From e219db3ee1b4642e1eef387cd7b759acbbe2f5fe Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Tue, 15 Dec 2015 11:48:11 +0800 Subject: [PATCH 0001/1469] Translating by ZTinoZ --- ...lla with Apache and SSL on FreeBSD 10.2.md | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/sources/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md b/sources/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md index 2b543d3444..e3c14d4a92 100644 --- a/sources/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md +++ b/sources/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md @@ -1,16 +1,15 @@ -Translating by ZTinoZ -How to Install Bugzilla with Apache and SSL on FreeBSD 10.2 +如何在FreeBSD 10.2上配置Apache和SSL并安装Bugzilla ================================================================================ Bugzilla is open source web base application for bug tracker and testing tool, develop by mozilla project, and licensed under Mozilla Public License. It is used by high tech company like mozilla, redhat and gnome. Bugzilla was originally created by Terry Weissman in 1998. It written in perl, use MySQL as the database back-end. It is a server software designed to help you manage software development. Bugzilla has a lot of features, optimized database, excellent security, advanced search tool, integrated with email capabilities etc. -In this tutorial we will install bugzilla 5.0 with apache for the web server, and enable SSL for it. Then install mysql51 as the database system on freebsd 10.2. +在本教程中,我们将给web服务器安装bugzilla 5.0的apache并为它启用SSL,然后在freebsd 10.2上安装mysql51来作为数据库系统。 -#### Prerequisite #### +#### 准备 #### FreeBSD 10.2 - 64bit. Root privileges. -### Step 1 - Update System ### +### 第一步 - 更新系统 ### Log in to the freebsd server with ssl login, and update the repository database : @@ -18,7 +17,7 @@ Log in to the freebsd server with ssl login, and update the repository database freebsd-update fetch freebsd-update install -### Step 2 - Install and Configure Apache ### +### 第二步 - 安装并配置Apache ### In this step we will install apache from the freebsd repositories with pkg command. Then configure apache by editing file "httpd.conf" on apache24 directory, configure apache to use SSL, and CGI support. @@ -76,7 +75,7 @@ And before start apache, add it to start at boot time with sysrc command : sysrc apache24_enable=yes service apache24 start -### Step 3 - Install and Configure MySQL Database ### +### 第三步 - 安装并配置MySQL数据库 ### We will use mysql51 for the database back-end, and it is support for perl module for mysql. Install mysql51 with pkg command below : @@ -129,7 +128,7 @@ Next, generate the certificate file with openssl command, then change the permis sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /usr/local/etc/apache24/ssl/bugzilla.key -out /usr/local/etc/apache24/ssl/bugzilla.crt chmod 600 * -### Step 5 - Configure Virtualhost ### +### 第五步 - 配置虚拟主机 ### We will install bugzilla on directory "/usr/local/www/bugzilla", so we must create new virtualhost configuration for it. @@ -193,7 +192,7 @@ Now test the apache configuration with "apachectl" command and restart it : apachectl configtest service apache24 restart -### Step 6 - Install Bugzilla ### +### 第六步 - 安装Bugzilla ### We can install bugzilla manually by downloading the source, or install it from freebsd repository. In this step we will install bugzilla from freebsd repository with pkg command : @@ -251,7 +250,7 @@ Bugzilla admin panel. ![Bugzilla Admin Page](http://blog.linoxide.com/wp-content/uploads/2015/12/Bugzilla-Admin-Page.png) -### Conclusion ### +### 结论 ### Bugzilla is web based application help you to manage the software development. It is written in perl and use MySQL as the database system. Bugzilla used by mozilla, redhat, gnome etc for help their software development. Bugzilla has a lot of features and easy to configure and install. @@ -260,7 +259,7 @@ Bugzilla is web based application help you to manage the software development. I via: http://linoxide.com/tools/install-bugzilla-apache-ssl-freebsd-10-2/ 作者:[Arul][a] -译者:[译者ID](https://github.com/译者ID) +译者:[ZTinoZ](https://github.com/ZTinoZ) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b455cc65a1528fcd4a11c424336b066c45f8c0fc Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Wed, 16 Dec 2015 16:20:34 +0800 Subject: [PATCH 0002/1469] Translating by ZTinoZ --- ... Install Bugzilla with Apache and SSL on FreeBSD 10.2.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sources/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md b/sources/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md index e3c14d4a92..37b7819959 100644 --- a/sources/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md +++ b/sources/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md @@ -1,13 +1,13 @@ 如何在FreeBSD 10.2上配置Apache和SSL并安装Bugzilla ================================================================================ -Bugzilla is open source web base application for bug tracker and testing tool, develop by mozilla project, and licensed under Mozilla Public License. It is used by high tech company like mozilla, redhat and gnome. Bugzilla was originally created by Terry Weissman in 1998. It written in perl, use MySQL as the database back-end. It is a server software designed to help you manage software development. Bugzilla has a lot of features, optimized database, excellent security, advanced search tool, integrated with email capabilities etc. +Bugzilla是一款bug跟踪系统和测试工具,它基于web且开源,由mozilla计划开发并由Mozilla公共许可证授权。它经常被一些高科技公司如mozilla、红帽公司和gnome使用。Bugzilla起初由Terry Weissman在1998年创立,它用perl语言编写,用MySQL作为后端数据库。它是一款旨在帮助管理软件开发的服务器软件,它功能丰富、高优化度的数据库、卓越的安全性、高级的搜索工具、整合邮件功能等等。 在本教程中,我们将给web服务器安装bugzilla 5.0的apache并为它启用SSL,然后在freebsd 10.2上安装mysql51来作为数据库系统。 #### 准备 #### - FreeBSD 10.2 - 64bit. - Root privileges. + FreeBSD 10.2 - 64位 + Root权限 ### 第一步 - 更新系统 ### From 5d7b2118e92181aa272a178a1bba8d2608e31239 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Thu, 17 Dec 2015 11:19:44 +0800 Subject: [PATCH 0003/1469] Translating by ZTinoZ --- ...lla with Apache and SSL on FreeBSD 10.2.md | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/sources/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md b/sources/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md index 37b7819959..11c35382b7 100644 --- a/sources/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md +++ b/sources/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md @@ -2,7 +2,7 @@ ================================================================================ Bugzilla是一款bug跟踪系统和测试工具,它基于web且开源,由mozilla计划开发并由Mozilla公共许可证授权。它经常被一些高科技公司如mozilla、红帽公司和gnome使用。Bugzilla起初由Terry Weissman在1998年创立,它用perl语言编写,用MySQL作为后端数据库。它是一款旨在帮助管理软件开发的服务器软件,它功能丰富、高优化度的数据库、卓越的安全性、高级的搜索工具、整合邮件功能等等。 -在本教程中,我们将给web服务器安装bugzilla 5.0的apache并为它启用SSL,然后在freebsd 10.2上安装mysql51来作为数据库系统。 +在本教程中,我们将给web服务器安装bugzilla 5.0的apache并为它启用SSL,然后在freebsd 10.2上安装mysql 5.1来作为数据库系统。 #### 准备 #### @@ -11,7 +11,7 @@ Bugzilla是一款bug跟踪系统和测试工具,它基于web且开源,由moz ### 第一步 - 更新系统 ### -Log in to the freebsd server with ssl login, and update the repository database : +用ssl登录freebsd服务器,并更新库: sudo su freebsd-update fetch @@ -19,58 +19,58 @@ Log in to the freebsd server with ssl login, and update the repository database ### 第二步 - 安装并配置Apache ### -In this step we will install apache from the freebsd repositories with pkg command. Then configure apache by editing file "httpd.conf" on apache24 directory, configure apache to use SSL, and CGI support. +在这一步我们将从freebsd库中用pkg命令安装apache,然后在apache24目录下编辑"httpd.conf"文件,启用SSL和CGI支持。 -Install apache with pkg command : +用pkg命令安装apache: pkg install apache24 -Go to the apache directory and edit the file "httpd.conf" with nanao editor : +进入apache目录并用nano编辑器编辑"httpd.conf"文件: cd /usr/local/etc/apache24 nano -c httpd.conf -Uncomment the list line below : +反注释掉下面列出的行: - #Line 70 + #第70行 LoadModule authn_socache_module libexec/apache24/mod_authn_socache.so - #Line 89 + #第89行 LoadModule socache_shmcb_module libexec/apache24/mod_socache_shmcb.so - # Line 117 + #第117行 LoadModule expires_module libexec/apache24/mod_expires.so - #Line 141 to enabling SSL + #第141行,启用SSL LoadModule ssl_module libexec/apache24/mod_ssl.so - # Line 162 for cgi support + #第162行,支持cgi LoadModule cgi_module libexec/apache24/mod_cgi.so - # Line 174 to enable mod_rewrite + #第174行,启用mod_rewrite LoadModule rewrite_module libexec/apache24/mod_rewrite.so - # Line 219 for the servername configuration + #第219行,服务器名配置 ServerName 127.0.0.1:80 -Save and exit. +保存并退出。 -Next, we need to install mod perl from freebsd repository, and then enable it : +接着,我们需要从freebsd库中安装mod perl,并启用它: pkg install ap24-mod_perl2 -To enable mod_perl, edit httpd.conf and add to the "Loadmodule" line below : +启用mod_perl,编辑"httpd.conf"文件并添加"Loadmodule"行: nano -c httpd.conf -Add line below : +添加该行: - # Line 175 + #第175行 LoadModule perl_module libexec/apache24/mod_perl.so -Save and exit. +保存并退出。 -And before start apache, add it to start at boot time with sysrc command : +在启用apache之前,用sysrc命令添加以下行来在引导的时候启动: sysrc apache24_enable=yes service apache24 start From 16a3c4212533dfe2d1969f84b5a48fe4f4fa161c Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 19 Dec 2015 23:49:02 +0800 Subject: [PATCH 0004/1469] translating by Ezio --- ...o Setup Drone - a Continuous Integration Service in Linux.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md b/sources/tech/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md index bfcf1e3ae3..8f63bdd5fc 100644 --- a/sources/tech/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md +++ b/sources/tech/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md @@ -1,3 +1,5 @@ +translating by Ezio + How to Setup Drone - a Continuous Integration Service in Linux ============================================================== From 8f8dcb4e6fb6b62791d227192f3f5ec6f3d5a011 Mon Sep 17 00:00:00 2001 From: taichirain Date: Mon, 21 Dec 2015 20:14:01 +0800 Subject: [PATCH 0005/1469] first commit --- ...onfigure Apache Solr on Ubuntu 14 or 15.md | 38 ++++++++++++++----- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/sources/tech/20151123 How to Configure Apache Solr on Ubuntu 14 or 15.md b/sources/tech/20151123 How to Configure Apache Solr on Ubuntu 14 or 15.md index 8033292f5f..0353702dc9 100644 --- a/sources/tech/20151123 How to Configure Apache Solr on Ubuntu 14 or 15.md +++ b/sources/tech/20151123 How to Configure Apache Solr on Ubuntu 14 or 15.md @@ -1,30 +1,35 @@ taichirain 翻译中 How to Configure Apache Solr on Ubuntu 14 / 15 +如何在Ubuntu 14/15上配置Apache Solr ================================================================================ Hello and welcome to our today's article on Apache Solr. The brief description about Apache Solr is that it is an Open Source most famous search platform with Apache Lucene at the back end for Web sites that enables you to easily create search engines which searches websites, databases and files. It can index and search multiple sites and return recommendations for related contents based on the searched text. Solr works with HTTP Extensible Markup Language (XML) that offers application program interfaces (APIs) for Javascript Object Notation, Python, and Ruby. According to the Apache Lucene Project, Solr offers capabilities that have made it popular with administrators including it many featuring like: -- Full Text Search -- Faceted Navigation +- 全文检索 +- 分面导航 - Snippet generation/highting -- Spell Suggestion/Auto complete +- 拼写建议/自动完成 - Custom document ranking/ordering +- 自定义文档排序/排列 -#### Prerequisites: #### +#### 前提条件: #### On a fresh Linux Ubuntu 14/15 with minimal packages installed, you only have to take care of few prerequisites in order to install Apache Solr. +在一个以最小化安装包安装的linux Ubuntu 14/15的系统上,你仅仅需要少量的准备,就可以开始安装 Apache Solor. -### 1)System Update ### +### 1)System Update 系统更新### Login to your Ubuntu server with a non-root sudo user that will be used to perform all the steps to install and use Solr. +在所有的安装步骤以及使用Solor过程中使用一个具有sudo权限的非root用户登录Ubuntu server After successful login, issue the following command to update your system with latest updates and patches. +登录成功后,使用下面的命令,升级你的系统到最新的更新及补丁 $ sudo apt-get update -### 2) JRE Setup ### +### 2) JRE Setup 安装JRE### The Solr setup needs Java Runtime Environment to be installed on the system as its basic requirement because solr and tomcat both are the Java based applications. So, we need to install and configure its home environment with latest Java. @@ -37,6 +42,7 @@ Upon completion, run the setup its the repository for the latest version of Java $ sudo add-apt-repository ppa:webupd8team/java Now you are able to install the latest version of Oracle Java 8 with 'wget' by issuing the below commands to update the packages source list and then to install Java. +使用下面的命令升级源列表,然后安装java,然后你就可以使用'wget'安装Oracle Jave 8的最新版本 $ sudo apt-get update @@ -45,8 +51,10 @@ Now you are able to install the latest version of Oracle Java 8 with 'wget' by i $ sudo apt-get install oracle-java8-installer Accept the Oracle Binary Code License Agreement for the Java SE Platform Products and JavaFX as you will be asked during the Java installation and configuration process by a click on the 'OK' button. +在安装和配置Java SE Platform 和 JavaFX 过程中点击'OK'按钮,接受 Oracle Binary Code License Agreement 协议. When the installation process complete, run the below command to test the successful installation of Java and check its version. +在安装完成后,运行下面的命令,检查是否安装成功以及安装的版本 kash@solr:~$ java -version java version "1.8.0_66" @@ -54,32 +62,38 @@ When the installation process complete, run the below command to test the succes Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode) The output indicates that we have successfully fulfilled the basic requirement of Solr by installing the Java. Now move to the next step to install Solr. +执行结果表明我们已经成功的安装了Java,并达到安装Solr最基本的要求了 -### Installing Solr ### +### Installing Solr 安装Solr### Installing Solr on Ubuntu can be done by using two different ways but in this article we prefer to install its latest package from the source. +有两种不同的方式可以在Ubuntu上安装Solr,在本文中,只会用最新的源码包来演示源码安装 To install Solr from its source, download its available package with latest version from there Official [Web Page][1], copy the link address and get it using 'wget' command. +要使用源码安装Solr,先要从官网 [Web Page][1] 下载最新的可用安装包。复制一下链接,然后使用 'wget'命令来下载。 $ wget http://www.us.apache.org/dist/lucene/solr/5.3.1/solr-5.3.1.tgz Run the command below to extract the archived service into '/bin' folder. +运行下面的命令,将归档服务解压到 /bin目录 $ tar -xzf solr-5.3.1.tgz solr-5.3.1/bin/install_solr_service.sh --strip-components=2 Then run the script to start Solr service that will creates a new 'solr' user and then installs solr as a service. +运行脚本来启动Solr服务:将会先创建一个solr的用户,然后将Solr安装成服务 $ sudo bash ./install_solr_service.sh solr-5.3.1.tgz ![Solr Installation](http://blog.linoxide.com/wp-content/uploads/2015/11/12.png) To check the status of Solr service, you use the below command. +使用下面的命令来检查Solr服务的状态 $ service solr status ![Solr Status](http://blog.linoxide.com/wp-content/uploads/2015/11/22.png) -### Creating Solr Collection: ### +### Creating Solr Collection: 创建Solr集合: ### Now we can create multiple collections using Solr user. To do so just run the below command by mentioning the name of the collection you want to create and by specifying its configuration set as shown. @@ -88,16 +102,20 @@ Now we can create multiple collections using Solr user. To do so just run the be ![creating collection](http://blog.linoxide.com/wp-content/uploads/2015/11/32.png) We have successfully created the new core instance directory for our our first collection where we can add new data in it. To view its default schema file in directory '/opt/solr/server/solr/configsets/data_driven_schema_configs/conf' . +我们已经成功的为我们的第一个集合创建了新的内核实例目录,并可以将数据添加到那里。 +它的概要文件在 '/opt/solr/server/solr/configsets/data_driven_schema_configs/conf' -### Using Solr Web ### +### Using Solr Web 使用Solr页面### Apache Solr can be accessible on the default port of Solr that 8983. Open your favorite browser and navigate to http://your_server_ip:8983/solr or http://your-domain.com:8983/solr. Make sure that the port is allowed in your firewall. +Apache Solr可以使用默认的端口8983进入.打开浏览器,输入 http://your_server_ip:8983/solr 或者 http://your-domain.com:8983/solr. 确保你的防火墙允许8983端口. http://172.25.10.171:8983/solr/ ![Solr Web Access](http://blog.linoxide.com/wp-content/uploads/2015/11/42.png) From the Solr Web Console click on the 'Core Admin' button from the left bar, then you will see your first collection that we created earlier using CLI. While you can also create new cores by pointing on the 'Add Core' button. +在Solr的Web控制台的左侧菜单点击'Core Admin'按钮,你将会看见我们之前使用CLI方式创建的集合。你可以点击'Add Core'按钮来创建新的内核 ![Adding Core](http://blog.linoxide.com/wp-content/uploads/2015/11/52.png) @@ -117,7 +135,7 @@ After adding the document click on the 'Submit Document' button. ![adding Document](http://blog.linoxide.com/wp-content/uploads/2015/11/62.png) -### Conclusion ### +### Conclusion 总结### You are now able to insert and query data using the Solr web interface after its successful installation on Ubuntu. Now add more collections and insert you own data and documents that you wish to put and manage through Solr. We hope you have got this article much helpful and enjoyed reading this. From 93f6f7bb9eebe77e4aab0244791b973cd6363c23 Mon Sep 17 00:00:00 2001 From: alim0x Date: Tue, 22 Dec 2015 10:35:59 +0800 Subject: [PATCH 0006/1469] [translating]22 - The history of Android --- .../The history of Android/22 - The history of Android.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sources/talk/The history of Android/22 - The history of Android.md b/sources/talk/The history of Android/22 - The history of Android.md index 79cf7bd2a5..fab3d8c087 100644 --- a/sources/talk/The history of Android/22 - The history of Android.md +++ b/sources/talk/The history of Android/22 - The history of Android.md @@ -1,8 +1,10 @@ +alim0x translating + The history of Android ================================================================================ ### Android 4.2, Jelly Bean—new Nexus devices, new tablet interface ### -The Android Platform was rapidly maturing, and with Google hosting more and more apps in the Play Store, there was less and less that needed to go out in the OS update. Still, the relentless march of updates must continue, and in November 2012 Android 4.2 was released. 4.2 was still called "Jelly Bean," a nod to the relatively small amount of changes that were present in this release. +The Android Platform was rapidly maturing, and with Google hosting more and more apps in the Play Store, there was less and less that needed to go out in the OS update. Still, the relentless march of updates must continue, and in November 2012 Android 4.2 was released. 4.2 was still called "Jelly Bean," a nod to the relatively small amount of changes that were present in this release. ![The LG-made Nexus 4 and Samsung-made Nexus 10.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/unnamed.jpg) The LG-made Nexus 4 and Samsung-made Nexus 10. @@ -81,4 +83,4 @@ via: http://arstechnica.com/gadgets/2014/06/building-android-a-40000-word-histor [1]:http://arstechnica.com/gadgets/2014/01/hands-on-with-samsungs-notepro-and-tabpro-new-screen-sizes-and-magazine-ui/ [2]:http://cdn.arstechnica.net/wp-content/uploads/2013/12/device-2013-12-26-11016071.png [a]:http://arstechnica.com/author/ronamadeo -[t]:https://twitter.com/RonAmadeo \ No newline at end of file +[t]:https://twitter.com/RonAmadeo From d76e3d2eabd459ab1a0ca42f17f9df6ed32ef579 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Tue, 22 Dec 2015 17:12:41 +0800 Subject: [PATCH 0007/1469] Translating by ZTinoZ --- ...all Bugzilla with Apache and SSL on FreeBSD 10.2.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sources/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md b/sources/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md index 11c35382b7..87aa5e1ef8 100644 --- a/sources/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md +++ b/sources/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md @@ -77,21 +77,21 @@ Bugzilla是一款bug跟踪系统和测试工具,它基于web且开源,由moz ### 第三步 - 安装并配置MySQL数据库 ### -We will use mysql51 for the database back-end, and it is support for perl module for mysql. Install mysql51 with pkg command below : +我们要用mysql 5.1来作为后端数据库并且支持perl模块。用pkg命令安装mysql 5.1: pkg install p5-DBD-mysql51 mysql51-server mysql51-client -Now we must add mysql to the boot time, and then start and configure the root password for mysql. +现在我们要在启动时添加mysql服务并启动,然后为mysql配置root密码。 -Run command below to do it all : +运行以下命令来完成所有操作: sysrc mysql_enable=yes service mysql-server start mysqladmin -u root password aqwe123 -Note : +注意: -mysql password : aqwe123 +这里mysql密码为:aqwe123 ![Configure MySQL Password](http://blog.linoxide.com/wp-content/uploads/2015/12/Configure-MySQL-Password.png) From 874f7a9f6acb14f072c29942e9e6f10b38298b97 Mon Sep 17 00:00:00 2001 From: Feng Wei Date: Tue, 22 Dec 2015 20:50:02 +0800 Subject: [PATCH 0008/1469] Update 20151104 Optimize Web Delivery with these Open Source Tools.md --- ...51104 Optimize Web Delivery with these Open Source Tools.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/share/20151104 Optimize Web Delivery with these Open Source Tools.md b/sources/share/20151104 Optimize Web Delivery with these Open Source Tools.md index aaf8a7292d..3d1137f5bf 100644 --- a/sources/share/20151104 Optimize Web Delivery with these Open Source Tools.md +++ b/sources/share/20151104 Optimize Web Delivery with these Open Source Tools.md @@ -1,3 +1,4 @@ +translating by fw8899 Optimize Web Delivery with these Open Source Tools ================================================================================ Web proxy software forwards HTTP requests without modifying traffic in any way. They can be configured as a transparent proxy with no client-side configuration required. They can also be used as a reverse proxy front-end to websites; here the cache serves an unlimited number of clients for one or some web servers. @@ -192,4 +193,4 @@ via: http://www.linuxlinks.com/article/20151101020309690/WebDelivery.html [2]:http://www.privoxy.org/ [3]:https://www.varnish-cache.org/ [4]:http://www.pps.univ-paris-diderot.fr/%7Ejch/software/polipo/ -[5]:https://banu.com/tinyproxy/ \ No newline at end of file +[5]:https://banu.com/tinyproxy/ From acc710338f47a470d172d579e9454a43700248f3 Mon Sep 17 00:00:00 2001 From: GHLandy Date: Tue, 22 Dec 2015 21:52:48 +0800 Subject: [PATCH 0009/1469] [Translating] Part 2 - LFCS: How to Install and Use vi/vim as a Full Text Editor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 认领翻译 --- ...-How to Install and Use vi or vim as a Full Text Editor.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 7fe8073a77..23e1b30f57 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 @@ +GHLandy Translating + 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. @@ -384,4 +386,4 @@ via: http://www.tecmint.com/vi-editor-usage/ [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 +[3]:https://identity.linuxfoundation.org/user?destination=pid/1 From f2fdb7203d562fa7db451dc889932737d0e6bfa1 Mon Sep 17 00:00:00 2001 From: sonofelice Date: Tue, 22 Dec 2015 22:48:36 +0800 Subject: [PATCH 0010/1469] translating --- ...uration File Directives Uncommented Lines of a Config File.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 7--Linux or UNIX View Only Configuration File Directives Uncommented Lines of a Config File.md b/sources/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 7--Linux or UNIX View Only Configuration File Directives Uncommented Lines of a Config File.md index d7d520326e..27bf39c2b3 100644 --- a/sources/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 7--Linux or UNIX View Only Configuration File Directives Uncommented Lines of a Config File.md +++ b/sources/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 7--Linux or UNIX View Only Configuration File Directives Uncommented Lines of a Config File.md @@ -1,3 +1,4 @@ +translating by sonofelice Linux / UNIX View Only Configuration File Directives ( Uncommented Lines of a Config File ) ================================================================================ Most Linux and UNIX-like system configuration files are documented using comments, but some time I just need to see line of configuration text in a config file. How can I view just the uncommented configuration file directives from squid.conf or httpd.conf file? How can I strip out comments and blank lines on a Linux or Unix-like systems? From c9f4791155b8d093bee8466abd0b2f84dd55da08 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 22 Dec 2015 23:36:32 +0800 Subject: [PATCH 0011/1469] PUB:20151215 How to enable Software Collections (SCL) on CentOS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @bianjp 翻译的不错!明早就发布出来了,请关注: https://linux.cn/ --- ...le Software Collections (SCL) on CentOS.md | 100 +++++++++++++++++ ...le Software Collections (SCL) on CentOS.md | 106 ------------------ 2 files changed, 100 insertions(+), 106 deletions(-) create mode 100644 published/20151215 How to enable Software Collections (SCL) on CentOS.md delete mode 100644 translated/tech/20151215 How to enable Software Collections (SCL) on CentOS.md diff --git a/published/20151215 How to enable Software Collections (SCL) on CentOS.md b/published/20151215 How to enable Software Collections (SCL) on CentOS.md new file mode 100644 index 0000000000..2c0b835026 --- /dev/null +++ b/published/20151215 How to enable Software Collections (SCL) on CentOS.md @@ -0,0 +1,100 @@ +如何在 CentOS 上启用 软件集 Software Collections(SCL) +================================================================================ + +红帽企业版 linux(RHEL)和它的社区版分支——CentOS,提供10年的生命周期,这意味着 RHEL/CentOS 的每个版本会提供长达10年的安全更新。虽然这么长的生命周期为企业用户提供了迫切需要的系统兼容性和可靠性,但也存在一个缺点:随着底层的 RHEL/CentOS 版本接近生命周期的结束,核心应用和运行时环境变得陈旧过时。例如 CentOS 6.5,它的生命周期结束时间是2020年11月30日,其所携带的 Python 2.6.6和 MySQL 5.1.73,以今天的标准来看已经非常古老了。 + +另一方面,在 RHEL/CentOS 上试图手动升级开发工具链和运行时环境存在使系统崩溃的潜在可能,除非所有依赖都被正确解决。通常情况下,手动升级都是不推荐的,除非你知道你在干什么。 + +[软件集(Software Collections)][1](SCL)源出现了,以帮助解决 RHEL/CentOS 下的这种问题。SCL 的创建就是为了给 RHEL/CentOS 用户提供一种以方便、安全地安装和使用应用程序和运行时环境的多个(而且可能是更新的)版本的方式,同时避免把系统搞乱。与之相对的是第三方源,它们可能会在已安装的包之间引起冲突。 + +最新的 SCL 提供了: + +- Python 3.3 和 2.7 +- PHP 5.4 +- Node.js 0.10 +- Ruby 1.9.3 +- Perl 5.16.3 +- MariaDB 和 MySQL 5.5 +- Apache httpd 2.4.6 + +在这篇教程的剩余部分,我会展示一下如何配置 SCL 源,以及如何安装和启用 SCL 中的包。 + +### 配置 SCL 源 + +SCL 可用于 CentOS 6.5 及更新的版本。要配置 SCL 源,只需执行: + + $ sudo yum install centos-release-SCL + +要启用和运行 SCL 中的应用,你还需要安装下列包: + + $ sudo yum install scl-utils-build + +执行下面的命令可以查看 SCL 中可用包的完整列表: + + $ yum --disablerepo="*" --enablerepo="scl" list available + +![](https://c2.staticflickr.com/6/5730/23304424250_f5c8a09584_c.jpg) + +### 从 SCL 中安装和启用包 + +既然你已配置好了 SCL,你可以继续并从 SCL 中安装包了。 + +你可以搜索 SCL 中的包: + + $ yum --disablerepo="*" --enablerepo="scl" search + +我们假设你要安装 Python 3.3。 + +继续,就像通常安装包那样使用 yum 安装: + + $ sudo yum install python33 + +任何时候你都可以查看从 SCL 中安装的包的列表,只需执行: + + $ scl --list + + python33 + +SCL 的优点之一是安装其中的包不会覆盖任何系统文件,并且保证不会引起与系统中其它库和应用的冲突。 + +例如,如果在安装 python33 包后检查默认的 python 版本,你会发现默认的版本并没有改变: + + $ python --version + + Python 2.6.6 + +如果想使用一个已经安装的 SCL 包,你需要在每个命令中使用 `scl` 命令显式启用它(LCTT 译注:即想在哪条命令中使用 SCL 中的包,就得通过`scl`命令执行该命令) + + $ scl enable + +例如,要针对`python`命令启用 python33 包: + + $ scl enable python33 'python --version' + + Python 3.3.2 + +如果想在启用 python33 包时执行多条命令,你可以像下面那样创建一个启用 SCL 的 bash 会话: + + $ scl enable python33 bash + +在这个 bash 会话中,默认的 python 会被切换为3.3版本,直到你输入`exit`,退出会话。 + +![](https://c2.staticflickr.com/6/5642/23491549632_1d08e163cc_c.jpg) + +简而言之,SCL 有几分像 Python 的虚拟环境,但更通用,因为你可以为远比 Python 更多的应用启用/禁用 SCL 会话。 + +更详细的 SCL 指南,参考官方的[快速入门指南][2] + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/enable-software-collections-centos.html + +作者:[Dan Nanni][a] +译者:[bianjp](https://github.com/bianjp) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/nanni +[1]:https://www.softwarecollections.org/ +[2]:https://www.softwarecollections.org/docs/ diff --git a/translated/tech/20151215 How to enable Software Collections (SCL) on CentOS.md b/translated/tech/20151215 How to enable Software Collections (SCL) on CentOS.md deleted file mode 100644 index 8567f69176..0000000000 --- a/translated/tech/20151215 How to enable Software Collections (SCL) on CentOS.md +++ /dev/null @@ -1,106 +0,0 @@ -如何在CentOS上启用Software Collections(SCL) -================================================================================ - -红帽企业版linux(RHEL)和它的社区版分支——CentOS,提供10年的生命周期,这意味着RHEL/CentOS的每个版本会提供长达10年的安全更新。虽然这么长的生命周期为企业用户提供了更需要的系统兼容性和可靠性,但也存在一个缺点:随着底层的RHEL/CentOS版本接近生命周期的结束,核心应用和运行时环境变得陈旧过时。例如CentOS 6.5,它的生命周期结束时间是2020年11月30日,携带Python 2.6.6和MySQL 5.1.73,以今天的标准来看已经非常古老了。 - -另一方面,在RHEL/CentOS上试图手动升级开发工具链和运行时环境存在潜在的可能使系统崩溃,除非所有依赖都被正确解决。通常情况下,手动升级都是不推荐的,除非你知道你在干什么。 - -[Software Collections][1](SCL)源出现了,以帮助解决RHEL/CentOS下的这种问题。SCL的创建就是为了给RHEL/CentOS用户提供一种方式以方便、安全地安装和使用应用程序和运行时环境的多个(而且可能更新的)版本,同时避免把系统搞乱。与之相对的是第三方源,它们可能会在已安装的包之间引起冲突。 - -最新的SCL提供: - -- Python 3.3 和 2.7 -- PHP 5.4 -- Node.js 0.10 -- Ruby 1.9.3 -- Perl 5.16.3 -- MariaDB 和 MySQL 5.5 -- Apache httpd 2.4.6 - -在这篇教程的剩余部分,我会展示一下如何配置SCL源,以及如何安装和启用SCL中的包。 - -### 配置SCL源 - -SCL可用于CentOS 6.5及更新的版本。要配置SCL源,只需执行: - - $ sudo yum install centos-release-SCL - -要启用和运行SCL中的应用,你还需要安装下列包: - - $ sudo yum install scl-utils-build - -执行下面的命令可以查看SCL中可用包的完整列表: - - $ yum --disablerepo="*" --enablerepo="scl" list available - -![](https://c2.staticflickr.com/6/5730/23304424250_f5c8a09584_c.jpg) - -### 从SCL中安装和启用包 - -既然你已配置好了SCL,你可以继续并从SCL中安装包了。 - -你可以搜索SCL中的包: - - $ yum --disablerepo="*" --enablerepo="scl" search - -我们假设你要安装Python 3.3。 - -继续,就像通常安装包那样使用yum安装: - - $ sudo yum install python33 - -任何时候你都可以查看从SCL中安装的包的列表,只需执行: - - $ scl --list - ----------- - - python33 - -SCL的优点之一是安装其中的包不会覆盖任何系统文件,并且保证了不会引起系统中其它库和应用的冲突。 - -例如,若果在安装python33包后检查默认的python版本,你会发现默认的版本并没有改变: - - $ python --version - ----------- - - Python 2.6.6 - -如果想使用一个已经安装的SCL包,你需要在每个命令中使用scl命令显式启用它(译注:即想在哪条命令中使用SCL中的包,就得通过scl命令执行该命令) - - $ scl enable - -例如,要针对python命令启用python33包: - - $ scl enable python33 'python --version' - ----------- - - Python 3.3.2 - -如果想在启用python33包时执行多条命令,你可以像下面那样创建一个启用SCL的bash会话: - - $ scl enable python33 bash - -在这个bash会话中,默认的python会被切换为3.3版本,直到你输入exit,退出会话。 - -![](https://c2.staticflickr.com/6/5642/23491549632_1d08e163cc_c.jpg) - -简而言之,SCL有几分像Python的虚拟环境,但更通用,因为你可以为远远更多的应用启用/禁用SCL会话,而不仅仅是Python。 - -更详细的SCL指南,参考官方的[快速入门指南][2] - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/enable-software-collections-centos.html - -作者:[Dan Nanni][a] -译者:[bianjp](https://github.com/bianjp) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://xmodulo.com/author/nanni -[1]:https://www.softwarecollections.org/ -[2]:https://www.softwarecollections.org/docs/ From 8ea4240d03f9e140239746c5343011fd3c5e3753 Mon Sep 17 00:00:00 2001 From: sonofelice Date: Tue, 22 Dec 2015 23:46:14 +0800 Subject: [PATCH 0012/1469] =?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 翻译完成 --- ...ives Uncommented Lines of a Config File.md | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) rename {sources => translated}/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 7--Linux or UNIX View Only Configuration File Directives Uncommented Lines of a Config File.md (68%) diff --git a/sources/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 7--Linux or UNIX View Only Configuration File Directives Uncommented Lines of a Config File.md b/translated/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 7--Linux or UNIX View Only Configuration File Directives Uncommented Lines of a Config File.md similarity index 68% rename from sources/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 7--Linux or UNIX View Only Configuration File Directives Uncommented Lines of a Config File.md rename to translated/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 7--Linux or UNIX View Only Configuration File Directives Uncommented Lines of a Config File.md index 27bf39c2b3..9de5e1d64d 100644 --- a/sources/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 7--Linux or UNIX View Only Configuration File Directives Uncommented Lines of a Config File.md +++ b/translated/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 7--Linux or UNIX View Only Configuration File Directives Uncommented Lines of a Config File.md @@ -1,18 +1,19 @@ -translating by sonofelice -Linux / UNIX View Only Configuration File Directives ( Uncommented Lines of a Config File ) -================================================================================ -Most Linux and UNIX-like system configuration files are documented using comments, but some time I just need to see line of configuration text in a config file. How can I view just the uncommented configuration file directives from squid.conf or httpd.conf file? How can I strip out comments and blank lines on a Linux or Unix-like systems? +Linux / UNIX 下只查看配置文件的有效配置行(配置文件中未被注释的命令行) +========================================================= -To view just the uncommented lines of text in a config file use the grep, sed, awk, perl or any other text processing utility provided by UNIX / BSD / OS X / Linux operating systems. +大多数的Linux和类Unix系统的配置文件中都有许多的注释行,但是有时候我只想看其中的有效配置行。那我怎么才能只看到quid.conf或httpd.conf这样的配置文件中的非注释命令行呢?怎么去掉这些注释或者空行呢? -### grep command example to strip out command ### +我们可以使用UNIX / BSD / OS X / Linux 这些操作系统自身提供的grep,sed,awk,perl或者其他文本处理工具来查看配置文件中的有效配置命令行。 -You can use the gerp command as follows: + +### grep 命令示例——去掉注释 ### + +可以按照如下示例使用grep命令: $ grep -v "^#" /path/to/config/file $ grep -v "^#" /etc/apache2/apache2.conf -Sample outputs: +示例输出: ServerRoot "/etc/apache2" @@ -99,7 +100,7 @@ Sample outputs: Include /etc/apache2/sites-enabled/ -To suppress blank lines use [egrep command][1], run: +想要跳过空行,可以使用 [egrep 命令][1], 示例: egrep -v "^#|^$" /etc/apache2/apache2.conf ## or pass it to the page such as more or less ## @@ -114,35 +115,34 @@ To suppress blank lines use [egrep command][1], run: [ -f "$1" ] && command egrep -v "^#|^$" "$f" || echo "Error $1 file not found." } -Sample output: +示例输出: ![Fig.01: Unix/Linux Egrep Strip Out Comments Blank Lines](http://s0.cyberciti.org/uploads/faq/2008/05/grep-strip-out-comments-blank-lines.jpg) -Fig.01: Unix/Linux Egrep Strip Out Comments Blank Lines +Fig.01: Unix/Linux Egrep 除去注释行和空行 -### Understanding grep/egrep command line options ### +### 理解 grep/egrep 命令行选项 ### -The -v option invert the sense of matching, to select non-matching lines. This option should work under all posix based systems. The regex ^$ matches and removes all blank lines and ^# matches and removes all comments that starts with a "#". +-v 选项,选择出不匹配的命令行。该选项适用于所有基于posix的系统。正则表达式 ^$ 匹配出所有的非空行, ^#匹配出所有的不以“#”开头的非注释行。 -### sed Command example ### +### sed 命令示例 ### -GNU / sed command can be used as follows: +可以按照如下示例使用 GNU / sed 命令: $ sed '/ *#/d; /^ *$/d' /path/to/file $ sed '/ *#/d; /^ *$/d' /etc/apache2/apache2.conf - -GNU or BSD sed can update your config file too. The syntax is as follows to edit files in-place, saving backups with the specified extension such as .bak: +GNU or BSD sed 也可以修改配置文件。下面的语法是编辑文件,修改扩展名(比如 .bak)进行文件备份: sed -i'.bak.2015.12.27' '/ *#/d; /^ *$/d' /etc/apache2/apache2.conf -For more info see man pages - [grep(1)][2], [sed(1)][3] +更多信息见参考手册 - [grep(1)][2], [sed(1)][3] -------------------------------------------------------------------------------- via: http://www.cyberciti.biz/faq/shell-display-uncommented-lines-only/ 作者:Vivek Gite -译者:[译者ID](https://github.com/译者ID) +译者:[sonofelice](https://github.com/sonofelice) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c148c7a8d9407f137320153b45615a4bf392512b Mon Sep 17 00:00:00 2001 From: bazz2 Date: Wed, 23 Dec 2015 08:19:50 +0800 Subject: [PATCH 0013/1469] [translating]Review EXT4 vs. Btrfs vs. XFS --- sources/share/20151204 Review EXT4 vs. Btrfs vs. XFS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/share/20151204 Review EXT4 vs. Btrfs vs. XFS.md b/sources/share/20151204 Review EXT4 vs. Btrfs vs. XFS.md index d370b87822..f6e40d4286 100644 --- a/sources/share/20151204 Review EXT4 vs. Btrfs vs. XFS.md +++ b/sources/share/20151204 Review EXT4 vs. Btrfs vs. XFS.md @@ -1,3 +1,4 @@ +bazz2222222222222222222222222222222222222222222 Review EXT4 vs. Btrfs vs. XFS ================================================================================ ![](http://1426826955.rsc.cdn77.org/wp-content/uploads/2015/09/1385698302_funny_linux_wallpapers-593x445.jpg) From b05214d1b383900dae93026b156f52c29e14ac14 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 23 Dec 2015 08:37:36 +0800 Subject: [PATCH 0014/1469] PUB:20151201 How to Install The Latest Arduino IDE 1.6.6 in Ubuntu @geekpi --- ... The Latest Arduino IDE 1.6.6 in Ubuntu.md | 73 +++++++++++++++++ ... The Latest Arduino IDE 1.6.6 in Ubuntu.md | 78 ------------------- 2 files changed, 73 insertions(+), 78 deletions(-) create mode 100644 published/20151201 How to Install The Latest Arduino IDE 1.6.6 in Ubuntu.md delete mode 100644 translated/tech/20151201 How to Install The Latest Arduino IDE 1.6.6 in Ubuntu.md diff --git a/published/20151201 How to Install The Latest Arduino IDE 1.6.6 in Ubuntu.md b/published/20151201 How to Install The Latest Arduino IDE 1.6.6 in Ubuntu.md new file mode 100644 index 0000000000..27160257ad --- /dev/null +++ b/published/20151201 How to Install The Latest Arduino IDE 1.6.6 in Ubuntu.md @@ -0,0 +1,73 @@ +如何在 Ubuntu 中安装最新的 Arduino IDE 1.6.6 +================================================================================ +![Install latest Arduino in Ubuntu](http://ubuntuhandbook.org/wp-content/uploads/2015/11/arduino-icon.png) + +> 本篇教程会教你如何在当前的 Ubuntu 发行版中安装最新的 Arduino IDE 1.6.6。 + +开源的 Arduino IDE 发布了1.6.6,并带来了很多的改变。新的发布已经切换到 Java 8,它与 IDE 绑定并且用于编译所需。具体见 [发布说明][1]。 + +![Arduino 1.6.6 in Ubuntu 15.10](http://ubuntuhandbook.org/wp-content/uploads/2015/11/arduino-ubuntu.jpg) + +对于那些不想使用软件中心的 1.0.5 旧版本的人而言,你可以使用下面的步骤在所有的 Ubuntu 发行版中安装 Arduino。 + +> **请用正确版本号替换软件包的版本号** + +**1、** 从下面的官方链接下载最新的包 **Linux 32-bit 或者 Linux 64-bit**。 + +- [https://www.arduino.cc/en/Main/Software][2] + +如果不知道你系统的类型?进入系统设置->详细->概览。 + +**2、** 从Unity Dash、App Launcher 或者使用 Ctrl+Alt+T 打开终端。打开后,一个个运行下面的命令: + +进入下载文件夹: + + cd ~/Downloads + +![navigate-downloads](http://ubuntuhandbook.org/wp-content/uploads/2015/11/navigate-downloads.jpg) + +使用 tar 命令解压: + + tar -xvf arduino-1.6.6-*.tar.xz + +![extract-archive](http://ubuntuhandbook.org/wp-content/uploads/2015/11/extract-archive.jpg) + +将解压后的文件移动到**/opt/**下: + + sudo mv arduino-1.6.6 /opt + +![move-opt](http://ubuntuhandbook.org/wp-content/uploads/2015/11/move-opt.jpg) + +**3、** 现在 IDE 已经与最新的 Java 绑定使用了。但是最好为程序设置一个桌面图标/启动方式: + +进入安装目录: + + cd /opt/arduino-1.6.6/ + +在这个目录给 install.sh 可执行权限 + + chmod +x install.sh + +最后运行脚本同时安装桌面快捷方式和启动图标: + + ./install.sh + +下图中我用“&&”同时运行这三个命令: + +![install-desktop-icon](http://ubuntuhandbook.org/wp-content/uploads/2015/11/install-desktop-icon.jpg) + +最后从 Unity Dash、程序启动器或者桌面快捷方式运行 Arduino IDE。 + +-------------------------------------------------------------------------------- + +via: http://ubuntuhandbook.org/index.php/2015/11/install-arduino-ide-1-6-6-ubuntu/ + +作者:[Ji m][a] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ubuntuhandbook.org/index.php/about/ +[1]:https://www.arduino.cc/en/Main/ReleaseNotes +[2]:https://www.arduino.cc/en/Main/Software diff --git a/translated/tech/20151201 How to Install The Latest Arduino IDE 1.6.6 in Ubuntu.md b/translated/tech/20151201 How to Install The Latest Arduino IDE 1.6.6 in Ubuntu.md deleted file mode 100644 index 668b9c3a80..0000000000 --- a/translated/tech/20151201 How to Install The Latest Arduino IDE 1.6.6 in Ubuntu.md +++ /dev/null @@ -1,78 +0,0 @@ -如何再Ubuntu中安装最新的Arduino IDE 1.6.6 -================================================================================ -![Install latest Arduino in Ubuntu](http://ubuntuhandbook.org/wp-content/uploads/2015/11/arduino-icon.png) - -> 本篇教程会教你如何在现在的Ubuntu发布版中安装最新的 Arduino IDE,目前的版本为1.6.6。 - -开源的Arduino IDE发布了1.6.6,并带来了很多的改变。新的发布已经切换到Java 8,它与IDE绑定并且再编译时需要它。具体见[RELEASE NOTE][1]。 - -![Arduino 1.6.6 in Ubuntu 15.10](http://ubuntuhandbook.org/wp-content/uploads/2015/11/arduino-ubuntu.jpg) - -对于那些不想使用软件中心的1.0.5旧版本的人而言,你可以使用下面的步骤再所有的Ubuntu发行版中安装Ardunino。 - -注:下面这个说明下面的代码颜色,这个发布的时候要对照一下原文,写点说明,因为颜色在md里标识不出来 -> **用红字替换将来的版本** - -**1.** Download the latest packages, **Linux 32-bit or Linux 64-bit**, from the official link below: -**1.** 从下面的官方链接下载最新的包 **Linux 32-bit 或者 Linux 64-bit**。 - -- [www.arduino.cc/en/Main/Software][2] - -不知道你系统的类型?进入系统设置->详细->概览。 - -**2.** 从Unity Dash、App Launcher或者Ctrl+Alt+T打开终端。打开后,一个个运行下面的命令: - -进入下载文件夹: - - cd ~/Downloads - -![navigate-downloads](http://ubuntuhandbook.org/wp-content/uploads/2015/11/navigate-downloads.jpg) - -使用tar命令解压 - -注:arduino-1.6.6-*.tar.xz 为红色部分 - tar -xvf arduino-1.6.6-*.tar.xz - -![extract-archive](http://ubuntuhandbook.org/wp-content/uploads/2015/11/extract-archive.jpg) - -将解压后的文件移动到**/opt/**下: - -注:arduino-1.6.6 为红色部分 - sudo mv arduino-1.6.6 /opt - -![move-opt](http://ubuntuhandbook.org/wp-content/uploads/2015/11/move-opt.jpg) - -**3.** 现在IDE已经与最新的Java绑定使用了。但是最好位程序设置一个桌面图标/启动方式: - -进入安装目录 - -注:arduino-1.6.6 为红色部分 - cd /opt/arduino-1.6.6/ - -在这个目录给install.sh可执行权限 - - chmod +x install.sh - -最后运行脚本同事安装桌面快捷方式和启动图标: - - ./install.sh - -下图中我用“&&”同事运行这三个命令: - -![install-desktop-icon](http://ubuntuhandbook.org/wp-content/uploads/2015/11/install-desktop-icon.jpg) - -最后从Unity Dash、程序启动器或者桌面快捷方式运行Arduino IDE。 - --------------------------------------------------------------------------------- - -via: http://ubuntuhandbook.org/index.php/2015/11/install-arduino-ide-1-6-6-ubuntu/ - -作者:[Ji m][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://ubuntuhandbook.org/index.php/about/ -[1]:https://www.arduino.cc/en/Main/ReleaseNotes -[2]:https://www.arduino.cc/en/Main/Software From 9bf82598140c99ddaedb276f1d1d3762e2c8874e Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 23 Dec 2015 08:38:01 +0800 Subject: [PATCH 0015/1469] PUB:20151215 Linux or Unix Desktop Fun--Cat And Mouse Chase All Over Your Screen @geekpi --- ...at And Mouse Chase All Over Your Screen.md | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) rename {translated/tech => published}/20151215 Linux or Unix Desktop Fun--Cat And Mouse Chase All Over Your Screen.md (72%) diff --git a/translated/tech/20151215 Linux or Unix Desktop Fun--Cat And Mouse Chase All Over Your Screen.md b/published/20151215 Linux or Unix Desktop Fun--Cat And Mouse Chase All Over Your Screen.md similarity index 72% rename from translated/tech/20151215 Linux or Unix Desktop Fun--Cat And Mouse Chase All Over Your Screen.md rename to published/20151215 Linux or Unix Desktop Fun--Cat And Mouse Chase All Over Your Screen.md index e08d21ae49..1994d7b797 100644 --- a/translated/tech/20151215 Linux or Unix Desktop Fun--Cat And Mouse Chase All Over Your Screen.md +++ b/published/20151215 Linux or Unix Desktop Fun--Cat And Mouse Chase All Over Your Screen.md @@ -1,6 +1,6 @@ -Linux/Unix桌面趣事:猫和老鼠在屏幕中追逐 +Linux/Unix桌面趣事:显示器里的猫和老鼠 ================================================================================ -Oneko是一个有趣的app。它会把你的光标变成一直老鼠,并在后面创建一个可爱的小猫,并且始终在老鼠光标后面追着。单词“neko”再日语中的意思是老鼠。它最初是作为Macintosh桌面附件由一位日本人开发的。 +Oneko 是一个有趣的应用。它会把你的光标变成一只老鼠,并在后面创建一个可爱的小猫,并且始终追逐着老鼠光标。单词“neko”在日语中的意思是老鼠。它最初是一位日本人开发的 Macintosh 桌面附件。 ### 安装 oneko ### @@ -29,19 +29,18 @@ Oneko是一个有趣的app。它会把你的光标变成一直老鼠,并在后 Setting up oneko (1.2.sakura.6-7) ... Processing triggers for menu ... -FreeBSD用户输入下面的命令安装oneko: +FreeBSD 用户输入下面的命令安装 oneko: # cd /usr/ports/games/oneko # make install clean -### 我该如何使用oneko? ### +### 我该如何使用 oneko? ### -Simply type the following command: 输入下面的命令: $ oneko -你可以把猫变成“tora-neko”,一只像白老虎条纹的猫: +你可以把猫变成 “tora-neko”,一只像白老虎条纹的猫: $ oneko -tora @@ -66,19 +65,18 @@ Simply type the following command: 注:youtube 视频 -(Video.01: 示例 - 在Linux下安装和使用oneko) +(Video.01: 示例 - 在 Linux 下安装和使用 oneko) ### 其他选项 ### -You can pass the following options: 你可以传入下面的选项 -1.**-tofocus**:让猫再聚焦的窗口顶部奔跑。当聚焦的窗口不在视野中时,猫像平常那样追逐老鼠。 +1. **-tofocus**:让猫在获得焦点的窗口顶部奔跑。当获得焦点的窗口不在视野中时,猫像平常那样追逐老鼠。 2. **-position 坐标** :指定X和Y来调整猫相对老鼠的位置 3. **-rv**:将前景色和背景色对调 4. **-fg 颜色** : 前景色 (比如 oneko -dog -fg red)。 5. **-bg 颜色** : 背景色 (比如 oneko -dog -bg green)。 -6. 查看oneko的手册获取更多信息。 +6. 查看 oneko 的手册获取更多信息。 -------------------------------------------------------------------------------- @@ -86,6 +84,6 @@ via: http://www.cyberciti.biz/open-source/oneko-app-creates-cute-cat-chasing-aro 作者:Vivek Gite 译者:[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 7d55d9a8053648ad273457bcb8fa1c0bb46a0519 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 23 Dec 2015 08:44:45 +0800 Subject: [PATCH 0016/1469] PUB:20151208 How to Customize Time and Date Format in Ubuntu Panel @alim0x --- ...ze Time and Date Format in Ubuntu Panel.md | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) rename {translated/tech => published}/20151208 How to Customize Time and Date Format in Ubuntu Panel.md (60%) diff --git a/translated/tech/20151208 How to Customize Time and Date Format in Ubuntu Panel.md b/published/20151208 How to Customize Time and Date Format in Ubuntu Panel.md similarity index 60% rename from translated/tech/20151208 How to Customize Time and Date Format in Ubuntu Panel.md rename to published/20151208 How to Customize Time and Date Format in Ubuntu Panel.md index 958dab2f18..4b20628048 100644 --- a/translated/tech/20151208 How to Customize Time and Date Format in Ubuntu Panel.md +++ b/published/20151208 How to Customize Time and Date Format in Ubuntu Panel.md @@ -1,14 +1,14 @@ -自定义Ubuntu面板时间日期显示格式 +如何深度定制 Ubuntu 面板的时间日期显示格式 ================================================================================ ![时间日期格式](http://ubuntuhandbook.org/wp-content/uploads/2015/08/ubuntu_tips1.png) -尽管设置里已经有一些选项可以用了,这个快速教程会向你展示如何更加深入地自定义 Ubuntu 面板上的时间和日期指示器。 +尽管设置页面里已经有一些选项可以用了,这个快速教程会向你展示如何更加深入地自定义 Ubuntu 面板上的时间和日期指示器。 ![自定义世间日期](http://ubuntuhandbook.org/wp-content/uploads/2015/12/custom-timedate.jpg) 在开始之前,在 Ubuntu 软件中心搜索并安装 **dconf Editor**。然后启动该软件并按以下步骤执行: -**1.** 当 dconf Editor 启动后,导航至 **com -> canonical -> indicator -> datetime**。将 **time-format** 的值设置为 **custom**。 +**1、** 当 dconf Editor 启动后,导航至 **com -> canonical -> indicator -> datetime**。将 **time-format** 的值设置为 **custom**。 ![自定义时间格式](http://ubuntuhandbook.org/wp-content/uploads/2015/12/time-format.jpg) @@ -16,11 +16,11 @@ gsettings set com.canonical.indicator.datetime time-format 'custom' -**2.** 现在你可以通过编辑 **custom-time-format** 的值来自定义时间和日期的格式。 +**2、** 现在你可以通过编辑 **custom-time-format** 的值来自定义时间和日期的格式。 ![自定义-时间格式](http://ubuntuhandbook.org/wp-content/uploads/2015/12/customize-timeformat.jpg) -你也可以通过命令完成:(译注:将 FORMAT_VALUE_HERE 替换为所需要的格式值) +你也可以通过命令完成:(LCTT 译注:将 FORMAT_VALUE_HERE 替换为所需要的格式值) gsettings set com.canonical.indicator.datetime custom-time-format 'FORMAT_VALUE_HERE' @@ -30,29 +30,28 @@ - %A = 星期名完整拼写 - %b = 月份名缩写 - %B = 月份名完整拼写 -- %d = 按月计日期 +- %d = 每月的日期 - %l = 小时 ( 1..12), %I = 小时 (01..12) - %k = 小时 ( 1..23), %H = 小时 (01..23) - %M = 分钟 (00..59) - %p = 午别,AM 或 PM, %P = am 或 pm. - %S = 秒 (00..59) -- 打开终端键入命令 `man date` 并执行以了解更多细节。 -一些例子: +可以打开终端键入命令 `man date` 并执行以了解更多细节。 -自定义时间日期显示格式值: +一些自定义时间日期显示格式值的例子: **%a %H:%M %m/%d/%Y** -![exam-1](http://ubuntuhandbook.org/wp-content/uploads/2015/12/exam-1.jpg) +![%a %H:%M %m/%d/%Y](http://ubuntuhandbook.org/wp-content/uploads/2015/12/exam-1.jpg) **%a %r %b %d or %a %I:%M:%S %p %b %d** -![exam-2](http://ubuntuhandbook.org/wp-content/uploads/2015/12/exam-2.jpg) +![%a %r %b %d or %a %I:%M:%S %p %b %d](http://ubuntuhandbook.org/wp-content/uploads/2015/12/exam-2.jpg) **%a %-d %b %l:%M %P %z** -![exam-3](http://ubuntuhandbook.org/wp-content/uploads/2015/12/exam-3.jpg) +![%a %-d %b %l:%M %P %z](http://ubuntuhandbook.org/wp-content/uploads/2015/12/exam-3.jpg) -------------------------------------------------------------------------------- @@ -60,7 +59,7 @@ via: http://ubuntuhandbook.org/index.php/2015/12/time-date-format-ubuntu-panel/ 作者:[Ji m][a] 译者:[alim0x](https://github.com/alim0x) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 40a30b579c10381389cf6b05279f8d52aeff765f Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 23 Dec 2015 09:17:15 +0800 Subject: [PATCH 0017/1469] PUB:20151030 How To Install FreeBSD on Raspberry Pi 2 Model B @strugglingyouth --- ...stall FreeBSD on Raspberry Pi 2 Model B.md | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) rename {translated/tech => published}/20151030 How To Install FreeBSD on Raspberry Pi 2 Model B.md (65%) diff --git a/translated/tech/20151030 How To Install FreeBSD on Raspberry Pi 2 Model B.md b/published/20151030 How To Install FreeBSD on Raspberry Pi 2 Model B.md similarity index 65% rename from translated/tech/20151030 How To Install FreeBSD on Raspberry Pi 2 Model B.md rename to published/20151030 How To Install FreeBSD on Raspberry Pi 2 Model B.md index 941d3a2b72..6057efd5fb 100644 --- a/translated/tech/20151030 How To Install FreeBSD on Raspberry Pi 2 Model B.md +++ b/published/20151030 How To Install FreeBSD on Raspberry Pi 2 Model B.md @@ -1,16 +1,15 @@ -如何在树莓派2 B型上安装 FreeBSD +如何在树莓派 2B 上安装 FreeBSD ================================================================================ -在树莓派2 B型上如何安装 FreeBSD 10 或 FreeBSD 11(current)?怎么在 Linux,OS X,FreeBSD 或类 Unix 操作系统上烧录 SD 卡? +在树莓派 2B 上如何安装 FreeBSD 10 或 FreeBSD 11(current)?怎么在 Linux,OS X,FreeBSD 或类 Unix 操作系统上烧录 SD 卡? -在树莓派2 B型上安装 FreeBSD 10或 FreeBSD 11(current)很容易。使用 FreeBSD 操作系统可以打造一个非常易用的 Unix 服务器。FreeBSD-CURRENT 自2012年十一月以来一直支持树莓派,2015年三月份后也开始支持树莓派2了。在这个快速教程中我将介绍如何在 RPI2 上安装 FreeBSD 11 current arm 版。 +在树莓派 2B 上安装 FreeBSD 10 或 FreeBSD 11(current)很容易。使用 FreeBSD 操作系统可以打造一个非常易用的 Unix 服务器。FreeBSD-CURRENT 自2012年十一月以来一直支持树莓派,2015年三月份后也开始支持树莓派2了。在这个快速教程中我将介绍如何在树莓派 2B 上安装 FreeBSD 11 current arm 版。 ### 1. 下载 FreeBSD-current 的 arm 镜像 ### 你可以 [访问这个页面来下载][1] 树莓派2的镜像。使用 wget 或 curl 命令来下载镜像: - $ wget ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/arm/armv6/ISO-IMAGES/11.0/FreeBSD-11.0-CURRENT-arm-armv6-RPI2-20151016-r289420.img.xz 或 @@ -45,52 +44,51 @@ 1024+0 records out 1073741824 bytes transferred in 661.669584 secs (1622776 bytes/sec) -#### 使用 Linux/FreeBSD 或者 类 Unix 系统来烧录 FreeBSD-current #### +#### 使用 Linux/FreeBSD 或者类 Unix 系统来烧录 FreeBSD-current #### 语法是这样: $ dd if=FreeBSD-11.0-CURRENT-arm-armv6-RPI2-20151016-r289420.img of=/dev/sdb bs=1M -确保使用实际 SD 卡的设备名称来替换 /dev/sdb 。 +**确保使用实际的 SD 卡的设备名称来替换 /dev/sdb**(LCTT 译注:千万注意不要写错了)。 ### 4. 引导 FreeBSD ### -在树莓派2 B型上插入 SD 卡。你需要连接键盘,鼠标和显示器。我使用的是 USB 转串口线来连接显示器的: +在树莓派 2B 上插入 SD 卡。你需要连接键盘,鼠标和显示器。我使用的是 USB 转串口线来连接显示器的: ![Fig.01 RPi USB based serial connection](http://s0.cyberciti.org/uploads/faq/2015/10/Raspberry-Pi-2-Model-B.pin-out.jpg) - -图01 RPI 基于 USB 的串行连接 +*图01 基于树莓派 USB 的串行连接* 在下面的例子中,我使用 screen 命令来连接我的 RPI: - ## Linux version ## + ## Linux 上 ## screen /dev/tty.USB0 115200 - ## OS X version ## + ## OS X 上 ## screen /dev/cu.usbserial 115200 - ## Windows user use Putty.exe ## + ## Windows 请使用 Putty.exe ## FreeBSD RPI 启动输出样例: ![Gif 01: Booting FreeBSD-current on RPi 2](http://s0.cyberciti.org/uploads/faq/2015/10/freebsd-current-rpi.gif) -图01: 在 RPi 2上引导 FreeBSD-current +*图02: 在树莓派 2上引导 FreeBSD-current* ### 5. FreeBSD 在 RPi 2上的用户名和密码 ### 默认的密码是 freebsd/freebsd 和 root/root。 -到此为止, FreeBSD-current 已经安装并运行在 RPi 2上。 +到此为止, FreeBSD-current 已经安装并运行在树莓派 2上。 -------------------------------------------------------------------------------- via: http://www.cyberciti.biz/faq/how-to-install-freebsd-on-raspberry-pi-2-model-b/ 作者:[Vivek Gite][a] -译者:[译者ID](https://github.com/译者ID) -校对:[strugglingyouth](https://github.com/strugglingyouth) +译者:[strugglingyouth](https://github.com/strugglingyouth) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 23c7ebb3b3ea9fc30c9ee1bc6deee4c5e1fb2a59 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 23 Dec 2015 09:37:45 +0800 Subject: [PATCH 0018/1469] PUB:20151208 Apple Swift Programming Language Comes To Linux @flowsnow --- ...ift Programming Language Comes To Linux.md | 41 ++++++++++++++++++ ...ift Programming Language Comes To Linux.md | 43 ------------------- 2 files changed, 41 insertions(+), 43 deletions(-) create mode 100644 published/20151208 Apple Swift Programming Language Comes To Linux.md delete mode 100644 translated/news/20151208 Apple Swift Programming Language Comes To Linux.md diff --git a/published/20151208 Apple Swift Programming Language Comes To Linux.md b/published/20151208 Apple Swift Programming Language Comes To Linux.md new file mode 100644 index 0000000000..1eb1de02fc --- /dev/null +++ b/published/20151208 Apple Swift Programming Language Comes To Linux.md @@ -0,0 +1,41 @@ +可以在 Linux 下试试苹果编程语言 Swift +================================================================================ +![](http://itsfoss.com/wp-content/uploads/2015/12/Apple-Swift-Open-Source.jpg) + +是的,你知道的,苹果编程语言 Swift 已经开源了。其实我们并不应该感到意外,因为[在六个月以前苹果就已经宣布了这个消息][1]。 + +苹果宣布推出开源 Swift 社区。一个专用于开源 Swift 社区的[新网站][2]已经就位,网站首页显示以下信息: + +> 我们对 Swift 开源感到兴奋。在苹果推出了编程语言 Swift 之后,它很快成为历史上增长最快的语言之一。Swift 可以编写出难以置信的又快又安全的软件。目前,Swift 是开源的,你可以将这个最好的通用编程语言用在各种地方。 + +[swift.org][2] 这个网站将会作为一站式网站,它会提供各种资料的下载,包括各种平台,社区指南,最新消息,入门教程,为开源 Swift 做贡献的说明,文件和一些其他的指南。 如果你正期待着学习 Swift,那么必须收藏这个网站。 + +在苹果的这次宣布中,一个用于方便分享和构建代码的包管理器已经可用了。 + +对于所有的 Linux 使用者来说,最重要的是,源代码已经可以从 [Github][3]获得了.你可以从以下链接 Checkout 它: + +- [苹果 Swift 源代码][3] + +除此之外,对于 ubuntu 14.04 和 15.10 版本还有预编译的二进制文件。 + +- [ubuntu 系统的 Swift 二进制文件][4] + +不要急着在产品环境中使用它们,因为这些都是开发分支而不适合于产品环境。因此现在应避免使用在产品环境中,一旦发布了 Linux 下 Swift 的稳定版本,我希望 ubuntu 会把它包含在 [umake][5]中,和 [Visual Studio Code][6] 放一起。 + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/swift-open-source-linux/ + +作者:[Abhishek][a] +译者:[Flowsnow](https://github.com/Flowsnow) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://itsfoss.com/apple-open-sources-swift-programming-language-linux/ +[2]:https://swift.org/ +[3]:https://github.com/apple +[4]:https://swift.org/download/#latest-development-snapshots +[5]:https://wiki.ubuntu.com/ubuntu-make +[6]:http://itsfoss.com/install-visual-studio-code-ubuntu/ diff --git a/translated/news/20151208 Apple Swift Programming Language Comes To Linux.md b/translated/news/20151208 Apple Swift Programming Language Comes To Linux.md deleted file mode 100644 index fe2089345d..0000000000 --- a/translated/news/20151208 Apple Swift Programming Language Comes To Linux.md +++ /dev/null @@ -1,43 +0,0 @@ - -苹果编程语言Swift开始支持Linux -================================================================================ -![](http://itsfoss.com/wp-content/uploads/2015/12/Apple-Swift-Open-Source.jpg) - -苹果也开源了?是的,苹果编程语言Swift已经开源了。其实我们并不应该感到意外,因为[在六个月以前苹果就已经宣布了这个消息][1]。 - -苹果宣布这周将推出开源Swift社区。一个专用于开源Swift社区的[新网站][2]已经就位,网站首页显示以下信息: - -> 我们对Swift开源感到兴奋。在苹果推出了编程语言Swift之后,它很快成为历史上增长最快的语言之一。Swift可以编写出难以置信的又快又安全的软件。目前,Swift是开源的,你能帮助做出随处可用的最好的通用编程语言。 - -[swift.org][2]这个网站将会作为一站式网站,它会提供各种资料的下载,包括各种平台,社区指南,最新消息,入门教程,贡献开源Swift的说明,文件和一些其他的指南。 如果你正期待着学习Swift,那么必须收藏这个网站。 - -在苹果的这次宣布中,一个用于方便分享和构建代码的包管理器已经可用了。 - -对于所有的Linux使用者来说,最重要的是,源代码已经可以从[Github][3]获得了.你可以从以下链接Checkout它: -Most important of all for Linux users, the source code is now available at [Github][3]. You can check it out from the link below: - -- [苹果Swift源代码][3] - -除此之外,对于ubuntu 14.04和15.10版本还有预编译的二进制文件。 - -- [ubuntu系统的Swift二进制文件][4] - -不要急着去使用它们,因为这些都是发展分支而且不适合于专用机器。因此现在避免使用,一旦发布了Linux下Swift的稳定版本,我希望ubuntu会把它包含在[umake][5]中靠近[Visual Studio][6]的地方。 - --------------------------------------------------------------------------------- - -via: http://itsfoss.com/swift-open-source-linux/ - -作者:[Abhishek][a] -译者:[Flowsnow](https://github.com/Flowsnow) -校对:[校对者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/apple-open-sources-swift-programming-language-linux/ -[2]:https://swift.org/ -[3]:https://github.com/apple -[4]:https://swift.org/download/#latest-development-snapshots -[5]:https://wiki.ubuntu.com/ubuntu-make -[6]:http://itsfoss.com/install-visual-studio-code-ubuntu/ From 370a351078481a901196b66f517eb0c0a3d55bb3 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Wed, 23 Dec 2015 17:29:23 +0800 Subject: [PATCH 0019/1469] =?UTF-8?q?20151223-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Biggest Linux Stories Of The Year 2015.md | 123 ++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 sources/talk/20151223 Ten Biggest Linux Stories Of The Year 2015.md diff --git a/sources/talk/20151223 Ten Biggest Linux Stories Of The Year 2015.md b/sources/talk/20151223 Ten Biggest Linux Stories Of The Year 2015.md new file mode 100644 index 0000000000..af41c6a5e1 --- /dev/null +++ b/sources/talk/20151223 Ten Biggest Linux Stories Of The Year 2015.md @@ -0,0 +1,123 @@ +Ten Biggest Linux Stories Of The Year 2015 +================================================================================ +![Biggest Linux Stories of 2015](http://itsfoss.com/wp-content/uploads/2015/12/Biggest-Linux-Stories-2015.jpg) + +Year 2015 is coming to an end and I am here with Year 2015 special series on It’s FOSS. First in this series is the biggest Linux stories of the year 2015. These stories are the ones that had the most impact on the Linux world, both positive and negative. + +I have summarized ten of such stories which created the most buzz in 2015. Here we go! + +### Biggest Linux and Open Source stories of the year 2015 ### + +Just to add, the listed items are not ordered chronologically. + +#### Microsoft’s partnering with Linux #### + +In late September, everyone was shocked to hear that [Microsoft created its own Linux distribution][1]. It was later revealed that [it was a software][2] developed for its Azur cloud switches. + +But the story did not end up just there. Microsoft indeed partnered with Canonical (parent company of Ubuntu Linux) for [HDInsight][3], Microsoft’s big data Hadoop-on-Azure service. Ubuntu was the first Linux on which [Microsoft deployed this software][4]. + +Will Microsoft continue its affair with Linux? Or will it dump it after Linux has served its purpose (Azur). Only time will tell. + +#### Microsoft releases Visual Studio Code for Linux #### + +Before Microsoft-Linux distribution uproar, Microsoft has dropped another bomb by releasing Visual Studio Code for Linux, along with Windows and OS X versions. Though Visual Studio Code is not open source, releasing a Linux version was somehow a win for Linux users. After all, Linus Torvalds had famously said, “if Microsoft ever does an application for Linux, it means I’ve won”. + +You can follow this tutorial to see [how to install Visual Studio Code in Ubuntu][5]. + +#### Apple open sources Swift programming language #### + +Apple was not behind in showing off its ‘love’ for Linux and Open Source. Apple’s flagship programming language Swift which is used for making iOS apps, [is now open source][6] with Linux ports available. Though in beta, you can easily [install Swift in Ubuntu][7]. + +But Apple is Apple and it [started bragging itself][8] as the “first major computer company to make Open Source development a key part of its software strategy…(sic)”. + +#### Ubuntu Phone finally launched #### + +Ubuntu Phone was finally launched earlier this year. Intended for early adopters and developers, Ubuntu was welcomed with open heart by the Ubuntu community. Mainstream smartphone users are still shying away from it, mainly [because the OS is still under heavy development][9]. Year 2016 will be deciding for the existence of Ubuntu Phone. + +#### Financial crisis hits Jolla #### + +Jolla, the company behind Linux based smartphone operating system Sailfish OS, hit a major financial hurdle. It resulted in [half of Jolla employees being laid off][10]. + +Jolla had a very [successful crowdfunding campaign][11] in 2014 for its tablet. Apparently, they spent most of the budget on the development of Sailfish OS and when the lead investor backed off, company struggled for its survival. + +Good news is that Jolla has managed to get some solid funding and its ]back in business][12]. + +#### Firefox OS is dead #### + +One of the open source alternatives to Android, Mozilla’s mobile operating system Firefox OS died a slow death earlier this month. Intended at developing countries with smartphones as cheap as $25, Firefox OS based smartphones could never gained popularity. I think lack of popular apps and cheap hardware was the main reason. + +In December, [Mozilla announced][13] that it will stop developing Firefox OS and also stop the sale of Firefox smartphones. + +Though it is never announced, I think even [Tizen][14], Linux foundation’s own Linux based mobile OS, is dead as well. I don’t see any development news on Tizen and Linux Foundation never promotes it. It is just the matter of time when we will be invited to the funeral of Tizen. + +#### Infighting in “Ubuntu family” #### + +There were lots of heated discussion in May this year when Kubuntu project lead, [Jonathan Riddell was forced out by Ubuntu Community Council][15]. Jonathan had asked questions about how the donations received by Ubuntu is being spent. He had complained that Kubuntu never saw the money. + +This led to an exchange of accusation between both sides. Ultimately, big daddy of Ubuntu, [Mark Shuttleworth asked Jonathan to step down][16]. + +#### Female Linux Kernel developer quits citing ‘brutal communication style’ #### + +Linux creator Linux Torvalds is known for the use of abusive language. Linux Kernel dev [Sarah Sharp][17] is also known for being out spoken. + +Sarah Sharp had earlier locked horns with Linus Torvalds in 2013 when she publicly [advised Linus to keep “verbal violence” off the mailing list][18]. Linus did not take it [lightly][19] as well. + +That was in 2013. In 2015, Sarah announced that she is [stepping down from her work in Kernel community][20] because the communication style lacks basic decency and is brutal and profane. + +This move left people discussing if Linux Kernel community should really change the way they behave or if Sarah took things too far. + +#### Unity gaming editor ported to Linux #### + +While [gaming on Linux][21] is still the Achilles heel for Linux users, the community got excited when gaming engine Unity announced that it is testing its [game editor on Linux][22]. As Linux is used very well for rendering, it is speculated that this move will bring game developers to Linux. It is not confirmed yet if Unity will actually bring a final Linux version of its game editor though. + +#### Open Source adoption in government organization #### + +Administration in several [European cities decided to ditch proprity software][23] and opt for open source alternatives. Most city administration replaced Microsoft Office with LibreOffice or OpenOffice. Few cities and [government][24] schools also went ahead and replaced Microsoft Windows with Linux. + +Cost cutting was one of the major factor in this decision as the city administration saved hundreds of thousands of Euro by adopting Open Source. + +Universities were not far behind in adopting open source as well. All year round, we get to hear how a [university dropped Photoshop for Krita][25] or [university using open source office][26]. + +### Conclusion ### + +As with any other year, 2015 also had some positive and some negative moments for Linux lovers. We saw competitors like Microsoft and Apple coming close to Linux, government organizations adopting to open source. At the same time, we witnessed the failure of Firefox smartphone OS. A mixed year, I would say. + +What do you think? I let you share what you think was the most important news for Linux-ers in the year 2015 and your overall feel about it. + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/biggest-linux-stories-2015/ + +作者:[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.theregister.co.uk/2015/09/18/microsoft_has_developed_its_own_linux_repeat_microsoft_has_developed_its_own_linux/ +[2]:http://arstechnica.com/information-technology/2015/09/microsoft-has-built-software-but-not-a-linux-distribution-for-its-software-switches/ +[3]:https://azure.microsoft.com/en-us/services/hdinsight/ +[4]:http://www.zdnet.com/article/microsoft-deploys-first-major-server-application-on-ubuntu-linux/ +[5]:http://itsfoss.com/install-visual-studio-code-ubuntu/ +[6]:http://itsfoss.com/swift-open-source-linux/ +[7]:http://itsfoss.com/use-swift-linux/ +[8]:https://business.facebook.com/itsfoss/photos/pb.115098615297581.-2207520000.1450817108./634288916711879/?type=3&theater +[9]:http://www.engadget.com/2015/07/24/ubuntu-phone-review/ +[10]:http://techcrunch.com/2015/11/20/jolla-running-out-of-runway-for-its-android-alternative/ +[11]:https://www.indiegogo.com/projects/jolla-tablet-world-s-first-crowdsourced-tablet#/ +[12]:https://blog.jolla.com/jolla-back-business/ +[13]:http://arstechnica.com/gadgets/2015/12/firefox-os-smartphones-are-dead/ +[14]:https://www.tizen.org/ +[15]:http://www.omgubuntu.co.uk/2015/05/kubuntu-project-lead-asked-to-step-down-by-ubuntu-community-council +[16]:http://www.cio.com/article/2926838/linux/mark-shuttleworth-ubuntu-community-council-ask-kubuntu-developer-to-step-down-as-leader.html +[17]:http://sarah.thesharps.us/ +[18]:http://www.techeye.net/chips/linus-torvalds-and-intel-woman-in-sweary-spat +[19]:http://marc.info/?l=linux-kernel&m=137392506516022&w=2 +[20]:http://www.networkworld.com/article/2988850/opensource-subnet/linux-kernel-dev-sarah-sharp-quits-citing-brutal-communications-style.html +[21]:http://itsfoss.com/linux-gaming-guide/ +[22]:http://itsfoss.com/unity-gaming-engine-linux/ +[23]:http://itsfoss.com/tag/open-source-adoption/ +[24]:http://itsfoss.com/spanish-school-ditches-windows-ubuntu/ +[25]:http://itsfoss.com/french-university-dumps-adobe-photoshop-open-source-app-krita/ +[26]:http://itsfoss.com/hungarian-universities-switch-eurooffice/ From 1a4eb0ff2650dd2bc0e6ce9a102b170efee072c9 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Wed, 23 Dec 2015 17:30:20 +0800 Subject: [PATCH 0020/1469] =?UTF-8?q?20151223-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...e Best File System for My Linux Install.md | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 sources/talk/20151223 What' s the Best File System for My Linux Install.md diff --git a/sources/talk/20151223 What' s the Best File System for My Linux Install.md b/sources/talk/20151223 What' s the Best File System for My Linux Install.md new file mode 100644 index 0000000000..1e8af12179 --- /dev/null +++ b/sources/talk/20151223 What' s the Best File System for My Linux Install.md @@ -0,0 +1,96 @@ +What’s the Best File System for My Linux Install? +================================================================================ +![](https://www.maketecheasier.com/assets/uploads/2015/05/file-systems-feature-image.jpg) + +File systems: they’re not the most exciting things in the world, but important nonetheless. In this article we’ll go over the popular choices for file systems on Linux – what they’re about, what they can do, and who they’re for. + +### Ext4 ### + +![file-systems-ext4](https://www.maketecheasier.com/assets/uploads/2015/05/file-systems-ext4.png) + +If you’ve ever installed Linux before, chances are you’ve seen the “Ext4” during installation. There’s a good reason for that: it’s the file system of choice for just about every Linux distribution available right now. Sure, there are some that choose other options, but there’s no denying that Extended 4 is the file system of choice for almost all Linux users. + +#### What can it do? #### + +Extended 4 has all of the goodness that you’ve come to expect from past file system iterations (Ext2/Ext3) but with enhancements. There’s a lot to dig into, but here are the best parts of what Ext4 can do for you: + +- file system journaling +- journal checksums +- multi-block file allocation +- backwards compatibility support for Extended 2 and 3 +- persistent pre-allocation of free space +- improved file system checking (over previous versions) +- and of course, support for larger files + +#### Who is it for? #### + +Extended 4 is for those looking for a super-stable foundation to build upon, or for those looking for something that just works. This file system won’t snapshot your system; it doesn’t even have the greatest SSD support, but If your needs aren’t too extravagant, you’ll get along with it just fine. + +### BtrFS ### + +![file-systems-btrFS](https://www.maketecheasier.com/assets/uploads/2015/05/file-systems-btrFS-e1450065697580.png) + +The B-tree file system (also known as butterFS) is a file system for Linux developed by Oracle. It’s a new file system and is in heavy development stages. The Linux community considers it unstable to use for some. The core principle of BtrFS is based around the principle of copy-on-write. **Copy on write** basically means that the system has one single copy of a bit of data before the data has been written. When the data has been written, a copy of it is made. + +#### What can it do? #### + +Besides supporting copy-on-write, BtrFS can do many other things – so many things, in fact, that it’d take forever to list everything. Here are the most notable features: The file system supports read-only snapshots, file cloning, subvolumes, transparent compression, offline file system check, in-place conversion from ext3 and 4 to Btrfs, online defragmentation, anew has support for RAID 0, RAID 1, RAID 5, RAID 6 and RAID 10. + +#### Who is it for? #### + +The developers of BtrFS have promised that this file system is the next-gen replacement for other file systems out there. That much is true, though it certainly is a work in progress. There are many killer features for advanced users and basic users alike (including great performance on SSDs). This file system is for those looking to get a little bit more out of their file system and who want to try the copy-on-write way of doing things. + +### XFS ### + +![file-systems-xfs](https://www.maketecheasier.com/assets/uploads/2015/05/file-systems-xfs.jpg) + +Developed and created by Silicon Graphics, XFS is a high-end file system that specializes in speed and performance. XFS does extremely well when it comes to parallel input and output because of its focus on performance. The XFS file system can handle massive amounts of data, so much in fact that some users of XFS have close to 300+ terabytes of data. + +#### What can it do? #### + +XFS is a well-tested data storage file system created for high performance operations. Its features include: + +- striped allocation of RAID arrays +- file system journaling +- variable block sizes +- direct I/O +- guaranteed-rate I/O +- snapshots +- online defragmentation +- online resizing + +#### Who is it for? #### + +XFS is for those looking for a rock-solid file solution. The file system has been around since 1993 and has only gotten better and better with time. If you have a home server and you’re perplexed on where you should go with storage, consider XFS. A lot of the features the file system comes with (like snapshots) could aid in your file storage system. It’s not just for servers, though. If you’re a more advanced user and you’re interested in a lot of what was promised in BtrFS, check out XFS. It does a lot of the same stuff and doesn’t have stability issues. + +### Reiser4 ### + +![file-system-riser4](https://www.maketecheasier.com/assets/uploads/2015/05/file-system-riser4.gif) + +Reiser4, the successor to ReiserFS, is a file system created and developed by Namesys. The creation of Reiser4 was backed by the Linspire project as well as DARPA. What makes Reiser4 special is its multitude of transaction models. There isn’t one single way data can be written; instead, there are many. + +#### What can it do? #### + +Reiser4 has the unique ability to use different transaction models. It can use the copy-on-write model (like BtrFS), write-anywhere, journaling, and the hybrid transaction model. It has a lot of improvements upon ReiserFS, including better file system journaling via wandering logs, better support for smaller files, and faster handling of directories. Reiser4 has a lot to offer. There are a lot more features to talk about, but suffice it to say it’s a huge improvement over ReiserFS with tons of added features. + +#### Who is it for? #### + +Resier4 is for those looking to stretch one file system across multiple use-cases. Maybe you want to set up one machine with copy-on-write, another with write-anywhere, and another with hybrid transaction, and you don’t want to use different types of file systems to accomplish this task. Reiser4 is perfect for this type of use-case. + +### Conclusion ### + +There are many file systems available on Linux. Each serves a unique purpose for unique users looking to solve different problems.This post focuses on the most popular choices for the platform. There is no doubt there are other choices out there for other use-cases. + +What’s your favorite file system to use on Linux? Tell us why below! + +-------------------------------------------------------------------------------- + +via: https://www.maketecheasier.com/best-file-system-linux/ + +作者:[Derrik Diener][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.maketecheasier.com/author/derrikdiener/ From 7cc9b01c1ed4c24d9f6f33d7eae96e9c2990825b Mon Sep 17 00:00:00 2001 From: DeadFire Date: Wed, 23 Dec 2015 17:31:30 +0800 Subject: [PATCH 0021/1469] =?UTF-8?q?20151223-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...H Login Without Password CentOS or RHEL.md | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 sources/tech/20151223 How to Setup SSH Login Without Password CentOS or RHEL.md diff --git a/sources/tech/20151223 How to Setup SSH Login Without Password CentOS or RHEL.md b/sources/tech/20151223 How to Setup SSH Login Without Password CentOS or RHEL.md new file mode 100644 index 0000000000..b4a2f886a1 --- /dev/null +++ b/sources/tech/20151223 How to Setup SSH Login Without Password CentOS or RHEL.md @@ -0,0 +1,105 @@ +How to Setup SSH Login Without Password CentOS / RHEL +================================================================================ +![](http://www.ehowstuff.com/wp-content/uploads/2015/12/notebook-1071774_1280.jpg) + +As a system administrator, you plan on using OpenSSH for Linux and automate your daily tasks such as transferring files or database dump file for the backup to another server. To achieve this goal, you need to log in automatically from the host A to host B. Login automatically mean you do not want to enter any password because you want to use ssh from a shell script. + +In this article we’ll show you how to Setup SSH Login without Password on CentOS / RHEL. After automatic login has been configured, you can use it to move the file using SSH (Secure Shell) and secure copy (SCP). + +SSH is open source and the most trusted network protocol which is used to login to the remote server. It is used by system administrators to execute commands, also used to transfer files from one computer to another over a network using SCP protocol. + +After you setup SSH login without password, you can get the following advantages : + +a) Automate your daily task via scripts. +b) Enhance security of your linux server. This is one of the recommended method to prevent a brute force attack on virtual private server (VPS), SSH keys are nearly impossible to decipher by brute force alone. + +### What is ssh-keygen ### + +ssh-keygen is a Unix utility that is used to generate, create, manage the public and private keys for ssh authentication. With the help of the ssh-keygen tool, a user can create passphrase keys for both SSH protocol version 1 and version 2. ssh-keygen creates RSA keys for SSH protocol version 1 and RSA or DSA keys for use by SSH protocol version 2. + +### What is ssh-copy-id ### + +ssh-copy-id is a script that copies the local-host’s public key to the remote-host’s authorized_keys file. ssh-copy-id also append the indicated identity file to that machine’s ~/.ssh/authorized_keys file and assigns proper permission to the remote-host’s home. + +### SSH keys ### + +SSH keys provide better and secure way of logging into a linux server with SSH. After you run ssh-keygen, you will generate public key and private key. You can place the public key on any server, and then unlock it by connecting to it with a client that already has the private key. When the two match up, the system unlocks without the need for a password. + +### Setup SSH Login Without Password on CentOS and RHEL. ### + +This steps tested on CentOS 5/6/7, RHEL 5/6/7 and Oracle Linux 6/7. + +Node1 : 192.168.0.9 +Node2 : 192.168.l.10 + +#### Step One : #### + +Test the connection and access from node1 to node2 : + + [root@node1 ~]# ssh root@192.168.0.10 + The authenticity of host '192.168.0.10 (192.168.0.10)' can't be established. + RSA key fingerprint is 6d:8f:63:9b:3b:63:e1:72:b3:06:a4:e4:f4:37:21:42. + Are you sure you want to continue connecting (yes/no)? yes + Warning: Permanently added '192.168.0.10' (RSA) to the list of known hosts. + root@192.168.0.10's password: + Last login: Thu Dec 10 22:04:55 2015 from 192.168.0.1 + [root@node2 ~]# + +#### Step Two : #### + +Generate public and private keys using ssh-key-gen. Please take note that you can increase security by protecting the private key with a passphrase. + + [root@node1 ~]# ssh-keygen + Generating public/private rsa key pair. + Enter file in which to save the key (/root/.ssh/id_rsa): + Enter passphrase (empty for no passphrase): + Enter same passphrase again: + Your identification has been saved in /root/.ssh/id_rsa. + Your public key has been saved in /root/.ssh/id_rsa.pub. + The key fingerprint is: + b4:51:7e:1e:52:61:cd:fb:b2:98:4b:ad:a1:8b:31:6d root@node1.ehowstuff.local + The key's randomart image is: + +--[ RSA 2048]----+ + | . ++ | + | o o o | + | o o o . | + | . o + .. | + | S . . | + | . .. .| + | o E oo.o | + | = ooo. | + | . o.o. | + +-----------------+ + +#### Step Three : #### + +Copy or transfer the public key to remote-host using ssh-copy-id command. It will append the indicated identity file to ~/.ssh/authorized_keys on node2 : + + [root@node1 ~]# ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.0.10 + root@192.168.0.10's password: + Now try logging into the machine, with "ssh '192.168.0.10'", and check in: + + .ssh/authorized_keys + + to make sure we haven't added extra keys that you weren't expecting. + +#### Step Four : #### + +Try SSH login without Password to node2 : + + [root@node1 ~]# ssh root@192.168.0.10 + Last login: Sun Dec 13 14:03:20 2015 from www.ehowstuff.local + +I hope this article gives you some ideas and quick guide on how to setup SSH login without password on Linux CentOS / RHEL. + +-------------------------------------------------------------------------------- + +via: http://www.ehowstuff.com/ssh-login-without-password-centos/ + +作者:[skytech][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.ehowstuff.com/author/skytech/ From 1ea0ae28be7b14830bca43993a001565fc559a8a Mon Sep 17 00:00:00 2001 From: DeadFire Date: Wed, 23 Dec 2015 17:31:58 +0800 Subject: [PATCH 0022/1469] =?UTF-8?q?20151204-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Use Glances to Monitor System on Ubuntu.md | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 sources/tech/20151223 How to Use Glances to Monitor System on Ubuntu.md diff --git a/sources/tech/20151223 How to Use Glances to Monitor System on Ubuntu.md b/sources/tech/20151223 How to Use Glances to Monitor System on Ubuntu.md new file mode 100644 index 0000000000..14787025e9 --- /dev/null +++ b/sources/tech/20151223 How to Use Glances to Monitor System on Ubuntu.md @@ -0,0 +1,105 @@ +How to Use Glances to Monitor System on Ubuntu +================================================================================ +![](https://www.maketecheasier.com/assets/uploads/2015/12/glances_featured.jpg) + +Glances is a cross-platform command-line text-based tool to monitor your system. It is written in Python language and uses the `psutil` library to get information from the system. Using it you can monitor CPU, Load Average, Memory, Network Interfaces, Disk I/O, File System spaces utilization, mounted devices, total number of active processes and top processes. There are many interesting options available in Glances. One of the main features is that you can set thresholds (careful, warning and critical) in a configuration file, and information will be shown in colors which indicates the bottleneck in the system. + +### Glances Features ### + +- the average CPU load +- total number of processes like active, sleeping processes, etc. +- total memory information like RAM, swap, free memory, etc. +- CPU information +- Network download and upload speed of connections +- Disk I/O read/write speed details +- Currently mounted devices’ disk usages +- Top processes with their CPU/memory usages + +### Installing Glances ### + +Installing Glances on Ubuntu is easy, as it is available on Ubuntu’s repository. You can install Glances by running the following command. + + sudo apt-get install glances + +### Usage of Glances ### + +After installation has been finished, you can launch Glances by running the following command: + + glances + +You will see an output like the following: + +![glances monitor system output](https://www.maketecheasier.com/assets/uploads/2015/12/glances_output1.png) + +Press ESC or “Ctrl + C” to quit from the Glances terminal. + +By default, the interval time is set to 1 second, but you can define the custom interval time while running glances from the terminal. + +To set the interval time to 5 seconds, run the following command: + + glances -t 5 + +### Glances Color Codes ### + +Glances color code meanings: + +- `GREEN` : OK +- `BLUE` : CAREFUL +- `VIOLET` : ALERT +- `RED` : CRITICAL + +By default, Glances thresholds set is: careful=50, warning=70, critical=90. You can customize the threshold by using the default configuration file glances.conf located at the “/etc/glances/” directory. + +### Glances Options ### + +Glances provides sever so hot keys to find output information while it is running. + +Below are the list of several hot keys. + +- `m` : sort processes by MEM% +- `p` : sort processes by name +- `c` : sort processes by CPU% +- `d` : show/hide disk I/O stats +- `a` : sort processes automatically +- `f` : show/hide file system statshddtemp +- `i` : sort processes by I/O rate +- `s` : show/hide sensors’ stats +- `y` : show/hide hddtemp stats +- `l` : show/hide logs +- `n` : show/hide network stats +- `x` : delete warning and critical logs +- `h` : show/hide help screen +- `q` : quit +- `w` : delete warning logs + +### Use Glances to Monitor Remote Systems ### + +You can also monitor remote systems using Glances. To use it on a remote system, use the following command: + + glances -s + +You will see an output like the following: + +![glances monitor remote system server](https://www.maketecheasier.com/assets/uploads/2015/12/glances_server.png) + +You will see Glances running on port 61209. + +Now, go to the remote machine and execute the following command to connect to a Glances server by specifying the IP address as shown below. For example, 192.168.1.10 is your Glances server IP address. + + glances -c -P 192.168.1.10 + +### Conclusion ### + +Glances is a very useful tool for every Linux system administrator. Using it, you can easily monitor your Linux system in less time. Feel free to comment if you have any questions. + +-------------------------------------------------------------------------------- + +via: https://www.maketecheasier.com/glances-monitor-system-ubuntu/ + +作者:[Hitesh Jethva][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.maketecheasier.com/author/hiteshjethva/ From e98d774219dc8570b61e838c94d783b70a02cc62 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Wed, 23 Dec 2015 17:32:31 +0800 Subject: [PATCH 0023/1469] =?UTF-8?q?20151204-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...tor Linux System Performance Using Nmon.md | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 sources/tech/20151223 Monitor Linux System Performance Using Nmon.md diff --git a/sources/tech/20151223 Monitor Linux System Performance Using Nmon.md b/sources/tech/20151223 Monitor Linux System Performance Using Nmon.md new file mode 100644 index 0000000000..6f47649208 --- /dev/null +++ b/sources/tech/20151223 Monitor Linux System Performance Using Nmon.md @@ -0,0 +1,100 @@ +Monitor Linux System Performance Using Nmon +================================================================================ +Nmon (also known as Nigel’s Monitor) is a computer performance system monitor tool for the AIX and Linux operating systems developed by IBM employee Nigel Griffiths. The tool displays onscreen or saves to a data file the operating system statistics to aid in the understanding of computer resource use, tuning options and bottlenecks. This system benchmark tool gives you a huge amount of important performance information in one go with a single command. You can easily monitor your system’s CPU, memory, network, disks, file systems, NFS, top processes, resources and power micro-partition information using Nmon. + +### Installing Nmon ### + +By default nmon is available in the Ubuntu repository. You can easily install nmon by running the following command: + + sudo apt-get install nmon + +How to Use Nmon to Monitor Linux Performance + +Once the installation has been finished, you can launch it by typing the `nmon` command in the terminal. + + nmon + +You wI’ll see the following output: + +![nmon-output](https://www.maketecheasier.com/assets/uploads/2015/12/nmon-output.png) + +You can see from the above screenshot that the nmon command-line utility runs completely in interactive mode, and you can easily toggle statistics using shortcut keys. + +You can use the following nmon keyboard shortcuts to display different system stats: + +- `q` : to stop and exit Nmon +- `h` : to see help screen +- `c` : see CPU stats +- `m` : see memory stats +- `d` : see disk stats +- `k` : see kernel stats +- `n` : see network stats +- `N` : see NFS stats +- `j` : see file system stats +- `t` : see top process +- `V` : see virtual memory stats +- `v` : verbose mode + +### Check CPU by Processor ### + +If you would like to collect some statistics on CPU performance, you should hit the c key on the keyboard. + +After hitting the c key you wI’ll see the following output. + +![nmon_cpu_output](https://www.maketecheasier.com/assets/uploads/2015/12/nmon_cpu_output.png) + +### Check Top Process Statistics ### + +To get stats on top processes that are running on your system, press the t key on your keyboard. + +You will see the following output. + +![nmon_process_output](https://www.maketecheasier.com/assets/uploads/2015/12/nmon_process_output.jpg) + +### Check Network Statistics ### + +To get the network stats of your Linux system, just press the n key on your keyboard. + +You wI’ll see the following output: + +![n_network_output](https://www.maketecheasier.com/assets/uploads/2015/12/nmon_network_output.png) + +### Disk I/O Graphs ### + +Use the `d` key to get information about disks. + +You wI’ll see the following output: + +![nmon_disk_output](https://www.maketecheasier.com/assets/uploads/2015/12/nmon_disk_output.png) + +### Check Kernel Information ### + +A most important key to use with this tool is `k;` it is used to display some brief information on the kernel of your system. + +You will see the following output after hitting the `k` key on your keyboard. + +![nmon_kernel_output](https://www.maketecheasier.com/assets/uploads/2015/12/nmon_kernel_output.png) + +### Get System Information ### + +A very useful key for every system admin is the `r` key which is used to give information on different resources such as machine architecture, operating system version, Linux version and CPU. + +You will see the following output by hitting the `r` key. + +![nmon_system_output](https://www.maketecheasier.com/assets/uploads/2015/12/nmon_system_output.png) + +### Conclusion ### + +There are many other tools that can do the same job of the Nmon, but Nmon is so usee friendly for a Linux beginner. Please feel free to comment if you have any questions. + +-------------------------------------------------------------------------------- + +via: https://www.maketecheasier.com/monitor-linux-system-performance/ + +作者:[Hitesh Jethva][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.maketecheasier.com/author/hiteshjethva/ From 0f62f73dcde9f3291e3f9905cdd96cc21e3d256d Mon Sep 17 00:00:00 2001 From: DeadFire Date: Wed, 23 Dec 2015 17:45:14 +0800 Subject: [PATCH 0024/1469] =?UTF-8?q?=E9=80=89=E9=A2=98=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E5=86=99=E9=94=99=E4=BA=8620152323-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 选题日期写错了20152323-2 选题 --- .../20151223 How to Use Glances to Monitor System on Ubuntu.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20151223 How to Use Glances to Monitor System on Ubuntu.md b/sources/tech/20151223 How to Use Glances to Monitor System on Ubuntu.md index 14787025e9..b10e7ed47e 100644 --- a/sources/tech/20151223 How to Use Glances to Monitor System on Ubuntu.md +++ b/sources/tech/20151223 How to Use Glances to Monitor System on Ubuntu.md @@ -103,3 +103,4 @@ via: https://www.maketecheasier.com/glances-monitor-system-ubuntu/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:https://www.maketecheasier.com/author/hiteshjethva/ + From d0828a112dd69ac359e098e2f29471a1064c40c8 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Wed, 23 Dec 2015 17:45:44 +0800 Subject: [PATCH 0025/1469] =?UTF-8?q?=E9=80=89=E9=A2=98=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E5=86=99=E9=94=99=E4=BA=8620152323-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 选题日期写错了20152323-2 选题 --- .../tech/20151223 Monitor Linux System Performance Using Nmon.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20151223 Monitor Linux System Performance Using Nmon.md b/sources/tech/20151223 Monitor Linux System Performance Using Nmon.md index 6f47649208..a0edd16870 100644 --- a/sources/tech/20151223 Monitor Linux System Performance Using Nmon.md +++ b/sources/tech/20151223 Monitor Linux System Performance Using Nmon.md @@ -98,3 +98,4 @@ via: https://www.maketecheasier.com/monitor-linux-system-performance/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:https://www.maketecheasier.com/author/hiteshjethva/ + From d16f505efbd81c72c391c926b2042e6f543d2c9f Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 23 Dec 2015 17:57:32 +0800 Subject: [PATCH 0026/1469] PUB:20150917 A Repository with 44 Years of Unix Evolution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @wi-cuckoo 太厉害了,这篇这么长,很多地方还很艰涩,亏你翻译的这么好。我校对都用了一整天呢。辛苦啦! --- ...ository with 44 Years of Unix Evolution.md | 220 ++++++++++++++++++ ...ository with 44 Years of Unix Evolution.md | 202 ---------------- 2 files changed, 220 insertions(+), 202 deletions(-) create mode 100755 published/20150917 A Repository with 44 Years of Unix Evolution.md delete mode 100755 translated/tech/20150917 A Repository with 44 Years of Unix Evolution.md diff --git a/published/20150917 A Repository with 44 Years of Unix Evolution.md b/published/20150917 A Repository with 44 Years of Unix Evolution.md new file mode 100755 index 0000000000..5c19f0180f --- /dev/null +++ b/published/20150917 A Repository with 44 Years of Unix Evolution.md @@ -0,0 +1,220 @@ +一个涵盖 Unix 44 年进化史的版本仓库 +============================================================================= + +http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html + +This is an HTML rendering of a working paper draft that led to a publication. The publication should always be cited in preference to this draft using the following reference: + +- **Diomidis Spinellis**. [A repository with 44 years of Unix evolution](http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html). In MSR '15: Proceedings of the 12th Working Conference on Mining Software Repositories, pages 13-16. IEEE, 2015. Best Data Showcase Award. ([doi:10.1109/MSR.2015.6](http://dx.doi.org/10.1109/MSR.2015.6)) + +This document is also available in [PDF format](http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.pdf). + +The document's metadata is available in [BibTeX format](http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c-bibtex.html). + +This material is presented to ensure timely dissemination of scholarly and technical work. Copyright and all rights therein are retained by authors or by other copyright holders. All persons copying this information are expected to adhere to the terms and constraints invoked by each author's copyright. In most cases, these works may not be reposted without the explicit permission of the copyright holder. + +[Diomidis Spinellis Publications](http://www.dmst.aueb.gr/dds/pubs/) + +© 2015 IEEE. Personal use of this material is permitted. However, permission to reprint/republish this material for advertising or promotional purposes or for creating new collective works for resale or redistribution to servers or lists, or to reuse any copyrighted component of this work in other works must be obtained from the IEEE. + +### 摘要 ### + +Unix 操作系统的进化历史,可以从一个版本控制仓库中窥见,时间跨度从 1972 年的 5000 行内核代码开始,到 2015 年成为一个含有 26,000,000 行代码的被广泛使用的系统。该仓库包含 659,000 条提交,和 2306 次合并。仓库部署了被普遍采用的 Git 系统用于储存其代码,并且在时下流行的 GitHub 上建立了存档。它由来自贝尔实验室(Bell Labs),伯克利大学(Berkeley University),386BSD 团队所开发的系统软件的 24 个快照综合定制而成,这包括两个老式仓库和一个开源 FreeBSD 系统的仓库。总的来说,可以确认其中的 850 位个人贡献者,更早些时候的一批人主要做基础研究。这些数据可以用于一些经验性的研究,在软件工程,信息系统和软件考古学领域。 + +### 1、介绍 ### + +Unix 操作系统作为一个主要的工程上的突破而脱颖而出,得益于其模范的设计、大量的技术贡献、它的开发模型及广泛的使用。Unix 编程环境的设计已经被视为一个提供非常简洁、强大而优雅的设计 [[1][1]] 。在技术方面,许多对 Unix 有直接贡献的,或者因 Unix 而流行的特性就包括 [[2][2]] :用高级语言编写的可移植部署的内核;一个分层式设计的文件系统;兼容的文件,设备,网络和进程间 I/O;管道和过滤架构;虚拟文件系统;和作为普通进程的可由用户选择的不同 shell。很早的时候,就有一个庞大的社区为 Unix 贡献软件 [[3][3]] ,[[4][4],pp. 65-72] 。随时间流逝,这个社区不断壮大,并且以现在称为开源软件开发的方式在工作着 [[5][5],pp. 440-442] 。Unix 和其睿智的晚辈们也将 C 和 C++ 编程语言、分析程序和词法分析生成器(*yacc*,*lex*)、文档编制工具(*troff*,*eqn*,*tbl*)、脚本语言(*awk*,*sed*,*Perl*)、TCP/IP 网络、和配置管理系统(configuration management system)(*SCSS*,*RCS*,*Subversion*,*Git*)发扬广大了,同时也形成了现代互联网基础设施和网络的最大的部分。 + +幸运的是,一些重要的具有历史意义的 Unix 材料已经保存下来了,现在保持对外开放。尽管 Unix 最初是由相对严格的协议发行,但在早期的开发中,很多重要的部分是通过 Unix 的版权拥有者之一(Caldera International) (LCTT 译注:2002年改名为 SCO Group)以一个自由的协议发行。通过将这些部分再结合上由加州大学伯克利分校(University of California, Berkeley)和 FreeBSD 项目组开发或发布的开源软件,贯穿了从 1972 年六月二十日开始到现在的整个系统的开发。 + +通过规划和处理这些可用的快照以及或旧或新的配置管理仓库,将这些可用数据的大部分重建到一个新合成的 Git 仓库之中。这个仓库以数字的形式记录了过去44年来最重要的数字时代产物的详细的进化。下列章节描述了该仓库的结构和内容(第[2][6]节)、创建方法(第[3][7]节)和该如何使用(第[4][8]节)。 + +### 2、数据概览 ### + +这 1GB 的 Unix 历史仓库可以从 [GitHub][9] 上克隆^[1][10] 。如今^[2][11] ,这个仓库包含来自 850 个贡献者的 659,000 个提交和 2,306 个合并。贡献者有来自贝尔实验室(Bell Labs)的 23 个员工,伯克利大学(Berkeley University)的计算机系统研究组(Computer Systems Research Group)(CSRG)的 158 个人,和 FreeBSD 项目的 660 个成员。 + +这个仓库的生命始于一个 *Epoch* 的标签,这里面只包含了证书信息和现在的 README 文件。其后各种各样的标签和分支记录了很多重要的时刻。 + +- *Research-VX* 标签对应来自贝尔实验室(Bell Labs)六个研究版本。从 *Research-V1* (4768 行 PDP-11 汇编代码)开始,到以 *Research-V7* (大约 324,000 行代码,1820 个 C 文件)结束。 +- *Bell-32V* 是第七个版本 Unix 在 DEC/VAX 架构上的移植。 +- *BSD-X* 标签对应伯克利大学(Berkeley University)释出的 15 个快照。 +- *386BSD-X* 标签对应该系统的两个开源版本,主要是 Lynne 和 William Jolitz 写的适用于 Intel 386 架构的内核代码。 +- *FreeBSD-release/X* 标签和分支标记了来自 FreeBSD 项目的 116 个发行版。 + +另外,以 *-Snapshot-Development* 为后缀的分支,表示该提交由来自一个以时间排序的快照文件序列而合成;而以一个 *-VCS-Development* 为后缀的标签,标记了有特定发行版出现的历史分支的时刻。 + +仓库的历史包含从系统开发早期的一些提交,比如下面这些。 + + commit c9f643f59434f14f774d61ee3856972b8c3905b1 + Author: Dennis Ritchie + Date: Mon Dec 2 18:18:02 1974 -0500 + Research V5 development + Work on file usr/sys/dmr/kl.c + +两个发布之间的合并代表着系统发生了进化,比如 BSD 3 的开发来自 BSD2 和 Unix 32/V,它在 Git 仓库里正是被表示为带两个父节点的图形节点。 + +更为重要的是,以这种方式构造的仓库允许 **git blame**,就是可以给源代码行加上注释,如版本、日期和它们第一次出现相关联的作者,这样可以知道任何代码的起源。比如说,检出 **BSD-4** 这个标签,并在内核的 *pipe.c* 文件上运行一下 git blame,就会显示出由 Ken Thompson 写于 1974,1975 和 1979年的代码行,和 Bill Joy 写于 1980 年的。这就可以自动(尽管计算上比较费事)检测出任何时刻出现的代码。 + +![](http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/provenance.png) + +*图1:各个重大 Unix 发行版的代码来源* + +如[上图][12]所示,现代版本的 Unix(FreeBSD 9)依然有相当部分的来自 BSD 4.3,BSD 4.3 Net/2 和 BSD 2.0 的代码块。有趣的是,这图片显示有部分代码好像没有保留下来,当时激进地要创造一个脱离于伯克利(386BSD 和 FreeBSD 1.0)所释出代码的开源操作系统。FreeBSD 9 中最古老的代码是一个 18 行的队列,在 C 库里面的 timezone.c 文件里,该文件也可以在第七版的 Unix 文件里找到,同样的名字,时间戳是 1979 年一月十日 - 36 年前。 + +### 3、数据收集和处理 ### + +这个项目的目的是以某种方式巩固从数据方面说明 Unix 的进化,通过将其并入一个现代的版本仓库,帮助人们对系统进化的研究。项目工作包括收录数据,分类并综合到一个单独的 Git 仓库里。 + +![](http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/branches.png) + +*图2:导入 Unix 快照、仓库及其合并* + +项目以三种数据类型为基础(见[图2][13])。首先,早期发布版本的快照,获取自 [Unix 遗产社会归档(Unix Heritage Society archive)][14]^[3][15] 、包括了 CSRG 全部的源代码归档的 [CD-ROM 镜像][16]^[4][17] , [Oldlinux 网站][18]^[5][19] 和 [FreeBSD 归档][20]^[6][21] 。 其次,以前的和现在的仓库,即 CSRG SCCS [[6][22]] 仓库,FreeBSD 1 CVS 仓库,和[现代 FreeBSD 开发的 Git 镜像][23]^[7][24] 。前两个都是从和快照相同的来源获得的。 + +最后,也是最费力的数据源是 **初步研究(primary research)**。释出的快照并没有提供关于它们的源头和每个文件贡献者的信息。因此,这些信息片段需要通过初步研究(primary research)验证。至于作者信息主要通过作者的自传,研究论文,内部备忘录和旧文档扫描件;通过阅读并且自动处理源代码和帮助页面补充;通过与那个年代的人用电子邮件交流;在 *StackExchange* 网站上贴出疑问;查看文件的位置(在早期的内核版本的源代码,分为 `usr/sys/dmr` 和 `/usr/sys/ken` 两个位置);从研究论文和帮助手册披露的作者找到源代码,从一个又一个的发行版中获取。(有趣的是,第一和第二的研究版(Research Edition)帮助页面都有一个 “owner” 部分,列出了作者(比如,*Ken*)及对应的系统命令、文件、系统调用或库函数。在第四版中这个部分就没了,而在 BSD 发行版中又浮现了 “Author” 部分。)关于作者信息更为详细地写在了项目的文件中,这些文件被用于匹配源代码文件和它们的作者和对应的提交信息。最后,关于源代码库之间的合并信息是获取自[ NetBSD 项目所维护的 BSD 家族树][25]^[8][26] 。 + +作为本项目的一部分而开发的软件和数据文件,现在可以[在线获取][27]^[9][28] ,并且,如果有合适的网络环境,CPU 和磁盘资源,可以用来从头构建这样一个仓库。关于主要发行版的作者信息,都存储在本项目的 `author-path` 目录下的文件里。它们的内容中带有正则表达式的文件路径后面指出了相符的作者。可以指定多个作者。正则表达式是按线性处理的,所以一个文件末尾的匹配一切的表达式可以指定一个发行版的默认作者。为避免重复,一个以 `.au` 后缀的独立文件专门用于映射作者的识别号(identifier)和他们的名字及 email。这样一个文件为每个与该系统进化相关的社区都建立了一个:贝尔实验室(Bell Labs),伯克利大学(Berkeley University),386BSD 和 FreeBSD。为了真实性的需要,早期贝尔实验室(Bell Labs)发行版的 emails 都以 UUCP 注释(UUCP notation)方式列出(例如, `research!ken`)。FreeBSD 作者的识别映射,需要导入早期的 CVS 仓库,通过从如今项目的 Git 仓库里拆解对应的数据构建。总的来说,由 1107 行构成了注释作者信息的文件(828 个规则),并且另有 640 行用于映射作者的识别号到名字。 + +现在项目的数据源被编码成了一个 168 行的 `Makefile`。它包括下面的步骤。 + +**Fetching** 从远程站点复制和克隆大约 11GB 的镜像、归档和仓库。 + +**Tooling** 从 2.9 BSD 中为旧的 PDP-11 归档获取一个归档器,并调整它以在现代的 Unix 版本下编译;编译 4.3 BSD 的 *compress* 程序来解压 386BSD 发行版,这个程序不再是现代 Unix 系统的组成部分了。 + +**Organizing** 用 *tar* 和 *cpio* 解压缩包;合并第六个研究版的三个目录;用旧的 PDP-11 归档器解压全部一个 BSD 归档;挂载 CD-ROM 镜像,这样可以作为文件系统处理;合并第 8 和 62 的 386BSD 磁盘镜像为两个独立的文件。 + +**Cleaning** 恢复第一个研究版的内核源代码文件,这个可以通过 OCR 从打印件上得到近似其原始状态的的格式;给第七个研究版的源代码文件打补丁;移除发行后被添加进来的元数据和其他文件,为避免得到错误的时间戳信息;修复毁坏的 SCCS 文件;用一个定制的 Perl 脚本移除指定到多个版本的 CVS 符号、删除与现在冲突的 CVS *Attr* 文件、用 *cvs2svn* 将 CVS 仓库转换为 Git 仓库,以处理早期的 FreeBSD CVS 仓库。 + +在仓库再现(representation)中有一个很有意思的部分就是,如何导入那些快照,并以一种方式联系起来,使得 *git blame* 可以发挥它的魔力。快照导入到仓库是基于每个文件的时间戳作为一系列的提交实现的。当所有文件导入后,就被用对应发行版的名字给标记了。然后,可以删除那些文件,并开始导入下一个快照。注意 *git blame* 命令是通过回溯一个仓库的历史来工作的,并使用启发法(heuristics)来检测文件之间或文件内的代码移动和复制。因此,删除掉的快照间会产生中断,以防止它们之间的代码被追踪。 + +相反,在下一个快照导入之前,之前快照的所有文件都被移动到了一个隐藏的后备目录里,叫做 `.ref`(引用)。它们保存在那,直到下个快照的所有文件都被导入了,这时候它们就会被删掉。因为 `.ref` 目录下的每个文件都精确对应一个原始文件,*git blame* 可以知道多少源代码通过 `.ref` 文件从一个版本移到了下一个,而不用显示出 `.ref` 文件。为了更进一步帮助检测代码起源,同时增加再现(representation)的真实性,每个发行版都被再现(represented)为一个有增量文件的分支(*-Development*)与之前发行版之间的合并。 + +上世纪 80 年代时期,只有伯克利(Berkeley) 开发的文件的一个子集是用 SCCS 版本控制的。在那个期间,我们的统一仓库里包含了来自 SCCS 的提交和快照的增量文件的导入数据。对于每个发行版,可用最近的时间戳找到该 SCCS 提交,并被标记为一个与发行版增量导入分支的合并。这些合并可以在[图2][29] 的中间看到。 + +将各种数据资源综合到一个仓库的工作,主要是用两个脚本来完成的。一个 780 行的 Perl 脚本(`import-dir.pl`)可以从一个单独的数据源(快照目录、SCCS 仓库,或者 Git 仓库)中,以 *Git fast export* 格式导出(真实的或者综合的)提交历史。输出是一个简单的文本格式,Git 工具用这个来导入和导出提交。其他方面,这个脚本以一些东西为参数,如文件到贡献者的映射、贡献者登录名和他们的全名间的映射、哪个导入的提交会被合并、哪些文件要处理和忽略、以及“引用”文件的处理。一个 450 行的 Shell 脚本创建 Git 仓库,并调用带适当参数的 Perl 脚本,来导入 27 个可用的历史数据资源。Shell 脚本也会运行 30 个测试,比较特定标签的仓库和对应的数据源,核对查看的目录中出现的和没出现的,并回溯查看分支树和合并的数量,*git blame* 和 *git log* 的输出。最后,调用 *git* 作垃圾收集和仓库压缩,从最初的 6GB 降到分发的 1GB 大小。 + +### 4、数据使用 ### + +该数据可以用于软件工程、信息系统和软件考古学(software archeology)领域的经验性研究。鉴于它从不间断而独一无二的存在了超过了 40 年,可以供软件进化和跨代更迭参考。从那时以来,处理速度已经成千倍地增长、存储容量扩大了百万倍,该数据同样可以用于软件和硬件技术交叉进化(co-evolution)的研究。软件开发从研究中心到大学,到开源社区的转移,可以用来研究组织文化对于软件开发的影响。该仓库也可以用于学习著名人物的实际编程,比如 Turing 奖获得者(Dennis Ritchie 和 Ken Thompson)和 IT 产业的大佬(Bill Joy 和 Eric Schmidt)。另一个值得学习的现象是代码的长寿,无论是单行的水平,或是作为那个时代随 Unix 发布的完整的系统(Ingres、 Lisp、 Pascal、 Ratfor、 Snobol、 TMP),和导致代码存活或消亡的因素。最后,因为该数据让 Git 感到了压力,底层的软件仓库存储技术达到了其极限,这会推动版本管理系统领域的工程进度。 + +![](http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/metrics.png) + +*图3:Unix 发行版的代码风格进化* + +[图3][30] 根据 36 个主要 Unix 发行版描述了一些有趣的代码统计的趋势线(用 R 语言的局部多项式回归拟合函数生成),验证了代码风格和编程语言的使用在很长的时间尺度上的进化。这种进化是软硬件技术的需求和支持、软件构筑理论,甚至社会力量所驱动的。图片中的日期计算了出现在一个给定发行版中的所有文件的平均日期。正如可以从中看到,在过去的 40 年中,标示符和文件名字的长度已经稳步从 4 到 6 个字符增长到 7 到 11 个字符。我们也可以看到注释数量的少量稳步增加,以及 *goto* 语句的使用量减少,同时 *register* 这个类型修饰符的消失。 + +### 5、未来的工作 ### + +可以做很多事情去提高仓库的正确性和有效性。创建过程以开源代码共享了,通过 GitHub 的拉取请求(pull request),可以很容易地贡献更多代码和修复。最有用的社区贡献将使得导入的快照文件的覆盖面增长,以便归属于某个具体的作者。现在,大约 90,000 个文件(在 160,000 总量之外)通过默认规则指定了作者。类似地,大约有 250 个作者(最初 FreeBSD 那些)仅知道其识别号。两个都列在了 build 仓库的 unmatched 目录里,欢迎贡献数据。进一步,BSD SCCS 和 FreeBSD CVS 的提交共享相同的作者和时间戳,这些可以结合成一个单独的 Git 提交。导入 SCCS 文件提交的支持会被添加进来,以便引入仓库对应的元数据。最后,也是最重要的,开源系统的更多分支会添加进来,比如 NetBSD、 OpenBSD、DragonFlyBSD 和 *illumos*。理想情况下,其他历史上重要的 Unix 发行版,如 System III、System V、 NeXTSTEP 和 SunOS 等的当前版权拥有者,也会在一个允许他们的合作伙伴使用仓库用于研究的协议下释出他们的系统。 + +### 鸣谢 ### + +本文作者感谢很多付出努力的人们。 Brian W. Kernighan, Doug McIlroy 和 Arnold D. Robbins 在贝尔实验室(Bell Labs)的登录识别号方面提供了帮助。 Clem Cole, Era Erikson, Mary Ann Horton, Kirk McKusick, Jeremy C. Reed, Ingo Schwarze 和 Anatole Shaw 在 BSD 的登录识别号方面提供了帮助。BSD SCCS 的导入代码是基于 H. Merijn Brand 和 Jonathan Gray 的工作。 + +这次研究由欧盟 ( 欧洲社会基金(European Social Fund,ESF)) 和 希腊国家基金(Greek national funds)通过国家战略参考框架( National Strategic Reference Framework ,NSRF) 的 Operational Program " Education and Lifelong Learning" - Research Funding Program: Thalis - Athens University of Economics and Business - Software Engineering Research Platform ,共同出资赞助。 + +### 引用 ### + +[[1]][31] + M. D. McIlroy, E. N. Pinson, and B. A. Tague, "UNIX time-sharing system: Foreword," *The Bell System Technical Journal*, vol. 57, no. 6, pp. 1899-1904, July-August 1978. + +[[2]][32] + D. M. Ritchie and K. Thompson, "The UNIX time-sharing system," *Bell System Technical Journal*, vol. 57, no. 6, pp. 1905-1929, July-August 1978. + +[[3]][33] + D. M. Ritchie, "The evolution of the UNIX time-sharing system," *AT&T Bell Laboratories Technical Journal*, vol. 63, no. 8, pp. 1577-1593, Oct. 1984. + +[[4]][34] + P. H. Salus, *A Quarter Century of UNIX*. Boston, MA: Addison-Wesley, 1994. + +[[5]][35] + E. S. Raymond, *The Art of Unix Programming*. Addison-Wesley, 2003. + +[[6]][36] + M. J. Rochkind, "The source code control system," *IEEE Transactions on Software Engineering*, vol. SE-1, no. 4, pp. 255-265, 1975. + +---------- + +#### 脚注 #### + +[1][37] - [https://github.com/dspinellis/unix-history-repo][38] + +[2][39] - Updates may add or modify material. To ensure replicability the repository's users are encouraged to fork it or archive it. + +[3][40] - [http://www.tuhs.org/archive_sites.html][41] + +[4][42] - [https://www.mckusick.com/csrg/][43] + +[5][44] - [http://www.oldlinux.org/Linux.old/distributions/386BSD][45] + +[6][46] - [http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/][47] + +[7][48] - [https://github.com/freebsd/freebsd][49] + +[8][50] - [http://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/share/misc/bsd-family-tree][51] + +[9][52] - [https://github.com/dspinellis/unix-history-make][53] + +-------------------------------------------------------------------------------- + +via: http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html + +作者:Diomidis Spinellis +译者:[wi-cuckoo](https://github.com/wi-cuckoo) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#MPT78 +[2]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#RT78 +[3]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#Rit84 +[4]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#Sal94 +[5]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#Ray03 +[6]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#sec:data +[7]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#sec:dev +[8]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#sec:use +[9]:https://github.com/dspinellis/unix-history-repo +[10]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#tthFtNtAAB +[11]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#tthFtNtAAC +[12]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#fig:provenance +[13]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#fig:branches +[14]:http://www.tuhs.org/archive_sites.html +[15]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#tthFtNtAAD +[16]:https://www.mckusick.com/csrg/ +[17]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#tthFtNtAAE +[18]:http://www.oldlinux.org/Linux.old/distributions/386BSD +[19]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#tthFtNtAAF +[20]:http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/ +[21]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#tthFtNtAAG +[22]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#SCCS +[23]:https://github.com/freebsd/freebsd +[24]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#tthFtNtAAH +[25]:http://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/share/misc/bsd-family-tree +[26]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#tthFtNtAAI +[27]:https://github.com/dspinellis/unix-history-make +[28]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#tthFtNtAAJ +[29]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#fig:branches +[30]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#fig:metrics +[31]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#CITEMPT78 +[32]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#CITERT78 +[33]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#CITERit84 +[34]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#CITESal94 +[35]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#CITERay03 +[36]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#CITESCCS +[37]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#tthFrefAAB +[38]:https://github.com/dspinellis/unix-history-repo +[39]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#tthFrefAAC +[40]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#tthFrefAAD +[41]:http://www.tuhs.org/archive_sites.html +[42]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#tthFrefAAE +[43]:https://www.mckusick.com/csrg/ +[44]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#tthFrefAAF +[45]:http://www.oldlinux.org/Linux.old/distributions/386BSD +[46]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#tthFrefAAG +[47]:http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/ +[48]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#tthFrefAAH +[49]:https://github.com/freebsd/freebsd +[50]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#tthFrefAAI +[51]:http://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/share/misc/bsd-family-tree +[52]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#tthFrefAAJ +[53]:https://github.com/dspinellis/unix-history-make diff --git a/translated/tech/20150917 A Repository with 44 Years of Unix Evolution.md b/translated/tech/20150917 A Repository with 44 Years of Unix Evolution.md deleted file mode 100755 index 43b3b9e219..0000000000 --- a/translated/tech/20150917 A Repository with 44 Years of Unix Evolution.md +++ /dev/null @@ -1,202 +0,0 @@ -一个涵盖 Unix 44 年进化史的仓库 -============================================================================= -### 摘要 ### - -Unix 操作系统的进化历史,可以从一个版本控制的仓库中窥见,时间跨越从 1972 年以 5000 行内核代码的出现,到 2015 年成为一个含有 26,000,000 行代码的被广泛使用的系统。该仓库包含 659,000 条提交,和 2306 次合并。仓库部署被普遍采用的 Git 系统储存其代码,并且在时下流行的 GitHub 上建立了档案。它综合了系统定制软件的 24 个快照,都是开发自贝尔实验室,伯克利大学,386BSD 团队,两个传统的仓库 和 开源 FreeBSD 系统的仓库。总的来说,850 位个人贡献者已经确认,更早些时候的一批人主要做基础研究。这些数据可以用于一些经验性的研究,在软件工程,信息系统和软件考古学领域。 - -### 1 介绍 ### - -Unix 操作系统作为一个主要的工程上的突破而脱颖而出,得益于其模范的设计,大量的技术贡献,它的开发模型和广泛的使用。Unix 编程环境的设计已经被标榜为一个能提供非常简洁,功能强大并且优雅的设计[[1][1]]。在技术方面,许多对 Unix 有直接贡献的,或者因 Unix 而流行的特性就包括[[2][2]]:用高级语言编写的可移植部署的内核;一个分层式设计的文件系统;兼容的文件,设备,网络和进程间 I/O;管道和过滤架构;虚拟文件系统;和用户可选的 shell。很早的时候,就有一个庞大的社区为 Unix 贡献软件[[3][3]],[[4][4]],pp. 65-72]。随时间流走,这个社区不断壮大,并且以现在称为开源软件开发的方式在工作着[[5][5],pp. 440-442]。Unix 和其睿智的晚辈们也将 C 和 C++ 编程语言,分析程序和词法分析生成器(*yacc,lex*),发扬光大了,文档编制工具(*troff,eqn,tbl*),脚本语言(*awk,sed,Perl*),TCP/IP 网络,和配置管理系统(*SCSS,RCS,Subversion,Git*)发扬广大了,同时也形成了大部分的现代互联网基础设施和网络。 - -幸运的是,一些重要的具有历史意义的 Unix 材料已经保存下来了,现在保持对外开放。尽管 Unix 最初是由相对严格的协议发行,但在早期的开发中,很多重要的部分是通过 Unix 的某个版权拥有者以一个自由的协议发行。然后将这些部分再结合开发的软件或者以开源发行的软件,Berkeley,Californai 大学和 FreeBSD 项目组从 1972 年六月二十日开始到现在,提供了涵盖整个系统的开发。 - -Curating and processing available snapshots as well as old and modern configuration management repositories allows the reconstruction of a new synthetic Git repository that combines under a single roof most of the available data. This repository documents in a digital form the detailed evolution of an important digital artefact over a period of 44 years. The following sections describe the repository's structure and contents (Section [II][6]), the way it was created (Section [III][7]), and how it can be used (Section [IV][8]). - -### 2. 数据概览 ### - -这 1GB 的 Unix 仓库可以从 [GitHub][9] 克隆。[1][10]如今[2][11],这个仓库包含来自 850 个贡献者的 659,000 个提交和 2306 个合并。贡献者有来自 Bell 实验室的 23 个员工,Berkeley 计算机系统研究组(CSRG)的 158 个人,和 FreeBSD 项目的 660 个成员。 - -这个仓库的生命始于一个 *Epoch* 的标签,这里面只包含了证书信息和现在的 README 文件。其后各种各样的标签和分支记录了很多重要的时刻。 - -- *Research-VX* 标签对应来自 Bell 实验室六次的研究版本。从 *Research-V1* (PDP-11 4768 行汇编代码)开始,到以 *Research-V7* (大约 324,000 行代码,1820 个 C 文件)结束。 -- *Bell-32V* 是 DEC/VAX 架构的 Unix 第七个版本的一部分。 -- *BSD-X* 标签对应 Berkeley 释出的 15 个快照。 -- *386BSD-X* 标签对应系统的两个开源版本,主要是 Lynne 和 William Jolitz 写的 适用于 Intel 386 架构的内核代码。 -- *FreeBSD-release/X* 标签和分支标记了来自 FreeBSD 项目的 116 个发行版。 - -另外,以 *-Snapshot-Development* 为后缀的分支,表示一个被综合的以时间排序的快照文件序列的一些提交,而以一个 *-VCS-Development* 为后缀的标签,标记了有特别发行版出现的历史分支的时刻。 - -仓库的历史包含从系统开发早期的一些提交,比如下面这些。 - - commit c9f643f59434f14f774d61ee3856972b8c3905b1 - Author: Dennis Ritchie - Date: Mon Dec 2 18:18:02 1974 -0500 - Research V5 development - Work on file usr/sys/dmr/kl.c - -释出间隙的合并随着系统进化而发生,比如 从 BSD 2 到 BSD 3 的开发,Unix 32/V 也是正确地代表了 Git 仓库里带两个父节点的图形节点。(这太莫名其妙了) - -更为重要的是,该仓库的构造方式允许 **git blame**,就是可以给源代码加上注释,如版本,日期和它们第一次出现相关联的作者,这样可以知道任何代码的起源。比如说 **BSD-4** 这个标签,在内核的 *pipe.c* 文件上运行一下 git blame,就会显示代码行由 Ken Thompson 写于 1974,1975 和 1979年,Bill Joy 写于 1980 年。这就可以自动(尽管计算上比较费事)检测出任何时刻出现的代码。 - -![](http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/provenance.png) - -Figure 1: Code provenance across significant Unix releases. - -如上图[12]所示,现代版本的 Unix(FreeBSD 9)依然有来自 BSD 4.3,BSD 4.3 Net/2 和 BSD 2.0 的代码块。有趣的是,这图片显示有部分代码好像没有保留下来,当时激进地要创造一个脱离于 Berkeyel(386BSD 和 FreeBSD 1.0)释出代码的开源操作系统,其所开发的代码。FreeBSD 9 中最古老的代码是一个 18 行的队列,在 C 库里面的 timezone.c 文件里,该文件也可以在第七版的 Unix 文件里找到,同样的名字,时间戳是 1979 年一月十日 - 36 年前。 - -### 数据收集和处理 ### - -这个项目的目的是以某种方式巩固从数据方面说明 Unix 的进化,通过将其并入一个现代的修订仓库,帮助人们对系统进化的研究。项目工作包括收录数据,分类并综合到一个单独的 Git 仓库里。 - -![](http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/branches.png) - -Figure 2: Imported Unix snapshots, repositories, and their mergers. - -项目以三种数据类型为基础(见 Figure [2][13])。首先,早些发布的版本快照,是从 [Unix Heritage Society archive][14] 中获得,[2][15] 在 [CD-ROM 镜像][16] 中包括 CSRG 全部的源包,[4][17] [Oldlinux site],[5][19] 和 [FreeBSD 包][20]。[6][21] 其次,以前的,现在的仓库,也就是 CSRG SCCS [[6][22]] 仓库,FreeBSD 1 CVS 仓库,和[现代 FreeBSD 开发的 Git 镜像][23]。[7][24]前两个都是从相同的源获得而作为对应的快照。 - -最后,也是最费力的数据源是 **primary research**。释出的快照并没有提供关于它们的源头和每个文件贡献者的信息。因此,这些信息片段需要通过 primary research 验证。至于作者信息主要通过作者的自传,研究论文,内部备忘录和旧文档扫描;通过阅读并且自动处理源代码和帮助页面补充;通过与那个年代的人用电子邮件交流;在 *StackExchange* 网站上贴出疑问;查看文件的位置(在早期的内核源代码版本中,分为 `usr/sys/dmr` 和 `/usr/sys/ken`);从研究论文和帮助手册到源代码,从一个发行版到另一个发行版地宣传中获取。(有趣的是,第一和第二的研究版帮助页面都有一个 “owner” 部分,列出了作者(比如,*Ken*)与对应的系统命令,文件,系统调用,或者功能库。在第四版中这个部分就没了,而在 BSD 发行版中又浮现了 “Author” 部分。)关于作者信息更为详细地写在了项目的文件中,这些文件被用于匹配源代码文件和它们的作者和对应的提交信息。最后,information regarding merges between source code bases was obtained from a [BSD family tree maintained by the NetBSD project][25].[8][26](不好组织这个语言) - -作为该项目的一部分而开发的软件和数据文件,现在可以[在线获取][27],[9][28],并且,如果有合适的网络环境,CPU 和磁盘资源,可以用来从头构建这样一个仓库。关于主要发行版的所有者信息,都存储在该项目 `author-path` 目录下的文件里。These contain lines with a regular expressions for a file path followed by the identifier of the corresponding author.(这句单词都认识,但是不理解具体意思)也可以制定多个作者。正则表达式是按线性处理的,所以一个文件末尾的匹配一切的表达式可以指定一个发行版的默认作者。为避免重复,一个以 `.au` 后缀的独立文件专门用于映射作者身份到他们的名字和 email。这样一个文件为每个社区建立了一个,以关联系统的进化:Bell 实验室,Berkeley,386BSD 和 FreeBSD。为了真实性的需要,早期 Bell 实验室发行版的 emails 都以 UUCP 注释列出了(e.g. `research!ken`)。FreeBSD 作者的鉴定人图谱,需要导入早期的 CVS 仓库,通过从如今项目的 Git 仓库里解压对应的数据构建。总的来说,注释作者信息的文件(828 rules)包含 1107 行,并且另外 640 映射作者鉴定人到名字。 - -现在项目的数据源被编码成了一个 168 行的 `Makefile`。它包括下面的步骤。 - -**Fetching** 从远程站点复制和克隆大约 11GB 的镜像,档案和仓库。 - -**Tooling** 从 2.9 BSD 中为旧的 PDP-11 档案获取一个归档器,并作出调整来在现代的 Unix 版本下编译;编译 4.3 BSD *compress* 程序来解压 386BSD 发行版,这个程序不再是现代 Unix 系统的组成部分了。 - -**Organizing** 用 tar 和 *cpio* 解压缩包;结合第六版的三个目录;用旧的 PDP-11 归档器解压所有的 1 BSD 档案;挂载 CD-ROM 镜像,这样可以作为文件系统处理;组合 8 和 62 386BSD 散乱的磁盘镜像为两个独立的文件。 - -**Cleaning** 重新存储第一版的内核源代码文件,这个可以通过合适的字符识别从打印输出用获取;给第七版的源代码文件打补丁;移除一个发行版后被添加进来的元数据和其他文件,为避免得到错误的时间戳信息;修复毁坏的 SCCS 文件;通过移除 CVS symbols assigned to multiple revisions with a custom Perl script,删除 CVS *Attr* 文件和用 *cvs2svn* 将 CVS 仓库转换为 Git 仓库,来处理早期的 FreeBSD CVS 仓库。 - -在仓库表述中有一个很有意思的部分就是,如何导入那些快照,并以一种方式联系起来,使得 *git blame* 可以发挥它的魔力。快照导入到仓库是作为一系列的提交实现的,根据每个文件的时间戳。当所有文件导入后,就被用对应发行版的名字给标记了。在这点上,一个人可以删除那些文件,并开始导入下一个快照。注意 *git blame* 命令是通过回溯一个仓库的历史来工作的,并使用启发法来检测文件之间或内部的代码移动和复制。因此,删除掉的快照间会产生中断,防止它们之间的代码被追踪。 - -相反,在下一个快照导入之前,之前快照的所有文件都被移动到了一个隐藏的后备目录里,叫做 `.ref`(引用)。它们保存在那,直到下个快照的所有文件都被导入了,这时候它们就会被删掉。因为 `.ref` 目录下的每个文件都完全配对一个原始文件,*git blame* 可以知道多少源代码通过 `.ref` 文件从一个版本移到了下一个,而不用显示出 `.ref` 文件。为了更进一步帮助检测代码起源,同时增加表述的真实性,每个发行版都被表述成了一个合并,介于有增加文件的分支(*-Development*)与之前发行版之间的合并。 - -上世纪 80 年代这个时期,只有 Berkeley 开发文件的一个子集是用 SCCS 版本控制的。整个时期内,我们统一的仓库里包含了来自 SCCS 的提交和快照增加的文件。在每个发行版的时间点上,可以发现 SCCS 最近的提交,被标记成一个发行版中增加的导入分支的合并。这些合并可以在 Figure [2][29] 中间看到。 - -将各种数据资源综合到一个仓库的工作,主要是用两个脚本来完成的。一个 780 行的 Perl 脚本(`import-dir.pl`)可以从一个单独的数据源(快照目录,SCCS 仓库,或者 Git 仓库)中,以 *Git fast export* 格式导出(真实的或者综合的)提交历史。输出是一个简单的文本格式,Git 工具用这个来导入和导出提交。其他方面,这个脚本以一些东西为参数,如文件到贡献者的映射,贡献者登录名和他们的全名间的映射,导入的提交会被合并,哪些文件要处理,哪些文件要忽略,和“引用”文件的处理。一个 450 行的 Shell 脚本创建 Git 仓库,并调用带适当参数的 Perl 脚本,导入 27 个可用的历史数据资源。Shell 脚本也会跑 30 遍测试,比较特定标签的仓库和对应的数据源,确认出现的和没出现的备用目录,并查看分支树和合并的数量,*git blame* 和 *git log* 的输出中的退化。最后,*git* 被调用来作垃圾收集和压缩仓库,从最初的 6GB 降到发行的 1GB。 - -### 4 数据使用 ### - -数据可以用于软件工程,信息系统和软件考古学领域的经验性研究。鉴于它从不间断而独一无二的存在了超过了 40 年,可以供软件的进化和代代更迭参考。伴随那个时代以来在处理速度千倍地增长,存储容量百万倍的扩大,数据同样可以用于软件和硬件技术交叉进化的研究。软件开发从研究中心到大学,到开源社区的转移,可以用来研究组织文化对于软件开发的影响。仓库也可以用于学习开发者编程的影响力,比如 Turing 奖获得者(Dennis Ritchie 和 Ken Thompson)和 IT 产业的大佬(Bill Joy 和 Eric Schmidt)。另一个值得学习的现象是代码的长寿,无论是单行的水平,或是作为那个时代随 Unix 发行的完整的系统(Ingres, Lisp, Pascal, Ratfor, Snobol, TMP),和导致代码存活或消亡的因素。最后,因为数据使 Git 底层软件仓库存储技术感到压力,到了它的限度,这会加速修正管理系统领域的工程进度。 - -![](http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/metrics.png) - -Figure 3: Code style evolution along Unix releases. - -Figure [3][30] 描述了一些有趣的代码统计,根据 36 个主要 Unix 发行版,验证了代码风格和编程语言的使用在很长的时间尺度上的进化。这种进化是软硬件技术的需求和支持驱动的,软件构筑理论,甚至社会力量。图片中的数据已经计算了在一个所给发行版中出现的文件的平均时间。正如可以从中看到,在过去的 40 年中,验证器和文件名字的长度已经稳定从 4 到 6 个字符增长到 7 到 11 个字符。我们也可以看到在评论数量的少量稳定增加,和 *goto* 表达的使用量减少,同时 *register* 这个类型修改器的消失。 - -### 5 未来的工作 ### - -可以做很多事情去提高仓库的正确性和有效性。创建进程作为源代码开源了,通过 GitHub 的拉取请求,可以很容易地贡献更多代码和修复。最有用的社区贡献会使得导入的快照文件的覆盖增长,这曾经是隶属于一个具体的作者。现在,大约 90,000 个文件(在 160,000 总量之外)被指定了作者,根据一个默认的规则。类似地,大约有 250 个作者(最初 FreeBSD 那些)是验证器确认的。两个都列在了 build 仓库无配对的目录里,也欢迎贡献数据。进一步,BSD SCCS 和 FreeBSD CVS 的提交,共享相同的作者和时间戳,这些可以结合成一个单独的 Git 提交。导入 SCCS 文件提交的支持会被添加进来,为了引入仓库对应的元数据。最后,最重要的,开源系统的更多分支会添加进来,比如 NetBSD OpenBSD, DragonFlyBSD 和 *illumos*。理想地,其他重要的历史上的 Unix 发行版,它们的版权拥有者,如 System III, System V, NeXTSTEP 和 SunOS,也会在一个协议下释出他们的系统,允许他们的合作伙伴使用仓库用于研究。 - -### 鸣谢 ### - -本人感谢很多付出努力的人们。 Brian W. Kernighan, Doug McIlroy 和 Arnold D. Robbins 帮助 Bell 实验室开发了登录验证器。 Clem Cole, Era Erikson, Mary Ann Horton, Kirk McKusick, Jeremy C. Reed, Ingo Schwarze 和 Anatole Shaw 开发了 BSD 的登录验证器。BSD SCCS 导入了 H. Merijn Brand 和 Jonathan Gray 的开发工作的代码。 - -这次研究通过 National Strategic Reference Framework (NSRF) 的 Operational Program " Education and Lifelong Learning" - Research Funding Program: Thalis - Athens University of Economics and Business - Software Engineering Research Platform,由 European Union ( European Social Fund - ESF) 和 Greek national funds 出资赞助。 - -### 引用 ### - -[[1]][31] - M. D. McIlroy, E. N. Pinson, and B. A. Tague, "UNIX time-sharing system: Foreword," *The Bell System Technical Journal*, vol. 57, no. 6, pp. 1899-1904, July-August 1978. - -[[2]][32] - D. M. Ritchie and K. Thompson, "The UNIX time-sharing system," *Bell System Technical Journal*, vol. 57, no. 6, pp. 1905-1929, July-August 1978. - -[[3]][33] - D. M. Ritchie, "The evolution of the UNIX time-sharing system," *AT&T Bell Laboratories Technical Journal*, vol. 63, no. 8, pp. 1577-1593, Oct. 1984. - -[[4]][34] - P. H. Salus, *A Quarter Century of UNIX*. Boston, MA: Addison-Wesley, 1994. - -[[5]][35] - E. S. Raymond, *The Art of Unix Programming*. Addison-Wesley, 2003. - -[[6]][36] - M. J. Rochkind, "The source code control system," *IEEE Transactions on Software Engineering*, vol. SE-1, no. 4, pp. 255-265, 1975. - ----------- - -#### Footnotes: #### - -[1][37] - [https://github.com/dspinellis/unix-history-repo][38] - -[2][39] - Updates may add or modify material. To ensure replicability the repository's users are encouraged to fork it or archive it. - -[3][40] - [http://www.tuhs.org/archive_sites.html][41] - -[4][42] - [https://www.mckusick.com/csrg/][43] - -[5][44] - [http://www.oldlinux.org/Linux.old/distributions/386BSD][45] - -[6][46] - [http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/][47] - -[7][48] - [https://github.com/freebsd/freebsd][49] - -[8][50] - [http://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/share/misc/bsd-family-tree][51] - -[9][52] - [https://github.com/dspinellis/unix-history-make][53] - --------------------------------------------------------------------------------- - -via: http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html - -译者:[wi-cuckoo](https://github.com/wi-cuckoo) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[1]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#MPT78 -[2]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#RT78 -[3]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#Rit84 -[4]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#Sal94 -[5]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#Ray03 -[6]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#sec:data -[7]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#sec:dev -[8]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#sec:use -[9]:https://github.com/dspinellis/unix-history-repo -[10]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#tthFtNtAAB -[11]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#tthFtNtAAC -[12]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#fig:provenance -[13]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#fig:branches -[14]:http://www.tuhs.org/archive_sites.html -[15]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#tthFtNtAAD -[16]:https://www.mckusick.com/csrg/ -[17]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#tthFtNtAAE -[18]:http://www.oldlinux.org/Linux.old/distributions/386BSD -[19]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#tthFtNtAAF -[20]:http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/ -[21]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#tthFtNtAAG -[22]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#SCCS -[23]:https://github.com/freebsd/freebsd -[24]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#tthFtNtAAH -[25]:http://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/share/misc/bsd-family-tree -[26]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#tthFtNtAAI -[27]:https://github.com/dspinellis/unix-history-make -[28]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#tthFtNtAAJ -[29]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#fig:branches -[30]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#fig:metrics -[31]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#CITEMPT78 -[32]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#CITERT78 -[33]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#CITERit84 -[34]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#CITESal94 -[35]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#CITERay03 -[36]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#CITESCCS -[37]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#tthFrefAAB -[38]:https://github.com/dspinellis/unix-history-repo -[39]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#tthFrefAAC -[40]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#tthFrefAAD -[41]:http://www.tuhs.org/archive_sites.html -[42]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#tthFrefAAE -[43]:https://www.mckusick.com/csrg/ -[44]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#tthFrefAAF -[45]:http://www.oldlinux.org/Linux.old/distributions/386BSD -[46]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#tthFrefAAG -[47]:http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/ -[48]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#tthFrefAAH -[49]:https://github.com/freebsd/freebsd -[50]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#tthFrefAAI -[51]:http://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/share/misc/bsd-family-tree -[52]:http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html#tthFrefAAJ -[53]:https://github.com/dspinellis/unix-history-make From bbdb9d470504664c71abe775b5a12bc4755516cc Mon Sep 17 00:00:00 2001 From: bazz2 Date: Wed, 23 Dec 2015 22:39:49 +0800 Subject: [PATCH 0027/1469] [translated]Learn with Linux--Learning Music --- .../Learn with Linux--Learning Music.md | 156 ------------------ .../Learn with Linux--Learning Music.md | 153 +++++++++++++++++ 2 files changed, 153 insertions(+), 156 deletions(-) delete mode 100644 sources/tech/Learn with Linux/Learn with Linux--Learning Music.md create mode 100644 translated/tech/Learn with Linux/Learn with Linux--Learning Music.md diff --git a/sources/tech/Learn with Linux/Learn with Linux--Learning Music.md b/sources/tech/Learn with Linux/Learn with Linux--Learning Music.md deleted file mode 100644 index f9675d59ce..0000000000 --- a/sources/tech/Learn with Linux/Learn with Linux--Learning Music.md +++ /dev/null @@ -1,156 +0,0 @@ -bazz2 -Learn with Linux: Learning Music -================================================================================ -![](https://www.maketecheasier.com/assets/uploads/2015/07/learnmusic-featured.png) - -[Linux 学习系列][1]的所有文章: - -- [Linux 教学之教你练打字][2] -- [Linux 教学之物理模拟][3] -- [Linux 教学之教你玩音乐][4] -- [Linux 教学之两款地理软件][5] -- [Linux 教学之掌握数学][6] - -引言:Linux 提供大量的教学软件和工具,面向各个年级段以及年龄段,提供大量学科的练习实践,其中大多数是可以与用户进行交互的。本“Linux 教学”系列就来介绍一些教学软件。 - -Learning music is a great pastime. Training your ears to identify scales and chords and mastering an instrument or your own voice requires lots of practise and could become difficult. Music theory is extensive. There is much to memorize, and to turn it into a “skill” you will need diligence. Linux offers exceptional software to help you along your musical journey. They will not help you become a professional musician instantly but could ease the process of learning, being a great aide and reference point. - -### Gnu Solfège ### - -[Solfège][7] is a popular music education method that is used in all levels of music education all around the world. Many popular methods (like the Kodály method) use Solfège as their basis. GNU Solfège is a great software aimed more at practising Solfège than learning it. It assumes the student has already acquired the basics and wishes to practise what they have learned. - -As the developer states on the GNU website: - -> “When you study music on high school, college, music conservatory, you usually have to do ear training. Some of the exercises, like sight singing, is easy to do alone [sic]. But often you have to be at least two people, one making questions, the other answering. […] GNU Solfège tries to help out with this. With Solfege you can practise the more simple and mechanical exercises without the need to get others to help you. Just don’t forget that this program only touches a part of the subject.” - -The software delivers its promise; you can practise essentially everything with audible and visual aids. - -GNU solfege is in the Debian (therefore Ubuntu) repositories. To get it just type the following command into a terminal: - - sudo apt-get install solfege - -When it loads, you find yourself on a simple starting screen/ - -![learnmusic-solfege-main](https://www.maketecheasier.com/assets/uploads/2015/07/learnmusic-solfege-main.png) - -The number of options is almost overwhelming. Most of the links will open sub-categories - -![learnmusic-solfege-scales](https://www.maketecheasier.com/assets/uploads/2015/07/learnmusic-solfege-scales.png) - -from where you can select individual exercises. - -![learnmusic-solfege-hun](https://www.maketecheasier.com/assets/uploads/2015/07/learnmusic-solfege-hun.png) - -There are practice sessions and tests. Both will be able to play the tones through any connected MIDI device or just your sound card’s MIDI player. The exercises often have visual notation and the ability to play back the sequence slowly. - -One important note about Solfège is that under Ubuntu you might not be able to hear anything with the default setup (unless you have a MIDI device connected). If that is the case, head over to “File -> Preferences,” select sound setup and choose the appropriate option for your system (choosing ALSA would probably work in most cases). - -![learnmusic-solfege-midi](https://www.maketecheasier.com/assets/uploads/2015/07/learnmusic-solfege-midi.png) - -Solfège could be very helpful for your daily practise. Use it regularly and you will have trained your ear before you can sing do-re-mi. - -### Tete (ear trainer) ### - -[Tete][8] (This ear trainer ‘ere) is a Java application for simple, yet efficient, [ear training][9]. It helps you identify a variety of scales by playing thhm back under various circumstances, from different roots and on different MIDI sounds. [Download it from SourceForge][10]. You then need to unzip the downloaded file. - - unzip Tete-* - -Enter the unpacked directory: - - cd Tete-* - -Assuming you have Java installed in your system, you can run the java file with - - java -jar Tete-[your version] - -(To autocomplete the above command, just press the Tab key after typing “Tete-“.) - -Tete has a simple, one-page interface with everything on it. - -![learnmusic-tete-main](https://www.maketecheasier.com/assets/uploads/2015/07/learnmusic-tete-main.png) - -You can choose to play scales (see above), chords, - -![learnmusic-tete-chords](https://www.maketecheasier.com/assets/uploads/2015/07/learnmusic-tete-chords.png) - -or intervals. - -![learnmusic-tete-intervals](https://www.maketecheasier.com/assets/uploads/2015/07/learnmusic-tete-intervals.png) - -You can “fine tune” your experience with various options including the midi instrument’s sound, what note to start from, ascending or descending scales, and how slow/fast the playback should be. Tete’s SourceForge page includes a very useful tutorial that explains most aspects of the software. - -### JalMus ### - -Jalmus is a Java-based keyboard note reading trainer. It works with attached MIDI keyboards or with the on-screen virtual keyboard. It has many simple lessons and exercises to train in music reading. Unfortunately, its development has been discontinued since 2013, but the software appears to still be functional. - -To get Jalmus, head over to the [sourceforge page][11] of its last version (2.3) to get the Java installer, or just type the following command into a terminal: - - wget http://garr.dl.sourceforge.net/project/jalmus/Jalmus-2.3/installjalmus23.jar - -Once the download finishes, load the installer with - - java -jar installjalmus23.jar - -You will be guided through a simple Java-based installer that was made for cross-platform installation. - -Jalmus’s main screen is plain. - -![learnmusic-jalmus-main](https://www.maketecheasier.com/assets/uploads/2015/07/learnmusic-jalmus-main.jpg) - -You can find lessons of varying difficulty in the Lessons menu. It ranges from very simple ones, where one notes swims in from the left, and the corresponding key lights up on the on screen keyboard … - -![learnmusic-jalmus-singlenote](https://www.maketecheasier.com/assets/uploads/2015/07/learnmusic-jalmus-singlenote.png) - -… to difficult ones with many notes swimming in from the right, and you are required to repeat the sequence on your keyboard. - -![learnmusic-jalmus-multinote](https://www.maketecheasier.com/assets/uploads/2015/07/learnmusic-jalmus-multinote.png) - -Jalmus also includes exercises of note reading single notes, which are very similar to the lessons, only without the visual hints, where your score will be displayed after you finished. It also aids rhythm reading of varying difficulty, where the rhythm is both audible and visually marked. A metronome (audible and visual) aids in the understanding - -![learnmusic-jalmus-rhythm](https://www.maketecheasier.com/assets/uploads/2015/07/learnmusic-jalmus-rhythm.png) - -and score reading where multiple notes will be played - -![learnmusic-jalmus-score](https://www.maketecheasier.com/assets/uploads/2015/07/learnmusic-jalmus-score.png) - -All these options are configurable; you can switch features on and off as you like. - -All things considered, Jalmus probably works best for rhythm training. Although it was not necessarily its intended purpose, the software really excelled in this particular use-case. - -### Notable mentions ### - -#### TuxGuitar #### - -For guitarists, [TuxGuitar][12] works much like Guitar Pro on Windows (and it can also read guitar-pro files). -PianoBooster - -[Piano Booster][13] can help with piano skills. It is designed to play MIDI files, which you can play along with on an attached keyboard, watching the core roll past on the screen. - -### Conclusion ### - -Linux offers many great tools for learning, and if your particular interest is music, your will not be left without software to aid your practice. Surely there are many more excellent software tools available for music students than were mentioned above. Do you know of any? Please let us know in the comments below. - --------------------------------------------------------------------------------- - -via: https://www.maketecheasier.com/linux-learning-music/ - -作者:[Attila Orosz][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.maketecheasier.com/author/attilaorosz/ -[1]:https://www.maketecheasier.com/series/learn-with-linux/ -[2]:https://www.maketecheasier.com/learn-to-type-in-linux/ -[3]:https://www.maketecheasier.com/linux-physics-simulation/ -[4]:https://www.maketecheasier.com/linux-learning-music/ -[5]:https://www.maketecheasier.com/linux-geography-apps/ -[6]:https://www.maketecheasier.com/learn-linux-maths/ -[7]:https://en.wikipedia.org/wiki/Solf%C3%A8ge -[8]:http://tete.sourceforge.net/index.shtml -[9]:https://en.wikipedia.org/wiki/Ear_training -[10]:http://sourceforge.net/projects/tete/files/latest/download -[11]:http://sourceforge.net/projects/jalmus/files/Jalmus-2.3/ -[12]:http://tuxguitar.herac.com.ar/ -[13]:http://www.linuxlinks.com/article/20090517041840856/PianoBooster.html diff --git a/translated/tech/Learn with Linux/Learn with Linux--Learning Music.md b/translated/tech/Learn with Linux/Learn with Linux--Learning Music.md new file mode 100644 index 0000000000..c732344a19 --- /dev/null +++ b/translated/tech/Learn with Linux/Learn with Linux--Learning Music.md @@ -0,0 +1,153 @@ +Linux 教学之教你玩音乐 +================================================================================ +![](https://www.maketecheasier.com/assets/uploads/2015/07/learnmusic-featured.png) + +[Linux 学习系列][1]的所有文章: + +- [Linux 教学之教你练打字][2] +- [Linux 教学之物理模拟][3] +- [Linux 教学之教你玩音乐][4] +- [Linux 教学之两款地理软件][5] +- [Linux 教学之掌握数学][6] + +引言:Linux 提供大量的教学软件和工具,面向各个年级段以及年龄段,提供大量学科的练习实践,其中大多数是可以与用户进行交互的。本“Linux 教学”系列就来介绍一些教学软件。 + +学习音乐是一个很好的消遣方式。训练你的耳朵能识别音阶与和弦、掌握一门乐器、控制自己的嗓音,这些都需要大量的练习,以及会遇到很多困难。音乐理论非常博大精深,有太多东西需要记忆,你需要非常勤奋才能讲这些东西变成你的“技术”。在你的音乐之路上,Linux 提供了杰出的软件来帮助你前行。它们不能让你立刻成为一个音乐家,但可以作为一个降低学习难度的好助手。 + +### Gnu Solfège ### + +[Solfège][7] 是一个世界流行的音乐教学工具,适用于各个级别的音乐教育。很多流行的教学方法(比如著名的柯达伊教学法)就使用 Solfège 作为它们的基础。相比于学到音乐知识,Solfège 更关注于让用户不断练习音乐。它假想的用户是那些已经有一些音乐基础,并且想不断练习音乐技巧的学生。 + +以下是 GNU 网站的开发者声明: + +> “当你在高校、学院、音乐学校中学习音乐,你一般要进行的一些听力训练,比如视唱,会比较简单,但是通常需要两个人配合,一个问,一个答。[...] GNU Solfège 尝试着解决这个问题,你可以在没有其他人的帮助下完成更多的简单机械式练习。只是别忘了这些练习只是整个音乐训练过程的一部分。” + +这款软件兑现了它的承诺,你可以在试听帮手的帮助下练习几乎所有音乐技巧。 + +Debian 和 Ubuntu 的远端库上有这款软件,在终端运行下面命令安装软件: + + sudo apt-get install solfege + +它开启的时候会出现一个简单的开始界面。 + +![learnmusic-solfege-main](https://www.maketecheasier.com/assets/uploads/2015/07/learnmusic-solfege-main.png) + +这些选项几乎包含了所有种类,大多数链接里面都有子类,你可以从中选择独立的练习。 + +![learnmusic-solfege-scales](https://www.maketecheasier.com/assets/uploads/2015/07/learnmusic-solfege-scales.png) + +![learnmusic-solfege-hun](https://www.maketecheasier.com/assets/uploads/2015/07/learnmusic-solfege-hun.png) + +软件提供多种练习和测试项目,都能通过外接的 MIDI 设备(LCTT 译注:MIDI,Musical Instrument Digital Interface,乐器数字接口)或者声卡来播放音乐。这些练习还配合音符播放,以及支持慢动作回放功能。 + +很重要的一点是如果你在 Ubuntu 下使用 Solfège,默认情况下你可能没法听到声音(除非你有外接 MIDI 设备)。如果出现了这种情况,点击“File -> Prefernces -> Sound Setup”,选择合适的设备(一般情况下选 ALSA 都能解决问题)。 + +![learnmusic-solfege-midi](https://www.maketecheasier.com/assets/uploads/2015/07/learnmusic-solfege-midi.png) + +Solfège 对你的日常练习非常有帮助,经常使用它,可以在你开始唱 do-re-mi 之前练好你的音乐听觉。 + +### Tete (听力训练) ### + +[Tete][8] (这款听力训练软件)是一款简单但有效的 JAVA 软件,用于[训练听力][9]。它通过在不同背景下播放不同和弦以及不同 MIDI 声音来训练你分辨不同的音阶。[从 SourceForge 下载][10],然后解压它。 + + unzip Tete-* + +进入解压出来的目录: + + cd Tete-* + +这里假设你的系统已经安装好了 JAVA,你可以使用下面的命令执行 Java 文件: + + java -jar Tete-[版本号] + +(可以在输入“Tete-”后按 Tab 键进行自动补全。) + +Tete 只有一个简单的界面,所有内容都在这里了。 + +![learnmusic-tete-main](https://www.maketecheasier.com/assets/uploads/2015/07/learnmusic-tete-main.png) + +你可以选择表演音阶(见上图),和弦(下图), + +![learnmusic-tete-chords](https://www.maketecheasier.com/assets/uploads/2015/07/learnmusic-tete-chords.png) + +或音程。 + +![learnmusic-tete-intervals](https://www.maketecheasier.com/assets/uploads/2015/07/learnmusic-tete-intervals.png) + +你可以“精调”很多选项,包括 midi 乐器的声音、提升或降低音阶以及回放的快慢等等。SourceForge 网站上有关于 Tete 的非常有用的教程,介绍了这个软件的各个方面。 + +### JalMus ### + +Jalmus 是用 JAVA 写的键盘音符阅读训练器。可以外接 MIDI 键盘,也可以使用虚拟键盘。它提供很多简单的课程练习来训练你的音符阅读能力。这个软件在2013年之后就不再更新了,但还是比较实用的。 + +进入[sourceforge 页面][11]下载最后版本(v2.3)的 JAVA 安装器,或者在终端输入下面的命令下载: + + wget http://garr.dl.sourceforge.net/project/jalmus/Jalmus-2.3/installjalmus23.jar + +下载完成后,加载安装器: + + java -jar installjalmus23.jar + +跨平台的 JAVA 安装器会一步一步引导你完成安装的。 + +Jalmus 的主界面非常朴素。 + +![learnmusic-jalmus-main](https://www.maketecheasier.com/assets/uploads/2015/07/learnmusic-jalmus-main.jpg) + +你可以在“Lessons”菜单中找到各种不同难度的课程,从非常简单(一行音符从左边向右滑过,键盘上相应的按键会高亮显示), + +![learnmusic-jalmus-singlenote](https://www.maketecheasier.com/assets/uploads/2015/07/learnmusic-jalmus-singlenote.png) + +到非常困难(有多行音符从右向左滑过,你需要按顺序键入音符)。 + +![learnmusic-jalmus-multinote](https://www.maketecheasier.com/assets/uploads/2015/07/learnmusic-jalmus-multinote.png) + +Jalmus 也包含一些训练,内容和课程相似,只是没有那些视觉上的提示了。当完成训练后,屏幕上会显示你的乐谱。它还提供不同难度的节拍训练,你能听到看到这些训练里面播放的旋律。在多行乐谱同时播放时,一个节拍器(能听见能看见)可以帮你理解 + +![learnmusic-jalmus-rhythm](https://www.maketecheasier.com/assets/uploads/2015/07/learnmusic-jalmus-rhythm.png) + +和阅读乐谱。(LCTT 写给王老板的话:我特么实在编不下去了,这段你得帮我改改。) + +![learnmusic-jalmus-score](https://www.maketecheasier.com/assets/uploads/2015/07/learnmusic-jalmus-score.png) + +所有这些功能都是可配置的,你可以选择打开或者关闭它们。 + +总的来说,Jalmus 可能是节奏训练软件中属于功能最强的,虽然它不是学音乐必备的软件,但在节奏训练这个特殊的领域,它做得很出色。 + +### 号外 ### + +#### TuxGuitar #### + +对于吉他练习者,[TuxGuitar][12] 看起来很像 Windows 下面的 Guitar Pro 软件(它也可以读 Guitar Pro 格式的文件)。 + +#### PianoBooster #### +[Piano Booster][13] 可以练习钢琴技巧,它能播放 MIDI 文件,你可以使用外接键盘来弹钢琴,同时还能查看屏幕上滑过的乐谱。 + +### 总结 ### + +Linux 提供很多优秀的工具供你学习,如果你对音乐感兴趣,你完全不用担心没有软件能帮你练习音乐技术。实际上,可供学习音乐的学生选择的优秀软件数量远比上面介绍的要多。如果你还知道其他的音乐训练软件,请在写下你的评论,让我们能够知道。 + +-------------------------------------------------------------------------------- + +via: https://www.maketecheasier.com/linux-learning-music/ + +作者:[Attila Orosz][a] +译者:[bazz2](https://github.com/bazz2) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.maketecheasier.com/author/attilaorosz/ +[1]:https://www.maketecheasier.com/series/learn-with-linux/ +[2]:https://www.maketecheasier.com/learn-to-type-in-linux/ +[3]:https://www.maketecheasier.com/linux-physics-simulation/ +[4]:https://www.maketecheasier.com/linux-learning-music/ +[5]:https://www.maketecheasier.com/linux-geography-apps/ +[6]:https://www.maketecheasier.com/learn-linux-maths/ +[7]:https://en.wikipedia.org/wiki/Solf%C3%A8ge +[8]:http://tete.sourceforge.net/index.shtml +[9]:https://en.wikipedia.org/wiki/Ear_training +[10]:http://sourceforge.net/projects/tete/files/latest/download +[11]:http://sourceforge.net/projects/jalmus/files/Jalmus-2.3/ +[12]:http://tuxguitar.herac.com.ar/ +[13]:http://www.linuxlinks.com/article/20090517041840856/PianoBooster.html From 145c6a3c782f027f97f3395aaa9bbcacc7b42e76 Mon Sep 17 00:00:00 2001 From: SonoFelice Date: Thu, 24 Dec 2015 10:37:18 +0800 Subject: [PATCH 0028/1469] =?UTF-8?q?=E3=80=90=E7=BF=BB=E8=AF=91=E4=B8=AD?= =?UTF-8?q?=E3=80=91Top=205=20open=20source=20community=20metrics=20to=20t?= =?UTF-8?q?rack?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20151208 Top 5 open source community metrics to track.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/talk/yearbook2015/20151208 Top 5 open source community metrics to track.md b/sources/talk/yearbook2015/20151208 Top 5 open source community metrics to track.md index 5098151775..86c20aeb6f 100644 --- a/sources/talk/yearbook2015/20151208 Top 5 open source community metrics to track.md +++ b/sources/talk/yearbook2015/20151208 Top 5 open source community metrics to track.md @@ -1,3 +1,4 @@ +Sonofelice Translating Top 5 open source community metrics to track ================================================================================ ![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/yearbook2015-osdc-lead-1.png) From 4e858354eec24702e5065805809bfb04c09cb7e8 Mon Sep 17 00:00:00 2001 From: Bian Jiaping Date: Thu, 24 Dec 2015 15:35:27 +0800 Subject: [PATCH 0029/1469] translating 'How to Use Glances to Monitor System on Ubuntu' --- .../20151223 How to Use Glances to Monitor System on Ubuntu.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20151223 How to Use Glances to Monitor System on Ubuntu.md b/sources/tech/20151223 How to Use Glances to Monitor System on Ubuntu.md index b10e7ed47e..8237aa4f25 100644 --- a/sources/tech/20151223 How to Use Glances to Monitor System on Ubuntu.md +++ b/sources/tech/20151223 How to Use Glances to Monitor System on Ubuntu.md @@ -1,3 +1,5 @@ +translating by bianjp + How to Use Glances to Monitor System on Ubuntu ================================================================================ ![](https://www.maketecheasier.com/assets/uploads/2015/12/glances_featured.jpg) From bb996158d9ed80408a7d7771c1b6bbede0bdbfcd Mon Sep 17 00:00:00 2001 From: NearTan Date: Thu, 24 Dec 2015 23:50:44 +0800 Subject: [PATCH 0030/1469] translated --- ...P Framework on CentOS 7 or Ubuntu 15.04.md | 176 ------------------ ...P Framework on CentOS 7 or Ubuntu 15.04.md | 176 ++++++++++++++++++ 2 files changed, 176 insertions(+), 176 deletions(-) delete mode 100644 sources/tech/20151204 How to Install Laravel PHP Framework on CentOS 7 or Ubuntu 15.04.md create mode 100644 translated/tech/20151204 How to Install Laravel PHP Framework on CentOS 7 or Ubuntu 15.04.md diff --git a/sources/tech/20151204 How to Install Laravel PHP Framework on CentOS 7 or Ubuntu 15.04.md b/sources/tech/20151204 How to Install Laravel PHP Framework on CentOS 7 or Ubuntu 15.04.md deleted file mode 100644 index 1e14ff6a7b..0000000000 --- a/sources/tech/20151204 How to Install Laravel PHP Framework on CentOS 7 or Ubuntu 15.04.md +++ /dev/null @@ -1,176 +0,0 @@ -translating by NearTan -How to Install Laravel PHP Framework on CentOS 7 / Ubuntu 15.04 -================================================================================ -Hi All, In this article we are going to setup Laravel on CentOS 7 and Ubuntu 15.04. If you are a PHP web developer then you don't need to worry about of all modern PHP frameworks, Laravel is the easiest to get up and running that saves your time and effort and makes web development a joy. Laravel embraces a general development philosophy that sets a high priority on creating maintainable code by following some simple guidelines, you should be able to keep a rapid pace of development and be free to change your code with little fear of breaking existing functionality. - -Laravel's PHP framework installation is not a big deal. You can simply follow the step by step guide in this article for your CentOS 7 or Ubuntu 15 server. - -### 1) Server Requirements ### - -Laravel depends upon a number of prerequisites that must be setup before installing it. Those prerequisites includes some basic tuning parameter of server like your system update, sudo rights and installation of required packages. - -Once you are connected to your server make sure to configure the fully qualified domain name then run the commands below to enable EPEL Repo and update your server. - -#### CentOS-7 #### - - # yum install epel-release - ----------- - - # rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm - # rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm - ----------- - - # yum update - -#### Ubuntu #### - - # apt-get install python-software-properties - # add-apt-repository ppa:ondrej/php5 - ----------- - - # apt-get update - ----------- - - # apt-get install -y php5 mcrypt php5-mcrypt php5-gd - -### 2) Firewall Setup ### - -System Firewall and SELinux setup is an important part regarding the security of your applications in production. You can make firewall off if you are working on test server and keep SELinux to permissive mode using the below command, so that you installing setup won't be affected by it. - - # setenforce 0 - -### 3) Apache, MariaDB, PHP Setup ### - -Laravel installation requires a complete LAMP stack with OpenSSL, PDO, Mbstring and Tokenizer PHP Extensions. If you are already running LAMP server then you can skip this step to move on and just make sure that the required PHP extensions are installed. - -To install AMP stack you can use the below commands on your respective server. - -#### CentOS #### - - # yum install httpd mariadb-server php56w php56w-mysql php56w-mcrypt php56w-dom php56w-mbstring - -To start and enable Apache web and MySQL/Mariadb services at bootup on CentOS 7 , we will use below commands. - - # systemctl start httpd - # systemctl enable httpd - ----------- - - #systemctl start mysqld - #systemctl enable mysqld - -After starting MariaDB service, we will configure its secured password with below command. - - #mysql_secure_installation - -#### Ubuntu #### - - # apt-get install mysql-server apache2 libapache2-mod-php5 php5-mysql - -### 4) Install Composer ### - -Now we are going to install composer that is one of the most important requirement before starting the Laravel installation that helps in installing Laravel's dependencies. - -#### CentOS/Ubuntu #### - -Run the below commands to setup 'composer' in CentOS/Ubuntu. - - # curl -sS https://getcomposer.org/installer | php - # mv composer.phar /usr/local/bin/composer - # chmod +x /usr/local/bin/composer - -![composer installation](http://blog.linoxide.com/wp-content/uploads/2015/11/14.png) - -### 5) Installing Laravel ### - -Laravel's installation package can be downloaded from github using the command below. - -# wget https://github.com/laravel/laravel/archive/develop.zip - -To extract the archived package and move into the document root directory use below commands. - - # unzip develop.zip - ----------- - - # mv laravel-develop /var/www/ - -Now use the following compose command that will install all required dependencies for Laravel within its directory. - - # cd /var/www/laravel-develop/ - # composer install - -![compose laravel](http://blog.linoxide.com/wp-content/uploads/2015/11/25.png) - -### 6) Key Encryption ### - -For encrypter service, we will be generating a 32 digit encryption key using the command below. - - # php artisan key:generate - - Application key [Lf54qK56s3qDh0ywgf9JdRxO2N0oV9qI] set successfully - -Now put this key into the 'app.php' file as shown below. - - # vim /var/www/laravel-develop/config/app.php - -![Key encryption](http://blog.linoxide.com/wp-content/uploads/2015/11/45.png) - -### 7) Virtua Host and Ownership ### - -After composer installation assign the permissions and apache user ownership to the document root directory as shown. - - # chmod 775 /var/www/laravel-develop/app/storage - ----------- - - # chown -R apache:apache /var/www/laravel-develop - -Open the default configuration file of apache web server using any editor to add the following lines at the end file for new virtual host entry. - - # vim /etc/httpd/conf/httpd.conf - ----------- - - ServerName laravel-develop - DocumentRoot /var/www/laravel/public - - start Directory /var/www/laravel - AllowOverride All - Directory close - -Now the time is to restart apache web server services as shown below and then open your web browser to check your localhost page. - -#### CentOS #### - - # systemctl restart httpd - -#### Ubuntu #### - - # service apache2 restart - -### 8) Laravel 5 Web Access ### - -Open your web browser and give your server IP or Fully Qualified Domain name and you will see the default web page of Laravel 5 frame work. - -![Laravel Default](http://blog.linoxide.com/wp-content/uploads/2015/11/35.png) - -### Conclusion ### - -Laravel Framework is a great tool to develop your web applications. So, at the end of this article you have learned its installation setup on Ubuntu 15 and CentOS 7 , Now start using this awesome PHP framework that provides you a lot of more features and comfort in your development work. Feel free to comment us back for your valuable suggestions an feedback to guide you in more specific and easiest way. - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/install-laravel-php-centos-7-ubuntu-15-04/ - -作者:[Kashif][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/ diff --git a/translated/tech/20151204 How to Install Laravel PHP Framework on CentOS 7 or Ubuntu 15.04.md b/translated/tech/20151204 How to Install Laravel PHP Framework on CentOS 7 or Ubuntu 15.04.md new file mode 100644 index 0000000000..431bd652a7 --- /dev/null +++ b/translated/tech/20151204 How to Install Laravel PHP Framework on CentOS 7 or Ubuntu 15.04.md @@ -0,0 +1,176 @@ + +如何在 CentOS 7 / Ubuntu 15.04 上安装 PHP 框架 Framework +================================================================================ +大家好,这篇文章将要讲述如何在 CentOS 7 / Ubuntu 15.04 上安装 PHP 框架 Laravel。如果你是一个 PHP Web 的开发者,你并不需要关心各种琳琅满目的现代 PHP 框架,Laravel 是最易用同时也是最能节省你时间的一个框架,能让你享受到 web 开发的乐趣。一个好的框架能让你在简单的使用指导下能快速开发出最核心的代码,Laravel 拥抱这一普世的开发哲学。你能抱持很高的开发效率并且无痛重构你现有的代码。 + +Laravel 安装极其容易,你只要跟着本文章一步步操作就能在 CentOS 7 或者 Ubuntu 15 服务器上安装。 + +### 1) 服务器要求 ### + +在安装 Laravel 前需要安装一些它的依赖和先决条件,这些包括升级系统到最新版本,sudo 权限,和安装依赖包。 + +当你连接到你的服务器时,请确保你能通以下命令能成功的使用 EPEL 仓库并且升级你的服务器。 + +#### CentOS-7 #### + + # yum install epel-release + +---------- + + # rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm + # rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm + +---------- + + # yum update + +#### Ubuntu #### + + # apt-get install python-software-properties + # add-apt-repository ppa:ondrej/php5 + +---------- + + # apt-get update + +---------- + + # apt-get install -y php5 mcrypt php5-mcrypt php5-gd + +### 2) Firewall Setup ### + +系统防火墙和 SELinux 设置对于用于生产的服务器安全来说非常重要,你可以关闭防火墙和用以下命令行设置 SELinux 成宽容模式(permissive)模式来保证安装程序不受他们的影响。 + + # setenforce 0 + +### 3) Apache, MariaDB, PHP Setup ### + +Laravel 安装程序需要完成安装 LAMP 整个环境,需要额外安装 OpenSSL, PDO, Mbstring 和 Tokenizer PHP Extensions。如果 LAMP 已经运行在你的服务器上你可以跳过这部,但是需要注意一些必要的 PHP 插件是否安装好。 + +要安装完整 AMP 你需要在自己的服务器上运行以下命令。 + +#### CentOS #### + + # yum install httpd mariadb-server php56w php56w-mysql php56w-mcrypt php56w-dom php56w-mbstring + +要在 CentOS 7 上实现 MySQL / Mariadb 服务开机自动启动,你需要运行以下命令 + + # systemctl start httpd + # systemctl enable httpd + +---------- + + #systemctl start mysqld + #systemctl enable mysqld + +在启动 MariaDB 服务之后,你需要运行以下命令配置一个足够安全的密码 + + #mysql_secure_installation + +#### Ubuntu #### + + # apt-get install mysql-server apache2 libapache2-mod-php5 php5-mysql + +### 4) 安装 Composer ### + +在我们安装 Laravel 前,先让我们开始安装 composer。安装 composer 对于安装 Laravel 是最重要的步骤之一,因为 composer 能帮我们安装 Laravel 的各种依赖。 + +#### CentOS/Ubuntu #### + +在 CentOS / Ubuntu 下运行以下命令来配置 composer + + # curl -sS https://getcomposer.org/installer | php + # mv composer.phar /usr/local/bin/composer + # chmod +x /usr/local/bin/composer + +![composer installation](http://blog.linoxide.com/wp-content/uploads/2015/11/14.png) + +### 5) Installing Laravel ### + +我们可以运行以下命令从 github 上下载 Laravel 的安装包 + + # wget https://github.com/laravel/laravel/archive/develop.zip + +运行以下命令解压安装包并且移动 document 的根目录 + + # unzip develop.zip + +---------- + + # mv laravel-develop /var/www/ + +现在使用 compose 命令来安装目录下所有 Laravel 所需要的依赖 + + # cd /var/www/laravel-develop/ + # composer install + +![compose laravel](http://blog.linoxide.com/wp-content/uploads/2015/11/25.png) + +### 6) Key Encryption ### + +为了加密服务器,我们使用以下命令来生成一个加密后的 32 位的密钥 + + # php artisan key:generate + + Application key [Lf54qK56s3qDh0ywgf9JdRxO2N0oV9qI] set successfully + +现在把这个密钥放到 'app.php' 文件,如以下所示 + + # vim /var/www/laravel-develop/config/app.php + +![Key encryption](http://blog.linoxide.com/wp-content/uploads/2015/11/45.png) + +### 7) 虚拟 Host 和 所属用户 ### + +在 composer 安装好后,分配 document 根目录的权限和所属用户,如下所示 + + # chmod 775 /var/www/laravel-develop/app/storage + +---------- + + # chown -R apache:apache /var/www/laravel-develop + +用任意一款编辑器打开 apache 服务器的默认配置文件,在文件最后加上虚拟 host 入口 + + # vim /etc/httpd/conf/httpd.conf + +---------- + + ServerName laravel-develop + DocumentRoot /var/www/laravel/public + + start Directory /var/www/laravel + AllowOverride All + Directory close + +现在我们用以下命令重启 apache 服务器,打开浏览器查看 localhost 页面 + +#### CentOS #### + + # systemctl restart httpd + +#### Ubuntu #### + + # service apache2 restart + +### 8) Laravel 5 Web Access ### + +打开浏览器然后输入你的配置的 IP 地址或者绝对域名(to 校对:「绝对域名」译自 https://zh.wikipedia.org/wiki/%E5%AE%8C%E6%95%B4%E7%B6%B2%E5%9F%9F%E5%90%8D%E7%A8%B1#cite_note-1)你将会看到 Laravel 5 的默认页面 + +![Laravel Default](http://blog.linoxide.com/wp-content/uploads/2015/11/35.png) + +### 结论 ### + +Laravel 框架对于开发网页应用来说是一个绝好的的工具。所以,看了这篇文章你将学会在 Ubuntu 15 和 CentOS 7 上安装 Laravel 之后你就能开始使用这超棒的框架提供的各种功能来舒服的来进行你的开发工作。如果你有什么意见或者建议请发表在评论内容上,我们将根据您宝贵的反馈来使我们的文章更加浅显易懂。 + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/install-laravel-php-centos-7-ubuntu-15-04/ + +作者:[Kashif][a] +译者:[NearTan](https://github.com/NearTan) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/kashifs/ From 30fe9721b5a000760b06c33b19cc7788340bfbd9 Mon Sep 17 00:00:00 2001 From: sonofelice Date: Fri, 25 Dec 2015 00:00:39 +0800 Subject: [PATCH 0031/1469] half of the translation --- ...op 5 open source community metrics to track.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/sources/talk/yearbook2015/20151208 Top 5 open source community metrics to track.md b/sources/talk/yearbook2015/20151208 Top 5 open source community metrics to track.md index 86c20aeb6f..0f2926152a 100644 --- a/sources/talk/yearbook2015/20151208 Top 5 open source community metrics to track.md +++ b/sources/talk/yearbook2015/20151208 Top 5 open source community metrics to track.md @@ -1,23 +1,28 @@ -Sonofelice Translating -Top 5 open source community metrics to track +五大开源社区指标追踪 ================================================================================ ![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/yearbook2015-osdc-lead-1.png) +你决定使用指标来追踪那些免费开源的软件社区。那么问题来了:我应该去追踪哪些指标呢? + So you decided to use metrics to track your free, open source software (FOSS) community. Now comes the big question: Which metrics should I be tracking? +要回答这个问题,你首先要知道你需要什么信息。比如,你可能想要知道一个项目社区的可持续性。这个社区对问题的应对速度怎么样。一个社区如何吸引、维持或者失去贡献者。一旦你知道需要哪类信息,你就可以找出哪些社区活动可以提供你想要知道的内容。幸运的是,免费开源社区(FOSS)一些遵从开放式开发模型的项目在其软件开发仓库里留下了大量的公共数据,我们可以对这些数据进行分析,并从中收集到一些有用的数据。 + To answer this question, you must have an idea of what information you need. For example, you may want to know about the sustainability of the project community. How quickly does the community react to problems? How is the community attracting, retaining, or losing contributors? Once you decide which information you need, you can figure out which traces of community activity are available to provide it. Fortunately, FOSS projects following an open development model tend to leave loads of public data in their software development repositories, which can be analyzed to gather useful data. +在这篇文章中,我会介绍一些指标,从而为这些项目社区提供一个多方位的视角分析。 + In this article, I'll introduce metrics that help provide a multi-faceted view of your project community. -### 1. Activity ### +### 1. 社区活动 ### -The overall activity of the community and how it evolves over time is a useful metric for all open source communities. Activity provides a first view of how much the community is doing, and can be used to track different kinds of activity. For example, the number of commits gives a first idea about the volume of the development effort. The number of tickets opened provides insight into how many bugs are reported or new features are proposed. The number of messages in mailing lists or posts in forums gives an idea of how much discussion is being held in public. +一个社区的总体活动和这个社区怎样随着时间演变,是度量一个社区好坏的非常有用的指标。社区活动是评价一个社区工作量的第一印象,也可以用来追踪不同种类的活动。比如,提交次数,给人的第一印象就是跟开发工作量挂钩。通过投票的数量我们可以大概知道提交了多少bug或者又提出了多少新特性。邮件列表的数量或者论坛帖子的数量可以让我了解到有过多少次公开的讨论。 ![Activity metrics chart](https://opensource.com/sites/default/files/images/business-uploads/activity-metrics.png) Number of commits and number of merged changes after code review in the OpenStack project, as found in the [OpenStack Activity Dashboard][1]. Evolution over time (weekly data). -### 2. Size ### +### 2. 社区规模 ### The size of the community is the number of people participating in it, but, depending on the kind of participation, size numbers may vary. Usually you're interested in active contributors, which is good news. Active people may leave traces in the repositories of the project, which means you can count contributors who are active in producing code by looking at the **Author** field in git repositories, or count people participating in the resolution of tickets by looking at who is contributing to them. From 47542308dd79ecbb9d4b44f749f7e11c5829bbc0 Mon Sep 17 00:00:00 2001 From: sonofelice Date: Fri, 25 Dec 2015 00:28:16 +0800 Subject: [PATCH 0032/1469] half --- ...08 Top 5 open source community metrics to track.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/sources/talk/yearbook2015/20151208 Top 5 open source community metrics to track.md b/sources/talk/yearbook2015/20151208 Top 5 open source community metrics to track.md index 0f2926152a..e0b309e9b0 100644 --- a/sources/talk/yearbook2015/20151208 Top 5 open source community metrics to track.md +++ b/sources/talk/yearbook2015/20151208 Top 5 open source community metrics to track.md @@ -4,26 +4,23 @@ 你决定使用指标来追踪那些免费开源的软件社区。那么问题来了:我应该去追踪哪些指标呢? -So you decided to use metrics to track your free, open source software (FOSS) community. Now comes the big question: Which metrics should I be tracking? - 要回答这个问题,你首先要知道你需要什么信息。比如,你可能想要知道一个项目社区的可持续性。这个社区对问题的应对速度怎么样。一个社区如何吸引、维持或者失去贡献者。一旦你知道需要哪类信息,你就可以找出哪些社区活动可以提供你想要知道的内容。幸运的是,免费开源社区(FOSS)一些遵从开放式开发模型的项目在其软件开发仓库里留下了大量的公共数据,我们可以对这些数据进行分析,并从中收集到一些有用的数据。 -To answer this question, you must have an idea of what information you need. For example, you may want to know about the sustainability of the project community. How quickly does the community react to problems? How is the community attracting, retaining, or losing contributors? Once you decide which information you need, you can figure out which traces of community activity are available to provide it. Fortunately, FOSS projects following an open development model tend to leave loads of public data in their software development repositories, which can be analyzed to gather useful data. - 在这篇文章中,我会介绍一些指标,从而为这些项目社区提供一个多方位的视角分析。 -In this article, I'll introduce metrics that help provide a multi-faceted view of your project community. - ### 1. 社区活动 ### 一个社区的总体活动和这个社区怎样随着时间演变,是度量一个社区好坏的非常有用的指标。社区活动是评价一个社区工作量的第一印象,也可以用来追踪不同种类的活动。比如,提交次数,给人的第一印象就是跟开发工作量挂钩。通过投票的数量我们可以大概知道提交了多少bug或者又提出了多少新特性。邮件列表的数量或者论坛帖子的数量可以让我了解到有过多少次公开的讨论。 ![Activity metrics chart](https://opensource.com/sites/default/files/images/business-uploads/activity-metrics.png) -Number of commits and number of merged changes after code review in the OpenStack project, as found in the [OpenStack Activity Dashboard][1]. Evolution over time (weekly data). +[OpenStack活动看板][1]上面显示的项目代码提交次数和代码评审之后代码合并次数随时间变化的趋势图(周数据) + ### 2. 社区规模 ### +社区的规模指的是参与到这个社区的人数,但是,基于不同形式的参与人数也有很大的差别。好消息是,通常你只对积极活跃的贡献者比较感兴趣。活跃的贡献者 + The size of the community is the number of people participating in it, but, depending on the kind of participation, size numbers may vary. Usually you're interested in active contributors, which is good news. Active people may leave traces in the repositories of the project, which means you can count contributors who are active in producing code by looking at the **Author** field in git repositories, or count people participating in the resolution of tickets by looking at who is contributing to them. This basic idea of activity" (somebody did something) can be extended in many ways. One common way to track activity is to look at how many people did a sizable chunk of the activity. Generally most of a project's code contributions, for example, are from a small fraction of the people in the project's community. Knowing about that fraction helps provide an idea of the core group (i.e., the people who help lead the community). From e369d054a27a924e2fc7219abf7905f64988a43c Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 25 Dec 2015 11:32:25 +0800 Subject: [PATCH 0033/1469] PUB:20150410 How to Install and Configure Multihomed ISC DHCP Server on Debian Linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @ivo-wang 翻译辛苦了~ https://linux.cn/article-6793-1.html --- ...tihomed ISC DHCP Server on Debian Linux.md | 162 +++++++++++++++++ ...tihomed ISC DHCP Server on Debian Linux.md | 164 ------------------ 2 files changed, 162 insertions(+), 164 deletions(-) create mode 100644 published/20150410 How to Install and Configure Multihomed ISC DHCP Server on Debian Linux.md delete mode 100644 translated/tech/20150410 How to Install and Configure Multihomed ISC DHCP Server on Debian Linux.md diff --git a/published/20150410 How to Install and Configure Multihomed ISC DHCP Server on Debian Linux.md b/published/20150410 How to Install and Configure Multihomed ISC DHCP Server on Debian Linux.md new file mode 100644 index 0000000000..32ce669b8c --- /dev/null +++ b/published/20150410 How to Install and Configure Multihomed ISC DHCP Server on Debian Linux.md @@ -0,0 +1,162 @@ +在 Debian Linux 上安装配置 ISC DHCP 服务器 +================================================================================ + +动态主机控制协议(Dynamic Host Control Protocol,DHCP)给网络管理员提供了一种便捷的方式,为不断变化的网络主机或是动态网络提供网络层地址。其中最常用的 DHCP 服务工具是 ISC DHCP Server。DHCP 服务的目的是给主机提供必要的网络信息以便能够和其他连接在网络中的主机互相通信。DHCP 服务提供的信息包括:DNS 服务器信息,网络地址(IP),子网掩码,默认网关信息,主机名等等。 + +本教程介绍运行在 Debian 7.7 上 4.2.4 版的 ISC-DHCP-Server 如何管理多个虚拟局域网(VLAN),也可以非常容易应用到单一网络上。 + +测试用的网络是通过思科路由器使用传统的方式来管理 DHCP 租约地址的。目前有 12 个 VLAN 需要通过集中式服务器来管理。把 DHCP 的任务转移到一个专用的服务器上,路由器可以收回相应的资源,把资源用到更重要的任务上,比如路由寻址,访问控制列表,流量监测以及网络地址转换等。 + +另一个将 DHCP 服务转移到专用服务器的好处,以后会讲到,它可以建立动态域名服务器(DDNS),这样当主机从服务器请求 DHCP 地址的时候,这样新主机的主机名就会被添加到 DNS 系统里面。 + +### 安装和配置 ISC DHCP 服务器### + +1、使用 apt 工具用来安装 Debian 软件仓库中的 ISC 软件,来创建这个多宿主服务器。与其他教程一样需要使用 root 或者 sudo 访问权限。请适当的修改,以便使用下面的命令。(LCTT 译注:下面中括号里面是注释,使用的时候请删除,#表示使用的 root 权限) + + # apt-get install isc-dhcp-server [安装 the ISC DHCP Server 软件] + # dpkg --get-selections isc-dhcp-server [确认软件已经成功安装] + # dpkg -s isc-dhcp-server [用另一种方式确认成功安装] + +![Install ISC DHCP Server in Debian](http://www.tecmint.com/wp-content/uploads/2015/04/Install-ISC-DHCP-Server.jpg) + +2、 确认服务软件已经安装完成,现在需要提供网络信息来配置服务器,这样服务器才能够根据我们的需要来分发网络信息。作为管理员最起码需要了解的 DHCP 信息如下: + +- 网络地址 +- 子网掩码 +- 动态分配的地址范围 + +其他一些服务器动态分配的有用信息包括: + +- 默认网关 +- DNS 服务器 IP 地址 +- 域名 +- 主机名 +- 网络广播地址 + +这只是能让 ISC DHCP 服务器处理的选项中非常少的一部分。如果你想查看所有选项及其描述需要在安装好软件后输入以下命令: + + # man dhcpd.conf + +3、 一旦管理员已经确定了这台服务器分发的所有必要信息,那么是时候配置服务器并且分配必要的地址池了。在配置任何地址池或服务器配置之前,必须配置 DHCP 服务器侦听这台服务器上面的一个接口。 + +在这台特定的服务器上,设置好网卡后,DHCP 会侦听名称名为`'bond0'`的接口。请适根据你的实际情况来更改服务器以及网络环境。下面的配置都是针对本教程的。 + +![Configure ISC DHCP Network](http://www.tecmint.com/wp-content/uploads/2015/04/Configure-ISC-DHCP-Network.jpg) + +这行指定的是 DHCP 服务侦听接口(一个或多个)上的 DHCP 流量。修改主配置文件,分配适合的 DHCP 地址池到所需要的网络上。主配置文件在 /etc/dhcp/dhcpd.conf。用文本编辑器打开这个文件 + + # nano /etc/dhcp/dhcpd.conf + +这个配置文件可以配置我们所需要的地址池/主机。文件顶部有 ‘ddns-update-style‘ 这样一句,在本教程中它设置为 ‘none‘。在以后的教程中会讲到动态 DNS,ISC-DHCP-Server 将会与 BIND9 集成,它能够使主机名更新指向到 IP 地址。 + +4、 接下来的部分是管理员配置全局网络设置,如 DNS 域名,默认的租约时间,IP地址,子网的掩码,以及其它。如果你想了解所有的选项,请阅读 man 手册中的 dhcpd.conf 文件,命令如下: + + # man dhcpd.conf + +对于这台服务器,我们需要在配置文件顶部配置一些全局网络设置,这样就不用到每个地址池中去单独设置了。 + +![Configure ISC DDNS](http://www.tecmint.com/wp-content/uploads/2015/04/Configure-ISC-DDNS.png) + +我们花一点时间来解释一下这些选项,在本教程中虽然它们是一些全局设置,但是也可以单独的为某一个地址池进行配置。 + +- option domain-name “comptech.local”; – 所有使用这台 DHCP 服务器的主机,都将成为 DNS 域 “comptech.local” 的一员 + +- option domain-name-servers 172.27.10.6; DHCP 向所有配置这台 DHCP 服务器的的网络主机分发 DNS 服务器地址为 172.27.10.6 + +- option subnet-mask 255.255.255.0; – 每个网络设备都分配子网掩码 255.255.255.0 或 /24 + +- default-lease-time 3600; – 默认有效的地址租约时间(单位是秒)。如果租约时间耗尽,那么主机可以重新申请租约。如果租约完成,那么相应的地址也将被尽快回收。 + +- max-lease-time 86400; – 这是一台主机所能租用的最大的租约时间(单位为秒)。 + +- ping-check true; – 这是一个额外的测试,以确保服务器分发出的网络地址不是当前网络中另一台主机已使用的网络地址。 + +- ping-timeout; – 在判断地址以前没有使用过前,服务器将等待 ping 响应多少秒。 + +- ignore client-updates; 现在这个选项是可以忽略的,因为 DDNS 在前面已在配置文件中已经被禁用,但是当 DDNS 运行时,这个选项会忽略主机更新其 DNS 主机名的请求。 + +5、 文件中下面一行是权威 DHCP 所在行。这行的意义是如果服务器是为文件中所配置的网络分发地址的服务器,那么取消对该权威关键字(authoritative stanza) 的注释。 + +通过去掉关键字 authoritative 前面的 ‘#’,取消注释全局权威关键字。这台服务器将是它所管理网络里面的唯一权威。 + +![Enable ISC Authoritative](http://www.tecmint.com/wp-content/uploads/2015/04/ISC-authoritative.png) + +默认情况下服务器被假定为**不是**网络上的权威服务器。之所以这样做是出于安全考虑。如果有人因为不了解 DHCP 服务的配置,导致配置不当或配置到一个不该出现的网络里面,这都将带来非常严重的连接问题。这行还可用在每个网络中单独配置使用。也就是说如果这台服务器不是整个网络的 DHCP 服务器,authoritative 行可以用在每个单独的网络中,而不是像上面截图中那样的全局配置。 + +6、 这一步是配置服务器将要管理的所有 DHCP 地址池/网络。简短起见,本教程只讲到配置的地址池之一。作为管理员需要收集一些必要的网络信息(比如域名,网络地址,有多少地址能够被分发等等) + +以下这个地址池所用到的信息都是管理员收集整理的:网络 ID 172.27.60.0, 子网掩码 255.255.255.0 或 /24, 默认子网网关 172.27.60.1,广播地址 172.27.60.255.0 。 + +以上这些信息对于构建 dhcpd.conf 文件中新网络非常重要。使用文本编辑器修改配置文件添加新网络进去,这里我们需要使用 root 或 sudo 访问权限。 + + # nano /etc/dhcp/dhcpd.conf + +![Configure DHCP Pools and Networks](http://www.tecmint.com/wp-content/uploads/2015/04/ISC-network.png) + +当前这个例子是给用 VMWare 创建的虚拟服务器分配 IP 地址。第一行显示是该网络的子网掩码。括号里面的内容是 DHCP 服务器应该提供给网络上面主机的所有选项。 + +第一行, range 172.27.60.50 172.27.60.254; 这一行显示的是,DHCP 服务在这个网络上能够给主机动态分发的地址范围。 + +第二行,option routers 172.27.60.1; 这里显示的是给网络里面所有的主机分发的默认网关地址。 + +最后一行, option broadcast-address 172.27.60.255; 显示当前网络的广播地址。这个地址不能被包含在要分发放的地址范围内,因为广播地址不能分配到一个主机上面。 + +必须要强调的是每行的结尾必须要用(;)来结束,所有创建的网络必须要在 {} 里面。 + +7、 如果要创建多个网络,继续创建完它们的相应选项后保存文本文件即可。配置完成以后如果有更改,ISC-DHCP-Server 进程需要重启来使新的更改生效。重启进程可以通过下面的命令来完成: + + # service isc-dhcp-server restart + +这条命令将重启 DHCP 服务,管理员能够使用几种不同的方式来检查服务器是否已经可以处理 dhcp 请求。最简单的方法是通过 [lsof 命令][1]来查看服务器是否在侦听67端口,命令如下: + + # lsof -i :67 + +![Check DHCP Listening Port](http://www.tecmint.com/wp-content/uploads/2015/04/lsof.png) + +这里输出的结果表明 dhcpd(DHCP 服务守护进程)正在运行并且侦听67端口。由于在 /etc/services 文件中67端口的映射,所以输出中的67端口实际上被转换成了 “bootps”。 + +在大多数的系统中这是非常常见的,现在服务器应该已经为网络连接做好准备,我们可以将一台主机接入网络请求DHCP地址来验证服务是否正常。 + +### 测试客户端连接 ### + +8、 现在许多系统使用网络管理器来维护网络连接状态,因此这个设备应该预先配置好的,只要对应的接口处于活跃状态就能够获取 DHCP。 + +然而当一台设备无法使用网络管理器时,它可能需要手动获取 DHCP 地址。下面的几步将演示怎样手动获取以及如何查看服务器是否已经按需要分发地址。 + +‘[ifconfig][2]‘工具能够用来检查接口的配置。这台被用来测试的 DHCP 服务器的设备,它只有一个网络适配器(网卡),这块网卡被命名为 ‘eth0‘。 + + # ifconfig eth0 + +![Check Network Interface IP Address](http://www.tecmint.com/wp-content/uploads/2015/04/No-ip.png) + +从输出结果上看,这台设备目前没有 IPv4 地址,这样很便于测试。我们把这台设备连接到 DHCP 服务器并发出一个请求。这台设备上已经安装了一个名为 ‘dhclient‘ 的DHCP客户端工具。因为操作系统各不相同,所以这个客户端软件也是互不一样的。 + + # dhclient eth0 + +![Request IP Address from DHCP](http://www.tecmint.com/wp-content/uploads/2015/04/IP.png) + +当前 `'inet addr:'` 字段中显示了属于 172.27.60.0 网络地址范围内的 IPv4 地址。值得欣慰的是当前网络还配置了正确的子网掩码并且分发了广播地址。 + +到这里看起来还都不错,让我们来测试一下,看看这台设备收到新 IP 地址是不是由服务器发出的。这里我们参照服务器的日志文件来完成这个任务。虽然这个日志的内容有几十万条,但是里面只有几条是用来确定服务器是否正常工作的。这里我们使用一个工具 ‘tail’,它只显示日志文件的最后几行,这样我们就可以不用拿一个文本编辑器去查看所有的日志文件了。命令如下: + + # tail /var/log/syslog + +![Check DHCP Logs](http://www.tecmint.com/wp-content/uploads/2015/04/DHCP-Log.png) + +OK!服务器记录表明它分发了一个地址给这台主机 (HRTDEBXENSRV)。服务器按预期运行,给它充当权威服务器的网络分发了适合的网络地址。至此 DHCP 服务器搭建成功并且运行。如果有需要你可以继续配置其他的网络,排查故障,确保安全。 + +在以后的Debian教程中我会讲一些新的 ISC-DHCP-Server 功能。有时间的话我将写一篇关于 Bind9 和 DDNS 的教程,融入到这篇文章里面。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/install-and-configure-multihomed-isc-dhcp-server-on-debian-linux/ + +作者:[Rob Turner][a] +译者:[ivo-wang](https://github.com/ivo-wang) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/robturner/ +[1]:http://www.tecmint.com/10-lsof-command-examples-in-linux/ +[2]:http://www.tecmint.com/ifconfig-command-examples/ diff --git a/translated/tech/20150410 How to Install and Configure Multihomed ISC DHCP Server on Debian Linux.md b/translated/tech/20150410 How to Install and Configure Multihomed ISC DHCP Server on Debian Linux.md deleted file mode 100644 index 5dcea06611..0000000000 --- a/translated/tech/20150410 How to Install and Configure Multihomed ISC DHCP Server on Debian Linux.md +++ /dev/null @@ -1,164 +0,0 @@ -debian linux上安装配置 ISC DHCP Server -================================================================================ -动态主机控制协议(DHCP)给网络管理员提供一种便捷的方式,为不断变化的网络主机或是动态网络提供网络层地址。其中最常用的DHCP服务工具是 ISC DHCP Server。DHCP服务的目的是给主机提供必要的网络信息以便能够和其他连接在网络中的主机互相通信。DHCP服务一般包括以下信息:DNS服务器信息,网络地址(IP),子网掩码,默认网关信息,主机名等等。 - -本教程介绍4.2.4版的ISC-DHCP-Server如何在Debian7.7上管理多个虚拟局域网(VLAN),它也可以非常容易的配置的用于单一网络。 - -测试用的网络是通过思科路由器使用传统的方式来管理DHCP租约地址的,目前有12个VLANs需要通过路由器的集中式服务器来管理。把DHCP的任务转移到一个专用的服务器上面,路由器可以收回相应的资源,把资源用到更重要的任务上,比如路由寻址,访问控制列表,流量监测以及网络地址转换等。 - -另一个将DHCP服务转移到专用服务器的好处,以后会讲到,它可以建立动态域名服务器(DDNS)这样当主机从服务器请求DHCP地址的时候,新主机的主机名将被添加到DNS系统里面。 - -### 安装和配置ISC DHCP Server### - -1. 使用apt工具用来安装Debian软件仓库中的ISC软件,来创建这个多宿主服务器。与其他教程一样需要使用root或者sudo访问权限。请适当的修改,以便使用下面的命令。(译者注:下面中括号里面是注释,使用的时候请删除,#表示使用的root权限) - - - # apt-get install isc-dhcp-server [安装 the ISC DHCP Server 软件] - # dpkg --get-selections isc-dhcp-server [确认软件已经成功安装] - # dpkg -s isc-dhcp-server [用另一种方式确认成功安装] - -![Install ISC DHCP Server in Debian](http://www.tecmint.com/wp-content/uploads/2015/04/Install-ISC-DHCP-Server.jpg) - -2. 确认服务软件已经安装完成,现在需要一些网络的需求来配置服务器,这样服务器才能够根据我们的需要来分发网络信息。作为管理员最起码需要了解的DHCP信息如下: -- 网络地址 -- 子网掩码 -- 动态分配的地址范围 - -其他一些服务器动态分配的有用信息包括: -- 默认网关 -- DNS服务器IP地址 -- 域名 -- 主机名 -- 网络广播地址 - - -这只是能让ISC DHCP server处理的选项中非常少的一部分。如果你想查看所有选项及其描述需要在安装好软件后输入以下命令: - # man dhcpd.conf - -3. 一旦管理员已经确定了这台服务器需要分发的需求信息,那么是时候配置服务器并且分配必要的地址池了。在配置任何地址池或服务器配置之前,DHCP服务必须配置好,来侦听这台服务器上面的一个接口。 - -在这台特定的服务器上,设置好网卡后,DHCP会侦听名称名为`'bond0'`的接口。请适根据你的实际情况来更改服务器以及网络环境。下面的配置都是针对本教程的。 - -![Configure ISC DHCP Network](http://www.tecmint.com/wp-content/uploads/2015/04/Configure-ISC-DHCP-Network.jpg) - -这行指定的是DHCP服务侦听接口(一个或多个)上的DHCP流量。修改主要的配置文件分配适合的DHCP地址池到所需要的网络上。配置文件所在置/etc/dhcp/dhcpd.conf。用文本编辑器打开这个文件 - # nano /etc/dhcp/dhcpd.conf - -这个配置文件可以配置我们所需要的地址池/主机。文件顶部有‘ddns-update-style‘这样一句,在本教程中它设置为‘none‘。在以后的教程中动态DNS,ISC-DHCP-Server 将被整合到 BIND9,它能够使主机名更新到IP地址。 - -4. 接下来的部分是管理员配置全局网络设置,如DNS域名,默认的租约时间,IP地址,子网的掩码,以及更多的区域。如果你想了解所有的选项,请阅读man手册中的dhcpd.conf文件,命令如下: - - # man dhcpd.conf - - -对于这台服务器,我们需要在顶部配置一些全局网络设置,这样就不用到每个地址池中去单独设置了。 - -![Configure ISC DDNS](http://www.tecmint.com/wp-content/uploads/2015/04/Configure-ISC-DDNS.png) - - -我们花一点时间来解释一下这些选项,在本教程中虽然它们是一些全局设置,但是也可以为单独的为某一个地址池进行配置。 - -- option domain-name “comptech.local”; – 所有使用这台DHCP服务器的主机,都将成为DNS域名为“comptech.local”的一员 - -- option domain-name-servers 172.27.10.6; DHCP向所有配置这台DHCP服务器的的网络主机分发DNS服务器地址为172.27.10.6 - -- option subnet-mask 255.255.255.0; – 分派子网掩码到每一个网络设备 255.255.255.0 或a /24 - -- default-lease-time 3600; – 默认有效的地址租约时间(单位是秒)。如果租约时间耗尽,那么主机可以重新申请租约。如果租约完成,那么相应的地址也将被尽快回收。 - -- max-lease-time 86400; – 这是一台主机最大的租约时间(单位为秒)。 - -- ping-check true; – 这是一个额外的测试,以确保服务器分发出的网络地址不是当前网络中另一台主机已使用的网络地址。 - -- ping-timeout; – 如果地址以前没有使用过,可以用这个选项来检测2个ping返回值之间的时间长度。 - -- ignore client-updates; 现在这个选项是可以忽略的,因为DDNS在前面已在配置文件中已经被禁用,但是当DDNS运行时,这个选项会忽略更新其DNS主机名的请求。 - -5. 文件中下面一行是权威DHCP所在行。这行的意义是如果服务器是为文件中所配置的网络分发地址的服务器,那么取消注释权威字节(authoritative stanza)来实现。 - -通过去掉关键字authoritative 前面的‘#’,取消注释全局权威字节。这台服务器将是它所管理网络里面的唯一权威。 - -![Enable ISC Authoritative](http://www.tecmint.com/wp-content/uploads/2015/04/ISC-authoritative.png) -开启 ISC Authoritative - -默认情况下服务器被假定为不是网络上的权威。之所以这样做是出于安全考虑。如果有人因为不了解DHCP服务的配置,导致配置不当或配置到一个不该出现的网络里面,这都将带来非常严重的重连接问题。这行还可用在每个网络中单独配置使用。也就是说如果这台服务器不是整个网络的DHCP服务器,authoritative行可以用在每个单独的网络中,而不是像上面截图中那样的全局配置。 - -6. 这一步是配置服务器将要管理的所有DHCP地址池/网络。简短起见,本教程只配置了地址池。作为管理员需要收集一些必要的网络信息(比如域名,网络地址,有多少地址能够被分发等等) - -以下这个地址池所用到的信息都是管理员收集整理的:网络id 172.27.60.0, 子网掩码 255.255.255.0 or a /24, 默认子网网关172.27.60.1,广播地址 172.27.60.255.0 - -以上这些信息用于构建hcpd.conf文件中新的网络非常重要。使用文本编辑器修改配置文件添加新的网络进去,这里我们需要使用root或sudo访问权限。网络非常重要。使用文本编辑器修改配置文件添加新的网络进去,这里我们需要使用root或sudo访问权限。 - - # nano /etc/dhcp/dhcpd.conf - -![Configure DHCP Pools and Networks](http://www.tecmint.com/wp-content/uploads/2015/04/ISC-network.png) -配置DHCP的地址池和网络 - -当前这个例子是给用VMWare创建的虚拟服务器分配IP地址。第一行显示是该网络的子网掩码。括号里面的内容是DHCP服务器应该提供给网络上面主机的所有选项。 - -第一节, range 172.27.60.50 172.27.60.254;这一行显示的是,DHCP服务在这个网络上能够给主机动态分发的地址范围。 - -第二节,option routers 172.27.60.1;这里显示的是网络里面所有的主机分发默认网关地址。 - -最后一节, option broadcast-address 172.27.60.255;,显示当前网络的广播地址。这个地址不能被包含在要分发放的地址范围内,因为广播地址不能分配到一个主机上面。 - -必须要强调的是每行的结尾必须要用(;)来结束,所有创建的网络必须要在{}里面。 - -7. 如果是创建多个网络,连续的创建完它们的相应选项后保存文本文件即可。配置完成以后如果有更改,ISC-DHCP-Server进程需要重启来使新的更改生效。重启进程可以通过下面的命令来完成: - # service isc-dhcp-server restart - -这条命令将重启DHCP服务,管理员能够使用几种不同的方式来检查服务器是否已经可以处理dhcp请求。最简单的方法是通过lsof命令[1]来查看服务器是否在侦听67端口,命令如下: - - # lsof -i :67 - -![Check DHCP Listening Port](http://www.tecmint.com/wp-content/uploads/2015/04/lsof.png) -检查DHCP侦听端口 - -这里输出的结果表明DHCPD(DHCP服务守护进程)正在运行并且侦听67端口。由于/etc/services文件中67端口是端口映射,所以输出中的67端口实际上被转换成了“bootps”。 - -在大多数的系统中这是非常常见的,现在服务器应该已经为网络连接做好准备,我们可以将一台主机接入网络请求DHCP地址来验证服务是否正常。 - -### 测试客户端连接 ### - -8. 现在许多系统使用网络管理器来维护网络连接状态,因此这个设备应该预先配置好的,只要对应的接口处于活跃状态就能够获取DHCP。 - -然而当一台设备无法使用网络管理器时,它可能需要手动获取DHCP地址。下面的几步将演示怎样手动获取以及如何查看服务器是否已经按需要分发地址。 - - ‘[ifconfig][2]‘工具能够用来检查接口的配置。这台被用来测试的DHCP服务器的设备,它只有一个网络适配器(网卡),这块网卡被命名为‘eth0‘。 - - # ifconfig eth0 - -![Check Network Interface IP Address](http://www.tecmint.com/wp-content/uploads/2015/04/No-ip.png) -检查网络接口IP地址 - -从输出结果上看,这台设备目前没IPv4地址,这样很好便于测试。我们把这台设备连接到DHCP服务器并发出一个请求。这台设备上已经安装了一个名为‘dhclient‘ 的DHCP客户端工具。因为操作系统各不相同,所以这个客户端软件也是互不一样的。 - # dhclient eth0 - -![Request IP Address from DHCP](http://www.tecmint.com/wp-content/uploads/2015/04/IP.png) -从DHCP请求IP地址 - -当前 `'inet addr:'` 字段中显示了属于172.27.60.0网络地址范围内的IPv4地址。值得欣慰的是当前网络还配置了正确的子网掩码并且分发了广播地址。 - -到这里看起来还都不错,让我们来测试一下,看看这台设备收到新IP地址是不是由服务器发出的。这里我们参照服务器的日志文件来完成这个任务。虽然这个日志的内容有几十万条,但是里面只有几条是用来确定服务器是否正常工作的。这里我们使用一个工具‘tail’,它只显示日志文件的最后几行,这样我们就可以不用拿一个文本编辑器去查看所有的日志文件了。命令如下: - - # tail /var/log/syslog - -![Check DHCP Logs](http://www.tecmint.com/wp-content/uploads/2015/04/DHCP-Log.png) -检查DHCP日志文件 - -OK!服务器记录表明它分发了一个地址给这台主机(HRTDEBXENSRV)。服务器按预期运行,给它充当权威的网络分发适合的网络地址。至此DHCP服务器搭建成功并且运行。如果有需要你可以继续配置其他的网络,排查故障,确保安全。 - -在以后的Debian教程中我会讲一些新的 ISC-DHCP-Server 功能。有时间的话我将写一篇关于Bind9和DDNS的教程,融入到这篇文章里面。 --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/install-and-configure-multihomed-isc-dhcp-server-on-debian-linux/ - -作者:[Rob Turner][a] -译者:[ivo-wang](https://github.com/ivo-wang) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/robturner/ -[1]:http://www.tecmint.com/10-lsof-command-examples-in-linux/ -[2]:http://www.tecmint.com/ifconfig-command-examples/ From 98da95eb5aa33a14bee57dd63783a34e449510a0 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 25 Dec 2015 14:51:24 +0800 Subject: [PATCH 0034/1469] PUB:20151215 Linux or UNIX Desktop Fun--Let it Snow On Your Desktop @geekpi --- ...esktop Fun--Let it Snow On Your Desktop.md | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) rename {translated/tech => published}/20151215 Linux or UNIX Desktop Fun--Let it Snow On Your Desktop.md (54%) diff --git a/translated/tech/20151215 Linux or UNIX Desktop Fun--Let it Snow On Your Desktop.md b/published/20151215 Linux or UNIX Desktop Fun--Let it Snow On Your Desktop.md similarity index 54% rename from translated/tech/20151215 Linux or UNIX Desktop Fun--Let it Snow On Your Desktop.md rename to published/20151215 Linux or UNIX Desktop Fun--Let it Snow On Your Desktop.md index c47ff21da0..29b9b1a77f 100644 --- a/translated/tech/20151215 Linux or UNIX Desktop Fun--Let it Snow On Your Desktop.md +++ b/published/20151215 Linux or UNIX Desktop Fun--Let it Snow On Your Desktop.md @@ -1,16 +1,17 @@ -Linux/Unix桌面趣事:让桌面下雪 +Linux/Unix 桌面趣事:让桌面下雪 ================================================================================ -在这个节日里感到孤独么?试一下Xsnow吧。它是一个可以在Unix/Linux桌面下下雪的app。圣诞老人和他的驯鹿会在屏幕中奔跑,伴随着雪片让你感受到节日的感觉。 -我第一次是再13、4年前安装的它。它最初是在1984年Macintosh系统中创造的。你可以用下面的方法来安装: +在这个节日里感到孤独么?试一下 Xsnow 吧。它是一个可以在 Unix/Linux 桌面下下雪的应用。圣诞老人和他的驯鹿会在屏幕中奔跑,伴随着雪片让你感受到节日的感觉。 + +我第一次安装它还是在 13、4 年前。它最初是在 1984 年 Macintosh 系统中创造的。你可以用下面的方法来安装: ### 安装 xsnow ### -Debian/Ubuntu/Mint用户用下面的命令: +Debian/Ubuntu/Mint 用户用下面的命令: $ sudo apt-get install xsnow -Freebsd用户输入下面的命令: +Freebsd 用户输入下面的命令: # cd /usr/ports/x11/xsnow/ # make install clean @@ -21,13 +22,13 @@ Freebsd用户输入下面的命令: #### 其他发行版的方法 #### -1. Fedora/RHEL/CentOS在[rpmfusion][1]仓库中找找。 -2. Gentoo用户试下Gentoo portage也就是[emerge -p xsnow][2] -3. Opensuse用户使用yast搜索xsnow +1. Fedora/RHEL/CentOS 在 [rpmfusion][1] 仓库中找找。 +2. Gentoo 用户试下 Gentoo portage,也就是[emerge -p xsnow][2] +3. Opensuse 用户使用 yast 搜索 xsnow -### 我该如何使用xsnow? ### +### 我该如何使用 xsnow? ### -打开终端(程序 > 附件 > 终端),输入下面的额命令启动xsnow: +打开终端(程序 > 附件 > 终端),输入下面的额命令启动 xsnow: $ xsnow @@ -35,13 +36,13 @@ Freebsd用户输入下面的命令: ![Fig.01: Snow for your Linux and Unix desktop systems](http://files.cyberciti.biz/uploads/tips/2011/12/application-to-bring-snow-to-desktop_small.png) -图01: 在Linux和Unix桌面中显示雪花 +*图01: 在 Linux 和 Unix 桌面中显示雪花* -你可以设置背景位蓝色,并让它下白雪,输入: +你可以设置背景为蓝色,并让它下白雪,输入: $ xsnow -bg blue -sc snow -设置最大的雪片数量,并让它尽可能快地运行,输入: +设置最大的雪片数量,并让它尽可能快地掉下,输入: $ xsnow -snowflakes 10000 -delay 0 @@ -49,14 +50,14 @@ Freebsd用户输入下面的命令: $ xsnow -notrees -nosanta -关于xsnow更多的信息和选项,在命令行下输入man xsnow查看手册: +关于 xsnow 更多的信息和选项,在命令行下输入 man xsnow 查看手册: $ man xsnow 建议阅读 - 官网[下载 Xsnow][1] -- 注意[MS-Windows][2]和[Mac OS X version][3]有一次性的共享软件费用。 +- 注意 [MS-Windows][2] 和 [Mac OS X][3] 版本有一次性的共享软件费用。 -------------------------------------------------------------------------------- @@ -64,7 +65,7 @@ via: http://www.cyberciti.biz/tips/linux-unix-xsnow.html 作者:Vivek Gite 译者:[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 488427cd8b3bfee1b55965e3b6cb2485aeb1a751 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 25 Dec 2015 14:59:34 +0800 Subject: [PATCH 0035/1469] PUB:20151215 Linux or UNIX Desktop Fun--Steam Locomotive @geekpi --- ...x or UNIX Desktop Fun--Steam Locomotive.md | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) rename {translated/tech => published}/20151215 Linux or UNIX Desktop Fun--Steam Locomotive.md (53%) diff --git a/translated/tech/20151215 Linux or UNIX Desktop Fun--Steam Locomotive.md b/published/20151215 Linux or UNIX Desktop Fun--Steam Locomotive.md similarity index 53% rename from translated/tech/20151215 Linux or UNIX Desktop Fun--Steam Locomotive.md rename to published/20151215 Linux or UNIX Desktop Fun--Steam Locomotive.md index d97f0f3c68..45a56d6ddc 100644 --- a/translated/tech/20151215 Linux or UNIX Desktop Fun--Steam Locomotive.md +++ b/published/20151215 Linux or UNIX Desktop Fun--Steam Locomotive.md @@ -1,30 +1,31 @@ Linux/Unix 桌面趣事:蒸汽火车 ================================================================================ -一个[最常见的错误][1]是把ls输入成了sl。我已经设置了[一个alias][2],也就是alias sl=ls。但是你也许就错过了带汽笛的蒸汽小火车了。 +一个你[经常犯的错误][1]是把 ls 输入成了 sl。我已经设置了[一个别名][2],也就是 `alias sl=ls`。但是这样你也许就错过了这辆带汽笛的蒸汽小火车了。 -sl是一个玩笑软件或是一个Unix游戏。它会在你错误地把“ls”输入成“sl”(Steam Locomotive)后出现一辆蒸汽火车穿过你的屏幕。 +sl 是一个搞笑软件或,也是一个 Unix 游戏。它会在你错误地把“ls”输入成“sl”(Steam Locomotive)后出现一辆蒸汽火车穿过你的屏幕。 ### 安装 sl ### -在Debian/Ubuntu下输入下面的命令: +在 Debian/Ubuntu 下输入下面的命令: # apt-get install sl -它同样也在Freebsd和其他类Unix的操作系统上存在。下面把ls输错成sl: +它同样也在 Freebsd 和其他类Unix的操作系统上存在。 + +下面,让我们把 ls 输错成 sl: $ sl ![Fig.01: Run steam locomotive across the screen if you type "sl" instead of "ls"](http://files.cyberciti.biz/uploads/tips/2011/05/sl_command_steam_locomotive.png) -图01: 如果你把“ls”输入成“sl”蒸汽火车会穿过你的屏幕。 +*图01: 如果你把 “ls” 输入成 “sl” ,蒸汽火车会穿过你的屏幕。* -It also supports the following options: 它同样支持下面的选项: -- **-a** : 似乎发生了意外。你会哭喊求助的人们感到难过。 +- **-a** : 似乎发生了意外。你会为那些哭喊求助的人们感到难过。 - **-l** : 显示小一点的火车 -- **-F** : 它飞走 -- **-e** : 允许被Ctrl+C终端 +- **-F** : 它居然飞走了 +- **-e** : 允许被 Ctrl+C 中断 -------------------------------------------------------------------------------- @@ -32,7 +33,7 @@ via: http://www.cyberciti.biz/tips/displays-animations-when-accidentally-you-typ 作者:Vivek Gite 译者:[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 aeb432f56aa517315f1b45f3f8212bb0ae7c9cb2 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 25 Dec 2015 15:29:41 +0800 Subject: [PATCH 0036/1469] PUB:20151215 Linux or UNIX Desktop Fun--Terminal ASCII Aquarium @geekpi --- ...IX Desktop Fun--Terminal ASCII Aquarium.md | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) rename {translated/tech => published}/20151215 Linux or UNIX Desktop Fun--Terminal ASCII Aquarium.md (68%) diff --git a/translated/tech/20151215 Linux or UNIX Desktop Fun--Terminal ASCII Aquarium.md b/published/20151215 Linux or UNIX Desktop Fun--Terminal ASCII Aquarium.md similarity index 68% rename from translated/tech/20151215 Linux or UNIX Desktop Fun--Terminal ASCII Aquarium.md rename to published/20151215 Linux or UNIX Desktop Fun--Terminal ASCII Aquarium.md index ed26f49783..e24c2f381e 100644 --- a/translated/tech/20151215 Linux or UNIX Desktop Fun--Terminal ASCII Aquarium.md +++ b/published/20151215 Linux or UNIX Desktop Fun--Terminal ASCII Aquarium.md @@ -1,11 +1,11 @@ -Linux/Unix桌面趣事:终端ASCII水族箱 +Linux/Unix 桌面趣事:终端 ASCII 水族箱 ================================================================================ -你可以在你的终端中使用ASCIIQuarium安全地欣赏海洋的神秘了。它是一个用perl写的ASCII艺术水族箱/海洋动画。 + +你可以在你的终端中使用 ASCIIQuarium 安全地欣赏海洋的神秘了。它是一个用 perl 写的 ASCII 艺术水族箱/海洋动画。 ### 安装 Term::Animation ### - -首先你需要安装名为Term-Animation的perl模块。打开终端(选择程序 > 附件 > 终端),并输入: +首先你需要安装名为 Term-Animation 的perl模块。打开终端(选择程序 > 附件 > 终端),并输入: $ sudo apt-get install libcurses-perl $ cd /tmp @@ -15,9 +15,9 @@ Linux/Unix桌面趣事:终端ASCII水族箱 $ perl Makefile.PL && make && make test $ sudo make install -### 下载安装ASCIIQuarium ### +### 下载安装 ASCIIQuarium ### -接着再终端中输入: +接着在终端中输入: $ cd /tmp $ wget http://www.robobunny.com/projects/asciiquarium/asciiquarium.tar.gz @@ -26,7 +26,7 @@ Linux/Unix桌面趣事:终端ASCII水族箱 $ sudo cp asciiquarium /usr/local/bin $ sudo chmod 0755 /usr/local/bin/asciiquarium -### 我怎么浏览ASCII水族箱? ### +### 我怎么观赏 ASCII 水族箱? ### 输入下面的命令: @@ -38,6 +38,8 @@ Linux/Unix桌面趣事:终端ASCII水族箱 ![Fig.01: ASCII Aquarium](http://s0.cyberciti.org/uploads/tips/2011/01/screenshot-ASCIIQuarium.png) +*ASCII 水族箱* + ### 相关媒体 ### 注:youtube 视频 @@ -45,9 +47,9 @@ Linux/Unix桌面趣事:终端ASCII水族箱 [视频01: ASCIIQuarium - Linux/Unix桌面上的海洋动画][1] -### 下载:ASCII Aquarium的KDE和Mac OS X版本 ### +### 下载:ASCII Aquarium 的 KDE 和 Mac OS X 版本 ### -[下载asciiquarium][2]。如果你运行的是Mac OS X,试下一个可以直接使用已经打包好的[版本][3]。对于KDE用户,试试基于Asciiquarium的[KDE屏幕保护程序][4] +[点此下载 asciiquarium][2]。如果你运行的是 Mac OS X,试下这个可以直接使用的已经打包好的[版本][3]。对于 KDE 用户,试试基于 Asciiquarium 的[KDE 屏幕保护程序][4] -------------------------------------------------------------------------------- @@ -55,7 +57,7 @@ via: http://www.cyberciti.biz/tips/linux-unix-apple-osx-terminal-ascii-aquarium. 作者:Vivek Gite 译者:[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 df310db48059e0d69cf0ae7063c2c877e11f40bd Mon Sep 17 00:00:00 2001 From: DeadFire Date: Fri, 25 Dec 2015 16:27:30 +0800 Subject: [PATCH 0037/1469] =?UTF-8?q?20151225-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ugins to increase productivity on Emacs.md | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 sources/tech/20151225 What are the best plugins to increase productivity on Emacs.md diff --git a/sources/tech/20151225 What are the best plugins to increase productivity on Emacs.md b/sources/tech/20151225 What are the best plugins to increase productivity on Emacs.md new file mode 100644 index 0000000000..17fb4ba8ab --- /dev/null +++ b/sources/tech/20151225 What are the best plugins to increase productivity on Emacs.md @@ -0,0 +1,78 @@ +What are the best plugins to increase productivity on Emacs +================================================================================ +Over a year ago now, I went looking for the best plugins to [turn Vim into a full-fledged IDE][1]. Interestingly, a lot of the comments on that post were about how Emacs already has most of these plugins built in, and was already a great IDE. Although I can only agree about Emacs' incredible versatility, it is still not the ultimate editor when it comes out of the box. Thankfully, its vast plugin library is here to fix that. But among the plethora of options available to you, it is sometimes hard to know where to start. So for now, let me try to assemble a short list of the indispensable plugins to increase your productivity while using Emacs. Although I am heavily geared towards programming related productivity, most of these plugins would be useful to anyone for any usage. + +### 1. Ido-mode ### + +![](https://c2.staticflickr.com/6/5718/23311895573_c1fb34337c_c.jpg) + +Maybe one of the most useful plugin for beginners, Ido stands for interactively do. It replaces most of the dry prompts with a fancy character matching menu. For example, it will replace the normal prompt to open a file with a list of all the files in the current directory. Type any string, and Ido will try to match it with the most appropriate file. It makes it really easy to visualize your actions, and also to quickly get through a folder where all files are named with the same prefix. + +### 2. Smex ### + +![](https://c2.staticflickr.com/2/1517/23310442314_2a22a60c34_c.jpg) + +Not the most famous one, but a good place to complete what Ido-mode started: Smex can be a fancy replacement to the normal 'M-x' prompt, with a heavy inspiration from Ido-mode. It brings the same interactive search for the commands you would normally have to type after calling 'M-x'. It is simple and efficient, and a great way to save those additional few fractions of a second you normally need. + +### 3. Auto Complete ### + +![](https://c2.staticflickr.com/6/5794/23643004900_3042f77952_c.jpg) + +Before knowing the existence of this plugin, I spent half of my time on Emacs pressing ‘M-/’ to complete my words. Now, I have a fancy pop-up to do it for me. There is not much more to say about it, except that we all need it. + +### 4. YASnippet ### + +![](https://c2.staticflickr.com/2/1688/23830403072_0d8df6ef4c_b.jpg) + +This one is really for the coders. There is always some piece of code that we feel we use all the time. For me, it's 'var_dump(...); exit;' to debug PHP. After a while of typing it over and over, it just occurred to me that I could have it pre-recorded and easily accessible as a snippet of code. With YASnippets, it's easy to import snippet files or make your own. After that, a simple press on the tabulation key will expand a small keyword into a chunk of pre-written code easy to navigate through and modify. + +### 5. Org-mode ### + +![](https://c2.staticflickr.com/6/5687/23570808789_d683c949e4.jpg) + +For disclaimer, I have only recently started using Org-mode. But it has already blown me away. From the hundreds of written pieces I have seen around, Org-mode can change your life. The idea behind it is simple: it is a mode that simplifies note taking while keeping a plain text format, making it easy to navigate through lists of tasks and various data, and perform operations such as filtering by priority or due date, or setting a recurrence. Yet, from this simple idea, you can accomplish a lot, and it is easy to get overwhelmed with all the options. Rather than a long explanation, I urge you to go through [available tutorials][2], watch a lot of videos, and see by yourself how powerful Org-mode is. + +### 6. Helm ### + +![](https://c2.staticflickr.com/2/1489/23310442334_5e6db22b79_c.jpg) + +Some love it, but others are not such a big fan of it. I am part of the later. But with such a huge following, it is impossible to avoid it. Helm aims to transform your Emacs experience completely. Simply described, Helm is a framework that will help you find a file or a command quickly from within Emacs. Based on your input, it will try to use word completion to guide you to the action you have in mind. The feeling is a bit weird at first, but for some, Helm is a religion of its own. Although I am not its fan, I do appreciate helm-occur which a great tool to search for strings in a large document as it shows all occurrences in a separate buffer, making it easy to navigate through them. If you are looking for a quick demo to understand what Helm can do, I recommend [this post][3]. + +### 7. ace-jump-mode ### + +![](https://c2.staticflickr.com/2/1710/23856168871_6df1faa565_c.jpg) + +Another plugin with a big following that I am trying to get on board with is ace-jump-mode. Master this plugin, and you will be promised to transcend the usage of a mouse. Simply described, by triggering ace-jump-mode with a shortcut of your choice, you will be prompted for a character. Enter one, and all words starting with that character will be highlighted with a unique letter. Enter one of the letters on screen, and your cursor will jump straight to the word it is highlighting. I have to admit that it is pretty hard to get the reflex to use it, but once you have it, it will increase your movement speed in a document by a lot. + +### 8. find-file-in-project ### + +![](https://c2.staticflickr.com/2/1492/23570808809_96ec8454a9_c.jpg) + +If you like Sublime text and its very handy 'Ctrl-p' fuzzy search to open any file in a project, then you will love find-file-in-project (or ffip). After setting it up by declaring the root of your version control folder, you can summon easily a cool text bar that quickly scans and searches through your code base for a matching file based on the name you input. I like to have it bound to the F6 key on my keyboard. It is simple and very handy if you do not know the complicate directory structure from the top of your head. + +### 9. Flymake ### + +![](https://c2.staticflickr.com/6/5708/23310442354_cbba657ed3.jpg) + +For IDE lovers, I think that syntax checker is one of the most powerful features. It is great for beginners and handy for tired programmers. And thanks to Flymake, Emacs users can enjoy it too. Since I work in PHP a lot, Flymake does not need any extra configuration. As I write my code, it will automatically check my code and highlight any line that contains a problem. For compiled languages, Flymake will look for a Makefile that it will use to check your code. Absolutely magical. + +### 10. electric-pair ### + +Last, but not least, electric-pair is one of the simplest yet most powerful plugin in my opinion. It just automatically closes whatever parenthesis or bracket you open. It doesn't look like much at first, but trust me. After struggling for the hundredth time to find that matching parenthesis, you will be glad to have a plugin to ensure that all your expressions are balanced. + +To conclude, Emacs is a fantastic tool. Probably not a shocker. Try these plugins and watch as your productivity goes through the roof. This list is of course not exhaustive at all. If you want to bring your contribution, feel free to do so in the comments. I am myself always looking for new plugins to try and new ways to experience Emacs. + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/best-plugins-to-increase-productivity-on-emacs.html + +作者:[Adrien Brochard][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/adrien +[1]:http://xmodulo.com/turn-vim-full-fledged-ide.html +[2]:http://orgmode.org/worg/org-tutorials/ +[3]:http://tuhdo.github.io/helm-intro.html From c76e19e7bd0e2becb6ff435fe84a39d8edae5e8d Mon Sep 17 00:00:00 2001 From: taichirain Date: Sat, 26 Dec 2015 01:18:30 +0800 Subject: [PATCH 0038/1469] first commit --- ...onfigure Apache Solr on Ubuntu 14 or 15.md | 81 +++++++------------ 1 file changed, 29 insertions(+), 52 deletions(-) diff --git a/sources/tech/20151123 How to Configure Apache Solr on Ubuntu 14 or 15.md b/sources/tech/20151123 How to Configure Apache Solr on Ubuntu 14 or 15.md index 0353702dc9..f2dd3e3474 100644 --- a/sources/tech/20151123 How to Configure Apache Solr on Ubuntu 14 or 15.md +++ b/sources/tech/20151123 How to Configure Apache Solr on Ubuntu 14 or 15.md @@ -1,48 +1,39 @@ taichirain 翻译中 -How to Configure Apache Solr on Ubuntu 14 / 15 如何在Ubuntu 14/15上配置Apache Solr ================================================================================ -Hello and welcome to our today's article on Apache Solr. The brief description about Apache Solr is that it is an Open Source most famous search platform with Apache Lucene at the back end for Web sites that enables you to easily create search engines which searches websites, databases and files. It can index and search multiple sites and return recommendations for related contents based on the searched text. +大家好,欢迎来阅读我们今天Apache Solr的文章.Apache Solr是一个运行在网站后台的目前最热门的一个搜索引擎,基于Apache Lucene,能让你很容易的创建搜索引擎,数据库,文件。它能够索引和搜索多个网站并根据搜索文本的相关内容返回搜索建议. -Solr works with HTTP Extensible Markup Language (XML) that offers application program interfaces (APIs) for Javascript Object Notation, Python, and Ruby. According to the Apache Lucene Project, Solr offers capabilities that have made it popular with administrators including it many featuring like: +Solr工作在可扩展标记语言(XML),并可以为JSON、Python和Ruby提供应用程序接口(APIs)。根据Apache Lucene项目,Solr提供了非常多的功能,让它很受管理员们的欢迎: - 全文检索 - 分面导航 -- Snippet generation/highting - 拼写建议/自动完成 -- Custom document ranking/ordering - 自定义文档排序/排列 #### 前提条件: #### - -On a fresh Linux Ubuntu 14/15 with minimal packages installed, you only have to take care of few prerequisites in order to install Apache Solr. -在一个以最小化安装包安装的linux Ubuntu 14/15的系统上,你仅仅需要少量的准备,就可以开始安装 Apache Solor. +在一个使用Ubuntu 14/15最小化安装包的系统上,你仅仅需要少量的准备,就开始安装 Apache Solor. ### 1)System Update 系统更新### -Login to your Ubuntu server with a non-root sudo user that will be used to perform all the steps to install and use Solr. -在所有的安装步骤以及使用Solor过程中使用一个具有sudo权限的非root用户登录Ubuntu server +在所有的安装步骤以及使用Solor过程中使用一个具有sudo权限的非root用户登录Ubuntu server。 -After successful login, issue the following command to update your system with latest updates and patches. 登录成功后,使用下面的命令,升级你的系统到最新的更新及补丁 $ sudo apt-get update ### 2) JRE Setup 安装JRE### +要安装Solr,首先需要安装JRE(Java Runtime Environment)作为基础环境,因为solr和tomcat都是基于Java.所以,我们需要安装最新版的Java和配置Java本地环境. -The Solr setup needs Java Runtime Environment to be installed on the system as its basic requirement because solr and tomcat both are the Java based applications. So, we need to install and configure its home environment with latest Java. - -To install the latest version on Oracle Java 8, we need to install Python Software Properties using the below command. +为了安装最新版的Java 8,我们需要安装Python Software Properties工具包 $ sudo apt-get install python-software-properties -Upon completion, run the setup its the repository for the latest version of Java 8. +完成后,配置最新版Java 8的仓库 $ sudo add-apt-repository ppa:webupd8team/java -Now you are able to install the latest version of Oracle Java 8 with 'wget' by issuing the below commands to update the packages source list and then to install Java. -使用下面的命令升级源列表,然后安装java,然后你就可以使用'wget'安装Oracle Jave 8的最新版本 +使用下面的命令更新源,然后安装java,然后使用'wget'安装Oracle Jave 8的最新版本 $ sudo apt-get update @@ -50,32 +41,25 @@ Now you are able to install the latest version of Oracle Java 8 with 'wget' by i $ sudo apt-get install oracle-java8-installer -Accept the Oracle Binary Code License Agreement for the Java SE Platform Products and JavaFX as you will be asked during the Java installation and configuration process by a click on the 'OK' button. -在安装和配置Java SE Platform 和 JavaFX 过程中点击'OK'按钮,接受 Oracle Binary Code License Agreement 协议. +在安装和配置Java SE Platform 和 JavaFX 过程中点击'OK'按钮接受 Oracle Binary Code License Agreement 协议. -When the installation process complete, run the below command to test the successful installation of Java and check its version. -在安装完成后,运行下面的命令,检查是否安装成功以及安装的版本 +在安装完成后,运行下面的命令,检查是否安装成功以及查看安装的版本 kash@solr:~$ java -version java version "1.8.0_66" Java(TM) SE Runtime Environment (build 1.8.0_66-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode) -The output indicates that we have successfully fulfilled the basic requirement of Solr by installing the Java. Now move to the next step to install Solr. 执行结果表明我们已经成功的安装了Java,并达到安装Solr最基本的要求了 -### Installing Solr 安装Solr### +### 安装Solr### +有两种不同的方式可以在Ubuntu上安装Solr,在本文中我们只用最新的源码包来演示源码安装 -Installing Solr on Ubuntu can be done by using two different ways but in this article we prefer to install its latest package from the source. -有两种不同的方式可以在Ubuntu上安装Solr,在本文中,只会用最新的源码包来演示源码安装 - -To install Solr from its source, download its available package with latest version from there Official [Web Page][1], copy the link address and get it using 'wget' command. -要使用源码安装Solr,先要从官网 [Web Page][1] 下载最新的可用安装包。复制一下链接,然后使用 'wget'命令来下载。 +要使用源码安装Solr,先要从官网 [Web Page][1] 下载最新的可用安装包。复制以下链接,然后使用 'wget'命令来下载。 $ wget http://www.us.apache.org/dist/lucene/solr/5.3.1/solr-5.3.1.tgz -Run the command below to extract the archived service into '/bin' folder. -运行下面的命令,将归档服务解压到 /bin目录 +运行下面的命令,将已压缩的服务解压到 /bin目录 $ tar -xzf solr-5.3.1.tgz solr-5.3.1/bin/install_solr_service.sh --strip-components=2 @@ -84,42 +68,36 @@ Then run the script to start Solr service that will creates a new 'solr' user an $ sudo bash ./install_solr_service.sh solr-5.3.1.tgz -![Solr Installation](http://blog.linoxide.com/wp-content/uploads/2015/11/12.png) +![Solr 安装](http://blog.linoxide.com/wp-content/uploads/2015/11/12.png) -To check the status of Solr service, you use the below command. 使用下面的命令来检查Solr服务的状态 $ service solr status -![Solr Status](http://blog.linoxide.com/wp-content/uploads/2015/11/22.png) +![Solr 状态](http://blog.linoxide.com/wp-content/uploads/2015/11/22.png) -### Creating Solr Collection: 创建Solr集合: ### - -Now we can create multiple collections using Solr user. To do so just run the below command by mentioning the name of the collection you want to create and by specifying its configuration set as shown. +### 创建Solr集合: ### +我们现在可以使用Solr用户添加多个集合.就像下图所示的那样,我们仅仅只需要在命令行中指定集合名称和指定其配置集就可以创建多个集合了 $ sudo su - solr -c "/opt/solr/bin/solr create -c myfirstcollection -n data_driven_schema_configs" -![creating collection](http://blog.linoxide.com/wp-content/uploads/2015/11/32.png) +![创建集合](http://blog.linoxide.com/wp-content/uploads/2015/11/32.png) -We have successfully created the new core instance directory for our our first collection where we can add new data in it. To view its default schema file in directory '/opt/solr/server/solr/configsets/data_driven_schema_configs/conf' . -我们已经成功的为我们的第一个集合创建了新的内核实例目录,并可以将数据添加到那里。 +我们已经成功的为我们的第一个集合创建了新的内核实例目录,并将数据添加到里面。 它的概要文件在 '/opt/solr/server/solr/configsets/data_driven_schema_configs/conf' ### Using Solr Web 使用Solr页面### - -Apache Solr can be accessible on the default port of Solr that 8983. Open your favorite browser and navigate to http://your_server_ip:8983/solr or http://your-domain.com:8983/solr. Make sure that the port is allowed in your firewall. -Apache Solr可以使用默认的端口8983进入.打开浏览器,输入 http://your_server_ip:8983/solr 或者 http://your-domain.com:8983/solr. 确保你的防火墙允许8983端口. +可以使用默认的端口8983连接Apache Solr.打开浏览器,输入 http://your_server_ip:8983/solr 或者 http://your-domain.com:8983/solr. 确保你的防火墙允许8983端口. http://172.25.10.171:8983/solr/ -![Solr Web Access](http://blog.linoxide.com/wp-content/uploads/2015/11/42.png) +![Web访问Solr](http://blog.linoxide.com/wp-content/uploads/2015/11/42.png) -From the Solr Web Console click on the 'Core Admin' button from the left bar, then you will see your first collection that we created earlier using CLI. While you can also create new cores by pointing on the 'Add Core' button. 在Solr的Web控制台的左侧菜单点击'Core Admin'按钮,你将会看见我们之前使用CLI方式创建的集合。你可以点击'Add Core'按钮来创建新的内核 -![Adding Core](http://blog.linoxide.com/wp-content/uploads/2015/11/52.png) +![添加核心](http://blog.linoxide.com/wp-content/uploads/2015/11/52.png) -You can also add the document and query from the document as shown in below image by selecting your particular collection and pointing the document. Add the data in the specified format as shown in the box. +就像下图中所示,你可以选择某个集合和指向文档向里面添加内容或从文档中查询数据。像方框中显示的那样添加指定格式的数据。 { "number": 1, @@ -131,20 +109,19 @@ You can also add the document and query from the document as shown in below imag "skills": "Linux and Virtualization" } -After adding the document click on the 'Submit Document' button. +添加文件后点击'Submit Document'按钮. -![adding Document](http://blog.linoxide.com/wp-content/uploads/2015/11/62.png) +![添加文档](http://blog.linoxide.com/wp-content/uploads/2015/11/62.png) -### Conclusion 总结### - -You are now able to insert and query data using the Solr web interface after its successful installation on Ubuntu. Now add more collections and insert you own data and documents that you wish to put and manage through Solr. We hope you have got this article much helpful and enjoyed reading this. +### 结尾### +在Ubuntu上安装成功后,你就可以使用Solr WEB接口插入或查询数据。如果你想通过Solr来管理更多的数据和文件,可以创建更多的集合。希望你能喜欢这篇文章并且希望它能够帮到你。 -------------------------------------------------------------------------------- via: http://linoxide.com/ubuntu-how-to/configure-apache-solr-ubuntu-14-15/ 作者:[Kashif][a] -译者:[译者ID](https://github.com/译者ID) +译者:[译者ID](https://github.com/taichirain) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From f582966b4dc5f77018dae3eb46d32fe2f372aae7 Mon Sep 17 00:00:00 2001 From: taichirain Date: Sat, 26 Dec 2015 01:40:40 +0800 Subject: [PATCH 0039/1469] Raspberry Pi --- ...51208 5 great Raspberry Pi projects for the classroom.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sources/talk/yearbook2015/20151208 5 great Raspberry Pi projects for the classroom.md b/sources/talk/yearbook2015/20151208 5 great Raspberry Pi projects for the classroom.md index c1aa541416..302034c330 100644 --- a/sources/talk/yearbook2015/20151208 5 great Raspberry Pi projects for the classroom.md +++ b/sources/talk/yearbook2015/20151208 5 great Raspberry Pi projects for the classroom.md @@ -1,8 +1,12 @@ +taichirain 翻译中 + 5 great Raspberry Pi projects for the classroom +5 伟大的树莓派项目教室 ================================================================================ ![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/osdc-open-source-yearbook-lead3.png) Image by : opensource.com +图片来源 : opensource.com ### 1. Minecraft Pi ### @@ -93,4 +97,4 @@ via: https://opensource.com/education/15/12/5-great-raspberry-pi-projects-classr [11]:https://www.piborg.org/4borg [12]:https://www.piborg.org/diddyborg [13]:https://www.piborg.org/doodleborg -[14]:http://camjam.me/?page_id=1035#worksheets \ No newline at end of file +[14]:http://camjam.me/?page_id=1035#worksheets From feb3be13eec53741e219e2c42adc58d8004ca8ec Mon Sep 17 00:00:00 2001 From: taichirain Date: Sat, 26 Dec 2015 09:20:54 +0800 Subject: [PATCH 0040/1469] =?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 --- .../20151123 How to Configure Apache Solr on Ubuntu 14 or 15.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20151123 How to Configure Apache Solr on Ubuntu 14 or 15.md b/sources/tech/20151123 How to Configure Apache Solr on Ubuntu 14 or 15.md index f2dd3e3474..64357e0284 100644 --- a/sources/tech/20151123 How to Configure Apache Solr on Ubuntu 14 or 15.md +++ b/sources/tech/20151123 How to Configure Apache Solr on Ubuntu 14 or 15.md @@ -121,7 +121,7 @@ Then run the script to start Solr service that will creates a new 'solr' user an via: http://linoxide.com/ubuntu-how-to/configure-apache-solr-ubuntu-14-15/ 作者:[Kashif][a] -译者:[译者ID](https://github.com/taichirain) +译者:[taichirain](https://github.com/taichirain) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2ca82e18efdbc537cce982e57f19dcc82bc66b0a Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 26 Dec 2015 14:48:33 +0800 Subject: [PATCH 0041/1469] translating --- sources/tech/20151222 Turn Tor socks to http.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20151222 Turn Tor socks to http.md b/sources/tech/20151222 Turn Tor socks to http.md index da6eb0ed5a..89729eb189 100644 --- a/sources/tech/20151222 Turn Tor socks to http.md +++ b/sources/tech/20151222 Turn Tor socks to http.md @@ -1,3 +1,5 @@ +translating---geekpi + Turn Tor socks to http ================================================================================ ![](http://1426826955.rsc.cdn77.org/wp-content/uploads/2015/12/tor-593x445.jpg) @@ -83,4 +85,4 @@ via: http://www.unixmen.com/turn-tor-socks-http/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://www.unixmen.com/author/hossein/ \ No newline at end of file +[a]:http://www.unixmen.com/author/hossein/ From 613744becc0be90d702be1931d4732fb970c2f7b Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 26 Dec 2015 15:11:58 +0800 Subject: [PATCH 0042/1469] translated --- .../tech/20151222 Turn Tor socks to http.md | 40 +++++++++---------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/sources/tech/20151222 Turn Tor socks to http.md b/sources/tech/20151222 Turn Tor socks to http.md index 89729eb189..6f50ba2455 100644 --- a/sources/tech/20151222 Turn Tor socks to http.md +++ b/sources/tech/20151222 Turn Tor socks to http.md @@ -1,65 +1,63 @@ -translating---geekpi - -Turn Tor socks to http +将Tor socks转换成http ================================================================================ ![](http://1426826955.rsc.cdn77.org/wp-content/uploads/2015/12/tor-593x445.jpg) -For using Tor service you can use diffrent tools like Tor browser, Foxyproxy and other things, some download managers such as Wget or Aria2 can’t get Tor socks directly and start downloading anonymously with that so we need some tools to change Tor socks to http and then download with that. +使用tor服务你可以使用不同的工具像Tor浏览器、Foxyproxy和其他事情,有些下载管理器像wget和aria2不能直接直接使用tor socks开始匿名下载,因此我们需要一些工具来将tor socks转换成http代理这样就能用它来下载了。 -**Note** : This tutorial is under Debian distrobutions and in other distrobutions may be diffrent so if your distro is Debian base and you have configured Tor correctly go a head ! +**注意**:本教程基于Debian下,其他发行版会有些不同,因此如果你的发行版是基于Debian的,就可以直接使用下面的配置了。 -**Polipo** : This service uses 8123 Port and 127.0.0.1 IP, use following command to install Polipo on your computer : +**Polipo** : 这个服务会使用8123端口和127.0.0.1的IP,使用下面的命令来在计算机上安装Polipo: sudo apt install polipo -Now use this command to go in Polipo config file: +现在使用这个命令打开Polipo的配置文件: sudo nano /etc/polipo/config -Add the following lines to the end of the file : +在文件最后加入下面的行: proxyAddress = "::0" allowedClients = 192.168.1.0/24 socksParentProxy = "localhost:9050" socksProxyType = socks5 -Restart the Polipo service with this command : +用下面的命令来重启Polipo: sudo service polipo restart -Now Polipo is ready ! do what ever you like in anonymous world ! as example of how using it : +现在Polipo已经安装好了!在匿名的世界里做你想做的吧!下面是使用的例子: pdmt -l "link" -i 127.0.01 -p 8123 -With command above, PDMT ( Persian Download Manager Terminal ) will download your file anonymously. +用上面的命令PDMT(Persian下载器)会匿名地下载你的文件。 -**Proxychains** : In this service you can set Tor or Lantern proxy to turn socks too but in usage it’s a little diffrent with Polipo and Privoxy because you don’t need to use any port ! for installing that use following command : +**Proxychains** : 在此服务中你可以设置使用tor或者Lantern代理,但是在使用上它和Polipo和Privoxy有点不同,它不需要使用任何端口!使用下面的命令来安装: sudo apt install proxychains -Open config file with this command : +用这条命令来打开配置文件: sudo nano /etc/proxychains.conf -Now add the following code to the end of text, this code is Tor port and Ip : +现在添加下面的代码到文件底部,这里是tor的端口和IP: socks5 127.0.0.1 9050 -If you put “proxychains” word before a command in terminal and run it, it would run by Tor proxy : +如果你在命令的前面加上“proxychains”并运行,它就能通过tor代理来运行: proxychains firefoxt proxychains aria2c proxychains wget -**Privoxy** : Privoxy uses 8118 port and it’s easy to run first install privoxy package : +**Privoxy** : Privoxy使用8118端口,并且首次可以很轻松地通过privoxy包来安装: sudo apt install privoxy -We should change the config file now : +我们现在要修改配置文件: sudo nano /etc/pivoxy/config -Add the following lines to end of the file : +在文件底部加入下面的行: forward-socks5 / 127.0.0.1:9050 . forward-socks4a / 127.0.0.1:9050 . @@ -69,18 +67,18 @@ Add the following lines to end of the file : forward 127.*.*.*/ . forward localhost/ . -Restart the service : +重启服务: sudo service privoxy restart -Service is ready ! port is 8118 and Ip is 127.0.0.1 use it and enjoy from it ! +服务已经好了!端口是8118,IP是127.0.0.1,就尽情使用吧! -------------------------------------------------------------------------------- via: http://www.unixmen.com/turn-tor-socks-http/ 作者:[Hossein heydari][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 6aff74c08e4feb47a4e74dc14b5c94e05ff246c2 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 26 Dec 2015 15:13:57 +0800 Subject: [PATCH 0043/1469] Rename sources/tech/20151222 Turn Tor socks to http.md to translated/tech/20151222 Turn Tor socks to http.md --- {sources => translated}/tech/20151222 Turn Tor socks to http.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20151222 Turn Tor socks to http.md (100%) diff --git a/sources/tech/20151222 Turn Tor socks to http.md b/translated/tech/20151222 Turn Tor socks to http.md similarity index 100% rename from sources/tech/20151222 Turn Tor socks to http.md rename to translated/tech/20151222 Turn Tor socks to http.md From 0583c7b8eb6142facd439024d2e09d757dccef3e Mon Sep 17 00:00:00 2001 From: sonofelice Date: Sat, 26 Dec 2015 16:24:35 +0800 Subject: [PATCH 0044/1469] complete --- ... open source community metrics to track.md | 41 +++++++++---------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/sources/talk/yearbook2015/20151208 Top 5 open source community metrics to track.md b/sources/talk/yearbook2015/20151208 Top 5 open source community metrics to track.md index e0b309e9b0..73a48fb694 100644 --- a/sources/talk/yearbook2015/20151208 Top 5 open source community metrics to track.md +++ b/sources/talk/yearbook2015/20151208 Top 5 open source community metrics to track.md @@ -2,15 +2,15 @@ ================================================================================ ![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/yearbook2015-osdc-lead-1.png) -你决定使用指标来追踪那些免费开源的软件社区。那么问题来了:我应该去追踪哪些指标呢? +如果你决定使用指标来追踪那些免费开源的软件社区。那么问题来了:我应该去追踪哪些指标呢? -要回答这个问题,你首先要知道你需要什么信息。比如,你可能想要知道一个项目社区的可持续性。这个社区对问题的应对速度怎么样。一个社区如何吸引、维持或者失去贡献者。一旦你知道需要哪类信息,你就可以找出哪些社区活动可以提供你想要知道的内容。幸运的是,免费开源社区(FOSS)一些遵从开放式开发模型的项目在其软件开发仓库里留下了大量的公共数据,我们可以对这些数据进行分析,并从中收集到一些有用的数据。 +要回答这个问题,你首先要知道你需要什么信息。比如,你可能想要知道一个项目社区的可持续性。这个社区对问题的应对速度怎么样。一个社区怎么吸引、维护或者流失贡献者。一旦你知道需要哪类信息,你就可以找出哪些社区活动可以提供你想要知道的内容。幸运的是,免费开源社区(FOSS)一些遵从开放式开发模型的项目在其软件开发仓库里留下了大量的公共数据,我们可以对这些数据进行分析,并从中收集到一些有用的数据。 在这篇文章中,我会介绍一些指标,从而为这些项目社区提供一个多方位的视角分析。 ### 1. 社区活动 ### -一个社区的总体活动和这个社区怎样随着时间演变,是度量一个社区好坏的非常有用的指标。社区活动是评价一个社区工作量的第一印象,也可以用来追踪不同种类的活动。比如,提交次数,给人的第一印象就是跟开发工作量挂钩。通过投票的数量我们可以大概知道提交了多少bug或者又提出了多少新特性。邮件列表的数量或者论坛帖子的数量可以让我了解到有过多少次公开的讨论。 +一个社区的总体活动和这个社区怎样随着时间演变,是度量一个社区好坏的非常有用的指标。社区活动是评价一个社区工作量的第一印象,也可以用来追踪不同种类的活动。比如,提交次数,给人的第一印象就是跟开发工作量挂钩。通过投票的数量我们可以大概知道提交了多少bug或者又提出了多少新特性。邮件列表的数量或者论坛帖子的数量可以让我们了解到有过多少次公开的讨论。 ![Activity metrics chart](https://opensource.com/sites/default/files/images/business-uploads/activity-metrics.png) @@ -19,47 +19,46 @@ ### 2. 社区规模 ### -社区的规模指的是参与到这个社区的人数,但是,基于不同形式的参与人数也有很大的差别。好消息是,通常你只对积极活跃的贡献者比较感兴趣。活跃的贡献者 +社区的规模指的是参与到这个社区的人数,但是,基于不同形式的参与人数也有很大的差别。好消息是,通常你只对积极活跃的贡献者比较感兴趣。活跃的贡献者会在项目的仓库留下一些线索。这意味着你可以通过查看git仓库存放的代码中**author**字段来统计积极贡献代码的人数,或者通过看积极参与问题解决的人的得票数来统计活跃人数。 -The size of the community is the number of people participating in it, but, depending on the kind of participation, size numbers may vary. Usually you're interested in active contributors, which is good news. Active people may leave traces in the repositories of the project, which means you can count contributors who are active in producing code by looking at the **Author** field in git repositories, or count people participating in the resolution of tickets by looking at who is contributing to them. - -This basic idea of activity" (somebody did something) can be extended in many ways. One common way to track activity is to look at how many people did a sizable chunk of the activity. Generally most of a project's code contributions, for example, are from a small fraction of the people in the project's community. Knowing about that fraction helps provide an idea of the core group (i.e., the people who help lead the community). +所谓活跃(某些人做了某些事)可以扩展到很多方面。一种常见的跟踪活动的方式是看有多少人做了工作量相当可观的任务。比如,通常一个项目代码的贡献者是来自这个项目社区的一小部分人。了解了这一小部分人,就对核心的工作组(比如,领导这个社区的人)有一个基本的认识了。 ![Size metrics chart](https://opensource.com/sites/default/files/images/business-uploads/size-metrics.png) -Number of authors and number of posters in mailing lists in the Xen project, as found in the [Xen Project Development Dashboard][2]. Evolution over time (monthly data). +[Xen项目开发看板][2]上展示的该项目邮件列表上作者人数和提交人数随时间的变化趋势(每月数据) -### 3. Performance ### +### 3. 社区表现 ### -So far, I have focused on measuring quantities of activities and contributors. You also can analyze how processes and people are performing. For example, you can measure how long processes take to finish. Time to resolve or close tickets shows how the project is reacting to new information that requires action, such as fixing a reported bug or implementing a requested new feature. Time spent in code review—from the moment when a change to the code is proposed to the moment it is accepted—shows how long upgrading a proposed change to the quality standards expected by the community takes. -Other metrics deal with how well the project is coping with pending work, such as the ratio of new to closed tickets, or the backlog of still non-completed code reviews. Those parameters tell us, for example, whether or not the resources put into solving issues is enough. +到目前为止,关注点主要集中在活动数量和贡献者数量的统计上了。你也可以分析流程还有用户的表现如何。比如,你可以测量某流程需要多久才能执行完成。解决或者关闭投票的时间可以表明一个需要及时响应的项目对新信息的应对如何,比如修复一个已经提出的bug或者实现一个新需求。代码评审花费的时间,即从代码修改提交到被通过的时间,可以看出更新一个提出的改变要达到社区期望的标准需要多久。 + +其他的一些指标主要与项目处理挂起的工作如何有关,比如新的要被关闭投票的比例,或者仍然没有关闭的代码评审的后台日志。这些参数能告诉我们像投入到解决这些问题的资源是否充足这样的一些信息。 ![Efficiency metrics chart](https://opensource.com/sites/default/files/images/business-uploads/efficiency-metrics.png) -Ratio of tickets closed by tickets opened, and ratio of change proposals accepted or abandoned by new change proposals per quarter. OpenStack project, as shown in the [OpenStack Development Report, 2015-Q3][3] (PDF). +在[2015第三季度OpenStack开发报告][3]上显示的,每季度关闭与打开状态的投票数之比,接受与放弃的改变提案与最新的改变提案之比。 -### 4. Demographics ### +### 4. 社区人口统计 ### -Communities change as contributors move in and out. Depending on how people enter and leave a community over time, the age (time since members joined the community) of the community varies. The [community aging chart][4] nicely illustrates these exchanges over time. The chart is structured as a set of horizontal bars, two per "generation" of people joining the community. For each generation, the attracted bar shows how many new people joined the community during the corresponding period of time. The retained bar shows how many people are still active in the community. +随着贡献者的参与或者退出,社区也在不断改变。社区的年龄(从社区成员加入时算起)取决于随着时间变化,人们怎么加入和退出社区。[社区年龄统计图表][4]能够很好的展现这些改变随时间的变化。 图标是由一系列的水平条组成,每条水平条代表加入到社区的两代人。对于每一代,Attracted栏显示在相应的时间里有多少人加入到了社区。Retained栏显示有多少人目前仍然活跃在社区。 -The relationship between the two bars for each generation is the retention rate: the fraction of people of that generation who are still in the project. The complete set of attracted bars show how attractive the project was in the past. And the complete set of the retention bars shows the current age structure of the community. +代表一代人的两个水平条的关系就是滞留比例:依然在这个项目中的那一代人的一部分。Attracted水平条的完整集合表示这个项目在过去有多么受欢迎。Retained水平条的完整集合则表示社区目前的年龄结构。 ![Demographics metrics chart](https://opensource.com/sites/default/files/images/business-uploads/demography-metrics.png) -Community aging chart for the Eclipse community, as shown in the [Eclipse Development Dashboard][5]. Generations are defined every six months. +[Eclipse开发看板][5]上显示的Eclipse社区的社区年龄表。每六个月为一代。 -### 5. Diversity ### +### 5. 社区多样性 ### -Diversity is an important factor in the resiliency of communities. In general, the more diverse communities are—in terms of people or organizations participating—the more resilient they are. For example, when a company decides to leave a FOSS community, the potential problems the departure may cause are much smaller if its employees were contributing 5% of the work rather than 85%. +多样性是一个社区保持弹性的很关键的因素。通常来说,一个社区越具有多样性(人或者组织参与的多元化),那么这个社区的弹性也就越大。比如,如果一个公司要决定离开一个免费开源社区,那么这个公司的员工贡献5%要远比85%所可能引起的潜在问题要小很多。 -The [Pony Factor][6], a term defined by [Daniel Gruno][7] for the minimum number of developers performing 50% of the commits. Based on the Pony Factor, the Elephant Factor is the minimum number of companies whose employees perform 50% of the commits. Both numbers provide an indication of how many people or companies the community depends on. +[小马因素][6],是[Daniel Gruno][7] 为“最少的开发者数贡献了50%的代码提交量”这一现象定义的术语。基于这一小马因素,大象因素则是指最少量的公司员工贡献了50%的代码提交量。这两个数据提供了一种指示,即这个社区依赖多少人或者公司。 ![Diversity metrics chart](https://opensource.com/sites/default/files/images/business-uploads/diversity-metrics.png) -Pony and Elephant Factor for several FOSS projects in the area of cloud computing, as presented in [The quantitative state of the open cloud 2015][8] (slides). +[2015开发云数量状态统计][8]显示的在云计算领域的几个免费开源社区项目的小马和大象因素。 -There are many other metrics to help measure a community. When determing which metrics to collect, think about the goals of your community, and which metrics will help you reach them. +还有许多其他的指标来衡量一个社区。在决定收集哪些指标时,想想你社区的目标,哪些指标能帮你了解这些社区。 -------------------------------------------------------------------------------- From c5d10610f51a82723c2a51b92da90c23ff4ffdb6 Mon Sep 17 00:00:00 2001 From: sonofelice Date: Sat, 26 Dec 2015 18:17:26 +0800 Subject: [PATCH 0045/1469] =?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 --- ... open source community metrics to track.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) rename {sources/talk/yearbook2015 => translated/tech}/20151208 Top 5 open source community metrics to track.md (70%) diff --git a/sources/talk/yearbook2015/20151208 Top 5 open source community metrics to track.md b/translated/tech/20151208 Top 5 open source community metrics to track.md similarity index 70% rename from sources/talk/yearbook2015/20151208 Top 5 open source community metrics to track.md rename to translated/tech/20151208 Top 5 open source community metrics to track.md index 73a48fb694..9d1c27f272 100644 --- a/sources/talk/yearbook2015/20151208 Top 5 open source community metrics to track.md +++ b/translated/tech/20151208 Top 5 open source community metrics to track.md @@ -2,15 +2,15 @@ ================================================================================ ![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/yearbook2015-osdc-lead-1.png) -如果你决定使用指标来追踪那些免费开源的软件社区。那么问题来了:我应该去追踪哪些指标呢? +如果你决定使用指标来追踪你的免费开源的软件社区。那么问题来了:我应该去追踪哪些指标呢? -要回答这个问题,你首先要知道你需要什么信息。比如,你可能想要知道一个项目社区的可持续性。这个社区对问题的应对速度怎么样。一个社区怎么吸引、维护或者流失贡献者。一旦你知道需要哪类信息,你就可以找出哪些社区活动可以提供你想要知道的内容。幸运的是,免费开源社区(FOSS)一些遵从开放式开发模型的项目在其软件开发仓库里留下了大量的公共数据,我们可以对这些数据进行分析,并从中收集到一些有用的数据。 +要回答这个问题,你必须知道你需要什么信息。比如,你可能想要知道一个项目社区的可持续性。一个社区对问题的应对速度有多快。一个社区怎么吸引、维护或者流失贡献者。一旦你知道需要哪类信息,你就可以找出哪些社区活动可以提供你想要知道的内容。幸运的是,免费开源软件社区(FOSS)一些遵从开放式开发模型的项目在其软件开发仓库里留下了大量的公共数据,我们可以对这些数据进行分析,并从中收集到一些有用的数据。 -在这篇文章中,我会介绍一些指标,从而为这些项目社区提供一个多方位的视角分析。 +在这篇文章中,我会介绍一些指标,从而为你的项目社区提供一个多方位的视角分析。 ### 1. 社区活动 ### -一个社区的总体活动和这个社区怎样随着时间演变,是度量一个社区好坏的非常有用的指标。社区活动是评价一个社区工作量的第一印象,也可以用来追踪不同种类的活动。比如,提交次数,给人的第一印象就是跟开发工作量挂钩。通过投票的数量我们可以大概知道提交了多少bug或者又提出了多少新特性。邮件列表的数量或者论坛帖子的数量可以让我们了解到有过多少次公开的讨论。 +一个社区的总体活动和这个社区怎样随着时间演变,是度量所有社区好坏的非常有用的指标。社区活动是评价一个社区工作量的第一印象,也可以用来追踪不同种类的活动。比如,提交次数,给人的第一印象就是跟开发工作量挂钩。通过开放的投票数我们可以大概知道提交了多少bug或者又提出了多少新特性。邮件列表的数量或者论坛帖子的数量可以让我们了解到有过多少次公开的讨论。 ![Activity metrics chart](https://opensource.com/sites/default/files/images/business-uploads/activity-metrics.png) @@ -32,7 +32,7 @@ 到目前为止,关注点主要集中在活动数量和贡献者数量的统计上了。你也可以分析流程还有用户的表现如何。比如,你可以测量某流程需要多久才能执行完成。解决或者关闭投票的时间可以表明一个需要及时响应的项目对新信息的应对如何,比如修复一个已经提出的bug或者实现一个新需求。代码评审花费的时间,即从代码修改提交到被通过的时间,可以看出更新一个提出的改变要达到社区期望的标准需要多久。 -其他的一些指标主要与项目处理挂起的工作如何有关,比如新的要被关闭投票的比例,或者仍然没有关闭的代码评审的后台日志。这些参数能告诉我们像投入到解决这些问题的资源是否充足这样的一些信息。 +其他的一些指标主要与项目处理挂起的工作表现如何有关,比如新的和被关闭投票的比例,或者仍然没有关闭的代码评审的后台日志。这些参数能告诉我们像投入到解决这些问题的资源是否充足这样的一些信息。 ![Efficiency metrics chart](https://opensource.com/sites/default/files/images/business-uploads/efficiency-metrics.png) @@ -40,25 +40,25 @@ ### 4. 社区人口统计 ### -随着贡献者的参与或者退出,社区也在不断改变。社区的年龄(从社区成员加入时算起)取决于随着时间变化,人们怎么加入和退出社区。[社区年龄统计图表][4]能够很好的展现这些改变随时间的变化。 图标是由一系列的水平条组成,每条水平条代表加入到社区的两代人。对于每一代,Attracted栏显示在相应的时间里有多少人加入到了社区。Retained栏显示有多少人目前仍然活跃在社区。 +随着贡献者的参与或者退出,社区也在不断改变。社区的年龄(从社区成员加入时算起)取决于随着时间变化,人们怎么加入和退出社区。[社区年龄统计图表][4]很直观的展现了这些改变随时间的变化。图标是由一系列的水平条组成,每两条水平条代表加入到社区的一代人。对于每一代,Attracted水平条表示在相应的时间里有多少人加入到了社区。Retained水平条表示有多少人目前仍然活跃在社区。 代表一代人的两个水平条的关系就是滞留比例:依然在这个项目中的那一代人的一部分。Attracted水平条的完整集合表示这个项目在过去有多么受欢迎。Retained水平条的完整集合则表示社区目前的年龄结构。 ![Demographics metrics chart](https://opensource.com/sites/default/files/images/business-uploads/demography-metrics.png) -[Eclipse开发看板][5]上显示的Eclipse社区的社区年龄表。每六个月为一代。 +[Eclipse开发看板][5]上显示的Eclipse社区的社区年龄表。每六个月定义一次。 ### 5. 社区多样性 ### -多样性是一个社区保持弹性的很关键的因素。通常来说,一个社区越具有多样性(人或者组织参与的多元化),那么这个社区的弹性也就越大。比如,如果一个公司要决定离开一个免费开源社区,那么这个公司的员工贡献5%要远比85%所可能引起的潜在问题要小很多。 +多样性是一个社区保持弹性的很关键的因素。通常来说,一个社区越具有多样性(人或者组织参与的多元化),那么这个社区的弹性也就越大。比如,如果一个公司要决定离开一个免费开源社区,那么这个公司的员工贡献5%要远比贡献85%所可能引起的潜在问题要小很多。 -[小马因素][6],是[Daniel Gruno][7] 为“最少的开发者数贡献了50%的代码提交量”这一现象定义的术语。基于这一小马因素,大象因素则是指最少量的公司员工贡献了50%的代码提交量。这两个数据提供了一种指示,即这个社区依赖多少人或者公司。 +[小马因素][6],是[Daniel Gruno][7] 为“最少的开发者贡献了50%的代码提交量”这一现象定义的术语。基于这一小马因素,大象因素则是指最少量的公司其员工贡献了50%的代码提交量。这两个数据提供了一种指示,即这个社区依赖多少人或者公司。 ![Diversity metrics chart](https://opensource.com/sites/default/files/images/business-uploads/diversity-metrics.png) [2015开发云数量状态统计][8]显示的在云计算领域的几个免费开源社区项目的小马和大象因素。 -还有许多其他的指标来衡量一个社区。在决定收集哪些指标时,想想你社区的目标,哪些指标能帮你了解这些社区。 +还有许多其他的指标来衡量一个社区。在决定收集哪些指标时,可以考虑一下社区的目标,还有哪些指标能帮到你。 -------------------------------------------------------------------------------- From 4c1368398ca316b5c79da540d608484238149eb8 Mon Sep 17 00:00:00 2001 From: sonofelice Date: Sat, 26 Dec 2015 20:04:53 +0800 Subject: [PATCH 0046/1469] edit translator --- .../20151208 Top 5 open source community metrics to track.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20151208 Top 5 open source community metrics to track.md b/translated/tech/20151208 Top 5 open source community metrics to track.md index 9d1c27f272..ac0e26b645 100644 --- a/translated/tech/20151208 Top 5 open source community metrics to track.md +++ b/translated/tech/20151208 Top 5 open source community metrics to track.md @@ -65,7 +65,7 @@ via: https://opensource.com/business/15/12/top-5-open-source-community-metrics-track 作者:[Jesus M. Gonzalez-Barahona][a] -译者:[译者ID](https://github.com/译者ID) +译者:[sonofelice](https://github.com/sonofelice) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2efea2e2bd1e46c9f5a70b9416faa558b083ef3a Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 26 Dec 2015 21:39:40 +0800 Subject: [PATCH 0047/1469] =?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 @taichirain --- .../20151123 How to Configure Apache Solr on Ubuntu 14 or 15.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20151123 How to Configure Apache Solr on Ubuntu 14 or 15.md (100%) diff --git a/sources/tech/20151123 How to Configure Apache Solr on Ubuntu 14 or 15.md b/translated/tech/20151123 How to Configure Apache Solr on Ubuntu 14 or 15.md similarity index 100% rename from sources/tech/20151123 How to Configure Apache Solr on Ubuntu 14 or 15.md rename to translated/tech/20151123 How to Configure Apache Solr on Ubuntu 14 or 15.md From 1f38b30f09c5b46b925c30bbd1a2acaf60d9e2a2 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 26 Dec 2015 23:59:45 +0800 Subject: [PATCH 0048/1469] Update 20151114 How to Setup Drone - a Continuous Integration Service in Linux.md --- ...Continuous Integration Service in Linux.md | 62 +++++++++++++++---- 1 file changed, 50 insertions(+), 12 deletions(-) diff --git a/sources/tech/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md b/sources/tech/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md index 8f63bdd5fc..a18bc28cb9 100644 --- a/sources/tech/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md +++ b/sources/tech/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md @@ -5,23 +5,33 @@ How to Setup Drone - a Continuous Integration Service in Linux Are you tired of cloning, building, testing, and deploying codes time and again? If yes, switch to continuous integration. Continuous Integration aka CI is practice in software engineering of making frequent commits to the code base, building, testing and deploying as we go. CI helps to quickly integrate new codes into the existing code base. If this process is made automated, then this will speed up the development process as it reduces the time taken for the developer to build and test things manually. [Drone][1] is a free and open source project which provides an awesome environment of continuous integration service and is released under Apache License Version 2.0. It integrates with many repository providers like Github, Bitbucket and Google Code and has the ability to pull codes from the repositories enabling us to build the source code written in number of languages including PHP, Node, Ruby, Go, Dart, Python, C/C++, JAVA and more. It is made such a powerful platform cause it uses containers and docker technology for every build making users a complete control over their build environment with guaranteed isolation. -### 1. Installing Docker ### +如果你对一次又一次的克隆、构建、测试和部署代码感到厌倦了,可以考虑一下持续集成。持续集成也就是CI,是软件工程的像我们一样的频繁提交的代码库,构建、测试和部署的实践。CI 帮助我们快速的集成新代码到已有的代码基线。如果这个过程是自动化进行的,那么就会提高开发的速度,因为这可以减少开发人员手工构建和测试的时间。[Drone][1] 是一个免费的开源项目,用来提供一个非常棒的持续集成服务的环境,采用了Apache 2.0 协议。它已经集成近很多代码库提供商,比如Github、Bitbucket 以及Google COde,并且它可以从代码库提取代码,使我们可以编译多种语言,包括PHP, Node, Ruby, Go, Dart, Python, C/C++, JAVA 等等。它是如此一个强大的平台是因为它每次构建都使用了容器和docker 技术,这让用户可以在保证隔离的条件下完全控制他们自己的构建环境。 + +### 1. 安装 Docker ### First of all, we'll gonna install Docker as its the most vital element for the complete workflow of Drone. Drone does a proper utilization of docker for the purpose of building and testing application. This container technology speeds up the development of the applications. To install docker, we'll need to run the following commands with respective the distribution of linux. In this tutorial, we'll cover the steps with Ubuntu 14.04 and CentOS 7 linux distributions. -#### On Ubuntu #### +首先,我们要安装docker,因为这是Drone 的工作流的最关键的元素。Drone 合理的利用了docker 来构建和测试应用。容器技术提高了应用部署的效率。要安装docker ,我们需要在不同的linux 发行版本运行下面对应的命令,我们这里会说明Ubuntu 14.04 和CentOS 7 两个版本。 + +#### Ubuntu #### To install Docker in Ubuntu, we can simply run the following commands in a terminal or console. +要在Ubuntu 上安装Docker ,我们只需要运行下面的命令。 + # apt-get update # apt-get install docker.io After the installation is done, we'll restart our docker engine using service command. +安装之后我们需要使用`service` 命令重启docker 引擎。 + # service docker restart Then, we'll make docker start automatically in every system boot. +然后我们让docker 在系统启动时自动启动。 + # update-rc.d docker defaults Adding system startup for /etc/init.d/docker ... @@ -33,50 +43,68 @@ Then, we'll make docker start automatically in every system boot. /etc/rc4.d/S20docker -> ../init.d/docker /etc/rc5.d/S20docker -> ../init.d/docker -#### On CentOS #### +#### CentOS #### First, we'll gonna update every packages installed in our centos machine. We can do that by running the following command. +第一,我们要更新机器上已经安装的软件包。我们可以使用下面的命令。 + # sudo yum update To install docker in centos, we can simply run the following commands. +要在centos 上安装docker,我们可以简单的运行下面的命令。 + # curl -sSL https://get.docker.com/ | sh After our docker engine is installed in our centos machine, we'll simply start it by running the following systemd command as systemd is the default init system in centos 7. +安装好docker 引擎之后我么只需要简单实用下面的`systemd` 命令启动docker,因为centos 7 的默认init 系统是systemd。 + # systemctl start docker Then, we'll enable docker to start automatically in every system startup. +然后我们要让docker 在系统启动时自动启动。 + # systemctl enable docker ln -s '/usr/lib/systemd/system/docker.service' '/etc/systemd/system/multi-user.target.wants/docker.service' -### 2. Installing SQlite Driver ### +### 2. 安装 SQlite 驱动 ### It uses SQlite3 database server for storing its data and information by default. It will automatically create a database file named drone.sqlite under /var/lib/drone/ which will handle database schema setup and migration. To setup SQlite3 drivers, we'll need to follow the below steps. -#### On Ubuntu 14.04 #### +Drone 默认使用SQLite3 数据库服务器来保存数据和信息。它会在/var/lib/drone/ 自动创建名为drone.sqlite 的数据库来处理数据库模式的创建和迁移。要安装SQLite3 我们要完成以下几步。 + +#### Ubuntu 14.04 #### As SQlite3 is available on the default respository of Ubuntu 14.04, we'll simply install it by running the following apt command. +因为SQLite3 存在于Ubuntu 14.04 的默认软件库,我们只需要简单的使用apt 命令安装它。 + # apt-get install libsqlite3-dev -#### On CentOS 7 #### +#### CentOS 7 #### To install it on CentOS 7 machine, we'll need to run the following yum command. +要在Centos 7 上安装选哟使用下面的yum 命令。 + # yum install sqlite-devel -### 3. Installing Drone ### +### 3. 安装 Drone ### Finally, after we have installed those dependencies successfully, we'll now go further towards the installation of drone in our machine. In this step, we'll simply download the binary package of it from the official download link of the respective binary formats and then install them using the default package manager. -#### On Ubuntu #### +最后,我们安装好依赖的软件,我们现在更进一步的接近安装Drone。在这一步里我们值简单的从官方链接下载对应的二进制软件包,然后使用默认软件包管理器安装Drone。 + +#### Ubuntu #### We'll use wget to download the debian package of drone for ubuntu from the [official Debian file download link][2]. Here is the command to download the required debian package of drone. +我们将使用wget 从官方的[Debian 文件下载链接][2]下载drone 的debian 软件包。下面就是下载命令。 + # wget downloads.drone.io/master/drone.deb Resolving downloads.drone.io (downloads.drone.io)... 54.231.48.98 @@ -89,6 +117,8 @@ We'll use wget to download the debian package of drone for ubuntu from the [offi After its downloaded, we'll gonna install it with dpkg package manager. +下载好之后,我们将使用dpkg 软件包管理器安装它。 + # dpkg -i drone.deb Selecting previously unselected package drone. @@ -99,10 +129,12 @@ After its downloaded, we'll gonna install it with dpkg package manager. Your system ubuntu 14: using upstart to control Drone drone start/running, process 9512 -#### On CentOS #### +#### CentOS #### In the machine running CentOS, we'll download the RPM package from the [official download link for RPM][3] using wget command as shown below. +在CentOS 机器上我们要使用wget 命令从[下载链接][3]下载RPM 包。 + # wget downloads.drone.io/master/drone.rpm --2015-11-06 11:06:45-- http://downloads.drone.io/master/drone.rpm @@ -116,19 +148,25 @@ In the machine running CentOS, we'll download the RPM package from the [official Then, we'll install the download rpm package using yum package manager. +然后我们使用yum 安装rpm 包。 + # yum localinstall drone.rpm -### 4. Configuring Port ### +### 4. 配置端口 ### After the installation is completed, we'll gonna configure drone to make it workable. The configuration of drone is inside **/etc/drone/drone.toml** file. By default, drone web interface is exposed under port 80 which is the default port of http, if we wanna change it, we can change it by replacing the value under server block as shown below. +安装完成之后,我们要使它工作要先进行配置。drone 的配置文件在**/etc/drone/drone.toml** 。默认情况下drone 的web 接口使用的是80,而这也是http 默认的端口,如果我们要下面所示的修改配置文件里server 块对应的值。 + [server] port=":80" -### 5. Integrating Github ### +### 5. 集成 Github ### In order to run Drone we must setup at least one integration points between GitHub, GitHub Enterprise, Gitlab, Gogs, Bitbucket. In this tutorial, we'll only integrate github but if we wanna integrate other we can do that from the configuration file. In order to integrate github, we'll need to create a new application in our [github settings][4]. + + ![Registering App Github](http://blog.linoxide.com/wp-content/uploads/2015/11/registering-app-github.png) To create, we'll need to click on Register a New Application then fill out the form as shown in the following image. @@ -307,7 +345,7 @@ In this article, we learned to completely setup a workable Continuous Intergrati via: http://linoxide.com/linux-how-to/setup-drone-continuous-integration-linux/ 作者:[Arun Pyasi][a] -译者:[译者ID](https://github.com/译者ID) +译者:[ezio](https://github.com/oska874) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 3aa612f8fc509c34511186557f17c792c2c9edbc Mon Sep 17 00:00:00 2001 From: carolinewuyan <309866211@qq.com> Date: Sun, 27 Dec 2015 00:16:41 +0800 Subject: [PATCH 0049/1469] =?UTF-8?q?=E5=B7=B2=E6=A0=A1=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0 eSpeak--Text To Speech Tool For Linux.md | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/translated/share/20151130 eSpeak--Text To Speech Tool For Linux.md b/translated/share/20151130 eSpeak--Text To Speech Tool For Linux.md index 271866ff47..f4ec1f20e1 100644 --- a/translated/share/20151130 eSpeak--Text To Speech Tool For Linux.md +++ b/translated/share/20151130 eSpeak--Text To Speech Tool For Linux.md @@ -1,24 +1,24 @@ -eSpeak: Linux文本转语音工具 +eSpeak: Linux 文本转语音工具 ================================================================================ ![Text to speech tool in Linux](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/11/Text-to-speech-Linux.jpg) -[eSpeak][1]是Linux的命令行工具,能把文本转变成语音。这是一款用C语言写就的精致的语音合成器,提供英语和其它多种语言支持。 +[eSpeak][1]是一款 Linux 命令行工具,能把文本转换成语音。它是一款简洁的语音合成器,用C语言编写而成,它支持英语和其它多种语言。 -eSpeak从标准输入或者输入文件中读取文本。虽然语音输出与真人声音相去甚远,但是,在你项目有用得到的地方,eSpeak仍不失为一个精致快捷的工具。 +eSpeak 从标准输入或者输入文件中读取文本。虽然语音输出与真人声音相去甚远,但是,在你项目需要的时候,eSpeak 仍不失为一个简便快捷的工具。 -eSpeak部分主要特性如下: +eSpeak 部分主要特性如下: -- 为Linux和Windows准备的命令行工具 +- 提供给 Linux 和 Windows 的命令行工具 - 从文件或者标准输入中把文本读出来 - 提供给其它程序使用的共享库版本 -- 为Windows提供SAPI5版本,在screen-readers或者其它支持Windows SAPI5接口程序的支持下,eSpeak仍然能正常使用 +- 为 Windows 提供SAPI5版本,在screen-readers或者其它支持Windows SAPI5接口程序的支持下,eSpeak仍然能正常使用 - 可移植到其它平台,包括安卓,OSX等 -- 多种特色声音提供选择 +- 提供多种声音特性选择 - 语音输出可保存为[.WAV][2]格式的文件 -- 部分SSML([Speech Synthesis Markup Language][3])能为HTML所支持 -- 体积小巧,整个程序包括语言支持等占用不足2MB -- 可以实现文本到音素编码的转化,能被其它语音合成引擎吸纳为前端工具 -- 可作为生成和调制音素数据的开发工具 +- 部分SSML([Speech Synthesis Markup Language][3]语音合成标记语言)能为HTML所支持 +- 体积小巧,整个程序连同语言支持等占用小于2MB +- 可以实现文本到音素编码的转化,因此能适应成为其它语音合成引擎的前端工具 +- 开发工具可用于生产和调整音素数据 ### 安装eSpeak ### @@ -26,35 +26,35 @@ eSpeak部分主要特性如下: sudo apt-get install espeak -eSpeak is an old tool and I presume that it should be available in the repositories of other Linux distributions such as Arch Linux, Fedora etc. You can install eSpeak easily using dnf, pacman etc.eSpeak是一个古老的工具,我推测它应该能在其它众多Linux发行版如Arch,Fedora中运行。使用dnf,pacman等命令就能轻易安装。 +eSpeak 是一个古老的工具,我推测它应该能在其它众多 Linux 发行版中运行,比如 Arch,Fedora。使用 dnf,pacman 等命令就能轻松安装。 -eSpeak用法如下:输入espeak按enter键运行程序。输入字符按enter转换为语音输出(译补)。使用Ctrl+C来关闭运行中的程序。 +eSpeak 用法如下:输入 espeak 按 enter 键运行程序。输入字符按 enter 转换为语音输出(译补)。使用 Ctrl+C 来关闭运行中的程序。 ![eSpeak command line](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/11/eSpeak-example.png) -还有其它可以的选项,可以通过程序帮助进行查看。 +还有一些其他的选项可用,可以通过程序帮助进行查看。 ### GUI版本:Gespeaker ### -如果你更倾向于使用GUI版本,可以安装Gespeaker,它为eSpeak提供了GTK界面。 +如果你更倾向于使用 GUI 版本,可以安装 Gespeaker,它为 eSpeak 提供了 GTK 界面。 使用以下命令来安装Gespeaker: sudo apt-get install gespeaker -操作接口简明易用,你完全可以自行探索。 +操作界面简明易用,你完全可以自行探索。 ![eSpeak GUI tool for text to speech in Ubuntu](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/11/eSpeak-GUI.png) -虽然这个工具不能为大部分计算所用,但是当你的项目需要把文本转换成语音,espeak还是挺方便使用的。需则用之吧~ +虽然这些工具不能为大部分计算所用,但是当你的项目需要把文本转换成语音时,使用 espeak 还是挺方便的。是否使用 espeak 这款语音合成器,选择权就交给你们啦。 -------------------------------------------------------------------------------- via: http://itsfoss.com/espeak-text-speech-linux/ 作者:[Abhishek][a] -译者:[译者ID](https://github.com/soooogreen) -校对:[校对者ID](https://github.com/校对者ID) +译者:[soooogreen](https://github.com/soooogreen) +校对:[Caroline](https://github.com/carolinewuyan) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From f612d31bd8343d8a1e8a53bfe80994f58aadc773 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 27 Dec 2015 00:33:48 +0800 Subject: [PATCH 0050/1469] Update 20151114 How to Setup Drone - a Continuous Integration Service in Linux.md --- ...Continuous Integration Service in Linux.md | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/sources/tech/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md b/sources/tech/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md index a18bc28cb9..f5f84006f8 100644 --- a/sources/tech/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md +++ b/sources/tech/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md @@ -165,24 +165,32 @@ After the installation is completed, we'll gonna configure drone to make it work In order to run Drone we must setup at least one integration points between GitHub, GitHub Enterprise, Gitlab, Gogs, Bitbucket. In this tutorial, we'll only integrate github but if we wanna integrate other we can do that from the configuration file. In order to integrate github, we'll need to create a new application in our [github settings][4]. - +为了运行Drone 我们必须设置最少一个和GitHub、GitHub 企业版,Gitlab,Gogs,Bitbucket 关联的集成点。在本文里我们只集成了github,但是如果哦我们要集成其他的我们可以在配置文件做修改。为了集成github 我们需要在[github setting] 创建一个新的应用。 ![Registering App Github](http://blog.linoxide.com/wp-content/uploads/2015/11/registering-app-github.png) To create, we'll need to click on Register a New Application then fill out the form as shown in the following image. +要创建一个应用,我们需要在`New Application` 页面点击`Register`,然后如下所示填表。 + ![Registering OAuth app github](http://blog.linoxide.com/wp-content/uploads/2015/11/registering-OAuth-app-github.png) We should make sure that **Authorization callback URL** looks like http://drone.linoxide.com/api/auth/github.com under the configuration of the application. Then, we'll click on Register application. After done, we'll note the Client ID and Client Secret key as we'll need to configure it in our drone configuration. +我们应该保证在应用的配置项里设置了**授权了的回调链接**,链接看起来像`http://drone.linoxide.com/api/auth/github.com`。然后我们点击注册应用。所有都做好之后我们会看到我们需要在我们的Drone 配置文件里配置的客户端ID 和客户端密钥。 + ![Client ID and Secret Token](http://blog.linoxide.com/wp-content/uploads/2015/11/client-id-secret-token.png) After thats done, we'll need to edit our drone configuration using a text editor by running the following command. +在这些都完成之后我们需要使用文本编辑器编辑drone 配置文件,比如使用下面的命令。 + # nano /etc/drone/drone.toml Then, we'll find the [github] section and append the section with the above noted configuration as shown below. +然后我们会在drone 的配置文件里面找到[github] 部分,紧接着的是下面所示的配置内容 + [github] client="3dd44b969709c518603c" secret="4ee261abdb431bdc5e96b19cc3c498403853632a" @@ -191,24 +199,32 @@ Then, we'll find the [github] section and append the section with the above note ![Configuring Github Drone](http://blog.linoxide.com/wp-content/uploads/2015/11/configuring-github-drone-e1446835124465.png) -### 6. Configuring SMTP server ### +### 6. 配置 SMTP 服务器 ### If we wanna enable drone to send notifications via emails, then we'll need to specify the SMTP configuration of our SMTP server. If we already have an SMTP server, we can use its configuration but as we don't have an SMTP server, we'll need to install an MTA ie Postfix and then specify the SMTP configuration in the drone configuration. -#### On Ubuntu #### +如果我们想让drone 使用email 发送通知,那么我们需要在SMTP 配置里面设置我们的SMTP 服务器。如果我们已经有了一个SMTP 服务,那就只需要简单的使用它的配置文件就行了,但是因为我们没有一个SMTP 服务器,我们需要安装一个MTA 比如Postfix,然后在drone 配置文件里配置好SMTP。 + +#### Ubuntu #### We can install postfix in ubuntu by running the following apt command. +在ubuntu 里使用下面的apt 命令安装postfix。 + # apt-get install postfix -#### On CentOS #### +#### CentOS #### We can install postfix in CentOS by running the following yum command. +在CentOS 里使用下面的yum 命令安装postfix。 + # yum install postfix After installing, we'll need to edit the configuration of our postfix configuration using a text editor. +安装好之后,我们需要编辑我们的postfix 配置文件。 + # nano /etc/postfix/main.cf Then, we'll need to replace the value of myhostname parameter to our FQDN ie drone.linoxide.com . @@ -345,7 +361,7 @@ In this article, we learned to completely setup a workable Continuous Intergrati via: http://linoxide.com/linux-how-to/setup-drone-continuous-integration-linux/ 作者:[Arun Pyasi][a] -译者:[ezio](https://github.com/oska874) +译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 7bcde5f35f2cee532828394c7fb468853f50a5ae Mon Sep 17 00:00:00 2001 From: carolinewuyan <309866211@qq.com> Date: Sun, 27 Dec 2015 01:28:50 +0800 Subject: [PATCH 0051/1469] =?UTF-8?q?=E5=B7=B2=E6=A0=A1=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...3 7 ways hackers can use Wi-Fi against you.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/translated/share/20151123 7 ways hackers can use Wi-Fi against you.md b/translated/share/20151123 7 ways hackers can use Wi-Fi against you.md index 623886b896..cc3447e72a 100644 --- a/translated/share/20151123 7 ways hackers can use Wi-Fi against you.md +++ b/translated/share/20151123 7 ways hackers can use Wi-Fi against you.md @@ -10,19 +10,19 @@ Wi-Fi — 既然方便又危险的东西!这里给大家介绍一下通过Wi-F ### 利用免费热点 ### -它们似乎无处不在,而且它们的数量会在[下一个四年里增加四倍][1]。但是它们当中很多都是不值得信任的,从你的登录凭证、email甚至更加敏感的账户,都能被黑客用一款名叫“sniffers”的软件截获 — 这款软件能截获到任何你通过该连接提交的信息。防止被黑客盯上的最好办法就是使用VPN(virtual private network),它能保护你的数据隐私它会加密你所输入的信息。 +它们似乎无处不在,而且它们的数量会在[接下来四年里增加三倍][1]。但是它们当中很多都是不值得信任的,从你的登录凭证、email甚至更加敏感的账户,都能被黑客用一款名叫“sniffers”的软件截获 — 这款软件能截获到任何你通过该连接提交的信息。防止被黑客盯上的最好办法就是使用VPN(virtual private network),它加密了你所输入的信息,因此能够保护你的数据隐私。 ![Image courtesy Thinkstock](http://core0.staticworld.net/images/article/2015/11/2_online-banking-100626675-orig.jpg) ### 网上银行 ### -你可能认为没有人需要自己被提醒不要使用免费Wi-Fi来操作网上银行, 但网络安全厂商卡巴斯基实验室表示[全球超过100家银行因为网络黑客而损失9亿美元][2],由此可见还是有很多人因此受害。如果你真的想要在一家咖吧里使用免费真实的Wi-Fi,那么你应该向服务员确认网络名称。[在店里用路由器设置一个开放的无线连接][3]并将它的网络名称设置成店名是一件相当简单的事。 +你可能认为没有人需要被提醒不要使用免费Wi-Fi来操作网上银行, 但网络安全厂商卡巴斯基实验室表示[全球超过100家银行因为网络黑客而损失9亿美元][2],由此可见还是有很多人因此受害。如果你确信一家咖啡店的免费Wi-Fi是正规的,想要连接它,那么你应该向服务员确认网络名称。[他人在店里用路由器设置一个开放的无线连接][3]并将它的网络名称设置成店名是一件相当简单的事。 ![Image courtesy Thinkstock](http://core0.staticworld.net/images/article/2015/11/3_keeping-wifi-on-100626676-orig.jpg) ### 始终开着Wi-Fi开关 ### -如果你手机的Wi-Fi开关一直开着的,你会自动被连接到一个不安全的网络中去,你甚至都没有意识到。你可以利用你手机的[基于位置的Wi-Fi功能][4],如果它是可用的,那它会在你离开你所保存的网络范围后自动关闭你的Wi-Fi开关并在你回去之后再次开启。 +如果你手机的Wi-Fi开关一直开着的,你会自动被连接到一个不安全的网络中去,你甚至都没有意识到。你可以利用你手机中[基于位置的Wi-Fi功能][4],如果它是可用的,那它会在你离开你所保存的网络范围后自动关闭你的Wi-Fi开关并在你回去之后再次开启。 ![Image courtesy Thinkstock](http://core0.staticworld.net/images/article/2015/11/4_not-using-firewall-100626677-orig.jpg) @@ -34,21 +34,21 @@ Wi-Fi — 既然方便又危险的东西!这里给大家介绍一下通过Wi-F ### 浏览非加密网页 ### -说起来很难过,[世界上排名前100万个网站中55%是不加密的][5],一个未加密的网站则会让传输的数据暴露在黑客的眼下。如果一个网页是安全的,你的浏览器则会有标明(比如说火狐浏览器是一把绿色的挂锁、Chrome蓝旗则是个绿色的图标)。但是一个安全的网站不能让你免于被劫持的风险,它能通过公共网络从你访问过的网站上窃取cookies,无论是不是正当网站与否。 +说起来很难过,[世界上排名前100万个网站中55%是不加密的][5],一个未加密的网站会让一切传输数据暴露在黑客的眼中。如果一个网页是安全的,你的浏览器则会有标明(比如说火狐浏览器是一把灰色的挂锁,Chrome浏览器则是个绿锁图标)。但是一个安全的网站不能让你免于被劫持的风险,它能通过公共网络从你访问过的网站上窃取cookies,无论是不是正规网站。 ![Image courtesy Thinkstock](http://core0.staticworld.net/images/article/2015/11/6_updating-security-software-100626679-orig.jpg) ### 不更新你的安全防护软件 ### -如果你想要确保你自己的网络是受保护的,就更新的路由器固件。你要做的就是进入你的路由器管理页面去检查,通常你能在厂商的官方网页上下载到最新的固件版本。 +如果你想要确保你自己的网络是受保护的,就更新路由器固件。你要做的就是进入你的路由器管理页面去检查,通常你能在厂商的官方网页上下载到最新的固件版本。 ![Image courtesy Thinkstock](http://core0.staticworld.net/images/article/2015/11/7_securing-home-wifi-100626680-orig.jpg) ### 不保护你的家用Wi-Fi ### -不用说,设置一个复杂的密码和更改无线连接的默认名都是非常重要的。你还可以过滤你的MAC地址来让你的路由器只承认那些确认过的设备。 +不用说,设置一个复杂的密码和更改无线连接的默认名都是非常重要的。你还可以过滤你的MAC地址来让你的路由器只识别那些确认过的设备。 -**Josh Althuser**是一个开源支持者、网络架构师和科技企业家。在过去12年里,他花了很多时间去倡导使用开源软件来管理团队和项目,同时为网络应用程序提供企业级咨询并帮助它们走向市场。你可以联系[他的推特][6]. +**Josh Althuser**是一个开源支持者、网络架构师和科技企业家。在过去12年里,他花了很多时间去倡导使用开源软件来管理团队和项目,同时为网络应用程序提供企业级咨询并帮助它们把产品推向市场。你可以通过[他的推特][6]联系他。 -------------------------------------------------------------------------------- @@ -56,7 +56,7 @@ via: http://www.networkworld.com/article/3003170/mobile-security/7-ways-hackers- 作者:[Josh Althuser][a] 译者:[ZTinoZ](https://github.com/ZTinoZ) -校对:[校对者ID](https://github.com/校对者ID) +校对:[Caroline](https://github.com/carolinewuyan) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 6fb06594c952173a4e2cdc85cc761a9ea1c9f949 Mon Sep 17 00:00:00 2001 From: carolinewuyan <309866211@qq.com> Date: Sun, 27 Dec 2015 01:31:25 +0800 Subject: [PATCH 0052/1469] =?UTF-8?q?=E5=B7=B2=E6=A0=A1=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../share/20151123 7 ways hackers can use Wi-Fi against you.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/share/20151123 7 ways hackers can use Wi-Fi against you.md b/translated/share/20151123 7 ways hackers can use Wi-Fi against you.md index cc3447e72a..ecb53bee2c 100644 --- a/translated/share/20151123 7 ways hackers can use Wi-Fi against you.md +++ b/translated/share/20151123 7 ways hackers can use Wi-Fi against you.md @@ -48,7 +48,7 @@ Wi-Fi — 既然方便又危险的东西!这里给大家介绍一下通过Wi-F 不用说,设置一个复杂的密码和更改无线连接的默认名都是非常重要的。你还可以过滤你的MAC地址来让你的路由器只识别那些确认过的设备。 -**Josh Althuser**是一个开源支持者、网络架构师和科技企业家。在过去12年里,他花了很多时间去倡导使用开源软件来管理团队和项目,同时为网络应用程序提供企业级咨询并帮助它们把产品推向市场。你可以通过[他的推特][6]联系他。 +* **Josh Althuser**是一个开源支持者、网络架构师和科技企业家。在过去12年里,他花了很多时间去倡导使用开源软件来管理团队和项目,同时为网络应用程序提供企业级咨询并帮助它们把产品推向市场。你可以通过[他的推特][6]联系他。* -------------------------------------------------------------------------------- From 2c5853e18db0912742753d3461ecaba7cb353200 Mon Sep 17 00:00:00 2001 From: carolinewuyan <309866211@qq.com> Date: Sun, 27 Dec 2015 01:32:04 +0800 Subject: [PATCH 0053/1469] =?UTF-8?q?=E5=B7=B2=E6=A0=A1=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../share/20151123 7 ways hackers can use Wi-Fi against you.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/share/20151123 7 ways hackers can use Wi-Fi against you.md b/translated/share/20151123 7 ways hackers can use Wi-Fi against you.md index ecb53bee2c..cc3447e72a 100644 --- a/translated/share/20151123 7 ways hackers can use Wi-Fi against you.md +++ b/translated/share/20151123 7 ways hackers can use Wi-Fi against you.md @@ -48,7 +48,7 @@ Wi-Fi — 既然方便又危险的东西!这里给大家介绍一下通过Wi-F 不用说,设置一个复杂的密码和更改无线连接的默认名都是非常重要的。你还可以过滤你的MAC地址来让你的路由器只识别那些确认过的设备。 -* **Josh Althuser**是一个开源支持者、网络架构师和科技企业家。在过去12年里,他花了很多时间去倡导使用开源软件来管理团队和项目,同时为网络应用程序提供企业级咨询并帮助它们把产品推向市场。你可以通过[他的推特][6]联系他。* +**Josh Althuser**是一个开源支持者、网络架构师和科技企业家。在过去12年里,他花了很多时间去倡导使用开源软件来管理团队和项目,同时为网络应用程序提供企业级咨询并帮助它们把产品推向市场。你可以通过[他的推特][6]联系他。 -------------------------------------------------------------------------------- From c6f38534c2fd2023a90a06f7b21c6cd68c6c1558 Mon Sep 17 00:00:00 2001 From: carolinewuyan <309866211@qq.com> Date: Sun, 27 Dec 2015 01:56:38 +0800 Subject: [PATCH 0054/1469] =?UTF-8?q?=E5=B7=B2=E6=A0=A1=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...all Android Studio on Ubuntu 15.04 or CentOS 7.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/translated/tech/20151123 How to install Android Studio on Ubuntu 15.04 or CentOS 7.md b/translated/tech/20151123 How to install Android Studio on Ubuntu 15.04 or CentOS 7.md index 11d2e9b5b4..00bde27e78 100644 --- a/translated/tech/20151123 How to install Android Studio on Ubuntu 15.04 or CentOS 7.md +++ b/translated/tech/20151123 How to install Android Studio on Ubuntu 15.04 or CentOS 7.md @@ -1,12 +1,12 @@ 如何在 Ubuntu 15.04 / CentOS 7 上安装 Android Studio ================================================================================ -随着最近几年智能手机的进步,安卓成为了最大的手机平台之一,也有很多免费的用于开发安卓应用的工具。Android Studio 是基于 [IntelliJ IDEA][1] 用于开发安卓应用的集成开发环境。它是 Google 2014 年发布的免费开源软件,继 Eclipse 之后成为主要的 IDE。 +随着最近几年智能手机的进步,安卓成为了最大的手机平台之一,所有用于开发安卓应用的工具都是免费提供。Android Studio 是基于 [IntelliJ IDEA][1] 用于开发安卓应用的集成开发环境(IDE)。它是 Google 2014 年发布的免费开源软件,继 Eclipse 之后成为主要的 IDE。 在这篇文章,我们一起来学习如何在 Ubuntu 15.04 和 CentOS 7 上安装 Android Studio。 ### 在 Ubuntu 15.04 上安装 ### -我们可以用两种方式安装 Android Studio。第一种是配置必须的库然后再安装它;另一种是从 Android 官方网站下载然后再本地编译安装。在下面的例子中,我们会使用命令行设置库并安装它。在继续下一步之前,我们需要确保我们已经安装了 JDK 1.6 或者更新版本。 +我们可以用两种方式安装 Android Studio。第一种是配置必须的库然后再安装它;另一种是从 Android 官方网站下载然后在本地编译安装。在下面的例子中,我们会使用命令行设置库并安装它。在继续下一步之前,我们需要确保我们已经安装了 JDK 1.6 或者更新版本。 这里,我打算安装 JDK 1.8。 @@ -32,7 +32,7 @@ 上面的安装命令会在 /opt 目录下面安装 Android Studio。 -现在,运行下面的命令启动安装窗口: +现在,运行下面的命令启动安装向导: $ /opt/android-studio/bin/studio.sh @@ -121,7 +121,7 @@ ### 总结 ### -虽然发布不到一年,但是 Android Studio 已经替代 Eclipse 成为了安装开发最主要的 IDE。它是唯一一个能支持之后 Google 提供的 Android SDKs 和其它 Android 特性的官方 IDE 工具。那么,你还在等什么呢?赶快安装 Android Studio 然后体验开发安装应用的乐趣吧。 +虽然发布不到一年,但是 Android Studio 已经替代 Eclipse 成为了Android开发最主要的 IDE。它是唯一能支持 Google 之后将要提供的 Android SDKs 和其它 Android 特性的官方 IDE 工具。那么,你还在等什么呢?赶快安装 Android Studio 来体验开发 Android 应用的乐趣吧。 -------------------------------------------------------------------------------- @@ -129,11 +129,11 @@ via: http://linoxide.com/tools/install-android-studio-ubuntu-15-04-centos-7/ 作者:[B N Poornima][a] 译者:[ictlyh](http://mutouxiaogui.cn/blog/) -校对:[校对者ID](https://github.com/校对者ID) +校对:[Caroline](https://github.com/carolinewuyan) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://linoxide.com/author/bnpoornima/ [1]:https://www.jetbrains.com/idea/ [2]:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html -[3]:http://developer.android.com/sdk/index.html \ No newline at end of file +[3]:http://developer.android.com/sdk/index.html From abb2af67a965ea777ed77ca7b14a0ad4471f0558 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 27 Dec 2015 11:30:01 +0800 Subject: [PATCH 0055/1469] Update 20151114 How to Setup Drone - a Continuous Integration Service in Linux.md --- ...Continuous Integration Service in Linux.md | 69 ++++++++++++++++--- 1 file changed, 59 insertions(+), 10 deletions(-) diff --git a/sources/tech/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md b/sources/tech/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md index f5f84006f8..275f92dc1b 100644 --- a/sources/tech/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md +++ b/sources/tech/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md @@ -1,6 +1,7 @@ translating by Ezio How to Setup Drone - a Continuous Integration Service in Linux +如何在linux 上配置持续集成服务 - Drone ============================================================== Are you tired of cloning, building, testing, and deploying codes time and again? If yes, switch to continuous integration. Continuous Integration aka CI is practice in software engineering of making frequent commits to the code base, building, testing and deploying as we go. CI helps to quickly integrate new codes into the existing code base. If this process is made automated, then this will speed up the development process as it reduces the time taken for the developer to build and test things manually. [Drone][1] is a free and open source project which provides an awesome environment of continuous integration service and is released under Apache License Version 2.0. It integrates with many repository providers like Github, Bitbucket and Google Code and has the ability to pull codes from the repositories enabling us to build the source code written in number of languages including PHP, Node, Ruby, Go, Dart, Python, C/C++, JAVA and more. It is made such a powerful platform cause it uses containers and docker technology for every build making users a complete control over their build environment with guaranteed isolation. @@ -189,7 +190,7 @@ After thats done, we'll need to edit our drone configuration using a text editor Then, we'll find the [github] section and append the section with the above noted configuration as shown below. -然后我们会在drone 的配置文件里面找到[github] 部分,紧接着的是下面所示的配置内容 +然后我们会在drone 的配置文件里面找到`[github]` 部分,紧接着的是下面所示的配置内容 [github] client="3dd44b969709c518603c" @@ -229,14 +230,20 @@ After installing, we'll need to edit the configuration of our postfix configurat Then, we'll need to replace the value of myhostname parameter to our FQDN ie drone.linoxide.com . +然后我们要把myhostname 的值替换为我们自己的FQDN,比如drone.linoxide.com。 + myhostname = drone.linoxide.com Now, we'll gonna finally configure the SMTP section of our drone configuration file. +现在开始配置drone 配置文件里的SMTP 部分。 + # nano /etc/drone/drone.toml Then, we'll find the [stmp] section and then we'll need to append the setting as follows. +找到`[smtp]` 部分补充上下面的内容。 + [smtp] host = "drone.linoxide.com" port = "587" @@ -248,14 +255,20 @@ Then, we'll find the [stmp] section and then we'll need to append the setting as Note: Here, **user** and **pass** parameters are strongly recommended to be changed according to one's user configuration. -### 7. Configuring Worker ### +注意:这里的**user** 和 **pass** 参数强烈推荐一定要改成一个用户的配置。 + +### 7. 配置 Worker ### As we know that drone utilizes docker for its building and testing task, we'll need to configure docker as the worker for our drone. To do so, we'll need to edit the [worker] section in the drone configuration file. +如我们所知的drone 利用了docker 完成构建、测试任务,我们需要把docker 配置为drone 的worker。要完成这些需要修改drone 配置文件里的`[worker]` 部分。 + # nano /etc/drone/drone.toml Then, we'll uncomment the following lines and append as shown below. +然后取消底下几行的注释并且补充上下面的内容。 + [worker] nodes=[ "unix:///var/run/docker.sock", @@ -264,6 +277,8 @@ Then, we'll uncomment the following lines and append as shown below. Here, we have set only 2 node which means the above configuration is capable of executing only 2 build at a time. In order to increase concurrency, we can increase the number of nodes. +这里我们只设置了两个节点,这意味着上面的配置文件只能同时执行2 个构建操作。要提高并发性可以增大节点的值。 + [worker] nodes=[ "unix:///var/run/docker.sock", @@ -274,45 +289,63 @@ Here, we have set only 2 node which means the above configuration is capable of Here, in the above configuration, drone is configured to process four builds at a time, using the local docker daemon. -### 8. Restarting Drone ### +使用上面的配置文件drone 被配置为使用本地的docker 守护程序可以同时构建4个任务。 + +### 8. 重启 Drone ### Finally, after everything is done regarding the installation and configuration, we'll now start our drone server in our linux machine. -#### On Ubuntu #### +最后,当所有的安装和配置都准备好之后,我们现在要在本地的linux 机器上启动drone 服务器。 + +#### Ubuntu #### To start drone in our Ubuntu 14.04 machine, we'll simply run service command as the default init system of Ubuntu 14.04 is SysVinit. +因为ubuntu 14.04 使用了sysvinit 作为默认的init 系统,所以只需要简单执行下面的service 命令就可以启动drone 了。 + # service drone restart To make drone start automatically in every boot of the system, we'll run the following command. +要让drone 在系统启动时也自动运行,需要运行下面的命令。 + # update-rc.d drone defaults -#### On CentOS #### +#### CentOS #### To start drone in CentOS machine, we'll simply run systemd command as CentOS 7 is shipped with systemd as init system. +因为CentOS 7使用systemd 作为init 系统,所以只需要运行下面的systemd 命令就可以重启drone。 + # systemctl restart drone Then, we'll enable drone to start automatically in every system boot. +要让drone 自动运行只需要运行下面的命令。 + # systemctl enable drone -### 9. Allowing Firewalls ### +### 9. 添加防火墙例外 ### As we know drone utilizes port 80 by default and we haven't changed the port, we'll gonna configure our firewall programs to allow port 80 (http) and be accessible from other machines in the network. -#### On Ubuntu 14.04 #### +众所周知drone 默认使用了80 端口而我们又没有修改他,所以我们需要配置防火墙程序允许80 端口(http)开发并允许其他机器可以通过网络连接。 + +#### Ubuntu 14.04 #### Iptables is a popular firewall program which is installed in the ubuntu distributions by default. We'll make iptables to expose port 80 so that we can make our Drone web interface accessible in the network. +iptables 是最流行的防火墙程序,并且ubuntu 默认安装了它。我们需要修改iptable 暴露端口80,这样我们才能让drone 的web 界面在网络上被大家访问。 + # iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT # /etc/init.d/iptables save -#### On CentOS 7 #### +#### CentOS 7 #### As CentOS 7 has systemd installed by default, it contains firewalld running as firewall problem. In order to open the port 80 (http service) on firewalld, we'll need to execute the following commands. +因为CentOS 7 默认安装了systemd,它使用firewalld 作为防火墙程序。为了在firewalld 上打开80端口(http 服务),我们需要执行下面的命令。 + # firewall-cmd --permanent --add-service=http success @@ -321,24 +354,34 @@ As CentOS 7 has systemd installed by default, it contains firewalld running as f success -### 10. Accessing Web Interface ### +### 10. 访问web 界面 ### Now, we'll gonna open the web interface of drone using our favourite web browser. To do so, we'll need to point our web browser to our machine running drone in it. As the default port of drone is 80 and we have also set 80 in this tutorial, we'll simply point our browser to http://ip-address/ or http://drone.linoxide.com according to our configuration. After we have done that correctly, we'll see the first page of it having options to login into our dashboard. +现在我们将在我们最喜欢的浏览器上通过web 界面打开drone。要完成这些我们要把浏览器指向运行drone 的服务器。因为drone 默认使用80 端口而我们有没有修改过,所以我们只需要在浏览器里根据我们的配置输入`http://ip-address/` 或 `http://drone.linoxide.com` 就行了。在我们正确的完成了上述操作后,我们就可以看到登陆界面了。 + ![Login Github Drone](http://blog.linoxide.com/wp-content/uploads/2015/11/login-github-drone-e1446834688394.png) As we have configured Github in the above step, we'll simply select github and we'll go through the app authentication process and after its done, we'll be forwarded to our Dashboard. +因为在上面的步骤里配置了Github,我们现在只需要简单的选择github然后进入应用授权步骤,这些完成后我们就可以进入工作台了。 + ![Drone Dashboard](http://blog.linoxide.com/wp-content/uploads/2015/11/drone-dashboard.png) Here, it will synchronize all our github repository and will ask us to activate the repo which we want to build with drone. +这里它会同步我们在github 上的代码库,然后询问我们要在drone 上构建那个代码库。 + ![Activate Repository](http://blog.linoxide.com/wp-content/uploads/2015/11/activate-repository-e1446835574595.png) After its activated, it will ask us to add a new file named .drone.yml in our repository and define the build process and configuration in that file like which image to fetch and which command/script to run while compiling, etc. +这一步完成后,它会询问我们在代码库里添加`.drone.yml` 文件的新名称,并且在这个文件里定义构建的过程和配置项,比如使用那个docker 镜像,执行那些命令和脚本来编译,等等。 + We'll need to configure our .drone.yml as shown below. +我们按照下面的内容来配置我们的`.drone.yml`。 + image: python script: - python helloworld.py @@ -346,16 +389,22 @@ We'll need to configure our .drone.yml as shown below. After its done, we'll be able to build our application using the configuration YAML file .drone.yml in our drone appliation. All the commits made into the repository is synced in realtime. It automatically syncs the commit and changes made to the repository. Once the commit is made in the repository, build is automatically started in our drone application. +这一步完成后我们就可以使用drone 应用里的YAML 格式的配置文件来构建我们的应用了。所有对代码库的提交和改变此时都会同步到这个仓库。一旦提交完成了,drone 就会自动开始构建。 + ![Building Application Drone](http://blog.linoxide.com/wp-content/uploads/2015/11/building-application-drone.png) After the build is completed, we'll be able to see the output of the build with the output console. +所有操作都完成后,我们就能在终端看到构建的结果了。 + ![Build Success Drone](http://blog.linoxide.com/wp-content/uploads/2015/11/build-success-drone.png) -### Conclusion ### +### 总结 ### In this article, we learned to completely setup a workable Continuous Intergration platform with Drone. If we want, we can even get started with the services provided by the official Drone.io project. We can start with free service or paid service according to our requirements. It has changed the world of Continuous integration with its beautiful web interface and powerful bunches of features. It has the ability to integrate with many third party applications and deployment platforms. 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 ! +在本文中我们学习了如何安装一个可以工作的使用drone 的持续集成平台。如果我们愿意我们甚至可以从drone.io 官方提供的服务开始工作。我们可以根据自己的需求从免费的服务或者收费服务开始。它通过漂亮的web界面和强大的功能改变了持续集成的世界。它可以集成很多第三方应用和部署平台。如果你有任何问题、建议可以直接反馈给我们,谢谢。 + -------------------------------------------------------------------------------- via: http://linoxide.com/linux-how-to/setup-drone-continuous-integration-linux/ From 992398e9d4a450ae1b393c7e10c9b5dafffda210 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 27 Dec 2015 11:32:55 +0800 Subject: [PATCH 0056/1469] translate done --- ...Continuous Integration Service in Linux.md | 107 +----------------- 1 file changed, 1 insertion(+), 106 deletions(-) diff --git a/sources/tech/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md b/sources/tech/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md index 275f92dc1b..077c945b9c 100644 --- a/sources/tech/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md +++ b/sources/tech/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md @@ -1,36 +1,23 @@ -translating by Ezio - -How to Setup Drone - a Continuous Integration Service in Linux 如何在linux 上配置持续集成服务 - Drone ============================================================== -Are you tired of cloning, building, testing, and deploying codes time and again? If yes, switch to continuous integration. Continuous Integration aka CI is practice in software engineering of making frequent commits to the code base, building, testing and deploying as we go. CI helps to quickly integrate new codes into the existing code base. If this process is made automated, then this will speed up the development process as it reduces the time taken for the developer to build and test things manually. [Drone][1] is a free and open source project which provides an awesome environment of continuous integration service and is released under Apache License Version 2.0. It integrates with many repository providers like Github, Bitbucket and Google Code and has the ability to pull codes from the repositories enabling us to build the source code written in number of languages including PHP, Node, Ruby, Go, Dart, Python, C/C++, JAVA and more. It is made such a powerful platform cause it uses containers and docker technology for every build making users a complete control over their build environment with guaranteed isolation. - 如果你对一次又一次的克隆、构建、测试和部署代码感到厌倦了,可以考虑一下持续集成。持续集成也就是CI,是软件工程的像我们一样的频繁提交的代码库,构建、测试和部署的实践。CI 帮助我们快速的集成新代码到已有的代码基线。如果这个过程是自动化进行的,那么就会提高开发的速度,因为这可以减少开发人员手工构建和测试的时间。[Drone][1] 是一个免费的开源项目,用来提供一个非常棒的持续集成服务的环境,采用了Apache 2.0 协议。它已经集成近很多代码库提供商,比如Github、Bitbucket 以及Google COde,并且它可以从代码库提取代码,使我们可以编译多种语言,包括PHP, Node, Ruby, Go, Dart, Python, C/C++, JAVA 等等。它是如此一个强大的平台是因为它每次构建都使用了容器和docker 技术,这让用户可以在保证隔离的条件下完全控制他们自己的构建环境。 ### 1. 安装 Docker ### -First of all, we'll gonna install Docker as its the most vital element for the complete workflow of Drone. Drone does a proper utilization of docker for the purpose of building and testing application. This container technology speeds up the development of the applications. To install docker, we'll need to run the following commands with respective the distribution of linux. In this tutorial, we'll cover the steps with Ubuntu 14.04 and CentOS 7 linux distributions. - 首先,我们要安装docker,因为这是Drone 的工作流的最关键的元素。Drone 合理的利用了docker 来构建和测试应用。容器技术提高了应用部署的效率。要安装docker ,我们需要在不同的linux 发行版本运行下面对应的命令,我们这里会说明Ubuntu 14.04 和CentOS 7 两个版本。 #### Ubuntu #### -To install Docker in Ubuntu, we can simply run the following commands in a terminal or console. - 要在Ubuntu 上安装Docker ,我们只需要运行下面的命令。 # apt-get update # apt-get install docker.io -After the installation is done, we'll restart our docker engine using service command. - 安装之后我们需要使用`service` 命令重启docker 引擎。 # service docker restart -Then, we'll make docker start automatically in every system boot. - 然后我们让docker 在系统启动时自动启动。 # update-rc.d docker defaults @@ -46,26 +33,18 @@ Then, we'll make docker start automatically in every system boot. #### CentOS #### -First, we'll gonna update every packages installed in our centos machine. We can do that by running the following command. - 第一,我们要更新机器上已经安装的软件包。我们可以使用下面的命令。 # sudo yum update -To install docker in centos, we can simply run the following commands. - 要在centos 上安装docker,我们可以简单的运行下面的命令。 # curl -sSL https://get.docker.com/ | sh -After our docker engine is installed in our centos machine, we'll simply start it by running the following systemd command as systemd is the default init system in centos 7. - 安装好docker 引擎之后我么只需要简单实用下面的`systemd` 命令启动docker,因为centos 7 的默认init 系统是systemd。 # systemctl start docker -Then, we'll enable docker to start automatically in every system startup. - 然后我们要让docker 在系统启动时自动启动。 # systemctl enable docker @@ -74,36 +53,26 @@ Then, we'll enable docker to start automatically in every system startup. ### 2. 安装 SQlite 驱动 ### -It uses SQlite3 database server for storing its data and information by default. It will automatically create a database file named drone.sqlite under /var/lib/drone/ which will handle database schema setup and migration. To setup SQlite3 drivers, we'll need to follow the below steps. - Drone 默认使用SQLite3 数据库服务器来保存数据和信息。它会在/var/lib/drone/ 自动创建名为drone.sqlite 的数据库来处理数据库模式的创建和迁移。要安装SQLite3 我们要完成以下几步。 #### Ubuntu 14.04 #### -As SQlite3 is available on the default respository of Ubuntu 14.04, we'll simply install it by running the following apt command. - 因为SQLite3 存在于Ubuntu 14.04 的默认软件库,我们只需要简单的使用apt 命令安装它。 # apt-get install libsqlite3-dev #### CentOS 7 #### -To install it on CentOS 7 machine, we'll need to run the following yum command. - 要在Centos 7 上安装选哟使用下面的yum 命令。 # yum install sqlite-devel ### 3. 安装 Drone ### -Finally, after we have installed those dependencies successfully, we'll now go further towards the installation of drone in our machine. In this step, we'll simply download the binary package of it from the official download link of the respective binary formats and then install them using the default package manager. - 最后,我们安装好依赖的软件,我们现在更进一步的接近安装Drone。在这一步里我们值简单的从官方链接下载对应的二进制软件包,然后使用默认软件包管理器安装Drone。 #### Ubuntu #### -We'll use wget to download the debian package of drone for ubuntu from the [official Debian file download link][2]. Here is the command to download the required debian package of drone. - 我们将使用wget 从官方的[Debian 文件下载链接][2]下载drone 的debian 软件包。下面就是下载命令。 # wget downloads.drone.io/master/drone.deb @@ -116,8 +85,6 @@ We'll use wget to download the debian package of drone for ubuntu from the [offi 100%[======================================>] 7,722,384 1.38MB/s in 17s 2015-11-06 14:09:28 (456 KB/s) - 'drone.deb' saved [7722384/7722384] -After its downloaded, we'll gonna install it with dpkg package manager. - 下载好之后,我们将使用dpkg 软件包管理器安装它。 # dpkg -i drone.deb @@ -132,8 +99,6 @@ After its downloaded, we'll gonna install it with dpkg package manager. #### CentOS #### -In the machine running CentOS, we'll download the RPM package from the [official download link for RPM][3] using wget command as shown below. - 在CentOS 机器上我们要使用wget 命令从[下载链接][3]下载RPM 包。 # wget downloads.drone.io/master/drone.rpm @@ -147,16 +112,12 @@ In the machine running CentOS, we'll download the RPM package from the [official 100%[======================================>] 7,763,311 1.18MB/s in 20s 2015-11-06 11:07:06 (374 KB/s) - ‘drone.rpm’ saved [7763311/7763311] -Then, we'll install the download rpm package using yum package manager. - 然后我们使用yum 安装rpm 包。 # yum localinstall drone.rpm ### 4. 配置端口 ### -After the installation is completed, we'll gonna configure drone to make it workable. The configuration of drone is inside **/etc/drone/drone.toml** file. By default, drone web interface is exposed under port 80 which is the default port of http, if we wanna change it, we can change it by replacing the value under server block as shown below. - 安装完成之后,我们要使它工作要先进行配置。drone 的配置文件在**/etc/drone/drone.toml** 。默认情况下drone 的web 接口使用的是80,而这也是http 默认的端口,如果我们要下面所示的修改配置文件里server 块对应的值。 [server] @@ -164,32 +125,22 @@ After the installation is completed, we'll gonna configure drone to make it work ### 5. 集成 Github ### -In order to run Drone we must setup at least one integration points between GitHub, GitHub Enterprise, Gitlab, Gogs, Bitbucket. In this tutorial, we'll only integrate github but if we wanna integrate other we can do that from the configuration file. In order to integrate github, we'll need to create a new application in our [github settings][4]. - 为了运行Drone 我们必须设置最少一个和GitHub、GitHub 企业版,Gitlab,Gogs,Bitbucket 关联的集成点。在本文里我们只集成了github,但是如果哦我们要集成其他的我们可以在配置文件做修改。为了集成github 我们需要在[github setting] 创建一个新的应用。 ![Registering App Github](http://blog.linoxide.com/wp-content/uploads/2015/11/registering-app-github.png) -To create, we'll need to click on Register a New Application then fill out the form as shown in the following image. - 要创建一个应用,我们需要在`New Application` 页面点击`Register`,然后如下所示填表。 ![Registering OAuth app github](http://blog.linoxide.com/wp-content/uploads/2015/11/registering-OAuth-app-github.png) -We should make sure that **Authorization callback URL** looks like http://drone.linoxide.com/api/auth/github.com under the configuration of the application. Then, we'll click on Register application. After done, we'll note the Client ID and Client Secret key as we'll need to configure it in our drone configuration. - 我们应该保证在应用的配置项里设置了**授权了的回调链接**,链接看起来像`http://drone.linoxide.com/api/auth/github.com`。然后我们点击注册应用。所有都做好之后我们会看到我们需要在我们的Drone 配置文件里配置的客户端ID 和客户端密钥。 ![Client ID and Secret Token](http://blog.linoxide.com/wp-content/uploads/2015/11/client-id-secret-token.png) -After thats done, we'll need to edit our drone configuration using a text editor by running the following command. - 在这些都完成之后我们需要使用文本编辑器编辑drone 配置文件,比如使用下面的命令。 # nano /etc/drone/drone.toml -Then, we'll find the [github] section and append the section with the above noted configuration as shown below. - 然后我们会在drone 的配置文件里面找到`[github]` 部分,紧接着的是下面所示的配置内容 [github] @@ -202,46 +153,32 @@ Then, we'll find the [github] section and append the section with the above note ### 6. 配置 SMTP 服务器 ### -If we wanna enable drone to send notifications via emails, then we'll need to specify the SMTP configuration of our SMTP server. If we already have an SMTP server, we can use its configuration but as we don't have an SMTP server, we'll need to install an MTA ie Postfix and then specify the SMTP configuration in the drone configuration. - 如果我们想让drone 使用email 发送通知,那么我们需要在SMTP 配置里面设置我们的SMTP 服务器。如果我们已经有了一个SMTP 服务,那就只需要简单的使用它的配置文件就行了,但是因为我们没有一个SMTP 服务器,我们需要安装一个MTA 比如Postfix,然后在drone 配置文件里配置好SMTP。 #### Ubuntu #### -We can install postfix in ubuntu by running the following apt command. - 在ubuntu 里使用下面的apt 命令安装postfix。 # apt-get install postfix #### CentOS #### -We can install postfix in CentOS by running the following yum command. - 在CentOS 里使用下面的yum 命令安装postfix。 # yum install postfix -After installing, we'll need to edit the configuration of our postfix configuration using a text editor. - 安装好之后,我们需要编辑我们的postfix 配置文件。 # nano /etc/postfix/main.cf -Then, we'll need to replace the value of myhostname parameter to our FQDN ie drone.linoxide.com . - 然后我们要把myhostname 的值替换为我们自己的FQDN,比如drone.linoxide.com。 myhostname = drone.linoxide.com -Now, we'll gonna finally configure the SMTP section of our drone configuration file. - 现在开始配置drone 配置文件里的SMTP 部分。 # nano /etc/drone/drone.toml -Then, we'll find the [stmp] section and then we'll need to append the setting as follows. - 找到`[smtp]` 部分补充上下面的内容。 [smtp] @@ -253,20 +190,14 @@ Then, we'll find the [stmp] section and then we'll need to append the setting as ![Configuring SMTP Drone](http://blog.linoxide.com/wp-content/uploads/2015/11/configuring-smtp-drone.png) -Note: Here, **user** and **pass** parameters are strongly recommended to be changed according to one's user configuration. - 注意:这里的**user** 和 **pass** 参数强烈推荐一定要改成一个用户的配置。 ### 7. 配置 Worker ### -As we know that drone utilizes docker for its building and testing task, we'll need to configure docker as the worker for our drone. To do so, we'll need to edit the [worker] section in the drone configuration file. - 如我们所知的drone 利用了docker 完成构建、测试任务,我们需要把docker 配置为drone 的worker。要完成这些需要修改drone 配置文件里的`[worker]` 部分。 # nano /etc/drone/drone.toml -Then, we'll uncomment the following lines and append as shown below. - 然后取消底下几行的注释并且补充上下面的内容。 [worker] @@ -275,8 +206,6 @@ Then, we'll uncomment the following lines and append as shown below. "unix:///var/run/docker.sock" ] -Here, we have set only 2 node which means the above configuration is capable of executing only 2 build at a time. In order to increase concurrency, we can increase the number of nodes. - 这里我们只设置了两个节点,这意味着上面的配置文件只能同时执行2 个构建操作。要提高并发性可以增大节点的值。 [worker] @@ -287,54 +216,38 @@ Here, we have set only 2 node which means the above configuration is capable of "unix:///var/run/docker.sock" ] -Here, in the above configuration, drone is configured to process four builds at a time, using the local docker daemon. - 使用上面的配置文件drone 被配置为使用本地的docker 守护程序可以同时构建4个任务。 ### 8. 重启 Drone ### -Finally, after everything is done regarding the installation and configuration, we'll now start our drone server in our linux machine. - 最后,当所有的安装和配置都准备好之后,我们现在要在本地的linux 机器上启动drone 服务器。 #### Ubuntu #### -To start drone in our Ubuntu 14.04 machine, we'll simply run service command as the default init system of Ubuntu 14.04 is SysVinit. - 因为ubuntu 14.04 使用了sysvinit 作为默认的init 系统,所以只需要简单执行下面的service 命令就可以启动drone 了。 # service drone restart -To make drone start automatically in every boot of the system, we'll run the following command. - 要让drone 在系统启动时也自动运行,需要运行下面的命令。 # update-rc.d drone defaults #### CentOS #### -To start drone in CentOS machine, we'll simply run systemd command as CentOS 7 is shipped with systemd as init system. - 因为CentOS 7使用systemd 作为init 系统,所以只需要运行下面的systemd 命令就可以重启drone。 # systemctl restart drone -Then, we'll enable drone to start automatically in every system boot. - 要让drone 自动运行只需要运行下面的命令。 # systemctl enable drone ### 9. 添加防火墙例外 ### -As we know drone utilizes port 80 by default and we haven't changed the port, we'll gonna configure our firewall programs to allow port 80 (http) and be accessible from other machines in the network. - 众所周知drone 默认使用了80 端口而我们又没有修改他,所以我们需要配置防火墙程序允许80 端口(http)开发并允许其他机器可以通过网络连接。 #### Ubuntu 14.04 #### -Iptables is a popular firewall program which is installed in the ubuntu distributions by default. We'll make iptables to expose port 80 so that we can make our Drone web interface accessible in the network. - iptables 是最流行的防火墙程序,并且ubuntu 默认安装了它。我们需要修改iptable 暴露端口80,这样我们才能让drone 的web 界面在网络上被大家访问。 # iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT @@ -342,8 +255,6 @@ iptables 是最流行的防火墙程序,并且ubuntu 默认安装了它。我 #### CentOS 7 #### -As CentOS 7 has systemd installed by default, it contains firewalld running as firewall problem. In order to open the port 80 (http service) on firewalld, we'll need to execute the following commands. - 因为CentOS 7 默认安装了systemd,它使用firewalld 作为防火墙程序。为了在firewalld 上打开80端口(http 服务),我们需要执行下面的命令。 # firewall-cmd --permanent --add-service=http @@ -356,30 +267,20 @@ As CentOS 7 has systemd installed by default, it contains firewalld running as f ### 10. 访问web 界面 ### -Now, we'll gonna open the web interface of drone using our favourite web browser. To do so, we'll need to point our web browser to our machine running drone in it. As the default port of drone is 80 and we have also set 80 in this tutorial, we'll simply point our browser to http://ip-address/ or http://drone.linoxide.com according to our configuration. After we have done that correctly, we'll see the first page of it having options to login into our dashboard. - 现在我们将在我们最喜欢的浏览器上通过web 界面打开drone。要完成这些我们要把浏览器指向运行drone 的服务器。因为drone 默认使用80 端口而我们有没有修改过,所以我们只需要在浏览器里根据我们的配置输入`http://ip-address/` 或 `http://drone.linoxide.com` 就行了。在我们正确的完成了上述操作后,我们就可以看到登陆界面了。 ![Login Github Drone](http://blog.linoxide.com/wp-content/uploads/2015/11/login-github-drone-e1446834688394.png) -As we have configured Github in the above step, we'll simply select github and we'll go through the app authentication process and after its done, we'll be forwarded to our Dashboard. - 因为在上面的步骤里配置了Github,我们现在只需要简单的选择github然后进入应用授权步骤,这些完成后我们就可以进入工作台了。 ![Drone Dashboard](http://blog.linoxide.com/wp-content/uploads/2015/11/drone-dashboard.png) -Here, it will synchronize all our github repository and will ask us to activate the repo which we want to build with drone. - 这里它会同步我们在github 上的代码库,然后询问我们要在drone 上构建那个代码库。 ![Activate Repository](http://blog.linoxide.com/wp-content/uploads/2015/11/activate-repository-e1446835574595.png) -After its activated, it will ask us to add a new file named .drone.yml in our repository and define the build process and configuration in that file like which image to fetch and which command/script to run while compiling, etc. - 这一步完成后,它会询问我们在代码库里添加`.drone.yml` 文件的新名称,并且在这个文件里定义构建的过程和配置项,比如使用那个docker 镜像,执行那些命令和脚本来编译,等等。 -We'll need to configure our .drone.yml as shown below. - 我们按照下面的内容来配置我们的`.drone.yml`。 image: python @@ -387,22 +288,16 @@ We'll need to configure our .drone.yml as shown below. - python helloworld.py - echo "Build has been completed." -After its done, we'll be able to build our application using the configuration YAML file .drone.yml in our drone appliation. All the commits made into the repository is synced in realtime. It automatically syncs the commit and changes made to the repository. Once the commit is made in the repository, build is automatically started in our drone application. - 这一步完成后我们就可以使用drone 应用里的YAML 格式的配置文件来构建我们的应用了。所有对代码库的提交和改变此时都会同步到这个仓库。一旦提交完成了,drone 就会自动开始构建。 ![Building Application Drone](http://blog.linoxide.com/wp-content/uploads/2015/11/building-application-drone.png) -After the build is completed, we'll be able to see the output of the build with the output console. - 所有操作都完成后,我们就能在终端看到构建的结果了。 ![Build Success Drone](http://blog.linoxide.com/wp-content/uploads/2015/11/build-success-drone.png) ### 总结 ### -In this article, we learned to completely setup a workable Continuous Intergration platform with Drone. If we want, we can even get started with the services provided by the official Drone.io project. We can start with free service or paid service according to our requirements. It has changed the world of Continuous integration with its beautiful web interface and powerful bunches of features. It has the ability to integrate with many third party applications and deployment platforms. 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 ! - 在本文中我们学习了如何安装一个可以工作的使用drone 的持续集成平台。如果我们愿意我们甚至可以从drone.io 官方提供的服务开始工作。我们可以根据自己的需求从免费的服务或者收费服务开始。它通过漂亮的web界面和强大的功能改变了持续集成的世界。它可以集成很多第三方应用和部署平台。如果你有任何问题、建议可以直接反馈给我们,谢谢。 -------------------------------------------------------------------------------- @@ -410,7 +305,7 @@ In this article, we learned to completely setup a workable Continuous Intergrati via: http://linoxide.com/linux-how-to/setup-drone-continuous-integration-linux/ 作者:[Arun Pyasi][a] -译者:[译者ID](https://github.com/译者ID) +译者:[ezio](https://github.com/oska874) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 5cc918dca292aacae91227b0bfee63921d5141f8 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 27 Dec 2015 11:33:16 +0800 Subject: [PATCH 0057/1469] move 1 --- ...Continuous Integration Service in Linux.md | 317 ------------------ 1 file changed, 317 deletions(-) delete mode 100644 sources/tech/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md diff --git a/sources/tech/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md b/sources/tech/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md deleted file mode 100644 index 077c945b9c..0000000000 --- a/sources/tech/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md +++ /dev/null @@ -1,317 +0,0 @@ -如何在linux 上配置持续集成服务 - Drone -============================================================== - -如果你对一次又一次的克隆、构建、测试和部署代码感到厌倦了,可以考虑一下持续集成。持续集成也就是CI,是软件工程的像我们一样的频繁提交的代码库,构建、测试和部署的实践。CI 帮助我们快速的集成新代码到已有的代码基线。如果这个过程是自动化进行的,那么就会提高开发的速度,因为这可以减少开发人员手工构建和测试的时间。[Drone][1] 是一个免费的开源项目,用来提供一个非常棒的持续集成服务的环境,采用了Apache 2.0 协议。它已经集成近很多代码库提供商,比如Github、Bitbucket 以及Google COde,并且它可以从代码库提取代码,使我们可以编译多种语言,包括PHP, Node, Ruby, Go, Dart, Python, C/C++, JAVA 等等。它是如此一个强大的平台是因为它每次构建都使用了容器和docker 技术,这让用户可以在保证隔离的条件下完全控制他们自己的构建环境。 - -### 1. 安装 Docker ### - -首先,我们要安装docker,因为这是Drone 的工作流的最关键的元素。Drone 合理的利用了docker 来构建和测试应用。容器技术提高了应用部署的效率。要安装docker ,我们需要在不同的linux 发行版本运行下面对应的命令,我们这里会说明Ubuntu 14.04 和CentOS 7 两个版本。 - -#### Ubuntu #### - -要在Ubuntu 上安装Docker ,我们只需要运行下面的命令。 - - # apt-get update - # apt-get install docker.io - -安装之后我们需要使用`service` 命令重启docker 引擎。 - - # service docker restart - -然后我们让docker 在系统启动时自动启动。 - - # update-rc.d docker defaults - - Adding system startup for /etc/init.d/docker ... - /etc/rc0.d/K20docker -> ../init.d/docker - /etc/rc1.d/K20docker -> ../init.d/docker - /etc/rc6.d/K20docker -> ../init.d/docker - /etc/rc2.d/S20docker -> ../init.d/docker - /etc/rc3.d/S20docker -> ../init.d/docker - /etc/rc4.d/S20docker -> ../init.d/docker - /etc/rc5.d/S20docker -> ../init.d/docker - -#### CentOS #### - -第一,我们要更新机器上已经安装的软件包。我们可以使用下面的命令。 - - # sudo yum update - -要在centos 上安装docker,我们可以简单的运行下面的命令。 - - # curl -sSL https://get.docker.com/ | sh - -安装好docker 引擎之后我么只需要简单实用下面的`systemd` 命令启动docker,因为centos 7 的默认init 系统是systemd。 - - # systemctl start docker - -然后我们要让docker 在系统启动时自动启动。 - - # systemctl enable docker - - ln -s '/usr/lib/systemd/system/docker.service' '/etc/systemd/system/multi-user.target.wants/docker.service' - -### 2. 安装 SQlite 驱动 ### - -Drone 默认使用SQLite3 数据库服务器来保存数据和信息。它会在/var/lib/drone/ 自动创建名为drone.sqlite 的数据库来处理数据库模式的创建和迁移。要安装SQLite3 我们要完成以下几步。 - -#### Ubuntu 14.04 #### - -因为SQLite3 存在于Ubuntu 14.04 的默认软件库,我们只需要简单的使用apt 命令安装它。 - - # apt-get install libsqlite3-dev - -#### CentOS 7 #### - -要在Centos 7 上安装选哟使用下面的yum 命令。 - - # yum install sqlite-devel - -### 3. 安装 Drone ### - -最后,我们安装好依赖的软件,我们现在更进一步的接近安装Drone。在这一步里我们值简单的从官方链接下载对应的二进制软件包,然后使用默认软件包管理器安装Drone。 - -#### Ubuntu #### - -我们将使用wget 从官方的[Debian 文件下载链接][2]下载drone 的debian 软件包。下面就是下载命令。 - - # wget downloads.drone.io/master/drone.deb - - Resolving downloads.drone.io (downloads.drone.io)... 54.231.48.98 - Connecting to downloads.drone.io (downloads.drone.io)|54.231.48.98|:80... connected. - HTTP request sent, awaiting response... 200 OK - Length: 7722384 (7.4M) [application/x-debian-package] - Saving to: 'drone.deb' - 100%[======================================>] 7,722,384 1.38MB/s in 17s - 2015-11-06 14:09:28 (456 KB/s) - 'drone.deb' saved [7722384/7722384] - -下载好之后,我们将使用dpkg 软件包管理器安装它。 - - # dpkg -i drone.deb - - Selecting previously unselected package drone. - (Reading database ... 28077 files and directories currently installed.) - Preparing to unpack drone.deb ... - Unpacking drone (0.3.0-alpha-1442513246) ... - Setting up drone (0.3.0-alpha-1442513246) ... - Your system ubuntu 14: using upstart to control Drone - drone start/running, process 9512 - -#### CentOS #### - -在CentOS 机器上我们要使用wget 命令从[下载链接][3]下载RPM 包。 - - # wget downloads.drone.io/master/drone.rpm - - --2015-11-06 11:06:45-- http://downloads.drone.io/master/drone.rpm - Resolving downloads.drone.io (downloads.drone.io)... 54.231.114.18 - Connecting to downloads.drone.io (downloads.drone.io)|54.231.114.18|:80... connected. - HTTP request sent, awaiting response... 200 OK - Length: 7763311 (7.4M) [application/x-redhat-package-manager] - Saving to: ‘drone.rpm’ - 100%[======================================>] 7,763,311 1.18MB/s in 20s - 2015-11-06 11:07:06 (374 KB/s) - ‘drone.rpm’ saved [7763311/7763311] - -然后我们使用yum 安装rpm 包。 - - # yum localinstall drone.rpm - -### 4. 配置端口 ### - -安装完成之后,我们要使它工作要先进行配置。drone 的配置文件在**/etc/drone/drone.toml** 。默认情况下drone 的web 接口使用的是80,而这也是http 默认的端口,如果我们要下面所示的修改配置文件里server 块对应的值。 - - [server] - port=":80" - -### 5. 集成 Github ### - -为了运行Drone 我们必须设置最少一个和GitHub、GitHub 企业版,Gitlab,Gogs,Bitbucket 关联的集成点。在本文里我们只集成了github,但是如果哦我们要集成其他的我们可以在配置文件做修改。为了集成github 我们需要在[github setting] 创建一个新的应用。 - -![Registering App Github](http://blog.linoxide.com/wp-content/uploads/2015/11/registering-app-github.png) - -要创建一个应用,我们需要在`New Application` 页面点击`Register`,然后如下所示填表。 - -![Registering OAuth app github](http://blog.linoxide.com/wp-content/uploads/2015/11/registering-OAuth-app-github.png) - -我们应该保证在应用的配置项里设置了**授权了的回调链接**,链接看起来像`http://drone.linoxide.com/api/auth/github.com`。然后我们点击注册应用。所有都做好之后我们会看到我们需要在我们的Drone 配置文件里配置的客户端ID 和客户端密钥。 - -![Client ID and Secret Token](http://blog.linoxide.com/wp-content/uploads/2015/11/client-id-secret-token.png) - -在这些都完成之后我们需要使用文本编辑器编辑drone 配置文件,比如使用下面的命令。 - - # nano /etc/drone/drone.toml - -然后我们会在drone 的配置文件里面找到`[github]` 部分,紧接着的是下面所示的配置内容 - - [github] - client="3dd44b969709c518603c" - secret="4ee261abdb431bdc5e96b19cc3c498403853632a" - # orgs=[] - # open=false - -![Configuring Github Drone](http://blog.linoxide.com/wp-content/uploads/2015/11/configuring-github-drone-e1446835124465.png) - -### 6. 配置 SMTP 服务器 ### - -如果我们想让drone 使用email 发送通知,那么我们需要在SMTP 配置里面设置我们的SMTP 服务器。如果我们已经有了一个SMTP 服务,那就只需要简单的使用它的配置文件就行了,但是因为我们没有一个SMTP 服务器,我们需要安装一个MTA 比如Postfix,然后在drone 配置文件里配置好SMTP。 - -#### Ubuntu #### - -在ubuntu 里使用下面的apt 命令安装postfix。 - - # apt-get install postfix - -#### CentOS #### - -在CentOS 里使用下面的yum 命令安装postfix。 - - # yum install postfix - -安装好之后,我们需要编辑我们的postfix 配置文件。 - - # nano /etc/postfix/main.cf - -然后我们要把myhostname 的值替换为我们自己的FQDN,比如drone.linoxide.com。 - - myhostname = drone.linoxide.com - -现在开始配置drone 配置文件里的SMTP 部分。 - - # nano /etc/drone/drone.toml - -找到`[smtp]` 部分补充上下面的内容。 - - [smtp] - host = "drone.linoxide.com" - port = "587" - from = "root@drone.linoxide.com" - user = "root" - pass = "password" - -![Configuring SMTP Drone](http://blog.linoxide.com/wp-content/uploads/2015/11/configuring-smtp-drone.png) - -注意:这里的**user** 和 **pass** 参数强烈推荐一定要改成一个用户的配置。 - -### 7. 配置 Worker ### - -如我们所知的drone 利用了docker 完成构建、测试任务,我们需要把docker 配置为drone 的worker。要完成这些需要修改drone 配置文件里的`[worker]` 部分。 - - # nano /etc/drone/drone.toml - -然后取消底下几行的注释并且补充上下面的内容。 - - [worker] - nodes=[ - "unix:///var/run/docker.sock", - "unix:///var/run/docker.sock" - ] - -这里我们只设置了两个节点,这意味着上面的配置文件只能同时执行2 个构建操作。要提高并发性可以增大节点的值。 - - [worker] - nodes=[ - "unix:///var/run/docker.sock", - "unix:///var/run/docker.sock", - "unix:///var/run/docker.sock", - "unix:///var/run/docker.sock" - ] - -使用上面的配置文件drone 被配置为使用本地的docker 守护程序可以同时构建4个任务。 - -### 8. 重启 Drone ### - -最后,当所有的安装和配置都准备好之后,我们现在要在本地的linux 机器上启动drone 服务器。 - -#### Ubuntu #### - -因为ubuntu 14.04 使用了sysvinit 作为默认的init 系统,所以只需要简单执行下面的service 命令就可以启动drone 了。 - - # service drone restart - -要让drone 在系统启动时也自动运行,需要运行下面的命令。 - - # update-rc.d drone defaults - -#### CentOS #### - -因为CentOS 7使用systemd 作为init 系统,所以只需要运行下面的systemd 命令就可以重启drone。 - - # systemctl restart drone - -要让drone 自动运行只需要运行下面的命令。 - - # systemctl enable drone - -### 9. 添加防火墙例外 ### - -众所周知drone 默认使用了80 端口而我们又没有修改他,所以我们需要配置防火墙程序允许80 端口(http)开发并允许其他机器可以通过网络连接。 - -#### Ubuntu 14.04 #### - -iptables 是最流行的防火墙程序,并且ubuntu 默认安装了它。我们需要修改iptable 暴露端口80,这样我们才能让drone 的web 界面在网络上被大家访问。 - - # iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT - # /etc/init.d/iptables save - -#### CentOS 7 #### - -因为CentOS 7 默认安装了systemd,它使用firewalld 作为防火墙程序。为了在firewalld 上打开80端口(http 服务),我们需要执行下面的命令。 - - # firewall-cmd --permanent --add-service=http - - success - - # firewall-cmd --reload - - success - -### 10. 访问web 界面 ### - -现在我们将在我们最喜欢的浏览器上通过web 界面打开drone。要完成这些我们要把浏览器指向运行drone 的服务器。因为drone 默认使用80 端口而我们有没有修改过,所以我们只需要在浏览器里根据我们的配置输入`http://ip-address/` 或 `http://drone.linoxide.com` 就行了。在我们正确的完成了上述操作后,我们就可以看到登陆界面了。 - -![Login Github Drone](http://blog.linoxide.com/wp-content/uploads/2015/11/login-github-drone-e1446834688394.png) - -因为在上面的步骤里配置了Github,我们现在只需要简单的选择github然后进入应用授权步骤,这些完成后我们就可以进入工作台了。 - -![Drone Dashboard](http://blog.linoxide.com/wp-content/uploads/2015/11/drone-dashboard.png) - -这里它会同步我们在github 上的代码库,然后询问我们要在drone 上构建那个代码库。 - -![Activate Repository](http://blog.linoxide.com/wp-content/uploads/2015/11/activate-repository-e1446835574595.png) - -这一步完成后,它会询问我们在代码库里添加`.drone.yml` 文件的新名称,并且在这个文件里定义构建的过程和配置项,比如使用那个docker 镜像,执行那些命令和脚本来编译,等等。 - -我们按照下面的内容来配置我们的`.drone.yml`。 - - image: python - script: - - python helloworld.py - - echo "Build has been completed." - -这一步完成后我们就可以使用drone 应用里的YAML 格式的配置文件来构建我们的应用了。所有对代码库的提交和改变此时都会同步到这个仓库。一旦提交完成了,drone 就会自动开始构建。 - -![Building Application Drone](http://blog.linoxide.com/wp-content/uploads/2015/11/building-application-drone.png) - -所有操作都完成后,我们就能在终端看到构建的结果了。 - -![Build Success Drone](http://blog.linoxide.com/wp-content/uploads/2015/11/build-success-drone.png) - -### 总结 ### - -在本文中我们学习了如何安装一个可以工作的使用drone 的持续集成平台。如果我们愿意我们甚至可以从drone.io 官方提供的服务开始工作。我们可以根据自己的需求从免费的服务或者收费服务开始。它通过漂亮的web界面和强大的功能改变了持续集成的世界。它可以集成很多第三方应用和部署平台。如果你有任何问题、建议可以直接反馈给我们,谢谢。 - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/setup-drone-continuous-integration-linux/ - -作者:[Arun Pyasi][a] -译者:[ezio](https://github.com/oska874) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/arunp/ -[1]:https://drone.io/ -[2]:http://downloads.drone.io/master/drone.deb -[3]:http://downloads.drone.io/master/drone.rpm -[4]:https://github.com/settings/developers From e3442f00e7bbff5a2ab9e84cc50e7410a2bdf046 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 27 Dec 2015 11:35:18 +0800 Subject: [PATCH 0058/1469] move done MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译完成 --- ...Continuous Integration Service in Linux.md | 317 ++++++++++++++++++ 1 file changed, 317 insertions(+) create mode 100644 translated/tech/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md diff --git a/translated/tech/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md b/translated/tech/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md new file mode 100644 index 0000000000..077c945b9c --- /dev/null +++ b/translated/tech/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md @@ -0,0 +1,317 @@ +如何在linux 上配置持续集成服务 - Drone +============================================================== + +如果你对一次又一次的克隆、构建、测试和部署代码感到厌倦了,可以考虑一下持续集成。持续集成也就是CI,是软件工程的像我们一样的频繁提交的代码库,构建、测试和部署的实践。CI 帮助我们快速的集成新代码到已有的代码基线。如果这个过程是自动化进行的,那么就会提高开发的速度,因为这可以减少开发人员手工构建和测试的时间。[Drone][1] 是一个免费的开源项目,用来提供一个非常棒的持续集成服务的环境,采用了Apache 2.0 协议。它已经集成近很多代码库提供商,比如Github、Bitbucket 以及Google COde,并且它可以从代码库提取代码,使我们可以编译多种语言,包括PHP, Node, Ruby, Go, Dart, Python, C/C++, JAVA 等等。它是如此一个强大的平台是因为它每次构建都使用了容器和docker 技术,这让用户可以在保证隔离的条件下完全控制他们自己的构建环境。 + +### 1. 安装 Docker ### + +首先,我们要安装docker,因为这是Drone 的工作流的最关键的元素。Drone 合理的利用了docker 来构建和测试应用。容器技术提高了应用部署的效率。要安装docker ,我们需要在不同的linux 发行版本运行下面对应的命令,我们这里会说明Ubuntu 14.04 和CentOS 7 两个版本。 + +#### Ubuntu #### + +要在Ubuntu 上安装Docker ,我们只需要运行下面的命令。 + + # apt-get update + # apt-get install docker.io + +安装之后我们需要使用`service` 命令重启docker 引擎。 + + # service docker restart + +然后我们让docker 在系统启动时自动启动。 + + # update-rc.d docker defaults + + Adding system startup for /etc/init.d/docker ... + /etc/rc0.d/K20docker -> ../init.d/docker + /etc/rc1.d/K20docker -> ../init.d/docker + /etc/rc6.d/K20docker -> ../init.d/docker + /etc/rc2.d/S20docker -> ../init.d/docker + /etc/rc3.d/S20docker -> ../init.d/docker + /etc/rc4.d/S20docker -> ../init.d/docker + /etc/rc5.d/S20docker -> ../init.d/docker + +#### CentOS #### + +第一,我们要更新机器上已经安装的软件包。我们可以使用下面的命令。 + + # sudo yum update + +要在centos 上安装docker,我们可以简单的运行下面的命令。 + + # curl -sSL https://get.docker.com/ | sh + +安装好docker 引擎之后我么只需要简单实用下面的`systemd` 命令启动docker,因为centos 7 的默认init 系统是systemd。 + + # systemctl start docker + +然后我们要让docker 在系统启动时自动启动。 + + # systemctl enable docker + + ln -s '/usr/lib/systemd/system/docker.service' '/etc/systemd/system/multi-user.target.wants/docker.service' + +### 2. 安装 SQlite 驱动 ### + +Drone 默认使用SQLite3 数据库服务器来保存数据和信息。它会在/var/lib/drone/ 自动创建名为drone.sqlite 的数据库来处理数据库模式的创建和迁移。要安装SQLite3 我们要完成以下几步。 + +#### Ubuntu 14.04 #### + +因为SQLite3 存在于Ubuntu 14.04 的默认软件库,我们只需要简单的使用apt 命令安装它。 + + # apt-get install libsqlite3-dev + +#### CentOS 7 #### + +要在Centos 7 上安装选哟使用下面的yum 命令。 + + # yum install sqlite-devel + +### 3. 安装 Drone ### + +最后,我们安装好依赖的软件,我们现在更进一步的接近安装Drone。在这一步里我们值简单的从官方链接下载对应的二进制软件包,然后使用默认软件包管理器安装Drone。 + +#### Ubuntu #### + +我们将使用wget 从官方的[Debian 文件下载链接][2]下载drone 的debian 软件包。下面就是下载命令。 + + # wget downloads.drone.io/master/drone.deb + + Resolving downloads.drone.io (downloads.drone.io)... 54.231.48.98 + Connecting to downloads.drone.io (downloads.drone.io)|54.231.48.98|:80... connected. + HTTP request sent, awaiting response... 200 OK + Length: 7722384 (7.4M) [application/x-debian-package] + Saving to: 'drone.deb' + 100%[======================================>] 7,722,384 1.38MB/s in 17s + 2015-11-06 14:09:28 (456 KB/s) - 'drone.deb' saved [7722384/7722384] + +下载好之后,我们将使用dpkg 软件包管理器安装它。 + + # dpkg -i drone.deb + + Selecting previously unselected package drone. + (Reading database ... 28077 files and directories currently installed.) + Preparing to unpack drone.deb ... + Unpacking drone (0.3.0-alpha-1442513246) ... + Setting up drone (0.3.0-alpha-1442513246) ... + Your system ubuntu 14: using upstart to control Drone + drone start/running, process 9512 + +#### CentOS #### + +在CentOS 机器上我们要使用wget 命令从[下载链接][3]下载RPM 包。 + + # wget downloads.drone.io/master/drone.rpm + + --2015-11-06 11:06:45-- http://downloads.drone.io/master/drone.rpm + Resolving downloads.drone.io (downloads.drone.io)... 54.231.114.18 + Connecting to downloads.drone.io (downloads.drone.io)|54.231.114.18|:80... connected. + HTTP request sent, awaiting response... 200 OK + Length: 7763311 (7.4M) [application/x-redhat-package-manager] + Saving to: ‘drone.rpm’ + 100%[======================================>] 7,763,311 1.18MB/s in 20s + 2015-11-06 11:07:06 (374 KB/s) - ‘drone.rpm’ saved [7763311/7763311] + +然后我们使用yum 安装rpm 包。 + + # yum localinstall drone.rpm + +### 4. 配置端口 ### + +安装完成之后,我们要使它工作要先进行配置。drone 的配置文件在**/etc/drone/drone.toml** 。默认情况下drone 的web 接口使用的是80,而这也是http 默认的端口,如果我们要下面所示的修改配置文件里server 块对应的值。 + + [server] + port=":80" + +### 5. 集成 Github ### + +为了运行Drone 我们必须设置最少一个和GitHub、GitHub 企业版,Gitlab,Gogs,Bitbucket 关联的集成点。在本文里我们只集成了github,但是如果哦我们要集成其他的我们可以在配置文件做修改。为了集成github 我们需要在[github setting] 创建一个新的应用。 + +![Registering App Github](http://blog.linoxide.com/wp-content/uploads/2015/11/registering-app-github.png) + +要创建一个应用,我们需要在`New Application` 页面点击`Register`,然后如下所示填表。 + +![Registering OAuth app github](http://blog.linoxide.com/wp-content/uploads/2015/11/registering-OAuth-app-github.png) + +我们应该保证在应用的配置项里设置了**授权了的回调链接**,链接看起来像`http://drone.linoxide.com/api/auth/github.com`。然后我们点击注册应用。所有都做好之后我们会看到我们需要在我们的Drone 配置文件里配置的客户端ID 和客户端密钥。 + +![Client ID and Secret Token](http://blog.linoxide.com/wp-content/uploads/2015/11/client-id-secret-token.png) + +在这些都完成之后我们需要使用文本编辑器编辑drone 配置文件,比如使用下面的命令。 + + # nano /etc/drone/drone.toml + +然后我们会在drone 的配置文件里面找到`[github]` 部分,紧接着的是下面所示的配置内容 + + [github] + client="3dd44b969709c518603c" + secret="4ee261abdb431bdc5e96b19cc3c498403853632a" + # orgs=[] + # open=false + +![Configuring Github Drone](http://blog.linoxide.com/wp-content/uploads/2015/11/configuring-github-drone-e1446835124465.png) + +### 6. 配置 SMTP 服务器 ### + +如果我们想让drone 使用email 发送通知,那么我们需要在SMTP 配置里面设置我们的SMTP 服务器。如果我们已经有了一个SMTP 服务,那就只需要简单的使用它的配置文件就行了,但是因为我们没有一个SMTP 服务器,我们需要安装一个MTA 比如Postfix,然后在drone 配置文件里配置好SMTP。 + +#### Ubuntu #### + +在ubuntu 里使用下面的apt 命令安装postfix。 + + # apt-get install postfix + +#### CentOS #### + +在CentOS 里使用下面的yum 命令安装postfix。 + + # yum install postfix + +安装好之后,我们需要编辑我们的postfix 配置文件。 + + # nano /etc/postfix/main.cf + +然后我们要把myhostname 的值替换为我们自己的FQDN,比如drone.linoxide.com。 + + myhostname = drone.linoxide.com + +现在开始配置drone 配置文件里的SMTP 部分。 + + # nano /etc/drone/drone.toml + +找到`[smtp]` 部分补充上下面的内容。 + + [smtp] + host = "drone.linoxide.com" + port = "587" + from = "root@drone.linoxide.com" + user = "root" + pass = "password" + +![Configuring SMTP Drone](http://blog.linoxide.com/wp-content/uploads/2015/11/configuring-smtp-drone.png) + +注意:这里的**user** 和 **pass** 参数强烈推荐一定要改成一个用户的配置。 + +### 7. 配置 Worker ### + +如我们所知的drone 利用了docker 完成构建、测试任务,我们需要把docker 配置为drone 的worker。要完成这些需要修改drone 配置文件里的`[worker]` 部分。 + + # nano /etc/drone/drone.toml + +然后取消底下几行的注释并且补充上下面的内容。 + + [worker] + nodes=[ + "unix:///var/run/docker.sock", + "unix:///var/run/docker.sock" + ] + +这里我们只设置了两个节点,这意味着上面的配置文件只能同时执行2 个构建操作。要提高并发性可以增大节点的值。 + + [worker] + nodes=[ + "unix:///var/run/docker.sock", + "unix:///var/run/docker.sock", + "unix:///var/run/docker.sock", + "unix:///var/run/docker.sock" + ] + +使用上面的配置文件drone 被配置为使用本地的docker 守护程序可以同时构建4个任务。 + +### 8. 重启 Drone ### + +最后,当所有的安装和配置都准备好之后,我们现在要在本地的linux 机器上启动drone 服务器。 + +#### Ubuntu #### + +因为ubuntu 14.04 使用了sysvinit 作为默认的init 系统,所以只需要简单执行下面的service 命令就可以启动drone 了。 + + # service drone restart + +要让drone 在系统启动时也自动运行,需要运行下面的命令。 + + # update-rc.d drone defaults + +#### CentOS #### + +因为CentOS 7使用systemd 作为init 系统,所以只需要运行下面的systemd 命令就可以重启drone。 + + # systemctl restart drone + +要让drone 自动运行只需要运行下面的命令。 + + # systemctl enable drone + +### 9. 添加防火墙例外 ### + +众所周知drone 默认使用了80 端口而我们又没有修改他,所以我们需要配置防火墙程序允许80 端口(http)开发并允许其他机器可以通过网络连接。 + +#### Ubuntu 14.04 #### + +iptables 是最流行的防火墙程序,并且ubuntu 默认安装了它。我们需要修改iptable 暴露端口80,这样我们才能让drone 的web 界面在网络上被大家访问。 + + # iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT + # /etc/init.d/iptables save + +#### CentOS 7 #### + +因为CentOS 7 默认安装了systemd,它使用firewalld 作为防火墙程序。为了在firewalld 上打开80端口(http 服务),我们需要执行下面的命令。 + + # firewall-cmd --permanent --add-service=http + + success + + # firewall-cmd --reload + + success + +### 10. 访问web 界面 ### + +现在我们将在我们最喜欢的浏览器上通过web 界面打开drone。要完成这些我们要把浏览器指向运行drone 的服务器。因为drone 默认使用80 端口而我们有没有修改过,所以我们只需要在浏览器里根据我们的配置输入`http://ip-address/` 或 `http://drone.linoxide.com` 就行了。在我们正确的完成了上述操作后,我们就可以看到登陆界面了。 + +![Login Github Drone](http://blog.linoxide.com/wp-content/uploads/2015/11/login-github-drone-e1446834688394.png) + +因为在上面的步骤里配置了Github,我们现在只需要简单的选择github然后进入应用授权步骤,这些完成后我们就可以进入工作台了。 + +![Drone Dashboard](http://blog.linoxide.com/wp-content/uploads/2015/11/drone-dashboard.png) + +这里它会同步我们在github 上的代码库,然后询问我们要在drone 上构建那个代码库。 + +![Activate Repository](http://blog.linoxide.com/wp-content/uploads/2015/11/activate-repository-e1446835574595.png) + +这一步完成后,它会询问我们在代码库里添加`.drone.yml` 文件的新名称,并且在这个文件里定义构建的过程和配置项,比如使用那个docker 镜像,执行那些命令和脚本来编译,等等。 + +我们按照下面的内容来配置我们的`.drone.yml`。 + + image: python + script: + - python helloworld.py + - echo "Build has been completed." + +这一步完成后我们就可以使用drone 应用里的YAML 格式的配置文件来构建我们的应用了。所有对代码库的提交和改变此时都会同步到这个仓库。一旦提交完成了,drone 就会自动开始构建。 + +![Building Application Drone](http://blog.linoxide.com/wp-content/uploads/2015/11/building-application-drone.png) + +所有操作都完成后,我们就能在终端看到构建的结果了。 + +![Build Success Drone](http://blog.linoxide.com/wp-content/uploads/2015/11/build-success-drone.png) + +### 总结 ### + +在本文中我们学习了如何安装一个可以工作的使用drone 的持续集成平台。如果我们愿意我们甚至可以从drone.io 官方提供的服务开始工作。我们可以根据自己的需求从免费的服务或者收费服务开始。它通过漂亮的web界面和强大的功能改变了持续集成的世界。它可以集成很多第三方应用和部署平台。如果你有任何问题、建议可以直接反馈给我们,谢谢。 + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/setup-drone-continuous-integration-linux/ + +作者:[Arun Pyasi][a] +译者:[ezio](https://github.com/oska874) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ +[1]:https://drone.io/ +[2]:http://downloads.drone.io/master/drone.deb +[3]:http://downloads.drone.io/master/drone.rpm +[4]:https://github.com/settings/developers From 18e544593361a1402e06b276ad9720113eee2261 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 27 Dec 2015 15:20:30 +0800 Subject: [PATCH 0059/1469] =?UTF-8?q?20151227-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ubuntu,mobile,os --- ...0151227 Ubuntu Touch, three years later.md | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 sources/tech/20151227 Ubuntu Touch, three years later.md diff --git a/sources/tech/20151227 Ubuntu Touch, three years later.md b/sources/tech/20151227 Ubuntu Touch, three years later.md new file mode 100644 index 0000000000..3d467163cf --- /dev/null +++ b/sources/tech/20151227 Ubuntu Touch, three years later.md @@ -0,0 +1,68 @@ +Back in early 2013, your editor [dedicated a sacrificial handset][2] to the testing of the then-new Ubuntu Touch distribution. At that time, things were so unbaked that the distribution came with mocked-up data for unready apps; it even came with a set of fake tweets. Nearly three years later, it seemed time to give Ubuntu Touch another try on another sacrificial device. This distribution has certainly made some progress in those years, but, sadly, it still seems far from being a competitive offering in this space. +In particular, your editor tested version 16.04r3 from the testing channel on a Nexus 4 handset. The Nexus 4 is certainly past its prime at the end of 2015, but it still functions as a credible Android device. It is, in any case, the only phone handset on [the list of supported devices][1] other than the three that were sold (in locations far from your editor's home) with Ubuntu Touch pre-installed. It is a bit discouraging that Ubuntu Touch is not supported on a more recent device; the Nexus 4 was discontinued over two years ago. + +People who are accustomed to putting strange systems on Nexus devices know the drill fairly well: unlock the bootloader, install a new recovery image if necessary, then use the **fastboot** tool to flash a new image. Ubuntu Touch does not work that way; instead, one must use a set of tools available only on the Ubuntu desktop distribution. Your editor's current menagerie of systems does not include any of those, but, fortunately, running the Ubuntu 15.10 distribution off a USB drive works just fine. It must be said, though, that Ubuntu appears not to have gotten the memo regarding high-DPI laptop displays; 15.10 is an exercise in eyestrain on such a device. + +Once the requisite packages have been installed, the **ubuntu-device-flash** command can be used to install Ubuntu Touch on the phone. It finds the installation image wherever Canonical hides them (it's not obvious where that is) and puts it onto the phone; the process, on the Nexus 4, took about three hours — a surprisingly long time. Among other things, it installs a Ubuntu-specific recovery image, regardless of whether that should be necessary or not. The installation takes up about 4.5GB of space on the device. At the end, the phone reboots and comes up with the Ubuntu Touch lock screen, which has changed little in the last three years. The first boot takes a discouragingly long time, but subsequent reboots are faster, perhaps faster than Android on the same device. + +Alas, that's about the only thing that is faster than Android. The phone starts sluggish and gets worse as time goes on. At one point it took a solid minute to get the dialer screen up on the running device. Scrolling can be jerky and unpleasant to work with. At least once, the phone bogged down to the point that there was little alternative to shutting it down and starting over. + +Logging into the device over the USB connection offers some clues as to why that might be. There were no less than 258 processes running on the system. A number of them have "evolution" in their name, which is never a good sign even on a heftier system. Daemons like NetworkManager and pulseaudio are running. In general, Ubuntu Touch seems to have a large number of relatively large moving parts, leading, seemingly, to memory pressure and a certain amount of thrashing. + +Three years ago, Ubuntu Touch was built on an Android chassis. There are still bits of Android that show up here and there (it uses binder, for example), but a number of those components have been replaced. This release runs an Android-derived kernel that identifies itself as "3.4.0-7 #39-Ubuntu". 3.4.0 was released in May 2012, so it is getting a bit long in the tooth; the 3.4.0 number suggests this kernel hasn't even gotten the stable updates that followed that release. Finding the source for the kernel in this distribution is not easy; it must almost certainly be hidden somewhere in this Gerrit repository, but your editor ran out of time while trying to find it. The SurfaceFlinger display manager has been replaced by Ubuntu's own Mir, with Unity providing the interface. Upstart is the init system, despite the fact that Ubuntu has moved to systemd on desktop systems. + +When one moves beyond the command-line interface and starts playing with the touchscreen, one finds that the basics of the interface resemble what was demonstrated three years ago. Swiping from the left edge brings the [Overview screen] Unity icon bar (but no longer switches to a home screen; the "home screen" concept doesn't really seem to exist anymore). Swiping from the right will either switch to another application or produce an overview of running applications; it's not clear how it decides which. The overview provides a cute oblique view of the running applications; it's sufficient to choose one, but seems somewhat wasteful of screen space. Swiping up from the bottom produces an application-specific menu — usually. + +![][3] + + +The swipe gestures work well enough once one gets used to them, but there is scope for confusion. The camera app, for example, will instruct the user to "swipe left for photo roll," but, unless one is careful to avoid [Swipe left] the right edge of the screen, that gesture will yield the overview screen instead. One can learn subtleties like "swipes involving the edge" and "swipes avoiding the edge," but one could argue that such an interface is more difficult than it needs to be and less discoverable than it could be. + +![][4] + +Speaking of the camera app, it takes pictures as one might expect, and it has gained a high-dynamic-range mode in recent years. It still has no support for stitching together photos in a panorama or "photo sphere" mode, though. + +![][5] + +The base distribution comes with a fairly basic set of apps. Many of them appear to be interfaces to an associated web page; the Amazon, GMail, and Facebook apps, for example. Something called "Shorts" appears to be an RSS reader, though it seems impervious to the addition of arbitrary feeds. There is a terminal app, but it prompts for a password — a bit surprising [Terminal emulator] given that no password had ever been supplied for the device (it turns out that one should use the screen-lock PIN here). It's not clear that this extra level of "security" is helpful, given that the user involved is already able to install, launch, and run applications on the device, but so it goes. + +Despite the presence of all those evolution processes, there is no IMAP-capable email app; there are also no mapping apps. There is a rudimentary web browser with Ubuntu branding; it appears that this browser is based on Chromium. The weather app is limited to a few dozen hardwired locations worldwide; the closest supported location to LWN headquarters was Houston, which, one assumes, is unlikely to be dealing with the foot of snow your editor had to shovel while partway through this article. One suspects we would have heard about that. + +![][6] + +Inevitably, there is a store from which one can obtain other apps. There are, for example, a couple of seemingly capable, OpenStreetMap-based mapping apps there, including one that claims turn-by-turn navigation, but nothing requiring GPS access worked in your editor's tests. Games abound, of course, but [Maps] there is little in the way of apps that are well known in the Android or iOS worlds. The store will refuse to allow the installation of apps until one creates a "Ubuntu One" account; that is unfortunate, but most Android users never get anywhere near that far before having to create or supply a Google account. + +![][7] + +Canonical puts a fair amount of energy into promoting its "scopes," which are said to be better than apps for the aggregation of content. In truth, they seem to just be another type of app with a focus on gathering information from more than one source. Although, with "branded scopes," the "more than one source" part is often deliberately put by the wayside. Your editor played around with scopes for a while, but, in truth, could not find what was supposed to make them special. + +Permissions management in Ubuntu Touch resembles that found in recent Android releases: the user will be prompted the first time an application tries to exercise a specific privilege. As with Android, the number of [Permissions request] actions requiring privilege is relatively small, and "connect to any arbitrary site on the Internet" is not among them. Access to location information or the camera, though, will generate a prompt. There is also, again as with Android, a way to control which applications are allowed to place notifications on the screen. + +Ubuntu Touch still seems to drain the battery far more quickly than Android does on the same device. Indeed, it is barely able to get through the night while sitting idle. There is a cute battery app that offers a couple of "ways to reduce battery use," but it lacks Android's ability to say which apps are actually draining the battery (though, it must be said, that information from Android is often less helpful than one might hope). + +![][8] + +The keyboard now has proper multi-lingual support (though there is no visual indication of which language is currently in effect) and, as with Android, one can switch between languages on the fly. It offers word suggestions, does [Keyboard] spelling correction, and all the usual things. One missing feature, though, is "swipe" typing which, your editor has found, can speed the process of inputting text on a small keyboard considerably. There is also no voice input; no major loss from your editor's point of view, but others will probably see that differently. + +There is a lot to like in Ubuntu Touch. There is some appeal to running something that looks like a proper Linux system, even if it still has a number of Ubuntu-specific components. One does not get the sense that the device is watching quite as closely as Android devices do, though it's not entirely clear, for example, what happens with location data or where it might be stored. In any case, a Ubuntu device clearly has more free software on it than most alternatives do; there is no proprietary "play services" layer maintaining control over the system. + +Sadly, though, this distribution still is not up to the capabilities and the performance of the big alternatives. Switching to Ubuntu Touch means settling for a much slower system, running on a severely limited set of devices, with a relative scarcity of apps to choose from. Your editor would very much like to see a handset distribution that is more free and more open than the alternatives, but that distribution must also be competitive with those alternatives, and that does not seem to be the case here. Unless Canonical can find a way to close the performance and feature gaps with Android, it seems unlikely to have much hope of achieving uptake that is within a few orders of magnitude of Android's. + +-------------------------------------- + +via: https://lwn.net/Articles/667983/ + +作者:Jonathan Corbet +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]: https://developer.ubuntu.com/en/start/ubuntu-for-devices/devices/ +[2]: https://lwn.net/Articles/540138/ +[3]: https://static.lwn.net/images/2015/utouch/overview-sm.png +[4]: https://static.lwn.net/images/2015/utouch/camera-swipe-sm.png +[5]: https://static.lwn.net/images/2015/utouch/terminal.png +[6]: https://static.lwn.net/images/2015/utouch/gps-sm.png +[7]: https://static.lwn.net/images/2015/utouch/camera-perm.png +[8]: https://static.lwn.net/images/2015/utouch/schifo.png From 6a2109b8d1636bb7ebf4c2f3b821c503e79fde34 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 27 Dec 2015 15:38:11 +0800 Subject: [PATCH 0060/1469] =?UTF-8?q?20151227-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit debian --- ...227 Upheaval in the Debian Live project.md | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 sources/talk/20151227 Upheaval in the Debian Live project.md diff --git a/sources/talk/20151227 Upheaval in the Debian Live project.md b/sources/talk/20151227 Upheaval in the Debian Live project.md new file mode 100644 index 0000000000..d663d09b17 --- /dev/null +++ b/sources/talk/20151227 Upheaval in the Debian Live project.md @@ -0,0 +1,66 @@ +While the event had a certain amount of drama surrounding it, the [announcement][1] of the end for the [Debian Live project][2] seems likely to have less of an impact than it first appeared. The loss of the lead developer will certainly be felt—and the treatment he and the project received seems rather baffling—but the project looks like it will continue in some form. So Debian will still have tools to create live CDs and other media going forward, but what appears to be a long-simmering dispute between project founder and leader Daniel Baumann and the Debian CD and installer teams has been "resolved", albeit in an unfortunate fashion. + +The November 9 announcement from Baumann was titled "An abrupt End to Debian Live". In that message, he pointed to a number of different events over the nearly ten years since the [project was founded][3] that indicated to him that his efforts on Debian Live were not being valued, at least by some. The final straw, it seems, was an "intent to package" (ITP) bug [filed][4] by Iain R. Learmonth that impinged on the namespace used by Debian Live. + +Given that one of the main Debian Live packages is called "live-build", the new package's name, "live-build-ng", was fairly confrontational in and of itself. Live-build-ng is meant to be a wrapper around the [vmdebootstrap][5] tool for creating live media (CDs and USB sticks), which is precisely the role Debian Live is filling. But when Baumann [asked][6] Learmonth to choose a different name for his package, he got an "interesting" [reply][7]: + +``` +It is worth noting that live-build is not a Debian project, it is an external project that claims to be an official Debian project. This is something that needs to be fixed. +There is no namespace issue, we are building on the existing live-config and live-boot packages that are maintained and bringing these into Debian as native projects. If necessary, these will be forks, but I'm hoping that won't have to happen and that we can integrate these packages into Debian and continue development in a collaborative manner. +live-build has been deprecated by debian-cd, and live-build-ng is replacing it. In a purely Debian context at least, live-build is deprecated. live-build-ng is being developed in collaboration with debian-cd and D-I [Debian Installer]. +``` + +Whether or not Debian Live is an "official" Debian project (or even what "official" means in this context) has been disputed in the thread. Beyond that, though, Neil Williams (who is the maintainer of vmdebootstrap) [provided some][8] explanation for the switch away from Debian Live: + +``` +vmdebootstrap is being extended explicitly to provide support for a replacement for live-build. This work is happening within the debian-cd team to be able to solve the existing problems with live-build. These problems include reliability issues, lack of multiple architecture support and lack of UEFI support. vmdebootstrap has all of these, we do use support from live-boot and live-config as these are out of the scope for vmdebootstrap. +``` + +Those seem like legitimate complaints, but ones that could have been fixed within the existing project. Instead, though, something of a stealth project was evidently undertaken to replace live-build. As Baumann [pointed out][9], nothing was posted to the debian-live mailing list about the plans. The ITP was the first notice that anyone from the Debian Live project got about the plans, so it all looks like a "secret plan"—something that doesn't sit well in a project like Debian. + +As might be guessed, there were multiple postings that supported Baumann's request to rename "live-build-ng", followed by many that expressed dismay at his decision to stop working on Debian Live. But Learmonth and Williams were adamant that replacing live-build is needed. Learmonth did [rename][10] live-build-ng to a perhaps less confrontational name: live-wrapper. He noted that his aim had been to add the new tool to the Debian Live project (and "bring the Debian Live project into Debian"), but things did not play out that way. + +``` +I apologise to everyone that has been upset by the ITP bug. The software is not yet ready for use as a full replacement for live-build, and it was filed to let people know that the work was ongoing and to collect feedback. This sort of worked, but the feedback wasn't the kind I was looking for. +``` + +The backlash could perhaps have been foreseen. Communication is a key aspect of free-software communities, so a plan to replace the guts of a project seems likely to be controversial—more so if it is kept under wraps. For his part, Baumann has certainly not been perfect—he delayed the "wheezy" release by [uploading an unsuitable syslinux package][11] and [dropped down][12] from a Debian Developer to a Debian Maintainer shortly thereafter—but that doesn't mean he deserves this kind of treatment. There are others involved in the project as well, of course, so it is not just Baumann who is affected. + +One of those other people is Ben Armstrong, who has been something of a diplomat during the event and has tried to smooth the waters. He started with a [post][13] that celebrated the project and what Baumann and the team had accomplished over the years. As he noted, the [list of downstream projects][14] for Debian Live is quite impressive. In another post, he also [pointed out][15] that the project is not dead: + +``` +If the Debian CD team succeeds in their efforts and produces a replacement that is viable, reliable, well-tested, and a suitable candidate to replace live-build, this can only be good for Debian. If they are doing their job, they will not "[replace live-build with] an officially improved, unreliable, little-tested alternative". I've seen no evidence so far that they operate that way. And in the meantime, live-build remains in the archive -- there is no hurry to remove it, so long as it remains in good shape, and there is not yet an improved successor to replace it. +``` + +On November 24, Armstrong also [posted][16] an update (and to [his blog][17]) on Debian Live. It shows some good progress made in the two weeks since Baumann's exit; there are even signs of collaboration between the project and the live-wrapper developers. There is also a [to-do list][18], as well as the inevitable call for more help. That gives reason to believe that all of the drama surrounding the project was just a glitch—avoidable, perhaps, but not quite as dire as it might have seemed. + + +--------------------------------- + +via: https://lwn.net/Articles/665839/ + +作者:Jake Edge +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + + +[1]: https://lwn.net/Articles/666127/ +[2]: http://live.debian.net/ +[3]: https://www.debian.org/News/weekly/2006/08/ +[4]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804315 +[5]: http://liw.fi/vmdebootstrap/ +[6]: https://lwn.net/Articles/666173/ +[7]: https://lwn.net/Articles/666176/ +[8]: https://lwn.net/Articles/666181/ +[9]: https://lwn.net/Articles/666208/ +[10]: https://lwn.net/Articles/666321/ +[11]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=699808 +[12]: https://nm.debian.org/public/process/14450 +[13]: https://lwn.net/Articles/666336/ +[14]: http://live.debian.net/project/downstream/ +[15]: https://lwn.net/Articles/666338/ +[16]: https://lwn.net/Articles/666340/ +[17]: http://syn.theti.ca/2015/11/24/debian-live-after-debian-live/ +[18]: https://wiki.debian.org/DebianLive/TODO From b452657816c4fc4d47756724164d4a45a3b6c8c9 Mon Sep 17 00:00:00 2001 From: carolinewuyan <309866211@qq.com> Date: Sun, 27 Dec 2015 15:41:59 +0800 Subject: [PATCH 0061/1469] =?UTF-8?q?=E5=B7=B2=E6=A0=A1=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...to access Dropbox from the command line in Linux.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/translated/tech/20151123 How to access Dropbox from the command line in Linux.md b/translated/tech/20151123 How to access Dropbox from the command line in Linux.md index 6c5f73e596..9f9d1fd5ed 100644 --- a/translated/tech/20151123 How to access Dropbox from the command line in Linux.md +++ b/translated/tech/20151123 How to access Dropbox from the command line in Linux.md @@ -1,8 +1,8 @@ -Linux 中如何从命令行访问 Dropbox +Linux 中如何通过命令行访问 Dropbox ================================================================================ -在当今这个多设备的环境下,云存储无处不在。无论身处何方,人们都想通过多种设备来从云存储中获取所需的内容。由于优雅的 UI 和完美的跨平台兼容性,Dropbox 已成为最为广泛使用的云存储服务。 Dropbox 的流行已引发了一系列官方或非官方 Dropbox 客户端的出现,它们支持不同的操作系统平台。 +在当今这个多设备的环境下,云存储无处不在。无论身处何方,人们都想通过多种设备来从云存储中获取所需的内容。由于拥有漂亮的 UI 和完美的跨平台兼容性,Dropbox 已成为最为广泛使用的云存储服务。 Dropbox 的流行已引发了一系列官方或非官方 Dropbox 客户端的出现,它们支持不同的操作系统平台。 -当然 Linux 平台下也有着自己的 Dropbox 客户端: 既有命令行的,也有图形界面。[Dropbox Uploader][1] 是一个简单易用的 Dropbox 命令行客户端,它是用 BASH 脚本语言所编写的。在这篇教程中,我将描述 **在 Linux 中如何使用 Dropbox Uploader 通过命令行来访问 Dropbox**。 +当然 Linux 平台下也有着自己的 Dropbox 客户端: 既有命令行的,也有图形界面客户端。[Dropbox Uploader][1] 是一个简单易用的 Dropbox 命令行客户端,它是用 BASH 脚本语言所编写的。在这篇教程中,我将描述 **在 Linux 中如何使用 Dropbox Uploader 通过命令行来访问 Dropbox**。 ### Linux 中安装和配置 Dropbox Uploader ### @@ -13,7 +13,7 @@ Linux 中如何从命令行访问 Dropbox 请确保你已经在系统中安装了 `curl`,因为 Dropbox Uploader 通过 curl 来运行 Dropbox 的 API。 -要配置 Dropbox Uploader,只需运行 dropbox_uploader.sh 即可。当你第一次运行这个脚本时,它将询问你,以使得它可以访问你的 Dropbox 账户。 +要配置 Dropbox Uploader,只需运行 dropbox_uploader.sh 即可。当你第一次运行这个脚本时,它将请求得到授权以使得脚本可以访问你的 Dropbox 账户。 $ ./dropbox_uploader.sh @@ -88,7 +88,7 @@ via: http://xmodulo.com/access-dropbox-command-line-linux.html 作者:[Dan Nanni][a] 译者:[FSSlc](https://github.com/FSSlc) -校对:[校对者ID](https://github.com/校对者ID) +校对:[Caroline](https://github.com/carolinewuyan) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1ee6c0f1ae424aaabad83c2b099ee90ef16a2cb5 Mon Sep 17 00:00:00 2001 From: carolinewuyan <309866211@qq.com> Date: Sun, 27 Dec 2015 16:33:00 +0800 Subject: [PATCH 0062/1469] =?UTF-8?q?=E5=B7=B2=E6=A0=A1=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...everse Proxy for Apache on FreeBSD 10.2.md | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/translated/tech/20151126 How to Install Nginx as Reverse Proxy for Apache on FreeBSD 10.2.md b/translated/tech/20151126 How to Install Nginx as Reverse Proxy for Apache on FreeBSD 10.2.md index 83877c8488..abd69a9cab 100644 --- a/translated/tech/20151126 How to Install Nginx as Reverse Proxy for Apache on FreeBSD 10.2.md +++ b/translated/tech/20151126 How to Install Nginx as Reverse Proxy for Apache on FreeBSD 10.2.md @@ -1,9 +1,9 @@ - + 如何在FreeBSD 10.2上安装Nginx作为Apache的反向代理 ================================================================================ -Nginx是一款免费的,开源的HTTP和反向代理服务器, 以及一个代理POP3/IMAP的邮件服务器. Nginx是一款高性能的web服务器,其特点是丰富的功能,简单的结构以及低内存的占用. 第一个版本由 Igor Sysoev在2002年发布,然而到现在为止很多大的科技公司都在使用,包括 Netflix, Github, Cloudflare, WordPress.com等等 +Nginx是一款免费的开源HTTP和反向代理服务器, 以及一个POP3/IMAP的邮件代理服务器。Nginx是一款高性能的web服务器,其特点是丰富的功能,简单的结构以及低内存的占用. 第一个版本由 Igor Sysoev在2002年发布,迄今为止很多大的科技公司依然在使用,包括 Netflix, Github, Cloudflare, WordPress.com等等。 -在这篇教程里我们会 "**在freebsd 10.2系统上,安装和配置Nginx网络服务器作为Apache的反向代理**". Apache 会用PHP在8080端口上运行,并且我们需要在80端口配置Nginx的运行,用来接收用户/访问者的请求.如果网页的用户请求来自于浏览器的80端口, 那么Nginx会用Apache网络服务器和PHP来通过这个请求,并运行在8080端口. +在这篇教程里我们会 "**在freebsd 10.2系统上,安装和配置Nginx网络服务器作为Apache的反向代理**". Apache 会用PHP在8080端口上运行,并且我们需要在80端口配置Nginx的运行,用来接收用户/访问者的请求.如果网页的用户请求来自于浏览器的80端口, 那么Nginx会用Apache网络服务器和PHP来通过这个请求,并运行在8080端口。 #### 前提条件 #### @@ -19,7 +19,7 @@ Nginx是一款免费的,开源的HTTP和反向代理服务器, 以及一个代 ### 步骤 2 - 安装 Apache ### -Apache是现在使用范围最广的网络服务器以及开源的HTTP服务器.在FreeBSD里Apache是未被默认安装的, 但是我们可以直接从端口下载,或者解压包在"/usr/ports/www/apache24" 目录下,再或者直接从PKG命令的FreeBSD系统信息库安装。在本教程中,我们将使用PKG命令从FreeBSD的库中安装: +Apache是现在使用范围最广的web服务器以及开源的HTTP服务器.在FreeBSD里Apache是未被默认安装的, 但是我们可以直接通过端口或者在"/usr/ports/www/apache24" 目录下的解压包安装,再或者直接从PKG命令的FreeBSD系统信息库安装。在本教程中,我们将使用PKG命令从FreeBSD的库中安装: pkg install apache24 @@ -31,7 +31,7 @@ Apache是现在使用范围最广的网络服务器以及开源的HTTP服务器. ### 步骤 4 - 配置 Apache 和 PHP ### -一旦所有都安装好了, 我们将会配置Apache在8080端口上运行, 并让PHP与Apache一同工作. 为了配置Apache,我们可以编辑 "httpd.conf"这个配置文件, 然而PHP我们只需要复制PHP的配置文件 php.ini 在 "/usr/local/etc/"目录下. +一旦所有都安装好了, 我们将会配置Apache在8080端口上运行, 并让PHP与Apache一同工作. 要想配置Apache,我们可以编辑 "httpd.conf"这个配置文件, 然而PHP我们只需要复制"/usr/local/etc/"目录下的PHP配置文件 php.ini 。 进入到 "/usr/local/etc/" 目录 并且复制 php.ini-production 文件到 php.ini : @@ -64,7 +64,7 @@ Apache是现在使用范围最广的网络服务器以及开源的HTTP服务器. SetHandler application/x-httpd-php-source -保存然后退出. +保存并退出。 现在用sysrc命令,来添加Apache作为开机启动项目 : @@ -78,7 +78,7 @@ Apache是现在使用范围最广的网络服务器以及开源的HTTP服务器. service apache24 start -如果全部完毕, 在"/usr/local/www/apache24/data" 目录下,创建一个phpinfo文件是验证PHP在Apache下完美运行的好方法 : +如果全部完毕, 在"/usr/local/www/apache24/data" 目录下创建一个phpinfo文件来验证PHP在Apache下完美运行: cd /usr/local/www/apache24/data echo "" > info.php @@ -87,17 +87,17 @@ Apache是现在使用范围最广的网络服务器以及开源的HTTP服务器. ![Apache and PHP on Port 8080](http://blog.linoxide.com/wp-content/uploads/2015/11/Apache-and-PHP-on-Port-8080.png) -Apache 是使用 PHP 在 8080端口下运行的. +Apache 是使用 PHP 在 8080 端口下运行的。 ### 步骤 5 - 安装 Nginx ### -Nginx 以低内存的占用作为一款高性能的web服务器以及反向代理服务器.在这个步骤里,我们将会使用Nginx作为Apache的反向代理, 因此让我们用pkg命令来安装它吧 : +Nginx 以低内存的占用作为一款高性能的web服务器以及反向代理服务器。在这个步骤里,我们将会使用Nginx作为Apache的反向代理, 因此让我们用pkg命令来安装它吧 : pkg install nginx ### 步骤 6 - 配置 Nginx ### -一旦 Nginx 安装完毕, 在 "**nginx.conf**" 文件里,我们需要做一个新的配置文件来替换掉原来的nginx文件. 更改到 "/usr/local/etc/nginx/"目录下 并且默认备份到 nginx.conf 文件: +一旦 Nginx 安装完毕, 在 "**nginx.conf**" 文件里,我们需要做一个新的配置文件来替换掉原来的nginx文件。更改到 "/usr/local/etc/nginx/"目录下,并且备份默认 nginx.conf 文件: cd /usr/local/etc/nginx/ mv nginx.conf nginx.conf.oroginal @@ -164,7 +164,7 @@ Nginx 以低内存的占用作为一款高性能的web服务器以及反向代 } -保存退出. +保存并退出。 下一步, 在nginx目录下面,创建一个 **proxy.conf** 文件,使其作为反向代理 : @@ -186,7 +186,7 @@ Nginx 以低内存的占用作为一款高性能的web服务器以及反向代 proxy_buffers 100 8k; add_header X-Cache $upstream_cache_status; -保存退出. +保存并退出. 最后一步, 为 nginx 的高速缓存创建一个 "/var/nginx/cache"的新目录 : @@ -194,14 +194,14 @@ Nginx 以低内存的占用作为一款高性能的web服务器以及反向代 ### 步骤 7 - 配置 Nginx 的虚拟主机 ### -在这个步骤里面,我们需要创建一个新的虚拟主机域 "saitama.me", 以跟文件 "/usr/local/www/saitama.me" 和日志文件一同放在 "/var/log/nginx" 目录下. +在这个步骤里面,我们需要创建一个新的虚拟主机域 "saitama.me", 以跟文件 "/usr/local/www/saitama.me" 和日志文件一同放在 "/var/log/nginx" 目录下。 我们必须做的第一件事情就是创建新的目录来存放虚拟主机文件, 在这里我们将用到一个"**vhost**"的新文件. 并创建它 : cd /usr/local/etc/nginx/ mkdir vhost -创建好vhost 目录, 那么我们就进入这个目录并创建一个新的虚拟主机文件. 这里我取名为 "**saitama.conf**" : +创建好vhost 目录, 那么我们就进入这个目录并创建一个新的虚拟主机文件。这里我取名为 "**saitama.conf**" : cd vhost/ nano -c saitama.conf @@ -252,7 +252,7 @@ Nginx 以低内存的占用作为一款高性能的web服务器以及反向代 } -保存退出. +保存并退出。 下一步, 为nginx和虚拟主机创建一个新的日志目录 "/var/log/" : @@ -265,7 +265,7 @@ Nginx 以低内存的占用作为一款高性能的web服务器以及反向代 ### 步骤 8 - 测试 ### -在这个步骤里面,我们只是测试我们的nginx和虚拟主机的配置. +在这个步骤里面,我们只是测试我们的nginx和虚拟主机的配置。 用如下命令测试nginx的配置 : @@ -282,37 +282,37 @@ Nginx 以低内存的占用作为一款高性能的web服务器以及反向代 cd /usr/local/www/saitama.me echo "" > info.php -然后便访问这个文档 : **www.saitama.me/info.php**. +然后访问这个域名 : **www.saitama.me/info.php**. ![Virtualhost Configured saitamame](http://blog.linoxide.com/wp-content/uploads/2015/11/Virtualhost-Configured-saitamame.png) -Nginx 作为Apache的反向代理正在运行了,PHP也同样在进行工作了. +Nginx 作为Apache的反向代理正在运行了,PHP也同样在进行工作了。 这是另一种结果 : -Test .html 文件无缓存. +无缓存的 Test .html 文件。 curl -I www.saitama.me ![html with no-cache](http://blog.linoxide.com/wp-content/uploads/2015/11/html-with-no-cache.png) -Test .css 文件只有三十天的缓存. +有三十天缓存的 Test .css 文件。 curl -I www.saitama.me/test.css ![css file 30day cache](http://blog.linoxide.com/wp-content/uploads/2015/11/css-file-30day-cache.png) -Test .php 文件正常缓存 : +正常缓存的 Test .php 文件: curl -I www.saitama.me/info.php ![PHP file cached](http://blog.linoxide.com/wp-content/uploads/2015/11/PHP-file-cached.png) -全部完成. +全部完成。 ### 总结 ### -Nginx 是最广泛的 HTTP 和反向代理的服务器. 拥有丰富的高性能和低内存/RAM的使用功能. Nginx使用了太多的缓存, 我们可以在网络上缓存静态文件使得网页加速, 并且在用户需要的时候再缓存php文件. 这样Nginx 的轻松配置和使用,可以让它用作HTTP服务器 或者 apache的反向代理. +Nginx 是最受欢迎的 HTTP 和反向代理服务器,拥有丰富的高性能和低内存/RAM的使用功能。Nginx使用了太多的缓存, 我们可以在网络上缓存静态文件使得网页加速,并且在用户需要的时候再缓存php文件。这样 Nginx 的轻松配置和使用可以让它用作HTTP服务器或者 apache的反向代理。 -------------------------------------------------------------------------------- @@ -320,8 +320,8 @@ via: http://linoxide.com/linux-how-to/install-nginx-reverse-proxy-apache-freebsd 作者:[Arul][a] 译者:[KnightJoker](https://github.com/KnightJoker) -校对:[校对者ID](https://github.com/校对者ID) +校对:[Caroline(https://github.com/carolinewuyan) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://linoxide.com/author/arulm/ \ No newline at end of file +[a]:http://linoxide.com/author/arulm/ From 41ac956f62c46c7e2f7719810ca07aa22d905e4c Mon Sep 17 00:00:00 2001 From: GHLandy Date: Sun, 27 Dec 2015 16:43:39 +0800 Subject: [PATCH 0063/1469] Create Part 2 - LFCS: How to Install and Use vi or vim as a Full Text Editor.md --- ...and Use vi or vim as a Full Text Editor.md | 392 ++++++++++++++++++ 1 file changed, 392 insertions(+) create mode 100644 translated/tech/LFCS/Part 2 - LFCS: How to Install and Use vi or vim as a Full Text Editor.md diff --git a/translated/tech/LFCS/Part 2 - LFCS: How to Install and Use vi or vim as a Full Text Editor.md b/translated/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..e300edbb99 --- /dev/null +++ b/translated/tech/LFCS/Part 2 - LFCS: How to Install and Use vi or vim as a Full Text Editor.md @@ -0,0 +1,392 @@ +GHLandy Translated + +LFCS系列第二讲:如何安装和使用纯文本编辑器vi/vim + +================================================================================ + +几个月前, Linux 基金会发起了 LFCS (Linux 基金会认证系统管理员)认证,以帮助世界各地的人来验证他们能够在 Linux 系统上做基本的中间系统管理任务:如系统支持,第一手的故障诊断和维修,以及何时向上游支持团队提出问题的智能决策。 + +![Learning VI Editor in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/LFCS-Part-2.png) + +在 Linux 中学习 vi 编辑器 + +请简要看看一下视频,里边介绍了 Linux 基金会认证的程序。 + +注:youtube 视频 + + + +这篇文章是十个tutorial系列的第二部分,在这个部分,我们会介绍 vi/vim 基本的文件编辑操作和理解编辑器中的(三个)模式,这是LFCS认证考试中必须掌握的。 + +### 使用 vi/vim 执行基本的文件编辑操作 ### + +vi 是为了 Unix 而被编写的第一个全屏文本编辑器。由于它被设计得小巧而简单,对于只使用图形界面编辑器,举几个例子,如 NotePad++ 或者 gedit 的那些人来说,使用起来可能存在一些困难。 + +为了使用 vi,我们必须首先理解这个强大的程序操作中的3种模式,方便我们后边学习这个强大文本处理软件的相关操作。 + +请注意,大多数的现代 Linux 发行版都集成了 vi 的变种——— vim(vi升级版),相比于 vi,它有更多新功能。由于这个原因,我们会在本教程中交替使用 vi 和 vim。 + +如果你的发行版还没有安装 vim,你可以通过以下方法来安装: + +- Ubuntu 及其衍生版:apt-get update && apt-get install vim +- 以 Red-Hat 为基础的发行版:yum update && yum install vim +- openSUSE :zypper update && zypper install vim + +### 我为什么要学习 vi ### + +至少有以下两点好理由: + +1.(不管你使用什么发行版)vi 总是可用的,因为它是 POSIX 所要求的。 + +2.vi 基本不消耗多少系统资源,并且允许我们仅仅通过键盘来完成任何可能的任务。 + +此外,vi 有的非常广泛的内置 manual 帮助,程序打开后就可以通过 :help 命令来查看。这个内置 manual 帮助比 vi/vim 的 man 页面包含了更多信息。 + +![vi Man Pages](http://www.tecmint.com/wp-content/uploads/2014/10/vi-man-pages.png) + +vi Man 页面 + +#### 启动 vi #### + +可以通过在命令提示符下输入 vi 来启动。 + +![Start vi Editor](http://www.tecmint.com/wp-content/uploads/2014/10/start-vi-editor.png) + +使用 vi 编辑器 + +然后按下字母 i,你就可以开始输入了。或者通过下面的方法来启动 vi: + + # vi filename + +这样会打开一个名为 filename 的 buffer(稍后详细介绍 buffer),在你编辑完成之后就可以存储在磁盘中了。 + +#### 理解 vi 的三个模式 #### + +1.在命令模式中,vi 允许用户浏览该文件并输入由一个或多个字母组成简短的、大小写敏感的 vi 命令。这些命令的大部分都可以增加一个前缀数字表示执行次数。 + +比如:yy(或Y) 复制当前的整行,3yy(或3Y) 复制当前整行和下边紧接着的两行(总共3行)。通过 Esc 键可以随时进入命令模式(而不管当前工作在什么模式下)。事实上,在命令模式下,键盘上所有的输入都被解释为命令而非文本,这往往使得初学者困惑不已。 + +2.在末行模式中,我们可以处理文件(包括保存当前文件和运行外部程序)。我们必须在命令模式下输入一个冒号(:),才能进入这个模式,紧接着是需要使用的末行模式下的命令。执行之后 vi 自动回到命令模式。 + +3.在文本输入模式(通常使用字母 i 进入这个模式)中,我们可以随意输入文本。大多数的键入将以文本形式输出到屏幕(一个重要的例外是Esc键,它将退出文本编辑模式并回到命令模式)。 + +![vi Insert Mode](http://www.tecmint.com/wp-content/uploads/2014/10/vi-insert-mode.png) + +vi 文本插入模式 + +#### vi 命令 #### + +下面的表格列出常用的 vi 命令。文件版本的命令可以通过添加叹号的命令强制执行(如,:q! 命令强制退出编辑器而不保存文件)。 + +注:表格 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 关键命令 描述
 h 或 ← 光标左移一个字符
 j 或 ↓ 光标下移一行
 k 或 ↑ 光标上移一行
 l (小写 L) 或 → 光标右移一个字符
 H 光标移至屏幕顶行
 L 光标移至屏幕末行
 G 光标移至文件末行
 w 光标右移一个词
 b 光标左移一个词
 0 (零) 光标移至行首
 ^ 光标移至当前行第一个非空格字符
 $ 光标移至当前行行尾
 Ctrl-B 向后翻页
 Ctrl-F 向前翻页
 i 在光标所在位置插入文本
 I (大写 i) 在当前行首插入文本
 J (大写 j) 将下一行与当前行合并(下一行上移到当前行)
 a 在光标所在位置后追加文本
 o (小写 O) 在当前行下边插入空白行
 O (大写 o) 在当前行上边插入空白行
 r 替换光标所在位置的字符
 R 光标所在位置覆盖插入文本
 x 删除光标所在位置的字符
 X 立即删除光标所在位置之前(左边)的一个字符
 dd 剪切当前整行文本(为了之后进行粘贴)
 D 剪切光标所在位置到行末的文本(该命令等效于 d$)
 yX 给 X 命令一个移动长度,复制适当数量的字符、单词或者从光标开始到一定数量的行
 yy 或 Y 复制当前整行
 p 粘贴在光标所在位置之后(下一行)
 P 粘贴在光标所在位置之前(上一行)
 . (句点) 重复最后一个命令
 u 撤销最后一个命令
 U 撤销最后一行的最后一个命令,只有光标仍在最后一行才能执行。
 n 在查找中跳到下一个匹配项
 N 在查找中跳到前一个匹配项
 :n 下一个文件,编辑多个指定文件时,该命令加载下一个文件。
 :e file 加载新文件来替代当前文件
 :r file 将新文件的内容插入到光标所在位置的下一行
 :q 退出并放弃更改
 :w file 将当期打开的buffer保存为file。如果是追加到已存在的文件中,则使用 :w >> file 命令
 :wq 保存当前文件的内容并退出。等效于 x! 和 ZZ
 :r! command 执行 command 命令,并将命令的输出插入到光标所在位置的下一行
+ +#### vi 选项 #### + +下列选项将会在启动 Vim 的时候进行加载(需要写入到~/.vimrc文件): + + # 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编辑器选项 + +- set number 当 vi 打开或新建文件时,显示行号。 +- syntax on 打开语法高亮(对应多个文件扩展名),以便源码文件和配置文件更具可读性。 +- set tabstop=4 设置制表符间距为 4 个空格(默认为 8)。 +- set autoindent 将前一行的缩进应用于下一行。 + +#### 查找和替换 #### + +vi 具有通过查找将光标移动到(在单独一行或者整个文件中的)指定位置。它还可自动或者通过用户确认来执行文本替换。 + +a) 在行内查找。f 命令在当前行查找指定字符,并将光标移动到指定字符出现的位置。 + +例如,命令 fh 会在本行中将光标实例字母h出现的位置。注意,字母 f 和你要查找的字符都不会出现在屏幕上,但是当你按下回车的时候,要查找的字符会被高亮显示。 + +比如,以下是在命令模式按下 f4 之后的结果。 + +![Search String in Vi](http://www.tecmint.com/wp-content/uploads/2014/10/vi-search-string.png) + +在 vi 中查找字符。 + +b) 在整个文件内查找。使用 / 命令,紧接着需要查找的单词或短语。这个查找可以通过使用 n 命令或者 N 重复查找上一个查找的字符串。以下是在命令模式键入 /Jane 的查找结果。 + +![Vi Search String in File](http://www.tecmint.com/wp-content/uploads/2014/10/vi-search-line.png) + +在vi中查找字符 + +c) vi 通过使用命令来完成多行或者整个文件的替换操作(类似于 sed)。我们可以使用一下命令,使得整个文件中的单词 “old” 替换为 “young”。 + + :%s/old/young/g + +**注意**:冒号位于命令的最前面。 + +![Vi Search and Replace](http://www.tecmint.com/wp-content/uploads/2014/10/vi-search-and-replace.png) + +vi 的查找和替换 + +冒号 (:) 进入末行模式,在本例中 s 表示替换,% 是从第一行到最后一行的表示方式(也可以使用 nm 表示范围,即第 n 行到第 m 行),old 是查找模式,young 是用来替换的文本,g 表示在每个查找出来的字符串都进行替换。 + +另外,在命令最后增加一个 c,可以在每一个匹配项替换前进行确认。 + + :%s/old/young/gc + +将就文本替换为新文本前,vi/vim 会想我们显示一下信息: + +![Replace String in Vi](http://www.tecmint.com/wp-content/uploads/2014/10/vi-replace-old-with-young.png) + +vi 中替换字符串 + +- y: 执行替换(yes) +- n: 跳过这个匹配字符的替换并转到下一个(no) +- a: 在当前匹配字符及后边的相同项全部执行替换 +- q 或 Esc: 取消替换 +- l (小写 L): 执行本次替换并退出 +- Ctrl-e, Ctrl-y: 下翻页,上翻页,查看相应的文本来进行替换 + +#### 同时编辑多个文件 #### + +我们在命令提示符输入 vim file1 file2 file3 如下: + + # vim file1 file2 file3 + +vim 会首先打开 file1,要跳到 file2 需用 :n 命令。当需要打开前一个文件时,:N 就可以了。 + +为了从 file1 跳到 file3 + +a) :buffers 命令会显示当前正在编辑的文件列表 + + :buffers + +![Edit Multiple Files](http://www.tecmint.com/wp-content/uploads/2014/10/vi-edit-multiple-files.png) + +编辑多个文件 + +b) :buffer 3 命令(后边没有 s)会打开 file 进行编辑。 + +在上边的图片中,标记符号 # 表示该文件当前已被打开在后台,而 %a 标记的文件是正在被编辑的。另外,文件号(如上边例子的 3)后边的空格表示该文件还没有被打开。 + +#### vi 的临时 buffers #### + +为了复制连续的多行(比如,假设为 4 行)到一个名为 a 的临时 buffer(与文件无关),并且还要将这些行粘贴到在当前 vi 会话文件中的其它位置,我们需要: + +1. 按下 Esc 键以确认 vi 处在命令模式 + +2. 将光标放在我们希望复制的第一行文本 + +3. 输入 a4yy 复制当前行和接下来的 3 行,进入一个名为 a 的 buffer。我们一继续编辑我们的文件————我们不需要立即插入刚刚复制的行。 + +4. 当到了需要使用刚刚复制行的位置,在 p(小写)或 P(大写)命令来讲复制行插入到名为 a 的 buffer: + +- 输入 ap,复制行将插入到光标位置所在行的下一行。 +- 输入 aP,复制行将插入到光标位置所在行的上一行。 + +如果愿意,我们可以重复上述步骤,将 buffer a 中的内容插入到我们文件的多个位置。一个临时 buffer,像本次会话中的一样,会在当前窗口关闭时释放掉。 + +### 总结 ### + +像我们看到的一样,vi/vim 在命令接口下是一个强大而灵活的文本编辑器。通过以下链接,随时分享你自己的技巧和评论。 + +#### 参考链接 #### + +- [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] +译者:[GHLandy](https://github.com/GHLandy) +校对:[校对者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 From f692f65f1e469169b649d4e9e82de825b1a5f938 Mon Sep 17 00:00:00 2001 From: GHLandy Date: Sun, 27 Dec 2015 16:45:39 +0800 Subject: [PATCH 0064/1469] Delete Part 2 - LFCS--How to Install and Use vi or vim as a Full Text Editor.md --- ...and Use vi or vim as a Full Text Editor.md | 389 ------------------ 1 file changed, 389 deletions(-) delete mode 100644 sources/tech/LFCS/Part 2 - LFCS--How to Install and Use vi or vim as a Full Text Editor.md 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 deleted file mode 100644 index 23e1b30f57..0000000000 --- a/sources/tech/LFCS/Part 2 - LFCS--How to Install and Use vi or vim as a Full Text Editor.md +++ /dev/null @@ -1,389 +0,0 @@ -GHLandy Translating - -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 From e76a60efe4a9f3de364a07217a8fcc69d1c835bd Mon Sep 17 00:00:00 2001 From: GHLandy Date: Sun, 27 Dec 2015 16:47:26 +0800 Subject: [PATCH 0065/1469] [Translating] Part 3 - LFCS--How to Archive or Compress Files and Directories Setting File Attributes and Finding Files in Linux. --- ...ries Setting File Attributes and Finding Files in Linux.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 82cc54a5a6..4b1d700c4e 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 @@ +GHLandy Translateing + 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. @@ -379,4 +381,4 @@ via: http://www.tecmint.com/compress-files-and-finding-files-in-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 +[6]:https://identity.linuxfoundation.org/user?destination=pid/1 From bf62ce04e50e36b18f3462b2cc1ecb34c7a8e242 Mon Sep 17 00:00:00 2001 From: dongfengweixiao Date: Sun, 27 Dec 2015 17:32:35 +0800 Subject: [PATCH 0066/1469] =?UTF-8?q?=E6=A0=A1=E5=AF=B9=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...and Use vi or vim as a Full Text Editor.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/translated/tech/LFCS/Part 2 - LFCS: How to Install and Use vi or vim as a Full Text Editor.md b/translated/tech/LFCS/Part 2 - LFCS: How to Install and Use vi or vim as a Full Text Editor.md index e300edbb99..c7f3d5140c 100644 --- a/translated/tech/LFCS/Part 2 - LFCS: How to Install and Use vi or vim as a Full Text Editor.md +++ b/translated/tech/LFCS/Part 2 - LFCS: How to Install and Use vi or vim as a Full Text Editor.md @@ -4,7 +4,7 @@ LFCS系列第二讲:如何安装和使用纯文本编辑器vi/vim ================================================================================ -几个月前, Linux 基金会发起了 LFCS (Linux 基金会认证系统管理员)认证,以帮助世界各地的人来验证他们能够在 Linux 系统上做基本的中间系统管理任务:如系统支持,第一手的故障诊断和维修,以及何时向上游支持团队提出问题的智能决策。 +几个月前, Linux 基金会发起了 LFCS (Linux Foundation Certified System administrator,Linux 基金会认证系统管理员)认证,以帮助世界各地的人来验证他们能够在 Linux 系统上做基本的中间系统管理任务:如系统支持,第一手的故障诊断和处理,以及何时向上游支持团队提出问题的智能决策。 ![Learning VI Editor in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/LFCS-Part-2.png) @@ -16,15 +16,15 @@ LFCS系列第二讲:如何安装和使用纯文本编辑器vi/vim -这篇文章是十个tutorial系列的第二部分,在这个部分,我们会介绍 vi/vim 基本的文件编辑操作和理解编辑器中的(三个)模式,这是LFCS认证考试中必须掌握的。 +这篇文章是《十个教程》系列的第二部分,在这个部分,我们会介绍 vi/vim 基本的文件编辑操作,帮助读者理解编辑器中的三个模式,这是LFCS认证考试中必须掌握的。 ### 使用 vi/vim 执行基本的文件编辑操作 ### -vi 是为了 Unix 而被编写的第一个全屏文本编辑器。由于它被设计得小巧而简单,对于只使用图形界面编辑器,举几个例子,如 NotePad++ 或者 gedit 的那些人来说,使用起来可能存在一些困难。 +vi 是为 Unix 而生的第一个全屏文本编辑器。它的设计小巧简单,对于仅仅使用过诸如 NotePad++ 或 gedit 等图形界面的文本编辑器的用户来说,使用起来可能存在一些困难。 -为了使用 vi,我们必须首先理解这个强大的程序操作中的3种模式,方便我们后边学习这个强大文本处理软件的相关操作。 +为了使用 vi,我们必须首先理解这个强大的程序操作中的三种模式,方便我们后边学习这个强大的文本处理软件的相关操作。 -请注意,大多数的现代 Linux 发行版都集成了 vi 的变种——— vim(vi升级版),相比于 vi,它有更多新功能。由于这个原因,我们会在本教程中交替使用 vi 和 vim。 +请注意,大多数的现代 Linux 发行版都集成了 vi 的变种——— vim(Vi IMproved,VI 的改进),相比于 vi,它有更多新功能。所以,我们会在本教程中交替使用 vi 和 vim。 如果你的发行版还没有安装 vim,你可以通过以下方法来安装: @@ -34,13 +34,13 @@ vi 是为了 Unix 而被编写的第一个全屏文本编辑器。由于它被 ### 我为什么要学习 vi ### -至少有以下两点好理由: +至少有以下两个理由: -1.(不管你使用什么发行版)vi 总是可用的,因为它是 POSIX 所要求的。 +1.因为它是 POSIX 标准的一部分,所以不管你使用什么发行版 vi 总是可用的。 2.vi 基本不消耗多少系统资源,并且允许我们仅仅通过键盘来完成任何可能的任务。 -此外,vi 有的非常广泛的内置 manual 帮助,程序打开后就可以通过 :help 命令来查看。这个内置 manual 帮助比 vi/vim 的 man 页面包含了更多信息。 +此外,vi 有的非常丰富的内置帮助手册,程序打开后就可以通过 :help 命令来查看。这个内置帮助手册比 vi/vim 的 man 页面包含了更多信息。 ![vi Man Pages](http://www.tecmint.com/wp-content/uploads/2014/10/vi-man-pages.png) @@ -298,7 +298,7 @@ b) 在整个文件内查找。使用 / 命令,紧接着需要查找的单词 在vi中查找字符 -c) vi 通过使用命令来完成多行或者整个文件的替换操作(类似于 sed)。我们可以使用一下命令,使得整个文件中的单词 “old” 替换为 “young”。 +c) vi 通过使用命令来完成多行或者整个文件的替换操作(类似于 sed)。我们可以使用以下命令,使得整个文件中的单词 “old” 替换为 “young”。 :%s/old/young/g @@ -382,7 +382,7 @@ via: http://www.tecmint.com/vi-editor-usage/ 作者:[Gabriel Cánepa][a] 译者:[GHLandy](https://github.com/GHLandy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[东风唯笑](https://github.com/dongfengweixiao) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 5a435541dd5f3b063f7bed2000c7f720dec68341 Mon Sep 17 00:00:00 2001 From: Bestony Date: Sun, 27 Dec 2015 17:50:27 +0800 Subject: [PATCH 0067/1469] Delete 20151013 DFileManager--Cover Flow File Manager.md DeleteFile --- ...3 DFileManager--Cover Flow File Manager.md | 64 ------------------- 1 file changed, 64 deletions(-) delete mode 100644 sources/tech/20151013 DFileManager--Cover Flow File Manager.md diff --git a/sources/tech/20151013 DFileManager--Cover Flow File Manager.md b/sources/tech/20151013 DFileManager--Cover Flow File Manager.md deleted file mode 100644 index c2f74987b4..0000000000 --- a/sources/tech/20151013 DFileManager--Cover Flow File Manager.md +++ /dev/null @@ -1,64 +0,0 @@ -translation by bestony -DFileManager: Cover Flow File Manager -================================================================================ -A real gem of a file manager absent from the standard Ubuntu repositories but sporting a unique feature. That’s DFileManager in a twitterish statement. - -A tricky question to answer is just how many open source Linux applications are available. Just out of curiosity, you can type at the shell: - - ~$ for f in /var/lib/apt/lists/*Packages; do printf ’%5d %s\n’ $(grep ’^Package: ’ “$f” | wc -l) ${f##*/} done | sort -rn - -On my Ubuntu 15.04 system, it produces the following results: - -![Ubuntu 15.04 Packages](http://www.linuxlinks.com/portal/content/reviews/FileManagers/UbuntuPackages.png) - -As the screenshot above illustrates, there are approximately 39,000 packages in the Universe repository, and around 8,500 packages in the main repository. These numbers sound a lot. But there is a smorgasbord of open source applications, utilities, and libraries that don’t have an Ubuntu team generating a package. And more importantly, there are some real treasures missing from the repositories which can only be discovered by compiling source code. DFileManager is one such utility. It is a Qt based cross-platform file manager which is in an early stage of development. Qt provides single-source portability across all major desktop operating systems. - -In the absence of a binary package, the user needs to compile the code. For some tools, this can be problematic, particularly if the application depends on any obscure libraries, or specific versions which may be incompatible with other software installed on a system. - -### Installation ### - -Fortunately, DFileManager is simple to compile. The installation instructions on the developer’s website provide most of the steps necessary for my creaking Ubuntu box, but a few essential packages were missing (why is it always that way however many libraries clutter up your filesystem?) To prepare my system, download the source code from GitHub and then compile the software, I entered the following commands at the shell: - - ~$ sudo apt-get install qt5-default qt5-qmake libqt5x11extras5-dev - ~$ git clone git://git.code.sf.net/p/dfilemanager/code dfilemanager-code - ~$ cd dfilemananger-code - ~$ mkdir build - ~$ cd build - ~$ cmake ../ -DCMAKE_INSTALL_PREFIX=/usr - ~$ make - ~$ sudo make install - -You can then start the application by typing at the shell: - - ~$ dfm - -Here is a screenshot of DFileManager in action, with the main attraction in full view; the Cover Flow view. This offers the ability to slide through items in the current folder with an attractive feel. It’s ideal for viewing photos. The file manager bears a resemblance to Finder (the default file manager and graphical user interface shell used on all Macintosh operating systems), which may appeal to you. - -![DFileManager in action](http://www.linuxlinks.com/portal/content/reviews/FileManagers/Screenshot-dfm.png) - -### Features: ### - -- 4 views: Icons, Details, Columns, and Cover Flow -- Categorised bookmarks with Places and Devices -- Tabs -- Simple searching and filtering -- Customizable thumbnails for filetypes including multimedia files -- Information bar which can be undocked -- Open folders and files with one click -- Option to queue IO operations -- Remembers some view properties for each folder -- Show hidden files - -DFileManager is not a replacement for KDE’s Dolphin, but do give it a go. It’s a file manager that really helps the user browse files. And don’t forget to give feedback to the developer; that’s a contribution anyone can offer. - --------------------------------------------------------------------------------- - -via: http://gofk.tumblr.com/post/131014089537/dfilemanager-cover-flow-file-manager-a-real-gem - -作者:[gofk][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://gofk.tumblr.com/ \ No newline at end of file From 768dcad8c69128b067af16359f5de8f420802fea Mon Sep 17 00:00:00 2001 From: Bestony Date: Sun, 27 Dec 2015 17:51:30 +0800 Subject: [PATCH 0068/1469] Create 20151013 DFileManager--Cover Flow File Manager.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 生成新的文件 --- ...3 DFileManager--Cover Flow File Manager.md | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 translated/tech/20151013 DFileManager--Cover Flow File Manager.md diff --git a/translated/tech/20151013 DFileManager--Cover Flow File Manager.md b/translated/tech/20151013 DFileManager--Cover Flow File Manager.md new file mode 100644 index 0000000000..39b376c113 --- /dev/null +++ b/translated/tech/20151013 DFileManager--Cover Flow File Manager.md @@ -0,0 +1,61 @@ +DFileManager:文件流文件管理器 +================================================================================ +一个像宝石一样的文件管理器从Ubuntu标准库中缺失,但是有器自己的独特的特色。DFileManager是一个推特一样的产品 + +一个很棘手的问题是,如何知道有多少个Linux开源软件可以被使用。出于好奇,你可以在Shell里输入如下命令 + + ~$ for f in /var/lib/apt/lists/*Packages; do printf ’%5d %s\n’ $(grep ’^Package: ’ “$f” | wc -l) ${f##*/} done | sort -rn + +在我的Ubuntu15.04系统上,会产生如下结果 +![Ubuntu 15.04 Packages](http://www.linuxlinks.com/portal/content/reviews/FileManagers/UbuntuPackages.png) + +正如上面的截图所示,在所有的库中,大约有39000个包,在主库中有8500个包。这听起来很少.但是这些自助形式的开源软件、组件、支持库有很多不是由Ubuntu开发者打包的。重要的是,有很多重要的组件不在库中,只能通过源代码编译。DFileManager就是这样一个组件。他是仍处在早期阶段的一个QT跨平台文件管理器.QT提供单一源码的跨平台可移植性。 + +在缺失二进制文件的包里,用户需要编译源代码。对于一些工具来说,这个可能会产生很大的问题,特别是如果这个应用依赖于任何一个含糊不清的依赖库,或者某个没有被编译在系统中的特殊软件版本。 +### 安装 ### + +幸运的是,DFileManager非常容易编译。对于我的老Ubutnu来说,这个在开发者网站上的安装介绍提供了大部分的重要步骤,不过,少量的基础包没有在上面(为什么总是这样?虽然支持库会让文件系统变得一团糟!)。在我的系统上,为了做好准备,从github上下载源代码并且编译这个软件,我在Shell里输入了以下命令: + + ~$ sudo apt-get install qt5-default qt5-qmake libqt5x11extras5-dev + ~$ git clone git://git.code.sf.net/p/dfilemanager/code dfilemanager-code + ~$ cd dfilemananger-code + ~$ mkdir build + ~$ cd build + ~$ cmake ../ -DCMAKE_INSTALL_PREFIX=/usr + ~$ make + ~$ sudo make install + +你可以通过在shell中输入如下命令来启动它 + + ~$ dfm + +下面是在最吸引人的操作界面下操作的DFileManager,文件流视图.这提供了一个拥有相当有吸引力的体验的滑动当前文件夹下的文件的能力。这是看图片的理想选择。这个文件管理器酷似Finder(Macintosh 操作系统下的默认文件管理器),可能会对你有吸引力。 + +![DFileManager in action](http://www.linuxlinks.com/portal/content/reviews/FileManagers/Screenshot-dfm.png) + +### 特点: ### + +- 4种视图:图标、详请、列和文件流 +- 通过位置和设备归类书签 +- 标签页 +- 简单的搜索和过滤 +- 自定义文件类型的缩略图,包括多媒体文件 +- 可以移动的信息栏 +- 单击打开文件和目录 +- 控制队列IO操作 +- 记住每个文件夹的视图属性 +- 显示隐藏文件 + +DFileManager 不是KDE 的Dolphin,但是能做相同的事情。这个是一个真正能够帮助人们的浏览文件的文件管理器。还有,别忘了反馈信息给开发者,任何人都可以做出这样的贡献 + +-------------------------------------------------------------------------------- + +via: http://gofk.tumblr.com/post/131014089537/dfilemanager-cover-flow-file-manager-a-real-gem + +作者:[gofk][a] +译者:[bestony](https://github.com/bestony) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://gofk.tumblr.com/ From ea29ca28be5b6044f7e88d2e1bd5289dcad58df5 Mon Sep 17 00:00:00 2001 From: Bestony Date: Mon, 28 Dec 2015 07:49:23 +0800 Subject: [PATCH 0069/1469] merge source --- translated/tech/LFCS/Part 2 - LFCS | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 translated/tech/LFCS/Part 2 - LFCS diff --git a/translated/tech/LFCS/Part 2 - LFCS b/translated/tech/LFCS/Part 2 - LFCS new file mode 100644 index 0000000000..e69de29bb2 From 2df9ed54870d35b41aca1f692d1c18b9ffdbaf5e Mon Sep 17 00:00:00 2001 From: Bestony Date: Mon, 28 Dec 2015 07:53:44 +0800 Subject: [PATCH 0070/1469] =?UTF-8?q?=E8=AE=A4=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20151012 Remember sed and awk All Linux admins should.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20151012 Remember sed and awk All Linux admins should.md b/sources/tech/20151012 Remember sed and awk All Linux admins should.md index 67a6641393..6f1aba9ed8 100644 --- a/sources/tech/20151012 Remember sed and awk All Linux admins should.md +++ b/sources/tech/20151012 Remember sed and awk All Linux admins should.md @@ -1,3 +1,4 @@ +translating By Bestony Remember sed and awk? All Linux admins should ================================================================================ ![](http://images.techhive.com/images/article/2015/03/linux-100573790-primary.idge.jpg) From 64ee6cf0f417bfd9d6a5d0852500aedaaa667ee9 Mon Sep 17 00:00:00 2001 From: carolinewuyan <309866211@qq.com> Date: Mon, 28 Dec 2015 10:32:55 +0800 Subject: [PATCH 0071/1469] =?UTF-8?q?=E5=B7=B2=E6=A0=A1=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...onfigure Apache Solr on Ubuntu 14 or 15.md | 48 ++++++++++--------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/translated/tech/20151123 How to Configure Apache Solr on Ubuntu 14 or 15.md b/translated/tech/20151123 How to Configure Apache Solr on Ubuntu 14 or 15.md index 64357e0284..e6f3f05552 100644 --- a/translated/tech/20151123 How to Configure Apache Solr on Ubuntu 14 or 15.md +++ b/translated/tech/20151123 How to Configure Apache Solr on Ubuntu 14 or 15.md @@ -1,9 +1,7 @@ -taichirain 翻译中 如何在Ubuntu 14/15上配置Apache Solr ================================================================================ -大家好,欢迎来阅读我们今天Apache Solr的文章.Apache Solr是一个运行在网站后台的目前最热门的一个搜索引擎,基于Apache Lucene,能让你很容易的创建搜索引擎,数据库,文件。它能够索引和搜索多个网站并根据搜索文本的相关内容返回搜索建议. - +大家好,欢迎来阅读我们今天Apache Solr的文章。Apache Solr是一个最有名的开源搜索平台,基于在网站后端运行的Apache Lucene,能够让你轻松创建搜索引擎来搜索网站、数据库和文件。它能够索引和搜索多个网站并根据搜索文本的相关内容返回搜索建议. Solr工作在可扩展标记语言(XML),并可以为JSON、Python和Ruby提供应用程序接口(APIs)。根据Apache Lucene项目,Solr提供了非常多的功能,让它很受管理员们的欢迎: - 全文检索 @@ -12,20 +10,22 @@ Solr工作在可扩展标记语言(XML),并可以为JSON、Python和Ruby提供 - 自定义文档排序/排列 #### 前提条件: #### -在一个使用Ubuntu 14/15最小化安装包的系统上,你仅仅需要少量的准备,就开始安装 Apache Solor. + +在一个使用最小化安装包的全新 Ubuntu 14/15 系统上,你仅仅需要少量的准备,就开始安装 Apache Solor. ### 1)System Update 系统更新### -在所有的安装步骤以及使用Solor过程中使用一个具有sudo权限的非root用户登录Ubuntu server。 +使用一个具有sudo权限的非root用户登录你的Ubuntu服务器,这将会在接下来的所有安装和使用Solr的步骤中使用。 登录成功后,使用下面的命令,升级你的系统到最新的更新及补丁 $ sudo apt-get update ### 2) JRE Setup 安装JRE### + 要安装Solr,首先需要安装JRE(Java Runtime Environment)作为基础环境,因为solr和tomcat都是基于Java.所以,我们需要安装最新版的Java和配置Java本地环境. -为了安装最新版的Java 8,我们需要安装Python Software Properties工具包 +要想安装最新版的Java 8,我们需要通过以下命令安装Python Software Properties工具包 $ sudo apt-get install python-software-properties @@ -33,7 +33,7 @@ Solr工作在可扩展标记语言(XML),并可以为JSON、Python和Ruby提供 $ sudo add-apt-repository ppa:webupd8team/java -使用下面的命令更新源,然后安装java,然后使用'wget'安装Oracle Jave 8的最新版本 +现在你可以通过以下命令更新包源列表,使用‘wget’来安装最新版本的Oracle Java 8,然后安装Java。 $ sudo apt-get update @@ -41,59 +41,62 @@ Solr工作在可扩展标记语言(XML),并可以为JSON、Python和Ruby提供 $ sudo apt-get install oracle-java8-installer -在安装和配置Java SE Platform 和 JavaFX 过程中点击'OK'按钮接受 Oracle Binary Code License Agreement 协议. +在安装和配置Java SE Platform 和 JavaFX 过程中点击'OK'按钮接受 Oracle二进制代码许可协议(Oracle Binary Code License Agreement)。 -在安装完成后,运行下面的命令,检查是否安装成功以及查看安装的版本 +在安装完成后,运行下面的命令,检查是否安装成功以及查看安装的版本。 kash@solr:~$ java -version java version "1.8.0_66" Java(TM) SE Runtime Environment (build 1.8.0_66-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode) -执行结果表明我们已经成功的安装了Java,并达到安装Solr最基本的要求了 +执行结果表明我们已经成功安装了Java,并达到安装Solr最基本的要求了,接着我们进行下一步。 ### 安装Solr### -有两种不同的方式可以在Ubuntu上安装Solr,在本文中我们只用最新的源码包来演示源码安装 + +有两种不同的方式可以在Ubuntu上安装Solr,在本文中我们只用最新的源码包来演示源码安装。 要使用源码安装Solr,先要从官网 [Web Page][1] 下载最新的可用安装包。复制以下链接,然后使用 'wget'命令来下载。 $ wget http://www.us.apache.org/dist/lucene/solr/5.3.1/solr-5.3.1.tgz -运行下面的命令,将已压缩的服务解压到 /bin目录 +运行下面的命令,将已存档的服务解压到 /bin目录。 $ tar -xzf solr-5.3.1.tgz solr-5.3.1/bin/install_solr_service.sh --strip-components=2 -Then run the script to start Solr service that will creates a new 'solr' user and then installs solr as a service. -运行脚本来启动Solr服务:将会先创建一个solr的用户,然后将Solr安装成服务 + +运行脚本来启动Solr服务,这将会先创建一个solr的用户,然后将Solr安装成服务。 $ sudo bash ./install_solr_service.sh solr-5.3.1.tgz ![Solr 安装](http://blog.linoxide.com/wp-content/uploads/2015/11/12.png) -使用下面的命令来检查Solr服务的状态 +使用下面的命令来检查Solr服务的状态。 $ service solr status ![Solr 状态](http://blog.linoxide.com/wp-content/uploads/2015/11/22.png) ### 创建Solr集合: ### -我们现在可以使用Solr用户添加多个集合.就像下图所示的那样,我们仅仅只需要在命令行中指定集合名称和指定其配置集就可以创建多个集合了 + +我们现在可以使用Solr用户添加多个集合。就像下图所示的那样,我们只需要在命令行中指定集合名称和指定其配置集就可以创建多个集合了。 $ sudo su - solr -c "/opt/solr/bin/solr create -c myfirstcollection -n data_driven_schema_configs" ![创建集合](http://blog.linoxide.com/wp-content/uploads/2015/11/32.png) -我们已经成功的为我们的第一个集合创建了新的内核实例目录,并将数据添加到里面。 -它的概要文件在 '/opt/solr/server/solr/configsets/data_driven_schema_configs/conf' +我们已经成功的为我们的第一个集合创建了新的内核实例目录,并可以将数据添加到里面。 +查看库中的默认模式文件 '/opt/solr/server/solr/configsets/data_driven_schema_configs/conf' + +### 使用Solr页面### -### Using Solr Web 使用Solr页面### 可以使用默认的端口8983连接Apache Solr.打开浏览器,输入 http://your_server_ip:8983/solr 或者 http://your-domain.com:8983/solr. 确保你的防火墙允许8983端口. http://172.25.10.171:8983/solr/ ![Web访问Solr](http://blog.linoxide.com/wp-content/uploads/2015/11/42.png) -在Solr的Web控制台的左侧菜单点击'Core Admin'按钮,你将会看见我们之前使用CLI方式创建的集合。你可以点击'Add Core'按钮来创建新的内核 +在Solr的Web控制台左侧菜单点击'Core Admin'按钮,你将会看见我们之前使用CLI方式创建的集合。你可以点击'Add Core'按钮来创建新的内核。 ![添加核心](http://blog.linoxide.com/wp-content/uploads/2015/11/52.png) @@ -113,7 +116,8 @@ Then run the script to start Solr service that will creates a new 'solr' user an ![添加文档](http://blog.linoxide.com/wp-content/uploads/2015/11/62.png) -### 结尾### +### 总结### + 在Ubuntu上安装成功后,你就可以使用Solr WEB接口插入或查询数据。如果你想通过Solr来管理更多的数据和文件,可以创建更多的集合。希望你能喜欢这篇文章并且希望它能够帮到你。 -------------------------------------------------------------------------------- @@ -122,7 +126,7 @@ via: http://linoxide.com/ubuntu-how-to/configure-apache-solr-ubuntu-14-15/ 作者:[Kashif][a] 译者:[taichirain](https://github.com/taichirain) -校对:[校对者ID](https://github.com/校对者ID) +校对:[Caroline](https://github.com/carolinewuyan) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 464359b33443f9433205bea038e05669e68912c7 Mon Sep 17 00:00:00 2001 From: Stdio A Date: Mon, 28 Dec 2015 14:57:57 +0800 Subject: [PATCH 0072/1469] Translating 20151223 Ten Biggest Linux Stories Of The Year 2015 --- .../talk/20151223 Ten Biggest Linux Stories Of The Year 2015.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/talk/20151223 Ten Biggest Linux Stories Of The Year 2015.md b/sources/talk/20151223 Ten Biggest Linux Stories Of The Year 2015.md index af41c6a5e1..ce56ab4405 100644 --- a/sources/talk/20151223 Ten Biggest Linux Stories Of The Year 2015.md +++ b/sources/talk/20151223 Ten Biggest Linux Stories Of The Year 2015.md @@ -1,3 +1,5 @@ +StdioA translating + Ten Biggest Linux Stories Of The Year 2015 ================================================================================ ![Biggest Linux Stories of 2015](http://itsfoss.com/wp-content/uploads/2015/12/Biggest-Linux-Stories-2015.jpg) From 87eb41695fe70df1fa3e51729b7b29231a310f10 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 28 Dec 2015 15:04:23 +0800 Subject: [PATCH 0073/1469] PUB:20151123 7 ways hackers can use Wi-Fi against you @ZTinoZ --- ... ways hackers can use Wi-Fi against you.md | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) rename {translated/share => published}/20151123 7 ways hackers can use Wi-Fi against you.md (50%) diff --git a/translated/share/20151123 7 ways hackers can use Wi-Fi against you.md b/published/20151123 7 ways hackers can use Wi-Fi against you.md similarity index 50% rename from translated/share/20151123 7 ways hackers can use Wi-Fi against you.md rename to published/20151123 7 ways hackers can use Wi-Fi against you.md index cc3447e72a..d8794383c7 100644 --- a/translated/share/20151123 7 ways hackers can use Wi-Fi against you.md +++ b/published/20151123 7 ways hackers can use Wi-Fi against you.md @@ -1,40 +1,42 @@ -黑客利用Wi-Fi侵犯你隐私的七种方法 +黑客利用 Wi-Fi 攻击你的七种方法 ================================================================================ ![Image courtesy Thinkstock](http://core0.staticworld.net/images/article/2015/11/intro_title-100626673-orig.jpg) -### 黑客利用Wi-Fi侵犯你隐私的七种方法 ### +### 黑客利用 Wi-Fi 侵犯你隐私的七种方法 ### -Wi-Fi — 既然方便又危险的东西!这里给大家介绍一下通过Wi-Fi连接泄露身份信息的七种方法和预防措施。 +Wi-Fi — 啊,你是如此的方便,却又如此的危险! + +这里给大家介绍一下通过Wi-Fi连接“慷慨捐赠”你的身份信息的七种方法和反制措施。 ![Image courtesy Thinkstock](http://core0.staticworld.net/images/article/2015/11/1_free-hotspots-100626674-orig.jpg) ### 利用免费热点 ### -它们似乎无处不在,而且它们的数量会在[接下来四年里增加三倍][1]。但是它们当中很多都是不值得信任的,从你的登录凭证、email甚至更加敏感的账户,都能被黑客用一款名叫“sniffers”的软件截获 — 这款软件能截获到任何你通过该连接提交的信息。防止被黑客盯上的最好办法就是使用VPN(virtual private network),它加密了你所输入的信息,因此能够保护你的数据隐私。 +它们似乎无处不在,而且它们的数量会在[接下来四年里增加三倍][1]。但是它们当中很多都是不值得信任的,从你的登录凭证、email 甚至更加敏感的账户,都能被黑客用“嗅探器(sniffers)”软件截获 — 这种软件能截获到任何你通过该连接提交的信息。防止被黑客盯上的最好办法就是使用VPN(虚拟私有网virtual private network),它加密了你所输入的信息,因此能够保护你的数据隐私。 ![Image courtesy Thinkstock](http://core0.staticworld.net/images/article/2015/11/2_online-banking-100626675-orig.jpg) ### 网上银行 ### -你可能认为没有人需要被提醒不要使用免费Wi-Fi来操作网上银行, 但网络安全厂商卡巴斯基实验室表示[全球超过100家银行因为网络黑客而损失9亿美元][2],由此可见还是有很多人因此受害。如果你确信一家咖啡店的免费Wi-Fi是正规的,想要连接它,那么你应该向服务员确认网络名称。[他人在店里用路由器设置一个开放的无线连接][3]并将它的网络名称设置成店名是一件相当简单的事。 +你可能认为没有人需要被提醒不要使用免费 Wi-Fi 来操作网上银行, 但网络安全厂商卡巴斯基实验室表示**[全球超过100家银行因为网络黑客而损失9亿美元][2]**,由此可见还是有很多人因此受害。如果你确信一家咖啡店的免费 Wi-Fi 是正规的,想要连接它,那么你应该向服务员确认网络名称。[其他人在店里用路由器设置一个开放的无线连接][3],并将它的网络名称设置成店名是一件相当简单的事。 ![Image courtesy Thinkstock](http://core0.staticworld.net/images/article/2015/11/3_keeping-wifi-on-100626676-orig.jpg) -### 始终开着Wi-Fi开关 ### +### 始终开着 Wi-Fi 开关 ### -如果你手机的Wi-Fi开关一直开着的,你会自动被连接到一个不安全的网络中去,你甚至都没有意识到。你可以利用你手机中[基于位置的Wi-Fi功能][4],如果它是可用的,那它会在你离开你所保存的网络范围后自动关闭你的Wi-Fi开关并在你回去之后再次开启。 +如果你手机的 Wi-Fi 开关一直开着的,你会自动被连接到一个不安全的网络中去,你甚至都没有意识到。你可以利用你手机中[基于位置的 Wi-Fi 功能][4],如果有这种功能的话,那它会在你离开你所保存的网络范围后自动关闭你的 Wi-Fi 开关并在你回去之后再次开启。 ![Image courtesy Thinkstock](http://core0.staticworld.net/images/article/2015/11/4_not-using-firewall-100626677-orig.jpg) ### 不使用防火墙 ### -防火墙是你的第一道抵御恶意入侵的防线,它能有效地让你的电脑网络通畅并阻挡黑客和恶意软件。你应该时刻开启它除非你的杀毒软件有它自己的防火墙。 +防火墙是你的第一道抵御恶意入侵的防线,它能有效地让你的电脑网络保持通畅并阻挡黑客和恶意软件。你应该时刻开启它除非你的杀毒软件有它自己的防火墙。 ![Image courtesy Thinkstock](http://core0.staticworld.net/images/article/2015/11/5_browsing-unencrypted-sites-100626678-orig.jpg) ### 浏览非加密网页 ### -说起来很难过,[世界上排名前100万个网站中55%是不加密的][5],一个未加密的网站会让一切传输数据暴露在黑客的眼中。如果一个网页是安全的,你的浏览器则会有标明(比如说火狐浏览器是一把灰色的挂锁,Chrome浏览器则是个绿锁图标)。但是一个安全的网站不能让你免于被劫持的风险,它能通过公共网络从你访问过的网站上窃取cookies,无论是不是正规网站。 +说起来很难过,**[世界上排名前100万个网站中55%是不加密的][5]**,一个未加密的网站会让一切传输数据暴露在黑客的眼中。如果一个网页是安全的,你的浏览器则会有标明(比如说火狐浏览器是一把灰色的挂锁,Chrome 浏览器则是个绿锁图标)。但是即使是安全的网站不能让你免于被劫持的风险,他们能通过公共网络从你访问过的网站上窃取 cookies,无论是不是正规网站。 ![Image courtesy Thinkstock](http://core0.staticworld.net/images/article/2015/11/6_updating-security-software-100626679-orig.jpg) @@ -44,11 +46,11 @@ Wi-Fi — 既然方便又危险的东西!这里给大家介绍一下通过Wi-F ![Image courtesy Thinkstock](http://core0.staticworld.net/images/article/2015/11/7_securing-home-wifi-100626680-orig.jpg) -### 不保护你的家用Wi-Fi ### +### 不保护你的家用 Wi-Fi ### -不用说,设置一个复杂的密码和更改无线连接的默认名都是非常重要的。你还可以过滤你的MAC地址来让你的路由器只识别那些确认过的设备。 +不用说,设置一个复杂的密码和更改无线连接的默认名都是非常重要的。你还可以过滤你的 MAC 地址来让你的路由器只识别那些确认过的设备。 -**Josh Althuser**是一个开源支持者、网络架构师和科技企业家。在过去12年里,他花了很多时间去倡导使用开源软件来管理团队和项目,同时为网络应用程序提供企业级咨询并帮助它们把产品推向市场。你可以通过[他的推特][6]联系他。 +本文作者 **Josh Althuser** 是一个开源支持者、网络架构师和科技企业家。在过去12年里,他花了很多时间去倡导使用开源软件来管理团队和项目,同时为网络应用程序提供企业级咨询并帮助它们把产品推向市场。你可以通过[他的推特][6]联系他。 -------------------------------------------------------------------------------- From 041b5463de7f615f045f875d5142f1f506151ec9 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 28 Dec 2015 15:09:31 +0800 Subject: [PATCH 0074/1469] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @bestony --- translated/tech/LFCS/Part 2 - LFCS | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 translated/tech/LFCS/Part 2 - LFCS diff --git a/translated/tech/LFCS/Part 2 - LFCS b/translated/tech/LFCS/Part 2 - LFCS deleted file mode 100644 index e69de29bb2..0000000000 From a76f67fe21399fdde03c6368ed29122d95b9e888 Mon Sep 17 00:00:00 2001 From: carolinewuyan <309866211@qq.com> Date: Mon, 28 Dec 2015 16:06:13 +0800 Subject: [PATCH 0075/1469] =?UTF-8?q?=E5=B7=B2=E6=A0=A1=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...resses To One Interface On Ubuntu 15.10.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/translated/tech/20151123 Assign Multiple IP Addresses To One Interface On Ubuntu 15.10.md b/translated/tech/20151123 Assign Multiple IP Addresses To One Interface On Ubuntu 15.10.md index fd61e5a939..5c35da569b 100644 --- a/translated/tech/20151123 Assign Multiple IP Addresses To One Interface On Ubuntu 15.10.md +++ b/translated/tech/20151123 Assign Multiple IP Addresses To One Interface On Ubuntu 15.10.md @@ -1,6 +1,6 @@ 在 Ubuntu 15.10 上为单个网卡设置多个 IP 地址 ================================================================================ -有时候你可能想在你的网卡上使用多个 IP 地址。遇到这种情况你会怎么办呢?买一个新的网卡并分配一个新的 IP?不,这没有必要(至少在小网络中)。现在我们可以在 Ubuntu 系统中为一个网卡分配多个 IP 地址。想知道怎么做到的?跟着我往下看,其实并不难。 +有时候你可能想在你的网卡上使用多个 IP 地址。遇到这种情况你会怎么办呢?买一个新的网卡并分配一个新的 IP?不,没有这个必要(至少在小型网络中)。现在我们可以在 Ubuntu 系统中为一个网卡分配多个 IP 地址。想知道怎么做到的?跟着我往下看,其实并不难。 这个方法也适用于 Debian 以及它的衍生版本。 @@ -12,7 +12,7 @@ sudo ip addr -**事例输出:** +**样例输出:** 1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 @@ -31,7 +31,7 @@ sudo ifconfig -**事例输出:** +**样例输出:** enp0s3 Link encap:Ethernet HWaddr 08:00:27:2a:03:4b inet addr:192.168.1.103 Bcast:192.168.1.255 Mask:255.255.255.0 @@ -50,7 +50,7 @@ collisions:0 txqueuelen:0 RX bytes:38793 (38.7 KB) TX bytes:38793 (38.7 KB) -正如你在上面看到的,我的网卡名称是 **enp0s3**,它的 IP 地址是 **192.168.1.103**。 +正如你在上面输出中看到的,我的网卡名称是 **enp0s3**,它的 IP 地址是 **192.168.1.103**。 现在让我们来为网卡添加一个新的 IP 地址,例如说 **192.168.1.104**。 @@ -73,7 +73,7 @@ inet6 fe80::a00:27ff:fe2a:34e/64 scope link valid_lft forever preferred_lft forever -类似地,你可以添加想要的任意多的 IP 地址。 +类似地,你可以添加任意数量的 IP 地址,只要你想要。 让我们 ping 一下这个 IP 地址验证一下。 @@ -108,7 +108,7 @@ 可以看到已经没有了!! -也许你已经知道,你重启系统后会丢失这些设置。那么怎么设置才能永久有效呢?这也很简单。 +正如你所知,重启系统后这些设置会失效。那么怎么设置才能永久有效呢?这也很简单。 ### 添加永久 IP 地址 ### @@ -154,7 +154,7 @@ Ubuntu 系统的网卡配置文件是 **/etc/network/interfaces**。 保存并关闭文件。 -无需重启运行下面的命令使更改生效。 +运行下面的命令使更改无需重启即生效。 sudo ifdown enp0s3 && sudo ifup enp0s3 @@ -182,7 +182,7 @@ Ubuntu 系统的网卡配置文件是 **/etc/network/interfaces**。 DHCPACK of 192.168.1.103 from 192.168.1.1 bound to 192.168.1.103 -- renewal in 35146 seconds. -**注意**:如果你从远程连接到服务器,把上面的两个命令放到**一行**中**非常重要**,因为第一个命令会断掉你的连接。而采用这种方式可以存活你的 ssh 会话。 +**注意**:如果你从远程连接到服务器,把上面的两个命令放到**一行**中**非常重要**,因为第一个命令会断掉你的连接。而采用这种方式可以保留你的 ssh 会话。 现在,让我们用下面的命令来检查一下是否添加了新的 IP: @@ -228,9 +228,9 @@ via: http://www.unixmen.com/assign-multiple-ip-addresses-to-one-interface-on-ubu 作者:[SK][a] 译者:[ictlyh](http://mutouxiaogui.cn/blog/) -校对:[校对者ID](https://github.com/校对者ID) +校对:[Caroline](https://github.com/carolinewuyan) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://www.unixmen.com/author/sk/ -[1]:http://www.unixmen.com/linux-basics-assign-multiple-ip-addresses-single-network-interface-card-centos-7/ \ No newline at end of file +[1]:http://www.unixmen.com/linux-basics-assign-multiple-ip-addresses-single-network-interface-card-centos-7/ From ae4d996af869f97d2ccc4f07aa9425f8082bb2d4 Mon Sep 17 00:00:00 2001 From: Jeff Tsang Date: Mon, 28 Dec 2015 16:29:41 +0800 Subject: [PATCH 0076/1469] translated 20151206 NetworkManager and privacy in the IPv6 internet.md --- ...anager and privacy in the IPv6 internet.md | 44 ++++++++++++++----- 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/sources/tech/20151206 NetworkManager and privacy in the IPv6 internet.md b/sources/tech/20151206 NetworkManager and privacy in the IPv6 internet.md index d3abefacb2..bdabf24aff 100644 --- a/sources/tech/20151206 NetworkManager and privacy in the IPv6 internet.md +++ b/sources/tech/20151206 NetworkManager and privacy in the IPv6 internet.md @@ -1,55 +1,75 @@ Translating by itsang NetworkManager and privacy in the IPv6 internet +IPv6因特网中的隐私保护和网络管理器 + ====================== IPv6 is gaining momentum. With growing use of the protocol concerns about privacy that were not initially anticipated arise. The Internet community actively publishes solutions to them. What’s the current state and how does NetworkManager catch up? Let’s figure out! +IPv6的使用量正在不断增加,让我们始料未及的是,伴随这个协议不断增加的使用量,大量隐私问题涌现出来。互联网社区在积极发表相关解决方案,当前状况是怎样的呢?网络管理器又是如何跟上的呢?让我们来瞧瞧吧! + ![](https://blogs.gnome.org/lkundrak/files/2015/12/cameras1.jpg) -## The identity of a IPv6-connected host +## The identity of a IPv6-connected host 通过IPv6方式连接的主机的特性 -The IPv6 enabled nodes don’t need a central authority similar to IPv4 [DHCP](https://tools.ietf.org/html/rfc2132) servers to configure their addresses. They discover the networks they are in and [complete the addresses themselves](https://tools.ietf.org/html/rfc4862) by generating the host part. This makes the network configuration simpler and scales better to larger networks. However, there’s some drawbacks to this approach. Firstly, the node needs to ensure that its address doesn’t collide with an address of any other node on the network. Secondly, if the node uses the same host part of the address in every network it enters then its movement can be tracked and the privacy is at risk. +The IPv6 enabled nodes don’t need a central authority similar to IPv4 [DHCP](https://tools.ietf.org/html/rfc2132) servers to configure their addresses. They discover the networks they are in and [complete the addresses themselves](https://tools.ietf.org/html/rfc4862) by generating the host part. This makes the network configuration simpler and scales better to larger networks. However, there’s some drawbacks to this approach. Firstly, the node needs to ensure that its address doesn’t collide with an address of any other node on the network. Secondly, if the node uses the same host part of the address in every network it enters then its movement can be tracked and the privacy is at risk. +通过IPv6方式激活的结点(译者注:结点在网络中指一个联网的设备)不需要类似IPv4网络中[DHCP](https://tools.ietf.org/html/rfc2132)服务器的中央机构来配置他们的地址。它们发现自己所在的网络然后通过生成主机部分来[自主生成地址](https://tools.ietf.org/html/rfc2132)。这种方式使得网络配置更加简单,并且能够更好的扩展到更大规模的网络。然而,这种方式也有一些缺点。首先,这个结点需要确保它的地址不会和网络上其他结点冲突。其次,如果这个结点在进入的每一个网络中使用相同的主机部分,它的运动就可以被追踪,如此一来,隐私便处于危险之中。 -Internet Engineering Task Force (IETF), the organization behind the Internet standards, [acknowledged this problem](https://tools.ietf.org/html/draft-iesg-serno-privacy-00) and recommends against use of hardware serial numbers to identify the node in the network. +Internet Engineering Task Force (IETF), the organization behind the Internet standards, [acknowledged this problem](https://tools.ietf.org/html/draft-iesg-serno-privacy-00) and recommends against use of hardware serial numbers to identify the node in the network. +负责制定因特网标准的组织Internet工程任务组(Internet Engineering Task Force,IETF)[意识到了这个问题](https://tools.ietf.org/html/draft-iesg-serno-privacy-00),这个组织建议取消使用硬件序列号来识别网络上的结点。 But what does the actual implementation look like? +但实际的实施情况是怎样的呢? -The problem of address uniqueness is addressed with [Duplicate Address Detection](https://tools.ietf.org/html/rfc4862#section-5.4) (DAD) mechanism. When a node creates an address for itself it first checks whether another node uses the same address using the [Neighbor Discovery Protocol](https://tools.ietf.org/html/rfc4861) (a mechanism not unlike IPv4 [ARP](https://tools.ietf.org/html/rfc826) protocol). When it discovers the address is already used, it must discard it. +The problem of address uniqueness is addressed with [Duplicate Address Detection](https://tools.ietf.org/html/rfc4862#section-5.4) (DAD) mechanism. When a node creates an address for itself it first checks whether another node uses the same address using the [Neighbor Discovery Protocol](https://tools.ietf.org/html/rfc4861) (a mechanism not unlike IPv4 [ARP](https://tools.ietf.org/html/rfc826) protocol). When it discovers the address is already used, it must discard it. +地址唯一性问题可以通过[重复地址检测(Duplicate Address Detection, DAD)](https://tools.ietf.org/html/rfc4862#section-5.4)机制来解决。当结点为自身创建地址的时候,他首先通过[邻居发现协议(Neighbor Discovery Protocol)](https://tools.ietf.org/html/rfc4861)(一种不同于IPv4 [ARP](https://tools.ietf.org/html/rfc826)协议的机制)来检查另一个结点是否使用了相同的地址。当它发现地址已经被使用,它必须抛弃掉这个地址。 The other problem (privacy) is a bit harder to solve. An IP address (be it IPv4 or IPv6) address consists of a network part and the host part. The host discovers the relevant network parts and is supposed generate the host part. Traditionally it just uses an Interface Identifier derived from the network hardware’s (MAC) address. The MAC address is set at manufacturing time and can uniquely identify the machine. This guarantees the address is stable and unique. That’s a good thing for address collision avoidance but a bad thing for privacy. The host part remaining constant in different network means that the machine can be uniquely identified as it enters different networks. This seemed like non-issue at the time the protocol was designed, but the privacy concerns arose as the IPv6 gained popularity. Fortunately, there’s a solution to this problem. +解决另一个问题——隐私问题,有一点困难。一个IP地址(无论IPv4或IPv6)由网络部分和主机部分组成(译者注:网络部分用来划分子网,主机部分用来从相应子网中找到具体的主机)。主机查找出相关的网络部分,并且生成主机部分。传统上它只使用了源自网络硬件(MAC)地址的接口识别器。MAC地址在硬件制造的时候就被设置好了,它可以唯一的识别机器。这样就确保了地址的稳定性和唯一性。这对避免地址冲突来说是件好事,但是对隐私来说一点也不好。主机部分在不同网络下保持恒定意味着机器在进入不同网络时可以被唯一的识别。这在协议制定的时候看起来无可非议,但是随着IPv6的流行,人们对于隐私问题的担忧也愈演愈烈。幸运的是,解决办法还是有的。 -## Enter privacy extensions +## Enter privacy extensions 进入隐私扩展 -It’s no secret that the biggest problem with IPv4 is that the addresses are scarce. This is no longer true with IPv6 and in fact an IPv6-enabled host can use addresses quite liberally. There’s absolutely nothing wrong with having multiple IPv6 addresses attached to the same interface. On the contrary, it’s a pretty standard situation. At the very minimum each node has an address that is used for contacting nodes on the same hardware link called a link-local address.  When the network contains a router that connects it to other networks in the internet, a node has an address for every network it’s directly connected to. If a host has more addresses in the same network the node accepts incoming traffic for all of them. For the outgoing connections which, of course, reveal the address to the remote host, the kernel picks the fittest one. But which one is it? +It’s no secret that the biggest problem with IPv4 is that the addresses are scarce. This is no longer true with IPv6 and in fact an IPv6-enabled host can use addresses quite liberally. There’s absolutely nothing wrong with having multiple IPv6 addresses attached to the same interface. On the contrary, it’s a pretty standard situation. At the very minimum each node has an address that is used for contacting nodes on the same hardware link called a link-local address. When the network contains a router that connects it to other networks in the internet, a node has an address for every network it’s directly connected to. If a host has more addresses in the same network the node accepts incoming traffic for all of them. For the outgoing connections which, of course, reveal the address to the remote host, the kernel picks the fittest one. But which one is it? +Pv4的最大问题——地址枯竭,已经不是什么秘密。对IPv6来说,这一点不再成立,事实上,使用IPv6的主机能够相当大方的利用地址。多个IPv6地址对应一块网卡绝对没有任何错误,正好相反,这是一种标准情形。最起码每个结点都有一个“本地连接地址”,它被用来与同一物理链路的结点联络。当网络包含了一个连接其他网络的路由器,这个网络中的每一个结点都有一个与每个直接连接网络联络的地址。如果主机在相同网络有更多的地址,结点(译者注:指路由器)将接受它们全部的传入流量。对于输出连接,它会把地址显示给远程主机,内核会挑选最适合的地址。但到底是哪一个呢? -With privacy extensions enabled, as defined by [RFC4941](https://tools.ietf.org/html/rfc4941), a new address with a random host part is generated every now and then. The newest one is used for new outgoing connections while the older ones are deprecated when they’re unused. This is a nifty trick — the host does not reveal the stable address as it’s not used for outgoing connections, but still accepts connections to it from the hosts that are aware of it. +With privacy extensions enabled, as defined by [RFC4941](https://tools.ietf.org/html/rfc4941), a new address with a random host part is generated every now and then. The newest one is used for new outgoing connections while the older ones are deprecated when they’re unused. This is a nifty trick — the host does not reveal the stable address as it’s not used for outgoing connections, but still accepts connections to it from the hosts that are aware of it. +隐私扩展可用时,就像[RFC4941](https://tools.ietf.org/html/rfc4941)定义的那样,时常会生成带有随机主机部分的新地址。最新的那个被用于最新的输出连接,与此同时,那些不被使用了的旧地址将被丢弃。这是一个极好的窍略——当固定地址不用于输出连接的时候,主机就不会显示它,但它仍然会接受注意到它的主机的连接。 There’s a downside to this. Certain applications tie the address to the user identity. Consider a web application that issues a HTTP Cookie for the user during the authentication but only accepts it for the connections that come from the address that conducted the authentications. As the kernel generates a new temporary address, the server would reject the requests that use it, effectively logging the user out. It could be argued that the address is not an appropriate mechanism for establishing user’s identity but that’s what some real-world applications do. +但这也存在美中不足之处——某些应用会把地址与用户识别绑定在一起。让我们来考虑一下这种情形,一个web应用在用户认证的时候生成一个HTTP Cookie,但它只接受实施认证的地址的连接。当内核生成了一个新的临时地址,服务器会拒绝使用这个地址的请求,实际上相当于将用户登出。地址是不是建立用户认证的合适机制值得商榷,但这确实是现实中应用程序正在做的。 -## Privacy stable addressing to the rescue +## Privacy stable addressing to the rescue 解救之道——隐私固定寻址 -Another approach would be needed to cope with this. There’s a need for an address that is unique (of course), stable for a particular network but still changes when user enters another network so that tracking is not possible. The RFC7217 introduces a mechanism that provides exactly this. +Another approach would be needed to cope with this. There’s a need for an address that is unique (of course), stable for a particular network but still changes when user enters another network so that tracking is not possible. The RFC7217 introduces a mechanism that provides exactly this. +解决这个问题可能需要另辟蹊径。唯一的(当然咯)地址确实有必要,对于特定网络来说是稳定的,但当用户进入了另一个网络后仍然会变,这样的话追踪就变得几乎不可能。RFC7217介绍了一种如上所述的机制。 Creation of a privacy stable address relies on a pseudo-random key that’s only known the host itself and never revealed to other hosts in the network. This key is then hashed using a cryptographically secure algorithm along with values specific for a particular network connection. It includes an identifier of the network interface, the network prefix and possibly other values specific to the network such as the wireless SSID. The use of the secret key makes it impossible to predict the resulting address for the other hosts while the network-specific data causes it to be different when entering a different network. +创建隐私固定地址依赖于伪随机值,这个随机值只被主机本身知晓,它不会显示给网络上的其他主机。这个随机值随后被一个密码安全算法加密,一起被加密的还有一些与网络连接的特殊值。这些值包含:用以标识网卡的标识符;网络前缀;对于这个网络来说有可能的其他特殊值,例如无线的SSID。使用安全值使其他主机很难预测结果地址,与此同时,当进入不同的网络时,网络的特殊数据会让地址变得不同。 This also solves the duplicate address problem nicely. The random key makes collisions unlikely. If, in spite of this, a collision occurs then the hash can be salted with a DAD failure counter and a different address can be generated instead of failing the network connectivity. Now that’s clever. +这也巧妙的解决了地址重复问题。因为有随机值的存在,冲突也不太可能发生。万一发生了冲突,结果地址会得到重复地址检测失败的记录,这时会生成一个不同的地址而不会断开网络连接。看,这种方式很聪明吧。 Using privacy stable address doesn’t interfere with the privacy extensions at all. You can use the [RFC7217](https://tools.ietf.org/html/rfc7217) stable address while still employing the RFC4941 temporary addresses at the same time. +使用隐私固定地址一点儿也不会妨碍隐私扩展。你可以在使用RFC4941所描述的临时地址的同时使用[RFC7217](https://tools.ietf.org/html/rfc7217)中的固定地址。 -## Where does NetworkManager stand? +## Where does NetworkManager stand? 网络管理器处于什么样的状况? We’ve already enabled the privacy extensions with the release NetworkManager 1.0.4. They’re turned on by default; you can control them with ipv6.ip6-privacy property. +我们已经在网络管理器1.0.4版本中实现了隐私扩展。在这个版本中,隐私扩展默认开启。你可以用ipv6.ip6-privacy参数来控制它。 With the release of NetworkManager 1.2, we’re adding the stable privacy addressing. It’s supposed to address the situations where the privacy extensions don’t make the cut. The use of the feature is controlled with the ipv6.addr-gen-mode property. If it’s set to stable-privacy then stable privacy addressing is used. Setting it to “eui64” or not setting it at all preserves the traditional default behavior. +在网络管理器1.2版本中,我们将会加入固定隐私寻址。应该指出的是,目前的隐私扩展还不符合这种需求。我们可以使用ipv6.addr-gen-mode参数来控制这个特性。如果它被设置成固定隐私,那么将会使用固定隐私寻址。设置成“eui64”或者干脆不设置它将会保持传统的默认寻址方式。 Stay tuned for NetworkManager 1.2 release in early 2016! If you want to try the bleeding-edge snapshot, give Fedora Rawhide a try. It will eventually become Fedora 24. +敬请期待明年,也就是2016年年初网络管理器1.2版本的发布吧!如果你想尝试一下最新的版本,不妨试试Fedora Rawhide,它最终会变成Fedora24。 -*I’d like to thank Hannes Frederic Sowa for a valuable feedback. The article would make less sense without his corrections. Hannes also created the in-kernel implementation of the RFC7217 mechanism which can be used when the networking is not managed by NetworkManager.* +*I’d like to thank Hannes Frederic Sowa for a valuable feedback. The article would make less sense without his corrections. Hannes also created the in-kernel implementation of the RFC7217 mechanism which can be used when the networking is not managed by NetworkManager.* +*我想感谢Hannes Frederic Sowa,他给了我很有价值的反馈。如果没有他的帮助,这篇文章的作用将会逊色很多。另外,Hannes也是RFC7217所描述机制的内核实现者,当网络管理器不起作用的时候,它将发挥作用。* -------------------------------------------------------------------------------- via: https://blogs.gnome.org/lkundrak/2015/12/03/networkmanager-and-privacy-in-the-ipv6-internet/ 作者:[Lubomir Rintel] -译者:[译者ID](https://github.com/译者ID) +译者:[itsang](https://github.com/itsang) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 0e4ab9bea694f9854a536b838b36ca8357f01dc7 Mon Sep 17 00:00:00 2001 From: carolinewuyan <309866211@qq.com> Date: Mon, 28 Dec 2015 17:37:26 +0800 Subject: [PATCH 0077/1469] =?UTF-8?q?=E5=B7=B2=E6=A0=A1=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...int) your Ubuntu or Linux Mint with SystemBack.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/translated/tech/20151201 Backup (System Restore Point) your Ubuntu or Linux Mint with SystemBack.md b/translated/tech/20151201 Backup (System Restore Point) your Ubuntu or Linux Mint with SystemBack.md index 7e0ccc87c7..c931365600 100644 --- a/translated/tech/20151201 Backup (System Restore Point) your Ubuntu or Linux Mint with SystemBack.md +++ b/translated/tech/20151201 Backup (System Restore Point) your Ubuntu or Linux Mint with SystemBack.md @@ -1,6 +1,10 @@ -# 使用SystemBack备份你的Ubuntu/Linux Mint(系统还原) +# 使用 SystemBack 备份你的 Ubuntu/Linux Mint(系统还原) -系统还原对于任何一款允许用户还原电脑到之前状态(包括文件系统,安装的应用,以及系统设置)的操作系统来说,都是必备功能,可以处理系统故障以及其他的问题。有的时候安装一个程序或者驱动可能让你的系统黑屏。系统还原则让你电脑里面的系统文件(译者注:是系统文件,并非普通文件,详情请看**注意**部分)和程序恢复到之前工作正常时候的状态,进而让你远离那让人头痛的排障过程了。而且它也不会影响你的文件,照片或者其他数据。简单的系统备份还原工具[Systemback](https://launchpad.net/systemback)让你很容易地创建系统备份以及用户配置文件。如果遇到问题,你可以傻瓜式还原。它还有一些额外的特征包括系统复制,系统安装以及Live系统创建。 +对于任何一款允许用户还原电脑到之前状态(包括文件系统,安装的应用,以及系统设置)的操作系统来说,系统还原都是必备功能,可以恢复系统故障以及其他的问题。 + +有的时候安装一个程序或者驱动可能让你的系统黑屏。系统还原则让你电脑里面的系统文件(译者注:是系统文件,并非普通文件,详情请看**注意**部分)和程序恢复到之前工作正常时候的状态,进而让你远离那让人头痛的排障过程了。而且它也不会影响你的文件,照片或者其他数据。 + +简单的系统备份还原工具[Systemback](https://launchpad.net/systemback)让你很容易地创建系统备份以及用户配置文件。一旦遇到问题,你可以简单地恢复到系统先前的状态。它还有一些额外的特征包括系统复制,系统安装以及Live系统创建。 截图 @@ -12,7 +16,7 @@ ![](http://1.bp.blogspot.com/-t_gmcoQZrvM/VlilhLP--TI/AAAAAAAAGt0/GWBg6bGeeaI/s1600/systemback-5.jpg) -**注意**:使用系统还原不会还原你的文件,音乐,电子邮件或者其他任何类型的私人文件。对不同用户来讲,这既是优点又是缺点。坏消息是它不会还原你意外删除的文件,不过你可以通过一个文件恢复程序来解决这个问题。如果你的计算机上没有系统还原点,那么系统还原工具就不会奏效了。(最后一句没有太理解) +**注意**:使用系统还原不会还原你的文件,音乐,电子邮件或者其他任何类型的私人文件。对不同用户来讲,这既是优点又是缺点。坏消息是它不会还原你意外删除的文件,不过你可以通过一个文件恢复程序来解决这个问题。如果你的计算机没有还原点,那么系统恢复就无法奏效,所以这个工具就无法帮助你(还原系统),如果你尝试恢复一个主要问题,你将需要移步到另外的步骤来进行故障排除。 > > >适用于Ubuntu 15.10 Wily/16.04/15.04 Vivid/14.04 Trusty/Linux Mint 14.x/其他Ubuntu衍生版,打开终端,将下面这些命令复制过去: @@ -32,7 +36,7 @@ sudo apt-get install systemback via: http://www.noobslab.com/2015/11/backup-system-restore-point-your.html 译者:[DongShuaike](https://github.com/DongShuaike) -校对:[校对者ID](https://github.com/校对者ID) +校对:[Caroline](https://github.com/carolinewuyan) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 59980f066fe3156be71d218c2770876c2413da3a Mon Sep 17 00:00:00 2001 From: Jeff Tsang Date: Mon, 28 Dec 2015 20:00:10 +0800 Subject: [PATCH 0078/1469] transtated 20151206 NetworkManager and privacy in the IPv6 internet.md --- .../20151206 NetworkManager and privacy in the IPv6 internet.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20151206 NetworkManager and privacy in the IPv6 internet.md (100%) diff --git a/sources/tech/20151206 NetworkManager and privacy in the IPv6 internet.md b/translated/tech/20151206 NetworkManager and privacy in the IPv6 internet.md similarity index 100% rename from sources/tech/20151206 NetworkManager and privacy in the IPv6 internet.md rename to translated/tech/20151206 NetworkManager and privacy in the IPv6 internet.md From a3a4270e4b16f72d6720c7301d14311d22b455a6 Mon Sep 17 00:00:00 2001 From: Jeff Tsang Date: Mon, 28 Dec 2015 20:05:56 +0800 Subject: [PATCH 0079/1469] translated --- ...anager and privacy in the IPv6 internet.md | 27 +++---------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/translated/tech/20151206 NetworkManager and privacy in the IPv6 internet.md b/translated/tech/20151206 NetworkManager and privacy in the IPv6 internet.md index bdabf24aff..834d50a0ac 100644 --- a/translated/tech/20151206 NetworkManager and privacy in the IPv6 internet.md +++ b/translated/tech/20151206 NetworkManager and privacy in the IPv6 internet.md @@ -1,69 +1,50 @@ -Translating by itsang -NetworkManager and privacy in the IPv6 internet IPv6因特网中的隐私保护和网络管理器 ====================== -IPv6 is gaining momentum. With growing use of the protocol concerns about privacy that were not initially anticipated arise. The Internet community actively publishes solutions to them. What’s the current state and how does NetworkManager catch up? Let’s figure out! IPv6的使用量正在不断增加,让我们始料未及的是,伴随这个协议不断增加的使用量,大量隐私问题涌现出来。互联网社区在积极发表相关解决方案,当前状况是怎样的呢?网络管理器又是如何跟上的呢?让我们来瞧瞧吧! ![](https://blogs.gnome.org/lkundrak/files/2015/12/cameras1.jpg) -## The identity of a IPv6-connected host 通过IPv6方式连接的主机的特性 +## 通过IPv6方式连接的主机的特性 -The IPv6 enabled nodes don’t need a central authority similar to IPv4 [DHCP](https://tools.ietf.org/html/rfc2132) servers to configure their addresses. They discover the networks they are in and [complete the addresses themselves](https://tools.ietf.org/html/rfc4862) by generating the host part. This makes the network configuration simpler and scales better to larger networks. However, there’s some drawbacks to this approach. Firstly, the node needs to ensure that its address doesn’t collide with an address of any other node on the network. Secondly, if the node uses the same host part of the address in every network it enters then its movement can be tracked and the privacy is at risk. 通过IPv6方式激活的结点(译者注:结点在网络中指一个联网的设备)不需要类似IPv4网络中[DHCP](https://tools.ietf.org/html/rfc2132)服务器的中央机构来配置他们的地址。它们发现自己所在的网络然后通过生成主机部分来[自主生成地址](https://tools.ietf.org/html/rfc2132)。这种方式使得网络配置更加简单,并且能够更好的扩展到更大规模的网络。然而,这种方式也有一些缺点。首先,这个结点需要确保它的地址不会和网络上其他结点冲突。其次,如果这个结点在进入的每一个网络中使用相同的主机部分,它的运动就可以被追踪,如此一来,隐私便处于危险之中。 -Internet Engineering Task Force (IETF), the organization behind the Internet standards, [acknowledged this problem](https://tools.ietf.org/html/draft-iesg-serno-privacy-00) and recommends against use of hardware serial numbers to identify the node in the network. 负责制定因特网标准的组织Internet工程任务组(Internet Engineering Task Force,IETF)[意识到了这个问题](https://tools.ietf.org/html/draft-iesg-serno-privacy-00),这个组织建议取消使用硬件序列号来识别网络上的结点。 -But what does the actual implementation look like? 但实际的实施情况是怎样的呢? -The problem of address uniqueness is addressed with [Duplicate Address Detection](https://tools.ietf.org/html/rfc4862#section-5.4) (DAD) mechanism. When a node creates an address for itself it first checks whether another node uses the same address using the [Neighbor Discovery Protocol](https://tools.ietf.org/html/rfc4861) (a mechanism not unlike IPv4 [ARP](https://tools.ietf.org/html/rfc826) protocol). When it discovers the address is already used, it must discard it. 地址唯一性问题可以通过[重复地址检测(Duplicate Address Detection, DAD)](https://tools.ietf.org/html/rfc4862#section-5.4)机制来解决。当结点为自身创建地址的时候,他首先通过[邻居发现协议(Neighbor Discovery Protocol)](https://tools.ietf.org/html/rfc4861)(一种不同于IPv4 [ARP](https://tools.ietf.org/html/rfc826)协议的机制)来检查另一个结点是否使用了相同的地址。当它发现地址已经被使用,它必须抛弃掉这个地址。 -The other problem (privacy) is a bit harder to solve. An IP address (be it IPv4 or IPv6) address consists of a network part and the host part. The host discovers the relevant network parts and is supposed generate the host part. Traditionally it just uses an Interface Identifier derived from the network hardware’s (MAC) address. The MAC address is set at manufacturing time and can uniquely identify the machine. This guarantees the address is stable and unique. That’s a good thing for address collision avoidance but a bad thing for privacy. The host part remaining constant in different network means that the machine can be uniquely identified as it enters different networks. This seemed like non-issue at the time the protocol was designed, but the privacy concerns arose as the IPv6 gained popularity. Fortunately, there’s a solution to this problem. 解决另一个问题——隐私问题,有一点困难。一个IP地址(无论IPv4或IPv6)由网络部分和主机部分组成(译者注:网络部分用来划分子网,主机部分用来从相应子网中找到具体的主机)。主机查找出相关的网络部分,并且生成主机部分。传统上它只使用了源自网络硬件(MAC)地址的接口识别器。MAC地址在硬件制造的时候就被设置好了,它可以唯一的识别机器。这样就确保了地址的稳定性和唯一性。这对避免地址冲突来说是件好事,但是对隐私来说一点也不好。主机部分在不同网络下保持恒定意味着机器在进入不同网络时可以被唯一的识别。这在协议制定的时候看起来无可非议,但是随着IPv6的流行,人们对于隐私问题的担忧也愈演愈烈。幸运的是,解决办法还是有的。 -## Enter privacy extensions 进入隐私扩展 +## 进入隐私扩展 -It’s no secret that the biggest problem with IPv4 is that the addresses are scarce. This is no longer true with IPv6 and in fact an IPv6-enabled host can use addresses quite liberally. There’s absolutely nothing wrong with having multiple IPv6 addresses attached to the same interface. On the contrary, it’s a pretty standard situation. At the very minimum each node has an address that is used for contacting nodes on the same hardware link called a link-local address. When the network contains a router that connects it to other networks in the internet, a node has an address for every network it’s directly connected to. If a host has more addresses in the same network the node accepts incoming traffic for all of them. For the outgoing connections which, of course, reveal the address to the remote host, the kernel picks the fittest one. But which one is it? Pv4的最大问题——地址枯竭,已经不是什么秘密。对IPv6来说,这一点不再成立,事实上,使用IPv6的主机能够相当大方的利用地址。多个IPv6地址对应一块网卡绝对没有任何错误,正好相反,这是一种标准情形。最起码每个结点都有一个“本地连接地址”,它被用来与同一物理链路的结点联络。当网络包含了一个连接其他网络的路由器,这个网络中的每一个结点都有一个与每个直接连接网络联络的地址。如果主机在相同网络有更多的地址,结点(译者注:指路由器)将接受它们全部的传入流量。对于输出连接,它会把地址显示给远程主机,内核会挑选最适合的地址。但到底是哪一个呢? -With privacy extensions enabled, as defined by [RFC4941](https://tools.ietf.org/html/rfc4941), a new address with a random host part is generated every now and then. The newest one is used for new outgoing connections while the older ones are deprecated when they’re unused. This is a nifty trick — the host does not reveal the stable address as it’s not used for outgoing connections, but still accepts connections to it from the hosts that are aware of it. 隐私扩展可用时,就像[RFC4941](https://tools.ietf.org/html/rfc4941)定义的那样,时常会生成带有随机主机部分的新地址。最新的那个被用于最新的输出连接,与此同时,那些不被使用了的旧地址将被丢弃。这是一个极好的窍略——当固定地址不用于输出连接的时候,主机就不会显示它,但它仍然会接受注意到它的主机的连接。 -There’s a downside to this. Certain applications tie the address to the user identity. Consider a web application that issues a HTTP Cookie for the user during the authentication but only accepts it for the connections that come from the address that conducted the authentications. As the kernel generates a new temporary address, the server would reject the requests that use it, effectively logging the user out. It could be argued that the address is not an appropriate mechanism for establishing user’s identity but that’s what some real-world applications do. 但这也存在美中不足之处——某些应用会把地址与用户识别绑定在一起。让我们来考虑一下这种情形,一个web应用在用户认证的时候生成一个HTTP Cookie,但它只接受实施认证的地址的连接。当内核生成了一个新的临时地址,服务器会拒绝使用这个地址的请求,实际上相当于将用户登出。地址是不是建立用户认证的合适机制值得商榷,但这确实是现实中应用程序正在做的。 -## Privacy stable addressing to the rescue 解救之道——隐私固定寻址 +## 解救之道——隐私固定寻址 -Another approach would be needed to cope with this. There’s a need for an address that is unique (of course), stable for a particular network but still changes when user enters another network so that tracking is not possible. The RFC7217 introduces a mechanism that provides exactly this. 解决这个问题可能需要另辟蹊径。唯一的(当然咯)地址确实有必要,对于特定网络来说是稳定的,但当用户进入了另一个网络后仍然会变,这样的话追踪就变得几乎不可能。RFC7217介绍了一种如上所述的机制。 -Creation of a privacy stable address relies on a pseudo-random key that’s only known the host itself and never revealed to other hosts in the network. This key is then hashed using a cryptographically secure algorithm along with values specific for a particular network connection. It includes an identifier of the network interface, the network prefix and possibly other values specific to the network such as the wireless SSID. The use of the secret key makes it impossible to predict the resulting address for the other hosts while the network-specific data causes it to be different when entering a different network. 创建隐私固定地址依赖于伪随机值,这个随机值只被主机本身知晓,它不会显示给网络上的其他主机。这个随机值随后被一个密码安全算法加密,一起被加密的还有一些与网络连接的特殊值。这些值包含:用以标识网卡的标识符;网络前缀;对于这个网络来说有可能的其他特殊值,例如无线的SSID。使用安全值使其他主机很难预测结果地址,与此同时,当进入不同的网络时,网络的特殊数据会让地址变得不同。 -This also solves the duplicate address problem nicely. The random key makes collisions unlikely. If, in spite of this, a collision occurs then the hash can be salted with a DAD failure counter and a different address can be generated instead of failing the network connectivity. Now that’s clever. 这也巧妙的解决了地址重复问题。因为有随机值的存在,冲突也不太可能发生。万一发生了冲突,结果地址会得到重复地址检测失败的记录,这时会生成一个不同的地址而不会断开网络连接。看,这种方式很聪明吧。 -Using privacy stable address doesn’t interfere with the privacy extensions at all. You can use the [RFC7217](https://tools.ietf.org/html/rfc7217) stable address while still employing the RFC4941 temporary addresses at the same time. 使用隐私固定地址一点儿也不会妨碍隐私扩展。你可以在使用RFC4941所描述的临时地址的同时使用[RFC7217](https://tools.ietf.org/html/rfc7217)中的固定地址。 -## Where does NetworkManager stand? 网络管理器处于什么样的状况? +## 网络管理器处于什么样的状况? -We’ve already enabled the privacy extensions with the release NetworkManager 1.0.4. They’re turned on by default; you can control them with ipv6.ip6-privacy property. 我们已经在网络管理器1.0.4版本中实现了隐私扩展。在这个版本中,隐私扩展默认开启。你可以用ipv6.ip6-privacy参数来控制它。 -With the release of NetworkManager 1.2, we’re adding the stable privacy addressing. It’s supposed to address the situations where the privacy extensions don’t make the cut. The use of the feature is controlled with the ipv6.addr-gen-mode property. If it’s set to stable-privacy then stable privacy addressing is used. Setting it to “eui64” or not setting it at all preserves the traditional default behavior. 在网络管理器1.2版本中,我们将会加入固定隐私寻址。应该指出的是,目前的隐私扩展还不符合这种需求。我们可以使用ipv6.addr-gen-mode参数来控制这个特性。如果它被设置成固定隐私,那么将会使用固定隐私寻址。设置成“eui64”或者干脆不设置它将会保持传统的默认寻址方式。 -Stay tuned for NetworkManager 1.2 release in early 2016! If you want to try the bleeding-edge snapshot, give Fedora Rawhide a try. It will eventually become Fedora 24. 敬请期待明年,也就是2016年年初网络管理器1.2版本的发布吧!如果你想尝试一下最新的版本,不妨试试Fedora Rawhide,它最终会变成Fedora24。 -*I’d like to thank Hannes Frederic Sowa for a valuable feedback. The article would make less sense without his corrections. Hannes also created the in-kernel implementation of the RFC7217 mechanism which can be used when the networking is not managed by NetworkManager.* *我想感谢Hannes Frederic Sowa,他给了我很有价值的反馈。如果没有他的帮助,这篇文章的作用将会逊色很多。另外,Hannes也是RFC7217所描述机制的内核实现者,当网络管理器不起作用的时候,它将发挥作用。* -------------------------------------------------------------------------------- From 192c04d8421b89b3ff83e45b5bc408c430e1f62e Mon Sep 17 00:00:00 2001 From: Jeff Tsang Date: Mon, 28 Dec 2015 20:08:36 +0800 Subject: [PATCH 0080/1469] Update 20151206 NetworkManager and privacy in the IPv6 internet.md --- .../20151206 NetworkManager and privacy in the IPv6 internet.md | 1 - 1 file changed, 1 deletion(-) diff --git a/translated/tech/20151206 NetworkManager and privacy in the IPv6 internet.md b/translated/tech/20151206 NetworkManager and privacy in the IPv6 internet.md index 834d50a0ac..fb2eaa5af7 100644 --- a/translated/tech/20151206 NetworkManager and privacy in the IPv6 internet.md +++ b/translated/tech/20151206 NetworkManager and privacy in the IPv6 internet.md @@ -1,5 +1,4 @@ IPv6因特网中的隐私保护和网络管理器 - ====================== IPv6的使用量正在不断增加,让我们始料未及的是,伴随这个协议不断增加的使用量,大量隐私问题涌现出来。互联网社区在积极发表相关解决方案,当前状况是怎样的呢?网络管理器又是如何跟上的呢?让我们来瞧瞧吧! From fa3a39e735fe419e19f27421bc66d19b914c511d Mon Sep 17 00:00:00 2001 From: Stdio A Date: Mon, 28 Dec 2015 20:47:21 +0800 Subject: [PATCH 0081/1469] =?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 deleted: sources/talk/20151223 Ten Biggest Linux Stories Of The Year 2015.md new file: translated/talk/20151223 Ten Biggest Linux Stories Of The Year 2015.md --- ... Biggest Linux Stories Of The Year 2015.md | 125 ------------------ ... Biggest Linux Stories Of The Year 2015.md | 125 ++++++++++++++++++ 2 files changed, 125 insertions(+), 125 deletions(-) delete mode 100644 sources/talk/20151223 Ten Biggest Linux Stories Of The Year 2015.md create mode 100644 translated/talk/20151223 Ten Biggest Linux Stories Of The Year 2015.md diff --git a/sources/talk/20151223 Ten Biggest Linux Stories Of The Year 2015.md b/sources/talk/20151223 Ten Biggest Linux Stories Of The Year 2015.md deleted file mode 100644 index ce56ab4405..0000000000 --- a/sources/talk/20151223 Ten Biggest Linux Stories Of The Year 2015.md +++ /dev/null @@ -1,125 +0,0 @@ -StdioA translating - -Ten Biggest Linux Stories Of The Year 2015 -================================================================================ -![Biggest Linux Stories of 2015](http://itsfoss.com/wp-content/uploads/2015/12/Biggest-Linux-Stories-2015.jpg) - -Year 2015 is coming to an end and I am here with Year 2015 special series on It’s FOSS. First in this series is the biggest Linux stories of the year 2015. These stories are the ones that had the most impact on the Linux world, both positive and negative. - -I have summarized ten of such stories which created the most buzz in 2015. Here we go! - -### Biggest Linux and Open Source stories of the year 2015 ### - -Just to add, the listed items are not ordered chronologically. - -#### Microsoft’s partnering with Linux #### - -In late September, everyone was shocked to hear that [Microsoft created its own Linux distribution][1]. It was later revealed that [it was a software][2] developed for its Azur cloud switches. - -But the story did not end up just there. Microsoft indeed partnered with Canonical (parent company of Ubuntu Linux) for [HDInsight][3], Microsoft’s big data Hadoop-on-Azure service. Ubuntu was the first Linux on which [Microsoft deployed this software][4]. - -Will Microsoft continue its affair with Linux? Or will it dump it after Linux has served its purpose (Azur). Only time will tell. - -#### Microsoft releases Visual Studio Code for Linux #### - -Before Microsoft-Linux distribution uproar, Microsoft has dropped another bomb by releasing Visual Studio Code for Linux, along with Windows and OS X versions. Though Visual Studio Code is not open source, releasing a Linux version was somehow a win for Linux users. After all, Linus Torvalds had famously said, “if Microsoft ever does an application for Linux, it means I’ve won”. - -You can follow this tutorial to see [how to install Visual Studio Code in Ubuntu][5]. - -#### Apple open sources Swift programming language #### - -Apple was not behind in showing off its ‘love’ for Linux and Open Source. Apple’s flagship programming language Swift which is used for making iOS apps, [is now open source][6] with Linux ports available. Though in beta, you can easily [install Swift in Ubuntu][7]. - -But Apple is Apple and it [started bragging itself][8] as the “first major computer company to make Open Source development a key part of its software strategy…(sic)”. - -#### Ubuntu Phone finally launched #### - -Ubuntu Phone was finally launched earlier this year. Intended for early adopters and developers, Ubuntu was welcomed with open heart by the Ubuntu community. Mainstream smartphone users are still shying away from it, mainly [because the OS is still under heavy development][9]. Year 2016 will be deciding for the existence of Ubuntu Phone. - -#### Financial crisis hits Jolla #### - -Jolla, the company behind Linux based smartphone operating system Sailfish OS, hit a major financial hurdle. It resulted in [half of Jolla employees being laid off][10]. - -Jolla had a very [successful crowdfunding campaign][11] in 2014 for its tablet. Apparently, they spent most of the budget on the development of Sailfish OS and when the lead investor backed off, company struggled for its survival. - -Good news is that Jolla has managed to get some solid funding and its ]back in business][12]. - -#### Firefox OS is dead #### - -One of the open source alternatives to Android, Mozilla’s mobile operating system Firefox OS died a slow death earlier this month. Intended at developing countries with smartphones as cheap as $25, Firefox OS based smartphones could never gained popularity. I think lack of popular apps and cheap hardware was the main reason. - -In December, [Mozilla announced][13] that it will stop developing Firefox OS and also stop the sale of Firefox smartphones. - -Though it is never announced, I think even [Tizen][14], Linux foundation’s own Linux based mobile OS, is dead as well. I don’t see any development news on Tizen and Linux Foundation never promotes it. It is just the matter of time when we will be invited to the funeral of Tizen. - -#### Infighting in “Ubuntu family” #### - -There were lots of heated discussion in May this year when Kubuntu project lead, [Jonathan Riddell was forced out by Ubuntu Community Council][15]. Jonathan had asked questions about how the donations received by Ubuntu is being spent. He had complained that Kubuntu never saw the money. - -This led to an exchange of accusation between both sides. Ultimately, big daddy of Ubuntu, [Mark Shuttleworth asked Jonathan to step down][16]. - -#### Female Linux Kernel developer quits citing ‘brutal communication style’ #### - -Linux creator Linux Torvalds is known for the use of abusive language. Linux Kernel dev [Sarah Sharp][17] is also known for being out spoken. - -Sarah Sharp had earlier locked horns with Linus Torvalds in 2013 when she publicly [advised Linus to keep “verbal violence” off the mailing list][18]. Linus did not take it [lightly][19] as well. - -That was in 2013. In 2015, Sarah announced that she is [stepping down from her work in Kernel community][20] because the communication style lacks basic decency and is brutal and profane. - -This move left people discussing if Linux Kernel community should really change the way they behave or if Sarah took things too far. - -#### Unity gaming editor ported to Linux #### - -While [gaming on Linux][21] is still the Achilles heel for Linux users, the community got excited when gaming engine Unity announced that it is testing its [game editor on Linux][22]. As Linux is used very well for rendering, it is speculated that this move will bring game developers to Linux. It is not confirmed yet if Unity will actually bring a final Linux version of its game editor though. - -#### Open Source adoption in government organization #### - -Administration in several [European cities decided to ditch proprity software][23] and opt for open source alternatives. Most city administration replaced Microsoft Office with LibreOffice or OpenOffice. Few cities and [government][24] schools also went ahead and replaced Microsoft Windows with Linux. - -Cost cutting was one of the major factor in this decision as the city administration saved hundreds of thousands of Euro by adopting Open Source. - -Universities were not far behind in adopting open source as well. All year round, we get to hear how a [university dropped Photoshop for Krita][25] or [university using open source office][26]. - -### Conclusion ### - -As with any other year, 2015 also had some positive and some negative moments for Linux lovers. We saw competitors like Microsoft and Apple coming close to Linux, government organizations adopting to open source. At the same time, we witnessed the failure of Firefox smartphone OS. A mixed year, I would say. - -What do you think? I let you share what you think was the most important news for Linux-ers in the year 2015 and your overall feel about it. - --------------------------------------------------------------------------------- - -via: http://itsfoss.com/biggest-linux-stories-2015/ - -作者:[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.theregister.co.uk/2015/09/18/microsoft_has_developed_its_own_linux_repeat_microsoft_has_developed_its_own_linux/ -[2]:http://arstechnica.com/information-technology/2015/09/microsoft-has-built-software-but-not-a-linux-distribution-for-its-software-switches/ -[3]:https://azure.microsoft.com/en-us/services/hdinsight/ -[4]:http://www.zdnet.com/article/microsoft-deploys-first-major-server-application-on-ubuntu-linux/ -[5]:http://itsfoss.com/install-visual-studio-code-ubuntu/ -[6]:http://itsfoss.com/swift-open-source-linux/ -[7]:http://itsfoss.com/use-swift-linux/ -[8]:https://business.facebook.com/itsfoss/photos/pb.115098615297581.-2207520000.1450817108./634288916711879/?type=3&theater -[9]:http://www.engadget.com/2015/07/24/ubuntu-phone-review/ -[10]:http://techcrunch.com/2015/11/20/jolla-running-out-of-runway-for-its-android-alternative/ -[11]:https://www.indiegogo.com/projects/jolla-tablet-world-s-first-crowdsourced-tablet#/ -[12]:https://blog.jolla.com/jolla-back-business/ -[13]:http://arstechnica.com/gadgets/2015/12/firefox-os-smartphones-are-dead/ -[14]:https://www.tizen.org/ -[15]:http://www.omgubuntu.co.uk/2015/05/kubuntu-project-lead-asked-to-step-down-by-ubuntu-community-council -[16]:http://www.cio.com/article/2926838/linux/mark-shuttleworth-ubuntu-community-council-ask-kubuntu-developer-to-step-down-as-leader.html -[17]:http://sarah.thesharps.us/ -[18]:http://www.techeye.net/chips/linus-torvalds-and-intel-woman-in-sweary-spat -[19]:http://marc.info/?l=linux-kernel&m=137392506516022&w=2 -[20]:http://www.networkworld.com/article/2988850/opensource-subnet/linux-kernel-dev-sarah-sharp-quits-citing-brutal-communications-style.html -[21]:http://itsfoss.com/linux-gaming-guide/ -[22]:http://itsfoss.com/unity-gaming-engine-linux/ -[23]:http://itsfoss.com/tag/open-source-adoption/ -[24]:http://itsfoss.com/spanish-school-ditches-windows-ubuntu/ -[25]:http://itsfoss.com/french-university-dumps-adobe-photoshop-open-source-app-krita/ -[26]:http://itsfoss.com/hungarian-universities-switch-eurooffice/ diff --git a/translated/talk/20151223 Ten Biggest Linux Stories Of The Year 2015.md b/translated/talk/20151223 Ten Biggest Linux Stories Of The Year 2015.md new file mode 100644 index 0000000000..90c8f2f6a7 --- /dev/null +++ b/translated/talk/20151223 Ten Biggest Linux Stories Of The Year 2015.md @@ -0,0 +1,125 @@ +# 2015年度十大Linux事件 + +![2015年的大事件](http://itsfoss.com/wp-content/uploads/2015/12/Biggest-Linux-Stories-2015.jpg) + +2015年即将结束,我在这里(It's FOSS)发表《2015年的大事件》系列。这个系列的第一篇文章为《2015十大Linux事件》。这些事件在Linux世界中产生了极大的影响,无论它们是积极的还是消极的。 + +我总结了2015发生的十个像这样——产生了最大影响的事件。黑喂狗! + +### 2015年度十大Linux/开源相关事件 + +补充一句,以下这些项目没有按照时间顺序排列。 + +#### 微软与Linux的结盟 + +在9月下旬,所有人听到[微软构建了自己的Linux发行版][1]这个消息时都大吃一惊。其在后来被揭露,这其实是一个微软开发的用于`Azur cloud switches`的[软件][2]。 + +但故事还没结束。微软真的与Canonical (Ubuntu Linux的母公司)达成合作 来开发[HDInsight][3]——微软在通过Azure上构建Hadoop来进行大数据处理的服务. Ubuntu是[微软在其上部署软件][4]的第一个Linux系统。 + +微软会继续保持它与Linux的关系吗? 还是在使用Linux达到其目的(Azur)就会收手?只有时间能告诉我们一切。 + +#### 微软发布适用于Linux的Visual Studio Code + +在微软发布Linux发行版引起喧嚣之前,微软扔下了另一枚炸弹——发布Linux版Visual Studio Code, 与其一并发布的还有Windows以及OS X版。尽管Visual Studio Code并不是开源的,从某种意义上讲,发布Linux版本仍然是Linux用户的胜利。 无论如何,Linus Torvalds曾说过一句很著名的话:“如果微软给Linux开发过一款应用的话,这就意味着我已经赢了”。 + +你可以看这个教程来学习[如何在Ubuntu中安装Visual Studio Code][5]。 + +#### 苹果公司开源编程语言Swift + +在向Linux及开源“示爱”方面,苹果公司也不甘示弱。苹果用来制作iOS应用的首选编程语言Swift, [现已开源][6]并移植到Linux中。虽然其还在测试中,但你可以轻易地[在Ubuntu中安装Swift][7]。 + +但是,苹果就是苹果,它[开始吹嘘][8]其为“第一个视开源开发为公司的关键软件开发策略的计算机公司巨头(原文如此)”。 + +#### Ubuntu手机终于发布 + +Ubuntu手机终于在今年年初发布。 因其早期使用者及开发者,Ubuntu深受Ubuntu社区喜爱。主流智能机用户仍然回避它,主要[因为该系统还在大规模开发中][9]。对于Ubuntu手机的问世,2016年将成为决定性的一年。 + +#### Jolla遭受经济危机 + +Jolla, Sailfish OS —— 以Linux为基础的智能手机系统的幕后公司,遭受了严重的财政障碍。这导致了[一半的Jolla员工罢工][10]。 + +Jolla在2014年针对它的平板电脑完成了一次非常[成功的众筹][11],显然,他们将大部分预算都花在了Sailfish OS的开发上,而在主要投资者退出后,公司在挣扎以求生存。 + +不过有一个好消息,Jolla成功拿到了一些雄厚的资金,而且他们已[回归经营生意][12]。 + +#### Firefox OS已死 + +作为安卓的开源替代品,Mozila的移动操作系统Firefox OS在这个月初慢性死亡。本打算在发展中国家售卖低至25美金的智能手机,可Firefox OS永远没有流行起来。我认为主要原因是它的硬件廉价,以及它缺少流行应用。 + +在十二月,[Mozilla宣布][13]其将停止开发Firefox OS, 并停止出售Firefox智能手机。 + +我认为[Tizen][14], Linux基金会旗下的基于Linux的移动操作系统,也已经消失了,尽管其从未发布过。我没有看到任何关于Tizen开发的消息,而且Linux基金会从未推动过它的开发。Tizen何时死亡只是一个时间问题。 + +#### “Ubuntu家族”内讧 + +今年五月,Jonathan Riddell,Kubuntu项目的领导者,[被Ubuntu社区委员会强制要求下台][15],这引起了很多激烈的讨论。Jonathan曾质问Ubuntu所收捐款的使用情况,他抱怨Kubuntu从未见到过这些钱。 + +这导致了两方的互相谴责。最终。Ubuntu的老爹,[Mark Shuttleworth要求Jonathan下台][16]。 + +#### 女性Linux内核开发者因“野蛮的沟通方式”而退出 + +Linux之父Linus Torvalds因其粗俗的语言而著称。Linux内核开发者[Sarah Sharp][17]也因为嘴快心直而著称。 + +Sarah Sharp曾在2013年与Linus Torvalds公开争执,[建议Linus将“语言暴力”赶出邮件列表][18]。Linus也没有[委婉地][19]回复她。 + +那是在2013年。2015年,Sarah宣布她正在[逐步停止她在内核社区的工作][20]因为他们的交流方式缺乏基本礼仪,并且野蛮而充满亵渎。 + +这一举动让人们开始讨论Linux内核社区是否真的应该改变他们的行为方式,还是Sarah做的太过分了。 + +#### Unity游戏编辑器移植到Linux平台 + +尽管[在Linux上玩游戏][21]认识Linux用户们的阿克琉斯之踵,整个社区在游戏引擎Unity宣布其正在测试[Linux下的游戏编辑器][22]时都沸腾了。因为在渲染图像时,Linux是一个最流行的选择,所以我们推测这将使游戏开发者向Linux靠拢。不过,Unity是否真的会推出一个最终版本的游戏编辑器,这个问题还未被证实。 + +#### 政府机构采用开源软件 + +欧洲数个城市的管理机构决定[抛弃先前的软件][23],并使用其开源的替代品。大多数城市管理机构将Microsoft Office替换为LibreOffice或OpenOffice. 一些城市管理机构和[公立学校][24]也跟进,将Microsoft Windows换成Linux. + +对于这一行为,削减成本是一个重要的因素,因为城市管理机构通过采用开源软件省下了无数欧元。 + +大学也并没有在采用开源软件的道路上落后。这一年,我们听到了[大学如何抛弃Photoshop改用Krita][25]以及[大学使用开源Office软件][26]的消息。 + +### 总结 + +与其他年一样,2015年同样有许多另Linux爱好者感到积极或消极的时刻。我们看到Linux的竞争者,如微软和苹果,向Linux靠拢,政府机构采用开源软件。同时,我们特见证了Firefox智能手机系统的失败。我想说,这真是喜忧参半的一年。 + +你认为呢?我希望你们分享你们所认为对于Linuxer们来说最重要的新闻,和你们对这一年的整体感受。 + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/biggest-linux-stories-2015/ + +作者:[Abhishek][a] + +译者:[ StdioA](https://github.com/StdioA) + +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://itsfoss.com/author/abhishek/ +[1]: http://www.theregister.co.uk/2015/09/18/microsoft_has_developed_its_own_linux_repeat_microsoft_has_developed_its_own_linux/ +[2]: http://arstechnica.com/information-technology/2015/09/microsoft-has-built-software-but-not-a-linux-distribution-for-its-software-switches/ +[3]: https://azure.microsoft.com/en-us/services/hdinsight/ +[4]: http://www.zdnet.com/article/microsoft-deploys-first-major-server-application-on-ubuntu-linux/ +[5]: http://itsfoss.com/install-visual-studio-code-ubuntu/ +[6]: http://itsfoss.com/swift-open-source-linux/ +[7]: http://itsfoss.com/use-swift-linux/ +[8]: https://business.facebook.com/itsfoss/photos/pb.115098615297581.-2207520000.1450817108./634288916711879/?type=3&theater +[9]: http://www.engadget.com/2015/07/24/ubuntu-phone-review/ +[10]: http://techcrunch.com/2015/11/20/jolla-running-out-of-runway-for-its-android-alternative/ +[11]: https://www.indiegogo.com/projects/jolla-tablet-world-s-first-crowdsourced-tablet#/ +[12]: https://blog.jolla.com/jolla-back-business/ +[13]: http://arstechnica.com/gadgets/2015/12/firefox-os-smartphones-are-dead/ +[14]: https://www.tizen.org/ +[15]: http://www.omgubuntu.co.uk/2015/05/kubuntu-project-lead-asked-to-step-down-by-ubuntu-community-council +[16]: http://www.cio.com/article/2926838/linux/mark-shuttleworth-ubuntu-community-council-ask-kubuntu-developer-to-step-down-as-leader.html +[17]: http://sarah.thesharps.us/ +[18]: http://www.techeye.net/chips/linus-torvalds-and-intel-woman-in-sweary-spat +[19]: http://marc.info/?l=linux-kernel&m=137392506516022&w=2 +[20]: http://www.networkworld.com/article/2988850/opensource-subnet/linux-kernel-dev-sarah-sharp-quits-citing-brutal-communications-style.html +[21]: http://itsfoss.com/linux-gaming-guide/ +[22]: http://itsfoss.com/unity-gaming-engine-linux/ +[23]: http://itsfoss.com/tag/open-source-adoption/ +[24]: http://itsfoss.com/spanish-school-ditches-windows-ubuntu/ +[25]: http://itsfoss.com/french-university-dumps-adobe-photoshop-open-source-app-krita/ +[26]: http://itsfoss.com/hungarian-universities-switch-eurooffice/ From ecb5c53f050396236af94ce61b3eb43f18498ea1 Mon Sep 17 00:00:00 2001 From: Bian Jiaping Date: Tue, 29 Dec 2015 00:42:40 +0800 Subject: [PATCH 0082/1469] Translated 'How to Use Glances to Monitor System on Ubuntu' --- ...Use Glances to Monitor System on Ubuntu.md | 108 ----------------- ...Use Glances to Monitor System on Ubuntu.md | 109 ++++++++++++++++++ 2 files changed, 109 insertions(+), 108 deletions(-) delete mode 100644 sources/tech/20151223 How to Use Glances to Monitor System on Ubuntu.md create mode 100644 translated/tech/20151223 How to Use Glances to Monitor System on Ubuntu.md diff --git a/sources/tech/20151223 How to Use Glances to Monitor System on Ubuntu.md b/sources/tech/20151223 How to Use Glances to Monitor System on Ubuntu.md deleted file mode 100644 index 8237aa4f25..0000000000 --- a/sources/tech/20151223 How to Use Glances to Monitor System on Ubuntu.md +++ /dev/null @@ -1,108 +0,0 @@ -translating by bianjp - -How to Use Glances to Monitor System on Ubuntu -================================================================================ -![](https://www.maketecheasier.com/assets/uploads/2015/12/glances_featured.jpg) - -Glances is a cross-platform command-line text-based tool to monitor your system. It is written in Python language and uses the `psutil` library to get information from the system. Using it you can monitor CPU, Load Average, Memory, Network Interfaces, Disk I/O, File System spaces utilization, mounted devices, total number of active processes and top processes. There are many interesting options available in Glances. One of the main features is that you can set thresholds (careful, warning and critical) in a configuration file, and information will be shown in colors which indicates the bottleneck in the system. - -### Glances Features ### - -- the average CPU load -- total number of processes like active, sleeping processes, etc. -- total memory information like RAM, swap, free memory, etc. -- CPU information -- Network download and upload speed of connections -- Disk I/O read/write speed details -- Currently mounted devices’ disk usages -- Top processes with their CPU/memory usages - -### Installing Glances ### - -Installing Glances on Ubuntu is easy, as it is available on Ubuntu’s repository. You can install Glances by running the following command. - - sudo apt-get install glances - -### Usage of Glances ### - -After installation has been finished, you can launch Glances by running the following command: - - glances - -You will see an output like the following: - -![glances monitor system output](https://www.maketecheasier.com/assets/uploads/2015/12/glances_output1.png) - -Press ESC or “Ctrl + C” to quit from the Glances terminal. - -By default, the interval time is set to 1 second, but you can define the custom interval time while running glances from the terminal. - -To set the interval time to 5 seconds, run the following command: - - glances -t 5 - -### Glances Color Codes ### - -Glances color code meanings: - -- `GREEN` : OK -- `BLUE` : CAREFUL -- `VIOLET` : ALERT -- `RED` : CRITICAL - -By default, Glances thresholds set is: careful=50, warning=70, critical=90. You can customize the threshold by using the default configuration file glances.conf located at the “/etc/glances/” directory. - -### Glances Options ### - -Glances provides sever so hot keys to find output information while it is running. - -Below are the list of several hot keys. - -- `m` : sort processes by MEM% -- `p` : sort processes by name -- `c` : sort processes by CPU% -- `d` : show/hide disk I/O stats -- `a` : sort processes automatically -- `f` : show/hide file system statshddtemp -- `i` : sort processes by I/O rate -- `s` : show/hide sensors’ stats -- `y` : show/hide hddtemp stats -- `l` : show/hide logs -- `n` : show/hide network stats -- `x` : delete warning and critical logs -- `h` : show/hide help screen -- `q` : quit -- `w` : delete warning logs - -### Use Glances to Monitor Remote Systems ### - -You can also monitor remote systems using Glances. To use it on a remote system, use the following command: - - glances -s - -You will see an output like the following: - -![glances monitor remote system server](https://www.maketecheasier.com/assets/uploads/2015/12/glances_server.png) - -You will see Glances running on port 61209. - -Now, go to the remote machine and execute the following command to connect to a Glances server by specifying the IP address as shown below. For example, 192.168.1.10 is your Glances server IP address. - - glances -c -P 192.168.1.10 - -### Conclusion ### - -Glances is a very useful tool for every Linux system administrator. Using it, you can easily monitor your Linux system in less time. Feel free to comment if you have any questions. - --------------------------------------------------------------------------------- - -via: https://www.maketecheasier.com/glances-monitor-system-ubuntu/ - -作者:[Hitesh Jethva][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.maketecheasier.com/author/hiteshjethva/ - diff --git a/translated/tech/20151223 How to Use Glances to Monitor System on Ubuntu.md b/translated/tech/20151223 How to Use Glances to Monitor System on Ubuntu.md new file mode 100644 index 0000000000..46541196a6 --- /dev/null +++ b/translated/tech/20151223 How to Use Glances to Monitor System on Ubuntu.md @@ -0,0 +1,109 @@ +如何在 Ubuntu 上使用 Glances 监控系统 +================================================================================ + +![](https://www.maketecheasier.com/assets/uploads/2015/12/glances_featured.jpg) + +Glances 是一个跨平台、基于命令行、文本模式的系统监控工具。它是用 Python 编写的,使用 `psutil` 库从系统获取信息。你可以用它来监控 CPU、平均负载、内存、网络接口、磁盘 I/O,文件系统空间利用率、挂载的设备、所有活动进程以及消耗资源最多的进程。Glances 有很多有趣的选项。它的主要特性之一是可以在配置文件中设置阀值(careful[小心]、warning[警告]、critical[致命]),然后它会用不同颜色显示信息以表明系统的瓶颈。 + +### Glances 的功能 + +- CPU 平均负载 +- 不同状态(如活动、休眠)进程的数量 +- 所有内存信息,如物理内存、交换空间、空闲内存 +- CPU 信息 +- 网络连接的上行/下行速度 +- 磁盘 I/O 读/写速度详细信息 +- 当前挂载设备的磁盘使用情况 +- 消耗资源最多的进程和他们的 CPU/内存使用情况 + +### 安装 Glances + +Glances 在 Ubuntu 的软件源中,所以安装很简单。执行下面的命令安装 Glances: + + sudo apt-get install glances + +(LCTT 译注:若安装后无法正常使用,可考虑使用 pip 安装/升级glances:`sudo pip install --upgrade glances`) + +### Glances 使用方法 + +安装完成后,可以执行下面的命令启动 Glances: + + glances + +你将看到类似下图的输出: + +![glances monitor system output](https://www.maketecheasier.com/assets/uploads/2015/12/glances_output1.png) + +要退出 Glances 终端,按 ESC 键或 “Ctrl + C”。 + +默认情况下,时间间隔(LCTT 译注:显示数据刷新的时间间隔)是 1s,不过你可以在从终端启动 Glances 时自定义时间间隔。 + +要把时间间隔设为 5s,执行下面的命令: + + glances -t 5 + +### Glances 中不同颜色含义 + +Glances 中不同颜色的含义: + +- `绿色`:正常 +- `蓝色`:需要注意 +- `紫色`:警告 +- `红色`:严重 + +默认设置下,Glances 的阀值设置是:careful=50,warning=70,critical=90。你可以通过 “/etc/glances/” 目录下的默认配置文件 glances.conf 来自定义这些阀值。 + +### Glances 的选项 + +Glances 提供了很多快捷键,可以在它运行时用来查找输出信息。 + +下面是一些常用的热键列表: + +- `m` : 按内存占用排序进程 +- `p` : 按进程名称排序进程 +- `c` : 按 CPU 占用率排序进程 +- `i` : 按 I/O 频率排序进程 +- `a` : 自动排序进程 +- `d` : 显示/隐藏磁盘 I/O 统计信息 +- `f` : 显示/隐藏文件系统统计信息 +- `s` : 显示/隐藏传感器统计信息 +- `y` : 显示/隐藏硬盘温度统计信息 +- `l` : 显示/隐藏日志 +- `n` : 显示/隐藏网络统计信息 +- `x` : 删除警告和严重日志 +- `h` : 显示/隐藏帮助界面 +- `q` : 退出 +- `w` : 删除警告记录 + +### 使用 Glances 监控远程系统 + +你也可以使用 Glances 监控远程系统。要在远程系统上使用它,使用下面的命令: + + glances -s + +你会看到类似下面的输出: + +![glances monitor remote system server](https://www.maketecheasier.com/assets/uploads/2015/12/glances_server.png) + +如你所见,Glances 运行在 61209 端口。 + +现在,到远程机器上执行下面的命令以连接到指定 IP 地址的 Glances 服务器上。假设 192.168.1.10 是你的 Glances 服务器 IP 地址。 + + glances -c -P 192.168.1.10 + +### 结论 + +对于每个 Linux 系统管理员来说,Glances 都是一个非常有用的工具。使用它,你可以轻松、高效地监控 Linux 系统。如果你有什么问题,自由地评论吧。 + +-------------------------------------------------------------------------------- + +via: https://www.maketecheasier.com/glances-monitor-system-ubuntu/ + +作者:[Hitesh Jethva][a] +译者:[bianjp](https://github.com/bianjp) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.maketecheasier.com/author/hiteshjethva/ + From 708a5ed930f0099d80981c58d39c3669dc366884 Mon Sep 17 00:00:00 2001 From: carolinewuyan <309866211@qq.com> Date: Tue, 29 Dec 2015 10:39:54 +0800 Subject: [PATCH 0083/1469] =?UTF-8?q?=E5=B7=B2=E6=A0=A1=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...P Framework on CentOS 7 or Ubuntu 15.04.md | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/translated/tech/20151204 How to Install Laravel PHP Framework on CentOS 7 or Ubuntu 15.04.md b/translated/tech/20151204 How to Install Laravel PHP Framework on CentOS 7 or Ubuntu 15.04.md index 431bd652a7..fe8da81be3 100644 --- a/translated/tech/20151204 How to Install Laravel PHP Framework on CentOS 7 or Ubuntu 15.04.md +++ b/translated/tech/20151204 How to Install Laravel PHP Framework on CentOS 7 or Ubuntu 15.04.md @@ -1,13 +1,13 @@ -如何在 CentOS 7 / Ubuntu 15.04 上安装 PHP 框架 Framework +如何在 CentOS 7 / Ubuntu 15.04 上安装 PHP 框架 Laravel ================================================================================ -大家好,这篇文章将要讲述如何在 CentOS 7 / Ubuntu 15.04 上安装 PHP 框架 Laravel。如果你是一个 PHP Web 的开发者,你并不需要关心各种琳琅满目的现代 PHP 框架,Laravel 是最易用同时也是最能节省你时间的一个框架,能让你享受到 web 开发的乐趣。一个好的框架能让你在简单的使用指导下能快速开发出最核心的代码,Laravel 拥抱这一普世的开发哲学。你能抱持很高的开发效率并且无痛重构你现有的代码。 +大家好,这篇文章将要讲述如何在 CentOS 7 / Ubuntu 15.04 上安装 Laravel。如果你是一个 PHP Web 的开发者,你并不需要关心各种琳琅满目的现代 PHP 框架,Laravel 是最轻松启动和运行的,它省时省力,能让你享受到 web 开发的乐趣。Laravel 信奉着一个普世的开发哲学,作为一个好的框架它为你提供了高度优先权,让你在简单的使用指导下创建出可维护代码,你应该保持着高速的开发效率,能够随时毫不畏惧更改你的代码来打破现有功能。 -Laravel 安装极其容易,你只要跟着本文章一步步操作就能在 CentOS 7 或者 Ubuntu 15 服务器上安装。 +Laravel 安装并不繁琐,你只要跟着本文章一步步操作就能在 CentOS 7 或者 Ubuntu 15 服务器上安装。 ### 1) 服务器要求 ### -在安装 Laravel 前需要安装一些它的依赖和先决条件,这些包括升级系统到最新版本,sudo 权限,和安装依赖包。 +在安装 Laravel 前需要安装一些它的依赖前提条件,主要是一些基本的参数调整,比如升级系统到最新版本,sudo 权限和安装依赖包。 当你连接到你的服务器时,请确保你能通以下命令能成功的使用 EPEL 仓库并且升级你的服务器。 @@ -37,15 +37,15 @@ Laravel 安装极其容易,你只要跟着本文章一步步操作就能在 Ce # apt-get install -y php5 mcrypt php5-mcrypt php5-gd -### 2) Firewall Setup ### +### 2) 防火墙安装 ### -系统防火墙和 SELinux 设置对于用于生产的服务器安全来说非常重要,你可以关闭防火墙和用以下命令行设置 SELinux 成宽容模式(permissive)模式来保证安装程序不受他们的影响。 +系统防火墙和 SELinux 设置对于用于产品应用安全来说非常重要,当你使用测试服务器的时候可以关闭防火墙,用以下命令行设置 SELinux 成宽容模式(permissive)模式来保证安装程序不受它们的影响。 # setenforce 0 -### 3) Apache, MariaDB, PHP Setup ### +### 3) Apache, MariaDB, PHP 安装 ### -Laravel 安装程序需要完成安装 LAMP 整个环境,需要额外安装 OpenSSL, PDO, Mbstring 和 Tokenizer PHP Extensions。如果 LAMP 已经运行在你的服务器上你可以跳过这部,但是需要注意一些必要的 PHP 插件是否安装好。 +Laravel 安装程序需要完成安装 LAMP 整个环境,需要额外安装 OpenSSL、PDO,Mbstring 和 Tokenizer PHP Extensions。如果 LAMP 已经运行在你的服务器上你可以跳过这一步,直接确认一些必要的 PHP 插件是否安装好。 要安装完整 AMP 你需要在自己的服务器上运行以下命令。 @@ -53,7 +53,7 @@ Laravel 安装程序需要完成安装 LAMP 整个环境,需要额外安装 Op # yum install httpd mariadb-server php56w php56w-mysql php56w-mcrypt php56w-dom php56w-mbstring -要在 CentOS 7 上实现 MySQL / Mariadb 服务开机自动启动,你需要运行以下命令 +要在 CentOS 7 上实现 MySQL / Mariadb 服务开机自动启动,你需要运行以下命令。 # systemctl start httpd # systemctl enable httpd @@ -63,7 +63,7 @@ Laravel 安装程序需要完成安装 LAMP 整个环境,需要额外安装 Op #systemctl start mysqld #systemctl enable mysqld -在启动 MariaDB 服务之后,你需要运行以下命令配置一个足够安全的密码 +在启动 MariaDB 服务之后,你需要运行以下命令配置一个足够安全的密码。 #mysql_secure_installation @@ -77,7 +77,7 @@ Laravel 安装程序需要完成安装 LAMP 整个环境,需要额外安装 Op #### CentOS/Ubuntu #### -在 CentOS / Ubuntu 下运行以下命令来配置 composer +在 CentOS / Ubuntu 下运行以下命令来配置 composer 。 # curl -sS https://getcomposer.org/installer | php # mv composer.phar /usr/local/bin/composer @@ -85,13 +85,13 @@ Laravel 安装程序需要完成安装 LAMP 整个环境,需要额外安装 Op ![composer installation](http://blog.linoxide.com/wp-content/uploads/2015/11/14.png) -### 5) Installing Laravel ### +### 5) 安装 Laravel ### -我们可以运行以下命令从 github 上下载 Laravel 的安装包 +我们可以运行以下命令从 github 上下载 Laravel 的安装包。 # wget https://github.com/laravel/laravel/archive/develop.zip -运行以下命令解压安装包并且移动 document 的根目录 +运行以下命令解压安装包并且移动 document 的根目录。 # unzip develop.zip @@ -99,22 +99,22 @@ Laravel 安装程序需要完成安装 LAMP 整个环境,需要额外安装 Op # mv laravel-develop /var/www/ -现在使用 compose 命令来安装目录下所有 Laravel 所需要的依赖 +现在使用 compose 命令来安装目录下所有 Laravel 所需要的依赖。 # cd /var/www/laravel-develop/ # composer install ![compose laravel](http://blog.linoxide.com/wp-content/uploads/2015/11/25.png) -### 6) Key Encryption ### +### 6) 密钥 ### -为了加密服务器,我们使用以下命令来生成一个加密后的 32 位的密钥 +为了加密服务器,我们使用以下命令来生成一个加密后的 32 位的密钥。 # php artisan key:generate Application key [Lf54qK56s3qDh0ywgf9JdRxO2N0oV9qI] set successfully -现在把这个密钥放到 'app.php' 文件,如以下所示 +现在把这个密钥放到 'app.php' 文件,如以下所示。 # vim /var/www/laravel-develop/config/app.php @@ -122,7 +122,7 @@ Laravel 安装程序需要完成安装 LAMP 整个环境,需要额外安装 Op ### 7) 虚拟 Host 和 所属用户 ### -在 composer 安装好后,分配 document 根目录的权限和所属用户,如下所示 +在 composer 安装好后,分配 document 根目录的权限和所属用户,如下所示。 # chmod 775 /var/www/laravel-develop/app/storage @@ -130,7 +130,7 @@ Laravel 安装程序需要完成安装 LAMP 整个环境,需要额外安装 Op # chown -R apache:apache /var/www/laravel-develop -用任意一款编辑器打开 apache 服务器的默认配置文件,在文件最后加上虚拟 host 入口 +用任意一款编辑器打开 apache 服务器的默认配置文件,在文件最后加上虚拟 host 入口。 # vim /etc/httpd/conf/httpd.conf @@ -143,7 +143,7 @@ Laravel 安装程序需要完成安装 LAMP 整个环境,需要额外安装 Op AllowOverride All Directory close -现在我们用以下命令重启 apache 服务器,打开浏览器查看 localhost 页面 +现在我们用以下命令重启 apache 服务器,打开浏览器查看 localhost 页面。 #### CentOS #### @@ -153,15 +153,15 @@ Laravel 安装程序需要完成安装 LAMP 整个环境,需要额外安装 Op # service apache2 restart -### 8) Laravel 5 Web Access ### +### 8) Laravel 5 网络访问 ### -打开浏览器然后输入你的配置的 IP 地址或者绝对域名(to 校对:「绝对域名」译自 https://zh.wikipedia.org/wiki/%E5%AE%8C%E6%95%B4%E7%B6%B2%E5%9F%9F%E5%90%8D%E7%A8%B1#cite_note-1)你将会看到 Laravel 5 的默认页面 +打开浏览器然后输入你配置的 IP 地址或者绝对域名(Fully qualified domain name)你将会看到 Laravel 5 的默认页面。 ![Laravel Default](http://blog.linoxide.com/wp-content/uploads/2015/11/35.png) -### 结论 ### +### 总结 ### -Laravel 框架对于开发网页应用来说是一个绝好的的工具。所以,看了这篇文章你将学会在 Ubuntu 15 和 CentOS 7 上安装 Laravel 之后你就能开始使用这超棒的框架提供的各种功能来舒服的来进行你的开发工作。如果你有什么意见或者建议请发表在评论内容上,我们将根据您宝贵的反馈来使我们的文章更加浅显易懂。 +Laravel 框架对于开发网页应用来说是一个绝好的的工具。所以,看了这篇文章你将学会在 Ubuntu 15 和 CentOS 7 上安装 Laravel, 之后你就可以使用这个超棒的PHP框架提供的各种功能和舒适便捷性来进行你的开发工作。如果您有什么意见或者建议请在以下评论区中回复,我们将根据您宝贵的反馈来使我们的文章更加浅显易懂。 -------------------------------------------------------------------------------- @@ -169,7 +169,7 @@ via: http://linoxide.com/linux-how-to/install-laravel-php-centos-7-ubuntu-15-04/ 作者:[Kashif][a] 译者:[NearTan](https://github.com/NearTan) -校对:[校对者ID](https://github.com/校对者ID) +校对:[Caroline](https://github.com/carolinewuyan) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 5783a8754c8725ab98617a65ab722869be68d171 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 29 Dec 2015 14:24:32 +0800 Subject: [PATCH 0084/1469] PUB:20151130 eSpeak--Text To Speech Tool For Linux @soooogreen --- ...0 eSpeak--Text To Speech Tool For Linux.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) rename {translated/share => published}/20151130 eSpeak--Text To Speech Tool For Linux.md (70%) diff --git a/translated/share/20151130 eSpeak--Text To Speech Tool For Linux.md b/published/20151130 eSpeak--Text To Speech Tool For Linux.md similarity index 70% rename from translated/share/20151130 eSpeak--Text To Speech Tool For Linux.md rename to published/20151130 eSpeak--Text To Speech Tool For Linux.md index f4ec1f20e1..e968be847b 100644 --- a/translated/share/20151130 eSpeak--Text To Speech Tool For Linux.md +++ b/published/20151130 eSpeak--Text To Speech Tool For Linux.md @@ -11,34 +11,34 @@ eSpeak 部分主要特性如下: - 提供给 Linux 和 Windows 的命令行工具 - 从文件或者标准输入中把文本读出来 - 提供给其它程序使用的共享库版本 -- 为 Windows 提供SAPI5版本,在screen-readers或者其它支持Windows SAPI5接口程序的支持下,eSpeak仍然能正常使用 +- 为 Windows 提供 SAPI5 版本,所以它能用于 screen-readers 或者其它支持 Windows SAPI5 接口的程序 - 可移植到其它平台,包括安卓,OSX等 - 提供多种声音特性选择 -- 语音输出可保存为[.WAV][2]格式的文件 -- 部分SSML([Speech Synthesis Markup Language][3]语音合成标记语言)能为HTML所支持 +- 语音输出可保存为 [.WAV][2] 格式的文件 +- 配合 HTML 部分可支持 SSML(语音合成标记语言,[Speech Synthesis Markup Language][3]) - 体积小巧,整个程序连同语言支持等占用小于2MB -- 可以实现文本到音素编码的转化,因此能适应成为其它语音合成引擎的前端工具 +- 可以实现文本到音素编码(phoneme code)的转化,因此可以作为其它语音合成引擎的前端工具 - 开发工具可用于生产和调整音素数据 -### 安装eSpeak ### +### 安装 eSpeak ### -基于Ubuntu的系统中,在终端运行以下命令安装eSpeak: +基于 Ubuntu 的系统中,在终端运行以下命令安装 eSpeak: sudo apt-get install espeak eSpeak 是一个古老的工具,我推测它应该能在其它众多 Linux 发行版中运行,比如 Arch,Fedora。使用 dnf,pacman 等命令就能轻松安装。 -eSpeak 用法如下:输入 espeak 按 enter 键运行程序。输入字符按 enter 转换为语音输出(译补)。使用 Ctrl+C 来关闭运行中的程序。 +eSpeak 用法如下:输入 espeak 运行程序。输入字符按 enter 转换为语音输出(LCTT 译注:补充)。使用 Ctrl+C 来关闭运行中的程序。 ![eSpeak command line](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/11/eSpeak-example.png) 还有一些其他的选项可用,可以通过程序帮助进行查看。 -### GUI版本:Gespeaker ### +### GUI 版本:Gespeaker ### 如果你更倾向于使用 GUI 版本,可以安装 Gespeaker,它为 eSpeak 提供了 GTK 界面。 -使用以下命令来安装Gespeaker: +使用以下命令来安装 Gespeaker: sudo apt-get install gespeaker @@ -46,7 +46,7 @@ eSpeak 用法如下:输入 espeak 按 enter 键运行程序。输入字符按 ![eSpeak GUI tool for text to speech in Ubuntu](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/11/eSpeak-GUI.png) -虽然这些工具不能为大部分计算所用,但是当你的项目需要把文本转换成语音时,使用 espeak 还是挺方便的。是否使用 espeak 这款语音合成器,选择权就交给你们啦。 +虽然这些工具在大多数计算任务下用不到,但是当你的项目需要把文本转换成语音时,使用 espeak 还是挺方便的。是否使用 espeak 这款语音合成器,选择权就交给你们啦。 -------------------------------------------------------------------------------- From 9ef158ab5819ff7341f8575ad4d5fbf6da5a15b4 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 29 Dec 2015 14:25:01 +0800 Subject: [PATCH 0085/1469] PUB:20151123 How to install Android Studio on Ubuntu 15.04 or CentOS 7 @ictlyh --- ...roid Studio on Ubuntu 15.04 or CentOS 7.md | 34 +++++++------------ 1 file changed, 12 insertions(+), 22 deletions(-) rename {translated/tech => published}/20151123 How to install Android Studio on Ubuntu 15.04 or CentOS 7.md (83%) diff --git a/translated/tech/20151123 How to install Android Studio on Ubuntu 15.04 or CentOS 7.md b/published/20151123 How to install Android Studio on Ubuntu 15.04 or CentOS 7.md similarity index 83% rename from translated/tech/20151123 How to install Android Studio on Ubuntu 15.04 or CentOS 7.md rename to published/20151123 How to install Android Studio on Ubuntu 15.04 or CentOS 7.md index 00bde27e78..c851ce0da2 100644 --- a/translated/tech/20151123 How to install Android Studio on Ubuntu 15.04 or CentOS 7.md +++ b/published/20151123 How to install Android Studio on Ubuntu 15.04 or CentOS 7.md @@ -1,19 +1,17 @@ 如何在 Ubuntu 15.04 / CentOS 7 上安装 Android Studio ================================================================================ -随着最近几年智能手机的进步,安卓成为了最大的手机平台之一,所有用于开发安卓应用的工具都是免费提供。Android Studio 是基于 [IntelliJ IDEA][1] 用于开发安卓应用的集成开发环境(IDE)。它是 Google 2014 年发布的免费开源软件,继 Eclipse 之后成为主要的 IDE。 +随着最近几年智能手机的进步,安卓成为了最大的手机平台之一,在开发安卓应用中所用到的所有工具也都可以免费得到。Android Studio 是基于 [IntelliJ IDEA][1] 用于开发安卓应用的集成开发环境(IDE)。它是 Google 2014 年发布的免费开源软件,继 Eclipse 之后成为主要的 IDE。 在这篇文章,我们一起来学习如何在 Ubuntu 15.04 和 CentOS 7 上安装 Android Studio。 ### 在 Ubuntu 15.04 上安装 ### -我们可以用两种方式安装 Android Studio。第一种是配置必须的库然后再安装它;另一种是从 Android 官方网站下载然后在本地编译安装。在下面的例子中,我们会使用命令行设置库并安装它。在继续下一步之前,我们需要确保我们已经安装了 JDK 1.6 或者更新版本。 +我们可以用两种方式安装 Android Studio。第一种是配置所需的库然后再安装它;另一种是从 Android 官方网站下载然后在本地编译安装。在下面的例子中,我们会使用命令行设置库并安装它。在继续下一步之前,我们需要确保我们已经安装了 JDK 1.6 或者更新版本。 这里,我打算安装 JDK 1.8。 $ sudo add-apt-repository ppa:webupd8team/java - $ sudo apt-get update - $ sudo apt-get install oracle-java8-installer oracle-java8-set-default 验证 java 是否安装成功: @@ -27,7 +25,6 @@ ![Android-Studio-repo](http://blog.linoxide.com/wp-content/uploads/2015/11/Android-studio-repo.png) $ sudo apt-get update - $ sudo apt-get install android-studio 上面的安装命令会在 /opt 目录下面安装 Android Studio。 @@ -48,7 +45,7 @@ ![下载组件](http://blog.linoxide.com/wp-content/uploads/2015/11/Download.png) -这一步之后就完成了 Android Studio 的安装。当你重启 Android Studio 时,你会看到下面的欢迎界面,从这里你可以开始用 Android Studio 工作了。 +这一步完成之后就结束了 Android Studio 的安装。当你重启 Android Studio 时,你会看到下面的欢迎界面,从这里你可以开始用 Android Studio 工作了。 ![欢迎界面](http://blog.linoxide.com/wp-content/uploads/2015/11/Welcome-screen.png) @@ -85,21 +82,14 @@ 如果你安装 Android Studio 的时候看到任何类似 “unable-to-run-mksdcard-sdk-tool:” 的错误信息,你可能要在 CentOS 7 64 位系统中安装以下软件包: - glibc.i686 - - glibc-devel.i686 - - libstdc++.i686 - - zlib-devel.i686 - - ncurses-devel.i686 - - libX11-devel.i686 - - libXrender.i686 - - libXrandr.i686 + - glibc.i686 + - glibc-devel.i686 + - libstdc++.i686 + - zlib-devel.i686 + - ncurses-devel.i686 + - libX11-devel.i686 + - libXrender.i686 + - libXrandr.i686 通过从 [Android 网站][3] 下载 IDE 文件然后解压安装 studio 也是一样的。 @@ -121,7 +111,7 @@ ### 总结 ### -虽然发布不到一年,但是 Android Studio 已经替代 Eclipse 成为了Android开发最主要的 IDE。它是唯一能支持 Google 之后将要提供的 Android SDKs 和其它 Android 特性的官方 IDE 工具。那么,你还在等什么呢?赶快安装 Android Studio 来体验开发 Android 应用的乐趣吧。 +虽然发布不到一年,但是 Android Studio 已经替代 Eclipse 成为了 Android 的开发最主要的 IDE。它是唯一能支持 Google 之后将要提供的 Android SDK 和其它 Android 特性的官方 IDE 工具。那么,你还在等什么呢?赶快安装 Android Studio 来体验开发 Android 应用的乐趣吧。 -------------------------------------------------------------------------------- From 9b3224321aa688ab71f1e5392dc17ca68babe2ec Mon Sep 17 00:00:00 2001 From: Jeff Tsang Date: Tue, 29 Dec 2015 14:35:12 +0800 Subject: [PATCH 0086/1469] [translated] 20151206 NetworkManager and privacy in the IPv6 internet.md --- .../20151206 NetworkManager and privacy in the IPv6 internet.md | 1 - 1 file changed, 1 deletion(-) diff --git a/translated/tech/20151206 NetworkManager and privacy in the IPv6 internet.md b/translated/tech/20151206 NetworkManager and privacy in the IPv6 internet.md index fb2eaa5af7..cfd203da33 100644 --- a/translated/tech/20151206 NetworkManager and privacy in the IPv6 internet.md +++ b/translated/tech/20151206 NetworkManager and privacy in the IPv6 internet.md @@ -3,7 +3,6 @@ IPv6因特网中的隐私保护和网络管理器 IPv6的使用量正在不断增加,让我们始料未及的是,伴随这个协议不断增加的使用量,大量隐私问题涌现出来。互联网社区在积极发表相关解决方案,当前状况是怎样的呢?网络管理器又是如何跟上的呢?让我们来瞧瞧吧! - ![](https://blogs.gnome.org/lkundrak/files/2015/12/cameras1.jpg) ## 通过IPv6方式连接的主机的特性 From ff16b906c4753b24f6831fd819bc02f27cd1f558 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 29 Dec 2015 14:47:47 +0800 Subject: [PATCH 0087/1469] PUB:20151123 How to access Dropbox from the command line in Linux @FSSlc --- ...1123 How to access Dropbox from the command line in Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename {translated/tech => published}/20151123 How to access Dropbox from the command line in Linux.md (95%) diff --git a/translated/tech/20151123 How to access Dropbox from the command line in Linux.md b/published/20151123 How to access Dropbox from the command line in Linux.md similarity index 95% rename from translated/tech/20151123 How to access Dropbox from the command line in Linux.md rename to published/20151123 How to access Dropbox from the command line in Linux.md index 9f9d1fd5ed..3c452ac4f6 100644 --- a/translated/tech/20151123 How to access Dropbox from the command line in Linux.md +++ b/published/20151123 How to access Dropbox from the command line in Linux.md @@ -2,7 +2,7 @@ Linux 中如何通过命令行访问 Dropbox ================================================================================ 在当今这个多设备的环境下,云存储无处不在。无论身处何方,人们都想通过多种设备来从云存储中获取所需的内容。由于拥有漂亮的 UI 和完美的跨平台兼容性,Dropbox 已成为最为广泛使用的云存储服务。 Dropbox 的流行已引发了一系列官方或非官方 Dropbox 客户端的出现,它们支持不同的操作系统平台。 -当然 Linux 平台下也有着自己的 Dropbox 客户端: 既有命令行的,也有图形界面客户端。[Dropbox Uploader][1] 是一个简单易用的 Dropbox 命令行客户端,它是用 BASH 脚本语言所编写的。在这篇教程中,我将描述 **在 Linux 中如何使用 Dropbox Uploader 通过命令行来访问 Dropbox**。 +当然 Linux 平台下也有着自己的 Dropbox 客户端: 既有命令行的,也有图形界面客户端。[Dropbox Uploader][1] 是一个简单易用的 Dropbox 命令行客户端,它是用 Bash 脚本语言所编写的(LCTT 译注:对,你没看错, 就是 Bash)。在这篇教程中,我将描述 **在 Linux 中如何使用 Dropbox Uploader 通过命令行来访问 Dropbox**。 ### Linux 中安装和配置 Dropbox Uploader ### From 10e947a980a3b4a40815d51eff17c020259ac66d Mon Sep 17 00:00:00 2001 From: DeadFire Date: Tue, 29 Dec 2015 15:31:05 +0800 Subject: [PATCH 0088/1469] =?UTF-8?q?20151229-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...51229 Watch Star Wars In Linux Terminal.md | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 sources/tech/20151229 Watch Star Wars In Linux Terminal.md diff --git a/sources/tech/20151229 Watch Star Wars In Linux Terminal.md b/sources/tech/20151229 Watch Star Wars In Linux Terminal.md new file mode 100644 index 0000000000..45c5a917ec --- /dev/null +++ b/sources/tech/20151229 Watch Star Wars In Linux Terminal.md @@ -0,0 +1,53 @@ +Watch Star Wars In Linux Terminal +================================================================================ +![](http://itsfoss.com/wp-content/uploads/2015/12/Star-Wars-Linux-Terminal-2.png) + +Star Wars fever has gripped the world. The latest installment in the [Star Wars series, Star Wars: The Force Awakens, has broken the opening records][1]. + +While I cannot help you to get a ticket of the latest Star Wars movie, I can certainly provide you a way to watch [Star Wars episode IV][2], the original and very first Star Wars movie. + +No, it won’t be HD, Blue Ray edition. Instead, it will be the ASCII version of Star Wars episode IV and you can watch it in Linux Terminal, in true geek way :) + +### Watch Star Wars in Linux Terminal ### + +Open a terminal and use the following command: + + telnet towel.blinkenlights.nl + +Wait for a few seconds and you can see animated ASCII art in the terminal like this: + +![](http://itsfoss.com/wp-content/uploads/2015/12/Star-Wars-Linux-Terminal.png) + +And it will keep on going: + +![](http://itsfoss.com/wp-content/uploads/2015/12/Star-Wars-Linux-Terminal-1.png) + +![](http://itsfoss.com/wp-content/uploads/2015/12/Star-Wars-Linux-Terminal-2.png) + +![](http://itsfoss.com/wp-content/uploads/2015/12/Star-Wars-Linux-Terminal-3.png) + +![](http://itsfoss.com/wp-content/uploads/2015/12/Star-Wars-Linux-Terminal-5.png) + +To stop the animation, press ctrl+]. After that type quit to come out of telnet command. + +### More terminal fun ### + +In fact, watching Star Wars is not the only fun thing you can do in Linux terminal. You can run a [train in terminal][3] or [get Linux logo in ASCII art][4]. + +I let you enjoy Star Wars in Linux :) + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/star-wars-linux/ + +作者:[Abhishek][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://www.gamespot.com/articles/star-wars-7-breaks-thursday-night-movie-opening-re/1100-6433246/ +[2]:http://www.imdb.com/title/tt0076759/ +[3]:http://itsfoss.com/ubuntu-terminal-train/ +[4]:http://itsfoss.com/display-linux-logo-in-ascii/ From af2238e609250c09210b747f7ea4a9e2d0576708 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Tue, 29 Dec 2015 15:42:41 +0800 Subject: [PATCH 0089/1469] =?UTF-8?q?20151129-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20151229 Grub 2--Heal your bootloader.md | 235 ++++++++++++++++++ 1 file changed, 235 insertions(+) create mode 100644 sources/tech/20151229 Grub 2--Heal your bootloader.md diff --git a/sources/tech/20151229 Grub 2--Heal your bootloader.md b/sources/tech/20151229 Grub 2--Heal your bootloader.md new file mode 100644 index 0000000000..062c2361d2 --- /dev/null +++ b/sources/tech/20151229 Grub 2--Heal your bootloader.md @@ -0,0 +1,235 @@ +Grub 2: Heal your bootloader +================================================================================ +**There are few things as irritating as a broken bootloader. Get the best out of Grub 2 and keep it shipshape.** + +Why do this? + +- Grub 2 is the most popular bootloader that’s used by almost every Linux distribution. +- A bootloader is a vital piece of software, but they are susceptible to damage. +- Grub 2 is an expansive and flexible boot loader that offers various customisable options. + +The Grub 2 Linux bootloader is a wonderful and versatile piece of software. While it isn’t the only bootloader out there, it’s the most popular and almost all the leading desktop distros use it. The job of the Grub bootloader is twofold. First, it displays a menu of all installed operating systems on a computer and invites you to pick one. Second, Grub loads the Linux kernel if you choose a Linux operating system from the boot menu. + +As you can see, if you use Linux, you can’t escape the bootloader. Yet it’s one the least understood components inside a Linux distro. In this tutorial we’ll familiarise you with some of Grub 2’s famed versatility and equip you with the skills to help yourself when you have a misbehaving bootloader. + +The most important parts of Grub 2 are a bunch of text files and a couple of scripts. The first piece to know is **/etc/default/grub**. This is the text file in which you can set the general configuration variables and other characteristics of the Grub 2 menu (see box titled “Common user settings”). + +The other important aspect of Grub 2 is the **/etc/grub.d** folder. All the scripts that define each menu entry are housed there. The names of these scripts must have a two-digit numeric prefix. Its purpose is to define the order in which the scripts are executed and the order of the corresponding entries when the Grub 2 menu is built. The **00_header** file is read first, which parses the **/etc/default/grub** configuration file. Then come the entries for the Linux kernels in the **10_linux** file. This script creates one regular and one recovery menu entry for each kernel in the default **/boot** partition. + +This script is followed by others for third-party apps such as **30_os-prober** and **40_custom**. The **os-prober** script creates entries for kernels and other operating systems found on other partitions. It can recognise Linux, Windows, BSD and Mac OS X installations. If your hard disk layout is too exotic for the **os-prober** script to pick up an installed distro, you can add it to the **40_custom** file (see the “Add custom entries” box). + +**Grub** 2 does not require you to manually maintain your boot options’ configuration file: instead it generates the **/boot/grub/grub.cfg** file with the **grub2-mkconfig** command. This utility will parse the scripts in the **/etc/grub.d** directory and the **/etc/default/grub** settings file to define your setup. + +Graphical boot repair + +A vast majority of Grub 2 issues can easily be resolved with the touch of a button thanks to the Boot Repair app. This nifty little application has an intuitive user interface and can scan and comprehend various kinds of disk layouts and partitioning schemes, and can sniff out and correctly identify operating system installations inside them. The utility works on traditional computers with a Master Boot Record (MBR) as well as the newer UEFI computers with the UID Partition Table (GPT) layout. + +The easiest way to use Boot Repair is to install it inside a Live Ubuntu session. Fire up an Ubuntu Live distro on a machine with a broken bootloader and install Boot Repair by first adding its PPA repository with + + sudo add-apt-repository ppa:yannubuntu/Boot Repair + +Then refresh the list of repositories with + + sudo apt-get update + +before installing the app with + + sudo apt-get install -y Boot Repair + +Fire up the tool once it’s installed. The app will scan your hard disk before displaying its interface, which is made up of a couple of buttons. To follow the advice of the tool, simply press the Recommended Repair button, which should fix most broken bootloaders. After it’s restored your bootloader, the tool also spits out a small URL which you should note. The URL contains a detailed summary of your disks, including your partitions along with the contents of important Grub 2 files including **/etc/default/grub** and **boot/grub/grub.cfg**. If the tool hasn’t been able to fix your bootloader, you can share the URL on your distro’s forum boards to allow others to understand your disk layout and offer suggestions. + +![](http://www.linuxvoice.com/wp-content/uploads/2015/10/boot-repair-large.jpg) + +**Boot Repair also lets you customise Grub 2’s options.** + +#### Bootloader bailout #### + +Grub 2 boot problems can leave the system in several states. The text on the display where you’d expect the bootloader menu gives an indication of the current state of the system. If the system stops booting at the **grub>** prompt, it means the Grub 2 modules were loaded but it couldn’t find the **grub.cfg** file. This is the full Grub 2 command shell and you can do quite a bit here to help yourself. If you see the **grub rescue>** prompt, it means that the bootloader couldn’t find the Grub 2 modules nor could it find any of your boot files. However, if your screen just displays the word ‘GRUB’, it means the bootloader has failed to find even the most basic information that’s usually contained in the Master Boot Record. + +You can correct these Grub failures either by using a live CD or from Grub 2’s command shell. If you’re lucky and your bootloader drops you at the **grub>** prompt, you have the power of the Grub 2 shell at your disposal to correct any errors. + +The next few commands work with both **grub>** and **grub rescue>**. The **set pager=1** command invokes the pager, which prevents text from scrolling off the screen. You can also use the **ls** command which lists all partitions that Grub sees, like this: + + grub> ls + (hd0) (hd0,msdos5) (hd0,msdos6) (hd1,msdos1) + +As you can see, the command also lists the partition table scheme along with the partitions. + +You can also use the **ls** command on each partition to find your root filesystem: + + grub> ls (hd0,5)/ + lost+found/ var/ etc/ media/ bin/ initrd.gz + boot/ dev/ home/ selinux/ srv/ tmp/ vmlinuz + +You can drop the **msdos** bit from the name of the partition. Also, if you miss the trailing slash and instead say **ls (hd0,5)** you’ll get information about the partition including its filesystem type, total size, and last modification time. If you have multiple partitions, read the contents of the **/etc/issue** file with the **cat** command to identify the distro, such as **cat (hd0,5)/etc/issue**. + +Assuming you find the root filesystem you’re looking for inside **(hd0,5)**, make sure that it contains the /**boot/grub** directory and the Linux kernel image you wish to boot into, such as **vmlinuz-3.13.0-24-generic**. Now type the following: + + grub> set root=(hd0,5) + grub> linux /boot/vmlinuz-3.13.0-24-generic root=/dev/sda5 + grub> initrd /boot/initrd.img-3.13.0-24-generic + +The first command points Grub to the partition housing the distro we wish to boot into. The second command then tells Grub the location of the kernel image inside the partition as well as the location of the root filesystem. The final line sets the location of the initial ramdisk file. You can use tab autocompletion to fill in the name of the kernel and the initrd, which will save you a lot of time and effort. + +Once you’ve keyed these in, type **boot** at the next **grub>** prompt and Grub will boot into the specified operating system. + +Things are a little different if you’re at the **grub rescue>** prompt. Since the bootloader hasn’t been able to find and load any of the required modules, you’ll have to insert them manually: + + grub rescue> set root=(hd0,5) + grub rescue> insmod (hd0,5)/boot/grub/normal.mod + grub rescue> normal + grub> insmod linux + +As you can see, just like before, after we use the **ls** command to hunt down the Linux partition, we mark it with the **set** command. We then insert the **normal** module, which when activated will return us to the standard **grub>** mode. The next command then inserts the linux module in case it hasn’t been loaded. Once this module has been loaded you can proceed to point the boot loader to the kernel image and initrd files just as before and round off the procedure with the **boot** command to bring up the distro. + +Once you’ve successfully booted into the distro, don’t forget to regenerate a new configuration file for Grub with the + + grub-mkconfig -o /boot/grub/grub.cfg + +command. You’ll also have to install a copy of the bootloader into the MBR with the + + sudo grub2-install /dev/sda + +command. + +![](http://www.linuxvoice.com/wp-content/uploads/2015/10/grub2-cfg-large.jpg) + +**To disable a script under the /etc/grub.d, all you need to do is remove the executable bit, for example with chmod -x /etc/grub.d/20_memtest86+ which will remove the ‘Memory Test’ option from the menu.** + +### Grub 2 and UEFI ### + +UEFI-enabled machines (more or less, any machine sold in the last couple of years) have added another layer of complexity to debugging a broken **Grub 2** bootloader. While the procedure for restoring a **Grub 2** install on a UEFI machine isn’t much different than it is on a non-UEFI machine, the newer firmware handles things differently, which results in mixed restoration results. + +On a UEFI-based system, you do not install anything in the MBR. Instead you install a Linux EFI bootloader in the EFI System Partition (ESP) and set it as the EFI’s default boot program using a tool such as **efibootmgr** for Linux, or **bcdedit** for Windows. + +As things stand now, the Grub 2 bootloader should be installed properly when installing any major desktop Linux distro, which will happily coexist with Windows 8. However, if you end up with a broken bootloader, you can restore the machine with a live distro. When you boot the live medium, make sure you boot it in the UEFI mode. The computer’s boot menu will have two boot options for each removable drive – a vanilla option and an option tagged with UEFI. Use the latter to expose the EFI variables in **/sys/firmware/efi/**. + +From the live environment, mount the root filesystem of the broken installation as mentioned in the tutorial. You’ll also have to mount the ESP partition. Assuming it’s **/dev/sda1**, you can mount it with + + sudo mount /dev/sda1 /mnt/boot/efi + +Then load the **efivars** module with **modprobe efivars** before chrooting into the installed distribution as shown in the tutorial. + +Here on, if you’re using Fedora, reinstall the bootloader with the + + yum reinstall grub2-efi shim + +command followed by + + grub2-mkconfig -o /boot/grub2/grub.cfg + +to generate the new configuration file. Ubuntu users can do this with + + apt-get install --reinstall grub-efi-amd64 + +With the bootloader in place, exit chroot, unmount all partitions and reboot to the Grub 2 menu. + +#### Dude, where’s my Grub? #### + +The best thing about Grub 2 is that you can reinstall it whenever you want. So if you lose the Grub 2 bootloader, say when another OS like Windows replaces it with its own bootloader, you can restore Grub within a few steps with the help of a live distro. Assuming you’ve installed a distro on **/dev/sda5**, you can reinstall Grub by first creating a mount directory for the distro with + + sudo mkdir -p /mnt/distro + +and then mounting the partition with + + mount /dev/sda5 /mnt/distro + +You can then reinstall Grub with + + grub2-install --root-directory=/mnt/distro /dev/sda + +This command will rewrite the MBR information on the **/dev/sda** device, point to the current Linux installation and rewrite some Grub 2 files such as **grubenv** and **device.map**. + +Another common issue pops up on computers with multiple distros. When you install a new Linux distro, its bootloader should pick up the already installed distros. In case it doesn’t, just boot into the newly installed distro and run + + grub2-mkconfig + +Before running the command, make sure that the root partitions of the distros missing from the boot menu are mounted. If the distro you wish to add has **/root** and **/home** on separate partitions, only mount the partition that contains /root, before running the **grub2-mkconfig** command. + +While Grub 2 will be able to pick most distros, trying to add a Fedora installation from within Ubuntu requires one extra step. If you’ve installed Fedora with its default settings, the distro’s installer would have created LVM partitions. In this case, you’ll first have to install the **lvm2** driver using the distro’s package management system, such as with + + sudo apt-get install lvm2 + +before Grub 2’s **os-prober** script can find and add Fedora to the boot menu. + +### Common user settings ### + +Grub 2 has lots of configuration variables. Here are some of the common ones that you’re most likely to modify in the **/etc/default/grub** file. The **GRUB_DEFAULT** variable specifies the default boot entry. It will accept a numeric value such as 0, which denotes the first entry, or “saved” which will point it to the selected option from the previous boot. The **GRUB_TIMEOUT** variable specifies the delay before booting the default menu entry and the **GRUB_CMDLINE_LINUX** variable lists the parameters that are passed on the kernel command line for all Linux menu entries. + +If the **GRUB_DISABLE_RECOVERY** variable is set to **true**, the recovery mode menu entries will not be generated. These entries boot the distro into single-user mode from where you can repair your system with command line tools. Also useful is the **GRUB_GFXMODE** variable, which specifies the resolution of the text shown in the menu. The variable can take any value supported by your graphics card. + +![](http://www.linuxvoice.com/wp-content/uploads/2015/10/grub2-cli-large.jpg) + +**Grub 2 has a command line, which you can invoke by pressing C at the bootloader menu.** + +#### Thorough fix #### + +If the **grub2-install** command didn’t work for you, and you still can’t boot into Linux, you’ll need to completely reinstall and reconfigure the bootloader. For this task, we’ll use the venerable **chroot** utility to change the run environment from that of the live CD to the Linux install we want to recover. You can use any Linux live CD for this purpose as long as it has the **chroot** tool. However, make sure the live medium is for the same architecture as the architecture of the installation on the hard disk. So if you wish to **chroot** to a 64-bit installation you must use an amd64 live distro. + +After you’ve booted the live distro, the first order of business is to check the partitions on the machine. Use **fdisk -l** to list all the partitions on the disk and make note of the partition that holds the Grub 2 installation that you want to fix. + +Let’s assume we wish to restore the bootloader from the distro installed in **/dev/sda5**. Fire up a terminal and mount it with: + + sudo mount /dev/sda5 /mnt + +Now you’ll have to bind the directories that the Grub 2 bootloader needs access to in order to detect other operating systems: + + $ sudo mount --bind /dev /mnt/dev + $ sudo mount --bind /dev/pts /mnt/dev/pts + $ sudo mount --bind /proc /mnt/proc + $ sudo mount --bind /sys /mnt/sys + +We’re now all set to leave the live environment and enter into the distro installed inside the **/dev/sda5** partition via **chroot**: + + $ sudo chroot /mnt /bin/bash + +You’re now all set to install, check, and update Grub. Just like before, use the + + sudo grub2-install /dev/sda + +command to reinstall the bootloader. Since the **grub2-install** command doesn’t touch the **grub.cfg** file, we’ll have to create it manually with + + sudo grub-mkconfig -o /boot/grub/grub.cfg + +That should do the trick. You now have a fresh copy of Grub 2 with a list of all the operating systems and distros installed on your machine. Before you can restart the computer, you’ll have to exit the chrooted system and unmount all the partitions in the following order: + + $ exit + $ sudo umount /mnt/sys + $ sudo umount /mnt/proc + $ sudo umount /mnt/dev/pts + $ sudo umount /mnt/dev + $ sudo umount /mnt + +You can now safely reboot the machine, which should be back under Grub 2’s control, and the bootloader under yours! + +### Add custom entries ### + +If you wish to add an entry to the bootloader menu, you should add a boot stanza to the **40_custom** script. You can, for example, use it to display an entry to boot a Linux distro installed on a removable USB drive. Assuming your USB drive is **sdb1**, and the vmlinuz kernel image and the initrd files are under the root (/) directory, add the following to the **40_custom** file: + + menuentry “Linux on USB” { + set root=(hd1,1) + linux /vmlinuz root=/dev/sdb1 ro quiet splash + initrd /initrd.img + } + +For more accurate results, instead of device and partition names you can use their UUIDs, such as + + set root=UUID=54f22dd7-eabe + +Use + + sudo blkid + +to find the UUIDs of all the connected drives and partitions. You can also add entries for any distros on your disk that weren’t picked up by the os-prober script, as long as you know where the distro’s installed and the location of its kernel and initrd image files. + +-------------------------------------------------------------------------------- + +via: https://www.linuxvoice.com/grub-2-heal-your-bootloader/ + +作者:[Mayank Sharma][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.linuxvoice.com/author/mayank/ From 19d10d23397e1b5801a3c79429c1495ee303cae6 Mon Sep 17 00:00:00 2001 From: Feng Wei Date: Wed, 30 Dec 2015 00:10:59 +0800 Subject: [PATCH 0090/1469] tranlation complete --- ...b Delivery with these Open Source Tools.md | 196 ------------------ ...b Delivery with these Open Source Tools.md | 195 +++++++++++++++++ 2 files changed, 195 insertions(+), 196 deletions(-) delete mode 100644 sources/share/20151104 Optimize Web Delivery with these Open Source Tools.md create mode 100644 translated/share/20151104 Optimize Web Delivery with these Open Source Tools.md diff --git a/sources/share/20151104 Optimize Web Delivery with these Open Source Tools.md b/sources/share/20151104 Optimize Web Delivery with these Open Source Tools.md deleted file mode 100644 index 3d1137f5bf..0000000000 --- a/sources/share/20151104 Optimize Web Delivery with these Open Source Tools.md +++ /dev/null @@ -1,196 +0,0 @@ -translating by fw8899 -Optimize Web Delivery with these Open Source Tools -================================================================================ -Web proxy software forwards HTTP requests without modifying traffic in any way. They can be configured as a transparent proxy with no client-side configuration required. They can also be used as a reverse proxy front-end to websites; here the cache serves an unlimited number of clients for one or some web servers. - -Web proxies are versatile tools. They have a wide variety of uses, from caching web, DNS and other lookups, to speeding up the delivery of a web server / reducing bandwidth consumption. Web proxy software can also harden security by filtering traffic and anonymizing connections, and offer media-range limitations. This software is used by high-profile, high-traffic websites such as The New York Times, The Guardian, and social media and content sites such as Twitter, Facebook, and Wikipedia. - -Web caches have become a vital mechanism for optimising the amount of data that is delivered in a given period of time. Good web caches also help to minimise latency, serving pages as quickly as possible. This helps to prevent the end user from becoming impatient having to wait for content to be delivered. Web caches optimise the data flow between client and server. They also help to converse bandwidth by caching frequently-delivered content. If you need to reduce server load and improve delivery speed of your content, it is definitely worth exploring the benefits offered by web cache software. - -To provide an insight into the quality of software available for Linux, I feature below 5 excellent open source web proxy tools. Some of the them are full-featured; a couple of them have very modest resource needs. - -### Squid ### - -Squid is a high-performance open source proxy caching server and web cache daemon. It supports FTP, Internet Gopher, HTTPS, TLS, and SSL. It handles all requests in a single, non-blocking, I/O-driven process over IPv4 or IPv6. - -Squid consists of a main server program squid, a Domain Name System lookup program dnsserver, some optional programs for rewriting requests and performing authentication, together with some management and client tools. - -Squid offers a rich access control, authorization and logging environment to develop web proxy and content serving applications. - -Features include: - -- Web proxy: - - Caching to reduce access time and bandwidth use - - Keeps meta data and especially hot objects cached in RAM - - Caches DNS lookups - - Supports non-blocking DNS lookups - - Implements negative chacking of failed requests -- Squid caches can be arranged in a hierarchy or mesh for additional bandwidth savings -- Enforce site-usage policies with extensive access controls -- Anonymize connections, such as disabling or changing specific header fields in a client's HTTP request -- Reverse proxy -- Media-range limitations -- Supports SSL -- Support for IPv6 -- Error Page Localization - error pages presented by Squid may now be localized per-request to match the visitors local preferred language -- Connection Pinning (for NTLM Auth Passthrough) - a workaround which permits Web servers to use Microsoft NTLM Authentication instead of HTTP standard authentication through a web proxy -- Quality of Service (QoS) Flow support - - Select a TOS/Diffserv value to mark local hits - - Select a TOS/Diffserv value to mark peer hits - - Selectively mark only sibling or parent requests - - Allows any HTTP response towards clients to have the TOS value of the response coming from the remote server preserved - - Mask certain bits in the TOS received from the remote server, before copying the value to the TOS send towards clients -- SSL Bump (for HTTPS Filtering and Adaptation) - Squid-in-the-middle decryption and encryption of CONNECT tunneled SSL traffic, using configurable client- and server-side certificates -- eCAP Adaptation Module support -- ICAP Bypass and Retry enhancements - ICAP is now extended with full bypass and dynamic chain routing to handle multiple adaptation services. -- ICY streaming protocol support - commonly known as SHOUTcast multimedia streams -- Dynamic SSL Certificate Generation -- Support for the Internet Content Adaptation Protocol (ICAP) -- Full request logging -- Anonymize connections - -- Website: [www.squid-cache.org][1] -- Developer: National Laboratory for Applied Networking Research (NLANR) and Internet volunteers -- License: GNU GPL v2 -- Version Number: 4.0.1 - -### Privoxy ### - -Privoxy (Privacy Enhancing Proxy) is a non-caching Web proxy with advanced filtering capabilities for enhancing privacy, modifying web page data and HTTP headers, controlling access, and removing ads and other obnoxious Internet junk. Privoxy has a flexible configuration and can be customized to suit individual needs and tastes. It supports both stand-alone systems and multi-user networks. - -Privoxy uses the concept of actions in order to manipulate the data stream between the browser and remote sites. - -Features include: - -- Highly configurable - completely personalize your installation -- Ad blocking -- Cookie management -- Supports "Connection: keep-alive". Outgoing connections can be kept alive independently from the client -- Supports IPv6 -- Tagging which allows to change the behaviour based on client and server headers -- Run as an "intercepting" proxy -- Sophisticated actions and filters for manipulating both server and client headers -- Can be chained with other proxies -- Integrated browser-based configuration and control utility. Browser-based tracing of rule and filter effects. Remote toggling -- Web page filtering (text replacements, removes banners based on size, invisible "web-bugs" and HTML annoyances, etc) -- Modularized configuration that allows for standard settings and user settings to reside in separate files, so that installing updated actions files won't overwrite individual user settings -- Support for Perl Compatible Regular Expressions in the configuration files, and a more sophisticated and flexible configuration syntax -- GIF de-animation -- Bypass many click-tracking scripts (avoids script redirection) -- User-customizable HTML templates for most proxy-generated pages (e.g. "blocked" page) -- Auto-detection and re-reading of config file changes -- Most features are controllable on a per-site or per-location basis - -- Website: [www.privoxy.org][2] -- Developer: Fabian Keil (lead developer), David Schmidt, and many other contributors -- License: GNU GPL v2 -- Version Number: 3.4.2 - -### Varnish Cache ### - -Varnish Cache is a web accelerator written with performance and flexibility in mind. It's modern architecture offers significantly better performance. It typically speeds up delivery with a factor of 300 - 1000x, depending on your architecture. Varnish stores web pages in memory so the web servers do not have to create the same web page repeatedly. The web server only recreates a page when it is changed. When content is served from memory this happens a lot faster then anything. - -Additionally Varnish can serve web pages much faster then any application server is capable of - giving the website a significant speed enhancement. - -For a cost-effective configuration, Varnish Cache uses between 1-16GB and a SSD disk. - -Features include: - -- Modern design -- VCL - a very flexible configuration language. The VCL configuration is translated to C, compiled, loaded and executed giving flexibility and speed -- Load balancing using both a round-robin and a random director, both with a per-backend weighting -- DNS, Random, Hashing and Client IP based Directors -- Load balance between multiple backends -- Support for Edge Side Includes including stitching together compressed ESI fragments -- Heavily threaded -- URL rewriting -- Cache multiple vhosts with a single Varnish -- Log data is stored in shared memory -- Basic health-checking of backends -- Graceful handling of "dead" backends -- Administered by a command line interface -- Use In-line C to extend Varnish -- Can be used on the same system as Apache -- Run multiple Varnish on the same system -- Support for HAProxy's PROXY protocol. This is a protocol adds a small header on each incoming TCP connection that describes who the real client is, added by (for example) an SSL terminating process -- Warm and cold VCL states -- Plugin support with Varnish Modules, called VMODs -- Backends defined through VMODs -- Gzip Compression and Decompression -- HTTP Streaming Pass & Fetch -- Saint and Grace mode. Saint Mode allows for unhealthy backends to be blacklisted for a period of time, preventing them from serving traffic when using Varnish as a load balancer. Grace mode allows Varnish to serve an expired version of a page or other asset in cases where Varnish is unable to retrieve a healthy response from the backend -- Experimental support for Persistent Storage, without LRU eviction - -- Website: [www.varnish-cache.org][3] -- Developer: Varnish Software -- License: FreeBSD -- Version Number: 4.1.0 - -### Polipo ### - -Polipo is an open source caching HTTP proxy which has modest resource needs. - -It listens to requests for web pages from your browser and forwards them to web servers, and forwards the servers’ replies to your browser. In the process, it optimises and cleans up the network traffic. It is similar in spirit to WWWOFFLE, but the implementation techniques are more like the ones ones used by Squid. - -Polipo aims at being a compliant HTTP/1.1 proxy. It should work with any web site that complies with either HTTP/1.1 or the older HTTP/1.0. - -Features include: - -- HTTP 1.1, IPv4 & IPv6, traffic filtering and privacy-enhancement -- Uses HTTP/1.1 pipelining if it believes that the remote server supports it, whether the incoming requests are pipelined or come in simultaneously on multiple connections -- Cache the initial segment of an instance if the download has been interrupted, and, if necessary, complete it later using Range requests -- Upgrade client requests to HTTP/1.1 even if they come in as HTTP/1.0, and up- or downgrade server replies to the client's capabilities -- Complete support for IPv6 (except for scoped (link-local) addresses) -- Use as a bridge between the IPv4 and IPv6 Internets -- Content-filtering -- Can use a technique known as Poor Man's Multiplexing to reduce latency -- SOCKS 4 and SOCKS 5 protocol support -- HTTPS proxying -- Behaves as a transparent proxy -- Run Polipo together with Privoxy or tor - -- Website: [www.pps.univ-paris-diderot.fr/~jch/software/polipo/][4] -- Developer: Juliusz Chroboczek, Christopher Davis -- License: MIT License -- Version Number: 1.1.1 - -### Tinyproxy ### - -Tinyproxy is a lightweight open source web proxy daemon. It is designed to be fast and yet small. It is useful for cases such as embedded deployments where a full featured HTTP proxy is required, but the system resources for a larger proxy are unavailable. - -Tinyproxy is very useful in a small network setting, where a larger proxy would either be too resource intensive, or a security risk. One of the key features of Tinyproxy is the buffering connection concept. In effect, Tinyproxy will buffer a high speed response from a server, and then relay it to a client at the highest speed the client will accept. This feature greatly reduces the problems with sluggishness on the net. - -Features: - -- Easy to modify -- Anonymous mode - allows specification of individual HTTP headers that should be allowed through, and which should be blocked -- HTTPS support - Tinyproxy allows forwarding of HTTPS connections without modifying traffic in any way through the CONNECT method -- Remote monitoring - access proxy statistics from afar, letting you know exactly how busy the proxy is -- Load average monitoring - configure software to refuse connections after the server load reaches a certain point -- Access control - configure to only allow connections from certain subnets or IP addresses -- Secure - run without any special privileges, thus minimizing the chance of system compromise -- URL based filtering - allows domain and URL-based black- and whitelisting -- Transparent proxying - configure as a transparent proxy, so that a proxy can be used without any client-side configuration -- Proxy chaining - use an upstream proxy server for outbound connections, instead of direct connections to the target server, creating a so-called proxy chain -- Privacy features - restrict both what data comes to your web browser from the HTTP server (e.g., cookies), and to restrict what data is allowed through from your web browser to the HTTP server (e.g., version information) -- Small footprint - the memory footprint is about 2MB with glibc, and the CPU load increases linearly with the number of simultaneous connections (depending on the speed of the connection). Tinyproxy can be run on an old machine without affecting performance - -- Website: [banu.com/tinyproxy][5] -- Developer: Robert James Kaes and contributors -- License: GNU GPL v2 -- Version Number: 1.8.3 - --------------------------------------------------------------------------------- - -via: http://www.linuxlinks.com/article/20151101020309690/WebDelivery.html - -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[1]:http://www.squid-cache.org/ -[2]:http://www.privoxy.org/ -[3]:https://www.varnish-cache.org/ -[4]:http://www.pps.univ-paris-diderot.fr/%7Ejch/software/polipo/ -[5]:https://banu.com/tinyproxy/ diff --git a/translated/share/20151104 Optimize Web Delivery with these Open Source Tools.md b/translated/share/20151104 Optimize Web Delivery with these Open Source Tools.md new file mode 100644 index 0000000000..21fd8ad8e2 --- /dev/null +++ b/translated/share/20151104 Optimize Web Delivery with these Open Source Tools.md @@ -0,0 +1,195 @@ +使用开源工具优化Web响应 +================================================================================ +Web代理软件转发HTTP请求时并不会改变数据流量。它们经过配置后,可以免客户端配置,作为透明代理。它们还可以作为网站反向代理的前端;缓存服务器在此能支撑一台或多台web服务器为海量用户提供服务。 + +网站代理功能多样,有着宽泛的用途:从页面缓存、DNS和其他查询,到加速web服务器响应、降低带宽消耗。代理软件广泛用于大型高访问量的网站,比如纽约时报、卫报, 以及社交媒体网站如Twitter、Facebook和Wikipedia。 + +页面缓存已经成为优化单位时间内所能吞吐的数据量的至关重要的机制。好的Web缓存还能降低延迟,尽可能快地响应页面,让终端用户不至于因等待内容的时间过久而失去耐心。它们还能将频繁访问的内容缓存起来以节省带宽。如果你需要降低服务器负载并改善网站内容响应速度,那缓存软件能带来的好处就绝对值得探索一番。 + +为深入探查Linux下可用的相关软件的质量,我列出了下边5个优秀的开源web代理工具。它们中有些功能完备强大,也有几个只需很低的资源就能运行。 + +### Squid ### + +Squid是一个高性能、开源的代理缓存和Web缓存服务器,支持FTP、Internet Gopher、HTTPS和SSL等多种协议。它通过一个非阻塞,I/O事件驱动的单一进程处理所有IPV4或IPV6上的请求。 + +Squid由一个主服务程序squid,和DNS查询程序dnsserver,另外还有可选的请求重写、执行认证程序组件,及一些管理和客户端工具构成。 + +Squid提供了丰富的访问控制、认证和日志环境, 用于开发web代理和内容服务网站应用。 + +其特性包括: + +- Web代理: + - 通过缓存来降低访问时间和带宽使用 + - 将元数据和特别热的对象缓存到内存中 + - 缓存DNS查询 + - 支持非阻塞的DNS查询 + - 实现了失败请求的未果缓存 +- Squid缓存可架设为层次结构,或网状结构以节省额外的带宽 +- 通过可扩展的访问控制来执行网站使用条款 +- 隐匿请求,如禁用或修改客户端HTTP请求头特定属性 +- 反向代理 +- 媒体范围限制 +- 支持SSL +- 支持IPv6 +- 错误页面的本地化 - Squid可以根据访问者的语言选项对每个请求展示本地化的错误页面 +- 连接Pinning(用于NTLM Auth Passthrough) - 一种通过Web代理,允许Web服务器使用Microsoft NTLM安全认证替代HTTP标准认证的方案 +- 支持服务质量 (QoS, Quality of Service) 流 + - 选择一个TOS/Diffserv值来标记本地命中 + - 选择一个TOS/Diffserv值来标记邻居命中 + - 选择性地仅标记同级或上级请求 + - 允许任意发往客户端的HTTP响应保持由远程服务器处响应的TOS值 + - 对收到的远程服务器的TOS值,在复制之前对指定位进行掩码操作,再发送到客户端 +- SSL Bump (用于HTTPS过滤和适配) - Squid-in-the-middle,在CONNECT方式的SSL隧道中,用配置化的客户端和服务器端证书,对流量进行解密和加密 +- 支持适配模块 +- ICAP旁路和重试增强 - 通过完全的旁路和动态链式路由扩展ICAP,来处理多多个适应性服务。 +- 支持ICY流式协议 - 俗称SHOUTcast多媒体流 +- 动态SSL证书生产 +- 支持ICAP协议(Internet Content Adaptation Protocol) +- 完整的请求日志记录 +- 匿名连接 + +- 网站: [www.squid-cache.org][1] +- 开发: 美国国家应用网络研究实验室和网络志愿者 +- 授权: GNU GPL v2 +- 版本号: 4.0.1 + +### Privoxy ### + +Privoxy(Privacy Enhancing Proxy)是一个非缓存类Web代理软件,它自带的高级过滤功能用来增强隐私保护,修改页面内容和HTTP头部信息,访问控制,以及去除广告和其它招人反感的互联网垃圾。Privoxy的配置非常灵活,能充分定制已满足各种各样的需求和偏好。它支持单机和多用户网络两种模式。 + +Privoxy使用Actions规则来处理浏览器和远程站点间的数据流。 + +其特性包括: + +- 高度配置化 +- 广告拦截 +- Cookie管理 +- 支持"Connection: keep-alive"。可以无视客户端配置而保持持久连接 +- 支持IPv6 +- 标签化,允许按照客户端和服务器的请求头进行处理 +- 作为拦截代理器运行 +- 巧妙的手段和过滤机制用来处理服务器和客户端的HTTP头部 +- 可以与其他代理软件链式使用 +- 整合了基于浏览器的配置和控制工具,能在线跟踪规则和过滤效果,可远程开关 +- 页面过滤(文本替换、根据尺寸大小删除广告栏, 隐藏的"web-bugs"元素和HTML容错等) +- 模块化的配置使得标准配合和用户配置可以存放于不同文件中,这样安装更新就不会覆盖用户的个性化设置 +- 配置文件支持Perl兼容的正则表达式,以及更为精妙和灵活的配置语法 +- GIF去动画 +- 旁路处理大量click-tracking脚本(避免脚本重定向) +- 大多数代理生成的页面(例如 "访问受限" 页面)可由用户自定义HTML模板 +- 自动监测配置文件的修改并重新读取 +- 最大特点是可以基于每个站点或每个位置来进行控制 + +- 网站: [www.privoxy.org][2] +- 开发: Fabian Keil(开发领导者), David Schmidt, 和众多其他贡献者 +- 授权: GNU GPL v2 +- 版本号: 3.4.2 + +### Varnish Cache ### + +Varnish Cache是一个为性能和灵活性而生的web加速器。它新颖的架构设计能带来显著的性能提升。根据你的架构,通常情况下它能加速响应速度300-1000倍。Varnish将页面存储到内存,这样web服务器就无需重复地创建相同的页面,只需要在页面发生变化后重新生成。页面内容直接从内存中访问,当然比其他方式更快。 + +此外Varnish能大大提升响应web页面的速度,用任何应用服务器都能使网站访问速度大幅度地提升。 + +按按经验,Varnish Cache比较经济的配置是1-16GB内存+SSD固态硬盘。 + +其特性包括: + +- 新颖的设计 +- VCL - 非常灵活的配置语言。VCL配置转换成C,然后编译、加载、运行,灵活且高效 +- 能使用round-robin轮询和随机分发两种方式来负载均衡,两种方式下后端服务器都可以设置权重 +- 基于DNS、随机、散列和客户端IP的分发器 +- 多台后端主机间的负载均衡 +- 支持Edge Side Includes,包括拼装压缩后的ESI片段 +- 多线程并发 +- URL重写 +- 单Varnish缓存多个虚拟主机 +- 日志数据存储在共享内存中 +- 基本的后端服务器健康检查 +- 优雅地处理后端服务器“挂掉” +- 命令行界面的管理控制台 +- 使用内联C来扩展Varnish +- 可以与Apache用在相同的系统上 +- 单系统可运行多个Varnish +- 支持HAProxy代理协议。该协议在每个收到的TCP请求,例如SSL终止过程中,附加小段头信息,以记录客户端的真实地址 +- 冷热VCL状态 +- 用名为VMODs的Varnish模块来提供插件扩展 +- 通过VMODs定义后端主机 +- Gzip压缩及解压 +- HTTP流通过和获取 +- 神圣模式和优雅模式。用Varnish作为负载均衡器,神圣模式下可以将不稳定的后端服务器在一段时间内打入黑名单,阻止它们继续提供流量服务。优雅模式允许Varnish在获取不到后端服务器状态良好的响应时,提供已过期版本的页面或其它内容。 +- 实验性支持持久化存储,无需LRU缓存淘汰 + +- 网站: [www.varnish-cache.org][3] +- 开发: Varnish Software +- 授权: FreeBSD +- 版本号: 4.1.0 + +### Polipo ### + +Polipo是一个开源的HTTP缓存代理,只需要非常低的资源开销。 + +它监听来自浏览器的web页面请求,转发到web服务器,然后将服务器的响应转发到浏览器。在此过程中,它能优化和整形网络流量。从本质来讲Polipo与WWWOFFLE很相似,但其实现技术更接近于Squid。 + +Polipo最开始的目标是作为一个兼容HTTP/1.1的代理,理论它能在任何兼容HTTP/1.1或更早的HTTP/1.0的站点上运行。 + +其特性包括: + +- HTTP 1.1、IPv4 & IPv6、流量过滤和隐私保护增强 +- 如确认远程服务器支持,则无论收到的请求是管道处理过的还是在多个连接上同时收到的,都使用HTTP/1.1管道 +- 下载被中断时缓存起始部分,当需要续传时用区间请求来完成下载 +- 将HTTP/1.0的客户端请求升级为HTTP/1.1,然后按照客户端支持的级别进行升级或降级后回复 +- 全面支持IPv6 (作用域(链路本地)地址除外) +- 作为IPv4和IPv6网络的网桥 +- 内容过滤 +- 能使用Poor Man多路复用技术降低延迟 +- 支持SOCKS 4和SOCKS 5协议 +- HTTPS代理 +- 扮演透明代理的角色 +- 可以与Privoxy或tor一起运行 + +- 网站: [www.pps.univ-paris-diderot.fr/~jch/software/polipo/][4] +- 开发: Juliusz Chroboczek, Christopher Davis +- 授权: MIT License +- 版本号: 1.1.1 + +### Tinyproxy ### + +Tinyproxy是一个轻量级的开源web代理守护进程,其设计目标是快而小。它适用于需要完整HTTP代理特性,但系统资源又不足以运行大型代理的场景,比如嵌入式部署。 + +Tinyproxy对小规模网络非常有用,这样的场合下大型代理会使系统资源紧张,或有安全风险。Tinyproxy的一个关键特性是其缓冲连接的理念。实质上Tinyproxy服务器的响应进行了高速缓冲,然后按照客户端能够处理的最高速度进行响应。该特性极大的降低了网络延滞带来的问题。 + +特性: + +- 易于修改 +- 隐匿模式 - 定义哪些HTTP头允许通过,哪些又会被拦截 +- 支持HTTPS - Tinyproxy允许通过CONNECT方法转发HTTPS连接,任何情况下都不会修改数据流量 +- 远程监控 - 远程访问代理统计数据,让你能清楚了解代理服务当前的忙碌状态 +- 平均负载监控 - 通过配置,当服务器的负载接近一定值后拒绝新连接 +- 访问控制 - 通过配置,仅允许指定子网或IP地址的访问 +- 安全 - 运行无需额外权限,减小了系统受到威胁的概率 +- 基于URL的过滤 - 允许基于域和URL的黑白名单 +- 透明代理 - 配位为透明代理,这样客户端就无需任何配置 +- 代理链 - 来流量出口处采用上游代理服务器,而不是直接转发到目标服务器,创建我们所说的代理链 +- 隐私特性 - 限制允许从浏览器收到的来自HTTP服务器的数据(例如cookies),同时限制允许通过的从浏览器到HTTP服务器的数据(例如版本信息) +- 低开销 - 使用glibc内存开销只有2MB,CPU负载按并发连接数线性增长(取决于网络连接速度)。 Tinyproxy可以运行在老旧的机器上而无需担心性能问题。 + +- 网站: [banu.com/tinyproxy][5] +- 开发: Robert James Kaes和其他贡献者 +- 授权: GNU GPL v2 +- 版本号: 1.8.3 + +-------------------------------------------------------------------------------- + +via: http://www.linuxlinks.com/article/20151101020309690/WebDelivery.html + +译者:[fw8899](https://github.com/fw8899) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:http://www.squid-cache.org/ +[2]:http://www.privoxy.org/ +[3]:https://www.varnish-cache.org/ +[4]:http://www.pps.univ-paris-diderot.fr/%7Ejch/software/polipo/ +[5]:https://banu.com/tinyproxy/ From eb201e83dd7269aa1af58920ac61e122d56e5ea4 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Wed, 30 Dec 2015 11:06:26 +0800 Subject: [PATCH 0091/1469] Translating by ZTinoZ --- ...illa with Apache and SSL on FreeBSD 10.2.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sources/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md b/sources/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md index 87aa5e1ef8..46ce91f327 100644 --- a/sources/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md +++ b/sources/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md @@ -95,14 +95,14 @@ Bugzilla是一款bug跟踪系统和测试工具,它基于web且开源,由moz ![Configure MySQL Password](http://blog.linoxide.com/wp-content/uploads/2015/12/Configure-MySQL-Password.png) -Next, we will log in to the mysql shell with user root and password that we've configured above, then we will create new database and user for bugzilla installation. +以上步骤都完成之后,我们用root登录mysql shell,然后为bugzilla创建一个新的数据库和用户。 -Log in to the mysql shell with command below : +用以下命令登录mysql shell: mysql -u root -p password: aqwe123 -Add the database : +添加数据库: create database bugzilladb; create user bugzillauser@localhost identified by 'bugzillauser@'; @@ -112,18 +112,18 @@ Add the database : ![Creating Database for Bugzilla](http://blog.linoxide.com/wp-content/uploads/2015/12/Creating-Database-for-Bugzilla.png) -Database for bugzilla is created, database "bugzilladb" with user "bugzillauser" and password "bugzillauser@". +bugzilla的数据库创建好了,名字为"bugzilladb",用户名和密码分别为"bugzillauser"和"bugzillauser@"。 -### Step 4 - Generate New SSL Certificate ### +### 第四步 - 生成新的SSL证书 ### -Generate new self signed ssl certificate on directory "ssl" for bugzilla site. +在bugzilla站点的"ssl"目录里生成新的自签名SSL证书。 -Go to the apache24 directory and create new directory "ssl" on it : +前往apache24目录并在此创建新目录"ssl": cd /usr/local/etc/apache24/ mkdir ssl; cd ssl -Next, generate the certificate file with openssl command, then change the permission of the certificate file : +接着,用openssl命令生成证书文件,然后更改其权限: sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /usr/local/etc/apache24/ssl/bugzilla.key -out /usr/local/etc/apache24/ssl/bugzilla.crt chmod 600 * @@ -171,7 +171,7 @@ Paste configuration below : -Save and exit. +保存并退出。 If all is done, create new directory for bugzilla installation and then enable the bugzilla virtualhost by adding the virtualhost configuration to httpd.conf file. From 974244eb79dccbb1d8e77ddba11c2e04323630cc Mon Sep 17 00:00:00 2001 From: "Fuliang.Li" Date: Wed, 30 Dec 2015 13:05:32 +0800 Subject: [PATCH 0092/1469] Create Part 3 - LFCS--How to Archive or Compress Files and Directories Setting File Attributes and Finding Files in Linux.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [Translated] Part 3 - LFCS--How to Archive or Compress Files and Directories Setting File Attributes and Finding Files in Linux 【翻译完成】 LFCS 系列第三讲:如何在 Linux 中归档/压缩文件及目录、设置文件属性和搜索文件 --- ...e Attributes and Finding Files in Linux.md | 390 ++++++++++++++++++ 1 file changed, 390 insertions(+) create mode 100644 translated/tech/LFCS/Part 3 - LFCS--How to Archive or Compress Files and Directories Setting File Attributes and Finding Files in Linux.md diff --git a/translated/tech/LFCS/Part 3 - LFCS--How to Archive or Compress Files and Directories Setting File Attributes and Finding Files in Linux.md b/translated/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..876fa4d3af --- /dev/null +++ b/translated/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,390 @@ +GHLandy Translated + +LFCS 系列第三讲:如何在 Linux 中归档/压缩文件及目录、设置文件属性和搜索文件 + +================================================================================ +最近,Linux 基金会发起了 一个全新的 LFCS(Linux Foundation Certified Sysadmin,Linux 基金会认证系统管理员)认证,旨在让遍布全世界的人都有机会参加该认证的考试,并且通过考试的人将会得到关于他们有能力在 Linux 上执行基本的中间系统管理任务的认证证书。这项认证包括了对已运行的系统和服务的支持、一流水平的问题解决和分析以及决定何时将问题反映给工程师团队的能力。 + +![Linux Foundation Certified Sysadmin – Part 3](http://www.tecmint.com/wp-content/uploads/2014/10/lfcs-Part-3.png) + +LFCS 系列第三讲 + +请看以下视频,这里边讲给出 Linux 基金会认证程序的一些想法。 + +注:youtube 视频 + + +本讲是《十套教程》系列中的第三讲,在这一讲中,我们会涵盖如何在文件系统中归档/压缩文件及目录、设置文件属性和搜索文件等内容,这些都是 LFCS 认证中必须掌握的知识。 + +### 归档和压缩的相关工具 ### + +文件归档工具将一堆文件整合到一个单独的归档文件之后,我们可以将归档文件备份到不同类型的媒介或者通过网络传输和发送 Email 来备份。在 Linux 中使用频率最高的归档实用工具是 tar。当归档工具和压缩工具一起使用的时候,可以减少同一文件和信息在硬盘中的存储空间。 + +#### tar 使用工具 #### + +tar 将一组文件打包到一个单独的归档文件(通常叫做 tar 文件或者 tarball)。tar 这个名称最初代表磁带存档程序(tape archiver),但现在我们可以用它来归档任意类型的可读写媒介上边的数据,而不是只能归档磁带数据。tar 通常与 gzip、bzip2 或者 xz 等压缩工具一起使用,生成一个压缩的 tarball。 + +**基本语法:** + + # tar [选项] [路径名 ...] + +其中 ... 代表指定那些文件进行归档操作的表达式 + +#### tar 的常用命令 #### + +注:表格 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
长选项简写描述
 –create c 创建 tar 归档文件
 –concatenate A 将一存档与已有的存档合并
 –append r 把要存档的文件追加到归档文件的末尾
 –update u 更新新文件到归档文件中去
 –diff 或 –compare d 比较存档与当前文件的不同之处
 –file archive f 使用档案文件或设备
 –list t 列出 tarball 中的内容
 –extract 或 –get x 从归档文件中释放文件
+ +#### 常用的操作修饰符 #### + +注:表格 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
长选项缩写描述
 –directory dir C 执行归档操作前,先转到指定目录
 –same-permissions p 保持原始的文件权限
 –verbose v 列出所有的读取或提取文件。但这个标识符与 –list 一起使用的时候,还会显示出文件大小、属主和时间戳的信息
 –verify W 写入存档后进行校验
 –exclude file — 不把指定文件包含在内
 –exclude=pattern X 以PATTERN模式排除文件
 –gzip 或 –gunzip z 通过gzip压缩归档
 –bzip2 j 通过bzip2压缩归档
 –xz J 通过xz压缩归档
+ +Gzip 是最古老的压缩工具,压缩率最小,bzip2 的压缩率稍微高一点。另外,xz是最新的压缩工具,压缩率最好。xz 具有最佳压缩率的代价是:完成压缩操作花费最多时间,压缩过程中占有较多系统资源。 + +通常,通过这些工具压缩的 tar 文件相应的具有 .gz、.bz2 或 .xz的扩展名。在下列的例子中,我们使用 file1、file2、file3、file4 和 file5 进行演示。 + +**通过 gzip、bzip2 和 xz 压缩归档** + +归档当前工作目录的所有文件,并以 gzip、bzip2 和 xz 压缩刚刚的归档文件(请注意,用正则表达式来指定那些文件应该归档——这是为了防止归档工具包前一步生成的文件打包进来)。 + + # 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) + +压缩多个文件 + +**列举 tarball 中的内容和更新/追加文件到归档文件中** + +列举 tarball 中的内容,并显示相同信息为一个详细目录清单。注意,不能直接向压缩的归档文件更新/追加文件(若你需要向压缩的 tarball 中更新/追加文件,需要先解压 tar 文件后再进行操作,然后重新压缩)。 + + # tar tvf [tarball] + +![Check Files in tar Archive](http://www.tecmint.com/wp-content/uploads/2014/10/List-Archive-Content.png) + +列举归档文件中的内容 + +运行一下任意一条命令: + + # gzip -d myfiles.tar.gz [#1] + # bzip2 -d myfiles.tar.bz2 [#2] + # xz -d myfiles.tar.xz [#3] + +然后: + + # tar --delete --file myfiles.tar file4 (删除tarball中的file4) + # tar --update --file myfiles.tar file4 (更新tarball中的file4) + +和 + + # gzip myfiles.tar [ 如果你运行 #1 命令 ] + # bzip2 myfiles.tar [ 如果你运行 #2 命令 ] + # xz myfiles.tar [ 如果你运行 #3 命令 ] + +最后 + + # tar tvf [tarball] #again + +将 file4 修改后的日期和时间与之前显示的对应信息进行比较 + +**排除文件类型** + +假设你现在需要备份用户的家目录。一个有经验的系统管理员会选择忽略所有视频和音频文件再备份(也可能是公司规定)。 + +可能你最先想到的方法是在备份是时候,忽略扩展名为 .mp3 和 .mp4(或者其他格式)的文件。但如果你有些自作聪明的用户将扩展名改为 .txt 或者 .bkp,那你的方法就不灵了。为了发现并排除音频或者视频文件,你需要先检查文件类型。以下 shell 脚本可以代你完成类型检查: + + #!/bin/bash + # 把需要进行备份的目录传递给 $1 参数. + DIR=$1 + #排除文件类型中包含了 mpeg 字符串的文件,然后创建 tarball 并进行压缩。 + # -若文件类型中包含 mpeg 字符串, $?(最后执行的命令的退出状态)返回 0,然后文件名被定向到排除选项。否则返回 1。 + # -若 $? 等于 0,该文件从需要备份文件的列表排除。 + 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) + +排除文件进行备份 + +**使用 tar 保持文件的原有权限进行恢复** + +通过以下命令,你可以保留文件的权限将备份文件恢复到原始用户的家目录(本例是 user_restore)。 + + # 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) + +从归档文件中恢复 + +**扩展阅读:** + +- [18 tar Command Examples in Linux][1] +- [Dtrx – An Intelligent Archive Tool for Linux][2] + +### 通过 find 命令搜索文件 ### + +find 命令用于递归搜索目录树中包含指定字符的文件和目录,然后在屏幕显示出于指定字符相匹配的文件和目录,或者在匹配项进行其他操作。 + +通常,我们通过文件名、文件的属主、属组、类型权限、日期及大小来搜索。 + +#### 基本语法:#### + +# find [需搜索的目录] [表达式] + +**通过文件大小递归搜索文件** + +以下命令会搜索当前目录(.)及其下两层子目录(-maxdepth 3,包含当前目录及往下两层的子目录)大于 2 MB(-size +2M)的所有文件(-f)。 + + # 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) + +通过文件大小搜索文件 + +**搜索符合一定规则的文件并将其删除** + +有时候,777 权限的文件通常为外部攻击者打开便利之门。不管是以何种方式,让所有人都可以对文件进行任意操作都是不安全的。对此,我们采取一个相对激进的方法——删除这些文件(‘{ }’用来“聚集”搜索的结果)。 + + # 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) + +搜索 777 权限的文件 + +**按访问时间和修改时间搜索文件** + +搜索 /etc 目录下访问时间(-atime)或修改时间(-mtime)大于或小于 6 个月或者刚好 6 个月的配置文件。 + +按照下面例子对命令进行修改: + + # 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) + +按修改时间搜索文件 + +- 扩展阅读: [35 Practical Examples of Linux ‘find’ Command][3] + +### 文件权限及基本属性 ### + +ls -l 命令输出的前 10 位字符是文件的属性,其中第一个字符用来表明文件的类型。 + +- – : 普通文件 +- -d : 目录 +- -l : 符号链接 +- -c : 字符设备 (它将数据作为字节流处理,如terminal) +- -b : 块设备 (在块设备中处理数据,如存储设备) + +接下来表示文件属性的 9 位字符叫做文件的读写模式,代表文件属主、同组用户和其他用户(通常指的是“外部世界”)对应的读(r)、写(w)和执行(x)权限。 + +文件的写权限允许对应的用户对文件进行打开和读写,对于同时设置了执行权限的目录,对应用户可以列举出该目录的内容。另外,文件的执行权限允许将文件当做是一个可执行程序来运行,而目录的执行权限则是允许用户进入和退出该目录。 + +文件的权限通过 chown 命令来更改,其基本语法如下: + + # chmod [new_mode] file + +new_mode 可以是 3 位八进制数值或者对应权限的表达式。 + +八进制数值可以从二进制数值进行等值转换,通过下列方法来计算文件属主、同组用户和其他用户权限对应的二进制数值: + +一个确定权限的二进制数值表现为 2 的幂(r=2^2,w=2^1,x=2^0),当权限省缺时,二进制数值为 0。如下: + +![Linux File Permissions](http://www.tecmint.com/wp-content/uploads/2014/10/File-Permissions.png) + +文件权限 + +使用八进制数值设置上图的文件权限,请输入: + + # chmod 744 myfile + +通过 u、g 和 o 分别代表用户、同组用户和其他用户,然后你也可以使用权限表达式来单独对用户设置文件的权限模式。也可以通过 a 代表所有用户,然后设置文件权限。通过 + 号或者 - 号相应的赋予或移除文件权限。 + + +**为所有用户撤销一个 shell 脚本的执行权限** + +正如之前解释的那样,我们可以通过 - 号为需要移除权限的属主、同组用户、其他用户或者所有用户去掉指定的文件权限。下面命令中的短横线(-)可以理解为:移除(-)所有用户(a)的 backup.sh 文件执行权限(x)。 + + # chmod a-x backup.sh + +下面演示为文件属主、同组用户赋予读、写和执行权限,并赋予其他用户读权限。 + +当我们使用 3 位八进制数值为文件设置权限的时候,第一位数字代表属主权限,第二位数字代表同组用户权限,第三位数字代表其他用户的权限: + +- 属主:(r=2^2 + w=2^1 + x=2^0 = 7) +- 同组用户:(r=2^2 + w=2^1 + x=2^0 = 7) +- 其他用户:(r=2^2 + w=0 + x=0 = 4), + + # chmod 774 myfile + +随着练习时间的推移,你会知道何种情况下使用哪种方式来更改文件的权限模式的效果最好。 + +使用 ls -l 详细列举目录详细同样会显示出文件的属主和属组(这个很基本,而且影响到系统文件的访问控制)。 + +![Linux File Listing](http://www.tecmint.com/wp-content/uploads/2014/10/Linux-File-Listing.png) + +列举 Linux 文件 + +通过 chown 命令可以对文件的归属权进行更改,可以同时或者分开更改属主和属组。其基本语法为: + + # chown user:group file + +至少要指定用户或者用户组 + +**举几个例子:** + +将文件的属主更改为指定用户: + + # chown gacanepa sent + +同时将文件的属主和属组更改为指定的用户和组: + + # chown gacanepa:gacanepa TestFile + +只将文件的属组更改为指定组。注意组名前的冒号(:)。 + + # chown :gacanepa email_body.txt + +### 结论 ### + +作为一个系统管理员,你需要懂得如何创建和恢复备份、如何在系统中搜索文件并更改它们的属性。通过一些技巧,你可以更好地管理系统并避免以后出问题。 + +我希望,本文给出的技巧可以帮助你达成管理系统的目标。你可以随时在评论中发表自己的技巧及社区给你带来的益处。 + +先行感谢! + +参考链接 +- [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] +译者:[GHLandy](https://github.com/GHLandy) +校对:[校对者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 From 4ec79d53a83651a6742e6d553165172c2737fe95 Mon Sep 17 00:00:00 2001 From: "Fuliang.Li" Date: Wed, 30 Dec 2015 13:07:17 +0800 Subject: [PATCH 0093/1469] Delete Part 3 - LFCS--How to Archive or Compress Files and Directories Setting File Attributes and Finding Files in Linux.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 完成翻译,删除原文,译文已放在对应位置。 --- ...e Attributes and Finding Files in Linux.md | 384 ------------------ 1 file changed, 384 deletions(-) delete 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 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 deleted file mode 100644 index 4b1d700c4e..0000000000 --- a/sources/tech/LFCS/Part 3 - LFCS--How to Archive or Compress Files and Directories Setting File Attributes and Finding Files in Linux.md +++ /dev/null @@ -1,384 +0,0 @@ -GHLandy Translateing - -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 From 23da66eef6883a16a1a01c36e5c9ae9c4deed867 Mon Sep 17 00:00:00 2001 From: "Fuliang.Li" Date: Wed, 30 Dec 2015 13:09:59 +0800 Subject: [PATCH 0094/1469] [Translating] Part 4 - LFCS: Partitioning Storage Devices, Formatting Filesystems and Configuring Swap Partition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【开始翻译】 LFCS系列第四讲:分区存储设备、格式化文件系统和配置Swap分区 --- ...s Formatting Filesystems and Configuring Swap Partition.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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..32bf16bb7c 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 @@ +GHLandy Translating + 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. @@ -188,4 +190,4 @@ via: http://www.tecmint.com/create-partitions-and-filesystems-in-linux/ [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 +[3]:https://identity.linuxfoundation.org/user?destination=pid/1 From 9dd65c151b8fd4fc910da5f77fbbe92693e37fca Mon Sep 17 00:00:00 2001 From: Markgolzh <1134386961@qq.com> Date: Wed, 30 Dec 2015 14:14:30 +0800 Subject: [PATCH 0095/1469] =?UTF-8?q?zky001=E6=AD=A3=E5=9C=A8=E7=BF=BB?= =?UTF-8?q?=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 本文由zky001正在翻译 谢谢 --- sources/tech/20151229 Watch Star Wars In Linux Terminal.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20151229 Watch Star Wars In Linux Terminal.md b/sources/tech/20151229 Watch Star Wars In Linux Terminal.md index 45c5a917ec..d0adc812c4 100644 --- a/sources/tech/20151229 Watch Star Wars In Linux Terminal.md +++ b/sources/tech/20151229 Watch Star Wars In Linux Terminal.md @@ -1,3 +1,4 @@ +zky001正在翻译 Watch Star Wars In Linux Terminal ================================================================================ ![](http://itsfoss.com/wp-content/uploads/2015/12/Star-Wars-Linux-Terminal-2.png) @@ -41,7 +42,7 @@ I let you enjoy Star Wars in Linux :) via: http://itsfoss.com/star-wars-linux/ 作者:[Abhishek][a] -译者:[译者ID](https://github.com/译者ID) +译者:[zky001](https://github.com/zky001) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 0fe200a3a7eccbd32086747f33eaf58aae52a3d8 Mon Sep 17 00:00:00 2001 From: Markgolzh <1134386961@qq.com> Date: Wed, 30 Dec 2015 14:47:58 +0800 Subject: [PATCH 0096/1469] =?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 翻译完成 --- ...51229 Watch Star Wars In Linux Terminal.md | 54 ------------------- 1 file changed, 54 deletions(-) delete mode 100644 sources/tech/20151229 Watch Star Wars In Linux Terminal.md diff --git a/sources/tech/20151229 Watch Star Wars In Linux Terminal.md b/sources/tech/20151229 Watch Star Wars In Linux Terminal.md deleted file mode 100644 index d0adc812c4..0000000000 --- a/sources/tech/20151229 Watch Star Wars In Linux Terminal.md +++ /dev/null @@ -1,54 +0,0 @@ -zky001正在翻译 -Watch Star Wars In Linux Terminal -================================================================================ -![](http://itsfoss.com/wp-content/uploads/2015/12/Star-Wars-Linux-Terminal-2.png) - -Star Wars fever has gripped the world. The latest installment in the [Star Wars series, Star Wars: The Force Awakens, has broken the opening records][1]. - -While I cannot help you to get a ticket of the latest Star Wars movie, I can certainly provide you a way to watch [Star Wars episode IV][2], the original and very first Star Wars movie. - -No, it won’t be HD, Blue Ray edition. Instead, it will be the ASCII version of Star Wars episode IV and you can watch it in Linux Terminal, in true geek way :) - -### Watch Star Wars in Linux Terminal ### - -Open a terminal and use the following command: - - telnet towel.blinkenlights.nl - -Wait for a few seconds and you can see animated ASCII art in the terminal like this: - -![](http://itsfoss.com/wp-content/uploads/2015/12/Star-Wars-Linux-Terminal.png) - -And it will keep on going: - -![](http://itsfoss.com/wp-content/uploads/2015/12/Star-Wars-Linux-Terminal-1.png) - -![](http://itsfoss.com/wp-content/uploads/2015/12/Star-Wars-Linux-Terminal-2.png) - -![](http://itsfoss.com/wp-content/uploads/2015/12/Star-Wars-Linux-Terminal-3.png) - -![](http://itsfoss.com/wp-content/uploads/2015/12/Star-Wars-Linux-Terminal-5.png) - -To stop the animation, press ctrl+]. After that type quit to come out of telnet command. - -### More terminal fun ### - -In fact, watching Star Wars is not the only fun thing you can do in Linux terminal. You can run a [train in terminal][3] or [get Linux logo in ASCII art][4]. - -I let you enjoy Star Wars in Linux :) - --------------------------------------------------------------------------------- - -via: http://itsfoss.com/star-wars-linux/ - -作者:[Abhishek][a] -译者:[zky001](https://github.com/zky001) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://itsfoss.com/author/abhishek/ -[1]:http://www.gamespot.com/articles/star-wars-7-breaks-thursday-night-movie-opening-re/1100-6433246/ -[2]:http://www.imdb.com/title/tt0076759/ -[3]:http://itsfoss.com/ubuntu-terminal-train/ -[4]:http://itsfoss.com/display-linux-logo-in-ascii/ From f86156a7ac258692f62efedae716b32b69f8d8b5 Mon Sep 17 00:00:00 2001 From: Markgolzh <1134386961@qq.com> Date: Wed, 30 Dec 2015 14:49:53 +0800 Subject: [PATCH 0097/1469] =?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 翻译完成 --- ...51229 Watch Star Wars In Linux Terminal.md | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 translated/tech/20151229 Watch Star Wars In Linux Terminal.md diff --git a/translated/tech/20151229 Watch Star Wars In Linux Terminal.md b/translated/tech/20151229 Watch Star Wars In Linux Terminal.md new file mode 100644 index 0000000000..41b739a9c0 --- /dev/null +++ b/translated/tech/20151229 Watch Star Wars In Linux Terminal.md @@ -0,0 +1,49 @@ +在Linux终端看星球大战 +================================================================================ +![](http://itsfoss.com/wp-content/uploads/2015/12/Star-Wars-Linux-Terminal-2.png) +星球大战席卷世界。最新一期的 [《星球大战》系列, 《星球大战7:原力觉醒》,打破了有史以来的记录][1]. + +虽然我不能帮你得到一张最新的《星球大战》电影的票,但我可以提供给你一种方式,看[星球大战第四集片段][2],它是非常早期的《星球大战》电影。 + +不,它不会是高清,也不是蓝光版。相反,它将是ASCII版的《星球大战》第四集片段,你可以在Linux终端看它,这才是真正的极客的方式 :) + +### 在Linux终端看星球大战 ### + +打开一个终端,使用以下命令: + + telnet towel.blinkenlights.nl + +等待几秒钟,你可以在终端看到类似于以下这样的动画ASCII艺术: + +![](http://itsfoss.com/wp-content/uploads/2015/12/Star-Wars-Linux-Terminal.png) + +同时它将继续 + +![](http://itsfoss.com/wp-content/uploads/2015/12/Star-Wars-Linux-Terminal-1.png) + +![](http://itsfoss.com/wp-content/uploads/2015/12/Star-Wars-Linux-Terminal-2.png) + +![](http://itsfoss.com/wp-content/uploads/2015/12/Star-Wars-Linux-Terminal-3.png) + +![](http://itsfoss.com/wp-content/uploads/2015/12/Star-Wars-Linux-Terminal-5.png) + +要停止动画,按 ctrl +],在这之后输入quit来退出tenlnet程序 + +### 更多有趣的终端 ### +事实上,看《星球大战》并不是你在Linux终端下唯一能做有趣的事情。您可以运行[终端里的列车][3]或[通过ASCII艺术得到Linux标志][4]。 + +我希望你可以在Linux下享受星球争霸 +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/star-wars-linux/ + +作者:[Abhishek][a] +译者:[zky001](https://github.com/zky001) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:http://www.gamespot.com/articles/star-wars-7-breaks-thursday-night-movie-opening-re/1100-6433246/ +[2]:http://www.imdb.com/title/tt0076759/ +[3]:http://itsfoss.com/ubuntu-terminal-train/ +[4]:http://itsfoss.com/display-linux-logo-in-ascii/ From b0f15872eecf93b5240e56ac15918b4f68616ad9 Mon Sep 17 00:00:00 2001 From: Markgolzh <1134386961@qq.com> Date: Wed, 30 Dec 2015 14:55:56 +0800 Subject: [PATCH 0098/1469] =?UTF-8?q?zky001=E7=BF=BB=E8=AF=91=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit zky001翻译中 --- ...t are the best plugins to increase productivity on Emacs.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20151225 What are the best plugins to increase productivity on Emacs.md b/sources/tech/20151225 What are the best plugins to increase productivity on Emacs.md index 17fb4ba8ab..6c3a1c8f98 100644 --- a/sources/tech/20151225 What are the best plugins to increase productivity on Emacs.md +++ b/sources/tech/20151225 What are the best plugins to increase productivity on Emacs.md @@ -1,3 +1,4 @@ +zky001翻译中 What are the best plugins to increase productivity on Emacs ================================================================================ Over a year ago now, I went looking for the best plugins to [turn Vim into a full-fledged IDE][1]. Interestingly, a lot of the comments on that post were about how Emacs already has most of these plugins built in, and was already a great IDE. Although I can only agree about Emacs' incredible versatility, it is still not the ultimate editor when it comes out of the box. Thankfully, its vast plugin library is here to fix that. But among the plethora of options available to you, it is sometimes hard to know where to start. So for now, let me try to assemble a short list of the indispensable plugins to increase your productivity while using Emacs. Although I am heavily geared towards programming related productivity, most of these plugins would be useful to anyone for any usage. @@ -67,7 +68,7 @@ To conclude, Emacs is a fantastic tool. Probably not a shocker. Try these plugin via: http://xmodulo.com/best-plugins-to-increase-productivity-on-emacs.html 作者:[Adrien Brochard][a] -译者:[译者ID](https://github.com/译者ID) +译者:[zky001](https://github.com/zky001) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 7fba1b5c829b620cb6a9dde2937853e9daf1bdce Mon Sep 17 00:00:00 2001 From: soooogreen <54364732@qq.com> Date: Wed, 30 Dec 2015 16:13:30 +0800 Subject: [PATCH 0099/1469] Update 20151229 Grub 2--Heal your bootloader.md --- sources/tech/20151229 Grub 2--Heal your bootloader.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20151229 Grub 2--Heal your bootloader.md b/sources/tech/20151229 Grub 2--Heal your bootloader.md index 062c2361d2..19fcca7d08 100644 --- a/sources/tech/20151229 Grub 2--Heal your bootloader.md +++ b/sources/tech/20151229 Grub 2--Heal your bootloader.md @@ -1,3 +1,4 @@ +翻译中。。。。。 Grub 2: Heal your bootloader ================================================================================ **There are few things as irritating as a broken bootloader. Get the best out of Grub 2 and keep it shipshape.** From 84eae5f5b24fdcd5da99a17eb77aaf1f5f5e98b8 Mon Sep 17 00:00:00 2001 From: SonoFelice Date: Wed, 30 Dec 2015 20:39:06 +0800 Subject: [PATCH 0100/1469] =?UTF-8?q?=E3=80=90=E7=BF=BB=E8=AF=91=E4=B8=AD?= =?UTF-8?q?=E3=80=91Monitor=20Linux=20System=20Performance=20Using=20Nmon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20151223 Monitor Linux System Performance Using Nmon.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20151223 Monitor Linux System Performance Using Nmon.md b/sources/tech/20151223 Monitor Linux System Performance Using Nmon.md index a0edd16870..b482f17bf6 100644 --- a/sources/tech/20151223 Monitor Linux System Performance Using Nmon.md +++ b/sources/tech/20151223 Monitor Linux System Performance Using Nmon.md @@ -1,3 +1,4 @@ +sonofelice translating Monitor Linux System Performance Using Nmon ================================================================================ Nmon (also known as Nigel’s Monitor) is a computer performance system monitor tool for the AIX and Linux operating systems developed by IBM employee Nigel Griffiths. The tool displays onscreen or saves to a data file the operating system statistics to aid in the understanding of computer resource use, tuning options and bottlenecks. This system benchmark tool gives you a huge amount of important performance information in one go with a single command. You can easily monitor your system’s CPU, memory, network, disks, file systems, NFS, top processes, resources and power micro-partition information using Nmon. From 6cd7f433eb07fb9d4ff528c2a4c5012d457e7dc6 Mon Sep 17 00:00:00 2001 From: crazyLinuxer <958983476@qq.com> Date: Wed, 30 Dec 2015 21:33:30 +0800 Subject: [PATCH 0101/1469] Update 20151125 Running a mainline kernel on a cellphone.md --- .../tech/20151125 Running a mainline kernel on a cellphone.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20151125 Running a mainline kernel on a cellphone.md b/sources/tech/20151125 Running a mainline kernel on a cellphone.md index c247051def..624c99d2a7 100644 --- a/sources/tech/20151125 Running a mainline kernel on a cellphone.md +++ b/sources/tech/20151125 Running a mainline kernel on a cellphone.md @@ -1,3 +1,5 @@ + +kylepeng93正在翻译 Running a mainline kernel on a cellphone ================================================================================ From 4eea7ab819a7be554faf85deb6ea8155084e23f5 Mon Sep 17 00:00:00 2001 From: "Fuliang.Li" Date: Wed, 30 Dec 2015 22:54:46 +0800 Subject: [PATCH 0102/1469] =?UTF-8?q?[=E5=BC=80=E5=A7=8B=E7=BF=BB=E8=AF=91?= =?UTF-8?q?]=20Part=205=20-=20LFCS:=20How=20to=20Mount/Unmount=20Local=20a?= =?UTF-8?q?nd=20Network=20(Samba=20&=20NFS)=20Filesystems=20in=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【开始翻译】 LFCS系列第五讲:如何在 Linux 中挂载/卸载本地文件系统和网络文件系统(Samba 和 NFS) --- ...nt Local and Network Samba and NFS Filesystems in Linux.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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..959095a394 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 @@ +GHLandy Translating + 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. @@ -229,4 +231,4 @@ via: http://www.tecmint.com/mount-filesystem-in-linux/ [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 +[5]:https://identity.linuxfoundation.org/user?destination=pid/1 From b37d0bb90c552073e11fe5a642d2ec1caba2696a Mon Sep 17 00:00:00 2001 From: "Fuliang.Li" Date: Wed, 30 Dec 2015 22:56:17 +0800 Subject: [PATCH 0103/1469] Delete Part 4 - LFCS--Partitioning Storage Devices Formatting Filesystems and Configuring Swap Partition.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 完成翻译,译文放在相应位置。 --- ...esystems and Configuring Swap Partition.md | 193 ------------------ 1 file changed, 193 deletions(-) delete mode 100644 sources/tech/LFCS/Part 4 - LFCS--Partitioning Storage Devices Formatting Filesystems and Configuring Swap Partition.md 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 deleted file mode 100644 index 32bf16bb7c..0000000000 --- a/sources/tech/LFCS/Part 4 - LFCS--Partitioning Storage Devices Formatting Filesystems and Configuring Swap Partition.md +++ /dev/null @@ -1,193 +0,0 @@ -GHLandy Translating - -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 From 7a6cbf6205b3e68f89d45662614498eaced759fa Mon Sep 17 00:00:00 2001 From: "Fuliang.Li" Date: Wed, 30 Dec 2015 22:58:44 +0800 Subject: [PATCH 0104/1469] =?UTF-8?q?[=E5=AE=8C=E6=88=90=E7=BF=BB=E8=AF=91?= =?UTF-8?q?]=20Part=204=20-=20LFCS:=20Partitioning=20Storage=20Devices,=20?= =?UTF-8?q?Formatting=20Filesystems=20and=20Configuring=20Swap=20Partition?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【完成翻译】 LFCS系列第四讲:分区存储设备、格式化文件系统和配置交换(Swap)分区 --- ...esystems and Configuring Swap Partition.md | 195 ++++++++++++++++++ 1 file changed, 195 insertions(+) create mode 100644 translated/tech/LFCS/Part 4 - LFCS: Partitioning Storage Devices, Formatting Filesystems and Configuring Swap Partition.md diff --git a/translated/tech/LFCS/Part 4 - LFCS: Partitioning Storage Devices, Formatting Filesystems and Configuring Swap Partition.md b/translated/tech/LFCS/Part 4 - LFCS: Partitioning Storage Devices, Formatting Filesystems and Configuring Swap Partition.md new file mode 100644 index 0000000000..987ea4a7f8 --- /dev/null +++ b/translated/tech/LFCS/Part 4 - LFCS: Partitioning Storage Devices, Formatting Filesystems and Configuring Swap Partition.md @@ -0,0 +1,195 @@ +GHLandy Translated + +LFCS 系列第四讲:分区存储设备、格式化文件系统和配置交换分区 + +================================================================================ +去年八月份,Linux 基金会发起了 LFCS(Linux Foundation Certified Sysadmin,Linux 基金会认证系统管理员)认证,给所有系统管理员一个展现自己的机会。通过基础考试后,他们可以胜任在 Linux 上的整体运维工作:包括系统支持、一流水平的诊断和监控以及在必要之时向其他支持团队提交帮助请求等。 + +![Linux Foundation Certified Sysadmin – Part 4](http://www.tecmint.com/wp-content/uploads/2014/10/lfcs-Part-4.png) + +LFCS 系列第四讲 + +需要注意的是,Linux 基金会认证是非常严格的,通过与否完全要看个人能力。通过在线链接,你可以随时随地参加 Linux 基金会认证考试。所以,你再也不用到考试中心了,只需要不断提高自己的专业技能和经验就可去参加考试了。 + +请看一下视频,这里将讲解 Linux 基金会认证程序。 + +注:youtube 视频 + + +本讲是《十套教程》系列中的第四讲。在本讲中,我们将涵盖分区存储设备、格式化文件系统和配置交换分区等内容,这些都是 LFCS 认证中的必备知识。 + +### 分区存储设备 ### + +分区是一种将单独的硬盘分成一个或多个区的手段。一个分区只是硬盘的一部分,我们可以认为这部分是独立的磁盘,里边包含一个单一类型的文件系统。分区表则是将硬盘上这些分区与分区标识符联系起来的索引。 + +在 Linux 中,IBM PC 兼容系统里边用于管理传统 MBR(最新到2009年)分区的工具是 fdisk。对于 GPT(2010年至今)分区,我们使用 gdisk。这两个工具都可以通过程序名后面加上设备名称(如 /dev/sdb)进行调用。 + +#### 使用 fdisk 管理 MBR 分区 #### + +我们先来介绍 fdisk: + + # fdisk /dev/sdb + +然后出现提示说进行下一步操作。若不确定如何操作,按下 “m” 键显示帮助。 + +![fdisk Help Menu](http://www.tecmint.com/wp-content/uploads/2014/10/fdisk-help.png) + +fdisk 帮助菜单 + +上图中,使用频率最高的选项已高亮显示。你可以随时按下 “p” 显示分区表。 + +![Check Partition Table in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Show-Partition-Table.png) + +显示分区表 + +Id 列显示由 fdisk 分配给每个分区的分区类型(分区 id)。一个分区类型代表一种文件系统的标识符,简单来说,包括该分区上数据的访问方法。 + +请注意,每个分区类型的全面都全面讲解将超出了本教程的范围——本系列教材主要专注于 LFCS 测试,因能力为主。 + +**下面列出一些 fdisk 常用选项:** + +按下 “l”(小写 L)选项来显示所有可以由 fdisk 管理的分区类型。 + +按下 “d” 可以删除现有的分区。若硬盘上有多个分区,fdisk 将询问你要删除那个分区。 + +键入对应的数字,并按下 “w” 保存更改(将更改写入分区表)。 + +在下图的命令中,我们将删除 /dev/sdb2,然后显示(p)分区表来验证更改。 + +![fdisk Command Options](http://www.tecmint.com/wp-content/uploads/2014/10/fdisk-options.png) + +fdisk 命令选项 + +按下 “n” 后接着按下 “p” 会创建新一个主分区。最后,你可以使用所有的默认值(这将占用所有的可用空间),或者像下面一样自定义分区大小。 + +![Create New Partition in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-New-Partition.png) + +创建新分区 + +若 fdisk 分配的分区 Id 并不是我们想用的,可以按下 “t” 来更改。 + +![Change Partition Name in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Change-Partition-Name.png) + +更改分区类型 + +全部设置好分区后,按下 “w” 将更改保存到硬盘分区表上。 + +![Save Partition Changes](http://www.tecmint.com/wp-content/uploads/2014/10/Save-Partition-Changes.png) + +保存分区更改 + +#### 使用 gdisk 管理 GPT 分区 #### + +下面的例子中,我们使用 /dev/sdb。 + + # gdisk /dev/sdb + +必须注意的是,gdisk 可以用于创建 MBR 和 GPT 两种分区表。 + +![Create GPT Partitions in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-GPT-Partitions.png) + +创建 GPT 分区 + +使用 GPT 分区方案,我们可以在同一个硬盘上创建最多 128 个分区,单个分区最大以 PB 为单位,而 MBR 分区方案最大的只能 2TB。 + +注意,fdisk 与 gdisk 中大多数命令都是一样的。因此,我们不会详细介绍这些命令选项,而是给出一张使用过程中的截图。 + +![gdisk Command Options](http://www.tecmint.com/wp-content/uploads/2014/10/gdisk-options.png) + +gdisk 命令选项 + +### 格式化文件系统 ### + +一旦创建完需要的分区,我们就必须为分区创建文件系统。查询你所用系统支持的文件系统,请运行: + + # ls /sbin/mk* + +![Check Filesystems Type in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Filesystems.png) + +检查文件系统类型 + +选择文件系统取决于你的需求。你应该考虑到每个文件系统的优缺点以及其特点。选择文件系统需要看的两个重要属性: + +- 日志支持,允许从系统崩溃事件中快速恢复数据。 +- 安全增强式 Linux(SELinux)支持,按照项目 wiki 所说,“安全增强式 Linux 允许用户和管理员更好的把握访问控制权限”。 + +在接下来的例子中,我们通过 mkfs 在 /dev/sdb1上创建 ext4 文件系统(支持日志和 SELinux),标卷为 Tecmint。mkfs 基本语法如下: + + # mkfs -t [filesystem] -L [label] device + 或者 + # mkfs.[filesystem] -L [label] device + +![Create ext4 Filesystems in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-ext4-Filesystems.png) + +创建 ext4 文件系统 + +### 创建并启用交换分区 ### + +要让 Linux 系统访问虚拟内存,则必须有一个交换分区,当内存(RAM)用完的时候,将硬盘中指定分区(即 Swap 分区)当做内存来使用。因此,当有足够的系统内存(RAM)来满足系统的所有的需求时,我们并不需要划分交换分区。尽管如此,是否使用交换分区取决于管理员。 + +下面列出选择交换分区大小的经验法则: + +物理内存不高于 2GB 时,取两倍物理内存大小即可;物理内存在 2GB 以上时,取一倍物理内存大小即可;并且所取大小应该大于 32MB。 + +所以,如果: + +M为物理内存大小,S 为交换分区大小,单位 GB,那么: + + 若 M < 2 + S = M *2 + 否则 + S = M + 2 + +记住,这只是基本的经验。对于作为系统管理员的你,才是决定是否使用交换分区及其大小的关键。 + +要配置交换分区,首先要划分一个常规分区,大小像我们之前演示的那样来选取。然后添加以下条目到 /etc/fstab 文件中(其中的X要更改为对应的 b 或 c)。 + + /dev/sdX1 swap swap sw 0 0 + +最后,格式化并启用交换分区: + + # mkswap /dev/sdX1 + # swapon -v /dev/sdX1 + +显示交换分区的快照: + + # cat /proc/swaps + +关闭交换分区: + + # swapoff /dev/sdX1 + +下面的例子,我们会使用 fdisk 将 /dev/sdc1(512MB,系统和内存为 256MB)来设置交换分区,下面是我们之前详细提过的步骤。注意,这种情况下我们使用的是指定大小分区。 + +![Create-Swap-Partition in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-Swap-Partition.png) + +创建交换分区 + +![Add Swap Partition in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Enable-Swap-Partition.png) + +启用交换分区 + +### 结论 ### + +在你的系统管理员之路上,创建分区(包括交换分区)和格式化文件系统是非常重要的一部。我希望本文中所给出的技巧指导你到达你的管理员目标。随时在本讲评论区中发表你的技巧和想法,一起为社区做贡献。 + +参考链接 + +- [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] +译者:[GHLandy](https://github.com/GHLandy) +校对:[校对者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 From f334cabef84a01dd01f6d318501e596c30a8271b Mon Sep 17 00:00:00 2001 From: SonoFelice Date: Thu, 31 Dec 2015 00:09:54 +0800 Subject: [PATCH 0105/1469] =?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 --- ...tor Linux System Performance Using Nmon.md | 86 ++++++++----------- 1 file changed, 36 insertions(+), 50 deletions(-) diff --git a/sources/tech/20151223 Monitor Linux System Performance Using Nmon.md b/sources/tech/20151223 Monitor Linux System Performance Using Nmon.md index b482f17bf6..30e22701c4 100644 --- a/sources/tech/20151223 Monitor Linux System Performance Using Nmon.md +++ b/sources/tech/20151223 Monitor Linux System Performance Using Nmon.md @@ -1,99 +1,85 @@ sonofelice translating -Monitor Linux System Performance Using Nmon +使用Nmon监控Linux的系统性能 ================================================================================ -Nmon (also known as Nigel’s Monitor) is a computer performance system monitor tool for the AIX and Linux operating systems developed by IBM employee Nigel Griffiths. The tool displays onscreen or saves to a data file the operating system statistics to aid in the understanding of computer resource use, tuning options and bottlenecks. This system benchmark tool gives you a huge amount of important performance information in one go with a single command. You can easily monitor your system’s CPU, memory, network, disks, file systems, NFS, top processes, resources and power micro-partition information using Nmon. +Nmon(得名于Nigel's的监控器)是IBM的员工Nigel Griffiths为AIX和Linux系统开发的一款计算机性能系统监控工具。Nmon可以把操作系统的统计数据展示在屏幕上或者存储到一份数据文件里,来帮助理解计算机资源的使用情况、调整选项和系统瓶颈。这个系统基准测试工具只需要使用一条命令就能得到大量重要的性能数据。使用Nmon可以很轻松的监控系统的CPU、内存、网络、硬盘、文件系统、NFS、高耗进程、资源和微分区功率的信息。 -### Installing Nmon ### +### Nmon 安装 ### -By default nmon is available in the Ubuntu repository. You can easily install nmon by running the following command: +Nmon默认是存在于Ubuntu的仓库中的。你可以通过下面的命令安装Nmon: sudo apt-get install nmon -How to Use Nmon to Monitor Linux Performance - -Once the installation has been finished, you can launch it by typing the `nmon` command in the terminal. +怎么使用Nmon来监控Linux的性能 +安装完成后,通过在终端输入`nmon` 命令来启动Nmon nmon -You wI’ll see the following output: +你会看到下面的输出: ![nmon-output](https://www.maketecheasier.com/assets/uploads/2015/12/nmon-output.png) -You can see from the above screenshot that the nmon command-line utility runs completely in interactive mode, and you can easily toggle statistics using shortcut keys. +从上面的截图可以看到nmon命令行工具完全是交互式运行的,你可以使用快捷键来轻松查看对应的统计数据。 +你可以使用下面的nmon快捷键来显示不同的系统统计数据: -You can use the following nmon keyboard shortcuts to display different system stats: +- `q` : 停止或编辑Nmon +- `h` : 查看帮助 +- `c` : 查看CPU统计数据 +- `m` : 查看内存统计数据 +- `d` : 查看硬盘统计数据 +- `k` : 查看内核统计数据 +- `n` : 查看网络统计数据 +- `N` : 查看NFS统计数据 +- `j` : 查看文件系统统计数据 +- `t` : 查看高耗进程 +- `V` : 查看虚拟内存统计数据 +- `v` : 详细模式 -- `q` : to stop and exit Nmon -- `h` : to see help screen -- `c` : see CPU stats -- `m` : see memory stats -- `d` : see disk stats -- `k` : see kernel stats -- `n` : see network stats -- `N` : see NFS stats -- `j` : see file system stats -- `t` : see top process -- `V` : see virtual memory stats -- `v` : verbose mode +### 核查CPU处理器 ### -### Check CPU by Processor ### - -If you would like to collect some statistics on CPU performance, you should hit the c key on the keyboard. - -After hitting the c key you wI’ll see the following output. +如果你想收集关于CPU性能相关的统计数据,你应该按下键盘上的`c`键,之后你将会看到下面的输出: ![nmon_cpu_output](https://www.maketecheasier.com/assets/uploads/2015/12/nmon_cpu_output.png) -### Check Top Process Statistics ### +### 核查高耗进程统计数据 ### -To get stats on top processes that are running on your system, press the t key on your keyboard. - -You will see the following output. +如果想收集系统正在运行的高耗进程的统计数据,按键盘上的`t`键,之后你将会看到下面的输出: ![nmon_process_output](https://www.maketecheasier.com/assets/uploads/2015/12/nmon_process_output.jpg) -### Check Network Statistics ### +### 核查网络统计数据 ### -To get the network stats of your Linux system, just press the n key on your keyboard. - -You wI’ll see the following output: +如果想收集Linux系统网络统计数据,按下`n`键,你将会看到下面输出: ![n_network_output](https://www.maketecheasier.com/assets/uploads/2015/12/nmon_network_output.png) -### Disk I/O Graphs ### +### 硬盘 I/O 图表 ### -Use the `d` key to get information about disks. - -You wI’ll see the following output: +使用`d` 键获取硬盘相关的信息,你会看到下面输出: ![nmon_disk_output](https://www.maketecheasier.com/assets/uploads/2015/12/nmon_disk_output.png) -### Check Kernel Information ### +### 核查内核信息 ### -A most important key to use with this tool is `k;` it is used to display some brief information on the kernel of your system. - -You will see the following output after hitting the `k` key on your keyboard. +Nmon一个非常重要的快捷键是`k`键,用来显示系统内核相关的概要信息。按下`k`键之后,会看到下面输出: ![nmon_kernel_output](https://www.maketecheasier.com/assets/uploads/2015/12/nmon_kernel_output.png) -### Get System Information ### +### 获取系统信息 ### -A very useful key for every system admin is the `r` key which is used to give information on different resources such as machine architecture, operating system version, Linux version and CPU. - -You will see the following output by hitting the `r` key. +对每个系统管理员来说一个非常有用的快捷键是`r`键,可以用来显示计算机系统结构、操作系统版本号和CPU等不同资源的信息。按下`r`键之后会看到下面输出: ![nmon_system_output](https://www.maketecheasier.com/assets/uploads/2015/12/nmon_system_output.png) -### Conclusion ### +### 总结 ### -There are many other tools that can do the same job of the Nmon, but Nmon is so usee friendly for a Linux beginner. Please feel free to comment if you have any questions. +还有许多其他的工具实现的功能和Nmon一样,不过Nmon对一个Linux新手来说还是很友好的。如果你有什么问题,尽管评论。 -------------------------------------------------------------------------------- via: https://www.maketecheasier.com/monitor-linux-system-performance/ 作者:[Hitesh Jethva][a] -译者:[译者ID](https://github.com/译者ID) +译者:[sonofelice](https://github.com/sonofelice) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b64d869421d63bf6ba9329677c0151dee467f011 Mon Sep 17 00:00:00 2001 From: SonoFelice Date: Thu, 31 Dec 2015 00:11:03 +0800 Subject: [PATCH 0106/1469] =?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 --- .../tech/20151223 Monitor Linux System Performance Using Nmon.md | 1 - 1 file changed, 1 deletion(-) rename {sources => translated}/tech/20151223 Monitor Linux System Performance Using Nmon.md (99%) diff --git a/sources/tech/20151223 Monitor Linux System Performance Using Nmon.md b/translated/tech/20151223 Monitor Linux System Performance Using Nmon.md similarity index 99% rename from sources/tech/20151223 Monitor Linux System Performance Using Nmon.md rename to translated/tech/20151223 Monitor Linux System Performance Using Nmon.md index 30e22701c4..70d0f3a11f 100644 --- a/sources/tech/20151223 Monitor Linux System Performance Using Nmon.md +++ b/translated/tech/20151223 Monitor Linux System Performance Using Nmon.md @@ -1,4 +1,3 @@ -sonofelice translating 使用Nmon监控Linux的系统性能 ================================================================================ Nmon(得名于Nigel's的监控器)是IBM的员工Nigel Griffiths为AIX和Linux系统开发的一款计算机性能系统监控工具。Nmon可以把操作系统的统计数据展示在屏幕上或者存储到一份数据文件里,来帮助理解计算机资源的使用情况、调整选项和系统瓶颈。这个系统基准测试工具只需要使用一条命令就能得到大量重要的性能数据。使用Nmon可以很轻松的监控系统的CPU、内存、网络、硬盘、文件系统、NFS、高耗进程、资源和微分区功率的信息。 From fdaa1dc0bb87b91fee1c1a2b1f3cab751c3b17c4 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 31 Dec 2015 06:40:13 +0800 Subject: [PATCH 0107/1469] PUB:20151229 Watch Star Wars In Linux Terminal @zky001 --- ...51229 Watch Star Wars In Linux Terminal.md | 55 +++++++++++++++++++ ...51229 Watch Star Wars In Linux Terminal.md | 49 ----------------- 2 files changed, 55 insertions(+), 49 deletions(-) create mode 100644 published/20151229 Watch Star Wars In Linux Terminal.md delete mode 100644 translated/tech/20151229 Watch Star Wars In Linux Terminal.md diff --git a/published/20151229 Watch Star Wars In Linux Terminal.md b/published/20151229 Watch Star Wars In Linux Terminal.md new file mode 100644 index 0000000000..b92a5b8b61 --- /dev/null +++ b/published/20151229 Watch Star Wars In Linux Terminal.md @@ -0,0 +1,55 @@ +在 Linux 终端下看《星球大战》 +================================================================================ +![](http://itsfoss.com/wp-content/uploads/2015/12/Star-Wars-Linux-Terminal-2.png) + +《星球大战(Star Wars)》已经席卷世界。最新一期的 [《星球大战》系列, 《星球大战7:原力觉醒》,打破了有史以来的记录][1]。 + +虽然我不能帮你得到一张最新的《星球大战》的电影票,但我可以提供给你一种方式,看[星球大战第四集][2],它是非常早期的《星球大战》电影(1977 年)。 + + +不,它不会是高清,也不是蓝光版。相反,它将是 ASCII 版的《星球大战》第四集,你可以在 Linux 终端看它,这才是真正的极客的方式 :) + +### 在 Linux 终端看星球大战 ### + +打开一个终端,使用以下命令: + + telnet towel.blinkenlights.nl + +等待几秒钟,你可以在终端看到类似于以下这样的动画ASCII艺术: + +(LCTT 译注:有时候会解析到效果更好 IPv6 版本上,如果你没有 IPv6 地址,可以重新连接试试;另外似乎线路不稳定,出现卡顿时稍等。) + +![](http://itsfoss.com/wp-content/uploads/2015/12/Star-Wars-Linux-Terminal.png) + +它将继续播映…… + +![](http://itsfoss.com/wp-content/uploads/2015/12/Star-Wars-Linux-Terminal-1.png) + +![](http://itsfoss.com/wp-content/uploads/2015/12/Star-Wars-Linux-Terminal-2.png) + +![](http://itsfoss.com/wp-content/uploads/2015/12/Star-Wars-Linux-Terminal-3.png) + +![](http://itsfoss.com/wp-content/uploads/2015/12/Star-Wars-Linux-Terminal-5.png) + +要停止动画,按 ctrl +],在这之后输入 quit 来退出 telnet 程序。 + +### 更多有趣的终端 ### + +事实上,看《星球大战》并不是你在 Linux 终端下唯一能做有趣的事情。您可以运行[终端里的列车][3]或[通过ASCII艺术得到Linux标志][4]。 + +希望你能享受在 Linux 下看《星球大战》。 + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/star-wars-linux/ + +作者:[Abhishek][a] +译者:[zky001](https://github.com/zky001) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:http://www.gamespot.com/articles/star-wars-7-breaks-thursday-night-movie-opening-re/1100-6433246/ +[2]:http://www.imdb.com/title/tt0076759/ +[3]:http://itsfoss.com/ubuntu-terminal-train/ +[4]:http://itsfoss.com/display-linux-logo-in-ascii/ diff --git a/translated/tech/20151229 Watch Star Wars In Linux Terminal.md b/translated/tech/20151229 Watch Star Wars In Linux Terminal.md deleted file mode 100644 index 41b739a9c0..0000000000 --- a/translated/tech/20151229 Watch Star Wars In Linux Terminal.md +++ /dev/null @@ -1,49 +0,0 @@ -在Linux终端看星球大战 -================================================================================ -![](http://itsfoss.com/wp-content/uploads/2015/12/Star-Wars-Linux-Terminal-2.png) -星球大战席卷世界。最新一期的 [《星球大战》系列, 《星球大战7:原力觉醒》,打破了有史以来的记录][1]. - -虽然我不能帮你得到一张最新的《星球大战》电影的票,但我可以提供给你一种方式,看[星球大战第四集片段][2],它是非常早期的《星球大战》电影。 - -不,它不会是高清,也不是蓝光版。相反,它将是ASCII版的《星球大战》第四集片段,你可以在Linux终端看它,这才是真正的极客的方式 :) - -### 在Linux终端看星球大战 ### - -打开一个终端,使用以下命令: - - telnet towel.blinkenlights.nl - -等待几秒钟,你可以在终端看到类似于以下这样的动画ASCII艺术: - -![](http://itsfoss.com/wp-content/uploads/2015/12/Star-Wars-Linux-Terminal.png) - -同时它将继续 - -![](http://itsfoss.com/wp-content/uploads/2015/12/Star-Wars-Linux-Terminal-1.png) - -![](http://itsfoss.com/wp-content/uploads/2015/12/Star-Wars-Linux-Terminal-2.png) - -![](http://itsfoss.com/wp-content/uploads/2015/12/Star-Wars-Linux-Terminal-3.png) - -![](http://itsfoss.com/wp-content/uploads/2015/12/Star-Wars-Linux-Terminal-5.png) - -要停止动画,按 ctrl +],在这之后输入quit来退出tenlnet程序 - -### 更多有趣的终端 ### -事实上,看《星球大战》并不是你在Linux终端下唯一能做有趣的事情。您可以运行[终端里的列车][3]或[通过ASCII艺术得到Linux标志][4]。 - -我希望你可以在Linux下享受星球争霸 --------------------------------------------------------------------------------- - -via: http://itsfoss.com/star-wars-linux/ - -作者:[Abhishek][a] -译者:[zky001](https://github.com/zky001) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[1]:http://www.gamespot.com/articles/star-wars-7-breaks-thursday-night-movie-opening-re/1100-6433246/ -[2]:http://www.imdb.com/title/tt0076759/ -[3]:http://itsfoss.com/ubuntu-terminal-train/ -[4]:http://itsfoss.com/display-linux-logo-in-ascii/ From b622e12b53d483fa29126aed575560f5293aaa6b Mon Sep 17 00:00:00 2001 From: Feng Wei Date: Thu, 31 Dec 2015 11:10:12 +0800 Subject: [PATCH 0108/1469] =?UTF-8?q?[=E7=BF=BB=E8=AF=91=E4=B8=AD]20151223?= =?UTF-8?q?=20How=20to=20Setup=20SSH=20Login=20Without=20Password=20CentOS?= =?UTF-8?q?=20or=20RHEL.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 申请任务 --- ...51223 How to Setup SSH Login Without Password CentOS or RHEL.md} | 1 + 1 file changed, 1 insertion(+) rename sources/tech/{20151223 How to Setup SSH Login Without Password CentOS or RHEL.md => [翻译中]20151223 How to Setup SSH Login Without Password CentOS or RHEL.md} (99%) diff --git a/sources/tech/20151223 How to Setup SSH Login Without Password CentOS or RHEL.md b/sources/tech/[翻译中]20151223 How to Setup SSH Login Without Password CentOS or RHEL.md similarity index 99% rename from sources/tech/20151223 How to Setup SSH Login Without Password CentOS or RHEL.md rename to sources/tech/[翻译中]20151223 How to Setup SSH Login Without Password CentOS or RHEL.md index b4a2f886a1..3e0fc4cc0d 100644 --- a/sources/tech/20151223 How to Setup SSH Login Without Password CentOS or RHEL.md +++ b/sources/tech/[翻译中]20151223 How to Setup SSH Login Without Password CentOS or RHEL.md @@ -1,3 +1,4 @@ +translating by fw8899 How to Setup SSH Login Without Password CentOS / RHEL ================================================================================ ![](http://www.ehowstuff.com/wp-content/uploads/2015/12/notebook-1071774_1280.jpg) From e58e7a4167bb1435323e8c3b9601b5c7f8e06009 Mon Sep 17 00:00:00 2001 From: "hittlle.li" Date: Thu, 31 Dec 2015 13:55:37 +0800 Subject: [PATCH 0109/1469] =?UTF-8?q?[=E5=BC=80=E5=A7=8B=E7=BF=BB=E8=AF=91?= =?UTF-8?q?]=20:=20Part=2010=20-=20LFCS=20--=20Understanding=20and=20Learn?= =?UTF-8?q?ing=20Basic=20Shell=20Scriptiong=20and=20Linux=20Filesystem=20T?= =?UTF-8?q?roubleshooting.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...sic Shell Scripting and Linux Filesystem Troubleshooting.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 3ffb1dc54f..841d5c0625 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,4 @@ +Being translated by hittlle...... 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. @@ -312,4 +313,4 @@ via: http://www.tecmint.com/linux-basic-shell-scripting-and-linux-filesystem-tro [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 +[4]:http://www.tecmint.com/basic-shell-programming-part-ii/ From d1d51c0e558646ebcf06439c70b5b9f457116275 Mon Sep 17 00:00:00 2001 From: cposture Date: Thu, 31 Dec 2015 14:02:40 +0800 Subject: [PATCH 0110/1469] =?UTF-8?q?[Translating=20by=20cposture=2015-12-?= =?UTF-8?q?31]Part=206=20-=20LFCS--Assembling=20Partitions=20as=20RAID=20D?= =?UTF-8?q?evices=20=E2=80=93=20Creating=20&=20=20=20=20=20Managing=20Syst?= =?UTF-8?q?em=20Backups?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ons as RAID Devices – Creating & Managing System Backups.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 fd23db110f..21f1d0523b 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,4 @@ +[Translating by cposture 15-12-31] 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. @@ -273,4 +274,4 @@ via: http://www.tecmint.com/creating-and-managing-raid-backups-in-linux/ [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 +[4]:http://www.tecmint.com/rsync-local-remote-file-synchronization-commands/ From a08de53bc453c005ca72b3da3dbfaf3a9da5dc0a Mon Sep 17 00:00:00 2001 From: "Fuliang.Li" Date: Thu, 31 Dec 2015 14:22:01 +0800 Subject: [PATCH 0111/1469] =?UTF-8?q?[=E5=BC=80=E5=A7=8B=E7=BF=BB=E8=AF=91?= =?UTF-8?q?]=20Part=208=20-=20LFCS--Managing=20Users=20and=20Groups=20File?= =?UTF-8?q?=20Permissions=20and=20Attributes=20and=20Enabling=20sudo=20Acc?= =?UTF-8?q?ess=20on=20Accounts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ons and Attributes and Enabling sudo Access on Accounts.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 2cec4de4ae..d45720d964 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 @@ +GHLandy Translating + 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. @@ -327,4 +329,4 @@ via: http://www.tecmint.com/manage-users-and-groups-in-linux/ [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 +[6]:http://www.tecmint.com/vi-editor-usage/ From 869e613069c86ca0cfc95caaf5e4cea7ef5a467d Mon Sep 17 00:00:00 2001 From: CHL Date: Thu, 31 Dec 2015 14:40:29 +0800 Subject: [PATCH 0112/1469] [Translating by Flowsnow] Part 7 - LFCS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flowsnow正在翻译part7 --- ...artup Process and Services SysVinit Systemd and Upstart.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 abf09ee523..3a2dfa844a 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 Flowsnow + 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. @@ -364,4 +366,4 @@ via: http://www.tecmint.com/linux-boot-process-and-manage-services/ [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 +[6]:http://upstart.ubuntu.com/cookbook/ From 536c8163d9e67f3893e3bbd6dfc49ad09ee6f4e5 Mon Sep 17 00:00:00 2001 From: CHL Date: Thu, 31 Dec 2015 14:43:32 +0800 Subject: [PATCH 0113/1469] =?UTF-8?q?=E5=8F=96=E6=B6=88=E7=BF=BB=E8=AF=91p?= =?UTF-8?q?art7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Startup Process and Services SysVinit Systemd and Upstart.md | 2 -- 1 file changed, 2 deletions(-) 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 3a2dfa844a..2a822e8a45 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,5 +1,3 @@ -Translating by Flowsnow - 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. From 9383d826c27445cd663e76377c69bc4ce43c9e9e Mon Sep 17 00:00:00 2001 From: CHL Date: Thu, 31 Dec 2015 14:47:17 +0800 Subject: [PATCH 0114/1469] [Translating by Flowsnow] Part 7 - LFCS: Managing System Startup Process and Services MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flowsnow开始翻译part7 --- ...Startup Process and Services SysVinit Systemd and Upstart.md | 2 ++ 1 file changed, 2 insertions(+) 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 2a822e8a45..3a2dfa844a 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 Flowsnow + 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. From e9550c3324e0325900dc7abf662a50d2d65ec57b Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Thu, 31 Dec 2015 14:57:47 +0800 Subject: [PATCH 0115/1469] Translating by ZTinoZ Signed-off-by: ZTinoZ --- ...lla with Apache and SSL on FreeBSD 10.2.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sources/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md b/sources/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md index 46ce91f327..4d14f87440 100644 --- a/sources/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md +++ b/sources/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md @@ -95,7 +95,7 @@ Bugzilla是一款bug跟踪系统和测试工具,它基于web且开源,由moz ![Configure MySQL Password](http://blog.linoxide.com/wp-content/uploads/2015/12/Configure-MySQL-Password.png) -以上步骤都完成之后,我们用root登录mysql shell,然后为bugzilla创建一个新的数据库和用户。 +以上步骤都完成之后,我们用root登录mysql shell,然后为bugzilla安装创建一个新的数据库和用户。 用以下命令登录mysql shell: @@ -130,18 +130,18 @@ bugzilla的数据库创建好了,名字为"bugzilladb",用户名和密码分 ### 第五步 - 配置虚拟主机 ### -We will install bugzilla on directory "/usr/local/www/bugzilla", so we must create new virtualhost configuration for it. +我们将在"/usr/local/www/bugzilla"目录里安装bugzilla,所以我们必须为它创建新的虚拟主机配置。 -Go to the apache directory and create new directory called "vhost" for virtualhost file : +前往apache目录并为虚拟主机文件创建名为"vhost"的新目录: cd /usr/local/etc/apache24/ mkdir vhost; cd vhost -Now create new file "bugzilla.conf" for the virtualhost file : +现在为虚拟主机文件创建新文件"bugzilla.conf": nano -c bugzilla.conf -Paste configuration below : +将以下配置粘贴进去: ServerName mybugzilla.me @@ -173,28 +173,28 @@ Paste configuration below : 保存并退出。 -If all is done, create new directory for bugzilla installation and then enable the bugzilla virtualhost by adding the virtualhost configuration to httpd.conf file. +上述都完成之后,为bugzilla安装创建新目录并通过添加虚拟主机配置至httpd.conf文件来启用bugzilla虚拟主机。 -Run command below on "apache24" directory : +在"apache24"目录下运行以下命令: mkdir -p /usr/local/www/bugzilla cd /usr/local/etc/apache24/ nano -c httpd.conf -In the end of the line, add configuration below : +文末,添加以下配置: Include etc/apache24/vhost/*.conf -Save and exit. +保存并退出。 -Now test the apache configuration with "apachectl" command and restart it : +现在用"apachectl"命令测试一下apache的配置并重启它: apachectl configtest service apache24 restart ### 第六步 - 安装Bugzilla ### -We can install bugzilla manually by downloading the source, or install it from freebsd repository. In this step we will install bugzilla from freebsd repository with pkg command : +我们可以通过下载源来手动安装bugzilla了,或从freebsd库中安装也可以。在这一步中我们将用pkg命令从freebsd库中安装bugzilla: pkg install bugzilla50 From f1695ece125a2d4395f517c8e8778b430475dd9c Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 31 Dec 2015 16:26:37 +0800 Subject: [PATCH 0116/1469] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84=E6=96=87=E4=BB=B6=E5=90=8D=EF=BC=8C=E4=B8=BA=E4=BA=86?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=E8=B5=B7=E8=A7=81=EF=BC=8C=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E7=94=A8=20/=20\=20:=20=E7=AD=89=E5=AD=97=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @GHLandy --- ...CS--How to Install and Use vi or vim as a Full Text Editor.md} | 0 ...ces, Formatting Filesystems and Configuring Swap Partition.md} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename translated/tech/LFCS/{Part 2 - LFCS: How to Install and Use vi or vim as a Full Text Editor.md => Part 2 - LFCS--How to Install and Use vi or vim as a Full Text Editor.md} (100%) rename translated/tech/LFCS/{Part 4 - LFCS: Partitioning Storage Devices, Formatting Filesystems and Configuring Swap Partition.md => Part 4 - LFCS--Partitioning Storage Devices, Formatting Filesystems and Configuring Swap Partition.md} (100%) diff --git a/translated/tech/LFCS/Part 2 - LFCS: How to Install and Use vi or vim as a Full Text Editor.md b/translated/tech/LFCS/Part 2 - LFCS--How to Install and Use vi or vim as a Full Text Editor.md similarity index 100% rename from translated/tech/LFCS/Part 2 - LFCS: How to Install and Use vi or vim as a Full Text Editor.md rename to translated/tech/LFCS/Part 2 - LFCS--How to Install and Use vi or vim as a Full Text Editor.md diff --git a/translated/tech/LFCS/Part 4 - LFCS: Partitioning Storage Devices, Formatting Filesystems and Configuring Swap Partition.md b/translated/tech/LFCS/Part 4 - LFCS--Partitioning Storage Devices, Formatting Filesystems and Configuring Swap Partition.md similarity index 100% rename from translated/tech/LFCS/Part 4 - LFCS: Partitioning Storage Devices, Formatting Filesystems and Configuring Swap Partition.md rename to translated/tech/LFCS/Part 4 - LFCS--Partitioning Storage Devices, Formatting Filesystems and Configuring Swap Partition.md From ce939525c2a1b031f474b6298601849d8d4f2fb9 Mon Sep 17 00:00:00 2001 From: martin qi Date: Thu, 31 Dec 2015 19:22:30 +0800 Subject: [PATCH 0117/1469] translating --- ...ee Software Foundation--Best Quotes of Richard Stallman.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/talk/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md b/sources/talk/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md index af8bb311db..e7dbefff62 100644 --- a/sources/talk/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md +++ b/sources/talk/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md @@ -1,3 +1,5 @@ +For my dear RMS + 30 Years of Free Software Foundation: Best Quotes of Richard Stallman ================================================================================ 注:youtube 视频 @@ -167,4 +169,4 @@ via: https://tlhp.cf/fsf-richard-stallman/ [a]:https://tlhp.cf/author/paul/ [1]:http://www.gnu.org/ -[2]:http://www.fsf.org/ \ No newline at end of file +[2]:http://www.fsf.org/ From 93ce9ef14f295c6d556d340c533b11c9a87129f0 Mon Sep 17 00:00:00 2001 From: Markgolzh <1134386961@qq.com> Date: Fri, 1 Jan 2016 13:03:55 +0800 Subject: [PATCH 0118/1469] Delete 20151225 What are the best plugins to increase productivity on Emacs.md --- ...ugins to increase productivity on Emacs.md | 79 ------------------- 1 file changed, 79 deletions(-) delete mode 100644 sources/tech/20151225 What are the best plugins to increase productivity on Emacs.md diff --git a/sources/tech/20151225 What are the best plugins to increase productivity on Emacs.md b/sources/tech/20151225 What are the best plugins to increase productivity on Emacs.md deleted file mode 100644 index 6c3a1c8f98..0000000000 --- a/sources/tech/20151225 What are the best plugins to increase productivity on Emacs.md +++ /dev/null @@ -1,79 +0,0 @@ -zky001翻译中 -What are the best plugins to increase productivity on Emacs -================================================================================ -Over a year ago now, I went looking for the best plugins to [turn Vim into a full-fledged IDE][1]. Interestingly, a lot of the comments on that post were about how Emacs already has most of these plugins built in, and was already a great IDE. Although I can only agree about Emacs' incredible versatility, it is still not the ultimate editor when it comes out of the box. Thankfully, its vast plugin library is here to fix that. But among the plethora of options available to you, it is sometimes hard to know where to start. So for now, let me try to assemble a short list of the indispensable plugins to increase your productivity while using Emacs. Although I am heavily geared towards programming related productivity, most of these plugins would be useful to anyone for any usage. - -### 1. Ido-mode ### - -![](https://c2.staticflickr.com/6/5718/23311895573_c1fb34337c_c.jpg) - -Maybe one of the most useful plugin for beginners, Ido stands for interactively do. It replaces most of the dry prompts with a fancy character matching menu. For example, it will replace the normal prompt to open a file with a list of all the files in the current directory. Type any string, and Ido will try to match it with the most appropriate file. It makes it really easy to visualize your actions, and also to quickly get through a folder where all files are named with the same prefix. - -### 2. Smex ### - -![](https://c2.staticflickr.com/2/1517/23310442314_2a22a60c34_c.jpg) - -Not the most famous one, but a good place to complete what Ido-mode started: Smex can be a fancy replacement to the normal 'M-x' prompt, with a heavy inspiration from Ido-mode. It brings the same interactive search for the commands you would normally have to type after calling 'M-x'. It is simple and efficient, and a great way to save those additional few fractions of a second you normally need. - -### 3. Auto Complete ### - -![](https://c2.staticflickr.com/6/5794/23643004900_3042f77952_c.jpg) - -Before knowing the existence of this plugin, I spent half of my time on Emacs pressing ‘M-/’ to complete my words. Now, I have a fancy pop-up to do it for me. There is not much more to say about it, except that we all need it. - -### 4. YASnippet ### - -![](https://c2.staticflickr.com/2/1688/23830403072_0d8df6ef4c_b.jpg) - -This one is really for the coders. There is always some piece of code that we feel we use all the time. For me, it's 'var_dump(...); exit;' to debug PHP. After a while of typing it over and over, it just occurred to me that I could have it pre-recorded and easily accessible as a snippet of code. With YASnippets, it's easy to import snippet files or make your own. After that, a simple press on the tabulation key will expand a small keyword into a chunk of pre-written code easy to navigate through and modify. - -### 5. Org-mode ### - -![](https://c2.staticflickr.com/6/5687/23570808789_d683c949e4.jpg) - -For disclaimer, I have only recently started using Org-mode. But it has already blown me away. From the hundreds of written pieces I have seen around, Org-mode can change your life. The idea behind it is simple: it is a mode that simplifies note taking while keeping a plain text format, making it easy to navigate through lists of tasks and various data, and perform operations such as filtering by priority or due date, or setting a recurrence. Yet, from this simple idea, you can accomplish a lot, and it is easy to get overwhelmed with all the options. Rather than a long explanation, I urge you to go through [available tutorials][2], watch a lot of videos, and see by yourself how powerful Org-mode is. - -### 6. Helm ### - -![](https://c2.staticflickr.com/2/1489/23310442334_5e6db22b79_c.jpg) - -Some love it, but others are not such a big fan of it. I am part of the later. But with such a huge following, it is impossible to avoid it. Helm aims to transform your Emacs experience completely. Simply described, Helm is a framework that will help you find a file or a command quickly from within Emacs. Based on your input, it will try to use word completion to guide you to the action you have in mind. The feeling is a bit weird at first, but for some, Helm is a religion of its own. Although I am not its fan, I do appreciate helm-occur which a great tool to search for strings in a large document as it shows all occurrences in a separate buffer, making it easy to navigate through them. If you are looking for a quick demo to understand what Helm can do, I recommend [this post][3]. - -### 7. ace-jump-mode ### - -![](https://c2.staticflickr.com/2/1710/23856168871_6df1faa565_c.jpg) - -Another plugin with a big following that I am trying to get on board with is ace-jump-mode. Master this plugin, and you will be promised to transcend the usage of a mouse. Simply described, by triggering ace-jump-mode with a shortcut of your choice, you will be prompted for a character. Enter one, and all words starting with that character will be highlighted with a unique letter. Enter one of the letters on screen, and your cursor will jump straight to the word it is highlighting. I have to admit that it is pretty hard to get the reflex to use it, but once you have it, it will increase your movement speed in a document by a lot. - -### 8. find-file-in-project ### - -![](https://c2.staticflickr.com/2/1492/23570808809_96ec8454a9_c.jpg) - -If you like Sublime text and its very handy 'Ctrl-p' fuzzy search to open any file in a project, then you will love find-file-in-project (or ffip). After setting it up by declaring the root of your version control folder, you can summon easily a cool text bar that quickly scans and searches through your code base for a matching file based on the name you input. I like to have it bound to the F6 key on my keyboard. It is simple and very handy if you do not know the complicate directory structure from the top of your head. - -### 9. Flymake ### - -![](https://c2.staticflickr.com/6/5708/23310442354_cbba657ed3.jpg) - -For IDE lovers, I think that syntax checker is one of the most powerful features. It is great for beginners and handy for tired programmers. And thanks to Flymake, Emacs users can enjoy it too. Since I work in PHP a lot, Flymake does not need any extra configuration. As I write my code, it will automatically check my code and highlight any line that contains a problem. For compiled languages, Flymake will look for a Makefile that it will use to check your code. Absolutely magical. - -### 10. electric-pair ### - -Last, but not least, electric-pair is one of the simplest yet most powerful plugin in my opinion. It just automatically closes whatever parenthesis or bracket you open. It doesn't look like much at first, but trust me. After struggling for the hundredth time to find that matching parenthesis, you will be glad to have a plugin to ensure that all your expressions are balanced. - -To conclude, Emacs is a fantastic tool. Probably not a shocker. Try these plugins and watch as your productivity goes through the roof. This list is of course not exhaustive at all. If you want to bring your contribution, feel free to do so in the comments. I am myself always looking for new plugins to try and new ways to experience Emacs. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/best-plugins-to-increase-productivity-on-emacs.html - -作者:[Adrien Brochard][a] -译者:[zky001](https://github.com/zky001) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://xmodulo.com/author/adrien -[1]:http://xmodulo.com/turn-vim-full-fledged-ide.html -[2]:http://orgmode.org/worg/org-tutorials/ -[3]:http://tuhdo.github.io/helm-intro.html From 74ca5559941b3aaf306e867843e2af4a70eaebb7 Mon Sep 17 00:00:00 2001 From: Markgolzh <1134386961@qq.com> Date: Fri, 1 Jan 2016 13:05:00 +0800 Subject: [PATCH 0119/1469] Create 20151225 What are the best plugins to increase productivity on Emacs.md --- ...ugins to increase productivity on Emacs.md | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 translated/tech/20151225 What are the best plugins to increase productivity on Emacs.md diff --git a/translated/tech/20151225 What are the best plugins to increase productivity on Emacs.md b/translated/tech/20151225 What are the best plugins to increase productivity on Emacs.md new file mode 100644 index 0000000000..789ba72198 --- /dev/null +++ b/translated/tech/20151225 What are the best plugins to increase productivity on Emacs.md @@ -0,0 +1,92 @@ +zky001翻译中 +提高emacs(生产力)效率的最好插件是什么 +================================================================================ +一年前的这个时候, 我想要寻找一个最好的插件 [将VIM打造成一个成熟的全功能的IDE][1]. 有趣的是, 很多评论那篇文章的是关于Emacs是怎么样(如何)已经集成大部分这些插件,已经是一个伟大的IDE了. 尽管我对Emacs的难以置信的多样化表示赞成, 它依旧不是可以开箱即用(安装好不安插件即可用)的高级编辑器. 还好, 其庞大的插件库可以解决这个问题. 但在过多的选项中, 有时很难清楚该如何入手. 因此现在, 让我试着收集一个虽然简短但是不可或缺的插件列表来让你使用Emacs时提高工作效率. 虽然我主要侧重于与编程相关的生产力,但是这些插件将对任何人或对任何使用方法都是有用的. + +### 1. Ido-模式 ### + +![](https://c2.staticflickr.com/6/5718/23311895573_c1fb34337c_c.jpg) + +Ido 或许是对新手最有用的一个插件, Ido 表示交互式的去做.它取代大部分的用花哨的匹配字符提示的枯燥菜单 . 好比说, 它将取代正常的提示来打开一个拥有当前目录中的所有文件列表的文件. 任何字符串类型,Ido 将尝试匹配最合适的文件。它很容易想象你的行为,并迅速通过一个文件夹的所有文件命名相同的前缀来查找. + +### 2. Smex ### + +![](https://c2.staticflickr.com/2/1517/23310442314_2a22a60c34_c.jpg) + +不算最著名的一个,但却是一个好选择来完成那些由Ido-mode开始的工作:Smex可以优雅的替代正常的“M-x”提示,也有由Ido-mode带来的很大的启发。通常输入的命令调用“M-x”之后它带来同样的互动搜索。它既简单又有效,是一个很好的节省那些额外的你通常需要1秒的短时间方式 + +### 3. Auto Complete ### + +![](https://c2.staticflickr.com/6/5794/23643004900_3042f77952_c.jpg) + +知道这个插件的存在之前,我花了我一半的时间在使用Emacs敲击"M-/"来完成代码上。现在,我有一个漂亮的弹出为我去做自动补全。无须多说,只是我们都需要它。 + +### 4. YASnippet ### + +![](https://c2.staticflickr.com/2/1688/23830403072_0d8df6ef4c_b.jpg) + +这是真正的程序员所需利器。总有一些代码,我们觉得我们在它们上面用掉了所有的时间。对我来说,用"var_dump(…);exit;"来调试PHP。经过一段时间一遍又一遍的输入"var_dump(…);exit;",我就想到我可以预先把其作为录制好的,方便的代码片段。YASnippets,很容易导入片段文件或者自己制做。之后,一个简单的按制表键可以将一小关键词扩展成一块预先写好的代码易于使用者浏览和修改。 + + +### 5. Org-mode ### + +![](https://c2.staticflickr.com/6/5687/23570808789_d683c949e4.jpg) + +免责声明,我最近才开始使用Org-mode。但它已经深深的吸引了我。从我看过数以百计的书面作品来说,Org-mode可以改变你的生活。它背后的想法很简单:它是一种模式,简化了笔记,同时保持一个纯文本格式,便于浏览列表的任务和各种数据,并执行操作,如按优先级过滤或到期日期,或设置一个复发日期 。然而,从这个简单的想法,你可以完成很多,但也容易被所有的选项弄的不堪重负。与其去看一个长长的解释,我敦促你去通过[可用教程][2],看很多视频,自己去看看Org-mode是多么强大。 + + +### 6. Helm ### + +![](https://c2.staticflickr.com/2/1489/23310442334_5e6db22b79_c.jpg) + +一些使用者喜欢它,但是其他人没有这么大的使用热情。我是后者的一部分。但在拥有这样一个庞大的追随者群体的情况下,是不可能避免提到它的。Helm旨在完全变换你的Emacs使用体验。简单描述,Helm是一个这样的框架,在Emacs下将帮助您快速找到一个文件或命令。根据您的输入,它将尝试使用词语自动完成指导你大脑的念头变为行动。起初感觉有点奇怪,但对一些人来说,Helm本身就是一个信仰。虽然我不是Helm的粉丝,我欣赏helm-occur这一个伟大的工具在一个大文档搜索字符串并且在一个单独的缓冲区显示所有,因此很容易导航。如果你正在寻找一个快速演示来了解Helm能做什么,我推荐这篇文章[3]。 + + +### 7. ace-jump-mode ### + +![](https://c2.staticflickr.com/2/1710/23856168871_6df1faa565_c.jpg) + +另一个插件有一大群追随者,我试图加入ace-jump-mode的粉丝群。拥有这个插件,你会体验到胜于鼠标的使用。简单的描述,通过触发ace-jump-mode您选择的快捷方式,你将被提示字符。输入一个字符,所有单词将会出现,独特的字母字符将突出显示。输入一个字母在屏幕上,和你的光标会直接跳转到词高亮显示。我不得不承认,这是让反射很难使用它,但是,一旦你拥有它,它会增加你的在一个文档里光标的移动速度。 + + + +### 8. find-file-in-project ### + +![](https://c2.staticflickr.com/2/1492/23570808809_96ec8454a9_c.jpg) + +如果你喜欢Sublime text和它非常方便的“Ctrl-p”模糊搜索打开在一个项目中的任何文件,你将会喜欢上find-file-in-project(或ffip)。通过声明您的版本控制的根文件夹设置后,您可以轻松地收集一个快速扫描的很酷的标题文本并根据您输入的名称匹配的通过代码库搜索文件。我喜欢把它绑定到键盘上面F6键。如果你不知道从你的顶层目录到最基本文件的复杂结构,它很简单,很方便。 + + +### 9. Flymake ### + +![](https://c2.staticflickr.com/6/5708/23310442354_cbba657ed3.jpg) + +IDE的爱好者,我认为语法检查器是IDE最强大的特性之一。它非常适合初学者和方便码累了的程序员。感谢Flymake,Emacs用户也可以享受语法检查器 。因为我工作很多需要PHP,Flymake不需要任何额外的配置。当我写代码的时候,它会自动检查我的代码和高亮任何一个包含一个问题的行。对于编译语言,Flymake将寻找一个Makefile,它将用来检查代码。绝对不可思议。 + + + +### 10. electric-pair ### + +  最后,但并非最不重要,在我看来,electric-pair是最简单但最强大的插件之一。它就自动关闭括号或打开括号。它期初看起来不是很好,但相信我。第一百次挣扎后发现匹配的括号,你会很高兴有一个插件,确保你所有的表达式都是平衡的。   +   + + +总结一下,Emacs是一个奇妙的工具。这可不是一个令人惊哑的说法。试试这些插件和看着你的效率直线飙升。这当然不是详尽的列表。如果你想带来你的贡献,请在评论中这样做。我自己一直在寻找新的插件来体验Emacs,也在找寻新方法来体验Emacs。 + + + + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/best-plugins-to-increase-productivity-on-emacs.html + +作者:[Adrien Brochard][a] +译者:[zky001](https://github.com/zky001) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/adrien +[1]:http://xmodulo.com/turn-vim-full-fledged-ide.html +[2]:http://orgmode.org/worg/org-tutorials/ +[3]:http://tuhdo.github.io/helm-intro.html From c40db506402c3121e391168a34413343e8bce589 Mon Sep 17 00:00:00 2001 From: Markgolzh <1134386961@qq.com> Date: Fri, 1 Jan 2016 13:07:49 +0800 Subject: [PATCH 0120/1469] Update 20151225 What are the best plugins to increase productivity on Emacs.md --- ...at are the best plugins to increase productivity on Emacs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20151225 What are the best plugins to increase productivity on Emacs.md b/translated/tech/20151225 What are the best plugins to increase productivity on Emacs.md index 789ba72198..66d9b657c0 100644 --- a/translated/tech/20151225 What are the best plugins to increase productivity on Emacs.md +++ b/translated/tech/20151225 What are the best plugins to increase productivity on Emacs.md @@ -1,4 +1,4 @@ -zky001翻译中 +zky001翻译完毕 提高emacs(生产力)效率的最好插件是什么 ================================================================================ 一年前的这个时候, 我想要寻找一个最好的插件 [将VIM打造成一个成熟的全功能的IDE][1]. 有趣的是, 很多评论那篇文章的是关于Emacs是怎么样(如何)已经集成大部分这些插件,已经是一个伟大的IDE了. 尽管我对Emacs的难以置信的多样化表示赞成, 它依旧不是可以开箱即用(安装好不安插件即可用)的高级编辑器. 还好, 其庞大的插件库可以解决这个问题. 但在过多的选项中, 有时很难清楚该如何入手. 因此现在, 让我试着收集一个虽然简短但是不可或缺的插件列表来让你使用Emacs时提高工作效率. 虽然我主要侧重于与编程相关的生产力,但是这些插件将对任何人或对任何使用方法都是有用的. From 74736f3411d34e03e531f81f8c1e2d93c6ddd221 Mon Sep 17 00:00:00 2001 From: Markgolzh <1134386961@qq.com> Date: Fri, 1 Jan 2016 20:15:17 +0800 Subject: [PATCH 0121/1469] =?UTF-8?q?zky001=E6=AD=A3=E5=9C=A8=E7=BF=BB?= =?UTF-8?q?=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...sktop Fun--Text Mode ASCII-art Box and Comment Drawing.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sources/tech/20151215 Linux or Unix Desktop Fun--Text Mode ASCII-art Box and Comment Drawing.md b/sources/tech/20151215 Linux or Unix Desktop Fun--Text Mode ASCII-art Box and Comment Drawing.md index db254d3858..268c6c9477 100644 --- a/sources/tech/20151215 Linux or Unix Desktop Fun--Text Mode ASCII-art Box and Comment Drawing.md +++ b/sources/tech/20151215 Linux or Unix Desktop Fun--Text Mode ASCII-art Box and Comment Drawing.md @@ -1,3 +1,4 @@ +翻译中 Linux / Unix Desktop Fun: Text Mode ASCII-art Box and Comment Drawing ================================================================================ Boxes command is a text filter and a little known tool that can draw any kind of ASCII art box around its input text or code for fun and profit. You can quickly create email signatures, or create regional comments in any programming language. This command was intended to be used with the vim text editor, but can be tied to any text editor which supports filters, as well as from the command line as a standalone tool. @@ -190,7 +191,7 @@ See also via: http://www.cyberciti.biz/tips/unix-linux-draw-any-kind-of-boxes-around-text-editor.html 作者:Vivek Gite -译者:[译者ID](https://github.com/译者ID) +译者:[zky001](https://github.com/zky001) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -198,4 +199,4 @@ via: http://www.cyberciti.biz/tips/unix-linux-draw-any-kind-of-boxes-around-text [1]:http://www.cyberciti.biz/tips/linux-debian-package-management-cheat-sheet.html [2]:http://www.cyberciti.biz/faq/rhel-centos-fedora-linux-yum-command-howto/ [3]:http://www.cyberciti.biz/faq/fedora-sl-centos-redhat6-enable-epel-repo/ -[4]:http://www.cyberciti.biz/faq/vim-inserting-current-date-time-under-linux-unix-osx/ \ No newline at end of file +[4]:http://www.cyberciti.biz/faq/vim-inserting-current-date-time-under-linux-unix-osx/ From daba25f97fc3cda441d91bef3f538782a61c7964 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Sat, 2 Jan 2016 15:27:10 +0800 Subject: [PATCH 0122/1469] Translating sources/tech/20151123 How to Install Cockpit in Fedora or CentOS or RHEL or Arch Linux.md --- ... Install Cockpit in Fedora or CentOS or RHEL or Arch Linux.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20151123 How to Install Cockpit in Fedora or CentOS or RHEL or Arch Linux.md b/sources/tech/20151123 How to Install Cockpit in Fedora or CentOS or RHEL or Arch Linux.md index 3f2f392efb..98275ace42 100644 --- a/sources/tech/20151123 How to Install Cockpit in Fedora or CentOS or RHEL or Arch Linux.md +++ b/sources/tech/20151123 How to Install Cockpit in Fedora or CentOS or RHEL or Arch Linux.md @@ -1,3 +1,4 @@ +ictlyh Translating How to Install Cockpit in Fedora / CentOS / RHEL/ Arch Linux ================================================================================ Cockpit is a free and open source server management software that makes us easy to administer our GNU/Linux servers via its beautiful web interface frontend. Cockpit helps make linux system administrator, system maintainers and DevOps easy to manage their server and to perform simple tasks, such as administering storage, inspecting journals, starting and stopping services and more. Its journal interface adds aroma in flower making people easy to switch between the terminal and web interface. And moreover, it makes easy to manage not only one server but several multiple networked servers from a single place at the same time with just a single click. It is very light weight and has easy to use web based interface. In this tutorial, we'll learn how we can setup Cockpit and use it to manage our server running Fedora, CentOS, Arch Linux and RHEL distributions as their operating system software. Some of the awesome benefits of Cockpit in our GNU/Linux servers are as follows: From 0038b65f13a97737e0f89c7de6db123cc16ea424 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Sat, 2 Jan 2016 16:40:35 +0800 Subject: [PATCH 0123/1469] Translated tech/20151123 How to Install Cockpit in Fedora or CentOS or RHEL or Arch Linux.md --- ... Fedora or CentOS or RHEL or Arch Linux.md | 149 ------------------ ... Fedora or CentOS or RHEL or Arch Linux.md | 148 +++++++++++++++++ 2 files changed, 148 insertions(+), 149 deletions(-) delete mode 100644 sources/tech/20151123 How to Install Cockpit in Fedora or CentOS or RHEL or Arch Linux.md create mode 100644 translated/tech/20151123 How to Install Cockpit in Fedora or CentOS or RHEL or Arch Linux.md diff --git a/sources/tech/20151123 How to Install Cockpit in Fedora or CentOS or RHEL or Arch Linux.md b/sources/tech/20151123 How to Install Cockpit in Fedora or CentOS or RHEL or Arch Linux.md deleted file mode 100644 index 98275ace42..0000000000 --- a/sources/tech/20151123 How to Install Cockpit in Fedora or CentOS or RHEL or Arch Linux.md +++ /dev/null @@ -1,149 +0,0 @@ -ictlyh Translating -How to Install Cockpit in Fedora / CentOS / RHEL/ Arch Linux -================================================================================ -Cockpit is a free and open source server management software that makes us easy to administer our GNU/Linux servers via its beautiful web interface frontend. Cockpit helps make linux system administrator, system maintainers and DevOps easy to manage their server and to perform simple tasks, such as administering storage, inspecting journals, starting and stopping services and more. Its journal interface adds aroma in flower making people easy to switch between the terminal and web interface. And moreover, it makes easy to manage not only one server but several multiple networked servers from a single place at the same time with just a single click. It is very light weight and has easy to use web based interface. In this tutorial, we'll learn how we can setup Cockpit and use it to manage our server running Fedora, CentOS, Arch Linux and RHEL distributions as their operating system software. Some of the awesome benefits of Cockpit in our GNU/Linux servers are as follows: - -1. It consist of systemd service manager for ease. -1. It has a Journal log viewer to perform troubleshoots and log analysis. -1. Storage setup including LVM was never easier before. -1. Basic Network configuration can be applied with Cockpit -1. We can easily add and remove local users and manage multiple servers. - -### 1. Installing Cockpit ### - -First of all, we'll need to setup Cockpit in our linux based server. In most of the distributions, the cockpit package is already available in their official repositories. Here, in this tutorial, we'll setup Cockpit in Fedora 22, CentOS 7, Arch Linux and RHEL 7 from their official repositories. - -#### On CentOS / RHEL #### - -Cockpit is available in the official repository of CenOS and RHEL. So, we'll simply install it using yum manager. To do so, we'll simply run the following command under sudo/root access. - - # yum install cockpit - -![Install Cockpit Centos](http://blog.linoxide.com/wp-content/uploads/2015/10/install-cockpit-centos.png) - -#### On Fedora 22/21 #### - -Alike, CentOS, it is also available by default in Fedora's official repository, we'll simply install cockpit using dnf package manager. - - # dnf install cockpit - -![Install Cockpit Fedora](http://blog.linoxide.com/wp-content/uploads/2015/10/install-cockpit-fedora.png) - -#### On Arch Linux #### - -Cockpit is currently not available in the official repository of Arch Linux but it is available in the Arch User Repository also know as AUR. So, we'll simply run the following yaourt command to install it. - - # yaourt cockpit - -![Install Cockpit Archlinux](http://blog.linoxide.com/wp-content/uploads/2015/10/install-cockpit-archlinux.png) - -### 2. Starting and Enabling Cockpit ### - -After we have successfully installed it, we'll gonna start the cockpit server with our service/daemon manager. As of 2015, most of the linux distributions have adopted Systemd whereas some of the linux distributions still run SysVinit to manage daemon, but Cockpit uses systemd for almost everything from running daemons to services. So, we can only setup Cockpit in the latest releases of linux distributions running Systemd. In order to start Cockpit and make it start in every boot of the system, we'll need to run the following command in a terminal or a console. - - # systemctl start cockpit - - # systemctl enable cockpit.socket - - Created symlink from /etc/systemd/system/sockets.target.wants/cockpit.socket to /usr/lib/systemd/system/cockpit.socket. - -### 3. Allowing Firewall ### - -After we have started our cockpit server and enable it to start in every boot, we'll now go for configuring firewall. As we have firewall programs running in our server, we'll need to allow ports in order to make cockpit accessible outside of the server. - -#### On Firewalld #### - - # firewall-cmd --add-service=cockpit --permanent - - success - - # firewall-cmd --reload - - success - -![Cockpit Allowing Firewalld](http://blog.linoxide.com/wp-content/uploads/2015/10/cockpit-allowing-firewalld.png) - -#### On Iptables #### - - # iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT - - # service iptables save - -### 4. Accessing Cockpit Web Interface ### - -Next, we'll gonna finally access the Cockpit web interface using a web browser. We'll simply need to point our web browser to https://ip-address:9090 or https://server.domain.com:9090 according to the configuration. Here, in our tutorial, we'll gonna point our browser to https://128.199.114.17:9090 as shown in the image below. - -![Cockpit Webserver SSL Proceed](http://blog.linoxide.com/wp-content/uploads/2015/10/cockpit-webserver-ssl-proceed.png) - -We'll be displayed an SSL certification warning as we are using a self-signed SSL certificate. So, we'll simply ignore it and go forward towards the login page, in chrome/chromium, we'll need to click on Show Advanced and then we'll need to click on **Proceed to 128.199.114.17 (unsafe)** . - -![Cockpit Login Screen](http://blog.linoxide.com/wp-content/uploads/2015/10/cockpit-login-screen.png) - -Now, we'll be asked to enter the login details in order to enter into the dashboard. Here, the username and password is the same as that of the login details we use to login to our linux server. After we enter the login details and click on Log In button, we will be welcomed into the Cockpit Dashboard. - -![Cockpit Dashboard](http://blog.linoxide.com/wp-content/uploads/2015/10/cockpit-dashboard.png) - -Here, we'll see all the menu and visualization of CPU, Disk, Network, Storage usages of the server. We'll see the dashboard as shown above. - -#### Services #### - -To manage services, we'll need to click on Services button on the menu situated in the right side of the web page. Then, we'll see the services under 5 categories, Targets, System Services, Sockets, Timers and Paths. - -![Cockpit Services](http://blog.linoxide.com/wp-content/uploads/2015/10/cockpit-services.png) - -#### Docker Containers #### - -We can even manage docker containers with Cockpit. It is pretty easy to monitor and administer Docker containers with Cockpit. As docker isn't installed and running in our server, we'll need to click on Start Docker. - -![Cockpit Container](http://blog.linoxide.com/wp-content/uploads/2015/10/cockpit-container.png) - -Cockpit will automatically install and run docker in our server. After its running, we see the following screen. Then, we can manage the docker images, containers as per our requirement. - -![Cockpit Containers Mangement](http://blog.linoxide.com/wp-content/uploads/2015/10/cockpit-containers-mangement.png) - -#### Journal Log Viewer #### - -Cockpit has a managed log viewer which separates the Errors, Warnings, Notices into different tabs. And we also have a tab All where we can see them all in a single place. - -![Cockpit Journal Logs](http://blog.linoxide.com/wp-content/uploads/2015/10/cockpit-journal-logs.png) - -#### Networking #### - -Under the networking section, we see two graphs in which there is the visualization of Sending and Receiving speed. And we can see there the list of available interfaces with option to Add Bond, Bridge, VLAN. If we need to configure an interface, we can do so by simply clicking on the interface name. Below everything, we can see the Journal Log Viewer for Networking. - -![Cockpit Network](http://blog.linoxide.com/wp-content/uploads/2015/10/cockpit-network.png) - -#### Storage #### - -Now, its easy with Cockpit to see the R/W speed of our hard disk. We can see the Journal log of the Storage in order to perform troubleshoot and fixes. A clear visualization bar of how much space is occupied is shown in the page. We can even Unmount, Format, Delete a partition of a Hard Disk and more. Features like creating RAID Device, Volume Group is also available in it. - -![Cockpit Storage](http://blog.linoxide.com/wp-content/uploads/2015/10/cockpit-storage.png) - -#### Account Management #### - -We can easily create new accounts with Cockpit Web Interface. The accounts created in it is applied to the system's user account. We can change password, specify roles, delete, rename user accounts with it. - -![Cockpit Accounts](http://blog.linoxide.com/wp-content/uploads/2015/10/cockpit-accounts.png) - -#### Live Terminal #### - -This is an awesome feature built-in with Cockpit. Yes, we can execute commands, do stuffs with the live terminal provided by Cockpit interface. This makes us really easy to switch between the web interface and terminal according to our need. - -![Cockpit Terminal](http://blog.linoxide.com/wp-content/uploads/2015/10/cockpit-terminal.png) - -### Conclusion ### - -Cockpit is a good free and open source software developed by [Red Hat][1] for making the server management easy and simple. It is best for performing simple system administration tasks and is good for the new system administrators. It is still under pre-release as its stable release hasn't been released yet. So, it is not suitable for production. It is currently developed on the latest release of Fedora, CentOS, Arch Linux, RHEL where systemd is installed by default. If you are willing to install Cockpit in Ubuntu, you can get the PPA access but is currently outdated. 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 ! - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/install-cockpit-fedora-centos-rhel-arch-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://www.redhat.com/ \ No newline at end of file diff --git a/translated/tech/20151123 How to Install Cockpit in Fedora or CentOS or RHEL or Arch Linux.md b/translated/tech/20151123 How to Install Cockpit in Fedora or CentOS or RHEL or Arch Linux.md new file mode 100644 index 0000000000..38a89dcbc2 --- /dev/null +++ b/translated/tech/20151123 How to Install Cockpit in Fedora or CentOS or RHEL or Arch Linux.md @@ -0,0 +1,148 @@ +如何在 Fedora/CentOS/RHEL 或 Arch Linux 上安装 Cockpit +================================================================================ +Cockpit 是一个免费开源的服务器管理软件,它使得我们可以通过它好看的 web 前端界面轻松地管理我们的 GNU/Linux 服务器。Cockpit 使得 linux 系统管理员、系统维护员和开发者能轻松地管理他们的服务器并执行一些简单的任务,例如管理存储、检测日志、启动或停止服务以及一些其它任务。它的报告界面添加了一些很好的功能使得可以轻松地在终端和 web 界面之间切换。另外,它不仅使得管理一台服务器变得简单,更重要的是只需要一个单击就可以在一个地方同时管理多个通过网络连接的服务器。它非常轻量级,web 界面也非常简单易用。在这篇博文中,我们会学习如何安装 Cockpit 并用它管理我们的运行着 Fedora、CentOS、Arch Linux 以及 RHEL 发行版操作系统的服务器。下面是 Cockpit 在我们的 GNU/Linux 服务器中一些非常棒的功能: + +1. 它包含 systemd 服务管理器。 +2. 有一个用于故障排除和日志分析的 Journal 日志查看器。 +3. 包括 LVM 在内的存储配置比以前任何时候都要简单。 +4. 用 Cockpit 可以进行基本的网络配置。 +5. 可以轻松地添加和删除用户以及管理多台服务器。 + +### 1. 安装 Cockpit ### + +首先,我们需要在我们基于 linux 的服务器上安装 Cockpit。大部分发行版的官方软件仓库中都有可用的 cockpit 安装包。这篇博文中,我们会在 Fedora 22、CentOS 7、Arch Linux 和 RHEL 7 中通过它们的官方软件仓库安装 Cockpit。 + +#### CentOS / RHEL #### + +CentOS 和 RHEL 官方软件库中有可用的 Cockpit。我们只需要用 yum 管理器就可以安装。只需要以 sudo/root 权限运行下面的命令就可以安装它。 + + # yum install cockpit + +![Centos 上安装 Cockpit](http://blog.linoxide.com/wp-content/uploads/2015/10/install-cockpit-centos.png) + +#### Fedora 22/21 #### + +和 CentOS 一样, Fedora 的官方软件库默认也有可用的 Cockpit。我们只需要用 dnf 软件包管理器就可以安装 Cockpit。 + + # dnf install cockpit + +![Fedora 上安装 Cockpit](http://blog.linoxide.com/wp-content/uploads/2015/10/install-cockpit-fedora.png) + +#### Arch Linux #### + +现在 Arch Linux 官方软件库中还没有可用的 Cockpit,但 Arch 用户库(Arch User Repository,AUR)有。只需要运行下面的 yaourt 命令就可以安装。 + + # yaourt cockpit + +![Arch linux 上安装 Cockpit](http://blog.linoxide.com/wp-content/uploads/2015/10/install-cockpit-archlinux.png) + +### 2. 启动并启用 Cockpit ### + +成功安装完 Cockpit,我们就要用服务/守护进程管理器启动 Cockpit 服务。到了 2015 年,尽管一些 linux 发行版仍然运行 SysVinit 管理守护进程,但大部分 linux 发行版都采用了 Systemd,Cockpit 使用 systemd 完成从运行守护进程到服务几乎所有的功能。因此,我们只能在运行着 Systemd 的最新的 linux 发行版中安装 Cockpit。要启动 Cockpit 并让它在每次系统重启时自动启动,我们需要在终端或控制台中运行下面的命令。 + # systemctl start cockpit + + # systemctl enable cockpit.socket + + 创建从 /etc/systemd/system/sockets.target.wants/cockpit.socket 到 /usr/lib/systemd/system/cockpit.socket 的符号链接。 + +### 3. 允许通过防火墙 ### + +启动 Cockpit 并使得它能在每次系统重启时自动启动后,我们现在要给它配置防火墙。由于我们的服务器上运行着防火墙程序,我们需要允许它通过某些端口使得从服务器外面可以访问 Cockpit。 + +#### Firewalld #### + + # firewall-cmd --add-service=cockpit --permanent + + success + + # firewall-cmd --reload + + success + +![允许 Cockpit 通过 Firewalld](http://blog.linoxide.com/wp-content/uploads/2015/10/cockpit-allowing-firewalld.png) + +#### Iptables #### + + # iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT + + # service iptables save + +### 4. 访问 Cockpit Web 界面 ### + +下面,我们终于要通过 web 浏览器访问 Cockpit web 界面了。根据配置,我们只需要用浏览器打开 https://ip-address:9090 或 https://server.domain.com:9090。在我们这篇博文中,我们用浏览器打开 https://128.199.114.17:9090,正如下图所示。 + +![通过 SSL 访问 Cockpit Web 服务](http://blog.linoxide.com/wp-content/uploads/2015/10/cockpit-webserver-ssl-proceed.png) + +此时会出现一个 SSL 认证警告,因为我们正在使用一个自签名认证。我们只需要忽略这个警告并进入到登录页面,在 chrome/chromium 中,我们需要点击 Show Advanced 然后点击 **Proceed to 128.199.114.17 (unsafe)**。 + +![Cockpit 登录界面](http://blog.linoxide.com/wp-content/uploads/2015/10/cockpit-login-screen.png) + +现在,要进入仪表盘,我们需要输入详细的登录信息。这里,用户名和密码和用于登录我们的 linux 服务器的用户名和密码相同。当我们输入登录信息并点击 Log In 按钮后,我们就会进入到 Cockpit 仪表盘。 + +![Cockpit 仪表盘](http://blog.linoxide.com/wp-content/uploads/2015/10/cockpit-dashboard.png) + +这里我们可以看到所有的菜单以及 CPU、磁盘、网络、存储使用情况的可视化结果。仪表盘正如上图所示。 + +#### 服务 #### + +要管理服务,我们需要点击 web 页面右边菜单中的 Services 按钮。然后,我们会看到服务被分成了 5 个类别,目标、系统服务、套接字、计时器和路径。 + +![Cockpit 服务](http://blog.linoxide.com/wp-content/uploads/2015/10/cockpit-services.png) + +#### Docker 容器 #### + +我们甚至可以用 Cockpit 管理 docker 容器。用 Cockpit 监控和管理 Docker 容器非常简单。由于我们的服务器中没有安装运行 docker,我们需要点击 Start Docker。 + + +![Cockpit 容器](http://blog.linoxide.com/wp-content/uploads/2015/10/cockpit-container.png) + +Cockpit 会自动在我们的服务器上安装和运行 docker。启动之后,我们就会看到下面的截图。然后我们就可以按照需求管理 docker 镜像、容器。 + +![Cockpit 容器管理](http://blog.linoxide.com/wp-content/uploads/2015/10/cockpit-containers-mangement.png) + +#### Journal 日志查看器 #### + +Cockpit 有个日志查看器,它把错误、警告、注意分到不同的标签页。我们也有一个 All 标签页,在这里可以看到所有的日志信息。 + +![Cockpit Journal 日志](http://blog.linoxide.com/wp-content/uploads/2015/10/cockpit-journal-logs.png) + +#### 网络 #### + +在网络部分,我们可以看到两个可视化发送和接收速度的图。我们可以看到这里有一个可用网卡的列表,还有 Add Bond、Bridge、VLAN 的选项。如果我们需要配置一个网卡,我们只需要点击网卡名称。在下面,我们可以看到网络的 Journal 日志信息。 + +![Cockpit Network](http://blog.linoxide.com/wp-content/uploads/2015/10/cockpit-network.png) + +#### 存储 #### + +现在,用 Cockpit 可以方便地查看硬盘的读写速度。我们可以查看存储的 Journal 日志以便进行故障排除和修复。在页面中还有一个已用空间的可视化图。我们甚至可以卸载、格式化、删除一块硬盘的某个分区。它还有类似创建 RAID 设备、卷组等攻能。 + +![Cockpit Storage](http://blog.linoxide.com/wp-content/uploads/2015/10/cockpit-storage.png) + +#### 用户管理 #### + +通过 Cockpit Web 界面我们可以方便地创建新用户。在这里创建的账户会应用到系统用户账户。我们可以用它更改密码、指定角色、以及删除用户账户。 + +![Cockpit Accounts](http://blog.linoxide.com/wp-content/uploads/2015/10/cockpit-accounts.png) + +#### 实时终端 #### + +Cockpit 还有一个很棒的特性。是的,我们可以执行命令,用 Cockpit 界面提供的实时终端执行任务。这使得我们可以根据我们的需求在 web 界面和终端之间自由切换。 + +![Cockpit 终端](http://blog.linoxide.com/wp-content/uploads/2015/10/cockpit-terminal.png) + +### 总结 ### + +Cockpit 是由 [Red Hat][1] 开发的使得管理服务器变得轻松简单的免费开源软件。它非常适合于进行简单的系统管理任务和新手系统管理员。它仍然处于开发阶段,还没有稳定版发行。因此不适合于生产环境。它是针对最新的默认安装了 systemd 的 Fedora、CentOS、Arch Linux、RHEL 系统开发的。如果你想在 Ubuntu 上安装 Cockpit,你可以通过 PPA 访问,但现在已经过期了。如果你有任何疑问、建议,请在下面的评论框中反馈给我们,这样我们可以改进和更新我们的内容。非常感谢 ! + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/install-cockpit-fedora-centos-rhel-arch-linux/ + +作者:[Arun Pyasi][a] +译者:[ictlyh](http://mutouxiaogui.cn/blog/) +校对:[校对者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/ \ No newline at end of file From 2aec773fc3e9ef5da40e09d479a6802941d998c8 Mon Sep 17 00:00:00 2001 From: Markgolzh <1134386961@qq.com> Date: Sat, 2 Jan 2016 16:54:20 +0800 Subject: [PATCH 0124/1469] =?UTF-8?q?zky001=E6=AD=A3=E5=9C=A8=E7=BF=BB?= =?UTF-8?q?=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...15 How to Install Light Table 0.8 in Ubuntu 14.04, 15.10.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20151215 How to Install Light Table 0.8 in Ubuntu 14.04, 15.10.md b/sources/tech/20151215 How to Install Light Table 0.8 in Ubuntu 14.04, 15.10.md index 5424c7cd68..fd26cb0104 100644 --- a/sources/tech/20151215 How to Install Light Table 0.8 in Ubuntu 14.04, 15.10.md +++ b/sources/tech/20151215 How to Install Light Table 0.8 in Ubuntu 14.04, 15.10.md @@ -1,3 +1,4 @@ +翻译中 How to Install Light Table 0.8 in Ubuntu 14.04, 15.10 ================================================================================ ![](http://ubuntuhandbook.org/wp-content/uploads/2014/11/LightTable-IDE-logo-icon.png) @@ -101,4 +102,4 @@ via: http://ubuntuhandbook.org/index.php/2015/12/install-light-table-0-8-ubuntu- [a]:http://ubuntuhandbook.org/index.php/about/ [1]:https://github.com/LightTable/LightTable/releases -[2]:https://github.com/LightTable/LightTable/releases/download/0.8.0/lighttable-0.8.0-linux.tar.gz \ No newline at end of file +[2]:https://github.com/LightTable/LightTable/releases/download/0.8.0/lighttable-0.8.0-linux.tar.gz From 73e91522cbe60dcbffdd4ee685e307f96753215c Mon Sep 17 00:00:00 2001 From: "Fuliang.Li" Date: Sat, 2 Jan 2016 23:50:24 +0800 Subject: [PATCH 0125/1469] =?UTF-8?q?[=E5=AE=8C=E6=88=90=E7=BF=BB=E8=AF=91?= =?UTF-8?q?]=20Part=205=20-=20LFCS--How=20to=20Mount=20or=20Unmount=20Loca?= =?UTF-8?q?l=20and=20Network=20Samba=20and=20NFS=20Filesystems=20in=20Linu?= =?UTF-8?q?x?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【完成翻译】 LFCS 系列第五讲:如何在 Linux 中挂载/卸载本地文件系统和网络文件系统(Samba 和 NFS) --- ...work Samba and NFS Filesystems in Linux.md | 246 ++++++++++++++++++ 1 file changed, 246 insertions(+) create mode 100644 translated/tech/LFCS/Part 5 - LFCS--How to Mount or Unmount Local and Network Samba and NFS Filesystems in Linux.md diff --git a/translated/tech/LFCS/Part 5 - LFCS--How to Mount or Unmount Local and Network Samba and NFS Filesystems in Linux.md b/translated/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..1551f4de0c --- /dev/null +++ b/translated/tech/LFCS/Part 5 - LFCS--How to Mount or Unmount Local and Network Samba and NFS Filesystems in Linux.md @@ -0,0 +1,246 @@ +GHLandy Translated + +LFCS 系列第五讲:如何在 Linux 中挂载/卸载本地文件系统和网络文件系统(Samba 和 NFS) + +================================================================================ + +Linux 基金会已经发起了一个全新的 LFCS(Linux Foundation Certified Sysadmin,Linux 基金会认证系统管理员)认证,旨在让来自世界各地的人有机会参加到 LFCS 测试,获得关于有能力在 Linux 系统中执行中间系统管理任务的认证。该认证包括:维护正在运行的系统和服务的能力、全面监控和分析的能力以及何时上游团队请求支持的决策能力。 + +![Linux Foundation Certified Sysadmin – Part 5](http://www.tecmint.com/wp-content/uploads/2014/10/lfcs-Part-5.png) + +LFCS 系列第五讲 + +请看以下视频,这里边介绍了 Linux 基金会认证程序。 + +注:youtube 视频 + + +本讲是《十套教程》系列中的第三讲,在这一讲里边,我们会解释如何在 Linux 中挂载/卸载本地和网络文件系统。这些都是 LFCS 认证中的必备知识。 + + +### 挂载文件系统 ### + +在个硬盘分好区之后,Linux 需要通过某些方式对硬盘分区上的数据进行访问。Linux 并不会像 DOS 或者 Windows 那样给每个硬盘分区分配一个字母来作为盘符,而是将硬盘分区挂载到统一的目录树上的挂载点。 + +挂载点是一个目录,挂载是一种访问分区上文件系统的方法,挂载文件系统实际上是将一个确切的文件系统(比如一个分区)和目录树中指定的目录联系起来的过程。 + +换句话说,管理存储设备的第一步就是把设备关联到文件系统树。要完成这一步,通常可以这样:用 mount 命令来进行临时挂载(用完的时候,使用 umount 命令来卸载),或者通过编辑 /etc/fstab 文件之后重启系统来永久性挂载,这样每次开机都会进行挂载。 + + +不带任何选项的 mount 命令,可以显示当前已挂载的文件系统。 + + # mount + +![Check Mounted Filesystem in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/check-mounted-filesystems.png) + +检查已挂载的文件系统 + +另外,mount 命令通常用来挂载文件系统。其基本语法如下: + + # mount -t type device dir -o options + +该命令会指引内核在设备上找到的文件系统(如已格式化为指定类型的文件系统)挂载到指定目录。像这样的形式,mount 命令不会再到 /etc/fstab 文件中进行确认。 + +除非像下面,挂载指定的目录或者设备: + + # mount /dir -o options + 或 + # mount device -o options + +mount 命令会尝试寻找挂载点,如果找不到就会查找设备(上述两种情况下,mount 命令会在 /etc/fstab 查找相应的设备或挂载点),最后尝试完成挂载操作(这个通常可以成功执行,除非你的挂载点或者设备正在使用中,或者你调用 mount 命令的时候没有 root 权限)。 + +你可以看到,mount 命令的每行输出都是如下格式: + + device on directory type (options) + +例如: + + /dev/mapper/debian-home on /home type ext4 (rw,relatime,user_xattr,barrier=1,data=ordered) + +读作: + +设备 dev/mapper/debian-home 的格式为 ext4,挂载在 /home 下,并且有以下挂载选项: rw,relatime,user_xattr,barrier=1,data=ordered。 + +**mount 命令选项** + +下面列出 mount 命令的常用选项 + + +- async:运许在将要挂载的文件系统上进行异步 I/O 操作 +- auto:标志文件系统通过 mount -a 命令挂载,与 noauto 相反。 + +- defaults:该选项为 async,auto,dev,exec,nouser,rw,suid 的一个别名。注意,多个选项必须由逗号隔开并且中间没有空格。倘若你不小心在两个选项中间输入了一个空格,mount 命令会把后边的字符解释为另一个参数。 +- loop:将镜像文件(如 .iso 文件)挂载为 loop 设备。该选项可以用来模拟显示光盘中的文件内容。 +- noexec:阻止该文件系统中可执行文件的执行。与 exec 选项相反。 + +- nouser:阻止任何用户(除 root 用户外) 挂载或卸载文件系统。与 user 选项相反。 +- remount:重新挂载文件系统。 +- ro:只读模式挂载。 +- rw:读写模式挂载。 +- relatime:只要访问时间早于修改时间,就更新文件的的访问时间。 +- user_xattr:允许用户设置和移除可扩展文件系统属性。 + +**以 ro 和 noexec 模式挂载设备** + + # mount -t ext4 /dev/sdg1 /mnt -o ro,noexec + +在本例中,我们可以看到,在挂载点 /mnt 中尝试写入文件或者运行可执行文件都会显示相应的错误信息。 + + # 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 -t ext4 /dev/sdg1 /mnt -o defaults + +![Mount Device in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Mount-Device.png) + +挂载设备 + +在这个例子中,我们发现写入文件和命令都完美执行了。 + +### 卸载设备 ### + +使用 umount 命令卸载设备,意味着将所有的“在使用”数据全部写入到文件系统了,然后可以安全移除文件系统。请注意,倘若你移除一个没有事先正确卸载的文件系统,就会有造成设备损坏和数据丢失的风险。 + +也就是说,你必须设备的盘符或者挂载点中退出,才能卸载设备。换言之,当前工作目录不能是需要卸载设备的挂载点。否则,系统将返回设备繁忙的提示信息。 + +![Unmount Device in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Unmount-Device.png) + +卸载设备 + +离开需卸载设备的挂载点最简单的方法就是,运行不带任何选项的 cd 命令,这样会回到当前用户的家目录。 + + +### 挂载常见的网络文件系统 ### +最常用的两种网络文件系统是 SMB(Server Message Block,服务器消息块)和 NFS(Network File System,网络文件系统)。如果你只向类 Unix 客户端提供共享,用 NFS 就可以了,如果是向 Windows 和其他类 Unix客户端提供共享服务,就需要用到 Samba 了。 + + +扩展阅读 + +- [Setup Samba Server in RHEL/CentOS and Fedora][1] +- [Setting up NFS (Network File System) on RHEL/CentOS/Fedora and Debian/Ubuntu][2] + +下面的例子中,假设 Samba 和 NFS 已经在地址为 192.168.0.10 的服务器上架设好了(请注意,架设 NFS 服务器也是 LFCS 考试中需要考核的能力,我们会在后边中提到)。 + + +#### 在 Linux 中挂载 Samba 共享 #### + +第一步:在 Red Hat 以 Debian 系发行版中安装 samba-client、samba-common 和 cifs-utils 软件包,如下: + + # yum update && yum install samba-client samba-common cifs-utils + # aptitude update && aptitude install samba-client samba-common cifs-utils +然后运行下列命令,查看服务器上可用的 Samba 共享。 + + # smbclient -L 192.168.0.10 + +并输入远程机器上 root 账户的密码。 + +![Mount Samba Share in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Mount-Samba-Share.png) + +挂载 Samba 共享 + +上图中,已经对可以挂载到我们本地系统上的共享进行高亮显示。你只需要与一个远程服务器上的合法用户名及密码就可以访问共享了。 + +第二步:当挂载有密码保护的网络文件系统时候,将你的访问凭证写入到 /etc/fstab 文件中并非明智的选择。你需要将这些信息写入到具有 600 权限的隐藏文件中,像这样: + + # mkdir /media/samba + # echo “username=samba_username” > /media/samba/.smbcredentials + # echo “password=samba_password” >> /media/samba/.smbcredentials + # chmod 600 /media/samba/.smbcredentials + +第三步:然后将下面的内容添加到 /etc/fstab 文件中。 + + # //192.168.0.10/gacanepa /media/samba cifs credentials=/media/samba/.smbcredentials,defaults 0 0 + +第四步:现在可以挂载你的 Samba 共享了。手动挂载(mount //192.168.0.10/gacanepa)或者重启系统并应用 /etc/fstab 中相应行来用就挂载都可以。 + +![Mount Password Protect Samba Share](http://www.tecmint.com/wp-content/uploads/2014/10/Mount-Password-Protect-Samba-Share.png) + +挂载有密码保护的 Samba 共享 + +#### 在 Linux 系统中挂载 NFS 共享 #### + +第一步:在 Red Hat 以 Debian 系发行版中安装 nfs-common 和 portmap 软件包。如下: + + # yum update && yum install nfs-utils nfs-utils-lib + # aptitude update && aptitude install nfs-common + +第二步:为 NFS 共享创建挂载点。 + + # mkdir /media/nfs + +第三步:将下面的内容添加到 /etc/fstab 文件中。 + +192.168.0.10:/NFS-SHARE /media/nfs nfs defaults 0 0 + +第四步:现在可以挂载你的 Samba 共享了。手动挂载(mount 192.168.0.10:/NFS-SHARE)或者重启系统并应用 /etc/fstab 中相应行来用就挂载都可以。 + +![Mount NFS Share in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Mount-NFS-Share.png) + +挂载 NFS 共享 + +### 永久性挂载文件系统 ### + +像前面两个例子那样,/etc/fstab 控制着Linux如何访问硬盘分区及可移动设备。/etc/fstab 由六个字段的内容组成,各个字段之间通过一个空格符或者制表符来分开。井号(#)开始的行只是会被忽略的注释。 + +每一行都按照这个格式来写入: + + + +其中: + +- : 第一个字段指定挂载的设备。大多数发行版本都通过分区的标卷(label)或者 UUID 来指定。这样做可以避免分区号改变是带来的错误。 +- : 第二字段指定挂载点。 +- :文件系统的类型代码与 mount 命令挂载文件系统时使用的类型代码是一样的。通过 auto 类型代码可以让内核自动检测文件系统,这对于可移动设备来说非常方便。注意,该选项可能不是对所有文件系统可用。 +- : 一个(或多个)挂载选项。 +- : 你可能把这个字段设置为 0(否则设置为 1),使得系统启动时禁用 dump 工具(dump 程序曾经是一个常用的备份工具,但现在越来越少用了)对文件系统进行备份。 + +- : 这个字段指定启动系统是是否通过 fsck 来检查文件系统的完整性。0 表示 fsck 不对文件系统进行检查。数字越大,优先级越低。因此,根分区(/)最可能使用数字 1,其他所有需要检查的分区则是以数字 2. + +**Mount 命令例示** + +1. 在系统启动时,通过 TECMINT 标卷来挂载文件系统,并具备 rw 和 noexec 属性,你应该将以下语句添加到 /etc/fstab 文件中。 + + LABEL=TECMINT /mnt ext4 rw,noexec 0 0 + +2. 若你想在系统启动时挂载 DVD 光驱中的内容,添加已下语句。 + + /dev/sr0 /media/cdrom0 iso9660 ro,user,noauto 0 0 + +其中 /dev/sr0 为你的 DVD 光驱。 + +### 总结 ### + +可以放心,在命令行中挂载/卸载本地和网络文件系统将是你作为系统管理员的日常责任的一部分。同时,你需要掌握 /etc/fstab 文件的编写。希望本文对你有帮助。随时在下边发表评论(或者提问),并分享本文到你的朋友圈。 + + +参考链接 + +- [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] +译者:[GHLandy](https://github.com/GHLandy) +校对:[校对者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 From 25b59c59cb88332b2e64f10ba4d17d2d64e5176e Mon Sep 17 00:00:00 2001 From: "Fuliang.Li" Date: Sat, 2 Jan 2016 23:51:43 +0800 Subject: [PATCH 0126/1469] Delete Part 5 - LFCS--How to Mount or Unmount Local and Network Samba and NFS Filesystems in Linux.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 完成翻译,译文放在对应位置 --- ...work Samba and NFS Filesystems in Linux.md | 234 ------------------ 1 file changed, 234 deletions(-) delete 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 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 deleted file mode 100644 index 959095a394..0000000000 --- a/sources/tech/LFCS/Part 5 - LFCS--How to Mount or Unmount Local and Network Samba and NFS Filesystems in Linux.md +++ /dev/null @@ -1,234 +0,0 @@ -GHLandy Translating - -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 From bb0bc00e6da8f42082e9058b6fdc50ba7bcb29df Mon Sep 17 00:00:00 2001 From: "Fuliang.Li" Date: Sun, 3 Jan 2016 00:00:15 +0800 Subject: [PATCH 0127/1469] =?UTF-8?q?[=E5=BC=80=E5=A7=8B=E7=BF=BB=E8=AF=91?= =?UTF-8?q?]=2020151125=2020=20Years=20of=20GIMP=20Evolution--Step=20by=20?= =?UTF-8?q?Step?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【开始翻译】GIMP 过去的 20 年——一点一点的进步 --- .../talk/20151125 20 Years of GIMP Evolution--Step by Step.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/talk/20151125 20 Years of GIMP Evolution--Step by Step.md b/sources/talk/20151125 20 Years of GIMP Evolution--Step by Step.md index edcef22d7f..681a1d6258 100644 --- a/sources/talk/20151125 20 Years of GIMP Evolution--Step by Step.md +++ b/sources/talk/20151125 20 Years of GIMP Evolution--Step by Step.md @@ -1,3 +1,5 @@ +GHLandy Translating + 20 Years of GIMP Evolution: Step by Step ================================================================================ 注:youtube 视频 @@ -168,4 +170,4 @@ via: https://tlhp.cf/20-years-of-gimp-evolution/ [a]:https://tlhp.cf/author/paul/ [1]:https://gimp.org/ -[2]:http://www.gnu.org/ \ No newline at end of file +[2]:http://www.gnu.org/ From 6bd4f7b843ca1a1e4b625aa89a517fbbe8cb4ae9 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 3 Jan 2016 18:39:01 +0800 Subject: [PATCH 0128/1469] =?UTF-8?q?=E5=BD=92=E6=A1=A3=20201512?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ll and Configure Multihomed ISC DHCP Server on Debian Linux.md | 0 .../20150806 Installation Guide for Puppet on Ubuntu 15.04.md | 0 ...0824 How to Setup Zephyr Test Management Tool on CentOS 7.x.md | 0 .../{ => 201512}/20150831 Linux workstation security checklist.md | 0 .../20150917 A Repository with 44 Years of Unix Evolution.md | 0 ...151012 The Brief History Of Aix HP-UX Solaris BSD And LINUX.md | 0 published/{ => 201512}/20151020 how to h2 in apache.md | 0 .../20151022 9 Tips for Improving WordPress Performance.md | 0 .../20151030 How To Install FreeBSD on Raspberry Pi 2 Model B.md | 0 .../20151104 How to Install Redis Server on CentOS 7.md | 0 ...orvalds Lambasts Open Source Programmers over Insecure Code.md | 0 ...Progress of a Linux Command Line Operation Using PV Command.md | 0 .../20151109 How to Set Up AWStats On Ubuntu Server.md | 0 ...51117 Install PostgreSQL 9.4 And phpPgAdmin On Ubuntu 15.10.md | 0 .../20151123 7 ways hackers can use Wi-Fi against you.md | 0 ...151123 How to access Dropbox from the command line in Linux.md | 0 ...3 How to install Android Studio on Ubuntu 15.04 or CentOS 7.md | 0 .../{ => 201512}/20151123 LNAV--Ncurses based log file viewer.md | 0 ...ow to Install GIMP 2.8.16 in Ubuntu 16.04 or 15.10 or 14.04.md | 0 published/{ => 201512}/20151125 The tar command explained.md | 0 .../20151130 eSpeak--Text To Speech Tool For Linux.md | 0 ...51201 How to Install The Latest Arduino IDE 1.6.6 in Ubuntu.md | 0 ...51201 Linux and Unix Port Scanning With netcat [nc] Command.md | 0 ...he Linux ftp command to up- and download files on the shell.md | 0 ...w to Remove Banned IP from Fail2ban on CentOS 6 or CentOS 7.md | 0 .../20151208 Apple Swift Programming Language Comes To Linux.md | 0 ...51208 How to Customize Time and Date Format in Ubuntu Panel.md | 0 .../{ => 201512}/20151208 Install Wetty on Centos or RHEL 6.X.md | 0 ...20151215 How to enable Software Collections (SCL) on CentOS.md | 0 ...1215 Linux or UNIX Desktop Fun--Let it Snow On Your Desktop.md | 0 .../20151215 Linux or UNIX Desktop Fun--Steam Locomotive.md | 0 ...20151215 Linux or UNIX Desktop Fun--Terminal ASCII Aquarium.md | 0 ... Unix Desktop Fun--Cat And Mouse Chase All Over Your Screen.md | 0 .../{ => 201512}/20151229 Watch Star Wars In Linux Terminal.md | 0 34 files changed, 0 insertions(+), 0 deletions(-) rename published/{ => 201512}/20150410 How to Install and Configure Multihomed ISC DHCP Server on Debian Linux.md (100%) rename published/{ => 201512}/20150806 Installation Guide for Puppet on Ubuntu 15.04.md (100%) rename published/{ => 201512}/20150824 How to Setup Zephyr Test Management Tool on CentOS 7.x.md (100%) rename published/{ => 201512}/20150831 Linux workstation security checklist.md (100%) rename published/{ => 201512}/20150917 A Repository with 44 Years of Unix Evolution.md (100%) rename published/{ => 201512}/20151012 The Brief History Of Aix HP-UX Solaris BSD And LINUX.md (100%) rename published/{ => 201512}/20151020 how to h2 in apache.md (100%) rename published/{ => 201512}/20151022 9 Tips for Improving WordPress Performance.md (100%) rename published/{ => 201512}/20151030 How To Install FreeBSD on Raspberry Pi 2 Model B.md (100%) rename published/{ => 201512}/20151104 How to Install Redis Server on CentOS 7.md (100%) rename published/{ => 201512}/20151105 Linus Torvalds Lambasts Open Source Programmers over Insecure Code.md (100%) rename published/{ => 201512}/20151109 How to Monitor the Progress of a Linux Command Line Operation Using PV Command.md (100%) rename published/{ => 201512}/20151109 How to Set Up AWStats On Ubuntu Server.md (100%) rename published/{ => 201512}/20151117 Install PostgreSQL 9.4 And phpPgAdmin On Ubuntu 15.10.md (100%) rename published/{ => 201512}/20151123 7 ways hackers can use Wi-Fi against you.md (100%) rename published/{ => 201512}/20151123 How to access Dropbox from the command line in Linux.md (100%) rename published/{ => 201512}/20151123 How to install Android Studio on Ubuntu 15.04 or CentOS 7.md (100%) rename published/{ => 201512}/20151123 LNAV--Ncurses based log file viewer.md (100%) rename published/{ => 201512}/20151125 How to Install GIMP 2.8.16 in Ubuntu 16.04 or 15.10 or 14.04.md (100%) rename published/{ => 201512}/20151125 The tar command explained.md (100%) rename published/{ => 201512}/20151130 eSpeak--Text To Speech Tool For Linux.md (100%) rename published/{ => 201512}/20151201 How to Install The Latest Arduino IDE 1.6.6 in Ubuntu.md (100%) rename published/{ => 201512}/20151201 Linux and Unix Port Scanning With netcat [nc] Command.md (100%) rename published/{ => 201512}/20151202 How to use the Linux ftp command to up- and download files on the shell.md (100%) rename published/{ => 201512}/20151204 How to Remove Banned IP from Fail2ban on CentOS 6 or CentOS 7.md (100%) rename published/{ => 201512}/20151208 Apple Swift Programming Language Comes To Linux.md (100%) rename published/{ => 201512}/20151208 How to Customize Time and Date Format in Ubuntu Panel.md (100%) rename published/{ => 201512}/20151208 Install Wetty on Centos or RHEL 6.X.md (100%) rename published/{ => 201512}/20151215 How to enable Software Collections (SCL) on CentOS.md (100%) rename published/{ => 201512}/20151215 Linux or UNIX Desktop Fun--Let it Snow On Your Desktop.md (100%) rename published/{ => 201512}/20151215 Linux or UNIX Desktop Fun--Steam Locomotive.md (100%) rename published/{ => 201512}/20151215 Linux or UNIX Desktop Fun--Terminal ASCII Aquarium.md (100%) rename published/{ => 201512}/20151215 Linux or Unix Desktop Fun--Cat And Mouse Chase All Over Your Screen.md (100%) rename published/{ => 201512}/20151229 Watch Star Wars In Linux Terminal.md (100%) diff --git a/published/20150410 How to Install and Configure Multihomed ISC DHCP Server on Debian Linux.md b/published/201512/20150410 How to Install and Configure Multihomed ISC DHCP Server on Debian Linux.md similarity index 100% rename from published/20150410 How to Install and Configure Multihomed ISC DHCP Server on Debian Linux.md rename to published/201512/20150410 How to Install and Configure Multihomed ISC DHCP Server on Debian Linux.md diff --git a/published/20150806 Installation Guide for Puppet on Ubuntu 15.04.md b/published/201512/20150806 Installation Guide for Puppet on Ubuntu 15.04.md similarity index 100% rename from published/20150806 Installation Guide for Puppet on Ubuntu 15.04.md rename to published/201512/20150806 Installation Guide for Puppet on Ubuntu 15.04.md diff --git a/published/20150824 How to Setup Zephyr Test Management Tool on CentOS 7.x.md b/published/201512/20150824 How to Setup Zephyr Test Management Tool on CentOS 7.x.md similarity index 100% rename from published/20150824 How to Setup Zephyr Test Management Tool on CentOS 7.x.md rename to published/201512/20150824 How to Setup Zephyr Test Management Tool on CentOS 7.x.md diff --git a/published/20150831 Linux workstation security checklist.md b/published/201512/20150831 Linux workstation security checklist.md similarity index 100% rename from published/20150831 Linux workstation security checklist.md rename to published/201512/20150831 Linux workstation security checklist.md diff --git a/published/20150917 A Repository with 44 Years of Unix Evolution.md b/published/201512/20150917 A Repository with 44 Years of Unix Evolution.md similarity index 100% rename from published/20150917 A Repository with 44 Years of Unix Evolution.md rename to published/201512/20150917 A Repository with 44 Years of Unix Evolution.md diff --git a/published/20151012 The Brief History Of Aix HP-UX Solaris BSD And LINUX.md b/published/201512/20151012 The Brief History Of Aix HP-UX Solaris BSD And LINUX.md similarity index 100% rename from published/20151012 The Brief History Of Aix HP-UX Solaris BSD And LINUX.md rename to published/201512/20151012 The Brief History Of Aix HP-UX Solaris BSD And LINUX.md diff --git a/published/20151020 how to h2 in apache.md b/published/201512/20151020 how to h2 in apache.md similarity index 100% rename from published/20151020 how to h2 in apache.md rename to published/201512/20151020 how to h2 in apache.md diff --git a/published/20151022 9 Tips for Improving WordPress Performance.md b/published/201512/20151022 9 Tips for Improving WordPress Performance.md similarity index 100% rename from published/20151022 9 Tips for Improving WordPress Performance.md rename to published/201512/20151022 9 Tips for Improving WordPress Performance.md diff --git a/published/20151030 How To Install FreeBSD on Raspberry Pi 2 Model B.md b/published/201512/20151030 How To Install FreeBSD on Raspberry Pi 2 Model B.md similarity index 100% rename from published/20151030 How To Install FreeBSD on Raspberry Pi 2 Model B.md rename to published/201512/20151030 How To Install FreeBSD on Raspberry Pi 2 Model B.md diff --git a/published/20151104 How to Install Redis Server on CentOS 7.md b/published/201512/20151104 How to Install Redis Server on CentOS 7.md similarity index 100% rename from published/20151104 How to Install Redis Server on CentOS 7.md rename to published/201512/20151104 How to Install Redis Server on CentOS 7.md diff --git a/published/20151105 Linus Torvalds Lambasts Open Source Programmers over Insecure Code.md b/published/201512/20151105 Linus Torvalds Lambasts Open Source Programmers over Insecure Code.md similarity index 100% rename from published/20151105 Linus Torvalds Lambasts Open Source Programmers over Insecure Code.md rename to published/201512/20151105 Linus Torvalds Lambasts Open Source Programmers over Insecure Code.md diff --git a/published/20151109 How to Monitor the Progress of a Linux Command Line Operation Using PV Command.md b/published/201512/20151109 How to Monitor the Progress of a Linux Command Line Operation Using PV Command.md similarity index 100% rename from published/20151109 How to Monitor the Progress of a Linux Command Line Operation Using PV Command.md rename to published/201512/20151109 How to Monitor the Progress of a Linux Command Line Operation Using PV Command.md diff --git a/published/20151109 How to Set Up AWStats On Ubuntu Server.md b/published/201512/20151109 How to Set Up AWStats On Ubuntu Server.md similarity index 100% rename from published/20151109 How to Set Up AWStats On Ubuntu Server.md rename to published/201512/20151109 How to Set Up AWStats On Ubuntu Server.md diff --git a/published/20151117 Install PostgreSQL 9.4 And phpPgAdmin On Ubuntu 15.10.md b/published/201512/20151117 Install PostgreSQL 9.4 And phpPgAdmin On Ubuntu 15.10.md similarity index 100% rename from published/20151117 Install PostgreSQL 9.4 And phpPgAdmin On Ubuntu 15.10.md rename to published/201512/20151117 Install PostgreSQL 9.4 And phpPgAdmin On Ubuntu 15.10.md diff --git a/published/20151123 7 ways hackers can use Wi-Fi against you.md b/published/201512/20151123 7 ways hackers can use Wi-Fi against you.md similarity index 100% rename from published/20151123 7 ways hackers can use Wi-Fi against you.md rename to published/201512/20151123 7 ways hackers can use Wi-Fi against you.md diff --git a/published/20151123 How to access Dropbox from the command line in Linux.md b/published/201512/20151123 How to access Dropbox from the command line in Linux.md similarity index 100% rename from published/20151123 How to access Dropbox from the command line in Linux.md rename to published/201512/20151123 How to access Dropbox from the command line in Linux.md diff --git a/published/20151123 How to install Android Studio on Ubuntu 15.04 or CentOS 7.md b/published/201512/20151123 How to install Android Studio on Ubuntu 15.04 or CentOS 7.md similarity index 100% rename from published/20151123 How to install Android Studio on Ubuntu 15.04 or CentOS 7.md rename to published/201512/20151123 How to install Android Studio on Ubuntu 15.04 or CentOS 7.md diff --git a/published/20151123 LNAV--Ncurses based log file viewer.md b/published/201512/20151123 LNAV--Ncurses based log file viewer.md similarity index 100% rename from published/20151123 LNAV--Ncurses based log file viewer.md rename to published/201512/20151123 LNAV--Ncurses based log file viewer.md diff --git a/published/20151125 How to Install GIMP 2.8.16 in Ubuntu 16.04 or 15.10 or 14.04.md b/published/201512/20151125 How to Install GIMP 2.8.16 in Ubuntu 16.04 or 15.10 or 14.04.md similarity index 100% rename from published/20151125 How to Install GIMP 2.8.16 in Ubuntu 16.04 or 15.10 or 14.04.md rename to published/201512/20151125 How to Install GIMP 2.8.16 in Ubuntu 16.04 or 15.10 or 14.04.md diff --git a/published/20151125 The tar command explained.md b/published/201512/20151125 The tar command explained.md similarity index 100% rename from published/20151125 The tar command explained.md rename to published/201512/20151125 The tar command explained.md diff --git a/published/20151130 eSpeak--Text To Speech Tool For Linux.md b/published/201512/20151130 eSpeak--Text To Speech Tool For Linux.md similarity index 100% rename from published/20151130 eSpeak--Text To Speech Tool For Linux.md rename to published/201512/20151130 eSpeak--Text To Speech Tool For Linux.md diff --git a/published/20151201 How to Install The Latest Arduino IDE 1.6.6 in Ubuntu.md b/published/201512/20151201 How to Install The Latest Arduino IDE 1.6.6 in Ubuntu.md similarity index 100% rename from published/20151201 How to Install The Latest Arduino IDE 1.6.6 in Ubuntu.md rename to published/201512/20151201 How to Install The Latest Arduino IDE 1.6.6 in Ubuntu.md diff --git a/published/20151201 Linux and Unix Port Scanning With netcat [nc] Command.md b/published/201512/20151201 Linux and Unix Port Scanning With netcat [nc] Command.md similarity index 100% rename from published/20151201 Linux and Unix Port Scanning With netcat [nc] Command.md rename to published/201512/20151201 Linux and Unix Port Scanning With netcat [nc] Command.md diff --git a/published/20151202 How to use the Linux ftp command to up- and download files on the shell.md b/published/201512/20151202 How to use the Linux ftp command to up- and download files on the shell.md similarity index 100% rename from published/20151202 How to use the Linux ftp command to up- and download files on the shell.md rename to published/201512/20151202 How to use the Linux ftp command to up- and download files on the shell.md diff --git a/published/20151204 How to Remove Banned IP from Fail2ban on CentOS 6 or CentOS 7.md b/published/201512/20151204 How to Remove Banned IP from Fail2ban on CentOS 6 or CentOS 7.md similarity index 100% rename from published/20151204 How to Remove Banned IP from Fail2ban on CentOS 6 or CentOS 7.md rename to published/201512/20151204 How to Remove Banned IP from Fail2ban on CentOS 6 or CentOS 7.md diff --git a/published/20151208 Apple Swift Programming Language Comes To Linux.md b/published/201512/20151208 Apple Swift Programming Language Comes To Linux.md similarity index 100% rename from published/20151208 Apple Swift Programming Language Comes To Linux.md rename to published/201512/20151208 Apple Swift Programming Language Comes To Linux.md diff --git a/published/20151208 How to Customize Time and Date Format in Ubuntu Panel.md b/published/201512/20151208 How to Customize Time and Date Format in Ubuntu Panel.md similarity index 100% rename from published/20151208 How to Customize Time and Date Format in Ubuntu Panel.md rename to published/201512/20151208 How to Customize Time and Date Format in Ubuntu Panel.md diff --git a/published/20151208 Install Wetty on Centos or RHEL 6.X.md b/published/201512/20151208 Install Wetty on Centos or RHEL 6.X.md similarity index 100% rename from published/20151208 Install Wetty on Centos or RHEL 6.X.md rename to published/201512/20151208 Install Wetty on Centos or RHEL 6.X.md diff --git a/published/20151215 How to enable Software Collections (SCL) on CentOS.md b/published/201512/20151215 How to enable Software Collections (SCL) on CentOS.md similarity index 100% rename from published/20151215 How to enable Software Collections (SCL) on CentOS.md rename to published/201512/20151215 How to enable Software Collections (SCL) on CentOS.md diff --git a/published/20151215 Linux or UNIX Desktop Fun--Let it Snow On Your Desktop.md b/published/201512/20151215 Linux or UNIX Desktop Fun--Let it Snow On Your Desktop.md similarity index 100% rename from published/20151215 Linux or UNIX Desktop Fun--Let it Snow On Your Desktop.md rename to published/201512/20151215 Linux or UNIX Desktop Fun--Let it Snow On Your Desktop.md diff --git a/published/20151215 Linux or UNIX Desktop Fun--Steam Locomotive.md b/published/201512/20151215 Linux or UNIX Desktop Fun--Steam Locomotive.md similarity index 100% rename from published/20151215 Linux or UNIX Desktop Fun--Steam Locomotive.md rename to published/201512/20151215 Linux or UNIX Desktop Fun--Steam Locomotive.md diff --git a/published/20151215 Linux or UNIX Desktop Fun--Terminal ASCII Aquarium.md b/published/201512/20151215 Linux or UNIX Desktop Fun--Terminal ASCII Aquarium.md similarity index 100% rename from published/20151215 Linux or UNIX Desktop Fun--Terminal ASCII Aquarium.md rename to published/201512/20151215 Linux or UNIX Desktop Fun--Terminal ASCII Aquarium.md diff --git a/published/20151215 Linux or Unix Desktop Fun--Cat And Mouse Chase All Over Your Screen.md b/published/201512/20151215 Linux or Unix Desktop Fun--Cat And Mouse Chase All Over Your Screen.md similarity index 100% rename from published/20151215 Linux or Unix Desktop Fun--Cat And Mouse Chase All Over Your Screen.md rename to published/201512/20151215 Linux or Unix Desktop Fun--Cat And Mouse Chase All Over Your Screen.md diff --git a/published/20151229 Watch Star Wars In Linux Terminal.md b/published/201512/20151229 Watch Star Wars In Linux Terminal.md similarity index 100% rename from published/20151229 Watch Star Wars In Linux Terminal.md rename to published/201512/20151229 Watch Star Wars In Linux Terminal.md From ae42a060d01c5dedbb5e7cc0e74c5a6dae6660c3 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 3 Jan 2016 18:39:42 +0800 Subject: [PATCH 0129/1469] PUB:20151222 Turn Tor socks to http.md @geekpi --- .../20151222 Turn Tor socks to http.md | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) rename {translated/tech => published}/20151222 Turn Tor socks to http.md (52%) diff --git a/translated/tech/20151222 Turn Tor socks to http.md b/published/20151222 Turn Tor socks to http.md similarity index 52% rename from translated/tech/20151222 Turn Tor socks to http.md rename to published/20151222 Turn Tor socks to http.md index 6f50ba2455..77415b8e82 100644 --- a/translated/tech/20151222 Turn Tor socks to http.md +++ b/published/20151222 Turn Tor socks to http.md @@ -1,16 +1,18 @@ -将Tor socks转换成http +将 Tor socks 转换成 http 代理 ================================================================================ ![](http://1426826955.rsc.cdn77.org/wp-content/uploads/2015/12/tor-593x445.jpg) -使用tor服务你可以使用不同的工具像Tor浏览器、Foxyproxy和其他事情,有些下载管理器像wget和aria2不能直接直接使用tor socks开始匿名下载,因此我们需要一些工具来将tor socks转换成http代理这样就能用它来下载了。 +你可以通过不同的 Tor 工具来使用 Tor 服务,如 Tor 浏览器、Foxyproxy 和其它东西,像 wget 和 aria2 这样的下载管理器不能直接使用 Tor socks 开始匿名下载,因此我们需要一些工具来将 Tor socks 转换成 http 代理,这样就能用它来下载了。 -**注意**:本教程基于Debian下,其他发行版会有些不同,因此如果你的发行版是基于Debian的,就可以直接使用下面的配置了。 +**注意**:本教程基于 Debian ,其他发行版会有些不同,因此如果你的发行版是基于 Debian 的,就可以直接使用下面的配置了。 -**Polipo** : 这个服务会使用8123端口和127.0.0.1的IP,使用下面的命令来在计算机上安装Polipo: +### Polipo + +这个服务会使用 8123 端口和 127.0.0.1 的 IP 地址,使用下面的命令来在计算机上安装 Polipo: sudo apt install polipo -现在使用这个命令打开Polipo的配置文件: +现在使用如下命令打开 Polipo 的配置文件: sudo nano /etc/polipo/config @@ -21,17 +23,19 @@ socksParentProxy = "localhost:9050" socksProxyType = socks5 -用下面的命令来重启Polipo: +用如下的命令来重启 Polipo: sudo service polipo restart -现在Polipo已经安装好了!在匿名的世界里做你想做的吧!下面是使用的例子: +现在 Polipo 已经安装好了!在匿名的世界里做你想做的吧!下面是使用的例子: pdmt -l "link" -i 127.0.01 -p 8123 -用上面的命令PDMT(Persian下载器)会匿名地下载你的文件。 +通过上面的命令 PDMT(Persian 下载器终端)会匿名地下载你的文件。 -**Proxychains** : 在此服务中你可以设置使用tor或者Lantern代理,但是在使用上它和Polipo和Privoxy有点不同,它不需要使用任何端口!使用下面的命令来安装: +### Proxychains + +在此服务中你可以设置使用 Tor 或者 Lantern 代理,但是在使用上它和 Polipo 和 Privoxy 有点不同,它不需要使用任何端口!使用下面的命令来安装: sudo apt install proxychains @@ -39,17 +43,19 @@ sudo nano /etc/proxychains.conf -现在添加下面的代码到文件底部,这里是tor的端口和IP: +现在添加下面的代码到文件底部,这里是 Tor 的端口和 IP: socks5 127.0.0.1 9050 -如果你在命令的前面加上“proxychains”并运行,它就能通过tor代理来运行: +如果你在命令的前面加上“proxychains”并运行,它就能通过 Tor 代理来运行: proxychains firefoxt proxychains aria2c proxychains wget -**Privoxy** : Privoxy使用8118端口,并且首次可以很轻松地通过privoxy包来安装: +### Privoxy + +Privoxy 使用 8118 端口,可以很轻松地通过 privoxy 包来安装: sudo apt install privoxy @@ -71,7 +77,7 @@ sudo service privoxy restart -服务已经好了!端口是8118,IP是127.0.0.1,就尽情使用吧! +服务已经好了!端口是 8118,IP 是 127.0.0.1,就尽情使用吧! -------------------------------------------------------------------------------- @@ -79,7 +85,7 @@ via: http://www.unixmen.com/turn-tor-socks-http/ 作者:[Hossein heydari][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 d659425d0df46b5078542a10b3df70ec12ddb084 Mon Sep 17 00:00:00 2001 From: Markgolzh <1134386961@qq.com> Date: Sun, 3 Jan 2016 20:06:04 +0800 Subject: [PATCH 0130/1469] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E7=BF=BB?= =?UTF-8?q?=E8=AF=91=E7=9A=84=E4=B8=80=E4=BA=9B=E4=B8=8D=E5=A5=BD=E7=9A=84?= =?UTF-8?q?=E5=9C=B0=E6=96=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改了翻译的一些不好的地方 --- ...are the best plugins to increase productivity on Emacs.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/translated/tech/20151225 What are the best plugins to increase productivity on Emacs.md b/translated/tech/20151225 What are the best plugins to increase productivity on Emacs.md index 66d9b657c0..86f163b7ff 100644 --- a/translated/tech/20151225 What are the best plugins to increase productivity on Emacs.md +++ b/translated/tech/20151225 What are the best plugins to increase productivity on Emacs.md @@ -1,7 +1,6 @@ -zky001翻译完毕 -提高emacs(生产力)效率的最好插件是什么 +提高emacs生产力的最好插件是什么 ================================================================================ -一年前的这个时候, 我想要寻找一个最好的插件 [将VIM打造成一个成熟的全功能的IDE][1]. 有趣的是, 很多评论那篇文章的是关于Emacs是怎么样(如何)已经集成大部分这些插件,已经是一个伟大的IDE了. 尽管我对Emacs的难以置信的多样化表示赞成, 它依旧不是可以开箱即用(安装好不安插件即可用)的高级编辑器. 还好, 其庞大的插件库可以解决这个问题. 但在过多的选项中, 有时很难清楚该如何入手. 因此现在, 让我试着收集一个虽然简短但是不可或缺的插件列表来让你使用Emacs时提高工作效率. 虽然我主要侧重于与编程相关的生产力,但是这些插件将对任何人或对任何使用方法都是有用的. +一年前的这个时候, 我想要寻找一个最好的插件 [将VIM打造成一个成熟的全功能的IDE][1]. 有趣的是, 很多评论那篇文章的是关于Emacs集成大部分这些插件,已经是一个伟大的IDE了. 尽管我对Emacs的难以置信的多样化表示赞成, 它依旧不是可以开箱即用(安装好不安插件即可用)的高级编辑器. 还好, 其庞大的插件库可以解决这个问题. 但在过多的选项中, 有时很难清楚该如何入手. 因此现在, 让我试着收集一个虽然简短但是不可或缺的插件列表来让你使用Emacs时提高工作效率. 虽然我主要侧重于与编程相关的生产力,但是这些插件将对任何人或对任何使用方法都是有用的. ### 1. Ido-模式 ### From 9432924f681ee08df446fe97f5f0176cb56fdfa2 Mon Sep 17 00:00:00 2001 From: "Fuliang.Li" Date: Sun, 3 Jan 2016 23:36:02 +0800 Subject: [PATCH 0131/1469] =?UTF-8?q?[=E5=AE=8C=E6=88=90=E7=BF=BB=E8=AF=91?= =?UTF-8?q?]=20Part=208=20-=20LFCS--Managing=20Users=20and=20Groups=20File?= =?UTF-8?q?=20Permissions=20and=20Attributes=20and=20Enabling=20sudo=20Acc?= =?UTF-8?q?ess=20on=20Accounts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【完成翻译】 LFCS 系列第八讲:管理用户和用户组、文件权限和属性以及启用账户 sudo 访问权限 --- ...es and Enabling sudo Access on Accounts.md | 333 ++++++++++++++++++ 1 file changed, 333 insertions(+) create mode 100644 translated/tech/LFCS/Part 8 - LFCS--Managing Users and Groups File Permissions and Attributes and Enabling sudo Access on Accounts.md diff --git a/translated/tech/LFCS/Part 8 - LFCS--Managing Users and Groups File Permissions and Attributes and Enabling sudo Access on Accounts.md b/translated/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..5f511676af --- /dev/null +++ b/translated/tech/LFCS/Part 8 - LFCS--Managing Users and Groups File Permissions and Attributes and Enabling sudo Access on Accounts.md @@ -0,0 +1,333 @@ +GHLandy Translated + +LFCS 系列第八讲:管理用户和用户组、文件权限和属性以及启用账户 sudo 访问权限 + +================================================================================ + +去年八月份,Linux 基金会发起了全新的 LFCS(Linux Foundation Certified Sysadmin,Linux 基金会认证系统管理员)认证,旨在让世界各地的人能够参与到关于 Linux 系统中间层的基本管理操作的认证考试中去,这项认证包括:维护正在运行的系统和服务的能力、全面监控和分析的能力以及何时向上游团队请求支持的决策能力。 + +![Linux Users and Groups Management](http://www.tecmint.com/wp-content/uploads/2014/10/lfcs-Part-8.png) + +LFCS 系列第八讲 + +请看以下视频,里边将描述 LFCS 认证程序。 + +注:youtube视频 + + +本讲是《十套教程》系列的第八讲,在这一讲中,我们将引导你学习如何在 Linux 管理用户和用户组权限的设置,这些内容是 LFCS 认证开始中的必备知识。 + +由于 Linux 是一个多用户的操作系统(允许多个用户通过不同主机或者终端访问一个独立系统),因此你需要知道如何才能有效地管理用户:如何添加、编辑、禁用和删除用户账户,并赋予他们足以完成自身任务的必要权限。 + +### 添加用户账户 ### + +添加新用户账户,你需要以 root 运行一下两条命令中的任意一条: + + # adduser [new_account] + # useradd [new_account] + +当新用户账户添加到系统时,会自动执行以下操作: + +1. 自动创建用户家目录(默认是 /home/username)。 + +2. 自动拷贝下列隐藏文件到新建用户的家目录,用来设置新用户会话的环境变量。 + + .bash_logout + .bash_profile + .bashrc + +3. 自动创建邮件缓存目录 /var/spool/mail/username。 + +4. 自动创建于用户名相同的用户组。 + +**理解 /etc/passwd 中的内容** + +/etc/passwd 文件中存储了所有用户账户的信息,每个用户在里边都有一条对应的记录,其格式(每个字段用冒号隔开)如下: + + [username]:[x]:[UID]:[GID]:[Comment]:[Home directory]:[Default shell] + +- 字段 [username] 和 [Comment] 是自解释的关系。 +- 第二个字段中 x 表明通过用户名 username 登录系统是有密码保护的, 密码保存在 /etc/shadow 文件中。 +- [UID] 和 [GID] 字段用整数表示,代表该用户的用户标识符和对应所在组的组标志符。 +- 字段 [Home directory] 为 username 用户家目录的绝对路径。 +- 字段 [Default shell] 指定用户登录系统时默认使用的 shell。 + +**理解 /etc/group 中的内容** + +/etc/group 文件存储所有用户组的信息。每行记录的格式如下: + + [Group name]:[Group password]:[GID]:[Group members] + +- [Group name] 为用户组名称。 +- 字段 [Group password] 为 x 的话,则说明不适用用户组密码。 +- [GID] 与 /etc/passwd 中保存的 GID 相同。 +- [Group members] 用户组中的用户使用逗号隔开。 + +![Add User Accounts in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/add-user-accounts.png) + +添加用户账户 + +添加用户账户之后,你可以使用 usermod 命令来修改用户信息中的部分字段,该命令基本语法如下: + + # usermod [options] [username] + +**设置账户的过期时间** + +通过 –expiredate 标记后边接 年-月-日 格式的日期,如下: + + # usermod --expiredate 2014-10-30 tecmint + +**将用户添加到其他组** + +使用 -aG 或者 –append –groups 选项,后边跟着用户组,如果有多个用户组,每个用户组之间使用逗号隔开。 + + # usermod --append --groups root,users tecmint + +**改变用户家目录的默认位置** + +使用 -d 或者 –home 选项,后边跟着新的家目录的绝对路径。 + + # usermod --home /tmp tecmint + +**改变用户的默认 shell** + +使用 –shell 选项,后边跟着新 shell 的路径。 + + # usermod --shell /bin/sh tecmint + +**显示用户所属的用户组** + + # groups tecmint + # id tecmint + +下面,我们一次运行上述命令: + + # 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 命令例示 + +扩展阅读 + +- [15 useradd Command Examples in Linux][1] +- [15 usermod Command Examples in Linux][2] + +对于已有用户账户,我们还可以: + +**通过锁定密码来禁用账户** + +使用 -L (大写 l)或者 –lock 选项来锁定用户密码。 + + # usermod --lock tecmint + +**解锁用户密码** + +使用 –u 或者 –unlock 选项来解锁我们之前锁定的账户。 + + # usermod --unlock tecmint + +![Lock User in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/lock-user-in-linux.png) + +锁定用户账户 + +**为需要对指定文件进行读写的多个用户建立用户组** + +运行下列几条命令来完成: + + # groupadd common_group # 添加新用户组 + # chown :common_group common.txt # 将 common.txt 的用户组修改为 common_group + # usermod -aG common_group user1 # 添加用户 user1 到 common_group 用户组 + # usermod -aG common_group user2 # 添加用户 user2 到 common_group 用户组 + # usermod -aG common_group user3 # 添加用户 user3 到 common_group 用户组 + +**删除用户组** + +通过以下命令删除用户组: + + # groupdel [group_name] + +属于这个 group_name 用户组的文件是不会被删除的,而仅仅是删除了用户组。 + +### Linux 文件权限 ### + +除了我们在 [Setting File Attributes – Part 3][3] 中说到的基本的读取、写入和执行权限外,文件还有一些不常用却很重要的的权限设置,有时候把它当做“特殊权限”。 + +就像之前我们讨论的基本权限,这里同样使用八进制数字或者一个字母(象征性符号)好表示该权限类型。 + +**删除用户账户** + +你可以通过 userdel --remove 命令来删除用户账户。这样会删除用户拥有的家目录和家目录下的所有文件,以及邮件缓存目录。 + + # userdel --remove [username] + +#### 用户组管理 #### + +每次添加新用户,系统会为该用户创建同名的用户组,此时用户组里边只有新建的用户,其他用户可以随后添加进去。建立用户组的目的之一,就是为了通过对指定资源设置权限来完成对这些资源和文件进行访问控制。 + +比如,你有下列用户: + +- user1 (primary group: user1) +- user2 (primary group: user2) +- user3 (primary group: user3) + +他们都需要对你系统里边某个位置的 common.txt 文件,或者 user1 用户刚刚创建的共享进行读写。你可能会运行下列命令: + + # chmod 660 common.txt + 或 + # chmod u=rw,g=rw,o= common.txt [注意最后那个 = 号和文件名之间的空格] + +然而,这样仅仅给文件所属的用户和用户组(本例为 user1)成员的提供了读写权限。你还需要将 user2 和 user3 添加到 user1 组,打这样做也将 user1 用户和用户组的其他文件的权限开放给了 user2 和 user3。 + +这时候,用户组就派上用场了,下面将演示怎么做。 + +**理解 Setuid 位** + +当为可执行文件设置 setuid 位之后,用户运行程序是会继承该程序属主的有效特权。由于这样做会引起安全风险,因此设置 setuid 权限的文件及程序必须尽量少。你会发现,当系统中有用户需要执行 root 用户所管辖的程序时就是设置了 setuid 权限。 + +也就是说,用户不仅仅可以运行这个可执行文件,而且能以 root 权限来运行。比如,先检查 /bin/passwd 的权限,这个可执行文件用于改变账户的密码,并修改 /etc/shadow 文件。超级用户可以改变任意账户的密码,但是其他用户只能改变自己账户的密码。 + +![passwd Command Examples](http://www.tecmint.com/wp-content/uploads/2014/10/passwd-command.png) + +passwd 命令例示 + +因此,所有用户都有权限运行 /bin/passwd,但只有 root 用户可以指定改变指定用户账户的密码。其他用户只能改变其自身的密码。 + +![Change User Password in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/change-user-password.png) + +修改用户密码 + +**理解 Setgid 位** + +设置 setgid 位之后,真实用户的有效 GID 变为属组的 GID。因此,任何用户都能以赋予属组用户的权限来访问文件。另外,当目录置了 setgid 位之后,新建的文件将继承其所属目录的 GID,并且新建的子目录会继承父目录的 setgid 位。通过这个方法,你能够以一个指定用户组的身份来访问该目录里边的文件,而不必管文件属主的主属组。 + + # chmod g+s [filename] + +以八进制形式来设置 setgid 位,在当前基本权限(或者想要设置的权限)前加上数字 2 就行了。 + + # chmod 2755 [directory] + +**给目录设置 SETGID 位** + +![Add Setgid in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/add-setgid-to-directory.png) + +给命令设置 setgid 位 + +**理解 Sticky 位** + +文件设置了 Sticky 为之后,Linux 会将文件忽略,对于该文件影响到的目录,除了属主或者 root 用户外,其他用户无法删除,甚至重命名目录中其他文件也不行。 + +# chmod o+t [directory] + +以八进制形式来设置 sticky 位,在当前基本权限(或者想要设置的权限)前加上数字 1 就行了。 + +# chmod 1755 [directory] + +若没有 sticky 位,任何有权限读写目录的用户都可删除和重命名文件。因此,sticky 为通常出现在像 /tmp 之类的目录,这些目录是所有人都具有写权限的。 + +![Add Stickybit in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/add-sticky-bit-to-directory.png) + +给目录设置 sticky 位 + +### Linux 特殊文件属性 ### + +文件还有其他一些属性,用来做进一步的操作限制。比如,阻止对文件的重命名、移动、删除甚至是修改。可以通过使用 [chattr 命令][4] 来设置,并可以使用 lsattr 工具来查看这些属性。设置如下: + + # chattr +i file1 + # chattr +a file2 + +运行这些命令之后,file1 成为不可变状态(即不可移动、重命名、修改或删除),而 file2 进入“仅追加”模式(仅在追加内容模式中打开)。 + +![Protect File from Deletion](http://www.tecmint.com/wp-content/uploads/2014/10/chattr-command.png) + +通过 Chattr 命令来包含文件 + +### 访问 root 账户并启用 sudo ### + +访问 root 账户的方法之一,就是通过输入: + + $ su + +然后输入 root 账户密码。 + +倘若授权成功,你将以 root 身份登录,工作目录则是登录前所在的位置。如果是想要一登录就自动进入 root 用户的家目录,请运行: + $ su - + +然后输入 root 账户密码。 + +![Enable sudo Access on Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Enable-Sudo-Access.png) + +为用户启用 sudo 访问权限 + +执行上个步骤需要普通用户知道 root 账户的密码,这样会引起非常严重的安全问题。于是,系统管理员通常会配置 sudo 命令来让普通用户在严格控制的环境中以其他用户身份(通常是 root)来执行命令。所有,可以在严格控制用户的情况下,又允许他运行一条或多条特权命令。 + +- 扩展阅读:[Difference Between su and sudo User][5] + +普通用户通过他自己的用户密码来完成 sudo 授权。输入命令之后会出现输入密码(并不是超级用户密码)的提示,授权成功(只要赋予了用户运行该命令的权限)的话,指定的命令就会运行。 + +系统管理员必须编辑 /etc/sudoers 文件,才能为 sudo 赋予相应权限。通常建议使用 visudo 命令来编辑这个文件,而不是使用文本编辑器来打开它。 + + # visudo + +这样会使用 vim(如果你按照 [Install and Use vim as Editor – Part 2][6] 里边说的来编辑文件)来打开 /etc/sudoers 文件。 + +以下是需要设置的相关的行: + + 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 + +来更加深入了解这些项: + + Defaults secure_path="/usr/sbin:/usr/bin:/sbin:/usr/local/bin" + +这一行指定 sudo 将要使用的目录,这样可以阻止使用用户指定的目录,那样的话可能会危及系统。 + +下一行是用来指定权限的: + + root ALL=(ALL) ALL + +- 第一个 ALL 关键词表明这条规则适用于所有主机。 +- 第二个 ALL 关键词表明第一个字段中指定的用户能以任何用户身份所具有的权限来运行相应命令。 +- 第三个 ALL 关键词表明可以运行任何命令。 + + tecmint ALL=/bin/yum update + +如果 = 号后边没有指定用户,sudo 则默认为 root 用户。本例中,tecmint 用户能以 root身份运行 yum update 命令。 + + gacanepa ALL=NOPASSWD:/bin/updatedb + +NOPASSWD 关键词表明 gacanepa 用户不需要密码,可以直接运行 /bin/updatedb 命令。 + + %admin ALL=(ALL) ALL + +% 符号表示该行应用 admin 用户组。其他部分的含义与对于用户的含义是一样的。本例表示 admin 用户组的成员可以通过任何主机的链接来运行任何命令。 + +通过 sudo -l 命令可以查看,你的账户拥有什么样的权限。 + +![Sudo Access Rules](http://www.tecmint.com/wp-content/uploads/2014/10/sudo-access-rules.png) + +Sudo 访问规则 + +### 总结 ### +对于系统管理员来说,高效能的用户和文件管理技能是非常必要的。本文已经涵盖了这些内容,我们希望你将这些作为一个开始,,然后慢慢进步。随时在下边发表评论或提问,我们会尽快回应的。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/manage-users-and-groups-in-linux/ + +作者:[Gabriel Cánepa][a] +译者:[GHLandy](https://github.com/GHLandy) +校对:[校对者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/ From 676e9ccb0cb9e8b33ee10f7458cd9eddf9f767b4 Mon Sep 17 00:00:00 2001 From: "Fuliang.Li" Date: Sun, 3 Jan 2016 23:36:53 +0800 Subject: [PATCH 0132/1469] Delete Part 8 - LFCS--Managing Users and Groups File Permissions and Attributes and Enabling sudo Access on Accounts.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 完成翻译,译文放于对应位置。 --- ...es and Enabling sudo Access on Accounts.md | 332 ------------------ 1 file changed, 332 deletions(-) delete mode 100644 sources/tech/LFCS/Part 8 - LFCS--Managing Users and Groups File Permissions and Attributes and Enabling sudo Access on Accounts.md 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 deleted file mode 100644 index d45720d964..0000000000 --- a/sources/tech/LFCS/Part 8 - LFCS--Managing Users and Groups File Permissions and Attributes and Enabling sudo Access on Accounts.md +++ /dev/null @@ -1,332 +0,0 @@ -GHLandy Translating - -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/ From f3d89dddfc15844e41d8dc0b97d02718bb8a84f5 Mon Sep 17 00:00:00 2001 From: "Fuliang.Li" Date: Sun, 3 Jan 2016 23:42:57 +0800 Subject: [PATCH 0133/1469] =?UTF-8?q?[=E5=BC=80=E5=A7=8B=E7=BF=BB=E8=AF=91?= =?UTF-8?q?]20150921=2014=20tips=20for=20teaching=20open=20source=20develo?= =?UTF-8?q?pment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【开始翻译】 开源代码开发的 14 个教学技巧 --- .../20150921 14 tips for teaching open source development.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/talk/20150921 14 tips for teaching open source development.md b/sources/talk/20150921 14 tips for teaching open source development.md index a580f3b776..fb250ac4c6 100644 --- a/sources/talk/20150921 14 tips for teaching open source development.md +++ b/sources/talk/20150921 14 tips for teaching open source development.md @@ -1,3 +1,5 @@ +GHLandy Translating + 14 tips for teaching open source development ================================================================================ Academia is an excellent platform for training and preparing the open source developers of tomorrow. In research, we occasionally open source software we write. We do this for two reasons. One, to promote the use of the tools we produce. And two, to learn more about the impact and issues other people face when using them. With this background of writing research software, I was tasked with redesigning the undergraduate software engineering course for second-year students at the University of Bradford. From dc65a026a8266bc28d893792a0ec7e4ca67c84e3 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Mon, 4 Jan 2016 14:48:54 +0800 Subject: [PATCH 0134/1469] Translating by ZTinoZ --- ...lla with Apache and SSL on FreeBSD 10.2.md | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/sources/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md b/sources/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md index 4d14f87440..b67dc19ac9 100644 --- a/sources/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md +++ b/sources/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md @@ -198,55 +198,55 @@ bugzilla的数据库创建好了,名字为"bugzilladb",用户名和密码分 pkg install bugzilla50 -If it's done, go to the bugzilla installation directory and install all perl module that needed by bugzilla. +以上步骤都完成之后,前往bugzilla安装目录并安装所有bugzilla需要的perl模块。 cd /usr/local/www/bugzilla ./install-module --all -Wait it until all is finished, it is take the time. +要等到所有都完成,这需要点时间。 -Next, generate the configuration file "localconfig" by executing "checksetup.pl" file on bugzilla installation directory. +下一步,在bugzilla的安装目录中执行"checksetup.pl"文件来生成配置文件"localconfig"。 ./checksetup.pl -You will see the error message about the database configuration, so edit the file "localconfig" with nano editor : +你会看到一条关于数据库配置错误,你得用nano编辑器编辑一下"localconfig"文件: nano -c localconfig -Now add the database that was created on step 3. +现在添加第三步创建的数据库。 - #Line 57 + #第五十七行 $db_name = 'bugzilladb'; - #Line 60 + #第六十行 $db_user = 'bugzillauser'; - #Line 67 + #第六十七行 $db_pass = 'bugzillauser@'; -Save and exit. +保存并退出。 -Then run "checksetup.pl" again : +然后再次运行"checksetup.pl": ./checksetup.pl -You will be prompt about mail and administrator account, fill all of it with your email, user and password. +你会收到输入邮箱名和管理员账号的提示,你只要输入你得邮箱、用户名和密码就行了。 ![Admin Setup](http://blog.linoxide.com/wp-content/uploads/2015/12/Admin-Setup.png) -In the last, we need to change the owner of the installation directory to user "www", then restart apache with service command : +最后,我们需要把安装目录的属主改成"www",然后用服务命令重启apache: cd /usr/local/www/ chown -R www:www bugzilla service apache24 restart -Now Bugzilla is installed, you can see it by visiting mybugzilla.me and you will be redirect to the https connection. +现在Bugzilla已经安装好了,你可以通过访问mybugzilla.me来查看,并且将会重定向到https连接。 -Bugzilla home page. +Bugzilla首页: ![Bugzilla Home](http://blog.linoxide.com/wp-content/uploads/2015/12/Bugzilla-Home.png) -Bugzilla admin panel. +Bugzilla admin面板: ![Bugzilla Admin Page](http://blog.linoxide.com/wp-content/uploads/2015/12/Bugzilla-Admin-Page.png) From 57fa60702434c05d254b28f11f4afacac90158f2 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Mon, 4 Jan 2016 16:19:17 +0800 Subject: [PATCH 0135/1469] =?UTF-8?q?20160104-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... portfolio management software on Linux.md | 109 ++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 sources/tech/20160104 What is good stock portfolio management software on Linux.md diff --git a/sources/tech/20160104 What is good stock portfolio management software on Linux.md b/sources/tech/20160104 What is good stock portfolio management software on Linux.md new file mode 100644 index 0000000000..258cf104fc --- /dev/null +++ b/sources/tech/20160104 What is good stock portfolio management software on Linux.md @@ -0,0 +1,109 @@ +What is good stock portfolio management software on Linux +================================================================================ +If you are investing in the stock market, you probably understand the importance of a sound portfolio management plan. The goal of portfolio management is to come up with the best investment plan tailored for you, considering your risk tolerance, time horizon and financial goals. Given its importance, no wonder there are no shortage of commercial portfolio management apps and stock market monitoring software, each touting various sophisticated portfolio performance tracking and reporting capabilities. + +For those of you Linux aficionados who are looking for a **good open-source portfolio management tool** to manage and track your stock portfolio on Linux, I would highly recommend a Java-based portfolio manager called [JStock][1]. If you are not a big Java fan, you might be turned off by the fact that JStock runs on a heavyweight JVM. At the same time I am sure many people will appreciate the fact that JStock is instantly accessible on every Linux platform with JRE installed. No hoops to jump through to make it work on your Linux environment. + +The day is gone when "open-source" means "cheap" or "subpar". Considering that JStock is just a one-man job, JStock is impressively packed with many useful features as a portfolio management tool, and all that credit goes to Yan Cheng Cheok! For example, JStock supports price monitoring via watchlists, multiple portfolios, custom/built-in stock indicators and scanners, support for 27 different stock markets and cross-platform cloud backup/restore. JStock is available on multiple platforms (Linux, OS X, Android and Windows), and you can save and restore your JStock portfolios seamlessly across different platforms via cloud backup/restore. + +Sounds pretty neat, huh? Now I am going to show you how to install and use JStock in more detail. + +### Install JStock on Linux ### + +Since JStock is written in Java, you must [install JRE][2] to run it. Note that JStock requires JRE 1.7 or higher. If your JRE version does not meet this requirement, JStock will fail with the following error. + + Exception in thread "main" java.lang.UnsupportedClassVersionError: org/yccheok/jstock/gui/JStock : Unsupported major.minor version 51.0 + +Once you install JRE on your Linux, download the latest JStock release from the official website, and launch it as follows. + + $ wget https://github.com/yccheok/jstock/releases/download/release_1-0-7-13/jstock-1.0.7.13-bin.zip + $ unzip jstock-1.0.7.13-bin.zip + $ cd jstock + $ chmod +x jstock.sh + $ ./jstock.sh + +In the rest of the tutorial, let me demonstrate several useful features of JStock. + +### Monitor Stock Price Movements via Watchlist ### + +On JStock you can monitor stock price movement and automatically get notified by creating one or more watchlists. In each watchlist, you can add multiple stocks you are interested in. Then add your alert thresholds under "Fall Below" and "Rise Above" columns, which correspond to minimum and maximum stock prices you want to set, respectively. + +![](https://c2.staticflickr.com/2/1588/23795349969_37f4b0f23c_c.jpg) + +For example, if you set minimum/maximum prices of AAPL stock to $102 and $115.50, you will be alerted via desktop notifications if the stock price goes below $102 or moves higher than $115.50 at any time. + +You can also enable email alert option, so that you will instead receive email notifications for such price events. To enable email alerts, go to "Options" menu. Under "Alert" tab, turn on "Send message to email(s)" box, and enter your Gmail account. Once you go through Gmail authorization steps, JStock will start sending email alerts to that Gmail account (and optionally CC to any third-party email address). + +![](https://c2.staticflickr.com/2/1644/24080560491_3aef056e8d_b.jpg) + +### Manage Multiple Portfolios ### + +JStock allows you to manage multiple portfolios. This feature is useful if you are using multiple stock brokers. You can create a separate portfolio for each broker and manage your buy/sell/dividend transactions on a per-broker basis. You can switch different portfolios by choosing a particular portfolio under "Portfolio" menu. The following screenshot shows a hypothetical portfolio. + +![](https://c2.staticflickr.com/2/1646/23536385433_df6c036c9a_c.jpg) + +Optionally you can enable broker fee option, so that you can enter any broker fees, stamp duty and clearing fees for each buy/sell transaction. If you are lazy, you can enable fee auto-calculation and enter fee schedules for each brokering firm from the option menu beforehand. Then JStock will automatically calculate and enter fees when you add transactions to your portfolio. + +![](https://c2.staticflickr.com/2/1653/24055085262_0e315c3691_b.jpg) + +### Screen Stocks with Built-in/Custom Indicators ### + +If you are doing any technical analysis on stocks, you may want to screen stocks based on various criteria (so-called "stock indicators"). For stock screening, JStock offers several [pre-built technical indicators][3] that capture upward/downward/reversal trends of individual stocks. The following is a list of available indicators. + +- Moving Average Convergence Divergence (MACD) +- Relative Strength Index (RSI) +- Money Flow Index (MFI) +- Commodity Channel Index (CCI) +- Doji +- Golden Cross, Death Cross +- Top Gainers/Losers + +To install any pre-built indicator, go to "Stock Indicator Editor" tab on JStock. Then click on "Install" button in the right-side panel. Choose "Install from JStock server" option, and then install any indicator(s) you want. + +![](https://c2.staticflickr.com/2/1476/23867534660_b6a9c95a06_c.jpg) + +Once one or more indicators are installed, you can scan stocks using them. Go to "Stock Indicator Scanner" tab, click on "Scan" button at the bottom, and choose any indicator. + +![](https://c2.staticflickr.com/2/1653/24137054996_e8fcd10393_c.jpg) + +Once you select the stocks to scan (e.g., NYSE, NASDAQ), JStock will perform scan, and show a list of stocks captured by the indicator. + +![](https://c2.staticflickr.com/2/1446/23795349889_0f1aeef608_c.jpg) + +Besides pre-built indicators, you can also define custom indicator(s) on your own with a GUI-based indicator editor. The following example screens for stocks whose current price is less than or equal to its 60-day average price. + +![](https://c2.staticflickr.com/2/1605/24080560431_3d26eac6b5_c.jpg) + +### Cloud Backup and Restore between Linux and Android JStock ### + +Another nice feature of JStock is cloud backup and restore. JStock allows you to save and restore your portfolios/watchlists via Google Drive, and this features works seamlessly across different platforms (e.g., Linux and Android). For example, if you saved your JStock portfolios to Google Drive on Android, you can restore them on Linux version of JStock. + +![](https://c2.staticflickr.com/2/1537/24163165565_bb47e04d6c_c.jpg) + +![](https://c2.staticflickr.com/2/1556/23536385333_9ed1a75d72_c.jpg) + +If you don't see your portfolios/watchlists after restoring from Google Drive, make sure that your country is correctly set under "Country" menu. + +JStock Android free version is available from [Google Play store][4]. You will need to upgrade to premium version for one-time payment if you want to use its full features (e.g., cloud backup, alerts, charts). I think the premium version is definitely worth it. + +![](https://c2.staticflickr.com/2/1687/23867534720_18b917028c_c.jpg) + +As a final note, I should mention that its creator, Yan Cheng Cheok, is pretty active in JStock development, and quite responsive in addressing any bugs. Kudos to him! + +What do you think of JStock as portfolio tracking software? + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/stock-portfolio-management-software-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]:http://jstock.org/ +[2]:http://ask.xmodulo.com/install-java-runtime-linux.html +[3]:http://jstock.org/ma_indicator.html +[4]:https://play.google.com/store/apps/details?id=org.yccheok.jstock.gui From 822172c79617c8a9dd115730250637dc71404c8a Mon Sep 17 00:00:00 2001 From: DeadFire Date: Mon, 4 Jan 2016 16:19:57 +0800 Subject: [PATCH 0136/1469] =?UTF-8?q?20160104-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...om the command line on Debian or Ubuntu.md | 312 ++++++++++++++++++ 1 file changed, 312 insertions(+) create mode 100644 sources/tech/20160104 How to use KVM from the command line on Debian or Ubuntu.md diff --git a/sources/tech/20160104 How to use KVM from the command line on Debian or Ubuntu.md b/sources/tech/20160104 How to use KVM from the command line on Debian or Ubuntu.md new file mode 100644 index 0000000000..ed21bdb4ce --- /dev/null +++ b/sources/tech/20160104 How to use KVM from the command line on Debian or Ubuntu.md @@ -0,0 +1,312 @@ +How to use KVM from the command line on Debian or Ubuntu +================================================================================ +There are different ways to manage virtual machines (VMs) running on KVM hypervisor. For example, virt-manager is a popular GUI-based front-end for VM management. However, if you would like to use KVM on a headless server, GUI-based solutions will not be ideal. In fact, you can create and manage KVM VMs purely from the command line using kvm command-line wrapper script. Alternatively, you can use virsh which is an easier-to-use command-line user interface for managing guest VMs. Underneath virsh, it communicates wtih libvirtd service which can control several different hypervisors including KVM, Xen, QEMU, LXC and OpenVZ. + +A command-line management interface such as virsh is also useful when you would like to "automate" the provisioning and management of VMs. Also, the fact that virsh supports multiple hypervisors means you can manage different hypervisors via the same virsh interface. + +In this tutorial, I will demonstrate **how to run KVM from the command line by using virsh on Debian or Ubuntu**. + +### Step One: Verify Hardware Virtualization Support ### + +As a first step, verify that the host CPU is equipped with hardware virtualization extensions (e.g., Intel VT or AMD-V), which are required for KVM. The following command will do. + + $ egrep '(vmx|svm)' --color /proc/cpuinfo + +![](https://c2.staticflickr.com/2/1505/24050288606_758a44c4c6_c.jpg) + +If the output does not contain vmx or svm flag, it means the host CPU does not have hardware virtualization support. Thus you cannot use KVM on the host. After verifying that the host CPU comes with vmx or svm, proceed to install KVM next. + +For KVM, it is not required to run a 64-bit kernel on the KVM host, but generally it is recommended. + +### Step Two: Install KVM ### + +Using apt-get, install KVM and related user-space tools. + + $ sudo apt-get install qemu-kvm libvirt-bin + +During installation, libvirtd group (or libvirt-qemu on Debian) will be created, and your userID will be automatically added to the group. This will allows you to manage VMs as a non-root regular user. You can verify that by using id command, which will show your group IDs: + + $ id + +![](https://c2.staticflickr.com/6/5597/15432586092_64dfb867d3_c.jpg) + +If for some reason, libvirtd (or libvirt-qemu) is not found in your groupID list, you can manually add yourself to the group as follows. + +On Ubuntu: + + $ sudo adduser [youruserID] libvirtd + +On Debian: + + $ sudo adduser [youruserID] libvirt-qemu + +Reload updated group membership info as follows. Upon asked for a password, enter your login password. + + $ exec su -l $USER + +At this point, you should be able to run virsh as a regular user. As a test, try the command below, which will show a list of available VMs (currently none). If you do not encounter a permission error, it means everything is okay so far. + + $ virsh list + +---------- + + Id Name State + ---------------------------------------------------- + +### Step Three: Configure Bridged Networking ### + +One way to enable KVM VMs to access external networks is via a Linux bridge created on a KVM host. The bridge interconnects the virtual interfaces of VMs with the physical interface of the host, so that the VMs can send or receive traffic via the physical interface. This is called bridged networking. + +Here is how to create and configure a Linux bridge br0 for bridged networking with KVM. + +First, install a necessary package, and create a Linux bridge from the command line. + + $ sudo apt-get install bridge-utils + $ sudo brctl addbr br0 + +The next step is to configure Linux bridge in /etc/network/interfaces, so that the bridge is configured automatically upon boot. To use /etc/network/interfaces, you need to disable Network Manager on your system (if you are using it). Follow the [this instruction][1] to disable Network Manager. + +After disabling Network Manager, go ahead and configure Linux bridge br0 in /etc/network/interfaces as follows. + + #auto eth0 + #iface eth0 inet dhcp + + auto br0 + iface br0 inet dhcp + bridge_ports eth0 + bridge_stp off + bridge_fd 0 + bridge_maxwait 0 + +In the above I assume that eth0 is the primary network interface that is connected to external networks. Also, I assume that eth0 is getting its IP address via DHCP. Note that there is no configuration for eth0 in /etc/network/interface. The Linux bridge br0 takes up the configuration of eth0 as eth0 is enslaved to the bridge br0. + +Restart network service, and verify that Linux bridge is configured successfully. If successful, br0 should be assigned the eth0's DHCP IP address, and eth0 should not have any IP address assigned. + + $ sudo /etc/init.d/networking restart + $ ifconfig + +If for any reason eth0 still retains the IP address which is assigned to br0, you may have to explicitly remove the IP address from eth0. + +![](https://c2.staticflickr.com/2/1698/23780708850_66cd7ba6ea_c.jpg) + +### Step Four: Create a VM from the Command Line ### + +With KVM, the configuration of a VM is stored in a domain XML file. Thus, the first step to create a VM is to prepare its domain XML file. + +The following is a sample domain XML file of a VM. You can customize it as needed. + + + alice + f5b8c05b-9c7a-3211-49b9-2bd635f7e2aa + 1048576 + 1048576 + 1 + + hvm + + + + + + + destroy + restart + destroy + + /usr/bin/kvm + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + + + + +The above domain XML file defines the following VM. + +- 1GB memory, one vCPU and one hard drive. +- Disk image: /home/dev/images/alice.img. +- Boot from CD-ROM (/home/dev/iso/CentOS-6.5-x86_64-minimal.iso). +- Networking: one network interface bridged to br0 +- Remote access via VNC. + +The UUID string inside can be randomly generated. To get a random UUID, you can use uuid command-line tool. + + $ sudo apt-get install uuid + $ uuid + +Another way to create a domain XML file is to dump the domain information of an existing VM as follows. + + $ virsh dumpxml alice > bob.xml + +![](https://c2.staticflickr.com/6/5808/23968234602_25e8019ec8_c.jpg) + +### Step Five: Start VM from the Command Line ### + +Before starting a VM, you need to create its initial disk image. For that, you can use qemu-img command, which comes with qemu-kvm package you installed. The following command creates 10GB size empty disk image of qcow2 type: + + $ qemu-img create -f qcow2 /home/dev/images/alice.img 10G + +The advantage of using "qcow2" (as opposed to "raw") as a disk image format is that a "qcow2"-type disk image is not created as a full size (10GB) initially, but grows as the disk gets populated. So it is more space-efficient. + +Now you are ready to start a VM using the domain XML file you created earlier. The following command will create a VM, and automatically start it. + + $ virsh create alice.xml + +---------- + + Domain alice created from alice.xml + +**NOTE**: If you run the above command with an already created VM, it will wipe out the VM without warning. If you already created a VM, you can instead use the following command to just start the VM. + + $ virsh start alice.xml + +Verify that a new domain has been created and started successfully with: + + $ virsh list + +---------- + + Id Name State + ---------------------------------------------------- + 3 alice running + +Also, verify that the virtual interface for the VM (e.g., vnet0) is successfully added to the Linux bridge br0 that you created earlier. + + $ sudo brctl show + +![](https://c2.staticflickr.com/2/1546/23449585383_a371e9e579_c.jpg) + +### Step Six: Remote Access a VM ### + +To access the console of a running VM remotely, you can use any VNC client. + +First, find out the VNC port number for the VM as follows. + + $ sudo netstat -nap | egrep '(kvm|qemu)' + +![](https://c2.staticflickr.com/6/5633/23448144274_49045bc868_c.jpg) + +In this example, the VNC port number for alice VM is 5900. + +Then launch a VNC client, and connect to a VNC server running at :5900. In our example, the VM is supposed to boot into CentOS CD-ROM. + +![](https://c2.staticflickr.com/2/1533/24076369675_99408972a4_c.jpg) + +### Manage VMs with virsh ### + +The following lists common usages of virsh command. + +To create a new guest domain and start a VM: + + $ virsh create alice.xml + +To stop a VM and destroy a guest domain: + + $ virsh destroy alice + +To shutdown a VM (without destroying a domain): + + $ virsh shutdown alice + +To suspend a VM: + + $ virsh suspend alice + +To resume a suspended VM: + + $ virsh resume alice + +To access login console of a running VM: + + $ virsh console alice + +To autostart a VM upon host booting: + + $ virsh autostart alice + +To get domain information of a VM: + + $ virsh dominfo alice + +To edit domain XML of a VM: + + $ virsh edit alice + +The above will invoke the domain XML file of the VM with a default text editor. Any change in the XML will automatically be validated by libvirt for correctness. + +You can also manage VMs from within a virsh session. To create and enter a new virsh session, simply run: + + $ virsh + +At the virsh prompt, you can use any virsh commands. + +![](https://c2.staticflickr.com/6/5645/23708565129_b1ef968b30_c.jpg) + +### Troubleshooting ### + +1. I am getting the error while trying to create a VM: + + error: internal error: no supported architecture for os type 'hvm' + +You can get this error if your hardware does not have hardware virtualization support (e.g., Intel VT or AMD-V), which is required to run KVM. If you are getting this error even when your CPU comes with Intel VT or AMD-V, here are possible solutions: + +First, check if kvm kernel module is missing. + + $ lsmod | grep kvm + +If kvm kernel module is not loaded, you must load it as follows. + + $ sudo modprobe kvm_intel (for Intel processor) + $ sudo modprobe kvm_amd (for AMD processor) + +The second solution is adding "--connect qemu:///system" argument to virsh command as follows. This argument may be needed when you are using more than one hypervisor (e.g., VMware, VirtualBox) on the server hardware. + + $ virsh --connect qemu:///system create alice.xml + +2. I am getting the error while trying to access login console of my VM: + + $ virsh console alice + +---------- + + error: internal error: cannot find character device + +This error occurs because you did not define a console device in the VM's XML file. Add the following inside the "device" section of the XML file. + + + + + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/use-kvm-command-line-debian-ubuntu.html + +作者:[Dan Nanni][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/nanni +[1]:http://xmodulo.com/disable-network-manager-linux.html From f6e1c6f4bd55d33a0f76e8cdec924bdaed464eca Mon Sep 17 00:00:00 2001 From: DeadFire Date: Mon, 4 Jan 2016 16:26:49 +0800 Subject: [PATCH 0137/1469] =?UTF-8?q?20160104-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Information on Linux Using Command Line.md | 150 ++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 sources/tech/20160104 How to Check Hardware Information on Linux Using Command Line.md diff --git a/sources/tech/20160104 How to Check Hardware Information on Linux Using Command Line.md b/sources/tech/20160104 How to Check Hardware Information on Linux Using Command Line.md new file mode 100644 index 0000000000..6d332d57b6 --- /dev/null +++ b/sources/tech/20160104 How to Check Hardware Information on Linux Using Command Line.md @@ -0,0 +1,150 @@ +How to Check Hardware Information on Linux Using Command Line +================================================================================ +![](https://maketecheasier-holisticmedia.netdna-ssl.com/assets/uploads/2015/12/hdd_info_featured-1.png) + +There are many commands available to check hardware information of your Linux system. Some commands report only specific hardware components like CPU or memory while the rest cover multiple hardware units. + +This tutorial takes a quick look at some of the most commonly used commands to check information and configuration details about various hardware devices. + +### lscpu ### + +The `lscpu` command gives you information about the CPU and processing units. It does not have any other options or functionality. + + lscpu + +You will see the following output by running the above command. + +![hdd_info_lscpu](https://www.maketecheasier.com/assets/uploads/2015/12/hdd_info_lscpu.png) + +### lspci ### + +The lspci is another command line tool that lists all the PCI buses and details about the devices connected to them like VGA adapter, graphics card, network adapter, usb ports, SATA controller, etc. + + lspci + +You will see an output similar to the following image. + +![hdd_info_lspci](https://www.maketecheasier.com/assets/uploads/2015/12/hdd_info_lspci-1.png) + +You can also filter out specific device information by running the following command: + + lspci -v | grep "VGA" -A 12 + +You will see graphics card information similar to the following. + +![hdd_info_lspci_vga](https://www.maketecheasier.com/assets/uploads/2015/12/hdd_info_lspci_vga.png) + +### lshw ### + +The `lshw` is a general purpose utility that reports detailed and brief information about multiple hardware units like CPU, memory, usb controller, disk, etc. Lshw extracts the information from different “/proc” files. + + lshw -short + +You will see the following information by running the above command. + +![hdd_info_lshw](https://www.maketecheasier.com/assets/uploads/2015/12/hdd_info_lshw.png) + +### lsscsi ### + +You can list all scsi/sata devices like hard drives and optical drives by running the following command: + + lsscsi + +The output wI’ll look something like this image. + +![hdd_info_lsscsi](https://www.maketecheasier.com/assets/uploads/2015/12/hdd_info_lsscsi-1.png) + +### lsusb ### + +This command shows you the USB controllers and details about devices connected to them. By default, the lsusb command prints brief information. You can also use the verbose option -v to print detailed information about each usb port. + + lsusb + +You will see the following output. + +![hdd_info_lsusb](https://www.maketecheasier.com/assets/uploads/2015/12/hdd_info_lsusb.png) + +### Inxi ### + +`Inxi` is a bash script that fetches hardware information from multiple sources and commands on the system and gives you goodlooking reports that non-technical users can read easily. + +By default, `inxi` is not installed in Ubuntu. You can install it by running the following command: + + sudo apt-get install inxi + +After installing inxi, you can get hardware information by running the following command: + + inxi -Fx + +You will see an output similar to the image below. + +![hdd_info_inxi](https://www.maketecheasier.com/assets/uploads/2015/12/hdd_info_inxi.jpg) + +### df ### + +This command gives you brief information about various partitions, their mount points and the used and available space on each. +You can run the `df` command with the `-H` parameter. + + df -H + +You will see the following output. + +![hdd_info_df](https://www.maketecheasier.com/assets/uploads/2015/12/hdd_info_df-1.png) + +### Free ### + +You can check the amount of used, free and total amount of RAM on your system with the free command. + + free -m + +You will see the following output. + +![hdd_info_free](https://www.maketecheasier.com/assets/uploads/2015/12/hdd_info_free.png) + +### Dmidecode ### + +The `dmidecode` command is different from all other commands. It extracts hardware information by reading data from the DMI tables. + +To display information about the processor, run: + + sudo dmidecode -t processor + +![hdd_info_dmi_processor](https://www.maketecheasier.com/assets/uploads/2015/12/hdd_info_dmi_processor.jpg) + +To display information about the memory, run: + + sudo dmidecode -t memory + +![hdd_info_dmi_memory](https://www.maketecheasier.com/assets/uploads/2015/12/hdd_info_dmi_memory.png) + +To display information about the bios, run: + + sudo dmidecode -t bios + +![hdd_info_dmi_bios](https://www.maketecheasier.com/assets/uploads/2015/12/hdd_info_dmi_bios.png) + +### Hdparm ### + +The hdparm command gives you information about sata devices like hard disks. + + sudo hdparm + +You will see the following output. + +![hdd_info_hdparm](https://www.maketecheasier.com/assets/uploads/2015/12/hdd_info_hdparm.png) + +### Conclusion ### + +Each of the commands has a different method of extracting hardware information. You can try more than one of them while looking for specific hardware details. All of the above tools are available in most Linux distros, and can be easily installed from the default repository. + +-------------------------------------------------------------------------------- + +via: https://www.maketecheasier.com/check-hardware-information-linux/ + +作者:[Hitesh Jethva][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.maketecheasier.com/author/hiteshjethva/ From 6a45c75309674c02770722e1700bcb3200044344 Mon Sep 17 00:00:00 2001 From: SonoFelice Date: Mon, 4 Jan 2016 23:02:06 +0800 Subject: [PATCH 0138/1469] =?UTF-8?q?=E3=80=90=E7=BF=BB=E8=AF=91=E4=B8=AD?= =?UTF-8?q?=E3=80=91How=20to=20Check=20Hardware=20Information=20on=20Linux?= =?UTF-8?q?=20Using=20Command=20Line?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【翻译中】How to Check Hardware Information on Linux Using Command Line --- ... to Check Hardware Information on Linux Using Command Line.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160104 How to Check Hardware Information on Linux Using Command Line.md b/sources/tech/20160104 How to Check Hardware Information on Linux Using Command Line.md index 6d332d57b6..c793db21b2 100644 --- a/sources/tech/20160104 How to Check Hardware Information on Linux Using Command Line.md +++ b/sources/tech/20160104 How to Check Hardware Information on Linux Using Command Line.md @@ -1,3 +1,4 @@ +sonofelice translating How to Check Hardware Information on Linux Using Command Line ================================================================================ ![](https://maketecheasier-holisticmedia.netdna-ssl.com/assets/uploads/2015/12/hdd_info_featured-1.png) From 68f219f6b242cab86205bfce1ba502c7c722c177 Mon Sep 17 00:00:00 2001 From: Feng Wei Date: Mon, 4 Jan 2016 23:02:56 +0800 Subject: [PATCH 0139/1469] translation complete --- ... SSH Login Without Password CentOS or RHEL.md | 106 ------------------ ...H Login Without Password CentOS or RHEL.md | 105 +++++++++++++++++ 2 files changed, 105 insertions(+), 106 deletions(-) delete mode 100644 sources/tech/[翻译中]20151223 How to Setup SSH Login Without Password CentOS or RHEL.md create mode 100644 translated/tech/20151223 How to Setup SSH Login Without Password CentOS or RHEL.md diff --git a/sources/tech/[翻译中]20151223 How to Setup SSH Login Without Password CentOS or RHEL.md b/sources/tech/[翻译中]20151223 How to Setup SSH Login Without Password CentOS or RHEL.md deleted file mode 100644 index 3e0fc4cc0d..0000000000 --- a/sources/tech/[翻译中]20151223 How to Setup SSH Login Without Password CentOS or RHEL.md +++ /dev/null @@ -1,106 +0,0 @@ -translating by fw8899 -How to Setup SSH Login Without Password CentOS / RHEL -================================================================================ -![](http://www.ehowstuff.com/wp-content/uploads/2015/12/notebook-1071774_1280.jpg) - -As a system administrator, you plan on using OpenSSH for Linux and automate your daily tasks such as transferring files or database dump file for the backup to another server. To achieve this goal, you need to log in automatically from the host A to host B. Login automatically mean you do not want to enter any password because you want to use ssh from a shell script. - -In this article we’ll show you how to Setup SSH Login without Password on CentOS / RHEL. After automatic login has been configured, you can use it to move the file using SSH (Secure Shell) and secure copy (SCP). - -SSH is open source and the most trusted network protocol which is used to login to the remote server. It is used by system administrators to execute commands, also used to transfer files from one computer to another over a network using SCP protocol. - -After you setup SSH login without password, you can get the following advantages : - -a) Automate your daily task via scripts. -b) Enhance security of your linux server. This is one of the recommended method to prevent a brute force attack on virtual private server (VPS), SSH keys are nearly impossible to decipher by brute force alone. - -### What is ssh-keygen ### - -ssh-keygen is a Unix utility that is used to generate, create, manage the public and private keys for ssh authentication. With the help of the ssh-keygen tool, a user can create passphrase keys for both SSH protocol version 1 and version 2. ssh-keygen creates RSA keys for SSH protocol version 1 and RSA or DSA keys for use by SSH protocol version 2. - -### What is ssh-copy-id ### - -ssh-copy-id is a script that copies the local-host’s public key to the remote-host’s authorized_keys file. ssh-copy-id also append the indicated identity file to that machine’s ~/.ssh/authorized_keys file and assigns proper permission to the remote-host’s home. - -### SSH keys ### - -SSH keys provide better and secure way of logging into a linux server with SSH. After you run ssh-keygen, you will generate public key and private key. You can place the public key on any server, and then unlock it by connecting to it with a client that already has the private key. When the two match up, the system unlocks without the need for a password. - -### Setup SSH Login Without Password on CentOS and RHEL. ### - -This steps tested on CentOS 5/6/7, RHEL 5/6/7 and Oracle Linux 6/7. - -Node1 : 192.168.0.9 -Node2 : 192.168.l.10 - -#### Step One : #### - -Test the connection and access from node1 to node2 : - - [root@node1 ~]# ssh root@192.168.0.10 - The authenticity of host '192.168.0.10 (192.168.0.10)' can't be established. - RSA key fingerprint is 6d:8f:63:9b:3b:63:e1:72:b3:06:a4:e4:f4:37:21:42. - Are you sure you want to continue connecting (yes/no)? yes - Warning: Permanently added '192.168.0.10' (RSA) to the list of known hosts. - root@192.168.0.10's password: - Last login: Thu Dec 10 22:04:55 2015 from 192.168.0.1 - [root@node2 ~]# - -#### Step Two : #### - -Generate public and private keys using ssh-key-gen. Please take note that you can increase security by protecting the private key with a passphrase. - - [root@node1 ~]# ssh-keygen - Generating public/private rsa key pair. - Enter file in which to save the key (/root/.ssh/id_rsa): - Enter passphrase (empty for no passphrase): - Enter same passphrase again: - Your identification has been saved in /root/.ssh/id_rsa. - Your public key has been saved in /root/.ssh/id_rsa.pub. - The key fingerprint is: - b4:51:7e:1e:52:61:cd:fb:b2:98:4b:ad:a1:8b:31:6d root@node1.ehowstuff.local - The key's randomart image is: - +--[ RSA 2048]----+ - | . ++ | - | o o o | - | o o o . | - | . o + .. | - | S . . | - | . .. .| - | o E oo.o | - | = ooo. | - | . o.o. | - +-----------------+ - -#### Step Three : #### - -Copy or transfer the public key to remote-host using ssh-copy-id command. It will append the indicated identity file to ~/.ssh/authorized_keys on node2 : - - [root@node1 ~]# ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.0.10 - root@192.168.0.10's password: - Now try logging into the machine, with "ssh '192.168.0.10'", and check in: - - .ssh/authorized_keys - - to make sure we haven't added extra keys that you weren't expecting. - -#### Step Four : #### - -Try SSH login without Password to node2 : - - [root@node1 ~]# ssh root@192.168.0.10 - Last login: Sun Dec 13 14:03:20 2015 from www.ehowstuff.local - -I hope this article gives you some ideas and quick guide on how to setup SSH login without password on Linux CentOS / RHEL. - --------------------------------------------------------------------------------- - -via: http://www.ehowstuff.com/ssh-login-without-password-centos/ - -作者:[skytech][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.ehowstuff.com/author/skytech/ diff --git a/translated/tech/20151223 How to Setup SSH Login Without Password CentOS or RHEL.md b/translated/tech/20151223 How to Setup SSH Login Without Password CentOS or RHEL.md new file mode 100644 index 0000000000..a806d76491 --- /dev/null +++ b/translated/tech/20151223 How to Setup SSH Login Without Password CentOS or RHEL.md @@ -0,0 +1,105 @@ +如何在CentOS / RHEL上设置SSH免密码登录 +================================================================================ +![](http://www.ehowstuff.com/wp-content/uploads/2015/12/notebook-1071774_1280.jpg) + +作为系统管理员,你计划在Linux上使用OpenSSHell,完成日常工作的自动化,比如文件传输、备份数据库转储文件到另一台服务器。为实现该目标,你需要从主机A能自动登录到主机B。自动登录也就是说,要在shell脚本中使用ssh,而无需要输入任何密码。 + +本文会告诉你怎样在CentOS/RHEL上设置SSH免密码登录。自动登录配置好以后,你可以在它基础上用SSH (Secure Shell) 和secure copy (SCP)移动文件。 + +SSH是开源的,用于远程登录的最为可靠的网络协议。系统管理员用它来执行命令,以及通过SCP协议在网络上向另一台电脑传输文件。 + +通过配置SSH免密码登录,你可以享受到如下的便利: + +a) 用脚本实现日常工作的自动化。 +b) 增强Linux服务器的安全性。这是防范虚拟专用服务器(VPS)遭受暴力破解攻击的一个推荐的方法,SSH 密钥单凭暴力破解是几乎不可攻破的。 + +### 什么是ssh-keygen ### + +ssh-keygen是Unix实用工具包里的一个命令,用来生成、创建和管理SSH认证用的公私钥。通过ssh-keygen命令,用户可以创建支持SSH1和SSH2的密钥。ssh-keygen为SSH1创建RSA密钥,SSH2则可以是RSA或DSA。 + +### 什么是ssh-copy-id ### + +ssh-copy-id是用来将本地公钥拷贝到远程authorized_keys文件的脚本命令,它还会将身份标识文件追加到远程机器的~/.ssh/authorized_keys文件中,并给远程主机的用户主目录适当的的权限 + +### SSH keys ### + +SSH keys为登录Linux服务器提供了更好且安全的机制。运行ssh-keygen后,将会生成公私密钥对。你可以将公钥放置到任意服务器,从持有私钥的客户端连接到服务器的时,会用它来解锁。两者匹配时,系统无需密码就能解除锁定。 + +### 在CentOS和RHEL上设置免密码登录SSH ### + +以下步骤在CentOS 5/6/7、RHEL 5/6/7和Oracle Linux 6/7上测试通过。 + +节点1 : 192.168.0.9 +节点2 : 192.168.l.10 + +#### 步骤1 : #### + +测试节点1到节点2的连接和访问: + + [root@node1 ~]# ssh root@192.168.0.10 + The authenticity of host '192.168.0.10 (192.168.0.10)' can't be established. + RSA key fingerprint is 6d:8f:63:9b:3b:63:e1:72:b3:06:a4:e4:f4:37:21:42. + Are you sure you want to continue connecting (yes/no)? yes + Warning: Permanently added '192.168.0.10' (RSA) to the list of known hosts. + root@192.168.0.10's password: + Last login: Thu Dec 10 22:04:55 2015 from 192.168.0.1 + [root@node2 ~]# + +#### 步骤二: #### + +使用ssh-key-gen命令生成公钥和私钥,这里要注意的是可以对私钥进行加密保护以增强安全性。 + + [root@node1 ~]# ssh-keygen + Generating public/private rsa key pair. + Enter file in which to save the key (/root/.ssh/id_rsa): + Enter passphrase (empty for no passphrase): + Enter same passphrase again: + Your identification has been saved in /root/.ssh/id_rsa. + Your public key has been saved in /root/.ssh/id_rsa.pub. + The key fingerprint is: + b4:51:7e:1e:52:61:cd:fb:b2:98:4b:ad:a1:8b:31:6d root@node1.ehowstuff.local + The key's randomart image is: + +--[ RSA 2048]----+ + | . ++ | + | o o o | + | o o o . | + | . o + .. | + | S . . | + | . .. .| + | o E oo.o | + | = ooo. | + | . o.o. | + +-----------------+ + +#### 步骤三: #### + + 用ssh-copy-di命令将公钥复制或上传到远程主机,并将身份标识文件追加到节点2的~/.ssh/authorized_keys中: + + [root@node1 ~]# ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.0.10 + root@192.168.0.10's password: + Now try logging into the machine, with "ssh '192.168.0.10'", and check in: + + .ssh/authorized_keys + + to make sure we haven't added extra keys that you weren't expecting. + +#### 步骤四: #### + +验证免密码SSH登录节点2: + + [root@node1 ~]# ssh root@192.168.0.10 + Last login: Sun Dec 13 14:03:20 2015 from www.ehowstuff.local + +我希望这篇文章能帮助到你,为你提供SSH免密码登录CentOS / RHEL的基本认知和快速指南。 + +-------------------------------------------------------------------------------- + +原载: http://www.ehowstuff.com/ssh-login-without-password-centos/ + +作者:[skytech][a] +译者:[fw8899](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.ehowstuff.com/author/skytech/ From 4031cf6d60d2a14a60079de8a97aa695546da230 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Tue, 5 Jan 2016 00:09:38 +0800 Subject: [PATCH 0140/1469] Update 20151215 How to block network traffic by country on Linux.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 准备翻译该篇。 --- ...151215 How to block network traffic by country on Linux.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20151215 How to block network traffic by country on Linux.md b/sources/tech/20151215 How to block network traffic by country on Linux.md index 1f2d39f04d..14bdbad711 100644 --- a/sources/tech/20151215 How to block network traffic by country on Linux.md +++ b/sources/tech/20151215 How to block network traffic by country on Linux.md @@ -1,3 +1,5 @@ +FSSlc translating + How to block network traffic by country on Linux ================================================================================ As a system admin who maintains production Linux servers, there are circumstances where you need to **selectively block or allow network traffic based on geographic locations**. For example, you are experiencing denial-of-service attacks mostly originating from IP addresses registered with a particular country. You want to block SSH logins from unknown foreign countries for security reasons. Your company has a distribution right to online videos, which requires it to legally stream to particular countries only. You need to prevent any local host from uploading documents to any non-US remote cloud storage due to geo-restriction company policies. @@ -107,4 +109,4 @@ via: http://xmodulo.com/block-network-traffic-by-country-linux.html [4]:http://xtables-addons.sourceforge.net/ [5]:https://support.maxmind.com/geoip-faq/geoip2-and-geoip-legacy-databases/how-accurate-are-your-geoip2-and-geoip-legacy-databases/ [6]:http://ask.xmodulo.com/add-cron-job-linux.html -[7]:https://en.wikipedia.org/wiki/ISO_3166-1 \ No newline at end of file +[7]:https://en.wikipedia.org/wiki/ISO_3166-1 From 12e1e660f328a4517799c0d523db36c2a0ed540f Mon Sep 17 00:00:00 2001 From: crazyLinuxer <958983476@qq.com> Date: Tue, 5 Jan 2016 00:53:06 +0800 Subject: [PATCH 0141/1469] Update 20160104 How to use KVM from the command line on Debian or Ubuntu.md --- ...4 How to use KVM from the command line on Debian or Ubuntu.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160104 How to use KVM from the command line on Debian or Ubuntu.md b/sources/tech/20160104 How to use KVM from the command line on Debian or Ubuntu.md index ed21bdb4ce..c91fa32afc 100644 --- a/sources/tech/20160104 How to use KVM from the command line on Debian or Ubuntu.md +++ b/sources/tech/20160104 How to use KVM from the command line on Debian or Ubuntu.md @@ -1,3 +1,4 @@ +kylepeng93翻译中... How to use KVM from the command line on Debian or Ubuntu ================================================================================ There are different ways to manage virtual machines (VMs) running on KVM hypervisor. For example, virt-manager is a popular GUI-based front-end for VM management. However, if you would like to use KVM on a headless server, GUI-based solutions will not be ideal. In fact, you can create and manage KVM VMs purely from the command line using kvm command-line wrapper script. Alternatively, you can use virsh which is an easier-to-use command-line user interface for managing guest VMs. Underneath virsh, it communicates wtih libvirtd service which can control several different hypervisors including KVM, Xen, QEMU, LXC and OpenVZ. From eb3eb38421f9718c4f68c362db79f7267046502b Mon Sep 17 00:00:00 2001 From: kylepeng93 <958983476@qq.com> Date: Tue, 5 Jan 2016 01:43:26 +0800 Subject: [PATCH 0142/1469] =?UTF-8?q?kylepeng93=E7=BF=BB=E8=AF=91=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...4 How to use KVM from the command line on Debian or Ubuntu.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160104 How to use KVM from the command line on Debian or Ubuntu.md b/sources/tech/20160104 How to use KVM from the command line on Debian or Ubuntu.md index ed21bdb4ce..733832f224 100644 --- a/sources/tech/20160104 How to use KVM from the command line on Debian or Ubuntu.md +++ b/sources/tech/20160104 How to use KVM from the command line on Debian or Ubuntu.md @@ -1,3 +1,4 @@ +kylepeng93翻译中 How to use KVM from the command line on Debian or Ubuntu ================================================================================ There are different ways to manage virtual machines (VMs) running on KVM hypervisor. For example, virt-manager is a popular GUI-based front-end for VM management. However, if you would like to use KVM on a headless server, GUI-based solutions will not be ideal. In fact, you can create and manage KVM VMs purely from the command line using kvm command-line wrapper script. Alternatively, you can use virsh which is an easier-to-use command-line user interface for managing guest VMs. Underneath virsh, it communicates wtih libvirtd service which can control several different hypervisors including KVM, Xen, QEMU, LXC and OpenVZ. From 353355ea35e725fc03802f751051422a1b8a9a60 Mon Sep 17 00:00:00 2001 From: kylepeng93 <958983476@qq.com> Date: Tue, 5 Jan 2016 02:04:32 +0800 Subject: [PATCH 0143/1469] translated --- ...unning a mainline kernel on a cellphone.md | 42 ------------------- ...unning a mainline kernel on a cellphone.md | 14 +++++++ 2 files changed, 14 insertions(+), 42 deletions(-) delete mode 100644 sources/tech/20151125 Running a mainline kernel on a cellphone.md create mode 100644 translated/tech/20151125 Running a mainline kernel on a cellphone.md diff --git a/sources/tech/20151125 Running a mainline kernel on a cellphone.md b/sources/tech/20151125 Running a mainline kernel on a cellphone.md deleted file mode 100644 index 624c99d2a7..0000000000 --- a/sources/tech/20151125 Running a mainline kernel on a cellphone.md +++ /dev/null @@ -1,42 +0,0 @@ - -kylepeng93正在翻译 -Running a mainline kernel on a cellphone -================================================================================ - -One of the biggest freedoms associated with free software is the ability to replace a program with an updated or modified version. Even so, of the many millions of people using Linux-powered phones, few are able to run a mainline kernel on those phones, even if they have the technical skills to do the replacement. The sad fact is that no mainstream phone available runs mainline kernels. A session at the 2015 Kernel Summit, led by Rob Herring, explored this problem and what might be done to address it. - -When asked, most of the developers in the room indicated that they would prefer to be able to run mainline kernels on their phones — though a handful did say that they would rather not do so. Rob has been working on this problem for the last year and a half in support of Project Ara (mentioned in this article). But the news is not good. - -There is, he said, too much out-of-tree code running on a typical handset; mainline kernels simply lack the drivers needed to make that handset work. A typical phone is running 1-3 million lines of out-of-tree code. Almost all of those phones are stuck on the 3.10 kernel — or something even older. There are all kinds of reasons for this, but the simple fact is that things seem to move too quickly in the handset world for the kernel community to keep up. Is that, he asked, something that we care about? - -Tim Bird noted that the Nexus 1, one of the original Android phones, never ran a mainline kernel and never will. It broke the promise of open source, making it impossible for users to put a new kernel onto their devices. At this point, no phone supports that ability. Peter Zijlstra wondered about how much of that out-of-tree code was duplicated functionality from one handset to the next; Rob noted that he has run into three independently developed hotplug governors so far. - -Dirk Hohndel suggested that few people care. Of the billion phones out there, he said, approximately 27 of them have owners who care about running mainline kernels. The rest just want to get the phone to work. Perhaps developers who are concerned about running mainline kernels are trying to solve the wrong problem. - -Chris Mason said that handset vendors are currently facing the same sorts of problems that distributors dealt with many years ago. They are coping with a lot of inefficient, repeated, duplicated work. Once the distributors [Rob Herring] decided to put their work into the mainline instead of carrying it themselves, things got a lot better. The key is to help the phone manufacturers to realize that they can benefit in the same way; that, rather than pressure from users, is how the problem will be solved. - -Grant Likely raised concerns about security in a world where phones cannot be upgraded. What we need is a real distribution market for phones. But, as long as the vendors are in charge of the operating software, phones will not be upgradeable. We have a big security mess coming, he said. Peter added that, with Stagefright, that mess is already upon us. - -Ted Ts'o said that running mainline kernels is not his biggest concern. He would be happy if the phones on sale this holiday season would be running a 3.18 or 4.1 kernel, rather than being stuck on 3.10. That, he suggested, is a more solvable problem. Steve Rostedt said that would not solve the security problem, but Ted remarked that a newer kernel would at least make it easier to backport fixes. Grant replied that, one year from now, it would all just happen again; shipping newer kernels is just an incremental fix. Kees Cook added that there is not much to be gained from backporting fixes; the real problem is that there are no defenses from bugs (he would expand on this theme in a separate session later in the day). - -Rob said that any kind of solution would require getting the vendors on board. That, though, will likely run into trouble with the sort of lockdown that vendors like to apply to their devices. Paolo Bonzini asked whether it would be possible to sue vendors over unfixed security vulnerabilities, especially when the devices are still under warranty. Grant said that upgradeability had to become a market requirement or it simply wasn't going to happen. It might be a nasty security issue that causes this to happen, or carriers might start requiring it. Meanwhile, kernel developers need to keep pushing in that direction. Rob noted that, beyond the advantages noted thus far, the ability to run mainline kernels would help developers to test and validate new features on Android devices. - -Josh Triplett asked whether the community would be prepared to do what it would take if the industry were to come around to the idea of mainline kernel support. There would be lots of testing and validation of kernels on handsets required; Android Compatibility Test Suite failures would have to be treated as regressions. Rob suggested that this could be discussed next year, after the basic functionality is in place, but Josh insisted that, if the demand were to show up, we would have to be able to give a good answer. - -Tim said that there is currently a big disconnect with the vendor world; vendors are not reporting or contributing anything back to the community at all. They are completely disconnected, so there is no forward progress ever. Josh noted that when vendors do report bugs with the old kernels they are using, the reception tends to be less than friendly. Arnd Bergmann said that what was needed was to get one of the big silicon vendors to commit to the idea and get its hardware to a point where running mainline kernels was possible; that would put pressure on the others. But, he added, that would require the existence of one free GPU driver that got shipped with the hardware — something that does not exist currently. - -Rob put up a list of problem areas, but there was not much time for discussion of the particulars. WiFi drivers continue to be an issue, especially with the new features being added in the Android world. Johannes Berg agreed that the new features are an issue; the Android developers do not even talk about them until they ship with the hardware. Support for most of those features does eventually land in the mainline kernel, though. - -As things wound down, Ben Herrenschmidt reiterated that the key was to get vendors to realize that working with the mainline kernel is in their own best interest; it saves work in the long run. Mark Brown said that, in past years when the kernel version shipped with Android moved forward more reliably, the benefits of working upstream were more apparent to vendors. Now that things seem to be stuck on 3.10, that pressure is not there in the same way. The session ended with developers determined to improve the situation, but without any clear plan for getting there. - --------------------------------------------------------------------------------- - -via: https://lwn.net/Articles/662147/ - -作者:[Jonathan Corbet][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:https://lwn.net/Articles/KernelSummit2015/ diff --git a/translated/tech/20151125 Running a mainline kernel on a cellphone.md b/translated/tech/20151125 Running a mainline kernel on a cellphone.md new file mode 100644 index 0000000000..e3a6c52e9f --- /dev/null +++ b/translated/tech/20151125 Running a mainline kernel on a cellphone.md @@ -0,0 +1,14 @@ +在手机上面运行主线内核 +对于自由软件来说,其最大的自由之一就是能够用一个更新或修改的版本来替换原始版本的程序。尽管如此,数千万使用linux内核作为支持的手机用户却很少能够在他们的手机上运行主线内核,即使他们拥有替换内核代码的专业技能。可悲的是,我们必须承认目前仍然无法使用到运行主线内核的主流手机。在由Rob Herring主持的2015届内核峰会上,与会人员共同探讨了这个问题,并进一步谈论了他们应该怎么做才能解决这个问题。 +当主持人提问的时候,在座的大多数开发人员都表示他们更喜欢在他们的手机上面运行主线内核,然而也有少数人持相反的看法。在Project Ara的支持下,Rob在这个问题上已经研究了近一年半的时间。但是最新的研究成果并不理想。 +Rob表示,有太多的树(out-of-tree)代码运行在手机上,主线内核只是缺少能使手机正常运行所必须的驱动。每台合格的手机都在运行着100万到300万的树(out-of-tree)代码。几乎所有的这些手机的内核版本都不超过3.1,有一些甚至更加古老。造成这种情况的原因有很多,但是有一点是很清楚的,在手机的世界里,一切都变化的太快以至于内核社区无法跟上它们的步伐。如果真是那样,他问到,我们还担心什么呢? +Tim Bird指出,第一台Android手机Nexus1从来没有运行过任何一个主线内核,并且以后也不会。它打破了开源的承诺,也使得用户不可能做到将一个新的内核放到手机中。从这一点上来说,没有任何一款手机支持这种能力。Peter Zijlstra想知道从一台手机到另一台手机到底有多少正发挥作用的被复制的代码。Rob表示,迄今为止,他已经见到了三个独立开发的热插拔调速器。 +Dirk Hohndel提出了很少有人注意到的建议。他说,对于世界上的成千上亿万台手机,其中大约有百分之27的手机用户关心他们的手机是否运行着主线内核。剩下的用户仅仅只是想让他们的手机正常工作。或许那些关注手机是否在运行主线内核的开发者正在努力去解决这个令人不解的问题。 +Chris Mason说,那些手机卖家当前正面临着相同类型的问题,而这些问题也是那些linux发行版过去所面临过的问题。他们疲于应付大量的无效且重复和能被复制的工作。一旦这些发行版决定将他们的工作重心转入到主线内核而不是让它顺其自然的发展,那么问题将会变得好解决的多。解决问题的关键就是去帮助手机制造商们认识到他们可以通过同样的方式获利,形成这种认识的关键并不是通过来自用户的压力。这样一来,问题就可以解决了。 +Grant Likely提出了对于安全问题的担忧,这种担忧来自于那些不能升级他们的手机系统的android设备。他说,我们需要的是一个真正专为手机设立的发行市场。但是,只要手机卖家仍然掌控着手机中的应用软件,那么手机的同步更新将无法实现。我们接下来将面临一个很大的安全难题。Peter补充说,随着Stagefright漏洞的出现,难题已经出现在我们面前了。 +Ted Ts'o说,运行主线内核并不是他的主要关注点。他很乐于见到这个假期中所售卖的手机能够运行3.18或者4.1的内核,而不是继续停留在3.10。他认为这是一个更可能被解决的问题。Steve Rostedt认为,按照Ted Ts'o所说的那样去做并不能解决手机的安全问题,但是,Ted认为使用一个更新的内核至少可以让漏洞修复变得更加容易。Grant对此回应说,接下来的一年里,这一切都将再次发生。过渡到更新的内核也是一个渐进式的对系统的完善。Kees Cook补充说,我们无法从修复旧版本的内核漏洞的过程中得到太多的益处,真正的问题是我们没有对bug的应对措施。 +Rob说,任何一种解决方案都需要得到当前的手机供应商的支持。否则,由于厂商对应用到他们生产的手机上的操作系统的封锁,运行主线内核的策略将会陷入麻烦。Paolo Bonzini提问说是否可以因为那些没有修复的安全漏洞而控告手机厂商,尤其当手机仍然处于保修期内。Grant认为对于手机的可更新能力的保证必须来源于市场需求,否则是无法实现的。而促使它实现的原因可能会是一个严重的安全问题,然后用户开始对手机的可更新能力提出要求。同时,内核开发人员必须不断朝着这个方向努力。Rob表示,除了到目前为止指出的所有优点之外,运行主线内核也能帮助开发者对安卓设备上的新特性进行测试和验证。 +Josh Triplett提问说,如果手机产商提出对主线内核提供支持的想法,那么内核社区又将采取什么措施呢?那样将会针对手机各方面的特性要求对内核进行大量的测试和验证;Android的兼容性测试套件中出现的失败将不得不被再次回归。Rob提议这个问题将会在明年被讨论,即先将最基本的功能做好。但是,Josh强调说,如果这个需求出现了,我们就应该能够给出一个好的答案。 +Tim认为,当前,我们和厂商之间存在很大的脱节。厂商根本不会主动报告或者贡献任何反馈给社区。他们之间完全脱节了,这样的话永远不会有进步。Josh表示,当厂商们报告他们正在使用的旧内核的相关bug时,双方之间的接受度将变得更加友好。Arnd Bergmann认为,我们需要的是得到一个大芯片厂商对使用主线内核的认可,并且将该厂商的硬件提升到能够支持主线内核的运行的这样一个水平,而这样将会在其他方面增加负担。但是,他补充说,实现这个目标要求存在一个跟随硬件一起分发的自由GPU驱动程序——然而这种程序当前并不存在。 +Rob给存在问题的领域列了一个清单,但是现在已经没有太多的时间去讨论其中的细节了。WIFI驱动仍然是一个问题,尤其是当新特性被添加到Android设备上的时候。Johannes Berg对新特性仍然存在问题表示赞同;android的开发人员甚至在这些新特性被应用到Android设备上之前都不会去谈论它们是否存在问题。然而,对这些特性中的大多数的技术支持最终都会落实在主线内核中。 +随着会议逐渐接近尾声,Ben Herrenschmidt再次重申:实现在andoroid手机上运行主线内核的关键还是在于让厂商认识到使用主线内核是它们获得最大利润的最好选择。从长远看,使用主线内核能节省大量的工作。Mark Brown认为,以前,当搭载在Android设备上的内核版本以更稳定的方式向前推进的时候,上游工作的好处对运营商来说更加明显。以现在的情况来看,手机上的内核版本似乎停留在了3.10,那种压力是不一样的。这次会话以开发者决定进一步改善当前的状况而结束,但是却并没有对如何改善提出一个明确的计划。 From aca7feecd997150483b7ecfa2ab5ecf9bd981579 Mon Sep 17 00:00:00 2001 From: "Fuliang.Li" Date: Tue, 5 Jan 2016 09:49:48 +0800 Subject: [PATCH 0144/1469] =?UTF-8?q?[=E5=BC=80=E5=A7=8B=E7=BF=BB=E8=AF=91?= =?UTF-8?q?]=2020151208=206=20useful=20LibreOffice=20extensions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【开始翻译】LibreOffice 中的六大实用扩展插件 --- .../yearbook2015/20151208 6 useful LibreOffice extensions.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/talk/yearbook2015/20151208 6 useful LibreOffice extensions.md b/sources/talk/yearbook2015/20151208 6 useful LibreOffice extensions.md index a2c1e393ff..be1bb2d553 100644 --- a/sources/talk/yearbook2015/20151208 6 useful LibreOffice extensions.md +++ b/sources/talk/yearbook2015/20151208 6 useful LibreOffice extensions.md @@ -1,3 +1,5 @@ +GHLandy Translating + 6 useful LibreOffice extensions ================================================================================ ![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/yearbook2015-osdc-lead-2.png) @@ -76,4 +78,4 @@ via: https://opensource.com/business/15/12/6-useful-libreoffice-extensions [7]:http://extensions.libreoffice.org/extension-center/impressrunner [8]:https://www.libreoffice.org/discover/draw/ [9]:http://extensions.libreoffice.org/extension-center/export-as-images -[10]:http://anaphraseus.sourceforge.net/ \ No newline at end of file +[10]:http://anaphraseus.sourceforge.net/ From 89cc4705478284b915583863d574f8a177287d96 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Tue, 5 Jan 2016 10:57:08 +0800 Subject: [PATCH 0145/1469] Translating by ZTinoZ --- ...w to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md b/sources/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md index b67dc19ac9..f709ba5582 100644 --- a/sources/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md +++ b/sources/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md @@ -252,7 +252,7 @@ Bugzilla admin面板: ### 结论 ### -Bugzilla is web based application help you to manage the software development. It is written in perl and use MySQL as the database system. Bugzilla used by mozilla, redhat, gnome etc for help their software development. Bugzilla has a lot of features and easy to configure and install. +Bugzilla是一个基于web并能帮助你管理软件开发的应用,它用perl开发并使用MySQL作为数据库系统。Bugzilla被mozilla,redhat,gnome等等公司用来帮助它们的软件开发工作。Bugzilla有很多功能并易于配置和安装。 -------------------------------------------------------------------------------- From dfa43521d91c3262d1ff22b464a0c9bbd7260bba Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Tue, 5 Jan 2016 10:57:58 +0800 Subject: [PATCH 0146/1469] Finish the translation by ZTinoZ --- ...How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md (100%) diff --git a/sources/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md b/translated/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md similarity index 100% rename from sources/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md rename to translated/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md From b84530a93dc7eadde2cb5007e86fda7bd611dcf8 Mon Sep 17 00:00:00 2001 From: kylepeng93 <958983476@qq.com> Date: Tue, 5 Jan 2016 11:54:59 +0800 Subject: [PATCH 0147/1469] translated --- ...unning a mainline kernel on a cellphone.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/translated/tech/20151125 Running a mainline kernel on a cellphone.md b/translated/tech/20151125 Running a mainline kernel on a cellphone.md index e3a6c52e9f..88f21b55d7 100644 --- a/translated/tech/20151125 Running a mainline kernel on a cellphone.md +++ b/translated/tech/20151125 Running a mainline kernel on a cellphone.md @@ -1,14 +1,14 @@ 在手机上面运行主线内核 -对于自由软件来说,其最大的自由之一就是能够用一个更新或修改的版本来替换原始版本的程序。尽管如此,数千万使用linux内核作为支持的手机用户却很少能够在他们的手机上运行主线内核,即使他们拥有替换内核代码的专业技能。可悲的是,我们必须承认目前仍然无法使用到运行主线内核的主流手机。在由Rob Herring主持的2015届内核峰会上,与会人员共同探讨了这个问题,并进一步谈论了他们应该怎么做才能解决这个问题。 -当主持人提问的时候,在座的大多数开发人员都表示他们更喜欢在他们的手机上面运行主线内核,然而也有少数人持相反的看法。在Project Ara的支持下,Rob在这个问题上已经研究了近一年半的时间。但是最新的研究成果并不理想。 -Rob表示,有太多的树(out-of-tree)代码运行在手机上,主线内核只是缺少能使手机正常运行所必须的驱动。每台合格的手机都在运行着100万到300万的树(out-of-tree)代码。几乎所有的这些手机的内核版本都不超过3.1,有一些甚至更加古老。造成这种情况的原因有很多,但是有一点是很清楚的,在手机的世界里,一切都变化的太快以至于内核社区无法跟上它们的步伐。如果真是那样,他问到,我们还担心什么呢? -Tim Bird指出,第一台Android手机Nexus1从来没有运行过任何一个主线内核,并且以后也不会。它打破了开源的承诺,也使得用户不可能做到将一个新的内核放到手机中。从这一点上来说,没有任何一款手机支持这种能力。Peter Zijlstra想知道从一台手机到另一台手机到底有多少正发挥作用的被复制的代码。Rob表示,迄今为止,他已经见到了三个独立开发的热插拔调速器。 -Dirk Hohndel提出了很少有人注意到的建议。他说,对于世界上的成千上亿万台手机,其中大约有百分之27的手机用户关心他们的手机是否运行着主线内核。剩下的用户仅仅只是想让他们的手机正常工作。或许那些关注手机是否在运行主线内核的开发者正在努力去解决这个令人不解的问题。 -Chris Mason说,那些手机卖家当前正面临着相同类型的问题,而这些问题也是那些linux发行版过去所面临过的问题。他们疲于应付大量的无效且重复和能被复制的工作。一旦这些发行版决定将他们的工作重心转入到主线内核而不是让它顺其自然的发展,那么问题将会变得好解决的多。解决问题的关键就是去帮助手机制造商们认识到他们可以通过同样的方式获利,形成这种认识的关键并不是通过来自用户的压力。这样一来,问题就可以解决了。 -Grant Likely提出了对于安全问题的担忧,这种担忧来自于那些不能升级他们的手机系统的android设备。他说,我们需要的是一个真正专为手机设立的发行市场。但是,只要手机卖家仍然掌控着手机中的应用软件,那么手机的同步更新将无法实现。我们接下来将面临一个很大的安全难题。Peter补充说,随着Stagefright漏洞的出现,难题已经出现在我们面前了。 -Ted Ts'o说,运行主线内核并不是他的主要关注点。他很乐于见到这个假期中所售卖的手机能够运行3.18或者4.1的内核,而不是继续停留在3.10。他认为这是一个更可能被解决的问题。Steve Rostedt认为,按照Ted Ts'o所说的那样去做并不能解决手机的安全问题,但是,Ted认为使用一个更新的内核至少可以让漏洞修复变得更加容易。Grant对此回应说,接下来的一年里,这一切都将再次发生。过渡到更新的内核也是一个渐进式的对系统的完善。Kees Cook补充说,我们无法从修复旧版本的内核漏洞的过程中得到太多的益处,真正的问题是我们没有对bug的应对措施。 -Rob说,任何一种解决方案都需要得到当前的手机供应商的支持。否则,由于厂商对应用到他们生产的手机上的操作系统的封锁,运行主线内核的策略将会陷入麻烦。Paolo Bonzini提问说是否可以因为那些没有修复的安全漏洞而控告手机厂商,尤其当手机仍然处于保修期内。Grant认为对于手机的可更新能力的保证必须来源于市场需求,否则是无法实现的。而促使它实现的原因可能会是一个严重的安全问题,然后用户开始对手机的可更新能力提出要求。同时,内核开发人员必须不断朝着这个方向努力。Rob表示,除了到目前为止指出的所有优点之外,运行主线内核也能帮助开发者对安卓设备上的新特性进行测试和验证。 -Josh Triplett提问说,如果手机产商提出对主线内核提供支持的想法,那么内核社区又将采取什么措施呢?那样将会针对手机各方面的特性要求对内核进行大量的测试和验证;Android的兼容性测试套件中出现的失败将不得不被再次回归。Rob提议这个问题将会在明年被讨论,即先将最基本的功能做好。但是,Josh强调说,如果这个需求出现了,我们就应该能够给出一个好的答案。 -Tim认为,当前,我们和厂商之间存在很大的脱节。厂商根本不会主动报告或者贡献任何反馈给社区。他们之间完全脱节了,这样的话永远不会有进步。Josh表示,当厂商们报告他们正在使用的旧内核的相关bug时,双方之间的接受度将变得更加友好。Arnd Bergmann认为,我们需要的是得到一个大芯片厂商对使用主线内核的认可,并且将该厂商的硬件提升到能够支持主线内核的运行的这样一个水平,而这样将会在其他方面增加负担。但是,他补充说,实现这个目标要求存在一个跟随硬件一起分发的自由GPU驱动程序——然而这种程序当前并不存在。 -Rob给存在问题的领域列了一个清单,但是现在已经没有太多的时间去讨论其中的细节了。WIFI驱动仍然是一个问题,尤其是当新特性被添加到Android设备上的时候。Johannes Berg对新特性仍然存在问题表示赞同;android的开发人员甚至在这些新特性被应用到Android设备上之前都不会去谈论它们是否存在问题。然而,对这些特性中的大多数的技术支持最终都会落实在主线内核中。 -随着会议逐渐接近尾声,Ben Herrenschmidt再次重申:实现在andoroid手机上运行主线内核的关键还是在于让厂商认识到使用主线内核是它们获得最大利润的最好选择。从长远看,使用主线内核能节省大量的工作。Mark Brown认为,以前,当搭载在Android设备上的内核版本以更稳定的方式向前推进的时候,上游工作的好处对运营商来说更加明显。以现在的情况来看,手机上的内核版本似乎停留在了3.10,那种压力是不一样的。这次会话以开发者决定进一步改善当前的状况而结束,但是却并没有对如何改善提出一个明确的计划。 + 对于自由软件来说,其最大的自由之一就是能够用一个更新或修改的版本来替换原始版本的程序。尽管如此,数千万使用linux内核作为支持的手机用户却很少能够在他们的手机上运行主线内核,即使他们拥有替换内核代码的专业技能。可悲的是,我们必须承认目前仍然无法使用到运行主线内核的主流手机。在由Rob Herring主持的2015届内核峰会上,与会人员共同探讨了这个问题,并进一步谈论了他们应该怎么做才能解决这个问题。 + 当主持人提问的时候,在座的大多数开发人员都表示他们更喜欢在他们的手机上面运行主线内核,然而也有少数人持相反的看法。在Project Ara的支持下,Rob在这个问题上已经研究了近一年半的时间。但是最新的研究成果并不理想。 + Rob表示,有太多的树(out-of-tree)代码运行在手机上,主线内核只是缺少能使手机正常运行所必须的驱动。每台合格的手机都在运行着100万到300万的树(out-of-tree)代码。几乎所有的这些手机的内核版本都不超过3.1,有一些甚至更加古老。造成这种情况的原因有很多,但是有一点是很清楚的,在手机的世界里,一切都变化的太快以至于内核社区无法跟上它们的步伐。如果真是那样,他问到,我们还担心什么呢? + Tim Bird指出,第一台Android手机Nexus1从来没有运行过任何一个主线内核,并且以后也不会。它打破了开源的承诺,也使得用户不可能做到将一个新的内核放到手机中。从这一点上来说,没有任何一款手机支持这种能力。Peter Zijlstra想知道从一台手机到另一台手机到底有多少正发挥作用的被复制的代码。Rob表示,迄今为止,他已经见到了三个独立开发的热插拔调速器。 + Dirk Hohndel提出了很少有人注意到的建议。他说,对于世界上的成千上亿万台手机,其中大约有百分之27的手机用户关心他们的手机是否运行着主线内核。剩下的用户仅仅只是想让他们的手机正常工作。或许那些关注手机是否在运行主线内核的开发者正在努力去解决这个令人不解的问题。 + Chris Mason说,那些手机卖家当前正面临着相同类型的问题,而这些问题也是那些linux发行版过去所面临过的问题。他们疲于应付大量的无效且重复和能被复制的工作。一旦这些发行版决定将他们的工作重心转入到主线内核而不是让它顺其自然的发展,那么问题将会变得好解决的多。解决问题的关键就是去帮助手机制造商们认识到他们可以通过同样的方式获利,形成这种认识的关键并不是通过来自用户的压力。这样一来,问题就可以解决了。 + Grant Likely提出了对于安全问题的担忧,这种担忧来自于那些不能升级他们的手机系统的android设备。他说,我们需要的是一个真正专为手机设立的发行市场。但是,只要手机卖家仍然掌控着手机中的应用软件,那么手机的同步更新将无法实现。我们接下来将面临一个很大的安全难题。Peter补充说,随着Stagefright漏洞的出现,难题已经出现在我们面前了。 + Ted Ts'o说,运行主线内核并不是他的主要关注点。他很乐于见到这个假期中所售卖的手机能够运行3.18或者4.1的内核,而不是继续停留在3.10。他认为这是一个更可能被解决的问题。Steve Rostedt认为,按照Ted Ts'o所说的那样去做并不能解决手机的安全问题,但是,Ted认为使用一个更新的内核至少可以让漏洞修复变得更加容易。Grant对此回应说,接下来的一年里,这一切都将再次发生。过渡到更新的内核也是一个渐进式的对系统的完善。Kees Cook补充说,我们无法从修复旧版本的内核漏洞的过程中得到太多的益处,真正的问题是我们没有对bug的应对措施。 + Rob说,任何一种解决方案都需要得到当前的手机供应商的支持。否则,由于厂商对应用到他们生产的手机上的操作系统的封锁,运行主线内核的策略将会陷入麻烦。Paolo Bonzini提问说是否可以因为那些没有修复的安全漏洞而控告手机厂商,尤其当手机仍然处于保修期内。Grant认为对于手机的可更新能力的保证必须来源于市场需求,否则是无法实现的。而促使它实现的原因可能会是一个严重的安全问题,然后用户开始对手机的可更新能力提出要求。同时,内核开发人员必须不断朝着这个方向努力。Rob表示,除了到目前为止指出的所有优点之外,运行主线内核也能帮助开发者对安卓设备上的新特性进行测试和验证。 + Josh Triplett提问说,如果手机产商提出对主线内核提供支持的想法,那么内核社区又将采取什么措施呢?那样将会针对手机各方面的特性要求对内核进行大量的测试和验证;Android的兼容性测试套件中出现的失败将不得不被再次回归。Rob提议这个问题将会在明年被讨论,即先将最基本的功能做好。但是,Josh强调说,如果这个需求出现了,我们就应该能够给出一个好的答案。 + Tim认为,当前,我们和厂商之间存在很大的脱节。厂商根本不会主动报告或者贡献任何反馈给社区。他们之间完全脱节了,这样的话永远不会有进步。Josh表示,当厂商们报告他们正在使用的旧内核的相关bug时,双方之间的接受度将变得更加友好。Arnd Bergmann认为,我们需要的是得到一个大芯片厂商对使用主线内核的认可,并且将该厂商的硬件提升到能够支持主线内核的运行的这样一个水平,而这样将会在其他方面增加负担。但是,他补充说,实现这个目标要求存在一个跟随硬件一起分发的自由GPU驱动程序——然而这种程序当前并不存在。 + Rob给存在问题的领域列了一个清单,但是现在已经没有太多的时间去讨论其中的细节了。WIFI驱动仍然是一个问题,尤其是当新特性被添加到Android设备上的时候。Johannes Berg对新特性仍然存在问题表示赞同;android的开发人员甚至在这些新特性被应用到Android设备上之前都不会去谈论它们是否存在问题。然而,对这些特性中的大多数的技术支持最终都会落实在主线内核中。 + 随着会议逐渐接近尾声,Ben Herrenschmidt再次重申:实现在andoroid手机上运行主线内核的关键还是在于让厂商认识到使用主线内核是它们获得最大利润的最好选择。从长远看,使用主线内核能节省大量的工作。Mark Brown认为,以前,当搭载在Android设备上的内核版本以更稳定的方式向前推进的时候,上游工作的好处对运营商来说更加明显。以现在的情况来看,手机上的内核版本似乎停留在了3.10,那种压力是不一样的。这次会话以开发者决定进一步改善当前的状况而结束,但是却并没有对如何改善提出一个明确的计划。 From 9920ab020efb2b60473075d5da0321c098d585a4 Mon Sep 17 00:00:00 2001 From: "Fuliang.Li" Date: Tue, 5 Jan 2016 13:35:53 +0800 Subject: [PATCH 0148/1469] =?UTF-8?q?[=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= =?UTF-8?q?]=2020151125=2020=20Years=20of=20GIMP=20Evolution--Step=20by=20?= =?UTF-8?q?Step?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【翻译完成】GIMP 过去的 20 年:一点一滴的进步 --- ...0 Years of GIMP Evolution--Step by Step.md | 169 ++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 translated/talk/20151125 20 Years of GIMP Evolution--Step by Step.md diff --git a/translated/talk/20151125 20 Years of GIMP Evolution--Step by Step.md b/translated/talk/20151125 20 Years of GIMP Evolution--Step by Step.md new file mode 100644 index 0000000000..20acfc1ee8 --- /dev/null +++ b/translated/talk/20151125 20 Years of GIMP Evolution--Step by Step.md @@ -0,0 +1,169 @@ +GHLandy Translated + +GIMP 过去的 20 年:一点一滴的进步 +================================================================================ +注:youtube 视频 + + +[GIMP][1](GNU 图像处理程序)—— 一流的开源免费图像处理程序。加州大学伯克利分校的 Peter Mattis 和 Spencer Kimball 最早在 1995 年的时候就进行了该程序的开发。到了 1997 年,该程序成为了 [GNU Project][2] 官方的一部分,并正式更名为 GIMP。时至今日,GIMP 已经成为了最好的图像编辑器之一,并有最受欢迎的 “GIMP vs Photoshop” 之争。 + +1995 年 11 月 21 日,首版发布: + +> 发布者: Peter Mattis +> +> 发布主题: ANNOUNCE: The GIMP +> +> 日期: 1995-11-21 +> +> 消息ID: <48s543$r7b@agate.berkeley.edu> +> +> 新闻组: comp.os.linux.development.apps,comp.os.linux.misc,comp.windows.x.apps +> +> GIMP:通用图像处理程序 +> ------------------------------------------------ +> +> GIMP 是为各种图像编辑操作提供一个直观的图形界面而设计的。 +> +> 以下是 GIMP 的主要功能介绍: +> +> 图像查看 +> ------------- +> +> * 支持 8 位,15 位,16 位和 24 位颜色 +> * 8 位色显示的图像序列的稳定算法 +> * 以 RGB 色、灰度和索引色模式查看图像 +> * 同时编辑多个图像 +> * 实时缩放和全图查看 +> * 支持 GIF、JPEG、PNG、TIFF 和 XPM 格式 +> +> 图像编辑 +> ------------- +> +> * 选区工具:包括矩形、椭圆、自由、模糊、贝尔赛曲线以及智能 +> * 变换工具:包括旋转、缩放、剪切和翻转 +> * 绘画工具:包括油漆桶、笔刷、喷枪、克隆、卷积、混合和文本 +> * 效果滤镜:如模糊和边缘检测 +> * 通道和颜色操作:叠加、反相和分解 +> * 组件功能:允许你方便的添加新的文件格式和效果滤镜 +> * 多步撤销/重做功能 + +1996 年,GIMP 0.54 版 + +![](https://github.com/paulcarroty/Articles/raw/master/GIMP%20History/054.png) + +GIMP 0.54 版需要具备 X11 显示、X-server 以及 Motif 1.2 微件,支持 8 位、15 位、16 位和 24 位的颜色深度和灰度,支持 GIF、JPEG、PNG、TIFF 和 XPM 图像格式。 + +基本功能:具备矩形、椭圆、自由、模糊、贝塞尔曲线和智能等选择工具,旋转、缩放、剪切、克隆、混合和翻转等变换工具。 + +扩展工具:文字添加、效果滤镜、通道和颜色操纵工具、撤销/重做功能。由于第一个版本支持组件扩展,才方便添加这些功能。 + +GIMP 0.54 版可以在 Linux、HP-UX、Solaris 和 SGI IRIX 中运行。 + +### 1997 年,GIMP 0.60 版 ### + +![](https://github.com/paulcarroty/Articles/raw/master/GIMP%20History/060.gif) + +这只是一个开发版本,并非面向用户发布的。GIMP 有了新的工具包——GDK(GIMP Drawing Kit,GIMP 绘图工具)和 GTK(GIMP Toolkit,GIMP 工具包),并弃用 Motif。GIMP 工具包随后也发展成为了 GTK+ 跨平台的微件工具包。新特性: + +- 基本的图层功能 +- 子像素采集 +- 笔刷间距 +- 改进剂喷枪功能 +- 绘制模式 + +### 1997 年,GIMP 0.99 版 ### + +![](https://github.com/paulcarroty/Articles/raw/master/GIMP%20History/099.png) + +从 0.99 版本开始,GIMP 有了宏脚本的支持。GTK 及 GTK 功能增强版正式更名为 GTK+。其他更新: + +- 支持大体积图像(大于 100M) +- 新增原生格式 – XCF +- 新的 API – 使得更加容易编写组件和扩展 + +### 1998 年,GIMP 1.0 版 ### + +![](https://github.com/paulcarroty/Articles/raw/master/GIMP%20History/100.gif) + +GIMP 和 GTK+ 开始分为两个不同的项目。GIMP 官网进行重构,包含新教程、组件和文档。新特性: + +- 基于瓦片式的内存管理 +- 组件 API 做了较大改变 +- XFC 格式现在支持图层、导航和选择 +- web 界面 +- 在线图像生成 + +### 2000 年,GIMP 1.2 版 ### + +新特性: + +- 进行了非英文语言翻译 +- 修复 GTK+ 和 GIMP 中的大量bug +- 增加大量组件 +- 图像映射 +- 新工具:调整大小、测量、加亮、燃烧效果、颜色吸管和翻转等。 +- 图像管道 +- 保存前可以进行图像预览 +- 按比例缩放的笔刷进行预览 +- 通过路径进行递归选择 +- 新的窗口导航 +- 支持图像拖拽 +- 支持水印 + +### 2004 年,GIMP 2.0 版 ### + +![](https://github.com/paulcarroty/Articles/raw/master/GIMP%20History/200.png) + +重大更新 – 更新 GTK+ 2.x toolkit. + +### 2004 年,GIMP 2.2 版 ### + +![](https://github.com/paulcarroty/Articles/raw/master/GIMP%20History/220.png) + +修复大量 Bug 并支持图像拖拽 + +### 2007 年,GIMP 2.4 版 ### + +![](https://github.com/paulcarroty/Articles/raw/master/GIMP%20History/240.png) + +新特性: + +- 更好的图像拖拽体验 +- 使用新的脚本解释器 Script-Fu 替代了 旧的 Ti-Fu +- 新组件:影印效果、光晕效果、霓虹灯效果、卡通效果、小狗笔刷、水珠笔刷以及其他组件 + +### 2008 年,GIMP 2.6 版 ### + +新特性: + +- 更新了图形界面 +- 新的选择工具 +- 继承了 GEGL (GEneric Graphics Library,通用图形库) +- 为 MDI 行为实现了实用程序窗口提示 + +### 2012 年,GIMP 2.8 版 ### + +![](https://github.com/paulcarroty/Articles/raw/master/GIMP%20History/280.png) + +新特性: + +- GUI 在视觉上做了一些改变 +- 新的保存和导出菜单 +- 更新文本框工具 +- 支持图层群组 +- 支持 JPEG2000 和导出为 pdf +- 网页截图工具 + +-------------------------------------------------------------------------------- + +via: https://tlhp.cf/20-years-of-gimp-evolution/ + +作者:[Pavlo Rudyi][a] +译者:[GHLandy](https://github.com/GHLandy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://tlhp.cf/author/paul/ +[1]:https://gimp.org/ +[2]:http://www.gnu.org/ From 4a27b3e387bfd731022e3a123c392550d9dd525e Mon Sep 17 00:00:00 2001 From: "Fuliang.Li" Date: Tue, 5 Jan 2016 13:40:28 +0800 Subject: [PATCH 0149/1469] =?UTF-8?q?[=E5=BC=80=E5=A7=8B=E7=BF=BB=E8=AF=91?= =?UTF-8?q?]=2020151208=206=20creative=20ways=20to=20use=20ownCloud?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【开始翻译】使用 onwCloud 的六个创意方法 --- .../yearbook2015/20151208 6 creative ways to use ownCloud.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/talk/yearbook2015/20151208 6 creative ways to use ownCloud.md b/sources/talk/yearbook2015/20151208 6 creative ways to use ownCloud.md index 969e0637b5..dd099648a7 100644 --- a/sources/talk/yearbook2015/20151208 6 creative ways to use ownCloud.md +++ b/sources/talk/yearbook2015/20151208 6 creative ways to use ownCloud.md @@ -1,3 +1,5 @@ +GHLandy Translating + 6 creative ways to use ownCloud ================================================================================ ![Yearbook cover 2015](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/osdc-open-source-yearbook-lead1-inc0335020sw-201511-01.png) @@ -91,4 +93,4 @@ via: https://opensource.com/life/15/12/6-creative-ways-use-owncloud [12]:https://owncloud.com/owncloud45-community/ [13]:http://karlitschek.de/2015/08/announcing-the-draft-federated-cloud-sharing-api/ [14]:https://owncloud.com/customer/sciebo/ -[15]:https://owncloud.org/federation/ \ No newline at end of file +[15]:https://owncloud.org/federation/ From 377bb6fbf55a1073e97dd7cc42858afa0eed2265 Mon Sep 17 00:00:00 2001 From: "Fuliang.Li" Date: Tue, 5 Jan 2016 13:41:14 +0800 Subject: [PATCH 0150/1469] Delete 20151125 20 Years of GIMP Evolution--Step by Step.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 完成翻译后进行删除原文 --- ...0 Years of GIMP Evolution--Step by Step.md | 173 ------------------ 1 file changed, 173 deletions(-) delete mode 100644 sources/talk/20151125 20 Years of GIMP Evolution--Step by Step.md diff --git a/sources/talk/20151125 20 Years of GIMP Evolution--Step by Step.md b/sources/talk/20151125 20 Years of GIMP Evolution--Step by Step.md deleted file mode 100644 index 681a1d6258..0000000000 --- a/sources/talk/20151125 20 Years of GIMP Evolution--Step by Step.md +++ /dev/null @@ -1,173 +0,0 @@ -GHLandy Translating - -20 Years of GIMP Evolution: Step by Step -================================================================================ -注:youtube 视频 - - -[GIMP][1] (GNU Image Manipulation Program) – superb open source and free graphics editor. Development began in 1995 as students project of the University of California, Berkeley by Peter Mattis and Spencer Kimball. In 1997 the project was renamed in “GIMP” and became an official part of [GNU Project][2]. During these years the GIMP is one of the best graphics editor and platinum holy wars “GIMP vs Photoshop” – one of the most popular. - -The first announce, 21.11.1995: - -> From: Peter Mattis -> -> Subject: ANNOUNCE: The GIMP -> -> Date: 1995-11-21 -> -> Message-ID: <48s543$r7b@agate.berkeley.edu> -> -> Newsgroups: comp.os.linux.development.apps,comp.os.linux.misc,comp.windows.x.apps -> -> The GIMP: the General Image Manipulation Program -> ------------------------------------------------ -> -> The GIMP is designed to provide an intuitive graphical interface to a -> variety of image editing operations. Here is a list of the GIMP's -> major features: -> -> Image viewing -> ------------- -> -> * Supports 8, 15, 16 and 24 bit color. -> * Ordered and Floyd-Steinberg dithering for 8 bit displays. -> * View images as rgb color, grayscale or indexed color. -> * Simultaneously edit multiple images. -> * Zoom and pan in real-time. -> * GIF, JPEG, PNG, TIFF and XPM support. -> -> Image editing -> ------------- -> -> * Selection tools including rectangle, ellipse, free, fuzzy, bezier -> and intelligent. -> * Transformation tools including rotate, scale, shear and flip. -> * Painting tools including bucket, brush, airbrush, clone, convolve, -> blend and text. -> * Effects filters (such as blur, edge detect). -> * Channel & color operations (such as add, composite, decompose). -> * Plug-ins which allow for the easy addition of new file formats and -> new effect filters. -> * Multiple undo/redo. - -GIMP 0.54, 1996 - -![](https://github.com/paulcarroty/Articles/raw/master/GIMP%20History/054.png) - -GIMP 0.54 was required X11 displays, X-server and Motif 1.2 wigdets and supported 8, 15, 16 & 24 color depths with RGB & grayscale colors. Supported images format: GIF, JPEG, PNG, TIFF and XPM. - -Basic functionality: rectangle, ellipse, free, fuzzy, bezier, intelligent selection tools, and rotate, scale, shear, clone, blend and flip images. - -Extended tools: text operations, effects filters, tools for channel and colors manipulation, undo and redo operations. Since the first version GIMP support the plugin system. - -GIMP 0.54 can be ran in Linux, HP-UX, Solaris, SGI IRIX. - -### GIMP 0.60, 1997 ### - -![](https://github.com/paulcarroty/Articles/raw/master/GIMP%20History/060.gif) - -This is development release, not for all users. GIMP has the new toolkits – GDK (GIMP Drawing Kit) and GTK (GIMP Toolkit), Motif support is deprecated. GIMP Toolkit is also begin of the GTK+ cross-platform widget toolkit. New features: - -- basic layers -- sub-pixel sampling -- brush spacing -- improver airbrush -- paint modes - -### GIMP 0.99, 1997 ### - -![](https://github.com/paulcarroty/Articles/raw/master/GIMP%20History/099.png) - -Since 0.99 version GIMP has the scripts add macros (Script-Fus) support. GTK and GDK with some improvements has now the new name – GTK+. Other improvements: - -- support big images (rather than 100 MB) -- new native format – XCF -- new API – write plugins and extensions is easy - -### GIMP 1.0, 1998 ### - -![](https://github.com/paulcarroty/Articles/raw/master/GIMP%20History/100.gif) - -GIMP and GTK+ was splitted into separate projects. The GIMP official website has -reconstructed and contained new tutorials, plugins and documentation. New features: - -- tile-based memory management -- massive changes in plugin API -- XFC format now support layers, guides and selections -- web interface -- online graphics generation - -### GIMP 1.2, 2000 ### - -New features: - -- translation for non-english languages -- fixed many bugs in GTK+ and GIMP -- many new plugins -- image map -- new toolbox: resize, measure, dodge, burn, smugle, samle colorize and curve bend -- image pipes -- images preview before saving -- scaled brush preview -- recursive selection by path -- new navigation window -- drag’n’drop -- watermarks support - -### GIMP 2.0, 2004 ### - -![](https://github.com/paulcarroty/Articles/raw/master/GIMP%20History/200.png) - -The biggest change – new GTK+ 2.x toolkit. - -### GIMP 2.2, 2004 ### - -![](https://github.com/paulcarroty/Articles/raw/master/GIMP%20History/220.png) - -Many bugfixes and drag’n’drop support. - -### GIMP 2.4, 2007 ### - -![](https://github.com/paulcarroty/Articles/raw/master/GIMP%20History/240.png) - -New features: - -- better drag’n’drop support -- Ti-Fu was replaced to Script-Fu – the new script interpreter -- new plugins: photocopy, softglow, neon, cartoon, dog, glob and others - -### GIMP 2.6, 2008 ### - -New features: - -- renew graphics interface -- new select and tool -- GEGL (GEneric Graphics Library) integration -- “The Utility Window Hint” for MDI behavior - -### GIMP 2.8, 2012 ### - -![](https://github.com/paulcarroty/Articles/raw/master/GIMP%20History/280.png) - -New features: - -- GUI has some visual changes -- new save and export menu -- renew text editor -- layers group support -- JPEG2000 and export to PDF support -- webpage screenshot tool - --------------------------------------------------------------------------------- - -via: https://tlhp.cf/20-years-of-gimp-evolution/ - -作者:[Pavlo Rudyi][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://tlhp.cf/author/paul/ -[1]:https://gimp.org/ -[2]:http://www.gnu.org/ From 328fccd1126cb319515c3d194222a5cce444e4ce Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 5 Jan 2016 22:27:55 +0800 Subject: [PATCH 0151/1469] PUB:20151204 How to Install Laravel PHP Framework on CentOS 7 or Ubuntu 15.04 @NearTan --- ...P Framework on CentOS 7 or Ubuntu 15.04.md | 34 ++++++------------- 1 file changed, 11 insertions(+), 23 deletions(-) rename {translated/tech => published}/20151204 How to Install Laravel PHP Framework on CentOS 7 or Ubuntu 15.04.md (80%) diff --git a/translated/tech/20151204 How to Install Laravel PHP Framework on CentOS 7 or Ubuntu 15.04.md b/published/20151204 How to Install Laravel PHP Framework on CentOS 7 or Ubuntu 15.04.md similarity index 80% rename from translated/tech/20151204 How to Install Laravel PHP Framework on CentOS 7 or Ubuntu 15.04.md rename to published/20151204 How to Install Laravel PHP Framework on CentOS 7 or Ubuntu 15.04.md index fe8da81be3..5b60ec5f1a 100644 --- a/translated/tech/20151204 How to Install Laravel PHP Framework on CentOS 7 or Ubuntu 15.04.md +++ b/published/20151204 How to Install Laravel PHP Framework on CentOS 7 or Ubuntu 15.04.md @@ -1,7 +1,7 @@ - 如何在 CentOS 7 / Ubuntu 15.04 上安装 PHP 框架 Laravel ================================================================================ -大家好,这篇文章将要讲述如何在 CentOS 7 / Ubuntu 15.04 上安装 Laravel。如果你是一个 PHP Web 的开发者,你并不需要关心各种琳琅满目的现代 PHP 框架,Laravel 是最轻松启动和运行的,它省时省力,能让你享受到 web 开发的乐趣。Laravel 信奉着一个普世的开发哲学,作为一个好的框架它为你提供了高度优先权,让你在简单的使用指导下创建出可维护代码,你应该保持着高速的开发效率,能够随时毫不畏惧更改你的代码来打破现有功能。 + +大家好,这篇文章将要讲述如何在 CentOS 7 / Ubuntu 15.04 上安装 Laravel。如果你是一个 PHP Web 的开发者,你并不需要考虑如何在琳琅满目的现代 PHP 框架中选择,Laravel 是最轻松启动和运行的,它省时省力,能让你享受到 web 开发的乐趣。Laravel 信奉着一个普世的开发哲学,通过简单的指导创建出可维护代码具有最高优先级,你将保持着高速的开发效率,能够随时毫不畏惧更改你的代码来改进现有功能。 Laravel 安装并不繁琐,你只要跟着本文章一步步操作就能在 CentOS 7 或者 Ubuntu 15 服务器上安装。 @@ -15,13 +15,9 @@ Laravel 安装并不繁琐,你只要跟着本文章一步步操作就能在 Ce # yum install epel-release ----------- - # rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm # rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm ----------- - # yum update #### Ubuntu #### @@ -29,23 +25,19 @@ Laravel 安装并不繁琐,你只要跟着本文章一步步操作就能在 Ce # apt-get install python-software-properties # add-apt-repository ppa:ondrej/php5 ----------- - # apt-get update ----------- - # apt-get install -y php5 mcrypt php5-mcrypt php5-gd ### 2) 防火墙安装 ### -系统防火墙和 SELinux 设置对于用于产品应用安全来说非常重要,当你使用测试服务器的时候可以关闭防火墙,用以下命令行设置 SELinux 成宽容模式(permissive)模式来保证安装程序不受它们的影响。 +系统防火墙和 SELinux 设置对于用于产品应用安全来说非常重要,当你使用测试服务器的时候可以关闭防火墙,用以下命令行设置 SELinux 成宽容模式(permissive)来保证安装程序不受它们的影响。 # setenforce 0 ### 3) Apache, MariaDB, PHP 安装 ### -Laravel 安装程序需要完成安装 LAMP 整个环境,需要额外安装 OpenSSL、PDO,Mbstring 和 Tokenizer PHP Extensions。如果 LAMP 已经运行在你的服务器上你可以跳过这一步,直接确认一些必要的 PHP 插件是否安装好。 +Laravel 安装程序需要完成安装 LAMP 整个环境,需要额外安装 OpenSSL、PDO,Mbstring 和 Tokenizer 等 PHP 扩展。如果 LAMP 已经运行在你的服务器上你可以跳过这一步,直接确认一些必要的 PHP 插件是否安装好。 要安装完整 AMP 你需要在自己的服务器上运行以下命令。 @@ -58,8 +50,6 @@ Laravel 安装程序需要完成安装 LAMP 整个环境,需要额外安装 Op # systemctl start httpd # systemctl enable httpd ----------- - #systemctl start mysqld #systemctl enable mysqld @@ -73,7 +63,7 @@ Laravel 安装程序需要完成安装 LAMP 整个环境,需要额外安装 Op ### 4) 安装 Composer ### -在我们安装 Laravel 前,先让我们开始安装 composer。安装 composer 对于安装 Laravel 是最重要的步骤之一,因为 composer 能帮我们安装 Laravel 的各种依赖。 +在我们安装 Laravel 前,先让我们开始安装 composer。安装 composer 是安装 Laravel 的最重要步骤之一,因为 composer 能帮我们安装 Laravel 的各种依赖。 #### CentOS/Ubuntu #### @@ -95,8 +85,6 @@ Laravel 安装程序需要完成安装 LAMP 整个环境,需要额外安装 Op # unzip develop.zip ----------- - # mv laravel-develop /var/www/ 现在使用 compose 命令来安装目录下所有 Laravel 所需要的依赖。 @@ -120,17 +108,15 @@ Laravel 安装程序需要完成安装 LAMP 整个环境,需要额外安装 Op ![Key encryption](http://blog.linoxide.com/wp-content/uploads/2015/11/45.png) -### 7) 虚拟 Host 和 所属用户 ### +### 7) 虚拟主机和所属用户 ### 在 composer 安装好后,分配 document 根目录的权限和所属用户,如下所示。 # chmod 775 /var/www/laravel-develop/app/storage ----------- - # chown -R apache:apache /var/www/laravel-develop -用任意一款编辑器打开 apache 服务器的默认配置文件,在文件最后加上虚拟 host 入口。 +用任意一款编辑器打开 apache 服务器的默认配置文件,在文件最后加上虚拟主机配置。 # vim /etc/httpd/conf/httpd.conf @@ -155,13 +141,15 @@ Laravel 安装程序需要完成安装 LAMP 整个环境,需要额外安装 Op ### 8) Laravel 5 网络访问 ### -打开浏览器然后输入你配置的 IP 地址或者绝对域名(Fully qualified domain name)你将会看到 Laravel 5 的默认页面。 +打开浏览器然后输入你配置的 IP 地址或者完整域名(Fully qualified domain name)你将会看到 Laravel 5 的默认页面。 ![Laravel Default](http://blog.linoxide.com/wp-content/uploads/2015/11/35.png) ### 总结 ### -Laravel 框架对于开发网页应用来说是一个绝好的的工具。所以,看了这篇文章你将学会在 Ubuntu 15 和 CentOS 7 上安装 Laravel, 之后你就可以使用这个超棒的PHP框架提供的各种功能和舒适便捷性来进行你的开发工作。如果您有什么意见或者建议请在以下评论区中回复,我们将根据您宝贵的反馈来使我们的文章更加浅显易懂。 +Laravel 框架对于开发网页应用来说是一个绝好的的工具。所以,看了这篇文章你将学会在 Ubuntu 15 和 CentOS 7 上安装 Laravel, 之后你就可以使用这个超棒的 PHP 框架提供的各种功能和舒适便捷性来进行你的开发工作。 + +如果您有什么意见或者建议请在以下评论区中回复,我们将根据您宝贵的反馈来使我们的文章更加浅显易懂。 -------------------------------------------------------------------------------- From c607a359687a93d330991e050b8aeaa88af5409e Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 5 Jan 2016 22:38:48 +0800 Subject: [PATCH 0152/1469] PUB:20151123 Assign Multiple IP Addresses To One Interface On Ubuntu 15.10 @ictlyh --- ...le IP Addresses To One Interface On Ubuntu 15.10.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename {translated/tech => published}/20151123 Assign Multiple IP Addresses To One Interface On Ubuntu 15.10.md (95%) diff --git a/translated/tech/20151123 Assign Multiple IP Addresses To One Interface On Ubuntu 15.10.md b/published/20151123 Assign Multiple IP Addresses To One Interface On Ubuntu 15.10.md similarity index 95% rename from translated/tech/20151123 Assign Multiple IP Addresses To One Interface On Ubuntu 15.10.md rename to published/20151123 Assign Multiple IP Addresses To One Interface On Ubuntu 15.10.md index 5c35da569b..9c1465d255 100644 --- a/translated/tech/20151123 Assign Multiple IP Addresses To One Interface On Ubuntu 15.10.md +++ b/published/20151123 Assign Multiple IP Addresses To One Interface On Ubuntu 15.10.md @@ -1,5 +1,6 @@ 在 Ubuntu 15.10 上为单个网卡设置多个 IP 地址 ================================================================================ + 有时候你可能想在你的网卡上使用多个 IP 地址。遇到这种情况你会怎么办呢?买一个新的网卡并分配一个新的 IP?不,没有这个必要(至少在小型网络中)。现在我们可以在 Ubuntu 系统中为一个网卡分配多个 IP 地址。想知道怎么做到的?跟着我往下看,其实并不难。 这个方法也适用于 Debian 以及它的衍生版本。 @@ -138,7 +139,7 @@ Ubuntu 系统的网卡配置文件是 **/etc/network/interfaces**。 sudo nano /etc/network/interfaces -按照黑色字体标注的添加额外的 IP 地址。 +如下添加额外的 IP 地址。 # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). @@ -217,10 +218,9 @@ Ubuntu 系统的网卡配置文件是 **/etc/network/interfaces**。 想知道怎么给 CentOS/RHEL/Scientific Linux/Fedora 系统添加额外的 IP 地址,可以点击下面的链接。 -注:此篇文章以前做过选题:20150205 Linux Basics--Assign Multiple IP Addresses To Single Network Interface Card On CentOS 7.md -- [Assign Multiple IP Addresses To Single Network Interface Card On CentOS 7][1] +- [在CentOS 7上给一个网卡分配多个IP地址][1] -周末愉快! +工作愉快! -------------------------------------------------------------------------------- @@ -233,4 +233,4 @@ via: http://www.unixmen.com/assign-multiple-ip-addresses-to-one-interface-on-ubu 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://www.unixmen.com/author/sk/ -[1]:http://www.unixmen.com/linux-basics-assign-multiple-ip-addresses-single-network-interface-card-centos-7/ +[1]:https://linux.cn/article-5127-1.html From 94cf047807dc9d5852e7f1fd29ca6cf9acffba96 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 5 Jan 2016 23:16:24 +0800 Subject: [PATCH 0153/1469] PUB:20151123 How to Configure Apache Solr on Ubuntu 14 or 15 @taichirain --- ...onfigure Apache Solr on Ubuntu 14 or 15.md | 131 +++++++++++++++++ ...onfigure Apache Solr on Ubuntu 14 or 15.md | 134 ------------------ 2 files changed, 131 insertions(+), 134 deletions(-) create mode 100644 published/20151123 How to Configure Apache Solr on Ubuntu 14 or 15.md delete mode 100644 translated/tech/20151123 How to Configure Apache Solr on Ubuntu 14 or 15.md diff --git a/published/20151123 How to Configure Apache Solr on Ubuntu 14 or 15.md b/published/20151123 How to Configure Apache Solr on Ubuntu 14 or 15.md new file mode 100644 index 0000000000..2f934be732 --- /dev/null +++ b/published/20151123 How to Configure Apache Solr on Ubuntu 14 or 15.md @@ -0,0 +1,131 @@ +如何在 Ubuntu 14/15 上配置 Apache Solr +================================================================================ + +大家好,欢迎来阅读我们今天这篇 Apache Solr 的文章。简单的来说,Apache Solr 是一个最负盛名的开源搜索平台,配合运行在网站后端的 Apache Lucene,能够让你轻松创建搜索引擎来搜索网站、数据库和文件。它能够索引和搜索多个网站并根据搜索文本的相关内容返回搜索建议。 + +Solr 使用 HTTP 可扩展标记语言(XML),可以为 JSON、Python 和 Ruby 等提供应用程序接口(API)。根据Apache Lucene 项目所述,Solr 提供了非常多的功能,很受管理员们的欢迎: + +- 全文检索 +- 分面导航(Faceted Navigation) +- 拼写建议/自动完成 +- 自定义文档排序/排列 + +#### 前提条件: #### + +在一个使用最小化安装包的全新 Ubuntu 14/15 系统上,你仅仅需要少量的准备,就开始安装 Apache Solor. + +### 1)System Update 系统更新### + +使用一个具有 sudo 权限的非 root 用户登录你的 Ubuntu 服务器,在接下来的所有安装和使用 Solr 的步骤中都会使用它。 + +登录成功后,使用下面的命令,升级你的系统到最新的更新及补丁: + + $ sudo apt-get update + +### 2) 安装 JRE### + +要安装 Solr,首先需要安装 JRE(Java Runtime Environment)作为基础环境,因为 solr 和 tomcat 都是基于Java.所以,我们需要安装最新版的 Java 并配置 Java 本地环境. + +要想安装最新版的 Java 8,我们需要通过以下命令安装 Python Software Properties 工具包 + + $ sudo apt-get install python-software-properties + +完成后,配置最新版 Java 8的仓库 + + $ sudo add-apt-repository ppa:webupd8team/java + +现在你可以通过以下命令更新包源列表,使用‘apt-get’来安装最新版本的 Oracle Java 8。 + + $ sudo apt-get update + + $ sudo apt-get install oracle-java8-installer + +在安装和配置过程中,点击'OK'按钮接受 Java SE Platform 和 JavaFX 的 Oracle 二进制代码许可协议(Oracle Binary Code License Agreement)。 + +在安装完成后,运行下面的命令,检查是否安装成功以及查看安装的版本。 + + kash@solr:~$ java -version + java version "1.8.0_66" + Java(TM) SE Runtime Environment (build 1.8.0_66-b17) + Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode) + +执行结果表明我们已经成功安装了 Java,并达到安装 Solr 最基本的要求了,接着我们进行下一步。 + +### 安装 Solr### + +有两种不同的方式可以在 Ubuntu 上安装 Solr,在本文中我们只用最新的源码包来演示源码安装。 + +要使用源码安装 Solr,先要从[官网][1]下载最新的可用安装包。复制以下链接,然后使用 'wget' 命令来下载。 + + $ wget http://www.us.apache.org/dist/lucene/solr/5.3.1/solr-5.3.1.tgz + +运行下面的命令,将这个已归档的服务解压到 /bin 目录。 + + $ tar -xzf solr-5.3.1.tgz solr-5.3.1/bin/install_solr_service.sh --strip-components=2 + +运行脚本来启动 Solr 服务,这将会先创建一个 solr 的用户,然后将 Solr 安装成服务。 + + $ sudo bash ./install_solr_service.sh solr-5.3.1.tgz + +![Solr 安装](http://blog.linoxide.com/wp-content/uploads/2015/11/12.png) + +使用下面的命令来检查 Solr 服务的状态。 + + $ service solr status + +![Solr 状态](http://blog.linoxide.com/wp-content/uploads/2015/11/22.png) + +### 创建 Solr 集合: ### + +我们现在可以使用 Solr 用户添加多个集合。就像下图所示的那样,我们只需要在命令行中指定集合名称和指定其配置集就可以创建多个集合了。 + + $ sudo su - solr -c "/opt/solr/bin/solr create -c myfirstcollection -n data_driven_schema_configs" + +![创建集合](http://blog.linoxide.com/wp-content/uploads/2015/11/32.png) + +我们已经成功的为我们的第一个集合创建了新核心实例目录,并可以将数据添加到里面。要查看库中的默认模式文件,可以在这里找到: '/opt/solr/server/solr/configsets/data_driven_schema_configs/conf' 。 + +### 使用 Solr Web### + +可以使用默认的端口8983连接 Apache Solr。打开浏览器,输入 http://your\_server\_ip:8983/solr 或者 http://your-domain.com:8983/solr. 确保你的防火墙允许8983端口. + + http://172.25.10.171:8983/solr/ + +![Web访问Solr](http://blog.linoxide.com/wp-content/uploads/2015/11/42.png) + +在 Solr 的 Web 控制台左侧菜单点击 'Core Admin' 按钮,你将会看见我们之前使用命令行方式创建的集合。你可以点击 'Add Core' 按钮来创建新的核心。 + +![添加核心](http://blog.linoxide.com/wp-content/uploads/2015/11/52.png) + +就像下图中所示,你可以选择某个集合并指向文档来向里面添加内容或从文档中查询数据。如下显示的那样添加指定格式的数据。 + + { + "number": 1, + "Name": "George Washington", + "birth_year": 1989, + "Starting_Job": 2002, + "End_Job": "2009-04-30", + "Qualification": "Graduation", + "skills": "Linux and Virtualization" + } + +添加文件后点击 'Submit Document'按钮. + +![添加文档](http://blog.linoxide.com/wp-content/uploads/2015/11/62.png) + +### 总结### + +在 Ubuntu 上安装成功后,你就可以使用 Solr Web 接口插入或查询数据。如果你想通过 Solr 来管理更多的数据和文件,可以创建更多的集合。希望你能喜欢这篇文章并且希望它能够帮到你。 + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/ubuntu-how-to/configure-apache-solr-ubuntu-14-15/ + +作者:[Kashif][a] +译者:[taichirain](https://github.com/taichirain) +校对:[Caroline](https://github.com/carolinewuyan) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/kashifs/ +[1]:http://lucene.apache.org/solr/ diff --git a/translated/tech/20151123 How to Configure Apache Solr on Ubuntu 14 or 15.md b/translated/tech/20151123 How to Configure Apache Solr on Ubuntu 14 or 15.md deleted file mode 100644 index e6f3f05552..0000000000 --- a/translated/tech/20151123 How to Configure Apache Solr on Ubuntu 14 or 15.md +++ /dev/null @@ -1,134 +0,0 @@ - -如何在Ubuntu 14/15上配置Apache Solr -================================================================================ -大家好,欢迎来阅读我们今天Apache Solr的文章。Apache Solr是一个最有名的开源搜索平台,基于在网站后端运行的Apache Lucene,能够让你轻松创建搜索引擎来搜索网站、数据库和文件。它能够索引和搜索多个网站并根据搜索文本的相关内容返回搜索建议. - -Solr工作在可扩展标记语言(XML),并可以为JSON、Python和Ruby提供应用程序接口(APIs)。根据Apache Lucene项目,Solr提供了非常多的功能,让它很受管理员们的欢迎: -- 全文检索 -- 分面导航 -- 拼写建议/自动完成 -- 自定义文档排序/排列 - -#### 前提条件: #### - -在一个使用最小化安装包的全新 Ubuntu 14/15 系统上,你仅仅需要少量的准备,就开始安装 Apache Solor. - -### 1)System Update 系统更新### - -使用一个具有sudo权限的非root用户登录你的Ubuntu服务器,这将会在接下来的所有安装和使用Solr的步骤中使用。 - -登录成功后,使用下面的命令,升级你的系统到最新的更新及补丁 - - $ sudo apt-get update - -### 2) JRE Setup 安装JRE### - -要安装Solr,首先需要安装JRE(Java Runtime Environment)作为基础环境,因为solr和tomcat都是基于Java.所以,我们需要安装最新版的Java和配置Java本地环境. - -要想安装最新版的Java 8,我们需要通过以下命令安装Python Software Properties工具包 - - $ sudo apt-get install python-software-properties - -完成后,配置最新版Java 8的仓库 - - $ sudo add-apt-repository ppa:webupd8team/java - -现在你可以通过以下命令更新包源列表,使用‘wget’来安装最新版本的Oracle Java 8,然后安装Java。 - - $ sudo apt-get update - ----------- - - $ sudo apt-get install oracle-java8-installer - -在安装和配置Java SE Platform 和 JavaFX 过程中点击'OK'按钮接受 Oracle二进制代码许可协议(Oracle Binary Code License Agreement)。 - -在安装完成后,运行下面的命令,检查是否安装成功以及查看安装的版本。 - - kash@solr:~$ java -version - java version "1.8.0_66" - Java(TM) SE Runtime Environment (build 1.8.0_66-b17) - Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode) - -执行结果表明我们已经成功安装了Java,并达到安装Solr最基本的要求了,接着我们进行下一步。 - -### 安装Solr### - -有两种不同的方式可以在Ubuntu上安装Solr,在本文中我们只用最新的源码包来演示源码安装。 - -要使用源码安装Solr,先要从官网 [Web Page][1] 下载最新的可用安装包。复制以下链接,然后使用 'wget'命令来下载。 - - $ wget http://www.us.apache.org/dist/lucene/solr/5.3.1/solr-5.3.1.tgz - -运行下面的命令,将已存档的服务解压到 /bin目录。 - - $ tar -xzf solr-5.3.1.tgz solr-5.3.1/bin/install_solr_service.sh --strip-components=2 - - -运行脚本来启动Solr服务,这将会先创建一个solr的用户,然后将Solr安装成服务。 - - $ sudo bash ./install_solr_service.sh solr-5.3.1.tgz - -![Solr 安装](http://blog.linoxide.com/wp-content/uploads/2015/11/12.png) - -使用下面的命令来检查Solr服务的状态。 - - $ service solr status - -![Solr 状态](http://blog.linoxide.com/wp-content/uploads/2015/11/22.png) - -### 创建Solr集合: ### - -我们现在可以使用Solr用户添加多个集合。就像下图所示的那样,我们只需要在命令行中指定集合名称和指定其配置集就可以创建多个集合了。 - - $ sudo su - solr -c "/opt/solr/bin/solr create -c myfirstcollection -n data_driven_schema_configs" - -![创建集合](http://blog.linoxide.com/wp-content/uploads/2015/11/32.png) - -我们已经成功的为我们的第一个集合创建了新的内核实例目录,并可以将数据添加到里面。 -查看库中的默认模式文件 '/opt/solr/server/solr/configsets/data_driven_schema_configs/conf' - -### 使用Solr页面### - -可以使用默认的端口8983连接Apache Solr.打开浏览器,输入 http://your_server_ip:8983/solr 或者 http://your-domain.com:8983/solr. 确保你的防火墙允许8983端口. - - http://172.25.10.171:8983/solr/ - -![Web访问Solr](http://blog.linoxide.com/wp-content/uploads/2015/11/42.png) - -在Solr的Web控制台左侧菜单点击'Core Admin'按钮,你将会看见我们之前使用CLI方式创建的集合。你可以点击'Add Core'按钮来创建新的内核。 - -![添加核心](http://blog.linoxide.com/wp-content/uploads/2015/11/52.png) - -就像下图中所示,你可以选择某个集合和指向文档向里面添加内容或从文档中查询数据。像方框中显示的那样添加指定格式的数据。 - - { - "number": 1, - "Name": "George Washington", - "birth_year": 1989, - "Starting_Job": 2002, - "End_Job": "2009-04-30", - "Qualification": "Graduation", - "skills": "Linux and Virtualization" - } - -添加文件后点击'Submit Document'按钮. - -![添加文档](http://blog.linoxide.com/wp-content/uploads/2015/11/62.png) - -### 总结### - -在Ubuntu上安装成功后,你就可以使用Solr WEB接口插入或查询数据。如果你想通过Solr来管理更多的数据和文件,可以创建更多的集合。希望你能喜欢这篇文章并且希望它能够帮到你。 - --------------------------------------------------------------------------------- - -via: http://linoxide.com/ubuntu-how-to/configure-apache-solr-ubuntu-14-15/ - -作者:[Kashif][a] -译者:[taichirain](https://github.com/taichirain) -校对:[Caroline](https://github.com/carolinewuyan) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/kashifs/ -[1]:http://lucene.apache.org/solr/ From 9a9de0be12f8e21da859476cad6ef9ac048517cc Mon Sep 17 00:00:00 2001 From: sevenot Date: Wed, 6 Jan 2016 08:55:58 +0800 Subject: [PATCH 0154/1469] =?UTF-8?q?=E6=92=A4=E9=94=80=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...r Using Windows 10 After More than 8 Years--See Comparison.md | 1 - 1 file changed, 1 deletion(-) 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 index 22a0acdbf1..702783b6b0 100644 --- 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 @@ -1,4 +1,3 @@ -sevenot translating 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. From 0353bd29faeeb683e6c974a8669fab9a72dbf138 Mon Sep 17 00:00:00 2001 From: "Fuliang.Li" Date: Wed, 6 Jan 2016 16:01:23 +0800 Subject: [PATCH 0155/1469] =?UTF-8?q?[=E7=BF=BB=E5=AE=8C=E6=88=90=E8=AF=91?= =?UTF-8?q?]=2020150921=2014=20tips=20for=20teaching=20open=20source=20dev?= =?UTF-8?q?elopment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【翻完成译】 开源代码开发的十四点教学技巧 --- ...ps for teaching open source development.md | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 translated/talk/20150921 14 tips for teaching open source development.md diff --git a/translated/talk/20150921 14 tips for teaching open source development.md b/translated/talk/20150921 14 tips for teaching open source development.md new file mode 100644 index 0000000000..aef6304789 --- /dev/null +++ b/translated/talk/20150921 14 tips for teaching open source development.md @@ -0,0 +1,75 @@ +GHLandy Translated + +开源代码开发的十四点教学技巧 +================================================================================ + +对于培养和塑造开源代码开发者,学术界就是一个很好的平台。研究中发现,我们偶尔会开源自己编写的软件。这样做有两个理由,一是为了提升自己编写的工具的使用率,二是为了了解人们使用这些工具时会遇到哪些问题。在这样一个编写研究软件的背景下,我的任务就是为 Bradford 大学重新设计二年级的软件工程课程。 + +这是一个巨大的挑战,因为我所面对的 80 个学生是来自不同专业的,包括 IT、商务计算和软件工程,这些学生将要在一起上课。最有难度的是,需要和这些编程经验差距很大的学生一起编写代码。按照传统,该课程允许学生选择自己的小组,然后布置他们构建一个存储数据库系统构的任务,最后提交报告作为评估的一部分。 + +而我决定重新设计课程,让学生了解现实中的软件团队是如何协作的过程。根据学生的专业和编程技能,我将他们分为五六个人一组。这是为了确保每个小组的整体水平相当,避免小组之间的不公平。 + +### 核心课程 ### + +课程的形式升级为文化课和实践课两项结合在一起。然而实践部分只是充当辅助,主要是老师监督各个小组的实践进度以及他们如何处理客户和产品之间的关系。传统的教学方式由项目管理、软件测试、工程需求分析以及类似主题的讲座组成,再辅以实践和导师会议。这些会议可以很好的考核学生的水平以及检测出他们是否可以跟得上我们在讲座部分中的软件工程方法。本年的教学主题包括以下内容: + +- 工程需求分析 +- 如何与客户及其他团队成员互动 +- 程序设计方法,如敏捷和极限编程方法 +- 如何通过学习不同的软件工程方法进行短期的水平提高 +- 小组会议及文档编写 +- 项目管理及项目进展图表 +- UML 图表及系统描述 +- 使用 Git 来进行代码的版本控制 +- 软件测试及 BUG 跟踪 +- 使用开源库 +- 开源代码许可及其选择 +- 软件分发 + +在这些讲座之后,我会有一些来自世界各地的嘉宾为我们说说他们在软件分发过程中的经验。我们也设法请来大学里知识产权律师谈关于软件在英国的知识产权问题,以及如何处理软件的知识产权问题。 + +### 协作工具 ### + +为了让上述教学内容的顺利进行,我们将会介绍一些工具,并训练学生在他们的项目中使用这些工具。如下: + +- Google Drive:团队与导师之间进行共享的工具,暂时存储用于描述项目的文档和图表、需求收集、会议纪要以及项目跟踪等信息。采取这样一个方式来监控并提供直接反馈到每个团队,是非常有效的。 +- [Basecamp][1]:同样是用于分享文档,在随后的课程中,我们可能会考虑用它取代 Google Drive。 +- BUG 报告工具,如 [Mantis][2]:只能让有限的用户自由提交 BUG。稍后我们提到的 Git 可以让小组内的所有人员用做 BUG 提交。 +- 远程视频会议工具:在人员不在校内,甚至去了其他城市的情况下使用。学生们可以定期通过 Skype 来交流并记录会议内容或则进行录音作为今后其他用处。 +- 同时,学生们的项目中还会用到大量的开源工具包。他们可以根据自己小组的项目需求来选择自己使用的工具包和编程语言。唯一的条件是,这些项目必须开源,最后成果可以安装到大学里的实验室,并且大多的研究人员都支持这个条件。 +- 最后,所有团队必须向客户交付他们的项目,包括完整的工作版本的软件、文档和他们自己选择的开放源码许可。大多数的团队选择了 GPLv3 许可证。 + +### 技巧和经验教训 ### + +在最后,这一年过的很愉快,并且所有学生的项目都做的非常棒。这里有一些我学到的经验教训,可能有助于提高明年的课程质量: + +1. 提供各种各样的有趣的选择项目给学生选择。比如说,游戏开发或者移动应用开发以及完成各种目标的项目等。建立普通的数据库系统已经不能提起学生的兴趣了,而参与到有趣的项目中去,学生本身就是自学者,同时可以帮助解决小组成员和小组之间的常见问题。再通过一个消息列表,学生们发表他们在测试中遇到的任何问题,以寻求其他人的帮助建议。然而,这种方法有一个缺点。外部考官建议我们使用统一种类型的项目和统一的编程语言以帮助缩小对学生的评估标准。 +2. 定期给学生在每一个阶段的表现进行反馈。比方说,可以在和各个小组开指导会议的时候、或者每个阶段进行反馈,以帮助他在接下来的工作中自我改进。 +3. 学生更加愿意与校外的客户一起协作。他们期待着与外部公司代表或大学以外的人协作,不过是为了获得新体验而已。与导师进行交流时,他们都能够表现得很专业,这样使得老师非常放心。 +4. 很多团队版开发单元测试的部分放到项目结束之后,从极限编程方法的角度来说,这是一个严重的禁忌。也许测试应包括在不同阶段的评估中,来提醒他们需要与并行开展软件开发和单元测试。 +5. 在这个班的 80 个人里边,仅有 4 个女生,每个女都分在不同的小组里边。我观察到,男生们总是准备充分地承担起领队角色,并将最有趣的代码分配个他们自己来编写,女生则多大遵循安排或则是编写文档。出于某种原因,女生选择不显示权威,即使在女性辅导员鼓励下,她们也不愿编写代码。这仍然是一个需要解决的主要问题。 +6.允许不同风格文项目文档,比方说,UML 图表、状态图或其他形式的。让学生学习这些并与其他课程融汇贯通来提高他们的学习经验。 +7. 学生里边,有些是很好的开发人员,有些做商务计算的则没有多少编程经验。我们要鼓励团队共同努力,避免开发人员做得比那些只做会议记录或文档的其他成员更好的错误认知。我们常在辅导课程中鼓励角色转换,让每个人都有机会学习如何编程。 +8. 各个小组进行导师会议室非常重要的,可以有效监督各个小组进展情况,还可以了解是谁做了大部分工作。通常,没来参加会议的小组成员基本就是没有参与到他们的团队工作中去的,并且通过其他成员提交的工作报告也可以确定哪些人不活跃。 +9. 我们鼓励学生们把许可证附加到项目中去,使用外部库以及和客户协作的时候要表明确切知识产权问题。 这样可让解放学生的思考能力,了解真实的软件交付问题。 +10. 给学生们自己选择技术空间。 +11. 助教是关键。同时管理 80 个显示显然很有难度,特别是需要对他们进行评估的那几周。明年我一定会找个助教来帮我一起管理各个小组。 +12. 实验室的技术支持是非常重要的。大学里的技术支持对于本课程是非常赞同的。学习正在考虑明年将虚拟机分配给每个团队,这样没个团队可以根据需要自行在虚拟机中安装任何软件。 +13. 团队合作,相互帮助。大多数团队自然而然的支持其他团队成员,同时指导人在中间也帮助了不少。 +14. 来自其他技术人员的帮助只能作为辅助方法。作为一个新的学术,我需要从经验中学习,同时当我如何知道学生是,我会通过多个角度来建议学生和小组去尝试处理问。来自高级技术人员的支持对我来说就是一种鼓励。 + +最后,对于作为导师的我以及所有的学生来说,这都是个有趣的课程。在学习目标和传统的分级方案上还有有一些问题需,以解决减少教师的工作量。明年,我计划会保留这种教学模式,并希望能够提出更好的分级方案以及介绍更多的软件来帮助监督项目和控制代码版本。 + +-------------------------------------------------------------------------------- + +via: http://opensource.com/education/15/9/teaching-open-source-development-undergraduates + +作者:[Mariam Kiran][a] +译者:[GHLandy](https://github.com/GHLandy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://opensource.com/users/mariamkiran +[1]:https://basecamp.com/ +[2]:https://www.mantisbt.org/ From ed66e7954440d97d41de62c4dd8ac91cd7fcc3e4 Mon Sep 17 00:00:00 2001 From: "Fuliang.Li" Date: Wed, 6 Jan 2016 16:02:05 +0800 Subject: [PATCH 0156/1469] Delete 20150921 14 tips for teaching open source development.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 完成翻译,译文放在相应位置。 --- ...ps for teaching open source development.md | 74 ------------------- 1 file changed, 74 deletions(-) delete mode 100644 sources/talk/20150921 14 tips for teaching open source development.md diff --git a/sources/talk/20150921 14 tips for teaching open source development.md b/sources/talk/20150921 14 tips for teaching open source development.md deleted file mode 100644 index fb250ac4c6..0000000000 --- a/sources/talk/20150921 14 tips for teaching open source development.md +++ /dev/null @@ -1,74 +0,0 @@ -GHLandy Translating - -14 tips for teaching open source development -================================================================================ -Academia is an excellent platform for training and preparing the open source developers of tomorrow. In research, we occasionally open source software we write. We do this for two reasons. One, to promote the use of the tools we produce. And two, to learn more about the impact and issues other people face when using them. With this background of writing research software, I was tasked with redesigning the undergraduate software engineering course for second-year students at the University of Bradford. - -It was a challenge, as I was faced with 80 students coming for different degrees, including IT, business computing, and software engineering, all in the same course. The hardest part was working with students with a wide range of programming experience levels. Traditionally, the course had involved allowing students to choose their own teams, tasking them with building a garage database system and then submitting a report in the end as part of the assessment. - -I decided to redesign the course to give students insight into the process of working on real-world software teams. I divided the students into teams of five or six, based on their degrees and programming skills. The aim was to have an equal distribution of skills across the teams to prevent any unfair advantage of one team over another. - -### The core lessons ### - -The course format was updated to have both lectures and lab sessions. However, the lab session functioned as mentoring sessions, where instructors visited each team to ask for updates and see how the teams were progressing with the clients and the products. There were traditional lectures on project management, software testing, requirements engineering, and similar topics, supplemented by lab sessions and mentor meetings. These meetings allowed us to check up on students' progress and monitor whether they were following the software engineering methodologies taught in the lecture portion. Topics we taught this year included: - -- Requirements engineering -- How to interact with clients and other team members -- Software methodologies, such as agile and extreme programming approaches -- How to use different software engineering approaches and work through sprints -- Team meetings and documentations -- Project management and Gantt charts -- UML diagrams and system descriptions -- Code revisioning using Git -- Software testing and bug tracking -- Using open source libraries for their tools -- Open source licenses and which one to use -- Software delivery - -Along with these lectures, we had a few guest speakers from the corporate world talk about their practices in software product deliveries. We also managed to get the university’s intellectual property lawyer to come and talk about IP issues surrounding software in the UK, and how to handle any intellectual properties issues in software. - -### Collaboration tools ### - -To make all of the above possible, a number of tools were introduced. Students were trained on how to use them for their projects. These included: - -- Google Drive folders shared within the team and the tutor, to maintain documents and spreadsheets for project descriptions, requirements gathering, meeting minutes, and time tracking of the project. This was an extremely efficient way to monitor and also provide feedback straight into the folders for each team. -- [Basecamp][1] for document sharing as well, and later in the course we considered this as a possible replacement for Google Drive. -- Bug reporting tools such as [Mantis][2] again have a limited users for free reporting. Later Git itself was being used for bug reports n any tools by the testers in the teams -- Remote videoconferencing tools were used as a number of clients were off-campus, and sometimes not even in the same city. The students were regularly using Skype to communicate with them, documenting their meetings and sometimes even recording them for later use. -- A number of open source tool kits were also used for students' projects. The students were allowed to choose their own tool kits and languages based on the requirements of the projects. The only condition was that these have to be open source and could be installed in the university labs, which the technical staff was extremely supportive of. -- In the end all teams had to deliver their projects to the client, including complete working version of the software, documentation, and open source licenses of their own choosing. Most of the teams chose the GPL version 3 license. - -### Tips and lessons learned ### - -In the end, it was a fun year and nearly all students did very well. Here are some of the lessons I learned which may help improve the course next year: - -1. Give the students a wide variety of choice in projects that are interesting, such as game development or mobile application development, and projects with goals. Working with mundane database systems is not going to keep most students interested. Working with interesting projects, most students became self-learners, and were also helping others in their teams and outside to solve some common issues. The course also had a message list, where students were posting any issues they were encountering, in hopes of receiving advice from others. However, there was a drawback to this approach. The external examiners have advised us to go back to a style of one type of project, and one type of language to help narrow the assessment criteria for the students. -1. Give students regular feedback on their performance at every stage. This could be done during the mentoring meetings with the teams, or at other stages, to help them improve the work for next time. -1. Students are more than willing to work with clients from outside university! They look forward to working with external company representatives or people outside the university, just because of the new experience. They were all able to display professional behavior when interacting with their mentors, which put the instructors at ease. -1. A lot of teams left developing unit testing until the end of the project, which from an extreme programming methodology standpoint was a serious no-no. Maybe testing should be included at the assessments of the various stages to help remind students that they need to be developing unit tests in parallel with the software. -1. In the class of 80, there were only four girls, each working in different teams. I observed that boys were very ready to take on roles as team leads, assigning the most interesting code pieces to themselves and the girls were mostly following instructions or doing documentation. For some reason, the girls choose not to show authority or preferred not to code even when they were encouraged by a female instructor. This is still a major issue that needs to be addressed. -1. There are different styles of documentation such as using UML, state diagrams, and others. Allow students to learn them all and merge with other courses during the year to improve their learning experience. -1. Some students were very good developers, but some doing business computing had very little coding experience. The teams were encouraged to work together to prevent the idea that developer would get better marks than other team members if they were only doing meeting minutes or documentations. Roles were also encouraged to be rotated during mentoring sessions to see that everyone was getting a chance to learn how to program. -1. Allowing the team to meet with the mentor every week was helpful in monitoring team activities. It also showed who was doing the most work. Usually students who were not participating in their groups would not come to meetings, and could be identified by the work being presented by other members every week. -1. We encouraged students to attach licenses to their work and identify intellectual property issues when working with external libraries and clients. This allowed students to think out of the box and learn about real-world software delivery problems. -1. Give students room to choose their own technologies. -1. Having teaching assistants is key. Managing 80 students was very difficult, especially on the weeks when they were being assessed. Next year I would definitely have teaching assistants helping me with the teams. -1. A supportive tech support for the lab is very important. The university tech support was extremely supportive of the course. Next year, they are talking about having virtual machines assigned to teams, so the teams can install any software on their own virtual machine as needed. -1. Teamwork helps. Most teams exhibited a supportive nature to other team members, and mentoring also helped. -1. Additional support from other staff members is a plus. As a new academic, I needed to learn from experience and also seek advice at multiple points on how to handle certain students and teams if I was confused on how to engage them with the course. Support from senior staff members was very encouraging to me. - -In the end, it was a fun course—not only for the me as an instructor, but for the students as well. There were some issues with learning objectives and traditional grading schemes that still need to be ironed out to reduce the workload it produced on the instructors. For next year, I plan to keep this same format, but hope to come up with a better grading scheme and introduce more software tools that can help monitor project activities and code revisions. - --------------------------------------------------------------------------------- - -via: http://opensource.com/education/15/9/teaching-open-source-development-undergraduates - -作者:[Mariam Kiran][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/mariamkiran -[1]:https://basecamp.com/ -[2]:https://www.mantisbt.org/ From 8e9f7304e048e221c0dd25f073717c7abc6bb696 Mon Sep 17 00:00:00 2001 From: Feng Wei Date: Wed, 6 Jan 2016 23:41:49 +0800 Subject: [PATCH 0157/1469] Update 20160104 What is good stock portfolio management software on Linux.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 申领任务 --- ... What is good stock portfolio management software on Linux.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160104 What is good stock portfolio management software on Linux.md b/sources/tech/20160104 What is good stock portfolio management software on Linux.md index 258cf104fc..b7c372ce71 100644 --- a/sources/tech/20160104 What is good stock portfolio management software on Linux.md +++ b/sources/tech/20160104 What is good stock portfolio management software on Linux.md @@ -1,3 +1,4 @@ +translating by fw8899 What is good stock portfolio management software on Linux ================================================================================ If you are investing in the stock market, you probably understand the importance of a sound portfolio management plan. The goal of portfolio management is to come up with the best investment plan tailored for you, considering your risk tolerance, time horizon and financial goals. Given its importance, no wonder there are no shortage of commercial portfolio management apps and stock market monitoring software, each touting various sophisticated portfolio performance tracking and reporting capabilities. From a1511399316d334594d75452d7ac380b8a10423d Mon Sep 17 00:00:00 2001 From: SonoFelice Date: Thu, 7 Jan 2016 00:01:05 +0800 Subject: [PATCH 0158/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译中 --- ...Information on Linux Using Command Line.md | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/sources/tech/20160104 How to Check Hardware Information on Linux Using Command Line.md b/sources/tech/20160104 How to Check Hardware Information on Linux Using Command Line.md index c793db21b2..29ec43f74b 100644 --- a/sources/tech/20160104 How to Check Hardware Information on Linux Using Command Line.md +++ b/sources/tech/20160104 How to Check Hardware Information on Linux Using Command Line.md @@ -1,82 +1,102 @@ sonofelice translating +Linux系统下使用命令行来查看硬件信息 How to Check Hardware Information on Linux Using Command Line ================================================================================ ![](https://maketecheasier-holisticmedia.netdna-ssl.com/assets/uploads/2015/12/hdd_info_featured-1.png) +有许多可用的命令可以用来查看Linux系统上的硬件信息。有些命令只能够打印出像CPU和内存这一特定的硬件组件信息,其余的命令可以查看其余硬件单元的信息。 + There are many commands available to check hardware information of your Linux system. Some commands report only specific hardware components like CPU or memory while the rest cover multiple hardware units. -This tutorial takes a quick look at some of the most commonly used commands to check information and configuration details about various hardware devices. +这个教程可以带大家快速学习一下核查各种硬件设备的信息和配置详情的最常用的命令。 +This tutorial takes a quick look at some of the most commonly used commands to check information and configuration details about various hardware devices. ### lscpu ### +`lscpu`命令能够查看CPU和处理单元的信息。该命令没有任何其他选项或者别的功能。 The `lscpu` command gives you information about the CPU and processing units. It does not have any other options or functionality. lscpu +运行该命令会看到下面输出: You will see the following output by running the above command. ![hdd_info_lscpu](https://www.maketecheasier.com/assets/uploads/2015/12/hdd_info_lscpu.png) ### lspci ### +`lspci`是另一个命令行工具,可以用来列出所有的PCI总线,还有与PCI总线相连的设备的详细信息,比如VGA适配器、显卡、网络适配器、usb端口、SATA控制器等。 The lspci is another command line tool that lists all the PCI buses and details about the devices connected to them like VGA adapter, graphics card, network adapter, usb ports, SATA controller, etc. lspci +你可以看到类似下图的输出信息。 You will see an output similar to the following image. ![hdd_info_lspci](https://www.maketecheasier.com/assets/uploads/2015/12/hdd_info_lspci-1.png) +可以通过运行下面的命令来过滤出特定的设备的信息。 You can also filter out specific device information by running the following command: lspci -v | grep "VGA" -A 12 +运行上面的命令可以看到类似下图的关于显卡的信息。 You will see graphics card information similar to the following. ![hdd_info_lspci_vga](https://www.maketecheasier.com/assets/uploads/2015/12/hdd_info_lspci_vga.png) ### lshw ### +`lshw`是一个通用的工具,可以列出多种硬件单元的详细或者概要的信息,比如CPU、内存、usb控制器、硬盘等。`lshw`能够从不同的“/proc”文件中提取出相关的信息。 The `lshw` is a general purpose utility that reports detailed and brief information about multiple hardware units like CPU, memory, usb controller, disk, etc. Lshw extracts the information from different “/proc” files. lshw -short +通过运行上面的命令可以看到下面的信息。 You will see the following information by running the above command. ![hdd_info_lshw](https://www.maketecheasier.com/assets/uploads/2015/12/hdd_info_lshw.png) ### lsscsi ### +通过运行下面的命令可以列出像硬盘和光驱等scsi/sata设备的信息: You can list all scsi/sata devices like hard drives and optical drives by running the following command: lsscsi +会得到类似下面的输出。 The output wI’ll look something like this image. ![hdd_info_lsscsi](https://www.maketecheasier.com/assets/uploads/2015/12/hdd_info_lsscsi-1.png) ### lsusb ### +`lsusb`命令能够列出USB控制器和与USB控制相连的设备的详细信息。默认情况下,`lsusb`命令只打印出概要信息。可以通过使用-v参数打印每一个usb端口的详细信息。 This command shows you the USB controllers and details about devices connected to them. By default, the lsusb command prints brief information. You can also use the verbose option -v to print detailed information about each usb port. lsusb +可以看到下面输出。 You will see the following output. ![hdd_info_lsusb](https://www.maketecheasier.com/assets/uploads/2015/12/hdd_info_lsusb.png) ### Inxi ### +`Inxi`是一个bash脚本,能够从系统的多个源文件和命令行抓取硬件信息,并打印出一个非技术人员也能看懂的友好的报告。 `Inxi` is a bash script that fetches hardware information from multiple sources and commands on the system and gives you goodlooking reports that non-technical users can read easily. +默认情况下,Ubuntu上没有安装`inxi`。可以通过运行下面命令来安装`Inxi`: By default, `inxi` is not installed in Ubuntu. You can install it by running the following command: sudo apt-get install inxi +安装完`Inxi`之后,通过运行下面命令能够得到硬件相关的信息: After installing inxi, you can get hardware information by running the following command: inxi -Fx +能够得到类似下图的输出。 You will see an output similar to the image below. ![hdd_info_inxi](https://www.maketecheasier.com/assets/uploads/2015/12/hdd_info_inxi.jpg) @@ -84,10 +104,12 @@ You will see an output similar to the image below. ### df ### This command gives you brief information about various partitions, their mount points and the used and available space on each. +可以在使用`df`命令的时候加上`-H`参数。 You can run the `df` command with the `-H` parameter. df -H +会得到下面的输出。 You will see the following output. ![hdd_info_df](https://www.maketecheasier.com/assets/uploads/2015/12/hdd_info_df-1.png) @@ -134,8 +156,9 @@ You will see the following output. ![hdd_info_hdparm](https://www.maketecheasier.com/assets/uploads/2015/12/hdd_info_hdparm.png) -### Conclusion ### +### 总结 ### +每个命令都有不同的方式来获取硬件的信息。在查看特定的硬件信息的时候,可以尝试使用不同的方式。上面所有的命令行工具在大部分的Linux发型版本中都是可以使用的,可以很容易的从仓库中获取安装。 Each of the commands has a different method of extracting hardware information. You can try more than one of them while looking for specific hardware details. All of the above tools are available in most Linux distros, and can be easily installed from the default repository. -------------------------------------------------------------------------------- From 6e35530646285c02fb478a4b81f0416ad94af5e0 Mon Sep 17 00:00:00 2001 From: SonoFelice Date: Thu, 7 Jan 2016 00:30:06 +0800 Subject: [PATCH 0159/1469] =?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 翻译完成 --- ...Information on Linux Using Command Line.md | 49 +++++-------------- 1 file changed, 12 insertions(+), 37 deletions(-) rename {sources => translated}/tech/20160104 How to Check Hardware Information on Linux Using Command Line.md (57%) diff --git a/sources/tech/20160104 How to Check Hardware Information on Linux Using Command Line.md b/translated/tech/20160104 How to Check Hardware Information on Linux Using Command Line.md similarity index 57% rename from sources/tech/20160104 How to Check Hardware Information on Linux Using Command Line.md rename to translated/tech/20160104 How to Check Hardware Information on Linux Using Command Line.md index 29ec43f74b..9806dd8b0d 100644 --- a/sources/tech/20160104 How to Check Hardware Information on Linux Using Command Line.md +++ b/translated/tech/20160104 How to Check Hardware Information on Linux Using Command Line.md @@ -1,146 +1,122 @@ -sonofelice translating Linux系统下使用命令行来查看硬件信息 -How to Check Hardware Information on Linux Using Command Line ================================================================================ ![](https://maketecheasier-holisticmedia.netdna-ssl.com/assets/uploads/2015/12/hdd_info_featured-1.png) 有许多可用的命令可以用来查看Linux系统上的硬件信息。有些命令只能够打印出像CPU和内存这一特定的硬件组件信息,其余的命令可以查看其余硬件单元的信息。 -There are many commands available to check hardware information of your Linux system. Some commands report only specific hardware components like CPU or memory while the rest cover multiple hardware units. - -这个教程可以带大家快速学习一下核查各种硬件设备的信息和配置详情的最常用的命令。 - -This tutorial takes a quick look at some of the most commonly used commands to check information and configuration details about various hardware devices. +这个教程可以带大家快速学习一下查看各种硬件设备的信息和配置详情的最常用的命令。 ### lscpu ### `lscpu`命令能够查看CPU和处理单元的信息。该命令没有任何其他选项或者别的功能。 -The `lscpu` command gives you information about the CPU and processing units. It does not have any other options or functionality. lscpu 运行该命令会看到下面输出: -You will see the following output by running the above command. ![hdd_info_lscpu](https://www.maketecheasier.com/assets/uploads/2015/12/hdd_info_lscpu.png) ### lspci ### `lspci`是另一个命令行工具,可以用来列出所有的PCI总线,还有与PCI总线相连的设备的详细信息,比如VGA适配器、显卡、网络适配器、usb端口、SATA控制器等。 -The lspci is another command line tool that lists all the PCI buses and details about the devices connected to them like VGA adapter, graphics card, network adapter, usb ports, SATA controller, etc. lspci 你可以看到类似下图的输出信息。 -You will see an output similar to the following image. ![hdd_info_lspci](https://www.maketecheasier.com/assets/uploads/2015/12/hdd_info_lspci-1.png) -可以通过运行下面的命令来过滤出特定的设备的信息。 -You can also filter out specific device information by running the following command: +可以通过运行下面的命令来过滤出特定设备的信息: lspci -v | grep "VGA" -A 12 运行上面的命令可以看到类似下图的关于显卡的信息。 -You will see graphics card information similar to the following. ![hdd_info_lspci_vga](https://www.maketecheasier.com/assets/uploads/2015/12/hdd_info_lspci_vga.png) ### lshw ### `lshw`是一个通用的工具,可以列出多种硬件单元的详细或者概要的信息,比如CPU、内存、usb控制器、硬盘等。`lshw`能够从不同的“/proc”文件中提取出相关的信息。 -The `lshw` is a general purpose utility that reports detailed and brief information about multiple hardware units like CPU, memory, usb controller, disk, etc. Lshw extracts the information from different “/proc” files. lshw -short 通过运行上面的命令可以看到下面的信息。 -You will see the following information by running the above command. ![hdd_info_lshw](https://www.maketecheasier.com/assets/uploads/2015/12/hdd_info_lshw.png) ### lsscsi ### 通过运行下面的命令可以列出像硬盘和光驱等scsi/sata设备的信息: -You can list all scsi/sata devices like hard drives and optical drives by running the following command: lsscsi 会得到类似下面的输出。 -The output wI’ll look something like this image. ![hdd_info_lsscsi](https://www.maketecheasier.com/assets/uploads/2015/12/hdd_info_lsscsi-1.png) ### lsusb ### `lsusb`命令能够列出USB控制器和与USB控制相连的设备的详细信息。默认情况下,`lsusb`命令只打印出概要信息。可以通过使用-v参数打印每一个usb端口的详细信息。 -This command shows you the USB controllers and details about devices connected to them. By default, the lsusb command prints brief information. You can also use the verbose option -v to print detailed information about each usb port. lsusb 可以看到下面输出。 -You will see the following output. ![hdd_info_lsusb](https://www.maketecheasier.com/assets/uploads/2015/12/hdd_info_lsusb.png) ### Inxi ### `Inxi`是一个bash脚本,能够从系统的多个源文件和命令行抓取硬件信息,并打印出一个非技术人员也能看懂的友好的报告。 -`Inxi` is a bash script that fetches hardware information from multiple sources and commands on the system and gives you goodlooking reports that non-technical users can read easily. 默认情况下,Ubuntu上没有安装`inxi`。可以通过运行下面命令来安装`Inxi`: -By default, `inxi` is not installed in Ubuntu. You can install it by running the following command: sudo apt-get install inxi 安装完`Inxi`之后,通过运行下面命令能够得到硬件相关的信息: -After installing inxi, you can get hardware information by running the following command: inxi -Fx 能够得到类似下图的输出。 -You will see an output similar to the image below. ![hdd_info_inxi](https://www.maketecheasier.com/assets/uploads/2015/12/hdd_info_inxi.jpg) ### df ### -This command gives you brief information about various partitions, their mount points and the used and available space on each. +`df`命令能够列出不同分区的概要信息,挂载点,已用的和可用的空间。 可以在使用`df`命令的时候加上`-H`参数。 -You can run the `df` command with the `-H` parameter. df -H 会得到下面的输出。 -You will see the following output. ![hdd_info_df](https://www.maketecheasier.com/assets/uploads/2015/12/hdd_info_df-1.png) ### Free ### -You can check the amount of used, free and total amount of RAM on your system with the free command. +通过使用`free`命令可以查看系统中使用的、闲置的和总体的RAM数量。 free -m -You will see the following output. +会看到下面输出。 ![hdd_info_free](https://www.maketecheasier.com/assets/uploads/2015/12/hdd_info_free.png) ### Dmidecode ### -The `dmidecode` command is different from all other commands. It extracts hardware information by reading data from the DMI tables. +`dmidecode`命令与其他命令不同。该命令是从DMI表中读取硬件信息的。 -To display information about the processor, run: +要查看处理器的信息,运行下面命令: sudo dmidecode -t processor ![hdd_info_dmi_processor](https://www.maketecheasier.com/assets/uploads/2015/12/hdd_info_dmi_processor.jpg) -To display information about the memory, run: +要查看内存的信息,运行下面命令: sudo dmidecode -t memory ![hdd_info_dmi_memory](https://www.maketecheasier.com/assets/uploads/2015/12/hdd_info_dmi_memory.png) -To display information about the bios, run: +要查看bios的信息,运行下面命令: sudo dmidecode -t bios @@ -148,25 +124,24 @@ To display information about the bios, run: ### Hdparm ### -The hdparm command gives you information about sata devices like hard disks. +`hdparm`命令可以用来显示想硬盘这样的sata设备的信息。 sudo hdparm -You will see the following output. +可以看到下面的输出。 ![hdd_info_hdparm](https://www.maketecheasier.com/assets/uploads/2015/12/hdd_info_hdparm.png) ### 总结 ### 每个命令都有不同的方式来获取硬件的信息。在查看特定的硬件信息的时候,可以尝试使用不同的方式。上面所有的命令行工具在大部分的Linux发型版本中都是可以使用的,可以很容易的从仓库中获取安装。 -Each of the commands has a different method of extracting hardware information. You can try more than one of them while looking for specific hardware details. All of the above tools are available in most Linux distros, and can be easily installed from the default repository. -------------------------------------------------------------------------------- via: https://www.maketecheasier.com/check-hardware-information-linux/ 作者:[Hitesh Jethva][a] -译者:[译者ID](https://github.com/译者ID) +译者:[sonofelice](https://github.com/sonofelice) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 49630096c8bbc0f92bc36c35ee8fa82740724ac0 Mon Sep 17 00:00:00 2001 From: kylepeng93 <958983476@qq.com> Date: Thu, 7 Jan 2016 16:23:04 +0800 Subject: [PATCH 0160/1469] translated --- ...om the command line on Debian or Ubuntu.md | 313 ------------------ ...om the command line on Debian or Ubuntu.md | 297 +++++++++++++++++ 2 files changed, 297 insertions(+), 313 deletions(-) delete mode 100644 sources/tech/20160104 How to use KVM from the command line on Debian or Ubuntu.md create mode 100644 translated/tech/20160104 How to use KVM from the command line on Debian or Ubuntu.md diff --git a/sources/tech/20160104 How to use KVM from the command line on Debian or Ubuntu.md b/sources/tech/20160104 How to use KVM from the command line on Debian or Ubuntu.md deleted file mode 100644 index c91fa32afc..0000000000 --- a/sources/tech/20160104 How to use KVM from the command line on Debian or Ubuntu.md +++ /dev/null @@ -1,313 +0,0 @@ -kylepeng93翻译中... -How to use KVM from the command line on Debian or Ubuntu -================================================================================ -There are different ways to manage virtual machines (VMs) running on KVM hypervisor. For example, virt-manager is a popular GUI-based front-end for VM management. However, if you would like to use KVM on a headless server, GUI-based solutions will not be ideal. In fact, you can create and manage KVM VMs purely from the command line using kvm command-line wrapper script. Alternatively, you can use virsh which is an easier-to-use command-line user interface for managing guest VMs. Underneath virsh, it communicates wtih libvirtd service which can control several different hypervisors including KVM, Xen, QEMU, LXC and OpenVZ. - -A command-line management interface such as virsh is also useful when you would like to "automate" the provisioning and management of VMs. Also, the fact that virsh supports multiple hypervisors means you can manage different hypervisors via the same virsh interface. - -In this tutorial, I will demonstrate **how to run KVM from the command line by using virsh on Debian or Ubuntu**. - -### Step One: Verify Hardware Virtualization Support ### - -As a first step, verify that the host CPU is equipped with hardware virtualization extensions (e.g., Intel VT or AMD-V), which are required for KVM. The following command will do. - - $ egrep '(vmx|svm)' --color /proc/cpuinfo - -![](https://c2.staticflickr.com/2/1505/24050288606_758a44c4c6_c.jpg) - -If the output does not contain vmx or svm flag, it means the host CPU does not have hardware virtualization support. Thus you cannot use KVM on the host. After verifying that the host CPU comes with vmx or svm, proceed to install KVM next. - -For KVM, it is not required to run a 64-bit kernel on the KVM host, but generally it is recommended. - -### Step Two: Install KVM ### - -Using apt-get, install KVM and related user-space tools. - - $ sudo apt-get install qemu-kvm libvirt-bin - -During installation, libvirtd group (or libvirt-qemu on Debian) will be created, and your userID will be automatically added to the group. This will allows you to manage VMs as a non-root regular user. You can verify that by using id command, which will show your group IDs: - - $ id - -![](https://c2.staticflickr.com/6/5597/15432586092_64dfb867d3_c.jpg) - -If for some reason, libvirtd (or libvirt-qemu) is not found in your groupID list, you can manually add yourself to the group as follows. - -On Ubuntu: - - $ sudo adduser [youruserID] libvirtd - -On Debian: - - $ sudo adduser [youruserID] libvirt-qemu - -Reload updated group membership info as follows. Upon asked for a password, enter your login password. - - $ exec su -l $USER - -At this point, you should be able to run virsh as a regular user. As a test, try the command below, which will show a list of available VMs (currently none). If you do not encounter a permission error, it means everything is okay so far. - - $ virsh list - ----------- - - Id Name State - ---------------------------------------------------- - -### Step Three: Configure Bridged Networking ### - -One way to enable KVM VMs to access external networks is via a Linux bridge created on a KVM host. The bridge interconnects the virtual interfaces of VMs with the physical interface of the host, so that the VMs can send or receive traffic via the physical interface. This is called bridged networking. - -Here is how to create and configure a Linux bridge br0 for bridged networking with KVM. - -First, install a necessary package, and create a Linux bridge from the command line. - - $ sudo apt-get install bridge-utils - $ sudo brctl addbr br0 - -The next step is to configure Linux bridge in /etc/network/interfaces, so that the bridge is configured automatically upon boot. To use /etc/network/interfaces, you need to disable Network Manager on your system (if you are using it). Follow the [this instruction][1] to disable Network Manager. - -After disabling Network Manager, go ahead and configure Linux bridge br0 in /etc/network/interfaces as follows. - - #auto eth0 - #iface eth0 inet dhcp - - auto br0 - iface br0 inet dhcp - bridge_ports eth0 - bridge_stp off - bridge_fd 0 - bridge_maxwait 0 - -In the above I assume that eth0 is the primary network interface that is connected to external networks. Also, I assume that eth0 is getting its IP address via DHCP. Note that there is no configuration for eth0 in /etc/network/interface. The Linux bridge br0 takes up the configuration of eth0 as eth0 is enslaved to the bridge br0. - -Restart network service, and verify that Linux bridge is configured successfully. If successful, br0 should be assigned the eth0's DHCP IP address, and eth0 should not have any IP address assigned. - - $ sudo /etc/init.d/networking restart - $ ifconfig - -If for any reason eth0 still retains the IP address which is assigned to br0, you may have to explicitly remove the IP address from eth0. - -![](https://c2.staticflickr.com/2/1698/23780708850_66cd7ba6ea_c.jpg) - -### Step Four: Create a VM from the Command Line ### - -With KVM, the configuration of a VM is stored in a domain XML file. Thus, the first step to create a VM is to prepare its domain XML file. - -The following is a sample domain XML file of a VM. You can customize it as needed. - - - alice - f5b8c05b-9c7a-3211-49b9-2bd635f7e2aa - 1048576 - 1048576 - 1 - - hvm - - - - - - - destroy - restart - destroy - - /usr/bin/kvm - - - - -
- - - - - - -
- - - - - - -
- - - - - - - - - -The above domain XML file defines the following VM. - -- 1GB memory, one vCPU and one hard drive. -- Disk image: /home/dev/images/alice.img. -- Boot from CD-ROM (/home/dev/iso/CentOS-6.5-x86_64-minimal.iso). -- Networking: one network interface bridged to br0 -- Remote access via VNC. - -The UUID string inside can be randomly generated. To get a random UUID, you can use uuid command-line tool. - - $ sudo apt-get install uuid - $ uuid - -Another way to create a domain XML file is to dump the domain information of an existing VM as follows. - - $ virsh dumpxml alice > bob.xml - -![](https://c2.staticflickr.com/6/5808/23968234602_25e8019ec8_c.jpg) - -### Step Five: Start VM from the Command Line ### - -Before starting a VM, you need to create its initial disk image. For that, you can use qemu-img command, which comes with qemu-kvm package you installed. The following command creates 10GB size empty disk image of qcow2 type: - - $ qemu-img create -f qcow2 /home/dev/images/alice.img 10G - -The advantage of using "qcow2" (as opposed to "raw") as a disk image format is that a "qcow2"-type disk image is not created as a full size (10GB) initially, but grows as the disk gets populated. So it is more space-efficient. - -Now you are ready to start a VM using the domain XML file you created earlier. The following command will create a VM, and automatically start it. - - $ virsh create alice.xml - ----------- - - Domain alice created from alice.xml - -**NOTE**: If you run the above command with an already created VM, it will wipe out the VM without warning. If you already created a VM, you can instead use the following command to just start the VM. - - $ virsh start alice.xml - -Verify that a new domain has been created and started successfully with: - - $ virsh list - ----------- - - Id Name State - ---------------------------------------------------- - 3 alice running - -Also, verify that the virtual interface for the VM (e.g., vnet0) is successfully added to the Linux bridge br0 that you created earlier. - - $ sudo brctl show - -![](https://c2.staticflickr.com/2/1546/23449585383_a371e9e579_c.jpg) - -### Step Six: Remote Access a VM ### - -To access the console of a running VM remotely, you can use any VNC client. - -First, find out the VNC port number for the VM as follows. - - $ sudo netstat -nap | egrep '(kvm|qemu)' - -![](https://c2.staticflickr.com/6/5633/23448144274_49045bc868_c.jpg) - -In this example, the VNC port number for alice VM is 5900. - -Then launch a VNC client, and connect to a VNC server running at :5900. In our example, the VM is supposed to boot into CentOS CD-ROM. - -![](https://c2.staticflickr.com/2/1533/24076369675_99408972a4_c.jpg) - -### Manage VMs with virsh ### - -The following lists common usages of virsh command. - -To create a new guest domain and start a VM: - - $ virsh create alice.xml - -To stop a VM and destroy a guest domain: - - $ virsh destroy alice - -To shutdown a VM (without destroying a domain): - - $ virsh shutdown alice - -To suspend a VM: - - $ virsh suspend alice - -To resume a suspended VM: - - $ virsh resume alice - -To access login console of a running VM: - - $ virsh console alice - -To autostart a VM upon host booting: - - $ virsh autostart alice - -To get domain information of a VM: - - $ virsh dominfo alice - -To edit domain XML of a VM: - - $ virsh edit alice - -The above will invoke the domain XML file of the VM with a default text editor. Any change in the XML will automatically be validated by libvirt for correctness. - -You can also manage VMs from within a virsh session. To create and enter a new virsh session, simply run: - - $ virsh - -At the virsh prompt, you can use any virsh commands. - -![](https://c2.staticflickr.com/6/5645/23708565129_b1ef968b30_c.jpg) - -### Troubleshooting ### - -1. I am getting the error while trying to create a VM: - - error: internal error: no supported architecture for os type 'hvm' - -You can get this error if your hardware does not have hardware virtualization support (e.g., Intel VT or AMD-V), which is required to run KVM. If you are getting this error even when your CPU comes with Intel VT or AMD-V, here are possible solutions: - -First, check if kvm kernel module is missing. - - $ lsmod | grep kvm - -If kvm kernel module is not loaded, you must load it as follows. - - $ sudo modprobe kvm_intel (for Intel processor) - $ sudo modprobe kvm_amd (for AMD processor) - -The second solution is adding "--connect qemu:///system" argument to virsh command as follows. This argument may be needed when you are using more than one hypervisor (e.g., VMware, VirtualBox) on the server hardware. - - $ virsh --connect qemu:///system create alice.xml - -2. I am getting the error while trying to access login console of my VM: - - $ virsh console alice - ----------- - - error: internal error: cannot find character device - -This error occurs because you did not define a console device in the VM's XML file. Add the following inside the "device" section of the XML file. - - - - - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/use-kvm-command-line-debian-ubuntu.html - -作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://xmodulo.com/author/nanni -[1]:http://xmodulo.com/disable-network-manager-linux.html diff --git a/translated/tech/20160104 How to use KVM from the command line on Debian or Ubuntu.md b/translated/tech/20160104 How to use KVM from the command line on Debian or Ubuntu.md new file mode 100644 index 0000000000..6f9f3690cb --- /dev/null +++ b/translated/tech/20160104 How to use KVM from the command line on Debian or Ubuntu.md @@ -0,0 +1,297 @@ + +怎样在ubuntu和debian中用命令行使用KVM +================================================================================ +有很多不同的方式去管理运行在KVM管理程序上的虚拟机。例如,virt-manager就是一个流行的基于图形用户界面的前端虚拟机管理工具。然而,如果你想要在没有图形窗口的服务器环境下使用KVM,那么基于图形用户界面的解决方案显然是行不通的。事实上,你可以纯粹的使用包装了kvm命令行脚本的命令行来管理KVM虚拟机。作为替代方案,你可以使用virsh这个容易使用的命令行用户接口来管理客户虚拟机。在virsh中,它通过和libvirtd服务通信来达到控制虚拟机的目的,而libvirtd可以控制几个不同的虚拟机管理器,包括KVM,Xen,QEMU,LXC和OpenVZ。 + 当你想要对虚拟机的前期准备和后期管理实现自动化操作时,像virsh这样的命令行管理工具是非常有用的。同样,virsh支持多个管理器的事实也意味着你可以通过相同的virsh接口去管理不同的虚拟机管理器。 + 在这篇文章中,我会示范**怎样在ubuntu和debian上通过使用virsh命令行去运行KVM**。 + +### 第一步:确认你的硬件平台支持虚拟化 ### + +作为第一步,首先要确认你的主机CPU配备了硬件虚拟化拓展(e.g.,Intel VT或者AMD-V),这是KVM对硬件的要求。下面的命令可以检查硬件是否支持虚拟化。 + + $ egrep '(vmx|svm)' --color /proc/cpuinfo + +![](https://c2.staticflickr.com/2/1505/24050288606_758a44c4c6_c.jpg) + + 如果在输出中不包含vmx或者svm标识,那么就意味着你的主机cpu不支持硬件虚拟化。因此你不能在你的机器上使用KVM。确认了主机cpu存在vmx或者svm之后,接下来开始安装KVM。 +对于KVM来说,它不要求运行在拥有64位内核系统的主机上,但是通常我们会推荐在64位系统的主机上面运行KVM。 + +### 第二步:安装KVM ### + +使用apt-get安装KVM和相关的用户空间工具。 + + $ sudo apt-get install qemu-kvm libvirt-bin + +安装期间,libvirtd组(在debian上是libvirtd-qemu组)将会被创建,并且你的用户id将会被自动添加到该组中。这样做的目的是让你可以以一个普通用户而不是root用户的身份去管理虚拟机。你可以使用id命令来确认这一点,下面将会告诉你怎么去显示你的组id: + + $ id + +![](https://c2.staticflickr.com/6/5597/15432586092_64dfb867d3_c.jpg) + +如果因为某些原因,libvirt(在debian中是libvirt-qemu)没有在你的组id中被找到,你也可以手动将你自己添加到对应的组中,如下所示: +在ubuntu上: + + $ sudo adduser [youruserID] libvirtd + +在debian上: + + $ sudo adduser [youruserID] libvirt-qemu + +按照如下形式重修载入更新后的组成员关系。如果要求输入密码,那么输入你的登陆密码即可。 + + $ exec su -l $USER + +这时,你应该可以以普通用户的身份去执行virsh了。做一个如下所示的测试,这个命令将会以列表的形式列出可用的虚拟机(当前的列表是空的)。如果你没有遇到权限问题,那意味着迄今为止一切都是正常的。 + + $ virsh list + +---------- + + Id Name State + ---------------------------------------------------- + +### 第三步:配置桥接网络 ### + +为了使KVM虚拟机能够访问外部网络,一种方法是通过在KVM宿主机上创建Linux桥来实现。创建之后的桥能够将虚拟机的虚拟网卡和宿主机的物理网卡连接起来,因此,虚拟机能够发送和接受由物理网卡发送过来的流量数据包。这种方式叫做网桥连接。 +下面将告诉你如何创建并且配置网桥,我们称它为br0. +首先,安装一个必需的包,然后用命令行创建一个网桥。 + + $ sudo apt-get install bridge-utils + $ sudo brctl addbr br0 + +下一步就是配置已经创建好的网桥,即修改位于/etc/network/interfaces的配置文件。我们需要将该桥接网卡设置成开机启动。为了修改该配置文件,你需要关闭你的操作系统上的网络管理器(如果你在使用它的话)。跟随[操作指南][1]的说明去关闭网络管理器。 + 关闭网络管理器之后,接下来就是通过修改配置文件来配置网桥了。 + + #auto eth0 + #iface eth0 inet dhcp + + auto br0 + iface br0 inet dhcp + bridge_ports eth0 + bridge_stp off + bridge_fd 0 + bridge_maxwait 0 + + +在上面的配置中,我假设eth0是主要网卡,它也是连接到外网的网卡,同样,我假设eth0将会通过DHCP得到它的ip地址。注意,之前在/etc/network/interfaces中还没有对eth0进行任何配置。桥接网卡br0引用了eth0的配置,而eth0也会受到br0的制约。 +重启网络服务,并确认网桥已经被成功的配置好。如果成功的话,br0的ip地址将会是eth0的被自动分配的ip地址,而且eth0不会被分配任何ip地址。 + + $ sudo /etc/init.d/networking restart + $ ifconfig + +如果因为某些原因,eth0仍然保留了之前分配给了br0的ip地址,那么你可能必须明确的删除eth0的ip地址。 + +![](https://c2.staticflickr.com/2/1698/23780708850_66cd7ba6ea_c.jpg) + +###第四步:用命令行创建一个虚拟机 ### + +对于虚拟机来说,它的配置信息被存储在它对应的xml文件中。因此,创建一个虚拟机的第一步就是准备一个与主机名对应的xml文件。 +下面是一个示例xml文件,你可以根据需要手动修改它。 + + + alice + f5b8c05b-9c7a-3211-49b9-2bd635f7e2aa + 1048576 + 1048576 + 1 + + hvm + + + + + + + destroy + restart + destroy + + /usr/bin/kvm + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + + + + +上面的主机xml配置文件定义了如下的虚拟机内容。 + +- 1GB内存,一个虚拟cpu和一个硬件驱动。 +- Disk image:/home/dev/images/alice.img。 +- Boot from CD-ROM(/home/dev/iso/CentOS-6.5-x86_64-minomal.iso)。 +- Networking:一个桥接到br0的虚拟网卡。 +- 通过VNC远程访问。 +中的UUID字符串可以随机生成。为了得到一个随机的uuid字符串,你可能需要使用uuid命令行工具。 + + $ sudo apt-get install uuid + $ uuid + +生成一个主机xml配置文件的方式就是通过一个已经存在的虚拟机来导出它的xml配置文件。如下所示。 + + $ virsh dumpxml alice > bob.xml + +![](https://c2.staticflickr.com/6/5808/23968234602_25e8019ec8_c.jpg) + +###第五步:使用命令行启动虚拟机### + +在启动虚拟机之前,我们需要创建它的初始磁盘镜像。为此,你需要使用qemu-img命令来生成一个你已经安装的qemu-kvm镜像。下面的命令将会创建10GB大小的空磁盘,并且它是qcow2格式的。 + + $ qemu-img create -f qcow2 /home/dev/images/alice.img 10G + +使用qcow2格式的磁盘镜像的好处就是它在创建之初并不会给它分配全部大小磁盘容量(这里是10GB),而是随着虚拟机中文件的增加而逐渐增大。因此,它对空间的使用更加有效。 +现在,你可以准备通过使用之前创建的xml配置文件启动你的虚拟机了。下面的命令将会创建一个虚拟机,然后自动启动它。 + + $ virsh create alice.xml + +---------- + + Domain alice created from alice.xml + +**注意**:如果你对一个已经存在的虚拟机运行了上面的命令,那么这个操作将会在没有警告信息的情况下抹去那个已经存在的虚拟机的全部信息。如果你已经创建了一个虚拟机,你可能会使用下面的命令来启动虚拟机。 + + $ virsh start alice.xml + +使用如下命令确认一个新的虚拟机已经被创建并成功的被启动。 + + $ virsh list + +---------- + + Id Name State + ---------------------------------------------------- + 3 alice running + +同样,使用如下命令确认你的虚拟机的虚拟网卡已经被成功的添加到了你先前创建的br0网桥中。 + + $ sudo brctl show + +![](https://c2.staticflickr.com/2/1546/23449585383_a371e9e579_c.jpg) + +### 远程连接虚拟机 ### + +为了远程访问一个正在运行的虚拟机的控制台,你可以使用VNC客户端。 +首先,你需要使用如下命令找出用于虚拟机的VNC端口号。 + + $ sudo netstat -nap | egrep '(kvm|qemu)' + +![](https://c2.staticflickr.com/6/5633/23448144274_49045bc868_c.jpg) + +在这个例子中,用于alice虚拟机的VNC端口号是5900 +然后启动一个VNC客户端,连接到一个端口号为5900的VNC服务器。在我们的例子中,虚拟机支持由CentOS光盘文件启动。 + +![](https://c2.staticflickr.com/2/1533/24076369675_99408972a4_c.jpg) + +### 使用virsh管理虚拟机 ### + +下面列出了virsh命令的常规用法 +创建客户机并且启动虚拟机: + + $ virsh create alice.xml + +停止虚拟机并且删除客户机 + + $ virsh destroy alice + +关闭虚拟机(不用删除它) + + $ virsh shutdown alice + +暂停虚拟机 + + $ virsh suspend alice + +恢复虚拟机 + + $ virsh resume alice + +访问正在运行的虚拟机的登陆控制台 + + $ virsh console alice + +设置虚拟机开机启动: + + $ virsh autostart alice + +查看虚拟机的详细信息 + + $ virsh dominfo alice + +编辑虚拟机的配置文件: + + $ virsh edit alice + +上面的这个命令将会使用一个默认的编辑器来调用主机配置文件。该配置文件中的任何改变都将自动被libvirt验证其正确性。 +你也可以在一个virsh会话中管理虚拟机。下面的命令会创建并进入到一个virsh会话中: + + $ virsh +在virsh提示中,你可以使用任何virsh命令。 + +![](https://c2.staticflickr.com/6/5645/23708565129_b1ef968b30_c.jpg) + +### 问题处理 ### + +1. 我在创建虚拟机的时候遇到了一个错误: + + error: internal error: no supported architecture for os type 'hvm' + + 如果你的硬件不支持虚拟化的话你可能就会遇到这个错误。(例如,Intel VT或者AMD-V),这是运行KVM所必需的。如果你遇到了这个错误,而你的cpu支持虚拟化,那么这里可以给你一些可用的解决方案: + +首先,检查你的内核模块是否丢失。 + + $ lsmod | grep kvm + +如果内核模块没有加载,你必须按照如下方式加载它。 + + $ sudo modprobe kvm_intel (for Intel processor) + $ sudo modprobe kvm_amd (for AMD processor) + +第二个解决方案就是添加“--connect qemu:///system”参数到virsh命令中,如下所示。当你正在你的硬件平台上使用超过一个虚拟机管理器的时候就需要添加这个参数(例如,VirtualBox,VMware)。 + $ virsh --connect qemu:///system create alice.xml + +2. 当我试着访问我的虚拟机的登陆控制台的时候遇到了错误: + + $ virsh console alice + +---------- + + error: internal error: cannot find character device + +这个错误发生的原因是你没有在你的虚拟机配置文件中定义控制台设备。在xml文件中加上下面的内部设备部分即可。 + + + + + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/use-kvm-command-line-debian-ubuntu.html + +作者:[Dan Nanni][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/nanni +[1]:http://xmodulo.com/disable-network-manager-linux.html From e581c4c0c2c125bad231811b46edcaea46805cd4 Mon Sep 17 00:00:00 2001 From: Stdio A Date: Thu, 7 Jan 2016 17:00:41 +0800 Subject: [PATCH 0161/1469] Translated Hackers Successfully Install Linux on a Potato --- ...l Linux on a Potato - StdioA_translated.md | 31 +++++++++++++++++++ ... Linux on a Potato - hittlle_translated.md | 31 +++++++++++++++++++ ... Successfully Install Linux on a Potato.md | 31 +++++++++++++++++++ 3 files changed, 93 insertions(+) create mode 100644 translated/share/Hackers Successfully Install Linux on a Potato/Hackers Successfully Install Linux on a Potato - StdioA_translated.md create mode 100644 translated/share/Hackers Successfully Install Linux on a Potato/Hackers Successfully Install Linux on a Potato - hittlle_translated.md create mode 100644 translated/share/Hackers Successfully Install Linux on a Potato/Hackers Successfully Install Linux on a Potato.md diff --git a/translated/share/Hackers Successfully Install Linux on a Potato/Hackers Successfully Install Linux on a Potato - StdioA_translated.md b/translated/share/Hackers Successfully Install Linux on a Potato/Hackers Successfully Install Linux on a Potato - StdioA_translated.md new file mode 100644 index 0000000000..d6708676e6 --- /dev/null +++ b/translated/share/Hackers Successfully Install Linux on a Potato/Hackers Successfully Install Linux on a Potato - StdioA_translated.md @@ -0,0 +1,31 @@ +# 黑客成功在马铃薯上安装Linux + +================================================================================ + +来自荷兰阿姆斯特丹的消息称,来自`LinuxOnAnything.nl网站的黑客在马铃薯上成功安装了Linux。这是操作系统第一次在根用蔬菜上安装成功。 + +![Linux Potato](http://www.bbspot.com/Images/News_Features/2008/12/linux-potato.jpg) + +“土豆没有CPU,内存和海量存储器,所以这确实是一个挑战,” Linux On Anything (LOA) 小组的Johan Piest说。“显然我们不能使用一个像Fedora或Ubuntu一样的大型发行版,所以我们使用了Damn Small Linux.” + +经过几周的尝试,这个小组制作了一个经过特殊修改的Linux内核,这个内核可以装载到土豆上,而且可以使用vi修改一个小的文本文件。他们将Linux通过一个小型USB存储器加载到土豆上,而命令通过一组红色和黑色线以二进制形式传输至土豆中。 + +LOA小组是一个由一群尝试在任何东西上加载Linux的黑客们构成的、不断壮大的小组。他们从电子设备(如Gameboy和iPod)开始,不过最近这个小组开始面对一些更严峻的挑战,比如在电灯泡和小狗上加载Linux. + +LOA小组在与另一个Stuttering Monarchs——另一个黑客小组竞赛,看谁先拿到土豆这一分。“马铃薯是一种非常抢手的蔬菜,因为它的用途极其广泛,就像Linux本身一样。你可以煮它,捣碎它,在焖锅中杵它,” Piest说道,“你可以认为我们完成这个挑战可以获得某些奖项,但我们认为这是我们吹嘘的一种成本。” + +LOA是第一个将Linux安装到一匹设得兰矮种马上的小组,但最近五年这个竞争愈演愈烈,其它黑客小组的进度已经反超了他们。 + +“我们本来可以成为在薄脆饼干上面加载Linux的第一个小组,但是那群来自挪威的混蛋把我们赢了。” Piest说。 + +第一个成功安装Linux的蔬菜是一头卷心菜,它由一个来自土耳其的一个黑客小组完成安装。 + + +-------------------------------------------------------------------------------- + +via: http://www.bbspot.com/news/2008/12/linux-on-a-potato.html + +译者:[StdioA](https://github.com/StdioA) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/translated/share/Hackers Successfully Install Linux on a Potato/Hackers Successfully Install Linux on a Potato - hittlle_translated.md b/translated/share/Hackers Successfully Install Linux on a Potato/Hackers Successfully Install Linux on a Potato - hittlle_translated.md new file mode 100644 index 0000000000..0f77926425 --- /dev/null +++ b/translated/share/Hackers Successfully Install Linux on a Potato/Hackers Successfully Install Linux on a Potato - hittlle_translated.md @@ -0,0 +1,31 @@ +# 黑客成功在马铃薯上安装Linux + +================================================================================ + +来自荷兰阿姆斯特丹的消息称,LinuxOnAnything.nl站点的黑客在马铃著上成功安装了Linux。这是操作系统第一次在根用蔬菜(译注:root vetetable, 一语双关,root在Linux是超级用户)上安装成功。 + +![Linux Potato](http://www.bbspot.com/Images/News_Features/2008/12/linux-potato.jpg) + +『马铃著上没有CPU, 内存和其它存储空间,这真的是一个挑战』, 来自LOA(LinuxOnAnything)的Johan Piest如是说。『很显然我们不能安装像Fedora或者Ubuntu这些体量比较大的Linux发行版,我们用的是Damn Small Linux这个发行版』 + +在尝试了几周之后,LOA小组的同学们弄出了一个适合马铃薯体量的Linux内核;这玩艺儿上面可以用vi来编辑小的文本文件。这个内核通过U盘加载到马铃薯上;并通过一组红黑线用二进制的方式向这个内核发送命令。 + +LOA小组是一个不断壮大的黑客组织的一个分支;这个组织致力于将Linux安装到所有物体上;他们先是将Linux装到Gameboys和iPods等电子产品上,不过最近他们在挑战一些高难度的东西,譬如将Linux安装到灯泡和小狗(????puppies确实是小狗啊,难道有其它意思???)身上。 + +The LOA group was in a race with another hacker group, the Stuttering Monarchs, to be the first to bag the potato. “The potato has been the vegetable that everyone has been gunning for, because it's so versatile like Linux itself. You can boil 'em, mash 'em, stick 'em in a stew,” said Piest. “You'd think we'd get some sort of reward for this, but it's all about bragging rights for us.” + +LOA was the group that first installed Linux on a Shetland pony in 2003, but growing competition from other hacker groups have shut them out in the past five years. + +“We were close to being the first with Linux on a cracker, but those jerks from Norway beat us out,” said Piest. + +The first vegetable Linux install was on a head of iceberg lettuce by a group of hackers in Turkey. + + +-------------------------------------------------------------------------------- + +via: http://www.bbspot.com/news/2008/12/linux-on-a-potato.html + +译者:[hittlle](https://github.com/hittlle) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/translated/share/Hackers Successfully Install Linux on a Potato/Hackers Successfully Install Linux on a Potato.md b/translated/share/Hackers Successfully Install Linux on a Potato/Hackers Successfully Install Linux on a Potato.md new file mode 100644 index 0000000000..b33e43b2ed --- /dev/null +++ b/translated/share/Hackers Successfully Install Linux on a Potato/Hackers Successfully Install Linux on a Potato.md @@ -0,0 +1,31 @@ +# Hackers Successfully Install Linux on a Potato + +================================================================================ + +Amsterdam, Netherlands – Hackers from the LinuxOnAnything.nl Web site successfully installed Linux on a potato. It's the first time the operating system has been successfully installed on a root vegetable. + +![Linux Potato](http://www.bbspot.com/Images/News_Features/2008/12/linux-potato.jpg) + +“A potato doesn't have a CPU, memory or storage space, so it was quite a challenge,” said Johan Piest of the Linux on Anything (LOA) group. “Obviously we couldn't use a large distribution like Fedora or Ubuntu, so we went with Damn Small Linux.” + +After weeks of trying the group got a Linux kernel specially modified for a potato loaded, and were able to edit a small text file in vi. Linux was loaded onto the potato using a USB thumb drive and commands were sent in binary to the potato using a set of red and black wires. + +The LOA group is a part of a growing group of hackers attempting to get Linux loaded on anything. It started on electronic devices like Gameboys and iPods, but recently groups have taken on tougher challenges like light bulbs and puppies. + +The LOA group was in a race with another hacker group, the Stuttering Monarchs, to be the first to bag the potato. “The potato has been the vegetable that everyone has been gunning for, because it's so versatile like Linux itself. You can boil 'em, mash 'em, stick 'em in a stew,” said Piest. “You'd think we'd get some sort of reward for this, but it's all about bragging rights for us.” + +LOA was the group that first installed Linux on a Shetland pony in 2003, but growing competition from other hacker groups have shut them out in the past five years. + +“We were close to being the first with Linux on a cracker, but those jerks from Norway beat us out,” said Piest. + +The first vegetable Linux install was on a head of iceberg lettuce by a group of hackers in Turkey. + + +-------------------------------------------------------------------------------- + +via: http://www.bbspot.com/news/2008/12/linux-on-a-potato.html + +译者:[翻译者ID](https://github.com/翻译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 020d0f12fc9288587d69bb9059db5f9e9a03a37a Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 7 Jan 2016 19:07:04 +0800 Subject: [PATCH 0162/1469] PUB:20151126 How to Install Nginx as Reverse Proxy for Apache on FreeBSD 10.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @KnightJoker @carolinewuyan 这篇翻译质量不佳,还需改进。 --- ...everse Proxy for Apache on FreeBSD 10.2.md | 100 +++++++++--------- 1 file changed, 50 insertions(+), 50 deletions(-) rename {translated/tech => published}/20151126 How to Install Nginx as Reverse Proxy for Apache on FreeBSD 10.2.md (54%) diff --git a/translated/tech/20151126 How to Install Nginx as Reverse Proxy for Apache on FreeBSD 10.2.md b/published/20151126 How to Install Nginx as Reverse Proxy for Apache on FreeBSD 10.2.md similarity index 54% rename from translated/tech/20151126 How to Install Nginx as Reverse Proxy for Apache on FreeBSD 10.2.md rename to published/20151126 How to Install Nginx as Reverse Proxy for Apache on FreeBSD 10.2.md index abd69a9cab..bf97fc16d7 100644 --- a/translated/tech/20151126 How to Install Nginx as Reverse Proxy for Apache on FreeBSD 10.2.md +++ b/published/20151126 How to Install Nginx as Reverse Proxy for Apache on FreeBSD 10.2.md @@ -1,61 +1,61 @@ - -如何在FreeBSD 10.2上安装Nginx作为Apache的反向代理 +如何在 FreeBSD 10.2 上安装 Nginx 作为 Apache 的反向代理 ================================================================================ -Nginx是一款免费的开源HTTP和反向代理服务器, 以及一个POP3/IMAP的邮件代理服务器。Nginx是一款高性能的web服务器,其特点是丰富的功能,简单的结构以及低内存的占用. 第一个版本由 Igor Sysoev在2002年发布,迄今为止很多大的科技公司依然在使用,包括 Netflix, Github, Cloudflare, WordPress.com等等。 -在这篇教程里我们会 "**在freebsd 10.2系统上,安装和配置Nginx网络服务器作为Apache的反向代理**". Apache 会用PHP在8080端口上运行,并且我们需要在80端口配置Nginx的运行,用来接收用户/访问者的请求.如果网页的用户请求来自于浏览器的80端口, 那么Nginx会用Apache网络服务器和PHP来通过这个请求,并运行在8080端口。 +Nginx 是一款自由开源的 HTTP 和反向代理服务器,也可以用作 POP3/IMAP 的邮件代理服务器。Nginx 是一款高性能的 web 服务器,其特点是功能丰富,结构简单以及内存占用低。 第一个版本由 Igor Sysoev 发布于2002年,到现在有很多大型科技公司在使用,包括 Netflix、 Github、 Cloudflare、 WordPress.com 等等。 -#### 前提条件 #### +在这篇教程里我们会“**在 freebsd 10.2 系统上,安装和配置 Nginx 网络服务器作为 Apache 的反向代理**”。 Apache 将在8080端口上运行 PHP ,而我们会配置 Nginx 运行在80端口以接收用户/访问者的请求。如果80端口接收到用户浏览器的网页请求,那么 Nginx 会将该请求传递给运行在8080端口上的 Apache 网络服务器和 PHP。 -- FreeBSD 10.2. -- Root 权限. +#### 前提条件 #### + +- FreeBSD 10.2 +- Root 权限 ### 步骤 1 - 更新系统 ### -使用SSH证书登录到你的FreeBSD服务器以及使用下面命令来更新你的系统 : +使用 SSH 认证方式登录到你的 FreeBSD 服务器,使用下面命令来更新你的系统: freebsd-update fetch freebsd-update install ### 步骤 2 - 安装 Apache ### -Apache是现在使用范围最广的web服务器以及开源的HTTP服务器.在FreeBSD里Apache是未被默认安装的, 但是我们可以直接通过端口或者在"/usr/ports/www/apache24" 目录下的解压包安装,再或者直接从PKG命令的FreeBSD系统信息库安装。在本教程中,我们将使用PKG命令从FreeBSD的库中安装: +Apache 是开源的、使用范围最广的 web 服务器。在 FreeBSD 里默认没有安装 Apache, 但是我们可以直接通过 /usr/ports/www/apache24 下的 ports 或软件包来安装,也可以直接使用 pkg 命令从 FreeBSD 软件库中安装。在本教程中,我们将使用 pkg 命令从 FreeBSD 软件库中安装: pkg install apache24 ### 步骤 3 - 安装 PHP ### -一旦成功安装Apache, 接着将会安装PHP并由一个用户处理一个PHP的文件请求. 我们将会用到如下的PKG命令来安装PHP : +一旦成功安装 Apache,接着将会安装 PHP ,它来负责处理用户对 PHP 文件的请求。我们将会用到如下的 pkg 命令来安装 PHP: pkg install php56 mod_php56 php56-mysql php56-mysqli ### 步骤 4 - 配置 Apache 和 PHP ### -一旦所有都安装好了, 我们将会配置Apache在8080端口上运行, 并让PHP与Apache一同工作. 要想配置Apache,我们可以编辑 "httpd.conf"这个配置文件, 然而PHP我们只需要复制"/usr/local/etc/"目录下的PHP配置文件 php.ini 。 +一旦所有都安装好了,我们将会配置 Apache 运行在8080端口上, 并让 PHP 与 Apache 一同工作。 要想配置Apache,我们可以编辑“httpd.conf”这个配置文件, 对于 PHP 我们只需要复制 “/usr/local/etc/”目录下的 PHP 配置文件 php.ini。 -进入到 "/usr/local/etc/" 目录 并且复制 php.ini-production 文件到 php.ini : +进入到“/usr/local/etc/”目录,并且复制 php.ini-production 文件到 php.ini : cd /usr/local/etc/ cp php.ini-production php.ini -下一步, 在Apache目录下通过编辑 "httpd.conf"文件来配置Apache : +下一步,在 Apache 目录下通过编辑“httpd.conf”文件来配置 Apache: cd /usr/local/etc/apache24 nano -c httpd.conf -端口配置在第 **52**行 : +端口配置在第**52**行 : Listen 8080 -服务器名称配置在第 **219** 行: +服务器名称配置在第**219**行: ServerName 127.0.0.1:8080 -在第 **277**行,如果目录需要,添加的DirectoryIndex文件,Apache将直接作用于它 : +在第**277**行,添加 DirectoryIndex 文件,Apache 将用它来服务对目录的请求: DirectoryIndex index.php index.html -在第 **287**行下,配置Apache通过添加脚本来支持PHP : +在第**287**行下,配置 Apache ,添加脚本支持: SetHandler application/x-httpd-php @@ -66,47 +66,47 @@ Apache是现在使用范围最广的web服务器以及开源的HTTP服务器.在 保存并退出。 -现在用sysrc命令,来添加Apache作为开机启动项目 : +现在用 sysrc 命令,来添加 Apache 为开机启动项目: sysrc apache24_enable=yes -然后用下面的命令测试Apache的配置 : +然后用下面的命令测试 Apache 的配置: apachectl configtest -如果到这里都没有问题的话,那么就启动Apache吧 : +如果到这里都没有问题的话,那么就启动 Apache 吧: service apache24 start -如果全部完毕, 在"/usr/local/www/apache24/data" 目录下创建一个phpinfo文件来验证PHP在Apache下完美运行: +如果全部完毕,在“/usr/local/www/apache24/data”目录下创建一个 phpinfo 文件来验证 PHP 在 Apache 下顺利运行: cd /usr/local/www/apache24/data echo "" > info.php -现在就可以访问 freebsd 的服务器 IP : 192.168.1.123:8080/info.php. +现在就可以访问 freebsd 的服务器 IP : 192.168.1.123:8080/info.php 。 ![Apache and PHP on Port 8080](http://blog.linoxide.com/wp-content/uploads/2015/11/Apache-and-PHP-on-Port-8080.png) -Apache 是使用 PHP 在 8080 端口下运行的。 +Apache 及 PHP 运行在 8080 端口。 ### 步骤 5 - 安装 Nginx ### -Nginx 以低内存的占用作为一款高性能的web服务器以及反向代理服务器。在这个步骤里,我们将会使用Nginx作为Apache的反向代理, 因此让我们用pkg命令来安装它吧 : +Nginx 可以以较低内存占用提供高性能的 Web 服务器和反向代理服务器。在这个步骤里,我们将会使用 Nginx 作为Apache 的反向代理,因此让我们用 pkg 命令来安装它吧: pkg install nginx ### 步骤 6 - 配置 Nginx ### -一旦 Nginx 安装完毕, 在 "**nginx.conf**" 文件里,我们需要做一个新的配置文件来替换掉原来的nginx文件。更改到 "/usr/local/etc/nginx/"目录下,并且备份默认 nginx.conf 文件: +一旦 Nginx 安装完毕,在“**nginx.conf**”文件里,我们需要做一个新的配置文件来替换掉原来的 nginx 配置文件。切换到“/usr/local/etc/nginx/”目录下,并且备份默认 nginx.conf 文件: cd /usr/local/etc/nginx/ mv nginx.conf nginx.conf.oroginal -现在就可以创建一个新的 nginx 配置文件了 : +现在就可以创建一个新的 nginx 配置文件了: nano -c nginx.conf -然后粘贴下面的配置: +然后粘贴下面的配置: user www; worker_processes 1; @@ -166,12 +166,12 @@ Nginx 以低内存的占用作为一款高性能的web服务器以及反向代 保存并退出。 -下一步, 在nginx目录下面,创建一个 **proxy.conf** 文件,使其作为反向代理 : +下一步,在 nginx 目录下面,创建一个 **proxy.conf** 文件,使其作为反向代理 : cd /usr/local/etc/nginx/ nano -c proxy.conf -粘贴如下配置 : +粘贴如下配置: proxy_buffering on; proxy_redirect off; @@ -186,27 +186,27 @@ Nginx 以低内存的占用作为一款高性能的web服务器以及反向代 proxy_buffers 100 8k; add_header X-Cache $upstream_cache_status; -保存并退出. +保存并退出。 -最后一步, 为 nginx 的高速缓存创建一个 "/var/nginx/cache"的新目录 : +最后一步,为 nginx 的高速缓存创建一个“/var/nginx/cache”的新目录: mkdir -p /var/nginx/cache ### 步骤 7 - 配置 Nginx 的虚拟主机 ### -在这个步骤里面,我们需要创建一个新的虚拟主机域 "saitama.me", 以跟文件 "/usr/local/www/saitama.me" 和日志文件一同放在 "/var/log/nginx" 目录下。 +在这个步骤里面,我们需要创建一个新的虚拟主机域“saitama.me”,其文档根目录为“/usr/local/www/saitama.me”,日志文件放在“/var/log/nginx”目录下。 -我们必须做的第一件事情就是创建新的目录来存放虚拟主机文件, 在这里我们将用到一个"**vhost**"的新文件. 并创建它 : +我们必须做的第一件事情就是创建新的目录来存放虚拟主机配置文件,我们创建的新目录名为“**vhost**”。创建它: cd /usr/local/etc/nginx/ mkdir vhost -创建好vhost 目录, 那么我们就进入这个目录并创建一个新的虚拟主机文件。这里我取名为 "**saitama.conf**" : +创建好 vhost 目录,然后我们就进入这个目录并创建一个新的虚拟主机文件。这里我取名为“**saitama.conf**”: cd vhost/ nano -c saitama.conf -粘贴如下虚拟主机的配置 : +粘贴如下虚拟主机的配置: server { # Replace with your freebsd IP @@ -254,65 +254,65 @@ Nginx 以低内存的占用作为一款高性能的web服务器以及反向代 保存并退出。 -下一步, 为nginx和虚拟主机创建一个新的日志目录 "/var/log/" : +下一步,为 nginx 和虚拟主机创建一个新的日志目录“/var/log/”: mkdir -p /var/log/nginx/ -如果一切顺利, 在文件的根目录下创建文件 saitama.me : +如果一切顺利,在文件的根目录下创建目录 saitama.me 用作文档根: cd /usr/local/www/ mkdir saitama.me ### 步骤 8 - 测试 ### -在这个步骤里面,我们只是测试我们的nginx和虚拟主机的配置。 +在这个步骤里面,我们只是测试我们的 nginx 和虚拟主机的配置。 -用如下命令测试nginx的配置 : +用如下命令测试 nginx 的配置: nginx -t -如果一切都没有问题, 用 sysrc 命令添加nginx为启动项,并且启动nginx和重启apache: +如果一切都没有问题,用 sysrc 命令添加 nginx 为开机启动项,并且启动 nginx 和重启 apache: sysrc nginx_enable=yes service nginx start service apache24 restart -一切完毕后, 在 saitama.me 目录下,添加一个新的phpinfo文件来验证php的正常运行 : +一切完毕后,在 saitama.me 目录下,添加一个新的 phpinfo 文件来验证 php 的正常运行: cd /usr/local/www/saitama.me echo "" > info.php -然后访问这个域名 : **www.saitama.me/info.php**. +然后访问这个域名: **www.saitama.me/info.php**。 ![Virtualhost Configured saitamame](http://blog.linoxide.com/wp-content/uploads/2015/11/Virtualhost-Configured-saitamame.png) -Nginx 作为Apache的反向代理正在运行了,PHP也同样在进行工作了。 +Nginx 作为 Apache 的反向代理运行了,PHP 也同样工作了。 -这是另一种结果 : +这是另一个结果: -无缓存的 Test .html 文件。 +测试无缓存的 .html 文件。 curl -I www.saitama.me ![html with no-cache](http://blog.linoxide.com/wp-content/uploads/2015/11/html-with-no-cache.png) -有三十天缓存的 Test .css 文件。 +测试有三十天缓存的 .css 文件。 curl -I www.saitama.me/test.css ![css file 30day cache](http://blog.linoxide.com/wp-content/uploads/2015/11/css-file-30day-cache.png) -正常缓存的 Test .php 文件: +测试缓存的 .php 文件: curl -I www.saitama.me/info.php ![PHP file cached](http://blog.linoxide.com/wp-content/uploads/2015/11/PHP-file-cached.png) -全部完成。 +全部搞定。 ### 总结 ### -Nginx 是最受欢迎的 HTTP 和反向代理服务器,拥有丰富的高性能和低内存/RAM的使用功能。Nginx使用了太多的缓存, 我们可以在网络上缓存静态文件使得网页加速,并且在用户需要的时候再缓存php文件。这样 Nginx 的轻松配置和使用可以让它用作HTTP服务器或者 apache的反向代理。 +Nginx 是最受欢迎的 HTTP 和反向代理服务器,拥有丰富的功能、高性能、低内存/RAM 占用。Nginx 也用于缓存, 我们可以在网络上缓存静态文件使得网页加速,并且缓存用户请求的 php 文件。 Nginx 容易配置和使用,可以将它用作 HTTP 服务器或者 apache 的反向代理。 -------------------------------------------------------------------------------- @@ -320,7 +320,7 @@ via: http://linoxide.com/linux-how-to/install-nginx-reverse-proxy-apache-freebsd 作者:[Arul][a] 译者:[KnightJoker](https://github.com/KnightJoker) -校对:[Caroline(https://github.com/carolinewuyan) +校对:[Caroline](https://github.com/carolinewuyan),[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From fb9ddc590d5bec38420f2fd57acb924a1cf05026 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 7 Jan 2016 20:07:39 +0800 Subject: [PATCH 0163/1469] PUB:20151013 DFileManager--Cover Flow File Manager @bestony --- ...3 DFileManager--Cover Flow File Manager.md | 64 +++++++++++++++++++ ...3 DFileManager--Cover Flow File Manager.md | 61 ------------------ 2 files changed, 64 insertions(+), 61 deletions(-) create mode 100644 published/20151013 DFileManager--Cover Flow File Manager.md delete mode 100644 translated/tech/20151013 DFileManager--Cover Flow File Manager.md diff --git a/published/20151013 DFileManager--Cover Flow File Manager.md b/published/20151013 DFileManager--Cover Flow File Manager.md new file mode 100644 index 0000000000..31e953c8da --- /dev/null +++ b/published/20151013 DFileManager--Cover Flow File Manager.md @@ -0,0 +1,64 @@ +DFileManager:封面流(CoverFlow)文件管理器 +================================================================================ + +这个一个 Ubuntu 标准软件仓库中缺失的像宝石般的、有着其独特的功能的文件管理器。这是 DFileManager 在推特中的宣称。 + +有一个不好回答的问题,如何知道到底有多少个 Linux 的开源软件?好奇的话,你可以在 Shell 里输入如下命令: + + ~$ for f in /var/lib/apt/lists/*Packages; do printf '%5d %s\n' $(grep '^Package: ' "$f" | wc -l) ${f##*/} done | sort -rn + +在我的 Ubuntu 15.04 系统上,产生结果如下: + +![Ubuntu 15.04 Packages](http://www.linuxlinks.com/portal/content/reviews/FileManagers/UbuntuPackages.png) + +正如上面的截图所示,在 Universe 仓库中,大约有39000个包,在 main 仓库中大约有8500个包。这听起来很多。但是这些包括了开源应用、工具、库,有很多不是由 Ubuntu 开发者打包的。更重要的是,有很多重要的软件不在库中,只能通过源代码编译。DFileManager 就是这样一个软件。它是仍处在开发早期的一个基于 QT 的跨平台文件管理器。QT提供单一源码下的跨平台可移植性。 + +现在还没有二进制文件包,用户需要编译源代码才行。对于一些工具来说,这个可能会产生很大的问题,特别是如果这个应用依赖于某个复杂的依赖库,或者需要与已经安装在系统中的软件不兼容的某个版本。 + +### 安装 ### + +幸运的是,DFileManager 非常容易编译。对于我的老 Ubutnu 机器来说,在开发者网站上的安装介绍提供了大部分的重要步骤,不过少量的基础包没有列出(为什么总是这样?虽然许多库会让文件系统变得一团糟!)。在我的系统上,从github 下载源代码并且编译这个软件,我在 Shell 里输入了以下命令: + + ~$ sudo apt-get install qt5-default qt5-qmake libqt5x11extras5-dev + ~$ git clone git://git.code.sf.net/p/dfilemanager/code dfilemanager-code + ~$ cd dfilemananger-code + ~$ mkdir build + ~$ cd build + ~$ cmake ../ -DCMAKE_INSTALL_PREFIX=/usr + ~$ make + ~$ sudo make install + +你可以通过在shell中输入如下命令来启动它: + + ~$ dfm + +下面是运行中的 DFileManager,完全展示了其最吸引人的地方:封面流(Cover Flow)视图。可以在当前文件夹的项目间滑动,提供了一个相当有吸引力的体验。这是看图片的理想选择。这个文件管理器酷似 Finder(苹果操作系统下的默认文件管理器),可能会吸引你。 + +![DFileManager in action](http://www.linuxlinks.com/portal/content/reviews/FileManagers/Screenshot-dfm.png) + +### 特点: ### + +- 4种视图:图标、详情、列视图和封面流 +- 按位置和设备归类书签 +- 标签页 +- 简单的搜索和过滤 +- 自定义文件类型的缩略图,包括多媒体文件 +- 信息栏可以移走 +- 单击打开文件和目录 +- 可以排队 IO 操作 +- 记住每个文件夹的视图属性 +- 显示隐藏文件 + +DFileManager 不是 KDE 的 Dolphin 的替代品,但是能做相同的事情。这个是一个真正能够帮助人们的浏览文件的文件管理器。还有,别忘了反馈信息给开发者,任何人都可以做出这样的贡献。 + +-------------------------------------------------------------------------------- + +via: http://gofk.tumblr.com/post/131014089537/dfilemanager-cover-flow-file-manager-a-real-gem + +作者:[gofk][a] +译者:[bestony](https://github.com/bestony) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://gofk.tumblr.com/ diff --git a/translated/tech/20151013 DFileManager--Cover Flow File Manager.md b/translated/tech/20151013 DFileManager--Cover Flow File Manager.md deleted file mode 100644 index 39b376c113..0000000000 --- a/translated/tech/20151013 DFileManager--Cover Flow File Manager.md +++ /dev/null @@ -1,61 +0,0 @@ -DFileManager:文件流文件管理器 -================================================================================ -一个像宝石一样的文件管理器从Ubuntu标准库中缺失,但是有器自己的独特的特色。DFileManager是一个推特一样的产品 - -一个很棘手的问题是,如何知道有多少个Linux开源软件可以被使用。出于好奇,你可以在Shell里输入如下命令 - - ~$ for f in /var/lib/apt/lists/*Packages; do printf ’%5d %s\n’ $(grep ’^Package: ’ “$f” | wc -l) ${f##*/} done | sort -rn - -在我的Ubuntu15.04系统上,会产生如下结果 -![Ubuntu 15.04 Packages](http://www.linuxlinks.com/portal/content/reviews/FileManagers/UbuntuPackages.png) - -正如上面的截图所示,在所有的库中,大约有39000个包,在主库中有8500个包。这听起来很少.但是这些自助形式的开源软件、组件、支持库有很多不是由Ubuntu开发者打包的。重要的是,有很多重要的组件不在库中,只能通过源代码编译。DFileManager就是这样一个组件。他是仍处在早期阶段的一个QT跨平台文件管理器.QT提供单一源码的跨平台可移植性。 - -在缺失二进制文件的包里,用户需要编译源代码。对于一些工具来说,这个可能会产生很大的问题,特别是如果这个应用依赖于任何一个含糊不清的依赖库,或者某个没有被编译在系统中的特殊软件版本。 -### 安装 ### - -幸运的是,DFileManager非常容易编译。对于我的老Ubutnu来说,这个在开发者网站上的安装介绍提供了大部分的重要步骤,不过,少量的基础包没有在上面(为什么总是这样?虽然支持库会让文件系统变得一团糟!)。在我的系统上,为了做好准备,从github上下载源代码并且编译这个软件,我在Shell里输入了以下命令: - - ~$ sudo apt-get install qt5-default qt5-qmake libqt5x11extras5-dev - ~$ git clone git://git.code.sf.net/p/dfilemanager/code dfilemanager-code - ~$ cd dfilemananger-code - ~$ mkdir build - ~$ cd build - ~$ cmake ../ -DCMAKE_INSTALL_PREFIX=/usr - ~$ make - ~$ sudo make install - -你可以通过在shell中输入如下命令来启动它 - - ~$ dfm - -下面是在最吸引人的操作界面下操作的DFileManager,文件流视图.这提供了一个拥有相当有吸引力的体验的滑动当前文件夹下的文件的能力。这是看图片的理想选择。这个文件管理器酷似Finder(Macintosh 操作系统下的默认文件管理器),可能会对你有吸引力。 - -![DFileManager in action](http://www.linuxlinks.com/portal/content/reviews/FileManagers/Screenshot-dfm.png) - -### 特点: ### - -- 4种视图:图标、详请、列和文件流 -- 通过位置和设备归类书签 -- 标签页 -- 简单的搜索和过滤 -- 自定义文件类型的缩略图,包括多媒体文件 -- 可以移动的信息栏 -- 单击打开文件和目录 -- 控制队列IO操作 -- 记住每个文件夹的视图属性 -- 显示隐藏文件 - -DFileManager 不是KDE 的Dolphin,但是能做相同的事情。这个是一个真正能够帮助人们的浏览文件的文件管理器。还有,别忘了反馈信息给开发者,任何人都可以做出这样的贡献 - --------------------------------------------------------------------------------- - -via: http://gofk.tumblr.com/post/131014089537/dfilemanager-cover-flow-file-manager-a-real-gem - -作者:[gofk][a] -译者:[bestony](https://github.com/bestony) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://gofk.tumblr.com/ From a119909cde08f45ba88235f54b25e6982439f12c Mon Sep 17 00:00:00 2001 From: Stdio A Date: Thu, 7 Jan 2016 20:19:20 +0800 Subject: [PATCH 0164/1469] =?UTF-8?q?=E9=87=8D=E6=96=B0=E6=95=B4=E7=90=86?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Successfully Install Linux on a Potato.md} | 3 +- ... Linux on a Potato - hittlle_translated.md | 31 ------------------- ... Successfully Install Linux on a Potato.md | 31 ------------------- 3 files changed, 2 insertions(+), 63 deletions(-) rename translated/share/{Hackers Successfully Install Linux on a Potato/Hackers Successfully Install Linux on a Potato - StdioA_translated.md => Hackers Successfully Install Linux on a Potato.md} (90%) delete mode 100644 translated/share/Hackers Successfully Install Linux on a Potato/Hackers Successfully Install Linux on a Potato - hittlle_translated.md delete mode 100644 translated/share/Hackers Successfully Install Linux on a Potato/Hackers Successfully Install Linux on a Potato.md diff --git a/translated/share/Hackers Successfully Install Linux on a Potato/Hackers Successfully Install Linux on a Potato - StdioA_translated.md b/translated/share/Hackers Successfully Install Linux on a Potato.md similarity index 90% rename from translated/share/Hackers Successfully Install Linux on a Potato/Hackers Successfully Install Linux on a Potato - StdioA_translated.md rename to translated/share/Hackers Successfully Install Linux on a Potato.md index d6708676e6..1e9d3fc723 100644 --- a/translated/share/Hackers Successfully Install Linux on a Potato/Hackers Successfully Install Linux on a Potato - StdioA_translated.md +++ b/translated/share/Hackers Successfully Install Linux on a Potato.md @@ -2,7 +2,7 @@ ================================================================================ -来自荷兰阿姆斯特丹的消息称,来自`LinuxOnAnything.nl网站的黑客在马铃薯上成功安装了Linux。这是操作系统第一次在根用蔬菜上安装成功。 +来自荷兰阿姆斯特丹的消息称,LinuxOnAnything.nl网站的黑客在马铃薯上成功安装了Linux。这是操作系统第一次在根用蔬菜上安装成功。 ![Linux Potato](http://www.bbspot.com/Images/News_Features/2008/12/linux-potato.jpg) @@ -26,6 +26,7 @@ LOA是第一个将Linux安装到一匹设得兰矮种马上的小组,但最近 via: http://www.bbspot.com/news/2008/12/linux-on-a-potato.html 译者:[StdioA](https://github.com/StdioA) +协同翻译:[hittlle](https://github.com/hittlle) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/translated/share/Hackers Successfully Install Linux on a Potato/Hackers Successfully Install Linux on a Potato - hittlle_translated.md b/translated/share/Hackers Successfully Install Linux on a Potato/Hackers Successfully Install Linux on a Potato - hittlle_translated.md deleted file mode 100644 index 0f77926425..0000000000 --- a/translated/share/Hackers Successfully Install Linux on a Potato/Hackers Successfully Install Linux on a Potato - hittlle_translated.md +++ /dev/null @@ -1,31 +0,0 @@ -# 黑客成功在马铃薯上安装Linux - -================================================================================ - -来自荷兰阿姆斯特丹的消息称,LinuxOnAnything.nl站点的黑客在马铃著上成功安装了Linux。这是操作系统第一次在根用蔬菜(译注:root vetetable, 一语双关,root在Linux是超级用户)上安装成功。 - -![Linux Potato](http://www.bbspot.com/Images/News_Features/2008/12/linux-potato.jpg) - -『马铃著上没有CPU, 内存和其它存储空间,这真的是一个挑战』, 来自LOA(LinuxOnAnything)的Johan Piest如是说。『很显然我们不能安装像Fedora或者Ubuntu这些体量比较大的Linux发行版,我们用的是Damn Small Linux这个发行版』 - -在尝试了几周之后,LOA小组的同学们弄出了一个适合马铃薯体量的Linux内核;这玩艺儿上面可以用vi来编辑小的文本文件。这个内核通过U盘加载到马铃薯上;并通过一组红黑线用二进制的方式向这个内核发送命令。 - -LOA小组是一个不断壮大的黑客组织的一个分支;这个组织致力于将Linux安装到所有物体上;他们先是将Linux装到Gameboys和iPods等电子产品上,不过最近他们在挑战一些高难度的东西,譬如将Linux安装到灯泡和小狗(????puppies确实是小狗啊,难道有其它意思???)身上。 - -The LOA group was in a race with another hacker group, the Stuttering Monarchs, to be the first to bag the potato. “The potato has been the vegetable that everyone has been gunning for, because it's so versatile like Linux itself. You can boil 'em, mash 'em, stick 'em in a stew,” said Piest. “You'd think we'd get some sort of reward for this, but it's all about bragging rights for us.” - -LOA was the group that first installed Linux on a Shetland pony in 2003, but growing competition from other hacker groups have shut them out in the past five years. - -“We were close to being the first with Linux on a cracker, but those jerks from Norway beat us out,” said Piest. - -The first vegetable Linux install was on a head of iceberg lettuce by a group of hackers in Turkey. - - --------------------------------------------------------------------------------- - -via: http://www.bbspot.com/news/2008/12/linux-on-a-potato.html - -译者:[hittlle](https://github.com/hittlle) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/translated/share/Hackers Successfully Install Linux on a Potato/Hackers Successfully Install Linux on a Potato.md b/translated/share/Hackers Successfully Install Linux on a Potato/Hackers Successfully Install Linux on a Potato.md deleted file mode 100644 index b33e43b2ed..0000000000 --- a/translated/share/Hackers Successfully Install Linux on a Potato/Hackers Successfully Install Linux on a Potato.md +++ /dev/null @@ -1,31 +0,0 @@ -# Hackers Successfully Install Linux on a Potato - -================================================================================ - -Amsterdam, Netherlands – Hackers from the LinuxOnAnything.nl Web site successfully installed Linux on a potato. It's the first time the operating system has been successfully installed on a root vegetable. - -![Linux Potato](http://www.bbspot.com/Images/News_Features/2008/12/linux-potato.jpg) - -“A potato doesn't have a CPU, memory or storage space, so it was quite a challenge,” said Johan Piest of the Linux on Anything (LOA) group. “Obviously we couldn't use a large distribution like Fedora or Ubuntu, so we went with Damn Small Linux.” - -After weeks of trying the group got a Linux kernel specially modified for a potato loaded, and were able to edit a small text file in vi. Linux was loaded onto the potato using a USB thumb drive and commands were sent in binary to the potato using a set of red and black wires. - -The LOA group is a part of a growing group of hackers attempting to get Linux loaded on anything. It started on electronic devices like Gameboys and iPods, but recently groups have taken on tougher challenges like light bulbs and puppies. - -The LOA group was in a race with another hacker group, the Stuttering Monarchs, to be the first to bag the potato. “The potato has been the vegetable that everyone has been gunning for, because it's so versatile like Linux itself. You can boil 'em, mash 'em, stick 'em in a stew,” said Piest. “You'd think we'd get some sort of reward for this, but it's all about bragging rights for us.” - -LOA was the group that first installed Linux on a Shetland pony in 2003, but growing competition from other hacker groups have shut them out in the past five years. - -“We were close to being the first with Linux on a cracker, but those jerks from Norway beat us out,” said Piest. - -The first vegetable Linux install was on a head of iceberg lettuce by a group of hackers in Turkey. - - --------------------------------------------------------------------------------- - -via: http://www.bbspot.com/news/2008/12/linux-on-a-potato.html - -译者:[翻译者ID](https://github.com/翻译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 67aaf2119147a94fb9245eb0444d4f6996a534c6 Mon Sep 17 00:00:00 2001 From: cposture Date: Thu, 7 Jan 2016 20:28:33 +0800 Subject: [PATCH 0165/1469] =?UTF-8?q?=E6=9C=AA=E5=AE=8C=E6=88=90,=E4=B8=8D?= =?UTF-8?q?=E8=A6=81=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...es – Creating & Managing System Backups.md | 155 ++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 translated/tech/LFCS/Part 6 - LFCS--Assembling Partitions as RAID Devices – Creating & Managing System Backups.md diff --git a/translated/tech/LFCS/Part 6 - LFCS--Assembling Partitions as RAID Devices – Creating & Managing System Backups.md b/translated/tech/LFCS/Part 6 - LFCS--Assembling Partitions as RAID Devices – Creating & Managing System Backups.md new file mode 100644 index 0000000000..94ffe0d7f7 --- /dev/null +++ b/translated/tech/LFCS/Part 6 - LFCS--Assembling Partitions as RAID Devices – Creating & Managing System Backups.md @@ -0,0 +1,155 @@ +[未完成,不要合并-Translating By cposture 2016-01-07] +LFCS 系列第六讲://创建和管理系统备份 +==== + +Linux 基金会已经发起了一个全新的 LFCS(Linux Foundation Certified Sysadmin,Linux 基金会认证系统管理员)认证,旨在让来自世界各地的人有机会参加到 LFCS 测试,获得关于有能力在 Linux 系统中执行中间系统管理任务的认证。该认证包括:维护正在运行的系统和服务的能力、全面监控和分析的能力以及何时上游团队请求支持的决策能力。 + +//图片 + +LFCS 系列第五讲 + +以下视频介绍了 Linux 基金会认证程序。 + +本讲是《十套教程》系列中的第六讲,在这一讲里,我们将会解释如何组装分区作为RAID设备——创建和管理系统备份。这些都是 LFCS 认证中的必备知识。 + +# 了解RAID + +被称为独立磁盘冗余阵列(RAID)的技术是一种将多个硬盘组合成一个单独逻辑单元的存储解决方案,它提供了数据冗余功能并且改善硬盘的读写性能。 + +然而,实际的容错和磁盘I/O性能硬盘取决于如何将多个硬盘组装成磁盘阵列。根据可用的设备和容错/性能的需求,RAID被分为不同的级别,你可以在Tecmint.com上参考RAID系列文章以获得每个RAID级别更详细的解释。 + +* //网址 + +我们选择用于创建、组装、管理、监视软件RAID的工具,叫做mdadm(multiple disk 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 # +``` + +## 组装分区作为RAID设备 + +组装已有分区作为RAID设备的过程由以下步骤组成。 + +1. 使用mdadm创建阵列 + +如果先前其中一个分区被格式化,或者作为了另一个RAID阵列的一部分,你会被提示以确认创建一个新的阵列。假设你已经采取了必要的预防措施以避免丢失重要数据,那么可以安全地输入Y并且按下回车。 + +``` +# mdadm --create --verbose /dev/md0 --level=stripe --raid-devices=2 /dev/sdb1 /dev/sdc1 +``` + +//图片 + +创建RAID阵列 + +2. 检查阵列的创建状态 + +在创建了RAID阵列之后,你可以检查使用以下命令检查阵列的状态 + +``` +# cat /proc/mdstat +or +# mdadm --detail /dev/md0 [More detailed summary] +``` + +//图片 + +检查RAID阵列的状态 + +3. 格式化RAID设备 + +如本系列4部分所介绍的,按照你的需求/要求采用某种文件系统格式化你的设备 + +4. 监控RAID阵列服务 + +指示监控服务时刻监视你的RAID阵列。把```# mdadm --detail --scan```命令输出结果添加到/etc/mdadm/mdadm.conf(Debian和derivatives)或者/etc/mdadm.conf(Cent0S/openSUSE),如下。 +``` +# mdadm --detail --scan +``` +//图片 + +监控RAID阵列 + +``` +# mdadm --assemble --scan [Assemble the array] +``` +为了确保服务能够开机启动,需要以root权限运行以下命令。 + +## Debian 和 Derivatives + +Debian 和 Derivatives能够通过下面步骤使服务默认开机启动 +``` +# update-rc.d mdadm defaults +``` +在/etc/default/mdadm文件中添加下面这一行 +``` +AUTOSTART=true +``` + +## CentOS 和 openSUSE(systemd-based) + +``` +# systemctl start mdmonitor +# systemctl enable mdmonitor +``` + +## CentOS 和 openSUSEi(SysVinit-based) + +``` +# service mdmonitor start +# chkconfig mdmonitor on +``` + +5. 检查RAID磁盘故障 + +在支持冗余的的RAID级别中,在需要时会替换故障的驱动器。当磁盘阵列中的设备出现故障时,仅当存在我们第一次创建阵列时预留的备用设备时,磁盘阵列会将自动启动重建。 + +//图片 + +检查RAID故障磁盘 + +否则,我们需要手动连接一个额外的物理驱动器到我们的系统,并且运行。 + +``` +# mdadm /dev/md0 --add /dev/sdX1 +``` + +/dev/md0是出现了问题的阵列,而/dev/sdx1是新添加的设备。 + +6. 分解一个工作阵列 + +如果你需要使用工作阵列的设备创建一个新的阵列,你可能不得不去分解已有工作阵列——(可选步骤) + +``` +# 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. 设置邮件通知 + +你可以配置一个用于发送通知的有效邮件地址或者系统账号(确保在mdadm.conf文件中有下面这一行)。——(可选步骤) +``` +MAILADDR root +``` + +在这种情况下,来自RAID后台监控程序所有的通知将会发送到你的本地root账号的邮件箱中。其中一个类似的通知如下。 + +说明:此次通知事件和第5步中的例子相关。一个设备被标志为错误并且一个空闲的设备自动地被mdadm加入到阵列。我们用完了所有"健康的"空闲设备,因此我们得到了通知。 + +//图片 + +RAID监控通知 + + From 38d82260bb5e9ce295fa940322335f4a4c37b6f1 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 7 Jan 2016 22:11:41 +0800 Subject: [PATCH 0166/1469] PUB:20151107 Hackers Successfully Install Linux on a Potato MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @StdioA @hittlle 这是一篇恶搞,翻译的挺好玩~~ --- ... Successfully Install Linux on a Potato.md | 32 +++++++++++++++++++ ... Successfully Install Linux on a Potato.md | 32 ------------------- 2 files changed, 32 insertions(+), 32 deletions(-) create mode 100644 published/20151107 Hackers Successfully Install Linux on a Potato.md delete mode 100644 translated/share/Hackers Successfully Install Linux on a Potato.md diff --git a/published/20151107 Hackers Successfully Install Linux on a Potato.md b/published/20151107 Hackers Successfully Install Linux on a Potato.md new file mode 100644 index 0000000000..b35220730b --- /dev/null +++ b/published/20151107 Hackers Successfully Install Linux on a Potato.md @@ -0,0 +1,32 @@ +黑客们成功地在土豆上安装了 Linux ! +================================================================================ + +来自荷兰阿姆斯特丹的消息称,LinuxOnAnything.nl 网站的黑客们成功地在土豆上安装了 Linux!这是该操作系统第一次在根用蔬菜(root vegetable)上安装成功(LCTT 译注:root vetetable,一语双关,root 在 Linux 是指超级用户)。 + +![Linux Potato](http://www.bbspot.com/Images/News_Features/2008/12/linux-potato.jpg) + +“土豆没有 CPU,内存和存储器,这真的是个挑战,” Linux On Anything (LOA) 小组的 Johan Piest 说。“显然我们不能使用一个像 Fedora 或 Ubuntu 这些体量较大的发行版,所以我们用的是 Damn Small Linux。” + +在尝试了几周之后,LOA 小组的的同学们弄出了一个适合土豆的 Linux 内核,这玩艺儿上面可以用 vi 来编辑小的文本文件。这个 Linux 通过一个小型的 U 盘加载到土豆上,并通过一组红黑线以二进制的方式向这个土豆发送命令。 + +LOA 小组是一个不断壮大的黑客组织的分支;这个组织致力于将 Linux 安装到所有物体上;他们先是将 Linux 装到Gameboy 和 iPod 等电子产品上,不过最近他们在挑战一些高难度的东西,譬如将Linux安装到灯泡和小狗身上! + +LOA 小组在与另一个黑客小组 Stuttering Monarchs 竞赛,看谁先拿到土豆这一分。“土豆是一种每个人都会接触到的蔬菜,它的用途就像 Linux 一样极其广泛。无论你是想煮捣烹炸还是别的都可以” Piest 说道,“你也许认为我们完成这个挑战是为了获得某些好处,而我们只是追求逼格而已。” + +LOA 是第一个将 Linux 安装到一匹设德兰矮种马上的小组,但这五年来竞争愈演愈烈,其它黑客小组的进度已经反超了他们。 + +“我们本来可以成为在饼干上面安装 Linux 的第一个小组,但是那群来自挪威的混蛋把我们击败了。” Piest 说。 + +第一个成功安装了 Linux 的蔬菜是一头卷心菜,它是由一个土耳其的一个黑客小组完成的。 + +(好啦——是不是已经目瞪口呆,事实上,这是一篇好几年前的恶搞文,你看出来了吗?哈哈哈哈) + +-------------------------------------------------------------------------------- + +via: http://www.bbspot.com/news/2008/12/linux-on-a-potato.html + +作者:[Brian Briggs](briggsb@bbspot.com) +译者:[StdioA](https://github.com/StdioA), [hittlle](https://github.com/hittlle) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/translated/share/Hackers Successfully Install Linux on a Potato.md b/translated/share/Hackers Successfully Install Linux on a Potato.md deleted file mode 100644 index 1e9d3fc723..0000000000 --- a/translated/share/Hackers Successfully Install Linux on a Potato.md +++ /dev/null @@ -1,32 +0,0 @@ -# 黑客成功在马铃薯上安装Linux - -================================================================================ - -来自荷兰阿姆斯特丹的消息称,LinuxOnAnything.nl网站的黑客在马铃薯上成功安装了Linux。这是操作系统第一次在根用蔬菜上安装成功。 - -![Linux Potato](http://www.bbspot.com/Images/News_Features/2008/12/linux-potato.jpg) - -“土豆没有CPU,内存和海量存储器,所以这确实是一个挑战,” Linux On Anything (LOA) 小组的Johan Piest说。“显然我们不能使用一个像Fedora或Ubuntu一样的大型发行版,所以我们使用了Damn Small Linux.” - -经过几周的尝试,这个小组制作了一个经过特殊修改的Linux内核,这个内核可以装载到土豆上,而且可以使用vi修改一个小的文本文件。他们将Linux通过一个小型USB存储器加载到土豆上,而命令通过一组红色和黑色线以二进制形式传输至土豆中。 - -LOA小组是一个由一群尝试在任何东西上加载Linux的黑客们构成的、不断壮大的小组。他们从电子设备(如Gameboy和iPod)开始,不过最近这个小组开始面对一些更严峻的挑战,比如在电灯泡和小狗上加载Linux. - -LOA小组在与另一个Stuttering Monarchs——另一个黑客小组竞赛,看谁先拿到土豆这一分。“马铃薯是一种非常抢手的蔬菜,因为它的用途极其广泛,就像Linux本身一样。你可以煮它,捣碎它,在焖锅中杵它,” Piest说道,“你可以认为我们完成这个挑战可以获得某些奖项,但我们认为这是我们吹嘘的一种成本。” - -LOA是第一个将Linux安装到一匹设得兰矮种马上的小组,但最近五年这个竞争愈演愈烈,其它黑客小组的进度已经反超了他们。 - -“我们本来可以成为在薄脆饼干上面加载Linux的第一个小组,但是那群来自挪威的混蛋把我们赢了。” Piest说。 - -第一个成功安装Linux的蔬菜是一头卷心菜,它由一个来自土耳其的一个黑客小组完成安装。 - - --------------------------------------------------------------------------------- - -via: http://www.bbspot.com/news/2008/12/linux-on-a-potato.html - -译者:[StdioA](https://github.com/StdioA) -协同翻译:[hittlle](https://github.com/hittlle) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 56a00be6aff15d1bf960a68cf974a0d944d10aea Mon Sep 17 00:00:00 2001 From: "Fuliang.Li" Date: Fri, 8 Jan 2016 09:35:52 +0800 Subject: [PATCH 0167/1469] =?UTF-8?q?[=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= =?UTF-8?q?]=2020151208=206=20useful=20LibreOffice=20extensions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0151208 6 useful LibreOffice extensions.md | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 translated/talk/yearbook2015/20151208 6 useful LibreOffice extensions.md diff --git a/translated/talk/yearbook2015/20151208 6 useful LibreOffice extensions.md b/translated/talk/yearbook2015/20151208 6 useful LibreOffice extensions.md new file mode 100644 index 0000000000..b8d4f1fa1c --- /dev/null +++ b/translated/talk/yearbook2015/20151208 6 useful LibreOffice extensions.md @@ -0,0 +1,78 @@ +GHLandy Translated + +LibreOffice 中的六大实用扩展组件 +================================================================================ +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/yearbook2015-osdc-lead-2.png) + +图片来源:Opensource.com + +LibreOffice 是最好的免费办公套件,并在所有的主要 Linux 发行版中得到应用。尽管 LibreOffice 已经拥有了大多数特性,它仍然可以添加特定的附加组件,即扩展。 + +LibreOffice 的扩展组件的网站是 [extensions.libreoffice.org][1]。扩展组件只是一些工具,可以在安装主体上进行独立添加或者移除,以便增加新功能或者让已有功能更容易使用。 + +### 1. 多格式保存组件 ### + +多格式保存组件可以根据用户的设置,同时将文档保存为开源文档、微软 Office 文档或者 PDF 文档。在你将微软 Office 文档格式转为标准的[开源文档格式][2]的时候,这个组件就很实用了,因为该组件同时提供了两种选择:互操作性较强的 ODF 文档格式以及为所有用户让在实用的微软 Office 文档格式保持兼容性。这样使管理员的文档迁移过程变得更具弹性、更易于管理。 + +**[下载 多格式保存组件][3]** + +![Multiformatsave extension](https://opensource.com/sites/default/files/images/business-uploads/multiformatsave.png) + +### 2. Writer 中可交替使用的查找与替换组件(交替搜索) ### + +该组件向 Writer 中的查找与替换功能添加了许多新特性:可以查找和替换一段或多段文本;一次执行在多个查找和替换;搜索:书签、笔记、文本字段、交叉引用和参考标志内容、名称或标志及其插入;搜索和插入脚注和尾注;通过名称来搜索表格对象、图像和文本框;搜索帮助手册页的分栏符以及创建和失活时间;根据光标位置搜索相同格式的文本。还可以保存/加载查找和替换参数,并在多个同时打开的文件中执行批处理。 + +**[下载 Writer 中可交替使用的查找与替换组件(交替搜索)][4]** + +![Alternative Find&amp;Replace add-on](https://opensource.com/sites/default/files/images/business-uploads/alternativefindreplace.png) + +### 3. Pepito 清除组件 ### +中 LibreOffice 中, Pepito 清除组件主要用来快速清除并修复旧扫描件、导入的 PDF 以及每个电子文本文档的格式错误。通过点击 LibreOffice 工具栏中的 Pepito 图标,用户可以打开一个用于分析文档并呈现文档错误类型。当你将 PDF 文档转换为 ODF 文档时,这个工具就非常有用了,它会自动清除转换过程中出现的错误。 + +**[下载 Pepito 清除组件][5]** + +![Pepito cleaner screenshot](https://opensource.com/sites/default/files/images/business-uploads/pepitocleaner.png) + +### 4. ImpressRunner 组件### +Impress Runner 是将 [Impress][6] 文档转换成自动播放文件的扩展组件。该组件会添加两个图标,用以设置或移除自动开始播放的功能,我们还可以通过编辑 文件 | 属性 | 自定义属性 菜单来手动添加这两个图标,并将自动运行按钮添加到四个文本域之前。在会议与活动组织而且幻灯片无人主持的时候,这个扩展组件就变得非常有用。 + +**[下载 ImpressRunner 组件][7]** + +### 5. 导出为图像组件 ### + +导出为图像组件是 Impress 和 [Draw][8] 中文件菜单里边的一个入口——导出为图像...,,主要用于将所有的幻灯片和页面导出成 JPG、PNG、GIF、BMP 和 TIFF 等图像格式,并且允许用户自定义导出图像的名称、大小以及其他参数。 + +**[下载 导出为图像组件][9]** + +![Export as images extension](https://opensource.com/sites/default/files/images/business-uploads/exportasimages.png) + +### 6. Anaphraseus 组件### +Anaphraseus 是一个 CAT(Computer-Aided Translation,计算机辅助翻译)工具组件,用来创建、管理双语翻译。Anaphraseus 是一个设置成扩展组件或者独立文档的 LibreOffice 宏。最开始,开发者设计 Anaphraseus 为快速翻译(Wordfast)格式,但现在它可以将文件导入或者到出成 TMX 格式。其主要特性:分本分割、在翻译记录中模糊搜索、术语识别以及导入导出 TMX(OmegaT translation memory format,OmegaT 翻译存储格式)。 + +**[下载 Anaphraseus 组件][10]** + +![Anaphraseus screenshot](https://opensource.com/sites/default/files/images/business-uploads/anaphraseus.png) + +你是否也有自己喜欢和推荐的 LibreOffice 组件呢?在评论中告诉大家吧。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/business/15/12/6-useful-libreoffice-extensions + +作者:[Italo Vignoli][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/italovignoli +[1]:http://extensions.libreoffice.org/ +[2]:http://www.opendocumentformat.org/ +[3]:http://extensions.libreoffice.org/extension-center/multisave-1 +[4]:http://extensions.libreoffice.org/extension-center/alternative-dialog-find-replace-for-writer +[5]:http://pepitoweb.altervista.org/pepito_cleaner/index.php +[6]:https://www.libreoffice.org/discover/impress/ +[7]:http://extensions.libreoffice.org/extension-center/impressrunner +[8]:https://www.libreoffice.org/discover/draw/ +[9]:http://extensions.libreoffice.org/extension-center/export-as-images +[10]:http://anaphraseus.sourceforge.net/ From bfa8b3aa3e77fa8bb582474a5fe461d76d9a3ef2 Mon Sep 17 00:00:00 2001 From: "Fuliang.Li" Date: Fri, 8 Jan 2016 09:36:10 +0800 Subject: [PATCH 0168/1469] Delete 20151208 6 useful LibreOffice extensions.md --- ...0151208 6 useful LibreOffice extensions.md | 81 ------------------- 1 file changed, 81 deletions(-) delete mode 100644 sources/talk/yearbook2015/20151208 6 useful LibreOffice extensions.md diff --git a/sources/talk/yearbook2015/20151208 6 useful LibreOffice extensions.md b/sources/talk/yearbook2015/20151208 6 useful LibreOffice extensions.md deleted file mode 100644 index be1bb2d553..0000000000 --- a/sources/talk/yearbook2015/20151208 6 useful LibreOffice extensions.md +++ /dev/null @@ -1,81 +0,0 @@ -GHLandy Translating - -6 useful LibreOffice extensions -================================================================================ -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/yearbook2015-osdc-lead-2.png) - -Image by : Opensource.com - -LibreOffice is the best free office suite around, and as such has been adopted by all major Linux distributions. Although LibreOffice is already packed with features, it can be extended by using specific add-ons, called extensions. - -The main LibreOffice extensions website is [extensions.libreoffice.org][1]. Extensions are tools that can be added or removed independently from the main installation, and may add new functionality or make existing functionality easier to use. - -### 1. MultiFormatSave ### - -MultiFormatSave lets users save a document in the OpenDocument, Microsoft Office (old and new), and/or PDF formats simultaneously, according to user settings. This extension is extremely useful during the migration from Microsoft Office document formats to the [Open Document Format][2] standard, because it offers the option to save in both flavors: ODF for interoperability, and Microsoft Office for compatibility with all users sticking to legacy formats. This makes the migration process softer, and easier to administer. - -**[Download MultiFormatSave][3]** - -![Multiformatsave extension](https://opensource.com/sites/default/files/images/business-uploads/multiformatsave.png) - -### 2. Alternative dialog Find & Replace for Writer (AltSearch) ### - -This extension adds many new features to Writer's find & replace function: searched or replaced text can contain one or more paragraphs; multiple search and replacement in one step; searching: Bookmarks, Notes, Text fields, Cross-references and Reference marks to their content, name or mark and their inserting; searching and inserting Footnote and Endnote; searching object of Table, Pictures and Text frames according to their name; searching out manual page and column break and their set up or deactivation; and searching similarly formatted text, according to cursor point. It is also possible to save and load search and replacement parameters, and execute the batch on several opened documents at the same time. - -**[Download Alternative dialog Find & Replace for Writer (AltSearch)][4]** - -![Alternative Find&amp;Replace add-on](https://opensource.com/sites/default/files/images/business-uploads/alternativefindreplace.png) - -### 3. Pepito Cleaner ### - -Pepito Cleaner is an extension of LibreOffice created to quickly resolve the most common formatting mistakes of old scans, PDF imports, and every digital text file. By clicking the Pepito Cleaner icon on the LibreOffice toolbar, users will open a window that will analyze the document and show the results broken down by category. This is extremely useful when converting PDF documents to ODF, as it cleans all the cruft left in place by the automatic process. - -**[Download Pepito Cleaner][5]** - -![Pepito cleaner screenshot](https://opensource.com/sites/default/files/images/business-uploads/pepitocleaner.png) - -### 4. ImpressRunner ### - -Impress Runner is a simple extension that transforms an [Impress][6] presentation into an auto-running file. The extension adds two icons, to set and remove the autostart function, which can also be added manually by editing the File | Properties | Custom Properties menu, and adding the term autostart in one of the first four text fields. This extension is especially useful for booths at conferences and events, where the slides are supposed to run unattended. - -**[Download ImpressRunner][7]** - -### 5. Export as Images ### - -The Export as Images extension adds a File menu entry export as Images... in Impress and [Draw][8], to export all slides or pages as images in JPG, PNG, GIF, BMP, and TIFF format, and allows users to choose a file name for exported images, the image size, and other parameters. - -**[Download Export as Images][9]** - -![Export as images extension](https://opensource.com/sites/default/files/images/business-uploads/exportasimages.png) - -### 6. Anaphraseus ### - -Anaphraseus is a CAT (Computer-Aided Translation) tool for creating, managing, and using bilingual Translation Memories. Anaphraseus is a LibreOffice macro set available as an extension or a standalone document. Originally, Anaphraseus was developed to work with the Wordfast format, but it can also export and import files in TMX format. Anaphraseus main features are: text segmentation, fuzzy search in Translation Memory, terminology recognition, and TMX Export/Import (OmegaT translation memory format). - -**[Download Anaphraseus][10]** - -![Anaphraseus screenshot](https://opensource.com/sites/default/files/images/business-uploads/anaphraseus.png) - -Do you have a favorite LibreOffice extension to recommend? Let us know about it in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/business/15/12/6-useful-libreoffice-extensions - -作者:[Italo Vignoli][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/italovignoli -[1]:http://extensions.libreoffice.org/ -[2]:http://www.opendocumentformat.org/ -[3]:http://extensions.libreoffice.org/extension-center/multisave-1 -[4]:http://extensions.libreoffice.org/extension-center/alternative-dialog-find-replace-for-writer -[5]:http://pepitoweb.altervista.org/pepito_cleaner/index.php -[6]:https://www.libreoffice.org/discover/impress/ -[7]:http://extensions.libreoffice.org/extension-center/impressrunner -[8]:https://www.libreoffice.org/discover/draw/ -[9]:http://extensions.libreoffice.org/extension-center/export-as-images -[10]:http://anaphraseus.sourceforge.net/ From f73f698f171617cbc4b86513e2b2743ce0774959 Mon Sep 17 00:00:00 2001 From: runningwater Date: Fri, 8 Jan 2016 10:02:20 +0800 Subject: [PATCH 0169/1469] =?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 --- ...rep Count Lines If a String or Word Matches.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) rename {sources => translated}/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 4--Grep Count Lines If a String or Word Matches.md (55%) diff --git a/sources/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 4--Grep Count Lines If a String or Word Matches.md b/translated/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 4--Grep Count Lines If a String or Word Matches.md similarity index 55% rename from sources/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 4--Grep Count Lines If a String or Word Matches.md rename to translated/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 4--Grep Count Lines If a String or Word Matches.md index c145320e5a..63cb1aa189 100644 --- a/sources/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 4--Grep Count Lines If a String or Word Matches.md +++ b/translated/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 4--Grep Count Lines If a String or Word Matches.md @@ -1,25 +1,24 @@ -(translating by runningwater) -Grep Count Lines If a String / Word Matches +Grep 命令统计匹配的字符串/单词行数 ================================================================================ -How do I count lines if given word or string matches for each input file under Linux or UNIX operating systems? +在 Linux 或 UNIX 操作系统下,对于给定的单词或字符串,我们应该怎么统计它们在每个输入文件中存在的行数呢? -You need to pass the -c or --count option to suppress normal output. It will display a count of matching lines for each input file: +您需要通过添加 -c 或者 --count 选项参数来抑制正常的输出。它将会显示对输入文件单词匹配的行数,如下示: $ grep -c vivek /etc/passwd -OR +或者 $ grep -w -c vivek /etc/passwd -Sample outputs: +输出的示例: 1 -However, with the -v or --invert-match option it will count non-matching lines, enter: +相反的,使用 -v 或者 --invert 选项参数可以统计出不匹配的输入文件行数,键入: $ grep -c vivek /etc/passwd -Sample outputs: +输出的示例: 45 From 8eb8d82fb5dfe75a1a647e2f8cc8e0fe140a1788 Mon Sep 17 00:00:00 2001 From: Markgolzh <1134386961@qq.com> Date: Fri, 8 Jan 2016 14:09:03 +0800 Subject: [PATCH 0170/1469] =?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 --- ... Light Table 0.8 in Ubuntu 14.04, 15.10.md | 105 ------------------ 1 file changed, 105 deletions(-) delete mode 100644 sources/tech/20151215 How to Install Light Table 0.8 in Ubuntu 14.04, 15.10.md diff --git a/sources/tech/20151215 How to Install Light Table 0.8 in Ubuntu 14.04, 15.10.md b/sources/tech/20151215 How to Install Light Table 0.8 in Ubuntu 14.04, 15.10.md deleted file mode 100644 index fd26cb0104..0000000000 --- a/sources/tech/20151215 How to Install Light Table 0.8 in Ubuntu 14.04, 15.10.md +++ /dev/null @@ -1,105 +0,0 @@ -翻译中 -How to Install Light Table 0.8 in Ubuntu 14.04, 15.10 -================================================================================ -![](http://ubuntuhandbook.org/wp-content/uploads/2014/11/LightTable-IDE-logo-icon.png) - -The Light Table IDE has just reached a new stable release after more than one year of development. Now it provides 64-bit only binary for Linux. - -Changes in LightTable 0.8.0: - -- CHANGED: We have switched to Electron from NW.js -- CHANGED: LT’s releases and self-updating processes are completely in the open on Github -- ADDED: LT can be built from source with provided scripts across supported platforms -- ADDED: Most of LT’s node libraries are installed as npm dependencies instead of as forked libraries -- ADDED: Significant documentation. See more below -- FIX: Major usability issues on >= OSX 10.10 -- CHANGED: 32-bit linux is no longer an official download. Building from source will still be supported -- FIX: ClojureScript eval for modern versions of ClojureScript -- More details at [github.com/LightTable/LightTable/releases][1] - -![LightTable 0.8.0](http://ubuntuhandbook.org/wp-content/uploads/2015/12/lighttable-08.jpg) - -### How to Install Light Table 0.8.0 in Ubuntu: ### - -Below steps show you how to install the official binary in Ubuntu. Works on all current Ubuntu releases (**64-bit only**). - -Before getting started, please make a backup if you have a previous release installed. - -**1.** Download the Linux binary from link below: - -- [lighttable-0.8.0-linux.tar.gz][2] - -**2.** Open terminal from Unity Dash, App Launcher, or via Ctrl+Alt+T keys. When it opens, paste below command and hit enter: - - gksudo file-roller ~/Downloads/lighttable-0.8.0-linux.tar.gz - -![open-via-fileroller](http://ubuntuhandbook.org/wp-content/uploads/2015/12/open-via-fileroller.jpg) - -Install `gksu` from Ubuntu Software Center if the command does not work. - -**3.** Previous command opens the downloaded archive via Archive Manager using root user privilege. - -When it opens, do: - -- right-click and rename the folder name to **LightTable** -- extract it to **Computer -> /opt/** directory. - -![extract-lighttable](http://ubuntuhandbook.org/wp-content/uploads/2015/12/extract-lighttable.jpg) - -Finally you should have the LightTable installed to /opt/ directory: - -![lighttable-in-opt](http://ubuntuhandbook.org/wp-content/uploads/2015/12/lighttable-in-opt.jpg) - -**4.** Create a launcher so you can start LightTable from Unity Dash or App Launcher. - -Open terminal and run below command to create & edit a launcher file for LightTable: - - gksudo gedit /usr/share/applications/lighttable.desktop - -When the file opens via Gedit text editor, paste below and save the file: - - [Desktop Entry] - Version=1.0 - Type=Application - Name=Light Table - GenericName=Text Editor - Comment=Open source IDE that modify, from running programs to embed websites and games - Exec=/opt/LightTable/LightTable %F - Terminal=false - MimeType=text/plain; - Icon=/opt/LightTable/resources/app/core/img/lticon.png - Categories=TextEditor;Development;Utility; - StartupNotify=true - Actions=Window;Document; - - Name[en_US]=Light Table - - [Desktop Action Window] - Name=New Window - Exec=/opt/LightTable/LightTable -n - OnlyShowIn=Unity; - - [Desktop Action Document] - Name=New File - Exec=/opt/LightTable/LightTable --command new_file - OnlyShowIn=Unity; - -So it looks like: - -![lighttable-launcher](http://ubuntuhandbook.org/wp-content/uploads/2015/12/lighttable-launcher.jpg) - -Finally launch the IDE from Unity Dash or Application Launcher and enjoy! - --------------------------------------------------------------------------------- - -via: http://ubuntuhandbook.org/index.php/2015/12/install-light-table-0-8-ubuntu-14-04/ - -作者:[Ji m][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://ubuntuhandbook.org/index.php/about/ -[1]:https://github.com/LightTable/LightTable/releases -[2]:https://github.com/LightTable/LightTable/releases/download/0.8.0/lighttable-0.8.0-linux.tar.gz From 5fae30508aaf1b4e6671c7b4363d12ddbddac0aa Mon Sep 17 00:00:00 2001 From: Markgolzh <1134386961@qq.com> Date: Fri, 8 Jan 2016 14:10:13 +0800 Subject: [PATCH 0171/1469] =?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 --- ... Light Table 0.8 in Ubuntu 14.04, 15.10.md | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 translated/tech/20151215 How to Install Light Table 0.8 in Ubuntu 14.04, 15.10.md diff --git a/translated/tech/20151215 How to Install Light Table 0.8 in Ubuntu 14.04, 15.10.md b/translated/tech/20151215 How to Install Light Table 0.8 in Ubuntu 14.04, 15.10.md new file mode 100644 index 0000000000..322697bfe4 --- /dev/null +++ b/translated/tech/20151215 How to Install Light Table 0.8 in Ubuntu 14.04, 15.10.md @@ -0,0 +1,108 @@ +翻译中 + 如何在 Ubuntu 14.04, 15.10 中安装Light Table 0.8 +================================================================================ +![](http://ubuntuhandbook.org/wp-content/uploads/2014/11/LightTable-IDE-logo-icon.png) + +Light Table 在经过一年以上的开发,已经推出了新的稳定发行版本。现在它只为Linux提供64位的二进制包。 +LightTable 0.8.0的改动: + +- 更改: 我们从 NW.js 中选择了 Electron +- 更改: LT’s 发行版本与自更新进程在github上面完全的公开 +- 增加: LT 可以由提供的脚本从源码在支持的不同平台上安装 +- 增加: LT’s 大部分的代码库将用npm依赖来安装以取代以forked库安装 +- 增加: 有效文档. 更多详情内容见下面 +- 修复: 版本号>= OSX 10.10的系统下工作的主要的可用性问题 +- 更改: 32位Linux不再提供官方包文件下载,从源码安装仍旧将被支持 +- 修复: ClojureScript eval 在ClojureScript的现代版本可以正常工作 +- 参阅更多 [github.com/LightTable/LightTable/releases][1] + +![LightTable 0.8.0](http://ubuntuhandbook.org/wp-content/uploads/2015/12/lighttable-08.jpg) + +### 如何在Ubuntu中安Light Table 0.8.0: ### + +下面的步骤回指导你怎么样在Ubuntu下安装官方的二进制包,在目前Ubuntu发行版本都适用(**仅仅针对64位**)。 + +在开始之前,如果你安装了之前的版本请做好备份。 + +**1.** +从以下链接下载LightTable Linux下的二进制文件: + +- [lighttable-0.8.0-linux.tar.gz][2] + +**2.** +从dash或是应用启动器,或者是Ctrl+Alt+T快捷键打开终端,并且在输入以下命令后敲击回车键: + + gksudo file-roller ~/Downloads/lighttable-0.8.0-linux.tar.gz + +![open-via-fileroller](http://ubuntuhandbook.org/wp-content/uploads/2015/12/open-via-fileroller.jpg) + +如果命令不工作的话从Ubuntu软件中心安装`gksu`。 + +**3.** +之前的命令使用了root用户权限通过档案管理器打开了下载好的存档。 + + +打开它后,请做以下步骤: + +- 右击文件并且将其重命名为 **LightTable** +- 将其解压到 **Computer -> /opt/** 目录下。 + +![extract-lighttable](http://ubuntuhandbook.org/wp-content/uploads/2015/12/extract-lighttable.jpg) + +最终你应该安装好了LightTable,可以在/opt/ 目录下查看: + +![lighttable-in-opt](http://ubuntuhandbook.org/wp-content/uploads/2015/12/lighttable-in-opt.jpg) + +**4.** 创建一个启动器使你可以从dash工具或是应用启动器打开LightTable。 + +打开终端,运行以下命令来创建与编辑一个LightTable的启动文件: + + gksudo gedit /usr/share/applications/lighttable.desktop + +通过Gedit文本编辑器打开文件后, 粘贴下面的内容并保存: + + [Desktop Entry] + Version=1.0 + Type=Application + Name=Light Table + GenericName=Text Editor + Comment=Open source IDE that modify, from running programs to embed websites and games + Exec=/opt/LightTable/LightTable %F + Terminal=false + MimeType=text/plain; + Icon=/opt/LightTable/resources/app/core/img/lticon.png + Categories=TextEditor;Development;Utility; + StartupNotify=true + Actions=Window;Document; + + Name[en_US]=Light Table + + [Desktop Action Window] + Name=New Window + Exec=/opt/LightTable/LightTable -n + OnlyShowIn=Unity; + + [Desktop Action Document] + Name=New File + Exec=/opt/LightTable/LightTable --command new_file + OnlyShowIn=Unity; + +因此它看起来像: + +![lighttable-launcher](http://ubuntuhandbook.org/wp-content/uploads/2015/12/lighttable-launcher.jpg) + +最后,从dash工具或者是应用启动器打开IDE,好好享受它吧! + +-------------------------------------------------------------------------------- + +via: http://ubuntuhandbook.org/index.php/2015/12/install-light-table-0-8-ubuntu-14-04/ + +作者:[Ji m][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ubuntuhandbook.org/index.php/about/ +[1]:https://github.com/LightTable/LightTable/releases +[2]:https://github.com/LightTable/LightTable/releases/download/0.8.0/lighttable-0.8.0-linux.tar.gz From ce08bbb6ad9cb58e79f29c21a3d9d93e7a608e45 Mon Sep 17 00:00:00 2001 From: Markgolzh <1134386961@qq.com> Date: Fri, 8 Jan 2016 14:11:12 +0800 Subject: [PATCH 0172/1469] =?UTF-8?q?=E5=88=A0=E6=8E=89=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...1215 How to Install Light Table 0.8 in Ubuntu 14.04, 15.10.md | 1 - 1 file changed, 1 deletion(-) diff --git a/translated/tech/20151215 How to Install Light Table 0.8 in Ubuntu 14.04, 15.10.md b/translated/tech/20151215 How to Install Light Table 0.8 in Ubuntu 14.04, 15.10.md index 322697bfe4..3b3f72ac4c 100644 --- a/translated/tech/20151215 How to Install Light Table 0.8 in Ubuntu 14.04, 15.10.md +++ b/translated/tech/20151215 How to Install Light Table 0.8 in Ubuntu 14.04, 15.10.md @@ -1,4 +1,3 @@ -翻译中 如何在 Ubuntu 14.04, 15.10 中安装Light Table 0.8 ================================================================================ ![](http://ubuntuhandbook.org/wp-content/uploads/2014/11/LightTable-IDE-logo-icon.png) From cc56e44e979ee13fef9392b0047bd53c7755bad4 Mon Sep 17 00:00:00 2001 From: kylepeng93 <958983476@qq.com> Date: Sat, 9 Jan 2016 13:47:13 +0800 Subject: [PATCH 0173/1469] kylepeng93 translating --- sources/talk/20151202 KDE vs GNOME vs XFCE Desktop.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/talk/20151202 KDE vs GNOME vs XFCE Desktop.md b/sources/talk/20151202 KDE vs GNOME vs XFCE Desktop.md index 5cfbc31ace..ea7c1f93b9 100644 --- a/sources/talk/20151202 KDE vs GNOME vs XFCE Desktop.md +++ b/sources/talk/20151202 KDE vs GNOME vs XFCE Desktop.md @@ -1,3 +1,4 @@ +translating by kylepeng93 KDE vs GNOME vs XFCE Desktop ================================================================================ ![](http://1426826955.rsc.cdn77.org/wp-content/uploads/2013/07/300px-Xfce_logo.svg_.png) @@ -50,4 +51,4 @@ via: http://www.unixmen.com/kde-vs-gnome-vs-xfce-desktop/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://www.unixmen.com/author/pirat9/ \ No newline at end of file +[a]:http://www.unixmen.com/author/pirat9/ From dbd404795633a16a39bfe7caec5da115727c1f67 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Sat, 9 Jan 2016 16:16:31 +0800 Subject: [PATCH 0174/1469] [Translated] tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 6--How To Find Files by Content Under UNIX.md --- ...How To Find Files by Content Under UNIX.md | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) rename {sources => translated}/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 6--How To Find Files by Content Under UNIX.md (59%) diff --git a/sources/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 6--How To Find Files by Content Under UNIX.md b/translated/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 6--How To Find Files by Content Under UNIX.md similarity index 59% rename from sources/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 6--How To Find Files by Content Under UNIX.md rename to translated/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 6--How To Find Files by Content Under UNIX.md index 3d5943fc07..9bf698136a 100644 --- a/sources/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 6--How To Find Files by Content Under UNIX.md +++ b/translated/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 6--How To Find Files by Content Under UNIX.md @@ -1,15 +1,20 @@ +如何在 UNIX 中根据文件内容查找文件 How To Find Files by Content Under UNIX ================================================================================ +为了完成课程作业,我写了很多 C 语言代码并把它们保存为 /home/user/c/*.c and *.h。那么在 UNIX shell 窗口中我如何能通过字符串或者单词(例如函数名 main())文件内容来查找文件呢? I had written lots of code in C for my school work and saved it as source code under /home/user/c/*.c and *.h. How do I find files by content such as string or words (function name such as main() under UNIX shell prompt? +你需要用到以下工具: You need to use the following tools: -[a] **grep command** : print lines matching a pattern. +[a] **grep 命令** : 输出匹配模式的行。 -[b] **find command**: search for files in a directory hierarchy. +[b] **find 命令**: 在目录层次中查找文件。 +### [使用 grep 命令根据内容查找文件][1] ### [grep Command To Find Files By][1] Content ### +输入以下命令: Type the command as follows: grep 'string' *.txt @@ -19,36 +24,48 @@ Type the command as follows: grep -i 'ultra' *.conf grep -iR 'ultra' *.conf +其中 Where +- **-i** : 忽视模式(匹配字符串 valid、 VALID、 ValID )和输入文件(匹配 file.c FILE.c FILE.C)的大小写。 +- **-R** : 递归读取每个目录下的所有文件。 - **-i** : Ignore case distinctions in both the PATTERN (match valid, VALID, ValID string) and the input files (math file.c FILE.c FILE.C filename). - **-R** : Read all files under each directory, recursively +### 高亮匹配到的模式 ### ### Highlighting searched patterns ### +在搜索大量文件的时候你可以轻松地高亮模式: You can highlight patterns easily while searching large number of files: $ grep --color=auto -iR 'getChar();' *.c +### 为查找到的模式显示文件名和行号 ### ### Displaying file names and line number for searched patterns ### +你也许需要显示文件名和行号: You may also need to display filenames and numbers: $ grep --color=auto -iRnH 'getChar();' *.c +其中, Where, +- **-n** : 在输出的每行前面添加文件中以 1 开始的行号。 +- **-H** : 为每个匹配打印文件名。要搜索多个文件时这是默认选项。 - **-n** : Prefix each line of output with the 1-based line number within its input file. - **-H** Print the file name for each match. This is the default when there is more than one file to search. $grep --color=auto -nH 'DIR' * +输出样例: Sample output: -![Fig.01: grep command displaying searched pattern](http://www.cyberciti.biz/faq/wp-content/uploads/2008/09/grep-command.png) +![Fig.01: grep 命令显示搜索到的模式](http://www.cyberciti.biz/faq/wp-content/uploads/2008/09/grep-command.png) -Fig.01: grep command displaying searched pattern +Fig.01: grep 命令显示搜索到的模式 +你也可以使用 find 命令: You can also use find command: $ find . -name "*.c" -print | xargs grep "main(" @@ -58,7 +75,7 @@ You can also use find command: via: http://www.cyberciti.biz/faq/unix-linux-finding-files-by-content/ 作者:Vivek Gite -译者:[译者ID](https://github.com/译者ID) +译者:[ictlyh](http://mutouxiaogui.cn/blog/) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d3ed5411cbf34005b2530d4a6e2574e5011464a8 Mon Sep 17 00:00:00 2001 From: kylepeng93 <958983476@qq.com> Date: Sat, 9 Jan 2016 18:52:50 +0800 Subject: [PATCH 0175/1469] translated --- .../20151202 KDE vs GNOME vs XFCE Desktop.md | 54 ------------------- .../20151202 KDE vs GNOME vs XFCE Desktop.md | 47 ++++++++++++++++ 2 files changed, 47 insertions(+), 54 deletions(-) delete mode 100644 sources/talk/20151202 KDE vs GNOME vs XFCE Desktop.md create mode 100644 translated/talk/20151202 KDE vs GNOME vs XFCE Desktop.md diff --git a/sources/talk/20151202 KDE vs GNOME vs XFCE Desktop.md b/sources/talk/20151202 KDE vs GNOME vs XFCE Desktop.md deleted file mode 100644 index ea7c1f93b9..0000000000 --- a/sources/talk/20151202 KDE vs GNOME vs XFCE Desktop.md +++ /dev/null @@ -1,54 +0,0 @@ -translating by kylepeng93 -KDE vs GNOME vs XFCE Desktop -================================================================================ -![](http://1426826955.rsc.cdn77.org/wp-content/uploads/2013/07/300px-Xfce_logo.svg_.png) - -Over many years, many people spent a long time with Linux desktop using either KDE or GNOME. These two environments have grown through the previous years and each of these desktops continued to expand their current user-base. For example, sleeper desktop environment has been XFCE as XFCE offers more robustness than LXDE that lacks much of XFCE’s polish in the default configuration. The XFCE provides all benefits which users enjoyed in the GNOME 2, but with some lightweight experiences which made it a hit on the older computers. - -### The Desktop Theming ### - -After the user has fresh installation, the XFCE will be a bit boring, which lacks some certain visual attractiveness to it. So, don’t misunderstand my words here, the XFCE is still having nice looking desktop, but it may be like vanilla in users’ eyes as well as most people who are new to the XFCE desktop environment. The good news here is that while installing new theme to the XFCE, it is a reasonably easy process as you can easily find the right XFCE theme which appeals to you, after that, you can extract that theme to the proper directory. From this point, the XFCE comes with an important tool located under the Appearance for helping the user to select the chosen theme easily throughout the Graphical User Interface (GUID). There’re no other tools that might be required here, and if the user follows the above directions, it will be a bit simple for everyone who is caring to have a try. - -On the GNOME desktop, the user should follow the similar above approach. The main key difference for this point is that users have to download and then install GNOME Tweak Tool before proceeding with anything. It does not have any huge barriers under any means, but it is simple valid oversight when the user consider that the XFCE does not require any tweak tool in order for installing and activating the new desktop themes. By being under the GNOME, and especially after installing that Tweak tool which is mentioned above, you will need to go ahead and also to make sure that you have the extension of User Themes installed. - -The same as with the XFCE, the user will want to search for, and then download the theme which most appeals personally to him. Then, user can revisit to the GNOME Tweak tool, and click on the Appearance option on left side of that Tweak tool. Then, the user can simply look at the bottom of the page and click on file browse button to right of the Shell Theme. User then can browse to the zipped folder, and click open. In case if this process was successfully done, the user will see an alert that tell him that it was installed without any problems. From this point, user can simply use the pull down menu in order for selecting the theme he wants to use. The same as with the XFCE, process of theme activation is very easy, however, a need to download the non-included application for using a new theme will leave much to be desired. - -Finally, there is the process of the KDE desktop theming. The same as with XFCE, there is no need at all to install any extra tools for making it work. This is one area where there is a feeling that the XFCE has to make the KDE the winner. Not only the installing themes in the KDE is accomplished entirely within the Graphical User Interface, but it’s also even possible to click on (Get New Themes) button and user will be able to locate, view, and also install the new themes automatically. - -However, it should be noted that the KDE is a bit more robust desktop environment comparing to the XFCE. Therefore, it is a bit reasonable now to see why such extra functionalities could be missing from the desktops which are mainly designed to be minimalist. So, we all have to give the KDE props for such outstanding functionality. - -### MATE is not Lightweight Desktop ### - -Before continuing with the comparison between the XFCE, the GNOME 3 and the KDE, it should be clear for experts that we can’t touch the MATE desktop as an option in the comparison. MATE can be considered as the GNOME 2 desktop’s next incarnation, but it’s not mainly marketed to be a lightweight or fast desktop. But instead of that, its primary goal is to be more traditional and comfortable desktop environment where the users can feel right at their home to use it. - -On the other hand, the XFCE comes with a completely other goal set. The XFCE offers its users a more lightweight and yet still visually appealing desktop experience. Then, for everyone who points out that MATE is a lightweight desktop too, it isn’t really targeting that lightweight desktop crowd. Both options may be dressed up for looking quite attractive with the proper theme installed. - -### The Navigation of Desktop ### - -The XFCE honestly offers an obvious navigation which is out of the box. Anyone who is used to the traditional Windows or the GNOME 2/MATE desktop experience will be going to have the ability to navigate around the new XFCE installation without any kind of help. Straight away, adding the applets to panel is still very obvious. The same as with locating installed applications, just use the launcher and simply click on any desired application. With an exception of LXDE and MATE, there is no other desktop that can make the navigation that simple. What can be even better is that fact which the control panel is very easy to use, that is a really big benefit to everyone who is new to the desktop environment. If the user prefer older methods to use his desktop, then GNOME is not an option. With the hot corners as well as the no minimize button, plus the other application layout method, it’ll take the most newcomers getting easily used to it. - -If the user is coming from, as an example, Windows environment, then he is going to be put off by the inability to add applets to the top of his workspace simply with just a mere right-click. Just instead of this, it can be handled by using extensions. Installing extensions in the GNOME is granted and is a brain-dead easy, based on the easy to use (on/off) toggle switches located on the extensions page of the GNOME. Users have to know, sadly, to actually visit that page to enjoy this functionality. - -On the other side, the GNOME is sharing its desire for providing a straight forward and an easy to use control panel, which many of you may think that it is not be a big deal, but it is really something that I by myself find commendable and worth to be mentioned. The KDE offers its users a bit more traditional desktop experience, throughout familiar launchers as well as the ability for getting to the software in more familiar way if they are coming from Windows desktop. The process of adding widgets or applets to the KDE desktop is an easy matter of just right-clicking on the bottom of the desktop. Only the problem with the KDE’s approach is to be that, as many things KDE, the feature which users are actually looking for are hidden. The KDE users might berate my opinion for this, but I still stand by my statement. - -In order for adding a Widget, just right-click on “my panel”, just to see the panel options, but not as an immediate method to install Widgets. You will not actually see the Add Widgets until you select the Panel Options, then the Add Widgets. This not a big deal to me, but later for some users, it becomes unnecessary tidbit of confusion. To make things here more convoluted, after the users manage to locate Widgets area they discover later a brand new term called “Activities”. It is in the same area as the Widgets, yet it is somehow in its own area as to what it does. - -Now don’t misunderstand me, the Activities feature in the KDE is totally great and actually valued. But to look at it from the usability standpoint, I think that it would be better suited in another menu option in order to not confuse the newbies. User is welcome to differ, but to test this with newbies for some extended periods of time can prove the correct over and over again. The rant against the Activities placement aside, the KDE approach to add new widgets is really great. The same as with the KDE themes, user can’t browse through and install the Widgets automatically via using the provided Graphical User Interface. It is a bit fantastic of functionality, and also it could be celebrated such way. The control panel of the KDE is not as easy as the user might like it to be, yet it is a bit clear that this’s something that they are still working on. - -### So, the XFCE is the best desktop, right? ### - -I, by myself, actually run GNOME, KDE, and XFCE on my computers in my office and home. I also have some older machines with OpenBox and LXDE too. Each desktop experience can offer something that is a bit useful to me and may help me to use each machine as I see that it is fit. For me, I have a soft spot in my heart for the XFCE as it is one of the desktop environments which I stuck with for years. But in this article, I’m just writing it on my daily use computer which is in fact, GNOME. - -The main idea here is that I still feel that the XFCE provides a bit better user experience for users who are looking for stable, traditional, and easy to understand desktop environment. You are also welcome to share with us your opinion in the comments section. - --------------------------------------------------------------------------------- - -via: http://www.unixmen.com/kde-vs-gnome-vs-xfce-desktop/ - -作者:[M.el Khamlichi][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.unixmen.com/author/pirat9/ diff --git a/translated/talk/20151202 KDE vs GNOME vs XFCE Desktop.md b/translated/talk/20151202 KDE vs GNOME vs XFCE Desktop.md new file mode 100644 index 0000000000..bdbaf2cdbd --- /dev/null +++ b/translated/talk/20151202 KDE vs GNOME vs XFCE Desktop.md @@ -0,0 +1,47 @@ +translating by kylepeng93 +KDE,GNOME和XFCE的较量 +================================================================================ +![](http://1426826955.rsc.cdn77.org/wp-content/uploads/2013/07/300px-Xfce_logo.svg_.png) +这么多年来,很多人一直都在他们的linux桌面端使用KDE或者GNOME桌面环境。这两个桌面环境经过多年的发展之后仍然在继续增加他们的用户基数。然而,在轻量级桌面环境下,XFCE一举成为了最受欢迎的桌面环境,相较于LXDE缺少的优美视觉效果,默认配置下的XFCE就可以在这方面打败前者。XFCE提供了用户能在GNOME2下使用的所有功能特性。但是,必须承认,在一些太老的计算机上,它的轻量级的特性并不能得到很好的效果。 + +### 桌面主题定制 ### +用户完成安装之后,XFCE看起来可能会有一点无聊,因为它在视觉上还缺少一些吸引力。但是,请不要误解我的话,XFCE仍然拥有漂亮的桌面,可能看起来像是用户眼中的香草,正如大多数刚刚接触XFCE桌面环境的人。好消息是当我们给XFCE安装新的主题的时候,这会是一个十分容易的过程,因为你能够快速的找到你喜欢的XFCE主题,之后,你可以将它解压到一个合适的目录中。从这一点上来说,XFCE自带的一个重要的图形界面工具可以帮助用户更加容易的选中你已经选好的主题,这可能是目前在XFCE上最好用的工具了。如果用户按照上面的指示去做的话,对于任何想要尝试使用XFCE的用户来说将不存在任何困难。 + +在GNOME桌面上,用户也可以按照上面的方法去做。不过,其中最主要的不同点就是用户必须手动下载并安装GNOME Tweak Tool,这样才能继续你想做的事。当然,对于使用任何一种方式都不会有什么障碍,但是对于用户来说,使用XFCE安装和激活主题并不需要去额外的下载并安装任何tweak tool可能是他们无法忽略的一个优势。而在GNOME上,尤其是在用户已经下载并安装了GNOME Tweak tool之后,你仍将必须确保你已经安装了用户主题拓展。 + +在XFCE一样,用户将会去搜索并下载自己喜欢的主题,然后,用户可以重新使用GNOME Tweak tool,并点击该工具界面左边的Appearance按钮,接着用户便可以简单的通过点击相应的按钮并选择自己已经下载好的主题来使用自己的主题,当一切都完成之后,用户将会看到一个告诉用户已经成功应用了主题的对话框,这样,你的主题便已经安装完成。对于这一点,用户可以简单的使用滚动条来选择他们想要的主题。和XFCE一样,主题激活的过程也是十分简单的,然而,对于因为要使用一个新的主题而下载一个不被包含的应用的需求也是需要考虑的。 + +最后,就是KDE桌面主题定制的过程了。和XFCE一样,不需要去下载额外的工具来安装主题。从这点来看,让人有种XFCE必将使KDE成为最后的赢家的感觉。不仅在KDE上可以完全使用图形用户界面来安装主题,而且甚至只需要用户点击获取新主题的按钮就可以定位,查看,并且最后自动安装新的主题。 + +然而,我们不应该认为KDE相比XFCE是一个更加稳定的桌面环境。因此,现在正是我们思考为什么一些额外的功能可能会从桌面环境中移除来达到最小化的目的。为此,我们都必须为拥有这样出色的功能而给予KDE更多的支持。 + +### MATE不是一个轻量级的桌面环境 ### +在继续比较XFCE,GNOME3和KDE之前,必须对这方面的老手作一个事先说明,我们不会将MATE桌面环境加入到我们的比较中。MATE可被认为是GNOME2的另一个衍生品,但是它并没有声称是作为一款轻量级或者快捷桌面。相反,它的主要目的是成为一款更加传统和舒适的桌面环境,并使它的用户感觉就像在家里使用它一样。 + +另一方面,XFCE生来就是要实现他自己的一系列使命。XFCE给它的用户提供一个更加轻量级的桌面环境,至今仍然有着吸引人的桌面视觉体验。然后,对于一些认为MATE也是一款轻量级的桌面环境的人来说,其实MATE真正的目标并不是成为一款轻量级的桌面环境。这两个选择在各自安装了一款好的主题之后看起来都会让人觉得非常具有吸引力。 + +### 桌面导航 ### +XFCE在窗口之外提供了一个显眼的导航器。任何使用过传统的windows或者GNOME 2/MATE桌面环境的用户都可以在没有任何帮助的情况下自如的使用新安装的XFCE桌面环境的导航器。紧接着,添加小程序到面板中也是很明显的。和找到已经安装的应用程序一样,直接使用启动器并点击你想要运行的应用程序图标。除了LXDE和MATE之外,还没有其他的桌面的导航器可以做到如此简单。不仅如此,更加简单的是对控制面板的使用,对于刚刚使用这个新桌面的每个用户来说这是一个非常大的好处。如果用户更喜欢通过老式的方法去使用他们的桌面,对于GNOME来说,这不是一个问题。和没有最小化按钮形成的用户关注热点一样,加上其他应用布局方法,这将使新用户更加容易习惯这个风格设计。 + +如果用户来自windows桌面环境,那么这些用户将要放弃这些习惯,因为,他们将不能简单的通过鼠标右击一下就可以将一个小程序添加到他们的工作空间的顶部。与此相反,它可以通过使用拓展来实现。GNOME中的KDE拓展是可用的,并且是非常的容易,这些容易之处体现在只需要用户简单的使用位于GNOME拓展页面上的on/off开关。用户必须清楚,只能通过访问该页面才能使用这个功能。 + +另一方面,GNOME正在它的外观中体现它的设计理念,即为用户提供一个直观和易用的控制面板。你可能认为那并不是什么大事,但是,在我看来,它确实是我认为值得称赞并且有必要被提及的方面。KDE提供给它的用户大量传统的桌面使用体验,并通过提供相似的启动器和一种更加类似的获取软件的方式的能力来迎合来自windows的用户。添加小图标或者小程序到KDE桌面是件非常简单的事情,只需要在桌面的底部右击即可。只有在KDE的使用中才会存在的的问题,对于KDE用户寻找的很多KDE的特性实际上都是隐藏的。KDE的用户可能会指责这我的观点,但我仍然坚持我的说法。 + +为了增加小部件,仅仅在我的面板上右击就可以看见面板选项,但是并不是安装小部件的一个快速的方法。通常在你选择面板选项之前你都不会看到添加的小部件,然后,就添加小部件吧。这对我来说不是个问题,但是后来对于一些用户来说,它变成了不必要的困惑。而使事情变得更加复杂,用户管理定位部件区域后,他们后来发现一种称为“Activities”的品牌新术语。在同一地区的小部件,但它是在自己的领域是什么。 + +现在请不要误解我,KDE中的活动特性是很不错的,也是很有价值的,但是从可用性的角度看,为了不让新手感到困惑,它更加适合于应用在另一个目录选项。欢迎来自用户的分歧,,但为了测试这个新手对一些长时间的可以一遍又一遍的证明它是正确的。责骂放在一边,KDE添加新部件的方法的确很棒。与KDE的主题一样,用户不能通过使用提供的图形用户界面浏览和自动安装部件。这是一个神奇的功能,也可以是这样的方式去庆祝。KDE的控制面板可能和用户希望的样子不一样,它不是足够的简单。但是有一点很清楚,这将是他们致力于改进的地方。 + +### 因此,XFCE是最好的桌面环境,对吗? ### +我在我的计算机上使用GNOME,KDE,并在我的办公室和家里的电脑上使用Xfce。我也有一些老机器在使用Openbox和LXDE。每一个使用桌面的经验都可以给我提供一些有用的东西,可以帮助我使用每台机器,因为我认为它是合适的。对我来说,在我的心里有一个柔软的地方,因为Xfce作为一个桌面环境,我坚持使用了很多年。但在这篇文章中,我只是在写我使用电脑的日常,事实上,它是GNOME。 +这篇文章的主要思想是我还是觉得Xfce能提供好一点的用户体验,对于那些正在寻找稳定的、传统的、容易理解的桌面环境的用户来说,XFCE是理想的。欢迎您在评论部分和我们分享你的意见。 +-------------------------------------------------------------------------------- + +via: http://www.unixmen.com/kde-vs-gnome-vs-xfce-desktop/ + +作者:[M.el Khamlichi][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.unixmen.com/author/pirat9/ From a7b5995b2cef1609f1b23b07bffd0a6124368158 Mon Sep 17 00:00:00 2001 From: Bestony Date: Sat, 9 Jan 2016 22:13:51 +0800 Subject: [PATCH 0176/1469] Delete 20151012 Remember sed and awk All Linux admins should.md --- ...ber sed and awk All Linux admins should.md | 61 ------------------- 1 file changed, 61 deletions(-) delete mode 100644 sources/tech/20151012 Remember sed and awk All Linux admins should.md diff --git a/sources/tech/20151012 Remember sed and awk All Linux admins should.md b/sources/tech/20151012 Remember sed and awk All Linux admins should.md deleted file mode 100644 index 6f1aba9ed8..0000000000 --- a/sources/tech/20151012 Remember sed and awk All Linux admins should.md +++ /dev/null @@ -1,61 +0,0 @@ -translating By Bestony -Remember sed and awk? All Linux admins should -================================================================================ -![](http://images.techhive.com/images/article/2015/03/linux-100573790-primary.idge.jpg) - -Credit: Shutterstock - -**We aren’t doing the next generation of Linux and Unix admins any favors by forgetting init scripts and fundamental tools** - -I happened across a post on Reddit by chance, [asking about textfile manipulation][1]. It was a fairly simple request, similar to those that folks in Unix see nearly every day. In this case, it was how to remove all duplicate lines in a file, keeping one instance of each. This sounds relatively easy, but can get a bit complicated if the source file is sufficiently large and random. - -There are countless answers to this problem. You could write a script in nearly any language to do this, with varying levels of complexity and time investment, which I suspect is what most would do. It might take 20 or 60 minutes depending on skill level, but armed with Perl, Python, or Ruby, you could make quick work of it. - -Or you could use the answer stated in that thread, which warmed my heart: Just use awk. - -That answer is the most concise and simplest solution to the problem by far. It’s one line: - - awk '!seen[$0]++' . - -Let’s take a look at this. - -In this command, there’s a lot of hidden code. Awk is a text processing language, and as such it makes a lot of assumptions. For starters, what you see here is actually the meat of a for loop. Awk assumes you want to loop through every line of the input file, so you don’t need to explicitly state it. Awk also assumes you want to print the postprocessed output, so you don’t need to state that either. Finally, Awk then assumes the loop ends when the last statement finishes, so no need to state it. - -The string seen in this example is the name given to an associative array. $0 is a variable that represents the entirety of the current line of the file. Thus, this command translates to “Evaluate every line in this file, and if you haven’t seen this line before, print it.” Awk does this by adding $0 to the seen array if it doesn’t already exist and incrementing the value so that it will not match the pattern the next time around and, thus, not print. - -Some will see this as elegant, while others may see this as obfuscation. Anyone who uses awk on a daily basis will be in the first group. Awk is designed to do this. You can write multiline programs in awk. You can even write [disturbingly complex functions in awk][2]. But at the end of the day, awk is designed to do text processing, generally within a pipe. Eliminating the extraneous cruft of loop definition is simply a shortcut for a very common use case. If you like, you could write the same thing as the following: - - awk '{ if (!seen[$0]) print $0; seen[$0]++ }’ - -It would lead to the same result. - -Awk is the perfect tool for this job. Nevertheless, I believe many admins -- especially newer admins -- would jump into [Bash][3] or Python to try to accomplish this task, because knowledge of awk and what it can do seems to be fading as time goes on. I think it may be an indicator of things to come, where problems that have been solved for decades suddenly emerge again, based on lack of exposure to the previous solutions. - -The shell, grep, sed, and awk are fundaments of Unix computing. If you’re not completely comfortable with their use, you’re artificially hamstrung because they form the basis of interaction with Unix systems via the CLI and shell scripting. One of the best ways to learn how these tools work is by observing and working with live examples, which every Unix flavor has in spades with their init systems -- or had, in the case of Linux distros that have adopted [systemd][4]. - -Millions of Unix admins learned how shell scripting and Unix tools worked by reading, writing, modifying, and working with init scripts. Init scripts differ greatly from OS to OS, even from distribution to distribution in the case of Linux, but they are all rooted in sh, and they all use core CLI tools like sed, awk, and grep. - -I’ve heard many complaints that init scripts are “ancient” and “difficult,” but in fact, init scripts use the same tools that Unix admins work with every day, and thus provide an excellent way to become more familiar and comfortable with those tools. Saying that init scripts are hard to read or difficult to work with is to admit that you lack fundamental familiarity with the Unix toolset. - -Speaking of things found on Reddit, I also came across this question from a budding Linux sys admin, [asking whether he should bother to learn sysvinit][5]. Most of the answers in the thread are good -- yes, definitely learn sysvinit and systemd. One commenter even notes that init scripts are a great way to learn Bash, and another states that the Fortune 50 company he works for has no plans to move to a systemd-based release. - -But it concerns me that this is a question at all. If we continue down the path of eliminating scripts and roping off core system elements within our operating systems, we will inadvertently make it harder for new admins to learn the fundamental Unix toolset due to the lack of exposure. - -I’m not sure why some want to cover up Unix internals with abstraction after abstraction, but such a path may reduce a generation of Unix admins to hapless button pushers dependent on support contracts. I’m pretty sure that would not be a good development. - --------------------------------------------------------------------------------- - -via: http://www.infoworld.com/article/2985804/linux/remember-sed-awk-linux-admins-should.html - -作者:[Paul Venezia][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.infoworld.com/author/Paul-Venezia/ -[1]:https://www.reddit.com/r/linuxadmin/comments/3lwyko/how_do_i_remove_every_occurence_of_duplicate_line/ -[2]:http://intro-to-awk.blogspot.com/2008/08/awk-more-complex-examples.html -[3]:http://www.infoworld.com/article/2613338/linux/linux-how-to-script-a-bash-crash-course.html -[4]:http://www.infoworld.com/article/2608798/data-center/systemd--harbinger-of-the-linux-apocalypse.html -[5]:https://www.reddit.com/r/linuxadmin/comments/3ltq2y/when_i_start_learning_about_linux_administration/ From d52c8bcd144a43582e9f1f6489ced36af6148916 Mon Sep 17 00:00:00 2001 From: Bestony Date: Sat, 9 Jan 2016 22:14:56 +0800 Subject: [PATCH 0177/1469] Create 20151012 Remember sed and awk All Linux admins should.md --- ...ber sed and awk All Linux admins should.md | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 translated/tech/20151012 Remember sed and awk All Linux admins should.md diff --git a/translated/tech/20151012 Remember sed and awk All Linux admins should.md b/translated/tech/20151012 Remember sed and awk All Linux admins should.md new file mode 100644 index 0000000000..7117e9f06d --- /dev/null +++ b/translated/tech/20151012 Remember sed and awk All Linux admins should.md @@ -0,0 +1,69 @@ + +# 学会Sed和Awk? 所有的Linux管理员都应该会的技能 + +![](http://images.techhive.com/images/article/2015/03/linux-100573790-primary.idge.jpg) + +图片来源: Shutterstock + +**我们不希望下一代Linux和Unix的管理员忘记任何初始化脚本和基本工具的好处** + +我曾经有一次在Reddit发表文章的机会, [asking about textfile manipulation][1].这是一个很简单请求,就像我们平时常用Unix的人所见到的。他的问题是,如何删除文件中的重复行,并保存在独立的实例里。 这听起来似乎很简单,但是当文件足够大时,就会有些复杂。 + +这个问题有很多种不同的答案。我怀疑你可以使用几乎任何一种语言来写这样的一个脚本,只是时间的投入和代码的复杂性不同罢了。根据你的个人水平,它大概会花费20-60分钟。但是如果你使用了Perl,Python,Ruby中的一种,你可能很快实现它。 + +或者你可以使用下面的一个方法,让你无比暖心的: 只用 awk. + +这个答案是迄今为止最简明、最简单的解决问题的方法。他只要一行: + +``` +awk '!seen[$0]++' . +``` + +让我们来分析一下 + +在这段代码中,其实隐藏了很多代码。AWK是一种文本处理语言,并且他内部做了大量的假设。首先,你看到的实际上是一个循环的结果。Awk假定你想通过循环输入文件的每一行,所以你不需要明确的去设定它。Awk还假定了你需要打印数据的输出,所以你也不需要去指定它。最好,Awk假定循环在最后一句话执行完结束,这一块也不再需要你去指定它 + +这个例子中看到的字符串是一个关联的数组的名字。$0是一个变量,表示当前行的全部。所以,这个命令翻译成话就是“对这个文件的每一行进行检查,如果你之前没有见过他,就打印出来。”Awk通过做这些来看这个数组是否早已存在或值不相等的,这样就不匹配参数,下次就不会再打印了。 + +一些人认为这样是优雅的,另外的人认为这可能会造成混淆。任何在日常基础事情上使用Awk的都是第一类人。Awk就是被设计做这个的。在Awk中,你可以写多行。甚至是一些复杂的功能。你甚至可以[用awk写一些让人不安的复杂功能][2]。但,最终,Awk还是一个通过管道进行文字处理的程序。去除循环定义的外部缺陷是很常见的用法,你可以用下面的代码做同样的事情 + + + +``` +awk '{ if (!seen[$0]) print $0; seen[$0]++ }’ +``` + +这必将导致相同的结果 + +Awk是完成这项工作的完美工具。不过,我相信很多管理员--特别是新管理员会跳转到[Bash][ 3 ]或Python来完成这一任务,因为Awk的知识和他所能做的事情总是随着时间而褪色。我认为这是一个标识性的事情。几十年来,以前的解决方案总是缺乏对新的问题的处理方法 + +The shell, grep, sed, and awk 是Unix的计算基础.如果你不能非常轻松的使用他们,你将会变得十分脆弱。因为他们通过命令行和脚本的相互作用来实现。学习这些工具如何工作最好的方法之一就是观察和正在运行的范例一起工作,通过Unix系统特有的Init系统,或者在Linux发行版被称为 [systemd][4]. + +数以百万计的Unix管理员了解Shell脚本和Unix工具同读、写、修改和研究Init脚本。不同系统的Init脚本有很大不同,甚至是不同的发行版。但是他们都源自sh,而且他他们都用核心命令行工具像sed,awk还有grep + +我每天都会挺到很多抱怨init脚本太“古老”而且很“难”。但是实际上,Init脚本和Unix管理员每天使用的工具一样,而且还提供了一个非常好的方式来更加熟悉和习惯这些工具。说Init脚本难的应该承认,你缺乏对Unix基础工具的熟悉。 + +说起在Reddit上的事情,我也碰到过这个问题,从一个初露头角的Linux系统管理员, [问他是否应该去学Sysvinit][5]. 大多数的答案都是好的方向--是的,应该学习sysvinit和systemd.一位评论者甚至指出,Init脚本是学习Bash的好方法。而另一个国家50强的公司不会搬到一个以系统为基础的发行版 + +但是,这提醒了我这是一个问题。如果我们继续沿着消除脚本和脱离我们操作系统的系统核心组件。由于出现的太少,我们将会不经意间的使新的管理员学习基本的Unix工具变得更难 + +我不知道为什么有些人想掩盖Unix内核抽象化和反抽象化,但是这样的一条路径可以减少一代Unix管理员出事后对服务支持的依赖。我相信这不是一件好事情。 + +------ + +via: http://www.infoworld.com/article/2985804/linux/remember-sed-awk-linux-admins-should.html + +作者:[Paul Venezia][a] + +译者:[Bestony](https://github.com/Bestony) + +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.infoworld.com/author/Paul-Venezia/ +[1]: https://www.reddit.com/r/linuxadmin/comments/3lwyko/how_do_i_remove_every_occurence_of_duplicate_line/ +[2]: http://intro-to-awk.blogspot.com/2008/08/awk-more-complex-examples.html +[3]: http://www.infoworld.com/article/2613338/linux/linux-how-to-script-a-bash-crash-course.html +[4]: http://www.infoworld.com/article/2608798/data-center/systemd--harbinger-of-the-linux-apocalypse.html +[5]: https://www.reddit.com/r/linuxadmin/comments/3ltq2y/when_i_start_learning_about_linux_administration/ From 0bbb5b3e4694dc16d5ed558a7954adf85e154561 Mon Sep 17 00:00:00 2001 From: soooogreen <54364732@qq.com> Date: Sat, 9 Jan 2016 22:19:30 +0800 Subject: [PATCH 0178/1469] delete sf by sg --- .../20151229 Grub 2--Heal your bootloader.md | 236 ------------------ 1 file changed, 236 deletions(-) delete mode 100644 sources/tech/20151229 Grub 2--Heal your bootloader.md diff --git a/sources/tech/20151229 Grub 2--Heal your bootloader.md b/sources/tech/20151229 Grub 2--Heal your bootloader.md deleted file mode 100644 index 19fcca7d08..0000000000 --- a/sources/tech/20151229 Grub 2--Heal your bootloader.md +++ /dev/null @@ -1,236 +0,0 @@ -翻译中。。。。。 -Grub 2: Heal your bootloader -================================================================================ -**There are few things as irritating as a broken bootloader. Get the best out of Grub 2 and keep it shipshape.** - -Why do this? - -- Grub 2 is the most popular bootloader that’s used by almost every Linux distribution. -- A bootloader is a vital piece of software, but they are susceptible to damage. -- Grub 2 is an expansive and flexible boot loader that offers various customisable options. - -The Grub 2 Linux bootloader is a wonderful and versatile piece of software. While it isn’t the only bootloader out there, it’s the most popular and almost all the leading desktop distros use it. The job of the Grub bootloader is twofold. First, it displays a menu of all installed operating systems on a computer and invites you to pick one. Second, Grub loads the Linux kernel if you choose a Linux operating system from the boot menu. - -As you can see, if you use Linux, you can’t escape the bootloader. Yet it’s one the least understood components inside a Linux distro. In this tutorial we’ll familiarise you with some of Grub 2’s famed versatility and equip you with the skills to help yourself when you have a misbehaving bootloader. - -The most important parts of Grub 2 are a bunch of text files and a couple of scripts. The first piece to know is **/etc/default/grub**. This is the text file in which you can set the general configuration variables and other characteristics of the Grub 2 menu (see box titled “Common user settings”). - -The other important aspect of Grub 2 is the **/etc/grub.d** folder. All the scripts that define each menu entry are housed there. The names of these scripts must have a two-digit numeric prefix. Its purpose is to define the order in which the scripts are executed and the order of the corresponding entries when the Grub 2 menu is built. The **00_header** file is read first, which parses the **/etc/default/grub** configuration file. Then come the entries for the Linux kernels in the **10_linux** file. This script creates one regular and one recovery menu entry for each kernel in the default **/boot** partition. - -This script is followed by others for third-party apps such as **30_os-prober** and **40_custom**. The **os-prober** script creates entries for kernels and other operating systems found on other partitions. It can recognise Linux, Windows, BSD and Mac OS X installations. If your hard disk layout is too exotic for the **os-prober** script to pick up an installed distro, you can add it to the **40_custom** file (see the “Add custom entries” box). - -**Grub** 2 does not require you to manually maintain your boot options’ configuration file: instead it generates the **/boot/grub/grub.cfg** file with the **grub2-mkconfig** command. This utility will parse the scripts in the **/etc/grub.d** directory and the **/etc/default/grub** settings file to define your setup. - -Graphical boot repair - -A vast majority of Grub 2 issues can easily be resolved with the touch of a button thanks to the Boot Repair app. This nifty little application has an intuitive user interface and can scan and comprehend various kinds of disk layouts and partitioning schemes, and can sniff out and correctly identify operating system installations inside them. The utility works on traditional computers with a Master Boot Record (MBR) as well as the newer UEFI computers with the UID Partition Table (GPT) layout. - -The easiest way to use Boot Repair is to install it inside a Live Ubuntu session. Fire up an Ubuntu Live distro on a machine with a broken bootloader and install Boot Repair by first adding its PPA repository with - - sudo add-apt-repository ppa:yannubuntu/Boot Repair - -Then refresh the list of repositories with - - sudo apt-get update - -before installing the app with - - sudo apt-get install -y Boot Repair - -Fire up the tool once it’s installed. The app will scan your hard disk before displaying its interface, which is made up of a couple of buttons. To follow the advice of the tool, simply press the Recommended Repair button, which should fix most broken bootloaders. After it’s restored your bootloader, the tool also spits out a small URL which you should note. The URL contains a detailed summary of your disks, including your partitions along with the contents of important Grub 2 files including **/etc/default/grub** and **boot/grub/grub.cfg**. If the tool hasn’t been able to fix your bootloader, you can share the URL on your distro’s forum boards to allow others to understand your disk layout and offer suggestions. - -![](http://www.linuxvoice.com/wp-content/uploads/2015/10/boot-repair-large.jpg) - -**Boot Repair also lets you customise Grub 2’s options.** - -#### Bootloader bailout #### - -Grub 2 boot problems can leave the system in several states. The text on the display where you’d expect the bootloader menu gives an indication of the current state of the system. If the system stops booting at the **grub>** prompt, it means the Grub 2 modules were loaded but it couldn’t find the **grub.cfg** file. This is the full Grub 2 command shell and you can do quite a bit here to help yourself. If you see the **grub rescue>** prompt, it means that the bootloader couldn’t find the Grub 2 modules nor could it find any of your boot files. However, if your screen just displays the word ‘GRUB’, it means the bootloader has failed to find even the most basic information that’s usually contained in the Master Boot Record. - -You can correct these Grub failures either by using a live CD or from Grub 2’s command shell. If you’re lucky and your bootloader drops you at the **grub>** prompt, you have the power of the Grub 2 shell at your disposal to correct any errors. - -The next few commands work with both **grub>** and **grub rescue>**. The **set pager=1** command invokes the pager, which prevents text from scrolling off the screen. You can also use the **ls** command which lists all partitions that Grub sees, like this: - - grub> ls - (hd0) (hd0,msdos5) (hd0,msdos6) (hd1,msdos1) - -As you can see, the command also lists the partition table scheme along with the partitions. - -You can also use the **ls** command on each partition to find your root filesystem: - - grub> ls (hd0,5)/ - lost+found/ var/ etc/ media/ bin/ initrd.gz - boot/ dev/ home/ selinux/ srv/ tmp/ vmlinuz - -You can drop the **msdos** bit from the name of the partition. Also, if you miss the trailing slash and instead say **ls (hd0,5)** you’ll get information about the partition including its filesystem type, total size, and last modification time. If you have multiple partitions, read the contents of the **/etc/issue** file with the **cat** command to identify the distro, such as **cat (hd0,5)/etc/issue**. - -Assuming you find the root filesystem you’re looking for inside **(hd0,5)**, make sure that it contains the /**boot/grub** directory and the Linux kernel image you wish to boot into, such as **vmlinuz-3.13.0-24-generic**. Now type the following: - - grub> set root=(hd0,5) - grub> linux /boot/vmlinuz-3.13.0-24-generic root=/dev/sda5 - grub> initrd /boot/initrd.img-3.13.0-24-generic - -The first command points Grub to the partition housing the distro we wish to boot into. The second command then tells Grub the location of the kernel image inside the partition as well as the location of the root filesystem. The final line sets the location of the initial ramdisk file. You can use tab autocompletion to fill in the name of the kernel and the initrd, which will save you a lot of time and effort. - -Once you’ve keyed these in, type **boot** at the next **grub>** prompt and Grub will boot into the specified operating system. - -Things are a little different if you’re at the **grub rescue>** prompt. Since the bootloader hasn’t been able to find and load any of the required modules, you’ll have to insert them manually: - - grub rescue> set root=(hd0,5) - grub rescue> insmod (hd0,5)/boot/grub/normal.mod - grub rescue> normal - grub> insmod linux - -As you can see, just like before, after we use the **ls** command to hunt down the Linux partition, we mark it with the **set** command. We then insert the **normal** module, which when activated will return us to the standard **grub>** mode. The next command then inserts the linux module in case it hasn’t been loaded. Once this module has been loaded you can proceed to point the boot loader to the kernel image and initrd files just as before and round off the procedure with the **boot** command to bring up the distro. - -Once you’ve successfully booted into the distro, don’t forget to regenerate a new configuration file for Grub with the - - grub-mkconfig -o /boot/grub/grub.cfg - -command. You’ll also have to install a copy of the bootloader into the MBR with the - - sudo grub2-install /dev/sda - -command. - -![](http://www.linuxvoice.com/wp-content/uploads/2015/10/grub2-cfg-large.jpg) - -**To disable a script under the /etc/grub.d, all you need to do is remove the executable bit, for example with chmod -x /etc/grub.d/20_memtest86+ which will remove the ‘Memory Test’ option from the menu.** - -### Grub 2 and UEFI ### - -UEFI-enabled machines (more or less, any machine sold in the last couple of years) have added another layer of complexity to debugging a broken **Grub 2** bootloader. While the procedure for restoring a **Grub 2** install on a UEFI machine isn’t much different than it is on a non-UEFI machine, the newer firmware handles things differently, which results in mixed restoration results. - -On a UEFI-based system, you do not install anything in the MBR. Instead you install a Linux EFI bootloader in the EFI System Partition (ESP) and set it as the EFI’s default boot program using a tool such as **efibootmgr** for Linux, or **bcdedit** for Windows. - -As things stand now, the Grub 2 bootloader should be installed properly when installing any major desktop Linux distro, which will happily coexist with Windows 8. However, if you end up with a broken bootloader, you can restore the machine with a live distro. When you boot the live medium, make sure you boot it in the UEFI mode. The computer’s boot menu will have two boot options for each removable drive – a vanilla option and an option tagged with UEFI. Use the latter to expose the EFI variables in **/sys/firmware/efi/**. - -From the live environment, mount the root filesystem of the broken installation as mentioned in the tutorial. You’ll also have to mount the ESP partition. Assuming it’s **/dev/sda1**, you can mount it with - - sudo mount /dev/sda1 /mnt/boot/efi - -Then load the **efivars** module with **modprobe efivars** before chrooting into the installed distribution as shown in the tutorial. - -Here on, if you’re using Fedora, reinstall the bootloader with the - - yum reinstall grub2-efi shim - -command followed by - - grub2-mkconfig -o /boot/grub2/grub.cfg - -to generate the new configuration file. Ubuntu users can do this with - - apt-get install --reinstall grub-efi-amd64 - -With the bootloader in place, exit chroot, unmount all partitions and reboot to the Grub 2 menu. - -#### Dude, where’s my Grub? #### - -The best thing about Grub 2 is that you can reinstall it whenever you want. So if you lose the Grub 2 bootloader, say when another OS like Windows replaces it with its own bootloader, you can restore Grub within a few steps with the help of a live distro. Assuming you’ve installed a distro on **/dev/sda5**, you can reinstall Grub by first creating a mount directory for the distro with - - sudo mkdir -p /mnt/distro - -and then mounting the partition with - - mount /dev/sda5 /mnt/distro - -You can then reinstall Grub with - - grub2-install --root-directory=/mnt/distro /dev/sda - -This command will rewrite the MBR information on the **/dev/sda** device, point to the current Linux installation and rewrite some Grub 2 files such as **grubenv** and **device.map**. - -Another common issue pops up on computers with multiple distros. When you install a new Linux distro, its bootloader should pick up the already installed distros. In case it doesn’t, just boot into the newly installed distro and run - - grub2-mkconfig - -Before running the command, make sure that the root partitions of the distros missing from the boot menu are mounted. If the distro you wish to add has **/root** and **/home** on separate partitions, only mount the partition that contains /root, before running the **grub2-mkconfig** command. - -While Grub 2 will be able to pick most distros, trying to add a Fedora installation from within Ubuntu requires one extra step. If you’ve installed Fedora with its default settings, the distro’s installer would have created LVM partitions. In this case, you’ll first have to install the **lvm2** driver using the distro’s package management system, such as with - - sudo apt-get install lvm2 - -before Grub 2’s **os-prober** script can find and add Fedora to the boot menu. - -### Common user settings ### - -Grub 2 has lots of configuration variables. Here are some of the common ones that you’re most likely to modify in the **/etc/default/grub** file. The **GRUB_DEFAULT** variable specifies the default boot entry. It will accept a numeric value such as 0, which denotes the first entry, or “saved” which will point it to the selected option from the previous boot. The **GRUB_TIMEOUT** variable specifies the delay before booting the default menu entry and the **GRUB_CMDLINE_LINUX** variable lists the parameters that are passed on the kernel command line for all Linux menu entries. - -If the **GRUB_DISABLE_RECOVERY** variable is set to **true**, the recovery mode menu entries will not be generated. These entries boot the distro into single-user mode from where you can repair your system with command line tools. Also useful is the **GRUB_GFXMODE** variable, which specifies the resolution of the text shown in the menu. The variable can take any value supported by your graphics card. - -![](http://www.linuxvoice.com/wp-content/uploads/2015/10/grub2-cli-large.jpg) - -**Grub 2 has a command line, which you can invoke by pressing C at the bootloader menu.** - -#### Thorough fix #### - -If the **grub2-install** command didn’t work for you, and you still can’t boot into Linux, you’ll need to completely reinstall and reconfigure the bootloader. For this task, we’ll use the venerable **chroot** utility to change the run environment from that of the live CD to the Linux install we want to recover. You can use any Linux live CD for this purpose as long as it has the **chroot** tool. However, make sure the live medium is for the same architecture as the architecture of the installation on the hard disk. So if you wish to **chroot** to a 64-bit installation you must use an amd64 live distro. - -After you’ve booted the live distro, the first order of business is to check the partitions on the machine. Use **fdisk -l** to list all the partitions on the disk and make note of the partition that holds the Grub 2 installation that you want to fix. - -Let’s assume we wish to restore the bootloader from the distro installed in **/dev/sda5**. Fire up a terminal and mount it with: - - sudo mount /dev/sda5 /mnt - -Now you’ll have to bind the directories that the Grub 2 bootloader needs access to in order to detect other operating systems: - - $ sudo mount --bind /dev /mnt/dev - $ sudo mount --bind /dev/pts /mnt/dev/pts - $ sudo mount --bind /proc /mnt/proc - $ sudo mount --bind /sys /mnt/sys - -We’re now all set to leave the live environment and enter into the distro installed inside the **/dev/sda5** partition via **chroot**: - - $ sudo chroot /mnt /bin/bash - -You’re now all set to install, check, and update Grub. Just like before, use the - - sudo grub2-install /dev/sda - -command to reinstall the bootloader. Since the **grub2-install** command doesn’t touch the **grub.cfg** file, we’ll have to create it manually with - - sudo grub-mkconfig -o /boot/grub/grub.cfg - -That should do the trick. You now have a fresh copy of Grub 2 with a list of all the operating systems and distros installed on your machine. Before you can restart the computer, you’ll have to exit the chrooted system and unmount all the partitions in the following order: - - $ exit - $ sudo umount /mnt/sys - $ sudo umount /mnt/proc - $ sudo umount /mnt/dev/pts - $ sudo umount /mnt/dev - $ sudo umount /mnt - -You can now safely reboot the machine, which should be back under Grub 2’s control, and the bootloader under yours! - -### Add custom entries ### - -If you wish to add an entry to the bootloader menu, you should add a boot stanza to the **40_custom** script. You can, for example, use it to display an entry to boot a Linux distro installed on a removable USB drive. Assuming your USB drive is **sdb1**, and the vmlinuz kernel image and the initrd files are under the root (/) directory, add the following to the **40_custom** file: - - menuentry “Linux on USB” { - set root=(hd1,1) - linux /vmlinuz root=/dev/sdb1 ro quiet splash - initrd /initrd.img - } - -For more accurate results, instead of device and partition names you can use their UUIDs, such as - - set root=UUID=54f22dd7-eabe - -Use - - sudo blkid - -to find the UUIDs of all the connected drives and partitions. You can also add entries for any distros on your disk that weren’t picked up by the os-prober script, as long as you know where the distro’s installed and the location of its kernel and initrd image files. - --------------------------------------------------------------------------------- - -via: https://www.linuxvoice.com/grub-2-heal-your-bootloader/ - -作者:[Mayank Sharma][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.linuxvoice.com/author/mayank/ From eee30717f4da23489fbf9ba02a4e34eef4dfe796 Mon Sep 17 00:00:00 2001 From: soooogreen <54364732@qq.com> Date: Sat, 9 Jan 2016 22:21:10 +0800 Subject: [PATCH 0179/1469] done by sg --- .../20151229 Grub 2--Heal your bootloader.md | 235 ++++++++++++++++++ 1 file changed, 235 insertions(+) create mode 100644 translated/tech/20151229 Grub 2--Heal your bootloader.md diff --git a/translated/tech/20151229 Grub 2--Heal your bootloader.md b/translated/tech/20151229 Grub 2--Heal your bootloader.md new file mode 100644 index 0000000000..f9005762b6 --- /dev/null +++ b/translated/tech/20151229 Grub 2--Heal your bootloader.md @@ -0,0 +1,235 @@ +Grub 2:拯救你的 bootloader +================================================================================ +**没什么事比 bootloader 坏掉更让气人的了。充分发挥 Grub 2 的作用,让 bootloader 安分工作吧。** + +为什么这么说? + +- Grub 2 是最受欢迎的 bootloader ,受用于几乎所有 Linux 发行版。 +- bootloader 是一个至关重要的软件,但是非常容易损坏。 +- Grub 2 是具有扩展性和灵活性一款引导加载程序,提供了大量可定制选项。 + +Grub 2 是一款精彩的功能强大的软件。它不是 bootloader 界一枝独秀,但却最受欢迎,几乎所有主要的桌面发行版都在使用它。 Grub 的工作有两个。首先,它用一个菜单展示计算机上所有已经安装的操作系统供你选择。然后,当你从启动菜单中选择了一个 Linux 操作系统, Grub 便加载这个 Linux 的内核。 + +你知道,如果使用 Linux ,你就离不开 bootloader 。然而它却是 Linux 发行版内部最鲜为人知的部分。在这个教程里,我们将带你熟悉 Grub 2 一些著名的特性,强化你相关技能,使你在 bootloader 跑飞的时候能够自行处理。 + +Grub 2 最重要的特色在于大量的 text 格式文件和两个脚本文件。首先需要了解的是 **/etc/default/grub** 。这是一个 text 文件,你可以在里面设置通用配置变量和 Grub 2 菜单(见标题为 “Common user settings(普通用户设置)” 的窗口)的其它特性。 + +Grub 2 另一个重要的特点在于 **/etc/grub.d** 文件夹。定义菜单入口的所有脚本都放置在这里。这些脚本的名称必须有两位的数字前缀。其目的是,在构建 Grub 2 菜单时定义脚本的执行顺序以及相应入口的顺序。文件 **00_header** 首先被读取,负责解析 **/etc/default/grub** 配置文件。然后是 Linux 内核的入口,位于 **10_linux** 文件中。这个脚本在默认的 **/boot** 分区为每个内核创建一个正规菜单入口和一个恢复菜单入口。 + +紧接着的是为第三方应用所用的脚本,如 **30_os-prober** 和 **40_custom** 。 **os-prober** 脚本为内核和其它分区里的操作系统创建入口。它能识别 Linux、 Windows、 BSD 以及 Mac OS X 的装置(译注,指 bootloader )。 如果你的硬盘设计比较独特,使得 **os-prober** 无法捕获已经安装的发行版,你可以在 **40_custom** 文件(见 “Add custom entries(添加定制入口)”窗口)中添加入口。 + +**Grub** 2 不需要你手动维护你的启动选项的配置文件:取而代之的是使用 **grub2-mkconfig** 命令产生 **/boot/grub/grub.cfg** 文件。这个功能会解析 **/etc/grub.d** 目录中的脚本以及 **/etc/default/grub** 设置文件来定义你的安装。 + +图形化引导修复 + +多亏了 Boot Repair 应用,只需要点击按钮,Grub 2 许许多多的问题都能轻易解决。这个小巧的应用有一个直观的用户界面,可以扫描并包含多种硬盘设计和分区方案,还能发现并正确识别里面的操作系统的装置(译注,指 bootloader )。这个应用可以以主引导记录 (MBR)形式存在于传统计算机里,也可以在新型 UEFI 计算机中以 GUID(译改,应为GUID)分区表布局方式工作。 + +Boot Repair 最简单的使用方式是在 Live Ubuntu 会话中安装。在机器上用一个坏的 bootloader 启动 Ubuntu Live 发行版,通过首次添加它的 PPA 版本库,安装 Boot Repair ,命令如下 + + sudo add-apt-repository ppa:yannubuntu/Boot Repair + +然后刷新版本库列表,使用 + + sudo apt-get update + +安装应用(译改,删了 before ),如下 + + sudo apt-get install -y Boot Repair + +安装完毕立刻启动应用。在显示它的界面(由一对按键组成)之前将会扫描你的硬盘。根据工具的指示,只需按下 Recommended Repair(推荐修复)按钮,即可修复大部分坏掉的 bootloader 。修复 bootloader 之后,这个工具会输出一串短小的 URL ,你应该把它记录下来。这个 URL 包含了硬盘详尽的信息:分区信息以及 Grub 2 重要的文件(如 **/etc/default/grub** 和 **boot/grub/grub.cfg** )的内容。如果工具不能解决 bootloader 的问题,可以把你这个 URL 共享在你的发行版的论坛公告牌上,让其他人分析你的硬盘设计以便给你建议。 + +![](http://www.linuxvoice.com/wp-content/uploads/2015/10/boot-repair-large.jpg) + +**Boot Repair 同样支持定制 Grub 2 的选项。** + +#### Bootloader 急救 #### + +Grub 2 引导问题会导致系统处于几种不同状态。屏幕(如你所想,本该显示 bootloader 菜单的地方)所展示的文本,指示系统的当前状态。如果系统中止于 **grub>** 提示符,表明 Grub 2 模块已经被加载,但是找不到 **grub.cfg** 文件。当前是全 Grub 2 命令shell,你可以通过多种方式解决此问题。如果你看到的是 **grub rescue>** 提示符,表明 bootloader 不能找到 Grub 2 模块或者找不到任何引导文件( boot files )。然而,如果你的屏幕只显示 ‘GRUB’ 一词,表明 bootloader 找不到通常位于主引导记录( Master Boot Record )里的最基本的信息。 + +你可以通过使用 live CD 或者在 Grub 2 shell中修正此类错误。如果你够幸运, bootloader 中止于 **grub>** 提示符,你将能获得 Grub 2 shell 的支配权,来帮助你排错。 + +接下来几个命令工作在 **grub>** 和 **grub rescue>** 提示符下。 **set pager=1** 命令产生分页器( pager ),防止文本在屏幕上被刷掉。你还可以使用 **ls** 命令列出 Grub 识别的分区,如下: + + grub> ls + (hd0) (hd0,msdos5) (hd0,msdos6) (hd1,msdos1) + +如你所见,这个命令列出分区的同时一并列出了分区表计划。 + +你还可以在每个分区上面使用 **ls** 来查找根文件系统: + + grub> ls (hd0,5)/ + lost+found/ var/ etc/ media/ bin/ initrd.gz + boot/ dev/ home/ selinux/ srv/ tmp/ vmlinuz + +你可以不写上分区名的 **msdos** 位。同样,如果你忘记尾斜杠( the trailing slash )只输入 **ls (hd0,5)** ,那你将获得分区的信息比如文件系统类型,总体大小和最后修改时间。如果你有多个分区,可以使用 **cat** 读取 **/etc/issue** 文件中的内容,来确定发行版,格式如 **cat (hd0,5)/etc/issue** 。 + +假设你在 **(hd0,5)** 中找到根文件系统,请确保它包含 /**boot/grub** 目录,以及你想引导进入的内核镜像,如 **vmlinuz-3.13.0-24-generic** 。此时输入以下命令: + + grub> set root=(hd0,5) + grub> linux /boot/vmlinuz-3.13.0-24-generic root=/dev/sda5 + grub> initrd /boot/initrd.img-3.13.0-24-generic + +第一个命令把 Grub 指向我们想引导进入的发行版所在的分区。接着第二个命令告知 Grub 内核镜像在分区中的位置,以及根文件系统的位置。最后一行设置虚拟文件系统( initial ramdisk )文件的位置。你可以使用 tab 补全功能补全内核名字和虚拟文件系统( initrd: initial ramdisk )名字,节省时间和精力。 + +输入完毕,在下一个 **grub>** 提示符后输入 **boot** , Grub 将会引导进入指定的操作系统。 + +在 **grub rescue>** 提示符下,情况会有些许不同。因为 bootloader 未能够找到并加载任何必需的模块,你需要手动添加这些模块: + + grub rescue> set root=(hd0,5) + grub rescue> insmod (hd0,5)/boot/grub/normal.mod + grub rescue> normal + grub> insmod linux + +如上所示,跟之前一样,使用 **ls** 命令列出所有分区之后,使用 **set** 命令标记起来。然后添加 **normal** 模块,此模块激活时将会恢复标准 **grub>** 模式。如果 linux 模块没加载,接下来的命令会进行添加。如果这个模块已经加载,你可以跟之前一样,把引导加载程序指向内核镜像和虚拟文件系统( initrd )文件,然后使用 **boot** 启动发行版,完美收官。 + +一旦成功启动发行版,别忘了为 Grub 重新产生新的配置文件,使用 + + grub-mkconfig -o /boot/grub/grub.cfg + +命令。你还需要往 MBR 里安装一份 bootloader 的拷贝,使用 + + sudo grub2-install /dev/sda + +命令。 + +![](http://www.linuxvoice.com/wp-content/uploads/2015/10/grub2-cfg-large.jpg) + +**想要禁能 /etc/grub.d 目录下的脚本,你只需移除可执行位,比如使用 chmod -x /etc/grub.d/20_memtest86+ 就能将 ‘Memory Test’ 选项从菜单中移除。** + +### Grub 2 和 UEFI ### + +支持UEFI的机器(最近几年上市的机器大部分都是)添加了另一复杂的层次,用以调试坏掉的 **Grub 2**。恢复 **Grub 2** 的程序在 UEFI 机器上安装和在非 UEFI 机器上安装并没多大区别,只是新程序处理方式不一样,从而导致了很多种恢复结果。 + +对于基于 UEFI 的系统,不要在 MBR上安装任何东西。相反,你要在 EFI 系统分区( ESP )里安装 EFI bootloader,并且借助工具把它设置为 EFI 的默认启动程序,这个工具对于 Linux 用户是 **efibootmgr** ,对于 window 用户则是 **bcdedit** 。 + +照目前情况看,在安装任何与 Windows 8 兼容的主流桌面 Linux 发行版前, Grub 2 应该完成正确安装。然而,如果 bootloader 损坏,你可以使用 live 发行版进行机器修复。在启动 live 媒介之时,请确保是以 UEFI模式启动。计算机每个可移动驱动的启动菜单将会有两个选项: vanilla 选项和以 EFI 标记的选项。使用后者开放 **/sys/firmware/efi/** 文件中的 EFI 变量。 + +在 live 环境中,挂载教程前面所提的安装失败的装置(译注,指 bootloader )的根文件系统。除此之外,还需要挂载 ESP 分区。假设分区是 **/dev/sda1** ,你可以如下所示挂载 + + sudo mount /dev/sda1 /mnt/boot/efi + +接着在 chroot 到安装完毕的发行版前之前,使用 **modprobe efivars** 加载 **efivars** 模块。 + +这个时候, Fedora 用户使用如下命令重新安装 bootloader + + yum reinstall grub2-efi shim + +在此之前,需要使用 + + grub2-mkconfig -o /boot/grub2/grub.cfg + +来产生新的配置文件。 Ubuntu 用户则改用以下命令 + + apt-get install --reinstall grub-efi-amd64 + +一旦 bootloader 正确就位,退出 chroot ,取消挂载所有分区,重启让 Grub 2 菜单显示。 + +#### 伙计,我的 Grub 哪去了? #### + +Grub 2 最好的特性是可以随时重新安装。因此,当其它像 Windows 之类的系统用自己的 bootloader 替换之,导致 Grub 2 丢失,你可以使用 live 发行版,寥寥数步即可重装 Grub 。假设你在 **/dev/sda5** 安装了一个发行版,若要重装 Grub ,你只需首先使用以下命令,为发行版创建一个挂载目录 + + sudo mkdir -p /mnt/distro + +然后挂载分区,如下 + + mount /dev/sda5 /mnt/distro + +接着就能重装 Grub 了,如下 + + grub2-install --root-directory=/mnt/distro /dev/sda + +这个命令会改写 **/dev/sda** 设备上的 MBR 信息,指向当前 Linux 的装置(译注,指 bootloader ),并改写 Grub 2 部分文件如 **grubenv** 和 **device.map** 。 + +另一个问题常见于装有多个发行版的计算机上。安装了新的 Linux 发行版,它的 bootloader 应当要能捕获所有已经安装的发行版。一旦不能够,只要引导进入新安装的发行版,并运行 + + grub2-mkconfig + +运行命令之前,请确保发行版的启动菜单中缺失的 root 分区已经完成挂载。如果你想添加的发行版有独立 **/root** 和 **/home** 分区,在运行 **grub2-mkconfig** 之前,只需挂载包含 /root 的分区。 + +虽然 Grub 2 能够捕获大部分发行版,但是在 Ubuntu 中尝试添加 Fedora 的装置(译注,指 bootloader )需要额外的一个步骤。如果你以默认设置安装了 Fedora ,则发行版的安装器(译注,同样指 bootloader )已经创建了 LVM 分区。此时你需要使用发行版的包管理系统,安装 **lvm2** 驱动,如下 + + sudo apt-get install lvm2 + +才能使得 Grub 2 的 **os-prober** 脚本能够找到并将 Fedora 添加进启动菜单。 + +### 普通用户设置 ### + +Grub 2 有很多可配置变量。 **/etc/default/grub** 文件里有很多你最可能会修改到的普通变量。 **GRUB_DEFAULT** 变量指定默认的启动入口,可以设置为数字值,比如 0 ,表示第一个入口,或者设置为 “saved” ,将它从指向上一次启动时选中的选项。 **GRUB_TIMEOUT** 变量指定启动默认菜单入口之前的停留时间。 **GRUB_CMDLINE_LINUX** 为所有 Linux 菜单入口列出在内核命令行上传递的参数。 + +如果 **GRUB_DISABLE_RECOVERY** 变量设置为 **true** ,那么将不产生恢复模式菜单入口。这些入口以单用户模式启动发行版,这种模式下允许你利用命令行工具修复系统。 **GRUB_GFXMODE** 变量同样有用,它指定了菜单上文本显示的分辨率,它可以设置为你的显卡所支持的任何数值。 + +![](http://www.linuxvoice.com/wp-content/uploads/2015/10/grub2-cli-large.jpg) + +** Grub 2 有其命令行,通过在 bootloader 菜单上按 C 调用。** + +#### 彻底的修复 #### + +如果 **grub2-install** 命令不能正常运作,使得你无法引导进入 Linux ,你需要完整地重装以及重新配置 bootloader 。为此目的,需要用到神圣的 **chroot** 应用将 live CD 环境切换至并运行我们想修复的 Linux 的安装环境。任何拥有 **chroot** 工具的 Linux live CD 都可以实现这个目的。不过需要确保 live 媒介的架构和硬盘上系统的架构一致。因此当你希望 **chroot** 到 64 位系统,你必须使用 amd64 live 发行版。 + +启动进入 live 发行版之后,首先需要检查机器上的分区。使用 **fdisk -l** 列出磁盘上所有分区,记录你想修复的 Grub 2 装置所在的分区。 + +假设我们希望从安装在 **/dev/sda5** 中的发行版中恢复 bootloader 。启动终端使用如下命令挂载分区: + + sudo mount /dev/sda5 /mnt + +此时需要绑定 Grub 2 bootloader 需要进入的目录,以便检测其它操作系统: + + $ sudo mount --bind /dev /mnt/dev + $ sudo mount --bind /dev/pts /mnt/dev/pts + $ sudo mount --bind /proc /mnt/proc + $ sudo mount --bind /sys /mnt/sys + +此时可以离开 live 环境进入安装在 **/dev/sda5** 分区中的发行版了,通过 **chroot** : + + $ sudo chroot /mnt /bin/bash + +现在可以安装、检测、以及升级 Grub 了,跟之前一样,使用 + + sudo grub2-install /dev/sda + +命令来重装 bootloader 。因为 **grub2-install** 命令不能 创建**grub.cfg** 文件,需要手动创建,如下 + + sudo grub-mkconfig -o /boot/grub/grub.cfg + +这样应该就可以了。现在你就有了 Grub 2 的一份全新拷贝,罗列机器上所有的操作系统和发行版。在重启电脑之前,你需要依次退出 chroot 系统,卸载所有分区,如下所示: + + $ exit + $ sudo umount /mnt/sys + $ sudo umount /mnt/proc + $ sudo umount /mnt/dev/pts + $ sudo umount /mnt/dev + $ sudo umount /mnt + +现在你可以安全地重启电脑了,而它应该会回退到 Grub 2 的控制之中,而你又控制着这个 bootloader 。 + +### 添加自定义入口 ### + +如果希望往 bootloader 菜单里添加入口,你需要在 **40_custom** 文件里添加一个启动段( boot stanza )。例如,你可以使用它展示一个入口来启动安装在可移动 USB 驱动里的 Linux 发行版。假设你的 USB 驱动是 **sdb1** ,并且 vmlinuz 内核镜像和虚拟文件系统( initrd )都位于根 (/)目录下,在 **40_custom** 文件中添加以下内容: + + menuentry “Linux on USB” { + set root=(hd1,1) + linux /vmlinuz root=/dev/sdb1 ro quiet splash + initrd /initrd.img + } + +相比使用设备和分区名,使用它们的 UUID 可以获得更精确结果,比如 + + set root=UUID=54f22dd7-eabe + +使用 + + sudo blkid + +来获得所有已连接驱动和分区的 UUID 。你还可以为你磁盘上没被 os-prober 脚本捕获的发行版添加入口,只要你知道该发行版的安装位置以及其内核和虚拟文件系统( initrd )的定位即可。 + +-------------------------------------------------------------------------------- + +via: https://www.linuxvoice.com/grub-2-heal-your-bootloader/ + +作者:[Mayank Sharma][a] +译者:[soooogreen](https://github.com/soooogreen) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.linuxvoice.com/author/mayank/ From ec97b605339a26b6884ec0156a2c9c7d127cacac Mon Sep 17 00:00:00 2001 From: alim0x Date: Sat, 9 Jan 2016 22:43:51 +0800 Subject: [PATCH 0180/1469] [translating]20151130 Useful Linux and Unix Tape Managements Commands For Sysadmins --- ...Tape Managements Commands For Sysadmins.md | 122 +++++++++--------- 1 file changed, 62 insertions(+), 60 deletions(-) diff --git a/sources/tech/20151130 Useful Linux and Unix Tape Managements Commands For Sysadmins.md b/sources/tech/20151130 Useful Linux and Unix Tape Managements Commands For Sysadmins.md index ff0e0219fb..d93670e012 100644 --- a/sources/tech/20151130 Useful Linux and Unix Tape Managements Commands For Sysadmins.md +++ b/sources/tech/20151130 Useful Linux and Unix Tape Managements Commands For Sysadmins.md @@ -1,3 +1,5 @@ +alim0x translating + 15 Useful Linux and Unix Tape Managements Commands For Sysadmins ================================================================================ Tape devices should be used on a regular basis only for archiving files or for transferring data from one server to another. Usually, tape devices are all hooked up to Unix boxes, and controlled with mt or mtx. You must backup all data to both disks (may be in cloud) and tape device. In this tutorial you will learn about: @@ -62,24 +64,24 @@ Type the following commands: ## Linux (read man pages for more info) ## lsscsi lsscsi -g - + ## IBM AIX ## lsdev -Cc tape lsdev -Cc adsm lscfg -vl rmt* - + ## Solaris Unix ## cfgadm –a cfgadm -al luxadm probe iostat -En - + ## HP-UX Unix ## ioscan Cf ioscan -funC tape ioscan -fnC tape ioscan -kfC tape - + Sample outputs from my Linux server: @@ -105,26 +107,26 @@ You can set TAPE shell variable. This is the pathname of the tape drive. The def ### 1: Display status of the tape/drive ### - mt status #Use default + mt status #Use default mt -f /dev/rmt/0 status #Unix - mt -f /dev/st0 status #Linux + mt -f /dev/st0 status #Linux mt -f /dev/nsa0 status #FreeBSD - mt -f /dev/rmt/1 status #Unix unity 1 i.e. tape device no. 1 - + mt -f /dev/rmt/1 status #Unix unity 1 i.e. tape device no. 1 + You can use shell loop as follows to poll a system and locate all of its tape drives: for d in 0 1 2 3 4 5 do mt -f "/dev/rmt/${d}" status done - + ### 2: Rewinds the tape ### mt rew mt rewind mt -f /dev/mt/0 rewind mt -f /dev/st0 rewind - + ### 3: Eject the tape ### mt off @@ -132,27 +134,27 @@ You can use shell loop as follows to poll a system and locate all of its tape dr mt eject mt -f /dev/mt/0 off mt -f /dev/st0 eject - + ### 4: Erase the tape (rewind the tape and, if applicable, unload the tape) ### mt erase - mt -f /dev/st0 erase #Linux - mt -f /dev/rmt/0 erase #Unix - + mt -f /dev/st0 erase #Linux + mt -f /dev/rmt/0 erase #Unix + ### 5: Retensioning a magnetic tape cartridge ### If errors occur when a tape is being read, you can retension the tape, clean the tape drive, and then try again as follows: mt retension mt -f /dev/rmt/1 retension #Unix - mt -f /dev/st0 retension #Linux - + mt -f /dev/st0 retension #Linux + ### 6: Writes n EOF marks in the current position of tape ### mt eof mt weof mt -f /dev/st0 eof - + ### 7: Forward space count files i.e. jumps n EOF marks ### The tape is positioned on the first block of the next file i.e. tape will position on first block of the field (see fig.01): @@ -160,7 +162,7 @@ The tape is positioned on the first block of the next file i.e. tape will positi mt fsf mt -f /dev/rmt/0 fsf mt -f /dev/rmt/1 fsf 1 #go 1 forward file/tape (see fig.01) - + ### 8: Backward space count files i.e. rewinds n EOF marks ### The tape is positioned on the first block of the next file i.e. tape positions after EOF mark (see fig.01): @@ -168,27 +170,27 @@ The tape is positioned on the first block of the next file i.e. tape positions a mt bsf mt -f /dev/rmt/1 bsf mt -f /dev/rmt/1 bsf 1 #go 1 backward file/tape (see fig.01) - + Here is a list of the tape position commands: fsf Forward space count files. The tape is positioned on the first block of the next file. - + fsfm Forward space count files. The tape is positioned on the last block of the previous file. - + bsf Backward space count files. The tape is positioned on the last block of the previous file. - + bsfm Backward space count files. The tape is positioned on the first block of the next file. - + asf The tape is positioned at the beginning of the count file. Positioning is done by first rewinding the tape and then spacing forward over count filemarks. - + fsr Forward space count records. - + bsr Backward space count records. - + fss (SCSI tapes) Forward space count setmarks. - + bss (SCSI tapes) Backward space count setmarks. - + ### Basic backup commands ### Let us see commands to backup and restore files @@ -197,31 +199,31 @@ Let us see commands to backup and restore files tar cvf /dev/rmt/0n /etc tar cvf /dev/st0 /etc - + ### 10: To restore directory (tar format) ### tar xvf /dev/rmt/0n -C /path/to/restore tar xvf /dev/st0 -C /tmp - + ### 11: List or check tape contents (tar format) ### mt -f /dev/st0 rewind; dd if=/dev/st0 of=- - + ## tar format ## tar tvf {DEVICE} {Directory-FileName} tar tvf /dev/st0 tar tvf /dev/st0 desktop tar tvf /dev/rmt/0 foo > list.txt - + ### 12: Backup partition with dump or ufsdump ### ## Unix backup c0t0d0s2 partition ## ufsdump 0uf /dev/rmt/0 /dev/rdsk/c0t0d0s2 - + ## Linux backup /home partition ## dump 0uf /dev/nst0 /dev/sda5 dump 0uf /dev/nst0 /home - + ## FreeBSD backup /usr partition ## dump -0aL -b64 -f /dev/nsa0 /usr @@ -231,12 +233,12 @@ Let us see commands to backup and restore files ufsrestore xf /dev/rmt/0 ## Unix interactive restore ## ufsrestore if /dev/rmt/0 - + ## Linux ## restore rf /dev/nst0 ## Restore interactive from the 6th backup on the tape media ## restore isf 6 /dev/nst0 - + ## FreeBSD restore ufsdump format ## restore -i -f /dev/nsa0 @@ -244,10 +246,10 @@ Let us see commands to backup and restore files ## This will overwrite all data on tape ## mt -f /dev/st1 rewind - + ### Backup home ## tar cvf /dev/st1 /home - + ## Offline and unload tape ## mt -f /dev/st0 offline @@ -256,28 +258,28 @@ To restore from the beginning of the tape: mt -f /dev/st0 rewind tar xvf /dev/st0 mt -f /dev/st0 offline - + ### 14: Start writing after the last tar (see fig.02) ### ## This will kee all data written so far ## mt -f /dev/st1 eom - + ### Backup home ## tar cvf /dev/st1 /home - + ## Unload ## mt -f /dev/st0 offline - + ### 15: Start writing after tar number 2 (see fig.02) ### ## To wrtite after tar number 2 (should be 2+1) mt -f /dev/st0 asf 3 tar cvf /dev/st0 /usr - + ## asf equivalent command done using fsf ## mt -f /dev/sf0 rewind mt -f /dev/st0 fsf 2 - + To restore tar from tar number 2: mt -f /dev/st0 asf 3 @@ -308,28 +310,28 @@ It is important that you do regular full system restorations and service testing # Last updated on : Feb-2007 - Added support for excluding files / dirs. # ------------------------------------------------------------------------- LOGBASE=/root/backup/log - + # Backup dirs; do not prefix / BACKUP_ROOT_DIR="home sales" - + # Get todays day like Mon, Tue and so on NOW=$(date +"%a") - + # Tape devie name TAPE="/dev/st0" - + # Exclude file TAR_ARGS="" EXCLUDE_CONF=/root/.backup.exclude.conf - + # Backup Log file LOGFIILE=$LOGBASE/$NOW.backup.log - + # Path to binaries TAR=/bin/tar MT=/bin/mt MKDIR=/bin/mkdir - + # ------------------------------------------------------------------------ # Excluding files when using tar # Create a file called $EXCLUDE_CONF using a text editor @@ -338,7 +340,7 @@ It is important that you do regular full system restorations and service testing # home/vivek/*.cpp~ # ------------------------------------------------------------------------ [ -f $EXCLUDE_CONF ] && TAR_ARGS="-X $EXCLUDE_CONF" - + #### Custom functions ##### # Make a full backup full_backup(){ @@ -349,7 +351,7 @@ It is important that you do regular full system restorations and service testing $MT -f $TAPE offline cd $old } - + # Make a partial backup partial_backup(){ local old=$(pwd) @@ -359,7 +361,7 @@ It is important that you do regular full system restorations and service testing $MT -f $TAPE offline cd $old } - + # Make sure all dirs exits verify_backup_dirs(){ local s=0 @@ -374,15 +376,15 @@ It is important that you do regular full system restorations and service testing # if not; just die [ $s -eq 1 ] && exit 1 } - + #### Main logic #### - + # Make sure log dir exits [ ! -d $LOGBASE ] && $MKDIR -p $LOGBASE - + # Verify dirs verify_backup_dirs - + # Okay let us start backup procedure # If it is Monday make a full backup; # For Tue to Fri make a partial backup @@ -392,7 +394,7 @@ It is important that you do regular full system restorations and service testing Tue|Wed|Thu|Fri) partial_backup;; *) ;; esac > $LOGFIILE 2>&1 - + ### A note about third party backup utilities ### Both Linux and Unix-like system provides many third-party utilities which you can use to schedule the creation of backups including tape backups such as: @@ -422,4 +424,4 @@ via: http://www.cyberciti.biz/hardware/unix-linux-basic-tape-management-commands [3]:http://www.manpager.com/linux/man1/mtx.1.html [4]:http://www.manpager.com/linux/man1/tar.1.html [5]:http://www.manpager.com/linux/man8/dump.8.html -[6]:http://www.manpager.com/linux/man8/restore.8.html \ No newline at end of file +[6]:http://www.manpager.com/linux/man8/restore.8.html From 49d5d089d8574762e096899cf290d53a8e3b1229 Mon Sep 17 00:00:00 2001 From: alim0x Date: Sun, 10 Jan 2016 18:34:07 +0800 Subject: [PATCH 0181/1469] [translate]Useful Linux and Unix Tape Managements Commands For Sysadmins --- ...Tape Managements Commands For Sysadmins.md | 208 +++++++++--------- 1 file changed, 103 insertions(+), 105 deletions(-) diff --git a/sources/tech/20151130 Useful Linux and Unix Tape Managements Commands For Sysadmins.md b/sources/tech/20151130 Useful Linux and Unix Tape Managements Commands For Sysadmins.md index d93670e012..f115444665 100644 --- a/sources/tech/20151130 Useful Linux and Unix Tape Managements Commands For Sysadmins.md +++ b/sources/tech/20151130 Useful Linux and Unix Tape Managements Commands For Sysadmins.md @@ -1,67 +1,65 @@ -alim0x translating - -15 Useful Linux and Unix Tape Managements Commands For Sysadmins +15条给系统管理员的实用 Linux/Unix 磁带管理命令 ================================================================================ -Tape devices should be used on a regular basis only for archiving files or for transferring data from one server to another. Usually, tape devices are all hooked up to Unix boxes, and controlled with mt or mtx. You must backup all data to both disks (may be in cloud) and tape device. In this tutorial you will learn about: +磁带设备应只用于定期的文件归档或将数据从一台服务器传送至另一台。通常磁带设备与 Unix 机器连接,用 mt 或 mtx 控制。你可以将所有的数据备份到磁盘(也许是云中)和磁带设备。在这个教程中你将会了解到: -- Tape device names -- Basic commands to manage tape drive -- Basic backup and restore commands +- 磁带设备名 +- 管理磁带驱动器的基本命令 +- 基本的备份和恢复命令 -### Why backup? ### +### 为什么备份? ### -A backup plant is important: +一个备份设备是很重要的: -- Ability to recover from disk failure -- Accidental file deletion -- File or file system corruption -- Complete server destruction, including destruction of on-site backups due to fire or other problems. +- 从磁盘故障中恢复的能力 +- 意外的文件删除 +- 文件或文件系统损坏 +- 服务器完全毁坏,包括由于火灾或其他问题导致的同盘备份毁坏 -You can use tape based archives to backup the whole server and move tapes off-site. +你可以使用磁带归档备份整个服务器并将其离线存储。 -### Understanding tape file marks and block size ### +### 理解磁带文件标记和块大小 ### ![Fig.01: Tape file marks](http://s0.cyberciti.org/uploads/cms/2015/10/tape-format.jpg) -Fig.01: Tape file marks +图01:磁带文件标记 -Each tape device can store multiple tape backup files. Tape backup files are created using cpio, tar, dd, and so on. However, tape device can be opened, written data to, and closed by various program. You can store several backups (tapes) on physical tape. Between each tape file is a "tape file mark". This is used to indicate where one tape file ends and another begins on physical tape. You need to use mt command to positions the tape (winds forward and rewinds and marks). +每个磁带设备能存储多个备份文件。磁带备份文件通过 cpio,tar,dd 等命令创建。但是,磁带设备可以由各种程序打开,写入数据,并关闭。你可以存储若干备份(磁带文件)到一个物理磁带上。在每个磁带文件之间有个“磁带文件标记”。这个是用来指示一个物理磁带上磁带文件的结尾以及另一个文件的开始。你需要使用 mt 命令来定位磁带(快进,倒带和标记)。 -#### How data is stored on a tape #### +#### 磁带上的数据是如何存储的 #### ![Fig.02: How data is stored on a tape](http://s0.cyberciti.org/uploads/cms/2015/10/how-data-is-stored-on-a-tape.jpg) -Fig.02: How data is stored on a tape +图02:磁带上的数据是如何存储的 -All data is stored subsequently in sequential tape archive format using tar. The first tape archive will start on the physical beginning of the tape (tar #0). The next will be tar #1 and so on. +所有的数据使用 tar 以连续磁带存储格式连续地存储。第一个磁带归档会从磁带的物理开始端开始存储(tar #0)。接下来的就是 tar #1,以此类推。 -### Tape device names on Unix ### +### Unix 上的磁带设备名 ### -1. /dev/rmt/0 or /dev/rmt/1 or /dev/rmt/[0-127] : Regular tape device name on Unix. The tape is rewound. -1. /dev/rmt/0n : This is know as no rewind i.e. after using tape, leaves the tape in current status for next command. -1. /dev/rmt/0b : Use magtape interface i.e. BSD behavior. More-readable by a variety of OS's such as AIX, Windows, Linux, FreeBSD, and more. -1. /dev/rmt/0l : Set density to low. -1. /dev/rmt/0m : Set density to medium. -1. /dev/rmt/0u : Set density to high. -1. /dev/rmt/0c : Set density to compressed. -1. /dev/st[0-9] : Linux specific SCSI tape device name. -1. /dev/sa[0-9] : FreeBSD specific SCSI tape device name. -1. /dev/esa0 : FreeBSD specific SCSI tape device name that eject on close (if capable). +1. /dev/rmt/0 或 /dev/rmt/1 或 /dev/rmt/[0-127] :Unix 上的常规磁带设备名。磁带自动倒回。 +1. /dev/rmt/0n :以无倒回为特征,换言之,磁带使用之后,停留在当前状态等待下个命令。 +1. /dev/rmt/0b :使用磁带接口,也就是 BSD 的行为。各种类型的操作系统比如 AIX,Windows,Linux,FreeBSD 等的行为更有可读性。 +1. /dev/rmt/0l :设置密度为低。 +1. /dev/rmt/0m :设置密度为中。 +1. /dev/rmt/0u :设置密度为高。 +1. /dev/rmt/0c :设置密度为压缩。 +1. /dev/st[0-9] :Linux 特定 SCSI 磁带设备名。 +1. /dev/sa[0-9] :FreeBSD 特定 SCSI 磁带设备名。 +1. /dev/esa0 :FreeBSD 特定 SCSI 磁带设备名,在关闭时弹出(如果可以的话)。 -#### Tape device name examples #### +#### 磁带设备名示例 #### -- The /dev/rmt/1cn indicate that I'm using unity 1, compressed density and no rewind. -- The /dev/rmt/0hb indicate that I'm using unity 0, high density and BSD behavior. -- The auto rewind SCSI tape device name on Linux : /dev/st0 -- The non-rewind SCSI tape device name on Linux : /dev/nst0 -- The auto rewind SCSI tape device name on FreeBSD: /dev/sa0 -- The non-rewind SCSI tape device name on FreeBSD: /dev/nsa0 +- /dev/rmt/1cn 指明正在使用 unity 1,压缩密度,无倒回。 +- /dev/rmt/0hb 指明正在使用 unity 0,高密度,BSD 行为。 +- Linux 上的自动倒回 SCSI 磁带设备名:/dev/st0 +- Linux 上的无倒回 SCSI 磁带设备名:/dev/nst0 +- FreeBSD 上的自动倒回 SCSI 磁带设备名:/dev/sa0 +- FreeBSD 上的无倒回 SCSI 磁带设备名:/dev/nsa0 -#### How do I list installed scsi tape devices? #### +#### 如何列出已安装的 scsi 磁带设备? #### -Type the following commands: +输入下列命令: - ## Linux (read man pages for more info) ## + ## Linux(更多信息参阅 man) ## lsscsi lsscsi -g @@ -83,51 +81,51 @@ Type the following commands: ioscan -kfC tape -Sample outputs from my Linux server: +来自我的 Linux 服务器的输出示例: ![Fig.03: Installed tape devices on Linux server](http://s0.cyberciti.org/uploads/cms/2015/10/linux-find-tape-devices-command.jpg) -Fig.03: Installed tape devices on Linux server +图03:Linux 服务器上已安装的磁带设备 -### mt command examples ### +### mt 命令实例 ### -In Linux and Unix-like system, mt command is used to control operations of the tape drive, such as finding status or seeking through files on a tape or writing tape control marks to the tape. You must most of the following command as root user. The syntax is: +在 Linux 和类Unix系统上,mt 命令用来控制磁带驱动器的操作,比如查看状态或查找磁带上的文件或写入磁带控制标记。下列大多数命令需要作为 root 用户执行。语法如下: mt -f /tape/device/name operation -#### Setting up environment #### +#### 设置环境 #### -You can set TAPE shell variable. This is the pathname of the tape drive. The default (if the variable is unset, but not if it is null) is /dev/nsa0 on FreeBSD. It may be overridden with the -f option passed to the mt command as explained below. +你可以设置 TAPE shell 变量。这是磁带驱动器的路径名。在 FreeBSD 上默认的(如果变量没有设置,而不是 null)是 /dev/nsa0。可以通过 mt 命令的 -f 参数传递变量覆盖它,就像下面解释的那样。 - ## Add to your shell startup file ## + ## 添加到你的 shell 配置文件 ## TAPE=/dev/st1 #Linux TAPE=/dev/rmt/2 #Unix TAPE=/dev/nsa3 #FreeBSD export TAPE -### 1: Display status of the tape/drive ### +### 1:显示磁带/驱动器状态 ### mt status #Use default mt -f /dev/rmt/0 status #Unix mt -f /dev/st0 status #Linux mt -f /dev/nsa0 status #FreeBSD - mt -f /dev/rmt/1 status #Unix unity 1 i.e. tape device no. 1 + mt -f /dev/rmt/1 status #Unix unity 1 也就是 tape device no. 1 -You can use shell loop as follows to poll a system and locate all of its tape drives: +你可以像下面一样使用 shell 循环调查系统并定位所有的磁带驱动器: for d in 0 1 2 3 4 5 do mt -f "/dev/rmt/${d}" status done -### 2: Rewinds the tape ### +### 2:倒带 ### mt rew mt rewind mt -f /dev/mt/0 rewind mt -f /dev/st0 rewind -### 3: Eject the tape ### +### 3:弹出磁带 ### mt off mt offline @@ -135,162 +133,162 @@ You can use shell loop as follows to poll a system and locate all of its tape dr mt -f /dev/mt/0 off mt -f /dev/st0 eject -### 4: Erase the tape (rewind the tape and, if applicable, unload the tape) ### +### 4:擦除磁带(倒带,在可以的情况下卸载磁带) ### mt erase mt -f /dev/st0 erase #Linux mt -f /dev/rmt/0 erase #Unix -### 5: Retensioning a magnetic tape cartridge ### +### 5:张紧磁带盒 ### -If errors occur when a tape is being read, you can retension the tape, clean the tape drive, and then try again as follows: +如果磁带在读取时发生错误,你重新张紧磁带,清洁磁带驱动器,像下面这样再试一次: mt retension mt -f /dev/rmt/1 retension #Unix mt -f /dev/st0 retension #Linux -### 6: Writes n EOF marks in the current position of tape ### +### 6:在磁带当前位置写入 EOF 标记 ### mt eof mt weof mt -f /dev/st0 eof -### 7: Forward space count files i.e. jumps n EOF marks ### +### 7:将磁带前进指定的文件标记数目,即跳过指定个 EOF 标记 ### -The tape is positioned on the first block of the next file i.e. tape will position on first block of the field (see fig.01): +磁带定位在下一个文件的第一个块,即磁带会定位在下一区域的第一个块(见图01): mt fsf mt -f /dev/rmt/0 fsf mt -f /dev/rmt/1 fsf 1 #go 1 forward file/tape (see fig.01) -### 8: Backward space count files i.e. rewinds n EOF marks ### +### 8:将磁带后退指定的文件标记数目,即倒带指定个 EOF 标记 ### -The tape is positioned on the first block of the next file i.e. tape positions after EOF mark (see fig.01): +磁带定位在下一个文件的第一个块,即磁带会定位在 EOF 标记之后(见图01): mt bsf mt -f /dev/rmt/1 bsf mt -f /dev/rmt/1 bsf 1 #go 1 backward file/tape (see fig.01) -Here is a list of the tape position commands: +这里是磁带定位命令列表: - fsf Forward space count files. The tape is positioned on the first block of the next file. + fsf 前进指定的文件标记数目。磁带定位在下一个文件的第一块。 - fsfm Forward space count files. The tape is positioned on the last block of the previous file. + fsfm 前进指定的文件标记数目。磁带定位在前一文件的最后一块。 - bsf Backward space count files. The tape is positioned on the last block of the previous file. + bsf 后退指定的文件标记数目。磁带定位在前一文件的最后一块。 - bsfm Backward space count files. The tape is positioned on the first block of the next file. + bsfm 后退指定的文件标记数目。磁带定位在下一个文件的第一块。 - asf The tape is positioned at the beginning of the count file. Positioning is done by first rewinding the tape and then spacing forward over count filemarks. + asf The tape is positioned at the beginning of the count file. Positioning is done by first rewinding the tape and then spacing forward over count filemarks.磁带定位在 - fsr Forward space count records. + fsr 前进指定的记录数。 - bsr Backward space count records. + bsr 后退指定的记录数。 - fss (SCSI tapes) Forward space count setmarks. + fss (SCSI tapes)前进指定的 setmarks。 - bss (SCSI tapes) Backward space count setmarks. + bss (SCSI tapes)后退指定的 setmarks。 -### Basic backup commands ### +### 基本备份命令 ### -Let us see commands to backup and restore files +让我们来看看备份和恢复命令。 -### 9: To backup directory (tar format) ### +### 9:备份目录(tar 格式) ### tar cvf /dev/rmt/0n /etc tar cvf /dev/st0 /etc -### 10: To restore directory (tar format) ### +### 10:恢复目录(tar 格式) ### tar xvf /dev/rmt/0n -C /path/to/restore tar xvf /dev/st0 -C /tmp -### 11: List or check tape contents (tar format) ### +### 11:列出或检查磁带内容(tar 格式) ### mt -f /dev/st0 rewind; dd if=/dev/st0 of=- - ## tar format ## + ## tar 格式 ## tar tvf {DEVICE} {Directory-FileName} tar tvf /dev/st0 tar tvf /dev/st0 desktop tar tvf /dev/rmt/0 foo > list.txt -### 12: Backup partition with dump or ufsdump ### +### 12:使用 dump 或 ufsdump 备份分区 ### - ## Unix backup c0t0d0s2 partition ## + ## Unix 备份 c0t0d0s2 分区 ## ufsdump 0uf /dev/rmt/0 /dev/rdsk/c0t0d0s2 - ## Linux backup /home partition ## + ## Linux 备份 /home 分区 ## dump 0uf /dev/nst0 /dev/sda5 dump 0uf /dev/nst0 /home - ## FreeBSD backup /usr partition ## + ## FreeBSD 备份 /usr 分区 ## dump -0aL -b64 -f /dev/nsa0 /usr -### 12: Restore partition with ufsrestore or restore ### +### 12:使用 ufsrestore 或 restore 恢复分区 ### ## Unix ## ufsrestore xf /dev/rmt/0 - ## Unix interactive restore ## + ## Unix 交互式恢复 ## ufsrestore if /dev/rmt/0 ## Linux ## restore rf /dev/nst0 - ## Restore interactive from the 6th backup on the tape media ## + ## 从磁带媒介上的第6个备份交互式恢复 ## restore isf 6 /dev/nst0 - ## FreeBSD restore ufsdump format ## + ## FreeBSD 恢复 ufsdump 格式 ## restore -i -f /dev/nsa0 -### 13: Start writing at the beginning of the tape (see fig.02) ### +### 13:从磁带开头开始写入(见图02) ### - ## This will overwrite all data on tape ## + ## 这会覆盖磁带上的所有数据 ## mt -f /dev/st1 rewind - ### Backup home ## + ### 备份 home ## tar cvf /dev/st1 /home - ## Offline and unload tape ## + ## 离线并卸载磁带 ## mt -f /dev/st0 offline -To restore from the beginning of the tape: +从磁带开头开始恢复: mt -f /dev/st0 rewind tar xvf /dev/st0 mt -f /dev/st0 offline -### 14: Start writing after the last tar (see fig.02) ### +### 14:从最后一个 tar 后开始写入(见图02) ### - ## This will kee all data written so far ## + ## 这会保留之前写入的数据 ## mt -f /dev/st1 eom - ### Backup home ## + ### 备份 home ## tar cvf /dev/st1 /home - ## Unload ## + ## 卸载 ## mt -f /dev/st0 offline -### 15: Start writing after tar number 2 (see fig.02) ### +### 15:从 tar number 2 后开始写入(见图02) ### - ## To wrtite after tar number 2 (should be 2+1) + ## 在 tar number 2 之后写入(应该是 2+1) mt -f /dev/st0 asf 3 tar cvf /dev/st0 /usr - ## asf equivalent command done using fsf ## + ## asf 等效于 fsf ## mt -f /dev/sf0 rewind mt -f /dev/st0 fsf 2 -To restore tar from tar number 2: +从 tar number 2 恢复 tar: mt -f /dev/st0 asf 3 tar xvf /dev/st0 mt -f /dev/st0 offline -### How do I verify backup tapes created using tar? ### +### 如何验证使用 tar 创建的备份磁带? ### -It is important that you do regular full system restorations and service testing, it's the only way to know for sure that the entire system is working correctly. See our [tutorial on verifying tar command tape backups][1] for more information. +定期做全系统修复和服务测试是很重要的,这是唯一确定整个系统正确工作的途径。参见我们的[验证 tar 命令磁带备份的教程][1]以获取更多信息。 -### Sample shell script ### +### 示例 shell 脚本 ### #!/bin/bash # A UNIX / Linux shell script to backup dirs to tape device like /dev/st0 (linux) @@ -395,9 +393,9 @@ It is important that you do regular full system restorations and service testing *) ;; esac > $LOGFIILE 2>&1 -### A note about third party backup utilities ### +### 关于第三方备份工具 ### -Both Linux and Unix-like system provides many third-party utilities which you can use to schedule the creation of backups including tape backups such as: +Linux 和类Unix系统都提供了许多第三方工具,可以用来安排备份,包括磁带备份在内,如: - Amanda - Bacula @@ -405,7 +403,7 @@ Both Linux and Unix-like system provides many third-party utilities which you ca - duplicity - rsnapshot -See also +另行参阅 - Man pages - [mt(1)][2], [mtx(1)][3], [tar(1)][4], [dump(8)][5], [restore(8)][6] @@ -414,7 +412,7 @@ See also via: http://www.cyberciti.biz/hardware/unix-linux-basic-tape-management-commands/ 作者:Vivek Gite -译者:[译者ID](https://github.com/译者ID) +译者:[alim0x](https://github.com/alim0x) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From e27ff32c7c114c5c5552af0c86f7bb6336b64fe3 Mon Sep 17 00:00:00 2001 From: Rubik Date: Sun, 10 Jan 2016 22:49:18 +0800 Subject: [PATCH 0182/1469] [Translating] 18 Years of GNOME Design and Software Evolution: Step by Step MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新手第一次翻译,若有不当望指正。 --- ...rs of GNOME Design and Software Evolution--Step by Step.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/talk/20151020 18 Years of GNOME Design and Software Evolution--Step by Step.md b/sources/talk/20151020 18 Years of GNOME Design and Software Evolution--Step by Step.md index 174fc55262..ea43c7af47 100644 --- a/sources/talk/20151020 18 Years of GNOME Design and Software Evolution--Step by Step.md +++ b/sources/talk/20151020 18 Years of GNOME Design and Software Evolution--Step by Step.md @@ -1,3 +1,5 @@ +HaohongWANG Translating + 18 Years of GNOME Design and Software Evolution: Step by Step ================================================================================ 注:youtube 视频 @@ -196,4 +198,4 @@ via: https://tlhp.cf/18-years-of-gnome-evolution/ [a]:https://tlhp.cf/author/paul/ [1]:https://www.gnome.org/ -[2]:https://en.wikipedia.org/wiki/GNOME \ No newline at end of file +[2]:https://en.wikipedia.org/wiki/GNOME From aa7446561ca9eaab4ce216b48d6923ae62da81bf Mon Sep 17 00:00:00 2001 From: Yu Haixin <836401406@qq.com> Date: Mon, 11 Jan 2016 07:14:05 +0800 Subject: [PATCH 0183/1469] Update 20150818 A Linux User Using Windows 10 After More than 8 Years--See Comparison.md --- ... Using Windows 10 After More than 8 Years--See Comparison.md | 2 ++ 1 file changed, 2 insertions(+) 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 index 702783b6b0..21a6fc9ca2 100644 --- 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 @@ -1,3 +1,5 @@ +#name1e5s translating + 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. From 64165a70a8cbcb5bbaa3c9ce38b926cc6c00820d Mon Sep 17 00:00:00 2001 From: Markgolzh <1134386961@qq.com> Date: Mon, 11 Jan 2016 10:15:28 +0800 Subject: [PATCH 0184/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E4=BA=86=E4=B8=80?= =?UTF-8?q?=E7=AF=87=E7=BF=BB=E8=AF=91=E7=9A=84=E4=B8=8D=E5=A5=BD=EF=BC=8C?= =?UTF-8?q?=E4=BA=A4=E8=BF=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 还是交给对gcc-Inline-Assembly有研究的人来翻译,我的翻译的太渣了。 --- sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md b/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md index 45dbf42e96..99f1ceed04 100644 --- a/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md +++ b/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md @@ -1,4 +1,3 @@ -translate by zky001 * * * # GCC-Inline-Assembly-HOWTO @@ -626,6 +625,6 @@ If you have found any glaring typos, or outdated info in this document, please l * * * via: http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html - 作者:[Sandeep.S](mailto:busybox@sancharnet.in) 译者:[zky001](https://github.com/zky001) 校对:[]() + 作者:[Sandeep.S](mailto:busybox@sancharnet.in) 译者:[](https://github.com/) 校对:[]() 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From cbc9c4bc0d5df56fb4475bb8ca95b30d7a759753 Mon Sep 17 00:00:00 2001 From: icecoobe Date: Mon, 11 Jan 2016 10:17:27 +0800 Subject: [PATCH 0185/1469] =?UTF-8?q?icecoobe=E8=AE=A4=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0151223 What' s the Best File System for My Linux Install.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/talk/20151223 What' s the Best File System for My Linux Install.md b/sources/talk/20151223 What' s the Best File System for My Linux Install.md index 1e8af12179..52f2ac8e88 100644 --- a/sources/talk/20151223 What' s the Best File System for My Linux Install.md +++ b/sources/talk/20151223 What' s the Best File System for My Linux Install.md @@ -1,3 +1,5 @@ +Translating by icecoobe. + What’s the Best File System for My Linux Install? ================================================================================ ![](https://www.maketecheasier.com/assets/uploads/2015/05/file-systems-feature-image.jpg) From 12530959088786f1c96cd5a19f92e10ce7a37e14 Mon Sep 17 00:00:00 2001 From: carolinewuyan <309866211@qq.com> Date: Mon, 11 Jan 2016 14:28:16 +0800 Subject: [PATCH 0186/1469] =?UTF-8?q?=E5=B7=B2=E6=A0=A1=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ps for teaching open source development.md | 54 +++++++++++-------- 1 file changed, 33 insertions(+), 21 deletions(-) diff --git a/translated/talk/20150921 14 tips for teaching open source development.md b/translated/talk/20150921 14 tips for teaching open source development.md index aef6304789..c6464977ac 100644 --- a/translated/talk/20150921 14 tips for teaching open source development.md +++ b/translated/talk/20150921 14 tips for teaching open source development.md @@ -1,11 +1,10 @@ -GHLandy Translated 开源代码开发的十四点教学技巧 ================================================================================ -对于培养和塑造开源代码开发者,学术界就是一个很好的平台。研究中发现,我们偶尔会开源自己编写的软件。这样做有两个理由,一是为了提升自己编写的工具的使用率,二是为了了解人们使用这些工具时会遇到哪些问题。在这样一个编写研究软件的背景下,我的任务就是为 Bradford 大学重新设计二年级的软件工程课程。 +对于培养和塑造开源代码开发者,Academia就是一个很好的平台。研究中发现,我们偶尔会开源自己编写的软件。这样做有两个理由,一是为了提升自己编写的工具使用率,二是为了了解人们使用这些工具时会遇到哪些问题。在这样一个编写研究软件的背景下,我的任务就是为 Bradford 大学重新设计二年级的软件工程课程。 -这是一个巨大的挑战,因为我所面对的 80 个学生是来自不同专业的,包括 IT、商务计算和软件工程,这些学生将要在一起上课。最有难度的是,需要和这些编程经验差距很大的学生一起编写代码。按照传统,该课程允许学生选择自己的小组,然后布置他们构建一个存储数据库系统构的任务,最后提交报告作为评估的一部分。 +这是一个巨大的挑战,因为我所面对的 80 个学生是来自不同专业的,包括 IT、商务计算和软件工程,这些学生将要在一起上课。最有难度的是,需要和这些编程经验差距很大的学生一起编写代码。按照传统,该课程允许学生选择自己的小组,然后给他们布置构建一个存储数据库系统构的任务,最后提交报告作为评估的一部分。 而我决定重新设计课程,让学生了解现实中的软件团队是如何协作的过程。根据学生的专业和编程技能,我将他们分为五六个人一组。这是为了确保每个小组的整体水平相当,避免小组之间的不公平。 @@ -26,13 +25,13 @@ GHLandy Translated - 开源代码许可及其选择 - 软件分发 -在这些讲座之后,我会有一些来自世界各地的嘉宾为我们说说他们在软件分发过程中的经验。我们也设法请来大学里知识产权律师谈关于软件在英国的知识产权问题,以及如何处理软件的知识产权问题。 +在这些讲座之后,会有一些来自世界各地的嘉宾为我们说说他们在软件分发过程中的经验。我们也设法请来大学里知识产权律师谈关于软件在英国的知识产权问题,以及如何处理软件的知识产权问题。 ### 协作工具 ### 为了让上述教学内容的顺利进行,我们将会介绍一些工具,并训练学生在他们的项目中使用这些工具。如下: -- Google Drive:团队与导师之间进行共享的工具,暂时存储用于描述项目的文档和图表、需求收集、会议纪要以及项目跟踪等信息。采取这样一个方式来监控并提供直接反馈到每个团队,是非常有效的。 +- Google Drive:团队与导师之间进行共享的工具,暂时存储用于描述项目的文档和图表、需求收集、会议纪要以及项目时间跟踪等信息。采取这样一个方式来监控并提供直接反馈到每个团队,是非常有效的。 - [Basecamp][1]:同样是用于分享文档,在随后的课程中,我们可能会考虑用它取代 Google Drive。 - BUG 报告工具,如 [Mantis][2]:只能让有限的用户自由提交 BUG。稍后我们提到的 Git 可以让小组内的所有人员用做 BUG 提交。 - 远程视频会议工具:在人员不在校内,甚至去了其他城市的情况下使用。学生们可以定期通过 Skype 来交流并记录会议内容或则进行录音作为今后其他用处。 @@ -43,22 +42,35 @@ GHLandy Translated 在最后,这一年过的很愉快,并且所有学生的项目都做的非常棒。这里有一些我学到的经验教训,可能有助于提高明年的课程质量: -1. 提供各种各样的有趣的选择项目给学生选择。比如说,游戏开发或者移动应用开发以及完成各种目标的项目等。建立普通的数据库系统已经不能提起学生的兴趣了,而参与到有趣的项目中去,学生本身就是自学者,同时可以帮助解决小组成员和小组之间的常见问题。再通过一个消息列表,学生们发表他们在测试中遇到的任何问题,以寻求其他人的帮助建议。然而,这种方法有一个缺点。外部考官建议我们使用统一种类型的项目和统一的编程语言以帮助缩小对学生的评估标准。 -2. 定期给学生在每一个阶段的表现进行反馈。比方说,可以在和各个小组开指导会议的时候、或者每个阶段进行反馈,以帮助他在接下来的工作中自我改进。 -3. 学生更加愿意与校外的客户一起协作。他们期待着与外部公司代表或大学以外的人协作,不过是为了获得新体验而已。与导师进行交流时,他们都能够表现得很专业,这样使得老师非常放心。 -4. 很多团队版开发单元测试的部分放到项目结束之后,从极限编程方法的角度来说,这是一个严重的禁忌。也许测试应包括在不同阶段的评估中,来提醒他们需要与并行开展软件开发和单元测试。 -5. 在这个班的 80 个人里边,仅有 4 个女生,每个女都分在不同的小组里边。我观察到,男生们总是准备充分地承担起领队角色,并将最有趣的代码分配个他们自己来编写,女生则多大遵循安排或则是编写文档。出于某种原因,女生选择不显示权威,即使在女性辅导员鼓励下,她们也不愿编写代码。这仍然是一个需要解决的主要问题。 -6.允许不同风格文项目文档,比方说,UML 图表、状态图或其他形式的。让学生学习这些并与其他课程融汇贯通来提高他们的学习经验。 -7. 学生里边,有些是很好的开发人员,有些做商务计算的则没有多少编程经验。我们要鼓励团队共同努力,避免开发人员做得比那些只做会议记录或文档的其他成员更好的错误认知。我们常在辅导课程中鼓励角色转换,让每个人都有机会学习如何编程。 -8. 各个小组进行导师会议室非常重要的,可以有效监督各个小组进展情况,还可以了解是谁做了大部分工作。通常,没来参加会议的小组成员基本就是没有参与到他们的团队工作中去的,并且通过其他成员提交的工作报告也可以确定哪些人不活跃。 -9. 我们鼓励学生们把许可证附加到项目中去,使用外部库以及和客户协作的时候要表明确切知识产权问题。 这样可让解放学生的思考能力,了解真实的软件交付问题。 -10. 给学生们自己选择技术空间。 -11. 助教是关键。同时管理 80 个显示显然很有难度,特别是需要对他们进行评估的那几周。明年我一定会找个助教来帮我一起管理各个小组。 -12. 实验室的技术支持是非常重要的。大学里的技术支持对于本课程是非常赞同的。学习正在考虑明年将虚拟机分配给每个团队,这样没个团队可以根据需要自行在虚拟机中安装任何软件。 -13. 团队合作,相互帮助。大多数团队自然而然的支持其他团队成员,同时指导人在中间也帮助了不少。 -14. 来自其他技术人员的帮助只能作为辅助方法。作为一个新的学术,我需要从经验中学习,同时当我如何知道学生是,我会通过多个角度来建议学生和小组去尝试处理问。来自高级技术人员的支持对我来说就是一种鼓励。 +1. 提供各种各样有趣的选择项目给学生选择。比如说,游戏开发或者移动应用开发以及完成各种目标的项目等。建立普通的数据库系统已经不能提起学生的兴趣了,而参与到有趣的项目中去,学生本身就是自学者,同时可以帮助解决小组成员和小组之间的常见问题。再通过一个消息列表,学生们发表他们在测试中遇到的任何问题,以寻求其他人的帮助建议。然而,这种方法有一个缺点。外部考官建议我们使用统一种类型的项目和统一的编程语言以帮助缩小对学生的评估标准。 -最后,对于作为导师的我以及所有的学生来说,这都是个有趣的课程。在学习目标和传统的分级方案上还有有一些问题需,以解决减少教师的工作量。明年,我计划会保留这种教学模式,并希望能够提出更好的分级方案以及介绍更多的软件来帮助监督项目和控制代码版本。 +2. 定期给学生在每一个阶段的表现进行反馈。比方说,可以在和各个小组开指导会议的时候,或者每个阶段进行反馈,以帮助他们在接下来的工作中自我改进。 + +3. 学生更加愿意与校外的客户一起协作。他们期待着与外部公司代表或校外人员协作,不过是为了获得新体验而已。与导师进行交流时,他们都能够表现得很专业,这样使得老师非常放心。 + +4. 很多团队版开发单元测试的部分放到项目结束之后,从极限编程方法的角度来说,这是一个严重的禁忌。也许测试应包括在不同阶段的评估中,来提醒他们需要与并行开展软件开发和单元测试。 + +5. 在这个班的 80 个人里边,仅有 4 个女生,每个女都分在不同的小组里边。我观察到,男生们总是充分准备好来承担起领队角色,并将最有趣的代码分配给他们自己来编写,女生则多大遵循安排或者是编写文档。出于某种原因,女生选择不显示权威,即使在女性辅导员鼓励下,她们也不愿编写代码。这仍然是一个需要解决的主要问题。 + +6.允许不同风格项目文档,比方说,UML 图表、状态图或其他形式的。让学生学习这些并与其他课程融汇贯通来提高他们的学习经验。 + +7. 学生里边,有些是很好的开发人员,有些做商务计算的则没有多少编程经验。我们要鼓励团队共同努力,避免开发人员做得比那些只做会议记录或文档的其他成员更好的错误认知。我们常在辅导课程中鼓励角色转换,让每个人都有机会学习如何编程。 + +8. 小组进行与导师每周见面沟通是非常重要的,可以有效监督各个小组进展情况,还可以了解是谁做了大部分工作。通常,没来参加会议的小组成员基本就是没有参与到他们的团队工作中去的,并且通过其他成员提交的工作报告也可以确定哪些人不活跃。 + +9. 我们鼓励学生们把许可证附加到项目中去,使用外部库以及和客户协作的时候要表明确切知识产权问题。 这样可让打破陈规,开拓思维,并了解真实的软件交付问题。 + +10. 给学生们自己选择技术空间。 + +11. 助教是关键。同时管理 80 个学生显然很有难度,特别是需要对他们进行评估的那几周。明年我一定会找个助教来帮我一起管理各个小组。 + +12. 实验室的技术支持是非常重要的。大学里的技术支持对于本课程是非常赞同的。他们正在考虑明年将虚拟机分配给每个团队,这样没个团队可以根据需要自行在虚拟机中安装任何软件。 + +13. 团队合作,相互帮助。大多数团队自然而然的支持其他团队成员,同时指导员在中间也帮助了不少。 + +14. 来自其他技术人员的帮助会锦上添花。作为一名新的大学导师,我需要从经验中学习,如果我想了解如何管理某些学生和团队,或者对如何让学生适应课程感到困惑时,我会通过多个方面来寻求建议。来自高级技术人员的支持对我来说是一种极大的鼓励。 + +最后,对于作为导师的我以及所有的学生来说,这都是个有趣的课程。在学习目标和传统的分级方案上还有有一些问题需解决,以减少教师的工作量。明年,我计划会保留这种教学模式,并希望能够提出更好的分级方案以及介绍更多的软件来帮助监督项目和控制代码版本。 -------------------------------------------------------------------------------- @@ -66,7 +78,7 @@ via: http://opensource.com/education/15/9/teaching-open-source-development-under 作者:[Mariam Kiran][a] 译者:[GHLandy](https://github.com/GHLandy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[Caroline](https://github.com/carolinewuyan) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 79a95eec3eeffd8078de6ce9a4f0bbd1c54b40ad Mon Sep 17 00:00:00 2001 From: carolinewuyan <309866211@qq.com> Date: Mon, 11 Jan 2016 14:33:40 +0800 Subject: [PATCH 0187/1469] =?UTF-8?q?=E5=B7=B2=E6=A0=A1=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20150921 14 tips for teaching open source development.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/talk/20150921 14 tips for teaching open source development.md b/translated/talk/20150921 14 tips for teaching open source development.md index c6464977ac..e1c340ba95 100644 --- a/translated/talk/20150921 14 tips for teaching open source development.md +++ b/translated/talk/20150921 14 tips for teaching open source development.md @@ -52,7 +52,7 @@ 5. 在这个班的 80 个人里边,仅有 4 个女生,每个女都分在不同的小组里边。我观察到,男生们总是充分准备好来承担起领队角色,并将最有趣的代码分配给他们自己来编写,女生则多大遵循安排或者是编写文档。出于某种原因,女生选择不显示权威,即使在女性辅导员鼓励下,她们也不愿编写代码。这仍然是一个需要解决的主要问题。 -6.允许不同风格项目文档,比方说,UML 图表、状态图或其他形式的。让学生学习这些并与其他课程融汇贯通来提高他们的学习经验。 +6. 允许不同风格项目文档,比方说,UML 图表、状态图或其他形式的。让学生学习这些并与其他课程融汇贯通来提高他们的学习经验。 7. 学生里边,有些是很好的开发人员,有些做商务计算的则没有多少编程经验。我们要鼓励团队共同努力,避免开发人员做得比那些只做会议记录或文档的其他成员更好的错误认知。我们常在辅导课程中鼓励角色转换,让每个人都有机会学习如何编程。 From e5e2cb9603981b7589553db809119c4745575414 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Mon, 11 Jan 2016 17:04:18 +0800 Subject: [PATCH 0188/1469] =?UTF-8?q?20160111-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...re Will Be Disabled In Ubuntu 16.04 LTS.md | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 sources/news/20160111 Ubuntu Spyware Will Be Disabled In Ubuntu 16.04 LTS.md diff --git a/sources/news/20160111 Ubuntu Spyware Will Be Disabled In Ubuntu 16.04 LTS.md b/sources/news/20160111 Ubuntu Spyware Will Be Disabled In Ubuntu 16.04 LTS.md new file mode 100644 index 0000000000..083ca3b595 --- /dev/null +++ b/sources/news/20160111 Ubuntu Spyware Will Be Disabled In Ubuntu 16.04 LTS.md @@ -0,0 +1,86 @@ +Ubuntu ‘Spyware’ Will Be Disabled In Ubuntu 16.04 LTS +================================================================================ +Controversial feature scaled back to help boost Ubuntu's privacy credentials + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2013/09/as2.jpg) + +**Unity’s controversial online search feature is being disabled by default in Ubuntu 16.04 LTS, due for release in April.** + +Search terms typed into the Unity 7 Dash search bar will **only show local file, folder and app results**. No search terms will be sent to Canonical or passed to third party results providers, as is currently the case. + +> ‘Unity online searches are now turned off by default.’ + +In currently supported versions of Ubuntu the Dash sends search queries the user enters to a remote web server run by Canonical, the company behind Ubuntu. + +No user-identifiable data is included with these queries, which are used to retrieve contextually relevant results from over 50 online services, including Wikipedia, YouTube and The Weather Channel. + +A switch to disable online search entirely is available in Ubuntu through the **Ubuntu System Settings > Privacy pane**. + +But some in the open-source community object to the feature being turned on by default. + +### Ubuntu Online Search Controversy ### + +> ‘Richard Stallman describes the feature as ‘spyware” + +Boiling over since 2012, the open-source community was quick to express concerns about user privacy in the wake of Ubuntu Amazon integration. Concerns continued with the rollout of the comprehensive ‘Smart Scopes Service’ a year later. + +The furore was so big it led free software stalwart [Richard Stallman to call Ubuntu ‘spyware’][1]. + +[The Electronic Frontier Foundation][2] also shared its concerns in a series of blog posts and suggested that Canonical make the feature opt-in. Privacy International went further than most by awarding Ubuntu’s makers a ‘[Big Brother award][3]‘ for work on, quote: “invading personal privacy”. + +[Canonical][4] maintains that the data collected through Unity’s online search feature is anonymised and “not user-identifiable”. + +In [blog post from 2013 the company explains][5] that it “**make[s] users aware of what data will be collected and which third party services will be queried through a notice right in the Dash, and we only collect data that allows us to deliver a great search experience to Ubuntu users.**” + +### Ubuntu Gets Serious About Data Privacy ### + +Canonical disabled Amazon product results on fresh installs of Ubuntu 14.04 LTS and up (though results from other online sources and services continue to appear until the opt-out is chosen). + +For the next LTS, Ubuntu 16.04, Canonical curtails the contentious online searching feature entirely, right out of the box, just like the EFF asked them to do in 2012. + +“None of your search terms will leave your computer,” [Ubuntu desktop manager Will Cooke][6] explains, noting that the “finer control over what is searched and [the] more targeted results” that Unity 8 offers “cannot be added into Unity 7.” + +It’s for this reason that “the online search features [of Unity 7] will be retired.” + +The change will also lower the support and infrastructure burden of Unity 7. With fewer Unity search results to handle Canonical can redirect time and engineering effort to more exciting avenues, like the promising Unity 8 desktop. + +### You Will Need to Opt-In To Get Online Results ### + +![Privacy settings in Ubuntu let you opt in to seeing online results](http://www.omgubuntu.co.uk/wp-content/uploads/2013/04/privacy.jpg) + +Privacy settings in Ubuntu let you opt in to seeing online results + +The decision to disable the online search element of the Ubuntu desktop will be greeted with considerable cheer by many in the open-source and free software communities. + +But not everyone is antagonised by the semantic search skills being served up in the Dash. + +If you think you’ll miss the efficiency of searching and previewing weather, news and other content through the Dash, **you can re-enable online search results** in a couple of clicks. Just head to Ubuntu **System Settings > Privacy > Search** and set the slider to ‘**On**‘. + +Flicking this won’t automatically bring back Amazon product results. The ‘shopping lens’ is decoupled from the opt-in toggle. You’ll need to okay a second opt-in to see product results from Amazon (and Skimlinks). + +### Summary ### + +- Ubuntu 16.04 LTS will no longer search online sources in the Dash by default +- Online results can be turned back on manually using a toggle +- A second opt-in allows Amazon product results +- The change only affects new installs. In-place upgrades will retain user preferences + +Do you agree with this decision? Or is Canonical about to reduce the experience of Ubuntu for new users? Let us know in the comments. + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2016/01/ubuntu-online-search-feature-disabled-16-04 + +作者:[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://arstechnica.com/information-technology/2012/12/richard-stallman-calls-ubuntu-spyware-because-it-tracks-searches/?utm_source=omgubuntu +[2]:https://www.eff.org/deeplinks/2012/10/privacy-ubuntu-1210-amazon-ads-and-data-leaks?utm_source=omgubuntu +[3]:http://www.omgubuntu.co.uk/2013/10/ubuntu-wins-big-brother-austria-privacy-award +[4]:http://blog.canonical.com/2012/12/07/searching-in-the-dash-in-ubuntu-13-04/ +[5]:http://blog.canonical.com/2012/12/07/searching-in-the-dash-in-ubuntu-13-04/?utm_source=omgubuntu +[6]:http://www.whizzy.org/2015/12/online-searches-in-the-dash-to-be-off-by-default?utm_source=omgubuntu From 9c3d1b6cd20ec3d5ccc442c8b9ae1124b50e379d Mon Sep 17 00:00:00 2001 From: DeadFire Date: Mon, 11 Jan 2016 17:08:05 +0800 Subject: [PATCH 0189/1469] =?UTF-8?q?20160111-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... DJ Software Mixxx Version 2.0 Released.md | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 sources/share/20160111 Open Source DJ Software Mixxx Version 2.0 Released.md diff --git a/sources/share/20160111 Open Source DJ Software Mixxx Version 2.0 Released.md b/sources/share/20160111 Open Source DJ Software Mixxx Version 2.0 Released.md new file mode 100644 index 0000000000..87522476a7 --- /dev/null +++ b/sources/share/20160111 Open Source DJ Software Mixxx Version 2.0 Released.md @@ -0,0 +1,69 @@ +Open Source DJ Software Mixxx Version 2.0 Released +================================================================================ +![](http://itsfoss.com/wp-content/uploads/2016/01/DJ-Software-Mixxx-2-Released.jpg) + +After three years, Open Source DJ mixing software [Mixxx][1] sees a major release in the form of Mixxx version 2.0. + +Mixxx is a cross-platform, free and open source DJ mixing software that provides almost all the features you would need for creating your own mixes. Used by professionals and amateurs alike, Mixxx has been a hot favorite for several years. + +In Mixxx you can use your iTunes library. Its powerful mixing engine supports a number of file format. Over 85 MIDI DJ controllers are supported out-of-the-box along with several HID controllers. There is an Auto DJ option as well to give you a break from mixing. + +Complete features of Mixxx can be found [here][2]. But before that, let’s see what is new in the latest release. + +### What’s new in Mixxx 2.0 ### + +- Dynamic, Resizable Skins +- 4 Decks with Master Sync +- Built-in Effects +- Harmonic Mixing with Musical Key Detection +- RGB Waveforms +- Four Microphones, Four AUX Inputs, Microphone Ducking +- Vinyl Passthrough +- Cover Art Support +- Core Mixing Engine Improvements +- Upgraded Library +- Improved, Expanded Support for DJ Controllers + +You can find the new features of Mixxx 2.0 in details [here][3]. + +### Install Mixxx 2.0 in Ubuntu based Linux distributions ### + +Mixxx provides its own PPA too easily install Mixxx in Ubuntu based Linux distributions such as Linux Mint, elementary OS, Zorin OS etc. The PPA is valid for Ubuntu 12.04, 14.04 and 15.10. + +Open a terminal and use the following commands: + + sudo add-apt-repository ppa:mixxx/mixxx + sudo apt-get update + sudo apt-get install mixxx + +To uninstall Mixxx, use the following commands: + + sudo apt-get remove mixxx + sudo add-apt-repository --remove ppa:mixxx/mixxx + +If you are already using an older version of Mixxx, it will be upgraded soon. + +For other Linux distributions, you can install Mixxx from the source code. You can download Mixxx 2.0 source code from the link below: + +- [Get Mixxx 2.0 Source Code][4] + +Since Mixxx is a cross platform application, you can download it for Windows and Mac OS X as well. You can visit the Mixxx download page to get the installer for other platforms. + +- [Download Mixxx 2.0][5] + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/dj-mixxx-2/ + +作者:[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://mixxx.org/ +[2]:http://mixxx.org/features/ +[3]:http://mixxx.org/whats-new-in-mixxx-2-0/ +[4]:http://downloads.mixxx.org/mixxx-2.0.0/mixxx-2.0.0-src.tar.gz +[5]:http://mixxx.org/download/ From 2fbb87c7086cac08f4b7740fb745a9fb95ced7bc Mon Sep 17 00:00:00 2001 From: carolinewuyan <309866211@qq.com> Date: Mon, 11 Jan 2016 17:18:49 +0800 Subject: [PATCH 0190/1469] =?UTF-8?q?=E6=A0=A1=E5=AF=B9=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...80 Linux Monitoring Tools for SysAdmins.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/translated/share/20151030 80 Linux Monitoring Tools for SysAdmins.md b/translated/share/20151030 80 Linux Monitoring Tools for SysAdmins.md index 7c16ca9fc8..25fdc1df44 100644 --- a/translated/share/20151030 80 Linux Monitoring Tools for SysAdmins.md +++ b/translated/share/20151030 80 Linux Monitoring Tools for SysAdmins.md @@ -1,12 +1,12 @@ -为 Linux 系统管理员准备的80个监控工具 +Linux 系统管理员必备的80个监控工具 ================================================================================ ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/linux-monitoring.jpg) -随着行业的不断发展,有许多比你想象中更棒的工具。这里列着网上最全的(工具)。拥有超过80种方式来管理你的机器。在本文中,我们主要讲述以下方面: +随着行业的不断发展,各种工具多得不可胜数。这里列出网上最全的(工具)。拥有超过80种方式来管理你的机器。在本文中,我们主要讲述以下方面: - 命令行工具 -- 与网络相关的 +- 网络相关内容 - 系统相关的监控工具 - 日志监控工具 - 基础设施监控工具 @@ -19,7 +19,7 @@ ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/top.jpg) -这是一个被预安装在许多 UNIX 系统中的小工具。当你想要查看在系统中运行的进程或线程时:top 是一个很好的工具。你可以对这些进程以不同的标准进行排序,默认是以 CPU 进行排序的。 +这是一个被预装在许多 UNIX 系统中的小工具。当你想要查看在系统中运行的进程或线程时:top 是一个很好的工具。你可以对这些进程以不同的标准进行排序,默认是以 CPU 进行排序的。 #### 2. [htop][1] #### @@ -33,7 +33,7 @@ Atop 和 top,htop 非常相似,它也能监控所有进程,但不同于 to #### 4. [apachetop][3] #### -Apachetop 会监视 apache 网络服务器的整体性能。它主要是基于 mytop。它会显示当前 reads, writes 的数量以及 requests 进程的总数。 +Apachetop 会监控 apache 网络服务器的整体性能。它主要是基于 mytop。它会显示当前 reads, writes 的数量以及 requests 进程的总数。 #### 5. [ftptop][4] #### @@ -43,7 +43,7 @@ ftptop 给你提供了当前所有连接到 ftp 服务器的基本信息,如 ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/mytop.jpg) -mytop 是一个很方便的工具,用于监控线程和 mysql 的性能。它给了你一个实时的数据库查询处理结果。 +mytop 是一个很简洁的工具,用于监控线程和 mysql 的性能。它给了你一个实时的数据库来查询处理结果。 #### 7. [powertop][6] #### @@ -69,19 +69,19 @@ ntopng 是 ntop 的升级版,它提供了一个能使用浏览器进行网络 ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/iftop.jpg) -iftop 类似于 top,但它主要不是检查 cpu 的使用率而是监听网卡的流量,并以表格的形式显示当前的使用量。像“为什么我的网速这么慢呢?!”这样的问题它可以直接回答。 +iftop 类似于 top,但它主要不是检查 cpu 的使用率而是监听所选择网络接口的流量,并以表格的形式显示当前的使用量。像“为什么我的网速这么慢呢?!”这样的问题它可以直接回答。 #### 11. [jnettop][10] #### ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/jnettop.jpg) -jnettop 以相同的方式来监测网络流量但比 iftop 更形象。它还支持自定义的文本输出并能以友好的交互方式来快速分析日志。 +jnettop 以相同的方式来监测网络流量但比 iftop 更形象。它还支持自定义的文本输出并能以友好的交互方式来深度分析日志。 #### 12. [bandwidthd][11] #### ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/bandwidthd.jpg) -bandwidthd 可以跟踪 TCP/IP 网络子网的使用情况并能在浏览器中通过 png 图片形象化的构建一个 HTML 页面。它有一个数据库驱动系统,支持搜索,过滤,多传感器和自定义报表。 +bandwidthd 可以跟踪 TCP/IP 网络子网的使用情况并能在浏览器中通过 png 图片形象化地构建一个 HTML 页面。它有一个数据库驱动系统,支持搜索、过滤,多传感器和自定义报表。 #### 13. [EtherApe][12] #### @@ -103,7 +103,7 @@ NetHogs 打破了网络流量按协议或子网进行统计的原理。它以进 ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/iptraf.jpg) -iptraf 收集的各种指标,如 TCP 连接数据包和字节数,接口界面和活动指标,TCP/UDP 通信故障,站内数据包和字节数。 +iptraf 收集的各种指标,如 TCP 连接数据包和字节数,端口统计和活动指标,TCP/UDP 通信故障,站内数据包和字节数。 #### 17. [ngrep][16] #### From 5eda19dcf6f443a75257adeda34ce2e8f0ecf974 Mon Sep 17 00:00:00 2001 From: alim0x Date: Mon, 11 Jan 2016 17:37:28 +0800 Subject: [PATCH 0191/1469] mv file to the proper place --- ...eful Linux and Unix Tape Managements Commands For Sysadmins.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20151130 Useful Linux and Unix Tape Managements Commands For Sysadmins.md (100%) diff --git a/sources/tech/20151130 Useful Linux and Unix Tape Managements Commands For Sysadmins.md b/translated/tech/20151130 Useful Linux and Unix Tape Managements Commands For Sysadmins.md similarity index 100% rename from sources/tech/20151130 Useful Linux and Unix Tape Managements Commands For Sysadmins.md rename to translated/tech/20151130 Useful Linux and Unix Tape Managements Commands For Sysadmins.md From 910adb31eaf6da813dd2c9b2bafc8c2e4e2a3d8f Mon Sep 17 00:00:00 2001 From: name1e5s <836401406@qq.com> Date: Tue, 12 Jan 2016 05:19:44 +0800 Subject: [PATCH 0192/1469] [translated] 20150818 A Linux User Using Windows 10 After More than 8 Years--See Comparison --- ...After More than 8 Years--See Comparison.md | 346 ------------------ ...After More than 8 Years--See Comparison.md | 344 +++++++++++++++++ 2 files changed, 344 insertions(+), 346 deletions(-) delete mode 100644 sources/talk/20150818 A Linux User Using Windows 10 After More than 8 Years--See Comparison.md create mode 100644 translated/talk/20150818 A Linux User Using Windows 10 After More than 8 Years--See Comparison.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 deleted file mode 100644 index 21a6fc9ca2..0000000000 --- a/sources/talk/20150818 A Linux User Using Windows 10 After More than 8 Years--See Comparison.md +++ /dev/null @@ -1,346 +0,0 @@ -#name1e5s translating - -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 diff --git a/translated/talk/20150818 A Linux User Using Windows 10 After More than 8 Years--See Comparison.md b/translated/talk/20150818 A Linux User Using Windows 10 After More than 8 Years--See Comparison.md new file mode 100644 index 0000000000..6f821f777d --- /dev/null +++ b/translated/talk/20150818 A Linux User Using Windows 10 After More than 8 Years--See Comparison.md @@ -0,0 +1,344 @@ +对比Windows 10与Linux:Linux用户已经使用'Windows 10'超过8年 +============================================================================================================================================================== +Windows 10 是2015年7月29日上市的最新一代Windows NT系列系统,Windows 8.1 的继任者.Windows 10 支持Intel 32位平台,AMD64以及ARM v7处理器. + +![Windows 10 and Linux Comparison](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-10-vs-Linux.jpg) + +对比:Windows 10与Linux + +作为一个连续使用linux超过8年的用户,我想要去测试Windows 10 ,因为它最近制造了很多新闻.这篇文章是我观察力的一个重大突破.我将从一个linux用户的角度去看待一切,所以这篇文章可能会有些偏向于linux.尽管如此,本文也应该不会有任何错误信息. + +1. 用谷歌搜索"download Windows 10" 并且点击第一个链接. + +![Search Windows 10](http://www.tecmint.com/wp-content/uploads/2015/08/Search-Windows-10.jpg) + +搜索Windows 10 + +你也可以直接打开: [https://www.microsoft.com/en_us/software-download/Windows10[1] + +2. 微软要求我从Windows 10, Windows 10 KN, Windows 10 N 和Windows 10 单语言版中选择一个版本 + +![Select Windows 10 Edition](http://www.tecmint.com/wp-content/uploads/2015/08/Select-Windows-10-Edition.jpg) + +选择版本 + +以下是各个版本的简略信息: + +- Windows 10 - 包含微软提供给我们的所有软件 +- Windows 10N - 此版本不包含媒体播放器 +- Windows 10KN - 此版本没有媒体播放能力 +- Windows 10单语言版 - 仅预装一种语言 + +3. 我选择了第一个选项 " Windows 10"并且单击"确认".之后我要选择语言,我选择了"英语" + +微软给我提供了两个下载链接.一个是32位版,另一个是64位版.我单击了64位版--这与我的电脑架构相同. + +![Download Windows 10](http://www.tecmint.com/wp-content/uploads/2015/08/Download-Windows-10.jpg) + +下载Windows 10 + +我的带宽是15M的,下载了整整3个小时.不幸的是微软没有提供系统的种子文件,否则整个过程会更加舒畅.镜像大小为 3.8 GB(译者注:就我的10M小水管,我使用迅雷下载用时50分钟). + +我找不到更小的镜像,微软并没有为Windows提供网络安装镜像.我也没有办法在下载完成后去校验哈希值. + +我十分惊讶,Windows在这样的问题上居然如此漫不经心.为了验证这个镜像是否正确下载,我需要把它刻到光盘上或者复制到我的U盘上然后启动它,一直静静的看着它安装直到安装完成. + +首先,我用dd命令将win10的iso镜像刻录到U盘上 + + # dd if=/home/avi/Downloads/Win10_English_x64.iso of=/dev/sdb1 bs=512M; sync + +这需要一点时间.在此之后我重启系统并在UEFI(BIOS)设置中选择从我的U盘启动. + +#### 系统要求 #### + +升级 + +- 仅支持从Windows 7 SP1或者Windows 8.1升级 + +重新安装 + +- 处理器: 1GHz 以上 +- 内存: 1GB以上(32位),2GB以上(64位) +- 硬盘: 16GB以上(32位),20GB以上(64位) +- 显卡: 支持DirectX 9或更新 + WDDM 1.0 驱动 + +###Windows 10 安装过程### + +1. Windows 10启动成功了.他们又换了logo,但是仍然没有信息提示我它正在做什么. + +![Windows 10 Logo](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-10-Logo.jpg) + +Windows 10 Logo + +2. 选择安装语言,时区,键盘,输入法,点击下一步 + +![Select Language and Time](http://www.tecmint.com/wp-content/uploads/2015/08/Select-Language-and-Time.jpg) + +选择语言和时区 + +3. 点击'现在安装' + +![Install Windows 10](http://www.tecmint.com/wp-content/uploads/2015/08/Install-Windows-10.jpg) + +安装Windows 10 + +4. 下一步是输入密钥,我点击了跳过 + +![Windows 10 Product Key](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-10-Product-Key.jpg) + +Windows 10 产品密钥 + +5. 从列表中选择一个系统版本.我选择了Windows 10专业版 + +![Select Install Operating System](http://www.tecmint.com/wp-content/uploads/2015/08/Select-Install-Operating-System.jpg) + +选择系统版本 + +6. 到了协议部分,选中"我接受"然后点击下一步 + +![Accept License](http://www.tecmint.com/wp-content/uploads/2015/08/Accept-License.jpg) + +同意协议 + +7. 下一步是选择(从Windows的老版本)升级到Windows 10或者安装Windows.我搞不懂为什么微软要让我自己选择:"安装Windows"被微软建议为"高级"选项.但是我还是选择了"安装Windows". + +![Select Installation Type](http://www.tecmint.com/wp-content/uploads/2015/08/Select-Installation-Type.jpg) + +选择安装类型 + +8. 选择驱动器,点击"下一步" + +![Select Install Drive](http://www.tecmint.com/wp-content/uploads/2015/08/Select-Install-Drive.jpg) + +选择安装盘 + +9. 安装程序开始复制文件,准备文件,安装更新,之后进行收尾.(如果安装程序能在安装时输出一堆字符来表示他在做什么就更好了) + +![Installing Windows](http://www.tecmint.com/wp-content/uploads/2015/08/Installing-Windows.jpg) + +安装 Windows + +10. 在此之后Windows重启了.他们说为了继续,我们需要重启 + +![Windows Installation Process](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-Installation-Process.jpg) + +安装进程 + +11. 我看到了一个写着"正在准备Windows"的界面.它停了整整五分多钟,仍然没有说明它正在做什么.没有输出. + +![Windows Getting Ready](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-Getting-Ready.jpg) + +正在准备Windows + +12. 又到了输入产品密钥的时间.我点击了"以后再说",并使用快速设置 + +![Enter Product Key](http://www.tecmint.com/wp-content/uploads/2015/08/Enter-Product-Key.jpg) + +输入产品密钥 + +![Select Express Settings](http://www.tecmint.com/wp-content/uploads/2015/08/Select-Express-Settings.jpg) + +使用快速设置 + + +13. 又出现了三个界面,作为Linux用户我认为此处应有信息来告诉我安装程序在做什么,但是我想多了 +![Loading Windows](http://www.tecmint.com/wp-content/uploads/2015/08/Loading-Windows.jpg) + +载入 Windows + +![Getting Updates](http://www.tecmint.com/wp-content/uploads/2015/08/Getting-Updates.jpg) + +获取更新 + +![Still Loading Windows](http://www.tecmint.com/wp-content/uploads/2015/08/Still-Loading-Windows.jpg) + +还是载入 Windows + +14. 安装程序想要知道谁拥有这台机器,"我的组织"或者我自己 + +![Select Organization](http://www.tecmint.com/wp-content/uploads/2015/08/Select-Organization.jpg) + +选择组织 + +15. 安装程序提示我加入"Aruze Ad"或者"加入域".在单击继续之前,我选择了后者. + +![Connect Windows](http://www.tecmint.com/wp-content/uploads/2015/08/Connect-Windows.jpg) + +连接网络 + +16. 安装程序让我新建一个账户.所以我输入了 "user_name"并点击下一步,我觉得我会收到一个要求我必须输入密码的信息. + +![Create Account](http://www.tecmint.com/wp-content/uploads/2015/08/Create-Account.jpg) + +新建账户 + +17. 让我惊讶的是Windows甚至都没有警告/发现我必须创建密码.真粗心.不管怎样,现在我可以体验系统了. + +![Windows 10 Desktop](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-10-Desktop.jpg) + +Windows 10的桌面环境 + +#### Linux用户(我)直到现在的体验 #### + +- 没有网络安装镜像 +- 镜像文件太臃肿了 +- 没有验证iso是否为正确的方法(官方没有提供哈希值) +- 启动与安装方式仍然与XP,Win 7,Win 8相同(可能吧...) +- 和以前一样,安装程序没有输出他正在干什么 - 正在复制什么和正在安装什么软件包 +- 安装程序比Linux发行版的更加直白和简单 + +####测试 Windows#### + +18. 默认桌面很干净,上面只有一个回收站图标.我们可以直接从桌面搜索网络.底部的快捷方式分别是任务预览,网络,微软应用商店.和以前的版本一样,消息栏在右下角. + +![ ](http://www.tecmint.com/wp-content/uploads/2015/08/Deskop-Shortcut-icons.jpg) + +桌面图标 + +19. IE浏览器被换成了Edge浏览器.微软把他们的老IE换成了Edge(斯巴达计划) + +![Microsoft Edge Browser](http://www.tecmint.com/wp-content/uploads/2015/08/Edge-browser.jpg) + +Edge浏览器 + +这个浏览器至少比IE要快.他们有相同的用户界面.它的主页包含新的更新.它还有一个标题是"下一步怎么走".由于它全面的性能提升,它的加载速度非常快.Edge的内存占用看起来一般般. + +![Windows Performance](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-Performance.jpg) + +性能 + +Edge也有小娜加成 -- 智能个人助理.支持笔记(在浏览网页时记笔记),分享(在本TAB分享而不必打开其他TAB) + +#### Linux用户(我)此时体验 #### + +20. 微软确实提升了网页浏览体验.我们要看的就是他的稳定性和质量.现在它并不落后. + +21. 对我来说,Edge的内存占用不算太大.但是有很多用户抱怨他的内存占用. + +22. 很难说目前Edge已经准备好了与火狐或Chrome竞争.让我们静观其变. + +#### 更多的视觉体验 #### + +23. 重新设计的开始菜单 -- 看起来很简洁高效.Merto磁贴大部分都会动.预先放置了最通用的应用. + +![Windows Look and Feel](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-Look.jpg) + +Windows + +在Linux的Gnome桌面环境下.我仅仅需要按下Win键并输入应用名就可以搜索应用. + +![Search Within Desktop](http://www.tecmint.com/wp-content/uploads/2015/08/Search-Within-Desktop.jpg) + +桌面内进行搜索 + +24. 文件浏览器 -- 设计的很简洁.左边是进入文件夹的快捷方式. + +![Windows File Explorer](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-File-Explorer.jpg) + +Windows资源管理器 + +我们的Gnome下的文件管理也同样的简洁高效. + +![File Browser on Gnome](http://www.tecmint.com/wp-content/uploads/2015/08/File-Browser.jpg) + +Gnome 的文件管理 + +25. 设置 -- 尽管Windows 10的设置有点精炼,但是我们还是可以把它与linux的设置进行对比. + +**Windows 的设置** + +![Windows 10 Settings](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-10-Settings.jpg) + +Windows 10 设置 + +**Linux Gnome 上的设置** + +![Gnome Settings](http://www.tecmint.com/wp-content/uploads/2015/08/Gnome-Settings.jpg) + +Gnome 的设置 + +26. 应用列表 -- 目前,Linux上的应用列表比之前的版本要好一些 + +**Windows 的应用列表** + +![Application List on Windows 10](http://www.tecmint.com/wp-content/uploads/2015/08/Application-List-on-Windows-10.jpg) + +Windows 10 的应用列表 + +**Gnome3 的应用列表** + +![Gnome Application List on Linux](http://www.tecmint.com/wp-content/uploads/2015/08/Gnome-Application-List-on-Linux.jpg) + +Gnome3 的应用列表 + +27. 虚拟桌面 -- Windows 10 上的虚拟桌面是近来被提及最多的特性之一 + +这是Windows 10 上的虚拟桌面. + +![Windows Virtual Desktop](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-Virtual-Desktop.jpg) + +Windows的虚拟桌面 + +这是我们Linux用户使用了超过20年的虚拟桌面. + +![Virtual Desktop on Linux](http://www.tecmint.com/wp-content/uploads/2015/08/Virtual-Desktop-on-Linux.jpg) + +Linux的虚拟桌面 + +#### Windows 10 的其他新特性 #### + +28. Windows 10 自带wifi感知.它会把你的wifi密码分享给他人.任何在你wifi范围内并且曾经通过Skype, Outlook, Hotmail 或 Facebook与你联系的人都能够获得你的网络接入权.这个特性的本意是让用户可以省时省力的连接网络. + +在微软对于 Tecmint 的问题的回答中,他们说道 -- 用户需要在每次到一个新的网络环境时自己去同意打开wifi感知.如果我们考虑到网络安全这将是很不安全的一件事.微软的说法并没有说服我. + +29. 从Windows 7 和 Windows 8.1升级可以省下买新版的花费.(家庭版$119 专业版$199 ) + +30. 微软发布了第一个累积更新,这个更新在一小部分设备上会让系统一直重启.Windows可能不知道这个问题或者不知道它发生的原因. + +31. 微软内建的禁用/隐藏我不想要的更新的功能在我这不起作用.这意味着一旦更新开始推送,你没有方法去禁用/隐藏他们.对不住啦,Windows 用户. + +#### Windows 10 包含的来源于Linux的功能 #### + +Windows 10有很多直接取自Linux的功能.如果Linux不已GPL发布的话,以下下这些功能永远不会出现在Windows上. + +32. 包管理器 -- 是的,你没有听错!Windows 10内建了一个包管理器.它只在Power Shell下工作.OneGet是Windows的官方包管理器. + +![Windows 10 Package Manager](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-10-Package-Manager.jpg) + + Windows 10的包管理器 + +- 无国界的Windows +- 扁平化图标 +- 虚拟桌面 +- 离线/在线搜索一体化 +- 手机/桌面系统一体化 + +### 总体印象### + +- 响应速度提升 +- 动画很好看 +- 资源占用少 +- 电池续航提升 +- Edge浏览器坚如磐石 +- 支持树莓派 2 +- Windows 10好的原因是Windows 8/8.1没有达到公众预期并且坏的可以 +- 旧瓶装新酒:Windows 10基本上就是以前的那一套换上新的图标 + +测试后我对Windows 10的评价是:Windows 10 在视觉和感觉上做了一些更新(就如同Windows经常做的那样).我要为斯巴达计划,虚拟桌面,命令行包管理器,整合在线/离线搜索的搜索栏点赞.这确实是一个更新后的产品 ,但是认为Windows 10将是Linux的最后一个棺材钉的人错了. + +Linux走在Windows前面.它们的做事方法并不相同.在以后的一段时间里Windows不会站到Linux这一旁.Linux用户也不必去使用Windows 10. + +这就是我要说的.希望你喜欢本文.如果你们喜欢本篇文章我会再写一些你们喜欢读的有趣的文章.在下方留下你的有价值的评论. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/a-linux-user-using-Windows-10-after-more-than-8-years-see-comparison/ + +作者:[vishek Kumar][a] +译者:[name1e5s](https://github.com/name1e5s) +校对:[校对者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 From e90ae8c9e8a056935842727bb7e2bdb9510139be Mon Sep 17 00:00:00 2001 From: name1e5s <836401406@qq.com> Date: Tue, 12 Jan 2016 05:27:49 +0800 Subject: [PATCH 0193/1469] [translating] Ubuntu Spyware Will Be Disabled In Ubuntu 16.04 LTS --- ...60111 Ubuntu Spyware Will Be Disabled In Ubuntu 16.04 LTS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/news/20160111 Ubuntu Spyware Will Be Disabled In Ubuntu 16.04 LTS.md b/sources/news/20160111 Ubuntu Spyware Will Be Disabled In Ubuntu 16.04 LTS.md index 083ca3b595..c11a4ff04c 100644 --- a/sources/news/20160111 Ubuntu Spyware Will Be Disabled In Ubuntu 16.04 LTS.md +++ b/sources/news/20160111 Ubuntu Spyware Will Be Disabled In Ubuntu 16.04 LTS.md @@ -1,3 +1,5 @@ +#translating by name1e5s + Ubuntu ‘Spyware’ Will Be Disabled In Ubuntu 16.04 LTS ================================================================================ Controversial feature scaled back to help boost Ubuntu's privacy credentials From 812b43daf1b08dff738e044fa628f24ea42d16af Mon Sep 17 00:00:00 2001 From: "Fuliang.Li" Date: Mon, 11 Jan 2016 23:35:34 +0800 Subject: [PATCH 0194/1469] =?UTF-8?q?[=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= =?UTF-8?q?]=2020151208=206=20creative=20ways=20to=20use=20ownCloud?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【翻译完成】使用 ownCloud 的六个创意方法 --- ...0151208 6 creative ways to use ownCloud.md | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 translated/talk/yearbook2015/20151208 6 creative ways to use ownCloud.md diff --git a/translated/talk/yearbook2015/20151208 6 creative ways to use ownCloud.md b/translated/talk/yearbook2015/20151208 6 creative ways to use ownCloud.md new file mode 100644 index 0000000000..5d81ed9cdf --- /dev/null +++ b/translated/talk/yearbook2015/20151208 6 creative ways to use ownCloud.md @@ -0,0 +1,95 @@ +GHLandy Translated + +使用 ownCloud 的六个创意方法 +================================================================================ +![Yearbook cover 2015](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/osdc-open-source-yearbook-lead1-inc0335020sw-201511-01.png) + +图片来源:Opensource.com + +[ownCloud][1] 是一个自我托管且开源的文件同步和共享服务上。就像 "big boys" Dropbox、Google Drive、Box 和其他的同类服务一样,ownCloud 可以让你访问自己的文件、日历、联系人和其他数据。你可以在自己设备之间进行任意数据(包括它自身的一部分)同步以及给其他人分享文件。然而,ownCloud 并非只能运行在它自己的开发商之中,试试[将 ownCloud 运行在其他服务器上][2] + +现在,一起来看看在 ownCloud 上的六件创意事件。其中一些是由于 ownCloud 的开源才得以完成,而另外的则是 ownCloud 自身特有的功能。 + +### 1. 可扩展的 ownCloud 派集群 ### + +由于 ownCloud 是开源的,你可以选择将它运行在自己的服务器中,或者从你信任的服务器提供商那里获取空间——没必要将你的文件存储在大公司的服务器中,谁知他们将你的文件存储到哪里去。[点击此处查看部分 ownCloud 服务商][3],或者下载该服务软件到你的虚拟主机中[搭建自己的服务器][4]. + +![](https://opensource.com/sites/default/files/images/life-uploads/banana-pi-owncloud-cluster.jpg) + +拍摄: Jörn Friedrich Dreyer. [CC BY-SA 4.0.][5] + +我们见过最具创意的事情就是组建 [香蕉派集群][6] 和 [树莓派集群][7]。ownCloud 的扩展性通常是成千上万的用户来完成的,这些人则将它往不同方向发展,通过大量的小型系统集群在一起,就可以创建出运行速度非常快的 ownCloud。酷毙了! + +### 2. 密码同步 ### + +为了让 ownCloud 更容易扩展,我们需要将它模块化,并拥有 [ownCloud app store][8]。然后你就可以在里边搜索音乐、视频播放器、日历、联系人、生产应用、游戏、应用框架等。 + +仅从 200 多个可用应用中挑选一个是一件非常困难的事,但密码管理则是一个很好的特性。ownCloud app store 里边至少有三款这种应用:[Passwords][9]、[Secure Container][10] 和 [Passman][11]。 + +![](https://opensource.com/sites/default/files/images/life-uploads/password.png) + +### 3. 随心所欲地存储文件 ### + +外部存储允许你通过接口将现有数据联系到 ownCloud,让你轻松访问存储在FTP、WebDAV、Amazon S3,甚至 Dropbox 和Google Drive。 + +注:youtube 视频 + + +DropBox 喜欢创建自己的 “围墙式花园”,只有注册用户之间才可以进行协作;假如你通过Google Drive 来分享文件,你的同伴也必须要有一个 Google 账号才可以访问的分享。通过 ownCloud 的外部存储功能,你可以轻松打破这些规则障碍。 + +最有创意的就是把 Google Drive 和 Dropbox 添加为外部存储。这样你就可以无缝的使用它们,并使用不需要账户地链接把文件分享给和你协作的人。 + +### 4. 下载以上传的文件 ### + +由于 ownCloud 的开源,人们可以不受公司需求限制地向它共享代码,增加新特性。共献者关注的往往是安全和隐私,所以 ownCloud 引入的特性常常比别人的要早,比如通过密码保护的公共链接和[设置失效期限][12]。 + +现在,ownCloud 可以配置分享链接的读写权限了,这就是说链接的访问者可以无缝的编辑你分享给他们的文件(不管是否有密码保护),或者在不提供他们的私人数据来登录其他服务的情况下将文件上传到服务器。 + +注:youtube 视频 + + +对于有人想给你分享大体积的文件时,这个特性就非常有用了。相比于上传到第三方站点、然后给你发送一个连接、你再去下载文件(通常需要登录),ownCloud 仅需要上传文件到你提供的分享文件夹、你就可以买上获取到文件了。 + +### 5. 免费却又安全的存储空间 ### + +之前就强调过,我们的代码贡献者最关注的就是安全和隐私,这就是 ownCloud 中有用于加密和解密存储数据的应用的原因。 + +通过使用 ownCloud 将你的文件存储到 Dropbox 或者 Google Drive,则会违背控制数据以及保持数据隐私的原则。但是加密应用则刚好可以满足安全及隐私问题。在发送数据给这些提供商前进行数据加密,并在取回数据的时候进行解密,你的数据就会变得很安全。 + +### 6. 在你的可控范围内分享文件 ### + +作为开源项目,ownCloud 没有必要自建 “围墙式花园”。进入联邦云共享:[developed and published by ownCloud][13] 协议使不同的文件同步和共享服务器可以彼此之间进行通信,并能够安全地传输文件。联邦云共享本身有一个有趣的故事:[22 所德国大学][14] 想要为自身的 500,000 学生建立一个庞大的云服务,但是每个大学都想控制自己学生数据。于是乎,我们需要一个可行性解决方案:也就是联邦云服务。该解决方案让让学生保持连接,使得他们可以无缝的协同工作。同时,每个大学的系统管理员保持着对自己学生创建的文件的控制权,如限制存储或者限制什么人、什么文件以及如何共享。 + +注:youtube 视频 + + +并且,这项令人崇敬的技术并没有限制于德国的大学之间,而是每个 ownCloud 用户都能在自己的用户设置中找到自己的 [联邦云 ID][15],并将之分享给同伴。 + +现在你明白了吧。仅六个方法,ownCloud 就能让人们完成特殊和特别的事。而是这一切成为可能的,就是 ownCloud 的开源 —— 设计用来释放你数据。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/15/12/6-creative-ways-use-owncloud + +作者:[Jos Poortvliet][a] +译者:[GHLandy](https://github.com/GHLandy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/jospoortvliet +[1]:https://owncloud.com/ +[2]:https://blogs.fsfe.org/mk/new-stickers-and-leaflets-no-cloud-and-e-mail-self-defense/ +[3]:https://owncloud.org/providers +[4]:https://owncloud.org/install/#instructions-server +[5]:https://creativecommons.org/licenses/by-sa/4.0/ +[6]:http://www.owncluster.de/ +[7]:https://christopherjcoleman.wordpress.com/2013/01/05/host-your-owncloud-on-a-raspberry-pi-cluster/ +[8]:https://apps.owncloud.com/ +[9]:https://apps.owncloud.com/content/show.php/Passwords?content=170480 +[10]:https://apps.owncloud.com/content/show.php/Secure+Container?content=167268 +[11]:https://apps.owncloud.com/content/show.php/Passman?content=166285 +[12]:https://owncloud.com/owncloud45-community/ +[13]:http://karlitschek.de/2015/08/announcing-the-draft-federated-cloud-sharing-api/ +[14]:https://owncloud.com/customer/sciebo/ +[15]:https://owncloud.org/federation/ From bd58213f19fde26d63555e89da187ed54204cb0b Mon Sep 17 00:00:00 2001 From: "Fuliang.Li" Date: Mon, 11 Jan 2016 23:36:25 +0800 Subject: [PATCH 0195/1469] Delete 20151208 6 creative ways to use ownCloud.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 完成译文,并放在相应位置。 --- ...0151208 6 creative ways to use ownCloud.md | 96 ------------------- 1 file changed, 96 deletions(-) delete mode 100644 sources/talk/yearbook2015/20151208 6 creative ways to use ownCloud.md diff --git a/sources/talk/yearbook2015/20151208 6 creative ways to use ownCloud.md b/sources/talk/yearbook2015/20151208 6 creative ways to use ownCloud.md deleted file mode 100644 index dd099648a7..0000000000 --- a/sources/talk/yearbook2015/20151208 6 creative ways to use ownCloud.md +++ /dev/null @@ -1,96 +0,0 @@ -GHLandy Translating - -6 creative ways to use ownCloud -================================================================================ -![Yearbook cover 2015](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/osdc-open-source-yearbook-lead1-inc0335020sw-201511-01.png) - -Image by : Opensource.com - -[ownCloud][1] is a self-hosted open source file sync and share server. Like "big boys" Dropbox, Google Drive, Box, and others, ownCloud lets you access your files, calendar, contacts, and other data. You can synchronize everything (or part of it) between your devices and share files with others. But ownCloud can do much more than its proprietary, [hosted-on-somebody-else's-computer competitors][2]. - -Let's look at six creative things ownCloud can do. Some of these are possible because ownCloud is open source, whereas others are just unique features it offers. - -### 1. A scalable ownCloud Pi cluster ### - -Because ownCloud is open source, you can choose between self-hosting on your own server or renting space from a provider you trust—no need to put your files at a big company that stores it who knows where. [Find some ownCloud providers here][3] or grab packages or a virtual machine for [your own server here][4]. - -![](https://opensource.com/sites/default/files/images/life-uploads/banana-pi-owncloud-cluster.jpg) - -Photo by Jörn Friedrich Dreyer. [CC BY-SA 4.0.][5] - -The most creative things we've seen are a [Banana Pi cluster][6] and a [Raspberry Pi cluster][7]. Although ownCloud's scalability is often used to deploy to hundreds of thousands of users, some folks out there take it in a different direction, bringing multiple tiny systems together to make a super-fast ownCloud. Kudos! - -### 2. Keep your passwords synced ### - -To make ownCloud easier to extend, we have made it extremely modular and have an [ownCloud app store][8]. There you can find things like music and video players, calendars, contacts, productivity apps, games, a sketching app, and much more. - -Picking only one app from the almost 200 available is hard, but managing passwords is certainly a unique feature. There are no less than three apps providing this functionality: [Passwords][9], [Secure Container][10], and [Passman][11]. - -![](https://opensource.com/sites/default/files/images/life-uploads/password.png) - -### 3. Store your files where you want ### - -External storage allows you to hook your existing data storage into ownCloud, letting you to access files stored on FTP, WebDAV, Amazon S3, and even Dropbox and Google Drive through one interface. - -注:youtube 视频 - - -The "big boys" like to create their own little walled gardens—Box user can only collaborate with other Box users; and if you want to share your files from Google Drive, your mate needs a Google account or they can't do much. With ownCloud's external storage, you can break these barriers. - -A very creative solution is adding Google Drive and Dropbox as external storage. You can work with files on both seamlessly and share them with others through a simple link—no account needed to work with you! - -### 4. Get files uploaded ### - -Because ownCloud is open source, people contribute interesting features without being limited by corporate requirements. Our contributors have always cared about security and privacy, so ownCloud introduced features such as protecting a public link with a password and setting an expire date [years before anybody else did][12]. - -Today, ownCloud has the ability to configure a shared link as read-write, which means visitors can seamlessly edit the files you share with them (protected with a password or not) or upload new files to your server without being forced to sign up to another web service that wants their private data. - -注:youtube 视频 - - -This is great for when people want to share a large file with you. Rather than having to upload it to a third-party site, send you a link, and make you go there and download it (often requiring a login), they can just upload it to a shared folder you provide, and you can get to work right away. - -### 5. Get free secure storage ### - -We already talked about how many of our contributors care about security and privacy. That's why ownCloud has an app that can encrypt and decrypt stored data. - -Using ownCloud to store your files on Dropbox or Google Drive defeats the whole idea of retaking control of your data and keeping it private. The Encryption app changes that. By encrypting data before sending it to these providers and decrypting it upon retrieval, your data is safe as kittens. - -### 6. Share your files and stay in control ### - -As an open source project, ownCloud has no stake in building walled gardens. Enter Federated Cloud Sharing: a protocol [developed and published by ownCloud][13] that enables different file sync and share servers to talk to one another and exchange files securely. Federated Cloud Sharing has an interesting history. [Twenty-two German universities][14] decided to build a huge cloud for their 500,000 students. But as each university wanted to stay in control of the data of their own students, a creative solution was needed: Federated Cloud Sharing. The solution now connects all these universities so the students can seamlessly work together. At the same time, the system administrators at each university stay in control of the files their students have created and can apply policies, such as storage restrictions, or limitations on what, with whom, and how files can be shared. - -注:youtube 视频 - - -And this awesome technology isn't limited to German universities: Every ownCloud user can find their [Federated Cloud ID][15] in their user settings and share it with others. - -So there you have it. Six ways ownCloud enables people to do special and unique things, all made possible because it is open source and designed to help you liberate your data. - - --------------------------------------------------------------------------------- - -via: https://opensource.com/life/15/12/6-creative-ways-use-owncloud - -作者:[Jos Poortvliet][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/jospoortvliet -[1]:https://owncloud.com/ -[2]:https://blogs.fsfe.org/mk/new-stickers-and-leaflets-no-cloud-and-e-mail-self-defense/ -[3]:https://owncloud.org/providers -[4]:https://owncloud.org/install/#instructions-server -[5]:https://creativecommons.org/licenses/by-sa/4.0/ -[6]:http://www.owncluster.de/ -[7]:https://christopherjcoleman.wordpress.com/2013/01/05/host-your-owncloud-on-a-raspberry-pi-cluster/ -[8]:https://apps.owncloud.com/ -[9]:https://apps.owncloud.com/content/show.php/Passwords?content=170480 -[10]:https://apps.owncloud.com/content/show.php/Secure+Container?content=167268 -[11]:https://apps.owncloud.com/content/show.php/Passman?content=166285 -[12]:https://owncloud.com/owncloud45-community/ -[13]:http://karlitschek.de/2015/08/announcing-the-draft-federated-cloud-sharing-api/ -[14]:https://owncloud.com/customer/sciebo/ -[15]:https://owncloud.org/federation/ From 873ab1321daa82422f39c792ba06ea810cfc1632 Mon Sep 17 00:00:00 2001 From: Rubik Date: Tue, 12 Jan 2016 00:37:07 +0800 Subject: [PATCH 0196/1469] =?UTF-8?q?[=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= =?UTF-8?q?]Haohong=20WANG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...gn and Software Evolution--Step by Step.md | 65 +++++++++---------- 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/sources/talk/20151020 18 Years of GNOME Design and Software Evolution--Step by Step.md b/sources/talk/20151020 18 Years of GNOME Design and Software Evolution--Step by Step.md index ea43c7af47..614f10bb85 100644 --- a/sources/talk/20151020 18 Years of GNOME Design and Software Evolution--Step by Step.md +++ b/sources/talk/20151020 18 Years of GNOME Design and Software Evolution--Step by Step.md @@ -1,19 +1,18 @@ -HaohongWANG Translating -18 Years of GNOME Design and Software Evolution: Step by Step +一步一脚印:GNOME十八年进化史 ================================================================================ 注:youtube 视频 -[GNOME][1] (GNU Object Model Environment) was started on August 15th 1997 by two Mexican programmers – Miguel de Icaza and Federico Mena. GNOME – Free Software project to develop a desktop environment and applications by volunteers and paid full-time developers. All of GNOME Desktop Environment is the open source software and support Linux, FreeBSD, OpenBSD and others. +[GNOME][1] (GNU Object Model Environment)由两位墨西哥的程序员Miguel de Icaza和Federico Mena 始创于1997年8月15日。GNOME自由软件的桌面环境和应用程序计划由志愿者和全职开发者来开发。所有的GNOME桌面环境都由开源软件组成,并且支持Linux, FreeBSD, OpenBSD 等操作系统。 -Now we move to 1997 and see the first version of GNOME: +现在就让我穿越到1997年来看看GNOME的第一个版本: ### GNOME 1 ### ![GNOME 1.0 - First major GNOME release](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/1.0/gnome.png) -**GNOME 1.0** (1997) – First major GNOME release +**GNOME 1.0** (1997) – GNOME 发布的第一个版本 ![GNOME 1.2 Bongo](https://raw.githubusercontent.com/paulcarroty/Articles/master/GNOME_History/1.2/1361441938.or.86429.png) @@ -29,103 +28,103 @@ Now we move to 1997 and see the first version of GNOME: **GNOME 2.0**, 2002 -Major upgrade based on GTK+2. Introduction of the Human Interface Guidelines. +基于GTK+2的重大更新。引入了人机界面指南。 ![GNOME 2.2](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.2/GNOME_2.2_catala.png) **GNOME 2.2**, 2003 -Multimedia and file manager improvements. +改进了多媒体和文件管理器。 ![GNOME 2.4 Temujin](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.4/gnome-desktop.png) **GNOME 2.4** “Temujin”, 2003 -First release of Epiphany Browser, accessibility support. +首次发布Epiphany浏览器,增添了辅助功能。 ![GNOME 2.6](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.6/Adam_Hooper.png) **GNOME 2.6**, 2004 -Nautilus changes to a spatial file manager, and a new GTK+ file dialog is introduced. A short-lived fork of GNOME, GoneME, is created as a response to the changes in this version. +启用Nautilus空间文件管理工具同时引入了新的GTK+ (译注:跨平台图形用户界面工具包)对话框。这个转瞬即逝的版本变更被称做是GNOME的一个分支:GoneME。 ![GNOME 2.8](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.8/3.png) **GNOME 2.8**, 2004 -Improved removable device support, adds Evolution +改良了对可移动设备的支持并新增了Evolution邮件应用。 ![GNOME 2.10](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.10/GNOME-Screenshot-2.10-FC4.png) **GNOME 2.10**, 2005 -Lower memory requirements and performance improvements. Adds: new panel applets (modem control, drive mounter and trashcan); and the Totem and Sound Juicer applications. +减小内存需求,改进显示界面。增加网络控制、磁盘挂载和回收站组件以及Totem影片播放器和Sound Juicer CD抓取工具。 ![GNOME 2.12](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.12/gnome-livecd.jpg) **GNOME 2.12**, 2005 -Nautilus improvements; improvements in cut/paste between applications and freedesktop.org integration. Adds: Evince PDF viewer; New default theme: Clearlooks; menu editor; keyring manager and admin tools. Based on GTK+ 2.8 with cairo support +改进了Nautilus以及跨平台剪切/粘贴功能的整合。 新增Evince PDF阅读器;新预设主题Clearlooks;新增菜单编辑器、管理员工具与环状管理器。基于支持Cairo的GTK+2.8。 ![GNOME 2.14](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.14/debian4-stable.jpg) **GNOME 2.14**, 2006 -Performance improvements (over 100% in some cases); usability improvements in user preferences; GStreamer 0.10 multimedia framework. Adds: Ekiga video conferencing application; Deskbar search tool; Pessulus lockdown editor; Fast user switching; Sabayon system administration tool. +改善显示效果;增强易用性;基于GStreamer 0.10多媒体框架。增加了Ekiga视频会议应用,Deskbar搜索工具,Pessulus权限管理器,和Sabayon系统管理员工具和快速切换用户功能。 ![GNOME 2.16](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.16/Gnome-2.16-screenshot.png) **GNOME 2.16**, 2006 -Performance improvements. Adds: Tomboy notetaking application; Baobab disk usage analyser; Orca screen reader; GNOME Power Manager (improving laptop battery life); improvements to Totem, Nautilus; compositing support for Metacity; new icon theme. Based on GTK+ 2.10 with new print dialog +界面改良。增加了Tomboy笔记应用,Baobab磁盘用量分析应用,Orca屏幕朗读器以及GNOME 电源管理程序(以延长笔记本电池寿命);改进了Totem, Nautilus, 使用了新的图标主题。基于GTK+ 2.0 的全新显示对话框。 ![GNOME 2.18](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.18/Gnome-2.18.1.png) **GNOME 2.18**, 2007 -Performance improvements. Adds: Seahorse GPG security application, allowing encryption of emails and local files; Baobab disk usage analyser improved to support ring chart view; Orca screen reader; improvements to Evince, Epiphany and GNOME Power Manager, Volume control; two new games, GNOME Sudoku and glChess. MP3 and AAC audio encoding. +界面改良。增加了Seahorse GPG安全应用,可以对邮件和本地文件进行加密;Baobab增加了环状图表显示方式;改进了Orca,Evince, Epiphany, GNOME电源管理,音量控制;增加了两款新游戏:GNOME数独和国际象棋。支持MP3和AAC音频解码。 ![GNOME 2.20](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.20/rnintroduction-screenshot.png) **GNOME 2.20**, 2007 -Tenth anniversary release. Evolution backup functionality; improvements in Epiphany, EOG, GNOME Power Manager; password keyring management in Seahorse. Adds: PDF forms editing in Evince; integrated search in the file manager dialogs; automatic multimedia codec installer. +发布十周年版本。Evolution增加了备份功能;改进了Epiphany,EOG,GNOME电源管理以及Seahorse中的Keyring密码管理方式;在Evince中可以编辑PDF文档;文件管理界面中整合了搜索模块;自动安装多媒体解码器。 ![GNOME 2.22, 2008](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.22/GNOME-2-22-2-Released-2.png) **GNOME 2.22**, 2008 -Addition of Cheese, a tool for taking photos from webcams and Remote Desktop Viewer; basic window compositing support in Metacity; introduction of GVFS; improved playback support for DVDs and YouTube, MythTV support in Totem; internationalised clock applet; Google Calendar support and message tagging in Evolution; improvements in Evince, Tomboy, Sound Juicer and Calculator. +新增Cheese应用,它是一个可以截取网络摄像头和远程桌面图像的工具;Metacity支持基本的窗口叠加复合;引入GVFS(译注:GNOME Virtual file system,GNOME虚拟文件系统);改善了Totem播放DVD 和YouTube的效果,支持播放MythTV;在Evolution中新增了谷歌日历以及为信息添加标签的功能;改进了Evince, Tomboy, Sound Juicer和计算器。 ![GNOME 2.24](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.24/gnome-224.jpg) **GNOME 2.24**, 2008 -Addition of the Empathy instant messenger client, Ekiga 3.0, tabbed browsing in Nautilus, better multiple screens support and improved digital TV support. +新增了Empathy即时通讯软件,Ekiga升级至3.0版本;Nautilus支持标签式浏览,更好的支持了多屏幕显示方式和数字电视功能。 ![GNOME 2.26](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.26/gnome226-large_001.jpg) **GNOME 2.26**, 2009 -New optical disc recording application Brasero, simpler file sharing, media player improvements, support for multiple monitors and fingerprint reader support. +新增光盘刻录应用Brasero;简化了文件分享的流程,改进了媒体播放器的性能;支持多显示器和指纹识别器。 ![GNOME 2.28](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.28/1.png) **GNOME 2.28**, 2009 -Addition of GNOME Bluetooth module. Improvements to Epiphany web browser, Empathy instant messenger client, Time Tracker, and accessibility. Upgrade to GTK+ version 2.18. +增加了GNOME 蓝牙模块;改进了Epiphany ,Empathy,时间追踪器和辅助功能。GTK+升级至2.18版本。 ![GNOME 2.30](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.30/GNOME2.30.png) **GNOME 2.30**, 2010 -Improvements to Nautilus file manager, Empathy instant messenger client, Tomboy, Evince, Time Tracker, Epiphany, and Vinagre. iPod and iPod Touch devices are now partially supported via GVFS through libimobiledevice. Uses GTK+ 2.20. +改进了Nautilus,Empathy,Tomboy,Evince,Time Tracker,Epiphany和 Vinagre。借助基于libimobiledevice(译注:支持iOS®设备跨平台使用的工具协议库)的GVFS可以访问部分iPod 和iPod Touch。 ![GNOME 2.32](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.32/gnome-2-32.png.en_GB.png) **GNOME 2.32**, 2010 -Addition of Rygel and GNOME Color Manager. Improvements to Empathy instant messenger client, Evince, Nautilus file manager and others. 3.0 was intended to be released in September 2010, so a large part of the development effort since 2.30 went towards 3.0. +新增Rygel 媒体分享工具和GNOME色彩管理器;改进了Empathy即时通讯客户端,Evince,Nautilus文件管理器等。计划于2010年9月发布3.0版本,因此大部分开发者的精力都由2.3x转移至了3.0版本。 ### GNOME 3 ### @@ -133,57 +132,57 @@ Addition of Rygel and GNOME Color Manager. Improvements to Empathy instant messe **GNOME 3.0**, 2011 -Introduction of GNOME Shell. A redesigned settings framework with fewer, more focused options. Topic-oriented help based on the Mallard markup language. Side-by-side window tiling. A new visual theme and default font. Adoption of GTK+ 3.0 with its improved language bindings, themes, touch, and multiplatform support. Removal of long-deprecated development APIs.[73] +引入GNOME Shell,一个重新设计的、具有更简练更集中的选项的框架。基于Mallard标记语言的话题导向型帮助。支持窗口并列堆叠。启用新的视觉主题和字体。采用GTK+3.0,具有更好的语言绑定,主题,触控以及多平台支持。去除了长期弃用的API。 ![GNOME 3.2](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/3.2/gdm.png) **GNOME 3.2**, 2011 -Online accounts support; Web applications support; contacts manager; documents and files manager; quick preview of files in the File Manager; greater integration; better documentation; enhanced looks and various performance improvements. +支持在线帐户,Web应用;新增通讯录应用和文档文件管理器;文件管理器支持快速预览;整合性能,更新文档以及对外观的一些小改进。 ![GNOME 3.4](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/3.4/application-view.png) **GNOME 3.4**, 2012 -New Look for GNOME 3 Applications: Documents, Epiphany (now called Web), and GNOME Contacts. Search for documents from the Activities overview. Application menus support. Refreshed interface components: New color picker, redesigned scrollbars, easier to use spin buttons, and hideable title bars. Smooth scrolling support. New animated backgrounds. Improved system settings with new Wacom panel. Easier extensions management. Better hardware support. Topic-oriented documentation. Video calling and Live Messenger support in Empathy. Better accessibility: Improved Orca integration, better high contrast mode, and new zoom settings. Plus many other application enhancements and smaller details. +全新的GNOME 3 应用程序外观:文件,Epiphany(更名为Web),GNOME 通讯录。可以在Activities Overview中搜索本地文件。支持应用菜单。焕然一新的界面元素:崭新的颜色拾取器,重新设计的滚动条,更易使用的旋转按钮以及可隐藏的标题栏。支持视角平滑。全新的动态壁纸。在系统设置中增添了对Wacom数位板的支持。更简便的扩展应用管理。更好的硬件支持。面向主题的文档。在Empathy中提供了对视频电话和动态信息的支持。更好的辅助功能:提升Orca整合度,增强高对比度模式适配性,以及全新的缩放设置。大量应用和细节的改进。 ![GNOME 3.6](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/3.6/gnome-3-6.png) **GNOME 3.6**, 2012 -Refreshed Core components: New applications button and improved layout in the Activities Overview. A new login and lock screen. Redesigned Message Tray. Notifications are now smarter, more noticeable, easier to dismiss. Improved interface and settings for System Settings. The user menu now shows Power Off by default. Integrated Input Methods. Accessibility is always on. New applications: Boxes, that was introduced as a preview version in GNOME 3.4, and Clocks, an application to handle world times. Updated looks for Disk Usage Analyzer, Empathy and Font Viewer. Improved braille support in Orca. In Web, the previously blank start page was replaced by a grid that holds your most visited pages, plus better full screen mode and a beta of WebKit2. Evolution renders email using WebKit. Major improvements to Disks. Revamped Files application (also known as Nautilus), with new features like Recent files and search. +全新设计的核心元素:新的应用按钮和改进的Activities Overview布局。新的登陆锁定界面。重新设计的通知栏。通知现在更智能,可见性更高,同时更容易操作。改进了系统设置的界面和设定逻辑。用户菜单默认显示关机操作。整合了输入法。辅助功能一直开启。新的应用:Boxes虚拟机,在GNOME 3.4中发布了预览版。Clocks时钟, 可以显示世界时间。升级了磁盘用量分析,Empathy和 Font Viewer的外观。改进了Orca对布莱叶盲文的支持。 在Web浏览器中, 用最常访问页面取代了之前的空白起始页,增添了更好的全屏模式并使用了WebKit2测试版引擎. Evolution 开始使用WebKit提交邮件。 改进了磁盘功能。 改进了文件管理应用即之前的Nautilus, 新增诸如最近访问的文件和搜索等功能。 ![GNOME 3.8](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/3.8/applications-view.png) **GNOME 3.8**, 2013 -Refreshed Core components: A new applications view with frequently used and all apps. An overhauled window layout. New input methods OSD switcher. The Notifications & Messaging tray now react to the force with which the pointer is pressed against the screen edge. Added Classic mode for those who prefer a more traditional desktop experience. The GNOME Settings application features an updated toolbar design. New Initial Setup assistant. GNOME Online Accounts integrates with more services. Web has been upgraded to use the WebKit2 engine. Web has a new private browsing mode. Documents has gained a new dual page mode & Google Documents integration. Improved user interface of Contacts. GNOME Files, GNOME Boxes and GNOME Disks have received a number of improvements. Integration of ownCloud. New GNOME Core Applications: GNOME Clocks and GNOME Weather. +令人耳目一新的核心组件:新应用界面可以分别显示常用应用及全部应用,窗口布局得到全面改造。新的屏幕即现式输入法开关。通知和信息现在会对屏幕边缘的点击作出回应。为那些喜欢传统桌面的用户提供了经典模式。重新设计了设置界面的工具栏。新的初始化引导流程。GNOME 在线帐户添加了对更多供应商的支持。浏览器正式启用WebKit2引擎。文档支持双页模式并且整合了Google 文档。通讯录的UI升级。GNOME Files,GNOME Boxes和GNOME Disks都得到了大幅改进。两款全新的GNOME核心应用:GNOME时钟和GNOME天气。 ![GNOME 3.10](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/3.10/GNOME-3-10-Release-Schedule-2.png) **GNOME 3.10**, 2013 -A reworked system status area, which gives a more focused overview of the system. A collection of new applications, including GNOME Maps, GNOME Notes, GNOME Music and GNOME Photos. New geolocation features, such as automatic time zones and world clocks. HiDPI support[75] and smart card support. D-Bus activation made possible with GLib 2.38 +全新设计的系统状态界面,能够更直观的纵览全局。一系列新应用,包括GNOME Maps, GNOME Notes, GNOME Music 和GNOME Photos。新的基于位置的功能,如自动时区和世界时间。支持高分辨率及智能卡。 基于GLib 2.38提供了对D-Bus的支持。 ![GNOME 3.12](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/3.12/app-folders.png) **GNOME 3.12**, 2014 -Improved keyboard navigation and window selection in the Overview. Revamped first set-up utility based on usability tests. Wired networking re-added to the system status area. Customizable application folders in the Applications view. Introduction of new GTK+ widgets such as popovers in many applications. New tab style in GTK+. GNOME Videos GNOME Terminal and gedit were given a fresh look, more consistent with the HIG. A search provider for the terminal emulator is included in GNOME Shell. Improvements to GNOME Software and high-density display support. A new sound recorder application. New desktop notifications API. Progress in the Wayland port has reached a usable state that can be optionally previewed. +改进了Overview中的键盘导航和窗口选择,基于易用性测试对初始设置进行了修改。有线网络重新回到了状态栏上,在应用预览中可以自定义应用文件夹。在大量应用的对话框中引入了新的GTK+小工具同时使用了新的GTK+标签风格。GNOME Videos,GNOME 终端以及Gedit都改用了全新外观,更贴合HIG(译注:Human Interface Guidelines,人机界面指南)。在GNOME Shell的终端仿真器中提供了搜索预测功能。增强了对GNOME软件和高密度显示屏的支持。提供了新的录音工具。增加了新的桌面通知接口。在Wayland中的进程被置于更易使用的位置并可以进行选择性预览。 ![GNOME 3.14](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/3.14/Top-Features-of-GNOME-3-14-Gallery-459893-2.jpg) **GNOME 3.14**, 2014 -Improved desktop environment animations. Improved touchscreen support. GNOME Software supports managing installed add-ons. GNOME Photos adds support for Google. Redesigned UI for Evince, Sudoku, Mines and Weather. Hitori is added as part of GNOME Games. +更炫酷的桌面环境效果,改善了对触摸屏的支持。GNOME Software supports managing installed add-ons. 在GNOME Photos中可以访问Google相册。重绘了Evince,数独,扫雷和天气应用的用户界面,同时增加了一款叫做Hitori 的GNOME游戏。 ![GNOME 3.16](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/3.16/preview-apps.png) **GNOME 3.16**, 2015 -33,000 changes. Major changes include UI color scheme goes from black to charcoal. Overlay scroll bars added. Improvements to notifications including integration with Calendar applet. Tweaks to various apps including Files, Image Viewer, and Maps. Access to Preview Apps. Continued porting from X11 to Wayland. +33,000处改变。主要修改了UI的配色方案。 增加了即现式滚动条。通知窗口中整合了日历应用。对文件管理器,图像查看器和地图等大量应用进行了微调。可以预览应用程序。进一步使用Wayland取代X11。 -Thanks to [Wikipedia][2] for short changelogs review and another big thanks for GNOME Project! Stay tuned! +感谢GNOME Project及[Wikipedia][2]提供的变更日志!感谢阅读!(译注:原文此处为“敬请期待”。) -------------------------------------------------------------------------------- @@ -191,7 +190,7 @@ Thanks to [Wikipedia][2] for short changelogs review and another big thanks for via: https://tlhp.cf/18-years-of-gnome-evolution/ 作者:[Pavlo Rudyi][a] -译者:[译者ID](https://github.com/译者ID) +译者:[Haohong WANG](https://github.com/HaohongWANG) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 5aa3c9a910659ca434eaf56db459a190e0f7e29c Mon Sep 17 00:00:00 2001 From: Rubik Date: Tue, 12 Jan 2016 00:55:57 +0800 Subject: [PATCH 0197/1469] =?UTF-8?q?[=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= =?UTF-8?q?]Haohong=20WANG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 初次翻译,欢迎批评指正,谢谢。 --- ... Years of GNOME Design and Software Evolution--Step by Step.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/talk/20151020 18 Years of GNOME Design and Software Evolution--Step by Step.md (100%) diff --git a/sources/talk/20151020 18 Years of GNOME Design and Software Evolution--Step by Step.md b/translated/talk/20151020 18 Years of GNOME Design and Software Evolution--Step by Step.md similarity index 100% rename from sources/talk/20151020 18 Years of GNOME Design and Software Evolution--Step by Step.md rename to translated/talk/20151020 18 Years of GNOME Design and Software Evolution--Step by Step.md From 7613015e25632507870990f471f0a0af3a23e7ec Mon Sep 17 00:00:00 2001 From: carolinewuyan <309866211@qq.com> Date: Tue, 12 Jan 2016 14:38:14 +0800 Subject: [PATCH 0198/1469] =?UTF-8?q?=E6=A0=A1=E5=AF=B9=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...20151030 80 Linux Monitoring Tools for SysAdmins.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/translated/share/20151030 80 Linux Monitoring Tools for SysAdmins.md b/translated/share/20151030 80 Linux Monitoring Tools for SysAdmins.md index 25fdc1df44..4733a41d17 100644 --- a/translated/share/20151030 80 Linux Monitoring Tools for SysAdmins.md +++ b/translated/share/20151030 80 Linux Monitoring Tools for SysAdmins.md @@ -109,7 +109,7 @@ iptraf 收集的各种指标,如 TCP 连接数据包和字节数,端口统 ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/ngrep.jpg) -ngrep 就是 grep 但是相对于网络层的。pcap 意识到后允许其指定扩展规则或十六进制表达式来匹配数据包。 +如果不是网络层的话,ngrep 就是 grep。pcap 意识到后允许其指定扩展规则或十六进制表达式来匹配数据包。 #### 18. [MRTG][17] #### @@ -127,7 +127,7 @@ Bmon 能监控并帮助你调试网络。它能捕获网络相关的统计数据 ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/traceroute.jpg) -Traceroute 一个内置工具,能测试路由和数据包在网络中的延迟。 +Traceroute 是一个内置工具,能显示路由和测试数据包在网络中的延迟。 #### 21. [IPTState][19] #### @@ -137,7 +137,7 @@ IPTState 可以让你跨越 iptables 来监控流量,并通过你指定的条 ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/darkstat.jpg) -Darkstat 能捕获网络流量并计算统计的数据。该报告需要在浏览器中进行查看,它为你提供了一个非常棒的图形用户界面。 +Darkstat 能捕获网络流量并计算使用情况的统计数据。该报告保存在一个简单的HTTP服务器中,它为你提供了一个非常棒的图形用户界面。 #### 23. [vnStat][21] #### @@ -153,7 +153,7 @@ netstat 是一个内置的工具,它能显示 TCP 网络连接,路由表和 #### 25. ss #### -并非 netstat,最好使用 ss。ss 命令能够显示的信息比 netstat 更多,也更快。如果你想查看统计结果的总信息,你可以使用命令 `ss -s`。 +比起 netstat,使用 ss 更好。ss 命令能够显示的信息比 netstat 更多,也更快。如果你想查看统计结果的总信息,你可以使用命令 `ss -s`。 #### 26. [nmap][22] #### @@ -211,7 +211,7 @@ Saidar 是一个非常小的工具,为你提供有关系统资源的基础信 RRDtool 是用来处理 RRD 数据库的工具。RRDtool 旨在处理时间序列数据,如 CPU 负载,温度等。该工具提供了一种方法来提取 RRD 数据并以图形界面显示。 -#### 35. [monit][31] #### +#### 35. [monit][31] #### ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/monit.jpg) From 5657efbe1a0e345c61c0ceea992c0bd436012ace Mon Sep 17 00:00:00 2001 From: name1e5s <836401406@qq.com> Date: Tue, 12 Jan 2016 23:35:50 +0800 Subject: [PATCH 0199/1469] [translated]Ubuntu-\342\200\230Spyware\342\200\231-Will-Be-Disabled-In-Ubuntu-16.04-LTS --- ...re Will Be Disabled In Ubuntu 16.04 LTS.md | 88 ------------------- ...are’-Will-Be-Disabled-In-Ubuntu-16.04-LTS.md | 85 ++++++++++++++++++ 2 files changed, 85 insertions(+), 88 deletions(-) delete mode 100644 sources/news/20160111 Ubuntu Spyware Will Be Disabled In Ubuntu 16.04 LTS.md create mode 100644 translated/news/Ubuntu-‘Spyware’-Will-Be-Disabled-In-Ubuntu-16.04-LTS.md diff --git a/sources/news/20160111 Ubuntu Spyware Will Be Disabled In Ubuntu 16.04 LTS.md b/sources/news/20160111 Ubuntu Spyware Will Be Disabled In Ubuntu 16.04 LTS.md deleted file mode 100644 index c11a4ff04c..0000000000 --- a/sources/news/20160111 Ubuntu Spyware Will Be Disabled In Ubuntu 16.04 LTS.md +++ /dev/null @@ -1,88 +0,0 @@ -#translating by name1e5s - -Ubuntu ‘Spyware’ Will Be Disabled In Ubuntu 16.04 LTS -================================================================================ -Controversial feature scaled back to help boost Ubuntu's privacy credentials - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2013/09/as2.jpg) - -**Unity’s controversial online search feature is being disabled by default in Ubuntu 16.04 LTS, due for release in April.** - -Search terms typed into the Unity 7 Dash search bar will **only show local file, folder and app results**. No search terms will be sent to Canonical or passed to third party results providers, as is currently the case. - -> ‘Unity online searches are now turned off by default.’ - -In currently supported versions of Ubuntu the Dash sends search queries the user enters to a remote web server run by Canonical, the company behind Ubuntu. - -No user-identifiable data is included with these queries, which are used to retrieve contextually relevant results from over 50 online services, including Wikipedia, YouTube and The Weather Channel. - -A switch to disable online search entirely is available in Ubuntu through the **Ubuntu System Settings > Privacy pane**. - -But some in the open-source community object to the feature being turned on by default. - -### Ubuntu Online Search Controversy ### - -> ‘Richard Stallman describes the feature as ‘spyware” - -Boiling over since 2012, the open-source community was quick to express concerns about user privacy in the wake of Ubuntu Amazon integration. Concerns continued with the rollout of the comprehensive ‘Smart Scopes Service’ a year later. - -The furore was so big it led free software stalwart [Richard Stallman to call Ubuntu ‘spyware’][1]. - -[The Electronic Frontier Foundation][2] also shared its concerns in a series of blog posts and suggested that Canonical make the feature opt-in. Privacy International went further than most by awarding Ubuntu’s makers a ‘[Big Brother award][3]‘ for work on, quote: “invading personal privacy”. - -[Canonical][4] maintains that the data collected through Unity’s online search feature is anonymised and “not user-identifiable”. - -In [blog post from 2013 the company explains][5] that it “**make[s] users aware of what data will be collected and which third party services will be queried through a notice right in the Dash, and we only collect data that allows us to deliver a great search experience to Ubuntu users.**” - -### Ubuntu Gets Serious About Data Privacy ### - -Canonical disabled Amazon product results on fresh installs of Ubuntu 14.04 LTS and up (though results from other online sources and services continue to appear until the opt-out is chosen). - -For the next LTS, Ubuntu 16.04, Canonical curtails the contentious online searching feature entirely, right out of the box, just like the EFF asked them to do in 2012. - -“None of your search terms will leave your computer,” [Ubuntu desktop manager Will Cooke][6] explains, noting that the “finer control over what is searched and [the] more targeted results” that Unity 8 offers “cannot be added into Unity 7.” - -It’s for this reason that “the online search features [of Unity 7] will be retired.” - -The change will also lower the support and infrastructure burden of Unity 7. With fewer Unity search results to handle Canonical can redirect time and engineering effort to more exciting avenues, like the promising Unity 8 desktop. - -### You Will Need to Opt-In To Get Online Results ### - -![Privacy settings in Ubuntu let you opt in to seeing online results](http://www.omgubuntu.co.uk/wp-content/uploads/2013/04/privacy.jpg) - -Privacy settings in Ubuntu let you opt in to seeing online results - -The decision to disable the online search element of the Ubuntu desktop will be greeted with considerable cheer by many in the open-source and free software communities. - -But not everyone is antagonised by the semantic search skills being served up in the Dash. - -If you think you’ll miss the efficiency of searching and previewing weather, news and other content through the Dash, **you can re-enable online search results** in a couple of clicks. Just head to Ubuntu **System Settings > Privacy > Search** and set the slider to ‘**On**‘. - -Flicking this won’t automatically bring back Amazon product results. The ‘shopping lens’ is decoupled from the opt-in toggle. You’ll need to okay a second opt-in to see product results from Amazon (and Skimlinks). - -### Summary ### - -- Ubuntu 16.04 LTS will no longer search online sources in the Dash by default -- Online results can be turned back on manually using a toggle -- A second opt-in allows Amazon product results -- The change only affects new installs. In-place upgrades will retain user preferences - -Do you agree with this decision? Or is Canonical about to reduce the experience of Ubuntu for new users? Let us know in the comments. - --------------------------------------------------------------------------------- - -via: http://www.omgubuntu.co.uk/2016/01/ubuntu-online-search-feature-disabled-16-04 - -作者:[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://arstechnica.com/information-technology/2012/12/richard-stallman-calls-ubuntu-spyware-because-it-tracks-searches/?utm_source=omgubuntu -[2]:https://www.eff.org/deeplinks/2012/10/privacy-ubuntu-1210-amazon-ads-and-data-leaks?utm_source=omgubuntu -[3]:http://www.omgubuntu.co.uk/2013/10/ubuntu-wins-big-brother-austria-privacy-award -[4]:http://blog.canonical.com/2012/12/07/searching-in-the-dash-in-ubuntu-13-04/ -[5]:http://blog.canonical.com/2012/12/07/searching-in-the-dash-in-ubuntu-13-04/?utm_source=omgubuntu -[6]:http://www.whizzy.org/2015/12/online-searches-in-the-dash-to-be-off-by-default?utm_source=omgubuntu diff --git a/translated/news/Ubuntu-‘Spyware’-Will-Be-Disabled-In-Ubuntu-16.04-LTS.md b/translated/news/Ubuntu-‘Spyware’-Will-Be-Disabled-In-Ubuntu-16.04-LTS.md new file mode 100644 index 0000000000..286ca7472c --- /dev/null +++ b/translated/news/Ubuntu-‘Spyware’-Will-Be-Disabled-In-Ubuntu-16.04-LTS.md @@ -0,0 +1,85 @@ +Ubuntu的"间谍软件"将在Ubuntu 16.04 LTS中被禁用 +================================================================================ + +出于用户隐私的考虑,Ubuntu阉割了一个有争议的功能. + + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2013/09/as2.jpg) + +** Unity 中有争议的在线搜索功能将在四月份发布的Ubuntu 16.04 LTS中被默认禁用 ** + +目前,用户在Unity 7 的Dash搜索栏里**只能搜索到本地文件,文件夹以及应用**.目前的状况是,用户输入的关键词将不会被发送到Canonical或任何第三方内容提供商的服务器里. + +> '现在,Unity的在线搜索在默认状况下是关闭的' + +在目前ubuntu的支持版本中,Dash栏会将用户搜索的关键词发送到Canonical运营的远程服务器中.它发送这些数据以用于从50多家在线服务获取搜索结果,这些服务包括维基百科,YouTube和The Weather Channel. + + + +我们可以选择去**系统设置 > 隐私控制**关闭这项功能.但是,一些在开源社区的功能被默认打开。 + + + +### Ubuntu 在线搜索引发的争议 ### + +> 'Richard Stallman 将这个功能描述为 "间谍软件"' + +早在2012年,在Ubuntu搜索中整合来自亚马逊的内容之后,开源社区表示为其用户的隐私感到担忧.在2013年,‘Smart Scopes 服务’全面推出后,开源社区再度表示担忧. + +风波如此之大,以至于开源界大神[Richard Stallman 都称Ubuntu为"间谍软件"][1]. + +[电子前哨基金会(EFF)][2]也在一系列博文中表达出对此的关注,并且建议Canonical将这个功能做成用户自由选择是否开启的功能.Privacy International比其他的组织走的更远,对于Ubuntu的工作,他给Ubuntu的缔造者发了一个"[老大哥奖][3]" + +[Canonical][4] 坚称Unity的在线搜索功能所收集的数据是匿名的以及"不可识别是来自哪个用户的". + +在[2013年Canoical发布的博文中][5]他们解释道 "** (我们)会使用户了解我们收集哪些信息以及哪些第三方服务商将会在他们搜索时从Dash栏中给出结果.我们只会收集能够提升用户体验的信息.**" + +### Ubuntu开始严肃对待的用户数据隐私### + +Canonical在给Ubuntu 14.04 LTS以及以上版本的更新中禁用了来自亚马逊的结果(尽管来自其他服务商的搜索结果仍然在出现直到你关闭这个选项) + +在下一个LTS(长期支持)版,也就是Ubuntu 16.04,Canonical完全关闭了这个有争议的在线搜索功能,这个功能在用户安装完后就是关闭的.就如同EFF在2012年让他们做的那样. + +"你搜索的关键词将不会逃出你的计算机." [Ubuntu 桌面环境经理Will Cooke][6]解释道,Unity提供的"对于搜索结果的更精细的控制不能添加到Unity 7" + +这也就是"[Unity 7]的在线搜索功能将会退役"的原因. + +这个变化也会减少Unity的支持以及基础设施对于Canonical的负担.Unity提供的搜索结果越少,Canonical就能把时间和工程师放到更加振奋人心的地方,比如更早的发布Unity 8桌面环境. + +### 在Ubuntu 16.04中你需要自己开启在线搜索功能 ### + +![Privacy settings in Ubuntu let you opt in to seeing online results](http://www.omgubuntu.co.uk/wp-content/uploads/2013/04/privacy.jpg) + +可以让你打开在线搜索功能的Ubuntu隐私设置 + +禁用Ubuntu桌面的在线搜索功能的决定将获得众多开源/免费软件社区的欢呼.但是并不是每一个人都对Dash提供的语义搜索功能反感,如果你认为你失去了在搜索时预览天气,查看新闻或其他来自Dash在线搜索提供的内容的效率的话.你只需要简单的点几下鼠标就可以**再次打开这个功能**,定位到Ubuntu的**系统设置 > 隐私控制 > 搜索**然后将选项调至'**开启**'/ + +这个选项不会自动把亚马逊的产品信息加入到搜索结果中.如果你想看产品信息的话,需要同意那个设置中的"shipping lens"选项. + +### 总结 ### + + +- 默认情况下,Ubuntu 16.04 LTS的Dash栏将不会搜索到在线结果 +- 可以手动打开在线搜索 +- *系统设置 > 隐私控制 > 搜索**中的第二个选项允许你看到亚马逊的产品信息 +- 这个变动只会影响新安装的系统.从老版本升级的将会保留用户的喜好 + +你同意这个决定吗?还是Cononical要以此提升Ubuntu对于新用户的体验?让我们在评论中揭晓./ + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2016/01/ubuntu-online-search-feature-disabled-16-04 + +作者:[Joey-Elijah Sneddon][a] +译者:[name1e5s](https://github.com/name1e5s) +校对:[校对者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://arstechnica.com/information-technology/2012/12/richard-stallman-calls-ubuntu-spyware-because-it-tracks-searches/?utm_source=omgubuntu +[2]:https://www.eff.org/deeplinks/2012/10/privacy-ubuntu-1210-amazon-ads-and-data-leaks?utm_source=omgubuntu +[3]:http://www.omgubuntu.co.uk/2013/10/ubuntu-wins-big-brother-austria-privacy-award +[4]:http://blog.canonical.com/2012/12/07/searching-in-the-dash-in-ubuntu-13-04/ +[5]:http://blog.canonical.com/2012/12/07/searching-in-the-dash-in-ubuntu-13-04/?utm_source=omgubuntu +[6]:http://www.whizzy.org/2015/12/online-searches-in-the-dash-to-be-off-by-default?utm_source=omgubuntu From 2c35f8488914ebb5e517f924ffbf165ff2a46fc9 Mon Sep 17 00:00:00 2001 From: Yu Haixin <836401406@qq.com> Date: Tue, 12 Jan 2016 15:38:31 +0800 Subject: [PATCH 0200/1469] Update 20160111 Open Source DJ Software Mixxx Version 2.0 Released.md --- ...160111 Open Source DJ Software Mixxx Version 2.0 Released.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/share/20160111 Open Source DJ Software Mixxx Version 2.0 Released.md b/sources/share/20160111 Open Source DJ Software Mixxx Version 2.0 Released.md index 87522476a7..6c7fa5838a 100644 --- a/sources/share/20160111 Open Source DJ Software Mixxx Version 2.0 Released.md +++ b/sources/share/20160111 Open Source DJ Software Mixxx Version 2.0 Released.md @@ -1,3 +1,5 @@ +#name1e5s translating + Open Source DJ Software Mixxx Version 2.0 Released ================================================================================ ![](http://itsfoss.com/wp-content/uploads/2016/01/DJ-Software-Mixxx-2-Released.jpg) From bc03fd0fc2929d38057af8135233ab727277577b Mon Sep 17 00:00:00 2001 From: Yu Haixin <836401406@qq.com> Date: Tue, 12 Jan 2016 17:50:40 +0800 Subject: [PATCH 0201/1469] Delete 20160111 Open Source DJ Software Mixxx Version 2.0 Released.md --- ... DJ Software Mixxx Version 2.0 Released.md | 71 ------------------- 1 file changed, 71 deletions(-) delete mode 100644 sources/share/20160111 Open Source DJ Software Mixxx Version 2.0 Released.md diff --git a/sources/share/20160111 Open Source DJ Software Mixxx Version 2.0 Released.md b/sources/share/20160111 Open Source DJ Software Mixxx Version 2.0 Released.md deleted file mode 100644 index 6c7fa5838a..0000000000 --- a/sources/share/20160111 Open Source DJ Software Mixxx Version 2.0 Released.md +++ /dev/null @@ -1,71 +0,0 @@ -#name1e5s translating - -Open Source DJ Software Mixxx Version 2.0 Released -================================================================================ -![](http://itsfoss.com/wp-content/uploads/2016/01/DJ-Software-Mixxx-2-Released.jpg) - -After three years, Open Source DJ mixing software [Mixxx][1] sees a major release in the form of Mixxx version 2.0. - -Mixxx is a cross-platform, free and open source DJ mixing software that provides almost all the features you would need for creating your own mixes. Used by professionals and amateurs alike, Mixxx has been a hot favorite for several years. - -In Mixxx you can use your iTunes library. Its powerful mixing engine supports a number of file format. Over 85 MIDI DJ controllers are supported out-of-the-box along with several HID controllers. There is an Auto DJ option as well to give you a break from mixing. - -Complete features of Mixxx can be found [here][2]. But before that, let’s see what is new in the latest release. - -### What’s new in Mixxx 2.0 ### - -- Dynamic, Resizable Skins -- 4 Decks with Master Sync -- Built-in Effects -- Harmonic Mixing with Musical Key Detection -- RGB Waveforms -- Four Microphones, Four AUX Inputs, Microphone Ducking -- Vinyl Passthrough -- Cover Art Support -- Core Mixing Engine Improvements -- Upgraded Library -- Improved, Expanded Support for DJ Controllers - -You can find the new features of Mixxx 2.0 in details [here][3]. - -### Install Mixxx 2.0 in Ubuntu based Linux distributions ### - -Mixxx provides its own PPA too easily install Mixxx in Ubuntu based Linux distributions such as Linux Mint, elementary OS, Zorin OS etc. The PPA is valid for Ubuntu 12.04, 14.04 and 15.10. - -Open a terminal and use the following commands: - - sudo add-apt-repository ppa:mixxx/mixxx - sudo apt-get update - sudo apt-get install mixxx - -To uninstall Mixxx, use the following commands: - - sudo apt-get remove mixxx - sudo add-apt-repository --remove ppa:mixxx/mixxx - -If you are already using an older version of Mixxx, it will be upgraded soon. - -For other Linux distributions, you can install Mixxx from the source code. You can download Mixxx 2.0 source code from the link below: - -- [Get Mixxx 2.0 Source Code][4] - -Since Mixxx is a cross platform application, you can download it for Windows and Mac OS X as well. You can visit the Mixxx download page to get the installer for other platforms. - -- [Download Mixxx 2.0][5] - --------------------------------------------------------------------------------- - -via: http://itsfoss.com/dj-mixxx-2/ - -作者:[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://mixxx.org/ -[2]:http://mixxx.org/features/ -[3]:http://mixxx.org/whats-new-in-mixxx-2-0/ -[4]:http://downloads.mixxx.org/mixxx-2.0.0/mixxx-2.0.0-src.tar.gz -[5]:http://mixxx.org/download/ From 432ab8e6999e7f0e1a602631c887189254daa4db Mon Sep 17 00:00:00 2001 From: name1e5s <836401406@qq.com> Date: Wed, 13 Jan 2016 02:15:55 +0800 Subject: [PATCH 0202/1469] [translated]sources/share/20160111 Open Source DJ Software Mixxx Version 2.0 Released.md --- ... DJ Software Mixxx Version 2.0 Released.md | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 translated/share/20160111 Open Source DJ Software Mixxx Version 2.0 Released.md diff --git a/translated/share/20160111 Open Source DJ Software Mixxx Version 2.0 Released.md b/translated/share/20160111 Open Source DJ Software Mixxx Version 2.0 Released.md new file mode 100644 index 0000000000..d5cf9d998d --- /dev/null +++ b/translated/share/20160111 Open Source DJ Software Mixxx Version 2.0 Released.md @@ -0,0 +1,75 @@ +开源Dj软件Mixxx 2.0版发布 +================================================================================ +![](http://itsfoss.com/wp-content/uploads/2016/01/DJ-Software-Mixxx-2-Released.jpg) + +时隔三年,开源Dj混音软件[Mixxx][1]再度发布一个大的版本更新----Mixxx 2.0. + +Mixxx是一个跨平台的免费开源的Dj混音软件,它几乎提供了当你想自己混音时需要的一切功能.Mixxx近几年在专业人士以及业余爱好者中都很火. + +在Mixxx中你能使用你的iTunes音乐库.它的强有力的引擎使它支持多种文件格式.Mixxx默认即支持超过85种MIDI Dj调节器以及少部分HID调节器.它也包含一个自动选项,可以让你在混音时休息一下. + +Mixxx的完整功能列表可以在[这里][2]找到.在查看完整列表之前,让我们看看最新版有何更新. + +### Mixxx 2.0更新 ### + +- 可自定义的用户界面 +- 4 轨道混音并且和主轨道同步 +- 内置特效 +- 谐波混频与音乐按键检测 +- RGB 音频波形 +- 4 个麦克风输入和 4 个音频输出 +- 黑胶音源输入、输出 +- 支持自定义封面 +- 核心升级 +- 升级库文件 +- 更先进的Dj 调节器 + +你可以在[这里][3]中看到所有的新功能. + +### 在基于Ubuntu的发行版中安装Mixxx 2.0 ### + +Mixxx提供了他们自己的ppa源,这使得在在基于Ubuntu的发行版----如Linux Mint, elementary OS, Zorin OS----安装Mixxx 2.0变得十分简单. + +打开终端,并输入如下命令: + + sudo add-apt-repository ppa:mixxx/mixxx + sudo apt-get update + sudo apt-get install mixxx + +使用如下命令卸载Mixxx: + + sudo apt-get remove mixxx + sudo add-apt-repository --remove ppa:mixxx/mixxx + +如果你使用老版本的Mixxx.它将很快升级到2.0版. + +### 在其他发行版中安装Mixxx 2.0 ### + +Archliunx + + sudo pacman -S mixxx + +对于其他发行版,你可以从源码编译安装Mixxx. + +- [源码地址][4] + +由于Mixxx是个跨平台的应用,你也可以下载它的Windows版或者Mac OS 版 + +- [下载地址][5] + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/dj-mixxx-2/ + +作者:[Abhishek][a] +译者:[name1e5s](https://github.com/name1e5s) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://mixxx.org/ +[2]:http://mixxx.org/features/ +[3]:http://mixxx.org/whats-new-in-mixxx-2-0/ +[4]:http://downloads.mixxx.org/mixxx-2.0.0/mixxx-2.0.0-src.tar.gz +[5]:http://mixxx.org/download/ From 0bc5f7c9b39cf14e9893e2bd98b19bce53cde57f Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 12 Jan 2016 22:43:57 +0800 Subject: [PATCH 0203/1469] =?UTF-8?q?PUB:20160111=20Ubuntu-=E2=80=98Spywar?= =?UTF-8?q?e=E2=80=99-Will-Be-Disabled-In-Ubuntu-16.04-LTS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @name1e5s 翻译的很好!有两个细节希以后注意: 1、保持文件名不动,只是移动位置,即,保留文件名前面的日期 2、使用中文标点,并在英文单词两侧留空格 明天一早,你会在如下 URL 看到: https://linux.cn/article-6878-1.html --- ...are’-Will-Be-Disabled-In-Ubuntu-16.04-LTS.md | 80 +++++++++++++++++ ...are’-Will-Be-Disabled-In-Ubuntu-16.04-LTS.md | 85 ------------------- 2 files changed, 80 insertions(+), 85 deletions(-) create mode 100644 published/20160111 Ubuntu-‘Spyware’-Will-Be-Disabled-In-Ubuntu-16.04-LTS.md delete mode 100644 translated/news/Ubuntu-‘Spyware’-Will-Be-Disabled-In-Ubuntu-16.04-LTS.md diff --git a/published/20160111 Ubuntu-‘Spyware’-Will-Be-Disabled-In-Ubuntu-16.04-LTS.md b/published/20160111 Ubuntu-‘Spyware’-Will-Be-Disabled-In-Ubuntu-16.04-LTS.md new file mode 100644 index 0000000000..ed6addfde7 --- /dev/null +++ b/published/20160111 Ubuntu-‘Spyware’-Will-Be-Disabled-In-Ubuntu-16.04-LTS.md @@ -0,0 +1,80 @@ +Ubuntu 里的“间谍软件”将在 Ubuntu 16.04 LTS 中被禁用 +================================================================================ + +出于用户隐私的考虑,Ubuntu 阉割了一个有争议的功能。 + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2013/09/as2.jpg) + +**Unity 中有争议的在线搜索功能将在今年四月份发布的 Ubuntu 16.04 LTS 中被默认禁用** + +用户在 Unity 7 的 Dash 搜索栏里将**只能搜索到本地文件、文件夹以及应用**。这样,用户输入的关键词将不会被发送到 Canonical 或任何第三方内容提供商的服务器里。 + +> “现在,Unity 的在线搜索在默认状况下是关闭的” + +在目前 ubuntu 的支持版本中,Dash 栏会将用户搜索的关键词发送到 Canonical 运营的远程服务器中。它发送这些数据以用于从50多家在线服务获取搜索结果,这些服务包括维基百科、YouTube 和 The Weather Channel 等。 + +我们可以选择去**系统设置 > 隐私控制**关闭这项功能。但是,一些开源社区针对的是默认打开这个事情。 + +### Ubuntu 在线搜索引发的争议 ### + +> “Richard Stallman 将这个功能描述为 ‘间谍软件’” + +早在2012年,在 Ubuntu 搜索中整合了来自亚马逊的内容之后,开源社区就表示为其用户的隐私感到担忧。在2013年,“Smart Scopes 服务”全面推出后,开源社区再度表示担忧. + +风波如此之大,以至于开源界大神 [Richard Stallman 都称 Ubuntu 为"间谍软件"][1]。 + +[电子前哨基金会 (EFF)][2]也在一系列博文中表达出对此的关注,并且建议 Canonical 将这个功能做成用户自由选择是否开启的功能。Privacy International 比其他的组织走的更远,对于 Ubuntu 的工作,他们给 Ubuntu 的缔造者发了一个“[老大哥奖][3]”。 + +[Canonical][4] 坚称] Unity 的在线搜索功能所收集的数据是匿名的以及“不可识别是来自哪个用户的”。 + +在[2013年 Canoical 发布的博文中][5]他们解释道:“**(我们)会使用户了解我们收集哪些信息以及哪些第三方服务商将会在他们搜索时从 Dash 栏中给出结果。我们只会收集能够提升用户体验的信息。**” + +### Ubuntu 开始严肃对待的用户数据隐私### + +Canonical 在给新安装的 Ubuntu 14.04 LTS 以及以上版本中禁用了来自亚马逊的产品搜索结果(尽管来自其他服务商的搜索结果仍然在出现,直到你关闭这个选项) + +在下一个LTS(长期支持)版,也就是 Ubuntu 16.04 中,Canonical 完全关闭了这个有争议的在线搜索功能,这个功能在用户安装完后就是关闭的。就如同 EFF 在2012年建议他们做的那样。 + +“你搜索的关键词将不会逃出你的计算机。” [Ubuntu 桌面主管 Will Cooke][6]解释道,“对于搜索结果的更精细的控制”和 Unity 8 所提供的“更有针对性的结果添加不到 Unity 7 里”。 + +这也就是“[Unity 7]的在线搜索功能将会退役”的原因。 + +这个变化也会降低对 Unity 7 的支持以及对 Canonical 基础设施的压力。Unity 提供的搜索结果越少,Canonical 就能把时间和工程师放到更加振奋人心的地方,比如更早的发布 Unity 8 桌面环境。 + +### 在 Ubuntu 16.04 中你需要自己开启在线搜索功能 ### + +![Privacy settings in Ubuntu let you opt in to seeing online results](http://www.omgubuntu.co.uk/wp-content/uploads/2013/04/privacy.jpg) + +*在 Ubuntu 隐私设置中你可以打开在线搜索功能* + +禁用 Ubuntu 桌面的在线搜索功能的决定将获得众多开源/免费软件社区的欢呼。但是并不是每一个人都对 Dash 提供的语义搜索功能反感,如果你认为你失去了在搜索时预览天气、查看新闻或其他来自 Dash 在线搜索提供的内容所带来的效率的话,你只需要简单的点几下鼠标就可以**再次打开这个功能**,定位到 Ubuntu 的**系统设置 > 隐私控制 > 搜索**然后将选项调至“**开启**”。 + +这个选项不会自动把亚马逊的产品信息加入到搜索结果中。如果你想看产品信息的话,需要打开第二个可选项“shipping lens”才能看到来自 Amazon (和 Skimlinks)的内容。 + +### 总结 ### + + +- 默认情况下,Ubuntu 16.04 LTS 的 Dash 栏将不会搜索到在线结果 +- 可以手动打开在线搜索 +- **系统设置 > 隐私控制 > 搜索**中的第二个可选项允许你看到亚马逊的产品信息 +- 这个变动只会影响新安装的系统。从老版本升级的将会保留用户的喜好 + +你同意这个决定吗?抑或是 Cononical 可能降低了新用户的体验?在评论中告诉我们。 + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2016/01/ubuntu-online-search-feature-disabled-16-04 + +作者:[Joey-Elijah Sneddon][a] +译者:[name1e5s](https://github.com/name1e5s) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://plus.google.com/117485690627814051450/?rel=author +[1]:http://arstechnica.com/information-technology/2012/12/richard-stallman-calls-ubuntu-spyware-because-it-tracks-searches/?utm_source=omgubuntu +[2]:https://www.eff.org/deeplinks/2012/10/privacy-ubuntu-1210-amazon-ads-and-data-leaks?utm_source=omgubuntu +[3]:http://www.omgubuntu.co.uk/2013/10/ubuntu-wins-big-brother-austria-privacy-award +[4]:http://blog.canonical.com/2012/12/07/searching-in-the-dash-in-ubuntu-13-04/ +[5]:http://blog.canonical.com/2012/12/07/searching-in-the-dash-in-ubuntu-13-04/?utm_source=omgubuntu +[6]:http://www.whizzy.org/2015/12/online-searches-in-the-dash-to-be-off-by-default?utm_source=omgubuntu diff --git a/translated/news/Ubuntu-‘Spyware’-Will-Be-Disabled-In-Ubuntu-16.04-LTS.md b/translated/news/Ubuntu-‘Spyware’-Will-Be-Disabled-In-Ubuntu-16.04-LTS.md deleted file mode 100644 index 286ca7472c..0000000000 --- a/translated/news/Ubuntu-‘Spyware’-Will-Be-Disabled-In-Ubuntu-16.04-LTS.md +++ /dev/null @@ -1,85 +0,0 @@ -Ubuntu的"间谍软件"将在Ubuntu 16.04 LTS中被禁用 -================================================================================ - -出于用户隐私的考虑,Ubuntu阉割了一个有争议的功能. - - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2013/09/as2.jpg) - -** Unity 中有争议的在线搜索功能将在四月份发布的Ubuntu 16.04 LTS中被默认禁用 ** - -目前,用户在Unity 7 的Dash搜索栏里**只能搜索到本地文件,文件夹以及应用**.目前的状况是,用户输入的关键词将不会被发送到Canonical或任何第三方内容提供商的服务器里. - -> '现在,Unity的在线搜索在默认状况下是关闭的' - -在目前ubuntu的支持版本中,Dash栏会将用户搜索的关键词发送到Canonical运营的远程服务器中.它发送这些数据以用于从50多家在线服务获取搜索结果,这些服务包括维基百科,YouTube和The Weather Channel. - - - -我们可以选择去**系统设置 > 隐私控制**关闭这项功能.但是,一些在开源社区的功能被默认打开。 - - - -### Ubuntu 在线搜索引发的争议 ### - -> 'Richard Stallman 将这个功能描述为 "间谍软件"' - -早在2012年,在Ubuntu搜索中整合来自亚马逊的内容之后,开源社区表示为其用户的隐私感到担忧.在2013年,‘Smart Scopes 服务’全面推出后,开源社区再度表示担忧. - -风波如此之大,以至于开源界大神[Richard Stallman 都称Ubuntu为"间谍软件"][1]. - -[电子前哨基金会(EFF)][2]也在一系列博文中表达出对此的关注,并且建议Canonical将这个功能做成用户自由选择是否开启的功能.Privacy International比其他的组织走的更远,对于Ubuntu的工作,他给Ubuntu的缔造者发了一个"[老大哥奖][3]" - -[Canonical][4] 坚称Unity的在线搜索功能所收集的数据是匿名的以及"不可识别是来自哪个用户的". - -在[2013年Canoical发布的博文中][5]他们解释道 "** (我们)会使用户了解我们收集哪些信息以及哪些第三方服务商将会在他们搜索时从Dash栏中给出结果.我们只会收集能够提升用户体验的信息.**" - -### Ubuntu开始严肃对待的用户数据隐私### - -Canonical在给Ubuntu 14.04 LTS以及以上版本的更新中禁用了来自亚马逊的结果(尽管来自其他服务商的搜索结果仍然在出现直到你关闭这个选项) - -在下一个LTS(长期支持)版,也就是Ubuntu 16.04,Canonical完全关闭了这个有争议的在线搜索功能,这个功能在用户安装完后就是关闭的.就如同EFF在2012年让他们做的那样. - -"你搜索的关键词将不会逃出你的计算机." [Ubuntu 桌面环境经理Will Cooke][6]解释道,Unity提供的"对于搜索结果的更精细的控制不能添加到Unity 7" - -这也就是"[Unity 7]的在线搜索功能将会退役"的原因. - -这个变化也会减少Unity的支持以及基础设施对于Canonical的负担.Unity提供的搜索结果越少,Canonical就能把时间和工程师放到更加振奋人心的地方,比如更早的发布Unity 8桌面环境. - -### 在Ubuntu 16.04中你需要自己开启在线搜索功能 ### - -![Privacy settings in Ubuntu let you opt in to seeing online results](http://www.omgubuntu.co.uk/wp-content/uploads/2013/04/privacy.jpg) - -可以让你打开在线搜索功能的Ubuntu隐私设置 - -禁用Ubuntu桌面的在线搜索功能的决定将获得众多开源/免费软件社区的欢呼.但是并不是每一个人都对Dash提供的语义搜索功能反感,如果你认为你失去了在搜索时预览天气,查看新闻或其他来自Dash在线搜索提供的内容的效率的话.你只需要简单的点几下鼠标就可以**再次打开这个功能**,定位到Ubuntu的**系统设置 > 隐私控制 > 搜索**然后将选项调至'**开启**'/ - -这个选项不会自动把亚马逊的产品信息加入到搜索结果中.如果你想看产品信息的话,需要同意那个设置中的"shipping lens"选项. - -### 总结 ### - - -- 默认情况下,Ubuntu 16.04 LTS的Dash栏将不会搜索到在线结果 -- 可以手动打开在线搜索 -- *系统设置 > 隐私控制 > 搜索**中的第二个选项允许你看到亚马逊的产品信息 -- 这个变动只会影响新安装的系统.从老版本升级的将会保留用户的喜好 - -你同意这个决定吗?还是Cononical要以此提升Ubuntu对于新用户的体验?让我们在评论中揭晓./ - --------------------------------------------------------------------------------- - -via: http://www.omgubuntu.co.uk/2016/01/ubuntu-online-search-feature-disabled-16-04 - -作者:[Joey-Elijah Sneddon][a] -译者:[name1e5s](https://github.com/name1e5s) -校对:[校对者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://arstechnica.com/information-technology/2012/12/richard-stallman-calls-ubuntu-spyware-because-it-tracks-searches/?utm_source=omgubuntu -[2]:https://www.eff.org/deeplinks/2012/10/privacy-ubuntu-1210-amazon-ads-and-data-leaks?utm_source=omgubuntu -[3]:http://www.omgubuntu.co.uk/2013/10/ubuntu-wins-big-brother-austria-privacy-award -[4]:http://blog.canonical.com/2012/12/07/searching-in-the-dash-in-ubuntu-13-04/ -[5]:http://blog.canonical.com/2012/12/07/searching-in-the-dash-in-ubuntu-13-04/?utm_source=omgubuntu -[6]:http://www.whizzy.org/2015/12/online-searches-in-the-dash-to-be-off-by-default?utm_source=omgubuntu From 397a19245d0135187c25da72788b502db8c40183 Mon Sep 17 00:00:00 2001 From: FSSlc Date: Tue, 12 Jan 2016 23:32:16 +0800 Subject: [PATCH 0204/1469] [Translated]20151215 How to block network traffic by country on Linux --- .../201407/Encrypting Your Cat Photos.md | 0 ... up server monitoring system with Monit.md | 0 ...ock network traffic by country on Linux.md | 112 ------------------ ...ock network traffic by country on Linux.md | 110 +++++++++++++++++ 4 files changed, 110 insertions(+), 112 deletions(-) mode change 100755 => 100644 published/201407/Encrypting Your Cat Photos.md mode change 100755 => 100644 published/201505/20150326 How to set up server monitoring system with Monit.md delete mode 100644 sources/tech/20151215 How to block network traffic by country on Linux.md create mode 100644 translated/tech/20151215 How to block network traffic by country on Linux.md diff --git a/published/201407/Encrypting Your Cat Photos.md b/published/201407/Encrypting Your Cat Photos.md old mode 100755 new mode 100644 diff --git a/published/201505/20150326 How to set up server monitoring system with Monit.md b/published/201505/20150326 How to set up server monitoring system with Monit.md old mode 100755 new mode 100644 diff --git a/sources/tech/20151215 How to block network traffic by country on Linux.md b/sources/tech/20151215 How to block network traffic by country on Linux.md deleted file mode 100644 index 14bdbad711..0000000000 --- a/sources/tech/20151215 How to block network traffic by country on Linux.md +++ /dev/null @@ -1,112 +0,0 @@ -FSSlc translating - -How to block network traffic by country on Linux -================================================================================ -As a system admin who maintains production Linux servers, there are circumstances where you need to **selectively block or allow network traffic based on geographic locations**. For example, you are experiencing denial-of-service attacks mostly originating from IP addresses registered with a particular country. You want to block SSH logins from unknown foreign countries for security reasons. Your company has a distribution right to online videos, which requires it to legally stream to particular countries only. You need to prevent any local host from uploading documents to any non-US remote cloud storage due to geo-restriction company policies. - -All these scenarios require an ability to set up a firewall which does **country-based traffic filtering**. There are a couple of ways to do that. For one, you can use TCP wrappers to set up conditional blocking for individual applications (e.g., SSH, NFS, httpd). The downside is that the application you want to protect must be built with TCP wrappers support. Besides, TCP wrappers are not universally available across different platforms (e.g., Arch Linux [dropped][2] its support). An alternative approach is to set up [ipset][3] with country-based GeoIP information and apply it to iptables rules. The latter approach is more promising as the iptables-based filtering is application-agnostic and easy to set up. - -In this tutorial, I am going to present **another iptables-based GeoIP filtering which is implemented with xtables-addons**. For those unfamiliar with it, xtables-addons is a suite of extensions for netfilter/iptables. Included in xtables-addons is a module called xt_geoip which extends the netfilter/iptables to filter, NAT or mangle packets based on source/destination countries. For you to use xt_geoip, you don't need to recompile the kernel or iptables, but only need to build xtables-addons as modules, using the current kernel build environment (/lib/modules/`uname -r`/build). Reboot is not required either. As soon as you build and install xtables-addons, xt_geoip is immediately usable with iptables. - -As for the comparison between xt_geoip and ipset, the [official source][3] mentions that xt_geoip is superior to ipset in terms of memory foot print. But in terms of matching speed, hash-based ipset might have an edge. - -In the rest of the tutorial, I am going to show **how to use iptables/xt_geoip to block network traffic based on its source/destination countries**. - -### Install Xtables-addons on Linux ### - -Here is how you can compile and install xtables-addons on various Linux platforms. - -To build xtables-addons, you need to install a couple of dependent packages first. - -#### Install Dependencies on Debian, Ubuntu or Linux Mint #### - - $ sudo apt-get install iptables-dev xtables-addons-common libtext-csv-xs-perl pkg-config - -#### Install Dependencies on CentOS, RHEL or Fedora #### - -CentOS/RHEL 6 requires EPEL repository being set up first (for perl-Text-CSV_XS). - - $ sudo yum install gcc-c++ make automake kernel-devel-`uname -r` wget unzip iptables-devel perl-Text-CSV_XS - -#### Compile and Install Xtables-addons #### - -Download the latest `xtables-addons` source code from the [official site][4], and build/install it as follows. - - $ wget http://downloads.sourceforge.net/project/xtables-addons/Xtables-addons/xtables-addons-2.10.tar.xz - $ tar xf xtables-addons-2.10.tar.xz - $ cd xtables-addons-2.10 - $ ./configure - $ make - $ sudo make install - -Note that for Red Hat based systems (CentOS, RHEL, Fedora) which have SELinux enabled by default, it is necessary to adjust SELinux policy as follows. Otherwise, SELinux will prevent iptables from loading xt_geoip module. - - $ sudo chcon -vR --user=system_u /lib/modules/$(uname -r)/extra/*.ko - $ sudo chcon -vR --type=lib_t /lib64/xtables/*.so - -### Install GeoIP Database for Xtables-addons ### - -The next step is to install GeoIP database which will be used by xt_geoip for IP-to-country mapping. Conveniently, the xtables-addons source package comes with two helper scripts for downloading GeoIP database from MaxMind and converting it into a binary form recognized by xt_geoip. These scripts are found in geoip folder inside the source package. Follow the instructions below to build and install GeoIP database on your system. - - $ cd geoip - $ ./xt_geoip_dl - $ ./xt_geoip_build GeoIPCountryWhois.csv - $ sudo mkdir -p /usr/share/xt_geoip - $ sudo cp -r {BE,LE} /usr/share/xt_geoip - -According to [MaxMind][5], their GeoIP database is 99.8% accurate on a country-level, and the database is updated every month. To keep the locally installed GeoIP database up-to-date, you want to set up a monthly [cron job][6] to refresh the local GeoIP database as often. - -### Block Network Traffic Originating from or Destined to a Country ### - -Once xt_geoip module and GeoIP database are installed, you can immediately use the geoip match options in iptables command. - - $ sudo iptables -m geoip --src-cc country[,country...] --dst-cc country[,country...] - -Countries you want to block are specified using [two-letter ISO3166 code][7] (e.g., US (United States), CN (China), IN (India), FR (France)). - -For example, if you want to block incoming traffic from Yemen (YE) and Zambia (ZM), the following iptables command will do. - - $ sudo iptables -I INPUT -m geoip --src-cc YE,ZM -j DROP - -If you want to block outgoing traffic destined to China (CN), run the following command. - - $ sudo iptables -A OUTPUT -m geoip --dst-cc CN -j DROP - -The matching condition can also be "negated" by prepending "!" to "--src-cc" or "--dst-cc". For example: - -If you want to block all incoming non-US traffic on your server, run this: - - $ sudo iptables -I INPUT -m geoip ! --src-cc US -j DROP - -![](https://c2.staticflickr.com/6/5654/23665427845_050241b03f_c.jpg) - -#### For Firewall-cmd Users #### - -Some distros such as CentOS/RHEL 7 or Fedora have replaced iptables with firewalld as the default firewall service. On such systems, you can use firewall-cmd to block traffic using xt_geoip similarly. The above three examples can be rewritten with firewall-cmd as follows. - - $ sudo firewall-cmd --direct --add-rule ipv4 filter INPUT 0 -m geoip --src-cc YE,ZM -j DROP - $ sudo firewall-cmd --direct --add-rule ipv4 filter OUTPUT 0 -m geoip --dst-cc CN -j DROP - $ sudo firewall-cmd --direct --add-rule ipv4 filter INPUT 0 -m geoip ! --src-cc US -j DROP - -### Conclusion ### - -In this tutorial, I presented iptables/xt_geoip which is an easy way to filter network packets based on their source/destination countries. This can be a useful arsenal to deploy in your firewall system if needed. As a final word of caution, I should mention that GeoIP-based traffic filtering is not a foolproof way to ban certain countries on your server. GeoIP database is by nature inaccurate/incomplete, and source/destination geography can easily be spoofed using VPN, Tor or any compromised relay hosts. Geography-based filtering can even block legitimate traffic that should not be banned. Understand this limitation before you decide to deploy it in your production environment. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/block-network-traffic-by-country-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://www.archlinux.org/news/dropping-tcp_wrappers-support/ -[2]:http://xmodulo.com/block-unwanted-ip-addresses-linux.html -[3]:http://xtables-addons.sourceforge.net/geoip.php -[4]:http://xtables-addons.sourceforge.net/ -[5]:https://support.maxmind.com/geoip-faq/geoip2-and-geoip-legacy-databases/how-accurate-are-your-geoip2-and-geoip-legacy-databases/ -[6]:http://ask.xmodulo.com/add-cron-job-linux.html -[7]:https://en.wikipedia.org/wiki/ISO_3166-1 diff --git a/translated/tech/20151215 How to block network traffic by country on Linux.md b/translated/tech/20151215 How to block network traffic by country on Linux.md new file mode 100644 index 0000000000..5d04b20a2b --- /dev/null +++ b/translated/tech/20151215 How to block network traffic by country on Linux.md @@ -0,0 +1,110 @@ +如何在 Linux 中根据国家位置来阻断网络流量 +================================================================================ +作为一名维护 Linux 生产服务器的系统管理员,你可能会遇到这样一些情形:你需要 **根据地理位置,选择性地阻断或允许网络流量通过。** 例如你正经历一次由注册在某个特定国家的 IP 发起的 DoS 攻击;或者基于安全考虑,你想阻止来自未知国家的 SSH 登陆请求;又或者你的公司对某些在线视频有分销权,它要求只能合法地在特定的国家内发行;抑或是由于公司的政策,你需要阻止任意一个本地主机将文件上传至任意一个非美国的远程云端存储。 + +所有的上述情形都需要设置防火墙,使之具有 **过滤基于国家位置的流量** 的功能。有几个方法可以做到这一点,其中之一是你可以使用 TCP wrappers 来为个人应用(例如 SSH,NFS, httpd)设置有条件的阻塞。但其缺点是你想要保护的那个应用必须以支持 TCP wrappers 的方式构建。另外,TCP wrappers 并不总是能够在各个平台中获取到(例如,Arch Linux [放弃了][2]对它的支持)。另一种方式是结合基于国家的 GeoIP 信息,设置 [ipset][3],并将它应用到 iptables 的规则中。后一种方式看起来更有希望一些,因为基于 iptables 的过滤器是与应用无关的,且容易设置。 + +在本教程中,我将展示 **另一个基于 iptables 的 GeoIP 过滤器,它由 xtables-addons 来实现**。对于那些不熟悉它的人来说, xtables-addons 是针对 netfilter/iptables 的一系列扩展。一个包含在 xtables-addons 中的名为 xt_geoip 的模块扩展了 netfilter/iptables 的功能,使得它可以根据流量来自或流向的国家来进行过滤,IP 掩蔽(NAT) 或丢包。若你想使用 xt_geoip,你不必重新编译内核或 iptables,你只需要使用当前的内核构建环境(/lib/modules/`uname -r`/build) 以模块的形式构建 xtables-addons。同时也不需要进行重启。只要你构建并安装了 xtables-addons , xt_geoip 便能够配合 iptables 使用。 + +至于 xt_geoip 和 ipset 之间的比较,[xtables-addons 的官方网站][3] 上是这么说的: 相比于 ipset,xt_geoip 在内存占用上更胜一筹,但对于匹配速度,基于哈希的 ipset 可能更有优势。 + +在教程的余下部分,我将展示 ** 如何使用 iptables/xt_geoip 来根据流量的来源地或流入的国家阻断网络流量 **。 + +### 在 Linux 中安装 xtables-addons ### + +下面介绍如何在各种 Linux 平台中编译和安装 xtables-addons。 + +为了编译 xtables-addons,首先你需要安装一些依赖软件包。 + +#### 在 Debian,Ubuntu 或 Linux Mint 中安装依赖 #### + + $ sudo apt-get install iptables-dev xtables-addons-common libtext-csv-xs-perl pkg-config + +#### 在 CentOS,RHEL 或 Fedora 中安装依赖 #### + +CentOS/RHEL 6 需要事先设置好 EPEL 仓库(为 perl-Text-CSV_XS 所需要)。 + + $ sudo yum install gcc-c++ make automake kernel-devel-`uname -r` wget unzip iptables-devel perl-Text-CSV_XS + +#### 编译并安装 xtables-addons #### + +从 `xtables-addons` 的[官方网站][4] 下载源码包,然后按照下面的指令编译安装它。 + + $ wget http://downloads.sourceforge.net/project/xtables-addons/Xtables-addons/xtables-addons-2.10.tar.xz + $ tar xf xtables-addons-2.10.tar.xz + $ cd xtables-addons-2.10 + $ ./configure + $ make + $ sudo make install + +需要注意的是,对于基于红帽的系统(CentOS, RHEL, Fedora),它们默认开启了 SELinux,所以有必要像下面这样调整 SELinux 的策略。否则,SELinux 将阻止 iptables 加载 xt_geoip 模块。 + + $ sudo chcon -vR --user=system_u /lib/modules/$(uname -r)/extra/*.ko + $ sudo chcon -vR --type=lib_t /lib64/xtables/*.so + +### 为 xtables-addons 安装 GeoIP 数据库 ### + +下一步是安装 GeoIP 数据库,它将被 xt_geoip 用来查询 IP 地址与国家地区之间的对应关系。方便的是,`xtables-addons` 的源码包中带有两个帮助脚本,它们被用来从 MaxMind 下载 GeoIP 数据库并将它转化为 xt_geoip 可识别的二进制形式文件;而它们可以在源码包中的 geoip 目录下找到。请遵循下面的指导来在你的系统中构建和安装 GeoIP 数据库。 + + $ cd geoip + $ ./xt_geoip_dl + $ ./xt_geoip_build GeoIPCountryWhois.csv + $ sudo mkdir -p /usr/share/xt_geoip + $ sudo cp -r {BE,LE} /usr/share/xt_geoip + +根据 [MaxMind][5] 的说明,他们的 GeoIP 数据库能够以 99.8% 的准确率识别出 ip 所对应的国家,并且每月这个数据库将进行更新。为了使得本地安装的 GeoIP 数据是最新的,或许你需要设置一个按月执行的 [cron job][6] 来时常更新你本地的 GeoIP 数据库。 + +### 阻断来自或流向某个国家的网络流量 ### + +一旦 xt_geoip 模块和 GeoIP 数据库安装好后,你就可以在 iptabels 命令中使用 geoip 的匹配选项。 + + $ sudo iptables -m geoip --src-cc country[,country...] --dst-cc country[,country...] + +你想要阻断流量的那些国家是使用[2个字母的 ISO3166 代码][7] 来特别指定的(例如 US(美国)、CN(中国)、IN(印度)、FR(法国))。 + +例如,假如你想阻断来自也门(YE) 和 赞比亚(ZM) 的流量,下面的 iptabels 命令便可以达到此目的。 + + $ sudo iptables -I INPUT -m geoip --src-cc YE,ZM -j DROP + +假如你想阻断流向中国(CN) 的流量,可以运行下面的命令: + + $ sudo iptables -A OUTPUT -m geoip --dst-cc CN -j DROP + +匹配条件也可以通过在 "--src-cc" 或 "--dst-cc" 选项前加 "!" 来达到相反的目的: + +假如你想在你的服务器上阻断来自所有非美国的流量,可以运行: + + $ sudo iptables -I INPUT -m geoip ! --src-cc US -j DROP + +![](https://c2.staticflickr.com/6/5654/23665427845_050241b03f_c.jpg) + +#### 对于使用 Firewall-cmd 的用户 #### + +某些发行版本例如 CentOS/RHEL7 或 Fedora 已经用 firewalld 替代了 iptables 来作为默认的防火墙服务。在这些系统中,你可以类似使用 xt_geoip 那样,使用 firewall-cmd 来阻断流量。利用 firewall-cmd 命令,上面的三个例子可被重新写为: + + $ sudo firewall-cmd --direct --add-rule ipv4 filter INPUT 0 -m geoip --src-cc YE,ZM -j DROP + $ sudo firewall-cmd --direct --add-rule ipv4 filter OUTPUT 0 -m geoip --dst-cc CN -j DROP + $ sudo firewall-cmd --direct --add-rule ipv4 filter INPUT 0 -m geoip ! --src-cc US -j DROP + +### 总结 ### + +在本教程中,我展示了使用 iptables/xt_geoip 来根据流量的来源地或流入的国家轻松地阻断网络流量。假如你有这方面的需求,把它部署到你的防火墙系统中可以使之成为一个实用的办法。作为最后的警告,我应该提醒你的是:在你的服务器上通过基于 GeoIP 的流量过滤来禁止特定国家的流量并不总是万无一失的。GeoIP 数据库本身就不是很准确或齐全,且流量的来源或目的地可以轻易地通过使用 VPN、Tor 或其他任意易受攻击的中继主机来达到欺骗的目的。基于地理位置的过滤器甚至可能会阻止本不该阻止的合法网络流量。在你决定把它部署到你的生产环境之前请仔细考虑这个限制。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/block-network-traffic-by-country-linux.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]:https://www.archlinux.org/news/dropping-tcp_wrappers-support/ +[2]:http://xmodulo.com/block-unwanted-ip-addresses-linux.html +[3]:http://xtables-addons.sourceforge.net/geoip.php +[4]:http://xtables-addons.sourceforge.net/ +[5]:https://support.maxmind.com/geoip-faq/geoip2-and-geoip-legacy-databases/how-accurate-are-your-geoip2-and-geoip-legacy-databases/ +[6]:http://ask.xmodulo.com/add-cron-job-linux.html +[7]:https://en.wikipedia.org/wiki/ISO_3166-1 From c51521e1157dc1e7a402b18adf719411d145c6ff Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 13 Jan 2016 09:37:19 +0800 Subject: [PATCH 0205/1469] PUB:20160111 Open Source DJ Software Mixxx Version 2.0 Released MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @name1e5s 要尽量忠实原文,如果原文有误,可以注明。 --- ... DJ Software Mixxx Version 2.0 Released.md | 75 +++++++++++++++++++ ... DJ Software Mixxx Version 2.0 Released.md | 75 ------------------- 2 files changed, 75 insertions(+), 75 deletions(-) create mode 100644 published/20160111 Open Source DJ Software Mixxx Version 2.0 Released.md delete mode 100644 translated/share/20160111 Open Source DJ Software Mixxx Version 2.0 Released.md diff --git a/published/20160111 Open Source DJ Software Mixxx Version 2.0 Released.md b/published/20160111 Open Source DJ Software Mixxx Version 2.0 Released.md new file mode 100644 index 0000000000..972d52e035 --- /dev/null +++ b/published/20160111 Open Source DJ Software Mixxx Version 2.0 Released.md @@ -0,0 +1,75 @@ +开源 DJ 软件 Mixxx 2.0 版发布 +================================================================================ +![](http://itsfoss.com/wp-content/uploads/2016/01/DJ-Software-Mixxx-2-Released.jpg) + +时隔三年,开源 DJ 混音软件 [Mixxx][1] 再度发布一个大的版本更新----Mixxx 2.0。 + +Mixxx 是一个跨平台的自由、开源的 DJ 混音软件,它几乎提供了当你想自己混音时需要的一切功能。Mixxx 近几年在专业人士以及业余爱好者中都很火。 + +甚至在 Mixxx 中你能使用你的 iTunes 音乐库。它的强有力的引擎使它支持多种文件格式。Mixxx 默认即支持超过85种MIDI DJ 调节器以及少部分 HID 调节器。它也包含一个自动选项,可以让你在混音时休息一下。 + +Mixxx 的完整功能列表可以在[这里][2]找到。在查看完整列表之前,让我们看看最新版有何更新。 + +### Mixxx 2.0更新 ### + +- 可动态调整大小的外观 +- 4 轨道混音并且和主轨道同步 +- 内置特效 +- 谐波混频(Harmonic Mixing)与音乐按键检测 +- RGB 音频波形 +- 4 个麦克风输入和 4 个音频输入,麦克风音量可调 +- 黑胶音源输入、输出 +- 支持自定义封面 +- 核心混音引擎改进 +- 更新的音乐库 +- 改进增强了 DJ 调节器 + +你可以在[这里][3]中看到所有的新功能。 + +### 在基于 Ubuntu 的发行版中安装 Mixxx 2.0 ### + +Mixxx 提供了他们自己的ppa源,这使得在基于 Ubuntu 的发行版,如 Linux Mint、elementary OS、 Zorin OS 上安装Mixxx 2.0 变得十分简单. + +打开终端,并输入如下命令: + + sudo add-apt-repository ppa:mixxx/mixxx + sudo apt-get update + sudo apt-get install mixxx + +使用如下命令卸载 Mixxx: + + sudo apt-get remove mixxx + sudo add-apt-repository --remove ppa:mixxx/mixxx + +如果你已经在使用旧版本的 Mixxx。它将很快升级到2.0版。 + +### 在其他发行版中安装 Mixxx 2.0 ### + +Archliunx + + sudo pacman -S mixxx + +对于其他发行版,你还可以从源码编译安装 Mixxx。从下列地址下载源代码: + +- [源码地址][4] + +由于 Mixxx 是个跨平台的应用,你也可以下载它的 Windows 版或者 Mac OS 版,请访问 Mixxx 下载页面找到对应的下载链接: + +- [下载地址][5] + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/dj-mixxx-2/ + +作者:[Abhishek][a] +译者:[name1e5s](https://github.com/name1e5s) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://mixxx.org/ +[2]:http://mixxx.org/features/ +[3]:http://mixxx.org/whats-new-in-mixxx-2-0/ +[4]:http://downloads.mixxx.org/mixxx-2.0.0/mixxx-2.0.0-src.tar.gz +[5]:http://mixxx.org/download/ diff --git a/translated/share/20160111 Open Source DJ Software Mixxx Version 2.0 Released.md b/translated/share/20160111 Open Source DJ Software Mixxx Version 2.0 Released.md deleted file mode 100644 index d5cf9d998d..0000000000 --- a/translated/share/20160111 Open Source DJ Software Mixxx Version 2.0 Released.md +++ /dev/null @@ -1,75 +0,0 @@ -开源Dj软件Mixxx 2.0版发布 -================================================================================ -![](http://itsfoss.com/wp-content/uploads/2016/01/DJ-Software-Mixxx-2-Released.jpg) - -时隔三年,开源Dj混音软件[Mixxx][1]再度发布一个大的版本更新----Mixxx 2.0. - -Mixxx是一个跨平台的免费开源的Dj混音软件,它几乎提供了当你想自己混音时需要的一切功能.Mixxx近几年在专业人士以及业余爱好者中都很火. - -在Mixxx中你能使用你的iTunes音乐库.它的强有力的引擎使它支持多种文件格式.Mixxx默认即支持超过85种MIDI Dj调节器以及少部分HID调节器.它也包含一个自动选项,可以让你在混音时休息一下. - -Mixxx的完整功能列表可以在[这里][2]找到.在查看完整列表之前,让我们看看最新版有何更新. - -### Mixxx 2.0更新 ### - -- 可自定义的用户界面 -- 4 轨道混音并且和主轨道同步 -- 内置特效 -- 谐波混频与音乐按键检测 -- RGB 音频波形 -- 4 个麦克风输入和 4 个音频输出 -- 黑胶音源输入、输出 -- 支持自定义封面 -- 核心升级 -- 升级库文件 -- 更先进的Dj 调节器 - -你可以在[这里][3]中看到所有的新功能. - -### 在基于Ubuntu的发行版中安装Mixxx 2.0 ### - -Mixxx提供了他们自己的ppa源,这使得在在基于Ubuntu的发行版----如Linux Mint, elementary OS, Zorin OS----安装Mixxx 2.0变得十分简单. - -打开终端,并输入如下命令: - - sudo add-apt-repository ppa:mixxx/mixxx - sudo apt-get update - sudo apt-get install mixxx - -使用如下命令卸载Mixxx: - - sudo apt-get remove mixxx - sudo add-apt-repository --remove ppa:mixxx/mixxx - -如果你使用老版本的Mixxx.它将很快升级到2.0版. - -### 在其他发行版中安装Mixxx 2.0 ### - -Archliunx - - sudo pacman -S mixxx - -对于其他发行版,你可以从源码编译安装Mixxx. - -- [源码地址][4] - -由于Mixxx是个跨平台的应用,你也可以下载它的Windows版或者Mac OS 版 - -- [下载地址][5] - --------------------------------------------------------------------------------- - -via: http://itsfoss.com/dj-mixxx-2/ - -作者:[Abhishek][a] -译者:[name1e5s](https://github.com/name1e5s) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://itsfoss.com/author/abhishek/ -[1]:http://mixxx.org/ -[2]:http://mixxx.org/features/ -[3]:http://mixxx.org/whats-new-in-mixxx-2-0/ -[4]:http://downloads.mixxx.org/mixxx-2.0.0/mixxx-2.0.0-src.tar.gz -[5]:http://mixxx.org/download/ From 53d7ac0c9e944cc0364fb2a258e242696e7c8c94 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 13 Jan 2016 09:42:46 +0800 Subject: [PATCH 0206/1469] PUB:20151215 Fix--Cannot establish FTP connection to an SFTP server @geekpi --- ...ablish FTP connection to an SFTP server.md | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) rename {translated/tech => published}/20151215 Fix--Cannot establish FTP connection to an SFTP server.md (52%) diff --git a/translated/tech/20151215 Fix--Cannot establish FTP connection to an SFTP server.md b/published/20151215 Fix--Cannot establish FTP connection to an SFTP server.md similarity index 52% rename from translated/tech/20151215 Fix--Cannot establish FTP connection to an SFTP server.md rename to published/20151215 Fix--Cannot establish FTP connection to an SFTP server.md index 79e26abd64..02ce43fcf4 100644 --- a/translated/tech/20151215 Fix--Cannot establish FTP connection to an SFTP server.md +++ b/published/20151215 Fix--Cannot establish FTP connection to an SFTP server.md @@ -1,8 +1,9 @@ -修复:无法与SFTP服务器建立FTP连接 +错误:无法与 SFTP 服务器建立 FTP 连接 ================================================================================ + ### 问题 ### -有一天我要连接到我的web服务器。我使用[FileZilla][1]连接到FTP服务器。当我输入主机名和密码后来连接服务器后,我得到了下面的错误。 +有一天我要连接到我的 web 服务器。我使用 [FileZilla][1] 连接到 FTP 服务器。当我输入主机名和密码连接服务器后,我得到了下面的错误。 > Error: Cannot establish FTP connection to an SFTP server. Please select proper protocol. > @@ -12,25 +13,25 @@ ### 原因 ### -看见错误信息后我意识到了我的错误。我尝试与一台SFTP服务器建立一个[FTP][2]连接。很明显我没有使用一个正确的协议(应该是SFTP而不是FTP)。 +看见错误信息后我意识到了我的错误是什么。我尝试与一台 **SFTP** 服务器建立一个 **[FTP][2]** 连接。很明显我没有使用一个正确的协议(应该是SFTP而不是FTP)。 -如你在上图所见,FileZilla默认使用的是FTP协议。 +如你在上图所见,FileZilla 默认使用的是FTP协议。 -### 解决“Cannot establish FTP connection to an SFTP server”的方案 ### +### 解决 “Cannot establish FTP connection to an SFTP server” 的方案 ### -解决方案很简单。使用SFTP协议而不是FTP。一个你或许要面对的问题是把协议修改成SFTP。这就是我要帮助你的。 +解决方案很简单。使用 SFTP 协议而不是 FTP。你要做的就是把协议修改成 SFTP。这就是我要告诉你的。 -再FileZilla菜单中,进入 **文件->站点管理**. +在 FileZilla 菜单中,进入 **文件->站点管理**。 ![FileZilla Site Manager](http://itsfoss.com/wp-content/uploads/2015/12/FileZilla_FTP_SFTP_Problem_2.jpeg) -在站点管理中,进入通用选项并选择SFTP协议。同样填上主机、端口号、用户密码等。 +在站点管理中,进入通用选项并选择 SFTP 协议。同样填上主机、端口号、用户密码等。 ![Cannot establish FTP connection to an SFTP server](http://itsfoss.com/wp-content/uploads/2015/12/FileZilla_FTP_SFTP_Problem_3.png) -我希望你从这里可以开始处理。 +我希望你从这里可以开始工作了。 -我希望本篇教程可以帮助你修复“Cannot establish FTP connection to an SFTP server. Please select proper protocol.”这个问题。在相关的文章中,你可以读[了解在Linux中如何设置FTP][4]。 +我希望本篇教程可以帮助你修复 “Cannot establish FTP connection to an SFTP server. Please select proper protocol.”这个问题。在相关的文章中,你可以读[了解在 Linux 中如何设置 FTP][4]。 -------------------------------------------------------------------------------- @@ -38,7 +39,7 @@ via: http://itsfoss.com/fix-establish-ftp-connection-sftp-server/ 作者:[Abhishek][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 52feca56f95055ad3711e35e0aa70fd7eef257be Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 13 Jan 2016 14:10:22 +0800 Subject: [PATCH 0207/1469] =?UTF-8?q?=E6=9B=B4=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...111 Ubuntu-‘Spyware’-Will-Be-Disabled-In-Ubuntu-16.04-LTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20160111 Ubuntu-‘Spyware’-Will-Be-Disabled-In-Ubuntu-16.04-LTS.md b/published/20160111 Ubuntu-‘Spyware’-Will-Be-Disabled-In-Ubuntu-16.04-LTS.md index ed6addfde7..e1824fe0e6 100644 --- a/published/20160111 Ubuntu-‘Spyware’-Will-Be-Disabled-In-Ubuntu-16.04-LTS.md +++ b/published/20160111 Ubuntu-‘Spyware’-Will-Be-Disabled-In-Ubuntu-16.04-LTS.md @@ -25,7 +25,7 @@ Ubuntu 里的“间谍软件”将在 Ubuntu 16.04 LTS 中被禁用 [电子前哨基金会 (EFF)][2]也在一系列博文中表达出对此的关注,并且建议 Canonical 将这个功能做成用户自由选择是否开启的功能。Privacy International 比其他的组织走的更远,对于 Ubuntu 的工作,他们给 Ubuntu 的缔造者发了一个“[老大哥奖][3]”。 -[Canonical][4] 坚称] Unity 的在线搜索功能所收集的数据是匿名的以及“不可识别是来自哪个用户的”。 +[Canonical][4] 坚称 Unity 的在线搜索功能所收集的数据是匿名的以及“不可识别是来自哪个用户的”。 在[2013年 Canoical 发布的博文中][5]他们解释道:“**(我们)会使用户了解我们收集哪些信息以及哪些第三方服务商将会在他们搜索时从 Dash 栏中给出结果。我们只会收集能够提升用户体验的信息。**” From 94627800ec28a8c0783091947ef85a096cb816de Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 13 Jan 2016 14:10:59 +0800 Subject: [PATCH 0208/1469] PUB:20151012 Remember sed and awk All Linux admins should MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Bestony 翻译的不错 --- ...ber sed and awk All Linux admins should.md | 66 ++++++++++++++++++ ...ber sed and awk All Linux admins should.md | 69 ------------------- 2 files changed, 66 insertions(+), 69 deletions(-) create mode 100644 published/20151012 Remember sed and awk All Linux admins should.md delete mode 100644 translated/tech/20151012 Remember sed and awk All Linux admins should.md diff --git a/published/20151012 Remember sed and awk All Linux admins should.md b/published/20151012 Remember sed and awk All Linux admins should.md new file mode 100644 index 0000000000..346557684b --- /dev/null +++ b/published/20151012 Remember sed and awk All Linux admins should.md @@ -0,0 +1,66 @@ +sed 和 awk,所有的 Linux 管理员都应该会的技能! +========================== + +![](http://images.techhive.com/images/article/2015/03/linux-100573790-primary.idge.jpg) + +*图片来源: Shutterstock* + +**我们不要让下一代 Linux 和 Unix 的管理员忘记初始化脚本和基本工具的好处** + +我曾经有一次在 Reddit 看到一个帖子,“[请问如何操作文本文件][1]”。这是一个很简单的需求,就像我们常用 Unix 的人每天遇到的一样。他的问题是,如何删除文件中的重复行,只保留不重复的。 这听起来似乎很简单,但是当文件足够大时,就会有些复杂。 + +这个问题有很多种不同的答案。你可以使用几乎任何一种语言来写这样的一个脚本,只是时间的投入和代码的复杂性不同罢了。根据你的个人水平,它大概会花费20-60分钟。但是如果你使用了 Perl、Python、Ruby 中的一种,你可能很快实现它。 + +或者你可以使用下面的一个方法,让你无比暖心的: 只用 awk。 + +这个答案是迄今为止最简明、最简单的解决问题的方法。它只要一行! + +``` +awk '!seen[$0]++' +``` + +让我们来看看发生了什么: + +在这个命令中,其实隐藏了很多代码。awk 是一种文本处理语言,并且它内部有很多预设。首先,你看到的实际上是一个 for 循环的结果。awk 假定你想通过循环处理输入文件的每一行,所以你不需要明确的去指定它。awk 还假定了你需要打印输出处理后的数据,所以你也不需要去指定它。最后,awk 假定循环在最后一句指令执行完结束,这一块也不再需要你去指定它。 + +这个例子中的字符串 seen 是一个关联数组的名字。$0 是一个变量,表示整个当前行。所以,这个命令翻译成人类语言就是“对这个文件的每一行进行检查,如果你之前没有见过它,就打印出来。” 如果该关联数组的键名还不存在就添加到数组,并增加其取值,这样 awk 下次遇到同样的行时就会不匹配(条件判断为“假”),从而不打印出来。 + +一些人认为这样是优雅的,另外的人认为这可能会造成混淆。任何在日常工作上使用 awk 的都是第一类人。awk 就是设计用来做这个的。在 awk 中,你可以写多行代码。你甚至可以[用 awk 写一些让人不安的复杂功能][2]。但终究来说,awk 还是一个进行文本处理的程序,一般是通过管道。去掉(没必要的)循环定义是很常见的快捷用法,不过如果你乐意,你也可以用下面的代码做同样的事情: + + +``` +awk '{ if (!seen[$0]) print $0; seen[$0]++ }’ +``` + +这会产生相同的结果。 + +awk 是完成这项工作的完美工具。不过,我相信很多管理员--特别是新管理员会转而使用 [Bash][3] 或 Python 来完成这一任务,因为对 awk 的知识和对它的能力的了解看起来随着时间而慢慢被人淡忘。我认为这是标志着一个问题,由于对之前的解决方案缺乏了解,那些已经解决了几十年的问题又突然出现了。 + +shell、grep、sed 和 awk 是 Unix 的基础。如果你不能非常轻松的使用它们,你将会被自己束缚住,因为它们构成了通过命令行和脚本与 Unix 系统交互的基础。学习这些工具如何工作最好的方法之一就是观察真实的例子和实验,你可以在各种 Unix 衍生系统的初始化系统中找到很多,但在 Linux 发行版中它们已经被 [systemd][4] 取代了。 + +数以百万计的 Unix 管理员了解 Shell 脚本和 Unix 工具如何读、写、修改和用在初始化脚本上。不同系统的初始化脚本有很大不同,甚至是不同的 Linux 发行版也不同。但是它们都源自 sh,而且它们都用像 sed、awk 还有 grep 这样的核心的命令行工具。 + +我每天都会听到很多人抱怨初始化脚本太“古老”而且很“难”。但是实际上,初始化脚本和 Unix 管理员每天使用的工具一样,还提供了一个非常好的方式来更加熟悉和习惯这些工具。说初始化脚本难于阅读和难于使用实际上是承认你缺乏对 Unix 基础工具的熟悉。 + +说起在 Reddit 上看到的内容,我也碰到过这个问题,来自一个新入行的 Linux 系统管理员, “[问他是否应该还要去学老式的初始化系统 sysvinit][5]”。 这个帖子的大多数的答案都是正面的——是的,应该学习 sysvinit 和 systemd 两个。一位评论者甚至指出,初始化脚本是学习 Bash 的好方法。而另一个消息是,Fortune 50 强的公司还没有计划迁移到以 systemd 为基础的发行版上。 + +但是,这提醒了我这确实是一个问题。如果我们继续沿着消除脚本和脱离操作系统核心组件的方式发展下去,由于疏于接触,我们将会不经意间使新管理员难于学习基本的 Unix 工具。 + +我不知道为什么有些人想在一层又一层的抽象化来掩盖 Unix 内部,但是这样发展下去可能会让新一代的系统管理员们变成只会按下按钮的工人。我觉得这不是一件好事情。 + +------ + +via: http://www.infoworld.com/article/2985804/linux/remember-sed-awk-linux-admins-should.html + +作者:[Paul Venezia][a] +译者:[Bestony](https://github.com/Bestony) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.infoworld.com/author/Paul-Venezia/ +[1]: https://www.reddit.com/r/linuxadmin/comments/3lwyko/how_do_i_remove_every_occurence_of_duplicate_line/ +[2]: http://intro-to-awk.blogspot.com/2008/08/awk-more-complex-examples.html +[3]: http://www.infoworld.com/article/2613338/linux/linux-how-to-script-a-bash-crash-course.html +[4]: http://www.infoworld.com/article/2608798/data-center/systemd--harbinger-of-the-linux-apocalypse.html +[5]: https://www.reddit.com/r/linuxadmin/comments/3ltq2y/when_i_start_learning_about_linux_administration/ diff --git a/translated/tech/20151012 Remember sed and awk All Linux admins should.md b/translated/tech/20151012 Remember sed and awk All Linux admins should.md deleted file mode 100644 index 7117e9f06d..0000000000 --- a/translated/tech/20151012 Remember sed and awk All Linux admins should.md +++ /dev/null @@ -1,69 +0,0 @@ - -# 学会Sed和Awk? 所有的Linux管理员都应该会的技能 - -![](http://images.techhive.com/images/article/2015/03/linux-100573790-primary.idge.jpg) - -图片来源: Shutterstock - -**我们不希望下一代Linux和Unix的管理员忘记任何初始化脚本和基本工具的好处** - -我曾经有一次在Reddit发表文章的机会, [asking about textfile manipulation][1].这是一个很简单请求,就像我们平时常用Unix的人所见到的。他的问题是,如何删除文件中的重复行,并保存在独立的实例里。 这听起来似乎很简单,但是当文件足够大时,就会有些复杂。 - -这个问题有很多种不同的答案。我怀疑你可以使用几乎任何一种语言来写这样的一个脚本,只是时间的投入和代码的复杂性不同罢了。根据你的个人水平,它大概会花费20-60分钟。但是如果你使用了Perl,Python,Ruby中的一种,你可能很快实现它。 - -或者你可以使用下面的一个方法,让你无比暖心的: 只用 awk. - -这个答案是迄今为止最简明、最简单的解决问题的方法。他只要一行: - -``` -awk '!seen[$0]++' . -``` - -让我们来分析一下 - -在这段代码中,其实隐藏了很多代码。AWK是一种文本处理语言,并且他内部做了大量的假设。首先,你看到的实际上是一个循环的结果。Awk假定你想通过循环输入文件的每一行,所以你不需要明确的去设定它。Awk还假定了你需要打印数据的输出,所以你也不需要去指定它。最好,Awk假定循环在最后一句话执行完结束,这一块也不再需要你去指定它 - -这个例子中看到的字符串是一个关联的数组的名字。$0是一个变量,表示当前行的全部。所以,这个命令翻译成话就是“对这个文件的每一行进行检查,如果你之前没有见过他,就打印出来。”Awk通过做这些来看这个数组是否早已存在或值不相等的,这样就不匹配参数,下次就不会再打印了。 - -一些人认为这样是优雅的,另外的人认为这可能会造成混淆。任何在日常基础事情上使用Awk的都是第一类人。Awk就是被设计做这个的。在Awk中,你可以写多行。甚至是一些复杂的功能。你甚至可以[用awk写一些让人不安的复杂功能][2]。但,最终,Awk还是一个通过管道进行文字处理的程序。去除循环定义的外部缺陷是很常见的用法,你可以用下面的代码做同样的事情 - - - -``` -awk '{ if (!seen[$0]) print $0; seen[$0]++ }’ -``` - -这必将导致相同的结果 - -Awk是完成这项工作的完美工具。不过,我相信很多管理员--特别是新管理员会跳转到[Bash][ 3 ]或Python来完成这一任务,因为Awk的知识和他所能做的事情总是随着时间而褪色。我认为这是一个标识性的事情。几十年来,以前的解决方案总是缺乏对新的问题的处理方法 - -The shell, grep, sed, and awk 是Unix的计算基础.如果你不能非常轻松的使用他们,你将会变得十分脆弱。因为他们通过命令行和脚本的相互作用来实现。学习这些工具如何工作最好的方法之一就是观察和正在运行的范例一起工作,通过Unix系统特有的Init系统,或者在Linux发行版被称为 [systemd][4]. - -数以百万计的Unix管理员了解Shell脚本和Unix工具同读、写、修改和研究Init脚本。不同系统的Init脚本有很大不同,甚至是不同的发行版。但是他们都源自sh,而且他他们都用核心命令行工具像sed,awk还有grep - -我每天都会挺到很多抱怨init脚本太“古老”而且很“难”。但是实际上,Init脚本和Unix管理员每天使用的工具一样,而且还提供了一个非常好的方式来更加熟悉和习惯这些工具。说Init脚本难的应该承认,你缺乏对Unix基础工具的熟悉。 - -说起在Reddit上的事情,我也碰到过这个问题,从一个初露头角的Linux系统管理员, [问他是否应该去学Sysvinit][5]. 大多数的答案都是好的方向--是的,应该学习sysvinit和systemd.一位评论者甚至指出,Init脚本是学习Bash的好方法。而另一个国家50强的公司不会搬到一个以系统为基础的发行版 - -但是,这提醒了我这是一个问题。如果我们继续沿着消除脚本和脱离我们操作系统的系统核心组件。由于出现的太少,我们将会不经意间的使新的管理员学习基本的Unix工具变得更难 - -我不知道为什么有些人想掩盖Unix内核抽象化和反抽象化,但是这样的一条路径可以减少一代Unix管理员出事后对服务支持的依赖。我相信这不是一件好事情。 - ------- - -via: http://www.infoworld.com/article/2985804/linux/remember-sed-awk-linux-admins-should.html - -作者:[Paul Venezia][a] - -译者:[Bestony](https://github.com/Bestony) - -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://www.infoworld.com/author/Paul-Venezia/ -[1]: https://www.reddit.com/r/linuxadmin/comments/3lwyko/how_do_i_remove_every_occurence_of_duplicate_line/ -[2]: http://intro-to-awk.blogspot.com/2008/08/awk-more-complex-examples.html -[3]: http://www.infoworld.com/article/2613338/linux/linux-how-to-script-a-bash-crash-course.html -[4]: http://www.infoworld.com/article/2608798/data-center/systemd--harbinger-of-the-linux-apocalypse.html -[5]: https://www.reddit.com/r/linuxadmin/comments/3ltq2y/when_i_start_learning_about_linux_administration/ From 24eda1cd59fd577e80eb32108768cc303d989d80 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 13 Jan 2016 14:32:07 +0800 Subject: [PATCH 0209/1469] PUB:20151223 How to Use Glances to Monitor System on Ubuntu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @bianjp 翻译的很好,我基本上没动~ --- ... Use Glances to Monitor System on Ubuntu.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) rename {translated/tech => published}/20151223 How to Use Glances to Monitor System on Ubuntu.md (77%) diff --git a/translated/tech/20151223 How to Use Glances to Monitor System on Ubuntu.md b/published/20151223 How to Use Glances to Monitor System on Ubuntu.md similarity index 77% rename from translated/tech/20151223 How to Use Glances to Monitor System on Ubuntu.md rename to published/20151223 How to Use Glances to Monitor System on Ubuntu.md index 46541196a6..08c03efb93 100644 --- a/translated/tech/20151223 How to Use Glances to Monitor System on Ubuntu.md +++ b/published/20151223 How to Use Glances to Monitor System on Ubuntu.md @@ -3,7 +3,7 @@ ![](https://www.maketecheasier.com/assets/uploads/2015/12/glances_featured.jpg) -Glances 是一个跨平台、基于命令行、文本模式的系统监控工具。它是用 Python 编写的,使用 `psutil` 库从系统获取信息。你可以用它来监控 CPU、平均负载、内存、网络接口、磁盘 I/O,文件系统空间利用率、挂载的设备、所有活动进程以及消耗资源最多的进程。Glances 有很多有趣的选项。它的主要特性之一是可以在配置文件中设置阀值(careful[小心]、warning[警告]、critical[致命]),然后它会用不同颜色显示信息以表明系统的瓶颈。 +Glances 是一个用于监控系统的跨平台、基于文本模式的命令行工具。它是用 Python 编写的,使用 `psutil` 库从系统获取信息。你可以用它来监控 CPU、平均负载、内存、网络接口、磁盘 I/O,文件系统空间利用率、挂载的设备、所有活动进程以及消耗资源最多的进程。Glances 有很多有趣的选项。它的主要特性之一是可以在配置文件中设置阀值(careful[小心]、warning[警告]、critical[致命]),然后它会用不同颜色显示信息以表明系统的瓶颈。 ### Glances 的功能 @@ -18,11 +18,11 @@ Glances 是一个跨平台、基于命令行、文本模式的系统监控工具 ### 安装 Glances -Glances 在 Ubuntu 的软件源中,所以安装很简单。执行下面的命令安装 Glances: +Glances 在 Ubuntu 的软件仓库中,所以安装很简单。执行下面的命令安装 Glances: sudo apt-get install glances -(LCTT 译注:若安装后无法正常使用,可考虑使用 pip 安装/升级glances:`sudo pip install --upgrade glances`) +(LCTT 译注:若安装后无法正常使用,可考虑使用 pip 安装/升级 glances:`sudo pip install --upgrade glances`) ### Glances 使用方法 @@ -34,7 +34,7 @@ Glances 在 Ubuntu 的软件源中,所以安装很简单。执行下面的命 ![glances monitor system output](https://www.maketecheasier.com/assets/uploads/2015/12/glances_output1.png) -要退出 Glances 终端,按 ESC 键或 “Ctrl + C”。 +要退出 Glances 终端,按 ESC 键或 `Ctrl + C`。 默认情况下,时间间隔(LCTT 译注:显示数据刷新的时间间隔)是 1s,不过你可以在从终端启动 Glances 时自定义时间间隔。 @@ -46,10 +46,10 @@ Glances 在 Ubuntu 的软件源中,所以安装很简单。执行下面的命 Glances 中不同颜色的含义: -- `绿色`:正常 -- `蓝色`:需要注意 -- `紫色`:警告 -- `红色`:严重 +- `绿色`:正常(OK) +- `蓝色`:小心(careful) +- `紫色`:警告(warning) +- `红色`:致命(critical) 默认设置下,Glances 的阀值设置是:careful=50,warning=70,critical=90。你可以通过 “/etc/glances/” 目录下的默认配置文件 glances.conf 来自定义这些阀值。 @@ -101,7 +101,7 @@ via: https://www.maketecheasier.com/glances-monitor-system-ubuntu/ 作者:[Hitesh Jethva][a] 译者:[bianjp](https://github.com/bianjp) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 18b1d57410dae8d149093bfa8fda0221151eab7f Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 14 Jan 2016 05:55:34 +0800 Subject: [PATCH 0210/1469] PUB:20150921 14 tips for teaching open source development @GHLandy --- ...ps for teaching open source development.md | 41 ++++++++++--------- 1 file changed, 21 insertions(+), 20 deletions(-) rename {translated/talk => published}/20150921 14 tips for teaching open source development.md (55%) diff --git a/translated/talk/20150921 14 tips for teaching open source development.md b/published/20150921 14 tips for teaching open source development.md similarity index 55% rename from translated/talk/20150921 14 tips for teaching open source development.md rename to published/20150921 14 tips for teaching open source development.md index e1c340ba95..2d5cfaf302 100644 --- a/translated/talk/20150921 14 tips for teaching open source development.md +++ b/published/20150921 14 tips for teaching open source development.md @@ -1,42 +1,43 @@ - -开源代码开发的十四点教学技巧 +在大学培养学生们参与开源代码开发的十四个技巧 ================================================================================ -对于培养和塑造开源代码开发者,Academia就是一个很好的平台。研究中发现,我们偶尔会开源自己编写的软件。这样做有两个理由,一是为了提升自己编写的工具使用率,二是为了了解人们使用这些工具时会遇到哪些问题。在这样一个编写研究软件的背景下,我的任务就是为 Bradford 大学重新设计二年级的软件工程课程。 +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/education/EDU_TeachingOS.png) -这是一个巨大的挑战,因为我所面对的 80 个学生是来自不同专业的,包括 IT、商务计算和软件工程,这些学生将要在一起上课。最有难度的是,需要和这些编程经验差距很大的学生一起编写代码。按照传统,该课程允许学生选择自己的小组,然后给他们布置构建一个存储数据库系统构的任务,最后提交报告作为评估的一部分。 +学术界是培养和塑造未来的开源开发者的最佳平台。研究中发现,我们偶尔会开源自己编写的软件。这样做有两个理由,一是为了推广自己编写的工具的使用,二是为了了解人们使用这些工具时会遇到哪些问题。在这样一个编写研究软件的背景下,我的任务就是为 Bradford 大学重新设计二年级的本科软件工程课程。 -而我决定重新设计课程,让学生了解现实中的软件团队是如何协作的过程。根据学生的专业和编程技能,我将他们分为五六个人一组。这是为了确保每个小组的整体水平相当,避免小组之间的不公平。 +这是一个挑战,因为我所面对的 80 个学生是来自不同专业的,包括 IT、商务计算和软件工程,这些学生将要在一起上课。最有难度的是,需要和这些编程经验差距很大的学生一起编写代码。按照传统,该课程允许学生选择自己的小组,然后给他们布置构建一个加油站数据库系统的任务,最后提交报告作为评估的一部分。 + +而我决定重新设计课程,让学生了解现实中的软件团队是如何协作的过程。根据学生的专业和编程技能,我将他们分为五、六个人一组。这是为了确保每个小组的整体水平相当,避免小组之间的不等。 ### 核心课程 ### -课程的形式升级为文化课和实践课两项结合在一起。然而实践部分只是充当辅助,主要是老师监督各个小组的实践进度以及他们如何处理客户和产品之间的关系。传统的教学方式由项目管理、软件测试、工程需求分析以及类似主题的讲座组成,再辅以实践和导师会议。这些会议可以很好的考核学生的水平以及检测出他们是否可以跟得上我们在讲座部分中的软件工程方法。本年的教学主题包括以下内容: +课程的形式改为讲座和实践课两项结合在一起。然而实践课作为指导过程,主要是老师监督各个小组的实践进度以及他们如何处理客户和产品之间的关系。而传统的教学方式由项目管理、软件测试、工程需求分析以及类似主题的讲座组成,再辅以实践和导师会议。这些会议可以很好的考核学生的水平以及检测出他们是否可以跟得上我们在讲座部分中的软件工程方法。本年的教学主题包括以下内容: - 工程需求分析 - 如何与客户及其他团队成员互动 - 程序设计方法,如敏捷和极限编程方法 - 如何通过学习不同的软件工程方法进行短期的水平提高 - 小组会议及文档编写 -- 项目管理及项目进展图表 +- 项目管理及项目进展图表(甘特图) - UML 图表及系统描述 - 使用 Git 来进行代码的版本控制 - 软件测试及 BUG 跟踪 - 使用开源库 - 开源代码许可及其选择 -- 软件分发 +- 软件交付 -在这些讲座之后,会有一些来自世界各地的嘉宾为我们说说他们在软件分发过程中的经验。我们也设法请来大学里知识产权律师谈关于软件在英国的知识产权问题,以及如何处理软件的知识产权问题。 +在这些讲座之后,会有一些来自世界各地的嘉宾为我们说说他们在软件交付过程中的经验。我们也设法请来大学里知识产权律师谈关于软件在英国的知识产权问题,以及如何处理软件的知识产权问题。 ### 协作工具 ### -为了让上述教学内容的顺利进行,我们将会介绍一些工具,并训练学生在他们的项目中使用这些工具。如下: +为了让上述教学内容的顺利进行,我们将会引入一些工具,并训练学生在他们的项目中使用这些工具。如下: - Google Drive:团队与导师之间进行共享的工具,暂时存储用于描述项目的文档和图表、需求收集、会议纪要以及项目时间跟踪等信息。采取这样一个方式来监控并提供直接反馈到每个团队,是非常有效的。 - [Basecamp][1]:同样是用于分享文档,在随后的课程中,我们可能会考虑用它取代 Google Drive。 -- BUG 报告工具,如 [Mantis][2]:只能让有限的用户自由提交 BUG。稍后我们提到的 Git 可以让小组内的所有人员用做 BUG 提交。 +- BUG 报告工具,如 [Mantis][2]:只能让有限的用户免费提交 BUG。稍后我们提到的 Git 可以让小组内的所有人员用做 BUG 提交。 - 远程视频会议工具:在人员不在校内,甚至去了其他城市的情况下使用。学生们可以定期通过 Skype 来交流并记录会议内容或则进行录音作为今后其他用处。 -- 同时,学生们的项目中还会用到大量的开源工具包。他们可以根据自己小组的项目需求来选择自己使用的工具包和编程语言。唯一的条件是,这些项目必须开源,最后成果可以安装到大学里的实验室,并且大多的研究人员都支持这个条件。 -- 最后,所有团队必须向客户交付他们的项目,包括完整的工作版本的软件、文档和他们自己选择的开放源码许可。大多数的团队选择了 GPLv3 许可证。 +- 同时,学生们的项目中还会用到大量的开源工具包。他们可以根据自己小组的项目需求来选择自己使用的工具包和编程语言。唯一的条件是,这些项目必须开源,最后成果可以安装到大学里的实验室,并且大多的研究人员都非常支持这个条件。 +- 最后,所有团队必须向客户交付他们的项目,包括完整的可以工作的软件版本、文档和他们自己选择的开放源码许可。大多数的团队选择了 GPLv3 许可证。 ### 技巧和经验教训 ### @@ -48,29 +49,29 @@ 3. 学生更加愿意与校外的客户一起协作。他们期待着与外部公司代表或校外人员协作,不过是为了获得新体验而已。与导师进行交流时,他们都能够表现得很专业,这样使得老师非常放心。 -4. 很多团队版开发单元测试的部分放到项目结束之后,从极限编程方法的角度来说,这是一个严重的禁忌。也许测试应包括在不同阶段的评估中,来提醒他们需要与并行开展软件开发和单元测试。 +4. 很多团队版将开发单元测试的部分放到项目结束之后,从极限编程方法的角度来说,这是一个严重的禁忌。也许测试应包括在不同阶段的评估中,来提醒他们需要并行开展软件开发和单元测试。 -5. 在这个班的 80 个人里边,仅有 4 个女生,每个女都分在不同的小组里边。我观察到,男生们总是充分准备好来承担起领队角色,并将最有趣的代码分配给他们自己来编写,女生则多大遵循安排或者是编写文档。出于某种原因,女生选择不显示权威,即使在女性辅导员鼓励下,她们也不愿编写代码。这仍然是一个需要解决的主要问题。 +5. 在这个班的 80 个人里边,仅有 4 个女生,每个女生都分在不同的小组里边。我观察到,男生们总是充分准备好来承担起领队角色,并将最有趣的代码部分留给他们自己来编写,女生则多大遵循安排或者是编写文档。出于某种原因,女生选择不出头,即使在女性辅导员鼓励下,她们也不愿编写代码。这仍然是一个需要解决的主要问题。 6. 允许不同风格项目文档,比方说,UML 图表、状态图或其他形式的。让学生学习这些并与其他课程融汇贯通来提高他们的学习经验。 7. 学生里边,有些是很好的开发人员,有些做商务计算的则没有多少编程经验。我们要鼓励团队共同努力,避免开发人员做得比那些只做会议记录或文档的其他成员更好的错误认知。我们常在辅导课程中鼓励角色转换,让每个人都有机会学习如何编程。 -8. 小组进行与导师每周见面沟通是非常重要的,可以有效监督各个小组进展情况,还可以了解是谁做了大部分工作。通常,没来参加会议的小组成员基本就是没有参与到他们的团队工作中去的,并且通过其他成员提交的工作报告也可以确定哪些人不活跃。 +8. 小组与导师每周见面沟通是非常重要的,可以有效监督各个小组进展情况,还可以了解是谁做了大部分工作。通常,没来参加会议的小组成员基本就是没有参与到他们的团队工作中去的,并且通过其他成员所提交的工作报告也可以确定哪些人不活跃。 9. 我们鼓励学生们把许可证附加到项目中去,使用外部库以及和客户协作的时候要表明确切知识产权问题。 这样可让打破陈规,开拓思维,并了解真实的软件交付问题。 -10. 给学生们自己选择技术空间。 +10. 给学生们自己选择所用技术的空间。 11. 助教是关键。同时管理 80 个学生显然很有难度,特别是需要对他们进行评估的那几周。明年我一定会找个助教来帮我一起管理各个小组。 -12. 实验室的技术支持是非常重要的。大学里的技术支持对于本课程是非常赞同的。他们正在考虑明年将虚拟机分配给每个团队,这样没个团队可以根据需要自行在虚拟机中安装任何软件。 +12. 实验室的技术支持是非常重要的。大学里的技术支持人员对于本课程是非常赞同的。他们正在考虑明年将虚拟机分配给每个团队,这样没个团队可以根据需要自行在虚拟机中安装任何软件。 13. 团队合作,相互帮助。大多数团队自然而然的支持其他团队成员,同时指导员在中间也帮助了不少。 -14. 来自其他技术人员的帮助会锦上添花。作为一名新的大学导师,我需要从经验中学习,如果我想了解如何管理某些学生和团队,或者对如何让学生适应课程感到困惑时,我会通过多个方面来寻求建议。来自高级技术人员的支持对我来说是一种极大的鼓励。 +14. 来自其他同事的帮助会锦上添花。作为一名新的大学导师,我需要从经验中学习,如果我想了解如何管理某些学生和团队,或者对如何让学生适应课程感到困惑时,我会通过多个方面来寻求建议。来自资深同事的支持对我来说是一种极大的鼓励。 -最后,对于作为导师的我以及所有的学生来说,这都是个有趣的课程。在学习目标和传统的分级方案上还有有一些问题需解决,以减少教师的工作量。明年,我计划会保留这种教学模式,并希望能够提出更好的分级方案以及介绍更多的软件来帮助监督项目和控制代码版本。 +最后,对于作为导师的我以及所有的学生来说,这都是个有趣的课程。在学习目标和传统评分方案上还有有一些问题需解决,以减少教师的工作量。明年,我计划会保留这种教学模式,并希望能够提出更好的评分方案以及引入更多的软件来帮助监督项目和控制代码版本。 -------------------------------------------------------------------------------- From 10eea621ce486fd8d26aa60cebf03454d0483fd2 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 14 Jan 2016 06:23:52 +0800 Subject: [PATCH 0211/1469] PUB:20151215 How to block network traffic by country on Linux @FSSlc --- ...ock network traffic by country on Linux.md | 111 ++++++++++++++++++ ...ock network traffic by country on Linux.md | 110 ----------------- 2 files changed, 111 insertions(+), 110 deletions(-) create mode 100644 published/20151215 How to block network traffic by country on Linux.md delete mode 100644 translated/tech/20151215 How to block network traffic by country on Linux.md diff --git a/published/20151215 How to block network traffic by country on Linux.md b/published/20151215 How to block network traffic by country on Linux.md new file mode 100644 index 0000000000..0a70e7d49b --- /dev/null +++ b/published/20151215 How to block network traffic by country on Linux.md @@ -0,0 +1,111 @@ +如何在 Linux 中根据国家位置来阻断网络流量 +================================================================================ + +作为一名维护 Linux 生产服务器的系统管理员,你可能会遇到这样一些情形:你需要**根据地理位置,选择性地阻断或允许网络流量通过。** 例如你正经历一次由注册在某个特定国家的 IP 发起的 DoS 攻击;或者基于安全考虑,你想阻止来自未知国家的 SSH 登录请求;又或者你的公司对某些在线视频有分销权,它要求只能在特定的国家内合法发行;抑或是由于公司的政策,你需要阻止某个本地主机将文件上传至任意一个非美国的远程云端存储。 + +所有的上述情形都需要设置防火墙,使之具有**基于国家位置过滤流量**的功能。有几个方法可以做到这一点,其中之一是你可以使用 TCP wrappers 来为某个应用(例如 SSH,NFS, httpd)设置条件阻塞。但其缺点是你想要保护的那个应用必须以支持 TCP wrappers 的方式构建。另外,TCP wrappers 并不总是能够在各个平台中获取到(例如,Arch Linux [放弃了][2]对它的支持)。另一种方式是结合基于国家的 GeoIP 信息,设置 [ipset][3],并将它应用到 iptables 的规则中。后一种方式看起来更有希望一些,因为基于 iptables 的过滤器是与应用无关的,且容易设置。 + +在本教程中,我将展示 **另一个基于 iptables 的 GeoIP 过滤器,它由 xtables-addons 来实现**。对于那些不熟悉它的人来说, xtables-addons 是用于 netfilter/iptables 的一系列扩展。一个包含在 xtables-addons 中的名为 xt\_geoip 的模块扩展了 netfilter/iptables 的功能,使得它可以根据流量来自或流向的国家来进行过滤,IP 掩蔽(NAT)或丢包。若你想使用 xt\_geoip,你不必重新编译内核或 iptables,你只需要使用当前的内核构建环境(/lib/modules/\`uname -r`/build)以模块的形式构建 xtables-addons。同时也不需要进行重启。只要你构建并安装了 xtables-addons , xt\_geoip 便能够配合 iptables 使用。 + +至于 xt\_geoip 和 ipset 之间的比较,[xtables-addons 的官方网站][3] 上是这么说的: 相比于 ipset,xt\_geoip 在内存占用上更胜一筹,但对于匹配速度,基于哈希的 ipset 可能更有优势。 + +在教程的余下部分,我将展示**如何使用 iptables/xt\_geoip 来根据流量的来源地或流入的国家阻断网络流量**。 + +### 在 Linux 中安装 xtables-addons ### + +下面介绍如何在各种 Linux 平台中编译和安装 xtables-addons。 + +为了编译 xtables-addons,首先你需要安装一些依赖软件包。 + +#### 在 Debian,Ubuntu 或 Linux Mint 中安装依赖 #### + + $ sudo apt-get install iptables-dev xtables-addons-common libtext-csv-xs-perl pkg-config + +#### 在 CentOS,RHEL 或 Fedora 中安装依赖 #### + +CentOS/RHEL 6 需要事先设置好 EPEL 仓库(为 perl-Text-CSV\_XS 所需要)。 + + $ sudo yum install gcc-c++ make automake kernel-devel-`uname -r` wget unzip iptables-devel perl-Text-CSV_XS + +#### 编译并安装 xtables-addons #### + +从 `xtables-addons` 的[官方网站][4] 下载源码包,然后按照下面的指令编译安装它。 + + $ wget http://downloads.sourceforge.net/project/xtables-addons/Xtables-addons/xtables-addons-2.10.tar.xz + $ tar xf xtables-addons-2.10.tar.xz + $ cd xtables-addons-2.10 + $ ./configure + $ make + $ sudo make install + +需要注意的是,对于基于红帽的系统(CentOS、RHEL、Fedora),它们默认开启了 SELinux,所以有必要像下面这样调整 SELinux 的策略。否则,SELinux 将阻止 iptables 加载 xt\_geoip 模块。 + + $ sudo chcon -vR --user=system_u /lib/modules/$(uname -r)/extra/*.ko + $ sudo chcon -vR --type=lib_t /lib64/xtables/*.so + +### 为 xtables-addons 安装 GeoIP 数据库 ### + +下一步是安装 GeoIP 数据库,它将被 xt\_geoip 用来查询 IP 地址与国家地区之间的对应关系。方便的是,`xtables-addons` 的源码包中带有两个帮助脚本,它们被用来从 MaxMind 下载 GeoIP 数据库并将它转化为 xt\_geoip 可识别的二进制形式文件;它们可以在源码包中的 geoip 目录下找到。请遵循下面的指导来在你的系统中构建和安装 GeoIP 数据库。 + + $ cd geoip + $ ./xt_geoip_dl + $ ./xt_geoip_build GeoIPCountryWhois.csv + $ sudo mkdir -p /usr/share/xt_geoip + $ sudo cp -r {BE,LE} /usr/share/xt_geoip + +根据 [MaxMind][5] 的说明,他们的 GeoIP 数据库能够以 99.8% 的准确率识别出 ip 所对应的国家,并且每月这个数据库将进行更新。为了使得本地安装的 GeoIP 数据是最新的,或许你需要设置一个按月执行的 [cron job][6] 来时常更新你本地的 GeoIP 数据库。 + +### 阻断来自或流向某个国家的网络流量 ### + +一旦 xt\_geoip 模块和 GeoIP 数据库安装好后,你就可以在 iptabels 命令中使用 geoip 的匹配选项。 + + $ sudo iptables -m geoip --src-cc country[,country...] --dst-cc country[,country...] + +你想要阻断流量的那些国家是使用[2个字母的 ISO3166 代码][7] 来特别指定的(例如 US(美国)、CN(中国)、IN(印度)、FR(法国))。 + +例如,假如你想阻断来自也门(YE) 和 赞比亚(ZM)的流量,下面的 iptabels 命令便可以达到此目的。 + + $ sudo iptables -I INPUT -m geoip --src-cc YE,ZM -j DROP + +假如你想阻断流向中国(CN) 的流量,可以运行下面的命令: + + $ sudo iptables -A OUTPUT -m geoip --dst-cc CN -j DROP + +匹配条件也可以通过在 `--src-cc` 或 `--dst-cc` 选项前加 `!` 来达到相反的目的: + +假如你想在你的服务器上阻断来自所有非美国的流量,可以运行: + + $ sudo iptables -I INPUT -m geoip ! --src-cc US -j DROP + +![](https://c2.staticflickr.com/6/5654/23665427845_050241b03f_c.jpg) + +#### 对于使用 Firewall-cmd 的用户 #### + +某些发行版本例如 CentOS/RHEL7 或 Fedora 已经用 firewalld 替代了 iptables 来作为默认的防火墙服务。在这些系统中,你可以类似使用 xt\_geoip 那样,使用 firewall-cmd 来阻断流量。利用 firewall-cmd 命令,上面的三个例子可被重新写为: + + $ sudo firewall-cmd --direct --add-rule ipv4 filter INPUT 0 -m geoip --src-cc YE,ZM -j DROP + $ sudo firewall-cmd --direct --add-rule ipv4 filter OUTPUT 0 -m geoip --dst-cc CN -j DROP + $ sudo firewall-cmd --direct --add-rule ipv4 filter INPUT 0 -m geoip ! --src-cc US -j DROP + +### 总结 ### + +在本教程中,我展示了使用 iptables/xt\_geoip 来根据流量的来源地或流入的国家轻松地阻断网络流量。假如你有这方面的需求,把它部署到你的防火墙系统中可以使之成为一个实用的办法。作为最后的警告,我应该提醒你的是:在你的服务器上通过基于 GeoIP 的流量过滤来禁止特定国家的流量并不总是万无一失的。GeoIP 数据库本身就不是很准确或齐全,且流量的来源或目的地可以轻易地通过使用 VPN、Tor 或其他任意易受攻击的中继主机来达到欺骗的目的。基于地理位置的过滤器甚至可能会阻止本不该阻止的合法网络流量。在你决定把它部署到你的生产环境之前请仔细考虑这个限制。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/block-network-traffic-by-country-linux.html + +作者:[Dan Nanni][a] +译者:[FSSlc](https://github.com/FSSlc) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/nanni +[1]:https://www.archlinux.org/news/dropping-tcp_wrappers-support/ +[2]:http://xmodulo.com/block-unwanted-ip-addresses-linux.html +[3]:http://xtables-addons.sourceforge.net/geoip.php +[4]:http://xtables-addons.sourceforge.net/ +[5]:https://support.maxmind.com/geoip-faq/geoip2-and-geoip-legacy-databases/how-accurate-are-your-geoip2-and-geoip-legacy-databases/ +[6]:http://ask.xmodulo.com/add-cron-job-linux.html +[7]:https://en.wikipedia.org/wiki/ISO_3166-1 diff --git a/translated/tech/20151215 How to block network traffic by country on Linux.md b/translated/tech/20151215 How to block network traffic by country on Linux.md deleted file mode 100644 index 5d04b20a2b..0000000000 --- a/translated/tech/20151215 How to block network traffic by country on Linux.md +++ /dev/null @@ -1,110 +0,0 @@ -如何在 Linux 中根据国家位置来阻断网络流量 -================================================================================ -作为一名维护 Linux 生产服务器的系统管理员,你可能会遇到这样一些情形:你需要 **根据地理位置,选择性地阻断或允许网络流量通过。** 例如你正经历一次由注册在某个特定国家的 IP 发起的 DoS 攻击;或者基于安全考虑,你想阻止来自未知国家的 SSH 登陆请求;又或者你的公司对某些在线视频有分销权,它要求只能合法地在特定的国家内发行;抑或是由于公司的政策,你需要阻止任意一个本地主机将文件上传至任意一个非美国的远程云端存储。 - -所有的上述情形都需要设置防火墙,使之具有 **过滤基于国家位置的流量** 的功能。有几个方法可以做到这一点,其中之一是你可以使用 TCP wrappers 来为个人应用(例如 SSH,NFS, httpd)设置有条件的阻塞。但其缺点是你想要保护的那个应用必须以支持 TCP wrappers 的方式构建。另外,TCP wrappers 并不总是能够在各个平台中获取到(例如,Arch Linux [放弃了][2]对它的支持)。另一种方式是结合基于国家的 GeoIP 信息,设置 [ipset][3],并将它应用到 iptables 的规则中。后一种方式看起来更有希望一些,因为基于 iptables 的过滤器是与应用无关的,且容易设置。 - -在本教程中,我将展示 **另一个基于 iptables 的 GeoIP 过滤器,它由 xtables-addons 来实现**。对于那些不熟悉它的人来说, xtables-addons 是针对 netfilter/iptables 的一系列扩展。一个包含在 xtables-addons 中的名为 xt_geoip 的模块扩展了 netfilter/iptables 的功能,使得它可以根据流量来自或流向的国家来进行过滤,IP 掩蔽(NAT) 或丢包。若你想使用 xt_geoip,你不必重新编译内核或 iptables,你只需要使用当前的内核构建环境(/lib/modules/`uname -r`/build) 以模块的形式构建 xtables-addons。同时也不需要进行重启。只要你构建并安装了 xtables-addons , xt_geoip 便能够配合 iptables 使用。 - -至于 xt_geoip 和 ipset 之间的比较,[xtables-addons 的官方网站][3] 上是这么说的: 相比于 ipset,xt_geoip 在内存占用上更胜一筹,但对于匹配速度,基于哈希的 ipset 可能更有优势。 - -在教程的余下部分,我将展示 ** 如何使用 iptables/xt_geoip 来根据流量的来源地或流入的国家阻断网络流量 **。 - -### 在 Linux 中安装 xtables-addons ### - -下面介绍如何在各种 Linux 平台中编译和安装 xtables-addons。 - -为了编译 xtables-addons,首先你需要安装一些依赖软件包。 - -#### 在 Debian,Ubuntu 或 Linux Mint 中安装依赖 #### - - $ sudo apt-get install iptables-dev xtables-addons-common libtext-csv-xs-perl pkg-config - -#### 在 CentOS,RHEL 或 Fedora 中安装依赖 #### - -CentOS/RHEL 6 需要事先设置好 EPEL 仓库(为 perl-Text-CSV_XS 所需要)。 - - $ sudo yum install gcc-c++ make automake kernel-devel-`uname -r` wget unzip iptables-devel perl-Text-CSV_XS - -#### 编译并安装 xtables-addons #### - -从 `xtables-addons` 的[官方网站][4] 下载源码包,然后按照下面的指令编译安装它。 - - $ wget http://downloads.sourceforge.net/project/xtables-addons/Xtables-addons/xtables-addons-2.10.tar.xz - $ tar xf xtables-addons-2.10.tar.xz - $ cd xtables-addons-2.10 - $ ./configure - $ make - $ sudo make install - -需要注意的是,对于基于红帽的系统(CentOS, RHEL, Fedora),它们默认开启了 SELinux,所以有必要像下面这样调整 SELinux 的策略。否则,SELinux 将阻止 iptables 加载 xt_geoip 模块。 - - $ sudo chcon -vR --user=system_u /lib/modules/$(uname -r)/extra/*.ko - $ sudo chcon -vR --type=lib_t /lib64/xtables/*.so - -### 为 xtables-addons 安装 GeoIP 数据库 ### - -下一步是安装 GeoIP 数据库,它将被 xt_geoip 用来查询 IP 地址与国家地区之间的对应关系。方便的是,`xtables-addons` 的源码包中带有两个帮助脚本,它们被用来从 MaxMind 下载 GeoIP 数据库并将它转化为 xt_geoip 可识别的二进制形式文件;而它们可以在源码包中的 geoip 目录下找到。请遵循下面的指导来在你的系统中构建和安装 GeoIP 数据库。 - - $ cd geoip - $ ./xt_geoip_dl - $ ./xt_geoip_build GeoIPCountryWhois.csv - $ sudo mkdir -p /usr/share/xt_geoip - $ sudo cp -r {BE,LE} /usr/share/xt_geoip - -根据 [MaxMind][5] 的说明,他们的 GeoIP 数据库能够以 99.8% 的准确率识别出 ip 所对应的国家,并且每月这个数据库将进行更新。为了使得本地安装的 GeoIP 数据是最新的,或许你需要设置一个按月执行的 [cron job][6] 来时常更新你本地的 GeoIP 数据库。 - -### 阻断来自或流向某个国家的网络流量 ### - -一旦 xt_geoip 模块和 GeoIP 数据库安装好后,你就可以在 iptabels 命令中使用 geoip 的匹配选项。 - - $ sudo iptables -m geoip --src-cc country[,country...] --dst-cc country[,country...] - -你想要阻断流量的那些国家是使用[2个字母的 ISO3166 代码][7] 来特别指定的(例如 US(美国)、CN(中国)、IN(印度)、FR(法国))。 - -例如,假如你想阻断来自也门(YE) 和 赞比亚(ZM) 的流量,下面的 iptabels 命令便可以达到此目的。 - - $ sudo iptables -I INPUT -m geoip --src-cc YE,ZM -j DROP - -假如你想阻断流向中国(CN) 的流量,可以运行下面的命令: - - $ sudo iptables -A OUTPUT -m geoip --dst-cc CN -j DROP - -匹配条件也可以通过在 "--src-cc" 或 "--dst-cc" 选项前加 "!" 来达到相反的目的: - -假如你想在你的服务器上阻断来自所有非美国的流量,可以运行: - - $ sudo iptables -I INPUT -m geoip ! --src-cc US -j DROP - -![](https://c2.staticflickr.com/6/5654/23665427845_050241b03f_c.jpg) - -#### 对于使用 Firewall-cmd 的用户 #### - -某些发行版本例如 CentOS/RHEL7 或 Fedora 已经用 firewalld 替代了 iptables 来作为默认的防火墙服务。在这些系统中,你可以类似使用 xt_geoip 那样,使用 firewall-cmd 来阻断流量。利用 firewall-cmd 命令,上面的三个例子可被重新写为: - - $ sudo firewall-cmd --direct --add-rule ipv4 filter INPUT 0 -m geoip --src-cc YE,ZM -j DROP - $ sudo firewall-cmd --direct --add-rule ipv4 filter OUTPUT 0 -m geoip --dst-cc CN -j DROP - $ sudo firewall-cmd --direct --add-rule ipv4 filter INPUT 0 -m geoip ! --src-cc US -j DROP - -### 总结 ### - -在本教程中,我展示了使用 iptables/xt_geoip 来根据流量的来源地或流入的国家轻松地阻断网络流量。假如你有这方面的需求,把它部署到你的防火墙系统中可以使之成为一个实用的办法。作为最后的警告,我应该提醒你的是:在你的服务器上通过基于 GeoIP 的流量过滤来禁止特定国家的流量并不总是万无一失的。GeoIP 数据库本身就不是很准确或齐全,且流量的来源或目的地可以轻易地通过使用 VPN、Tor 或其他任意易受攻击的中继主机来达到欺骗的目的。基于地理位置的过滤器甚至可能会阻止本不该阻止的合法网络流量。在你决定把它部署到你的生产环境之前请仔细考虑这个限制。 - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/block-network-traffic-by-country-linux.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]:https://www.archlinux.org/news/dropping-tcp_wrappers-support/ -[2]:http://xmodulo.com/block-unwanted-ip-addresses-linux.html -[3]:http://xtables-addons.sourceforge.net/geoip.php -[4]:http://xtables-addons.sourceforge.net/ -[5]:https://support.maxmind.com/geoip-faq/geoip2-and-geoip-legacy-databases/how-accurate-are-your-geoip2-and-geoip-legacy-databases/ -[6]:http://ask.xmodulo.com/add-cron-job-linux.html -[7]:https://en.wikipedia.org/wiki/ISO_3166-1 From 41f5508b4c826c826f639eda0e35e8c1e02a105c Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 14 Jan 2016 06:37:10 +0800 Subject: [PATCH 0212/1469] PUB:20151223 Monitor Linux System Performance Using Nmon MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @sonofelice 翻译的不错,用心了。https://linux.cn/article-6886-1.html --- ...tor Linux System Performance Using Nmon.md | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) rename {translated/tech => published}/20151223 Monitor Linux System Performance Using Nmon.md (51%) diff --git a/translated/tech/20151223 Monitor Linux System Performance Using Nmon.md b/published/20151223 Monitor Linux System Performance Using Nmon.md similarity index 51% rename from translated/tech/20151223 Monitor Linux System Performance Using Nmon.md rename to published/20151223 Monitor Linux System Performance Using Nmon.md index 70d0f3a11f..26f3f3f1e2 100644 --- a/translated/tech/20151223 Monitor Linux System Performance Using Nmon.md +++ b/published/20151223 Monitor Linux System Performance Using Nmon.md @@ -1,15 +1,16 @@ -使用Nmon监控Linux的系统性能 +使用 Nmon 监控 Linux 的系统性能 ================================================================================ -Nmon(得名于Nigel's的监控器)是IBM的员工Nigel Griffiths为AIX和Linux系统开发的一款计算机性能系统监控工具。Nmon可以把操作系统的统计数据展示在屏幕上或者存储到一份数据文件里,来帮助理解计算机资源的使用情况、调整选项和系统瓶颈。这个系统基准测试工具只需要使用一条命令就能得到大量重要的性能数据。使用Nmon可以很轻松的监控系统的CPU、内存、网络、硬盘、文件系统、NFS、高耗进程、资源和微分区功率的信息。 +Nmon(得名于 Nigel 的监控器)是IBM的员工 Nigel Griffiths 为 AIX 和 Linux 系统开发的一款计算机性能系统监控工具。Nmon 可以把操作系统的统计数据展示在屏幕上或者存储到一份数据文件里,来帮助了解计算机资源的使用情况、调整方向和系统瓶颈。这个系统基准测试工具只需要使用一条命令就能得到大量重要的性能数据。使用 Nmon 可以很轻松的监控系统的 CPU、内存、网络、硬盘、文件系统、NFS、高耗进程、资源和 IBM Power 系统的微分区的信息。 ### Nmon 安装 ### -Nmon默认是存在于Ubuntu的仓库中的。你可以通过下面的命令安装Nmon: +Nmon 默认是存在于 Ubuntu 的仓库中的。你可以通过下面的命令安装 Nmon: sudo apt-get install nmon -怎么使用Nmon来监控Linux的性能 -安装完成后,通过在终端输入`nmon` 命令来启动Nmon +### 怎么使用Nmon来监控Linux的性能 ### + +安装完成后,通过在终端输入`nmon` 命令来启动 Nmon nmon @@ -17,25 +18,24 @@ Nmon默认是存在于Ubuntu的仓库中的。你可以通过下面的命令安 ![nmon-output](https://www.maketecheasier.com/assets/uploads/2015/12/nmon-output.png) -从上面的截图可以看到nmon命令行工具完全是交互式运行的,你可以使用快捷键来轻松查看对应的统计数据。 -你可以使用下面的nmon快捷键来显示不同的系统统计数据: +从上面的截图可以看到 nmon 命令行工具完全是交互式运行的,你可以使用快捷键来轻松查看对应的统计数据。你可以使用下面的 nmon 快捷键来显示不同的系统统计数据: -- `q` : 停止或编辑Nmon +- `q` : 停止并退出 Nmon - `h` : 查看帮助 -- `c` : 查看CPU统计数据 +- `c` : 查看 CPU 统计数据 - `m` : 查看内存统计数据 - `d` : 查看硬盘统计数据 - `k` : 查看内核统计数据 - `n` : 查看网络统计数据 -- `N` : 查看NFS统计数据 +- `N` : 查看 NFS 统计数据 - `j` : 查看文件系统统计数据 - `t` : 查看高耗进程 - `V` : 查看虚拟内存统计数据 - `v` : 详细模式 -### 核查CPU处理器 ### +### 核查 CPU 处理器 ### -如果你想收集关于CPU性能相关的统计数据,你应该按下键盘上的`c`键,之后你将会看到下面的输出: +如果你想收集关于 CPU 性能相关的统计数据,你应该按下键盘上的`c`键,之后你将会看到下面的输出: ![nmon_cpu_output](https://www.maketecheasier.com/assets/uploads/2015/12/nmon_cpu_output.png) @@ -47,7 +47,7 @@ Nmon默认是存在于Ubuntu的仓库中的。你可以通过下面的命令安 ### 核查网络统计数据 ### -如果想收集Linux系统网络统计数据,按下`n`键,你将会看到下面输出: +如果想收集 Linux 系统的网络统计数据,按下`n`键,你将会看到下面输出: ![n_network_output](https://www.maketecheasier.com/assets/uploads/2015/12/nmon_network_output.png) @@ -59,19 +59,19 @@ Nmon默认是存在于Ubuntu的仓库中的。你可以通过下面的命令安 ### 核查内核信息 ### -Nmon一个非常重要的快捷键是`k`键,用来显示系统内核相关的概要信息。按下`k`键之后,会看到下面输出: +Nmon 一个非常重要的快捷键是`k`键,用来显示系统内核相关的概要信息。按下`k`键之后,会看到下面输出: ![nmon_kernel_output](https://www.maketecheasier.com/assets/uploads/2015/12/nmon_kernel_output.png) ### 获取系统信息 ### -对每个系统管理员来说一个非常有用的快捷键是`r`键,可以用来显示计算机系统结构、操作系统版本号和CPU等不同资源的信息。按下`r`键之后会看到下面输出: +对每个系统管理员来说一个非常有用的快捷键是`r`键,可以用来显示计算机的系统结构、操作系统版本号和 CPU 等不同资源的信息。按下`r`键之后会看到下面输出: ![nmon_system_output](https://www.maketecheasier.com/assets/uploads/2015/12/nmon_system_output.png) ### 总结 ### -还有许多其他的工具实现的功能和Nmon一样,不过Nmon对一个Linux新手来说还是很友好的。如果你有什么问题,尽管评论。 +还有许多其他的工具做的和 Nmon 同样的工作,不过 Nmon 对一个 Linux 新手来说还是很友好的。如果你有什么问题,尽管评论。 -------------------------------------------------------------------------------- @@ -79,7 +79,7 @@ via: https://www.maketecheasier.com/monitor-linux-system-performance/ 作者:[Hitesh Jethva][a] 译者:[sonofelice](https://github.com/sonofelice) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 99e9065073cab133e18e2d27903d364c0168bd4b Mon Sep 17 00:00:00 2001 From: icecoobe Date: Thu, 14 Jan 2016 09:56:50 +0800 Subject: [PATCH 0213/1469] [Translated] 20151223 What' s the Best File System for My Linux Install.md --- ...e Best File System for My Linux Install.md | 98 ------------------- ...e Best File System for My Linux Install.md | 96 ++++++++++++++++++ 2 files changed, 96 insertions(+), 98 deletions(-) delete mode 100644 sources/talk/20151223 What' s the Best File System for My Linux Install.md create mode 100644 translated/talk/20151223 What' s the Best File System for My Linux Install.md diff --git a/sources/talk/20151223 What' s the Best File System for My Linux Install.md b/sources/talk/20151223 What' s the Best File System for My Linux Install.md deleted file mode 100644 index 52f2ac8e88..0000000000 --- a/sources/talk/20151223 What' s the Best File System for My Linux Install.md +++ /dev/null @@ -1,98 +0,0 @@ -Translating by icecoobe. - -What’s the Best File System for My Linux Install? -================================================================================ -![](https://www.maketecheasier.com/assets/uploads/2015/05/file-systems-feature-image.jpg) - -File systems: they’re not the most exciting things in the world, but important nonetheless. In this article we’ll go over the popular choices for file systems on Linux – what they’re about, what they can do, and who they’re for. - -### Ext4 ### - -![file-systems-ext4](https://www.maketecheasier.com/assets/uploads/2015/05/file-systems-ext4.png) - -If you’ve ever installed Linux before, chances are you’ve seen the “Ext4” during installation. There’s a good reason for that: it’s the file system of choice for just about every Linux distribution available right now. Sure, there are some that choose other options, but there’s no denying that Extended 4 is the file system of choice for almost all Linux users. - -#### What can it do? #### - -Extended 4 has all of the goodness that you’ve come to expect from past file system iterations (Ext2/Ext3) but with enhancements. There’s a lot to dig into, but here are the best parts of what Ext4 can do for you: - -- file system journaling -- journal checksums -- multi-block file allocation -- backwards compatibility support for Extended 2 and 3 -- persistent pre-allocation of free space -- improved file system checking (over previous versions) -- and of course, support for larger files - -#### Who is it for? #### - -Extended 4 is for those looking for a super-stable foundation to build upon, or for those looking for something that just works. This file system won’t snapshot your system; it doesn’t even have the greatest SSD support, but If your needs aren’t too extravagant, you’ll get along with it just fine. - -### BtrFS ### - -![file-systems-btrFS](https://www.maketecheasier.com/assets/uploads/2015/05/file-systems-btrFS-e1450065697580.png) - -The B-tree file system (also known as butterFS) is a file system for Linux developed by Oracle. It’s a new file system and is in heavy development stages. The Linux community considers it unstable to use for some. The core principle of BtrFS is based around the principle of copy-on-write. **Copy on write** basically means that the system has one single copy of a bit of data before the data has been written. When the data has been written, a copy of it is made. - -#### What can it do? #### - -Besides supporting copy-on-write, BtrFS can do many other things – so many things, in fact, that it’d take forever to list everything. Here are the most notable features: The file system supports read-only snapshots, file cloning, subvolumes, transparent compression, offline file system check, in-place conversion from ext3 and 4 to Btrfs, online defragmentation, anew has support for RAID 0, RAID 1, RAID 5, RAID 6 and RAID 10. - -#### Who is it for? #### - -The developers of BtrFS have promised that this file system is the next-gen replacement for other file systems out there. That much is true, though it certainly is a work in progress. There are many killer features for advanced users and basic users alike (including great performance on SSDs). This file system is for those looking to get a little bit more out of their file system and who want to try the copy-on-write way of doing things. - -### XFS ### - -![file-systems-xfs](https://www.maketecheasier.com/assets/uploads/2015/05/file-systems-xfs.jpg) - -Developed and created by Silicon Graphics, XFS is a high-end file system that specializes in speed and performance. XFS does extremely well when it comes to parallel input and output because of its focus on performance. The XFS file system can handle massive amounts of data, so much in fact that some users of XFS have close to 300+ terabytes of data. - -#### What can it do? #### - -XFS is a well-tested data storage file system created for high performance operations. Its features include: - -- striped allocation of RAID arrays -- file system journaling -- variable block sizes -- direct I/O -- guaranteed-rate I/O -- snapshots -- online defragmentation -- online resizing - -#### Who is it for? #### - -XFS is for those looking for a rock-solid file solution. The file system has been around since 1993 and has only gotten better and better with time. If you have a home server and you’re perplexed on where you should go with storage, consider XFS. A lot of the features the file system comes with (like snapshots) could aid in your file storage system. It’s not just for servers, though. If you’re a more advanced user and you’re interested in a lot of what was promised in BtrFS, check out XFS. It does a lot of the same stuff and doesn’t have stability issues. - -### Reiser4 ### - -![file-system-riser4](https://www.maketecheasier.com/assets/uploads/2015/05/file-system-riser4.gif) - -Reiser4, the successor to ReiserFS, is a file system created and developed by Namesys. The creation of Reiser4 was backed by the Linspire project as well as DARPA. What makes Reiser4 special is its multitude of transaction models. There isn’t one single way data can be written; instead, there are many. - -#### What can it do? #### - -Reiser4 has the unique ability to use different transaction models. It can use the copy-on-write model (like BtrFS), write-anywhere, journaling, and the hybrid transaction model. It has a lot of improvements upon ReiserFS, including better file system journaling via wandering logs, better support for smaller files, and faster handling of directories. Reiser4 has a lot to offer. There are a lot more features to talk about, but suffice it to say it’s a huge improvement over ReiserFS with tons of added features. - -#### Who is it for? #### - -Resier4 is for those looking to stretch one file system across multiple use-cases. Maybe you want to set up one machine with copy-on-write, another with write-anywhere, and another with hybrid transaction, and you don’t want to use different types of file systems to accomplish this task. Reiser4 is perfect for this type of use-case. - -### Conclusion ### - -There are many file systems available on Linux. Each serves a unique purpose for unique users looking to solve different problems.This post focuses on the most popular choices for the platform. There is no doubt there are other choices out there for other use-cases. - -What’s your favorite file system to use on Linux? Tell us why below! - --------------------------------------------------------------------------------- - -via: https://www.maketecheasier.com/best-file-system-linux/ - -作者:[Derrik Diener][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.maketecheasier.com/author/derrikdiener/ diff --git a/translated/talk/20151223 What' s the Best File System for My Linux Install.md b/translated/talk/20151223 What' s the Best File System for My Linux Install.md new file mode 100644 index 0000000000..2d093cb83f --- /dev/null +++ b/translated/talk/20151223 What' s the Best File System for My Linux Install.md @@ -0,0 +1,96 @@ + +我的Linux系统应该安装的最好的文件系统是什么? +================================================================================ +![](https://www.maketecheasier.com/assets/uploads/2015/05/file-systems-feature-image.jpg) + +文件系统: 它们不是世界上最激动人心的技术,但是仍然很重要。本文我们将细数那些流行的Linux文件系统 - 它们是什么,它们能够做什么,以及它们的目标用户。 + +### Ext4 ### + +![file-systems-ext4](https://www.maketecheasier.com/assets/uploads/2015/05/file-systems-ext4.png) + +如果你曾经安装过Linux,你可能在安装过程中看到过"Ext4"字样。关于这个有一个不错的理由: 它是当前每个可用Linux发行版所选择的文件系统。当然,还有其他的一些选择,但是不可否认的是,Ext4(Extended 4)几乎是所有Linux用户都会选择的文件系统。 + +#### 它能做什么? #### + +Ext4拥有你预期的曾经的文件系统(Ext2/Ext3)的所有优点, 同时还带来了一些改进。还有很多内容可以发掘,这里列举出Ext4为你带来的最好的部分: + +- 文件系统日志 +- 日志校验 +- 多重块文件的分配 +- 对Ext2 && Ext3向后兼容 +- 持续的预分配空闲空间 +- 改进的文件系统校验(相比于之前的版本) +- 当然,同时支持更大的文件 + +#### 目标用户 #### + +Ext4针对那些寻找超级可靠的构建环境或者那些仅仅需要可用环境的用户。这个文件系统不会对你的系统做快照;它甚至没有最好的SSD支持,但是如果你的要求不是太过严格的话,你会觉得它也还不错。 + +### BtrFS ### + +![file-systems-btrFS](https://www.maketecheasier.com/assets/uploads/2015/05/file-systems-btrFS-e1450065697580.png) + +B树(B-tree)文件系统 (也被认为是butterFS,黄油文件系统) 是Oracle为Linux研发的一款文件系统。它是一个全新的文件系统,而且正处于重度开发阶段。Linux社区认为其目前使用上还有些不稳定。BtrFS的核心原则是基于写时复制(copy-on-write). **写时复制**基本上意味着在写入数据前,这份数据的每一比特都有单独的一份副本。当数据写入完毕后,它相应的副本也随之生成。 + +#### 它能做什么 #### + +除了支持写时复制之外,BtrFS也能够胜任许多其他的事务 - 事实上,如此多的事务支持以致于它能永久列出一切(数据)。这里列举最值得一提的特性:支持只读快照,文件克隆,子卷,透明压缩,离线文件系统校验,无缝地从ext3&&4转换到BtrFS,在线碎片整理,还支持RAID 0, RAID 1, RAID 5, RAID 6 and RAID 10。 + +#### 目标用户 #### + +BtrFS的开发者门许诺过,该文件系统是当前其他文件系统的新一代替代者。非常正确,虽然目前其处于开发中。它有很多杀手级的特性面向高级用户,也包括基本用户 (包括SSDs上面的表现)。这个文件系统针对那些想要从文件系统中获取更多(特性),以及那些想尝试用写时复制机制做一些事情的用户。 + +### XFS ### + +![file-systems-xfs](https://www.maketecheasier.com/assets/uploads/2015/05/file-systems-xfs.jpg) + +由Silicon Graphics公司创造开发,XFS是一个高端文件系统,定位于速度和性能。对于性能方面的专注,使得在并行输入输出方面,XFS表现的尤其出色。XFS文件系统能够处理数量庞大的数据,事实上某些XFS用户的数据接近300+TB。 + +#### 它能做什么 #### + +XFS是一个经历良好测试的数据存储文件系统,它是为了高性能操作而诞生的。其特性包括: + +- RAID阵列的条纹(striped)模式分配 +- 文件系统日志 +- 多种块大小 +- 直接I/O +- 指定速率(guaranteed-rate)I/O +- 快照 +- 在线碎片整理 +- 在线调整大小 + +#### 目标用户 #### + +XFS针对那些想要一个坚如磐石的文件系统方案的用户。它起源于1993年,并且随着时间的变迁它变得越来越好。如果你有一台家庭服务器,而且你苦恼于如何部署存储环境,那么可以考虑下XFS。它拥有的众多特性(比如快照)能够协助你的文件存储系统。尽管如此,它不局限于服务器端。如果你是一个相对高级一点的用户或者你对BtrFS所承诺的很多特性感兴趣的话,尝试一下XFS。它实现了很多与BtrFS相似的特性,并且没有稳定性方面的问题。 + +### Reiser4 ### + +![file-system-riser4](https://www.maketecheasier.com/assets/uploads/2015/05/file-system-riser4.gif) + +Reiser4,ReiserFS的继任者,由Namesys公司创造研发。它的诞生追溯到Linspire工程和DARPA。它与众不同的地方在于众多的事务模式。没有一个单一的方式来写入数据;取而代之的是,有很多方式(来写入)。 + +#### 它能做什么 #### + +Reiser4拥有着使用多种不同事务模式的独特能力。它能够使用写时复制模式 (像BtrFS),任意位置写入(write-anywhere),日志,以及超级事务模式。它在ReiserFS的基础上做了许多的改进,包括更好的基于漫游日志的文件系统日志,对更小的文件较好的支持,以及更快速的目录处理。Reiser4提供了许多功能特性。还有更多的特性可以探讨,不过简单来讲,相比于ReiserFS它对众多新增特性做了非常大的改进。 + +#### 目标用户 #### + +Resier4适合那些想要将一个文件系统应用到多中场景下的用户。可能你想在一台机器上使用copy-on-write机制,在另一台机器上使用write-anywhere机制,还会在另一台机器上使用超级事务,而你又不希望使用多种不同类型的文件系统来完成这项任务。Reiser4是适合这种情况的完美方案。 + +### 结论 ### + +Linux上有许多可用的文件系统。每个文件系统都有其特定的用途,以便于特定用户解决不同的问题。本文的焦点集中在平台上文件系统的主流的选择。毫无疑问,其它的场景下还有一些别的选择。 + +你在Linux上最喜欢的文件系统是什么?在下面(的评论区)告诉我们吧! +-------------------------------------------------------------------------------- + +via: https://www.maketecheasier.com/best-file-system-linux/ + +作者:[Derrik Diener][a] +译者:[icecoobe](https://github.com/icecoobe) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.maketecheasier.com/author/derrikdiener/ From 16e79babe31a787b33c8de96e2175583e230062e Mon Sep 17 00:00:00 2001 From: cposture Date: Thu, 14 Jan 2016 15:19:35 +0800 Subject: [PATCH 0214/1469] translated by cposture 2016-01-14 --- ...es – Creating & Managing System Backups.md | 277 ------------------ ...es – Creating & Managing System Backups.md | 254 ++++++++++++---- 2 files changed, 192 insertions(+), 339 deletions(-) delete mode 100644 sources/tech/LFCS/Part 6 - LFCS--Assembling Partitions as RAID Devices – Creating & Managing System Backups.md 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 deleted file mode 100644 index 21f1d0523b..0000000000 --- a/sources/tech/LFCS/Part 6 - LFCS--Assembling Partitions as RAID Devices – Creating & Managing System Backups.md +++ /dev/null @@ -1,277 +0,0 @@ -[Translating by cposture 15-12-31] -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/ diff --git a/translated/tech/LFCS/Part 6 - LFCS--Assembling Partitions as RAID Devices – Creating & Managing System Backups.md b/translated/tech/LFCS/Part 6 - LFCS--Assembling Partitions as RAID Devices – Creating & Managing System Backups.md index 94ffe0d7f7..8f7ca3dda1 100644 --- a/translated/tech/LFCS/Part 6 - LFCS--Assembling Partitions as RAID Devices – Creating & Managing System Backups.md +++ b/translated/tech/LFCS/Part 6 - LFCS--Assembling Partitions as RAID Devices – Creating & Managing System Backups.md @@ -1,24 +1,26 @@ [未完成,不要合并-Translating By cposture 2016-01-07] -LFCS 系列第六讲://创建和管理系统备份 -==== - +LFCS 系列第六讲:组装分区为RAID设备——创建和管理系统备份 +========================================================= Linux 基金会已经发起了一个全新的 LFCS(Linux Foundation Certified Sysadmin,Linux 基金会认证系统管理员)认证,旨在让来自世界各地的人有机会参加到 LFCS 测试,获得关于有能力在 Linux 系统中执行中间系统管理任务的认证。该认证包括:维护正在运行的系统和服务的能力、全面监控和分析的能力以及何时上游团队请求支持的决策能力。 -//图片 +![Linux Foundation Certified Sysadmin – Part 6](http://www.tecmint.com/wp-content/uploads/2014/10/lfcs-Part-6.png) -LFCS 系列第五讲 +LFCS 系列第六讲 以下视频介绍了 Linux 基金会认证程序。 -本讲是《十套教程》系列中的第六讲,在这一讲里,我们将会解释如何组装分区作为RAID设备——创建和管理系统备份。这些都是 LFCS 认证中的必备知识。 +注:youtube 视频 + -# 了解RAID +本讲是《十套教程》系列中的第六讲,在这一讲里,我们将会解释如何组装分区为RAID设备——创建和管理系统备份。这些都是 LFCS 认证中的必备知识。 -被称为独立磁盘冗余阵列(RAID)的技术是一种将多个硬盘组合成一个单独逻辑单元的存储解决方案,它提供了数据冗余功能并且改善硬盘的读写性能。 +### 了解RAID ### + +一种被称为独立磁盘冗余阵列(RAID)的技术是将多个硬盘组合成一个单独逻辑单元的存储解决方案,它提供了数据冗余功能并且改善硬盘的读写操作性能。 然而,实际的容错和磁盘I/O性能硬盘取决于如何将多个硬盘组装成磁盘阵列。根据可用的设备和容错/性能的需求,RAID被分为不同的级别,你可以在Tecmint.com上参考RAID系列文章以获得每个RAID级别更详细的解释。 -* //网址 +- RAID Guide: [What is RAID, Concepts of RAID and RAID Levels Explained][1] 我们选择用于创建、组装、管理、监视软件RAID的工具,叫做mdadm(multiple disk admin的简写)。 @@ -37,11 +39,11 @@ LFCS 系列第五讲 # zypper refresh && zypper install mdadm # ``` -## 组装分区作为RAID设备 +#### 组装分区作为RAID设备 #### 组装已有分区作为RAID设备的过程由以下步骤组成。 -1. 使用mdadm创建阵列 +**1. 使用mdadm创建阵列** 如果先前其中一个分区被格式化,或者作为了另一个RAID阵列的一部分,你会被提示以确认创建一个新的阵列。假设你已经采取了必要的预防措施以避免丢失重要数据,那么可以安全地输入Y并且按下回车。 @@ -49,107 +51,235 @@ LFCS 系列第五讲 # 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) 创建RAID阵列 -2. 检查阵列的创建状态 +**2. 检查阵列的创建状态** -在创建了RAID阵列之后,你可以检查使用以下命令检查阵列的状态 +在创建了RAID阵列之后,你可以检查使用以下命令检查阵列的状态。 -``` -# cat /proc/mdstat -or -# mdadm --detail /dev/md0 [More detailed summary] -``` -//图片 + # 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) 检查RAID阵列的状态 -3. 格式化RAID设备 +**3. 格式化RAID设备** -如本系列4部分所介绍的,按照你的需求/要求采用某种文件系统格式化你的设备 +如本系列[Part 4][2]所介绍的,按照你的需求/要求采用某种文件系统格式化你的设备。 4. 监控RAID阵列服务 指示监控服务时刻监视你的RAID阵列。把```# mdadm --detail --scan```命令输出结果添加到/etc/mdadm/mdadm.conf(Debian和derivatives)或者/etc/mdadm.conf(Cent0S/openSUSE),如下。 -``` -# mdadm --detail --scan -``` -//图片 + + # mdadm --detail --scan + + +![Monitor RAID Array](http://www.tecmint.com/wp-content/uploads/2014/10/Monitor-RAID-Array.png) 监控RAID阵列 -``` -# mdadm --assemble --scan [Assemble the array] -``` + # mdadm --assemble --scan [Assemble the array] + 为了确保服务能够开机启动,需要以root权限运行以下命令。 -## Debian 和 Derivatives +**Debian 和 Derivatives** Debian 和 Derivatives能够通过下面步骤使服务默认开机启动 -``` -# update-rc.d mdadm defaults -``` + + # update-rc.d mdadm defaults + 在/etc/default/mdadm文件中添加下面这一行 -``` -AUTOSTART=true -``` -## CentOS 和 openSUSE(systemd-based) + AUTOSTART=true -``` -# systemctl start mdmonitor -# systemctl enable mdmonitor -``` -## CentOS 和 openSUSEi(SysVinit-based) +**CentOS 和 openSUSE(systemd-based)** -``` -# service mdmonitor start -# chkconfig mdmonitor on -``` + # systemctl start mdmonitor + # systemctl enable mdmonitor -5. 检查RAID磁盘故障 +**CentOS 和 openSUSEi(SysVinit-based)** + + # service mdmonitor start + # chkconfig mdmonitor on + +**5. 检查RAID磁盘故障** 在支持冗余的的RAID级别中,在需要时会替换故障的驱动器。当磁盘阵列中的设备出现故障时,仅当存在我们第一次创建阵列时预留的备用设备时,磁盘阵列会将自动启动重建。 -//图片 +![Check RAID Faulty Disk](http://www.tecmint.com/wp-content/uploads/2014/10/Check-RAID-Faulty-Disk.png) 检查RAID故障磁盘 否则,我们需要手动连接一个额外的物理驱动器到我们的系统,并且运行。 -``` -# mdadm /dev/md0 --add /dev/sdX1 -``` + # mdadm /dev/md0 --add /dev/sdX1 /dev/md0是出现了问题的阵列,而/dev/sdx1是新添加的设备。 -6. 分解一个工作阵列 +**6. 分解一个工作阵列** 如果你需要使用工作阵列的设备创建一个新的阵列,你可能不得不去分解已有工作阵列——(可选步骤) -``` -# 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 -``` + # 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. 设置邮件通知 +**7. 设置邮件通知** 你可以配置一个用于发送通知的有效邮件地址或者系统账号(确保在mdadm.conf文件中有下面这一行)。——(可选步骤) -``` -MAILADDR root -``` + + MAILADDR root 在这种情况下,来自RAID后台监控程序所有的通知将会发送到你的本地root账号的邮件箱中。其中一个类似的通知如下。 说明:此次通知事件和第5步中的例子相关。一个设备被标志为错误并且一个空闲的设备自动地被mdadm加入到阵列。我们用完了所有"健康的"空闲设备,因此我们得到了通知。 -//图片 +![RAID Monitoring Alerts](http://www.tecmint.com/wp-content/uploads/2014/10/RAID-Monitoring-Alerts.png) RAID监控通知 +#### 了解RAID级别 #### + +** RAID 0 ** + +阵列总大小是最小分区大小的n倍,n是阵列中独立磁盘的个数(你至少需要两个驱动器/磁盘)。运行下面命令,使用/dev/sdb1和/dev/sdc1分区组装一个RAID 0 阵列。 + + # mdadm --create --verbose /dev/md0 --level=stripe --raid-devices=2 /dev/sdb1 /dev/sdc1 + +常见用途:用于支持性能比容错更重要的实时应用程序的设置 + +**RAID 1 (又名镜像/Mirroring)** + +阵列总大小等于最小分区大小(你至少需要两个驱动器/磁盘)。运行下面命令,使用/dev/sdb1和/dev/sdc1分区组装一个RAID 1 阵列。 + + # mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sdb1 /dev/sdc1 + +常见用途:操作系统的安装或者重要的子文件夹,例如 /home + +**RAID 5 (又名奇偶校验码盘/drives with Parity)** + +阵列总大小将是最小分区大小的(n-1)倍。//用于奇偶校验(冗余)计算(你至少需要3个驱动器/磁盘)。 + +说明:你可以指定一个空闲设备(/dev/sde1)替换问题出现时的故障部分(分区)。运行下面命令,使用/dev/sdb1, /dev/sdc1, /dev/sdd1,/dev/sde1组装一个RAID 5 阵列,其中/dev/sde1作为空闲分区。 + + # mdadm --create --verbose /dev/md0 --level=5 --raid-devices=3 /dev/sdb1 /dev/sdc1 /dev/sdd1 --spare-devices=1 /dev/sde1 + +常见用途:Web和文件服务 + +**RAID 6 (又名双重奇偶校验码盘/drives with double Parity)** + +阵列总大小为(n*s)-2*s,其中n为阵列中独立磁盘的个数,s为最小磁盘大小。 + +说明:你可以指定一个空闲分区(在这个例子为/dev/sdf1)替换问题出现时的故障部分(分区)。 + +运行下面命令,使用/dev/sdb1, /dev/sdc1, /dev/sdd1, /dev/sde1和/dev/sdf1组装RAID 6阵列,其中/dev/sdf1作为空闲分区。 + + # mdadm --create --verbose /dev/md0 --level=6 --raid-devices=4 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde --spare-devices=1 /dev/sdf1 + +常见用途:大容量、高可用性要求的文件服务器和备份服务器。 + +**RAID 1+0 (又名镜像条带/stripe of mirrors)** + +因为RAID 1+0是RAID 0 和 RAID 1的组合,所以阵列总大小是基于两者的公式计算的。首先,计算每一个镜像的大小,然后再计算条带的大小。 + + + # mdadm --create --verbose /dev/md0 --level=10 --raid-devices=4 /dev/sd[b-e]1 --spare-devices=1 /dev/sdf1 + +常见用途:需要快速IO操作的数据库和应用服务器 + +#### 创建和管理系统备份 #### + +记住RAID其所有的价值不是在于备份的替换者是对你有益的!在黑板上写上1000次,如果你需要的话,但无论何时一定要记住它。在我们开始前,我们必须注意的是,没有一个放之四海皆准的针对所有系统备份的解决方案,但这里有一些东西,是你在规划一个备份策略时需要考虑的。 + +- 你的系统将用于什么?(桌面或者服务器?如果系统是应用于后者,那么最重要的服务是什么——//其配置?) +- 你每隔多久备份你的系统? +- 你需要备份的数据是什么(比如 文件/文件夹/数据库转储)?你还可以考虑是否需要备份大型文件(比如音频和视频文件)。 +- 这些备份将会存储在哪里(物理位置和媒体)? + +**备份你的数据** + +方法1:使用dd命令备份整个磁盘。你可以在任意时间点通过创建一个准确的镜像来备份一整个硬盘或者是分区。注意当设备是离线时,这种方法效果最好,也就是说它没有被挂载并且没有任何进程的I/O操作访问它。 + +这种备份方法的缺点是镜像将具有和磁盘或分区一样的大小,即使实际数据占用的是一个很小的比例。比如,如果你想要为只使用了10%的20GB的分区创建镜像,那么镜像文件将仍旧是20GB。换句话来讲,它不仅包含了备份的实际数据,而且也包含了整个分区。如果你想完整备份你的设备,那么你可以考虑使用这个方法。 + +**从现有的设备创建一个镜像文件** + + # dd if=/dev/sda of=/system_images/sda.img + 或者 + --------------------- 可选地,你可以压缩镜像文件 ------------------- + # dd if=/dev/sda | gzip -c > /system_images/sda.img.gz + +**从镜像文件恢复备份** + + # dd if=/system_images/sda.img of=/dev/sda + 或者 + --------------------- 根据你创建镜像文件时的选择(译者注:比如压缩) ---------------- + # gzip -dc /system_images/sda.img.gz | dd of=/dev/sda + +方法2:使用tar命令备份确定的文件/文件夹——已经在本系列[Part 3][3]中讲了。如果你想要备份指定的文件/文件夹(配置文件,用户主目录等等),你可以使用这种方法。 + +方法3:使用rsync命令同步文件。rsync是一种多功能远程(和本地)文件复制工具。如果你想要从网络设备备份或同步文件,rsync是一种选择。 + + +无论是你是正在同步两个本地文件夹还是本地 < — > 挂载在本地文件系统的远程文件夹,其基本语法是一样的。 + + # rsync -av source_directory destination directory + +在这里,-a 递归遍历子目录(如果它们存在的话),维持符号链接、时间戳、权限以及原本的属主/属组,-v 显示详细过程。 + +![rsync Synchronizing Files](http://www.tecmint.com/wp-content/uploads/2014/10/rsync-synchronizing-Files.png) + +rsync 同步文件 + +除此之外,如果你想增加在网络上传输数据的安全性,你可以通过rsync使用ssh协议。 + +**通过ssh同步本地 → 远程文件夹** + + # rsync -avzhe ssh backups root@remote_host:/remote_directory/ + +这个示例,本地主机上的backups文件夹将与远程主机上的/root/remote_directory的内容同步。 + +在这里,-h 选项以人可读的格式显示文件的大小,-e 标志用于表示一个ssh连接。 + +![rsync Synchronize Remote Files](http://www.tecmint.com/wp-content/uploads/2014/10/rsync-synchronize-Remote-Files.png) + +rsync 同步远程文件 + +**通过ssh同步远程 → 本地 文件夹** + +在这种情况下,交换前面示例中的source和destination文件夹。 + + # rsync -avzhe ssh root@remote_host:/remote_directory/ backups + +请注意这些只是rsync用法的三个示例而已(你可能遇到的最常见的情形)。对于更多有关rsync命令的示例和用法 ,你可以查看下面的文章。 + +- Read Also: [10 rsync Commands to Sync Files in Linux][4] + +### Summary ### + +作为一个系统管理员,你需要确保你的系统表现得尽可能好。如果你做好了充分准备,并且如果你的数据完整性能被诸如RAID和系统日常备份的存储技术支持,那你将是安全的。 + +如果你有有关完善这篇文章的问题、评论或者进一步的想法,可以在下面畅所欲言。除此之外,请考虑通过你的社交网络简介分享这系列文章。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/creating-and-managing-raid-backups-in-linux/ + +作者:[Gabriel Cánepa][a] +译者:[cpsoture](https://github.com/cposture) +校对:[校对者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/ From 814c58ee1b4eb2d1b24c3d8be769cb8bdb08f7f8 Mon Sep 17 00:00:00 2001 From: cposture Date: Thu, 14 Jan 2016 15:52:16 +0800 Subject: [PATCH 0215/1469] Translated by cposture 2016-01-14 --- ...tions as RAID Devices – Creating & Managing System Backups.md | 1 - 1 file changed, 1 deletion(-) diff --git a/translated/tech/LFCS/Part 6 - LFCS--Assembling Partitions as RAID Devices – Creating & Managing System Backups.md b/translated/tech/LFCS/Part 6 - LFCS--Assembling Partitions as RAID Devices – Creating & Managing System Backups.md index 8f7ca3dda1..5de5004424 100644 --- a/translated/tech/LFCS/Part 6 - LFCS--Assembling Partitions as RAID Devices – Creating & Managing System Backups.md +++ b/translated/tech/LFCS/Part 6 - LFCS--Assembling Partitions as RAID Devices – Creating & Managing System Backups.md @@ -1,4 +1,3 @@ -[未完成,不要合并-Translating By cposture 2016-01-07] LFCS 系列第六讲:组装分区为RAID设备——创建和管理系统备份 ========================================================= Linux 基金会已经发起了一个全新的 LFCS(Linux Foundation Certified Sysadmin,Linux 基金会认证系统管理员)认证,旨在让来自世界各地的人有机会参加到 LFCS 测试,获得关于有能力在 Linux 系统中执行中间系统管理任务的认证。该认证包括:维护正在运行的系统和服务的能力、全面监控和分析的能力以及何时上游团队请求支持的决策能力。 From 9f4da42a2fc93454825f621c612a2ee0634dd7b5 Mon Sep 17 00:00:00 2001 From: zpl Date: Thu, 14 Jan 2016 19:06:12 +0800 Subject: [PATCH 0216/1469] [translated] 20151109 Install Android On BQ Aquaris Ubuntu Phone In Linux.md --- ...oid On BQ Aquaris Ubuntu Phone In Linux.md | 126 ------------------ ...oid On BQ Aquaris Ubuntu Phone In Linux.md | 125 ----------------- ...oid On BQ Aquaris Ubuntu Phone In Linux.md | 125 +++++++++++++++++ 3 files changed, 125 insertions(+), 251 deletions(-) delete mode 100644 sources/tech/20151109 Install Android On BQ Aquaris Ubuntu Phone In Linux.md delete mode 100644 sources/tech/20151117 Install Android On BQ Aquaris Ubuntu Phone In Linux.md create mode 100644 translated/tech/20151109 Install Android On BQ Aquaris Ubuntu Phone In Linux.md diff --git a/sources/tech/20151109 Install Android On BQ Aquaris Ubuntu Phone In Linux.md b/sources/tech/20151109 Install Android On BQ Aquaris Ubuntu Phone In Linux.md deleted file mode 100644 index 864068eb91..0000000000 --- a/sources/tech/20151109 Install Android On BQ Aquaris Ubuntu Phone In Linux.md +++ /dev/null @@ -1,126 +0,0 @@ -zpl1025 -Install Android On BQ Aquaris Ubuntu Phone In Linux -================================================================================ -![How to install Android on Ubuntu Phone](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/11/Install-Android-on-Ubuntu-Phone.jpg) - -If you happen to own the first Ubuntu phone and want to **replace Ubuntu with Android on the bq Aquaris e4.5**, this post is going to help you. - -There can be plenty of reasons why you might want to remove Ubuntu and use the mainstream Android OS. One of the foremost reason is that the OS itself is at an early stage and intend to target developers and enthusiasts. Whatever may be your reason, installing Android on bq Aquaris is a piece of cake, thanks to the tools provided by bq. - -Let’s see what to do we need to install Android on bq Aquaris. - -### Prerequisite ### - -- Working Internet connection to download Android factory image and install tools for flashing Android -- USB data cable -- A system running Linux - -This tutorial is performed using Ubuntu 15.10. But the steps should be applicable to most other Linux distributions. - -### Replace Ubuntu with Android in bq Aquaris e4.5 ### - -#### Step 1: Download Android firmware #### - -First step is to download the Android image for bq Aquaris e4.5. Good thing is that it is available from the bq’s support website. You can download the firmware, around 650 MB in size, from the link below: - -- [Download Android for bq Aquaris e4.5][1] - -Yes, you would get OTA updates with it. At present the firmware version is 2.0.1 which is based on Android Lolipop. Over time, there could be a new firmware based on Marshmallow and then the above link could be outdated. - -I suggest to check the [bq support page and download][2] the latest firmware from there. - -Once downloaded, extract it. In the extracted directory, look for **MT6582_Android_scatter.txt** file. We shall be using it later. - -#### Step 2: Download flash tool #### - -bq has provided its own flash tool, Herramienta MTK Flash Tool, for easier installation of Android or Ubuntu on the device. You can download the tool from the link below: - -- [Download MTK Flash Tool][3] - -Since the flash tool might be upgraded in future, you can always get the latest version of flash tool from the [bq support page][4]. - -Once downloaded extract the downloaded file. You should see an executable file named **flash_tool** in it. We shall be using it later. - -#### Step 3: Remove conflicting packages (optional) #### - -If you are using recent version of Ubuntu or Ubuntu based Linux distributions, you may encounter “BROM ERROR : S_UNDEFINED_ERROR (1001)” later in this tutorial. - -To avoid this error, you’ll have to uninstall conflicting package. Use the commands below: - - sudo apt-get remove modemmanager - -Restart udev service with the command below: - - sudo service udev restart - -Just to check for any possible side effects on kernel module cdc_acm, run the command below: - - lsmod | grep cdc_acm - -If the output of the above command is an empty list, you’ll have to reinstall this kernel module: - - sudo modprobe cdc_acm - -#### Step 4: Prepare to flash Android #### - -Go to the downloaded and extracted flash tool directory (in step 2). Use command line for this purpose because you’ll have to use the root privileges here. - -Presuming that you saved it in the Downloads directory, use the command below to go to this directory (in case you do not know how to navigate between directories in command line). - - cd ~/Downloads/SP_Flash* - -After that use the command below to run the flash tool as root: - - sudo ./flash_tool - -You’ll see a window popped as the one below. Don’t bother about Download Agent field, it will be automatically filled. Just focus on Scatter-loading field. - -![Replace Ubuntu with Android](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/11/Install-Android-bq-aquaris-Ubuntu-1.jpeg) - -Remember we talked about **MT6582_Android_scatter.txt** in step 1? This text file is in the extracted directory of the Andriod firmware you downloaded in step 1. Click on Scatter-loading (in the above picture) and point to MT6582_Android_scatter.txt file. - -When you do that, you’ll see several green lines like the one below: - -![Install-Android-bq-aquaris-Ubuntu-2](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/11/Install-Android-bq-aquaris-Ubuntu-2.jpeg) - -#### Step 5: Flashing Android #### - -We are almost ready. Switch off your phone and connect it to your computer via a USB cable. - -Select Firmware Upgrade from the dropdown and after that click on the big download button. - -![flash Android with Ubuntu](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/11/Install-Android-bq-aquaris-Ubuntu.jpeg) - -If everything is correct, you should see a flash status in the bottom of the tool: - -![Replace Ubuntu with Android](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/11/Install-Android-bq-aquaris-Ubuntu-3.jpeg) - -When the procedure is successfully completed, you’ll see a notification like this: - -![Successfully flashed Android on bq qauaris Ubuntu Phone](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/11/Install-Android-bq-aquaris-Ubuntu-4.jpeg) - -Unplug your phone and power it on. You should see a white screen with AQUARIS written in the middle and at bottom, “powered by Android” would be displayed. It might take upto 10 minutes before you could configure and start using Android. - -Note: If something goes wrong in the process, Press power, volume up, volume down button together and boot in to fast boot mode. Turn off again and connect the cable again. Repeat the process of firmware upgrade. It should work. - -### Conclusion ### - -Thanks to the tools provided, it becomes easier to **flash Android on bq Ubuntu Phone**. Of course, you can use the same steps to replace Android with Ubuntu. All you need is to download Ubuntu firmware instead of Android. - -I hope this tutorial helped you to replace Ubuntu with Android on your bq phone. If you have questions or suggestions, feel free to ask in the comment section below. - --------------------------------------------------------------------------------- - -via: http://itsfoss.com/install-android-ubuntu-phone/ - -作者:[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://storage.googleapis.com/otas/2014/Smartphones/Aquaris_E4.5_L/2.0.1_20150623-1900_bq-FW.zip -[2]:http://www.bq.com/gb/support/aquaris-e4-5 -[3]:https://storage.googleapis.com/otas/2014/Smartphones/Aquaris_E4.5/Ubuntu/Web%20version/Web%20version/SP_Flash_Tool_exe_linux_v5.1424.00.zip -[4]:http://www.bq.com/gb/support/aquaris-e4-5-ubuntu-edition diff --git a/sources/tech/20151117 Install Android On BQ Aquaris Ubuntu Phone In Linux.md b/sources/tech/20151117 Install Android On BQ Aquaris Ubuntu Phone In Linux.md deleted file mode 100644 index 94e7ef69ce..0000000000 --- a/sources/tech/20151117 Install Android On BQ Aquaris Ubuntu Phone In Linux.md +++ /dev/null @@ -1,125 +0,0 @@ -Install Android On BQ Aquaris Ubuntu Phone In Linux -================================================================================ -![How to install Android on Ubuntu Phone](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/11/Install-Android-on-Ubuntu-Phone.jpg) - -If you happen to own the first Ubuntu phone and want to **replace Ubuntu with Android on the bq Aquaris e4.5**, this post is going to help you. - -There can be plenty of reasons why you might want to remove Ubuntu and use the mainstream Android OS. One of the foremost reason is that the OS itself is at an early stage and intend to target developers and enthusiasts. Whatever may be your reason, installing Android on bq Aquaris is a piece of cake, thanks to the tools provided by bq. - -Let’s see what to do we need to install Android on bq Aquaris. - -### Prerequisite ### - -- Working Internet connection to download Android factory image and install tools for flashing Android -- USB data cable -- A system running Linux - -This tutorial is performed using Ubuntu 15.10. But the steps should be applicable to most other Linux distributions. - -### Replace Ubuntu with Android in bq Aquaris e4.5 ### - -#### Step 1: Download Android firmware #### - -First step is to download the Android image for bq Aquaris e4.5. Good thing is that it is available from the bq’s support website. You can download the firmware, around 650 MB in size, from the link below: - -- [Download Android for bq Aquaris e4.5][1] - -Yes, you would get OTA updates with it. At present the firmware version is 2.0.1 which is based on Android Lolipop. Over time, there could be a new firmware based on Marshmallow and then the above link could be outdated. - -I suggest to check the [bq support page][2] and download the latest firmware from there. - -Once downloaded, extract it. In the extracted directory, look for **MT6582_Android_scatter.txt** file. We shall be using it later. - -#### Step 2: Download flash tool #### - -bq has provided its own flash tool, Herramienta MTK Flash Tool, for easier installation of Android or Ubuntu on the device. You can download the tool from the link below: - -- [Download MTK Flash Tool][3] - -Since the flash tool might be upgraded in future, you can always get the latest version of flash tool from the [bq support page][4]. - -Once downloaded extract the downloaded file. You should see an executable file named **flash_tool** in it. We shall be using it later. - -#### Step 3: Remove conflicting packages (optional) #### - -If you are using recent version of Ubuntu or Ubuntu based Linux distributions, you may encounter “BROM ERROR : S_UNDEFINED_ERROR (1001)” later in this tutorial. - -To avoid this error, you’ll have to uninstall conflicting package. Use the commands below: - - sudo apt-get remove modemmanager - -Restart udev service with the command below: - - sudo service udev restart - -Just to check for any possible side effects on kernel module cdc_acm, run the command below: - - lsmod | grep cdc_acm - -If the output of the above command is an empty list, you’ll have to reinstall this kernel module: - - sudo modprobe cdc_acm - -#### Step 4: Prepare to flash Android #### - -Go to the downloaded and extracted flash tool directory (in step 2). Use command line for this purpose because you’ll have to use the root privileges here. - -Presuming that you saved it in the Downloads directory, use the command below to go to this directory (in case you do not know how to navigate between directories in command line). - - cd ~/Downloads/SP_Flash* - -After that use the command below to run the flash tool as root: - - sudo ./flash_tool - -You’ll see a window popped as the one below. Don’t bother about Download Agent field, it will be automatically filled. Just focus on Scatter-loading field. - -![Replace Ubuntu with Android](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/11/Install-Android-bq-aquaris-Ubuntu-1.jpeg) - -Remember we talked about **MT6582_Android_scatter.txt** in step 1? This text file is in the extracted directory of the Andriod firmware you downloaded in step 1. Click on Scatter-loading (in the above picture) and point to MT6582_Android_scatter.txt file. - -When you do that, you’ll see several green lines like the one below: - -![Install-Android-bq-aquaris-Ubuntu-2](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/11/Install-Android-bq-aquaris-Ubuntu-2.jpeg) - -#### Step 5: Flashing Android #### - -We are almost ready. Switch off your phone and connect it to your computer via a USB cable. - -Select Firmware Upgrade from the dropdown and after that click on the big download button. - -![flash Android with Ubuntu](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/11/Install-Android-bq-aquaris-Ubuntu.jpeg) - -If everything is correct, you should see a flash status in the bottom of the tool: - -![Replace Ubuntu with Android](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/11/Install-Android-bq-aquaris-Ubuntu-3.jpeg) - -When the procedure is successfully completed, you’ll see a notification like this: - -![Successfully flashed Android on bq qauaris Ubuntu Phone](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/11/Install-Android-bq-aquaris-Ubuntu-4.jpeg) - -Unplug your phone and power it on. You should see a white screen with AQUARIS written in the middle and at bottom, “powered by Android” would be displayed. It might take upto 10 minutes before you could configure and start using Android. - -Note: If something goes wrong in the process, Press power, volume up, volume down button together and boot in to fast boot mode. Turn off again and connect the cable again. Repeat the process of firmware upgrade. It should work. - -### Conclusion ### - -Thanks to the tools provided, it becomes easier to **flash Android on bq Ubuntu Phone**. Of course, you can use the same steps to replace Android with Ubuntu. All you need is to download Ubuntu firmware instead of Android. - -I hope this tutorial helped you to replace Ubuntu with Android on your bq phone. If you have questions or suggestions, feel free to ask in the comment section below. - --------------------------------------------------------------------------------- - -via: http://itsfoss.com/install-android-ubuntu-phone/ - -作者:[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://storage.googleapis.com/otas/2014/Smartphones/Aquaris_E4.5_L/2.0.1_20150623-1900_bq-FW.zip -[2]:http://www.bq.com/gb/support/aquaris-e4-5 -[3]:https://storage.googleapis.com/otas/2014/Smartphones/Aquaris_E4.5/Ubuntu/Web%20version/Web%20version/SP_Flash_Tool_exe_linux_v5.1424.00.zip -[4]:http://www.bq.com/gb/support/aquaris-e4-5-ubuntu-edition \ No newline at end of file diff --git a/translated/tech/20151109 Install Android On BQ Aquaris Ubuntu Phone In Linux.md b/translated/tech/20151109 Install Android On BQ Aquaris Ubuntu Phone In Linux.md new file mode 100644 index 0000000000..73397819cd --- /dev/null +++ b/translated/tech/20151109 Install Android On BQ Aquaris Ubuntu Phone In Linux.md @@ -0,0 +1,125 @@ +在 Linux 上将 BQ Aquaris Ubuntu 手机刷成 Android 系统 +================================================================================ +![How to install Android on Ubuntu Phone](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/11/Install-Android-on-Ubuntu-Phone.jpg) + +如果你正好拥有全球第一支运行 Ubuntu 的手机并且希望将 **BQ Aquaris E4.5 自带的 Ubuntu 系统换成 Android **,那这篇文章能帮你点小忙。 + +有一万种理由来解释为什么要将 Ubuntu 换成主流 Android OS。其中最主要的一个,就是这个系统本身仍然处于非常早期的阶段,针对的目标用户仍然是开发者和爱好者。不管你的理由是什么,要谢谢 bq 提供的工具,让我们能非常轻松地在 BQ Aquaris 上安装 Android OS。 + +下面让我们一起看下在 BQ Aquaris 上安装 Android 需要做哪些事情。 + +### 前提条件 ### + +- 可用的因特网连接,用来下载 Android 出厂固件以及安装刷机工具。 +- USB 数据线 +- 运行 Linux 的电脑 + +本文是基于 Ubuntu 15.10 操作的。但是这些步骤应该也可以应用于其他大多数 Linux 发行版。 + +### 将 BQ Aquaris E4.5 上的 Ubuntu 换成 Android ### + +#### 第一步:下载 Android 固件 #### + +首先是下载可以在 BQ Aquaris E4.5 上运行的 Android 固件。幸运的是我们可以在 bq 的技术支持网站找到。可以从下面的链接直接下载,差不多 650 MB: + +- [下载为 BQ Aquaris E4.5 制作的 Android][1] + +是的,这个版本还支持 OTA 自动升级。目前,固件版本是 2.0.1,基于 Android Lolipop 开发。过一段时间,应该就会放出基于 Marshmallow 的新版本,上边的链接可能就无效了。 + +我建议去[ bq 的技术支持网站][2]下载最新的固件。 + +下载完成后解压。在解压后的目录里,找到一个名字是 **MT6582_Android_scatter.txt** 的文件。后面将要用到它。 + +#### 第二步:下载刷机工具 #### + +bq 已经提供了自己的刷机工具,Herramienta MTK Flash Tool,可以轻松地给设备安装 Andriod 或者 Ubuntu 系统。你可以从下面的链接下载工具: + +- [下载 MTK Flash Tool][3] + +考虑到刷机工具在以后可能会升级,你总是可以从[bq 技术支持网站][4]上找到最新的版本。 + +下载完后解压。之后应该可以在目录里找到一个叫 **flash_tool** 的可执行文件。我们稍后会用到。 + +#### 第三步:移除冲突的软件包(可选) #### + +如果你正在用最新版本的 Ubuntu 或 基于 Ubuntu 的 Linux 发行版,稍后可能会碰到 “BROM ERROR : S_UNDEFINED_ERROR (1001)” 错误。 + +要避免这个错误,你需要卸载有冲突的软件包。可以使用下面的命令: + + sudo apt-get remove modemmanager + +用下面的命令重启 udev 服务: + + sudo service udev restart + +检查一下内核模块 cdc_acm 可能存在的边际效应,运行下面的命令: + + lsmod | grep cdc_acm + +如果上面命令输出是空,你将需要重新加载一下这个内核模块: + + sudo modprobe cdc_acm + +#### 第四步:准备刷入 Android #### + +切换到下载好并解压完成的刷机工具目录(第二步)。请使用命令行来完成,这是因为将要用到 root 权限。 + +假设你保存在下载目录里,使用下面的命令切换目录(为那些不懂如何在命令行下切换目录的朋友考虑)。 + + cd ~/Downloads/SP_Flash* + +然后使用下面的命令以 root 权限启动刷机工具: + + sudo ./flash_tool + +然后你会看到一个像下面的窗口界面。不用在意 Download Agent 区域,它将会被自动填入。只要关心 Scatter-loading 区域。 + +![Replace Ubuntu with Android](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/11/Install-Android-bq-aquaris-Ubuntu-1.jpeg) + +还记得之前第一步里提到的 **MT6582_Android_scatter.txt** 文件吗?这个文本文件就在你第一步中下载的 Android 固件解压后的目录里。点击 Scatter-loading(上图中)然后选中 MT6582_Android_scatter.txt 文件。 + +之后,你将看到类似下面图片里的一些绿色线条: + +![Install-Android-bq-aquaris-Ubuntu-2](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/11/Install-Android-bq-aquaris-Ubuntu-2.jpeg) + +#### 第五步:刷入 Android #### + +已经差不多了。把你的手机关机,然后通过 USB 线连接到电脑上。 + +在下拉列表里选择 Firmware Upgrade,然后点击那个大的 Download 按钮。 + +![flash Android with Ubuntu](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/11/Install-Android-bq-aquaris-Ubuntu.jpeg) + +如果一切顺利,你应该可以在工具下方的状态栏里看到刷机状态: + +![Replace Ubuntu with Android](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/11/Install-Android-bq-aquaris-Ubuntu-3.jpeg) + +当所有过程都完成后,你将看到一个类似这样的提示: + +![Successfully flashed Android on bq qauaris Ubuntu Phone](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/11/Install-Android-bq-aquaris-Ubuntu-4.jpeg) + +将手机从电脑上移除然后开机。你应该看到屏幕上显示白色并在中间和底部有 AQUARIS 文字,还应该有 “powered by Android” 字样。差不多需要差不多十分钟,你才可以设置和开始使用 Android。 + +注意:如果中间出了什么问题,同时按下电源、音量加、音量减按键可以进入 fast boot 模式。然后再次关机并连接电脑。重复升级固件的过程。应该可以。 + +### 总结 ### + +要感谢厂商提供的工具,让我们可以轻松地 **在 bq Ubuntu 手机上刷 Android**。当然,你可以使用相同的步骤将 Android 替换回 Ubuntu。只是下载的时候选 Ubuntu 固件而不是 Android。 + +希望这篇文章可以帮你将你的 bq 手机上的 Ubuntu 刷成 Android。如果有什么问题或建议,可以在下面留言区里讨论。 + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/install-android-ubuntu-phone/ + +作者:[Abhishek][a] +译者:[zpl1025](https://github.com/zpl1025) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:https://storage.googleapis.com/otas/2014/Smartphones/Aquaris_E4.5_L/2.0.1_20150623-1900_bq-FW.zip +[2]:http://www.bq.com/gb/support/aquaris-e4-5 +[3]:https://storage.googleapis.com/otas/2014/Smartphones/Aquaris_E4.5/Ubuntu/Web%20version/Web%20version/SP_Flash_Tool_exe_linux_v5.1424.00.zip +[4]:http://www.bq.com/gb/support/aquaris-e4-5-ubuntu-edition From 4c3cf266fe6ea2f891f7346135aa9773a906193f Mon Sep 17 00:00:00 2001 From: cposture Date: Fri, 15 Jan 2016 00:13:27 +0800 Subject: [PATCH 0217/1469] Translating by cposture --- sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md b/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md index 99f1ceed04..80031c7fd8 100644 --- a/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md +++ b/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md @@ -1,3 +1,4 @@ +[Translating by cposture 16-01-14] * * * # GCC-Inline-Assembly-HOWTO From fb1cc19c32fc77e478c21d9c275c73ce8010d47b Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 15 Jan 2016 06:40:06 +0800 Subject: [PATCH 0218/1469] PUB:20151117 Linux 101--Get the most out of Systemd MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Ricky-Gong 翻译的很好,出乎意料地我校对非常省力! --- ... Linux 101--Get the most out of Systemd.md | 171 ++++++++++++++++++ ... Linux 101--Get the most out of Systemd.md | 171 ------------------ 2 files changed, 171 insertions(+), 171 deletions(-) create mode 100644 published/20151117 Linux 101--Get the most out of Systemd.md delete mode 100644 translated/tech/20151117 Linux 101--Get the most out of Systemd.md diff --git a/published/20151117 Linux 101--Get the most out of Systemd.md b/published/20151117 Linux 101--Get the most out of Systemd.md new file mode 100644 index 0000000000..b0df8fdfb9 --- /dev/null +++ b/published/20151117 Linux 101--Get the most out of Systemd.md @@ -0,0 +1,171 @@ +Linux 101:最有效地使用 Systemd +================================================================================ +干嘛要这么做? + +- 理解现代 Linux 发行版中的显著变化; +- 看看 Systemd 是如何取代 SysVinit 的; +- 搞定单元(unit)和新的 journal 日志。 + +吐槽邮件、人身攻击、死亡威胁——Lennart Poettering,Systemd 的作者,对收到这些东西早就习以为常了。这位 Red Hat 公司的员工之前在 Google+ 上怒斥 FOSS 社区([http://tinyurl.com/poorlennart][1])的本质,悲痛且失望地表示:“那真是个令人恶心的地方”。他着重指出 Linus Torvalds 在邮件列表上言辞极其刻薄的帖子,并谴责这位内核的领导者为在线讨论定下基调,并使得人身攻击及贬抑之辞成为常态。 + +但为何 Poettering 会遭受如此多的憎恨?为何就这么个搞搞开源软件的人要忍受这等愤怒?答案就在于他的软件的重要性。如今大多数发行版中,Systemd 是 Linux 内核发起的第一个程序,并且它还扮演多种角色。它会启动系统服务、处理用户登录,每隔特定的时间执行一些任务,还有很多很多。它在不断地成长,并逐渐成为 Linux 的某种“基础系统”——提供系统启动和发行版维护所需的所有工具。 + +如今,在以下几点上 Systemd 颇具争议:它逃避了一些已经确立的 Unix 传统,例如纯文本的日志文件;它被看成是个“大一统”的项目,试图接管一切;它还是我们这个操作系统的支柱的重要革新。然而大多数主流发行版已经接受了(或即将接受)它,因此它就活了下来。而且它确实是有好处的:更快地启动,更简单地管理那些有依赖的服务程序,提供强大且安全的日志系统等。 + +因此在这篇教程中,我们将探索 Systemd 的特性,并向您展示如何最有效地利用这些特性。即便您此刻并不是这款软件的粉丝,读完本文后您至少可以更加了解和适应它。 + +![](http://narf-archive.com/pix/bd0fb252416206158627fb0b1bff9b4779dca13f.gif) + +*这部没正经的动画片来自[http://tinyurl.com/m2e7mv8][2],它把 Systemd 塑造成一只狂暴的动物,吞噬它路过的一切。大多数批评者的言辞可不像这只公仔一样柔软。* + +### 启动及服务 ### + +大多数主流发行版要么已经采用 Systemd,要么即将在下个发布中采用(如 Debian 和 Ubuntu)。在本教程中,我们使用 Fedora 21(该发行版已经是 Systemd 的优秀实验场地)的一个预览版进行演示,但不论您用哪个发行版,要用到的命令和注意事项都应该是一样的。这是 Systemd 的一个加分点:它消除了不同发行版之间许多细微且琐碎的区别。 + +在终端中输入 `ps ax | grep systemd`,看到第一行,其中的数字 **1** 表示它的进程号是1,也就是说它是 Linux 内核发起的第一个程序。因此,内核一旦检测完硬件并组织好了内存,就会运行 `/usr/lib/systemd/systemd` 可执行程序,这个程序会按顺序依次发起其他程序。(在还没有 Systemd 的日子里,内核会去运行 `/sbin/init`,随后这个程序会在名为 SysVinit 的系统中运行其余的各种启动脚本。) + +Systemd 的核心是一个叫*单元* (unit)的概念,它是一些存有关于服务(service)(在运行在后台的程序)、设备、挂载点、和操作系统其他方面信息的配置文件。Systemd 的其中一个目标就是简化这些事物之间的相互作用,因此如果你有程序需要在某个挂载点被创建或某个设备被接入后开始运行,Systemd 可以让这一切正常运作起来变得相当容易。(在没有 Systemd 的日子里,要使用脚本来把这些事情调配好,那可是相当丑陋的。)要列出您 Linux 系统上的所有单元,输入以下命令: + + systemctl list-unit-files + +现在,`systemctl` 是与 Systemd 交互的主要工具,它有不少选项。在单元列表中,您会注意到这儿有一些格式化:被使能(enabled)的单元显示为绿色,被禁用(disabled)的显示为红色。标记为“static”的单元不能直接启用,它们是其他单元所依赖的对象。若要限制输出列表只包含服务,使用以下命令: + + systemctl list-unit-files --type=service + +注意,一个单元显示为“enabled”,并不等于对应的服务正在运行,而只能说明它可以被开启。要获得某个特定服务的信息,以 GDM (Gnome Display Manager) 为例,输入以下命令: + + systemctl status gdm.service + +这条命令提供了许多有用的信息:一段给人看的服务描述、单元配置文件的位置、启动的时间、进程号,以及它所从属的 CGroups(用以限制各组进程的资源开销)。 + +如果您去查看位于 `/usr/lib/systemd/system/gdm.service` 的单元配置文件,您可以看到各种选项,包括要被运行的二进制文件(“ExecStart”那一行),相冲突的其他单元(即不能同时进入运行的单元),以及需要在本单元执行前进入运行的单元(“After”那一行)。一些单元有附加的依赖选项,例如“Requires”(必要的依赖)和“Wants”(可选的依赖)。 + +此处另一个有趣的选项是: + + Alias=display-manager.service + +当您启动 **gdm.service** 后,您将可以通过 `systemctl status display-manager.service` 来查看它的状态。当您知道有*显示管理程序* (display manager)在运行并想对它做点什么,但您不关心那究竟是 GDM,KDM,XDM 还是什么别的显示管理程序时,这个选项会非常有用。 + +![Image](http://www.linuxvoice.com/wp-content/uploads/2015/10/status-large.jpg) + +*使用 systemctl status 命令后面跟一个单元名,来查看对应的服务有什么情况。* + +### “目标(target)”锁定 ### + +如果您在 `/usr/lib/systemd/system` 目录中输入 `ls` 命令,您将看到各种以 `.target` 结尾的文件。*启动目标* (target)是一种将多个单元聚合在一起以致于将它们同时启动的方式。例如,对大多数类 Unix 操作系统而言有一种“多用户(multi-user)”状态,意思是系统已被成功启动,后台服务正在运行,并且已准备好让一个或多个用户登录并工作——至少在文本模式下。(其他状态包括用于进行管理工作的单用户(single-user)状态,以及用于机器关机的重启(reboot)状态。) + +如果您打开 **multi-user.target** 文件一探究竟,您可能期待看到的是一个要被启动的单元列表。但您会发现这个文件内部几乎空空如也——其实,一个服务会通过 **WantedBy** 选项让自己成为启动目标的依赖。因此如果您去打开 **avahi-daemon.service**, **NetworkManager.service** 及其他 **.service** 文件看看,您将在 Install 段看到这一行: + + WantedBy=multi-user.target + +因此,切换到多用户启动目标会使能(enable)那些包含上述语句的单元。还有其他一些启动目标可用(例如 **emergency.target** 提供一个紧急情况使用的 shell,以及 **halt.target** 用于机器关机),您可以用以下方式轻松地在它们之间切换: + + systemctl isolate emergency.target + +在许多方面,这些都很像 SysVinit 中的*运行级* (runlevel),如文本模式的 **multi-user.target** 类似于第3运行级,**graphical.target** 类似于第5运行级,**reboot.target** 类似于第6运行级,诸如此类。 + +![Image](http://www.linuxvoice.com/wp-content/uploads/2015/10/unit-large.jpg) + +**与传统的脚本相比,单元配置文件也许看起来很陌生,但并不难以理解。** + +### 开启与停止 ### + +现在您也许陷入了沉思:我们已经看了这么多,但仍没看到如何停止和开启服务!这其实是有原因的。从外部看,Systemd 也许很复杂,像野兽一般难以驾驭。因此在您开始摆弄它之前,有必要从宏观的角度看看它是如何工作的。实际用来管理服务的命令非常简单: + + systemctl stop cups.service + systemctl start cups.service + +(若某个单元被禁用了,您可以先通过 `systemctl enable` 加上该单元名的方式将其使能。这种做法会为该单元创建一个符号链接,并将其放置在当前启动目标的 `.wants` 目录下,这些 `.wants` 目录在`/etc/systemd/system` 文件夹中。) + +还有两个有用的命令是 `systemctl restart` 和 `systemctl reload`,后面接单元名。后者用于让单元重新加载它的配置文件。Systemd 的绝大部分都有良好的文档,因此您可以查看手册 (`man systemctl`) 了解每条命令的细节。 + +### 定时器单元:取代 Cron ### + +除了系统初始化和服务管理,Systemd 还染指了其他方面。在很大程度上,它能够完成 **cron** 的工作,而且可以说是以更灵活的方式(并带有更易读的语法)。**cron** 是一个以规定时间间隔执行任务的程序——例如清除临时文件,刷新缓存等。 + +如果您再次进入 `/usr/lib/systemd/system` 目录,您会看到那儿有多个 `.timer` 文件。用 `less` 来查看这些文件,您会发现它们与 `.service` 和 `.target` 文件有着相似的结构,而区别在于 `[Timer]` 段。举个例子: + + [Timer] + OnBootSec=1h + OnUnitActiveSec=1w + +**OnBootSec** 选项告诉 Systemd 在系统启动一小时后启动这个单元。第二个选项的意思是:自那以后每周启动这个单元一次。关于定时器有大量选项您可以设置,输入 `man systemd.time` 查看完整列表。 + +Systemd 的时间精度默认为一分钟。也就是说,它会在设定时刻的一分钟内运行单元,但不一定精确到那一秒。这么做是基于电源管理方面的原因,但如果您需要一个没有任何延时且精确到毫秒的定时器,您可以添加以下一行: + + AccuracySec=1us + +另外, **WakeSystem** 选项(可以被设置为 true 或 false)决定了定时器是否可以唤醒处于休眠状态的机器。 + +![Image](http://www.linuxvoice.com/wp-content/uploads/2015/10/systemd_gui-large.jpg) + +*有一个 Systemd 的图形界面程序,即便它已有多年未被积极维护。* + +### 日志文件:向 journald 问声好 ### + +Systemd 的第二个主要部分是 journal 。这是个日志系统,类似于 syslog 但也有些显著区别。如果您是个 Unix 日志管理模式的粉丝,准备好出离愤怒吧:这是个二进制日志,因此您不能使用常规的命令行文本处理工具来解析它。这个设计决定不出意料地在网上引起了激烈的争论,但它的确有些优点。例如,日志可以被更系统地组织,带有更多的元数据,因此可以更容易地根据可执行文件名和进程号等过滤出信息。 + +要查看整个 journal,输入以下命令: + + journalctl + +像许多其他的 Systemd 命令一样,该命令将输出通过管道的方式引向 `less` 程序,因此您可以使用空格键向下滚动,键入`/`(斜杠)查找,以及其他熟悉的快捷键。您也能在此看到少许颜色,像红色的警告及错误信息。 + +以上命令会输出很多信息。为了限制其只输出本次启动的消息,使用如下命令: + + journalctl -b + +这就是 Systemd 大放异彩的地方!您想查看自上次启动以来的全部消息吗?试试 **journalctl -b -1** 吧。再上一次的?用 **-2** 替换 **-1** 吧。那自某个具体时间,例如2014年10月24日16:38以来的呢? + + journalctl -b --since=”2014-10-24 16:38” + +即便您对二进制日志感到遗憾,那依然是个有用的特性,并且对许多系统管理员来说,构建类似的过滤器比起写正则表达式而言容易多了。 + +我们已经可以根据特定的时间来准确查找日志了,那可以根据特定程序吗?对单元而言,试试这个: + + journalctl -u gdm.service + +(注意:这是个查看 X server 产生的日志的好办法。)那根据特定的进程号? + + journalctl _PID=890 + +您甚至可以请求只看某个可执行文件产生的消息: + + journalctl /usr/bin/pulseaudio + +若您想将输出的消息限制在某个优先级,可以使用 **-p** 选项。该选项参数为 0 的话只会显示紧急消息(也就是说,是时候向 **$DEITY** 祈求保佑了)(LCTT 译注: $DEITY 是一个计算机方面的幽默,DEITY 是指广义上的“神”,$前缀表示这是一个变量),为 7 的话会显示所有消息,包括调试消息。请查看手册 (`man journalctl`) 获取更多关于优先级的信息。 + +值得指出的是,您也可以将多个选项结合在一起,若想查看在当前启动中由 GDM 服务输出的优先级数小于等于 3 的消息,请使用下述命令: + + journalctl -u gdm.service -p 3 -b + +最后,如果您仅仅想打开一个随 journal 持续更新的终端窗口,就像在没有 Systemd 时使用 `tail` 命令实现的那样,输入 `journalctl -f` 就好了。 + +![](http://www.linuxvoice.com/wp-content/uploads/2015/10/journal-large.jpg) + +*二进制日志并不流行,但 journal 的确有它的优点,如非常方便的信息查找及过滤。* + +### 没有 Systemd 的生活?### + +如果您就是完全不能接受 Systemd,您仍然有一些主流发行版中的选择。尤其是 Slackware,作为历史最为悠久的发行版,目前还没有做出改变,但它的主要开发者并没有将其从未来规划中移除。一些不出名的发行版也在坚持使用 SysVinit 。 + +但这又将持续多久呢?Gnome 正越来越依赖于 Systemd,其他的主流桌面环境也会步其后尘。这也是引起 BSD 社区一阵恐慌的原因:Systemd 与 Linux 内核紧密相连,导致在某种程度上,桌面环境正变得越来越不可移植。一种折衷的解决方案也许会以 Uselessd ([http://uselessd.darknedgy.net][3]) 的形式到来:一种裁剪版的 Systemd,纯粹专注于启动和监控进程,而不消耗整个基础系统。 + +![Image](http://www.linuxvoice.com/wp-content/uploads/2015/10/gentoo-large.jpg) + +若您不喜欢 Systemd,可以尝试一下 Gentoo 发行版,它将 Systemd 作为初始化工具的一种选择,但并不强制用户使用 Systemd。 + +-------------------------------------------------------------------------------- + +via: http://www.linuxvoice.com/linux-101-get-the-most-out-of-systemd/ + +作者:[Mike Saunders][a] +译者:[Ricky-Gong](https://github.com/Ricky-Gong) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linuxvoice.com/author/mike/ +[1]:http://tinyurl.com/poorlennart +[2]:http://tinyurl.com/m2e7mv8 +[3]:http://uselessd.darknedgy.net/ diff --git a/translated/tech/20151117 Linux 101--Get the most out of Systemd.md b/translated/tech/20151117 Linux 101--Get the most out of Systemd.md deleted file mode 100644 index 1a382479ec..0000000000 --- a/translated/tech/20151117 Linux 101--Get the most out of Systemd.md +++ /dev/null @@ -1,171 +0,0 @@ -Linux 101:最有效地使用 Systemd -================================================================================ -干嘛要这么做? - -- 理解现代 Linux 发行版中的显著变化; -- 看看 Systemd 是如何取代 SysVinit 的; -- 处理好*单元* (unit)和新的 journal 日志。 - -吐槽邮件,人身攻击,死亡威胁——Lennart Poettering,Systemd 的作者,对收到这些东西早就习以为常了。这位 Red Hat 公司的员工最近在 Google+ 上怒斥 FOSS 社区([http://tinyurl.com/poorlennart][1])的本质,悲痛且失望地表示:“那真是个令人恶心的地方”。他着重指出 Linus Torvalds 在邮件列表上言辞刻薄的帖子,并谴责这位内核的领导者为在线讨论定下基调,并使得人身攻击及贬抑之辞成为常态。 - -但为何 Poettering 会遭受如此多的憎恨?为何就这么个搞搞开源软件的人要忍受这等愤怒?答案就在于他的软件的重要性。如今大多数发行版中,Systemd 是 Linux 内核发起的第一个程序,并且它还扮演多种角色。它会启动系统服务,处理用户登陆,每隔特定的时间执行一些任务,还有很多很多。它在不断地成长,并逐渐成为 Linux 的某种“基础系统”——提供系统启动和发行版维护所需的所有工具。 - -如今,在以下几点上 Systemd 颇具争议:它逃避了一些确立好的 Unix 传统,例如纯文本的日志文件;它被看成是个“大一统”的项目,试图接管一切;它还是我们这个操作系统的支柱的重要革新。然而大多数主流发行版已经接受了(或即将接受)它,因此它就保留了下来。而且它确实是有好处的:更快地启动,更简单地管理那些有依赖的服务程序,提供强大且安全的日志系统等。 - -因此在这篇教程中,我们将探索 Systemd 的特性,并向您展示如何最有效地利用这些特性。即便您此刻并不是这款软件的粉丝,读完本文后您至少可以更加了解和适应它。 - -![Image](http://www.linuxvoice.com/wp-content/uploads/2015/10/eating-large.jpg) - -**这部没正经的动画片来自[http://tinyurl.com/m2e7mv8][2],它把 Systemd 塑造成一只狂暴的动物,吞噬它路过的一切。大多数批评者的言辞可不像这只公仔一样柔软。** - -### 启动及服务 ### - -大多数主流发行版要么已经采用 Systemd,要么即将在下个发布中采用(如 Debian 和 Ubuntu)。在本教程中,我们使用 Fedora 21——该发行版已经是 Systemd 的优秀实验场地——的一个预览版进行演示,但不论您用哪个发行版,要用到的命令和注意事项都应该是一样的。这是 Systemd 的一个加分点:它消除了不同发行版之间许多细微且琐碎的区别。 - -在终端中输入 **ps ax | grep systemd**,看到第一行,其中的数字 **1** 表示它的进程号是1,也就是说它是 Linux 内核发起的第一个程序。因此,内核一旦检测完硬件并组织好了内存,就会运行 **/usr/lib/systemd/systemd** 可执行程序,这个程序会按顺序依次发起其他程序。(在还没有 Systemd 的日子里,内核会去运行 **/sbin/init**,随后这个程序会在名为 SysVinit 的系统中运行其余的各种启动脚本。) - -Systemd 的核心是一个叫*单元* (unit)的概念,它是一些存有关于服务(在运行在后台的程序),设备,挂载点,和操作系统其他方面信息的配置文件。Systemd 的其中一个目标就是简化这些事物之间的相互作用,因此如果你有程序需要在某个挂载点被创建或某个设备被接入后开始运行,Systemd 可以让这一切正常运作起来变得相当容易。(在没有 Systemd 的日子里,要使用脚本来把这些事情调配好,那可是相当丑陋的。)要列出您 Linux 系统上的所有单元,输入以下命令: - - systemctl list-unit-files - -现在,**systemctl** 是与 Systemd 交互的主要工具,它有不少选项。在单元列表中,您会注意到这儿有一些格式:被使能的单元显示为绿色,被禁用的显示为红色。标记为“static”的单元不能直接启用,它们是其他单元所依赖的对象。若要限制输出列表只包含服务,使用以下命令: - - systemctl list-unit-files --type=service - -注意,一个单元显示为“enabled”,并不等于对应的服务正在运行,而只能说明它可以被开启。要获得某个特定服务的信息,以 GDM (the Gnome Display Manager) 为例,输入以下命令: - - systemctl status gdm.service - -这条命令提供了许多有用的信息:一段人类可读的服务描述,单元配置文件的位置,启动的时间,进程号,以及它所从属的 CGroups (用以限制各组进程的资源开销)。 - -如果您去查看位于 **/usr/lib/systemd/system/gdm.service** 的单元配置文件,您可以看到多种选项,包括要被运行的二进制文件(“ExecStart”那一行),相冲突的其他单元(即不能同时进入运行的单元),以及需要在本单元执行前进入运行的单元(“After”那一行)。一些单元有附加的依赖选项,例如“Requires”(必要的依赖)和“Wants”(可选的依赖)。 - -此处另一个有趣的选项是: - - Alias=display-manager.service - -当您启动 **gdm.service** 后,您将可以通过 **systemctl status display-manager.service** 来查看它的状态。当您知道有*显示管理程序* (display manager)在运行并想对它做点什么,但您不关心那究竟是 GDM,KDM,XDM 还是什么别的显示管理程序时,这个选项会非常有用。 - -![Image](http://www.linuxvoice.com/wp-content/uploads/2015/10/status-large.jpg) - -**使用 systemctl status 命令后面跟一个单元名,来查看对应的服务有什么情况。** - -### “目标”锁定 ### - -如果您在 **/usr/lib/systemd/system** 目录中输入 **ls** 命令,您将看到各种以 **.target** 结尾的文件。一个*启动目标* (target)是一种将多个单元聚合在一起以致于将它们同时启动的方式。例如,对大多数类 Unix 操作系统而言有一种“多用户”状态,意思是系统已被成功启动,后台服务正在运行,并且已准备好让一个或多个用户登陆并工作——至少在文本模式下。(其他状态包括用于进行管理工作的单用户状态,以及用于机器关机的重启状态。) - -如果您打开 **multi-user.target** 文件一探究竟,您可能期待看到的是一个要被启动的单元列表。但您会发现这个文件内部几乎空空如也——其实,一个服务会通过 **WantedBy** 选项让自己成为启动目标的依赖。因此如果您去打开 **avahi-daemon.service**, **NetworkManager.service** 及其他 **.service** 文件看看,您将在 Install 段看到这一行: - - WantedBy=multi-user.target - -因此,切换到多用户启动目标会使能那些包含上述语句的单元。还有其他一些启动目标可用(例如 **emergency.target** 用于一个紧急情况使用的 shell,以及 **halt.target** 用于机器关机),您可以用以下方式轻松地在它们之间切换: - - systemctl isolate emergency.target - -在许多方面,这些都很像 SysVinit 中的*运行级* (runlevel),如文本模式的 **multi-user.target** 类似于第3运行级,**graphical.target** 类似于第5运行级,**reboot.target** 类似于第6运行级,诸如此类。 - -![Image](http://www.linuxvoice.com/wp-content/uploads/2015/10/unit-large.jpg) - -**与传统的脚本相比,单元配置文件也许看起来很陌生,但并不难以理解。** - -### 开启与停止 ### - -现在您也许陷入了沉思:我们已经看了这么多,但仍没看到如何停止和开启服务!这其实是有原因的。从外部看,Systemd 也许很复杂,像野兽一般难以驾驭。因此在您开始摆弄它之间,有必要从宏观的角度看看它是如何工作的。实际用来管理服务的命令非常简单: - - systemctl stop cups.service - systemctl start cups.service - -(若某个单元被禁用了,您可以先通过 **systemctl enable** 加该单元名的方式将其使能。这种做法会为该单元创建一个符号链接,并将其放置在当前启动目标的 .wants 目录下,这些 .wants 目录在**/etc/systemd/system** 文件夹中。) - -还有两个有用的命令是 **systemctl restart** 和 **systemctl reload**,后面接单元名。后者要求单元重新加载它的配置文件。Systemd 的绝大部分都有良好的文档,因此您可以查看手册 (**man systemctl**) 了解每条命令的细节。 - -> ### 定时器单元:取代 Cron ### -> -> 除了系统初始化和服务管理,Systemd 还染指其他方面。在很大程度上,它能够完成 **cron** 的工作,而且可以说是以更灵活的方式(并带有更易读的语法)。**cron** 是一个以规定时间间隔执行任务的程序——例如清楚临时文件,刷新缓存等。 -> -> 如果您再次进入 **/usr/lib/systemd/system** 目录,您会看到那儿有多个 **.timer** 文件。用 **less** 来查看这些文件,您会发现它们与 **.service** 和 **.target** 文件有着相似的结构,而区别在于 **[Timer]** 段。举个例子: -> -> [Timer] -> OnBootSec=1h -> OnUnitActiveSec=1w -> -> **OnBootSec** 选项告诉 Systemd 在系统启动一小时后启动这个单元。第二个选项的意思是:自那以后每周启动这个单元一次。关于定时器有大量选项您可以设置——输入 **man systemd.time** 查看完整列表。 -> -> Systemd 的时间精度默认为一分钟。也就是说,它会在设定时刻的一分钟内运行单元,但不一定精确到那一秒。这么做是基于电源管理方面的原因,但如果您需要一个没有任何延时且精确到毫秒的定时器,您可以添加以下一行: -> -> AccuracySec=1us -> -> 另外, **WakeSystem** 选项(可以被设置为 true 或 false)决定了定时器是否可以唤醒处于休眠状态的机器。 - -![Image](http://www.linuxvoice.com/wp-content/uploads/2015/10/systemd_gui-large.jpg) - -**存在一个 Systemd 的图形界面程序,即便它已有多年未被积极维护。** - -### 日志文件:向 journald 问声好 ### - -Systemd 的第二个主要部分是 journal 。这是个日志系统,类似于 syslog 但也有些显著区别。如果您是个 Unix 日志管理模式的 粉丝,准备好热血沸腾吧:这是个二进制日志,因此您不能使用常规的命令行文本处理工具来解析它。这个设计决定不出意料地在网上引起了激烈的争论,但它的确有些优点。例如,日志可以被更系统地组织,带有更多元数据,因此可以更容易地根据可执行文件名和进程号等过滤出信息。 - -要查看整个 journal,输入以下命令: - - journalctl - -像许多其他的 Systemd 命令一样,该命令将输出通过管道的方式引向 **less** 程序,因此您可以使用空格键向下滚动,“/”(斜杠)键查找,以及其他熟悉的快捷键。您也能在此看到少许颜色,像红色的警告及错误信息。 - -以上命令会输出很多信息。为了限制其只输出当前启动的消息,使用如下命令: - - journalctl -b - -这就是 Systemd 大放异彩的地方!您想查看自上次启动以来的全部消息吗?试试 **journalctl -b -1** 吧。再上一次的?用 **-2** 替换 **-1** 吧。那自某个具体时间,例如2014年10月24日16:38以来的呢? - - journalctl -b --since=”2014-10-24 16:38” - -即便您对二进制日志感到遗憾,那依然是个有用的特性,并且对许多系统管理员来说,构建类似的过滤器比起写正则表达式而言容易多了。 - -我们已经可以根据特定的时间来准确查找日志了,那可以根据特定程序吗?对单元而言,试试这个: - - journalctl -u gdm.service - -(注意:这是个查看 X server 产生的日志的好办法。)那根据特定的进程号? - - journalctl _PID=890 - -您甚至可以请求只看某个可执行文件产生的消息: - - journalctl /usr/bin/pulseaudio - -若您想将输出的消息限制在某个优先级,可以使用 **-p** 选项。该选项参数为 0 的话只会显示紧急消息(也就是说,是时候向 **\$DEITY** 祈求保佑了),为 7 的话会显示所有消息,包括调试消息。请查看手册 (**man journalctl**) 获取更多关于优先级的信息。 - -值得指出的是,您也可以将多个选项结合在一起,若想查看在当前启动中由 GDM 服务输出的优先级数小于等于 3 的消息,请使用下述命令: - - journalctl -u gdm.service -p 3 -b - -最后,如果您仅仅想打开一个随 journal 持续更新的终端窗口,就像在没有 Systemd 时使用 tail 命令实现的那样,输入 **journalctl -f** 就好了。 - -![Image](http://www.linuxvoice.com/wp-content/uploads/2015/10/journal-large.jpg) - -**二进制日志并不流行,但 journal 的确有它的优点,如非常方便的信息查找及过滤。** - -> ### 没有 Systemd 的生活?### -> -> 如果您就是完全不能接收 Systemd,您仍然有一些主流发现版中的选择。尤其是 Slackware,作为历史最为悠久的发行版,目前还没有做出改变,但它的主要开发者并没有将其从未来规划中移除。一些不出名的发行版也在坚持使用 SysVinit 。 -> -> 但这又将持续多久呢?Gnome 正越来越依赖于 Systemd,其他的主流桌面环境也会步其后尘。这也是引起 BSD 社区一阵恐慌的原因:Systemd 与 Linux 内核紧密相连,导致在某种程度上,桌面环境正变得越来越不可移植。一种折中的解决方案也许会以 Uselessd ([http://uselessd.darknedgy.net][3]) 的形式到来:一种裁剪版的 Systemd,纯粹专注于启动和监控进程,而不消耗整个基础系统。 -> -> ![Image](http://www.linuxvoice.com/wp-content/uploads/2015/10/gentoo-large.jpg) -> -> 若您不喜欢 Systemd,可以尝试一下 Gentoo 发行版,它将 Systemd 作为初始化工具的一种选择,但并不强制用户使用 Systemd。 - --------------------------------------------------------------------------------- - -via: http://www.linuxvoice.com/linux-101-get-the-most-out-of-systemd/ - -作者:[Mike Saunders][a] -译者:[Ricky-Gong](https://github.com/Ricky-Gong) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.linuxvoice.com/author/mike/ -[1]:http://tinyurl.com/poorlennart -[2]:http://tinyurl.com/m2e7mv8 -[3]:http://uselessd.darknedgy.net/ From 3cddd4e586cf0ca9b5c8e27b84c96ba0b25374a9 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 15 Jan 2016 06:40:24 +0800 Subject: [PATCH 0219/1469] PUB:20151208 How to renew the ISPConfig 3 SSL Certificate @geekpi --- ...o renew the ISPConfig 3 SSL Certificate.md | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) rename {translated/tech => published}/20151208 How to renew the ISPConfig 3 SSL Certificate.md (55%) diff --git a/translated/tech/20151208 How to renew the ISPConfig 3 SSL Certificate.md b/published/20151208 How to renew the ISPConfig 3 SSL Certificate.md similarity index 55% rename from translated/tech/20151208 How to renew the ISPConfig 3 SSL Certificate.md rename to published/20151208 How to renew the ISPConfig 3 SSL Certificate.md index a2ce4f1d1c..ea132d4185 100644 --- a/translated/tech/20151208 How to renew the ISPConfig 3 SSL Certificate.md +++ b/published/20151208 How to renew the ISPConfig 3 SSL Certificate.md @@ -1,20 +1,20 @@ -如何更新ISPConfig 3 SSL证书 +如何更新 ISPConfig 3 SSL 证书 ================================================================================ -本教程描述了如何再ISPConfig 3控制面板中更新SSL证书。有两个可选的方法: +本教程描述了如何在 ISPConfig 3控制面板中更新 SSL 证书。有两个可选的方法: -- 用OpenSSL创建一个新的OpenSSL证书和CSR。 -- 用ISPConfig updater更新SSL证书 +- 用 OpenSSL 创建一个新的 OpenSSL 证书和 CSR。 +- 用 ISPConfig updater 更新 SSL 证书 -我将会用手工的方法更新ssl证书。 +我将从用手工的方法更新 SSL 证书开始。 -### 1)用OpenSSL创建一个新的ISPConfig 3 SSL 证书 ### +### 1)用 OpenSSL 创建一个新的 ISPConfig 3 SSL 证书 ### -用root用户登录你的服务器。在创建一个新的SSL证书之前,备份现有的。SSL证书是安全敏感的,因此我将它存储在/root/目录下。 +用 root 用户登录你的服务器。在创建一个新的 SSL 证书之前,先备份现有的。SSL 证书是安全敏感的,因此我将它存储在 /root/ 目录下。 tar pcfz /root/ispconfig_ssl_backup.tar.gz /usr/local/ispconfig/interface/ssl chmod 600 /root/ispconfig_ssl_backup.tar.gz -> 现在创建一个新的SSL证书密钥,证书请求(csr)和自签发证书。 +> 现在创建一个新的 SSL 证书密钥,证书请求(CSR)和自签发证书。 cd /usr/local/ispconfig/interface/ssl openssl genrsa -des3 -out ispserver.key 4096 @@ -25,13 +25,13 @@ mv ispserver.key ispserver.key.secure mv ispserver.key.insecure ispserver.key -重启apache来加载新的SSL证书 +重启 apache 来加载新的 SSL 证书 service apache2 restart -### 2)用ISPConfig安装器来更新SSL证书 ### +### 2)用 ISPConfig 安装器来更新 SSL 证书 ### -另一个获取新的SSL证书的替代方案是使用ISPConfig更新脚本。下载ISPConfig到/tmp目录下,解压包并运行脚本。 +另一个获取新的 SSL 证书的替代方案是使用 ISPConfig 更新脚本。下载 ISPConfig 到 /tmp 目录下,解压包并运行脚本。 cd /tmp wget http://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz @@ -39,11 +39,11 @@ cd ispconfig3_install/install php -q update.php -更新脚本会在更新时询问下面的额问题: +更新脚本会在更新时询问下面的问题: Create new ISPConfig SSL certificate (yes,no) [no]: -这里回答“yes”,SSL证书创建对话框就会启动。 +这里回答“yes”,SSL 证书创建对话框就会启动。 -------------------------------------------------------------------------------- @@ -51,7 +51,7 @@ via: http://www.faqforge.com/linux/how-to-renew-the-ispconfig-3-ssl-certificate/ 作者:[Till][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 a1eaadc2e82367bfbfb32c260f7515daa81e424d Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 15 Jan 2016 10:48:23 +0800 Subject: [PATCH 0220/1469] PUB:20151225 What are the best plugins to increase productivity on Emacs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @zky001 有些地方还是不够细致,建议翻译完了自己通读一遍,或者稍微放放再去读。 --- ...ugins to increase productivity on Emacs.md | 79 ++++++++++++++++ ...ugins to increase productivity on Emacs.md | 91 ------------------- 2 files changed, 79 insertions(+), 91 deletions(-) create mode 100644 published/20151225 What are the best plugins to increase productivity on Emacs.md delete mode 100644 translated/tech/20151225 What are the best plugins to increase productivity on Emacs.md diff --git a/published/20151225 What are the best plugins to increase productivity on Emacs.md b/published/20151225 What are the best plugins to increase productivity on Emacs.md new file mode 100644 index 0000000000..8e063d3693 --- /dev/null +++ b/published/20151225 What are the best plugins to increase productivity on Emacs.md @@ -0,0 +1,79 @@ +提升 emacs 生产力的十大最佳插件 +================================================================================ + +一年前的这个时候,我想要寻找[将 Vim 打造成一个成熟的全功能的 IDE][1] 的最好插件。有趣的是,那篇文章的很多评论提到了 Emacs 已经大部分有了这些内置插件,已经是一个很棒的 IDE 了。尽管我对 Emacs 的难以置信的多样化表示赞同,它依旧不是一个可以开箱即用的高级编辑器。还好,其庞大的插件库可以解决这个问题。但在过多的选择中,有时很难弄清该如何入手。因此,现在让我试着收集一个不可或缺的插件的简短列表,来提升你使用 Emacs 时的工作效率。 虽然我主要侧重于与编程相关的生产力提升,但是这些插件对所有人或不同用途都是有用的。 + +### 1. Ido-mode ### + +![](https://c2.staticflickr.com/6/5718/23311895573_c1fb34337c_c.jpg) + +Ido 或许是对新手最有用的一个插件,Ido 的意思是交互式工作(interactively do)。它取代了大部分的用花哨字符匹配菜单的枯燥提示。好比说,它用列出了当前目录所有文件的列表来取代了常规的打开文件提示符。输入一些字符,Ido 将尝试匹配最合适的文件。它通过可视化让你的操作变得更容易,这也是一个快速遍历所有文件都有相同前缀的文件夹的方法。 + +### 2. Smex ### + +![](https://c2.staticflickr.com/2/1517/23310442314_2a22a60c34_c.jpg) + +它不算最著名的一个、但却是一个替代 Ido-mode 的好选择:Smex 可以优雅的替代普通的`M-x`提示符,灵感大部分来自于 Ido-mode。它也给调用`M-x`后输入的命令带来了同样的交互搜索能力。它简单而有效,是一个为常用操作提升效率的最好方法。 + +### 3. Auto Complete ### + +![](https://c2.staticflickr.com/6/5794/23643004900_3042f77952_c.jpg) + +知道这个插件的存在之前,我在 Emacs 里面有一半的时间花在敲击 `M-/` 来补完单词上。现在,我有一个漂亮的弹出菜单可以为我做自动补全。无须多说,我们都需要它。 + +### 4. YASnippet ### + +![](https://c2.staticflickr.com/2/1688/23830403072_0d8df6ef4c_b.jpg) + +这是真正的程序员必备利器。总有一些代码片段会让我们觉得我们一辈子都在写它。对我来说,就是调试 PHP 时不断输入的 `var_dump(...);exit;`。经过一段时间一遍又一遍的输入`var_dump(...);exit;`,我觉得我可以预先把其做成录制好的、方便用到的代码片段。使用 YASnippets,可以很容易导入代码片段文件或者自己做个。之后,只要按下一个 tab 键,就可以将一个小的关键词扩展成一大段预先写好的代码,然后可以很方便地在里面修改。 + +### 5. Org-mode ### + +![](https://c2.staticflickr.com/6/5687/23570808789_d683c949e4.jpg) + +免责声明,我最近才开始使用 Org-mode,但它已经深深的吸引了我。从我看过数以百计的文章来说,Org-mode 可以改变你的生活。它背后的想法很简单:它是一种用普通文本做简单备注的模式,可以很容易地在任务列表和各种数据中转来转去,并进行一些比如按优先级或到期日期的过滤,或设置一个重复日期。然而,虽然思路简单,但你可以做到很多,用各种方法用于各种用途。与其去看一个长长的介绍,我觉得你可以去读读[现有教程][2],有很多视频可以看,自己去体验一下 Org-mode 是多么强大。 + +### 6. Helm ### + +![](https://c2.staticflickr.com/2/1489/23310442334_5e6db22b79_c.jpg) + +一些使用者喜欢它,但是其他人没有这么大的使用热情。我是后者的一部分。但在拥有这样一个庞大的追随者的情况下,是不能不提到它的。Helm 旨在完全变换你的 Emacs 使用体验。简单来说,Helm 是一个在 Emacs 中帮助你快速找到一个文件或命令的框架。根据你的输入,它将尝试使用词语自动完成来引导你将大脑的念头变为行动。起初感觉有点奇怪,但对一些人来说,Helm 本身就是一个信仰。虽然我不是 Helm 的粉丝,我欣赏 helm-occur 这一个伟大的工具可以在一个大文档搜索字符串并且在一个单独的缓冲区显示所有匹配结果,以便很容易在它们之间跳转。如果你正在寻找一个快速演示来了解 Helm 能做什么,我推荐[这篇文章][3]。 + +### 7. ace-jump-mode ### + +![](https://c2.staticflickr.com/2/1710/23856168871_6df1faa565_c.jpg) + +这是另一个有一大群追随者的插件,我正在试图成为 ace-jump-mode 的粉丝。掌握这个插件,你会体验到超越鼠标感受。简单描述一下,通过你选择的快捷方式触发 ace-jump-mode 后,你会被提示输入字符。输入一个字符,所有以该字符开头的单词中的那个字符就会替换成一个唯一字符并被高亮。输入一个屏幕上的高亮字符,你的光标会直接跳转到高亮显示的那个词。我不得不承认,这让我使用它时有点反应不过来,但是,一旦你掌握它,它将显著提升你在一个文档里的移动速度。(LCTT 译注:用文字描述比较困难,如截图中,你输入的是一个“i”,然后屏幕中所有以“i”开头的单词中的那个“i”都被替换成了从 a 到 z 的字符,并高亮;你可以输入这些高亮的字符直接跳转到那个位置。) + +### 8. find-file-in-project ### + +![](https://c2.staticflickr.com/2/1492/23570808809_96ec8454a9_c.jpg) + +如果你喜欢 Sublime text 以及它可以用非常方便的`Ctrl-p`模糊搜索来打开一个项目中的任何文件的功能,你将会喜欢上 find-file-in-project (简称 ffip)的。使用设置指定了您的版本控制的根文件夹后,您可以轻松地调出一个很酷的文本条,通过快速扫描和搜索你的代码,来根据你输入的名称找到匹配的文件。我喜欢把它绑定到键盘上的 F6 键。如果你不知道整个目录从上到下的复杂结构,这很简单,而且非常易用。 + +### 9. Flymake ### + +![](https://c2.staticflickr.com/6/5708/23310442354_cbba657ed3.jpg) + +对 IDE 的爱好者来说,我认为语法检查器是 IDE 最强大的特性之一,它非常适合初学者和方便了那些疲惫的程序员。感谢 Flymake,Emacs 用户也可以享受到了语法检查器。因为我工作中用 PHP 很多,Flymake 就不需要任何额外的配置。当我写代码的时候,它会自动检查我的代码和高亮任何一个包含问题的行。对于编译语言,Flymake 将寻找一个用于检查你的代码的 Makefile。真神奇。 + +### 10. electric-pair ### + +最后,但并非最不重要,在我看来,electric-pair 是最简单但最强大的插件之一。它会自动关闭你输入的括号。它起初看起来并不是很有用,但相信我,在被寻找配对括号折磨几百次之后,你会很高兴有这么一个插件,可以确保你所有的表达式的括号都是一一对应的。 + +总结一下,Emacs 是一个奇妙的工具。这可不是一个令人惊讶的说法。试试这些插件,看着你的效率直线飙升吧。这个列表当然不是详尽的列表。如果你想贡献你的建议,请在评论中这样做。我自己一直在寻找新的插件来试着发现 Emacs 的新体验。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/best-plugins-to-increase-productivity-on-emacs.html + +作者:[Adrien Brochard][a] +译者:[zky001](https://github.com/zky001) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/adrien +[1]:http://xmodulo.com/turn-vim-full-fledged-ide.html +[2]:http://orgmode.org/worg/org-tutorials/ +[3]:http://tuhdo.github.io/helm-intro.html diff --git a/translated/tech/20151225 What are the best plugins to increase productivity on Emacs.md b/translated/tech/20151225 What are the best plugins to increase productivity on Emacs.md deleted file mode 100644 index 86f163b7ff..0000000000 --- a/translated/tech/20151225 What are the best plugins to increase productivity on Emacs.md +++ /dev/null @@ -1,91 +0,0 @@ -提高emacs生产力的最好插件是什么 -================================================================================ -一年前的这个时候, 我想要寻找一个最好的插件 [将VIM打造成一个成熟的全功能的IDE][1]. 有趣的是, 很多评论那篇文章的是关于Emacs集成大部分这些插件,已经是一个伟大的IDE了. 尽管我对Emacs的难以置信的多样化表示赞成, 它依旧不是可以开箱即用(安装好不安插件即可用)的高级编辑器. 还好, 其庞大的插件库可以解决这个问题. 但在过多的选项中, 有时很难清楚该如何入手. 因此现在, 让我试着收集一个虽然简短但是不可或缺的插件列表来让你使用Emacs时提高工作效率. 虽然我主要侧重于与编程相关的生产力,但是这些插件将对任何人或对任何使用方法都是有用的. - -### 1. Ido-模式 ### - -![](https://c2.staticflickr.com/6/5718/23311895573_c1fb34337c_c.jpg) - -Ido 或许是对新手最有用的一个插件, Ido 表示交互式的去做.它取代大部分的用花哨的匹配字符提示的枯燥菜单 . 好比说, 它将取代正常的提示来打开一个拥有当前目录中的所有文件列表的文件. 任何字符串类型,Ido 将尝试匹配最合适的文件。它很容易想象你的行为,并迅速通过一个文件夹的所有文件命名相同的前缀来查找. - -### 2. Smex ### - -![](https://c2.staticflickr.com/2/1517/23310442314_2a22a60c34_c.jpg) - -不算最著名的一个,但却是一个好选择来完成那些由Ido-mode开始的工作:Smex可以优雅的替代正常的“M-x”提示,也有由Ido-mode带来的很大的启发。通常输入的命令调用“M-x”之后它带来同样的互动搜索。它既简单又有效,是一个很好的节省那些额外的你通常需要1秒的短时间方式 - -### 3. Auto Complete ### - -![](https://c2.staticflickr.com/6/5794/23643004900_3042f77952_c.jpg) - -知道这个插件的存在之前,我花了我一半的时间在使用Emacs敲击"M-/"来完成代码上。现在,我有一个漂亮的弹出为我去做自动补全。无须多说,只是我们都需要它。 - -### 4. YASnippet ### - -![](https://c2.staticflickr.com/2/1688/23830403072_0d8df6ef4c_b.jpg) - -这是真正的程序员所需利器。总有一些代码,我们觉得我们在它们上面用掉了所有的时间。对我来说,用"var_dump(…);exit;"来调试PHP。经过一段时间一遍又一遍的输入"var_dump(…);exit;",我就想到我可以预先把其作为录制好的,方便的代码片段。YASnippets,很容易导入片段文件或者自己制做。之后,一个简单的按制表键可以将一小关键词扩展成一块预先写好的代码易于使用者浏览和修改。 - - -### 5. Org-mode ### - -![](https://c2.staticflickr.com/6/5687/23570808789_d683c949e4.jpg) - -免责声明,我最近才开始使用Org-mode。但它已经深深的吸引了我。从我看过数以百计的书面作品来说,Org-mode可以改变你的生活。它背后的想法很简单:它是一种模式,简化了笔记,同时保持一个纯文本格式,便于浏览列表的任务和各种数据,并执行操作,如按优先级过滤或到期日期,或设置一个复发日期 。然而,从这个简单的想法,你可以完成很多,但也容易被所有的选项弄的不堪重负。与其去看一个长长的解释,我敦促你去通过[可用教程][2],看很多视频,自己去看看Org-mode是多么强大。 - - -### 6. Helm ### - -![](https://c2.staticflickr.com/2/1489/23310442334_5e6db22b79_c.jpg) - -一些使用者喜欢它,但是其他人没有这么大的使用热情。我是后者的一部分。但在拥有这样一个庞大的追随者群体的情况下,是不可能避免提到它的。Helm旨在完全变换你的Emacs使用体验。简单描述,Helm是一个这样的框架,在Emacs下将帮助您快速找到一个文件或命令。根据您的输入,它将尝试使用词语自动完成指导你大脑的念头变为行动。起初感觉有点奇怪,但对一些人来说,Helm本身就是一个信仰。虽然我不是Helm的粉丝,我欣赏helm-occur这一个伟大的工具在一个大文档搜索字符串并且在一个单独的缓冲区显示所有,因此很容易导航。如果你正在寻找一个快速演示来了解Helm能做什么,我推荐这篇文章[3]。 - - -### 7. ace-jump-mode ### - -![](https://c2.staticflickr.com/2/1710/23856168871_6df1faa565_c.jpg) - -另一个插件有一大群追随者,我试图加入ace-jump-mode的粉丝群。拥有这个插件,你会体验到胜于鼠标的使用。简单的描述,通过触发ace-jump-mode您选择的快捷方式,你将被提示字符。输入一个字符,所有单词将会出现,独特的字母字符将突出显示。输入一个字母在屏幕上,和你的光标会直接跳转到词高亮显示。我不得不承认,这是让反射很难使用它,但是,一旦你拥有它,它会增加你的在一个文档里光标的移动速度。 - - - -### 8. find-file-in-project ### - -![](https://c2.staticflickr.com/2/1492/23570808809_96ec8454a9_c.jpg) - -如果你喜欢Sublime text和它非常方便的“Ctrl-p”模糊搜索打开在一个项目中的任何文件,你将会喜欢上find-file-in-project(或ffip)。通过声明您的版本控制的根文件夹设置后,您可以轻松地收集一个快速扫描的很酷的标题文本并根据您输入的名称匹配的通过代码库搜索文件。我喜欢把它绑定到键盘上面F6键。如果你不知道从你的顶层目录到最基本文件的复杂结构,它很简单,很方便。 - - -### 9. Flymake ### - -![](https://c2.staticflickr.com/6/5708/23310442354_cbba657ed3.jpg) - -IDE的爱好者,我认为语法检查器是IDE最强大的特性之一。它非常适合初学者和方便码累了的程序员。感谢Flymake,Emacs用户也可以享受语法检查器 。因为我工作很多需要PHP,Flymake不需要任何额外的配置。当我写代码的时候,它会自动检查我的代码和高亮任何一个包含一个问题的行。对于编译语言,Flymake将寻找一个Makefile,它将用来检查代码。绝对不可思议。 - - - -### 10. electric-pair ### - -  最后,但并非最不重要,在我看来,electric-pair是最简单但最强大的插件之一。它就自动关闭括号或打开括号。它期初看起来不是很好,但相信我。第一百次挣扎后发现匹配的括号,你会很高兴有一个插件,确保你所有的表达式都是平衡的。   -   - - -总结一下,Emacs是一个奇妙的工具。这可不是一个令人惊哑的说法。试试这些插件和看着你的效率直线飙升。这当然不是详尽的列表。如果你想带来你的贡献,请在评论中这样做。我自己一直在寻找新的插件来体验Emacs,也在找寻新方法来体验Emacs。 - - - - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/best-plugins-to-increase-productivity-on-emacs.html - -作者:[Adrien Brochard][a] -译者:[zky001](https://github.com/zky001) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://xmodulo.com/author/adrien -[1]:http://xmodulo.com/turn-vim-full-fledged-ide.html -[2]:http://orgmode.org/worg/org-tutorials/ -[3]:http://tuhdo.github.io/helm-intro.html From 37acc33327f61e0563317f904e31d41bdf291388 Mon Sep 17 00:00:00 2001 From: name1e5s <836401406@qq.com> Date: Fri, 15 Jan 2016 12:36:39 +0800 Subject: [PATCH 0221/1469] translating sources/tech/20151202 8 things to do after installing openSUSE Leap 42.1.md --- ...51202 8 things to do after installing openSUSE Leap 42.1.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20151202 8 things to do after installing openSUSE Leap 42.1.md b/sources/tech/20151202 8 things to do after installing openSUSE Leap 42.1.md index bbd79c19a3..183d39252f 100644 --- a/sources/tech/20151202 8 things to do after installing openSUSE Leap 42.1.md +++ b/sources/tech/20151202 8 things to do after installing openSUSE Leap 42.1.md @@ -1,3 +1,4 @@ +#name1e5s Translating 8 things to do after installing openSUSE Leap 42.1 ================================================================================ ![Credit: Metropolitan Transportation/Flicrk](http://images.techhive.com/images/article/2015/11/things-to-do-100626947-primary.idge.jpg) @@ -105,4 +106,4 @@ via: http://www.itworld.com/article/3003865/open-source-tools/8-things-to-do-aft [3]:https://www.linux.com/learn/tutorials/857788-how-to-convert-videos-in-linux-using-the-command-line [4]:https://www.google.com/intl/en/chrome/browser/desktop/index.html#brand=CHMB&utm_campaign=en&utm_source=en-ha-na-us-sk&utm_medium=ha [5]:http://opensuse-community.org/ -[6]:http://www.itworld.com/article/2875981/the-5-best-open-source-email-clients-for-linux.html \ No newline at end of file +[6]:http://www.itworld.com/article/2875981/the-5-best-open-source-email-clients-for-linux.html From 1dd35ace0759c966803c46fa97844f5a10827c63 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 15 Jan 2016 22:54:25 +0800 Subject: [PATCH 0222/1469] PUB:20151229 Grub 2--Heal your bootloader MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @soooogreen 好长的文章,翻译的很不错,我修复了个别错误和用语——下周一发布出来。 --- .../20151229 Grub 2--Heal your bootloader.md | 236 ++++++++++++++++++ .../20151229 Grub 2--Heal your bootloader.md | 235 ----------------- 2 files changed, 236 insertions(+), 235 deletions(-) create mode 100644 published/20151229 Grub 2--Heal your bootloader.md delete mode 100644 translated/tech/20151229 Grub 2--Heal your bootloader.md diff --git a/published/20151229 Grub 2--Heal your bootloader.md b/published/20151229 Grub 2--Heal your bootloader.md new file mode 100644 index 0000000000..ef246a203a --- /dev/null +++ b/published/20151229 Grub 2--Heal your bootloader.md @@ -0,0 +1,236 @@ +Grub 2:拯救你的 bootloader +================================================================================ + +**没有什么事情比 bootloader 坏掉更让气人的了。充分发挥 Grub 2 的作用,让 bootloader 安分工作吧。** + +为什么这么说? + +- Grub 2 是最受欢迎的 bootloader ,几乎用在所有 Linux 发行版上。 +- bootloader 是一个至关重要的软件,但是非常容易损坏。 +- Grub 2 是兼具扩展性和灵活性的一款引导加载程序,提供了大量可定制选项。 + +Grub 2 是一款精彩的功能强大的软件。它不是 bootloader 界的一枝独秀,但却最受欢迎,几乎所有主要的桌面发行版都在使用它。 Grub 的工作有两个。首先,它用一个菜单展示计算机上所有已经安装的操作系统供你选择。其次,当你从启动菜单中选择了一个 Linux 操作系统, Grub 便加载这个 Linux 的内核。 + +你知道,如果使用 Linux ,你就离不开 bootloader 。然而它却是 Linux 发行版内部最鲜为人知的部分。在这篇文章里,我们将带你熟悉 Grub 2 一些著名的特性,强化你相关技能,使你在 bootloader 跑飞的时候能够自行处理。 + +Grub 2 最重要的部分是一堆文本文件和两个脚本文件。首先需要了解的是 `/etc/default/grub` 。这是一个文本文件,你可以在里面设置通用配置变量和 Grub 2 菜单(见下方 “常见用户设置” )的其它特性。 + +Grub 2 另一个重要的部分是 `/etc/grub.d` 文件夹。定义每个菜单项的所有脚本都放置在这里。这些脚本的名称必须有两位的数字前缀。其目的是,在构建 Grub 2 菜单时定义脚本的执行顺序以及相应菜单项的顺序。文件 `00_header` 首先被读取,负责解析 `/etc/default/grub` 配置文件。然后是 Linux 内核的菜单项,位于 `10_linux` 文件中。这个脚本在默认的 `/boot` 分区为每个内核创建一个正规菜单项和一个恢复菜单项。 + +紧接着的是为第三方应用所用的脚本,如 `30_os-prober` 和 `40_custom` 。 **os-prober** 脚本为内核和其它分区里的操作系统创建菜单项。它能识别安装的 Linux、 Windows、 BSD 以及 Mac OS X 。 如果你的硬盘布局比较独特,使得 **os-prober** 无法找到已经安装的发行版,你可以在 `40_custom` 文件(见下方 “添加自定义菜单项”)中添加菜单项。 + +**Grub** 2 不需要你手动维护你的启动选项的配置文件:取而代之的是使用 `grub2-mkconfig` 命令产生 `/boot/grub/grub.cfg` 文件。这个功能会解析 `/etc/grub.d` 目录中的脚本以及 `/etc/default/grub` 设置文件来定义你的设置情况。 + +###图形化的引导修复### + +多亏了 Boot Repair 应用,只需要点击按钮,Grub 2 许许多多的问题都能轻易解决。这个漂亮小巧的应用有一个直观的用户界面,可以扫描并识别多种硬盘布局和分区方案,还能发现并正确识别安装在其中的操作系统。这个应用可以处理传统计算机里的主引导记录(Master Boot Record) (MBR),也可以处理新型 UEFI 计算机中的 GUID 分区表(GUID Partition Table)(GPT)。 + +Boot Repair 最简单的使用方式是安装到 Live Ubuntu 会话中。在一个 bootloader 损坏的机器上启动 Ubuntu Live 发行版,先通过添加它的 PPA 版本库来安装 Boot Repair ,命令如下: + + sudo add-apt-repository ppa:yannubuntu/Boot Repair + +然后刷新版本库列表: + + sudo apt-get update + +安装应用,如下: + + sudo apt-get install -y Boot Repair + +安装完毕后就启动应用。在显示它的界面(由一对按键组成)之前将会扫描你的硬盘。根据工具的指示,只需按下 Recommended Repair(推荐的修复)按钮,即可修复大部分坏掉的 bootloader 。修复 bootloader 之后,这个工具会输出一个短小的 URL ,你应该把它记录下来。这个 URL 包含了硬盘详尽的信息:分区信息以及重要的 Grub 2 文件(如 `/etc/default/grub` 和 `/boot/grub/grub.cfg` )的内容。如果工具不能解决 bootloader 的问题,可以把你这个 URL 共享在你的发行版的论坛上,让其他人可以分析你的硬盘布局以便给你建议。 + +![](http://www.linuxvoice.com/wp-content/uploads/2015/10/boot-repair-large.jpg) + +*Boot Repair 也可以让你定制 Grub 2 的选项。* + +### Bootloader 急救 ### + +Grub 2 引导问题会让系统处于几种不同状态。屏幕(如你所想,本该显示 bootloader 菜单的地方)所展示的文本会指示出系统的当前状态。如果系统中止于 **grub>** 提示符,表明 Grub 2 模块已经被加载,但是找不到 **grub.cfg** 文件。当前是完全版的 Grub 2 命令行 shell,你可以通过多种方式解决此问题。如果你看到的是 **grub rescue>** 提示符,表明 bootloader 不能找到 Grub 2 模块或者找不到任何引导文件( boot files )。然而,如果你的屏幕只显示 ‘GRUB’ 一词,表明 bootloader 找不到通常位于主引导记录( Master Boot Record )里的最基本的信息。 + +你可以通过使用 live CD 或者在 Grub 2 shell 中修正此类错误。如果你够幸运, bootloader 出现了 **grub>** 提示符,你就能获得 Grub 2 shell 的支配权,来帮助你排错。 + +接下来几个命令工作在 **grub>** 和 **grub rescue>** 提示符下。 **set pager=1** 命令设置显示分页( pager ),防止文本在屏幕上一滚而过。你还可以使用 **ls** 命令列出 Grub 识别出的所有分区,如下: + + grub> ls + (hd0) (hd0,msdos5) (hd0,msdos6) (hd1,msdos1) + +如你所见,这个命令列出分区的同时一并列出了分区表方案(即 msdos)。 + +你还可以在每个分区上面使用 **ls** 来查找你的根文件系统: + + grub> ls (hd0,5)/ + lost+found/ var/ etc/ media/ bin/ initrd.gz + boot/ dev/ home/ selinux/ srv/ tmp/ vmlinuz + +你可以不写上分区名的 **msdos** 部分。同样,如果你忘记了尾部的斜杠( trailing slash )只输入 `ls (hd0,5)` ,那你将获得分区的信息,比如文件系统类型、总体大小和最后修改时间。如果你有多个分区,可以使用 `cat` 读取 `/etc/issue` 文件中的内容,来确定发行版,格式如 `cat (hd0,5)/etc/issue` 。 + +假设你在 **(hd0,5)** 中找到根文件系统,请确保它包含 `/boot/grub` 目录,以及你想引导进入的内核镜像,如 **vmlinuz-3.13.0-24-generic** 。此时输入以下命令: + + grub> set root=(hd0,5) + grub> linux /boot/vmlinuz-3.13.0-24-generic root=/dev/sda5 + grub> initrd /boot/initrd.img-3.13.0-24-generic + +第一个命令把 Grub 指向我们想引导进入的发行版所在的分区。接着第二个命令告知 Grub 内核镜像在分区中的位置,以及根文件系统的位置。最后一行设置虚拟文件系统( initial ramdisk )文件的位置。你可以使用 tab 补全功能补全内核名字和虚拟文件系统( initrd: initial ramdisk )的名字,节省时间和精力。 + +输入完毕,在下一个 **grub>** 提示符后输入 `boot` , Grub 将会引导进入指定的操作系统。 + +如果你在 **grub rescue>** 提示符下,情况会有些许不同。因为 bootloader 未能够找到并加载任何必需的模块,你需要手动添加这些模块: + + grub rescue> set root=(hd0,5) + grub rescue> insmod (hd0,5)/boot/grub/normal.mod + grub rescue> normal + grub> insmod linux + +如上所示,跟之前一样,使用 `ls` 命令列出所有分区之后,使用 `set` 命令标记起来。然后添加 **normal** 模块,此模块激活时将会恢复到标准 **grub>** 模式。如果 linux 模块没加载,接下来的命令会进行添加。如果这个模块已经加载,你可以跟之前一样,把引导加载程序指向内核镜像和虚拟文件系统( initrd )文件,然后使用 `boot` 启动发行版,完美收官。 + +一旦成功启动发行版,别忘了为 Grub 重新产生新的配置文件,使用 + + grub-mkconfig -o /boot/grub/grub.cfg + +命令。你还需要往 MBR 里安装一份 bootloader 的拷贝,使用 + + sudo grub2-install /dev/sda + +命令。 + +![](http://www.linuxvoice.com/wp-content/uploads/2015/10/grub2-cfg-large.jpg) + +*想要禁用 `/etc/grub.d` 目录下的脚本,你只需移除其可执行位,比如使用 `chmod -x /etc/grub.d/20_memtest86+` 就能将 ‘Memory Test’ 选项从菜单中移除。* + +### Grub 2 和 UEFI ### + +在支持 UEFI 的机器(最近几年上市的机器大部分都是)调试坏掉的 Grub 2 增加了另一复杂的层次。恢复安装在 UEFI 机器上的 **Grub 2** 的和安装在非 UEFI 机器上的并没多大区别,只是新的固件处理方式不一样,从而导致了很多种恢复结果。 + +对于基于 UEFI 的系统,不要在 MBR 上安装任何东西。相反,你要在 EFI 系统分区(EFI System Partition)( ESP )里安装 Linux EFI bootloader,并且借助工具把它设置为 EFI 的默认启动程序,这个工具对于 Linux 用户是 `efibootmgr` ,对于 window 用户则是 `bcdedit` 。 + +照目前情况看,在安装任何与 Windows 8 兼容的主流桌面 Linux 发行版前,应该正确安装好 Grub 2。然而,如果 bootloader 损坏,你可以使用 live 发行版修复机器。在启动 live 介质之时,请确保是以 UEFI 模式启动。计算机每个可移动驱动器的启动菜单将会有两个: 一个普通的和一个以 EFI 标记的。使用后者会用到 **/sys/firmware/efi/** 文件中的 EFI 变量。 + +在 live 环境中,挂载教程前面所提的安装挂掉系统的根文件系统。除此之外,还需要挂载 ESP 分区。假设分区是 **/dev/sda1** ,你可以如下所示挂载: + + sudo mount /dev/sda1 /mnt/boot/efi + +接着在 chroot 到安装完毕的发行版前之前,使用 `modprobe efivars` 加载 **efivars** 模块。 + +在这里, Fedora 用户可以使用如下命令重新安装 bootloader + + yum reinstall grub2-efi shim + +但在此之前,需要使用 + + grub2-mkconfig -o /boot/grub2/grub.cfg + +来产生新的配置文件。 Ubuntu 用户则改用以下命令 + + apt-get install --reinstall grub-efi-amd64 + +一旦 bootloader 正确就位,退出 chroot ,卸载所有分区,重启到 Grub 2 菜单。 + +### 伙计,我的 Grub 哪去了? ### + +Grub 2 最好的特性是可以随时重新安装。因此,当其它像 Windows 之类的系统用它们自己的 bootloader 替换后,导致 Grub 2 丢失,你可以使用 live 发行版,寥寥数步即可重装 Grub 。假设你在 `/dev/sda5` 安装了一个发行版,若要重装 Grub ,你只需首先使用以下命令为发行版创建一个挂载目录: + + sudo mkdir -p /mnt/distro + +然后挂载分区,如下: + + mount /dev/sda5 /mnt/distro + +接着就能重装 Grub 了,如下: + + grub2-install --root-directory=/mnt/distro /dev/sda + +这个命令会改写 `/dev/sda` 设备上的 MBR 信息,指向当前 Linux 系统,并重写一些 Grub 2 文件,如 **grubenv** 和 **device.map** 。 + +另一个问题常见于装有多个发行版的计算机上。当你安装了新的 Linux 发行版,它的 bootloader 应当要能找到所有已经安装的发行版。一旦不行,只要引导进入新安装的发行版,并运行 + + grub2-mkconfig + +在运行这个命令之前,请确保启动菜单中缺失的发行版的 root 分区已经挂载。如果你想添加的发行版有单独的 `/root` 和 `/home` 分区,在运行 `grub2-mkconfig` 之前,只需挂载包含 `/root` 的分区。 + +虽然 Grub 2 能够找到大部分发行版,但是在 Ubuntu 中尝试添加安装的 Fedora 系统需要额外的一个步骤。如果你以默认设置安装了 Fedora ,则发行版的安装器已经创建了 LVM 分区。此时你需要使用发行版的包管理系统安装 **lvm2** 驱动,如下 + + sudo apt-get install lvm2 + +才能使得 Grub 2 的 `os-prober` 脚本能够找到并将 Fedora 添加进启动菜单。 + +### 常见用户设置 ### + +Grub 2 有很多可配置变量。 这里有一些 `/etc/default/grub` 文件中你最可能会修改到的常见变量。 **GRUB_DEFAULT** 变量指定默认的启动项,可以设置为数字值,比如 0 ,表示第一个菜单项,或者设置为 “saved” ,将指向上一次启动时选中的菜单项。 **GRUB\_TIMEOUT** 变量指定启动默认菜单项之前的停留时间。 **GRUB\_CMDLINE\_LINUX** 列出了要传递给所有 Linux 菜单项的内核命令行参数。 + +如果 **GRUB\_DISABLE\_RECOVERY** 变量设置为 **true** ,那么将不生成恢复模式菜单项。这些菜单项会以单用户模式启动发行版,这种模式下允许你利用命令行工具修复系统。 **GRUB_GFXMODE** 变量同样有用,它指定了菜单上文本显示的分辨率,它可以设置为你的显卡所支持的任何数值。 + +![](http://www.linuxvoice.com/wp-content/uploads/2015/10/grub2-cli-large.jpg) + +*Grub 2 有个命令行模式,通过在 bootloader 菜单上按 C 进入。* + +### 彻底的修复 ### + +如果 `grub2-install` 命令不能正常运作,使得你无法引导进入 Linux ,你需要完整地重装以及重新配置 bootloader 。为此目的,需要用到强大的 **chroot** 功能将运行环境从 live CD 环境切换至我们想修复的 Linux 的安装位置。任何拥有 **chroot** 工具的 Linux live CD 都可以实现这个目的。不过需要确保 live 介质的系统架构和硬盘上系统的架构一致。因此当你希望 **chroot** 到 64 位系统,你必须使用 amd64 live 发行版。 + +启动进入 live 发行版之后,首先需要检查机器上的分区。使用 `fdisk -l` 列出磁盘上所有分区,记录你想修复的 Grub 2 系统所在的分区。 + +假设我们希望从安装在 `/dev/sda5` 中的发行版中恢复 bootloader 。启动终端使用如下命令挂载分区: + + sudo mount /dev/sda5 /mnt + +此时需要绑定(bind)Grub 2 bootloader 需要进入的目录,以便检测其它操作系统: + + $ sudo mount --bind /dev /mnt/dev + $ sudo mount --bind /dev/pts /mnt/dev/pts + $ sudo mount --bind /proc /mnt/proc + $ sudo mount --bind /sys /mnt/sys + +此时可以离开 live 环境进入安装在 **/dev/sda5** 分区中的发行版了,通过 **chroot** : + + $ sudo chroot /mnt /bin/bash + +现在可以安装、检测、以及升级 Grub 了,跟之前一样,使用 + + sudo grub2-install /dev/sda + +命令来重装 bootloader 。因为 **grub2-install** 命令不能创建**grub.cfg** 文件,需要手动创建,如下 + + sudo grub-mkconfig -o /boot/grub/grub.cfg + +这样应该就可以了。现在你就有了 Grub 2 的一份全新拷贝,罗列了机器上所有的操作系统和发行版。在重启电脑之前,你需要依次退出 chroot 系统,卸载所有分区,如下所示: + + $ exit + $ sudo umount /mnt/sys + $ sudo umount /mnt/proc + $ sudo umount /mnt/dev/pts + $ sudo umount /mnt/dev + $ sudo umount /mnt + +现在你可以安全地重启电脑了,而它应该会回退到 Grub 2 的控制之中,你已经修好了这个 bootloader。 + +### 添加自定义菜单项 ### + +如果希望往 bootloader 菜单里添加菜单项,你需要在 **40_custom** 文件里添加一个启动段( boot stanza )。例如,你可以使用它展示一个菜单项来启动安装在可移动 USB 驱动里的 Linux 发行版。假设你的 USB 驱动器是 **sdb1** ,并且 vmlinuz 内核镜像和虚拟文件系统( initrd )都位于根 (/)目录下,在 **40_custom** 文件中添加以下内容: + + menuentry “Linux on USB” { + set root=(hd1,1) + linux /vmlinuz root=/dev/sdb1 ro quiet splash + initrd /initrd.img + } + +相比使用设备和分区名,使用它们的 UUID 可以获得更精确结果,比如 + + set root=UUID=54f22dd7-eabe + +使用 + + sudo blkid + +来获得所有已连接的驱动器和分区的 UUID 。你还可以为你磁盘上没被 os-prober 脚本找到的发行版添加菜单项,只要你知道该发行版的安装位置以及其内核和虚拟文件系统( initrd )的位置即可。 + +-------------------------------------------------------------------------------- + +via: https://www.linuxvoice.com/grub-2-heal-your-bootloader/ + +作者:[Mayank Sharma][a] +译者:[soooogreen](https://github.com/soooogreen) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.linuxvoice.com/author/mayank/ diff --git a/translated/tech/20151229 Grub 2--Heal your bootloader.md b/translated/tech/20151229 Grub 2--Heal your bootloader.md deleted file mode 100644 index f9005762b6..0000000000 --- a/translated/tech/20151229 Grub 2--Heal your bootloader.md +++ /dev/null @@ -1,235 +0,0 @@ -Grub 2:拯救你的 bootloader -================================================================================ -**没什么事比 bootloader 坏掉更让气人的了。充分发挥 Grub 2 的作用,让 bootloader 安分工作吧。** - -为什么这么说? - -- Grub 2 是最受欢迎的 bootloader ,受用于几乎所有 Linux 发行版。 -- bootloader 是一个至关重要的软件,但是非常容易损坏。 -- Grub 2 是具有扩展性和灵活性一款引导加载程序,提供了大量可定制选项。 - -Grub 2 是一款精彩的功能强大的软件。它不是 bootloader 界一枝独秀,但却最受欢迎,几乎所有主要的桌面发行版都在使用它。 Grub 的工作有两个。首先,它用一个菜单展示计算机上所有已经安装的操作系统供你选择。然后,当你从启动菜单中选择了一个 Linux 操作系统, Grub 便加载这个 Linux 的内核。 - -你知道,如果使用 Linux ,你就离不开 bootloader 。然而它却是 Linux 发行版内部最鲜为人知的部分。在这个教程里,我们将带你熟悉 Grub 2 一些著名的特性,强化你相关技能,使你在 bootloader 跑飞的时候能够自行处理。 - -Grub 2 最重要的特色在于大量的 text 格式文件和两个脚本文件。首先需要了解的是 **/etc/default/grub** 。这是一个 text 文件,你可以在里面设置通用配置变量和 Grub 2 菜单(见标题为 “Common user settings(普通用户设置)” 的窗口)的其它特性。 - -Grub 2 另一个重要的特点在于 **/etc/grub.d** 文件夹。定义菜单入口的所有脚本都放置在这里。这些脚本的名称必须有两位的数字前缀。其目的是,在构建 Grub 2 菜单时定义脚本的执行顺序以及相应入口的顺序。文件 **00_header** 首先被读取,负责解析 **/etc/default/grub** 配置文件。然后是 Linux 内核的入口,位于 **10_linux** 文件中。这个脚本在默认的 **/boot** 分区为每个内核创建一个正规菜单入口和一个恢复菜单入口。 - -紧接着的是为第三方应用所用的脚本,如 **30_os-prober** 和 **40_custom** 。 **os-prober** 脚本为内核和其它分区里的操作系统创建入口。它能识别 Linux、 Windows、 BSD 以及 Mac OS X 的装置(译注,指 bootloader )。 如果你的硬盘设计比较独特,使得 **os-prober** 无法捕获已经安装的发行版,你可以在 **40_custom** 文件(见 “Add custom entries(添加定制入口)”窗口)中添加入口。 - -**Grub** 2 不需要你手动维护你的启动选项的配置文件:取而代之的是使用 **grub2-mkconfig** 命令产生 **/boot/grub/grub.cfg** 文件。这个功能会解析 **/etc/grub.d** 目录中的脚本以及 **/etc/default/grub** 设置文件来定义你的安装。 - -图形化引导修复 - -多亏了 Boot Repair 应用,只需要点击按钮,Grub 2 许许多多的问题都能轻易解决。这个小巧的应用有一个直观的用户界面,可以扫描并包含多种硬盘设计和分区方案,还能发现并正确识别里面的操作系统的装置(译注,指 bootloader )。这个应用可以以主引导记录 (MBR)形式存在于传统计算机里,也可以在新型 UEFI 计算机中以 GUID(译改,应为GUID)分区表布局方式工作。 - -Boot Repair 最简单的使用方式是在 Live Ubuntu 会话中安装。在机器上用一个坏的 bootloader 启动 Ubuntu Live 发行版,通过首次添加它的 PPA 版本库,安装 Boot Repair ,命令如下 - - sudo add-apt-repository ppa:yannubuntu/Boot Repair - -然后刷新版本库列表,使用 - - sudo apt-get update - -安装应用(译改,删了 before ),如下 - - sudo apt-get install -y Boot Repair - -安装完毕立刻启动应用。在显示它的界面(由一对按键组成)之前将会扫描你的硬盘。根据工具的指示,只需按下 Recommended Repair(推荐修复)按钮,即可修复大部分坏掉的 bootloader 。修复 bootloader 之后,这个工具会输出一串短小的 URL ,你应该把它记录下来。这个 URL 包含了硬盘详尽的信息:分区信息以及 Grub 2 重要的文件(如 **/etc/default/grub** 和 **boot/grub/grub.cfg** )的内容。如果工具不能解决 bootloader 的问题,可以把你这个 URL 共享在你的发行版的论坛公告牌上,让其他人分析你的硬盘设计以便给你建议。 - -![](http://www.linuxvoice.com/wp-content/uploads/2015/10/boot-repair-large.jpg) - -**Boot Repair 同样支持定制 Grub 2 的选项。** - -#### Bootloader 急救 #### - -Grub 2 引导问题会导致系统处于几种不同状态。屏幕(如你所想,本该显示 bootloader 菜单的地方)所展示的文本,指示系统的当前状态。如果系统中止于 **grub>** 提示符,表明 Grub 2 模块已经被加载,但是找不到 **grub.cfg** 文件。当前是全 Grub 2 命令shell,你可以通过多种方式解决此问题。如果你看到的是 **grub rescue>** 提示符,表明 bootloader 不能找到 Grub 2 模块或者找不到任何引导文件( boot files )。然而,如果你的屏幕只显示 ‘GRUB’ 一词,表明 bootloader 找不到通常位于主引导记录( Master Boot Record )里的最基本的信息。 - -你可以通过使用 live CD 或者在 Grub 2 shell中修正此类错误。如果你够幸运, bootloader 中止于 **grub>** 提示符,你将能获得 Grub 2 shell 的支配权,来帮助你排错。 - -接下来几个命令工作在 **grub>** 和 **grub rescue>** 提示符下。 **set pager=1** 命令产生分页器( pager ),防止文本在屏幕上被刷掉。你还可以使用 **ls** 命令列出 Grub 识别的分区,如下: - - grub> ls - (hd0) (hd0,msdos5) (hd0,msdos6) (hd1,msdos1) - -如你所见,这个命令列出分区的同时一并列出了分区表计划。 - -你还可以在每个分区上面使用 **ls** 来查找根文件系统: - - grub> ls (hd0,5)/ - lost+found/ var/ etc/ media/ bin/ initrd.gz - boot/ dev/ home/ selinux/ srv/ tmp/ vmlinuz - -你可以不写上分区名的 **msdos** 位。同样,如果你忘记尾斜杠( the trailing slash )只输入 **ls (hd0,5)** ,那你将获得分区的信息比如文件系统类型,总体大小和最后修改时间。如果你有多个分区,可以使用 **cat** 读取 **/etc/issue** 文件中的内容,来确定发行版,格式如 **cat (hd0,5)/etc/issue** 。 - -假设你在 **(hd0,5)** 中找到根文件系统,请确保它包含 /**boot/grub** 目录,以及你想引导进入的内核镜像,如 **vmlinuz-3.13.0-24-generic** 。此时输入以下命令: - - grub> set root=(hd0,5) - grub> linux /boot/vmlinuz-3.13.0-24-generic root=/dev/sda5 - grub> initrd /boot/initrd.img-3.13.0-24-generic - -第一个命令把 Grub 指向我们想引导进入的发行版所在的分区。接着第二个命令告知 Grub 内核镜像在分区中的位置,以及根文件系统的位置。最后一行设置虚拟文件系统( initial ramdisk )文件的位置。你可以使用 tab 补全功能补全内核名字和虚拟文件系统( initrd: initial ramdisk )名字,节省时间和精力。 - -输入完毕,在下一个 **grub>** 提示符后输入 **boot** , Grub 将会引导进入指定的操作系统。 - -在 **grub rescue>** 提示符下,情况会有些许不同。因为 bootloader 未能够找到并加载任何必需的模块,你需要手动添加这些模块: - - grub rescue> set root=(hd0,5) - grub rescue> insmod (hd0,5)/boot/grub/normal.mod - grub rescue> normal - grub> insmod linux - -如上所示,跟之前一样,使用 **ls** 命令列出所有分区之后,使用 **set** 命令标记起来。然后添加 **normal** 模块,此模块激活时将会恢复标准 **grub>** 模式。如果 linux 模块没加载,接下来的命令会进行添加。如果这个模块已经加载,你可以跟之前一样,把引导加载程序指向内核镜像和虚拟文件系统( initrd )文件,然后使用 **boot** 启动发行版,完美收官。 - -一旦成功启动发行版,别忘了为 Grub 重新产生新的配置文件,使用 - - grub-mkconfig -o /boot/grub/grub.cfg - -命令。你还需要往 MBR 里安装一份 bootloader 的拷贝,使用 - - sudo grub2-install /dev/sda - -命令。 - -![](http://www.linuxvoice.com/wp-content/uploads/2015/10/grub2-cfg-large.jpg) - -**想要禁能 /etc/grub.d 目录下的脚本,你只需移除可执行位,比如使用 chmod -x /etc/grub.d/20_memtest86+ 就能将 ‘Memory Test’ 选项从菜单中移除。** - -### Grub 2 和 UEFI ### - -支持UEFI的机器(最近几年上市的机器大部分都是)添加了另一复杂的层次,用以调试坏掉的 **Grub 2**。恢复 **Grub 2** 的程序在 UEFI 机器上安装和在非 UEFI 机器上安装并没多大区别,只是新程序处理方式不一样,从而导致了很多种恢复结果。 - -对于基于 UEFI 的系统,不要在 MBR上安装任何东西。相反,你要在 EFI 系统分区( ESP )里安装 EFI bootloader,并且借助工具把它设置为 EFI 的默认启动程序,这个工具对于 Linux 用户是 **efibootmgr** ,对于 window 用户则是 **bcdedit** 。 - -照目前情况看,在安装任何与 Windows 8 兼容的主流桌面 Linux 发行版前, Grub 2 应该完成正确安装。然而,如果 bootloader 损坏,你可以使用 live 发行版进行机器修复。在启动 live 媒介之时,请确保是以 UEFI模式启动。计算机每个可移动驱动的启动菜单将会有两个选项: vanilla 选项和以 EFI 标记的选项。使用后者开放 **/sys/firmware/efi/** 文件中的 EFI 变量。 - -在 live 环境中,挂载教程前面所提的安装失败的装置(译注,指 bootloader )的根文件系统。除此之外,还需要挂载 ESP 分区。假设分区是 **/dev/sda1** ,你可以如下所示挂载 - - sudo mount /dev/sda1 /mnt/boot/efi - -接着在 chroot 到安装完毕的发行版前之前,使用 **modprobe efivars** 加载 **efivars** 模块。 - -这个时候, Fedora 用户使用如下命令重新安装 bootloader - - yum reinstall grub2-efi shim - -在此之前,需要使用 - - grub2-mkconfig -o /boot/grub2/grub.cfg - -来产生新的配置文件。 Ubuntu 用户则改用以下命令 - - apt-get install --reinstall grub-efi-amd64 - -一旦 bootloader 正确就位,退出 chroot ,取消挂载所有分区,重启让 Grub 2 菜单显示。 - -#### 伙计,我的 Grub 哪去了? #### - -Grub 2 最好的特性是可以随时重新安装。因此,当其它像 Windows 之类的系统用自己的 bootloader 替换之,导致 Grub 2 丢失,你可以使用 live 发行版,寥寥数步即可重装 Grub 。假设你在 **/dev/sda5** 安装了一个发行版,若要重装 Grub ,你只需首先使用以下命令,为发行版创建一个挂载目录 - - sudo mkdir -p /mnt/distro - -然后挂载分区,如下 - - mount /dev/sda5 /mnt/distro - -接着就能重装 Grub 了,如下 - - grub2-install --root-directory=/mnt/distro /dev/sda - -这个命令会改写 **/dev/sda** 设备上的 MBR 信息,指向当前 Linux 的装置(译注,指 bootloader ),并改写 Grub 2 部分文件如 **grubenv** 和 **device.map** 。 - -另一个问题常见于装有多个发行版的计算机上。安装了新的 Linux 发行版,它的 bootloader 应当要能捕获所有已经安装的发行版。一旦不能够,只要引导进入新安装的发行版,并运行 - - grub2-mkconfig - -运行命令之前,请确保发行版的启动菜单中缺失的 root 分区已经完成挂载。如果你想添加的发行版有独立 **/root** 和 **/home** 分区,在运行 **grub2-mkconfig** 之前,只需挂载包含 /root 的分区。 - -虽然 Grub 2 能够捕获大部分发行版,但是在 Ubuntu 中尝试添加 Fedora 的装置(译注,指 bootloader )需要额外的一个步骤。如果你以默认设置安装了 Fedora ,则发行版的安装器(译注,同样指 bootloader )已经创建了 LVM 分区。此时你需要使用发行版的包管理系统,安装 **lvm2** 驱动,如下 - - sudo apt-get install lvm2 - -才能使得 Grub 2 的 **os-prober** 脚本能够找到并将 Fedora 添加进启动菜单。 - -### 普通用户设置 ### - -Grub 2 有很多可配置变量。 **/etc/default/grub** 文件里有很多你最可能会修改到的普通变量。 **GRUB_DEFAULT** 变量指定默认的启动入口,可以设置为数字值,比如 0 ,表示第一个入口,或者设置为 “saved” ,将它从指向上一次启动时选中的选项。 **GRUB_TIMEOUT** 变量指定启动默认菜单入口之前的停留时间。 **GRUB_CMDLINE_LINUX** 为所有 Linux 菜单入口列出在内核命令行上传递的参数。 - -如果 **GRUB_DISABLE_RECOVERY** 变量设置为 **true** ,那么将不产生恢复模式菜单入口。这些入口以单用户模式启动发行版,这种模式下允许你利用命令行工具修复系统。 **GRUB_GFXMODE** 变量同样有用,它指定了菜单上文本显示的分辨率,它可以设置为你的显卡所支持的任何数值。 - -![](http://www.linuxvoice.com/wp-content/uploads/2015/10/grub2-cli-large.jpg) - -** Grub 2 有其命令行,通过在 bootloader 菜单上按 C 调用。** - -#### 彻底的修复 #### - -如果 **grub2-install** 命令不能正常运作,使得你无法引导进入 Linux ,你需要完整地重装以及重新配置 bootloader 。为此目的,需要用到神圣的 **chroot** 应用将 live CD 环境切换至并运行我们想修复的 Linux 的安装环境。任何拥有 **chroot** 工具的 Linux live CD 都可以实现这个目的。不过需要确保 live 媒介的架构和硬盘上系统的架构一致。因此当你希望 **chroot** 到 64 位系统,你必须使用 amd64 live 发行版。 - -启动进入 live 发行版之后,首先需要检查机器上的分区。使用 **fdisk -l** 列出磁盘上所有分区,记录你想修复的 Grub 2 装置所在的分区。 - -假设我们希望从安装在 **/dev/sda5** 中的发行版中恢复 bootloader 。启动终端使用如下命令挂载分区: - - sudo mount /dev/sda5 /mnt - -此时需要绑定 Grub 2 bootloader 需要进入的目录,以便检测其它操作系统: - - $ sudo mount --bind /dev /mnt/dev - $ sudo mount --bind /dev/pts /mnt/dev/pts - $ sudo mount --bind /proc /mnt/proc - $ sudo mount --bind /sys /mnt/sys - -此时可以离开 live 环境进入安装在 **/dev/sda5** 分区中的发行版了,通过 **chroot** : - - $ sudo chroot /mnt /bin/bash - -现在可以安装、检测、以及升级 Grub 了,跟之前一样,使用 - - sudo grub2-install /dev/sda - -命令来重装 bootloader 。因为 **grub2-install** 命令不能 创建**grub.cfg** 文件,需要手动创建,如下 - - sudo grub-mkconfig -o /boot/grub/grub.cfg - -这样应该就可以了。现在你就有了 Grub 2 的一份全新拷贝,罗列机器上所有的操作系统和发行版。在重启电脑之前,你需要依次退出 chroot 系统,卸载所有分区,如下所示: - - $ exit - $ sudo umount /mnt/sys - $ sudo umount /mnt/proc - $ sudo umount /mnt/dev/pts - $ sudo umount /mnt/dev - $ sudo umount /mnt - -现在你可以安全地重启电脑了,而它应该会回退到 Grub 2 的控制之中,而你又控制着这个 bootloader 。 - -### 添加自定义入口 ### - -如果希望往 bootloader 菜单里添加入口,你需要在 **40_custom** 文件里添加一个启动段( boot stanza )。例如,你可以使用它展示一个入口来启动安装在可移动 USB 驱动里的 Linux 发行版。假设你的 USB 驱动是 **sdb1** ,并且 vmlinuz 内核镜像和虚拟文件系统( initrd )都位于根 (/)目录下,在 **40_custom** 文件中添加以下内容: - - menuentry “Linux on USB” { - set root=(hd1,1) - linux /vmlinuz root=/dev/sdb1 ro quiet splash - initrd /initrd.img - } - -相比使用设备和分区名,使用它们的 UUID 可以获得更精确结果,比如 - - set root=UUID=54f22dd7-eabe - -使用 - - sudo blkid - -来获得所有已连接驱动和分区的 UUID 。你还可以为你磁盘上没被 os-prober 脚本捕获的发行版添加入口,只要你知道该发行版的安装位置以及其内核和虚拟文件系统( initrd )的定位即可。 - --------------------------------------------------------------------------------- - -via: https://www.linuxvoice.com/grub-2-heal-your-bootloader/ - -作者:[Mayank Sharma][a] -译者:[soooogreen](https://github.com/soooogreen) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.linuxvoice.com/author/mayank/ From c82917b4d4b71a3923553fbf2df7ae0360b95e38 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Sat, 16 Jan 2016 11:32:57 +0800 Subject: [PATCH 0223/1469] [Translating] sources/share/20151028 Bossie Awards 2015--The best open source big data tools.md --- ...28 Bossie Awards 2015--The best open source big data tools.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/share/20151028 Bossie Awards 2015--The best open source big data tools.md b/sources/share/20151028 Bossie Awards 2015--The best open source big data tools.md index 0cf65ea3a8..942e4b3076 100644 --- a/sources/share/20151028 Bossie Awards 2015--The best open source big data tools.md +++ b/sources/share/20151028 Bossie Awards 2015--The best open source big data tools.md @@ -1,3 +1,4 @@ +ictlyh Translating Bossie Awards 2015: The best open source big data tools ================================================================================ InfoWorld's top picks in distributed data processing, streaming analytics, machine learning, and other corners of large-scale data analytics From 9d2c14b70857b24a80102939fe58a87527d01e1c Mon Sep 17 00:00:00 2001 From: ictlyh Date: Sat, 16 Jan 2016 12:16:39 +0800 Subject: [PATCH 0224/1469] =?UTF-8?q?[=E5=8F=96=E6=B6=88=E8=AE=A4=E9=A2=86?= =?UTF-8?q?]=20sources/share/20151028=20Bossie=20Awards=202015--The=20best?= =?UTF-8?q?=20open=20source=20big=20data=20tools.md=20[Translating]=20sour?= =?UTF-8?q?ces/tech/20151204=20Install=20and=20Configure=20Munin=20monitor?= =?UTF-8?q?ing=20server=20in=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...28 Bossie Awards 2015--The best open source big data tools.md | 1 - ...204 Install and Configure Munin monitoring server in Linux.md | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/share/20151028 Bossie Awards 2015--The best open source big data tools.md b/sources/share/20151028 Bossie Awards 2015--The best open source big data tools.md index 942e4b3076..0cf65ea3a8 100644 --- a/sources/share/20151028 Bossie Awards 2015--The best open source big data tools.md +++ b/sources/share/20151028 Bossie Awards 2015--The best open source big data tools.md @@ -1,4 +1,3 @@ -ictlyh Translating Bossie Awards 2015: The best open source big data tools ================================================================================ InfoWorld's top picks in distributed data processing, streaming analytics, machine learning, and other corners of large-scale data analytics diff --git a/sources/tech/20151204 Install and Configure Munin monitoring server in Linux.md b/sources/tech/20151204 Install and Configure Munin monitoring server in Linux.md index 314d721e38..05f2ead9c3 100644 --- a/sources/tech/20151204 Install and Configure Munin monitoring server in Linux.md +++ b/sources/tech/20151204 Install and Configure Munin monitoring server in Linux.md @@ -1,3 +1,4 @@ +ictlyh Translating Install and Configure Munin monitoring server in Linux ================================================================================ ![](http://www.linuxnix.com/wp-content/uploads/2015/12/munin_page.jpg) From 8f940123251d25c2f5809406c68c8a588d345e4a Mon Sep 17 00:00:00 2001 From: ictlyh Date: Sat, 16 Jan 2016 12:53:14 +0800 Subject: [PATCH 0225/1469] [Translated] sources/tech/20151204 Install and Configure Munin monitoring server in Linux.md --- ...figure Munin monitoring server in Linux.md | 146 ------------------ ...figure Munin monitoring server in Linux.md | 145 +++++++++++++++++ 2 files changed, 145 insertions(+), 146 deletions(-) delete mode 100644 sources/tech/20151204 Install and Configure Munin monitoring server in Linux.md create mode 100644 translated/tech/20151204 Install and Configure Munin monitoring server in Linux.md diff --git a/sources/tech/20151204 Install and Configure Munin monitoring server in Linux.md b/sources/tech/20151204 Install and Configure Munin monitoring server in Linux.md deleted file mode 100644 index 05f2ead9c3..0000000000 --- a/sources/tech/20151204 Install and Configure Munin monitoring server in Linux.md +++ /dev/null @@ -1,146 +0,0 @@ -ictlyh Translating -Install and Configure Munin monitoring server in Linux -================================================================================ -![](http://www.linuxnix.com/wp-content/uploads/2015/12/munin_page.jpg) - -Munin is an excellent system monitoring tool similar to [RRD tool][1] which will give you ample information about system performance in multiple fronts like **disk, network, process, system and users**. These are some of the default properties Munin monitors. - -### How Munin works? ### - -Munin works in a client-server model. Munin server process on main server try to collect data from client daemon which is running locally(Munin can monitor it’ss own resources) or from remote client(Munin can monitor hundreds of machines) and displays them in graphs on its web interface. - -### Configuring Munin in nutshell ### - -This is of two steps as we have to configure both server and client. -1)Install Munin server package and configure it so that it get data from clients. -2)Configure Munin client so that server will connect to client daemon for data collocation. - -### Install munin server in Linux ### - -Munin server installation on Ubuntu/Debian based machines - - apt-get install munin apache2 - -Munin server installation on Redhat/Centos based machines. Make sure that you [enable EPEL repo][2] before installing Munin on Redhat based machines as by default Redhat based machines do not have Munin in their repos. - - yum install munin httpd - -### Configuring Munin server in Linux ### - -Below are the steps we have to do in order to bring server up. - -1. Add host details which need monitoring in /etc/munin/munin.conf -1. Configure apache web server to include munin details. -1. Create User name and password for web interface -1. Restart apache server - -**Step 1**: Add hosts entry in this file in **/etc/munin/munin.conf**. Go to end of the file and a client to monitor. Here in this example, I added my DB server and its IP address to monitor - -Example: - - [db.linuxnix.com] - address 192.168.1.25 - use_node_name yes - -Save the file and exit. - -**Step 2**: Edit/create munin.conf file in /etc/apache2/conf.d folder to include Munin Apache related configs. In another note, by default other Munin web related configs are kept in /var/www/munin folder. - - vi /etc/apache2/conf.d/munin.conf - -Content: - - Alias /munin /var/www/munin - - Order allow,deny - Allow from localhost 127.0.0.0/8 ::1 - AllowOverride None - Options ExecCGI FollowSymlinks - AddHandler cgi-script .cgi - DirectoryIndex index.cgi - AuthUserFile /etc/munin/munin.passwd - AuthType basic - AuthName "Munin stats" - require valid-user - - ExpiresActive On - ExpiresDefault M310 - - - -Save the file and exit - -**Step 3**: Now create a username and password for viewing muning graphs: - - htpasswd -c /etc/munin/munin-htpasswd munin - -**Note**: For Redhat/Centos machines replace “**apache2**” with “**httpd**” in each path to access your config files. - -**Step 3**: Restart Apache server so that Munin configurations are picked-up by Apache. - -#### Ubuntu/Debian based: #### - - service apache2 restart - -#### Centos/Redhat based: #### - - service httpd restart - -### Install and configure Munin client in Linux ### - -**Step 1**: Install Munin client in Linux - - apt-get install munin-node - -**Note**: If you want to monitor your Munin server, then you have to install munin-node on that as well. - -**Step 2**: Configure client by editing munin-node.conf file. - - vi /etc/munin/munin-node.conf - -Example: - - allow ^127\.0\.0\.1$ - allow ^10\.10\.20\.20$ - ----------- - - # Which address to bind to; - host * - ----------- - - # And which port - port 4949 - -**Note**: 10.10.20.20 is my Munin server and it connections to 4949 port on client to get its data. - -**Step 3**: Restart munin-node on client server - - service munin-node restart - -### Testing connection ### - -check if you are able to connect client from server on 4949 port, other wise you have to open that port on client machine. - - telnet db.linuxnix.com 4949 - -Accessing Munin web interface - - http://munin.linuxnix.com/munin/index.html - -Hope this helps to configure basic Munin server. - --------------------------------------------------------------------------------- - -via: http://www.linuxnix.com/install-and-configure-munin-monitoring-server-in-linux/ - -作者:[Surendra Anne][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.linuxnix.com/author/surendra/ -[1]:http://www.linuxnix.com/network-monitoringinfo-gathering-tools-in-linux/ -[2]:http://www.linuxnix.com/how-to-install-and-enable-epel-repo-in-rhel-centos-oracle-scentific-linux/ diff --git a/translated/tech/20151204 Install and Configure Munin monitoring server in Linux.md b/translated/tech/20151204 Install and Configure Munin monitoring server in Linux.md new file mode 100644 index 0000000000..d26c1b0d8e --- /dev/null +++ b/translated/tech/20151204 Install and Configure Munin monitoring server in Linux.md @@ -0,0 +1,145 @@ +在 Linux 上安装和配置 Munin 检测服务器 +================================================================================ +![](http://www.linuxnix.com/wp-content/uploads/2015/12/munin_page.jpg) + +Munin 是一款和 [RRD][1] 类似很好的系统检测工具,它能提供给你多方面的系统性能信息,例如 **磁盘、网络、进程、系统和用户**。这些是 Munin 默认检测的属性。 + +### Munin 如何工作? ### + +Munin 以客户端-服务器模式运行。主服务器上运行的 Munin 服务器进程尝试从本地运行的客户端守护进程(Munin 可以检测它自己的资源)或者远程客户端(Munin 可以检测上百台机器)收集数据,然后在它的 web 页面以图的形式显示出来。 + +### 在 nutshell 中配置 Munin ### + +要配置服务器端和客户端,我们需要完成以下两步。 +1) 安装 Munin 服务器软件包并配置,使得它能从客户端收集数据。 +2) 安装 Munin 客户端使得服务器能连接到客户端守护进程用于收集数据。 + +### 在 Linux 上安装 munin 服务器端 ### + +在基于 Ubuntu/Debian 的机器上安装 Munin 服务器 + + apt-get install munin apache2 + +在基于 Redhat/CentOS 的机器上安装 Munin 服务器。在基于 Redhat 的机器上安装 Munin 之前,你需要确保 [启用 EPEL 软件仓库][2],因为基于 Redhead 的机器它们的软件仓库默认没有 Munin。 + + yum install munin httpd + +### 在 Linux 上配置 Munin 服务器端 ### + +下面是我们要启动服务器按按顺序执行的步骤。 + +1. 在 /etc/munin/munin.conf 中添加需要检测的主机详情 +2. 配置 apache web 服务器使其包括 munin 配置。 +3. 为 web 页面创建用户名和密码 +4. 重启 apache 服务器 + +**步骤 1**: 在 **/etc/munin/munin.conf** 文件中添加主机条目。调到文件末尾添加要检测的客户端。在这个例子中,我添加了要检测的数据库服务器和它的 IP 地址。 + +事例: + + [db.linuxnix.com] + address 192.168.1.25 + use_node_name yes + +保存文件并退出。 + +**步骤 2**: 在 /etc/apache2/conf.d 目录中编辑/创建文件 munin.conf 用于包括 Munin 和 Apache 相关的配置。另外注意一点,默认其它和 web 相关的 Munin 配置保存在 /var/www/munin 目录。 + + vi /etc/apache2/conf.d/munin.conf + +内容: + + Alias /munin /var/www/munin + + Order allow,deny + Allow from localhost 127.0.0.0/8 ::1 + AllowOverride None + Options ExecCGI FollowSymlinks + AddHandler cgi-script .cgi + DirectoryIndex index.cgi + AuthUserFile /etc/munin/munin.passwd + AuthType basic + AuthName "Munin stats" + require valid-user + + ExpiresActive On + ExpiresDefault M310 + + + +保存文件并退出 + +**步骤 3**: 现在为查看 munin 的图示创建用户名和密码: + + htpasswd -c /etc/munin/munin-htpasswd munin + +**注意**:对于 Redhat/Centos 机器,为了访问你的配置文件,需要在每个路径中用 “**httpd**” 替换 “**apache2**”。 + +**步骤 4**: 重启 Apache 服务器,使得 Munin 配置生效。 + +#### 基于 Ubuntu/Debian : #### + + service apache2 restart + +#### 基于 Centos/Redhat : #### + + service httpd restart + +### 在 Linux 上安装和配置 Munin 客户端 ### + +**步骤 1**: 在 Linux 上安装 Munin 客户端 + + apt-get install munin-node + +**注意**:如果你想检测你的 Munin 服务器端,你也需要在那里安装 munin-node。 + +**步骤 2**: 编辑 munin-node.conf 文件配置客户端。 + + vi /etc/munin/munin-node.conf + +事例: + + allow ^127\.0\.0\.1$ + allow ^10\.10\.20\.20$ + +---------- + + # Which address to bind to; + host * + +---------- + + # And which port + port 4949 + +**注意**: 10.10.20.20 是我的 Munin 服务器,它连接到客户端的 4949 端口获取数据。 + +**步骤 3**: 在客户端机器中重启 munin-node + + service munin-node restart + +### 测试连接 ### + +检查你是否能从服务器的连接到客户端的 4949 端口,如果不行,你需要在客户端机器中打开该端口。 + + telnet db.linuxnix.com 4949 + +访问 Munin web 页面 + + http://munin.linuxnix.com/munin/index.html + +希望这些能对你配置基本的 Munin 服务器有所帮助。 + +-------------------------------------------------------------------------------- + +via: http://www.linuxnix.com/install-and-configure-munin-monitoring-server-in-linux/ + +作者:[Surendra Anne][a] +译者:[ictlyh](http://mutouxiaogui.cn/blog/) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linuxnix.com/author/surendra/ +[1]:http://www.linuxnix.com/network-monitoringinfo-gathering-tools-in-linux/ +[2]:http://www.linuxnix.com/how-to-install-and-enable-epel-repo-in-rhel-centos-oracle-scentific-linux/ From 5d59b422ea67469c4e0307181c869b0619988fea Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 16 Jan 2016 20:56:57 +0800 Subject: [PATCH 0226/1469] PUB:20151125 Running a mainline kernel on a cellphone MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @kylepeng93 翻译的不错,就是应该保留原文的 Markdown 格式啊,我还得一个个补充回来。https://linux.cn/article-6897-1.html --- ...unning a mainline kernel on a cellphone.md | 45 +++++++++++++++++++ ...unning a mainline kernel on a cellphone.md | 14 ------ 2 files changed, 45 insertions(+), 14 deletions(-) create mode 100644 published/20151125 Running a mainline kernel on a cellphone.md delete mode 100644 translated/tech/20151125 Running a mainline kernel on a cellphone.md diff --git a/published/20151125 Running a mainline kernel on a cellphone.md b/published/20151125 Running a mainline kernel on a cellphone.md new file mode 100644 index 0000000000..0de1daf0c4 --- /dev/null +++ b/published/20151125 Running a mainline kernel on a cellphone.md @@ -0,0 +1,45 @@ +为什么主线内核不能运行在我的手机上? +================== + +对于自由软件来说,其最大的自由之一就是能够用一个更新或修改的版本来替换原始版本的程序。尽管如此,数千万使用那些手机里面装着所谓 Linux 的用户却很少能够在他们的手机上运行主线内核(mainline kernel),即使他们拥有替换内核代码的专业技能。可悲的是,我们必须承认目前仍然没有可以运行主线内核的主流手机。在由 Rob Herring 主持的2015届内核峰会(Kernel Summit)上,与会人员共同探讨了这个问题,并进一步谈论了他们应该怎么做才能解决这个问题。 + +当主持人提问的时候,在座的大多数开发人员都表示他们更乐意在他们的手机上面运行主线内核,然而也有少数人持相反的看法。在 Project Ara 的支持下,Rob 在这个问题上已经研究了近一年半的时间(参见:https://lwn.net/Articles/648400/ )。但是最新的研究成果并不理想。 + +Rob 表示,通常手机上运行了太多的过期(out-of-tree)代码;主线内核只是缺少能使手机正常运行所必须的驱动。每台常规的手机都在运行着100万行到300万行的过期(out-of-tree)代码。几乎所有的这些手机的内核版本都不超过3.10,有一些甚至更加古老。造成这种情况的原因有很多,但是有一点是很清楚的,在手机的世界里,一切都变化的太快以至于无法跟上内核社区的步伐。如果真是那样,他问到,我们还担心什么呢? + +Tim Bird 指出,第一台 Android 手机 Nexus 1 从来没有运行过任何一个主线内核,并且以后也不会。它打破了开源的承诺,也使得用户不可能做到将一个新的内核放到手机中。从这一点上来说,没有任何一款手机支持这种能力。Peter Zijlstra 想知道从一台手机到另一台手机到底复制了多少能够工作的过期代码;Rob表示,迄今为止,他已经见到了三个独立开发的热插拔 [Governors][1]。 + +Dirk Hohndel 提出了很少有人注意到的建议。他说,对于世界上的数以亿计的手机,大约只有他们27个人关心他们的手机是否运行着主线内核。剩下的用户仅仅只是想让他们的手机正常工作。或许那些关注手机是否在运行主线内核的开发者正在努力去解决这个令人不解的问题。 + +Chris Mason 说,那些手机厂商当前正面临着相同类型的问题,而这些问题也是那些 Linux 发行版过去所面临过的问题。他们疲于应付大量的无效且重复和能被复用的工作。一旦这些发行版决定将他们的工作配合主线内核而不是使用自己维护的内核,那么问题将会变得好解决的多。解决问题的关键就是去帮助手机制造商们认识到他们可以通过同样的方式获得便利,形成这种认识的关键并不是通过来自用户的压力。这样一来,问题就可以解决了。 + +Grant Likely 提出了对于安全问题的担忧,这种担忧来自于那些不能升级他们的手机系统的 android 设备。他说,我们需要的是一个真正专为手机设立的发行版。但是,只要手机厂商仍然掌控着手机中的应用软件,那么手机的同步更新将无法实现。我们接下来将面临一个很大的安全难题。Peter 补充说,随着 [Stagefright 漏洞][2]的出现,难题已经出现在我们面前了。 + +Ted Ts'o 说,运行主线内核并不是他的主要关注点。他很乐于见到这个假期中所售卖的手机能够运行3.18或者4.1的内核,而不是继续停留在3.10。他认为这是一个更可能被解决的问题。Steve Rostedt 认为,按照 Ted Ts'o 所说的那样去做并不能解决手机的安全问题,但是,Ted 认为使用一个更新一些的内核至少可以让漏洞修复变得更加容易。Grant 对此回应说,接下来的一年里,这一切都将再次发生。过渡到更新的内核也是一个渐进式的对系统的完善。Kees Cook 补充说,我们无法从修复旧版本的内核漏洞的过程中得到太多的益处,真正的问题是我们没有对 bug 的应对措施(他会在今天的另外一个对话中讲到这个话题)。 + +Rob 说,任何一种解决方案都需要得到当前市场上的手机供应商的支持。否则,由于厂商对安装到他们生产的手机上的操作系统的封锁,运行主线内核的策略将会陷入麻烦。Paolo Bonzini 提问说是否可以因为那些没有修复的安全漏洞而控告手机厂商,尤其当手机仍然处于保修期内。Grant 认为对于手机的可更新能力(upgradeability)的保证必须来源于市场需求,否则是无法实现的。而促使它实现的原因可能会是一个严重的安全问题,然后用户开始对手机的可更新能力提出要求。同时,内核开发人员必须不断朝着这个方向努力。Rob 表示,除了到目前为止指出的所有优点之外,运行主线内核也能帮助开发者对安卓设备上的新特性进行测试和验证。 + +Josh Triplett 提问说,如果手机厂商提出对主线内核提供支持的想法,那么内核社区又将采取什么措施呢?那样将会针对手机各方面的特性要求对内核进行大量的测试和验证;[Android 的兼容性测试套件][3]中出现的失败将不得不被再次回归到内核。Rob 提议这个问题可以在明年讨论,即先将最基本的功能做好。但是,Josh 强调说,如果这个需求出现了,我们就应该能够给出一个好的答案。 + +Tim 认为,当前,我们和厂商之间存在很大的脱节。厂商根本不会主动报告或者贡献任何反馈给社区。他们之间完全脱节了,这样的话永远不会有进步。Josh 表示,当厂商们开始报告他们正在使用的旧内核的相关 bug 时,双方之间的接受度将变得更加友好。Arnd Bergmann 认为,我们需要的是得到一个大芯片厂商对使用主线内核的认可,并且将该厂商的硬件提升到能够支持主线内核的运行的这样一个水平,而这样将会在其他方面增加负担。但是,他补充说,实现这个目标要求存在一个跟随硬件一起分发的自由 GPU 驱动程序——然而这种程序当前并不存在。 + +Rob 给存在问题的领域列了一个清单,但是现在已经没有太多的时间去讨论其中的细节了。WiFi 驱动仍然是一个问题,尤其是当这个新特性被添加到 Android 设备上的时候。Johannes Berg 对新特性仍然存在问题表示赞同;Android 的开发人员甚至在这些新特性被应用到 Android 设备上之前都不会去谈论它们是否存在问题。然而,对这些特性中的大多数的技术支持最终都会落实在主线内核中。 + +随着会议逐渐接近尾声,Ben Herrenschmidt 再次重申:实现在 Android 手机上运行主线内核的关键还是在于让厂商认识到使用主线内核是它们获得最大利润的最好选择。从长远看,使用主线内核能节省大量的工作。Mark Brown 认为,以前,当搭载在 Android 设备上的内核版本以更稳定的方式向前推进的时候,上游工作的好处对运营商来说更加明显。以现在的情况来看,手机上的内核版本似乎停留在了3.10,那种压力是不一样的。 + +这次谈话以开发者决定进一步改善当前的状况而结束,但是却并没有对如何改善提出一个明确的计划。 + +--------------------------------------------------------------------------------- + +via: https://lwn.net/Articles/662147/ + +作者:[Jonathan Corbet][a] +译者:[kylepeng93](https://github.com/kylepeng93) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:https://lwn.net/Articles/KernelSummit2015/ +[1]:http://androidmodguide.blogspot.com/p/blog-page.html +[2]:https://lwn.net/Articles/652728/ +[3]:https://source.android.com/compatibility/cts/index.html diff --git a/translated/tech/20151125 Running a mainline kernel on a cellphone.md b/translated/tech/20151125 Running a mainline kernel on a cellphone.md deleted file mode 100644 index 88f21b55d7..0000000000 --- a/translated/tech/20151125 Running a mainline kernel on a cellphone.md +++ /dev/null @@ -1,14 +0,0 @@ -在手机上面运行主线内核 - 对于自由软件来说,其最大的自由之一就是能够用一个更新或修改的版本来替换原始版本的程序。尽管如此,数千万使用linux内核作为支持的手机用户却很少能够在他们的手机上运行主线内核,即使他们拥有替换内核代码的专业技能。可悲的是,我们必须承认目前仍然无法使用到运行主线内核的主流手机。在由Rob Herring主持的2015届内核峰会上,与会人员共同探讨了这个问题,并进一步谈论了他们应该怎么做才能解决这个问题。 - 当主持人提问的时候,在座的大多数开发人员都表示他们更喜欢在他们的手机上面运行主线内核,然而也有少数人持相反的看法。在Project Ara的支持下,Rob在这个问题上已经研究了近一年半的时间。但是最新的研究成果并不理想。 - Rob表示,有太多的树(out-of-tree)代码运行在手机上,主线内核只是缺少能使手机正常运行所必须的驱动。每台合格的手机都在运行着100万到300万的树(out-of-tree)代码。几乎所有的这些手机的内核版本都不超过3.1,有一些甚至更加古老。造成这种情况的原因有很多,但是有一点是很清楚的,在手机的世界里,一切都变化的太快以至于内核社区无法跟上它们的步伐。如果真是那样,他问到,我们还担心什么呢? - Tim Bird指出,第一台Android手机Nexus1从来没有运行过任何一个主线内核,并且以后也不会。它打破了开源的承诺,也使得用户不可能做到将一个新的内核放到手机中。从这一点上来说,没有任何一款手机支持这种能力。Peter Zijlstra想知道从一台手机到另一台手机到底有多少正发挥作用的被复制的代码。Rob表示,迄今为止,他已经见到了三个独立开发的热插拔调速器。 - Dirk Hohndel提出了很少有人注意到的建议。他说,对于世界上的成千上亿万台手机,其中大约有百分之27的手机用户关心他们的手机是否运行着主线内核。剩下的用户仅仅只是想让他们的手机正常工作。或许那些关注手机是否在运行主线内核的开发者正在努力去解决这个令人不解的问题。 - Chris Mason说,那些手机卖家当前正面临着相同类型的问题,而这些问题也是那些linux发行版过去所面临过的问题。他们疲于应付大量的无效且重复和能被复制的工作。一旦这些发行版决定将他们的工作重心转入到主线内核而不是让它顺其自然的发展,那么问题将会变得好解决的多。解决问题的关键就是去帮助手机制造商们认识到他们可以通过同样的方式获利,形成这种认识的关键并不是通过来自用户的压力。这样一来,问题就可以解决了。 - Grant Likely提出了对于安全问题的担忧,这种担忧来自于那些不能升级他们的手机系统的android设备。他说,我们需要的是一个真正专为手机设立的发行市场。但是,只要手机卖家仍然掌控着手机中的应用软件,那么手机的同步更新将无法实现。我们接下来将面临一个很大的安全难题。Peter补充说,随着Stagefright漏洞的出现,难题已经出现在我们面前了。 - Ted Ts'o说,运行主线内核并不是他的主要关注点。他很乐于见到这个假期中所售卖的手机能够运行3.18或者4.1的内核,而不是继续停留在3.10。他认为这是一个更可能被解决的问题。Steve Rostedt认为,按照Ted Ts'o所说的那样去做并不能解决手机的安全问题,但是,Ted认为使用一个更新的内核至少可以让漏洞修复变得更加容易。Grant对此回应说,接下来的一年里,这一切都将再次发生。过渡到更新的内核也是一个渐进式的对系统的完善。Kees Cook补充说,我们无法从修复旧版本的内核漏洞的过程中得到太多的益处,真正的问题是我们没有对bug的应对措施。 - Rob说,任何一种解决方案都需要得到当前的手机供应商的支持。否则,由于厂商对应用到他们生产的手机上的操作系统的封锁,运行主线内核的策略将会陷入麻烦。Paolo Bonzini提问说是否可以因为那些没有修复的安全漏洞而控告手机厂商,尤其当手机仍然处于保修期内。Grant认为对于手机的可更新能力的保证必须来源于市场需求,否则是无法实现的。而促使它实现的原因可能会是一个严重的安全问题,然后用户开始对手机的可更新能力提出要求。同时,内核开发人员必须不断朝着这个方向努力。Rob表示,除了到目前为止指出的所有优点之外,运行主线内核也能帮助开发者对安卓设备上的新特性进行测试和验证。 - Josh Triplett提问说,如果手机产商提出对主线内核提供支持的想法,那么内核社区又将采取什么措施呢?那样将会针对手机各方面的特性要求对内核进行大量的测试和验证;Android的兼容性测试套件中出现的失败将不得不被再次回归。Rob提议这个问题将会在明年被讨论,即先将最基本的功能做好。但是,Josh强调说,如果这个需求出现了,我们就应该能够给出一个好的答案。 - Tim认为,当前,我们和厂商之间存在很大的脱节。厂商根本不会主动报告或者贡献任何反馈给社区。他们之间完全脱节了,这样的话永远不会有进步。Josh表示,当厂商们报告他们正在使用的旧内核的相关bug时,双方之间的接受度将变得更加友好。Arnd Bergmann认为,我们需要的是得到一个大芯片厂商对使用主线内核的认可,并且将该厂商的硬件提升到能够支持主线内核的运行的这样一个水平,而这样将会在其他方面增加负担。但是,他补充说,实现这个目标要求存在一个跟随硬件一起分发的自由GPU驱动程序——然而这种程序当前并不存在。 - Rob给存在问题的领域列了一个清单,但是现在已经没有太多的时间去讨论其中的细节了。WIFI驱动仍然是一个问题,尤其是当新特性被添加到Android设备上的时候。Johannes Berg对新特性仍然存在问题表示赞同;android的开发人员甚至在这些新特性被应用到Android设备上之前都不会去谈论它们是否存在问题。然而,对这些特性中的大多数的技术支持最终都会落实在主线内核中。 - 随着会议逐渐接近尾声,Ben Herrenschmidt再次重申:实现在andoroid手机上运行主线内核的关键还是在于让厂商认识到使用主线内核是它们获得最大利润的最好选择。从长远看,使用主线内核能节省大量的工作。Mark Brown认为,以前,当搭载在Android设备上的内核版本以更稳定的方式向前推进的时候,上游工作的好处对运营商来说更加明显。以现在的情况来看,手机上的内核版本似乎停留在了3.10,那种压力是不一样的。这次会话以开发者决定进一步改善当前的状况而结束,但是却并没有对如何改善提出一个明确的计划。 From 221e8815445e84e604045978f648f8e5da2125b7 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 17 Jan 2016 11:49:50 +0800 Subject: [PATCH 0227/1469] PUB:20151204 Linux or Unix--jobs Command Examples @strugglingyouth --- ...04 Linux or Unix--jobs Command Examples.md | 71 ++++++------------- 1 file changed, 23 insertions(+), 48 deletions(-) rename {translated/tech => published}/20151204 Linux or Unix--jobs Command Examples.md (57%) diff --git a/translated/tech/20151204 Linux or Unix--jobs Command Examples.md b/published/20151204 Linux or Unix--jobs Command Examples.md similarity index 57% rename from translated/tech/20151204 Linux or Unix--jobs Command Examples.md rename to published/20151204 Linux or Unix--jobs Command Examples.md index fbb52a2544..70e5138862 100644 --- a/translated/tech/20151204 Linux or Unix--jobs Command Examples.md +++ b/published/20151204 Linux or Unix--jobs Command Examples.md @@ -1,14 +1,13 @@ - -Linux / Unix: jobs 命令示例 +jobs 命令示例 ================================================================================ -我是个新的 Linux 或 Unix 用户。如何在 Linux 或类 Unix 系统中使用 BASH/KSH/TCSH 或者基于 POSIX 的 shell 来查看当前正在进行的作业?在 Unix/Linux 上怎样显示当前作业的状态? +我是个新的 Linux/Unix 用户。我该如何在 Linux 或类 Unix 系统中使用 BASH/KSH/TCSH 或者基于 POSIX 的 shell 来查看当前正在进行的作业(job)?在 Unix/Linux 上怎样显示当前作业的状态?(LCTT 译注:job,也常称为“任务”) -作业控制的是什么,停止/暂停进程(命令)的执行并按你的要求继续/恢复它们的执行。这是根据你的操作系统和 shell 如,bash/ksh 或 POSIX shell 来执行的。 +作业控制是一种能力,可以停止/暂停进程(命令)的执行并按你的要求继续/恢复它们的执行。这是通过你的操作系统和诸如 bash/ksh 或 POSIX shell 等 shell 来执行的。 shell 会将当前所执行的作业保存在一个表中,可以用 jobs 命令来显示。 -### 目的 ### +### 用途 ### > 在当前 shell 会话中显示作业的状态。 @@ -30,7 +29,7 @@ shell 会将当前所执行的作业保存在一个表中,可以用 jobs 命 在开始使用 jobs 命令前,你需要在系统上先启动多个作业。执行以下命令来启动作业: - ## 启动 xeyes, calculator, 和 gedit 文本编辑器 ### + ### 启动 xeyes, calculator, 和 gedit 文本编辑器 ### xeyes & gnome-calculator & gedit fetch-stock-prices.py & @@ -39,7 +38,7 @@ shell 会将当前所执行的作业保存在一个表中,可以用 jobs 命 ping www.cyberciti.biz -按 **Ctrl-Z** 键来暂停 ping 命令的作业。 +按 **Ctrl-Z** 键来挂起(suspend) ping 命令的作业。 ### jobs 命令示例 ### @@ -54,7 +53,7 @@ shell 会将当前所执行的作业保存在一个表中,可以用 jobs 命 [3]- 7910 Running gedit fetch-stock-prices.py & [4]+ 7946 Stopped ping cyberciti.biz -要显示进程 ID 或作业名称请使用 “P” 选项,输入: +要显示名字以“p”开头的进程 ID 或作业名称,输入: $ jobs -p %p @@ -66,7 +65,7 @@ shell 会将当前所执行的作业保存在一个表中,可以用 jobs 命 [4]- Stopped ping cyberciti.biz -字符 % 后加一个作业。在这个例子中,你需要使用作业的名称来暂停它,如 %ping。 +字符 % 是一个指定任务的方法。在这个例子中,你可以使用作业名称开头字符串来来暂停它,如 %ping。 ### 如何显示进程 ID 不包含其他正常的信息? ### @@ -77,7 +76,8 @@ shell 会将当前所执行的作业保存在一个表中,可以用 jobs 命 示例输出: ![Fig.01: Displaying the status of jobs in the shell](http://s0.cyberciti.org/uploads/faq/2013/02/jobs-command-output.jpg) -Fig.01: 在 shell 中显示 jobs 的状态 + +*Fig.01: 在 shell 中显示 jobs 的状态* ### 如何只列出最近一次状态改变的进程? ### @@ -85,7 +85,7 @@ Fig.01: 在 shell 中显示 jobs 的状态 $ sleep 100 & -现在,只显示作业最近一次的状态(停止或退出),输入: +现在,只显示自从上次提示过停止或退出之后的作业,输入: $ jobs -n @@ -137,43 +137,18 @@ Fig.01: 在 shell 中显示 jobs 的状态 摘自 [bash(1)][1] 命令 man 手册页: -注:表格 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionDescription
-lShow process id's in addition to the normal information.
-pShow process id's only.
-nShow only processes that have changed status since the last notification are printed.
-rRestrict output to running jobs only.
-sRestrict output to stopped jobs only.
-xCOMMAND is run after all job specifications that appear in ARGS have been replaced with the process ID of that job's process group leader./td>
+|选项|描述| +|---|------------------| +|`-l`| 列出进程 ID 及其它信息。| +|`-p`| 仅列出进程 ID。| +|`-n`| 仅列出自从上次输出了状态变化提示(比如显示有进程退出)后的发生了状态变化的进程。| +|`-r`| 仅显示运行中的作业。| +|`-s`| 仅显示停止的作业。| +|`-x`| 运行命令及其参数,并用新的命令的进程 ID 替代所匹配的原有作业的进程组 ID。| ### 关于 /usr/bin/jobs 和 shell 内建的说明 ### -输入以下 type 命令找出是否 jobs 命令是 shell 的内建命令或是外部命令: +输入以下 type 命令找出是否 jobs 命令是 shell 的内建命令或是外部命令还是都是: $ type -a jobs @@ -182,15 +157,15 @@ Fig.01: 在 shell 中显示 jobs 的状态 jobs is a shell builtin jobs is /usr/bin/jobs -在几乎所有情况下,jobs 命令都是作为 BASH/KSH/POSIX shell 内建命令被实现的。/usr/bin/jobs 命令不能被用在当前 shell 中。/usr/bin/jobs 命令工作在不同的环境中不共享父 bash/ksh 的 shells 来执行作业。 +在几乎所有情况下,你都需要使用 BASH/KSH/POSIX shell 内建的jobs 命令。/usr/bin/jobs 命令不能被用在当前 shell 中。/usr/bin/jobs 命令工作在不同的环境中,并不共享其父 bash/ksh 的 shell 作业。 -------------------------------------------------------------------------------- -via: +via: http://www.cyberciti.biz/faq/unix-linux-jobs-command-examples-usage-syntax/ 作者:Vivek Gite 译者:[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 34d5bfc306acb7965fd000a3454e6db2379696d7 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 17 Jan 2016 13:04:44 +0800 Subject: [PATCH 0228/1469] PUB:20151208 Top 5 open source community metrics to track MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @sonofelice 翻译的不错,语言组织的很好,部分理解错误的专业术语我修正了。 --- ... open source community metrics to track.md | 47 +++++++++---------- 1 file changed, 23 insertions(+), 24 deletions(-) rename {translated/tech => published}/20151208 Top 5 open source community metrics to track.md (55%) diff --git a/translated/tech/20151208 Top 5 open source community metrics to track.md b/published/20151208 Top 5 open source community metrics to track.md similarity index 55% rename from translated/tech/20151208 Top 5 open source community metrics to track.md rename to published/20151208 Top 5 open source community metrics to track.md index ac0e26b645..5b616f8116 100644 --- a/translated/tech/20151208 Top 5 open source community metrics to track.md +++ b/published/20151208 Top 5 open source community metrics to track.md @@ -1,62 +1,61 @@ -五大开源社区指标追踪 +衡量开源社区的五大指标 ================================================================================ ![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/yearbook2015-osdc-lead-1.png) -如果你决定使用指标来追踪你的免费开源的软件社区。那么问题来了:我应该去追踪哪些指标呢? +如果你想要使用指标来追踪你的自由开源软件(FOSS)的社区。现在就面临着一个问题:我应该去追踪哪些指标呢? -要回答这个问题,你必须知道你需要什么信息。比如,你可能想要知道一个项目社区的可持续性。一个社区对问题的应对速度有多快。一个社区怎么吸引、维护或者流失贡献者。一旦你知道需要哪类信息,你就可以找出哪些社区活动可以提供你想要知道的内容。幸运的是,免费开源软件社区(FOSS)一些遵从开放式开发模型的项目在其软件开发仓库里留下了大量的公共数据,我们可以对这些数据进行分析,并从中收集到一些有用的数据。 +要回答这个问题,你必须知道你需要什么信息。比如,你可能想要知道一个项目社区的可持续性。一个社区对问题的应对速度有多快。一个社区怎么吸引、维护或者流失贡献者。一旦你知道需要哪类信息,你就可以找出哪些社区活动可以提供你想要知道的内容。幸运的是,自由开源软件(FOSS)遵从开放式开发模型,在其软件开发仓库里留下了大量的公共数据,我们可以对这些数据进行分析,并从中收集到一些有用的数据。 在这篇文章中,我会介绍一些指标,从而为你的项目社区提供一个多方位的视角分析。 -### 1. 社区活动 ### +### 1. 社区活动(Activity) ### -一个社区的总体活动和这个社区怎样随着时间演变,是度量所有社区好坏的非常有用的指标。社区活动是评价一个社区工作量的第一印象,也可以用来追踪不同种类的活动。比如,提交次数,给人的第一印象就是跟开发工作量挂钩。通过开放的投票数我们可以大概知道提交了多少bug或者又提出了多少新特性。邮件列表的数量或者论坛帖子的数量可以让我们了解到有过多少次公开的讨论。 +一个社区的总体活动和这个社区怎样随着时间演变,是度量所有社区好坏的非常有用的指标。社区活动是评价一个社区工作量的第一印象,也可以用来追踪不同种类的活动。比如,提交次数,给人的第一印象就是跟开发工作量挂钩。通过提出的问题(tickets opened)我们可以大概知道提交了多少 bug 或者又提出了多少新特性。邮件列表中的邮件数量或者论坛帖子的数量可以让我们了解到有过多少次公开讨论。 ![Activity metrics chart](https://opensource.com/sites/default/files/images/business-uploads/activity-metrics.png) -[OpenStack活动看板][1]上面显示的项目代码提交次数和代码评审之后代码合并次数随时间变化的趋势图(周数据) +[OpenStack 活动看板][1]上面显示的项目代码提交次数和代码评审之后代码合并次数随时间变化的趋势图(周数据)。 -### 2. 社区规模 ### +### 2. 社区规模(Size) ### -社区的规模指的是参与到这个社区的人数,但是,基于不同形式的参与人数也有很大的差别。好消息是,通常你只对积极活跃的贡献者比较感兴趣。活跃的贡献者会在项目的仓库留下一些线索。这意味着你可以通过查看git仓库存放的代码中**author**字段来统计积极贡献代码的人数,或者通过看积极参与问题解决的人的得票数来统计活跃人数。 +社区的规模指的是参与到这个社区的人数,但是,基于不同形式的参与人数也有很大的差别。好消息是,通常你只对积极活跃的贡献者比较感兴趣。活跃的贡献者会在项目的仓库留下一些线索。这意味着你可以通过查看git仓库存放的代码中**author**字段来统计积极贡献代码的人数,或者通过看积极参与问题解决的人数来统计活跃人数。 -所谓活跃(某些人做了某些事)可以扩展到很多方面。一种常见的跟踪活动的方式是看有多少人做了工作量相当可观的任务。比如,通常一个项目代码的贡献者是来自这个项目社区的一小部分人。了解了这一小部分人,就对核心的工作组(比如,领导这个社区的人)有一个基本的认识了。 +所谓活动(某些人做了某些事)可以扩展到很多方面。一种常见的跟踪活动的方式是看有多少人做了工作量相当可观的任务。比如,通常一个项目代码的贡献者是来自这个项目社区的一小部分人。了解了这一小部分人,就对核心的工作组(比如,领导这个社区的人)有一个基本的认识了。 ![Size metrics chart](https://opensource.com/sites/default/files/images/business-uploads/size-metrics.png) -[Xen项目开发看板][2]上展示的该项目邮件列表上作者人数和提交人数随时间的变化趋势(每月数据) +[Xen 项目开发看板][2]上展示的该项目邮件列表上作者人数和提交人数随时间的变化趋势(每月数据) -### 3. 社区表现 ### +### 3. 社区表现(Performance) ### +到目前为止,关注点主要集中在活动数量和贡献者数量的统计上了。你也可以分析流程还有用户的表现如何。比如,你可以测量某流程需要多久才能执行完成。解决或者关闭问题的时间可以表明一个需要及时响应的项目对新信息的应对如何,比如修复一个报告过来的 bug 或者实现一个新需求。代码评审花费的时间,即从代码修改提交到被通过的时间,可以看出更新一个提出的改变要达到社区期望的标准需要多久。 -到目前为止,关注点主要集中在活动数量和贡献者数量的统计上了。你也可以分析流程还有用户的表现如何。比如,你可以测量某流程需要多久才能执行完成。解决或者关闭投票的时间可以表明一个需要及时响应的项目对新信息的应对如何,比如修复一个已经提出的bug或者实现一个新需求。代码评审花费的时间,即从代码修改提交到被通过的时间,可以看出更新一个提出的改变要达到社区期望的标准需要多久。 - -其他的一些指标主要与项目处理挂起的工作表现如何有关,比如新的和被关闭投票的比例,或者仍然没有关闭的代码评审的后台日志。这些参数能告诉我们像投入到解决这些问题的资源是否充足这样的一些信息。 +其他的一些指标主要与项目处理挂起的工作表现如何有关,比如新的和被关闭问题的比例,或者仍然没有完成的代码评审的队列。这些参数能告诉我们像投入到解决这些问题的资源是否充足这样的一些信息。 ![Efficiency metrics chart](https://opensource.com/sites/default/files/images/business-uploads/efficiency-metrics.png) -在[2015第三季度OpenStack开发报告][3]上显示的,每季度关闭与打开状态的投票数之比,接受与放弃的改变提案与最新的改变提案之比。 +在[2015第三季度 OpenStack 开发报告][3]上显示的,每季度关闭与打开状态的问题数之比,接受与放弃的改变提案与最新的改变提案之比。 -### 4. 社区人口统计 ### +### 4. 社区人口特征(Demographics) ### -随着贡献者的参与或者退出,社区也在不断改变。社区的年龄(从社区成员加入时算起)取决于随着时间变化,人们怎么加入和退出社区。[社区年龄统计图表][4]很直观的展现了这些改变随时间的变化。图标是由一系列的水平条组成,每两条水平条代表加入到社区的一代人。对于每一代,Attracted水平条表示在相应的时间里有多少人加入到了社区。Retained水平条表示有多少人目前仍然活跃在社区。 +随着贡献者的参与或者退出,社区也在不断改变。随着人们加入和退出社区,社区成员的会龄(从社区成员加入时算起)也各异。[社区会龄统计图表][4]很直观的展现了这些改变随时间的变化。图表是由一系列的水平条组成,每两条水平条代表加入到社区的一代人。对于每一代,吸引力(Attracted)水平条表示在相应的时间里有多少人加入到了社区。活跃度(Retained)水平条表示有多少人目前仍然活跃在社区。 -代表一代人的两个水平条的关系就是滞留比例:依然在这个项目中的那一代人的一部分。Attracted水平条的完整集合表示这个项目在过去有多么受欢迎。Retained水平条的完整集合则表示社区目前的年龄结构。 +代表一代人的两个水平条的关系就是滞留比例:依然在这个项目中的那一代人的一部分。吸引力(Attracted)水平条的完整集合表示这个项目在过去有多么受欢迎。活跃度(Retained)水平条的完整集合则表示社区目前的会龄结构。 ![Demographics metrics chart](https://opensource.com/sites/default/files/images/business-uploads/demography-metrics.png) -[Eclipse开发看板][5]上显示的Eclipse社区的社区年龄表。每六个月定义一次。 +[Eclipse 开发看板][5]上显示的 Eclipse 社区的社区年龄表。每六个月定义一次。 -### 5. 社区多样性 ### +### 5. 社区多样性(Diversity) ### -多样性是一个社区保持弹性的很关键的因素。通常来说,一个社区越具有多样性(人或者组织参与的多元化),那么这个社区的弹性也就越大。比如,如果一个公司要决定离开一个免费开源社区,那么这个公司的员工贡献5%要远比贡献85%所可能引起的潜在问题要小很多。 +多样性是一个社区保持弹性的很关键的因素。通常来说,一个社区越具有多样性(人或者组织参与的多元化),那么这个社区的弹性也就越大。比如,如果一个公司要决定离开一个自由开源社区,那么这个公司的员工贡献5%要远比贡献85%所可能引起的潜在问题要小很多。 -[小马因素][6],是[Daniel Gruno][7] 为“最少的开发者贡献了50%的代码提交量”这一现象定义的术语。基于这一小马因素,大象因素则是指最少量的公司其员工贡献了50%的代码提交量。这两个数据提供了一种指示,即这个社区依赖多少人或者公司。 +[小马因素(Pony Factor)][6],是 [Daniel Gruno][7] 为“最少的开发者贡献了50%的代码提交量”这一现象定义的术语。基于小马因素,大象因素(Elephant Factor)则是指最少量的公司其员工贡献了50%的代码提交量。这两个数据提供了一种指示,即这个社区依赖多少人或者公司。 ![Diversity metrics chart](https://opensource.com/sites/default/files/images/business-uploads/diversity-metrics.png) -[2015开发云数量状态统计][8]显示的在云计算领域的几个免费开源社区项目的小马和大象因素。 +[2015开发云数量状态统计][8]显示的在云计算领域的几个自由开源社区项目的小马和大象因素。 还有许多其他的指标来衡量一个社区。在决定收集哪些指标时,可以考虑一下社区的目标,还有哪些指标能帮到你。 @@ -66,7 +65,7 @@ via: https://opensource.com/business/15/12/top-5-open-source-community-metrics-t 作者:[Jesus M. Gonzalez-Barahona][a] 译者:[sonofelice](https://github.com/sonofelice) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 8ccde3a4b74336a1bb3f8f47fb055c3675ad2abd Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 17 Jan 2016 21:10:01 +0800 Subject: [PATCH 0229/1469] PUB:20151223 How to Setup SSH Login Without Password CentOS or RHEL @fw8899 --- ...H Login Without Password CentOS or RHEL.md | 105 ++++++++++++++++++ ...H Login Without Password CentOS or RHEL.md | 105 ------------------ 2 files changed, 105 insertions(+), 105 deletions(-) create mode 100644 published/20151223 How to Setup SSH Login Without Password CentOS or RHEL.md delete mode 100644 translated/tech/20151223 How to Setup SSH Login Without Password CentOS or RHEL.md diff --git a/published/20151223 How to Setup SSH Login Without Password CentOS or RHEL.md b/published/20151223 How to Setup SSH Login Without Password CentOS or RHEL.md new file mode 100644 index 0000000000..6f9cb3e793 --- /dev/null +++ b/published/20151223 How to Setup SSH Login Without Password CentOS or RHEL.md @@ -0,0 +1,105 @@ +如何在 CentOS / RHEL 上设置 SSH 免密码登录 +================================================================================ +![](http://www.ehowstuff.com/wp-content/uploads/2015/12/notebook-1071774_1280.jpg) + +作为系统管理员,你计划在 Linux 上使用 OpenSSH,完成日常工作的自动化,比如文件传输、备份数据库转储文件到另一台服务器等。为实现该目标,你需要从主机 A 能自动登录到主机 B。自动登录也就是说,要在 shell 脚本中使用ssh,而无需要输入任何密码。 + +本文会告诉你怎样在 CentOS/RHEL 上设置 SSH 免密码登录。自动登录配置好以后,你可以通过它使用 SSH (Secure Shell)和安全复制 (SCP)来移动文件。 + +SSH 是开源的,是用于远程登录的最为可靠的网络协议。系统管理员用它来执行命令,以及通过 SCP 协议在网络上向另一台电脑传输文件。 + +通过配置 SSH 免密码登录,你可以享受到如下的便利: + +- 用脚本实现日常工作的自动化。 +- 增强 Linux 服务器的安全性。这是防范虚拟专用服务器(VPS)遭受暴力破解攻击的一个推荐的方法,SSH 密钥单凭暴力破解是几乎不可攻破的。 + +### 什么是 ssh-keygen ### + +ssh-keygen 是一个用来生成、创建和管理 SSH 认证用的公私钥的工具。通过 ssh-keygen 命令,用户可以创建支持SSH1 和 SSH2 两个协议的密钥。ssh-keygen 为 SSH1 协议创建 RSA 密钥,SSH2 则可以是 RSA 或 DSA。 + +### 什么是 ssh-copy-id ### + +ssh-copy-id 是用来将本地公钥拷贝到远程的 authorized_keys 文件的脚本命令,它还会将身份标识文件追加到远程机器的 ~/.ssh/authorized_keys 文件中,并给远程主机的用户主目录适当的的权限。 + +### SSH 密钥 ### + +SSH 密钥为登录 Linux 服务器提供了更好且安全的机制。运行 ssh-keygen 后,将会生成公私密钥对。你可以将公钥放置到任意服务器,从持有私钥的客户端连接到服务器的时,会用它来解锁。两者匹配时,系统无需密码就能解除锁定。 + +### 在 CentOS 和 RHEL 上设置免密码登录 SSH ### + +以下步骤在 CentOS 5/6/7、RHEL 5/6/7 和 Oracle Linux 6/7 上测试通过。 + +节点1 : 192.168.0.9 +节点2 : 192.168.l.10 + +#### 步骤1 : #### + +测试节点1到节点2的连接和访问: + + [root@node1 ~]# ssh root@192.168.0.10 + The authenticity of host '192.168.0.10 (192.168.0.10)' can't be established. + RSA key fingerprint is 6d:8f:63:9b:3b:63:e1:72:b3:06:a4:e4:f4:37:21:42. + Are you sure you want to continue connecting (yes/no)? yes + Warning: Permanently added '192.168.0.10' (RSA) to the list of known hosts. + root@192.168.0.10's password: + Last login: Thu Dec 10 22:04:55 2015 from 192.168.0.1 + [root@node2 ~]# + +#### 步骤二: #### + +使用 ssh-key-gen 命令生成公钥和私钥,这里要注意的是可以对私钥进行加密保护以增强安全性。 + + [root@node1 ~]# ssh-keygen + Generating public/private rsa key pair. + Enter file in which to save the key (/root/.ssh/id_rsa): + Enter passphrase (empty for no passphrase): + Enter same passphrase again: + Your identification has been saved in /root/.ssh/id_rsa. + Your public key has been saved in /root/.ssh/id_rsa.pub. + The key fingerprint is: + b4:51:7e:1e:52:61:cd:fb:b2:98:4b:ad:a1:8b:31:6d root@node1.ehowstuff.local + The key's randomart image is: + +--[ RSA 2048]----+ + | . ++ | + | o o o | + | o o o . | + | . o + .. | + | S . . | + | . .. .| + | o E oo.o | + | = ooo. | + | . o.o. | + +-----------------+ + +#### 步骤三: #### + +用 ssh-copy-id 命令将公钥复制或上传到远程主机,并将身份标识文件追加到节点2的 ~/.ssh/authorized_keys 中: + + [root@node1 ~]# ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.0.10 + root@192.168.0.10's password: + Now try logging into the machine, with "ssh '192.168.0.10'", and check in: + + .ssh/authorized_keys + + to make sure we haven't added extra keys that you weren't expecting. + +#### 步骤四: #### + +验证免密码 SSH 登录节点2: + + [root@node1 ~]# ssh root@192.168.0.10 + Last login: Sun Dec 13 14:03:20 2015 from www.ehowstuff.local + +我希望这篇文章能帮助到你,为你提供 SSH 免密码登录 CentOS / RHEL 的基本认知和快速指南。 + +-------------------------------------------------------------------------------- + +via: http://www.ehowstuff.com/ssh-login-without-password-centos/ + +作者:[skytech][a] +译者:[fw8899](https://github.com/fw8899) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.ehowstuff.com/author/skytech/ diff --git a/translated/tech/20151223 How to Setup SSH Login Without Password CentOS or RHEL.md b/translated/tech/20151223 How to Setup SSH Login Without Password CentOS or RHEL.md deleted file mode 100644 index a806d76491..0000000000 --- a/translated/tech/20151223 How to Setup SSH Login Without Password CentOS or RHEL.md +++ /dev/null @@ -1,105 +0,0 @@ -如何在CentOS / RHEL上设置SSH免密码登录 -================================================================================ -![](http://www.ehowstuff.com/wp-content/uploads/2015/12/notebook-1071774_1280.jpg) - -作为系统管理员,你计划在Linux上使用OpenSSHell,完成日常工作的自动化,比如文件传输、备份数据库转储文件到另一台服务器。为实现该目标,你需要从主机A能自动登录到主机B。自动登录也就是说,要在shell脚本中使用ssh,而无需要输入任何密码。 - -本文会告诉你怎样在CentOS/RHEL上设置SSH免密码登录。自动登录配置好以后,你可以在它基础上用SSH (Secure Shell) 和secure copy (SCP)移动文件。 - -SSH是开源的,用于远程登录的最为可靠的网络协议。系统管理员用它来执行命令,以及通过SCP协议在网络上向另一台电脑传输文件。 - -通过配置SSH免密码登录,你可以享受到如下的便利: - -a) 用脚本实现日常工作的自动化。 -b) 增强Linux服务器的安全性。这是防范虚拟专用服务器(VPS)遭受暴力破解攻击的一个推荐的方法,SSH 密钥单凭暴力破解是几乎不可攻破的。 - -### 什么是ssh-keygen ### - -ssh-keygen是Unix实用工具包里的一个命令,用来生成、创建和管理SSH认证用的公私钥。通过ssh-keygen命令,用户可以创建支持SSH1和SSH2的密钥。ssh-keygen为SSH1创建RSA密钥,SSH2则可以是RSA或DSA。 - -### 什么是ssh-copy-id ### - -ssh-copy-id是用来将本地公钥拷贝到远程authorized_keys文件的脚本命令,它还会将身份标识文件追加到远程机器的~/.ssh/authorized_keys文件中,并给远程主机的用户主目录适当的的权限 - -### SSH keys ### - -SSH keys为登录Linux服务器提供了更好且安全的机制。运行ssh-keygen后,将会生成公私密钥对。你可以将公钥放置到任意服务器,从持有私钥的客户端连接到服务器的时,会用它来解锁。两者匹配时,系统无需密码就能解除锁定。 - -### 在CentOS和RHEL上设置免密码登录SSH ### - -以下步骤在CentOS 5/6/7、RHEL 5/6/7和Oracle Linux 6/7上测试通过。 - -节点1 : 192.168.0.9 -节点2 : 192.168.l.10 - -#### 步骤1 : #### - -测试节点1到节点2的连接和访问: - - [root@node1 ~]# ssh root@192.168.0.10 - The authenticity of host '192.168.0.10 (192.168.0.10)' can't be established. - RSA key fingerprint is 6d:8f:63:9b:3b:63:e1:72:b3:06:a4:e4:f4:37:21:42. - Are you sure you want to continue connecting (yes/no)? yes - Warning: Permanently added '192.168.0.10' (RSA) to the list of known hosts. - root@192.168.0.10's password: - Last login: Thu Dec 10 22:04:55 2015 from 192.168.0.1 - [root@node2 ~]# - -#### 步骤二: #### - -使用ssh-key-gen命令生成公钥和私钥,这里要注意的是可以对私钥进行加密保护以增强安全性。 - - [root@node1 ~]# ssh-keygen - Generating public/private rsa key pair. - Enter file in which to save the key (/root/.ssh/id_rsa): - Enter passphrase (empty for no passphrase): - Enter same passphrase again: - Your identification has been saved in /root/.ssh/id_rsa. - Your public key has been saved in /root/.ssh/id_rsa.pub. - The key fingerprint is: - b4:51:7e:1e:52:61:cd:fb:b2:98:4b:ad:a1:8b:31:6d root@node1.ehowstuff.local - The key's randomart image is: - +--[ RSA 2048]----+ - | . ++ | - | o o o | - | o o o . | - | . o + .. | - | S . . | - | . .. .| - | o E oo.o | - | = ooo. | - | . o.o. | - +-----------------+ - -#### 步骤三: #### - - 用ssh-copy-di命令将公钥复制或上传到远程主机,并将身份标识文件追加到节点2的~/.ssh/authorized_keys中: - - [root@node1 ~]# ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.0.10 - root@192.168.0.10's password: - Now try logging into the machine, with "ssh '192.168.0.10'", and check in: - - .ssh/authorized_keys - - to make sure we haven't added extra keys that you weren't expecting. - -#### 步骤四: #### - -验证免密码SSH登录节点2: - - [root@node1 ~]# ssh root@192.168.0.10 - Last login: Sun Dec 13 14:03:20 2015 from www.ehowstuff.local - -我希望这篇文章能帮助到你,为你提供SSH免密码登录CentOS / RHEL的基本认知和快速指南。 - --------------------------------------------------------------------------------- - -原载: http://www.ehowstuff.com/ssh-login-without-password-centos/ - -作者:[skytech][a] -译者:[fw8899](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.ehowstuff.com/author/skytech/ From ce9804c8aaf5ed99961e3b66ca246dc7ca1e70d7 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 17 Jan 2016 21:27:20 +0800 Subject: [PATCH 0230/1469] PUB:Learn with Linux--Learning to Type @bazz2 --- .../Learn with Linux--Learning to Type.md | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) rename {translated/tech/Learn with Linux => published}/Learn with Linux--Learning to Type.md (74%) diff --git a/translated/tech/Learn with Linux/Learn with Linux--Learning to Type.md b/published/Learn with Linux--Learning to Type.md similarity index 74% rename from translated/tech/Learn with Linux/Learn with Linux--Learning to Type.md rename to published/Learn with Linux--Learning to Type.md index 75694225aa..01c2dbc70d 100644 --- a/translated/tech/Learn with Linux/Learn with Linux--Learning to Type.md +++ b/published/Learn with Linux--Learning to Type.md @@ -1,36 +1,36 @@ -Linux 教学之教你练打字 +与 Linux 一起学习:学习打字 ================================================================================ ![](https://www.maketecheasier.com/assets/uploads/2015/07/learntotype-featured.png) -[Linux 学习系列][1]的所有文章: +[与 Linux 一起学习][1]的所有文章: -- [Linux 教学之教你练打字][2] -- [Linux 教学之物理模拟][3] -- [Linux 教学之教你玩音乐][4] -- [Linux 教学之两款地理软件][5] -- [Linux 教学之掌握数学][6] +- [与 Linux 一起学习:学习打字][2] +- [与 Linux 一起学习:物理模拟][3] +- [与 Linux 一起学习:玩音乐][4] +- [与 Linux 一起学习:两款地理软件][5] +- [与 Linux 一起学习: 使用这些 Linux 应用来征服你的数学学习][6] -引言:Linux 提供大量的教学软件和工具,面向各个年级段以及年龄段,提供大量学科的练习实践,其中大多数是可以与用户进行交互的。本“Linux 教学”系列就来介绍一些教学软件。 +Linux 提供大量的教学软件和工具,面向各个年级以及不同年龄段,提供大量学科的练习实践,其中大多数是可以与用户进行交互的。本“与 Linux 一起学习”系列就来介绍一些教学软件。 -很多人都要打字,操作键盘已经成为他们的第二天性。 但是这些人中有多少是依然使用两个手指头来快速地按键盘的?即使学校有教我们使用键盘的方法(LCTT 译注:呃。。。),我们也会慢慢地抛弃正确的打字姿势,养成只用两个大拇指玩键盘的习惯。 +很多人都要打字,操作键盘已经成为他们的第二天性。但是这些人中有多少是依然使用两个手指头来快速地按键盘的?即使学校有教我们使用键盘的方法,我们也会慢慢地抛弃正确的打字姿势,养成只用两个大拇指玩键盘的习惯。(LCTT 译注:呃,你确认是拇指而不是食指?) -下面要介绍的两款软件可以帮你掌控你的键盘,然后你就可以让你的手指跟上你的思维,然后你的思维就不会被打断了。当然,还有很多更炫更酷的软件可供选择,但本文所选的这两款是最简单、最容易上手的。 +下面要介绍的两款软件可以帮你掌控你的键盘,然后你就可以让你的手指跟上你的思维,这样你的思维就不会被打断了。当然,还有很多更炫更酷的软件可供选择,但本文所选的这两款是最简单、最容易上手的。 ### TuxType (或者叫 TuxTyping) ### -TuxType 是给小孩子玩的。在一些有趣的游戏中,小学生们可以通过完成一些简单的练习来 get “10个手指打字”的新技能。 +TuxType 是给小孩子玩的。在一些有趣的游戏中,小学生们可以通过完成一些简单的练习来 Get “双手打字以示清白”的新技能。 Debian 及其衍生版本(包含所有 Ubuntu 衍生版本)的标准软件仓库都有 TuxType,使用下面的命令安装: sudo apt-get install tuxtype -软件开始时有一个简单的 Tux 界面和一段难听的 midi 音乐,幸运的是你可以通过右下角的喇叭按钮把声音调低了。(LCTT译注:Tux 就是那只 Linux 吉祥物,Linus 说它的表情被设计成刚喝完啤酒后的满足感,见《Just For Fun》。) +软件开始时有一个简单的 Tux 界面和一段难听的 midi 音乐,幸运的是你可以通过右下角的喇叭按钮把声音调低了。(LCTT 译注:Tux 就是那只 Linux 吉祥物,Linus 说它的表情被设计成刚喝完啤酒后的满足感,见《Just For Fun》。) ![learntotype-tuxtyping-main](https://www.maketecheasier.com/assets/uploads/2015/07/learntotype-tuxtyping-main.jpg) -最开始处的两个选项“Fish Cascade”和“Comet Zap”是打字游戏,当你开始游戏时,你需要很投入到这个课程。 +最开始处的两个选项“Fish Cascade”和“Comet Zap”是打字游戏,当你开始游戏时,你就投入到了这个课程。 -第3个选项为“Lession”,提供40多个简单的课程,每个课程会增加一个字母让你来练习,练习过程中会给出一些提示,比如应该用哪个手指按键盘上的字母。 +第3个选项为“Lessions”,提供40多个简单的课程,每个课程会增加一个字母让你来练习,练习过程中会给出一些提示,比如应该用哪个手指按键盘上的字母。 ![learntotype-tuxtyping-exd1](https://www.maketecheasier.com/assets/uploads/2015/07/learntotype-tuxtyping-exd1.jpg) @@ -68,7 +68,7 @@ GNU Typist 也在大多数 Debian 衍生版本的软件库中,运行下面的 ![learntotype-gtype-lesson](https://www.maketecheasier.com/assets/uploads/2015/07/learntotype-gtype-lesson.png) -在交互练习的过程中,如果你输入错误,会将错误点高亮显示。不会像其他漂亮界面分散你的注意力,你可以专注于练习。每个课程的右下角都有一组统计数据来展示你的表现,如果你犯了很多错误,就可能无法通过关卡了。 +在交互练习的过程中,如果你输入错误,会将错误位置高亮显示。不会像其他漂亮界面分散你的注意力,你可以专注于练习。每个课程的右下角都有一组统计数据来展示你的表现,如果你犯了很多错误,就可能无法通过关卡了。 ![learntotype-gtype-mistake](https://www.maketecheasier.com/assets/uploads/2015/07/learntotype-gtype-mistake.png) @@ -106,7 +106,7 @@ via: https://www.maketecheasier.com/learn-to-type-in-linux/ 作者:[Attila Orosz][a] 译者:[bazz2](https://github.com/bazz2) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -116,4 +116,4 @@ via: https://www.maketecheasier.com/learn-to-type-in-linux/ [3]:https://www.maketecheasier.com/linux-physics-simulation/ [4]:https://www.maketecheasier.com/linux-learning-music/ [5]:https://www.maketecheasier.com/linux-geography-apps/ -[6]:https://www.maketecheasier.com/learn-linux-maths/ \ No newline at end of file +[6]:https://linux.cn/article-6546-1.html \ No newline at end of file From 0f6a6eefb17577574b3e2978761d0218b2da1713 Mon Sep 17 00:00:00 2001 From: martin qi Date: Sun, 17 Jan 2016 21:33:29 +0800 Subject: [PATCH 0231/1469] =?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 --- ...dation--Best Quotes of Richard Stallman.md | 170 ----------------- ...dation--Best Quotes of Richard Stallman.md | 171 ++++++++++++++++++ 2 files changed, 171 insertions(+), 170 deletions(-) delete mode 100644 sources/talk/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md create mode 100644 translated/talk/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md diff --git a/sources/talk/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md b/sources/talk/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md deleted file mode 100644 index af8bb311db..0000000000 --- a/sources/talk/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md +++ /dev/null @@ -1,170 +0,0 @@ -30 Years of Free Software Foundation: Best Quotes of Richard Stallman -================================================================================ -注:youtube 视频 - - -**Richard Matthew Stallman** (rms) – one of biggest figure in Information Technology. He is a computer programmer and architect (GNU Compiler Collection (GCC)), GNU Debugger, Emacs), software freedom evangelist, [GNU Project][1] and [FSF][2] founder. - -**GNU** is a recursive acronym “GNU’s Not Unix!”. GNU – collection of free computer software for Unix-based operation system. Can be used with GNU/Hurd and Linux kernels. Announced on September 27, 1983. General components: - -- GNU Compiler Collection (GCC) -- GNU C library (glibc) -- GNU Core Utilities (coreutils) -- GNU Debugger (GDB) -- GNU Binary Utilities (binutils) -- GNU Bash shell -- NOME desktop environment - -注:视频 - - -**Free Software Foundation** (FSF) – non-profit organization for free software and computer user freedom promotion and defend their rights. Read more information here. Founded on 4 October 1985. - -- The freedom to run the program as you wish, for any purpose (freedom 0). -- The freedom to study how the program works, and change it so it does your computing as you wish (freedom 1). Access to the source code is a precondition for this. -- The freedom to redistribute copies so you can help your neighbor (freedom 2). -- The freedom to distribute copies of your modified versions to others (freedom 3). By doing this you can give the whole community a chance to benefit from your changes. Access to the source code is a precondition for this. - -This is the Four Freedoms of free software. - -Here is quotes of Richard Stallman about freedom, software, social, philosophy and others things. - -**About Facebook:** - -> Facebook is not your friend, it is a surveillance engine. - -**About Android:** - -> Android is very different from the GNU/Linux operating system because it contains very little of GNU. Indeed, just about the only component in common between Android and GNU/Linux is Linux, the kernel. - -**About computer industry:** - -> The computer industry is the only industry that is more fashion-driven than women's fashion. - -**About cloud computing:** - -> The interesting thing about cloud computing is that we've redefined cloud computing to include everything that we already do. - -**About ethics:** - -> Whether gods exist or not, there is no way to get absolute certainty about ethics. Without absolute certainty, what do we do? We do the best we can. - -**About freedom:** - -> Free software is software that respects your freedom and the social solidarity of your community. So it's free as in freedom. - -**About goal and idealism:** - -> If you want to accomplish something in the world, idealism is not enough - you need to choose a method that works to achieve the goal. - -**About sharing:** - -> Sharing is good, and with digital technology, sharing is easy. - -**About facebook (extended version):** - -> Facebook mistreats its users. Facebook is not your friend; it is a surveillance engine. For instance, if you browse the Web and you see a 'like' button in some page or some other site that has been displayed from Facebook. Therefore, Facebook knows that your machine visited that page. - -**About web application:** - -> One reason you should not use web applications to do your computing is that you lose control. -> -> If you use a proprietary program or somebody else's web server, you're defenceless. You're putty in the hands of whoever developed that software. - -**About books:** - -> With paper printed books, you have certain freedoms. You can acquire the book anonymously by paying cash, which is the way I always buy books. I never use a credit card. I don't identify to any database when I buy books. Amazon takes away that freedom. - -**About MPAA:** - -> Officially, MPAA stands for Motion Picture Association of America, but I suggest that MPAA stands for Malicious Power Attacking All. - -**About money and career:** - -> I could have made money this way, and perhaps amused myself writing code. But I knew that at the end of my career, I would look back on years of building walls to divide people, and feel I had spent my life making the world a worse place. - -**About proprietary software:** - -> Proprietary software keeps users divided and helpless. Divided because each user is forbidden to redistribute it to others, and helpless because the users can't change it since they don't have the source code. They can't study what it really does. So the proprietary program is a system of unjust power. - -**About smartphone:** - -> A smartphone is a computer - it's not built using a computer - the job it does is the job of being a computer. So, everything we say about computers, that the software you run should be free - you should insist on that - applies to smart phones just the same. And likewise to those tablets. - -**About CD and digital content:** - -> CD stores have the disadvantage of an expensive inventory, but digital bookshops would need no such thing: they could write copies at the time of sale on to memory sticks, and sell you one if you forgot your own. - -**About paradigm of competition:** - -> The paradigm of competition is a race: by rewarding the winner, we encourage everyone to run faster. When capitalism really works this way, it does a good job; but its defenders are wrong in assuming it always works this way. - -**About vi and emacs:** - -> People sometimes ask me if it is a sin in the Church of Emacs to use vi. Using a free version of vi is not a sin; it is a penance. So happy hacking. - -**About freedom and history:** - -> Value your freedom or you will lose it, teaches history. 'Don't bother us with politics', respond those who don't want to learn. - -**About patents:** - -> Fighting patents one by one will never eliminate the danger of software patents, any more than swatting mosquitoes will eliminate malaria. -> -> Software patents are dangerous to software developers because they impose monopolies on software ideas. - -**About copyrights:** - -> In practice, the copyright system does a bad job of supporting authors, aside from the most popular ones. Other authors' principal interest is to be better known, so sharing their work benefits them as well as readers. - -**About pay for work:** - -> There is nothing wrong with wanting pay for work, or seeking to maximize one's income, as long as one does not use means that are destructive. - -**About Chrome OS:** - -> In essence, Chrome OS is the GNU/Linux operating system. However, it is delivered without the usual applications, and rigged up to impede and discourage installing applications. - -**About Linux users:** - -> Many users of the GNU/Linux system will not have heard the ideas of free software. They will not be aware that we have ideas, that a system exists because of ethical ideals, which were omitted from ideas associated with the term 'open source.' - -**About privacy in facebook:** - -> If there is a Like button in a page, Facebook knows who visited that page. And it can get IP address of the computer visiting the page even if the person is not a Facebook user. - -**About programming:** - -> Programming is not a science. Programming is a craft. -> -> My favorite programming languages are Lisp and C. However, since around 1992 I have worked mainly on free software activism, which means I am too busy to do much programming. Around 2008 I stopped doing programming projects. -> -> C++ is a badly designed and ugly language. It would be a shame to use it in Emacs. - -**About hacking and learn programming:** - -> People could no longer learn hacking the way I did, by starting to work on a real operating system, making real improvements. In fact, in the 1980s I often came across newly graduated computer science majors who had never seen a real program in their lives. They had only seen toy exercises, school exercises, because every real program was a trade secret. They never had the experience of writing features for users to really use, and fixing the bugs that real users came across. The things you need to know to do real work. -> -> It is hard to write a simple definition of something as varied as hacking, but I think what these activities have in common is playfulness, cleverness, and exploration. Thus, hacking means exploring the limits of what is possible, in a spirit of playful cleverness. Activities that display playful cleverness have "hack value". - -**About web browsing:** - -> For personal reasons, I do not browse the web from my computer. (I also have no net connection much of the time.) To look at page I send mail to a daemon which runs wget and mails the page back to me. It is very efficient use of my time, but it is slow in real time. - -**About music sharing:** - -> Friends share music with each other, they don't allow themselves to be divided by a system that says that nobody is supposed to have copies. - --------------------------------------------------------------------------------- - -via: https://tlhp.cf/fsf-richard-stallman/ - -作者:[Pavlo Rudyi][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://tlhp.cf/author/paul/ -[1]:http://www.gnu.org/ -[2]:http://www.fsf.org/ \ No newline at end of file diff --git a/translated/talk/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md b/translated/talk/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md new file mode 100644 index 0000000000..a8d1616106 --- /dev/null +++ b/translated/talk/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md @@ -0,0 +1,171 @@ +30 年自由软件基金会:理查德·斯托曼语录集锦 +================================================================================ +注:youtube 视频 + + +**理查德·马修·斯托曼** (rms) – IT大牛之一。他是一名程序员,GCC、GDB、Emacs 的构建者,软件自由传教士,[GNU Project][1] 和 [FSF][2] 的创办人。 + +**GNU** 是 “GNU’s Not Unix!”的缩写。GNU 是基于 Unix 操作系统的自由计算机软件集合。支持 GNU/Hurd 和 Linux 内核。于1983年9月27日公诸于众。常有组件: + +- GNU Compiler Collection (GCC) +- GNU C library (glibc) +- GNU Core Utilities (coreutils) +- GNU Debugger (GDB) +- GNU Binary Utilities (binutils) +- GNU Bash shell +- NOME desktop environment + +注:视频 + + +**自由软件基金会** (FSF) – 一个自由软件的非营利组织,致力于计算机用户自由的提升和权力的捍卫。于 1985 年 10 月 4 日成立。阅读[更多][3]。 + +- 于目的无关,随心运行程序的自由(自由0)。 +- 学习程序如何运作,并改变它为你所用的自由(自由1)。可以访问源码是这条的前提。 +- 重新发布副本的自由,如此你便可以帮助你的邻居了 (自由 2)。 +- 发布自己修改版本给他人的自由(自由 3)。这样能让整个社区有机会从你的改变中受益。可以访问源码是这条的前提。 + +以上为自由软件的四项自由原则。 + +以下为理查德·斯托曼关于自由、软件、社交、哲学等的名言摘引。 + +**关于 Facebook:** + +> Facebook 不是你的朋友,是监控引擎。 + +**关于 Android:** + +> Android 和 GNU/Linux 有很大的区别,因为其中几乎没有 GNU。的确,Android 和 GNU/Linux 之间仅有一个共同组件,那就是内核 - Linux。 + +**关于计算机行业:** + +> 计算机行业是唯一一个比时尚女装更被时尚驱动的行业。 + +**关于云计算:** + +> 关于云计算,有趣的是我们已经重新定义了云计算来包含我们曾干的所有事。 + +**关于伦理:** + +> 无论神存在与否,都没有绝对的伦理道德。没有这份理所当然,我们该如何?也唯有尽善吧。 + +**关于自由:** + +> 自由软件是尊重个人自由和社会团结的软件。所以才能如自由般自由自在。 + +**关于目标和理想:** + +> 如果你想为这世界做些什么,仅有理想是不够的,你需要找条通往目标的道路并走完。 + +**关于分享:** + +> 分享很棒,而且数字化技术也使分享变得容易。 + +**关于 facebook(进阶版):** + +> Facebook 蹂躏它们的用户。它不是你们的朋友;它就是个监控引擎。举个例子,你是否曾在一些网页或网站上看到 Facebook 的 “like” 按键。对,Facebook 知道你的电脑曾访问过那些网页。 + +**关于 web 应用:** + +> 给你个为什么不应该使用 web 应用的理由,因为你失去了计算机的控制权。 +> +> 如果你使用私有程序或他人的 web 服务器,那么你只能任人鱼肉。被软件的软件的开发者轻易操纵。 + +**关于书:** + +> 印刷出来的书,当然是自由的。即使你买了别人也不知道,这也是我一直买书的方式。买时不会被任何数据库认出。是亚马逊把自由夺走了。 + +**关于 MPAA:** + +> MPAA 其实是美国电影协会(Motion Picture Association of America),但我认为叫做攻击万物的邪恶力量(Malicious Power Attacking All)更为合适。 + +**关于金钱与职业:** + +> 我可以这样赚钱,并沉浸在编码的快乐中。但在职业生涯结束后,回首目睹自己筑就的高墙将人与人分隔开,我会觉得我耗尽毕生精力只换来了一个更糟糕的世界。 + +**关于私有软件:** + +> 私有软件使用户孤立、无助。因为禁止将软件给他人使用所以孤立,因为无法改变源码所以无助。他们学不了其中正真的工作方式。所以整个私有软件体系就是一种不公的力量。 + +**关于智能手机:** + +> 智能手机就是电脑 - 虽然做的和常用的电脑不同 - 但是却能干电脑能干的活。所以我们所说的一切有关于电脑上的软件应该能自由运行 - 必须坚持 - 在智能手机上也是这样。当然也包括平板。 + +**关于 CD 和数字内容:** + +> CD 商店有一个弱势就是需要昂贵的库存,但是电子商店就没有这方面的需求:他们只需要将售卖的副本写入记忆棒,并在你忘带自己的记忆棒时卖你一个就是了。 + +**关于竞争范式:About paradigm of competition:** + +> 竞争范式就像是赛跑:鼓励每一个跑得更快的人。当资本主义真的这样运作时,当然是件好事;但是维护者若是假设它一直这样运作的话那就大错特错了。 + +**关于 vi 和 emacs:** + +> 有时会有人问我在 Emacs 的阵营使用 vi 是不是一种罪过。使用自由版的 vi 并不是一种罪过;是一种忏悔。所以好好享受其中乐趣吧。 + +**关于自由和历史:** + +> 历史教会我们:珍惜自由,否则你将失去他。“别和我们谈政治”,对听不进的人这就是答复。 + +**关于专利:** + +> 和专利一个一个的战斗并不能解决软件专利带来的危害,就像打再多的蚊子也消灭不了疟疾一样。 +> +> 软件专利对于软件的开发者来说十分危险,因为它们加剧了对于软件理念的垄断。 + +**关于版权:** + +> 其实,版权制度对作者也没有什么好处,撇开最受欢迎的那个,其他作者的主旨可能更好理解,所以分享无论对他们还是你的读者都是一件好事。 + +**关于工作与报酬:** + +> 劳有所得,或寻求收入的最大化并没有什么错,只要不是不择手段。 + +**关于 Chrome OS:** + +> Chrome OS 确实是 GNU/Linux 的操作系统。但是,它在发布时没有安装常用应用,并为安装他们设置了阻碍。 + +**关于 Linux 用户:** + +> 许多的 GNU/Linux 用户并没有听过自由软件。他们并没有意识到,这个系统是因为道德理想才存在的,与此一起被忽视的还有所谓的“开源”。 + +**关于 facebook 的隐私:** + +> 如果页面上有 “like” 按键,Facebook 就能知道谁访问了页面。即使不是 Facebook 的用户,也可以得到访问该页面电脑的 IP 地址。 + +**关于编程:** + +> 编程不是科学,编程是手艺。 +> +> Lisp 和 C 语言是我的最爱。然自 1992 年以来高频的自由软件活动,确实反映了我编的太过匆忙。大概在 2008 年我便停止了编程开发。 +> +> C++ 设计的真糟糕、真丑陋。在 Emacs 上用他应该觉得羞愧。 + +**关于钻研(hacking)和学习编程:** + +> 今时不同往日,大家再也不用走我的老路了,完全可以在实际的操作系统上提升自己。上世纪 80 年代,我常遇见计算机专业的毕业生,自出生以来没见过真正的程序。他们接触的到的只有小玩意和学校的作业,因为每一个程序都是商业机密。他们没有机会去写真正实用的特性,修复用户真正遭遇的问题。做这些事便是你应知晓的最好的提升方式。 +> +> 对于如 hacking 这般多样化的东西真的很难简单的下定义,不过在我看来诸如此类的行为都会有以下的这些共同点:嬉乐、智慧和探索。因此,hacking 意味着对可能的极限的探索,一颗向往快乐与智慧心。能带来快乐与智慧的行为就有 “hack 的价值” 。 + +**关于浏览网页:** + +> 由于个人原因,我不会在我的电脑上浏览网页。(大部分时间处于没有网络连接的状态。)要浏览网页,我需要给守护进程发 mail,然后它会运行 wget 并把页面通过 mail 发还给我。这对我而言已经是最效率了,但那真的比实时慢太多了。 + +**关于音乐共享:** + +> 朋友之间彼此分享音乐,绝不会希望因为系统的一句:禁止私下拷贝!而生分。 + +-------------------------------------------------------------------------------- + +via: https://tlhp.cf/fsf-richard-stallman/ + +作者:[Pavlo Rudyi][a] +译者:[martin2011qi](https://github.com/martin2011qi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://tlhp.cf/fsf-richard-stallman/ +[1]:http://www.gnu.org/ +[2]:http://www.fsf.org/ +[3]:https://www.fsf.org/about/ \ No newline at end of file From 1503c77a9be608066d1c27945cb75e9baaa25bdc Mon Sep 17 00:00:00 2001 From: "Fuliang.Li" Date: Sun, 17 Jan 2016 22:21:35 +0800 Subject: [PATCH 0232/1469] =?UTF-8?q?[=E5=BC=80=E5=A7=8B=E7=BF=BB=E8=AF=91?= =?UTF-8?q?]=2020151126=20Linux=20Foundation=20Explains=20a=20'World=20wit?= =?UTF-8?q?hout=20Linux'=20and=20Open=20Source?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...dation Explains a 'World without Linux' and Open Source.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/talk/20151126 Linux Foundation Explains a 'World without Linux' and Open Source.md b/sources/talk/20151126 Linux Foundation Explains a 'World without Linux' and Open Source.md index 90f8b22e32..c9d08b73bf 100644 --- a/sources/talk/20151126 Linux Foundation Explains a 'World without Linux' and Open Source.md +++ b/sources/talk/20151126 Linux Foundation Explains a 'World without Linux' and Open Source.md @@ -1,3 +1,5 @@ +GHLandy Translating + Linux Foundation Explains a "World without Linux" and Open Source ================================================================================ > The Linux Foundation responds to questions about its "World without Linux" movies, including what the Internet would be like without Linux and other open source software. @@ -48,4 +50,4 @@ via: http://thevarguy.com/open-source-application-software-companies/linux-found [1]:http://linuxfoundation.org/ [2]:http://www.linuxfoundation.org/world-without-linux [3]:http://thevarguy.com/open-source-application-software-companies/new-linux-foundation-video-highlights-role-open-source-3d -[4]:http://thevarguy.com/open-source-application-software-companies/100715/would-internet-exist-without-linux-yes-without-open-sourc \ No newline at end of file +[4]:http://thevarguy.com/open-source-application-software-companies/100715/would-internet-exist-without-linux-yes-without-open-sourc From ff337778161f56454ed7001876b34987012fa5a9 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 17 Jan 2016 22:45:03 +0800 Subject: [PATCH 0233/1469] PUB:Learn with Linux--Physics Simulation @bazz2 --- .../Learn with Linux--Physics Simulation.md | 45 ++++++++++--------- 1 file changed, 25 insertions(+), 20 deletions(-) rename {translated/tech/Learn with Linux => published}/Learn with Linux--Physics Simulation.md (66%) diff --git a/translated/tech/Learn with Linux/Learn with Linux--Physics Simulation.md b/published/Learn with Linux--Physics Simulation.md similarity index 66% rename from translated/tech/Learn with Linux/Learn with Linux--Physics Simulation.md rename to published/Learn with Linux--Physics Simulation.md index 273ff72d5a..452ec3a9eb 100644 --- a/translated/tech/Learn with Linux/Learn with Linux--Physics Simulation.md +++ b/published/Learn with Linux--Physics Simulation.md @@ -1,22 +1,22 @@ -Linux 教学之物理模拟 +与 Linux 一起学习:物理模拟 ================================================================================ ![](https://www.maketecheasier.com/assets/uploads/2015/07/physics-fetured.jpg) -[Linux 学习系列][1]的所有文章: +[与 Linux 一起学习][1]的所有文章: -- [Linux 教学之教你练打字][2] -- [Linux 教学之物理模拟][3] -- [Linux 教学之教你玩音乐][4] -- [Linux 教学之两款地理软件][5] -- [Linux 教学之掌握数学][6] +- [与 Linux 一起学习:学习打字][2] +- [与 Linux 一起学习:物理模拟][3] +- [与 Linux 一起学习:玩音乐][4] +- [与 Linux 一起学习:两款地理软件][5] +- [与 Linux 一起学习:掌握数学][6] -引言:Linux 提供大量的教学软件和工具,面向各个年级段以及年龄段,提供大量学科的练习实践,其中大多数是可以与用户进行交互的。本“Linux 教学”系列就来介绍一些教学软件。 +Linux 提供大量的教学软件和工具,面向各个年级段以及不同年龄段,提供大量学科的练习实践,其中大多数是可以与用户进行交互的。本“与 Linux 一起学习”系列就来介绍一些教学软件。 物理是一个有趣的课题,证据就是任何物理课程都可以用具体的图片演示给你看。能看到物理变化过程是一个很妙的体验,特别是你不需要到教室就能体验到。Linux 上有很多很好的科学软件来为你提供这种美妙感觉,本篇文章只着重介绍其中几种。 ### 1. Step ### -[Step][7] 是一个交互型物理模拟器,KDEEdu[8](KDE 教育)项目的一部分。没人会比它的作者更了解它的作用。在项目官网主页上写着“[Step] 是这样玩的:你放点东西进来,添加一些力(地心引力或者弹簧),然后点击‘模拟’按钮,这款软件就会为你模拟这个物体在真实世界的物理定律影响下的运动状态。你可以改变物体或力的属性(允许在模拟过程中进行修改),然后观察不同属性下产生的现象。Step 可以让你从体验中学习物理!” +[Step][7] 是一个交互型物理模拟器,属于 [KDEEdu][8](KDE 教育)项目的一部分。没人会比它的作者更了解它的作用。在项目官网主页上写着“[Step] 是这样玩的:你放点东西进来,添加一些力(地心引力或者弹簧),然后点击‘模拟(Simulate)’按钮,这款软件就会为你模拟这个物体在真实世界的物理定律影响下的运动状态。你可以改变物体或力的属性(允许在模拟过程中进行修改),然后观察不同属性下产生的现象。Step 可以让你从体验中学习物理!” Step 依赖 Qt 以及其他一些 KDE 所依赖的软件,正是由于像 KDEEdu 之类的项目存在,才使得 KDE 变得如此强大,当然,你可能需要忍受由此带来的庞大的桌面系统。 @@ -30,7 +30,7 @@ Step 有个简单的交互界面,你进去后直接可以进行模拟操作。 ![physics-step-main](https://www.maketecheasier.com/assets/uploads/2015/07/physics-step-main.png) -你会发现所有物品在屏幕左边,包括不同的质点,空气,不同形状的物体,弹簧,以及不同的力(见1区域) 。如果你选中一个物体,屏幕右边会出现简短的描述信息(见2区域),以及你创造的世界的介绍(主要介绍这个世界中包含的物体)(见3区域),以及你当前选中的物体的属性(见4区域),以及你的操作历史(见5区域)。 +你会发现所有物品在屏幕左边,包括不同的质点,空气,不同形状的物体,弹簧,以及不同的力(见区域1) 。如果你选中一个物体,屏幕右边会出现简短的描述信息(见区域2),以及你创造的世界的介绍(主要介绍这个世界中包含的物体)(见区域3),以及你当前选中的物体的属性(见区域4),以及你的操作历史(见区域5)。 ![physics-step-parts](https://www.maketecheasier.com/assets/uploads/2015/07/physics-step-parts.png) @@ -42,7 +42,7 @@ Step 有个简单的交互界面,你进去后直接可以进行模拟操作。 ![physics-step-simulate3](https://www.maketecheasier.com/assets/uploads/2015/07/physics-step-simulate3.png) -想要更多了解 Step,按 F1 键,KDE 帮助中心会打印详细的软件操作手册。 +想要更多了解 Step,按 F1 键,KDE 帮助中心会显示出详细的软件操作手册。 ### 2. Lightspeed ### @@ -50,10 +50,10 @@ Lightspeed 是一个简单的基于 GTK+ 和 OpenGL 的模拟器,可以模拟 受到相对速度影响的现象如下(LCTT 译注:都可以从“光速不变”理论推导出来): -- **洛伦兹收缩** —— 物体看起来变短了 -- **多普乐红移/蓝移** —— 物体的颜色变了 -- **前灯效应** —— 物体的明暗变化(LCTT 译注:当物体接近光速移动时,会在它前进的方向强烈地辐射光子,从这个角度看,物体会变得很亮,相反,从物体背后观察,会发现它很暗) -- **光行差效应** —— 物体扭曲变形了 +- **洛伦兹收缩(The Lorentz contraction)** —— 物体看起来变短了 +- **多普勒红移/蓝移(The Doppler red/blue shift)** —— 物体的颜色变了 +- **前灯效应(The headlight effect)** —— 物体的明暗变化(LCTT 译注:当物体接近光速移动时,会在它前进的方向强烈地辐射光子,从这个角度看,物体会变得很亮,相反,从物体背后观察,会发现它很暗) +- **光行差效应(Optical aberration)** —— 物体扭曲变形了 Lightspeed 有 Debian 的源,执行下面的命令来安装: @@ -75,9 +75,13 @@ Lightspeed 有 Debian 的源,执行下面的命令来安装: ### 特别推荐: Physion ### -Physion 是个非常有趣并且美观的物理模拟软件,比上面介绍的两款软件都好玩好看。可惜在写本文章的时候它的[官网][10]出现问题了,下载页面无法使用。 +Physion 是个非常有趣并且美观的物理模拟软件,比上面介绍的两款软件都好玩好看。 -从他们放在 Youtube 上的视频来看,Physion 还是值得我们下载下来玩玩的。在官网恢复之前,我们只能看看演示视频了。 +可以从它的[官网][10]下载: + +- [Linux][11] + +从他们放在 Youtube 上的视频来看,Physion 还是值得我们下载下来玩玩的。\ 注:youtube 视频 @@ -90,18 +94,19 @@ via: https://www.maketecheasier.com/linux-physics-simulation/ 作者:[Attila Orosz][a] 译者:[bazz2](https://github.com/bazz2) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:https://www.maketecheasier.com/author/attilaorosz/ [1]:https://www.maketecheasier.com/series/learn-with-linux/ -[2]:https://www.maketecheasier.com/learn-to-type-in-linux/ +[2]:https://linux.cn/article-6902-1.html [3]:https://www.maketecheasier.com/linux-physics-simulation/ [4]:https://www.maketecheasier.com/linux-learning-music/ [5]:https://www.maketecheasier.com/linux-geography-apps/ -[6]:https://www.maketecheasier.com/learn-linux-maths/ +[6]:https://linux.cn/article-6546-1.html [7]:https://edu.kde.org/applications/all/step [8]:https://edu.kde.org/ [9]:http://lightspeed.sourceforge.net/ [10]:http://www.physion.net/ +[11]:http://physion.net/en/downloads/linux/13-physion-linux-x8664/download \ No newline at end of file From 3dc99bc5841404843ea819fd823deeaef76799c1 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 17 Jan 2016 23:31:12 +0800 Subject: [PATCH 0234/1469] PUB:20151109 How to Install GitLab on Ubuntu or Fedora or Debian @FSSlc --- ...ll GitLab on Ubuntu or Fedora or Debian.md | 59 ++++++++++--------- 1 file changed, 31 insertions(+), 28 deletions(-) rename {translated/tech => published}/20151109 How to Install GitLab on Ubuntu or Fedora or Debian.md (62%) diff --git a/translated/tech/20151109 How to Install GitLab on Ubuntu or Fedora or Debian.md b/published/20151109 How to Install GitLab on Ubuntu or Fedora or Debian.md similarity index 62% rename from translated/tech/20151109 How to Install GitLab on Ubuntu or Fedora or Debian.md rename to published/20151109 How to Install GitLab on Ubuntu or Fedora or Debian.md index 524fc1e2c1..7dbeb72f95 100644 --- a/translated/tech/20151109 How to Install GitLab on Ubuntu or Fedora or Debian.md +++ b/published/20151109 How to Install GitLab on Ubuntu or Fedora or Debian.md @@ -1,12 +1,13 @@ -如何在 Ubuntu / Fedora / Debian 中安装 GitLab +如何在 Ubuntu/Fedora/Debian 中安装 GitLab ================================================================================ -在 Git 问世之前,分布式版本控制从来都不是一件简单的事。Git 是一个免费、开源的软件,旨在轻松且快速地对从小规模到非常巨大的项目进行管理。Git 最开始由 Linus Torvalds 开发,他同时也是著名的 Linux 内核的创建者。在 git 和分布式版本控制系统领域中,[GitLab][1] 是一个极棒的新产品。它是一个基于 web 的 Git 仓库管理应用,包含代码审查、wiki、问题跟踪等诸多功能。使用 GitLab 可以很方便、快速地创建、审查、部署及托管代码。与 Github 类似,尽管它也提供在其官方的服务器托管免费的代码仓库,但它也可以运行在我们自己的服务器上。GitLab 有两个不同的版本:社区版(Community Edition)和企业版(Enterprise Edition)。社区本完全免费且开源,遵循 MIT 协议;而企业版则遵循一个专有的协议,包含一些社区版中没有的功能。下面介绍的是有关如何在我们自己的运行着 Ubuntu、Fedora 或 Debian 操作系统的机子上安装 GitLab 社区版的简单步骤。 + +在 Git 问世之前,分布式版本控制从来都不是一件简单的事。Git 是一个自由开源的软件,旨在轻松且快速地对从小规模到非常巨大的项目进行管理。Git 最开始由 Linus Torvalds 开发,他同时也是著名的 Linux 内核的创建者。在 git 和分布式版本控制系统领域中,[GitLab][1] 是一个极棒的新产品。它是一个基于 web 的 Git 仓库管理应用,包含代码审查、wiki、问题跟踪等诸多功能。使用 GitLab 可以很方便、快速地创建、审查、部署及托管代码。尽管它在其官方的服务器提供了与 Github 类似的免费托管的代码仓库,但它也可以运行在我们自己的服务器上。GitLab 有两个不同的版本:社区版(Community Edition)和企业版(Enterprise Edition)。社区版本完全免费且开源,遵循 MIT 协议;而企业版则遵循一个专有的协议,包含一些社区版中没有的功能。下面介绍的是有关如何在我们自己的运行着 Ubuntu、Fedora 或 Debian 操作系统的机器上安装 GitLab 社区版的简单步骤。 ### 1. 安装先决条件 ### -首先,我们需要安装 GitLab 所依赖的软件包。我们将安装 `curl`,用以下载我们所需的文件;安装`openssh-server` ,以此来通过 ssh 协议登陆到我们的机子上;安装`ca-certificates`,用它来添加 CA 认证;以及 `postfix`,把它作为一个 MTA(Mail Transfer Agent,邮件传输代理)。 +首先,我们需要安装 GitLab 所依赖的软件包。我们将安装 `curl`,用以下载我们所需的文件;安装`openssh-server` ,以此来通过 ssh 协议登录到我们的机器上;安装`ca-certificates`,用它来添加 CA 认证;以及 `postfix`,把它作为一个 MTA(Mail Transfer Agent,邮件传输代理)。 -注: 若要安装 GitLab 社区版,我们需要一个至少包含 2 GB 内存和 2 核 CPU 的 linux 机子。 +注: 若要安装 GitLab 社区版,我们需要一个至少包含 2 GB 内存和 2 核 CPU 的 linux 机器。 #### 在 Ubuntu 14 .04/Debian 8.x 中 #### @@ -18,7 +19,7 @@ #### 在 Fedora 22 中 #### -在 Fedora 22 中,由于 `yum` 已经被弃用了,所以默认的包管理器是 `dnf`。为了安装上面那些需要的软件包,我们只需运行下面的 dnf 命令: +在 Fedora 22 中,由于 `yum` 已经被弃用了,默认的包管理器是 `dnf`。为了安装上面那些需要的软件包,我们只需运行下面的 dnf 命令: # dnf install curl openssh-server postfix @@ -26,11 +27,11 @@ ### 2. 打开并开启服务 ### -现在,我们将使用我们默认的 init 系统来打开 sshd 和 postfix 服务。并且我们将使得它们在每次系统启动时被自动开启。 +现在,我们将使用我们默认的初始化系统来打开 sshd 和 postfix 服务。并且我们将使得它们在每次系统启动时被自动开启。 #### 在 Ubuntu 14.04 中 #### -由于 SysVinit 在 Ubuntu 14.04 中作为 init 系统被安装,我们将使用 service 命令来开启 sshd 和 postfix 守护进程: +由于在 Ubuntu 14.04 中安装的是 SysVinit 初始化系统,我们将使用 service 命令来开启 sshd 和 postfix 守护进程: # service sshd start # service postfix start @@ -42,24 +43,24 @@ #### 在 Fedora 22/Debian 8.x 中 #### -鉴于 Fedora 22 和 Debi 8.x 已经用 Systemd 代替了 SysVinit 来作为默认的 init 系统,我们只需运行下面的命令来开启 sshd 和 postfix 服务: +鉴于 Fedora 22 和 Debian 8.x 已经用 Systemd 代替了 SysVinit 来作为默认的初始化系统,我们只需运行下面的命令来开启 sshd 和 postfix 服务: # systemctl start sshd postfix -现在,为了使得它们在每次开机启动时被自动地开启,我们需要运行下面的 systemctl 命令: +现在,为了使得它们在每次开机启动时可以自动运行,我们需要运行下面的 systemctl 命令: # systemctl enable sshd postfix - 从 /etc/systemd/system/multi-user.target.wants/sshd.service 建立软链接到 /usr/lib/systemd/system/sshd.service. - 从 /etc/systemd/system/multi-user.target.wants/postfix.service 建立软链接到 /usr/lib/systemd/system/postfix.service. + Created symlink from /etc/systemd/system/multi-user.target.wants/sshd.service to /usr/lib/systemd/system/sshd.service. + Created symlink from /etc/systemd/system/multi-user.target.wants/postfix.service to /usr/lib/systemd/system/postfix.service. ### 3. 下载 GitLab ### -现在,我们将使用 curl 从官方的 GitLab 社区版仓库下载二进制安装文件。首先,为了得到所需文件的下载链接,我们需要浏览到该软件仓库的页面。为此,我们需要在运行着相应操作系统的 linux 机子上运行下面的命令。 +现在,我们将使用 curl 从官方的 GitLab 社区版仓库下载二进制安装文件。首先,为了得到所需文件的下载链接,我们需要浏览到该软件仓库的页面。为此,我们需要在运行着相应操作系统的 linux 机器上运行下面的命令。 #### 在 Ubuntu 14.04 中 #### -由于 Ubuntu 和 Debian 使用相同格式的 debian 文件,我们需要在 [https://packages.gitlab.com/gitlab/gitlab-ce?filter=debs][2] 下搜索所需版本的 GitLab,然后点击有着 ubuntu/trusty 标签的链接,这是因为我们运作着 Ubuntu 14.04。接着一个新的页面将会出现,我们将看到一个下载按钮,然后我们在它的上面右击,得到文件的链接,然后像下面这样使用 curl 来下载它。 +由于 Ubuntu 和 Debian 使用相同的 debian 格式的安装包,我们需要在 [https://packages.gitlab.com/gitlab/gitlab-ce?filter=debs][2] 下搜索所需版本的 GitLab,然后点击有着 ubuntu/trusty 标签的链接,即我们运行着的 Ubuntu 14.04。接着一个新的页面将会出现,我们将看到一个下载按钮,然后我们在它的上面右击,得到文件的链接,然后像下面这样使用 curl 来下载它。 # curl https://packages.gitlab.com/gitlab/gitlab-ce/packages/ubuntu/trusty/gitlab-ce_8.1.2-ce.0_amd64.deb @@ -67,7 +68,7 @@ #### 在 Debian 8.x 中 #### -与 Ubuntu 类似,我们需要在 [https://packages.gitlab.com/gitlab/gitlab-ce?filter=debs][3] 页面中搜索所需版本的 GitLab,然后点击带有 debian/jessie 标签的链接,这是因为我们运行的是 Debian 8.x。接着,一个新的页面将会出现,然后我们在下载按钮上右击,得到文件的下载链接。最后我们像下面这样使用 curl 来下载该文件。 +与 Ubuntu 类似,我们需要在 [https://packages.gitlab.com/gitlab/gitlab-ce?filter=debs][3] 页面中搜索所需版本的 GitLab,然后点击带有 debian/jessie 标签的链接,即我们运行着的 Debian 8.x。接着,一个新的页面将会出现,然后我们在下载按钮上右击,得到文件的下载链接。最后我们像下面这样使用 curl 来下载该文件。 # curl https://packages.gitlab.com/gitlab/gitlab-ce/packages/debian/jessie/gitlab-ce_8.1.2-ce.0_amd64.deb/download @@ -83,11 +84,11 @@ ### 4. 安装 GitLab ### -在相应的软件源被添加到我们的 linux 机子上之后,现在我们将使用相应 linux 发行版本中的默认包管理器来安装 GitLab 社区版。 +在相应的软件源被添加到我们的 linux 机器上之后,现在我们将使用相应 linux 发行版本中的默认包管理器来安装 GitLab 社区版。 #### 在 Ubuntu 14.04/Debian 8.x 中 #### -要在运行着 Ubuntu 14.04 或 Debian 8.x linux 发行版本的机子上安装 GitLab 社区版,我们只需运行如下的命令: +要在运行着 Ubuntu 14.04 或 Debian 8.x linux 发行版本的机器上安装 GitLab 社区版,我们只需运行如下的命令: # dpkg -i gitlab-ce_8.1.2-ce.0_amd64.deb @@ -95,7 +96,7 @@ #### 在 Fedora 22 中 #### -我们只需执行下面的 dnf 命令来在我们的 Fedora 22 机子上安装 GitLab。 +我们只需执行下面的 dnf 命令来在我们的 Fedora 22 机器上安装 GitLab。 # dnf install gitlab-ce-8.1.2-ce.0.el7.x86_64.rpm @@ -103,7 +104,7 @@ ### 5. 配置和开启 GitLab ### -由于 GitLab 社区版已经成功地安装在我们的 linux 系统中了,接下来我们将要配置和开启它了。为此,我们需要运行下面的命令,这在 Ubuntu、Debian 和 Fedora 发行版本上都一样: +GitLab 社区版已经成功地安装在我们的 linux 系统中了,接下来我们将要配置和开启它了。为此,我们需要运行下面的命令,这在 Ubuntu、Debian 和 Fedora 发行版本上都一样: # gitlab-ctl reconfigure @@ -111,19 +112,19 @@ ### 6. 允许通过防火墙 ### -假如在我们的 linux 机子中已经启用了防火墙程序,为了使得 GitLab 社区版的 web 界面可以通过网络进行访问,我们需要允许 80 端口通过防火墙,这个端口是 GitLab 社区版的默认端口。为此,我们需要运行下面的命令。 +假如在我们的 linux 机器中已经启用了防火墙程序,为了使得 GitLab 社区版的 web 界面可以通过网络进行访问,我们需要允许 80 端口通过防火墙,这个端口是 GitLab 社区版的默认端口。为此,我们需要运行下面的命令。 -#### 在 Iptables 中 #### +#### 在 iptables 中 #### -Ubuntu 14.04 默认安装和使用 Iptables。所以,我们将运行下面的 iptables 命令来打开 80 端口: +Ubuntu 14.04 默认安装和使用的是 iptables。所以,我们将运行下面的 iptables 命令来打开 80 端口: # iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT # /etc/init.d/iptables save -#### 在 Firewalld 中 #### +#### 在 firewalld 中 #### -由于 Fedora 22 和 Debian 8.x 默认安装了 systemd,它包含了作为防火墙程序的 firewalld。为了使得 80 端口(http 服务) 能够通过 firewalld,我们需要执行下面的命令。 +由于 Fedora 22 和 Debian 8.x 默认安装了 systemd,它包含了作为防火墙程序的 firewalld。为了使得 80 端口(http 服务) 能够通过 firewalld,我们需要执行下面的命令。 # firewall-cmd --permanent --add-service=http @@ -139,13 +140,13 @@ Ubuntu 14.04 默认安装和使用 Iptables。所以,我们将运行下面的 ![Gitlab Login Screen](http://blog.linoxide.com/wp-content/uploads/2015/10/gitlab-login-screen.png) -现在,为了登陆进面板,我们需要点击登陆按钮,它将询问我们的用户名和密码。然后我们将输入默认的用户名和密码,即 **root** 和 **5iveL!fe** 。在登陆进控制面板后,我们将被强制要求为我们的 GitLab root 用户输入新的密码。 +现在,为了登录进面板,我们需要点击登录按钮,它将询问我们的用户名和密码。然后我们将输入默认的用户名和密码,即 **root** 和 **5iveL!fe** 。在登录进控制面板后,我们将被强制要求为我们的 GitLab root 用户输入新的密码。 ![Setting New Password Gitlab](http://blog.linoxide.com/wp-content/uploads/2015/10/setting-new-password-gitlab.png) ### 8. 创建仓库 ### -在我们成功地更改密码并登陆到我们的控制面板之后,现在,我们将为我们的新项目创建一个新的仓库。为此,我们需要来到项目栏,然后点击 **新项目** 绿色按钮。 +在我们成功地更改密码并登录到我们的控制面板之后,现在,我们将为我们的新项目创建一个新的仓库。为此,我们需要来到项目栏,然后点击 **新项目** 绿色按钮。 ![Creating New Projects](http://blog.linoxide.com/wp-content/uploads/2015/10/creating-new-projects.png) @@ -153,13 +154,15 @@ Ubuntu 14.04 默认安装和使用 Iptables。所以,我们将运行下面的 ![Creating New Project](http://blog.linoxide.com/wp-content/uploads/2015/10/configuring-git-project.png) -做完这些后,我们将能够使用任何包含基本 git 命令行的 Git 客户端来访问我们的 Git 仓库。我们可以看到在仓库中进行的任何活动,例如创建一个里程碑,管理 issue,合并请求,管理成员,便签,Wiki 等。 +做完这些后,我们将能够使用任何包含基本 git 命令行的 Git 客户端来访问我们的 Git 仓库。我们可以看到在仓库中进行的任何活动,例如创建一个里程碑,管理问题,合并请求,管理成员,便签,Wiki 等。 ![Gitlab Menu](http://blog.linoxide.com/wp-content/uploads/2015/10/gitlab-menu.png) ### 总结 ### -GitLab 是一个用来管理 git 仓库的很棒的开源 web 应用。它有着漂亮,响应式的带有诸多酷炫功能的界面。它还打包有许多酷炫功能,例如管理群组,分发密钥,连续集成,查看日志,广播消息,钩子,系统 OAuth 应用,模板等。(注:OAuth 是一个开放标准,允许用户让第三方应用访问该用户在某一网站上存储的私密的资源(如照片,视频,联系人列表),而无需将用户名和密码提供给第三方应用。--- 摘取自 [维基百科上的 OAuth 词条](https://zh.wikipedia.org/wiki/OAuth)) 它还可以和大量的工具进行交互如 Slack,Hipchat,LDAP,JIRA,Jenkins,很多类型的钩子和一个完整的 API。它至少需要 2 GB 的内存和 2 核 CPU 来流畅运行,支持多达 500 个用户,但它也可以被扩展到多个活动的服务器上。假如你有任何的问题,建议,回馈,请将它们写在下面的评论框中,以便我们可以提升或更新我们的内容。谢谢! +GitLab 是一个用来管理 git 仓库的很棒的开源 web 应用。它有着漂亮的带有诸多酷炫功能的响应式界面。它还打包有许多酷炫功能,例如管理群组,分发密钥,持续集成,查看日志,广播消息,钩子,系统 OAuth 应用,模板等。(注:OAuth 是一个开放标准,允许用户让第三方应用访问该用户在某一网站上存储的私密的资源(如照片,视频,联系人列表),而无需将用户名和密码提供给第三方应用。--- 摘取自 [维基百科上的 OAuth 词条](https://zh.wikipedia.org/wiki/OAuth)) 它还可以和大量的工具进行交互如 Slack,Hipchat,LDAP,JIRA,Jenkins,有很多类型的钩子和完整的 API。它至少需要 2 GB 的内存和 2 核 CPU 来流畅运行,支持多达 500 个用户,但它也可以被扩展到多个工作服务器上。 + +假如你有任何的问题,建议,回馈,请将它们写在下面的评论框中,以便我们可以提升或更新我们的内容。谢谢! -------------------------------------------------------------------------------- @@ -167,7 +170,7 @@ via: http://linoxide.com/linux-how-to/install-gitlab-on-ubuntu-fedora-debian/ 作者:[Arun Pyasi][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 ce8bcc3906959aac7c790c734a0fbe688bef2371 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Mon, 18 Jan 2016 15:37:15 +0800 Subject: [PATCH 0235/1469] Delete 20151105 Linux FAQs with Answers--How to install Ubuntu desktop behind a proxy.md --- ...o install Ubuntu desktop behind a proxy.md | 62 ------------------- 1 file changed, 62 deletions(-) delete mode 100644 sources/tech/20151105 Linux FAQs with Answers--How to install Ubuntu desktop behind a proxy.md diff --git a/sources/tech/20151105 Linux FAQs with Answers--How to install Ubuntu desktop behind a proxy.md b/sources/tech/20151105 Linux FAQs with Answers--How to install Ubuntu desktop behind a proxy.md deleted file mode 100644 index 7ceced012d..0000000000 --- a/sources/tech/20151105 Linux FAQs with Answers--How to install Ubuntu desktop behind a proxy.md +++ /dev/null @@ -1,62 +0,0 @@ -translation by strugglingyouth -Linux FAQs with Answers--How to install Ubuntu desktop behind a proxy -================================================================================ -> **Question**: My computer is connected to a corporate network sitting behind an HTTP proxy. When I try to install Ubuntu desktop on the computer from a CD-ROM drive, the installation hangs and never finishes while trying to retrieve files, which is presumably due to the proxy. However, the problem is that Ubuntu installer never asks me to configure proxy during installation procedure. Then how can I install Ubuntu desktop behind a proxy? - -Unlike Ubuntu server, installation of Ubuntu desktop is pretty much auto-pilot, not leaving much room for customization, such as custom disk partitioning, manual network settings, package selection, etc. While such simple, one-shot installation is considered user-friendly, it leaves much to be desired for those users looking for "advanced installation mode" to customize their Ubuntu desktop installation. - -In addition, one big problem of the default Ubuntu desktop installer is the absense of proxy settings. If your computer is connected behind a proxy, you will notice that Ubuntu installation gets stuck while preparing to download files. - -![](https://c2.staticflickr.com/6/5683/22195372232_cea81a5e45_c.jpg) - -This post describes how to get around the limitation of Ubuntu **installer and install Ubuntu desktop when you are behind a proxy**. - -The basic idea is as follows. Instead of starting with Ubuntu installer directly, boot into live Ubuntu desktop first, configure proxy settings, and finally launch Ubuntu installer manually from live desktop. The following is the step by step procedure. - -After booting from Ubuntu desktop CD/DVD or USB, click on "Try Ubuntu" on the first welcome screen. - -![](https://c1.staticflickr.com/1/586/22195371892_3816ba09c3_c.jpg) - -Once you boot into live Ubuntu desktop, click on Settings icon in the left. - -![](https://c1.staticflickr.com/1/723/22020327738_058610c19d_c.jpg) - -Go to Network menu. - -![](https://c2.staticflickr.com/6/5675/22021212239_ba3901c8bf_c.jpg) - -Configure proxy settings manually. - -![](https://c1.staticflickr.com/1/735/22020025040_59415e0b9a_c.jpg) - -Next, open a terminal. - -![](https://c2.staticflickr.com/6/5642/21587084823_357b5c48cb_c.jpg) - -Enter a root session by typing the following: - - $ sudo su - -Finally, type the following command as the root. - - # ubiquity gtk_ui - -This will launch GUI-based Ubuntu installer as follows. - -![](https://c1.staticflickr.com/1/723/22020025090_cc64848b6c_c.jpg) - -Proceed with the rest of installation. - -![](https://c1.staticflickr.com/1/628/21585344214_447020e9d6_c.jpg) - --------------------------------------------------------------------------------- - -via: http://ask.xmodulo.com/install-ubuntu-desktop-behind-proxy.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 487f7eb455812a7b1b6a14ee60b5ca2a16231df2 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Mon, 18 Jan 2016 15:38:07 +0800 Subject: [PATCH 0236/1469] Create 20151105 Linux FAQs with Answers--How to install Ubuntu desktop behind a proxy.md --- ...o install Ubuntu desktop behind a proxy.md | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 translated/tech/20151105 Linux FAQs with Answers--How to install Ubuntu desktop behind a proxy.md diff --git a/translated/tech/20151105 Linux FAQs with Answers--How to install Ubuntu desktop behind a proxy.md b/translated/tech/20151105 Linux FAQs with Answers--How to install Ubuntu desktop behind a proxy.md new file mode 100644 index 0000000000..b7c86609bd --- /dev/null +++ b/translated/tech/20151105 Linux FAQs with Answers--How to install Ubuntu desktop behind a proxy.md @@ -0,0 +1,63 @@ + +Linux 有问必答 - 如何通过代理服务器安装 Ubuntu 桌面 +================================================================================ +> **问题**: 我的电脑通过 HTTP 代理连接到公司网络。当我尝试从 CD-ROM 在计算机上安装 Ubuntu 桌面时,在检索文件时安装程序会被挂起,检索则不会完成,这可能是由于代理造成的。然而问题是,Ubuntu 的安装程序从不要求我在安装过程中配置代理。那我该怎么使用代理来安装 Ubuntu 桌面? + +与 Ubuntu 服务器不太一样,安装 Ubuntu 桌面几乎都是自动安装,没有留下太多自定义的空间,如自定义磁盘分区,手动网络设置,包选择等等。尽管非常简单,一键安装被认为是用户友好的,它不需要用户寻找“高级安装模式”来定制自己的 Ubuntu 桌面。 + +此外,Ubuntu 默认桌面的安装程序中一个大问题是代理设置。如果你的计算机连接在一个代理上,你会发现 Ubuntu 安装时会卡在准备下载文件处。 + +![](https://c2.staticflickr.com/6/5683/22195372232_cea81a5e45_c.jpg) + +这篇文章描述了如何解决当使用代理时 Ubuntu **安装程序的限制和安装 Ubuntu 桌面**。 + +其基本思路如下。不是直接使用 Ubuntu 的安装程序开始安装,首先进入 live Ubuntu 桌面,配置代理服务器,最后从 live 桌面手动启动 Ubuntu 的安装程序。以下是程序的安装步骤。 + +从 CD/DVD 或 USB 启动 Ubuntu 桌面后,点击第一个欢迎屏幕上的"Try Ubuntu"。 + +![](https://c1.staticflickr.com/1/586/22195371892_3816ba09c3_c.jpg) + +一旦进入 live Ubuntu 桌面,点击左侧设置图标。 + +![](https://c1.staticflickr.com/1/723/22020327738_058610c19d_c.jpg) + +进入 Network 菜单。 + +![](https://c2.staticflickr.com/6/5675/22021212239_ba3901c8bf_c.jpg) + +手动配置代理服务器。 + +![](https://c1.staticflickr.com/1/735/22020025040_59415e0b9a_c.jpg) + +接下来,打开一个终端。 + +![](https://c2.staticflickr.com/6/5642/21587084823_357b5c48cb_c.jpg) + +通过输入以下命令切换到 root 用户: + + $ sudo su + +最后,在 root 用户下输入以下命令。 + + # ubiquity gtk_ui + +然后将启动基于 GUI 的 Ubuntu 安装程序。 + + +![](https://c1.staticflickr.com/1/723/22020025090_cc64848b6c_c.jpg) + +继续安装其余部分。 + +![](https://c1.staticflickr.com/1/628/21585344214_447020e9d6_c.jpg) + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/install-ubuntu-desktop-behind-proxy.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 943a6dc243a32426c19843afc511c9e1004d8c3c Mon Sep 17 00:00:00 2001 From: zpl Date: Mon, 18 Jan 2016 16:44:26 +0800 Subject: [PATCH 0237/1469] [translating] 20151206 Supporting secure DNS in glibc.md --- sources/tech/20151206 Supporting secure DNS in glibc.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20151206 Supporting secure DNS in glibc.md b/sources/tech/20151206 Supporting secure DNS in glibc.md index 8933c3c891..0547719a72 100644 --- a/sources/tech/20151206 Supporting secure DNS in glibc.md +++ b/sources/tech/20151206 Supporting secure DNS in glibc.md @@ -1,3 +1,4 @@ +zpl1025 Supporting secure DNS in glibc ======================== From cbdeba1bc57742cdf5a1af768092c3fcd1d4f9d0 Mon Sep 17 00:00:00 2001 From: SonoFelice Date: Mon, 18 Jan 2016 20:04:34 +0800 Subject: [PATCH 0238/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E4=B8=ADMicrosoft?= =?UTF-8?q?=20and=20Linux--True=20Romance=20or=20Toxic=20Love?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译中Microsoft and Linux--True Romance or Toxic Love --- .../20151126 Microsoft and Linux--True Romance or Toxic Love.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/talk/20151126 Microsoft and Linux--True Romance or Toxic Love.md b/sources/talk/20151126 Microsoft and Linux--True Romance or Toxic Love.md index 92705b4b5c..8659cd787c 100644 --- a/sources/talk/20151126 Microsoft and Linux--True Romance or Toxic Love.md +++ b/sources/talk/20151126 Microsoft and Linux--True Romance or Toxic Love.md @@ -1,3 +1,4 @@ +sonofelice translating Microsoft and Linux: True Romance or Toxic Love? ================================================================================ Every now and then, you come across a news story that makes you choke on your coffee or splutter hot latte all over your monitor. Microsoft's recent proclamations of love for Linux is an outstanding example of such a story. From dc163f6114e443fb399fc9759f08406194abc9c9 Mon Sep 17 00:00:00 2001 From: martin qi Date: Mon, 18 Jan 2016 21:52:30 +0800 Subject: [PATCH 0239/1469] =?UTF-8?q?Revert=20"=E7=BF=BB=E8=AF=91=E5=AE=8C?= =?UTF-8?q?=E6=88=90"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0f6a6eefb17577574b3e2978761d0218b2da1713. --- ...dation--Best Quotes of Richard Stallman.md | 170 +++++++++++++++++ ...dation--Best Quotes of Richard Stallman.md | 171 ------------------ 2 files changed, 170 insertions(+), 171 deletions(-) create mode 100644 sources/talk/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md delete mode 100644 translated/talk/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md diff --git a/sources/talk/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md b/sources/talk/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md new file mode 100644 index 0000000000..af8bb311db --- /dev/null +++ b/sources/talk/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md @@ -0,0 +1,170 @@ +30 Years of Free Software Foundation: Best Quotes of Richard Stallman +================================================================================ +注:youtube 视频 + + +**Richard Matthew Stallman** (rms) – one of biggest figure in Information Technology. He is a computer programmer and architect (GNU Compiler Collection (GCC)), GNU Debugger, Emacs), software freedom evangelist, [GNU Project][1] and [FSF][2] founder. + +**GNU** is a recursive acronym “GNU’s Not Unix!”. GNU – collection of free computer software for Unix-based operation system. Can be used with GNU/Hurd and Linux kernels. Announced on September 27, 1983. General components: + +- GNU Compiler Collection (GCC) +- GNU C library (glibc) +- GNU Core Utilities (coreutils) +- GNU Debugger (GDB) +- GNU Binary Utilities (binutils) +- GNU Bash shell +- NOME desktop environment + +注:视频 + + +**Free Software Foundation** (FSF) – non-profit organization for free software and computer user freedom promotion and defend their rights. Read more information here. Founded on 4 October 1985. + +- The freedom to run the program as you wish, for any purpose (freedom 0). +- The freedom to study how the program works, and change it so it does your computing as you wish (freedom 1). Access to the source code is a precondition for this. +- The freedom to redistribute copies so you can help your neighbor (freedom 2). +- The freedom to distribute copies of your modified versions to others (freedom 3). By doing this you can give the whole community a chance to benefit from your changes. Access to the source code is a precondition for this. + +This is the Four Freedoms of free software. + +Here is quotes of Richard Stallman about freedom, software, social, philosophy and others things. + +**About Facebook:** + +> Facebook is not your friend, it is a surveillance engine. + +**About Android:** + +> Android is very different from the GNU/Linux operating system because it contains very little of GNU. Indeed, just about the only component in common between Android and GNU/Linux is Linux, the kernel. + +**About computer industry:** + +> The computer industry is the only industry that is more fashion-driven than women's fashion. + +**About cloud computing:** + +> The interesting thing about cloud computing is that we've redefined cloud computing to include everything that we already do. + +**About ethics:** + +> Whether gods exist or not, there is no way to get absolute certainty about ethics. Without absolute certainty, what do we do? We do the best we can. + +**About freedom:** + +> Free software is software that respects your freedom and the social solidarity of your community. So it's free as in freedom. + +**About goal and idealism:** + +> If you want to accomplish something in the world, idealism is not enough - you need to choose a method that works to achieve the goal. + +**About sharing:** + +> Sharing is good, and with digital technology, sharing is easy. + +**About facebook (extended version):** + +> Facebook mistreats its users. Facebook is not your friend; it is a surveillance engine. For instance, if you browse the Web and you see a 'like' button in some page or some other site that has been displayed from Facebook. Therefore, Facebook knows that your machine visited that page. + +**About web application:** + +> One reason you should not use web applications to do your computing is that you lose control. +> +> If you use a proprietary program or somebody else's web server, you're defenceless. You're putty in the hands of whoever developed that software. + +**About books:** + +> With paper printed books, you have certain freedoms. You can acquire the book anonymously by paying cash, which is the way I always buy books. I never use a credit card. I don't identify to any database when I buy books. Amazon takes away that freedom. + +**About MPAA:** + +> Officially, MPAA stands for Motion Picture Association of America, but I suggest that MPAA stands for Malicious Power Attacking All. + +**About money and career:** + +> I could have made money this way, and perhaps amused myself writing code. But I knew that at the end of my career, I would look back on years of building walls to divide people, and feel I had spent my life making the world a worse place. + +**About proprietary software:** + +> Proprietary software keeps users divided and helpless. Divided because each user is forbidden to redistribute it to others, and helpless because the users can't change it since they don't have the source code. They can't study what it really does. So the proprietary program is a system of unjust power. + +**About smartphone:** + +> A smartphone is a computer - it's not built using a computer - the job it does is the job of being a computer. So, everything we say about computers, that the software you run should be free - you should insist on that - applies to smart phones just the same. And likewise to those tablets. + +**About CD and digital content:** + +> CD stores have the disadvantage of an expensive inventory, but digital bookshops would need no such thing: they could write copies at the time of sale on to memory sticks, and sell you one if you forgot your own. + +**About paradigm of competition:** + +> The paradigm of competition is a race: by rewarding the winner, we encourage everyone to run faster. When capitalism really works this way, it does a good job; but its defenders are wrong in assuming it always works this way. + +**About vi and emacs:** + +> People sometimes ask me if it is a sin in the Church of Emacs to use vi. Using a free version of vi is not a sin; it is a penance. So happy hacking. + +**About freedom and history:** + +> Value your freedom or you will lose it, teaches history. 'Don't bother us with politics', respond those who don't want to learn. + +**About patents:** + +> Fighting patents one by one will never eliminate the danger of software patents, any more than swatting mosquitoes will eliminate malaria. +> +> Software patents are dangerous to software developers because they impose monopolies on software ideas. + +**About copyrights:** + +> In practice, the copyright system does a bad job of supporting authors, aside from the most popular ones. Other authors' principal interest is to be better known, so sharing their work benefits them as well as readers. + +**About pay for work:** + +> There is nothing wrong with wanting pay for work, or seeking to maximize one's income, as long as one does not use means that are destructive. + +**About Chrome OS:** + +> In essence, Chrome OS is the GNU/Linux operating system. However, it is delivered without the usual applications, and rigged up to impede and discourage installing applications. + +**About Linux users:** + +> Many users of the GNU/Linux system will not have heard the ideas of free software. They will not be aware that we have ideas, that a system exists because of ethical ideals, which were omitted from ideas associated with the term 'open source.' + +**About privacy in facebook:** + +> If there is a Like button in a page, Facebook knows who visited that page. And it can get IP address of the computer visiting the page even if the person is not a Facebook user. + +**About programming:** + +> Programming is not a science. Programming is a craft. +> +> My favorite programming languages are Lisp and C. However, since around 1992 I have worked mainly on free software activism, which means I am too busy to do much programming. Around 2008 I stopped doing programming projects. +> +> C++ is a badly designed and ugly language. It would be a shame to use it in Emacs. + +**About hacking and learn programming:** + +> People could no longer learn hacking the way I did, by starting to work on a real operating system, making real improvements. In fact, in the 1980s I often came across newly graduated computer science majors who had never seen a real program in their lives. They had only seen toy exercises, school exercises, because every real program was a trade secret. They never had the experience of writing features for users to really use, and fixing the bugs that real users came across. The things you need to know to do real work. +> +> It is hard to write a simple definition of something as varied as hacking, but I think what these activities have in common is playfulness, cleverness, and exploration. Thus, hacking means exploring the limits of what is possible, in a spirit of playful cleverness. Activities that display playful cleverness have "hack value". + +**About web browsing:** + +> For personal reasons, I do not browse the web from my computer. (I also have no net connection much of the time.) To look at page I send mail to a daemon which runs wget and mails the page back to me. It is very efficient use of my time, but it is slow in real time. + +**About music sharing:** + +> Friends share music with each other, they don't allow themselves to be divided by a system that says that nobody is supposed to have copies. + +-------------------------------------------------------------------------------- + +via: https://tlhp.cf/fsf-richard-stallman/ + +作者:[Pavlo Rudyi][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://tlhp.cf/author/paul/ +[1]:http://www.gnu.org/ +[2]:http://www.fsf.org/ \ No newline at end of file diff --git a/translated/talk/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md b/translated/talk/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md deleted file mode 100644 index a8d1616106..0000000000 --- a/translated/talk/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md +++ /dev/null @@ -1,171 +0,0 @@ -30 年自由软件基金会:理查德·斯托曼语录集锦 -================================================================================ -注:youtube 视频 - - -**理查德·马修·斯托曼** (rms) – IT大牛之一。他是一名程序员,GCC、GDB、Emacs 的构建者,软件自由传教士,[GNU Project][1] 和 [FSF][2] 的创办人。 - -**GNU** 是 “GNU’s Not Unix!”的缩写。GNU 是基于 Unix 操作系统的自由计算机软件集合。支持 GNU/Hurd 和 Linux 内核。于1983年9月27日公诸于众。常有组件: - -- GNU Compiler Collection (GCC) -- GNU C library (glibc) -- GNU Core Utilities (coreutils) -- GNU Debugger (GDB) -- GNU Binary Utilities (binutils) -- GNU Bash shell -- NOME desktop environment - -注:视频 - - -**自由软件基金会** (FSF) – 一个自由软件的非营利组织,致力于计算机用户自由的提升和权力的捍卫。于 1985 年 10 月 4 日成立。阅读[更多][3]。 - -- 于目的无关,随心运行程序的自由(自由0)。 -- 学习程序如何运作,并改变它为你所用的自由(自由1)。可以访问源码是这条的前提。 -- 重新发布副本的自由,如此你便可以帮助你的邻居了 (自由 2)。 -- 发布自己修改版本给他人的自由(自由 3)。这样能让整个社区有机会从你的改变中受益。可以访问源码是这条的前提。 - -以上为自由软件的四项自由原则。 - -以下为理查德·斯托曼关于自由、软件、社交、哲学等的名言摘引。 - -**关于 Facebook:** - -> Facebook 不是你的朋友,是监控引擎。 - -**关于 Android:** - -> Android 和 GNU/Linux 有很大的区别,因为其中几乎没有 GNU。的确,Android 和 GNU/Linux 之间仅有一个共同组件,那就是内核 - Linux。 - -**关于计算机行业:** - -> 计算机行业是唯一一个比时尚女装更被时尚驱动的行业。 - -**关于云计算:** - -> 关于云计算,有趣的是我们已经重新定义了云计算来包含我们曾干的所有事。 - -**关于伦理:** - -> 无论神存在与否,都没有绝对的伦理道德。没有这份理所当然,我们该如何?也唯有尽善吧。 - -**关于自由:** - -> 自由软件是尊重个人自由和社会团结的软件。所以才能如自由般自由自在。 - -**关于目标和理想:** - -> 如果你想为这世界做些什么,仅有理想是不够的,你需要找条通往目标的道路并走完。 - -**关于分享:** - -> 分享很棒,而且数字化技术也使分享变得容易。 - -**关于 facebook(进阶版):** - -> Facebook 蹂躏它们的用户。它不是你们的朋友;它就是个监控引擎。举个例子,你是否曾在一些网页或网站上看到 Facebook 的 “like” 按键。对,Facebook 知道你的电脑曾访问过那些网页。 - -**关于 web 应用:** - -> 给你个为什么不应该使用 web 应用的理由,因为你失去了计算机的控制权。 -> -> 如果你使用私有程序或他人的 web 服务器,那么你只能任人鱼肉。被软件的软件的开发者轻易操纵。 - -**关于书:** - -> 印刷出来的书,当然是自由的。即使你买了别人也不知道,这也是我一直买书的方式。买时不会被任何数据库认出。是亚马逊把自由夺走了。 - -**关于 MPAA:** - -> MPAA 其实是美国电影协会(Motion Picture Association of America),但我认为叫做攻击万物的邪恶力量(Malicious Power Attacking All)更为合适。 - -**关于金钱与职业:** - -> 我可以这样赚钱,并沉浸在编码的快乐中。但在职业生涯结束后,回首目睹自己筑就的高墙将人与人分隔开,我会觉得我耗尽毕生精力只换来了一个更糟糕的世界。 - -**关于私有软件:** - -> 私有软件使用户孤立、无助。因为禁止将软件给他人使用所以孤立,因为无法改变源码所以无助。他们学不了其中正真的工作方式。所以整个私有软件体系就是一种不公的力量。 - -**关于智能手机:** - -> 智能手机就是电脑 - 虽然做的和常用的电脑不同 - 但是却能干电脑能干的活。所以我们所说的一切有关于电脑上的软件应该能自由运行 - 必须坚持 - 在智能手机上也是这样。当然也包括平板。 - -**关于 CD 和数字内容:** - -> CD 商店有一个弱势就是需要昂贵的库存,但是电子商店就没有这方面的需求:他们只需要将售卖的副本写入记忆棒,并在你忘带自己的记忆棒时卖你一个就是了。 - -**关于竞争范式:About paradigm of competition:** - -> 竞争范式就像是赛跑:鼓励每一个跑得更快的人。当资本主义真的这样运作时,当然是件好事;但是维护者若是假设它一直这样运作的话那就大错特错了。 - -**关于 vi 和 emacs:** - -> 有时会有人问我在 Emacs 的阵营使用 vi 是不是一种罪过。使用自由版的 vi 并不是一种罪过;是一种忏悔。所以好好享受其中乐趣吧。 - -**关于自由和历史:** - -> 历史教会我们:珍惜自由,否则你将失去他。“别和我们谈政治”,对听不进的人这就是答复。 - -**关于专利:** - -> 和专利一个一个的战斗并不能解决软件专利带来的危害,就像打再多的蚊子也消灭不了疟疾一样。 -> -> 软件专利对于软件的开发者来说十分危险,因为它们加剧了对于软件理念的垄断。 - -**关于版权:** - -> 其实,版权制度对作者也没有什么好处,撇开最受欢迎的那个,其他作者的主旨可能更好理解,所以分享无论对他们还是你的读者都是一件好事。 - -**关于工作与报酬:** - -> 劳有所得,或寻求收入的最大化并没有什么错,只要不是不择手段。 - -**关于 Chrome OS:** - -> Chrome OS 确实是 GNU/Linux 的操作系统。但是,它在发布时没有安装常用应用,并为安装他们设置了阻碍。 - -**关于 Linux 用户:** - -> 许多的 GNU/Linux 用户并没有听过自由软件。他们并没有意识到,这个系统是因为道德理想才存在的,与此一起被忽视的还有所谓的“开源”。 - -**关于 facebook 的隐私:** - -> 如果页面上有 “like” 按键,Facebook 就能知道谁访问了页面。即使不是 Facebook 的用户,也可以得到访问该页面电脑的 IP 地址。 - -**关于编程:** - -> 编程不是科学,编程是手艺。 -> -> Lisp 和 C 语言是我的最爱。然自 1992 年以来高频的自由软件活动,确实反映了我编的太过匆忙。大概在 2008 年我便停止了编程开发。 -> -> C++ 设计的真糟糕、真丑陋。在 Emacs 上用他应该觉得羞愧。 - -**关于钻研(hacking)和学习编程:** - -> 今时不同往日,大家再也不用走我的老路了,完全可以在实际的操作系统上提升自己。上世纪 80 年代,我常遇见计算机专业的毕业生,自出生以来没见过真正的程序。他们接触的到的只有小玩意和学校的作业,因为每一个程序都是商业机密。他们没有机会去写真正实用的特性,修复用户真正遭遇的问题。做这些事便是你应知晓的最好的提升方式。 -> -> 对于如 hacking 这般多样化的东西真的很难简单的下定义,不过在我看来诸如此类的行为都会有以下的这些共同点:嬉乐、智慧和探索。因此,hacking 意味着对可能的极限的探索,一颗向往快乐与智慧心。能带来快乐与智慧的行为就有 “hack 的价值” 。 - -**关于浏览网页:** - -> 由于个人原因,我不会在我的电脑上浏览网页。(大部分时间处于没有网络连接的状态。)要浏览网页,我需要给守护进程发 mail,然后它会运行 wget 并把页面通过 mail 发还给我。这对我而言已经是最效率了,但那真的比实时慢太多了。 - -**关于音乐共享:** - -> 朋友之间彼此分享音乐,绝不会希望因为系统的一句:禁止私下拷贝!而生分。 - --------------------------------------------------------------------------------- - -via: https://tlhp.cf/fsf-richard-stallman/ - -作者:[Pavlo Rudyi][a] -译者:[martin2011qi](https://github.com/martin2011qi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://tlhp.cf/fsf-richard-stallman/ -[1]:http://www.gnu.org/ -[2]:http://www.fsf.org/ -[3]:https://www.fsf.org/about/ \ No newline at end of file From 75cee609a6500ab06d13f1bcd27a6e3058448b7b Mon Sep 17 00:00:00 2001 From: martin qi Date: Mon, 18 Jan 2016 21:54:20 +0800 Subject: [PATCH 0240/1469] =?UTF-8?q?=E9=87=8D=E6=96=B0=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...dation--Best Quotes of Richard Stallman.md | 172 ------------------ ...dation--Best Quotes of Richard Stallman.md | 171 +++++++++++++++++ 2 files changed, 171 insertions(+), 172 deletions(-) delete mode 100644 sources/talk/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md create mode 100644 translated/talk/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md diff --git a/sources/talk/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md b/sources/talk/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md deleted file mode 100644 index e7dbefff62..0000000000 --- a/sources/talk/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md +++ /dev/null @@ -1,172 +0,0 @@ -For my dear RMS - -30 Years of Free Software Foundation: Best Quotes of Richard Stallman -================================================================================ -注:youtube 视频 - - -**Richard Matthew Stallman** (rms) – one of biggest figure in Information Technology. He is a computer programmer and architect (GNU Compiler Collection (GCC)), GNU Debugger, Emacs), software freedom evangelist, [GNU Project][1] and [FSF][2] founder. - -**GNU** is a recursive acronym “GNU’s Not Unix!”. GNU – collection of free computer software for Unix-based operation system. Can be used with GNU/Hurd and Linux kernels. Announced on September 27, 1983. General components: - -- GNU Compiler Collection (GCC) -- GNU C library (glibc) -- GNU Core Utilities (coreutils) -- GNU Debugger (GDB) -- GNU Binary Utilities (binutils) -- GNU Bash shell -- NOME desktop environment - -注:视频 - - -**Free Software Foundation** (FSF) – non-profit organization for free software and computer user freedom promotion and defend their rights. Read more information here. Founded on 4 October 1985. - -- The freedom to run the program as you wish, for any purpose (freedom 0). -- The freedom to study how the program works, and change it so it does your computing as you wish (freedom 1). Access to the source code is a precondition for this. -- The freedom to redistribute copies so you can help your neighbor (freedom 2). -- The freedom to distribute copies of your modified versions to others (freedom 3). By doing this you can give the whole community a chance to benefit from your changes. Access to the source code is a precondition for this. - -This is the Four Freedoms of free software. - -Here is quotes of Richard Stallman about freedom, software, social, philosophy and others things. - -**About Facebook:** - -> Facebook is not your friend, it is a surveillance engine. - -**About Android:** - -> Android is very different from the GNU/Linux operating system because it contains very little of GNU. Indeed, just about the only component in common between Android and GNU/Linux is Linux, the kernel. - -**About computer industry:** - -> The computer industry is the only industry that is more fashion-driven than women's fashion. - -**About cloud computing:** - -> The interesting thing about cloud computing is that we've redefined cloud computing to include everything that we already do. - -**About ethics:** - -> Whether gods exist or not, there is no way to get absolute certainty about ethics. Without absolute certainty, what do we do? We do the best we can. - -**About freedom:** - -> Free software is software that respects your freedom and the social solidarity of your community. So it's free as in freedom. - -**About goal and idealism:** - -> If you want to accomplish something in the world, idealism is not enough - you need to choose a method that works to achieve the goal. - -**About sharing:** - -> Sharing is good, and with digital technology, sharing is easy. - -**About facebook (extended version):** - -> Facebook mistreats its users. Facebook is not your friend; it is a surveillance engine. For instance, if you browse the Web and you see a 'like' button in some page or some other site that has been displayed from Facebook. Therefore, Facebook knows that your machine visited that page. - -**About web application:** - -> One reason you should not use web applications to do your computing is that you lose control. -> -> If you use a proprietary program or somebody else's web server, you're defenceless. You're putty in the hands of whoever developed that software. - -**About books:** - -> With paper printed books, you have certain freedoms. You can acquire the book anonymously by paying cash, which is the way I always buy books. I never use a credit card. I don't identify to any database when I buy books. Amazon takes away that freedom. - -**About MPAA:** - -> Officially, MPAA stands for Motion Picture Association of America, but I suggest that MPAA stands for Malicious Power Attacking All. - -**About money and career:** - -> I could have made money this way, and perhaps amused myself writing code. But I knew that at the end of my career, I would look back on years of building walls to divide people, and feel I had spent my life making the world a worse place. - -**About proprietary software:** - -> Proprietary software keeps users divided and helpless. Divided because each user is forbidden to redistribute it to others, and helpless because the users can't change it since they don't have the source code. They can't study what it really does. So the proprietary program is a system of unjust power. - -**About smartphone:** - -> A smartphone is a computer - it's not built using a computer - the job it does is the job of being a computer. So, everything we say about computers, that the software you run should be free - you should insist on that - applies to smart phones just the same. And likewise to those tablets. - -**About CD and digital content:** - -> CD stores have the disadvantage of an expensive inventory, but digital bookshops would need no such thing: they could write copies at the time of sale on to memory sticks, and sell you one if you forgot your own. - -**About paradigm of competition:** - -> The paradigm of competition is a race: by rewarding the winner, we encourage everyone to run faster. When capitalism really works this way, it does a good job; but its defenders are wrong in assuming it always works this way. - -**About vi and emacs:** - -> People sometimes ask me if it is a sin in the Church of Emacs to use vi. Using a free version of vi is not a sin; it is a penance. So happy hacking. - -**About freedom and history:** - -> Value your freedom or you will lose it, teaches history. 'Don't bother us with politics', respond those who don't want to learn. - -**About patents:** - -> Fighting patents one by one will never eliminate the danger of software patents, any more than swatting mosquitoes will eliminate malaria. -> -> Software patents are dangerous to software developers because they impose monopolies on software ideas. - -**About copyrights:** - -> In practice, the copyright system does a bad job of supporting authors, aside from the most popular ones. Other authors' principal interest is to be better known, so sharing their work benefits them as well as readers. - -**About pay for work:** - -> There is nothing wrong with wanting pay for work, or seeking to maximize one's income, as long as one does not use means that are destructive. - -**About Chrome OS:** - -> In essence, Chrome OS is the GNU/Linux operating system. However, it is delivered without the usual applications, and rigged up to impede and discourage installing applications. - -**About Linux users:** - -> Many users of the GNU/Linux system will not have heard the ideas of free software. They will not be aware that we have ideas, that a system exists because of ethical ideals, which were omitted from ideas associated with the term 'open source.' - -**About privacy in facebook:** - -> If there is a Like button in a page, Facebook knows who visited that page. And it can get IP address of the computer visiting the page even if the person is not a Facebook user. - -**About programming:** - -> Programming is not a science. Programming is a craft. -> -> My favorite programming languages are Lisp and C. However, since around 1992 I have worked mainly on free software activism, which means I am too busy to do much programming. Around 2008 I stopped doing programming projects. -> -> C++ is a badly designed and ugly language. It would be a shame to use it in Emacs. - -**About hacking and learn programming:** - -> People could no longer learn hacking the way I did, by starting to work on a real operating system, making real improvements. In fact, in the 1980s I often came across newly graduated computer science majors who had never seen a real program in their lives. They had only seen toy exercises, school exercises, because every real program was a trade secret. They never had the experience of writing features for users to really use, and fixing the bugs that real users came across. The things you need to know to do real work. -> -> It is hard to write a simple definition of something as varied as hacking, but I think what these activities have in common is playfulness, cleverness, and exploration. Thus, hacking means exploring the limits of what is possible, in a spirit of playful cleverness. Activities that display playful cleverness have "hack value". - -**About web browsing:** - -> For personal reasons, I do not browse the web from my computer. (I also have no net connection much of the time.) To look at page I send mail to a daemon which runs wget and mails the page back to me. It is very efficient use of my time, but it is slow in real time. - -**About music sharing:** - -> Friends share music with each other, they don't allow themselves to be divided by a system that says that nobody is supposed to have copies. - --------------------------------------------------------------------------------- - -via: https://tlhp.cf/fsf-richard-stallman/ - -作者:[Pavlo Rudyi][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://tlhp.cf/author/paul/ -[1]:http://www.gnu.org/ -[2]:http://www.fsf.org/ diff --git a/translated/talk/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md b/translated/talk/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md new file mode 100644 index 0000000000..a8d1616106 --- /dev/null +++ b/translated/talk/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md @@ -0,0 +1,171 @@ +30 年自由软件基金会:理查德·斯托曼语录集锦 +================================================================================ +注:youtube 视频 + + +**理查德·马修·斯托曼** (rms) – IT大牛之一。他是一名程序员,GCC、GDB、Emacs 的构建者,软件自由传教士,[GNU Project][1] 和 [FSF][2] 的创办人。 + +**GNU** 是 “GNU’s Not Unix!”的缩写。GNU 是基于 Unix 操作系统的自由计算机软件集合。支持 GNU/Hurd 和 Linux 内核。于1983年9月27日公诸于众。常有组件: + +- GNU Compiler Collection (GCC) +- GNU C library (glibc) +- GNU Core Utilities (coreutils) +- GNU Debugger (GDB) +- GNU Binary Utilities (binutils) +- GNU Bash shell +- NOME desktop environment + +注:视频 + + +**自由软件基金会** (FSF) – 一个自由软件的非营利组织,致力于计算机用户自由的提升和权力的捍卫。于 1985 年 10 月 4 日成立。阅读[更多][3]。 + +- 于目的无关,随心运行程序的自由(自由0)。 +- 学习程序如何运作,并改变它为你所用的自由(自由1)。可以访问源码是这条的前提。 +- 重新发布副本的自由,如此你便可以帮助你的邻居了 (自由 2)。 +- 发布自己修改版本给他人的自由(自由 3)。这样能让整个社区有机会从你的改变中受益。可以访问源码是这条的前提。 + +以上为自由软件的四项自由原则。 + +以下为理查德·斯托曼关于自由、软件、社交、哲学等的名言摘引。 + +**关于 Facebook:** + +> Facebook 不是你的朋友,是监控引擎。 + +**关于 Android:** + +> Android 和 GNU/Linux 有很大的区别,因为其中几乎没有 GNU。的确,Android 和 GNU/Linux 之间仅有一个共同组件,那就是内核 - Linux。 + +**关于计算机行业:** + +> 计算机行业是唯一一个比时尚女装更被时尚驱动的行业。 + +**关于云计算:** + +> 关于云计算,有趣的是我们已经重新定义了云计算来包含我们曾干的所有事。 + +**关于伦理:** + +> 无论神存在与否,都没有绝对的伦理道德。没有这份理所当然,我们该如何?也唯有尽善吧。 + +**关于自由:** + +> 自由软件是尊重个人自由和社会团结的软件。所以才能如自由般自由自在。 + +**关于目标和理想:** + +> 如果你想为这世界做些什么,仅有理想是不够的,你需要找条通往目标的道路并走完。 + +**关于分享:** + +> 分享很棒,而且数字化技术也使分享变得容易。 + +**关于 facebook(进阶版):** + +> Facebook 蹂躏它们的用户。它不是你们的朋友;它就是个监控引擎。举个例子,你是否曾在一些网页或网站上看到 Facebook 的 “like” 按键。对,Facebook 知道你的电脑曾访问过那些网页。 + +**关于 web 应用:** + +> 给你个为什么不应该使用 web 应用的理由,因为你失去了计算机的控制权。 +> +> 如果你使用私有程序或他人的 web 服务器,那么你只能任人鱼肉。被软件的软件的开发者轻易操纵。 + +**关于书:** + +> 印刷出来的书,当然是自由的。即使你买了别人也不知道,这也是我一直买书的方式。买时不会被任何数据库认出。是亚马逊把自由夺走了。 + +**关于 MPAA:** + +> MPAA 其实是美国电影协会(Motion Picture Association of America),但我认为叫做攻击万物的邪恶力量(Malicious Power Attacking All)更为合适。 + +**关于金钱与职业:** + +> 我可以这样赚钱,并沉浸在编码的快乐中。但在职业生涯结束后,回首目睹自己筑就的高墙将人与人分隔开,我会觉得我耗尽毕生精力只换来了一个更糟糕的世界。 + +**关于私有软件:** + +> 私有软件使用户孤立、无助。因为禁止将软件给他人使用所以孤立,因为无法改变源码所以无助。他们学不了其中正真的工作方式。所以整个私有软件体系就是一种不公的力量。 + +**关于智能手机:** + +> 智能手机就是电脑 - 虽然做的和常用的电脑不同 - 但是却能干电脑能干的活。所以我们所说的一切有关于电脑上的软件应该能自由运行 - 必须坚持 - 在智能手机上也是这样。当然也包括平板。 + +**关于 CD 和数字内容:** + +> CD 商店有一个弱势就是需要昂贵的库存,但是电子商店就没有这方面的需求:他们只需要将售卖的副本写入记忆棒,并在你忘带自己的记忆棒时卖你一个就是了。 + +**关于竞争范式:About paradigm of competition:** + +> 竞争范式就像是赛跑:鼓励每一个跑得更快的人。当资本主义真的这样运作时,当然是件好事;但是维护者若是假设它一直这样运作的话那就大错特错了。 + +**关于 vi 和 emacs:** + +> 有时会有人问我在 Emacs 的阵营使用 vi 是不是一种罪过。使用自由版的 vi 并不是一种罪过;是一种忏悔。所以好好享受其中乐趣吧。 + +**关于自由和历史:** + +> 历史教会我们:珍惜自由,否则你将失去他。“别和我们谈政治”,对听不进的人这就是答复。 + +**关于专利:** + +> 和专利一个一个的战斗并不能解决软件专利带来的危害,就像打再多的蚊子也消灭不了疟疾一样。 +> +> 软件专利对于软件的开发者来说十分危险,因为它们加剧了对于软件理念的垄断。 + +**关于版权:** + +> 其实,版权制度对作者也没有什么好处,撇开最受欢迎的那个,其他作者的主旨可能更好理解,所以分享无论对他们还是你的读者都是一件好事。 + +**关于工作与报酬:** + +> 劳有所得,或寻求收入的最大化并没有什么错,只要不是不择手段。 + +**关于 Chrome OS:** + +> Chrome OS 确实是 GNU/Linux 的操作系统。但是,它在发布时没有安装常用应用,并为安装他们设置了阻碍。 + +**关于 Linux 用户:** + +> 许多的 GNU/Linux 用户并没有听过自由软件。他们并没有意识到,这个系统是因为道德理想才存在的,与此一起被忽视的还有所谓的“开源”。 + +**关于 facebook 的隐私:** + +> 如果页面上有 “like” 按键,Facebook 就能知道谁访问了页面。即使不是 Facebook 的用户,也可以得到访问该页面电脑的 IP 地址。 + +**关于编程:** + +> 编程不是科学,编程是手艺。 +> +> Lisp 和 C 语言是我的最爱。然自 1992 年以来高频的自由软件活动,确实反映了我编的太过匆忙。大概在 2008 年我便停止了编程开发。 +> +> C++ 设计的真糟糕、真丑陋。在 Emacs 上用他应该觉得羞愧。 + +**关于钻研(hacking)和学习编程:** + +> 今时不同往日,大家再也不用走我的老路了,完全可以在实际的操作系统上提升自己。上世纪 80 年代,我常遇见计算机专业的毕业生,自出生以来没见过真正的程序。他们接触的到的只有小玩意和学校的作业,因为每一个程序都是商业机密。他们没有机会去写真正实用的特性,修复用户真正遭遇的问题。做这些事便是你应知晓的最好的提升方式。 +> +> 对于如 hacking 这般多样化的东西真的很难简单的下定义,不过在我看来诸如此类的行为都会有以下的这些共同点:嬉乐、智慧和探索。因此,hacking 意味着对可能的极限的探索,一颗向往快乐与智慧心。能带来快乐与智慧的行为就有 “hack 的价值” 。 + +**关于浏览网页:** + +> 由于个人原因,我不会在我的电脑上浏览网页。(大部分时间处于没有网络连接的状态。)要浏览网页,我需要给守护进程发 mail,然后它会运行 wget 并把页面通过 mail 发还给我。这对我而言已经是最效率了,但那真的比实时慢太多了。 + +**关于音乐共享:** + +> 朋友之间彼此分享音乐,绝不会希望因为系统的一句:禁止私下拷贝!而生分。 + +-------------------------------------------------------------------------------- + +via: https://tlhp.cf/fsf-richard-stallman/ + +作者:[Pavlo Rudyi][a] +译者:[martin2011qi](https://github.com/martin2011qi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://tlhp.cf/fsf-richard-stallman/ +[1]:http://www.gnu.org/ +[2]:http://www.fsf.org/ +[3]:https://www.fsf.org/about/ \ No newline at end of file From b9b6629a9194851fc1e16f57bb518c2a375f8a72 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 18 Jan 2016 23:23:24 +0800 Subject: [PATCH 0241/1469] PUB:20151223 Ten Biggest Linux Stories Of The Year 2015 @StdioA --- ... Biggest Linux Stories Of The Year 2015.md | 127 ++++++++++++++++++ ... Biggest Linux Stories Of The Year 2015.md | 125 ----------------- 2 files changed, 127 insertions(+), 125 deletions(-) create mode 100644 published/20151223 Ten Biggest Linux Stories Of The Year 2015.md delete mode 100644 translated/talk/20151223 Ten Biggest Linux Stories Of The Year 2015.md diff --git a/published/20151223 Ten Biggest Linux Stories Of The Year 2015.md b/published/20151223 Ten Biggest Linux Stories Of The Year 2015.md new file mode 100644 index 0000000000..0a844a4cd7 --- /dev/null +++ b/published/20151223 Ten Biggest Linux Stories Of The Year 2015.md @@ -0,0 +1,127 @@ +2015年 Linux 世界的十个大事件 +====================== + +![2015年的大事件](http://itsfoss.com/wp-content/uploads/2015/12/Biggest-Linux-Stories-2015.jpg) + +2015年已经过去,我在这里(It's FOSS)发表《2015年的大事件》系列。这个系列的第一篇文章为《2015年 Linux 世界的十个大事件》。这些事件在 Linux 世界中产生了极大的影响,无论它们是积极的还是消极的。 + +我总结了2015发生的十件产生了最大影响的事件。让我们来看看: + +### 2015年度十大 Linux /开源相关事件 + +补充一句,以下这些事件没有按照时间顺序排列。 + +#### 微软与 Linux 的结盟 + +在9月下旬,所有人听到[微软构建了自己的 Linux 发行版][1]这个消息时都大吃一惊。其在后来被揭露,这其实是一个微软开发的用于它的 Azure cloud switches 的[软件][2]。 + +但故事还没结束。微软真的与 Canonical(Ubuntu Linux 的母公司)达成合作来开发 [HDInsight][3],这是微软在 Azure 上构建的 Hadoop 大数据服务。 Ubuntu 是[微软在其上部署应用][4]的第一个 Linux 系统。 + +微软会继续保持它与 Linux 的关系吗? 还是在使用 Linux 达到其目的(Azure)就会收手?只有时间能告诉我们一切。 + +#### 微软发布适用于 Linux 的 Visual Studio Code + +在微软发布 Linux 发行版引起喧嚣之前,微软扔下了另一枚炸弹——发布 [Linux 版 Visual Studio Code][27], 与其一并发布的还有 Windows 版以及 OS X 版。尽管 Visual Studio Code 并不是开源的,从某种意义上讲,发布 Linux 版本仍然是 Linux 用户的胜利。(LCTT 译注:此处原文消息有误,[Visual Studio Code 已开源][28]。)无论如何,Linus Torvalds 曾说过一句很著名的话:“如果微软给 Linux 开发过一款应用的话,这就意味着我已经赢了”。 + +你可以看这个教程来学习[如何在 Ubuntu 中安装 Visual Studio Code][5]。 + +#### 苹果公司开源编程语言 Swift + +在向 Linux 及开源“示爱”方面,苹果公司也不甘示弱。苹果用来制作 iOS 应用的首选编程语言 Swift,[现已开源][6]并移植到 Linux 中。虽然其还在测试中,但你已经可以轻易地[在 Ubuntu 中安装 Swift][7]。 + +但是,苹果就是苹果,它[开始吹嘘][8]其为“第一个视开源开发为公司关键的软件开发策略的计算机公司巨头(原文如此)”。 + +#### Ubuntu 手机终于发布 + +Ubuntu 手机终于在今年年初发布。因其早期使用者及开发者,Ubuntu 深受 Ubuntu 社区喜爱。主流智能机用户仍然回避它,主要是[因为该系统还在重度开发中][9]。对于 Ubuntu 手机的问世,2016年将成为决定性的一年。 + +#### Jolla 遭受经济危机 + +Jolla 是 Sailfish OS 这个基于 Linux 的智能手机系统的幕后公司,它遭受了严重的财政困难。这导致了[一半的Jolla 员工被裁][10]。 + +Jolla 在2014年针对它的平板电脑完成了一次非常[成功的众筹][11],显然,他们将大部分预算都花在了 Sailfish OS 的开发上,而在主要投资者退出后,公司正在挣扎以求生存。 + +不过有一个好消息,Jolla 成功拿到了一些雄厚的资金,而且他们[已经继续运营了][12]。 + +#### Firefox OS 已死 + +作为安卓的开源替代品,Mozila 的移动操作系统 Firefox OS 在去年底慢性死亡。本打算在发展中国家售卖低至25美金的智能手机,可基于 Firefox OS 的手机却一直没有流行起来。我认为主要原因是它的硬件配置不高,以及它缺少流行应用。 + +在十二月,[Mozilla 宣布][13]其将停止开发 Firefox OS,并停止出售 Firefox 智能手机。 + +虽然没有正式宣布过,我认为 [Tizen][14],这个 Linux 基金会旗下的基于 Linux 的移动操作系统,也已经消失了。我没有看到任何关于 Tizen 开发的消息,而且 Linux 基金会从未推动过它的开发。Tizen 何时死亡只是一个时间问题。(LCTT 译注:此处原文消息有误,[Tizen 在2015年发布了 3.0 版本][29]。) + +#### “Ubuntu 家族”内讧 + +五月份时,Kubuntu 项目的领导者 Jonathan Riddell [被 Ubuntu 社区委员会强制要求下台][15],这引起了很多激烈的讨论。Jonathan 曾质问 Ubuntu 所收捐款的使用情况,他抱怨 Kubuntu 从未见到过这些钱。 + +这导致了两方的互相谴责。最终。Ubuntu 的大老板,[Mark Shuttleworth 要求 Jonathan 下台][16]。 + +#### 女性 Linux 内核开发者因“野蛮的沟通方式”而退出 + +Linux 之父 Linus Torvalds 以其粗俗的语言而著称。Linux 内核开发者 [Sarah Sharp][17] 也因为嘴快心直而闻名。 + +Sarah Sharp 曾在2013年与 Linus Torvalds 公开争执,[建议 Linus 将“语言暴力”赶出邮件列表][18]。但 Linus 也没有[委婉地][19]回复她。 + +那是在2013年。2015年,Sarah 宣布她正在[逐步停止她在内核社区的工作][20],因为他们的交流方式缺乏基本礼仪,并且野蛮而充满亵渎。 + +这一举动让人们开始讨论 Linux 内核社区是否真的应该改变他们的行为方式,还是 Sarah 做的太过分了。 + +#### Unity 游戏编辑器移植到 Linux平台 + +尽管[在 Linux 上玩游戏][21]仍是 Linux 用户们的阿克琉斯之踵,而在游戏引擎 Unity 宣布其正在测试[Linux 下的游戏编辑器][22]时整个社区都沸腾了。因为在渲染图像时,Linux 是一个最流行的选择,所以我们推测这将使游戏开发者向 Linux 靠拢。不过,Unity 是否真的会推出一个最终版本的游戏编辑器,这个问题还未被证实。 + +#### 政府机构采用开源软件 + +欧洲数个城市的管理机构决定[抛弃先前的软件][23],并使用其开源的替代品。大多数城市管理机构将 Microsoft Office 替换为 LibreOffice 或 OpenOffice. 一些城市管理机构和[公立学校][24]也在跟进,将 Microsoft Windows 换成 Linux。 + +对于这一行为,削减成本是一个重要的因素,因为城市管理机构通过采用开源软件省下了无数欧元。 + +大学也并没有在采用开源软件的道路上落后。这一年,我们听到了[大学如何抛弃 Photoshop 改用 Krita][25] 以及[大学使用开源 Office 软件][26]的消息。 + +### 总结 + +与其他年一样,2015年同样有许多令 Linux 爱好者感到积极或消极的时刻。我们看到 Linux 的竞争者,如微软和苹果,向 Linux 靠拢,政府机构采用开源软件。同时,我们还见证了 Firefox 智能手机系统的失败。我想说,这真是喜忧参半的一年。 + +你认为呢?我希望你们分享你所认为对于 Linuxer 们来说最重要的新闻,和你们对这一年的整体感受。 + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/biggest-linux-stories-2015/ + +作者:[Abhishek][a] +译者:[StdioA](https://github.com/StdioA) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://itsfoss.com/author/abhishek/ +[1]: https://linux.cn/article-6269-1.html +[2]: http://arstechnica.com/information-technology/2015/09/microsoft-has-built-software-but-not-a-linux-distribution-for-its-software-switches/ +[3]: https://azure.microsoft.com/en-us/services/hdinsight/ +[4]: http://www.zdnet.com/article/microsoft-deploys-first-major-server-application-on-ubuntu-linux/ +[5]: https://linux.cn/article-5423-1.html +[6]: https://linux.cn/article-6689-1.html +[7]: https://linux.cn/article-6781-1.html +[8]: https://business.facebook.com/itsfoss/photos/pb.115098615297581.-2207520000.1450817108./634288916711879/?type=3&theater +[9]: http://www.engadget.com/2015/07/24/ubuntu-phone-review/ +[10]: https://linux.cn/article-6621-1.html +[11]: https://www.indiegogo.com/projects/jolla-tablet-world-s-first-crowdsourced-tablet#/ +[12]: https://linux.cn/article-6757-1.html +[13]: https://linux.cn/article-6800-1.html +[14]: https://www.tizen.org/ +[15]: https://linux.cn/article-5529-1.html +[16]: http://www.cio.com/article/2926838/linux/mark-shuttleworth-ubuntu-community-council-ask-kubuntu-developer-to-step-down-as-leader.html +[17]: http://sarah.thesharps.us/ +[18]: http://www.techeye.net/chips/linus-torvalds-and-intel-woman-in-sweary-spat +[19]: http://marc.info/?l=linux-kernel&m=137392506516022&w=2 +[20]: https://linux.cn/article-6361-1.html +[21]: https://linux.cn/article-6258-1.html +[22]: http://itsfoss.com/unity-gaming-engine-linux/ +[23]: https://linux.cn/article-6459-1.html +[24]: http://itsfoss.com/spanish-school-ditches-windows-ubuntu/ +[25]: http://itsfoss.com/french-university-dumps-adobe-photoshop-open-source-app-krita/ +[26]: http://itsfoss.com/hungarian-universities-switch-eurooffice/ +[27]: https://linux.cn/article-5376-1.html +[28]: https://linux.cn/article-6604-1.html +[29]: https://linux.cn/article-6261-1.html diff --git a/translated/talk/20151223 Ten Biggest Linux Stories Of The Year 2015.md b/translated/talk/20151223 Ten Biggest Linux Stories Of The Year 2015.md deleted file mode 100644 index 90c8f2f6a7..0000000000 --- a/translated/talk/20151223 Ten Biggest Linux Stories Of The Year 2015.md +++ /dev/null @@ -1,125 +0,0 @@ -# 2015年度十大Linux事件 - -![2015年的大事件](http://itsfoss.com/wp-content/uploads/2015/12/Biggest-Linux-Stories-2015.jpg) - -2015年即将结束,我在这里(It's FOSS)发表《2015年的大事件》系列。这个系列的第一篇文章为《2015十大Linux事件》。这些事件在Linux世界中产生了极大的影响,无论它们是积极的还是消极的。 - -我总结了2015发生的十个像这样——产生了最大影响的事件。黑喂狗! - -### 2015年度十大Linux/开源相关事件 - -补充一句,以下这些项目没有按照时间顺序排列。 - -#### 微软与Linux的结盟 - -在9月下旬,所有人听到[微软构建了自己的Linux发行版][1]这个消息时都大吃一惊。其在后来被揭露,这其实是一个微软开发的用于`Azur cloud switches`的[软件][2]。 - -但故事还没结束。微软真的与Canonical (Ubuntu Linux的母公司)达成合作 来开发[HDInsight][3]——微软在通过Azure上构建Hadoop来进行大数据处理的服务. Ubuntu是[微软在其上部署软件][4]的第一个Linux系统。 - -微软会继续保持它与Linux的关系吗? 还是在使用Linux达到其目的(Azur)就会收手?只有时间能告诉我们一切。 - -#### 微软发布适用于Linux的Visual Studio Code - -在微软发布Linux发行版引起喧嚣之前,微软扔下了另一枚炸弹——发布Linux版Visual Studio Code, 与其一并发布的还有Windows以及OS X版。尽管Visual Studio Code并不是开源的,从某种意义上讲,发布Linux版本仍然是Linux用户的胜利。 无论如何,Linus Torvalds曾说过一句很著名的话:“如果微软给Linux开发过一款应用的话,这就意味着我已经赢了”。 - -你可以看这个教程来学习[如何在Ubuntu中安装Visual Studio Code][5]。 - -#### 苹果公司开源编程语言Swift - -在向Linux及开源“示爱”方面,苹果公司也不甘示弱。苹果用来制作iOS应用的首选编程语言Swift, [现已开源][6]并移植到Linux中。虽然其还在测试中,但你可以轻易地[在Ubuntu中安装Swift][7]。 - -但是,苹果就是苹果,它[开始吹嘘][8]其为“第一个视开源开发为公司的关键软件开发策略的计算机公司巨头(原文如此)”。 - -#### Ubuntu手机终于发布 - -Ubuntu手机终于在今年年初发布。 因其早期使用者及开发者,Ubuntu深受Ubuntu社区喜爱。主流智能机用户仍然回避它,主要[因为该系统还在大规模开发中][9]。对于Ubuntu手机的问世,2016年将成为决定性的一年。 - -#### Jolla遭受经济危机 - -Jolla, Sailfish OS —— 以Linux为基础的智能手机系统的幕后公司,遭受了严重的财政障碍。这导致了[一半的Jolla员工罢工][10]。 - -Jolla在2014年针对它的平板电脑完成了一次非常[成功的众筹][11],显然,他们将大部分预算都花在了Sailfish OS的开发上,而在主要投资者退出后,公司在挣扎以求生存。 - -不过有一个好消息,Jolla成功拿到了一些雄厚的资金,而且他们已[回归经营生意][12]。 - -#### Firefox OS已死 - -作为安卓的开源替代品,Mozila的移动操作系统Firefox OS在这个月初慢性死亡。本打算在发展中国家售卖低至25美金的智能手机,可Firefox OS永远没有流行起来。我认为主要原因是它的硬件廉价,以及它缺少流行应用。 - -在十二月,[Mozilla宣布][13]其将停止开发Firefox OS, 并停止出售Firefox智能手机。 - -我认为[Tizen][14], Linux基金会旗下的基于Linux的移动操作系统,也已经消失了,尽管其从未发布过。我没有看到任何关于Tizen开发的消息,而且Linux基金会从未推动过它的开发。Tizen何时死亡只是一个时间问题。 - -#### “Ubuntu家族”内讧 - -今年五月,Jonathan Riddell,Kubuntu项目的领导者,[被Ubuntu社区委员会强制要求下台][15],这引起了很多激烈的讨论。Jonathan曾质问Ubuntu所收捐款的使用情况,他抱怨Kubuntu从未见到过这些钱。 - -这导致了两方的互相谴责。最终。Ubuntu的老爹,[Mark Shuttleworth要求Jonathan下台][16]。 - -#### 女性Linux内核开发者因“野蛮的沟通方式”而退出 - -Linux之父Linus Torvalds因其粗俗的语言而著称。Linux内核开发者[Sarah Sharp][17]也因为嘴快心直而著称。 - -Sarah Sharp曾在2013年与Linus Torvalds公开争执,[建议Linus将“语言暴力”赶出邮件列表][18]。Linus也没有[委婉地][19]回复她。 - -那是在2013年。2015年,Sarah宣布她正在[逐步停止她在内核社区的工作][20]因为他们的交流方式缺乏基本礼仪,并且野蛮而充满亵渎。 - -这一举动让人们开始讨论Linux内核社区是否真的应该改变他们的行为方式,还是Sarah做的太过分了。 - -#### Unity游戏编辑器移植到Linux平台 - -尽管[在Linux上玩游戏][21]认识Linux用户们的阿克琉斯之踵,整个社区在游戏引擎Unity宣布其正在测试[Linux下的游戏编辑器][22]时都沸腾了。因为在渲染图像时,Linux是一个最流行的选择,所以我们推测这将使游戏开发者向Linux靠拢。不过,Unity是否真的会推出一个最终版本的游戏编辑器,这个问题还未被证实。 - -#### 政府机构采用开源软件 - -欧洲数个城市的管理机构决定[抛弃先前的软件][23],并使用其开源的替代品。大多数城市管理机构将Microsoft Office替换为LibreOffice或OpenOffice. 一些城市管理机构和[公立学校][24]也跟进,将Microsoft Windows换成Linux. - -对于这一行为,削减成本是一个重要的因素,因为城市管理机构通过采用开源软件省下了无数欧元。 - -大学也并没有在采用开源软件的道路上落后。这一年,我们听到了[大学如何抛弃Photoshop改用Krita][25]以及[大学使用开源Office软件][26]的消息。 - -### 总结 - -与其他年一样,2015年同样有许多另Linux爱好者感到积极或消极的时刻。我们看到Linux的竞争者,如微软和苹果,向Linux靠拢,政府机构采用开源软件。同时,我们特见证了Firefox智能手机系统的失败。我想说,这真是喜忧参半的一年。 - -你认为呢?我希望你们分享你们所认为对于Linuxer们来说最重要的新闻,和你们对这一年的整体感受。 - --------------------------------------------------------------------------------- - -via: http://itsfoss.com/biggest-linux-stories-2015/ - -作者:[Abhishek][a] - -译者:[ StdioA](https://github.com/StdioA) - -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://itsfoss.com/author/abhishek/ -[1]: http://www.theregister.co.uk/2015/09/18/microsoft_has_developed_its_own_linux_repeat_microsoft_has_developed_its_own_linux/ -[2]: http://arstechnica.com/information-technology/2015/09/microsoft-has-built-software-but-not-a-linux-distribution-for-its-software-switches/ -[3]: https://azure.microsoft.com/en-us/services/hdinsight/ -[4]: http://www.zdnet.com/article/microsoft-deploys-first-major-server-application-on-ubuntu-linux/ -[5]: http://itsfoss.com/install-visual-studio-code-ubuntu/ -[6]: http://itsfoss.com/swift-open-source-linux/ -[7]: http://itsfoss.com/use-swift-linux/ -[8]: https://business.facebook.com/itsfoss/photos/pb.115098615297581.-2207520000.1450817108./634288916711879/?type=3&theater -[9]: http://www.engadget.com/2015/07/24/ubuntu-phone-review/ -[10]: http://techcrunch.com/2015/11/20/jolla-running-out-of-runway-for-its-android-alternative/ -[11]: https://www.indiegogo.com/projects/jolla-tablet-world-s-first-crowdsourced-tablet#/ -[12]: https://blog.jolla.com/jolla-back-business/ -[13]: http://arstechnica.com/gadgets/2015/12/firefox-os-smartphones-are-dead/ -[14]: https://www.tizen.org/ -[15]: http://www.omgubuntu.co.uk/2015/05/kubuntu-project-lead-asked-to-step-down-by-ubuntu-community-council -[16]: http://www.cio.com/article/2926838/linux/mark-shuttleworth-ubuntu-community-council-ask-kubuntu-developer-to-step-down-as-leader.html -[17]: http://sarah.thesharps.us/ -[18]: http://www.techeye.net/chips/linus-torvalds-and-intel-woman-in-sweary-spat -[19]: http://marc.info/?l=linux-kernel&m=137392506516022&w=2 -[20]: http://www.networkworld.com/article/2988850/opensource-subnet/linux-kernel-dev-sarah-sharp-quits-citing-brutal-communications-style.html -[21]: http://itsfoss.com/linux-gaming-guide/ -[22]: http://itsfoss.com/unity-gaming-engine-linux/ -[23]: http://itsfoss.com/tag/open-source-adoption/ -[24]: http://itsfoss.com/spanish-school-ditches-windows-ubuntu/ -[25]: http://itsfoss.com/french-university-dumps-adobe-photoshop-open-source-app-krita/ -[26]: http://itsfoss.com/hungarian-universities-switch-eurooffice/ From 119d9c3efdc914791efbfa272a858c7e1e144373 Mon Sep 17 00:00:00 2001 From: GHLandy Date: Tue, 19 Jan 2016 13:52:13 +0800 Subject: [PATCH 0242/1469] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=B7=B2=E7=BF=BB?= =?UTF-8?q?=E8=AF=91=E7=9A=84=E5=8E=9F=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...a 'World without Linux' and Open Source.md | 53 ------------------- 1 file changed, 53 deletions(-) delete mode 100644 sources/talk/20151126 Linux Foundation Explains a 'World without Linux' and Open Source.md diff --git a/sources/talk/20151126 Linux Foundation Explains a 'World without Linux' and Open Source.md b/sources/talk/20151126 Linux Foundation Explains a 'World without Linux' and Open Source.md deleted file mode 100644 index c9d08b73bf..0000000000 --- a/sources/talk/20151126 Linux Foundation Explains a 'World without Linux' and Open Source.md +++ /dev/null @@ -1,53 +0,0 @@ -GHLandy Translating - -Linux Foundation Explains a "World without Linux" and Open Source -================================================================================ -> The Linux Foundation responds to questions about its "World without Linux" movies, including what the Internet would be like without Linux and other open source software. - -![](http://thevarguy.com/site-files/thevarguy.com/files/imagecache/medium_img/uploads/2015/11/hey_22.png) - -Would the world really be tremendously different if Linux, the open source operating system kernel, did not exist? Would there be no Internet or movies? Those are the questions some viewers of the [Linux Foundation's][1] ongoing "[World without Linux][2]" video series are asking. Here are some answers. - -In case you've missed it, the "World without Linux" series is a collection of quirky short films that depict, well, a world without Linux (and open source software more generally). They have emphasized themes like [Linux's role in movie-making][3] and in [serving the Internet][4]. - -To offer perspective on the series's claims, direction and hidden symbols, Jennifer Cloer, vice president of communications at The Linux Foundation, recently sent The VAR Guy responses to some common queries about the movies. Below are the answers, in her own words. - -### The latest episode takes Sam and Annie to the movies. Would today's graphics really be that much different without Linux? ### - -In episode #4, we do a bit of a parody on "Avatar." Love it or hate it, the graphics in the real "Avatar" are pretty impressive. In a world without Linux, the graphics would be horrible but we wouldn't even know it because we wouldn't know any better. But in fact, "Avatar" was created using Linux. Weta Digital used one of the world's largest Linux clusters to render the film and do 3D modeling. It's also been reported that "Lord of the Rings," "Fantastic Four" and "King Kong," among others, have used Linux. We hope this episode can bring attention to that work, which hasn't been widely reported. - -### Some people criticized the original episode for concluding there would be no Internet without Linux. What's your reaction? ### - -We enjoyed the debate that resulted from the debut episode. With more than 100,000 views to date of that episode alone, it brought awareness to the role that Linux plays in society and to the worldwide community of contributors and supporters. Of course the Internet would exist without Linux but it wouldn't be the Internet we know today and it wouldn't have matured at the pace it has. Each episode makes a bold and fun statement about Linux's role in our every day lives. We hope this can help extend the story of Linux to more people around the world. - -### Why is Sam and Annie's cat named String? ### - -Nothing in the series is a coincidence. Look closely and you'll find all kinds of inside Linux and geek jokes. String is named after String theory and was named by our Linux.com Editor Libby Clark. In physics, string theory is a theoretical framework in which the point-like particles of particle physics are replaced by one-dimensional objects called strings. String theory describes how these strings propagate through space and interact with each other. Kind of like Sam, Annie and String in a World Without Linux. - -### What can we expect from the next two episodes and, in particular, the finale? When will it air? ### - -In episode #5, we'll go to space and experience what a world without Linux would mean to exploration. It's a wild ride. In the finale, we finally get to see Linus in a world without Linux. There have been clues throughout the series as to what this finale will include but I can't give more than that away since there are ongoing contests to find the clues. And I can't give away the air date for the finale! You'll have to follow #WorldWithoutLinux to learn more. - -### Can you give us a hint on the clues in episode #4? ### - -There is another reference to the Free Burger Restaurant in this episode. Linux also actually does appear in this world without Linux but in a very covert way; you could say it's like reading Linux in another language. And, of course, just for fun, String makes another appearance. - -### Is the series achieving what you hoped? ### - -Yes. We're really happy to see people share and engage with these stories. We hope that it's reaching people who might not otherwise know the story of Linux or understand its pervasiveness in the world today. It's really about surfacing this to a broader audience and giving thanks to the worldwide community of developers and companies that support Linux and all the things it makes possible. - --------------------------------------------------------------------------------- - -via: http://thevarguy.com/open-source-application-software-companies/linux-foundation-explains-world-without-linux-and-open-so - -作者:[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://linuxfoundation.org/ -[2]:http://www.linuxfoundation.org/world-without-linux -[3]:http://thevarguy.com/open-source-application-software-companies/new-linux-foundation-video-highlights-role-open-source-3d -[4]:http://thevarguy.com/open-source-application-software-companies/100715/would-internet-exist-without-linux-yes-without-open-sourc From 366eba880f5ccce632a10f3524a0d8a8d2177e5e Mon Sep 17 00:00:00 2001 From: GHLandy Date: Tue, 19 Jan 2016 13:54:32 +0800 Subject: [PATCH 0243/1469] =?UTF-8?q?[=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= =?UTF-8?q?]=2020151126=20Linux=20Foundation=20Explains=20a=20'World=20wit?= =?UTF-8?q?hout=20Linux'=20and=20Open=20Source?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...a 'World without Linux' and Open Source.md | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 translated/talk/20151126 Linux Foundation Explains a 'World without Linux' and Open Source.md diff --git a/translated/talk/20151126 Linux Foundation Explains a 'World without Linux' and Open Source.md b/translated/talk/20151126 Linux Foundation Explains a 'World without Linux' and Open Source.md new file mode 100644 index 0000000000..3f0170de0a --- /dev/null +++ b/translated/talk/20151126 Linux Foundation Explains a 'World without Linux' and Open Source.md @@ -0,0 +1,52 @@ +没有 Linux 和开源软件的世界会变得怎么样 —— 听听来自 Linux 基金会的解释 +================================================================================ +> Linux 基金会针最近对人们关于 “没有 Linux 的世界” 系列短片提出的问题做了回应:包括没有 Linux 和其他的开源软件的因特网会变得怎么样等问题。 + +![](http://thevarguy.com/site-files/thevarguy.com/files/imagecache/medium_img/uploads/2015/11/hey_22.png) + +假如 Linux —— 一个开源的操作系统内核 —— 不曾出现过,我们现在的世界是否会是另一番景象。会不会没有了因特网,或者没有了电影?这些都是 [Linux 基金会][1] 正在连续播出的 “[没有 Linux 的世界][2]” 系列短片的观众提出来的问题。 + +假如你错过了观看这些短片也不要紧,“没有 Linux 的世界” 系列短片是一个古怪的短片集合,里边描述了没有了 Linux (或者说没有开源软件)的世界发生的事情。这些短片强调了 Linux 在 [电影制作][3] 以及 [服务于因特网][4] 中充当的角色。 + +为了提供该系列短片的一些主张、方向和隐藏元素,Linux 基金会副主席 Jennifer Cloer 最近在 The VAR Guy 上回应了关于该短片的一些问题。以下是她的原话解答。 + +### 最新一集短片 —— Sam 和 Annie 一起看电影。假如没有 Linux,我们现在的荧屏是不是也和短片中的一样? ### + +在 #4 剧情中,我们恶搞了一下电影 “Avatar”。不管你喜欢还是讨厌,现实中的 “Avatar” 在荧屏上的效果还是让人产生记忆深刻的。在没有 Linux 的世界中,电影的效果就变得非常恐怖,但是我们并不介意它,因为那已经是最好的了。但实际上,“Avatar” 是使用了 Linux 来进行效果制作的。Weta 数码使用了当时世界上最大的 Linux 集群来给电影做效果渲染和 3D 建模。据报道,指环王(Lord of the Rings)、神奇四侠(Fantastic Four)和金刚(King Kong)等电影都用到了 Linux。我希望该短片能引起电影制作工作者的关注,还有很多我们不知道的用到 Linux 来制作的电影。(译者注:这句应该是强度 Linux 在电影制作中的重要应用,可能翻译的不是很好。that work应该指的电影制作,只是直译感觉有点怪,这暂时没想到怎么译的最好。原话为:We hope this episode can bring attention to that work, which hasn't been widely reported.) + +### 很多人对短片的原始剧情进行了批判,其中包括没有 Linux 将没有因特网。你对此持什么样的看法? ### + +我们很喜欢人们从短片刚上映就进行激烈的辩论。该短片上映当天就超过了 100,000 的观众,这引起了人们对 Linux 在社会中扮演的角色以及全球的社区贡献者和维护者的关注。当然了,没有 Linux 的话,因特网也是会出现的,只是不会像当前我们所熟知的互联网那么成熟而已。每一个短片都对 Linux 在我们每天生活中扮演的角色进行了大胆且有趣的描述。我们希望,这些短片能够把关于 Linux 的故事推广到全世界的人的心里去。 + +### 为什么 Sam 和 Annie 的那只猫叫做 String? ### + +该短片系列中没有一处剧情是偶然的。仔细的观看话,你就会发现其中关于 Linux 和极客们的各种玩笑。小猫 String 是我们的 Linux.com 主编 Libby Clark 以弦理论(string theory)亲自来命名的。在物理学里,弦理论(string theory)是一个理论框架,它用一个叫做弦(String)的一维对象替换了粒子物理学中粒子状粒子。弦理论(string theory)描述了这些弦(String)如何在空间传播以及相互影响。就像 Sam、Annie 和 String 在那个没有 Linux 的世界里的关系那样。 + +### 我们期待已久的下两集是什么样的,特别是,最后那集什么时候上映? ### + +在 #5 短片中,我们将到太空并体验一下没有 Linux 的世界对太空探索的影响。这就像是一场疯狂的骑行。在短片的最后,我们最终还是会见到没有 Linux 的世界里的 Linus。贯穿整个短片系列,里边已经给出关于结局的线索,我在这就不能给太多提示了,因为还有好多人在找线索比赛中继续寻找着。并且我也不能给你们说出关于结局短片的上映日期。你们要自己跟进 #WorldWithoutLinux 主题帖来获取跟多信息。 + +### 你可给一些关于 #4 短片相关线索的提示吗? ### + +在该短片中有另外一个关于免费汉堡餐厅(Free Burger Restaurant)的线索。在那个没有 Linux 的世界里,Linux 最后还是以一种很隐秘的方式出现了,可以说,就像是以另一种语言来解读 Linux。当然,这只是为了好玩,String 也是另外一个模样。 + +### 那么,该系列短片达到你所想要的效果了吗? ### + +是的,达到了。我们很高兴看到人们分享并参与到这些故事中去。 +我们希望向那些可能不知道 Linux 的人传达更多关于 Linux 的故事并了解 Linux 在当今世界中是无处不在的。全部的短片就是为了把这些关于 Linux 的真相推广给大家,并感谢那些全球性社区的开发者和公司对 Linux 的支持,Linux 使得一切成为可能。 + +-------------------------------------------------------------------------------- + +via: http://thevarguy.com/open-source-application-software-companies/linux-foundation-explains-world-without-linux-and-open-so + +作者:[Christopher Tozzi][a] +译者:[GHLandy](https://github.com/GHLandy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://thevarguy.com/author/christopher-tozzi +[1]:http://linuxfoundation.org/ +[2]:http://www.linuxfoundation.org/world-without-linux +[3]:http://thevarguy.com/open-source-application-software-companies/new-linux-foundation-video-highlights-role-open-source-3d +[4]:http://thevarguy.com/open-source-application-software-companies/100715/would-internet-exist-without-linux-yes-without-open-sourc From d5003c1d43fc3e03a6634e7f9e4d5bfdea157ceb Mon Sep 17 00:00:00 2001 From: Ping Date: Wed, 20 Jan 2016 10:03:06 +0800 Subject: [PATCH 0244/1469] Mark the translaing Article. --- ... to install Suricata intrusion detection system on Linux.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150906 How to install Suricata intrusion detection system on Linux.md b/sources/tech/20150906 How to install Suricata intrusion detection system on Linux.md index 736a6577de..02e6153c60 100644 --- a/sources/tech/20150906 How to install Suricata intrusion detection system on Linux.md +++ b/sources/tech/20150906 How to install Suricata intrusion detection system on Linux.md @@ -1,4 +1,5 @@ -translated by ivo-wang +translating by Ping + How to install Suricata intrusion detection system on Linux ================================================================================ With incessant security threats, intrusion detection system (IDS) has become one of the most critical requirements in today's data center environments. However, as more and more servers upgrade their NICs to 10GB/40GB Ethernet, it is increasingly difficult to implement compute-intensive intrusion detection on commodity hardware at line rates. One approach to scaling IDS performance is **multi-threaded IDS**, where CPU-intensive deep packet inspection workload is parallelized into multiple concurrent tasks. Such parallelized inspection can exploit multi-core hardware to scale up IDS throughput easily. Two well-known open-source efforts in this area are [Suricata][1] and [Bro][2]. From 2daaf49e6808fc5c69542c2d311b9698d97d25ae Mon Sep 17 00:00:00 2001 From: Ping Date: Wed, 20 Jan 2016 13:57:23 +0800 Subject: [PATCH 0245/1469] translated 20150906 How to install Suricata intrusion detection system on Linux.md --- ...ata intrusion detection system on Linux.md | 199 ----------------- ...ata intrusion detection system on Linux.md | 203 ++++++++++++++++++ 2 files changed, 203 insertions(+), 199 deletions(-) delete mode 100644 sources/tech/20150906 How to install Suricata intrusion detection system on Linux.md create mode 100644 translated/tech/20150906 How to install Suricata intrusion detection system on Linux.md diff --git a/sources/tech/20150906 How to install Suricata intrusion detection system on Linux.md b/sources/tech/20150906 How to install Suricata intrusion detection system on Linux.md deleted file mode 100644 index 02e6153c60..0000000000 --- a/sources/tech/20150906 How to install Suricata intrusion detection system on Linux.md +++ /dev/null @@ -1,199 +0,0 @@ -translating by Ping - -How to install Suricata intrusion detection system on Linux -================================================================================ -With incessant security threats, intrusion detection system (IDS) has become one of the most critical requirements in today's data center environments. However, as more and more servers upgrade their NICs to 10GB/40GB Ethernet, it is increasingly difficult to implement compute-intensive intrusion detection on commodity hardware at line rates. One approach to scaling IDS performance is **multi-threaded IDS**, where CPU-intensive deep packet inspection workload is parallelized into multiple concurrent tasks. Such parallelized inspection can exploit multi-core hardware to scale up IDS throughput easily. Two well-known open-source efforts in this area are [Suricata][1] and [Bro][2]. - -In this tutorial, I am going to demonstrate **how to install and configure Suricata IDS on Linux server**. - -### Install Suricata IDS on Linux ### - -Let's build Suricata from the source. You first need to install several required dependencies as follows. - -#### Install Dependencies on Debian, Ubuntu or Linux Mint #### - - $ sudo apt-get install wget build-essential libpcre3-dev libpcre3-dbg automake autoconf libtool libpcap-dev libnet1-dev libyaml-dev zlib1g-dev libcap-ng-dev libjansson-dev - -#### Install Dependencies on CentOS, Fedora or RHEL #### - - $ sudo yum install wget libpcap-devel libnet-devel pcre-devel gcc-c++ automake autoconf libtool make libyaml-devel zlib-devel file-devel jansson-devel nss-devel - -Once you install all required packages, go ahead and install Suricata as follows. - -First, download the latest Suricata source code from [http://suricata-ids.org/download/][3], and build it. As of this writing, the latest version is 2.0.8. - - $ wget http://www.openinfosecfoundation.org/download/suricata-2.0.8.tar.gz - $ tar -xvf suricata-2.0.8.tar.gz - $ cd suricata-2.0.8 - $ ./configure --sysconfdir=/etc --localstatedir=/var - -Here is the example output of configuration. - - Suricata Configuration: - AF_PACKET support: yes - PF_RING support: no - NFQueue support: no - NFLOG support: no - IPFW support: no - DAG enabled: no - Napatech enabled: no - Unix socket enabled: yes - Detection enabled: yes - - libnss support: yes - libnspr support: yes - libjansson support: yes - Prelude support: no - PCRE jit: yes - LUA support: no - libluajit: no - libgeoip: no - Non-bundled htp: no - Old barnyard2 support: no - CUDA enabled: no - -Now compile and install it. - - $ make - $ sudo make install - -Suricata source code comes with default configuration files. Let's install these default configuration files as follows. - - $ sudo make install-conf - -As you know, Suricata is useless without IDS rule sets. Conveniently, the Makefile comes with IDS rule installation option. To install IDS rules, run the following command. - - $ sudo make install-rules - -The above rule installation command will download the current snapshot of community rulesets available from [EmergingThreats.net][4], and store them under /etc/suricata/rules. - -![](https://farm1.staticflickr.com/691/20482669553_8b67632277_c.jpg) - -### Configure Suricata IDS the First Time ### - -Now it's time to configure Suricata. The configuration file is located at **/etc/suricata/suricata.yaml**. Open the file with a text editor for editing. - - $ sudo vi /etc/suricata/suricata.yaml - -Here are some basic setup for you to get started. - -The "default-log-dir" keyword should point to the location of Suricata log files. - - default-log-dir: /var/log/suricata/ - -Under "vars" section, you will find several important variables used by Suricata. "HOME_NET" should point to the local network to be inspected by Suricata. "!$HOME_NET" (assigned to EXTERNAL_NET) refers to any other networks than the local network. "XXX_PORTS" indicates the port number(s) use by different services. Note that Suricata can automatically detect HTTP traffic regardless of the port it uses. So it is not critical to specify the HTTP_PORTS variable correctly. - - vars: - HOME_NET: "[192.168.122.0/24]" - EXTERNAL_NET: "!$HOME_NET" - HTTP_PORTS: "80" - SHELLCODE_PORTS: "!80" - SSH_PORTS: 22 - -The "host-os-policy" section is used to defend against some well-known attacks which exploit the behavior of an operating system's network stack (e.g., TCP reassembly) to evade detection. As a counter measure, modern IDS came up with so-called "target-based" inspection, where inspection engine fine-tunes its detection algorithm based on a target operating system of the traffic. Thus, if you know what OS individual local hosts are running, you can feed that information to Suricata to potentially enhance its detection rate. This is when "host-os-policy" section is used. In this example, the default IDS policy is Linux; if no OS information is known for a particular IP address, Suricata will apply Linux-based inspection. When traffic for 192.168.122.0/28 and 192.168.122.155 is captured, Suricata will apply Windows-based inspection policy. - - host-os-policy: - # These are Windows machines. - windows: [192.168.122.0/28, 192.168.122.155] - bsd: [] - bsd-right: [] - old-linux: [] - # Make the default policy Linux. - linux: [0.0.0.0/0] - old-solaris: [] - solaris: ["::1"] - hpux10: [] - hpux11: [] - irix: [] - macos: [] - vista: [] - windows2k3: [] - -Under "threading" section, you can specify CPU affinity for different Suricata threads. By default, [CPU affinity][5] is disabled ("set-cpu-affinity: no"), meaning that Suricata threads will be scheduled on any available CPU cores. By default, Suricata will create one "detect" thread for each CPU core. You can adjust this behavior by specifying "detect-thread-ratio: N". This will create N*M detect threads, where M is the total number of CPU cores on the host. - - threading: - set-cpu-affinity: no - detect-thread-ratio: 1.5 - -With the above threading settings, Suricata will create 1.5*M detection threads, where M is the total number of CPU cores on the system. - -For more information about Suricata configuration, you can read the default configuration file itself, which is heavily commented for clarity. - -### Perform Intrusion Detection with Suricata ### - -Now it's time to test-run Suricata. Before launching it, there's one more step to do. - -When you are using pcap capture mode, it is highly recommended to turn off any packet offloead features (e.g., LRO/GRO) on the NIC which Suricata is listening on, as those features may interfere with live packet capture. - -Here is how to turn off LRO/GRO on the network interface eth0: - - $ sudo ethtool -K eth0 gro off lro off - -Note that depending on your NIC, you may see the following warning, which you can ignore. It simply means that your NIC does not support LRO. - - Cannot change large-receive-offload - -Suricata supports a number of running modes. A runmode determines how different threads are used for IDS. The following command lists all [available runmodes][6]. - - $ sudo /usr/local/bin/suricata --list-runmodes - -![](https://farm6.staticflickr.com/5730/20481140934_25080d04d7_c.jpg) - -The default runmode used by Suricata is autofp (which stands for "auto flow pinned load balancing"). In this mode, packets from each distinct flow are assigned to a single detect thread. Flows are assigned to threads with the lowest number of unprocessed packets. - -Finally, let's start Suricata, and see it in action. - - $ sudo /usr/local/bin/suricata -c /etc/suricata/suricata.yaml -i eth0 --init-errors-fatal - -![](https://farm1.staticflickr.com/701/21077552366_c577746e36_c.jpg) - -In this example, we are monitoring a network interface eth0 on a 8-core system. As shown above, Suricata creates 13 packet processing threads and 3 management threads. The packet processing threads consist of one PCAP packet capture thread, and 12 detect threads (equal to 8*1.5). This means that the packets captured by one capture thread are load-balanced to 12 detect threads for IDS. The management threads are one flow manager and two counter/stats related threads. - -Here is a thread-view of Suricata process (plotted by [htop][7]). - -![](https://farm6.staticflickr.com/5775/20482669593_174f8f41cb_c.jpg) - -Suricata detection logs are stored in /var/log/suricata directory. - - $ tail -f /var/log/suricata/fast.log - ----------- - - 04/01/2015-15:47:12.559075 [**] [1:2200074:1] SURICATA TCPv4 invalid checksum [**] [Classification: (null)] [Priority: 3] {TCP} 172.16.253.158:22 -> 172.16.253.1:46997 - 04/01/2015-15:49:06.565901 [**] [1:2200074:1] SURICATA TCPv4 invalid checksum [**] [Classification: (null)] [Priority: 3] {TCP} 172.16.253.158:22 -> 172.16.253.1:46317 - 04/01/2015-15:49:06.566759 [**] [1:2200074:1] SURICATA TCPv4 invalid checksum [**] [Classification: (null)] [Priority: 3] {TCP} 172.16.253.158:22 -> 172.16.253.1:46317 - -For ease of import, the log is also available in JSON format: - - $ tail -f /var/log/suricata/eve.json - ----------- - {"timestamp":"2015-04-01T15:49:06.565901","event_type":"alert","src_ip":"172.16.253.158","src_port":22,"dest_ip":"172.16.253.1","dest_port":46317,"proto":"TCP","alert":{"action":"allowed","gid":1,"signature_id":2200074,"rev":1,"signature":"SURICATA TCPv4 invalid checksum","category":"","severity":3}} - {"timestamp":"2015-04-01T15:49:06.566759","event_type":"alert","src_ip":"172.16.253.158","src_port":22,"dest_ip":"172.16.253.1","dest_port":46317,"proto":"TCP","alert":{"action":"allowed","gid":1,"signature_id":2200074,"rev":1,"signature":"SURICATA TCPv4 invalid checksum","category":"","severity":3}} - -### Conclusion ### - -In this tutorial, I demonstrated how you can set up Suricata IDS on a multi-core Linux server. Unlike single-threaded [Snort IDS][8], Suricata can easily benefit from multi-core/many-core hardware with multi-threading. There is great deal of customization in Suricata to maximize its performance and detection coverage. Suricata folks maintain [online Wiki][9] quite well, so I strongly recommend you check it out if you want to deploy Suricata in your environment. - -Are you currently using Suricata? If so, feel free to share your experience. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/install-suricata-intrusion-detection-system-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]:http://suricata-ids.org/ -[2]:https://www.bro.org/ -[3]:http://suricata-ids.org/download/ -[4]:http://rules.emergingthreats.net/ -[5]:http://xmodulo.com/run-program-process-specific-cpu-cores-linux.html -[6]:https://redmine.openinfosecfoundation.org/projects/suricata/wiki/Runmodes -[7]:http://ask.xmodulo.com/view-threads-process-linux.html -[8]:http://xmodulo.com/how-to-compile-and-install-snort-from-source-code-on-ubuntu.html -[9]:https://redmine.openinfosecfoundation.org/projects/suricata/wiki diff --git a/translated/tech/20150906 How to install Suricata intrusion detection system on Linux.md b/translated/tech/20150906 How to install Suricata intrusion detection system on Linux.md new file mode 100644 index 0000000000..b92f69df82 --- /dev/null +++ b/translated/tech/20150906 How to install Suricata intrusion detection system on Linux.md @@ -0,0 +1,203 @@ +如何在Linux系统上安装Suricata入侵检测系统 +================================================================================ + +随着安全威胁的不断发生,入侵检测系统(IDS)在如今的数据中心环境中显得尤为必要。然而,随着越来越多的服务器将他们的网卡升级到10GB/40GB网络,对如此线路上的硬件进行计算密集型的入侵检测越来越困难。其中一种扩展入侵检测系统性能的途径是**多线程入侵检测系统**,它将CPU密集型的深度包检测工作并行的分配给多个并发任务来完成。这样的并行检测可以充分利用多核硬件的优势来轻松扩展入侵检测系统的吞吐量。在这方面有两个知名的开源项目,分别是[Suricata][1] 和 [Bro][2]。 + +这个教程里,我会向大家演示**如何在Linux服务器上安装和配置Suricata入侵检测系统** + +### 在Linux上安装Suricata IDS ### + +让我们从源文件来构建 Suricata,但在此之前,需要按如下所示安装几个依赖包先。 + +#### 在Debian, Ubuntu 或者 Linux Mint 操作系统上安装依赖包 #### + + $ sudo apt-get install wget build-essential libpcre3-dev libpcre3-dbg automake autoconf libtool libpcap-dev libnet1-dev libyaml-dev zlib1g-dev libcap-ng-dev libjansson-dev + +#### 在CentOS, Fedora 或者 RHEL 操作系统上安装依赖包 #### + + $ sudo yum install wget libpcap-devel libnet-devel pcre-devel gcc-c++ automake autoconf libtool make libyaml-devel zlib-devel file-devel jansson-devel nss-devel + +一旦将所有依赖包安装完毕,我们就可以继续安装 Suricata 了。 + + +首先从 [http://suricata-ids.org/download/][3] 下载 Suricata 源代码,然后构建它。撰写这篇文章的时候,其最新版本号为 2.0.8 。 + + $ wget http://www.openinfosecfoundation.org/download/suricata-2.0.8.tar.gz + $ tar -xvf suricata-2.0.8.tar.gz + $ cd suricata-2.0.8 + $ ./configure --sysconfdir=/etc --localstatedir=/var + +以下是配置信息的样例。 + + Suricata Configuration: + AF_PACKET support: yes + PF_RING support: no + NFQueue support: no + NFLOG support: no + IPFW support: no + DAG enabled: no + Napatech enabled: no + Unix socket enabled: yes + Detection enabled: yes + + libnss support: yes + libnspr support: yes + libjansson support: yes + Prelude support: no + PCRE jit: yes + LUA support: no + libluajit: no + libgeoip: no + Non-bundled htp: no + Old barnyard2 support: no + CUDA enabled: no + +现在可以编译、安装了。 + + $ make + $ sudo make install + +Suricata 源代码带有默认的配置文件。按照如下方法安装这些默认配置文件即可。 + + $ sudo make install-conf + +正如你所料,如果没有IDS规则集的话,Suricata 毛用没有。幸好 Makefile 为我们提供了 IDS 规则集的安装选项。安装方法如下。 + + + $ sudo make install-rules + +以上的规则安装命令会从 [EmergingThreats.net][4] 上下载可用的现存社区规则集快照,并且将其存储在 /etc/suricata/rules 目录下。 + +![](https://farm1.staticflickr.com/691/20482669553_8b67632277_c.jpg) + +### 首次配置 Suricata IDS ### + +现在到了配置 Suricata 的时候了。配置文件的位置是 **/etc/suricata/suricata.yaml**。参照以下命令,用文本编辑器打开这个文件。 + + $ sudo vi /etc/suricata/suricata.yaml + +文件中有一些基本的配置供你使用。 + +为"default-log-dir"关键字指定Suricata日至文件所在的位置。 + + default-log-dir: /var/log/suricata/ + +在"vars"部分下方,你会发现几项对 Suricata 来说很重要变量。"HOME_NET"变量需要指定 Suricata 检查的网络。被分配给 EXTERNAL_NET 变量的 "!$HOME_NET" 代表除本地网络之外的其他网络。"XXX_PORTS"变量用来辨别不同服务所用到的端口号。需要注意的是无论使用什么端口,Suricata 都可以自动检测HTTP流量。所以是不是正确指定端口就显得没那么重要了。 + + + vars: + HOME_NET: "[192.168.122.0/24]" + EXTERNAL_NET: "!$HOME_NET" + HTTP_PORTS: "80" + SHELLCODE_PORTS: "!80" + SSH_PORTS: 22 + +"host-os-policy" 部分用于防御利用操作系统网络栈(例如:TCP reassembly)的自身行为来逃避检测的一些知名攻击手段。作为对策,通过针对目标操作系统而对检测引擎算法进行微调,现代IDC提供了“基于目标”的检测手段。因此,如果你知道某台主机运行了什么操作系统的话,将这个信息提供给 Suricata 就可以大幅提高检测的成功率。这就是 "host-os-policy" 存在的意义。本例中,默认的IDC对策是Linux系统。如果针对某个IP地址没有指定操作系统信息,Suricata 会默认应用基于Linux系统的检测策略。当捕获到对192.168.122.0/28 和 192.168.122.155通讯时,Suricata就会应用基于Windows系统的检测策略。 + + host-os-policy: + # These are Windows machines. + windows: [192.168.122.0/28, 192.168.122.155] + bsd: [] + bsd-right: [] + old-linux: [] + # Make the default policy Linux. + linux: [0.0.0.0/0] + old-solaris: [] + solaris: ["::1"] + hpux10: [] + hpux11: [] + irix: [] + macos: [] + vista: [] + windows2k3: [] + +在 "threading" 部分下,你可以为不同的 Suricata 线程指定CPU关联。默认状态下,[CPU 关联][5] 是被禁止使用的 ("set-cpu-affinity: no"),这意味着 Suricata 会分配其线程到所有可用的CPU核心上。Suricata 会默认为每一个CPU核心创建一个检测线程。你可以通过指定 "detect-thread-ratio: N" 来调整此行为。此处会创建 N*M 个检测线程,M代表CPU核心总数。 + + threading: + set-cpu-affinity: no + detect-thread-ratio: 1.5 + +通过以上对线程的设置,Suricata会创建 1.5*M 个检测线程,M是系统的CPU核心总数。 + +如果你想对Suricata配置有更多的了解,可以去翻阅默认配置文件。里边配有有大量的注释以供你清晰理解。 + +### 使用Suricata进行入侵监控 ### + +现在是时候让 Suricata 跑起来了,但在这之前还有一个步骤需要去完成。 + +当你使用 pcap捕获模式 的时候,强烈建议关闭Suricata监听网卡上的任何的包卸载(例如 LRO/GRO)功能。这些功能会干扰包的实时捕获行为。 + +按照以下方法关闭 eth0 接口的 LRO/GRO 功能。 + + $ sudo ethtool -K eth0 gro off lro off + +这里要注意,在使用部分网卡的情况下,你会看到如下警告信息。忽略它们就行了,这些信息只不过告诉你你的网卡不支持LRO功能而已。 + + Cannot change large-receive-offload + +Suricata 支持许多运行模式。运行模式决定着IDC会使用何种线程。以下命令可以查看所有 [可用的运行模式][6]。 + + $ sudo /usr/local/bin/suricata --list-runmodes + +![](https://farm6.staticflickr.com/5730/20481140934_25080d04d7_c.jpg) + + +Suricata 使用的默认运行模式是autofp("auto flow pinned load balancing"==“自动流绑定负载均衡” 的缩写)。这个模式下,来自某一个流的包会被分配到一个单独的检测线程中。这些流会根据未被处理的包的最低数量来分配相应的线程。 + +最后,让我们将 Suricata 运行起来,看看它表现如何。 + + $ sudo /usr/local/bin/suricata -c /etc/suricata/suricata.yaml -i eth0 --init-errors-fatal + +![](https://farm1.staticflickr.com/701/21077552366_c577746e36_c.jpg) + +本例中,我们在一个8核心系统中监控eth0网络接口。如上所示,Suricata 创建了13个包处理线程和3个管理线程。包处理线程中包括一个PCAP包捕获线程,12个检测线程(由8*1.5得出)。这表示IDS内的1个包捕获线程均衡负载到12个检测线程中。管理线程包括1个流管理和2个计数/统计相关线程。 + +Here is a thread-view of Suricata process (plotted by [htop][7]). +以下是一个关于Suricata处理的线程截图(由 [htop][7] 绘制)。 + +![](https://farm6.staticflickr.com/5775/20482669593_174f8f41cb_c.jpg) + +Suricata检测日志存储在 /var/log/suricata 目录下。 + + $ tail -f /var/log/suricata/fast.log + +---------- + + 04/01/2015-15:47:12.559075 [**] [1:2200074:1] SURICATA TCPv4 invalid checksum [**] [Classification: (null)] [Priority: 3] {TCP} 172.16.253.158:22 -> 172.16.253.1:46997 + 04/01/2015-15:49:06.565901 [**] [1:2200074:1] SURICATA TCPv4 invalid checksum [**] [Classification: (null)] [Priority: 3] {TCP} 172.16.253.158:22 -> 172.16.253.1:46317 + 04/01/2015-15:49:06.566759 [**] [1:2200074:1] SURICATA TCPv4 invalid checksum [**] [Classification: (null)] [Priority: 3] {TCP} 172.16.253.158:22 -> 172.16.253.1:46317 + +日志也可以提供Json格式,被当做引用实例去使用: + + $ tail -f /var/log/suricata/eve.json + +---------- + {"timestamp":"2015-04-01T15:49:06.565901","event_type":"alert","src_ip":"172.16.253.158","src_port":22,"dest_ip":"172.16.253.1","dest_port":46317,"proto":"TCP","alert":{"action":"allowed","gid":1,"signature_id":2200074,"rev":1,"signature":"SURICATA TCPv4 invalid checksum","category":"","severity":3}} + {"timestamp":"2015-04-01T15:49:06.566759","event_type":"alert","src_ip":"172.16.253.158","src_port":22,"dest_ip":"172.16.253.1","dest_port":46317,"proto":"TCP","alert":{"action":"allowed","gid":1,"signature_id":2200074,"rev":1,"signature":"SURICATA TCPv4 invalid checksum","category":"","severity":3}} + +### 总结 ### + +这篇教程中,我为大家演示了如何在一台多核Linux服务器上安装Suricata入侵检测系统。不同于单线程的 [Snort IDS][8] ,Suricata 可以很容易的从多核硬件的多进程特性所带来的红利中获益。定制Suricata来最大化其效能和检测范围是一个很好的主意。Suricata的粉丝们维护着一个 [在线 Wiki][9],如果你打算将Suricata部署到你的环境中,我强烈建议你去那儿取取经。 + +如果你现在已经开始使用Suricata了的话,把你的经验也分享出来吧。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/install-suricata-intrusion-detection-system-linux.html + +作者:[Dan Nanni][a] +译者:[译者ID](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/nanni +[1]:http://suricata-ids.org/ +[2]:https://www.bro.org/ +[3]:http://suricata-ids.org/download/ +[4]:http://rules.emergingthreats.net/ +[5]:http://xmodulo.com/run-program-process-specific-cpu-cores-linux.html +[6]:https://redmine.openinfosecfoundation.org/projects/suricata/wiki/Runmodes +[7]:http://ask.xmodulo.com/view-threads-process-linux.html +[8]:http://xmodulo.com/how-to-compile-and-install-snort-from-source-code-on-ubuntu.html +[9]:https://redmine.openinfosecfoundation.org/projects/suricata/wiki From ab449052bcd01fe412259008ccd216b6614a4f59 Mon Sep 17 00:00:00 2001 From: Ping Date: Wed, 20 Jan 2016 15:41:17 +0800 Subject: [PATCH 0246/1469] add my nick-name --- ...w to install Suricata intrusion detection system on Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20150906 How to install Suricata intrusion detection system on Linux.md b/translated/tech/20150906 How to install Suricata intrusion detection system on Linux.md index b92f69df82..0eab03088c 100644 --- a/translated/tech/20150906 How to install Suricata intrusion detection system on Linux.md +++ b/translated/tech/20150906 How to install Suricata intrusion detection system on Linux.md @@ -186,7 +186,7 @@ Suricata检测日志存储在 /var/log/suricata 目录下。 via: http://xmodulo.com/install-suricata-intrusion-detection-system-linux.html 作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/mr-ping) +译者:[mr-ping](https://github.com/mr-ping) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 235fbb22136983daa5255cc0c347d426937c8d76 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 20 Jan 2016 20:34:06 +0800 Subject: [PATCH 0247/1469] PUB:20151223 What' s the Best File System for My Linux Install MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @icecoobe 翻译的不错 --- ...e Best File System for My Linux Install.md | 97 +++++++++++++++++++ ...e Best File System for My Linux Install.md | 96 ------------------ 2 files changed, 97 insertions(+), 96 deletions(-) create mode 100644 published/20151223 What' s the Best File System for My Linux Install.md delete mode 100644 translated/talk/20151223 What' s the Best File System for My Linux Install.md diff --git a/published/20151223 What' s the Best File System for My Linux Install.md b/published/20151223 What' s the Best File System for My Linux Install.md new file mode 100644 index 0000000000..6bb9dcd898 --- /dev/null +++ b/published/20151223 What' s the Best File System for My Linux Install.md @@ -0,0 +1,97 @@ +哪个文件系统最适合你的 Linux 系统? +================================================================================ + +![](https://www.maketecheasier.com/assets/uploads/2015/05/file-systems-feature-image.jpg) + +文件系统: 它们不是世界上最激动人心的技术,但是仍然很重要。本文我们将细数那些流行的 Linux 文件系统 - 它们是什么,它们能够做什么,以及它们的目标用户。 + +### Ext4 ### + +![file-systems-ext4](https://www.maketecheasier.com/assets/uploads/2015/05/file-systems-ext4.png) + +如果你曾经安装过 Linux,你可能在安装过程中看到过“Ext4”字样。用它有一个不错的理由: 它是当前每个可用的 Linux 发行版所选择的文件系统。当然,还有其他的一些选择,但是不可否认的是,Ext4(Extended 4)几乎是所有 Linux 用户都会选择的文件系统。 + +#### 它能做什么? #### + +Ext4 拥有之前的文件系统(Ext2/Ext3)中你所期待的所有优点, 同时还带来了一些改进。还有很多内容可以发掘,这里列举出了 Ext4 为你带来的最好的部分: + +- 日志型文件系统 +- 日志校验 +- 多重块文件分配 +- 向后兼容 Ext2 && Ext3 +- 持续的空闲空间预分配 +- 改进的文件系统校验(相比于之前的版本) +- 当然,同时支持更大的文件 + +#### 目标用户 #### + +Ext4 针对那些寻找超级可靠的基础环境或者那些只需要能工作就行的用户。这个文件系统不会对你的系统做快照;它甚至没有最好的 SSD 支持,但是如果你不是太挑剔的话,你会觉得它也还不错。 + +### BtrFS ### + +![file-systems-btrFS](https://www.maketecheasier.com/assets/uploads/2015/05/file-systems-btrFS-e1450065697580.png) + +B 树(B-tree)文件系统 (也被当做是 butterFS,黄油文件系统) 是 Oracle 为 Linux 研发的一款文件系统。它是一个全新的文件系统,而且正处于主要开发阶段。Linux 社区认为其有时候使用上还有些不稳定。BtrFS 的核心原则是围绕着写时复制(copy-on-write)原则展开的。**写时复制**基本上意味着在写入数据完成前,这份数据的每一比特都有单独的一份副本。当数据写入完毕后,相当于它做了一份副本。 + +#### 它能做什么 #### + +除了支持写时复制之外,BtrFS 也能够胜任许多其他的事务 - 事实上,它可以一直列出各种特性。这里列举最值得一提的特性:支持只读快照、文件克隆、子卷、透明压缩、离线文件系统校验、从 ext3 & 4 原地转换到 BtrFS、在线碎片整理,还支持 RAID 0, RAID 1, RAID 5, RAID 6 和 RAID 10。 + +#### 目标用户 #### + +BtrFS 的开发者们许诺过,该文件系统是当前其他文件系统的新一代替代者。非常正确,虽然目前其处于开发中。它有很多面向高级用户的杀手级特性,对于基本用户也是这样(包括 SSD 上面的更佳性能)。这个文件系统针对那些想要从文件系统中获取更多(特性),以及那些想尝试用写时复制机制做一些事情的用户。 + +### XFS ### + +![file-systems-xfs](https://www.maketecheasier.com/assets/uploads/2015/05/file-systems-xfs.jpg) + +由 Silicon Graphics 公司创造开发,XFS 是一个高端文件系统,定位于速度和性能方面。处于对性能方面的专注,使得在并行 IO 方面,XFS 表现的尤其出色。XFS 文件系统能够处理数量庞大的数据,事实上某些 XFS 用户的数据接近300TB 以上。 + +#### 它能做什么 #### + +XFS 是一个经历良好测试的数据存储文件系统,它是为了高性能操作而诞生的。其特性包括: + +- RAID 阵列的条带化分配 +- 日志型文件系统 +- 块大小可变 +- 直接 I/O +- 指定速率(guaranteed-rate) I/O +- 快照 +- 在线碎片整理 +- 在线调整文件系统大小 + +#### 目标用户 #### + +XFS 针对那些想要一个坚如磐石的文件系统方案的用户。它始于1993年,并且随着时间的变迁它变得越来越好。如果你有一台家庭服务器,而且你苦恼于如何部署存储环境,那么可以考虑下 XFS。它拥有的众多特性(比如快照)能够有助于你的文件存储系统。尽管如此,它不局限于服务器端。如果你是一个相对高级一点的用户或者你对 BtrFS 所承诺的很多特性感兴趣的话,尝试一下 XFS。它实现了很多与 BtrFS 相似的特性,并且没有稳定性方面的问题。 + +### Reiser4 ### + +![file-system-riser4](https://www.maketecheasier.com/assets/uploads/2015/05/file-system-riser4.gif) + +Reiser4 是 ReiserFS 的继任者,由 Namesys 公司创造研发。它的诞生可以追溯到 Linspire 项目和 DARPA。它与众不同的地方在于众多的事务模式。并不止于单一的一种写入数据的方式;取而代之的是,有很多方式(来写入)。 + +#### 它能做什么 #### + +Reiser4 拥有着使用多种不同事务模式的独特能力。它能够使用写时复制模式 (像 BtrFS),任意位置写入(write-anywhere),日志,以及混合事务模式。它在 ReiserFS 的基础上做了许多的改进,包括更好的基于漫游日志的文件系统日志,对较小文件的支持更好,以及更快速的目录处理。Reiser4 提供了许多功能特性。还有更多的特性可以探讨,不过简单来讲,相比于 ReiserFS 它不但做了非常大的改进,而且增加了众多特性。 + +#### 目标用户 #### + +Resier4 适合那些想要将一个文件系统应用到多种场景下的用户。可能你想在一台机器上使用写时复制机制,在另一台机器上使用任意位置写入机制,还会在另一台机器上使用混合事务,而你又不希望使用多种不同类型的文件系统来完成这项任务。Reiser4 是适合这种情况的完美方案。 + +### 结论 ### + +Linux 上有许多可用的文件系统。每个文件系统都有其特定的用途,以便于特定用户解决不同的问题。本文的焦点集中在 Linux 平台上文件系统的主流选择。毫无疑问,其它的场景下还有一些别的选择。 + +你在 Linux 上最喜欢的文件系统是什么?在下面的评论区告诉我们吧! + +-------------------------------------------------------------------------------- + +via: https://www.maketecheasier.com/best-file-system-linux/ + +作者:[Derrik Diener][a] +译者:[icecoobe](https://github.com/icecoobe) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.maketecheasier.com/author/derrikdiener/ diff --git a/translated/talk/20151223 What' s the Best File System for My Linux Install.md b/translated/talk/20151223 What' s the Best File System for My Linux Install.md deleted file mode 100644 index 2d093cb83f..0000000000 --- a/translated/talk/20151223 What' s the Best File System for My Linux Install.md +++ /dev/null @@ -1,96 +0,0 @@ - -我的Linux系统应该安装的最好的文件系统是什么? -================================================================================ -![](https://www.maketecheasier.com/assets/uploads/2015/05/file-systems-feature-image.jpg) - -文件系统: 它们不是世界上最激动人心的技术,但是仍然很重要。本文我们将细数那些流行的Linux文件系统 - 它们是什么,它们能够做什么,以及它们的目标用户。 - -### Ext4 ### - -![file-systems-ext4](https://www.maketecheasier.com/assets/uploads/2015/05/file-systems-ext4.png) - -如果你曾经安装过Linux,你可能在安装过程中看到过"Ext4"字样。关于这个有一个不错的理由: 它是当前每个可用Linux发行版所选择的文件系统。当然,还有其他的一些选择,但是不可否认的是,Ext4(Extended 4)几乎是所有Linux用户都会选择的文件系统。 - -#### 它能做什么? #### - -Ext4拥有你预期的曾经的文件系统(Ext2/Ext3)的所有优点, 同时还带来了一些改进。还有很多内容可以发掘,这里列举出Ext4为你带来的最好的部分: - -- 文件系统日志 -- 日志校验 -- 多重块文件的分配 -- 对Ext2 && Ext3向后兼容 -- 持续的预分配空闲空间 -- 改进的文件系统校验(相比于之前的版本) -- 当然,同时支持更大的文件 - -#### 目标用户 #### - -Ext4针对那些寻找超级可靠的构建环境或者那些仅仅需要可用环境的用户。这个文件系统不会对你的系统做快照;它甚至没有最好的SSD支持,但是如果你的要求不是太过严格的话,你会觉得它也还不错。 - -### BtrFS ### - -![file-systems-btrFS](https://www.maketecheasier.com/assets/uploads/2015/05/file-systems-btrFS-e1450065697580.png) - -B树(B-tree)文件系统 (也被认为是butterFS,黄油文件系统) 是Oracle为Linux研发的一款文件系统。它是一个全新的文件系统,而且正处于重度开发阶段。Linux社区认为其目前使用上还有些不稳定。BtrFS的核心原则是基于写时复制(copy-on-write). **写时复制**基本上意味着在写入数据前,这份数据的每一比特都有单独的一份副本。当数据写入完毕后,它相应的副本也随之生成。 - -#### 它能做什么 #### - -除了支持写时复制之外,BtrFS也能够胜任许多其他的事务 - 事实上,如此多的事务支持以致于它能永久列出一切(数据)。这里列举最值得一提的特性:支持只读快照,文件克隆,子卷,透明压缩,离线文件系统校验,无缝地从ext3&&4转换到BtrFS,在线碎片整理,还支持RAID 0, RAID 1, RAID 5, RAID 6 and RAID 10。 - -#### 目标用户 #### - -BtrFS的开发者门许诺过,该文件系统是当前其他文件系统的新一代替代者。非常正确,虽然目前其处于开发中。它有很多杀手级的特性面向高级用户,也包括基本用户 (包括SSDs上面的表现)。这个文件系统针对那些想要从文件系统中获取更多(特性),以及那些想尝试用写时复制机制做一些事情的用户。 - -### XFS ### - -![file-systems-xfs](https://www.maketecheasier.com/assets/uploads/2015/05/file-systems-xfs.jpg) - -由Silicon Graphics公司创造开发,XFS是一个高端文件系统,定位于速度和性能。对于性能方面的专注,使得在并行输入输出方面,XFS表现的尤其出色。XFS文件系统能够处理数量庞大的数据,事实上某些XFS用户的数据接近300+TB。 - -#### 它能做什么 #### - -XFS是一个经历良好测试的数据存储文件系统,它是为了高性能操作而诞生的。其特性包括: - -- RAID阵列的条纹(striped)模式分配 -- 文件系统日志 -- 多种块大小 -- 直接I/O -- 指定速率(guaranteed-rate)I/O -- 快照 -- 在线碎片整理 -- 在线调整大小 - -#### 目标用户 #### - -XFS针对那些想要一个坚如磐石的文件系统方案的用户。它起源于1993年,并且随着时间的变迁它变得越来越好。如果你有一台家庭服务器,而且你苦恼于如何部署存储环境,那么可以考虑下XFS。它拥有的众多特性(比如快照)能够协助你的文件存储系统。尽管如此,它不局限于服务器端。如果你是一个相对高级一点的用户或者你对BtrFS所承诺的很多特性感兴趣的话,尝试一下XFS。它实现了很多与BtrFS相似的特性,并且没有稳定性方面的问题。 - -### Reiser4 ### - -![file-system-riser4](https://www.maketecheasier.com/assets/uploads/2015/05/file-system-riser4.gif) - -Reiser4,ReiserFS的继任者,由Namesys公司创造研发。它的诞生追溯到Linspire工程和DARPA。它与众不同的地方在于众多的事务模式。没有一个单一的方式来写入数据;取而代之的是,有很多方式(来写入)。 - -#### 它能做什么 #### - -Reiser4拥有着使用多种不同事务模式的独特能力。它能够使用写时复制模式 (像BtrFS),任意位置写入(write-anywhere),日志,以及超级事务模式。它在ReiserFS的基础上做了许多的改进,包括更好的基于漫游日志的文件系统日志,对更小的文件较好的支持,以及更快速的目录处理。Reiser4提供了许多功能特性。还有更多的特性可以探讨,不过简单来讲,相比于ReiserFS它对众多新增特性做了非常大的改进。 - -#### 目标用户 #### - -Resier4适合那些想要将一个文件系统应用到多中场景下的用户。可能你想在一台机器上使用copy-on-write机制,在另一台机器上使用write-anywhere机制,还会在另一台机器上使用超级事务,而你又不希望使用多种不同类型的文件系统来完成这项任务。Reiser4是适合这种情况的完美方案。 - -### 结论 ### - -Linux上有许多可用的文件系统。每个文件系统都有其特定的用途,以便于特定用户解决不同的问题。本文的焦点集中在平台上文件系统的主流的选择。毫无疑问,其它的场景下还有一些别的选择。 - -你在Linux上最喜欢的文件系统是什么?在下面(的评论区)告诉我们吧! --------------------------------------------------------------------------------- - -via: https://www.maketecheasier.com/best-file-system-linux/ - -作者:[Derrik Diener][a] -译者:[icecoobe](https://github.com/icecoobe) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.maketecheasier.com/author/derrikdiener/ From b6282e980e73935b2c237da88c5b9a67a04bbd66 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 20 Jan 2016 21:01:56 +0800 Subject: [PATCH 0248/1469] PUB:Learn with Linux--Two Geography Apps @bazz2 --- .../Learn with Linux--Learning Music.md | 35 ++++++++++--------- .../Learn with Linux--Two Geography Apps.md | 22 ++++++------ 2 files changed, 29 insertions(+), 28 deletions(-) rename {translated/tech/Learn with Linux => published}/Learn with Linux--Learning Music.md (82%) rename {translated/tech/Learn with Linux => published}/Learn with Linux--Two Geography Apps.md (89%) diff --git a/translated/tech/Learn with Linux/Learn with Linux--Learning Music.md b/published/Learn with Linux--Learning Music.md similarity index 82% rename from translated/tech/Learn with Linux/Learn with Linux--Learning Music.md rename to published/Learn with Linux--Learning Music.md index c732344a19..83f522bfba 100644 --- a/translated/tech/Learn with Linux/Learn with Linux--Learning Music.md +++ b/published/Learn with Linux--Learning Music.md @@ -1,22 +1,22 @@ -Linux 教学之教你玩音乐 +与 Linux 一起学习:玩音乐 ================================================================================ ![](https://www.maketecheasier.com/assets/uploads/2015/07/learnmusic-featured.png) -[Linux 学习系列][1]的所有文章: +[与 Linux 一起学习:][1]的所有文章: -- [Linux 教学之教你练打字][2] -- [Linux 教学之物理模拟][3] -- [Linux 教学之教你玩音乐][4] -- [Linux 教学之两款地理软件][5] -- [Linux 教学之掌握数学][6] +- [与 Linux 一起学习:学习打字][2] +- [与 Linux 一起学习:物理模拟][3] +- [与 Linux 一起学习:玩音乐][4] +- [与 Linux 一起学习:两款地理软件][5] +- [与 Linux 一起学习:掌握数学][6] -引言:Linux 提供大量的教学软件和工具,面向各个年级段以及年龄段,提供大量学科的练习实践,其中大多数是可以与用户进行交互的。本“Linux 教学”系列就来介绍一些教学软件。 +引言:Linux 提供大量的教学软件和工具,面向各个年级段以及不同年龄段,提供大量学科的练习实践,其中大多数是可以与用户进行交互的。本“与 Linux 一起学习:”系列就来介绍一些教学软件。 -学习音乐是一个很好的消遣方式。训练你的耳朵能识别音阶与和弦、掌握一门乐器、控制自己的嗓音,这些都需要大量的练习,以及会遇到很多困难。音乐理论非常博大精深,有太多东西需要记忆,你需要非常勤奋才能讲这些东西变成你的“技术”。在你的音乐之路上,Linux 提供了杰出的软件来帮助你前行。它们不能让你立刻成为一个音乐家,但可以作为一个降低学习难度的好助手。 +学习音乐是一个很好的消遣方式。训练你的耳朵能识别音阶与和弦、掌握一门乐器、控制自己的嗓音,这些都需要大量的练习,以及会遇到很多困难。音乐理论非常博大精深,有太多东西需要记忆,你需要非常勤奋才能将这些东西变成你的“技术”。在你的音乐之路上,Linux 提供了杰出的软件来帮助你前行。它们不能让你立刻成为一个音乐家,但可以作为一个降低学习难度的好助手。 ### Gnu Solfège ### -[Solfège][7] 是一个世界流行的音乐教学工具,适用于各个级别的音乐教育。很多流行的教学方法(比如著名的柯达伊教学法)就使用 Solfège 作为它们的基础。相比于学到音乐知识,Solfège 更关注于让用户不断练习音乐。它假想的用户是那些已经有一些音乐基础,并且想不断练习音乐技巧的学生。 +[Solfège][7] 是一个世界流行的音乐教学工具,适用于各个级别的音乐教育。很多流行的教学方法(比如著名的柯达伊教学法)就使用 Solfège 作为它们的基础。相比于学到音乐知识,Solfège 更关注于让用户不断练习音乐。它预期的用户是那些已经有一些音乐基础,并且想不断练习音乐技巧的学生。 以下是 GNU 网站的开发者声明: @@ -24,7 +24,7 @@ Linux 教学之教你玩音乐 这款软件兑现了它的承诺,你可以在试听帮手的帮助下练习几乎所有音乐技巧。 -Debian 和 Ubuntu 的远端库上有这款软件,在终端运行下面命令安装软件: +Debian 和 Ubuntu 的仓库上有这款软件,在终端运行下面命令安装软件: sudo apt-get install solfege @@ -78,9 +78,9 @@ Tete 只有一个简单的界面,所有内容都在这里了。 ### JalMus ### -Jalmus 是用 JAVA 写的键盘音符阅读训练器。可以外接 MIDI 键盘,也可以使用虚拟键盘。它提供很多简单的课程练习来训练你的音符阅读能力。这个软件在2013年之后就不再更新了,但还是比较实用的。 +Jalmus 是用 JAVA 写的键盘音符阅读训练器。可以外接 MIDI 键盘,也可以使用虚拟键盘。它提供很多简单的课程练习来训练你的音符阅读能力。虽然这个软件在2013年之后就不再更新了,但还是比较实用的。 -进入[sourceforge 页面][11]下载最后版本(v2.3)的 JAVA 安装器,或者在终端输入下面的命令下载: +进入 [sourceforge 页面][11]下载最后版本(v2.3)的 JAVA 安装器,或者在终端输入下面的命令下载: wget http://garr.dl.sourceforge.net/project/jalmus/Jalmus-2.3/installjalmus23.jar @@ -102,11 +102,11 @@ Jalmus 的主界面非常朴素。 ![learnmusic-jalmus-multinote](https://www.maketecheasier.com/assets/uploads/2015/07/learnmusic-jalmus-multinote.png) -Jalmus 也包含一些训练,内容和课程相似,只是没有那些视觉上的提示了。当完成训练后,屏幕上会显示你的乐谱。它还提供不同难度的节拍训练,你能听到看到这些训练里面播放的旋律。在多行乐谱同时播放时,一个节拍器(能听见能看见)可以帮你理解 +Jalmus 也包含一些阅读单个音符的训练,内容和课程相似,只是没有那些视觉上的提示了。当完成训练后,屏幕上会显示你的乐谱。它还提供不同难度的节拍训练,你能听到并看到这些训练里面播放的节拍。在多行乐谱同时播放时,一个节拍器(能听见能看见)可以帮你理解 ![learnmusic-jalmus-rhythm](https://www.maketecheasier.com/assets/uploads/2015/07/learnmusic-jalmus-rhythm.png) -和阅读乐谱。(LCTT 写给王老板的话:我特么实在编不下去了,这段你得帮我改改。) +和阅读乐谱。 ![learnmusic-jalmus-score](https://www.maketecheasier.com/assets/uploads/2015/07/learnmusic-jalmus-score.png) @@ -121,11 +121,12 @@ Jalmus 也包含一些训练,内容和课程相似,只是没有那些视觉 对于吉他练习者,[TuxGuitar][12] 看起来很像 Windows 下面的 Guitar Pro 软件(它也可以读 Guitar Pro 格式的文件)。 #### PianoBooster #### + [Piano Booster][13] 可以练习钢琴技巧,它能播放 MIDI 文件,你可以使用外接键盘来弹钢琴,同时还能查看屏幕上滑过的乐谱。 ### 总结 ### -Linux 提供很多优秀的工具供你学习,如果你对音乐感兴趣,你完全不用担心没有软件能帮你练习音乐技术。实际上,可供学习音乐的学生选择的优秀软件数量远比上面介绍的要多。如果你还知道其他的音乐训练软件,请在写下你的评论,让我们能够知道。 +Linux 提供很多优秀的工具供你学习,如果你对音乐感兴趣,你完全不用担心没有帮你练习音乐技术的软件。实际上,可供学习音乐的学生选择的优秀软件数量远比上面介绍的要多。如果你还知道其他的音乐训练软件,请在写下你的评论,让我们能够知道。 -------------------------------------------------------------------------------- @@ -133,7 +134,7 @@ via: https://www.maketecheasier.com/linux-learning-music/ 作者:[Attila Orosz][a] 译者:[bazz2](https://github.com/bazz2) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/translated/tech/Learn with Linux/Learn with Linux--Two Geography Apps.md b/published/Learn with Linux--Two Geography Apps.md similarity index 89% rename from translated/tech/Learn with Linux/Learn with Linux--Two Geography Apps.md rename to published/Learn with Linux--Two Geography Apps.md index 8ce6b052af..bdbcb36a42 100644 --- a/translated/tech/Learn with Linux/Learn with Linux--Two Geography Apps.md +++ b/published/Learn with Linux--Two Geography Apps.md @@ -1,16 +1,16 @@ -Linux 教学之两款地理软件 +与 Linux 一起学习:学习地理 ================================================================================ ![](https://www.maketecheasier.com/assets/uploads/2015/07/learn-geography-featured.png) -[Linux 学习系列][1]的所有文章: +[与 Linux 一起学习][1]的所有文章: -- [Linux 教学之教你练打字][2] -- [Linux 教学之物理模拟][3] -- [Linux 教学之教你玩音乐][4] -- [Linux 教学之两款地理软件][5] -- [Linux 教学之掌握数学][6] +- [与 Linux 一起学习:学习打字][2] +- [与 Linux 一起学习:物理模拟][3] +- [与 Linux 一起学习:玩音乐][4] +- [与 Linux 一起学习:学习地理][5] +- [与 Linux 一起学习:掌握数学][6] -引言:Linux 提供大量的教学软件和工具,面向各个年级段以及年龄段,提供大量学科的练习实践,其中大多数是可以与用户进行交互的。本“Linux 教学”系列就来介绍一些教学软件。 +引言:Linux 提供大量的教学软件和工具,面向各个年级段以及各个年龄段,提供大量学科的练习实践,其中大多数是可以与用户进行交互的。本“与 Linux 一起学习”系列就来介绍一些教学软件。 地理是一门有趣的学科,我们每天都能接触到,虽然可能没有意识到,但当你打开 GPS、SatNav 或谷歌地图时,你就已经在使用这些软件提供的地理数据了;当你在新闻中看到一个国家的消息或听到一些金融数据时,这些信息都可以归于地理学范畴。Linux 提供了很多学习地理学的软件,可用于教学,也可用于自学。 @@ -62,11 +62,11 @@ Marble 专注于地图绘制,它的主界面就是一张地图。 ![learn-geography-marble-history](https://www.maketecheasier.com/assets/uploads/2015/07/learn-geography-marble-history.jpg) -除了有包含不同界面和大量数据的离线地图,Marble 还提供其他信息。你可以在菜单中打开或关闭不同的离线 info-boxes +除了有包含不同界面和大量数据的离线地图,Marble 还提供其他信息。你可以在菜单中打开或关闭不同的离线信息框 ![learn-geography-marble-offline](https://www.maketecheasier.com/assets/uploads/2015/07/learn-geography-marble-offline.png) -和在线的 online services。 +和在线服务。 ![learn-geography-marble-online](https://www.maketecheasier.com/assets/uploads/2015/07/learn-geography-marble-online.png) @@ -86,7 +86,7 @@ via: https://www.maketecheasier.com/linux-geography-apps/ 作者:[Attila Orosz][a] 译者:[bazz2](https://github.com/bazz2) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d82e137209072bd1754f483d6f4059730d020b9d Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 20 Jan 2016 23:25:42 +0800 Subject: [PATCH 0249/1469] PUB:20151206 NetworkManager and privacy in the IPv6 internet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @itsang 翻译的很好 --- ...anager and privacy in the IPv6 internet.md | 56 +++++++++++++++++++ ...anager and privacy in the IPv6 internet.md | 54 ------------------ 2 files changed, 56 insertions(+), 54 deletions(-) create mode 100644 published/20151206 NetworkManager and privacy in the IPv6 internet.md delete mode 100644 translated/tech/20151206 NetworkManager and privacy in the IPv6 internet.md diff --git a/published/20151206 NetworkManager and privacy in the IPv6 internet.md b/published/20151206 NetworkManager and privacy in the IPv6 internet.md new file mode 100644 index 0000000000..b20c8d93bf --- /dev/null +++ b/published/20151206 NetworkManager and privacy in the IPv6 internet.md @@ -0,0 +1,56 @@ +IPv6 互联网中的隐私保护和网络管理器 +============================== + +IPv6 的使用量正在不断增加,让我们始料未及的是,伴随这个协议不断增加的使用量,大量的隐私问题涌现出来。互联网社区在积极发布相关解决方案。当前状况是怎样的呢?网络管理器(NetworkManager)又是如何跟上的呢?让我们来瞧瞧吧! + +![](https://blogs.gnome.org/lkundrak/files/2015/12/cameras1.jpg) + +## 通过 IPv6 方式连接的主机的特性 + +启用了 IPv6 的节点(LCTT 译注:节点在网络中指一个联网的设备)并不需要类似 IPv4 网络中 [DHCP](https://tools.ietf.org/html/rfc2132) 服务器的中央机构来配置他们的地址。它们发现(discover)自己所在的网络,然后通过生成主机部分来[自主生成地址](https://tools.ietf.org/html/rfc4862)。这种方式使得网络配置更加简单,并且能够更好的扩展到更大规模的网络。然而,这种方式也有一些缺点。首先,这个节点需要确保它的地址不会和网络上其他节点冲突。其次,如果这个节点在进入的每一个网络中使用相同的主机部分,它的运动就可以被追踪,如此一来,隐私便处于危险之中。 + +负责制定因特网标准的组织 Internet 工程任务组(Internet Engineering Task Force,IETF)[意识到了这个问题](https://tools.ietf.org/html/draft-iesg-serno-privacy-00),这个组织建议取消使用硬件序列号来识别网络上的节点。 + +但实际的实施情况是怎样的呢? + +地址唯一性问题可以通过[重复地址检测(Duplicate Address Detection, DAD)](https://tools.ietf.org/html/rfc4862#section-5.4)机制来解决。当节点为自身创建地址的时候,它首先通过[邻居发现协议(Neighbor Discovery Protocol)](https://tools.ietf.org/html/rfc4861)(一种不同于 IPv4 [ARP](https://tools.ietf.org/html/rfc826)协议的机制)来检查另一个节点是否使用了相同的地址。当它发现地址已经被使用,它必须抛弃掉这个地址。 + +解决另一个问题——隐私问题,有一点困难。一个 IP 地址(无论 IPv4 或 IPv6)由网络部分和主机部分组成(LCTT 译注:网络部分用来划分子网,主机部分用来从相应子网中找到具体的主机)。主机查找出相关的地址的网络部分,并且生成地址的主机部分。传统上它只使用了源自网络硬件(MAC)地址的接口识别器(Interface Identifier)。MAC 地址在硬件制造的时候就被设置好了,它可以唯一的识别机器。这样就确保了地址的稳定性和唯一性。这对避免地址冲突来说是件好事,但是对隐私来说一点也不好。主机部分在不同网络下保持恒定意味着机器在进入不同网络时可以被唯一的识别。这在协议制定的时候看起来无可非议,但是随着 IPv6 的流行,人们对于隐私问题的担忧也愈演愈烈。幸运的是,解决办法还是有的。 + +## 使用隐私扩展(privacy extensions) + +IPv4 的最大问题——地址枯竭,已经不是什么秘密。对 IPv6 来说,这一点不再成立,事实上,使用 IPv6 的主机能够相当大方的利用地址。多个 IPv6 地址对应一块网卡绝对没有任何不合适,正好相反,这是一种标准情形。最起码每个节点都有一个“本地连接(link-local)地址”,它被用来与同一物理链路的节点联络。当网络包含了一个连接其他网络的路由器,这个网络中的每个节点都有一个与每个直接连接的网络相联络的地址。如果主机在同一个网络有更多的地址,该节点(LCTT 译注:指路由器)将接受它们全部的传入流量。对于外发连接,它会把地址显示给远程主机,内核会挑选最适合的地址。但到底是哪一个呢? + +启用了隐私扩展,就像 [RFC4941](https://tools.ietf.org/html/rfc4941) 定义的那样,时常会生成带有随机主机部分的新地址。最新的那个被用于最新的外发连接,与此同时,那些不被使用了的旧地址将被丢弃。这是一个极好的策略——主机不会对外暴露其固定地址,因为它不用于外发连接,但它仍然会接受知道其固定地址的主机连接。 + +但这也存在美中不足之处——某些应用会把地址与用户识别绑定在一起。让我们来考虑一下这种情形,一个 web 应用在用户认证的时候生成一个 HTTP Cookie,但它只接受实施认证的地址的连接。当内核生成了一个新的临时地址,服务器会拒绝使用这个地址的请求,实际上相当于用户登出了。地址是不是建立用户认证的合适机制值得商榷,但这确实是现实中应用程序正在做的。 + +## 解救之道——隐私固定寻址(Privacy stable addressing) + +解决这个问题可能需要另辟蹊径。唯一的(当然咯)地址确实有必要,对于特定网络来说是稳定的,但当用户进入了另一个网络后仍然会变,这样的话追踪就变得几乎不可能。RFC7217 介绍了一种如上所述的机制。 + +创建隐私固定地址依赖于伪随机值,这个随机值只被主机本身知晓,它不会暴露给网络上的其他主机。这个随机值随后被一个密码安全算法加密,一起被加密的还有一些与网络连接的特定值。这些值包含:用以标识网卡的名称;网络地址;对于这个网络来说有可能的其他特殊值,例如无线网络的 SSID。使用这个安全密钥使其他主机很难预测结果地址,与此同时,当进入不同的网络时,网络的特殊数据会让地址变得不同。 + +这也巧妙的解决了地址重复问题。因为有随机值的存在,冲突也不太可能发生。万一发生了冲突,结果地址会得到重复地址检测失败的记录,这时会生成一个不同的地址而不会断开网络连接。看,这种方式很聪明吧。 + +使用隐私固定地址一点儿也不会妨碍隐私扩展。你可以在使用 RFC4941 所描述的临时地址的同时使用 [RFC7217](https://tools.ietf.org/html/rfc7217)中的固定地址。 + +## 网络管理器(NetworkManager)处于什么样的状况? + +我们已经在网络管理器1.0.4版本中实现了隐私扩展(privacy extensions)。在这个版本中,隐私扩展默认开启。你可以用 ipv6.ip6-privacy 参数来控制它。 + +在网络管理器1.2版本中,我们将会加入固定隐私寻址(stable privacy addressing)。应该指出的是,目前的隐私扩展还不符合这种需求。我们可以使用 ipv6.addr-gen-mode 参数来控制这个特性。如果它被设置成固定隐私,那么将会使用固定隐私寻址。设置成“eui64”或者干脆不设置它将会保持传统的默认寻址方式。 + +敬请期待2016年年初网络管理器1.2版本的发布吧!如果你想尝试一下最新的版本,不妨试试 Fedora Rawhide,它最终会变成 Fedora 24。 + +*我想感谢 Hannes Frederic Sowa,他给了我很有价值的反馈。如果没有他的帮助,这篇文章的作用将会逊色很多。另外,Hannes 也是 RFC7217 所描述机制的内核实现者,当网络管理器不起作用的时候,它将发挥作用。* + +-------------------------------------------------------------------------------- + +via: https://blogs.gnome.org/lkundrak/2015/12/03/networkmanager-and-privacy-in-the-ipv6-internet/ + +作者:Lubomir Rintel +译者:[itsang](https://github.com/itsang) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/translated/tech/20151206 NetworkManager and privacy in the IPv6 internet.md b/translated/tech/20151206 NetworkManager and privacy in the IPv6 internet.md deleted file mode 100644 index cfd203da33..0000000000 --- a/translated/tech/20151206 NetworkManager and privacy in the IPv6 internet.md +++ /dev/null @@ -1,54 +0,0 @@ -IPv6因特网中的隐私保护和网络管理器 -====================== - -IPv6的使用量正在不断增加,让我们始料未及的是,伴随这个协议不断增加的使用量,大量隐私问题涌现出来。互联网社区在积极发表相关解决方案,当前状况是怎样的呢?网络管理器又是如何跟上的呢?让我们来瞧瞧吧! - -![](https://blogs.gnome.org/lkundrak/files/2015/12/cameras1.jpg) - -## 通过IPv6方式连接的主机的特性 - -通过IPv6方式激活的结点(译者注:结点在网络中指一个联网的设备)不需要类似IPv4网络中[DHCP](https://tools.ietf.org/html/rfc2132)服务器的中央机构来配置他们的地址。它们发现自己所在的网络然后通过生成主机部分来[自主生成地址](https://tools.ietf.org/html/rfc2132)。这种方式使得网络配置更加简单,并且能够更好的扩展到更大规模的网络。然而,这种方式也有一些缺点。首先,这个结点需要确保它的地址不会和网络上其他结点冲突。其次,如果这个结点在进入的每一个网络中使用相同的主机部分,它的运动就可以被追踪,如此一来,隐私便处于危险之中。 - -负责制定因特网标准的组织Internet工程任务组(Internet Engineering Task Force,IETF)[意识到了这个问题](https://tools.ietf.org/html/draft-iesg-serno-privacy-00),这个组织建议取消使用硬件序列号来识别网络上的结点。 - -但实际的实施情况是怎样的呢? - -地址唯一性问题可以通过[重复地址检测(Duplicate Address Detection, DAD)](https://tools.ietf.org/html/rfc4862#section-5.4)机制来解决。当结点为自身创建地址的时候,他首先通过[邻居发现协议(Neighbor Discovery Protocol)](https://tools.ietf.org/html/rfc4861)(一种不同于IPv4 [ARP](https://tools.ietf.org/html/rfc826)协议的机制)来检查另一个结点是否使用了相同的地址。当它发现地址已经被使用,它必须抛弃掉这个地址。 - -解决另一个问题——隐私问题,有一点困难。一个IP地址(无论IPv4或IPv6)由网络部分和主机部分组成(译者注:网络部分用来划分子网,主机部分用来从相应子网中找到具体的主机)。主机查找出相关的网络部分,并且生成主机部分。传统上它只使用了源自网络硬件(MAC)地址的接口识别器。MAC地址在硬件制造的时候就被设置好了,它可以唯一的识别机器。这样就确保了地址的稳定性和唯一性。这对避免地址冲突来说是件好事,但是对隐私来说一点也不好。主机部分在不同网络下保持恒定意味着机器在进入不同网络时可以被唯一的识别。这在协议制定的时候看起来无可非议,但是随着IPv6的流行,人们对于隐私问题的担忧也愈演愈烈。幸运的是,解决办法还是有的。 - -## 进入隐私扩展 - -Pv4的最大问题——地址枯竭,已经不是什么秘密。对IPv6来说,这一点不再成立,事实上,使用IPv6的主机能够相当大方的利用地址。多个IPv6地址对应一块网卡绝对没有任何错误,正好相反,这是一种标准情形。最起码每个结点都有一个“本地连接地址”,它被用来与同一物理链路的结点联络。当网络包含了一个连接其他网络的路由器,这个网络中的每一个结点都有一个与每个直接连接网络联络的地址。如果主机在相同网络有更多的地址,结点(译者注:指路由器)将接受它们全部的传入流量。对于输出连接,它会把地址显示给远程主机,内核会挑选最适合的地址。但到底是哪一个呢? - -隐私扩展可用时,就像[RFC4941](https://tools.ietf.org/html/rfc4941)定义的那样,时常会生成带有随机主机部分的新地址。最新的那个被用于最新的输出连接,与此同时,那些不被使用了的旧地址将被丢弃。这是一个极好的窍略——当固定地址不用于输出连接的时候,主机就不会显示它,但它仍然会接受注意到它的主机的连接。 - -但这也存在美中不足之处——某些应用会把地址与用户识别绑定在一起。让我们来考虑一下这种情形,一个web应用在用户认证的时候生成一个HTTP Cookie,但它只接受实施认证的地址的连接。当内核生成了一个新的临时地址,服务器会拒绝使用这个地址的请求,实际上相当于将用户登出。地址是不是建立用户认证的合适机制值得商榷,但这确实是现实中应用程序正在做的。 - -## 解救之道——隐私固定寻址 - -解决这个问题可能需要另辟蹊径。唯一的(当然咯)地址确实有必要,对于特定网络来说是稳定的,但当用户进入了另一个网络后仍然会变,这样的话追踪就变得几乎不可能。RFC7217介绍了一种如上所述的机制。 - -创建隐私固定地址依赖于伪随机值,这个随机值只被主机本身知晓,它不会显示给网络上的其他主机。这个随机值随后被一个密码安全算法加密,一起被加密的还有一些与网络连接的特殊值。这些值包含:用以标识网卡的标识符;网络前缀;对于这个网络来说有可能的其他特殊值,例如无线的SSID。使用安全值使其他主机很难预测结果地址,与此同时,当进入不同的网络时,网络的特殊数据会让地址变得不同。 - -这也巧妙的解决了地址重复问题。因为有随机值的存在,冲突也不太可能发生。万一发生了冲突,结果地址会得到重复地址检测失败的记录,这时会生成一个不同的地址而不会断开网络连接。看,这种方式很聪明吧。 - -使用隐私固定地址一点儿也不会妨碍隐私扩展。你可以在使用RFC4941所描述的临时地址的同时使用[RFC7217](https://tools.ietf.org/html/rfc7217)中的固定地址。 - -## 网络管理器处于什么样的状况? - -我们已经在网络管理器1.0.4版本中实现了隐私扩展。在这个版本中,隐私扩展默认开启。你可以用ipv6.ip6-privacy参数来控制它。 - -在网络管理器1.2版本中,我们将会加入固定隐私寻址。应该指出的是,目前的隐私扩展还不符合这种需求。我们可以使用ipv6.addr-gen-mode参数来控制这个特性。如果它被设置成固定隐私,那么将会使用固定隐私寻址。设置成“eui64”或者干脆不设置它将会保持传统的默认寻址方式。 - -敬请期待明年,也就是2016年年初网络管理器1.2版本的发布吧!如果你想尝试一下最新的版本,不妨试试Fedora Rawhide,它最终会变成Fedora24。 - -*我想感谢Hannes Frederic Sowa,他给了我很有价值的反馈。如果没有他的帮助,这篇文章的作用将会逊色很多。另外,Hannes也是RFC7217所描述机制的内核实现者,当网络管理器不起作用的时候,它将发挥作用。* - --------------------------------------------------------------------------------- - -via: https://blogs.gnome.org/lkundrak/2015/12/03/networkmanager-and-privacy-in-the-ipv6-internet/ -作者:[Lubomir Rintel] -译者:[itsang](https://github.com/itsang) -校对:[校对者ID](https://github.com/校对者ID) -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From a0b2c61f80597dddd3648001802fdaa99d2e84ce Mon Sep 17 00:00:00 2001 From: SonoFelice Date: Thu, 21 Jan 2016 10:40:12 +0800 Subject: [PATCH 0250/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...1126 Microsoft and Linux--True Romance or Toxic Love.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sources/talk/20151126 Microsoft and Linux--True Romance or Toxic Love.md b/sources/talk/20151126 Microsoft and Linux--True Romance or Toxic Love.md index 8659cd787c..41d68798ce 100644 --- a/sources/talk/20151126 Microsoft and Linux--True Romance or Toxic Love.md +++ b/sources/talk/20151126 Microsoft and Linux--True Romance or Toxic Love.md @@ -1,12 +1,19 @@ sonofelice translating Microsoft and Linux: True Romance or Toxic Love? +微软和 Linux :真正的浪漫还是有毒的爱情?(微软和Linux的爱恨情仇) ================================================================================ +时不时的我们会读到一个能让你喝咖啡呛到或者把热拿铁喷到你显示器上的新闻故事。微软最近宣布的对Linux的钟爱就是这样一个鲜明的例子。 Every now and then, you come across a news story that makes you choke on your coffee or splutter hot latte all over your monitor. Microsoft's recent proclamations of love for Linux is an outstanding example of such a story. +从常识来讲,微软和自由开源软件(FOSS)运动就是恒久的敌人。在很多人眼里,微软体现了过分的贪婪,而这正为自由开源软件运动(FOSS)所拒绝。另外,之前微软就已经给自由开源软件社区贴上了"一伙强盗"的标签。 + Common sense says that Microsoft and the FOSS movement should be perpetual enemies. In the eyes of many, Microsoft embodies most of the greedy excesses that the Free Software movement rejects. In addition, Microsoft previously has labeled Linux as a cancer and the FOSS community as a "pack of thieves". +我们能够理解为什么微软一直以来都害怕免费的操作系统。免费操作系统结合挑战微软核心产品线的开源应用时,就威胁到了微软在台式机和笔记本电脑的控制地位。 + We can understand why Microsoft has been afraid of a free operating system. When combined with open-source applications that challenge Microsoft's core line, it threatens Microsoft's grip on the desktop/laptop market. +尽管微软有对在台式机主导地位的担忧,在网络服务器市场 Linux 却有着最高的影响力。今天,大多数的服务器都是Linux系统。包括世界上最繁忙的站点服务器。 In spite of Microsoft's fears over its desktop dominance, the Web server marketplace is one arena where Linux has had the greatest impact. Today, the majority of Web servers are Linux boxes. This includes most of the world's busiest sites. The sight of so much unclaimed licensing revenue must be painful indeed for Microsoft. Handheld devices are another realm where Microsoft has lost ground to free software. At one point, its Windows CE and Pocket PC operating systems were at the forefront of mobile computing. Windows-powered PDA devices were the shiniest and flashiest gadgets around. But, that all ended when Apple released its iPhone. Since then, Android has stepped into the limelight, with Windows Mobile largely ignored and forgotten. The Android platform is built on free and open-source components. From a86ab7a0f0fcade07be81a97a3d3338441246dc6 Mon Sep 17 00:00:00 2001 From: zpl Date: Fri, 22 Jan 2016 17:43:23 +0800 Subject: [PATCH 0251/1469] [translated] 20151206 Supporting secure DNS in glibc.md --- ...20151206 Supporting secure DNS in glibc.md | 47 ------------------- ...20151206 Supporting secure DNS in glibc.md | 46 ++++++++++++++++++ 2 files changed, 46 insertions(+), 47 deletions(-) delete mode 100644 sources/tech/20151206 Supporting secure DNS in glibc.md create mode 100644 translated/tech/20151206 Supporting secure DNS in glibc.md diff --git a/sources/tech/20151206 Supporting secure DNS in glibc.md b/sources/tech/20151206 Supporting secure DNS in glibc.md deleted file mode 100644 index 0547719a72..0000000000 --- a/sources/tech/20151206 Supporting secure DNS in glibc.md +++ /dev/null @@ -1,47 +0,0 @@ -zpl1025 -Supporting secure DNS in glibc -======================== - -Credit: Jonathan Corbet - -One of the many weak links in Internet security is the domain name system (DNS); it is subject to attacks that, among other things, can mislead applications regarding the IP address of a system they wish to connect to. That, in turn, can cause connections to go to the wrong place, facilitating man-in-the-middle attacks and more. The DNSSEC protocol extensions are meant to address this threat by setting up a cryptographically secure chain of trust for DNS information. When DNSSEC is set up properly, applications should be able to trust the results of domain lookups. As the discussion over an attempt to better integrate DNSSEC into the GNU C Library shows, though, ensuring that DNS lookups are safe is still not a straightforward problem. - -In a sense, the problem was solved years ago; one can configure a local nameserver to perform full DNSSEC verification and use that server via glibc calls in applications. DNSSEC can even be used to increase security in other areas; it can, for example, carry SSH or TLS key fingerprints, allowing applications to verify that they are talking to the right server. Things get tricky, though, when one wants to be sure that DNS results claiming to have DNSSEC verification are actually what they claim to be — when one wants the security that DNSSEC is meant to provide, in other words. - -The /etc/resolv.conf problem - -Part of the problem, from the glibc perspective, is that glibc itself does not do DNSSEC verification. Instead, it consults /etc/resolv.conf and asks the servers found therein to do the lookup and verification; the results are then returned to the application. If the application is using the low-level res_query() interface, those results may include the "authenticated data" (AD) flag (if the nameserver has set it) indicating that DNSSEC verification has been successfully performed. But glibc knows nothing about the trustworthiness of the nameserver that has provided those results, so it cannot tell the application anything about whether they should really be trusted. - -One of the first steps suggested by glibc maintainer Carlos O'Donell is to add an option (dns-strip-dnssec-ad-bit) to the resolv.conf file telling glibc to unconditionally remove the AD bit. This option could be set by distributions to indicate that the DNS lookup results cannot be trusted at a DNSSEC level. Once things have been set up so that the results can be trusted, that option can be removed. In the meantime, though, applications would have a way to judge the DNS lookup results they get from glibc, something that does not exist now. - -What would a trustworthy setup look like? The standard picture looks something like this: there is a local nameserver, accessed via the loopback interface, as the only entry in /etc/resolv.conf. That nameserver would be configured to do verification and, in the case that verification fails, simply return no results at all. There would, in almost all cases, be no need to worry about whether applications see the AD bit or not; if the results are not trustworthy, applications will simply not see them at all. A number of distributions are moving toward this model, but the situation is still not as simple as some might think. - -One problem is that this scheme makes /etc/resolv.conf into a central point of trust for the system. But, in a typical Linux system, there are no end of DHCP clients, networking scripts, and more that will make changes to that file. As Paul Wouters pointed out, locking down this file in the short term is not really an option. Sometimes those changes are necessary: when a diskless system is booting, it may need name-resolution service before it is at a point where it can start up its own nameserver. A system's entire DNS environment may change depending on which network it is attached to. Systems in containers may be best configured to talk to a nameserver on the host. And so on. - -So there seems to be a general belief that /etc/resolv.conf cannot really be trusted on current systems. Ideas to add secondary configuration files (/etc/secure-resolv.conf or whatever) have been floated, but they don't much change the basic nature of the situation. Beyond that, some participants felt that even a local nameserver running on the loopback interface is not really trustworthy; Zack Weinberg suggested that administrators might intentionally short out DNSSEC validation, for example. - -Since the configuration cannot be trusted on current systems, the reasoning goes, glibc needs to have a way to indicate to applications when the situation has improved and things can be trusted. That could include the AD-stripping option described above (or, conversely, an explicit "this nameserver is trusted" option); that, of course, would require that the system be locked down to a level where surprising changes to /etc/resolv.conf no longer happen. A variant, as suggested by Petr Spacek, is to have a way for an application to ask glibc whether it is talking to a local nameserver or not. - -Do it in glibc? - -An alternative would be to dispense with the nameserver and have glibc do DNSSEC validation itself. There is, however, resistance to putting a big pile of cryptographic code into glibc itself. That would increase the size of the library and, it is felt, increase the attack surface of any application using it. A variant of this idea, suggested by Zack, would be to put the validation code into the name-service caching daemon (nscd) instead. Since nscd is part of glibc, it is under the control of the glibc developers and there could be a certain amount of confidence that DNSSEC validation is being performed properly. The location of the nscd socket is well known, so the /etc/resolv.confissues don't come into play. Carlos worried, though, that this approach might deter adoption by users who do not want the caching features of nscd; in his mind, that seems to rule out the nscd option. - -So, in the short term, at least, it seems unlikely that glibc will take on the full task of performing validated DNSSEC lookups. That means that, if security-conscious applications are going to use glibc for their name lookups, the library will have to provide an indication of how trustworthy the results received from a separate nameserver are. And that will almost certainly require explicit action on the part of the distributor and/or system administrator. As Simo Sorce put it: - -A situation in which glibc does not use an explicit configuration option to signal applications that it is using a trusted resolver is not useful ... no scratch that, it is actively harmful, because applications developers will quickly realize they cannot trust any information coming from glibc and will simply not use it for DNSSEC related information. - -Configuring a system to properly use DNSSEC involves change to many of the components of that system — it is a distribution-wide problem that will take time to solve fully. The role that glibc plays in this transition is likely to be relatively small, but it is an important one: glibc is probably the only place where applications can receive some assurance that their DNS results are trustworthy without implementing their own resolver code. Running multiple DNSSEC implementations on a system seems like an unlikely path to greater security, so it would be good to get this right. - -The glibc project has not yet chosen a path by which it intends to get things right, though some sort of annotation in /etc/resolv.conf looks like a likely outcome. Any such change would then have to get into a release; given the conservative nature of glibc development, it may already be late for the 2.23 release, which is likely to happen in February. So higher DNSSEC awareness in glibc may not happen right away, but there is at least some movement in that direction. - ---------------------------- - -via: https://lwn.net/Articles/663474/ - -作者:Jonathan Corbet - -译者:[译者ID](https://github.com/译者ID) - -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/translated/tech/20151206 Supporting secure DNS in glibc.md b/translated/tech/20151206 Supporting secure DNS in glibc.md new file mode 100644 index 0000000000..c66a28257c --- /dev/null +++ b/translated/tech/20151206 Supporting secure DNS in glibc.md @@ -0,0 +1,46 @@ +通过修改 glibc 支持 DNS 加密 +======================== + +感谢:Jonathan Corbet + +域名解析系统(DNS)是因特网安全许多薄弱环节之一;可以误导应用程序所访问的主机相应的 IP 地址。也就是说,会连接到错误的位置,可以引发中间人攻击以及更多攻击。而 DNSSEC 扩展协议是通过为 DNS 信息建立一条加密的可信通道来解决这个漏洞。在正确地配置好 DNSSEC 后,应用程序将可以得到可靠的主机查询信息。通过关于尝试将 DNSSEC 更好地集成到 GNU C 库里的讨论,确保 DNS 查询信息安全并不是那么简单。 + +某种意义上来说,这个问题多年以前就解决了,我们可以配置一个本地域名服务实现完整的 DNSSEC 认证并允许应用程序通过 glibc 函数来使用该服务。DNSSEC 甚至还可以用于提高其他领域的安全性,比如,它可以携带 SSH 或 TLS 密钥指纹,让应用程序可以确认其在与正确的服务器通话。不过,当我们希望确认这条自称带有 DNSSEC 认证的 DNS 结果是不是真的已通过认证的时候 - 也就是说,当我们想依赖 DNSSEC 所承诺的安全的时候,事情变得有点复杂。 + +/etc/resolv.conf 问题 + +从 glibc 的角度来看,这个问题一部分是因为 glibc 本身并没有做 DNSSEC 认证。而是引用 /etc/resolv.conf 文件,从该文件里读出的服务器来做解析以及认证,再将结果返回给应用程序。如果应用程序使用底层 res_query() 接口,那结果中将会包含“已认证数据”(AD)标识(如果域名服务器设定了的话)以表示 DNSSEC 认证已经成功。但是 glibc 却完全不知道提供这些结果的域名服务器的信用,所以它其实并不能告诉应用程序结果是否真的可靠。 + +由 glibc 的维护者 Carlos O'Donell 提出的建议是在 resolv.conf 文件里增加一个选项(dns-strip-dnssec-ad-bit)告诉 glibc 无条件移除 AD 标识。这个选项可以由各发行版设定,表示 DNSSEC 级别的 DNS 查询结果并不可靠。而一旦建立好合适的环境可以获得可靠的查询结果后,再移除这个选项。这样一来,虽然问题还没有完全解决,至少应用程序有依据来评价从 glibc 获取的 DNS 查询结果的可靠性。 + +一个可靠的环境配置应该是什么样?标准情况应该和这个差不太多:有一个本地域名服务器,通过环路接口访问,作为访问 /etc/resolv.conf 文件的唯一入口。这个域名服务器应该配置来做认证,而在认证失败后就只是简单地不返回任何结果。绝大多数情况下,应用程序就不再需要关心 AD 标识,如果结果不可靠,应用程序就根本看不到。一些发行版已经偏向这种模型,不过情况仍然不像一些人所设想的没那么简单。 + +其中一个问题是,这种方式将 /etc/resolv.conf 文件放到整个系统可信任度的中心。但是,在一个典型的 Linux 系统里,有无数的 DHCP 客户端、网络脚本以及其他更多,可以修改这个文件。就像 Paul Wouters 所指出的,在短时间内锁定这个文件是不可能的。有时候这种改变是必须的:在一个无盘系统启动的时候,在自身的域名服务器启动之前也是需要域名服务的;一个系统的整个 DNS 环境也会根据所连接的网络不同而有所改变;运行在容器里的系统也最好是配制成使用宿主机的域名服务器;等等。 + +所以,现在一般认为,现有系统里的 /etc/resolv.conf 文件并不可信。于是有人提出增加另一个配置文件(/etc/secure-resolv.conf 或其他什么),但这并没有从根本上解决问题。除此之外,有些参与人员觉得就算有一个运行在环路接口上的域名服务器也不是真正可靠,比如 Zack Weinberg 甚至建议系统管理员可以有意禁用 DNSSEC 认证。 + +既然当前系统里的配置不足以信任,那可以这样推断,在情况有改善能够取得可信的结果后,glibc 需要有一种方式来通知应用程序。可以是上面讨论的屏蔽 AD 标识的方式(或者与之相反,增加一个显示的“此域名服务器可以信任”选项);当然,这都需要一定程度上锁定系统以免 /etc/resolv.conf 受到任何不可预计的修改。按 Petr Spacek 的建议,还有一种引申方式,就是提供一种途径允许应用程序查询 glibc 当前通讯的是不是本地域名服务器。 + +在 glibc 里来处理? + +另一种方式是去掉域名服务器,而是让 glibc 本身来做 DNSSEC 认证。不过,把这么大一坨加密相关代码放进 glibc 也是有很大阻力。这样将增加库本身的大小,从而感觉会增加使用它的应用程序的受攻击面积。这个方向再引申一下,由 Zack 提出的建议,可以把认证相关代码放到域名服务缓冲守护进程(nscd)里。因为 nscd 也是 glibc 的一部分,由 glibc 开发人员维护,因此在一定程度上可以相信能正确执行 DNSSEC 认证。而且 nscd 的通讯 socket 所在位置也是公开的,所以可以不考虑 /etc/resolv.conf 问题。不过,Carlos 担心这种方式不能让那些不想使用 nscd 缓存功能的用户所接受;在他看来,基本可以排除 nscd 的方式。 + +所以,至少近期内,glibc 不太可能全部执行带 DNSSEC 认证的整个查询过程。这意味着,如果一个有安全考虑的应用要使用 glibc 库来查询域名,库将需要提供一个标识来评价从独立域名服务器返回的结果有多大程度的可靠性。这几乎肯定需要发行商或系统管理员做出一些明确的改动。就像 Simo Sorce 说的那样: + +如果 glibc 不使用明确的配置选项来通知应用程序它所用的域名解析是可信的,不会有什么用。。。不改一下还有很大弊端,因为应用程序开发者将马上认识到他们不能信任从 glibc 获取的任何信息,从而在处理 DNSSEC 相关信息时就简单地不用它。 + +要配置一个系统能正常使用 DNSSEC 需要改动该系统的很多组件 - 这是一个发行版范围的问题,需要时间来完全解决。在这个转变过程中 glibc 所扮演的角色很可能会比较小,但是很重要的一部分:如果应用程序不实现一套自己的域名解析代码,glibc 很可能是保证 DNS 结果可信的唯一方式。在一个系统中运行多个 DNSSEC 实现方式看起来不像是一种安全的方式,所以最好还是把事情做对了。 + +glibc 项目目前并没有确定用哪种方式来做这个事情,虽然从 /etc/resolv.conf 文件里的某些标记看上去快好了。这种改动应该需要发布新版本;考虑到 glibc 开发的保守天性,很可能来不及加入预计二月份发布的 2.23 版本了。所以 glibc 中暂时还不会有更高安全性的 DNSSEC ,不过在这个方向上也有一些进展了。 + +--------------------------- + +via: https://lwn.net/Articles/663474/ + +作者:Jonathan Corbet + +译者:[zpl1025](https://github.com/zpl1025) + +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 6a81bf7bd2f301b6859e365f54816020255664cc Mon Sep 17 00:00:00 2001 From: zpl Date: Fri, 22 Jan 2016 17:51:31 +0800 Subject: [PATCH 0252/1469] [translating] 20151202 A new Mindcraft moment.md --- sources/tech/20151202 A new Mindcraft moment.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20151202 A new Mindcraft moment.md b/sources/tech/20151202 A new Mindcraft moment.md index 79930e8202..92c645ea4b 100644 --- a/sources/tech/20151202 A new Mindcraft moment.md +++ b/sources/tech/20151202 A new Mindcraft moment.md @@ -1,3 +1,4 @@ +zpl1025 A new Mindcraft moment? ======================= From c4b1535743d241474dc5bad34d4a0b23f4e999ad Mon Sep 17 00:00:00 2001 From: SonoFelice Date: Sun, 24 Jan 2016 17:26:59 +0800 Subject: [PATCH 0253/1469] =?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 and Linux--True Romance or Toxic Love.md | 85 ------------------- ...t and Linux--True Romance or Toxic Love.md | 77 +++++++++++++++++ 2 files changed, 77 insertions(+), 85 deletions(-) delete mode 100644 sources/talk/20151126 Microsoft and Linux--True Romance or Toxic Love.md create mode 100644 translated/talk/20151126 Microsoft and Linux--True Romance or Toxic Love.md diff --git a/sources/talk/20151126 Microsoft and Linux--True Romance or Toxic Love.md b/sources/talk/20151126 Microsoft and Linux--True Romance or Toxic Love.md deleted file mode 100644 index 41d68798ce..0000000000 --- a/sources/talk/20151126 Microsoft and Linux--True Romance or Toxic Love.md +++ /dev/null @@ -1,85 +0,0 @@ -sonofelice translating -Microsoft and Linux: True Romance or Toxic Love? -微软和 Linux :真正的浪漫还是有毒的爱情?(微软和Linux的爱恨情仇) -================================================================================ -时不时的我们会读到一个能让你喝咖啡呛到或者把热拿铁喷到你显示器上的新闻故事。微软最近宣布的对Linux的钟爱就是这样一个鲜明的例子。 -Every now and then, you come across a news story that makes you choke on your coffee or splutter hot latte all over your monitor. Microsoft's recent proclamations of love for Linux is an outstanding example of such a story. - -从常识来讲,微软和自由开源软件(FOSS)运动就是恒久的敌人。在很多人眼里,微软体现了过分的贪婪,而这正为自由开源软件运动(FOSS)所拒绝。另外,之前微软就已经给自由开源软件社区贴上了"一伙强盗"的标签。 - -Common sense says that Microsoft and the FOSS movement should be perpetual enemies. In the eyes of many, Microsoft embodies most of the greedy excesses that the Free Software movement rejects. In addition, Microsoft previously has labeled Linux as a cancer and the FOSS community as a "pack of thieves". - -我们能够理解为什么微软一直以来都害怕免费的操作系统。免费操作系统结合挑战微软核心产品线的开源应用时,就威胁到了微软在台式机和笔记本电脑的控制地位。 - -We can understand why Microsoft has been afraid of a free operating system. When combined with open-source applications that challenge Microsoft's core line, it threatens Microsoft's grip on the desktop/laptop market. - -尽管微软有对在台式机主导地位的担忧,在网络服务器市场 Linux 却有着最高的影响力。今天,大多数的服务器都是Linux系统。包括世界上最繁忙的站点服务器。 -In spite of Microsoft's fears over its desktop dominance, the Web server marketplace is one arena where Linux has had the greatest impact. Today, the majority of Web servers are Linux boxes. This includes most of the world's busiest sites. The sight of so much unclaimed licensing revenue must be painful indeed for Microsoft. - -Handheld devices are another realm where Microsoft has lost ground to free software. At one point, its Windows CE and Pocket PC operating systems were at the forefront of mobile computing. Windows-powered PDA devices were the shiniest and flashiest gadgets around. But, that all ended when Apple released its iPhone. Since then, Android has stepped into the limelight, with Windows Mobile largely ignored and forgotten. The Android platform is built on free and open-source components. - -The rapid expansion in Android's market share is due to the open nature of the platform. Unlike with iOS, any phone manufacturer can release an Android handset. And, unlike with Windows Mobile, there are no licensing fees. This has been really good news for consumers. It has led to lots of powerful and cheap handsets appearing from manufacturers all over the world. It's a very definite vindication of the value of FOSS software. - -Losing the battle for the Web and mobile computing is a brutal loss for Microsoft. When you consider the size of those two markets combined, the desktop market seems like a stagnant backwater. Nobody likes to lose, especially when money is on the line. And, Microsoft does have a lot to lose. You would expect Microsoft to be bitter about it. And in the past, it has been. - -Microsoft has fought back against Linux and FOSS using every weapon at its disposal, from propaganda to patent threats, and although these attacks have slowed the adoption of Linux, they haven't stopped it. - -So, you can forgive us for being shocked when Microsoft starts handing out t-shirts and badges that say "Microsoft Loves Linux" at open-source conferences and events. Could it be true? Does Microsoft really love Linux? - -Of course, PR slogans and free t-shirts do not equal truth. Actions speak louder than words. And when you consider Microsoft's actions, Microsoft's stance becomes a little more ambiguous. - -On the one hand, Microsoft is recruiting hundreds of Linux developers and sysadmins. It's releasing its .NET Core framework as an open-source project with cross-platform support (so that .NET apps can run on OS X and Linux). And, it is partnering with Linux companies to bring popular distros to its Azure platform. In fact, Microsoft even has gone so far as to create its own Linux distro for its Azure data center. - -On the other hand, Microsoft continues to launch legal attacks on open-source projects directly and through puppet corporations. It's clear that Microsoft hasn't had some big moral change of heart over proprietary vs. free software, so why the public declarations of adoration? - -To state the obvious, Microsoft is a profit-making entity. It's an investment vehicle for its shareholders and a source of income for its employees. Everything it does has a single ultimate goal: revenue. Microsoft doesn't act out of love or even hate (although that's a common accusation). - -So the question shouldn't be "does Microsoft really love Linux?" Instead, we should ask how Microsoft is going to profit from all this. - -Let's take the open-source release of .NET Core. This move makes it easy to port the .NET runtime to any platform. That extends the reach of Microsoft's .NET framework far beyond the Windows platform. - -Opening .NET Core ultimately will make it possible for .NET developers to produce cross-platform apps for OS X, Linux, iOS and even Android--all from a single codebase. - -From a developer's perspective, this makes the .NET framework much more attractive than before. Being able to reach many platforms from a single codebase dramatically increases the potential target market for any app developed using the .NET framework. - -What's more, a strong Open Source community would provide developers with lots of code to reuse in their own projects. So, the availability of open-source projects would make the .NET framework. - -On the plus side, opening .NET Core reduces fragmentation across different platforms and means a wider choice of apps for consumers. That means more choice, both in terms of open-source software and proprietary apps. - -From Microsoft's point of view, it would gain a huge army of developers. Microsoft profits by selling training, certification, technical support, development tools (including Visual Studio) and proprietary extensions. - -The question we should ask ourselves is does this benefit or hurt the Free Software community? - -Widespread adoption of the .NET framework could mean the eventual death of competing open-source projects, forcing us all to dance to Microsoft's tune. - -Moving beyond .NET, Microsoft is drawing a lot of attention to its Linux support on its Azure cloud computing platform. Remember, Azure originally was Windows Azure. That's because Windows Server was the only supported operating system. Today, Azure offers support for a number of Linux distros too. - -There's one reason for this: paying customers who need and want Linux services. If Microsoft didn't offer Linux virtual machines, those customers would do business with someone else. - -It looks like Microsoft is waking up to the fact that Linux is here to stay. Microsoft cannot feasibly wipe it out, so it has to embrace it. - -This brings us back to the question of why there is so much buzz about Microsoft and Linux. We're all talking about it, because Microsoft wants us to think about it. After all, all these stories trace back to Microsoft, whether it's through press releases, blog posts or public announcements at conferences. The company is working hard to draw attention to its Linux expertise. - -What other possible purpose could be behind Chief Architect Kamala Subramaniam's blog post announcing Azure Cloud Switch? ACS is a custom Linux distro that Microsoft uses to automate the configuration of its switch hardware in the Azure data centers. - -ACS is not publicly available. It's intended for internal use in the Azure data center, and it's unlikely that anyone else would be able to find a use for it. In fact, Subramaniam states the same thing herself in her post. - -So, Microsoft won't be making any money from selling ACS, and it won't attract a user base by giving it away. Instead, Microsoft gets to draw attention to Linux and Azure, strengthening its position as a Linux cloud computing platform. - -Is Microsoft's new-found love for Linux good news for the community? - -We shouldn't be slow to forget Microsoft's mantra of Embrace, Extend and Exterminate. Right now, Microsoft is very much in the early stages of embracing Linux. Will Microsoft seek to splinter the community through custom extensions and proprietary "standards"? - -Let us know what you think in the comments below. - --------------------------------------------------------------------------------- - -via: http://www.linuxjournal.com/content/microsoft-and-linux-true-romance-or-toxic-love-0 - -作者:[James Darvell][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.linuxjournal.com/users/james-darvell \ No newline at end of file diff --git a/translated/talk/20151126 Microsoft and Linux--True Romance or Toxic Love.md b/translated/talk/20151126 Microsoft and Linux--True Romance or Toxic Love.md new file mode 100644 index 0000000000..d16ed99114 --- /dev/null +++ b/translated/talk/20151126 Microsoft and Linux--True Romance or Toxic Love.md @@ -0,0 +1,77 @@ +微软和 Linux :真正的浪漫还是有毒的爱情? +================================================================================ +时不时的我们会读到一个能让你喝咖啡呛到或者把热拿铁喷到你显示器上的新闻故事。微软最近宣布的对 Linux 的钟爱就是这样一个鲜明的例子。 + +从常识来讲,微软和自由开源软件(FOSS)运动就是恒久的敌人。在很多人眼里,微软体现了过分的贪婪,而这正为自由开源软件运动(FOSS)所拒绝。另外,之前微软就已经给自由开源软件社区贴上了"一伙强盗"的标签。 + +我们能够理解为什么微软一直以来都害怕免费的操作系统。免费操作系统结合挑战微软核心产品线的开源应用时,就威胁到了微软在台式机和笔记本电脑市场的控制地位。 + +尽管微软有对在台式机主导地位的担忧,在网络服务器市场 Linux 却有着最高的影响力。今天,大多数的服务器都是 Linux 系统。包括世界上最繁忙的站点服务器。对微软来说,看到这么多没有被声明的许可证收入一定是非常痛苦的。 + +掌上设备是微软输给免费软件的另一个领域。曾几何时,微软的 Windows CE 和 Pocket PC 操作系统走在移动计算的前沿。Windows PDA 设备是最闪亮的和豪华的产品。但是这一切在苹果公司发布了iphone之后都结束了。从那时起,安卓已经开始进入公众视野,Windows的移动产品开始被忽略被遗忘。而安卓平台是建立在免费开源的组件的基础上的。 + +由于安卓平台的开放性,安卓的市场份额在迅速扩大。不像 IOS,任何一个手机制造商都可以发布安卓手机。也不像Windows手机,安卓没有许可费用。这对消费者来说是件好事。这也导致了许多强大却又价格低廉的手机制造商在世界各地涌现。这非常明确的证明了自由开源软件(FOSS)的价值。 + +在服务器和移动计算的角逐中失利对微软来说是非常惨重的损失。考虑一下服务器和移动计算这两个加起来所占有的市场大小,台式机市场似乎是死水一潭。没有人喜欢失败,尤其是涉及到金钱。并且,微软确实有许多正在慢慢失去。你可能期望着微软自尝苦果。在过去,确实如此。 + +微软使用了各种可以支配的手段来对 Linux 和自由开源软件(FOSS)进行反击,从宣传到专利威胁。尽管这种攻击确实减慢了适配 Linux 的步伐,但却从来没有让 Linux 的脚步停下。 + +所以,当微软在开源大会和重大事件上拿出印有"Microsoft Loves Linux"的T-恤和徽章时,请原谅我们表现出来的震惊。这是真的吗?微软真的爱 Linux ? + +当然,公关的口号和免费的T-恤并不代表真理。行动胜于雄辩。当你思考一下微软的行动时,微软的立场就变得有点模棱两可了。 + +一方面,微软招募了几百名 Linux 开发者和系统管理员。将 .NET 核心框架作为一个开源的项目进行了发布,并提供了跨平台的支持(这样 .NET 就可以跑在 OS X 和 Linux 上了)。并且,微软与 Linux 公司合作把最流行的发型版本放到了Azure平台上。事实上,微软已经走的如此之远以至于要为Azure数据中心开发自己的Linux发行版了。 + +另一方面,微软继续直接通过法律或者傀儡公司来对开源项目进行攻击。很明显,微软在与自由软件的所有权较量上并没有发自内心的进行大的道德转变。那为什么要公开生命对Linux的钟爱之情呢? + +一个显而易见的事实:微软是一个经营性实体。对股东来说是一个投资工具,对雇员来说是收入来源。微软所做的只有一个终极目标:盈利。微软并没有表现出来爱或者恨(尽管这是一个最常见的指控)。 + +所以问题不应该是"微软真的爱 Linux 吗?"相反,我们应该问,微软是怎么从这一切中获利的。 + +让我们以 .NET 核心框架的开源发行为例。这一举动使得任何平台都很容易进入 .NET 的运行时环境。这使得微软的.NET框架所涉及到的范围远远大于Windows平台。 + +开放 .NET 的核心包,最终使得 .NET 开发者开发跨平台的app成为可能,比如OS X,Linux甚至安卓——都基于同一个核心代码库。 + +从开发者角度来讲,这使得.NET框架比之前更有吸引力了。能够从单一的代码库就可以触及到多个平台,使得使用.NET框架开发的任何app戏剧性的扩大了潜在的目标市场。 + +另外,一个强大的开源社区能够提供给开发者一些代码来在他们自己的项目中进行服用。所以,开源项目的可利用性也将会成就.NET框架。 + +更进一步讲,开放 .NET 的核心代码能够减少跨越不同平台锁产生的碎片,意味着对消费者来说有对app更广的选择。无论是开源软件还是专用的app,都有更多的选择。 + +从微软的角度来讲,会得到一队开发者大军。微软可以通过销售培训、证书、技术支持、开发者工具(包括Visual Studio)和应用扩展来获利。 + +我们应该自问的是,这对自由软件社区有利还是有弊? + +.NET 框架的大范围适用意味着许多参与竞争的开源项目的消亡,迫使我们会跟着微软的节奏走下去。 + +先抛开.NET不谈,微软正在花费大量的精力在Linux对Azure云计算平台的支持上。要记得,Azure最初是Windows的Azure。Windows服务器是唯一能够支持Azure的操作系统。今天,Azure也提供了对多个Linux发行版的支持。 + +关于此,有一个原因:付费给需要或者想要Linux服务的顾客。如果微软不提供Linux虚拟机,那些顾客就会跟别人合作了。 + +看上去好像是微软意识到"Linux就在这里"的这样一个现实。微软不能真正的消灭它,所以必须接收它。 + +这又把我们带回到那个问题:关于微软和Linux为什么有这么多的流言?我们在谈论这个问题,因为微软希望我们思考这个问题。毕竟,所有这些谈资都会追溯到微软,不管是在新闻稿、博客还是会议上的公开声明。微软在努力吸引大家对其在Linux专业知识方面的注意力。 + +首席架构师 Kamala Subramaniam 的博文声明Azure Cloud Switch背后的其他企图会是什么?ACS是一个定制的Linux发行版。微软用它来对Azure数据中心的开关硬件进行自动配置。 + +ACS不是公开的。它是用于Azure内部使用的。别人也不太可能找到这个发行版其他的用途。事实上,Subramaniam 在她的博文中也表述了同样的观点。 + +所以,微软不会通过卖ACS来获利,也不会因为放弃使用而获得一个用户基础。相反,微软在Linux和Azure上花费经历,加强其在Linux云计算平台方面的地位。 + +微软最近迷上Linux对社区来说是好消息吗? + +我们不应该慢慢忘记微软的"拥抱、扩展、消灭"的诅咒。现在,微软处在拥抱Linux的初期阶段。微软会通过定制扩展和专有标准来分裂社区吗? + +赶紧评论吧,让我们知道你是怎么想的。 + +-------------------------------------------------------------------------------- + +via: http://www.linuxjournal.com/content/microsoft-and-linux-true-romance-or-toxic-love-0 + +作者:[James Darvell][a] +译者:[sonofelice](https://github.com/sonofelice) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linuxjournal.com/users/james-darvell \ No newline at end of file From 0d8d7f05e6e52f08810354fba489805fc61a8077 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 25 Jan 2016 07:23:57 +0800 Subject: [PATCH 0254/1469] PUB:20151204 Install and Configure Munin monitoring server in Linux @ictlyh --- ...figure Munin monitoring server in Linux.md | 162 ++++++++++++++++++ ...figure Munin monitoring server in Linux.md | 145 ---------------- 2 files changed, 162 insertions(+), 145 deletions(-) create mode 100644 published/20151204 Install and Configure Munin monitoring server in Linux.md delete mode 100644 translated/tech/20151204 Install and Configure Munin monitoring server in Linux.md diff --git a/published/20151204 Install and Configure Munin monitoring server in Linux.md b/published/20151204 Install and Configure Munin monitoring server in Linux.md new file mode 100644 index 0000000000..9845ad8503 --- /dev/null +++ b/published/20151204 Install and Configure Munin monitoring server in Linux.md @@ -0,0 +1,162 @@ +在 Linux 上安装和配置 Munin 监控服务器 +================================================================================ +![](http://www.linuxnix.com/wp-content/uploads/2015/12/munin_page.jpg) + +Munin 是一款类似 [RRD tool][1] 的非常棒的系统监控工具,它能提供给你多方面的系统性能信息,例如 **磁盘、网络、进程、系统和用户**。这些是 Munin 默认监控的内容。 + +### Munin 如何工作? ### + +Munin 以客户端-服务器模式运行。主服务器上运行的 Munin 服务器进程会从本地运行的客户端守护进程(Munin 可以监控它自己的资源)或者远程客户端(Munin 可以监控上百台机器)收集数据,然后在它的 web 界面上以图形的方式显示出来。 + +### 在 nutshell 中配置 Munin ### + +要配置服务器端和客户端,我们需要完成以下两步。 + +1. 安装 Munin 服务器软件包并配置,使得它能从客户端收集数据。 +2. 安装 Munin 客户端,使得服务器能连接到客户端守护进程进行数据收集。 + +### 在 Linux 上安装 munin 服务器端 ### + +在基于 Ubuntu/Debian 的机器上安装 Munin 服务器: + + apt-get install munin apache2 + +在基于 Redhat/CentOS 的机器上安装 Munin 服务器: + +在基于 Redhat 的机器上安装 Munin 之前,你需要确保 [启用 EPEL 软件仓库][2],因为基于 Redhat 的机器的软件仓库默认没有 Munin。 + + yum install munin httpd + +### 在 Linux 上配置 Munin 服务器端 ### + +下面是我们要在服务器上启动 Munini 所进行的步骤: + +1. 在 /etc/munin/munin.conf 中添加需要监控的主机详情。 +2. 配置 apache web 服务器使其包括 munin 配置。 +3. 为 web 界面创建用户名和密码 +4. 重启 apache 服务器 + +####步骤 1#### + +在 **/etc/munin/munin.conf** 文件中添加主机条目。调到文件末尾添加要监控的客户端。在这个例子中,我添加了要监控的数据库服务器和它的 IP 地址。 + +示例: + + [db.linuxnix.com] + address 192.168.1.25 + use_node_name yes + +保存文件并退出。 + +####步骤 2#### + +在 /etc/apache2/conf.d 目录中编辑或创建文件 munin.conf 用于包括 Munin 和 Apache 相关的配置。另外注意一点,默认其它和 web 相关的 Munin 配置保存在 /var/www/munin 目录。 + + vi /etc/apache2/conf.d/munin.conf + +内容: + + Alias /munin /var/www/munin + + Order allow,deny + Allow from localhost 127.0.0.0/8 ::1 + AllowOverride None + Options ExecCGI FollowSymlinks + AddHandler cgi-script .cgi + DirectoryIndex index.cgi + AuthUserFile /etc/munin/munin.passwd + AuthType basic + AuthName "Munin stats" + require valid-user + + ExpiresActive On + ExpiresDefault M310 + + + +保存文件并退出。 + +####步骤 3#### + +现在为查看 munin 的图示而创建用户名和密码: + + htpasswd -c /etc/munin/munin-htpasswd munin + +**注意**:对于 Redhat/Centos 机器,要访问你的配置文件,需要在每个路径中用 “**httpd**” 替换 “**apache2**”。 + +####步骤 4#### + +重启 Apache 服务器,使得 Munin 配置生效。 + +基于 Ubuntu/Debian : + + service apache2 restart + +基于 Centos/Redhat : + + service httpd restart + +### 在 Linux 上安装和配置 Munin 客户端 ### + +####步骤 1#### + +在 Linux 上安装 Munin 客户端 + + apt-get install munin-node + +**注意**:如果你想监控你的 Munin 服务器端,你也需要在服务器端安装 munin-node。 + +####步骤 2#### + +编辑 munin-node.conf 文件配置客户端。 + + vi /etc/munin/munin-node.conf + +示例: + + allow ^127\.0\.0\.1$ + allow ^10\.10\.20\.20$ + +---------- + + # 监听到哪个地址上 + host * + +---------- + + # 以及哪个端口 + port 4949 + +**注意**: 10.10.20.20 是我的 Munin 服务器,它连接到客户端的 4949 端口获取数据。 + +####步骤 3#### + +在客户端机器中重启 munin-node: + + service munin-node restart + +### 测试连接 ### + +检查你是否能从服务器的连接到客户端的 4949 端口,如果不行,你需要在客户端机器中的防火墙打开该端口。 + + telnet db.linuxnix.com 4949 + +访问 Munin web 页面 + + http://munin.linuxnix.com/munin/index.html + +希望这些能对你配置基本的 Munin 服务器有所帮助。 + +-------------------------------------------------------------------------------- + +via: http://www.linuxnix.com/install-and-configure-munin-monitoring-server-in-linux/ + +作者:[Surendra Anne][a] +译者:[ictlyh](http://mutouxiaogui.cn/blog/) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linuxnix.com/author/surendra/ +[1]:http://www.linuxnix.com/network-monitoringinfo-gathering-tools-in-linux/ +[2]:https://linux.cn/article-2324-1.html diff --git a/translated/tech/20151204 Install and Configure Munin monitoring server in Linux.md b/translated/tech/20151204 Install and Configure Munin monitoring server in Linux.md deleted file mode 100644 index d26c1b0d8e..0000000000 --- a/translated/tech/20151204 Install and Configure Munin monitoring server in Linux.md +++ /dev/null @@ -1,145 +0,0 @@ -在 Linux 上安装和配置 Munin 检测服务器 -================================================================================ -![](http://www.linuxnix.com/wp-content/uploads/2015/12/munin_page.jpg) - -Munin 是一款和 [RRD][1] 类似很好的系统检测工具,它能提供给你多方面的系统性能信息,例如 **磁盘、网络、进程、系统和用户**。这些是 Munin 默认检测的属性。 - -### Munin 如何工作? ### - -Munin 以客户端-服务器模式运行。主服务器上运行的 Munin 服务器进程尝试从本地运行的客户端守护进程(Munin 可以检测它自己的资源)或者远程客户端(Munin 可以检测上百台机器)收集数据,然后在它的 web 页面以图的形式显示出来。 - -### 在 nutshell 中配置 Munin ### - -要配置服务器端和客户端,我们需要完成以下两步。 -1) 安装 Munin 服务器软件包并配置,使得它能从客户端收集数据。 -2) 安装 Munin 客户端使得服务器能连接到客户端守护进程用于收集数据。 - -### 在 Linux 上安装 munin 服务器端 ### - -在基于 Ubuntu/Debian 的机器上安装 Munin 服务器 - - apt-get install munin apache2 - -在基于 Redhat/CentOS 的机器上安装 Munin 服务器。在基于 Redhat 的机器上安装 Munin 之前,你需要确保 [启用 EPEL 软件仓库][2],因为基于 Redhead 的机器它们的软件仓库默认没有 Munin。 - - yum install munin httpd - -### 在 Linux 上配置 Munin 服务器端 ### - -下面是我们要启动服务器按按顺序执行的步骤。 - -1. 在 /etc/munin/munin.conf 中添加需要检测的主机详情 -2. 配置 apache web 服务器使其包括 munin 配置。 -3. 为 web 页面创建用户名和密码 -4. 重启 apache 服务器 - -**步骤 1**: 在 **/etc/munin/munin.conf** 文件中添加主机条目。调到文件末尾添加要检测的客户端。在这个例子中,我添加了要检测的数据库服务器和它的 IP 地址。 - -事例: - - [db.linuxnix.com] - address 192.168.1.25 - use_node_name yes - -保存文件并退出。 - -**步骤 2**: 在 /etc/apache2/conf.d 目录中编辑/创建文件 munin.conf 用于包括 Munin 和 Apache 相关的配置。另外注意一点,默认其它和 web 相关的 Munin 配置保存在 /var/www/munin 目录。 - - vi /etc/apache2/conf.d/munin.conf - -内容: - - Alias /munin /var/www/munin - - Order allow,deny - Allow from localhost 127.0.0.0/8 ::1 - AllowOverride None - Options ExecCGI FollowSymlinks - AddHandler cgi-script .cgi - DirectoryIndex index.cgi - AuthUserFile /etc/munin/munin.passwd - AuthType basic - AuthName "Munin stats" - require valid-user - - ExpiresActive On - ExpiresDefault M310 - - - -保存文件并退出 - -**步骤 3**: 现在为查看 munin 的图示创建用户名和密码: - - htpasswd -c /etc/munin/munin-htpasswd munin - -**注意**:对于 Redhat/Centos 机器,为了访问你的配置文件,需要在每个路径中用 “**httpd**” 替换 “**apache2**”。 - -**步骤 4**: 重启 Apache 服务器,使得 Munin 配置生效。 - -#### 基于 Ubuntu/Debian : #### - - service apache2 restart - -#### 基于 Centos/Redhat : #### - - service httpd restart - -### 在 Linux 上安装和配置 Munin 客户端 ### - -**步骤 1**: 在 Linux 上安装 Munin 客户端 - - apt-get install munin-node - -**注意**:如果你想检测你的 Munin 服务器端,你也需要在那里安装 munin-node。 - -**步骤 2**: 编辑 munin-node.conf 文件配置客户端。 - - vi /etc/munin/munin-node.conf - -事例: - - allow ^127\.0\.0\.1$ - allow ^10\.10\.20\.20$ - ----------- - - # Which address to bind to; - host * - ----------- - - # And which port - port 4949 - -**注意**: 10.10.20.20 是我的 Munin 服务器,它连接到客户端的 4949 端口获取数据。 - -**步骤 3**: 在客户端机器中重启 munin-node - - service munin-node restart - -### 测试连接 ### - -检查你是否能从服务器的连接到客户端的 4949 端口,如果不行,你需要在客户端机器中打开该端口。 - - telnet db.linuxnix.com 4949 - -访问 Munin web 页面 - - http://munin.linuxnix.com/munin/index.html - -希望这些能对你配置基本的 Munin 服务器有所帮助。 - --------------------------------------------------------------------------------- - -via: http://www.linuxnix.com/install-and-configure-munin-monitoring-server-in-linux/ - -作者:[Surendra Anne][a] -译者:[ictlyh](http://mutouxiaogui.cn/blog/) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.linuxnix.com/author/surendra/ -[1]:http://www.linuxnix.com/network-monitoringinfo-gathering-tools-in-linux/ -[2]:http://www.linuxnix.com/how-to-install-and-enable-epel-repo-in-rhel-centos-oracle-scentific-linux/ From 8f69032b711738df010afa5c7acc83400a945bb3 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 25 Jan 2016 08:04:19 +0800 Subject: [PATCH 0255/1469] PUB:20151127 Linux or UNIX grep Command Tutorial series 1--HowTo--Use grep Command In Linux or UNIX--Examples @zky001 --- ...grep Command In Linux or UNIX--Examples.md | 153 ++++++++++++++++++ ...grep Command In Linux or UNIX--Examples.md | 143 ---------------- 2 files changed, 153 insertions(+), 143 deletions(-) create mode 100644 published/20151127 Linux or UNIX grep Command Tutorial series 1--HowTo--Use grep Command In Linux or UNIX--Examples.md delete mode 100644 translated/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 1--HowTo--Use grep Command In Linux or UNIX--Examples.md diff --git a/published/20151127 Linux or UNIX grep Command Tutorial series 1--HowTo--Use grep Command In Linux or UNIX--Examples.md b/published/20151127 Linux or UNIX grep Command Tutorial series 1--HowTo--Use grep Command In Linux or UNIX--Examples.md new file mode 100644 index 0000000000..b48b9675a3 --- /dev/null +++ b/published/20151127 Linux or UNIX grep Command Tutorial series 1--HowTo--Use grep Command In Linux or UNIX--Examples.md @@ -0,0 +1,153 @@ +grep 命令系列:如何在 Linux/UNIX 中使用 grep 命令 +========================================== + +我该怎样在 Linux、Apple OS X 及其他类 UNIX 系统中使用 grep 命令,你能给我展示一些简单的例子吗? + +grep 命令用来搜索文本,或从给定的文件中搜索行内包含了给定字符串或单词的文件。通常来说,grep 显示匹配到的行。使用 grep 来搜索包括一个或多个正则表达式匹配到的文本行,然后只显示匹配到的行。grep 被视作在 Linux/ Unix 系统中最有用的命令之一。 + +### 你知道吗 ### + +grep 这个名字,来源于一个 Unix/Linux 中的古老的文本编辑器 ed 中执行相似操作的命令: + + g/re/p + +### grep 命令的语法 ### + +语法如下所示: + + grep 'word' 文件名 + grep 'word' 文件1 文件2 文件3 + grep '字符串1 字符串2' 文件名 + cat 某个文件 | grep '某个东西' + command | grep '某个东西' + command 选项1 | grep '数据' + grep --color '数据' 文件名 + +###怎么样使用 grep 来搜索一个文件### + +搜索 /etc/passwd 文件下的 boo 用户,输入: + + $ grep boo /etc/passwd + +输出内容: + + foo:x:1000:1000:foo,,,:/home/foo:/bin/ksh + +可以使用 grep 去强制忽略大小写。例如,使用 -i 选项可以匹配 boo, Boo, BOO 和其他组合: + + $ grep -i "boo" /etc/passwd + +### 递归使用 grep ### + +你可以递归地使用 grep 进行搜索。例如,在文件目录下面搜索所有包含字符串“192.168.1.5”的文件 + + $ grep -r "192.168.1.5" /etc/ + +或者是: + + $ grep -R "192.168.1.5" /etc/ + +示例输出: + + /etc/ppp/options:# ms-wins 192.168.1.50 + /etc/ppp/options:# ms-wins 192.168.1.51 + /etc/NetworkManager/system-connections/Wired connection 1:addresses1=192.168.1.5;24;192.168.1.2; + +你会看到搜索到 192.168.1.5 的结果每一行都前缀以找到匹配的文件名(例如:/etc/ppp/options)。输出之中包含的文件名可以加 -h 选项来禁止输出: + + $ grep -h -R "192.168.1.5" /etc/ + +或者 + + $ grep -hR "192.168.1.5" /etc/ + +示例输出: + + # ms-wins 192.168.1.50 + # ms-wins 192.168.1.51 + addresses1=192.168.1.5;24;192.168.1.2; + +### 使用 grep 去搜索文本 ### + +当你搜索 boo 时,grep 命令将会匹配 fooboo,boo123, barfoo35 和其他所有包含 boo 的字符串,你可以使用 -w 选项去强制只输出那些仅仅包含那个整个单词的行(LCTT译注:即该字符串两侧是英文单词分隔符,如空格,标点符号,和末端等,因此对中文这种没有断字符号的语言并不适用。)。 + + $ grep -w "boo" file + +### 使用 grep 命令去搜索两个不同的单词 ### + +使用 egrep 命令如下: + + $ egrep -w 'word1|word2' /path/to/file + +(LCTT 译注:这里使用到了正则表达式,因此使用的是 egrep 命令,即扩展的 grep 命令。) + +### 统计文本匹配到的行数 ### + +grep 命令可以通过加 -c 参数显示每个文件中匹配到的次数: + + $ grep -c 'word' /path/to/file + +传递 -n 选项可以输出的行前加入匹配到的行的行号: + + $ grep -n 'root' /etc/passwd + +示例输出: + + 1:root:x:0:0:root:/root:/bin/bash + 1042:rootdoor:x:0:0:rootdoor:/home/rootdoor:/bin/csh + 3319:initrootapp:x:0:0:initrootapp:/home/initroot:/bin/ksh + +### 反转匹配(不匹配) ### + +可以使用 -v 选项来输出不包含匹配项的内容,输出内容仅仅包含那些不含给定单词的行,例如输出所有不包含 bar 单词的行: + + $ grep -v bar /path/to/file + +### UNIX/Linux 管道与 grep 命令 ### + +grep 常常与管道一起使用,在这个例子中,显示硬盘设备的名字: + + # dmesg | egrep '(s|h)d[a-z]' + +显示 CPU 型号: + + # cat /proc/cpuinfo | grep -i 'Model' + +然而,以上命令也可以按照以下方法使用,不使用管道: + + # grep -i 'Model' /proc/cpuinfo + +示例输出: + + model : 30 + model name : Intel(R) Core(TM) i7 CPU Q 820 @ 1.73GHz + model : 30 + model name : Intel(R) Core(TM) i7 CPU Q 820 @ 1.73GHz + +### 如何仅仅显示匹配到内容的文件名字? ### + +使用 -l 选项去显示那些文件内容中包含 main() 的文件名: + + $ grep -l 'main' *.c + +最后,你可以强制 grep 以彩色输出: + + $ grep --color vivek /etc/passwd + +示例输出: + +![Grep command in action](http://files.cyberciti.biz/uploads/faq/2007/08/grep_command_examples.png) + + +-------------------------------------------------------------------------------- + +via: http://www.cyberciti.biz/faq/howto-use-grep-command-in-linux-unix/ + +作者:Vivek Gite +译者:[zky001](https://github.com/zky001) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +校对者ID: +[1]:http://bash.cyberciti.biz/guide/Pipes \ No newline at end of file diff --git a/translated/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 1--HowTo--Use grep Command In Linux or UNIX--Examples.md b/translated/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 1--HowTo--Use grep Command In Linux or UNIX--Examples.md deleted file mode 100644 index b539b9a4a8..0000000000 --- a/translated/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 1--HowTo--Use grep Command In Linux or UNIX--Examples.md +++ /dev/null @@ -1,143 +0,0 @@ -grepƥַ򵥴ʸʽļļͨ˵grep ʾƥ䵽Уʹgrepһʽƥ䵽УֻʾʵУgrepΪLinuxUnixϵͳõ -### ֪ ### -grep֣ԴڱʾһƵΪgrepUnixLinuxı༭ǣ - - g/re/p - -### grep﷨ ### - -﷨ʾ: - - grep 'word' filename - grep 'word' file1 file2 file3 - grep 'string1 string2' filename - cat otherfile | grep 'something' - command | grep 'something' - command option1 | grep 'data' - grep --color 'data' fileName - -###ôʹgrepһļ### - - /etc/passwd ļµbooû,: - - $ grep boo /etc/passwd - -: - - foo:x:1000:1000:foo,,,:/home/foo:/bin/ksh - -ʹgrepȥǿƺԴСд i.e ʹ-iƥ boo, Boo, BOO ѡ: - - $ grep -i "boo" /etc/passwd - -### ݹʹgrep ### - -ʹgrepݹ i.e. ļĿ¼аַ192.168.1.5ļ - - $ grep -r "192.168.1.5" /etc/ - -ǣ - - $ grep -R "192.168.1.5" /etc/ - -ʾ: - - /etc/ppp/options:# ms-wins 192.168.1.50 - /etc/ppp/options:# ms-wins 192.168.1.51 - /etc/NetworkManager/system-connections/Wired connection 1:addresses1=192.168.1.5;24;192.168.1.2; - -ῴҵ 192.168.1.5 ĽļΪʾڵ棬֮аļԼ-hѡֹ - $ grep -h -R "192.168.1.5" /etc/ - - - - $ grep -hR "192.168.1.5" /etc/ - -ʾ: - - # ms-wins 192.168.1.50 - # ms-wins 192.168.1.51 - addresses1=192.168.1.5;24;192.168.1.2; - -### ʹgrepȥı ### - -boogrepƥfoobooboo123, barfoo35 booַʹ-wѡȥǿѡЩǸʵС - - $ grep -w "boo" file - -### ʹegrepȥȽϲͬ ### - -ʹegrep: - - $ egrep -w 'word1|word2' /path/to/file - -### ıƥʱͳ ### - -grepͨ-cʾÿļƥ䵽Ĵ - - $ grep -c 'word' /path/to/file - --nѡȥʾǰƥ䵽ļ - - $ grep -n 'root' /etc/passwd - -ʾ: - - 1:root:x:0:0:root:/root:/bin/bash - 1042:rootdoor:x:0:0:rootdoor:/home/rootdoor:/bin/csh - 3319:initrootapp:x:0:0:initrootapp:/home/initroot:/bin/ksh - -### תƥ ### - -ʹ-vѡȥӡƥݣݽЩʵУɾbarʵУ - - $ grep -v bar /path/to/file - -### UNIX / Linux ܵ grep ### - -grep ܵһʹãУʾӲ֣ - - # dmesg | egrep '(s|h)d[a-z]' - -ʾCPUģ - - # cat /proc/cpuinfo | grep -i 'Model' - -Ȼ԰·ʹõͬʱʹùܵ: - - # grep -i 'Model' /proc/cpuinfo - -ʾ: - - model : 30 - model name : Intel(R) Core(TM) i7 CPU Q 820 @ 1.73GHz - model : 30 - model name : Intel(R) Core(TM) i7 CPU Q 820 @ 1.73GHz - -### νʾƥ䵽ݵļ? ### - -ʹ-lѡȥʾЩļаmainļ: - - $ grep -l 'main' *.c - -ʹgrepɫʵʾ: - - $ grep --color vivek /etc/passwd - -ʾ: - -![Grep command in action](http://files.cyberciti.biz/uploads/faq/2007/08/grep_command_examples.png) - - --------------------------------------------------------------------------------- - -via: http://www.cyberciti.biz/faq/howto-use-grep-command-in-linux-unix/ - -ߣVivek Gite -ߣ[zky001](https://github.com/zky001) -Уԣ[УID](https://github.com/УID) - - [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](https://linux.cn/) Ƴ - -УID -[1]:http://bash.cyberciti.biz/guide/Pipes \ No newline at end of file From 67369f4a3294451c370fbdfa005a5b5dd4dfdf8d Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 25 Jan 2016 08:24:34 +0800 Subject: [PATCH 0256/1469] PUB:20160104 How to Check Hardware Information on Linux Using Command Line @sonofelice --- ...Information on Linux Using Command Line.md | 37 ++++++++++--------- 1 file changed, 20 insertions(+), 17 deletions(-) rename {translated/tech => published}/20160104 How to Check Hardware Information on Linux Using Command Line.md (65%) diff --git a/translated/tech/20160104 How to Check Hardware Information on Linux Using Command Line.md b/published/20160104 How to Check Hardware Information on Linux Using Command Line.md similarity index 65% rename from translated/tech/20160104 How to Check Hardware Information on Linux Using Command Line.md rename to published/20160104 How to Check Hardware Information on Linux Using Command Line.md index 9806dd8b0d..cce96867e8 100644 --- a/translated/tech/20160104 How to Check Hardware Information on Linux Using Command Line.md +++ b/published/20160104 How to Check Hardware Information on Linux Using Command Line.md @@ -1,13 +1,15 @@ -Linux系统下使用命令行来查看硬件信息 +Linux 系统下查看硬件信息命令大全 ================================================================================ + ![](https://maketecheasier-holisticmedia.netdna-ssl.com/assets/uploads/2015/12/hdd_info_featured-1.png) -有许多可用的命令可以用来查看Linux系统上的硬件信息。有些命令只能够打印出像CPU和内存这一特定的硬件组件信息,其余的命令可以查看其余硬件单元的信息。 +有许多命令可以用来查看 Linux 系统上的硬件信息。有些命令只能够打印出像 CPU 和内存这一特定的硬件组件信息,另外一些命令可以查看多种硬件组件的信息。 + +这个教程可以带大家快速了解一下查看各种硬件设备的信息和配置详情的最常用的命令。 -这个教程可以带大家快速学习一下查看各种硬件设备的信息和配置详情的最常用的命令。 ### lscpu ### -`lscpu`命令能够查看CPU和处理单元的信息。该命令没有任何其他选项或者别的功能。 +`lscpu`命令能够查看 CPU 和处理单元的信息。该命令没有任何其他选项或者别的功能。 lscpu @@ -17,7 +19,7 @@ Linux系统下使用命令行来查看硬件信息 ### lspci ### -`lspci`是另一个命令行工具,可以用来列出所有的PCI总线,还有与PCI总线相连的设备的详细信息,比如VGA适配器、显卡、网络适配器、usb端口、SATA控制器等。 +`lspci`是另一个命令行工具,可以用来列出所有的 PCI 总线,还有与 PCI 总线相连的设备的详细信息,比如 VGA 适配器、显卡、网络适配器、usb 端口、SATA 控制器等。 lspci @@ -35,7 +37,7 @@ Linux系统下使用命令行来查看硬件信息 ### lshw ### -`lshw`是一个通用的工具,可以列出多种硬件单元的详细或者概要的信息,比如CPU、内存、usb控制器、硬盘等。`lshw`能够从不同的“/proc”文件中提取出相关的信息。 +`lshw`是一个通用的工具,可以列出多种硬件单元的详细或者概要的信息,比如 CPU、内存、usb 控制器、硬盘等。`lshw`能够从各个“/proc”文件中提取出相关的信息。 lshw -short @@ -45,7 +47,7 @@ Linux系统下使用命令行来查看硬件信息 ### lsscsi ### -通过运行下面的命令可以列出像硬盘和光驱等scsi/sata设备的信息: +通过运行下面的命令可以列出像硬盘和光驱等 scsi/sata 设备的信息: lsscsi @@ -55,7 +57,7 @@ Linux系统下使用命令行来查看硬件信息 ### lsusb ### -`lsusb`命令能够列出USB控制器和与USB控制相连的设备的详细信息。默认情况下,`lsusb`命令只打印出概要信息。可以通过使用-v参数打印每一个usb端口的详细信息。 +`lsusb`命令能够列出 USB 控制器和与 USB 控制器相连的设备的详细信息。默认情况下,`lsusb`命令只打印出概要信息。可以通过使用-v参数打印每一个usb端口的详细信息。 lsusb @@ -65,9 +67,9 @@ Linux系统下使用命令行来查看硬件信息 ### Inxi ### -`Inxi`是一个bash脚本,能够从系统的多个源文件和命令行抓取硬件信息,并打印出一个非技术人员也能看懂的友好的报告。 +`Inxi`是一个 bash 脚本,能够从系统的多个来源和命令获取硬件信息,并打印出一个非技术人员也能看懂的友好的报告。 -默认情况下,Ubuntu上没有安装`inxi`。可以通过运行下面命令来安装`Inxi`: +默认情况下,Ubuntu 上没有安装`inxi`。可以通过运行下面命令来安装`Inxi`: sudo apt-get install inxi @@ -81,7 +83,8 @@ Linux系统下使用命令行来查看硬件信息 ### df ### -`df`命令能够列出不同分区的概要信息,挂载点,已用的和可用的空间。 +`df`命令能够列出不同分区的概要信息、挂载点、已用的和可用的空间。 + 可以在使用`df`命令的时候加上`-H`参数。 df -H @@ -92,7 +95,7 @@ Linux系统下使用命令行来查看硬件信息 ### Free ### -通过使用`free`命令可以查看系统中使用的、闲置的和总体的RAM数量。 +通过使用`free`命令可以查看系统中使用的、闲置的和 RAM 的总体数量。 free -m @@ -102,7 +105,7 @@ Linux系统下使用命令行来查看硬件信息 ### Dmidecode ### -`dmidecode`命令与其他命令不同。该命令是从DMI表中读取硬件信息的。 +`dmidecode`命令与其他命令不同。该命令是从硬件中的 DMI 表中读取信息的。 要查看处理器的信息,运行下面命令: @@ -116,7 +119,7 @@ Linux系统下使用命令行来查看硬件信息 ![hdd_info_dmi_memory](https://www.maketecheasier.com/assets/uploads/2015/12/hdd_info_dmi_memory.png) -要查看bios的信息,运行下面命令: +要查看 bios 的信息,运行下面命令: sudo dmidecode -t bios @@ -124,7 +127,7 @@ Linux系统下使用命令行来查看硬件信息 ### Hdparm ### -`hdparm`命令可以用来显示想硬盘这样的sata设备的信息。 +`hdparm`命令可以用来显示像硬盘这样的 sata 设备的信息。 sudo hdparm @@ -134,7 +137,7 @@ Linux系统下使用命令行来查看硬件信息 ### 总结 ### -每个命令都有不同的方式来获取硬件的信息。在查看特定的硬件信息的时候,可以尝试使用不同的方式。上面所有的命令行工具在大部分的Linux发型版本中都是可以使用的,可以很容易的从仓库中获取安装。 +每个命令都有不同的方式来获取硬件的信息。在查看特定的硬件信息的时候,可以尝试使用不同的方式。上面所有的命令行工具在大部分的 Linux 发行版本中都是可以使用的,可以很容易的从仓库中获取安装。 -------------------------------------------------------------------------------- @@ -142,7 +145,7 @@ via: https://www.maketecheasier.com/check-hardware-information-linux/ 作者:[Hitesh Jethva][a] 译者:[sonofelice](https://github.com/sonofelice) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2cdde3e61fd4023baa166b26e5a990bf1f840ed3 Mon Sep 17 00:00:00 2001 From: "Fuliang.Li" Date: Mon, 25 Jan 2016 14:52:51 +0800 Subject: [PATCH 0257/1469] =?UTF-8?q?[=E5=BC=80=E5=A7=8B=E7=BF=BB=E8=AF=91?= =?UTF-8?q?]=2020151028=20Bossie=20Awards=202015--The=20best=20open=20sour?= =?UTF-8?q?ce=20application=20development=20tools?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...015--The best open source application development tools.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/share/20151028 Bossie Awards 2015--The best open source application development tools.md b/sources/share/20151028 Bossie Awards 2015--The best open source application development tools.md index 10da3e7cdc..c135ae0832 100644 --- a/sources/share/20151028 Bossie Awards 2015--The best open source application development tools.md +++ b/sources/share/20151028 Bossie Awards 2015--The best open source application development tools.md @@ -1,3 +1,5 @@ +GHLandy Translating + Bossie Awards 2015: The best open source application development tools ================================================================================ InfoWorld's top picks among platforms, frameworks, databases, and all the other tools that programmers use @@ -333,4 +335,4 @@ via: http://www.infoworld.com/article/2982920/open-source-tools/bossie-awards-20 [43]:http://www.infoworld.com/article/2982429/bossie-awards-2015-the-best-open-source-big-data-tools.html [44]:http://www.infoworld.com/article/2982923/bossie-awards-2015-the-best-open-source-data-center-and-cloud-software.html [45]:http://www.infoworld.com/article/2982630/bossie-awards-2015-the-best-open-source-desktop-and-mobile-software.html -[46]:http://www.infoworld.com/article/2982962/bossie-awards-2015-the-best-open-source-networking-and-security-software.html \ No newline at end of file +[46]:http://www.infoworld.com/article/2982962/bossie-awards-2015-the-best-open-source-networking-and-security-software.html From 4a60db4814867147d93a6a6fde458871242e477c Mon Sep 17 00:00:00 2001 From: wwy Date: Mon, 25 Jan 2016 21:20:17 +0800 Subject: [PATCH 0258/1469] [Translating] Cinnamon 2.8 Review --- sources/talk/20151201 Cinnamon 2.8 Review.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/talk/20151201 Cinnamon 2.8 Review.md b/sources/talk/20151201 Cinnamon 2.8 Review.md index 0c44eba14f..0529cf80ec 100644 --- a/sources/talk/20151201 Cinnamon 2.8 Review.md +++ b/sources/talk/20151201 Cinnamon 2.8 Review.md @@ -1,3 +1,5 @@ +translating by wwy-hust + Cinnamon 2.8 Review ================================================================================ ![](https://www.maketecheasier.com/assets/uploads/2015/11/cinnamon-2-8-featured.jpg) @@ -84,4 +86,4 @@ via: https://www.maketecheasier.com/cinnamon-2-8-review/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:https://www.maketecheasier.com/author/ayoisaiah/ \ No newline at end of file +[a]:https://www.maketecheasier.com/author/ayoisaiah/ From 533734cae7c595f020760737ea5f8b389432831c Mon Sep 17 00:00:00 2001 From: wwy Date: Mon, 25 Jan 2016 23:56:10 +0800 Subject: [PATCH 0259/1469] starting to translate --- translated/talk/20151201 Cinnamon 2.8 Review.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 translated/talk/20151201 Cinnamon 2.8 Review.md diff --git a/translated/talk/20151201 Cinnamon 2.8 Review.md b/translated/talk/20151201 Cinnamon 2.8 Review.md new file mode 100644 index 0000000000..e539136ce1 --- /dev/null +++ b/translated/talk/20151201 Cinnamon 2.8 Review.md @@ -0,0 +1,10 @@ +Cinnamon 2.8 评论 +================================================================================ +![](https://www.maketecheasier.com/assets/uploads/2015/11/cinnamon-2-8-featured.jpg) + +除了Gnome和KDE外,Cinnamon是另一个很多人使用的桌面环境。它是由创作Linux Mint的团队制作的,并且可以被安装在许多其他发行版上。该桌面环境的最新版本 - Cinnamon 2.8 - 于本月早些时间发布,此版本修复了许多的Bug、做了许多改进并添加了一些新功能。 + +我将仔细介绍该发行版本的主要改进,以及如何更新到Cinnamon 2.8或者第一次安装它。 + +### 对Applets的改进 ### + From e8c02dc6f62d813c526359cbf9fbf2c5f65a8b2e Mon Sep 17 00:00:00 2001 From: Ping Date: Tue, 26 Jan 2016 09:33:00 +0800 Subject: [PATCH 0260/1469] Add new source article --- ...ernative Python version on Debian Linux.md | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 sources/tech/20160126 How to change from default to alternative Python version on Debian Linux.md diff --git a/sources/tech/20160126 How to change from default to alternative Python version on Debian Linux.md b/sources/tech/20160126 How to change from default to alternative Python version on Debian Linux.md new file mode 100644 index 0000000000..c498ea0763 --- /dev/null +++ b/sources/tech/20160126 How to change from default to alternative Python version on Debian Linux.md @@ -0,0 +1,91 @@ +How to change from default to alternative Python version on Debian Linux +==================================================== + +Your Debian Linux installation may include multiple python versions and thus also include multiple python binary executables. You can run the following `ls` command to find out what python binary executables are available on your system: + +``` +$ ls /usr/bin/python* +/usr/bin/python /usr/bin/python2 /usr/bin/python2.7 /usr/bin/python3 /usr/bin/python3.4 /usr/bin/python3.4m /usr/bin/python3m +``` + +To check what is your default python version execute: + +``` +$ python --version +Python 2.7.8 +``` + +1、Change python version on per user basis +To change a python version on per user basis you simply create an `alias` within user's home directory. Open `~/.bashrc` file and add new alias to change your default python executable: + +``` +alias python='/usr/bin/python3.4' +``` + +Once you make the above change, re-login or source your `.bashrc` file: + + +``` +$ . ~/.bashrc +``` + +Check your default python version: + +``` +$ python --version +Python 3.4.2 +``` + +2、 Change python version system-wide +To change python version system-wide we can use `update-alternatives` command. Logged in as a root user, first list all available python alternatives: + +``` +# update-alternatives --list python +update-alternatives: error: no alternatives for python +``` + +The above error message means that no python alternatives has been recognized by `update-alternatives` command. For this reason we need to update our alternatives table and include both `python2.7` and `python3.4`: + +``` +# update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1 +update-alternatives: using /usr/bin/python2.7 to provide /usr/bin/python (python) in auto mode +# update-alternatives --install /usr/bin/python python /usr/bin/python3.4 2 +update-alternatives: using /usr/bin/python3.4 to provide /usr/bin/python (python) in auto mode +``` + +The `--install` option take multiple arguments from which it will be able to create a symbolic link. The last argument specified it priority means, if no manual alternative selection is made the alternative with the highest priority number will be set. In our case we have set a priority 2 for `/usr/bin/python3.4` and as a result the `/usr/bin/python3.4` was set as default python version automatically by `update-alternatives` command. + +``` +# python --version +Python 3.4.2 +``` + +Next, we can again list all python alternatives: + +``` +# update-alternatives --list python +/usr/bin/python2.7 +/usr/bin/python3.4 +``` + +From now on, we can anytime switch between the above listed python alternative versions using below command and entering a selection number: + +``` +# update-alternatives --config python +``` + +![](http://linuxconfig.org/images/change-python-alternative-version-debian-linux.png) + +``` +# python --version +Python 2.7.8 +``` + +3、 Appendix +In case we no longer have the alternative python version installed on our system we can remove its `update-alternatives` listing. For example let's remove python2.7 version: + +``` +# update-alternatives --remove python /usr/bin/python2.7 +update-alternatives: removing manually selected alternative - switching python to auto mode +update-alternatives: using /usr/bin/python3.4 to provide /usr/bin/python (python) in auto mode +``` From 47816aa16d78d56ea813233c74b143f335358ba2 Mon Sep 17 00:00:00 2001 From: Ping Date: Tue, 26 Jan 2016 09:34:58 +0800 Subject: [PATCH 0261/1469] Translating by Ping --- ...rom default to alternative Python version on Debian Linux.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160126 How to change from default to alternative Python version on Debian Linux.md b/sources/tech/20160126 How to change from default to alternative Python version on Debian Linux.md index c498ea0763..4dafe1b604 100644 --- a/sources/tech/20160126 How to change from default to alternative Python version on Debian Linux.md +++ b/sources/tech/20160126 How to change from default to alternative Python version on Debian Linux.md @@ -1,3 +1,5 @@ +Translating by Ping + How to change from default to alternative Python version on Debian Linux ==================================================== From 7ecec2e32745b6139851681b47fd0c5234e6ea6d Mon Sep 17 00:00:00 2001 From: Ping Date: Tue, 26 Jan 2016 10:07:07 +0800 Subject: [PATCH 0262/1469] Add copyright on the tail --- ...lt to alternative Python version on Debian Linux.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sources/tech/20160126 How to change from default to alternative Python version on Debian Linux.md b/sources/tech/20160126 How to change from default to alternative Python version on Debian Linux.md index 4dafe1b604..e5b26e3c13 100644 --- a/sources/tech/20160126 How to change from default to alternative Python version on Debian Linux.md +++ b/sources/tech/20160126 How to change from default to alternative Python version on Debian Linux.md @@ -91,3 +91,13 @@ In case we no longer have the alternative python version installed on our system update-alternatives: removing manually selected alternative - switching python to auto mode update-alternatives: using /usr/bin/python3.4 to provide /usr/bin/python (python) in auto mode ``` + +-------------------------------------------------------------------------------- + +via: http://linuxconfig.org/how-to-change-from-default-to-alternative-python-version-on-debian-linux + +作者:[作者][] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 904f3fb4cd3da52bcee28319670564d9a02e6ae4 Mon Sep 17 00:00:00 2001 From: sailing Date: Tue, 26 Jan 2016 11:37:42 +0800 Subject: [PATCH 0263/1469] claim an article --- ...20150709 Interviews--Linus Torvalds Answers Your Question.md | 2 ++ 1 file changed, 2 insertions(+) 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 bb04ddf0c8..c27e90fd7d 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,5 @@ +[translating by ray] + 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]. From ca77778c20319ef06304cb4fdd432f8ea23e5029 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 27 Jan 2016 11:32:24 +0800 Subject: [PATCH 0264/1469] PUB:20151127 Linux or UNIX grep Command Tutorial series 2--Regular Expressions In grep @runningwater --- ...l series 2--Regular Expressions In grep.md | 240 +++++++++++++++ ...l series 2--Regular Expressions In grep.md | 288 ------------------ 2 files changed, 240 insertions(+), 288 deletions(-) create mode 100755 published/20151127 Linux or UNIX grep Command Tutorial series 2--Regular Expressions In grep.md delete mode 100755 translated/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 2--Regular Expressions In grep.md diff --git a/published/20151127 Linux or UNIX grep Command Tutorial series 2--Regular Expressions In grep.md b/published/20151127 Linux or UNIX grep Command Tutorial series 2--Regular Expressions In grep.md new file mode 100755 index 0000000000..11e656c666 --- /dev/null +++ b/published/20151127 Linux or UNIX grep Command Tutorial series 2--Regular Expressions In grep.md @@ -0,0 +1,240 @@ +grep 命令系列:grep 中的正则表达式 +================================================================================ + +在 Linux 、类 Unix 系统中我该如何使用 Grep 命令的正则表达式呢? + +Linux 附带有 GNU grep 命令工具,它支持扩展正则表达式(extended regular expressions),而且 GNU grep 在所有的 Linux 系统中都是默认有的。Grep 命令被用于搜索定位存储在您服务器或工作站上的任何信息。 + +### 正则表达式 ### + +正则表达式就是用于匹配每行输入的一种模式,模式是指一串字符序列。下面是范例: + + ^w1 + w1|w2 + [^ ] + +#### grep 正则表达式示例 #### + +在 /etc/passswd 目录中搜索 'vivek' + + grep vivek /etc/passwd + +输出例子: + + vivek:x:1000:1000:Vivek Gite,,,:/home/vivek:/bin/bash + vivekgite:x:1001:1001::/home/vivekgite:/bin/sh + gitevivek:x:1002:1002::/home/gitevivek:/bin/sh + +搜索大小写任意的 vivek(即不区分大小写的搜索) + + grep -i -w vivek /etc/passwd + +搜索大小写任意的 vivek 或 raj + + grep -E -i -w 'vivek|raj' /etc/passwd + +上面最后的例子显示的,就是一个扩展的正则表达式的模式。 + +### 锚点 ### + +你可以分别使用 ^ 和 $ 符号来正则匹配输入行的开始或结尾。下面的例子搜索显示仅仅以 vivek 开始的输入行: + + grep ^vivek /etc/passwd + +输出例子: + + vivek:x:1000:1000:Vivek Gite,,,:/home/vivek:/bin/bash + vivekgite:x:1001:1001::/home/vivekgite:/bin/sh + +你可以仅仅只搜索出以单词 vivek 开始的行,即不显示 vivekgit、vivekg 等(LCTT 译注:即该单词后面是空格、符号等英文的单词分隔符。) + + grep -w ^vivek /etc/passwd + +找出以单词 word 结尾的行: + + grep 'foo$' 文件名 + +匹配仅仅只包含 foo 的行: + + grep '^foo$' 文件名 + +如下所示的例子可以搜索空行: + + grep '^$' 文件名 + +### 字符类 ### + +匹配 Vivek 或 vivek: + + grep '[vV]ivek' 文件名 + +或者 + + grep '[vV][iI][Vv][Ee][kK]' 文件名 + +也可以匹配数字 (即匹配 vivek1 或 Vivek2 等等): + + grep -w '[vV]ivek[0-9]' 文件名 + +可以匹配两个数字字符(即 foo11、foo12 等): + + grep 'foo[0-9][0-9]' 文件名 + +不仅仅局限于数字,也能匹配至少一个字母的: + + grep '[A-Za-z]' 文件名 + +显示含有 "w" 或 "n" 字符的所有行: + + grep [wn] 文件名 + +放在括号内的表达式,即包在 "[:" 和 ":]" 之间的字符类的名字,它表示的是属于此类的所有字符列表。标准的字符类名称如下: + +- [:alnum:] - 字母数字字符 +- [:alpha:] - 字母字符 +- [:blank:] - 空字符: 空格键符 和 制表符 +- [:digit:] - 数字: '0 1 2 3 4 5 6 7 8 9' +- [:lower:] - 小写字母: 'a b c d e f g h i j k l m n o p q r s t u v w x y z' +- [:space:] - 空格字符: 制表符、换行符、垂直制表符、换页符、回车符和空格键符 +- [:upper:] - 大写字母: 'A B C D E F G H I J K L M N O P Q R S T U V W X Y Z' + +在这个例子所示的是匹配所有大写字母: + + grep '[:upper:]' 文件名 + +### 通配符 ### + +你可以使用 "." 来匹配单个字符。例子中匹配以 "b" 开头以 "t" 结尾的3个字符的单词: + + grep '\' 文件名 + +在这儿, + +- `\<` 匹配单词前面的空字符串 +- `\>` 匹配单词后面的空字符串 + +打印出只有两个字符的所有行: + + grep '^..$' 文件名 + +显示以一个点和一个数字开头的行: + + grep '^\.[0-9]' 文件名 + +#### 点字符转义 #### + +下面要匹配到 IP 地址为 192.168.1.254 的正则式是不正确的:(LCTT 译注:可以匹配到该 IP 地址,但是也有可能匹配到间隔符号不是点的类似格式) + + grep '192.168.1.254' /etc/hosts + +三个点字符都需要转义: + + grep '192\.168\.1\.254' /etc/hosts + +下面的例子只能匹配出 IP 地址:(LCTT 译注:实际上由于 IP 地址中数字的取值范围,该正则表达式并不精确) + + egrep '[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}' 文件名 + +### 怎么样搜索以 - 符号开头的匹配模式? ### + +要使用 -e 选项来搜索匹配 '--test--' 字符串,如果不使用 -e 选项,grep 命令会试图把 '--test--' 当作自己的选项参数来解析: + + grep -e '--test--' 文件名 + +### 怎么使用 grep 的“或”匹配? ### + +使用如下的语法: + + grep -E 'word1|word2' 文件名 + 或 + egrep 'word1|word2' 文件名 + +或者是 + + grep 'word1\|word2' 文件名 + +### 怎么使用 grep 的“和”匹配? ### + +使用下面的语法来显示既包含 'word1' 又包含 'word2' 的所有行 + + grep 'word1' 文件名 | grep 'word2' + +### 怎么样使用序列检测? ### + +使用如下的语法,您可以检测一个字符在序列中重复出现次数: + + {N} + {N,} + {min,max} + +要匹配字符 “v" 出现两次: + + egrep "v{2}" 文件名 + +下面的命令能匹配到 "col" 和 "cool" : + + egrep 'co{1,2}l' 文件名 + +下面的命令将会匹配出至少有三个 'c' 字符的所有行。 + + egrep 'c{3,}' 文件名 + +下面的例子会匹配 91-1234567890(即二个数字-十个数字) 这种格式的手机号。 + + grep "[[:digit:]]\{2\}[ -]\?[[:digit:]]\{10\}" 文件名 + +### 怎么样使 grep 命令高亮显示?### + +使用如下的语法: + + grep --color 正则表达式 文件名 + +### 怎么样仅仅只显示匹配出的字符,而不是匹配出的行? ### + +使用如下语法: + + grep -o 正则表达式 文件名 + +### 正则表达式限定符### + +| 限定符 | 描述| +|------|----| +|`.`|匹配任意的一个字符。| +|`?`|匹配前面的子表达式,最多一次。| +|`*`|匹配前面的子表达式零次或多次。| +|`+`|匹配前面的子表达式一次或多次。| +|`{N}`|匹配前面的子表达式 N 次。| +|`{N,}`|匹配前面的子表达式 N 次到多次。| +|`{N,M}`|匹配前面的子表达式 N 到 M 次,至少 N 次至多 M 次。| +|`-`|只要不是在序列开始、结尾或者序列的结束点上,表示序列范围。| +|`^`|匹配一行开始的空字符串;也表示字符不在要匹配的列表中。| +|`$`|匹配一行末尾的空字符串。| +|`\b`|匹配一个单词前后的空字符串。| +|`\B`|匹配一个单词中间的空字符串。| +|`\<`|匹配单词前面的空字符串。| +|`\>`|匹配单词后面的空字符串。| + +#### grep 和 egrep #### + +egrep 等同于 **grep -E** 。它会以扩展的正则表达式的模式来解释模式。下面来自 grep 的帮助页: + + 基本的正则表达式元字符 ?、+、 {、 |、 ( 和 ) 已经失去了它们原来的意义,要使用的话用反斜线的版本 \?、\+、\{、\|、\( 和 \) 来代替。 + 传统的 egrep 并不支持 { 元字符,一些 egrep 的实现是以 \{ 替代的,所以一个可移植的脚本应该避免在 grep -E 使用 { 符号,要匹配字面的 { 应该使用 [}]。 + GNU grep -E 试图支持传统的用法,如果 { 出在在无效的间隔规范字符串这前,它就会假定 { 不是特殊字符。 + 例如,grep -E '{1' 命令搜索包含 {1 两个字符的串,而不会报出正则表达式语法错误。 + POSIX.2 标准允许这种操作的扩展,但在可移植脚本文件里应该避免这样使用。 + +参考: + +- grep 和 regex 帮助手册页(7) +- grep 的 info 页 + +-------------------------------------------------------------------------------- + +via: http://www.cyberciti.biz/faq/grep-regular-expressions/ + +作者:Vivek Gite +译者:[runningwater](https://github.com/runningwater) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 \ No newline at end of file diff --git a/translated/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 2--Regular Expressions In grep.md b/translated/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 2--Regular Expressions In grep.md deleted file mode 100755 index 8389f4c339..0000000000 --- a/translated/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 2--Regular Expressions In grep.md +++ /dev/null @@ -1,288 +0,0 @@ -## grep 中的正则表达式 -================================================================================ -在 Linux 、类 Unix 系统中我该如何使用 Grep 命令的正则表达式呢? - -Linux 附带有 GNU grep 命令工具,它支持正则表达式,而且 GNU grep 在所有的 Linux 系统中都是默认有的。Grep 命令被用于搜索定位存储在您服务器或工作站的信息。 - -### 正则表达式 ### - -正则表达式仅仅是对每个输入行的匹配的一种模式,即对字符序列的匹配模式。下面是范例: - - ^w1 - w1|w2 - [^ ] - -#### grep 正则表达式示例 #### - -在 /etc/passswd 目录中搜索 'vivek' - - grep vivek /etc/passwd - -输出例子: - - vivek:x:1000:1000:Vivek Gite,,,:/home/vivek:/bin/bash - vivekgite:x:1001:1001::/home/vivekgite:/bin/sh - gitevivek:x:1002:1002::/home/gitevivek:/bin/sh - -摸索任何情况下的 vivek(即不区分大小写的搜索) - - grep -i -w vivek /etc/passwd - -摸索任何情况下的 vivek 或 raj - - grep -E -i -w 'vivek|raj' /etc/passwd - -上面最后的例子显示的,就是一个正则表达式扩展的模式。 - -### 锚 ### - -你可以分别使用 ^ 和 $ 符号来正则匹配输入行的开始或结尾。下面的例子搜索显示仅仅以 vivek 开始的输入行: - - grep ^vivek /etc/passwd - -输出例子: - - vivek:x:1000:1000:Vivek Gite,,,:/home/vivek:/bin/bash - vivekgite:x:1001:1001::/home/vivekgite:/bin/sh - -你可以仅仅只搜索出以单词 vivek 开始的行,即不显示 vivekgit、vivekg 等 - - grep -w ^vivek /etc/passwd - -找出以单词 word 结尾的行: - - grep 'foo$' 文件名 - -匹配仅仅只包含 foo 的行: - - grep '^foo$' 文件名 - -如下所示的例子可以搜索空行: - - grep '^$' 文件名 - -### 字符类 ### - -匹配 Vivek 或 vivek: - - grep '[vV]ivek' 文件名 - -或者 - - grep '[vV][iI][Vv][Ee][kK]' 文件名 - -也可以匹配数字 (即匹配 vivek1 或 Vivek2 等等): - - grep -w '[vV]ivek[0-9]' 文件名 - -可以匹配两个数字字符(即 foo11、foo12 等): - - grep 'foo[0-9][0-9]' 文件名 - -不仅仅局限于数字,也能匹配至少一个字母的: - - grep '[A-Za-z]' 文件名 - -显示含有"w" 或 "n" 字符的所有行: - - grep [wn] 文件名 - -在括号内的表达式,即包在"[:" 和 ":]" 之间的字符类的名字,它表示的是属于此类的所有字符列表。标准的字符类名称如下: - -- [:alnum:] - 字母数字字符. -- [:alpha:] - 字母字符 -- [:blank:] - 空字符: 空格键符 和 制表符. -- [:digit:] - 数字: '0 1 2 3 4 5 6 7 8 9'. -- [:lower:] - 小写字母: 'a b c d e f g h i j k l m n o p q r s t u v w x y z'. -- [:space:] - 空格字符: 制表符、换行符、垂直制表符、换页符、回车符和空格键符. -- [:upper:] - 大写字母: 'A B C D E F G H I J K L M N O P Q R S T U V W X Y Z'. - -例子所示的是匹配所有大写字母: - - grep '[:upper:]' 文件名 - -### 通配符 ### - -你可以使用 "." 来匹配单个字符。例子中匹配以"b"开头以"t"结尾的3个字符的单词: - - grep '\' 文件名 - -在这儿, - -- \< 匹配单词前面的空字符串 -- \> 匹配单词后面的空字符串 - -打印出只有两个字符的所有行: - - grep '^..$' 文件名 - -显示以一个点和一个数字开头的行: - - grep '^\.[0-9]' 文件名 - -#### 点号转义 #### - -下面要匹配到 IP 地址为 192.168.1.254 的正则式是不会工作的: - - egrep '192.168.1.254' /etc/hosts - -三个点符号都需要转义: - - grep '192\.168\.1\.254' /etc/hosts - -下面的例子仅仅匹配出 IP 地址: - - egrep '[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}' 文件名 - -下面的例子会匹配任意大小写的 Linux 或 UNIX 这两个单词: - - egrep -i '^(linux|unix)' 文件名 - -### 怎么样搜索以 - 符号开头的匹配模式? ### - -要使用 -e 选项来搜索匹配 '--test--' 字符串,如果不使用 -e 选项,grep 命令会试图把 '--test--' 当作自己的选项参数来解析: - - grep -e '--test--' 文件名 - -### 怎么使用 grep 的 OR 匹配? ### - -使用如下的语法: - - grep 'word1|word2' 文件名 - -或者是 - - grep 'word1\|word2' 文件名 - -### 怎么使用 grep 的 AND 匹配? ### - -使用下面的语法来显示既包含 'word1' 又包含 'word2' 的所有行 - - grep 'word1' 文件名 | grep 'word2' - -### 怎么样使用序列检测? ### - -使用如下的语法,您可以检测一个字符在序列中重复出现次数: - - {N} - {N,} - {min,max} - -要匹配字符 “v" 出现两次: - - egrep "v{2}" 文件名 - -下面的命令能匹配到 "col" 和 "cool" : - - egrep 'co{1,2}l' 文件名 - -下面的命令将会匹配出至少有三个 'c' 字符的所有行。 - - egrep 'c{3,}' 文件名 - -下面的例子会匹配 91-1234567890(即二个数字-十个数字) 这种格式的手机号。 - - grep "[[:digit:]]\{2\}[ -]\?[[:digit:]]\{10\}" 文件名 - -### 怎么样使 grep 命令突出显示?### - -使用如下的语法: - - grep --color regex 文件名 - -### 怎么样仅仅只显示匹配出的字符,而不是匹配出的行? ### - -使用如下语法: - - grep -o regex 文件名 - -### 正则表达式限定符### - -注:表格 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
限定符描述
.匹配任意的一个字符.
?匹配前面的子表达式,最多一次。
*匹配前面的子表达式零次或多次。
+匹配前面的子表达式一次或多次。
{N}匹配前面的子表达式 N 次。
{N,}匹配前面的子表达式 N 次到多次。
{N,M}匹配前面的子表达式 N 到 M 次,至少 N 次至多 M 次。
-只要不是在序列开始、结尾或者序列的结束点上,表示序列范围
^匹配一行开始的空字符串;也表示字符不在要匹配的列表中。
$匹配一行末尾的空字符串。
\b匹配一个单词前后的空字符串。
\B匹配一个单词中间的空字符串
\<匹配单词前面的空字符串。
\> 匹配单词后面的空字符串。
- -#### grep 和 egrep #### - -egrep 跟 **grep -E** 是一样的。他会以正则表达式的模式来解释。下面是 grep 的帮助页(man): - - 基本的正则表达式元字符 ?、+、 {、 |、 ( 和 ) 已经失去了他们特殊的意义,要使用的话用反斜线的版本 \?、\+、\{、\|、\( 和 \) 来代替。 - 传统的 egrep 不支持 { 元字符,一些 egrep 的实现是以 \{ 替代的,所以有 grep -E 的通用脚本应该避免使用 { 符号,要匹配字面的 { 应该使用 [}]。 - GNU grep -E 试图支持传统的用法,如果 { 出在在无效的间隔规范字符串这前,它就会假定 { 不是特殊字符。 - 例如,grep -E '{1' 命令搜索包含 {1 两个字符的串,而不会报出正则表达式语法错误。 - POSIX.2 标准允许对这种操作的扩展,但在可移植脚本文件里应该避免这样使用。 - -引用: - -- grep 和 regex 帮助手册页(7) -- grep 的 info 页` - --------------------------------------------------------------------------------- - -via: http://www.cyberciti.biz/faq/grep-regular-expressions/ - -作者:Vivek Gite -译者:[runningwater](https://github.com/runningwater) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 \ No newline at end of file From 8cca4d5f4f90e8cd352afff25df2fdf3791adb82 Mon Sep 17 00:00:00 2001 From: wwy Date: Wed, 27 Jan 2016 16:06:14 +0800 Subject: [PATCH 0265/1469] another translation --- .../talk/20151201 Cinnamon 2.8 Review.md | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/translated/talk/20151201 Cinnamon 2.8 Review.md b/translated/talk/20151201 Cinnamon 2.8 Review.md index e539136ce1..e06ba31a93 100644 --- a/translated/talk/20151201 Cinnamon 2.8 Review.md +++ b/translated/talk/20151201 Cinnamon 2.8 Review.md @@ -8,3 +8,43 @@ Cinnamon 2.8 评论 ### 对Applets的改进 ### +在此版本中,对已经在面板中存在的Applets做了若干的改进。 + +#### 声音 Applet #### + +![cinnamon-28-sound-applet](https://www.maketecheasier.com/assets/uploads/2015/11/rsz_cinnamon-28-sound-applet.jpg) + +声音Applet经过修订,目前可以显示音轨信息并且可以在音频文件的艺术家封面上面进行媒体控制。对于支持拖动的音乐播放器来说(例如Banshee),会有一个进度条在同样的位置,您可以用它来改变音轨位置。在applet的面板上右击将显示对输入和输出静音的选项。 + +#### 电源 Applet #### + +电源applet则会使用制造商的数据而不是通用名称显示每一个连接的电池和设备。 + +#### 窗口缩略图 #### + +![cinnamon-2.8-window-thumbnails](https://www.maketecheasier.com/assets/uploads/2015/11/cinnamon-2.8-window-thumbnails.png) + +Cinnamon 2.8带来了可以在鼠标悬停于面板里窗口列表中的窗口时展示窗口缩略图的选项。如果您不喜欢该功能,您还可以关闭它。 + +#### 工作区切换 Applet #### + +![cinnamon-2.8-workspace-switcher](https://www.maketecheasier.com/assets/uploads/2015/11/cinnamon-2.8-workspace-switcher.png) + +添加工作区切换applet到您的面板将为您显示一个代表工作区的可视化的图像,一些矩形嵌套在其中,代表您的窗口的位置。 + +#### 系统托盘 #### + +Cinnamon 2.8带来了对系统托盘中的应用程序指示器的支持。您可以容易地在设置中禁用它,这将强制应用程序回滚以使用 + + + + + + + + + + + + + From 1d242fa4c4cfff054326f52f223f36a348cdd3a0 Mon Sep 17 00:00:00 2001 From: wwy Date: Wed, 27 Jan 2016 17:02:04 +0800 Subject: [PATCH 0266/1469] finish translation --- .../talk/20151201 Cinnamon 2.8 Review.md | 39 ++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/translated/talk/20151201 Cinnamon 2.8 Review.md b/translated/talk/20151201 Cinnamon 2.8 Review.md index e06ba31a93..209ee05cd6 100644 --- a/translated/talk/20151201 Cinnamon 2.8 Review.md +++ b/translated/talk/20151201 Cinnamon 2.8 Review.md @@ -34,17 +34,54 @@ Cinnamon 2.8带来了可以在鼠标悬停于面板里窗口列表中的窗口 #### 系统托盘 #### -Cinnamon 2.8带来了对系统托盘中的应用程序指示器的支持。您可以容易地在设置中禁用它,这将强制应用程序回滚以使用 +Cinnamon 2.8带来了对系统托盘中的应用程序指示器的支持。您可以很容易地在设置中禁用它,这将强制应用程序回滚以使用状态图标作为替代。 +### 视觉改进 ### +Cinnamon 2.8还做了很多视觉上的改进。经典的切换器和Alt + Tab预览切换器都被细细打磨,有了显著的改进,同时修复了Alt + F2对话框的bug,并赋予了它更好的命令自动补全功能。 +而且,在于最小化窗口时的存在的传统的动画效果中的问题现已被解决并可用于多个面板。 +### Nemo 的改进 ### +![cinnamon-2.8-nemo](https://www.maketecheasier.com/assets/uploads/2015/11/rsz_cinnamon-28-nemo.jpg) +Cinnamon默认的文件管理器也修复了一些bug,并有了新的“快速重命名”的功能,用于重命名文件和文件夹。可以通过两次点击文件或文件夹并在两次点击之前进行简短的停顿以重命名文件。 +Nemo也会自动地检测缩略图存在的问题,并提示您快速地修复它们。 +### 其他值得注意的改进 ### +- Applets如今会在它们被更新的时候自动地重新加载一次。 +- 对于多个监视器的支持有了显著的提高。 +- 对话框窗口有了提高,并且会附加到它的父窗口上。 +- HiDPI检测有了改进。 +- QT5应用程序现在看起来更加原生并使用了默认的GTK主题。 +- 窗口管理和渲染性能有了提升。 +- 修复了许多bug。 +### 如何获得 Cinnamon 2.8 ### +如果您在运行Linux Mint,您会在更新Linux Mint 17.3 “Rosa”Cinnamon版本的时候获得Cinnamon 2.8的更新。BETA版本现在已经放出,因此,如果您想立刻尝试新的软件,您可以试试。 +对于Arch的用户来说,Cinnamon 2.8已经在Arch的官方仓库了,您可以通过更新软件包和系统级的更新获得Cinnamon的最新版本。 +最后,对于Ubuntu用户来说,您可以通过下面的命令安装或更新Cinnamon 2.8: + + sudo add-apt-repository -y ppa:moorkai/cinnamon + sudo apt-get update + sudo apt-get install cinnamon + +您已经尝试了Cinnamon 2.8了么?感觉如何呢? + +-------------------------------------------------------------------------------- + +via: https://www.maketecheasier.com/cinnamon-2-8-review/ + +作者:[Ayo Isaiah][a] +译者:[wwy-hust](https://github.com/wwy-hust) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.maketecheasier.com/author/ayoisaiah/ From c3168e64e88f5d362c8f80bd1908d3615f20a72d Mon Sep 17 00:00:00 2001 From: wwy Date: Wed, 27 Jan 2016 17:03:14 +0800 Subject: [PATCH 0267/1469] remove source --- sources/talk/20151201 Cinnamon 2.8 Review.md | 89 -------------------- 1 file changed, 89 deletions(-) delete mode 100644 sources/talk/20151201 Cinnamon 2.8 Review.md diff --git a/sources/talk/20151201 Cinnamon 2.8 Review.md b/sources/talk/20151201 Cinnamon 2.8 Review.md deleted file mode 100644 index 0529cf80ec..0000000000 --- a/sources/talk/20151201 Cinnamon 2.8 Review.md +++ /dev/null @@ -1,89 +0,0 @@ -translating by wwy-hust - -Cinnamon 2.8 Review -================================================================================ -![](https://www.maketecheasier.com/assets/uploads/2015/11/cinnamon-2-8-featured.jpg) - -Other than Gnome and KDE, Cinnamon is another desktop environment that is used by many people. It is made by the same team that produces Linux Mint (and ships with Linux Mint) and can also be installed on several other distributions. The latest version of this DE – Cinnamon 2.8 – was released earlier this month, and it brings a host of bug fixes and improvements as well as some new features. - -I’m going to go over the major improvements made in this release as well as how to update to Cinnamon 2.8 or install it for the first time. - -### Improvements to Applets ### - -There are several improvements to already existing applets for the panel. - -#### Sound Applet #### - -![cinnamon-28-sound-applet](https://www.maketecheasier.com/assets/uploads/2015/11/rsz_cinnamon-28-sound-applet.jpg) - -The Sound applet was revamped and now displays track information as well as the media controls on top of the cover art of the audio file. For music players with seeking support (such as Banshee), a progress bar will be displayed in the same region which you can use to change the position of the audio track. Right-clicking on the applet in the panel will display the options to mute input and output devices. - -#### Power Applet #### - -The Power applet now displays the status of each of the connected batteries and devices using the manufacturer’s data instead of generic names. - -#### Window Thumbnails #### - -![cinnamon-2.8-window-thumbnails](https://www.maketecheasier.com/assets/uploads/2015/11/cinnamon-2.8-window-thumbnails.png) - -Cinnamon 2.8 brings the option to show window thumbnails when hovering over the window list in the panel. You can turn it off if you don’t like it, though. - -#### Workspace Switcher Applet #### - -![cinnamon-2.8-workspace-switcher](https://www.maketecheasier.com/assets/uploads/2015/11/cinnamon-2.8-workspace-switcher.png) - -Adding the Workspace switcher applet to your panel will show you a visual representation of your workspaces with little rectangles embedded inside to show the position of your windows. - -#### System Tray #### - -Cinnamon 2.8 brings support for app indicators in the system tray. You can easily disable this in the settings which will force affected apps to fall back to using status icons instead. - -### Visual Improvements ### - -A host of visual improvements were made in Cinnamon 2.8. The classic and preview Alt + Tab switchers were polished with noticeable improvements, while the Alt + F2 dialog received bug fixes and better auto completion for commands. - -Also, the issue with the traditional animation effect for minimizing windows is now sorted and works with multiple panels. - -### Nemo Improvements ### - -![cinnamon-2.8-nemo](https://www.maketecheasier.com/assets/uploads/2015/11/rsz_cinnamon-28-nemo.jpg) - -The default file manager for Cinnamon also received several bug fixes and has a new “Quick-rename” feature for renaming files and directories. This works by clicking the file or directory twice with a short pause in between to rename the files. - -Nemo also detects issues with thumbnails automatically and prompts you to quickly fix them. - -### Other Notable improvements ### - -- Applets now reload themselves automatically once they are updated. -- Support for multiple monitors was improved significantly. -- Dialog windows have been improved and now attach themselves to their parent windows. -- HiDPI dectection has been improved. -- QT5 applications now look more native and use the default GTK theme. -- Window management and rendering performance has been improved. -- There are various bugfixes. - -### How to Get Cinnamon 2.8 ### - -If you’re running Linux Mint you will get Cinnamon 2.8 as part of the upgrade to Linux Mint 17.3 “Rosa” Cinnamon Edition. The BETA release is already out, so you can grab that if you’d like to get your hands on the new software immediately. - -For Arch users, Cinnamon 2.8 is already in the official Arch repositories, so you can just update your packages and do a system-wide upgrade to get the latest version. - -Finally, for Ubuntu users, you can install or upgrade to Cinnamon 2.8 by running in turn the following commands: - - sudo add-apt-repository -y ppa:moorkai/cinnamon - sudo apt-get update - sudo apt-get install cinnamon - -Have you tried Cinnamon 2.8? What do you think of it? - --------------------------------------------------------------------------------- - -via: https://www.maketecheasier.com/cinnamon-2-8-review/ - -作者:[Ayo Isaiah][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.maketecheasier.com/author/ayoisaiah/ From 6df20a2e20a3909187912b001f95235bb28e25f6 Mon Sep 17 00:00:00 2001 From: Ping Date: Thu, 28 Jan 2016 14:38:36 +0800 Subject: [PATCH 0268/1469] [Translated] 20160126 How to change from default to alternative Python version on Debian Linux --- ...ernative Python version on Debian Linux.md | 103 ------------------ ...ernative Python version on Debian Linux.md | 102 +++++++++++++++++ 2 files changed, 102 insertions(+), 103 deletions(-) delete mode 100644 sources/tech/20160126 How to change from default to alternative Python version on Debian Linux.md create mode 100644 translated/tech/20160126 How to change from default to alternative Python version on Debian Linux.md diff --git a/sources/tech/20160126 How to change from default to alternative Python version on Debian Linux.md b/sources/tech/20160126 How to change from default to alternative Python version on Debian Linux.md deleted file mode 100644 index e5b26e3c13..0000000000 --- a/sources/tech/20160126 How to change from default to alternative Python version on Debian Linux.md +++ /dev/null @@ -1,103 +0,0 @@ -Translating by Ping - -How to change from default to alternative Python version on Debian Linux -==================================================== - -Your Debian Linux installation may include multiple python versions and thus also include multiple python binary executables. You can run the following `ls` command to find out what python binary executables are available on your system: - -``` -$ ls /usr/bin/python* -/usr/bin/python /usr/bin/python2 /usr/bin/python2.7 /usr/bin/python3 /usr/bin/python3.4 /usr/bin/python3.4m /usr/bin/python3m -``` - -To check what is your default python version execute: - -``` -$ python --version -Python 2.7.8 -``` - -1、Change python version on per user basis -To change a python version on per user basis you simply create an `alias` within user's home directory. Open `~/.bashrc` file and add new alias to change your default python executable: - -``` -alias python='/usr/bin/python3.4' -``` - -Once you make the above change, re-login or source your `.bashrc` file: - - -``` -$ . ~/.bashrc -``` - -Check your default python version: - -``` -$ python --version -Python 3.4.2 -``` - -2、 Change python version system-wide -To change python version system-wide we can use `update-alternatives` command. Logged in as a root user, first list all available python alternatives: - -``` -# update-alternatives --list python -update-alternatives: error: no alternatives for python -``` - -The above error message means that no python alternatives has been recognized by `update-alternatives` command. For this reason we need to update our alternatives table and include both `python2.7` and `python3.4`: - -``` -# update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1 -update-alternatives: using /usr/bin/python2.7 to provide /usr/bin/python (python) in auto mode -# update-alternatives --install /usr/bin/python python /usr/bin/python3.4 2 -update-alternatives: using /usr/bin/python3.4 to provide /usr/bin/python (python) in auto mode -``` - -The `--install` option take multiple arguments from which it will be able to create a symbolic link. The last argument specified it priority means, if no manual alternative selection is made the alternative with the highest priority number will be set. In our case we have set a priority 2 for `/usr/bin/python3.4` and as a result the `/usr/bin/python3.4` was set as default python version automatically by `update-alternatives` command. - -``` -# python --version -Python 3.4.2 -``` - -Next, we can again list all python alternatives: - -``` -# update-alternatives --list python -/usr/bin/python2.7 -/usr/bin/python3.4 -``` - -From now on, we can anytime switch between the above listed python alternative versions using below command and entering a selection number: - -``` -# update-alternatives --config python -``` - -![](http://linuxconfig.org/images/change-python-alternative-version-debian-linux.png) - -``` -# python --version -Python 2.7.8 -``` - -3、 Appendix -In case we no longer have the alternative python version installed on our system we can remove its `update-alternatives` listing. For example let's remove python2.7 version: - -``` -# update-alternatives --remove python /usr/bin/python2.7 -update-alternatives: removing manually selected alternative - switching python to auto mode -update-alternatives: using /usr/bin/python3.4 to provide /usr/bin/python (python) in auto mode -``` - --------------------------------------------------------------------------------- - -via: http://linuxconfig.org/how-to-change-from-default-to-alternative-python-version-on-debian-linux - -作者:[作者][] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/translated/tech/20160126 How to change from default to alternative Python version on Debian Linux.md b/translated/tech/20160126 How to change from default to alternative Python version on Debian Linux.md new file mode 100644 index 0000000000..0438614ddb --- /dev/null +++ b/translated/tech/20160126 How to change from default to alternative Python version on Debian Linux.md @@ -0,0 +1,102 @@ +如何将 Debian Linux 系统中默认的 Python 替代为其他版本 +==================================================== + +当你安装 Debian Linux 时,安装过程有可能同时为你提供多个可用的 Python 版本,因此系统中会存在多个 Python 的可执行二进制文件。你可以按照以下方法使用 `ls` 命令来查看你的系统中都有那些 Python 的二进制文件可供使用。 + +``` +$ ls /usr/bin/python* +/usr/bin/python /usr/bin/python2 /usr/bin/python2.7 /usr/bin/python3 /usr/bin/python3.4 /usr/bin/python3.4m /usr/bin/python3m +``` + +执行如下命令查看默认的 Python 版本信息: + +``` +$ python --version +Python 2.7.8 +``` + +1、基于用户修改 Python 版本: +想要为某个特定用户修改 Python 版本,只需要在其 home 目录下创建一个 `alias(别名)` 即可。打开 `~/.bashrc` 文件,添加新的别名信息来修改默认使用的 Python 版本。 + +``` +alias python='/usr/bin/python3.4' +``` + +一旦完成以上操作,重新登录或者重新加载 `.bashrc` 文件,使操作生效。 + +``` +$ . ~/.bashrc +``` + +检查当前的 Python 版本。 + +``` +$ python --version +Python 3.4.2 +``` + +2、 基于系统级别修改 Python 版本 +我们可以使用 `update-alternatives` 来为整个系统更改 Python 版本。以 root 身份登录,首先罗列出所有可用的 python 替代版本信息: + +``` +# update-alternatives --list python +update-alternatives: error: no alternatives for python +``` + +如果出现以上所示的错误信息,则表示 Python 的替代版本尚未被 `update-alternatives` 命令识别。想解决这个问题,我们需要更新一下替代表,将 `python2.7` 和 `python3.4` 放入其中。 + +``` +# update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1 +update-alternatives: using /usr/bin/python2.7 to provide /usr/bin/python (python) in auto mode +# update-alternatives --install /usr/bin/python python /usr/bin/python3.4 2 +update-alternatives: using /usr/bin/python3.4 to provide /usr/bin/python (python) in auto mode +``` + +`--install` 选项使用了多个参数用于创建符号链接。最后一个参数指定了此选项的优先级,如果我们没有手动来设置替代选项,那么具有最高优先级的选项就会被选中。这个例子中,我们为 `/usr/bin/python3.4` 设置的优先级为2,所以 `update-alternatives` 命令会自动将它设置为默认 Python 版本。 + +``` +# python --version +Python 3.4.2 +``` + +接下来,我们继续列出可用的 Python 替代版本。 + +``` +# update-alternatives --list python +/usr/bin/python2.7 +/usr/bin/python3.4 +``` + +现在开始,我们就可以使用下方的命令随时在列出的 Python 替代版本中任意切换了。 + +``` +# update-alternatives --config python +``` + +![](http://linuxconfig.org/images/change-python-alternative-version-debian-linux.png) + +``` +# python --version +Python 2.7.8 +``` + +3、附录 + +一旦我们的系统中不再存在某个 Python 的替代版本时,我们可以将其从 `update-alternatives` 列表中删除掉。例如,我们可以将列表中的 python2.7 版本移除掉。 + +``` +# update-alternatives --remove python /usr/bin/python2.7 +update-alternatives: removing manually selected alternative - switching python to auto mode +update-alternatives: using /usr/bin/python3.4 to provide /usr/bin/python (python) in auto mode +``` + +-------------------------------------------------------------------------------- + +via: http://linuxconfig.org/how-to-change-from-default-to-alternative-python-version-on-debian-linux + +作者:[作者][] +译者:[mr-ping](https://github.com/mr-ping) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + From ec187dbd52544c934bca8c88f5556e84524dc0c5 Mon Sep 17 00:00:00 2001 From: Ping Date: Thu, 28 Jan 2016 14:45:54 +0800 Subject: [PATCH 0269/1469] Reformat somewhere --- ...rom default to alternative Python version on Debian Linux.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/translated/tech/20160126 How to change from default to alternative Python version on Debian Linux.md b/translated/tech/20160126 How to change from default to alternative Python version on Debian Linux.md index 0438614ddb..5ff89d7944 100644 --- a/translated/tech/20160126 How to change from default to alternative Python version on Debian Linux.md +++ b/translated/tech/20160126 How to change from default to alternative Python version on Debian Linux.md @@ -16,6 +16,7 @@ Python 2.7.8 ``` 1、基于用户修改 Python 版本: + 想要为某个特定用户修改 Python 版本,只需要在其 home 目录下创建一个 `alias(别名)` 即可。打开 `~/.bashrc` 文件,添加新的别名信息来修改默认使用的 Python 版本。 ``` @@ -36,6 +37,7 @@ Python 3.4.2 ``` 2、 基于系统级别修改 Python 版本 + 我们可以使用 `update-alternatives` 来为整个系统更改 Python 版本。以 root 身份登录,首先罗列出所有可用的 python 替代版本信息: ``` From 9f36a2ebdfc07804a99e3fa41c8bec867e47105d Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 29 Jan 2016 07:00:55 +0800 Subject: [PATCH 0270/1469] PUB:20151127 Linux or UNIX grep Command Tutorial series 3--Search Multiple Words or String Pattern Using grep Command @runningwater --- ...iple Words or String Pattern Using grep Command.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) rename {translated/tech/Linux or UNIX grep Command Tutorial series => published}/20151127 Linux or UNIX grep Command Tutorial series 3--Search Multiple Words or String Pattern Using grep Command.md (81%) diff --git a/translated/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 3--Search Multiple Words or String Pattern Using grep Command.md b/published/20151127 Linux or UNIX grep Command Tutorial series 3--Search Multiple Words or String Pattern Using grep Command.md similarity index 81% rename from translated/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 3--Search Multiple Words or String Pattern Using grep Command.md rename to published/20151127 Linux or UNIX grep Command Tutorial series 3--Search Multiple Words or String Pattern Using grep Command.md index 9af1afa163..ed44522d70 100644 --- a/translated/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 3--Search Multiple Words or String Pattern Using grep Command.md +++ b/published/20151127 Linux or UNIX grep Command Tutorial series 3--Search Multiple Words or String Pattern Using grep Command.md @@ -1,5 +1,6 @@ -使用 grep 命令来搜索多个单词/字符串模式 +grep 命令系列:使用 grep 命令来搜索多个单词 ================================================================================ + 要使用 grep 命令来搜索多个字符串或单词,我们该怎么做?例如我想要查找 /path/to/file 文件中的 word1、word2、word3 等单词,我怎么样命令 grep 查找这些单词呢? [grep 命令支持正则表达式][1]匹配模式。要使用多单词搜索,请使用如下语法: @@ -10,7 +11,7 @@ $ grep 'warning\|error\|critical' /var/log/messages -仅仅只是要匹配单词的话,可以加上 -w 选项参数: +仅仅只是要匹配单词(即该词两侧是单词分界符,针对西方以空格分隔的语言而言)的话,可以加上 -w 选项参数: $ grep -w 'warning\|error\|critical' /var/log/messages @@ -26,7 +27,7 @@ egrep 命令可以跳过上面的语法格式,其使用的语法格式如下 ![Fig.01: Linux / Unix egrep Command Search Multiple Words Demo Output](http://s0.cyberciti.org/uploads/faq/2008/04/egrep-words-output.png) -Fig.01: Linux / Unix egrep 命令查找多个单词输出例子 +图一: Linux / Unix egrep 命令查找多个单词输出例子 -------------------------------------------------------------------------------- @@ -34,8 +35,8 @@ via: http://www.cyberciti.biz/faq/searching-multiple-words-string-using-grep/ 作者:Vivek Gite 译者:[runningwater](https://github.com/runningwater) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 -[1]:http://www.cyberciti.biz/faq/grep-regular-expressions/ \ No newline at end of file +[1]:https://linux.cn/article-6941-1.html \ No newline at end of file From 2343b8358acc60ce0667e33ff6b9fdedabec5692 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 29 Jan 2016 07:05:18 +0800 Subject: [PATCH 0271/1469] PUB:20151127 Linux or UNIX grep Command Tutorial series 4--Grep Count Lines If a String or Word Matches @runningwater --- ...ries 4--Grep Count Lines If a String or Word Matches.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) rename {translated/tech/Linux or UNIX grep Command Tutorial series => published}/20151127 Linux or UNIX grep Command Tutorial series 4--Grep Count Lines If a String or Word Matches.md (88%) diff --git a/translated/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 4--Grep Count Lines If a String or Word Matches.md b/published/20151127 Linux or UNIX grep Command Tutorial series 4--Grep Count Lines If a String or Word Matches.md similarity index 88% rename from translated/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 4--Grep Count Lines If a String or Word Matches.md rename to published/20151127 Linux or UNIX grep Command Tutorial series 4--Grep Count Lines If a String or Word Matches.md index 63cb1aa189..081ecdb9b6 100644 --- a/translated/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 4--Grep Count Lines If a String or Word Matches.md +++ b/published/20151127 Linux or UNIX grep Command Tutorial series 4--Grep Count Lines If a String or Word Matches.md @@ -1,8 +1,9 @@ -Grep 命令统计匹配的字符串/单词行数 +grep 命令系列:用 grep 命令统计匹配字符串的行数 ================================================================================ + 在 Linux 或 UNIX 操作系统下,对于给定的单词或字符串,我们应该怎么统计它们在每个输入文件中存在的行数呢? -您需要通过添加 -c 或者 --count 选项参数来抑制正常的输出。它将会显示对输入文件单词匹配的行数,如下示: +您需要通过添加 -c 或者 --count 选项参数来抑制正常的输出。它将会显示对输入文件单词匹配的行数,如下所示: $ grep -c vivek /etc/passwd @@ -28,6 +29,6 @@ via: http://www.cyberciti.biz/faq/grep-count-lines-if-a-string-word-matches/ 作者:Vivek Gite 译者:[runningwater](https://github.com/runningwater) -校对:[校对者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 acc6502c8766f86eef2433bdecf7c96119149517 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 29 Jan 2016 08:09:57 +0800 Subject: [PATCH 0272/1469] PUB:20101020 19 Years of KDE History--Step by Step @jerryling315 --- ...0 19 Years of KDE History--Step by Step.md | 232 ++++++++++++++++++ ...0 19 Years of KDE History--Step by Step.md | 209 ---------------- 2 files changed, 232 insertions(+), 209 deletions(-) create mode 100644 published/20101020 19 Years of KDE History--Step by Step.md delete mode 100644 translated/talk/20101020 19 Years of KDE History--Step by Step.md diff --git a/published/20101020 19 Years of KDE History--Step by Step.md b/published/20101020 19 Years of KDE History--Step by Step.md new file mode 100644 index 0000000000..50cfff73fb --- /dev/null +++ b/published/20101020 19 Years of KDE History--Step by Step.md @@ -0,0 +1,232 @@ +KDE 的19年进化历程 +================ + +注:youtube 视频 + + +## 概述 + +KDE – 史上功能最强大的桌面环境之一;开源且可自由使用。19年前,1996年10月14日,德国程序员 Matthias Ettrich 开始了这个美观的桌面环境的开发。KDE 提供了用户界面以及其他很多日常使用的程序。今日,KDE 被成千上万人在 Unix 和 Windows 上使用。19年,一个对软件项目而言极为漫长的年岁。现在是时候让我们回到最初,看看这一切肇始于何处。 + +K Desktop Environment(KDE)有很多创新之处:新设计,美观,一致的体验,易于使用,对普通用户和专业用户都足够强大的应用库。“KDE”这个名字是对单词“通用桌面环境”(Common Desktop Environment)玩的一个简单谐音游戏,“K”即“Cool”。 第一代 KDE 在双许可证授权下使用了 Trolltech 公司专利的 Qt framework(现 Qt 的前身),这两个许可证分别是开源的 QPL(Q public license)和商业专利许可证(proprietary commercial license)。在2000年 Trolltech 公司让一部分 Qt 软件库开始发布在 GPL 证书下; Qt 4.5 发布在了 LGPL 2.1 许可证下。自2009起 KDE 桌面环境由三部分构成:Plasma Workspaces(用做交互界面),KDE Applications,作为 KDE Software 编译的 KDE Platform。 + +## 各发布版本 + +### 预发布版本 – 1996年10月14日 + +![](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/0b3.png) + +当时名称为 Kool Desktop Environment;“Kool”这个单词在很快就被弃用了。最初,所有 KDE 的组件都是被单独发布在开发社区里的,它们并没有被一个大的项目所贯穿起来。开发组邮件列表中的首选通信是发往kde@fiwi02.wiwi.uni-Tubingen.de 邮件列表。 + +### KDE 1.0 – 1998年7月12日 + +![](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/10.png) + +这个版本受到了颇有争议的反馈。很多人反对使用 Qt 框架,因为当时的 FreeQt 许可证和自由软件许可证并不兼容,他们建议开发组使用 Motif 或者 LessTif 替代。尽管有着这些反对声,KDE 仍然被很多用户所青睐,并且成功作为第一个 Linux 发行版的环境被集成了进去。 + +![28 January 1999](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/11.png) + +*1999年1月28日* + +有一次升级,**K Desktop Environment 1.1**,更快,更稳定的同时加入了很多小的改进。这个版本同时也加入了很多新的图标,背景和材质纹理。和这些全面翻新同时出现的还有 Torsten Rahn 绘制的全新 KDE 图标----一个放在齿轮前的字母 K ;这个图标的修改版也一直沿用至今。 + +### KDE 2.0 – 2000年10月23日 + +![](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/20.png) + +重大更新: + +- DCOP (Desktop COmmunication Protocol),一个端到端的通信协议 +- KIO,一个应用程序 I/O 库 +- KParts,组件对象模型 +- KHTML,一个符合 HTML 4.0 标准的渲染绘制引擎。 + +![26 February 2001](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/21.png) + +*2001年2月26日* + +**K Desktop Environment 2.1** 首次发布了媒体播放器 noatun,它使用了模组化、插件设计。为了便利开发者,K Desktop Environment 2.1 打包了 KDevelop。 + +![15 August 2001](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/22.png) + +*2001年8月15日* + +**KDE 2.2**版本在 GNU/Linux 上加快了50%的应用启动速度,同时提高了 HTML 渲染、JavaScript 稳定性和性能,同时还增加了一些 KMail 的功能。 + +### KDE 3.0 – 2002年4月3日 + +![](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/30.png) + +K Desktop Environment 3.0 加入了更好的限制使用功能,这个功能在电话亭、网咖,企业公用电脑上被广泛需求,它可以禁止用户完全使用软件的某些能力。 + +![28 January 2003](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/31.png) + +*2003年1月28日* + +**K Desktop Environment 3.1** 加入了新的默认窗口(Keramik)和图标样式(Crystal)和其他一些改进。 + +![3 February 2004](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/32.png) + +*2004年2月3日* + +**K Desktop Environment 3.2** 加入了诸如在网页表格、书写邮件中拼写检查的新功能;增强了邮件和日历功能。完善了 Konqueror 中的标签机制和对 Microsoft Windows 桌面共享协议(RDP)的支持。 + +![19 August 2004](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/33.png) + +*2004年8月19日* + +**K Desktop Environment 3.3** 侧重于组合不同的桌面组件。Kontact 被放进了群件应用 Kolab 并与 Kpilot 结合。Konqueror 的加入让 KDE 有了更好的 IM 交流功能,比如支持发送文件,以及其他 IM 协议(如IRC)的支持。 + +![16 March 2005](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/34.png) + +*2005年3月16日* + +**K Desktop Environment 3.4** 侧重于提高易用性。这次更新为 Konqueror、Kate、KPDF 加入了文字-语音转换功能;也在桌面系统中加入了独立的 KSayIt 文字-语音转换软件。 + +![29 November 2005](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/35.png) + +*2005年11月29日* + +**The K Desktop Environment 3.5** 发布加入了 SuperKaramba,为桌面环境提供了易于安装的插件(widgets)机制。 Konqueror 加入了广告屏蔽功能并成为了有史以来第二个通过 Acid2 CSS 测试的浏览器。 + +### KDE SC 4.0 – 2008年1月11日 + +![](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/400.png) + +大部分的开发投身于把最新的技术和开发框架整合进 KDE 4 当中。Plasma 和 Oxygen 是两次最大的用户界面风格变更。同时,Dolphin 替代 Konqueror 成为默认文件管理器,Okular 成为了默认文档浏览器。 + +![29 July 2008](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/401.png) + +*2008年7月29日* + +**KDE 4.1** 引入了一个在 PIM 和 Kopete 中共享使用的表情主题系统;引入了可以让用户便利地从互联网上一键下载数据的 DXS。同时引入了 GStreamer、QuickTime 和 DirectShow 9 Phonon 后端。加入了新应用如: + +- Dragon Player +- Kontact +- Skanlite — 扫描仪软件 +- Step —— 物理模拟软件 +- 新游戏: Kdiamond、Kollision、KBreakout 和更多...... + +![27 January 2009](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/402.png) + +*2009年1月27日* + +**KDE 4.2** 被认为是在已经极佳的 KDE 4.1 基础上的又一次全面超越,同时也成为了大多数用户替换旧 3.5 版本的完美选择。 + +![4 August 2009](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/403.png) + +*2009年8月4日* + +**KDE 4.3** 修复了超过10000个 bug,同时加入了让近2000个用户要求的功能。整合一些新的技术例如:PolicyKit、NetworkManage & Geolocation services 等也是这个版本的一大重点。 + +![9 February 2010](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/404.png) + +*2010年2月9日* + +**KDE SC 4.4** 基于 Qt 4 toolkit 的 4.6 版本,加入新的应用 KAddressBook。 + +![10 August 2010](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/405.png) + +*2010年8月10日* + +**KDE SC 4.5** 增加了一些新特性:整合了开源的浏览器引擎 WebKit 库,其现在也在 Apple Safari 和 Google Chrome 中广泛使用。KPackageKit 替换了 Kpackage。 + +![26 January 2011](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/406.png) + +*2011年1月26日* + +**KDE SC 4.6** 加强了 OpenGl 的性能,同时照常更新了无数bug和小改进。 + +![27 July 2011](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/407.png) + +*2011年7月27日* + +**KDE SC 4.7** 升级 KWin 以兼容 OpenGL ES 2.0 ,更新了 Qt Quick,Plasma Desktop 带来许多增强和在应用里的大量新特性, 修复了1.2万个 bug。 + +![25 January 2012](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/408.png) + +*2012年1月25日* + +**KDE SC 4.8**: 更好的 KWin 性能与 Wayland 支持,更崭新的 Doplhin 的外观设计。 + +![1 August 2012](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/409.png) + +*2012年8月1日* + +**KDE SC 4.9**: 向 Dolphin 文件管理器增加了一些更新,比如重新加入了实时文件重命名,鼠标辅助按钮支持,更好的位置面板和更多文件分类管理功能。 + +![6 February 2013](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/410.png) + +*2013年2月6日* + +**KDE SC 4.10**: 很多 Plasma 插件使用 QML 重写; Nepomuk、Kontact 和 Okular 得到了很大程度的性能和功能提升。 + +![14 August 2013](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/411.png) + +*2013年8月14日* + +**KDE SC 4.11**: Kontact 和 Nepomuk 有了很多优化。 第一代 Plasma Workspaces 进入了单纯维护阶段。 + +![18 December 2013](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/412.png) + +*2013年12月18日* + +**KDE SC 4.12**: Kontact 得到了极大的提升,包括许多小的改进。 + +![16 April 2014](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/413.png) + +*2014年4月16日* + +**KDE SC 4.13**: Nepomuk 语义搜索功能替代了桌面上的原有的 Baloo 搜索。 KDE SC 4.13 以53个语言版本发布。 + +![20 August 2014](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/414.png) + +*2014年8月20日* + +**KDE SC 4.14**: 这个发布版本侧重于稳定性提升:大量的 bug 修复和增加了一些小的功能。这是最后一个 KDE SC 4 发布版本。 + +### KDE Plasma 5.0 – 2014年7月15日 + +![](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/500.png) + +KDE Plasma 5 – 第五代 KDE。大幅改进了设计和系统,新的默认主题 Breeze 完全迁移到了 QML,更好的 OpenGL 性能,更完美的 HiDPI (高分辨率)显示支持。 + +![11 November 2014](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/501.png) + +*2014年11月11日* + +**KDE Plasma 5.1**:迁移了从 Plasma 4 里丢失的功能。 + +![27 January 2015](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/502.png) + +*2015年1月27日* + +**KDE Plasma 5.2**:新组件:BlueDevil、KSSHAskPass、Muon、SDDM 主题设置、KScreen、GTK+ 样式设置和 KDecoration。 + +![28 April 2015](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/503.png) + +*2015年4月28日* + +**KDE Plasma 5.3**:Plasma Media Center 技术预览。新的蓝牙和触摸板小程序;改良了电源管理。 + +![25 August 2015](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/504.png) + +*2015年8月25日* + +**KDE Plasma 5.4**:Wayland 登场,新的基于 QML 的音频管理程序,一个全屏的程序启动器替代品。 + +万分感谢 [KDE][1] 开发者及社区,并感谢 Wikipedia 为书写 [概述][2] 带来的帮助,同时,感谢所有读者。让我们保持自由精神(be free)并继续支持如同 KDE 一样的开源的自由软件发展。 + +-------------------------------------------------------------------------------- + +via: [https://tlhp.cf/kde-history/](https://tlhp.cf/kde-history/) + +作者:[Pavlo Rudyi][a] +译者:[jerryling315](https://github.com/jerryling315) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]: https://www.kde.org/ +[2]: https://en.wikipedia.org/wiki/KDE_Plasma_5 +[a]: https://tlhp.cf/author/paul/ diff --git a/translated/talk/20101020 19 Years of KDE History--Step by Step.md b/translated/talk/20101020 19 Years of KDE History--Step by Step.md deleted file mode 100644 index ef90acd91f..0000000000 --- a/translated/talk/20101020 19 Years of KDE History--Step by Step.md +++ /dev/null @@ -1,209 +0,0 @@ -# 19年KDE进化历程 -注:youtube 视频 - - -## 概述 -KDE – 史上功能最强大的桌面环境之一; 开源且免费。19年前,1996年10月14日,德国程序员 Matthias Ettrich 开始了编写这个美观的桌面环境。KDE提供了诸如shell以及其他很多日常使用的程序。今日,KDE被成千上万人在 Unix 和 Windows 上使用。19年----一个对软件项目而言极为漫长的年岁。现在是时候让我们回到最初,看看这一切从哪里开始了。 - -K Desktop Environment(KDE)有很多创新之处:新设计,美观,连贯性,易于使用,对普通用户和专业用户都足够强大的应用库。"KDE"这个名字是对单词"通用桌面环境"(Common Desktop Environment)玩的一个简单谐音游戏,"K"----"Cool"。 第一代KDE在双证书授权下使用了有专利的 Trolltech's Qt 框架 (现Qt的前身),这两个许可证分别是 open source QPL(Q public license) 和 商业专利许可证(proprietary commercial license)。在2000年 Trolltech 让一部分 Qt 软件库开始发布在 GPL 证书下; Qt 4.5 发布在了 LGPL 2.1 许可证下。自2009起 KDE 桌面环境由三部分构成:Plasma Workspaces (作Shell),KDE 应用,作为 KDE Software 编译的 KDE Platform. - -## 各发布版本 -### Pre-Release – 1996年10月14日 -![](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/0b3.png) - -当时名称为 Kool Desktop Environment;"Kool"这个单词在很快就被弃用了。最初,所有KDE的组件都是被单独发布在开发社区里的,他们之间没有任何环绕大项目的组装配合。开发组邮件列表中的第一封通信是发往kde@fiwi02.wiwi.uni-Tubingen.de 的邮件。 - -### KDE 1.0 – 1998年7月12日 -![](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/10.png) - -这个版本受到了颇有争议的反馈。很多人反对使用Qt框架----当时的 FreeQt 许可证和自由软件许可证并不兼容----并建议开发组使用 Motif 或者 LessTif 替代。尽管有着这些反对声,KDE 仍然被很多用户所青睐,并且成功作为第一个Linux发行版的环境被集成了进去。(made its way into the first Linux distributions) - -![28 January 1999](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/11.png) - -1999年1月28日 - -一次升级,**K Desktop Environment 1.1**,更快,更稳定的同时加入了很多小升级。这个版本同时也加入了很多新的图标,背景,外观文理。和这些全面翻新同时出现的还有 Torsten Rahn 绘制的全新KDE图标----齿轮前的3个K字母;这个图标的修改版也一直沿用至今。 - -### KDE 2.0 – 2000年10月23日 -![](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/20.png) - -重大更新:_ DCOP (Desktop COmmunication Protocol),一个端到端的通信协议 _ KIO,一个应用程序I/O库 _ KParts,组件对象模板 _ KHTML,一个符合 HTML 4.0 标准的图像绘制引擎。 - -![26 February 2001](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/21.png) - -2001年2月26日 - -**K Desktop Environment 2.1** 首次发布了媒体播放器 noatun,noatun使用了先进的模组-插件设计。为了便利开发者,K Desktop Environment 2.1 打包了 KDevelop - -![15 August 2001](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/22.png) - -2001年8月15日 - -**KDE 2.2**版本在GNU/Linux上加快了50%的应用启动速度,同时提高了稳定性和 HTML、JavaScript的解析性能,同时还增加了一些 KMail 的功能。 - -### KDE 3.0 – 2002年4月3日 -![](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/30.png) - -K Desktop Environment 3.0 加入了更好的限制使用功能,这个功能在网咖,企业公用电脑上被广泛需求。 - -![28 January 2003](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/31.png) - -2003年1月28日 - -**K Desktop Environment 3.1** 加入了新的默认窗口(Keramik)和图标样式(Crystal)和其他一些改进。 - -![3 February 2004](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/32.png) - -2004年2月3日 - -**K Desktop Environment 3.2** 加入了诸如网页表格,书写邮件中拼写检查的新功能;补强了邮件和日历功能。完善了Konqueror 中的标签机制和对 Microsoft Windows 桌面共享协议的支持。 - -![19 August 2004](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/33.png) - -2004年8月19日 - -**K Desktop Environment 3.3** 侧重于组合不同的桌面组件。Kontact 被放进了群件应用Kolab 并与 Kpilot 结合。Konqueror 的加入让KDE有了更好的 IM 交流功能,比如支持发送文件,以及其他 IM 协议(如IRC)的支持。 - -![16 March 2005](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/34.png) - -2005年3月16日 - -**K Desktop Environment 3.4** 侧重于提高易用性。这次更新为Konqueror,Kate,KPDF加入了文字-语音转换功能;也在桌面系统中加入了独立的 KSayIt 文字-语音转换软件。 - -![29 November 2005](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/35.png) - -2005年11月29日 - -**The K Desktop Environment 3.5** 发布加入了 SuperKaramba,为桌面环境提供了易于安装的插件机制。 desktop. Konqueror 加入了广告屏蔽功能并成为了有史以来第二个通过Acid2 CSS 测试的浏览器。 - -### KDE SC 4.0 – 2008年1月11日 -![](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/400.png) - -大部分开组投身于把最新的技术和开发框架整合进 KDE 4 当中。Plasma 和 Oxygen 是两次最大的用户界面风格变更。同时,Dolphin 替代 Konqueror 成为默认文件管理器,Okular 成为了默认文档浏览器。 - -![29 July 2008](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/401.png) - -2008年7月29日 - -**KDE 4.1** 引入了一个在 PIM 和 Kopete 中使用的表情主题系统;引入了可以让用户便利地从互联网上一键下载数据的DXS。同时引入了 GStreamer,QuickTime,和 DirectShow 9 Phonon 后台。加入了新应用如:_ Dragon Player _ Kontact _ Skanlite – 扫描仪软件,_ Step – 物理模拟软件 * 新游戏: Kdiamond,Kollision,KBreakout 和更多...... - -![27 January 2009](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/402.png) - -2009年1月27日 - -**KDE 4.2** 被认为是在已经极佳的 KDE 4.1 基础上的又一次全面超越,同时也成为了大多数用户替换旧 3.5 版本的完美选择。 - -![4 August 2009](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/403.png) - -2009年8月4日 - -**KDE 4.3** 修复了超过10,000个 bugs,同时加入了让近2,000个被用户需求的功能。整合一些新的技术例如:PolicyKit,NetworkManage & Geolocation services 等也是这个版本的一大重点。 - -![9 February 2010](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/404.png) - -2010年2月9日 - -**KDE SC 4.4** 基础 Qt 4 开框架的 4.6 版本,新的应用 KAddressBook 被加入,同时也是is based on version 4.6 of the Qt 4 toolkit. New application – KAddressBook,Kopete首次发布。 - -![10 August 2010](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/405.png) - -2010年8月10日 - -**KDE SC 4.5** 增加了一些新特性:整合了 WebKit 库----一个开源的浏览器引擎库,现在也被在 Apple Safari 和 Google Chrome 中广泛使用。KPackageKit 替换了 Kpackage。 - -![26 January 2011](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/406.png) - -2011年1月26日 - -**KDE SC 4.6** 加强了 OpenGl 的性能,同时照常更新了无数bug和小改进。 - -![27 July 2011](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/407.png) - -2011年7月27日 - -**KDE SC 4.7** 升级 KWin 以兼容 OpenGL ES 2.0 ,更新了 Qt Quick,Plasma Desktop 中在应用里普遍使用的新特性 1.2万个bug被修复。 - -![25 January 2012](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/408.png) - -2012年1月25日 - -**KDE SC 4.8**: 更好的 KWin 性能与 Wayland 支持,更新了 Doplhin 的外观设计。 - -![1 August 2012](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/409.png) - -2012年8月1日 - -**KDE SC 4.9**: 向 Dolphin 文件管理器增加了一些更新,比如加入了实时文件重命名,鼠标辅助按钮支持,更好的位置标签和更多文件分类管理功能。 - -![6 February 2013](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/410.png) - -2013年2月6日 - -**KDE SC 4.10**: 很多 Plasma 插件使用 QML 重写; Nepomuk,Kontact 和 Okular 得到了很大程度的性能和功能提升。 - -![14 August 2013](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/411.png) - -2013年8月14日 - -**KDE SC 4.11**: Kontact 和 Nepomuk 有了很大的优化。 第一代 Plasma Workspaces 进入了仅有维护而没有新生开发的软件周期。 - -![18 December 2013](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/412.png) - -2013年12月18日 - -**KDE SC 4.12**: Kontact 得到了极大的提升。 - -![16 April 2014](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/413.png) - -2014年4月16日 - -**KDE SC 4.13**: Nepomuk 语义搜索功能替代了桌面上的原有的Baloo搜索。 KDE SC 4.13 发布了53个语言版本。 - -![20 August 2014](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/414.png) - -2014年8月20日 - -**KDE SC 4.14**: 这个发布版本侧重于稳定性提升:大量的bug修复和小更新。这是最后一个 KDE SC 4 发布版本。 - -### KDE Plasma 5.0 – 2014年7月15日 -![](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/500.png) - -KDE Plasma 5 – 第五代 KDE。大幅改进了设计和系统,新的默认主题 ---- Breeze,完全迁移到了 QML,更好的 OpenGL 性能,更完美的 HiDPI (高分辨率)显示支持。 - -![11 November 2014](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/501.png) - -2014年11月11日 - -**KDE Plasma 5.1**:加入了Plasma 4里原先没有补完的功能。 - -![27 January 2015](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/502.png) - -2015年1月27日 - -**KDE Plasma 5.2**:新组件:BlueDevil,KSSHAskPass,Muon,SDDM 主题设置,KScreen,GTK+ 样式设置 和 KDecoration. - -![28 April 2015](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/503.png) - -2015年4月28日 - -**KDE Plasma 5.3**:Plasma Media Center 技术预览。新的蓝牙和触摸板小程序;改良了电源管理。 - -![25 August 2015](https://github.com/paulcarroty/Articles/raw/master/KDE_History/im/504.png) - -2015年8月25日 - -**KDE Plasma 5.4**:Wayland 登场,新的基于 QML 的音频管理程序,交替式全屏程序显示。 - -万分感谢 [KDE][1] 开发者和社区及Wikipedia 为书写 [概述][2] 带来的帮助,同时,感谢所有读者。希望大家保持自由精神(be free)并继续支持如同 KDE 一样的开源的自由软件发展。 - --------------------------------------------------------------------------------- - -via: [https://tlhp.cf/kde-history/](https://tlhp.cf/kde-history/) - -作者:[Pavlo RudyiCategories][a] 译者:[jerryling315](https://github.com/jerryling315) 校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[1]: https://www.kde.org/ -[2]: https://en.wikipedia.org/wiki/KDE_Plasma_5 -[a]: https://tlhp.cf/author/paul/ From 0cde68a7de1a3d2bb34a8b961fb25ae9bc7519ce Mon Sep 17 00:00:00 2001 From: "Fuliang.Li" Date: Fri, 29 Jan 2016 19:19:37 +0800 Subject: [PATCH 0273/1469] =?UTF-8?q?=E5=8F=96=E6=B6=88=E8=AE=A4=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... 2015--The best open source application development tools.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/sources/share/20151028 Bossie Awards 2015--The best open source application development tools.md b/sources/share/20151028 Bossie Awards 2015--The best open source application development tools.md index c135ae0832..b99752ea7b 100644 --- a/sources/share/20151028 Bossie Awards 2015--The best open source application development tools.md +++ b/sources/share/20151028 Bossie Awards 2015--The best open source application development tools.md @@ -1,5 +1,3 @@ -GHLandy Translating - Bossie Awards 2015: The best open source application development tools ================================================================================ InfoWorld's top picks among platforms, frameworks, databases, and all the other tools that programmers use From 696e8481b55224e5919ce4257881d63d4d462b62 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 30 Jan 2016 14:16:30 +0800 Subject: [PATCH 0274/1469] PUB:20151127 Linux or UNIX grep Command Tutorial series 5--Grep From Files and Display the File Name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @runningwater 这篇你给忘记了吧~~ --- ...ep From Files and Display the File Name.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) rename {sources/tech/Linux or UNIX grep Command Tutorial series => published}/20151127 Linux or UNIX grep Command Tutorial series 5--Grep From Files and Display the File Name.md (71%) diff --git a/sources/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 5--Grep From Files and Display the File Name.md b/published/20151127 Linux or UNIX grep Command Tutorial series 5--Grep From Files and Display the File Name.md similarity index 71% rename from sources/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 5--Grep From Files and Display the File Name.md rename to published/20151127 Linux or UNIX grep Command Tutorial series 5--Grep From Files and Display the File Name.md index 3b683746eb..4953cae431 100644 --- a/sources/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 5--Grep From Files and Display the File Name.md +++ b/published/20151127 Linux or UNIX grep Command Tutorial series 5--Grep From Files and Display the File Name.md @@ -1,14 +1,14 @@ -(translating by runningwater) -Grep From Files and Display the File Name +grep 命令系列:从文件中搜索并显示文件名 ================================================================================ -How do I grep from a number of files and display the file name only? -When there is more than one file to search it will display file name by default: +我怎样从几个文件中搜索(grep),并只显示匹配到的文件的文件名? - grep "word" filename +当你从不止一个的文件中搜索时,默认它将显示文件名: + + grep "word" 文件名 grep root /etc/* -Sample outputs: +示例输出: /etc/bash.bashrc: See "man sudo_root" for details. /etc/crontab:17 * * * * root cd / && run-parts --report /etc/cron.hourly @@ -20,12 +20,12 @@ Sample outputs: /etc/logrotate.conf: create 0664 root utmp /etc/logrotate.conf: create 0660 root utmp -The first name is file name (e.g., /etc/crontab, /etc/group). The -l option will only print filename if th +每行开始的第一个部分是文件名(如:/etc/crontab、/etc/group)。使用 -l 选项可以只显示文件名: grep -l "string" filename grep -l root /etc/* -Sample outputs: +示例输出: /etc/aliases /etc/arpwatch.conf @@ -36,12 +36,12 @@ Sample outputs: /etc/crontab /etc/group -You can suppress normal output; instead print the name of each input file from **which no output would normally have been** printed: +你也可以逆转输出;使用 -L 选项来输出**那些不匹配的文件的文件名**: grep -L "word" filename grep -L root /etc/* -Sample outputs: +示例输出: /etc/apm /etc/apparmor @@ -62,7 +62,7 @@ Sample outputs: via: http://www.cyberciti.biz/faq/grep-from-files-and-display-the-file-name/ 作者:Vivek Gite -译者:[runningwater](https://github.com/runningwater) -校对:[校对者ID](https://github.com/校对者ID) +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 \ No newline at end of file From a8951fce7de9fd81e8a4a6ccb0a1cc769632027d Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 30 Jan 2016 14:27:02 +0800 Subject: [PATCH 0275/1469] PUB:20151127 Linux or UNIX grep Command Tutorial series 6--How To Find Files by Content Under UNIX @ictlyh --- ...How To Find Files by Content Under UNIX.md | 31 +++++-------------- 1 file changed, 8 insertions(+), 23 deletions(-) rename {translated/tech/Linux or UNIX grep Command Tutorial series => published}/20151127 Linux or UNIX grep Command Tutorial series 6--How To Find Files by Content Under UNIX.md (56%) diff --git a/translated/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 6--How To Find Files by Content Under UNIX.md b/published/20151127 Linux or UNIX grep Command Tutorial series 6--How To Find Files by Content Under UNIX.md similarity index 56% rename from translated/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 6--How To Find Files by Content Under UNIX.md rename to published/20151127 Linux or UNIX grep Command Tutorial series 6--How To Find Files by Content Under UNIX.md index 9bf698136a..5616548d54 100644 --- a/translated/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 6--How To Find Files by Content Under UNIX.md +++ b/published/20151127 Linux or UNIX grep Command Tutorial series 6--How To Find Files by Content Under UNIX.md @@ -1,21 +1,17 @@ -如何在 UNIX 中根据文件内容查找文件 -How To Find Files by Content Under UNIX +grep 命令系列:如何在 UNIX 中根据文件内容查找文件 ================================================================================ -为了完成课程作业,我写了很多 C 语言代码并把它们保存为 /home/user/c/*.c and *.h。那么在 UNIX shell 窗口中我如何能通过字符串或者单词(例如函数名 main())文件内容来查找文件呢? -I had written lots of code in C for my school work and saved it as source code under /home/user/c/*.c and *.h. How do I find files by content such as string or words (function name such as main() under UNIX shell prompt? + +为了完成课程作业,我写了很多 C 语言代码并把它们保存为 /home/user/c/*.c 和 *.h。那么在 UNIX shell 窗口中我如何能通过字符串或者单词(例如函数名 main())文件内容来查找文件呢? 你需要用到以下工具: -You need to use the following tools: [a] **grep 命令** : 输出匹配模式的行。 [b] **find 命令**: 在目录层次中查找文件。 ### [使用 grep 命令根据内容查找文件][1] -### [grep Command To Find Files By][1] Content ### 输入以下命令: -Type the command as follows: grep 'string' *.txt grep 'main(' *.c @@ -25,48 +21,37 @@ Type the command as follows: grep -iR 'ultra' *.conf 其中 -Where -- **-i** : 忽视模式(匹配字符串 valid、 VALID、 ValID )和输入文件(匹配 file.c FILE.c FILE.C)的大小写。 +- **-i** : 忽略模式(匹配字符串 valid、 VALID、 ValID )和输入文件(匹配 file.c FILE.c FILE.C)的大小写。 - **-R** : 递归读取每个目录下的所有文件。 -- **-i** : Ignore case distinctions in both the PATTERN (match valid, VALID, ValID string) and the input files (math file.c FILE.c FILE.C filename). -- **-R** : Read all files under each directory, recursively + ### 高亮匹配到的模式 ### -### Highlighting searched patterns ### 在搜索大量文件的时候你可以轻松地高亮模式: -You can highlight patterns easily while searching large number of files: $ grep --color=auto -iR 'getChar();' *.c ### 为查找到的模式显示文件名和行号 ### -### Displaying file names and line number for searched patterns ### 你也许需要显示文件名和行号: -You may also need to display filenames and numbers: $ grep --color=auto -iRnH 'getChar();' *.c 其中, -Where, -- **-n** : 在输出的每行前面添加文件中以 1 开始的行号。 +- **-n** : 在输出的每行前面添加以 1 开始的行号。 - **-H** : 为每个匹配打印文件名。要搜索多个文件时这是默认选项。 -- **-n** : Prefix each line of output with the 1-based line number within its input file. -- **-H** Print the file name for each match. This is the default when there is more than one file to search. $grep --color=auto -nH 'DIR' * 输出样例: -Sample output: ![Fig.01: grep 命令显示搜索到的模式](http://www.cyberciti.biz/faq/wp-content/uploads/2008/09/grep-command.png) -Fig.01: grep 命令显示搜索到的模式 +*Fig.01: grep 命令显示搜索到的模式* 你也可以使用 find 命令: -You can also use find command: $ find . -name "*.c" -print | xargs grep "main(" @@ -76,7 +61,7 @@ via: http://www.cyberciti.biz/faq/unix-linux-finding-files-by-content/ 作者:Vivek Gite 译者:[ictlyh](http://mutouxiaogui.cn/blog/) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 13dade0c1325cf49108f8e61b43b4d7fab4527db Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 30 Jan 2016 14:35:17 +0800 Subject: [PATCH 0276/1469] PUB:20151127 Linux or UNIX grep Command Tutorial series 7--Linux or UNIX View Only Configuration File Directives Uncommented Lines of a Config File @sonofelice --- ...ives Uncommented Lines of a Config File.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) rename {translated/tech/Linux or UNIX grep Command Tutorial series => published}/20151127 Linux or UNIX grep Command Tutorial series 7--Linux or UNIX View Only Configuration File Directives Uncommented Lines of a Config File.md (83%) diff --git a/translated/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 7--Linux or UNIX View Only Configuration File Directives Uncommented Lines of a Config File.md b/published/20151127 Linux or UNIX grep Command Tutorial series 7--Linux or UNIX View Only Configuration File Directives Uncommented Lines of a Config File.md similarity index 83% rename from translated/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 7--Linux or UNIX View Only Configuration File Directives Uncommented Lines of a Config File.md rename to published/20151127 Linux or UNIX grep Command Tutorial series 7--Linux or UNIX View Only Configuration File Directives Uncommented Lines of a Config File.md index 9de5e1d64d..28ae0b5122 100644 --- a/translated/tech/Linux or UNIX grep Command Tutorial series/20151127 Linux or UNIX grep Command Tutorial series 7--Linux or UNIX View Only Configuration File Directives Uncommented Lines of a Config File.md +++ b/published/20151127 Linux or UNIX grep Command Tutorial series 7--Linux or UNIX View Only Configuration File Directives Uncommented Lines of a Config File.md @@ -1,10 +1,9 @@ -Linux / UNIX 下只查看配置文件的有效配置行(配置文件中未被注释的命令行) +grep 命令系列:如何只查看配置文件中未被注释的有效配置行 ========================================================= 大多数的Linux和类Unix系统的配置文件中都有许多的注释行,但是有时候我只想看其中的有效配置行。那我怎么才能只看到quid.conf或httpd.conf这样的配置文件中的非注释命令行呢?怎么去掉这些注释或者空行呢? -我们可以使用UNIX / BSD / OS X / Linux 这些操作系统自身提供的grep,sed,awk,perl或者其他文本处理工具来查看配置文件中的有效配置命令行。 - +我们可以使用 UNIX/BSD/OS X/Linux 这些操作系统自身提供的 grep,sed,awk,perl或者其他文本处理工具来查看配置文件中的有效配置命令行。 ### grep 命令示例——去掉注释 ### @@ -100,7 +99,7 @@ Linux / UNIX 下只查看配置文件的有效配置行(配置文件中未被 Include /etc/apache2/sites-enabled/ -想要跳过空行,可以使用 [egrep 命令][1], 示例: +想要跳过其中的空行,可以使用 [egrep 命令][1], 示例: egrep -v "^#|^$" /etc/apache2/apache2.conf ## or pass it to the page such as more or less ## @@ -119,23 +118,24 @@ Linux / UNIX 下只查看配置文件的有效配置行(配置文件中未被 ![Fig.01: Unix/Linux Egrep Strip Out Comments Blank Lines](http://s0.cyberciti.org/uploads/faq/2008/05/grep-strip-out-comments-blank-lines.jpg) -Fig.01: Unix/Linux Egrep 除去注释行和空行 +*图 01: Unix/Linux Egrep 除去注释行和空行* ### 理解 grep/egrep 命令行选项 ### --v 选项,选择出不匹配的命令行。该选项适用于所有基于posix的系统。正则表达式 ^$ 匹配出所有的非空行, ^#匹配出所有的不以“#”开头的非注释行。 +-v 选项,选择出不匹配的命令行。该选项适用于所有基于posix的系统。正则表达式 `^$` 匹配出所有的非空行, `^#` 匹配出所有的不以“#”开头的非注释行。 ### sed 命令示例 ### -可以按照如下示例使用 GNU / sed 命令: +可以按照如下示例使用 GNU 上的 sed 命令: $ sed '/ *#/d; /^ *$/d' /path/to/file $ sed '/ *#/d; /^ *$/d' /etc/apache2/apache2.conf -GNU or BSD sed 也可以修改配置文件。下面的语法是编辑文件,修改扩展名(比如 .bak)进行文件备份: + +GNU 或 BSD 上的 sed 也可以修改配置文件。下面的命令的作用是原地编辑文件,并以特定(比如 .bak)备份文件: sed -i'.bak.2015.12.27' '/ *#/d; /^ *$/d' /etc/apache2/apache2.conf -更多信息见参考手册 - [grep(1)][2], [sed(1)][3] +更多信息见参考手册 - [grep(1)][2], [sed(1)][3]。 -------------------------------------------------------------------------------- @@ -143,7 +143,7 @@ via: http://www.cyberciti.biz/faq/shell-display-uncommented-lines-only/ 作者:Vivek Gite 译者:[sonofelice](https://github.com/sonofelice) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b9f9aa3c58b98c8ed92acdb93307ae46456b6578 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 1 Feb 2016 07:48:36 +0800 Subject: [PATCH 0277/1469] PUB:20151214 Linux or Unix Desktop Fun--Christmas Tree For Your Terminal @soooogreen --- ...esktop Fun--Christmas Tree For Your Terminal.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) rename {translated/tech => published}/20151214 Linux or Unix Desktop Fun--Christmas Tree For Your Terminal.md (88%) diff --git a/translated/tech/20151214 Linux or Unix Desktop Fun--Christmas Tree For Your Terminal.md b/published/20151214 Linux or Unix Desktop Fun--Christmas Tree For Your Terminal.md similarity index 88% rename from translated/tech/20151214 Linux or Unix Desktop Fun--Christmas Tree For Your Terminal.md rename to published/20151214 Linux or Unix Desktop Fun--Christmas Tree For Your Terminal.md index dbbab5ef8c..48b6d23f18 100644 --- a/translated/tech/20151214 Linux or Unix Desktop Fun--Christmas Tree For Your Terminal.md +++ b/published/20151214 Linux or Unix Desktop Fun--Christmas Tree For Your Terminal.md @@ -1,16 +1,16 @@ -Linux / Unix桌面之趣:终端上的圣诞树 +Linux/Unix 桌面趣事:终端上的圣诞树 ================================================================================ -给你的Linux或Unix控制台创造一棵圣诞树玩玩吧。在此之前,需要先安装一个Perl模块,命名为Acme::POE::Tree。这是一棵很喜庆的圣诞树,我已经在Linux、OSX和类Unix系统上验证过了。 +给你的Linux或Unix控制台创造一棵圣诞树玩玩吧。在此之前,需要先安装一个Perl模块,命名为Acme::POE::Tree。这是一棵很喜庆的圣诞树,我已经在Linux、OSX和类Unix系统上验证过了。 ### 安装 Acme::POE::Tree ### -安装perl模块最简单的办法就是使用cpan(Perl综合典藏网)。打开终端,把下面的指令敲进去便可安装Acme::POE::Tree。 +安装perl模块最简单的办法就是使用CPAN(Perl综合典藏网(Comprehensive Perl Archive Network))。打开终端,把下面的指令敲进去便可安装Acme::POE::Tree。 ## 以root身份运行 ## perl -MCPAN -e 'install Acme::POE::Tree' -**案例输出:** +**示例输出:** Installing /home/vivek/perl5/man/man3/POE::NFA.3pm Installing /home/vivek/perl5/man/man3/POE::Kernel.3pm @@ -49,7 +49,7 @@ Linux / Unix桌面之趣:终端上的圣诞树 perl -MAcme::POE::Tree -e 'Acme::POE::Tree->new()->run()' -**案例输出** +**示例输出** ![Gif 01: An animated christmas tree in Perl](http://s0.cyberciti.org/uploads/cms/2015/12/perl-tree.gif) @@ -71,7 +71,7 @@ Gif 01: 一棵用Perl写的喜庆圣诞树 ); $tree->run(); -这样就可以通过修改star_delay、run_for和light_delay参数的值来自定义你的树了。一棵提供消遣的终端圣诞树就此诞生。 +这样就可以通过修改star_delay、run_for和light_delay参数的值来自定义你的树了。一棵好玩的终端圣诞树就此诞生。 -------------------------------------------------------------------------------- @@ -79,6 +79,6 @@ via: http://www.cyberciti.biz/open-source/command-line-hacks/linux-unix-desktop- 作者:Vivek Gite 译者:[soooogreen](https://github.com/soooogreen) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b6b13ea3c377dc969bb1df0fdac58181427b4762 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 1 Feb 2016 07:50:52 +0800 Subject: [PATCH 0278/1469] PUB:20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman @martin2011qi --- ...dation--Best Quotes of Richard Stallman.md | 241 ++++++++++++++++++ ...dation--Best Quotes of Richard Stallman.md | 171 ------------- 2 files changed, 241 insertions(+), 171 deletions(-) create mode 100644 published/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md delete mode 100644 translated/talk/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md diff --git a/published/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md b/published/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md new file mode 100644 index 0000000000..40a0607bef --- /dev/null +++ b/published/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md @@ -0,0 +1,241 @@ +理查德·斯托曼经典语录集锦 +================================================================================ +注:youtube 视频 + + +**理查德·马修·斯托曼(Richard Matthew Stallman)** (RMS) – 神级程序员之一。他是一名程序员,是 GCC、GDB、Emacs 的构建者,软件自由的传教士,[GNU Project][1] 和 [FSF][2] 的创办人。 + +**GNU** 是 “GNU’s Not Unix!”的递归缩写。GNU 是一系列用于基于 Unix 的操作系统的自由软件集合。它能用于 GNU/Hurd 和 Linux 内核。于1983年9月27日公诸于众。常用组件有: + +- GNU Compiler Collection (GCC) +- GNU C library (glibc) +- GNU Core Utilities (coreutils) +- GNU Debugger (GDB) +- GNU Binary Utilities (binutils) +- GNU Bash shell +- GNOME desktop environment + +注:视频 + + +**自由软件基金会(Free Software Foundation)** (FSF) – 一个自由软件的非营利组织,致力于推进计算机用户的自由和捍卫他们的权力。于 1985年10月4日成立。阅读[更多][3]。 + +许多人不理解开源代码(open source code)和自由软件(free software)的区别。每个程序都应该是自由软件: + +- 与目的无关,随心运行程序的自由(自由0)。 +- 学习程序如何运作,并改变它为你所用的自由(自由1)。可以访问源码是这一条的前提。 +- 重新发布副本的自由,如此你便可以帮助你周围的人(自由 2)。 +- 发布自己修改版本给他人的自由(自由 3)。这样能让整个社区有机会从你的改变中受益。可以访问源码是这条的前提。 + +以上为自由软件的四项自由原则。 + +以下为理查德·斯托曼关于自由、软件、社交、哲学等方面的名言摘引。 + +**关于 Facebook:** + +> Facebook is not your friend, it is a surveillance engine. + +Facebook 不是你的朋友,是监控引擎。 + +**关于 Android:** + +> Android is very different from the GNU/Linux operating system because it contains very little of GNU. Indeed, just about the only component in common between Android and GNU/Linux is Linux, the kernel. + +Android 和 GNU/Linux 有很大的区别,因为其中几乎没有 GNU。的确,Android 和 GNU/Linux 之间仅有一个共同组件,那就是内核 - Linux。 + +**关于计算机行业:** + +> The computer industry is the only industry that is more fashion-driven than women's fashion. + +计算机行业是唯一一个比女性时尚业更容易受潮流影响的行业了。 + +**关于云计算:** + +> The interesting thing about cloud computing is that we've redefined cloud computing to include everything that we already do. + +关于云计算,有趣的是我们已经重新定义了云计算来包含我们曾干过的所有事。 + +**关于伦理:** + +> Whether gods exist or not, there is no way to get absolute certainty about ethics. Without absolute certainty, what do we do? We do the best we can. + +无论神存在与否,都没有绝对的伦理道德。没有这份理所当然,我们该如何?也唯有尽善吧。 + +**关于自由:** + +> Free software is software that respects your freedom and the social solidarity of your community. So it's free as in freedom. + +自由软件是尊重个人自由和社会团结的软件。所以才能如自由般自由自在。 + +**关于目标和理想:** + +> If you want to accomplish something in the world, idealism is not enough - you need to choose a method that works to achieve the goal. + +如果你想为这世界做些什么,仅有理想是不够的,你需要找条通往目标的道路并走完。 + +**关于分享:** + +> Sharing is good, and with digital technology, sharing is easy. + +分享很棒,而且数字化技术也使分享变得容易。 + +**关于 facebook(进阶版):** + +> Facebook mistreats its users. Facebook is not your friend; it is a surveillance engine. For instance, if you browse the Web and you see a 'like' button in some page or some other site that has been displayed from Facebook. Therefore, Facebook knows that your machine visited that page. + +Facebook 蹂躏它们的用户。它不是你们的朋友;它就是个监控引擎。举个例子,你是否曾在一些网页或网站上看到 Facebook 的 “like” 按键。对,Facebook 知道你的电脑曾访问过那些网页。 + +**关于 web 应用:** + +> One reason you should not use web applications to do your computing is that you lose control. + +给你个为什么不应该使用 web 应用的理由,因为你失去了计算机的控制权。 + +> If you use a proprietary program or somebody else's web server, you're defenceless. You're putty in the hands of whoever developed that software. + +如果你使用私有程序或他人的 web 服务器,那么你只能任人鱼肉。被软件的开发者轻易操纵。 + +**关于书:** + +> With paper printed books, you have certain freedoms. You can acquire the book anonymously by paying cash, which is the way I always buy books. I never use a credit card. I don't identify to any database when I buy books. Amazon takes away that freedom. + +印刷出来的书,当然是自由的。你可以付现金匿名买书,这也是我一直买书的方式。我绝不会使用信用卡,我买书时不会被任何数据库记下。是亚马逊把自由夺走了。 + +**关于 MPAA:** + +> Officially, MPAA stands for Motion Picture Association of America, but I suggest that MPAA stands for Malicious Power Attacking All. + +MPAA 其实是美国电影协会(Motion Picture Association of America),但我认为叫做攻击万物的邪恶力量(Malicious Power Attacking All)更为合适。 + +**关于金钱与职业:** + +> I could have made money this way, and perhaps amused myself writing code. But I knew that at the end of my career, I would look back on years of building walls to divide people, and feel I had spent my life making the world a worse place. + +我可以找份工作赚钱,并沉浸在编码的快乐中。但在职业生涯结束后,回首目睹自己筑就的高墙将人与人分隔开,我会觉得我耗尽毕生精力只换来了一个更糟糕的世界。 + +**关于私有软件:** + +> Proprietary software keeps users divided and helpless. Divided because each user is forbidden to redistribute it to others, and helpless because the users can't change it since they don't have the source code. They can't study what it really does. So the proprietary program is a system of unjust power. + +私有软件使用户孤立、无助。因为禁止将软件给他人使用所以孤立,因为无法改变源码所以无助。他们不能学习其中真正的工作方式,所以整个私有软件体系就是一种不公的力量。 + +**关于智能手机:** + +> A smartphone is a computer - it's not built using a computer - the job it does is the job of being a computer. So, everything we say about computers, that the software you run should be free - you should insist on that - applies to smart phones just the same. And likewise to those tablets. + +智能手机就是电脑 —— 虽然做的和常用的电脑不同 —— 但是却能干电脑能干的活。所以我们所说的一切有关于电脑上的软件应该能自由运行 —— 必须坚持这一点 —— 在智能手机上也是这样,当然也包括平板。 + +**关于 CD 和数字内容:** + +> CD stores have the disadvantage of an expensive inventory, but digital bookshops would need no such thing: they could write copies at the time of sale on to memory sticks, and sell you one if you forgot your own. + +CD 商店有一个弱势就是需要昂贵的库存,但是电子商店就没有这方面的需求:他们只需要将售卖的副本写入记忆棒,并在你忘带自己的记忆棒时卖你一个就是了。 + +**关于竞争范式(paradigm of competition):** + +> The paradigm of competition is a race: by rewarding the winner, we encourage everyone to run faster. When capitalism really works this way, it does a good job; but its defenders are wrong in assuming it always works this way. + +竞争范式就像是赛跑:奖励胜者,鼓励每一个跑得更快的人。当资本主义真的这样运作时,当然是件好事;但是维护它的人若是假设它一直这样运作的话那就大错特错了。 + +**关于 vi 和 emacs:** + +> People sometimes ask me if it is a sin in the Church of Emacs to use vi. Using a free version of vi is not a sin; it is a penance. So happy hacking. + +有时会有人问我在 Emacs 的阵营使用 vi 是不是一种罪过。使用自由版的 vi 并不是一种罪过;是一种自我惩罚。所以好好享受其中乐趣吧。 + +**关于自由和历史:** + +> Value your freedom or you will lose it, teaches history. 'Don't bother us with politics', respond those who don't want to learn. + +历史告诉我们不珍惜自由便失去自由,然而有的人不懂吸取教训,只知道说“别拿政治烦我们”。 + +**关于专利:** + +> Fighting patents one by one will never eliminate the danger of software patents, any more than swatting mosquitoes will eliminate malaria. + +和专利一个一个的战斗并不能解决软件专利带来的危害,就像打再多的蚊子也消灭不了疟疾一样。 + +> Software patents are dangerous to software developers because they impose monopolies on software ideas. + +软件专利对于软件的开发者来说十分危险,因为它们加剧了对于软件理念的垄断。 + +**关于版权:** + +> In practice, the copyright system does a bad job of supporting authors, aside from the most popular ones. Other authors' principal interest is to be better known, so sharing their work benefits them as well as readers. + +其实,版权制度对作者也没有什么好处,撇开最受欢迎的那个,其他作者的主旨可能更好理解,所以分享无论对他们还是你的读者都是一件好事。 + +**关于工作与报酬:** + +> There is nothing wrong with wanting pay for work, or seeking to maximize one's income, as long as one does not use means that are destructive. + +劳有所得,或寻求收入的最大化并没有什么错,只要不是不择手段。 + +**关于 Chrome OS:** + +> In essence, Chrome OS is the GNU/Linux operating system. However, it is delivered without the usual applications, and rigged up to impede and discourage installing applications. + +Chrome OS 确实是 GNU/Linux 的操作系统。但是,它在发布时没有安装常用应用,并为安装他们设置了阻碍。 + +**关于 Linux 用户:** + +> Many users of the GNU/Linux system will not have heard the ideas of free software. They will not be aware that we have ideas, that a system exists because of ethical ideals, which were omitted from ideas associated with the term 'open source.' + +许多的 GNU/Linux 用户并没有听过自由软件。他们并没有意识到,这个系统是因为道德理想才存在的,与此一起被忽视的还有所谓的“开源”。 + +**关于 facebook 的隐私:** + +> If there is a Like button in a page, Facebook knows who visited that page. And it can get IP address of the computer visiting the page even if the person is not a Facebook user. + +如果页面上有 “like” 按键,Facebook 就能知道谁访问了页面。即使不是 Facebook 的用户,也可以得到访问该页面电脑的 IP 地址。 + +**关于编程:** + +> Programming is not a science. Programming is a craft. + +编程不是科学,编程是手艺。 + +> My favorite programming languages are Lisp and C. However, since around 1992 I have worked mainly on free software activism, which means I am too busy to do much programming. Around 2008 I stopped doing programming projects. + +Lisp 和 C 语言是我的最爱。然自 1992 年以来我主要工作在自由软件活动上,导致我太忙了,没法做更多的编程。大概在 2008 年我便停止了做编程项目。 + +> C++ is a badly designed and ugly language. It would be a shame to use it in Emacs. + +C++ 设计的真糟糕、真丑陋。在 Emacs 上用它应该觉得羞愧。 + +**关于钻研(hacking)和学习编程:** + +> People could no longer learn hacking the way I did, by starting to work on a real operating system, making real improvements. In fact, in the 1980s I often came across newly graduated computer science majors who had never seen a real program in their lives. They had only seen toy exercises, school exercises, because every real program was a trade secret. They never had the experience of writing features for users to really use, and fixing the bugs that real users came across. The things you need to know to do real work. + +(时过境迁,)人们没法再像我当初那样通过改进实实在在的操作系统来学习编程了。上世纪 80 年代,我常遇见计算机专业的毕业生,有生以来没见过真正的程序。他们接触的到的只有小玩意和学校的作业,因为每一个程序都是商业机密。他们没有机会为用户去写真正实用的特性,修复用户真正遭遇的问题。而这些正是真正的工作中你需要掌握的(东西)。 + +> It is hard to write a simple definition of something as varied as hacking, but I think what these activities have in common is playfulness, cleverness, and exploration. Thus, hacking means exploring the limits of what is possible, in a spirit of playful cleverness. Activities that display playful cleverness have "hack value". + +对于如“hacking”这般多样化的东西真的很难简单的下定义,不过在我看来诸如此类的行为都会有以下的这些共同点:嬉乐、智慧和探索。因此,hacking 意味着对可能的极限的探索,一颗向往快乐与智慧的心。能带来快乐与智慧的行为就有 “hack 的价值” 。 + +**关于浏览网页:** + +> For personal reasons, I do not browse the web from my computer. (I also have no net connection much of the time.) To look at page I send mail to a daemon which runs wget and mails the page back to me. It is very efficient use of my time, but it is slow in real time. + +出于个人原因,我不会在我的电脑上浏览网页。(大部分时间处于没有网络连接的状态。)要浏览网页,我需要给一个守护进程发 mail,然后它会运行 wget 并把页面通过 mail 发还给我。这对我而言已经是最效率了,但那真的比实时慢太多了。 + +**关于音乐共享:** + +> Friends share music with each other, they don't allow themselves to be divided by a system that says that nobody is supposed to have copies. + +朋友之间彼此分享音乐,绝不会希望因为系统的一句:“禁止私下拷贝!”而生分。 + +-------------------------------------------------------------------------------- + +via: https://tlhp.cf/fsf-richard-stallman/ + +作者:[Pavlo Rudyi][a] +译者:[martin2011qi](https://github.com/martin2011qi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://tlhp.cf/fsf-richard-stallman/ +[1]:http://www.gnu.org/ +[2]:http://www.fsf.org/ +[3]:https://www.fsf.org/about/ \ No newline at end of file diff --git a/translated/talk/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md b/translated/talk/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md deleted file mode 100644 index a8d1616106..0000000000 --- a/translated/talk/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md +++ /dev/null @@ -1,171 +0,0 @@ -30 年自由软件基金会:理查德·斯托曼语录集锦 -================================================================================ -注:youtube 视频 - - -**理查德·马修·斯托曼** (rms) – IT大牛之一。他是一名程序员,GCC、GDB、Emacs 的构建者,软件自由传教士,[GNU Project][1] 和 [FSF][2] 的创办人。 - -**GNU** 是 “GNU’s Not Unix!”的缩写。GNU 是基于 Unix 操作系统的自由计算机软件集合。支持 GNU/Hurd 和 Linux 内核。于1983年9月27日公诸于众。常有组件: - -- GNU Compiler Collection (GCC) -- GNU C library (glibc) -- GNU Core Utilities (coreutils) -- GNU Debugger (GDB) -- GNU Binary Utilities (binutils) -- GNU Bash shell -- NOME desktop environment - -注:视频 - - -**自由软件基金会** (FSF) – 一个自由软件的非营利组织,致力于计算机用户自由的提升和权力的捍卫。于 1985 年 10 月 4 日成立。阅读[更多][3]。 - -- 于目的无关,随心运行程序的自由(自由0)。 -- 学习程序如何运作,并改变它为你所用的自由(自由1)。可以访问源码是这条的前提。 -- 重新发布副本的自由,如此你便可以帮助你的邻居了 (自由 2)。 -- 发布自己修改版本给他人的自由(自由 3)。这样能让整个社区有机会从你的改变中受益。可以访问源码是这条的前提。 - -以上为自由软件的四项自由原则。 - -以下为理查德·斯托曼关于自由、软件、社交、哲学等的名言摘引。 - -**关于 Facebook:** - -> Facebook 不是你的朋友,是监控引擎。 - -**关于 Android:** - -> Android 和 GNU/Linux 有很大的区别,因为其中几乎没有 GNU。的确,Android 和 GNU/Linux 之间仅有一个共同组件,那就是内核 - Linux。 - -**关于计算机行业:** - -> 计算机行业是唯一一个比时尚女装更被时尚驱动的行业。 - -**关于云计算:** - -> 关于云计算,有趣的是我们已经重新定义了云计算来包含我们曾干的所有事。 - -**关于伦理:** - -> 无论神存在与否,都没有绝对的伦理道德。没有这份理所当然,我们该如何?也唯有尽善吧。 - -**关于自由:** - -> 自由软件是尊重个人自由和社会团结的软件。所以才能如自由般自由自在。 - -**关于目标和理想:** - -> 如果你想为这世界做些什么,仅有理想是不够的,你需要找条通往目标的道路并走完。 - -**关于分享:** - -> 分享很棒,而且数字化技术也使分享变得容易。 - -**关于 facebook(进阶版):** - -> Facebook 蹂躏它们的用户。它不是你们的朋友;它就是个监控引擎。举个例子,你是否曾在一些网页或网站上看到 Facebook 的 “like” 按键。对,Facebook 知道你的电脑曾访问过那些网页。 - -**关于 web 应用:** - -> 给你个为什么不应该使用 web 应用的理由,因为你失去了计算机的控制权。 -> -> 如果你使用私有程序或他人的 web 服务器,那么你只能任人鱼肉。被软件的软件的开发者轻易操纵。 - -**关于书:** - -> 印刷出来的书,当然是自由的。即使你买了别人也不知道,这也是我一直买书的方式。买时不会被任何数据库认出。是亚马逊把自由夺走了。 - -**关于 MPAA:** - -> MPAA 其实是美国电影协会(Motion Picture Association of America),但我认为叫做攻击万物的邪恶力量(Malicious Power Attacking All)更为合适。 - -**关于金钱与职业:** - -> 我可以这样赚钱,并沉浸在编码的快乐中。但在职业生涯结束后,回首目睹自己筑就的高墙将人与人分隔开,我会觉得我耗尽毕生精力只换来了一个更糟糕的世界。 - -**关于私有软件:** - -> 私有软件使用户孤立、无助。因为禁止将软件给他人使用所以孤立,因为无法改变源码所以无助。他们学不了其中正真的工作方式。所以整个私有软件体系就是一种不公的力量。 - -**关于智能手机:** - -> 智能手机就是电脑 - 虽然做的和常用的电脑不同 - 但是却能干电脑能干的活。所以我们所说的一切有关于电脑上的软件应该能自由运行 - 必须坚持 - 在智能手机上也是这样。当然也包括平板。 - -**关于 CD 和数字内容:** - -> CD 商店有一个弱势就是需要昂贵的库存,但是电子商店就没有这方面的需求:他们只需要将售卖的副本写入记忆棒,并在你忘带自己的记忆棒时卖你一个就是了。 - -**关于竞争范式:About paradigm of competition:** - -> 竞争范式就像是赛跑:鼓励每一个跑得更快的人。当资本主义真的这样运作时,当然是件好事;但是维护者若是假设它一直这样运作的话那就大错特错了。 - -**关于 vi 和 emacs:** - -> 有时会有人问我在 Emacs 的阵营使用 vi 是不是一种罪过。使用自由版的 vi 并不是一种罪过;是一种忏悔。所以好好享受其中乐趣吧。 - -**关于自由和历史:** - -> 历史教会我们:珍惜自由,否则你将失去他。“别和我们谈政治”,对听不进的人这就是答复。 - -**关于专利:** - -> 和专利一个一个的战斗并不能解决软件专利带来的危害,就像打再多的蚊子也消灭不了疟疾一样。 -> -> 软件专利对于软件的开发者来说十分危险,因为它们加剧了对于软件理念的垄断。 - -**关于版权:** - -> 其实,版权制度对作者也没有什么好处,撇开最受欢迎的那个,其他作者的主旨可能更好理解,所以分享无论对他们还是你的读者都是一件好事。 - -**关于工作与报酬:** - -> 劳有所得,或寻求收入的最大化并没有什么错,只要不是不择手段。 - -**关于 Chrome OS:** - -> Chrome OS 确实是 GNU/Linux 的操作系统。但是,它在发布时没有安装常用应用,并为安装他们设置了阻碍。 - -**关于 Linux 用户:** - -> 许多的 GNU/Linux 用户并没有听过自由软件。他们并没有意识到,这个系统是因为道德理想才存在的,与此一起被忽视的还有所谓的“开源”。 - -**关于 facebook 的隐私:** - -> 如果页面上有 “like” 按键,Facebook 就能知道谁访问了页面。即使不是 Facebook 的用户,也可以得到访问该页面电脑的 IP 地址。 - -**关于编程:** - -> 编程不是科学,编程是手艺。 -> -> Lisp 和 C 语言是我的最爱。然自 1992 年以来高频的自由软件活动,确实反映了我编的太过匆忙。大概在 2008 年我便停止了编程开发。 -> -> C++ 设计的真糟糕、真丑陋。在 Emacs 上用他应该觉得羞愧。 - -**关于钻研(hacking)和学习编程:** - -> 今时不同往日,大家再也不用走我的老路了,完全可以在实际的操作系统上提升自己。上世纪 80 年代,我常遇见计算机专业的毕业生,自出生以来没见过真正的程序。他们接触的到的只有小玩意和学校的作业,因为每一个程序都是商业机密。他们没有机会去写真正实用的特性,修复用户真正遭遇的问题。做这些事便是你应知晓的最好的提升方式。 -> -> 对于如 hacking 这般多样化的东西真的很难简单的下定义,不过在我看来诸如此类的行为都会有以下的这些共同点:嬉乐、智慧和探索。因此,hacking 意味着对可能的极限的探索,一颗向往快乐与智慧心。能带来快乐与智慧的行为就有 “hack 的价值” 。 - -**关于浏览网页:** - -> 由于个人原因,我不会在我的电脑上浏览网页。(大部分时间处于没有网络连接的状态。)要浏览网页,我需要给守护进程发 mail,然后它会运行 wget 并把页面通过 mail 发还给我。这对我而言已经是最效率了,但那真的比实时慢太多了。 - -**关于音乐共享:** - -> 朋友之间彼此分享音乐,绝不会希望因为系统的一句:禁止私下拷贝!而生分。 - --------------------------------------------------------------------------------- - -via: https://tlhp.cf/fsf-richard-stallman/ - -作者:[Pavlo Rudyi][a] -译者:[martin2011qi](https://github.com/martin2011qi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://tlhp.cf/fsf-richard-stallman/ -[1]:http://www.gnu.org/ -[2]:http://www.fsf.org/ -[3]:https://www.fsf.org/about/ \ No newline at end of file From 39e253925b31c506e525c28c909c5e90dc3155a4 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 1 Feb 2016 07:53:55 +0800 Subject: [PATCH 0279/1469] =?UTF-8?q?=E5=BD=92=E6=A1=A3=20201601?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20101020 19 Years of KDE History--Step by Step.md | 0 .../20150921 14 tips for teaching open source development.md | 0 .../20151012 Remember sed and awk All Linux admins should.md | 0 .../20151013 DFileManager--Cover Flow File Manager.md | 0 .../20151107 Hackers Successfully Install Linux on a Potato.md | 0 ...0151109 How to Install GitLab on Ubuntu or Fedora or Debian.md | 0 .../20151117 Linux 101--Get the most out of Systemd.md | 0 ...sign Multiple IP Addresses To One Interface On Ubuntu 15.10.md | 0 .../20151123 How to Configure Apache Solr on Ubuntu 14 or 15.md | 0 .../20151125 Running a mainline kernel on a cellphone.md | 0 ...o Install Nginx as Reverse Proxy for Apache on FreeBSD 10.2.md | 0 ...eries 1--HowTo--Use grep Command In Linux or UNIX--Examples.md | 0 ...grep Command Tutorial series 2--Regular Expressions In grep.md | 0 ...-Search Multiple Words or String Pattern Using grep Command.md | 0 ...rial series 4--Grep Count Lines If a String or Word Matches.md | 0 ...utorial series 5--Grep From Files and Display the File Name.md | 0 ... Tutorial series 6--How To Find Files by Content Under UNIX.md | 0 ...guration File Directives Uncommented Lines of a Config File.md | 0 ...o Install Laravel PHP Framework on CentOS 7 or Ubuntu 15.04.md | 0 ...1204 Install and Configure Munin monitoring server in Linux.md | 0 .../{ => 201601}/20151204 Linux or Unix--jobs Command Examples.md | 0 .../20151206 NetworkManager and privacy in the IPv6 internet.md | 0 .../20151208 How to renew the ISPConfig 3 SSL Certificate.md | 0 .../20151208 Top 5 open source community metrics to track.md | 0 ...1215 Fix--Cannot establish FTP connection to an SFTP server.md | 0 .../20151215 How to block network traffic by country on Linux.md | 0 published/{ => 201601}/20151222 Turn Tor socks to http.md | 0 ...1223 How to Setup SSH Login Without Password CentOS or RHEL.md | 0 .../20151223 How to Use Glances to Monitor System on Ubuntu.md | 0 .../20151223 Monitor Linux System Performance Using Nmon.md | 0 .../20151223 Ten Biggest Linux Stories Of The Year 2015.md | 0 .../20151223 What' s the Best File System for My Linux Install.md | 0 ...What are the best plugins to increase productivity on Emacs.md | 0 published/{ => 201601}/20151229 Grub 2--Heal your bootloader.md | 0 ...w to Check Hardware Information on Linux Using Command Line.md | 0 ...20160111 Open Source DJ Software Mixxx Version 2.0 Released.md | 0 ...60111 Ubuntu-‘Spyware’-Will-Be-Disabled-In-Ubuntu-16.04-LTS.md | 0 published/{ => 201601}/Learn with Linux--Learning Music.md | 0 published/{ => 201601}/Learn with Linux--Learning to Type.md | 0 published/{ => 201601}/Learn with Linux--Physics Simulation.md | 0 published/{ => 201601}/Learn with Linux--Two Geography Apps.md | 0 41 files changed, 0 insertions(+), 0 deletions(-) rename published/{ => 201601}/20101020 19 Years of KDE History--Step by Step.md (100%) rename published/{ => 201601}/20150921 14 tips for teaching open source development.md (100%) rename published/{ => 201601}/20151012 Remember sed and awk All Linux admins should.md (100%) rename published/{ => 201601}/20151013 DFileManager--Cover Flow File Manager.md (100%) rename published/{ => 201601}/20151107 Hackers Successfully Install Linux on a Potato.md (100%) rename published/{ => 201601}/20151109 How to Install GitLab on Ubuntu or Fedora or Debian.md (100%) rename published/{ => 201601}/20151117 Linux 101--Get the most out of Systemd.md (100%) rename published/{ => 201601}/20151123 Assign Multiple IP Addresses To One Interface On Ubuntu 15.10.md (100%) rename published/{ => 201601}/20151123 How to Configure Apache Solr on Ubuntu 14 or 15.md (100%) rename published/{ => 201601}/20151125 Running a mainline kernel on a cellphone.md (100%) rename published/{ => 201601}/20151126 How to Install Nginx as Reverse Proxy for Apache on FreeBSD 10.2.md (100%) rename published/{ => 201601}/20151127 Linux or UNIX grep Command Tutorial series 1--HowTo--Use grep Command In Linux or UNIX--Examples.md (100%) rename published/{ => 201601}/20151127 Linux or UNIX grep Command Tutorial series 2--Regular Expressions In grep.md (100%) mode change 100755 => 100644 rename published/{ => 201601}/20151127 Linux or UNIX grep Command Tutorial series 3--Search Multiple Words or String Pattern Using grep Command.md (100%) rename published/{ => 201601}/20151127 Linux or UNIX grep Command Tutorial series 4--Grep Count Lines If a String or Word Matches.md (100%) rename published/{ => 201601}/20151127 Linux or UNIX grep Command Tutorial series 5--Grep From Files and Display the File Name.md (100%) rename published/{ => 201601}/20151127 Linux or UNIX grep Command Tutorial series 6--How To Find Files by Content Under UNIX.md (100%) rename published/{ => 201601}/20151127 Linux or UNIX grep Command Tutorial series 7--Linux or UNIX View Only Configuration File Directives Uncommented Lines of a Config File.md (100%) rename published/{ => 201601}/20151204 How to Install Laravel PHP Framework on CentOS 7 or Ubuntu 15.04.md (100%) rename published/{ => 201601}/20151204 Install and Configure Munin monitoring server in Linux.md (100%) rename published/{ => 201601}/20151204 Linux or Unix--jobs Command Examples.md (100%) rename published/{ => 201601}/20151206 NetworkManager and privacy in the IPv6 internet.md (100%) rename published/{ => 201601}/20151208 How to renew the ISPConfig 3 SSL Certificate.md (100%) rename published/{ => 201601}/20151208 Top 5 open source community metrics to track.md (100%) rename published/{ => 201601}/20151215 Fix--Cannot establish FTP connection to an SFTP server.md (100%) rename published/{ => 201601}/20151215 How to block network traffic by country on Linux.md (100%) rename published/{ => 201601}/20151222 Turn Tor socks to http.md (100%) rename published/{ => 201601}/20151223 How to Setup SSH Login Without Password CentOS or RHEL.md (100%) rename published/{ => 201601}/20151223 How to Use Glances to Monitor System on Ubuntu.md (100%) rename published/{ => 201601}/20151223 Monitor Linux System Performance Using Nmon.md (100%) rename published/{ => 201601}/20151223 Ten Biggest Linux Stories Of The Year 2015.md (100%) rename published/{ => 201601}/20151223 What' s the Best File System for My Linux Install.md (100%) rename published/{ => 201601}/20151225 What are the best plugins to increase productivity on Emacs.md (100%) rename published/{ => 201601}/20151229 Grub 2--Heal your bootloader.md (100%) rename published/{ => 201601}/20160104 How to Check Hardware Information on Linux Using Command Line.md (100%) rename published/{ => 201601}/20160111 Open Source DJ Software Mixxx Version 2.0 Released.md (100%) rename published/{ => 201601}/20160111 Ubuntu-‘Spyware’-Will-Be-Disabled-In-Ubuntu-16.04-LTS.md (100%) rename published/{ => 201601}/Learn with Linux--Learning Music.md (100%) rename published/{ => 201601}/Learn with Linux--Learning to Type.md (100%) rename published/{ => 201601}/Learn with Linux--Physics Simulation.md (100%) rename published/{ => 201601}/Learn with Linux--Two Geography Apps.md (100%) diff --git a/published/20101020 19 Years of KDE History--Step by Step.md b/published/201601/20101020 19 Years of KDE History--Step by Step.md similarity index 100% rename from published/20101020 19 Years of KDE History--Step by Step.md rename to published/201601/20101020 19 Years of KDE History--Step by Step.md diff --git a/published/20150921 14 tips for teaching open source development.md b/published/201601/20150921 14 tips for teaching open source development.md similarity index 100% rename from published/20150921 14 tips for teaching open source development.md rename to published/201601/20150921 14 tips for teaching open source development.md diff --git a/published/20151012 Remember sed and awk All Linux admins should.md b/published/201601/20151012 Remember sed and awk All Linux admins should.md similarity index 100% rename from published/20151012 Remember sed and awk All Linux admins should.md rename to published/201601/20151012 Remember sed and awk All Linux admins should.md diff --git a/published/20151013 DFileManager--Cover Flow File Manager.md b/published/201601/20151013 DFileManager--Cover Flow File Manager.md similarity index 100% rename from published/20151013 DFileManager--Cover Flow File Manager.md rename to published/201601/20151013 DFileManager--Cover Flow File Manager.md diff --git a/published/20151107 Hackers Successfully Install Linux on a Potato.md b/published/201601/20151107 Hackers Successfully Install Linux on a Potato.md similarity index 100% rename from published/20151107 Hackers Successfully Install Linux on a Potato.md rename to published/201601/20151107 Hackers Successfully Install Linux on a Potato.md diff --git a/published/20151109 How to Install GitLab on Ubuntu or Fedora or Debian.md b/published/201601/20151109 How to Install GitLab on Ubuntu or Fedora or Debian.md similarity index 100% rename from published/20151109 How to Install GitLab on Ubuntu or Fedora or Debian.md rename to published/201601/20151109 How to Install GitLab on Ubuntu or Fedora or Debian.md diff --git a/published/20151117 Linux 101--Get the most out of Systemd.md b/published/201601/20151117 Linux 101--Get the most out of Systemd.md similarity index 100% rename from published/20151117 Linux 101--Get the most out of Systemd.md rename to published/201601/20151117 Linux 101--Get the most out of Systemd.md diff --git a/published/20151123 Assign Multiple IP Addresses To One Interface On Ubuntu 15.10.md b/published/201601/20151123 Assign Multiple IP Addresses To One Interface On Ubuntu 15.10.md similarity index 100% rename from published/20151123 Assign Multiple IP Addresses To One Interface On Ubuntu 15.10.md rename to published/201601/20151123 Assign Multiple IP Addresses To One Interface On Ubuntu 15.10.md diff --git a/published/20151123 How to Configure Apache Solr on Ubuntu 14 or 15.md b/published/201601/20151123 How to Configure Apache Solr on Ubuntu 14 or 15.md similarity index 100% rename from published/20151123 How to Configure Apache Solr on Ubuntu 14 or 15.md rename to published/201601/20151123 How to Configure Apache Solr on Ubuntu 14 or 15.md diff --git a/published/20151125 Running a mainline kernel on a cellphone.md b/published/201601/20151125 Running a mainline kernel on a cellphone.md similarity index 100% rename from published/20151125 Running a mainline kernel on a cellphone.md rename to published/201601/20151125 Running a mainline kernel on a cellphone.md diff --git a/published/20151126 How to Install Nginx as Reverse Proxy for Apache on FreeBSD 10.2.md b/published/201601/20151126 How to Install Nginx as Reverse Proxy for Apache on FreeBSD 10.2.md similarity index 100% rename from published/20151126 How to Install Nginx as Reverse Proxy for Apache on FreeBSD 10.2.md rename to published/201601/20151126 How to Install Nginx as Reverse Proxy for Apache on FreeBSD 10.2.md diff --git a/published/20151127 Linux or UNIX grep Command Tutorial series 1--HowTo--Use grep Command In Linux or UNIX--Examples.md b/published/201601/20151127 Linux or UNIX grep Command Tutorial series 1--HowTo--Use grep Command In Linux or UNIX--Examples.md similarity index 100% rename from published/20151127 Linux or UNIX grep Command Tutorial series 1--HowTo--Use grep Command In Linux or UNIX--Examples.md rename to published/201601/20151127 Linux or UNIX grep Command Tutorial series 1--HowTo--Use grep Command In Linux or UNIX--Examples.md diff --git a/published/20151127 Linux or UNIX grep Command Tutorial series 2--Regular Expressions In grep.md b/published/201601/20151127 Linux or UNIX grep Command Tutorial series 2--Regular Expressions In grep.md old mode 100755 new mode 100644 similarity index 100% rename from published/20151127 Linux or UNIX grep Command Tutorial series 2--Regular Expressions In grep.md rename to published/201601/20151127 Linux or UNIX grep Command Tutorial series 2--Regular Expressions In grep.md diff --git a/published/20151127 Linux or UNIX grep Command Tutorial series 3--Search Multiple Words or String Pattern Using grep Command.md b/published/201601/20151127 Linux or UNIX grep Command Tutorial series 3--Search Multiple Words or String Pattern Using grep Command.md similarity index 100% rename from published/20151127 Linux or UNIX grep Command Tutorial series 3--Search Multiple Words or String Pattern Using grep Command.md rename to published/201601/20151127 Linux or UNIX grep Command Tutorial series 3--Search Multiple Words or String Pattern Using grep Command.md diff --git a/published/20151127 Linux or UNIX grep Command Tutorial series 4--Grep Count Lines If a String or Word Matches.md b/published/201601/20151127 Linux or UNIX grep Command Tutorial series 4--Grep Count Lines If a String or Word Matches.md similarity index 100% rename from published/20151127 Linux or UNIX grep Command Tutorial series 4--Grep Count Lines If a String or Word Matches.md rename to published/201601/20151127 Linux or UNIX grep Command Tutorial series 4--Grep Count Lines If a String or Word Matches.md diff --git a/published/20151127 Linux or UNIX grep Command Tutorial series 5--Grep From Files and Display the File Name.md b/published/201601/20151127 Linux or UNIX grep Command Tutorial series 5--Grep From Files and Display the File Name.md similarity index 100% rename from published/20151127 Linux or UNIX grep Command Tutorial series 5--Grep From Files and Display the File Name.md rename to published/201601/20151127 Linux or UNIX grep Command Tutorial series 5--Grep From Files and Display the File Name.md diff --git a/published/20151127 Linux or UNIX grep Command Tutorial series 6--How To Find Files by Content Under UNIX.md b/published/201601/20151127 Linux or UNIX grep Command Tutorial series 6--How To Find Files by Content Under UNIX.md similarity index 100% rename from published/20151127 Linux or UNIX grep Command Tutorial series 6--How To Find Files by Content Under UNIX.md rename to published/201601/20151127 Linux or UNIX grep Command Tutorial series 6--How To Find Files by Content Under UNIX.md diff --git a/published/20151127 Linux or UNIX grep Command Tutorial series 7--Linux or UNIX View Only Configuration File Directives Uncommented Lines of a Config File.md b/published/201601/20151127 Linux or UNIX grep Command Tutorial series 7--Linux or UNIX View Only Configuration File Directives Uncommented Lines of a Config File.md similarity index 100% rename from published/20151127 Linux or UNIX grep Command Tutorial series 7--Linux or UNIX View Only Configuration File Directives Uncommented Lines of a Config File.md rename to published/201601/20151127 Linux or UNIX grep Command Tutorial series 7--Linux or UNIX View Only Configuration File Directives Uncommented Lines of a Config File.md diff --git a/published/20151204 How to Install Laravel PHP Framework on CentOS 7 or Ubuntu 15.04.md b/published/201601/20151204 How to Install Laravel PHP Framework on CentOS 7 or Ubuntu 15.04.md similarity index 100% rename from published/20151204 How to Install Laravel PHP Framework on CentOS 7 or Ubuntu 15.04.md rename to published/201601/20151204 How to Install Laravel PHP Framework on CentOS 7 or Ubuntu 15.04.md diff --git a/published/20151204 Install and Configure Munin monitoring server in Linux.md b/published/201601/20151204 Install and Configure Munin monitoring server in Linux.md similarity index 100% rename from published/20151204 Install and Configure Munin monitoring server in Linux.md rename to published/201601/20151204 Install and Configure Munin monitoring server in Linux.md diff --git a/published/20151204 Linux or Unix--jobs Command Examples.md b/published/201601/20151204 Linux or Unix--jobs Command Examples.md similarity index 100% rename from published/20151204 Linux or Unix--jobs Command Examples.md rename to published/201601/20151204 Linux or Unix--jobs Command Examples.md diff --git a/published/20151206 NetworkManager and privacy in the IPv6 internet.md b/published/201601/20151206 NetworkManager and privacy in the IPv6 internet.md similarity index 100% rename from published/20151206 NetworkManager and privacy in the IPv6 internet.md rename to published/201601/20151206 NetworkManager and privacy in the IPv6 internet.md diff --git a/published/20151208 How to renew the ISPConfig 3 SSL Certificate.md b/published/201601/20151208 How to renew the ISPConfig 3 SSL Certificate.md similarity index 100% rename from published/20151208 How to renew the ISPConfig 3 SSL Certificate.md rename to published/201601/20151208 How to renew the ISPConfig 3 SSL Certificate.md diff --git a/published/20151208 Top 5 open source community metrics to track.md b/published/201601/20151208 Top 5 open source community metrics to track.md similarity index 100% rename from published/20151208 Top 5 open source community metrics to track.md rename to published/201601/20151208 Top 5 open source community metrics to track.md diff --git a/published/20151215 Fix--Cannot establish FTP connection to an SFTP server.md b/published/201601/20151215 Fix--Cannot establish FTP connection to an SFTP server.md similarity index 100% rename from published/20151215 Fix--Cannot establish FTP connection to an SFTP server.md rename to published/201601/20151215 Fix--Cannot establish FTP connection to an SFTP server.md diff --git a/published/20151215 How to block network traffic by country on Linux.md b/published/201601/20151215 How to block network traffic by country on Linux.md similarity index 100% rename from published/20151215 How to block network traffic by country on Linux.md rename to published/201601/20151215 How to block network traffic by country on Linux.md diff --git a/published/20151222 Turn Tor socks to http.md b/published/201601/20151222 Turn Tor socks to http.md similarity index 100% rename from published/20151222 Turn Tor socks to http.md rename to published/201601/20151222 Turn Tor socks to http.md diff --git a/published/20151223 How to Setup SSH Login Without Password CentOS or RHEL.md b/published/201601/20151223 How to Setup SSH Login Without Password CentOS or RHEL.md similarity index 100% rename from published/20151223 How to Setup SSH Login Without Password CentOS or RHEL.md rename to published/201601/20151223 How to Setup SSH Login Without Password CentOS or RHEL.md diff --git a/published/20151223 How to Use Glances to Monitor System on Ubuntu.md b/published/201601/20151223 How to Use Glances to Monitor System on Ubuntu.md similarity index 100% rename from published/20151223 How to Use Glances to Monitor System on Ubuntu.md rename to published/201601/20151223 How to Use Glances to Monitor System on Ubuntu.md diff --git a/published/20151223 Monitor Linux System Performance Using Nmon.md b/published/201601/20151223 Monitor Linux System Performance Using Nmon.md similarity index 100% rename from published/20151223 Monitor Linux System Performance Using Nmon.md rename to published/201601/20151223 Monitor Linux System Performance Using Nmon.md diff --git a/published/20151223 Ten Biggest Linux Stories Of The Year 2015.md b/published/201601/20151223 Ten Biggest Linux Stories Of The Year 2015.md similarity index 100% rename from published/20151223 Ten Biggest Linux Stories Of The Year 2015.md rename to published/201601/20151223 Ten Biggest Linux Stories Of The Year 2015.md diff --git a/published/20151223 What' s the Best File System for My Linux Install.md b/published/201601/20151223 What' s the Best File System for My Linux Install.md similarity index 100% rename from published/20151223 What' s the Best File System for My Linux Install.md rename to published/201601/20151223 What' s the Best File System for My Linux Install.md diff --git a/published/20151225 What are the best plugins to increase productivity on Emacs.md b/published/201601/20151225 What are the best plugins to increase productivity on Emacs.md similarity index 100% rename from published/20151225 What are the best plugins to increase productivity on Emacs.md rename to published/201601/20151225 What are the best plugins to increase productivity on Emacs.md diff --git a/published/20151229 Grub 2--Heal your bootloader.md b/published/201601/20151229 Grub 2--Heal your bootloader.md similarity index 100% rename from published/20151229 Grub 2--Heal your bootloader.md rename to published/201601/20151229 Grub 2--Heal your bootloader.md diff --git a/published/20160104 How to Check Hardware Information on Linux Using Command Line.md b/published/201601/20160104 How to Check Hardware Information on Linux Using Command Line.md similarity index 100% rename from published/20160104 How to Check Hardware Information on Linux Using Command Line.md rename to published/201601/20160104 How to Check Hardware Information on Linux Using Command Line.md diff --git a/published/20160111 Open Source DJ Software Mixxx Version 2.0 Released.md b/published/201601/20160111 Open Source DJ Software Mixxx Version 2.0 Released.md similarity index 100% rename from published/20160111 Open Source DJ Software Mixxx Version 2.0 Released.md rename to published/201601/20160111 Open Source DJ Software Mixxx Version 2.0 Released.md diff --git a/published/20160111 Ubuntu-‘Spyware’-Will-Be-Disabled-In-Ubuntu-16.04-LTS.md b/published/201601/20160111 Ubuntu-‘Spyware’-Will-Be-Disabled-In-Ubuntu-16.04-LTS.md similarity index 100% rename from published/20160111 Ubuntu-‘Spyware’-Will-Be-Disabled-In-Ubuntu-16.04-LTS.md rename to published/201601/20160111 Ubuntu-‘Spyware’-Will-Be-Disabled-In-Ubuntu-16.04-LTS.md diff --git a/published/Learn with Linux--Learning Music.md b/published/201601/Learn with Linux--Learning Music.md similarity index 100% rename from published/Learn with Linux--Learning Music.md rename to published/201601/Learn with Linux--Learning Music.md diff --git a/published/Learn with Linux--Learning to Type.md b/published/201601/Learn with Linux--Learning to Type.md similarity index 100% rename from published/Learn with Linux--Learning to Type.md rename to published/201601/Learn with Linux--Learning to Type.md diff --git a/published/Learn with Linux--Physics Simulation.md b/published/201601/Learn with Linux--Physics Simulation.md similarity index 100% rename from published/Learn with Linux--Physics Simulation.md rename to published/201601/Learn with Linux--Physics Simulation.md diff --git a/published/Learn with Linux--Two Geography Apps.md b/published/201601/Learn with Linux--Two Geography Apps.md similarity index 100% rename from published/Learn with Linux--Two Geography Apps.md rename to published/201601/Learn with Linux--Two Geography Apps.md From e7af5ba25b0f04def15fff3b473346146e538e90 Mon Sep 17 00:00:00 2001 From: sonofelice Date: Mon, 1 Feb 2016 23:10:22 +0800 Subject: [PATCH 0280/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E4=B8=ADHow=20bad?= =?UTF-8?q?=20a=20boss=20is=20Linus=20Torvalds=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译中How bad a boss is Linus Torvalds? --- sources/talk/20151117 How bad a boss is Linus Torvalds.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/talk/20151117 How bad a boss is Linus Torvalds.md b/sources/talk/20151117 How bad a boss is Linus Torvalds.md index 8b10e44584..76e9f4c244 100644 --- a/sources/talk/20151117 How bad a boss is Linus Torvalds.md +++ b/sources/talk/20151117 How bad a boss is Linus Torvalds.md @@ -1,3 +1,4 @@ +sonofelice translating How bad a boss is Linus Torvalds? ================================================================================ ![linus torvalds](http://images.techhive.com/images/article/2015/08/linus_torvalds-100600260-primary.idge.jpg) From b74befbdb37e452359c9b6e23bac7926d448765a Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 2 Feb 2016 11:45:02 +0800 Subject: [PATCH 0281/1469] PUB:20151201 How to use Mutt email client with encrypted passwords @wyangsun --- ...t email client with encrypted passwords.md | 135 +++++++++++++++++ ...t email client with encrypted passwords.md | 138 ------------------ 2 files changed, 135 insertions(+), 138 deletions(-) create mode 100644 published/20151201 How to use Mutt email client with encrypted passwords.md delete mode 100644 translated/tech/20151201 How to use Mutt email client with encrypted passwords.md diff --git a/published/20151201 How to use Mutt email client with encrypted passwords.md b/published/20151201 How to use Mutt email client with encrypted passwords.md new file mode 100644 index 0000000000..2c57a73d91 --- /dev/null +++ b/published/20151201 How to use Mutt email client with encrypted passwords.md @@ -0,0 +1,135 @@ +如何 Mutt 邮件客户端中使用密文密码 +================================================================================ +Mutt 是一个 Linux/UNIX 终端环境下的开源的邮件客户端。Mutt 以及 [Alpine][1] 在 Linux 命令行爱好者中有着最忠诚的追随者,这不是没有原因的。想一下你所期待邮件客户端应有的功能,Mutt 拥有:多协议支持(例如,POP3、IMAP 和 SMTP),S/MIME 和 PGP/GPG 集成,会话线索,颜色标记,可定制宏/快捷键,等等。另外,基于命令行的 Mutt 相比粗重的基于浏览器的邮件客户端(如:Gmail,Ymail)或图形用户界面的邮件客户端(如:Thunderbird,MS Outlook)而言,是一个使用电子邮件的轻量级替代品。 + +当你想使用 Mutt 通过公司的 SMTP/IMAP 服务器访问或发送邮件,或取代网页邮件服务,可能所关心的一个问题是如何保护您的邮件凭据(如:SMTP/IMAP 密码),它们存储在一个纯文本 Mutt 配置文件(~/.muttrc)中。 + +对于这些人对安全的担忧,确实有一个容易的方法来**加密 Mutt 配置文件***,以防止这种风险。在这个教程中,我描述了如何加密 Mutt 敏感配置,比如使用 GnuPG(GPG)加密 SMTP/IMAP 密码,GPG 是一个开源的 OpenPGP 实现。 + +### 第一步 (可选):创建 GPG 密钥 ### + +因为我们将要使用 GPG 加密 Mutt 配置文件,如果你没有 GPG 密钥,第一步就是创建一个(公钥/私钥对)。如果有,请忽略这步。 + +创建一个新 GPG 密钥,输入下面命令: + + $ gpg --gen-key + +选择密钥类型(RSA),密钥长度(2048 bits),和过期时间(0 代表不过期)。当出现用户 ID 提示时,输入关联到该公钥/私钥对的名字(Dan Nanni) 和邮箱地址(myemail@email.com)。最后,输入一个密码来保护你的私钥。 + +![](https://c2.staticflickr.com/6/5726/22808727824_7735f11157_c.jpg) + +生成一个 GPG 密钥需要大量的随机字节来构成熵,所以在生成密钥期间确保在你的系统上执行一些随机行为(如:敲打键盘,移动鼠标或者读写磁盘)。根据密钥长度,生成 GPG 密钥要花几分钟或更多时间。 + +![](https://c1.staticflickr.com/1/644/23328597612_6ac5a29944_c.jpg) + +### 第二步:加密 Mutt 敏感配置 ### + +下一步,在 ~/.mutt 目录创建一个新的文本文件,然后把一些你想隐藏的 Mutt 敏感配置放进去。这个例子里,我指定了 SMTP/IMAP 密码。 + + $ mkdir ~/.mutt + $ vi ~/.mutt/password + +---------- + + set smtp_pass="XXXXXXX" + set imap_pass="XXXXXXX" + +现在通过 GPG 使用你的公钥加密这个文件如下: + + $ gpg -r myemail@email.com -e ~/.mutt/password + +这将创建 ~/.mutt/password.gpg,这是一个原始文件的 GPG 加密版本。 + +然后删除 ~/.mutt/password,只保留 GPG 加密版本。 + +### 第三步:创建完整 Mutt 配置文件 ### + +现在你已经在一个单独的文件放置了加密的 Mutt 敏感配置,你可以在 ~/.muttrc 指定其余的 Mutt 配置。然后增加下面这行在 ~/.muttrc 末尾。 + + source "gpg -d ~/.mutt/password.gpg |" + +当你启动 Mutt 时,这行将解密 ~/.mutt/password.gpg ,然后将解密内容应用到你的 Mutt 配置中。 + +下面展示一个完整 Mutt 配置例子,这可以让你通过 Mutt 访问 Gmail,而没有暴露你的 SMTP/IMAP 密码。用你的 Gmail ID 替代下面的 `yourgmailaccount`,此外你也需要在[你的 Goolgle 账户设置][3]中启用“支持不太安全的应用访问”。 + + set from = "yourgmailaccount@gmail.com" + set realname = "Your Name" + set smtp_url = "smtp://yourgmailaccount@smtp.gmail.com:587/" + set imap_user = "yourgmailaccount@gmail.com" + set folder = "imaps://imap.gmail.com:993" + set spoolfile = "+INBOX" + set postponed = "+[Google Mail]/Drafts" + set trash = "+[Google Mail]/Trash" + set header_cache =~/.mutt/cache/headers + set message_cachedir =~/.mutt/cache/bodies + set certificate_file =~/.mutt/certificates + set move = no + set imap_keepalive = 900 + + # encrypted IMAP/SMTP passwords + source "gpg -d ~/.mutt/password.gpg |" + +### 第四步(可选):配置 GPG 代理 ### + +这时候,你将可以使用加密了IMAP/SMTP 密码的 Mutt。然而,每次你运行 Mutt,你都要先被提示输入一个 GPG 密码来使用你的私钥解密 IMAP/SMTP 密码。 + +![](https://c2.staticflickr.com/6/5667/23437064775_20c874940f_c.jpg) + +如果你想避免这样的 GPG 密码提示,你可以部署一个 gpg-agent。它以后台守护进程方式运行,gpg-agent 可以安全地缓存你的 GPG 密码,无需手工干预,gpg 可以自动从 gpg-agent 获得你的 GPG 密码。如果你正在使用 Linux 桌面,你可以配置使用一些等同于 gpg-agent 的特定的桌面软件,例如,GNOME 桌面的 gnome-keyring-daemon。 + +你可以在基于 Debian 系统安装 gpg-agent: + + $ sudo apt-get install gpg-agent + +gpg-agent 在基于 Red Hat 的系统上是预装好的。 + +现在增加下面这些到你的 .bashrc 文件中。 + + envfile="$HOME/.gnupg/gpg-agent.env" + if [[ -e "$envfile" ]] && kill -0 $(grep GPG_AGENT_INFO "$envfile" | cut -d: -f 2) 2>/dev/null; then + eval "$(cat "$envfile")" + else + eval "$(gpg-agent --daemon --allow-preset-passphrase --write-env-file "$envfile")" + fi + export GPG_AGENT_INFO + +重载 .bashrc,或简单的登出然后重新登录。 + + $ source ~/.bashrc + +现在确认 GPG_AGENT_INFO 环境变量已经设置妥当。 + + $ echo $GPG_AGENT_INFO + + /tmp/gpg-0SKJw8/S.gpg-agent:942:1 + +并且,当你输入 gpg-agent 命令时,你应该看到下面的信息。 + + $ gpg-agent + + gpg-agent: gpg-agent running and available + +一旦 gpg-agent 启动运行,它将会在第一次提示你输入密码时缓存你的 GPG 密码。随后你多次运行 Mutt ,都不会被提示要 GPG 密码(gpg-agent 一直开着,缓存就不会过期)。 + +![](https://c1.staticflickr.com/1/664/22809928093_3be57698ce_c.jpg) + +### 结论 ### + +在这个指导里,我提供一个使用 GnuPG 加密如 SMTP/IMAP 密码这样的 Mutt 敏感配置的方法。注意,如果你想在 Mutt 上使用 GnuPG 来加密或签名你的邮件,你可以参考[官方指南][2]关于 GPG 与 Mutt 结合的部分。 + +如果你知道任何使用 Mutt 的安全技巧,欢迎分享它。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/mutt-email-client-encrypted-passwords.html + +作者:[Dan Nanni][a] +译者:[wyangsun](https://github.com/wyangsun) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/nanni +[1]:http://xmodulo.com/gmail-command-line-linux-alpine.html +[2]:http://dev.mutt.org/trac/wiki/MuttGuide/UseGPG +[3]:https://www.google.com/settings/u/1/security \ No newline at end of file diff --git a/translated/tech/20151201 How to use Mutt email client with encrypted passwords.md b/translated/tech/20151201 How to use Mutt email client with encrypted passwords.md deleted file mode 100644 index 1e8a032a04..0000000000 --- a/translated/tech/20151201 How to use Mutt email client with encrypted passwords.md +++ /dev/null @@ -1,138 +0,0 @@ -如何使用加密过密码的Mutt邮件客户端 -================================================================================ -Mutt是一个开源的Linux/UNIX终端环境下的邮件客户端。连同[Alpine][1],Mutt有充分的理由在Linux命令行热衷者中有最忠诚的追随者。想一下你对邮件客户端的期待的事情,Mutt拥有:多协议支持(e.g., POP3, IMAP and SMTP),S/MIME和PGP/GPG集成,线程会话,颜色编码,可定制宏/快捷键,等等。另外,基于命令行的Mutt相比笨重的web浏览器(如:Gmail,Ymail)或可视化邮件客户端(如:Thunderbird,MS Outlook)是一个轻量访问电子邮件的选择。 - -当你想使用Mutt通过公司的SMTP/IMAP服务器访问或发送邮件,或取代网页邮件服务,可能所关心的一个问题是如何保护您的邮件凭据(如:SMTP/IMAP密码)存储在一个纯文本Mutt配置文件(~/.muttrc)。 - -对于一些人安全的担忧,确实有一个容易的方法来**加密Mutt配置文件***,防止这种风险。在这个教程中,我描述了如何加密Mutt敏感配置,比如SMTP/IMAP密码使用GnuPG(GPG),一个开源的OpenPGP实现。 - -### 第一步 (可选):创建GPG密钥 ### - -因为我们将要使用GPG加密Mutt配置文件,如果你没有,第一步就是创建一个GPG密钥(公有/私有 密钥对)。如果有,忽略这步。 - -创建一个新GPG密钥,输入下面的。 - - $ gpg --gen-key - -选择密钥类型(RSA),密钥长度(2048 bits),和过期时间(0,不过期)。当出现用户ID提示时,输入你的名字(Dan Nanni) 和邮箱地址(myemail@email.com)关联到私有/公有密钥对。最后,输入一个密码来保护你的私钥。 - -![](https://c2.staticflickr.com/6/5726/22808727824_7735f11157_c.jpg) - -生成一个GPG密钥需要大量的随机字节熵,所以在生成密钥期间确保在你的系统上执行一些随机行为(如:打键盘,移动鼠标或者读写磁盘)。根据密钥长度决定生成GPG密钥要花几分钟或更多时间。 - -![](https://c1.staticflickr.com/1/644/23328597612_6ac5a29944_c.jpg) - -### 第二部:加密Mutt敏感配置 ### - -下一步,在~/.mutt目录创建一个新的文本文件,然后把一些你想隐藏的Mutt敏感配置放进去。这个例子里,我指定了SMTP/IMAP密码。 - - $ mkdir ~/.mutt - $ vi ~/.mutt/password - ----------- - - set smtp_pass="XXXXXXX" - set imap_pass="XXXXXXX" - -现在gpg用你的公钥加密这个文件如下。 - - $ gpg -r myemail@email.com -e ~/.mutt/password - -这将创建~/.mutt/password.gpg,这个是一个GPG加密原始版本文件。 - -继续删除~/.mutt/password,只保留GPG加密版本。 - -### 第三部:创建完整Mutt配置文件 ### - -由于你已经在一个单独的文件加密了Mutt敏感配置,你可以在~/.muttrc指定其余的Mutt配置。然后增加下面这行在~/.muttrc末尾。 - - source "gpg -d ~/.mutt/password.gpg |" - -当你使用Mutt,这行将解密~/.mutt/password.gpg,然后将解密内容应用到你的Mutt配置。 - -下面展示一个完整Mutt配置例子,这允许你用Mutt访问Gmail,没有暴露你的SMTP/IMAP密码。取代你用Gmail ID登陆你的账户。 - - set from = "yourgmailaccount@gmail.com" - set realname = "Your Name" - set smtp_url = "smtp://yourgmailaccount@smtp.gmail.com:587/" - set imap_user = "yourgmailaccount@gmail.com" - set folder = "imaps://imap.gmail.com:993" - set spoolfile = "+INBOX" - set postponed = "+[Google Mail]/Drafts" - set trash = "+[Google Mail]/Trash" - set header_cache =~/.mutt/cache/headers - set message_cachedir =~/.mutt/cache/bodies - set certificate_file =~/.mutt/certificates - set move = no - set imap_keepalive = 900 - - # encrypted IMAP/SMTP passwords - source "gpg -d ~/.mutt/password.gpg |" - -### 第四部(可选):配置GPG代理 ### - -这时候,你将可以使用加密了IMAP/SMTP密码的Mutt。无论如何,每次你运行Mutt,你都要先被提示输入一个GPG密码来使用你的私钥解密IMAP/SMTP密码。 - -![](https://c2.staticflickr.com/6/5667/23437064775_20c874940f_c.jpg) - -如果你想避免这样的GPG密码提示,你可以部署gpg代理。运行一个后台程序,gpg代理安全的缓存你的GPG密码,无需手工干预gpg自动从gpg代理获得你的GPG密码。如果你正在使用Linux桌面,你可以使用桌面特定方式来配置一些东西等价于gpg代理,例如,GNOME桌面的gnome-keyring-daemon。 - -你可以在基于Debian系统安装gpg代理: - -$ sudo apt-get install gpg-agent - -gpg代理是基于Red Hat系统预装的。 - -现在增加下面这些道你的.bashrc文件。 - - envfile="$HOME/.gnupg/gpg-agent.env" - if [[ -e "$envfile" ]] && kill -0 $(grep GPG_AGENT_INFO "$envfile" | cut -d: -f 2) 2>/dev/null; then - eval "$(cat "$envfile")" - else - eval "$(gpg-agent --daemon --allow-preset-passphrase --write-env-file "$envfile")" - fi - export GPG_AGENT_INFO - -重载.bashrc,或单纯的登出然后登陆回来。 - - $ source ~/.bashrc - -现在确认GPG_AGENT_INFO环境变量已经设置妥当。 - - $ echo $GPG_AGENT_INFO - ----------- - - /tmp/gpg-0SKJw8/S.gpg-agent:942:1 - -并且,当你输入gpg-agent命令时,你应该看到下面的信息。 - - $ gpg-agent - ----------- - - gpg-agent: gpg-agent running and available - -一旦gpg-agent启动运行,它将会在第一次提示你输入密码时缓存你的GPG密码。随后你运行Mutt多次,你将不会被提示要GPG密码(gpg-agent一直开着,缓存就不会过期)。 - -![](https://c1.staticflickr.com/1/664/22809928093_3be57698ce_c.jpg) - -### 结论 ### - -在这个指导里,我提出一个方法加密Mutt敏感配置如SMTP/IMAP密码使用GnuPG。注意,如果你想在Mutt上使用GnuPG或者登陆你的邮件信息,你可以参考[官方指南][2]在使用GPG与Mutt结合。 - -如果你知道任何使用Mutt的安全技巧,随时分享他。 - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/mutt-email-client-encrypted-passwords.html - -作者:[Dan Nanni][a] -译者:[wyangsun](https://github.com/wyangsun) -校对:[校对者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/gmail-command-line-linux-alpine.html -[2]:http://dev.mutt.org/trac/wiki/MuttGuide/UseGPG From a67b583872904f9ee242bc363289f8a3ab5ddb83 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 2 Feb 2016 20:12:15 +0800 Subject: [PATCH 0282/1469] PUB:20160126 How to change from default to alternative Python version on Debian Linux @mr-ping --- ...lternative Python version on Debian Linux.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) rename {translated/tech => published}/20160126 How to change from default to alternative Python version on Debian Linux.md (85%) diff --git a/translated/tech/20160126 How to change from default to alternative Python version on Debian Linux.md b/published/20160126 How to change from default to alternative Python version on Debian Linux.md similarity index 85% rename from translated/tech/20160126 How to change from default to alternative Python version on Debian Linux.md rename to published/20160126 How to change from default to alternative Python version on Debian Linux.md index 5ff89d7944..a33c0fcaaf 100644 --- a/translated/tech/20160126 How to change from default to alternative Python version on Debian Linux.md +++ b/published/20160126 How to change from default to alternative Python version on Debian Linux.md @@ -1,4 +1,4 @@ -如何将 Debian Linux 系统中默认的 Python 替代为其他版本 +如何将 Debian Linux 中的默认的 Python 版本切换为替代版本 ==================================================== 当你安装 Debian Linux 时,安装过程有可能同时为你提供多个可用的 Python 版本,因此系统中会存在多个 Python 的可执行二进制文件。你可以按照以下方法使用 `ls` 命令来查看你的系统中都有那些 Python 的二进制文件可供使用。 @@ -15,9 +15,9 @@ $ python --version Python 2.7.8 ``` -1、基于用户修改 Python 版本: +###1、基于用户修改 Python 版本: -想要为某个特定用户修改 Python 版本,只需要在其 home 目录下创建一个 `alias(别名)` 即可。打开 `~/.bashrc` 文件,添加新的别名信息来修改默认使用的 Python 版本。 +想要为某个特定用户修改 Python 版本,只需要在其 home 目录下创建一个 `alias`(别名) 即可。打开该用户的 `~/.bashrc` 文件,添加新的别名信息来修改默认使用的 Python 版本。 ``` alias python='/usr/bin/python3.4' @@ -36,7 +36,7 @@ $ python --version Python 3.4.2 ``` -2、 基于系统级别修改 Python 版本 +###2、 在系统级修改 Python 版本 我们可以使用 `update-alternatives` 来为整个系统更改 Python 版本。以 root 身份登录,首先罗列出所有可用的 python 替代版本信息: @@ -45,7 +45,7 @@ Python 3.4.2 update-alternatives: error: no alternatives for python ``` -如果出现以上所示的错误信息,则表示 Python 的替代版本尚未被 `update-alternatives` 命令识别。想解决这个问题,我们需要更新一下替代表,将 `python2.7` 和 `python3.4` 放入其中。 +如果出现以上所示的错误信息,则表示 Python 的替代版本尚未被 `update-alternatives` 命令识别。想解决这个问题,我们需要更新一下替代列表,将 `python2.7` 和 `python3.4` 放入其中。 ``` # update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1 @@ -61,7 +61,7 @@ update-alternatives: using /usr/bin/python3.4 to provide /usr/bin/python (python Python 3.4.2 ``` -接下来,我们继续列出可用的 Python 替代版本。 +接下来,我们再次列出可用的 Python 替代版本。 ``` # update-alternatives --list python @@ -82,7 +82,7 @@ Python 3.4.2 Python 2.7.8 ``` -3、附录 +###3、移除替代版本 一旦我们的系统中不再存在某个 Python 的替代版本时,我们可以将其从 `update-alternatives` 列表中删除掉。例如,我们可以将列表中的 python2.7 版本移除掉。 @@ -96,9 +96,8 @@ update-alternatives: using /usr/bin/python3.4 to provide /usr/bin/python (python via: http://linuxconfig.org/how-to-change-from-default-to-alternative-python-version-on-debian-linux -作者:[作者][] 译者:[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 71059bb550dbaa260f6d979972fb64186ed4d119 Mon Sep 17 00:00:00 2001 From: DongShuaike Date: Thu, 4 Feb 2016 11:38:06 +0800 Subject: [PATCH 0283/1469] Create 20160129 Recognizing correct code.md --- .../news/20160129 Recognizing correct code.md | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 sources/news/20160129 Recognizing correct code.md diff --git a/sources/news/20160129 Recognizing correct code.md b/sources/news/20160129 Recognizing correct code.md new file mode 100644 index 0000000000..ad5028d622 --- /dev/null +++ b/sources/news/20160129 Recognizing correct code.md @@ -0,0 +1,51 @@ +# Recognizing correct code + +Automatic bug-repair system fixes 10 times as many errors as its predecessors. +------ +MIT researchers have developed a machine-learning system that can comb through repairs to open-source computer programs and learn their general properties, in order to produce new repairs for a different set of programs. + +The researchers tested their system on a set of programming errors, culled from real open-source applications, that had been compiled to evaluate automatic bug-repair systems. Where those earlier systems were able to repair one or two of the bugs, the MIT system repaired between 15 and 18, depending on whether it settled on the first solution it found or was allowed to run longer. + +While an automatic bug-repair tool would be useful in its own right, professor of electrical engineering and computer science Martin Rinard, whose group developed the new system, believes that the work could have broader ramifications. + +“One of the most intriguing aspects of this research is that we’ve found that there are indeed universal properties of correct code that you can learn from one set of applications and apply to another set of applications,” Rinard says. “If you can recognize correct code, that has enormous implications across all software engineering. This is just the first application of what we hope will be a brand-new, fabulous technique.” + +Fan Long, a graduate student in electrical engineering and computer science at MIT, presented a paper describing the new system at the Symposium on Principles of Programming Languages last week. He and Rinard, his advisor, are co-authors. + +Users of open-source programs catalogue bugs they encounter on project websites, and contributors to the projects post code corrections, or “patches,” to the same sites. So Long was able to write a computer script that automatically extracted both the uncorrected code and patches for 777 errors in eight common open-source applications stored in the online repository GitHub. + +**Feature performance** + +As with [all][1] machine-learning systems, the crucial aspect of Long and Rinard’s design was the selection of a “[feature set][2]” that the system would analyze. The researchers concentrated on values stored in memory — either variables, which can be modified during a program’s execution, or constants, which can’t. They identified 30 prime characteristics of a given value: It might be involved in an operation, such as addition or multiplication, or a comparison, such as greater than or equal to; it might be local, meaning it occurs only within a single block of code, or global, meaning that it’s accessible to the program as a whole; it might be the variable that represents the final result of a calculation; and so on. + +Long and Rinard wrote a computer program that evaluated all the possible relationships between these characteristics in successive lines of code. More than 3,500 such relationships constitute their feature set. Their machine-learning algorithm then tried to determine what combination of features most consistently predicted the success of a patch. + +“All the features we’re trying to look at are relationships between the patch you insert and the code you are trying to patch,” Long says. “Typically, there will be good connections in the correct patches, corresponding to useful or productive program logic. And there will be bad patterns that mean disconnections in program logic or redundant program logic that are less likely to be successful.” + +**Ranking candidates** + +In earlier work, Long had developed an algorithm that attempts to repair program bugs by systematically modifying program code. The modified code is then subjected to a suite of tests designed to elicit the buggy behavior. This approach may find a modification that passes the tests, but it could take a prohibitively long time. Moreover, the modified code may still contain errors that the tests don’t trigger. + +Long and Rinard’s machine-learning system works in conjunction with this earlier algorithm, ranking proposed modifications according to the probability that they are correct before subjecting them to time-consuming tests. + +The researchers tested their system, which they call Prophet, on a set of 69 program errors that had cropped up in eight popular open-source programs. Of those, 19 are amenable to the type of modifications that Long’s algorithm uses; the other 50 have more complicated problems that involve logical inconsistencies across larger swaths of code. + +When Long and Rinard configured their system to settle for the first solution that passed the bug-eliciting tests, it was able to correctly repair 15 of the 19 errors; when they allowed it to run for 12 hours per problem, it repaired 18. + +Of course, that still leaves the other 50 errors in the test set untouched. In ongoing work, Long is working on a machine-learning system that will look at more coarse-grained manipulation of program values across larger stretches of code, in the hope of producing a bug-repair system that can handle more complex errors. + +“A revolutionary aspect of Prophet is how it leverages past successful patches to learn new ones,” says Eran Yahav, an associate professor of computer science at the Technion in Israel. “It relies on the insight that despite differences between software projects, fixes — patches — applied to projects often have commonalities that can be learned from. Using machine learning to learn from ‘big code’ holds the promise to revolutionize many programming tasks — code completion, reverse-engineering, et cetera.” + +-------------------------------------------------------------------------------- + +via: http://news.mit.edu/2016/faster-automatic-bug-repair-code-errors-0129 + +作者:Larry Hardesty +译者:[译者ID](https://github.com/翻译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:http://news.mit.edu/2013/teaching-computers-to-see-by-learning-to-see-like-computers-0919 +[2]:http://news.mit.edu/2015/automating-big-data-analysis-1016 + From 1c79e513dbf63cc0f61099af12f5ba2fcd978c07 Mon Sep 17 00:00:00 2001 From: ZhangXiangping Date: Fri, 5 Feb 2016 10:41:46 +0800 Subject: [PATCH 0284/1469] Update 20151119 How to Install Revive Adserver on Ubuntu 15.04 or CentOS 7.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit chisper 翻译中 --- ...w to Install Revive Adserver on Ubuntu 15.04 or CentOS 7.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20151119 How to Install Revive Adserver on Ubuntu 15.04 or CentOS 7.md b/sources/tech/20151119 How to Install Revive Adserver on Ubuntu 15.04 or CentOS 7.md index 3b6277da80..7fd80c5ce6 100644 --- a/sources/tech/20151119 How to Install Revive Adserver on Ubuntu 15.04 or CentOS 7.md +++ b/sources/tech/20151119 How to Install Revive Adserver on Ubuntu 15.04 or CentOS 7.md @@ -1,3 +1,4 @@ +chisper 翻译中 How to Install Revive Adserver on Ubuntu 15.04 / CentOS 7 ================================================================================ Revive AdserverHow to Install Revive Adserver on Ubuntu 15.04 / CentOS 7 is a free and open source advertisement management system that enables publishers, ad networks and advertisers to serve ads on websites, apps, videos and manage campaigns for multiple advertiser with many features. Revive Adserver is licensed under GNU Public License which is also known as OpenX Source. It features an integrated banner management interface, URL targeting, geo-targeting and tracking system for gathering statistics. This application enables website owners to manage banners from both in-house advertisement campaigns as well as from paid or third-party sources, such as Google's AdSense. Here, in this tutorial, we'll gonna install Revive Adserver in our machine running Ubuntu 15.04 or CentOS 7. @@ -239,4 +240,4 @@ via: http://linoxide.com/linux-how-to/install-revive-adserver-ubuntu-15-04-cento [a]:http://linoxide.com/author/arunp/ [1]:http://www.revive-adserver.com/download/ -[2]:http://www.adserverplugins.com/ \ No newline at end of file +[2]:http://www.adserverplugins.com/ From b9fe009cf445c8f11f6ae1e8db8886cdf0b6ced6 Mon Sep 17 00:00:00 2001 From: ZhangXiangping Date: Fri, 5 Feb 2016 15:20:49 +0800 Subject: [PATCH 0285/1469] Delete 20151119 How to Install Revive Adserver on Ubuntu 15.04 or CentOS 7.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 删除原稿 --- ...ve Adserver on Ubuntu 15.04 or CentOS 7.md | 243 ------------------ 1 file changed, 243 deletions(-) delete mode 100644 sources/tech/20151119 How to Install Revive Adserver on Ubuntu 15.04 or CentOS 7.md diff --git a/sources/tech/20151119 How to Install Revive Adserver on Ubuntu 15.04 or CentOS 7.md b/sources/tech/20151119 How to Install Revive Adserver on Ubuntu 15.04 or CentOS 7.md deleted file mode 100644 index 7fd80c5ce6..0000000000 --- a/sources/tech/20151119 How to Install Revive Adserver on Ubuntu 15.04 or CentOS 7.md +++ /dev/null @@ -1,243 +0,0 @@ -chisper 翻译中 -How to Install Revive Adserver on Ubuntu 15.04 / CentOS 7 -================================================================================ -Revive AdserverHow to Install Revive Adserver on Ubuntu 15.04 / CentOS 7 is a free and open source advertisement management system that enables publishers, ad networks and advertisers to serve ads on websites, apps, videos and manage campaigns for multiple advertiser with many features. Revive Adserver is licensed under GNU Public License which is also known as OpenX Source. It features an integrated banner management interface, URL targeting, geo-targeting and tracking system for gathering statistics. This application enables website owners to manage banners from both in-house advertisement campaigns as well as from paid or third-party sources, such as Google's AdSense. Here, in this tutorial, we'll gonna install Revive Adserver in our machine running Ubuntu 15.04 or CentOS 7. - -### 1. Installing LAMP Stack ### - -First of all, as Revive Adserver requires a complete LAMP Stack to work, we'll gonna install it. LAMP Stack is the combination of Apache Web Server, MySQL/MariaDB Database Server and PHP modules. To run Revive properly, we'll need to install some PHP modules like apc, zlib, xml, pcre, mysql and mbstring. To setup LAMP Stack, we'll need to run the following command with respect to the distribution of linux we are currently running. - -#### On Ubuntu 15.04 #### - - # apt-get install apache2 mariadb-server php5 php5-gd php5-mysql php5-curl php-apc zlibc zlib1g zlib1g-dev libpcre3 libpcre3-dev libapache2-mod-php5 zip - -#### On CentOS 7 #### - - # yum install httpd mariadb php php-gd php-mysql php-curl php-mbstring php-xml php-apc zlibc zlib1g zlib1g-dev libpcre3 libpcre3-dev zip - -### 2. Starting Apache and MariaDB server ### - -We’ll now start our newly installed Apache web server and MariaDB database server in our linux machine. To do so, we'll need to execute the following commands. - -#### On Ubuntu 15.04 #### - -Ubuntu 15.04 is shipped with Systemd as its default init system, so we'll need to execute the following commands to start apache and mariadb daemons. - - # systemctl start apache2 mysql - -After its started, we'll now make it able to start automatically in every system boot by running the following command. - - # systemctl enable apache2 mysql - - Synchronizing state for apache2.service with sysvinit using update-rc.d... - Executing /usr/sbin/update-rc.d apache2 defaults - Executing /usr/sbin/update-rc.d apache2 enable - Synchronizing state for mysql.service with sysvinit using update-rc.d... - Executing /usr/sbin/update-rc.d mysql defaults - Executing /usr/sbin/update-rc.d mysql enable - -#### On CentOS 7 #### - -Also in CentOS 7, systemd is the default init system so, we'll run the following command to start them. - - # systemctl start httpd mariadb - -Next, we'll enable them to start automatically in every startup of init system using the following command. - - # systemctl enable httpd mariadb - - ln -s '/usr/lib/systemd/system/httpd.service' '/etc/systemd/system/multi-user.target.wants/httpd.service' - ln -s '/usr/lib/systemd/system/mariadb.service' '/etc/systemd/system/multi-user.target.wants/mariadb.service' - -### 3. Configuring MariaDB ### - -#### On CentOS 7/Ubuntu 15.04 #### - -Now, as we are starting MariaDB for the first time and no password has been assigned for MariaDB so, we’ll first need to configure a root password for it. Then, we’ll gonna create a new database so that it can store data for our Revive Adserver installation. - -To configure MariaDB and assign a root password, we’ll need to run the following command. - - # mysql_secure_installation - -This will ask us to enter the password for root but as we haven’t set any password before and its our first time we’ve installed mariadb, we’ll simply press enter and go further. Then, we’ll be asked to set root password, here we’ll hit Y and enter our password for root of MariaDB. Then, we’ll simply hit enter to set the default values for the further configurations. - - …. - so you should just press enter here. - - 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! - … - installation should now be secure. - Thanks for using MariaDB! - -![Configuring MariaDB](http://blog.linoxide.com/wp-content/uploads/2015/11/configuring-mariadb.png) - -### 4. Creating new Database ### - -After we have assigned the password to our root user of mariadb server, we'll now create a new database for Revive Adserver application so that it can store its data into the database server. To do so, first we'll need to login to our MariaDB console by running the following command. - - # mysql -u root -p - -Then, it will ask us to enter the password of root user which we had just set in the above step. Then, we'll be welcomed into the MariaDB console in which we'll create our new database, database user and assign its password and grant all privileges to create, remove and edit the tables and data stored in it. - - > CREATE DATABASE revivedb; - > CREATE USER 'reviveuser'@'localhost' IDENTIFIED BY 'Pa$$worD123'; - > GRANT ALL PRIVILEGES ON revivedb.* TO 'reviveuser'@'localhost'; - > FLUSH PRIVILEGES; - > EXIT; - -![Creating Mariadb Revive Database](http://blog.linoxide.com/wp-content/uploads/2015/11/creating-mariadb-revive-database.png) - -### 5. Downloading Revive Adserver Package ### - -Next, we'll download the latest release of Revive Adserver ie version 3.2.2 in the time of writing this article. So, we'll first get the download link from the official Download Page of Revive Adserver ie [http://www.revive-adserver.com/download/][1] then we'll download the compressed zip file using wget command under /tmp/ directory as shown bellow. - - # cd /tmp/ - # wget http://download.revive-adserver.com/revive-adserver-3.2.2.zip - - --2015-11-09 17:03:48-- http://download.revive-adserver.com/revive-adserver-3.2.2.zip - Resolving download.revive-adserver.com (download.revive-adserver.com)... 54.230.119.219, 54.239.132.177, 54.230.116.214, ... - Connecting to download.revive-adserver.com (download.revive-adserver.com)|54.230.119.219|:80... connected. - HTTP request sent, awaiting response... 200 OK - Length: 11663620 (11M) [application/zip] - Saving to: 'revive-adserver-3.2.2.zip' - revive-adserver-3.2 100%[=====================>] 11.12M 1.80MB/s in 13s - 2015-11-09 17:04:02 (906 KB/s) - 'revive-adserver-3.2.2.zip' saved [11663620/11663620] - -After the file is downloaded, we'll simply extract its files and directories using unzip command. - - # unzip revive-adserver-3.2.2.zip - -Then, we'll gonna move the entire Revive directories including every files from /tmp to the default webroot of Apache Web Server ie /var/www/html/ directory. - - # mv revive-adserver-3.2.2 /var/www/html/reviveads - -### 6. Configuring Apache Web Server ### - -We'll now configure our Apache Server so that revive will run with proper configuration. To do so, we'll create a new virtualhost by creating a new configuration file named reviveads.conf . The directory here may differ from one distribution to another, here is how we create in the following distributions of linux. - -#### On Ubuntu 15.04 #### - - # touch /etc/apache2/sites-available/reviveads.conf - # ln -s /etc/apache2/sites-available/reviveads.conf /etc/apache2/sites-enabled/reviveads.conf - # nano /etc/apache2/sites-available/reviveads.conf - -Now, we'll gonna add the following lines of configuration into this file using our favorite text editor. - - - ServerAdmin info@reviveads.linoxide.com - DocumentRoot /var/www/html/reviveads/ - ServerName reviveads.linoxide.com - ServerAlias www.reviveads.linoxide.com - - Options FollowSymLinks - AllowOverride All - - ErrorLog /var/log/apache2/reviveads.linoxide.com-error_log - CustomLog /var/log/apache2/reviveads.linoxide.com-access_log common - - -![Configuring Apache2 Ubuntu](http://blog.linoxide.com/wp-content/uploads/2015/11/configuring-apache2-ubuntu.png) - -After done, we'll gonna save the file and exit our text editor. Then, we'll restart our Apache Web server. - - # systemctl restart apache2 - -#### On CentOS 7 #### - -In CentOS, we'll directly create the file reviveads.conf under /etc/httpd/conf.d/ directory using our favorite text editor. - - # nano /etc/httpd/conf.d/reviveads.conf - -Then, we'll gonna add the following lines of configuration into the file. - - - ServerAdmin info@reviveads.linoxide.com - DocumentRoot /var/www/html/reviveads/ - ServerName reviveads.linoxide.com - ServerAlias www.reviveads.linoxide.com - - Options FollowSymLinks - AllowOverride All - - ErrorLog /var/log/httpd/reviveads.linoxide.com-error_log - CustomLog /var/log/httpd/reviveads.linoxide.com-access_log common - - -![Configuring httpd Centos](http://blog.linoxide.com/wp-content/uploads/2015/11/configuring-httpd-centos.png) - -Once done, we'll simply save the file and exit the editor. And then, we'll gonna restart our apache web server. - - # systemctl restart httpd - -### 7. Fixing Permissions and Ownership ### - -Now, we'll gonna fix some file permissions and ownership of the installation path. First, we'll gonna set the ownership of the installation directory to Apache process owner so that apache web server will have full access of the files and directories to edit, create and delete. - -#### On Ubuntu 15.04 #### - - # chown www-data: -R /var/www/html/reviveads - -#### On CentOS 7 #### - - # chown apache: -R /var/www/html/reviveads - -### 8. Allowing Firewall ### - -Now, we'll gonna configure our firewall programs to allow port 80 (http) so that our apache web server running Revive Adserver will be accessible from other machines in the network across the default http port ie 80. - -#### On Ubuntu 15.04/CentOS 7 #### - -As CentOS 7 and Ubuntu 15.04 both has systemd installed by default, it contains firewalld running as firewall program. In order to open the port 80 (http service) on firewalld, we'll need to execute the following commands. - - # firewall-cmd --permanent --add-service=http - - success - - # firewall-cmd --reload - - success - -### 9. Web Installation ### - -Finally, after everything is done as expected, we'll now be able to access the web interface of the application using a web browser. We can go further towards the web installation, by pointing the web browser to the web server we are running in our linux machine. To do so, we'll need to point our web browser to http://ip-address/ or http://domain.com assigned to our linux machine. Here, in this tutorial, we'll point our browser to http://reviveads.linoxide.com/ . - -Here, we'll see the Welcome page of the installation of Revive Adserver with the GNU General Public License V2 as Revive Adserver is released under this license. Then, we'll simply click on I agree button in order to continue the installation. - -In the next page, we'll need to enter the required database information in order to connect Revive Adserver with the MariaDB database server. Here, we'll need to enter the database name, user and password that we had set in the above step. In this tutorial, we entered database name, user and password as revivedb, reviveuser and Pa$$worD123 respectively then, we set the hostname as localhost and continue further. - -![Configuring Revive Adserver](http://blog.linoxide.com/wp-content/uploads/2015/11/configuring-revive-adserver.png) - -We'll now enter the required information like administration username, password and email address so that we can use these information to login to the dashboard of our Adserver. After done, we'll head towards the Finish page in which we'll see that we have successfully installed Revive Adserver in our server. - -Next, we'll be redirected to the Adverstiser page where we'll add new Advertisers and manage them. Then, we'll be able to navigate to our Dashboard, add new users to the adserver, add new campaign for our advertisers, banners, websites, video ads and everything that its built with. - -For enabling more configurations and access towards the administrative settings, we can switch our Dashboard user to the Administrator account. This will add new administrative menus in the dashboard like Plugins, Configuration through which we can add and manage plugins and configure many features and elements of Revive Adserver. - -### Conclusion ### - -In this article, we learned some information on what is Revive Adserver and how we can setup on linux machine running Ubuntu 15.04 and CentOS 7 distributions. Though Revive Adserver's initial source code was bought from OpenX, currently the code base for OpenX Enterprise and Revive Adserver are completely separate. To extend more features, we can install more plugins which we can also find from [http://www.adserverplugins.com/][2] . Really, this piece of software has changed the way of managing the ads for websites, apps, videos and made it very easy and efficient. 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 ! - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/install-revive-adserver-ubuntu-15-04-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.revive-adserver.com/download/ -[2]:http://www.adserverplugins.com/ From fbb48eaac4b5c36e59b127a32f8887c61fe41047 Mon Sep 17 00:00:00 2001 From: ZhangXiangping Date: Fri, 5 Feb 2016 15:54:05 +0800 Subject: [PATCH 0286/1469] Create 20151119 How to Install Revive Adserver on Ubuntu 15.04 or CentOS 7.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译完成。 --- ...ve Adserver on Ubuntu 15.04 or CentOS 7.md | 237 ++++++++++++++++++ 1 file changed, 237 insertions(+) create mode 100644 translated/tech/20151119 How to Install Revive Adserver on Ubuntu 15.04 or CentOS 7.md diff --git a/translated/tech/20151119 How to Install Revive Adserver on Ubuntu 15.04 or CentOS 7.md b/translated/tech/20151119 How to Install Revive Adserver on Ubuntu 15.04 or CentOS 7.md new file mode 100644 index 0000000000..25bea6cf72 --- /dev/null +++ b/translated/tech/20151119 How to Install Revive Adserver on Ubuntu 15.04 or CentOS 7.md @@ -0,0 +1,237 @@ +在Ubuntu 15.04 / CentOS 7上安装Revive Adserver +================================================================================ +Revive Adserver是一个免费且开源的广告管理系统,能使出版商,广告平台和广告商把广告投放在网页,应用,视频上并且管理的系统。Revive Adserver又名OpenX,遵循GNU通用公共授权协议。它集广告管理、网站定位、地理定位和跟踪系统于一体 +,用于数据收集。能使网站站长管理内部,付费以及第三方来源的广告,如谷歌的AdSense。本教程中,将会教会你在Ubuntu 15.04或CentOS 7安装并运行Revive Adserver。 +### 1. 安装LAMP### + +首先,Revive Adserver需要完整的LAMP环境才能运行,所以我们先安装LAMP。LAMP是Apache网页服务器,MySQL/MariaDB数据库和PHP模块的集合。要使Revive正常运行,需要安装PHP的众多模块,如apc,zlib,xml,pcre,mysql和mbstring。在不同的Linux发行版中,我们可以用下列命令进行LAMP的配置: + +#### 在Ubuntu 15.04下#### + + # apt-get install apache2 mariadb-server php5 php5-gd php5-mysql php5-curl php-apc zlibc zlib1g zlib1g-dev libpcre3 libpcre3-dev libapache2-mod-php5 zip + +#### 在CentOS 7下 #### + + # yum install httpd mariadb php php-gd php-mysql php-curl php-mbstring php-xml php-apc zlibc zlib1g zlib1g-dev libpcre3 libpcre3-dev zip + +### 2. 启动Apache Web和MariaDB服务 + +可以用下列命令启动刚刚安装好的Apache Web服务和MariaDB数据库服务。 + +#### 在Ubuntu 15.04下#### + +Ubuntu15.04使用Systemd作为默认初始系统,所以用下列命令启动Apache和MariaDB进程: + + # systemctl start apache2 mysql + +可以用下列命令使其开机自动运行: + + # systemctl enable apache2 mysql + + Synchronizing state for apache2.service with sysvinit using update-rc.d... + Executing /usr/sbin/update-rc.d apache2 defaults + Executing /usr/sbin/update-rc.d apache2 enable + Synchronizing state for mysql.service with sysvinit using update-rc.d... + Executing /usr/sbin/update-rc.d mysql defaults + Executing /usr/sbin/update-rc.d mysql enable + +#### 在CentOS 7下 + +CentOS 7同样是以Systemd作为默认初始系统,可以用下列命令启动: + + # systemctl start httpd mariadb + + ln -s '/usr/lib/systemd/system/httpd.service' '/etc/systemd/system/multi-user.target.wants/httpd.service' + ln -s '/usr/lib/systemd/system/mariadb.service' '/etc/systemd/system/multi-user.target.wants/mariadb.service' + +### 3. 配置MariaDB + +#### 在CentOS 7/Ubuntu 15.04下 #### + +当我们第一次启动MariaDB时,MariaDB是没有分配密码的,所以要先设置一个root密码。之后再创建一个新的数据库用来储存Revive Adserver的数据。 + +使用以下命令配置MariaDB并设置其root密码: + + # mysql_secure_installation + +这时会要我们输入root密码,但我们之前什么密码都没设置,所以按回车下一步。之后,要求设置root密码,这时我们输入Y,然后输入自己想要的密码。回车继续下一步。 + + …. + so you should just press enter here. + + 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! + … + installation should now be secure. + Thanks for using MariaDB! + +![Configuring MariaDB](http://blog.linoxide.com/wp-content/uploads/2015/11/configuring-mariadb.png) + +### 4. 创建新的数据库 ### +为MariaDB的root用户设置了密码之后,就可以创建用来储存Revive Adserver应用数据的数据库。首先通过以下命令登陆MariaDB控制台: + + # mysql -u root -p + +这时要求输入root用户的密码,我们只要输入上一步设置好的密码。然后进入MariaDB控制台创建新的数据库,数据库用户及其密码,并且授予其创建、删除、编辑和存储表与数据的全部权限。 + + > CREATE DATABASE revivedb; + > CREATE USER 'reviveuser'@'localhost' IDENTIFIED BY 'Pa$$worD123'; + > GRANT ALL PRIVILEGES ON revivedb.* TO 'reviveuser'@'localhost'; + > FLUSH PRIVILEGES; + > EXIT; + +![Creating Mariadb Revive Database](http://blog.linoxide.com/wp-content/uploads/2015/11/creating-mariadb-revive-database.png) + +### 5. 下载Revive Adserver + +接下来下载Revive Adserver的最新版本Revive Adserver.3.2.2(写本文时)。可以使用wget命令从Revive Adserverde 官方网站下载压缩包,网址是:[http://www.revive-adserver.com/download/][1] 。命令如下: + + # cd /tmp/ + # wget http://download.revive-adserver.com/revive-adserver-3.2.2.zip + + --2015-11-09 17:03:48-- http://download.revive-adserver.com/revive-adserver-3.2.2.zip + Resolving download.revive-adserver.com (download.revive-adserver.com)... 54.230.119.219, 54.239.132.177, 54.230.116.214, ... + Connecting to download.revive-adserver.com (download.revive-adserver.com)|54.230.119.219|:80... connected. + HTTP request sent, awaiting response... 200 OK + Length: 11663620 (11M) [application/zip] + Saving to: 'revive-adserver-3.2.2.zip' + revive-adserver-3.2 100%[=====================>] 11.12M 1.80MB/s in 13s + 2015-11-09 17:04:02 (906 KB/s) - 'revive-adserver-3.2.2.zip' saved [11663620/11663620] + +解压到临时目录下: + + # unzip revive-adserver-3.2.2.zip + +把解压后的整个文件夹移动到Apache Web服务器的默认根目录/var/www/html/下: + + # mv revive-adserver-3.2.2 /var/www/html/reviveads + +### 6. 配置Apache Web服务 + +现在配置Apache服务使Revive正常运行。通过创建配置文件reviveads.conf来创建一个新的虚拟主机。这个目录在不同的Linux发行版上有所不同。 + +#### 在Ubuntu 15.04下 + + # touch /etc/apache2/sites-available/reviveads.conf + # ln -s /etc/apache2/sites-available/reviveads.conf /etc/apache2/sites-enabled/reviveads.conf + # nano /etc/apache2/sites-available/reviveads.conf + +在这个文件中添加下列几行文本: + + + ServerAdmin info@reviveads.linoxide.com + DocumentRoot /var/www/html/reviveads/ + ServerName reviveads.linoxide.com + ServerAlias www.reviveads.linoxide.com + + Options FollowSymLinks + AllowOverride All + + ErrorLog /var/log/apache2/reviveads.linoxide.com-error_log + CustomLog /var/log/apache2/reviveads.linoxide.com-access_log common + + +![Configuring Apache2 Ubuntu](http://blog.linoxide.com/wp-content/uploads/2015/11/configuring-apache2-ubuntu.png) +保存并退出,重启Apache Web服务: + + # systemctl restart apache2 + +#### 在CentOS 7下 #### + +在CentOS下,我们直接在/etc/httpd/conf.d/ 目录下创建reviveads.conf : + + # nano /etc/httpd/conf.d/reviveads.conf + +在这个文件中添加下列几行文本: + + + ServerAdmin info@reviveads.linoxide.com + DocumentRoot /var/www/html/reviveads/ + ServerName reviveads.linoxide.com + ServerAlias www.reviveads.linoxide.com + + Options FollowSymLinks + AllowOverride All + + ErrorLog /var/log/httpd/reviveads.linoxide.com-error_log + CustomLog /var/log/httpd/reviveads.linoxide.com-access_log common + + +![Configuring httpd Centos](http://blog.linoxide.com/wp-content/uploads/2015/11/configuring-httpd-centos.png) + +保存并退出,重启Apache Web服务: + + # systemctl restart httpd + +### 7. 修复权限和所有权 + +现在我们修改安装路径下文件的权限和所有权。把安装目录的所有权改成Apache进程所有以便Apache Web服务有文件和目录的编辑,创建和删除的完全权限。 + +#### 在Ubuntu 15.04下#### + + # chown www-data: -R /var/www/html/reviveads + +#### 在CentOS 7下 + + # chown apache: -R /var/www/html/reviveads + +### 8. 设置防火墙 + + 现在要配置防火墙,打开80端口使Apache Web服务运行的Revive Adserver能够被网络上的其他机器所访问。 + +#### 在Ubuntu 15.04/CentOS 7下 + +Ubuntu15.04/CentOS 7都使用Systemd作为默认初始系统,使用firewalld作为其防火墙。要打开80端口(http服务端口),执行以下命令: + + # firewall-cmd --permanent --add-service=http + + success + + # firewall-cmd --reload + + success + +### 9. 网站的安装 + +顺利的话我们能够使用浏览器进行交互,并可以将浏览器指向正在运行的网络服务器。只要在浏览器输入http://ip-address/ 或者 http://domain.com 。这里我们要访问 http://reviveads.linoxide.com/ + +打开后可以看到Revive Adserver的欢迎页面,上面还有作为它发行许可证的GNU通用公共许可证V2。点击 I agree 继续下一步安装。 + +在下一页中,我们要输入数据库信息以便把Revive Adserver和MariaDB数据库服务连接起来。要输入之前设置的数据库名称,用户名以及密码。在本教程中,我们分别输入数据库名称为revivedb,用户名为reviveuser,密码为Pa$$worD123,并且令主机名为localhost,点击continue继续。 + +![Configuring Revive Adserver](http://blog.linoxide.com/wp-content/uploads/2015/11/configuring-revive-adserver.png) + +输入要填的信息,如:管理员用户名,密码和邮箱。可以以这些信息登录Adserver的控制界面。然后跳到最后一页,可以看到Revive Adserver已经安装成功了。 + +接着,转到Adverstiser页面,添加新的广告管理。在控制界面添加新用户到adserver,为广告库户添加标题,网页,视频 +广告。 + + +### 总结 ### +本文中,我们学习了如何在Ubuntu 15.04和CentOS 7上安装并配置Revive Adserver。尽管Revive Adserver的原始代码是从OpenX那买的,但现在它们已经完全分开了。可以从[http://www.adserverplugins.com/][2] 获得更多插件来扩展新特性。讲真,这个软件确实让网页,应用,视频上的广告管理变得容易了许多。 + + + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/install-revive-adserver-ubuntu-15-04-centos-7/ + +作者:[Arun Pyasi][a] +译者:[chisper](https://github.com/chisper) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ +[1]:http://www.revive-adserver.com/download/ +[2]:http://www.adserverplugins.com/ From fb355018990cd275d8a0e370ebe591da75f8f336 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 5 Feb 2016 21:52:18 +0800 Subject: [PATCH 0287/1469] PUB:20151206 Supporting secure DNS in glibc @zpl1025 --- ...20151206 Supporting secure DNS in glibc.md | 51 +++++++++++++++++++ ...20151206 Supporting secure DNS in glibc.md | 46 ----------------- 2 files changed, 51 insertions(+), 46 deletions(-) create mode 100644 published/20151206 Supporting secure DNS in glibc.md delete mode 100644 translated/tech/20151206 Supporting secure DNS in glibc.md diff --git a/published/20151206 Supporting secure DNS in glibc.md b/published/20151206 Supporting secure DNS in glibc.md new file mode 100644 index 0000000000..25e1004b09 --- /dev/null +++ b/published/20151206 Supporting secure DNS in glibc.md @@ -0,0 +1,51 @@ +通过修改 glibc 支持 DNS 加密 +======================== + +域名解析系统(DNS)是互联网安全的许多薄弱环节之一;可以将应用程序所访问的主机对应的 IP 地址误导到其它地方。也就是说,会连接到错误的位置,从而引发中间人(man-in-the-middle )攻击等等。而 [DNSSEC][1] 扩展协议则通过为 DNS 信息建立一条加密的可信通道来解决这个漏洞。在正确地配置好 DNSSEC 后,应用程序将可以得到可靠的主机查询信息。通过关于[尝试将 DNSSEC 更好地集成到 GNU C 库里][2]的讨论,我们知道,确保 DNS 查询信息安全这件事并不是那么简单。 + +从某种意义上来说,这个问题多年以前就解决了,我们可以配置一个本地域名服务实现完整的 DNSSEC 校验(verification)并允许应用程序通过 glibc 函数来使用该服务。DNSSEC 甚至还可以用于提高其他领域的安全性,比如,它可以携带 SSH 或 TLS 密钥指纹,让应用程序可以确认其在与正确的服务器对话。不过,当我们希望确认这条自称带有 DNSSEC 校验的 DNS 结果是不是真的已通过认证的时候 - 也就是说,当我们想依赖 DNSSEC 所承诺的安全的时候,事情变得有点复杂。 + +### /etc/resolv.conf 问题 + +从 glibc 的角度来看,这个问题一部分是因为 glibc 本身并没有做 DNSSEC 校验,而是引用 /etc/resolv.conf 文件,从该文件里读出的服务器来做解析以及校验,再将结果返回给应用程序。如果应用程序使用底层 res_query() 接口,那结果中将会包含“已认证数据(authenticated data)”(AD)标识(如果域名服务器设定了的话)以表示 DNSSEC 校验已经成功。但是 glibc 却完全不知道提供这些结果的域名服务器的信用,所以它其实并不能告诉应用程序结果是否真的可靠。 + +由 glibc 的维护者 Carlos O'Donell 提出的建议是在 resolv.conf 文件里增加一个选项(dns-strip-dnssec-ad-bit)告诉 glibc 无条件移除 AD 标识。这个选项可以由各发行版设定,表示 DNSSEC 级别的 DNS 查询结果并不可靠。而一旦建立好合适的环境可以获得可靠的查询结果后,再移除这个选项。这样一来,虽然问题还没有完全解决,至少应用程序有依据来评价从 glibc 获取的 DNS 查询结果的可靠性。 + +一个可靠的环境配置应该是什么样?标准情况应该和这个差不太多:有一个本地域名服务器,通过环路(loopback)接口访问,作为访问 /etc/resolv.conf 文件的唯一条目。这个域名服务器应该配置来做校验,而在校验失败后就只是简单地不返回任何结果。绝大多数情况下,应用程序就不再需要关心 AD 标识,如果结果不可靠,应用程序就根本看不到。一些发行版已经倾向于这种模型,不过情况仍然不像一些人所设想的那么简单。 + +其中一个问题是,这种方式将 /etc/resolv.conf 文件放到整个系统可信任度的中心。但是,在一个典型的 Linux 系统里,有无数的 DHCP 客户端、网络脚本以及其他更多的程序可以修改这个文件。就像 Paul Wouters 所[指出][3]的,在短时间内锁定这个文件是不可能的。有时候这种修改是必须的:在一个无盘系统启动的时候,在自身的域名服务器启动之前也是需要域名服务的;一个系统的整个 DNS 环境也会根据所连接的网络不同而有所改变;运行在容器里的系统也最好是配置成使用宿主机的域名服务器;等等。 + +所以,现在一般认为,现有系统里的 /etc/resolv.conf 文件并不可信。于是有人提出增加另一个配置文件(/etc/secure-resolv.conf 或其他什么),但这并没有从根本上解决问题。除此之外,有些参与者觉得就算有一个运行在环路接口上的域名服务器也不是真正可靠,比如 Zack Weinberg 甚至[建议][4]系统管理员可以有意禁用 DNSSEC 确认(validation)。 + +既然当前系统里的配置不足以信任,那可以这样推断,在情况有改善能够取得可信的结果后,glibc 需要有一种方式来通知应用程序。可以是上面讨论的屏蔽 AD 标识的方式(或者与之相反,增加一个显示的“此域名服务器可以信任”选项);当然,这都需要一定程度上锁定系统以免 /etc/resolv.conf 受到任何不可预计的修改。按 Petr Spacek 的[建议][5],还有一种引申方式,就是提供一种途径允许应用程序查询 glibc 当前通讯的是不是本地域名服务器。 + +### 在 glibc 里来处理? + +另一种方式是不管域名服务器,而是让 glibc 本身来做 DNSSEC 确认。不过,把这么大一坨加密相关代码放进 glibc 也是有很大阻力。这样将增加库本身的大小,从而感觉会增加使用它的应用程序的受攻击可能性。这个方向再引申一下,由 Zack 提出的[建议][6],可以把确认相关代码放到域名服务缓冲守护进程(nscd)里。因为 nscd 也是 glibc 的一部分,由 glibc 开发人员维护,因此在一定程度上可以相信能正确执行 DNSSEC 确认。而且 nscd 的通讯 socket 所在位置也是公开的,所以可以不考虑 /etc/resolv.conf 问题。不过,Carlos [担心][7]这种方式不能让那些不想使用 nscd 缓存功能的用户所接受;在他看来,基本可以排除 nscd 的方式。 + +所以,至少近期内,glibc 不太可能全部执行 DNSSEC 确认了的整个查询过程。这意味着,如果一个有安全考虑的应用要使用 glibc 库来查询域名,该库将需要提供一个标识来评价从独立域名服务器返回的结果有多大程度的可靠性。这几乎肯定需要发行版或系统管理员做出一些明确的改动。就像 Simo Sorce [说的][8]那样: + +> 如果 glibc 不使用明确的配置选项来通知应用程序它所用的域名解析是可信的,不会有什么用……不改一下还有很大弊端,因为应用程序开发者将马上认识到他们不能信任从 glibc 获取的任何信息,从而在处理 DNSSEC 相关信息时就简单地不用它。 + +要配置一个系统能正常使用 DNSSEC 需要改动该系统的很多组件 - 这是一个发行版范围的问题,需要时间来完全解决。在这个转变过程中 glibc 所扮演的角色很可能会比较小,但是很重要的一部分:如果应用程序不实现一套自己的域名解析代码,glibc 很可能是保证 DNS 结果可信的唯一方式。在一个系统中运行多个 DNSSEC 实现方式看起来不像是一种安全的方式,所以最好还是把事情做对了。 + +glibc 项目目前并没有确定用哪种方式来做这个事情,虽然从 /etc/resolv.conf 文件里的某些标记看上去快好了。这种改动应该需要发布新版本;考虑到 glibc 开发的保守天性,很可能来不及加入预计二月份发布的 2.23 版本了。所以 glibc 中暂时还不会有更高安全性的 DNSSEC ,不过在这个方向上也有一些进展了。 + +--------------------------- + +via: https://lwn.net/Articles/664776/ + +作者:Jonathan Corbet +译者:[zpl1025](https://github.com/zpl1025) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]: https://en.wikipedia.org/wiki/Domain_Name_System_Security_Extensions +[2]: http://lwn.net/Articles/664790/ +[3]: http://lwn.net/Articles/664794/ +[4]: http://lwn.net/Articles/664782/ +[5]: http://lwn.net/Articles/664784/ +[6]: http://lwn.net/Articles/664796/ +[7]: http://lwn.net/Articles/664786/ +[8]: http://lwn.net/Articles/664787/ \ No newline at end of file diff --git a/translated/tech/20151206 Supporting secure DNS in glibc.md b/translated/tech/20151206 Supporting secure DNS in glibc.md deleted file mode 100644 index c66a28257c..0000000000 --- a/translated/tech/20151206 Supporting secure DNS in glibc.md +++ /dev/null @@ -1,46 +0,0 @@ -通过修改 glibc 支持 DNS 加密 -======================== - -感谢:Jonathan Corbet - -域名解析系统(DNS)是因特网安全许多薄弱环节之一;可以误导应用程序所访问的主机相应的 IP 地址。也就是说,会连接到错误的位置,可以引发中间人攻击以及更多攻击。而 DNSSEC 扩展协议是通过为 DNS 信息建立一条加密的可信通道来解决这个漏洞。在正确地配置好 DNSSEC 后,应用程序将可以得到可靠的主机查询信息。通过关于尝试将 DNSSEC 更好地集成到 GNU C 库里的讨论,确保 DNS 查询信息安全并不是那么简单。 - -某种意义上来说,这个问题多年以前就解决了,我们可以配置一个本地域名服务实现完整的 DNSSEC 认证并允许应用程序通过 glibc 函数来使用该服务。DNSSEC 甚至还可以用于提高其他领域的安全性,比如,它可以携带 SSH 或 TLS 密钥指纹,让应用程序可以确认其在与正确的服务器通话。不过,当我们希望确认这条自称带有 DNSSEC 认证的 DNS 结果是不是真的已通过认证的时候 - 也就是说,当我们想依赖 DNSSEC 所承诺的安全的时候,事情变得有点复杂。 - -/etc/resolv.conf 问题 - -从 glibc 的角度来看,这个问题一部分是因为 glibc 本身并没有做 DNSSEC 认证。而是引用 /etc/resolv.conf 文件,从该文件里读出的服务器来做解析以及认证,再将结果返回给应用程序。如果应用程序使用底层 res_query() 接口,那结果中将会包含“已认证数据”(AD)标识(如果域名服务器设定了的话)以表示 DNSSEC 认证已经成功。但是 glibc 却完全不知道提供这些结果的域名服务器的信用,所以它其实并不能告诉应用程序结果是否真的可靠。 - -由 glibc 的维护者 Carlos O'Donell 提出的建议是在 resolv.conf 文件里增加一个选项(dns-strip-dnssec-ad-bit)告诉 glibc 无条件移除 AD 标识。这个选项可以由各发行版设定,表示 DNSSEC 级别的 DNS 查询结果并不可靠。而一旦建立好合适的环境可以获得可靠的查询结果后,再移除这个选项。这样一来,虽然问题还没有完全解决,至少应用程序有依据来评价从 glibc 获取的 DNS 查询结果的可靠性。 - -一个可靠的环境配置应该是什么样?标准情况应该和这个差不太多:有一个本地域名服务器,通过环路接口访问,作为访问 /etc/resolv.conf 文件的唯一入口。这个域名服务器应该配置来做认证,而在认证失败后就只是简单地不返回任何结果。绝大多数情况下,应用程序就不再需要关心 AD 标识,如果结果不可靠,应用程序就根本看不到。一些发行版已经偏向这种模型,不过情况仍然不像一些人所设想的没那么简单。 - -其中一个问题是,这种方式将 /etc/resolv.conf 文件放到整个系统可信任度的中心。但是,在一个典型的 Linux 系统里,有无数的 DHCP 客户端、网络脚本以及其他更多,可以修改这个文件。就像 Paul Wouters 所指出的,在短时间内锁定这个文件是不可能的。有时候这种改变是必须的:在一个无盘系统启动的时候,在自身的域名服务器启动之前也是需要域名服务的;一个系统的整个 DNS 环境也会根据所连接的网络不同而有所改变;运行在容器里的系统也最好是配制成使用宿主机的域名服务器;等等。 - -所以,现在一般认为,现有系统里的 /etc/resolv.conf 文件并不可信。于是有人提出增加另一个配置文件(/etc/secure-resolv.conf 或其他什么),但这并没有从根本上解决问题。除此之外,有些参与人员觉得就算有一个运行在环路接口上的域名服务器也不是真正可靠,比如 Zack Weinberg 甚至建议系统管理员可以有意禁用 DNSSEC 认证。 - -既然当前系统里的配置不足以信任,那可以这样推断,在情况有改善能够取得可信的结果后,glibc 需要有一种方式来通知应用程序。可以是上面讨论的屏蔽 AD 标识的方式(或者与之相反,增加一个显示的“此域名服务器可以信任”选项);当然,这都需要一定程度上锁定系统以免 /etc/resolv.conf 受到任何不可预计的修改。按 Petr Spacek 的建议,还有一种引申方式,就是提供一种途径允许应用程序查询 glibc 当前通讯的是不是本地域名服务器。 - -在 glibc 里来处理? - -另一种方式是去掉域名服务器,而是让 glibc 本身来做 DNSSEC 认证。不过,把这么大一坨加密相关代码放进 glibc 也是有很大阻力。这样将增加库本身的大小,从而感觉会增加使用它的应用程序的受攻击面积。这个方向再引申一下,由 Zack 提出的建议,可以把认证相关代码放到域名服务缓冲守护进程(nscd)里。因为 nscd 也是 glibc 的一部分,由 glibc 开发人员维护,因此在一定程度上可以相信能正确执行 DNSSEC 认证。而且 nscd 的通讯 socket 所在位置也是公开的,所以可以不考虑 /etc/resolv.conf 问题。不过,Carlos 担心这种方式不能让那些不想使用 nscd 缓存功能的用户所接受;在他看来,基本可以排除 nscd 的方式。 - -所以,至少近期内,glibc 不太可能全部执行带 DNSSEC 认证的整个查询过程。这意味着,如果一个有安全考虑的应用要使用 glibc 库来查询域名,库将需要提供一个标识来评价从独立域名服务器返回的结果有多大程度的可靠性。这几乎肯定需要发行商或系统管理员做出一些明确的改动。就像 Simo Sorce 说的那样: - -如果 glibc 不使用明确的配置选项来通知应用程序它所用的域名解析是可信的,不会有什么用。。。不改一下还有很大弊端,因为应用程序开发者将马上认识到他们不能信任从 glibc 获取的任何信息,从而在处理 DNSSEC 相关信息时就简单地不用它。 - -要配置一个系统能正常使用 DNSSEC 需要改动该系统的很多组件 - 这是一个发行版范围的问题,需要时间来完全解决。在这个转变过程中 glibc 所扮演的角色很可能会比较小,但是很重要的一部分:如果应用程序不实现一套自己的域名解析代码,glibc 很可能是保证 DNS 结果可信的唯一方式。在一个系统中运行多个 DNSSEC 实现方式看起来不像是一种安全的方式,所以最好还是把事情做对了。 - -glibc 项目目前并没有确定用哪种方式来做这个事情,虽然从 /etc/resolv.conf 文件里的某些标记看上去快好了。这种改动应该需要发布新版本;考虑到 glibc 开发的保守天性,很可能来不及加入预计二月份发布的 2.23 版本了。所以 glibc 中暂时还不会有更高安全性的 DNSSEC ,不过在这个方向上也有一些进展了。 - ---------------------------- - -via: https://lwn.net/Articles/663474/ - -作者:Jonathan Corbet - -译者:[zpl1025](https://github.com/zpl1025) - -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 6714641232da02832b9cdf0b288fb27bb7a4cbd0 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 5 Feb 2016 23:10:29 +0800 Subject: [PATCH 0288/1469] PUB:20150824 Great Open Source Collaborative Editing Tools @H-mudcup --- ...Open Source Collaborative Editing Tools.md | 49 ++++++++++--------- 1 file changed, 25 insertions(+), 24 deletions(-) rename {translated/share => published}/20150824 Great Open Source Collaborative Editing Tools.md (77%) diff --git a/translated/share/20150824 Great Open Source Collaborative Editing Tools.md b/published/20150824 Great Open Source Collaborative Editing Tools.md similarity index 77% rename from translated/share/20150824 Great Open Source Collaborative Editing Tools.md rename to published/20150824 Great Open Source Collaborative Editing Tools.md index bc0a841477..aab783c627 100644 --- a/translated/share/20150824 Great Open Source Collaborative Editing Tools.md +++ b/published/20150824 Great Open Source Collaborative Editing Tools.md @@ -1,12 +1,13 @@ -优秀的开源合作编辑工具 +六款优秀的开源协作编辑工具 ================================================================================ -一句话,合作编著就是多个人进行编著。合作有好处也有风险。好处包括更加全面/协调的方式,更好的利用现有资源和一个更加有力的、团结的声音。对于我来说,最大的好处是极大的透明度。那是当我需要采纳同事的观点。同事之间来来回回地传文件效率非常低,导致不必要的延误还让人(比如,我)对整个合作这件事都感到不满意。有个好的合作软件,我就能实时地或异步地分享笔记,数据和文件,并用评论来分享自己的想法。这样在文档、图片、视频、演示文稿上合作就不会那么的琐碎而无聊。 -有很多种方式能在线进行合作,简直不能更简便了。这篇文章表明了我最喜欢的开源实时文档合作编辑工具。 +简而言之,协作编辑(Collaborative Edit)就是多个人进行编辑。协作有好处也有风险。好处之一是更加全面/协调的方式,更好的利用现有资源和一个更加有力一致的声音。对于我来说,最大的好处是极大的透明度。那是当我需要采纳同事的观点。同事之间来来回回地传文件效率非常低,导致不必要的延误还让人(比如,我)对整个协作这件事都感到不满意。有个好的协作软件,我就能实时地或异步地分享笔记,数据和文件,并用评论来分享自己的想法。这样在文档、图片、视频、演示文稿上协作就不会那么的琐碎而无聊。 -Google Docs 是个非常好的高效应用,有着大部分我所需要的功能。它可以作为一个实时地合作编辑文档的工具提供服务。文档可以被分享、打开并被多位用户同时编辑,用户还能看见其他合作者一个字母一个字母的编辑过程。虽然 Google Docs 对个人是免费的,但并不开源。 +有很多种方式能在线进行协作,简直不能更简便了。这篇文章展示了我最喜欢的开源的实时文档协作编辑工具。 -下面是我带来的最棒的开源合作编辑器,它们能帮你不被打扰的集中精力进行写作,而且是和其他人协同完成。 +Google Docs 是个非常好的高效应用,有着大部分我所需要的功能。它可以作为一个实时地协作编辑文档的工具提供服务。文档可以被分享、打开并被多位用户同时编辑,用户还能看见其他协作者一个字母一个字母的编辑过程。虽然 Google Docs 对个人是免费的,但并不开源。 + +下面是我带来的最棒的开源协作编辑器,它们能帮你不被打扰的集中精力进行写作,而且是和其他人协同完成。 ---------- @@ -14,17 +15,17 @@ Google Docs 是个非常好的高效应用,有着大部分我所需要的功 ![Hackpad in action](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-Hackpad.png) -Hackpad 是个开源的基于网页的实时 wiki,基于开源 EtherPad 合作文档编辑器。 +Hackpad 是个开源的基于网页的实时 wiki,基于开源 EtherPad 协作文档编辑器。 Hackpad 允许用户实时分享你的文档,它还用彩色编码显示各个作者分别贡献了哪部分。它还允许插入图片、清单,由于提供了语法高亮功能,它还能用来写代码。 -当2014年4月 Dropbox 获得了 Hackpad 后,这款软件就以开源的形式在本月发行。让我们经历的等待非常值得。 +当2014年4月 Dropbox 收购了 Hackpad 后,就在这个月这款软件以开源的形式发布。让我们经历的等待非常值得。 特性: - 有类似 wiki 所提供的,一套非常完善的功能 -- 实时或者异步地记合作笔记,共享数据和文件,或用评论分享你们的想法 -- 细致的隐私许可让你可以邀请单个朋友,一个十几人的团队或者上千的 Twitter 粉丝 +- 实时或者异步地记录协作笔记,共享数据和文件,或用评论分享你们的想法 +- 细致的隐私许可让你可以邀请单个朋友、一个十几人的团队或者上千的 Twitter 粉丝 - 智能执行 - 直接从流行的视频分享网站上插入视频 - 表格 @@ -42,9 +43,9 @@ Hackpad 允许用户实时分享你的文档,它还用彩色编码显示各个 ![Etherpad in action](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-Etherpad.png) -Etherpad 是个基于网页的开源实时合作编辑器,允许多个作者同时编辑一个文本文档,写评论,并与其他作者用群聊方式进行交流。 +Etherpad 是个基于网页的开源实时协作编辑器,允许多个作者同时编辑一个文本文档,写评论,并与其他作者用群聊方式进行交流。 -Etherpad 是用 JavaScript 运行的,在 AppJet 平台的顶端,通过 Comet 流实现实时的功能。 +Etherpad 是用 JavaScript 编写的,运行在 AppJet 平台之上,通过 Comet 流实现实时的功能。 特性: @@ -55,9 +56,9 @@ Etherpad 是用 JavaScript 运行的,在 AppJet 平台的顶端,通过 Comet - 每隔一段很短的时间就会自动保存 - 可个性化程度高 - 有客户端插件可以扩展编辑的功能 -- 几百个支持 Etherpad 的扩展包括支持 email 提醒,pad 管理,授权 +- 几百个支持 Etherpad 的扩展,包括支持 email 提醒,pad 管理,授权 - 可访问性开启 -- 可从 Node 里或通过 CLI(命令行界面)和 Pad 目录实时交互 +- 可从 Node 里或通过 CLI(命令行界面)和 EtherPad 的内容交互 - 网站: [etherpad.org][4] - 源代码:[github.com/ether/etherpad-lite][5] @@ -71,7 +72,7 @@ Etherpad 是用 JavaScript 运行的,在 AppJet 平台的顶端,通过 Comet ![Firepad in action](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-Firepad.png) -Firepad 是个开源的合作文本编辑器。它的设计目的是被嵌入到更大的网页应用中对几天内新加入的代码进行批注。 +Firepad 是个开源的协作文本编辑器。它的设计目的是被嵌入到更大的网页应用中对几天内新加入的代码进行批注。 Firepad 是个全功能的文本编辑器,有解决冲突,光标同步,用户属性,用户在线状态检测功能。它使用 Firebase 作为后台,而且不需要任何服务器端的代码。他可以被加入到任何网页应用中。Firepad 可以使用 CodeMirror 编辑器或者 Ace 编辑器提交文本,它的操作转换代码是从 ot.js 上借鉴的。 @@ -81,7 +82,7 @@ Firepad 已被多个编辑器使用,包括Atlassian Stash Realtime Editor、Ni 特性: -- 纯正的合作编辑 +- 纯正的协作编辑 - 基于 OT 的智能合并及解决冲突 - 支持多种格式的文本和代码的编辑 - 光标位置同步 @@ -106,13 +107,13 @@ Firepad 已被多个编辑器使用,包括Atlassian Stash Realtime Editor、Ni ![ownCloud Documents in action](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-ownCloud.png) -ownCloud Documents 是个可以单独并/或合作进行办公室文档编辑 ownCloud 应用。它允许最多5个人同时在网页浏览器上合作进行编辑 .odt 和 .doc 文件。 +ownCloud Documents 是个可以单独并/或协作进行办公室文档编辑 ownCloud 应用。它允许最多5个人同时在网页浏览器上协作进行编辑 .odt 和 .doc 文件。 ownCloud 是个自托管文件同步和分享服务器。他通过网页界面,同步客户端或 WebDAV 提供你数据的使用权,同时提供一个容易在设备间进行浏览、同步和分享的平台。 特性: -- 合作编辑,多个用户同时进行文件编辑 +- 协作编辑,多个用户同时进行文件编辑 - 在 ownCloud 里创建文档 - 上传文档 - 在浏览器里分享和编辑文件,然后在 ownCloud 内部或通过公共链接进行分享这些文件 @@ -131,16 +132,16 @@ ownCloud 是个自托管文件同步和分享服务器。他通过网页界面 ![Gobby in action](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-Gobby.png) -Gobby 是个支持在一个会话内进行多个用户聊天并打开多个文档的合作编辑器。所有的用户都能同时在文件上进行工作,无需锁定。不同用户编写的部分用不同颜色高亮显示,它还支持多个编程和标记语言的语法高亮。 +Gobby 是个支持在一个会话内进行多个用户聊天并打开多个文档的协作编辑器。所有的用户都能同时在文件上进行工作,无需锁定。不同用户编写的部分用不同颜色高亮显示,它还支持多个编程和标记语言的语法高亮。 -Gobby 允许多个用户在互联网上实时共同编辑同一个文档。他很好的整合了 GNOME 环境。它拥有一个客户端-服务端结构,这让它能支持一个会话开多个文档,文档同步请求,密码保护和 IRC 式的聊天方式可以在多个频道进行交流。用户可以选择一个颜色对他们在文档中编写的文本进行高亮。 +Gobby 允许多个用户在互联网上实时共同编辑同一个文档。它很好的整合了 GNOME 环境。它拥有一个客户端-服务端结构,这让它能支持一个会话开多个文档,文档同步请求,密码保护和 IRC 式的聊天方式可以在多个频道进行交流。用户可以选择一个颜色对他们在文档中编写的文本进行高亮。 还供有一个叫做 infinoted 的专用服务器。 特性: - 成熟的文本编辑能力包括使用 GtkSourceView 的语法高亮功能 -- 实时、无需锁定、通过加密(包括PFS)连接的合作文本编辑 +- 实时、无需锁定、通过加密(包括PFS)连接的协作文本编辑 - 整合了群聊 - 本地组撤销:撤销不会影响远程用户的修改 - 显示远程用户的光标和选择区域 @@ -170,9 +171,9 @@ Gobby 允许多个用户在互联网上实时共同编辑同一个文档。他 ONLYOFFICE(从前叫 Teamlab Office)是个多功能云端在线办公套件,整合了 CRM(客户关系管理)系统、文档和项目管理工具箱、甘特图以及邮件整合器 -它能让你整理商业任务和时间表,保存并分享你的合作或个人文档,使用网络社交工具如博客和论坛,还可以和你的队员通过团队的即时聊天工具进行交流。 +它能让你整理商业任务和时间表,保存并分享你的协作或个人文档,使用网络社交工具如博客和论坛,还可以和你的队员通过团队的即时聊天工具进行交流。 -能在同一个地方管理文档、项目、团队和顾客关系。OnlyOffice 结合了文本,电子表格和电子幻灯片编辑器,他们的功能跟微软桌面应用(Word、Excel 和 PowerPoint)的功能相同。但是他允许实时进行合作编辑、评论和聊天。 +能在同一个地方管理文档、项目、团队和顾客关系。OnlyOffice 结合了文本,电子表格和电子幻灯片编辑器,他们的功能跟微软桌面应用(Word、Excel 和 PowerPoint)的功能相同。但是他允许实时进行协作编辑、评论和聊天。 OnlyOffice 是用 ASP.NET 编写的,基于 HTML5 Canvas 元素,并且被翻译成21种语言。 @@ -182,7 +183,7 @@ OnlyOffice 是用 ASP.NET 编写的,基于 HTML5 Canvas 元素,并且被翻 - 文档可以在浏览/编辑模式下分享 - 文档嵌入 - 电子表格和电子幻灯片编辑器 -- 合作编辑 +- 协作编辑 - 评论 - 群聊 - 移动应用 @@ -209,7 +210,7 @@ via: http://www.linuxlinks.com/article/20150823085112605/CollaborativeEditing.ht 作者:Frazer Kline 译者:[H-mudcup](https://github.com/H-mudcup) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 7c4742db05a9909d2010cbb31a2a2bb4450eb627 Mon Sep 17 00:00:00 2001 From: DongShuaike Date: Sat, 6 Feb 2016 09:08:09 +0800 Subject: [PATCH 0289/1469] DongShuaike is translating --- sources/news/20160129 Recognizing correct code.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/news/20160129 Recognizing correct code.md b/sources/news/20160129 Recognizing correct code.md index ad5028d622..60b94b895d 100644 --- a/sources/news/20160129 Recognizing correct code.md +++ b/sources/news/20160129 Recognizing correct code.md @@ -2,6 +2,8 @@ Automatic bug-repair system fixes 10 times as many errors as its predecessors. ------ +DongShuaike is translating. + MIT researchers have developed a machine-learning system that can comb through repairs to open-source computer programs and learn their general properties, in order to produce new repairs for a different set of programs. The researchers tested their system on a set of programming errors, culled from real open-source applications, that had been compiled to evaluate automatic bug-repair systems. Where those earlier systems were able to repair one or two of the bugs, the MIT system repaired between 15 and 18, depending on whether it settled on the first solution it found or was allowed to run longer. From 35511700a51b0b1b9382e321efafc007952fb4a5 Mon Sep 17 00:00:00 2001 From: ZhangXiangping Date: Sat, 6 Feb 2016 14:29:59 +0800 Subject: [PATCH 0290/1469] Update 20151104 How to Install Pure-FTPd with TLS on FreeBSD 10.2.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit chisper翻译中 --- ...151104 How to Install Pure-FTPd with TLS on FreeBSD 10.2.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20151104 How to Install Pure-FTPd with TLS on FreeBSD 10.2.md b/sources/tech/20151104 How to Install Pure-FTPd with TLS on FreeBSD 10.2.md index 3d898340d8..10a40233e8 100644 --- a/sources/tech/20151104 How to Install Pure-FTPd with TLS on FreeBSD 10.2.md +++ b/sources/tech/20151104 How to Install Pure-FTPd with TLS on FreeBSD 10.2.md @@ -1,3 +1,4 @@ +chisper 翻译中 How to Install Pure-FTPd with TLS on FreeBSD 10.2 ================================================================================ FTP or File Transfer Protocol is application layer standard network protocol used to transfer file from the client to the server, after user logged in to the FTP server over the TCP-Network, such as internet. FTP has been round long time ago, much longer then P2P Program, or World Wide Web, and until this day it was a primary method for sharing file with other over the internet and it it remain very popular even today. FTP provide an secure transmission, that protect username, password and encrypt the content with SSL/TLS. @@ -151,4 +152,4 @@ via: http://linoxide.com/linux-how-to/install-pure-ftpd-tls-freebsd-10-2/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://linoxide.com/author/arulm/ \ No newline at end of file +[a]:http://linoxide.com/author/arulm/ From 3f2e68fa22c9684f7103d0cb2e786997d20100cc Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 6 Feb 2016 20:19:23 +0800 Subject: [PATCH 0291/1469] PUB:20150906 How to install Suricata intrusion detection system on Linux @mr-ping --- ...ata intrusion detection system on Linux.md | 59 +++++++++---------- 1 file changed, 27 insertions(+), 32 deletions(-) rename {translated/tech => published}/20150906 How to install Suricata intrusion detection system on Linux.md (54%) diff --git a/translated/tech/20150906 How to install Suricata intrusion detection system on Linux.md b/published/20150906 How to install Suricata intrusion detection system on Linux.md similarity index 54% rename from translated/tech/20150906 How to install Suricata intrusion detection system on Linux.md rename to published/20150906 How to install Suricata intrusion detection system on Linux.md index 0eab03088c..89eccf5650 100644 --- a/translated/tech/20150906 How to install Suricata intrusion detection system on Linux.md +++ b/published/20150906 How to install Suricata intrusion detection system on Linux.md @@ -1,25 +1,24 @@ -如何在Linux系统上安装Suricata入侵检测系统 +如何在 Linux 系统上安装 Suricata 入侵检测系统 ================================================================================ -随着安全威胁的不断发生,入侵检测系统(IDS)在如今的数据中心环境中显得尤为必要。然而,随着越来越多的服务器将他们的网卡升级到10GB/40GB网络,对如此线路上的硬件进行计算密集型的入侵检测越来越困难。其中一种扩展入侵检测系统性能的途径是**多线程入侵检测系统**,它将CPU密集型的深度包检测工作并行的分配给多个并发任务来完成。这样的并行检测可以充分利用多核硬件的优势来轻松扩展入侵检测系统的吞吐量。在这方面有两个知名的开源项目,分别是[Suricata][1] 和 [Bro][2]。 +随着安全威胁的不断发生,入侵检测系统(IDS)在如今的数据中心环境中显得尤为必要。然而,随着越来越多的服务器将他们的网卡升级到10GB/40GB以太网,对如此线路上的硬件进行计算密集型的入侵检测越来越困难。其中一种提升入侵检测系统性能的途径是**多线程入侵检测系统**,它将 CPU 密集型的深度包检测工作并行的分配给多个并发任务来完成。这样的并行检测可以充分利用多核硬件的优势来轻松提升入侵检测系统的吞吐量。在这方面有两个知名的开源项目,分别是 [Suricata][1] 和 [Bro][2]。 -这个教程里,我会向大家演示**如何在Linux服务器上安装和配置Suricata入侵检测系统** +这个教程里,我会向大家演示**如何在 Linux 服务器上安装和配置 Suricata 入侵检测系统** -### 在Linux上安装Suricata IDS ### +### 在 Linux 上安装 Suricata IDS ### -让我们从源文件来构建 Suricata,但在此之前,需要按如下所示安装几个依赖包先。 +让我们从源文件来构建 Suricata,但在此之前,需要按如下所示先安装几个依赖包。 -#### 在Debian, Ubuntu 或者 Linux Mint 操作系统上安装依赖包 #### +#### 在 Debian, Ubuntu 或者 Linux Mint 操作系统上安装依赖包 #### $ sudo apt-get install wget build-essential libpcre3-dev libpcre3-dbg automake autoconf libtool libpcap-dev libnet1-dev libyaml-dev zlib1g-dev libcap-ng-dev libjansson-dev -#### 在CentOS, Fedora 或者 RHEL 操作系统上安装依赖包 #### +#### 在 CentOS, Fedora 或者 RHEL 操作系统上安装依赖包 #### $ sudo yum install wget libpcap-devel libnet-devel pcre-devel gcc-c++ automake autoconf libtool make libyaml-devel zlib-devel file-devel jansson-devel nss-devel 一旦将所有依赖包安装完毕,我们就可以继续安装 Suricata 了。 - 首先从 [http://suricata-ids.org/download/][3] 下载 Suricata 源代码,然后构建它。撰写这篇文章的时候,其最新版本号为 2.0.8 。 $ wget http://www.openinfosecfoundation.org/download/suricata-2.0.8.tar.gz @@ -61,12 +60,11 @@ Suricata 源代码带有默认的配置文件。按照如下方法安装这些 $ sudo make install-conf -正如你所料,如果没有IDS规则集的话,Suricata 毛用没有。幸好 Makefile 为我们提供了 IDS 规则集的安装选项。安装方法如下。 - +正如你所料,如果没有IDS规则集的话,Suricata 什么用也没有。幸好 Makefile 为我们提供了 IDS 规则集的安装选项。安装方法如下。 $ sudo make install-rules -以上的规则安装命令会从 [EmergingThreats.net][4] 上下载可用的现存社区规则集快照,并且将其存储在 /etc/suricata/rules 目录下。 +以上的规则安装命令会从 [EmergingThreats.net][4] 上下载可用的社区规则集快照,并且将其存储在 /etc/suricata/rules 目录下。 ![](https://farm1.staticflickr.com/691/20482669553_8b67632277_c.jpg) @@ -76,14 +74,13 @@ Suricata 源代码带有默认的配置文件。按照如下方法安装这些 $ sudo vi /etc/suricata/suricata.yaml -文件中有一些基本的配置供你使用。 +文件中有一些运行所需的基本配置。 -为"default-log-dir"关键字指定Suricata日至文件所在的位置。 +为`default-log-dir`关键字指定 Suricata 日志文件所在的位置。 default-log-dir: /var/log/suricata/ -在"vars"部分下方,你会发现几项对 Suricata 来说很重要变量。"HOME_NET"变量需要指定 Suricata 检查的网络。被分配给 EXTERNAL_NET 变量的 "!$HOME_NET" 代表除本地网络之外的其他网络。"XXX_PORTS"变量用来辨别不同服务所用到的端口号。需要注意的是无论使用什么端口,Suricata 都可以自动检测HTTP流量。所以是不是正确指定端口就显得没那么重要了。 - +在`vars`部分下方,你会发现几项对 Suricata 来说很重要变量。`HOME_NET`变量需要指定 Suricata 检查的网络。被分配给 `EXTERNAL_NET` 变量的 `!$HOME_NET` 代表除本地网络之外的其他网络。`XXX_PORTS`变量用来辨别不同服务所用到的端口号。需要注意的是无论使用什么端口,Suricata 都可以自动检测 HTTP 流量。所以是不是正确指定端口就显得没那么重要了。 vars: HOME_NET: "[192.168.122.0/24]" @@ -92,7 +89,7 @@ Suricata 源代码带有默认的配置文件。按照如下方法安装这些 SHELLCODE_PORTS: "!80" SSH_PORTS: 22 -"host-os-policy" 部分用于防御利用操作系统网络栈(例如:TCP reassembly)的自身行为来逃避检测的一些知名攻击手段。作为对策,通过针对目标操作系统而对检测引擎算法进行微调,现代IDC提供了“基于目标”的检测手段。因此,如果你知道某台主机运行了什么操作系统的话,将这个信息提供给 Suricata 就可以大幅提高检测的成功率。这就是 "host-os-policy" 存在的意义。本例中,默认的IDC对策是Linux系统。如果针对某个IP地址没有指定操作系统信息,Suricata 会默认应用基于Linux系统的检测策略。当捕获到对192.168.122.0/28 和 192.168.122.155通讯时,Suricata就会应用基于Windows系统的检测策略。 +`host-os-policy` 部分用于防御利用操作系统网络栈的自身行为来逃避检测的一些知名攻击手段(例如:TCP reassembly)。作为对策,通过针对目标操作系统而对检测引擎算法进行微调,现代 IDC 提供了“基于目标”的检测手段。因此,如果你知道某台主机运行了什么操作系统的话,将这个信息提供给 Suricata 就可以大幅提高检测的成功率。这就是 `host-os-policy` 存在的意义。本例中,默认的 IDC 策略是 Linux 系统。如果针对某个 IP 地址没有指定操作系统信息,Suricata 会默认应用基于 Linux 系统的检测策略。如下,当捕获到对 192.168.122.0/28 和 192.168.122.155通讯时,Suricata 就会应用基于 Windows 系统的检测策略。 host-os-policy: # These are Windows machines. @@ -111,38 +108,37 @@ Suricata 源代码带有默认的配置文件。按照如下方法安装这些 vista: [] windows2k3: [] -在 "threading" 部分下,你可以为不同的 Suricata 线程指定CPU关联。默认状态下,[CPU 关联][5] 是被禁止使用的 ("set-cpu-affinity: no"),这意味着 Suricata 会分配其线程到所有可用的CPU核心上。Suricata 会默认为每一个CPU核心创建一个检测线程。你可以通过指定 "detect-thread-ratio: N" 来调整此行为。此处会创建 N*M 个检测线程,M代表CPU核心总数。 +在 `threading` 部分下,你可以为不同的 Suricata 线程指定 CPU 关联。默认状态下,[CPU 关联][5] 是被禁止使用的 (`set-cpu-affinity: no`),这意味着 Suricata 会分配其线程到所有可用的 CPU 核心上。Suricata 会默认为每一个 CPU 核心创建一个检测线程。你可以通过指定 `detect-thread-ratio: N` 来调整此行为。此处会创建 N*M 个检测线程,M 代表 CPU 核心总数。 threading: set-cpu-affinity: no detect-thread-ratio: 1.5 -通过以上对线程的设置,Suricata会创建 1.5*M 个检测线程,M是系统的CPU核心总数。 +通过以上对线程的设置,Suricata 会创建 1.5*M 个检测线程,M 是系统的 CPU 核心总数。 -如果你想对Suricata配置有更多的了解,可以去翻阅默认配置文件。里边配有有大量的注释以供你清晰理解。 +如果你想对 Suricata 配置有更多的了解,可以去翻阅默认配置文件。里边配有有大量的注释以供你清晰理解。 -### 使用Suricata进行入侵监控 ### +### 使用 Suricata 进行入侵监控 ### 现在是时候让 Suricata 跑起来了,但在这之前还有一个步骤需要去完成。 -当你使用 pcap捕获模式 的时候,强烈建议关闭Suricata监听网卡上的任何的包卸载(例如 LRO/GRO)功能。这些功能会干扰包的实时捕获行为。 +当你使用 pcap 捕获模式的时候,强烈建议关闭 Suricata 监听网卡上的任何的包卸载(例如 LRO/GRO)功能。这些功能会干扰包的实时捕获行为。 按照以下方法关闭 eth0 接口的 LRO/GRO 功能。 $ sudo ethtool -K eth0 gro off lro off -这里要注意,在使用部分网卡的情况下,你会看到如下警告信息。忽略它们就行了,这些信息只不过告诉你你的网卡不支持LRO功能而已。 +这里要注意,在使用某些网卡的情况下,你会看到如下警告信息。忽略它们就行了,这些信息只不过告诉你你的网卡不支持 LRO 功能而已。 Cannot change large-receive-offload -Suricata 支持许多运行模式。运行模式决定着IDC会使用何种线程。以下命令可以查看所有 [可用的运行模式][6]。 +Suricata 支持许多运行模式。运行模式决定着 IDC 会使用何种线程。以下命令可以查看所有 [可用的运行模式][6]。 $ sudo /usr/local/bin/suricata --list-runmodes ![](https://farm6.staticflickr.com/5730/20481140934_25080d04d7_c.jpg) - -Suricata 使用的默认运行模式是autofp("auto flow pinned load balancing"==“自动流绑定负载均衡” 的缩写)。这个模式下,来自某一个流的包会被分配到一个单独的检测线程中。这些流会根据未被处理的包的最低数量来分配相应的线程。 +Suricata 使用的默认运行模式是 autofp("auto flow pinned load balancing"==“自动流绑定负载均衡” 的缩写)。这个模式下,来自某一个流的包会被分配到一个单独的检测线程中。这些流会根据未被处理的包的最低数量来分配相应的线程。 最后,让我们将 Suricata 运行起来,看看它表现如何。 @@ -150,14 +146,13 @@ Suricata 使用的默认运行模式是autofp("auto flow pinned load balancing ![](https://farm1.staticflickr.com/701/21077552366_c577746e36_c.jpg) -本例中,我们在一个8核心系统中监控eth0网络接口。如上所示,Suricata 创建了13个包处理线程和3个管理线程。包处理线程中包括一个PCAP包捕获线程,12个检测线程(由8*1.5得出)。这表示IDS内的1个包捕获线程均衡负载到12个检测线程中。管理线程包括1个流管理和2个计数/统计相关线程。 +本例中,我们在一个8核心系统中监控 eth0 网络接口。如上所示,Suricata 创建了13个包处理线程和3个管理线程。包处理线程中包括一个 PCAP 包捕获线程,12个检测线程(由8*1.5得出)。这表示 IDS 内的1个包捕获线程均衡负载到12个检测线程中。管理线程包括1个流管理和2个计数/统计相关线程。 -Here is a thread-view of Suricata process (plotted by [htop][7]). 以下是一个关于Suricata处理的线程截图(由 [htop][7] 绘制)。 ![](https://farm6.staticflickr.com/5775/20482669593_174f8f41cb_c.jpg) -Suricata检测日志存储在 /var/log/suricata 目录下。 +Suricata 检测日志存储在 /var/log/suricata 目录下。 $ tail -f /var/log/suricata/fast.log @@ -167,7 +162,7 @@ Suricata检测日志存储在 /var/log/suricata 目录下。 04/01/2015-15:49:06.565901 [**] [1:2200074:1] SURICATA TCPv4 invalid checksum [**] [Classification: (null)] [Priority: 3] {TCP} 172.16.253.158:22 -> 172.16.253.1:46317 04/01/2015-15:49:06.566759 [**] [1:2200074:1] SURICATA TCPv4 invalid checksum [**] [Classification: (null)] [Priority: 3] {TCP} 172.16.253.158:22 -> 172.16.253.1:46317 -日志也可以提供Json格式,被当做引用实例去使用: +日志也可以提供 Json 格式以便导入: $ tail -f /var/log/suricata/eve.json @@ -177,9 +172,9 @@ Suricata检测日志存储在 /var/log/suricata 目录下。 ### 总结 ### -这篇教程中,我为大家演示了如何在一台多核Linux服务器上安装Suricata入侵检测系统。不同于单线程的 [Snort IDS][8] ,Suricata 可以很容易的从多核硬件的多进程特性所带来的红利中获益。定制Suricata来最大化其效能和检测范围是一个很好的主意。Suricata的粉丝们维护着一个 [在线 Wiki][9],如果你打算将Suricata部署到你的环境中,我强烈建议你去那儿取取经。 +这篇教程中,我为大家演示了如何在一台多核 Linux 服务器上安装 Suricata 入侵检测系统。不同于单线程的 [Snort IDS][8] ,Suricata 可以很容易的从多核硬件的多进程特性所带来的好处中获益。定制 Suricata 来最大化其效能和检测范围是一个很好的主意。Suricata 的粉丝们维护着一个 [在线 Wiki][9],如果你打算将 Suricata 部署到你的环境中,我强烈建议你去那儿取取经。 -如果你现在已经开始使用Suricata了的话,把你的经验也分享出来吧。 +如果你现在已经开始使用 Suricata 了的话,把你的经验也分享出来吧。 -------------------------------------------------------------------------------- @@ -187,7 +182,7 @@ via: http://xmodulo.com/install-suricata-intrusion-detection-system-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 9ccb1e7e67891d48f09f85e2fb4bba49066c96d7 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 6 Feb 2016 21:00:09 +0800 Subject: [PATCH 0292/1469] PUB:20151201 Cinnamon 2.8 Review @wwy-hust --- .../20151201 Cinnamon 2.8 Review.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) rename {translated/talk => published}/20151201 Cinnamon 2.8 Review.md (70%) diff --git a/translated/talk/20151201 Cinnamon 2.8 Review.md b/published/20151201 Cinnamon 2.8 Review.md similarity index 70% rename from translated/talk/20151201 Cinnamon 2.8 Review.md rename to published/20151201 Cinnamon 2.8 Review.md index 209ee05cd6..ac84601cab 100644 --- a/translated/talk/20151201 Cinnamon 2.8 Review.md +++ b/published/20151201 Cinnamon 2.8 Review.md @@ -1,52 +1,52 @@ -Cinnamon 2.8 评论 +Cinnamon 2.8 新变化一览 ================================================================================ ![](https://www.maketecheasier.com/assets/uploads/2015/11/cinnamon-2-8-featured.jpg) -除了Gnome和KDE外,Cinnamon是另一个很多人使用的桌面环境。它是由创作Linux Mint的团队制作的,并且可以被安装在许多其他发行版上。该桌面环境的最新版本 - Cinnamon 2.8 - 于本月早些时间发布,此版本修复了许多的Bug、做了许多改进并添加了一些新功能。 +除了Gnome和KDE外,Cinnamon是另一个很多人使用的桌面环境。它是由创作Linux Mint的团队制作的,并且可以被安装在许多其他发行版上。该桌面环境的最新版本 - Cinnamon 2.8 - 于去年底发布,此版本修复了许多的Bug、做了许多改进并添加了一些新功能。 我将仔细介绍该发行版本的主要改进,以及如何更新到Cinnamon 2.8或者第一次安装它。 ### 对Applets的改进 ### -在此版本中,对已经在面板中存在的Applets做了若干的改进。 +在此版本中,对面板中已有的Applets做了若干的改进。 #### 声音 Applet #### ![cinnamon-28-sound-applet](https://www.maketecheasier.com/assets/uploads/2015/11/rsz_cinnamon-28-sound-applet.jpg) -声音Applet经过修订,目前可以显示音轨信息并且可以在音频文件的艺术家封面上面进行媒体控制。对于支持拖动的音乐播放器来说(例如Banshee),会有一个进度条在同样的位置,您可以用它来改变音轨位置。在applet的面板上右击将显示对输入和输出静音的选项。 +声音Applet经过修正,目前可以显示音轨信息并且可以在音频文件的艺术家封面上面进行媒体控制。对于支持拖动的音乐播放器来说(例如Banshee),会有一个进度条显示同样的播放进度,您可以用它来改变音轨位置。在applet的面板上右击将显示对输入和输出设备静音的选项。 #### 电源 Applet #### -电源applet则会使用制造商的数据而不是通用名称显示每一个连接的电池和设备。 +电源applet则会使用电池制造商的数据而不是通用名称来显示每一个连接的电池和设备。 #### 窗口缩略图 #### ![cinnamon-2.8-window-thumbnails](https://www.maketecheasier.com/assets/uploads/2015/11/cinnamon-2.8-window-thumbnails.png) -Cinnamon 2.8带来了可以在鼠标悬停于面板里窗口列表中的窗口时展示窗口缩略图的选项。如果您不喜欢该功能,您还可以关闭它。 +在Cinnamon 2.8中,可以在鼠标悬停于面板里窗口列表时展示窗口缩略图。如果您不喜欢该功能,您还可以关闭该选项。 #### 工作区切换 Applet #### ![cinnamon-2.8-workspace-switcher](https://www.maketecheasier.com/assets/uploads/2015/11/cinnamon-2.8-workspace-switcher.png) -添加工作区切换applet到您的面板将为您显示一个代表工作区的可视化的图像,一些矩形嵌套在其中,代表您的窗口的位置。 +添加工作区切换applet到您的面板将为您显示一个代表该工作区的可视化图像,一些矩形嵌套显示在其中,代表您的窗口的位置。 #### 系统托盘 #### -Cinnamon 2.8带来了对系统托盘中的应用程序指示器的支持。您可以很容易地在设置中禁用它,这将强制应用程序回滚以使用状态图标作为替代。 +Cinnamon 2.8支持在系统托盘中显示应用程序指示器。您可以很容易地在设置中禁用它,这将强制应用程序到以前使用状态图标的方式。 ### 视觉改进 ### -Cinnamon 2.8还做了很多视觉上的改进。经典的切换器和Alt + Tab预览切换器都被细细打磨,有了显著的改进,同时修复了Alt + F2对话框的bug,并赋予了它更好的命令自动补全功能。 +Cinnamon 2.8还做了很多视觉上的改进。经典的切换器和Alt + Tab预览切换器都被精细打磨,有了显著的改进,同时修复了Alt + F2对话框的bug,并赋予了它更好的命令自动补全功能。 -而且,在于最小化窗口时的存在的传统的动画效果中的问题现已被解决并可用于多个面板。 +而且,传统的最小化窗口时动画效果的问题现已被解决,并可用于多个面板。 ### Nemo 的改进 ### ![cinnamon-2.8-nemo](https://www.maketecheasier.com/assets/uploads/2015/11/rsz_cinnamon-28-nemo.jpg) -Cinnamon默认的文件管理器也修复了一些bug,并有了新的“快速重命名”的功能,用于重命名文件和文件夹。可以通过两次点击文件或文件夹并在两次点击之前进行简短的停顿以重命名文件。 +Cinnamon默认的文件管理器也修复了一些bug,并有了新的“快速重命名”的功能,用于重命名文件和文件夹。可以通过两次点击文件或文件夹并在两次点击之间进行简短的停顿以重命名文件。 Nemo也会自动地检测缩略图存在的问题,并提示您快速地修复它们。 @@ -54,7 +54,7 @@ Nemo也会自动地检测缩略图存在的问题,并提示您快速地修复 - Applets如今会在它们被更新的时候自动地重新加载一次。 - 对于多个监视器的支持有了显著的提高。 -- 对话框窗口有了提高,并且会附加到它的父窗口上。 +- 对话框窗口有了改进,并且会附加到它的父窗口上。 - HiDPI检测有了改进。 - QT5应用程序现在看起来更加原生并使用了默认的GTK主题。 - 窗口管理和渲染性能有了提升。 @@ -80,7 +80,7 @@ via: https://www.maketecheasier.com/cinnamon-2-8-review/ 作者:[Ayo Isaiah][a] 译者:[wwy-hust](https://github.com/wwy-hust) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 92536f4a2cd2839526f76860ec35bca646288ffb Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 7 Feb 2016 23:52:41 +0800 Subject: [PATCH 0293/1469] PUB:20151030 80 Linux Monitoring Tools for SysAdmins MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @strugglingyouth 好长的文章 --- ...80 Linux Monitoring Tools for SysAdmins.md | 156 +++++++++--------- 1 file changed, 78 insertions(+), 78 deletions(-) rename {translated/share => published}/20151030 80 Linux Monitoring Tools for SysAdmins.md (68%) diff --git a/translated/share/20151030 80 Linux Monitoring Tools for SysAdmins.md b/published/20151030 80 Linux Monitoring Tools for SysAdmins.md similarity index 68% rename from translated/share/20151030 80 Linux Monitoring Tools for SysAdmins.md rename to published/20151030 80 Linux Monitoring Tools for SysAdmins.md index 4733a41d17..b78c23fa41 100644 --- a/translated/share/20151030 80 Linux Monitoring Tools for SysAdmins.md +++ b/published/20151030 80 Linux Monitoring Tools for SysAdmins.md @@ -1,9 +1,9 @@ - -Linux 系统管理员必备的80个监控工具 +最全列表: 80 多个 Linux 系统管理员必备的监控工具 ================================================================================ + ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/linux-monitoring.jpg) -随着行业的不断发展,各种工具多得不可胜数。这里列出网上最全的(工具)。拥有超过80种方式来管理你的机器。在本文中,我们主要讲述以下方面: +随着互联网行业的不断发展,各种监控工具多得不可胜数。这里列出网上最全的监控工具。让你可以拥有超过80种方式来管理你的机器。在本文中,我们主要包括以下方面: - 命令行工具 - 网络相关内容 @@ -11,51 +11,51 @@ Linux 系统管理员必备的80个监控工具 - 日志监控工具 - 基础设施监控工具 -监控和调试性能问题非常困难,但用对了正确的工具有时也是很容易的。下面是一些你可能听说过的工具,当你使用它们时可能存在一些问题: +监控和调试性能问题是一个艰巨的任务,但用对了正确的工具有时也是很容易的。下面是一些你可能听说过的工具,也有可能没有听说过——何不赶快开始试试? -### 十大系统监控工具 ### +### 八大系统监控工具 ### -#### 1. Top #### +#### 1. top #### ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/top.jpg) -这是一个被预装在许多 UNIX 系统中的小工具。当你想要查看在系统中运行的进程或线程时:top 是一个很好的工具。你可以对这些进程以不同的标准进行排序,默认是以 CPU 进行排序的。 +这是一个被预装在许多 UNIX 系统中的小工具。当你想要查看在系统中运行的进程或线程时:top 是一个很好的工具。你可以对这些进程以不同的方式进行排序,默认是以 CPU 进行排序的。 #### 2. [htop][1] #### ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/htop.jpg) -HTOP 实质上是 top 的增强版本。它更容易对进程排序。它在视觉上更容易理解并且已经内建了许多通用的命令。它也是完全交互的。 +htop 实质上是 top 的一个增强版本。它更容易对进程排序。它看起来上更容易理解,并且已经内建了许多通用操作。它也是完全交互式的。 #### 3. [atop][2] #### -Atop 和 top,htop 非常相似,它也能监控所有进程,但不同于 top 和 htop 的是,它会记录进程的日志供以后分析。它也能显示所有进程的资源消耗。它还会高亮显示已经达到临界负载的资源。 +atop 和 top,htop 非常相似,它也能监控所有进程,但不同于 top 和 htop 的是,它可以按日记录进程的日志供以后分析。它也能显示所有进程的资源消耗。它还会高亮显示已经达到临界负载的资源。 #### 4. [apachetop][3] #### -Apachetop 会监控 apache 网络服务器的整体性能。它主要是基于 mytop。它会显示当前 reads, writes 的数量以及 requests 进程的总数。 +apachetop 会监控 apache 网络服务器的整体性能。它主要是基于 mytop。它会显示当前的读取进程、写入进程的数量以及请求进程的总数。 #### 5. [ftptop][4] #### -ftptop 给你提供了当前所有连接到 ftp 服务器的基本信息,如会话总数,正在上传和下载的客户端数量以及客户端信息。 +ftptop 给你提供了当前所有连接到 ftp 服务器的基本信息,如会话总数,正在上传和下载的客户端数量以及客户端是谁。 #### 6. [mytop][5] #### ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/mytop.jpg) -mytop 是一个很简洁的工具,用于监控线程和 mysql 的性能。它给了你一个实时的数据库来查询处理结果。 +mytop 是一个很简洁的工具,用于监控 mysql 的线程和性能。它能让你实时查看数据库以及正在处理哪些查询。 #### 7. [powertop][6] #### ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/powertop.jpg) -powertop 可以帮助你诊断与电量消耗和电源管理相关的问题。它也可以帮你进行电源管理设置,以实现对你服务器最有效的配置。你可以使用 tab 键进行选项切换。 +powertop 可以帮助你诊断与电量消耗和电源管理相关的问题。它也可以帮你进行电源管理设置,以实现对你服务器最有效的配置。你可以使用 tab 键切换选项卡。 #### 8. [iotop][7] #### ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/iotop.jpg) -iotop 用于检查 I/O 的使用情况,并为你提供了一个类似 top 的界面来显示。它每列显示读和写的速率,每行代表一个进程。当出现等待 I/O 交换时,它也显示进程消耗时间的百分比。 +iotop 用于检查 I/O 的使用情况,并为你提供了一个类似 top 的界面来显示。它按列显示读和写的速率,每行代表一个进程。当发生交换或 I/O 等待时,它会显示进程消耗时间的百分比。 ### 与网络相关的监控 ### @@ -63,7 +63,7 @@ iotop 用于检查 I/O 的使用情况,并为你提供了一个类似 top 的 ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/ntopng.jpg) -ntopng 是 ntop 的升级版,它提供了一个能使用浏览器进行网络监控的图形用户界面。它还有其他用途,如:定位主机,显示网络流量和 ip 流量分布并能进行分析。 +ntopng 是 ntop 的升级版,它提供了一个能通过浏览器进行网络监控的图形用户界面。它还有其他用途,如:地理定位主机,显示网络流量和 ip 流量分布并能进行分析。 #### 10. [iftop][9] #### @@ -75,17 +75,17 @@ iftop 类似于 top,但它主要不是检查 cpu 的使用率而是监听所 ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/jnettop.jpg) -jnettop 以相同的方式来监测网络流量但比 iftop 更形象。它还支持自定义的文本输出并能以友好的交互方式来深度分析日志。 +jnettop 以相同的方式来监测网络流量但比 iftop 更形象。它还支持自定义的文本输出,并能以友好的交互方式来深度分析日志。 #### 12. [bandwidthd][11] #### ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/bandwidthd.jpg) -bandwidthd 可以跟踪 TCP/IP 网络子网的使用情况并能在浏览器中通过 png 图片形象化地构建一个 HTML 页面。它有一个数据库驱动系统,支持搜索、过滤,多传感器和自定义报表。 +BandwidthD 可以跟踪 TCP/IP 网络子网的使用情况,并能在浏览器中通过 png 图片形象化地构建一个 HTML 页面。它有一个数据库系统,支持搜索、过滤,多传感器和自定义报表。 #### 13. [EtherApe][12] #### -EtherApe 以图形化显示网络流量,可以支持更多的节点。它可以捕获实时流量信息,也可以从 tcpdump 进行读取。也可以使用具有 pcap 语法的网络过滤显示特定信息。 +EtherApe 以图形化显示网络流量,可以支持更多的节点。它可以捕获实时流量信息,也可以从 tcpdump 进行读取。也可以使用 pcap 格式的网络过滤器来显示特定信息。 #### 14. [ethtool][13] #### @@ -97,7 +97,7 @@ ethtool 用于显示和修改网络接口控制器的一些参数。它也可以 ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/nethogs.jpg) -NetHogs 打破了网络流量按协议或子网进行统计的原理。它以进程组来计算。所以,当网络流量猛增时,你可以使用 NetHogs 查看是由哪个进程造成的。 +NetHogs 打破了网络流量按协议或子网进行统计的惯例,它以进程来分组。所以,当网络流量猛增时,你可以使用 NetHogs 查看是由哪个进程造成的。 #### 16. [iptraf][15] #### @@ -109,7 +109,7 @@ iptraf 收集的各种指标,如 TCP 连接数据包和字节数,端口统 ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/ngrep.jpg) -如果不是网络层的话,ngrep 就是 grep。pcap 意识到后允许其指定扩展规则或十六进制表达式来匹配数据包。 +ngrep 就是网络层的 grep。它使用 pcap ,允许通过指定扩展正则表达式或十六进制表达式来匹配数据包。 #### 18. [MRTG][17] #### @@ -121,29 +121,29 @@ MRTG 最初被开发来监控路由器的流量,但现在它也能够监控网 ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/bmon.jpg) -Bmon 能监控并帮助你调试网络。它能捕获网络相关的统计数据,并以友好的方式进行展示。你还可以与 bmon 通过脚本进行交互。 +bmon 能监控并帮助你调试网络。它能捕获网络相关的统计数据,并以友好的方式进行展示。你还可以与 bmon 通过脚本进行交互。 #### 20. traceroute #### ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/traceroute.jpg) -Traceroute 是一个内置工具,能显示路由和测试数据包在网络中的延迟。 +traceroute 是一个内置工具,能显示路由和测量数据包在网络中的延迟。 #### 21. [IPTState][19] #### -IPTState 可以让你跨越 iptables 来监控流量,并通过你指定的条件来进行排序。该工具还允许你从表中删除状态信息。 +IPTState 可以让你观察流量是如何通过 iptables,并通过你指定的条件来进行排序。该工具还允许你从 iptables 的表中删除状态信息。 #### 22. [darkstat][20] #### ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/darkstat.jpg) -Darkstat 能捕获网络流量并计算使用情况的统计数据。该报告保存在一个简单的HTTP服务器中,它为你提供了一个非常棒的图形用户界面。 +darkstat 能捕获网络流量并计算使用情况的统计数据。该报告保存在一个简单的 HTTP 服务器中,它为你提供了一个非常棒的图形用户界面。 #### 23. [vnStat][21] #### ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/vnstat.jpg) -vnStat 是一个网络流量监控工具,它的数据统计是由内核进行提供的,其消耗的系统资源非常少。系统重新启动后,它收集的数据仍然存在。它具有颜色选项供系统管理员使用。 +vnStat 是一个网络流量监控工具,它的数据统计是由内核进行提供的,其消耗的系统资源非常少。系统重新启动后,它收集的数据仍然存在。有艺术感的系统管理员可以使用它的颜色选项。 #### 24. netstat #### @@ -159,19 +159,19 @@ netstat 是一个内置的工具,它能显示 TCP 网络连接,路由表和 ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/nmap.jpg) -Nmap 可以扫描你服务器开放的端口并且可以检测正在使用哪个操作系统。但你也可以使用 SQL 注入漏洞,网络发现和渗透测试相关的其他手段。 +Nmap 可以扫描你服务器开放的端口并且可以检测正在使用哪个操作系统。但你也可以将其用于 SQL 注入漏洞、网络发现和渗透测试相关的其他用途。 #### 27. [MTR][23] #### ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/mtr.jpg) -MTR 结合了 traceroute 和 ping 的功能到一个网络诊断工具上。当使用该工具时,它会限制单个数据包的跳数,同时也监视它们的到期时间。然后每秒进行重复。 +MTR 将 traceroute 和 ping 的功能结合到了一个网络诊断工具上。当使用该工具时,它会限制单个数据包的跳数,然后监视它们的到期时到达的位置。然后每秒进行重复。 #### 28. [Tcpdump][24] #### ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/tcpdump.jpg) -Tcpdump 将输出一个你在命令中匹配并捕获到的数据包的信息。你还可以将此数据保存并进一步分析。 +Tcpdump 将按照你在命令行中指定的表达式输出匹配捕获到的数据包的信息。你还可以将此数据保存并进一步分析。 #### 29. [Justniffer][25] #### @@ -185,13 +185,13 @@ Justniffer 是 tcp 数据包嗅探器。使用此嗅探器你可以选择收集 ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/nmon.jpg) -nmon 将数据输出到屏幕上的,或将其保存在一个以逗号分隔的文件中。你可以查看 CPU,内存,网络,文件系统,top 进程。数据也可以被添加到 RRD 数据库中用于进一步分析。 +nmon 将数据输出到屏幕上的,或将其保存在一个以逗号分隔的文件中。你可以查看 CPU,内存,网络,文件系统,前列 进程。数据也可以被添加到 RRD 数据库中用于进一步分析。 #### 31. [conky][27] #### ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/cpulimit.jpg) -Conky 能监视不同操作系统并统计数据。它支持 IMAP 和 POP3, 甚至许多流行的音乐播放器!出于方便不同的人,你可以使用自己的 Lua 脚本或程序来进行扩展。 +Conky 能监视很多的操作系统数据。它支持 IMAP 和 POP3, 甚至许多流行的音乐播放器!出于方便不同的人,你可以使用自己的 Lua 脚本或程序来进行扩展。 #### 32. [Glances][28] #### @@ -211,17 +211,17 @@ Saidar 是一个非常小的工具,为你提供有关系统资源的基础信 RRDtool 是用来处理 RRD 数据库的工具。RRDtool 旨在处理时间序列数据,如 CPU 负载,温度等。该工具提供了一种方法来提取 RRD 数据并以图形界面显示。 -#### 35. [monit][31] #### +#### 35. [monit][31] #### ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/monit.jpg) -如果出现故障时,monit 有发送警报以及重新启动服务的功能。它可以对任何类型进行检查,你可以为 monit 写一个脚本,它有一个 Web 用户界面来分担你眼睛的压力。 +如果出现故障时,monit 有发送警报以及重新启动服务的功能。它可以对各种数据进行检查,你可以为 monit 写一个脚本,它有一个 Web 用户界面来分担你眼睛的压力。 #### 36. [Linux process explorer][32] #### ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/linux-process-monitor.jpg) -Linux process explorer 是类似 OSX 或 Windows 的在线监视器。它比 top 或 ps 的使用范围更广。你可以查看每个进程的内存消耗以及 CPU 的使用情况。 +Linux process explorer 是类似 OSX 或 Windows 的活动监视器。它比 top 或 ps 的使用范围更广。你可以查看每个进程的内存消耗以及 CPU 的使用情况。 #### 37. df #### @@ -233,37 +233,37 @@ df 是 disk free 的缩写,它是所有 UNIX 系统预装的程序,用来显 ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/discus.jpg) -Discus 类似于 df,它的目的是通过使用更吸引人的特性,如颜色,图形和数字来对 df 进行改进。 +discus 类似于 df,它的目的是通过使用更吸引人的特性,如颜色,图形和数字来对 df 进行改进。 #### 39. [xosview][34] #### ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/xosview.jpg) -xosview 是一款经典的系统监控工具,它给你提供包括 IRQ 的各个不同部分的总览。 +xosview 是一款经典的系统监控工具,它给你提供包括 IRQ 在内的各个不同部分的简单总览。 #### 40. [Dstat][35] #### ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/dstat.jpg) -Dstat 旨在替代 vmstat,iostat,netstat 和 ifstat。它可以让你查实时查看所有的系统资源。这些数据可以导出为 CSV。最重要的是 dstat 允许使用插件,因此其可以扩展到更多领域。 +dstat 旨在替代 vmstat,iostat,netstat 和 ifstat。它可以让你查实时查看所有的系统资源。这些数据可以导出为 CSV。最重要的是 dstat 允许使用插件,因此其可以扩展到更多领域。 #### 41. [Net-SNMP][36] #### -SNMP 是“简单网络管理协议”,Net-SNMP 工具套件使用该协议可帮助你收集服务器的准确信息。 +SNMP 即“简单网络管理协议”,Net-SNMP 工具套件使用该协议可帮助你收集服务器的准确信息。 #### 42. [incron][37] #### -Incron 允许你监控一个目录树,然后对这些变化采取措施。如果你想将目录‘a’中的新文件复制到目录‘b’,这正是 incron 能做的。 +incron 允许你监控一个目录树,然后对这些变化采取措施。如果你想在目录‘a’中出现新文件时,将其复制到目录‘b’,这正是 incron 能做的。 #### 43. [monitorix][38] #### -Monitorix 是轻量级的系统监控工具。它可以帮助你监控一台机器,并为你提供丰富的指标。它也有一个内置的 HTTP 服务器,来查看图表和所有指标的报告。 +Monitorix 是轻量级的系统监控工具。它可以帮助你监控单独一台机器,并为你提供丰富的指标。它也有一个内置的 HTTP 服务器,来查看图表和所有指标的报告。 #### 44. vmstat #### ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/vmstat.jpg) -vmstat(virtual memory statistics)是一个小的内置工具,能监控和显示机器的内存。 +vmstat(virtual memory statistics)是一个小型内置工具,能监控和显示机器的内存。 #### 45. uptime #### @@ -273,13 +273,13 @@ vmstat(virtual memory statistics)是一个小的内置工具,能监控和 ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/mpstat.jpg) -mpstat 是一个内置的工具,能监视 cpu 的使用情况。最常见的使用方法是 `mpstat -P ALL`,它给你提供 cpu 的使用情况。你也可以间隔更新 cpu 的使用情况。 +mpstat 是一个内置的工具,能监视 cpu 的使用情况。最常见的使用方法是 `mpstat -P ALL`,它给你提供 cpu 的使用情况。你也可以间歇性地更新 cpu 的使用情况。 #### 47. pmap #### ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/pmap.jpg) -pmap 是一个内置的工具,报告一个进程的内存映射。你可以使用这个命令来找出内存瓶颈的原因。 +pmap 是一个内置的工具,报告一个进程的内存映射。你可以使用这个命令来找出导致内存瓶颈的原因。 #### 48. ps #### @@ -291,13 +291,13 @@ pmap 是一个内置的工具,报告一个进程的内存映射。你可以使 ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/sar.jpg) -sar 是 sysstat 包的一部分,可以帮助你收集,报告和保存不同系统的指标。使用不同的参数,它会给你提供 CPU, 内存 和 I/O 使用情况及其他东西。 +sar 是 sysstat 包的一部分,可以帮助你收集、报告和保存不同系统的指标。使用不同的参数,它会给你提供 CPU、 内存和 I/O 使用情况及其他东西。 #### 50. [collectl][40] #### ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/collectl.jpg) -类似于 sar,collectl 收集你机器的性能指标。默认情况下,显示 cpu,网络和磁盘统计数据,但它实际收集了很多信息。与 sar 不同的是,collectl 能够处理比秒更小的单位,它可以被直接送入绘图工具并且 collectl 的监控过程更广泛。 +类似于 sar,collectl 收集你机器的性能指标。默认情况下,显示 cpu、网络和磁盘统计数据,但它实际收集了很多信息。与 sar 不同的是,collectl 能够处理比秒更小的单位,它可以被直接送入绘图工具并且 collectl 的监控过程更广泛。 #### 51. [iostat][41] #### @@ -309,23 +309,23 @@ iostat 也是 sysstat 包的一部分。此命令用于监控系统的输入/输 ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/free.jpg) -这是一个内置的命令用于显示你机器上可用的内存大小以及已使用的内存大小。它还可以显示某时刻内核所使用的缓冲区大小。 +这是一个内置的命令,用于显示你机器上可用的内存大小以及已使用的内存大小。它还可以显示某时刻内核所使用的缓冲区大小。 -#### 53. /Proc 文件系统 #### +#### 53. /proc 文件系统 #### ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/procfile.jpg) -proc 文件系统可以让你查看内核的统计信息。从这些统计数据可以得到你机器上不同硬件设备的详细信息。看看这个 [ proc文件统计的完整列表 ][42]。 +proc 文件系统可以让你查看内核的统计信息。从这些统计数据可以得到你机器上不同硬件设备的详细信息。看看这个 [proc 文件统计的完整列表][42]。 #### 54. [GKrellM][43] #### -GKrellm 是一个图形应用程序来监控你硬件的状态信息,像CPU,内存,硬盘,网络接口以及其他的。它也可以监视并启动你所选择的邮件阅读器。 +GKrellm 是一个图形应用程序,用来监控你硬件的状态信息,像CPU,内存,硬盘,网络接口以及其他的。它也可以监视并启动你所选择的邮件阅读器。 #### 55. [Gnome 系统监控器][44] #### ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/gnome-system-monitor.jpg) -Gnome 系统监控器是一个基本的系统监控工具,其能通过一个树状结构来查看进程的依赖关系,能杀死及调整进程优先级,还能以图表形式显示所有服务器的指标。 +Gnome 系统监控器是一个基本的系统监控工具,其能通过一个树状结构来查看进程的依赖关系,能杀死进程及调整进程优先级,还能以图表形式显示所有服务器的指标。 ### 日志监控工具 ### @@ -333,11 +333,11 @@ Gnome 系统监控器是一个基本的系统监控工具,其能通过一个 ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/goaccess.jpg) -GoAccess 是一个实时的网络日志分析器,它能分析 apache, nginx 和 amazon cloudfront 的访问日志。它也可以将数据输出成 HTML,JSON 或 CSV 格式。它会给你一个基本的统计信息,访问量,404页面,访客位置和其他东西。 +GoAccess 是一个实时的网络日志分析器,它能分析 apache, nginx 和 amazon cloudfront 的访问日志。它也可以将数据输出成 HTML,JSON 或 CSV 格式。它会给你一个基本的统计信息、访问量、404 页面,访客位置和其他东西。 #### 57. [Logwatch][46] #### -Logwatch 是一个日志分析系统。它通过分析系统的日志,并为你所指定的区域创建一个分析报告。它每天给你一个报告可以让你花费更少的时间来分析日志。 +Logwatch 是一个日志分析系统。它通过分析系统的日志,并为你所指定的部分创建一个分析报告。它每天给你一个报告,以便让你花费更少的时间来分析日志。 #### 58. [Swatch][47] #### @@ -349,13 +349,13 @@ Logwatch 是一个日志分析系统。它通过分析系统的日志,并为 ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/multitail.jpg) -MultiTail 可帮助你在多窗口下监控日志文件。你可以将这些日志文件合并成一个。它也像正则表达式一样使用不同的颜色来显示日志文件以方便你阅读。 +MultiTail 可帮助你在多个窗口之下监控日志文件。你可以将这些日志文件合并到一个窗口。它可以通过正则表达式的帮助,使用不同的颜色来显示日志文件以方便你阅读。 -#### 系统工具 #### +### 系统工具 ### #### 60. [acct or psacct][49] #### -acct 也称 psacct(取决于如果你使用 apt-get 还是 yum)可以监控所有用户执行的命令,包括 CPU 和内存在系统内所使用的时间。一旦安装完成后你可以使用命令 ‘sa’ 来查看。 +acct 也称 psacct(取决于如果你使用 apt-get 还是 yum)可以监控所有用户执行的命令,包括 CPU 时间和内存占用。一旦安装完成后你可以使用命令 `sa` 来查看统计。 #### 61. [whowatch][50] #### @@ -365,31 +365,31 @@ acct 也称 psacct(取决于如果你使用 apt-get 还是 yum)可以监控 ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/strace.jpg) -strace 被用于诊断,调试和监控程序之间的相互调用过程。最常见的做法是用 strace 打印系统调用的程序列表,其可以看出程序是否像预期那样被执行了。 +strace 被用于诊断、调试和监控程序之间的相互调用过程。最常见的做法是用 strace 打印系统调用的程序列表,其可以看出程序是否像预期那样被执行了。 #### 63. [DTrace][52] #### ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/dtrace.jpg) -DTrace 可以说是 strace 的大哥。它动态地跟踪与检测代码实时运行的指令。它允许你深入分析其性能和诊断故障。但是,它并不简单,大约有1200本书中提到过它。 +DTrace 可以说是 strace 的大哥。它动态地跟踪与检测代码实时运行的指令。它允许你深入分析其性能和诊断故障。但是,它并不简单,关于这个话题有1200本书之多。 #### 64. [webmin][53] #### ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/webmin.jpg) -Webmin 是一个基于 Web 的系统管理工具。它不需要手动编辑 UNIX 配置文件,并允许你远程管理系统。它有一对监控模块用于连接它。 +Webmin 是一个基于 Web 的系统管理工具。它不需要手动编辑 UNIX 配置文件,可以让你远程管理系统。它有一对监控模块用于连接它。 #### 65. stat #### ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/stat.jpg) -Stat 是一个内置的工具,用于显示文件和文件系统的状态信息。它会显示文件被修改,访问或更改的信息。 +Stat 是一个内置的工具,用于显示文件和文件系统的状态信息。它会显示文件何时被修改、访问或更改。 #### 66. ifconfig #### ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/ifconfig.jpg) -ifconfig 是一个内置的工具用于配置网络接口。大多数网络监控工具背后都使用 ifconfig 将其设置成混乱模式来捕获所有的数据包。你可以手动执行 `ifconfig eth0 promisc` 并使用 `ifconfig eth0 -promisc` 返回正常模式。 +ifconfig 是一个内置的工具,用于配置网络接口。大多数网络监控工具背后都使用 ifconfig 将网卡设置成混乱模式来捕获所有的数据包。你可以手动执行 `ifconfig eth0 promisc` 进入混乱模式,使用 `ifconfig eth0 -promisc` 返回正常模式。 #### 67. [ulimit][54] #### @@ -399,23 +399,23 @@ ulimit 是一个内置的工具,可监控系统资源,并可以限制任何 #### 68. [cpulimit][55] #### -CPULimit 是一个小工具用于监控并限制进程对 CPU 的使用率。其特别有用,能限制批处理作业对 CPU 的使用率保持在一定范围。 +CPULimit 是一个小工具,用于监控并限制进程对 CPU 的使用率。其特别可以用于将批处理作业对 CPU 的使用率保持在一定范围。 #### 69. lshw #### ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/lshw.jpg) -lshw 是一个小的内置工具能提取关于本机硬件配置的详细信息。它可以输出 CPU 版本和主板配置。 +lshw 是一个小的内置工具,能提取关于本机硬件配置的详细信息。它可以输出 CPU 版本和主板配置。 #### 70. w #### -w 是一个内置命令用于显示当前登录用户的信息及他们所运行的进程。 +w 是一个内置命令,用于显示当前登录用户的信息及他们所运行的进程。 #### 71. lsof #### ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/lsof.jpg) -lsof 是一个内置的工具可让你列出所有打开的文件和网络连接。从那里你可以看到文件是由哪个进程打开的,基于进程名,可通过一个特定的用户来杀死属于某个用户的所有进程。 +lsof 是一个内置的工具,可让你列出所有打开的文件和网络连接。从那里你可以看到文件是由哪个进程打开的,基于进程名可找到其特定的用户,或杀死属于某个用户的所有进程。 ### 基础架构监控工具 ### @@ -423,13 +423,13 @@ lsof 是一个内置的工具可让你列出所有打开的文件和网络连接 ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/server-density-monitoring.png) -我们的 [服务器监控工具][56]!它有一个 web 界面,使你可以进行报警设置并可以通过图表来查看所有系统的网络指标。你还可以设置监控的网站,无论是否在线。Server Density 允许你设置用户的权限,你可以根据我们的插件或 api 来扩展你的监控。该服务已经支持 Nagios 的插件了。 +我们的 [服务器监控工具][56] 它有一个 web 界面,使你可以进行报警设置并可以通过图表来查看所有系统的网络指标。你还可以设置监控的网站,无论是否在线。Server Density 允许你设置用户的权限,你可以根据我们的插件或 api 来扩展你的监控。该服务已经支持 Nagios 的插件了。 #### 73. [OpenNMS][57] #### ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/opennms.jpg) -OpenNMS 主要有四个功能区:事件管理和通知;发现和配置;服务监控和数据收集。其设计可被在多种网络环境中定制。 +OpenNMS 主要有四个功能区:事件管理和通知;发现和配置;服务监控和数据收集。其设计为可被在多种网络环境中定制。 #### 74. [SysUsage][58] #### @@ -441,19 +441,19 @@ SysUsage 通过 Sar 和其他系统命令持续监控你的系统。一旦达到 ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/brainypdm.jpg) -brainypdm 是一个数据管理和监控工具,它能收集来自 nagios 或其它公共资源的数据并以图表显示。它是跨平台的,其基于 Web 并可自定义图形。 +brainypdm 是一个数据管理和监控工具,它能收集来自 nagios 或其它常规来源的数据并以图表显示。它是跨平台的,其基于 Web 并可自定义图形。 #### 76. [PCP][60] #### ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/pcp.jpg) -PCP 可以收集来自多个主机的指标,并且效率很高。它也有一个插件框架,所以你可以把它收集的对你很重要的指标使用插件来管理。你可以通过任何一个 Web 界面或 GUI 访问图形数据。它比较适合大型监控系统。 +PCP 可以收集来自多个主机的指标,并且效率很高。它也有一个插件框架,所以你可以让它收集对你很重要的指标。你可以通过任何一个 Web 界面或 GUI 访问图形数据。它比较适合大型监控系统。 -#### 77. [KDE 系统保护][61] #### +#### 77. [KDE 系统守护][61] #### ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/kdesystemguard.jpg) -这个工具既是一个系统监控器也是一个任务管理器。你可以通过工作表来查看多台机器的服务指标,如果一个进程需要被杀死或者你需要启动一个进程,它可以在 KDE 系统保护中来完成。 +这个工具既是一个系统监控器也是一个任务管理器。你可以通过工作表来查看多台机器的服务指标,如果需要杀死一个进程或者你需要启动一个进程,它可以在 KDE 系统守护中来完成。 #### 78. [Munin][62] #### @@ -471,7 +471,7 @@ Nagios 是系统和网络监控工具,可帮助你监控多台服务器。当 ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/zenoss.jpg) -Zenoss 提供了一个 Web 界面,使你可以监控所有的系统和网络指标。此外,它能自动发现网络资源和修改网络配置。并且会提醒你采取行动,它也支持 Nagios 的插件。 +Zenoss 提供了一个 Web 界面,使你可以监控所有的系统及网络指标。此外,它能自动发现网络资源和修改网络配置。并且会提醒你采取行动,它也支持 Nagios 的插件。 #### 81. [Cacti][65] #### @@ -483,7 +483,7 @@ Zenoss 提供了一个 Web 界面,使你可以监控所有的系统和网络 ![](https://serverdensity-wpengine.netdna-ssl.com/wp-content/uploads/2015/02/zabbix-monitoring.png) -Zabbix 是一个开源的基础设施监控解决方案。它使用了许多数据库来存放监控统计信息。其核心是用 C 语言编写,并在前端中使用 PHP。如果你不喜欢安装代理,Zabbix 可能是一个最好选择。 +Zabbix 是一个开源的基础设施监控解决方案。它使用了许多数据库来存放监控统计信息。其核心是用 C 语言编写,并在前端中使用 PHP。如果你不喜欢安装代理端,Zabbix 可能是一个最好选择。 ### 附加部分: ### @@ -491,15 +491,15 @@ Zabbix 是一个开源的基础设施监控解决方案。它使用了许多数 #### 83. [collectd][67] #### -Collectd 是一个 Unix 守护进程来收集所有的监控数据。它采用了模块化设计并使用插件来填补一些缺陷。这样能使 collectd 保持轻量级并可进行定制。 +Collectd 是一个 Unix 守护进程,用来收集所有的监控数据。它采用了模块化设计并使用插件来填补一些缺陷。这样能使 collectd 保持轻量级并可进行定制。 #### 84. [Observium][68] #### -Observium 是一个自动发现网络的监控平台,支持普通的硬件平台和操作系统。Observium 专注于提供一个优美,功能强大,简单直观的界面来显示网络的健康和状态。 +Observium 是一个自动发现网络的监控平台,支持大量硬件平台和操作系统。Observium 专注于提供一个优美、功能强大、简单直观的界面来显示网络的健康和状态。 #### 85. Nload #### -这是一个命令行工具来监控网络的吞吐量。它很整洁,因为它使用两个图表和其他一些有用的数据类似传输的数据总量来对进出站流量进行可视化。你可以使用如下方法安装它: +这是一个命令行工具来监控网络的吞吐量。它很整洁,因为它使用两个图表和其他一些类似传输的数据总量这样的有用数据来对进出站流量进行可视化。你可以使用如下方法安装它: yum install nload @@ -509,15 +509,15 @@ Observium 是一个自动发现网络的监控平台,支持普通的硬件平 #### 86. [SmokePing][69] #### -SmokePing 可以跟踪你网络延迟,并对他们进行可视化。SmokePing 有一个流行的延迟测量插件。如果图形用户界面对你来说非常重要,现在有一个正在开发中的插件来实现此功能。 +SmokePing 可以跟踪你网络延迟,并对他们进行可视化。有各种为 SmokePing 开发的延迟测量插件。如果图形用户界面对你来说非常重要,现在有一个正在开发中的插件来实现此功能。 #### 87. [MobaXterm][70] #### -如果你整天在 windows 环境下工作。你可能会觉得 Windows 下受终端窗口的限制。MobaXterm 正是由此而来的,它允许你使用多个在 Linux 中相似的终端。这将会极大地帮助你在监控方面的需求! +如果你整天在 windows 环境下工作。你可能会觉得 Windows 下终端窗口的限制。MobaXterm 正是由此而来的,它允许你使用多个通常出现在 Linux 中的命令。这将会极大地帮助你在监控方面的需求! #### 88. [Shinken monitoring][71] #### -Shinken 是一个监控框架,其是由 python 对 Nagios 进行完全重写的。它的目的是增强灵活性和管理更大环境。但仍保持所有的 nagios 配置和插件。 +Shinken 是一个监控框架,其是采用 python 对 Nagios 进行了完全重写。它的目的是增强灵活性和管理更大环境。但仍保持所有的 nagios 配置和插件。 -------------------------------------------------------------------------------- @@ -525,7 +525,7 @@ via: https://blog.serverdensity.com/80-linux-monitoring-tools-know/ 作者:[Jonathan Sundqvist][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 87408809307d007f635eb9c06ad734fbce103705 Mon Sep 17 00:00:00 2001 From: carolinewuyan <309866211@qq.com> Date: Mon, 8 Feb 2016 12:13:05 +0800 Subject: [PATCH 0294/1469] =?UTF-8?q?=E5=B7=B2=E6=A0=A1=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...lla with Apache and SSL on FreeBSD 10.2.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/translated/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md b/translated/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md index f709ba5582..784c7d03aa 100644 --- a/translated/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md +++ b/translated/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md @@ -1,8 +1,8 @@ -如何在FreeBSD 10.2上配置Apache和SSL并安装Bugzilla +在FreeBSD 10.2上如何通过配置Apache和SSL安装Bugzilla ================================================================================ -Bugzilla是一款bug跟踪系统和测试工具,它基于web且开源,由mozilla计划开发并由Mozilla公共许可证授权。它经常被一些高科技公司如mozilla、红帽公司和gnome使用。Bugzilla起初由Terry Weissman在1998年创立,它用perl语言编写,用MySQL作为后端数据库。它是一款旨在帮助管理软件开发的服务器软件,它功能丰富、高优化度的数据库、卓越的安全性、高级的搜索工具、整合邮件功能等等。 +Bugzilla是一款bug跟踪系统和测试工具,它基于web且开源,由mozilla计划开发并由Mozilla公共许可证授权。它经常被一些高科技公司如mozilla、红帽公司和gnome使用。Bugzilla起初由Terry Weissman在1998年创立,它用perl语言编写,用MySQL作为后端数据库。它是一款旨在帮助管理软件开发的服务器软件,它有丰富的功能、高优化度的数据库、卓越的安全性、高级的搜索工具、整合的邮件功能等等。 -在本教程中,我们将给web服务器安装bugzilla 5.0的apache并为它启用SSL,然后在freebsd 10.2上安装mysql 5.1来作为数据库系统。 +在本教程中,我们将给web服务器安装 bugzilla 5.0 的apache,并为它启用SSL,然后安装 mysql 5.1 来作为 freebsd 10.2 的数据库系统。 #### 准备 #### @@ -19,7 +19,7 @@ Bugzilla是一款bug跟踪系统和测试工具,它基于web且开源,由moz ### 第二步 - 安装并配置Apache ### -在这一步我们将从freebsd库中用pkg命令安装apache,然后在apache24目录下编辑"httpd.conf"文件,启用SSL和CGI支持。 +在这一步我们将使用pkg命令从freebsd库中安装apache,然后在apache24目录下编辑"httpd.conf"文件,启用SSL和CGI支持来配置apache。 用pkg命令安装apache: @@ -70,7 +70,7 @@ Bugzilla是一款bug跟踪系统和测试工具,它基于web且开源,由moz 保存并退出。 -在启用apache之前,用sysrc命令添加以下行来在引导的时候启动: +在启用apache之前,用sysrc命令添加以下行作为开机启动项: sysrc apache24_enable=yes service apache24 start @@ -81,7 +81,7 @@ Bugzilla是一款bug跟踪系统和测试工具,它基于web且开源,由moz pkg install p5-DBD-mysql51 mysql51-server mysql51-client -现在我们要在启动时添加mysql服务并启动,然后为mysql配置root密码。 +现在我们要添加mysql服务到开机启动,然后为mysql配置root密码。 运行以下命令来完成所有操作: @@ -209,19 +209,19 @@ bugzilla的数据库创建好了,名字为"bugzilladb",用户名和密码分 ./checksetup.pl -你会看到一条关于数据库配置错误,你得用nano编辑器编辑一下"localconfig"文件: +你会看到一条关于数据库配置错误的消息,你得用nano编辑器编辑一下"localconfig"文件: nano -c localconfig 现在添加第三步创建的数据库。 - #第五十七行 + #第57行 $db_name = 'bugzilladb'; - #第六十行 + #第60行 $db_user = 'bugzillauser'; - #第六十七行 + #第67行 $db_pass = 'bugzillauser@'; 保存并退出。 @@ -230,7 +230,7 @@ bugzilla的数据库创建好了,名字为"bugzilladb",用户名和密码分 ./checksetup.pl -你会收到输入邮箱名和管理员账号的提示,你只要输入你得邮箱、用户名和密码就行了。 +你会收到输入邮箱名和管理员账号的提示,你只要输入你的邮箱、用户名和密码就行了。 ![Admin Setup](http://blog.linoxide.com/wp-content/uploads/2015/12/Admin-Setup.png) @@ -252,7 +252,7 @@ Bugzilla admin面板: ### 结论 ### -Bugzilla是一个基于web并能帮助你管理软件开发的应用,它用perl开发并使用MySQL作为数据库系统。Bugzilla被mozilla,redhat,gnome等等公司用来帮助它们的软件开发工作。Bugzilla有很多功能并易于配置和安装。 +Bugzilla是一个基于web并能帮助你管理软件开发的应用,它用perl开发并使用MySQL作为数据库系统。Bugzilla帮助mozilla、redhat,gnome等公司完成软件开发工作。Bugzilla有很多功能并易于配置和安装。 -------------------------------------------------------------------------------- @@ -260,7 +260,7 @@ via: http://linoxide.com/tools/install-bugzilla-apache-ssl-freebsd-10-2/ 作者:[Arul][a] 译者:[ZTinoZ](https://github.com/ZTinoZ) -校对:[校对者ID](https://github.com/校对者ID) +校对:[Caroline](https://github.com/carolinewuyan) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ba22a3d4e504c0f7ecd7c9cb9ecc093c445ef3f1 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 8 Feb 2016 21:19:08 +0800 Subject: [PATCH 0295/1469] PUB:20151104 How to Install SQLite 3.9.1 with JSON Support on Ubuntu 15.04 @oska874 --- ...3.9.1 with JSON Support on Ubuntu 15.04.md | 44 ++++++++++--------- 1 file changed, 23 insertions(+), 21 deletions(-) rename {translated/tech => published}/20151104 How to Install SQLite 3.9.1 with JSON Support on Ubuntu 15.04.md (55%) diff --git a/translated/tech/20151104 How to Install SQLite 3.9.1 with JSON Support on Ubuntu 15.04.md b/published/20151104 How to Install SQLite 3.9.1 with JSON Support on Ubuntu 15.04.md similarity index 55% rename from translated/tech/20151104 How to Install SQLite 3.9.1 with JSON Support on Ubuntu 15.04.md rename to published/20151104 How to Install SQLite 3.9.1 with JSON Support on Ubuntu 15.04.md index b79dc3657e..fcb65c6344 100644 --- a/translated/tech/20151104 How to Install SQLite 3.9.1 with JSON Support on Ubuntu 15.04.md +++ b/published/20151104 How to Install SQLite 3.9.1 with JSON Support on Ubuntu 15.04.md @@ -1,57 +1,58 @@ -如何在Ubuntu 15.04 上安装带JSON 支持的SQLite 3.9.1 +如何在 Ubuntu 15.04 上安装带 JSON 支持的 SQLite 3.9.1 ================================================================================ -欢迎阅读我们关于SQLite 的文章,SQLite 是当今时间上使用最广泛的SQL 数据库引擎,它他基本不需要配置,不需要安装或者管理就可以运行。SQLite 是一个是开放领域的软件,是关系数据库的管理系统,或者说RDBMS,用来在大表存储用户定义的记录。对于数据存储和管理来说,数据库引擎要处理复杂的查询命令,这些命令可能会从多个表获取数据然后生成报告的数据总结。 +欢迎阅读我们关于SQLite 的文章,SQLite 是当今世界上使用最广泛的 SQL 数据库引擎,它基本不需要配置,不需要设置或管理就可以运行。SQLite 是一个是开放领域(public-domain)的软件,是一个关系型数据库管理系统(RDBMS),用来在一个大数据表中存储用户定义的记录。对于数据存储和管理来说,数据库引擎要处理复杂的查询命令,这些命令可能会从多个表获取数据然后生成报告和数据总结。 -SQLite 是一个非常小、轻量级,不需要分离的服务进程或系统。他可以运行在UNIX,Linux,Mac OS-X,Android,iOS 和Windows 上,已经被大量的软件程序使用,如Opera, Ruby On Rails, Adobe System, Mozilla Firefox, Google Chrome 和 Skype。 +SQLite 是一个非常小、轻量级,不需要独立的服务进程或系统。它可以运行在 UNIX,Linux,Mac OS-X,Android,iOS 和 Windows 上,已经被大量的软件程序使用,如 Opera, Ruby On Rails, Adobe System, Mozilla Firefox, Google Chrome 和 Skype。 ### 1) 基本需求: ### -在几乎全部支持SQLite 的平台上安装SQLite 基本上没有复杂的要求。 +在绝大部分支持 SQLite 的平台上安装 SQLite 基本上并没有复杂的要求。 -所以让我们在CLI 或者Secure Shell 上使用sudo 或者root 权限登录Ubuntu 服务器。然后更新系统,这样子就可以让操作系统的软件更新到新版本。 +让我们在 CLI 或者 Secure Shell 上使用 sudo 或者 root 权限登录 Ubuntu 服务器。然后更新系统,这样子就可以让操作系统的软件更新到新版本。 -在Ubuntu 上,下面的命令是用来更新系统的软件源的。 +在 Ubuntu 上,使用如下的命令来更新系统的软件源。 # apt-get update -如果你要在新安装的Ubuntu 上部署SQLite,那么你需要安装一些基础的系统管理工具,如wget, make, unzip, gcc。 +如果你要在新安装的 Ubuntu 上部署 SQLite,那么你需要安装一些基础的系统管理工具,如 wget, make, unzip, gcc。 -要安装wget,可以使用下面的命令,然后输入Y 如果系统提示的话: +要安装 wget,可以使用下面的命令,如果系统提示的话,输入 Y : # apt-get install wget make gcc ### 2) 下载 SQLite ### -要下载SQLite 最好是在[SQLite 官网][1]下载,如下所示 +要下载 SQLite ,最好是在 [SQLite 官网][1]下载,如下所示 ![SQLite download](http://blog.linoxide.com/wp-content/uploads/2015/10/Selection_014.png) -你也可以直接复制资源的连接然后再命令行使用wget 下载,如下所示: +你也可以直接复制资源的连接然后在命令行使用 wget 下载,如下所示: # wget https://www.sqlite.org/2015/sqlite-autoconf-3090100.tar.gz ![wget SQLite](http://blog.linoxide.com/wp-content/uploads/2015/10/23.png) -下载完成之后,解压缩安装包,切换工作目录到解压缩后的SQLite 目录,使用下面的命令。 +下载完成之后,解压缩安装包,切换工作目录到解压缩后的 SQLite 目录,使用下面的命令。 # tar -zxvf sqlite-autoconf-3090100.tar.gz ### 3) 安装 SQLite ### -现在我们要开始安装、配置刚才下载的SQLite。所以在Ubuntu 上编译、安装SQLite,运行配置脚本。 +现在我们要开始安装、配置刚才下载的 SQLite。在 Ubuntu 上编译、安装 SQLite,运行配置脚本: root@ubuntu-15:~/sqlite-autoconf-3090100# ./configure –prefix=/usr/local ![SQLite Installation](http://blog.linoxide.com/wp-content/uploads/2015/10/35.png) -配置要上面的prefix 之后,运行下面的命令编译安装包。 - - root@ubuntu-15:~/sqlite-autoconf-3090100# make +配置要上面的安装位置前缀(prefix)之后,运行下面的命令编译安装包。 +``` +root@ubuntu-15:~/sqlite-autoconf-3090100# make source='sqlite3.c' object='sqlite3.lo' libtool=yes \ DEPDIR=.deps depmode=none /bin/bash ./depcomp \ /bin/bash ./libtool --tag=CC --mode=compile gcc -DPACKAGE_NAME=\"sqlite\" -DPACKAGE_TARNAME=\"sqlite\" -DPACKAGE_VERSION=\"3.9.1\" -DPACKAGE_STRING=\"sqlite\ 3.9.1\" -DPACKAGE_BUGREPORT=\"http://www.sqlite.org\" -DPACKAGE_URL=\"\" -DPACKAGE=\"sqlite\" -DVERSION=\"3.9.1\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_FDATASYNC=1 -DHAVE_USLEEP=1 -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DHAVE_DECL_STRERROR_R=1 -DHAVE_STRERROR_R=1 -DHAVE_POSIX_FALLOCATE=1 -I. -D_REENTRANT=1 -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE -g -O2 -c -o sqlite3.lo sqlite3.c +``` -运行完上面的命令之后,要在Ubuntu 上完成SQLite 的安装得运行下面的命令。 +运行完上面的命令之后,要在 Ubuntu 上完成 SQLite 的安装得运行下面的命令。 # make install @@ -59,7 +60,7 @@ DEPDIR=.deps depmode=none /bin/bash ./depcomp \ ### 4) 测试 SQLite 安装 ### -要保证SQLite 3.9 安装成功了,运行下面的命令。 +要保证 SQLite 3.9 安装成功了,运行下面的命令。 # sqlite3 @@ -77,7 +78,7 @@ SQLite 很容易上手。要获得详细的使用方法,在SQLite 控制台里 ![SQLite Help](http://blog.linoxide.com/wp-content/uploads/2015/10/62.png) -现在开始最后一部分,使用一点SQLite 命令创建数据库。 +现在开始最后一部分,使用一点 SQLite 命令创建数据库。 要创建一个新的数据库需要运行下面的命令。 @@ -103,17 +104,18 @@ SQLite 很容易上手。要获得详细的使用方法,在SQLite 控制台里 sqlite> .exit ![Using SQLite3](http://blog.linoxide.com/wp-content/uploads/2015/10/73.png) + ### 结论 ### -通过本文你可以了解如果安装支持JSON1 的最新版的SQLite,SQLite 从3.9.0 开始支持JSON1。这是一个非常棒的库,可以用来获取内嵌到应用程序,利用它可以很有效而且很轻量的管理资源。我们希望你能觉得本文有所帮助,请自由的像我们反馈你遇到的问题和困难。 +通过本文你可以了解如果安装支持 JSON1 的最新版的 SQLite,SQLite 从 3.9.0 开始支持 JSON1。这是一个非常棒的库,可以内嵌到应用程序,利用它可以很有效而轻量的管理资源。我们希望你能觉得本文有所帮助,请随意地向我们反馈你遇到的问题和困难。 -------------------------------------------------------------------------------- via: http://linoxide.com/ubuntu-how-to/install-sqlite-json-ubuntu-15-04/ 作者:[Kashif Siddique][a] -译者:[译者ID](https://github.com/oska874) -校对:[校对者ID](https://github.com/校对者ID) +译者:[oska874](https://github.com/oska874) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 5da8a2a2cf4138694e11c3604a854ebe8edc6a4d Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 12 Feb 2016 10:35:48 +0800 Subject: [PATCH 0296/1469] PUB:20151119 How to Install Revive Adserver on Ubuntu 15.04 or CentOS 7 @chisper --- ...ve Adserver on Ubuntu 15.04 or CentOS 7.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) rename {translated/tech => published}/20151119 How to Install Revive Adserver on Ubuntu 15.04 or CentOS 7.md (88%) diff --git a/translated/tech/20151119 How to Install Revive Adserver on Ubuntu 15.04 or CentOS 7.md b/published/20151119 How to Install Revive Adserver on Ubuntu 15.04 or CentOS 7.md similarity index 88% rename from translated/tech/20151119 How to Install Revive Adserver on Ubuntu 15.04 or CentOS 7.md rename to published/20151119 How to Install Revive Adserver on Ubuntu 15.04 or CentOS 7.md index 25bea6cf72..c7f5a5d71f 100644 --- a/translated/tech/20151119 How to Install Revive Adserver on Ubuntu 15.04 or CentOS 7.md +++ b/published/20151119 How to Install Revive Adserver on Ubuntu 15.04 or CentOS 7.md @@ -1,10 +1,10 @@ -在Ubuntu 15.04 / CentOS 7上安装Revive Adserver +在 Ubuntu 15.04 / CentOS 7 上安装广告服务器 Revive Adserver ================================================================================ -Revive Adserver是一个免费且开源的广告管理系统,能使出版商,广告平台和广告商把广告投放在网页,应用,视频上并且管理的系统。Revive Adserver又名OpenX,遵循GNU通用公共授权协议。它集广告管理、网站定位、地理定位和跟踪系统于一体 -,用于数据收集。能使网站站长管理内部,付费以及第三方来源的广告,如谷歌的AdSense。本教程中,将会教会你在Ubuntu 15.04或CentOS 7安装并运行Revive Adserver。 +Revive Adserver是一个自由开源的广告管理系统,能使出版商,广告平台和广告商在网页、应用、视频上投放并管理广告的系统。Revive Adserver以前叫做OpenX Source,遵循GNU通用公共授权协议。它集广告管理、网站定位、地理定位和一个用于数据收集的跟踪系统于一体。能使网站站长管理内部的、付费的以及第三方来源的广告,如谷歌的AdSense。本教程中,将会教会你在Ubuntu 15.04或CentOS 7安装并运行Revive Adserver。 + ### 1. 安装LAMP### -首先,Revive Adserver需要完整的LAMP环境才能运行,所以我们先安装LAMP。LAMP是Apache网页服务器,MySQL/MariaDB数据库和PHP模块的集合。要使Revive正常运行,需要安装PHP的众多模块,如apc,zlib,xml,pcre,mysql和mbstring。在不同的Linux发行版中,我们可以用下列命令进行LAMP的配置: +首先,Revive Adserver需要完整的LAMP环境才能运行,所以我们先安装LAMP。LAMP是Apache网页服务器,MySQL/MariaDB数据库和PHP模块的集合。要使Revive正常运行,需要安装PHP的众多模块,如apc, zlib, xml, pcre, mysql和mbstring。在不同的Linux发行版中,我们可以用下列命令进行LAMP的配置: #### 在Ubuntu 15.04下#### @@ -78,7 +78,8 @@ CentOS 7同样是以Systemd作为默认初始系统,可以用下列命令启 ![Configuring MariaDB](http://blog.linoxide.com/wp-content/uploads/2015/11/configuring-mariadb.png) ### 4. 创建新的数据库 ### -为MariaDB的root用户设置了密码之后,就可以创建用来储存Revive Adserver应用数据的数据库。首先通过以下命令登陆MariaDB控制台: + +为MariaDB的root用户设置了密码之后,就可以创建用来储存Revive Adserver应用数据的数据库。首先通过以下命令登录MariaDB控制台: # mysql -u root -p @@ -142,6 +143,7 @@ CentOS 7同样是以Systemd作为默认初始系统,可以用下列命令启 ![Configuring Apache2 Ubuntu](http://blog.linoxide.com/wp-content/uploads/2015/11/configuring-apache2-ubuntu.png) + 保存并退出,重启Apache Web服务: # systemctl restart apache2 @@ -174,8 +176,8 @@ CentOS 7同样是以Systemd作为默认初始系统,可以用下列命令启 # systemctl restart httpd ### 7. 修复权限和所有权 - -现在我们修改安装路径下文件的权限和所有权。把安装目录的所有权改成Apache进程所有以便Apache Web服务有文件和目录的编辑,创建和删除的完全权限。 + +现在我们修改安装路径下文件的权限和所有权。把安装目录的所有权改成Apache进程所有,以便Apache Web服务有文件和目录的编辑、创建和删除的完全权限。 #### 在Ubuntu 15.04下#### @@ -202,7 +204,7 @@ Ubuntu15.04/CentOS 7都使用Systemd作为默认初始系统,使用firewalld success ### 9. 网站的安装 - + 顺利的话我们能够使用浏览器进行交互,并可以将浏览器指向正在运行的网络服务器。只要在浏览器输入http://ip-address/ 或者 http://domain.com 。这里我们要访问 http://reviveads.linoxide.com/ 打开后可以看到Revive Adserver的欢迎页面,上面还有作为它发行许可证的GNU通用公共许可证V2。点击 I agree 继续下一步安装。 @@ -216,11 +218,9 @@ Ubuntu15.04/CentOS 7都使用Systemd作为默认初始系统,使用firewalld 接着,转到Adverstiser页面,添加新的广告管理。在控制界面添加新用户到adserver,为广告库户添加标题,网页,视频 广告。 - ### 总结 ### -本文中,我们学习了如何在Ubuntu 15.04和CentOS 7上安装并配置Revive Adserver。尽管Revive Adserver的原始代码是从OpenX那买的,但现在它们已经完全分开了。可以从[http://www.adserverplugins.com/][2] 获得更多插件来扩展新特性。讲真,这个软件确实让网页,应用,视频上的广告管理变得容易了许多。 - +本文中,我们学习了如何在Ubuntu 15.04和CentOS 7上安装并配置Revive Adserver。尽管Revive Adserver的原始代码是从OpenX那买的,但现在OpenX Enterprise和Revive Adserver已经完全分开了。可以从[http://www.adserverplugins.com/][2] 获得更多插件来扩展新特性。讲真,这个软件确实让网页,应用,视频上的广告管理变得容易了许多。 -------------------------------------------------------------------------------- @@ -228,7 +228,7 @@ via: http://linoxide.com/linux-how-to/install-revive-adserver-ubuntu-15-04-cento 作者:[Arun Pyasi][a] 译者:[chisper](https://github.com/chisper) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 615e2fa7b90d13a2d845870ae2ce85569010d677 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 12 Feb 2016 11:35:35 +0800 Subject: [PATCH 0297/1469] PUB:20150818 A Linux User Using Windows 10 After More than 8 Years--See Comparison @name1e5s --- ...After More than 8 Years--See Comparison.md | 345 ++++++++++++++++++ ...After More than 8 Years--See Comparison.md | 344 ----------------- 2 files changed, 345 insertions(+), 344 deletions(-) create mode 100644 published/20150818 A Linux User Using Windows 10 After More than 8 Years--See Comparison.md delete mode 100644 translated/talk/20150818 A Linux User Using Windows 10 After More than 8 Years--See Comparison.md diff --git a/published/20150818 A Linux User Using Windows 10 After More than 8 Years--See Comparison.md b/published/20150818 A Linux User Using Windows 10 After More than 8 Years--See Comparison.md new file mode 100644 index 0000000000..21e8fcb748 --- /dev/null +++ b/published/20150818 A Linux User Using Windows 10 After More than 8 Years--See Comparison.md @@ -0,0 +1,345 @@ +一个八年的 Linux 老用户使用 Windows 10 的体验 +========================================================== + +Windows 10 是2015年7月29日上市的最新一代 Windows NT 系列系统,它是 Windows 8.1 的继任者。Windows 10 支持 Intel 32位平台,AMD64 以及 ARM v7 处理器。 + +![Windows 10 and Linux Comparison](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-10-vs-Linux.jpg) + +*对比:Windows 10与Linux* + +作为一个连续使用 linux 超过8年的用户,我想要去体验一下 Windows 10 ,因为有很多关于它的消息。这篇文章是我观察力的一个重大突破。我将从一个 linux 用户的角度去看待一切,所以这篇文章可能会有些偏向于 linux。尽管如此,本文也绝对不会有任何虚假信息。 + +1、用谷歌搜索“download Windows 10”并且点击第一个链接。 + +![Search Windows 10](http://www.tecmint.com/wp-content/uploads/2015/08/Search-Windows-10.jpg) + +*搜索 Windows 10* + +你也可以直接打开: [https://www.microsoft.com/en_us/software-download/Windows10[1] + +2、微软要求我从 Windows 10, Windows 10 KN, Windows 10 N 和 Windows 10 单语言版中选择一个版本。 + +![Select Windows 10 Edition](http://www.tecmint.com/wp-content/uploads/2015/08/Select-Windows-10-Edition.jpg) + +*选择版本* + +以下是各个版本的简略信息: + +- Windows 10 - 包含微软提供给我们的所有软件 +- Windows 10N - 此版本不包含媒体播放器 +- Windows 10KN - 此版本没有媒体播放能力 +- Windows 10 单语言版 - 仅预装一种语言 + +3、我选择了第一个选项“Windows 10”并且单击“确认”。之后我要选择语言,我选择了“英语”。 + +微软给我提供了两个下载链接。一个是32位版,另一个是64位版。我单击了64位版--这与我的电脑架构相同。 + +![Download Windows 10](http://www.tecmint.com/wp-content/uploads/2015/08/Download-Windows-10.jpg) + +*下载 Windows 10* + +我的带宽是15M的,下载了整整3个小时。不幸的是微软没有提供系统的种子文件,否则整个过程会更加舒畅。镜像大小为 3.8 GB(LCTT译者注:就我的10M小水管,我使用迅雷下载用时50分钟)。 + +我找不到更小的镜像,微软并没有为 Windows 提供网络安装镜像。我也没有办法在下载完成后去校验哈希值。(LCTT 译注:你知道的,这对于 Linux 来说都是常识了) + +我十分惊讶,Windows 在这样的问题上居然如此漫不经心。为了验证这个镜像是否正确下载,我需要把它刻到光盘上或者复制到我的U盘上然后启动它,一直静静的看着它安装直到安装完成。 + +首先,我用 dd 命令将 win10 的 iso 镜像刻录到U盘上。 + + # dd if=/home/avi/Downloads/Win10_English_x64.iso of=/dev/sdb1 bs=512M; sync + +这需要一点时间。在此之后我重启系统并在 UEFI(BIOS)设置中选择从我的U盘启动。 + +#### 系统要求 #### + +升级 + +- 仅支持从 Windows 7 SP1 或者 Windows 8.1 升级 + +全新安装 + +- 处理器: 1GHz 以上 +- 内存: 1GB以上(32位),2GB以上(64位) +- 硬盘: 16GB以上(32位),20GB以上(64位) +- 显卡: 支持DirectX 9或更新 + WDDM 1.0 驱动 + +###Windows 10 安装过程### + +1、Windows 10启动成功了。他们又换了logo,但是仍然没有信息提示我它正在做什么。 + +![Windows 10 Logo](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-10-Logo.jpg) + +*Windows 10 Logo* + +2、选择安装语言,时区,键盘,输入法,点击下一步。 + +![Select Language and Time](http://www.tecmint.com/wp-content/uploads/2015/08/Select-Language-and-Time.jpg) + +*选择语言和时区* + +3、点击“现在安装”。 + +![Install Windows 10](http://www.tecmint.com/wp-content/uploads/2015/08/Install-Windows-10.jpg) + +*安装Windows 10* + +4、下一步是输入密钥,我点击了“跳过”。 + +![Windows 10 Product Key](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-10-Product-Key.jpg) + +*Windows 10 产品密钥* + +5、从列表中选择一个系统版本。我选择了 Windows 10专业版。 + +![Select Install Operating System](http://www.tecmint.com/wp-content/uploads/2015/08/Select-Install-Operating-System.jpg) + +*选择系统版本* + +6、到了协议部分,选中"我接受"然后点击下一步。 + +![Accept License](http://www.tecmint.com/wp-content/uploads/2015/08/Accept-License.jpg) + +*同意协议* + +7、下一步是选择(从 Windows 的老版本)升级到 Windows 10 或者安装 Windows。我搞不懂为什么微软要让我自己选择:“安装Windows”被微软建议为“高级”选项。但是我还是选择了“安装Windows”。 + +![Select Installation Type](http://www.tecmint.com/wp-content/uploads/2015/08/Select-Installation-Type.jpg) + +*选择安装类型* + +8、选择驱动器,点击“下一步”。 + +![Select Install Drive](http://www.tecmint.com/wp-content/uploads/2015/08/Select-Install-Drive.jpg) + +*选择安装盘* + +9、安装程序开始复制文件,准备文件,安装更新,之后进行收尾。如果安装程序能在安装时输出一堆字符来表示它在做什么就更好了。 + +![Installing Windows](http://www.tecmint.com/wp-content/uploads/2015/08/Installing-Windows.jpg) + +*安装 Windows* + +10、在此之后 Windows 重启了。它们说要继续的话,我们需要重启。 + +![Windows Installation Process](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-Installation-Process.jpg) + +*安装进程* + +11、我看到了一个写着“正在准备 Windows”的界面。它停了整整五分多钟!仍然没有说明它正在做什么。没有输出。 + +![Windows Getting Ready](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-Getting-Ready.jpg) + +*正在准备 Windows* + +12、又到了输入产品密钥的时间。我点击了“以后再说”,并使用快速设置。 + +![Enter Product Key](http://www.tecmint.com/wp-content/uploads/2015/08/Enter-Product-Key.jpg) + +*输入产品密钥* + +![Select Express Settings](http://www.tecmint.com/wp-content/uploads/2015/08/Select-Express-Settings.jpg) + +*使用快速设置* + +13、又出现了三个界面,作为 Linux 用户我认为此处应有信息来告诉我安装程序在做什么,但是我想多了。 + +![Loading Windows](http://www.tecmint.com/wp-content/uploads/2015/08/Loading-Windows.jpg) + +*载入 Windows* + +![Getting Updates](http://www.tecmint.com/wp-content/uploads/2015/08/Getting-Updates.jpg) + +*获取更新* + +![Still Loading Windows](http://www.tecmint.com/wp-content/uploads/2015/08/Still-Loading-Windows.jpg) + +*还是载入 Windows* + +14、安装程序想要知道谁拥有这台机器,“我的组织”或者我自己。选择我自己并继续。 + +![Select Organization](http://www.tecmint.com/wp-content/uploads/2015/08/Select-Organization.jpg) + +*选择组织* + +15、在单击继续之前,安装程序提示我加入“Aruze Ad”或者“加入域”。我选择了后者。 + +![Connect Windows](http://www.tecmint.com/wp-content/uploads/2015/08/Connect-Windows.jpg) + +*连接网络* + +16、安装程序让我新建一个账户。所以我输入了“user_name”就点击了下一步,我觉得我会收到一个要求我必须输入密码的信息。 + +![Create Account](http://www.tecmint.com/wp-content/uploads/2015/08/Create-Account.jpg) + +*新建账户* + +17、让我惊讶的是 Windows 甚至都没有显示一个警告或提示信息,告诉我必须创建密码。真粗心。不管怎样,现在我可以体验系统了。 + +![Windows 10 Desktop](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-10-Desktop.jpg) + +*Windows 10的桌面环境* + +#### Linux 用户(我)直到现在的体验 #### + +- 没有网络安装镜像 +- 镜像文件太臃肿了 +- 没有验证 iso 是否为正确的方法(官方没有提供哈希值) +- 启动与安装方式仍然与 XP,Win 7,Win 8 相同(可能吧...) +- 和以前一样,安装程序没有输出它正在干什么 - 正在复制什么和正在安装什么软件包 +- 安装程序比 Linux 发行版的更加傻瓜和简单 + +####测试 Windows 10#### + +18、默认桌面很干净,上面只有一个回收站图标。我们可以直接从桌面搜索网络。底部的快捷方式分别是任务预览、网络、微软应用商店。和以前的版本一样,消息栏在右下角。 + +![ ](http://www.tecmint.com/wp-content/uploads/2015/08/Deskop-Shortcut-icons.jpg) + +*桌面图标* + +19、IE 浏览器被换成了 Edge 浏览器。微软把他们的老IE换成了 Edge (斯巴达计划) + +![Microsoft Edge Browser](http://www.tecmint.com/wp-content/uploads/2015/08/Edge-browser.jpg) + +*Edge 浏览器* + +测试起来,这个浏览器至少比 IE 要快。他们有相同的用户界面。它的主页包含新闻更新。它还有一个搜索标题栏是“下一步怎么走”。由于浏览器的全面性能提升,它的加载速度非常快。Edge 的内存占用看起来正常。 + +![Windows Performance](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-Performance.jpg) + +*性能* + +Edge 也有小娜加成(智能个人助理)、支持 Chrome 扩展、支持笔记(在浏览网页时记笔记)、分享(在选项卡上右击而不必打开其他选项卡) + +#### Linux 用户(我)此时体验 #### + +20、微软确实提升了网页浏览体验。我绝对稳定性和质量还好。现在它并不落后。 + +21、对我来说,Edge 的内存占用不算太大。但是有很多用户抱怨它的内存占用太多。 + +22、很难说目前 Edge 已经准备好了与火狐或 Chrome竞争。让我们静观其变。 + +#### 更多的视觉体验 #### + +23、重新设计的开始菜单 -- 看起来很简洁高效。Merto 磁贴大部分都会动。预先放置了最通用的应用。 + +![Windows Look and Feel](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-Look.jpg) + +*Windows* + +而在 Linux 的 Gnome 桌面环境下。我仅仅需要按下 Win 键并输入应用名就可以搜索应用。 + +![Search Within Desktop](http://www.tecmint.com/wp-content/uploads/2015/08/Search-Within-Desktop.jpg) + +*桌面内进行搜索* + +24、文件浏览器 -- 设计的很简洁。左边是进入文件夹的快捷方式。 + +![Windows File Explorer](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-File-Explorer.jpg) + +*Windows 文件管理器* + +我们的 Gnome 下的文件管理也同样的简洁高效。从图标上移走了不需要的图形图像是个加分点。 + +![File Browser on Gnome](http://www.tecmint.com/wp-content/uploads/2015/08/File-Browser.jpg) + +*Gnome 的文件管理* + +25、设置 -- 尽管 Windows 10的设置有点精炼,但是我们还是可以把它与 linux 的设置进行对比。 + +**Windows 的设置** + +![Windows 10 Settings](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-10-Settings.jpg) + +*Windows 10 设置* + +**Linux Gnome 上的设置** + +![Gnome Settings](http://www.tecmint.com/wp-content/uploads/2015/08/Gnome-Settings.jpg) + +*Gnome 的设置* + +26、应用列表 -- 目前,Linux上的应用列表要好于之前的版本(据我所记,那时我还是一个普通的 Windows 用户),但是 Windows 10 的还比 Gnome 3 的差一点。 + +**Windows 的应用列表** + +![Application List on Windows 10](http://www.tecmint.com/wp-content/uploads/2015/08/Application-List-on-Windows-10.jpg) + +*Windows 10 的应用列表* + +**Gnome3 的应用列表** + +![Gnome Application List on Linux](http://www.tecmint.com/wp-content/uploads/2015/08/Gnome-Application-List-on-Linux.jpg) + +*Gnome3 的应用列表* + +27、虚拟桌面 -- Windows 10 上的虚拟桌面是近来被提及最多的特性之一。 + +这是 Windows 10 上的虚拟桌面。 + +![Windows Virtual Desktop](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-Virtual-Desktop.jpg) + +*Windows 的虚拟桌面* + +这是我们 Linux 用户使用了超过20年的虚拟桌面。 + +![Virtual Desktop on Linux](http://www.tecmint.com/wp-content/uploads/2015/08/Virtual-Desktop-on-Linux.jpg) + +*Linux 的虚拟桌面* + +#### Windows 10 的其他新特性 #### + +28、Windows 10 自带 wifi 感知。它会把你的 wifi 密码分享给他人。任何在你 wifi 范围内并且曾经通过 Skype, Outlook, Hotmail 或 Facebook与你联系的人都能够获得你的网络接入权。这个特性的本意是让用户可以省时省力的连接网络。 + +在微软对于 Tecmint 的问题的回答中,他们说道 -- 用户需要在每次到一个新的网络环境时自己去同意打开 wifi 感知。如果我们考虑到网络安全这将是很不安全的一件事。微软的说法并没有说服我。 + +29、从 Windows 7 和 Windows 8.1 升级可以省下买新版的花费。(家庭版 $119 专业版$199) + +30、微软发布了第一个累积更新,这个更新在一小部分设备上会让系统一直重启。Windows可能不知道这个问题或者不知道它发生的原因。 + +31、微软内建的“禁用/隐藏我不想要的更新”的功能在我这不起作用。这意味着一旦更新开始推送,你没有方法去禁用/隐藏他们。对不住啦,Windows 用户。 + +#### Windows 10 包含的来源于 Linux 的功能 #### + +Windows 10 有很多直接取自 Linux 的功能。如果 Linux 不以 GPL 发布的话,也许以下这些功能永远不会出现在 Windows上。 + +32、命令行的包管理器 -- 是的,你没有听错!Windows 10内建了一个包管理器。它只在 Power Shell 下工作。OneGet 是Windows 的官方包管理器。 + +![Windows 10 Package Manager](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-10-Package-Manager.jpg) + +*Windows 10的包管理器* + +- 无边窗口 +- 扁平化图标 +- 虚拟桌面 +- 离线/在线搜索一体化 +- 手机/桌面系统融合 + +### 总体印象### + +- 响应速度提升 +- 动画很好看 +- 资源占用少 +- 电池续航提升 +- Edge 浏览器很稳定 +- 支持树莓派 2 +- Windows 10 好的原因是 Windows 8/8.1 没有达到公众预期并且坏的可以 +- 旧瓶装新酒:Windows 10基本上就是以前的那一套换上新的图标 + +测试后我对 Windows 10 的评价是:Windows 10 在视觉和感觉上做了一些更新(就如同 Windows 经常做的那样)。我要为斯巴达计划、虚拟桌面、命令行包管理器、整合在线/离线搜索的搜索栏点赞。这确实是一个更新后的产品 ,但是认为 Windows 10 将是 Linux 的最后一个棺材钉的人错了。 + +Linux 走在 Windows 前面。它们的做事方法并不相同。在以后的一段时间里 Windows 不会站到 Linux这一旁。也没有什么让 Linux 用户值得去使用 Windows 10。 + +这就是我要说的。希望你喜欢本文。如果你们喜欢本篇文章我会再写一些你们喜欢读的有趣的文章。在下方留下你的有价值的评论。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/a-linux-user-using-Windows-10-after-more-than-8-years-see-comparison/ + +作者:[Avishek Kumar][a] +译者:[name1e5s](https://github.com/name1e5s) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:https://www.microsoft.com/en-us/software-download/Windows10ISO diff --git a/translated/talk/20150818 A Linux User Using Windows 10 After More than 8 Years--See Comparison.md b/translated/talk/20150818 A Linux User Using Windows 10 After More than 8 Years--See Comparison.md deleted file mode 100644 index 6f821f777d..0000000000 --- a/translated/talk/20150818 A Linux User Using Windows 10 After More than 8 Years--See Comparison.md +++ /dev/null @@ -1,344 +0,0 @@ -对比Windows 10与Linux:Linux用户已经使用'Windows 10'超过8年 -============================================================================================================================================================== -Windows 10 是2015年7月29日上市的最新一代Windows NT系列系统,Windows 8.1 的继任者.Windows 10 支持Intel 32位平台,AMD64以及ARM v7处理器. - -![Windows 10 and Linux Comparison](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-10-vs-Linux.jpg) - -对比:Windows 10与Linux - -作为一个连续使用linux超过8年的用户,我想要去测试Windows 10 ,因为它最近制造了很多新闻.这篇文章是我观察力的一个重大突破.我将从一个linux用户的角度去看待一切,所以这篇文章可能会有些偏向于linux.尽管如此,本文也应该不会有任何错误信息. - -1. 用谷歌搜索"download Windows 10" 并且点击第一个链接. - -![Search Windows 10](http://www.tecmint.com/wp-content/uploads/2015/08/Search-Windows-10.jpg) - -搜索Windows 10 - -你也可以直接打开: [https://www.microsoft.com/en_us/software-download/Windows10[1] - -2. 微软要求我从Windows 10, Windows 10 KN, Windows 10 N 和Windows 10 单语言版中选择一个版本 - -![Select Windows 10 Edition](http://www.tecmint.com/wp-content/uploads/2015/08/Select-Windows-10-Edition.jpg) - -选择版本 - -以下是各个版本的简略信息: - -- Windows 10 - 包含微软提供给我们的所有软件 -- Windows 10N - 此版本不包含媒体播放器 -- Windows 10KN - 此版本没有媒体播放能力 -- Windows 10单语言版 - 仅预装一种语言 - -3. 我选择了第一个选项 " Windows 10"并且单击"确认".之后我要选择语言,我选择了"英语" - -微软给我提供了两个下载链接.一个是32位版,另一个是64位版.我单击了64位版--这与我的电脑架构相同. - -![Download Windows 10](http://www.tecmint.com/wp-content/uploads/2015/08/Download-Windows-10.jpg) - -下载Windows 10 - -我的带宽是15M的,下载了整整3个小时.不幸的是微软没有提供系统的种子文件,否则整个过程会更加舒畅.镜像大小为 3.8 GB(译者注:就我的10M小水管,我使用迅雷下载用时50分钟). - -我找不到更小的镜像,微软并没有为Windows提供网络安装镜像.我也没有办法在下载完成后去校验哈希值. - -我十分惊讶,Windows在这样的问题上居然如此漫不经心.为了验证这个镜像是否正确下载,我需要把它刻到光盘上或者复制到我的U盘上然后启动它,一直静静的看着它安装直到安装完成. - -首先,我用dd命令将win10的iso镜像刻录到U盘上 - - # dd if=/home/avi/Downloads/Win10_English_x64.iso of=/dev/sdb1 bs=512M; sync - -这需要一点时间.在此之后我重启系统并在UEFI(BIOS)设置中选择从我的U盘启动. - -#### 系统要求 #### - -升级 - -- 仅支持从Windows 7 SP1或者Windows 8.1升级 - -重新安装 - -- 处理器: 1GHz 以上 -- 内存: 1GB以上(32位),2GB以上(64位) -- 硬盘: 16GB以上(32位),20GB以上(64位) -- 显卡: 支持DirectX 9或更新 + WDDM 1.0 驱动 - -###Windows 10 安装过程### - -1. Windows 10启动成功了.他们又换了logo,但是仍然没有信息提示我它正在做什么. - -![Windows 10 Logo](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-10-Logo.jpg) - -Windows 10 Logo - -2. 选择安装语言,时区,键盘,输入法,点击下一步 - -![Select Language and Time](http://www.tecmint.com/wp-content/uploads/2015/08/Select-Language-and-Time.jpg) - -选择语言和时区 - -3. 点击'现在安装' - -![Install Windows 10](http://www.tecmint.com/wp-content/uploads/2015/08/Install-Windows-10.jpg) - -安装Windows 10 - -4. 下一步是输入密钥,我点击了跳过 - -![Windows 10 Product Key](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-10-Product-Key.jpg) - -Windows 10 产品密钥 - -5. 从列表中选择一个系统版本.我选择了Windows 10专业版 - -![Select Install Operating System](http://www.tecmint.com/wp-content/uploads/2015/08/Select-Install-Operating-System.jpg) - -选择系统版本 - -6. 到了协议部分,选中"我接受"然后点击下一步 - -![Accept License](http://www.tecmint.com/wp-content/uploads/2015/08/Accept-License.jpg) - -同意协议 - -7. 下一步是选择(从Windows的老版本)升级到Windows 10或者安装Windows.我搞不懂为什么微软要让我自己选择:"安装Windows"被微软建议为"高级"选项.但是我还是选择了"安装Windows". - -![Select Installation Type](http://www.tecmint.com/wp-content/uploads/2015/08/Select-Installation-Type.jpg) - -选择安装类型 - -8. 选择驱动器,点击"下一步" - -![Select Install Drive](http://www.tecmint.com/wp-content/uploads/2015/08/Select-Install-Drive.jpg) - -选择安装盘 - -9. 安装程序开始复制文件,准备文件,安装更新,之后进行收尾.(如果安装程序能在安装时输出一堆字符来表示他在做什么就更好了) - -![Installing Windows](http://www.tecmint.com/wp-content/uploads/2015/08/Installing-Windows.jpg) - -安装 Windows - -10. 在此之后Windows重启了.他们说为了继续,我们需要重启 - -![Windows Installation Process](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-Installation-Process.jpg) - -安装进程 - -11. 我看到了一个写着"正在准备Windows"的界面.它停了整整五分多钟,仍然没有说明它正在做什么.没有输出. - -![Windows Getting Ready](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-Getting-Ready.jpg) - -正在准备Windows - -12. 又到了输入产品密钥的时间.我点击了"以后再说",并使用快速设置 - -![Enter Product Key](http://www.tecmint.com/wp-content/uploads/2015/08/Enter-Product-Key.jpg) - -输入产品密钥 - -![Select Express Settings](http://www.tecmint.com/wp-content/uploads/2015/08/Select-Express-Settings.jpg) - -使用快速设置 - - -13. 又出现了三个界面,作为Linux用户我认为此处应有信息来告诉我安装程序在做什么,但是我想多了 -![Loading Windows](http://www.tecmint.com/wp-content/uploads/2015/08/Loading-Windows.jpg) - -载入 Windows - -![Getting Updates](http://www.tecmint.com/wp-content/uploads/2015/08/Getting-Updates.jpg) - -获取更新 - -![Still Loading Windows](http://www.tecmint.com/wp-content/uploads/2015/08/Still-Loading-Windows.jpg) - -还是载入 Windows - -14. 安装程序想要知道谁拥有这台机器,"我的组织"或者我自己 - -![Select Organization](http://www.tecmint.com/wp-content/uploads/2015/08/Select-Organization.jpg) - -选择组织 - -15. 安装程序提示我加入"Aruze Ad"或者"加入域".在单击继续之前,我选择了后者. - -![Connect Windows](http://www.tecmint.com/wp-content/uploads/2015/08/Connect-Windows.jpg) - -连接网络 - -16. 安装程序让我新建一个账户.所以我输入了 "user_name"并点击下一步,我觉得我会收到一个要求我必须输入密码的信息. - -![Create Account](http://www.tecmint.com/wp-content/uploads/2015/08/Create-Account.jpg) - -新建账户 - -17. 让我惊讶的是Windows甚至都没有警告/发现我必须创建密码.真粗心.不管怎样,现在我可以体验系统了. - -![Windows 10 Desktop](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-10-Desktop.jpg) - -Windows 10的桌面环境 - -#### Linux用户(我)直到现在的体验 #### - -- 没有网络安装镜像 -- 镜像文件太臃肿了 -- 没有验证iso是否为正确的方法(官方没有提供哈希值) -- 启动与安装方式仍然与XP,Win 7,Win 8相同(可能吧...) -- 和以前一样,安装程序没有输出他正在干什么 - 正在复制什么和正在安装什么软件包 -- 安装程序比Linux发行版的更加直白和简单 - -####测试 Windows#### - -18. 默认桌面很干净,上面只有一个回收站图标.我们可以直接从桌面搜索网络.底部的快捷方式分别是任务预览,网络,微软应用商店.和以前的版本一样,消息栏在右下角. - -![ ](http://www.tecmint.com/wp-content/uploads/2015/08/Deskop-Shortcut-icons.jpg) - -桌面图标 - -19. IE浏览器被换成了Edge浏览器.微软把他们的老IE换成了Edge(斯巴达计划) - -![Microsoft Edge Browser](http://www.tecmint.com/wp-content/uploads/2015/08/Edge-browser.jpg) - -Edge浏览器 - -这个浏览器至少比IE要快.他们有相同的用户界面.它的主页包含新的更新.它还有一个标题是"下一步怎么走".由于它全面的性能提升,它的加载速度非常快.Edge的内存占用看起来一般般. - -![Windows Performance](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-Performance.jpg) - -性能 - -Edge也有小娜加成 -- 智能个人助理.支持笔记(在浏览网页时记笔记),分享(在本TAB分享而不必打开其他TAB) - -#### Linux用户(我)此时体验 #### - -20. 微软确实提升了网页浏览体验.我们要看的就是他的稳定性和质量.现在它并不落后. - -21. 对我来说,Edge的内存占用不算太大.但是有很多用户抱怨他的内存占用. - -22. 很难说目前Edge已经准备好了与火狐或Chrome竞争.让我们静观其变. - -#### 更多的视觉体验 #### - -23. 重新设计的开始菜单 -- 看起来很简洁高效.Merto磁贴大部分都会动.预先放置了最通用的应用. - -![Windows Look and Feel](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-Look.jpg) - -Windows - -在Linux的Gnome桌面环境下.我仅仅需要按下Win键并输入应用名就可以搜索应用. - -![Search Within Desktop](http://www.tecmint.com/wp-content/uploads/2015/08/Search-Within-Desktop.jpg) - -桌面内进行搜索 - -24. 文件浏览器 -- 设计的很简洁.左边是进入文件夹的快捷方式. - -![Windows File Explorer](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-File-Explorer.jpg) - -Windows资源管理器 - -我们的Gnome下的文件管理也同样的简洁高效. - -![File Browser on Gnome](http://www.tecmint.com/wp-content/uploads/2015/08/File-Browser.jpg) - -Gnome 的文件管理 - -25. 设置 -- 尽管Windows 10的设置有点精炼,但是我们还是可以把它与linux的设置进行对比. - -**Windows 的设置** - -![Windows 10 Settings](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-10-Settings.jpg) - -Windows 10 设置 - -**Linux Gnome 上的设置** - -![Gnome Settings](http://www.tecmint.com/wp-content/uploads/2015/08/Gnome-Settings.jpg) - -Gnome 的设置 - -26. 应用列表 -- 目前,Linux上的应用列表比之前的版本要好一些 - -**Windows 的应用列表** - -![Application List on Windows 10](http://www.tecmint.com/wp-content/uploads/2015/08/Application-List-on-Windows-10.jpg) - -Windows 10 的应用列表 - -**Gnome3 的应用列表** - -![Gnome Application List on Linux](http://www.tecmint.com/wp-content/uploads/2015/08/Gnome-Application-List-on-Linux.jpg) - -Gnome3 的应用列表 - -27. 虚拟桌面 -- Windows 10 上的虚拟桌面是近来被提及最多的特性之一 - -这是Windows 10 上的虚拟桌面. - -![Windows Virtual Desktop](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-Virtual-Desktop.jpg) - -Windows的虚拟桌面 - -这是我们Linux用户使用了超过20年的虚拟桌面. - -![Virtual Desktop on Linux](http://www.tecmint.com/wp-content/uploads/2015/08/Virtual-Desktop-on-Linux.jpg) - -Linux的虚拟桌面 - -#### Windows 10 的其他新特性 #### - -28. Windows 10 自带wifi感知.它会把你的wifi密码分享给他人.任何在你wifi范围内并且曾经通过Skype, Outlook, Hotmail 或 Facebook与你联系的人都能够获得你的网络接入权.这个特性的本意是让用户可以省时省力的连接网络. - -在微软对于 Tecmint 的问题的回答中,他们说道 -- 用户需要在每次到一个新的网络环境时自己去同意打开wifi感知.如果我们考虑到网络安全这将是很不安全的一件事.微软的说法并没有说服我. - -29. 从Windows 7 和 Windows 8.1升级可以省下买新版的花费.(家庭版$119 专业版$199 ) - -30. 微软发布了第一个累积更新,这个更新在一小部分设备上会让系统一直重启.Windows可能不知道这个问题或者不知道它发生的原因. - -31. 微软内建的禁用/隐藏我不想要的更新的功能在我这不起作用.这意味着一旦更新开始推送,你没有方法去禁用/隐藏他们.对不住啦,Windows 用户. - -#### Windows 10 包含的来源于Linux的功能 #### - -Windows 10有很多直接取自Linux的功能.如果Linux不已GPL发布的话,以下下这些功能永远不会出现在Windows上. - -32. 包管理器 -- 是的,你没有听错!Windows 10内建了一个包管理器.它只在Power Shell下工作.OneGet是Windows的官方包管理器. - -![Windows 10 Package Manager](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-10-Package-Manager.jpg) - - Windows 10的包管理器 - -- 无国界的Windows -- 扁平化图标 -- 虚拟桌面 -- 离线/在线搜索一体化 -- 手机/桌面系统一体化 - -### 总体印象### - -- 响应速度提升 -- 动画很好看 -- 资源占用少 -- 电池续航提升 -- Edge浏览器坚如磐石 -- 支持树莓派 2 -- Windows 10好的原因是Windows 8/8.1没有达到公众预期并且坏的可以 -- 旧瓶装新酒:Windows 10基本上就是以前的那一套换上新的图标 - -测试后我对Windows 10的评价是:Windows 10 在视觉和感觉上做了一些更新(就如同Windows经常做的那样).我要为斯巴达计划,虚拟桌面,命令行包管理器,整合在线/离线搜索的搜索栏点赞.这确实是一个更新后的产品 ,但是认为Windows 10将是Linux的最后一个棺材钉的人错了. - -Linux走在Windows前面.它们的做事方法并不相同.在以后的一段时间里Windows不会站到Linux这一旁.Linux用户也不必去使用Windows 10. - -这就是我要说的.希望你喜欢本文.如果你们喜欢本篇文章我会再写一些你们喜欢读的有趣的文章.在下方留下你的有价值的评论. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/a-linux-user-using-Windows-10-after-more-than-8-years-see-comparison/ - -作者:[vishek Kumar][a] -译者:[name1e5s](https://github.com/name1e5s) -校对:[校对者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 From d28b10a297ae9f8b6fc8ca292f70766b94e8fc43 Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Fri, 12 Feb 2016 22:22:09 +0800 Subject: [PATCH 0298/1469] =?UTF-8?q?20160212-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...isk in Linux CentOS 7 Without Rebooting.md | 172 ++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 sources/tech/20160104 How to Add New Disk in Linux CentOS 7 Without Rebooting.md diff --git a/sources/tech/20160104 How to Add New Disk in Linux CentOS 7 Without Rebooting.md b/sources/tech/20160104 How to Add New Disk in Linux CentOS 7 Without Rebooting.md new file mode 100644 index 0000000000..b9e906a435 --- /dev/null +++ b/sources/tech/20160104 How to Add New Disk in Linux CentOS 7 Without Rebooting.md @@ -0,0 +1,172 @@ +How to Add New Disk in Linux CentOS 7 Without Rebooting +================================================================================ + +Increasing disk spaces on the Linux servers is a daily routine work for very system administrator. So, in this article we are going to show you some simple simple steps that you can use to increase your disk spaces on Linux CentOS 7 without rebooting to your production server using Linux commands. We will cover multiple methods and possibilities to increase and add new disks to the Linux systems, so that you can follow the one that you feel comfortable while using according to your requirements. + +### 1. Increasing Disk of VM Guest: ### + +Before increasing the disk volume inside your Linux system, you need to add a new disk or increase the one its has already attached with the system by editing its settings from your VMware vShere, Workstation or any other infrastructure environment that you are using. + +![Increase disk](http://blog.linoxide.com/wp-content/uploads/2016/02/1.png) + +### 2. Check Disk Space: ### + +Run the following command to check the current size of your disk space. + + # df -h + # fdisk -l + +![Fdisk check](http://blog.linoxide.com/wp-content/uploads/2016/02/2.png) + +Here we can see that the total disk size is still the same that is 10 GB while we have already increased it to 50 GB from the back end. + +### 3. Expanding Space without Rebooting VM ### + +Now run the following commands to expand the disk space in the physical volume of the Operating System without rebooting the virtual machine by Re-scanning the SCSI Bus and then adding SCSI Device. + + # ls /sys/class/scsi_host/ + # echo "- - -" > /sys/class/scsi_host/host0/scan + # echo "- - -" > /sys/class/scsi_host/host1/scan + # echo "- - -" > /sys/class/scsi_host/host2/scan + +Check the names of your SCSI devices and then rescan the SCSI buses using below commands. + + # ls /sys/class/scsi_device/ + # echo 1 > /sys/class/scsi_device/0\:0\:0\:0/device/rescan + # echo 1 > /sys/class/scsi_device/2\:0\:0\:0/device/rescan + +That will rescan the current scsi bus and the disk size that we increased from the VM guest settings will be show up as you can see in the below image. + +![Rescan disk device](http://blog.linoxide.com/wp-content/uploads/2016/02/3.png) + +### 4. New Disk Partition: ### + +Once you are able to see the increased disk space inside your system then the run the following command to format your disk for creating a new partition by following the steps to increase your physical disk volume. + + # fdisk /dev/sda + Welcome to fdisk (util-linux 2.23.2) press the 'm' key for help + Command (m for help): m + Command action + a toggle a bootable flag + b edit bsd disklabel + c toggle the dos compatibility flag + d delete a partition + g create a new empty GPT partition table + G create an IRIX (SGI) partition table + l list known partition types + m print this menu + n add a new partition + o create a new empty DOS partition table + p print the partition table + q quit without saving changes + s create a new empty Sun disklabel + t change a partition's system id + u change display/entry units + v verify the partition table + w write table to disk and exit + x extra functionality (experts only) + + Command (m for help): + +Type the 'p' to print the current partition table then create a new primary partition by typing the 'n' key and selecting the available sectors. Change the disk type to 'Linux LVM' by using 't' command and selecting the code to '8e' or leave as it to its default type that is '83'. + +Now write the table to disk and exit by Entring 'w' key as shown. + + Command (m for help): w + The partition table has been altered! + + Calling ioctl() to re-read partition table. + + WARNING: Re-reading the partition table failed with error 16: Device or resource busy. + The kernel still uses the old table. The new table will be used at + the next reboot or after you run partprobe(8) or kpartx(8) + +![New disk Volume](http://blog.linoxide.com/wp-content/uploads/2016/02/3A.png) + +### 5. Creating Physical Volume: ### + +As indicated above run the 'partprobe' or kpartx command so that the tables are ready to use and then create the new Physical Volume using the below commands. + + # partprobe + # pvresize /dev/sda3 + +To check the newly created volume run the following command to see if the new physical volume has been created and visible. After that we will extend the Volume Group 'centos' with the newly create Physical Volume as shown. + + # pvdisplay + # vgextend centos /dev/sda3 + +![Extend volume Group](http://blog.linoxide.com/wp-content/uploads/2016/02/3B.png) + +### 6. Extending Logical Volume: ### + +Now we will extend the Logical Volume to increase the disk space on it using the the below command. + + # lvextend -L +40G /dev/mapper/centos-root + +Once you get the successfully increased message, run the command as shown below to extend the size of your logical volume . + + # xfs_growfs /dev/mapper/centos-root + +The size of the '/' partition has been increased successfully, you can check the size of your disk drives by using the 'df' command as shown. + +![Increase disk space](http://blog.linoxide.com/wp-content/uploads/2016/02/3C.png) + +### 7. Extending Root Partition by Adding New Disk Without Reboot: ### + +This is the second method with but with quite similar commands to increase the size of the Logical volume in CentOS 7. + +So, the first step is to Open the setting of your VM guest settings and click on the 'Add' new button and proceed to the next option. + +![Add new disk](http://blog.linoxide.com/wp-content/uploads/2016/02/3D.png) + +Choose the required configuration for the new disk by selecting the size of the new disk and its type as shown in the below image. + +![New disk setup](http://blog.linoxide.com/wp-content/uploads/2016/02/3E.png) + +Then come to the server side and repeat the following commands to scan your disk devices to the new disk is visible on the system. + + # echo "- - -" > /sys/class/scsi_host/host0/scan + # echo "- - -" > /sys/class/scsi_host/host1/scan + # echo "- - -" > /sys/class/scsi_host/host2/scan + +List the names of your SCSi devices + + # ls /sys/class/scsi_device/ + # echo 1 > /sys/class/scsi_device/1\:0\:0\:0/device/rescan + # echo 1 > /sys/class/scsi_device/2\:0\:0\:0/device/rescan + # echo 1 > /sys/class/scsi_device/3\:0\:0\:0/device/rescan + # fdisk -l + +![Scanning new disk](http://blog.linoxide.com/wp-content/uploads/2016/02/3F.png) + +Once the new disk is visible run the below commands to create the new physical volume and add it to the volume group as shown. + + # pvcreate /dev/sdb + # vgextend centos /dev/sdb + # vgdisplay + +![Extending Volume Group](http://blog.linoxide.com/wp-content/uploads/2016/02/3G.png) + +Now extend the Logical Volume by adding the disk space on it and then add it to the root partition. + + # lvextend -L +20G /dev/mapper/centos-root + # xfs_growfs /dev/mapper/centos-root + # df -h + +![Increase / Partition](http://blog.linoxide.com/wp-content/uploads/2016/02/3H.png) + +### Conclusion: ### + +Managing disk partitions in Linux CentOS 7 is a simple process to increase the disk space of any of your logical volumes by using the steps as described in this article. You don't need to give your production server's reboot for this purpose but simply rescan your SCSi devices and expand your desired LVM. We hope you find this article much helpful. Feel free to leave your valuable comments or suggestions. + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/add-new-disk-centos-7-without-rebooting/ + +作者:[Kashif S][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 fab54d093ced2df32f11ca3d61e13831e7663e1c Mon Sep 17 00:00:00 2001 From: runningwater Date: Sat, 13 Feb 2016 13:24:22 +0800 Subject: [PATCH 0299/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E4=B8=ADby=20runni?= =?UTF-8?q?ngwater?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...How to Add New Disk in Linux CentOS 7 Without Rebooting.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20160104 How to Add New Disk in Linux CentOS 7 Without Rebooting.md b/sources/tech/20160104 How to Add New Disk in Linux CentOS 7 Without Rebooting.md index b9e906a435..006d4f9905 100644 --- a/sources/tech/20160104 How to Add New Disk in Linux CentOS 7 Without Rebooting.md +++ b/sources/tech/20160104 How to Add New Disk in Linux CentOS 7 Without Rebooting.md @@ -1,3 +1,4 @@ +(翻译中 by runningwater) How to Add New Disk in Linux CentOS 7 Without Rebooting ================================================================================ @@ -164,7 +165,8 @@ Managing disk partitions in Linux CentOS 7 is a simple process to increase the d via: http://linoxide.com/linux-how-to/add-new-disk-centos-7-without-rebooting/ 作者:[Kashif S][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/) 荣誉推出 From a60212ce1570b2bb004b3781fc308743f6ffc2fc Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 13 Feb 2016 22:09:35 +0800 Subject: [PATCH 0300/1469] =?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 @tastynoodle @bazz2 @213edu @taichirain @iov-wang @zky001 @KnightJoker @DongShuaike @name1e5s @zpl1025 @strugglingyouth @ezio @cposture @fw8899 --- .../20150901 5 best open source board games to play online.md | 1 - sources/share/20151204 Review EXT4 vs. Btrfs vs. XFS.md | 1 - .../talk/20151019 Gaming On Linux--All You Need To Know.md | 2 -- ...0151208 5 great Raspberry Pi projects for the classroom.md | 4 ---- ...tall OsTicket Ticketing System in Fedora 22 or Centos 7.md | 1 - .../tech/20150906 How to Configure OpenNMS on CentOS 7.x.md | 1 - .../tech/20151109 How to Configure Tripwire IDS on Debian.md | 1 - ...nd email notifications using Gmail SMTP server on Linux.md | 1 - sources/tech/20151123 Data Structures in the Linux Kernel.md | 2 -- ...1202 8 things to do after installing openSUSE Leap 42.1.md | 1 - sources/tech/20151202 A new Mindcraft moment.md | 1 - ...--Summon Swarms Of Penguins To Waddle About The Desktop.md | 1 - ...esktop Fun--Text Mode ASCII-art Box and Comment Drawing.md | 3 +-- ...ri-Pi--Using the Raspberry Pi as a Secure Landing Point.md | 4 ---- sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md | 1 - ...at is good stock portfolio management software on Linux.md | 1 - ...ic Shell Scripting and Linux Filesystem Troubleshooting.md | 1 - ...artup Process and Services SysVinit Systemd and Upstart.md | 2 -- 18 files changed, 1 insertion(+), 28 deletions(-) diff --git a/sources/share/20150901 5 best open source board games to play online.md b/sources/share/20150901 5 best open source board games to play online.md index eee49289e0..c14fecc697 100644 --- a/sources/share/20150901 5 best open source board games to play online.md +++ b/sources/share/20150901 5 best open source board games to play online.md @@ -1,4 +1,3 @@ -translating by tastynoodle 5 best open source board games to play online ================================================================================ I have always had a fascination with board games, in part because they are a device of social interaction, they challenge the mind and, most importantly, they are great fun to play. In my misspent youth, myself and a group of friends gathered together to escape the horrors of the classroom, and indulge in a little escapism. The time provided an outlet for tension and rivalry. Board games help teach diplomacy, how to make and break alliances, bring families and friends together, and learn valuable lessons. diff --git a/sources/share/20151204 Review EXT4 vs. Btrfs vs. XFS.md b/sources/share/20151204 Review EXT4 vs. Btrfs vs. XFS.md index f6e40d4286..d370b87822 100644 --- a/sources/share/20151204 Review EXT4 vs. Btrfs vs. XFS.md +++ b/sources/share/20151204 Review EXT4 vs. Btrfs vs. XFS.md @@ -1,4 +1,3 @@ -bazz2222222222222222222222222222222222222222222 Review EXT4 vs. Btrfs vs. XFS ================================================================================ ![](http://1426826955.rsc.cdn77.org/wp-content/uploads/2015/09/1385698302_funny_linux_wallpapers-593x445.jpg) diff --git a/sources/talk/20151019 Gaming On Linux--All You Need To Know.md b/sources/talk/20151019 Gaming On Linux--All You Need To Know.md index 525d08838b..332136112a 100644 --- a/sources/talk/20151019 Gaming On Linux--All You Need To Know.md +++ b/sources/talk/20151019 Gaming On Linux--All You Need To Know.md @@ -1,5 +1,3 @@ -213edu Translating - Gaming On Linux: All You Need To Know ================================================================================ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/10/Gaming-on-Linux.jpeg) diff --git a/sources/talk/yearbook2015/20151208 5 great Raspberry Pi projects for the classroom.md b/sources/talk/yearbook2015/20151208 5 great Raspberry Pi projects for the classroom.md index 302034c330..cefad8cc6b 100644 --- a/sources/talk/yearbook2015/20151208 5 great Raspberry Pi projects for the classroom.md +++ b/sources/talk/yearbook2015/20151208 5 great Raspberry Pi projects for the classroom.md @@ -1,12 +1,8 @@ -taichirain 翻译中 - 5 great Raspberry Pi projects for the classroom -5 伟大的树莓派项目教室 ================================================================================ ![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/osdc-open-source-yearbook-lead3.png) Image by : opensource.com -图片来源 : opensource.com ### 1. Minecraft Pi ### 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 index 7a56750804..6624a3c590 100644 --- 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 @@ -1,4 +1,3 @@ -translated by iov-wang 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. diff --git a/sources/tech/20150906 How to Configure OpenNMS on CentOS 7.x.md b/sources/tech/20150906 How to Configure OpenNMS on CentOS 7.x.md index aca2b04bba..f209c8e45c 100644 --- a/sources/tech/20150906 How to Configure OpenNMS on CentOS 7.x.md +++ b/sources/tech/20150906 How to Configure OpenNMS on CentOS 7.x.md @@ -1,4 +1,3 @@ -translated by ivo-wang How to Configure OpenNMS on CentOS 7.x ================================================================================ Systems management and monitoring services are very important that provides information to view important systems management information that allow us to to make decisions based on this information. To make sure the network is running at its best and to minimize the network downtime we need to improve application performance. So, in this article we will make you understand the step by step procedure to setup OpenNMS in your IT infrastructure. OpenNMS is a free open source enterprise level network monitoring and management platform that provides information to allow us to make decisions in regards to future network and capacity planning. diff --git a/sources/tech/20151109 How to Configure Tripwire IDS on Debian.md b/sources/tech/20151109 How to Configure Tripwire IDS on Debian.md index 11e7dbad60..b5068348e4 100644 --- a/sources/tech/20151109 How to Configure Tripwire IDS on Debian.md +++ b/sources/tech/20151109 How to Configure Tripwire IDS on Debian.md @@ -1,4 +1,3 @@ -正在翻译:zky001 How to Configure Tripwire IDS on Debian ================================================================================ This article is about Tripwire installation and configuration on Debian OS. It is a host based Intrusion detection system (IDS) for Linux environment. Prime function of tripwire IDS is to detect and report any unauthorized change (files and directories ) on linux system. After tripwire installation, baseline database created first, tripwire monitors and detects changes such as new file addition/creation, file modification and user who changed it etc. If the changes are legitimate, you can accept the changes to update tripwire database. diff --git a/sources/tech/20151109 How to send email notifications using Gmail SMTP server on Linux.md b/sources/tech/20151109 How to send email notifications using Gmail SMTP server on Linux.md index 22e8606c6c..5ffcb5aea8 100644 --- a/sources/tech/20151109 How to send email notifications using Gmail SMTP server on Linux.md +++ b/sources/tech/20151109 How to send email notifications using Gmail SMTP server on Linux.md @@ -1,4 +1,3 @@ -Translating by KnightJoker How to send email notifications using Gmail SMTP server on Linux ================================================================================ Suppose you want to configure a Linux app to send out email messages from your server or desktop. The email messages can be part of email newsletters, status updates (e.g., [Cachet][1]), monitoring alerts (e.g., [Monit][2]), disk events (e.g., [RAID mdadm][3]), and so on. While you can set up your [own outgoing mail server][4] to deliver messages, you can alternatively rely on a freely available public SMTP server as a maintenance-free option. diff --git a/sources/tech/20151123 Data Structures in the Linux Kernel.md b/sources/tech/20151123 Data Structures in the Linux Kernel.md index d344eacd97..187b3ce9cd 100644 --- a/sources/tech/20151123 Data Structures in the Linux Kernel.md +++ b/sources/tech/20151123 Data Structures in the Linux Kernel.md @@ -1,5 +1,3 @@ -Translating by DongShuaike - Data Structures in the Linux Kernel ================================================================================ diff --git a/sources/tech/20151202 8 things to do after installing openSUSE Leap 42.1.md b/sources/tech/20151202 8 things to do after installing openSUSE Leap 42.1.md index 183d39252f..b941c3d611 100644 --- a/sources/tech/20151202 8 things to do after installing openSUSE Leap 42.1.md +++ b/sources/tech/20151202 8 things to do after installing openSUSE Leap 42.1.md @@ -1,4 +1,3 @@ -#name1e5s Translating 8 things to do after installing openSUSE Leap 42.1 ================================================================================ ![Credit: Metropolitan Transportation/Flicrk](http://images.techhive.com/images/article/2015/11/things-to-do-100626947-primary.idge.jpg) diff --git a/sources/tech/20151202 A new Mindcraft moment.md b/sources/tech/20151202 A new Mindcraft moment.md index 92c645ea4b..79930e8202 100644 --- a/sources/tech/20151202 A new Mindcraft moment.md +++ b/sources/tech/20151202 A new Mindcraft moment.md @@ -1,4 +1,3 @@ -zpl1025 A new Mindcraft moment? ======================= diff --git a/sources/tech/20151215 Linux Desktop Fun--Summon Swarms Of Penguins To Waddle About The Desktop.md b/sources/tech/20151215 Linux Desktop Fun--Summon Swarms Of Penguins To Waddle About The Desktop.md index b544517f5e..73d16fe1bd 100644 --- a/sources/tech/20151215 Linux Desktop Fun--Summon Swarms Of Penguins To Waddle About The Desktop.md +++ b/sources/tech/20151215 Linux Desktop Fun--Summon Swarms Of Penguins To Waddle About The Desktop.md @@ -1,4 +1,3 @@ -translation by strugglingyouth Linux Desktop Fun: Summon Swarms Of Penguins To Waddle About The Desktop ================================================================================ XPenguins is a program for animating cute cartoons animals in your root window. By default it will be penguins they drop in from the top of the screen, walk along the tops of your windows, up the side of your windows, levitate, skateboard, and do other similarly exciting things. Now you can send an army of cute little penguins to invade the screen of someone else on your network. diff --git a/sources/tech/20151215 Linux or Unix Desktop Fun--Text Mode ASCII-art Box and Comment Drawing.md b/sources/tech/20151215 Linux or Unix Desktop Fun--Text Mode ASCII-art Box and Comment Drawing.md index 268c6c9477..fad7c6443b 100644 --- a/sources/tech/20151215 Linux or Unix Desktop Fun--Text Mode ASCII-art Box and Comment Drawing.md +++ b/sources/tech/20151215 Linux or Unix Desktop Fun--Text Mode ASCII-art Box and Comment Drawing.md @@ -1,4 +1,3 @@ -翻译中 Linux / Unix Desktop Fun: Text Mode ASCII-art Box and Comment Drawing ================================================================================ Boxes command is a text filter and a little known tool that can draw any kind of ASCII art box around its input text or code for fun and profit. You can quickly create email signatures, or create regional comments in any programming language. This command was intended to be used with the vim text editor, but can be tied to any text editor which supports filters, as well as from the command line as a standalone tool. @@ -191,7 +190,7 @@ See also via: http://www.cyberciti.biz/tips/unix-linux-draw-any-kind-of-boxes-around-text-editor.html 作者:Vivek Gite -译者:[zky001](https://github.com/zky001) +译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/sources/tech/20151215 Securi-Pi--Using the Raspberry Pi as a Secure Landing Point.md b/sources/tech/20151215 Securi-Pi--Using the Raspberry Pi as a Secure Landing Point.md index 7388b7693e..36c28d25d6 100644 --- a/sources/tech/20151215 Securi-Pi--Using the Raspberry Pi as a Secure Landing Point.md +++ b/sources/tech/20151215 Securi-Pi--Using the Raspberry Pi as a Secure Landing Point.md @@ -1,7 +1,3 @@ -translating by ezio - - - Securi-Pi: Using the Raspberry Pi as a Secure Landing Point ================================================================================ diff --git a/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md b/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md index 80031c7fd8..99f1ceed04 100644 --- a/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md +++ b/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md @@ -1,4 +1,3 @@ -[Translating by cposture 16-01-14] * * * # GCC-Inline-Assembly-HOWTO diff --git a/sources/tech/20160104 What is good stock portfolio management software on Linux.md b/sources/tech/20160104 What is good stock portfolio management software on Linux.md index b7c372ce71..258cf104fc 100644 --- a/sources/tech/20160104 What is good stock portfolio management software on Linux.md +++ b/sources/tech/20160104 What is good stock portfolio management software on Linux.md @@ -1,4 +1,3 @@ -translating by fw8899 What is good stock portfolio management software on Linux ================================================================================ If you are investing in the stock market, you probably understand the importance of a sound portfolio management plan. The goal of portfolio management is to come up with the best investment plan tailored for you, considering your risk tolerance, time horizon and financial goals. Given its importance, no wonder there are no shortage of commercial portfolio management apps and stock market monitoring software, each touting various sophisticated portfolio performance tracking and reporting capabilities. 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 841d5c0625..4d0a5a229a 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,4 +1,3 @@ -Being translated by hittlle...... 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. 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 3a2dfa844a..2a822e8a45 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,5 +1,3 @@ -Translating by Flowsnow - 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. From 1318b4f220f427102d05c4d5ada4bfc712404fb8 Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Sun, 14 Feb 2016 15:45:59 +0800 Subject: [PATCH 0301/1469] =?UTF-8?q?20160214-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ll MariaDB 10 on CentOS 7 CPanel Server.md | 326 ++++++++++++++++++ 1 file changed, 326 insertions(+) create mode 100644 sources/tech/20160214 How to Install MariaDB 10 on CentOS 7 CPanel Server.md diff --git a/sources/tech/20160214 How to Install MariaDB 10 on CentOS 7 CPanel Server.md b/sources/tech/20160214 How to Install MariaDB 10 on CentOS 7 CPanel Server.md new file mode 100644 index 0000000000..53160a0c31 --- /dev/null +++ b/sources/tech/20160214 How to Install MariaDB 10 on CentOS 7 CPanel Server.md @@ -0,0 +1,326 @@ +How to Install MariaDB 10 on CentOS 7 CPanel Server +================================================================================ + +MariaDB is a enhanced open source and drop-in replacement for MySQL. It is developed by MariaDB community and available under the terms of the GPL v2 license. Software Security is the main focus for the MariaDB developers. They maintain its own set of security patches for each MariaDB releases. When any critical security issues are discovered, the developers introduces a new release of MariaDB to get the fix out as soon as possible. + +MariaDB is always up-to-date with the latest MySQL releases. It is highly compatible and works exactly like the MySQL. Almost all commands, data, table definition files, Client APIs, protocols, interfaces, structures, filenames, binaries, ports, database storage locations etc are same as the MySQL. It isn't even needed to convert databases to switch to MariaDB. + +### Advantages of MariaDB ### + +- Truly Open source +- More quicker and transparent security releases +- Highly Compatible with MySQL +- Improved Performance +- More storage engines compared to MySQL + +In this article, I provides guidelines on how to upgrade MySQL 5.5 to the latest MariaDB on a CentOS 7 CPanel server. Let's walk through the Pre-installation steps. + +### Pre-requisites: ### + +#### 1. Stop current MySQL Service #### + + root@server1 [/var/# mysql + Welcome to the MySQL monitor. Commands end with ; or \g. + Your MySQL connection id is 5859 + Server version: 5.5.47-cll MySQL Community Server (GPL) + + Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + + Oracle is a registered trademark of Oracle Corporation and/or its + affiliates. Other names may be trademarks of their respective + owners. + + Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. + + root@server1 [~]# systemctl stop mysql + root@server1 [~]# systemctl status mysql + ● mysql.service - LSB: start and stop MySQL + Loaded: loaded (/etc/rc.d/init.d/mysql) + Active: failed (Result: exit-code) since Sun 2016-01-31 10:00:02 UTC; 1min 31s ago + Docs: man:systemd-sysv-generator(8) + Main PID: 23430 (code=exited, status=203/EXEC) + + Jan 31 10:00:02 server1.centos7-test.com systemd[1]: Started MySQL Server. + Jan 31 10:00:02 server1.centos7-test.com systemd[1]: Starting MySQL Server... + Jan 31 10:00:02 server1.centos7-test.com systemd[1]: mysql.service: main process exited, code=exited, status=203/EXEC + Jan 31 10:00:02 server1.centos7-test.com systemd[1]: Unit mysql.service entered failed state. + Jan 31 10:00:02 server1.centos7-test.com systemd[1]: mysql.service failed. + +#### 2. Move all configuration files and databases prior to the upgrade #### + +Move the DB storage path and MySQL configuration files + + root@server1 [~]# cp -Rf /var/lib/mysql /var/lib/mysql-old + + root@server1 [/var/lib/mysql]# cat /etc/my.cnf + [mysqld] + default-storage-engine=MyISAM + innodb_file_per_table=1 + max_allowed_packet=268435456 + open_files_limit=10000 + + root@server1 [~]#mv /etc/my.cnf /etc/my.cnf-old + +#### 3. Remove and uninstall all MySQL rpms from the server #### + +Run the following commands to disable the MySQL RPM targets. By running this commands, cPanel will no longer handle MySQL updates, and mark these rpm.versions as uninstalled on the system. + + /scripts/update_local_rpm_versions --edit target_settings.MySQL50 uninstalled + /scripts/update_local_rpm_versions --edit target_settings.MySQL51 uninstalled + /scripts/update_local_rpm_versions --edit target_settings.MySQL55 uninstalled + /scripts/update_local_rpm_versions --edit target_settings.MySQL56 uninstalled + +Now run the this command: + +/scripts/check_cpanel_rpms --fix --targets=MySQL50,MySQL51,MySQL55,MySQL56 to remove all existing MySQL rpms on the server and leave a clean environment for MariaDB installation. Please see its output below: + + root@server1 [/var/lib/mysql]# /scripts/check_cpanel_rpms --fix --targets=MySQL50,MySQL51,MySQL55,MySQL56 + [2016-01-31 09:53:59 +0000] + [2016-01-31 09:53:59 +0000] Problems were detected with cPanel-provided files which are RPM controlled. + [2016-01-31 09:53:59 +0000] If you did not make these changes intentionally, you can correct them by running: + [2016-01-31 09:53:59 +0000] + [2016-01-31 09:53:59 +0000] > /usr/local/cpanel/scripts/check_cpanel_rpms --fix + [2016-01-31 09:53:59 +0000] + [2016-01-31 09:53:59 +0000] The following RPMs are unneeded on your system and should be uninstalled: + [2016-01-31 09:53:59 +0000] MySQL55-client-5.5.47-1.cp1148 + [2016-01-31 09:53:59 +0000] MySQL55-devel-5.5.47-1.cp1148 + [2016-01-31 09:53:59 +0000] MySQL55-server-5.5.47-1.cp1148 + [2016-01-31 09:53:59 +0000] MySQL55-shared-5.5.47-1.cp1148 + [2016-01-31 09:53:59 +0000] MySQL55-test-5.5.47-1.cp1148 + [2016-01-31 09:53:59 +0000] compat-MySQL50-shared-5.0.96-4.cp1136 + [2016-01-31 09:53:59 +0000] compat-MySQL51-shared-5.1.73-1.cp1150 + [2016-01-31 09:53:59 +0000] Removing 0 broken rpms: + [2016-01-31 09:53:59 +0000] rpm: no packages given for erase + [2016-01-31 09:53:59 +0000] No new RPMS needed for install + [2016-01-31 09:53:59 +0000] Disabling service monitoring. + [2016-01-31 09:54:01 +0000] Uninstalling unneeded rpms: MySQL55-test MySQL55-server MySQL55-client compat-MySQL51-shared compat-MySQL50-shared MySQL55-shared MySQL55-devel + [2016-01-31 09:54:04 +0000] Removed symlink /etc/systemd/system/multi-user.target.wants/mysql.service. + [2016-01-31 09:54:04 +0000] Restoring service monitoring. + +With these steps, we've uninstalled existing MySQL RPMs, marked targets to prevent further MySQL updates and made the server ready and clean for the MariaDB installation. + +To startup with the installation, we need to create a yum repository for MariaDB depending on the MariaDB & CentOS versions. This is how I did it! + +### Installation procedures: ### + +#### Step 1: Creating a YUM repository. #### + + root@server1 [~]# vim /etc/yum.repos.d/MariaDB.repo + [mariadb] + name = MariaDB + baseurl = http://yum.mariadb.org/10.0/centos7-amd64/ + gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB + gpgcheck=1 + root@server1 [/etc/yum.repos.d]# cat /etc/yum.repos.d/MariaDB.repo + [mariadb] + name = MariaDB + baseurl = http://yum.mariadb.org/10.0/centos7-amd64/ + gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB + gpgcheck=1 + +#### Step 2: Open the /etc/yum.conf and modify the exclude line as below: #### + +**Remove this line** exclude=courier* dovecot* exim* filesystem httpd* mod_ssl* mydns* mysql* nsd* php* proftpd* pure-ftpd* spamassassin* squirrelmail* + +**And replace with this line** exclude=courier* dovecot* exim* filesystem httpd* mod_ssl* mydns* nsd* proftpd* pure-ftpd* spamassassin* squirrelmail* + +**\*\*\* IMPORTANT \*\*\*** + +We need to make sure, we've removed the MySQL and PHP from the exclude list. + +#### Step 3: Run the following command to install MariaDB and related packages. #### + +**yum install MariaDB-server MariaDB-client MariaDB-devel php-mysql** + + root@server1 [~]#yum install MariaDB-server MariaDB-client MariaDB-devel php-mysql + + Dependencies Resolved + + =============================================================================================================================================== + Package Arch Version Repository Size + =============================================================================================================================================== + Installing: + MariaDB-client x86_64 10.0.23-1.el7.centos mariadb 10 M + MariaDB-devel x86_64 10.0.23-1.el7.centos mariadb 6.3 M + MariaDB-server x86_64 10.0.23-1.el7.centos mariadb 55 M + php-mysql x86_64 5.4.16-36.el7_1 base 99 k + Installing for dependencies: + MariaDB-common x86_64 10.0.23-1.el7.centos mariadb 43 k + MariaDB-shared x86_64 10.0.23-1.el7.centos mariadb 1.2 M + libzip x86_64 0.10.1-8.el7 base 48 k + php-common x86_64 5.4.16-36.el7_1 base 563 k + php-pdo x86_64 5.4.16-36.el7_1 base 97 k + + Transaction Summary + =============================================================================================================================================== + Install 4 Packages (+5 Dependent package) + +#### Step 4: Restart and make sure the MySQL service is up. #### + + root@server1 [~]# systemctl start mysql + root@server1 [~]# + root@server1 [~]# + root@server1 [~]# systemctl status mysql + ● mysql.service - LSB: start and stop MySQL + Loaded: loaded (/etc/rc.d/init.d/mysql) + Active: active (exited) since Sun 2016-01-31 10:01:46 UTC; 3s ago + Docs: man:systemd-sysv-generator(8) + Process: 23717 ExecStart=/etc/rc.d/init.d/mysql start (code=exited, status=0/SUCCESS) + Main PID: 23430 (code=exited, status=203/EXEC) + + Jan 31 10:01:46 server1.centos7-test.com systemd[1]: Starting LSB: start and stop MySQL... + Jan 31 10:01:46 server1.centos7-test.com mysql[23717]: Starting MySQL SUCCESS! + Jan 31 10:01:46 server1.centos7-test.com systemd[1]: Started LSB: start and stop MySQL. + +#### Step 5: Run mysql_upgrade command #### + +It will examine all tables in all databases for incompatibilities with the current installed version and upgrades the system tables if necessary to take advantage of new privileges or capabilities that might have added with the current version. + + root@server1 [~]# mysql_upgrade + MySQL upgrade detected + Phase 1/6: Checking and upgrading mysql database + Processing databases + mysql + mysql.columns_priv OK + mysql.db OK + mysql.event OK + mysql.func OK + mysql.help_category OK + mysql.help_keyword OK + mysql.help_relation OK + mysql.help_topic OK + mysql.host OK + mysql.ndb_binlog_index OK + mysql.plugin OK + mysql.proc OK + mysql.procs_priv OK + mysql.proxies_priv OK + mysql.servers OK + mysql.tables_priv OK + mysql.time_zone OK + mysql.time_zone_leap_second OK + mysql.time_zone_name OK + mysql.time_zone_transition OK + mysql.time_zone_transition_type OK + mysql.user OK + Phase 2/6: Fixing views from mysql + Phase 3/6: Running 'mysql_fix_privilege_tables' + Phase 4/6: Fixing table and database names + Phase 5/6: Checking and upgrading tables + Processing databases + cphulkd + cphulkd.auths OK + cphulkd.blacklist OK + cphulkd.brutes OK + cphulkd.good_logins OK + cphulkd.ip_lists OK + cphulkd.known_netblocks OK + cphulkd.login_track OK + cphulkd.logins OK + cphulkd.report OK + cphulkd.whitelist OK + eximstats + eximstats.defers OK + eximstats.failures OK + eximstats.sends OK + eximstats.smtp OK + information_schema + leechprotect + leechprotect.hits OK + modsec + modsec.hits OK + performance_schema + roundcube + roundcube.cache OK + roundcube.cache_index OK + roundcube.cache_messages OK + roundcube.cache_shared OK + roundcube.cache_thread OK + roundcube.contactgroupmembers OK + roundcube.contactgroups OK + roundcube.contacts OK + roundcube.cp_schema_version OK + roundcube.dictionary OK + roundcube.identities OK + roundcube.searches OK + roundcube.session OK + roundcube.system OK + roundcube.users OK + saheetha_test + saheetha_test.authors OK + whmxfer + whmxfer.sessions OK + Phase 6/6: Running 'FLUSH PRIVILEGES' + OK + +#### Step 6 : Restart the MySQL service once again to ensure everything works perfect. #### + + root@server1 [~]# systemctl restart mysql + root@server1 [~]# + root@server1 [~]# systemctl status mysql + ● mysql.service - LSB: start and stop MySQL + Loaded: loaded (/etc/rc.d/init.d/mysql) + Active: active (running) since Sun 2016-01-31 10:04:11 UTC; 9s ago + Docs: man:systemd-sysv-generator(8) + Process: 23831 ExecStop=/etc/rc.d/init.d/mysql stop (code=exited, status=0/SUCCESS) + Process: 23854 ExecStart=/etc/rc.d/init.d/mysql start (code=exited, status=0/SUCCESS) + Main PID: 23430 (code=exited, status=203/EXEC) + CGroup: /system.slice/mysql.service + ├─23861 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/server1.centos7-test.com.pid + └─23933 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/v... + + Jan 31 10:04:10 server1.centos7-test.com systemd[1]: Starting LSB: start and stop MySQL... + Jan 31 10:04:11 server1.centos7-test.com mysql[23854]: Starting MySQL. SUCCESS! + Jan 31 10:04:11 server1.centos7-test.com systemd[1]: Started LSB: start and stop MySQL. + +#### Step 7: Run EasyApache to rebuild Apache/PHP with MariaDB and ensure all PHP modules remains intact. #### + + root@server1 [~]#/scripts/easyapache --build + + ****IMPORTANT ***** + If you forget to rebuild Apache/PHP after the MariaDB installation, it will report the library error as below: + + root@server1 [/etc/my.cnf.d]# php -v + php: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory + +#### Step 8: Now verify the installation and databases. #### + + root@server1 [/var/lib/mysql]# mysql + Welcome to the MariaDB monitor. Commands end with ; or \g. + Your MariaDB connection id is 15 + Server version: 10.0.23-MariaDB MariaDB Server + + Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others. + + Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. + + MariaDB [(none)]> show storage engines; + +--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+ + | Engine | Support | Comment | Transactions | XA | Savepoints | + +--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+ + | CSV | YES | CSV storage engine | NO | NO | NO | + | MRG_MyISAM | YES | Collection of identical MyISAM tables | NO | NO | NO | + | MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO | + | BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO | + | MyISAM | YES | MyISAM storage engine | NO | NO | NO | + | InnoDB | DEFAULT | Percona-XtraDB, Supports transactions, row-level locking, and foreign keys | YES | YES | YES | + | ARCHIVE | YES | Archive storage engine | NO | NO | NO | + | FEDERATED | YES | FederatedX pluggable storage engine | YES | NO | YES | + | PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO | + | Aria | YES | Crash-safe tables with MyISAM heritage | NO | NO | NO | + +--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+ + 10 rows in set (0.00 sec) + +That's all :). Now we're all set to go with MariaDB with its improved and efficient features. Hope you enjoyed reading this documentation. I would recommend your valuable suggestions and feedback on this! + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/how-tos/install-mariadb-10-centos-7-cpanel/ + +作者:[Saheetha Shameer][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/saheethas/ \ No newline at end of file From 3cf5e80b1fe1c90057255ae7e54166effb8d340c Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Sun, 14 Feb 2016 15:48:09 +0800 Subject: [PATCH 0302/1469] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=2020160212-1=20?= =?UTF-8?q?=E9=80=89=E9=A2=98=E7=9A=84=E6=96=87=E4=BB=B6=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...12 How to Add New Disk in Linux CentOS 7 Without Rebooting.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/tech/{20160104 How to Add New Disk in Linux CentOS 7 Without Rebooting.md => 20160212 How to Add New Disk in Linux CentOS 7 Without Rebooting.md} (100%) diff --git a/sources/tech/20160104 How to Add New Disk in Linux CentOS 7 Without Rebooting.md b/sources/tech/20160212 How to Add New Disk in Linux CentOS 7 Without Rebooting.md similarity index 100% rename from sources/tech/20160104 How to Add New Disk in Linux CentOS 7 Without Rebooting.md rename to sources/tech/20160212 How to Add New Disk in Linux CentOS 7 Without Rebooting.md From 658a0d21820840882519c9aab60f1e0b92765777 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 15 Feb 2016 09:57:04 +0800 Subject: [PATCH 0303/1469] translating --- .../tech/20151109 How to Configure Tripwire IDS on Debian.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sources/tech/20151109 How to Configure Tripwire IDS on Debian.md b/sources/tech/20151109 How to Configure Tripwire IDS on Debian.md index b5068348e4..d7bee4b745 100644 --- a/sources/tech/20151109 How to Configure Tripwire IDS on Debian.md +++ b/sources/tech/20151109 How to Configure Tripwire IDS on Debian.md @@ -1,3 +1,5 @@ +Translating---geekpi + How to Configure Tripwire IDS on Debian ================================================================================ This article is about Tripwire installation and configuration on Debian OS. It is a host based Intrusion detection system (IDS) for Linux environment. Prime function of tripwire IDS is to detect and report any unauthorized change (files and directories ) on linux system. After tripwire installation, baseline database created first, tripwire monitors and detects changes such as new file addition/creation, file modification and user who changed it etc. If the changes are legitimate, you can accept the changes to update tripwire database. @@ -377,3 +379,5 @@ via: http://linoxide.com/security/configure-tripwire-ids-debian/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://linoxide.com/author/naveeda/ + + From 685413ea138e996eb55019661de498287ca3c97e Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 15 Feb 2016 11:03:02 +0800 Subject: [PATCH 0304/1469] translated --- ...How to Configure Tripwire IDS on Debian.md | 51 +++++++++---------- 1 file changed, 25 insertions(+), 26 deletions(-) rename {sources => translated}/tech/20151109 How to Configure Tripwire IDS on Debian.md (78%) diff --git a/sources/tech/20151109 How to Configure Tripwire IDS on Debian.md b/translated/tech/20151109 How to Configure Tripwire IDS on Debian.md similarity index 78% rename from sources/tech/20151109 How to Configure Tripwire IDS on Debian.md rename to translated/tech/20151109 How to Configure Tripwire IDS on Debian.md index d7bee4b745..23bf8eef65 100644 --- a/sources/tech/20151109 How to Configure Tripwire IDS on Debian.md +++ b/translated/tech/20151109 How to Configure Tripwire IDS on Debian.md @@ -1,50 +1,49 @@ -Translating---geekpi - -How to Configure Tripwire IDS on Debian +如何在Debian中配置Tripewire IDS ================================================================================ -This article is about Tripwire installation and configuration on Debian OS. It is a host based Intrusion detection system (IDS) for Linux environment. Prime function of tripwire IDS is to detect and report any unauthorized change (files and directories ) on linux system. After tripwire installation, baseline database created first, tripwire monitors and detects changes such as new file addition/creation, file modification and user who changed it etc. If the changes are legitimate, you can accept the changes to update tripwire database. +本文是一篇关于Debian中安装和配置Tripewire的文章。它是Linux环境下基于主机的入侵检测系统(IDS)。tripwire的高级功能有检测并报告任何Linux中未授权的更改(文件和目录)。tripewire安装之后,会先创建一个基本的数据库,tripewire监控并检测新文件的创建修改和谁修改了它等等。如果修改过是合法的,你可以接受修改并更新tripwire的数据库。 -### Installation and Configuration ### +### 安装和配置 ### -Tripwire installation on Debian VM is shown below. +tripwire在Debian VM中的安装如下。 # apt-get install tripwire ![installation](http://blog.linoxide.com/wp-content/uploads/2015/11/installation.png) -During installation, tripwire prompt for following configuration. +安装中,tripwire会有下面的配置提示。 -#### Site key Creation #### +#### 站点密钥创建 #### + +tripwire需要一个站点口令来加密tripwire的配置文件tw.cfg和策略文件tw.pol。tripewire使用指定的密码加密两个文件。一个tripewire实例必须指定站点口令。 -Tripwire required a site passphrase to secure the tw.cfg tripwire configuration file and tw.pol tripwire policy file. Tripewire encrypte both files using given passphrase. Site passphrase is must even for a single instance tripwire. ![site key1](http://blog.linoxide.com/wp-content/uploads/2015/11/site-key1.png) -#### Local Key passphrase #### +#### 本地密钥口令 #### -Local passphrase is needed for the protection of tripwire database and report files . Local key used by the tripwire to avoid unauthorized modification of tripwire baseline database. +本地口令用来保护tripwire数据库和报告文件。本地密钥用于阻止非授权的tripewire数据库修改。 ![local key1](http://blog.linoxide.com/wp-content/uploads/2015/11/local-key1.png) -#### Tripwire configuration path #### +#### Tripwire配置路径 #### -Tripwire configuration saved in the /etc/tripwire/twcfg.txt file. It is used to generate encrypted configuration file tw.cfg. +tripewire配置存储在/etc/tripwire/twcfg.txt。它用于生成加密的配置文件tw.cfg。 ![configuration file](http://blog.linoxide.com/wp-content/uploads/2015/11/configuration-file.png) -**Tripwire Policy path** +**Tripwire策略路径** -Tripwire saves policies in /etc/tripwire/twpol.txt file . It is used for the generation of encrypted policy file tw.pol used by the tripwire. +tripwire在/etc/tripwire/twpol.txt中保存策略文件。它用于生成加密的策略文件tw.pol。 ![tripwire policy](http://blog.linoxide.com/wp-content/uploads/2015/11/tripwire-policy.png) -Final installation of tripwire is shown in the following snapshot. +安装完成后如下图所示。 ![installed tripewire1](http://blog.linoxide.com/wp-content/uploads/2015/11/installed-tripewire1.png) -#### Tripwire Configuration file (twcfg.txt) #### +#### Tripwire配置文件 (twcfg.txt) #### -Tripwire configuration file (twcfg.txt) details is given below. Paths of encrypted policy file (tw.pol), site key (site.key) and local key (hostname-local.key) etc are given below. +tripewire配置文件(twcfg.txt)细节如下图所示。加密策略文件(tw.pol),站点密钥(site.key)和本地密钥(hostname-local.key)如下所示。 ROOT =/usr/sbin @@ -80,9 +79,9 @@ Tripwire configuration file (twcfg.txt) details is given below. Paths of encrypt TEMPDIRECTORY =/tmp -#### Tripwire Policy Configuration #### +#### Tripwire策略配置 #### -Configure tripwire configuration before generation of baseline database. It is necessary to disable few policies such as /dev , /proc ,/root/mail etc. Detailed policy file twpol.txt is given below. +在生成基础数据库之前先配置tripwire配置。有必要经用一些策略如/dev、 /proc 、/root/mail等。详细的twpol.txt策略文件如下所示。 @@section GLOBAL TWBIN = /usr/sbin; @@ -238,13 +237,13 @@ Configure tripwire configuration before generation of baseline database. It is n #/proc -> $(Device) ; } -#### Tripwire Report #### +#### Tripwire 报告 #### -**tripwire –check** command checks the twpol.txt file and based on this file generates tripwire report which is shown below. If this is any error in the twpol.txt file, tripwire does not generate report. +**tripwire –check** 命令检查twpol.txt文件并基于此文件生成tripwire报告如下。如果twpol.txt中有任何错误,tripwire不会生成报告。 ![tripwire report](http://blog.linoxide.com/wp-content/uploads/2015/11/tripwire-report.png) -**Report in text form** +**文本形式报告** root@VMdebian:/home/labadmin# tripwire --check @@ -364,16 +363,16 @@ Configure tripwire configuration before generation of baseline database. It is n Integrity check complete. -### Conclusion ### +### 总结 ### -In this article, we learned installation and basic configuration of open source IDS tool Tripwire. First it generates baseline database and detects any change (file/folder) by comparing it with already generated baseline. However, tripwire is not live monitoring IDS. +本篇中,我们学习安装配置开源入侵检测软件tripwire。首先生成基础数据库并通过比较检测出任何改动(文件/文件夹)。然而,tripwire并不是实时监测的IDS。 -------------------------------------------------------------------------------- via: http://linoxide.com/security/configure-tripwire-ids-debian/ 作者:[nido][a] -译者:[译者zky001](https://github.com/zky001) +译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a77967d1b11d2b0241533aab62dac4b7bcd437d4 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 15 Feb 2016 20:59:49 +0800 Subject: [PATCH 0305/1469] PUB:20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2 @ZTinoZ --- ...lla with Apache and SSL on FreeBSD 10.2.md | 87 ++++++++++--------- 1 file changed, 44 insertions(+), 43 deletions(-) rename {translated/tech => published}/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md (54%) diff --git a/translated/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md b/published/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md similarity index 54% rename from translated/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md rename to published/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md index 784c7d03aa..a60b5d7589 100644 --- a/translated/tech/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md +++ b/published/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md @@ -1,36 +1,37 @@ -在FreeBSD 10.2上如何通过配置Apache和SSL安装Bugzilla +在 FreeBSD 10.2 上如何通过配置 Apache 和 SSL 安装 Bugzilla ================================================================================ -Bugzilla是一款bug跟踪系统和测试工具,它基于web且开源,由mozilla计划开发并由Mozilla公共许可证授权。它经常被一些高科技公司如mozilla、红帽公司和gnome使用。Bugzilla起初由Terry Weissman在1998年创立,它用perl语言编写,用MySQL作为后端数据库。它是一款旨在帮助管理软件开发的服务器软件,它有丰富的功能、高优化度的数据库、卓越的安全性、高级的搜索工具、整合的邮件功能等等。 -在本教程中,我们将给web服务器安装 bugzilla 5.0 的apache,并为它启用SSL,然后安装 mysql 5.1 来作为 freebsd 10.2 的数据库系统。 +Bugzilla 是一款开源的 Web 应用,用于 bug 跟踪系统和测试工具,由 mozilla 开发,并采用 Mozilla 公共许可证授权(MPL)。它经常被一些高科技公司如 mozilla、红帽公司和 gnome 使用。Bugzilla 起初由 Terry Weissman开发于1998年,它用 perl 语言编写,用 MySQL 作为后端数据库。它是一款旨在帮助管理软件开发的服务器软件,它有丰富的功能、高度优化的数据库、卓越的安全性、高级的搜索工具、集成了邮件功能等等。 + +在本教程中,我们将安装 bugzilla 5.0 ,采用 apache 作为 Web 服务器,并为它启用 SSL,然后在 freebsd 10.2 上安装 mysql 5.1 来作为数据库系统。 #### 准备 #### - FreeBSD 10.2 - 64位 - Root权限 +- FreeBSD 10.2 - 64位 +- Root 权限 ### 第一步 - 更新系统 ### -用ssl登录freebsd服务器,并更新库: +用 ssh 登录 freebsd 服务器,并更新软件库: sudo su freebsd-update fetch freebsd-update install -### 第二步 - 安装并配置Apache ### +### 第二步 - 安装并配置 Apache ### -在这一步我们将使用pkg命令从freebsd库中安装apache,然后在apache24目录下编辑"httpd.conf"文件,启用SSL和CGI支持来配置apache。 +在这一步我们将使用 pkg 命令从 freebsd 软件库中安装 apache,然后在 apache24 目录下编辑 "httpd.conf" 文件,来配置 apache 以启用 SSL 和 CGI 支持。 -用pkg命令安装apache: +用 pkg 命令安装 apache: pkg install apache24 -进入apache目录并用nano编辑器编辑"httpd.conf"文件: +进入 apache 目录并用 nano 编辑器编辑"httpd.conf"文件: cd /usr/local/etc/apache24 nano -c httpd.conf -反注释掉下面列出的行: +取消下面列出行的注释: #第70行 LoadModule authn_socache_module libexec/apache24/mod_authn_socache.so @@ -55,11 +56,11 @@ Bugzilla是一款bug跟踪系统和测试工具,它基于web且开源,由moz 保存并退出。 -接着,我们需要从freebsd库中安装mod perl,并启用它: +接着,我们需要从 freebsd 库中安装 mod perl,并启用它: pkg install ap24-mod_perl2 -启用mod_perl,编辑"httpd.conf"文件并添加"Loadmodule"行: +启用 mod_perl,编辑"httpd.conf"文件并添加"Loadmodule"行: nano -c httpd.conf @@ -70,20 +71,20 @@ Bugzilla是一款bug跟踪系统和测试工具,它基于web且开源,由moz 保存并退出。 -在启用apache之前,用sysrc命令添加以下行作为开机启动项: +在启用 apache 之前,用 sysrc 命令添加以下行作为开机启动项: sysrc apache24_enable=yes service apache24 start -### 第三步 - 安装并配置MySQL数据库 ### +### 第三步 - 安装并配置 MySQL 数据库 ### -我们要用mysql 5.1来作为后端数据库并且支持perl模块。用pkg命令安装mysql 5.1: +我们要用 mysql 5.1 来作为后端数据库并且支持 perl 模块。用 pkg 命令安装 mysql 5.1: pkg install p5-DBD-mysql51 mysql51-server mysql51-client -现在我们要添加mysql服务到开机启动,然后为mysql配置root密码。 +现在我们要将 mysql 服务设置为开机启动,然后为 mysql 配置 root 密码。 -运行以下命令来完成所有操作: +运行以下命令来完成上述所有操作: sysrc mysql_enable=yes service mysql-server start @@ -91,13 +92,13 @@ Bugzilla是一款bug跟踪系统和测试工具,它基于web且开源,由moz 注意: -这里mysql密码为:aqwe123 +这里 mysql 密码为:aqwe123 ![Configure MySQL Password](http://blog.linoxide.com/wp-content/uploads/2015/12/Configure-MySQL-Password.png) -以上步骤都完成之后,我们用root登录mysql shell,然后为bugzilla安装创建一个新的数据库和用户。 +以上步骤都完成之后,我们用 root 登录 mysql shell,然后为 bugzilla 安装创建一个新的数据库和用户。 -用以下命令登录mysql shell: +用以下命令登录 mysql shell: mysql -u root -p password: aqwe123 @@ -112,32 +113,32 @@ Bugzilla是一款bug跟踪系统和测试工具,它基于web且开源,由moz ![Creating Database for Bugzilla](http://blog.linoxide.com/wp-content/uploads/2015/12/Creating-Database-for-Bugzilla.png) -bugzilla的数据库创建好了,名字为"bugzilladb",用户名和密码分别为"bugzillauser"和"bugzillauser@"。 +bugzilla 的数据库创建好了,名字为"bugzilladb",用户名和密码分别为"bugzillauser"和"bugzillauser@"。 -### 第四步 - 生成新的SSL证书 ### +### 第四步 - 生成新的 SSL 证书 ### -在bugzilla站点的"ssl"目录里生成新的自签名SSL证书。 +在 bugzilla 站点的 "ssl" 目录里生成新的自签名 SSL 证书。 -前往apache24目录并在此创建新目录"ssl": +前往 apache24 目录并在此创建新目录 "ssl": cd /usr/local/etc/apache24/ mkdir ssl; cd ssl -接着,用openssl命令生成证书文件,然后更改其权限: +接着,用 openssl 命令生成证书文件,然后更改其权限: sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /usr/local/etc/apache24/ssl/bugzilla.key -out /usr/local/etc/apache24/ssl/bugzilla.crt chmod 600 * ### 第五步 - 配置虚拟主机 ### -我们将在"/usr/local/www/bugzilla"目录里安装bugzilla,所以我们必须为它创建新的虚拟主机配置。 +我们将在 "/usr/local/www/bugzilla" 目录里安装 bugzilla,所以我们必须为它创建新的虚拟主机配置。 -前往apache目录并为虚拟主机文件创建名为"vhost"的新目录: +前往 apache 目录并为虚拟主机文件创建名为 "vhost" 的新目录: cd /usr/local/etc/apache24/ mkdir vhost; cd vhost -现在为虚拟主机文件创建新文件"bugzilla.conf": +现在为虚拟主机文件创建新文件 "bugzilla.conf": nano -c bugzilla.conf @@ -173,9 +174,9 @@ bugzilla的数据库创建好了,名字为"bugzilladb",用户名和密码分 保存并退出。 -上述都完成之后,为bugzilla安装创建新目录并通过添加虚拟主机配置至httpd.conf文件来启用bugzilla虚拟主机。 +上述都完成之后,为 bugzilla 安装创建新目录,并在 httpd.conf 文件添加虚拟主机配置来启用 bugzilla虚拟主机。 -在"apache24"目录下运行以下命令: +在 "apache24" 目录下运行以下命令: mkdir -p /usr/local/www/bugzilla cd /usr/local/etc/apache24/ @@ -187,29 +188,29 @@ bugzilla的数据库创建好了,名字为"bugzilladb",用户名和密码分 保存并退出。 -现在用"apachectl"命令测试一下apache的配置并重启它: +现在用 "apachectl" 命令测试一下 apache 的配置并重启它: apachectl configtest service apache24 restart -### 第六步 - 安装Bugzilla ### +### 第六步 - 安装 Bugzilla ### -我们可以通过下载源来手动安装bugzilla了,或从freebsd库中安装也可以。在这一步中我们将用pkg命令从freebsd库中安装bugzilla: +我们可以通过下载源来手动安装 bugzilla 了,或从 freebsd 库中安装也可以。在这一步中我们将用 pkg 命令从 freebsd 库中安装 bugzilla: pkg install bugzilla50 -以上步骤都完成之后,前往bugzilla安装目录并安装所有bugzilla需要的perl模块。 +以上步骤都完成之后,前往 bugzilla 安装目录并安装所有 bugzilla 需要的 perl 模块。 cd /usr/local/www/bugzilla ./install-module --all 要等到所有都完成,这需要点时间。 -下一步,在bugzilla的安装目录中执行"checksetup.pl"文件来生成配置文件"localconfig"。 +下一步,在 bugzilla 的安装目录中执行 "checksetup.pl" 文件来生成配置文件 "localconfig"。 ./checksetup.pl -你会看到一条关于数据库配置错误的消息,你得用nano编辑器编辑一下"localconfig"文件: +你会看到一条关于数据库配置错误的消息,你得用 nano 编辑器编辑一下 "localconfig" 文件: nano -c localconfig @@ -226,7 +227,7 @@ bugzilla的数据库创建好了,名字为"bugzilladb",用户名和密码分 保存并退出。 -然后再次运行"checksetup.pl": +然后再次运行 "checksetup.pl": ./checksetup.pl @@ -234,25 +235,25 @@ bugzilla的数据库创建好了,名字为"bugzilladb",用户名和密码分 ![Admin Setup](http://blog.linoxide.com/wp-content/uploads/2015/12/Admin-Setup.png) -最后,我们需要把安装目录的属主改成"www",然后用服务命令重启apache: +最后,我们需要把安装目录的属主改成 "www",然后用服务命令重启 apache: cd /usr/local/www/ chown -R www:www bugzilla service apache24 restart -现在Bugzilla已经安装好了,你可以通过访问mybugzilla.me来查看,并且将会重定向到https连接。 +现在 Bugzilla 已经安装好了,你可以通过访问 mybugzilla.me 来查看,并且将会重定向到 https 连接。 -Bugzilla首页: +Bugzilla 首页: ![Bugzilla Home](http://blog.linoxide.com/wp-content/uploads/2015/12/Bugzilla-Home.png) -Bugzilla admin面板: +Bugzilla admin 面板: ![Bugzilla Admin Page](http://blog.linoxide.com/wp-content/uploads/2015/12/Bugzilla-Admin-Page.png) ### 结论 ### -Bugzilla是一个基于web并能帮助你管理软件开发的应用,它用perl开发并使用MySQL作为数据库系统。Bugzilla帮助mozilla、redhat,gnome等公司完成软件开发工作。Bugzilla有很多功能并易于配置和安装。 +Bugzilla 是一个基于 web 的应用,并能帮助你管理软件开发,它用 perl 开发并以 MySQL 作为数据库系统。Bugzilla 帮助 mozilla、redhat、gnome 等公司完成软件开发工作。Bugzilla 有很多功能并易于配置和安装。 -------------------------------------------------------------------------------- From 4067bc9522f90acf97ee31e13a58a2509f2e615d Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Mon, 15 Feb 2016 23:13:51 +0800 Subject: [PATCH 0306/1469] Update 20160214 How to Install MariaDB 10 on CentOS 7 CPanel Server.md --- ...0214 How to Install MariaDB 10 on CentOS 7 CPanel Server.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20160214 How to Install MariaDB 10 on CentOS 7 CPanel Server.md b/sources/tech/20160214 How to Install MariaDB 10 on CentOS 7 CPanel Server.md index 53160a0c31..ccd14d1410 100644 --- a/sources/tech/20160214 How to Install MariaDB 10 on CentOS 7 CPanel Server.md +++ b/sources/tech/20160214 How to Install MariaDB 10 on CentOS 7 CPanel Server.md @@ -1,3 +1,4 @@ +translation by strugglingyouth How to Install MariaDB 10 on CentOS 7 CPanel Server ================================================================================ @@ -323,4 +324,4 @@ via: http://linoxide.com/how-tos/install-mariadb-10-centos-7-cpanel/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://linoxide.com/author/saheethas/ \ No newline at end of file +[a]:http://linoxide.com/author/saheethas/ From 5d936a2ac8298afcb0e0a2bfbe2348554b85fb59 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 16 Feb 2016 16:42:06 +0800 Subject: [PATCH 0307/1469] PUB:20151208 6 useful LibreOffice extensions @GHLandy --- ...0151208 6 useful LibreOffice extensions.md | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) rename {translated/talk/yearbook2015 => published}/20151208 6 useful LibreOffice extensions.md (54%) diff --git a/translated/talk/yearbook2015/20151208 6 useful LibreOffice extensions.md b/published/20151208 6 useful LibreOffice extensions.md similarity index 54% rename from translated/talk/yearbook2015/20151208 6 useful LibreOffice extensions.md rename to published/20151208 6 useful LibreOffice extensions.md index b8d4f1fa1c..5fed70cb74 100644 --- a/translated/talk/yearbook2015/20151208 6 useful LibreOffice extensions.md +++ b/published/20151208 6 useful LibreOffice extensions.md @@ -1,53 +1,54 @@ -GHLandy Translated - LibreOffice 中的六大实用扩展组件 ================================================================================ ![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/yearbook2015-osdc-lead-2.png) 图片来源:Opensource.com -LibreOffice 是最好的免费办公套件,并在所有的主要 Linux 发行版中得到应用。尽管 LibreOffice 已经拥有了大多数特性,它仍然可以添加特定的附加组件,即扩展。 +LibreOffice 是最好的自由办公套件,并在所有的主要 Linux 发行版中得到应用。尽管 LibreOffice 已经拥有了大多数特性,它仍然可以通过添加一种叫做扩展(extension)的特定的附加组件来增加功能。 LibreOffice 的扩展组件的网站是 [extensions.libreoffice.org][1]。扩展组件只是一些工具,可以在安装主体上进行独立添加或者移除,以便增加新功能或者让已有功能更容易使用。 ### 1. 多格式保存组件 ### -多格式保存组件可以根据用户的设置,同时将文档保存为开源文档、微软 Office 文档或者 PDF 文档。在你将微软 Office 文档格式转为标准的[开源文档格式][2]的时候,这个组件就很实用了,因为该组件同时提供了两种选择:互操作性较强的 ODF 文档格式以及为所有用户让在实用的微软 Office 文档格式保持兼容性。这样使管理员的文档迁移过程变得更具弹性、更易于管理。 +多格式保存组件可以根据用户的设置,同时将文档保存为开源文档(OpenDocument)、微软 Office 文档或者 PDF 文档。在你需要将微软 Office 文档格式转为标准的[开源文档格式][2]的时候,这个组件就很实用了,因为该组件同时提供了两种选择:互操作性较强的 ODF 文档格式,以及微软 Office 文档格式,以便同所有需要使用老旧的文档格式的用户保持兼容性。这样使管理员的文档迁移过程变得更具弹性、更易于管理。 **[下载 多格式保存组件][3]** ![Multiformatsave extension](https://opensource.com/sites/default/files/images/business-uploads/multiformatsave.png) -### 2. Writer 中可交替使用的查找与替换组件(交替搜索) ### +### 2. Writer 中可备选使用的查找与替换组件(备选搜索 (AltSearch)) ### -该组件向 Writer 中的查找与替换功能添加了许多新特性:可以查找和替换一段或多段文本;一次执行在多个查找和替换;搜索:书签、笔记、文本字段、交叉引用和参考标志内容、名称或标志及其插入;搜索和插入脚注和尾注;通过名称来搜索表格对象、图像和文本框;搜索帮助手册页的分栏符以及创建和失活时间;根据光标位置搜索相同格式的文本。还可以保存/加载查找和替换参数,并在多个同时打开的文件中执行批处理。 +该组件向 Writer 中的查找与替换功能添加了许多新特性:可以查找和替换一段或多段文本;一次执行多个查找和替换;搜索:书签、笔记、文本字段、交叉引用和参考标志内容、名称或标志及其插入;搜索和插入脚注和尾注;通过名称来搜索表格对象、图像和文本框;搜索帮助手册页和分栏符以及创建和失活时间;根据光标位置搜索相同格式的文本。还可以保存/加载查找和替换参数,并在多个同时打开的文件中执行批处理。 -**[下载 Writer 中可交替使用的查找与替换组件(交替搜索)][4]** +**[下载 Writer 中可交替使用的查找与替换组件(交替搜索 (AltSearch))][4]** ![Alternative Find&amp;Replace add-on](https://opensource.com/sites/default/files/images/business-uploads/alternativefindreplace.png) ### 3. Pepito 清除组件 ### -中 LibreOffice 中, Pepito 清除组件主要用来快速清除并修复旧扫描件、导入的 PDF 以及每个电子文本文档的格式错误。通过点击 LibreOffice 工具栏中的 Pepito 图标,用户可以打开一个用于分析文档并呈现文档错误类型。当你将 PDF 文档转换为 ODF 文档时,这个工具就非常有用了,它会自动清除转换过程中出现的错误。 + +Pepito 清除组件是一个 LibreOffice 扩展,主要用来快速清除并修复旧式扫描件、导入的 PDF 以及每个电子文本文档的格式错误。通过点击 LibreOffice 工具栏中的 Pepito 图标,用户可以打开一个用于分析文档并按类型呈现文档错误。当你将 PDF 文档转换为 ODF 文档时,这个工具就非常有用了,它会自动清除转换过程中出现的错误。 **[下载 Pepito 清除组件][5]** ![Pepito cleaner screenshot](https://opensource.com/sites/default/files/images/business-uploads/pepitocleaner.png) ### 4. ImpressRunner 组件### -Impress Runner 是将 [Impress][6] 文档转换成自动播放文件的扩展组件。该组件会添加两个图标,用以设置或移除自动开始播放的功能,我们还可以通过编辑 文件 | 属性 | 自定义属性 菜单来手动添加这两个图标,并将自动运行按钮添加到四个文本域之前。在会议与活动组织而且幻灯片无人主持的时候,这个扩展组件就变得非常有用。 + +Impress Runner 是将 [Impress][6] 文档转换成自动播放文件的扩展组件。该组件会添加两个图标,用以设置或移除自动开始播放的功能,我们还可以通过编辑 文件 | 属性 | 自定义属性 菜单来手动添加这两个图标,并将自动运行按钮添加到前四个文本域之一前面。在会议与组织活动时,如果幻灯片无人主持,这个扩展组件就变得非常有用。 **[下载 ImpressRunner 组件][7]** ### 5. 导出为图像组件 ### -导出为图像组件是 Impress 和 [Draw][8] 中文件菜单里边的一个入口——导出为图像...,,主要用于将所有的幻灯片和页面导出成 JPG、PNG、GIF、BMP 和 TIFF 等图像格式,并且允许用户自定义导出图像的名称、大小以及其他参数。 +导出为图像组件为 Impress 和 [Draw][8] 中文件菜单里增加了一个入口——“导出为图像...”,主要用于将所有的幻灯片和页面导出成 JPG、PNG、GIF、BMP 和 TIFF 等图像格式,并且允许用户自定义导出图像的名称、大小以及其他参数。 **[下载 导出为图像组件][9]** ![Export as images extension](https://opensource.com/sites/default/files/images/business-uploads/exportasimages.png) ### 6. Anaphraseus 组件### -Anaphraseus 是一个 CAT(Computer-Aided Translation,计算机辅助翻译)工具组件,用来创建、管理双语翻译。Anaphraseus 是一个设置成扩展组件或者独立文档的 LibreOffice 宏。最开始,开发者设计 Anaphraseus 为快速翻译(Wordfast)格式,但现在它可以将文件导入或者到出成 TMX 格式。其主要特性:分本分割、在翻译记录中模糊搜索、术语识别以及导入导出 TMX(OmegaT translation memory format,OmegaT 翻译存储格式)。 + +Anaphraseus 是一个 CAT(Computer-Aided Translation,计算机辅助翻译)工具组件,用来创建、管理双语翻译。Anaphraseus 是一个 LibreOffice 宏集合,可以作为扩展组件或者用在单独的文档中。最开始,Anaphraseus 支持快速翻译(Wordfast)格式,但现在它可以导入或者导出成 TMX 格式。其主要特性:分本分割、在翻译记录(Translation Memory)中模糊搜索、术语识别以及导入导出 TMX(OmegaT translation memory format,OmegaT 翻译存储格式)。 **[下载 Anaphraseus 组件][10]** @@ -60,8 +61,8 @@ Anaphraseus 是一个 CAT(Computer-Aided Translation,计算机辅助翻译 via: https://opensource.com/business/15/12/6-useful-libreoffice-extensions 作者:[Italo Vignoli][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[GHLandy](https://github.com/GHLandy) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 56271618f9b1d32d5e6e63455a9c4526b17d5551 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 17 Feb 2016 09:57:16 +0800 Subject: [PATCH 0308/1469] translating --- ...esktop Fun--Text Mode ASCII-art Box and Comment Drawing.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sources/tech/20151215 Linux or Unix Desktop Fun--Text Mode ASCII-art Box and Comment Drawing.md b/sources/tech/20151215 Linux or Unix Desktop Fun--Text Mode ASCII-art Box and Comment Drawing.md index fad7c6443b..f5321bd83e 100644 --- a/sources/tech/20151215 Linux or Unix Desktop Fun--Text Mode ASCII-art Box and Comment Drawing.md +++ b/sources/tech/20151215 Linux or Unix Desktop Fun--Text Mode ASCII-art Box and Comment Drawing.md @@ -1,3 +1,5 @@ +Translating----geekpi + Linux / Unix Desktop Fun: Text Mode ASCII-art Box and Comment Drawing ================================================================================ Boxes command is a text filter and a little known tool that can draw any kind of ASCII art box around its input text or code for fun and profit. You can quickly create email signatures, or create regional comments in any programming language. This command was intended to be used with the vim text editor, but can be tied to any text editor which supports filters, as well as from the command line as a standalone tool. @@ -199,3 +201,5 @@ via: http://www.cyberciti.biz/tips/unix-linux-draw-any-kind-of-boxes-around-text [2]:http://www.cyberciti.biz/faq/rhel-centos-fedora-linux-yum-command-howto/ [3]:http://www.cyberciti.biz/faq/fedora-sl-centos-redhat6-enable-epel-repo/ [4]:http://www.cyberciti.biz/faq/vim-inserting-current-date-time-under-linux-unix-osx/ + + From 859f199aed135a93f11d9b8a09608aba37ac2cc5 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 17 Feb 2016 10:31:36 +0800 Subject: [PATCH 0309/1469] translated --- ... Mode ASCII-art Box and Comment Drawing.md | 62 +++++++++---------- 1 file changed, 31 insertions(+), 31 deletions(-) rename {sources => translated}/tech/20151215 Linux or Unix Desktop Fun--Text Mode ASCII-art Box and Comment Drawing.md (74%) diff --git a/sources/tech/20151215 Linux or Unix Desktop Fun--Text Mode ASCII-art Box and Comment Drawing.md b/translated/tech/20151215 Linux or Unix Desktop Fun--Text Mode ASCII-art Box and Comment Drawing.md similarity index 74% rename from sources/tech/20151215 Linux or Unix Desktop Fun--Text Mode ASCII-art Box and Comment Drawing.md rename to translated/tech/20151215 Linux or Unix Desktop Fun--Text Mode ASCII-art Box and Comment Drawing.md index f5321bd83e..01b0051fef 100644 --- a/sources/tech/20151215 Linux or Unix Desktop Fun--Text Mode ASCII-art Box and Comment Drawing.md +++ b/translated/tech/20151215 Linux or Unix Desktop Fun--Text Mode ASCII-art Box and Comment Drawing.md @@ -1,16 +1,15 @@ -Translating----geekpi - -Linux / Unix Desktop Fun: Text Mode ASCII-art Box and Comment Drawing +Linux/Unix桌面趣事:文本模式艺术框及注释图 ================================================================================ Boxes command is a text filter and a little known tool that can draw any kind of ASCII art box around its input text or code for fun and profit. You can quickly create email signatures, or create regional comments in any programming language. This command was intended to be used with the vim text editor, but can be tied to any text editor which supports filters, as well as from the command line as a standalone tool. +boxes是一个文本过滤器并且是一个鲜为人知的可以在文字或者代码周围绘出任何形式的ASCII艺术框的工具。你可以快速地创建一个email签名或者在任何语言中创建一个注释。这个命令可以和vim一起使用,但是可以和任何支持过滤和可以在命令行中使用独立工具的文本编辑器绑定在一起。。 -### Task: Install boxes ### +### 任务: 安装 boxes ### -Use the [apt-get command][1] to install boxes under Debian / Ubuntu Linux: +在Debian/Ubuntu中使用[apt-get命令][1]来安装boxes: $ sudo apt-get install boxes -Sample outputs: +示例输出: Reading package lists... Done Building dependency tree @@ -26,11 +25,11 @@ Sample outputs: Processing triggers for man-db ... Setting up boxes (1.0.1a-2.3) ... -RHEL / CentOS / Fedora Linux users, use the [yum command to install boxes][2] (first [enable EPEL repo as described here][3]): +对于RHEL / CentOS / Fedora用户,使用[yum命令来安装boxes][2](首先[启用EPEL仓库][3]) # yum install boxes -Sample outputs: +示例输出: Loaded plugins: rhnplugin Setting up Install Process @@ -63,50 +62,51 @@ Sample outputs: Complete! FreeBSD user can use the port as follows: +FreeBSD用户可以使用port: cd /usr/ports/misc/boxes/ && make install clean -Or, add the package using the pkg_add command: +或者使用pkg_add命令添加包: # pkg_add -r boxes -### Draw any kind of box around some given text ### +### 用给定的文字画出任何形式的框 ### -Type the following command: +输入下面的额命令: echo "This is a test" | boxes -Or specify the name of the design to use: +或者指定设计: echo -e "\n\tVivek Gite\n\tvivek@nixcraft.com\n\twww.cyberciti.biz" | boxes -d dog -Sample outputs: +示例输出: ![Unix / Linux: Boxes Command To Draw Various Designs](http://s0.cyberciti.org/uploads/l/tips/2012/06/unix-linux-boxes-draw-dog-design.png) -Fig.01: Unix / Linux: Boxes Command To Draw Various Designs +图01:Unix / Linux:Box命令来画出不同的设计 -#### How do I list all designs? #### +#### 我如何列出所有的设计? #### -The syntax is: +语法是: boxes option pipe | boxes options echo "text" | boxes -d foo boxes -l -The -d design option sets the name of the design to use. The syntax is: +-d选项设置使用的设计。语法是: echo "Text" | boxes -d design pipe | boxes -d desig -The -l option list designs. It produces a listing of all available box designs in the config file, along with a sample box and information about it's creator: +-l选项列出设计列表。它会列出配置文件中所有的设计,以及它的设计者的一些信息: boxes -l boxes -l | more boxes -l | less -Sample outputs: +示例输出: 43 Available Styles in "/etc/boxes/boxes-config": ------------------------------------------------- @@ -142,32 +142,32 @@ Sample outputs: output truncated .. -### How do I filter text via boxes while using vi/vim text editor? ### +### 我如何在vi/vim中使用boxes过滤文本? ### -You can use any external command with vi or vim. In this example, [insert current date and time][4], enter: +你可以在vi或者vim中使用任何外部命令。比如,[插入日期和时间][4],输入: !!date -OR +或者 :r !date -You need to type above command in Vim to read the output from the date command. This will insert the date and time after the current line: +你需要在vim中输入上面的命令来读取date命令的输出。这可以在当前行中插入时间和日期: Tue Jun 12 00:05:38 IST 2012 -You can do the same with boxes command. Create a sample shell script or a c program as follows: +你可以用boxes命令做同样的事情。如下创建一个示例脚本或者程序: #!/bin/bash Purpose: Backup mysql database to remote server. Author: Vivek Gite Last updated on: Tue Jun, 12 2012 -Now type the following (move cursor to the second line i.e. line which starts with "Purpose: ...") +现在输入下面的命令(移动光标到第二行,也就是说以Purpose开头的那行) 3!!boxes -And voila you will get the output as follows: +你就会得到下面的示例输出: #!/bin/bash /****************************************************/ @@ -177,22 +177,22 @@ And voila you will get the output as follows: /****************************************************/ This video will give you an introduction to boxes command: +这个视频是boxes命令的一个介绍 注:youtube 视频 -(Video:01: boxes command in action. BTW, this is my first video so go easy on me and let me know what you think.) +(视频01:boxes命令实践。顺便说一下,这是我的第一个视频,所以对我不要太认真并让我知道你们所想) +同样可见 -See also - -- boxes man page +- boxes man页 -------------------------------------------------------------------------------- via: http://www.cyberciti.biz/tips/unix-linux-draw-any-kind-of-boxes-around-text-editor.html 作者:Vivek Gite -译者:[译者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 e8d9170b3976f2c2f5c25de2a1bee2c96e4e3353 Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Wed, 17 Feb 2016 23:31:17 +0800 Subject: [PATCH 0310/1469] =?UTF-8?q?20160217-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... PHP-FPM Instances with Nginx or Apache.md | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 sources/tech/20160217 How to Enable Multiple PHP-FPM Instances with Nginx or Apache.md diff --git a/sources/tech/20160217 How to Enable Multiple PHP-FPM Instances with Nginx or Apache.md b/sources/tech/20160217 How to Enable Multiple PHP-FPM Instances with Nginx or Apache.md new file mode 100644 index 0000000000..68af7da0a4 --- /dev/null +++ b/sources/tech/20160217 How to Enable Multiple PHP-FPM Instances with Nginx or Apache.md @@ -0,0 +1,121 @@ +How to Enable Multiple PHP-FPM Instances with Nginx / Apache +================================================================================ + +PHP-FPM is also known as PHP FastCGI Process Manager. It is an advancement of PHP FastCGI implementation with more useful features for handling heavy-loaded servers and websites. Some of those features are listed below: + +### New Features ### + + - Advanced process managament capability with graceful start/stop options. + - Ability to run the processes with different userids/groupids listening on different ports and using different PHP configurations. + - Error logging. + - Acceleration upload support + - Special function to finish request and flush all data while doing some time consuming tasks + - Both Dynamic and Static Child process Spawning + - IP Address restriction + +In this article, I'm going to discuss about installing PHP-FPM along with Nginx and Apache on a CentOS 7 server running cPanel 11.52 with EA3(EasyApache) and how to manage those installed multiple PHP-FPM instances via CPanel. + +Before going to the installation procedures, let us take a look on the pre-requisites. + +### Pre-requisites ### + + # Enable Mod_proxy_fcgi module + # Enable MPM_Event + +Since, we are installing PHP-FPM on a EA3 server, we need to run EasyApache to compile Apache to enable these modules. + +You can refer my previous document on how to install Nginx as reverse proxy on a Apache server to confirm with the Nginx installation. + +I'll brief those installation steps once again here. You can refer to my previous documentation **(How to Set Nginx as Reverse Proxy on CentOS 7 /CPanel Server)** for details. + + Step 1: Install the Epel repo + Step 2: Install nDeploy RPM repo which is the most **IMPORTANT** step in this installation. + Step 3: Install nDeploy and Nginx plugin using yum from the nDeploy repo. + Step 4: Enable/Configure Nginx as reverse proxy + +Once this is done, install the PHP-FPM packages for all PHP versions available in the server. EA3 uses remi repository for installing these packages. You can run this nDeploy script to download all packages. + + root@server1 [~]# /opt/nDeploy/scripts/easy_php_setup.sh + Loaded plugins: fastestmirror, tsflags, universal-hooks + EA4 | 2.9 kB 00:00:00 + base | 3.6 kB 00:00:00 + epel/x86_64/metalink | 9.7 kB 00:00:00 + epel | 4.3 kB 00:00:00 + extras | 3.4 kB 00:00:00 + updates | 3.4 kB 00:00:00 + (1/2): epel/x86_64/updateinfo | 460 kB 00:00:00 + (2/2): epel/x86_64/primary_db + +Running this script will install all these FPM packages for PHP 54, PHP 55, PHP 56 and PHP 70. + + Installed Packages + php54-php-fpm.x86_64 5.4.45-3.el7.remi @remi + php55-php-fpm.x86_64 5.5.31-1.el7.remi @remi + php56-php-fpm.x86_64 5.6.17-1.el7.remi @remi + php70-php-fpm.x86_64 7.0.2-1.el7.remi @remi + +After this installation, you need to enable PHP-FPM SAPI for Apache. You can run this script to enable PHP-FPM instances. + + root@server1 [~]# /opt/nDeploy/scripts/apache_php-fpm_setup.sh enable + mod_proxy_fcgi.c + Please choose one default PHP version from the list below + PHP70 + PHP56 + PHP54 + PHP55 + Provide the exact desired version string here and press ENTER: PHP54 + ConfGen:: lxblogger + ConfGen:: blogr + ConfGen:: saheetha + ConfGen:: satest + which: no cagefsctl in (/usr/local/jdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/root/bin) + info [rebuildhttpdconf] Missing owner for domain server1.centos7-test.com, force lookup to root + Built /usr/local/apache/conf/httpd.conf OK + Waiting for “httpd” to restart gracefully …waiting for “httpd” to initialize …… + …finished. + +It will ask the required PHP version which you prefer to run as default on the server. You can enter those details and proceed to configure and generate the virtual host files for the existing domains. + +I've chosen PHP 54 as the default PHP-FPM version on my server. + +![confirm-php-fpm](http://blog.linoxide.com/wp-content/uploads/2016/01/confirm-php-fpm-1024x525.png) + +Even though, the server is configured with PHP-FPM 54, we can modify the PHP-FPM instances for the individual domains via cPanel. + +I'll explain you on how to modify the PHP-FPM instances for individual domains via cPanel using some screenshots. + +The installation of Nginx plugin will provide you with an icon of Nginx Webstack in your domain's cPanel. You can click on that icon to configure your Web server. I've logged into one of my domain's cPanel to configure it's Web server. + +Please check these snapshots. + +![nginx webstack](http://blog.linoxide.com/wp-content/uploads/2016/01/nginx-webstack.png) + +![nginxicon1](http://blog.linoxide.com/wp-content/uploads/2016/01/nginxicon1-1024x253.png) + +Now you can configure the web-server for the selected main domain as required(I've selected the main domain saheetha.com here). I've gone ahead with automatic configuration options since, I don't have any manual settings to add. + +![nginx_auto_proxy](http://blog.linoxide.com/wp-content/uploads/2016/01/nginx_auto_proxy-1024x408.png) + +Once Nginx is configured, you can select the PHP-FPM instance for your domain here. + +![php-fpm1](http://blog.linoxide.com/wp-content/uploads/2016/01/php-fpm1-1024x408.png) + +![php54](http://blog.linoxide.com/wp-content/uploads/2016/01/php54-1024x169.png) + +![php55](http://blog.linoxide.com/wp-content/uploads/2016/01/php55.png) + +As you can see in these snapshots, my default PHP-FPM on the server is **PHP 54** and I'm changing the PHP-FPM instance for my domain alone to **PHP 55**. Once you've modified the PHP-FPM for your domain, you can confirm it by accessing the **phpinfo** page. + +Thank you for referring to this article. I believe this article is really informative and useful for you. I would recommend your valuable comments on this :). + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/enable-multiple-php-fpm-instances-nginx-apache/ + +作者:[Saheetha Shameer][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/saheethas/ \ No newline at end of file From 6535efbb56e01671dfbd878f02da697afff38163 Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Thu, 18 Feb 2016 00:14:05 +0800 Subject: [PATCH 0311/1469] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8E=9F=E6=96=87?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E5=BA=8F=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Enable Multiple PHP-FPM Instances with Nginx or Apache.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20160217 How to Enable Multiple PHP-FPM Instances with Nginx or Apache.md b/sources/tech/20160217 How to Enable Multiple PHP-FPM Instances with Nginx or Apache.md index 68af7da0a4..4037c4aa92 100644 --- a/sources/tech/20160217 How to Enable Multiple PHP-FPM Instances with Nginx or Apache.md +++ b/sources/tech/20160217 How to Enable Multiple PHP-FPM Instances with Nginx or Apache.md @@ -19,8 +19,8 @@ Before going to the installation procedures, let us take a look on the pre-requi ### Pre-requisites ### - # Enable Mod_proxy_fcgi module - # Enable MPM_Event + 1. Enable Mod_proxy_fcgi module + 2. Enable MPM_Event Since, we are installing PHP-FPM on a EA3 server, we need to run EasyApache to compile Apache to enable these modules. From 8402f139fa2a53c878cbb7724f3f3355502ca970 Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Thu, 18 Feb 2016 10:23:29 +0800 Subject: [PATCH 0312/1469] =?UTF-8?q?20160218-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ginx as Reverse Proxy on Centos7 CPanel.md | 201 ++++++++++++++++++ 1 file changed, 201 insertions(+) create mode 100644 sources/tech/20160218 How to Set Nginx as Reverse Proxy on Centos7 CPanel.md diff --git a/sources/tech/20160218 How to Set Nginx as Reverse Proxy on Centos7 CPanel.md b/sources/tech/20160218 How to Set Nginx as Reverse Proxy on Centos7 CPanel.md new file mode 100644 index 0000000000..e3cc72cd8d --- /dev/null +++ b/sources/tech/20160218 How to Set Nginx as Reverse Proxy on Centos7 CPanel.md @@ -0,0 +1,201 @@ +How to Set Nginx as Reverse Proxy on Centos7 CPanel +================================================================================ + +Nginx is one of the fastest and most powerful web-server. It is known for its high performance and low resource utilization. It can be installed as both a standalone and a Reverse Proxy Web-server. In this article, I'm discussing about the installation of Nginx as a reverse proxy along with Apache on a CPanel server with latest CentOS 7 installed. + +Nginx as a reverse proxy will work as a frontend webserver serving static contents along with Apache serving the dynamic files in backend. This setup will boost up the overall server performance. + +Let's walk through the installation steps for Nginx as reverse proxy in CentOS7 x86_64 bit server with cPanel 11.52 installed. + +First of all, we need to install the EPEL repo to start-up with the process. + +### Step 1: Install the EPEL repo. ### + + root@server1 [/usr]# yum -y install epel-release + Loaded plugins: fastestmirror, tsflags, universal-hooks + Loading mirror speeds from cached hostfile + * EA4: 66.23.237.210 + * base: mirrors.linode.com + * extras: mirrors.linode.com + * updates: mirrors.linode.com + Resolving Dependencies + --> Running transaction check + ---> Package epel-release.noarch 0:7-5 will be installed + --> Finished Dependency Resolution + + Dependencies Resolved + + =============================================================================================================================================== + Package Arch Version Repository Size + =============================================================================================================================================== + Installing: + epel-release noarch 7-5 extras 14 k + +### Step 2: After installing the repo, we can start with the installation of the nDeploy RPM repo for CentOS to install our required nDeploy Webstack and Nginx plugin. ### + + root@server1 [/usr]# yum -y install http://rpm.piserve.com/nDeploy-release-centos-1.0-1.noarch.rpm + Loaded plugins: fastestmirror, tsflags, universal-hooks + nDeploy-release-centos-1.0-1.noarch.rpm | 1.7 kB 00:00:00 + Examining /var/tmp/yum-root-ei5tWJ/nDeploy-release-centos-1.0-1.noarch.rpm: nDeploy-release-centos-1.0-1.noarch + Marking /var/tmp/yum-root-ei5tWJ/nDeploy-release-centos-1.0-1.noarch.rpm to be installed + Resolving Dependencies + --> Running transaction check + ---> Package nDeploy-release-centos.noarch 0:1.0-1 will be installed + --> Finished Dependency Resolution + + Dependencies Resolved + + =============================================================================================================================================== + Package Arch Version Repository Size + =============================================================================================================================================== + Installing: + nDeploy-release-centos noarch 1.0-1 /nDeploy-release-centos-1.0-1.noarch 110 + +### Step 3: Install the nDeploy and Nginx nDeploy plugins. ### + + root@server1 [/usr]# yum --enablerepo=ndeploy install nginx-nDeploy nDeploy + Loaded plugins: fastestmirror, tsflags, universal-hooks + epel/x86_64/metalink | 9.9 kB 00:00:00 + epel | 4.3 kB 00:00:00 + ndeploy | 2.9 kB 00:00:00 + (1/4): ndeploy/7/x86_64/primary_db | 14 kB 00:00:00 + (2/4): epel/x86_64/group_gz | 169 kB 00:00:00 + (3/4): epel/x86_64/primary_db | 3.7 MB 00:00:02 + + Dependencies Resolved + + =============================================================================================================================================== + Package Arch Version Repository Size + =============================================================================================================================================== + Installing: + nDeploy noarch 2.0-11.el7 ndeploy 80 k + nginx-nDeploy x86_64 1.8.0-34.el7 ndeploy 36 M + Installing for dependencies: + PyYAML x86_64 3.10-11.el7 base 153 k + libevent x86_64 2.0.21-4.el7 base 214 k + memcached x86_64 1.4.15-9.el7 base 84 k + python-inotify noarch 0.9.4-4.el7 base 49 k + python-lxml x86_64 3.2.1-4.el7 base 758 k + + Transaction Summary + =============================================================================================================================================== + Install 2 Packages (+5 Dependent packages) + +With these steps, we've completed with the installation of Nginx plugin in our server. Now we need to configure Nginx as reverse proxy and create the virtualhost for the existing cPanel user accounts. For that we can run the following script. + +### Step 4: To enable Nginx as a front end Web Server and create the default configuration files. ### + + root@server1 [/usr]# /opt/nDeploy/scripts/cpanel-nDeploy-setup.sh enable + Modifying apache http and https port in cpanel + + httpd restarted successfully. + Created symlink from /etc/systemd/system/multi-user.target.wants/nginx.service to /usr/lib/systemd/system/nginx.service. + Created symlink from /etc/systemd/system/multi-user.target.wants/ndeploy_watcher.service to /usr/lib/systemd/system/ndeploy_watcher.service. + Created symlink from /etc/systemd/system/multi-user.target.wants/ndeploy_backends.service to /usr/lib/systemd/system/ndeploy_backends.service. + ConfGen:: saheetha + ConfGen:: satest + +As you can see these script will modify the Apache port from 80 to another port to make Nginx run as a front end web server and create the virtual host configuration files for the existing cPanel accounts. Once it is done, confirm the status of both Apache and Nginx. + +### Apache Status: ### + + root@server1 [/var/run/httpd]# systemctl status httpd + ● httpd.service - Apache Web Server + Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled) + Active: active (running) since Mon 2016-01-18 06:34:23 UTC; 12s ago + Process: 25606 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS) + Main PID: 24760 (httpd) + CGroup: /system.slice/httpd.service + ‣ 24760 /usr/local/apache/bin/httpd -k start + + Jan 18 06:34:23 server1.centos7-test.com systemd[1]: Starting Apache Web Server... + Jan 18 06:34:23 server1.centos7-test.com apachectl[25606]: httpd (pid 24760) already running + Jan 18 06:34:23 server1.centos7-test.com systemd[1]: Started Apache Web Server. + +### Nginx Status: ### + + root@server1 [~]# systemctl status nginx + ● nginx.service - nginx-nDeploy - high performance web server + Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled) + Active: active (running) since Sun 2016-01-17 17:18:29 UTC; 13h ago + Docs: http://nginx.org/en/docs/ + Main PID: 3833 (nginx) + CGroup: /system.slice/nginx.service + ├─ 3833 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf + ├─25473 nginx: worker process + ├─25474 nginx: worker process + └─25475 nginx: cache manager process + + Jan 17 17:18:29 server1.centos7-test.com systemd[1]: Starting nginx-nDeploy - high performance web server... + Jan 17 17:18:29 server1.centos7-test.com nginx[3804]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok + Jan 17 17:18:29 server1.centos7-test.com nginx[3804]: nginx: configuration file /etc/nginx/nginx.conf test is successful + Jan 17 17:18:29 server1.centos7-test.com systemd[1]: Started nginx-nDeploy - high performance web server. + +Nginx act as a frontend webserver running on port 80 and Apache configuration is modified to listen on http port 9999 and https port 4430. Please see their status below: + + root@server1 [/usr/local/src]# netstat -plan | grep httpd + tcp 0 0 0.0.0.0:4430 0.0.0.0:* LISTEN 17270/httpd + tcp 0 0 0.0.0.0:9999 0.0.0.0:* LISTEN 17270/httpd + tcp6 0 0 :::4430 :::* LISTEN 17270/httpd + tcp6 0 0 :::9999 :::* LISTEN 17270/httpd + +![apacheport](http://blog.linoxide.com/wp-content/uploads/2016/01/apacheport.png) + + root@server1 [/usr/local/src]# netstat -plan | grep nginx + tcp 0 0 127.0.0.1:80 0.0.0.0:* LISTEN 17802/nginx: master + tcp 0 0 45.79.183.73:80 0.0.0.0:* LISTEN 17802/nginx: master + +The virtualhost entries created for the existing users as located in the folder "**/etc/nginx/sites-enabled**". This file path is included in the Nginx main configuration file. + + root@server1 [/etc/nginx/sites-enabled]# ll | grep .conf + -rw-r--r-- 1 root root 311 Jan 17 09:02 saheetha.com.conf + -rw-r--r-- 1 root root 336 Jan 17 09:02 saheethastest.com.conf + +### Sample Vhost for a domain: ### + + server { + + listen 45.79.183.73:80; + #CPIPVSIX:80; + + # ServerNames + server_name saheetha.com www.saheetha.com; + access_log /usr/local/apache/domlogs/saheetha.com main; + access_log /usr/local/apache/domlogs/saheetha.com-bytes_log bytes_log; + + include /etc/nginx/sites-enabled/saheetha.com.include; + + } + +We can confirm the working of the web server status by calling a website in the browser. Please see the web server information on my server after the installation. + + root@server1 [/home]# ip a | grep -i eth0 + 3: eth0: mtu 1500 qdisc pfifo_fast state UP qlen 1000 + inet 45.79.183.73/24 brd 45.79.183.255 scope global dynamic eth0 + root@server1 [/home]# nginx -v + nginx version: nginx/1.8.0 + +![webserver-status](http://blog.linoxide.com/wp-content/uploads/2016/01/webserver.png) + +Nginx will create the virtual host automatically for any newly created accounts in cPanel. With these simple steps we can configure Nginx as reverse proxy on a CentOS 7/CPanel server. + +### Advantages of Nginx as Reverse Proxy: ### + + 1. Easy to install and configure + 2. Performance and efficiency + 3. Prevent DDOS attacks + 4. Allows .htaccess PHP rewrite rules + +I hope this article is useful for you guys. Thank you for referring to this. I would appreciate your valuable comments and suggestions on this for further improvements. + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/set-nginx-reverse-proxy-centos-7-cpanel/ + +作者:[Saheetha Shameer][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/saheethas/ \ No newline at end of file From f9dfc8e24cba3b6f0f45b8f487db74e130db33b9 Mon Sep 17 00:00:00 2001 From: Markgolzh <1134386961@qq.com> Date: Thu, 18 Feb 2016 17:01:56 +0800 Subject: [PATCH 0313/1469] =?UTF-8?q?=E6=88=91=E7=BF=BB=E8=AF=91=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rp请合并 --- ... Mode ASCII-art Box and Comment Drawing.md | 75 ++++++++++--------- 1 file changed, 38 insertions(+), 37 deletions(-) diff --git a/translated/tech/20151215 Linux or Unix Desktop Fun--Text Mode ASCII-art Box and Comment Drawing.md b/translated/tech/20151215 Linux or Unix Desktop Fun--Text Mode ASCII-art Box and Comment Drawing.md index 01b0051fef..ce9c76f324 100644 --- a/translated/tech/20151215 Linux or Unix Desktop Fun--Text Mode ASCII-art Box and Comment Drawing.md +++ b/translated/tech/20151215 Linux or Unix Desktop Fun--Text Mode ASCII-art Box and Comment Drawing.md @@ -1,15 +1,18 @@ -Linux/Unix桌面趣事:文本模式艺术框及注释图 + +Linux / Unix 桌面娱乐 : +文字模式的带有ASCII艺术的Box与评论绘制 + ================================================================================ -Boxes command is a text filter and a little known tool that can draw any kind of ASCII art box around its input text or code for fun and profit. You can quickly create email signatures, or create regional comments in any programming language. This command was intended to be used with the vim text editor, but can be tied to any text editor which supports filters, as well as from the command line as a standalone tool. -boxes是一个文本过滤器并且是一个鲜为人知的可以在文字或者代码周围绘出任何形式的ASCII艺术框的工具。你可以快速地创建一个email签名或者在任何语言中创建一个注释。这个命令可以和vim一起使用,但是可以和任何支持过滤和可以在命令行中使用独立工具的文本编辑器绑定在一起。。 +Boxes 命令不仅是一个文本过滤器,同时是一个很少人知道的可以为了乐趣或者需要在它的输入文本或者代码周围画各种ASCII艺术画的工具。你可以迅速创建邮件签名,或者使用各种编程语言创建局部评论。这个命令计划被vim文本编辑器使用,但是也可以被支持过滤的文本编辑器使用,同时从命令行作为一个单独的工具使用。 -### 任务: 安装 boxes ### -在Debian/Ubuntu中使用[apt-get命令][1]来安装boxes: +### 任务: 安装 boxes ### + +使用 [apt-get command][1] 在 Debian / Ubuntu Linux中安装 boxes : $ sudo apt-get install boxes -示例输出: +输出示例 : Reading package lists... Done Building dependency tree @@ -25,11 +28,11 @@ boxes是一个文本过滤器并且是一个鲜为人知的可以在文字或者 Processing triggers for man-db ... Setting up boxes (1.0.1a-2.3) ... -对于RHEL / CentOS / Fedora用户,使用[yum命令来安装boxes][2](首先[启用EPEL仓库][3]) +RHEL / CentOS / Fedora Linux 用户, 使用 [yum command to install boxes][2] (首先 [enable EPEL repo as described here][3]): # yum install boxes -示例输出: +输出示例 : Loaded plugins: rhnplugin Setting up Install Process @@ -61,52 +64,53 @@ boxes是一个文本过滤器并且是一个鲜为人知的可以在文字或者 boxes.x86_64 0:1.1-8.el6 Complete! -FreeBSD user can use the port as follows: -FreeBSD用户可以使用port: +FreeBSD 用户可以按如下来使用 : cd /usr/ports/misc/boxes/ && make install clean -或者使用pkg_add命令添加包: +或者,使用 pkg_add 命令来增加包: # pkg_add -r boxes -### 用给定的文字画出任何形式的框 ### +### 在一些给定文本周围画出任何种类的box ### -输入下面的额命令: +输入下列命令 : echo "This is a test" | boxes -或者指定设计: +或者,通过设置要使用的设计的名字来使用 : echo -e "\n\tVivek Gite\n\tvivek@nixcraft.com\n\twww.cyberciti.biz" | boxes -d dog -示例输出: +输出示例 : ![Unix / Linux: Boxes Command To Draw Various Designs](http://s0.cyberciti.org/uploads/l/tips/2012/06/unix-linux-boxes-draw-dog-design.png) -图01:Unix / Linux:Box命令来画出不同的设计 +Fig.01: Unix / Linux: Boxes 命令来画出各式各样的设计 -#### 我如何列出所有的设计? #### +#### 怎么样输出所有的设计 #### -语法是: +语法如下: boxes option pipe | boxes options echo "text" | boxes -d foo boxes -l --d选项设置使用的设计。语法是: +设计 -d 选项设置要使用的设计的名字 . 语法如下: + echo "Text" | boxes -d design pipe | boxes -d desig --l选项列出设计列表。它会列出配置文件中所有的设计,以及它的设计者的一些信息: +-l 选项列出所有设计 . 它显示在配置文件中的所有的box设计图,同时也显示关于其创作者的信息。 + boxes -l boxes -l | more boxes -l | less -示例输出: +输出示例: 43 Available Styles in "/etc/boxes/boxes-config": ------------------------------------------------- @@ -142,32 +146,32 @@ FreeBSD用户可以使用port: output truncated .. -### 我如何在vi/vim中使用boxes过滤文本? ### +### 在使用vi/vim文本编辑器时如何通过boxes过滤文本? ### -你可以在vi或者vim中使用任何外部命令。比如,[插入日期和时间][4],输入: +你可以使用vi或vim支持的任何附加命令,在这个例子中, [insert current date and time][4], 输入: !!date 或者 :r !date - -你需要在vim中输入上面的命令来读取date命令的输出。这可以在当前行中插入时间和日期: +你需要在vim中输入以上命令来读取数据命令的输出,这将在当前行后面加入日期和时分秒: Tue Jun 12 00:05:38 IST 2012 -你可以用boxes命令做同样的事情。如下创建一个示例脚本或者程序: +你可以用boxes命令做到同样的. 创建一个作为样本的shell脚本或者如下的一个c程序: + #!/bin/bash Purpose: Backup mysql database to remote server. Author: Vivek Gite Last updated on: Tue Jun, 12 2012 -现在输入下面的命令(移动光标到第二行,也就是说以Purpose开头的那行) +现在输入如下 (将光标移到第二行,也就是以"Purpose: ..."开头的行) 3!!boxes -你就会得到下面的示例输出: +瞧,你就会看到如下的输出 : #!/bin/bash /****************************************************/ @@ -175,24 +179,23 @@ FreeBSD用户可以使用port: /* Author: Vivek Gite */ /* Last updated on: Tue Jun, 12 2012 */ /****************************************************/ - -This video will give you an introduction to boxes command: -这个视频是boxes命令的一个介绍 +这个短片将会给你介绍boxes命令: 注:youtube 视频 -(视频01:boxes命令实践。顺便说一下,这是我的第一个视频,所以对我不要太认真并让我知道你们所想) -同样可见 +(Video:01: boxes command in action. BTW, this is my first video so go easy on me and let me know what you think.) -- boxes man页 +另见 + +- boxes man 手册 -------------------------------------------------------------------------------- via: http://www.cyberciti.biz/tips/unix-linux-draw-any-kind-of-boxes-around-text-editor.html 作者:Vivek Gite -译者:[geekpi](https://github.com/geekpi) +译者:[zky001](https://github.com/zky001) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -201,5 +204,3 @@ via: http://www.cyberciti.biz/tips/unix-linux-draw-any-kind-of-boxes-around-text [2]:http://www.cyberciti.biz/faq/rhel-centos-fedora-linux-yum-command-howto/ [3]:http://www.cyberciti.biz/faq/fedora-sl-centos-redhat6-enable-epel-repo/ [4]:http://www.cyberciti.biz/faq/vim-inserting-current-date-time-under-linux-unix-osx/ - - From bf55379eef0d8b14bfa0555568300fc2b2c2168e Mon Sep 17 00:00:00 2001 From: joeren Date: Thu, 18 Feb 2016 17:44:20 +0800 Subject: [PATCH 0314/1469] Update 20160217 How to Enable Multiple PHP-FPM Instances with Nginx or Apache.md --- ...o Enable Multiple PHP-FPM Instances with Nginx or Apache.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20160217 How to Enable Multiple PHP-FPM Instances with Nginx or Apache.md b/sources/tech/20160217 How to Enable Multiple PHP-FPM Instances with Nginx or Apache.md index 4037c4aa92..10eaaf1388 100644 --- a/sources/tech/20160217 How to Enable Multiple PHP-FPM Instances with Nginx or Apache.md +++ b/sources/tech/20160217 How to Enable Multiple PHP-FPM Instances with Nginx or Apache.md @@ -1,3 +1,4 @@ +Translating by GOLinux! How to Enable Multiple PHP-FPM Instances with Nginx / Apache ================================================================================ @@ -118,4 +119,4 @@ via: http://linoxide.com/linux-how-to/enable-multiple-php-fpm-instances-nginx-ap 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://linoxide.com/author/saheethas/ \ No newline at end of file +[a]:http://linoxide.com/author/saheethas/ From a4c3b419ee534969c86abfef15325f8db75d7f5b Mon Sep 17 00:00:00 2001 From: GOLinux Date: Thu, 18 Feb 2016 18:57:14 +0800 Subject: [PATCH 0315/1469] [Translated]How to Enable Multiple PHP-FPM Instances with Nginx/Apache.md --- ... PHP-FPM Instances with Nginx or Apache.md | 122 ------------------ 1 file changed, 122 deletions(-) delete mode 100644 sources/tech/20160217 How to Enable Multiple PHP-FPM Instances with Nginx or Apache.md diff --git a/sources/tech/20160217 How to Enable Multiple PHP-FPM Instances with Nginx or Apache.md b/sources/tech/20160217 How to Enable Multiple PHP-FPM Instances with Nginx or Apache.md deleted file mode 100644 index 10eaaf1388..0000000000 --- a/sources/tech/20160217 How to Enable Multiple PHP-FPM Instances with Nginx or Apache.md +++ /dev/null @@ -1,122 +0,0 @@ -Translating by GOLinux! -How to Enable Multiple PHP-FPM Instances with Nginx / Apache -================================================================================ - -PHP-FPM is also known as PHP FastCGI Process Manager. It is an advancement of PHP FastCGI implementation with more useful features for handling heavy-loaded servers and websites. Some of those features are listed below: - -### New Features ### - - - Advanced process managament capability with graceful start/stop options. - - Ability to run the processes with different userids/groupids listening on different ports and using different PHP configurations. - - Error logging. - - Acceleration upload support - - Special function to finish request and flush all data while doing some time consuming tasks - - Both Dynamic and Static Child process Spawning - - IP Address restriction - -In this article, I'm going to discuss about installing PHP-FPM along with Nginx and Apache on a CentOS 7 server running cPanel 11.52 with EA3(EasyApache) and how to manage those installed multiple PHP-FPM instances via CPanel. - -Before going to the installation procedures, let us take a look on the pre-requisites. - -### Pre-requisites ### - - 1. Enable Mod_proxy_fcgi module - 2. Enable MPM_Event - -Since, we are installing PHP-FPM on a EA3 server, we need to run EasyApache to compile Apache to enable these modules. - -You can refer my previous document on how to install Nginx as reverse proxy on a Apache server to confirm with the Nginx installation. - -I'll brief those installation steps once again here. You can refer to my previous documentation **(How to Set Nginx as Reverse Proxy on CentOS 7 /CPanel Server)** for details. - - Step 1: Install the Epel repo - Step 2: Install nDeploy RPM repo which is the most **IMPORTANT** step in this installation. - Step 3: Install nDeploy and Nginx plugin using yum from the nDeploy repo. - Step 4: Enable/Configure Nginx as reverse proxy - -Once this is done, install the PHP-FPM packages for all PHP versions available in the server. EA3 uses remi repository for installing these packages. You can run this nDeploy script to download all packages. - - root@server1 [~]# /opt/nDeploy/scripts/easy_php_setup.sh - Loaded plugins: fastestmirror, tsflags, universal-hooks - EA4 | 2.9 kB 00:00:00 - base | 3.6 kB 00:00:00 - epel/x86_64/metalink | 9.7 kB 00:00:00 - epel | 4.3 kB 00:00:00 - extras | 3.4 kB 00:00:00 - updates | 3.4 kB 00:00:00 - (1/2): epel/x86_64/updateinfo | 460 kB 00:00:00 - (2/2): epel/x86_64/primary_db - -Running this script will install all these FPM packages for PHP 54, PHP 55, PHP 56 and PHP 70. - - Installed Packages - php54-php-fpm.x86_64 5.4.45-3.el7.remi @remi - php55-php-fpm.x86_64 5.5.31-1.el7.remi @remi - php56-php-fpm.x86_64 5.6.17-1.el7.remi @remi - php70-php-fpm.x86_64 7.0.2-1.el7.remi @remi - -After this installation, you need to enable PHP-FPM SAPI for Apache. You can run this script to enable PHP-FPM instances. - - root@server1 [~]# /opt/nDeploy/scripts/apache_php-fpm_setup.sh enable - mod_proxy_fcgi.c - Please choose one default PHP version from the list below - PHP70 - PHP56 - PHP54 - PHP55 - Provide the exact desired version string here and press ENTER: PHP54 - ConfGen:: lxblogger - ConfGen:: blogr - ConfGen:: saheetha - ConfGen:: satest - which: no cagefsctl in (/usr/local/jdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/root/bin) - info [rebuildhttpdconf] Missing owner for domain server1.centos7-test.com, force lookup to root - Built /usr/local/apache/conf/httpd.conf OK - Waiting for “httpd” to restart gracefully …waiting for “httpd” to initialize …… - …finished. - -It will ask the required PHP version which you prefer to run as default on the server. You can enter those details and proceed to configure and generate the virtual host files for the existing domains. - -I've chosen PHP 54 as the default PHP-FPM version on my server. - -![confirm-php-fpm](http://blog.linoxide.com/wp-content/uploads/2016/01/confirm-php-fpm-1024x525.png) - -Even though, the server is configured with PHP-FPM 54, we can modify the PHP-FPM instances for the individual domains via cPanel. - -I'll explain you on how to modify the PHP-FPM instances for individual domains via cPanel using some screenshots. - -The installation of Nginx plugin will provide you with an icon of Nginx Webstack in your domain's cPanel. You can click on that icon to configure your Web server. I've logged into one of my domain's cPanel to configure it's Web server. - -Please check these snapshots. - -![nginx webstack](http://blog.linoxide.com/wp-content/uploads/2016/01/nginx-webstack.png) - -![nginxicon1](http://blog.linoxide.com/wp-content/uploads/2016/01/nginxicon1-1024x253.png) - -Now you can configure the web-server for the selected main domain as required(I've selected the main domain saheetha.com here). I've gone ahead with automatic configuration options since, I don't have any manual settings to add. - -![nginx_auto_proxy](http://blog.linoxide.com/wp-content/uploads/2016/01/nginx_auto_proxy-1024x408.png) - -Once Nginx is configured, you can select the PHP-FPM instance for your domain here. - -![php-fpm1](http://blog.linoxide.com/wp-content/uploads/2016/01/php-fpm1-1024x408.png) - -![php54](http://blog.linoxide.com/wp-content/uploads/2016/01/php54-1024x169.png) - -![php55](http://blog.linoxide.com/wp-content/uploads/2016/01/php55.png) - -As you can see in these snapshots, my default PHP-FPM on the server is **PHP 54** and I'm changing the PHP-FPM instance for my domain alone to **PHP 55**. Once you've modified the PHP-FPM for your domain, you can confirm it by accessing the **phpinfo** page. - -Thank you for referring to this article. I believe this article is really informative and useful for you. I would recommend your valuable comments on this :). - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/enable-multiple-php-fpm-instances-nginx-apache/ - -作者:[Saheetha Shameer][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/saheethas/ From a8c18cbe391dac6abd9e8279d7974dc20f440456 Mon Sep 17 00:00:00 2001 From: GOLinux Date: Thu, 18 Feb 2016 19:00:24 +0800 Subject: [PATCH 0316/1469] [Translated]How to Enable Multiple PHP-FPM Instances with Nginx or Apache.md --- ... PHP-FPM Instances with Nginx or Apache.md | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 translated/tech/20160217 How to Enable Multiple PHP-FPM Instances with Nginx or Apache.md diff --git a/translated/tech/20160217 How to Enable Multiple PHP-FPM Instances with Nginx or Apache.md b/translated/tech/20160217 How to Enable Multiple PHP-FPM Instances with Nginx or Apache.md new file mode 100644 index 0000000000..befa31312f --- /dev/null +++ b/translated/tech/20160217 How to Enable Multiple PHP-FPM Instances with Nginx or Apache.md @@ -0,0 +1,119 @@ +启用Nginx/Apache的PHP-FPM多实例 +================================================================================ + +PHP-FPM作为FastCGI进程管理器而广为熟知,它是PHP FastCGI实现的改进,带有更为有用的功能,用于处理高负载的服务器和网站。下面列出其中一些功能: +### 新功能 ### + + - 拥有具有优雅启动/停止选项的高级进程管理能力。 + - 可以以监听不同端口以及使用不同PHP配置的不同用户身份/组身份来运行进程。 + - 错误日志记录。 + - 支持上传加速。 + - 用于在处理一些耗时任务时结束请求和清空所有数据的特别功能。 + - 同时支持动态和静态子进程重生。 + - 支持IP地址限制。 + +在本文中,我将要讨论的是,在运行EA3下CPanel 11.52的CentOS 7服务器上与Nginx和Apache一起安装PHP-FPM,以及如何来通过CPanel管理这些安装好的多个PHP-FPM实例。 +Before going to the installation procedures, let us take a look on the pre-requisites. + +### 先决条件 ### + + 1. 启用 Mod_proxy_fcgi模块 + 2. 启用 MPM_Event + +由于我们要将PHP-FPM安装到一台EA3服务器,我们需要运行EasyApache来编译Apache以启用这些模块。 + +你们可以参考我以前写的,关于如何在Apache服务器上安装Nginx作为反向代理的文档来确认Nginx的安装。 + +这里,我将再次简述那些安装步骤。具体细节,你可以参考我之前写的**(如何在CentOS 7/CPanel服务器上配置Nginx反向代理)**一文。 + + 步骤 1:安装Epel仓库 + 步骤 2:安装nDeploy RPM仓库,这是此次安装中最为**重要**的步骤。 + 步骤 3:使用yum从nDeploy仓库安装nDeploy和Nginx插件。 + 步骤 4:启用/配置Nginx为反向代理。 + +完成这些步骤后,下面为服务器中所有可用PHP版本安装PHP-FPM包,EA3使用remi仓库来安装这些包。你可以运行这个nDeploy脚本来下载所有的包。 + + root@server1 [~]# /opt/nDeploy/scripts/easy_php_setup.sh + Loaded plugins: fastestmirror, tsflags, universal-hooks + EA4 | 2.9 kB 00:00:00 + base | 3.6 kB 00:00:00 + epel/x86_64/metalink | 9.7 kB 00:00:00 + epel | 4.3 kB 00:00:00 + extras | 3.4 kB 00:00:00 + updates | 3.4 kB 00:00:00 + (1/2): epel/x86_64/updateinfo | 460 kB 00:00:00 + (2/2): epel/x86_64/primary_db + +运行该脚本将为PHP 54,PHP 55,PHP 56和PHP 70安装所有这些FPM包。 + + Installed Packages + php54-php-fpm.x86_64 5.4.45-3.el7.remi @remi + php55-php-fpm.x86_64 5.5.31-1.el7.remi @remi + php56-php-fpm.x86_64 5.6.17-1.el7.remi @remi + php70-php-fpm.x86_64 7.0.2-1.el7.remi @remi + +在以上安装完成后,你需要为Apache启用PHP-FPM SAPI。你可以运行下面这个脚本来启用PHP-FPM实例。 + + root@server1 [~]# /opt/nDeploy/scripts/apache_php-fpm_setup.sh enable + mod_proxy_fcgi.c + Please choose one default PHP version from the list below + PHP70 + PHP56 + PHP54 + PHP55 + Provide the exact desired version string here and press ENTER: PHP54 + ConfGen:: lxblogger + ConfGen:: blogr + ConfGen:: saheetha + ConfGen:: satest + which: no cagefsctl in (/usr/local/jdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/root/bin) + info [rebuildhttpdconf] Missing owner for domain server1.centos7-test.com, force lookup to root + Built /usr/local/apache/conf/httpd.conf OK + Waiting for “httpd” to restart gracefully …waiting for “httpd” to initialize …… + …finished. + +它会问你需要运行哪个PHP版本作为服务器默认版本,你可以输入那些细节内容,然后继续配置并为现存的域生成虚拟主机文件。 + +我选择了PHP 54作为我服务器上的默认PHP-FPM版本。 + +![confirm-php-fpm](http://blog.linoxide.com/wp-content/uploads/2016/01/confirm-php-fpm-1024x525.png) + +虽然服务器配置了PHP-FPM 54,但是我们可以通过CPanel为各个独立的域修改PHP-FPM实例。 + +下面我将通过一些截图来为你们说明一下,怎样通过CPanel为各个独立域修改PHP-FPM实例。 + +Nginx插件的安装将为你的域的CPanel提供一个Nginx Webstack图标,你可以点击该图标来配置你的Web服务器。我已经登陆进了我其中的一个CPanel来配置相应的Web服务器。 + +请看这些截图。 + +![nginx webstack](http://blog.linoxide.com/wp-content/uploads/2016/01/nginx-webstack.png) + +![nginxicon1](http://blog.linoxide.com/wp-content/uploads/2016/01/nginxicon1-1024x253.png) + +现在,你可以根据需要为选中的主域配置web服务器(这里,我已经选择了主域saheetha.com)。我已经继续通过自动化配置选项来进行了,因为我不需要添加任何手动设置。 + +![nginx_auto_proxy](http://blog.linoxide.com/wp-content/uploads/2016/01/nginx_auto_proxy-1024x408.png) + +当Nginx配置完后,你可以在这里为你的域选择PHP-FPM实例。 + +![php-fpm1](http://blog.linoxide.com/wp-content/uploads/2016/01/php-fpm1-1024x408.png) + +![php54](http://blog.linoxide.com/wp-content/uploads/2016/01/php54-1024x169.png) + +![php55](http://blog.linoxide.com/wp-content/uploads/2016/01/php55.png) + +就像你在截图中所看到的,我服务器上的默认PHP-FPM是**PHP 54**,而我正要将我的域的PHP-FPM实例单独修改成**PHP 55**。当你为你的域修改PHP-FPM后,你可以通过访问**phpinfo**页面来确认。 + +谢谢你们参考本文,我相信这篇文章会给你提供不少信息和帮助。我会为你们推荐关于这个内容的有价值的评论 :)。 + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/enable-multiple-php-fpm-instances-nginx-apache/ + +作者:[Saheetha Shameer][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/saheethas/ From b7d17528a5cc1c83b6e6d8c0c069dcbbdb571310 Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 18 Feb 2016 20:05:24 +0800 Subject: [PATCH 0317/1469] Create A Linux-powered microwave oven.md --- .../tech/A Linux-powered microwave oven.md | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 sources/tech/A Linux-powered microwave oven.md diff --git a/sources/tech/A Linux-powered microwave oven.md b/sources/tech/A Linux-powered microwave oven.md new file mode 100644 index 0000000000..f1e35685b7 --- /dev/null +++ b/sources/tech/A Linux-powered microwave oven.md @@ -0,0 +1,51 @@ +A Linux-powered microwave oven +================================================================================ + +Scratching an itch is a recurring theme in presentations at [linux.conf.au](http://linux.conf.au/). As the open-hardware movement gains strength, more and more of these itches relate to the physical world, not just the digital. David Tulloh used his [presentation [WebM]](http://mirror.linux.org.au/linux.conf.au/2016/04_Thursday/D4.303_Costa_Theatre/Linux_driven_microwave.webm) on the “Linux Driven Microwave” to discuss how annoying microwave ovens can be and to describe his project to build something less irritating. + +Tulloh's story began when he obtained a microwave oven, admittedly an inexpensive one, with a user interface even worse than the norm. Setting the time required pressing buttons so hard that the microwave tended to get pushed away — a fact that was elegantly balanced by the door handle requiring a sufficiently hard tug to return the oven to its original position. While this is clearly an extreme case, Tulloh lamented that microwave ovens really hadn't improved noticeably in recent decades. They may have gotten a little cheaper and gained a few features that few people could use without poring over the instruction manual — the implied contrast to smartphones, which are widely used with little instruction, was clear. + +This microwave oven was not a lost cause — it gave its life to the greater good and became the prototype for an idea that Tulloh hopes to turn into a crowd-funded project if he can find the right match between features and demand: a Linux-driven microwave oven. + +![](https://static.lwn.net/images/2016/lca-oven-sm.jpg) + +## Adding novelty + +Adding a smartphone-like touchscreen and a network connection and encouraging a community to build innovative apps such as recipe sharing are fairly obvious ideas once you think to put “Linux” and “microwave oven” together, but Tulloh's vision and prototype lead well beyond there. Two novel features that have been fitted are a thermal camera and a scale for measuring weight. + +The thermal camera provides an eight-by-eight-pixel image of the contents of the oven with a precision of about two degrees. This is enough to detect if a glass of milk is about to boil over, or if the steak being thawed is in danger of getting cooked. In either case, the power can be reduced or removed. If appropriate, an alert can be sounded. This would not be the first microwave to be temperature sensitive — GE sold microwave ovens with temperature probes decades ago — but an always-present sensor is much more useful than a manually inserted probe, especially when there is an accessible API behind it. + +The second innovation is a built-in scale to weigh the food (and container) being cooked. Many recipes give cooking-time guidance based on weight and some microwave ovens allow you to enter the weight manually so it can do a calculation for you. With built-in scales, that can become automatic. Placing a scale reliably under the rotating plate typical of many microwave ovens would be a mechanical challenge that Tulloh did not think worth confronting. Instead his design is based on the “flat-plate” or “flat-bed” style of oven — placing a sensor at each of the four corners is mechanically straightforward and gives good results. + + [User interface] +Once you have these extra sensors — weight and temperature — connected to a suitable logic engine, more interesting possibilities can be explored. A cup of cold milk from the fridge will have a particular weight and temperature profile with a modest degree of error. Tulloh suggested that situation could be detected and some relevant options such as “Boil” or “Warm” could be offered for easy selection (a mock up of the interface is at right, a clickable version is [here](http://mwgui.tulloh.id.au/)). Simple machine learning could extend this to create a personalized experience. It would be easy to collect a history of starting profiles and cooking choices; when those patterns are detected, the most likely cooking choices could be made the easiest to select. + +![](https://static.lwn.net/images/2016/lca-ovengui-sm.png) + +## Overcoming staleness + +Beyond just new functionality, Tulloh wants to improve the functionality that already exists. Door handles as stiff as on Tulloh's cheap microwave may not be common, but few microwave oven doors seem designed to make life easy for people with physical handicaps. There are regulatory restrictions, particularly in the US, that require the oven to function only if there is positive confirmation that the door is actually shut. This confirmation must be resilient against simple fraud, so poking a stick in the hole must not trick the oven into working with the door open. In fact, there must be two independent confirmations and, if they disagree, a fuse must be blown so that a service call is required. Tulloh believes that a magnetic latch would provide much greater flexibility (including easy software control) and that magnetic keying similar to that used in a [magnetic keyed lock](https://en.wikipedia.org/wiki/Magnetic_keyed_lock) would allow the magnetic latch to pass certification. + +Another pain point with microwave ovens is the annoying sounds they make. Tulloh has discarded the beeper and hooked up a speaker to the Banana Pi that is controlling his prototype. This allows for more pleasant and configurable alerts as well as for advice and guidance through a text-to-speech system. Adding a microphone for voice control is an obvious next step. + +Many microwave ovens can do more than just set a time and a power level — they provide a range of power profiles for cooking, warming, defrosting, and so on. Adding precise temperature sensing will allow the community to extend this range substantially. A question from Andrew Tridgell in the audience wondered if tempering chocolate — a process that requires very precise temperature control — would be possible. Tulloh had no experience with the process, and couldn't make promises, but thought it was certainly worth looking in to. Even if that doesn't work out, it shows clear potential for value to be gained from community input. + +## Availability + +Tulloh would very much like to get these Linux-enabled microwave ovens out into the world to create a community and see where it goes. Buying existing ovens and replacing the electronics is not seen as a viable option. The result would be ugly and, given that a small-run smart microwave will inevitably cost more, potential buyers are going to want something that doesn't look completely out of place in their kitchen. + +Many components are available off-the-shelf (magnetron, processor board, thermal sensor) and others, such as a USB interface for the thermal sensor, are easily built. Prototype software is, of course, already available on [GitHub](https://github.com/lod?tab=repositories). The case and door are more of a challenge and would need to be made to order. Tulloh wants to turn this adversity into an opportunity by providing the option for left-handed microwave ovens and a variety of colors. + +A quick survey of the audience suggested that few people would hastily commit to his target price of $AU1000 for a new, improved, open oven. Whether a bit more time for reflection and a wider audience might tip the balance is hard to know. The idea is intriguing, so it seems worth watching Tulloh's [blog](http://david.tulloh.id.au/category/microwave/) for updates. + + +------------------------------------------------------------------------------ + + +via: https://lwn.net/Articles/674877/ + +作者:Neil Brown +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 683d6b5f114edf4a84c92759b702eaff34c62613 Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 18 Feb 2016 20:06:54 +0800 Subject: [PATCH 0318/1469] Rename A Linux-powered microwave oven.md to 20160218 A Linux-powered microwave oven.md --- ...crowave oven.md => 20160218 A Linux-powered microwave oven.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/tech/{A Linux-powered microwave oven.md => 20160218 A Linux-powered microwave oven.md} (100%) diff --git a/sources/tech/A Linux-powered microwave oven.md b/sources/tech/20160218 A Linux-powered microwave oven.md similarity index 100% rename from sources/tech/A Linux-powered microwave oven.md rename to sources/tech/20160218 A Linux-powered microwave oven.md From e4f469029bdc99ee22bc0ab8b7a8a0db956c134e Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 18 Feb 2016 20:21:04 +0800 Subject: [PATCH 0319/1469] =?UTF-8?q?20160218-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ng List of Raspberry Pi 2 Distributions.md | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 sources/tech/20160218 Tizen 3.0 Joins Growing List of Raspberry Pi 2 Distributions.md diff --git a/sources/tech/20160218 Tizen 3.0 Joins Growing List of Raspberry Pi 2 Distributions.md b/sources/tech/20160218 Tizen 3.0 Joins Growing List of Raspberry Pi 2 Distributions.md new file mode 100644 index 0000000000..5203be38d8 --- /dev/null +++ b/sources/tech/20160218 Tizen 3.0 Joins Growing List of Raspberry Pi 2 Distributions.md @@ -0,0 +1,43 @@ +Tizen 3.0 Joins Growing List of Raspberry Pi 2 Distributions +============================================================== +Last week’s news that Tizen 3.0 has been ported to the Raspberry Pi 2 Model B is the latest example of how the year-old ARMv7 version of the Pi is attracting ports from more powerful Linux distributions, most notably Fedora, Ubuntu MATE, and Snappy. The [Samsung Open Source Group’s Tizen for Pi](http://blogs.s-osg.org/bringing-tizen-to-a-raspberry-pi-2-near-you/) project has been underway for several years, achieving several beta releases, and now the effort has shifted to the new Tizen 3.0. It’s still in beta, but now you can create builds for the Pi 2 using tools from the [Yocto](https://www.yoctoproject.org/) Project and [OpenEmbedded project](http://www.openembedded.org/wiki/Main_Page). + +Tizen 3.0 offers performance and security improvements, multiple-user and 64-bit support, and an Internet of Things (IoT) framework. Samsung, the principal backer of the [Linux Foundation hosted Tizen project](https://www.tizen.org/), is using the Pi port to expand the base of developers using Tizen for IoT projects, according to an [IDG News Service post](http://www.cio.com/article/3031812/samsung-hopes-raspberry-pi-can-spread-tizen-os-adoption.html) that reported on the port. + +Although Samsung finally [shipped a Tizen-based](http://www.linux.com/news/embedded-mobile/mobile-linux/837843-samsung-sells-a-million-tizen-phones-as-mozilla-rethinks-firefox-os) phone in India last summer, and Gear smartwatches continue to use Tizen, the main focus now appears to be on IoT. At CES last month, Samsung [announced](http://www.linux.com/news/embedded-mobile/mobile-linux/877879-linux-based-drones-upstage-other-mobile-gadgets-at-ces) that all of its Tizen-based, 2016 Smart TVs will be able to act as SmartThings home automation hubs, letting users monitor the household while watching TV. + +## The Growing List of Pi Distros + +[Elinux.org](http://elinux.org/RPi_Distributions) lists some 46 ARMv6-ready distributions that run on all the Raspberry Pi boards. A separate listing notes two ARMv7-only distros that require the ARMv7 Raspberry Pi 2: Ubuntu MATE, which replaces the resource-intensive Unity desktop with the Gnome 2.0 flavored MATE, and Windows 10 IoT Core. The prominent placement of a Microsoft distribution is not as controversial as one might have thought. To many younger Linux developers and casual Pi hackers, Microsoft is just another tech company, not so much the evil empire loathed by old-time Linux hackers. + +Windows 10 IoT Core isn’t the only non-Linux distro running on the Pi. There’s also the Unix-like FreeBSD and NetBSD, as well as the revived RISC OS Pi version of the old Acorn Computers OS. Some of the 48 operating systems on the Elinux.org list are incomplete, out-of-date, or dedicated to limited niches. [DistroWatch](https://distrowatch.com/search.php?category=Raspberry+Pi) offers a more manageable list of 20. + +The [Raspberry Pi Foundation](https://www.raspberrypi.org/) still prominently posts a download page for its homegrown, Debian-based Raspbian, in both standard and NOOBS packages. This lightweight distro is still the most popular and typically the highest rated Linux build for the Pi. The Scratch-ready distro is especially equally suited for desktop use and embedded hacking with home automation gear, robots, and other IoT gizmos. Raspbian recently [received an update](http://news.softpedia.com/news/raspbian-gets-experimental-opengl-driver-gpu-now-used-for-acceleration-500152.shtml) with an experimental OpenGL driver for doing hardware acceleration on the VideoCore IV GPU used with the Pi 2’s Broadcom BCM2836 SoC. + +The Pi Foundation also lists several [third-party downloads](https://www.raspberrypi.org/downloads/). In addition to Windows 10 IoT Core and and Ubuntu MATE, the list includes the lightweight, transactionally focused [Snappy Ubuntu Core](http://www.linux.com/news/embedded-mobile/mobile-linux/804659-ubuntu-snappy-leads-mobile-linux-migration-to-iot) for the Pi 2. Canonical is aiming Snappy at those who want an app platform and cloud integration in embedded devices like drones and IoT devices. Snappy also came out last week in a version designed for [Intel NUC mini-PCs](https://insights.ubuntu.com/2016/02/10/ubuntu-core-is-available-for-the-intel-nuc/). The Pi Foundation also posts images for RISC OS and the education-focused PINET. There are also two media center distros related to KODI/XBMC: OSMC and OpenElec. + +In addition to its list of 48 released distros, Elinux.org lists several “announced” distros including Firefox OS, [openSUSE](https://www.reddit.com/r/openSUSE/comments/3hxrz4/opensuse_on_a_raspberry_pi_2_armv7/), Meego MER & XBMC, Puppy, RPi-Buildroot, and Aros. Missing, however, is Tizen, as well as newly announced ports such as [Manjaro-ARM](http://www.linux-arm.info/index.php/1103-hands-on-more-adventures-with-manjaro-arm-for-the-raspberry-pi-2) and the CentOS 7-based [CentOS AltArch 7](http://www.linux-arm.info/index.php/1054-centos-altarch-7-now-available-for-aarch64-powerpc64-powerpc8-le-and-armhfp) for the Pi 2, Banana Pi, and CubieTruck SBCs. + +## Android Still Pi in the Sky + +Elinux.org’s “announced” list also includes Android and a Miracast-like program called Android Transporter. People have been trying to port Android to the Pi for years; yet, even with the more suitable [Pi 2](http://www.linux.com/news/embedded-mobile/mobile-linux/807087-faster-raspberry-pi-2-says-yes-to-ubuntu-and-windows-but-wheres-android) shipping for a year now, Android is still pretty much a no-show. Android can run on lower-powered SoCs than the Pi 2’s quad-core, Cortex-A7, but the limited 1GB of RAM and the lack of GPU acceleration are big challenges. Perhaps Raspbian’s OpenGL driver could be ported to Android as well, although the Pi Foundation does not seem very interested in Android. + +There are several Android-for-Pi projects in the works, but without the foundation’s backing, there is still nothing close to a complete port. Projects include an [AOSP Marshmallow](http://www.linux.com/news/embedded-mobile/mobile-linux/886126-tizen-30-joins-growing-list-of-raspberry-pi-2-distros#!topic/android-rpi/YW_gGr8wZkk) patch-set from Peter Yoon, as well as a [RaspAnd](https://extonlinux.wordpress.com/2015/04/05/run-android-5-1-lollipop-exton-build-on-your-raspberry-pi-2/) release based on the Ubuntu-based RaspEx, which makes use of the Aptoide package manager to load some Android 5.1 apps on a Pi 2. The [Razdroid project](https://www.raspberrypi.org/forums/viewtopic.php?f=73&t=19106), which aims to tap into the secrets of Broadcom hardware acceleration, seems to have stalled. + +Most Rasp Pi users, however, appear more interested in [Ubuntu MATE](https://ubuntu-mate.org/raspberry-pi/), which was never optimized for ARMv6, and Fedora. For years, Pi users have run the lightweight spin-down of Fedora called Pidora, but with the Pi 2, they can now try the real thing. The Raspberry Pi Foundation has yet to post Fedora, but the recent [betas of the Pi 2 port](https://chisight.wordpress.com/2015/10/19/fedora-22-or-23-on-raspberry-pi-2/) have received high marks. + +Other Linux distributions that regularly make Top Pi distro lists include Arch Linux, which unlike most ports from mature Linux distros, works just fine on ARMv6. A recent [TechRadar Top 5 list](http://www.techradar.com/us/news/software/5-of-the-most-popular-raspberry-pi-distros-1292537) includes several more niche distros in addition to Raspbian. These include the OSMC media player environment, RetroPie for playing classic games, OpenMediaVault for turning your Pi into a NAS, and Pi MusicBox, based on the Mopidy music streaming server. + +Beyond Ubuntu, Fedora, and Tizen, other distros, both arcane and general, are heading for the Pi 2, as well. The platform is rapidly expanding the boundaries of, as well as redefining the meaning of, desktop Linux. + +------------------------------------------------------------------------------ + +via: http://www.linux.com/news/embedded-mobile/mobile-linux/886126-tizen-30-joins-growing-list-of-raspberry-pi-2-distros + +作者:[Eric Brown][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/42808) From 47be313d3315e8713b5f4e29ac2350f126b656f2 Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 18 Feb 2016 20:32:55 +0800 Subject: [PATCH 0320/1469] =?UTF-8?q?20160218-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...160218 Russia Announces Switch to Linux.md | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 sources/news/20160218 Russia Announces Switch to Linux.md diff --git a/sources/news/20160218 Russia Announces Switch to Linux.md b/sources/news/20160218 Russia Announces Switch to Linux.md new file mode 100644 index 0000000000..aa7fb66a86 --- /dev/null +++ b/sources/news/20160218 Russia Announces Switch to Linux.md @@ -0,0 +1,33 @@ +This Week in Linux News:Russia Announces Switch to Linux, Outdated Fight for the Linux Desktop +========================================================================= +This week in Linux news, Russia announces a possible switch to Linux, Jack Wallen ponders the importance of the Linux Desktop in 2016, and more! Get up-to-date on the Latest Linux news with our weekly digest. + +1. Russia announces a possible switch to Linux in retalliation against Western business embargo on Crimea. + + [Russia Might Switch Thousands of Government Computers to Linux to Spite Microsoft](http://www.techradar.com/news/world-of-tech/russia-might-switch-thousands-of-government-computers-to-linux-to-spite-microsoft-1314762) - TechRadar + +2. "It doesn't matter if Linux has 1% or 99% of the desktop market share" writes Jack Wallen. + + [Should the Fight for the Linux Desktop Really Matter?](http://www.techrepublic.com/article/should-the-fight-for-the-linux-desktop-really-matter/) - TechRepublic + +3. The Linux Foundation's Hyperledger Project experiences growth in membership since its launch in December. + + [Linux Foundation-Led Blockchain Project Grows to 30 Members](http://www.coindesk.com/linux-foundation-led-hyperledger-project-swells-to-30-members/) - CoinDesk + +4. Docker's founder and CTO, Solomon Hykes, suggests Alpine Linux will be the company's new default OS. + + [Is Docker Ditching Ubuntu Linux? Confusion Reigns](http://www.infoworld.com/article/3031847/open-source-tools/is-docker-ditching-ubuntu-linux-confusion-reigns.html) - InfoWorld + +5. The Node.js Foundation, a Linux Foundation Collaborative Project, will bring in popular third-party "Express" package. + + [The Node.js Foundation Plans to Incubate One of the Community’s Most Popular Packages](http://www.linux.com/news/software/applications/885174-this-week-in-linux-news-russia-announces-switch-to-linux-outdated-fight-for-the-linux-desktop-a-more#gref)- The Next Web + +------------------------------------------------------------------------------ + +via: http://www.linux.com/news/software/applications/885174-this-week-in-linux-news-russia-announces-switch-to-linux-outdated-fight-for-the-linux-desktop-a-more + +作者:[linux.com][linux.com] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From e1423fd93635f7b85b6d9c8b28841108d81edf7a Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 18 Feb 2016 20:43:32 +0800 Subject: [PATCH 0321/1469] =?UTF-8?q?20160218-4=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Releases Free Linux IDE for 32-Bit MCUs.md | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 sources/tech/20160218 ST Releases Free Linux IDE for 32-Bit MCUs.md diff --git a/sources/tech/20160218 ST Releases Free Linux IDE for 32-Bit MCUs.md b/sources/tech/20160218 ST Releases Free Linux IDE for 32-Bit MCUs.md new file mode 100644 index 0000000000..d90f6bfbce --- /dev/null +++ b/sources/tech/20160218 ST Releases Free Linux IDE for 32-Bit MCUs.md @@ -0,0 +1,54 @@ +ST Releases Free Linux IDE for 32-Bit MCUs +================================================= + +![](http://www.linux.com/images/stories/66866/STM32_Nucleo_expansion_board.jpg) + +The 32-bit microcontroller world is starting to open up to Linux. This week, leading ARM Cortex-M vendor STMicroelectronics (ST) [released](http://www.st.com/web/en/press/p3781) a free Linux desktop version of its development software for its line of STM32 microcontroller units (MCUs). The tools include ST’s STM32CubeMX configurator and initialization tool, as well as its [System Workbench for STM32 (SW4STM32)](http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1533/PF261797) , an Eclipse-based IDE created by Ac6 Tools. SW4STM32 is supported with toolchain, forums, blogs, and technical support by the [openSTM32.org](http://www.openstm32.org/tiki-index.php?page=HomePage) development community. + +"The Linux community is known to attract creative free-thinkers who are adept at sharing ideas and solving challenges efficiently," stated Laurent Desseignes, Microcontroller Ecosystem Marketing Manager, Microcontroller Division, STMicroelectronics. "We are now making it ultra-easy for them to apply their skills to create imaginative new products, leveraging the features and performance of our STM32 family." + +Linux is the leading platform for Internet of Things gateways and hubs, as well as higher-end IoT endpoints. Yet, much of the IoT revolution, as well as the wearables market, is based on tiny, low-power microcontrollers, increasingly Cortex-M chips. A small subset of these can run the stripped-down uCLinux (see below), but none support more comprehensive Linux distributions. Instead, they are controlled with real-time operating systems (RTOSes) or go bare-bones with no OS at all. The firmware development work is typically done on a Windows-based Integrated Development Environment (IDE). + +With ST’s free tools, Linux developers can more easily tap this new realm. ST’s tools, some of which should also be available for Mac OS/X in the second quarter, work with [STM32 Nucleo](http://www.st.com/web/en/catalog/tools/FM146/CL2167/SC2003?icmp=sc2003_pron_pr-stm32f446_dec2014&sc=stm32nucleo-pr5) boards, Discovery kits, and Evaluation boards. The Nucleo boards are available in 32-, 64-, and 144-pin versions, and offer hardware add-ons such as Arduino connectors. + +The STM32CubeMX configurator and SW4STM32 IDE enable Linux developers to configure microcontrollers and develop and debug code. SW4STM32 supports the ST-LINK/V2 debugging tool under Linux via an adapted version of the [OpenOCD](http://openocd.org/) community project. + +The software is compatible with microcontroller firmware within the STM32Cube embedded-software packages or Standard Peripheral Library, says ST. Targets include ST’s full range of MCUs, from entry-level Cortex-M0 cores to high-performing M7 chips, including M0+, M3, and DSP-extended M4 cores. + +ST is not the first 32-bit MCU vendor to offer Linux-ready IDEs for Cortex-M chips, but it appears to be one of the first major free Linux platforms. For example, NXP, whose share of the MCU market increased with its recent acquisition of Freescale (Kinetis MCUs, among others), offers an [LPCXpresso IDE](http://www.nxp.com/pages/lpcxpresso-ide:LPCXPRESSO) with Linux, Windows, and Mac support. However, LPCXpresso costs $450 per individual seat. + +Microsemi, which integrates Cortex-M3 chips in its [SmartFusion FPGA SoCs](http://www.microsemi.com/products/fpga-soc/soc-processors/arm-cortex-m3) has a [Libero IDE](http://www.linux.com/news/embedded-mobile/mobile-linux/884961-st-releases-free-linux-ide-for-32-bit-mcus#device-support) available for Red Hat Enterprise Linux (RHEL) in addition to Windows. However, Libero requires a license, and the RHEL version lacks support for add-on packages such as FlashPro and SoftConsole. + +## Why Learn MCU-Speak? + +Even if a Linux developer has no plans to load uClinux on a Cortex-M chip, knowledge of MCUs should come in handy. This is especially true with complex, heterogeneous IoT projects that extend from MCU-based endpoints to cloud platforms. + +For prototyping and hobbyist projects, an interface to an Arduino board offers fairly easy access to MCU benefits. Yet beyond prototyping, developers often replace the Arduino board and its 8-bit ATmega32u4 MCU with a faster 32-bit Cortex-M chip with additional functionality. This includes improved memory addressing, independent clock settings for the core and various buses, and in the case of some [Cortex-M7](http://www.electronicsnews.com.au/products/stm32-mcus-with-arm-cortex-m7-processors-and-graph) chips, rudimentary graphics. + +Other categories where MCU development skills might come in handy include wearables, where low power, low cost, and small size give MCUs an edge, and robotics and drones where real-time processing and motor control are the main benefits. In robotics, you’re likely to see Cortex-A and Cortex-M both integrated in the same product. + +There’s also a modest trend toward system-on-chips adding MCUs to Linux-driven Cortex-A cores, as with the [NXP i.MX6 SoloX](http://linuxgizmos.com/freescales-popular-i-mx6-soc-sprouts-a-cortex-m4-mcu/). While most embedded projects don’t use such hybrid SoCs or combine applications processor and MCUs on the same product, developers may increasingly find themselves working on product lines that extend from low-end MCU models to Linux- or Android-driven Cortex-A based designs. + +## uClinux Stakes Linux Claim in MCUs + +With the rise of IoT, we’re starting to see more SBCs and computer-on-modules that run uClinux on 32-bit MCUs. Unlike other Linux distributions, uClinux does not require a memory management unit (MMU). uClinux does, however, have higher memory requirements than most MCUs can meet. The distro requires higher end Cortex-M4 and Cortex-M4 MCUs with built-in memory controllers supporting external DRAM chips. + +[Amptek’s iCon](http://www.semiconductorstore.com/Amptek/) SBCs run uClinux on NXP LPC Cortex-M3 and -M4 chips, offering familiar trappings like WiFi, Bluetooth, USB, and other interfaces. Arrow’s [SF2+](http://linuxgizmos.com/iot-dev-kit-runs-uclinux-on-a-microsemi-cortex-m3-fpga-soc/) IoT development kit runs uClinux on an Emcraft Systems SmartFusion2 COM based on Microsemi’s 166MHz, Cortex-M3/FPGA SmartFusion2 hybrid SoC. + +[Emcraft](http://www.emcraft.com/), which sells uClinux-based COMs based on ST and NXP, as well as Microsemi MCUs, has been actively promoting the role of uClinux on 32-bit MCUs. Increasingly, uClinux is up against ARM’s own [Mbed OS](http://linuxgizmos.com/arm-announces-mbed-os-for-iot-devices/), at least on high-end MCU projects that require wireless communications and more sophisticated rules-based operation. Proponents of Mbed and modern, open source RTOSes like FreeRTOS say that uClinux requires too much RAM overhead to make it affordable for IoT endpoints. However, Emcraft and other uCLinux proponents claim the costs are overstated, and are worth the more extensive Linux wireless and interface support available even in a stripped down distro like uClinux. + +When asked for comment on the ST release, Emcraft director of engineering Vladimir Khusainov had this to say: “ST’s decision to port its development tools to Linux is good news for Emcraft since it allows Linux users an easy way to start working with embedded STM MCUs. We expect that, having had a chance to get familiar with STM devices using the ST configurator and embedded libraries, some of those users may become interested in running embedded Linux (in its uClinux form) on the target.” + +For a recent overview of uClinux on Cortex-M4, check out this [slide show](http://events.linuxfoundation.org/sites/events/files/slides/optimize-uclinux.pdf) from last year’s Embedded Linux Conference by Jim Huang and Jeff Liaw. More on Cortex-M processors in general may be found in this tidy [AnandTech overview](http://www.anandtech.com/show/8400/arms-cortex-m-even-smaller-and-lower-power-cpu-cores). + +------------------------------------------------------------------------------ + +via: http://www.linux.com/news/embedded-mobile/mobile-linux/884961-st-releases-free-linux-ide-for-32-bit-mcus + +作者:[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://www.linux.com/community/forums/person/42808 From 8136b37aaf7dc2ca5ff8ec43994c76b60e37bfdf Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 18 Feb 2016 21:01:59 +0800 Subject: [PATCH 0322/1469] =?UTF-8?q?20160218-5=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Getting to Know Linux File Permissions.md | 147 ++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 sources/tech/20160218 Getting to Know Linux File Permissions.md diff --git a/sources/tech/20160218 Getting to Know Linux File Permissions.md b/sources/tech/20160218 Getting to Know Linux File Permissions.md new file mode 100644 index 0000000000..03f6d5018e --- /dev/null +++ b/sources/tech/20160218 Getting to Know Linux File Permissions.md @@ -0,0 +1,147 @@ +Getting to Know Linux File Permissions +========================================== + +![](http://www.linux.com/images/stories/66866/files_a.png) + +One of the most basic tasks in Linux is setting file permissions. Understanding how this is done should be considered a must-know, first step in your travels through the Linux ecosystem. As you might expect, such a fundamental issue within the operating environment hasn’t changed much over the years. In fact, the Linux file permission system is taken directly from the UNIX file permission (and even uses many of the same tools). + +But, don’t think for a second that understanding file permissions is something you’ll wind up having to spend days and days studying...it’s actually quite simple. Let’s walk through what you need to know and how to put it all together. + +## The Bits and Pieces + +The first thing you need to understand is what file permissions apply to. Effectively what you do is apply a permission to a group. When you break it down, the concept really is that simple. But what are the permissions and what are the groups? + +There are three types of permissions you can apply: + +- read — gives the group permission to read the file (indicated with `r`) + +- write — gives the group permission to edit the file (indicated with `w`) + +- execute — gives the group permission to execute (run) the file (indicated with `x`) + +To better explain how this is applied to a group, you could, for example, give a group permission to read and write to a file, but not execute the file. Or, you could give a group permission to read and execute a file, but not write to a file. You can even give a group full permission to read, write, and execute a file or strip a group of any access to a file by removing all permissions. + +Now, what are the groups? There are four: + +- user — the actual owner of the file + +- group — users in the file’s group + +- others — other users not in the file’s group + +- all — all users + +For the most part, you will only really ever bother with the first three groups. The all group is really only used as a shortcut (I’ll explain later). + +So far so simple, right? Let’s layer on a bit of complexity. + +If you open up a terminal window and issue the command ls -l, you will see a line-by-line listing of all files and folders within the current working directory (Figure 1 above). + +If you look in the far left column, you’ll notice listings like `-rw-rw-r--`. + +That listing should actually be looked at like so: + +>rw- rw- r-- + +As you can see, the listing is broken into three sections: + +- rw- + +- rw- + +- r-- + +The order is quite important...for both permissions and for groups. The order is always: + +- User Group Others — for groups + +- Read Write Execute — for permissions + +In our permissions listing example above, the User has read/write permission, the Group has read/write permission, and Others has only read permission. Had any of those groups been given executable permissions, it would have been represented with an x. + +## Numerical Equivalent + +Let’s make this even more complex. Each permission can also be represented by a number. The numbers are: + +- Read — 4 + +- Write — 2 + +- Execute — 1 + +The numerical substitution isn’t an apples to apples change. You can’t drop in: + +>-42-42-4-- + +Instead, what you do is add up the numbers you want for each group. Let’s stick with our example above (`-rw-rw-r—`). To give the User group read and write permission, you would add up 4+2 to get 6. For the Group, you need the same permissions, so they get the same number. You only want Others to have read permissions, so they get 4. The numerical equivalent is now: + +>664 + +So, if you want to give a file 664 permissions, you’d issue the chmod command like this: + +>chmod 664 FILENAME + +where FILENAME is the name of the file. + +## Changing Permissions + +Now that you understand the actual permissions of files, it’s time to learn how to change those permissions. This is done with the chmod command. One of the first things you must understand is that, to be able to change the permissions of a file, either you must be the owner of the file or you must have permission to edit the file (or have admin access by way of su or sudo). Because of that, you cannot just jump around in the directory structure and change permissions of files at will. + +Let’s stick with our example (`-rw-rw-r--`). Suppose this file (we’ll name it script.sh) is actually a shell script and needs to be executed...but you only want to give yourself permission to execute that script. At this point, you should be thinking, “Ah, then I need the permission listing to read `-rwx-rw-r--`!”. To get that `x` bit in there, you’d run the chmod command like so: + +>chmod u+x script.sh + +At this point, the listing will be -rwx-rw-r--. + +If you wanted to give both User and Group executable permission, the command would look like: + +>chmod ug+x script.sh + +See how this works? Let’s make it interesting. Say, for whatever reason, you accidentally give all groups executable permissions for that file (so the listing looks like `-rwx-rwx-r-x`). If you want to strip Others of executable permissions, issue the command: + +>chmod o-x script.sh + +What if you want to completely remove executable permission from the file? You can do that two ways: + +>chmod ugo-x script.sh + +or + +>chmod a-x script.sh + +That’s where all comes into play. This is used to make the process a bit more efficient. I prefer to avoid using a as it could lead to issues (such as, when you accidentally issue the command chmod `a-rwx` script.sh). + +## Directory Permissions + +You can also execute the chmod command on a directory. When you create a new directory as a user, it is typically created with the following permissions: + +>drwxrwxr-x + +NOTE: The leading d indicates it is a directory. + +As you can see, both User and Group have executable permission for the folder. This does not mean that any files created in the folder will have the same permissions (files will be created with the default system permissions of `-rw-rw-r--`). But, suppose you do create files in this new directory, and you want to strip Group of write permissions. You don’t have to change into the directory and then issue the chmod command on all the files. You can add the R option (which means recursive) to the chmod command and change the permission on both the folder and all the containing files. + +Now, suppose our example is a folder named TEST and within it is a number of scripts — all of which (including the TEST folder) have permissions `-rwxrwxr-x`. If you want to strip Group of write permissions, you could issue the command: + +>chmod -R g-w TEST + +If you now issue the command ls `-l`, you will see the TEST folder now has a permission listing of `drwxr-xr-x`. Group has been stripped of its write permissions (as will all the files within). + +## Permission to Conclude + +At this point, you should now have a solid understand of the basic Linux file permissions. There are more advanced issues that you can now easily study, such as setuid and setgid and ACLs. Without a good foundation of the basics, however, you’d quickly get lost with those next-level topics. + +Linux file permissions haven’t changed much, since the early days. And, they most likely won’t change much going into the future. + + +------------------------------------------------------------------------------ + +via: http://www.linux.com/learn/tutorials/885268-getting-to-know-linux-file-permissions + +作者:[Jack Wallen][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/93 From 480813356abe9606acec9037b0c292b8e8bd928d Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 18 Feb 2016 21:06:17 +0800 Subject: [PATCH 0323/1469] =?UTF-8?q?20160218-6=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20160218 A Linux-powered microwave oven.md | 1 - 1 file changed, 1 deletion(-) diff --git a/sources/tech/20160218 A Linux-powered microwave oven.md b/sources/tech/20160218 A Linux-powered microwave oven.md index f1e35685b7..109212ad14 100644 --- a/sources/tech/20160218 A Linux-powered microwave oven.md +++ b/sources/tech/20160218 A Linux-powered microwave oven.md @@ -41,7 +41,6 @@ A quick survey of the audience suggested that few people would hastily commit to ------------------------------------------------------------------------------ - via: https://lwn.net/Articles/674877/ 作者:Neil Brown From 10ccb319a19d83164857e9ec94db554b6b9528ae Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 18 Feb 2016 21:17:42 +0800 Subject: [PATCH 0324/1469] =?UTF-8?q?20160218-7=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...creates diabetes project for the masses.md | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 sources/tech/20160218 Mozilla contributor creates diabetes project for the masses.md diff --git a/sources/tech/20160218 Mozilla contributor creates diabetes project for the masses.md b/sources/tech/20160218 Mozilla contributor creates diabetes project for the masses.md new file mode 100644 index 0000000000..7ac86c8045 --- /dev/null +++ b/sources/tech/20160218 Mozilla contributor creates diabetes project for the masses.md @@ -0,0 +1,34 @@ +Mozilla contributor creates diabetes project for the masses +================================================================ + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/myopensourcestory.png?itok=6TXlAkFi) + +My open source story started in high school as a student. I always considered myself to be a hacker—not the malicious type, but the curious type who liked to tinker with code and hardware. My first encounter with open source was in 2001 when I installed my first Linux distro, [Lindows](https://en.wikipedia.org/wiki/Linspire). Of course, I was also an early user of [Mozilla Firefox](https://www.mozilla.org/en-US/firefox/new/?utm_source=firefox-com&utm_medium=referral). + +As a result of my early adoption of Linux, the first version I used was 1.0.4 (if I recall correctly), and I immediately fell in love. While I did not stay long with Lindows, hopping across many distros ([Debian](https://www.debian.org/), [Puppy Linux](http://puppylinux.org/main/Overview%20and%20Getting%20Started.htm), [SUSE](https://www.suse.com/), [Slackware](http://www.slackware.com/), [Ubuntu](http://ubuntu.com/)) over the years I continued to use open source software on a daily basis from my youth into adulthood. + +Eventually, I consistently used Ubuntu. Around the release of Hardy Heron I started some of my first contributions to Ubuntu, helping out on IRC and helping users locally who needed help. With Ubuntu being where I cut my teeth in open source, it has always had a special place in my heart. The community behind Ubuntu is very diverse, passionate, and friendly and everyone comes together with some shared common goals but also individuals' goals as drivers for why they contribute to open source. + +After having contributed to Ubuntu for a while, I started contributing upstream to projects like Debian, [GNOME](https://www.gnome.org/), [Ganeti](https://code.google.com/p/ganeti/), and many others. In the past few years I have contributed to over 40 different open source projects, some small and some very large. + +After some changes in direction in the Ubuntu project, I ended up deciding not only that was it time for me to try something new, but that also I wanted to put my contributions into something new. So I started getting involved in Mozilla around 2009, helping out on IRC and then eventually getting involved with the [Mozilla WebFWD program](https://webfwd.org/), becoming a team member, then the [Mozilla Reps Program](https://reps.mozilla.org/), [Mozilla DevRel Program](https://wiki.mozilla.org/Devrel), and then for just over two years was a Firefox Community Release Manager overseeing the release of Firefox Nightly and Firefox ESR. Contributing to Mozilla was an even more rewarding experience than contributions to other open source projects. Of all the open source communities I've been involved in, Mozilla has been the most diverse, largest, and friendliest. + +One thing that has happened over the years in terms of my feelings about open source is I've become more and more aligned to the values of free software and more defensive of things like privacy and respecting licensing and working in the open. I believe all three of those topics are very important to open source, and while many may not care about these things it's important that people advocate for them. + +And here I am today, no longer a full-time contributor to other people's open source projects. Recently being diagnosed with diabetes, I saw a gap in the open source ecosystem where open source health software was not very abundant. Where it did exist, it was not as active as other open source software applications like Linux distros or browsers. + +I recently founded my own open source project, [Glucosio](http://www.glucosio.org/), to bring open source diabetes management and research software to the masses. My years of contributing to open source projects and observing various structures has really come in handy being a project leader now. I'm very excited about the future of Glucosio, but most importantly about the future open source and how that will play out in health and medicine. + +There is a lot of potential for software innovation in healthcare, and I think we will soon see a startup disrupt healthcare and medicine with open source solutions. + +------------------------------------------------------------------------------ + +via: https://opensource.com/life/15/11/my-open-source-story-ben-kerensa + +作者:[opensource.com][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:opensource.com From 81b7e1c8d8cdae0dbd061f32126392b5ac84d516 Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 18 Feb 2016 21:32:41 +0800 Subject: [PATCH 0325/1469] =?UTF-8?q?20160218-8=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...untu Edition Announced and It's a Beast.md | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 sources/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md diff --git a/sources/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md b/sources/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md new file mode 100644 index 0000000000..5fb0d286d0 --- /dev/null +++ b/sources/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md @@ -0,0 +1,37 @@ +Meizu PRO 5 Ubuntu Edition Announced and It's a Beast +======================================================== + +## Canonical and Meizu have just revealed that Meizu PRO 5 Ubuntu Edition will be available for pre-order during Mobile World Congress 2016. + +It's been a while since we last heard something from Meizu, but it looks like the collaboration between Canonical and the Chinese hardware maker is still alive. From the looks of it, the previous Meizu MX4 Ubuntu Edition was only a limited release, so only a small number of devices have been sold. + +We can only hope that Meizu PRO 5 Ubuntu Edition will be made available in greater numbers, especially since it's a much newer phone that's still supported by Meizu. + +This latest Meizu PRO 5 Ubuntu Edition is the fifth official device that comes with Ubuntu Touch, and we'll likely see many more phones and maybe tablets with this operating system landing in 2016. + +##Meizu PRO 5 Ubuntu Edition is a beast + +Canonical says that it's the most powerful Ubuntu smartphone launched to date, and they are right, not to mention that it's also the biggest, if we don't count the tablet. Meizu PRO 5 features a Samsung Exynos 7420 Octa-core processor, a 5.7-inch 1920x1080 AMOLED display, Corning Gorilla Glass 3, and LPDDR4 memory technology. + +Many of you will probably ask if this new phone is also capable of desktop convergence, and it looks that users are in luck. + +"Canonical remains committed to the vision of reinventing personal computing through a single, adaptive platform for all personal device form factors. As such, while the PRO 5 lacks MHL output, the software running on the Meizu PRO 5 is the latest code which also powers recently announced tablets and other devices and is capable of providing a traditional desktop experience," the company explained. + +Meizu PRO 5 was initially launched back in September 2015. Users will also get a 21 MP back camera, and the phone can shoot video at 2160p and 30fps. It also comes with a fingerprint sensor and a Li-Ion 3050 mAh battery with fast charging. + +For now, the phone will only be available in China and Europe, and the preorders will be opened during the Mobile World Congress 2016 that takes place between February 22 and 25. + +![](http://i1-news.softpedia-static.com/images/fitted/620x/meizu-pro-5-ubuntu-edition-announced-and-it-s-a-beast-photos-500526-11.jpg) + + +------------------------------------------------------------------------------ + +via: http://www.linux.com/news/embedded-mobile/mobile-linux/886322-meizu-pro-5-ubuntu-edition-announced-and-its-a-beast + +作者:[Silviu Stahie][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://news.softpedia.com/editors/browse/silviu-stahie From 630a8ea4c531cfa7c22da8cb59c333fa6b267fba Mon Sep 17 00:00:00 2001 From: miaolin Date: Thu, 18 Feb 2016 21:35:02 +0800 Subject: [PATCH 0326/1469] Update 20160218 Mozilla contributor creates diabetes project for the masses.md --- ...ozilla contributor creates diabetes project for the masses.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160218 Mozilla contributor creates diabetes project for the masses.md b/sources/tech/20160218 Mozilla contributor creates diabetes project for the masses.md index 7ac86c8045..61e5c08883 100644 --- a/sources/tech/20160218 Mozilla contributor creates diabetes project for the masses.md +++ b/sources/tech/20160218 Mozilla contributor creates diabetes project for the masses.md @@ -1,3 +1,4 @@ +translating by ynmlml Mozilla contributor creates diabetes project for the masses ================================================================ From 849eb6500f1ee20c228562613ca4c5677507e731 Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 18 Feb 2016 21:38:49 +0800 Subject: [PATCH 0327/1469] =?UTF-8?q?20160218-9=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Systems Patched for Critical glibc Flaw.md | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 sources/tech/20160218 Linux Systems Patched for Critical glibc Flaw.md diff --git a/sources/tech/20160218 Linux Systems Patched for Critical glibc Flaw.md b/sources/tech/20160218 Linux Systems Patched for Critical glibc Flaw.md new file mode 100644 index 0000000000..19c654e27e --- /dev/null +++ b/sources/tech/20160218 Linux Systems Patched for Critical glibc Flaw.md @@ -0,0 +1,50 @@ +Linux Systems Patched for Critical glibc Flaw +================================================= + +**Google exposed a critical flaw affecting major Linux distributions. The glibc flaw could have potentially led to remote code execution.** + +Linux users today are scrambling to patch a critical flaw in the core glibc open-source library that could be exposing systems to a remote code execution risk. The glibc vulnerability is identified as CVE-2015-7547 and is titled, "getaddrinfo stack-based buffer overflow." + +The glibc, or GNU C Library, is an open-source implementation of the C and C++ programming language libraries and is part of every major Linux distribution. Google engineers came across the CVE-2015-7547 issue when they were attempting to connect into a certain host system and a segmentation fault (segfault) occurred, causing the connection to crash. Further investigation revealed that glibc was at fault and the crash could potentially achieve an arbitrary remote code execution condition. + +"The glibc DNS client side resolver is vulnerable to a stack-based buffer overflow when the getaddrinfo() library function is used," Google wrote in a blog post. "Software using this function may be exploited with attacker-controlled domain names, attacker-controlled DNS [Domain Name System] servers, or through a man-in-the-middle attack." + +Actually exploiting the CVE-2015-7547 issue is not trivial, but it is possible. To prove that the issue can be exploited, Google has published proof-of-concept (PoC) code on GitHub that demonstrates if an end user or system is vulnerable. + +"The server code triggers the vulnerability and therefore will crash the client code," the GitHub PoC page states. + +Mark Loveless, senior security researcher at Duo Security, explained that the main risk of CVE-2015-7547 is to Linux client-based applications that rely on DNS responses. + +"There are some specific conditions, so not every single application will be impacted, but it appears that several command-line utilities, including the popular SSH [Secure Shell] client could trigger the flaw," Loveless told eWEEK. "We deem this serious mainly because of the existing risks to Linux systems, but also because of the potential for other issues." + +Other issues could potentially include a risk of an email-based attack that triggers the vulnerable glibc getaddrinfo() library call. Also of note is the fact that the vulnerability was in the code for years before it was discovered. + +Google's engineers were not the first or only group to discover the security risk in glibc. The issue was first reported to a glibc bug [tracker](https://sourceware.org/bugzilla/show_bug.cgi?id=1866) on July 13, 2015. The roots of the flaw go back even further with the actual code commit that introduced the flaw first in glibc 2.9, which was released in May 2008. + +Linux vendor Red Hat also independently was looking at the bug in glibc and on Jan. 6, 2016, Google and Red Hat developers confirmed that they had been independently working on the same vulnerability as part of the initial private discussion with upstream glibc maintainers. + +"Once it was confirmed that both teams were working on the same vulnerability, we collaborated on potential fixes, mitigations and regression testing," Florian Weimer, principal software engineer for product security at Red Hat, told eWEEK. "We also worked together to make the test coverage as wide as possible to catch any related problems in the code to help prevent future issues." + +It took years to discover that there was a security issue with the glibc code because that flaw isn't obvious or immediately apparent. + +"To diagnose bugs in a networking component, like a DNS resolver, it is common to look at packet traces which were captured while the issue was encountered," Weimer said. "Such packet captures were not available in this case, so some experimentation was needed to reproduce the exact scenario that triggered the bug." + +Weimer added that once the packet captures were available, considerable effort went into validating the fix, leading to a series of refinements culminating in the regression test suite that was contributed upstream to the glibc project. + +In many cases in Linux, the Security Enhanced Linux (SELinux) mandatory access security controls can mitigate the risk of potential vulnerabilities, but that's not the case with the new glibc issue. + +"The risk is a compromise of important system functionality due to the execution of arbitrary code supplied by an attacker," Weimer said. "A suitable SELinux policy can contain some of the damage an attacker might do and constrain their access to the system, but DNS is used by many applications and system components, so SELinux policies offer only limited containment for this issue." + +Alongside the vulnerability disclosure today, there is now a patch available to mitigate the potential risk of CVE-2015-7547. + +------------------------------------------------------------------------------ + +via: http://www.eweek.com/security/linux-systems-patched-for-critical-glibc-flaw.html + +作者:[Michael Kerner][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://twitter.com/TechJournalist From 53edb51ee2248ea32f3f3dc1da200e4c63799440 Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 18 Feb 2016 21:49:57 +0800 Subject: [PATCH 0328/1469] =?UTF-8?q?20160218-10=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... 9 Key Trends in Hybrid Cloud Computing.md | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 sources/tech/20160218 9 Key Trends in Hybrid Cloud Computing.md diff --git a/sources/tech/20160218 9 Key Trends in Hybrid Cloud Computing.md b/sources/tech/20160218 9 Key Trends in Hybrid Cloud Computing.md new file mode 100644 index 0000000000..003405b4b7 --- /dev/null +++ b/sources/tech/20160218 9 Key Trends in Hybrid Cloud Computing.md @@ -0,0 +1,74 @@ +9 Key Trends in Hybrid Cloud Computing +======================================== + +All three forms of cloud computing – public, private, and hybrid – have undergone considerable evolution since the concepts first gained the attention of IT years ago. Hybrid cloud is the overwhelming favorite form of the cloud, with [88% of firms surveyed](https://www.greenhousedata.com/blog/hybrid-continues-to-be-most-popular-cloud-option-adoption-accelerating) rating it as important or critical to their business. + +The lightning-fast evolution of hybrid cloud means the conventional wisdom of a year or two back is already obsolete. So we asked several industry analysts where they saw the hybrid cloud headed in 2016 and got some interesting answers. + +1. **2016 might be the year that we get hybrid cloud to actually work.** + + By its very nature, hybrid cloud relies on private cloud, which has proven elusive for most enterprises. The fact is that the public cloud – Amazon, Google, Microsoft – have had much more investment and a longer head start. The private cloud has hamstrung the hybrid cloud's growth and usability. + + There hasn't been as much investment in the private cloud because by its very nature, the private cloud means keeping and investing in your own data center. And many public cloud providers are pushing enterprises to reduce or eliminate their data center spending all together. + + However, this year will see the private cloud start to catch up thanks to advances in OpenStack and Microsoft's Azure Stack, which is basically a private cloud in a box. The tools, infrastructures, and architectures to support hybrid cloud are also becoming much more robust. + +2. **Containers, microservices, and unikernels will bolster the hybrid cloud.** + + These are all cloud native technologies and will all be more or less mainstream by the end of 2016, analysts predict. They are maturing rapidly and serving as a viable alternative to virtual machines, which require more resources. + + More importantly, they work in an on-premises scenario as well as an off-premises scenario. Containerization and orchestration allow rapid scale up, scale out, and service migration between public and private cloud, making it even easier to move your services around. + +3. **Data and relevance take center stage** + + The cloud, in all its forms, has been in growth mode. That makes it a technology story. But with the cloud shifting into maturity, data and relevance become more important, according to the consultancy [Avoa](http://avoa.com/2016/01/01/2016-is-the-year-of-data-and-relevance/). At first, the cloud and Big Data were all about sucking up as much data as possible. Then they worried about what to do with it. + + In 2016, organizations will hone their craft in how data is collected and used. There is still much progress to be made in the technological and cultural aspects that must be dealt with. But 2016 should bring a renewed focus on the importance of data from all aspects and finding the most relevant information, not just lots of it. + +4. **Cloud services move beyond just on-demand workloads** + + AWS got its start as a place where a programmer/developer could spin up a VM real quick, get some work done, and get off. That's the essence of on-demand use, and given how much it can cost to leave those services constantly running, there is almost a disincentive to keep them running 24/7. + + However, IT organizations are starting to act as service brokers to provide all manner of IT services to their in-house users. This can be anything from in-house IT services, public cloud infrastructure providers, platform-as-a-service, and software-as-a-service. + + They will increasingly recognize the value of tools like cloud management platforms to provide consistent policy-based management over many of these different services. And they will see the value of technology such as containers to enhance portability. However, cloud service brokering in the sense of rapidly moving workloads between clouds for price arbitrage and related reasons will continue to be a non-starter. + +5. **Service providers become cloud service providers** + + Up to now, buying cloud services has been a direct sale model. The user was frequently the buyer of AWS EC2 services, either through officially recognized channels at work or through Shadow IT. But as cloud services become more comprehensive, and the menu of services more confusing, more and more people are turning to resellers and services providers to act as the purchaser of IT services for them. + + A recent survey by 2nd Watch, a Seattle-based cloud services provider, found nearly 85 percent of IT executives in the United States would be willing to pay a small premium to buy public cloud from a channel partner if it were to make it less complex. And about four out of every five within that 85 percent would shell out an extra 15 percent or more, the survey found. One in three executives surveyed said they could use the help in buying, using, and managing public cloud services. + +6. **IoT and cloud is to 2016 what mobile and cloud was to 2012** + + IoT is gaining mindshare and, more importantly, it's moving from test beds to real use cases. The cloud is a vital part for IoT due to its distributed nature, and for industrial IoT, where machinery and heavy equipment talk to back-end systems, a hybrid cloud will be most natural driver because the connection, data collection, and processing will happen in a hybrid cloud environment, due to perceived benefits of the private cloud side, like security and privacy. + +7. **The NIST definition of the cloud begins to break down** + + In 2011, the National Institute of Standards and Technology published "[The NIST Definition of Cloud Computing](http://csrc.nist.gov/publications/nistpubs/800-145/SP800-145.pdf)" (PDF) that became the standard definitions of private, public, and hybrid cloud terms and as-a-service models. + + Over time, though, the definitions have changed. IaaS has become much more complex, supporting things like OpenStack, [Swift](https://wiki.openstack.org/wiki/Swift) for object storage and [Neutron networking](https://wiki.openstack.org/wiki/Neutron). PaaS seems to be fading out because there's little that separates it from traditional middleware application development. And SaaS, which was just apps accessed through a browser, is losing steam because with so many cloud APIs for apps and services, you can access them through anything, not just a browser. + +8. **Analytics becomes more important** + + Analytics will be a huge growth opportunity for hybrid cloud because the high volume of data used in analytics is well suited to cloud, with its advantages of large scale and elasticity. For some forms of analytics, like highly sensitive data, then the private cloud will still rule. But the private cloud is part of the hybrid cloud, so either way, hybrid cloud wins. + +9. **Security takes on a new urgency** + + As hybrid cloud grows in 2016 and adds all kinds of new technologies, like IoT and containers, this just adds more vulnerable surface areas for data breaches. Add to it the tendency to rush into a new technology and then secure it later, which happens all the time, along with inexperienced technologists who don't think to secure the system – and you have a recipe for disaster. + + When new technologies come out, management discipline almost always lags and we think about securing the technology later. Containers are a good example. You can download all kinds of sample containers from Docker, but do you know where it came from? Docker had to go back and add security verifications after it started letting people download and run containers without any idea what was really in it. + + Mobile technologies like Path and Snapchat had major security problems a few years back as the smartphone market was taking off. It's inevitable that a new technology will be exploited by the bad guys. So security researchers will have their hands full trying to secure these new technologies. Probably after they get deployed. + +------------------------------------------------------------------------------ + +via: http://www.datamation.com/cloud-computing/9-key-trends-in-hybrid-cloud-computing.html + +作者:[Andy Patrizio][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.datamation.com/author/Andy-Patrizio-90720.html From 33c670f207f02c2bdec4e7e268991a6bf2864f22 Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 18 Feb 2016 21:53:56 +0800 Subject: [PATCH 0329/1469] =?UTF-8?q?20160218-11=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... in the Series with Hundreds of Changes.md | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 sources/tech/20160218 Linux Kernel 4.1.18 LTS Is the Biggest in the Series with Hundreds of Changes.md diff --git a/sources/tech/20160218 Linux Kernel 4.1.18 LTS Is the Biggest in the Series with Hundreds of Changes.md b/sources/tech/20160218 Linux Kernel 4.1.18 LTS Is the Biggest in the Series with Hundreds of Changes.md new file mode 100644 index 0000000000..2bf7e02ce7 --- /dev/null +++ b/sources/tech/20160218 Linux Kernel 4.1.18 LTS Is the Biggest in the Series with Hundreds of Changes.md @@ -0,0 +1,28 @@ +Linux Kernel 4.1.18 LTS Is the Biggest in the Series with Hundreds of Changes +================================================================================= + +**It looks like renowned kernel maintainer Greg Kroah-Hartman is on vacation, as Sasha Levin has had the great pleasure of [announcing](http://lkml.iu.edu/hypermail/linux/kernel/1602.2/00520.html) earlier today, February 16, 2016, the general availability of the eighteenth maintenance release of Linux kernel 4.1 LTS.** + +Being a long-term supported kernel branch, Linux 4.1 will receive updates and patches for a few more years, and today's maintenance build proves that the kernel developers are committed to keeping the series stable and reliable for all GNU/Linux operating systems that use it. Linux kernel 4.1.18 LTS is a massive release with a total of 228 files changes, consisting of 5,304 insertions and 1,128 deletions. + +What's new in Linux kernel 4.1.18 LTS? Well, let's start with improvements to the ARM, ARM64 (AArch64), MIPS, PA-RISC, m32r, PowerPC (PPC), s390, and x86 hardware architectures. Moreover, there are enhancements to the Btrfs, CIFS, NFS, XFS, OCFS2, OverlayFS, and UDF filesystems, networking stack fixes, especially for mac80211, as well as multiple core, crypto, and mm improvements and sound updates. + +"I'm announcing the release of the 4.1.18 kernel. All users of the 4.1 kernel series must upgrade," says Sasha Levin. "The updated 4.1.y git tree can be found at: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.1.y and can be browsed at the normal kernel.org git web browser: http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary." + +## Numerous drivers have been updated + +Besides the architectures, filesystems, sound, networking, crypto, mm, and core kernel improvements, Linux kernel 4.1.18 LTS updates various drivers for better hardware support. This is in particular for things like Bluetooth, DMA, EDAC, GPU (mostly Radeon and Intel i915), InfiniBand, IOMMU, IRQchip, MD, MMC, DVB, networking (mostly wireless), PCI, SCSI, USB, thermal, staging, TTY, and Virtio. + +As usual, we're urging all users of Linux kernel-based operating systems that use kernel packages from the Linux 4.1 LTS series to update to today's 4.1.18 release as soon as possible. This can be done either by installing the update from the default software repositories or by manually compiling the sources, which you can download right now from the [kernel.org](http://kernel.org/) website or via [Softpedia](http://linux.softpedia.com/get/System/Operating-Systems/Kernels/Linux-Kernel-Stable-1960.shtml). + +------------------------------------------------------------------------------ + +via: http://news.softpedia.com/news/linux-kernel-4-1-18-lts-is-the-biggest-in-the-series-with-hundreds-of-changes-500500.shtml + +作者:[Marius Nestor ][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://news.softpedia.com/editors/browse/marius-nestor From 5ae3d0069a2c6bc697827d74ae2c3e28e669308c Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 18 Feb 2016 21:55:46 +0800 Subject: [PATCH 0330/1469] =?UTF-8?q?20160218-12=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...anonical's ZFS Plans Are Lining Up For Ubuntu 16.04.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 sources/tech/20160218 Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04.md diff --git a/sources/tech/20160218 Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04.md b/sources/tech/20160218 Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04.md new file mode 100644 index 0000000000..0b1e9b9502 --- /dev/null +++ b/sources/tech/20160218 Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04.md @@ -0,0 +1,8 @@ +Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04 +======================================================= + +Ubuntu developers have been working on [ZFS support for Ubuntu 16.04](http://www.phoronix.com/scan.php?page=news_item&px=ZFS-For-Ubuntu-16.04) and all of that file-system support is getting squared away. + +EXT4 will continue to be the default for Ubuntu 16.04 installations, but ZFS support will be automatically built into the Ubuntu Linux kernel releases, the module will automatically load when needed, zfsutils-linux is part of the main Ubuntu archive, and the support is being backed to commercial customers via Canonical. + +For those interested in official ZFS support for Ubuntu Linux, Canonical's Dustin Kirkland has written [a new blog post](http://blog.dustinkirkland.com/2016/02/zfs-is-fs-for-containers-in-ubuntu-1604.html) covering some of the details and why "ZFS is *the* FS for Containers in Ubuntu 16.04!" From 20d355bab055bfdaa49e0d75d9c8dd6d8945a0f4 Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 18 Feb 2016 21:58:16 +0800 Subject: [PATCH 0331/1469] =?UTF-8?q?20160218-12=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...l's ZFS Plans Are Lining Up For Ubuntu 16.04.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sources/tech/20160218 Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04.md b/sources/tech/20160218 Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04.md index 0b1e9b9502..32c822289c 100644 --- a/sources/tech/20160218 Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04.md +++ b/sources/tech/20160218 Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04.md @@ -1,8 +1,22 @@ Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04 ======================================================= +![](https://www.phoronix.com/assets/categories/ubuntu.jpg) + Ubuntu developers have been working on [ZFS support for Ubuntu 16.04](http://www.phoronix.com/scan.php?page=news_item&px=ZFS-For-Ubuntu-16.04) and all of that file-system support is getting squared away. EXT4 will continue to be the default for Ubuntu 16.04 installations, but ZFS support will be automatically built into the Ubuntu Linux kernel releases, the module will automatically load when needed, zfsutils-linux is part of the main Ubuntu archive, and the support is being backed to commercial customers via Canonical. For those interested in official ZFS support for Ubuntu Linux, Canonical's Dustin Kirkland has written [a new blog post](http://blog.dustinkirkland.com/2016/02/zfs-is-fs-for-containers-in-ubuntu-1604.html) covering some of the details and why "ZFS is *the* FS for Containers in Ubuntu 16.04!" + +------------------------------------------------------------------------------ + +via: https://www.phoronix.com/scan.php?page=news_item&px=Ubuntu-ZFS-Continues-16.04&utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+Phoronix+%28Phoronix%29 + +作者:[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/ From 3e1eac235ef9b29ad76c130e9a3e99479dc10f20 Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 18 Feb 2016 22:08:26 +0800 Subject: [PATCH 0332/1469] =?UTF-8?q?20160218-13=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...inux developers think of Git and GitHub.md | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 sources/tech/20160218 What do Linux developers think of Git and GitHub.md diff --git a/sources/tech/20160218 What do Linux developers think of Git and GitHub.md b/sources/tech/20160218 What do Linux developers think of Git and GitHub.md new file mode 100644 index 0000000000..9002025820 --- /dev/null +++ b/sources/tech/20160218 What do Linux developers think of Git and GitHub.md @@ -0,0 +1,93 @@ +What do Linux developers think of Git and GitHub? +===================================================== + +**Also in today’s open source roundup: DistroWatch reviews XStream Desktop 153, and Street Fighter V is coming to Linux and SteamOS in the spring** + +## What do Linux developers think of Git and GitHub? + +The popularity of Git and GitHub among Linux developers is well established. But what do developers think of them? And should GitHub really be synonymous with Git itself? A Linux redditor recently asked about this and got some very interesting answers. + +Dontwakemeup46 asked his question: + +>I am learning Git and Github. What I am interested in is how these two are viewed by the community. That git and github are used extensively, is something I know. But are there serious issues with either Git or Github? Something that the community would love to change? + +[More at Reddit](http://api.viglink.com/api/click?format=go&jsonp=vglnk_145580413015211&key=0a7039c08493c7c51b759e3d13019dbe&libId=iksc5hc8010113at000DL3yrsuvp7&loc=http%3A%2F%2Fwww.infoworld.com%2Farticle%2F3033059%2Flinux%2Fwhat-do-linux-developers-think-of-git-and-github.html&v=1&out=https%3A%2F%2Fwww.reddit.com%2Fr%2Flinux%2Fcomments%2F45jy59%2Fthe_popularity_of_git_and_github%2F&ref=http%3A%2F%2Fwww.linux.com%2Fnews%2Fsoftware%2Fapplications%2F886008-what-do-linux-developers-think-of-git-and-github&title=What%20do%20Linux%20developers%20think%20of%20Git%20and%20GitHub%3F%20%7C%20InfoWorld&txt=More%20at%20Reddit) + +His fellow Linux redditors responded with their thoughts about Git and GitHub: + +>Derenir: ”Github is not affliated with Git. + +>Git is made by Linus Torvalds. + +>Github hardly supports Linux. + +>Github is a corporate bordelo that tries to make money from Git. + +>[https://desktop.github.com/](http://api.viglink.com/api/click?format=go&jsonp=vglnk_145580415025712&key=0a7039c08493c7c51b759e3d13019dbe&libId=iksc5hc8010113at000DL3yrsuvp7&loc=http%3A%2F%2Fwww.infoworld.com%2Farticle%2F3033059%2Flinux%2Fwhat-do-linux-developers-think-of-git-and-github.html&v=1&type=U&out=https%3A%2F%2Fdesktop.github.com%2F&ref=http%3A%2F%2Fwww.linux.com%2Fnews%2Fsoftware%2Fapplications%2F886008-what-do-linux-developers-think-of-git-and-github&title=What%20do%20Linux%20developers%20think%20of%20Git%20and%20GitHub%3F%20%7C%20InfoWorld&txt=https%3A%2F%2Fdesktop.github.com%2F) see here no Linux Support.” + +>**Bilog78**: ”A minor update: git hasn't been “made by Linus Torvalds” for a while. The maintainer is Junio C Hamano and the main contributors after him are Jeff King and Shawn O. Pearce.” + +>**Fearthefuture**: ”I like git but can't understand why people even use github anymore. From my point of view the only thing it does better than bitbucket are user statistics and the larger userbase. Bitbucket has unlimited free private repos, much better UI and very good integration with other services such as Jenkins.” + +>**Thunger**: ”Gitlab.com is also nice, especially since you can host your own instance on your own servers.” + +>**Takluyver**: ”Lots of people are familiar with the UI of Github and associated services like Travis, and lots of people already have Github accounts, so it's a good place for projects to be. People also use their Github profile as a kind of portfolio, so they're motivated to put more projects on there. Github is a de facto standard for hosting open source projects.” + +>**Tdammers**: ”Serious issue with git would be the UI, which is kind of counterintuitive, to the point that many users just stick with a handful of memorized incantations. + +Github: most serious issue here is that it's a proprietary hosted solution; you buy convenience, and the price is that your code is on someone else's server and not under your control anymore. Another common criticism of github is that its workflow isn't in line with the spirit of git itself, particularly the way pull requests work. And finally, github is monopolizing the code hosting landscape, and that's bad for diversity, which in turn is crucial for a thriving free software community.” + +>**Dies**: ”How is that the case? More importantly, if that is the case, then what's done is done and I guess we're stuck with Github since they control so many projects.” + +>**Tdammers**: ”The code is hosted on someone else's server, "someone else" in this case being github. Which, for an open-source project, is not typically a huge problem, but still, you don't control it. If you have a private project on github, then the only assurance you have that it will remain private is github's word for it. If you decide to delete things, then you can never be sure whether it's been deleted, or just hidden. + +Github doesn't control the projects themselves (you can always take your code and host it elsewhere, declaring the new location the "official" one), it just has deeper access to the code than the developers themselves.” + +>**Drelos**: ”I have read a lot of praises and bad stuff about Github ([here's an example](http://api.viglink.com/api/click?format=go&jsonp=vglnk_145580428524613&key=0a7039c08493c7c51b759e3d13019dbe&libId=iksc5hc8010113at000DL3yrsuvp7&loc=http%3A%2F%2Fwww.infoworld.com%2Farticle%2F3033059%2Flinux%2Fwhat-do-linux-developers-think-of-git-and-github.html&v=1&out=http%3A%2F%2Fwww.wired.com%2F2015%2F06%2Fproblem-putting-worlds-code-github%2F&ref=http%3A%2F%2Fwww.linux.com%2Fnews%2Fsoftware%2Fapplications%2F886008-what-do-linux-developers-think-of-git-and-github&title=What%20do%20Linux%20developers%20think%20of%20Git%20and%20GitHub%3F%20%7C%20InfoWorld&txt=here%27s%20an%20example)) but my simple noob question is why aren't efforts towards a free and open "version" ?” + +>**Twizmwazin**: ”GitLab is sorta pushing there.” + +[More at Reddit](http://api.viglink.com/api/click?format=go&jsonp=vglnk_145580429720714&key=0a7039c08493c7c51b759e3d13019dbe&libId=iksc5hc8010113at000DL3yrsuvp7&loc=http%3A%2F%2Fwww.infoworld.com%2Farticle%2F3033059%2Flinux%2Fwhat-do-linux-developers-think-of-git-and-github.html&v=1&out=https%3A%2F%2Fwww.reddit.com%2Fr%2Flinux%2Fcomments%2F45jy59%2Fthe_popularity_of_git_and_github%2F&ref=http%3A%2F%2Fwww.linux.com%2Fnews%2Fsoftware%2Fapplications%2F886008-what-do-linux-developers-think-of-git-and-github&title=What%20do%20Linux%20developers%20think%20of%20Git%20and%20GitHub%3F%20%7C%20InfoWorld&txt=More%20at%20Reddit) + +## DistroWatch reviews XStream Desktop 153 + +XStreamOS is a version of Solaris created by Sonicle. XStream Desktop brings the power of Solaris to desktop users, and distrohoppers might be interested in checking it out. DistroWatch did a full review of XStream Desktop 153 and found that it performed fairly well. + +Jesse Smith reports for DistroWatch: + +>I think XStream Desktop does a lot of things well. Admittedly, my trial got off to a rocky start when the operating system would not boot on my hardware and I could not get the desktop to use my display's full screen resolution when running in VirtualBox. However, after that, XStream performed fairly well. The installer works well, the operating system automatically sets up and uses boot environments, insuring we can recover the system if something goes wrong. The package management tools work well and XStream ships with a useful collection of software. + +>I did run into a few problems playing media, specifically getting audio to work. I am not sure if that is another hardware compatibility issue or a problem with the media software that ships with the operating system. On the other hand, tools such as the web browser, e-mail, productivity suite and configuration tools all worked well. + +>What I appreciate about XStream the most is that the operating system is a branch of the OpenSolaris family that is being kept up to date. Other derivatives of OpenSolaris tend to lag behind, at least with desktop software, but XStream is still shipping recent versions of Firefox and LibreOffice. + +>For me personally, XStream is missing a few components, like a printer manager, multimedia support and drivers for my specific hardware. Other aspects of the operating system are quite attractive. I like the way the developers have set up LXDE, I like the default collection of software and I especially like the way file system snapshots and boot environments are enabled out of the box. Most Linux distributions, openSUSE aside, have not caught on to the usefulness of boot environments yet and I hope it is a technology that is picked up by more projects. + +[More at DistroWatch](http://api.viglink.com/api/click?format=go&jsonp=vglnk_145580434172315&key=0a7039c08493c7c51b759e3d13019dbe&libId=iksc5hc8010113at000DL3yrsuvp7&loc=http%3A%2F%2Fwww.infoworld.com%2Farticle%2F3033059%2Flinux%2Fwhat-do-linux-developers-think-of-git-and-github.html&v=1&out=http%3A%2F%2Fdistrowatch.com%2Fweekly.php%3Fissue%3D20160215%23xstreamos&ref=http%3A%2F%2Fwww.linux.com%2Fnews%2Fsoftware%2Fapplications%2F886008-what-do-linux-developers-think-of-git-and-github&title=What%20do%20Linux%20developers%20think%20of%20Git%20and%20GitHub%3F%20%7C%20InfoWorld&txt=More%20at%20DistroWatch) + +## Street Fighter V and SteamOS + +Street Fighter is one of the most well known game franchises of all time, and now [Capcom has announced](http://api.viglink.com/api/click?format=go&jsonp=vglnk_145580435418216&key=0a7039c08493c7c51b759e3d13019dbe&libId=iksc5hc8010113at000DL3yrsuvp7&loc=http%3A%2F%2Fwww.infoworld.com%2Farticle%2F3033059%2Flinux%2Fwhat-do-linux-developers-think-of-git-and-github.html&v=1&out=http%3A%2F%2Fsteamcommunity.com%2Fgames%2F310950%2Fannouncements%2Fdetail%2F857177755595160250&ref=http%3A%2F%2Fwww.linux.com%2Fnews%2Fsoftware%2Fapplications%2F886008-what-do-linux-developers-think-of-git-and-github&title=What%20do%20Linux%20developers%20think%20of%20Git%20and%20GitHub%3F%20%7C%20InfoWorld&txt=Capcom%20has%20announced) that Street Fighter V will be coming to Linux and SteamOS in the spring. This is great news for Linux gamers. + +Joe Parlock reports for Destructoid: + +>Are you one of the less than one percent of Steam users who play on a Linux-based system? Are you part of the even smaller percentage of people who play on Linux and are excited for Street Fighter V? Well, I’ve got some good news for you. + +>Capcom has announced via Steam that Street Fighter V will be coming to SteamOS and other Linux operating systems sometime this spring. It’ll come at no extra cost, so those who already own the PC build of the game will just be able to install it on Linux and be good to go. + +[More at Destructoid](http://api.viglink.com/api/click?format=go&jsonp=vglnk_145580435418216&key=0a7039c08493c7c51b759e3d13019dbe&libId=iksc5hc8010113at000DL3yrsuvp7&loc=http%3A%2F%2Fwww.infoworld.com%2Farticle%2F3033059%2Flinux%2Fwhat-do-linux-developers-think-of-git-and-github.html&v=1&out=http%3A%2F%2Fsteamcommunity.com%2Fgames%2F310950%2Fannouncements%2Fdetail%2F857177755595160250&ref=http%3A%2F%2Fwww.linux.com%2Fnews%2Fsoftware%2Fapplications%2F886008-what-do-linux-developers-think-of-git-and-github&title=What%20do%20Linux%20developers%20think%20of%20Git%20and%20GitHub%3F%20%7C%20InfoWorld&txt=Capcom%20has%20announced) + +Did you miss a roundup? Check the [Eye On Open home page](http://www.infoworld.com/blog/eye-on-open/) to get caught up with the latest news about open source and Linux. + +------------------------------------------------------------------------------ + +via: http://www.infoworld.com/article/3033059/linux/what-do-linux-developers-think-of-git-and-github.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.infoworld.com/author/Jim-Lynch/ + From 3703d87617b077ca3d757b692fde92ffc13a33ef Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 18 Feb 2016 22:13:18 +0800 Subject: [PATCH 0333/1469] PUB:20151126 Linux Foundation Explains a 'World without Linux' and Open Source MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @GHLandy 翻译的不错! --- ...a 'World without Linux' and Open Source.md | 51 ++++++++++++++++++ ...a 'World without Linux' and Open Source.md | 52 ------------------- 2 files changed, 51 insertions(+), 52 deletions(-) create mode 100644 published/20151126 Linux Foundation Explains a 'World without Linux' and Open Source.md delete mode 100644 translated/talk/20151126 Linux Foundation Explains a 'World without Linux' and Open Source.md diff --git a/published/20151126 Linux Foundation Explains a 'World without Linux' and Open Source.md b/published/20151126 Linux Foundation Explains a 'World without Linux' and Open Source.md new file mode 100644 index 0000000000..e86ee8b7f0 --- /dev/null +++ b/published/20151126 Linux Foundation Explains a 'World without Linux' and Open Source.md @@ -0,0 +1,51 @@ +没有 Linux 和开源软件的世界会变得怎么样 +================================================================================ +> Linux 基金会针最近对人们关于 “没有 Linux 的世界” 系列短片所提出的问题做了回应,解答了包括没有 Linux 和其他的开源软件的因特网会变得怎么样等问题。 + +![](http://thevarguy.com/site-files/thevarguy.com/files/imagecache/medium_img/uploads/2015/11/hey_22.png) + +假如 Linux —— 这个开源的操作系统内核 —— 不曾出现过,我们现在的世界是否会是另一番景象。会不会没有了因特网,或者没有了电影?这些都是观看 [Linux 基金会][1] 正在连续播出的 “[没有 Linux 的世界][2]” 系列短片的观众提出来的问题。 + +假如你错过了观看这些短片也不要紧,“[没有 Linux 的世界][2]” 系列短片是一个搞笑短片的集合,里边描述了没有了 Linux (或者说没有开源软件)的世界发生的事情。这些短片强调了 Linux 在 [电影制作][3] 以及 [因特网服务][4] 中充当的角色。 + +为了揭示该系列短片的一些主张、倾向和隐藏元素,Linux 基金会副主席 Jennifer Cloer 最近在 The VAR Guy 上回应了关于该短片的一些问题。以下是她的原话解答。 + +### 最新一集短片 —— Sam 和 Annie 一起看电影。假如没有 Linux,我们现在的荧屏是不是也和短片中的一样? ### + +在第 4 集剧情中,我们恶搞了一下电影 “阿凡达(Avatar)”。不管你喜欢还是讨厌,现实中的 “阿凡达(Avatar)” 在荧屏上的效果还是让人记忆深刻的。在没有 Linux 的世界中,电影的效果就变得非常丑陋,但是我们并不知道它有多难看,因为那已经是最好的了。但实际上,“阿凡达(Avatar)” 是使用 Linux 来进行效果制作的。Weta 数码使用了当时世界上最大的 Linux 集群来给电影做效果渲染和 3D 建模。据报道,指环王(Lord of the Rings)、神奇四侠(Fantastic Four)和金刚(King Kong)等电影都用到了 Linux。我希望该短片能引起人们关注,因为它所做的这方面的工作还并不广为人知。 + +### 很多人对短片的原始剧情进行了批判,其中就包括“没有 Linux 将没有因特网”的剧情的指责。你对此持什么样的看法? ### + +我们很喜欢人们在短片刚上映就进行激烈的辩论。该短片上映当天就超过了 100,000 的观众,这引起了人们对 Linux 在社会中扮演的角色以及对全世界的社区贡献者和维护者的关注。当然了,没有 Linux 的话,因特网也是会出现的,只是不会像当前我们所熟知的互联网那么成熟而已。每一个短片都对 Linux 在我们每天生活中扮演的角色进行了大胆且有趣的描述。我们希望,这些短片能够把关于 Linux 的故事推广到全世界的人的心里去。 + +### 为什么 Sam 和 Annie 的那只猫叫做 String? ### + +该短片系列中没有一处剧情是随意的。仔细的观看的话,你就会发现其中关于 Linux 和极客们的各种玩笑。小猫 String 是我们的 Linux.com 主编 Libby Clark 以弦理论(string theory)亲自来命名的。在物理学里,弦理论(string theory)是一个理论框架,它用一个叫做弦(String)的一维对象替换了粒子物理学中粒子状的粒子。弦理论(string theory)描述了这些弦(String)如何在空间传播以及相互影响。就像 Sam、Annie 和 String 在那个没有 Linux 的世界里的关系那样。 + +### 我们期待已久的下两集是什么样的,特别是,最后那集什么时候上映? ### + +在第 5 集短片中,我们将到太空并体验一下没有 Linux 的世界对太空探索的影响。这就像是一场疯狂的骑行。在短片的最后,我们最终还是会见到没有 Linux 的世界里的 Linus。贯穿整个短片系列,里边已经给出关于结局的线索,我在这就不能给太多提示了,因为还有好多人在找线索比赛中继续寻找着。并且我也不能给你们说出关于结局短片的上映日期。你们要自己跟进 #WorldWithoutLinux 主题帖来获取更多信息。 + +### 你可给一些关于第 4 集短片相关线索的提示吗? ### + +在该短片中有另外一个关于免费汉堡餐厅(Free Burger Restaurant)的线索。在那个没有 Linux 的世界里,Linux 最后还是以一种很隐秘的方式出现了,可以说,就像是以另一种语言来解读 Linux。当然,这只是为了好玩,String 也以另外一个模样出现。 + +### 那么,该系列短片达到你所想要的效果了吗? ### + +是的,达到了。我们很高兴看到人们分享并参与到这些故事中去。我们希望向那些可能不知道 Linux 的人传达更多关于 Linux 的故事并了解到 Linux 在当今世界中是无处不在的。全部的短片就是为了把这些关于 Linux 的真相推广给大家,并感谢那些全球性社区的开发者和公司对 Linux 的支持,Linux 使得一切成为可能。 + +-------------------------------------------------------------------------------- + +via: http://thevarguy.com/open-source-application-software-companies/linux-foundation-explains-world-without-linux-and-open-so + +作者:[Christopher Tozzi][a] +译者:[GHLandy](https://github.com/GHLandy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://thevarguy.com/author/christopher-tozzi +[1]:http://linuxfoundation.org/ +[2]:http://www.linuxfoundation.org/world-without-linux +[3]:http://thevarguy.com/open-source-application-software-companies/new-linux-foundation-video-highlights-role-open-source-3d +[4]:http://thevarguy.com/open-source-application-software-companies/100715/would-internet-exist-without-linux-yes-without-open-sourc diff --git a/translated/talk/20151126 Linux Foundation Explains a 'World without Linux' and Open Source.md b/translated/talk/20151126 Linux Foundation Explains a 'World without Linux' and Open Source.md deleted file mode 100644 index 3f0170de0a..0000000000 --- a/translated/talk/20151126 Linux Foundation Explains a 'World without Linux' and Open Source.md +++ /dev/null @@ -1,52 +0,0 @@ -没有 Linux 和开源软件的世界会变得怎么样 —— 听听来自 Linux 基金会的解释 -================================================================================ -> Linux 基金会针最近对人们关于 “没有 Linux 的世界” 系列短片提出的问题做了回应:包括没有 Linux 和其他的开源软件的因特网会变得怎么样等问题。 - -![](http://thevarguy.com/site-files/thevarguy.com/files/imagecache/medium_img/uploads/2015/11/hey_22.png) - -假如 Linux —— 一个开源的操作系统内核 —— 不曾出现过,我们现在的世界是否会是另一番景象。会不会没有了因特网,或者没有了电影?这些都是 [Linux 基金会][1] 正在连续播出的 “[没有 Linux 的世界][2]” 系列短片的观众提出来的问题。 - -假如你错过了观看这些短片也不要紧,“没有 Linux 的世界” 系列短片是一个古怪的短片集合,里边描述了没有了 Linux (或者说没有开源软件)的世界发生的事情。这些短片强调了 Linux 在 [电影制作][3] 以及 [服务于因特网][4] 中充当的角色。 - -为了提供该系列短片的一些主张、方向和隐藏元素,Linux 基金会副主席 Jennifer Cloer 最近在 The VAR Guy 上回应了关于该短片的一些问题。以下是她的原话解答。 - -### 最新一集短片 —— Sam 和 Annie 一起看电影。假如没有 Linux,我们现在的荧屏是不是也和短片中的一样? ### - -在 #4 剧情中,我们恶搞了一下电影 “Avatar”。不管你喜欢还是讨厌,现实中的 “Avatar” 在荧屏上的效果还是让人产生记忆深刻的。在没有 Linux 的世界中,电影的效果就变得非常恐怖,但是我们并不介意它,因为那已经是最好的了。但实际上,“Avatar” 是使用了 Linux 来进行效果制作的。Weta 数码使用了当时世界上最大的 Linux 集群来给电影做效果渲染和 3D 建模。据报道,指环王(Lord of the Rings)、神奇四侠(Fantastic Four)和金刚(King Kong)等电影都用到了 Linux。我希望该短片能引起电影制作工作者的关注,还有很多我们不知道的用到 Linux 来制作的电影。(译者注:这句应该是强度 Linux 在电影制作中的重要应用,可能翻译的不是很好。that work应该指的电影制作,只是直译感觉有点怪,这暂时没想到怎么译的最好。原话为:We hope this episode can bring attention to that work, which hasn't been widely reported.) - -### 很多人对短片的原始剧情进行了批判,其中包括没有 Linux 将没有因特网。你对此持什么样的看法? ### - -我们很喜欢人们从短片刚上映就进行激烈的辩论。该短片上映当天就超过了 100,000 的观众,这引起了人们对 Linux 在社会中扮演的角色以及全球的社区贡献者和维护者的关注。当然了,没有 Linux 的话,因特网也是会出现的,只是不会像当前我们所熟知的互联网那么成熟而已。每一个短片都对 Linux 在我们每天生活中扮演的角色进行了大胆且有趣的描述。我们希望,这些短片能够把关于 Linux 的故事推广到全世界的人的心里去。 - -### 为什么 Sam 和 Annie 的那只猫叫做 String? ### - -该短片系列中没有一处剧情是偶然的。仔细的观看话,你就会发现其中关于 Linux 和极客们的各种玩笑。小猫 String 是我们的 Linux.com 主编 Libby Clark 以弦理论(string theory)亲自来命名的。在物理学里,弦理论(string theory)是一个理论框架,它用一个叫做弦(String)的一维对象替换了粒子物理学中粒子状粒子。弦理论(string theory)描述了这些弦(String)如何在空间传播以及相互影响。就像 Sam、Annie 和 String 在那个没有 Linux 的世界里的关系那样。 - -### 我们期待已久的下两集是什么样的,特别是,最后那集什么时候上映? ### - -在 #5 短片中,我们将到太空并体验一下没有 Linux 的世界对太空探索的影响。这就像是一场疯狂的骑行。在短片的最后,我们最终还是会见到没有 Linux 的世界里的 Linus。贯穿整个短片系列,里边已经给出关于结局的线索,我在这就不能给太多提示了,因为还有好多人在找线索比赛中继续寻找着。并且我也不能给你们说出关于结局短片的上映日期。你们要自己跟进 #WorldWithoutLinux 主题帖来获取跟多信息。 - -### 你可给一些关于 #4 短片相关线索的提示吗? ### - -在该短片中有另外一个关于免费汉堡餐厅(Free Burger Restaurant)的线索。在那个没有 Linux 的世界里,Linux 最后还是以一种很隐秘的方式出现了,可以说,就像是以另一种语言来解读 Linux。当然,这只是为了好玩,String 也是另外一个模样。 - -### 那么,该系列短片达到你所想要的效果了吗? ### - -是的,达到了。我们很高兴看到人们分享并参与到这些故事中去。 -我们希望向那些可能不知道 Linux 的人传达更多关于 Linux 的故事并了解 Linux 在当今世界中是无处不在的。全部的短片就是为了把这些关于 Linux 的真相推广给大家,并感谢那些全球性社区的开发者和公司对 Linux 的支持,Linux 使得一切成为可能。 - --------------------------------------------------------------------------------- - -via: http://thevarguy.com/open-source-application-software-companies/linux-foundation-explains-world-without-linux-and-open-so - -作者:[Christopher Tozzi][a] -译者:[GHLandy](https://github.com/GHLandy) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://thevarguy.com/author/christopher-tozzi -[1]:http://linuxfoundation.org/ -[2]:http://www.linuxfoundation.org/world-without-linux -[3]:http://thevarguy.com/open-source-application-software-companies/new-linux-foundation-video-highlights-role-open-source-3d -[4]:http://thevarguy.com/open-source-application-software-companies/100715/would-internet-exist-without-linux-yes-without-open-sourc From b72b91afc506c622cd0f31037e6619c7924ca4a5 Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 18 Feb 2016 22:32:31 +0800 Subject: [PATCH 0334/1469] =?UTF-8?q?20160218-14=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...est Linux Desktop Environments for 2016.md | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 sources/tech/20160218 Best Linux Desktop Environments for 2016.md diff --git a/sources/tech/20160218 Best Linux Desktop Environments for 2016.md b/sources/tech/20160218 Best Linux Desktop Environments for 2016.md new file mode 100644 index 0000000000..a93d38c21a --- /dev/null +++ b/sources/tech/20160218 Best Linux Desktop Environments for 2016.md @@ -0,0 +1,90 @@ +Best Linux Desktop Environments for 2016 +============================================= + +![](http://www.linux.com/images/stories/66866/DE-2.png) + +Linux creates a friendly environment for choices and options. For example, there are many Linux-based distributions out there that use different desktop environments for you to choose from. I have picked some of the best desktop environments that you will see in the Linux world. + +## Plasma + +I consider [KDE’s Plasma desktop](https://www.kde.org/workspaces/plasmadesktop/) to be the most advanced desktop environment (DE). It’s the most feature-rich and customizable desktop environment that I have ever seen; even Mac OS X and Windows don’t come near Plasma when it comes to complete control by the user. + +I also love Plasma because of its awesome file manager, Dolphin. One reason I prefer Plasma over Gnome-based systems is the file manager. One of my biggest gripes with Gnome is that its file manager, Files, can’t handle basic tasks, such as batch-files renaming. That’s important for me because I take a lot of pictures, and Gnome makes it impossible for me to rename image files. On Dolphin, it’s a walk in the park. + +Then, you can add more functionality to Plasma with plugins. Plasma comes with some incredible software including Krita, Kdenlive, Calligra Office Suite, digiKam, Kwrite, and many other applications being developed by the KDE community. + +The only weakness of the Plasma desktop is its default email client, Kmail. It’s way too complicated to set up, and I also wish that setting up Kmail also configured the Address Book and Calendar. + +Plasma is the default desktop environment of many major distributions including openSUSE. + +## GNOME + +[GNOME](https://www.gnome.org/) (GNU Network Object Model Environment) was founded by [Miguel de Icaza](https://en.wikipedia.org/wiki/Miguel_de_Icaza) and Federico Mena in 1997 because KDE used Qt toolkit, which was released under a proprietary license. Unlike KDE, where there were numerous customizations, GNOME focused on keeping things simple. GNOME became extremely popular due to its simplicity and ease of use. A factor that I think contributed heavily to Gnome’s popularity was the fact that Ubuntu, one of the most popular Linux distributions, picked it as their default desktop environment. + +With changing times, GNOME needed a change. Therefore, with GNOME 3 the developers introduced the GNOME 3 Shell, which brought with it an entirely new design paradigm. That in turn led to some conflict with Canonical’s plans with Ubuntu, and they created their own shell for GNOME called Unity. Initially, GNOME 3 Shell was plagued by many issues -- most notably, the fact that extensions would stop working after updates. This major shift in design and the various problems then led to many forks of GNOME, such as the Cinnamon and Mate desktops. + +That said, what makes GNOME desktop interesting is that they are targeting touch-based devices, so if you have new laptops that come with a touchscreen, Gnome is the best suited DE for them. + +With version 3.18, GNOME has made some impressive improvements. The most interesting thing that they have done is Google Drive integration where users can mount their Google Drive as a remote file storage and work with files without having to use a web browser. I also love GNOME’s awesome integration of email client with calendar and address book. Despite all this awesomeness, however, the one thing that keeps me from using GNOME is its file manager, which can’t handle batch file renames. I will stick to Plasma until GNOME developers fix this problem. + +![](http://www.linux.com/images/stories/66866/DE-fig1.png) + +## Unity + +[Unity](https://unity.ubuntu.com/) is technically not a desktop environment, it’s a graphical shell developed by Canonical for Ubuntu. Unity runs on top of GNOME desktop environment and uses most stock GNOME apps and tools. The Ubuntu team has forked a few GNOME components to better suit the needs of Unity users. + +Unity plays a very important role in Ubuntu’s convergence story and with Unity 8, the company is bringing the desktop and mobile world together. Canonical has developed many intriguing technologies for Unity including HUD (Head-up Display). They also took a unique approach with lenses and scopes making it easy for users to find appropriate content. + +The upcoming release of Ubuntu, 16.04, is expected to ship with Unity 8 so users will get to experience all the work that developers have put into this open source software. One of the biggest criticisms with Unity was opt-out integration of Amazon ads and other services. With the upcoming release, though, Canonical is removing Amazon ads from Dash, making it a privacy-respecting OS by default. + +## Cinnamon + +[Cinnamon](https://en.wikipedia.org/wiki/Cinnamon_(software)) was initially developed by [Linux Mint](http://www.linuxmint.com/) -- the most popular distro on DistroWatch. Cinnamon is a fork of GNOME Shell, just like Unity. Later, however, it evolved into a desktop environment as Linux Mint developers forked many components of the GNOME desktop, including Files, to address the needs of their users. + +Because Linux Mint was based on regular releases of Ubuntu, the developers continued to chase the moving target that was Ubuntu. As a result, despite great promises Cinnamon was full of bugs and problems. With the 17.x release, however, Linux Mint developers moved to LTS edition of Ubuntu that allowed them to focus on core components of Cinnamon without having to worry about the base. As a result of this move, Cinnamon has become incredibly stable and bug free. The developers have started adding more features to the desktop. + +For those who prefer the good old Windows-like UI on top of the simplicity of GNOME, Cinnamon is the best desktop environment. + +## MATE Desktop + +The [MATE desktop](http://mate-desktop.com/) environment is also a fork of GNOME. However, unlike Cinnamon, it’s not a fork of GNOME 3; instead it’s a fork of GNOME 2 codebase, which is not unmaintained. A few developers didn’t like Gnome 3 and wanted to “continue” GNOME 2, so they took the codebase and created MATE. The MATE project forked many components of the GNOME project and created a few from scratch. To avoid any conflict with GNOME 3, they renamed all their packages: Nautilus become Caja, Gedit became Pluma, Evince became Atril, and so on. + +Although MATE is a continuation of GNOME 2, that doesn’t mean they are using old and obsolete technologies; they are using newer technologies to offer a modern GNOME 2 experience. + +What makes MATE an impressive desktop environment is that it’s extremely resource efficient. You can run it on older hardware or newer less powerful hardware, such as Raspberry Pi or Chromebook Flip. What’s makes it even more interesting is that using it on powerful systems frees most system resources for applications instead of the resources being consumed by the desktop environment itself. + +## LXQt + +[LXQt](http://lxqt.org/) is the successor of LXDE, one of the most lightweight desktop environments. It’s a merger of two open source projects LXDE and Razor-Qt. The first usable version of LXQt (v 0.9) was released in 2015. Initially, the developers used Qt4 but then all compatibility with it was dropped, and they moved to Qt5 and KDE Frameworks 5 for speedy development. I have tried LXQt on my Arch systems, and its a great lightweight desktop environment, but it has a long way to go before it becomes the rightful successor of LXDE. + +## Xfce + +[Xfce](http://www.xfce.org/) predates the KDE desktop environment. It is one of the oldest and lightest desktop environments around. The latest release of Xfce is 4.15, which was released in 2015 and uses modern technologies like GTK+ 3. Xfce is used by many special purpose distributions, such as Ubuntu Studio, because -- much like MATE -- it frees most system resources for applications. It’s also the default desktop environment of many notable Linux distributions including Manjaro Linux, PC/OS, Salix, and Mythbuntu. + +## Budgie + +[Budgie](https://solus-project.com/budgie/) is a new desktop environment being developed by the Solus Linux team. Solus is new Linux distribution that’s being developed from scratch, and Budgie is a core component of it. Budgie uses many GNOME components and offers a minimalistic UI. Because there’s not much information about the new desktop, I talked to the core developer of Solus, Ikey Doherty, and he explained, “We ship our own desktop, the Budgie Desktop. Unlike some other desktops, this is not a fork, rather it aims for full integration into the GNOME stack. It's written from scratch, and is specifically designed to cater for the experience Solus is offering. We work with upstream GNOME here as much as we can, contributing fixes, and advocate and support their work.” + +## Pantheon + +[Pantheon](https://elementary.io/) needs no introduction, it’s the desktop environment powering the lovely Linux distribution elementary OS. Similar to Budgie, Pantheon is not a fork of GNOME as many may assume. elementary OS team comes from design background so they pay very close attention to minute details, as a result Pantheon is extremely polished desktop environment. At the moment, it may lack many feature found in DEs like Plasma, but the developers are taking their time in order to stick to the design principle. + +![](http://www.linux.com/images/stories/66866/DE-3.png) + +## Conclusion + +As I went through this story, I realized the awesomeness of open source and Linux. There is something for everyone. As Jon “maddog” Hall said during the latest SCaLE 14, “Yes, there are 300 Linux distributions. I can try them and stick to the one that I like!” + +So, enjoy this diversity and use the one that floats your boat! + +------------------------------------------------------------------------------ + +via: http://www.linux.com/news/software/applications/881107-best-linux-desktop-environments-for-2016 + +作者:[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 From 1fe2dae1544fa3bb6641fda1d95ae0c14a0adc6e Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 18 Feb 2016 22:46:11 +0800 Subject: [PATCH 0335/1469] =?UTF-8?q?20160218-15=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...20160218 The Best Linux Distros of 2016.md | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 sources/tech/20160218 The Best Linux Distros of 2016.md diff --git a/sources/tech/20160218 The Best Linux Distros of 2016.md b/sources/tech/20160218 The Best Linux Distros of 2016.md new file mode 100644 index 0000000000..ec3bc1390c --- /dev/null +++ b/sources/tech/20160218 The Best Linux Distros of 2016.md @@ -0,0 +1,118 @@ +The Best Linux Distros of 2016 +================================ + +![](http://www.linux.com/images/stories/66866/distro-opensuse.JPG) + +2015 was a very important year for Linux, [both in the enterprise as well as in the consumer space](http://www.cio.com/article/3017983/linux/2015s-most-exciting-linux-devices.html). As a Linux user since 2005, I can see that the operating system has come a long way in the past 10 years. [And, 2016 is going to be even more exciting](http://www.cio.com/article/3017177/linux/11-predictions-for-linux-in-2016.html). In this article, I have picked some of the best distros that will shine in 2016. + +## Best Comeback Distro: openSUSE + +SUSE, the company behind openSUSE, is the oldest Linux company; [it was formed just a year after Linus Torvalds announced Linux](http://www.linux.com/news/software/applications/866964-exclusive-interview-with-suse-president-nils-brauckmann). The company actually predates Linux king Red Hat. SUSE is also the sponsor of the community-based distro [openSUSE](https://www.opensuse.org/). + +In 2015, openSUSE teams decided to come closer to SUSE Linux Enterprise (SLE) so that users could have a distribution that shares its DNA with the enterprise server -- similar to CentOS and Ubuntu. Thus, openSUSE became [openSUSE Leap](https://en.opensuse.org/Portal:Leap), a distribution that’s directly based on SLE SP (service pack) 1. + +The two distros will share the code base to benefit each other -- SUSE will take what’s good in openSUSE and vice versa. With this move, openSUSE is also ditching the regular release cycle, and a new version will be released in sync with SLE. That means each version will have a much longer life cycle. + +As a result of this move, openSUSE has become a very important distribution because potential SLE users can now use openSUSE Leap. That’s not all, however; openSUSE also announced the release of [Tumbleweed](http://www.cio.com/article/3008856/open-source-tools/is-opensuse-tumbleweed-good-enough-for-a-seasoned-arch-user.html), a pure rolling-release version. So, now, users can use either the super-stable openSUSE Leap or the always up-to-date openSUSE Tumbleweed. + +No other distro has made such an impressive comeback in my memory. + +Most Customizable Distro: Arch Linux + +Arch Linux is the best rolling-release distribution out there. Period. Ok, I could be biased because I am an Arch Linux user. However, the reason behind my claim is that Arch excels in many other areas, too, and that’s why I use it as my main operating system. + +[Arch Linux](https://www.archlinux.org/) is a great distro for those who want to learn everything about Linux. Because you have to install everything manually, you learn all the bits and pieces of a Linux-based operating system. + +- Arch is the most customizable distribution. There is no “Arch” flavor of any DE. All you get is a foundation and you can build whatever distro want, on top of it. For good or for worse, unlike openSUSE or Ubuntu there is no extra patching or integration. You get what upstream developers created. Period. + +- Arch Linux is also one of the best rolling releases. It’s always updated. Users always run the latest packages, and they can also run pre-released software through unstable repositories. + +- Arch is also known for having excellent documentation. Arch Wiki is my to-go resource for everything Linux related. + +- What I like the most about Arch is that is offers almost every package and software that’s available for “any” Linux distribution, thanks to the Arch User Repository, aka AUR. + +## Best-Looking Distro: elementary OS + +Different Linux distributions have different focus areas -- in most cases, these are technical differences. In many Linux distributions. the look and feel is an afterthought -- a side project at the mercy of the specific desktop environment. + +[elementary OS](https://elementary.io/) is trying to change all that. Here, design is at the forefront, and the reason is quite obvious. The distro is being developed by designers who have made their name in the Linux world by creating beautiful icons. + +elementary OS is quite strict about the holistic look and feel. The developers have created their own components, including the desktop environment. Additionally, they choose only those applications that fit into the design paradigm. One can find heavy influence of Mac OS X on elementary OS. + +## Best Newcomer: Solus + +![](http://www.linux.com/images/stories/66866/distro-solus.JPG) + +[Solus](https://solus-project.com/) operating system has garnered quite a lot of attention lately. It’s a decent-looking operating system that has been created from scratch. It’s not a derivative of Debian or Ubuntu. It comes with the Budgie desktop environment, which was built from scratch but aims to integrate with Gnome. Solus has the same minimalistic approach as Google’s Chrome OS. + +I have not played with Solus much, but it does look promising. Solus is actually not a “new” OS. It has been around for a while in different forms and names. But the entire project was revived back in 2015 under this new name. + +## Best Cloud OS: Chrome OS + +[Chrome OS](https://www.chromium.org/chromium-os) may not be your typical Linux-based distribution because it’s a browser-based operating system for online activities. However, because it’s based on Linux and its source code is available for anyone to compile, it’s an attractive OS. I use Chrome OS on a daily basis. It’s an excellent, maintenance-free, always updated OS for anyone using a computer purely for web-related activities. Chrome OS, along with Android, deserves all the credit for making Linux popular in the PC and mobile space. + +## Best Laptop OS: Ubuntu MATE + +Most laptops don’t have very high-end hardware, and if you are running a really resource-intensive desktop environment then you won’t have much system resources or battery life at your disposal -- they will be used by the OS itself. That’s where I found [Ubuntu MATE](http://www.cio.com/article/2848475/ubuntu-mate-enterprise-customers.html) to be an excellent operating system. It’s lightweight, yet has all the bells and whistles needed for a pleasant experience. Thanks to its lightweight design, the majority of system resources are free for applications so you can still do some heavy work on it. I also found it to be a great distro on really low-end systems. + +## Best Distro for Old Hardware: Lubuntu + +If you have an old laptop or PC sitting around, breathe new life into it with [Lubuntu](http://lubuntu.net/). Lubuntu uses LXDE, but the project has merged with Razor Qt to create LXQt. Although the latest release 15.04 is still using LXDE, the future versions will be using LXQt. Lubuntu is a decent operating system for old hardware. + +## Best Distro for IoT: Snappy Ubuntu Core + +![](http://www.linux.com/images/stories/66866/distro-ubuntu-studio.JPG) + +Snappy Ubuntu Core is the best Linux-based operating system out there for Internet of Things (IoT) and other such devices. The operating system holds great potential to turn almost everything around us into smart devices -- such as routers, coffeemakers, drones, etc. What makes it even more interesting is the way the software manages updates and offers containerization for added security. + +## Best Distro for Desktops: Linux Mint Cinnamon + +[Linux Mint Cinnamon](http://www.linux.com/news/software/applications/838569-review-linux-mint-172-release/) is the best operating system for desktops and powerful laptops. I will go as far as calling it the Mac OS X of the Linux world. Honestly, I had not been a huge fan of Linux Mint for a long time because of unstable Cinnamon. But, as soon as the developers chose to use LTS as the base, the distro has become incredibly stable. Because the developers don’t have to spend much time worrying about keeping up with Ubuntu, they are now investing all of their time in making Cinnamon better. + +## Best Distro for Games: Steam OS + +Gaming has been a weakness of desktop Linux. Many users dual-boot with Windows just to be able to play games. Valve Software is trying to change that. Valve is a game distributor that offers a client to run games on different platforms. And, Valve has now created their open operating system -- [Steam OS](http://store.steampowered.com/steamos/) -- to create a Linux-based gaming platform. By the end of 2015, partners started shipping Steam machines to the market. + +## Best Distro for Privacy: Tails + +In this age of mass surveillance and tracking by marketers (anonymous tracking for targeted content is acceptable), privacy has become a major issue. If you are someone who needs to keep the government and marketing agencies out of your business, you need an operating system that’s created -- from the ground up -- with privacy in mind. + +And, nothing beats [Tails](https://tails.boum.org/) for this purpose. It’s a Debian-based distribution that offers privacy and anonymity by design. Tails is so good that, according to reports, the NSA considers it a major threat to their mission. + +## Best Distro for Multimedia Production: Ubuntu Studio + +Multimedia production is one of the major weaknesses of Linux-based operating systems. All the professional-grade applications are available for either Windows or Mac OS X. There is no dearth of decent audio/video production software for Linux, but a multimedia production system needs more than just decent applications. It should use a lightweight desktop environment so that precious system resources -- such as CPU and RAM -- are used sparingly by the system itself, leaving them for the multimedia applications. And, the best Linux distribution for multimedia production is [Ubuntu Studio](https://ubuntustudio.org/tour/). It uses Xfce and comes with a broad range of audio, video, and image editing applications. + +## Best Enterprise Distro: SLE/RHEL + +Enterprise customers don’t look for articles like these to choose a distribution to run on their servers. They already know where to go: It’s either [Red Hat Enterprise Linux](https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux) or [SUSE Linux Enterprise](https://www.suse.com/). These two names have become synonymous with enterprise servers. These companies are also pushing boundaries by innovating in this changing landscape where everything is containerized and becoming software defined. + +## Best Server OS: Debian/CentOS + +If you are looking at running a server, but you can’t afford or don’t want to pay a subscription fee for RHEL or SLE, then there is nothing better than [Debian](https://www.debian.org/) or [CentOS](https://www.centos.org/). These distributions are the gold standard when it comes to community-based servers. And, they are supported for a very long time, so you won’t have to worry about upgrading your system so often. + +## Best Mobile OS: Plasma Mobile + +Although the Linux-based distribution Android is ruling the roost, many in the open source community, including me, still desire a distribution that offers traditional Linux desktop apps on mobile devices. At the same time, it’s better if the distro is run by a community instead of a company so that a user remains in the focus and not the company’s financial goals. And that’s where KDE’s [Plasma Mobile](https://community.kde.org/Plasma/Mobile) brings some hope. + +This Kubuntu-based distribution was launched in 2015. Because the KDE community is known for their adherence to standards and developing stuff in public, I am quite excited about the future of Plasma Mobile. + +## Best Distro for ARM Devices: Arch Linux ARM + +With the success of Android, we are now surrounded by ARM-powered devices -- from Raspberry Pi to Chromebook and Nvidia Shield. The traditional distros written for Intel/AMD processors won’t run on these systems. Some distributions are aimed at ARM, but they are mostly for specific hardware only, such as Raspbian for Raspberry Pi. That’s where [Arch Linux ARM](http://archlinuxarm.org/) (ALARM) shines. It’s a purely community-based distribution that’s based on Arch Linux. You can run it on Raspberry Pi, Chromebooks, Android devices, Nvidia Shield, and what not. What makes this distribution even more interesting is that, thanks to the Arch User Repository (AUR), you can install many applications than you may not get on other distributions. + +## Conclusion + +I was astonished and amazed when I worked on this story. It’s very exciting to see that there is something for everyone in the Linux world. It doesn’t matter if the year of the desktop Linux never arrives. We are happy with our Linux moments! + +------------------------------------------------------------------------------ + +via: http://www.linux.com/news/software/applications/878620-the-best-linux-distros-of-2016 + +作者:[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 From 5a2ad668c2413590e73644e9a2b2d3fbcb3934e6 Mon Sep 17 00:00:00 2001 From: Ricky Gong Date: Thu, 18 Feb 2016 16:14:11 +0100 Subject: [PATCH 0336/1469] =?UTF-8?q?Ricky=E7=94=B3=E8=AF=B7=E7=BF=BB?= =?UTF-8?q?=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20160218 Linux Systems Patched for Critical glibc Flaw.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160218 Linux Systems Patched for Critical glibc Flaw.md b/sources/tech/20160218 Linux Systems Patched for Critical glibc Flaw.md index 19c654e27e..14e950a611 100644 --- a/sources/tech/20160218 Linux Systems Patched for Critical glibc Flaw.md +++ b/sources/tech/20160218 Linux Systems Patched for Critical glibc Flaw.md @@ -1,3 +1,5 @@ +Ricky Gong 翻译中 + Linux Systems Patched for Critical glibc Flaw ================================================= From 0a56670fc6e507e3fbf1e839a10ba1f9c01b995b Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 18 Feb 2016 23:14:48 +0800 Subject: [PATCH 0337/1469] =?UTF-8?q?20160218-16=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...eps to Start Your Linux SysAdmin Career.md | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 sources/tech/20160218 7 Steps to Start Your Linux SysAdmin Career.md diff --git a/sources/tech/20160218 7 Steps to Start Your Linux SysAdmin Career.md b/sources/tech/20160218 7 Steps to Start Your Linux SysAdmin Career.md new file mode 100644 index 0000000000..60b8f7fc75 --- /dev/null +++ b/sources/tech/20160218 7 Steps to Start Your Linux SysAdmin Career.md @@ -0,0 +1,68 @@ +7 Steps to Start Your Linux SysAdmin Career +=============================================== + +Linux is hot right now. Everybody is looking for Linux talent. Recruiters are knocking down the doors of anybody with Linux experience, and there are tens of thousands of jobs waiting to be filled. But what if you want to take advantage of this trend and you’re new to Linux? How do you get started? + +1. Install Linux + + It should almost go without saying, but the first key to learning Linux is to install Linux. Both the LFS101x and the LFS201 courses include detailed sections on installing and configuring Linux for the first time. + +2. Take LFS101x + + If you are completely new to Linux, the best place to start is our free [LFS101x Introduction](https://www.edx.org/course/introduction-linux-linuxfoundationx-lfs101x-2) to Linux course. This online course is hosted by edX.org, and explores the various tools and techniques commonly used by Linux system administrators and end users to achieve their day-to-day work in a Linux environment. It is designed for experienced computer users who have limited or no previous exposure to Linux, whether they are working in an individual or enterprise environment. This course will give you a good working knowledge of Linux from both a graphical and command line perspective, allowing you to easily navigate through any of the major Linux distributions. + +3. Look into LFS201 + + Once you’ve completed LFS101x, you’re ready to start diving into the more complicated tasks in Linux that will be required of you as a professional sysadmin. To gain those skills, you’ll want to take [LFS201 Essentials of Linux System Administration](http://training.linuxfoundation.org/linux-courses/system-administration-training/essentials-of-system-administration). The course gives you in-depth explanations and instructions for each topic, along with plenty of exercises and labs to help you get real, hands-on experience with the subject matter. + + If you would rather have a live instructor teach you or you have an employer who is interested in helping you become a Linux sysadmin, you might also be interested in LFS220 Linux System Administration. This course includes all the same topics as the LFS201 course, but is taught by an expert instructor who can guide you through the labs and answer any questions you have on the topics covered in the course. + +4. Practice! + + Practice makes perfect, and that’s as true for Linux as it is for any musical instrument or sport. Once you’ve installed Linux, use it regularly. Perform key tasks over and over again until you can do them easily without reference material. Learn the ins and outs of the command line as well as the GUI. This practice will ensure that you’ve got the skills and knowledge to be successful as a professional Linux sysadmin. + +5. Get Certified + + After you’ve taken LFS201 or LFS220 and you’ve gotten some practice, you are now ready to get certified as a system administrator. You’ll need this certification because this is how you will prove to employers that you have the necessary skills to be a professional Linux sysadmin. + + There are several Linux certifications on the market today, and all of them have their place. However, most of these certifications are either centered on a specific distro (like Red Hat) or are purely knowledge-based and don’t demonstrate actual skill with Linux. The Linux Foundation Certified System Administrator certification is an excellent alternative for someone looking for a flexible, meaningful entry-level certification. + +6. Get Involved + + At this point you may also want to consider joining up with a local Linux Users Group (or LUG), if there’s one in your area. These groups are usually composed of people of all ages and experience levels, so regardless of where you are at with your Linux experience, you can find people with similar skill levels to bond with, or more advanced Linux users who can help answer questions and point you towards helpful resources. To find out if there’s a LUG near you, try looking on meetup.com, check with a nearby university, or just do a simple Internet search. + + There are also many online communities available to you as you learn Linux. These sites and communities provide help and support to both individuals new to Linux or experienced administrators: + + - [Linux Admin subreddit](https://www.reddit.com/r/linuxadmin) + + - [Linux.com](http://www.linux.com/) + + - [training.linuxfoundation.org](http://training.linuxfoundation.org/) + + - [http://community.ubuntu.com/help-information/](http://community.ubuntu.com/help-information/) + + - [https://forums.opensuse.org/forum.php](https://forums.opensuse.org/forum.php) + + - [http://wiki.centos.org/Documentation](http://wiki.centos.org/Documentation) + +7. Learn To Love The Documentation + + Last but not least, if you ever get stuck on something within Linux, don’t forget about Linux’s included documentation. Using the commands man (for manual), info and help, you can find information on virtually every aspect of Linux, right from within the operating system. The usefulness of these built-in resources cannot be overstated, and you’ll find yourself using them throughout your career, so you might as well get familiar with them early on. + + Interested in learning more about starting your IT career with Linux? Check out our free ebook “[A Brief Guide To Starting Your IT Career In Linux](http://training.linuxfoundation.org/sysadmin-it-career-guide).” + +[Download Now](http://training.linuxfoundation.org/sysadmin-it-career-guide) + +------------------------------------------------------------------------------ + +via: http://www.linux.com/news/featured-blogs/191-linux-training/834644-7-steps-to-start-your-linux-sysadmin-career + +作者:[linux.com][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:linux.com + + From ce654f9d7b969b1d8cd034a9d6b0268577fdf554 Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 18 Feb 2016 23:22:31 +0800 Subject: [PATCH 0338/1469] =?UTF-8?q?20160218-17=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...to Best Manage Encryption Keys on Linux.md | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 sources/tech/20160218 How to Best Manage Encryption Keys on Linux.md diff --git a/sources/tech/20160218 How to Best Manage Encryption Keys on Linux.md b/sources/tech/20160218 How to Best Manage Encryption Keys on Linux.md new file mode 100644 index 0000000000..19aab96541 --- /dev/null +++ b/sources/tech/20160218 How to Best Manage Encryption Keys on Linux.md @@ -0,0 +1,111 @@ +How to Best Manage Encryption Keys on Linux +============================================= + +![](http://www.linux.com/images/stories/41373/key-management-diagram.png) + +Storing SSH encryption **keys** and memorizing passwords can be a headache. But unfortunately in today's world of malicious hackers and exploits, basic security precautions are an essential practice. For a lot of general users, this amounts to simply memorizing passwords and perhaps finding a good program to store the passwords, as we remind such users not to use the same password for every site. But for those of us in various IT fields, we need to take this up a level. We have to deal with encryption keys such as SSH keys, not just passwords. + +Here's a scenario: I have a server running on a cloud that I use for my main git repository. I have multiple computers I work from. All of those computers need to log into that central server to push to and pull from. I have git set up to use SSH. When git uses SSH, git essentially logs into the server in the same way you would if you were to launch a command line into the server with the SSH command. In order to configure everything, I created a config file in my .ssh directory that contains a Host entry providing a name for the server, the host name, the user to log in as, and the path to a key file. I can then test this configuration out by simply typing the command + +>ssh gitserver + +And soon I'm presented with the server's bash shell. Now I can configure git to use this same entry to log in with the stored key. Easy enough, except for one problem: For each computer I use to log into that server, I need to have a key file. That means more than one key file floating around. I have several such keys on this computer, and several such keys on my other computers. In the same way everyday users have a gazillion passwords, it's easy for us IT folks to end up with a gazillion key files. What to do? + +## Cleaning Up + +Before starting out with a program to help you manage your keys, you have to lay some groundwork on how your keys should be handled, and whether the questions we're asking even make sense. And that requires first and foremost that you understand where your public keys go and where your private keys go. I'm going to assume you know: + +1. The difference between a public key and private key + +2. Why you can't generate a private key from a public key but you can do the reverse + +3. The purpose of the authorized_keys file and what goes in it + +4. How you use private keys to log into a server that has the corresponding public key in its authorized_keys file. + +Here's an example. When you create a cloud server on Amazon Web Services, you have to provide an SSH key that you'll use for connecting to your server. Each key has a public part and a private part. Because you want your server to stay secure, at first glance it might seem you put the private key onto that server, and that you take the public key with you. After all, you don't want that server to be publicly accessible, right? But that's actually backwards. + +You put the public key on the AWS server, and you hold onto your private key for logging into the server. You guard that private key and keep it by your side, not on some remote server, as shown in the figure above. + +Here's why: If the public key were to become known to others, they wouldn't be able to log into the server since they don't have the private key. Further, if somebody did manage to break into your server, all they would find is a public key. You can't generate a private key from a public key. And so if you're using that same key on other servers, they wouldn't be able to use it to log into those other computers. + +And that's why you put your public key on your servers for logging into them through SSH. The private keys stay with you. You don't let those private keys out of your hands. + +But there's still trouble. Consider the case of my git server. I had some decisions to make. Sometimes I'm logged into a development server that's hosted elsewhere. While on that dev box, I need to connect to my git server. How can the dev box connect to the git server? By using the private key. And therein lies trouble. This scenario requires I put a private key on a server that is hosted elsewhere, which is potentially dangerous. + +Now a further scenario: What if I were to use a single key to log into multiple servers? If an intruder got hold of this one private key, he or she would have that private key and gain access to the full virtual network of servers, ready to do some serious damage. Not good at all. + +And that, of course, brings up the other question: Should I really use the same key for those other servers? That's could be dangerous because of what I just described. + +In the end, this sounds messy, but there are some simple solutions. Let's get organized. + +(Note that there are many places you need to use keys besides just logging into servers, but I'm presenting this as one scenario to show you what you're faced with when dealing with keys.) + +## Regarding Passphrases + +When you create your keys, you have the option to include a passphrase that is required when using the private key. With this passphrase, the private key file itself is encrypted using the passphrase. For example, if you have a public key stored on a server and you use the private key to log into that server, you'll be prompted to enter a passphrase. Without the passphrase, the key cannot be used. Alternatively, you can configure your key without a passphrase to begin with. Then all you need is the key file to log into the server. + +Generally going without a passphrase is easier on the users, but one reason I strongly recommend using the passphrase in many situations is this: If the private key file gets stolen, the person who steals it still can't use it until he or she is able to find out the passphrase. In theory, this will save you time as you remove the public key from the server before the attacker can discover the passphrase, thus protecting your system. There are other reasons to use a passphrase, but this one alone makes it worth it to me in many situations. (As an example, I have VNC software on an Android tablet. The tablet holds my private key. If my tablet gets stolen, I'll immediately revoke the public key from the server it logs into, rendering its private key useless, with or without the passphrase.) But in some cases I don't use it, because the server I'm logging into might not have much valuable data on it. It depends on the situation. + +## Server Infrastructure + +How you design your infrastructure of servers will impact how you manage your keys. For example, if you have multiple users logging in, you'll need to decide whether each user gets a separate key. (Generally speaking, they should; you don't want users sharing private keys. That way if one user leaves the organization or loses trust, you can revoke that user's key without having to generate new keys for everyone else. And similarly, by sharing keys they could log in as each other, which is also bad.) But another issue is how you're allocating your servers. Do you allocate a lot of servers using tools such as Puppet, for example? And do you create multiple servers based on your own images? When you replicate your servers, do you need to have the same key for each? Different cloud server software allows you to configure this how you choose; you can have the servers get the same key, or have a new one generated for each. + +If you're dealing with replicated servers, it can get confusing if the users need to use different keys to log into two different servers that are otherwise similar. But on the other hand, there could be security risks by having the servers share the same keys. Or, on the third hand, if your keys are needed for something other than logging in (such as mounting an encrypted drive), then you would need the same key in multiple places. As you can see, whether you need to use the same keys across different servers is not a decision I can make for you; there are trade offs, and you need to decide for yourself what's best. + +In the end, you're likely to have: + +- Multiple servers that need to be logged into + +- Multiple users logging into different servers, each with their own key + +- Multiple keys for each user as they log into different servers. + +(If you're using keys in other situations, as you likely are, the same general concepts will apply regarding how keys are used, how many keys are needed, whether they're shared, and how you handle private and public parts of keys.) + +## Method of safety + +Knowing your infrastructure and unique situation, you need to put together a key management plan that will help guide you on how you distribute and store your keys. For example, earlier I mentioned that if my tablet gets stolen, I will revoke the public key from my server, hopefully before the tablet can be used to access the server. As such, I can allow for the following in my overall plan: + +1. Private keys are okay on mobile devices, but they must include a passphrase + +2. There must exist a way to quickly revoke public keys from a server. + +In your situation, you might decide you just don't want to use passphrases for a system you log into regularly; for example, the system might be a test machine that the developers log into many times a day. That's fine, but then you'll need to adjust your rules a bit. You might include a rule that that machine is not to be logged into from mobile devices. In other words, you need to build your protocols based on your own situation, and not assume one size fits all. + +## Software + +On to software. Surprisingly, there aren't a lot of good, solid software solutions for storing and managing your private keys. But should there be? Consider this: If you have a program storing all your keys for all your servers, and that program is locked down by a quick password, are your keys really secure? Or, similarly, if your private keys are sitting on your hard drive for quick access by the SSH program, is a key management software really providing any protection? + +But for overall infrastructure and creating and managing public keys, there are some solutions. I already mentioned Puppet. In the Puppet world, you create modules to manage your servers in different ways. The idea is that servers are dynamic and not necessarily exact duplicates of each other. [Here's one clever approach](http://manuel.kiessling.net/2014/03/26/building-manageable-server-infrastructures-with-puppet-part-4/) that uses the same keys on different servers, but uses a different Puppet module for each user. This solution may or may not apply to you. + +Or, another option is to shift gears altogether. In the world of Docker, you can take a different approach, as described in [this blog regarding SSH and Docker](http://blog.docker.com/2014/06/why-you-dont-need-to-run-sshd-in-docker/). + +But what about managing the private keys? If you search, you're not going to find many software options, for the reasons I mentioned earlier; the private keys are sitting on your hard drive, and a management program might not provide much additional security. But I do manage my keys using this method: + +First, I have multiple Host entries in my .ssh/config file. I have an entry for hosts that I log into, but sometimes I have more than one entry for a single host. That happens if I have multiple logins. I have two different logins for the server hosting my git repository; one is strictly for git, and the other is for general-purpose bash access. The one for git has greatly restricted rights on that machine. Remember what I said earlier about my git keys living on remote development machines? There we go. Although those keys can log into one of my servers, the accounts used are severely limited. + + Second, most of these private keys include a passphrase. (For dealing with having to type the passphrase multiple times, considering using [ssh-agent](http://blog.docker.com/2014/06/why-you-dont-need-to-run-sshd-in-docker/).) + +Third, I do have some servers that I want to guard a bit more carefully, and I don't have an entry into my Host file. This is more a social engineering aspect, because the key files are still present, but it might take an intruder a bit longer to locate the key file and figure out which machine they go with. In those cases, I just type out the long ssh command manually. (It's really not that bad.) + +And you can see that I'm not using any special software to manage these private keys. + +## One Size Doesn't Fit All + +We occasionally get questions at linux.com for advice on good software for managing keys. But let's take a step back. The question actually needs to be re-framed, because there isn't a one-size-fits-all solution. The questions you ask should be based on your own situation. Are you simply trying to find a place to store your key files? Are you looking for a way to manage multiple users each with their own public key that needs to be inserted into the authorized_keys file? + +Throughout this article, I've covered the basics of how all this fits together, and hopefully at this point you'll see that how you manage your keys, and whatever software you look for (if you even need additional software at all), should happen only after you ask the right questions. + + +------------------------------------------------------------------------------ + +via: http://www.linux.com/learn/tutorials/838235-how-to-best-manage-encryption-keys-on-linux + +作者:[Jeff Cogswell][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/62256 From 0f472802375809d232f12c4e084dfa34f7c7835d Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 18 Feb 2016 23:38:59 +0800 Subject: [PATCH 0339/1469] =?UTF-8?q?20160218-18=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Top 4 open source issue tracking tools.md | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 sources/tech/20160218 Top 4 open source issue tracking tools.md diff --git a/sources/tech/20160218 Top 4 open source issue tracking tools.md b/sources/tech/20160218 Top 4 open source issue tracking tools.md new file mode 100644 index 0000000000..b2f784e1e7 --- /dev/null +++ b/sources/tech/20160218 Top 4 open source issue tracking tools.md @@ -0,0 +1,63 @@ +Top 4 open source issue tracking tools +======================================== + +Life is full of bugs. + +No matter how carefully planned, no matter how much time went into design, any project is going to have unforseen issues when the rubber hits the road in the implementation stage. And that's okay. Perhaps the best measure of resiliency for any organization is not how well they handle things when everything is functioning as planned, but rather, how they handle the speed bumps when they come along. + +A critical tool for any project management workflow, especially in the software development world, is an issue tracker. The basics are simple; allowing bugs to be opened, tracked, and resolved in a collaborative manner, while making it easy to follow the progress. Beyond the basic functionality, there are a lot of options focused on meeting specific needs, features, and use cases, including software development and beyond. You may be familiar with hosted versions of these tools, like [GitHub Issues](https://guides.github.com/features/issues/) or [Launchpad](https://launchpad.net/), some of which are themselves open source. + +So let's take a look at four excellent choices for managing bugs and issues, all open source and all easy to download and host yourself. To be clear, there's no way we could possibly list every issue tracking tool here; instead, these are four of our favorites, based on feature richness and the size of the community behind the project. There are others, to be sure, and if you've got a good case for your favorite not listed here, be sure to let us know which is your favorite tool and what makes it stand out to you, in the comments below. + +## Redmine + +[Redmine](http://www.redmine.org/) is a popular issue tracking tool built on Ruby on Rails and dating back to 2006. Similar in many regards to Trac, another one of our favorites, Redmine is capable of managing multiple projects and integrates with a number of version control systems. In addition to basic issue tracking, Redmine also offers forums, wikis, time tracking tools, and the ability to generate Gantt charts and calendars to track progress. + +Redmine is fairly flexible in its setup, supporting numerous database backends and dozens of languages, and is customizable as well, featuring the ability to add custom fields to issues, users, projects and more. It can be further customized with a number of community-created plugins and themes. + +An [online demo](http://demo.redmine.org/) is available if you’d like to try it out. Redmine is licensed as open source under the [GPL version 2](http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html); the source code can be found in the project’s [subversion repository](https://svn.redmine.org/redmine) or mirrored on [GitHub](https://github.com/redmine/redmine). + +![](https://opensource.com/sites/default/files/images/business-uploads/issues-redmine.png) + +## Bugzilla + +[Bugzilla](https://www.bugzilla.org/) is another popular development tool with issue tracking capabilities. As you might have guessed from the name, Bugzilla was originally created by the [Mozilla Foundation](https://www.mozilla.org/en-US/) to track bugs in the development of the then-called Netscape Communicator suite. Ported to Perl from its original Tcl routes for greater accessibility, Bugzilla is one of the older and more widely adopted issue tracking systems, as it is used by a number of well-known open source projects like GNOME, KDE, and the Linux kernel itself. + +Sporting a number of advanced tools, from notifications to duplicate bug detection to shared searches, Bugzilla is certainly a more feature-rich option. Bugzilla has an advanced search system along with a comprehensive reporting tool, capable of generating charts and automated scheduled reports. Like Redmine, Bugzilla is extensible and customizable, both in the fields themselves as well as featuring the ability to create custom workflows for bugs. It also works with many database backends, and many different languages are supported out of the box. + +Bugzilla is licensed under the [Mozilla Public License](https://en.wikipedia.org/wiki/Mozilla_Public_License), and you can read their [future roadmap](https://www.bugzilla.org/status/roadmap.html) and try out a [demo server](https://landfill.bugzilla.org/) on the official website. + +![](https://opensource.com/sites/default/files/images/business-uploads/issues-bugzilla.png) + +## Trac + +[Trac](http://trac.edgewall.org/browser) describes itself as taking a minimalistic approach to web-based software project management, but don’t confusing minimalism with a lack of features. + +Written in Python, Trac tightly integrates its bug tracking capabilities with its wiki system and a revision control system of your choosing. It features project management capabilities like generating milestones and roadmaps, a customizable reporting system, timelines, support for multiple repositories, built-in spam filtering, and is available in many common languages. Like the other bug trackers we have looked at, has a number of plugins available for it extending its base feature set even further. + +Trac is made available as open source under a modified [BSD license](http://trac.edgewall.org/wiki/TracLicense), though older versions were released under the GPL. You can view Trac’s source in a [self-hosted repository](http://trac.edgewall.org/browser) or check out their [roadmap](http://trac.edgewall.org/wiki/TracRoadmap) for future plans. + +![](https://opensource.com/sites/default/files/images/business-uploads/issues-trac.png) + +## Mantis + +[Mantis](https://www.mantisbt.org/) is the final tool we’ll look at in this collection, a PHP-based bug tracker with a sixteen year history. Another bug tracker with support for many different revision control systems and an event-driven notification system, Mantis has a similar feature set to other tools here. While it does not itself contain a wiki, it integrates with many popular wiki platforms and is localized into many languages. + +Mantis is licensed as open source under the [GPL version 2](http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html); you can browse its source code on [GitHub](https://github.com/mantisbt/mantisbt) or check out the self-hosted [roadmap](https://www.mantisbt.org/bugs/roadmap_page.php?project=mantisbt&version=1.3.x) for future plans. For a demo, you can check out their own internal [bug tracker](https://www.mantisbt.org/bugs/my_view_page.php). + +![](https://opensource.com/sites/default/files/images/business-uploads/issues-mantis.png) + +As we notes, these four are not the only options. Looking to explore some others? [Apache Bloodhound](https://issues.apache.org/bloodhound/), [Fossil](http://fossil-scm.org/index.html/doc/trunk/www/index.wiki), [The Bug Genie](http://www.thebuggenie.com/), and many alternatives all have dedicated followings, each with different strengths and weaknesses. In addtion, some of the tools in our [project management](https://opensource.com/business/15/1/top-project-management-tools-2015) roundup have issue tracking capabilities. So, which is your preferred tool for tracking and squashing bugs? + + +------------------------------------------------------------------------------ + +via: https://opensource.com/business/16/2/top-issue-support-and-bug-tracking-tools + +作者:[Jason Baker][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/jason-baker From a49f2ec78e8cf0dbb8600ec9c28333c191207c4f Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 18 Feb 2016 23:50:38 +0800 Subject: [PATCH 0340/1469] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/news/20160218 Russia Announces Switch to Linux.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/news/20160218 Russia Announces Switch to Linux.md b/sources/news/20160218 Russia Announces Switch to Linux.md index aa7fb66a86..1f5cdd1f49 100644 --- a/sources/news/20160218 Russia Announces Switch to Linux.md +++ b/sources/news/20160218 Russia Announces Switch to Linux.md @@ -1,3 +1,5 @@ +translating by Ezio + This Week in Linux News:Russia Announces Switch to Linux, Outdated Fight for the Linux Desktop ========================================================================= This week in Linux news, Russia announces a possible switch to Linux, Jack Wallen ponders the importance of the Linux Desktop in 2016, and more! Get up-to-date on the Latest Linux news with our weekly digest. From f3ae44aa6236a68149a094dee64a58ecaf1bd7de Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 19 Feb 2016 00:12:04 +0800 Subject: [PATCH 0341/1469] =?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 试水新类型文章 --- ...160218 Russia Announces Switch to Linux.md | 35 ------------------- ...160218 Russia Announces Switch to Linux.md | 35 +++++++++++++++++++ 2 files changed, 35 insertions(+), 35 deletions(-) delete mode 100644 sources/news/20160218 Russia Announces Switch to Linux.md create mode 100644 translated/news/20160218 Russia Announces Switch to Linux.md diff --git a/sources/news/20160218 Russia Announces Switch to Linux.md b/sources/news/20160218 Russia Announces Switch to Linux.md deleted file mode 100644 index 1f5cdd1f49..0000000000 --- a/sources/news/20160218 Russia Announces Switch to Linux.md +++ /dev/null @@ -1,35 +0,0 @@ -translating by Ezio - -This Week in Linux News:Russia Announces Switch to Linux, Outdated Fight for the Linux Desktop -========================================================================= -This week in Linux news, Russia announces a possible switch to Linux, Jack Wallen ponders the importance of the Linux Desktop in 2016, and more! Get up-to-date on the Latest Linux news with our weekly digest. - -1. Russia announces a possible switch to Linux in retalliation against Western business embargo on Crimea. - - [Russia Might Switch Thousands of Government Computers to Linux to Spite Microsoft](http://www.techradar.com/news/world-of-tech/russia-might-switch-thousands-of-government-computers-to-linux-to-spite-microsoft-1314762) - TechRadar - -2. "It doesn't matter if Linux has 1% or 99% of the desktop market share" writes Jack Wallen. - - [Should the Fight for the Linux Desktop Really Matter?](http://www.techrepublic.com/article/should-the-fight-for-the-linux-desktop-really-matter/) - TechRepublic - -3. The Linux Foundation's Hyperledger Project experiences growth in membership since its launch in December. - - [Linux Foundation-Led Blockchain Project Grows to 30 Members](http://www.coindesk.com/linux-foundation-led-hyperledger-project-swells-to-30-members/) - CoinDesk - -4. Docker's founder and CTO, Solomon Hykes, suggests Alpine Linux will be the company's new default OS. - - [Is Docker Ditching Ubuntu Linux? Confusion Reigns](http://www.infoworld.com/article/3031847/open-source-tools/is-docker-ditching-ubuntu-linux-confusion-reigns.html) - InfoWorld - -5. The Node.js Foundation, a Linux Foundation Collaborative Project, will bring in popular third-party "Express" package. - - [The Node.js Foundation Plans to Incubate One of the Community’s Most Popular Packages](http://www.linux.com/news/software/applications/885174-this-week-in-linux-news-russia-announces-switch-to-linux-outdated-fight-for-the-linux-desktop-a-more#gref)- The Next Web - ------------------------------------------------------------------------------- - -via: http://www.linux.com/news/software/applications/885174-this-week-in-linux-news-russia-announces-switch-to-linux-outdated-fight-for-the-linux-desktop-a-more - -作者:[linux.com][linux.com] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/translated/news/20160218 Russia Announces Switch to Linux.md b/translated/news/20160218 Russia Announces Switch to Linux.md new file mode 100644 index 0000000000..a259ec1e4e --- /dev/null +++ b/translated/news/20160218 Russia Announces Switch to Linux.md @@ -0,0 +1,35 @@ +本周 Linux 新闻: 俄罗斯宣布迁移到 Linux +========================================================================= + +本周 Linux 新闻, 俄罗斯宣布可能会将系统迁移到 Linux 上, Jack Wallen 思考2016 年对 Linux 桌面系统的重要性, 等等。下面就让我们看看本周 Linux 界都有那些重要新闻。 + +1. 俄罗斯宣布有可能切换到 Linux , 以此来反击自克里米亚以来西方实施的商业禁运。 + + [俄罗斯可能讲成千上万台政府的电脑系统从 Windows 切换成 Linux](http://www.techradar.com/news/world-of-tech/russia-might-switch-thousands-of-government-computers-to-linux-to-spite-microsoft-1314762) - TechRadar + +2. Jack Wallen 写到:“对于 Linux 来说占有桌面系统市场 1% 或者 99% 并不重要” + + [为了 Linux 桌面系统奋斗是否真的很重要?](http://www.techrepublic.com/article/should-the-fight-for-the-linux-desktop-really-matter/) - TechRepublic + +3. 自从去年12月以来,参与 Linux 基金会的 HYPERLEDGER 计划的合作伙伴有了显著的增加 + + [Linux 基金会的 HYPERLEDGER 计划已经有了30 个合作伙伴](http://www.coindesk.com/linux-foundation-led-hyperledger-project-swells-to-30-members/) - CoinDesk + +4. Docker 的创始人和 CTO , Solomon Hykes 暗示 Alpine Linux 将会成为公司新的默认操作系统 + + [Docker 将会抛弃 Ubuntu 吗?](http://www.infoworld.com/article/3031847/open-source-tools/is-docker-ditching-ubuntu-linux-confusion-reigns.html) - InfoWorld + +5.Node.js 基金会, 作为Linux 基金会的合作项目, 将会产生流行的第三方快捷(Express)软件包 + + [Node.js 基金会计划孵化社区中最流行的一个软件包](http://www.linux.com/news/software/applications/885174-this-week-in-linux-news-russia-announces-switch-to-linux-outdated-fight-for-the-linux-desktop-a-more#gref)- The Next Web + + +------------------------------------------------------------------------------ + +via: http://www.linux.com/news/software/applications/885174-this-week-in-linux-news-russia-announces-switch-to-linux-outdated-fight-for-the-linux-desktop-a-more + +作者:[linux.com][linux.com] +译者:[译者ID](https://github.com/oska874) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 5daff92f5784a06f3d893772eb5d66510bc1fdc7 Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 19 Feb 2016 00:17:00 +0800 Subject: [PATCH 0342/1469] =?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 --- .../news/20160218 Russia Announces Switch to Linux.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/translated/news/20160218 Russia Announces Switch to Linux.md b/translated/news/20160218 Russia Announces Switch to Linux.md index a259ec1e4e..04da7f31c1 100644 --- a/translated/news/20160218 Russia Announces Switch to Linux.md +++ b/translated/news/20160218 Russia Announces Switch to Linux.md @@ -1,4 +1,4 @@ -本周 Linux 新闻: 俄罗斯宣布迁移到 Linux +本周 Linux 新闻: 俄罗斯宣布政府电脑系统迁移到 Linux ========================================================================= 本周 Linux 新闻, 俄罗斯宣布可能会将系统迁移到 Linux 上, Jack Wallen 思考2016 年对 Linux 桌面系统的重要性, 等等。下面就让我们看看本周 Linux 界都有那些重要新闻。 @@ -19,9 +19,9 @@ [Docker 将会抛弃 Ubuntu 吗?](http://www.infoworld.com/article/3031847/open-source-tools/is-docker-ditching-ubuntu-linux-confusion-reigns.html) - InfoWorld -5.Node.js 基金会, 作为Linux 基金会的合作项目, 将会产生流行的第三方快捷(Express)软件包 +5.Node.js 基金会, 作为Linux 基金会的合作项目, 计划将 Express 引入基金会 - [Node.js 基金会计划孵化社区中最流行的一个软件包](http://www.linux.com/news/software/applications/885174-this-week-in-linux-news-russia-announces-switch-to-linux-outdated-fight-for-the-linux-desktop-a-more#gref)- The Next Web + [Node.js 基金会计划将社区里最流行的框架软件 Expres 引入基金会进行孵化](http://thenextweb.com/dd/2016/02/10/the-node-js-foundation-plans-to-incubate-one-of-the-communitys-most-popular-packages/)- The Next Web ------------------------------------------------------------------------------ From 315e6e200f255770f1666c16fb8505ce4b6682b9 Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 19 Feb 2016 00:17:56 +0800 Subject: [PATCH 0343/1469] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md b/sources/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md index 5fb0d286d0..d2f3c4ee5c 100644 --- a/sources/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md +++ b/sources/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md @@ -1,3 +1,5 @@ +translatin by Ezio + Meizu PRO 5 Ubuntu Edition Announced and It's a Beast ======================================================== From a10b20f772d617b13d930ea84d112d26fabd1bdc Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 19 Feb 2016 00:41:54 +0800 Subject: [PATCH 0344/1469] =?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 --- ...untu Edition Announced and It's a Beast.md | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/sources/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md b/sources/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md index d2f3c4ee5c..fceeccc881 100644 --- a/sources/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md +++ b/sources/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md @@ -1,27 +1,28 @@ translatin by Ezio Meizu PRO 5 Ubuntu Edition Announced and It's a Beast +魅族 Pr 5 Ubuntu 版即将发布 ======================================================== -## Canonical and Meizu have just revealed that Meizu PRO 5 Ubuntu Edition will be available for pre-order during Mobile World Congress 2016. +**Canonical 和魅族刚刚透露魅族 Pro 5 Ubuntu 版将在2016 世界移动大会召开期间开始预售** -It's been a while since we last heard something from Meizu, but it looks like the collaboration between Canonical and the Chinese hardware maker is still alive. From the looks of it, the previous Meizu MX4 Ubuntu Edition was only a limited release, so only a small number of devices have been sold. +自从上次听到魅族的消息到现在已经很久了,但是看起来 Canonical 和这个中国的硬件厂商之间的合作关系仍然存在。从表面来看,之前的魅族 MX4 Ubuntu 版只是进行了有限的发布,所以只有很少的设备被出售出去了。 -We can only hope that Meizu PRO 5 Ubuntu Edition will be made available in greater numbers, especially since it's a much newer phone that's still supported by Meizu. +我们可以仅仅希望 魅族 Pro 5 Ubuntu 版可以增加更多的供货量,特别因为他还是一个魅族仍然提供支持的非常新的手机。 -This latest Meizu PRO 5 Ubuntu Edition is the fifth official device that comes with Ubuntu Touch, and we'll likely see many more phones and maybe tablets with this operating system landing in 2016. +最新的魅族 Pro 5 是第5个支持 Ubuntu Touch 的官方设备,而且在2016 年我们将会看到更多的手机,以及平板会预装这个操作系统。 -##Meizu PRO 5 Ubuntu Edition is a beast +## 魅族 Pro 5 Ubuntu 版将会非常震撼 -Canonical says that it's the most powerful Ubuntu smartphone launched to date, and they are right, not to mention that it's also the biggest, if we don't count the tablet. Meizu PRO 5 features a Samsung Exynos 7420 Octa-core processor, a 5.7-inch 1920x1080 AMOLED display, Corning Gorilla Glass 3, and LPDDR4 memory technology. +Canonical 宣称 Pro 5 是目前已发布了的 Ubuntu 智能手机中最强大的, 他们说的是对的, 除了这一点,它还是平板意外最大的。 魅族 Pro 5 拥有一颗 Exynos 7420 8核处理器,5.7 英寸分辨率未1920x1080 的 AMOLED 屏,覆盖第三代大猩猩屏,以及 LPDDR4 内存技术。 -Many of you will probably ask if this new phone is also capable of desktop convergence, and it looks that users are in luck. +很多人也许会问这个新手机是否可以汇聚桌面版系统, 而且看起来用户是运气不错。 -"Canonical remains committed to the vision of reinventing personal computing through a single, adaptive platform for all personal device form factors. As such, while the PRO 5 lacks MHL output, the software running on the Meizu PRO 5 is the latest code which also powers recently announced tablets and other devices and is capable of providing a traditional desktop experience," the company explained. +公司解释说,“Canonical 一直致力于重塑个人计算的视觉表现,希望为所有的的个人设备提供自适应的平台。因此尽管 Pro 5 缺少 MHL 输出,运行在魅族 Pro 5 上的是最新的代码,同时也是最新发布的支持平板和其它设备系统,它可以提供一种传统桌面的体验。” -Meizu PRO 5 was initially launched back in September 2015. Users will also get a 21 MP back camera, and the phone can shoot video at 2160p and 30fps. It also comes with a fingerprint sensor and a Li-Ion 3050 mAh battery with fast charging. +魅族 Pro 5 最初实在2015 年9 月发布的。用户同时会拥有一个2100 万像素的后置摄像头,可以拍摄2160p 和30 fps 的视频。同时它还带有一个指纹传感器和支持快速充电的3050 mAh 的锂电池。 -For now, the phone will only be available in China and Europe, and the preorders will be opened during the Mobile World Congress 2016 that takes place between February 22 and 25. +目前这款手机只在中国和欧洲有售,预定讲从2016 年世界移动大会期间开始,即2 月22 日至25 日。 ![](http://i1-news.softpedia-static.com/images/fitted/620x/meizu-pro-5-ubuntu-edition-announced-and-it-s-a-beast-photos-500526-11.jpg) @@ -31,7 +32,7 @@ For now, the phone will only be available in China and Europe, and the preorders via: http://www.linux.com/news/embedded-mobile/mobile-linux/886322-meizu-pro-5-ubuntu-edition-announced-and-its-a-beast 作者:[Silviu Stahie][a] -译者:[译者ID](https://github.com/译者ID) +译者:[译者ID](https://github.com/osk874) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 95e9d1e3942f583e506738fdc27446efcf694021 Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 19 Feb 2016 00:42:51 +0800 Subject: [PATCH 0345/1469] =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E5=88=B0translated?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...60218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources/news => translated/tech}/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md (100%) diff --git a/sources/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md b/translated/tech/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md similarity index 100% rename from sources/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md rename to translated/tech/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md From 7769afc60d41d4e642a4bad6ab8fd5c9bdea789e Mon Sep 17 00:00:00 2001 From: "Fuliang.Li" Date: Fri, 19 Feb 2016 09:28:55 +0800 Subject: [PATCH 0346/1469] =?UTF-8?q?[=E5=BC=80=E5=A7=8B=E7=BF=BB=E8=AF=91?= =?UTF-8?q?]=2020160218=20The=20Best=20Linux=20Distros=20of=202016?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20160218 The Best Linux Distros of 2016.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160218 The Best Linux Distros of 2016.md b/sources/tech/20160218 The Best Linux Distros of 2016.md index ec3bc1390c..fa9a6b6ffa 100644 --- a/sources/tech/20160218 The Best Linux Distros of 2016.md +++ b/sources/tech/20160218 The Best Linux Distros of 2016.md @@ -1,3 +1,5 @@ +GHLandy Translating + The Best Linux Distros of 2016 ================================ From 4b24c31143224c785aecf0b82a2874500328bdd8 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 19 Feb 2016 10:00:37 +0800 Subject: [PATCH 0347/1469] translating --- ...18 Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sources/tech/20160218 Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04.md b/sources/tech/20160218 Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04.md index 32c822289c..2f26ef8c91 100644 --- a/sources/tech/20160218 Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04.md +++ b/sources/tech/20160218 Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04.md @@ -1,3 +1,5 @@ +Translating----geekpi + Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04 ======================================================= @@ -20,3 +22,5 @@ via: https://www.phoronix.com/scan.php?page=news_item&px=Ubuntu-ZFS-Continues-16 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://www.michaellarabel.com/ + + From 8051180f3b87d04e5510bf855284cffe761745ce Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 19 Feb 2016 10:18:23 +0800 Subject: [PATCH 0348/1469] translated --- ...FS Plans Are Lining Up For Ubuntu 16.04.md | 26 ------------------- ...FS Plans Are Lining Up For Ubuntu 16.04.md | 24 +++++++++++++++++ 2 files changed, 24 insertions(+), 26 deletions(-) delete mode 100644 sources/tech/20160218 Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04.md create mode 100644 translated/tech/20160218 Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04.md diff --git a/sources/tech/20160218 Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04.md b/sources/tech/20160218 Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04.md deleted file mode 100644 index 2f26ef8c91..0000000000 --- a/sources/tech/20160218 Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04.md +++ /dev/null @@ -1,26 +0,0 @@ -Translating----geekpi - -Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04 -======================================================= - -![](https://www.phoronix.com/assets/categories/ubuntu.jpg) - -Ubuntu developers have been working on [ZFS support for Ubuntu 16.04](http://www.phoronix.com/scan.php?page=news_item&px=ZFS-For-Ubuntu-16.04) and all of that file-system support is getting squared away. - -EXT4 will continue to be the default for Ubuntu 16.04 installations, but ZFS support will be automatically built into the Ubuntu Linux kernel releases, the module will automatically load when needed, zfsutils-linux is part of the main Ubuntu archive, and the support is being backed to commercial customers via Canonical. - -For those interested in official ZFS support for Ubuntu Linux, Canonical's Dustin Kirkland has written [a new blog post](http://blog.dustinkirkland.com/2016/02/zfs-is-fs-for-containers-in-ubuntu-1604.html) covering some of the details and why "ZFS is *the* FS for Containers in Ubuntu 16.04!" - ------------------------------------------------------------------------------- - -via: https://www.phoronix.com/scan.php?page=news_item&px=Ubuntu-ZFS-Continues-16.04&utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+Phoronix+%28Phoronix%29 - -作者:[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/ - - diff --git a/translated/tech/20160218 Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04.md b/translated/tech/20160218 Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04.md new file mode 100644 index 0000000000..efe2ff27bc --- /dev/null +++ b/translated/tech/20160218 Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04.md @@ -0,0 +1,24 @@ +Canonical的ZFS计划将会进入Ubuntu 16.04 +======================================================= + +![](https://www.phoronix.com/assets/categories/ubuntu.jpg) + +Ubuntu开发者正在为[Ubuntu 16.04 加上支持ZFS](http://www.phoronix.com/scan.php?page=news_item&px=ZFS-For-Ubuntu-16.04) ,并且所遇的文件系统支持都已经准备就绪。 + +Ubuntu 16.04的默认安装将会继续是ext4,但是ZFS支持将会自动构建进Ubuntu发布中,模块将在需要时自动加载,zfsutils-linux是Ubuntu的一部分,并且通过Canonical对商业客户提供支持 + +对于那些对Ubuntu中的ZFS感兴趣的人,Canonical的Dustin Kirkland已经写了[一篇新的博客](http://blog.dustinkirkland.com/2016/02/zfs-is-fs-for-containers-in-ubuntu-1604.html)覆盖了一些细节及为何“ZFS是Ubuntu 16.04中为容器使用的文件系统!” + +------------------------------------------------------------------------------ + +via: https://www.phoronix.com/scan.php?page=news_item&px=Ubuntu-ZFS-Continues-16.04&utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+Phoronix+%28Phoronix%29 + +作者:[Michael Larabel][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.michaellarabel.com/ + + From 63981031529b0517976ae2ca1118fcb967f6f38a Mon Sep 17 00:00:00 2001 From: "Fuliang.Li" Date: Fri, 19 Feb 2016 10:46:48 +0800 Subject: [PATCH 0349/1469] =?UTF-8?q?[=E5=BC=80=E5=A7=8B=E7=BF=BB=E8=AF=91?= =?UTF-8?q?]=2020160218=20How=20to=20Best=20Manage=20Encryption=20Keys=20o?= =?UTF-8?q?n=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20160218 How to Best Manage Encryption Keys on Linux.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160218 How to Best Manage Encryption Keys on Linux.md b/sources/tech/20160218 How to Best Manage Encryption Keys on Linux.md index 19aab96541..468414fdfa 100644 --- a/sources/tech/20160218 How to Best Manage Encryption Keys on Linux.md +++ b/sources/tech/20160218 How to Best Manage Encryption Keys on Linux.md @@ -1,3 +1,5 @@ +GHLandy Translating + How to Best Manage Encryption Keys on Linux ============================================= From 1bb3a1380fc9d4cea13e06eff86ba60ee3ed8522 Mon Sep 17 00:00:00 2001 From: joeren Date: Fri, 19 Feb 2016 12:52:30 +0800 Subject: [PATCH 0350/1469] Taken by GOLinux --- ... LTS Is the Biggest in the Series with Hundreds of Changes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160218 Linux Kernel 4.1.18 LTS Is the Biggest in the Series with Hundreds of Changes.md b/sources/tech/20160218 Linux Kernel 4.1.18 LTS Is the Biggest in the Series with Hundreds of Changes.md index 2bf7e02ce7..3e6e5e4388 100644 --- a/sources/tech/20160218 Linux Kernel 4.1.18 LTS Is the Biggest in the Series with Hundreds of Changes.md +++ b/sources/tech/20160218 Linux Kernel 4.1.18 LTS Is the Biggest in the Series with Hundreds of Changes.md @@ -1,3 +1,4 @@ +Translating by GOLinux Linux Kernel 4.1.18 LTS Is the Biggest in the Series with Hundreds of Changes ================================================================================= From 34b7f4f7e6efccc50897a41849fafb0b70ea5a04 Mon Sep 17 00:00:00 2001 From: bioIkke <455256722@qq.com> Date: Fri, 19 Feb 2016 13:32:27 +0800 Subject: [PATCH 0351/1469] Update 20160218 7 Steps to Start Your Linux SysAdmin Career.md --- .../tech/20160218 7 Steps to Start Your Linux SysAdmin Career.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160218 7 Steps to Start Your Linux SysAdmin Career.md b/sources/tech/20160218 7 Steps to Start Your Linux SysAdmin Career.md index 60b8f7fc75..6df151f9f6 100644 --- a/sources/tech/20160218 7 Steps to Start Your Linux SysAdmin Career.md +++ b/sources/tech/20160218 7 Steps to Start Your Linux SysAdmin Career.md @@ -1,3 +1,4 @@ +bioIkke 翻译中 7 Steps to Start Your Linux SysAdmin Career =============================================== From d427778a695757cc9357a1b256373b36220b56f6 Mon Sep 17 00:00:00 2001 From: miaolin Date: Fri, 19 Feb 2016 13:46:41 +0800 Subject: [PATCH 0352/1469] Create 20160218 Mozilla contributor creates diabetes project for the masses.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 第一次翻译,感觉确是需要多翻译,校对费心了了 --- ...creates diabetes project for the masses.md | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 translated/tech/20160218 Mozilla contributor creates diabetes project for the masses.md diff --git a/translated/tech/20160218 Mozilla contributor creates diabetes project for the masses.md b/translated/tech/20160218 Mozilla contributor creates diabetes project for the masses.md new file mode 100644 index 0000000000..de61ff1d7b --- /dev/null +++ b/translated/tech/20160218 Mozilla contributor creates diabetes project for the masses.md @@ -0,0 +1,51 @@ +Mozilla贡献者为群众创建糖尿病项目 +================================================================ + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/myopensourcestory.png?itok=6TXlAkFi) + + +我的开源生涯从我还是一名高中生开始,我总想着自己能成为一名黑客,没有什么恶意的,只是喜欢钻研代码和硬件那种。我第一次接触开源是2001年, +我安装了我的第一个Linux发行版[Lindows](https://en.wikipedia.org/wiki/Linspire)。当然,我也是[Mozilla Firefox](https://www.mozilla.org/en-US/firefox/new/?utm_source=firefox-com&utm_medium=referral)的早期用户。 + +由于我很早使用Linux,我用的第一个版本是1.0.4(如果我没记错的话),我就立即爱上了它。我没在Lindows上呆太久, +而是活跃于多个发行版([Debian](https://www.debian.org/), +[Puppy Linux](http://puppylinux.org/main/Overview%20and%20Getting%20Started.htm), [SUSE](https://www.suse.com/), +[Slackware](http://www.slackware.com/), [Ubuntu](http://ubuntu.com/)),多年来我一直每天使用着开源软件,从青少年时候直到我成年。 + +最后,我坚持使用Ubuntu。大概是在Hardy Heron(译者注:Ubuntu8.04 LTS)发布时候,我开始第一次为Ubuntu做些贡献,在IRC频道和当地社区 +帮助那些需要帮助的用户。我是通过Ubuntu认识开源的,它在我心里总有着特殊的意义。Ubuntu背后的社区的是非常多样化的,热情的,友好的, +每个人都做些共享,是他们共同的目标也是个人目标,这成为他们为开源贡献的动力。 + +在为Ubuntu贡献一段时间后,我开始了为一些上游项目作贡献,比如Debian, [GNOME](https://www.gnome.org/), +[Ganeti](https://code.google.com/p/ganeti/),还有许多其他的开源项目。 +在过去的几年里,我为超过40个开源项目贡献过,有些小的,也有很大的。 + +在Ubuntu项目方向上有些变化之后,我最终决定不仅对于我是时候该尝试新东西,而且我也想贡献一些新的东西。所以我在2009年参与Mozilla, +在IRC帮忙,最终通过参与[Mozilla WebFWD program](https://webfwd.org/),成为一名团队成员,接着[Mozilla Reps Program](https://reps.mozilla.org/), +[Mozilla DevRel Program](https://wiki.mozilla.org/Devrel),刚过两年时间,我成为了火狐社区的发布经理,负责监督Firefox Nightly +和Firefox ESR的发布。比为其他开源项目,在为Mozilla贡献中会获得更多有益的经验。在所有我参与过的开源社区中,Mozilla是最不同的 +,最大的也是最友好的。 + +这些年来,关于开源我觉得,免费软件,更具安全的隐私和尊重许可,以及公开的工作,我越来越与这样的价值观相一致。我相信这三个主题 +对于开源来说是非常重要的,虽然许多人并没在意到提倡它们是很重要的。 + +今天在这,我已不再是全职的他人开源项目的贡献者。最近我被诊断出患有糖尿病,我看到了开源软件中健康软件不是很丰富这一缺口。确实, +它不像其它开源软件应用如Linux发行版或浏览器那样活跃。 + +我最近创立了自己的开源项目[Glucosio](http://www.glucosio.org/),带给人们糖尿病管理和研究的开源软件。经过几年来对开源项目的贡献, +和见过的多种架构,使得我作为项目领导能够得心应手。我对于Glucosio的未来很兴奋,但最重要的是未来的开源将在医疗健康领域发展的如何。 + +医疗保健软件的创新具有很大潜力,我想我们很快就会看到用于改善医疗卫生保健的开源新方案。 + + +------------------------------------------------------------------------------ + +via: https://opensource.com/life/15/11/my-open-source-story-ben-kerensa + +作者:[opensource.com][a] +译者:[ynmlml](https://github.com/ynmll) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:opensource.com From 0165d6996ef60fe83bd5294aade577b5bd47de77 Mon Sep 17 00:00:00 2001 From: GOLinux Date: Fri, 19 Feb 2016 13:52:56 +0800 Subject: [PATCH 0353/1469] [Translated]20160218 Linux Kernel 4.1.18 LTS Is the Biggest in the Series with Hundreds of Changes.md --- ... in the Series with Hundreds of Changes.md | 29 ------------------- ... in the Series with Hundreds of Changes.md | 27 +++++++++++++++++ 2 files changed, 27 insertions(+), 29 deletions(-) delete mode 100644 sources/tech/20160218 Linux Kernel 4.1.18 LTS Is the Biggest in the Series with Hundreds of Changes.md create mode 100644 translated/tech/20160218 Linux Kernel 4.1.18 LTS Is the Biggest in the Series with Hundreds of Changes.md diff --git a/sources/tech/20160218 Linux Kernel 4.1.18 LTS Is the Biggest in the Series with Hundreds of Changes.md b/sources/tech/20160218 Linux Kernel 4.1.18 LTS Is the Biggest in the Series with Hundreds of Changes.md deleted file mode 100644 index 3e6e5e4388..0000000000 --- a/sources/tech/20160218 Linux Kernel 4.1.18 LTS Is the Biggest in the Series with Hundreds of Changes.md +++ /dev/null @@ -1,29 +0,0 @@ -Translating by GOLinux -Linux Kernel 4.1.18 LTS Is the Biggest in the Series with Hundreds of Changes -================================================================================= - -**It looks like renowned kernel maintainer Greg Kroah-Hartman is on vacation, as Sasha Levin has had the great pleasure of [announcing](http://lkml.iu.edu/hypermail/linux/kernel/1602.2/00520.html) earlier today, February 16, 2016, the general availability of the eighteenth maintenance release of Linux kernel 4.1 LTS.** - -Being a long-term supported kernel branch, Linux 4.1 will receive updates and patches for a few more years, and today's maintenance build proves that the kernel developers are committed to keeping the series stable and reliable for all GNU/Linux operating systems that use it. Linux kernel 4.1.18 LTS is a massive release with a total of 228 files changes, consisting of 5,304 insertions and 1,128 deletions. - -What's new in Linux kernel 4.1.18 LTS? Well, let's start with improvements to the ARM, ARM64 (AArch64), MIPS, PA-RISC, m32r, PowerPC (PPC), s390, and x86 hardware architectures. Moreover, there are enhancements to the Btrfs, CIFS, NFS, XFS, OCFS2, OverlayFS, and UDF filesystems, networking stack fixes, especially for mac80211, as well as multiple core, crypto, and mm improvements and sound updates. - -"I'm announcing the release of the 4.1.18 kernel. All users of the 4.1 kernel series must upgrade," says Sasha Levin. "The updated 4.1.y git tree can be found at: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.1.y and can be browsed at the normal kernel.org git web browser: http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary." - -## Numerous drivers have been updated - -Besides the architectures, filesystems, sound, networking, crypto, mm, and core kernel improvements, Linux kernel 4.1.18 LTS updates various drivers for better hardware support. This is in particular for things like Bluetooth, DMA, EDAC, GPU (mostly Radeon and Intel i915), InfiniBand, IOMMU, IRQchip, MD, MMC, DVB, networking (mostly wireless), PCI, SCSI, USB, thermal, staging, TTY, and Virtio. - -As usual, we're urging all users of Linux kernel-based operating systems that use kernel packages from the Linux 4.1 LTS series to update to today's 4.1.18 release as soon as possible. This can be done either by installing the update from the default software repositories or by manually compiling the sources, which you can download right now from the [kernel.org](http://kernel.org/) website or via [Softpedia](http://linux.softpedia.com/get/System/Operating-Systems/Kernels/Linux-Kernel-Stable-1960.shtml). - ------------------------------------------------------------------------------- - -via: http://news.softpedia.com/news/linux-kernel-4-1-18-lts-is-the-biggest-in-the-series-with-hundreds-of-changes-500500.shtml - -作者:[Marius Nestor ][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://news.softpedia.com/editors/browse/marius-nestor diff --git a/translated/tech/20160218 Linux Kernel 4.1.18 LTS Is the Biggest in the Series with Hundreds of Changes.md b/translated/tech/20160218 Linux Kernel 4.1.18 LTS Is the Biggest in the Series with Hundreds of Changes.md new file mode 100644 index 0000000000..4a53818b49 --- /dev/null +++ b/translated/tech/20160218 Linux Kernel 4.1.18 LTS Is the Biggest in the Series with Hundreds of Changes.md @@ -0,0 +1,27 @@ +Linux最大版本4.1.18 LTS发布,带来大量修改 +================================================================================= + +**著名的内核维护者Greg Kroah-Hartman貌似正在度假中,因为Sasha Levin有幸在今天,2016年2月16日,的早些时候来[宣布](http://lkml.iu.edu/hypermail/linux/kernel/1602.2/00520.html),第十八个Linux内核维护版本Linux Kernel 4.1 LTS通用版本正式发布。** + +作为长期支持的内核分支,Linux 4.1将再多几年接收到更新和补丁,而今天的维护构建版本也证明一点,就是内核开发者们正致力于统保持该系列在所有使用该版本的GNU/Linux操作系统上稳定和可靠。Linux Kernel 4.1.18 LTS是一个大规模发行版,它带来了总计达228个文件修改,这些修改包含了多达5304个插入修改和1128个删除修改。 + +Linux Kernel 4.1.18 LTS更新了什么呢?好吧,首先是对ARM,ARM64(AArch64),MIPS,PA-RISC,m32r,PowerPC(PPC),s390以及x86等硬件架构的改进。此外,还有对Btrfs,CIFS,NFS,XFS,OCFS2,OverlayFS以及UDF文件系统的加强。对网络堆栈的修复,尤其是对mac80211的修复。同时,还有多核心、加密和mm等方面的改进和对声音的更新。 + +“我宣布4.1.18内核正式发布,所有4.1内核系列的用户都应当升级。”Sasha Levin说,“更新的4.1.y git树可以在这里找到:git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.1.y,并且可以在常规kernel.org git网站浏览器:http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary 进行浏览。” +## 大量驱动被更新 + +除了架构、文件系统、声音、网络、加密、mm和核心内核方面的改进之外,Linux Kernel 4.1.18 LTS更新了各个驱动,以提供更好的硬件支持,特别是像蓝牙、DMA、EDAC、GPU(主要是Radeon和Intel i915)、无限带宽技术、IOMMU、IRQ芯片、MD、MMC、DVB、网络(主要是无线)、PCI、SCSI、USB、散热、暂存和Virtio等此类东西。 + +和以往一样,我们鼓励所有基于Linux内核的操作系统平台的用户,凡是使用了Linux 4.1 LTS系列内核包的,尽快更新到今天的4.1.18版本。这些用户可以通过默认软件仓库安装更新,也可以手动编译源码包,这些包你现在就可以从[kernel.org](http://kernel.org/)网站或者[Softpedia](http://linux.softpedia.com/get/System/Operating-Systems/Kernels/Linux-Kernel-Stable-1960.shtml)下载。 + +------------------------------------------------------------------------------ + +via: http://news.softpedia.com/news/linux-kernel-4-1-18-lts-is-the-biggest-in-the-series-with-hundreds-of-changes-500500.shtml + +作者:[Marius Nestor ][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://news.softpedia.com/editors/browse/marius-nestor From 401f1507f651c46c8ef44504e5f2d1f454f0fee5 Mon Sep 17 00:00:00 2001 From: miaolin Date: Fri, 19 Feb 2016 14:05:56 +0800 Subject: [PATCH 0354/1469] =?UTF-8?q?=E5=BF=98=E4=BA=86=E5=88=A0=E5=8E=9F?= =?UTF-8?q?=E6=96=87=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...creates diabetes project for the masses.md | 35 ------------------- 1 file changed, 35 deletions(-) delete mode 100644 sources/tech/20160218 Mozilla contributor creates diabetes project for the masses.md diff --git a/sources/tech/20160218 Mozilla contributor creates diabetes project for the masses.md b/sources/tech/20160218 Mozilla contributor creates diabetes project for the masses.md deleted file mode 100644 index 61e5c08883..0000000000 --- a/sources/tech/20160218 Mozilla contributor creates diabetes project for the masses.md +++ /dev/null @@ -1,35 +0,0 @@ -translating by ynmlml -Mozilla contributor creates diabetes project for the masses -================================================================ - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/myopensourcestory.png?itok=6TXlAkFi) - -My open source story started in high school as a student. I always considered myself to be a hacker—not the malicious type, but the curious type who liked to tinker with code and hardware. My first encounter with open source was in 2001 when I installed my first Linux distro, [Lindows](https://en.wikipedia.org/wiki/Linspire). Of course, I was also an early user of [Mozilla Firefox](https://www.mozilla.org/en-US/firefox/new/?utm_source=firefox-com&utm_medium=referral). - -As a result of my early adoption of Linux, the first version I used was 1.0.4 (if I recall correctly), and I immediately fell in love. While I did not stay long with Lindows, hopping across many distros ([Debian](https://www.debian.org/), [Puppy Linux](http://puppylinux.org/main/Overview%20and%20Getting%20Started.htm), [SUSE](https://www.suse.com/), [Slackware](http://www.slackware.com/), [Ubuntu](http://ubuntu.com/)) over the years I continued to use open source software on a daily basis from my youth into adulthood. - -Eventually, I consistently used Ubuntu. Around the release of Hardy Heron I started some of my first contributions to Ubuntu, helping out on IRC and helping users locally who needed help. With Ubuntu being where I cut my teeth in open source, it has always had a special place in my heart. The community behind Ubuntu is very diverse, passionate, and friendly and everyone comes together with some shared common goals but also individuals' goals as drivers for why they contribute to open source. - -After having contributed to Ubuntu for a while, I started contributing upstream to projects like Debian, [GNOME](https://www.gnome.org/), [Ganeti](https://code.google.com/p/ganeti/), and many others. In the past few years I have contributed to over 40 different open source projects, some small and some very large. - -After some changes in direction in the Ubuntu project, I ended up deciding not only that was it time for me to try something new, but that also I wanted to put my contributions into something new. So I started getting involved in Mozilla around 2009, helping out on IRC and then eventually getting involved with the [Mozilla WebFWD program](https://webfwd.org/), becoming a team member, then the [Mozilla Reps Program](https://reps.mozilla.org/), [Mozilla DevRel Program](https://wiki.mozilla.org/Devrel), and then for just over two years was a Firefox Community Release Manager overseeing the release of Firefox Nightly and Firefox ESR. Contributing to Mozilla was an even more rewarding experience than contributions to other open source projects. Of all the open source communities I've been involved in, Mozilla has been the most diverse, largest, and friendliest. - -One thing that has happened over the years in terms of my feelings about open source is I've become more and more aligned to the values of free software and more defensive of things like privacy and respecting licensing and working in the open. I believe all three of those topics are very important to open source, and while many may not care about these things it's important that people advocate for them. - -And here I am today, no longer a full-time contributor to other people's open source projects. Recently being diagnosed with diabetes, I saw a gap in the open source ecosystem where open source health software was not very abundant. Where it did exist, it was not as active as other open source software applications like Linux distros or browsers. - -I recently founded my own open source project, [Glucosio](http://www.glucosio.org/), to bring open source diabetes management and research software to the masses. My years of contributing to open source projects and observing various structures has really come in handy being a project leader now. I'm very excited about the future of Glucosio, but most importantly about the future open source and how that will play out in health and medicine. - -There is a lot of potential for software innovation in healthcare, and I think we will soon see a startup disrupt healthcare and medicine with open source solutions. - ------------------------------------------------------------------------------- - -via: https://opensource.com/life/15/11/my-open-source-story-ben-kerensa - -作者:[opensource.com][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:opensource.com From 6f75af2fabdc9ba1601708501b662c52e5b3841e Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 19 Feb 2016 14:08:28 +0800 Subject: [PATCH 0355/1469] =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E5=88=B0translated?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...18 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md | 3 --- 1 file changed, 3 deletions(-) rename translated/{tech => news}/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md (97%) diff --git a/translated/tech/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md b/translated/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md similarity index 97% rename from translated/tech/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md rename to translated/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md index fceeccc881..1c07796555 100644 --- a/translated/tech/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md +++ b/translated/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md @@ -1,6 +1,3 @@ -translatin by Ezio - -Meizu PRO 5 Ubuntu Edition Announced and It's a Beast 魅族 Pr 5 Ubuntu 版即将发布 ======================================================== From 3163de29ac2c0e820ec0233af60b2a1ed611f029 Mon Sep 17 00:00:00 2001 From: Yuking-net Date: Fri, 19 Feb 2016 14:25:16 +0800 Subject: [PATCH 0356/1469] Update 20160218 Russia Announces Switch to Linux.md --- ...160218 Russia Announces Switch to Linux.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/translated/news/20160218 Russia Announces Switch to Linux.md b/translated/news/20160218 Russia Announces Switch to Linux.md index 04da7f31c1..4e322fadc4 100644 --- a/translated/news/20160218 Russia Announces Switch to Linux.md +++ b/translated/news/20160218 Russia Announces Switch to Linux.md @@ -1,27 +1,27 @@ 本周 Linux 新闻: 俄罗斯宣布政府电脑系统迁移到 Linux ========================================================================= -本周 Linux 新闻, 俄罗斯宣布可能会将系统迁移到 Linux 上, Jack Wallen 思考2016 年对 Linux 桌面系统的重要性, 等等。下面就让我们看看本周 Linux 界都有那些重要新闻。 +本周 Linux 新闻包括:俄罗斯宣布可能会将系统迁移到 Linux 上、Jack Wallen 思考 2016 年对 Linux 桌面系统的重要性,等等。下面就让我们看看本周 Linux 界都有那些重要新闻。 -1. 俄罗斯宣布有可能切换到 Linux , 以此来反击自克里米亚以来西方实施的商业禁运。 +1. 俄罗斯宣布有可能切换到 Linux , 以此来反击西方因克里米亚问题而实施的商业禁运。 - [俄罗斯可能讲成千上万台政府的电脑系统从 Windows 切换成 Linux](http://www.techradar.com/news/world-of-tech/russia-might-switch-thousands-of-government-computers-to-linux-to-spite-microsoft-1314762) - TechRadar + [俄罗斯可能将成千上万台政府的电脑系统从 Windows 切换成 Linux](http://www.techradar.com/news/world-of-tech/russia-might-switch-thousands-of-government-computers-to-linux-to-spite-microsoft-1314762) - TechRadar -2. Jack Wallen 写到:“对于 Linux 来说占有桌面系统市场 1% 或者 99% 并不重要” +2. Jack Wallen 写到:“对于 Linux 来说,占有桌面系统市场 1% 或者 99% 并不重要” [为了 Linux 桌面系统奋斗是否真的很重要?](http://www.techrepublic.com/article/should-the-fight-for-the-linux-desktop-really-matter/) - TechRepublic -3. 自从去年12月以来,参与 Linux 基金会的 HYPERLEDGER 计划的合作伙伴有了显著的增加 +3. 自从去年 12 月以来,参与 Linux 基金会的 HYPERLEDGER 计划的合作伙伴有了显著的增加 - [Linux 基金会的 HYPERLEDGER 计划已经有了30 个合作伙伴](http://www.coindesk.com/linux-foundation-led-hyperledger-project-swells-to-30-members/) - CoinDesk + [Linux 基金会的 HYPERLEDGER 计划已经有了 30 个合作伙伴](http://www.coindesk.com/linux-foundation-led-hyperledger-project-swells-to-30-members/) - CoinDesk -4. Docker 的创始人和 CTO , Solomon Hykes 暗示 Alpine Linux 将会成为公司新的默认操作系统 +4. Docker 的创始人和 CTO , Solomon Hykes 建议将 Alpine Linux 作为公司新的默认操作系统 [Docker 将会抛弃 Ubuntu 吗?](http://www.infoworld.com/article/3031847/open-source-tools/is-docker-ditching-ubuntu-linux-confusion-reigns.html) - InfoWorld -5.Node.js 基金会, 作为Linux 基金会的合作项目, 计划将 Express 引入基金会 +5. Linux 基金会的合作项目 Node.js 基金会计划引入流行的第三方软件包“Express” - [Node.js 基金会计划将社区里最流行的框架软件 Expres 引入基金会进行孵化](http://thenextweb.com/dd/2016/02/10/the-node-js-foundation-plans-to-incubate-one-of-the-communitys-most-popular-packages/)- The Next Web + [Node.js 基金会计划引入社区里最流行的框架软件 Express 进行孵化](http://thenextweb.com/dd/2016/02/10/the-node-js-foundation-plans-to-incubate-one-of-the-communitys-most-popular-packages/)- The Next Web ------------------------------------------------------------------------------ @@ -30,6 +30,6 @@ via: http://www.linux.com/news/software/applications/885174-this-week-in-linux-n 作者:[linux.com][linux.com] 译者:[译者ID](https://github.com/oska874) -校对:[校对者ID](https://github.com/校对者ID) +校对:[校对者ID](https://github.com/Yuking-net) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 8f9ed3456f44ffbf97894d1e2232c2a0e1345626 Mon Sep 17 00:00:00 2001 From: Yuking-net Date: Fri, 19 Feb 2016 14:26:22 +0800 Subject: [PATCH 0357/1469] Update 20160218 Russia Announces Switch to Linux.md --- translated/news/20160218 Russia Announces Switch to Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translated/news/20160218 Russia Announces Switch to Linux.md b/translated/news/20160218 Russia Announces Switch to Linux.md index 4e322fadc4..9aa0ee327a 100644 --- a/translated/news/20160218 Russia Announces Switch to Linux.md +++ b/translated/news/20160218 Russia Announces Switch to Linux.md @@ -29,7 +29,7 @@ via: http://www.linux.com/news/software/applications/885174-this-week-in-linux-news-russia-announces-switch-to-linux-outdated-fight-for-the-linux-desktop-a-more 作者:[linux.com][linux.com] -译者:[译者ID](https://github.com/oska874) -校对:[校对者ID](https://github.com/Yuking-net) +译者:[oska874](https://github.com/oska874) +校对:[Yuking_net](https://github.com/Yuking-net) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 65a7ff39d5bcbd4c11509f008c62dccf519c1b32 Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 19 Feb 2016 14:48:26 +0800 Subject: [PATCH 0358/1469] Rename translated/news/20160218 Russia Announces Switch to Linux.md to published/20160218 Russia Announces Switch to Linux.md --- .../20160218 Russia Announces Switch to Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/news => published}/20160218 Russia Announces Switch to Linux.md (100%) diff --git a/translated/news/20160218 Russia Announces Switch to Linux.md b/published/20160218 Russia Announces Switch to Linux.md similarity index 100% rename from translated/news/20160218 Russia Announces Switch to Linux.md rename to published/20160218 Russia Announces Switch to Linux.md From 099e7daa37819b2cffc6c9c3b9b1279a7ed785f2 Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 19 Feb 2016 14:49:18 +0800 Subject: [PATCH 0359/1469] fix some bug --- ... Ubuntu Edition Announced and It's a Beast.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/translated/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md b/translated/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md index 1c07796555..7bc06d74b7 100644 --- a/translated/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md +++ b/translated/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md @@ -1,25 +1,25 @@ -魅族 Pr 5 Ubuntu 版即将发布 +魅族 Pro 5 Ubuntu 版即将发布 ======================================================== **Canonical 和魅族刚刚透露魅族 Pro 5 Ubuntu 版将在2016 世界移动大会召开期间开始预售** -自从上次听到魅族的消息到现在已经很久了,但是看起来 Canonical 和这个中国的硬件厂商之间的合作关系仍然存在。从表面来看,之前的魅族 MX4 Ubuntu 版只是进行了有限的发布,所以只有很少的设备被出售出去了。 +自从上次听到魅族的消息到现在已经很久了,但是看起来 Canonical 和这个中国的硬件厂商之间的合作关系仍然存在。从表面来看,之前魅族的 MX4 Ubuntu 版只是进行了小范围的发布,所以只有很少的设备卖出去了。 -我们可以仅仅希望 魅族 Pro 5 Ubuntu 版可以增加更多的供货量,特别因为他还是一个魅族仍然提供支持的非常新的手机。 +我们仅仅希望 魅族 Pro 5 Ubuntu 版可以提高供货量,特别因为它还是一个魅族仍然提供支持的非常新的手机。 -最新的魅族 Pro 5 是第5个支持 Ubuntu Touch 的官方设备,而且在2016 年我们将会看到更多的手机,以及平板会预装这个操作系统。 +最新的魅族 Pro 5 是第5个支持 Ubuntu Touch 的官方设备,而且在2016 年我们将会看到更多的手机以及平板都会预装这个操作系统。 ## 魅族 Pro 5 Ubuntu 版将会非常震撼 -Canonical 宣称 Pro 5 是目前已发布了的 Ubuntu 智能手机中最强大的, 他们说的是对的, 除了这一点,它还是平板意外最大的。 魅族 Pro 5 拥有一颗 Exynos 7420 8核处理器,5.7 英寸分辨率未1920x1080 的 AMOLED 屏,覆盖第三代大猩猩屏,以及 LPDDR4 内存技术。 +Canonical 宣称 Pro 5 是目前已发布了的 Ubuntu 智能手机中最强大的, 他们说的是对的, 除了这一点,它还是平板以外最大的设备。 魅族 Pro 5 拥有一颗 Exynos 7420 8核处理器,5.7 英寸分辨率为1920x1080 的 AMOLED 屏,覆盖第三代大猩猩屏,以及 LPDDR4 内存技术。 -很多人也许会问这个新手机是否可以汇聚桌面版系统, 而且看起来用户是运气不错。 +很多人也许会问这个新手机的系统是否可以和桌面版系统一样, 现在看起来用户是运气不错。 -公司解释说,“Canonical 一直致力于重塑个人计算的视觉表现,希望为所有的的个人设备提供自适应的平台。因此尽管 Pro 5 缺少 MHL 输出,运行在魅族 Pro 5 上的是最新的代码,同时也是最新发布的支持平板和其它设备系统,它可以提供一种传统桌面的体验。” +公司解释说,“Canonical 一直致力于重塑个人计算的视觉表现,希望为所有的的个人设备提供自适应的平台。因此尽管 Pro 5 缺少 MHL 输出,但运行在魅族 Pro 5 上的是最新的代码,同时也是最新发布的支持平板和其它设备的系统,它可以提供一种接近传统桌面的体验。” 魅族 Pro 5 最初实在2015 年9 月发布的。用户同时会拥有一个2100 万像素的后置摄像头,可以拍摄2160p 和30 fps 的视频。同时它还带有一个指纹传感器和支持快速充电的3050 mAh 的锂电池。 -目前这款手机只在中国和欧洲有售,预定讲从2016 年世界移动大会期间开始,即2 月22 日至25 日。 +目前这款手机只在中国和欧洲有售,预定将从2016 年世界移动大会期间开始,即2 月22 日至25 日。 ![](http://i1-news.softpedia-static.com/images/fitted/620x/meizu-pro-5-ubuntu-edition-announced-and-it-s-a-beast-photos-500526-11.jpg) From a5d070d8fbd46fe82edf4eff9480c0fb7ca250fc Mon Sep 17 00:00:00 2001 From: Markgolzh Date: Fri, 19 Feb 2016 17:58:17 +0800 Subject: [PATCH 0360/1469] =?UTF-8?q?=F0=9F=91=80=E7=A5=9E=E7=BF=BB?= =?UTF-8?q?=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit zky001翻译中 --- ...0218 How to Set Nginx as Reverse Proxy on Centos7 CPanel.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20160218 How to Set Nginx as Reverse Proxy on Centos7 CPanel.md b/sources/tech/20160218 How to Set Nginx as Reverse Proxy on Centos7 CPanel.md index e3cc72cd8d..16fc43d0b3 100644 --- a/sources/tech/20160218 How to Set Nginx as Reverse Proxy on Centos7 CPanel.md +++ b/sources/tech/20160218 How to Set Nginx as Reverse Proxy on Centos7 CPanel.md @@ -1,3 +1,4 @@ +zky001开始翻译 How to Set Nginx as Reverse Proxy on Centos7 CPanel ================================================================================ @@ -198,4 +199,4 @@ via: http://linoxide.com/linux-how-to/set-nginx-reverse-proxy-centos-7-cpanel/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://linoxide.com/author/saheethas/ \ No newline at end of file +[a]:http://linoxide.com/author/saheethas/ From 8d2861b287ec5319ffc2d395a52ad588ecbb3844 Mon Sep 17 00:00:00 2001 From: martin qi Date: Fri, 19 Feb 2016 21:45:45 +0800 Subject: [PATCH 0361/1469] Martin --- .../tech/20160218 ST Releases Free Linux IDE for 32-Bit MCUs.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160218 ST Releases Free Linux IDE for 32-Bit MCUs.md b/sources/tech/20160218 ST Releases Free Linux IDE for 32-Bit MCUs.md index d90f6bfbce..313bf3b9e5 100644 --- a/sources/tech/20160218 ST Releases Free Linux IDE for 32-Bit MCUs.md +++ b/sources/tech/20160218 ST Releases Free Linux IDE for 32-Bit MCUs.md @@ -1,3 +1,4 @@ +martin ST Releases Free Linux IDE for 32-Bit MCUs ================================================= From ec638ca480a1796229bd2675a14036335aa3765e Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Fri, 19 Feb 2016 22:55:51 +0800 Subject: [PATCH 0362/1469] =?UTF-8?q?20160219-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Web server on Ubuntu 15.04 or CentOS 7.md | 218 ++++++++++++++++++ 1 file changed, 218 insertions(+) create mode 100644 sources/tech/20160219 How to Setup Lighttpd Web server on Ubuntu 15.04 or CentOS 7.md diff --git a/sources/tech/20160219 How to Setup Lighttpd Web server on Ubuntu 15.04 or CentOS 7.md b/sources/tech/20160219 How to Setup Lighttpd Web server on Ubuntu 15.04 or CentOS 7.md new file mode 100644 index 0000000000..cc0cd57b6d --- /dev/null +++ b/sources/tech/20160219 How to Setup Lighttpd Web server on Ubuntu 15.04 or CentOS 7.md @@ -0,0 +1,218 @@ +How to Setup Lighttpd Web server on Ubuntu 15.04 / CentOS 7 +================================================================================ + +Lighttpd is an open source web server which is secure, fast, compliant, and very flexible and is optimized for high-performance environments. It uses very low memory compared to other web servers , small CPU load and speed optimization making it popular among the server for its efficiency and speed. Its advanced feature-set (FastCGI, CGI, Auth, Output-Compression, URL-Rewriting and many more) makes lighttpd the perfect webserver-software for every server that suffers load problems. + +Here are some simple easy setups on how we can setup Lighttpd web server on our machine running Ubuntu 15.04 or CentOS 7 linux distributions. + +### Installing Lighttpd ### + +#### Installing using Package Manager #### + +Here, we'll install Lighttpd using package manager as its the easiest method to install it. So, we can simply run the following command under sudo mode in a terminal or console to install Lighttpd. + +**CentOS 7** + +As lighttpd is not available in the official repository of CentOS 7, we'll need to install epel additional repository to our system. To do so, we'll need to run the following yum command. + + # yum install epel-release + +Then, we'll gonna update our system and proceed towards the installation of lighttpd. + + # yum update + + # yum install lighttpd + +![Install Lighttpd Centos](http://blog.linoxide.com/wp-content/uploads/2016/02/install-lighttpd-centos.png) + +**Ubuntu 15.04** + +Lighttpd is available on the official repository of Ubuntu 15.04 so, we'll simply update our local repository index and then go for the installation of lighttpd using apt-get command. + + # apt-get update + + # apt-get install lighttpd + +![Install lighttpd ubuntu](http://blog.linoxide.com/wp-content/uploads/2016/02/install-lighttpd-ubuntu.png) + +#### Installing from Source #### + +If we wanna install lighttpd from the latest version of source code ie 1.4.39, we'll need to compile the source code and install it into our system. First of all, we'll need to install the dependencies required to compile it. + + # cd /tmp/ + # wget http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.39.tar.gz + +After its downloaded, we'll need to extract it the tarball by running the following. + + # tar -zxvf lighttpd-1.4.39.tar.gz + +Then, we'll compile it by running the following commands. + + # cd lighttpd-1.4.39 + # ./configure + # make + +**Note:** In this tutorial, we are installing lighttpd with its standard configuration. If you wanna configure beyond the standard configuration and want to install more features like support for SSL, mod_rewrite, mod_redirect then you can configure. + +Once, its compiled, we'll install it in our system. + + # make install + +### Configuring Lighttpd ### + +If we need to configure our lighttpd web server further as our requirements, we can make changes to the default configuration file ie /etc/lighttpd/lighttpd.conf . As wee'll go with the default configuration here in this tutorial, we'll not gonna make changes to it. If we had made any changes and we wanna check for errors in the config file, we'll need to run the following command. + + # lighttpd -t -f /etc/lighttpd/lighttpd.conf + +#### On CentOS 7 #### + +If we are running CentOS 7, we'll need to create a new directory for our webroot defined in our lighttpd's default configuration ie /src/www/htdocs/ . + + # mkdir -p /srv/www/htdocs/ + +Then, we'll copy the default welcome page from /var/www/lighttpd/ directory to the above created directory. + + # cp -r /var/www/lighttpd/* /srv/www/htdocs/ + +### Starting and Enabling Services ### + +Now, we'll gonna restart our database server by executing the following systemctl command. + + # systemctl start lighttpd + +Then, we'll enable it to start automatically in every system boot. + + # systemctl enable lighttpd + +### Allowing Firewall ### + +To allow our webpages or websites running lighttpd web server on the internet or inside the same network, we'll need to allow port 80 from the firewall program. As both CentOS 7 and Ubuntu 15.04 are shipped with systemd as the default init system, we will have firewalld installed as a firewall solution. To allow port 80 or http service, we'll need to run the following commands. + + # firewall-cmd --permanent --add-service=http + + success + + # firewall-cmd --reload + + success + +### Accessing Web Server ### + +As we have allowed port 80 which is the default port of lighttpd, we should be able to access lighttpd's welcome page by default. To do so, we'll need to point our browser to the ip address or domain of our machine running lighttpd according to our configuration. In this tutorial, we'll point our browser to http://lighttpd.linoxide.com/ as we have pointed our sub-domain to its ip address. On doing so, we'll see the following welcome page in our browser. + +![Lighttpd Welcome Page](http://blog.linoxide.com/wp-content/uploads/2016/02/lighttpd-welcome-page.png) + +Further, we can add our website's files to the webroot directory and remove the default lighttpd's index file to make our static website live to the internet. + +If we want to run our PHP application in our lighttpd webserver, we'll need to follow the following steps. + +### Installing PHP5 Modules ### + +Once our lighttpd is installed successfully, we'll need to install PHP and some PHP modules to run PHP5 scripts in our lighttpd web server. + +#### On Ubuntu 15.04 #### + + # apt-get install php5 php5-cgi php5-fpm php5-mysql php5-curl php5-gd php5-intl php5-imagick php5-mcrypt php5-memcache php-pear + +#### On CentOS 7 #### + + # yum install php php-cgi php-fpm php-mysql php-curl php-gd php-intl php-pecl-imagick php-mcrypt php-memcache php-pear lighttpd-fastcgi + +### Configuring Lighttpd with PHP ### + +To make PHP work with lighttpd web server, we'll need to follow the following methods respect to the distribution we are running. + +#### On CentOS 7 #### + +First of all, we'll need to edit our php configuration ie /etc/php.ini and uncomment a line **cgi.fix_pathinfo=1** using a text editor. + + # nano /etc/php.ini + +After its done, we'll need to change the ownership of PHP-FPM process from apache to lighttpd. To do so, we'll need to open the configuration file /etc/php-fpm.d/www.conf using a text editor. + + # nano /etc/php-fpm.d/www.conf + +Then, we'll append the file with the following configurations. + + user = lighttpd + group = lighttpd + +Once done, we'll need to save the file and exit the text editor. Then, we'll need to include fastcgi module from /etc/lighttpd/modules.conf configuration file. + + # nano /etc/lighttpd/modules.conf + +Then, we'll need to uncomment the following line by removing # from it. + + include "conf.d/fastcgi.conf" + +At last, we'll need to configure our fastcgi configuration file using our favorite text editor. + + # nano /etc/lighttpd/conf.d/fastcgi.conf + +Then, we'll need to add the following lines at the end of the file. + + fastcgi.server += ( ".php" => + (( + "host" => "127.0.0.1", + "port" => "9000", + "broken-scriptfilename" => "enable" + )) + ) + +After its done, we'll save the file and exit the text editor. + +#### On Ubuntu 15.04 #### + +To enable fastcgi with lighttpd web server, we'll simply need to execute the following commands. + + # lighttpd-enable-mod fastcgi + + Enabling fastcgi: ok + Run /etc/init.d/lighttpd force-reload to enable changes + + # lighttpd-enable-mod fastcgi-php + + Enabling fastcgi-php: ok + Run /etc/init.d/lighttpd force-reload to enable changes + +Then, we'll reload our lighttpd by running the following command. + + # systemctl force-reload lighttpd + +### Testing if PHP is working ### + +In order to see if PHP is working as expected or not, we'll need to create a new php file under the webroot of our lighttpd web server. Here, in this tutorial we have /var/www/html in Ubuntu and /srv/www/htdocs in CentOS as the default webroot so, we'll create a info.php file under it using a text editor. + +**On CentOS 7** + + # nano /var/www/info.php + +**On Ubuntu 15.04** + + # nano /srv/www/htdocs/info.php + +Then, we'll simply add the following line into the file. + + + +Once done, we'll simply save the file and exit from the text editor. + +Now, we'll point our web browser to our machine running lighttpd using its ip address or domain name with the info.php file path as http://lighttpd.linoxide.com/info.php If everything was done as described above, we will see our PHP information page as shown below. + +![phpinfo lighttpd](http://blog.linoxide.com/wp-content/uploads/2016/02/phpinfo-lighttpd.png) + +### Conclusion ### + +Finally we have successfully installed the world's lightweight, fast and secure web server Lighttpd in our machine running CentOS 7 and Ubuntu 15.04 linux distributions. Once its ready, we can upload our website files into our web root, configure virtual host, enable ssl, connect database, run web apps and much more with our lighttpd web server. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you ! Enjoy :-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/setup-lighttpd-web-server-ubuntu-15-04-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/ \ No newline at end of file From a5b318d5abae4250d3b3cd672d142354110e25dd Mon Sep 17 00:00:00 2001 From: miaolin Date: Fri, 19 Feb 2016 23:27:21 +0800 Subject: [PATCH 0363/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20160218 Getting to Know Linux File Permissions.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160218 Getting to Know Linux File Permissions.md b/sources/tech/20160218 Getting to Know Linux File Permissions.md index 03f6d5018e..816f499e36 100644 --- a/sources/tech/20160218 Getting to Know Linux File Permissions.md +++ b/sources/tech/20160218 Getting to Know Linux File Permissions.md @@ -1,3 +1,4 @@ +ynmlml translating Getting to Know Linux File Permissions ========================================== From f70590d3730ff9a47e50699e1363b840bde45e2c Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 20 Feb 2016 00:13:45 +0800 Subject: [PATCH 0364/1469] =?UTF-8?q?20160219-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit felixonmars --- ... Web server on Ubuntu 15.04 or CentOS 7.md | 73 +++++++++---------- 1 file changed, 34 insertions(+), 39 deletions(-) diff --git a/sources/tech/20160219 How to Setup Lighttpd Web server on Ubuntu 15.04 or CentOS 7.md b/sources/tech/20160219 How to Setup Lighttpd Web server on Ubuntu 15.04 or CentOS 7.md index cc0cd57b6d..f84e9e1e46 100644 --- a/sources/tech/20160219 How to Setup Lighttpd Web server on Ubuntu 15.04 or CentOS 7.md +++ b/sources/tech/20160219 How to Setup Lighttpd Web server on Ubuntu 15.04 or CentOS 7.md @@ -1,41 +1,39 @@ How to Setup Lighttpd Web server on Ubuntu 15.04 / CentOS 7 -================================================================================ +================================================================================= Lighttpd is an open source web server which is secure, fast, compliant, and very flexible and is optimized for high-performance environments. It uses very low memory compared to other web servers , small CPU load and speed optimization making it popular among the server for its efficiency and speed. Its advanced feature-set (FastCGI, CGI, Auth, Output-Compression, URL-Rewriting and many more) makes lighttpd the perfect webserver-software for every server that suffers load problems. Here are some simple easy setups on how we can setup Lighttpd web server on our machine running Ubuntu 15.04 or CentOS 7 linux distributions. -### Installing Lighttpd ### +### Installing Lighttpd -#### Installing using Package Manager #### +#### Installing using Package Manager -Here, we'll install Lighttpd using package manager as its the easiest method to install it. So, we can simply run the following command under sudo mode in a terminal or console to install Lighttpd. +Here, we'll install Lighttpd using package manager as its the easiest method to install it. So, we can simply run the following command under `sudo` mode in a terminal or console to install Lighttpd. **CentOS 7** -As lighttpd is not available in the official repository of CentOS 7, we'll need to install epel additional repository to our system. To do so, we'll need to run the following yum command. +As lighttpd is not available in the official repository of CentOS 7, we'll need to install epel additional repository to our system. To do so, we'll need to run the following `yum` command. # yum install epel-release Then, we'll gonna update our system and proceed towards the installation of lighttpd. # yum update - # yum install lighttpd ![Install Lighttpd Centos](http://blog.linoxide.com/wp-content/uploads/2016/02/install-lighttpd-centos.png) **Ubuntu 15.04** -Lighttpd is available on the official repository of Ubuntu 15.04 so, we'll simply update our local repository index and then go for the installation of lighttpd using apt-get command. +Lighttpd is available on the official repository of Ubuntu 15.04 so, we'll simply update our local repository index and then go for the installation of lighttpd using `apt-get` command. # apt-get update - # apt-get install lighttpd ![Install lighttpd ubuntu](http://blog.linoxide.com/wp-content/uploads/2016/02/install-lighttpd-ubuntu.png) -#### Installing from Source #### +#### Installing from Source If we wanna install lighttpd from the latest version of source code ie 1.4.39, we'll need to compile the source code and install it into our system. First of all, we'll need to install the dependencies required to compile it. @@ -52,31 +50,31 @@ Then, we'll compile it by running the following commands. # ./configure # make -**Note:** In this tutorial, we are installing lighttpd with its standard configuration. If you wanna configure beyond the standard configuration and want to install more features like support for SSL, mod_rewrite, mod_redirect then you can configure. +**Note:** In this tutorial, we are installing lighttpd with its standard configuration. If you wanna configure beyond the standard configuration and want to install more features like support for SSL, `mod_rewrite`, `mod_redirect` then you can configure. Once, its compiled, we'll install it in our system. # make install -### Configuring Lighttpd ### +### Configuring Lighttpd -If we need to configure our lighttpd web server further as our requirements, we can make changes to the default configuration file ie /etc/lighttpd/lighttpd.conf . As wee'll go with the default configuration here in this tutorial, we'll not gonna make changes to it. If we had made any changes and we wanna check for errors in the config file, we'll need to run the following command. +If we need to configure our lighttpd web server further as our requirements, we can make changes to the default configuration file ie `/etc/lighttpd/lighttpd.conf` . As wee'll go with the default configuration here in this tutorial, we'll not gonna make changes to it. If we had made any changes and we wanna check for errors in the config file, we'll need to run the following command. # lighttpd -t -f /etc/lighttpd/lighttpd.conf -#### On CentOS 7 #### +#### On CentOS 7 -If we are running CentOS 7, we'll need to create a new directory for our webroot defined in our lighttpd's default configuration ie /src/www/htdocs/ . +If we are running CentOS 7, we'll need to create a new directory for our webroot defined in our lighttpd's default configuration ie `/src/www/htdocs/` . # mkdir -p /srv/www/htdocs/ -Then, we'll copy the default welcome page from /var/www/lighttpd/ directory to the above created directory. +Then, we'll copy the default welcome page from `/var/www/lighttpd/` directory to the above created directory. # cp -r /var/www/lighttpd/* /srv/www/htdocs/ -### Starting and Enabling Services ### +### Starting and Enabling Services -Now, we'll gonna restart our database server by executing the following systemctl command. +Now, we'll gonna restart our database server by executing the following `systemctl` command. # systemctl start lighttpd @@ -84,21 +82,18 @@ Then, we'll enable it to start automatically in every system boot. # systemctl enable lighttpd -### Allowing Firewall ### +### Allowing Firewall To allow our webpages or websites running lighttpd web server on the internet or inside the same network, we'll need to allow port 80 from the firewall program. As both CentOS 7 and Ubuntu 15.04 are shipped with systemd as the default init system, we will have firewalld installed as a firewall solution. To allow port 80 or http service, we'll need to run the following commands. # firewall-cmd --permanent --add-service=http - success - # firewall-cmd --reload - success -### Accessing Web Server ### +### Accessing Web Server -As we have allowed port 80 which is the default port of lighttpd, we should be able to access lighttpd's welcome page by default. To do so, we'll need to point our browser to the ip address or domain of our machine running lighttpd according to our configuration. In this tutorial, we'll point our browser to http://lighttpd.linoxide.com/ as we have pointed our sub-domain to its ip address. On doing so, we'll see the following welcome page in our browser. +As we have allowed port 80 which is the default port of lighttpd, we should be able to access lighttpd's welcome page by default. To do so, we'll need to point our browser to the ip address or domain of our machine running lighttpd according to our configuration. In this tutorial, we'll point our browser to [http://lighttpd.linoxide.com/](http://lighttpd.linoxide.com/) as we have pointed our sub-domain to its ip address. On doing so, we'll see the following welcome page in our browser. ![Lighttpd Welcome Page](http://blog.linoxide.com/wp-content/uploads/2016/02/lighttpd-welcome-page.png) @@ -106,29 +101,29 @@ Further, we can add our website's files to the webroot directory and remove the If we want to run our PHP application in our lighttpd webserver, we'll need to follow the following steps. -### Installing PHP5 Modules ### +### Installing PHP5 Modules Once our lighttpd is installed successfully, we'll need to install PHP and some PHP modules to run PHP5 scripts in our lighttpd web server. -#### On Ubuntu 15.04 #### +#### On Ubuntu 15.04 # apt-get install php5 php5-cgi php5-fpm php5-mysql php5-curl php5-gd php5-intl php5-imagick php5-mcrypt php5-memcache php-pear -#### On CentOS 7 #### +#### On CentOS 7 # yum install php php-cgi php-fpm php-mysql php-curl php-gd php-intl php-pecl-imagick php-mcrypt php-memcache php-pear lighttpd-fastcgi -### Configuring Lighttpd with PHP ### +### Configuring Lighttpd with PHP To make PHP work with lighttpd web server, we'll need to follow the following methods respect to the distribution we are running. -#### On CentOS 7 #### +#### On CentOS 7 -First of all, we'll need to edit our php configuration ie /etc/php.ini and uncomment a line **cgi.fix_pathinfo=1** using a text editor. +First of all, we'll need to edit our php configuration ie `/etc/php.ini` and uncomment a line **cgi.fix_pathinfo=1** using a text editor. # nano /etc/php.ini -After its done, we'll need to change the ownership of PHP-FPM process from apache to lighttpd. To do so, we'll need to open the configuration file /etc/php-fpm.d/www.conf using a text editor. +After its done, we'll need to change the ownership of PHP-FPM process from apache to lighttpd. To do so, we'll need to open the configuration file `/etc/php-fpm.d/www.conf` using a text editor. # nano /etc/php-fpm.d/www.conf @@ -137,11 +132,11 @@ Then, we'll append the file with the following configurations. user = lighttpd group = lighttpd -Once done, we'll need to save the file and exit the text editor. Then, we'll need to include fastcgi module from /etc/lighttpd/modules.conf configuration file. +Once done, we'll need to save the file and exit the text editor. Then, we'll need to include fastcgi module from `/etc/lighttpd/modules.conf` configuration file. # nano /etc/lighttpd/modules.conf -Then, we'll need to uncomment the following line by removing # from it. +Then, we'll need to uncomment the following line by removing `#` from it. include "conf.d/fastcgi.conf" @@ -161,7 +156,7 @@ Then, we'll need to add the following lines at the end of the file. After its done, we'll save the file and exit the text editor. -#### On Ubuntu 15.04 #### +#### On Ubuntu 15.04 To enable fastcgi with lighttpd web server, we'll simply need to execute the following commands. @@ -173,15 +168,15 @@ To enable fastcgi with lighttpd web server, we'll simply need to execute the fol # lighttpd-enable-mod fastcgi-php Enabling fastcgi-php: ok - Run /etc/init.d/lighttpd force-reload to enable changes + Run `/etc/init.d/lighttpd` force-reload to enable changes Then, we'll reload our lighttpd by running the following command. # systemctl force-reload lighttpd -### Testing if PHP is working ### +### Testing if PHP is working -In order to see if PHP is working as expected or not, we'll need to create a new php file under the webroot of our lighttpd web server. Here, in this tutorial we have /var/www/html in Ubuntu and /srv/www/htdocs in CentOS as the default webroot so, we'll create a info.php file under it using a text editor. +In order to see if PHP is working as expected or not, we'll need to create a new php file under the webroot of our lighttpd web server. Here, in this tutorial we have `/var/www/html` in Ubuntu and `/srv/www/htdocs` in CentOS as the default webroot so, we'll create a info.php file under it using a text editor. **On CentOS 7** @@ -197,11 +192,11 @@ Then, we'll simply add the following line into the file. Once done, we'll simply save the file and exit from the text editor. -Now, we'll point our web browser to our machine running lighttpd using its ip address or domain name with the info.php file path as http://lighttpd.linoxide.com/info.php If everything was done as described above, we will see our PHP information page as shown below. +Now, we'll point our web browser to our machine running lighttpd using its ip address or domain name with the info.php file path as [http://lighttpd.linoxide.com/info.php](http://lighttpd.linoxide.com/info.php) If everything was done as described above, we will see our PHP information page as shown below. ![phpinfo lighttpd](http://blog.linoxide.com/wp-content/uploads/2016/02/phpinfo-lighttpd.png) -### Conclusion ### +### Conclusion Finally we have successfully installed the world's lightweight, fast and secure web server Lighttpd in our machine running CentOS 7 and Ubuntu 15.04 linux distributions. Once its ready, we can upload our website files into our web root, configure virtual host, enable ssl, connect database, run web apps and much more with our lighttpd web server. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you ! Enjoy :-) @@ -215,4 +210,4 @@ via: http://linoxide.com/linux-how-to/setup-lighttpd-web-server-ubuntu-15-04-cen 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://linoxide.com/author/arunp/ \ No newline at end of file +[a]:http://linoxide.com/author/arunp/ From 7ae9656b9847563a7850e50bd8267bdb0a430864 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Sat, 20 Feb 2016 10:43:24 +0800 Subject: [PATCH 0365/1469] Translating sources/share/20151204 Review EXT4 vs. Btrfs vs. XFS.md --- sources/share/20151204 Review EXT4 vs. Btrfs vs. XFS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/share/20151204 Review EXT4 vs. Btrfs vs. XFS.md b/sources/share/20151204 Review EXT4 vs. Btrfs vs. XFS.md index d370b87822..f6a568a55f 100644 --- a/sources/share/20151204 Review EXT4 vs. Btrfs vs. XFS.md +++ b/sources/share/20151204 Review EXT4 vs. Btrfs vs. XFS.md @@ -1,3 +1,4 @@ +ictlyh Translating Review EXT4 vs. Btrfs vs. XFS ================================================================================ ![](http://1426826955.rsc.cdn77.org/wp-content/uploads/2015/09/1385698302_funny_linux_wallpapers-593x445.jpg) From b28157e72b1ab231d13c546ae74c7af67e5e7dff Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 20 Feb 2016 15:33:44 +0800 Subject: [PATCH 0366/1469] =?UTF-8?q?20160220-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Linux Is Coming To ARM With Manjaro-ARM.md | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 sources/tech/20160220 Manjaro Linux Is Coming To ARM With Manjaro-ARM.md diff --git a/sources/tech/20160220 Manjaro Linux Is Coming To ARM With Manjaro-ARM.md b/sources/tech/20160220 Manjaro Linux Is Coming To ARM With Manjaro-ARM.md new file mode 100644 index 0000000000..0d503b3010 --- /dev/null +++ b/sources/tech/20160220 Manjaro Linux Is Coming To ARM With Manjaro-ARM.md @@ -0,0 +1,31 @@ +Manjaro Linux Is Coming To ARM With Manjaro-ARM +=================================================== + +![](http://itsfoss.com/wp-content/uploads/2016/02/manjaro-arm.jpg) + +Recently, the developers of Manjaro have announced the release of an [alpha build for ARM devices](https://manjaro.github.io/Manjaro-ARM-launched/). This is a big step for the Arch-based distro, which up until this point only ran on 32 and 64-bit PCs. + +According to the announcement, “[Manjaro Arm](http://manjaro-arm.org/) is a project aimed to bring you the simplicity and customability that is Manjaro to [ARM devices](https://www.arm.com/). These devices are growing in numbers and can be used for any number of applications. Most famous is the Raspberry Pi series and BeagleBoard series.” The alpha build only supports the Raspberry Pi 2, but that will undoubtedly grow with time. + +The developers currently include dodgejcr, Torei, Strit, and Ringo32. They are looking for more people to help the project grow and develop. Besides developers, [they are looking for maintainers, moderators and admins, and artists](http://manjaro-arm.org/forums/website/looking-for-contributors/?PHPSESSID=876d5c11400e9c25eb727e9965300a9a). + +Manjaro-ARM will be available in four different versions. The Media Edition will allow you to create a media center with very little configuration and will run Kodi. The Server Edition will come with SSH, FTP, and a LAMP server preconfigured so you can use your ARM device as a file or web server. The Base Edition acts as the desktop edition, with an XFCE desktop. If you want to build you own system from scratch, the Minimal Edition is your choice. It will come with no preloaded packages or desktop, only have a root user. + +## Final Thoughts + +As a fan of Manjaro (I have it installed on 4 computers), I’m glad to hear that they are branching out into the ARM world. ARM is being used in more and more devices. According to technology commentator Robert Cringely, [device makers are starting to look at cheap ARM chips over more expensive Intel or AMD chips](http://www.cringely.com/2016/01/21/prediction-8-intel-starts-to-become-irrelevent/). Even Microsoft (please don’t strike me down) is thinking of porting some of its software to ARM. As the use of ARM powered devices increase, Manjaro will be ready to give those users a great Linux experience. + +What do you think? Do you wish that more Linux distros would create ARM ports? Or do you think that ARM is a passing fad? Tell us below. + +------------------------------------------------------------------------------ + +via: http://itsfoss.com/manjaro-linux-arm/ + +作者:[JOHN PAUL][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/john/ + From 90ff0166a2934cd468c1335969b5fba893e8fbe9 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 20 Feb 2016 15:38:47 +0800 Subject: [PATCH 0367/1469] =?UTF-8?q?20160220-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ser For Each Incorrect Password Attempt.md | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 sources/tech/20160220 Make Sudo Insult User For Each Incorrect Password Attempt.md diff --git a/sources/tech/20160220 Make Sudo Insult User For Each Incorrect Password Attempt.md b/sources/tech/20160220 Make Sudo Insult User For Each Incorrect Password Attempt.md new file mode 100644 index 0000000000..cf2146e73e --- /dev/null +++ b/sources/tech/20160220 Make Sudo Insult User For Each Incorrect Password Attempt.md @@ -0,0 +1,57 @@ +Make Sudo Insult User For Each Incorrect Password Attempt +=========================================================== + +You can have lots of fun in Linux terminal. And I am not talking about those funny commands to [run a train in Linux terminal](http://itsfoss.com/ubuntu-terminal-train/). + +I am talking about little tweaks in the terminal that will lighten up your mood. In a previous article, you learnt [how to increase sudo timeout in Linux terminal](http://itsfoss.com/change-sudo-password-timeout-ubuntu/). In today’s fun post, I’ll show you how you can make sudo to insult you (or other users) when incorrect password is attempted with sudo command. + +Confused what I am talking about? Here, take a look at this gif to get a gist of how sudo can insult you for typing in the incorrect password. + +![](http://itsfoss.com/wp-content/uploads/2016/02/sudo-insults-Linux.gif) + +Now, why would you do that and take insults? After all, insults are not going to brighten up your day, is it? + +To me, this little tweak is funny and is better than the plain old “incorrect password” error message. Moreover, I can show it off to my friends (in this case you, via It’s FOSS) to amuse them. I am pretty sure you can come up with your own reason to use this tweak. + +## Enable insults in sudo + +You can enable insults in `sudo` by adding the following line in `sudo` configuration: + +``` +Defaults insults +``` + +Let’s see how to do that. Open a terminal and use the following command: + +``` +sudo visudo +``` + +This should open the configuration file in [nano](http://www.nano-editor.org/). Yeah, I know that traditionally ‘visudo’ should open the `/etc/sudoers` file in Vi editor, but Ubuntu and Ubuntu based Linux distribution will open it in nano. Since we are talking about Vi, here is a [cheat sheet for Vi editor](http://itsfoss.com/download-vi-cheat-sheet/) that could come handy if you decide to use Vi. + +Coming back to editing the sudeors file, you need to find the section where Defaults are listed. Luckily, it is in the beginning itself. Just add “Defaults insults” line to it, like this: + +![](http://itsfoss.com/wp-content/uploads/2016/02/sudo-insults-Linux-Mint.png) + +If you are using nano, use `Ctrl+X` to quit the editor. At the time of quitting, it will ask you if you want to save the changes or not. To save the changes, press `Y`. + +Once you have saved the changes in sudoers file, open a terminal and use any command with sudo. Deliberately type wrong password and enjoy the abuses :) + +sudo could be nasty. See, it even threatens me of consequences if I type incorrect password again. LOL. + +![](http://itsfoss.com/wp-content/uploads/2016/02/sudo-insults-Linux-Mint-1.jpeg) + +If you like this terminal hack, check out other [terminal tricks](http://itsfoss.com/category/terminal-tricks/) posts as well. If you have other such fun tweaks and hacks, do share it in the comment box below. + + +------------------------------------------------------------------------------ + +via: http://itsfoss.com/sudo-insult-linux/ + +作者:[ABHISHEK][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ From 1a7507fa03a84027493dab943d275f5f037f7868 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 20 Feb 2016 15:58:20 +0800 Subject: [PATCH 0368/1469] =?UTF-8?q?20160220-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...loud Services For Linux To Replace Copy.md | 135 ++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 sources/tech/20160220 Best Cloud Services For Linux To Replace Copy.md diff --git a/sources/tech/20160220 Best Cloud Services For Linux To Replace Copy.md b/sources/tech/20160220 Best Cloud Services For Linux To Replace Copy.md new file mode 100644 index 0000000000..cd2ffee237 --- /dev/null +++ b/sources/tech/20160220 Best Cloud Services For Linux To Replace Copy.md @@ -0,0 +1,135 @@ +Best Cloud Services For Linux To Replace Copy +=============================================== + +![](http://itsfoss.com/wp-content/uploads/2016/02/Linux-cloud-services.jpg) + +Cloud storage service Copy is shutting down and it is time for us Linux users to look for a worthy **cloud storage alternative to Copy for Linux**. + +All files will be deleted on May 1st, 2016. If you are a Copy user, you should save your files and move it to other + +Copy has been my favorite cloud storage for past couple of years. It gave me plenty of free storage and came with native apps for desktop platforms including Linux and mobile platforms as iOS and Android. + +It was a perfect Cloud storage for me where I get plenty of free storage (380 GB) with a seamless experience between desktop and mobile OSes. But this ‘easy free storage’, 15GB for signup and 5Gb for each referral, had me thinking that if Copy doesn’t get business customers, they will be running out of business soon. Such huge free storage only meant that they were not targeting individual customers like Dropbox do. + +My fear came true when I read about the shutting down of Copy.com. In fact, Copy is not alone. Its parent company [Barracuda Networks](https://www.barracuda.com/) is going through a rough patch and has [hired Morgan Stanely to look for suitable buyer](http://www.bloomberg.com/news/articles/2016-02-01/barracuda-networks-said-to-work-with-morgan-stanley-to-seek-sale)(s). + +Whatever be the reason, all we know is that Copy will soon be history and we need to find similarly **good cloud services for Linux**. I am putting emphasis on Linux because other popular cloud storage services like [Microsoft’s OneDrive](https://onedrive.live.com/about/en-us/) and [Google Drive](https://www.google.com/drive/) do not provide native Linux client. This is something expected out of Microsoft but [Google’s apathy towards Linux](http://itsfoss.com/google-hates-desktop-linux/) is shocking. + +## Best Copy alternatives for Linux + +Now, what do you want in a cloud storage services as a Linux storage? Let me guess: + +- Lots of free storage. After all, individuals cannot pay hefty amounts every month. +- Native Linux client. So that you can synchronize files easily with the server without doing special tweaking or running scripts at regular intervals. +- Desktop clients for other desktop OSes i.e. Windows and OS X. Portability is a necessity and syncing files between devices is such a good relief. +- Mobile apps for Android and iOS. In today’s modern world, you need to be connected across all the devices. + +I am not counting the self-hosted cloud services like OwnCloud or [Seafile](https://www.seafile.com/en/home/) because they require set-up and run a server. This is not apt for all home users who want a Copy like cloud service. + +Let’s see what are the services that you could use to replace Copy.com on Linux. + +## Mega + +![](http://itsfoss.com/wp-content/uploads/2016/02/Mega-Linux.jpg) + +If you are a regular It’s FOSS reader, you might have come across my earlier article about [Mega on Linux](http://itsfoss.com/install-mega-cloud-storage-linux/). This cloud service is an offering by the infamous [Kim Dotcom](https://en.wikipedia.org/wiki/Kim_Dotcom) of [Megaupload scandal](https://en.wikipedia.org/wiki/Megaupload). This also makes some users skeptical about it because Kim Dotcom has been a target by US authorities for a long time. + +Mega has everything that you would expect in a hassle free cloud service. It provides 50 GB of free storage to individual users. Provide native clients for Linux and other platforms and also has end to end encryption. The native Linux client works fine and the sync across the device is seamless. You can also view and access your files in a web browser. + +### Pros: + +- 50 GB of free storage +- End to end encryption +- Native clients for Linux and other platforms such as Windows, Mac OS X, Android, iOS + +### Cons: + +- Shady past of the owner + +[Mega](https://mega.nz/) + +## Hubic + +![](http://itsfoss.com/wp-content/uploads/2016/02/hubic.jpeg) + +Hubic is a cloud service from French company [OVH](https://www.ovh.com/fr/). Hubic also offers 25 GB of free cloud storage at sign up. You can further extend it to 50GB (for free users) by referring it to friends. + +Hubic has a Linux client which is in beta (for over two years now). Hubic has an official Linux client but it is limited to command line. I did not go on to test the mobile versions. + +Hubic boasts of some nice features though. Apart from simple to use interface, file sharing etc, it has a Backup feature where you can archive your important files regularly. + +### Pros: + +- 25 GB of free storage, extendable up to 50 GB +- Available on multiple platforms +- Backup feature + +### Cons: + +- Linux client in beta, only available in command line + +[Hubic](https://hubic.com/) + +## pCloud + +![](http://itsfoss.com/wp-content/uploads/2016/02/pCloud-Linux.jpeg) + +pCloud is another European offering but this time across the French border, from Switzerland. Focused on encryption and security, pCloud offers 10 GB of free storage for each signup. You can further increase it up to 20 GB by inviting friends, sharing links on social media etc. + +It has all the standard features of a cloud service such as file sharing and synchronization, selective syncing etc. pCloud also has native clients across platforms, including Linux of course. + +Linux client is easy to use and worked well in my limited testing on Linux Mint 17.3. + +### Pros: + +- 10 GB of free storage, extendable up to 20 GB +- A good working Linux client with GUI + +### Cons: + +- Encryption is a premium feature + +[pCloud](https://www.pcloud.com/) + +## Yandex Disk + +![](http://itsfoss.com/wp-content/uploads/2016/02/Yandex.jpg) + +Russian internet giant Yandex has everything that Google has. A search engine, analytics and webmaster tool, email, web browser and cloud storage service. + +Yandex Disk offers 10 GB of free cloud storage on sign up. It has native clients for multiple platforms, including Linux. However, the official Linux client is only command line. You can get [unofficial GUI client for Yandex disk](https://mintguide.org/tools/265-yd-tools-gui-indicator-for-yandexdisk-free-cloud-storage-in-linux-mint.html) though. File sharing via links is available as along with other standard cloud storage feature. + +### Pros: + +- 10 GB of free storage, extendable up to 20 GB via referrals. + +### Cons: + +- Only command line client available + +[Yandex Disk](https://disk.yandex.com/) + +## Honorable and deliberate omissions + +I have deliberately skipped [Dropbox](https://www.dropbox.com/), [SpiderOak](https://spideroak.com/) from the list. Dropbox is excellent for Linux but the free storage is limited to 2 GB. Over the past several years, I have managed to increase it to over 21 GB, but that’s another story. + +SpiderOak also provides only 2 GB of free storage and you cannot access it in a web browser. + +OwnCloud needs its own server and set-up and thus it is not everyone’s cup of tea. And it certainly doesn’t fit the criteria of a typical cloud service. + +## Verdict + +If you ask me what I am going to use in place of Copy, my answer is Mega. It has plenty of free cloud storage and a great Linux desktop client. What is your choice among this list of **best cloud storage services for Linux**? Which one do you prefer? + + +------------------------------------------------------------------------------ + +via: http://itsfoss.com/cloud-services-linux/ + +作者:[ABHISHEK][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ From 6ff062bb00db4edb580a3183c487d2ae12d2a9b0 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 20 Feb 2016 16:04:28 +0800 Subject: [PATCH 0369/1469] =?UTF-8?q?20160220-4=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...e Becomes Real With First Ubuntu Tablet.md | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 sources/tech/20160220 Convergence Becomes Real With First Ubuntu Tablet.md diff --git a/sources/tech/20160220 Convergence Becomes Real With First Ubuntu Tablet.md b/sources/tech/20160220 Convergence Becomes Real With First Ubuntu Tablet.md new file mode 100644 index 0000000000..a7beb58156 --- /dev/null +++ b/sources/tech/20160220 Convergence Becomes Real With First Ubuntu Tablet.md @@ -0,0 +1,73 @@ +Convergence Becomes Real With First Ubuntu Tablet +==================================================== + +![](http://itsfoss.com/wp-content/uploads/2016/02/front-landscape-1-e1454624669422.jpg) + +First Ubuntu tablet has been just announced. Canonical, parent company of Ubuntu, and Spanish hardware manufacturer BQ are all set to unveil the first Ubuntu tablet at Mobile World Congress, later this month. + +BQ is also the manufacturer of the [first Ubuntu Phone](http://itsfoss.com/ubuntu-phone-specification-release-date-pricing/). The partnership between Canonical and BQ extends to the tablet as well. + +Ubuntu has been running the [#reinvent campaign on social media](https://business.facebook.com/media/set/?set=a.656637987810305.1073741827.115098615297581&type=3) and the web ahead of the launch to generate curiosity over the tablet. But does an Ubuntu fan really need a dedicated campaign to know about such things? I think not. + +Ahead of this launch, specifications of the Ubuntu tablet and some teasers have been released. No surprises that the main focus has been on [convergence](https://insights.ubuntu.com/2015/10/20/ubuntus-path-to-convergence/). + +[Ubuntu Phone has demonstrated convergence](http://www.omgubuntu.co.uk/2015/02/new-video-shows-off-ubuntu-convergence-demoed-on-tablet-phone) several times in the past. Ubuntu tablet takes it to the next level. Just adding an HDMI cable makes it to a full-fledged desktop. All you need is a keyboard and a mouse. + +![](http://itsfoss.com/wp-content/uploads/2016/02/convergence-ubuntu-e1454624459103.jpg) + +## BQ Ubuntu tablet specification + +BQ will be using its trusted [Aquaris M10](http://www.bq.com/es/aquaris-m10) series to launch an Ubuntu edition. This is a strategy they used earlier with Ubuntu Phone where they launched an Ubuntu edition of their Aquaris e4.5 Android smartphone. + +Aquaris M10 boasts of a decent hardware and an enormous 10 inches screen size. A quick list of specification includes: + +- 10.1 inch multi-touch screen +- MediaTek Quad Core MT8163A processor up to 1.5GHz +- High capacity Li-Po battery (7280mAh) +- Full HD (1080p) camera for super-sharp video recording +- 2GB RAM and 16GB internal memory +- MicroSD slot for extra storage (up to 64GB) +- 12 megapixel camera with autofocus and dual flash +- Frontal speakers +- Micro HDMI slot +- Dimensions: 246 x 171 x 8.2mm +- Lightweight at only 470g + +These proposed specifications have been taken from Ubuntu’s official website which doesn’t match up with the Aquaris M10 specification on BQ website though. Ubuntu website shows a 12 MP camera while BQ website has 8 MP max. + +As you can see, first Ubuntu tablet is not really a power horse. In 2016, 2GB of RAM doesn’t seem to be sufficient. Moreover, the closed source MediaTek processors are another let down of the first Ubuntu Phone. + +However, a supposed price tag of Euro 260 (the Android version costs the same) is a positive factor here and considering its capability to converge into a desktop, 10 inches screen keeps it in the entry level Netbook section. + +The 470 g weight is another plus factor. + +## First look at Ubuntu tablet + +While Ubuntu tablet will be officially unveiled at Mobile World Congress, you can have a glimpse of its looks and functionings in the pictures below: + +![](http://itsfoss.com/wp-content/uploads/2016/02/tablet-overview-hero-300x182.png) + +## Price, availability and release date + +BQ Aquaris M10 Ubuntu edition will go on sale in the second quarter of the year 2016. Guessing from Ubuntu Phone experience, it should be available for Europe and UK first and later in other parts of the world. + +The price should be around 260-270 Euro. This too is an estimate based on the price of the Android version. + +## Up for the grab? + +I was not very convinced at the first Ubuntu Phone. However, I think Ubuntu tablet is a better device than the Ubuntu Phone. With Snappy coming in action, Ubuntu tablet has the potential to become a mobile device cum desktop. + +What do you think of it? + +------------------------------------------------------------------------------ + +via: http://itsfoss.com/ubuntu-tablet/ + +作者:[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/ + From 435cab7d902cc27d73763e4152589f691fef4026 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 20 Feb 2016 16:13:48 +0800 Subject: [PATCH 0370/1469] =?UTF-8?q?20160220-5=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...er Kubuntu Head Unveils New KDE Project.md | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 sources/tech/20160220 Former Kubuntu Head Unveils New KDE Project.md diff --git a/sources/tech/20160220 Former Kubuntu Head Unveils New KDE Project.md b/sources/tech/20160220 Former Kubuntu Head Unveils New KDE Project.md new file mode 100644 index 0000000000..dc3b2a1a76 --- /dev/null +++ b/sources/tech/20160220 Former Kubuntu Head Unveils New KDE Project.md @@ -0,0 +1,35 @@ +Former Kubuntu Head Unveils New KDE Project +============================================== + +The name Jonathan Riddell should ring a bell if you read Linux and [open source news](http://itsfoss.com/category/news/). He was the creator and longtime lead developer of the [Kubuntu](http://www.kubuntu.org/) distribution. He was [forced out of his position by Ubuntu boss Mark Shuttleworth](http://www.cio.com/article/2926838/linux/mark-shuttleworth-ubuntu-community-council-ask-kubuntu-developer-to-step-down-as-leader.html) last year because he dared to ask what happened to the funds Canonical had raised for Kubuntu. (To the best of my knowledge, Canonical never really answered to his questions about finances.) + +![](http://itsfoss.com/wp-content/uploads/2016/02/kde-neon-e1454448724263.png) + +## KDE neon logo + +On Saturday, Riddell [announced](https://dot.kde.org/2016/01/30/fosdem-announcing-kde-neon) a new project: [KDE neon](http://neon.kde.org.uk/). According to Riddell’s announcement “Neon will provide a way to get the latest KDE software on the day it’s released.” + +After reading both the announcement and looking at the brief site, **it appears that neon is a mainly a “rapidly updated software repository” that allows KDE fans to be on the bleeding edge**. Instead of waiting for months for distro developers to release the updated KDE on their repos, you’ll be able to get it hot off the presses. + +KDE did state in the [noen FAQ](http://neon.kde.org.uk/faq) that this is not a KDE created distro. In fact, they say “KDE believes it is important to work with many distributions, as each brings unique value and expertise for their respective users. This is one project out of hundreds from KDE.” + +![](http://itsfoss.com/wp-content/uploads/2016/02/kde-neon-e1454448830870.jpg) + +However, the way the site and the announcement refer to the fact that neon runs on Ubuntu 15.10 (until the next LTS version is available) and that there will soon be images makes me wonder. KDE could be saying this to keep Canonical from seeing this project as a competitor to Kubuntu. If they that there is a demand for KDE neon, they could spin it off as a full distro. Both the announcement and site state that this is a KDE Incubator project, so the future could hold anything for this project. + +[KDE neon](http://neon.kde.org.uk/) + +Does neon sound like it would be useful for you or are you happy with your current distro’s KDE release rate? Do you think there is room for another KDE distro (if KDE decides to head in that direction)? Let me know in the comment section below. + +------------------------------------------------------------------------------ + +via: http://itsfoss.com/kde-neon-unveiled/ + +作者:[JOHN PAUL][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/john/ + From 7d760a6a01194c7250aefc778b9e430676b8aaac Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 20 Feb 2016 16:34:30 +0800 Subject: [PATCH 0371/1469] =?UTF-8?q?20160220-6=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ux Mint 18 Will Get Its Own Set Of Apps.md | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 sources/tech/20160220 Linux Mint 18 Will Get Its Own Set Of Apps.md diff --git a/sources/tech/20160220 Linux Mint 18 Will Get Its Own Set Of Apps.md b/sources/tech/20160220 Linux Mint 18 Will Get Its Own Set Of Apps.md new file mode 100644 index 0000000000..2ef5effbb7 --- /dev/null +++ b/sources/tech/20160220 Linux Mint 18 Will Get Its Own Set Of Apps.md @@ -0,0 +1,62 @@ +Linux Mint 18 Will Get Its Own Set Of Apps +============================================= + +![](http://itsfoss.com/wp-content/uploads/2016/01/Linux-Mint-apps.jpg) + +It’s common for distro developers to create and release a series of apps that are designed specifically for their distros. A big example of this is [elementary OS](https://elementary.io/). Nine years in, Linux Mint is finally taking the plunge and doing the same. + +>#LinuxMint to finally get its own apps in Mint 18. + +[Linux Mint](http://www.linuxmint.com/) is one of the best known Linux distros available. Based on Ubuntu and Debian, Linux Mint strives to create a “modern, elegant and comfortable operating system which is both powerful and easy to use”. The team behind Linux Mint is also very involved with the [MATE](http://itsfoss.com/install-mate-desktop-ubuntu-14-04/) and [Cinnamon](http://itsfoss.com/install-cinnamon-ubuntu-14-04/) desktop environments. + +## First X-Men, now X-Apps + +Thursday, Linux Mint project lead Clement Lefebvre [announced](http://blog.linuxmint.com/?p=2985) the creation of the X-Apps. The X-Apps are designed to be desktop-agnostic so that developers can update them without having to tweak them for each desktop environment. Lefebvre stated that these X-Apps would be used as default applications for Cinnamon, MATE and Xfce. + +## Does Linux Need Even More Apps? + +According to Lefebvre, the creation of the X-Apps was necessitated by the release of GNOME 3.18. He said that with the release of GNOME 3.18: + +> “GTK itself and many of the GNOME applications now integrate better with GNOME Shell and look more native in that environment. The bad news, is that they now look completely out of place everywhere else. To make matters worse, Unity, the flagship product of Ubuntu, relies heavily on GTK, GNOME applications and the GNOME environment itself, so we’re not dealing with the upstream version of 3.18 here, but with a collection of patches which bring their own issues (one example is that Ubuntu reintroduces menubars and titlebars in applications but without rewriting their headerbar.. so you sometimes see all three of them).” + +In the past, the Linux Mint team dealt with the problem by “downgrading apps (Linux Mint 17 uses gedit 2.30 for instance), patching GNOME (GTK and various GNOME apps) and using alternatives (mostly in MATE and Xfce)”. + +Lefebvre also said that it didn’t make sense to build specific applications for Cinnamon and MATE this is why they opted to work on apps which would be generic, perfectly suited to run in Cinnamon, MATE and Xfce (and possibly other desktop environments). + +He further added: + +>"X-Apps will be a collection of generic GTK3 applications using traditional interfaces which can be used as default desktop components in Cinnamon, MATE and Xfce. In Mint 18, the “X apps” will allow us to maintain a native look and a good level of integration because they will be used in replacement of GNOME applications which now look foreign (using headerbars and a distinctive layout). Long-term, the X-App project will allow us to innovate and to develop new features and improvements in the applications themselves (this is something we couldn’t do via patches, temporary forks or DE-specific forks like the MATE apps because it was too costly)." + +## What Kind of Apps Will Be Available? + +![](http://itsfoss.com/wp-content/uploads/2016/01/xedit.png) + +Lefebvre only revealed one of the upcoming X-Apps: a text editor named xedit. Here are some of the feature that it will provide: + +- Based on Pluma to lower learning curve +- Makes use of GTK3 +- Doesn’t depend on GNOME or MATE + +## When + +The X-Apps will be coming together with [Linux Mint 18 release](http://itsfoss.com/linux-mint-18-codenamed-sarah/), which will follow the release of Ubuntu 16.04 LTS by several months. [Ubuntu 16.04 is scheduled to release in April](http://itsfoss.com/ubuntu-1604-release-schedule/). + +## Final Thoughts + +Personally, whenever I hear about someone releasing new distro specific apps, I cringe. The Linux universe is already incredibly fragmented. Do we really need more duplicate projects to take time and energy to create? Don’t get me wrong, I like the idea of desktop-agnostic apps. It would fix a lot of problems with how apps look from distro to distro. + +The problem that worries me is “Will they be able to pull it off?” As I stated before, the Linux Mint guys also work on two desktop environments. Now add application development to the mix. I’ve never written a piece of software myself (other than one that said “Hello, World”), but I do know that when you try and complicate a project bad things happen. Many projects have fallen to the dragon of feature creep I hope that doesn’t happen here. + +Do you have a different take? Let me know in the comments below. + +------------------------------------------------------------------------------ + +via: http://itsfoss.com/linux-mint-own-apps/ + +作者:[JOHN PAUL][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/john/ From 291ffd96eaac49b1747ed249c91b290618922662 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 20 Feb 2016 16:46:59 +0800 Subject: [PATCH 0372/1469] =?UTF-8?q?20160220-7=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Download] Vi Cheat Sheet For Beginners.md | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 sources/tech/20160220 [Free Download] Vi Cheat Sheet For Beginners.md diff --git a/sources/tech/20160220 [Free Download] Vi Cheat Sheet For Beginners.md b/sources/tech/20160220 [Free Download] Vi Cheat Sheet For Beginners.md new file mode 100644 index 0000000000..0a43387984 --- /dev/null +++ b/sources/tech/20160220 [Free Download] Vi Cheat Sheet For Beginners.md @@ -0,0 +1,78 @@ +[Free Download] Vi Cheat Sheet For Beginners +================================================ + +![](http://itsfoss.com/wp-content/uploads/2016/01/VI.jpg) + +I have often shared my Linux experience with you. Today I am going to share my **Vi cheat sheet** that has often saved me time in googling for a quick command. + +## Basic Vi commands + +This is not a detailed tutorial to teach you each and every aspect of [Vi editor](https://en.wikipedia.org/wiki/Vi). In fact, it’s not a tutorial at all. It’s just a collection of basic Vi commands and their brief description for a quick reference. + +command|explain +:--|:-- +:x |Save the file and quit +:q!|Quit without saving the file +i|Insert starting left of the cursor +a|Append starting right of the cursor +ESC|Exit insert/append mode +arrows|Move cursor +/text|Search string text (case sensitive) +n|Search next occurrence of the searched item +x|Delete character under the cursor +dd|Delete line under the cursor +u|Undo last change +:0|Beginning of the file +:n|Go to line n +G|End of the file +^|Beginning of the line +$|End of the line +:set list|See special characters in the file +yy|Copy the line into the buffer +5yy|Copy 5 lines into the buffer +p|Paste buffer after the current line + +You can download the above cheat sheet in a PDF format from the link below: + +[Download Vi Cheat Sheet](https://drive.google.com/file/d/0By49_3Av9sT1X3dlWkNQa3g2b2c/view?usp=sharing) + +You can print it and keep it at your desk or just save it for offline use. + +## Why I created the Vi cheat sheet? + +Several years ago, when I started working in Linux terminal, the idea of using a command line editor horrified me. I had used desktop Linux before but it was my personal computer so I happily used the GUI text editor like Gedit. But in the working environment, I was stuck with the command line and there was no scope of using a graphical editor. + +I was forced to use Vi for basic edits in the files on remote Linux boxes and this is where I identified and started to admire the power of command line editing tool Vi. + +Since, at that time, I was new at Vi editor, I found myself baffling with it. The first time, I could not even come out of the file because I did not know how to close Vi editor. No shame in accepting that I had to Google it. + +So, I decided to make a list of all the basic commands that I used frequently for editing in Vi. This list or cheat sheet, as you may call it, helped me a lot in my early days with Vi. With time, I grew up with Vi and now I don’t even need to look at the Vi cheat sheet because I have the commands memorized by heart. + +## Why should you use Vi cheat sheet? + +I can understand your situation if you are just getting started with Vi. Your favorite Ctrl+S doesn’t work for saving files. Ctrl+C and Ctrl+V were supposed to be the universal shortcut for copy and paste but it won’t work in Vi universe.Thousands of people use cheat sheets + +Thousands of people use such cheat sheets for various programming languages and `/` or tools that give them a quick reference to commonly used steps `/` commands. Trust me, using cheat sheets among the best practices advised to programmers. + +This Vi cheat sheet will help you a lot if you are just starting with Vi or if you infrequently use the Vi editor (so you keep forgetting the commands). You can save it and use it for quick reference in future, that too offline. + +## Do you like it? + +So far, I have refrained myself from going into too much on terminal side. How do you find this post? Do you want me to share more such cheat sheets and downloadable items? Your suggestions are welcomed. + +------------------------------------------------------------------------------ + +via: http://itsfoss.com/download-vi-cheat-sheet/ + +作者:[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/ + + + + + From 9100e0c49aca1309ad0191e2c80aab601261aee8 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Sat, 20 Feb 2016 17:02:26 +0800 Subject: [PATCH 0373/1469] Translated share/20151204 Review EXT4 vs. Btrfs vs. XFS.md --- .../20151204 Review EXT4 vs. Btrfs vs. XFS.md | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 translated/share/20151204 Review EXT4 vs. Btrfs vs. XFS.md diff --git a/translated/share/20151204 Review EXT4 vs. Btrfs vs. XFS.md b/translated/share/20151204 Review EXT4 vs. Btrfs vs. XFS.md new file mode 100644 index 0000000000..b2e71c0da3 --- /dev/null +++ b/translated/share/20151204 Review EXT4 vs. Btrfs vs. XFS.md @@ -0,0 +1,66 @@ +EXT4、Btrfs、XFS 文件系统回顾 +================================================================================ +![](http://1426826955.rsc.cdn77.org/wp-content/uploads/2015/09/1385698302_funny_linux_wallpapers-593x445.jpg) + +老实说,人们最不曾考虑的问题之一是他们的个人电脑中使用了什么文件系统。Windows 和 Mac OS X 用户更没有理由去考虑,因为对于他们的操作系统,只有一种选择,那就是 NTFS 和 HFS+。相反,对于 Linux 系统而言,有很多种文件系统可以选择,现在默认的是广泛采用的 ext4。然而,现在也有改用一种称为 btrfs 文件系统的趋势。那是什么使得 btrfs、或者其它文件系统变得更优秀呢?什么时候我们又能看到 Linux 发行版作出改变呢? + +首先让我们对文件系统以及它们真正干什么有个总体的认识,然后我们再对一些有名的文件系统做详细的比较。 + +### 文件系统是干什么的? ### + +如果你不清楚文件系统是干什么的,一句话总结起来也非常简单。文件系统主要用于控制所有程序不再使用数据时如何存储数据、如何访问数据以及有什么其它信息(元数据)和数据本身相关,等等。听起来要编程实现并不是轻而易举的事情,实际上也确实如此。文件系统一直在改进,包括更多的功能、更高效地完成它需要做的事情。总而言之,它是所有计算机的基本需求、但并不像听起来那么简单。 + +### 为什么要分区? ### + +由于每个操作系统都能创建或者删除分区,很多人对分区都有模糊的认识。Linux 操作系统在同一块磁盘上使用多个分区,就算使用标准安装过程,这看起来很奇怪,因此需要一些解释。拥有不同分区的一个主要目的就是为了在灾难发生时能获得更好的数据安全性。 + +通过将硬盘划分为分区,数据会被分隔以及重组。当事故发生的时候,只有存储在被损坏分区的数据会被破坏,很大可能上其它分区的数据能得以保留。这个原因可以追溯到 Linux 操作系统还没有日志文件系统,任何掉电都有可能导致灾难发生的时候。 + +使用分区也考虑到了安全和健壮性原因,因此操作系统部分损坏并不意味着整个计算机就有风险或者会受到破坏。这也是当前采用分区的一个最重要因素。举个例子,用户创建了一些会填满磁盘的脚本、程序或者 web 应用,如果该磁盘只有一个大的分区,如果磁盘满了那么整个系统就不能工作。如果用户把数据保存在不同的分区,那么就只有那个分区会受到影响,而系统分区或者其它数据分区仍能正常运行。 + +记住,拥有一个日志文件系统只能在掉电或者和存储设备意外断开连接时提供数据安全性,并不能在文件系统出现坏块或者发生逻辑错误时保护数据。对于这种情况,用户可以采用廉价磁盘冗余阵列(RAID:Redundant Array of Inexpensive Disks)的方案。 + +### 为什么要选择文件系统? ### + +ext4 文件系统由 ext3 文件系统改进而来,而后者又是从 ext2 文件系统改进而来。虽然 ext4 文件系统已经非常稳定,是过去几年中绝大部分发行版的默认选择,但它是基于陈旧的代码开发而来。另外, Linux 操作系统用户也需要很多 ext4 文件系统本身不提供的新功能。虽然通过某些软件能满足这种需求,但性能会受到影响,在文件系统层次做到这些能获得更好的性能。 + +### Ext4 文件系统 ### + +ext4 还有一些令人印象深刻的限值。最大文件大小是 16tebibytes(大概是 17.6 terabytes),这比普通用户当前能买到的硬盘还要大。使用 ext4 能创建的最大卷/分区是 1 exbibyte(大概是 1,152,921.5 terabytes)。通过使用多种技巧, ext4 比 ext3 有很大的速度提升。类似一些最先进的文件系统,它是一个日志文件系统,意味着它会对文件在磁盘中的位置以及任何其它对磁盘的更改做记录。纵观它的所有功能,它还不支持透明压缩、重复数据删除或者透明加密。技术上支持了快照,但该功能还处于实验性阶段。 + +### Btrfs 文件系统 ### + +btrfs 有很多不同的发音,例如 Better FS、Butter FS 或者 B-Tree FS。它是一个几乎完全从头开发的文件系统。btrfs 存在的原因是它的开发者期初希望扩展文件系统的功能使得它包括快照、池化、校验以及其它一些功能。虽然和 ext4 无关,它也希望能保留 ext4 中能使消费者和商家受益的功能,并整合额外的能使每个人、尤其是企业受益的功能。对于使用大型软件以及大规模数据库的企业,对于多种不同的硬盘看起来一致的文件系统能使他们受益并且使数据整合变得更加简单。删除重复数据能降低数据实际使用的空间,当需要镜像一个单一和广泛文件系统时使用 btrfs 也能使数据镜像变得简单。 + +用户当然可以继续选择创建多个分区从而无需镜像任何东西。考虑到这种情况,btrfs 能横跨多种硬盘,和 ext4 相比,它能支持 16 倍多的驱动空间。btrfs 文件系统一个分区最大是 16 exbibytes,最大的文件大小也是 16 exbibytes。 + +### XFS 文件系统 ### + +XFS 文件系统是扩展文件系统(extent file system)的扩展。XFS 是 64 位高性能日志文件系统。对 XFS 的支持大概在 2002 年合并到了 Linux 内核,到了 2009 年,红帽企业版 Linux 5.4 也支持了 XFS 文件系统。对于 64 位文件系统,XFS 支持最大文件系统大小为 8 exbibytes。XFS 文件系统有一些缺陷,例如它不能压缩,删除大量文件时性能低下。RHEL 7.0 文件系统默认使用 XFS。 + +### 总后总结 ### + +不幸的是,还不知道 btrfs 什么时候能到来。官方说,下一代文件系统仍然被归类到“不稳定”,但是如果用户下载最新版本的 Ubuntu,他就可以选择安装到 btrfs 分区上。什么时候 btrfs 会被归类到 “稳定” 仍然是个谜, 直到真的认为它“稳定”之前,用户也不应该期望 Ubuntu 会默认采用 btrfs。有报道说 Fedora 18 会用 btrfs 作为它的默认文件系统,因为到了发布它的时候,应该有了 btrfs 文件系统校验器。由于还没有实现所有的功能,另外和 ext4 相比性能上也比较缓慢, btrfs 还有很多的工作要做。 + +那么,究竟使用哪个更好呢?尽管性能几乎相同,但 ext4 还是赢家。为什么呢?答案在于易用性以及广泛性。对于桌面或者工作站, ext4 仍然是一个很好的文件系统。由于默认提供,用户可以在上面安装操作系统。同时, ext4 支持最大 1 exabytes 的卷和 16 terabytes 的文件,因此考虑到大小,它也还有很大的进步空间。 + +btrfs 能提供更大的高达 16 exabytes 的卷以及更好的容错,但是,到现在为止,它感觉更像是一个附加文件系统,而没有集成到 Linux 操作系统。比如,尽管 btrfs 支持不同的发行版,使用 btrfs 格式化硬盘之前先要有 btrfs-tools 工具,这意味着安装 Linux 操作系统的时候它并不是一个可选项。 + +尽管传输速率非常重要,评价一个文件系统出了文件传输速度之外还有很多因素。btrfs 有很多好用的功能,例如写复制、扩展校验、快照、清洗、数据自治愈、冗余删除以及其它保证数据完整性的功能。和 ZFS 相比 btrfs 缺少 RAID-Z 功能,因此对于 btrfs, RAID 还处于实验性阶段。对于单纯的数据存储,和 ext4 相比 btrfs 似乎更加优秀,但时间会验证一切。 + +迄今为止,对于桌面系统而言,ext4 似乎是一个更好的选择,因为它是默认的文件系统,传输文件时也比 btrfs 更快。btrfs 当然值得尝试、但要在桌面 Linux 上完全取代 ext4 可能还需要一些时间。数据场和大存储池会揭示关于 ext4、XCF 以及 btrfs 不同的故事和差异。 + +如果你有其它不同的或者额外的观点、在下面的评论框中告诉我们吧。 +If you have a different or additional opinion, kindly let us know by commenting on this article. + +-------------------------------------------------------------------------------- + +via: http://www.unixmen.com/review-ext4-vs-btrfs-vs-xfs/ + +作者:[M.el Khamlichi][a] +译者:[ictlyh](http://mutouxiaogui.cn/blog/) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.unixmen.com/author/pirat9/ From baaa02aa74732629f9b5040b43c6e8e174e2ef40 Mon Sep 17 00:00:00 2001 From: Yuking-net Date: Sat, 20 Feb 2016 21:16:24 +0800 Subject: [PATCH 0374/1469] Update 20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md --- ...untu Edition Announced and It's a Beast.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/translated/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md b/translated/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md index 7bc06d74b7..e655b4ffba 100644 --- a/translated/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md +++ b/translated/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md @@ -5,32 +5,32 @@ 自从上次听到魅族的消息到现在已经很久了,但是看起来 Canonical 和这个中国的硬件厂商之间的合作关系仍然存在。从表面来看,之前魅族的 MX4 Ubuntu 版只是进行了小范围的发布,所以只有很少的设备卖出去了。 -我们仅仅希望 魅族 Pro 5 Ubuntu 版可以提高供货量,特别因为它还是一个魅族仍然提供支持的非常新的手机。 +我们仅仅希望魅族 Pro 5 Ubuntu 版可以提高供货量,尤其是因为它是魅族的一款相当新且还提供支持的手机。 -最新的魅族 Pro 5 是第5个支持 Ubuntu Touch 的官方设备,而且在2016 年我们将会看到更多的手机以及平板都会预装这个操作系统。 +最新的魅族 Pro 5 是第5个支持 Ubuntu Touch 的官方设备,2016 年我们可能会看到更多的手机甚至是平板都会预装这个操作系统。 ## 魅族 Pro 5 Ubuntu 版将会非常震撼 -Canonical 宣称 Pro 5 是目前已发布了的 Ubuntu 智能手机中最强大的, 他们说的是对的, 除了这一点,它还是平板以外最大的设备。 魅族 Pro 5 拥有一颗 Exynos 7420 8核处理器,5.7 英寸分辨率为1920x1080 的 AMOLED 屏,覆盖第三代大猩猩屏,以及 LPDDR4 内存技术。 +Canonical 宣称 Pro 5 是目前已发布了的最强大的 Ubuntu 智能手机,他们说的是对的,但还有一点没有被提及,即如果不考虑平板,它还是最大的Ubuntu设备。魅族 Pro 5 采用一颗 Exynos 7420 8核处理器、5.7 英寸分辨率为1920x1080 的 AMOLED 屏、第三代康宁大猩猩屏以及 LPDDR4 内存技术。 -很多人也许会问这个新手机的系统是否可以和桌面版系统一样, 现在看起来用户是运气不错。 +很多人也许会问这个新手机的系统是否可以和桌面版系统一样,现在看起来用户是运气不错。 -公司解释说,“Canonical 一直致力于重塑个人计算的视觉表现,希望为所有的的个人设备提供自适应的平台。因此尽管 Pro 5 缺少 MHL 输出,但运行在魅族 Pro 5 上的是最新的代码,同时也是最新发布的支持平板和其它设备的系统,它可以提供一种接近传统桌面的体验。” +该公司解释说,“通过向各种个人设备提供一个单一的自适应平台,Canonical 一直致力于重塑个人计算的视觉表现。因此尽管魅族 Pro 5 缺少 MHL 输出,但它 运行的是最新的代码,这些代码与新近发布的平板和其它设备一样,可提供一种接近传统桌面的体验。” -魅族 Pro 5 最初实在2015 年9 月发布的。用户同时会拥有一个2100 万像素的后置摄像头,可以拍摄2160p 和30 fps 的视频。同时它还带有一个指纹传感器和支持快速充电的3050 mAh 的锂电池。 +魅族 Pro 5 最初于 2015 年9 月发布,拥有一个2100 万像素的后置摄像头,可以拍摄30fps 的 2160p 视频。同时它还带有一个指纹传感器和支持快速充电的 3050 mAh 的锂电池。 -目前这款手机只在中国和欧洲有售,预定将从2016 年世界移动大会期间开始,即2 月22 日至25 日。 +目前这款手机只在中国和欧洲有售,预定将从 2016 年 2 月 22 日至 25 日的世界移动大会期间开始。 ![](http://i1-news.softpedia-static.com/images/fitted/620x/meizu-pro-5-ubuntu-edition-announced-and-it-s-a-beast-photos-500526-11.jpg) ------------------------------------------------------------------------------ -via: http://www.linux.com/news/embedded-mobile/mobile-linux/886322-meizu-pro-5-ubuntu-edition-announced-and-its-a-beast +via: http://news.softpedia.com/news/meizu-pro-5-ubuntu-edition-announced-and-it-s-a-beast-photos-500526.shtml 作者:[Silviu Stahie][a] -译者:[译者ID](https://github.com/osk874) -校对:[校对者ID](https://github.com/校对者ID) +译者:[osk874](https://github.com/osk874) +校对:[Yuking](https://github.com/Yuking-net) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 3c641f1b3566efda27f43098f18c0f816291d2c4 Mon Sep 17 00:00:00 2001 From: Yuking-net Date: Sat, 20 Feb 2016 21:17:16 +0800 Subject: [PATCH 0375/1469] Update 20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md --- ...218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md b/translated/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md index e655b4ffba..294866bf67 100644 --- a/translated/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md +++ b/translated/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md @@ -17,7 +17,7 @@ Canonical 宣称 Pro 5 是目前已发布了的最强大的 Ubuntu 智能手机 该公司解释说,“通过向各种个人设备提供一个单一的自适应平台,Canonical 一直致力于重塑个人计算的视觉表现。因此尽管魅族 Pro 5 缺少 MHL 输出,但它 运行的是最新的代码,这些代码与新近发布的平板和其它设备一样,可提供一种接近传统桌面的体验。” -魅族 Pro 5 最初于 2015 年9 月发布,拥有一个2100 万像素的后置摄像头,可以拍摄30fps 的 2160p 视频。同时它还带有一个指纹传感器和支持快速充电的 3050 mAh 的锂电池。 +魅族 Pro 5 最初于 2015 年 9 月发布,拥有一个 2100 万像素的后置摄像头,可以拍摄 30fps 的 2160p 视频。同时它还带有一个指纹传感器和支持快速充电的 3050 mAh 的锂电池。 目前这款手机只在中国和欧洲有售,预定将从 2016 年 2 月 22 日至 25 日的世界移动大会期间开始。 From 208d3f9a288470fa3f0f3447406ad0f961a88ff8 Mon Sep 17 00:00:00 2001 From: Yuking-net Date: Sat, 20 Feb 2016 21:17:58 +0800 Subject: [PATCH 0376/1469] Update 20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md --- ...8 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translated/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md b/translated/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md index 294866bf67..81ad51e3ab 100644 --- a/translated/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md +++ b/translated/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md @@ -7,11 +7,11 @@ 我们仅仅希望魅族 Pro 5 Ubuntu 版可以提高供货量,尤其是因为它是魅族的一款相当新且还提供支持的手机。 -最新的魅族 Pro 5 是第5个支持 Ubuntu Touch 的官方设备,2016 年我们可能会看到更多的手机甚至是平板都会预装这个操作系统。 +最新的魅族 Pro 5 是第 5 个支持 Ubuntu Touch 的官方设备,2016 年我们可能会看到更多的手机甚至是平板都会预装这个操作系统。 ## 魅族 Pro 5 Ubuntu 版将会非常震撼 -Canonical 宣称 Pro 5 是目前已发布了的最强大的 Ubuntu 智能手机,他们说的是对的,但还有一点没有被提及,即如果不考虑平板,它还是最大的Ubuntu设备。魅族 Pro 5 采用一颗 Exynos 7420 8核处理器、5.7 英寸分辨率为1920x1080 的 AMOLED 屏、第三代康宁大猩猩屏以及 LPDDR4 内存技术。 +Canonical 宣称 Pro 5 是目前已发布了的最强大的 Ubuntu 智能手机,他们说的是对的,但还有一点没有被提及,即如果不考虑平板,它还是最大的Ubuntu设备。魅族 Pro 5 采用一颗 Exynos 7420 8 核处理器、5.7 英寸分辨率为 1920x1080 的 AMOLED 屏、第三代康宁大猩猩屏以及 LPDDR4 内存技术。 很多人也许会问这个新手机的系统是否可以和桌面版系统一样,现在看起来用户是运气不错。 From b5a2d52001890af341fc0dbe3052d69f23aea31b Mon Sep 17 00:00:00 2001 From: Yuking-net Date: Sat, 20 Feb 2016 21:18:45 +0800 Subject: [PATCH 0377/1469] Update 20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md --- ...8 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translated/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md b/translated/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md index 81ad51e3ab..fa75e049cb 100644 --- a/translated/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md +++ b/translated/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md @@ -1,7 +1,7 @@ 魅族 Pro 5 Ubuntu 版即将发布 ======================================================== -**Canonical 和魅族刚刚透露魅族 Pro 5 Ubuntu 版将在2016 世界移动大会召开期间开始预售** +**Canonical 和魅族刚刚透露魅族 Pro 5 Ubuntu 版将在 2016 世界移动大会召开期间开始预售** 自从上次听到魅族的消息到现在已经很久了,但是看起来 Canonical 和这个中国的硬件厂商之间的合作关系仍然存在。从表面来看,之前魅族的 MX4 Ubuntu 版只是进行了小范围的发布,所以只有很少的设备卖出去了。 @@ -11,7 +11,7 @@ ## 魅族 Pro 5 Ubuntu 版将会非常震撼 -Canonical 宣称 Pro 5 是目前已发布了的最强大的 Ubuntu 智能手机,他们说的是对的,但还有一点没有被提及,即如果不考虑平板,它还是最大的Ubuntu设备。魅族 Pro 5 采用一颗 Exynos 7420 8 核处理器、5.7 英寸分辨率为 1920x1080 的 AMOLED 屏、第三代康宁大猩猩屏以及 LPDDR4 内存技术。 +Canonical 宣称 Pro 5 是目前已发布了的最强大的 Ubuntu 智能手机,他们说的是对的,但还有一点没有被提及,即如果不考虑平板,它还是最大的 Ubuntu 设备。魅族 Pro 5 采用一颗 Exynos 7420 8 核处理器、5.7 英寸分辨率为 1920x1080 的 AMOLED 屏、第三代康宁大猩猩屏以及 LPDDR4 内存技术。 很多人也许会问这个新手机的系统是否可以和桌面版系统一样,现在看起来用户是运气不错。 From 026d0e3ce3ba84f921730320105109b2eabf98c5 Mon Sep 17 00:00:00 2001 From: Yuking-net Date: Sat, 20 Feb 2016 21:21:28 +0800 Subject: [PATCH 0378/1469] Update 20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md --- ...218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md b/translated/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md index fa75e049cb..b13c639b3d 100644 --- a/translated/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md +++ b/translated/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md @@ -11,7 +11,7 @@ ## 魅族 Pro 5 Ubuntu 版将会非常震撼 -Canonical 宣称 Pro 5 是目前已发布了的最强大的 Ubuntu 智能手机,他们说的是对的,但还有一点没有被提及,即如果不考虑平板,它还是最大的 Ubuntu 设备。魅族 Pro 5 采用一颗 Exynos 7420 8 核处理器、5.7 英寸分辨率为 1920x1080 的 AMOLED 屏、第三代康宁大猩猩屏以及 LPDDR4 内存技术。 +Canonical 宣称 Pro 5 是目前已发布了的最强大的 Ubuntu 智能手机,他们说的是对的,但还有一点没有被提及,即如果不考虑平板,它还是最大的 Ubuntu 设备。魅族 Pro 5 具备一颗 Exynos 7420 8 核处理器和 5.7 英寸分辨率为 1920x1080 的 AMOLED 屏,采用第三代康宁大猩猩玻璃以及 LPDDR4 内存技术。 很多人也许会问这个新手机的系统是否可以和桌面版系统一样,现在看起来用户是运气不错。 From 8c67721ceac1168266ad338ec7792d7bfcc4d0fa Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 20 Feb 2016 21:50:51 +0800 Subject: [PATCH 0379/1469] Update 20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md --- ...8 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translated/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md b/translated/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md index b13c639b3d..df872dd49e 100644 --- a/translated/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md +++ b/translated/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md @@ -11,11 +11,11 @@ ## 魅族 Pro 5 Ubuntu 版将会非常震撼 -Canonical 宣称 Pro 5 是目前已发布了的最强大的 Ubuntu 智能手机,他们说的是对的,但还有一点没有被提及,即如果不考虑平板,它还是最大的 Ubuntu 设备。魅族 Pro 5 具备一颗 Exynos 7420 8 核处理器和 5.7 英寸分辨率为 1920x1080 的 AMOLED 屏,采用第三代康宁大猩猩玻璃以及 LPDDR4 内存技术。 +Canonical 宣称 Pro 5 是目前已发布了的 Ubuntu 智能手机中最强大的一个,他们说的是对的,但还有一点没有被提及,即如果不考虑平板,它也是最大的 Ubuntu Touch 设备。魅族 Pro 5 采用了一颗 Exynos 7420 8 核处理器和 5.7 英寸分辨率为 1920x1080 的 AMOLED 屏,配备第三代康宁大猩猩玻璃以及 LPDDR4 内存技术。 很多人也许会问这个新手机的系统是否可以和桌面版系统一样,现在看起来用户是运气不错。 -该公司解释说,“通过向各种个人设备提供一个单一的自适应平台,Canonical 一直致力于重塑个人计算的视觉表现。因此尽管魅族 Pro 5 缺少 MHL 输出,但它 运行的是最新的代码,这些代码与新近发布的平板和其它设备一样,可提供一种接近传统桌面的体验。” +该公司解释说,“Canonical 一直致力于通过向各种个人设备提供一个统一的自适应平台来重塑个人计算的视觉表现。因此尽管魅族 Pro 5 缺少 MHL 输出,但它运行的是最新的代码,这些代码与新近发布的平板和其它设备一样,可提供一种接近传统桌面的体验。” 魅族 Pro 5 最初于 2015 年 9 月发布,拥有一个 2100 万像素的后置摄像头,可以拍摄 30fps 的 2160p 视频。同时它还带有一个指纹传感器和支持快速充电的 3050 mAh 的锂电池。 From d023a49156a57dbe7f9f4599875bc477bec7c90e Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 20 Feb 2016 21:53:09 +0800 Subject: [PATCH 0380/1469] =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E5=88=B0published?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...60218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/news => published}/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md (100%) diff --git a/translated/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md b/published/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md similarity index 100% rename from translated/news/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md rename to published/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md From 7503fd7d0b9590547bb0639044b852a6cd496d94 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 20 Feb 2016 22:06:52 +0800 Subject: [PATCH 0381/1469] =?UTF-8?q?=E4=B8=AD=E6=96=87=E6=8E=92=E7=89=88?= =?UTF-8?q?=E6=8C=87=E5=8D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 用来规范翻译之后的格式 --- chinese-copywriting-guidelines.md | 301 ++++++++++++++++++++++++++++++ 1 file changed, 301 insertions(+) create mode 100644 chinese-copywriting-guidelines.md diff --git a/chinese-copywriting-guidelines.md b/chinese-copywriting-guidelines.md new file mode 100644 index 0000000000..c2d0d207bd --- /dev/null +++ b/chinese-copywriting-guidelines.md @@ -0,0 +1,301 @@ +# 中文文案排版指北 +[![devDependency Status](https://david-dm.org/sparanoid/chinese-copywriting-guidelines/dev-status.svg)](https://david-dm.org/sparanoid/chinese-copywriting-guidelines#info=devDependencies) +[![Built with Almace Scaffolding](https://d349cztnlupsuf.cloudfront.net/amsf-badge.svg)](http://sparanoid.com/note/chinese-copywriting-guidelines/) + +統一中文文案、排版的相關用法,降低團隊成員之間的溝通成本,增強網站氣質。 + +Other languages: + +- [English](README.en.md) +- [Chinese Traditional](README.md) +- [Chinese Simplifed](https://github.com/mzlogin/chinese-copywriting-guidelines) + +----- + +## 目次 + +- [空格](#空格) + - [中英文之間需要增加空格](#中英文之間需要增加空格) + - [中文與數字之間需要增加空格](#中文與數字之間需要增加空格) + - [數字與單位之間需要增加空格](#數字與單位之間需要增加空格) + - [全形標點與其他字符之間不加空格](#全形標點與其他字符之間不加空格) + - [`-ms-text-autospace` to the rescue?](#-ms-text-autospace-to-the-rescue) +- [標點符號](#標點符號) + - [不重複使用標點符號](#不重複使用標點符號) +- [全形和半形](#全形和半形) + - [使用全形中文標點](#使用全形中文標點) + - [數字使用半形字符](#數字使用半形字符) + - [遇到完整的英文整句、特殊名詞,其內容使用半形標點](#遇到完整的英文整句特殊名詞其內容使用半形標點) +- [名詞](#名詞) + - [專有名詞使用正確的大小寫](#專有名詞使用正確的大小寫) + - [不要使用不地道的縮寫](#不要使用不地道的縮寫) +- [爭議](#爭議) + - [鏈接之間增加空格](#鏈接之間增加空格) + - [簡體中文使用直角引號](#簡體中文使用直角引號) +- [工具](#工具) +- [誰在這樣做?](#誰在這樣做) +- [參考文獻](#參考文獻) + +## 空格 + +「有研究顯示,打字的時候不喜歡在中文和英文之間加空格的人,感情路都走得很辛苦,有七成的比例會在 34 歲的時候跟自己不愛的人結婚,而其餘三成的人最後只能把遺產留給自己的貓。畢竟愛情跟書寫都需要適時地留白。 + +與大家共勉之。」——[vinta/paranoid-auto-spacing](https://github.com/vinta/pangu.js) + +### 中英文之間需要增加空格 + +正確: + +> 在 LeanCloud 上,數據存儲是圍繞 `AVObject` 進行的。 + +錯誤: + +> 在LeanCloud上,數據存儲是圍繞`AVObject`進行的。 + +> 在 LeanCloud上,數據存儲是圍繞`AVObject` 進行的。 + +完整的正確用法: + +> 在 LeanCloud 上,数据存储是围绕 `AVObject` 进行的。每个 `AVObject` 都包含了与 JSON 兼容的 key-value 对应的数据。数据是 schema-free 的,你不需要在每个 `AVObject` 上提前指定存在哪些键,只要直接设定对应的 key-value 即可。 + +例外:「豆瓣FM」等產品名詞,按照官方所定義的格式書寫。 + +### 中文與數字之間需要增加空格 + +正確: + +> 今天出去買菜花了 5000 元。 + +錯誤: + +> 今天出去買菜花了 5000元。 + +> 今天出去買菜花了5000元。 + +### 數字與單位之間需要增加空格 + +正確: + +> 我家的光纖入屋寬頻有 10 Gbps,SSD 一共有 20 TB。 + +錯誤: + +> 我家的光纖入屋寬頻有 10Gbps,SSD 一共有 20TB。 + +例外:度/百分比與數字之間不需要增加空格: + +正確: + +> 今天是 233° 的高溫。 + +> 新 MacBook Pro 有 15% 的 CPU 性能提升。 + +錯誤: + +> 今天是 233 ° 的高溫。 + +> 新 MacBook Pro 有 15 % 的 CPU 性能提升。 + +### 全形標點與其他字符之間不加空格 + +正確: + +> 剛剛買了一部 iPhone,好開心! + +錯誤: + +> 剛剛買了一部 iPhone ,好開心! + +### `-ms-text-autospace` to the rescue? + +Microsoft 有個 [`-ms-text-autospace`](http://msdn.microsoft.com/en-us/library/ie/ms531164(v=vs.85).aspx) 的 CSS 屬性可以實現自動為中英文之間增加空白。不過目前並未普及,另外在其他應用場景,例如 OS X、iOS 的用戶介面目前并不存在這個特性,所以請繼續保持隨手加空格的習慣。 + +## 標點符號 + +### 不重複使用標點符號 + +正確: + +> 德國隊竟然戰勝了巴西隊! + +> 她竟然對你說「喵」?! + +錯誤: + +> 德國隊竟然戰勝了巴西隊!! + +> 德國隊竟然戰勝了巴西隊!!!!!!!! + +> 她竟然對你說「喵」??!! + +> 她竟然對你說「喵」?!?!??!! + +## 全形和半形 + +不明白什麼是全形(全角)與半形(半角)符號?請查看維基百科詞條『[全形和半形](http://zh.wikipedia.org/wiki/%E5%85%A8%E5%BD%A2%E5%92%8C%E5%8D%8A%E5%BD%A2)』。 + +### 使用全形中文標點 + +正確: + +> 嗨!你知道嘛?今天前台的小妹跟我說「喵」了哎! + +> 核磁共振成像(NMRI)是什麼原理都不知道?JFGI! + +錯誤: + +> 嗨! 你知道嘛? 今天前台的小妹跟我說 "喵" 了哎! + +> 嗨!你知道嘛?今天前台的小妹跟我說"喵"了哎! + +> 核磁共振成像 (NMRI) 是什麼原理都不知道? JFGI! + +> 核磁共振成像(NMRI)是什麼原理都不知道?JFGI! + +### 數字使用半形字符 + +正確: + +> 這件蛋糕只賣 1000 元。 + +錯誤: + +> 這件蛋糕只賣 1000 元。 + +例外:在設計稿、宣傳海報中如出現極少量數字的情形時,為方便文字對齊,是可以使用全形數字的。 + +### 遇到完整的英文整句、特殊名詞,其內容使用半形標點 + +正確: + +> 賈伯斯那句話是怎麼說的?「Stay hungry, stay foolish.」 + +> 推薦你閱讀《Hackers & Painters: Big Ideas from the Computer Age》,非常的有趣。 + +錯誤: + +> 賈伯斯那句話是怎麼說的?「Stay hungry,stay foolish。」 + +> 推薦你閱讀《Hackers&Painters:Big Ideas from the Computer Age》,非常的有趣。 + +## 名詞 + +### 專有名詞使用正確的大小寫 + +大小寫相關用法原屬於英文書寫範疇,不屬於本 wiki 討論內容,在這裡只對部分易錯用法進行簡述。 + +正確: + +> 使用 GitHub 登錄 + +> 我們的客戶有 GitHub、Foursquare、Microsoft Corporation、Google、Facebook, Inc.。 + +錯誤: + +> 使用 github 登錄 + +> 使用 GITHUB 登錄 + +> 使用 Github 登錄 + +> 使用 gitHub 登錄 + +> 使用 gイんĤЦ8 登錄 + +> 我們的客戶有 github、foursquare、microsoft corporation、google、facebook, inc.。 + +> 我們的客戶有 GITHUB、FOURSQUARE、MICROSOFT CORPORATION、GOOGLE、FACEBOOK, INC.。 + +> 我們的客戶有 Github、FourSquare、MicroSoft Corporation、Google、FaceBook, Inc.。 + +> 我們的客戶有 gitHub、fourSquare、microSoft Corporation、google、faceBook, Inc.。 + +> 我們的客戶有 gイんĤЦ8、キouЯƧquムгє、๓เςг๏ร๏Ŧt ς๏гק๏гคtเ๏ภn、900913、ƒ4ᄃëв๏๏к, IПᄃ.。 + +注意:當網頁中需要配合整體視覺風格而出現全部大寫/小寫的情形,HTML 中請使用標準的大小寫規範進行書寫;並通過 `text-transform: uppercase;`/`text-transform: lowercase;` 對表現形式進行定義。 + +### 不要使用不地道的縮寫 + +正確: + +> 我們需要一位熟悉 JavaScript、HTML5,至少理解一种框架(如 Backbone.js、AngularJS、React 等)的前端開發者。 + +錯誤: + +> 我們需要一位熟悉 Js、h5,至少理解一种框架(如 backbone、angular、RJS 等)的 FED。 + +## 爭議 + +以下用法略帶有個人色彩,既:無論是否遵循下述規則,從語法的角度來講都是**正確**的。 + +### 鏈接之間增加空格 + +用法: + +> 请 [提交一个 issue](#) 并分配给相关同事。 + +> 訪問我們網站的最新動態,請 [點擊這裡](#) 進行訂閱! + +對比用法: + +> 请[提交一个 issue](#) 并分配给相关同事。 + +> 訪問我們網站的最新動態,請[點擊這裡](#)進行訂閱! + +### 簡體中文使用直角引號 + +用法: + +> 「老师,『有条不紊』的『紊』是什么意思?」 + +對比用法: + +> “老师,‘有条不紊’的‘紊’是什么意思?” + +## 工具 + +倉庫 | 語言 +--- | --- +[vinta/paranoid-auto-spacing](https://github.com/vinta/paranoid-auto-spacing) | JavaScript +[huei90/pangu.node](https://github.com/huei90/pangu.node) | Node.js +[huacnlee/auto-correct](https://github.com/huacnlee/auto-correct) | Ruby +[sparanoid/space-lover](https://github.com/sparanoid/space-lover) | PHP (WordPress) +[nauxliu/auto-correct](https://github.com/NauxLiu/auto-correct) | PHP +[hotoo/pangu.vim](https://github.com/hotoo/pangu.vim) | Vim +[sparanoid/grunt-auto-spacing](https://github.com/sparanoid/grunt-auto-spacing) | Node.js (Grunt) +[hjiang/scripts/add-space-between-latin-and-cjk](https://github.com/hjiang/scripts/blob/master/add-space-between-latin-and-cjk) | Python + +## 誰在這樣做? + +網站 | 文案 | UGC +--- | --- | --- +[Apple 中國](http://www.apple.com/cn/) | Yes | N/A +[Apple 香港](http://www.apple.com/hk/) | Yes | N/A +[Apple 台灣](http://www.apple.com/tw/) | Yes | N/A +[Microsoft 中國](http://www.microsoft.com/zh-cn/) | Yes | N/A +[Microsoft 香港](http://www.microsoft.com/zh-hk/) | Yes | N/A +[Microsoft 台灣](http://www.microsoft.com/zh-tw/) | Yes | N/A +[LeanCloud](https://leancloud.cn/) | Yes | N/A +[知乎](https://www.zhihu.com/) | Yes | 部分用戶達成 +[V2EX](https://www.v2ex.com/) | Yes | Yes +[SegmentFault](https://segmentfault.com/) | Yes | 部分用戶達成 +[Apple4us](http://apple4us.com/) | Yes | N/A +[豌豆荚](https://www.wandoujia.com/) | Yes | N/A +[Ruby China](https://ruby-china.org/) | Yes | 標題達成 +[PHPHub](https://phphub.org/) | Yes | 標題達成 + +## 參考文獻 + +- [Guidelines for Using Capital Letters - About.com](http://grammar.about.com/od/punctuationandmechanics/a/Guidelines-For-Using-Capital-Letters.htm) +- [Letter case - Wikipedia](http://en.wikipedia.org/wiki/Letter_case) +- [Punctuation - Oxford Dictionaries](http://www.oxforddictionaries.com/words/punctuation) +- [Punctuation - The Purdue OWL](https://owl.english.purdue.edu/owl/section/1/6/) +- [How to Use English Punctuation Correctly - wikiHow](http://www.wikihow.com/Use-English-Punctuation-Correctly) +- [格式 - openSUSE](https://zh.opensuse.org/index.php?title=Help:%E6%A0%BC%E5%BC%8F) +- [全形和半形 - 維基百科](http://zh.wikipedia.org/wiki/%E5%85%A8%E5%BD%A2%E5%92%8C%E5%8D%8A%E5%BD%A2) +- [引號 - 維基百科](http://zh.wikipedia.org/wiki/%E5%BC%95%E8%99%9F) +- [疑問驚嘆號 - 維基百科](http://zh.wikipedia.org/wiki/%E7%96%91%E5%95%8F%E9%A9%9A%E5%98%86%E8%99%9F) + +## CopyRight + +[中文文案排版指北](https://github.com/sparanoid/chinese-copywriting-guidelines) From cc8f4d94673467679a743bb9e80af9e59a84105f Mon Sep 17 00:00:00 2001 From: GHLandy Date: Sun, 21 Feb 2016 00:32:19 +0800 Subject: [PATCH 0382/1469] =?UTF-8?q?[=E5=AE=8C=E6=88=90=E7=BF=BB=E8=AF=91?= =?UTF-8?q?]=2020160218=20The=20Best=20Linux=20Distros=20of=202016?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...20160218 The Best Linux Distros of 2016.md | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 translated/tech/20160218 The Best Linux Distros of 2016.md diff --git a/translated/tech/20160218 The Best Linux Distros of 2016.md b/translated/tech/20160218 The Best Linux Distros of 2016.md new file mode 100644 index 0000000000..b0f080a7b6 --- /dev/null +++ b/translated/tech/20160218 The Best Linux Distros of 2016.md @@ -0,0 +1,118 @@ +2016 最佳Linux 发行版 +================================ + +![](http://www.linux.com/images/stories/66866/distro-opensuse.JPG) + +[不管是在企业还是在消费者空间](http://www.cio.com/article/3017983/linux/2015s-most-exciting-linux-devices.html),2015 对于 Linux 来说都是极其重要的一年。作为一个从 2005 年就开始使用 Linux 的老用户,我有幸见证了这个 Linux 过去 10 里的重大发展。[并且,我相信它在 2016 年里会更加令人激动](http://www.cio.com/article/3017177/linux/11-predictions-for-linux-in-2016.html)。在这篇文章里,我会挑选几个将在 2016 年里大放光彩的最佳发行版来介绍个大家。 + +## 最易回归的发行版:openSUSE + +SUSE 是 openSUSE 发行版背后的公司,同时也是起步最早的 Linux 公司;[它在 Linus Torvalds 发布 Linux 的第二年就成立了](http://www.linux.com/news/software/applications/866964-exclusive-interview-with-suse-president-nils-brauckmann)。该公司的成立实际上早于现在的 Linux 公司之王 —— Red Hat。同时 SUSE 也是 [openSUSE](https://www.opensuse.org/) 社区发行版的发起者和赞助商。 + +2015 年,openSUSE 的开发团队决定向 SUSE Linux 企业版 (SLE) 靠拢,以便让用户可以获得企业服务器特性的发行版 —— 类似于 CentOS 和 Ubuntu 那样。因此,openSUSE 变成了 [openSUSE Leap](https://en.opensuse.org/Portal:Leap),一个直接基于 SLE SP1 的发行版。 + +两个发行版共用相同的基础代码,相互受益 —— SUSE 会选用 openSUSE 中好的代码,反之亦然。如此,openSUSE 也放弃了原本常规的发布周期,新版本与 SLE 同步发行。这意味着每个版本将会有更长的生命周期。 + +这样做的结果是,openSUSE 就成了一个非常重要的发行版,因为潜在的 SLE 用户现在可以使用 openSUSE Leap 了。但也并非完全如此,openSUSE 同样也有发行版 [Tumbleweed](http://www.cio.com/article/3008856/open-source-tools/is-opensuse-tumbleweed-good-enough-for-a-seasoned-arch-user.html) —— 一个纯净的滚动式版本。所以,用户们可以选择使用超稳定的 openSUSE Leap 或者经常更新的 openSUSE Tumbleweed。 + +在我的记忆中,还没有其他的发行版做了这样一个令人印象深刻的回归。 + +## 最高可定制性的发行版:Arch Linux + +Arch Linux 是目前最好的滚动式更新的发行版。好吧,我可能有些偏见,因为我是一名 Arch Linux 用户 (GHLandy 译注:本人也是 Arch Linux 用户,它的定制性真的很好)。然而,我认为它好的真正原因是 Arch 在很多其他领域也都表现的非常优越,并且这才是我为什么用它作为主系统的原因。 + +- 对于那些想要学习 Linux 方方面面的用户来说,[Arch Linux](https://www.archlinux.org/) 无疑是一个绝佳的选择。因为你需要手动安装所有自己需要的东西,这样你会慢慢学到 Linux 系统的所有细节。 + +- Arch 是一个可高度定制发行版。任何桌面环境 (DE) 都没有了 “Arch” 的原味。你能够得到的只是一个基础系统,然后你可以在上边构建你所想要的发行版。无论好坏,也不想 openSUSE 或者 Ubuntu 那样,Arch 没有额外的补丁或者集成环境。你得到的基本就是上游开发者所创建的原始软件。 + +- Arch Linux 同时也是最好的滚动式更新的发行版之一。它需要经常保持着更新。用户所运行的基本上是最新的软件,当然,也可以通过非稳定仓库运行预发行版的软件。 + +- Arch 闻名于拥有为数众多的优秀文档。Arch Wiki 是我用以了解所有 Linux 相关事情的外带资源。 + +- Arch 中,我最喜欢的是,它提供了“任何” 其他发行版中可用的的包和软件,同时还要感谢 AUR (Arch User Repository,Arch 用户仓库)。 + +## 最美观的发行版:elementary OS + +不同的发行版会有不同的关注点 —— 多数情况下表现为不同的技术。在大多数的 Linux 发行版中,外观和用户感觉并非他们优先考虑的事情 —— 这通常是桌面环境需要考虑的事情。 + +[elementary OS](https://elementary.io/) 正在尝试改变这一事实。在这个发行版中,设计是占据重要位置,并且原因明显 —— 为该发行版取这个名字的开发者要在 Linux 世界里创建一些漂亮的图标。 + +elementary OS 相当注重整体外观和用户感觉。开发者创建了他们自己的组件,包括桌面环境。此外,他们只会选择那些符合设计规范的应用来加入到软件仓库。你可以发现 elementary OS 有很浓重的 Mac OS X 气息。 + +## 最好的新晋发行版:Solus + +![](http://www.linux.com/images/stories/66866/distro-solus.JPG) + +[Solus](https://solus-project.com/) 最近获得非常大的关注程度。它是一个外观还可以、从零开始构建的操作系统,而并非 Debian 或者 Ubuntu 的衍生版本。它使用的 Budgie 桌面环境同样是从零开始构建的,但它的目标是兼容 Gnome。Solus 和 Google 的 Chrome OS 一样 —— 一切从简。 + +我个人没怎么玩过 Solus,但它看起来很有前途。Solus 实际上并不是一个 “新” 系统。它曾以不同的形式和名称存在来很长时间,但直到 2015 年整个项目才现在这个新名称重归大众视野。 + +## 最好的云操作系统:Chrome OS + +[Chrome OS](https://www.chromium.org/chromium-os) 可能不会成为你的典型 Linux 发行版,毕竟它是基于浏览器的操作系统,主要用以在线活动。但由于基于 Linux 以及任何可以获取其源码进行编译,它同样是一个吸引人的系统。同时我也每天使用 Chrome OS,它是一个优秀、不用自己维护并且总是最新状态的系统,每个人都可以单纯用它来进行 web 相关的活动。Chrome OS 和 Android 对于推动 Linux 在 PC 市场和移动市场的占有率有着不可或缺的功劳。 + +## 最好的笔记本操作系统:Ubuntu MATE + +大多数的笔记本都没有高端的硬件,假如你运行了一个很耗费资源的桌面环境,那么你可能没有足够的系统资源或电量来维持你的基本使用 —— 因为基本上被系统自身消耗了。于是我找到了 [Ubuntu MATE](http://www.cio.com/article/2848475/ubuntu-mate-enterprise-customers.html) 这个优秀的系统。它是轻量级的环境,但提供了能让你拥有不错体验的所有软件。也幸好它的轻量级设计,大部分的系统资源都留来给你的软件使用,让你依旧可以完成一些繁重的任务。我还发现,它对于一些低端的硬件也同样有很好的支持。 + +## 为老旧硬件支持而生的发行版:Lubuntu + +假如你身边拥有一些过时的笔记本或 PC,给它安装 [Lubuntu](http://lubuntu.net/) 来获得重生吧。Lubuntu 使用的是 LXDE 桌面环境,但该项目与 Razor Qt 合并之后,变成了 LXQt。尽管最新的版本 15.04 依旧使用 LXDE,但之后的版本将会使用 LXQt。Lubuntu 对于老旧硬件来说是最合适不过的系统来。 + +## 为物联网 (IoT) 而生的发行版:Snappy Ubuntu Core + +![](http://www.linux.com/images/stories/66866/distro-ubuntu-studio.JPG) + +Snappy Ubuntu Core 为物联网 (IoT) 及此类设备而生的 Linux 操作系统。该系统拥有巨大潜力,它可以将我们身边绝大多数的东西 —— 如路由器、咖啡机和玩具飞机等 —— 变成智能设备。让它更有趣的是,软件管理更新的方式以及添加安全性能的模块。 + +## 为桌面系统而生的发行版:Linux Mint Cinnamon + +[Linux Mint Cinnamon](http://www.linux.com/news/software/applications/838569-review-linux-mint-172-release/) 对于台式机和一些有强大硬件的笔记本来说是最好的操作系统。并且我会尽量把它叫做 Linux 世界里的 Mac OS X。老实说,由于 Cinnamon 的不稳定,我在很长一段时间内并不是 Linux Mint 的忠实粉丝。但是,在开发者使用 LTS (Long Term Support,长期支持)作为基础之后,该发行版就变得难以想象的稳定。因为开发者花费经历来跟上 Ubuntu 的开发进度,他们现在可以将所有精力放到把 Cinnamon 做的更好上边来了。 + +## 为游戏而生的发行版:Steam OS + +对于桌面版 Linux 来说,玩游戏同样是短板。很多用户为了能够玩游戏,安装了 Linux 和 Windows 双系统。而 Valve 则尝试改变这个局面。Valve 是一个游戏发行商,它提供一个可以跨平台运行游戏的客户端。并且,Valve 也同样创建来它自己的开源操作系统 —— [Steam OS](http://store.steampowered.com/steamos/) —— 为了创建一个基于 Linux 的游戏平台。截至 2015 年底,它的合作伙伴开始把搭载来 Steam OS 的机子推向市场。 + +## 为隐私而生的发行版:Tails + +在充斥着大量监控和营销者的跟踪 (为目标内容进行的匿名跟踪通常是可接受的),隐私就变成主要问题。如果你向脱离政府或者市场机构的监控和跟踪范围,那么你需要一款始终考虑到隐私问题的操作系统。 + +在出于保护隐私的考虑上,没有任何一款系统可以超越 [Tails](https://tails.boum.org/)。它以基于 Debian 的发行版,在设计之初就考虑了隐私和匿名的支持。Tails 非常优秀,而且据报道说,NSA 认为这是对他们的监控的主要威胁之一。 + +## 为多媒体制作而生的发行版:Ubuntu Studio + +基于 Linux 的操作系统有一个明显的弱点,那就是对多媒体制作的支持并不友好。所有在的专业级应用基本只能运行在 Windows 或者 Mac OS X 上。Linux 系统从来都不缺乏像样的音频/视频制作软件,但这样还是远远不够的。应该要有一款轻量级的桌面环境,使得那些宝贵的系统资源 —— 如 CPU 和 RAM —— 尽量少占用,以便用于多媒体制作。目前,[Ubuntu Studio](https://ubuntustudio.org/tour/) 对多媒体制作的支持最好。它使用了 Xfce 桌面环境,并且有应用广泛的音频、视频以及图像编辑应用。 + +## 最好的企业发行版:SLE/RHEL + +企业级用户并不会通过浏览想这样的文章来了解他们的服务器该运行什么发行版。他们通常非常明确该到哪里获取信息:即 [Red Hat Enterprise Linux](https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux) 或 [SUSE Linux Enterprise](https://www.suse.com/)。这两个名字已经成了企业服务器的代名词了。同时,它们背后的公司也都通过创新来推动一切皆容器并且可以进行软件定义。 + +## 最好的服务器操作系统:Debian/CentOS + +假如你在考虑自己运行一台服务器,但有不希望支付 RHEL 或者 SLE 授权的费用,那么 [Debian](https://www.debian.org/) 或者 [CentOS](https://www.centos.org/) 将是你最好的选择。这两个发行版在社区发行版服务器操作系统有着不可动摇的位置。并且它们有着很长的支持期,从而你不必担忧需要经常去上级系统。 + +## 最好的移动操作系统:Plasma Mobile + +尽管,基于 Linux 的 Android 系统称雄于移动操作系统市场,但是大多数的开源社区 —— 也包括我在内 —— 也仍然强烈希望能有一个发行版能够为移动设备提供传统 Linux 的桌面应用。同时,这样的一个发行版由开源社区来维护会比由商业公司来维护好的多,只有这样用户群才能才能成为这个发行版的焦点,而不应该有公司的商业目标决定这个发行版的发展趋势。而 KDE 的 [Plasma Mobile](https://community.kde.org/Plasma/Mobile) 刚好实现来我们的愿望。 + +这个 基于 Kubuntu 的发行版始于 2015 年。因为 KDE 社区以坚守标准和为公众开发应用而闻名,我非常期待 Plasma Mobile 能够一直坚持下去。 + +## 为 ARM 设备而生的发行版:Arch Linux ARM + +随着 Android 系统的成功,我们的生活也围绕者越来越多的 ARM 设备 —— 从树梅派 (Raspberry Pi) 到 Chromebook 以及 Nvidia Shield。为 Intel/AMD 架构的 CPU 而编写的传统发行版并不能够在这些 ARM 架构的设备上运行。而一些为 ARM 而编写的发行版却仅仅只能在特定的硬件上运行,比如只能运行在树梅派 (Raspberry Pi) 上的 Raspbian 系统。[Arch Linux ARM](http://archlinuxarm.org/) (ALARM) 的闪光点在于:它是一个基于 Arch Linux 的纯社区支持的发行版,可以在树梅派 (Raspberry Pi)、Chromebook、Android 设备以及 Nvidia Shield 等设备上运行。同时,也由于有了 AUR,该发行版变得更加有趣,你可以安装很多在其他发行版可能无法获取的软件。 + +## 结论 + +在我写完本文的时候,连我自己都震惊了。能够在 Linux 的世界里为大家写点东西真的是很令人激动。不必去管 Linux 统治桌面电脑的时代是否会到来,我们都要一样享受自己使用 Linux 的每一刻快乐时光。 + +------------------------------------------------------------------------------ + +via: http://www.linux.com/news/software/applications/878620-the-best-linux-distros-of-2016 + +作者:[Swapnil Bhartiya][a] +译者:[GHLandy](https://github.com/GHLandy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linux.com/community/forums/person/61003 From 9870239927f18c8e36a0ef4fb5c8da4ad977268d Mon Sep 17 00:00:00 2001 From: GHLandy Date: Sun, 21 Feb 2016 00:34:51 +0800 Subject: [PATCH 0383/1469] =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=8B=B1=E6=96=87?= =?UTF-8?q?=E5=8E=9F=E6=96=87=EF=BC=8C=E8=AF=91=E6=96=87=E5=B7=B2=E7=BB=8F?= =?UTF-8?q?=E6=94=BE=E5=9C=A8=E5=AF=B9=E5=BA=94=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...20160218 The Best Linux Distros of 2016.md | 120 ------------------ 1 file changed, 120 deletions(-) delete mode 100644 sources/tech/20160218 The Best Linux Distros of 2016.md diff --git a/sources/tech/20160218 The Best Linux Distros of 2016.md b/sources/tech/20160218 The Best Linux Distros of 2016.md deleted file mode 100644 index fa9a6b6ffa..0000000000 --- a/sources/tech/20160218 The Best Linux Distros of 2016.md +++ /dev/null @@ -1,120 +0,0 @@ -GHLandy Translating - -The Best Linux Distros of 2016 -================================ - -![](http://www.linux.com/images/stories/66866/distro-opensuse.JPG) - -2015 was a very important year for Linux, [both in the enterprise as well as in the consumer space](http://www.cio.com/article/3017983/linux/2015s-most-exciting-linux-devices.html). As a Linux user since 2005, I can see that the operating system has come a long way in the past 10 years. [And, 2016 is going to be even more exciting](http://www.cio.com/article/3017177/linux/11-predictions-for-linux-in-2016.html). In this article, I have picked some of the best distros that will shine in 2016. - -## Best Comeback Distro: openSUSE - -SUSE, the company behind openSUSE, is the oldest Linux company; [it was formed just a year after Linus Torvalds announced Linux](http://www.linux.com/news/software/applications/866964-exclusive-interview-with-suse-president-nils-brauckmann). The company actually predates Linux king Red Hat. SUSE is also the sponsor of the community-based distro [openSUSE](https://www.opensuse.org/). - -In 2015, openSUSE teams decided to come closer to SUSE Linux Enterprise (SLE) so that users could have a distribution that shares its DNA with the enterprise server -- similar to CentOS and Ubuntu. Thus, openSUSE became [openSUSE Leap](https://en.opensuse.org/Portal:Leap), a distribution that’s directly based on SLE SP (service pack) 1. - -The two distros will share the code base to benefit each other -- SUSE will take what’s good in openSUSE and vice versa. With this move, openSUSE is also ditching the regular release cycle, and a new version will be released in sync with SLE. That means each version will have a much longer life cycle. - -As a result of this move, openSUSE has become a very important distribution because potential SLE users can now use openSUSE Leap. That’s not all, however; openSUSE also announced the release of [Tumbleweed](http://www.cio.com/article/3008856/open-source-tools/is-opensuse-tumbleweed-good-enough-for-a-seasoned-arch-user.html), a pure rolling-release version. So, now, users can use either the super-stable openSUSE Leap or the always up-to-date openSUSE Tumbleweed. - -No other distro has made such an impressive comeback in my memory. - -Most Customizable Distro: Arch Linux - -Arch Linux is the best rolling-release distribution out there. Period. Ok, I could be biased because I am an Arch Linux user. However, the reason behind my claim is that Arch excels in many other areas, too, and that’s why I use it as my main operating system. - -[Arch Linux](https://www.archlinux.org/) is a great distro for those who want to learn everything about Linux. Because you have to install everything manually, you learn all the bits and pieces of a Linux-based operating system. - -- Arch is the most customizable distribution. There is no “Arch” flavor of any DE. All you get is a foundation and you can build whatever distro want, on top of it. For good or for worse, unlike openSUSE or Ubuntu there is no extra patching or integration. You get what upstream developers created. Period. - -- Arch Linux is also one of the best rolling releases. It’s always updated. Users always run the latest packages, and they can also run pre-released software through unstable repositories. - -- Arch is also known for having excellent documentation. Arch Wiki is my to-go resource for everything Linux related. - -- What I like the most about Arch is that is offers almost every package and software that’s available for “any” Linux distribution, thanks to the Arch User Repository, aka AUR. - -## Best-Looking Distro: elementary OS - -Different Linux distributions have different focus areas -- in most cases, these are technical differences. In many Linux distributions. the look and feel is an afterthought -- a side project at the mercy of the specific desktop environment. - -[elementary OS](https://elementary.io/) is trying to change all that. Here, design is at the forefront, and the reason is quite obvious. The distro is being developed by designers who have made their name in the Linux world by creating beautiful icons. - -elementary OS is quite strict about the holistic look and feel. The developers have created their own components, including the desktop environment. Additionally, they choose only those applications that fit into the design paradigm. One can find heavy influence of Mac OS X on elementary OS. - -## Best Newcomer: Solus - -![](http://www.linux.com/images/stories/66866/distro-solus.JPG) - -[Solus](https://solus-project.com/) operating system has garnered quite a lot of attention lately. It’s a decent-looking operating system that has been created from scratch. It’s not a derivative of Debian or Ubuntu. It comes with the Budgie desktop environment, which was built from scratch but aims to integrate with Gnome. Solus has the same minimalistic approach as Google’s Chrome OS. - -I have not played with Solus much, but it does look promising. Solus is actually not a “new” OS. It has been around for a while in different forms and names. But the entire project was revived back in 2015 under this new name. - -## Best Cloud OS: Chrome OS - -[Chrome OS](https://www.chromium.org/chromium-os) may not be your typical Linux-based distribution because it’s a browser-based operating system for online activities. However, because it’s based on Linux and its source code is available for anyone to compile, it’s an attractive OS. I use Chrome OS on a daily basis. It’s an excellent, maintenance-free, always updated OS for anyone using a computer purely for web-related activities. Chrome OS, along with Android, deserves all the credit for making Linux popular in the PC and mobile space. - -## Best Laptop OS: Ubuntu MATE - -Most laptops don’t have very high-end hardware, and if you are running a really resource-intensive desktop environment then you won’t have much system resources or battery life at your disposal -- they will be used by the OS itself. That’s where I found [Ubuntu MATE](http://www.cio.com/article/2848475/ubuntu-mate-enterprise-customers.html) to be an excellent operating system. It’s lightweight, yet has all the bells and whistles needed for a pleasant experience. Thanks to its lightweight design, the majority of system resources are free for applications so you can still do some heavy work on it. I also found it to be a great distro on really low-end systems. - -## Best Distro for Old Hardware: Lubuntu - -If you have an old laptop or PC sitting around, breathe new life into it with [Lubuntu](http://lubuntu.net/). Lubuntu uses LXDE, but the project has merged with Razor Qt to create LXQt. Although the latest release 15.04 is still using LXDE, the future versions will be using LXQt. Lubuntu is a decent operating system for old hardware. - -## Best Distro for IoT: Snappy Ubuntu Core - -![](http://www.linux.com/images/stories/66866/distro-ubuntu-studio.JPG) - -Snappy Ubuntu Core is the best Linux-based operating system out there for Internet of Things (IoT) and other such devices. The operating system holds great potential to turn almost everything around us into smart devices -- such as routers, coffeemakers, drones, etc. What makes it even more interesting is the way the software manages updates and offers containerization for added security. - -## Best Distro for Desktops: Linux Mint Cinnamon - -[Linux Mint Cinnamon](http://www.linux.com/news/software/applications/838569-review-linux-mint-172-release/) is the best operating system for desktops and powerful laptops. I will go as far as calling it the Mac OS X of the Linux world. Honestly, I had not been a huge fan of Linux Mint for a long time because of unstable Cinnamon. But, as soon as the developers chose to use LTS as the base, the distro has become incredibly stable. Because the developers don’t have to spend much time worrying about keeping up with Ubuntu, they are now investing all of their time in making Cinnamon better. - -## Best Distro for Games: Steam OS - -Gaming has been a weakness of desktop Linux. Many users dual-boot with Windows just to be able to play games. Valve Software is trying to change that. Valve is a game distributor that offers a client to run games on different platforms. And, Valve has now created their open operating system -- [Steam OS](http://store.steampowered.com/steamos/) -- to create a Linux-based gaming platform. By the end of 2015, partners started shipping Steam machines to the market. - -## Best Distro for Privacy: Tails - -In this age of mass surveillance and tracking by marketers (anonymous tracking for targeted content is acceptable), privacy has become a major issue. If you are someone who needs to keep the government and marketing agencies out of your business, you need an operating system that’s created -- from the ground up -- with privacy in mind. - -And, nothing beats [Tails](https://tails.boum.org/) for this purpose. It’s a Debian-based distribution that offers privacy and anonymity by design. Tails is so good that, according to reports, the NSA considers it a major threat to their mission. - -## Best Distro for Multimedia Production: Ubuntu Studio - -Multimedia production is one of the major weaknesses of Linux-based operating systems. All the professional-grade applications are available for either Windows or Mac OS X. There is no dearth of decent audio/video production software for Linux, but a multimedia production system needs more than just decent applications. It should use a lightweight desktop environment so that precious system resources -- such as CPU and RAM -- are used sparingly by the system itself, leaving them for the multimedia applications. And, the best Linux distribution for multimedia production is [Ubuntu Studio](https://ubuntustudio.org/tour/). It uses Xfce and comes with a broad range of audio, video, and image editing applications. - -## Best Enterprise Distro: SLE/RHEL - -Enterprise customers don’t look for articles like these to choose a distribution to run on their servers. They already know where to go: It’s either [Red Hat Enterprise Linux](https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux) or [SUSE Linux Enterprise](https://www.suse.com/). These two names have become synonymous with enterprise servers. These companies are also pushing boundaries by innovating in this changing landscape where everything is containerized and becoming software defined. - -## Best Server OS: Debian/CentOS - -If you are looking at running a server, but you can’t afford or don’t want to pay a subscription fee for RHEL or SLE, then there is nothing better than [Debian](https://www.debian.org/) or [CentOS](https://www.centos.org/). These distributions are the gold standard when it comes to community-based servers. And, they are supported for a very long time, so you won’t have to worry about upgrading your system so often. - -## Best Mobile OS: Plasma Mobile - -Although the Linux-based distribution Android is ruling the roost, many in the open source community, including me, still desire a distribution that offers traditional Linux desktop apps on mobile devices. At the same time, it’s better if the distro is run by a community instead of a company so that a user remains in the focus and not the company’s financial goals. And that’s where KDE’s [Plasma Mobile](https://community.kde.org/Plasma/Mobile) brings some hope. - -This Kubuntu-based distribution was launched in 2015. Because the KDE community is known for their adherence to standards and developing stuff in public, I am quite excited about the future of Plasma Mobile. - -## Best Distro for ARM Devices: Arch Linux ARM - -With the success of Android, we are now surrounded by ARM-powered devices -- from Raspberry Pi to Chromebook and Nvidia Shield. The traditional distros written for Intel/AMD processors won’t run on these systems. Some distributions are aimed at ARM, but they are mostly for specific hardware only, such as Raspbian for Raspberry Pi. That’s where [Arch Linux ARM](http://archlinuxarm.org/) (ALARM) shines. It’s a purely community-based distribution that’s based on Arch Linux. You can run it on Raspberry Pi, Chromebooks, Android devices, Nvidia Shield, and what not. What makes this distribution even more interesting is that, thanks to the Arch User Repository (AUR), you can install many applications than you may not get on other distributions. - -## Conclusion - -I was astonished and amazed when I worked on this story. It’s very exciting to see that there is something for everyone in the Linux world. It doesn’t matter if the year of the desktop Linux never arrives. We are happy with our Linux moments! - ------------------------------------------------------------------------------- - -via: http://www.linux.com/news/software/applications/878620-the-best-linux-distros-of-2016 - -作者:[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 From 0bf780e222e649fe3b499313cc074850f07b57ab Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 21 Feb 2016 14:26:56 +0800 Subject: [PATCH 0384/1469] translating --- ...218 How to Set Nginx as Reverse Proxy on Centos7 CPanel.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20160218 How to Set Nginx as Reverse Proxy on Centos7 CPanel.md b/sources/tech/20160218 How to Set Nginx as Reverse Proxy on Centos7 CPanel.md index e3cc72cd8d..393ff4b878 100644 --- a/sources/tech/20160218 How to Set Nginx as Reverse Proxy on Centos7 CPanel.md +++ b/sources/tech/20160218 How to Set Nginx as Reverse Proxy on Centos7 CPanel.md @@ -1,3 +1,5 @@ +translating----geekpi + How to Set Nginx as Reverse Proxy on Centos7 CPanel ================================================================================ @@ -198,4 +200,4 @@ via: http://linoxide.com/linux-how-to/set-nginx-reverse-proxy-centos-7-cpanel/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://linoxide.com/author/saheethas/ \ No newline at end of file +[a]:http://linoxide.com/author/saheethas/ From 60edea5ac41b7f818baa3ed4ce163a7bdee44171 Mon Sep 17 00:00:00 2001 From: mudongliang Date: Sun, 21 Feb 2016 14:30:16 +0800 Subject: [PATCH 0385/1469] Validation --- ...20160218 The Best Linux Distros of 2016.md | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/translated/tech/20160218 The Best Linux Distros of 2016.md b/translated/tech/20160218 The Best Linux Distros of 2016.md index b0f080a7b6..fdb7cd02b0 100644 --- a/translated/tech/20160218 The Best Linux Distros of 2016.md +++ b/translated/tech/20160218 The Best Linux Distros of 2016.md @@ -3,7 +3,7 @@ ![](http://www.linux.com/images/stories/66866/distro-opensuse.JPG) -[不管是在企业还是在消费者空间](http://www.cio.com/article/3017983/linux/2015s-most-exciting-linux-devices.html),2015 对于 Linux 来说都是极其重要的一年。作为一个从 2005 年就开始使用 Linux 的老用户,我有幸见证了这个 Linux 过去 10 里的重大发展。[并且,我相信它在 2016 年里会更加令人激动](http://www.cio.com/article/3017177/linux/11-predictions-for-linux-in-2016.html)。在这篇文章里,我会挑选几个将在 2016 年里大放光彩的最佳发行版来介绍个大家。 +[不管是在企业还是在消费者空间](http://www.cio.com/article/3017983/linux/2015s-most-exciting-linux-devices.html),2015 对于 Linux 来说都是极其重要的一年。作为一个从 2005 年就开始使用 Linux 的老用户,我有幸见证了 Linux 过去这 10 年里的重大发展,[并且,我相信它在 2016 年里会更加令人激动](http://www.cio.com/article/3017177/linux/11-predictions-for-linux-in-2016.html)。在这篇文章里,我会挑选几个将在 2016 年里大放光彩的最佳发行版给大家介绍一下。 ## 最易回归的发行版:openSUSE @@ -23,13 +23,13 @@ Arch Linux 是目前最好的滚动式更新的发行版。好吧,我可能有 - 对于那些想要学习 Linux 方方面面的用户来说,[Arch Linux](https://www.archlinux.org/) 无疑是一个绝佳的选择。因为你需要手动安装所有自己需要的东西,这样你会慢慢学到 Linux 系统的所有细节。 -- Arch 是一个可高度定制发行版。任何桌面环境 (DE) 都没有了 “Arch” 的原味。你能够得到的只是一个基础系统,然后你可以在上边构建你所想要的发行版。无论好坏,也不想 openSUSE 或者 Ubuntu 那样,Arch 没有额外的补丁或者集成环境。你得到的基本就是上游开发者所创建的原始软件。 +- Arch 是一个可高度定制发行版。任何桌面环境 (DE) 都没有了 “Arch” 的原味。你能够得到的只是一个基础系统,然后你可以在上边构建你所想要的发行版。无论好坏,也不像 openSUSE 或者 Ubuntu 那样,Arch 没有额外的补丁或者集成环境。你得到的基本就是上游开发者所创建的原始软件。 - Arch Linux 同时也是最好的滚动式更新的发行版之一。它需要经常保持着更新。用户所运行的基本上是最新的软件,当然,也可以通过非稳定仓库运行预发行版的软件。 - Arch 闻名于拥有为数众多的优秀文档。Arch Wiki 是我用以了解所有 Linux 相关事情的外带资源。 -- Arch 中,我最喜欢的是,它提供了“任何” 其他发行版中可用的的包和软件,同时还要感谢 AUR (Arch User Repository,Arch 用户仓库)。 +- Arch 中,我最喜欢的是,它提供了“任何”其他发行版中可用的的包和软件,同时还要感谢 AUR (Arch User Repository,Arch 用户仓库)。 ## 最美观的发行版:elementary OS @@ -45,11 +45,11 @@ elementary OS 相当注重整体外观和用户感觉。开发者创建了他们 [Solus](https://solus-project.com/) 最近获得非常大的关注程度。它是一个外观还可以、从零开始构建的操作系统,而并非 Debian 或者 Ubuntu 的衍生版本。它使用的 Budgie 桌面环境同样是从零开始构建的,但它的目标是兼容 Gnome。Solus 和 Google 的 Chrome OS 一样 —— 一切从简。 -我个人没怎么玩过 Solus,但它看起来很有前途。Solus 实际上并不是一个 “新” 系统。它曾以不同的形式和名称存在来很长时间,但直到 2015 年整个项目才现在这个新名称重归大众视野。 +我个人没怎么玩过 Solus,但它看起来很有前途。Solus 实际上并不是一个 “新” 系统。它曾以不同的形式和名称存在了很长时间,但直到 2015 年整个项目才以现在这个新名称重归大众视野。 ## 最好的云操作系统:Chrome OS -[Chrome OS](https://www.chromium.org/chromium-os) 可能不会成为你的典型 Linux 发行版,毕竟它是基于浏览器的操作系统,主要用以在线活动。但由于基于 Linux 以及任何可以获取其源码进行编译,它同样是一个吸引人的系统。同时我也每天使用 Chrome OS,它是一个优秀、不用自己维护并且总是最新状态的系统,每个人都可以单纯用它来进行 web 相关的活动。Chrome OS 和 Android 对于推动 Linux 在 PC 市场和移动市场的占有率有着不可或缺的功劳。 +[Chrome OS](https://www.chromium.org/chromium-os) 可能不会成为你的典型 Linux 发行版,毕竟它是基于浏览器的操作系统,主要用以在线活动。但由于它基于 Linux 以及任何人都可以获取其源码进行编译,它同样是一个吸引人的系统。同时我也每天使用 Chrome OS,它是一个优秀、不用自己维护并且总是最新状态的系统,每个人都可以单纯用它来进行 web 相关的活动。Chrome OS 和 Android 对于推动 Linux 在 PC 市场和移动市场的占有率有着不可或缺的功劳。 ## 最好的笔记本操作系统:Ubuntu MATE @@ -57,7 +57,7 @@ elementary OS 相当注重整体外观和用户感觉。开发者创建了他们 ## 为老旧硬件支持而生的发行版:Lubuntu -假如你身边拥有一些过时的笔记本或 PC,给它安装 [Lubuntu](http://lubuntu.net/) 来获得重生吧。Lubuntu 使用的是 LXDE 桌面环境,但该项目与 Razor Qt 合并之后,变成了 LXQt。尽管最新的版本 15.04 依旧使用 LXDE,但之后的版本将会使用 LXQt。Lubuntu 对于老旧硬件来说是最合适不过的系统来。 +假如你身边拥有一些过时的笔记本或 PC,给它安装 [Lubuntu](http://lubuntu.net/) 来获得重生吧。Lubuntu 使用的是 LXDE 桌面环境,但该项目与 Razor Qt 合并之后,变成了 LXQt。尽管最新的版本 15.04 依旧使用 LXDE,但之后的版本将会使用 LXQt。Lubuntu 对于老旧硬件来说是最合适不过的系统了。 ## 为物联网 (IoT) 而生的发行版:Snappy Ubuntu Core @@ -67,39 +67,39 @@ Snappy Ubuntu Core 为物联网 (IoT) 及此类设备而生的 Linux 操作系 ## 为桌面系统而生的发行版:Linux Mint Cinnamon -[Linux Mint Cinnamon](http://www.linux.com/news/software/applications/838569-review-linux-mint-172-release/) 对于台式机和一些有强大硬件的笔记本来说是最好的操作系统。并且我会尽量把它叫做 Linux 世界里的 Mac OS X。老实说,由于 Cinnamon 的不稳定,我在很长一段时间内并不是 Linux Mint 的忠实粉丝。但是,在开发者使用 LTS (Long Term Support,长期支持)作为基础之后,该发行版就变得难以想象的稳定。因为开发者花费经历来跟上 Ubuntu 的开发进度,他们现在可以将所有精力放到把 Cinnamon 做的更好上边来了。 +[Linux Mint Cinnamon](http://www.linux.com/news/software/applications/838569-review-linux-mint-172-release/) 对于台式机和一些有强大硬件的笔记本来说是最好的操作系统。我会尽量把它叫做 Linux 世界里的 Mac OS X。老实说,由于 Cinnamon 的不稳定,我在很长一段时间内并不是 Linux Mint 的忠实粉丝。但是,在开发者使用 LTS (Long Term Support,长期支持)作为基础之后,该发行版就变得难以想象的稳定。因为开发者不必花费经历来跟上 Ubuntu 的开发进度,他们现在可以将所有精力放到提升 Cinnamon 上。 ## 为游戏而生的发行版:Steam OS -对于桌面版 Linux 来说,玩游戏同样是短板。很多用户为了能够玩游戏,安装了 Linux 和 Windows 双系统。而 Valve 则尝试改变这个局面。Valve 是一个游戏发行商,它提供一个可以跨平台运行游戏的客户端。并且,Valve 也同样创建来它自己的开源操作系统 —— [Steam OS](http://store.steampowered.com/steamos/) —— 为了创建一个基于 Linux 的游戏平台。截至 2015 年底,它的合作伙伴开始把搭载来 Steam OS 的机子推向市场。 +对于桌面版 Linux 来说,玩游戏同样是短板。很多用户为了能够玩游戏,安装了 Linux 和 Windows 双系统。而 Valve 则尝试改变这个局面。Valve 是一个游戏发行商,它提供一个可以跨平台运行游戏的客户端。并且,Valve 也同样创建了它自己的开源操作系统 —— [Steam OS](http://store.steampowered.com/steamos/) —— 为了创建一个基于 Linux 的游戏平台。截至 2015 年底,它的合作伙伴开始把搭载了 Steam OS 的机器推向市场。 ## 为隐私而生的发行版:Tails -在充斥着大量监控和营销者的跟踪 (为目标内容进行的匿名跟踪通常是可接受的),隐私就变成主要问题。如果你向脱离政府或者市场机构的监控和跟踪范围,那么你需要一款始终考虑到隐私问题的操作系统。 +在充斥着大量监控和营销者的跟踪 (为目标内容进行的匿名跟踪通常是可接受的)的岁月,隐私就变成主要问题。如果你想脱离政府或者市场机构的监控和跟踪范围,那么你需要一款始终考虑到隐私问题的操作系统。 -在出于保护隐私的考虑上,没有任何一款系统可以超越 [Tails](https://tails.boum.org/)。它以基于 Debian 的发行版,在设计之初就考虑了隐私和匿名的支持。Tails 非常优秀,而且据报道说,NSA 认为这是对他们的监控的主要威胁之一。 +在出于保护隐私的考虑上,没有任何一款系统可以超越 [Tails](https://tails.boum.org/)。它是一款基于 Debian 的发行版,并且在设计之初就考虑了隐私和匿名的支持。Tails 非常优秀,而且据报道说,NSA 认为这是对他们的监控的主要威胁之一。 ## 为多媒体制作而生的发行版:Ubuntu Studio -基于 Linux 的操作系统有一个明显的弱点,那就是对多媒体制作的支持并不友好。所有在的专业级应用基本只能运行在 Windows 或者 Mac OS X 上。Linux 系统从来都不缺乏像样的音频/视频制作软件,但这样还是远远不够的。应该要有一款轻量级的桌面环境,使得那些宝贵的系统资源 —— 如 CPU 和 RAM —— 尽量少占用,以便用于多媒体制作。目前,[Ubuntu Studio](https://ubuntustudio.org/tour/) 对多媒体制作的支持最好。它使用了 Xfce 桌面环境,并且有应用广泛的音频、视频以及图像编辑应用。 +基于 Linux 的操作系统有一个明显的弱点,那就是对多媒体制作的支持并不友好。所有专业级应用基本只能运行在 Windows 或者 Mac OS X 上。Linux 系统从来都不缺乏像样的音频/视频制作软件,但这样还是远远不够的。应该要有一款轻量级的桌面环境,使得那些宝贵的系统资源 —— 如 CPU 和 RAM —— 尽量少占用,以便用于多媒体制作。目前,[Ubuntu Studio](https://ubuntustudio.org/tour/) 对多媒体制作的支持最好。它使用了 Xfce 桌面环境,并且有各种各样的音频、视频以及图像编辑应用。 ## 最好的企业发行版:SLE/RHEL -企业级用户并不会通过浏览想这样的文章来了解他们的服务器该运行什么发行版。他们通常非常明确该到哪里获取信息:即 [Red Hat Enterprise Linux](https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux) 或 [SUSE Linux Enterprise](https://www.suse.com/)。这两个名字已经成了企业服务器的代名词了。同时,它们背后的公司也都通过创新来推动一切皆容器并且可以进行软件定义。 +企业级用户并不会通过浏览像这样的文章来了解他们的服务器该运行什么发行版。他们通常非常明确该到哪里获取信息:即 [Red Hat Enterprise Linux](https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux) 或 [SUSE Linux Enterprise](https://www.suse.com/)。这两个名字已经成了企业服务器的代名词了。同时,它们背后的公司也都通过创新来推动一切皆容器并且可以进行软件定义。 ## 最好的服务器操作系统:Debian/CentOS -假如你在考虑自己运行一台服务器,但有不希望支付 RHEL 或者 SLE 授权的费用,那么 [Debian](https://www.debian.org/) 或者 [CentOS](https://www.centos.org/) 将是你最好的选择。这两个发行版在社区发行版服务器操作系统有着不可动摇的位置。并且它们有着很长的支持期,从而你不必担忧需要经常去上级系统。 +假如你在考虑自己运行一台服务器,但有不希望支付 RHEL 或者 SLE 授权的费用,那么 [Debian](https://www.debian.org/) 或者 [CentOS](https://www.centos.org/) 将是你最好的选择。这两个发行版在社区发行版服务器操作系统有着不可动摇的地位。并且它们有着长期支持,你不必担忧需要经常去升级系统。 ## 最好的移动操作系统:Plasma Mobile -尽管,基于 Linux 的 Android 系统称雄于移动操作系统市场,但是大多数的开源社区 —— 也包括我在内 —— 也仍然强烈希望能有一个发行版能够为移动设备提供传统 Linux 的桌面应用。同时,这样的一个发行版由开源社区来维护会比由商业公司来维护好的多,只有这样用户群才能才能成为这个发行版的焦点,而不应该有公司的商业目标决定这个发行版的发展趋势。而 KDE 的 [Plasma Mobile](https://community.kde.org/Plasma/Mobile) 刚好实现来我们的愿望。 +尽管,基于 Linux 的 Android 系统称雄于移动操作系统市场,但是大多数的开源社区 —— 也包括我在内 —— 也仍然强烈希望能有一个发行版能够为移动设备提供传统 Linux 的桌面应用。同时,这样的一个发行版由开源社区来维护会比由商业公司来维护好的多,只有这样用户群才能成为这个发行版的焦点,而不应该由公司的商业目标来决定这个发行版的发展趋势。而 KDE 的 [Plasma Mobile](https://community.kde.org/Plasma/Mobile) 刚好实现了我们的愿望。 -这个 基于 Kubuntu 的发行版始于 2015 年。因为 KDE 社区以坚守标准和为公众开发应用而闻名,我非常期待 Plasma Mobile 能够一直坚持下去。 +这个基于 Kubuntu 的发行版始于 2015 年。因为 KDE 社区以坚守标准和为公众开发应用而闻名,我非常期待 Plasma Mobile 能够一直坚持下去。 ## 为 ARM 设备而生的发行版:Arch Linux ARM -随着 Android 系统的成功,我们的生活也围绕者越来越多的 ARM 设备 —— 从树梅派 (Raspberry Pi) 到 Chromebook 以及 Nvidia Shield。为 Intel/AMD 架构的 CPU 而编写的传统发行版并不能够在这些 ARM 架构的设备上运行。而一些为 ARM 而编写的发行版却仅仅只能在特定的硬件上运行,比如只能运行在树梅派 (Raspberry Pi) 上的 Raspbian 系统。[Arch Linux ARM](http://archlinuxarm.org/) (ALARM) 的闪光点在于:它是一个基于 Arch Linux 的纯社区支持的发行版,可以在树梅派 (Raspberry Pi)、Chromebook、Android 设备以及 Nvidia Shield 等设备上运行。同时,也由于有了 AUR,该发行版变得更加有趣,你可以安装很多在其他发行版可能无法获取的软件。 +随着 Android 系统的成功,我们的生活也围绕者越来越多的 ARM 设备 —— 从树莓派 (Raspberry Pi) 到 Chromebook 以及 Nvidia Shield。为 Intel/AMD 架构的 CPU 而编写的传统发行版并不能够在这些 ARM 架构的设备上运行。而一些为 ARM 而编写的发行版却仅仅只能在特定的硬件上运行,比如只能运行在树莓派 (Raspberry Pi) 上的 Raspbian 系统。这就是 [Arch Linux ARM](http://archlinuxarm.org/) (ALARM) 的闪光点所在。它是一个基于 Arch Linux 的纯社区支持的发行版,可以在树梅派 (Raspberry Pi)、Chromebook、Android 设备以及 Nvidia Shield 等设备上运行。同时,也由于 AUR,该发行版变得更加有趣,你可以安装很多在其他发行版可能无法获取的软件。 ## 结论 @@ -111,7 +111,7 @@ via: http://www.linux.com/news/software/applications/878620-the-best-linux-distr 作者:[Swapnil Bhartiya][a] 译者:[GHLandy](https://github.com/GHLandy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[mudongliang](https://github.com/mudongliang) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 4ffed9195b05f144b681d003f4b2d193ac0d576b Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 21 Feb 2016 14:48:14 +0800 Subject: [PATCH 0386/1469] PUB:20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast @oska874 @YuKing-net @locez --- ...218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md b/published/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md index df872dd49e..9eb9e779b9 100644 --- a/published/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md +++ b/published/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md @@ -13,7 +13,7 @@ Canonical 宣称 Pro 5 是目前已发布了的 Ubuntu 智能手机中最强大的一个,他们说的是对的,但还有一点没有被提及,即如果不考虑平板,它也是最大的 Ubuntu Touch 设备。魅族 Pro 5 采用了一颗 Exynos 7420 8 核处理器和 5.7 英寸分辨率为 1920x1080 的 AMOLED 屏,配备第三代康宁大猩猩玻璃以及 LPDDR4 内存技术。 -很多人也许会问这个新手机的系统是否可以和桌面版系统一样,现在看起来用户是运气不错。 +很多人也许会问这个新手机的系统是否可以和桌面版系统一样,现在看起来真是如此。 该公司解释说,“Canonical 一直致力于通过向各种个人设备提供一个统一的自适应平台来重塑个人计算的视觉表现。因此尽管魅族 Pro 5 缺少 MHL 输出,但它运行的是最新的代码,这些代码与新近发布的平板和其它设备一样,可提供一种接近传统桌面的体验。” From dd6751d7e7254673b2e51aa8a6f3cb847f0039ce Mon Sep 17 00:00:00 2001 From: mudongliang Date: Sun, 21 Feb 2016 15:04:15 +0800 Subject: [PATCH 0387/1469] Translating --- .../tech/20160220 Linux Mint 18 Will Get Its Own Set Of Apps.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160220 Linux Mint 18 Will Get Its Own Set Of Apps.md b/sources/tech/20160220 Linux Mint 18 Will Get Its Own Set Of Apps.md index 2ef5effbb7..6846dbf49d 100644 --- a/sources/tech/20160220 Linux Mint 18 Will Get Its Own Set Of Apps.md +++ b/sources/tech/20160220 Linux Mint 18 Will Get Its Own Set Of Apps.md @@ -1,3 +1,5 @@ +mudongliang + Linux Mint 18 Will Get Its Own Set Of Apps ============================================= From 329cff65e44a490cdd9004dc1932cb1665b9cc98 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 21 Feb 2016 15:06:23 +0800 Subject: [PATCH 0388/1469] =?UTF-8?q?=E4=B8=AD=E6=96=87=E6=8E=92=E7=89=88?= =?UTF-8?q?=E6=8C=87=E5=8C=97=EF=BC=88=E7=AE=80=E4=BD=93=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chinese-copywriting-guidelines.md | 301 ------------------------------ 中文排版指北.md | 300 +++++++++++++++++++++++++++++ 2 files changed, 300 insertions(+), 301 deletions(-) delete mode 100644 chinese-copywriting-guidelines.md create mode 100644 中文排版指北.md diff --git a/chinese-copywriting-guidelines.md b/chinese-copywriting-guidelines.md deleted file mode 100644 index c2d0d207bd..0000000000 --- a/chinese-copywriting-guidelines.md +++ /dev/null @@ -1,301 +0,0 @@ -# 中文文案排版指北 -[![devDependency Status](https://david-dm.org/sparanoid/chinese-copywriting-guidelines/dev-status.svg)](https://david-dm.org/sparanoid/chinese-copywriting-guidelines#info=devDependencies) -[![Built with Almace Scaffolding](https://d349cztnlupsuf.cloudfront.net/amsf-badge.svg)](http://sparanoid.com/note/chinese-copywriting-guidelines/) - -統一中文文案、排版的相關用法,降低團隊成員之間的溝通成本,增強網站氣質。 - -Other languages: - -- [English](README.en.md) -- [Chinese Traditional](README.md) -- [Chinese Simplifed](https://github.com/mzlogin/chinese-copywriting-guidelines) - ------ - -## 目次 - -- [空格](#空格) - - [中英文之間需要增加空格](#中英文之間需要增加空格) - - [中文與數字之間需要增加空格](#中文與數字之間需要增加空格) - - [數字與單位之間需要增加空格](#數字與單位之間需要增加空格) - - [全形標點與其他字符之間不加空格](#全形標點與其他字符之間不加空格) - - [`-ms-text-autospace` to the rescue?](#-ms-text-autospace-to-the-rescue) -- [標點符號](#標點符號) - - [不重複使用標點符號](#不重複使用標點符號) -- [全形和半形](#全形和半形) - - [使用全形中文標點](#使用全形中文標點) - - [數字使用半形字符](#數字使用半形字符) - - [遇到完整的英文整句、特殊名詞,其內容使用半形標點](#遇到完整的英文整句特殊名詞其內容使用半形標點) -- [名詞](#名詞) - - [專有名詞使用正確的大小寫](#專有名詞使用正確的大小寫) - - [不要使用不地道的縮寫](#不要使用不地道的縮寫) -- [爭議](#爭議) - - [鏈接之間增加空格](#鏈接之間增加空格) - - [簡體中文使用直角引號](#簡體中文使用直角引號) -- [工具](#工具) -- [誰在這樣做?](#誰在這樣做) -- [參考文獻](#參考文獻) - -## 空格 - -「有研究顯示,打字的時候不喜歡在中文和英文之間加空格的人,感情路都走得很辛苦,有七成的比例會在 34 歲的時候跟自己不愛的人結婚,而其餘三成的人最後只能把遺產留給自己的貓。畢竟愛情跟書寫都需要適時地留白。 - -與大家共勉之。」——[vinta/paranoid-auto-spacing](https://github.com/vinta/pangu.js) - -### 中英文之間需要增加空格 - -正確: - -> 在 LeanCloud 上,數據存儲是圍繞 `AVObject` 進行的。 - -錯誤: - -> 在LeanCloud上,數據存儲是圍繞`AVObject`進行的。 - -> 在 LeanCloud上,數據存儲是圍繞`AVObject` 進行的。 - -完整的正確用法: - -> 在 LeanCloud 上,数据存储是围绕 `AVObject` 进行的。每个 `AVObject` 都包含了与 JSON 兼容的 key-value 对应的数据。数据是 schema-free 的,你不需要在每个 `AVObject` 上提前指定存在哪些键,只要直接设定对应的 key-value 即可。 - -例外:「豆瓣FM」等產品名詞,按照官方所定義的格式書寫。 - -### 中文與數字之間需要增加空格 - -正確: - -> 今天出去買菜花了 5000 元。 - -錯誤: - -> 今天出去買菜花了 5000元。 - -> 今天出去買菜花了5000元。 - -### 數字與單位之間需要增加空格 - -正確: - -> 我家的光纖入屋寬頻有 10 Gbps,SSD 一共有 20 TB。 - -錯誤: - -> 我家的光纖入屋寬頻有 10Gbps,SSD 一共有 20TB。 - -例外:度/百分比與數字之間不需要增加空格: - -正確: - -> 今天是 233° 的高溫。 - -> 新 MacBook Pro 有 15% 的 CPU 性能提升。 - -錯誤: - -> 今天是 233 ° 的高溫。 - -> 新 MacBook Pro 有 15 % 的 CPU 性能提升。 - -### 全形標點與其他字符之間不加空格 - -正確: - -> 剛剛買了一部 iPhone,好開心! - -錯誤: - -> 剛剛買了一部 iPhone ,好開心! - -### `-ms-text-autospace` to the rescue? - -Microsoft 有個 [`-ms-text-autospace`](http://msdn.microsoft.com/en-us/library/ie/ms531164(v=vs.85).aspx) 的 CSS 屬性可以實現自動為中英文之間增加空白。不過目前並未普及,另外在其他應用場景,例如 OS X、iOS 的用戶介面目前并不存在這個特性,所以請繼續保持隨手加空格的習慣。 - -## 標點符號 - -### 不重複使用標點符號 - -正確: - -> 德國隊竟然戰勝了巴西隊! - -> 她竟然對你說「喵」?! - -錯誤: - -> 德國隊竟然戰勝了巴西隊!! - -> 德國隊竟然戰勝了巴西隊!!!!!!!! - -> 她竟然對你說「喵」??!! - -> 她竟然對你說「喵」?!?!??!! - -## 全形和半形 - -不明白什麼是全形(全角)與半形(半角)符號?請查看維基百科詞條『[全形和半形](http://zh.wikipedia.org/wiki/%E5%85%A8%E5%BD%A2%E5%92%8C%E5%8D%8A%E5%BD%A2)』。 - -### 使用全形中文標點 - -正確: - -> 嗨!你知道嘛?今天前台的小妹跟我說「喵」了哎! - -> 核磁共振成像(NMRI)是什麼原理都不知道?JFGI! - -錯誤: - -> 嗨! 你知道嘛? 今天前台的小妹跟我說 "喵" 了哎! - -> 嗨!你知道嘛?今天前台的小妹跟我說"喵"了哎! - -> 核磁共振成像 (NMRI) 是什麼原理都不知道? JFGI! - -> 核磁共振成像(NMRI)是什麼原理都不知道?JFGI! - -### 數字使用半形字符 - -正確: - -> 這件蛋糕只賣 1000 元。 - -錯誤: - -> 這件蛋糕只賣 1000 元。 - -例外:在設計稿、宣傳海報中如出現極少量數字的情形時,為方便文字對齊,是可以使用全形數字的。 - -### 遇到完整的英文整句、特殊名詞,其內容使用半形標點 - -正確: - -> 賈伯斯那句話是怎麼說的?「Stay hungry, stay foolish.」 - -> 推薦你閱讀《Hackers & Painters: Big Ideas from the Computer Age》,非常的有趣。 - -錯誤: - -> 賈伯斯那句話是怎麼說的?「Stay hungry,stay foolish。」 - -> 推薦你閱讀《Hackers&Painters:Big Ideas from the Computer Age》,非常的有趣。 - -## 名詞 - -### 專有名詞使用正確的大小寫 - -大小寫相關用法原屬於英文書寫範疇,不屬於本 wiki 討論內容,在這裡只對部分易錯用法進行簡述。 - -正確: - -> 使用 GitHub 登錄 - -> 我們的客戶有 GitHub、Foursquare、Microsoft Corporation、Google、Facebook, Inc.。 - -錯誤: - -> 使用 github 登錄 - -> 使用 GITHUB 登錄 - -> 使用 Github 登錄 - -> 使用 gitHub 登錄 - -> 使用 gイんĤЦ8 登錄 - -> 我們的客戶有 github、foursquare、microsoft corporation、google、facebook, inc.。 - -> 我們的客戶有 GITHUB、FOURSQUARE、MICROSOFT CORPORATION、GOOGLE、FACEBOOK, INC.。 - -> 我們的客戶有 Github、FourSquare、MicroSoft Corporation、Google、FaceBook, Inc.。 - -> 我們的客戶有 gitHub、fourSquare、microSoft Corporation、google、faceBook, Inc.。 - -> 我們的客戶有 gイんĤЦ8、キouЯƧquムгє、๓เςг๏ร๏Ŧt ς๏гק๏гคtเ๏ภn、900913、ƒ4ᄃëв๏๏к, IПᄃ.。 - -注意:當網頁中需要配合整體視覺風格而出現全部大寫/小寫的情形,HTML 中請使用標準的大小寫規範進行書寫;並通過 `text-transform: uppercase;`/`text-transform: lowercase;` 對表現形式進行定義。 - -### 不要使用不地道的縮寫 - -正確: - -> 我們需要一位熟悉 JavaScript、HTML5,至少理解一种框架(如 Backbone.js、AngularJS、React 等)的前端開發者。 - -錯誤: - -> 我們需要一位熟悉 Js、h5,至少理解一种框架(如 backbone、angular、RJS 等)的 FED。 - -## 爭議 - -以下用法略帶有個人色彩,既:無論是否遵循下述規則,從語法的角度來講都是**正確**的。 - -### 鏈接之間增加空格 - -用法: - -> 请 [提交一个 issue](#) 并分配给相关同事。 - -> 訪問我們網站的最新動態,請 [點擊這裡](#) 進行訂閱! - -對比用法: - -> 请[提交一个 issue](#) 并分配给相关同事。 - -> 訪問我們網站的最新動態,請[點擊這裡](#)進行訂閱! - -### 簡體中文使用直角引號 - -用法: - -> 「老师,『有条不紊』的『紊』是什么意思?」 - -對比用法: - -> “老师,‘有条不紊’的‘紊’是什么意思?” - -## 工具 - -倉庫 | 語言 ---- | --- -[vinta/paranoid-auto-spacing](https://github.com/vinta/paranoid-auto-spacing) | JavaScript -[huei90/pangu.node](https://github.com/huei90/pangu.node) | Node.js -[huacnlee/auto-correct](https://github.com/huacnlee/auto-correct) | Ruby -[sparanoid/space-lover](https://github.com/sparanoid/space-lover) | PHP (WordPress) -[nauxliu/auto-correct](https://github.com/NauxLiu/auto-correct) | PHP -[hotoo/pangu.vim](https://github.com/hotoo/pangu.vim) | Vim -[sparanoid/grunt-auto-spacing](https://github.com/sparanoid/grunt-auto-spacing) | Node.js (Grunt) -[hjiang/scripts/add-space-between-latin-and-cjk](https://github.com/hjiang/scripts/blob/master/add-space-between-latin-and-cjk) | Python - -## 誰在這樣做? - -網站 | 文案 | UGC ---- | --- | --- -[Apple 中國](http://www.apple.com/cn/) | Yes | N/A -[Apple 香港](http://www.apple.com/hk/) | Yes | N/A -[Apple 台灣](http://www.apple.com/tw/) | Yes | N/A -[Microsoft 中國](http://www.microsoft.com/zh-cn/) | Yes | N/A -[Microsoft 香港](http://www.microsoft.com/zh-hk/) | Yes | N/A -[Microsoft 台灣](http://www.microsoft.com/zh-tw/) | Yes | N/A -[LeanCloud](https://leancloud.cn/) | Yes | N/A -[知乎](https://www.zhihu.com/) | Yes | 部分用戶達成 -[V2EX](https://www.v2ex.com/) | Yes | Yes -[SegmentFault](https://segmentfault.com/) | Yes | 部分用戶達成 -[Apple4us](http://apple4us.com/) | Yes | N/A -[豌豆荚](https://www.wandoujia.com/) | Yes | N/A -[Ruby China](https://ruby-china.org/) | Yes | 標題達成 -[PHPHub](https://phphub.org/) | Yes | 標題達成 - -## 參考文獻 - -- [Guidelines for Using Capital Letters - About.com](http://grammar.about.com/od/punctuationandmechanics/a/Guidelines-For-Using-Capital-Letters.htm) -- [Letter case - Wikipedia](http://en.wikipedia.org/wiki/Letter_case) -- [Punctuation - Oxford Dictionaries](http://www.oxforddictionaries.com/words/punctuation) -- [Punctuation - The Purdue OWL](https://owl.english.purdue.edu/owl/section/1/6/) -- [How to Use English Punctuation Correctly - wikiHow](http://www.wikihow.com/Use-English-Punctuation-Correctly) -- [格式 - openSUSE](https://zh.opensuse.org/index.php?title=Help:%E6%A0%BC%E5%BC%8F) -- [全形和半形 - 維基百科](http://zh.wikipedia.org/wiki/%E5%85%A8%E5%BD%A2%E5%92%8C%E5%8D%8A%E5%BD%A2) -- [引號 - 維基百科](http://zh.wikipedia.org/wiki/%E5%BC%95%E8%99%9F) -- [疑問驚嘆號 - 維基百科](http://zh.wikipedia.org/wiki/%E7%96%91%E5%95%8F%E9%A9%9A%E5%98%86%E8%99%9F) - -## CopyRight - -[中文文案排版指北](https://github.com/sparanoid/chinese-copywriting-guidelines) diff --git a/中文排版指北.md b/中文排版指北.md new file mode 100644 index 0000000000..8f54947f8f --- /dev/null +++ b/中文排版指北.md @@ -0,0 +1,300 @@ +# 中文文案排版指北 +[![devDependency Status](https://david-dm.org/mzlogin/chinese-copywriting-guidelines/dev-status.svg)](https://david-dm.org/mzlogin/chinese-copywriting-guidelines#info=devDependencies) + +统一中文文案、排版的相关用法,降低团队成员之间的沟通成本,增强网站气质。 + +Other languages: + +- [English](https://github.com/mzlogin/chinese-copywriting-guidelines/blob/Simplified/README.en.md) +- [Chinese Traditional](https://github.com/sparanoid/chinese-copywriting-guidelines) +- [Chinese Simplified](README.md) + +----- + +## 目录 + +- [空格](#空格) + - [中英文之间需要增加空格](#中英文之间需要增加空格) + - [中文与数字之间需要增加空格](#中文与数字之间需要增加空格) + - [数字与单位之间需要增加空格](#数字与单位之间需要增加空格) + - [全角标点与其他字符之间不加空格](#全角标点与其他字符之间不加空格) + - [`-ms-text-autospace` to the rescue?](#-ms-text-autospace-to-the-rescue) +- [标点符号](#标点符号) + - [不重复使用标点符号](#不重复使用标点符号) +- [全角和半角](#全角和半角) + - [使用全角中文标点](#使用全角中文标点) + - [数字使用半角字符](#数字使用半角字符) + - [遇到完整的英文整句、特殊名词,其內容使用半角标点](#遇到完整的英文整句特殊名词其內容使用半角标点) +- [名词](#名词) + - [专有名词使用正确的大小写](#专有名词使用正确的大小写) + - [不要使用不地道的缩写](#不要使用不地道的缩写) +- [争议](#争议) + - [链接之间增加空格](#链接之间增加空格) + - [简体中文使用直角引号](#简体中文使用直角引号) +- [工具](#工具) +- [谁在这样做?](#谁在这样做) +- [参考文献](#参考文献) + +## 空格 + +「有研究显示,打字的时候不喜欢在中文和英文之间加空格的人,感情路都走得很辛苦,有七成的比例会在 34 岁的时候跟自己不爱的人结婚,而其余三成的人最后只能把遗产留给自己的猫。毕竟爱情跟书写都需要适时地留白。 + +与大家共勉之。」——[vinta/paranoid-auto-spacing](https://github.com/vinta/pangu.js) + +### 中英文之间需要增加空格 + +正确: + +> 在 LeanCloud 上,数据存储是围绕 `AVObject` 进行的。 + +错误: + +> 在LeanCloud上,数据存储是围绕`AVObject`进行的。 + +> 在 LeanCloud上,数据存储是围绕`AVObject` 进行的。 + +完整的正确用法: + +> 在 LeanCloud 上,数据存储是围绕 `AVObject` 进行的。每个 `AVObject` 都包含了与 JSON 兼容的 key-value 对应的数据。数据是 schema-free 的,你不需要在每个 `AVObject` 上提前指定存在哪些键,只要直接设定对应的 key-value 即可。 + +例外:「豆瓣FM」等产品名词,按照官方所定义的格式书写。 + +### 中文与数字之间需要增加空格 + +正确: + +> 今天出去买菜花了 5000 元。 + +错误: + +> 今天出去买菜花了 5000元。 + +> 今天出去买菜花了5000元。 + +### 数字与单位之间需要增加空格 + +正确: + +> 我家的光纤入户宽带有 10 Gbps,SSD 一共有 20 TB。 + +错误: + +> 我家的光纤入户宽带有 10Gbps,SSD 一共有 10TB。 + +例外:度/百分比与数字之间不需要增加空格: + +正确: + +> 今天是 233° 的高温。 + +> 新 MacBook Pro 有 15% 的 CPU 性能提升。 + +错误: + +> 今天是 233 ° 的高温。 + +> 新 MacBook Pro 有 15 % 的 CPU 性能提升。 + +### 全角标点与其他字符之间不加空格 + +正确: + +> 刚刚买了一部 iPhone,好开心! + +错误: + +> 刚刚买了一部 iPhone ,好开心! + +### `-ms-text-autospace` to the rescue? + +Microsoft 有个 [`-ms-text-autospace`](http://msdn.microsoft.com/en-us/library/ie/ms531164(v=vs.85).aspx) 的 CSS 属性可以实现自动为中英文之间增加空白。不过目前并未普及,另外在其他应用场景,例如 OS X、iOS 的用户界面目前并不存在这个特性,所以请继续保持随手加空格的习惯。 + +## 标点符号 + +### 不重复使用标点符号 + +正确: + +> 德国队竟然战胜了巴西队! + +> 她竟然对你说「喵」?! + +错误: + +> 德国队竟然战胜了巴西队!! + +> 德国队竟然战胜了巴西队!!!!!!!! + +> 她竟然对你说「喵」??!! + +> 她竟然对你说「喵」?!?!??!! + +## 全角和半角 + +不明白什么是全角(全形)与半角(半形)符号?请查看维基百科词条『[全角和半角](http://zh.wikipedia.org/wiki/%E5%85%A8%E5%BD%A2%E5%92%8C%E5%8D%8A%E5%BD%A2)』。 + +### 使用全角中文标点 + +正确: + +> 嗨!你知道嘛?今天前台的小妹跟我说「喵」了哎! + +> 核磁共振成像(NMRI)是什么原理都不知道?JFGI! + +错误: + +> 嗨! 你知道嘛? 今天前台的小妹跟我说 "喵" 了哎! + +> 嗨!你知道嘛?今天前台的小妹跟我说"喵"了哎! + +> 核磁共振成像 (NMRI) 是什么原理都不知道? JFGI! + +> 核磁共振成像(NMRI)是什么原理都不知道?JFGI! + +### 数字使用半角字符 + +正确: + +> 这件蛋糕只卖 1000 元。 + +错误: + +> 这件蛋糕只卖 1000 元。 + +例外:在设计稿、宣传海报中如出现极少量数字的情形时,为方便文字对齐,是可以使用全角数字的。 + +### 遇到完整的英文整句、特殊名词,其內容使用半角标点 + +正确: + +> 乔布斯那句话是怎么说的?「Stay hungry, stay foolish.」 + +> 推荐你阅读《Hackers & Painters: Big Ideas from the Computer Age》,非常的有趣。 + +错误: + +> 乔布斯那句话是怎么说的?「Stay hungry,stay foolish。」 + +> 推荐你阅读《Hackers&Painters:Big Ideas from the Computer Age》,非常的有趣。 + +## 名词 + +### 专有名词使用正确的大小写 + +大小写相关用法原属于英文书写范畴,不属于本 wiki 讨论內容,在这里只对部分易错用法进行简述。 + +正确: + +> 使用 GitHub 登录 + +> 我们的客户有 GitHub、Foursquare、Microsoft Corporation、Google、Facebook, Inc.。 + +错误: + +> 使用 github 登录 + +> 使用 GITHUB 登录 + +> 使用 Github 登录 + +> 使用 gitHub 登录 + +> 使用 gイんĤЦ8 登录 + +> 我们的客户有 github、foursquare、microsoft corporation、google、facebook, inc.。 + +> 我们的客户有 GITHUB、FOURSQUARE、MICROSOFT CORPORATION、GOOGLE、FACEBOOK, INC.。 + +> 我们的客户有 Github、FourSquare、MicroSoft Corporation、Google、FaceBook, Inc.。 + +> 我们的客户有 gitHub、fourSquare、microSoft Corporation、google、faceBook, Inc.。 + +> 我们的客户有 gイんĤЦ8、キouЯƧquムгє、๓เςг๏ร๏Ŧt ς๏гק๏гคtเ๏ภn、900913、ƒ4ᄃëв๏๏к, IПᄃ.。 + +注意:当网页中需要配合整体视觉风格而出现全部大写/小写的情形,HTML 中请使用标准的大小写规范进行书写;并通过 `text-transform: uppercase;`/`text-transform: lowercase;` 对表现形式进行定义。 + +### 不要使用不地道的缩写 + +正确: + +> 我们需要一位熟悉 JavaScript、HTML5,至少理解一种框架(如 Backbone.js、AngularJS、React 等)的前端开发者。 + +错误: + +> 我们需要一位熟悉 Js、h5,至少理解一种框架(如 backbone、angular、RJS 等)的 FED。 + +## 争议 + +以下用法略带有个人色彩,既:无论是否遵循下述规则,从语法的角度来讲都是**正确**的。 + +### 链接之间增加空格 + +用法: + +> 请 [提交一个 issue](#) 并分配给相关同事。 + +> 访问我们网站的最新动态,请 [点击这里](#) 进行订阅! + +对比用法: + +> 请[提交一个 issue](#) 并分配给相关同事。 + +> 访问我们网站的最新动态,请[点击这里](#)进行订阅! + +### 简体中文使用直角引号 + +用法: + +> 「老师,『有条不紊』的『紊』是什么意思?」 + +对比用法: + +> “老师,‘有条不紊’的‘紊’是什么意思?” + +## 工具 + +仓库 | 语言 +--- | --- +[vinta/paranoid-auto-spacing](https://github.com/vinta/paranoid-auto-spacing) | JavaScript +[huei90/pangu.node](https://github.com/huei90/pangu.node) | Node.js +[huacnlee/auto-correct](https://github.com/huacnlee/auto-correct) | Ruby +[sparanoid/space-lover](https://github.com/sparanoid/space-lover) | PHP (WordPress) +[nauxliu/auto-correct](https://github.com/NauxLiu/auto-correct) | PHP +[hotoo/pangu.vim](https://github.com/hotoo/pangu.vim) | Vim +[sparanoid/grunt-auto-spacing](https://github.com/sparanoid/grunt-auto-spacing) | Node.js (Grunt) +[hjiang/scripts/add-space-between-latin-and-cjk](https://github.com/hjiang/scripts/blob/master/add-space-between-latin-and-cjk) | Python + +## 谁在这样做? + +网站 | 文案 | UGC +--- | --- | --- +[Apple 中国](http://www.apple.com/cn/) | Yes | N/A +[Apple 香港](http://www.apple.com/hk/) | Yes | N/A +[Apple 台湾](http://www.apple.com/tw/) | Yes | N/A +[Microsoft 中国](http://www.microsoft.com/zh-cn/) | Yes | N/A +[Microsoft 香港](http://www.microsoft.com/zh-hk/) | Yes | N/A +[Microsoft 台湾](http://www.microsoft.com/zh-tw/) | Yes | N/A +[LeanCloud](https://leancloud.cn/) | Yes | N/A +[知乎](https://www.zhihu.com/) | Yes | 部分用户达成 +[V2EX](https://www.v2ex.com/) | Yes | Yes +[SegmentFault](https://segmentfault.com/) | Yes | 部分用户达成 +[Apple4us](http://apple4us.com/) | Yes | N/A +[豌豆荚](https://www.wandoujia.com/) | Yes | N/A +[Ruby China](https://ruby-china.org/) | Yes | 标题达成 +[PHPHub](https://phphub.org/) | Yes | 标题达成 + +## 参考文献 + +- [Guidelines for Using Capital Letters](http://grammar.about.com/od/punctuationandmechanics/a/Guidelines-For-Using-Capital-Letters.htm) +- [Letter case - Wikipedia](http://en.wikipedia.org/wiki/Letter_case) +- [Punctuation - Oxford Dictionaries](http://www.oxforddictionaries.com/words/punctuation) +- [Punctuation - The Purdue OWL](https://owl.english.purdue.edu/owl/section/1/6/) +- [How to Use English Punctuation Corrently - wikiHow](http://www.wikihow.com/Use-English-Punctuation-Correctly) +- [格式 - openSUSE](https://zh.opensuse.org/index.php?title=Help:%E6%A0%BC%E5%BC%8F) +- [全角和半角 - 维基百科](http://zh.wikipedia.org/wiki/%E5%85%A8%E5%BD%A2%E5%92%8C%E5%8D%8A%E5%BD%A2) +- [引号 - 维基百科](http://zh.wikipedia.org/wiki/%E5%BC%95%E8%99%9F) +- [疑问惊叹号 - 维基百科](http://zh.wikipedia.org/wiki/%E7%96%91%E5%95%8F%E9%A9%9A%E5%98%86%E8%99%9F) + +## CopyRight + +[中文文案排版指北](https://github.com/sparanoid/chinese-copywriting-guidelines) From d4fc7ecab45e6ce71c4ff1f0fee87e2bf1e97bae Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 21 Feb 2016 15:07:52 +0800 Subject: [PATCH 0389/1469] translated --- ...ser For Each Incorrect Password Attempt.md | 59 ------------------- ...ser For Each Incorrect Password Attempt.md | 58 ++++++++++++++++++ 2 files changed, 58 insertions(+), 59 deletions(-) delete mode 100644 sources/tech/20160220 Make Sudo Insult User For Each Incorrect Password Attempt.md create mode 100644 translated/tech/20160220 Make Sudo Insult User For Each Incorrect Password Attempt.md diff --git a/sources/tech/20160220 Make Sudo Insult User For Each Incorrect Password Attempt.md b/sources/tech/20160220 Make Sudo Insult User For Each Incorrect Password Attempt.md deleted file mode 100644 index 8db9dfa7b4..0000000000 --- a/sources/tech/20160220 Make Sudo Insult User For Each Incorrect Password Attempt.md +++ /dev/null @@ -1,59 +0,0 @@ -Translating---geekpi - -Make Sudo Insult User For Each Incorrect Password Attempt -=========================================================== - -You can have lots of fun in Linux terminal. And I am not talking about those funny commands to [run a train in Linux terminal](http://itsfoss.com/ubuntu-terminal-train/). - -I am talking about little tweaks in the terminal that will lighten up your mood. In a previous article, you learnt [how to increase sudo timeout in Linux terminal](http://itsfoss.com/change-sudo-password-timeout-ubuntu/). In today’s fun post, I’ll show you how you can make sudo to insult you (or other users) when incorrect password is attempted with sudo command. - -Confused what I am talking about? Here, take a look at this gif to get a gist of how sudo can insult you for typing in the incorrect password. - -![](http://itsfoss.com/wp-content/uploads/2016/02/sudo-insults-Linux.gif) - -Now, why would you do that and take insults? After all, insults are not going to brighten up your day, is it? - -To me, this little tweak is funny and is better than the plain old “incorrect password” error message. Moreover, I can show it off to my friends (in this case you, via It’s FOSS) to amuse them. I am pretty sure you can come up with your own reason to use this tweak. - -## Enable insults in sudo - -You can enable insults in `sudo` by adding the following line in `sudo` configuration: - -``` -Defaults insults -``` - -Let’s see how to do that. Open a terminal and use the following command: - -``` -sudo visudo -``` - -This should open the configuration file in [nano](http://www.nano-editor.org/). Yeah, I know that traditionally ‘visudo’ should open the `/etc/sudoers` file in Vi editor, but Ubuntu and Ubuntu based Linux distribution will open it in nano. Since we are talking about Vi, here is a [cheat sheet for Vi editor](http://itsfoss.com/download-vi-cheat-sheet/) that could come handy if you decide to use Vi. - -Coming back to editing the sudeors file, you need to find the section where Defaults are listed. Luckily, it is in the beginning itself. Just add “Defaults insults” line to it, like this: - -![](http://itsfoss.com/wp-content/uploads/2016/02/sudo-insults-Linux-Mint.png) - -If you are using nano, use `Ctrl+X` to quit the editor. At the time of quitting, it will ask you if you want to save the changes or not. To save the changes, press `Y`. - -Once you have saved the changes in sudoers file, open a terminal and use any command with sudo. Deliberately type wrong password and enjoy the abuses :) - -sudo could be nasty. See, it even threatens me of consequences if I type incorrect password again. LOL. - -![](http://itsfoss.com/wp-content/uploads/2016/02/sudo-insults-Linux-Mint-1.jpeg) - -If you like this terminal hack, check out other [terminal tricks](http://itsfoss.com/category/terminal-tricks/) posts as well. If you have other such fun tweaks and hacks, do share it in the comment box below. - - ------------------------------------------------------------------------------- - -via: http://itsfoss.com/sudo-insult-linux/ - -作者:[ABHISHEK][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://itsfoss.com/author/abhishek/ diff --git a/translated/tech/20160220 Make Sudo Insult User For Each Incorrect Password Attempt.md b/translated/tech/20160220 Make Sudo Insult User For Each Incorrect Password Attempt.md new file mode 100644 index 0000000000..0a0008ab8d --- /dev/null +++ b/translated/tech/20160220 Make Sudo Insult User For Each Incorrect Password Attempt.md @@ -0,0 +1,58 @@ +让sudo在用户输错密码时侮辱用户 +=========================================================== + +你在Linux终端中会有很多的乐趣。我今天要讲的不是在[终端中跑火车](http://itsfoss.com/ubuntu-terminal-train/)。 + +我今天要讲的技巧可以放松你的心情。前面一篇文章中,你学习了[如何在命令行中增加sudo命令的超时](http://itsfoss.com/change-sudo-password-timeout-ubuntu/)。今天的文章中,我会向你展示如让sudo在输错密码的时候侮辱你(或者其他人)。 + + +对我讲的感到疑惑?这里,让我们看下这张gif来了解sudo如何在你输错密码之后侮辱你的。 + +![](http://itsfoss.com/wp-content/uploads/2016/02/sudo-insults-Linux.gif) + +现在,你为什要这么做?毕竟,侮辱不会让你的一天开心,不是么? + +对我来说,一点小技巧都是有趣的,并且要比以前的“密码错误”的错误提示更有趣。另外,我可以向我的朋友展示娱乐(这个例子中是通过自由开源软件)。我很肯定你有你自己的里有来使用这个技巧的。 + +## 在sudo中启用侮辱 + +你可以在`sudo`配置中增加下面的行来启用侮辱功能: + +``` +Defaults insults +``` + +让我们看看该如何做。打开终端并使用下面的命令: + +``` +sudo visudo +``` + +这会在[nano](http://www.nano-editor.org/)中打开配置文件。使得,我知道传统的‘visudo’应该在vi中打开`/etc/sudoers` 文件,但是Ubuntu及基于它的发行版会使用nano打开。由于我们再讨论vi,这里有一份[vi速查表](http://itsfoss.com/download-vi-cheat-sheet)可以在你决定使用vi的时候使用。 + +回到编辑sudeors文件界面,你需要找出Defaults所在的行。幸运的是,只需要在文件的开头加上“Defaults insults”,就像这样: + +![](http://itsfoss.com/wp-content/uploads/2016/02/sudo-insults-Linux-Mint.png) + +如果你正在使用nano,使用`Ctrl+X`来退出编辑器。在退出的时候,它会询问你是否保存更改。要保存更改,按下“Y”。 + +一旦你保存了sudoers文件之后,打开终端并在任何命令中使用sudo。故意输错密码病享受辱骂:) + +sudo可能会讨厌的。看见没,他甚至在我再次输错之后威胁我。哈哈 + +![](http://itsfoss.com/wp-content/uploads/2016/02/sudo-insults-Linux-Mint-1.jpeg) + +如果你喜欢这个终端技巧,你也可以查看[其他终端技巧的文章](http://itsfoss.com/category/terminal-tricks/)。如果你有其他有趣的技巧,在评论中分享。 + + +------------------------------------------------------------------------------ + +via: http://itsfoss.com/sudo-insult-linux/ + +作者:[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 3e8c3e1ce47da456a73ad851d70acae27c7498e7 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 21 Feb 2016 15:34:35 +0800 Subject: [PATCH 0390/1469] Update 20160218 The Best Linux Distros of 2016.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 按照指北修改几处排版 --- ...20160218 The Best Linux Distros of 2016.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/translated/tech/20160218 The Best Linux Distros of 2016.md b/translated/tech/20160218 The Best Linux Distros of 2016.md index fdb7cd02b0..dee100ad70 100644 --- a/translated/tech/20160218 The Best Linux Distros of 2016.md +++ b/translated/tech/20160218 The Best Linux Distros of 2016.md @@ -9,17 +9,17 @@ SUSE 是 openSUSE 发行版背后的公司,同时也是起步最早的 Linux 公司;[它在 Linus Torvalds 发布 Linux 的第二年就成立了](http://www.linux.com/news/software/applications/866964-exclusive-interview-with-suse-president-nils-brauckmann)。该公司的成立实际上早于现在的 Linux 公司之王 —— Red Hat。同时 SUSE 也是 [openSUSE](https://www.opensuse.org/) 社区发行版的发起者和赞助商。 -2015 年,openSUSE 的开发团队决定向 SUSE Linux 企业版 (SLE) 靠拢,以便让用户可以获得企业服务器特性的发行版 —— 类似于 CentOS 和 Ubuntu 那样。因此,openSUSE 变成了 [openSUSE Leap](https://en.opensuse.org/Portal:Leap),一个直接基于 SLE SP1 的发行版。 +2015 年,openSUSE 的开发团队决定向 SUSE Linux 企业版 (SLE) 靠拢,以便让用户可以获得企业服务器特性的发行版——类似于 CentOS 和 Ubuntu 那样。因此,openSUSE 变成了 [openSUSE Leap](https://en.opensuse.org/Portal:Leap),一个直接基于 SLE SP1 的发行版。 -两个发行版共用相同的基础代码,相互受益 —— SUSE 会选用 openSUSE 中好的代码,反之亦然。如此,openSUSE 也放弃了原本常规的发布周期,新版本与 SLE 同步发行。这意味着每个版本将会有更长的生命周期。 +两个发行版共用相同的基础代码,相互受益—— SUSE 会选用 openSUSE 中好的代码,反之亦然。如此,openSUSE 也放弃了原本常规的发布周期,新版本与 SLE 同步发行。这意味着每个版本将会有更长的生命周期。 -这样做的结果是,openSUSE 就成了一个非常重要的发行版,因为潜在的 SLE 用户现在可以使用 openSUSE Leap 了。但也并非完全如此,openSUSE 同样也有发行版 [Tumbleweed](http://www.cio.com/article/3008856/open-source-tools/is-opensuse-tumbleweed-good-enough-for-a-seasoned-arch-user.html) —— 一个纯净的滚动式版本。所以,用户们可以选择使用超稳定的 openSUSE Leap 或者经常更新的 openSUSE Tumbleweed。 +这样做的结果是,openSUSE 就成了一个非常重要的发行版,因为潜在的 SLE 用户现在可以使用 openSUSE Leap 了。但也并非完全如此,openSUSE 同样也有发行版 [Tumbleweed](http://www.cio.com/article/3008856/open-source-tools/is-opensuse-tumbleweed-good-enough-for-a-seasoned-arch-user.html) ——一个纯净的滚动式版本。所以,用户们可以选择使用超稳定的 openSUSE Leap 或者经常更新的 openSUSE Tumbleweed。 在我的记忆中,还没有其他的发行版做了这样一个令人印象深刻的回归。 ## 最高可定制性的发行版:Arch Linux -Arch Linux 是目前最好的滚动式更新的发行版。好吧,我可能有些偏见,因为我是一名 Arch Linux 用户 (GHLandy 译注:本人也是 Arch Linux 用户,它的定制性真的很好)。然而,我认为它好的真正原因是 Arch 在很多其他领域也都表现的非常优越,并且这才是我为什么用它作为主系统的原因。 +Arch Linux 是目前最好的滚动式更新的发行版。好吧,我可能有些偏见,因为我是一名 Arch Linux 用户 ( LCTT 译注:译者也是 Arch Linux 用户,它的定制性真的很好)。然而,我认为它好的真正原因是 Arch 在很多其他领域也都表现的非常优越,并且这才是我为什么用它作为主系统的原因。 - 对于那些想要学习 Linux 方方面面的用户来说,[Arch Linux](https://www.archlinux.org/) 无疑是一个绝佳的选择。因为你需要手动安装所有自己需要的东西,这样你会慢慢学到 Linux 系统的所有细节。 @@ -33,9 +33,9 @@ Arch Linux 是目前最好的滚动式更新的发行版。好吧,我可能有 ## 最美观的发行版:elementary OS -不同的发行版会有不同的关注点 —— 多数情况下表现为不同的技术。在大多数的 Linux 发行版中,外观和用户感觉并非他们优先考虑的事情 —— 这通常是桌面环境需要考虑的事情。 +不同的发行版会有不同的关注点——多数情况下表现为不同的技术。在大多数的 Linux 发行版中,外观和用户感觉并非他们优先考虑的事情 —— 这通常是桌面环境需要考虑的事情。 -[elementary OS](https://elementary.io/) 正在尝试改变这一事实。在这个发行版中,设计是占据重要位置,并且原因明显 —— 为该发行版取这个名字的开发者要在 Linux 世界里创建一些漂亮的图标。 +[elementary OS](https://elementary.io/) 正在尝试改变这一事实。在这个发行版中,设计是占据重要位置,并且原因明显——为该发行版取这个名字的开发者要在 Linux 世界里创建一些漂亮的图标。 elementary OS 相当注重整体外观和用户感觉。开发者创建了他们自己的组件,包括桌面环境。此外,他们只会选择那些符合设计规范的应用来加入到软件仓库。你可以发现 elementary OS 有很浓重的 Mac OS X 气息。 @@ -43,7 +43,7 @@ elementary OS 相当注重整体外观和用户感觉。开发者创建了他们 ![](http://www.linux.com/images/stories/66866/distro-solus.JPG) -[Solus](https://solus-project.com/) 最近获得非常大的关注程度。它是一个外观还可以、从零开始构建的操作系统,而并非 Debian 或者 Ubuntu 的衍生版本。它使用的 Budgie 桌面环境同样是从零开始构建的,但它的目标是兼容 Gnome。Solus 和 Google 的 Chrome OS 一样 —— 一切从简。 +[Solus](https://solus-project.com/) 最近获得非常大的关注程度。它是一个外观还可以、从零开始构建的操作系统,而并非 Debian 或者 Ubuntu 的衍生版本。它使用的 Budgie 桌面环境同样是从零开始构建的,但它的目标是兼容 Gnome。Solus 和 Google 的 Chrome OS 一样——一切从简。 我个人没怎么玩过 Solus,但它看起来很有前途。Solus 实际上并不是一个 “新” 系统。它曾以不同的形式和名称存在了很长时间,但直到 2015 年整个项目才以现在这个新名称重归大众视野。 @@ -63,7 +63,7 @@ elementary OS 相当注重整体外观和用户感觉。开发者创建了他们 ![](http://www.linux.com/images/stories/66866/distro-ubuntu-studio.JPG) -Snappy Ubuntu Core 为物联网 (IoT) 及此类设备而生的 Linux 操作系统。该系统拥有巨大潜力,它可以将我们身边绝大多数的东西 —— 如路由器、咖啡机和玩具飞机等 —— 变成智能设备。让它更有趣的是,软件管理更新的方式以及添加安全性能的模块。 +Snappy Ubuntu Core 为物联网 (IoT) 及此类设备而生的 Linux 操作系统。该系统拥有巨大潜力,它可以将我们身边绝大多数的东西 —— 如路由器、咖啡机和玩具飞机等——变成智能设备。让它更有趣的是,软件管理更新的方式以及添加安全性能的模块。 ## 为桌面系统而生的发行版:Linux Mint Cinnamon @@ -71,7 +71,7 @@ Snappy Ubuntu Core 为物联网 (IoT) 及此类设备而生的 Linux 操作系 ## 为游戏而生的发行版:Steam OS -对于桌面版 Linux 来说,玩游戏同样是短板。很多用户为了能够玩游戏,安装了 Linux 和 Windows 双系统。而 Valve 则尝试改变这个局面。Valve 是一个游戏发行商,它提供一个可以跨平台运行游戏的客户端。并且,Valve 也同样创建了它自己的开源操作系统 —— [Steam OS](http://store.steampowered.com/steamos/) —— 为了创建一个基于 Linux 的游戏平台。截至 2015 年底,它的合作伙伴开始把搭载了 Steam OS 的机器推向市场。 +对于桌面版 Linux 来说,玩游戏同样是短板。很多用户为了能够玩游戏,安装了 Linux 和 Windows 双系统。而 Valve 则尝试改变这个局面。Valve 是一个游戏发行商,它提供一个可以跨平台运行游戏的客户端。并且,Valve 也同样创建了它自己的开源操作系统——[Steam OS](http://store.steampowered.com/steamos/)——为了创建一个基于 Linux 的游戏平台。截至 2015 年底,它的合作伙伴开始把搭载了 Steam OS 的机器推向市场。 ## 为隐私而生的发行版:Tails @@ -81,7 +81,7 @@ Snappy Ubuntu Core 为物联网 (IoT) 及此类设备而生的 Linux 操作系 ## 为多媒体制作而生的发行版:Ubuntu Studio -基于 Linux 的操作系统有一个明显的弱点,那就是对多媒体制作的支持并不友好。所有专业级应用基本只能运行在 Windows 或者 Mac OS X 上。Linux 系统从来都不缺乏像样的音频/视频制作软件,但这样还是远远不够的。应该要有一款轻量级的桌面环境,使得那些宝贵的系统资源 —— 如 CPU 和 RAM —— 尽量少占用,以便用于多媒体制作。目前,[Ubuntu Studio](https://ubuntustudio.org/tour/) 对多媒体制作的支持最好。它使用了 Xfce 桌面环境,并且有各种各样的音频、视频以及图像编辑应用。 +基于 Linux 的操作系统有一个明显的弱点,那就是对多媒体制作的支持并不友好。所有专业级应用基本只能运行在 Windows 或者 Mac OS X 上。Linux 系统从来都不缺乏像样的音频/视频制作软件,但这样还是远远不够的。应该要有一款轻量级的桌面环境,使得那些宝贵的系统资源——如 CPU 和 RAM——尽量少占用,以便用于多媒体制作。目前,[Ubuntu Studio](https://ubuntustudio.org/tour/) 对多媒体制作的支持最好。它使用了 Xfce 桌面环境,并且有各种各样的音频、视频以及图像编辑应用。 ## 最好的企业发行版:SLE/RHEL @@ -93,13 +93,13 @@ Snappy Ubuntu Core 为物联网 (IoT) 及此类设备而生的 Linux 操作系 ## 最好的移动操作系统:Plasma Mobile -尽管,基于 Linux 的 Android 系统称雄于移动操作系统市场,但是大多数的开源社区 —— 也包括我在内 —— 也仍然强烈希望能有一个发行版能够为移动设备提供传统 Linux 的桌面应用。同时,这样的一个发行版由开源社区来维护会比由商业公司来维护好的多,只有这样用户群才能成为这个发行版的焦点,而不应该由公司的商业目标来决定这个发行版的发展趋势。而 KDE 的 [Plasma Mobile](https://community.kde.org/Plasma/Mobile) 刚好实现了我们的愿望。 +尽管,基于 Linux 的 Android 系统称雄于移动操作系统市场,但是大多数的开源社区——也包括我在内——也仍然强烈希望能有一个发行版能够为移动设备提供传统 Linux 的桌面应用。同时,这样的一个发行版由开源社区来维护会比由商业公司来维护好的多,只有这样用户群才能成为这个发行版的焦点,而不应该由公司的商业目标来决定这个发行版的发展趋势。而 KDE 的 [Plasma Mobile](https://community.kde.org/Plasma/Mobile) 刚好实现了我们的愿望。 这个基于 Kubuntu 的发行版始于 2015 年。因为 KDE 社区以坚守标准和为公众开发应用而闻名,我非常期待 Plasma Mobile 能够一直坚持下去。 ## 为 ARM 设备而生的发行版:Arch Linux ARM -随着 Android 系统的成功,我们的生活也围绕者越来越多的 ARM 设备 —— 从树莓派 (Raspberry Pi) 到 Chromebook 以及 Nvidia Shield。为 Intel/AMD 架构的 CPU 而编写的传统发行版并不能够在这些 ARM 架构的设备上运行。而一些为 ARM 而编写的发行版却仅仅只能在特定的硬件上运行,比如只能运行在树莓派 (Raspberry Pi) 上的 Raspbian 系统。这就是 [Arch Linux ARM](http://archlinuxarm.org/) (ALARM) 的闪光点所在。它是一个基于 Arch Linux 的纯社区支持的发行版,可以在树梅派 (Raspberry Pi)、Chromebook、Android 设备以及 Nvidia Shield 等设备上运行。同时,也由于 AUR,该发行版变得更加有趣,你可以安装很多在其他发行版可能无法获取的软件。 +随着 Android 系统的成功,我们的生活也围绕者越来越多的 ARM 设备——从树莓派 (Raspberry Pi) 到 Chromebook 以及 Nvidia Shield。为 Intel/AMD 架构的 CPU 而编写的传统发行版并不能够在这些 ARM 架构的设备上运行。而一些为 ARM 而编写的发行版却仅仅只能在特定的硬件上运行,比如只能运行在树莓派 (Raspberry Pi) 上的 Raspbian 系统。这就是 [Arch Linux ARM](http://archlinuxarm.org/) (ALARM) 的闪光点所在。它是一个基于 Arch Linux 的纯社区支持的发行版,可以在树梅派 (Raspberry Pi)、Chromebook、Android 设备以及 Nvidia Shield 等设备上运行。同时,也由于 AUR,该发行版变得更加有趣,你可以安装很多在其他发行版可能无法获取的软件。 ## 结论 From 51dbcd09e3799274318425e3021e4f93cf6d641d Mon Sep 17 00:00:00 2001 From: mudongliang Date: Sun, 21 Feb 2016 20:34:13 +0800 Subject: [PATCH 0391/1469] Translated --- ...ux Mint 18 Will Get Its Own Set Of Apps.md | 56 +++++++++---------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/sources/tech/20160220 Linux Mint 18 Will Get Its Own Set Of Apps.md b/sources/tech/20160220 Linux Mint 18 Will Get Its Own Set Of Apps.md index 6846dbf49d..e2ee3073b9 100644 --- a/sources/tech/20160220 Linux Mint 18 Will Get Its Own Set Of Apps.md +++ b/sources/tech/20160220 Linux Mint 18 Will Get Its Own Set Of Apps.md @@ -1,62 +1,60 @@ -mudongliang - -Linux Mint 18 Will Get Its Own Set Of Apps +Linux Mint 18 将会得到自己的应用集 ============================================= ![](http://itsfoss.com/wp-content/uploads/2016/01/Linux-Mint-apps.jpg) -It’s common for distro developers to create and release a series of apps that are designed specifically for their distros. A big example of this is [elementary OS](https://elementary.io/). Nine years in, Linux Mint is finally taking the plunge and doing the same. +对于发行版开发者来说,创建和发布一系列专为他们发行版设计的应用是再平常不过的事情。一个很大的例子就是 [elementary OS](https://elementary.io/) 。九年的投入,Linux Mint 终于孤注一掷做了相同的事情。 ->#LinuxMint to finally get its own apps in Mint 18. +>#LinuxMint 终将在 Mint 18 中得到自己的应用。 -[Linux Mint](http://www.linuxmint.com/) is one of the best known Linux distros available. Based on Ubuntu and Debian, Linux Mint strives to create a “modern, elegant and comfortable operating system which is both powerful and easy to use”. The team behind Linux Mint is also very involved with the [MATE](http://itsfoss.com/install-mate-desktop-ubuntu-14-04/) and [Cinnamon](http://itsfoss.com/install-cinnamon-ubuntu-14-04/) desktop environments. +[Linux Mint](http://www.linuxmint.com/) 是目前可用的最著名的 Linux 发行版之一。基于 Ubuntu 和 Debian,Linux Mint 努力去创建一个现代的,优雅的,舒适的操作系统,同时强大而易于使用。(LCTT 注:Linux Mint 基于 Ubuntu,而 Linux Mint Debian Edition 基于 Debian。)Linux Mint 背后的团队同时也积极参与 [MATE](http://itsfoss.com/install-mate-desktop-ubuntu-14-04/) 和 [Cinnamon](http://itsfoss.com/install-cinnamon-ubuntu-14-04/) 桌面环境开发。 -## First X-Men, now X-Apps +## 原来的 X-Men,现在的 X-Apps -Thursday, Linux Mint project lead Clement Lefebvre [announced](http://blog.linuxmint.com/?p=2985) the creation of the X-Apps. The X-Apps are designed to be desktop-agnostic so that developers can update them without having to tweak them for each desktop environment. Lefebvre stated that these X-Apps would be used as default applications for Cinnamon, MATE and Xfce. +周四 Linux Mint 项目领导者 Clement Lefebvre [宣布](http://blog.linuxmint.com/?p=2985) X-Apps 的创建。X-Apps 被设计为桌面无关以便开发者可以直接更新它们而不必针对每一种桌面环境做调整。Lefebvre 声明这些 X-Apps 将会被作为 Cinnamon,MATE 和 Xfce 桌面环境的默认应用。 -## Does Linux Need Even More Apps? +## Linux是否需要更多的应用? -According to Lefebvre, the creation of the X-Apps was necessitated by the release of GNOME 3.18. He said that with the release of GNOME 3.18: +据 Lefebvre 所述,X-Apps 的创建被 GNOME 3.18 发布所需。对于 GNOME 3.18 的发布,他这样说: + +> “GTK 本身和一些 GNOME 应用都在 GNOME SHELL 上集成地很好,而且看起来很有本地风格。坏消息就是它们在任何别的地方看起来很不相称。使事情变得更糟的是,Unity,Ubuntu的旗舰产品,重度依赖 GTK,GNOME 应用,GNOME 环境本身,所以我们这里才不处理上游的 3.18 版本,但是这一系列的补丁带来它们自己的问题(举一个例子,Ubuntu 在应用中重新引入菜单条和标题栏,但是不重写它们的头部栏..所以你有时会看到它们三者一起出现)。” -> “GTK itself and many of the GNOME applications now integrate better with GNOME Shell and look more native in that environment. The bad news, is that they now look completely out of place everywhere else. To make matters worse, Unity, the flagship product of Ubuntu, relies heavily on GTK, GNOME applications and the GNOME environment itself, so we’re not dealing with the upstream version of 3.18 here, but with a collection of patches which bring their own issues (one example is that Ubuntu reintroduces menubars and titlebars in applications but without rewriting their headerbar.. so you sometimes see all three of them).” +在过去,Linux Mint 团队通过“应用降级(例如 Linux Mint 17 使用 gedit 2.30),给 GNOME 打补丁以及使用替代品(大部分在 MATE 和 Xfce)”来处理这个问题。 -In the past, the Linux Mint team dealt with the problem by “downgrading apps (Linux Mint 17 uses gedit 2.30 for instance), patching GNOME (GTK and various GNOME apps) and using alternatives (mostly in MATE and Xfce)”. +Lefebvre也说为 Cinnamon 和 MATE 构建特定应用没有意义。这就是为什么他们选择开发那些一般的,完美适应地运行在 Cinnamon,MATE 和 Xfce(以及其他可能的桌面环境)。 -Lefebvre also said that it didn’t make sense to build specific applications for Cinnamon and MATE this is why they opted to work on apps which would be generic, perfectly suited to run in Cinnamon, MATE and Xfce (and possibly other desktop environments). +他进一步添加到: -He further added: +>“X-Apps 将会是一个通用的,使用传统的接口 GTK3 应用的集合。它将会被作为 Cinnamon,MATE 和 Xfce 默认的桌面组件。在 Mint 18 中,“X apps” 将允许我们去维护一个本地样子和好的集成标准。因为它们将会被用于替代看起来很外地的 GNOME 桌面应用。长期来讲,X-App 项目将会允许我们去创新和开发更多的,应用本身的特色和提高(这是一些我们无法通过打补丁,临时的复制或者特定桌面的复制,比如说 MATE 桌面应用做到的事情,因为它代价太高)。” ->"X-Apps will be a collection of generic GTK3 applications using traditional interfaces which can be used as default desktop components in Cinnamon, MATE and Xfce. In Mint 18, the “X apps” will allow us to maintain a native look and a good level of integration because they will be used in replacement of GNOME applications which now look foreign (using headerbars and a distinctive layout). Long-term, the X-App project will allow us to innovate and to develop new features and improvements in the applications themselves (this is something we couldn’t do via patches, temporary forks or DE-specific forks like the MATE apps because it was too costly)." - -## What Kind of Apps Will Be Available? +## 什么类型的应用将会可用? ![](http://itsfoss.com/wp-content/uploads/2016/01/xedit.png) -Lefebvre only revealed one of the upcoming X-Apps: a text editor named xedit. Here are some of the feature that it will provide: +Lefebvre 只透露其中一个即将来临的 X-Apps:一个名为 xedit 的文本编辑器。下面是这个软件提供的一些特性: + +- 基于 Pluma 去降低学习曲线 +- 使用 GTK3 +- 不依赖 GNOME 或 MATE -- Based on Pluma to lower learning curve -- Makes use of GTK3 -- Doesn’t depend on GNOME or MATE +## 何时 -## When +X-Apps 将会和 [Linux Mint 18](http://itsfoss.com/linux-mint-18-codenamed-sarah/) 一同到来。而 Linux Mint 18 将会在 Ubuntu 16.04 LTS 发布之后数月后发布。[Ubuntu 16.04 LTS 计划于四月发布。](http://itsfoss.com/ubuntu-1604-release-schedule/) -The X-Apps will be coming together with [Linux Mint 18 release](http://itsfoss.com/linux-mint-18-codenamed-sarah/), which will follow the release of Ubuntu 16.04 LTS by several months. [Ubuntu 16.04 is scheduled to release in April](http://itsfoss.com/ubuntu-1604-release-schedule/). +## 最终想法 -## Final Thoughts +就我而言,无论何时当我听见某人发布一个新发行版特定的应用,我都会局促不安。Linux 世界本身已经难以想象的碎片化了。我们真的需要花费时间和精力去创建更多的副本工程吗?不要误解我,我喜欢桌面无关软件的想法。它将修复大量的关于一个桌面一个应用样子的问题。 -Personally, whenever I hear about someone releasing new distro specific apps, I cringe. The Linux universe is already incredibly fragmented. Do we really need more duplicate projects to take time and energy to create? Don’t get me wrong, I like the idea of desktop-agnostic apps. It would fix a lot of problems with how apps look from distro to distro. +使我发愁的问题是“它们是否会成功?”。正如我之前所说,Linux Mint 团队成员也在两种桌面环境工作。目前去添加应用开发来混合。我自己没有写过一个软件(除了 Hello World),但是我知道当你尝试且使一个项目复杂化,不好的事情将会发生。许多项目已经变成了不断膨胀的巨龙。我希望这样的事不要发生在这里。 -The problem that worries me is “Will they be able to pull it off?” As I stated before, the Linux Mint guys also work on two desktop environments. Now add application development to the mix. I’ve never written a piece of software myself (other than one that said “Hello, World”), but I do know that when you try and complicate a project bad things happen. Many projects have fallen to the dragon of feature creep I hope that doesn’t happen here. - -Do you have a different take? Let me know in the comments below. +你有不同的想法吗?在下方评论以便让我知道。 ------------------------------------------------------------------------------ via: http://itsfoss.com/linux-mint-own-apps/ 作者:[JOHN PAUL][a] -译者:[译者ID](https://github.com/译者ID) +译者:[mudongliang](https://github.com/mudongliang) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 52fe4ccb7f8cba04e4299649903a1cea437a673d Mon Sep 17 00:00:00 2001 From: mudongliang Date: Sun, 21 Feb 2016 20:39:20 +0800 Subject: [PATCH 0392/1469] remove translated file to the translated directory --- .../tech/20160220 Linux Mint 18 Will Get Its Own Set Of Apps.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20160220 Linux Mint 18 Will Get Its Own Set Of Apps.md (100%) diff --git a/sources/tech/20160220 Linux Mint 18 Will Get Its Own Set Of Apps.md b/translated/tech/20160220 Linux Mint 18 Will Get Its Own Set Of Apps.md similarity index 100% rename from sources/tech/20160220 Linux Mint 18 Will Get Its Own Set Of Apps.md rename to translated/tech/20160220 Linux Mint 18 Will Get Its Own Set Of Apps.md From a96939a54f221b1df766fb27dd7e7b8b69740668 Mon Sep 17 00:00:00 2001 From: carolinewuyan <309866211@qq.com> Date: Mon, 22 Feb 2016 00:14:05 +0800 Subject: [PATCH 0393/1469] =?UTF-8?q?=E5=B7=B2=E6=A0=A1=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20151204 Review EXT4 vs. Btrfs vs. XFS.md | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/translated/share/20151204 Review EXT4 vs. Btrfs vs. XFS.md b/translated/share/20151204 Review EXT4 vs. Btrfs vs. XFS.md index b2e71c0da3..7f93b149ba 100644 --- a/translated/share/20151204 Review EXT4 vs. Btrfs vs. XFS.md +++ b/translated/share/20151204 Review EXT4 vs. Btrfs vs. XFS.md @@ -1,8 +1,8 @@ -EXT4、Btrfs、XFS 文件系统回顾 +EXT4,Btrfs和XFS 文件系统之点评 ================================================================================ ![](http://1426826955.rsc.cdn77.org/wp-content/uploads/2015/09/1385698302_funny_linux_wallpapers-593x445.jpg) -老实说,人们最不曾考虑的问题之一是他们的个人电脑中使用了什么文件系统。Windows 和 Mac OS X 用户更没有理由去考虑,因为对于他们的操作系统,只有一种选择,那就是 NTFS 和 HFS+。相反,对于 Linux 系统而言,有很多种文件系统可以选择,现在默认的是广泛采用的 ext4。然而,现在也有改用一种称为 btrfs 文件系统的趋势。那是什么使得 btrfs、或者其它文件系统变得更优秀呢?什么时候我们又能看到 Linux 发行版作出改变呢? +老实说,人们最不曾考虑的问题之一是他们的个人电脑中使用了什么文件系统。Windows 和 Mac OS X 用户更没有理由去考虑,因为对于他们的操作系统,只有一种选择,那就是 NTFS 和 HFS+。相反,对于 Linux 系统而言,有很多种文件系统可以选择,现在默认的是广泛采用的 ext4。然而,现在也有改用一种称为 btrfs 文件系统的趋势。那是什么使得 btrfs更优秀,其它的文件系统又是什么,什么时候我们又能看到 Linux 发行版作出改变呢? 首先让我们对文件系统以及它们真正干什么有个总体的认识,然后我们再对一些有名的文件系统做详细的比较。 @@ -12,46 +12,45 @@ EXT4、Btrfs、XFS 文件系统回顾 ### 为什么要分区? ### -由于每个操作系统都能创建或者删除分区,很多人对分区都有模糊的认识。Linux 操作系统在同一块磁盘上使用多个分区,就算使用标准安装过程,这看起来很奇怪,因此需要一些解释。拥有不同分区的一个主要目的就是为了在灾难发生时能获得更好的数据安全性。 +由于每个操作系统都能创建或者删除分区,很多人对分区都有模糊的认识。Linux 操作系统在同一块磁盘上即便使用标准安装过程,仍可以使用多个分区,这看起来很奇怪,因此需要一些解释。拥有不同分区的一个主要目的就是为了在灾难发生时能获得更好的数据安全性。 -通过将硬盘划分为分区,数据会被分隔以及重组。当事故发生的时候,只有存储在被损坏分区的数据会被破坏,很大可能上其它分区的数据能得以保留。这个原因可以追溯到 Linux 操作系统还没有日志文件系统,任何掉电都有可能导致灾难发生的时候。 +通过将硬盘划分为分区,数据会被分隔以及重组。当事故发生的时候,只有存储在被损坏分区的数据会被破坏,很大可能上其它分区的数据能得以保留。这个原因可以追溯到 Linux 操作系统还没有日志文件系统,任何电力故障都有可能导致灾难发生的时候。 使用分区也考虑到了安全和健壮性原因,因此操作系统部分损坏并不意味着整个计算机就有风险或者会受到破坏。这也是当前采用分区的一个最重要因素。举个例子,用户创建了一些会填满磁盘的脚本、程序或者 web 应用,如果该磁盘只有一个大的分区,如果磁盘满了那么整个系统就不能工作。如果用户把数据保存在不同的分区,那么就只有那个分区会受到影响,而系统分区或者其它数据分区仍能正常运行。 记住,拥有一个日志文件系统只能在掉电或者和存储设备意外断开连接时提供数据安全性,并不能在文件系统出现坏块或者发生逻辑错误时保护数据。对于这种情况,用户可以采用廉价磁盘冗余阵列(RAID:Redundant Array of Inexpensive Disks)的方案。 -### 为什么要选择文件系统? ### +### 为什么要改变文件系统? ### ext4 文件系统由 ext3 文件系统改进而来,而后者又是从 ext2 文件系统改进而来。虽然 ext4 文件系统已经非常稳定,是过去几年中绝大部分发行版的默认选择,但它是基于陈旧的代码开发而来。另外, Linux 操作系统用户也需要很多 ext4 文件系统本身不提供的新功能。虽然通过某些软件能满足这种需求,但性能会受到影响,在文件系统层次做到这些能获得更好的性能。 ### Ext4 文件系统 ### -ext4 还有一些令人印象深刻的限值。最大文件大小是 16tebibytes(大概是 17.6 terabytes),这比普通用户当前能买到的硬盘还要大。使用 ext4 能创建的最大卷/分区是 1 exbibyte(大概是 1,152,921.5 terabytes)。通过使用多种技巧, ext4 比 ext3 有很大的速度提升。类似一些最先进的文件系统,它是一个日志文件系统,意味着它会对文件在磁盘中的位置以及任何其它对磁盘的更改做记录。纵观它的所有功能,它还不支持透明压缩、重复数据删除或者透明加密。技术上支持了快照,但该功能还处于实验性阶段。 +ext4 还有一些明显的限值。最大文件大小是 16tebibytes(大概是 17.6 terabytes),这比普通用户当前能买到的硬盘还要大的多。使用 ext4 能创建的最大卷/分区是 1 exbibyte(大概是 1,152,921.5 terabytes)。通过使用多种技巧, ext4 比 ext3 有很大的速度提升。类似一些最先进的文件系统,它是一个日志文件系统,意味着它会对文件在磁盘中的位置以及任何其它对磁盘的更改做记录。纵观它的所有功能,它还不支持透明压缩、重复数据删除或者透明加密。技术上支持了快照,但该功能还处于实验性阶段。 ### Btrfs 文件系统 ### -btrfs 有很多不同的发音,例如 Better FS、Butter FS 或者 B-Tree FS。它是一个几乎完全从头开发的文件系统。btrfs 存在的原因是它的开发者期初希望扩展文件系统的功能使得它包括快照、池化、校验以及其它一些功能。虽然和 ext4 无关,它也希望能保留 ext4 中能使消费者和商家受益的功能,并整合额外的能使每个人、尤其是企业受益的功能。对于使用大型软件以及大规模数据库的企业,对于多种不同的硬盘看起来一致的文件系统能使他们受益并且使数据整合变得更加简单。删除重复数据能降低数据实际使用的空间,当需要镜像一个单一和广泛文件系统时使用 btrfs 也能使数据镜像变得简单。 +btrfs 有很多不同的发音,例如 Better FS、Butter FS 或者 B-Tree FS。它是一个几乎完全从头开发的文件系统。btrfs 存在的原因是它的开发者期初希望扩展文件系统的功能使得它包括快照、池化、校验以及其它一些功能。虽然和 ext4 无关,它也希望能保留 ext4 中能使消费者和商家受益的功能,并整合额外的能使每个人,尤其是企业受益的功能。对于使用大型软件以及大规模数据库的企业,对于多种不同的硬盘看起来一致的文件系统能使他们受益并且使数据整合变得更加简单。删除重复数据能降低数据实际使用的空间,当需要镜像一个单一和广泛文件系统时使用 btrfs 也能使数据镜像变得简单。 -用户当然可以继续选择创建多个分区从而无需镜像任何东西。考虑到这种情况,btrfs 能横跨多种硬盘,和 ext4 相比,它能支持 16 倍多的驱动空间。btrfs 文件系统一个分区最大是 16 exbibytes,最大的文件大小也是 16 exbibytes。 +用户当然可以继续选择创建多个分区从而无需镜像任何东西。考虑到这种情况,btrfs 能横跨多种硬盘,和 ext4 相比,它能支持 16 倍以上的驱动空间。btrfs 文件系统一个分区最大是 16 exbibytes,最大的文件大小也是 16 exbibytes。 ### XFS 文件系统 ### -XFS 文件系统是扩展文件系统(extent file system)的扩展。XFS 是 64 位高性能日志文件系统。对 XFS 的支持大概在 2002 年合并到了 Linux 内核,到了 2009 年,红帽企业版 Linux 5.4 也支持了 XFS 文件系统。对于 64 位文件系统,XFS 支持最大文件系统大小为 8 exbibytes。XFS 文件系统有一些缺陷,例如它不能压缩,删除大量文件时性能低下。RHEL 7.0 文件系统默认使用 XFS。 +XFS 文件系统是扩展文件系统(extent file system)的扩展。XFS 是 64 位高性能日志文件系统。对 XFS 的支持大概在 2002 年合并到了 Linux 内核,到了 2009 年,红帽企业版 Linux 5.4 也支持了 XFS 文件系统。对于 64 位文件系统,XFS 支持最大文件系统大小为 8 exbibytes。XFS 文件系统有一些缺陷,例如它不能压缩,删除大量文件时性能低下。目前RHEL 7.0 文件系统默认使用 XFS。 ### 总后总结 ### -不幸的是,还不知道 btrfs 什么时候能到来。官方说,下一代文件系统仍然被归类到“不稳定”,但是如果用户下载最新版本的 Ubuntu,他就可以选择安装到 btrfs 分区上。什么时候 btrfs 会被归类到 “稳定” 仍然是个谜, 直到真的认为它“稳定”之前,用户也不应该期望 Ubuntu 会默认采用 btrfs。有报道说 Fedora 18 会用 btrfs 作为它的默认文件系统,因为到了发布它的时候,应该有了 btrfs 文件系统校验器。由于还没有实现所有的功能,另外和 ext4 相比性能上也比较缓慢, btrfs 还有很多的工作要做。 +不幸的是,还不知道 btrfs 什么时候能到来。官方说,下一代文件系统仍然被归类为“不稳定”,但是如果用户下载最新版本的 Ubuntu,就可以选择安装到 btrfs 分区上。什么时候 btrfs 会被归类到 “稳定” 仍然是个谜, 直到真的认为它“稳定”之前,用户也不应该期望 Ubuntu 会默认采用 btrfs。有报道说 Fedora 18 会用 btrfs 作为它的默认文件系统,因为到了发布它的时候,应该有了 btrfs 文件系统校验器。由于还没有实现所有的功能,另外和 ext4 相比性能上也比较缓慢,btrfs 还有很多的工作要做。 那么,究竟使用哪个更好呢?尽管性能几乎相同,但 ext4 还是赢家。为什么呢?答案在于易用性以及广泛性。对于桌面或者工作站, ext4 仍然是一个很好的文件系统。由于默认提供,用户可以在上面安装操作系统。同时, ext4 支持最大 1 exabytes 的卷和 16 terabytes 的文件,因此考虑到大小,它也还有很大的进步空间。 -btrfs 能提供更大的高达 16 exabytes 的卷以及更好的容错,但是,到现在为止,它感觉更像是一个附加文件系统,而没有集成到 Linux 操作系统。比如,尽管 btrfs 支持不同的发行版,使用 btrfs 格式化硬盘之前先要有 btrfs-tools 工具,这意味着安装 Linux 操作系统的时候它并不是一个可选项。 +btrfs 能提供更大的高达 16 exabytes 的卷以及更好的容错,但是,到现在为止,它感觉更像是一个附加文件系统,而没有集成到 Linux 操作系统。比如,尽管 btrfs 支持不同的发行版,使用 btrfs 格式化硬盘之前先要有 btrfs-tools 工具,这意味着安装 Linux 操作系统的时候它并不是一个可选项,即便不同发行版之间会有差异。 -尽管传输速率非常重要,评价一个文件系统出了文件传输速度之外还有很多因素。btrfs 有很多好用的功能,例如写复制、扩展校验、快照、清洗、数据自治愈、冗余删除以及其它保证数据完整性的功能。和 ZFS 相比 btrfs 缺少 RAID-Z 功能,因此对于 btrfs, RAID 还处于实验性阶段。对于单纯的数据存储,和 ext4 相比 btrfs 似乎更加优秀,但时间会验证一切。 +尽管传输速率非常重要,评价一个文件系统出了文件传输速度之外还有很多因素。btrfs 有很多好用的功能,例如写复制、扩展校验、快照、清洗、自修复数据、冗余删除以及其它保证数据完整性的功能。和 ZFS 相比 btrfs 缺少 RAID-Z 功能,因此对于 btrfs, RAID 还处于实验性阶段。对于单纯的数据存储,和 ext4 相比 btrfs 似乎更加优秀,但时间会验证一切。 迄今为止,对于桌面系统而言,ext4 似乎是一个更好的选择,因为它是默认的文件系统,传输文件时也比 btrfs 更快。btrfs 当然值得尝试、但要在桌面 Linux 上完全取代 ext4 可能还需要一些时间。数据场和大存储池会揭示关于 ext4、XCF 以及 btrfs 不同的故事和差异。 -如果你有其它不同的或者额外的观点、在下面的评论框中告诉我们吧。 -If you have a different or additional opinion, kindly let us know by commenting on this article. +如果你有不同或者其它的观点,在下面的评论框中告诉我们吧。 -------------------------------------------------------------------------------- @@ -59,7 +58,7 @@ via: http://www.unixmen.com/review-ext4-vs-btrfs-vs-xfs/ 作者:[M.el Khamlichi][a] 译者:[ictlyh](http://mutouxiaogui.cn/blog/) -校对:[校对者ID](https://github.com/校对者ID) +校对:[Caroline](https://github.com/carolinewuyan) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c7e9960c5818b5c17114a3a793de5d32d67c1788 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 22 Feb 2016 11:04:05 +0800 Subject: [PATCH 0394/1469] PUB:20160220 Linux Mint 18 Will Get Its Own Set Of Apps @mudongliang @locez @oska874 --- ...ux Mint 18 Will Get Its Own Set Of Apps.md | 60 ++++++++++++++++++ ...ux Mint 18 Will Get Its Own Set Of Apps.md | 62 ------------------- 2 files changed, 60 insertions(+), 62 deletions(-) create mode 100644 published/20160220 Linux Mint 18 Will Get Its Own Set Of Apps.md delete mode 100644 translated/tech/20160220 Linux Mint 18 Will Get Its Own Set Of Apps.md diff --git a/published/20160220 Linux Mint 18 Will Get Its Own Set Of Apps.md b/published/20160220 Linux Mint 18 Will Get Its Own Set Of Apps.md new file mode 100644 index 0000000000..4872f4352a --- /dev/null +++ b/published/20160220 Linux Mint 18 Will Get Its Own Set Of Apps.md @@ -0,0 +1,60 @@ +Linux Mint 18 将拥有自己的应用集 +============================================= + +![](http://itsfoss.com/wp-content/uploads/2016/01/Linux-Mint-apps.jpg) + +对于发行版开发者来说,创建和发布一系列专为他们发行版设计的应用是再平常不过的事情。一个最典型的例子就是 [elementary OS](https://elementary.io/) 。而在经过九年的努力后,Linux Mint 终于孤注一掷做了相同的事情。 + +[Linux Mint](http://www.linuxmint.com/) 是现今最著名的 Linux 发行版之一。其基于 Ubuntu 和 Debian,Linux Mint 努力去创建一个现代的、优雅的、舒适的操作系统,不但强大而且易用。(LCTT 译注:Linux Mint 基于 Ubuntu,而 Linux Mint Debian Edition 基于 Debian。)Linux Mint 背后的团队同时也积极参与 [MATE](http://itsfoss.com/install-mate-desktop-ubuntu-14-04/) 和 [Cinnamon](http://itsfoss.com/install-cinnamon-ubuntu-14-04/) 桌面环境开发。 + +## 前有 X 战警(X-men),后有 X 应用(X-Apps) + +周四, Linux Mint 项目领导者 Clement Lefebvre [宣布](http://blog.linuxmint.com/?p=2985) X-Apps 的创建。X-Apps 被设计为不依赖特定桌面环境,以便开发者可以直接更新它们而不必针对每一种桌面环境做调整。Lefebvre 声明这些 X-Apps 将会被作为 Cinnamon、MATE 和 Xfce 桌面环境的默认应用。 + +## Linux 是否需要更多的应用? + +据 Lefebvre 所述,X-Apps 的创建是因 GNOME 3.18 发布所需。对于 GNOME 3.18 的发布,他这样说: + +> “GTK 本身和一些 GNOME 应用都在 GNOME SHELL 上集成地很好,而且看起来风格很一致。坏消息就是它们在任何别的地方看起来很不相称。使事情变得更糟的是,Ubuntu 的旗舰产品 Unity 重度依赖 GTK、GNOME 应用及 GNOME 环境本身,所以我们这里不能在上游的 3.18 版本中处理,而这一系列的补丁会带来它们自己的问题(举一个例子,Ubuntu 在应用中重新引入菜单条和标题栏,但是不重写它们的头部栏..所以你有时会看到它们三者一起出现)。” + +在过去,Linux Mint 团队通过“应用降级(例如 Linux Mint 17 使用 gedit 2.30),给 GNOME 打补丁以及使用替代品(大部分在 MATE 和 Xfce)”来处理这个问题。 + +Lefebvre 也说为 Cinnamon 和 MATE 构建特定应用没有意义。这就是为什么他们选择开发那些通用的,可以完美地适应运行在 Cinnamon,MATE 和 Xfce(以及其他可能的桌面环境)的应用。 + +他进一步补充道: + +>“X-Apps 将会是一个通用的,使用传统的接口 GTK3 应用的集合。它能被用作 Cinnamon,MATE 和 Xfce 默认的桌面组件。在 Mint 18 中,“X apps” 将允许我们去维护一个本地风格及更高层面的集成。因为它们将会被用于替代看起来很不一致的 GNOME 桌面应用。长期来讲,X-App 项目将会允许我们去开发新的功能和改进应用本身(这是一些我们无法通过打补丁,临时分支或者特定桌面的分支做到的事情,比如说 MATE 桌面应用,因为它代价太高)。” + +## 将会有什么类型的应用? + +![](http://itsfoss.com/wp-content/uploads/2016/01/xedit.png) + +Lefebvre 只透露其中一个即将来临的 X-Apps:一个名为 xedit 的文本编辑器。下面是这个软件提供的一些特性: + +- 基于 Pluma,很容易学会使用 +- 使用 GTK3 +- 不依赖 GNOME 或 MATE + +## 何时呢? + +X-Apps 将会和 [Linux Mint 18](http://itsfoss.com/linux-mint-18-codenamed-sarah/) 一同到来。而 Linux Mint 18 将会在 Ubuntu 16.04 LTS 发布之后数月后发布。[Ubuntu 16.04 LTS 计划于四月发布。](http://itsfoss.com/ubuntu-1604-release-schedule/) + +## 总结 + +就我而言,无论何时当我听见某人发布一个新发行版特定的应用,我都会局促不安。Linux 世界本身已经难以想象的碎片化了。我们真的需要花费时间和精力去创建更多的重复的项目吗?但不要误解我,我喜欢桌面无关软件的想法。它将修复大量的一个桌面一个应用样子的问题。 + +使我发愁的问题是“它们是否会成功?”。正如我之前所说,Linux Mint 团队成员也在两种桌面环境工作。目前增加了应用开发就让这些混在一起了。我自己没有写过一个软件(除了 Hello World),但是我知道当你尝试且使一个项目复杂化,就会发生不好的事情。许多项目已经变成了不断膨胀的恶龙。我希望这样的事不要发生在这里。 + +你有不同的想法吗?在下方评论以便让我知道。 + +------------------------------------------------------------------------------ + +via: http://itsfoss.com/linux-mint-own-apps/ + +作者:[JOHN PAUL][a] +译者:[mudongliang](https://github.com/mudongliang) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/john/ diff --git a/translated/tech/20160220 Linux Mint 18 Will Get Its Own Set Of Apps.md b/translated/tech/20160220 Linux Mint 18 Will Get Its Own Set Of Apps.md deleted file mode 100644 index e2ee3073b9..0000000000 --- a/translated/tech/20160220 Linux Mint 18 Will Get Its Own Set Of Apps.md +++ /dev/null @@ -1,62 +0,0 @@ -Linux Mint 18 将会得到自己的应用集 -============================================= - -![](http://itsfoss.com/wp-content/uploads/2016/01/Linux-Mint-apps.jpg) - -对于发行版开发者来说,创建和发布一系列专为他们发行版设计的应用是再平常不过的事情。一个很大的例子就是 [elementary OS](https://elementary.io/) 。九年的投入,Linux Mint 终于孤注一掷做了相同的事情。 - ->#LinuxMint 终将在 Mint 18 中得到自己的应用。 - -[Linux Mint](http://www.linuxmint.com/) 是目前可用的最著名的 Linux 发行版之一。基于 Ubuntu 和 Debian,Linux Mint 努力去创建一个现代的,优雅的,舒适的操作系统,同时强大而易于使用。(LCTT 注:Linux Mint 基于 Ubuntu,而 Linux Mint Debian Edition 基于 Debian。)Linux Mint 背后的团队同时也积极参与 [MATE](http://itsfoss.com/install-mate-desktop-ubuntu-14-04/) 和 [Cinnamon](http://itsfoss.com/install-cinnamon-ubuntu-14-04/) 桌面环境开发。 - -## 原来的 X-Men,现在的 X-Apps - -周四 Linux Mint 项目领导者 Clement Lefebvre [宣布](http://blog.linuxmint.com/?p=2985) X-Apps 的创建。X-Apps 被设计为桌面无关以便开发者可以直接更新它们而不必针对每一种桌面环境做调整。Lefebvre 声明这些 X-Apps 将会被作为 Cinnamon,MATE 和 Xfce 桌面环境的默认应用。 - -## Linux是否需要更多的应用? - -据 Lefebvre 所述,X-Apps 的创建被 GNOME 3.18 发布所需。对于 GNOME 3.18 的发布,他这样说: - -> “GTK 本身和一些 GNOME 应用都在 GNOME SHELL 上集成地很好,而且看起来很有本地风格。坏消息就是它们在任何别的地方看起来很不相称。使事情变得更糟的是,Unity,Ubuntu的旗舰产品,重度依赖 GTK,GNOME 应用,GNOME 环境本身,所以我们这里才不处理上游的 3.18 版本,但是这一系列的补丁带来它们自己的问题(举一个例子,Ubuntu 在应用中重新引入菜单条和标题栏,但是不重写它们的头部栏..所以你有时会看到它们三者一起出现)。” - -在过去,Linux Mint 团队通过“应用降级(例如 Linux Mint 17 使用 gedit 2.30),给 GNOME 打补丁以及使用替代品(大部分在 MATE 和 Xfce)”来处理这个问题。 - -Lefebvre也说为 Cinnamon 和 MATE 构建特定应用没有意义。这就是为什么他们选择开发那些一般的,完美适应地运行在 Cinnamon,MATE 和 Xfce(以及其他可能的桌面环境)。 - -他进一步添加到: - ->“X-Apps 将会是一个通用的,使用传统的接口 GTK3 应用的集合。它将会被作为 Cinnamon,MATE 和 Xfce 默认的桌面组件。在 Mint 18 中,“X apps” 将允许我们去维护一个本地样子和好的集成标准。因为它们将会被用于替代看起来很外地的 GNOME 桌面应用。长期来讲,X-App 项目将会允许我们去创新和开发更多的,应用本身的特色和提高(这是一些我们无法通过打补丁,临时的复制或者特定桌面的复制,比如说 MATE 桌面应用做到的事情,因为它代价太高)。” - -## 什么类型的应用将会可用? - -![](http://itsfoss.com/wp-content/uploads/2016/01/xedit.png) - -Lefebvre 只透露其中一个即将来临的 X-Apps:一个名为 xedit 的文本编辑器。下面是这个软件提供的一些特性: - -- 基于 Pluma 去降低学习曲线 -- 使用 GTK3 -- 不依赖 GNOME 或 MATE - -## 何时 - -X-Apps 将会和 [Linux Mint 18](http://itsfoss.com/linux-mint-18-codenamed-sarah/) 一同到来。而 Linux Mint 18 将会在 Ubuntu 16.04 LTS 发布之后数月后发布。[Ubuntu 16.04 LTS 计划于四月发布。](http://itsfoss.com/ubuntu-1604-release-schedule/) - -## 最终想法 - -就我而言,无论何时当我听见某人发布一个新发行版特定的应用,我都会局促不安。Linux 世界本身已经难以想象的碎片化了。我们真的需要花费时间和精力去创建更多的副本工程吗?不要误解我,我喜欢桌面无关软件的想法。它将修复大量的关于一个桌面一个应用样子的问题。 - -使我发愁的问题是“它们是否会成功?”。正如我之前所说,Linux Mint 团队成员也在两种桌面环境工作。目前去添加应用开发来混合。我自己没有写过一个软件(除了 Hello World),但是我知道当你尝试且使一个项目复杂化,不好的事情将会发生。许多项目已经变成了不断膨胀的巨龙。我希望这样的事不要发生在这里。 - -你有不同的想法吗?在下方评论以便让我知道。 - ------------------------------------------------------------------------------- - -via: http://itsfoss.com/linux-mint-own-apps/ - -作者:[JOHN PAUL][a] -译者:[mudongliang](https://github.com/mudongliang) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://itsfoss.com/author/john/ From 6468ca248c80bd87cd4df640b8630815194678e6 Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 22 Feb 2016 11:57:23 +0800 Subject: [PATCH 0395/1469] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=80=89=E9=A2=98?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ng List of Raspberry Pi 2 Distributions.md | 50 ++++++++++++++----- 1 file changed, 37 insertions(+), 13 deletions(-) diff --git a/sources/tech/20160218 Tizen 3.0 Joins Growing List of Raspberry Pi 2 Distributions.md b/sources/tech/20160218 Tizen 3.0 Joins Growing List of Raspberry Pi 2 Distributions.md index 5203be38d8..ee98887448 100644 --- a/sources/tech/20160218 Tizen 3.0 Joins Growing List of Raspberry Pi 2 Distributions.md +++ b/sources/tech/20160218 Tizen 3.0 Joins Growing List of Raspberry Pi 2 Distributions.md @@ -1,32 +1,32 @@ Tizen 3.0 Joins Growing List of Raspberry Pi 2 Distributions ============================================================== -Last week’s news that Tizen 3.0 has been ported to the Raspberry Pi 2 Model B is the latest example of how the year-old ARMv7 version of the Pi is attracting ports from more powerful Linux distributions, most notably Fedora, Ubuntu MATE, and Snappy. The [Samsung Open Source Group’s Tizen for Pi](http://blogs.s-osg.org/bringing-tizen-to-a-raspberry-pi-2-near-you/) project has been underway for several years, achieving several beta releases, and now the effort has shifted to the new Tizen 3.0. It’s still in beta, but now you can create builds for the Pi 2 using tools from the [Yocto](https://www.yoctoproject.org/) Project and [OpenEmbedded project](http://www.openembedded.org/wiki/Main_Page). +Last week’s news that Tizen 3.0 has been ported to the Raspberry Pi 2 Model B is the latest example of how the year-old ARMv7 version of the Pi is attracting ports from more powerful Linux distributions, most notably Fedora, Ubuntu MATE, and Snappy. The [Samsung Open Source Group’s Tizen for Pi][1] project has been underway for several years, achieving several beta releases, and now the effort has shifted to the new Tizen 3.0. It’s still in beta, but now you can create builds for the Pi 2 using tools from the [Yocto][2] Project and [OpenEmbedded project][3]. -Tizen 3.0 offers performance and security improvements, multiple-user and 64-bit support, and an Internet of Things (IoT) framework. Samsung, the principal backer of the [Linux Foundation hosted Tizen project](https://www.tizen.org/), is using the Pi port to expand the base of developers using Tizen for IoT projects, according to an [IDG News Service post](http://www.cio.com/article/3031812/samsung-hopes-raspberry-pi-can-spread-tizen-os-adoption.html) that reported on the port. +Tizen 3.0 offers performance and security improvements, multiple-user and 64-bit support, and an Internet of Things (IoT) framework. Samsung, the principal backer of the [Linux Foundation hosted Tizen project][4], is using the Pi port to expand the base of developers using Tizen for IoT projects, according to an [IDG News Service post][5] that reported on the port. -Although Samsung finally [shipped a Tizen-based](http://www.linux.com/news/embedded-mobile/mobile-linux/837843-samsung-sells-a-million-tizen-phones-as-mozilla-rethinks-firefox-os) phone in India last summer, and Gear smartwatches continue to use Tizen, the main focus now appears to be on IoT. At CES last month, Samsung [announced](http://www.linux.com/news/embedded-mobile/mobile-linux/877879-linux-based-drones-upstage-other-mobile-gadgets-at-ces) that all of its Tizen-based, 2016 Smart TVs will be able to act as SmartThings home automation hubs, letting users monitor the household while watching TV. +Although Samsung finally [shipped a Tizen-based][6] phone in India last summer, and Gear smartwatches continue to use Tizen, the main focus now appears to be on IoT. At CES last month, Samsung [announced][7] that all of its Tizen-based, 2016 Smart TVs will be able to act as SmartThings home automation hubs, letting users monitor the household while watching TV. ## The Growing List of Pi Distros -[Elinux.org](http://elinux.org/RPi_Distributions) lists some 46 ARMv6-ready distributions that run on all the Raspberry Pi boards. A separate listing notes two ARMv7-only distros that require the ARMv7 Raspberry Pi 2: Ubuntu MATE, which replaces the resource-intensive Unity desktop with the Gnome 2.0 flavored MATE, and Windows 10 IoT Core. The prominent placement of a Microsoft distribution is not as controversial as one might have thought. To many younger Linux developers and casual Pi hackers, Microsoft is just another tech company, not so much the evil empire loathed by old-time Linux hackers. +[Elinux.org][8] lists some 46 ARMv6-ready distributions that run on all the Raspberry Pi boards. A separate listing notes two ARMv7-only distros that require the ARMv7 Raspberry Pi 2: Ubuntu MATE, which replaces the resource-intensive Unity desktop with the Gnome 2.0 flavored MATE, and Windows 10 IoT Core. The prominent placement of a Microsoft distribution is not as controversial as one might have thought. To many younger Linux developers and casual Pi hackers, Microsoft is just another tech company, not so much the evil empire loathed by old-time Linux hackers. -Windows 10 IoT Core isn’t the only non-Linux distro running on the Pi. There’s also the Unix-like FreeBSD and NetBSD, as well as the revived RISC OS Pi version of the old Acorn Computers OS. Some of the 48 operating systems on the Elinux.org list are incomplete, out-of-date, or dedicated to limited niches. [DistroWatch](https://distrowatch.com/search.php?category=Raspberry+Pi) offers a more manageable list of 20. +Windows 10 IoT Core isn’t the only non-Linux distro running on the Pi. There’s also the Unix-like FreeBSD and NetBSD, as well as the revived RISC OS Pi version of the old Acorn Computers OS. Some of the 48 operating systems on the Elinux.org list are incomplete, out-of-date, or dedicated to limited niches. [DistroWatch][9] offers a more manageable list of 20. -The [Raspberry Pi Foundation](https://www.raspberrypi.org/) still prominently posts a download page for its homegrown, Debian-based Raspbian, in both standard and NOOBS packages. This lightweight distro is still the most popular and typically the highest rated Linux build for the Pi. The Scratch-ready distro is especially equally suited for desktop use and embedded hacking with home automation gear, robots, and other IoT gizmos. Raspbian recently [received an update](http://news.softpedia.com/news/raspbian-gets-experimental-opengl-driver-gpu-now-used-for-acceleration-500152.shtml) with an experimental OpenGL driver for doing hardware acceleration on the VideoCore IV GPU used with the Pi 2’s Broadcom BCM2836 SoC. +The [Raspberry Pi Foundation][10] still prominently posts a download page for its homegrown, Debian-based Raspbian, in both standard and NOOBS packages. This lightweight distro is still the most popular and typically the highest rated Linux build for the Pi. The Scratch-ready distro is especially equally suited for desktop use and embedded hacking with home automation gear, robots, and other IoT gizmos. Raspbian recently [received an update][11] with an experimental OpenGL driver for doing hardware acceleration on the VideoCore IV GPU used with the Pi 2’s Broadcom BCM2836 SoC. -The Pi Foundation also lists several [third-party downloads](https://www.raspberrypi.org/downloads/). In addition to Windows 10 IoT Core and and Ubuntu MATE, the list includes the lightweight, transactionally focused [Snappy Ubuntu Core](http://www.linux.com/news/embedded-mobile/mobile-linux/804659-ubuntu-snappy-leads-mobile-linux-migration-to-iot) for the Pi 2. Canonical is aiming Snappy at those who want an app platform and cloud integration in embedded devices like drones and IoT devices. Snappy also came out last week in a version designed for [Intel NUC mini-PCs](https://insights.ubuntu.com/2016/02/10/ubuntu-core-is-available-for-the-intel-nuc/). The Pi Foundation also posts images for RISC OS and the education-focused PINET. There are also two media center distros related to KODI/XBMC: OSMC and OpenElec. +The Pi Foundation also lists several [third-party downloads][12]. In addition to Windows 10 IoT Core and and Ubuntu MATE, the list includes the lightweight, transactionally focused [Snappy Ubuntu Core][13] for the Pi 2. Canonical is aiming Snappy at those who want an app platform and cloud integration in embedded devices like drones and IoT devices. Snappy also came out last week in a version designed for [Intel NUC mini-PCs][14]. The Pi Foundation also posts images for RISC OS and the education-focused PINET. There are also two media center distros related to KODI/XBMC: OSMC and OpenElec. -In addition to its list of 48 released distros, Elinux.org lists several “announced” distros including Firefox OS, [openSUSE](https://www.reddit.com/r/openSUSE/comments/3hxrz4/opensuse_on_a_raspberry_pi_2_armv7/), Meego MER & XBMC, Puppy, RPi-Buildroot, and Aros. Missing, however, is Tizen, as well as newly announced ports such as [Manjaro-ARM](http://www.linux-arm.info/index.php/1103-hands-on-more-adventures-with-manjaro-arm-for-the-raspberry-pi-2) and the CentOS 7-based [CentOS AltArch 7](http://www.linux-arm.info/index.php/1054-centos-altarch-7-now-available-for-aarch64-powerpc64-powerpc8-le-and-armhfp) for the Pi 2, Banana Pi, and CubieTruck SBCs. +In addition to its list of 48 released distros, Elinux.org lists several “announced” distros including Firefox OS, [openSUSE][15], Meego MER & XBMC, Puppy, RPi-Buildroot, and Aros. Missing, however, is Tizen, as well as newly announced ports such as [Manjaro-ARM][16] and the CentOS 7-based [CentOS AltArch 7][17] for the Pi 2, Banana Pi, and CubieTruck SBCs. ## Android Still Pi in the Sky -Elinux.org’s “announced” list also includes Android and a Miracast-like program called Android Transporter. People have been trying to port Android to the Pi for years; yet, even with the more suitable [Pi 2](http://www.linux.com/news/embedded-mobile/mobile-linux/807087-faster-raspberry-pi-2-says-yes-to-ubuntu-and-windows-but-wheres-android) shipping for a year now, Android is still pretty much a no-show. Android can run on lower-powered SoCs than the Pi 2’s quad-core, Cortex-A7, but the limited 1GB of RAM and the lack of GPU acceleration are big challenges. Perhaps Raspbian’s OpenGL driver could be ported to Android as well, although the Pi Foundation does not seem very interested in Android. +Elinux.org’s “announced” list also includes Android and a Miracast-like program called Android Transporter. People have been trying to port Android to the Pi for years; yet, even with the more suitable [Pi 2][18] shipping for a year now, Android is still pretty much a no-show. Android can run on lower-powered SoCs than the Pi 2’s quad-core, Cortex-A7, but the limited 1GB of RAM and the lack of GPU acceleration are big challenges. Perhaps Raspbian’s OpenGL driver could be ported to Android as well, although the Pi Foundation does not seem very interested in Android. -There are several Android-for-Pi projects in the works, but without the foundation’s backing, there is still nothing close to a complete port. Projects include an [AOSP Marshmallow](http://www.linux.com/news/embedded-mobile/mobile-linux/886126-tizen-30-joins-growing-list-of-raspberry-pi-2-distros#!topic/android-rpi/YW_gGr8wZkk) patch-set from Peter Yoon, as well as a [RaspAnd](https://extonlinux.wordpress.com/2015/04/05/run-android-5-1-lollipop-exton-build-on-your-raspberry-pi-2/) release based on the Ubuntu-based RaspEx, which makes use of the Aptoide package manager to load some Android 5.1 apps on a Pi 2. The [Razdroid project](https://www.raspberrypi.org/forums/viewtopic.php?f=73&t=19106), which aims to tap into the secrets of Broadcom hardware acceleration, seems to have stalled. +There are several Android-for-Pi projects in the works, but without the foundation’s backing, there is still nothing close to a complete port. Projects include an [AOSP Marshmallow][19] patch-set from Peter Yoon, as well as a [RaspAnd][20] release based on the Ubuntu-based RaspEx, which makes use of the Aptoide package manager to load some Android 5.1 apps on a Pi 2. The [Razdroid project][21], which aims to tap into the secrets of Broadcom hardware acceleration, seems to have stalled. -Most Rasp Pi users, however, appear more interested in [Ubuntu MATE](https://ubuntu-mate.org/raspberry-pi/), which was never optimized for ARMv6, and Fedora. For years, Pi users have run the lightweight spin-down of Fedora called Pidora, but with the Pi 2, they can now try the real thing. The Raspberry Pi Foundation has yet to post Fedora, but the recent [betas of the Pi 2 port](https://chisight.wordpress.com/2015/10/19/fedora-22-or-23-on-raspberry-pi-2/) have received high marks. +Most Rasp Pi users, however, appear more interested in [Ubuntu MATE][22], which was never optimized for ARMv6, and Fedora. For years, Pi users have run the lightweight spin-down of Fedora called Pidora, but with the Pi 2, they can now try the real thing. The Raspberry Pi Foundation has yet to post Fedora, but the recent [betas of the Pi 2 port][23] have received high marks. -Other Linux distributions that regularly make Top Pi distro lists include Arch Linux, which unlike most ports from mature Linux distros, works just fine on ARMv6. A recent [TechRadar Top 5 list](http://www.techradar.com/us/news/software/5-of-the-most-popular-raspberry-pi-distros-1292537) includes several more niche distros in addition to Raspbian. These include the OSMC media player environment, RetroPie for playing classic games, OpenMediaVault for turning your Pi into a NAS, and Pi MusicBox, based on the Mopidy music streaming server. +Other Linux distributions that regularly make Top Pi distro lists include Arch Linux, which unlike most ports from mature Linux distros, works just fine on ARMv6. A recent [TechRadar Top 5 list][24] includes several more niche distros in addition to Raspbian. These include the OSMC media player environment, RetroPie for playing classic games, OpenMediaVault for turning your Pi into a NAS, and Pi MusicBox, based on the Mopidy music streaming server. Beyond Ubuntu, Fedora, and Tizen, other distros, both arcane and general, are heading for the Pi 2, as well. The platform is rapidly expanding the boundaries of, as well as redefining the meaning of, desktop Linux. @@ -40,4 +40,28 @@ via: http://www.linux.com/news/embedded-mobile/mobile-linux/886126-tizen-30-join 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 -[a](http://www.linux.com/community/forums/person/42808) +[a]:http://www.linux.com/community/forums/person/42808 +[1]:http://blogs.s-osg.org/bringing-tizen-to-a-raspberry-pi-2-near-you/ +[2]:https://www.yoctoproject.org/ +[3]:http://www.openembedded.org/wiki/Main_Page +[4]:https://www.tizen.org/ +[5]:http://www.cio.com/article/3031812/samsung-hopes-raspberry-pi-can-spread-tizen-os-adoption.html +[6]:http://www.linux.com/news/embedded-mobile/mobile-linux/837843-samsung-sells-a-million-tizen-phones-as-mozilla-rethinks-firefox-os +[7]:http://www.linux.com/news/embedded-mobile/mobile-linux/877879-linux-based-drones-upstage-other-mobile-gadgets-at-ces +[8]:http://elinux.org/RPi_Distributions +[9]:https://distrowatch.com/search.php?category=Raspberry+Pi +[10]:https://www.raspberrypi.org/ +[11]:http://news.softpedia.com/news/raspbian-gets-experimental-opengl-driver-gpu-now-used-for-acceleration-500152.shtml +[12]:https://www.raspberrypi.org/downloads/ +[13]:http://www.linux.com/news/embedded-mobile/mobile-linux/804659-ubuntu-snappy-leads-mobile-linux-migration-to-iot +[14]:https://insights.ubuntu.com/2016/02/10/ubuntu-core-is-available-for-the-intel-nuc/ +[15]:https://www.reddit.com/r/openSUSE/comments/3hxrz4/opensuse_on_a_raspberry_pi_2_armv7/ +[16]:http://www.linux-arm.info/index.php/1103-hands-on-more-adventures-with-manjaro-arm-for-the-raspberry-pi-2 +[17]:http://www.linux-arm.info/index.php/1054-centos-altarch-7-now-available-for-aarch64-powerpc64-powerpc8-le-and-armhfp +[18]:http://www.linux.com/news/embedded-mobile/mobile-linux/807087-faster-raspberry-pi-2-says-yes-to-ubuntu-and-windows-but-wheres-android +[19]:http://www.linux.com/news/embedded-mobile/mobile-linux/886126-tizen-30-joins-growing-list-of-raspberry-pi-2-distros#!topic/android-rpi/YW_gGr8wZkk +[20]:https://extonlinux.wordpress.com/2015/04/05/run-android-5-1-lollipop-exton-build-on-your-raspberry-pi-2/ +[21]:https://www.raspberrypi.org/forums/viewtopic.php?f=73&t=19106 +[22]:https://ubuntu-mate.org/raspberry-pi/ +[23]:https://chisight.wordpress.com/2015/10/19/fedora-22-or-23-on-raspberry-pi-2/ +[24]:http://www.techradar.com/us/news/software/5-of-the-most-popular-raspberry-pi-distros-1292537 From 64815556c7daf620251ee24ff6de17ba1a1c818a Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 22 Feb 2016 11:59:43 +0800 Subject: [PATCH 0396/1469] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=80=89=E9=A2=98?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...3.0 Joins Growing List of Raspberry Pi 2 Distributions.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sources/tech/20160218 Tizen 3.0 Joins Growing List of Raspberry Pi 2 Distributions.md b/sources/tech/20160218 Tizen 3.0 Joins Growing List of Raspberry Pi 2 Distributions.md index ee98887448..062fcae483 100644 --- a/sources/tech/20160218 Tizen 3.0 Joins Growing List of Raspberry Pi 2 Distributions.md +++ b/sources/tech/20160218 Tizen 3.0 Joins Growing List of Raspberry Pi 2 Distributions.md @@ -1,12 +1,13 @@ Tizen 3.0 Joins Growing List of Raspberry Pi 2 Distributions ============================================================== + Last week’s news that Tizen 3.0 has been ported to the Raspberry Pi 2 Model B is the latest example of how the year-old ARMv7 version of the Pi is attracting ports from more powerful Linux distributions, most notably Fedora, Ubuntu MATE, and Snappy. The [Samsung Open Source Group’s Tizen for Pi][1] project has been underway for several years, achieving several beta releases, and now the effort has shifted to the new Tizen 3.0. It’s still in beta, but now you can create builds for the Pi 2 using tools from the [Yocto][2] Project and [OpenEmbedded project][3]. Tizen 3.0 offers performance and security improvements, multiple-user and 64-bit support, and an Internet of Things (IoT) framework. Samsung, the principal backer of the [Linux Foundation hosted Tizen project][4], is using the Pi port to expand the base of developers using Tizen for IoT projects, according to an [IDG News Service post][5] that reported on the port. Although Samsung finally [shipped a Tizen-based][6] phone in India last summer, and Gear smartwatches continue to use Tizen, the main focus now appears to be on IoT. At CES last month, Samsung [announced][7] that all of its Tizen-based, 2016 Smart TVs will be able to act as SmartThings home automation hubs, letting users monitor the household while watching TV. -## The Growing List of Pi Distros +### The Growing List of Pi Distros [Elinux.org][8] lists some 46 ARMv6-ready distributions that run on all the Raspberry Pi boards. A separate listing notes two ARMv7-only distros that require the ARMv7 Raspberry Pi 2: Ubuntu MATE, which replaces the resource-intensive Unity desktop with the Gnome 2.0 flavored MATE, and Windows 10 IoT Core. The prominent placement of a Microsoft distribution is not as controversial as one might have thought. To many younger Linux developers and casual Pi hackers, Microsoft is just another tech company, not so much the evil empire loathed by old-time Linux hackers. @@ -18,7 +19,7 @@ The Pi Foundation also lists several [third-party downloads][12]. In addition to In addition to its list of 48 released distros, Elinux.org lists several “announced” distros including Firefox OS, [openSUSE][15], Meego MER & XBMC, Puppy, RPi-Buildroot, and Aros. Missing, however, is Tizen, as well as newly announced ports such as [Manjaro-ARM][16] and the CentOS 7-based [CentOS AltArch 7][17] for the Pi 2, Banana Pi, and CubieTruck SBCs. -## Android Still Pi in the Sky +### Android Still Pi in the Sky Elinux.org’s “announced” list also includes Android and a Miracast-like program called Android Transporter. People have been trying to port Android to the Pi for years; yet, even with the more suitable [Pi 2][18] shipping for a year now, Android is still pretty much a no-show. Android can run on lower-powered SoCs than the Pi 2’s quad-core, Cortex-A7, but the limited 1GB of RAM and the lack of GPU acceleration are big challenges. Perhaps Raspbian’s OpenGL driver could be ported to Android as well, although the Pi Foundation does not seem very interested in Android. From f50d7a402ad215892f822164188988acd01cbb78 Mon Sep 17 00:00:00 2001 From: Jonathan Kang Date: Mon, 22 Feb 2016 14:09:21 +0800 Subject: [PATCH 0397/1469] JonathanKang is translating --- .../20160220 [Free Download] Vi Cheat Sheet For Beginners.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160220 [Free Download] Vi Cheat Sheet For Beginners.md b/sources/tech/20160220 [Free Download] Vi Cheat Sheet For Beginners.md index 0a43387984..db69940892 100644 --- a/sources/tech/20160220 [Free Download] Vi Cheat Sheet For Beginners.md +++ b/sources/tech/20160220 [Free Download] Vi Cheat Sheet For Beginners.md @@ -1,3 +1,5 @@ +JonathanKang is translating + [Free Download] Vi Cheat Sheet For Beginners ================================================ From 96f17f73af84fdc2689e640c61d47ede5825bfe4 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 22 Feb 2016 13:58:00 +0800 Subject: [PATCH 0398/1469] PUB:20160218 The Best Linux Distros of 2016 @GHLandy @mudongliang @locez @oska874 --- ...20160218 The Best Linux Distros of 2016.md | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) rename {translated/tech => published}/20160218 The Best Linux Distros of 2016.md (58%) diff --git a/translated/tech/20160218 The Best Linux Distros of 2016.md b/published/20160218 The Best Linux Distros of 2016.md similarity index 58% rename from translated/tech/20160218 The Best Linux Distros of 2016.md rename to published/20160218 The Best Linux Distros of 2016.md index dee100ad70..bfd8ddd640 100644 --- a/translated/tech/20160218 The Best Linux Distros of 2016.md +++ b/published/20160218 The Best Linux Distros of 2016.md @@ -1,21 +1,21 @@ -2016 最佳Linux 发行版 +2016:如何选择 Linux 发行版 ================================ ![](http://www.linux.com/images/stories/66866/distro-opensuse.JPG) -[不管是在企业还是在消费者空间](http://www.cio.com/article/3017983/linux/2015s-most-exciting-linux-devices.html),2015 对于 Linux 来说都是极其重要的一年。作为一个从 2005 年就开始使用 Linux 的老用户,我有幸见证了 Linux 过去这 10 年里的重大发展,[并且,我相信它在 2016 年里会更加令人激动](http://www.cio.com/article/3017177/linux/11-predictions-for-linux-in-2016.html)。在这篇文章里,我会挑选几个将在 2016 年里大放光彩的最佳发行版给大家介绍一下。 +[不管是在企业级应用还是在消费者领域](http://www.cio.com/article/3017983/linux/2015s-most-exciting-linux-devices.html),2015 对于 Linux 来说都是极其重要的一年。作为一个从 2005 年就开始使用 Linux 的老用户,我有幸见证了 Linux 过去这 10 年里的重大发展,[并且,我相信它在 2016 年里会更加令人激动](http://www.cio.com/article/3017177/linux/11-predictions-for-linux-in-2016.html)。在这篇文章里,我会挑选几个将在 2016 年里大放光彩的最佳发行版给大家介绍一下。 -## 最易回归的发行版:openSUSE +## 强势归来的发行版:openSUSE SUSE 是 openSUSE 发行版背后的公司,同时也是起步最早的 Linux 公司;[它在 Linus Torvalds 发布 Linux 的第二年就成立了](http://www.linux.com/news/software/applications/866964-exclusive-interview-with-suse-president-nils-brauckmann)。该公司的成立实际上早于现在的 Linux 公司之王 —— Red Hat。同时 SUSE 也是 [openSUSE](https://www.opensuse.org/) 社区发行版的发起者和赞助商。 2015 年,openSUSE 的开发团队决定向 SUSE Linux 企业版 (SLE) 靠拢,以便让用户可以获得企业服务器特性的发行版——类似于 CentOS 和 Ubuntu 那样。因此,openSUSE 变成了 [openSUSE Leap](https://en.opensuse.org/Portal:Leap),一个直接基于 SLE SP1 的发行版。 -两个发行版共用相同的基础代码,相互受益—— SUSE 会选用 openSUSE 中好的代码,反之亦然。如此,openSUSE 也放弃了原本常规的发布周期,新版本与 SLE 同步发行。这意味着每个版本将会有更长的生命周期。 +两个发行版共用相同的基础代码,相互受益 —— SUSE 会选用 openSUSE 中好的代码,反之亦然。如此,openSUSE 也放弃了原本常规的发布周期,新版本与 SLE 同步发行。这意味着每个版本将会有更长的生命周期。 -这样做的结果是,openSUSE 就成了一个非常重要的发行版,因为潜在的 SLE 用户现在可以使用 openSUSE Leap 了。但也并非完全如此,openSUSE 同样也有发行版 [Tumbleweed](http://www.cio.com/article/3008856/open-source-tools/is-opensuse-tumbleweed-good-enough-for-a-seasoned-arch-user.html) ——一个纯净的滚动式版本。所以,用户们可以选择使用超稳定的 openSUSE Leap 或者经常更新的 openSUSE Tumbleweed。 +这样做的结果是,openSUSE 就成了一个非常重要的发行版,因为潜在的 SLE 用户现在可以使用 openSUSE Leap 了。不过,这还不是全部,openSUSE 同样也有发行版 [Tumbleweed](http://www.cio.com/article/3008856/open-source-tools/is-opensuse-tumbleweed-good-enough-for-a-seasoned-arch-user.html) —— 一个纯净的滚动式版本。所以,用户们可以选择使用很稳定的 openSUSE Leap 或者经常更新的 openSUSE Tumbleweed。 -在我的记忆中,还没有其他的发行版做了这样一个令人印象深刻的回归。 +在我的记忆中,还没有其他的发行版做了这样一个令人印象深刻的强势归来。 ## 最高可定制性的发行版:Arch Linux @@ -27,15 +27,15 @@ Arch Linux 是目前最好的滚动式更新的发行版。好吧,我可能有 - Arch Linux 同时也是最好的滚动式更新的发行版之一。它需要经常保持着更新。用户所运行的基本上是最新的软件,当然,也可以通过非稳定仓库运行预发行版的软件。 -- Arch 闻名于拥有为数众多的优秀文档。Arch Wiki 是我用以了解所有 Linux 相关事情的外带资源。 +- Arch 闻名于拥有为数众多的优秀文档。Arch Wiki 是我用以了解所有 Linux 相关事情的完整资源。 - Arch 中,我最喜欢的是,它提供了“任何”其他发行版中可用的的包和软件,同时还要感谢 AUR (Arch User Repository,Arch 用户仓库)。 ## 最美观的发行版:elementary OS -不同的发行版会有不同的关注点——多数情况下表现为不同的技术。在大多数的 Linux 发行版中,外观和用户感觉并非他们优先考虑的事情 —— 这通常是桌面环境需要考虑的事情。 +不同的发行版会有不同的关注点——多数情况下表现为技术的不同。在大多数的 Linux 发行版中,外观和用户感觉并非他们优先考虑的事情 —— 这通常是桌面环境需要考虑的事情。 -[elementary OS](https://elementary.io/) 正在尝试改变这一事实。在这个发行版中,设计是占据重要位置,并且原因明显——为该发行版取这个名字的开发者要在 Linux 世界里创建一些漂亮的图标。 +[elementary OS](https://elementary.io/) 正在尝试改变这一事实。在这个发行版中,设计是占据重要位置,并且原因明显——这个发行版是由那些以在 Linux 世界创建漂亮图标而闻名的设计人员所开发的。 elementary OS 相当注重整体外观和用户感觉。开发者创建了他们自己的组件,包括桌面环境。此外,他们只会选择那些符合设计规范的应用来加入到软件仓库。你可以发现 elementary OS 有很浓重的 Mac OS X 气息。 @@ -43,17 +43,17 @@ elementary OS 相当注重整体外观和用户感觉。开发者创建了他们 ![](http://www.linux.com/images/stories/66866/distro-solus.JPG) -[Solus](https://solus-project.com/) 最近获得非常大的关注程度。它是一个外观还可以、从零开始构建的操作系统,而并非 Debian 或者 Ubuntu 的衍生版本。它使用的 Budgie 桌面环境同样是从零开始构建的,但它的目标是兼容 Gnome。Solus 和 Google 的 Chrome OS 一样——一切从简。 +[Solus](https://solus-project.com/) 最近获得非常大的关注程度。它是一个看起来中规中矩、从零开始构建的操作系统,它并非 Debian 或者 Ubuntu 的衍生版本。它使用的 Budgie 桌面环境同样是从零开始构建的,但它的目标是兼容 Gnome。Solus 和 Google 的 Chrome OS 一样——一切从简。 我个人没怎么玩过 Solus,但它看起来很有前途。Solus 实际上并不是一个 “新” 系统。它曾以不同的形式和名称存在了很长时间,但直到 2015 年整个项目才以现在这个新名称重归大众视野。 ## 最好的云操作系统:Chrome OS -[Chrome OS](https://www.chromium.org/chromium-os) 可能不会成为你的典型 Linux 发行版,毕竟它是基于浏览器的操作系统,主要用以在线活动。但由于它基于 Linux 以及任何人都可以获取其源码进行编译,它同样是一个吸引人的系统。同时我也每天使用 Chrome OS,它是一个优秀、不用自己维护并且总是最新状态的系统,每个人都可以单纯用它来进行 web 相关的活动。Chrome OS 和 Android 对于推动 Linux 在 PC 市场和移动市场的占有率有着不可或缺的功劳。 +[Chrome OS](https://www.chromium.org/chromium-os) 可能不会成为你的典型 Linux 发行版,毕竟它是基于浏览器的操作系统,主要用以在线使用。但由于它基于 Linux ,任何人都可以获取其源码进行编译,它同样是一个吸引人的系统。我每天都使用 Chrome OS,它是一个优秀、不用自己维护并且总是保持最新状态的系统,每个人都可以单纯地用它来进行 web 相关的用途。Chrome OS 和 Android 对于推动 Linux 在 PC 市场和移动市场的占有率有着不可或缺的功劳。 -## 最好的笔记本操作系统:Ubuntu MATE +## 最好的笔记本计算机操作系统:Ubuntu MATE -大多数的笔记本都没有高端的硬件,假如你运行了一个很耗费资源的桌面环境,那么你可能没有足够的系统资源或电量来维持你的基本使用 —— 因为基本上被系统自身消耗了。于是我找到了 [Ubuntu MATE](http://www.cio.com/article/2848475/ubuntu-mate-enterprise-customers.html) 这个优秀的系统。它是轻量级的环境,但提供了能让你拥有不错体验的所有软件。也幸好它的轻量级设计,大部分的系统资源都留来给你的软件使用,让你依旧可以完成一些繁重的任务。我还发现,它对于一些低端的硬件也同样有很好的支持。 +大多数的笔记本计算机都没有高端的硬件,假如你运行了一个很耗费资源的桌面环境,那么你可能没有足够的系统资源或电量来维持你的使用 —— 因为基本上被操作系统自身消耗了。于是我找到了 [Ubuntu MATE](http://www.cio.com/article/2848475/ubuntu-mate-enterprise-customers.html) 这个优秀的系统。它是轻量级的环境,但提供了能让你拥有不错体验的所有软件。也幸好它的轻量级设计,大部分的系统资源都留来给你的软件使用,让你依旧可以完成一些繁重的任务。我认为它对于低端硬件来说是最好的发行版。 ## 为老旧硬件支持而生的发行版:Lubuntu @@ -63,19 +63,19 @@ elementary OS 相当注重整体外观和用户感觉。开发者创建了他们 ![](http://www.linux.com/images/stories/66866/distro-ubuntu-studio.JPG) -Snappy Ubuntu Core 为物联网 (IoT) 及此类设备而生的 Linux 操作系统。该系统拥有巨大潜力,它可以将我们身边绝大多数的东西 —— 如路由器、咖啡机和玩具飞机等——变成智能设备。让它更有趣的是,软件管理更新的方式以及添加安全性能的模块。 +Snappy Ubuntu Core 是为物联网 (IoT) 及此类设备而生的 Linux 操作系统。该系统拥有巨大潜力,它可以将我们身边绝大多数的东西 —— 如路由器、咖啡机和无人机等——变成智能设备。让它更有趣的是,软件管理更新的方式以及为增加安全而提供的容器化支持。 ## 为桌面系统而生的发行版:Linux Mint Cinnamon -[Linux Mint Cinnamon](http://www.linux.com/news/software/applications/838569-review-linux-mint-172-release/) 对于台式机和一些有强大硬件的笔记本来说是最好的操作系统。我会尽量把它叫做 Linux 世界里的 Mac OS X。老实说,由于 Cinnamon 的不稳定,我在很长一段时间内并不是 Linux Mint 的忠实粉丝。但是,在开发者使用 LTS (Long Term Support,长期支持)作为基础之后,该发行版就变得难以想象的稳定。因为开发者不必花费经历来跟上 Ubuntu 的开发进度,他们现在可以将所有精力放到提升 Cinnamon 上。 +[Linux Mint Cinnamon](http://www.linux.com/news/software/applications/838569-review-linux-mint-172-release/) 对于台式机和一些有强大硬件的笔记本来说是最好的操作系统。我一般把它叫做 Linux 世界里的 Mac OS X。老实说,由于 Cinnamon 的不稳定,我在很长一段时间内并不是 Linux Mint 的忠实粉丝。但是,在开发者使用Ubuntu LTS (Long Term Support,长期支持)作为基础版本之后,该发行版就变得难以想象的稳定。因为开发者不必花费精力来跟上 Ubuntu 的开发进度,他们现在可以将所有精力放到提升 Cinnamon 上。 ## 为游戏而生的发行版:Steam OS -对于桌面版 Linux 来说,玩游戏同样是短板。很多用户为了能够玩游戏,安装了 Linux 和 Windows 双系统。而 Valve 则尝试改变这个局面。Valve 是一个游戏发行商,它提供一个可以跨平台运行游戏的客户端。并且,Valve 也同样创建了它自己的开源操作系统——[Steam OS](http://store.steampowered.com/steamos/)——为了创建一个基于 Linux 的游戏平台。截至 2015 年底,它的合作伙伴开始把搭载了 Steam OS 的机器推向市场。 +对于桌面版 Linux 来说,玩游戏同样是短板。很多用户为了能够玩游戏,安装了 Linux 和 Windows 双系统。而 Valve 则尝试改变这个局面。Valve 是一个游戏发行商,它提供一个可以在不同平台上运行游戏的客户端。并且,Valve 也同样创建了它自己的开源操作系统——[Steam OS](http://store.steampowered.com/steamos/)——为了创建一个基于 Linux 的游戏平台。截至 2015 年底,它的合作伙伴开始把搭载了 Steam OS 的机器推向市场。 ## 为隐私而生的发行版:Tails -在充斥着大量监控和营销者的跟踪 (为目标内容进行的匿名跟踪通常是可接受的)的岁月,隐私就变成主要问题。如果你想脱离政府或者市场机构的监控和跟踪范围,那么你需要一款始终考虑到隐私问题的操作系统。 +在充斥着大量监控和营销者的跟踪 (对目标内容进行的匿名跟踪通常是可接受的)的岁月,隐私保护就变成了一个重要问题。如果你想脱离政府或者市场机构的监控和跟踪,那么你需要一款始终考虑到隐私问题的操作系统。 在出于保护隐私的考虑上,没有任何一款系统可以超越 [Tails](https://tails.boum.org/)。它是一款基于 Debian 的发行版,并且在设计之初就考虑了隐私和匿名的支持。Tails 非常优秀,而且据报道说,NSA 认为这是对他们的监控的主要威胁之一。 @@ -85,21 +85,21 @@ Snappy Ubuntu Core 为物联网 (IoT) 及此类设备而生的 Linux 操作系 ## 最好的企业发行版:SLE/RHEL -企业级用户并不会通过浏览像这样的文章来了解他们的服务器该运行什么发行版。他们通常非常明确该到哪里获取信息:即 [Red Hat Enterprise Linux](https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux) 或 [SUSE Linux Enterprise](https://www.suse.com/)。这两个名字已经成了企业服务器的代名词了。同时,它们背后的公司也都通过创新来推动一切皆容器并且可以进行软件定义。 +企业级用户并不会通过浏览像这样的文章来了解他们的服务器该运行什么发行版。他们通常非常明确地知道该到哪里获取信息:即 [Red Hat Enterprise Linux](https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux) 或 [SUSE Linux Enterprise](https://www.suse.com/)。这两个名字已经成了企业服务器的代名词了。同时,这些公司也都通过创新来推动将一切都容器化和变成软件定义的。 ## 最好的服务器操作系统:Debian/CentOS -假如你在考虑自己运行一台服务器,但有不希望支付 RHEL 或者 SLE 授权的费用,那么 [Debian](https://www.debian.org/) 或者 [CentOS](https://www.centos.org/) 将是你最好的选择。这两个发行版在社区发行版服务器操作系统有着不可动摇的地位。并且它们有着长期支持,你不必担忧需要经常去升级系统。 +假如你在考虑自己运行一台服务器,但有不希望支付 RHEL 或者 SLE 授权的费用,那么 [Debian](https://www.debian.org/) 或者 [CentOS](https://www.centos.org/) 将是你最好的选择。这两个发行版是社区主导的服务器操作系统,具有不可动摇的地位。并且它们有着长期支持,你不必担忧需要经常去升级系统。 ## 最好的移动操作系统:Plasma Mobile -尽管,基于 Linux 的 Android 系统称雄于移动操作系统市场,但是大多数的开源社区——也包括我在内——也仍然强烈希望能有一个发行版能够为移动设备提供传统 Linux 的桌面应用。同时,这样的一个发行版由开源社区来维护会比由商业公司来维护好的多,只有这样用户群才能成为这个发行版的焦点,而不应该由公司的商业目标来决定这个发行版的发展趋势。而 KDE 的 [Plasma Mobile](https://community.kde.org/Plasma/Mobile) 刚好实现了我们的愿望。 +尽管,基于 Linux 的 Android 系统称雄于移动操作系统市场,但是大多数的开源社区——也包括我在内——也仍然强烈希望能有一个发行版可以为移动设备提供传统 Linux 的桌面应用。同时,这样的一个发行版由开源社区来维护会比由商业公司来维护好的多,只有这样,用户才能成为这个发行版的关注点,而不是由公司的商业目标来决定这个发行版的发展趋势。KDE 的 [Plasma Mobile](https://community.kde.org/Plasma/Mobile) 刚好实现了我们的愿望。 这个基于 Kubuntu 的发行版始于 2015 年。因为 KDE 社区以坚守标准和为公众开发应用而闻名,我非常期待 Plasma Mobile 能够一直坚持下去。 ## 为 ARM 设备而生的发行版:Arch Linux ARM -随着 Android 系统的成功,我们的生活也围绕者越来越多的 ARM 设备——从树莓派 (Raspberry Pi) 到 Chromebook 以及 Nvidia Shield。为 Intel/AMD 架构的 CPU 而编写的传统发行版并不能够在这些 ARM 架构的设备上运行。而一些为 ARM 而编写的发行版却仅仅只能在特定的硬件上运行,比如只能运行在树莓派 (Raspberry Pi) 上的 Raspbian 系统。这就是 [Arch Linux ARM](http://archlinuxarm.org/) (ALARM) 的闪光点所在。它是一个基于 Arch Linux 的纯社区支持的发行版,可以在树梅派 (Raspberry Pi)、Chromebook、Android 设备以及 Nvidia Shield 等设备上运行。同时,也由于 AUR,该发行版变得更加有趣,你可以安装很多在其他发行版可能无法获取的软件。 +随着 Android 系统的成功,我们的生活也围绕者越来越多的 ARM 设备——从树莓派 (Raspberry Pi) 到 Chromebook 以及 Nvidia Shield。为 Intel/AMD 架构的 CPU 而编写的传统发行版并不能够在这些 ARM 架构的设备上运行。而一些为 ARM 而编写的发行版却仅仅只能在特定的硬件上运行,比如只能运行在树莓派 (Raspberry Pi) 上的 Raspbian 系统。这就是为什么 [Arch Linux ARM](http://archlinuxarm.org/) (ALARM) 让人眼前一亮的原因。它是一个基于 Arch Linux 的纯粹由社区主导的发行版,可以在树梅派 (Raspberry Pi)、Chromebook、Android 设备以及 Nvidia Shield 等设备上运行。同时,更好的是,也由于 AUR,你可以安装很多在其他发行版可能无法获取的软件。 ## 结论 @@ -111,7 +111,7 @@ via: http://www.linux.com/news/software/applications/878620-the-best-linux-distr 作者:[Swapnil Bhartiya][a] 译者:[GHLandy](https://github.com/GHLandy) -校对:[mudongliang](https://github.com/mudongliang) +校对:[mudongliang](https://github.com/mudongliang),[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 3442410a42843c8d737fe2d58baa763fb8e954e2 Mon Sep 17 00:00:00 2001 From: robot527 Date: Mon, 22 Feb 2016 15:30:56 +0800 Subject: [PATCH 0399/1469] Translating The best open source networking and security software --- ...5--The best open source networking and security software.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sources/share/20151028 Bossie Awards 2015--The best open source networking and security software.md b/sources/share/20151028 Bossie Awards 2015--The best open source networking and security software.md index 129ce3eff4..78c558b1e6 100644 --- a/sources/share/20151028 Bossie Awards 2015--The best open source networking and security software.md +++ b/sources/share/20151028 Bossie Awards 2015--The best open source networking and security software.md @@ -1,3 +1,6 @@ +robot527 translating + + Bossie Awards 2015: The best open source networking and security software ================================================================================ InfoWorld's top picks of the year among open source tools for building, operating, and securing networks From 1dd5c99446d1250d643fc6216ebbc901789bcd45 Mon Sep 17 00:00:00 2001 From: "Fuliang.Li" Date: Mon, 22 Feb 2016 22:31:46 +0800 Subject: [PATCH 0400/1469] =?UTF-8?q?[=E5=BC=80=E5=A7=8B=E7=BF=BB=E8=AF=91?= =?UTF-8?q?]=2020160218=20Best=20Linux=20Desktop=20Environments=20for=2020?= =?UTF-8?q?16?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2016:如何选择 Linux 桌面环境 --- .../tech/20160218 Best Linux Desktop Environments for 2016.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160218 Best Linux Desktop Environments for 2016.md b/sources/tech/20160218 Best Linux Desktop Environments for 2016.md index a93d38c21a..7aef79366b 100644 --- a/sources/tech/20160218 Best Linux Desktop Environments for 2016.md +++ b/sources/tech/20160218 Best Linux Desktop Environments for 2016.md @@ -1,3 +1,5 @@ +GHLandy Translating + Best Linux Desktop Environments for 2016 ============================================= From 81dd542a8fe8e62f25b457a42ed2bfc45aca0087 Mon Sep 17 00:00:00 2001 From: Ezio Date: Tue, 23 Feb 2016 09:50:42 +0800 Subject: [PATCH 0401/1469] =?UTF-8?q?20160223-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...er Tools With Wercker’s Open Source CLI.md | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 sources/tech/20160222 Achieving Enterprise-Ready Container Tools With Wercker’s Open Source CLI.md diff --git a/sources/tech/20160222 Achieving Enterprise-Ready Container Tools With Wercker’s Open Source CLI.md b/sources/tech/20160222 Achieving Enterprise-Ready Container Tools With Wercker’s Open Source CLI.md new file mode 100644 index 0000000000..81f7467719 --- /dev/null +++ b/sources/tech/20160222 Achieving Enterprise-Ready Container Tools With Wercker’s Open Source CLI.md @@ -0,0 +1,80 @@ +Achieving Enterprise-Ready Container Tools With Wercker’s Open Source CLI +=========================================== + +For enterprises, containers offer more efficient build environments, cloud-native applications and migration from legacy systems to the cloud. But enterprise adoption of the technology -- Docker specifically -- has been hampered by, among other issues, [a lack of mature developer tools][1]. + +Amsterdam-based [Wercker][2] is one of many early-stage companies looking to meet the need for better tools with its cloud platform for automating microservices and application development, based on Docker. + +The company [announced a $4.5 million Series A][3] funding round this month, which will help it ramp up development on an upcoming on-premise enterprise product. Key to its success, however, will be building a community around its newly [open-sourced CLI][4] tool. Wercker must quickly integrate with myriad other container technologies -- open source Kubernetes and Mesos among them -- to remain competitive in the evolving container space. + +“By open sourcing our CLI technology, we hope to get to dev-prod parity faster and turn “build once, ship anywhere” into an automated reality,” said Wercker CEO and founder Micha Hernández van Leuffen. + +I reached out to van Leuffen to learn more about the company, its CLI tool, and how it’s planning to help grow the pool of enterprise customers actually using containers in production. Below is an edited version of the interview. + +### Linux.com: Can you briefly tell us about Wercker? + +van Leuffen: Wercker is a container-centric platform for automating the development of microservices and applications. + +With Wercker’s Docker-based infrastructure, teams can increase developer velocity with custom automation pipelines using steps that produce containers as artifacts. Once the build passes, users can continue to deploy the steps as specified in the wercker.yml. Continuously repeating these steps allows teams to work in small increments, making it easy to debug and ship faster. + +![](https://www.linux.com/images/stories/66866/wercker-cli.png) + +### Linux.com: How does it help developers? + +van Leuffen: The Wercker CLI helps developers attain greater dev-prod parity. They’re able to release faster and more often because they are developing, building and testing in an environment very similar to that in production. We’ve open sourced the exact same program that we execute in the Wercker cloud platform to run your pipelines. + +### Linux.com: Can you point out some of the features and advantages of your tool as compared to competitors? + +van Leuffen: Unlike some of our competitors, we’re not just offering Docker support. With Wercker, the Docker container is the unit of work. All jobs run inside containers, and each build artifact can be a Docker container. + +Wercker’s Docker container pipeline is completely customizable. A ‘pipeline’ refers to any automated workflow, for instance, a build or deploy pipeline. In those workflows, you want to execute tasks: install dependencies, test your code, push your container, or create a slack notification when something fails, for example. We call these tasks ‘steps,’ and there is no limit to the types of steps created. In fact, we have a marketplace of steps built by the Wercker community. So if you’ve built a step that fits my workflow, I can use that in my pipeline. + +Our Docker container pipelines adapt to any developer workflow. Users can use any Docker container out there — not just those made by or for Wercker. Whether the container is on Docker Hub or a private registry such as CoreOS’s Quay, it works with Wercker. + +Our competitors range from the classic CI/CD tools to larger-scale DevOps solutions like CloudBees. + +### Linux.com: How does it integrate with other cloud technologies? + +van Leuffen: Wercker is vendor-agnostic and can automate development with any cloud platform or service. We work closely with ecosystem partners like Mesosphere, Kubernetes and CoreOS to make integrations as seamless as possible. We also recently partnered with Atlassian to integrate the Wercker platform with Bitbucket. More than 3 million Bitbucket users can install the Wercker Pipeline Viewer and view build status directly from their dashboard. + +### Linux.com: Why did you open source the Wercker CLI tool? + +van Leuffen: Open sourcing the Wercker CLI will help us stay ahead of the curve and strengthen the developer community. The market landscape is changing fast; developers are expected to release more frequently, using infrastructure of increasing complexity. While Docker has solved a lot of infrastructure problems, developer teams are still looking for the perfect tools to test, build and deploy rapidly. + +The Wercker community is already experimenting with these new tools: Kubernetes, Mesosphere, CoreOS. It makes sense to tap that community to create integrations that work with our technology – and make that process as frictionless as possible. By open sourcing our CLI technology, we hope to get to dev-prod parity faster and turn “build once, ship anywhere” into an automated reality. + +### Linux.com: You recently raised over $4.5 million, so how is this fund being used for product development? + +van Leuffen: We’re focused on building out our commercial team and bringing an enterprise product to market. We’ve had a lot of inbound interest from the enterprise looking for VPC and on-premise solutions. While the enterprise is still largely in the discovery stage, we can see the market shifting toward containers. Enterprise software devs need to release often, just like the small, agile teams with whom they are increasingly competing. We need to prove containers can scale, and that Wercker has the organizational permissions and the automation suite to make that process as efficient as possible. + +In addition to continuing to invest in our product, we’ll be focusing our resources on market education and developer evangelism. Developer teams are still looking for the right mix of tools to test, build and deploy rapidly (including Kubernetes, Mesosphere, CoreOS, etc.). As an ecosystem, we need to do more to educate and provide the tutorials and resources to help developers succeed in this changing landscape. + +### Linux.com: What products do you offer and who is your target audience? + +van Leuffen: We currently offer one service level of our product Wercker; however, we’re developing an enterprise offering. Current organizations using Wercker range from startups, such as Open Listings, to larger companies and big agencies, like Pivotal Labs. + + +### Linux.com: What does this recently open-sourced CLI do? + +van Leuffen: Using the Wercker Command Line Interface (CLI), developers can spin up Docker containers on their desktop, automate their build and deploy processes and then deploy them to various cloud providers, like AWS, and scheduler and orchestration platforms, such as Mesosphere and Kubernetes. + +The Wercker Command Line Interface is available as an open source project on GitHub and runs on both OSX and Linux machines. + + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/enterprise/systems-management/887177-achieving-enterprise-ready-container-tools-with-werckers-open-source-cli + +作者:[Swapnil Bhartiya][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.linux.com/community/forums/person/61003 +[1]:http://thenewstack.io/adopting-containers-enterprise/ +[2]:http://wercker.com/ +[3]:http://venturebeat.com/2016/01/28/wercker-raises-4-5-million-open-sources-its-command-line-tool/ +[4]:https://github.com/wercker/wercker + + From de34ee4eff38ed238aefd88c32d27f7d5524f000 Mon Sep 17 00:00:00 2001 From: Ezio Date: Tue, 23 Feb 2016 10:11:49 +0800 Subject: [PATCH 0402/1469] =?UTF-8?q?20160223-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...RM processor for the Internet of Things.md | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 sources/tech/20160221 NXP unveils a tiny 64-bit ARM processor for the Internet of Things.md diff --git a/sources/tech/20160221 NXP unveils a tiny 64-bit ARM processor for the Internet of Things.md b/sources/tech/20160221 NXP unveils a tiny 64-bit ARM processor for the Internet of Things.md new file mode 100644 index 0000000000..2acebc8473 --- /dev/null +++ b/sources/tech/20160221 NXP unveils a tiny 64-bit ARM processor for the Internet of Things.md @@ -0,0 +1,37 @@ +NXP unveils a tiny 64-bit ARM processor for the Internet of Things +========================================================================= + +**TAGS**:[ARM][1], [INTERNET OF THINGS][2], [NXP][3], [NXP SEMICONDUCTORS][4] + +![](http://1u88jj3r4db2x4txp44yqfj1.wpengine.netdna-cdn.com/wp-content/uploads/2016/02/nxp-930x556.jpg) + +[NXP Semiconductors][5] has unveiled what it calls the world’s smallest and lowest-power 64-bit ARM processor for the Internet of Things (IoT). + +The tiny QorIQ LS1012A delivers networking-grade security and performance acceleration to battery-powered, space-constrained applications. This includes powering applications for Internet of Things, or everyday objects that are smart and connected. If IoT is to reach its potential of $1.7 trillion by 2020 (as estimated by market researcher IDC), it’s going to need processors like the new one from NXP, which was unveiled at the Embedded World 2016 event in Nuremberg, Germany. + +The chip has a 64-bit ARMv8 processor with network packet acceleration and built-in security. It fits in a 9.6 mm-square space and draws about 1 watt of power. Potential applications include next-generation IoT gateways, portable entertainment platforms, high-performance portable storage applications, mobile hard disk drives, and mobile storage for cameras, tablets, and other rechargeable devices. + +Additionally, the LS1012A is the first processor designed specifically for an emerging new storage solution, dubbed object-based storage. Object-based storage relies on a smart hard disk drive that is directly connected to the data center’s Ethernet network. The processor must be small enough to be integrated directly on the circuit board for a hard disk drive. + +“The groundbreaking combination of low power, tiny footprint and networking-grade performance of NXP’s LS1012 processor is ideal for consumer, networking and Internet of Things applications alike,” said Tareq Bustami, senior vice president and general manager of NXP’s Digital Networking division, in a statement. “This unique blend of capabilities unleashes embedded systems designers and developers to imagine and create radically innovative end-products across a broad spectrum of high-growth markets.” + +NXP said it is the only 1-watt, 64-bit processor in the market to combine such a comprehensive set of high-speed peripherals in a single chip, thus enabling lower system-level costs. And due to innovative packaging, the processor can be routed on low-cost circuit boards. + +NXP’s LS1012A will be available in April 2016 and can be ordered now. NXP has more than 45,000 employees in 35 countries. + +-------------------------------------------------------------------------------- + +via: http://venturebeat.com/2016/02/21/nxp-unveils-a-small-and-tiny-64-bit-arm-processor-for-the-internet-of-things/ + +作者:[DEAN TAKAHASHI][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://venturebeat.com/author/dean-takahashi/ +[1]:http://venturebeat.com/tag/arm/ +[2]:http://venturebeat.com/tag/internet-of-things/ +[3]:http://venturebeat.com/tag/nxp/ +[4]:http://venturebeat.com/tag/nxp-semiconductors/ +[5]:http://www.nxp.com/ From dd1d0b122aaf6c46de2cd6b0c88aaab8da549b77 Mon Sep 17 00:00:00 2001 From: KS Date: Tue, 23 Feb 2016 10:27:55 +0800 Subject: [PATCH 0403/1469] Update 20160218 Top 4 open source issue tracking tools.md --- sources/tech/20160218 Top 4 open source issue tracking tools.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160218 Top 4 open source issue tracking tools.md b/sources/tech/20160218 Top 4 open source issue tracking tools.md index b2f784e1e7..060a50db11 100644 --- a/sources/tech/20160218 Top 4 open source issue tracking tools.md +++ b/sources/tech/20160218 Top 4 open source issue tracking tools.md @@ -1,3 +1,4 @@ +wyangsun translating Top 4 open source issue tracking tools ======================================== From 6df2f1212d74a018aeeb2d41e4a29df6c075289b Mon Sep 17 00:00:00 2001 From: BOBO Date: Wed, 24 Feb 2016 12:48:10 +0800 Subject: [PATCH 0404/1469] translating --- ...prise-Ready Container Tools With Wercker’s Open Source CLI.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160222 Achieving Enterprise-Ready Container Tools With Wercker’s Open Source CLI.md b/sources/tech/20160222 Achieving Enterprise-Ready Container Tools With Wercker’s Open Source CLI.md index 81f7467719..2f7d6f7f8d 100644 --- a/sources/tech/20160222 Achieving Enterprise-Ready Container Tools With Wercker’s Open Source CLI.md +++ b/sources/tech/20160222 Achieving Enterprise-Ready Container Tools With Wercker’s Open Source CLI.md @@ -1,5 +1,6 @@ Achieving Enterprise-Ready Container Tools With Wercker’s Open Source CLI =========================================== +#CoderBOBO translating For enterprises, containers offer more efficient build environments, cloud-native applications and migration from legacy systems to the cloud. But enterprise adoption of the technology -- Docker specifically -- has been hampered by, among other issues, [a lack of mature developer tools][1]. From 14469815a347ce0c13562bd42c906cc4777d2ccd Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 24 Feb 2016 16:29:29 +0800 Subject: [PATCH 0405/1469] =?UTF-8?q?20160224-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Android phone powering big-screen Linux.md | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 sources/tech/20160223 Intel shows budget Android phone powering big-screen Linux.md diff --git a/sources/tech/20160223 Intel shows budget Android phone powering big-screen Linux.md b/sources/tech/20160223 Intel shows budget Android phone powering big-screen Linux.md new file mode 100644 index 0000000000..29a5c77cd9 --- /dev/null +++ b/sources/tech/20160223 Intel shows budget Android phone powering big-screen Linux.md @@ -0,0 +1,32 @@ +Intel shows budget Android phone powering big-screen Linux +============================================================== + +![](https://regmedia.co.uk/2016/02/23/intel-bigscreen.jpg?x=648&y=348&crop=1) + +**MWC16** Intel is showing what it calls "Big Screen Experience" at Mobile World Congress, an Android smartphone which runs a full Linux desktop when plugged into an external display. + +The concept is broadly similar to Microsoft's Continuum for Windows 10 Mobile, but whereas Continuum devices are towards the high end, Intel's project is aimed, it says, at budget smartphones and emerging markets. + +On display in Barcelona is a prototype SoFIA (Smart or Feature Phone with Intel Architecture) smartphone with an Atom x3 processor, 2GB RAM and 16GB storage, and modified to support an external display. Attach keyboard, mouse and display, and it becomes desktop Linux, with an option to display the Android screen in a window on the large display. + +"Android is based on a Linux kernel, so we're running one kernel, we have an Android stack and a Linux stack, and we're sharing the same context, so the file system is identical. The phone stays fully functional," Intel's Nir Metzer, Path Finding Group Manager, told the Reg. + +"I have a multi-window environment. As soon as I plug in I can do spreadsheets, I can drag and drop, play video. Achieving all this on a low-end platform is a challenge," said Metzer. + +Currently the display on the device goes blank when the external display is attached, but Metzer said that the next version of the Atom X3 will support dual displays. + +The version of Linux used is maintained by Intel. "We need to align between the Linux versions and the Android," said Metzer. "The framework is pre-installed, not an app you can download." + +Intel is pitching the idea at phone manufacturers here at Mobile World Congress, but had nothing to report concerning actual customers for its device. "The chip is ready, this is production-ready. This can go into production tomorrow. It is a business decision," said Metzer.® + +-------------------------------------------------------------------------------- + +via: http://www.theregister.co.uk/2016/02/23/move_over_continuum_intel_shows_android_smartphone_powering_bigscreen_linux/ + +作者:[Tim Anderson][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.theregister.co.uk/Author/2878 From 6f8f6394d46dd50d9de3e553b7606099e3289761 Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 24 Feb 2016 16:34:12 +0800 Subject: [PATCH 0406/1469] =?UTF-8?q?20160224-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...S Parallel File System Goes Open Source.md | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 sources/tech/20160223 BeeGFS Parallel File System Goes Open Source.md diff --git a/sources/tech/20160223 BeeGFS Parallel File System Goes Open Source.md b/sources/tech/20160223 BeeGFS Parallel File System Goes Open Source.md new file mode 100644 index 0000000000..d65285a222 --- /dev/null +++ b/sources/tech/20160223 BeeGFS Parallel File System Goes Open Source.md @@ -0,0 +1,32 @@ +BeeGFS Parallel File System Goes Open Source +================================================== + +![](http://insidehpc.com/wp-content/uploads/2015/08/beegfs.jpg) + +Today ThinkParQ announced that the complete [BeeGFS parallel file system][1] is now available as open source. Developed specifically for performance-critical environments, the BeeGFS parallel file system was developed with a strong focus on easy installation and high flexibility, including converged setups where storage servers are also used for compute jobs. By increasing the number of servers and disks in the system, performance and capacity of the file system can simply be scaled out to the desired level, seamlessly from small clusters up to enterprise-class systems with thousands of nodes. + +The first official announcement to make the BeeGFS sources available was made at the International Supercomputing Conference 2013. This was in the context of the European exascale project [DEEP-ER][2], where several new approaches to address extreme I/O requirements are being designed and implemented. For exascale systems, the different software and hardware layers have to work together very efficiently to achieve maximum scalability. Thus, making the sources of BeeGFS available is one logical step to enabling efficient integration of all layers of an exascale stack. + +“While some of our users are just happy with the fact that BeeGFS is so easy to install and doesn’t require much attention, others really want to understand exactly what is happening under the hood to further optimize the runtime of their applications, improve their monitoring or port it to other platforms like BSD,” said Sven Breuner, CEO of ThinkParQ, the company behind BeeGFS “Also, being able to build BeeGFS for non-x86 architectures like ARM and Power is another important aspect that the community has been waiting for.” + +The steady advances in ARM technology indeed make it a more and more interesting technology to look at for future procurements. Thus, the BeeGFS team is also participating in [ExaNeSt][3], a new European exascale project, which is specifically focused on getting the ARM ecosystem ready for performance-critical workloads. “Although BeeGFS can already run out of the box on ARM systems today, this project will give us the opportunity to make sure that we can deliver the maximum performance on this architecture as well.”, adds Bernd Lietzow, BeeGFS head for ExaNeSt. + +With a rather compact code base of about 25K lines of C++ code for the distributed metadata service and about 15K lines of C++ code for the distributed storage service, BeeGFS should be relatively easy to understand and extend, not only for senior programmers, but also for University students interested in file system research. On GitHub, there are already a number of projects listed related to BeeGFS, e.g. for browser-based monitoring or Docker integration. + +In related news, the [BeeGFS User Meeting][4] will take place May 18-19 in Kaiserslautern, Germany. + +----------------------------------------------------------------------------------------- + +via: http://insidehpc.com/2016/02/beegfs-parallel-file-system-now-open-source/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+InsideHPC+%28insideHPC.com%29 + +作者:[staff][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://insidehpc.com/author/staff/ +[1]: http://www.beegfs.com/ +[2]: http://www.deep-project.eu/deep-project/EN/Home/home_node.html +[3]: http://www.exanest.eu/ +[4]: http://www.beegfs.com/content/user-meeting-2016/ From 1a8398fc6771cc30ba4cf497c9eaf7ef898a3906 Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 24 Feb 2016 16:41:13 +0800 Subject: [PATCH 0407/1469] =?UTF-8?q?20160224-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Should Bring Order to Containerization.md | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 sources/tech/20160223 New Docker Data Center Admin Suite Should Bring Order to Containerization.md diff --git a/sources/tech/20160223 New Docker Data Center Admin Suite Should Bring Order to Containerization.md b/sources/tech/20160223 New Docker Data Center Admin Suite Should Bring Order to Containerization.md new file mode 100644 index 0000000000..48ea41d7b3 --- /dev/null +++ b/sources/tech/20160223 New Docker Data Center Admin Suite Should Bring Order to Containerization.md @@ -0,0 +1,49 @@ +New Docker Data Center Admin Suite Should Bring Order to Containerization +=============================================================================== + +![](https://tctechcrunch2011.files.wordpress.com/2016/02/shutterstock_119411227.jpg?w=738) + +[Docker][1] announced a new container control center today it’s calling the Docker Datacenter (DDC), an integrated administrative console that has been designed to give large and small businesses control over creating, managing and shipping containers. + +The DDC is a new tool made up of various commercial pieces including Docker Universal Control Plane (which also happens to be generally available today) and Docker Trusted Registry. It also includes open source pieces such as Docker Engine. The idea is to give companies the ability to manage the entire lifecycle of Dockerized applications from one central administrative interface. + +Customers actually were the driving force behind this new tool. While companies liked the agility that Docker containers give them, they also wanted management control over administration, security and governance around the containers they were creating and shipping, Scott Johnston, SVP of product management told TechCrunch. + +The company has called this Containers as a Service (CaaS), mostly because when customers came to them asking for this type of administrative control, that’s how they described it, Johnston said. + + +![](https://tctechcrunch2011.files.wordpress.com/2016/02/screen-shot-2016-02-23-at-7-56-54-am.png?w=680&h=401) + +>Image courtesy of Docker + +Like many open source projects, Docker gained a strong following among developers first, but as it grew in popularity, the companies these developers were working for wanted a straight-forward way to track and manage them. + +That’s exactly what DDC is designed to do. It gives developers the agility they need to create containerized applications, while providing operations with the tools they need to bring order to the process. + +In practice this means that developers can create a set of containerized components, have them approved for deployment by operations and then have access to a library of fully certified images. This lets developers pull the pieces they need across a range of applications without having to reinvent the wheel every time. That should speed up application development and deployment (and add to the agility that containers should in theory be providing in the first place). + +This aspect appealed to Beta customer ADP. The payroll services giant particularly liked having this central repository of images available to developers. + +“As part of our initiative to modernize our business-critical applications to microservices, ADP has been investigating solutions that would enable our developers to leverage a central library of IT-vetted and secured core services that they could rapidly iterate on,” said Keith Fulton, Chief Technology Officer at ADP said in a statement. + +Docker was launched in 2010 by founder Solomon Hykes as dotCloud. He pivoted the company to Docker in 2013, [selling dotCloud in August][2], 2014 to focus completely on Docker. + +The company came out of the gate like gangbusters a couple of years ago raising $180 million ($168 million since becoming Docker) over five rounds, according to CrunchBase. What caught the attention of investors was that Docker offered a way to deliver applications for the modern age called containers, a way of building, managing and shipping distributed applications. + +Containerization enables developers to create these distributed applications made up of small discrete pieces that run across multiple servers, as opposed to the large monolithic applications companies used to create running on a single server. + +Pricing for Docker Datacenter starts at $150 per node per month. + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/calico-virtual-private-networking-docker/ + +作者:[ Ron Miller][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://techcrunch.com/author/ron-miller/ +[1]: https://www.docker.com/ +[2]: http://techcrunch.com/2014/08/04/docker-sells-dotcloud-to-cloudcontrol-to-focus-on-core-container-business/ From d2818a9bc4402d2487d9b2f34144aa955850f00b Mon Sep 17 00:00:00 2001 From: Jonathan Kang Date: Wed, 24 Feb 2016 16:44:12 +0800 Subject: [PATCH 0408/1469] Translated --- ... Download] Vi Cheat Sheet For Beginners.md | 80 ------------------- ... Download] Vi Cheat Sheet For Beginners.md | 79 ++++++++++++++++++ 2 files changed, 79 insertions(+), 80 deletions(-) delete mode 100644 sources/tech/20160220 [Free Download] Vi Cheat Sheet For Beginners.md create mode 100644 translated/tech/20160220 [Free Download] Vi Cheat Sheet For Beginners.md diff --git a/sources/tech/20160220 [Free Download] Vi Cheat Sheet For Beginners.md b/sources/tech/20160220 [Free Download] Vi Cheat Sheet For Beginners.md deleted file mode 100644 index db69940892..0000000000 --- a/sources/tech/20160220 [Free Download] Vi Cheat Sheet For Beginners.md +++ /dev/null @@ -1,80 +0,0 @@ -JonathanKang is translating - -[Free Download] Vi Cheat Sheet For Beginners -================================================ - -![](http://itsfoss.com/wp-content/uploads/2016/01/VI.jpg) - -I have often shared my Linux experience with you. Today I am going to share my **Vi cheat sheet** that has often saved me time in googling for a quick command. - -## Basic Vi commands - -This is not a detailed tutorial to teach you each and every aspect of [Vi editor](https://en.wikipedia.org/wiki/Vi). In fact, it’s not a tutorial at all. It’s just a collection of basic Vi commands and their brief description for a quick reference. - -command|explain -:--|:-- -:x |Save the file and quit -:q!|Quit without saving the file -i|Insert starting left of the cursor -a|Append starting right of the cursor -ESC|Exit insert/append mode -arrows|Move cursor -/text|Search string text (case sensitive) -n|Search next occurrence of the searched item -x|Delete character under the cursor -dd|Delete line under the cursor -u|Undo last change -:0|Beginning of the file -:n|Go to line n -G|End of the file -^|Beginning of the line -$|End of the line -:set list|See special characters in the file -yy|Copy the line into the buffer -5yy|Copy 5 lines into the buffer -p|Paste buffer after the current line - -You can download the above cheat sheet in a PDF format from the link below: - -[Download Vi Cheat Sheet](https://drive.google.com/file/d/0By49_3Av9sT1X3dlWkNQa3g2b2c/view?usp=sharing) - -You can print it and keep it at your desk or just save it for offline use. - -## Why I created the Vi cheat sheet? - -Several years ago, when I started working in Linux terminal, the idea of using a command line editor horrified me. I had used desktop Linux before but it was my personal computer so I happily used the GUI text editor like Gedit. But in the working environment, I was stuck with the command line and there was no scope of using a graphical editor. - -I was forced to use Vi for basic edits in the files on remote Linux boxes and this is where I identified and started to admire the power of command line editing tool Vi. - -Since, at that time, I was new at Vi editor, I found myself baffling with it. The first time, I could not even come out of the file because I did not know how to close Vi editor. No shame in accepting that I had to Google it. - -So, I decided to make a list of all the basic commands that I used frequently for editing in Vi. This list or cheat sheet, as you may call it, helped me a lot in my early days with Vi. With time, I grew up with Vi and now I don’t even need to look at the Vi cheat sheet because I have the commands memorized by heart. - -## Why should you use Vi cheat sheet? - -I can understand your situation if you are just getting started with Vi. Your favorite Ctrl+S doesn’t work for saving files. Ctrl+C and Ctrl+V were supposed to be the universal shortcut for copy and paste but it won’t work in Vi universe.Thousands of people use cheat sheets - -Thousands of people use such cheat sheets for various programming languages and `/` or tools that give them a quick reference to commonly used steps `/` commands. Trust me, using cheat sheets among the best practices advised to programmers. - -This Vi cheat sheet will help you a lot if you are just starting with Vi or if you infrequently use the Vi editor (so you keep forgetting the commands). You can save it and use it for quick reference in future, that too offline. - -## Do you like it? - -So far, I have refrained myself from going into too much on terminal side. How do you find this post? Do you want me to share more such cheat sheets and downloadable items? Your suggestions are welcomed. - ------------------------------------------------------------------------------- - -via: http://itsfoss.com/download-vi-cheat-sheet/ - -作者:[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/tech/20160220 [Free Download] Vi Cheat Sheet For Beginners.md b/translated/tech/20160220 [Free Download] Vi Cheat Sheet For Beginners.md new file mode 100644 index 0000000000..dbf4ef5011 --- /dev/null +++ b/translated/tech/20160220 [Free Download] Vi Cheat Sheet For Beginners.md @@ -0,0 +1,79 @@ +【免费下载】初学者Vi备忘单 +================================================ + +![](http://itsfoss.com/wp-content/uploads/2016/01/VI.jpg) + +一直以来,我都在给你们分享我使用Linux的经验。今天我想分享我的**Vi备忘单**。这份备忘单节省了我很多时间,因为我再也不用使用Google去搜索这些命令了。 + +## Basic Vi commands +## 基本Vi命令 + +这并不是一个详尽的教程来教你[Vi编辑器](https://en.wikipedia.org/wiki/Vi)的每一个方面。事实上,这根本就不是一个教程。这仅仅是一些基本Vi命令以及这些命令简单介绍的集合。 + +命令|解释 +:--|:-- +:x |保存文件并退出 +:q!|退出但不保存文件 +i|在光标左侧插入 +a|在光标右侧插入 +ESC|退出插入模式 +arrows|移动光标 +/text|搜索字符串text(大小写敏感) +n|跳到下一个搜索结果 +x|删除当前光标处的字符 +dd|删除当前光标所在的行 +u|撤销上次改变 +:0|将光标移动到文件开头 +:n|将光标移动到第n行 +G|将光标移动到文件结尾 +^|将光标移动到该行开头 +$|将光标移动到该行结尾 +:set list|查看文件中特殊字符 +yy|复制光标所在行 +5yy|复制从光标所在行开始的5行 +p|在光标所在行下面粘贴 + +你可以通过下面的链接下载PDF格式的Vi备忘录: + +[下载Vi备忘录](https://drive.google.com/file/d/0By49_3Av9sT1X3dlWkNQa3g2b2c/view?usp=sharing) + +你可以把它打印出来放到你的办公桌上,或者把它保存到你的电脑上来使用。 + +## 我为什么要建立这个Vi备忘录? + +几年前,当我刚刚接触Linux终端时,使用命令行编辑器这个主意使我一惊。我之前在我自己的电脑上使用过桌面版本的Linux,所以我很乐意使用像Gedit这样的有图形界面的编辑器。但是在工作环境中,我不得不使用命令行,并且无法使用图形界面版的编辑器。 + +我就这么被强迫地使用Vi来对远程Linux终端上的文件做一些基本的编辑。从这时候我开始了解并钦佩Vi的强大之处。 + +因为在那时候我还是一个Vi新手,所以我经常对Vi一些操作很困惑。仍然记得第一次使用Vi的时候,由于我不知道如何退出Vi,所以我都无法关闭某个文件。我也只能通过Google搜索来找到解决办法。我不得不接受这个尴尬的事实。 + +从那以后,我就决定制作一个列表来列出我经常会用到的基本Vi操作。这个列表,或者你可能称它为备忘录。在我早期使用Vi的时候,它对我非常有用。慢慢地,我对Vi更加熟悉,我已经可以熟记那些基本编辑命令。到现在,我甚至不需要再去查看我的Vi备忘录了。 + +## 你为什么需要Vi备忘录? + +我能理解一个刚刚接触Vi的人的感受。你最喜欢的Ctrl+S快捷键不能像在其他编辑器那样方便地保存文件。Ctrl+C和Ctrl+V理应是通用的用来复制和粘贴的快捷键,但是在Vi中却不是这样。 + +很多人都在使用类似的备忘录帮助他们熟悉各种编程语言以及用来进行快速检索的“/”工具。相信我,使用备忘录会给程序员日常工作带来很大便利。 + +如果你刚刚开始接触Vi或者你经常使用但是总是记不住Vi操作,那么这份Vi备忘录对于你来说是非常有用的。你可以把它保存下来留作以后查询使用。 + +## 你怎么看待这份备忘录? + +至今为止,我一直在克制我自己不要过于以来终端。我想知道你是怎么发现这篇文章的?你是否想让我分享更多类似的备忘录出来以供你们下载?我很期待你的意见和建议。 + +------------------------------------------------------------------------------ + +via: http://itsfoss.com/download-vi-cheat-sheet/ + +作者:[ABHISHEK][a] +译者:[JonathanKang](https://github.com/JonathanKang) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ + + + + + From 47727a58486ee50dc5121309ed52e4c7f1aef180 Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 24 Feb 2016 16:50:07 +0800 Subject: [PATCH 0409/1469] =?UTF-8?q?20160224-4=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20160204 An Introduction to SELinux.md | 136 ++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 sources/tech/20160204 An Introduction to SELinux.md diff --git a/sources/tech/20160204 An Introduction to SELinux.md b/sources/tech/20160204 An Introduction to SELinux.md new file mode 100644 index 0000000000..dc5968ad00 --- /dev/null +++ b/sources/tech/20160204 An Introduction to SELinux.md @@ -0,0 +1,136 @@ +An Introduction to SELinux +=============================== + +![](https://www.linux.com/images/stories/66866/jack2-selinux_a.png) + +>Figure 1: The getenforce command reporting SELinux is set to Enforcing. + +Way back in kernel 2.6, a new security system was introduced to provide a mechanism for supporting access control security policies. This system was [Security Enhanced Linux (SELinux)][1] and was introduced by the [National Security Administration (NSA)][2] to incorporate a strong Mandatory Access Control architecture into the subsystems of the Linux kernel. + +If you’ve spent your entire Linux career either disabling or ignoring SELinux, this article is dedicated to you — an introduction to the system that lives “under the hood” of your Linux desktop or server to limit privilege or even eliminate the possibility of damage should programs or daemons become compromised. + +Before I begin, you should know that SELinux is primarily a tool for Red Hat Linux and its derivatives. The likes of Ubuntu and SUSE (and their derivatives) make use of AppArmor. SELinux and AppArmor are significantly different. You can install SELinux on SUSE, openSUSE, Ubuntu, etc., but it’s an incredibly challenging task unless you’re very well versed in Linux. + +With that said, let me introduce you to SELinux. + +### DAC vs. MAC + +The old-guard standard form of access control on Linux was Discretionary Access Control (DAC). With this form, an application or daemon runs under either User ID (UID) or Set owner User ID (SUID) and holds object permissions (for files, sockets, and other processes) of that user. This made it easier for malicious code to be run with a permission set that would grant it access to crucial subsystems. + +Mandatory Access Control (MAC), on the other hand, enforces the separation of information based on both confidentiality and integrity to enable the confinement of damage. The confinement unit operates independently of the traditional Linux security mechanisms and has no concept of a superuser. + +### How SELinux Works + +Consider these pieces of the SELinux puzzle: + +- Subjects + +- Objects + +- Policy + +- Mode + +When a subject (such as an application) attempts to access an object (such as a file), the SELinux Security Server (inside the kernel) runs a check against the Policy Database. Depending on the current mode, if the SELinux Security Server grants permission, the subject is given access to the object. If the SELinux Security Server denies permission, a denied message is logged in /var/log/messages. + +Sounds relatively simple, right? There’s actually more to it than that, but for the sake of introduction, those are the important steps. + +### The Modes + +SELinux has three modes (which can be set by the user). These modes will dictate how SELinux acts upon subject request. The modes are: + +- Enforcing — SELinux policy is enforced and subjects will be denied or granted access to objects based on the SELinux policy rules + +- Permissive — SELinux policy is not enforced and does not deny access, although denials are logged + +- Disabled — SELinux is completely disabled + +Out of the box, most systems have SELinux set to Enforcing. How do you know what mode your system is currently running? You can use a simple command to report the mode; that command is getenforce. This command is incredibly simple to use (as it has the singular purpose of reporting the SELinux mode). To use this tool, open up a terminal window and issue the command getenforce. The report will come back with either, Enforcing, Permissive, or Disabled (see Figure 1 above). + +Setting the SELinux mode is actually quite simple — depending upon the mode you want to set. Understand this: It is never recommended to set SELinux to Disable. Why? When you do this, you open up the possibility that files on your disk will be mislabeled and require a re-label to fix. It is also not possible to change the mode of a system when it has been booted in Disabled mode. Your best modes are either Enabled or Permissive. + +You can change the SELinux mode from the command line or in the /etc/selinux/config file. To set the mod via command line, you use the setenforce tool. To set the mode to Enforcing, do the following: + +1. Open up a terminal window + +2. Issue the command su and then enter your administrator password + +3. Issue the command setenforce 1 + +4. Issue the command getenforce to ensure the mode has been set (Figure 2) + +![](https://www.linux.com/images/stories/66866/jack-selinux_b.png) + +>Figure 2: Setting the SELinux mode to Enforcing. + +To set the mode to Permissive, do this: + +1. Open up a terminal window + +2. Issue the command su and then enter your administrator password + +3. Issue the command setenforce 0 + +4. Issue the command getenforce to ensure the mode has been set (Figure 3) + +![](https://www.linux.com/images/stories/66866/jack-selinux_c.png) + +>Figure 3: Setting the SELinux mode to Permissive. + +NOTE: Setting the mode via command line overrides the setting in the SELinux config file. + +If you’d prefer to set the mode in the SELinux command file, open up that particular file in your favorite text editor and look for the line: + +>SELINUX=permissive + +You can change the mode to suit your preference and then save the file. + +There is also a third method of changing the SELinux mode (via the bootloader), but I don’t recommend it for a beginning user. + +### Policy Type + +There are two types of SELinux policies: + +- Targeted — only targeted network daemons (dhcpd, httpd, named, nscd, ntpd, portmap, snmpd, squid, and syslogd) are protected + +- Strict — full SELinux protection for all daemons + +You can change the policy type within the /etc/selinux/config file. Open the file in your favorite text editor and look for the line: + +>SELINUXTYPE=targeted + +Change the option in that line to either targeted or strict to match your needs. + +### Checking the Full SELinux Status + +There is a handy SELinux tool you might want to know about that will display a detailed status report of your SELinux-enabled system. The command is run from a terminal window like this: + +>sestatus -v + +You should see output similar to that shown in Figure 4. + +![](https://www.linux.com/images/stories/66866/jack-selinux_d.png) + +>Figure 4: The output of the sestatus -v command. + +### Just Scratching the Surface + +As you might expect, I have only scratched the surface of SELinux. It is quite a complex system and will require diving much deeper to obtain a solid understanding of how it works for you and how you can make it better work for your desktops and servers. I still have yet to cover troubleshooting and creating custom SELinux policies. + +SELinux is a powerful tool that any Linux administrator should know. Now that you’ve been introduced, I highly recommend you return to Linux.com (when more tutorials on the subject are posted) or take a look at the [NSA SELinux documentation][3] for very in-depth tutorials. + + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/learn/docs/ldp/883671-an-introduction-to-selinux + +作者:[Jack Wallen][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.linux.com/community/forums/person/93 +[1]: http://selinuxproject.org/page/Main_Page +[2]: https://www.nsa.gov/research/selinux/ +[3]: https://www.nsa.gov/research/selinux/docs.shtml From cbab5e849861ab2589290cd63cdcf63fb9ddcb77 Mon Sep 17 00:00:00 2001 From: KS Date: Wed, 24 Feb 2016 17:38:38 +0800 Subject: [PATCH 0410/1469] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Top 4 open source issue tracking tools.md | 64 ------------------- ... Top 4 open source issue tracking tools.md | 63 ++++++++++++++++++ 2 files changed, 63 insertions(+), 64 deletions(-) delete mode 100644 sources/tech/20160218 Top 4 open source issue tracking tools.md create mode 100644 translated/tech/20160218 Top 4 open source issue tracking tools.md diff --git a/sources/tech/20160218 Top 4 open source issue tracking tools.md b/sources/tech/20160218 Top 4 open source issue tracking tools.md deleted file mode 100644 index 060a50db11..0000000000 --- a/sources/tech/20160218 Top 4 open source issue tracking tools.md +++ /dev/null @@ -1,64 +0,0 @@ -wyangsun translating -Top 4 open source issue tracking tools -======================================== - -Life is full of bugs. - -No matter how carefully planned, no matter how much time went into design, any project is going to have unforseen issues when the rubber hits the road in the implementation stage. And that's okay. Perhaps the best measure of resiliency for any organization is not how well they handle things when everything is functioning as planned, but rather, how they handle the speed bumps when they come along. - -A critical tool for any project management workflow, especially in the software development world, is an issue tracker. The basics are simple; allowing bugs to be opened, tracked, and resolved in a collaborative manner, while making it easy to follow the progress. Beyond the basic functionality, there are a lot of options focused on meeting specific needs, features, and use cases, including software development and beyond. You may be familiar with hosted versions of these tools, like [GitHub Issues](https://guides.github.com/features/issues/) or [Launchpad](https://launchpad.net/), some of which are themselves open source. - -So let's take a look at four excellent choices for managing bugs and issues, all open source and all easy to download and host yourself. To be clear, there's no way we could possibly list every issue tracking tool here; instead, these are four of our favorites, based on feature richness and the size of the community behind the project. There are others, to be sure, and if you've got a good case for your favorite not listed here, be sure to let us know which is your favorite tool and what makes it stand out to you, in the comments below. - -## Redmine - -[Redmine](http://www.redmine.org/) is a popular issue tracking tool built on Ruby on Rails and dating back to 2006. Similar in many regards to Trac, another one of our favorites, Redmine is capable of managing multiple projects and integrates with a number of version control systems. In addition to basic issue tracking, Redmine also offers forums, wikis, time tracking tools, and the ability to generate Gantt charts and calendars to track progress. - -Redmine is fairly flexible in its setup, supporting numerous database backends and dozens of languages, and is customizable as well, featuring the ability to add custom fields to issues, users, projects and more. It can be further customized with a number of community-created plugins and themes. - -An [online demo](http://demo.redmine.org/) is available if you’d like to try it out. Redmine is licensed as open source under the [GPL version 2](http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html); the source code can be found in the project’s [subversion repository](https://svn.redmine.org/redmine) or mirrored on [GitHub](https://github.com/redmine/redmine). - -![](https://opensource.com/sites/default/files/images/business-uploads/issues-redmine.png) - -## Bugzilla - -[Bugzilla](https://www.bugzilla.org/) is another popular development tool with issue tracking capabilities. As you might have guessed from the name, Bugzilla was originally created by the [Mozilla Foundation](https://www.mozilla.org/en-US/) to track bugs in the development of the then-called Netscape Communicator suite. Ported to Perl from its original Tcl routes for greater accessibility, Bugzilla is one of the older and more widely adopted issue tracking systems, as it is used by a number of well-known open source projects like GNOME, KDE, and the Linux kernel itself. - -Sporting a number of advanced tools, from notifications to duplicate bug detection to shared searches, Bugzilla is certainly a more feature-rich option. Bugzilla has an advanced search system along with a comprehensive reporting tool, capable of generating charts and automated scheduled reports. Like Redmine, Bugzilla is extensible and customizable, both in the fields themselves as well as featuring the ability to create custom workflows for bugs. It also works with many database backends, and many different languages are supported out of the box. - -Bugzilla is licensed under the [Mozilla Public License](https://en.wikipedia.org/wiki/Mozilla_Public_License), and you can read their [future roadmap](https://www.bugzilla.org/status/roadmap.html) and try out a [demo server](https://landfill.bugzilla.org/) on the official website. - -![](https://opensource.com/sites/default/files/images/business-uploads/issues-bugzilla.png) - -## Trac - -[Trac](http://trac.edgewall.org/browser) describes itself as taking a minimalistic approach to web-based software project management, but don’t confusing minimalism with a lack of features. - -Written in Python, Trac tightly integrates its bug tracking capabilities with its wiki system and a revision control system of your choosing. It features project management capabilities like generating milestones and roadmaps, a customizable reporting system, timelines, support for multiple repositories, built-in spam filtering, and is available in many common languages. Like the other bug trackers we have looked at, has a number of plugins available for it extending its base feature set even further. - -Trac is made available as open source under a modified [BSD license](http://trac.edgewall.org/wiki/TracLicense), though older versions were released under the GPL. You can view Trac’s source in a [self-hosted repository](http://trac.edgewall.org/browser) or check out their [roadmap](http://trac.edgewall.org/wiki/TracRoadmap) for future plans. - -![](https://opensource.com/sites/default/files/images/business-uploads/issues-trac.png) - -## Mantis - -[Mantis](https://www.mantisbt.org/) is the final tool we’ll look at in this collection, a PHP-based bug tracker with a sixteen year history. Another bug tracker with support for many different revision control systems and an event-driven notification system, Mantis has a similar feature set to other tools here. While it does not itself contain a wiki, it integrates with many popular wiki platforms and is localized into many languages. - -Mantis is licensed as open source under the [GPL version 2](http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html); you can browse its source code on [GitHub](https://github.com/mantisbt/mantisbt) or check out the self-hosted [roadmap](https://www.mantisbt.org/bugs/roadmap_page.php?project=mantisbt&version=1.3.x) for future plans. For a demo, you can check out their own internal [bug tracker](https://www.mantisbt.org/bugs/my_view_page.php). - -![](https://opensource.com/sites/default/files/images/business-uploads/issues-mantis.png) - -As we notes, these four are not the only options. Looking to explore some others? [Apache Bloodhound](https://issues.apache.org/bloodhound/), [Fossil](http://fossil-scm.org/index.html/doc/trunk/www/index.wiki), [The Bug Genie](http://www.thebuggenie.com/), and many alternatives all have dedicated followings, each with different strengths and weaknesses. In addtion, some of the tools in our [project management](https://opensource.com/business/15/1/top-project-management-tools-2015) roundup have issue tracking capabilities. So, which is your preferred tool for tracking and squashing bugs? - - ------------------------------------------------------------------------------- - -via: https://opensource.com/business/16/2/top-issue-support-and-bug-tracking-tools - -作者:[Jason Baker][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/jason-baker diff --git a/translated/tech/20160218 Top 4 open source issue tracking tools.md b/translated/tech/20160218 Top 4 open source issue tracking tools.md new file mode 100644 index 0000000000..b8f336b120 --- /dev/null +++ b/translated/tech/20160218 Top 4 open source issue tracking tools.md @@ -0,0 +1,63 @@ +排名前4的开源问题追踪工具 +======================================== + +生活充满了漏洞。 + +无论怎样小心计划,无论花多少时间去设计,在执行阶段当轮胎压在路上,任何工程都会有未知的问题。也无妨。也许对于任何一个组织的最佳衡量弹性不是他们如何一切都按计划运行地处理事情,而是,当出现磕磕碰碰时他们处理速度。 + +一个任意工程管理流程的关键工具,特别是在软件开发领域,是一个问题追踪系统。基础很简单;允许漏洞在合作的方式被打开,追踪,和解决,同时很容易跟随进展。除了基本功能,还有很多专注于满足特定需求的选择,和使用案例,包括软件开发和更多。你可能熟悉托管版本的这些工具,像 [GitHub Issues](https://guides.github.com/features/issues/)或者[Launchpad](https://launchpad.net/),这些是他们自己开放的资源。 + +让我们看一看四个管理漏洞和问题的优秀选择,全部开源代码、易于下载和自我托管。要清楚,我们可能没有办法在这里列出每一个问题跟踪工具;然而,这有四个我们偏爱的,基于功能丰富和项目背后的社区项目的规模。还有其他,可以肯定的是,如果你有一个好的理由你喜欢的没有列在这里,一定要让我们知道这是你最喜欢的工具,在下面的评论中使它脱颖而出。 + +## Redmine + +[Redmine](http://www.redmine.org/) 是一个流行的问题追踪工具建立在Ruby on Rails和可以追溯到2006年。很多类似于Trac,另一方面我们最爱的是,Redmine可以管理多个项目然后整合了多种版本控制系统。除了基本问题追踪,Redmine也提供论坛,wiki,时间跟踪工具,和生成甘特图和日历的能力来跟踪项目的进展。 + +Redmine的设置相当灵活,支持多种数据库后端和几十种语言,还是可定制的,可以添加自定义字段到问题,用户,工程和更多。通过社区创建的插件和主题它可以进一步定制。 + +如果你想试一试,一个[在线演示](http://demo.redmine.org/)可提供使用。Redmine在开源[GPL版本2](http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)下许可;开源代码可以在工程的[svn仓库](https://svn.redmine.org/redmine)或在[GitHub](https://github.com/redmine/redmine)镜像上找到。 + +![](https://opensource.com/sites/default/files/images/business-uploads/issues-redmine.png) + +## Bugzilla + +[Bugzilla](https://www.bugzilla.org/)是另一个流行的有问题追踪功能的开发工具。从名字您可能已经猜到了,Bugzilla最初是[Mozilla基金会](https://www.mozilla.org/en-US/)创建,用来跟踪当时称为网景通信套件开发漏洞的。为了更好的通过性从原来的Tcl移植到Perl路径,Bugzilla是一个比较老的和更广泛采用的问题跟踪系统,因为它用在许多著名的开源项目如GNOME,KDE,Linux内核本身。 + +拥有一些先进的工具,从通知到共享搜索重复的漏洞检测,Bugzilla是一个功能更丰富的选项。Bugzilla有高级搜索系统与全面的报表工具,生成图表和自动化计划报告的能力。像Redmine,Bugzilla是可扩展和可定制的,两者在字段本身像能创建自定义漏洞工作流一样。它也支持多种后端数据库,和自带的多语言支持。 + +Bugzilla在[Mozilla公共许可证](https://en.wikipedia.org/wiki/Mozilla_Public_License)下许可,你可以读取他们[未来路线图](https://www.bugzilla.org/status/roadmap.html)还有在官网测试一个[示例服务](https://landfill.bugzilla.org/) + +![](https://opensource.com/sites/default/files/images/business-uploads/issues-bugzilla.png) + +## Trac + +[Trac](http://trac.edgewall.org/browser)自称是使用基于web简单的方法的软件工程管理软件,但不要混淆极简主义与缺乏功能。 + +python编写,Trac紧密结合它的漏洞跟踪与它的wiki系统和你选择的版本控制系统。项目管理能力突出,如生成的里程碑和路线图,一个可定制的报表系统,大事记,支持多资源库,内置的垃圾邮件过滤,还可以使用很多一般的语言。如其他漏洞追踪软件我们已经看到,有很多插件可进一步扩展其基本特性。 + +Trac是在改进的[BSD许可](http://trac.edgewall.org/wiki/TracLicense)下获得开放源码许可,虽然更老的版本发布在GPL下。你可以在一个[自托管仓库](http://trac.edgewall.org/browser)预览Trac的源码或者查看他们的[路线图](http://trac.edgewall.org/wiki/TracRoadmap)对未来的规划。 + +![](https://opensource.com/sites/default/files/images/business-uploads/issues-trac.png) + +## Mantis + +[Mantis](https://www.mantisbt.org/)是这次收集中我们将看的最后一个工具,一个基于PHP且有16年历史的漏洞跟踪工具。另外漏洞跟踪支持多种不同的版本控制系统和一个事件驱动的通知系统,Mantis有一个与其他工具类似的功能设置。虽然它不本身包含一个wiki,它整合很多流行的wiki平台且本地化到多种语言。 + +Mantis在[GPL版本2](http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)下获得开源许可证书;你可以在[GitHub](https://github.com/mantisbt/mantisbt)浏览他的源代码或查看自托管[路线图](https://www.mantisbt.org/bugs/roadmap_page.php?project=mantisbt&version=1.3.x)对未来的规划。一个示例,你可以查看他们的内部[漏洞跟踪](https://www.mantisbt.org/bugs/my_view_page.php)。 + +![](https://opensource.com/sites/default/files/images/business-uploads/issues-mantis.png) + +正如我们指出的,这四个不是唯一的选项。想要探索更多?[Apache Bloodhound](https://issues.apache.org/bloodhound/),[Fossil](http://fossil-scm.org/index.html/doc/trunk/www/index.wiki),[The Bug Genie](http://www.thebuggenie.com/),还有很多可替换品都有专注的追随者,每个都有不同的优点和缺点。另外,一些工具在我们[项目管理](https://opensource.com/business/15/1/top-project-management-tools-2015)摘要有问题跟踪功能。所以,哪个是你首选的跟踪和挤压漏洞的工具? + + +------------------------------------------------------------------------------ + +via: https://opensource.com/business/16/2/top-issue-support-and-bug-tracking-tools + +作者:[Jason Baker][a] +译者:[wyangsun](https://github.com/wyangsun) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/jason-baker From 9ebe7447e4532865956f9daf127666d418b527f8 Mon Sep 17 00:00:00 2001 From: KS Date: Wed, 24 Feb 2016 17:42:47 +0800 Subject: [PATCH 0411/1469] Update 20160218 Top 4 open source issue tracking tools.md --- .../tech/20160218 Top 4 open source issue tracking tools.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translated/tech/20160218 Top 4 open source issue tracking tools.md b/translated/tech/20160218 Top 4 open source issue tracking tools.md index b8f336b120..d5572a8ff8 100644 --- a/translated/tech/20160218 Top 4 open source issue tracking tools.md +++ b/translated/tech/20160218 Top 4 open source issue tracking tools.md @@ -1,9 +1,9 @@ -排名前4的开源问题追踪工具 +排名前4的开源漏洞追踪工具 ======================================== 生活充满了漏洞。 -无论怎样小心计划,无论花多少时间去设计,在执行阶段当轮胎压在路上,任何工程都会有未知的问题。也无妨。也许对于任何一个组织的最佳衡量弹性不是他们如何一切都按计划运行地处理事情,而是,当出现磕磕碰碰时他们处理速度。 +无论怎样小心计划,无论花多少时间去设计,在执行阶段当轮胎压在路上,任何工程都会有未知的问题。也无妨。也许对于任何一个组织的最佳弹性衡量不是他们如何一切都按计划运行地处理事情,而是,当出现磕磕碰碰时他们处理速度。 一个任意工程管理流程的关键工具,特别是在软件开发领域,是一个问题追踪系统。基础很简单;允许漏洞在合作的方式被打开,追踪,和解决,同时很容易跟随进展。除了基本功能,还有很多专注于满足特定需求的选择,和使用案例,包括软件开发和更多。你可能熟悉托管版本的这些工具,像 [GitHub Issues](https://guides.github.com/features/issues/)或者[Launchpad](https://launchpad.net/),这些是他们自己开放的资源。 From 4aa35794053585c3e94e77f15c8c3a98fe7423ed Mon Sep 17 00:00:00 2001 From: KS Date: Wed, 24 Feb 2016 17:47:30 +0800 Subject: [PATCH 0412/1469] Update 20160218 Top 4 open source issue tracking tools.md --- .../20160218 Top 4 open source issue tracking tools.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/translated/tech/20160218 Top 4 open source issue tracking tools.md b/translated/tech/20160218 Top 4 open source issue tracking tools.md index d5572a8ff8..840a3d80fc 100644 --- a/translated/tech/20160218 Top 4 open source issue tracking tools.md +++ b/translated/tech/20160218 Top 4 open source issue tracking tools.md @@ -11,7 +11,7 @@ ## Redmine -[Redmine](http://www.redmine.org/) 是一个流行的问题追踪工具建立在Ruby on Rails和可以追溯到2006年。很多类似于Trac,另一方面我们最爱的是,Redmine可以管理多个项目然后整合了多种版本控制系统。除了基本问题追踪,Redmine也提供论坛,wiki,时间跟踪工具,和生成甘特图和日历的能力来跟踪项目的进展。 +[Redmine](http://www.redmine.org/) 是一个流行的漏洞追踪工具建立在Ruby on Rails和可以追溯到2006年。很多类似于Trac,另一方面我们最爱的是,Redmine可以管理多个项目然后整合了多种版本控制系统。除了基本问题追踪,Redmine也提供论坛,wiki,时间跟踪工具,和生成甘特图和日历的能力来跟踪项目的进展。 Redmine的设置相当灵活,支持多种数据库后端和几十种语言,还是可定制的,可以添加自定义字段到问题,用户,工程和更多。通过社区创建的插件和主题它可以进一步定制。 @@ -21,17 +21,17 @@ Redmine的设置相当灵活,支持多种数据库后端和几十种语言, ## Bugzilla -[Bugzilla](https://www.bugzilla.org/)是另一个流行的有问题追踪功能的开发工具。从名字您可能已经猜到了,Bugzilla最初是[Mozilla基金会](https://www.mozilla.org/en-US/)创建,用来跟踪当时称为网景通信套件开发漏洞的。为了更好的通过性从原来的Tcl移植到Perl路径,Bugzilla是一个比较老的和更广泛采用的问题跟踪系统,因为它用在许多著名的开源项目如GNOME,KDE,Linux内核本身。 +[Bugzilla](https://www.bugzilla.org/)是另一个流行的有漏洞追踪功能的开发工具。从名字您可能已经猜到了,Bugzilla最初是[Mozilla基金会](https://www.mozilla.org/en-US/)创建,用来跟踪当时称为网景通信套件开发漏洞的。为了更好的通过性从原来的Tcl移植到Perl路径,Bugzilla是一个比较老的和更广泛采用的问题跟踪系统,因为它用在许多著名的开源项目如GNOME,KDE,Linux内核本身。 拥有一些先进的工具,从通知到共享搜索重复的漏洞检测,Bugzilla是一个功能更丰富的选项。Bugzilla有高级搜索系统与全面的报表工具,生成图表和自动化计划报告的能力。像Redmine,Bugzilla是可扩展和可定制的,两者在字段本身像能创建自定义漏洞工作流一样。它也支持多种后端数据库,和自带的多语言支持。 -Bugzilla在[Mozilla公共许可证](https://en.wikipedia.org/wiki/Mozilla_Public_License)下许可,你可以读取他们[未来路线图](https://www.bugzilla.org/status/roadmap.html)还有在官网测试一个[示例服务](https://landfill.bugzilla.org/) +Bugzilla在[Mozilla公共许可证](https://en.wikipedia.org/wiki/Mozilla_Public_License)下许可,你可以读取他们[未来路线图](https://www.bugzilla.org/status/roadmap.html)还有在官网尝试一个[示例服务](https://landfill.bugzilla.org/) ![](https://opensource.com/sites/default/files/images/business-uploads/issues-bugzilla.png) ## Trac -[Trac](http://trac.edgewall.org/browser)自称是使用基于web简单的方法的软件工程管理软件,但不要混淆极简主义与缺乏功能。 +[Trac](http://trac.edgewall.org/browser)自称是使用简单的方法基于web的软件工程管理软件,但不要混淆极简主义与缺乏功能。 python编写,Trac紧密结合它的漏洞跟踪与它的wiki系统和你选择的版本控制系统。项目管理能力突出,如生成的里程碑和路线图,一个可定制的报表系统,大事记,支持多资源库,内置的垃圾邮件过滤,还可以使用很多一般的语言。如其他漏洞追踪软件我们已经看到,有很多插件可进一步扩展其基本特性。 From 83e522b07505011ffe88486379bebed5f0967c68 Mon Sep 17 00:00:00 2001 From: martin qi Date: Wed, 24 Feb 2016 21:20:10 +0800 Subject: [PATCH 0413/1469] Translated --- ...Releases Free Linux IDE for 32-Bit MCUs.md | 43 +++++++-------- ...Releases Free Linux IDE for 32-Bit MCUs.md | 55 +++++++++++++++++++ 2 files changed, 76 insertions(+), 22 deletions(-) create mode 100644 translated/tech/20160218 ST Releases Free Linux IDE for 32-Bit MCUs.md diff --git a/sources/tech/20160218 ST Releases Free Linux IDE for 32-Bit MCUs.md b/sources/tech/20160218 ST Releases Free Linux IDE for 32-Bit MCUs.md index 313bf3b9e5..adc5404a2c 100644 --- a/sources/tech/20160218 ST Releases Free Linux IDE for 32-Bit MCUs.md +++ b/sources/tech/20160218 ST Releases Free Linux IDE for 32-Bit MCUs.md @@ -1,53 +1,52 @@ -martin -ST Releases Free Linux IDE for 32-Bit MCUs +意法半导体为 32 位 微控制器发布了一款自由的 Linux 集成开发环境 ================================================= ![](http://www.linux.com/images/stories/66866/STM32_Nucleo_expansion_board.jpg) -The 32-bit microcontroller world is starting to open up to Linux. This week, leading ARM Cortex-M vendor STMicroelectronics (ST) [released](http://www.st.com/web/en/press/p3781) a free Linux desktop version of its development software for its line of STM32 microcontroller units (MCUs). The tools include ST’s STM32CubeMX configurator and initialization tool, as well as its [System Workbench for STM32 (SW4STM32)](http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1533/PF261797) , an Eclipse-based IDE created by Ac6 Tools. SW4STM32 is supported with toolchain, forums, blogs, and technical support by the [openSTM32.org](http://www.openstm32.org/tiki-index.php?page=HomePage) development community. +32 位微控制器世界向 Linux 敞开大门。本周,领先的 ARM Cortex-M 供应商意法半导体(ST)[发布了](http://www.st.com/web/en/press/p3781) 一款自由的 Linux 桌面版开发程序,该软件面向其旗下的 STM32 微控制单元(MCU)。包含了 ST 的 STM32CubeMX 配置器和初始化工具,以及其 STM32 [系统工作台(SW4STM32)](http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1533/PF261797) ,这个基于 Eclipse 的 IDE 由工具 Ac6 创建。支撑 SW4STM32 的工具链,论坛,博客以及技术会由 [openSTM32.org](http://www.openstm32.org/tiki-index.php?page=HomePage) 开发社区提供。 -"The Linux community is known to attract creative free-thinkers who are adept at sharing ideas and solving challenges efficiently," stated Laurent Desseignes, Microcontroller Ecosystem Marketing Manager, Microcontroller Division, STMicroelectronics. "We are now making it ultra-easy for them to apply their skills to create imaginative new products, leveraging the features and performance of our STM32 family." +“Linux 社区以吸引富有创意的自由思想者而闻名,他们善于交流心得、高效地克服挑战。” Laurent Desseignes,意法半导体微控制器产品部,微控制器生态系统市场经理这么说道:“我们正着手做的是让他们能极端简单的借力 STM32 系列的特性和性能施展自己的才能,运用到富有想象力的新产品的创造中去。 -Linux is the leading platform for Internet of Things gateways and hubs, as well as higher-end IoT endpoints. Yet, much of the IoT revolution, as well as the wearables market, is based on tiny, low-power microcontrollers, increasingly Cortex-M chips. A small subset of these can run the stripped-down uCLinux (see below), but none support more comprehensive Linux distributions. Instead, they are controlled with real-time operating systems (RTOSes) or go bare-bones with no OS at all. The firmware development work is typically done on a Windows-based Integrated Development Environment (IDE). +Linux 是物联网(IoT)网关和枢纽,及高端 IoT 终端的领先平台。但是,大部分 IoT 革命,以及可穿戴设备市场基于小型的低功耗微控制器,对 Cortex-M 芯片的运用越来越多。虽然其中的一小部分可以运行精简的 uCLinux (见下文),却没能支持更全面的 Linux 发行版。取而代之的是实时操作系统(RTOS)们或者有时干脆不用 OS 来控制。固件的开发工作一般会在基于 Windows 的集成开发环境(IDE)上完成。 -With ST’s free tools, Linux developers can more easily tap this new realm. ST’s tools, some of which should also be available for Mac OS/X in the second quarter, work with [STM32 Nucleo](http://www.st.com/web/en/catalog/tools/FM146/CL2167/SC2003?icmp=sc2003_pron_pr-stm32f446_dec2014&sc=stm32nucleo-pr5) boards, Discovery kits, and Evaluation boards. The Nucleo boards are available in 32-, 64-, and 144-pin versions, and offer hardware add-ons such as Arduino connectors. +通过 ST 的自由工具,Linux 开发者们可以更容易的开疆拓土。ST 工具中的一些技术在第二季度应该登录 Mac OS/X 平台,与 [STM32 Nucleo](http://www.st.com/web/en/catalog/tools/FM146/CL2167/SC2003?icmp=sc2003_pron_pr-stm32f446_dec2014&sc=stm32nucleo-pr5) ,开发套件,以及评估板同时面世。Nucleo 支持 32 针, 64 针, 和 144 针的版本,并且提供类似 Arduino 连接器这样的插件。 -The STM32CubeMX configurator and SW4STM32 IDE enable Linux developers to configure microcontrollers and develop and debug code. SW4STM32 supports the ST-LINK/V2 debugging tool under Linux via an adapted version of the [OpenOCD](http://openocd.org/) community project. +STM32CubeMX 配置器和 IDE SW4STM32 使 Linux 开发者能够配置微控制器并开发调试代码。SW4STM32 支持在 Linux 下通过社区更改版的 [OpenOCD](http://openocd.org/) 使用调试工具 ST-LINK/V2。 -The software is compatible with microcontroller firmware within the STM32Cube embedded-software packages or Standard Peripheral Library, says ST. Targets include ST’s full range of MCUs, from entry-level Cortex-M0 cores to high-performing M7 chips, including M0+, M3, and DSP-extended M4 cores. +据 ST 称,软件兼容 STM32Cube 软件包及标准外设库中的微控制器固件。目标是囊括 ST 的全系列 MCU,从入门级的 Cortex-M0 内核到高性能的 M7 芯片,包括 M0+,M3 和 DSP 扩展的 M4 内核。 -ST is not the first 32-bit MCU vendor to offer Linux-ready IDEs for Cortex-M chips, but it appears to be one of the first major free Linux platforms. For example, NXP, whose share of the MCU market increased with its recent acquisition of Freescale (Kinetis MCUs, among others), offers an [LPCXpresso IDE](http://www.nxp.com/pages/lpcxpresso-ide:LPCXPRESSO) with Linux, Windows, and Mac support. However, LPCXpresso costs $450 per individual seat. +ST 并非首个为 Linux 准备 Cortex-M 芯片 IDE 的 32 位 MCU 供应商,但似乎是第一大自由的 Linux 平台。例如NXP,MCU 的市场份额随着近期收购了 Freescale (Kinetis 系列 MCU,等)而增加,提供了一款 IDE [LPCXpresso IDE](http://www.nxp.com/pages/lpcxpresso-ide:LPCXPRESSO)支持 Linux 、Windows 和 Mac。然而,LPCXpresso 每份售价 $450。 -Microsemi, which integrates Cortex-M3 chips in its [SmartFusion FPGA SoCs](http://www.microsemi.com/products/fpga-soc/soc-processors/arm-cortex-m3) has a [Libero IDE](http://www.linux.com/news/embedded-mobile/mobile-linux/884961-st-releases-free-linux-ide-for-32-bit-mcus#device-support) available for Red Hat Enterprise Linux (RHEL) in addition to Windows. However, Libero requires a license, and the RHEL version lacks support for add-on packages such as FlashPro and SoftConsole. +在其 [SmartFusion FPGA 系统级芯片(SoC)](http://www.microsemi.com/products/fpga-soc/soc-processors/arm-cortex-m3)上集成了 Cortex-M3 芯片的Microsemi,拥有一款 IDE [Libero IDE](http://www.linux.com/news/embedded-mobile/mobile-linux/884961-st-releases-free-linux-ide-for-32-bit-mcus#device-support)适用于 RHEL 和 Windows。然而,Libero 需求许可证,并且 RHEL 版缺乏如 FlashPro 和 SoftConsole 的插件。 -## Why Learn MCU-Speak? +## 为什么要学习 MCU? -Even if a Linux developer has no plans to load uClinux on a Cortex-M chip, knowledge of MCUs should come in handy. This is especially true with complex, heterogeneous IoT projects that extend from MCU-based endpoints to cloud platforms. +即便 Linux 开发者并没有计划在 Cortex-M 上使用 uClinux,但是 MCU 的知识总会派上用场。特别是牵扯到复杂的 IoT 工程,需要扩展 MCU 终端至云端。 -For prototyping and hobbyist projects, an interface to an Arduino board offers fairly easy access to MCU benefits. Yet beyond prototyping, developers often replace the Arduino board and its 8-bit ATmega32u4 MCU with a faster 32-bit Cortex-M chip with additional functionality. This includes improved memory addressing, independent clock settings for the core and various buses, and in the case of some [Cortex-M7](http://www.electronicsnews.com.au/products/stm32-mcus-with-arm-cortex-m7-processors-and-graph) chips, rudimentary graphics. +对于历程和业余爱好者的项目,Arduino 板为其访问 MCU 提供了非常便利的接口。然而历程之外,开发者常常就会用更快的 32 位 Cortex-M 芯片以及所带来的附加功能来替代 Arduino 板和板上的那块 8 位 MCU ATmega32u4。这些附加功能包括改进的存储器寻址,用于芯片和各种总线的独立时钟设置,以及芯片 [Cortex-M7](http://www.electronicsnews.com.au/products/stm32-mcus-with-arm-cortex-m7-processors-and-graph)自带的入门级显示芯片。 -Other categories where MCU development skills might come in handy include wearables, where low power, low cost, and small size give MCUs an edge, and robotics and drones where real-time processing and motor control are the main benefits. In robotics, you’re likely to see Cortex-A and Cortex-M both integrated in the same product. +还有些可能需求 MCU 开发技术的地方有:可穿戴设备、低功耗、低成本和小尺寸给了 MCU 一席之地,还有机器人和无人机这些使用实时处理和电机控制的地方更为受用。在机器人上,你更是有可能看看 Cortex-A 与 Cortex-M 集成在同一个产品中的样子。 -There’s also a modest trend toward system-on-chips adding MCUs to Linux-driven Cortex-A cores, as with the [NXP i.MX6 SoloX](http://linuxgizmos.com/freescales-popular-i-mx6-soc-sprouts-a-cortex-m4-mcu/). While most embedded projects don’t use such hybrid SoCs or combine applications processor and MCUs on the same product, developers may increasingly find themselves working on product lines that extend from low-end MCU models to Linux- or Android-driven Cortex-A based designs. +对于 SoC 芯片还有这样的一种温和的局势,即将 MCU 加入到 Linux 驱动的 Cortex-A 核心中,就如同 [NXP i.MX6 SoloX](http://linuxgizmos.com/freescales-popular-i-mx6-soc-sprouts-a-cortex-m4-mcu/)。虽然大多数的嵌入式项目并不使用这种混合型 SoC 或者说将应用处理器和 MCU 结合在同一产品中,但开发者会渐渐地发现自己工作的生产线、设计所基于的芯片正渐渐的从低端的 MCU 模块发展到 Linux 或安卓驱动的 Cortex-A。 -## uClinux Stakes Linux Claim in MCUs +## uClinux 是 Linux 在 MCU 领域的筹码 -With the rise of IoT, we’re starting to see more SBCs and computer-on-modules that run uClinux on 32-bit MCUs. Unlike other Linux distributions, uClinux does not require a memory management unit (MMU). uClinux does, however, have higher memory requirements than most MCUs can meet. The distro requires higher end Cortex-M4 and Cortex-M4 MCUs with built-in memory controllers supporting external DRAM chips. +随着物联网的兴起,我们见到越来越多的 SBC 和模块计算机,它们在 32 位的 MCU 上运行着 uClinux。不同于其他的 Linux 发行版,uClinux 并不需要内存管理单元(MMU)。然而,uClinux 对市面上可见 MCU 有更高的内存需求。需求更高端的 Cortex-M4 和 Cortex-M4 微控制器内置内存控制器来支持外部 DRAM 芯片。 -[Amptek’s iCon](http://www.semiconductorstore.com/Amptek/) SBCs run uClinux on NXP LPC Cortex-M3 and -M4 chips, offering familiar trappings like WiFi, Bluetooth, USB, and other interfaces. Arrow’s [SF2+](http://linuxgizmos.com/iot-dev-kit-runs-uclinux-on-a-microsemi-cortex-m3-fpga-soc/) IoT development kit runs uClinux on an Emcraft Systems SmartFusion2 COM based on Microsemi’s 166MHz, Cortex-M3/FPGA SmartFusion2 hybrid SoC. +[Amptek](http://www.semiconductorstore.com/Amptek/) SBC 在 NXP LPC Cortex-M3 和 -M4 芯片上运行 uClinux,以提供常用的功能类似 WiFi、蓝牙、USB 等众多接口。Arrow 的 [SF2+](http://linuxgizmos.com/iot-dev-kit-runs-uclinux-on-a-microsemi-cortex-m3-fpga-soc/) 物联网开发套件将 uClinux 运行于 SmartFusion2 模块计算机的 Emcraft 系统上,该模块计算机是 Microsemi 的 166MHz Cortex-M3/FPGA SmartFusion2 混合 SoC。 -[Emcraft](http://www.emcraft.com/), which sells uClinux-based COMs based on ST and NXP, as well as Microsemi MCUs, has been actively promoting the role of uClinux on 32-bit MCUs. Increasingly, uClinux is up against ARM’s own [Mbed OS](http://linuxgizmos.com/arm-announces-mbed-os-for-iot-devices/), at least on high-end MCU projects that require wireless communications and more sophisticated rules-based operation. Proponents of Mbed and modern, open source RTOSes like FreeRTOS say that uClinux requires too much RAM overhead to make it affordable for IoT endpoints. However, Emcraft and other uCLinux proponents claim the costs are overstated, and are worth the more extensive Linux wireless and interface support available even in a stripped down distro like uClinux. +[Emcraft](http://www.emcraft.com/) 销售基于 uClinux 的模块计算机,有 ST 和 NXP 的,也有 Microsemi 的 MCU,是 32 位 MCU 上积极推进 uClinux 的重要角色。日益频繁的 uClinux 开始了与 ARM 本身 [Mbed OS](http://linuxgizmos.com/arm-announces-mbed-os-for-iot-devices/)的对抗,至少在高端的 MCU 工程中需要无线通信和更为复杂的操作规则。Mbed 和 modern 的支持者,开源的 RTOS 们,类似 FreeRTOS 认为 uClinux 需要对 RAM 的需求太高以至于难以压低 IoT 终端的价格然而 Emcraft 与其他 uCLinux 拥趸表示价格并没有如此夸张,而且扩展 Linux 的无线和接口也是相当值得的,即使只是在像 uClinux 这样的精简版上。 -When asked for comment on the ST release, Emcraft director of engineering Vladimir Khusainov had this to say: “ST’s decision to port its development tools to Linux is good news for Emcraft since it allows Linux users an easy way to start working with embedded STM MCUs. We expect that, having had a chance to get familiar with STM devices using the ST configurator and embedded libraries, some of those users may become interested in running embedded Linux (in its uClinux form) on the target.” +当被问及对于这次 ST 发布的看法,Emcraft 的主任工程师 Vladimir Khusainov 表示:”ST决定将这款开发工具 移植至 Linux 对于 Emcraft 是个好消息,它使得 Linux 用户能轻易的在嵌入式 STM MCU 上展开工作。我们希望那些有机会熟悉 STM 设备,使用 ST 配置器和嵌入式库的用户可以对在目标机上使用嵌入式 Linux (以 uClinux 的形式)感兴趣。“ -For a recent overview of uClinux on Cortex-M4, check out this [slide show](http://events.linuxfoundation.org/sites/events/files/slides/optimize-uclinux.pdf) from last year’s Embedded Linux Conference by Jim Huang and Jeff Liaw. More on Cortex-M processors in general may be found in this tidy [AnandTech overview](http://www.anandtech.com/show/8400/arms-cortex-m-even-smaller-and-lower-power-cpu-cores). +最近关于 Cortex-M4 上运行 uClinux 的概述,可以查看去年 Jim Huang 与 Jeff Liaws 在嵌入式 Linux 大会上使用的[幻灯片](http://events.linuxfoundation.org/sites/events/files/slides/optimize-uclinux.pdf)。更多关于 Cortex-M 处理器可以查看这里过的 [AnandTech 总结](http://www.anandtech.com/show/8400/arms-cortex-m-even-smaller-and-lower-power-cpu-cores)。 ------------------------------------------------------------------------------ via: http://www.linux.com/news/embedded-mobile/mobile-linux/884961-st-releases-free-linux-ide-for-32-bit-mcus 作者:[Arun Pyasi][a] -译者:[译者ID](https://github.com/译者ID) +译者:[martin2011qi](https://github.com/martin2011qi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/translated/tech/20160218 ST Releases Free Linux IDE for 32-Bit MCUs.md b/translated/tech/20160218 ST Releases Free Linux IDE for 32-Bit MCUs.md new file mode 100644 index 0000000000..e6dc9cca97 --- /dev/null +++ b/translated/tech/20160218 ST Releases Free Linux IDE for 32-Bit MCUs.md @@ -0,0 +1,55 @@ +ST 为 32 位 MCU 发布了一款自由的 Linux IDE +================================================= + +![](http://www.linux.com/images/stories/66866/STM32_Nucleo_expansion_board.jpg) + +32 位微控制器世界向 Linux 敞开大门。本周,领先的 ARM Cortex-M 供应商意法半导体(ST)[发布了](http://www.st.com/web/en/press/p3781) 一款自由的 Linux 桌面版开发程序,该软件面向其旗下的 STM32 微控制单元(MCU)。包含了 ST 的 STM32CubeMX 配置器和初始化工具,以及其 STM32 [系统工作台(SW4STM32)](http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1533/PF261797) ,这个基于 Eclipse 的 IDE 由工具 Ac6 创建。支撑 SW4STM32 的工具链,论坛,博客以及技术会由 [openSTM32.org](http://www.openstm32.org/tiki-index.php?page=HomePage) 开发社区提供。 + +"Linux 社区以吸引富有创意的自由思想者而闻名,他们善于交流心得、高效地克服挑战。” Laurent Desseignes,意法半导体微控制器产品部,微控制器生态系统市场经理这么说道:“我们正着手做的是让他们能极端简单的借力 STM32 系列的特性和性能施展自己的才能,运用到富有想象力的新产品的创造中去。 + +Linux 是物联网(IoT)网关和枢纽,及高端 IoT 终端的领先平台。但是,大部分 IoT 革命,以及可穿戴设备市场基于小型的低功耗微控制器,对 Cortex-M 芯片的运用越来越多。虽然其中的一小部分可以运行精简的 uCLinux (见下文),却没能支持更全面的 Linux 发行版。取而代之的是实时操作系统(RTOS)们或者干脆不用 OS来控制。固件的开发工作一般会在基于 Windows 的集成开发环境(IDE)上完成。 + +通过 ST 的自由工具,Linux 开发者们可以更容易的开疆拓土。ST 工具中的一些技术在第二季度应该登录 Mac OS/X 平台,与 [STM32 Nucleo](http://www.st.com/web/en/catalog/tools/FM146/CL2167/SC2003?icmp=sc2003_pron_pr-stm32f446_dec2014&sc=stm32nucleo-pr5) ,开发套件,以及评估板同时面世。Nucleo 支持 32 针, 64 针, 和 144 针的版本,并且提供类似 Arduino 连接器这样的插件。 + +STM32CubeMX 配置器和 IDE SW4STM32 是 Linux 开发者能够配置微控制器并开发调试代码。SW4STM32 支持在 Linux 下通过社区更改版的 [OpenOCD](http://openocd.org/) 使用调试工具 ST-LINK/V2。 + +据 ST 称,软件兼容 STM32Cube 软件包及标准外设库中的微控制器固件。目标是囊括 ST 的全系列 MCU,从入门级的 Cortex-M0 内核到高性能的 M7 芯片,包括 M0+,M3 和 DSP 扩展的 M4 内核。 + +ST 并非首个为 Linux 准备 Cortex-M 芯片 IDE 的 32 位 MCU 供应商,但似乎是第一大自由的 Linux 平台之一。例如NXP,MCU 的市场份额随着近期收购了 Freescale (Kinetis 系列 MCU,等)而增加,提供了一款 IDE [LPCXpresso IDE](http://www.nxp.com/pages/lpcxpresso-ide:LPCXPRESSO)支持 Linux 、Windows 和 Mac。然而,LPCXpresso 每份售价 $450。 + +在其 [SmartFusion FPGA SoCs](http://www.microsemi.com/products/fpga-soc/soc-processors/arm-cortex-m3)上集成了 Cortex-M3 芯片的拥有一款 IDE [Libero IDE](http://www.linux.com/news/embedded-mobile/mobile-linux/884961-st-releases-free-linux-ide-for-32-bit-mcus#device-support)适用于 RHEL 和 Windows。然而,Libero 需求许可证,并且 RHEL 版缺乏插件,比如 FlashPro 和 SoftConsole。 + +## 为什么要学习 MCU? + +即便 Linux 开发者并没有计划在 Cortex-M 上使用 uClinux,但是 MCU 的知识总会派上用场。特别是牵扯到复杂的 IoT 工程,需要扩展 MCU 终端至云端。 + +对于历程和业余爱好者的项目,Arduino 板为其访问 MCU 提供了非常便利的接口。然而历程之外,开发者常常就会用更快的 32 位 Cortex-M 芯片以及所带来的附加功能来替代 Arduino 板和板上的那块 8 位 MCU ATmega32u4。这些附加功能包括改进的存储器寻址,用于芯片和各种总线的独立时钟设置,以及芯片 [Cortex-M7](http://www.electronicsnews.com.au/products/stm32-mcus-with-arm-cortex-m7-processors-and-graph)自带的入门级显示芯片。 + +还有些可能需求 MCU 开发技术的地方有:可穿戴设备、低功耗、低成本和小尺寸给了 MCU 一席之地,还有机器人和无人机这些使用实时处理和电机控制的地方更为受用。在机器人上,你更是有可能看看 Cortex-A 与 Cortex-M 集成在同一个产品中的样子。 + +对于 SoC 芯片还有这样的一种温和的局势,即将 MCU 加入到 Linux 驱动的 Cortex-A 核心中,就如同 [NXP i.MX6 SoloX](http://linuxgizmos.com/freescales-popular-i-mx6-soc-sprouts-a-cortex-m4-mcu/)。 +虽然大多数的嵌入式项目并不使用这种混合型 SoC 或者说将应用处理器和 MCU 结合在同一产品中,但开发者会渐渐地发现自己工作的生产线、设计所基于的芯片正渐渐的从低端的 MCU 模块发展到 Linux 或安卓驱动的 Cortex-A。 + +## uClinux 是 Linux 在 MCU 领域的筹码 + +随着物联网的兴起,我们见到越来越多的 SBC 和模块计算机,它们在 32 位的 MCU 上运行着 uClinux。不同于其他的 Linux 发行版,uClinux 并不需要内存管理单元(MMU)。然而,uClinux 对市面上可见 MCU 有更高的内存需求。需求更高端的 Cortex-M4 和 Cortex-M4 微控制器内置内存控制器来支持外部 DRAM 芯片。 + +[Amptek 图标](http://www.semiconductorstore.com/Amptek/) SBC 在 NXP LPC Cortex-M3 和 -M4 芯片上运行 uClinux,以提供常用的功能类似 WiFi、蓝牙、USB 等众多接口。Arrow 的 [SF2+](http://linuxgizmos.com/iot-dev-kit-runs-uclinux-on-a-microsemi-cortex-m3-fpga-soc/) 物联网开发套件将 uClinux 运行于 SmartFusion2 模块计算机的 Emcraft 系统上,该模块计算机是 Microsemi 的 166MHz Cortex-M3/FPGA SmartFusion2 混合片上系统。 + +[Emcraft](http://www.emcraft.com/) 销售基于 uClinux 的模块计算机,有 ST 和 NXP 的,也有 Microsemi 的 MCU,是 32 位 MCU 上积极推进 uClinux 的重要角色。日益频繁的 uClinux 开始了与 ARM 本身 [Mbed OS](http://linuxgizmos.com/arm-announces-mbed-os-for-iot-devices/)的对抗,至少在高端的 MCU 工程中需要无线通信和更为复杂的操作规则。Mbed 和 modern 的支持者,开源的 RTOS 们,类似 FreeRTOS 认为 uClinux 需要对 RAM 的需求太高以至于难以压低 IoT 终端的价格然而 Emcraft 与其他 uCLinux 拥趸表示价格并没有如此夸张,而且扩展 Linux 的无线和接口也是相当值得的,即使只是在像 uClinux 这样的精简版上。 + +当被问及对于这次 ST 发布的看法,Emcraft 的主任工程师 Vladimir Khusainov 表示:”ST决定将这款开发工具 移植至 Linux 对于 Emcraft 是个好消息,它使得 Linux 用户能轻易的在嵌入式 STM MCU 上展开工作。我们希望那些有机会熟悉 STM 设备,使用 ST 配置器和嵌入式库的用户可以对在目标机上使用嵌入式 Linux (以 uClinux的形式)感兴趣。“ + +最近关于 Cortex-M4 上运行 uClinux 的概述,可以查看去年 Jim Huang 与 Jeff Liaws 在嵌入式 Linux 大会上使用的[幻灯片](http://events.linuxfoundation.org/sites/events/files/slides/optimize-uclinux.pdf)。更多关于 Cortex-M 处理器可以查看这里过的 [AnandTech 总结](http://www.anandtech.com/show/8400/arms-cortex-m-even-smaller-and-lower-power-cpu-cores)。 + +------------------------------------------------------------------------------ + +via: http://www.linux.com/news/embedded-mobile/mobile-linux/884961-st-releases-free-linux-ide-for-32-bit-mcus + +作者:[Arun Pyasi][a] +译者:[martin2011qi](https://github.com/martin2011qi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linux.com/community/forums/person/42808 From d1651db94c4b1d12851701b18978ac91e18f4729 Mon Sep 17 00:00:00 2001 From: martin qi Date: Wed, 24 Feb 2016 21:24:27 +0800 Subject: [PATCH 0414/1469] Translated --- ...Releases Free Linux IDE for 32-Bit MCUs.md | 54 ------------------- ...Releases Free Linux IDE for 32-Bit MCUs.md | 19 ++++--- 2 files changed, 9 insertions(+), 64 deletions(-) delete mode 100644 sources/tech/20160218 ST Releases Free Linux IDE for 32-Bit MCUs.md diff --git a/sources/tech/20160218 ST Releases Free Linux IDE for 32-Bit MCUs.md b/sources/tech/20160218 ST Releases Free Linux IDE for 32-Bit MCUs.md deleted file mode 100644 index adc5404a2c..0000000000 --- a/sources/tech/20160218 ST Releases Free Linux IDE for 32-Bit MCUs.md +++ /dev/null @@ -1,54 +0,0 @@ -意法半导体为 32 位 微控制器发布了一款自由的 Linux 集成开发环境 -================================================= - -![](http://www.linux.com/images/stories/66866/STM32_Nucleo_expansion_board.jpg) - -32 位微控制器世界向 Linux 敞开大门。本周,领先的 ARM Cortex-M 供应商意法半导体(ST)[发布了](http://www.st.com/web/en/press/p3781) 一款自由的 Linux 桌面版开发程序,该软件面向其旗下的 STM32 微控制单元(MCU)。包含了 ST 的 STM32CubeMX 配置器和初始化工具,以及其 STM32 [系统工作台(SW4STM32)](http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1533/PF261797) ,这个基于 Eclipse 的 IDE 由工具 Ac6 创建。支撑 SW4STM32 的工具链,论坛,博客以及技术会由 [openSTM32.org](http://www.openstm32.org/tiki-index.php?page=HomePage) 开发社区提供。 - -“Linux 社区以吸引富有创意的自由思想者而闻名,他们善于交流心得、高效地克服挑战。” Laurent Desseignes,意法半导体微控制器产品部,微控制器生态系统市场经理这么说道:“我们正着手做的是让他们能极端简单的借力 STM32 系列的特性和性能施展自己的才能,运用到富有想象力的新产品的创造中去。 - -Linux 是物联网(IoT)网关和枢纽,及高端 IoT 终端的领先平台。但是,大部分 IoT 革命,以及可穿戴设备市场基于小型的低功耗微控制器,对 Cortex-M 芯片的运用越来越多。虽然其中的一小部分可以运行精简的 uCLinux (见下文),却没能支持更全面的 Linux 发行版。取而代之的是实时操作系统(RTOS)们或者有时干脆不用 OS 来控制。固件的开发工作一般会在基于 Windows 的集成开发环境(IDE)上完成。 - -通过 ST 的自由工具,Linux 开发者们可以更容易的开疆拓土。ST 工具中的一些技术在第二季度应该登录 Mac OS/X 平台,与 [STM32 Nucleo](http://www.st.com/web/en/catalog/tools/FM146/CL2167/SC2003?icmp=sc2003_pron_pr-stm32f446_dec2014&sc=stm32nucleo-pr5) ,开发套件,以及评估板同时面世。Nucleo 支持 32 针, 64 针, 和 144 针的版本,并且提供类似 Arduino 连接器这样的插件。 - -STM32CubeMX 配置器和 IDE SW4STM32 使 Linux 开发者能够配置微控制器并开发调试代码。SW4STM32 支持在 Linux 下通过社区更改版的 [OpenOCD](http://openocd.org/) 使用调试工具 ST-LINK/V2。 - -据 ST 称,软件兼容 STM32Cube 软件包及标准外设库中的微控制器固件。目标是囊括 ST 的全系列 MCU,从入门级的 Cortex-M0 内核到高性能的 M7 芯片,包括 M0+,M3 和 DSP 扩展的 M4 内核。 - -ST 并非首个为 Linux 准备 Cortex-M 芯片 IDE 的 32 位 MCU 供应商,但似乎是第一大自由的 Linux 平台。例如NXP,MCU 的市场份额随着近期收购了 Freescale (Kinetis 系列 MCU,等)而增加,提供了一款 IDE [LPCXpresso IDE](http://www.nxp.com/pages/lpcxpresso-ide:LPCXPRESSO)支持 Linux 、Windows 和 Mac。然而,LPCXpresso 每份售价 $450。 - -在其 [SmartFusion FPGA 系统级芯片(SoC)](http://www.microsemi.com/products/fpga-soc/soc-processors/arm-cortex-m3)上集成了 Cortex-M3 芯片的Microsemi,拥有一款 IDE [Libero IDE](http://www.linux.com/news/embedded-mobile/mobile-linux/884961-st-releases-free-linux-ide-for-32-bit-mcus#device-support)适用于 RHEL 和 Windows。然而,Libero 需求许可证,并且 RHEL 版缺乏如 FlashPro 和 SoftConsole 的插件。 - -## 为什么要学习 MCU? - -即便 Linux 开发者并没有计划在 Cortex-M 上使用 uClinux,但是 MCU 的知识总会派上用场。特别是牵扯到复杂的 IoT 工程,需要扩展 MCU 终端至云端。 - -对于历程和业余爱好者的项目,Arduino 板为其访问 MCU 提供了非常便利的接口。然而历程之外,开发者常常就会用更快的 32 位 Cortex-M 芯片以及所带来的附加功能来替代 Arduino 板和板上的那块 8 位 MCU ATmega32u4。这些附加功能包括改进的存储器寻址,用于芯片和各种总线的独立时钟设置,以及芯片 [Cortex-M7](http://www.electronicsnews.com.au/products/stm32-mcus-with-arm-cortex-m7-processors-and-graph)自带的入门级显示芯片。 - -还有些可能需求 MCU 开发技术的地方有:可穿戴设备、低功耗、低成本和小尺寸给了 MCU 一席之地,还有机器人和无人机这些使用实时处理和电机控制的地方更为受用。在机器人上,你更是有可能看看 Cortex-A 与 Cortex-M 集成在同一个产品中的样子。 - -对于 SoC 芯片还有这样的一种温和的局势,即将 MCU 加入到 Linux 驱动的 Cortex-A 核心中,就如同 [NXP i.MX6 SoloX](http://linuxgizmos.com/freescales-popular-i-mx6-soc-sprouts-a-cortex-m4-mcu/)。虽然大多数的嵌入式项目并不使用这种混合型 SoC 或者说将应用处理器和 MCU 结合在同一产品中,但开发者会渐渐地发现自己工作的生产线、设计所基于的芯片正渐渐的从低端的 MCU 模块发展到 Linux 或安卓驱动的 Cortex-A。 - -## uClinux 是 Linux 在 MCU 领域的筹码 - -随着物联网的兴起,我们见到越来越多的 SBC 和模块计算机,它们在 32 位的 MCU 上运行着 uClinux。不同于其他的 Linux 发行版,uClinux 并不需要内存管理单元(MMU)。然而,uClinux 对市面上可见 MCU 有更高的内存需求。需求更高端的 Cortex-M4 和 Cortex-M4 微控制器内置内存控制器来支持外部 DRAM 芯片。 - -[Amptek](http://www.semiconductorstore.com/Amptek/) SBC 在 NXP LPC Cortex-M3 和 -M4 芯片上运行 uClinux,以提供常用的功能类似 WiFi、蓝牙、USB 等众多接口。Arrow 的 [SF2+](http://linuxgizmos.com/iot-dev-kit-runs-uclinux-on-a-microsemi-cortex-m3-fpga-soc/) 物联网开发套件将 uClinux 运行于 SmartFusion2 模块计算机的 Emcraft 系统上,该模块计算机是 Microsemi 的 166MHz Cortex-M3/FPGA SmartFusion2 混合 SoC。 - -[Emcraft](http://www.emcraft.com/) 销售基于 uClinux 的模块计算机,有 ST 和 NXP 的,也有 Microsemi 的 MCU,是 32 位 MCU 上积极推进 uClinux 的重要角色。日益频繁的 uClinux 开始了与 ARM 本身 [Mbed OS](http://linuxgizmos.com/arm-announces-mbed-os-for-iot-devices/)的对抗,至少在高端的 MCU 工程中需要无线通信和更为复杂的操作规则。Mbed 和 modern 的支持者,开源的 RTOS 们,类似 FreeRTOS 认为 uClinux 需要对 RAM 的需求太高以至于难以压低 IoT 终端的价格然而 Emcraft 与其他 uCLinux 拥趸表示价格并没有如此夸张,而且扩展 Linux 的无线和接口也是相当值得的,即使只是在像 uClinux 这样的精简版上。 - -当被问及对于这次 ST 发布的看法,Emcraft 的主任工程师 Vladimir Khusainov 表示:”ST决定将这款开发工具 移植至 Linux 对于 Emcraft 是个好消息,它使得 Linux 用户能轻易的在嵌入式 STM MCU 上展开工作。我们希望那些有机会熟悉 STM 设备,使用 ST 配置器和嵌入式库的用户可以对在目标机上使用嵌入式 Linux (以 uClinux 的形式)感兴趣。“ - -最近关于 Cortex-M4 上运行 uClinux 的概述,可以查看去年 Jim Huang 与 Jeff Liaws 在嵌入式 Linux 大会上使用的[幻灯片](http://events.linuxfoundation.org/sites/events/files/slides/optimize-uclinux.pdf)。更多关于 Cortex-M 处理器可以查看这里过的 [AnandTech 总结](http://www.anandtech.com/show/8400/arms-cortex-m-even-smaller-and-lower-power-cpu-cores)。 - ------------------------------------------------------------------------------- - -via: http://www.linux.com/news/embedded-mobile/mobile-linux/884961-st-releases-free-linux-ide-for-32-bit-mcus - -作者:[Arun Pyasi][a] -译者:[martin2011qi](https://github.com/martin2011qi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.linux.com/community/forums/person/42808 diff --git a/translated/tech/20160218 ST Releases Free Linux IDE for 32-Bit MCUs.md b/translated/tech/20160218 ST Releases Free Linux IDE for 32-Bit MCUs.md index e6dc9cca97..adc5404a2c 100644 --- a/translated/tech/20160218 ST Releases Free Linux IDE for 32-Bit MCUs.md +++ b/translated/tech/20160218 ST Releases Free Linux IDE for 32-Bit MCUs.md @@ -1,23 +1,23 @@ -ST 为 32 位 MCU 发布了一款自由的 Linux IDE +意法半导体为 32 位 微控制器发布了一款自由的 Linux 集成开发环境 ================================================= ![](http://www.linux.com/images/stories/66866/STM32_Nucleo_expansion_board.jpg) 32 位微控制器世界向 Linux 敞开大门。本周,领先的 ARM Cortex-M 供应商意法半导体(ST)[发布了](http://www.st.com/web/en/press/p3781) 一款自由的 Linux 桌面版开发程序,该软件面向其旗下的 STM32 微控制单元(MCU)。包含了 ST 的 STM32CubeMX 配置器和初始化工具,以及其 STM32 [系统工作台(SW4STM32)](http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1533/PF261797) ,这个基于 Eclipse 的 IDE 由工具 Ac6 创建。支撑 SW4STM32 的工具链,论坛,博客以及技术会由 [openSTM32.org](http://www.openstm32.org/tiki-index.php?page=HomePage) 开发社区提供。 -"Linux 社区以吸引富有创意的自由思想者而闻名,他们善于交流心得、高效地克服挑战。” Laurent Desseignes,意法半导体微控制器产品部,微控制器生态系统市场经理这么说道:“我们正着手做的是让他们能极端简单的借力 STM32 系列的特性和性能施展自己的才能,运用到富有想象力的新产品的创造中去。 +“Linux 社区以吸引富有创意的自由思想者而闻名,他们善于交流心得、高效地克服挑战。” Laurent Desseignes,意法半导体微控制器产品部,微控制器生态系统市场经理这么说道:“我们正着手做的是让他们能极端简单的借力 STM32 系列的特性和性能施展自己的才能,运用到富有想象力的新产品的创造中去。 -Linux 是物联网(IoT)网关和枢纽,及高端 IoT 终端的领先平台。但是,大部分 IoT 革命,以及可穿戴设备市场基于小型的低功耗微控制器,对 Cortex-M 芯片的运用越来越多。虽然其中的一小部分可以运行精简的 uCLinux (见下文),却没能支持更全面的 Linux 发行版。取而代之的是实时操作系统(RTOS)们或者干脆不用 OS来控制。固件的开发工作一般会在基于 Windows 的集成开发环境(IDE)上完成。 +Linux 是物联网(IoT)网关和枢纽,及高端 IoT 终端的领先平台。但是,大部分 IoT 革命,以及可穿戴设备市场基于小型的低功耗微控制器,对 Cortex-M 芯片的运用越来越多。虽然其中的一小部分可以运行精简的 uCLinux (见下文),却没能支持更全面的 Linux 发行版。取而代之的是实时操作系统(RTOS)们或者有时干脆不用 OS 来控制。固件的开发工作一般会在基于 Windows 的集成开发环境(IDE)上完成。 通过 ST 的自由工具,Linux 开发者们可以更容易的开疆拓土。ST 工具中的一些技术在第二季度应该登录 Mac OS/X 平台,与 [STM32 Nucleo](http://www.st.com/web/en/catalog/tools/FM146/CL2167/SC2003?icmp=sc2003_pron_pr-stm32f446_dec2014&sc=stm32nucleo-pr5) ,开发套件,以及评估板同时面世。Nucleo 支持 32 针, 64 针, 和 144 针的版本,并且提供类似 Arduino 连接器这样的插件。 -STM32CubeMX 配置器和 IDE SW4STM32 是 Linux 开发者能够配置微控制器并开发调试代码。SW4STM32 支持在 Linux 下通过社区更改版的 [OpenOCD](http://openocd.org/) 使用调试工具 ST-LINK/V2。 +STM32CubeMX 配置器和 IDE SW4STM32 使 Linux 开发者能够配置微控制器并开发调试代码。SW4STM32 支持在 Linux 下通过社区更改版的 [OpenOCD](http://openocd.org/) 使用调试工具 ST-LINK/V2。 据 ST 称,软件兼容 STM32Cube 软件包及标准外设库中的微控制器固件。目标是囊括 ST 的全系列 MCU,从入门级的 Cortex-M0 内核到高性能的 M7 芯片,包括 M0+,M3 和 DSP 扩展的 M4 内核。 -ST 并非首个为 Linux 准备 Cortex-M 芯片 IDE 的 32 位 MCU 供应商,但似乎是第一大自由的 Linux 平台之一。例如NXP,MCU 的市场份额随着近期收购了 Freescale (Kinetis 系列 MCU,等)而增加,提供了一款 IDE [LPCXpresso IDE](http://www.nxp.com/pages/lpcxpresso-ide:LPCXPRESSO)支持 Linux 、Windows 和 Mac。然而,LPCXpresso 每份售价 $450。 +ST 并非首个为 Linux 准备 Cortex-M 芯片 IDE 的 32 位 MCU 供应商,但似乎是第一大自由的 Linux 平台。例如NXP,MCU 的市场份额随着近期收购了 Freescale (Kinetis 系列 MCU,等)而增加,提供了一款 IDE [LPCXpresso IDE](http://www.nxp.com/pages/lpcxpresso-ide:LPCXPRESSO)支持 Linux 、Windows 和 Mac。然而,LPCXpresso 每份售价 $450。 -在其 [SmartFusion FPGA SoCs](http://www.microsemi.com/products/fpga-soc/soc-processors/arm-cortex-m3)上集成了 Cortex-M3 芯片的拥有一款 IDE [Libero IDE](http://www.linux.com/news/embedded-mobile/mobile-linux/884961-st-releases-free-linux-ide-for-32-bit-mcus#device-support)适用于 RHEL 和 Windows。然而,Libero 需求许可证,并且 RHEL 版缺乏插件,比如 FlashPro 和 SoftConsole。 +在其 [SmartFusion FPGA 系统级芯片(SoC)](http://www.microsemi.com/products/fpga-soc/soc-processors/arm-cortex-m3)上集成了 Cortex-M3 芯片的Microsemi,拥有一款 IDE [Libero IDE](http://www.linux.com/news/embedded-mobile/mobile-linux/884961-st-releases-free-linux-ide-for-32-bit-mcus#device-support)适用于 RHEL 和 Windows。然而,Libero 需求许可证,并且 RHEL 版缺乏如 FlashPro 和 SoftConsole 的插件。 ## 为什么要学习 MCU? @@ -27,18 +27,17 @@ ST 并非首个为 Linux 准备 Cortex-M 芯片 IDE 的 32 位 MCU 供应商, 还有些可能需求 MCU 开发技术的地方有:可穿戴设备、低功耗、低成本和小尺寸给了 MCU 一席之地,还有机器人和无人机这些使用实时处理和电机控制的地方更为受用。在机器人上,你更是有可能看看 Cortex-A 与 Cortex-M 集成在同一个产品中的样子。 -对于 SoC 芯片还有这样的一种温和的局势,即将 MCU 加入到 Linux 驱动的 Cortex-A 核心中,就如同 [NXP i.MX6 SoloX](http://linuxgizmos.com/freescales-popular-i-mx6-soc-sprouts-a-cortex-m4-mcu/)。 -虽然大多数的嵌入式项目并不使用这种混合型 SoC 或者说将应用处理器和 MCU 结合在同一产品中,但开发者会渐渐地发现自己工作的生产线、设计所基于的芯片正渐渐的从低端的 MCU 模块发展到 Linux 或安卓驱动的 Cortex-A。 +对于 SoC 芯片还有这样的一种温和的局势,即将 MCU 加入到 Linux 驱动的 Cortex-A 核心中,就如同 [NXP i.MX6 SoloX](http://linuxgizmos.com/freescales-popular-i-mx6-soc-sprouts-a-cortex-m4-mcu/)。虽然大多数的嵌入式项目并不使用这种混合型 SoC 或者说将应用处理器和 MCU 结合在同一产品中,但开发者会渐渐地发现自己工作的生产线、设计所基于的芯片正渐渐的从低端的 MCU 模块发展到 Linux 或安卓驱动的 Cortex-A。 ## uClinux 是 Linux 在 MCU 领域的筹码 随着物联网的兴起,我们见到越来越多的 SBC 和模块计算机,它们在 32 位的 MCU 上运行着 uClinux。不同于其他的 Linux 发行版,uClinux 并不需要内存管理单元(MMU)。然而,uClinux 对市面上可见 MCU 有更高的内存需求。需求更高端的 Cortex-M4 和 Cortex-M4 微控制器内置内存控制器来支持外部 DRAM 芯片。 -[Amptek 图标](http://www.semiconductorstore.com/Amptek/) SBC 在 NXP LPC Cortex-M3 和 -M4 芯片上运行 uClinux,以提供常用的功能类似 WiFi、蓝牙、USB 等众多接口。Arrow 的 [SF2+](http://linuxgizmos.com/iot-dev-kit-runs-uclinux-on-a-microsemi-cortex-m3-fpga-soc/) 物联网开发套件将 uClinux 运行于 SmartFusion2 模块计算机的 Emcraft 系统上,该模块计算机是 Microsemi 的 166MHz Cortex-M3/FPGA SmartFusion2 混合片上系统。 +[Amptek](http://www.semiconductorstore.com/Amptek/) SBC 在 NXP LPC Cortex-M3 和 -M4 芯片上运行 uClinux,以提供常用的功能类似 WiFi、蓝牙、USB 等众多接口。Arrow 的 [SF2+](http://linuxgizmos.com/iot-dev-kit-runs-uclinux-on-a-microsemi-cortex-m3-fpga-soc/) 物联网开发套件将 uClinux 运行于 SmartFusion2 模块计算机的 Emcraft 系统上,该模块计算机是 Microsemi 的 166MHz Cortex-M3/FPGA SmartFusion2 混合 SoC。 [Emcraft](http://www.emcraft.com/) 销售基于 uClinux 的模块计算机,有 ST 和 NXP 的,也有 Microsemi 的 MCU,是 32 位 MCU 上积极推进 uClinux 的重要角色。日益频繁的 uClinux 开始了与 ARM 本身 [Mbed OS](http://linuxgizmos.com/arm-announces-mbed-os-for-iot-devices/)的对抗,至少在高端的 MCU 工程中需要无线通信和更为复杂的操作规则。Mbed 和 modern 的支持者,开源的 RTOS 们,类似 FreeRTOS 认为 uClinux 需要对 RAM 的需求太高以至于难以压低 IoT 终端的价格然而 Emcraft 与其他 uCLinux 拥趸表示价格并没有如此夸张,而且扩展 Linux 的无线和接口也是相当值得的,即使只是在像 uClinux 这样的精简版上。 -当被问及对于这次 ST 发布的看法,Emcraft 的主任工程师 Vladimir Khusainov 表示:”ST决定将这款开发工具 移植至 Linux 对于 Emcraft 是个好消息,它使得 Linux 用户能轻易的在嵌入式 STM MCU 上展开工作。我们希望那些有机会熟悉 STM 设备,使用 ST 配置器和嵌入式库的用户可以对在目标机上使用嵌入式 Linux (以 uClinux的形式)感兴趣。“ +当被问及对于这次 ST 发布的看法,Emcraft 的主任工程师 Vladimir Khusainov 表示:”ST决定将这款开发工具 移植至 Linux 对于 Emcraft 是个好消息,它使得 Linux 用户能轻易的在嵌入式 STM MCU 上展开工作。我们希望那些有机会熟悉 STM 设备,使用 ST 配置器和嵌入式库的用户可以对在目标机上使用嵌入式 Linux (以 uClinux 的形式)感兴趣。“ 最近关于 Cortex-M4 上运行 uClinux 的概述,可以查看去年 Jim Huang 与 Jeff Liaws 在嵌入式 Linux 大会上使用的[幻灯片](http://events.linuxfoundation.org/sites/events/files/slides/optimize-uclinux.pdf)。更多关于 Cortex-M 处理器可以查看这里过的 [AnandTech 总结](http://www.anandtech.com/show/8400/arms-cortex-m-even-smaller-and-lower-power-cpu-cores)。 From a0a37c0fbaa909b1cfa2ad7d7c4f26488f362312 Mon Sep 17 00:00:00 2001 From: runningwater Date: Thu, 25 Feb 2016 00:15:02 +0800 Subject: [PATCH 0415/1469] =?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 --- ...isk in Linux CentOS 7 Without Rebooting.md | 174 ------------------ ...isk in Linux CentOS 7 Without Rebooting.md | 173 +++++++++++++++++ 2 files changed, 173 insertions(+), 174 deletions(-) delete mode 100644 sources/tech/20160212 How to Add New Disk in Linux CentOS 7 Without Rebooting.md create mode 100644 translated/tech/20160212 How to Add New Disk in Linux CentOS 7 Without Rebooting.md diff --git a/sources/tech/20160212 How to Add New Disk in Linux CentOS 7 Without Rebooting.md b/sources/tech/20160212 How to Add New Disk in Linux CentOS 7 Without Rebooting.md deleted file mode 100644 index 006d4f9905..0000000000 --- a/sources/tech/20160212 How to Add New Disk in Linux CentOS 7 Without Rebooting.md +++ /dev/null @@ -1,174 +0,0 @@ -(翻译中 by runningwater) -How to Add New Disk in Linux CentOS 7 Without Rebooting -================================================================================ - -Increasing disk spaces on the Linux servers is a daily routine work for very system administrator. So, in this article we are going to show you some simple simple steps that you can use to increase your disk spaces on Linux CentOS 7 without rebooting to your production server using Linux commands. We will cover multiple methods and possibilities to increase and add new disks to the Linux systems, so that you can follow the one that you feel comfortable while using according to your requirements. - -### 1. Increasing Disk of VM Guest: ### - -Before increasing the disk volume inside your Linux system, you need to add a new disk or increase the one its has already attached with the system by editing its settings from your VMware vShere, Workstation or any other infrastructure environment that you are using. - -![Increase disk](http://blog.linoxide.com/wp-content/uploads/2016/02/1.png) - -### 2. Check Disk Space: ### - -Run the following command to check the current size of your disk space. - - # df -h - # fdisk -l - -![Fdisk check](http://blog.linoxide.com/wp-content/uploads/2016/02/2.png) - -Here we can see that the total disk size is still the same that is 10 GB while we have already increased it to 50 GB from the back end. - -### 3. Expanding Space without Rebooting VM ### - -Now run the following commands to expand the disk space in the physical volume of the Operating System without rebooting the virtual machine by Re-scanning the SCSI Bus and then adding SCSI Device. - - # ls /sys/class/scsi_host/ - # echo "- - -" > /sys/class/scsi_host/host0/scan - # echo "- - -" > /sys/class/scsi_host/host1/scan - # echo "- - -" > /sys/class/scsi_host/host2/scan - -Check the names of your SCSI devices and then rescan the SCSI buses using below commands. - - # ls /sys/class/scsi_device/ - # echo 1 > /sys/class/scsi_device/0\:0\:0\:0/device/rescan - # echo 1 > /sys/class/scsi_device/2\:0\:0\:0/device/rescan - -That will rescan the current scsi bus and the disk size that we increased from the VM guest settings will be show up as you can see in the below image. - -![Rescan disk device](http://blog.linoxide.com/wp-content/uploads/2016/02/3.png) - -### 4. New Disk Partition: ### - -Once you are able to see the increased disk space inside your system then the run the following command to format your disk for creating a new partition by following the steps to increase your physical disk volume. - - # fdisk /dev/sda - Welcome to fdisk (util-linux 2.23.2) press the 'm' key for help - Command (m for help): m - Command action - a toggle a bootable flag - b edit bsd disklabel - c toggle the dos compatibility flag - d delete a partition - g create a new empty GPT partition table - G create an IRIX (SGI) partition table - l list known partition types - m print this menu - n add a new partition - o create a new empty DOS partition table - p print the partition table - q quit without saving changes - s create a new empty Sun disklabel - t change a partition's system id - u change display/entry units - v verify the partition table - w write table to disk and exit - x extra functionality (experts only) - - Command (m for help): - -Type the 'p' to print the current partition table then create a new primary partition by typing the 'n' key and selecting the available sectors. Change the disk type to 'Linux LVM' by using 't' command and selecting the code to '8e' or leave as it to its default type that is '83'. - -Now write the table to disk and exit by Entring 'w' key as shown. - - Command (m for help): w - The partition table has been altered! - - Calling ioctl() to re-read partition table. - - WARNING: Re-reading the partition table failed with error 16: Device or resource busy. - The kernel still uses the old table. The new table will be used at - the next reboot or after you run partprobe(8) or kpartx(8) - -![New disk Volume](http://blog.linoxide.com/wp-content/uploads/2016/02/3A.png) - -### 5. Creating Physical Volume: ### - -As indicated above run the 'partprobe' or kpartx command so that the tables are ready to use and then create the new Physical Volume using the below commands. - - # partprobe - # pvresize /dev/sda3 - -To check the newly created volume run the following command to see if the new physical volume has been created and visible. After that we will extend the Volume Group 'centos' with the newly create Physical Volume as shown. - - # pvdisplay - # vgextend centos /dev/sda3 - -![Extend volume Group](http://blog.linoxide.com/wp-content/uploads/2016/02/3B.png) - -### 6. Extending Logical Volume: ### - -Now we will extend the Logical Volume to increase the disk space on it using the the below command. - - # lvextend -L +40G /dev/mapper/centos-root - -Once you get the successfully increased message, run the command as shown below to extend the size of your logical volume . - - # xfs_growfs /dev/mapper/centos-root - -The size of the '/' partition has been increased successfully, you can check the size of your disk drives by using the 'df' command as shown. - -![Increase disk space](http://blog.linoxide.com/wp-content/uploads/2016/02/3C.png) - -### 7. Extending Root Partition by Adding New Disk Without Reboot: ### - -This is the second method with but with quite similar commands to increase the size of the Logical volume in CentOS 7. - -So, the first step is to Open the setting of your VM guest settings and click on the 'Add' new button and proceed to the next option. - -![Add new disk](http://blog.linoxide.com/wp-content/uploads/2016/02/3D.png) - -Choose the required configuration for the new disk by selecting the size of the new disk and its type as shown in the below image. - -![New disk setup](http://blog.linoxide.com/wp-content/uploads/2016/02/3E.png) - -Then come to the server side and repeat the following commands to scan your disk devices to the new disk is visible on the system. - - # echo "- - -" > /sys/class/scsi_host/host0/scan - # echo "- - -" > /sys/class/scsi_host/host1/scan - # echo "- - -" > /sys/class/scsi_host/host2/scan - -List the names of your SCSi devices - - # ls /sys/class/scsi_device/ - # echo 1 > /sys/class/scsi_device/1\:0\:0\:0/device/rescan - # echo 1 > /sys/class/scsi_device/2\:0\:0\:0/device/rescan - # echo 1 > /sys/class/scsi_device/3\:0\:0\:0/device/rescan - # fdisk -l - -![Scanning new disk](http://blog.linoxide.com/wp-content/uploads/2016/02/3F.png) - -Once the new disk is visible run the below commands to create the new physical volume and add it to the volume group as shown. - - # pvcreate /dev/sdb - # vgextend centos /dev/sdb - # vgdisplay - -![Extending Volume Group](http://blog.linoxide.com/wp-content/uploads/2016/02/3G.png) - -Now extend the Logical Volume by adding the disk space on it and then add it to the root partition. - - # lvextend -L +20G /dev/mapper/centos-root - # xfs_growfs /dev/mapper/centos-root - # df -h - -![Increase / Partition](http://blog.linoxide.com/wp-content/uploads/2016/02/3H.png) - -### Conclusion: ### - -Managing disk partitions in Linux CentOS 7 is a simple process to increase the disk space of any of your logical volumes by using the steps as described in this article. You don't need to give your production server's reboot for this purpose but simply rescan your SCSi devices and expand your desired LVM. We hope you find this article much helpful. Feel free to leave your valuable comments or suggestions. - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/add-new-disk-centos-7-without-rebooting/ - -作者:[Kashif S][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/ \ No newline at end of file diff --git a/translated/tech/20160212 How to Add New Disk in Linux CentOS 7 Without Rebooting.md b/translated/tech/20160212 How to Add New Disk in Linux CentOS 7 Without Rebooting.md new file mode 100644 index 0000000000..adfb7f556f --- /dev/null +++ b/translated/tech/20160212 How to Add New Disk in Linux CentOS 7 Without Rebooting.md @@ -0,0 +1,173 @@ +如何在CentOS 7 中添加新磁盘而不用重启系统 +================================================================================ + +对大多数系统管理员来说扩充 Linux 服务器的磁盘空间是日常的工作之一。因此这篇文章会在通过使用 Linux 命令,在 CentOS 7 系统上演示一些简单的操作步骤来扩充您的磁盘空间而不需要重启您的生产服务器。关于扩充和增加新的磁盘到 Linux 系统,我们会提及多种方法和多种可行性,所以可按您所需选择最适用的一种。 + +### 1. 为虚拟机客户端扩充磁盘空间: ### + +在为 Linux 系统增加磁盘卷之前,您需要添加一块新的物理磁盘或是从正使用的 VMware vShere、工作站或着其它的基础虚拟环境软件中进行设置,从而扩充一块系统正使用的虚拟磁盘空间。 + +![Increase disk](http://blog.linoxide.com/wp-content/uploads/2016/02/1.png) + +### 2. 检查磁盘空间: ### + +运行如下命令来检查当前磁盘空间大小。 + + # df -h + # fdisk -l + +![Fdisk check](http://blog.linoxide.com/wp-content/uploads/2016/02/2.png) + +可以看到,虽然我们已经在后端给其增加到 50 GB 的空间,但此时的总磁盘大小仍然为 10 GB。 + +### 3. 扩展空间而无需重启虚拟机 ### + +现在运行如下命令就可以来扩展操作系统的物理卷磁盘空间,而且不需要重启虚拟机,系统会重新扫描 SCSI (注:Small Computer System Interface 小型计算机系统接口)总线并添加 SCSI 设备。 + + # ls /sys/class/scsi_host/ + # echo "- - -" > /sys/class/scsi_host/host0/scan + # echo "- - -" > /sys/class/scsi_host/host1/scan + # echo "- - -" > /sys/class/scsi_host/host2/scan + +使用下面的命令来检查 SCSI 设备的名称,然后重新扫描 SCSI 总线。 + + # ls /sys/class/scsi_device/ + # echo 1 > /sys/class/scsi_device/0\:0\:0\:0/device/rescan + # echo 1 > /sys/class/scsi_device/2\:0\:0\:0/device/rescan + +如下图所示,会重新扫描 SCSI 总线,随后我们从虚拟机客户端设置的磁盘大小会正常显示。 + +![Rescan disk device](http://blog.linoxide.com/wp-content/uploads/2016/02/3.png) + +### 4. 创建新磁盘分区: ### + +一旦在系统中可以看到扩展的磁盘空间,就可以运行如下命令来格式化您的磁盘以创建一个新的分区。请按如下操作步骤来扩充您的物理磁盘卷。 + + # fdisk /dev/sda + Welcome to fdisk (util-linux 2.23.2) press the 'm' key for help + Command (m for help): m + Command action + a toggle a bootable flag + b edit bsd disklabel + c toggle the dos compatibility flag + d delete a partition + g create a new empty GPT partition table + G create an IRIX (SGI) partition table + l list known partition types + m print this menu + n add a new partition + o create a new empty DOS partition table + p print the partition table + q quit without saving changes + s create a new empty Sun disklabel + t change a partition's system id + u change display/entry units + v verify the partition table + w write table to disk and exit + x extra functionality (experts only) + + Command (m for help): + +键入 'p' 来查看当前的分区表信息,然后键入 'n' 键来创建一个新的主分区,选择所有可用的扇区。 使用 't' 命令改变磁盘类型为 'Linux LVM',然后选择编码 '8e' 或者默认不选,它默认的类型编码为 '83'。 + +现在输入 'w' 来保存分区表信息并且退出命令环境,如下示: + + Command (m for help): w + The partition table has been altered! + + Calling ioctl() to re-read partition table. + + WARNING: Re-reading the partition table failed with error 16: Device or resource busy. + The kernel still uses the old table. The new table will be used at + the next reboot or after you run partprobe(8) or kpartx(8) + +![New disk Volume](http://blog.linoxide.com/wp-content/uploads/2016/02/3A.png) + +### 5. 创建物理卷: ### + +根据提示运行 'partprob' 或 'kpartx' 命令以使分区表被真正使用,然后使用如下的命令来创建新的物理卷。 + + # partprobe + # pvresize /dev/sda3 + +要检查新创建的卷,运行如下的命令可以看出新的物理卷是否已经被创建,是否可用。接下来,我们就可以使用这个新的物理卷来扩展 'centos' 卷组了,如下示: + + # pvdisplay + # vgextend centos /dev/sda3 + +![Extend volume Group](http://blog.linoxide.com/wp-content/uploads/2016/02/3B.png) + +### 6. 扩展逻辑卷: ### + +现在我们使用如下的命令扩展逻辑卷,以增加我们系统正使用的磁盘空间。 + + # lvextend -L +40G /dev/mapper/centos-root + +一旦返回增加成功的消息,就可以运行如下命令来扩展您的逻辑卷大小。 + + # xfs_growfs /dev/mapper/centos-root + +'/' 分区的大小已经成功的增加了,可以使用 'df' 命令来检查您磁盘驱动的大小。如图示。 + +![Increase disk space](http://blog.linoxide.com/wp-content/uploads/2016/02/3C.png) + +### 7. 通过增加新的磁盘来扩充根分区而不用重启系统: ### + +这是第二种方法,它使用的命令非常简单, 用来增加 CentOS 7 系统上逻辑卷空间大小。 + +所以第一步是打开您的虚拟机客户端的设置页面,点击 ‘增加’ 按纽,然后继续下一步操作。 + +![Add new disk](http://blog.linoxide.com/wp-content/uploads/2016/02/3D.png) + +选择新磁盘所需要的配置信息,如下图所示的,选择新磁盘的大小和它的类型。 + +![New disk setup](http://blog.linoxide.com/wp-content/uploads/2016/02/3E.png) + +然后进入服务端重复如下的命令来扫描您的磁盘设备,以使新磁盘在系统中可见。 + + # echo "- - -" > /sys/class/scsi_host/host0/scan + # echo "- - -" > /sys/class/scsi_host/host1/scan + # echo "- - -" > /sys/class/scsi_host/host2/scan + +列出您的 SCSI 设备的名称 + + # ls /sys/class/scsi_device/ + # echo 1 > /sys/class/scsi_device/1\:0\:0\:0/device/rescan + # echo 1 > /sys/class/scsi_device/2\:0\:0\:0/device/rescan + # echo 1 > /sys/class/scsi_device/3\:0\:0\:0/device/rescan + # fdisk -l + +![Scanning new disk](http://blog.linoxide.com/wp-content/uploads/2016/02/3F.png) + +一旦新增的磁盘可见就可以运行下面的命令来创建新的物理卷,然后增加到卷组,如下示。 + + # pvcreate /dev/sdb + # vgextend centos /dev/sdb + # vgdisplay + +![Extending Volume Group](http://blog.linoxide.com/wp-content/uploads/2016/02/3G.png) + +现在根据此磁盘的空间大小来扩展逻辑卷,然后添加到根分区。 + + # lvextend -L +20G /dev/mapper/centos-root + # xfs_growfs /dev/mapper/centos-root + # df -h + +![Increase / Partition](http://blog.linoxide.com/wp-content/uploads/2016/02/3H.png) + +### 结论: ### + +在 Linux CentOS 7 系统上,使用这篇文章所述的操作步骤来扩充您的任意逻辑卷的磁盘空间,此管理磁盘分区的操作过程是非常简单的。您不需要重启生产线上的服务器,只是简单的重扫描下 SCSI 设备,和扩展您想要的 LVM(逻辑卷管理)。我们希望这文章对您有用。可自由的发表有用的评论和建议。 + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/add-new-disk-centos-7-without-rebooting/ + +作者:[Kashif S][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/ \ No newline at end of file From bbb269101a9672cf1ca04064ec2f7fa0c6f20359 Mon Sep 17 00:00:00 2001 From: name1e5s <836401406@qq.com> Date: Thu, 25 Feb 2016 09:58:56 +0800 Subject: [PATCH 0416/1469] name1e5s translating... --- .../20160220 Manjaro Linux Is Coming To ARM With Manjaro-ARM.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160220 Manjaro Linux Is Coming To ARM With Manjaro-ARM.md b/sources/tech/20160220 Manjaro Linux Is Coming To ARM With Manjaro-ARM.md index 0d503b3010..14ef0ed776 100644 --- a/sources/tech/20160220 Manjaro Linux Is Coming To ARM With Manjaro-ARM.md +++ b/sources/tech/20160220 Manjaro Linux Is Coming To ARM With Manjaro-ARM.md @@ -1,3 +1,5 @@ +name1e5s translating + Manjaro Linux Is Coming To ARM With Manjaro-ARM =================================================== From 7d010d7154513d78166dc19c4cf5f4d02e0f5aee Mon Sep 17 00:00:00 2001 From: name1e5s <836401406@qq.com> Date: Thu, 25 Feb 2016 10:48:13 +0800 Subject: [PATCH 0417/1469] [translated] 20160220 Manjaro Linux Is Coming To ARM With Manjaro-ARM.md --- ...Linux Is Coming To ARM With Manjaro-ARM.md | 33 ------------------- ...Linux Is Coming To ARM With Manjaro-ARM.md | 31 +++++++++++++++++ 2 files changed, 31 insertions(+), 33 deletions(-) delete mode 100644 sources/tech/20160220 Manjaro Linux Is Coming To ARM With Manjaro-ARM.md create mode 100644 translated/tech/20160220 Manjaro Linux Is Coming To ARM With Manjaro-ARM.md diff --git a/sources/tech/20160220 Manjaro Linux Is Coming To ARM With Manjaro-ARM.md b/sources/tech/20160220 Manjaro Linux Is Coming To ARM With Manjaro-ARM.md deleted file mode 100644 index 14ef0ed776..0000000000 --- a/sources/tech/20160220 Manjaro Linux Is Coming To ARM With Manjaro-ARM.md +++ /dev/null @@ -1,33 +0,0 @@ -name1e5s translating - -Manjaro Linux Is Coming To ARM With Manjaro-ARM -=================================================== - -![](http://itsfoss.com/wp-content/uploads/2016/02/manjaro-arm.jpg) - -Recently, the developers of Manjaro have announced the release of an [alpha build for ARM devices](https://manjaro.github.io/Manjaro-ARM-launched/). This is a big step for the Arch-based distro, which up until this point only ran on 32 and 64-bit PCs. - -According to the announcement, “[Manjaro Arm](http://manjaro-arm.org/) is a project aimed to bring you the simplicity and customability that is Manjaro to [ARM devices](https://www.arm.com/). These devices are growing in numbers and can be used for any number of applications. Most famous is the Raspberry Pi series and BeagleBoard series.” The alpha build only supports the Raspberry Pi 2, but that will undoubtedly grow with time. - -The developers currently include dodgejcr, Torei, Strit, and Ringo32. They are looking for more people to help the project grow and develop. Besides developers, [they are looking for maintainers, moderators and admins, and artists](http://manjaro-arm.org/forums/website/looking-for-contributors/?PHPSESSID=876d5c11400e9c25eb727e9965300a9a). - -Manjaro-ARM will be available in four different versions. The Media Edition will allow you to create a media center with very little configuration and will run Kodi. The Server Edition will come with SSH, FTP, and a LAMP server preconfigured so you can use your ARM device as a file or web server. The Base Edition acts as the desktop edition, with an XFCE desktop. If you want to build you own system from scratch, the Minimal Edition is your choice. It will come with no preloaded packages or desktop, only have a root user. - -## Final Thoughts - -As a fan of Manjaro (I have it installed on 4 computers), I’m glad to hear that they are branching out into the ARM world. ARM is being used in more and more devices. According to technology commentator Robert Cringely, [device makers are starting to look at cheap ARM chips over more expensive Intel or AMD chips](http://www.cringely.com/2016/01/21/prediction-8-intel-starts-to-become-irrelevent/). Even Microsoft (please don’t strike me down) is thinking of porting some of its software to ARM. As the use of ARM powered devices increase, Manjaro will be ready to give those users a great Linux experience. - -What do you think? Do you wish that more Linux distros would create ARM ports? Or do you think that ARM is a passing fad? Tell us below. - ------------------------------------------------------------------------------- - -via: http://itsfoss.com/manjaro-linux-arm/ - -作者:[JOHN PAUL][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/john/ - diff --git a/translated/tech/20160220 Manjaro Linux Is Coming To ARM With Manjaro-ARM.md b/translated/tech/20160220 Manjaro Linux Is Coming To ARM With Manjaro-ARM.md new file mode 100644 index 0000000000..80670c5c7b --- /dev/null +++ b/translated/tech/20160220 Manjaro Linux Is Coming To ARM With Manjaro-ARM.md @@ -0,0 +1,31 @@ +Manjaro Linux 即将推出支持 ARM 处理器的 Manjaro-ARM +=================================================== + +![](http://itsfoss.com/wp-content/uploads/2016/02/manjaro-arm.jpg) + +最近,Manjaro 的开发者为 ARM 处理器发布了一个[ alpha 版本](https://manjaro.github.io/Manjaro-ARM-launched/)。这是这个基于 Arhclinux 的发行版的一大进步,在此之前,它只能在 32 位或者 64 位的个人电脑上运行。 + +根据公告, “[Manjaro Arm](http://manjaro-arm.org/) 项目致力于将简洁可定制的 Manjaro 移植到使用[ ARM 处理器](https://www.arm.com/)的设备上去。这些设备的数量正在上涨并且应用范围广泛。这些设备中最出名的是树莓派和 BeagleBoard“。目前 Alpha 版本仅支持树莓派2,但是毫无疑问,支持的设备数量会随时间增长。 + +现在这个项目的开发者有 dodgejcr, Torei, Strit, 和 Ringo32。他们正在寻求更多的人来帮助这个项目发展。除了开发者,[他们还在寻找维护者,论坛版主,管理员,以及设计师](http://manjaro-arm.org/forums/website/looking-for-contributors/?PHPSESSID=876d5c11400e9c25eb727e9965300a9a)。 + +Manjaro-ARM 将会有四个版本。媒体版本将可以运行Kodi并且允许你很少配置就能创建一个媒体中心。服务器版将会预先配置好 SSH,FTP,LAMP ,你能把你的 ARM 设备当作服务器使用。基本版是一个桌面版本,自带一个 XFCE 桌面。如果你想自己从头折腾系统的话你可以选择迷你版,它没有任何预先配置的包,仅仅包含一个 root 用户。 + +## 我的想法 + +作为一个 Manjaro 的粉丝(我在 4 个电脑上都安了 Manjaro),听说他们分支出一个 ARM 版我很高兴。 ARM 处理器被用到了越来越多的设备当中。如同评论员 Robert Cringely 所说, [设备制造商开始注意到昂贵的因特尔或者AMD处理器之外的便宜的多的ARM处理器](http://www.cringely.com/2016/01/21/prediction-8-intel-starts-to-become-irrelevent/)。甚至微软(憋打我)都开始考虑将自己的一些软件移植到 ARM 处理器上去。随着 ARM 处理器设备数量的增多,Manjaro 将会带给用户良好的体验。 + +对此,你怎样看待?你希望更多的发行版支持 ARM 吗?或者你认为 ARM 将是昙花一现?在评论区告诉我们。 + +------------------------------------------------------------------------------ + +via: http://itsfoss.com/manjaro-linux-arm/ + +作者:[JOHN PAUL][a] +译者:[name1e5s](https://github.com/name1e5s) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/john/ + From 2e7947e057e67346060788df67b08ba71dbb47c8 Mon Sep 17 00:00:00 2001 From: Rubik Date: Thu, 25 Feb 2016 11:36:33 +0800 Subject: [PATCH 0418/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...w to Setup Lighttpd Web server on Ubuntu 15.04 or CentOS 7.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160219 How to Setup Lighttpd Web server on Ubuntu 15.04 or CentOS 7.md b/sources/tech/20160219 How to Setup Lighttpd Web server on Ubuntu 15.04 or CentOS 7.md index f84e9e1e46..51f8050de7 100644 --- a/sources/tech/20160219 How to Setup Lighttpd Web server on Ubuntu 15.04 or CentOS 7.md +++ b/sources/tech/20160219 How to Setup Lighttpd Web server on Ubuntu 15.04 or CentOS 7.md @@ -1,3 +1,4 @@ +[Translating] Haohong Wang How to Setup Lighttpd Web server on Ubuntu 15.04 / CentOS 7 ================================================================================= From 52bf40b2a72fda6311c562ffec2b6abcb0b119d1 Mon Sep 17 00:00:00 2001 From: name1e5s <836401406@qq.com> Date: Thu, 25 Feb 2016 18:20:01 +0800 Subject: [PATCH 0419/1469] name1e5s translating... --- .../20160223 BeeGFS Parallel File System Goes Open Source.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160223 BeeGFS Parallel File System Goes Open Source.md b/sources/tech/20160223 BeeGFS Parallel File System Goes Open Source.md index d65285a222..f563483358 100644 --- a/sources/tech/20160223 BeeGFS Parallel File System Goes Open Source.md +++ b/sources/tech/20160223 BeeGFS Parallel File System Goes Open Source.md @@ -1,3 +1,4 @@ +name1e5s translating BeeGFS Parallel File System Goes Open Source ================================================== From 35256e338657d15663937d2b3747fbafe1fce9cb Mon Sep 17 00:00:00 2001 From: name1e5s <836401406@qq.com> Date: Thu, 25 Feb 2016 19:39:57 +0800 Subject: [PATCH 0420/1469] [translated]BeeGFS Parallel File System Goes Open Source --- ...S Parallel File System Goes Open Source.md | 33 ------------------- ...S Parallel File System Goes Open Source.md | 32 ++++++++++++++++++ 2 files changed, 32 insertions(+), 33 deletions(-) delete mode 100644 sources/tech/20160223 BeeGFS Parallel File System Goes Open Source.md create mode 100644 translated/tech/20160223 BeeGFS Parallel File System Goes Open Source.md diff --git a/sources/tech/20160223 BeeGFS Parallel File System Goes Open Source.md b/sources/tech/20160223 BeeGFS Parallel File System Goes Open Source.md deleted file mode 100644 index f563483358..0000000000 --- a/sources/tech/20160223 BeeGFS Parallel File System Goes Open Source.md +++ /dev/null @@ -1,33 +0,0 @@ -name1e5s translating -BeeGFS Parallel File System Goes Open Source -================================================== - -![](http://insidehpc.com/wp-content/uploads/2015/08/beegfs.jpg) - -Today ThinkParQ announced that the complete [BeeGFS parallel file system][1] is now available as open source. Developed specifically for performance-critical environments, the BeeGFS parallel file system was developed with a strong focus on easy installation and high flexibility, including converged setups where storage servers are also used for compute jobs. By increasing the number of servers and disks in the system, performance and capacity of the file system can simply be scaled out to the desired level, seamlessly from small clusters up to enterprise-class systems with thousands of nodes. - -The first official announcement to make the BeeGFS sources available was made at the International Supercomputing Conference 2013. This was in the context of the European exascale project [DEEP-ER][2], where several new approaches to address extreme I/O requirements are being designed and implemented. For exascale systems, the different software and hardware layers have to work together very efficiently to achieve maximum scalability. Thus, making the sources of BeeGFS available is one logical step to enabling efficient integration of all layers of an exascale stack. - -“While some of our users are just happy with the fact that BeeGFS is so easy to install and doesn’t require much attention, others really want to understand exactly what is happening under the hood to further optimize the runtime of their applications, improve their monitoring or port it to other platforms like BSD,” said Sven Breuner, CEO of ThinkParQ, the company behind BeeGFS “Also, being able to build BeeGFS for non-x86 architectures like ARM and Power is another important aspect that the community has been waiting for.” - -The steady advances in ARM technology indeed make it a more and more interesting technology to look at for future procurements. Thus, the BeeGFS team is also participating in [ExaNeSt][3], a new European exascale project, which is specifically focused on getting the ARM ecosystem ready for performance-critical workloads. “Although BeeGFS can already run out of the box on ARM systems today, this project will give us the opportunity to make sure that we can deliver the maximum performance on this architecture as well.”, adds Bernd Lietzow, BeeGFS head for ExaNeSt. - -With a rather compact code base of about 25K lines of C++ code for the distributed metadata service and about 15K lines of C++ code for the distributed storage service, BeeGFS should be relatively easy to understand and extend, not only for senior programmers, but also for University students interested in file system research. On GitHub, there are already a number of projects listed related to BeeGFS, e.g. for browser-based monitoring or Docker integration. - -In related news, the [BeeGFS User Meeting][4] will take place May 18-19 in Kaiserslautern, Germany. - ------------------------------------------------------------------------------------------ - -via: http://insidehpc.com/2016/02/beegfs-parallel-file-system-now-open-source/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+InsideHPC+%28insideHPC.com%29 - -作者:[staff][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://insidehpc.com/author/staff/ -[1]: http://www.beegfs.com/ -[2]: http://www.deep-project.eu/deep-project/EN/Home/home_node.html -[3]: http://www.exanest.eu/ -[4]: http://www.beegfs.com/content/user-meeting-2016/ diff --git a/translated/tech/20160223 BeeGFS Parallel File System Goes Open Source.md b/translated/tech/20160223 BeeGFS Parallel File System Goes Open Source.md new file mode 100644 index 0000000000..2aeadbc3fb --- /dev/null +++ b/translated/tech/20160223 BeeGFS Parallel File System Goes Open Source.md @@ -0,0 +1,32 @@ +并行文件系统 BeeGFS 现已开源 +================================================== + +![](http://insidehpc.com/wp-content/uploads/2015/08/beegfs.jpg) + +今天(2月23日) ThinkParQ 宣布完整的 [BeeGFS 并行文件系统][1] 的源码现已开源。由于 BeeGFS 是专为要求性能的环境开发的,所以它在开发时十分注重安装的简单以及高度的灵活性,包括融合了在存储服务器同时做计算任务时需要的设置。随着系统中的服务器以及存储设备的增加,文件系统的容量以及性能将是需求的拓展点,无论是小型集群还是多达上千个节点的企业级系统。 + +第一次官方声明开放 BeeGFS 的源码是在 2013 年的国际超级计算大会上发布的。这个声明是在欧洲的百亿亿次级超算项目 [DEEP-ER][2] 的背景下做出的,在这个项目里为了得到更好的 I/O 要求,一些微小的进步被设计并应用。对于运算量高达百亿亿次的系统,不同的软硬件必须有效的协同工作才能得到最佳的拓展性。因此,开源 BeeGFS 是让一个百亿亿次的集群的所有组成部分高效的发挥作用的一步。 + +“当我们的一些用户对于 BeeGFS 十分容易安装并且不用费心管理而感到高兴时,另外一些用户则想要知道它是如何运行的以便于更好的优化他们的应用,使得他们可以监控它或者把它移植到其他的平台上,比如 BSD,” Sven Breuner 说道,他是 ThinkParQ (BeeGFS 背后的公司)的 CEO,“而且,把 BeeGFS 移植到其他的非 X86 架构,比如 ARM 或者 Power,也是社区等着要做的一件事。” + +对于未来的采购来说,ARM 技术的稳步发展确实使得它成为了一个越来越有趣的技术。因此, BeeGFS 的团队也参与了 [ExaNeSt][3],一个来自欧洲的新的百亿亿次级超算计划,这个计划致力于使 ARM 的生态能为高性能的工作负载做好准备。“尽管现在 BeeGFS 在 ARM 处理器上可以算是开箱即用,这个项目也将给我们机会来证明我们在这个架构上也能完全发挥其性能。”, Bernd Lietzow , BeeGFS 中 ExaNeSt 的领导者补充道。 + + 作为一个有着 25 K 行 C++ 代码的元数据服务以及约 15 K 行存储服务的项目,BeeGFS 相对比较容易理解和拓展,不只是对于大神,对于对文件系统有兴趣的大学生也是这样。在 GitHub 上已经有很多的为 BeeGFS 写的项目,比如基于浏览器的监控或者 Docker 一体化。 + + 有关新闻显示, [BeeGFS 用户大会][4]将于 5 月 18-19 日在德国凯泽斯劳滕举行。 + + ----------------------------------------------------------------------------------------- + +via: http://insidehpc.com/2016/02/beegfs-parallel-file-system-now-open-source/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+InsideHPC+%28insideHPC.com%29 + +作者:[staff][a] +译者:[name1e5s](https://github.com/name1e5s) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://insidehpc.com/author/staff/ +[1]: http://www.beegfs.com/ +[2]: http://www.deep-project.eu/deep-project/EN/Home/home_node.html +[3]: http://www.exanest.eu/ +[4]: http://www.beegfs.com/content/user-meeting-2016/ From 4b95d3fa5b77ec6ed6112aab628885bd3c75c0ed Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 25 Feb 2016 20:10:02 +0800 Subject: [PATCH 0421/1469] =?UTF-8?q?20160225-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...d open source experience to your resume.md | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 sources/tech/20160225 How to add open source experience to your resume.md diff --git a/sources/tech/20160225 How to add open source experience to your resume.md b/sources/tech/20160225 How to add open source experience to your resume.md new file mode 100644 index 0000000000..73e22c2b8b --- /dev/null +++ b/sources/tech/20160225 How to add open source experience to your resume.md @@ -0,0 +1,91 @@ +How to add open source experience to your resume +================================================== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/lightning-test.png?itok=aMceg0Vg) + + +In this article, I'll share my technique for leveraging open source contributions to stand out as a great candidate for a job in the technology field. + +No goal can be accomplished without first being set. Before jumping into a new commitment or spending the evening overhauling your resume, it pays to clearly define the traits of the job you're seeking. Your resume is a piece of persuasive writing, so you have to know your audience for it to reach its full potential. Your resume's audience is anyone with the need for your skills and the budget to hire you. When editing, read your resume while imagining what it's like to be in their position. Do you look like a candidate that you would hire? + +I personally find it helpful to make a list of the key traits that the ideal candidate for my target job displays. I gather this list from a combination of personal experience, reading job postings, and asking colleagues in similar roles. LinkedIn and conferences are great places to find people happy to offer this sort of advice. Many people enjoy talking about themselves, and inviting them to tell part of their own story to help you expand your knowledge makes everyone feel good. As you talk to others about their career paths, you'll gain insights not only into how to land the jobs you want, but also into which traits or behaviors correspond to ending up in situations you'd rather avoid. + +For example, the list of key traits for a junior role might look like this: + +### Technical: + +- Experience with CI, Jenkins preferred + +- Strong scripting background in Python and Ruby + +- Familiarity with Eclipse IDE + +- Basic Git and Bash + +### Personal: + +- Self-directed learner + +- Clear communication and documentation skills + +- Experience working on a multi-person development team ("team player") + +- Familiarity with issue tracker workflow + +### Apply anyway + +Remember, you don't have to meet every single criterion listed in a job description to get an interview. + +The job description describes whoever left the role, and if you start out knowing everything you've likely signed yourself up for a few years that don't challenge or expand your skill set. If you're nervous about missing a particular technology on the list, do some research into it to see whether comparable skills from another experience would apply. For example, someone who's never used [Jenkins][1] might still understand the principles of continuous integration testing from working on a project that uses [Buildbot][2] or [Travis CI][3]. + +If you're applying at a larger company, they probably have an entire department and comprehensive screening process to make sure they don't hire any candidate unable to succeed in a role. That means it's your job to apply and their job to decide whether to reject you. Don't prematurely reject yourself from the job by refusing to apply. + +Now you have an idea of what job you want and what skills you'll need to impress your interviewers. The next steps to take will vary based on how much experience you've already got. + +### Tailoring existing involvement + +Start by making a list of all the projects you've been involved with in the past few years. One way to get a quick list of things you've worked on lately is to navigate to the **Repositories** tab of your GitHub profile and filter the list by clicking on **Forks**. Additionally, look down your [Organizations][4] list for places you might have been engaging in leadership roles. If you already have a resume, make sure you've included everything from these lists under experience. + +Consider any IRC channel where you have special permissions as a potential leadership experience. Check your Meetup and Eventbrite accounts and add any events that you organize or volunteer at to your list. Skim your calendar for the past year and note any volunteering, mentoring, or public speaking engagements. + +Now for the hard part: Map the list of required skills onto the list of experiences. I like to assign a letter or number to each trait needed for the job, then mark the same symbol next to every piece of experience or involvement where you demonstrated the trait. When in doubt, claim it anyway—your problem is more likely a reluctance to brag than actual incompetence. + +This is the point in the process at which resume writers are often fettered by reluctance to risk overselling their own skills. It often helps to re-frame the question as: "Did someone who organized a meetup show leadership and planning skills?" Rather than: "Did I personally show these skills when I organized that meetup?". + +If you've been sufficiently thorough at figuring out where your free time has gone for the past year or two and you code a lot, you might now be facing a surprising problem: Too many items to fit on a single-page resume! If anything on your list of experiences didn't demonstrate any of the skills you're trying to showcase, cross it off. If an item demonstrates few skills and you don't have any stories that you enjoy telling about it, cross it off. If this abridged list of things you've done still won't fit in the format of a resume, prioritize the experiences from which you gained a relevant story or extensive experience with a desired technology. + +At this point, it should be obvious if you need a better piece of experience to hone a particular skill. Consider using an issue aggregator like OpenHatch to find an open source project where you build and practice your skills with the tool or technology that you're missing. + +### Make your resume beautiful + +A resume's beauty comes from conciseness, clarity, and layout. Each piece of experience should be accompanied by enough information for a reader to immediately know why you included it, but no more. Each type of information should be formatted consistently throughout the document—it's distracting to have some dates italicized or right-aligned and others not. + +Typeset your resume using a tool that makes these goals easy to achieve. I enjoy using [LaTeX][5], since its macro system makes visual consistency easy and most interviewers recognize it immediately. Your tool of choice might be [LibreOffice][6] or HTML, depending on your skills and how you want to distribute your resume. + +Remember that a digitally submitted resume might be scanned for keywords, so it can help to use the same acronyms as the job posting when describing your experiences. To make your resume easy for your interviewer to use, place the most important information first. + +Coders often struggle to quantify balance and layout when typesetting a document. My favorite technique for stepping back and assessing whether my document's whitespace is in the right place is to fullscreen the PDF or print it out, then look at it in a mirror. If you're using LibreOffice Writer, save a copy of your resume then change the font to that of a language you can't read. Both of these techniques forcibly pull you out of reading the content, and allow you to see the overall layout of the document in a new light. They take you from a "That sentence is poorly worded!" critique to noticing things like "It looks funny to have only a single word on that line." + +Finally, double check that your resume displays correctly in the media where it will be seen. If you're distributing it as a web page, test it at different screen widths in multiple browsers. If it's a PDF, open it on your phone or a friend's computer to make sure all the fonts it needs are available. + +### Next steps + +Finally, don't let the content that you worked so hard on for your resume go to waste! Mirror it to your LinkedIn account—complete with the buzzwords from the job posting—and don't be surprised if recruiters start reaching out to you. Even if the jobs they're describing aren't a good fit right now, you can leverage their time and interest to get feedback on what's working well about your resume and what isn't. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/business/16/2/add-open-source-to-your-resume + +作者:[edunham][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/edunham +[1]: https://jenkins-ci.org/ +[2]: http://buildbot.net/ +[3]: https://travis-ci.org/ +[4]: https://github.com/settings/organizations +[5]: https://www.latex-project.org/ +[6]: https://www.libreoffice.org/download/libreoffice-fresh/ From 38754c8fb275cebc3ecd1858b83bf342c8f293bc Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 25 Feb 2016 20:16:09 +0800 Subject: [PATCH 0422/1469] =?UTF-8?q?20160225-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...he Zika virus with rapid, open research.md | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 sources/tech/20160224 Can we tackle the Zika virus with rapid, open research.md diff --git a/sources/tech/20160224 Can we tackle the Zika virus with rapid, open research.md b/sources/tech/20160224 Can we tackle the Zika virus with rapid, open research.md new file mode 100644 index 0000000000..e25df9c008 --- /dev/null +++ b/sources/tech/20160224 Can we tackle the Zika virus with rapid, open research.md @@ -0,0 +1,27 @@ +Can we tackle the Zika virus with rapid, open research? +============================================================ + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/OSDC_LifeScience_OpenScience_520x292_12268077_0614MM.png?itok=3ZD2Mce9) + +One of the major issues with the Zika virus is that so little is known about it. That means that a lot of research has to be done very quickly. + +The Zika virus is at the heart of a global health emergency. It became a global health emergency after outbreaks began in 2015, and has possible links to birth defects. When the virus was first discovered in the late forties, human infections had been observed as early as 1952 according to Wikipedia. + +On February 10, the open journal [PLoS released a statement][1] on data sharing in public emergencies. Then, an article in the research journal F1000, [Open drug discovery for the Zika virus][2], discussed the status of Zika along with the need to conduct research openly. The statement from PLoS lists more than 30 important organizations who have aligned around the open dissemination of data as the virus is studied. And the World Health Organization has implemented special provisions that submissions to the WHO Bulletin now be made available under a [Creative Commons license][3]. + +Rapid publication, unrestricted reuse, and emphasizing dissemination of research are strategic steps that the open science community has been pushing for in all scientific research. Seeing a start with health emergencies that require our immediate attention is encouraging. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/16/2/how-rapid-open-science-could-change-game-zika-virus + +作者:[Marcus D. Hanwell][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mhanwell +[1]: http://blogs.plos.org/plos/2016/02/statement-on-data-sharing-in-public-health-emergencies/ +[2]: http://f1000research.com/articles/5-150/v1 +[3]: https://creativecommons.org/licenses/by/3.0/igo/ From 32159443d8119de4978d91e53530801d121e8dde Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 25 Feb 2016 20:28:03 +0800 Subject: [PATCH 0423/1469] =?UTF-8?q?20160225-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20160225 The Tao of project management.md | 176 ++++++++++++++++++ 1 file changed, 176 insertions(+) create mode 100644 sources/tech/20160225 The Tao of project management.md diff --git a/sources/tech/20160225 The Tao of project management.md b/sources/tech/20160225 The Tao of project management.md new file mode 100644 index 0000000000..629bdaef36 --- /dev/null +++ b/sources/tech/20160225 The Tao of project management.md @@ -0,0 +1,176 @@ +The Tao of project management +================================= + + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BUSINESS_orgchart1.png?itok=DGsp6jB5) + +The [Tao Te Ching][1], [believed to have been written][2] by the sage [Lao Tzu][3] in the 6th century BCE, is among the most widely translated texts in existence. It has inspired everything from [religions][4] to [funny movies about dating][5], and authors have used it as a metaphor to explain all kinds of things (even [programming][6]). + +This text is what immediately comes to my mind when thinking about project management in open organizations. + +That might sound strange. But to understand where I'm coming from, you should start by reading *The Open Organization: Igniting Passion and Performance*, Red Hat president and CEO Jim Whitehurst's manifesto on corporate culture and the new leadership paradigm. In this book, Jim (with a little help from other Red Hatters) explains the difference between conventional organizations (a "top-down" approach, with decisions coming down from central command to employees motivated by promotion and pay) and open organizations (a bottom-up approach, with leaders focused on inspiring purpose and passion so employees are empowered to be and do their best). + +This concept—that employees in open organizations are motivated by passion, purpose, and engagement—plays directly into where I think project managers should focus. + +And to explain, I'll return to the *Tao Te Ching*. + +### Don't let your job title define you + +>The tao that can be told +>is not the eternal Tao +>The name that can be named +>is not the eternal Name. + +>The unnameable is the eternally real. +>Naming is the origin +>of all particular things. +[[1]][7] + +What exactly is project management? And what does a project manager do? + +As you might expect, part of being a project manager is managing projects: gathering requirements, managing stakeholder communication, setting priority, scheduling tasks, helping the team resolve blockers. Many institutions can teach you how to manage projects very well, and these are good skills to have. + +However, literally managing projects is only part of what project managers in open organizations do. These organizations require something more: Courage. If you're good at managing projects (or if you're good at any job, really), then you can start to feel safe in your routine. That's when you know you need to find the courage to take a risk. + +Do you have the courage to step outside of your comfort zone? The courage to ask important people challenging questions that might raise eyebrows, but that might also uncover a better way forward? The courage to identify the next thing that needs to be done—then the courage to go and do it? The courage to call out communication gaps and take initiative to fix them? The courage to try things? The courage to fail? + +The opening passage of the Tao Te Ching (which I cited above) suggests that words, labels, and names are limiting. That includes job titles. In open organizations, project managers don't just perform the rote tasks required to manage projects. They help teams accomplish the organization's mission, however defined. + +### Connect the right people + +>We join spokes together in a wheel, +>but it is the center hole +>that makes the wagon move. +[[11]][8] + +One of the most difficult lessons I had to learn as I transitioned into project management was that not having all the answers was perfectly acceptable, even expected. That was new for me. I like having all the answers. But as a project manager, my role is more about connecting people—so the ones who do have the answers can collaborate efficiently. + +This does not mean dodging responsibility or ownership. This means being comfortable saying, "I don't know, but I will find out for you," and closing that loop as quickly as possible. + +Picture a wagon wheel. Without the stability and direction provided by the center hole, the spokes would fall and the wheel collapse in on itself. Project managers in an open organization can help a team maintain forward momentum by bringing the right people together and cultivating the right discussions. + +### Trust your team + +>When the Master governs, the people +>are hardly aware that he exists. +>Next best is a leader who is loved. +>Next, one who is feared. +>The worst is one who is despised. +> +>If you don't trust the people, +>you make them untrustworthy. +> +>The Master doesn't talk, he acts. +>When his work is done, +>the people say, "Amazing: +>we did it, all by ourselves!" +[[17]][9] + +[Rebecca Fernandez][10] once told me that what differentiates leaders in open organizations is not the trust people have in them, but the trust they have in other people. + +Open organizations do a great job hiring smart people who are passionate about what their companies are doing. In order for them to do their best work, we have to give them what they need and then get out of their way. + +Here, I think the above passage from the Tao Te Ching speaks for itself. + +### Be effortless + +>The Master does nothing +>yet he leaves nothing undone. +>The ordinary man is always doing things, +>yet many more are left to be done. +[[38]][11] + +Do you know the type of person who is always extremely busy? The one who seems frazzled and stressed with too many things to do? + +Don't be that person. + +I know that's easier said than done. The thing that most helps me keep from being that person is remembering that we are all extremely busy. I don't have a single co-worker who is bored. + +But someone needs to be the calm in the middle of the storm. Someone needs to be the person who reassures the team that everything is going to be okay, that we'll find a way to get things done within the parameters dictated by reality and the number of business hours in a day (because that's the truth, and we have to). + +Be that person. + +What this passage of the Tao Te Ching says to me is that the person who's always talking about what she or he is doing has no time to actually do those things. If you can make your job seem effortless to those around you, then you're doing your job right. + +### Be a culture coach + +>When a superior man hears of the Tao, +>he immediately begins to embody it. +>When an average man hears of the Tao, +>he half believes it, half doubts it. +>When a foolish man hears of the Tao, +>he laughs out loud. +>If he didn't laugh, +>it wouldn't be the Tao. +[[41]][12] + +Last fall, I enrolled an MBA business ethics class with a bunch of federal employees. When I started describing my company's culture, values, and ethics framework, I got the direct impression that both my classmates and my professor thought I was a naive young lady with [a lot of lovely daydreams][13] about how companies should run. They told me things couldn't possibly be as they seemed. They said I should investigate further. + +So I did. + +And here's what I found: Things are exactly as they seem. + +In open organizations, culture matters. Maintaining that culture as an organization grows makes it possible to wake up and look forward to going to work in the morning. I (and other members of open organizations) don't want to "work to live," as my classmates described it. I need to feel a passion and purpose, to understand how the work I do on a daily basis directly contributes to something I believe in. + +As a project manager, you might think that your job has nothing to do with cultivating your company's culture on your team. However, it's your job to embody it. + +### Kaizen + +>In pursuit of knowledge, +>every day something is added. +>In the practice of the Tao, +>every day something is dropped. +>Less and less do you need to force things, +>until finally you arrive at non-action. When nothing is done, +>nothing is left undone. +[[48]][14] + +The general field of project management is too focused on the latest and greatest tools. But the answer to the question of which tool you should use is always the same: "the simplest." + +For example, I keep my running to-do list in a text file on my desktop because it serves its purpose without unnecessary distractions. Whatever tools, processes, and procedures you introduce to a team should increase efficiency and remove obstacles, not introduce additional complexity. So instead of focusing on the tools, focus on the problem(s) you're using those tools to solve. + +My favorite part of being a project manager in an Agile world is having the freedom to throw out what doesn't work. This is related to the concept of kaizen, or "continuous improvement." Don't be afraid to try and fail. Failing is the label we've put on the process of learning what works and what doesn't. But it's the only way to improve. + +The best processes arise organically. As a project manager, you can help your team by supporting them and not trying to force them into anything. + +### Practice + +>Some say that my teaching is nonsense. +>Others call it lofty but impractical. +>But to those who have looked inside themselves, +>this nonsense makes perfect sense. +>And to those who put it into practice, +>this loftiness has roots that go deep. +[[67]][15] + +I believe in what open organizations are doing. What open organizations are doing for the field of management is almost as important as the actual products and services they offer. We have an opportunity to lead by example, to inspire passion and purpose in others, to create working environments that inspire and empower. + +I encourage you to find ways to incorporate some of these ideas into your own projects and teams to see what happens. Learn about your organization's mission and how your projects contribute to it. Have courage, expect to try some things that won't work, and don't forget to share the lessons you learn with our community so we can continue to improve. + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/16/2/tao-project-management + +作者:[Allison Matlack][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/amatlack +[1]: http://acc6.its.brooklyn.cuny.edu/~phalsall/texts/taote-v3.html +[2]: https://en.wikipedia.org/wiki/Tao_Te_Ching +[3]: http://plato.stanford.edu/entries/laozi/ +[4]: https://en.wikipedia.org/wiki/Taoism +[5]: http://www.imdb.com/title/tt0234853/ +[6]: http://www.mit.edu/~xela/tao.html +[7]: http://acc6.its.brooklyn.cuny.edu/~phalsall/texts/taote-v3.html#1 +[8]: http://acc6.its.brooklyn.cuny.edu/~phalsall/texts/taote-v3.html#11 +[10]: https://opensource.com/users/rebecca +[11]: http://acc6.its.brooklyn.cuny.edu/~phalsall/texts/taote-v3.html#38 +[12]: http://acc6.its.brooklyn.cuny.edu/~phalsall/texts/taote-v3.html#41 +[13]: https://opensource.com/open-organization/15/9/reflections-open-organization-starry-eyed-dreamer +[14]: http://acc6.its.brooklyn.cuny.edu/~phalsall/texts/taote-v3.html#48 +[15]: http://acc6.its.brooklyn.cuny.edu/~phalsall/texts/taote-v3.html#67 + From 121d67ae26355c6ca30de530823bf33f060a3f6e Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 25 Feb 2016 22:22:41 +0800 Subject: [PATCH 0424/1469] =?UTF-8?q?=E9=80=89=E9=A2=98=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 选题模板.txt | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 选题模板.txt diff --git a/选题模板.txt b/选题模板.txt new file mode 100644 index 0000000000..fabd1f1dba --- /dev/null +++ b/选题模板.txt @@ -0,0 +1,41 @@ +选题标题格式: + + 原文日期 标题.md + +正文内容: + + 标题 + ======= + + ### 子一级标题 + + 正文 + + #### 子二级标题 + + 正文内容 + + ![](图片地址) + + ### 子一级标题 + + 正文内容 : I have a [dream][1]。 + + + -------------------------------------------------------------------------------- + + via: 原文地址 + + 作者:[作者名][a] + 译者:[译者ID](https://github.com/译者ID) + 校对:[校对者ID](https://github.com/校对者ID) + + 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + + [a]: 作者介绍地址 + [1]: 引文链接地址 + +说明: +1. 标题层级很多时从 “##” 开始 +2. 引文链接地址在下方集中写 + From 6f67b9d37e15e93874a9438b3930e87df86c102f Mon Sep 17 00:00:00 2001 From: GHLandy Date: Thu, 25 Feb 2016 22:47:02 +0800 Subject: [PATCH 0425/1469] =?UTF-8?q?[=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= =?UTF-8?q?]=2020160218=20Best=20Linux=20Desktop=20Environments=20for=2020?= =?UTF-8?q?16?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...est Linux Desktop Environments for 2016.md | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 translated/tech/20160218 Best Linux Desktop Environments for 2016.md diff --git a/translated/tech/20160218 Best Linux Desktop Environments for 2016.md b/translated/tech/20160218 Best Linux Desktop Environments for 2016.md new file mode 100644 index 0000000000..b9306b79be --- /dev/null +++ b/translated/tech/20160218 Best Linux Desktop Environments for 2016.md @@ -0,0 +1,90 @@ +2016:如何选择 Linux 桌面环境 +============================================= + +![](http://www.linux.com/images/stories/66866/DE-2.png) + +Linux 创建了一个相对友好的环境,为我们提供了选择的可能。比方说,现代大多数的 Linux 发行版都提供不同桌面环境给我们来选择。在本文中,我将挑选一些你可能会在 Linux 中见到的相对较好的桌面环境来介绍。 + +## Plasma + +我认为,[KDE’s Plasma desktop](https://www.kde.org/workspaces/plasmadesktop/) 是最高级的桌面环境 (LCTT 译注:译者认为,没有什么是最好的,只有最合适的,毕竟每个人的喜好都不可能完全相同)。它是我见过功能最完善和定制性最高的桌面环境;在用户完全自主控制方面,即使是 Mac OS X 和 Windows 也无法与之比拟。 + +我爱 Plasma,因为它自带了一个非常好的文件管理器——Dolphin。而相对应 Gnome 环境,我更喜欢 Plasma 的原因就在于文件管理器。使用 Gnome 最大的痛苦就是,它的文件管理器——Files——使我无法完成一些基本任务,比如说,批量文件重命名操作。而这个操作对我来说相当重要,因为我喜欢拍摄,但 Gnome 却让我无法批量重命名这些图像文件。而使用 Dolphin 的话,这个操作就像在公园散步一样简单。 + +而且,你可以通过插件来增强 Plasma 的功能。Plasma 有大量的基础软件,如 Krita、Kdenlive、Calligra 办公套件、digiKam、Kwrite 以及由 KDE 社区开发维护的大量应用。 + +Plasma 桌面环境唯一的缺陷就是它默认的邮件客户端——Kmail。它的设置比较困难,我希望 Kmail 设置可以配置地址簿和日历。 + +包括 openSUSE 在内的多数主流发行版多使用 Plasma 作为默认桌面。 + +## GNOME + +[GNOME](https://www.gnome.org/) (GNU Network Object Model Environment,GNU 网络对象模型环境) 由 [Miguel de Icaza](https://en.wikipedia.org/wiki/Miguel_de_Icaza) 和 Federico Mena 在 1997 年的时候创立,这是因为 KDE 使用来 Qt 工具包,而这个工具包是使用专业许可证 (proprietary license) 发布的。和 KDE 不一样的是,GNOME 提供了大量的定制,它专注于让事情变得简单。因为 自身的简单性和易用性,GNOME 变得相当流行。而我认为 GNOME 之所以流行的原因在于,Ubuntu——使用 GNOME 作为默认桌面的主流 Linux 发行版之一——对其有着巨大的推动作用。 + +随着时代变化,GNOME 也需要作出相应的改变了。因此,开发者通过 GNOME 3 推出了 GNOME 3 Shell,从而引出它全新的设计规范。但这同时与 Canonical 的 Ubuntu 计划存在者一些冲突,所以 Canonical 为 GNOME 开发来叫做 Unity 的特有 Shell。最初,GNOME 3 Shell 因很多争议 (issues) 而困扰不已——最明显的是,升级之后会导致很多扩展无法正常工作。由于设计上的重大改版以及各种问题的出现,GNOME 便产生来很多分支,比如 Cinnamon 和 Mate 桌面。 + +也就是说,使得 GNOME 有趣的是,它针对触摸设备做了优化,所以,如果你有一台触屏笔记本电脑的话,GNOME 则是最合适你这台电脑的桌面环境。 + +在 3.18 版本中,GNOME 已经作出了一些令人印象深刻的改动。其中他们所做的最有趣的是集成了 Google Drive,用户可以把他们的 Google Drive 挂载为远程存储设备,这样就不必在使用浏览器来查看里边的文件来。我也很喜欢 GNOME 里边自带的那个优秀的邮件客户端,它带有日历和地址簿功能。尽管有这么多些优秀的特性,但它的文件管理器使我不再使用 GNOME ,因为我无法处理批量文件重命名。我会坚持使用 Plasma,一直到 GNOME 的开发者修复了这个小缺陷。 + +![](http://www.linux.com/images/stories/66866/DE-fig1.png) + +## Unity + +从技术上来说,[Unity](https://unity.ubuntu.com/) 并不是一个桌面环境,它只是 Canonical 为 Ubuntu 开发的一个图形化 Shell。Unity 运行于 GNOME 桌面之上,并使用很多 GNOME 的应用和工具。Ubuntu 团队分支了一些 GNOME 组件,以便更好的满足 Unity 用户的需求。 + +Unity 在 Ubuntu 故事集和 Unity 8 中扮演者重要角色,Canonical 公司正在努力将电脑桌面和移动世界结合到一起。Canonical 同时还为 Unity 开发了许多的有趣技术,比如 HUD (Head-up Display,平视显示)。他们还有一种独特的技术来然用户在镜片上的某范围找到特定内容。 + +即将发行的 Ubuntu 16.04,将会搭载 Unity 8,那时候用户就可以完全体验开发者为该开源软件添加的所有特性了。其中最大的争议就是,Unity 不再集成 Amazon Ads 和其他服务。即将发行的版本,虽然 Canonical 从 Dash 移除了 Amazon ads,但却默认保证了系统的隐私性。 + +## Cinnamon + +最初,[Cinnamon](https://en.wikipedia.org/wiki/Cinnamon_(software)) 由 [Linux Mint](http://www.linuxmint.com/) 开发 —— DistroWatch.com 上统计出来最流行的发行版。就像 Unity,Cinnamon 是 GNOME Shell 的一个分支。但最后进化为一个独立的桌面环境,这是因为 Linux Mint 的开发者分支了 GNOME 桌面中很多的组件到 Cinnamon,包括 Files ——以满足自身用户的需求。 + +由于 Linux Mint 基于普通版本的 Ubuntu,开发者仍需要去完成 Ubuntu 尚未完成的目标。结果,尽管前途光明,但 Cinnamon 却充满了 Bugs 和问题。随着 17.x 本版的发布,Linux Mint 开始移动到 Ubuntu 的 LTS 版本上,从而他们可以专注于开发 Cinnamon 的核心组件,而不必再去担心代码库。移动到 LTS 的好处是,Cinnamon 变得非常稳定并且基本没有 Bugs 出现。现在,开发者已经开始向桌面环境中添加更多的新特性来。 + +对于那些更喜欢在 GNOME 基础上有一个很好的类 Windows 用户界面的用户来说,Cinnamon 是他们最好的桌面环境。 + +## MATE Desktop + +[MATE desktop](http://mate-desktop.com/) 同样是 GNOME 的一个分支,然而,它并不像 Cinnamon 那样由 GNOME 3 分支,而是现在已经没有人维护的 GNOME 2 代码库的一个分支。MATE desktop 中的一些开发者并不喜欢 GNOME 3 并且想要“继续坚持” GNOME 2,所以他们使用这个代码库来创建来 MATE。为避免和 GNOME 3 的冲突,他们重命名了全部的包:Nautilus 改为 Caja、Gedit 改为 Pluma 以及 Evince 改为 Atril 等。 + +尽管 MATE 延续了 GNOME 2,但这并不意味着他们使用过时的技术;相反,他们使用了更新的技术来提供一个现代的 GNOME 2 体验。 + +拥有相当高的资源效率才是 MATE 最令人印象深刻之处。你可将它运行在老旧硬件或者很少更新的强大硬件上,如树梅派 (Raspberry Pi) 或者 Chromebook Flip。使得它更有趣的是,把它运行在一些强大的硬件上,可以节省大多数的资源给其他应用,而桌面环境本身只占用很少的资源。 + +## LXQt + +[LXQt](http://lxqt.org/) 继承了 LXDE ——最轻量级的桌面环境之一。它融合了 LXDE 和 Razor-Qt 两个开源项目。LXQt 的首个可用本版 V 0.9 发布于 2015 年。最初,开发者使用了 Qt4 但向下兼容,之后为了加快开发速度,他们移动到 Qt5 和 KDE 框架上。我也在自己的 Arch 系统上尝试使用了 LXQt,它的确是一个非常好的轻量级桌面环境。但在完全继承 LXDE 之前,LXQt 仍有一段很长的路需要走。 + +## Xfce + +[Xfce](http://www.xfce.org/) 早于 KDE 桌面环境,它是最古老和最轻量级的桌面环境。Xfce 的最新版本是 4.15,发布于 2015 年,使用了诸如 GTK + 3 的大量的现代科技。很多发行版都使用了 Xfce 环境以满足特定需求,比如 Ubuntu Studio ——与 MATE 类似——尽量节省系统资源给其他的应用。并且,许多的著名的 Linux 发行版——包括 Manjaro Linux、PC/OS、Salix 和 Mythbuntu ——都把它作为默认桌面环境。 + +## Budgie + +[Budgie](https://solus-project.com/budgie/) 是一个新型的桌面环境,由 Solus Linux 团队开发和维护。Solus 是一个从零开始构建的新型发行版,而 Budgie 则是它的一个核心组件。Budgie 使用了大量的 GNOME 组件,从而提供一个华丽的用户界面 (UI)。由于没有该桌面环境的更多信息,我特地联系了 Solus 的核心开发者—— Ikey Doherty。他解释说:“我们搭载了自己的桌面环境—— Budgie。与其他桌面环境不同的是,Budgie 并不是其他桌面的一个分支,它的目标是侧底融入到 GNOME 协议栈之中。它完全从零开始编写,并特意的设计来迎合 Solus 提供的体验。我们会尽可能的和 GNOME 的上游团队协同工作,修复 Bugs,并提倡和支持他们的工作”。 + +## Pantheon + +我想,[Pantheon](https://elementary.io/) 不需要特别介绍了吧,那个优美的 elementary OS 就使用它作为桌面。类似于 Budgie,很多人都认为 Pantheon 也不是 GNOME 的一个分支。elementary OS 团队大多拥有良好的设计背景,所以他们会近距离关注每一个细节,这使得 Pantheon 成为一个非常优美的桌面环境。在某个瞬间,它可能缺少像 Plasma 等桌面中的某些特性,但开发者实际上是尽其所能的去坚持设计原则。 + +![](http://www.linux.com/images/stories/66866/DE-3.png) + +## 结论 + +当我写完本文后,我突然意识到来开源和 Linux 的重大好处。总有一个发行版本适合你。就像 Jon “maddog” Hall 在最近的 SCaLE 14 上说的那样:“是的,现在有 300 多个 Linux 发行版。我可以一个一个去尝试,然后坚持使用我最喜欢的那一个”。 + +所以,尽情享受 Linux 的多样性吧,最后使用最合你意的那一个。 + +------------------------------------------------------------------------------ + +via: http://www.linux.com/news/software/applications/881107-best-linux-desktop-environments-for-2016 + +作者:[Swapnil Bhartiya][a] +译者:[GHLandy](https://github.com/GHLandy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linux.com/community/forums/person/61003 From 316d10fc5f83baca12be63af1374be9a1948c4a4 Mon Sep 17 00:00:00 2001 From: GHLandy Date: Thu, 25 Feb 2016 22:48:52 +0800 Subject: [PATCH 0426/1469] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=B7=B2=E7=BF=BB?= =?UTF-8?q?=E8=AF=91=E5=AE=8C=E6=88=90=E7=9A=84=E5=8E=9F=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...est Linux Desktop Environments for 2016.md | 92 ------------------- 1 file changed, 92 deletions(-) delete mode 100644 sources/tech/20160218 Best Linux Desktop Environments for 2016.md diff --git a/sources/tech/20160218 Best Linux Desktop Environments for 2016.md b/sources/tech/20160218 Best Linux Desktop Environments for 2016.md deleted file mode 100644 index 7aef79366b..0000000000 --- a/sources/tech/20160218 Best Linux Desktop Environments for 2016.md +++ /dev/null @@ -1,92 +0,0 @@ -GHLandy Translating - -Best Linux Desktop Environments for 2016 -============================================= - -![](http://www.linux.com/images/stories/66866/DE-2.png) - -Linux creates a friendly environment for choices and options. For example, there are many Linux-based distributions out there that use different desktop environments for you to choose from. I have picked some of the best desktop environments that you will see in the Linux world. - -## Plasma - -I consider [KDE’s Plasma desktop](https://www.kde.org/workspaces/plasmadesktop/) to be the most advanced desktop environment (DE). It’s the most feature-rich and customizable desktop environment that I have ever seen; even Mac OS X and Windows don’t come near Plasma when it comes to complete control by the user. - -I also love Plasma because of its awesome file manager, Dolphin. One reason I prefer Plasma over Gnome-based systems is the file manager. One of my biggest gripes with Gnome is that its file manager, Files, can’t handle basic tasks, such as batch-files renaming. That’s important for me because I take a lot of pictures, and Gnome makes it impossible for me to rename image files. On Dolphin, it’s a walk in the park. - -Then, you can add more functionality to Plasma with plugins. Plasma comes with some incredible software including Krita, Kdenlive, Calligra Office Suite, digiKam, Kwrite, and many other applications being developed by the KDE community. - -The only weakness of the Plasma desktop is its default email client, Kmail. It’s way too complicated to set up, and I also wish that setting up Kmail also configured the Address Book and Calendar. - -Plasma is the default desktop environment of many major distributions including openSUSE. - -## GNOME - -[GNOME](https://www.gnome.org/) (GNU Network Object Model Environment) was founded by [Miguel de Icaza](https://en.wikipedia.org/wiki/Miguel_de_Icaza) and Federico Mena in 1997 because KDE used Qt toolkit, which was released under a proprietary license. Unlike KDE, where there were numerous customizations, GNOME focused on keeping things simple. GNOME became extremely popular due to its simplicity and ease of use. A factor that I think contributed heavily to Gnome’s popularity was the fact that Ubuntu, one of the most popular Linux distributions, picked it as their default desktop environment. - -With changing times, GNOME needed a change. Therefore, with GNOME 3 the developers introduced the GNOME 3 Shell, which brought with it an entirely new design paradigm. That in turn led to some conflict with Canonical’s plans with Ubuntu, and they created their own shell for GNOME called Unity. Initially, GNOME 3 Shell was plagued by many issues -- most notably, the fact that extensions would stop working after updates. This major shift in design and the various problems then led to many forks of GNOME, such as the Cinnamon and Mate desktops. - -That said, what makes GNOME desktop interesting is that they are targeting touch-based devices, so if you have new laptops that come with a touchscreen, Gnome is the best suited DE for them. - -With version 3.18, GNOME has made some impressive improvements. The most interesting thing that they have done is Google Drive integration where users can mount their Google Drive as a remote file storage and work with files without having to use a web browser. I also love GNOME’s awesome integration of email client with calendar and address book. Despite all this awesomeness, however, the one thing that keeps me from using GNOME is its file manager, which can’t handle batch file renames. I will stick to Plasma until GNOME developers fix this problem. - -![](http://www.linux.com/images/stories/66866/DE-fig1.png) - -## Unity - -[Unity](https://unity.ubuntu.com/) is technically not a desktop environment, it’s a graphical shell developed by Canonical for Ubuntu. Unity runs on top of GNOME desktop environment and uses most stock GNOME apps and tools. The Ubuntu team has forked a few GNOME components to better suit the needs of Unity users. - -Unity plays a very important role in Ubuntu’s convergence story and with Unity 8, the company is bringing the desktop and mobile world together. Canonical has developed many intriguing technologies for Unity including HUD (Head-up Display). They also took a unique approach with lenses and scopes making it easy for users to find appropriate content. - -The upcoming release of Ubuntu, 16.04, is expected to ship with Unity 8 so users will get to experience all the work that developers have put into this open source software. One of the biggest criticisms with Unity was opt-out integration of Amazon ads and other services. With the upcoming release, though, Canonical is removing Amazon ads from Dash, making it a privacy-respecting OS by default. - -## Cinnamon - -[Cinnamon](https://en.wikipedia.org/wiki/Cinnamon_(software)) was initially developed by [Linux Mint](http://www.linuxmint.com/) -- the most popular distro on DistroWatch. Cinnamon is a fork of GNOME Shell, just like Unity. Later, however, it evolved into a desktop environment as Linux Mint developers forked many components of the GNOME desktop, including Files, to address the needs of their users. - -Because Linux Mint was based on regular releases of Ubuntu, the developers continued to chase the moving target that was Ubuntu. As a result, despite great promises Cinnamon was full of bugs and problems. With the 17.x release, however, Linux Mint developers moved to LTS edition of Ubuntu that allowed them to focus on core components of Cinnamon without having to worry about the base. As a result of this move, Cinnamon has become incredibly stable and bug free. The developers have started adding more features to the desktop. - -For those who prefer the good old Windows-like UI on top of the simplicity of GNOME, Cinnamon is the best desktop environment. - -## MATE Desktop - -The [MATE desktop](http://mate-desktop.com/) environment is also a fork of GNOME. However, unlike Cinnamon, it’s not a fork of GNOME 3; instead it’s a fork of GNOME 2 codebase, which is not unmaintained. A few developers didn’t like Gnome 3 and wanted to “continue” GNOME 2, so they took the codebase and created MATE. The MATE project forked many components of the GNOME project and created a few from scratch. To avoid any conflict with GNOME 3, they renamed all their packages: Nautilus become Caja, Gedit became Pluma, Evince became Atril, and so on. - -Although MATE is a continuation of GNOME 2, that doesn’t mean they are using old and obsolete technologies; they are using newer technologies to offer a modern GNOME 2 experience. - -What makes MATE an impressive desktop environment is that it’s extremely resource efficient. You can run it on older hardware or newer less powerful hardware, such as Raspberry Pi or Chromebook Flip. What’s makes it even more interesting is that using it on powerful systems frees most system resources for applications instead of the resources being consumed by the desktop environment itself. - -## LXQt - -[LXQt](http://lxqt.org/) is the successor of LXDE, one of the most lightweight desktop environments. It’s a merger of two open source projects LXDE and Razor-Qt. The first usable version of LXQt (v 0.9) was released in 2015. Initially, the developers used Qt4 but then all compatibility with it was dropped, and they moved to Qt5 and KDE Frameworks 5 for speedy development. I have tried LXQt on my Arch systems, and its a great lightweight desktop environment, but it has a long way to go before it becomes the rightful successor of LXDE. - -## Xfce - -[Xfce](http://www.xfce.org/) predates the KDE desktop environment. It is one of the oldest and lightest desktop environments around. The latest release of Xfce is 4.15, which was released in 2015 and uses modern technologies like GTK+ 3. Xfce is used by many special purpose distributions, such as Ubuntu Studio, because -- much like MATE -- it frees most system resources for applications. It’s also the default desktop environment of many notable Linux distributions including Manjaro Linux, PC/OS, Salix, and Mythbuntu. - -## Budgie - -[Budgie](https://solus-project.com/budgie/) is a new desktop environment being developed by the Solus Linux team. Solus is new Linux distribution that’s being developed from scratch, and Budgie is a core component of it. Budgie uses many GNOME components and offers a minimalistic UI. Because there’s not much information about the new desktop, I talked to the core developer of Solus, Ikey Doherty, and he explained, “We ship our own desktop, the Budgie Desktop. Unlike some other desktops, this is not a fork, rather it aims for full integration into the GNOME stack. It's written from scratch, and is specifically designed to cater for the experience Solus is offering. We work with upstream GNOME here as much as we can, contributing fixes, and advocate and support their work.” - -## Pantheon - -[Pantheon](https://elementary.io/) needs no introduction, it’s the desktop environment powering the lovely Linux distribution elementary OS. Similar to Budgie, Pantheon is not a fork of GNOME as many may assume. elementary OS team comes from design background so they pay very close attention to minute details, as a result Pantheon is extremely polished desktop environment. At the moment, it may lack many feature found in DEs like Plasma, but the developers are taking their time in order to stick to the design principle. - -![](http://www.linux.com/images/stories/66866/DE-3.png) - -## Conclusion - -As I went through this story, I realized the awesomeness of open source and Linux. There is something for everyone. As Jon “maddog” Hall said during the latest SCaLE 14, “Yes, there are 300 Linux distributions. I can try them and stick to the one that I like!” - -So, enjoy this diversity and use the one that floats your boat! - ------------------------------------------------------------------------------- - -via: http://www.linux.com/news/software/applications/881107-best-linux-desktop-environments-for-2016 - -作者:[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 From 455c2fae1ad9c0cf5c597da90e8a47e4d944b485 Mon Sep 17 00:00:00 2001 From: cposture Date: Fri, 26 Feb 2016 14:51:27 +0800 Subject: [PATCH 0427/1469] Data Structures in the Linux Kernel --- sources/tech/20151123 Data Structures in the Linux Kernel.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20151123 Data Structures in the Linux Kernel.md b/sources/tech/20151123 Data Structures in the Linux Kernel.md index 187b3ce9cd..edc4c1a5a7 100644 --- a/sources/tech/20151123 Data Structures in the Linux Kernel.md +++ b/sources/tech/20151123 Data Structures in the Linux Kernel.md @@ -1,3 +1,4 @@ +【Translating By cposture 2016-02-26】 Data Structures in the Linux Kernel ================================================================================ From 86223bf367d29aa12b2281aa857f1b0c8dd019f9 Mon Sep 17 00:00:00 2001 From: cposture Date: Fri, 26 Feb 2016 15:08:36 +0800 Subject: [PATCH 0428/1469] Translaing by cposture-How to add open source experience to your resume --- .../20160225 How to add open source experience to your resume.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160225 How to add open source experience to your resume.md b/sources/tech/20160225 How to add open source experience to your resume.md index 73e22c2b8b..eee0d6aa23 100644 --- a/sources/tech/20160225 How to add open source experience to your resume.md +++ b/sources/tech/20160225 How to add open source experience to your resume.md @@ -1,3 +1,4 @@ +【Translating by cposture 2016-02-25】 How to add open source experience to your resume ================================================== From 1fc20642e29479ec1a947ce6b6d4663d13207399 Mon Sep 17 00:00:00 2001 From: runningwater Date: Fri, 26 Feb 2016 15:57:18 +0800 Subject: [PATCH 0429/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E4=B8=AD=20by=20ru?= =?UTF-8?q?nningwater?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20160225 The Tao of project management.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20160225 The Tao of project management.md b/sources/tech/20160225 The Tao of project management.md index 629bdaef36..a8de86ae0b 100644 --- a/sources/tech/20160225 The Tao of project management.md +++ b/sources/tech/20160225 The Tao of project management.md @@ -1,3 +1,4 @@ +(翻译中 by runningwater) The Tao of project management ================================= @@ -153,7 +154,7 @@ I encourage you to find ways to incorporate some of these ideas into your own pr via: https://opensource.com/open-organization/16/2/tao-project-management 作者:[Allison Matlack][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/) 荣誉推出 From d97cd027939b2425f9db4c2b0ce9dad0a8e0594a Mon Sep 17 00:00:00 2001 From: name1e5s <836401406@qq.com> Date: Fri, 26 Feb 2016 19:14:25 +0800 Subject: [PATCH 0430/1469] name1e5s translating... --- ...224 Can we tackle the Zika virus with rapid, open research.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160224 Can we tackle the Zika virus with rapid, open research.md b/sources/tech/20160224 Can we tackle the Zika virus with rapid, open research.md index e25df9c008..d243496585 100644 --- a/sources/tech/20160224 Can we tackle the Zika virus with rapid, open research.md +++ b/sources/tech/20160224 Can we tackle the Zika virus with rapid, open research.md @@ -1,3 +1,4 @@ +name1e5s translating Can we tackle the Zika virus with rapid, open research? ============================================================ From 7fad6c6a8c6b147a846bb273ddcfc61c17c1f22f Mon Sep 17 00:00:00 2001 From: name1e5s <836401406@qq.com> Date: Fri, 26 Feb 2016 20:04:33 +0800 Subject: [PATCH 0431/1469] [Translated]20160224 Can we tackle the Zika virus with rapid, open research --- ...he Zika virus with rapid, open research.md | 28 ------------------- ...he Zika virus with rapid, open research.md | 27 ++++++++++++++++++ 2 files changed, 27 insertions(+), 28 deletions(-) delete mode 100644 sources/tech/20160224 Can we tackle the Zika virus with rapid, open research.md create mode 100644 translated/tech/20160224 Can we tackle the Zika virus with rapid, open research.md diff --git a/sources/tech/20160224 Can we tackle the Zika virus with rapid, open research.md b/sources/tech/20160224 Can we tackle the Zika virus with rapid, open research.md deleted file mode 100644 index d243496585..0000000000 --- a/sources/tech/20160224 Can we tackle the Zika virus with rapid, open research.md +++ /dev/null @@ -1,28 +0,0 @@ -name1e5s translating -Can we tackle the Zika virus with rapid, open research? -============================================================ - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/OSDC_LifeScience_OpenScience_520x292_12268077_0614MM.png?itok=3ZD2Mce9) - -One of the major issues with the Zika virus is that so little is known about it. That means that a lot of research has to be done very quickly. - -The Zika virus is at the heart of a global health emergency. It became a global health emergency after outbreaks began in 2015, and has possible links to birth defects. When the virus was first discovered in the late forties, human infections had been observed as early as 1952 according to Wikipedia. - -On February 10, the open journal [PLoS released a statement][1] on data sharing in public emergencies. Then, an article in the research journal F1000, [Open drug discovery for the Zika virus][2], discussed the status of Zika along with the need to conduct research openly. The statement from PLoS lists more than 30 important organizations who have aligned around the open dissemination of data as the virus is studied. And the World Health Organization has implemented special provisions that submissions to the WHO Bulletin now be made available under a [Creative Commons license][3]. - -Rapid publication, unrestricted reuse, and emphasizing dissemination of research are strategic steps that the open science community has been pushing for in all scientific research. Seeing a start with health emergencies that require our immediate attention is encouraging. - --------------------------------------------------------------------------------- - -via: https://opensource.com/life/16/2/how-rapid-open-science-could-change-game-zika-virus - -作者:[Marcus D. Hanwell][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/mhanwell -[1]: http://blogs.plos.org/plos/2016/02/statement-on-data-sharing-in-public-health-emergencies/ -[2]: http://f1000research.com/articles/5-150/v1 -[3]: https://creativecommons.org/licenses/by/3.0/igo/ diff --git a/translated/tech/20160224 Can we tackle the Zika virus with rapid, open research.md b/translated/tech/20160224 Can we tackle the Zika virus with rapid, open research.md new file mode 100644 index 0000000000..8ed74fc15f --- /dev/null +++ b/translated/tech/20160224 Can we tackle the Zika virus with rapid, open research.md @@ -0,0 +1,27 @@ +我们能通过快速的,开放的研究战胜寨卡病毒吗? +============================================================ + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/OSDC_LifeScience_OpenScience_520x292_12268077_0614MM.png?itok=3ZD2Mce9) + +关于寨卡病毒,最主要的问题就是我们对于它了解的太少了。这意味着我们需要尽快对它作出很多研究。 + +寨卡病毒现已严重威胁到世界人民的健康。在 2015 年爆发之后,它就成为了全球卫生的紧急状况,并且这个病毒也可能与儿童的出生缺陷有关。根据维基百科,在这个病毒在 40 年代末期被发现以后,它对于人类的影响早在 1952 年就被观测到了。 + +在 2 月 10 日,开放杂志 PLoS [发布了一个声明][1],这个是声明是关于有关公共公众紧急状况的信息的共享。在此之后,刊登在开放期刊 F1000 的一篇文章 [开始了对于能治疗寨卡病毒的药物的研究][2],它开放的讨论寨卡病毒的状况以及对它进行研究的需要。那个来自 PLoS 的声明列出了超过 30 个开放了对于寨卡病毒的研究进度的数据的重要组织。并且世界卫生组织实施了对于提交到他们那里的资料的特别规定使得在一个[创作共用许可证下][3]公布。 + +快速公布,无限制的重复利用,以及强调研究结果的传播是开放科研组织把他们的研究推出的战略性一步。看到一个需要我们给予关注的紧急状况的研究的开端是很令人受鼓舞的。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/16/2/how-rapid-open-science-could-change-game-zika-virus + +作者:[Marcus D. Hanwell][a] +译者:[name1e5s](https://github.com/name1e5s) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mhanwell +[1]: http://blogs.plos.org/plos/2016/02/statement-on-data-sharing-in-public-health-emergencies/ +[2]: http://f1000research.com/articles/5-150/v1 +[3]: https://creativecommons.org/licenses/by/3.0/igo/ From 3a249757c99e6c40adcc2bc39acacbd964d5c66f Mon Sep 17 00:00:00 2001 From: name1e5s <836401406@qq.com> Date: Fri, 26 Feb 2016 20:22:12 +0800 Subject: [PATCH 0432/1469] name1e5s translating... --- sources/talk/20151019 Gaming On Linux--All You Need To Know.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/talk/20151019 Gaming On Linux--All You Need To Know.md b/sources/talk/20151019 Gaming On Linux--All You Need To Know.md index 332136112a..6618b8302d 100644 --- a/sources/talk/20151019 Gaming On Linux--All You Need To Know.md +++ b/sources/talk/20151019 Gaming On Linux--All You Need To Know.md @@ -1,3 +1,4 @@ +name1e5s translating Gaming On Linux: All You Need To Know ================================================================================ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/10/Gaming-on-Linux.jpeg) From fd5421db9660dec797b7723f468be56263181e84 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Sat, 27 Feb 2016 09:12:13 +0800 Subject: [PATCH 0433/1469] Delete 20160214 How to Install MariaDB 10 on CentOS 7 CPanel Server.md --- ...ll MariaDB 10 on CentOS 7 CPanel Server.md | 327 ------------------ 1 file changed, 327 deletions(-) delete mode 100644 sources/tech/20160214 How to Install MariaDB 10 on CentOS 7 CPanel Server.md diff --git a/sources/tech/20160214 How to Install MariaDB 10 on CentOS 7 CPanel Server.md b/sources/tech/20160214 How to Install MariaDB 10 on CentOS 7 CPanel Server.md deleted file mode 100644 index ccd14d1410..0000000000 --- a/sources/tech/20160214 How to Install MariaDB 10 on CentOS 7 CPanel Server.md +++ /dev/null @@ -1,327 +0,0 @@ -translation by strugglingyouth -How to Install MariaDB 10 on CentOS 7 CPanel Server -================================================================================ - -MariaDB is a enhanced open source and drop-in replacement for MySQL. It is developed by MariaDB community and available under the terms of the GPL v2 license. Software Security is the main focus for the MariaDB developers. They maintain its own set of security patches for each MariaDB releases. When any critical security issues are discovered, the developers introduces a new release of MariaDB to get the fix out as soon as possible. - -MariaDB is always up-to-date with the latest MySQL releases. It is highly compatible and works exactly like the MySQL. Almost all commands, data, table definition files, Client APIs, protocols, interfaces, structures, filenames, binaries, ports, database storage locations etc are same as the MySQL. It isn't even needed to convert databases to switch to MariaDB. - -### Advantages of MariaDB ### - -- Truly Open source -- More quicker and transparent security releases -- Highly Compatible with MySQL -- Improved Performance -- More storage engines compared to MySQL - -In this article, I provides guidelines on how to upgrade MySQL 5.5 to the latest MariaDB on a CentOS 7 CPanel server. Let's walk through the Pre-installation steps. - -### Pre-requisites: ### - -#### 1. Stop current MySQL Service #### - - root@server1 [/var/# mysql - Welcome to the MySQL monitor. Commands end with ; or \g. - Your MySQL connection id is 5859 - Server version: 5.5.47-cll MySQL Community Server (GPL) - - Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. - - Oracle is a registered trademark of Oracle Corporation and/or its - affiliates. Other names may be trademarks of their respective - owners. - - Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. - - root@server1 [~]# systemctl stop mysql - root@server1 [~]# systemctl status mysql - ● mysql.service - LSB: start and stop MySQL - Loaded: loaded (/etc/rc.d/init.d/mysql) - Active: failed (Result: exit-code) since Sun 2016-01-31 10:00:02 UTC; 1min 31s ago - Docs: man:systemd-sysv-generator(8) - Main PID: 23430 (code=exited, status=203/EXEC) - - Jan 31 10:00:02 server1.centos7-test.com systemd[1]: Started MySQL Server. - Jan 31 10:00:02 server1.centos7-test.com systemd[1]: Starting MySQL Server... - Jan 31 10:00:02 server1.centos7-test.com systemd[1]: mysql.service: main process exited, code=exited, status=203/EXEC - Jan 31 10:00:02 server1.centos7-test.com systemd[1]: Unit mysql.service entered failed state. - Jan 31 10:00:02 server1.centos7-test.com systemd[1]: mysql.service failed. - -#### 2. Move all configuration files and databases prior to the upgrade #### - -Move the DB storage path and MySQL configuration files - - root@server1 [~]# cp -Rf /var/lib/mysql /var/lib/mysql-old - - root@server1 [/var/lib/mysql]# cat /etc/my.cnf - [mysqld] - default-storage-engine=MyISAM - innodb_file_per_table=1 - max_allowed_packet=268435456 - open_files_limit=10000 - - root@server1 [~]#mv /etc/my.cnf /etc/my.cnf-old - -#### 3. Remove and uninstall all MySQL rpms from the server #### - -Run the following commands to disable the MySQL RPM targets. By running this commands, cPanel will no longer handle MySQL updates, and mark these rpm.versions as uninstalled on the system. - - /scripts/update_local_rpm_versions --edit target_settings.MySQL50 uninstalled - /scripts/update_local_rpm_versions --edit target_settings.MySQL51 uninstalled - /scripts/update_local_rpm_versions --edit target_settings.MySQL55 uninstalled - /scripts/update_local_rpm_versions --edit target_settings.MySQL56 uninstalled - -Now run the this command: - -/scripts/check_cpanel_rpms --fix --targets=MySQL50,MySQL51,MySQL55,MySQL56 to remove all existing MySQL rpms on the server and leave a clean environment for MariaDB installation. Please see its output below: - - root@server1 [/var/lib/mysql]# /scripts/check_cpanel_rpms --fix --targets=MySQL50,MySQL51,MySQL55,MySQL56 - [2016-01-31 09:53:59 +0000] - [2016-01-31 09:53:59 +0000] Problems were detected with cPanel-provided files which are RPM controlled. - [2016-01-31 09:53:59 +0000] If you did not make these changes intentionally, you can correct them by running: - [2016-01-31 09:53:59 +0000] - [2016-01-31 09:53:59 +0000] > /usr/local/cpanel/scripts/check_cpanel_rpms --fix - [2016-01-31 09:53:59 +0000] - [2016-01-31 09:53:59 +0000] The following RPMs are unneeded on your system and should be uninstalled: - [2016-01-31 09:53:59 +0000] MySQL55-client-5.5.47-1.cp1148 - [2016-01-31 09:53:59 +0000] MySQL55-devel-5.5.47-1.cp1148 - [2016-01-31 09:53:59 +0000] MySQL55-server-5.5.47-1.cp1148 - [2016-01-31 09:53:59 +0000] MySQL55-shared-5.5.47-1.cp1148 - [2016-01-31 09:53:59 +0000] MySQL55-test-5.5.47-1.cp1148 - [2016-01-31 09:53:59 +0000] compat-MySQL50-shared-5.0.96-4.cp1136 - [2016-01-31 09:53:59 +0000] compat-MySQL51-shared-5.1.73-1.cp1150 - [2016-01-31 09:53:59 +0000] Removing 0 broken rpms: - [2016-01-31 09:53:59 +0000] rpm: no packages given for erase - [2016-01-31 09:53:59 +0000] No new RPMS needed for install - [2016-01-31 09:53:59 +0000] Disabling service monitoring. - [2016-01-31 09:54:01 +0000] Uninstalling unneeded rpms: MySQL55-test MySQL55-server MySQL55-client compat-MySQL51-shared compat-MySQL50-shared MySQL55-shared MySQL55-devel - [2016-01-31 09:54:04 +0000] Removed symlink /etc/systemd/system/multi-user.target.wants/mysql.service. - [2016-01-31 09:54:04 +0000] Restoring service monitoring. - -With these steps, we've uninstalled existing MySQL RPMs, marked targets to prevent further MySQL updates and made the server ready and clean for the MariaDB installation. - -To startup with the installation, we need to create a yum repository for MariaDB depending on the MariaDB & CentOS versions. This is how I did it! - -### Installation procedures: ### - -#### Step 1: Creating a YUM repository. #### - - root@server1 [~]# vim /etc/yum.repos.d/MariaDB.repo - [mariadb] - name = MariaDB - baseurl = http://yum.mariadb.org/10.0/centos7-amd64/ - gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB - gpgcheck=1 - root@server1 [/etc/yum.repos.d]# cat /etc/yum.repos.d/MariaDB.repo - [mariadb] - name = MariaDB - baseurl = http://yum.mariadb.org/10.0/centos7-amd64/ - gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB - gpgcheck=1 - -#### Step 2: Open the /etc/yum.conf and modify the exclude line as below: #### - -**Remove this line** exclude=courier* dovecot* exim* filesystem httpd* mod_ssl* mydns* mysql* nsd* php* proftpd* pure-ftpd* spamassassin* squirrelmail* - -**And replace with this line** exclude=courier* dovecot* exim* filesystem httpd* mod_ssl* mydns* nsd* proftpd* pure-ftpd* spamassassin* squirrelmail* - -**\*\*\* IMPORTANT \*\*\*** - -We need to make sure, we've removed the MySQL and PHP from the exclude list. - -#### Step 3: Run the following command to install MariaDB and related packages. #### - -**yum install MariaDB-server MariaDB-client MariaDB-devel php-mysql** - - root@server1 [~]#yum install MariaDB-server MariaDB-client MariaDB-devel php-mysql - - Dependencies Resolved - - =============================================================================================================================================== - Package Arch Version Repository Size - =============================================================================================================================================== - Installing: - MariaDB-client x86_64 10.0.23-1.el7.centos mariadb 10 M - MariaDB-devel x86_64 10.0.23-1.el7.centos mariadb 6.3 M - MariaDB-server x86_64 10.0.23-1.el7.centos mariadb 55 M - php-mysql x86_64 5.4.16-36.el7_1 base 99 k - Installing for dependencies: - MariaDB-common x86_64 10.0.23-1.el7.centos mariadb 43 k - MariaDB-shared x86_64 10.0.23-1.el7.centos mariadb 1.2 M - libzip x86_64 0.10.1-8.el7 base 48 k - php-common x86_64 5.4.16-36.el7_1 base 563 k - php-pdo x86_64 5.4.16-36.el7_1 base 97 k - - Transaction Summary - =============================================================================================================================================== - Install 4 Packages (+5 Dependent package) - -#### Step 4: Restart and make sure the MySQL service is up. #### - - root@server1 [~]# systemctl start mysql - root@server1 [~]# - root@server1 [~]# - root@server1 [~]# systemctl status mysql - ● mysql.service - LSB: start and stop MySQL - Loaded: loaded (/etc/rc.d/init.d/mysql) - Active: active (exited) since Sun 2016-01-31 10:01:46 UTC; 3s ago - Docs: man:systemd-sysv-generator(8) - Process: 23717 ExecStart=/etc/rc.d/init.d/mysql start (code=exited, status=0/SUCCESS) - Main PID: 23430 (code=exited, status=203/EXEC) - - Jan 31 10:01:46 server1.centos7-test.com systemd[1]: Starting LSB: start and stop MySQL... - Jan 31 10:01:46 server1.centos7-test.com mysql[23717]: Starting MySQL SUCCESS! - Jan 31 10:01:46 server1.centos7-test.com systemd[1]: Started LSB: start and stop MySQL. - -#### Step 5: Run mysql_upgrade command #### - -It will examine all tables in all databases for incompatibilities with the current installed version and upgrades the system tables if necessary to take advantage of new privileges or capabilities that might have added with the current version. - - root@server1 [~]# mysql_upgrade - MySQL upgrade detected - Phase 1/6: Checking and upgrading mysql database - Processing databases - mysql - mysql.columns_priv OK - mysql.db OK - mysql.event OK - mysql.func OK - mysql.help_category OK - mysql.help_keyword OK - mysql.help_relation OK - mysql.help_topic OK - mysql.host OK - mysql.ndb_binlog_index OK - mysql.plugin OK - mysql.proc OK - mysql.procs_priv OK - mysql.proxies_priv OK - mysql.servers OK - mysql.tables_priv OK - mysql.time_zone OK - mysql.time_zone_leap_second OK - mysql.time_zone_name OK - mysql.time_zone_transition OK - mysql.time_zone_transition_type OK - mysql.user OK - Phase 2/6: Fixing views from mysql - Phase 3/6: Running 'mysql_fix_privilege_tables' - Phase 4/6: Fixing table and database names - Phase 5/6: Checking and upgrading tables - Processing databases - cphulkd - cphulkd.auths OK - cphulkd.blacklist OK - cphulkd.brutes OK - cphulkd.good_logins OK - cphulkd.ip_lists OK - cphulkd.known_netblocks OK - cphulkd.login_track OK - cphulkd.logins OK - cphulkd.report OK - cphulkd.whitelist OK - eximstats - eximstats.defers OK - eximstats.failures OK - eximstats.sends OK - eximstats.smtp OK - information_schema - leechprotect - leechprotect.hits OK - modsec - modsec.hits OK - performance_schema - roundcube - roundcube.cache OK - roundcube.cache_index OK - roundcube.cache_messages OK - roundcube.cache_shared OK - roundcube.cache_thread OK - roundcube.contactgroupmembers OK - roundcube.contactgroups OK - roundcube.contacts OK - roundcube.cp_schema_version OK - roundcube.dictionary OK - roundcube.identities OK - roundcube.searches OK - roundcube.session OK - roundcube.system OK - roundcube.users OK - saheetha_test - saheetha_test.authors OK - whmxfer - whmxfer.sessions OK - Phase 6/6: Running 'FLUSH PRIVILEGES' - OK - -#### Step 6 : Restart the MySQL service once again to ensure everything works perfect. #### - - root@server1 [~]# systemctl restart mysql - root@server1 [~]# - root@server1 [~]# systemctl status mysql - ● mysql.service - LSB: start and stop MySQL - Loaded: loaded (/etc/rc.d/init.d/mysql) - Active: active (running) since Sun 2016-01-31 10:04:11 UTC; 9s ago - Docs: man:systemd-sysv-generator(8) - Process: 23831 ExecStop=/etc/rc.d/init.d/mysql stop (code=exited, status=0/SUCCESS) - Process: 23854 ExecStart=/etc/rc.d/init.d/mysql start (code=exited, status=0/SUCCESS) - Main PID: 23430 (code=exited, status=203/EXEC) - CGroup: /system.slice/mysql.service - ├─23861 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/server1.centos7-test.com.pid - └─23933 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/v... - - Jan 31 10:04:10 server1.centos7-test.com systemd[1]: Starting LSB: start and stop MySQL... - Jan 31 10:04:11 server1.centos7-test.com mysql[23854]: Starting MySQL. SUCCESS! - Jan 31 10:04:11 server1.centos7-test.com systemd[1]: Started LSB: start and stop MySQL. - -#### Step 7: Run EasyApache to rebuild Apache/PHP with MariaDB and ensure all PHP modules remains intact. #### - - root@server1 [~]#/scripts/easyapache --build - - ****IMPORTANT ***** - If you forget to rebuild Apache/PHP after the MariaDB installation, it will report the library error as below: - - root@server1 [/etc/my.cnf.d]# php -v - php: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory - -#### Step 8: Now verify the installation and databases. #### - - root@server1 [/var/lib/mysql]# mysql - Welcome to the MariaDB monitor. Commands end with ; or \g. - Your MariaDB connection id is 15 - Server version: 10.0.23-MariaDB MariaDB Server - - Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others. - - Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. - - MariaDB [(none)]> show storage engines; - +--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+ - | Engine | Support | Comment | Transactions | XA | Savepoints | - +--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+ - | CSV | YES | CSV storage engine | NO | NO | NO | - | MRG_MyISAM | YES | Collection of identical MyISAM tables | NO | NO | NO | - | MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO | - | BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO | - | MyISAM | YES | MyISAM storage engine | NO | NO | NO | - | InnoDB | DEFAULT | Percona-XtraDB, Supports transactions, row-level locking, and foreign keys | YES | YES | YES | - | ARCHIVE | YES | Archive storage engine | NO | NO | NO | - | FEDERATED | YES | FederatedX pluggable storage engine | YES | NO | YES | - | PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO | - | Aria | YES | Crash-safe tables with MyISAM heritage | NO | NO | NO | - +--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+ - 10 rows in set (0.00 sec) - -That's all :). Now we're all set to go with MariaDB with its improved and efficient features. Hope you enjoyed reading this documentation. I would recommend your valuable suggestions and feedback on this! - --------------------------------------------------------------------------------- - -via: http://linoxide.com/how-tos/install-mariadb-10-centos-7-cpanel/ - -作者:[Saheetha Shameer][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/saheethas/ From 0ff9c6c29c593d35b231937a4e70040a14ee9cc4 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Sat, 27 Feb 2016 09:12:48 +0800 Subject: [PATCH 0434/1469] Create 20160214 How to Install MariaDB 10 on CentOS 7 CPanel Server.md --- ...ll MariaDB 10 on CentOS 7 CPanel Server.md | 326 ++++++++++++++++++ 1 file changed, 326 insertions(+) create mode 100644 translated/tech/20160214 How to Install MariaDB 10 on CentOS 7 CPanel Server.md diff --git a/translated/tech/20160214 How to Install MariaDB 10 on CentOS 7 CPanel Server.md b/translated/tech/20160214 How to Install MariaDB 10 on CentOS 7 CPanel Server.md new file mode 100644 index 0000000000..8d452af0ad --- /dev/null +++ b/translated/tech/20160214 How to Install MariaDB 10 on CentOS 7 CPanel Server.md @@ -0,0 +1,326 @@ + +在 CentOS 7 CPanel 服务器上安装 MariaDB 10 +================================================================================ + +MariaDB 是一个增强版的,开源的并且可以直接替代 MySQL。它主要由 MariaDB 社区在维护,采用 GPL v2 授权许可。软件的安全性是 MariaDB 开发者的主要焦点。他们保持为 MariaDB 的每个版本发布安全补丁。当有任何安全问题被发现时,开发者会尽快修复并推出 MariaDB 的新版本。 + +### MariaDB 的优势 ### + +- 完全开源 +- 快速且透明的安全版本 +- 与 MySQL 高度兼容 +- 性能更好 +- 比 MySQL 的存储引擎多 + +在这篇文章中,我将谈论关于如何升级 MySQL5.5 到最新的 MariaDB 在CentOS7 CPanel 服务器上。在安装前先完成以下步骤。 + +### 先决条件: ### + +#### 1. 停止当前 MySQL 服务 #### + + root@server1 [/var/# mysql + Welcome to the MySQL monitor. Commands end with ; or \g. + Your MySQL connection id is 5859 + Server version: 5.5.47-cll MySQL Community Server (GPL) + + Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + + Oracle is a registered trademark of Oracle Corporation and/or its + affiliates. Other names may be trademarks of their respective + owners. + + Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. + + root@server1 [~]# systemctl stop mysql + root@server1 [~]# systemctl status mysql + ● mysql.service - LSB: start and stop MySQL + Loaded: loaded (/etc/rc.d/init.d/mysql) + Active: failed (Result: exit-code) since Sun 2016-01-31 10:00:02 UTC; 1min 31s ago + Docs: man:systemd-sysv-generator(8) + Main PID: 23430 (code=exited, status=203/EXEC) + + Jan 31 10:00:02 server1.centos7-test.com systemd[1]: Started MySQL Server. + Jan 31 10:00:02 server1.centos7-test.com systemd[1]: Starting MySQL Server... + Jan 31 10:00:02 server1.centos7-test.com systemd[1]: mysql.service: main process exited, code=exited, status=203/EXEC + Jan 31 10:00:02 server1.centos7-test.com systemd[1]: Unit mysql.service entered failed state. + Jan 31 10:00:02 server1.centos7-test.com systemd[1]: mysql.service failed. + +#### 2. 在升级之前将所有配置文件和数据库转移 #### + +转移数据库的存储路径和 MySQL 的配置文件 + + root@server1 [~]# cp -Rf /var/lib/mysql /var/lib/mysql-old + + root@server1 [/var/lib/mysql]# cat /etc/my.cnf + [mysqld] + default-storage-engine=MyISAM + innodb_file_per_table=1 + max_allowed_packet=268435456 + open_files_limit=10000 + + root@server1 [~]#mv /etc/my.cnf /etc/my.cnf-old + +#### 3. 从服务器上删除和卸载 MySQL 所有的 RPM 包 #### + +运行以下命令来禁用 MySQL 的 RPM 的目标。通过运行此命令,cPanel 将不再处理 MySQL 的更新,并在系统上将卸载的标记为 rpm.versions。 + + /scripts/update_local_rpm_versions --edit target_settings.MySQL50 uninstalled + /scripts/update_local_rpm_versions --edit target_settings.MySQL51 uninstalled + /scripts/update_local_rpm_versions --edit target_settings.MySQL55 uninstalled + /scripts/update_local_rpm_versions --edit target_settings.MySQL56 uninstalled + +现在运行以下命令: + +/scripts/check_cpanel_rpms --fix --targets=MySQL50,MySQL51,MySQL55,MySQL56 +移除服务器上所有已存在的 MySQL rpms 来为 MariaDB 的安装清理环境。请看下面的输出: + + root@server1 [/var/lib/mysql]# /scripts/check_cpanel_rpms --fix --targets=MySQL50,MySQL51,MySQL55,MySQL56 + [2016-01-31 09:53:59 +0000] + [2016-01-31 09:53:59 +0000] Problems were detected with cPanel-provided files which are RPM controlled. + [2016-01-31 09:53:59 +0000] If you did not make these changes intentionally, you can correct them by running: + [2016-01-31 09:53:59 +0000] + [2016-01-31 09:53:59 +0000] > /usr/local/cpanel/scripts/check_cpanel_rpms --fix + [2016-01-31 09:53:59 +0000] + [2016-01-31 09:53:59 +0000] The following RPMs are unneeded on your system and should be uninstalled: + [2016-01-31 09:53:59 +0000] MySQL55-client-5.5.47-1.cp1148 + [2016-01-31 09:53:59 +0000] MySQL55-devel-5.5.47-1.cp1148 + [2016-01-31 09:53:59 +0000] MySQL55-server-5.5.47-1.cp1148 + [2016-01-31 09:53:59 +0000] MySQL55-shared-5.5.47-1.cp1148 + [2016-01-31 09:53:59 +0000] MySQL55-test-5.5.47-1.cp1148 + [2016-01-31 09:53:59 +0000] compat-MySQL50-shared-5.0.96-4.cp1136 + [2016-01-31 09:53:59 +0000] compat-MySQL51-shared-5.1.73-1.cp1150 + [2016-01-31 09:53:59 +0000] Removing 0 broken rpms: + [2016-01-31 09:53:59 +0000] rpm: no packages given for erase + [2016-01-31 09:53:59 +0000] No new RPMS needed for install + [2016-01-31 09:53:59 +0000] Disabling service monitoring. + [2016-01-31 09:54:01 +0000] Uninstalling unneeded rpms: MySQL55-test MySQL55-server MySQL55-client compat-MySQL51-shared compat-MySQL50-shared MySQL55-shared MySQL55-devel + [2016-01-31 09:54:04 +0000] Removed symlink /etc/systemd/system/multi-user.target.wants/mysql.service. + [2016-01-31 09:54:04 +0000] Restoring service monitoring. + +通过这些步骤,我们已经卸载了现有的 MySQL RPMs,并做了标记来防止 MySQL的更新,服务器的环境已经清理然后准备安装 MariaDB。 + +开始安装吧,我们需要在 CentOS 为 MariaDB 创建一个 yum 软件库。下面是我的做法! + +### 安装步骤: ### + +#### 第1步:创建 YUM 软件库。#### + + root@server1 [~]# vim /etc/yum.repos.d/MariaDB.repo + [mariadb] + name = MariaDB + baseurl = http://yum.mariadb.org/10.0/centos7-amd64/ + gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB + gpgcheck=1 + root@server1 [/etc/yum.repos.d]# cat /etc/yum.repos.d/MariaDB.repo + [mariadb] + name = MariaDB + baseurl = http://yum.mariadb.org/10.0/centos7-amd64/ + gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB + gpgcheck=1 + +#### 第2步:打开 /etc/yum.conf 并修改如下行: #### + +**Remove this line** exclude=courier* dovecot* exim* filesystem httpd* mod_ssl* mydns* mysql* nsd* php* proftpd* pure-ftpd* spamassassin* squirrelmail* + +**And replace with this line** exclude=courier* dovecot* exim* filesystem httpd* mod_ssl* mydns* nsd* proftpd* pure-ftpd* spamassassin* squirrelmail* + +**\*\*\* IMPORTANT \*\*\*** + +需要确保我们已经从 exclude 列表中移除了 MySQL 和 PHP。 + +#### 第3步:运行以下命令来安装 MariaDB 和相关的包。 #### + +**yum install MariaDB-server MariaDB-client MariaDB-devel php-mysql** + + root@server1 [~]#yum install MariaDB-server MariaDB-client MariaDB-devel php-mysql + + Dependencies Resolved + + =============================================================================================================================================== + Package Arch Version Repository Size + =============================================================================================================================================== + Installing: + MariaDB-client x86_64 10.0.23-1.el7.centos mariadb 10 M + MariaDB-devel x86_64 10.0.23-1.el7.centos mariadb 6.3 M + MariaDB-server x86_64 10.0.23-1.el7.centos mariadb 55 M + php-mysql x86_64 5.4.16-36.el7_1 base 99 k + Installing for dependencies: + MariaDB-common x86_64 10.0.23-1.el7.centos mariadb 43 k + MariaDB-shared x86_64 10.0.23-1.el7.centos mariadb 1.2 M + libzip x86_64 0.10.1-8.el7 base 48 k + php-common x86_64 5.4.16-36.el7_1 base 563 k + php-pdo x86_64 5.4.16-36.el7_1 base 97 k + + Transaction Summary + =============================================================================================================================================== + Install 4 Packages (+5 Dependent package) + +#### 第4步:重新启动,并确保 MySQL 服务已启动。#### + + root@server1 [~]# systemctl start mysql + root@server1 [~]# + root@server1 [~]# + root@server1 [~]# systemctl status mysql + ● mysql.service - LSB: start and stop MySQL + Loaded: loaded (/etc/rc.d/init.d/mysql) + Active: active (exited) since Sun 2016-01-31 10:01:46 UTC; 3s ago + Docs: man:systemd-sysv-generator(8) + Process: 23717 ExecStart=/etc/rc.d/init.d/mysql start (code=exited, status=0/SUCCESS) + Main PID: 23430 (code=exited, status=203/EXEC) + + Jan 31 10:01:46 server1.centos7-test.com systemd[1]: Starting LSB: start and stop MySQL... + Jan 31 10:01:46 server1.centos7-test.com mysql[23717]: Starting MySQL SUCCESS! + Jan 31 10:01:46 server1.centos7-test.com systemd[1]: Started LSB: start and stop MySQL. + +#### 第5步:运行 mysql_upgrade 命令。 #### + +它将检查所有数据库中的所有表与当前安装的版本是否兼容并在必要时会更新系统表采取新的特权或功能,可能会增加当前版本的性能。 + + + root@server1 [~]# mysql_upgrade + MySQL upgrade detected + Phase 1/6: Checking and upgrading mysql database + Processing databases + mysql + mysql.columns_priv OK + mysql.db OK + mysql.event OK + mysql.func OK + mysql.help_category OK + mysql.help_keyword OK + mysql.help_relation OK + mysql.help_topic OK + mysql.host OK + mysql.ndb_binlog_index OK + mysql.plugin OK + mysql.proc OK + mysql.procs_priv OK + mysql.proxies_priv OK + mysql.servers OK + mysql.tables_priv OK + mysql.time_zone OK + mysql.time_zone_leap_second OK + mysql.time_zone_name OK + mysql.time_zone_transition OK + mysql.time_zone_transition_type OK + mysql.user OK + Phase 2/6: Fixing views from mysql + Phase 3/6: Running 'mysql_fix_privilege_tables' + Phase 4/6: Fixing table and database names + Phase 5/6: Checking and upgrading tables + Processing databases + cphulkd + cphulkd.auths OK + cphulkd.blacklist OK + cphulkd.brutes OK + cphulkd.good_logins OK + cphulkd.ip_lists OK + cphulkd.known_netblocks OK + cphulkd.login_track OK + cphulkd.logins OK + cphulkd.report OK + cphulkd.whitelist OK + eximstats + eximstats.defers OK + eximstats.failures OK + eximstats.sends OK + eximstats.smtp OK + information_schema + leechprotect + leechprotect.hits OK + modsec + modsec.hits OK + performance_schema + roundcube + roundcube.cache OK + roundcube.cache_index OK + roundcube.cache_messages OK + roundcube.cache_shared OK + roundcube.cache_thread OK + roundcube.contactgroupmembers OK + roundcube.contactgroups OK + roundcube.contacts OK + roundcube.cp_schema_version OK + roundcube.dictionary OK + roundcube.identities OK + roundcube.searches OK + roundcube.session OK + roundcube.system OK + roundcube.users OK + saheetha_test + saheetha_test.authors OK + whmxfer + whmxfer.sessions OK + Phase 6/6: Running 'FLUSH PRIVILEGES' + OK + +#### 第6步:再次重新启动MySQL的服务,以确保一切都运行完好。 #### + + root@server1 [~]# systemctl restart mysql + root@server1 [~]# + root@server1 [~]# systemctl status mysql + ● mysql.service - LSB: start and stop MySQL + Loaded: loaded (/etc/rc.d/init.d/mysql) + Active: active (running) since Sun 2016-01-31 10:04:11 UTC; 9s ago + Docs: man:systemd-sysv-generator(8) + Process: 23831 ExecStop=/etc/rc.d/init.d/mysql stop (code=exited, status=0/SUCCESS) + Process: 23854 ExecStart=/etc/rc.d/init.d/mysql start (code=exited, status=0/SUCCESS) + Main PID: 23430 (code=exited, status=203/EXEC) + CGroup: /system.slice/mysql.service + ├─23861 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/server1.centos7-test.com.pid + └─23933 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/v... + + Jan 31 10:04:10 server1.centos7-test.com systemd[1]: Starting LSB: start and stop MySQL... + Jan 31 10:04:11 server1.centos7-test.com mysql[23854]: Starting MySQL. SUCCESS! + Jan 31 10:04:11 server1.centos7-test.com systemd[1]: Started LSB: start and stop MySQL. + +#### 第7步:运行 EasyApache 用 MariaDB 重建 Apache/PHP,并确保所有 PHP 的模块保持不变。#### + + root@server1 [~]#/scripts/easyapache --build + + ****IMPORTANT ***** + If you forget to rebuild Apache/PHP after the MariaDB installation, it will report the library error as below: + + root@server1 [/etc/my.cnf.d]# php -v + php: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory + +#### 第8步:现在验证安装的数据库。 #### + + root@server1 [/var/lib/mysql]# mysql + Welcome to the MariaDB monitor. Commands end with ; or \g. + Your MariaDB connection id is 15 + Server version: 10.0.23-MariaDB MariaDB Server + + Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others. + + Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. + + MariaDB [(none)]> show storage engines; + +--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+ + | Engine | Support | Comment | Transactions | XA | Savepoints | + +--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+ + | CSV | YES | CSV storage engine | NO | NO | NO | + | MRG_MyISAM | YES | Collection of identical MyISAM tables | NO | NO | NO | + | MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO | + | BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO | + | MyISAM | YES | MyISAM storage engine | NO | NO | NO | + | InnoDB | DEFAULT | Percona-XtraDB, Supports transactions, row-level locking, and foreign keys | YES | YES | YES | + | ARCHIVE | YES | Archive storage engine | NO | NO | NO | + | FEDERATED | YES | FederatedX pluggable storage engine | YES | NO | YES | + | PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO | + | Aria | YES | Crash-safe tables with MyISAM heritage | NO | NO | NO | + +--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+ + 10 rows in set (0.00 sec) + +就这样 :)。现在,我们该去欣赏 MariaDB 完善和高效的特点了。希望你喜欢阅读本文。希望留下您宝贵的建议和反馈! +-------------------------------------------------------------------------------- + +via: http://linoxide.com/how-tos/install-mariadb-10-centos-7-cpanel/ + +作者:[Saheetha Shameer][a] +译者:[strugglingyouth](https://github.com/strugglingyouth) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/saheethas/ From 84afc48e27e7e0b72cb2e017fb2a74d3ff28d5c2 Mon Sep 17 00:00:00 2001 From: name1e5s <836401406@qq.com> Date: Sat, 27 Feb 2016 14:55:00 +0800 Subject: [PATCH 0435/1469] [Translated]20151019 Gaming On Linux--All You Need To Know --- ...9 Gaming On Linux--All You Need To Know.md | 204 ------------------ ...9 Gaming On Linux--All You Need To Know.md | 200 +++++++++++++++++ 2 files changed, 200 insertions(+), 204 deletions(-) delete mode 100644 sources/talk/20151019 Gaming On Linux--All You Need To Know.md create mode 100644 translated/talk/20151019 Gaming On Linux--All You Need To Know.md diff --git a/sources/talk/20151019 Gaming On Linux--All You Need To Know.md b/sources/talk/20151019 Gaming On Linux--All You Need To Know.md deleted file mode 100644 index 6618b8302d..0000000000 --- a/sources/talk/20151019 Gaming On Linux--All You Need To Know.md +++ /dev/null @@ -1,204 +0,0 @@ -name1e5s translating -Gaming On Linux: All You Need To Know -================================================================================ -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/10/Gaming-on-Linux.jpeg) - -**Can I play games on Linux?** - -This is one of the most frequently asked questions by people who are thinking about [switching to Linux][1]. After all, gaming on Linux often termed as a distant possibility. In fact, some people even wonder if they can listen to music or watch movies on Linux. Considering that, question about native Linux games seem genuine. - -In this article, I am going to answer most of the Linux gaming questions a Linux beginner may have. For example, if it is possible to play games on Linux, if yes, what are the Linux games available, where can you **download Linux games** from or how do you get more information of gaming on Linux. - -But before I do that, let me make a confession. I am not a PC gamer or rather I should say, I am not desktop Linux gamer. I prefer to play games on my PS4 and I don’t care about PC games or even mobile games (no candy crush request sent to anyone in my friend list). This is the reason you see only a few articles in [Linux games][2] section of It’s FOSS. - -So why am I covering this topic then? - -Because I have been asked questions about playing games on Linux several times and I wanted to come up with a Linux gaming guide that could answer all those question. And remember, it’s not just gaming on Ubuntu I am talking about here. I am talking about Linux in general. - -### Can you play games on Linux? ### - -Yes and no! - -Yes, you can play games on Linux and no, you cannot play ‘all the games’ in Linux. - -Confused? Don’t be. What I meant here is that you can get plenty of popular games on Linux such as [Counter Strike, Metro Last Night][3] etc. But you might not get all the latest and popular Windows games on Linux, for e.g., [PES 2015][4]. - -The reason, in my opinion, is that Linux has less than 2% of desktop market share and these numbers are demotivating enough for most game developers to avoid working on the Linux version of their games. - -Which means that there is huge possibility that the most talked about games of the year may not be playable in Linux. Don’t despair, there are ‘other means’ to get these games on Linux and we shall see it in coming sections, but before that let’s talk about what kind of games are available for Linux. - -If I have to categorize, I’ll divide them in four categories: - -1. Native Linux Games -1. Windows games in Linux -1. Browser Games -1. Terminal Games - -Let’s start with the most important one, native Linux games, first. - ----------- - -### 1. Where to find native Linux games? ### - -Native Linux games mean those games which are officially supported in Linux. These games have native Linux client and can be installed like most other applications in Linux without requiring any additional effort (we’ll see about these in next section). - -So, as you see, there are games developed for Linux. Next question that arises is where can you find these Linux games and how can you play them. I am going to list some of the resources where you can get Linux games. - -#### Steam #### - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/09/Install-Steam-Ubuntu-11.jpeg) - -“[Steam][5] is a digital distribution platform for video games. As Amazon Kindle is digital distribution platform for e-Books, iTunes for music, similarly Steam is for games. It provides you the option to buy and install games, play multiplayer and stay in touch with other games via social networking on its platform. The games are protected with [DRM][6].” - -A couple of years ago, when gaming platform Steam announced support for Linux, it was a big news. It was an indication that gaming on Linux is being taken seriously. Though Steam’s decision was more influenced with its own Linux-based gaming console and a separate [Linux distribution called Steam OS][7], it still was a reassuring move that has brought a number of games on Linux. - -I have written a detailed article about installing and using Steam. If you are getting started with Steam, do read it. - -- [Install and use Steam for gaming on Linux][8] - -#### GOG.com #### - -[GOG.com][9] is another platform similar to Steam. Like Steam, you can browse and find hundreds of native Linux games on GOG.com, purchase the games and install them. If the games support several platforms, you can download and use them across various operating systems. Your purchased games are available for you all the time in your account. You can download them anytime you wish. - -One main difference between the two is that GOG.com offers only DRM free games and movies. Also, GOG.com is entirely web based. So you don’t need to install a client like Steam. You can simply download the games from browser and install them in your system. - -#### Portable Linux Games #### - -[Portable Linux Games][10] is a website that has a collection of a number of Linux games. The unique and best thing about Portable Linux Games is that you can download and store the games for offline installation. - -The downloaded files have all the dependencies (at times Wine and Perl installation) and these are also platform independent. All you need to do is to download the files and double click to install them. Store the downloadable file on external hard disk and use them in future. Highly recommend if you don’t have continuous access to high speed internet. - -#### Game Drift Game Store #### - -[Game Drift][11] is actually a Linux distribution based on Ubuntu with sole focus on gaming. While you might not want to start using this Linux distribution for the sole purpose of gaming, you can always visit its game store online and see what games are available for Linux and install them. - -#### Linux Game Database #### - -As the name suggests, [Linux Game Database][12] is a website with a huge collection of Linux games. You can browse through various category of games and download/install them from the game developer’s website. As a member of Linux Game Database, you can even rate the games. LGDB, kind of, aims to be the IGN or IMDB for Linux games. - -#### Penguspy #### - -Created by a gamer who refused to use Windows for playing games, [Penguspy][13] showcases a collection of some of the best Linux games. You can browse games based on category and if you like the game, you’ll have to go to the respective game developer’s website. - -#### Software Repositories #### - -Look into the software repositories of your own Linux distribution. There always will be some games in it. If you are using Ubuntu, Ubuntu Software Center itself has an entire section for games. Same is true for other Linux distributions such as Linux Mint etc. - ----------- - -### 2. How to play Windows games in Linux? ### - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/10/Wine-Linux.png) - -So far we talked about native Linux games. But there are not many Linux games, or to be more precise, most popular Linux games are not available for Linux but they are available for Windows PC. So the questions arises, how to play Windows games in Linux? - -Good thing is that with the help of tools like Wine, PlayOnLinux and CrossOver, you can play a number of popular Windows games in Linux. - -#### Wine #### - -Wine is a compatibility layer which is capable of running Windows applications in systems like Linux, BSD and OS X. With the help of Wine, you can install and use a number of Windows applications in Linux. - -[Installing Wine in Ubuntu][14] or any other Linux is easy as it is available in most Linux distributions’ repository. There is a huge [database of applications and games supported by Wine][15] that you can browse. - -#### CrossOver #### - -[CrossOver][16] is an improved version of Wine that brings professional and technical support to Wine. But unlike Wine, CrossOver is not free. You’ll have to purchase the yearly license for it. Good thing about CrossOver is that every purchase contributes to Wine developers and that in fact boosts the development of Wine to support more Windows games and applications. If you can afford $48 a year, you should buy CrossOver for the support they provide. - -### PlayOnLinux ### - -PlayOnLinux too is based on Wine but implemented differently. It has different interface and slightly easier to use than Wine. Like Wine, PlayOnLinux too is free to use. You can browse the [applications and games supported by PlayOnLinux on its database][17]. - ----------- - -### 3. Browser Games ### - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/10/Chrome-Web-Store.jpeg) - -Needless to say that there are tons of browser based games that are available to play in any operating system, be it Windows or Linux or Mac OS X. Most of the addictive mobile games, such as [GoodGame Empire][18], also have their web browser counterparts. - -Apart from that, thanks to [Google Chrome Web Store][19], you can play some more games in Linux. These Chrome games are installed like a standalone app and they can be accessed from the application menu of your Linux OS. Some of these Chrome games are playable offline as well. - ----------- - -### 4. Terminal Games ### - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/03/nSnake_Linux_terminal_game.jpeg) - -Added advantage of using Linux is that you can use the command line terminal to play games. I know that it’s not the best way to play games but at times, it’s fun to play games like [Snake][20] or [2048][21] in terminal. There is a good collection of Linux terminal games at [this blog][22]. You can browse through it and play the ones you want. - ----------- - -### How to stay updated about Linux games? ### - -When you have learned a lot about what kind of games are available on Linux and how could you use them, next question is how to stay updated about new games on Linux? And for that, I advise you to follow these blogs that provide you with the latest happenings of the Linux gaming world: - -- [Gaming on Linux][23]: I won’t be wrong if I call it the nest Linux gaming news portal. You get all the latest rumblings and news about Linux games. Frequently updated, Gaming on Linux has dedicated fan following which makes it a nice community of Linux game lovers. -- [Free Gamer][24]: A blog focusing on free and open source games. -- [Linux Game News][25]: A Tumbler blog that updates on various Linux games. - -#### What else? #### - -I think that’s pretty much what you need to know to get started with gaming on Linux. If you are still not convinced, I would advise you to [dual boot Linux with Windows][26]. Use Linux as your main desktop and if you want to play games, boot into Windows. This could be a compromised solution. - -I think that’s pretty much what you need to know to get started with gaming on Linux. If you are still not convinced, I would advise you to [dual boot Linux with Windows][27]. Use Linux as your main desktop and if you want to play games, boot into Windows. This could be a compromised solution. - -It’s time for you to add your inputs. Do you play games on your Linux desktop? What are your favorites? What blogs you follow to stay updated on latest Linux games? - - -投票项目: -How do you play games on Linux? - -- I use Wine and PlayOnLinux along with native Linux Games -- I am happy with Browser Games -- I prefer the Terminal Games -- I use native Linux games only -- I play it on Steam -- I dual boot and go in to Windows to play games -- I don't play games at all - -注:投票代码 -
-
- - - -注,发布时根据情况看怎么处理 - --------------------------------------------------------------------------------- - -via: http://itsfoss.com/linux-gaming-guide/ - -作者:[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/reasons-switch-linux-windows-xp/ -[2]:http://itsfoss.com/category/games/ -[3]:http://blog.counter-strike.net/ -[4]:https://pes.konami.com/tag/pes-2015/ -[5]:http://store.steampowered.com/ -[6]:https://en.wikipedia.org/wiki/Digital_rights_management -[7]:http://itsfoss.com/valve-annouces-linux-based-gaming-operating-system-steamos/ -[8]:http://itsfoss.com/install-steam-ubuntu-linux/ -[9]:http://www.gog.com/ -[10]:http://www.portablelinuxgames.org/ -[11]:http://gamedrift.org/GameStore.html -[12]:http://www.lgdb.org/ -[13]:http://www.penguspy.com/ -[14]:http://itsfoss.com/wine-1-5-11-released-ppa-available-to-download/ -[15]:https://appdb.winehq.org/ -[16]:https://www.codeweavers.com/products/ -[17]:https://www.playonlinux.com/en/supported_apps.html -[18]:http://empire.goodgamestudios.com/ -[19]:https://chrome.google.com/webstore/category/apps -[20]:http://itsfoss.com/nsnake-play-classic-snake-game-linux-terminal/ -[21]:http://itsfoss.com/play-2048-linux-terminal/ -[22]:https://ttygames.wordpress.com/ -[23]:https://www.gamingonlinux.com/ -[24]:http://freegamer.blogspot.fr/ -[25]:http://linuxgamenews.com/ -[26]:http://itsfoss.com/install-ubuntu-1404-dual-boot-mode-windows-8-81-uefi/ -[27]:http://itsfoss.com/install-ubuntu-1404-dual-boot-mode-windows-8-81-uefi/ diff --git a/translated/talk/20151019 Gaming On Linux--All You Need To Know.md b/translated/talk/20151019 Gaming On Linux--All You Need To Know.md new file mode 100644 index 0000000000..ae46ccb117 --- /dev/null +++ b/translated/talk/20151019 Gaming On Linux--All You Need To Know.md @@ -0,0 +1,200 @@ +Linux上的游戏:所有你需要知道的 +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/10/Gaming-on-Linux.jpeg) + +** 我能在 Linux 上玩游戏吗 ?** + +这是打算[投奔 Linux 阵营][1]的人最经常问的问题之一。毕竟,在 Linux 上面玩游戏经常被认为有点难以实现。事实上,一些人甚至考虑他们能不能在 Linux 上看电影或者听音乐。考虑到这些,关于 Linux 的平台的游戏的问题是很现实的。「 + +在本文中,我将解答大多数 Linux 新手关于在 Linux 打游戏的问题。例如 Linux 下能不能玩游戏,如果能的话,在**哪里下载游戏**或者如何获取有关游戏的信息。 + +但是在此之前,我需要说明一下。我不是一个 PC 上的玩家或者说我不认为我是一个在 Linux 桌面上完游玩戏的家伙。我更喜欢在 PS4 上玩游戏并且我不关心 PC 上的游戏甚至也不关心手机上的游戏(我没有给我的任何一个朋友安利糖果传奇)。这也就是你很少在 It's FOSS 上很少看见关于 [Linux 上的游戏][2]的部分。 + +所以我为什么要写这个主题? + +因为别人问过我几次有关 Linux 上的游戏的问题并且我想要写出来一个能解答这些问题的 Linux 上的游戏指南。注意,在这里我不只是讨论 Ubuntu 上的游戏。我讨论的是在所有的 Linux 上的游戏。 + +### 我能在 Linux 上玩游戏吗 ? ### + +是,但不是完全是。 + +“是”,是指你能在Linux上玩游戏;“不完全是”,是指你不能在 Linux 上玩 ’所有的游戏‘。 + +什么?你是拒绝的?不必这样。我的意思是你能在 Linux 上玩很多流行的游戏,比如[反恐精英以及地铁:最后的曙光][3]等。但是你可能不能玩到所有在 Windows 上流行的最新游戏,比如[实况足球2015][4]。 + +在我看来,造成这种情况的原因是 Linux 在桌面系统中仅占不到 2%,这占比使得大多数开发者没有在 Linux 上发布他们的游戏的打算。 + +这就意味指大多数近年来被提及的比较多的游戏很有可能不能在 Linux 上玩。不要灰心。我们能以某种方式在 Linux 上玩这些游戏,我们将在下面的章节中讨论这些方法。但是,在此之前,让我们看看在 Linux 上能玩的游戏的种类。 + +要我说的话,我会把那些游戏分为四类: + +1. Linux 原生游戏 +2. Linux 上的 Windows 游戏 +3. 浏览器里的游戏 +4. 终端里的游戏 + +让我们以最重要的 Linux 的原生游戏开始。 + +--------- + +### 1. 在哪里去找 Llinux 原生游戏 ?### + +原生游戏指的是官方支持 Linux 的游戏。这些游戏有原生的 Linux 客户端并且能像在 Linux 上的其他软件一样不需要附加的步骤就能安装在 Linux 上面(我们将在下一节讨论)。 + +所以,如你所见,这里有一些为 Linux 开发的游戏,下一个问题就是在哪能找到这些游戏以及如何安装。我将列出来一些让你玩到游戏的渠道了。 + +#### Steam #### + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/09/Install-Steam-Ubuntu-11.jpeg) + +“[Steam][5] 是一个游戏的分发平台。就如同 Kindle 是电子书的分发平台,iTunes 是音乐的分发平台一样,Steam 也具有那样的功能。它给了你购买和安装游戏,玩多人游戏以及在它的平台上关注其他游戏的选项。这些游戏被[ DRM ][6]所保护。” + +两年以前,游戏平台 Steam 宣布支持 Linux,这在当时是一个大新闻。这是 Linux 上玩游戏被严肃的对待的一个迹象。尽管这个决定更多地影响了他们自己的基于 Linux 游戏平台[ Steam OS][7]。这仍然是令人欣慰的事情,因为它给 Linux 带来了一大堆游戏。 + +我已经写了一篇详细的关于安装以及使用 Steam 的文章。如果你想开始使用 Steam 的话,读读那篇文章。 + +- [在 Linux 上安装以及使用 Steam ][8] + +#### GOG.com #### + +[GOG.com][9] 失灵一个与 Steam 类似的平台。与 Steam 一样,你能在这上面找到数以百计的 Linux 游戏,你可以购买和安装它们。如果游戏支持好几个平台,尼卡一在多个操作系统上安装他们。你买到你账户的游戏你可以随时玩。捏可以在你想要下载的任何时间下载。 + +GOG.com 与 Steam 不同的是前者仅提供没有 DRM 保护的游戏以及电影。而且,GOG.com 完全是基于网页的,所以你不需要安装类似 Steam 的客户端。你只需要用浏览器下载游戏然后安装到你的系统上。 + +#### Portable Linux Games #### + +[Portable Linux Games][10] 是一个集聚了不少 Linux 游戏的网站。这家网站最特别以及最好的就是你能离线安装这些游戏。 + +你下载到的文件包含所有的依赖(仅需 Wine 以及 Perl)并且他们也是与平台无关的。你所需要的仅仅是下载文件并且双击来启动安装程序。你也可以把文件储存起来以用于将来的安装,如果你网速不够快的话我很推荐您这样做。 + +#### Game Drift 游戏商店 #### + +[Game Drift][11] 是一个只专注于游戏的基于 Ubuntu 的 Linux 发行版。但是如果你不想只为游戏就去安装这个发行版的话,你也可以经常上线看哪个游戏可以在 Linux 上运行并且安装他们。 + +#### Linux Game Database #### + +如其名字所示,[Linux Game Database][12]是一个收集了很多 Linux 游戏的网站。你能在这里浏览诸多类型的游戏并从游戏开发者的网站下载/安装这些游戏。作为这家网站的会员,你甚至可以为游戏打分。LGDB,有点像 Linux 游戏界的 IMDB 或者 IGN. + +#### Penguspy #### + +此网站由一个不想用 Windows 玩游戏的玩家创立。[Penguspy][13] 聚集了一些 Linux 下最好的游戏。在这里你也能分类浏览游戏,如果你喜欢这个游戏的话,你可以跳转到游戏开发者的网站去下载安装。 + +#### 软件源 #### + +看看你自己的发行版的软件源。那里可能有一些游戏。如果你用 Ubuntu 的话,它的软件中心里有一个游戏的分类。在一些其他的发行版里也有,比如 Liux Mint 等。 + +---------- + +### 2. 如何在 Linux 上玩 Windows 的游戏 ?### + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/10/Wine-Linux.png) + +到现在为止,我们一直在讨论 Linux 的原生游戏。但是并没有很多 Linux 上的原生游戏,或者说,火的不要不要的游戏大多不支持 Linux,但是都支持 Windows PC。所以,如何在 Linux 上玩 Wendows 的游戏? + +幸好,由于我们有 Wine, PlayOnLinux 和 CrossOver 等工具,我们能在 Linux 上玩不少的 Wendows 游戏。 + +#### Wine #### + +Wine 是一个能使 Wendows 应用在类似 Linux, BSD 和 OS X 上运行的兼容层。在 Wine 的帮助下,你可以在 Linux 下安装以及使用很多 Windows 下的应用。 + +[在 Ubuntu 上安装 Wine][14]或者在其他 Linux 上安装 Wine 是很简单的,因为大多数发行版的软件源里都有它。这里也有一个很大的[ Wine 支持的应用的数据库][15]供您浏览。 + +#### CrossOver #### + +[CrossOver][16] 是 Wine 的增强版,它给 Wine 提供了专业的技术上的支持。但是与 Wine 不同, CrossOver 不是免费的。你需要购买许可。好消息是它会把更新也贡献到 Wine 的开发者那里并且事实上加速了 Wine 的开发使得 Wine 能支持更多的 Windows 上的游戏和应用。如果你可以一年支付 48 美元,你可以购买 CrossOver 并得到他们提供的技术支持。 + +### PlayOnLinux ### + +PlayOnLinux 也基于 Wine 但是执行程序的方式略有不同。它有着更好用的,不同的界面。与 Wine 一样,PlayOnLinux 也是免费使用。你可以在[开发者自己的数据库里查看它支持的应用以及游戏][17]。 + +---------- + +### 3. 网页游戏 ### + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/10/Chrome-Web-Store.jpeg) + +不必说你也应该知道有非常多的基于网页的游戏,这些游戏都可以在任何操作系统里运行,无论是 Windows,Linux,还是 OS X。大多数让人上瘾的手机游戏,比如[帝国之战][18]就有官方的网页版。 + +除了这些,还有 [Google Chrome在线商店][19],你可以在 Linux 上玩更多的这些游戏。这些 Chrome 上的游戏可以像一个单独的应用一样安装并从应用菜单中打开,一些游戏就算是离线也能运行。 + +---------- + +### 4. 终端游戏 ### + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/03/nSnake_Linux_terminal_game.jpeg) + +使用 Linux 的一个附加优势就是可以使用命令行终端玩游戏。我知道这不是最好的玩游戏的 方法,但是在终端里玩[贪吃蛇][20]或者 [2048][21] 很有趣。在[这个博客][21]中有一些好玩的的终端游戏。你可以浏览并安装你喜欢的游戏。 + +---------- + +### 如何保证游戏的版本是最新的 ?### + +当你了解了不少的在 Linux 上你可以玩到的游戏以及你如何使用他们,下一个问题就是如何保持游戏的版本是最新的。对于这件事,我建议你看看下面的博客,这些博客能告诉你 Linux 游戏世界的最新消息: + +- [Gaming on Linux][23]:我认为我把它叫做 Linux 游戏的门户并没有错误。在这你可以得到关于 Linux 的游戏的最新的传言以及新闻。最近, Gaming on Linux 有了一个由 Linux 游戏爱好者组成的漂亮的社区。 +- [Free Gamer][24]:一个专注于免费开源的游戏的博客。 +- [Linux Game News][25]:一个提供很多的 Linux 游戏的升级的 Tumbler 博客。 + +#### 还有别的要说呃吗? #### + +我认为让你知道如何开始在 Linux 上的游戏人生是一个好事。如果你仍然不能被说服。我推荐你做个[双系统][26],把 Linux 作为你的主要桌面系统,当你想玩游戏时,重启到 Windows。这是一个对游戏妥协的解决办法。 + +现在,这里是你说出你自己的状况的时候了。你在 Linux 上玩游戏吗?你最喜欢什么游戏?你关注了哪些游戏博客? + + +投票项目: +你怎样在 Linux 上玩游戏? + +- 我玩原生 Linux 游戏,我也用 Wine 以及 PlayOnLinux 运行 Windows 游戏 +- 我喜欢网页游戏 +- 我喜欢终端游戏 +- 我只玩原生 Linux 游戏 +- 我用 Steam +- 我用双系统,要玩游戏时就换到 Windows +- 我不玩游戏 + +注:投票代码 +
+
+ + + +注,发布时根据情况看怎么处理 + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/linux-gaming-guide/ + +作者:[Abhishek][a] +译者:[name1e5s](https://github.com/name1e5s) +校对:[校对者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/reasons-switch-linux-windows-xp/ +[2]:http://itsfoss.com/category/games/ +[3]:http://blog.counter-strike.net/ +[4]:https://pes.konami.com/tag/pes-2015/ +[5]:http://store.steampowered.com/ +[6]:https://en.wikipedia.org/wiki/Digital_rights_management +[7]:http://itsfoss.com/valve-annouces-linux-based-gaming-operating-system-steamos/ +[8]:http://itsfoss.com/install-steam-ubuntu-linux/ +[9]:http://www.gog.com/ +[10]:http://www.portablelinuxgames.org/ +[11]:http://gamedrift.org/GameStore.html +[12]:http://www.lgdb.org/ +[13]:http://www.penguspy.com/ +[14]:http://itsfoss.com/wine-1-5-11-released-ppa-available-to-download/ +[15]:https://appdb.winehq.org/ +[16]:https://www.codeweavers.com/products/ +[17]:https://www.playonlinux.com/en/supported_apps.html +[18]:http://empire.goodgamestudios.com/ +[19]:https://chrome.google.com/webstore/category/apps +[20]:http://itsfoss.com/nsnake-play-classic-snake-game-linux-terminal/ +[21]:http://itsfoss.com/play-2048-linux-terminal/ +[22]:https://ttygames.wordpress.com/ +[23]:https://www.gamingonlinux.com/ +[24]:http://freegamer.blogspot.fr/ +[25]:http://linuxgamenews.com/ +[26]:http://itsfoss.com/install-ubuntu-1404-dual-boot-mode-windows-8-81-uefi/ \ No newline at end of file From 8b39d31702ec2d5ffeed0a4f8ab76252d2ed6bd8 Mon Sep 17 00:00:00 2001 From: name1e5s <836401406@qq.com> Date: Sat, 27 Feb 2016 15:00:12 +0800 Subject: [PATCH 0436/1469] =?UTF-8?q?remove=20=E5=91=83=20in=20line=20138?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../talk/20151019 Gaming On Linux--All You Need To Know.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translated/talk/20151019 Gaming On Linux--All You Need To Know.md b/translated/talk/20151019 Gaming On Linux--All You Need To Know.md index ae46ccb117..d43b548f7c 100644 --- a/translated/talk/20151019 Gaming On Linux--All You Need To Know.md +++ b/translated/talk/20151019 Gaming On Linux--All You Need To Know.md @@ -135,7 +135,7 @@ PlayOnLinux 也基于 Wine 但是执行程序的方式略有不同。它有着 - [Free Gamer][24]:一个专注于免费开源的游戏的博客。 - [Linux Game News][25]:一个提供很多的 Linux 游戏的升级的 Tumbler 博客。 -#### 还有别的要说呃吗? #### +#### 还有别的要说的吗? #### 我认为让你知道如何开始在 Linux 上的游戏人生是一个好事。如果你仍然不能被说服。我推荐你做个[双系统][26],把 Linux 作为你的主要桌面系统,当你想玩游戏时,重启到 Windows。这是一个对游戏妥协的解决办法。 @@ -197,4 +197,4 @@ via: http://itsfoss.com/linux-gaming-guide/ [23]:https://www.gamingonlinux.com/ [24]:http://freegamer.blogspot.fr/ [25]:http://linuxgamenews.com/ -[26]:http://itsfoss.com/install-ubuntu-1404-dual-boot-mode-windows-8-81-uefi/ \ No newline at end of file +[26]:http://itsfoss.com/install-ubuntu-1404-dual-boot-mode-windows-8-81-uefi/ From e7827fd92651f3ae5c63b2b50169579961579dd6 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 27 Feb 2016 17:54:43 +0800 Subject: [PATCH 0437/1469] =?UTF-8?q?20160227-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rom Facebook, IBM, Yahoo, and more news.md | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 sources/news/20160227 Zephyr Project for Internet of Things, releases from Facebook, IBM, Yahoo, and more news.md diff --git a/sources/news/20160227 Zephyr Project for Internet of Things, releases from Facebook, IBM, Yahoo, and more news.md b/sources/news/20160227 Zephyr Project for Internet of Things, releases from Facebook, IBM, Yahoo, and more news.md new file mode 100644 index 0000000000..518256d0e9 --- /dev/null +++ b/sources/news/20160227 Zephyr Project for Internet of Things, releases from Facebook, IBM, Yahoo, and more news.md @@ -0,0 +1,72 @@ +Zephyr Project for Internet of Things, releases from Facebook, IBM, Yahoo, and more news +=========================================================================================== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/weekly_news_roundup_tv.png?itok=eqUoW1gU) + +In this week's edition of our open source news roundup, we take a look at the new IoT project from the Linux Foundation, three big corporations releasing open source, and more. + +**News roundup for February 21 - 26, 2016** + +### Linux Foundation unveils the Zephyr Project + +The Internet of Things (IoT) is shaping up to be the next big thing in consumer technology. At the moment, most IoT solutions are proprietary and closed source. Open source is making numerous in-roads into the IoT world, and that's undoubtedly going to accelerate now that the Linux Foundation has [announced the Zephyr Project][1]. + +The Zephyr Project, according to ZDNet, "hopes to bring vendors and developers together under a single operating system which could make the development of connected devices an easier, less expensive and more stable process." The Project "aims to incorporate input from the open source and embedded developer communities and to encourage collaboration on the RTOS (real-time operating system)," according to the [Linux Foundation's press release][2]. + +Currently, Intel Corporation, NXP Semiconductors N.V., Synopsys, Inc., and UbiquiOS Technology Limited are the main supporters of the project. The Linux Foundation intends to attract other IoT vendors to this effort as well. + +### Releases from Facebook, IBM, Yahoo + +As we all know, open source isn't just about individuals or small groups hacking on code and hardware. Quite a few large corporations have significant investments in open source. This past week, three of them affirmed their commitment to open source. + +Yahoo again waded into open source waters this week with the [release of CaffeOnSpark][3] artificial intelligence software under an Apache 2.0 license. CaffeOnSpark performs "a popular type of AI called 'deep learning' on the vast swaths of data kept in its Hadoop open-source file system for storing big data," according to VentureBeat. If you're curious, you can [find the source code on GitHub][4]. + +Earlier this week, Facebook "[unveiled a new project that seeks not only to accelerate the evolution of technologies that drive our mobile networks, but to freely share this work with the world’s telecoms][5]," according to Wired. The company plans to build "everything from new wireless radios to nee optical fiber equipment." The designs, according to Facebook, will be open source so any telecom firm can use them. + +As part of the [Open Mainframe Project][6], IBM has open sourced the code for its Anomaly Detection Engine (ADE) for Linux logs. [According to IBM][7], "ADE detects anomalous time slices and messages in Linux logs using statistical learning" to detect suspicious behaviour. You can grab the [source code for ADE][8] from GitHub. + +### European Union to fund research + +The European Research Council, the European Union's science and technology funding body, is [funding four open source research projects][9] to the tune of about €2 million. According to joinup.ec.europa.eu, the projects being funded are: + +- A code audit of Mozilla's open source Rust programming language + +- An initiative at INRIA (France's national computer science research center) studying secure programming + +- A project at Austria's Technische Universitat Graz testing "ways to secure code against attacks that exploit certain properties of the computer hardware" + +- The "development of techniques to prove popular cryptographic protocols and schemes" at IST Austria + +### In other news + +- [Infosys' newest weapon: open source][10] + +- [Intel demonstrates Android smartphone running a Linux desktop][11] + +- [BeeGFS file system goes open source][12] + +A big thanks, as always, to the Opensource.com moderators and staff for their help this week. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/16/2/weekly-news-feb-26 + +作者:[Scott Nesbitt][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/scottnesbitt +[1]: http://www.zdnet.com/article/the-linux-foundations-zephyr-project-building-an-operating-system-for-iot-devices/ +[2]: http://www.linuxfoundation.org/news-media/announcements/2016/02/linux-foundation-announces-project-build-real-time-operating-system +[3]: http://venturebeat.com/2016/02/24/yahoo-open-sources-caffeonspark-deep-learning-framework-for-hadoop/ +[4]: https://github.com/yahoo/CaffeOnSpark +[5]: http://www.wired.com/2016/02/facebook-open-source-wireless-gear-forge-5g-world/ +[6]: https://www.openmainframeproject.org/ +[7]: http://openmainframeproject.github.io/ade/ +[8]: https://github.com/openmainframeproject/ade +[9]: https://joinup.ec.europa.eu/node/149541 +[10]: http://www.businessinsider.in/Exclusive-Infosys-is-using-Open-Source-as-its-mostlethal-weapon-yet/articleshow/51109129.cms +[11]: http://www.theregister.co.uk/2016/02/23/move_over_continuum_intel_shows_android_smartphone_powering_bigscreen_linux/ +[12]: http://insidehpc.com/2016/02/beegfs-parallel-file-system-now-open-source/ From 9b8154162c9ac491b4116709a3c16da2b44bcb60 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 27 Feb 2016 18:35:13 +0800 Subject: [PATCH 0438/1469] =?UTF-8?q?20160227-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... to use Python to hack your Eclipse IDE.md | 215 ++++++++++++++++++ 1 file changed, 215 insertions(+) create mode 100644 sources/tech/20160226 How to use Python to hack your Eclipse IDE.md diff --git a/sources/tech/20160226 How to use Python to hack your Eclipse IDE.md b/sources/tech/20160226 How to use Python to hack your Eclipse IDE.md new file mode 100644 index 0000000000..770c6db479 --- /dev/null +++ b/sources/tech/20160226 How to use Python to hack your Eclipse IDE.md @@ -0,0 +1,215 @@ +How to use Python to hack your Eclipse IDE +============================================== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/lightbulb_computer_person_general_.png?itok=ZY3UuQQa) + +The Eclipse Advanced Scripting Environment ([EASE][1]) project is a new but powerful set of plugins that enables you to quickly hack your Eclipse IDE. + +Eclipse is a powerful framework that can be extended in many different ways by using its built-in plugin mechanism. However, writing and deploying a new plugin can be cumbersome if all you want is a bit of additional functionality. Now, using EASE, there's a better way to do that, without having to write a single line of Java code. EASE provides a way to easily automate workbench functionality using scripting languages such as Python or Javascript. + +In this article, based on my [talk][2] at EclipseCon North America this year, I'll cover the basics of how to set up your Eclipse environment with Python and EASE and look at a few ideas to supercharge your IDE with the power of Python. + +### Setup and run "Hello World" + +The examples in this article are based on the Java-implementation of Python, Jython. You can install EASE directly into your existing Eclipse IDE. In this example we use Eclipse [Mars][3] and install EASE itself, its modules and the Jython engine. + +From within the Eclipse Install Dialog (`Help>Install New Software`...), install EASE: [http://download.eclipse.org/ease/update/nightly][4] + +And, select the following components: + +- EASE Core feature + +- EASE core UI feature + +- EASE Python Developer Resources + +- EASE modules (Incubation) + +This will give you EASE and its modules. The main one we are interested in is the Resource module that gives you access to the Eclipse workspace, projects, and files API. + +![](https://opensource.com/sites/default/files/1_installease_nightly.png) + + +After those have been successfully installed, next install the EASE Jython engine: [https://dl.bintray.com/pontesegger/ease-jython/][5]. Once the plugins are installed, test EASE out. Create a new project and add in a new file called hello.py with this content: + +``` +print "hello world" +``` + +Select the file, right click, and select 'Run as -> EASE script'. You should see "Hello World" appear in the console. + +Now you can start writing Python scripts that can access the workspace and projects. This power can be used for all sorts of hacks, below are just a few ideas. + +### Improve your code quality + +Maintaining good code quality can be a tiresome job especially when dealing with a large codebase or when lots of developers are involved. Some of this pain can be made easier with a script, such as for batch formatting for a set of files, or even fixing certain files to [remove unix line endings][6] for easy comparison in source control like git. Another nice thing to do is use a script to generate Eclipse markers to highlight code that could do with improving. Here's an example script that you could use to add task markers for all "printStackTrace" methods it detects in Java files. See the source code: [markers.py][7] + +To run, copy the file to your workspace, then right click and select 'Run as -> EASE script'. + +``` +loadModule('/System/Resources') +``` + +from org.eclipse.core.resources import IMarker + +``` +for ifile in findFiles("*.java"): + file_name = str(ifile.getLocation()) + print "Processing " + file_name + with open(file_name) as f: + for line_no, line in enumerate(f, start=1): + if "printStackTrace" in line: + marker = ifile.createMarker(IMarker.TASK) + marker.setAttribute(IMarker.TRANSIENT, True) + marker.setAttribute(IMarker.LINE_NUMBER, line_no) + marker.setAttribute(IMarker.MESSAGE, "Fix in Sprint 2: " + line.strip()) + +``` + +If you have any java files with printStackTraces you will be able to see the newly created markers in the Tasks view and in the editor margin. + +![](https://opensource.com/sites/default/files/2_codequality.png) + +### Automate tedious tasks + +When you are working with several projects you may want to automate some tedious, repetitive tasks. Perhaps you need to add in a copyright header to the beginning of each source file, or update source files when adopting a new framework. For instance, when we first switched to using Tycho and Maven, we had to add a pom.xml to each project. This is easily done using a few lines of Python. Then when Tycho provided support for pom-less builds, we wanted to remove unnecessary pom files. Again, a few lines of Python script enabled this. As an example, here is a script which adds a README.md file to every open project in your workspace, noting if they are Java or Python projects. See the source code: [add_readme.py][8]. + +To run, copy the file to your workspace, then right click and select 'Run as -> EASE script'. + +loadModule('/System/Resources') + +``` +for iproject in getWorkspace().getProjects(): + if not iproject.isOpen(): + continue + + ifile = iproject.getFile("README.md") + + if not ifile.exists(): + contents = "# " + iproject.getName() + "\n\n" + if iproject.hasNature("org.eclipse.jdt.core.javanature"): + contents += "A Java Project\n" + elif iproject.hasNature("org.python.pydev.pythonNature"): + contents += "A Python Project\n" + writeFile(ifile, contents) +``` + +The result should be that every open project will have a README.md file, with Java and Python projects having an additional descriptive line. + +![](https://opensource.com/sites/default/files/3_tedioustask.png) + +### Prototype new features + +You can also use a Python script to hack a quick-fix for some much wanted functionality, or as a prototype to help demonstrate to your team or users how you envision a feature. For instance, one feature Eclipse IDE doesn't currently support is auto-save on the current file you are working on. Although this feature is in the works for future releases, you can have a quick and dirty version that autosaves every 30 seconds or when the editor is deactivated. Below is a snippet of the main method. See the full source: [autosave.py][9] + +``` +def save_dirty_editors(): + workbench = getService(org.eclipse.ui.IWorkbench) + for window in workbench.getWorkbenchWindows(): + for page in window.getPages(): + for editor_ref in page.getEditorReferences(): + part = editor_ref.getPart(False) + if part and part.isDirty(): + print "Auto-Saving", part.getTitle() + part.doSave(None) +``` + +Before running this script you will need to turn on the 'Allow Scripts to run code in UI thread' setting by checking the box under Window > Preferences > Scripting. Then you can add the file to your workspace, right click on it and select 'Run As>EASE Script'. A save message is printed out in the Console view every time an editor is saved. To turn off the autosave just stop the script by pressing the 'Terminate' red square button in the Console view. + +![](https://opensource.com/sites/default/files/4_prototype.png) + +### Quickly extend the user interface with custom buttons, menus, etc + +One of the best things about EASE is that it allows you to take your scripts and quickly hook them into UI elements of the IDE, for example, as a new button or new menu item. No need to write Java or have a new plugin, just add a couple of lines to your script header—it's that simple. + +Here's an example for a simplistic script that creates us three new projects. + +``` +# name : Create fruit projects +# toolbar : Project Explorer +# description : Create fruit projects + +loadModule("/System/Resources") + +for name in ["banana", "pineapple", "mango"]: + createProject(name) +``` + +The comment lines specify to EASE to add a button to the Project Explorer toolbar. Here's another script that adds a button to the same toolbar to delete those three projects. See the source files: [createProjects.py][10] and [deleteProjects.py][11] + +``` +# name :Delete fruit projects +# toolbar : Project Explorer +# description : Get rid of the fruit projects + +loadModule("/System/Resources") + +for name in ["banana", "pineapple", "mango"]: + project = getProject(name) + project.delete(0, None) +``` + +To get the buttons to appear, add the two script files to a new project—let's call it 'ScriptsProject'. Then go to Windows > Preference > Scripting > Script Locations. Click on the 'Add Workspace' button and select the ScriptsProject. This project now becomes a default location for locating script files. You should see the buttons show up in the Project Explorer without needing to restart your IDE. You should be able to quickly create and delete the projects using your newly added buttons. + +![](https://opensource.com/sites/default/files/5_buttons.png) + +### Integrate with third-party tools + +Every now and then you may need to use a tool outside the Eclipse ecosystem (sad but true, it has a lot but it does not do everything). For those occasions it might be quite handy to wrap calling that call to the tool in a script. Here's an example that allows you to integrate with explorer.exe, and add it to the content menu so you could instantly open a file browser using the current selection. See the source code: [explorer.py][12] + +``` +# name : Explore from here +# popup : enableFor(org.eclipse.core.resources.IResource) +# description : Start a file browser using current selection +loadModule("/System/Platform") +loadModule('/System/UI') + +selection = getSelection() +if isinstance(selection, org.eclipse.jface.viewers.IStructuredSelection): + selection = selection.getFirstElement() + +if not isinstance(selection, org.eclipse.core.resources.IResource): + selection = adapt(selection, org.eclipse.core.resources.IResource) + +if isinstance(selection, org.eclipse.core.resources.IFile): + selection = selection.getParent() + +if isinstance(selection, org.eclipse.core.resources.IContainer): + runProcess("explorer.exe", [selection.getLocation().toFile().toString()]) +``` + +To get the menu to appear, add the script to a new project—let's call it 'ScriptsProject'. Then go to Windows > Preference > Scripting > Script Locations. Click on the 'Add Workspace' button and select the ScriptsProject. You should see the new menu item show up in the context menu when you right-click on a file. Select this action to bring up a file browser. (Note this functionality already exists in Eclipse but this example is one you could adapt to other third-party tools). + +![](https://opensource.com/sites/default/files/6_explorer.png) + +The Eclipse Advanced Scripting Environment provides a great way to get more out of your Eclipse IDE by leveraging the power of Python. It is a project in its infancy so there is so much more to come. Learn more [about the project][13] and get involved by signing up for the [forum][14]. + +I'll be talking more about EASE at [Eclipsecon North America][15] 2016. My talk [Scripting Eclipse with Python][16] will go into how you can use not just Jython, but C-Python and how this functionality can be extended specifically for scientific use-cases. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/16/2/how-use-python-hack-your-ide + +作者:[Tracy Miranda][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/tracymiranda +[1]: https://eclipse.org/ease/ +[2]: https://www.eclipsecon.org/na2016/session/scripting-eclipse-python +[3]: https://www.eclipse.org/downloads/packages/eclipse-ide-eclipse-committers-451/mars1 +[4]: http://download.eclipse.org/ease/update/nightly +[5]: https://dl.bintray.com/pontesegger/ease-jython/ +[6]: http://code.activestate.com/recipes/66434-change-line-endings/ +[7]: https://gist.github.com/tracymiranda/6556482e278c9afc421d +[8]: https://gist.github.com/tracymiranda/f20f233b40f1f79b1df2 +[9]: https://gist.github.com/tracymiranda/e9588d0976c46a987463 +[10]: https://gist.github.com/tracymiranda/55995daaea9a4db584dc +[11]: https://gist.github.com/tracymiranda/baa218fc2c1a8e898194 +[12]: https://gist.github.com/tracymiranda/8aa3f0fc4bf44f4a5cd3 +[13]: https://eclipse.org/ease/ +[14]: https://dev.eclipse.org/mailman/listinfo/ease-dev +[15]: https://www.eclipsecon.org/na2016 +[16]: https://www.eclipsecon.org/na2016/session/scripting-eclipse-python From 6886aaf9320f1d315b9c773e1556665fcd8b3487 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 27 Feb 2016 19:49:12 +0800 Subject: [PATCH 0439/1469] =?UTF-8?q?=E6=A0=A1=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...om the command line on Debian or Ubuntu.md | 187 ++++++++++++------ 1 file changed, 130 insertions(+), 57 deletions(-) diff --git a/translated/tech/20160104 How to use KVM from the command line on Debian or Ubuntu.md b/translated/tech/20160104 How to use KVM from the command line on Debian or Ubuntu.md index 6f9f3690cb..aa157a4969 100644 --- a/translated/tech/20160104 How to use KVM from the command line on Debian or Ubuntu.md +++ b/translated/tech/20160104 How to use KVM from the command line on Debian or Ubuntu.md @@ -1,67 +1,90 @@ 怎样在ubuntu和debian中用命令行使用KVM ================================================================================ -有很多不同的方式去管理运行在KVM管理程序上的虚拟机。例如,virt-manager就是一个流行的基于图形用户界面的前端虚拟机管理工具。然而,如果你想要在没有图形窗口的服务器环境下使用KVM,那么基于图形用户界面的解决方案显然是行不通的。事实上,你可以纯粹的使用包装了kvm命令行脚本的命令行来管理KVM虚拟机。作为替代方案,你可以使用virsh这个容易使用的命令行用户接口来管理客户虚拟机。在virsh中,它通过和libvirtd服务通信来达到控制虚拟机的目的,而libvirtd可以控制几个不同的虚拟机管理器,包括KVM,Xen,QEMU,LXC和OpenVZ。 - 当你想要对虚拟机的前期准备和后期管理实现自动化操作时,像virsh这样的命令行管理工具是非常有用的。同样,virsh支持多个管理器的事实也意味着你可以通过相同的virsh接口去管理不同的虚拟机管理器。 - 在这篇文章中,我会示范**怎样在ubuntu和debian上通过使用virsh命令行去运行KVM**。 + +有很多不同的方式去管理运行在 KVM 管理程序上的虚拟机。例如,virt-manager 就是一个流行的基于图形界面的前端虚拟机管理工具。然而,如果你想要在没有图形窗口的服务器环境下使用 KVM ,那么基于图形界面的解决方案显然是行不通的。事实上,你可以纯粹的使用包装了 kvm 命令行脚本的命令行来管理 KVM 虚拟机。作为替代方案,你可以使用 virsh 这个容易使用的命令行程序来管理客户虚拟机。在 virsh 中,它通过和 libvirtd 服务通信来达到控制虚拟机的目的,而 libvirtd 可以控制多个不同的虚拟机管理器,包括 KVM,Xen,QEMU,LXC 和 OpenVZ。 + +当你想要对虚拟机的前期准备和后期管理实现自动化操作时,像 virsh 这样的命令行管理工具是非常有用的。同样,virsh 支持多个管理器也就意味着你可以通过相同的 virsh 接口去管理不同的虚拟机管理器。 + +在这篇文章中,我会示范**怎样在ubuntu和debian上通过使用virsh命令行去运行KVM**。 ### 第一步:确认你的硬件平台支持虚拟化 ### -作为第一步,首先要确认你的主机CPU配备了硬件虚拟化拓展(e.g.,Intel VT或者AMD-V),这是KVM对硬件的要求。下面的命令可以检查硬件是否支持虚拟化。 +第一步,首先要确认你的 CPU 支持硬件虚拟化扩展(e.g.,Intel VT 或者 AMD-V),这是 KVM 对硬件的要求。下面的命令可以检查硬件是否支持虚拟化。 +``` $ egrep '(vmx|svm)' --color /proc/cpuinfo +``` ![](https://c2.staticflickr.com/2/1505/24050288606_758a44c4c6_c.jpg) - 如果在输出中不包含vmx或者svm标识,那么就意味着你的主机cpu不支持硬件虚拟化。因此你不能在你的机器上使用KVM。确认了主机cpu存在vmx或者svm之后,接下来开始安装KVM。 -对于KVM来说,它不要求运行在拥有64位内核系统的主机上,但是通常我们会推荐在64位系统的主机上面运行KVM。 +如果在输出中不包含 vmx 或者 svm 标识,那么就意味着你的 cpu 不支持硬件虚拟化。因此你不能在你的机器上使用 KVM 。确认了 cpu 支持 vmx 或者 svm 之后,接下来开始安装 KVM。 + +对于 KVM 来说,它不要求运行在拥有 64 位内核系统的主机上,但是通常我们会推荐在 64 位系统的主机上面运行 KVM。 ### 第二步:安装KVM ### -使用apt-get安装KVM和相关的用户空间工具。 +使用 `apt-ge` 安装 KVM 和相关的用户空间工具。 +``` $ sudo apt-get install qemu-kvm libvirt-bin +``` -安装期间,libvirtd组(在debian上是libvirtd-qemu组)将会被创建,并且你的用户id将会被自动添加到该组中。这样做的目的是让你可以以一个普通用户而不是root用户的身份去管理虚拟机。你可以使用id命令来确认这一点,下面将会告诉你怎么去显示你的组id: +安装期间,libvirtd 用户组(在 debian 上是 libvirtd-qemu 用户组)将会被创建,并且你的用户 id 将会被自动添加到该组中。这样做的目的是让你可以以一个普通用户而不是 root 用户的身份去管理虚拟机。你可以使用 `id` 命令来确认这一点,下面将会告诉你怎么去显示你的组 id: +``` $ id +``` ![](https://c2.staticflickr.com/6/5597/15432586092_64dfb867d3_c.jpg) -如果因为某些原因,libvirt(在debian中是libvirt-qemu)没有在你的组id中被找到,你也可以手动将你自己添加到对应的组中,如下所示: -在ubuntu上: +如果因为某些原因,libvirt(在 debian 中是 libvirt-qemu)没有在你的组 id 中被找到,你也可以手动将你自己添加到对应的组中,如下所示: +在 ubuntu 上: + +``` $ sudo adduser [youruserID] libvirtd +``` -在debian上: +在 debian 上: +``` $ sudo adduser [youruserID] libvirt-qemu +``` -按照如下形式重修载入更新后的组成员关系。如果要求输入密码,那么输入你的登陆密码即可。 +按照如下命令重新载入更新后的组成员关系。如果要求输入密码,那么输入你的登陆密码即可。 +``` $ exec su -l $USER +``` -这时,你应该可以以普通用户的身份去执行virsh了。做一个如下所示的测试,这个命令将会以列表的形式列出可用的虚拟机(当前的列表是空的)。如果你没有遇到权限问题,那意味着迄今为止一切都是正常的。 +这时,你应该可以以普通用户的身份去执行 virsh 了。做一个如下所示的测试,这个命令将会以列表的形式列出可用的虚拟机(当前的列表是空的)。如果你没有遇到权限问题,那意味着到目前为止一切都是正常的。 $ virsh list ---------- Id Name State - ---------------------------------------------------- +---------------------------------------------------- ### 第三步:配置桥接网络 ### -为了使KVM虚拟机能够访问外部网络,一种方法是通过在KVM宿主机上创建Linux桥来实现。创建之后的桥能够将虚拟机的虚拟网卡和宿主机的物理网卡连接起来,因此,虚拟机能够发送和接受由物理网卡发送过来的流量数据包。这种方式叫做网桥连接。 -下面将告诉你如何创建并且配置网桥,我们称它为br0. +为了使 KVM 虚拟机能够访问外部网络,一种方法是通过在 KVM 宿主机上创建 Linux 桥来实现。创建之后的桥能够将虚拟机的虚拟网卡和宿主机的物理网卡连接起来,因此,虚拟机能够发送和接收由物理网卡传输的数据包。这种方式叫做网络桥接。 + +下面将告诉你如何创建并且配置网桥,我们创建一个网桥称它为 br0. + 首先,安装一个必需的包,然后用命令行创建一个网桥。 +``` $ sudo apt-get install bridge-utils $ sudo brctl addbr br0 +``` -下一步就是配置已经创建好的网桥,即修改位于/etc/network/interfaces的配置文件。我们需要将该桥接网卡设置成开机启动。为了修改该配置文件,你需要关闭你的操作系统上的网络管理器(如果你在使用它的话)。跟随[操作指南][1]的说明去关闭网络管理器。 - 关闭网络管理器之后,接下来就是通过修改配置文件来配置网桥了。 +下一步就是配置已经创建好的网桥,即修改位于 `/etc/network/interfaces` 的配置文件。我们需要将该桥接网卡设置成开机启动。为了修改该配置文件,你需要关闭你的操作系统上的网络管理器(如果你在使用它的话)。跟随[操作指南][1]的说明去关闭网络管理器。 +关闭网络管理器之后,接下来就是通过修改配置文件来配置网桥了。 + +``` #auto eth0 #iface eth0 inet dhcp @@ -71,23 +94,28 @@ bridge_stp off bridge_fd 0 bridge_maxwait 0 +``` +在上面的配置中,我假设 eth0 是主要网卡,它也是连接到外网的网卡,同样,我假设 eth0 将会通过 DHCP 协议自动获取 ip 地址。注意,之前在 `/etc/network/interfaces` 中还没有对 eth0 进行任何配置。桥接网卡 br0 引用了 eth0 的配置,而 eth0 也会受到 br0 的制约。 -在上面的配置中,我假设eth0是主要网卡,它也是连接到外网的网卡,同样,我假设eth0将会通过DHCP得到它的ip地址。注意,之前在/etc/network/interfaces中还没有对eth0进行任何配置。桥接网卡br0引用了eth0的配置,而eth0也会受到br0的制约。 -重启网络服务,并确认网桥已经被成功的配置好。如果成功的话,br0的ip地址将会是eth0的被自动分配的ip地址,而且eth0不会被分配任何ip地址。 +重启网络服务,并确认网桥已经被成功的配置好。如果成功的话,br0 的 ip 地址将会是 eth0 自动分配的 ip 地址,而且 eth0 不会被分配任何 ip 地址。 +``` $ sudo /etc/init.d/networking restart $ ifconfig +``` -如果因为某些原因,eth0仍然保留了之前分配给了br0的ip地址,那么你可能必须明确的删除eth0的ip地址。 +如果因为某些原因,eth0 仍然保留了之前分配给了 br0 的 ip 地址,那么你可能必须手动删除 eth0 的 ip 地址。 ![](https://c2.staticflickr.com/2/1698/23780708850_66cd7ba6ea_c.jpg) -###第四步:用命令行创建一个虚拟机 ### +### 第四步:用命令行创建一个虚拟机 ### -对于虚拟机来说,它的配置信息被存储在它对应的xml文件中。因此,创建一个虚拟机的第一步就是准备一个与主机名对应的xml文件。 -下面是一个示例xml文件,你可以根据需要手动修改它。 - +对于虚拟机来说,它的配置信息被存储在它对应的xml文件中。因此,创建一个虚拟机的第一步就是准备一个与虚拟机对应的 xml 文件。 + +下面是一个示例 xml 文件,你可以根据需要手动修改它。 + +``` alice f5b8c05b-9c7a-3211-49b9-2bd635f7e2aa @@ -134,55 +162,69 @@ +``` 上面的主机xml配置文件定义了如下的虚拟机内容。 -- 1GB内存,一个虚拟cpu和一个硬件驱动。 -- Disk image:/home/dev/images/alice.img。 -- Boot from CD-ROM(/home/dev/iso/CentOS-6.5-x86_64-minomal.iso)。 -- Networking:一个桥接到br0的虚拟网卡。 -- 通过VNC远程访问。 -中的UUID字符串可以随机生成。为了得到一个随机的uuid字符串,你可能需要使用uuid命令行工具。 +- 1GB内存,一个虚拟cpu和一个硬件驱动 +- Disk image:`/home/dev/images/alice.img` + +- Boot from CD-ROM(`/home/dev/iso/CentOS-6.5-x86_64-minomal.iso`) + +- Networking:一个桥接到 br0 的虚拟网卡 + +- 通过 VNC 远程访问 + +`` 中的 UUID 字符串可以随机生成。为了得到一个随机的 uuid 字符串,你可能需要使用 uuid 命令行工具。 + +``` $ sudo apt-get install uuid $ uuid +``` 生成一个主机xml配置文件的方式就是通过一个已经存在的虚拟机来导出它的xml配置文件。如下所示。 +``` $ virsh dumpxml alice > bob.xml +``` ![](https://c2.staticflickr.com/6/5808/23968234602_25e8019ec8_c.jpg) -###第五步:使用命令行启动虚拟机### +### 第五步:使用命令行启动虚拟机 ### -在启动虚拟机之前,我们需要创建它的初始磁盘镜像。为此,你需要使用qemu-img命令来生成一个你已经安装的qemu-kvm镜像。下面的命令将会创建10GB大小的空磁盘,并且它是qcow2格式的。 +在启动虚拟机之前,我们需要创建它的初始磁盘镜像。为此,你需要使用 qemu-img 命令来生成一个 qemu-kvm 镜像。下面的命令将会创建 10 GB 大小的空磁盘,并且它是 qcow2 格式的。 +``` $ qemu-img create -f qcow2 /home/dev/images/alice.img 10G +``` -使用qcow2格式的磁盘镜像的好处就是它在创建之初并不会给它分配全部大小磁盘容量(这里是10GB),而是随着虚拟机中文件的增加而逐渐增大。因此,它对空间的使用更加有效。 -现在,你可以准备通过使用之前创建的xml配置文件启动你的虚拟机了。下面的命令将会创建一个虚拟机,然后自动启动它。 +使用 qcow2 格式的磁盘镜像的好处就是它在创建之初并不会给它分配全部大小磁盘容量(这里是 10 GB),而是随着虚拟机中文件的增加而逐渐增大。因此,它对空间的使用更加有效。 +现在,你可以通过使用之前创建的 xml 配置文件启动你的虚拟机了。下面的命令将会创建一个虚拟机,然后自动启动它。 + +``` $ virsh create alice.xml - ----------- - Domain alice created from alice.xml +``` -**注意**:如果你对一个已经存在的虚拟机运行了上面的命令,那么这个操作将会在没有警告信息的情况下抹去那个已经存在的虚拟机的全部信息。如果你已经创建了一个虚拟机,你可能会使用下面的命令来启动虚拟机。 +**注意**: 如果你对一个已经存在的虚拟机执行了了上面的命令,那么这个操作将会在没有任何警告的情况下抹去那个已经存在的虚拟机的全部信息。如果你已经创建了一个虚拟机,你可能会使用下面的命令来启动虚拟机。 +``` $ virsh start alice.xml +``` 使用如下命令确认一个新的虚拟机已经被创建并成功的被启动。 +``` $ virsh list - ----------- +``` Id Name State ---------------------------------------------------- 3 alice running -同样,使用如下命令确认你的虚拟机的虚拟网卡已经被成功的添加到了你先前创建的br0网桥中。 +同样,使用如下命令确认你的虚拟机的虚拟网卡已经被成功的添加到了你先前创建的 br0 网桥中。 $ sudo brctl show @@ -193,59 +235,82 @@ 为了远程访问一个正在运行的虚拟机的控制台,你可以使用VNC客户端。 首先,你需要使用如下命令找出用于虚拟机的VNC端口号。 +``` $ sudo netstat -nap | egrep '(kvm|qemu)' +``` ![](https://c2.staticflickr.com/6/5633/23448144274_49045bc868_c.jpg) -在这个例子中,用于alice虚拟机的VNC端口号是5900 -然后启动一个VNC客户端,连接到一个端口号为5900的VNC服务器。在我们的例子中,虚拟机支持由CentOS光盘文件启动。 +在这个例子中,用于 alice 虚拟机的 VNC 端口号是 5900 + 然后启动一个VNC客户端,连接到一个端口号为5900的VNC服务器。在我们的例子中,虚拟机支持由CentOS光盘文件启动。 ![](https://c2.staticflickr.com/2/1533/24076369675_99408972a4_c.jpg) -### 使用virsh管理虚拟机 ### +### 使用 virsh 管理虚拟机 ### -下面列出了virsh命令的常规用法 +下面列出了 virsh 命令的常规用法 创建客户机并且启动虚拟机: +``` $ virsh create alice.xml +``` 停止虚拟机并且删除客户机 +``` $ virsh destroy alice +``` 关闭虚拟机(不用删除它) +``` $ virsh shutdown alice +``` 暂停虚拟机 +``` $ virsh suspend alice +``` 恢复虚拟机 +``` $ virsh resume alice +``` -访问正在运行的虚拟机的登陆控制台 +访问正在运行的虚拟机的控制台 +``` $ virsh console alice +``` 设置虚拟机开机启动: +``` $ virsh autostart alice +``` 查看虚拟机的详细信息 +``` $ virsh dominfo alice +``` 编辑虚拟机的配置文件: +``` $ virsh edit alice +``` 上面的这个命令将会使用一个默认的编辑器来调用主机配置文件。该配置文件中的任何改变都将自动被libvirt验证其正确性。 你也可以在一个virsh会话中管理虚拟机。下面的命令会创建并进入到一个virsh会话中: +``` $ virsh -在virsh提示中,你可以使用任何virsh命令。 +``` + +在 virsh 提示中,你可以使用任何 virsh 命令。 ![](https://c2.staticflickr.com/6/5645/23708565129_b1ef968b30_c.jpg) @@ -255,33 +320,41 @@ error: internal error: no supported architecture for os type 'hvm' - 如果你的硬件不支持虚拟化的话你可能就会遇到这个错误。(例如,Intel VT或者AMD-V),这是运行KVM所必需的。如果你遇到了这个错误,而你的cpu支持虚拟化,那么这里可以给你一些可用的解决方案: + 如果你的硬件不支持虚拟化的话你可能就会遇到这个错误。(例如,Intel VT或者AMD-V),这是运行KVM所必需的。如果你遇到了这个错误,而你的cpu支持虚拟化,那么这里可以给你一些可用的解决方案: -首先,检查你的内核模块是否丢失。 + 首先,检查你的内核模块是否丢失。 + ``` $ lsmod | grep kvm + ``` -如果内核模块没有加载,你必须按照如下方式加载它。 + 如果内核模块没有加载,你必须按照如下方式加载它。 + ``` $ sudo modprobe kvm_intel (for Intel processor) $ sudo modprobe kvm_amd (for AMD processor) + ``` -第二个解决方案就是添加“--connect qemu:///system”参数到virsh命令中,如下所示。当你正在你的硬件平台上使用超过一个虚拟机管理器的时候就需要添加这个参数(例如,VirtualBox,VMware)。 + 第二个解决方案就是添加 `--connect qemu:///system` 参数到 `virsh` 命令中,如下所示。当你正在你的硬件平台上使用超过一个虚拟机管理器的时候就需要添加这个参数(例如,VirtualBox,VMware)。 + + ``` $ virsh --connect qemu:///system create alice.xml + ``` 2. 当我试着访问我的虚拟机的登陆控制台的时候遇到了错误: +``` $ virsh console alice + error: internal error: cannot find character device +``` ----------- + 这个错误发生的原因是你没有在你的虚拟机配置文件中定义控制台设备。在 xml 文件中加上下面的内部设备部分即可。 - error: internal error: cannot find character device - -这个错误发生的原因是你没有在你的虚拟机配置文件中定义控制台设备。在xml文件中加上下面的内部设备部分即可。 - +``` +``` -------------------------------------------------------------------------------- From ee145429e26dbea845c3a577d702fa19d0486ad7 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 27 Feb 2016 19:51:51 +0800 Subject: [PATCH 0440/1469] =?UTF-8?q?=E5=B7=B2=E6=A0=A1=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... KVM from the command line on Debian or Ubuntu.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/translated/tech/20160104 How to use KVM from the command line on Debian or Ubuntu.md b/translated/tech/20160104 How to use KVM from the command line on Debian or Ubuntu.md index aa157a4969..6063bb7810 100644 --- a/translated/tech/20160104 How to use KVM from the command line on Debian or Ubuntu.md +++ b/translated/tech/20160104 How to use KVM from the command line on Debian or Ubuntu.md @@ -343,26 +343,26 @@ 2. 当我试着访问我的虚拟机的登陆控制台的时候遇到了错误: -``` + ``` $ virsh console alice error: internal error: cannot find character device -``` + ``` 这个错误发生的原因是你没有在你的虚拟机配置文件中定义控制台设备。在 xml 文件中加上下面的内部设备部分即可。 -``` + ``` -``` + ``` -------------------------------------------------------------------------------- via: http://xmodulo.com/use-kvm-command-line-debian-ubuntu.html 作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[kylepeng93 ](https://github.com/kylepeng93 ) +校对:[Ezio](https://github.com/oska874) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c6de07aab673c036d1b18bc9da638596038f2049 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 27 Feb 2016 19:53:19 +0800 Subject: [PATCH 0441/1469] =?UTF-8?q?=E5=B7=B2=E6=A0=A1=E5=AF=B9=EF=BC=8C?= =?UTF-8?q?=E5=87=86=E5=A4=87=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...04 How to use KVM from the command line on Debian or Ubuntu.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20160104 How to use KVM from the command line on Debian or Ubuntu.md (100%) diff --git a/translated/tech/20160104 How to use KVM from the command line on Debian or Ubuntu.md b/published/20160104 How to use KVM from the command line on Debian or Ubuntu.md similarity index 100% rename from translated/tech/20160104 How to use KVM from the command line on Debian or Ubuntu.md rename to published/20160104 How to use KVM from the command line on Debian or Ubuntu.md From be2ed7eb8b54ea88849f7b4f56596980e545cb3c Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 27 Feb 2016 19:54:27 +0800 Subject: [PATCH 0442/1469] =?UTF-8?q?=E5=B7=B2=E6=A0=A1=E5=AF=B9=EF=BC=8C?= =?UTF-8?q?=E5=87=86=E5=A4=87=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... How to use KVM from the command line on Debian or Ubuntu.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20160104 How to use KVM from the command line on Debian or Ubuntu.md b/published/20160104 How to use KVM from the command line on Debian or Ubuntu.md index 6063bb7810..1f7a121b3a 100644 --- a/published/20160104 How to use KVM from the command line on Debian or Ubuntu.md +++ b/published/20160104 How to use KVM from the command line on Debian or Ubuntu.md @@ -1,5 +1,5 @@ -怎样在ubuntu和debian中用命令行使用KVM +怎样在 ubuntu 和 debian 中用命令行使用 KVM ================================================================================ 有很多不同的方式去管理运行在 KVM 管理程序上的虚拟机。例如,virt-manager 就是一个流行的基于图形界面的前端虚拟机管理工具。然而,如果你想要在没有图形窗口的服务器环境下使用 KVM ,那么基于图形界面的解决方案显然是行不通的。事实上,你可以纯粹的使用包装了 kvm 命令行脚本的命令行来管理 KVM 虚拟机。作为替代方案,你可以使用 virsh 这个容易使用的命令行程序来管理客户虚拟机。在 virsh 中,它通过和 libvirtd 服务通信来达到控制虚拟机的目的,而 libvirtd 可以控制多个不同的虚拟机管理器,包括 KVM,Xen,QEMU,LXC 和 OpenVZ。 From e6bcad3740501e940e567416602e8d678106b718 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Sat, 27 Feb 2016 21:51:18 +0800 Subject: [PATCH 0443/1469] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=8E=9F=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20151204 Review EXT4 vs. Btrfs vs. XFS.md | 66 ------------------- 1 file changed, 66 deletions(-) delete mode 100644 sources/share/20151204 Review EXT4 vs. Btrfs vs. XFS.md diff --git a/sources/share/20151204 Review EXT4 vs. Btrfs vs. XFS.md b/sources/share/20151204 Review EXT4 vs. Btrfs vs. XFS.md deleted file mode 100644 index f6a568a55f..0000000000 --- a/sources/share/20151204 Review EXT4 vs. Btrfs vs. XFS.md +++ /dev/null @@ -1,66 +0,0 @@ -ictlyh Translating -Review EXT4 vs. Btrfs vs. XFS -================================================================================ -![](http://1426826955.rsc.cdn77.org/wp-content/uploads/2015/09/1385698302_funny_linux_wallpapers-593x445.jpg) - -To be honest, one of the things that comes last in people’s thinking is to look at which file system on their PC is being used. Windows users as well as Mac OS X users even have less reason for looking as they have really only 1 choice for their operating system which are NTFS and HFS+. Linux operating system, on the other side, has plenty of various file system options, with the current default is being widely used ext4. However, there is another push for changing the file system to something other which is called btrfs. But what makes btrfs better, what are other file systems, and when can we see the distributions making the change? - -Let’s first have a general look at file systems and what they really do, then we will make a small comparison between famous file systems. - -### So, What Do File Systems Do? ### - -Just in case if you are unfamiliar about what file systems really do, it is actually simple when it is summarized. The file systems are mainly used in order for controlling how the data is stored after any program is no longer using it, how access to the data is controlled, what other information (metadata) is attached to the data itself, etc. I know that it does not sound like an easy thing to be programmed, and it is definitely not. The file systems are continually still being revised for including more functionality while becoming more efficient in what it simply needs to do. Therefore, however, it is a basic need for all computers, it is not quite as basic as it sounds like. - -### Why Partitioning? ### - -Many people have a vague knowledge of what the partitions are since each operating system has an ability for creating or removing them. It can seem strange that Linux operating system uses more than 1 partition on the same disk, even while using the standard installation procedure, so few explanations are called for them. One of the main goals of having different partitions is achieving higher data security in the disaster case. - -By dividing your hard disk into partitions, the data may be grouped and also separated. When the accidents occur, only the data stored in the partition which got the hit will only be damaged, while data on the other partitions will survive most likely. These principles date from the days when the Linux operating system didn’t have a journaled file system and any power failure might have led to a disaster. - -The using of partitions will remain for security and the robustness reasons, then the breach on 1 part of the operating system does not automatically mean that whole computer is under risk or danger. This is currently most important factor for the partitioning process. For example, the users create scripts, the programs or web applications which start filling up the disk. If that disk contains only 1 big partition, then entire system may stop functioning if that disk is full. If the users store data on separate partitions, then only that data partition can be affected, while system partitions and the possible other data partitions will keep functioning. - -Mind that to have a journaled file system will only provide data security in case if there is a power failure as well as sudden disconnection of the storage devices. Such will not protect the data against the bad blocks and the logical errors in the file system. In such cases, the user should use a Redundant Array of Inexpensive Disks (RAID) solution. - -### Why Switch File Systems? ### - -The ext4 file system has been an improvement for the ext3 file system that was also an improvement over the ext2 file system. While the ext4 is a very solid file system which has been the default choice for almost all distributions for the past few years, it is made from an aging code base. Additionally, Linux operating system users are seeking many new different features in file systems which ext4 does not handle on its own. There is software which takes care of some of such needs, but in the performance aspect, being able to do such things on the file system level could be faster. - -### Ext4 File System ### - -The ext4 has some limits which are still a bit impressive. The maximum file size is 16 tebibytes (which is roughly 17.6 terabytes) and is much bigger than any hard drive a regular consumer can currently buy. While, the largest volume/partition you can make with ext4 is 1 exbibyte (which is roughly 1,152,921.5 terabytes). The ext4 is known to bring the speed improvements over ext3 by using multiple various techniques. Like in the most modern file systems, it is a journaling file system that means that it will keep a journal of where the files are mainly located on the disk and of any other changes that happen to the disk. Regardless all of its features, it doesn’t support the transparent compression, the data deduplication, or the transparent encryption. The snapshots are supported technically, but such feature is experimental at best. - -### Btrfs File System ### - -The btrfs, many of us pronounce it different ways, as an example, Better FS, Butter FS, or B-Tree FS. It is a file system which is completely made from scratch. The btrfs exists because its developers firstly wanted to expand the file system functionality in order to include snapshots, pooling, as well as checksums among the other things. While it is independent from the ext4, it also wants to build off the ideas present in the ext4 that are great for the consumers and the businesses alike as well as incorporate those additional features that will benefit everybody, but specifically the enterprises. For the enterprises who are using very large programs with very large databases, they are having a seemingly continuous file system across the multiple hard drives could be very beneficial as it will make a consolidation of the data much easier. The data deduplication could reduce the amount of the actual space data could occupy, and the data mirroring could become easier with the btrfs as well when there is a single and broad file system which needs to be mirrored. - -The user certainly can still choose to create multiple partitions so that he does not need to mirror everything. Considering that the btrfs will be able for spanning over the multiple hard drives, it is a very good thing that it can support 16 times more drive space than the ext4. A maximum partition size of the btrfs file system is 16 exbibytes, as well as maximum file size is 16 exbibytes too. - -### XFS File System ### - -The XFS file system is an extension of the extent file system. The XFS is a high-performance 64-bit journaling file system. The support of the XFS was merged into Linux kernel in around 2002 and In 2009 Red Hat Enterprise Linux version 5.4 usage of the XFS file system. XFS supports maximum file system size of 8 exbibytes for the 64-bit file system. There is some comparison of XFS file system is XFS file system can’t be shrunk and poor performance with deletions of the large numbers of files. Now, the RHEL 7.0 uses XFS as the default filesystem. - -### Final Thoughts ### - -Unfortunately, the arrival date for the btrfs is not quite known. But officially, the next-generation file system is still classified as “unstable”, but if the user downloads the latest version of Ubuntu, he will be able to choose to install on a btrfs partition. When the btrfs will be classified actually as “stable” is still a mystery, but users shouldn’t expect the Ubuntu to use the btrfs by default until it’s indeed considered “stable”. It has been reported that Fedora 18 will use the btrfs as its default file system as by the time of its release a file system checker for the btrfs should exist. There is a good amount of work still left for the btrfs, as not all the features are yet implemented and the performance is a little sluggish if we compare it to the ext4. - -So, which is better to use? Till now, the ext4 will be the winner despite the identical performance. But why? The answer will be the convenience as well as the ubiquity. The ext4 is still excellent file system for the desktop or workstation use. It is provided by default, so the user can install the operating system on it. Also, the ext4 supports volumes up to 1 Exabyte and files up to 16 Terabyte in size, so there’s still a plenty of room for the growth where space is concerned. - -The btrfs might offer greater volumes up to 16 Exabyte and improved fault tolerance, but, till now, it feels more as an add-on file system rather than one integrated into the Linux operating system. For example, the btrfs-tools have to be present before a drive will be formatted with the btrfs, which means that the btrfs is not an option during the Linux operating system installation though that could vary with the distribution. - -Even though the transfer rates are so important, there’s more to a just file system than speed of the file transfers. The btrfs has many useful features such as Copy-on-Write (CoW), extensive checksums, snapshots, scrubbing, self-healing data, deduplication, as well as many more good improvements that ensure the data integrity. The btrfs lacks the RAID-Z features of ZFS, so the RAID is still in an experimental state with the btrfs. For pure data storage, however, the btrfs is the winner over the ext4, but time still will tell. - -Till the moment, the ext4 seems to be a better choice on the desktop system since it is presented as a default file system, as well as it is faster than the btrfs when transferring files. The btrfs is definitely worth to look into, but to completely switch to replace the ext4 on desktop Linux might be few years later. The data farms and the large storage pools could reveal different stories and show the right differences between ext4, XCF, and btrfs. - -If you have a different or additional opinion, kindly let us know by commenting on this article. - --------------------------------------------------------------------------------- - -via: http://www.unixmen.com/review-ext4-vs-btrfs-vs-xfs/ - -作者:[M.el Khamlichi][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.unixmen.com/author/pirat9/ From efb620868dd4ed32461fe143f3ddc2cb87e442ef Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 27 Feb 2016 21:52:17 +0800 Subject: [PATCH 0444/1469] PUB:20160224 Can we tackle the Zika virus with rapid, open research @name1e5s --- ...tackle the Zika virus with rapid, open research.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) rename {translated/tech => published}/20160224 Can we tackle the Zika virus with rapid, open research.md (52%) diff --git a/translated/tech/20160224 Can we tackle the Zika virus with rapid, open research.md b/published/20160224 Can we tackle the Zika virus with rapid, open research.md similarity index 52% rename from translated/tech/20160224 Can we tackle the Zika virus with rapid, open research.md rename to published/20160224 Can we tackle the Zika virus with rapid, open research.md index 8ed74fc15f..54cd0fe697 100644 --- a/translated/tech/20160224 Can we tackle the Zika virus with rapid, open research.md +++ b/published/20160224 Can we tackle the Zika virus with rapid, open research.md @@ -1,15 +1,15 @@ -我们能通过快速的,开放的研究战胜寨卡病毒吗? +我们能通过快速、开放的研究来战胜寨卡病毒吗? ============================================================ ![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/OSDC_LifeScience_OpenScience_520x292_12268077_0614MM.png?itok=3ZD2Mce9) 关于寨卡病毒,最主要的问题就是我们对于它了解的太少了。这意味着我们需要尽快对它作出很多研究。 -寨卡病毒现已严重威胁到世界人民的健康。在 2015 年爆发之后,它就成为了全球卫生的紧急状况,并且这个病毒也可能与儿童的出生缺陷有关。根据维基百科,在这个病毒在 40 年代末期被发现以后,它对于人类的影响早在 1952 年就被观测到了。 +寨卡病毒现已严重威胁到世界人民的健康。在 2015 年爆发之后,它就成为了全球性的突发公共卫生事件,并且这个病毒也可能与儿童的出生缺陷有关。根据[维基百科][4],在这个病毒在 40 年代末期被发现以后,早在 1952 年就被观测到了对于人类的影响。 -在 2 月 10 日,开放杂志 PLoS [发布了一个声明][1],这个是声明是关于有关公共公众紧急状况的信息的共享。在此之后,刊登在开放期刊 F1000 的一篇文章 [开始了对于能治疗寨卡病毒的药物的研究][2],它开放的讨论寨卡病毒的状况以及对它进行研究的需要。那个来自 PLoS 的声明列出了超过 30 个开放了对于寨卡病毒的研究进度的数据的重要组织。并且世界卫生组织实施了对于提交到他们那里的资料的特别规定使得在一个[创作共用许可证下][3]公布。 +在 2 月 10 日,开放杂志 PLoS [发布了一个声明][1],这个是声明是关于有关公众紧急状况的信息共享。在此之后,刊登在研究期刊 F1000 的一篇文章 [对于能治疗寨卡病毒的开源药物(Open drug)的研究][2],它讨论了寨卡病毒及其开放研究的状况。那篇来自 PLoS 的声明列出了超过 30 个开放了对于寨卡病毒的研究进度的数据的重要组织。并且世界卫生组织实施了一个特别规定,以[创作共用许可证][3]公布提交到他们那里的资料。 -快速公布,无限制的重复利用,以及强调研究结果的传播是开放科研组织把他们的研究推出的战略性一步。看到一个需要我们给予关注的紧急状况的研究的开端是很令人受鼓舞的。 +快速公布,无限制的重复利用,以及强调研究结果的传播是推动开放科研社区的战略性一步。看到我们所关注的突发公共卫生事件能够以这样的方式开始是很令人受鼓舞的。 -------------------------------------------------------------------------------- @@ -17,7 +17,7 @@ via: https://opensource.com/life/16/2/how-rapid-open-science-could-change-game-z 作者:[Marcus D. Hanwell][a] 译者:[name1e5s](https://github.com/name1e5s) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -25,3 +25,4 @@ via: https://opensource.com/life/16/2/how-rapid-open-science-could-change-game-z [1]: http://blogs.plos.org/plos/2016/02/statement-on-data-sharing-in-public-health-emergencies/ [2]: http://f1000research.com/articles/5-150/v1 [3]: https://creativecommons.org/licenses/by/3.0/igo/ +[4]: https://en.wikipedia.org/wiki/Zika_virus \ No newline at end of file From 1cb307ea85c53b1329c3d43edc375c4a08a437f7 Mon Sep 17 00:00:00 2001 From: cposture Date: Sun, 28 Feb 2016 11:30:55 +0800 Subject: [PATCH 0445/1469] Translated Data Structures in the Linux Kernel --- ...123 Data Structures in the Linux Kernel.md | 202 ------------------ 1 file changed, 202 deletions(-) delete mode 100644 sources/tech/20151123 Data Structures in the Linux Kernel.md diff --git a/sources/tech/20151123 Data Structures in the Linux Kernel.md b/sources/tech/20151123 Data Structures in the Linux Kernel.md deleted file mode 100644 index edc4c1a5a7..0000000000 --- a/sources/tech/20151123 Data Structures in the Linux Kernel.md +++ /dev/null @@ -1,202 +0,0 @@ -【Translating By cposture 2016-02-26】 -Data Structures in the Linux Kernel -================================================================================ - -Radix tree --------------------------------------------------------------------------------- - -As you already know linux kernel provides many different libraries and functions which implement different data structures and algorithms. In this part we will consider one of these data structures - [Radix tree](http://en.wikipedia.org/wiki/Radix_tree). There are two files which are related to `radix tree` implementation and API in the linux kernel: - -* [include/linux/radix-tree.h](https://github.com/torvalds/linux/blob/master/include/linux/radix-tree.h) -* [lib/radix-tree.c](https://github.com/torvalds/linux/blob/master/lib/radix-tree.c) - -Lets talk about what a `radix tree` is. Radix tree is a `compressed trie` where a [trie](http://en.wikipedia.org/wiki/Trie) is a data structure which implements an interface of an associative array and allows to store values as `key-value`. The keys are usually strings, but any data type can be used. A trie is different from an `n-tree` because of its nodes. Nodes of a trie do not store keys; instead, a node of a trie stores single character labels. The key which is related to a given node is derived by traversing from the root of the tree to this node. For example: - - -``` -               +-----------+ -               |           | -               |    " "    | - | | -        +------+-----------+------+ -        |                         | -        |                         | -   +----v------+            +-----v-----+ -   |           |            |           | -   |    g      |            |     c     | - | | | | -   +-----------+            +-----------+ -        |                         | -        |                         | -   +----v------+            +-----v-----+ -   |           |            |           | -   |    o      |            |     a     | - | | | | -   +-----------+            +-----------+ -                                  | -                                  | -                            +-----v-----+ -                            |           | -                            |     t     | - | | -                            +-----------+ -``` - -So in this example, we can see the `trie` with keys, `go` and `cat`. The compressed trie or `radix tree` differs from `trie` in that all intermediates nodes which have only one child are removed. - -Radix tree in linux kernel is the datastructure which maps values to integer keys. It is represented by the following structures from the file [include/linux/radix-tree.h](https://github.com/torvalds/linux/blob/master/include/linux/radix-tree.h): - -```C -struct radix_tree_root { - unsigned int height; - gfp_t gfp_mask; - struct radix_tree_node __rcu *rnode; -}; -``` - -This structure presents the root of a radix tree and contains three fields: - -* `height` - height of the tree; -* `gfp_mask` - tells how memory allocations will be performed; -* `rnode` - pointer to the child node. - -The first field we will discuss is `gfp_mask`: - -Low-level kernel memory allocation functions take a set of flags as - `gfp_mask`, which describes how that allocation is to be performed. These `GFP_` flags which control the allocation process can have following values: (`GF_NOIO` flag) means sleep and wait for memory, (`__GFP_HIGHMEM` flag) means high memory can be used, (`GFP_ATOMIC` flag) means the allocation process has high-priority and can't sleep etc. - -* `GFP_NOIO` - can sleep and wait for memory; -* `__GFP_HIGHMEM` - high memory can be used; -* `GFP_ATOMIC` - allocation process is high-priority and can't sleep; - -etc. - -The next field is `rnode`: - -```C -struct radix_tree_node { - unsigned int path; - unsigned int count; - union { - struct { - struct radix_tree_node *parent; - void *private_data; - }; - struct rcu_head rcu_head; - }; - /* For tree user */ - struct list_head private_list; - void __rcu *slots[RADIX_TREE_MAP_SIZE]; - unsigned long tags[RADIX_TREE_MAX_TAGS][RADIX_TREE_TAG_LONGS]; -}; -``` - -This structure contains information about the offset in a parent and height from the bottom, count of the child nodes and fields for accessing and freeing a node. This fields are described below: - -* `path` - offset in parent & height from the bottom; -* `count` - count of the child nodes; -* `parent` - pointer to the parent node; -* `private_data` - used by the user of a tree; -* `rcu_head` - used for freeing a node; -* `private_list` - used by the user of a tree; - -The two last fields of the `radix_tree_node` - `tags` and `slots` are important and interesting. Every node can contains a set of slots which are store pointers to the data. Empty slots in the linux kernel radix tree implementation store `NULL`. Radix trees in the linux kernel also supports tags which are associated with the `tags` fields in the `radix_tree_node` structure. Tags allow individual bits to be set on records which are stored in the radix tree. - -Now that we know about radix tree structure, it is time to look on its API. - -Linux kernel radix tree API ---------------------------------------------------------------------------------- - -We start from the datastructure initialization. There are two ways to initialize a new radix tree. The first is to use `RADIX_TREE` macro: - -```C -RADIX_TREE(name, gfp_mask); -```` - -As you can see we pass the `name` parameter, so with the `RADIX_TREE` macro we can define and initialize radix tree with the given name. Implementation of the `RADIX_TREE` is easy: - -```C -#define RADIX_TREE(name, mask) \ - struct radix_tree_root name = RADIX_TREE_INIT(mask) - -#define RADIX_TREE_INIT(mask) { \ - .height = 0, \ - .gfp_mask = (mask), \ - .rnode = NULL, \ -} -``` - -At the beginning of the `RADIX_TREE` macro we define instance of the `radix_tree_root` structure with the given name and call `RADIX_TREE_INIT` macro with the given mask. The `RADIX_TREE_INIT` macro just initializes `radix_tree_root` structure with the default values and the given mask. - -The second way is to define `radix_tree_root` structure by hand and pass it with mask to the `INIT_RADIX_TREE` macro: - -```C -struct radix_tree_root my_radix_tree; -INIT_RADIX_TREE(my_tree, gfp_mask_for_my_radix_tree); -``` - -where: - -```C -#define INIT_RADIX_TREE(root, mask) \ -do { \ - (root)->height = 0; \ - (root)->gfp_mask = (mask); \ - (root)->rnode = NULL; \ -} while (0) -``` - -makes the same initialziation with default values as it does `RADIX_TREE_INIT` macro. - -The next are two functions for inserting and deleting records to/from a radix tree: - -* `radix_tree_insert`; -* `radix_tree_delete`; - -The first `radix_tree_insert` function takes three parameters: - -* root of a radix tree; -* index key; -* data to insert; - -The `radix_tree_delete` function takes the same set of parameters as the `radix_tree_insert`, but without data. - -The search in a radix tree implemented in two ways: - -* `radix_tree_lookup`; -* `radix_tree_gang_lookup`; -* `radix_tree_lookup_slot`. - -The first `radix_tree_lookup` function takes two parameters: - -* root of a radix tree; -* index key; - -This function tries to find the given key in the tree and return the record associated with this key. The second `radix_tree_gang_lookup` function have the following signature - -```C -unsigned int radix_tree_gang_lookup(struct radix_tree_root *root, - void **results, - unsigned long first_index, - unsigned int max_items); -``` - -and returns number of records, sorted by the keys, starting from the first index. Number of the returned records will not be greater than `max_items` value. - -And the last `radix_tree_lookup_slot` function will return the slot which will contain the data. - -Links ---------------------------------------------------------------------------------- - -* [Radix tree](http://en.wikipedia.org/wiki/Radix_tree) -* [Trie](http://en.wikipedia.org/wiki/Trie) - --------------------------------------------------------------------------------- - -via: https://github.com/0xAX/linux-insides/edit/master/DataStructures/radix-tree.md - -作者:[0xAX] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - From 938cbe4b34646dbf4d5c984afd65a28a92df8ce1 Mon Sep 17 00:00:00 2001 From: cposture Date: Sun, 28 Feb 2016 11:35:27 +0800 Subject: [PATCH 0446/1469] Translated Data Structures in the Linux Kernel --- ...123 Data Structures in the Linux Kernel.md | 198 ++++++++++++++++++ 1 file changed, 198 insertions(+) create mode 100644 translated/tech/20151123 Data Structures in the Linux Kernel.md diff --git a/translated/tech/20151123 Data Structures in the Linux Kernel.md b/translated/tech/20151123 Data Structures in the Linux Kernel.md new file mode 100644 index 0000000000..78526e6d94 --- /dev/null +++ b/translated/tech/20151123 Data Structures in the Linux Kernel.md @@ -0,0 +1,198 @@ +Linux内核数据结构 +================================================================================ + +基数树 Radix tree +-------------------------------------------------------------------------------- +正如你所知道的,Linux内核提供了许多不同的库和函数,它们实现了不同的数据结构和算法。在这部分,我们将研究其中一种数据结构——[基数树 Radix tree](http://en.wikipedia.org/wiki/Radix_tree)。在Linux内核中,有两个与基数树实现和API相关的文件: + +* [include/linux/radix-tree.h](https://github.com/torvalds/linux/blob/master/include/linux/radix-tree.h) +* [lib/radix-tree.c](https://github.com/torvalds/linux/blob/master/lib/radix-tree.c) + +让我们讨论什么是`基数树`吧。基数树是一种`压缩的字典树`,而[字典树](http://en.wikipedia.org/wiki/Trie)是实现了关联数组接口并允许以`键值对`方式存储值的一种数据结构。该键通常是字符串,但能够使用任何数据类型。字典树因为它的节点而与`n叉树`不同。字典树的节点不存储键;相反,字典树的一个节点存储单个字符的标签。与一个给定节点关联的键可以通过从根遍历到该节点获得。举个例子: + +``` +               +-----------+ +               |           | +               |    " "    | + | | +        +------+-----------+------+ +        |                         | +        |                         | +   +----v------+            +-----v-----+ +   |           |            |           | +   |    g      |            |     c     | + | | | | +   +-----------+            +-----------+ +        |                         | +        |                         | +   +----v------+            +-----v-----+ +   |           |            |           | +   |    o      |            |     a     | + | | | | +   +-----------+            +-----------+ +                                  | +                                  | +                            +-----v-----+ +                            |           | +                            |     t     | + | | +                            +-----------+ +``` + +因此在这个例子中,我们可以看到一个有着两个键`go`和`cat`的`字典树`。压缩的字典树或者`基数树`和`字典树`不同于所有只有一个孩子的中间节点都被删除。 + +Linu内核中的基数树是映射值到整形键的一种数据结构。[include/linux/radix-tree.h](https://github.com/torvalds/linux/blob/master/include/linux/radix-tree.h)文件中的以下结构体表示了基数树: + +```C +struct radix_tree_root { + unsigned int height; + gfp_t gfp_mask; + struct radix_tree_node __rcu *rnode; +}; +``` + +这个结构体表示了一个基数树的根,并包含了3个域成员: + +* `height` - 树的高度; +* `gfp_mask` - 告诉如何执行动态内存分配; +* `rnode` - 孩子节点指针. + +我们第一个要讨论的域是`gfp_mask`: + +底层内核内存动态分配函数以一组标志作为` gfp_mask `,用于描述如何执行动态内存分配。这些控制分配进程的`GFP_`标志拥有以下值:(`GF_NOIO`标志)意味着睡眠等待内存,(`__GFP_HIGHMEM`标志)意味着高端内存能够被使用,(`GFP_ATOMIC`标志)意味着分配进程拥有高优先级并不能睡眠等等。 + +* `GFP_NOIO` - 睡眠等待内存 +* `__GFP_HIGHMEM` - 高端内存能够被使用; +* `GFP_ATOMIC` - 分配进程拥有高优先级并且不能睡眠; + +等等。 + +下一个域是`rnode`: + +```C +struct radix_tree_node { + unsigned int path; + unsigned int count; + union { + struct { + struct radix_tree_node *parent; + void *private_data; + }; + struct rcu_head rcu_head; + }; + /* For tree user */ + struct list_head private_list; + void __rcu *slots[RADIX_TREE_MAP_SIZE]; + unsigned long tags[RADIX_TREE_MAX_TAGS][RADIX_TREE_TAG_LONGS]; +}; +``` +这个结构体包含的信息有父节点中的偏移以及到底端(叶节点)的高度、孩子节点的个数以及用于访问和释放节点的域成员。这些域成员描述如下: + +* `path` - 父节点中的偏移和到底端(叶节点)的高度 +* `count` - 孩子节点的个数; +* `parent` - 父节点指针; +* `private_data` - 由树的用户使用; +* `rcu_head` - 用于释放节点; +* `private_list` - 由树的用户使用; + +`radix_tree_node`的最后两个成员——`tags`和`slots`非常重要且令人关注。Linux内核基数树的每个节点都包含一组存储指向数据指针的slots。Linux内核基数树实现的空slots存储`NULL`值。Linux内核中的基数树也支持与`radix_tree_node`结构体的`tags`域相关联的标签。标签允许在基数树存储的记录中设置各个位。 + +既然我们了解了基数树的结构,那么该是时候看一下它的API了。 + +Linux内核基数树API +--------------------------------------------------------------------------------- + +我们从结构体的初始化开始。有两种方法初始化一个新的基数树。第一种是使用`RADIX_TREE`宏: + +```C +RADIX_TREE(name, gfp_mask); +```` + +正如你所看到的,我们传递`name`参数,所以使用`RADIX_TREE`宏,我们能够定义和初始化基数树为给定的名字。`RADIX_TREE`的实现是简单的: + +```C +#define RADIX_TREE(name, mask) \ + struct radix_tree_root name = RADIX_TREE_INIT(mask) + +#define RADIX_TREE_INIT(mask) { \ + .height = 0, \ + .gfp_mask = (mask), \ + .rnode = NULL, \ +} +``` + +在`RADIX_TREE`宏的开始,我们使用给定的名字定义`radix_tree_root`结构体实例,并使用给定的mask调用`RADIX_TREE_INIT`宏。`RADIX_TREE_INIT`宏只是初始化`radix_tree_root`结构体为默认值和给定的mask而已。 + +第二种方法是亲手定义`radix_tree_root`结构体,并且将它和mask传给`INIT_RADIX_TREE`宏: + +```C +struct radix_tree_root my_radix_tree; +INIT_RADIX_TREE(my_tree, gfp_mask_for_my_radix_tree); +``` + +where: + +```C +#define INIT_RADIX_TREE(root, mask) \ +do { \ + (root)->height = 0; \ + (root)->gfp_mask = (mask); \ + (root)->rnode = NULL; \ +} while (0) +``` + +和`RADIX_TREE_INIT`宏所做的初始化一样,初始化为默认值。 + +接下来是用于从基数树插入和删除数据的两个函数: + +* `radix_tree_insert`; +* `radix_tree_delete`; + +第一个函数`radix_tree_insert`需要3个参数: + +* 基数树的根; +* 索引键; +* 插入的数据; + +`radix_tree_delete`函数需要和`radix_tree_insert`一样的一组参数,但是没有data。 + +基数树的搜索以两种方法实现: + +* `radix_tree_lookup`; +* `radix_tree_gang_lookup`; +* `radix_tree_lookup_slot`. + +第一个函数`radix_tree_lookup`需要两个参数: + +* 基数树的根; +* 索引键; + +这个函数尝试在树中查找给定的键,并返回和该键相关联的记录。第二个函数`radix_tree_gang_lookup`有以下的函数签名: + +```C +unsigned int radix_tree_gang_lookup(struct radix_tree_root *root, + void **results, + unsigned long first_index, + unsigned int max_items); +``` + +和返回记录的个数,(results指向的数据)按键排序并从第一个索引开始。返回的记录个数将不会超过`max_items`。 + +最后一个函数`radix_tree_lookup_slot`将会返回包含数据的slot。 + +链接 +--------------------------------------------------------------------------------- + +* [Radix tree](http://en.wikipedia.org/wiki/Radix_tree) +* [Trie](http://en.wikipedia.org/wiki/Trie) + +-------------------------------------------------------------------------------- + +via: https://github.com/0xAX/linux-insides/edit/master/DataStructures/radix-tree.md + +作者:[0xAX] +译者:[cposture](https://github.com/cposture) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + From 2eadbb2d8deba1b7555258d3075d775f3850e551 Mon Sep 17 00:00:00 2001 From: cposture Date: Sun, 28 Feb 2016 11:51:02 +0800 Subject: [PATCH 0447/1469] Update 20151109 How to send email notifications using Gmail SMTP server on Linux.md --- ...end email notifications using Gmail SMTP server on Linux.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20151109 How to send email notifications using Gmail SMTP server on Linux.md b/sources/tech/20151109 How to send email notifications using Gmail SMTP server on Linux.md index 5ffcb5aea8..1ec6ddff27 100644 --- a/sources/tech/20151109 How to send email notifications using Gmail SMTP server on Linux.md +++ b/sources/tech/20151109 How to send email notifications using Gmail SMTP server on Linux.md @@ -1,3 +1,4 @@ +【Translating by cposture 2016-02-28】 How to send email notifications using Gmail SMTP server on Linux ================================================================================ Suppose you want to configure a Linux app to send out email messages from your server or desktop. The email messages can be part of email newsletters, status updates (e.g., [Cachet][1]), monitoring alerts (e.g., [Monit][2]), disk events (e.g., [RAID mdadm][3]), and so on. While you can set up your [own outgoing mail server][4] to deliver messages, you can alternatively rely on a freely available public SMTP server as a maintenance-free option. @@ -153,4 +154,4 @@ via: http://xmodulo.com/send-email-notifications-gmail-smtp-server-linux.html [4]:http://xmodulo.com/mail-server-ubuntu-debian.html [5]:http://xmodulo.com/go/digitalocean [6]:http://xmodulo.com/server-monitoring-system-monit.html -[7]:http://xmodulo.com/go/digitalocean \ No newline at end of file +[7]:http://xmodulo.com/go/digitalocean From fdba14f751711368c0c6f231734dca520c6cc25b Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Sun, 28 Feb 2016 17:24:32 +0800 Subject: [PATCH 0448/1469] Update 20151208 5 great Raspberry Pi projects for the classroom.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 准备翻译该篇。 --- .../20151208 5 great Raspberry Pi projects for the classroom.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/talk/yearbook2015/20151208 5 great Raspberry Pi projects for the classroom.md b/sources/talk/yearbook2015/20151208 5 great Raspberry Pi projects for the classroom.md index cefad8cc6b..09423a6b8d 100644 --- a/sources/talk/yearbook2015/20151208 5 great Raspberry Pi projects for the classroom.md +++ b/sources/talk/yearbook2015/20151208 5 great Raspberry Pi projects for the classroom.md @@ -1,3 +1,5 @@ +FSSlc translating + 5 great Raspberry Pi projects for the classroom ================================================================================ ![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/osdc-open-source-yearbook-lead3.png) From 456fd7fa45321e6af3a601293cc374e11d14f2be Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 28 Feb 2016 20:04:43 +0800 Subject: [PATCH 0449/1469] PUB:20160104 How to use KVM from the command line on Debian or Ubuntu @kylepeng93 --- ...om the command line on Debian or Ubuntu.md | 43 ++++++++++--------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/published/20160104 How to use KVM from the command line on Debian or Ubuntu.md b/published/20160104 How to use KVM from the command line on Debian or Ubuntu.md index 1f7a121b3a..f631477721 100644 --- a/published/20160104 How to use KVM from the command line on Debian or Ubuntu.md +++ b/published/20160104 How to use KVM from the command line on Debian or Ubuntu.md @@ -1,12 +1,11 @@ - -怎样在 ubuntu 和 debian 中用命令行使用 KVM +怎样在 ubuntu 和 debian 中通过命令行管理 KVM ================================================================================ -有很多不同的方式去管理运行在 KVM 管理程序上的虚拟机。例如,virt-manager 就是一个流行的基于图形界面的前端虚拟机管理工具。然而,如果你想要在没有图形窗口的服务器环境下使用 KVM ,那么基于图形界面的解决方案显然是行不通的。事实上,你可以纯粹的使用包装了 kvm 命令行脚本的命令行来管理 KVM 虚拟机。作为替代方案,你可以使用 virsh 这个容易使用的命令行程序来管理客户虚拟机。在 virsh 中,它通过和 libvirtd 服务通信来达到控制虚拟机的目的,而 libvirtd 可以控制多个不同的虚拟机管理器,包括 KVM,Xen,QEMU,LXC 和 OpenVZ。 +有很多不同的方式去管理运行在 KVM 管理程序上的虚拟机。例如,virt-manager 就是一个流行的基于图形界面的前端虚拟机管理工具。然而,如果你想要在没有图形窗口的服务器环境下使用 KVM ,那么基于图形界面的解决方案显然是行不通的。事实上,你可以单纯使用包装了 kvm 命令行脚本的命令行来管理 KVM 虚拟机。作为替代方案,你可以使用 virsh 这个容易使用的命令行程序来管理客户虚拟机。在 virsh 中,它通过和 libvirtd 服务通信来达到控制虚拟机的目的,而 libvirtd 可以控制多个不同的虚拟机管理器,包括 KVM,Xen,QEMU,LXC 和 OpenVZ。 当你想要对虚拟机的前期准备和后期管理实现自动化操作时,像 virsh 这样的命令行管理工具是非常有用的。同样,virsh 支持多个管理器也就意味着你可以通过相同的 virsh 接口去管理不同的虚拟机管理器。 -在这篇文章中,我会示范**怎样在ubuntu和debian上通过使用virsh命令行去运行KVM**。 +在这篇文章中,我会示范**怎样在 ubuntu 和 debian 上通过使用 virsh 命令行去运行 KVM**。 ### 第一步:确认你的硬件平台支持虚拟化 ### @@ -24,7 +23,7 @@ ### 第二步:安装KVM ### -使用 `apt-ge` 安装 KVM 和相关的用户空间工具。 +使用 `apt-get` 安装 KVM 和相关的用户空间工具。 ``` $ sudo apt-get install qemu-kvm libvirt-bin @@ -71,7 +70,7 @@ 为了使 KVM 虚拟机能够访问外部网络,一种方法是通过在 KVM 宿主机上创建 Linux 桥来实现。创建之后的桥能够将虚拟机的虚拟网卡和宿主机的物理网卡连接起来,因此,虚拟机能够发送和接收由物理网卡传输的数据包。这种方式叫做网络桥接。 -下面将告诉你如何创建并且配置网桥,我们创建一个网桥称它为 br0. +下面将告诉你如何创建并且配置网桥,我们创建一个网桥称它为 br0。 首先,安装一个必需的包,然后用命令行创建一个网桥。 @@ -168,11 +167,11 @@ - 1GB内存,一个虚拟cpu和一个硬件驱动 -- Disk image:`/home/dev/images/alice.img` +- 磁盘镜像:`/home/dev/images/alice.img` -- Boot from CD-ROM(`/home/dev/iso/CentOS-6.5-x86_64-minomal.iso`) +- 从 CD-ROM 引导(`/home/dev/iso/CentOS-6.5-x86_64-minomal.iso`) -- Networking:一个桥接到 br0 的虚拟网卡 +- 网络:一个桥接到 br0 的虚拟网卡 - 通过 VNC 远程访问 @@ -183,7 +182,7 @@ $ uuid ``` -生成一个主机xml配置文件的方式就是通过一个已经存在的虚拟机来导出它的xml配置文件。如下所示。 +生成一个主机 xml 配置文件的方式就是通过一个已经存在的虚拟机来导出它的 xml 配置文件。如下所示。 ``` $ virsh dumpxml alice > bob.xml @@ -233,6 +232,7 @@ ### 远程连接虚拟机 ### 为了远程访问一个正在运行的虚拟机的控制台,你可以使用VNC客户端。 + 首先,你需要使用如下命令找出用于虚拟机的VNC端口号。 ``` @@ -241,57 +241,57 @@ ![](https://c2.staticflickr.com/6/5633/23448144274_49045bc868_c.jpg) -在这个例子中,用于 alice 虚拟机的 VNC 端口号是 5900 - 然后启动一个VNC客户端,连接到一个端口号为5900的VNC服务器。在我们的例子中,虚拟机支持由CentOS光盘文件启动。 +在这个例子中,用于 alice 虚拟机的 VNC 端口号是 5900。 然后启动一个VNC客户端,连接到一个端口号为5900的VNC服务器。在我们的例子中,虚拟机支持由CentOS光盘文件启动。 ![](https://c2.staticflickr.com/2/1533/24076369675_99408972a4_c.jpg) ### 使用 virsh 管理虚拟机 ### -下面列出了 virsh 命令的常规用法 +下面列出了 virsh 命令的常规用法: + 创建客户机并且启动虚拟机: ``` $ virsh create alice.xml ``` -停止虚拟机并且删除客户机 +停止虚拟机并且删除客户机: ``` $ virsh destroy alice ``` -关闭虚拟机(不用删除它) +关闭虚拟机(不用删除它): ``` $ virsh shutdown alice ``` -暂停虚拟机 +暂停虚拟机: ``` $ virsh suspend alice ``` -恢复虚拟机 +恢复虚拟机: ``` $ virsh resume alice ``` -访问正在运行的虚拟机的控制台 +访问正在运行的虚拟机的控制台: ``` $ virsh console alice ``` -设置虚拟机开机启动: +设置虚拟机开机启动: ``` $ virsh autostart alice ``` -查看虚拟机的详细信息 +查看虚拟机的详细信息: ``` $ virsh dominfo alice @@ -304,6 +304,7 @@ ``` 上面的这个命令将会使用一个默认的编辑器来调用主机配置文件。该配置文件中的任何改变都将自动被libvirt验证其正确性。 + 你也可以在一个virsh会话中管理虚拟机。下面的命令会创建并进入到一个virsh会话中: ``` @@ -361,7 +362,7 @@ via: http://xmodulo.com/use-kvm-command-line-debian-ubuntu.html 作者:[Dan Nanni][a] -译者:[kylepeng93 ](https://github.com/kylepeng93 ) +译者:[kylepeng93](https://github.com/kylepeng93 ) 校对:[Ezio](https://github.com/oska874) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d083c7a9baf670e0285c3b6bbfb891c099daec93 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 28 Feb 2016 21:06:24 +0800 Subject: [PATCH 0450/1469] =?UTF-8?q?20160228-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...velopment Release: Xubuntu 16.04 Beta 1.md | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 sources/news/20160226 Development Release: Xubuntu 16.04 Beta 1.md diff --git a/sources/news/20160226 Development Release: Xubuntu 16.04 Beta 1.md b/sources/news/20160226 Development Release: Xubuntu 16.04 Beta 1.md new file mode 100644 index 0000000000..20111a905d --- /dev/null +++ b/sources/news/20160226 Development Release: Xubuntu 16.04 Beta 1.md @@ -0,0 +1,25 @@ +Development Release: Xubuntu 16.04 Beta 1 +============================================ + +he Ubuntu Release Team has announced the availability of new beta test images for select community editions. The new development release, which carries the designation 16.04 Beta 1, is recommended for testers only and is not considered suitable for daily use. + +"This beta features images for [Lubuntu][1], Ubuntu Cloud, [Ubuntu GNOME][2], [Ubuntu MATE][3], [Ubuntu Kylin][4], [Ubuntu Studio][5] and [Xubuntu][6]. Pre-releases of Xenial Xerus are not encouraged for anyone needing a stable system or anyone who is not comfortable running into occasional, even frequent breakage. They are, however, recommended for Ubuntu flavour developers and those who want to help in testing, reporting and fixing bugs as we work towards getting this release ready." Additional information can be found in the [release announcement][7]. + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/software/applications/888731-development-release-xubuntu-1604-beta-1 + +作者:[DistroWatch][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/community/forums/person/284 +[1]: http://distrowatch.com/lubuntu +[2]: http://distrowatch.com/ubuntugnome +[3]: http://distrowatch.com/ubuntumate +[4]: http://distrowatch.com/ubuntukylin +[5]: http://distrowatch.com/ubuntustudio +[6]: http://distrowatch.com/xubuntu +[7]: https://lists.ubuntu.com/archives/ubuntu-devel-announce/2016-February/001173.html From e28e4c57daafe88c261ecf6d7bb8b7aa6149892b Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 28 Feb 2016 21:06:56 +0800 Subject: [PATCH 0451/1469] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../news/20160226 Development Release: Xubuntu 16.04 Beta 1.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/news/20160226 Development Release: Xubuntu 16.04 Beta 1.md b/sources/news/20160226 Development Release: Xubuntu 16.04 Beta 1.md index 20111a905d..85cbe1f351 100644 --- a/sources/news/20160226 Development Release: Xubuntu 16.04 Beta 1.md +++ b/sources/news/20160226 Development Release: Xubuntu 16.04 Beta 1.md @@ -1,3 +1,5 @@ +ezio translting + Development Release: Xubuntu 16.04 Beta 1 ============================================ From 34fff873e6d09c0c56e27e403d0e71b4d6897a90 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 28 Feb 2016 21:23:53 +0800 Subject: [PATCH 0452/1469] =?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 --- ...60226 Development Release: Xubuntu 16.04 Beta 1.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sources/news/20160226 Development Release: Xubuntu 16.04 Beta 1.md b/sources/news/20160226 Development Release: Xubuntu 16.04 Beta 1.md index 85cbe1f351..7d1fee4d3c 100644 --- a/sources/news/20160226 Development Release: Xubuntu 16.04 Beta 1.md +++ b/sources/news/20160226 Development Release: Xubuntu 16.04 Beta 1.md @@ -1,18 +1,23 @@ -ezio translting +ezio translted Development Release: Xubuntu 16.04 Beta 1 +Xubuntu 16.04 Beta 1 开发发布 ============================================ -he Ubuntu Release Team has announced the availability of new beta test images for select community editions. The new development release, which carries the designation 16.04 Beta 1, is recommended for testers only and is not considered suitable for daily use. +The Ubuntu Release Team has announced the availability of new beta test images for select community editions. The new development release, which carries the designation 16.04 Beta 1, is recommended for testers only and is not considered suitable for daily use. + +Ubuntu 发布组已经宣布为了选定的社区版本准备的最新的 beta 测试镜像已经可以使用了。新的开发发布版名称是 16.04 beta 1,这个版本只推荐给测试人员,并不适合日常使用。 "This beta features images for [Lubuntu][1], Ubuntu Cloud, [Ubuntu GNOME][2], [Ubuntu MATE][3], [Ubuntu Kylin][4], [Ubuntu Studio][5] and [Xubuntu][6]. Pre-releases of Xenial Xerus are not encouraged for anyone needing a stable system or anyone who is not comfortable running into occasional, even frequent breakage. They are, however, recommended for Ubuntu flavour developers and those who want to help in testing, reporting and fixing bugs as we work towards getting this release ready." Additional information can be found in the [release announcement][7]. +“这个 beta 特性的镜像是为 [Lubuntu][1], Ubuntu Cloud, [Ubuntu GNOME][2], [Ubuntu MATE][3], [Ubuntu Kylin][4], [Ubuntu Studio][5] 和 [Xubuntu][6] 这几个发布版准备的。Xenial Xerus 的预发布版本并不推荐那些需要稳定版本的,或者那些不希望在系统运行中偶尔或频繁的出现 bug 的人。这个版本还是推荐给喜欢 ubuntu 的开发人员,以及那些想帮助着测试、报告和修改 bug,和我们一起工作让这个发布版本早日准备好。” 更多的信息可以从 [发布日志][7] 获取。 + -------------------------------------------------------------------------------- via: https://www.linux.com/news/software/applications/888731-development-release-xubuntu-1604-beta-1 作者:[DistroWatch][a] -译者:[译者ID](https://github.com/译者ID) +译者:[Ezio](https://github.com/oska874) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 8743d7ca06f035c9f35b09a9a878b83332106e5b Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 28 Feb 2016 21:24:54 +0800 Subject: [PATCH 0453/1469] =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E5=88=B0translated?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../news/20160226 Development Release: Xubuntu 16.04 Beta 1.md | 2 -- 1 file changed, 2 deletions(-) rename {sources => translated}/news/20160226 Development Release: Xubuntu 16.04 Beta 1.md (99%) diff --git a/sources/news/20160226 Development Release: Xubuntu 16.04 Beta 1.md b/translated/news/20160226 Development Release: Xubuntu 16.04 Beta 1.md similarity index 99% rename from sources/news/20160226 Development Release: Xubuntu 16.04 Beta 1.md rename to translated/news/20160226 Development Release: Xubuntu 16.04 Beta 1.md index 7d1fee4d3c..95be0bfa46 100644 --- a/sources/news/20160226 Development Release: Xubuntu 16.04 Beta 1.md +++ b/translated/news/20160226 Development Release: Xubuntu 16.04 Beta 1.md @@ -1,5 +1,3 @@ -ezio translted - Development Release: Xubuntu 16.04 Beta 1 Xubuntu 16.04 Beta 1 开发发布 ============================================ From 9c6cf2cf1dada2930577cbd26becf8078bcf6c04 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 28 Feb 2016 21:25:50 +0800 Subject: [PATCH 0454/1469] =?UTF-8?q?=E8=B5=B6=E7=B4=A7=E6=A0=A1=E5=AF=B9?= =?UTF-8?q?=E5=90=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20160226 Development Release: Xubuntu 16.04 Beta 1.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/translated/news/20160226 Development Release: Xubuntu 16.04 Beta 1.md b/translated/news/20160226 Development Release: Xubuntu 16.04 Beta 1.md index 95be0bfa46..62e903018f 100644 --- a/translated/news/20160226 Development Release: Xubuntu 16.04 Beta 1.md +++ b/translated/news/20160226 Development Release: Xubuntu 16.04 Beta 1.md @@ -1,13 +1,8 @@ -Development Release: Xubuntu 16.04 Beta 1 Xubuntu 16.04 Beta 1 开发发布 ============================================ -The Ubuntu Release Team has announced the availability of new beta test images for select community editions. The new development release, which carries the designation 16.04 Beta 1, is recommended for testers only and is not considered suitable for daily use. - Ubuntu 发布组已经宣布为了选定的社区版本准备的最新的 beta 测试镜像已经可以使用了。新的开发发布版名称是 16.04 beta 1,这个版本只推荐给测试人员,并不适合日常使用。 -"This beta features images for [Lubuntu][1], Ubuntu Cloud, [Ubuntu GNOME][2], [Ubuntu MATE][3], [Ubuntu Kylin][4], [Ubuntu Studio][5] and [Xubuntu][6]. Pre-releases of Xenial Xerus are not encouraged for anyone needing a stable system or anyone who is not comfortable running into occasional, even frequent breakage. They are, however, recommended for Ubuntu flavour developers and those who want to help in testing, reporting and fixing bugs as we work towards getting this release ready." Additional information can be found in the [release announcement][7]. - “这个 beta 特性的镜像是为 [Lubuntu][1], Ubuntu Cloud, [Ubuntu GNOME][2], [Ubuntu MATE][3], [Ubuntu Kylin][4], [Ubuntu Studio][5] 和 [Xubuntu][6] 这几个发布版准备的。Xenial Xerus 的预发布版本并不推荐那些需要稳定版本的,或者那些不希望在系统运行中偶尔或频繁的出现 bug 的人。这个版本还是推荐给喜欢 ubuntu 的开发人员,以及那些想帮助着测试、报告和修改 bug,和我们一起工作让这个发布版本早日准备好。” 更多的信息可以从 [发布日志][7] 获取。 -------------------------------------------------------------------------------- From a520da8795954430434bf059d36fd93824e31d48 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 29 Feb 2016 14:52:25 +0800 Subject: [PATCH 0455/1469] translating --- ...ntel shows budget Android phone powering big-screen Linux.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160223 Intel shows budget Android phone powering big-screen Linux.md b/sources/tech/20160223 Intel shows budget Android phone powering big-screen Linux.md index 29a5c77cd9..315de0689e 100644 --- a/sources/tech/20160223 Intel shows budget Android phone powering big-screen Linux.md +++ b/sources/tech/20160223 Intel shows budget Android phone powering big-screen Linux.md @@ -1,3 +1,5 @@ +translating---geekpi + Intel shows budget Android phone powering big-screen Linux ============================================================== From e494a35410c411e9a5d080e15b089354b6ab456d Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 29 Feb 2016 15:22:54 +0800 Subject: [PATCH 0456/1469] translated --- ...Android phone powering big-screen Linux.md | 24 ++++++------- ...Android phone powering big-screen Linux.md | 34 +++++++++++++++++++ 2 files changed, 46 insertions(+), 12 deletions(-) create mode 100644 translated/tech/20160223 Intel shows budget Android phone powering big-screen Linux.md diff --git a/sources/tech/20160223 Intel shows budget Android phone powering big-screen Linux.md b/sources/tech/20160223 Intel shows budget Android phone powering big-screen Linux.md index 315de0689e..aedd61f966 100644 --- a/sources/tech/20160223 Intel shows budget Android phone powering big-screen Linux.md +++ b/sources/tech/20160223 Intel shows budget Android phone powering big-screen Linux.md @@ -1,34 +1,34 @@ -translating---geekpi - -Intel shows budget Android phone powering big-screen Linux +Intel展示了带动大屏幕Linux的便宜Android手机 ============================================================== ![](https://regmedia.co.uk/2016/02/23/intel-bigscreen.jpg?x=648&y=348&crop=1) -**MWC16** Intel is showing what it calls "Big Screen Experience" at Mobile World Congress, an Android smartphone which runs a full Linux desktop when plugged into an external display. +在世界移动会议**MWC16**上Intel展示了称之为“大屏体验”的一款的Android智能手机,它在插入一个外部显示后运行了一个完整的Linux桌面。 -The concept is broadly similar to Microsoft's Continuum for Windows 10 Mobile, but whereas Continuum devices are towards the high end, Intel's project is aimed, it says, at budget smartphones and emerging markets. +这个概念大体上与微软在Windows 10手机中的Continuum相似,但是Continuum面向的是高端设备,Intel的项目面向的是低端智能机何新兴市场。 -On display in Barcelona is a prototype SoFIA (Smart or Feature Phone with Intel Architecture) smartphone with an Atom x3 processor, 2GB RAM and 16GB storage, and modified to support an external display. Attach keyboard, mouse and display, and it becomes desktop Linux, with an option to display the Android screen in a window on the large display. +显示上Barcelona是拥有Atom x3、2GB RAM和16GB存储以及支持外部显示的的SoFIA(Intel架构的只能或功能手机)智能机原型。插上键盘、鼠标何显示,它就变成了一台桌面Linux,可以选择在大屏幕中显示Android桌面。 -"Android is based on a Linux kernel, so we're running one kernel, we have an Android stack and a Linux stack, and we're sharing the same context, so the file system is identical. The phone stays fully functional," Intel's Nir Metzer, Path Finding Group Manager, told the Reg. +Intel的拓荒小组经理Nir Metzer告诉Reg:“Android基于Linux内核,因此我们运行的是一个内核,我们有一个Android栈和一个Linux栈,并且我们共享一个上下文,因此文件系统是相同的。电话是全功能的。” -"I have a multi-window environment. As soon as I plug in I can do spreadsheets, I can drag and drop, play video. Achieving all this on a low-end platform is a challenge," said Metzer. +Metzer说:“我有一个多窗口环境。只要我插入后就可以做电子表格,我可以拖拽、播放音频。在一个低端平台实现这一切是一个挑战。” -Currently the display on the device goes blank when the external display is attached, but Metzer said that the next version of the Atom X3 will support dual displays. +现在当连上外部显示器时设备的屏幕显示的空白,但是Metzer说下个版本的Atom X3会支持双显示。 -The version of Linux used is maintained by Intel. "We need to align between the Linux versions and the Android," said Metzer. "The framework is pre-installed, not an app you can download." +使用的Linux版本是由Intel维护的。Metzer说:“我们需要将Linux和Android保持一致。框架是预安装的,你不能下载任何app” -Intel is pitching the idea at phone manufacturers here at Mobile World Congress, but had nothing to report concerning actual customers for its device. "The chip is ready, this is production-ready. This can go into production tomorrow. It is a business decision," said Metzer.® +英特尔在移动世界大会上向手机制造商们推销这一想法,但却没有实际报告购买该设备的消费者。Metzer说:“芯片已经准备好了,已经为量产准备好了。这可以明天进入生产。这是一个商业决定。” -------------------------------------------------------------------------------- via: http://www.theregister.co.uk/2016/02/23/move_over_continuum_intel_shows_android_smartphone_powering_bigscreen_linux/ 作者:[Tim Anderson][a] -译者:[译者ID](https://github.com/译者ID) +译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://www.theregister.co.uk/Author/2878 + + diff --git a/translated/tech/20160223 Intel shows budget Android phone powering big-screen Linux.md b/translated/tech/20160223 Intel shows budget Android phone powering big-screen Linux.md new file mode 100644 index 0000000000..aedd61f966 --- /dev/null +++ b/translated/tech/20160223 Intel shows budget Android phone powering big-screen Linux.md @@ -0,0 +1,34 @@ +Intel展示了带动大屏幕Linux的便宜Android手机 +============================================================== + +![](https://regmedia.co.uk/2016/02/23/intel-bigscreen.jpg?x=648&y=348&crop=1) + +在世界移动会议**MWC16**上Intel展示了称之为“大屏体验”的一款的Android智能手机,它在插入一个外部显示后运行了一个完整的Linux桌面。 + +这个概念大体上与微软在Windows 10手机中的Continuum相似,但是Continuum面向的是高端设备,Intel的项目面向的是低端智能机何新兴市场。 + +显示上Barcelona是拥有Atom x3、2GB RAM和16GB存储以及支持外部显示的的SoFIA(Intel架构的只能或功能手机)智能机原型。插上键盘、鼠标何显示,它就变成了一台桌面Linux,可以选择在大屏幕中显示Android桌面。 + +Intel的拓荒小组经理Nir Metzer告诉Reg:“Android基于Linux内核,因此我们运行的是一个内核,我们有一个Android栈和一个Linux栈,并且我们共享一个上下文,因此文件系统是相同的。电话是全功能的。” + +Metzer说:“我有一个多窗口环境。只要我插入后就可以做电子表格,我可以拖拽、播放音频。在一个低端平台实现这一切是一个挑战。” + +现在当连上外部显示器时设备的屏幕显示的空白,但是Metzer说下个版本的Atom X3会支持双显示。 + +使用的Linux版本是由Intel维护的。Metzer说:“我们需要将Linux和Android保持一致。框架是预安装的,你不能下载任何app” + +英特尔在移动世界大会上向手机制造商们推销这一想法,但却没有实际报告购买该设备的消费者。Metzer说:“芯片已经准备好了,已经为量产准备好了。这可以明天进入生产。这是一个商业决定。” + +-------------------------------------------------------------------------------- + +via: http://www.theregister.co.uk/2016/02/23/move_over_continuum_intel_shows_android_smartphone_powering_bigscreen_linux/ + +作者:[Tim Anderson][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.theregister.co.uk/Author/2878 + + From d7e2a05e8f6ffe8b023abaf692c90042bed9aa91 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 29 Feb 2016 15:24:31 +0800 Subject: [PATCH 0457/1469] delete source --- ...Android phone powering big-screen Linux.md | 34 ------------------- 1 file changed, 34 deletions(-) delete mode 100644 sources/tech/20160223 Intel shows budget Android phone powering big-screen Linux.md diff --git a/sources/tech/20160223 Intel shows budget Android phone powering big-screen Linux.md b/sources/tech/20160223 Intel shows budget Android phone powering big-screen Linux.md deleted file mode 100644 index aedd61f966..0000000000 --- a/sources/tech/20160223 Intel shows budget Android phone powering big-screen Linux.md +++ /dev/null @@ -1,34 +0,0 @@ -Intel展示了带动大屏幕Linux的便宜Android手机 -============================================================== - -![](https://regmedia.co.uk/2016/02/23/intel-bigscreen.jpg?x=648&y=348&crop=1) - -在世界移动会议**MWC16**上Intel展示了称之为“大屏体验”的一款的Android智能手机,它在插入一个外部显示后运行了一个完整的Linux桌面。 - -这个概念大体上与微软在Windows 10手机中的Continuum相似,但是Continuum面向的是高端设备,Intel的项目面向的是低端智能机何新兴市场。 - -显示上Barcelona是拥有Atom x3、2GB RAM和16GB存储以及支持外部显示的的SoFIA(Intel架构的只能或功能手机)智能机原型。插上键盘、鼠标何显示,它就变成了一台桌面Linux,可以选择在大屏幕中显示Android桌面。 - -Intel的拓荒小组经理Nir Metzer告诉Reg:“Android基于Linux内核,因此我们运行的是一个内核,我们有一个Android栈和一个Linux栈,并且我们共享一个上下文,因此文件系统是相同的。电话是全功能的。” - -Metzer说:“我有一个多窗口环境。只要我插入后就可以做电子表格,我可以拖拽、播放音频。在一个低端平台实现这一切是一个挑战。” - -现在当连上外部显示器时设备的屏幕显示的空白,但是Metzer说下个版本的Atom X3会支持双显示。 - -使用的Linux版本是由Intel维护的。Metzer说:“我们需要将Linux和Android保持一致。框架是预安装的,你不能下载任何app” - -英特尔在移动世界大会上向手机制造商们推销这一想法,但却没有实际报告购买该设备的消费者。Metzer说:“芯片已经准备好了,已经为量产准备好了。这可以明天进入生产。这是一个商业决定。” - --------------------------------------------------------------------------------- - -via: http://www.theregister.co.uk/2016/02/23/move_over_continuum_intel_shows_android_smartphone_powering_bigscreen_linux/ - -作者:[Tim Anderson][a] -译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.theregister.co.uk/Author/2878 - - From c266d8db2eda6dd9725640c0133895dc740ef0b2 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 29 Feb 2016 15:27:29 +0800 Subject: [PATCH 0458/1469] tranalating --- ...--Summon Swarms Of Penguins To Waddle About The Desktop.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sources/tech/20151215 Linux Desktop Fun--Summon Swarms Of Penguins To Waddle About The Desktop.md b/sources/tech/20151215 Linux Desktop Fun--Summon Swarms Of Penguins To Waddle About The Desktop.md index 73d16fe1bd..898790b197 100644 --- a/sources/tech/20151215 Linux Desktop Fun--Summon Swarms Of Penguins To Waddle About The Desktop.md +++ b/sources/tech/20151215 Linux Desktop Fun--Summon Swarms Of Penguins To Waddle About The Desktop.md @@ -1,3 +1,5 @@ +translating---geekpi + Linux Desktop Fun: Summon Swarms Of Penguins To Waddle About The Desktop ================================================================================ XPenguins is a program for animating cute cartoons animals in your root window. By default it will be penguins they drop in from the top of the screen, walk along the tops of your windows, up the side of your windows, levitate, skateboard, and do other similarly exciting things. Now you can send an army of cute little penguins to invade the screen of someone else on your network. @@ -98,3 +100,5 @@ via: http://www.cyberciti.biz/tips/linux-cute-little-xpenguins-walk-along-tops-o [1]:http://xpenguins.seul.org/ [2]:http://www.cyberciti.biz/tips/displays-animations-when-accidentally-you-type-sl-instead-of-ls.html [3]:http://www.cyberciti.biz/tips/linux-unix-apple-osx-terminal-ascii-aquarium.html + + From 1cebb81e0fcd6d6d7d171ef3dfaeee051df5149d Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 29 Feb 2016 15:46:07 +0800 Subject: [PATCH 0459/1469] translated --- ...Of Penguins To Waddle About The Desktop.md | 48 +++++++++---------- 1 file changed, 23 insertions(+), 25 deletions(-) rename {sources => translated}/tech/20151215 Linux Desktop Fun--Summon Swarms Of Penguins To Waddle About The Desktop.md (51%) diff --git a/sources/tech/20151215 Linux Desktop Fun--Summon Swarms Of Penguins To Waddle About The Desktop.md b/translated/tech/20151215 Linux Desktop Fun--Summon Swarms Of Penguins To Waddle About The Desktop.md similarity index 51% rename from sources/tech/20151215 Linux Desktop Fun--Summon Swarms Of Penguins To Waddle About The Desktop.md rename to translated/tech/20151215 Linux Desktop Fun--Summon Swarms Of Penguins To Waddle About The Desktop.md index 898790b197..6c797816f5 100644 --- a/sources/tech/20151215 Linux Desktop Fun--Summon Swarms Of Penguins To Waddle About The Desktop.md +++ b/translated/tech/20151215 Linux Desktop Fun--Summon Swarms Of Penguins To Waddle About The Desktop.md @@ -1,45 +1,43 @@ -translating---geekpi - -Linux Desktop Fun: Summon Swarms Of Penguins To Waddle About The Desktop +Linux桌面趣闻:召唤一群企鹅在桌面上行走 ================================================================================ -XPenguins is a program for animating cute cartoons animals in your root window. By default it will be penguins they drop in from the top of the screen, walk along the tops of your windows, up the side of your windows, levitate, skateboard, and do other similarly exciting things. Now you can send an army of cute little penguins to invade the screen of someone else on your network. +XPenguins是一个在窗口播放可爱动物动画的程序。默认情况下,将会从屏幕上方掉落企鹅,沿着你的窗口顶部行走,在窗口变漂浮,滑板,和做其他类似的令人兴奋的事情。现在,你可以把这些可爱的小企鹅大军入侵别人的桌面了。 -### Install XPenguins ### +### 安装XPenguins ### -Open a command-line terminal (select Applications > Accessories > Terminal), and then type the following commands to install XPenguins program. First, type the command apt-get update to tell apt to refresh its package information by querying the configured repositories and then install the required program: +打开终端(选择程序->附件->终端),接着输入下面的命令来安装XPenguins。首先,输入apt-get update通过请求配置的仓库刷新包的信息,接着安装需要的程序: $ sudo apt-get update $ sudo apt-get install xpenguins -### How do I Start XPenguins Locally? ### +### 我本地如何启动XPenguins? ### -Type the following command: +输入下面的命令: $ xpenguins -Sample outputs: +示例输出: ![An army of cute little penguins invading the screen](http://files.cyberciti.biz/uploads/tips/2011/07/Workspace-1_002_12_07_2011.png) -An army of cute little penguins invading the screen +一支可爱企鹅军队正在入侵屏幕。 ![Linux: Cute little penguins walking along the tops of your windows](http://files.cyberciti.biz/uploads/tips/2011/07/Workspace-1_001_12_07_2011.png) -Linux: Cute little penguins walking along the tops of your windows +Linux:可爱的小企鹅沿着窗口的顶部行走。 ![Xpenguins Screenshot](http://files.cyberciti.biz/uploads/tips/2011/07/xpenguins-screenshot.jpg) -Xpenguins Screenshot +Xpenguins截图 -Be careful when you move windows as the little guys squash easily. If you send the program an interupt signal (Ctrl-C) they will burst. +移动窗口时小心点,小家伙们很容易被压坏。如果你发送中断程序(Ctrl-C),它们会爆炸。 -### Themes ### +### 主题 ### -To list themes, enter: +要列出主题,输入: $ xpenguins -l -Sample outputs: +示例输出: Big Penguins Bill @@ -47,11 +45,11 @@ Sample outputs: Penguins Turtles -You can use alternative themes as follows: +你可以用下面的命令使用其他的主题: $ xpenguins --theme "Big Penguins" --theme "Turtles" -You can install additional themes as follows: +你可以用下面的命令安装额外的主题: $ cd /tmp $ wget http://xpenguins.seul.org/xpenguins_themes-1.0.tar.gz @@ -60,7 +58,7 @@ You can install additional themes as follows: $ mv -v themes ~/.xpenguins/ $ xpenguins -l -Sample outputs: +示例输出: Lemmings Sonic the Hedgehog @@ -73,26 +71,26 @@ Sample outputs: Penguins Turtles -To start with a random theme, enter: +已一个随机主题开始,输入: $ xpenguins --random-theme -To load all available themes and run them simultaneously, enter: +要加载所有的主题并且同时运行,输入: $ xpenguins --all -More links and information: +更多链接何信息: -- [XPenguins][1] home page. +- [XPenguins][1] 主页。 - man penguins -- More Linux / UNIX desktop fun with [Steam Locomotive][2] and [Terminal ASCII Aquarium][3]. +- 更多Linux/Unix桌面乐趣在[蒸汽火车][2]和[终端ASCII水族馆][3]。 -------------------------------------------------------------------------------- via: http://www.cyberciti.biz/tips/linux-cute-little-xpenguins-walk-along-tops-ofyour-windows.html 作者:Vivek Gite -译者:[译者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 7fbc74dc9e80c685979ee7b1d82ef2bc1f84c472 Mon Sep 17 00:00:00 2001 From: Bestony Date: Mon, 29 Feb 2016 17:35:12 +0800 Subject: [PATCH 0460/1469] Update 20150817 How to Install OsTicket Ticketing System in Fedora 22 or Centos 7.md --- ...Install OsTicket Ticketing System in Fedora 22 or Centos 7.md | 1 + 1 file changed, 1 insertion(+) 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 index 6624a3c590..49244c96d2 100644 --- 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 @@ -1,3 +1,4 @@ +translated by bestony 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. From a07d9fbe5afc29ccb83f7af2ab48af4cc97276fa Mon Sep 17 00:00:00 2001 From: cposture Date: Mon, 29 Feb 2016 19:20:47 +0800 Subject: [PATCH 0461/1469] Translated by cposture --- ...ations using Gmail SMTP server on Linux.md | 156 ------------------ ...ations using Gmail SMTP server on Linux.md | 156 ++++++++++++++++++ 2 files changed, 156 insertions(+), 156 deletions(-) delete mode 100644 sources/tech/20151109 How to send email notifications using Gmail SMTP server on Linux.md create mode 100644 translated/tech/20151109 How to send email notifications using Gmail SMTP server on Linux.md diff --git a/sources/tech/20151109 How to send email notifications using Gmail SMTP server on Linux.md b/sources/tech/20151109 How to send email notifications using Gmail SMTP server on Linux.md deleted file mode 100644 index 5ffcb5aea8..0000000000 --- a/sources/tech/20151109 How to send email notifications using Gmail SMTP server on Linux.md +++ /dev/null @@ -1,156 +0,0 @@ -How to send email notifications using Gmail SMTP server on Linux -================================================================================ -Suppose you want to configure a Linux app to send out email messages from your server or desktop. The email messages can be part of email newsletters, status updates (e.g., [Cachet][1]), monitoring alerts (e.g., [Monit][2]), disk events (e.g., [RAID mdadm][3]), and so on. While you can set up your [own outgoing mail server][4] to deliver messages, you can alternatively rely on a freely available public SMTP server as a maintenance-free option. - -One of the most reliable **free SMTP servers** is from Google's Gmail service. All you have to do to send email notifications within your app is to add Gmail's SMTP server address and your credentials to the app, and you are good to go. - -One catch with using Gmail's SMTP server is that there are various restrictions in place, mainly to combat spammers and email marketers who often abuse the server. For example, you can send messages to no more than 100 addresses at once, and no more than 500 recipients per day. Also, if you don't want to be flagged as a spammer, you cannot send a large number of undeliverable messages. When any of these limitations is reached, your Gmail account will temporarily be locked out for a day. In short, Gmail's SMTP server is perfectly fine for your personal use, but not meant for commercial bulk emails. - -With that being said, let me demonstrate **how to use Gmail's SMTP server in Linux environment**. - -### Google Gmail SMTP Server Setting ### - -If you want to send emails from your app using Gmail's SMTP server, remember the following details. - -- **Outgoing mail server (SMTP server)**: smtp.gmail.com -- **Use authentication**: yes -- **Use secure connection**: yes -- **Username**: your Gmail account ID (e.g., "alice" if your email is alice@gmail.com) -- **Password**: your Gmail password -- **Port**: 587 - -Exact configuration syntax may vary depending on apps. In the rest of this tutorial, I will show you several useful examples of using Gmail SMTP server in Linux. - -### Send Emails from the Command Line ### - -As the first example, let's try the most basic email functionality: send an email from the command line using Gmail SMTP server. For this, I am going to use a command-line email client called mutt. - -First, install mutt: - -For Debian-based system: - - $ sudo apt-get install mutt - -For Red Hat based system: - - $ sudo yum install mutt - -Create a mutt configuration file (~/.muttrc) and specify in the file Gmail SMTP server information as follows. Replace with your own Gmail ID. Note that this configuration is for sending emails only (not receiving emails). - - $ vi ~/.muttrc - ----------- - - set from = "@gmail.com" - set realname = "Dan Nanni" - set smtp_url = "smtp://@smtp.gmail.com:587/" - set smtp_pass = "" - -Now you are ready to send out an email using mutt: - - $ echo "This is an email body." | mutt -s "This is an email subject" alice@yahoo.com - -To attach a file in an email, use "-a" option: - - $ echo "This is an email body." | mutt -s "This is an email subject" alice@yahoo.com -a ~/test_attachment.jpg - -![](https://c1.staticflickr.com/1/770/22239850784_5fb0988075_c.jpg) - -Using Gmail SMTP server means that the emails appear as sent from your Gmail account. In other words, a recepient will see your Gmail address as the sender's address. If you want to use your domain as the email sender, you need to use Gmail SMTP relay service instead. - -### Send Email Notification When a Server is Rebooted ### - -If you are running a [virtual private server (VPS)][5] for some critical website, one recommendation is to monitor VPS reboot activities. As a more practical example, let's consider how to set up email notifications for every reboot event on your VPS. Here I assume you are using systemd on your VPS, and show you how to create a custom systemd boot-time service for automatic email notifications. - -First create the following script reboot_notify.sh which takes care of email notifications. - - $ sudo vi /usr/local/bin/reboot_notify.sh - ----------- - - #!/bin/sh - - echo "`hostname` was rebooted on `date`" | mutt -F /etc/muttrc -s "Notification on `hostname`" alice@yahoo.com - ----------- - - $ sudo chmod +x /usr/local/bin/reboot_notify.sh - -In the script, I use "-F" option to specify the location of system-wide mutt configuration file. So don't forget to create /etc/muttrc file and populate Gmail SMTP information as described earlier. - -Now let's create a custom systemd service as follows. - - $ sudo mkdir -p /usr/local/lib/systemd/system - $ sudo vi /usr/local/lib/systemd/system/reboot-task.service - ----------- - - [Unit] - Description=Send a notification email when the server gets rebooted - DefaultDependencies=no - Before=reboot.target - - [Service] - Type=oneshot - ExecStart=/usr/local/bin/reboot_notify.sh - - [Install] - WantedBy=reboot.target - -Once the service file is created, enable and start the service. - - $ sudo systemctl enable reboot-task - $ sudo systemctl start reboot-task - -From now on, you will be receiving a notification email every time the VPS gets rebooted. - -![](https://c1.staticflickr.com/1/608/22241452923_2ace9cde2e_c.jpg) - -### Send Email Notification from Server Usage Monitoring ### - -As a final example, let me present a real-world application called [Monit][6], which is a pretty useful server monitoring application. It comes with comprehensive [VPS][7] monitoring capabilities (e.g., CPU, memory, processes, file system), as well as email notification functions. - -If you want to receive email notifications for any event on your VPS (e.g., server overload) generated by Monit, you can add the following SMTP information to Monit configuration file. - - set mailserver smtp.gmail.com port 587 - username "" password "" - using tlsv12 - - set mail-format { - from: @gmail.com - subject: $SERVICE $EVENT at $DATE on $HOST - message: Monit $ACTION $SERVICE $EVENT at $DATE on $HOST : $DESCRIPTION. - - Yours sincerely, - Monit - } - - # the person who will receive notification emails - set alert alice@yahoo.com - -Here is the example email notification sent by Monit for excessive CPU load. - -![](https://c1.staticflickr.com/1/566/22873764251_8fe66bfd16_c.jpg) - -### Conclusion ### - -As you can imagine, there will be so many different ways to take advantage of free SMTP servers like Gmail. But once again, remember that the free SMTP server is not meant for commercial usage, but only for your own personal project. If you are using Gmail SMTP server inside any app, feel free to share your use case. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/send-email-notifications-gmail-smtp-server-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]:http://xmodulo.com/setup-system-status-page.html -[2]:http://xmodulo.com/server-monitoring-system-monit.html -[3]:http://xmodulo.com/create-software-raid1-array-mdadm-linux.html -[4]:http://xmodulo.com/mail-server-ubuntu-debian.html -[5]:http://xmodulo.com/go/digitalocean -[6]:http://xmodulo.com/server-monitoring-system-monit.html -[7]:http://xmodulo.com/go/digitalocean \ No newline at end of file diff --git a/translated/tech/20151109 How to send email notifications using Gmail SMTP server on Linux.md b/translated/tech/20151109 How to send email notifications using Gmail SMTP server on Linux.md new file mode 100644 index 0000000000..56830068ab --- /dev/null +++ b/translated/tech/20151109 How to send email notifications using Gmail SMTP server on Linux.md @@ -0,0 +1,156 @@ +如何在Linux上使用Gmail SMTP服务器发送邮件通知 +================================================================================ +假定你想配置一个Linux app从你的服务器或桌面客户端发送邮件信息。邮件信息可以是邮件简报、状态更新(比如[Cachet][1])、监控警报(比如[Monit][2])、磁盘时间(比如[RAID mdadm][3])等等的一部分。当你要建立自己的[邮件发送服务器][4],作为一个免维护的选择,你可以依赖一个免费可用的公共SMTP服务器。 + +最可靠的**免费SMTP服务器**之一来自谷歌的Gmail服务。为了在你的app里发送邮件通知,你仅需在app中添加Gmail的SMTP服务器地址和你的凭证即可。 + +Gmail的SMTP服务器吸引人的地方之一是有各种各样恰当的限制,这些限制主要用于阻止那些经常滥用服务器的滥发垃圾邮件者和邮件营销者。举个例子,你一次只能给至多100个地址发送信息,并且一天不能超过500个接收者。当你达到任何一个限制,你的Gmail账户将暂时锁一天。简而言之,Gmail的SMTP服务器对于你个人的使用是非常棒的,但不适合商业的批量邮件。 + +话虽如此,让我们展示**如何在Linux环境下使用Gmail的SMTP服务器**。 + +### Google Gmail SMTP服务器设置 ### + +如果你想要使用Gmail的SMTP服务器从你的app发送邮件,请牢记接下来的详细说明。 + +- **邮件发送服务器 (SMTP服务器)**: smtp.gmail.com +- **使用认证**: 是 +- **使用安全连接**: 是 +- **用户名**: 你的Gmail账户ID (比如 "alice" 如果你的邮箱为alice@gmail.com) +- **密码**: 你的Gmail密码 +- **端口**: 587 + +确切的配置语法可能要依据app而不同。在本教程的剩下部分,我将会向你展示各种在Linux上使用Gmail SMTP服务器的有用示例。 + +### 从命令行发送邮件 ### + +作为第一个例子,让我们尝试最基本的邮件功能:使用Gmail SMTP服务器从命令行发送一封邮件。为此,我将使用一个称为mutt的命令行邮件客户端。 + +先安装mutt: + +对于 Debian-based 系统: + + $ sudo apt-get install mutt + +对于 Red Hat based 系统: + + $ sudo yum install mutt + +创建一个mutt配置文件(~/.muttrc),并和下面一样,在文件中指定Gmail SMTP服务器信息。将gmail-id替换成自己的Gmail ID。注意这配置只是为了发送邮件而已(而非接收邮件)。 + + $ vi ~/.muttrc + +---------- + + set from = "@gmail.com" + set realname = "Dan Nanni" + set smtp_url = "smtp://@smtp.gmail.com:587/" + set smtp_pass = "" + +现在准备使用mutt发送一封邮件: + + $ echo "This is an email body." | mutt -s "This is an email subject" alice@yahoo.com + +为了在一封邮件中添加一个附件,使用"-a"选项 + + $ echo "This is an email body." | mutt -s "This is an email subject" alice@yahoo.com -a ~/test_attachment.jpg + +![](https://c1.staticflickr.com/1/770/22239850784_5fb0988075_c.jpg) + +使用Gmail SMTP服务器意味着邮件显示为从你的Gmail账户发出。换句话说,一个接收者将你的Gmail地址视为发送者地址。如果你想要使用自己的域名作为邮件发送者,你需要使用Gmail SMTP转发服务。 + +### 当服务器重启时发送邮件通知 ### + +如果你为了一些重要的网站正在运行一台[虚拟专用服务器(VPS)][5],一个建议是监视VPS的重启活动。作为一个更实用的例子,让我们研究如何在你的VPS上为每一次重启事件建立邮件通知。这里我假设你正在你的VPS上使用systemd,并向你展示如何为自动邮件通知创建一个自定义的systemd启动服务。 + +首先创建下面的脚本reboot_notify.sh,用于负责邮件通知。 + + $ sudo vi /usr/local/bin/reboot_notify.sh + +---------- + + #!/bin/sh + + echo "`hostname` was rebooted on `date`" | mutt -F /etc/muttrc -s "Notification on `hostname`" alice@yahoo.com + +---------- + + $ sudo chmod +x /usr/local/bin/reboot_notify.sh + +在这个脚本中,我使用"-F"选项,用于直到系统级的mutt配置文件位置。因此不要忘了创建/etc/muttrc文件并如前面描述填入Gmail SMTP信息。 + +现在让我们创建如下一个自定义的systemd服务。 + + $ sudo mkdir -p /usr/local/lib/systemd/system + $ sudo vi /usr/local/lib/systemd/system/reboot-task.service + +---------- + + [Unit] + Description=Send a notification email when the server gets rebooted + DefaultDependencies=no + Before=reboot.target + + [Service] + Type=oneshot + ExecStart=/usr/local/bin/reboot_notify.sh + + [Install] + WantedBy=reboot.target + +一旦创建服务,便使能和启动该服务。 + + $ sudo systemctl enable reboot-task + $ sudo systemctl start reboot-task + +从现在起,在每次VPS重启时你将会收到一封通知邮件。 + +![](https://c1.staticflickr.com/1/608/22241452923_2ace9cde2e_c.jpg) + +### 从服务器使用监控发送邮件通知 ### + +作为最后一个例子,让我展示一个称为[Monit][6]的现实生活的应用程序,这是一个极其有用的服务器监控应用程序。它附有广泛的[VPS][7]监控能力(比如CPU、内存、进程、文件系统),包括邮件通知能力。 + +如果你想要接收VPS上任何事件导致的且由Monit产生的邮件通知,你可以在Monit配置文件中添加以下SMTP信息。 + + set mailserver smtp.gmail.com port 587 + username "" password "" + using tlsv12 + + set mail-format { + from: @gmail.com + subject: $SERVICE $EVENT at $DATE on $HOST + message: Monit $ACTION $SERVICE $EVENT at $DATE on $HOST : $DESCRIPTION. + + Yours sincerely, + Monit + } + + # the person who will receive notification emails + set alert alice@yahoo.com + +这是一个因为CPU负载超载而由Monit发送的邮件通知例子。 + +![](https://c1.staticflickr.com/1/566/22873764251_8fe66bfd16_c.jpg) + +### 总结 ### + +正如你能想象的,像Gmail一样,有许多中不同的方式使用免费的SMTP服务器。但再次说明,请牢记免费的SMTP服务器不适用于商业用途,仅仅适用于个人项目。如果你正在任一app中使用Gmail SMTP服务器,请自由分享你的用例。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/send-email-notifications-gmail-smtp-server-linux.html + +作者:[Dan Nanni][a] +译者:[cposture](https://github.com/cposture) +校对:[校对者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/setup-system-status-page.html +[2]:http://xmodulo.com/server-monitoring-system-monit.html +[3]:http://xmodulo.com/create-software-raid1-array-mdadm-linux.html +[4]:http://xmodulo.com/mail-server-ubuntu-debian.html +[5]:http://xmodulo.com/go/digitalocean +[6]:http://xmodulo.com/server-monitoring-system-monit.html +[7]:http://xmodulo.com/go/digitalocean From f69d2d164193fc1b5753a55ffccb0c8ea27cb4a6 Mon Sep 17 00:00:00 2001 From: cposture Date: Mon, 29 Feb 2016 19:54:16 +0800 Subject: [PATCH 0462/1469] =?UTF-8?q?=E5=9B=9E=E6=94=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20160225 How to add open source experience to your resume.md | 1 - 1 file changed, 1 deletion(-) diff --git a/sources/tech/20160225 How to add open source experience to your resume.md b/sources/tech/20160225 How to add open source experience to your resume.md index eee0d6aa23..73e22c2b8b 100644 --- a/sources/tech/20160225 How to add open source experience to your resume.md +++ b/sources/tech/20160225 How to add open source experience to your resume.md @@ -1,4 +1,3 @@ -【Translating by cposture 2016-02-25】 How to add open source experience to your resume ================================================== From 01b1c41bc687b2bcd26654d5a43ee8821e48f9e3 Mon Sep 17 00:00:00 2001 From: cposture Date: Mon, 29 Feb 2016 20:40:59 +0800 Subject: [PATCH 0463/1469] Translated by cposture --- ...ations using Gmail SMTP server on Linux.md | 157 ------------------ 1 file changed, 157 deletions(-) delete mode 100644 sources/tech/20151109 How to send email notifications using Gmail SMTP server on Linux.md diff --git a/sources/tech/20151109 How to send email notifications using Gmail SMTP server on Linux.md b/sources/tech/20151109 How to send email notifications using Gmail SMTP server on Linux.md deleted file mode 100644 index 1ec6ddff27..0000000000 --- a/sources/tech/20151109 How to send email notifications using Gmail SMTP server on Linux.md +++ /dev/null @@ -1,157 +0,0 @@ -【Translating by cposture 2016-02-28】 -How to send email notifications using Gmail SMTP server on Linux -================================================================================ -Suppose you want to configure a Linux app to send out email messages from your server or desktop. The email messages can be part of email newsletters, status updates (e.g., [Cachet][1]), monitoring alerts (e.g., [Monit][2]), disk events (e.g., [RAID mdadm][3]), and so on. While you can set up your [own outgoing mail server][4] to deliver messages, you can alternatively rely on a freely available public SMTP server as a maintenance-free option. - -One of the most reliable **free SMTP servers** is from Google's Gmail service. All you have to do to send email notifications within your app is to add Gmail's SMTP server address and your credentials to the app, and you are good to go. - -One catch with using Gmail's SMTP server is that there are various restrictions in place, mainly to combat spammers and email marketers who often abuse the server. For example, you can send messages to no more than 100 addresses at once, and no more than 500 recipients per day. Also, if you don't want to be flagged as a spammer, you cannot send a large number of undeliverable messages. When any of these limitations is reached, your Gmail account will temporarily be locked out for a day. In short, Gmail's SMTP server is perfectly fine for your personal use, but not meant for commercial bulk emails. - -With that being said, let me demonstrate **how to use Gmail's SMTP server in Linux environment**. - -### Google Gmail SMTP Server Setting ### - -If you want to send emails from your app using Gmail's SMTP server, remember the following details. - -- **Outgoing mail server (SMTP server)**: smtp.gmail.com -- **Use authentication**: yes -- **Use secure connection**: yes -- **Username**: your Gmail account ID (e.g., "alice" if your email is alice@gmail.com) -- **Password**: your Gmail password -- **Port**: 587 - -Exact configuration syntax may vary depending on apps. In the rest of this tutorial, I will show you several useful examples of using Gmail SMTP server in Linux. - -### Send Emails from the Command Line ### - -As the first example, let's try the most basic email functionality: send an email from the command line using Gmail SMTP server. For this, I am going to use a command-line email client called mutt. - -First, install mutt: - -For Debian-based system: - - $ sudo apt-get install mutt - -For Red Hat based system: - - $ sudo yum install mutt - -Create a mutt configuration file (~/.muttrc) and specify in the file Gmail SMTP server information as follows. Replace with your own Gmail ID. Note that this configuration is for sending emails only (not receiving emails). - - $ vi ~/.muttrc - ----------- - - set from = "@gmail.com" - set realname = "Dan Nanni" - set smtp_url = "smtp://@smtp.gmail.com:587/" - set smtp_pass = "" - -Now you are ready to send out an email using mutt: - - $ echo "This is an email body." | mutt -s "This is an email subject" alice@yahoo.com - -To attach a file in an email, use "-a" option: - - $ echo "This is an email body." | mutt -s "This is an email subject" alice@yahoo.com -a ~/test_attachment.jpg - -![](https://c1.staticflickr.com/1/770/22239850784_5fb0988075_c.jpg) - -Using Gmail SMTP server means that the emails appear as sent from your Gmail account. In other words, a recepient will see your Gmail address as the sender's address. If you want to use your domain as the email sender, you need to use Gmail SMTP relay service instead. - -### Send Email Notification When a Server is Rebooted ### - -If you are running a [virtual private server (VPS)][5] for some critical website, one recommendation is to monitor VPS reboot activities. As a more practical example, let's consider how to set up email notifications for every reboot event on your VPS. Here I assume you are using systemd on your VPS, and show you how to create a custom systemd boot-time service for automatic email notifications. - -First create the following script reboot_notify.sh which takes care of email notifications. - - $ sudo vi /usr/local/bin/reboot_notify.sh - ----------- - - #!/bin/sh - - echo "`hostname` was rebooted on `date`" | mutt -F /etc/muttrc -s "Notification on `hostname`" alice@yahoo.com - ----------- - - $ sudo chmod +x /usr/local/bin/reboot_notify.sh - -In the script, I use "-F" option to specify the location of system-wide mutt configuration file. So don't forget to create /etc/muttrc file and populate Gmail SMTP information as described earlier. - -Now let's create a custom systemd service as follows. - - $ sudo mkdir -p /usr/local/lib/systemd/system - $ sudo vi /usr/local/lib/systemd/system/reboot-task.service - ----------- - - [Unit] - Description=Send a notification email when the server gets rebooted - DefaultDependencies=no - Before=reboot.target - - [Service] - Type=oneshot - ExecStart=/usr/local/bin/reboot_notify.sh - - [Install] - WantedBy=reboot.target - -Once the service file is created, enable and start the service. - - $ sudo systemctl enable reboot-task - $ sudo systemctl start reboot-task - -From now on, you will be receiving a notification email every time the VPS gets rebooted. - -![](https://c1.staticflickr.com/1/608/22241452923_2ace9cde2e_c.jpg) - -### Send Email Notification from Server Usage Monitoring ### - -As a final example, let me present a real-world application called [Monit][6], which is a pretty useful server monitoring application. It comes with comprehensive [VPS][7] monitoring capabilities (e.g., CPU, memory, processes, file system), as well as email notification functions. - -If you want to receive email notifications for any event on your VPS (e.g., server overload) generated by Monit, you can add the following SMTP information to Monit configuration file. - - set mailserver smtp.gmail.com port 587 - username "" password "" - using tlsv12 - - set mail-format { - from: @gmail.com - subject: $SERVICE $EVENT at $DATE on $HOST - message: Monit $ACTION $SERVICE $EVENT at $DATE on $HOST : $DESCRIPTION. - - Yours sincerely, - Monit - } - - # the person who will receive notification emails - set alert alice@yahoo.com - -Here is the example email notification sent by Monit for excessive CPU load. - -![](https://c1.staticflickr.com/1/566/22873764251_8fe66bfd16_c.jpg) - -### Conclusion ### - -As you can imagine, there will be so many different ways to take advantage of free SMTP servers like Gmail. But once again, remember that the free SMTP server is not meant for commercial usage, but only for your own personal project. If you are using Gmail SMTP server inside any app, feel free to share your use case. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/send-email-notifications-gmail-smtp-server-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]:http://xmodulo.com/setup-system-status-page.html -[2]:http://xmodulo.com/server-monitoring-system-monit.html -[3]:http://xmodulo.com/create-software-raid1-array-mdadm-linux.html -[4]:http://xmodulo.com/mail-server-ubuntu-debian.html -[5]:http://xmodulo.com/go/digitalocean -[6]:http://xmodulo.com/server-monitoring-system-monit.html -[7]:http://xmodulo.com/go/digitalocean From cece931e431327d5dc919267037a06b2ed379547 Mon Sep 17 00:00:00 2001 From: cposture Date: Tue, 1 Mar 2016 00:26:25 +0800 Subject: [PATCH 0464/1469] Translating by cposture --- sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md b/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md index 99f1ceed04..f2e09b5c7a 100644 --- a/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md +++ b/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md @@ -1,3 +1,4 @@ +【Translating by cposture 2016-03-01】 * * * # GCC-Inline-Assembly-HOWTO From ccb535342afd9645c4af9ebcd5c4a8d141e63fed Mon Sep 17 00:00:00 2001 From: alim0x Date: Tue, 1 Mar 2016 19:47:34 +0800 Subject: [PATCH 0465/1469] [translated]22 - The history of Android --- .../22 - The history of Android.md | 86 ------------------- .../22 - The history of Android.md | 84 ++++++++++++++++++ 2 files changed, 84 insertions(+), 86 deletions(-) delete mode 100644 sources/talk/The history of Android/22 - The history of Android.md create mode 100644 translated/talk/The history of Android/22 - The history of Android.md diff --git a/sources/talk/The history of Android/22 - The history of Android.md b/sources/talk/The history of Android/22 - The history of Android.md deleted file mode 100644 index fab3d8c087..0000000000 --- a/sources/talk/The history of Android/22 - The history of Android.md +++ /dev/null @@ -1,86 +0,0 @@ -alim0x translating - -The history of Android -================================================================================ -### Android 4.2, Jelly Bean—new Nexus devices, new tablet interface ### - -The Android Platform was rapidly maturing, and with Google hosting more and more apps in the Play Store, there was less and less that needed to go out in the OS update. Still, the relentless march of updates must continue, and in November 2012 Android 4.2 was released. 4.2 was still called "Jelly Bean," a nod to the relatively small amount of changes that were present in this release. - -![The LG-made Nexus 4 and Samsung-made Nexus 10.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/unnamed.jpg) -The LG-made Nexus 4 and Samsung-made Nexus 10. -Photo by Google/Ron Amadeo - -Along with Android 4.2 came two flagship devices, the Nexus 4 and the Nexus 10, both of which were sold direct by Google on the Play Store. The Nexus 4 applied the Nexus 7 strategy of a quality device at a shockingly low price and sold for $300 unlocked. The Nexus 4 had a quad-core 1.5 GHz Snapdragon S4 Pro, 2GB of RAM and a 4.7-inch 1280×768 LCD. Google's new flagship phone was manufactured by LG, and with the manufacturer switch came a focus on materials and build quality. The Nexus 4 had a glass front and back, and while you couldn't drop it, it was one of the nicest-feeling Android phones to date. The biggest downside to the Nexus 4 was the lack of LTE at a time when most phones, including the Verizon Galaxy Nexus, came with the faster modem. Still, demand for the Nexus 4 greatly exceeded Google's expectations—the launch rush crashed the Play Store Web site on launch day. The device sold out in under an hour. - -The Nexus 10 was Google's first 10-inch Nexus tablet. The highlight of the device was the 2560×1600 display, which was the highest resolution in its class. All those pixels were powered by a dual core, 1.7GHz Cortex A15 processor and 2GB of RAM. With each passing month, it's looking more and more like the Nexus 10 is the first and last 10-inch Nexus tablet. Usually these devices are upgraded every year, but the Nexus 10 is now 16 months old, and there's no sign of the new model on the horizon. Google is doing well with smaller-sized 7-inch tablets, and it seems content to let partners [like Samsung][1] explore the larger end of the tablet spectrum. - -![The new lock screen, wallpaper, and clock widget design.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/JBvsjb.jpg) -The new lock screen, wallpaper, and clock widget design. -Photo by Ron Amadeo - -4.2 brought lots of changes to the lock screen. The font was centered and used an extremely thick weight for the hour and a thin font for the minutes. The lock screen was now paginated and could be customized with widgets. Rather than a simple clock on the lock screen, users could replace it with another widget or add extra pages to the lock screen for more widgets. - -![The lock screen's add widget page, the list of widgets, the Gmail widget on the lock screen, and swiping over to the camera.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/locksc2reen.jpg) -The lock screen's add widget page, the list of widgets, the Gmail widget on the lock screen, and swiping over to the camera. -Photo by Ron Amadeo - -The lock screen now worked like a stripped-down version of the home screen. Page outlines would pop up on the left and right sides of the lock screen to hint to users that they could swipe to other pages with other widgets. Swiping to the left would show a simple blank page with a plus sign in the center, and tapping on it would bring up a list of widgets that were compatible with the lock screen. Lock screens were limited to one widget per page and could be expanded or collapsed by dragging up or down on the widget. The right-most page was reserved for the camera—a simple over would open the camera interface, but you weren't able to swipe back. - -![The new Quick Settings panel and a composite image of the app lineup.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/42fix.png) -The new Quick Settings panel and a composite image of the app lineup. -Photo by Ron Amadeo - -One of the biggest additions to 4.2 was the new "Quick Settings" panel. Android 3.0 brought a way to quickly change power settings to tablets, and 4.2 finally brought that ability to phones. A new icon was added to the top right corner of the notification panel that would switch between the normal list of notifications and the new quick settings screen. Quick Settings offered faster access to screen brightness, network connections, and battery and data usage without having to dig through the full settings screen. The top level settings button in Android 4.1 was removed, and a square was added to the Quick Settings screen for it. - -There were lots of changes to the app drawer and 4.2's lineup of apps and icons. Thanks to the wider aspect ratio of the Nexus 4 (5:3 vs 16:9 on the Galaxy Nexus), the app drawer on that device could now show a five-wide grid of icons. 4.2 replaced the stock browser with Google Chrome and the stock calendar with Google Calendar, both of which brought new icon designs. The Clock and Camera apps were revamped in 4.2, and new icons were part of the deal. "Google Settings" was a new app that offered shortcuts to all the existing Google Account settings around the OS, and it had a unified look with Google Search and the new Google+ icon. Google Maps got a new icon, and Google Latitude, which was part of Google Maps, was retired in favor of Google+ location. - -![The browser was replaced with Chrome, and the new camera interface with a full screen viewfinder.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/chroemcam.jpg) -The browser was replaced with Chrome, and the new camera interface with a full screen viewfinder. -Photo by Ron Amadeo - -The stock browser did its best Chrome imitation for a while—it took many cues from Chrome’s interface, many Chrome features, and was even using Chrome’s javascript engine—but by the time Android 4.2 rolled around, Google deemed the Android version of Chrome ready to replace the imitator. On the surface, it didn't seem like much of a difference; the interface looked different, and early versions of Chrome for Android didn't scroll as smoothly as the stock browser. Under the hood, though, everything was different. Development of Android's main browser was now handled by the Google Chrome team instead of being a side project of the Android team. Android's default browser moved from being a stagnant app tied to Android releases to a Play Store app that was continually updated. Today there is even a beta channel that receives several updates per month. - -The camera interface was redesigned. It was now a completely full-screen app, showing a live view of the camera and places controls on top of it. The layout aesthetic had a lot in common with the [camera design][2] of Android 1.5: minimal controls with a focus on the viewfinder output. The circle of controls in the center appeared when you either held your finger on the screen or pressed the circle icon in the bottom right corner. When holding your finger down, you could slide around to pick the options around the circle, often expanding out into a sub-menu. Releasing over a highlighted item would select it. This was clearly inspired by the Quick Controls in the Android 4.0 browser, but arranging the options in a circle meant your finger was almost always blocking part of the interface. - -![The clock app, which went from a two-screen app to a feature-packed, useful application.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/clock-1.jpg) -The clock app, which went from a two-screen app to a feature-packed, useful application. -Photo by Ron Amadeo - -The clock application was completely revamped, going from a simple two-screen alarm clock to a world clock, alarm, timer, and stopwatch. The clock app design was like nothing Google introduced before, with an ultra-minimal aesthetic and red highlights. It seemed to be an experiment for Google. Even several versions later, this design language seemed to be confined only to this app. - -The clock's time picker was particularly well-designed. It showed a simple number pad, and it would intelligently disable numbers that would result in an invalid time. It was also impossible to set an alarm time without implicitly selecting AM or PM, forever solving the problem of accidentally setting an alarm for 9pm instead of 9am. - -![The new system UI for tablets used a stretched-out phone interface.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/tablet2.jpg) -The new system UI for tablets used a stretched-out phone interface. -Photo by Ron Amadeo - -The most controversial change in Android 4.2 was made to the tablet UI, which switched from a unified single bottom system bar to a two-bar interface with a top status bar and bottom system bar. The new design unified the phone and tablet interfaces, but critics said it was a waste of space to stretch the phone interface to a 10-inch landscape tablet. Since the navigation buttons had the whole bottom bar to themselves now, they were centered, just like the phone interface. - -![Multiple users on a tablet, and the new gesture-driven keyboard.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/2014-03-06-14.55.png) -Multiple users on a tablet, and the new gesture-driven keyboard. -Photo by Ron Amadeo - -On tablets, Android 4.2 brought support for multiple users. In the settings, a "Users" section was added, where you could manage users on a device. Setup was done from within each user account, where Android would keep separate settings, home screens, apps, and app data for each user. - -4.2 also added a new keyboard with swiping abilities. Rather than just tapping each individual letter, users could now keep a finger on the screen the whole time and just slide from letter to letter to type. - ----------- - -![Ron Amadeo](http://cdn.arstechnica.net/wp-content//uploads/authors/ron-amadeo-sq.jpg) - -[Ron Amadeo][a] / Ron is the Reviews Editor at Ars Technica, where he specializes in Android OS and Google products. He is always on the hunt for a new gadget and loves to rip things apart to see how they work. - -[@RonAmadeo][t] - --------------------------------------------------------------------------------- - -via: http://arstechnica.com/gadgets/2014/06/building-android-a-40000-word-history-of-googles-mobile-os/22/ - -译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[1]:http://arstechnica.com/gadgets/2014/01/hands-on-with-samsungs-notepro-and-tabpro-new-screen-sizes-and-magazine-ui/ -[2]:http://cdn.arstechnica.net/wp-content/uploads/2013/12/device-2013-12-26-11016071.png -[a]:http://arstechnica.com/author/ronamadeo -[t]:https://twitter.com/RonAmadeo diff --git a/translated/talk/The history of Android/22 - The history of Android.md b/translated/talk/The history of Android/22 - The history of Android.md new file mode 100644 index 0000000000..aabe79cfa1 --- /dev/null +++ b/translated/talk/The history of Android/22 - The history of Android.md @@ -0,0 +1,84 @@ +安卓编年史 +================================================================================ +### Android 4.2,果冻豆——全新 Nexus 设备,全新平板界面 ### + +安卓平台成熟的脚步越来越快,谷歌也将越来越多的应用托管到 Play 商店,需要通过系统更新来更新的应用越来越少。但是不间断的更新还是要继续的,2012 年 11 月,安卓 4.2 发布。4.2 还是叫做“果冻豆”,这个版本主要是一些少量变动。 + +![LG 生产的 Nexus 4 和三星生产的 Nexus 10。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/unnamed.jpg) +LG 生产的 Nexus 4 和三星生产的 Nexus 10。 +Google/Ron Amadeo 供图 + +和安卓 4.2 一同发布的还有两部旗舰设备,Nexus 4 和 Nexus 10,都由谷歌直接在 Play 商店出售。Nexus 4 使用了 Nexus 7 的策略,令人惊讶的低价和高质量,并且无锁设备售价 300 美元。Nexus 4 有一个 4 核 1.5GHz 骁龙 S4 Pro 处理器,2GB 内存以及 1280×768 分辨率 4.7 英寸 LCD 显示屏。谷歌的新旗舰手机由 LG 生产,并和制造商一起将关注点转向了材料和质量。Nexus 4 有着正反两面双面玻璃,这会让你爱不释手,他是有史以来触感最佳的安卓手机之一。Nexus 4 最大的缺点是没有 LTE 支持,那时候大部分手机,包括 Version Galaxy Nexus 都有更快的基带。但 Nexus 4 的需求仍大大超出了谷歌的预料——发布当日大量的流量拖垮了 Play 商店网站。手机在一小时之内销售一空。 + +Nexus 10 是谷歌的第一部 10 英寸 Nexus 平板。该设备的亮点是 2560×1600 分辨率的显示屏,在其等级上是分辨率最高的。这背后是双核 1.7GHz Cortex A15 处理器和 2GB 内存的强力支持。随着时间一个月一个月地流逝,Nexus 10 似乎逐渐成为了第一部也是最后一部 10 英寸 Nexus 平板。通常这些设备每年都升级,但 Nexus 10 至今面世 16 个月了,可预见的未来还没有新设备的迹象。谷歌在小尺寸的 7 英寸平板上做得很出色,它似乎更倾向于让[像三星][1]这样的合作伙伴探索更大的平板家族。 + +![新的锁屏,壁纸,以及时钟小部件设计。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/JBvsjb.jpg) +新的锁屏,壁纸,以及时钟小部件设计。 +Ron Amadeo 供图 + +4.2 为锁屏带来了很多变化。文字居中,并且对小时使用了较大的字重,对分钟使用了较细的字体。锁屏现在是分页的,可以自定义小部件。锁屏不仅仅是一个简单的时钟,用户还可以将其替换成其它小部件或者添加额外的页面和更多的小部件。 + +![锁屏的添加小部件页面,小部件列表,锁屏上的 Gmail 部件,以及滑动到相机。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/locksc2reen.jpg) +锁屏的添加小部件页面,小部件列表,锁屏上的 Gmail 部件,以及滑动到相机。 +Ron Amadeo 供图 + +锁屏现在就像是一个精简版的主屏幕。页面轮廓会显示在锁屏的左右两侧来提示用户可以滑动到有其他小部件的页面。向左滑动页面会显示一个中间带有加号的简单空白页面,点击加号会打开兼容锁屏的小部件列表。锁屏每个页面限制一个小部件,将小部件向上或向下拖动可以展开或收起。最右侧的页面保留给了相机——一个简单的滑动就能打开相机界面,但是你没办法滑动回来。 + +![新的快速设置面板以及内置应用集合。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/42fix.png) +新的快速设置面板以及内置应用集合。 +Ron Amadeo 供图 + +4.2 最大的新增特性之一就是“快速设置”面板。安卓 3.0 为平板引入了快速改变电源设置的途径,4.2 终于将这种能力带给了手机。通知中心右上角加入了一枚新图标,可以在正常的通知列表和新的快速设置之间切换。快速设置提供了对屏幕亮度,网络连接,电池以及数据用量更加快捷的访问,而不用打开完整的设置界面。安卓 4.1 中顶部的设置按钮移除掉了,快速设置中添加了一个按钮来替代它。 + +应用抽屉和 4.2 中的应用阵容有很多改变。得益于 Nexus 4 更宽的屏幕横纵比(5:3,Galaxy Nexus 是 16:9),应用抽屉可以显示一行五个应用图标的方阵。4.2 将自带的浏览器替换为了 Google Chrome,自带的日历换成了 Google Calendar,他们都带来了新的图标设计。时钟和相机应用在 4.2 中经过了重制,新的图标也是其中的一部分。“Google Settings”是个新应用,用于提供对系统范围内所有存在的谷歌账户设置的快捷方式,它有着和 Google Search 和 Google+ 图标一致的风格。谷歌地图拥有了新图标,谷歌纵横,以往是谷歌地图的一部分,作为对 Google+ location 的支持在这个版本退役。 + +![浏览器替换为 Chrome,带有全屏取景器的新相机界面。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/chroemcam.jpg) +浏览器替换为 Chrome,带有全屏取景器的新相机界面。 +Ron Amadeo 供图 + +原自带浏览器在一段时间内对 Chrome 的模仿上下了不少功夫——它引入了许多 Chrome 的界面元素,许多 Chrome 的特性,甚至还使用了 Chrome 的 javascript 引擎——但安卓 4.2 来临的时候,谷歌认为安卓版的 Chrome 已经准备好替代这个模仿者了。表面上看起来没有多大不同;界面看起来不一样,而且早期版本的 Chrome 安卓版滚动起来没有原浏览器顺畅。不过深层次来说,一切都不一样。安卓的主浏览器开发现在由 Google Chrome 团队负责,而不是作为安卓团队的子项目存在。安卓的默认浏览器从绑定安卓版本发布停滞不前的应用变成了不断更新的 Play 商店应用。现在甚至还有一个每个月接收一些更新的 beta 通道。 + +相机界面经过了重新设计。它现在完全是个全屏应用,显示摄像头的实时图像并且在上面显示控制选项。布局审美和安卓 1.5 的[相机设计][2]有很多共同之处:带对焦的最小化的控制放置在取景器显示之上。中间的控制环在你长按屏幕或点击右下角圆形按钮的时候显示。你的手指保持在屏幕上时,你可以滑动来选择环上的选项,通常是展开进入一个子菜单。在高亮的选项上释放手指选中它。这灵感很明显来自于安卓 4.0 浏览器中的快速控制,但是将选项安排在一个环上意味着你的手指几乎总会挡住一部分界面。 + +![时钟应用,从一个只有两个界面的应用变成功能强大,实用的应用。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/clock-1.jpg) +时钟应用,从一个只有两个界面的应用变成功能强大,实用的应用。 +Ron Amadeo 供图 + +时钟应用经过了完整的改造,从一个简单的两个界面的闹钟,到一个世界时钟,闹钟,定时器,以及秒表俱全。时钟应用的设计和谷歌之前引入的完全不同,有着极简审美和红色高亮。它看起来像是谷歌的一个试验。甚至是几个版本之后,这个设计语言似乎也仅限于这个应用。 + +时钟的时间选择器是经过特别精心设计的。它显示一个简单的数字盘,会智能地禁用会导致无效时间的数字。设置闹钟时间也不可能没有隐式选择选择的 AM 和 PM,永远地解决了不小心将 9am 的闹钟设置成 9pm 的问题。 + +![平板的新系统界面使用了延展版的手机界面。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/tablet2.jpg) +平板的新系统界面使用了延展版的手机界面。 +Ron Amadeo 供图 + +安卓 4.2 中最有争议的改变是平板界面,从单独一个统一的底部系统栏变成带有顶部状态栏和底部系统栏的双栏设计。新设计统一了手机和平板的界面,但批评人士说将手机界面延展到 10 英寸的横向平板上是浪费空间。因为导航按键现在拥有了整个底栏,所以他们像手机界面那样被居中。 + +![平板上的多用户,以及新的手势键盘。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/2014-03-06-14.55.png) +平板上的多用户,以及新的手势键盘。 +Ron Amadeo 供图 + +在平板上,安卓 4.2 带来了多用户支持。在设置里,新增了“用户”部分,你可以在这里管理一台设备上的用户。设置在每个用户账户内完成,安卓会给每个用户保存单独的设置,主屏幕,应用以及应用数据。 + +4.2 还添加了有滑动输入能力的键盘。用户可以将手指一直保持在屏幕上,按顺序在字母按键上滑动来输入,而不用像以前那样一个一个字母单独地输入。 + +---------- + +![Ron Amadeo](http://cdn.arstechnica.net/wp-content//uploads/authors/ron-amadeo-sq.jpg) + +[Ron Amadeo][a] / Ron是Ars Technica的评论编缉,专注于安卓系统和谷歌产品。他总是在追寻新鲜事物,还喜欢拆解事物看看它们到底是怎么运作的。 + +[@RonAmadeo][t] + +-------------------------------------------------------------------------------- + +via: http://arstechnica.com/gadgets/2014/06/building-android-a-40000-word-history-of-googles-mobile-os/22/ + +译者:[alim0x](https://github.com/alim0x) 校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[1]:http://arstechnica.com/gadgets/2014/01/hands-on-with-samsungs-notepro-and-tabpro-new-screen-sizes-and-magazine-ui/ +[2]:http://cdn.arstechnica.net/wp-content/uploads/2013/12/device-2013-12-26-11016071.png +[a]:http://arstechnica.com/author/ronamadeo +[t]:https://twitter.com/RonAmadeo From 7114caea17111b6315cc7a83141b3f443f896f86 Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 2 Mar 2016 09:14:21 +0800 Subject: [PATCH 0466/1469] =?UTF-8?q?20160302-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ommercial Software Built On Open Source.md | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 sources/tech/20160301 The Evolving Market for Commercial Software Built On Open Source.md diff --git a/sources/tech/20160301 The Evolving Market for Commercial Software Built On Open Source.md b/sources/tech/20160301 The Evolving Market for Commercial Software Built On Open Source.md new file mode 100644 index 0000000000..85ba752bfa --- /dev/null +++ b/sources/tech/20160301 The Evolving Market for Commercial Software Built On Open Source.md @@ -0,0 +1,40 @@ +The Evolving Market for Commercial Software Built On Open Source +===================================================================== + +![](https://www.linux.com/images/stories/41373/Structure-event-photo.jpg) +>Attendees listen to a presentation during Structure at the UCSF Mission Bay Conference Center, where Structure Data 2016 will take place. Image credit: Structure Events. + +It's really hard to understate the impact of open source projects on the enterprise software market these days; open source integration became the norm so quickly we could be forgiven for missing the turning point. + +Hadoop, for example, changed more than just the world of data analysis. It gave rise to a new generation of data companies that created their own software around open source projects, tweaking and supporting that code as needed, much like how Red Hat embraced Linux in the 1990s and early 2000s. And this software is increasingly delivered over public clouds, rather than run on the buyer's own servers, enabling an amazing degree of operational flexibility but raising all sorts of new questions about licensing, support, and pricing. + +We've been following this closely over the years when putting together the lineup for our Structure Data conference, and Structure Data 2016 is no exception. The CEOs of three of the most important companies in big data operating around Hadoop -- Hortonworks, Cloudera and MapR -- will share the stage to discuss how they sell enterprise software and services around open source projects, generating cash while giving back to that community project at the same time. + +There was a time when making money on enterprise software was easier. Once purchased by a customer, a mega-package of software from an enterprise vendor turned into its own cash register, generating something close to lifetime income from maintenance contracts and periodic upgrades to software that became harder and harder to displace as it became the heart of a customer’s business. Customers grumbled about lock-in, but they didn't really have much of a choice if they wanted to make their workforce more productive. + +That is no longer the case. While an awful lot of companies are still stuck running immense software packages critical to their infrastructure, new projects are being deployed on cloud servers using open source technologies. This makes it much easier to upgrade one's capabilities without having to rip out a huge software package and reinstall something else, and it also allows companies to pay as they go, rather than paying for a bunch of features they'll never use. + +And there are a lot of customers who want to take advantage of open source projects without building and supporting a team of engineers to tweak one of those projects for their own unique needs. Those customers are willing to pay for software packages whose value is based on the delta between the open source projects and the proprietary features laid on top of that project. + +This is especially true for infrastructure-related software. Sure, your customers could install their own tweaks to a project like Hadoop or Spark or Node.js, but there's money to be made helping those customers out with a customizable package that lets them implement some of today's vital open source technologies without having to do all of the heavy lifting themselves. Just look at Structure Data 2016 presenters such as Confluent (Kafka), Databricks (Spark), and the Cloudera-Hortonworks-MapR (Hadoop) trio. + +There's certainly something to be said for having a vendor to yell at when things go wrong. If your engineers botch the implementation of an open source project, you've only yourself to blame. But If you contract with a company that is willing to guarantee certain performance and uptime metrics inside of a service-level agreement, you're willing to pay for support, guidance, and a chance to yell at somebody outside of your organization when inevitable problems crop up. + +The evolving market for commercial software on top of open source projects is something we've been tracking at Structure Data for years, and we urge you to join us in San Francisco March 9 and 10 if this is a topic near and dear to your heart. + + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/enterprise/cloud-computing/889564-the-evolving-market-for-commercial-software-built-on-open-source- + +作者:[Tom Krazit ][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/community/forums/person/70513 + + + + From 6eaeac207dccfd4d3dce37fa5e13b0b3d0555f65 Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 2 Mar 2016 09:20:47 +0800 Subject: [PATCH 0467/1469] =?UTF-8?q?20160302-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ites Imperiled by New Decryption Attack.md | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 sources/tech/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md diff --git a/sources/tech/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md b/sources/tech/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md new file mode 100644 index 0000000000..3c73120fa4 --- /dev/null +++ b/sources/tech/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md @@ -0,0 +1,26 @@ +More than 11 Million HTTPS Websites Imperiled by New Decryption Attack +=========================================================================== + +![](https://www.linux.com/images/stories/66866/drown-explainer.jpg) + +Low-cost DROWN attack decrypts data in hours, works against TLS e-mail servers, too. + +More than 11 million websites and e-mail services protected by the [transport layer security protocol[[1] are vulnerable to a newly discovered, low-cost attack that decrypts sensitive communications in a matter of hours and in some cases almost immediately, an international team of researchers warned Tuesday. More than 81,000 of the top 1 million most popular Web properties are among the vulnerable HTTPS-protected sites. + +The attack works against TLS-protected communications that rely on the [RSA cryptosystem][2] when the key is exposed even indirectly through SSLv2, a TLS precursor that was retired almost two decades ago because of crippling weaknesses. The vulnerability allows an attacker to decrypt an intercepted TLS connection by repeatedly using SSLv2 to make connections to a server. + + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/software/applications/889455--more-than-11-million-https-websites-imperiled-by-new-decryption-attack + +作者:[ArsTechnica][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/community/forums/person/112 +[1]: https://en.wikipedia.org/wiki/Transport_Layer_Security +[2]: https://en.wikipedia.org/wiki/RSA_(cryptosystem) + From 8dbeefa384f670487801e13a56e8132c5bee2e42 Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 2 Mar 2016 09:26:10 +0800 Subject: [PATCH 0468/1469] =?UTF-8?q?20160302-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...n IoT Development Suite, is now Zerynth.md | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 sources/tech/20160301 Viper, the Python IoT Development Suite, is now Zerynth.md diff --git a/sources/tech/20160301 Viper, the Python IoT Development Suite, is now Zerynth.md b/sources/tech/20160301 Viper, the Python IoT Development Suite, is now Zerynth.md new file mode 100644 index 0000000000..40a601a71e --- /dev/null +++ b/sources/tech/20160301 Viper, the Python IoT Development Suite, is now Zerynth.md @@ -0,0 +1,34 @@ +Viper, the Python IoT Development Suite, is now Zerynth +============================================================ + + +![](http://www.open-electronics.org/wp-content/uploads/2016/02/Logo_Zerynth-636x144.png) + + +The startup that launched the tools to develop embedded solutions in Python language announced the brand change along with the first official release. + +>Exactly one year after the Kickstarter launch of the suite for developing Internet of Things solutions in Python language, **Viper becomes Zerynth**. It is definitely a big day for the startup that created a radically new way to approach the world of microcontrollers and connected devices, making professionals and makers able to design interactive solutions with reduced efforts and shorter time. + +>“We really believe in the uniqueness of our tools, this is why they deserve an adequate recognition. Viper was a great name for a product, but other notable companies had the same feeling many decades ago, with the result that this term was shared with too many other actors out there. We are grown now, and ready to take off fast and light, like the design processes that our tools are enabling”, says the Viper (now Zerynth), co-founders. + +>**Thousands of users** developed amazing connected solutions in just 9 months of life in Beta version. Built to be cross-platform, Zerynth’s tools are meant for high-level design of Internet/cloud-connected devices, interactive objects, artistic installations. They are: **Zerynth Studio**, a browser-based IDE for programming embedded devices in Python with cloud sync and board management features; **Zerynth Virtual Machine**: a multithreaded real-time OS that provides real hardware independence allowing code reuse on the entire ARM architecture; **Zerynth App**, a general purpose interface that turns any mobile into the controller and display for smart objects and IoT systems. + +>This modular set of tools, adaptable to different hardware and cloud infrastructures, can dramatically reduce the time to market and the overall development costs for makers, professionals and companies. + +>Now Zerynth celebrates its new name launching the **first official release** of the toolkit. Check it here [www.zerynth.com][1] + +![](http://www.open-electronics.org/wp-content/uploads/2016/02/Zerynth-Press-Release_Studio-Img-768x432.png) + +-------------------------------------------------------------------------------- + +via: http://www.open-electronics.org/viper-the-python-iot-development-suite-is-now-zerynth/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+OpenElectronics+%28Open+Electronics%29 + +作者:[Staff ][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.open-electronics.org/author/staff/ +[1]: http://www.zerynth.com/ + From 5ffe9ac893bc91d5996bbdc8be64701693d7ab8a Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 2 Mar 2016 09:32:22 +0800 Subject: [PATCH 0469/1469] =?UTF-8?q?20160302-4=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...-Signatures-Using-SHA-256512 Algorithms.md | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 sources/news/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md diff --git a/sources/news/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md b/sources/news/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md new file mode 100644 index 0000000000..d40a1c9e6f --- /dev/null +++ b/sources/news/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md @@ -0,0 +1,32 @@ +OpenSSH 7.2 Out Now with Support for RSA Signatures Using SHA-256/512 Algorithms +======================================================== + +**Today, February 29, 2016, the OpenBSD project had the great pleasure of announcing the release and immediate availability for download of OpenSSH 7.2 for all supported platforms.** + +According to the internal [release notes][1], also attached at the end of the article for reference, OpenSSH 7.2 is primarily a bugfix release, fixing most of the issues reported by users or discovered by the development team since the release of OpenSSH 7.1p2, but we can see several new features as well. + +Among these, we can mention support for RSA signatures using SHA-256 or SHA-256 512 hash algorithms, the addition of an AddKeysToAgent client option to add private keys used for authentication to the ssh-agent, and the implementation of the "restrict" authorized_keys option for storing key restrictions. + +Furthermore, there's now an ssh_config CertificateFile option for explicitly listing certificates, the ssh-keygen is now capable of changing the key comment for all supported formats, fingerprinting is now allowed from standard input and for multiple public keys in a file. + +### ssh-keygen now supports multiple certificates + +In addition to the changes mentioned above, OpenSSH 7.2 adds support for multiple certificates to ssh-keygen, one per line, implements the "none" argument for sshd_config ChrootDirectory and Foreground, and the "-c" flag allows ssh-keyscan to fetch certificates instead of plain keys. + +Last but not least, OpenSSH 7.2 no longer enables by default all flavors of the rijndael-cbc aliases for AES, blowfish-cbc, and cast128-cbc legacy ciphers, as well as MD5-based and truncated HMAC algorithms. The getrandom() syscall is now supported under Linux. [Download OpenSSH 7.2][2] and check the changelog below for some additional details about exactly what has been fixed in this major release. + + + +-------------------------------------------------------------------------------- + +via: http://news.softpedia.com/news/openssh-7-2-out-now-with-support-for-rsa-signatures-using-sha-256-512-algorithms-501111.shtml + +作者:[Marius Nestor][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://news.softpedia.com/editors/browse/marius-nestor +[1]: http://www.openssh.com/txt/release-7.2 +[2]: http://linux.softpedia.com/get/Security/OpenSSH-4474.shtml From d6bb51f8a4eda54c02b5af26662311215bdb9741 Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 2 Mar 2016 09:37:07 +0800 Subject: [PATCH 0470/1469] =?UTF-8?q?2060302-5=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ased ahead of impending OpenSSL updates.md | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 sources/news/20160229 Node.js 5.7 released ahead of impending OpenSSL updates.md diff --git a/sources/news/20160229 Node.js 5.7 released ahead of impending OpenSSL updates.md b/sources/news/20160229 Node.js 5.7 released ahead of impending OpenSSL updates.md new file mode 100644 index 0000000000..659df2e1f3 --- /dev/null +++ b/sources/news/20160229 Node.js 5.7 released ahead of impending OpenSSL updates.md @@ -0,0 +1,42 @@ +Node.js 5.7 released ahead of impending OpenSSL updates +============================================================= + +![](http://images.techhive.com/images/article/2014/09/nodejs-100449932-primary.idge.jpg) + +>Once again, OpenSSL fixes must be evaluated by keepers of the popular server-side JavaScript platform + +The Node.js Foundation is gearing up this week for fixes to OpenSSL that could mean updates to Node.js itself. + +Releases to OpenSSL due on Tuesday will fix defects deemed to be of "high" severity, Rod Vagg, foundation technical steering committee director, said [in a blog post][1] on Monday. Within a day of the OpenSSL releases, the Node.js crypto team will assess their impacts, saying, "Please be prepared for the possibility of important updates to Node.js v0.10, v0.12, v4 and v5 soon after Tuesday, the 1st of March." + +[ Deep Dive: [How to rethink security for the new world of IT][2]. | Discover how to secure your systems with InfoWorld's [Security newsletter][3]. ] + +The high severity status actually means the issues are of lower risks than critical, perhaps affecting less-common configurations or less likely to be exploitable. Due to an embargo, the exact nature of these fixes and their impact on Node.js remain uncertain, said Vagg. "Node.js v0.10 and v0.12 both use OpenSSL v1.0.1, and Node.js v4 and v5 both use OpenSSL v1.0.2, and releases from nodejs.org and some other popular distribution sources are statically compiled. Therefore, all active release lines are impacted by this update." OpenSSL also impacted Node.js in December, [when two critical vulnerabilities were fixed][4]. + +The latest OpenSSL developments follow [the release of Node.js 5.7.0][5], which is clearing a path for the upcoming Node.js 6. Version 5 is the main focus for active development, said foundation representative Mikeal Rogers, "However, v5 won't be supported long-term, and most users will want to wait for v6, which will be released by the end of April, for the new features that are landing in v5." + +Release 5.7 has more predictability for C++ add-ons' interactions with JavaScript. Node.js can invoke JavaScript code from C++ code, and in version 5.7, the C++ node::MakeCallback() API is now re-entrant; calling it from inside another MakeCallback() call no longer causes the nextTick queue or Promises microtask queue to be processed out of order, [according to release notes][6]. + +Also fixed is an HTTP bug where handling headers mistakenly trigger an "upgrade" event where the server just advertises protocols. The bug can prevent HTTP clients from communicating with HTTP2-enabled servers. Version 5.7 performance improvements are featured in the path, querystring, streams, and process.nextTick modules. + +This story, "Node.js 5.7 released ahead of impending OpenSSL updates" was originally published by [InfoWorld][7]. + + +-------------------------------------------------------------------------------- + +via: http://www.itworld.com/article/3039005/security/nodejs-57-released-ahead-of-impending-openssl-updates.html + +作者:[Paul Krill][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/Paul-Krill/ +[1]: https://nodejs.org/en/blog/vulnerability/openssl-march-2016/ +[2]: http://www.infoworld.com/resources/17273/security-management/how-to-rethink-security-for-the-new-world-of-it#tk.ifw-infsb +[3]: http://www.infoworld.com/newsletters/signup.html#tk.ifw-infsb +[4]: http://www.infoworld.com/article/3012157/security/why-nodejs-waited-for-openssl-security-update-before-patching.html +[5]: https://nodejs.org/en/blog/release/v5.7.0/ +[6]: https://nodejs.org/en/blog/release/v5.7.0/ +[7]: http://www.infoworld.com/ From 243529de979ed767d7de22befc6c2bc3786528b7 Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 2 Mar 2016 10:31:06 +0800 Subject: [PATCH 0471/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=EF=BC=8C?= =?UTF-8?q?=E5=BA=94=E8=AF=A5=E6=94=BE=E5=88=B0news=20=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... HTTPS Websites Imperiled by New Decryption Attack.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) rename sources/{tech => news}/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md (59%) diff --git a/sources/tech/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md b/sources/news/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md similarity index 59% rename from sources/tech/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md rename to sources/news/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md index 3c73120fa4..6d9ae7f4e9 100644 --- a/sources/tech/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md +++ b/sources/news/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md @@ -1,21 +1,28 @@ More than 11 Million HTTPS Websites Imperiled by New Decryption Attack + +超过一千万个使用 https 的站点有可能收到新型的加密攻击的影响 =========================================================================== ![](https://www.linux.com/images/stories/66866/drown-explainer.jpg) Low-cost DROWN attack decrypts data in hours, works against TLS e-mail servers, too. +低成本的淹没攻击会在几个小时内完成解密操作,同时这也不利于采用了 TLS 的邮件服务器。 + More than 11 million websites and e-mail services protected by the [transport layer security protocol[[1] are vulnerable to a newly discovered, low-cost attack that decrypts sensitive communications in a matter of hours and in some cases almost immediately, an international team of researchers warned Tuesday. More than 81,000 of the top 1 million most popular Web properties are among the vulnerable HTTPS-protected sites. +一个国际研究小组在周二发出的警告说,超过 1100 万的网站和邮件服务采用了[传输层安全协议][1],以此来保护自己的服务,而这些都是处于一个新发现的、低成本的攻击的威胁之下,这种攻击会在几个小时内解密敏感的通信,在某些情况下甚至是立即解密。 1 百万个最流行的网站中有超过 81,000 个就处于这些受到威胁的 HTTPS 协议保护之下。 + The attack works against TLS-protected communications that rely on the [RSA cryptosystem][2] when the key is exposed even indirectly through SSLv2, a TLS precursor that was retired almost two decades ago because of crippling weaknesses. The vulnerability allows an attacker to decrypt an intercepted TLS connection by repeatedly using SSLv2 to make connections to a server. +处于 TLS 保护的通信协议,依赖于 [RSA 加密系统][2],如果密钥被泄露了,即使是间接的通过 SSLv2 ——一种在 20 年前就因为自身缺陷而退休了的安全协议,也就是 TLS 的前辈协议——泄露也会处于这种新型攻击的威胁之下。这种危险性在于允许一个入侵者通过反复的使用 SSLv2 来连接到服务器,可以解密一个被中途拦截下来的 TLS 连接。 -------------------------------------------------------------------------------- via: https://www.linux.com/news/software/applications/889455--more-than-11-million-https-websites-imperiled-by-new-decryption-attack 作者:[ArsTechnica][a] -译者:[译者ID](https://github.com/译者ID) +译者:[Ezio](https://github.com/oska874) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c0a8fa7b54d4eca685570cda7ca39beea7863a36 Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 2 Mar 2016 10:32:30 +0800 Subject: [PATCH 0472/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= =?UTF-8?q?=EF=BC=8C=E6=94=BE=E5=88=B0=20translated?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...lion HTTPS Websites Imperiled by New Decryption Attack.md | 5 ----- 1 file changed, 5 deletions(-) rename {sources => translated}/news/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md (66%) diff --git a/sources/news/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md b/translated/news/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md similarity index 66% rename from sources/news/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md rename to translated/news/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md index 6d9ae7f4e9..cdc7d1b7ae 100644 --- a/sources/news/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md +++ b/translated/news/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md @@ -1,19 +1,14 @@ -More than 11 Million HTTPS Websites Imperiled by New Decryption Attack - 超过一千万个使用 https 的站点有可能收到新型的加密攻击的影响 =========================================================================== ![](https://www.linux.com/images/stories/66866/drown-explainer.jpg) -Low-cost DROWN attack decrypts data in hours, works against TLS e-mail servers, too. 低成本的淹没攻击会在几个小时内完成解密操作,同时这也不利于采用了 TLS 的邮件服务器。 -More than 11 million websites and e-mail services protected by the [transport layer security protocol[[1] are vulnerable to a newly discovered, low-cost attack that decrypts sensitive communications in a matter of hours and in some cases almost immediately, an international team of researchers warned Tuesday. More than 81,000 of the top 1 million most popular Web properties are among the vulnerable HTTPS-protected sites. 一个国际研究小组在周二发出的警告说,超过 1100 万的网站和邮件服务采用了[传输层安全协议][1],以此来保护自己的服务,而这些都是处于一个新发现的、低成本的攻击的威胁之下,这种攻击会在几个小时内解密敏感的通信,在某些情况下甚至是立即解密。 1 百万个最流行的网站中有超过 81,000 个就处于这些受到威胁的 HTTPS 协议保护之下。 -The attack works against TLS-protected communications that rely on the [RSA cryptosystem][2] when the key is exposed even indirectly through SSLv2, a TLS precursor that was retired almost two decades ago because of crippling weaknesses. The vulnerability allows an attacker to decrypt an intercepted TLS connection by repeatedly using SSLv2 to make connections to a server. 处于 TLS 保护的通信协议,依赖于 [RSA 加密系统][2],如果密钥被泄露了,即使是间接的通过 SSLv2 ——一种在 20 年前就因为自身缺陷而退休了的安全协议,也就是 TLS 的前辈协议——泄露也会处于这种新型攻击的威胁之下。这种危险性在于允许一个入侵者通过反复的使用 SSLv2 来连接到服务器,可以解密一个被中途拦截下来的 TLS 连接。 From a9d0940aed3bc389317173edf15fdee5a76201e3 Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 2 Mar 2016 10:39:38 +0800 Subject: [PATCH 0473/1469] =?UTF-8?q?=E5=B7=B2=E6=A0=A1=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20160226 Development Release: Xubuntu 16.04 Beta 1.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/translated/news/20160226 Development Release: Xubuntu 16.04 Beta 1.md b/translated/news/20160226 Development Release: Xubuntu 16.04 Beta 1.md index 62e903018f..bae1ecccf8 100644 --- a/translated/news/20160226 Development Release: Xubuntu 16.04 Beta 1.md +++ b/translated/news/20160226 Development Release: Xubuntu 16.04 Beta 1.md @@ -1,9 +1,9 @@ Xubuntu 16.04 Beta 1 开发发布 ============================================ -Ubuntu 发布组已经宣布为了选定的社区版本准备的最新的 beta 测试镜像已经可以使用了。新的开发发布版名称是 16.04 beta 1,这个版本只推荐给测试人员,并不适合日常使用。 +Ubuntu 发布组宣布为选定的社区版本而准备的最新的 beta 测试镜像已经可以使用了。新的发布版名称是 16.04 beta 1 ,这个版本只推荐给测试人员测试用,并不适合普通人进行日常使用。 -“这个 beta 特性的镜像是为 [Lubuntu][1], Ubuntu Cloud, [Ubuntu GNOME][2], [Ubuntu MATE][3], [Ubuntu Kylin][4], [Ubuntu Studio][5] 和 [Xubuntu][6] 这几个发布版准备的。Xenial Xerus 的预发布版本并不推荐那些需要稳定版本的,或者那些不希望在系统运行中偶尔或频繁的出现 bug 的人。这个版本还是推荐给喜欢 ubuntu 的开发人员,以及那些想帮助着测试、报告和修改 bug,和我们一起工作让这个发布版本早日准备好。” 更多的信息可以从 [发布日志][7] 获取。 +“这个 beta 特性的镜像主要是为 [Lubuntu][1], Ubuntu Cloud, [Ubuntu GNOME][2], [Ubuntu MATE][3], [Ubuntu Kylin][4], [Ubuntu Studio][5] 和 [Xubuntu][6] 这几个发布版准备的。Xenial Xerus (LCTT 注: ubuntu 16.04 的开发代号) 的这个预发布版本并不推荐那些需要稳定版本的人员使用,同时那些不希望在系统运行中偶尔或频繁的出现 bug 的人也不建议使用这个版本。这个版本主要还是推荐给那些喜欢 ubuntu 的开发人员,以及那些想协助我们测试、报告 bug 和修改 bug 的人使用,和我们一起努力让这个发布版本早日准备就绪。” 更多的信息可以从 [发布日志][7] 获取。 -------------------------------------------------------------------------------- @@ -11,7 +11,7 @@ via: https://www.linux.com/news/software/applications/888731-development-release 作者:[DistroWatch][a] 译者:[Ezio](https://github.com/oska874) -校对:[校对者ID](https://github.com/校对者ID) +校对:[Ezio](https://github.com/oska874) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 84a9cd948715593113a28b135fd0e6c1bb65784a Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 2 Mar 2016 10:40:23 +0800 Subject: [PATCH 0474/1469] =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E5=87=86=E5=A4=87?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20160226 Development Release: Xubuntu 16.04 Beta 1.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/news => published}/20160226 Development Release: Xubuntu 16.04 Beta 1.md (100%) diff --git a/translated/news/20160226 Development Release: Xubuntu 16.04 Beta 1.md b/published/20160226 Development Release: Xubuntu 16.04 Beta 1.md similarity index 100% rename from translated/news/20160226 Development Release: Xubuntu 16.04 Beta 1.md rename to published/20160226 Development Release: Xubuntu 16.04 Beta 1.md From b342f53e0868c9db39bd70dc7898906e60e70999 Mon Sep 17 00:00:00 2001 From: runningwater Date: Wed, 2 Mar 2016 11:23:05 +0800 Subject: [PATCH 0475/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E4=B8=AD=20by=20ru?= =?UTF-8?q?nningwater?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- published/20160226 Development Release | 0 ... Viper, the Python IoT Development Suite, is now Zerynth.md | 3 ++- translated/news/20160226 Development Release | 0 3 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 published/20160226 Development Release create mode 100644 translated/news/20160226 Development Release diff --git a/published/20160226 Development Release b/published/20160226 Development Release new file mode 100644 index 0000000000..e69de29bb2 diff --git a/sources/tech/20160301 Viper, the Python IoT Development Suite, is now Zerynth.md b/sources/tech/20160301 Viper, the Python IoT Development Suite, is now Zerynth.md index 40a601a71e..f732382bc6 100644 --- a/sources/tech/20160301 Viper, the Python IoT Development Suite, is now Zerynth.md +++ b/sources/tech/20160301 Viper, the Python IoT Development Suite, is now Zerynth.md @@ -1,3 +1,4 @@ +(翻译中 by runningwater) Viper, the Python IoT Development Suite, is now Zerynth ============================================================ @@ -24,7 +25,7 @@ The startup that launched the tools to develop embedded solutions in Python lang via: http://www.open-electronics.org/viper-the-python-iot-development-suite-is-now-zerynth/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+OpenElectronics+%28Open+Electronics%29 作者:[Staff ][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/) 荣誉推出 diff --git a/translated/news/20160226 Development Release b/translated/news/20160226 Development Release new file mode 100644 index 0000000000..e69de29bb2 From bef55ccf97cb52b732672e3a88a51188d01ddae8 Mon Sep 17 00:00:00 2001 From: martin qi Date: Wed, 2 Mar 2016 23:57:24 +0800 Subject: [PATCH 0476/1469] =?UTF-8?q?=E6=A0=A1=E5=AF=B9=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 第一次校对,发布前再看看是否有错漏。 --- ...ites Imperiled by New Decryption Attack.md | 25 +++++++++++++++++ ...ites Imperiled by New Decryption Attack.md | 28 ------------------- 2 files changed, 25 insertions(+), 28 deletions(-) create mode 100644 published/news/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md delete mode 100644 translated/news/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md diff --git a/published/news/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md b/published/news/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md new file mode 100644 index 0000000000..d3270ac88e --- /dev/null +++ b/published/news/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md @@ -0,0 +1,25 @@ +逾千万使用 https 的站点受到新型解密攻击的威胁 +=========================================================================== + +![](https://www.linux.com/images/stories/66866/drown-explainer.jpg) + + +低成本的 DROWN 攻击能在数小时内完成数据解密,对采用了 TLS 的邮件服务器也同样奏效。 + +一国际研究小组于周二发出警告,据称逾 1100 万家网站和邮件服务采用的用以保证服务安全的[传输层安全协议][1],对于一种新发现的、成本低廉的攻击而言异常脆弱,这种攻击会在几个小时内解密敏感的通信,在某些情况下解密甚至能瞬间完成。 1 百万家最为流行的网站中有超过 81,000 家正处于这些脆弱的 HTTPS 协议的保护之下。 + +这种攻击主要针对受 TLS 保护、依赖于 [RSA 加密系统][2]的通信。如果密钥泄露了,即使是间接的由 SSLv2,一种在 20 年前就因为自身缺陷而退休了的 LTS 前辈。该漏洞允许攻击者,可以通过反复使用 SSLv2 创建与服务器连接的方式,解密截获的 TLS 连接。 + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/software/applications/889455--more-than-11-million-https-websites-imperiled-by-new-decryption-attack + +作者:[ArsTechnica][a] +译者:[Ezio](https://github.com/oska874) +校对:[martin2011qi](https://github.com/martin2011qi) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/community/forums/person/112 +[1]: https://en.wikipedia.org/wiki/Transport_Layer_Security +[2]: https://en.wikipedia.org/wiki/RSA_(cryptosystem) diff --git a/translated/news/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md b/translated/news/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md deleted file mode 100644 index cdc7d1b7ae..0000000000 --- a/translated/news/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md +++ /dev/null @@ -1,28 +0,0 @@ -超过一千万个使用 https 的站点有可能收到新型的加密攻击的影响 -=========================================================================== - -![](https://www.linux.com/images/stories/66866/drown-explainer.jpg) - - -低成本的淹没攻击会在几个小时内完成解密操作,同时这也不利于采用了 TLS 的邮件服务器。 - - -一个国际研究小组在周二发出的警告说,超过 1100 万的网站和邮件服务采用了[传输层安全协议][1],以此来保护自己的服务,而这些都是处于一个新发现的、低成本的攻击的威胁之下,这种攻击会在几个小时内解密敏感的通信,在某些情况下甚至是立即解密。 1 百万个最流行的网站中有超过 81,000 个就处于这些受到威胁的 HTTPS 协议保护之下。 - - -处于 TLS 保护的通信协议,依赖于 [RSA 加密系统][2],如果密钥被泄露了,即使是间接的通过 SSLv2 ——一种在 20 年前就因为自身缺陷而退休了的安全协议,也就是 TLS 的前辈协议——泄露也会处于这种新型攻击的威胁之下。这种危险性在于允许一个入侵者通过反复的使用 SSLv2 来连接到服务器,可以解密一个被中途拦截下来的 TLS 连接。 - --------------------------------------------------------------------------------- - -via: https://www.linux.com/news/software/applications/889455--more-than-11-million-https-websites-imperiled-by-new-decryption-attack - -作者:[ArsTechnica][a] -译者:[Ezio](https://github.com/oska874) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.linux.com/community/forums/person/112 -[1]: https://en.wikipedia.org/wiki/Transport_Layer_Security -[2]: https://en.wikipedia.org/wiki/RSA_(cryptosystem) - From 54c5c2f669f2b9d4a2b1c843467855996289da85 Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 3 Mar 2016 00:11:04 +0800 Subject: [PATCH 0477/1469] =?UTF-8?q?=E6=A0=A1=E5=AF=B9=E5=AE=8C=E6=88=90?= =?UTF-8?q?=EF=BC=8C=E8=AF=B7=E5=8F=91=E5=B8=83=E5=90=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...1 Million HTTPS Websites Imperiled by New Decryption Attack.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename published/{news => }/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md (100%) diff --git a/published/news/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md b/published/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md similarity index 100% rename from published/news/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md rename to published/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md From 91f16a64344aee942079e824c481bcbe57cd1902 Mon Sep 17 00:00:00 2001 From: FSSlc Date: Thu, 3 Mar 2016 00:36:53 +0800 Subject: [PATCH 0478/1469] [Translated]20151208 5 great Raspberry Pi projects for the classroom.md --- ...Raspberry Pi projects for the classroom.md | 98 ------------------- ...Raspberry Pi projects for the classroom.md | 98 +++++++++++++++++++ 2 files changed, 98 insertions(+), 98 deletions(-) delete mode 100644 sources/talk/yearbook2015/20151208 5 great Raspberry Pi projects for the classroom.md create mode 100644 translated/talk/yearbook2015/20151208 5 great Raspberry Pi projects for the classroom.md diff --git a/sources/talk/yearbook2015/20151208 5 great Raspberry Pi projects for the classroom.md b/sources/talk/yearbook2015/20151208 5 great Raspberry Pi projects for the classroom.md deleted file mode 100644 index 09423a6b8d..0000000000 --- a/sources/talk/yearbook2015/20151208 5 great Raspberry Pi projects for the classroom.md +++ /dev/null @@ -1,98 +0,0 @@ -FSSlc translating - -5 great Raspberry Pi projects for the classroom -================================================================================ -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/osdc-open-source-yearbook-lead3.png) - -Image by : opensource.com - -### 1. Minecraft Pi ### - -Courtesy of the Raspberry Pi Foundation. [CC BY-SA 4.0.][1] - -Minecraft is the favorite game of pretty much every teenager in the world—and it's one of the most creative games ever to capture the attention of young people. The version that comes with every Raspberry Pi is not only a creative thinking building game, but comes with a programming interface allowing for additional interaction with the Minecraft world through Python code. - -Minecraft: Pi Edition is a great way for teachers to engage students with problem solving and writing code to perform tasks. You can use the Python API to build a house and have it follow you wherever you go, build a bridge wherever you walk, make it rain lava, show the temperature in the sky, and anything else your imagination can create. - -Read more in "[Getting Started with Minecraft Pi][2]." - -### 2. Reaction game and traffic lights ### - -![](https://opensource.com/sites/default/files/pi_traffic_installed_yellow_led_on.jpg) - -Courtesy of [Low Voltage Labs][3]. [CC BY-SA 4.0][1]. - -It's really easy to get started with physical computing on Raspberry Pi—just connect up LEDs and buttons to the GPIO pins, and with a few lines of code you can turn lights on and control things with button presses. Once you know the code to do the basics, it's down to your imagination as to what you do next! - -If you know how to flash one light, you can flash three. Pick out three LEDs in traffic light colors and you can code the traffic light sequence. If you know how to use a button to a trigger an event, then you have a pedestrian crossing! Also look out for great pre-built traffic light add-ons like [PI-TRAFFIC][4], [PI-STOP][5], [Traffic HAT][6], and more. - -It's not always about the code—this can be used as an exercise in understanding how real world systems are devised. Computational thinking is a useful skill in any walk of life. - -![](https://opensource.com/sites/default/files/reaction-game.png) - -Courtesy of the Raspberry Pi Foundation. [CC BY-SA 4.0][1]. - -Next, try wiring up two buttons and an LED and making a two-player reaction game—let the light come on after a random amount of time and see who can press the button first! - -To learn more, check out "[GPIO Zero recipes][7]. Everything you need is in [CamJam EduKit 1][8]. - -### 3. Sense HAT Pixel Pet ### - -The Astro Pi—an augmented Raspberry Pi—is going to space this December, but you haven't missed your chance to get your hands on the hardware. The Sense HAT is the sensor board add-on used in the Astro Pi mission and it's available for anyone to buy. You can use it for data collection, science experiments, games and more. Watch this Gurl Geek Diaries video from Raspberry Pi's Carrie Anne for a great way to get started—by bringing to life an animated pixel pet of your own design on the Sense HAT display: - -注:youtube 视频 - - -Learn more in "[Exploring the Sense HAT][9]." - -### 4. Infrared bird box ### - -![](https://opensource.com/sites/default/files/ir-bird-box.png) -Courtesy of the Raspberry Pi Foundation. [CC BY-SA 4.0.][1] - -A great exercise for the whole class to get involved with—place a Raspberry Pi and the NoIR camera module inside a bird box along with some infra-red lights so you can see in the dark, then stream video from the Pi over the network or on the internet. Wait for birds to nest and you can observe them without disturbing them in their habitat. - -Learn all about infrared and the light spectrum, and how to adjust the camera focus and control the camera in software. - -Learn more in "[Make an infrared bird box.][10]" - -### 5. Robotics ### - -![](https://opensource.com/sites/default/files/edukit3_1500-alex-eames-sm.jpg) - -Courtesy of Low Voltage Labs. [CC BY-SA 4.0][1]. - -With a Raspberry Pi and as little as a couple of motors and a motor controller board, you can build your own robot. There is a vast range of robots you can make, from basic buggies held together by sellotape and a homemade chassis, all the way to self-aware, sensor-laden metallic stallions with camera attachments driven by games controllers. - -Learn how to control individual motors with something straightforward like the RTK Motor Controller Board (£8/$12), or dive into the new CamJam robotics kit (£17/$25) which comes with motors, wheels and a couple of sensors—great value and plenty of learning potential. - -Alternatively, if you'd like something more hardcore, try PiBorg's [4Borg][11] (£99/$150) or [DiddyBorg][12] (£180/$273) or go the whole hog and treat yourself to their DoodleBorg Metal edition (£250/$380)—and build a mini version of their infamous [DoodleBorg tank][13] (unfortunately not for sale). - -Check out the [CamJam robotics kit worksheets][14]. - - --------------------------------------------------------------------------------- - -via: https://opensource.com/education/15/12/5-great-raspberry-pi-projects-classroom - -作者:[Ben Nuttall][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/bennuttall -[1]:https://creativecommons.org/licenses/by-sa/4.0/ -[2]:https://opensource.com/life/15/5/getting-started-minecraft-pi -[3]:http://lowvoltagelabs.com/ -[4]:http://lowvoltagelabs.com/products/pi-traffic/ -[5]:http://4tronix.co.uk/store/index.php?rt=product/product&product_id=390 -[6]:https://ryanteck.uk/hats/1-traffichat-0635648607122.html -[7]:http://pythonhosted.org/gpiozero/recipes/ -[8]:http://camjam.me/?page_id=236 -[9]:https://opensource.com/life/15/10/exploring-raspberry-pi-sense-hat -[10]:https://www.raspberrypi.org/learning/infrared-bird-box/ -[11]:https://www.piborg.org/4borg -[12]:https://www.piborg.org/diddyborg -[13]:https://www.piborg.org/doodleborg -[14]:http://camjam.me/?page_id=1035#worksheets diff --git a/translated/talk/yearbook2015/20151208 5 great Raspberry Pi projects for the classroom.md b/translated/talk/yearbook2015/20151208 5 great Raspberry Pi projects for the classroom.md new file mode 100644 index 0000000000..06191d551c --- /dev/null +++ b/translated/talk/yearbook2015/20151208 5 great Raspberry Pi projects for the classroom.md @@ -0,0 +1,98 @@ +5 个适合课堂教学的树莓派项目 +================================================================================ +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/osdc-open-source-yearbook-lead3.png) + +图片来源 : opensource.com + +### 1. Minecraft Pi ### + +![](https://opensource.com/sites/default/files/lava.png) + +上图由树莓派基金会提供。遵循 [CC BY-SA 4.0.][1] 协议。 + +Minecraft(我的世界)几乎是世界上每个青少年都极其喜爱的游戏 —— 在吸引年轻人注意力方面,它也是最具创意的游戏之一。伴随着每一个树莓派的游戏版本不仅仅是一个关于创造性思维的建筑游戏,它还带有一个编程接口,允许使用者通过 Python 代码来与 Minecraft 世界进行互动。 + +对于教师来说,Minecraft: Pi 版本是一个鼓励学生们解决遇到的问题以及通过书写代码来执行特定任务的极好方式。你可以使用 Python API + 来建造一所房子,让它跟随你到任何地方;或在你所到之处修建一座桥梁;又或者是下一场岩溶雨;或在天空中显示温度;以及其他任何你能想像到的事物。 + +可在 "[Minecraft Pi 入门][2]" 中了解更多相关内容。 + +### 2. 反应游戏和交通指示灯 ### + +![](https://opensource.com/sites/default/files/pi_traffic_installed_yellow_led_on.jpg) + +上图由 [Low Voltage Labs][3] 提供。遵循 [CC BY-SA 4.0][1] 协议。 + +在树莓派上进行物理计算是非常容易的 —— 只需将 LED 灯 和按钮连接到 GPIO 针脚上,再加上少量的代码,你就可以点亮 LED 灯并通过按按钮来控制物体。一旦你知道来执行基本操作的代码,下一步就可以随你的想像那样去做了! + +假如你知道如何让一盏灯闪烁,你就可以让三盏灯闪烁。选出三盏交通灯颜色的 LED 灯,你就可以编程出交通灯闪烁序列。假如你知道如何使用一个按钮来触发一个事件,然后你就有一个人行横道了!同时,你还可以找到诸如 [PI-TRAFFIC][4]、[PI-STOP][5]、[Traffic HAT][6] 等预先构建好的交通灯插件。 + +这不总是关于代码的 —— 它还可以被用来作为一个的练习,用以理解真实世界中的系统是如何被设计出来的。计算思维在生活中的各种情景中都是一个有用的技能。 + +![](https://opensource.com/sites/default/files/reaction-game.png) + +上图由树莓派基金会提供。遵循 [CC BY-SA 4.0][1] 协议。 + +下面尝试将两个按钮和一个 LED 灯连接起来,来制作一个二人制反应游戏 —— 让灯在一段随机的时间中点亮,然后看谁能够先按到按钮! + +想了解更多的话,请查看 [GPIO 新手指南][7]。你所需要的尽在 [CamJam EduKit 1][8]。 + +### 3. Sense HAT 像素宠物 ### + +Astro Pi— 一个增强版的树莓派 —将于今年 12 月(注:应该是去年的事了。)问世,但你并没有错过让你的手玩弄硬件的机会。Sense HAT 是一个用在 Astro Pi 任务中的感应器主板插件,且任何人都可以买到。你可以用它来做数据收集、科学实验、游戏或者更多。 观看下面这个由树莓派的 Carrie Anne 带来的 Gurl Geek Diaries 录像来开始一段美妙的旅程吧 —— 通过在 Sense HAT 的显示器上展现出你自己设计的一个动物像素宠物: + +注:youtube 视频 + + +在 "[探索 Sense HAT][9]" 中可以学到更多。 + +### 4. 红外鸟箱 ### + +![](https://opensource.com/sites/default/files/ir-bird-box.png) +上图由 [Low Voltage Labs][3] 提供。遵循 [CC BY-SA 4.0][1] 协议。 + +让全班所有同学都能够参与进来的一个好的练习是 —— 在一个鸟箱中沿着某些红外线放置一个树莓派和 NoIR 照相模块,这样你就可以在黑暗中观看,然后通过网络或在网络中你可以从树莓派那里获取到视频流。等鸟进入笼子,然后你就可以在不打扰到它们的情况下观察它们。 + +在这期间,你可以学习到所有关于红外和光谱的知识,以及如何用软件来调整摄像头的焦距和控制它。 + +在 "[制作一个红外鸟箱][10]" 中你可以学到更多。 + +### 5. 机器人 ### + +![](https://opensource.com/sites/default/files/edukit3_1500-alex-eames-sm.jpg) + +上图由 Low Voltage Labs 提供。遵循 [CC BY-SA 4.0][1] 协议。 + +拥有一个树莓派,一些感应器和一个感应器控制电路板,你就可以构建你自己的机器人。你可以制作各种类型的机器人,从用透明胶带和自制底盘组合在一起的简易四驱车,一直到由游戏控制器驱动的具有自我意识,带有传感器和摄像头的金属马儿。 + +学习如何直接去控制单个的发动机,例如通过 RTK Motor Controller Board (£8/$12),或者尝试新的 CamJam robotics kit (£17/$25) ,它带有发动机、轮胎和一系列的感应器 — 这些都很有价值并很有学习的潜力。 + +另外,如何你喜欢更为骨灰级别的东西,可以尝试 PiBorg 的 [4Borg][11] (£99/$150) 或 [DiddyBorg][12] (£180/$273) 或者一干到底,享受他们的 DoodleBorg 金属版 (£250/$380) — 并构建一个他们声名远扬的 [DoodleBorg tank][13](很不幸的时,这个没有卖的) 的迷你版。 + +另外请参考 [CamJam robotics kit worksheets][14]。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/education/15/12/5-great-raspberry-pi-projects-classroom + +作者:[Ben Nuttall][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/bennuttall +[1]:https://creativecommons.org/licenses/by-sa/4.0/ +[2]:https://opensource.com/life/15/5/getting-started-minecraft-pi +[3]:http://lowvoltagelabs.com/ +[4]:http://lowvoltagelabs.com/products/pi-traffic/ +[5]:http://4tronix.co.uk/store/index.php?rt=product/product&product_id=390 +[6]:https://ryanteck.uk/hats/1-traffichat-0635648607122.html +[7]:http://pythonhosted.org/gpiozero/recipes/ +[8]:http://camjam.me/?page_id=236 +[9]:https://opensource.com/life/15/10/exploring-raspberry-pi-sense-hat +[10]:https://www.raspberrypi.org/learning/infrared-bird-box/ +[11]:https://www.piborg.org/4borg +[12]:https://www.piborg.org/diddyborg +[13]:https://www.piborg.org/doodleborg +[14]:http://camjam.me/?page_id=1035#worksheets From 2fd4968b580d73a74038c177a8a8873d0daddf78 Mon Sep 17 00:00:00 2001 From: martin qi Date: Thu, 3 Mar 2016 21:34:54 +0800 Subject: [PATCH 0479/1469] Verify --- ...send email notifications using Gmail SMTP server on Linux.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/translated/tech/20151109 How to send email notifications using Gmail SMTP server on Linux.md b/translated/tech/20151109 How to send email notifications using Gmail SMTP server on Linux.md index 56830068ab..ce6174cefc 100644 --- a/translated/tech/20151109 How to send email notifications using Gmail SMTP server on Linux.md +++ b/translated/tech/20151109 How to send email notifications using Gmail SMTP server on Linux.md @@ -1,3 +1,5 @@ +Martin + 如何在Linux上使用Gmail SMTP服务器发送邮件通知 ================================================================================ 假定你想配置一个Linux app从你的服务器或桌面客户端发送邮件信息。邮件信息可以是邮件简报、状态更新(比如[Cachet][1])、监控警报(比如[Monit][2])、磁盘时间(比如[RAID mdadm][3])等等的一部分。当你要建立自己的[邮件发送服务器][4],作为一个免维护的选择,你可以依赖一个免费可用的公共SMTP服务器。 From 331a67dbaa08d9bb2f8714586271a43346d8e907 Mon Sep 17 00:00:00 2001 From: martin qi Date: Fri, 4 Mar 2016 01:02:10 +0800 Subject: [PATCH 0480/1469] =?UTF-8?q?=E6=A0=A1=E5=AF=B9=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ations using Gmail SMTP server on Linux.md | 156 +++++++++++++++++ ...ations using Gmail SMTP server on Linux.md | 158 ------------------ 2 files changed, 156 insertions(+), 158 deletions(-) create mode 100644 published/tech/20151109 How to send email notifications using Gmail SMTP server on Linux.md delete mode 100644 translated/tech/20151109 How to send email notifications using Gmail SMTP server on Linux.md diff --git a/published/tech/20151109 How to send email notifications using Gmail SMTP server on Linux.md b/published/tech/20151109 How to send email notifications using Gmail SMTP server on Linux.md new file mode 100644 index 0000000000..20850869b1 --- /dev/null +++ b/published/tech/20151109 How to send email notifications using Gmail SMTP server on Linux.md @@ -0,0 +1,156 @@ +如何在 Linux 上使用 Gmail SMTP 服务器发送邮件通知 +================================================================================ +假定你想配置一个 Linux app,用于从你的服务器或桌面客户端发送邮件信息。邮件信息可能是部分的邮件简报、状态更新(如 [Cachet][1])、监控警报(如 [Monit][2])、磁盘时间(如 [RAID mdadm][3])等等。当你要建立自己的 [邮件发送服务器][4] 传递信息时 ,你可以依赖一个免费使用的公共 SMTP 服务器作为一个变通选项避免遭受维护之苦。 + +谷歌的 Gmail 服务就是最可靠的 **免费 SMTP 服务器** 之一。想要从 app 发送邮件通知,你仅需在 app 中添加 Gmail 的 SMTP 服务器地址和你的凭证即可。 + +选择 Gmail 的 SMTP 服务器的原因之一是各种各样恰当的限制,这些限制主要用于阻止那些经常滥用服务器来发送垃圾邮件和使用邮件营销的家伙。举个例子,你一次只能给至多 100 个地址发送信息,并且一天不能超过 500 个收件人。同样,如果你不想被标为垃圾邮件发送者,你就不能发送过多的不可投递的消息。当你达到任何一个限制,你的 Gmail 账户将被暂时的锁定一天。简而言之,Gmail 的 SMTP 服务器对于你个人的使用是非常棒的,但不适合商业的批量邮件。 + +说了这么多,是时候向你们展示 **如何在 Linux 环境下使用 Gmail 的 SMTP 服务器** 了。 + +### Google Gmail SMTP 服务器设置 ### + +如果你想要通过你的 app 使用 Gmail 的 SMTP 服务器发送邮件,请牢记接下来的详细说明。 + +- **邮件发送服务器 (SMTP 服务器)**: smtp.gmail.com +- **使用认证**: 是 +- **使用安全连接**: 是 +- **用户名**: 你的 Gmail 账户 ID (比如 "alice" 如果你的邮箱为 alice@gmail.com) +- **密码**: 你的 Gmail 密码 +- **端口**: 587 + +确切的配置根据 app 会有所不同。在本教程的剩余部分,我将向你展示一些在 Linux 上使用 Gmail SMTP 服务器的应用示例。 + +### 从命令行发送邮件 ### + +作为第一个例子,让我们尝试最基本的邮件功能:使用 Gmail SMTP 服务器从命令行发送一封邮件。为此,我将使用一个称为 mutt 的命令行邮件客户端。 + +先安装 mutt: + +对于 Debian-based 系统: + + $ sudo apt-get install mutt + +对于 Red Hat based 系统: + + $ sudo yum install mutt + +创建一个 mutt 配置文件(~/.muttrc),并和下面一样,在文件中指定 Gmail SMTP 服务器信息。将 替换成自己的 Gmail ID。注意该配置只是为了发送邮件而已(而非接收邮件)。 + + $ vi ~/.muttrc + +---------- + + set from = "@gmail.com" + set realname = "Dan Nanni" + set smtp_url = "smtp://@smtp.gmail.com:587/" + set smtp_pass = "" + +一切就绪使用 mutt 发送一封邮件: + + $ echo "This is an email body." | mutt -s "This is an email subject" alice@yahoo.com + +想在一封邮件中添加附件,使用 "-a" 选项 + + $ echo "This is an email body." | mutt -s "This is an email subject" alice@yahoo.com -a ~/test_attachment.jpg + +![](https://c1.staticflickr.com/1/770/22239850784_5fb0988075_c.jpg) + +使用 Gmail SMTP 服务器意味着邮件将显示是从你 Gmail 账户发出的。换句话说,收件人将视你的 Gmail 地址为发件人地址。如果你想要使用自己的域名作为邮件发送方,你需要使用 Gmail SMTP 转发服务。 + +### 当服务器重启时发送邮件通知 ### + +如果你在 [虚拟专用服务器(VPS)][5] 上跑了些重要的网站,建议要监控 VPS 的重启行为。作为一个更为实用的例子,让我们研究如何在你的 VPS 上为每一次重启事件建立邮件通知。这里假设你的 VPS 上使用的是 systemd,并向你展示如何为自动邮件通知创建一个自定义的 systemd 启动服务。 + +首先创建下面的脚本 reboot_notify.sh,用于负责邮件通知。 + + $ sudo vi /usr/local/bin/reboot_notify.sh + +---------- + + #!/bin/sh + + echo "`hostname` was rebooted on `date`" | mutt -F /etc/muttrc -s "Notification on `hostname`" alice@yahoo.com + +---------- + + $ sudo chmod +x /usr/local/bin/reboot_notify.sh + +在这个脚本中,我使用 "-F" 选项,用于指定系统级的 mutt 配置文件位置。因此不要忘了创建 /etc/muttrc 文件,并如前面描述的那样填入 Gmail SMTP 信息。 + +现在让我们创建如下一个自定义的 systemd 服务。 + + $ sudo mkdir -p /usr/local/lib/systemd/system + $ sudo vi /usr/local/lib/systemd/system/reboot-task.service + +---------- + + [Unit] + Description=Send a notification email when the server gets rebooted + DefaultDependencies=no + Before=reboot.target + + [Service] + Type=oneshot + ExecStart=/usr/local/bin/reboot_notify.sh + + [Install] + WantedBy=reboot.target + +在创建服务后,添加并启动该服务。 + + $ sudo systemctl enable reboot-task + $ sudo systemctl start reboot-task + +从现在起,在每次 VPS 重启时,你将会收到一封通知邮件。 + +![](https://c1.staticflickr.com/1/608/22241452923_2ace9cde2e_c.jpg) + +### 通过服务器使用监控发送邮件通知 ### + +作为最后一个例子,让我展示一个现实生活中的应用程序,[Monit][6],这是一款极其有用的服务器监控应用程序。它附有全面的 [VPS][7] 监控能力(比如 CPU、内存、进程、文件系统),和邮件通知功能。 + +如果你想要接收 VPS 上任何事件导致的且由 Monit 产生的邮件通知,你可以在 Monit 配置文件中添加以下 SMTP 信息。 + + set mailserver smtp.gmail.com port 587 + username "" password "" + using tlsv12 + + set mail-format { + from: @gmail.com + subject: $SERVICE $EVENT at $DATE on $HOST + message: Monit $ACTION $SERVICE $EVENT at $DATE on $HOST : $DESCRIPTION. + + Yours sincerely, + Monit + } + + # the person who will receive notification emails + set alert alice@yahoo.com + +这是一个因为 CPU 负载超载而由 Monit 发送的邮件通知的例子。 + +![](https://c1.staticflickr.com/1/566/22873764251_8fe66bfd16_c.jpg) + +### 总结 ### + +如你所见,类似 Gmail 这样免费的 SMTP 服务器有着这么多不同的运用方式 。但再次重申,牢记免费的 SMTP 服务器不适用于商业用途,仅仅适用于个人项目。无论你正在任一款 app 中使用 Gmail SMTP 服务器,欢迎自由分享你的用例。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/send-email-notifications-gmail-smtp-server-linux.html + +作者:[Dan Nanni][a] +译者:[cposture](https://github.com/cposture) +校对:[martin2011qi](https://github.com/martin2011qi) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/nanni +[1]:http://xmodulo.com/setup-system-status-page.html +[2]:http://xmodulo.com/server-monitoring-system-monit.html +[3]:http://xmodulo.com/create-software-raid1-array-mdadm-linux.html +[4]:http://xmodulo.com/mail-server-ubuntu-debian.html +[5]:http://xmodulo.com/go/digitalocean +[6]:http://xmodulo.com/server-monitoring-system-monit.html +[7]:http://xmodulo.com/go/digitalocean diff --git a/translated/tech/20151109 How to send email notifications using Gmail SMTP server on Linux.md b/translated/tech/20151109 How to send email notifications using Gmail SMTP server on Linux.md deleted file mode 100644 index ce6174cefc..0000000000 --- a/translated/tech/20151109 How to send email notifications using Gmail SMTP server on Linux.md +++ /dev/null @@ -1,158 +0,0 @@ -Martin - -如何在Linux上使用Gmail SMTP服务器发送邮件通知 -================================================================================ -假定你想配置一个Linux app从你的服务器或桌面客户端发送邮件信息。邮件信息可以是邮件简报、状态更新(比如[Cachet][1])、监控警报(比如[Monit][2])、磁盘时间(比如[RAID mdadm][3])等等的一部分。当你要建立自己的[邮件发送服务器][4],作为一个免维护的选择,你可以依赖一个免费可用的公共SMTP服务器。 - -最可靠的**免费SMTP服务器**之一来自谷歌的Gmail服务。为了在你的app里发送邮件通知,你仅需在app中添加Gmail的SMTP服务器地址和你的凭证即可。 - -Gmail的SMTP服务器吸引人的地方之一是有各种各样恰当的限制,这些限制主要用于阻止那些经常滥用服务器的滥发垃圾邮件者和邮件营销者。举个例子,你一次只能给至多100个地址发送信息,并且一天不能超过500个接收者。当你达到任何一个限制,你的Gmail账户将暂时锁一天。简而言之,Gmail的SMTP服务器对于你个人的使用是非常棒的,但不适合商业的批量邮件。 - -话虽如此,让我们展示**如何在Linux环境下使用Gmail的SMTP服务器**。 - -### Google Gmail SMTP服务器设置 ### - -如果你想要使用Gmail的SMTP服务器从你的app发送邮件,请牢记接下来的详细说明。 - -- **邮件发送服务器 (SMTP服务器)**: smtp.gmail.com -- **使用认证**: 是 -- **使用安全连接**: 是 -- **用户名**: 你的Gmail账户ID (比如 "alice" 如果你的邮箱为alice@gmail.com) -- **密码**: 你的Gmail密码 -- **端口**: 587 - -确切的配置语法可能要依据app而不同。在本教程的剩下部分,我将会向你展示各种在Linux上使用Gmail SMTP服务器的有用示例。 - -### 从命令行发送邮件 ### - -作为第一个例子,让我们尝试最基本的邮件功能:使用Gmail SMTP服务器从命令行发送一封邮件。为此,我将使用一个称为mutt的命令行邮件客户端。 - -先安装mutt: - -对于 Debian-based 系统: - - $ sudo apt-get install mutt - -对于 Red Hat based 系统: - - $ sudo yum install mutt - -创建一个mutt配置文件(~/.muttrc),并和下面一样,在文件中指定Gmail SMTP服务器信息。将gmail-id替换成自己的Gmail ID。注意这配置只是为了发送邮件而已(而非接收邮件)。 - - $ vi ~/.muttrc - ----------- - - set from = "@gmail.com" - set realname = "Dan Nanni" - set smtp_url = "smtp://@smtp.gmail.com:587/" - set smtp_pass = "" - -现在准备使用mutt发送一封邮件: - - $ echo "This is an email body." | mutt -s "This is an email subject" alice@yahoo.com - -为了在一封邮件中添加一个附件,使用"-a"选项 - - $ echo "This is an email body." | mutt -s "This is an email subject" alice@yahoo.com -a ~/test_attachment.jpg - -![](https://c1.staticflickr.com/1/770/22239850784_5fb0988075_c.jpg) - -使用Gmail SMTP服务器意味着邮件显示为从你的Gmail账户发出。换句话说,一个接收者将你的Gmail地址视为发送者地址。如果你想要使用自己的域名作为邮件发送者,你需要使用Gmail SMTP转发服务。 - -### 当服务器重启时发送邮件通知 ### - -如果你为了一些重要的网站正在运行一台[虚拟专用服务器(VPS)][5],一个建议是监视VPS的重启活动。作为一个更实用的例子,让我们研究如何在你的VPS上为每一次重启事件建立邮件通知。这里我假设你正在你的VPS上使用systemd,并向你展示如何为自动邮件通知创建一个自定义的systemd启动服务。 - -首先创建下面的脚本reboot_notify.sh,用于负责邮件通知。 - - $ sudo vi /usr/local/bin/reboot_notify.sh - ----------- - - #!/bin/sh - - echo "`hostname` was rebooted on `date`" | mutt -F /etc/muttrc -s "Notification on `hostname`" alice@yahoo.com - ----------- - - $ sudo chmod +x /usr/local/bin/reboot_notify.sh - -在这个脚本中,我使用"-F"选项,用于直到系统级的mutt配置文件位置。因此不要忘了创建/etc/muttrc文件并如前面描述填入Gmail SMTP信息。 - -现在让我们创建如下一个自定义的systemd服务。 - - $ sudo mkdir -p /usr/local/lib/systemd/system - $ sudo vi /usr/local/lib/systemd/system/reboot-task.service - ----------- - - [Unit] - Description=Send a notification email when the server gets rebooted - DefaultDependencies=no - Before=reboot.target - - [Service] - Type=oneshot - ExecStart=/usr/local/bin/reboot_notify.sh - - [Install] - WantedBy=reboot.target - -一旦创建服务,便使能和启动该服务。 - - $ sudo systemctl enable reboot-task - $ sudo systemctl start reboot-task - -从现在起,在每次VPS重启时你将会收到一封通知邮件。 - -![](https://c1.staticflickr.com/1/608/22241452923_2ace9cde2e_c.jpg) - -### 从服务器使用监控发送邮件通知 ### - -作为最后一个例子,让我展示一个称为[Monit][6]的现实生活的应用程序,这是一个极其有用的服务器监控应用程序。它附有广泛的[VPS][7]监控能力(比如CPU、内存、进程、文件系统),包括邮件通知能力。 - -如果你想要接收VPS上任何事件导致的且由Monit产生的邮件通知,你可以在Monit配置文件中添加以下SMTP信息。 - - set mailserver smtp.gmail.com port 587 - username "" password "" - using tlsv12 - - set mail-format { - from: @gmail.com - subject: $SERVICE $EVENT at $DATE on $HOST - message: Monit $ACTION $SERVICE $EVENT at $DATE on $HOST : $DESCRIPTION. - - Yours sincerely, - Monit - } - - # the person who will receive notification emails - set alert alice@yahoo.com - -这是一个因为CPU负载超载而由Monit发送的邮件通知例子。 - -![](https://c1.staticflickr.com/1/566/22873764251_8fe66bfd16_c.jpg) - -### 总结 ### - -正如你能想象的,像Gmail一样,有许多中不同的方式使用免费的SMTP服务器。但再次说明,请牢记免费的SMTP服务器不适用于商业用途,仅仅适用于个人项目。如果你正在任一app中使用Gmail SMTP服务器,请自由分享你的用例。 - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/send-email-notifications-gmail-smtp-server-linux.html - -作者:[Dan Nanni][a] -译者:[cposture](https://github.com/cposture) -校对:[校对者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/setup-system-status-page.html -[2]:http://xmodulo.com/server-monitoring-system-monit.html -[3]:http://xmodulo.com/create-software-raid1-array-mdadm-linux.html -[4]:http://xmodulo.com/mail-server-ubuntu-debian.html -[5]:http://xmodulo.com/go/digitalocean -[6]:http://xmodulo.com/server-monitoring-system-monit.html -[7]:http://xmodulo.com/go/digitalocean From f6195564271811c8bb9361a4762b7296369f8ca3 Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 4 Mar 2016 11:00:52 +0800 Subject: [PATCH 0481/1469] =?UTF-8?q?=E6=A0=A1=E5=AF=B9=E5=AE=8C=E6=88=90?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=AD=A3=E7=9B=AE=E5=BD=95=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...o send email notifications using Gmail SMTP server on Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename published/{tech => }/20151109 How to send email notifications using Gmail SMTP server on Linux.md (100%) diff --git a/published/tech/20151109 How to send email notifications using Gmail SMTP server on Linux.md b/published/20151109 How to send email notifications using Gmail SMTP server on Linux.md similarity index 100% rename from published/tech/20151109 How to send email notifications using Gmail SMTP server on Linux.md rename to published/20151109 How to send email notifications using Gmail SMTP server on Linux.md From 9b7d854df6eda7cbf5827231fa5e8b752a5dd3aa Mon Sep 17 00:00:00 2001 From: robot527 Date: Fri, 4 Mar 2016 20:19:36 +0800 Subject: [PATCH 0482/1469] Translated 20151028 Bossie Awards 2015--The best open source networking and security software.md --- ...source networking and security software.md | 165 ------------------ ...source networking and security software.md | 162 +++++++++++++++++ 2 files changed, 162 insertions(+), 165 deletions(-) delete mode 100644 sources/share/20151028 Bossie Awards 2015--The best open source networking and security software.md create mode 100644 translated/share/20151028 Bossie Awards 2015--The best open source networking and security software.md diff --git a/sources/share/20151028 Bossie Awards 2015--The best open source networking and security software.md b/sources/share/20151028 Bossie Awards 2015--The best open source networking and security software.md deleted file mode 100644 index 78c558b1e6..0000000000 --- a/sources/share/20151028 Bossie Awards 2015--The best open source networking and security software.md +++ /dev/null @@ -1,165 +0,0 @@ -robot527 translating - - -Bossie Awards 2015: The best open source networking and security software -================================================================================ -InfoWorld's top picks of the year among open source tools for building, operating, and securing networks - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-net-sec-100614459-orig.jpg) - -### The best open source networking and security software ### - -BIND, Sendmail, OpenSSH, Cacti, Nagios, Snort -- open source software seems to have been invented for networks, and many of the oldies and goodies are still going strong. Among our top picks in the category this year, you'll find a mix of stalwarts, mainstays, newcomers, and upstarts perfecting the arts of network management, security monitoring, vulnerability assessment, rootkit detection, and much more. - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-icinga-100614482-orig.jpg) - -### Icinga 2 ### - -Icinga began life as a fork of system monitoring application Nagios. [Icinga 2][1] was completely rewritten to give users a modern interface, support for multiple databases, and an API to integrate numerous extensions. With out-of-the-box load balancing, notifications, and configuration, Icinga 2 shortens the time to installation for complex environments. Icinga 2 supports Graphite natively, giving administrators real-time performance graphing without any fuss. But what puts Icinga back on the radar this year is its release of Icinga Web 2, a graphical front end with drag-and-drop customizable dashboards and streamlined monitoring tools. - -Administrators can view, filter, and prioritize problems, while keeping track of which actions have already been taken. A new matrix view lets administrators view hosts and services on one page. You can view events over a particular time period or filter incidents to understand which ones need immediate attention. Icinga Web 2 may boast a new interface and zippier performance, but all the usual commands from Icinga Classic and Icinga Web are still available. That means there is no downtime trying to learn a new version of the tool. - --- Fahmida Rashid - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-zenoss-100614465-orig.jpg) - -### Zenoss Core ### - -Another open source stalwart, [Zenoss Core][2] gives network administrators a complete, one-stop solution for tracking and managing all of the applications, servers, storage, networking components, virtualization tools, and other elements of an enterprise infrastructure. Administrators can make sure the hardware is running efficiently and take advantage of the modular design to plug in ZenPacks for extended functionality. - -Zenoss Core 5, released in February of this year, takes the already powerful tool and improves it further, with an enhanced user interface and expanded dashboard. The Web-based console and dashboards were already highly customizable and dynamic, and the new version now lets administrators mash up multiple component charts onto a single chart. Think of it as the tool for better root cause and cause/effect analysis. - -Portlets give additional insights for network mapping, device issues, daemon processes, production states, watch lists, and event views, to name a few. And new HTML5 charts can be exported outside the tool. The Zenoss Control Center allows out-of-band management and monitoring of all Zenoss components. Zenoss Core has new tools for online backup and restore, snapshots and rollbacks, and multihost deployment. Even more important, deployments are faster with full Docker support. - --- Fahmida Rashid - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-opennms-100614461-orig.jpg) - -### OpenNMS ### - -An extremely flexible network management solution, [OpenNMS][3] can handle any network management task, whether it's device management, application performance monitoring, inventory control, or events management. With IPv6 support, a robust alerts system, and the ability to record user scripts to test Web applications, OpenNMS has everything network administrators and testers need. OpenNMS has become, as now a mobile dashboard, called OpenNMS Compass, lets networking pros keep an eye on their network even when they're out and about. - -The iOS version of the app, which is available on the [iTunes App Store][4], displays outages, nodes, and alarms. The next version will offer additional event details, resource graphs, and information about IP and SNMP interfaces. The Android version, available on [Google Play][5], displays network availability, outages, and alarms on the dashboard, as well as the ability to acknowledge, escalate, or clear alarms. The mobile clients are compatible with OpenNMS Horizon 1.12 or greater and OpenNMS Meridian 2015.1.0 or greater. - --- Fahmida Rashid - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-onion-100614460-orig.jpg) - -### Security Onion ### - -Like an onion, network security monitoring is made of many layers. No single tool will give you visibility into every attack or show you every reconnaissance or foot-printing session on your company network. [Security Onion][6] bundles scores of proven tools into one handy Ubuntu distro that will allow you to see who's inside your network and help keep the bad guys out. - -Whether you're taking a proactive approach to network security monitoring or following up on a potential attack, Security Onion can assist. Consisting of sensor, server, and display layers, the Onion combines full network packet capture with network-based and host-based intrusion detection, and it serves up all of the various logs for inspection and analysis. - -The star-studded network security toolchain includes Netsniff-NG for packet capture, Snort and Suricata for rules-based network intrusion detection, Bro for analysis-based network monitoring, OSSEC for host intrusion detection, and Sguil, Squert, Snorby, and ELSA (Enterprise Log Search and Archive) for display, analysis, and log management. It’s a carefully vetted collection of tools, all wrapped in a wizard-driven installer and backed by thorough documentation, that can help you get from zero to monitoring as fast as possible. - --- Victor R. Garza - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-kali-100614458-orig.jpg) - -Kali Linux - -The team behind [Kali Linux][7] revamped the popular security Linux distribution this year to make it faster and even more versatile. Kali sports a new 4.0 kernel, improved hardware and wireless driver support, and a snappier interface. The most popular tools are easily accessible from a dock on the side of the screen. The biggest change? Kali Linux is now a rolling distribution, with a continuous stream of software updates. Kali's core system is based on Debian Jessie, and the team will pull packages continuously from Debian Testing, while continuing to add new Kali-flavored features on top. - -The distribution still comes jam-packed with tools for penetration testing, vulnerability analysis, security forensics, Web application analysis, wireless networking and assessment, reverse engineering, and exploitation tools. Now the distribution has an upstream version checking system that will automatically notify users when updates are available for the individual tools. The distribution also features ARM images for a range of devices, including Raspberry Pi, Chromebook, and Odroids, as well as updates to the NetHunter penetration testing platform that runs on Android devices. There are other changes too: Metasploit Community/Pro is no longer included, because Kali 2.0 is not yet [officially supported by Rapid7][8]. - --- Fahmida Rashid - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-openvas-100614462-orig.jpg) - -### OpenVAS ### - -[OpenVAS][9], the Open Vulnerability Assessment System, is a framework that combines multiple services and tools to offer vulnerability scanning and vulnerability management. The scanner is coupled with a weekly feed of network vulnerability tests, or you can use a feed from a commercial service. The framework includes a command-line interface (so it can be scripted) and an SSL-secured, browser-based interface via the [Greenbone Security Assistant][10]. OpenVAS accommodates various plug-ins for additional functionality. Scans can be scheduled or run on-demand. - -Multiple OpenVAS installations can be controlled through a single master, which makes this a scalable vulnerability assessment tool for enterprises. The project is as compatible with standards as can be: Scan results and configurations are stored in a SQL database, where they can be accessed easily by external reporting tools. Client tools access the OpenVAS Manager via the XML-based stateless OpenVAS Management Protocol, so security administrators can extend the functionality of the framework. The software can be installed from packages or source code to run on Windows or Linux, or downloaded as a virtual appliance. - --- Matt Sarrel - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-owasp-100614463-orig.jpg) - -### OWASP ### - -[OWASP][11], the Open Web Application Security Project, is a nonprofit organization with worldwide chapters focused on improving software security. The community-driven organization provides test tools, documentation, training, and almost anything you could imagine that’s related to assessing software security and best practices for developing secure software. Several OWASP projects have become valuable components of many a security practitioner's toolkit: - -[ZAP][12], the Zed Attack Proxy Project, is a penetration test tool for finding vulnerabilities in Web applications. One of the design goals of ZAP was to make it easy to use so that developers and functional testers who aren't security experts can benefit from using it. ZAP provides automated scanners and a set of manual test tools. - -The [Xenotix XSS Exploit Framework][13] is an advanced cross-site scripting vulnerability detection and exploitation framework that runs scans within browser engines to get real-world results. The Xenotix Scanner Module uses three intelligent fuzzers, and it can run through nearly 5,000 distinct XSS payloads. An API lets security administrators extend and customize the exploit toolkit. - -[O-Saft][14], or the OWASP SSL advanced forensic tool, is an SSL auditing tool that shows detailed information about SSL certificates and tests SSL connections. This command-line tool can run online or offline to assess SSL security such as ciphers and configurations. O-Saft provides built-in checks for common vulnerabilities, and you can easily extend these through scripting. In May 2015 a simple GUI was added as an optional download. - -[OWTF][15], the Offensive Web Testing Framework, is an automated test tool that follows OWASP testing guidelines and the NIST and PTES standards. The framework uses both a Web UI and a CLI, and it probes Web and application servers for common vulnerabilities such as improper configuration and unpatched software. - --- Matt Sarrel - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-beef-100614456-orig.jpg) - -### BeEF ### - -The Web browser has become the most common vector for attacks against clients. [BeEF][15], the Browser Exploitation Framework Project, is a widely used penetration tool to assess Web browser security. BeEF helps you expose the security weaknesses of client systems using client-side attacks launched through the browser. BeEF sets up a malicious website, which security administrators visit from the browser they want to test. BeEF then sends commands to attack the Web browser and use it to plant software on the client machine. Administrators can then launch attacks on the client machine as if they were zombies. - -BeEF comes with commonly used modules like a key logger, a port scanner, and a Web proxy, plus you can write your own modules or send commands directly to the zombified test machine. BeEF comes with a handful of demo Web pages to help you get started and makes it very easy to write additional Web pages and attack modules so you can customize testing to your environment. BeEF is a valuable test tool for assessing browser and endpoint security and for learning how browser-based attacks are launched. Use it to put together a demo to show your users how malware typically infects client devices. - --- Matt Sarrel - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-unhide-100614464-orig.jpg) - -### Unhide ### - -[Unhide][16] is a forensic tool that locates open TCP/UDP ports and hidden process on UNIX, Linux, and Windows. Hidden ports and processes can be the result of rootkit or LKM (loadable kernel module) activity. Rootkits can be difficult to find and remove because they are designed to be stealthy, hiding themselves from the OS and user. A rootkit can use LKMs to hide its processes or impersonate other processes, allowing it to run on machines undiscovered for a long time. Unhide can provide the assurance that administrators need to know their systems are clean. - -Unhide is really two separate scripts: one for processes and one for ports. The tool interrogates running processes, threads, and open ports and compares this info to what's registered with the system as active, reporting discrepancies. Unhide and WinUnhide are extremely lightweight scripts that run from the command line to produce text output. They're not pretty, but they are extremely useful. Unhide is also included in the [Rootkit Hunter][17] project. - --- Matt Sarrel - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-main-100614457-orig.jpg) - -Read about more open source winners - -InfoWorld's Best of Open Source Awards for 2014 celebrate more than 100 open source projects, from the bottom of the stack to the top. Follow these links to more open source winners: - -[Bossie Awards 2015: The best open source applications][18] - -[Bossie Awards 2015: The best open source application development tools][19] - -[Bossie Awards 2015: The best open source big data tools][20] - -[Bossie Awards 2015: The best open source data center and cloud software][21] - -[Bossie Awards 2015: The best open source desktop and mobile software][22] - -[Bossie Awards 2015: The best open source networking and security software][23] - --------------------------------------------------------------------------------- - -via: http://www.infoworld.com/article/2982962/open-source-tools/bossie-awards-2015-the-best-open-source-networking-and-security-software.html - -作者:[InfoWorld staff][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.infoworld.com/author/InfoWorld-staff/ -[1]:https://www.icinga.org/icinga/icinga-2/ -[2]:http://www.zenoss.com/ -[3]:http://www.opennms.org/ -[4]:https://itunes.apple.com/us/app/opennms-compass/id968875097?mt=8 -[5]:https://play.google.com/store/apps/details?id=com.opennms.compass&hl=en -[6]:http://blog.securityonion.net/p/securityonion.html -[7]:https://www.kali.org/ -[8]:https://community.rapid7.com/community/metasploit/blog/2015/08/12/metasploit-on-kali-linux-20 -[9]:http://www.openvas.org/ -[10]:http://www.greenbone.net/ -[11]:https://www.owasp.org/index.php/Main_Page -[12]:https://www.owasp.org/index.php/OWASP_Zed_Attack_Proxy_Project -[13]:https://www.owasp.org/index.php/O-Saft -[14]:https://www.owasp.org/index.php/OWASP_OWTF -[15]:http://www.beefproject.com/ -[16]:http://www.unhide-forensics.info/ -[17]:http://www.rootkit.nl/projects/rootkit_hunter.html -[18]:http://www.infoworld.com/article/2982622/bossie-awards-2015-the-best-open-source-applications.html -[19]:http://www.infoworld.com/article/2982920/bossie-awards-2015-the-best-open-source-application-development-tools.html -[20]:http://www.infoworld.com/article/2982429/bossie-awards-2015-the-best-open-source-big-data-tools.html -[21]:http://www.infoworld.com/article/2982923/bossie-awards-2015-the-best-open-source-data-center-and-cloud-software.html -[22]:http://www.infoworld.com/article/2982630/bossie-awards-2015-the-best-open-source-desktop-and-mobile-software.html -[23]:http://www.infoworld.com/article/2982962/bossie-awards-2015-the-best-open-source-networking-and-security-software.html \ No newline at end of file diff --git a/translated/share/20151028 Bossie Awards 2015--The best open source networking and security software.md b/translated/share/20151028 Bossie Awards 2015--The best open source networking and security software.md new file mode 100644 index 0000000000..42b2a4ac99 --- /dev/null +++ b/translated/share/20151028 Bossie Awards 2015--The best open source networking and security software.md @@ -0,0 +1,162 @@ +2015 Bossie 评选:最佳开源网络和安全软件 +================================================================================ +InfoWorld 在建设网络,运营网络和保障网络安全领域精选出了年度开源工具获奖者。 + +![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-net-sec-100614459-orig.jpg) + +### 最佳开源网络和安全软件 ### + +[BIND](https://en.wikipedia.org/wiki/BIND), [Sendmail](https://en.wikipedia.org/wiki/Sendmail), [OpenSSH](https://en.wikipedia.org/wiki/OpenSSH), [Cacti](https://en.wikipedia.org/wiki/Cactus), [Nagios](https://en.wikipedia.org/wiki/Nagios), [Snort](https://en.wikipedia.org/wiki/Snort_%28software%29) -- 这些为了网络而发明的开源软件,许多老家伙和好东西依然强劲。今年在我们这个范畴的最佳选择中,你会发现中坚支柱,新人,和新贵正在完善网络管理,安全监控,漏洞评估,[rootkit](https://en.wikipedia.org/wiki/Rootkit) 检测,以及更多。 + +![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-icinga-100614482-orig.jpg) + +### Icinga 2 ### + +Icinga 起先只是系统监控应用 Nagios 的一个分叉。为了给用户一个时尚的界面,对多个数据库的支持,以及一个集成众多扩展的 API,[Icinga 2][1] 被完全重写。凭借开箱即用的负载均衡、通知和配置,Icinga 2 缩短了在复杂环境下的安装时间。Icinga 2 原生支持 [Graphite](https://github.com/graphite-project/graphite-web)(系统监控应用),轻松为管理员呈现实时性能图表。但是 Icinga 今年很火是因为它发布了一个支持可拖放可定制 dashboard 和一些流式监控工具的前端图形界面系统 Icinga Web 2。 + +管理员可以查看,过滤,并把问题按优先顺序排好,同时保持跟踪已经进行的动作。一个新的矩阵视图使管理员能够在一个页面上查看主机和服务。您可以查看一个特定时间段的事件或筛选了的事件来了解哪些需要立即关注。Icinga Web 2 能够拥有一个全新界面和更为强劲的性能,然而传统版 Icinga 和 Web 版 Icinga 的所有常用命令仍然可用。这意味着学习新版工具不耗费额外的时间。 + +-- Fahmida Rashid + +![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-zenoss-100614465-orig.jpg) + +### Zenoss Core ### + +另一个强大的开源软件,[Zenoss Core][2] 为网络管理员提供了一个完整的,一站式解决方案来跟踪和管理所有的应用程序、服务器、存储,网络组件、虚拟化工具、以及企业基础架构的其他元素。管理员可以确保硬件的运行效率并利用模块化设计的插件来扩展 ZenPacks 的功能。 + +Zenoss Core 5,在今年二月发布,作为已经很强大的工具,并进一步改进以增强用户界面和扩展 dashboard。基于 Web 的控制台和 dashboard 已经是高度可定制的和动态调整的,现在新版本可让管理员混搭多个组件图表到一个图表。可把它作为一种更好的根源分析和因果分析的工具。 + +Portlets 为网络映射、设备问题、守护进程、产品状态、监视列表和事件视图等等提供深入的分析。而且新的 HTML5 图表可以从工具导出。Zenoss 的控制中心支持带外管理并且可监控所有 Zenoss 组件。Zenoss Core 拥有在线备份和恢复、快照和回滚和多主机部署的新工具。更重要的是,凭借对 Docker 的全面支持,部署起来更快了。 + +-- Fahmida Rashid + +![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-opennms-100614461-orig.jpg) + +### OpenNMS ### + +一个非常灵活的网络管理解决方案,[OpenNMS][3] 可以处理任何网络管理任务,无论是设备管理,应用性能监控,库存控制,或事件管理。凭借对 IPv6 的支持,强大的警报系统,和记录用户脚本来测试 Web 应用程序的能力,OpenNMS 拥有网络管理员和测试人员需要的一切。OpenNMS 现在变得像一款移动 dashboard,堪称 OpenNMS 指南针,可让网络专家随时,甚至当他们外出时都可以监视他们的网络。 + +该应用程序的 IOS 版本,可从 [iTunes App Store][4] 上获取,显示故障、节点和告警。下一个版本将提供更多的事件细节、资源图表、以及关于 IP 和 SNMP 接口的信息。安卓版可从 [Google Play][5] 上获取,可在仪表板上显示网络可用性,故障和告警,以及确认、提升或清除告警的能力。移动客户端与 OpenNMS Horizon 1.12 或更高版本以及 OpenNMS Meridian 2015.1.0 或更高版本兼容。 + +-- Fahmida Rashid + +![](http://images.techhive.com/images/article/2015/09/bossies-2015-onion-100614460-orig.jpg) + +### Security Onion ### + +如同一个洋葱,网络安全监控是由许多层组成。没有单一的工具会使你洞察在你公司网络中的每次攻击,或者显示每一次侦查或文本会话给你。[Security Onion][6] 打包了许多经过验证的工具成为一个便于使用的 Ubuntu 发行版,这会让你看到谁留在你的网络里,并帮助你隔离坏家伙。 + +无论你是采取主动式的网络安全监测还是追查可能的攻击,Security Onion 都可以帮助你。由传感器、服务器和显示层组成,Onion 结合了基于网络和基于主机的入侵检测,全面的网络数据包捕获,并提供了所有的各种日志进行检查和分析。 + +众星云集的的网络安全工具链,包括用于网络抓包的 [Netsniff-NG](http://www.netsniff-ng.org/)、基于规则的网络入侵检测系统 Snort 和 [Suricata](https://en.wikipedia.org/wiki/Suricata_%28software%29),基于分析的网络监控系统 Bro,基于主机的入侵检测系统 OSSEC 和用于显示、分析和日志管理的 Sguil、Squert、Snorby 和 ELSA (企业日志搜索和归档)。它是一个经过精挑细选的工具集,全被打包进一个向导驱动式的安装程序并有完整的文档支持,可以帮助你尽可能快地进行监控。 + +-- Victor R. Garza + +![](http://images.techhive.com/images/article/2015/09/bossies-2015-kali-100614458-orig.jpg) + +Kali Linux + +[Kali Linux][7] 背后的团队修改了今年流行的安全 Linux 发行版,使其更快,更全能。Kali 采用全新 4.0 版的内核 ,改进了对硬件和无线驱动程序的支持,以及一个更流畅的界面。最流行的工具都可从屏幕的侧边栏上轻松访问。最大的改变?Kali Linux 现在是一个滚动发行版,具有连续的软件更新。Kali 的核心系统是基于 Debian Jessie 发行版,而且该团队会不断地从 Debian 测试版 pull 程序包,同时持续在上面添加新的 Kali 风格的特性。 + +该发行版仍然配备满了渗透测试,漏洞分析,安全审查,网络应用分析,无线网络评估,逆向工程,和漏洞利用工具。现在该发行版具有新版本检测系统,当有个别工具可更新时系统会自动通知用户。该发行版还具有一系列设备的 ARM 映像,包括树莓派、[Chromebook](https://en.wikipedia.org/wiki/Chromebook) 和 [Odroid](https://en.wikipedia.org/wiki/ODROID),也可更新在 Android 设备上运行的 [NetHunter](https://www.kali.org/kali-linux-nethunter/) 渗透测试平台。还有其他的变化:Metasploit 的社区版/专业版不再包括在内,因为 Kali 2.0 还没有 [Rapid7 的官方支持][8]。 + +-- Fahmida Rashid + +![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-openvas-100614462-orig.jpg) + +### OpenVAS ### + +[OpenVAS][9],开源漏洞评估系统,是一种整合多种服务和工具来提供漏洞扫描和漏洞管理的软件框架。该扫描器与每周一次的网络漏洞测试数据配合,或者您可以使用商业数据。该软件框架包括一个命令行界面(所以它可以用脚本运行)和一个带 SSL 安全机制的基于 [Greenbone 安全助手][10] 的浏览器界面。OpenVAS 提供了用于附加功能的各种插件。扫描可以预定运行或按需运行。 + +可通过单一的主控来控制多个 OpenVAS 的安装,使得它成为一个可扩展的企业漏洞评估工具。该项目与兼容这样的标准:扫描结果和配置存储在 SQL 数据库中,在那里他们可以容易地被外部报告工具访问。客户端工具通过基于 XML 的无状态 OpenVAS 管理协议访问 OpenVAS 管理器,所以安全管理员可以扩展该框架的功能。该软件能以包或源代码的方式安装在 Windows 或 Linux 上运行,或者作为一个虚拟设备被下载。 + +-- Matt Sarrel + +![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-owasp-100614463-orig.jpg) + +### OWASP ### + +[OWASP][11],开放的 Web 应用安全项目,是专注于提高软件安全性的全球协会的非营利组织。社区性组织提供测试工具、文档、培训和几乎任何你可以想象的评估软件安全和开发安全软件相关的最佳实践。有几个 OWASP 项目已成为很多安全从业者的工具箱中有价值的组件: + +[ZAP][12],ZED 攻击代理项目,是一个在 Web 应用程序中寻找漏洞的渗透测试工具。ZAP 的设计目标之一是使之易于使用,以便于开发人员和非安全专家的测试人员可以受益于使用它。ZAP 提供了自动扫描器和一套手动测试工具。 + +[Xenotix XSS Exploit Framework][13] 是一款运行浏览器引擎内的扫描来获得实际结果的先进的跨站脚本漏洞检测和漏洞利用框架。Xenotix 扫描器模块采用三个智能的 fuzzer,它可以运行近 5000 个不同的XSS有效载荷。一个 API 可以让安全管理员扩展和定制开发工具包。 + +[O-Saft][14],OWASP SSL 高级审查工具,一个查看 SSL 证书详细信息和测试 SSL 连接的 SSL 审计工具。这个命令行工具可以在线或离线运行来评估 SSL 安全性,比如密码和配置。O-Saft 提供了常见漏洞的内置检查,你可以容易地通过编写脚本来扩展这些功能。在 2015 年 5 月加入了一个简单的图形用户界面作为可选的下载项。 + +[OWTF][15],攻击性的 Web 测试框架,一个遵循 OWASP 测试指南和 NIST 和 PTES 标准的自动化测试工具。该框架使用一个 Web 用户界面和一个命令行,它探测 Web 和应用服务器常见漏洞,如配置不当和未打补丁的软件。 + +-- Matt Sarrel + +![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-beef-100614456-orig.jpg) + +### BeEF ### + +Web 浏览器已经成为用于针对客户端的攻击中最常见的载体。[BeEF][15] 浏览器漏洞利用框架项目,是一种广泛使用的用以评估 Web 浏览器安全性的渗透工具。BeEF 帮助你揭露客户端系统的安全弱点,通过启动浏览器来进行客户端攻击。BeEF 建立了一个恶意网站,安全管理员用想要测试的浏览器访问该网站。然后 BeEF 发送命令来攻击 Web 浏览器并使用命令在客户端机器上植入软件。如果他们是僵尸机 ,管理员可以对客户端机器发动攻击。 + +BeEF 自带像键盘记录器,一个端口扫描器,和 Web 代理这样的常用模块,此外你可以编写你自己的模块或直接将命令发送到僵尸测试机。BeEF 带有少量的演示网页来帮你快速入门使得编写额外的网页和攻击模块很简单,因此你可以自定义测试你的环境。BeEF 是一个评估浏览器和终端安全、学习如何发起基于浏览器的攻击的宝贵的测试工具。可使用它来展示恶意软件通常如何感染客户端设备的演示给你的用户。 + +-- Matt Sarrel + +![](http://images.techhive.com/images/article/2015/09/bossies-2015-unhide-100614464-orig.jpg) + +### Unhide ### + +[Unhide][16] 是一个定位开放的 TCP/UDP 端口和隐藏在 UNIX、Linux 和 Windows 上的进程的审查工具。隐藏的端口和进程可以是 rootkit 或 LKM(可加载的内核模块)activity 的结果。rootkit 可能很难找到并移除,因为它们被设计成隐蔽的,对操作系统和用户隐藏自己。一个 rootkit 可以使用内核模块隐藏其进程或冒充其他进程,让它在机器上运行很长一段时间而不被发现。Unhide 可以保证管理员需要的干净系统。 + +Unhide 实际上是两个单独的脚本:一个用于进程,一个用于端口。该工具查询正在运行的进程、线程和开放的端口并将这些信息与系统中注册的活动比较,报告之间的差异。Unhide 和 WinUnhide 是在运行命令行产生文本输出的非常轻量级的脚本。它们不算优美,但是极为有用。Unhide 还列入了 [Rootkit Hunter][17] 项目中。 + +-- Matt Sarrel + +![](http://images.techhive.com/images/article/2015/09/bossies-2015-main-100614457-orig.jpg) + +查看更多的开源软件优胜者 + +InfoWorld 网站的 2014 年最佳开源奖从堆栈底部到顶部庆祝了 100 多个开源项目。以下链接指向更多开源软件优胜者: + +[2015 Bossie 评选:最佳开源应用程序][18] + +[2015 Bossie 评选:最佳开源应用程序开发工具][19] + +[2015 Bossie 评选:最佳开源大数据工具][20] + +[2015 Bossie 评选:最佳开源数据中心和云计算软件][21] + +[2015 Bossie 评选:最佳开源桌面和移动端软件][22] + +[2015 Bossie 评选:最佳开源网络和安全软件][23] + +-------------------------------------------------------------------------------- + +via: http://www.infoworld.com/article/2982962/open-source-tools/bossie-awards-2015-the-best-open-source-networking-and-security-software.html + +作者:[InfoWorld staff][a] +译者:[robot527](https://github.com/robot527) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.infoworld.com/author/InfoWorld-staff/ +[1]:https://www.icinga.org/icinga/icinga-2/ +[2]:http://www.zenoss.com/ +[3]:http://www.opennms.org/ +[4]:https://itunes.apple.com/us/app/opennms-compass/id968875097?mt=8 +[5]:https://play.google.com/store/apps/details?id=com.opennms.compass&hl=en +[6]:http://blog.securityonion.net/p/securityonion.html +[7]:https://www.kali.org/ +[8]:https://community.rapid7.com/community/metasploit/blog/2015/08/12/metasploit-on-kali-linux-20 +[9]:http://www.openvas.org/ +[10]:http://www.greenbone.net/ +[11]:https://www.owasp.org/index.php/Main_Page +[12]:https://www.owasp.org/index.php/OWASP_Zed_Attack_Proxy_Project +[13]:https://www.owasp.org/index.php/O-Saft +[14]:https://www.owasp.org/index.php/OWASP_OWTF +[15]:http://www.beefproject.com/ +[16]:http://www.unhide-forensics.info/ +[17]:http://www.rootkit.nl/projects/rootkit_hunter.html +[18]:http://www.infoworld.com/article/2982622/bossie-awards-2015-the-best-open-source-applications.html +[19]:http://www.infoworld.com/article/2982920/bossie-awards-2015-the-best-open-source-application-development-tools.html +[20]:http://www.infoworld.com/article/2982429/bossie-awards-2015-the-best-open-source-big-data-tools.html +[21]:http://www.infoworld.com/article/2982923/bossie-awards-2015-the-best-open-source-data-center-and-cloud-software.html +[22]:http://www.infoworld.com/article/2982630/bossie-awards-2015-the-best-open-source-desktop-and-mobile-software.html +[23]:http://www.infoworld.com/article/2982962/bossie-awards-2015-the-best-open-source-networking-and-security-software.html From 4ab470b03712d1af26481403e6c4612fcdef616b Mon Sep 17 00:00:00 2001 From: GHLandy Date: Fri, 4 Mar 2016 20:49:15 +0800 Subject: [PATCH 0483/1469] =?UTF-8?q?[=E5=BC=80=E5=A7=8B=E7=BF=BB=E8=AF=91?= =?UTF-8?q?]=20Part=2010=20-=20LFCS:=20Understanding=20&=20Learning=20Basi?= =?UTF-8?q?c=20Shell=20Scripting=20and=20Linux=20Filesystem=20Troubleshoot?= =?UTF-8?q?ing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...asic Shell Scripting and Linux Filesystem Troubleshooting.md | 2 ++ 1 file changed, 2 insertions(+) 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 4d0a5a229a..65a853bc84 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 @@ +GHLandy Translating + 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. From 5d09fbdbe696ef87889372987d2d3191a20406ab Mon Sep 17 00:00:00 2001 From: martin qi Date: Fri, 4 Mar 2016 21:18:18 +0800 Subject: [PATCH 0484/1469] =?UTF-8?q?=E5=BC=80=E5=A7=8B=E6=A0=A1=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...15--The best open source networking and security software.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/translated/share/20151028 Bossie Awards 2015--The best open source networking and security software.md b/translated/share/20151028 Bossie Awards 2015--The best open source networking and security software.md index 42b2a4ac99..a073ce5349 100644 --- a/translated/share/20151028 Bossie Awards 2015--The best open source networking and security software.md +++ b/translated/share/20151028 Bossie Awards 2015--The best open source networking and security software.md @@ -1,3 +1,5 @@ +Martin + 2015 Bossie 评选:最佳开源网络和安全软件 ================================================================================ InfoWorld 在建设网络,运营网络和保障网络安全领域精选出了年度开源工具获奖者。 From 9fbcb0f9568620f6ada517c2342be87bb2be2931 Mon Sep 17 00:00:00 2001 From: Rubik Date: Sat, 5 Mar 2016 11:14:12 +0800 Subject: [PATCH 0485/1469] =?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 --- ... Web server on Ubuntu 15.04 or CentOS 7.md | 214 ------------------ ... Web server on Ubuntu 15.04 or CentOS 7.md | 210 +++++++++++++++++ 2 files changed, 210 insertions(+), 214 deletions(-) delete mode 100644 sources/tech/20160219 How to Setup Lighttpd Web server on Ubuntu 15.04 or CentOS 7.md create mode 100644 translated/tech/20160219 How to Setup Lighttpd Web server on Ubuntu 15.04 or CentOS 7.md diff --git a/sources/tech/20160219 How to Setup Lighttpd Web server on Ubuntu 15.04 or CentOS 7.md b/sources/tech/20160219 How to Setup Lighttpd Web server on Ubuntu 15.04 or CentOS 7.md deleted file mode 100644 index 51f8050de7..0000000000 --- a/sources/tech/20160219 How to Setup Lighttpd Web server on Ubuntu 15.04 or CentOS 7.md +++ /dev/null @@ -1,214 +0,0 @@ -[Translating] Haohong Wang -How to Setup Lighttpd Web server on Ubuntu 15.04 / CentOS 7 -================================================================================= - -Lighttpd is an open source web server which is secure, fast, compliant, and very flexible and is optimized for high-performance environments. It uses very low memory compared to other web servers , small CPU load and speed optimization making it popular among the server for its efficiency and speed. Its advanced feature-set (FastCGI, CGI, Auth, Output-Compression, URL-Rewriting and many more) makes lighttpd the perfect webserver-software for every server that suffers load problems. - -Here are some simple easy setups on how we can setup Lighttpd web server on our machine running Ubuntu 15.04 or CentOS 7 linux distributions. - -### Installing Lighttpd - -#### Installing using Package Manager - -Here, we'll install Lighttpd using package manager as its the easiest method to install it. So, we can simply run the following command under `sudo` mode in a terminal or console to install Lighttpd. - -**CentOS 7** - -As lighttpd is not available in the official repository of CentOS 7, we'll need to install epel additional repository to our system. To do so, we'll need to run the following `yum` command. - - # yum install epel-release - -Then, we'll gonna update our system and proceed towards the installation of lighttpd. - - # yum update - # yum install lighttpd - -![Install Lighttpd Centos](http://blog.linoxide.com/wp-content/uploads/2016/02/install-lighttpd-centos.png) - -**Ubuntu 15.04** - -Lighttpd is available on the official repository of Ubuntu 15.04 so, we'll simply update our local repository index and then go for the installation of lighttpd using `apt-get` command. - - # apt-get update - # apt-get install lighttpd - -![Install lighttpd ubuntu](http://blog.linoxide.com/wp-content/uploads/2016/02/install-lighttpd-ubuntu.png) - -#### Installing from Source - -If we wanna install lighttpd from the latest version of source code ie 1.4.39, we'll need to compile the source code and install it into our system. First of all, we'll need to install the dependencies required to compile it. - - # cd /tmp/ - # wget http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.39.tar.gz - -After its downloaded, we'll need to extract it the tarball by running the following. - - # tar -zxvf lighttpd-1.4.39.tar.gz - -Then, we'll compile it by running the following commands. - - # cd lighttpd-1.4.39 - # ./configure - # make - -**Note:** In this tutorial, we are installing lighttpd with its standard configuration. If you wanna configure beyond the standard configuration and want to install more features like support for SSL, `mod_rewrite`, `mod_redirect` then you can configure. - -Once, its compiled, we'll install it in our system. - - # make install - -### Configuring Lighttpd - -If we need to configure our lighttpd web server further as our requirements, we can make changes to the default configuration file ie `/etc/lighttpd/lighttpd.conf` . As wee'll go with the default configuration here in this tutorial, we'll not gonna make changes to it. If we had made any changes and we wanna check for errors in the config file, we'll need to run the following command. - - # lighttpd -t -f /etc/lighttpd/lighttpd.conf - -#### On CentOS 7 - -If we are running CentOS 7, we'll need to create a new directory for our webroot defined in our lighttpd's default configuration ie `/src/www/htdocs/` . - - # mkdir -p /srv/www/htdocs/ - -Then, we'll copy the default welcome page from `/var/www/lighttpd/` directory to the above created directory. - - # cp -r /var/www/lighttpd/* /srv/www/htdocs/ - -### Starting and Enabling Services - -Now, we'll gonna restart our database server by executing the following `systemctl` command. - - # systemctl start lighttpd - -Then, we'll enable it to start automatically in every system boot. - - # systemctl enable lighttpd - -### Allowing Firewall - -To allow our webpages or websites running lighttpd web server on the internet or inside the same network, we'll need to allow port 80 from the firewall program. As both CentOS 7 and Ubuntu 15.04 are shipped with systemd as the default init system, we will have firewalld installed as a firewall solution. To allow port 80 or http service, we'll need to run the following commands. - - # firewall-cmd --permanent --add-service=http - success - # firewall-cmd --reload - success - -### Accessing Web Server - -As we have allowed port 80 which is the default port of lighttpd, we should be able to access lighttpd's welcome page by default. To do so, we'll need to point our browser to the ip address or domain of our machine running lighttpd according to our configuration. In this tutorial, we'll point our browser to [http://lighttpd.linoxide.com/](http://lighttpd.linoxide.com/) as we have pointed our sub-domain to its ip address. On doing so, we'll see the following welcome page in our browser. - -![Lighttpd Welcome Page](http://blog.linoxide.com/wp-content/uploads/2016/02/lighttpd-welcome-page.png) - -Further, we can add our website's files to the webroot directory and remove the default lighttpd's index file to make our static website live to the internet. - -If we want to run our PHP application in our lighttpd webserver, we'll need to follow the following steps. - -### Installing PHP5 Modules - -Once our lighttpd is installed successfully, we'll need to install PHP and some PHP modules to run PHP5 scripts in our lighttpd web server. - -#### On Ubuntu 15.04 - - # apt-get install php5 php5-cgi php5-fpm php5-mysql php5-curl php5-gd php5-intl php5-imagick php5-mcrypt php5-memcache php-pear - -#### On CentOS 7 - - # yum install php php-cgi php-fpm php-mysql php-curl php-gd php-intl php-pecl-imagick php-mcrypt php-memcache php-pear lighttpd-fastcgi - -### Configuring Lighttpd with PHP - -To make PHP work with lighttpd web server, we'll need to follow the following methods respect to the distribution we are running. - -#### On CentOS 7 - -First of all, we'll need to edit our php configuration ie `/etc/php.ini` and uncomment a line **cgi.fix_pathinfo=1** using a text editor. - - # nano /etc/php.ini - -After its done, we'll need to change the ownership of PHP-FPM process from apache to lighttpd. To do so, we'll need to open the configuration file `/etc/php-fpm.d/www.conf` using a text editor. - - # nano /etc/php-fpm.d/www.conf - -Then, we'll append the file with the following configurations. - - user = lighttpd - group = lighttpd - -Once done, we'll need to save the file and exit the text editor. Then, we'll need to include fastcgi module from `/etc/lighttpd/modules.conf` configuration file. - - # nano /etc/lighttpd/modules.conf - -Then, we'll need to uncomment the following line by removing `#` from it. - - include "conf.d/fastcgi.conf" - -At last, we'll need to configure our fastcgi configuration file using our favorite text editor. - - # nano /etc/lighttpd/conf.d/fastcgi.conf - -Then, we'll need to add the following lines at the end of the file. - - fastcgi.server += ( ".php" => - (( - "host" => "127.0.0.1", - "port" => "9000", - "broken-scriptfilename" => "enable" - )) - ) - -After its done, we'll save the file and exit the text editor. - -#### On Ubuntu 15.04 - -To enable fastcgi with lighttpd web server, we'll simply need to execute the following commands. - - # lighttpd-enable-mod fastcgi - - Enabling fastcgi: ok - Run /etc/init.d/lighttpd force-reload to enable changes - - # lighttpd-enable-mod fastcgi-php - - Enabling fastcgi-php: ok - Run `/etc/init.d/lighttpd` force-reload to enable changes - -Then, we'll reload our lighttpd by running the following command. - - # systemctl force-reload lighttpd - -### Testing if PHP is working - -In order to see if PHP is working as expected or not, we'll need to create a new php file under the webroot of our lighttpd web server. Here, in this tutorial we have `/var/www/html` in Ubuntu and `/srv/www/htdocs` in CentOS as the default webroot so, we'll create a info.php file under it using a text editor. - -**On CentOS 7** - - # nano /var/www/info.php - -**On Ubuntu 15.04** - - # nano /srv/www/htdocs/info.php - -Then, we'll simply add the following line into the file. - - - -Once done, we'll simply save the file and exit from the text editor. - -Now, we'll point our web browser to our machine running lighttpd using its ip address or domain name with the info.php file path as [http://lighttpd.linoxide.com/info.php](http://lighttpd.linoxide.com/info.php) If everything was done as described above, we will see our PHP information page as shown below. - -![phpinfo lighttpd](http://blog.linoxide.com/wp-content/uploads/2016/02/phpinfo-lighttpd.png) - -### Conclusion - -Finally we have successfully installed the world's lightweight, fast and secure web server Lighttpd in our machine running CentOS 7 and Ubuntu 15.04 linux distributions. Once its ready, we can upload our website files into our web root, configure virtual host, enable ssl, connect database, run web apps and much more with our lighttpd web server. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you ! Enjoy :-) - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/setup-lighttpd-web-server-ubuntu-15-04-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/ diff --git a/translated/tech/20160219 How to Setup Lighttpd Web server on Ubuntu 15.04 or CentOS 7.md b/translated/tech/20160219 How to Setup Lighttpd Web server on Ubuntu 15.04 or CentOS 7.md new file mode 100644 index 0000000000..8840e8b973 --- /dev/null +++ b/translated/tech/20160219 How to Setup Lighttpd Web server on Ubuntu 15.04 or CentOS 7.md @@ -0,0 +1,210 @@ +[Translated] Haohong Wang +如何在Ubuntu 15.04/CentOS 7中安装Lighttpd Web server +================================================================================= +Lighttpd 是一款开源Web服务器软件。Lighttpd 安全快速,符合行业标准,适配性强并且针对高配置环境进行了优化。Lighttpd因其CPU、内存占用小,针对小型CPU加载的快速适配以及出色的效率和速度而从众多Web服务器中脱颖而出。 而Lighttpd诸如FastCGI,CGI,Auth,Out-Compression,URL-Rewriting等高级功能更是那些低配置的服务器的福音。 + +以下便是在我们运行Ubuntu 15.04 或CentOS 7 Linux发行版的机器上安装Lighttpd Web服务器的简要流程。 + +### 安装Lighttpd + +#### 使用包管理器安装 + +这里我们通过使用包管理器这种最简单的方法来安装Lighttpd。只需以sudo模式在终端或控制台中输入下面的指令即可。 + +**CentOS 7** + +由于CentOS 7.0官方repo中并没有提供Lighttpd,所以我们需要在系统中安装额外的软件源epel repo。使用下面的yum指令来安装epel。 + + # yum install epel-release + +然后,我们需要更新系统及进程为Lighttpd的安装做准备。 + + # yum update + # yum install lighttpd + +![Install Lighttpd Centos](http://blog.linoxide.com/wp-content/uploads/2016/02/install-lighttpd-centos.png) + +**Ubuntu 15.04** + +Ubuntu 15.04官方repo中包含了Lighttpd,所以只需更新本地repo并使用apt-get指令即可安装Lighttpd。 + + # apt-get update + # apt-get install lighttpd + +![Install lighttpd ubuntu](http://blog.linoxide.com/wp-content/uploads/2016/02/install-lighttpd-ubuntu.png) + +#### 从源代码安装Lighttpd + +如果想从Lighttpd源码安装最新版本(例如1.4.39),我们需要在本地编译源码并进行安装。首先我们要安装编译源码所需的依赖包。 + + # cd /tmp/ + # wget http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.39.tar.gz + +下载完成后,执行下面的指令解压缩。 + + # tar -zxvf lighttpd-1.4.39.tar.gz + +然后使用下面的指令进行编译。 + + # cd lighttpd-1.4.39 + # ./configure + # make + +**注:**在这份教程中,我们安装的是默认配置的Lighttpd。其他诸如高级功能或拓展功能,如对SSL的支持,mod_rewrite,mod_redirect等,需自行配置。 + +当编译完成后,我们就可以把它安装到系统中了。 + + # make install + +### 设置Lighttpd + +如果有更高的需求,我们可以通过修改默认设置文件,如`/etc/lighttpd/lighttpd.conf`,来对Lighttpd进行进一步设置。 而在这份教程中我们将使用默认设置,不对设置文件进行修改。如果你曾做过修改并想检查设置文件是否出错,可以执行下面的指令。 + + # lighttpd -t -f /etc/lighttpd/lighttpd.conf + +#### 使用 CentOS 7 + +在CentOS 7中,我们需在Lighttpd默认设置中创设一个例如`/src/www/htdocs`的webroot文件夹。 + + # mkdir -p /srv/www/htdocs/ + +而后将默认欢迎页面从`/var/www/lighttpd`复制至刚刚新建的目录中: + + # cp -r /var/www/lighttpd/* /srv/www/htdocs/ + +### 开启服务 + +现在,通过执行systemctl指令来重启数据库服务。 + + # systemctl start lighttpd + +然后我们将它设置为伴随系统启动自动运行。 + + # systemctl enable lighttpd + +### 设置防火墙 + +如要让我们运行在Lighttpd上的网页和网站能在Internet或相似的网络上被访问,我们需要在防火墙程序中设置打开80端口。由于CentOS 7和Ubuntu15.04都附带Systemd作为默认初始化系统,所以我们安装firewalld作为解决方案。如果要打开80端口或http服务,我们只需执行下面的命令: + + # firewall-cmd --permanent --add-service=http + success + # firewall-cmd --reload + success + +### 连接至Web Server +在将80端口设置为默认端口后,我们就可以默认直接访问Lighttpd的欢迎页了。我们需要根据运行Lighttpd的设备来设置浏览器的IP地址和域名。在本教程中,我们令浏览器指向 [http://lighttpd.linoxide.com/](http://lighttpd.linoxide.com/) 同时将子域名指向它的IP地址。如此一来,我们就可以在浏览器中看到如下的欢迎页面了。 + +![Lighttpd Welcome Page](http://blog.linoxide.com/wp-content/uploads/2016/02/lighttpd-welcome-page.png) + +此外,我们可以将网站的文件添加到webroot目录下,并删除lighttpd的默认索引文件,使我们的静态网站链接至互联网上。 + +如果想在Lighttpd Web Server中运行PHP应用,请参考下面的步骤: + +### 安装PHP5模块 +在Lighttpd成功安装后,我们需要安装PHP及相关模块以在Lighttpd中运行PHP5脚本。 + +#### 使用 Ubuntu 15.04 + + # apt-get install php5 php5-cgi php5-fpm php5-mysql php5-curl php5-gd php5-intl php5-imagick php5-mcrypt php5-memcache php-pear + +#### 使用 CentOS 7 + + # yum install php php-cgi php-fpm php-mysql php-curl php-gd php-intl php-pecl-imagick php-mcrypt php-memcache php-pear lighttpd-fastcgi + +### 设置Lighttpd的PHP服务 + +如要让PHP与Lighttpd协同工作,我们只要根据所使用的发行版执行如下对应的指令即可。 + +#### 使用 CentOS 7 + +首先要做的便是使用文件编辑器编辑php设置文件(例如`/etc/php.ini`)并取消掉对**cgi.fix_pathinfo=1**的注释。 + + # nano /etc/php.ini + +完成上面的步骤之后,我们需要把PHP-FPM进程的所有权从Apache转移至Lighttpd。要完成这些,首先用文件编辑器打开`/etc/php-fpm.d/www.conf`文件。 + + # nano /etc/php-fpm.d/www.conf + +然后在文件中增加下面的语句: + + user = lighttpd + group = lighttpd + +做完这些,我们保存并退出文本编辑器。然后从`/etc/lighttpd/modules.conf`设置文件中添加FastCGI模块。 + + # nano /etc/lighttpd/modules.conf + +然后,去掉下面语句前面的`#`来取消对它的注释。 + + include "conf.d/fastcgi.conf" + +最后我们还需在文本编辑器设置FastCGI的设置文件。 + + # nano /etc/lighttpd/conf.d/fastcgi.conf + +在文件尾部添加以下代码: + + fastcgi.server += ( ".php" => + (( + "host" => "127.0.0.1", + "port" => "9000", + "broken-scriptfilename" => "enable" + )) + ) + +在编辑完成后保存并退出文本编辑器即可。 + +#### 使用 Ubuntu 15.04 + +如需启用Lighttpd的FastCGI,只需执行下列代码: + + # lighttpd-enable-mod fastcgi + + Enabling fastcgi: ok + Run /etc/init.d/lighttpd force-reload to enable changes + + # lighttpd-enable-mod fastcgi-php + + Enabling fastcgi-php: ok + Run `/etc/init.d/lighttpd` force-reload to enable changes + +然后,执行下列命令来重启Lighttpd。 + + # systemctl force-reload lighttpd + +### 检测PHP工作状态 + +如需检测PHP是否按预期工作,我们需在Lighttpd的webroot目录下新建一个php文件。本教程中,在Ubuntu下/var/www/html 目录,CentOS下/src/www/htdocs目录下使用文本编辑器创建并打开info.php。 + +**使用 CentOS 7** + + # nano /var/www/info.php + +**使用 Ubuntu 15.04** + + # nano /srv/www/htdocs/info.php + +然后只需将下面的语句添加到文件里即可。 + + + +在编辑完成后保存并推出文本编辑器即可。 + +现在,我们需根据路径 [http://lighttpd.linoxide.com/info.php](http://lighttpd.linoxide.com/info.php) 下的info.php文件的IP地址或域名,来让我们的网页浏览器指向系统上运行的Lighttpd。如果一切都按照以上说明进行,我们将看到如下图所示的PHP页面信息。 + +![phpinfo lighttpd](http://blog.linoxide.com/wp-content/uploads/2016/02/phpinfo-lighttpd.png) + +### 总结 + +至此,我们已经在CentOS 7和Ubuntu 15.04 Linux 发行版上成功安装了轻巧快捷并且安全的Lighttpd Web服务器。现在,我们已经可以利用Lighttpd Web服务器来实现上传网站文件到网站根目录,配置虚拟主机,启用SSL,连接数据库,运行Web应用等功能了。 如果你有任何疑问,建议或反馈请在下面的评论区中写下来以让我们更好的改良Lighttpd。谢谢!(译注:评论网址 http://linoxide.com/linux-how-to/setup-lighttpd-web-server-ubuntu-15-04-centos-7/ ) +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/setup-lighttpd-web-server-ubuntu-15-04-centos-7/ + +作者:[Arun Pyasi][a] +译者:[HaohongWANG](https://github.com/HaohongWANG) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ From 54df9889e0dca5ff774ec1598d627636eefb6b70 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 6 Mar 2016 14:27:31 +0800 Subject: [PATCH 0486/1469] =?UTF-8?q?20160306-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit keyword: NASA , Image Process , Node.js , OpenCV --- ...ocessing at NASA with open source tools.md | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 sources/tech/20160304 Image processing at NASA with open source tools.md diff --git a/sources/tech/20160304 Image processing at NASA with open source tools.md b/sources/tech/20160304 Image processing at NASA with open source tools.md new file mode 100644 index 0000000000..7bf6d8297d --- /dev/null +++ b/sources/tech/20160304 Image processing at NASA with open source tools.md @@ -0,0 +1,81 @@ +Image processing at NASA with open source tools +======================================================= + +keyword: NASA , Image Process , Node.js , OpenCV + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/nasa_spitzer_space_pink_spiral.jpg?itok=3XEUstkl) + +This past summer, I was an intern at the [GVIS][1] Lab at [NASA][2] Glenn, where I brought my passion for open source into the lab. My task was to improve our lab's contributions to an open source fluid flow dynamics [simulation][3] developed by Dan Schroeder. The original simulation presents obstacles that users can draw in with their mouse to model computational fluid dynamics. My team contributed by adding image processing code that analyzes each frame of a live video feed to show how a physical object interacts with a fluid. But, there was more for us to do. + +We wanted to make the image processing more robust, so I worked on improving the image processing library. + +With the new library, the simulation would be able to detect contours, perform coordinate transformations in place, and find the center of mass of an object. The image processing doesn't directly relate to the physics of the fluid flow dynamics simulation. It detects the object with a camera and creates a barrier for the fluid flow simulation by getting the outline of the object. Then, the fluid flow simulation runs, and the output is projected down onto the actual object. + +My goal was to improve the simulation in three ways: + +1. to find accurate contours of an object +2. to find the center of mass of an object +3. to be able to perform accurate transformations about the center of an object + +My mentor recommended that I install [Node.js][4], [OpenCV][5], and the [Node.js bindings for OpenCV][6]. While I was waiting for those to install, I looked at the example code on the OpenCV bindings on their [GitHub page][7]. I discovered that the example code was in JavaScript, so because I didn’t know JavaScript, I started a short course from Codecademy. Two days later, I was sick of JavaScript but ready to start my project... which involved yet more JavaScript. + +The example contour-finding code worked well. In fact, it allowed me to accomplish my first goal in a matter of hours! To get the contours of an image, here's what it looked like: + +![](https://opensource.com/sites/default/files/resize/image_processing_nasa_1-520x293.jpg) +>The original image with all of the contours. + +The example contour-finding code worked a bit too well. Instead of the contour of the object being detected, all of the contours in the image were detected. This would have resulted in the simulation interacting with all of the unwanted contours. This is a problem because it would return incorrect data. To keep the simulation from interacting with the unwanted contours, I added an area constraint. If the contour was in a certain area range, then it would be drawn. The area constraint resulted in a much cleaner contour. + +![](https://opensource.com/sites/default/files/resize/image_processing_nasa_2-520x293.jpg) +>The filtered contour with the shadow contour. + +Though the extraneous contours weren't detected, there was still a problem with the image. There was only one contour in the image, but it doubled back on itself and wasn't complete. Area couldn't be a deciding factor here, so it was time to try something else. + +This time around, instead of immediately finding the contours, I first converted the image into a binary image. A binary image is an image where each pixel is either black or white. To get a binary image I first converted the color image to grayscale. Once the image was in grayscale, I called the threshold method on the image. The threshold method went through the image pixel by pixel and if the color value of the pixel was less than 30, the pixel color would be changed to black. Otherwise, the pixel value would be turned to white. After the original image was converted to a binary image, the resulting image looked like this: + +![](https://opensource.com/sites/default/files/resize/image_processing_nasa_3-520x293.jpg) +>The binary image. + +Then I got the contours from the binary image, which resulted in a much cleaner contour, without the shadow contour. + +![](https://opensource.com/sites/default/files/image_processing_nasa_4.jpg) +>The final clean contour. + +At this point, I was able to get clean contours and detect the center of mass. Unfortunately, I didn't have enough time to be able to complete transformations about the center of mass. Since I only had a few days left in my internship, I started to think about other things I could do within a limited time span. One of those things was the bounding rectangle. The bounding rectangle is a quadrilateral with the smallest area that contains the entire contour of an image. The bounding rectangle is important because it is key in scaling the contour on the page. Unfortunately I didn't have time to do much with the bounding rectangle, but I still wanted to learn about it because it's a useful tool. + +Finally, after all of that, I was able to finish processing the image! + +![](https://opensource.com/sites/default/files/resize/image_processing_nasa_5-521x293.jpg) +>The final image with bounding rectangle and center of mass in red. + +Once the image processing code was complete, I replaced the old image processing code in the simulation with my code. To my surprise, it worked! + +Well, mostly. + +The program had a memory leak in it, which leaked 100MB every 1/10 of a second. I was glad that it wasn’t because of my code. The bad thing was that fixing it was out of my control. The good thing was that there was a workaround that I could use. It was less than ideal, but it checked the amount of memory the simulation was using and when it used more than 1 GiB, the simulation restarted. + +At the NASA lab, we use a lot of open source software, and my work there isn't possible without it. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/16/3/image-processing-nasa + +作者:[Lauren Egts][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/laurenegts +[1]: https://ocio.grc.nasa.gov/gvis/ +[2]: http://www.nasa.gov/centers/glenn/home/index.html +[3]: http://physics.weber.edu/schroeder/fluids/ +[4]: http://nodejs.org/ +[5]: http://opencv.org/ +[6]: https://github.com/peterbraden/node-opencv +[7]: https://github.com/peterbraden/node-opencv + + + + + From 31e0cc9057849be5238a02346451ce917315178d Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 6 Mar 2016 14:41:20 +0800 Subject: [PATCH 0487/1469] =?UTF-8?q?20160306-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit keyword: shell , Linux , bash , zsh , fish , ksh , tcsh , license --- ... 5 open source command shells for Linux.md | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 sources/tech/20160303 Top 5 open source command shells for Linux.md diff --git a/sources/tech/20160303 Top 5 open source command shells for Linux.md b/sources/tech/20160303 Top 5 open source command shells for Linux.md new file mode 100644 index 0000000000..74c135e594 --- /dev/null +++ b/sources/tech/20160303 Top 5 open source command shells for Linux.md @@ -0,0 +1,89 @@ +Top 5 open source command shells for Linux +=============================================== + +keyword: shell , Linux , bash , zsh , fish , ksh , tcsh , license + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/terminal_blue_smoke_command_line_0.jpg?itok=u2mRRqOa) + +There are two kinds of Linux users: the cautious and the adventurous. + +On one side is the user who almost reflexively tries out ever new option which hits the scene. They’ve tried handfuls of window managers, dozens of distributions, and every new desktop widget they can find. + +On the other side is the user who finds something they like and sticks with it. They tend to like their distribution’s defaults. If they’re passionate about a text editor, it’s whichever one they mastered first. + +As a Linux user, both on the server and the desktop, for going on fifteen years now, I am definitely more in the second category than the first. I have a tendency to use what’s presented to me, and I like the fact that this means more often than not I can find thorough documentation and examples of most any use case I can dream up. If I used something non-standard, the switch was carefully researched and often predicated by a strong pitch from someone I trust. + +But that doesn’t mean I don’t like to sometimes try and see what I’m missing. So recently, after years of using the bash shell without even giving it a thought, I decided to try out four alternative shells: ksh, tcsh, zsh, and fish. All four were easy installs from my default repositories in Fedora, and they’re likely already packaged for your distribution of choice as well. + +Here’s a little bit on each option and why you might choose it to be your next Linux command-line interpreter. + +### bash + +First, let’s take a look back at the familiar. [GNU Bash][1], the Bourne Again Shell, has been the default in pretty much every Linux distribution I’ve used through the years. Originally released in 1989, bash has grown to easily become the most used shell across the Linux world, and it is commonly found in other unix-like operating systems as well. + +Bash is a perfectly respectable shell, and as you look for documentation of how to do various things across the Internet, almost invariably you’ll find instructions which assume you are using a bash shell. But bash has some shortcomings, as anyone who has ever written a bash script that’s more than a few lines can attest to. It’s not that you can’t do something, it’s that it’s not always particularly intuitive (or at least elegant) to read and write. For some examples, see this list of [common bash pitfalls][2]. + +That said, bash is probably here to stay for at least the near future, with its enormous install base and legions of both casual and professional system administrators who are already attuned to its usage, and quirks. The bash project is available under a [GPLv3][3] license. + +### ksh + +[KornShell][4], also known by its command invocation, ksh, is an alternative shell that grew out of Bell Labs in the 1980s, written by David Korn. While originally proprietary software, later versions were released under the [Eclipse Public License][5]. + +Proponents of ksh list a number of ways in which they feel it is superior, including having a better loop syntax, cleaner exit codes from pipes, an easier way to repeat commands, and associative arrays. It's also capable of emulating many of the behaviors of vi or emacs, so if you are very partial to a text editor, it may be worth giving a try. Overall, I found it to be very similar to bash for basic input, although for advanced scripting it would surely be a different experience. + +### tcsh + +[Tcsh][6] is a derivative of csh, the Berkely Unix C shell, and sports a very long lineage back to the early days of Unix and computing itself. + +The big selling point for tcsh is its scripting language, which should look very familiar to anyone who has programmed in C. Tcsh's scripting is loved by some and hated by others. But it has other features as well, including adding arguments to aliases, and various defaults that might appeal to your preferences, including the way autocompletion with tab and history tab completion work. + +You can find tcsh under a [BSD license][7]. + +### zsh + +[Zsh][8] is another shell which has similarities to bash and ksh. Originating in the early 90s, zsh sports a number of useful features, including spelling correction, theming, namable directory shortcuts, sharing your command history across multiple terminals, and various other slight tweaks from the original Bourne shell. + +The code and binaries for zsh can be distributed under an MIT-like license, though portions are under the GPL; check the [actual license][9] for details. + +### fish + +I knew I was going to like the Friendly Interactive Shell, [fish][10], when I visited the website and found it described tongue-in-cheek with "Finally, a command line shell for the 90s"—fish was written in 2005. + +The authors of fish offer a number of reasons to make the switch, all invoking a bit of humor and poking a bit of fun at shells that don't quite live up. Features include autosuggestions ("Watch out, Netscape Navigator 4.0"), support of the "astonishing" 256 color palette of VGA, but some actually quite helpful features as well including command completion based on the man pages on your machine, clean scripting, and a web-based configuration. + +Fish is licensed primarily unde the GPL version 2 but with portions under other licenses; check the repository for [complete information][11]. + +*** + +Looking for a more detailed rundown on the precise differences between each option? [This site][12] ought to help you out. + +So where did I land? Well, ultimately, I’m probably going back to bash, because the differences were subtle enough that someone who mostly used the command line interactively as opposed to writing advanced scripts really wouldn't benefit much from the switch, and I'm already pretty comfortable in bash. + +But I’m glad I decided to come out of my shell (ha!) and try some new options. And I know there are many, many others out there. Which shells have you tried, and which one do you prefer? Let us know in the comments! + + + + +via: https://opensource.com/business/16/3/top-linux-shells + +作者:[Jason Baker][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/jason-baker + +[1]: https://www.gnu.org/software/bash/ +[2]: http://mywiki.wooledge.org/BashPitfalls +[3]: http://www.gnu.org/licenses/gpl.html +[4]: http://www.kornshell.org/ +[5]: https://www.eclipse.org/legal/epl-v10.html +[6]: http://www.tcsh.org/Welcome +[7]: https://en.wikipedia.org/wiki/BSD_licenses +[8]: http://www.zsh.org/ +[9]: https://sourceforge.net/p/zsh/code/ci/master/tree/LICENCE +[10]: https://fishshell.com/ +[11]: https://github.com/fish-shell/fish-shell/blob/master/COPYING +[12]: http://hyperpolyglot.org/unix-shells + From 110043eefa1bd5b4e3820f58aa5308e165cc2b64 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 6 Mar 2016 16:39:11 +0800 Subject: [PATCH 0488/1469] translating --- ...th-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/news/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md b/sources/news/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md index d40a1c9e6f..63c82074d3 100644 --- a/sources/news/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md +++ b/sources/news/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md @@ -1,3 +1,5 @@ +Translating---geekpi + OpenSSH 7.2 Out Now with Support for RSA Signatures Using SHA-256/512 Algorithms ======================================================== From fbe4c229c106303b8fc5a57f4b9bc98b51d48d8d Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 6 Mar 2016 17:02:18 +0800 Subject: [PATCH 0489/1469] translated --- ...-Signatures-Using-SHA-256512 Algorithms.md | 34 ------------------- ...-Signatures-Using-SHA-256512 Algorithms.md | 33 ++++++++++++++++++ 2 files changed, 33 insertions(+), 34 deletions(-) delete mode 100644 sources/news/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md create mode 100644 translated/news/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md diff --git a/sources/news/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md b/sources/news/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md deleted file mode 100644 index 63c82074d3..0000000000 --- a/sources/news/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md +++ /dev/null @@ -1,34 +0,0 @@ -Translating---geekpi - -OpenSSH 7.2 Out Now with Support for RSA Signatures Using SHA-256/512 Algorithms -======================================================== - -**Today, February 29, 2016, the OpenBSD project had the great pleasure of announcing the release and immediate availability for download of OpenSSH 7.2 for all supported platforms.** - -According to the internal [release notes][1], also attached at the end of the article for reference, OpenSSH 7.2 is primarily a bugfix release, fixing most of the issues reported by users or discovered by the development team since the release of OpenSSH 7.1p2, but we can see several new features as well. - -Among these, we can mention support for RSA signatures using SHA-256 or SHA-256 512 hash algorithms, the addition of an AddKeysToAgent client option to add private keys used for authentication to the ssh-agent, and the implementation of the "restrict" authorized_keys option for storing key restrictions. - -Furthermore, there's now an ssh_config CertificateFile option for explicitly listing certificates, the ssh-keygen is now capable of changing the key comment for all supported formats, fingerprinting is now allowed from standard input and for multiple public keys in a file. - -### ssh-keygen now supports multiple certificates - -In addition to the changes mentioned above, OpenSSH 7.2 adds support for multiple certificates to ssh-keygen, one per line, implements the "none" argument for sshd_config ChrootDirectory and Foreground, and the "-c" flag allows ssh-keyscan to fetch certificates instead of plain keys. - -Last but not least, OpenSSH 7.2 no longer enables by default all flavors of the rijndael-cbc aliases for AES, blowfish-cbc, and cast128-cbc legacy ciphers, as well as MD5-based and truncated HMAC algorithms. The getrandom() syscall is now supported under Linux. [Download OpenSSH 7.2][2] and check the changelog below for some additional details about exactly what has been fixed in this major release. - - - --------------------------------------------------------------------------------- - -via: http://news.softpedia.com/news/openssh-7-2-out-now-with-support-for-rsa-signatures-using-sha-256-512-algorithms-501111.shtml - -作者:[Marius Nestor][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://news.softpedia.com/editors/browse/marius-nestor -[1]: http://www.openssh.com/txt/release-7.2 -[2]: http://linux.softpedia.com/get/Security/OpenSSH-4474.shtml diff --git a/translated/news/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md b/translated/news/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md new file mode 100644 index 0000000000..d3cf0e8e8b --- /dev/null +++ b/translated/news/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md @@ -0,0 +1,33 @@ +使用SHA-256/512算法作为RSA签名的OpenSSH 7.2发布了 +======================================================== + +**今天,2016.2.29,OpenBSD项目很高兴地宣布OpenSSH 7.2发布了,并且很块可在所有支持的平台下载。** + +根据内部[发布公告][1],该公告附在了文章的最后,OpenSSH 7.2主要是bug修复,修改了自OpenSSH 7.1p2以来由用户报告和开发团队发现的问题,但是我们可以看到几个新功能。 + +这其中,我们可以提到使用了SHA-256 或者 SHA-256 512哈希算法的RSA签名,增加了一个AddKeysToAgent客户端选项添加用于身份验证的ssh-agent的私钥,和实现了一个“restrict”级别的authorized_keys选项用于存储键限制。 + +此外,现在ssh_config中CertificateFile选项可以明确列出证书,ssh-keygen现在能够改所有支持的格式的密钥注释、指纹可以来自标准输入,文件可含多个公钥。 + +### ssh-keygen现在支持多证书 + +除了上面提到的,OpenSSH 7.2正加了ssh-keygen多证书的支持,一个一行,实现了sshd_config ChrootDirectory及前台的0参数,“-c”标志允许ssh-keyscan取回证书而不是文本密钥。 + +最后但并非最不重要的,OpenSSH 7.3不再默认启用rijndael-cbc也叫AES,blowfish-cbc、古老的cast128-cbc密码,同样还有基于MD5和截断的HMAC算法。getrandom()系统调用在Linux中支持。[下载OpenSSH 7.2][2]并在更新日志中查看更细节的在本主要更新中修复的问题。 + + + + +-------------------------------------------------------------------------------- + +via: http://news.softpedia.com/news/openssh-7-2-out-now-with-support-for-rsa-signatures-using-sha-256-512-algorithms-501111.shtml + +作者:[Marius Nestor][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://news.softpedia.com/editors/browse/marius-nestor +[1]: http://www.openssh.com/txt/release-7.2 +[2]: http://linux.softpedia.com/get/Security/OpenSSH-4474.shtml From 5e16d7165d8f840540df33aa67cf2118cff4c553 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 6 Mar 2016 17:03:29 +0800 Subject: [PATCH 0490/1469] Revert "translated" This reverts commit fbe4c229c106303b8fc5a57f4b9bc98b51d48d8d. --- ...-Signatures-Using-SHA-256512 Algorithms.md | 34 +++++++++++++++++++ ...-Signatures-Using-SHA-256512 Algorithms.md | 33 ------------------ 2 files changed, 34 insertions(+), 33 deletions(-) create mode 100644 sources/news/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md delete mode 100644 translated/news/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md diff --git a/sources/news/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md b/sources/news/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md new file mode 100644 index 0000000000..63c82074d3 --- /dev/null +++ b/sources/news/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md @@ -0,0 +1,34 @@ +Translating---geekpi + +OpenSSH 7.2 Out Now with Support for RSA Signatures Using SHA-256/512 Algorithms +======================================================== + +**Today, February 29, 2016, the OpenBSD project had the great pleasure of announcing the release and immediate availability for download of OpenSSH 7.2 for all supported platforms.** + +According to the internal [release notes][1], also attached at the end of the article for reference, OpenSSH 7.2 is primarily a bugfix release, fixing most of the issues reported by users or discovered by the development team since the release of OpenSSH 7.1p2, but we can see several new features as well. + +Among these, we can mention support for RSA signatures using SHA-256 or SHA-256 512 hash algorithms, the addition of an AddKeysToAgent client option to add private keys used for authentication to the ssh-agent, and the implementation of the "restrict" authorized_keys option for storing key restrictions. + +Furthermore, there's now an ssh_config CertificateFile option for explicitly listing certificates, the ssh-keygen is now capable of changing the key comment for all supported formats, fingerprinting is now allowed from standard input and for multiple public keys in a file. + +### ssh-keygen now supports multiple certificates + +In addition to the changes mentioned above, OpenSSH 7.2 adds support for multiple certificates to ssh-keygen, one per line, implements the "none" argument for sshd_config ChrootDirectory and Foreground, and the "-c" flag allows ssh-keyscan to fetch certificates instead of plain keys. + +Last but not least, OpenSSH 7.2 no longer enables by default all flavors of the rijndael-cbc aliases for AES, blowfish-cbc, and cast128-cbc legacy ciphers, as well as MD5-based and truncated HMAC algorithms. The getrandom() syscall is now supported under Linux. [Download OpenSSH 7.2][2] and check the changelog below for some additional details about exactly what has been fixed in this major release. + + + +-------------------------------------------------------------------------------- + +via: http://news.softpedia.com/news/openssh-7-2-out-now-with-support-for-rsa-signatures-using-sha-256-512-algorithms-501111.shtml + +作者:[Marius Nestor][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://news.softpedia.com/editors/browse/marius-nestor +[1]: http://www.openssh.com/txt/release-7.2 +[2]: http://linux.softpedia.com/get/Security/OpenSSH-4474.shtml diff --git a/translated/news/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md b/translated/news/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md deleted file mode 100644 index d3cf0e8e8b..0000000000 --- a/translated/news/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md +++ /dev/null @@ -1,33 +0,0 @@ -使用SHA-256/512算法作为RSA签名的OpenSSH 7.2发布了 -======================================================== - -**今天,2016.2.29,OpenBSD项目很高兴地宣布OpenSSH 7.2发布了,并且很块可在所有支持的平台下载。** - -根据内部[发布公告][1],该公告附在了文章的最后,OpenSSH 7.2主要是bug修复,修改了自OpenSSH 7.1p2以来由用户报告和开发团队发现的问题,但是我们可以看到几个新功能。 - -这其中,我们可以提到使用了SHA-256 或者 SHA-256 512哈希算法的RSA签名,增加了一个AddKeysToAgent客户端选项添加用于身份验证的ssh-agent的私钥,和实现了一个“restrict”级别的authorized_keys选项用于存储键限制。 - -此外,现在ssh_config中CertificateFile选项可以明确列出证书,ssh-keygen现在能够改所有支持的格式的密钥注释、指纹可以来自标准输入,文件可含多个公钥。 - -### ssh-keygen现在支持多证书 - -除了上面提到的,OpenSSH 7.2正加了ssh-keygen多证书的支持,一个一行,实现了sshd_config ChrootDirectory及前台的0参数,“-c”标志允许ssh-keyscan取回证书而不是文本密钥。 - -最后但并非最不重要的,OpenSSH 7.3不再默认启用rijndael-cbc也叫AES,blowfish-cbc、古老的cast128-cbc密码,同样还有基于MD5和截断的HMAC算法。getrandom()系统调用在Linux中支持。[下载OpenSSH 7.2][2]并在更新日志中查看更细节的在本主要更新中修复的问题。 - - - - --------------------------------------------------------------------------------- - -via: http://news.softpedia.com/news/openssh-7-2-out-now-with-support-for-rsa-signatures-using-sha-256-512-algorithms-501111.shtml - -作者:[Marius Nestor][a] -译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://news.softpedia.com/editors/browse/marius-nestor -[1]: http://www.openssh.com/txt/release-7.2 -[2]: http://linux.softpedia.com/get/Security/OpenSSH-4474.shtml From cf3c03be58f508073adac520564761cfbda1ae48 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 6 Mar 2016 17:06:20 +0800 Subject: [PATCH 0491/1469] revert --- ...-Signatures-Using-SHA-256512 Algorithms.md | 34 ------------------- ...-Signatures-Using-SHA-256512 Algorithms.md | 33 ++++++++++++++++++ 2 files changed, 33 insertions(+), 34 deletions(-) delete mode 100644 sources/news/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md create mode 100644 translated/news/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md diff --git a/sources/news/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md b/sources/news/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md deleted file mode 100644 index 63c82074d3..0000000000 --- a/sources/news/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md +++ /dev/null @@ -1,34 +0,0 @@ -Translating---geekpi - -OpenSSH 7.2 Out Now with Support for RSA Signatures Using SHA-256/512 Algorithms -======================================================== - -**Today, February 29, 2016, the OpenBSD project had the great pleasure of announcing the release and immediate availability for download of OpenSSH 7.2 for all supported platforms.** - -According to the internal [release notes][1], also attached at the end of the article for reference, OpenSSH 7.2 is primarily a bugfix release, fixing most of the issues reported by users or discovered by the development team since the release of OpenSSH 7.1p2, but we can see several new features as well. - -Among these, we can mention support for RSA signatures using SHA-256 or SHA-256 512 hash algorithms, the addition of an AddKeysToAgent client option to add private keys used for authentication to the ssh-agent, and the implementation of the "restrict" authorized_keys option for storing key restrictions. - -Furthermore, there's now an ssh_config CertificateFile option for explicitly listing certificates, the ssh-keygen is now capable of changing the key comment for all supported formats, fingerprinting is now allowed from standard input and for multiple public keys in a file. - -### ssh-keygen now supports multiple certificates - -In addition to the changes mentioned above, OpenSSH 7.2 adds support for multiple certificates to ssh-keygen, one per line, implements the "none" argument for sshd_config ChrootDirectory and Foreground, and the "-c" flag allows ssh-keyscan to fetch certificates instead of plain keys. - -Last but not least, OpenSSH 7.2 no longer enables by default all flavors of the rijndael-cbc aliases for AES, blowfish-cbc, and cast128-cbc legacy ciphers, as well as MD5-based and truncated HMAC algorithms. The getrandom() syscall is now supported under Linux. [Download OpenSSH 7.2][2] and check the changelog below for some additional details about exactly what has been fixed in this major release. - - - --------------------------------------------------------------------------------- - -via: http://news.softpedia.com/news/openssh-7-2-out-now-with-support-for-rsa-signatures-using-sha-256-512-algorithms-501111.shtml - -作者:[Marius Nestor][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://news.softpedia.com/editors/browse/marius-nestor -[1]: http://www.openssh.com/txt/release-7.2 -[2]: http://linux.softpedia.com/get/Security/OpenSSH-4474.shtml diff --git a/translated/news/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md b/translated/news/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md new file mode 100644 index 0000000000..d3cf0e8e8b --- /dev/null +++ b/translated/news/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md @@ -0,0 +1,33 @@ +使用SHA-256/512算法作为RSA签名的OpenSSH 7.2发布了 +======================================================== + +**今天,2016.2.29,OpenBSD项目很高兴地宣布OpenSSH 7.2发布了,并且很块可在所有支持的平台下载。** + +根据内部[发布公告][1],该公告附在了文章的最后,OpenSSH 7.2主要是bug修复,修改了自OpenSSH 7.1p2以来由用户报告和开发团队发现的问题,但是我们可以看到几个新功能。 + +这其中,我们可以提到使用了SHA-256 或者 SHA-256 512哈希算法的RSA签名,增加了一个AddKeysToAgent客户端选项添加用于身份验证的ssh-agent的私钥,和实现了一个“restrict”级别的authorized_keys选项用于存储键限制。 + +此外,现在ssh_config中CertificateFile选项可以明确列出证书,ssh-keygen现在能够改所有支持的格式的密钥注释、指纹可以来自标准输入,文件可含多个公钥。 + +### ssh-keygen现在支持多证书 + +除了上面提到的,OpenSSH 7.2正加了ssh-keygen多证书的支持,一个一行,实现了sshd_config ChrootDirectory及前台的0参数,“-c”标志允许ssh-keyscan取回证书而不是文本密钥。 + +最后但并非最不重要的,OpenSSH 7.3不再默认启用rijndael-cbc也叫AES,blowfish-cbc、古老的cast128-cbc密码,同样还有基于MD5和截断的HMAC算法。getrandom()系统调用在Linux中支持。[下载OpenSSH 7.2][2]并在更新日志中查看更细节的在本主要更新中修复的问题。 + + + + +-------------------------------------------------------------------------------- + +via: http://news.softpedia.com/news/openssh-7-2-out-now-with-support-for-rsa-signatures-using-sha-256-512-algorithms-501111.shtml + +作者:[Marius Nestor][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://news.softpedia.com/editors/browse/marius-nestor +[1]: http://www.openssh.com/txt/release-7.2 +[2]: http://linux.softpedia.com/get/Security/OpenSSH-4474.shtml From e88c20e9de6a2eb539f06f209a3952b24206e915 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 6 Mar 2016 22:20:33 +0800 Subject: [PATCH 0492/1469] =?UTF-8?q?=E5=BD=92=E6=A1=A3=20201602?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...er Using Windows 10 After More than 8 Years--See Comparison.md | 0 .../20150824 Great Open Source Collaborative Editing Tools.md | 0 ...How to install Suricata intrusion detection system on Linux.md | 0 ...f Free Software Foundation--Best Quotes of Richard Stallman.md | 0 .../20151030 80 Linux Monitoring Tools for SysAdmins.md | 0 ...w to Install SQLite 3.9.1 with JSON Support on Ubuntu 15.04.md | 0 ... How to Install Revive Adserver on Ubuntu 15.04 or CentOS 7.md | 0 ...Foundation Explains a 'World without Linux' and Open Source.md | 0 published/{ => 201602}/20151201 Cinnamon 2.8 Review.md | 0 ...51201 How to use Mutt email client with encrypted passwords.md | 0 published/{ => 201602}/20151206 Supporting secure DNS in glibc.md | 0 .../{ => 201602}/20151208 6 useful LibreOffice extensions.md | 0 ...How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md | 0 ...Linux or Unix Desktop Fun--Christmas Tree For Your Terminal.md | 0 ...04 How to use KVM from the command line on Debian or Ubuntu.md | 0 ... from default to alternative Python version on Debian Linux.md | 0 ...60218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md | 0 .../{ => 201602}/20160218 Russia Announces Switch to Linux.md | 0 published/{ => 201602}/20160218 The Best Linux Distros of 2016.md | 0 .../20160220 Linux Mint 18 Will Get Its Own Set Of Apps.md | 0 ...0224 Can we tackle the Zika virus with rapid, open research.md | 0 21 files changed, 0 insertions(+), 0 deletions(-) rename published/{ => 201602}/20150818 A Linux User Using Windows 10 After More than 8 Years--See Comparison.md (100%) rename published/{ => 201602}/20150824 Great Open Source Collaborative Editing Tools.md (100%) rename published/{ => 201602}/20150906 How to install Suricata intrusion detection system on Linux.md (100%) rename published/{ => 201602}/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md (100%) rename published/{ => 201602}/20151030 80 Linux Monitoring Tools for SysAdmins.md (100%) rename published/{ => 201602}/20151104 How to Install SQLite 3.9.1 with JSON Support on Ubuntu 15.04.md (100%) rename published/{ => 201602}/20151119 How to Install Revive Adserver on Ubuntu 15.04 or CentOS 7.md (100%) rename published/{ => 201602}/20151126 Linux Foundation Explains a 'World without Linux' and Open Source.md (100%) rename published/{ => 201602}/20151201 Cinnamon 2.8 Review.md (100%) rename published/{ => 201602}/20151201 How to use Mutt email client with encrypted passwords.md (100%) rename published/{ => 201602}/20151206 Supporting secure DNS in glibc.md (100%) rename published/{ => 201602}/20151208 6 useful LibreOffice extensions.md (100%) rename published/{ => 201602}/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md (100%) rename published/{ => 201602}/20151214 Linux or Unix Desktop Fun--Christmas Tree For Your Terminal.md (100%) rename published/{ => 201602}/20160104 How to use KVM from the command line on Debian or Ubuntu.md (100%) rename published/{ => 201602}/20160126 How to change from default to alternative Python version on Debian Linux.md (100%) rename published/{ => 201602}/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md (100%) rename published/{ => 201602}/20160218 Russia Announces Switch to Linux.md (100%) rename published/{ => 201602}/20160218 The Best Linux Distros of 2016.md (100%) rename published/{ => 201602}/20160220 Linux Mint 18 Will Get Its Own Set Of Apps.md (100%) rename published/{ => 201602}/20160224 Can we tackle the Zika virus with rapid, open research.md (100%) diff --git a/published/20150818 A Linux User Using Windows 10 After More than 8 Years--See Comparison.md b/published/201602/20150818 A Linux User Using Windows 10 After More than 8 Years--See Comparison.md similarity index 100% rename from published/20150818 A Linux User Using Windows 10 After More than 8 Years--See Comparison.md rename to published/201602/20150818 A Linux User Using Windows 10 After More than 8 Years--See Comparison.md diff --git a/published/20150824 Great Open Source Collaborative Editing Tools.md b/published/201602/20150824 Great Open Source Collaborative Editing Tools.md similarity index 100% rename from published/20150824 Great Open Source Collaborative Editing Tools.md rename to published/201602/20150824 Great Open Source Collaborative Editing Tools.md diff --git a/published/20150906 How to install Suricata intrusion detection system on Linux.md b/published/201602/20150906 How to install Suricata intrusion detection system on Linux.md similarity index 100% rename from published/20150906 How to install Suricata intrusion detection system on Linux.md rename to published/201602/20150906 How to install Suricata intrusion detection system on Linux.md diff --git a/published/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md b/published/201602/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md similarity index 100% rename from published/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md rename to published/201602/20151020 30 Years of Free Software Foundation--Best Quotes of Richard Stallman.md diff --git a/published/20151030 80 Linux Monitoring Tools for SysAdmins.md b/published/201602/20151030 80 Linux Monitoring Tools for SysAdmins.md similarity index 100% rename from published/20151030 80 Linux Monitoring Tools for SysAdmins.md rename to published/201602/20151030 80 Linux Monitoring Tools for SysAdmins.md diff --git a/published/20151104 How to Install SQLite 3.9.1 with JSON Support on Ubuntu 15.04.md b/published/201602/20151104 How to Install SQLite 3.9.1 with JSON Support on Ubuntu 15.04.md similarity index 100% rename from published/20151104 How to Install SQLite 3.9.1 with JSON Support on Ubuntu 15.04.md rename to published/201602/20151104 How to Install SQLite 3.9.1 with JSON Support on Ubuntu 15.04.md diff --git a/published/20151119 How to Install Revive Adserver on Ubuntu 15.04 or CentOS 7.md b/published/201602/20151119 How to Install Revive Adserver on Ubuntu 15.04 or CentOS 7.md similarity index 100% rename from published/20151119 How to Install Revive Adserver on Ubuntu 15.04 or CentOS 7.md rename to published/201602/20151119 How to Install Revive Adserver on Ubuntu 15.04 or CentOS 7.md diff --git a/published/20151126 Linux Foundation Explains a 'World without Linux' and Open Source.md b/published/201602/20151126 Linux Foundation Explains a 'World without Linux' and Open Source.md similarity index 100% rename from published/20151126 Linux Foundation Explains a 'World without Linux' and Open Source.md rename to published/201602/20151126 Linux Foundation Explains a 'World without Linux' and Open Source.md diff --git a/published/20151201 Cinnamon 2.8 Review.md b/published/201602/20151201 Cinnamon 2.8 Review.md similarity index 100% rename from published/20151201 Cinnamon 2.8 Review.md rename to published/201602/20151201 Cinnamon 2.8 Review.md diff --git a/published/20151201 How to use Mutt email client with encrypted passwords.md b/published/201602/20151201 How to use Mutt email client with encrypted passwords.md similarity index 100% rename from published/20151201 How to use Mutt email client with encrypted passwords.md rename to published/201602/20151201 How to use Mutt email client with encrypted passwords.md diff --git a/published/20151206 Supporting secure DNS in glibc.md b/published/201602/20151206 Supporting secure DNS in glibc.md similarity index 100% rename from published/20151206 Supporting secure DNS in glibc.md rename to published/201602/20151206 Supporting secure DNS in glibc.md diff --git a/published/20151208 6 useful LibreOffice extensions.md b/published/201602/20151208 6 useful LibreOffice extensions.md similarity index 100% rename from published/20151208 6 useful LibreOffice extensions.md rename to published/201602/20151208 6 useful LibreOffice extensions.md diff --git a/published/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md b/published/201602/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md similarity index 100% rename from published/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md rename to published/201602/20151208 How to Install Bugzilla with Apache and SSL on FreeBSD 10.2.md diff --git a/published/20151214 Linux or Unix Desktop Fun--Christmas Tree For Your Terminal.md b/published/201602/20151214 Linux or Unix Desktop Fun--Christmas Tree For Your Terminal.md similarity index 100% rename from published/20151214 Linux or Unix Desktop Fun--Christmas Tree For Your Terminal.md rename to published/201602/20151214 Linux or Unix Desktop Fun--Christmas Tree For Your Terminal.md diff --git a/published/20160104 How to use KVM from the command line on Debian or Ubuntu.md b/published/201602/20160104 How to use KVM from the command line on Debian or Ubuntu.md similarity index 100% rename from published/20160104 How to use KVM from the command line on Debian or Ubuntu.md rename to published/201602/20160104 How to use KVM from the command line on Debian or Ubuntu.md diff --git a/published/20160126 How to change from default to alternative Python version on Debian Linux.md b/published/201602/20160126 How to change from default to alternative Python version on Debian Linux.md similarity index 100% rename from published/20160126 How to change from default to alternative Python version on Debian Linux.md rename to published/201602/20160126 How to change from default to alternative Python version on Debian Linux.md diff --git a/published/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md b/published/201602/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md similarity index 100% rename from published/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md rename to published/201602/20160218 Meizu PRO 5 Ubuntu Edition Announced and It's a Beast.md diff --git a/published/20160218 Russia Announces Switch to Linux.md b/published/201602/20160218 Russia Announces Switch to Linux.md similarity index 100% rename from published/20160218 Russia Announces Switch to Linux.md rename to published/201602/20160218 Russia Announces Switch to Linux.md diff --git a/published/20160218 The Best Linux Distros of 2016.md b/published/201602/20160218 The Best Linux Distros of 2016.md similarity index 100% rename from published/20160218 The Best Linux Distros of 2016.md rename to published/201602/20160218 The Best Linux Distros of 2016.md diff --git a/published/20160220 Linux Mint 18 Will Get Its Own Set Of Apps.md b/published/201602/20160220 Linux Mint 18 Will Get Its Own Set Of Apps.md similarity index 100% rename from published/20160220 Linux Mint 18 Will Get Its Own Set Of Apps.md rename to published/201602/20160220 Linux Mint 18 Will Get Its Own Set Of Apps.md diff --git a/published/20160224 Can we tackle the Zika virus with rapid, open research.md b/published/201602/20160224 Can we tackle the Zika virus with rapid, open research.md similarity index 100% rename from published/20160224 Can we tackle the Zika virus with rapid, open research.md rename to published/201602/20160224 Can we tackle the Zika virus with rapid, open research.md From 1f7add65730d940fa46fbfd891c6f3e81c88c011 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 6 Mar 2016 22:21:27 +0800 Subject: [PATCH 0493/1469] =?UTF-8?q?=E6=B6=88=E9=99=A4=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84=E6=96=87=E4=BB=B6=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @oska874 --- published/20160226 Development Release | 0 ...1.md => 20160226 Development Release- Xubuntu 16.04 Beta 1.md} | 0 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 published/20160226 Development Release rename published/{20160226 Development Release: Xubuntu 16.04 Beta 1.md => 20160226 Development Release- Xubuntu 16.04 Beta 1.md} (100%) diff --git a/published/20160226 Development Release b/published/20160226 Development Release deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/published/20160226 Development Release: Xubuntu 16.04 Beta 1.md b/published/20160226 Development Release- Xubuntu 16.04 Beta 1.md similarity index 100% rename from published/20160226 Development Release: Xubuntu 16.04 Beta 1.md rename to published/20160226 Development Release- Xubuntu 16.04 Beta 1.md From b4c0dea400bea351d7bf70b8ecfe95af6613fcf5 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 6 Mar 2016 22:29:32 +0800 Subject: [PATCH 0494/1469] PUB:20160226 Development Release- Xubuntu 16.04 Beta 1 @oska874 --- .../20160226 Development Release- Xubuntu 16.04 Beta 1.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/published/20160226 Development Release- Xubuntu 16.04 Beta 1.md b/published/20160226 Development Release- Xubuntu 16.04 Beta 1.md index bae1ecccf8..0e7c3d0673 100644 --- a/published/20160226 Development Release- Xubuntu 16.04 Beta 1.md +++ b/published/20160226 Development Release- Xubuntu 16.04 Beta 1.md @@ -1,9 +1,11 @@ -Xubuntu 16.04 Beta 1 开发发布 +Xubuntu 16.04 Beta 1 开发者版本发布 ============================================ -Ubuntu 发布组宣布为选定的社区版本而准备的最新的 beta 测试镜像已经可以使用了。新的发布版名称是 16.04 beta 1 ,这个版本只推荐给测试人员测试用,并不适合普通人进行日常使用。 +Ubuntu 发布团队宣布为选定的社区版本而准备的最新的 beta 测试镜像已经可以使用了。新的发布版本名称是 16.04 beta 1 ,这个版本只推荐给测试人员测试用,并不适合普通人进行日常使用。 -“这个 beta 特性的镜像主要是为 [Lubuntu][1], Ubuntu Cloud, [Ubuntu GNOME][2], [Ubuntu MATE][3], [Ubuntu Kylin][4], [Ubuntu Studio][5] 和 [Xubuntu][6] 这几个发布版准备的。Xenial Xerus (LCTT 注: ubuntu 16.04 的开发代号) 的这个预发布版本并不推荐那些需要稳定版本的人员使用,同时那些不希望在系统运行中偶尔或频繁的出现 bug 的人也不建议使用这个版本。这个版本主要还是推荐给那些喜欢 ubuntu 的开发人员,以及那些想协助我们测试、报告 bug 和修改 bug 的人使用,和我们一起努力让这个发布版本早日准备就绪。” 更多的信息可以从 [发布日志][7] 获取。 +![](https://www.linux.com/images/stories/66866/xubuntu-small.png) + +“这个 beta 特性的镜像主要是为 [Lubuntu][1], Ubuntu Cloud, [Ubuntu GNOME][2], [Ubuntu MATE][3], [Ubuntu Kylin][4], [Ubuntu Studio][5] 和 [Xubuntu][6] 这几个发布版准备的。Xenial Xerus (LCTT 译注: ubuntu 16.04 的开发代号)的这个预发布版本并不推荐那些需要稳定版本的人员使用,同时那些不希望在系统运行中偶尔或频繁的出现 bug 的人也不建议使用这个版本。这个版本主要还是推荐给那些喜欢 ubuntu 的开发人员,以及那些想协助我们测试、报告 bug 和修改 bug 的人使用,和我们一起努力让这个发布版本早日准备就绪。” 更多的信息可以从 [发布日志][7] 获取。 -------------------------------------------------------------------------------- From 95892c50c547cbf5a37c3a4dec9b89dcf31645e0 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 6 Mar 2016 22:45:14 +0800 Subject: [PATCH 0495/1469] PUB:20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack @oska874 @martin2011qi --- ...n HTTPS Websites Imperiled by New Decryption Attack.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/published/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md b/published/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md index d3270ac88e..d1878c81f9 100644 --- a/published/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md +++ b/published/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md @@ -4,11 +4,11 @@ ![](https://www.linux.com/images/stories/66866/drown-explainer.jpg) -低成本的 DROWN 攻击能在数小时内完成数据解密,对采用了 TLS 的邮件服务器也同样奏效。 +低成本的 DROWN 攻击能在数小时内完成数据解密,该攻击对采用了 TLS 的邮件服务器也同样奏效。 -一国际研究小组于周二发出警告,据称逾 1100 万家网站和邮件服务采用的用以保证服务安全的[传输层安全协议][1],对于一种新发现的、成本低廉的攻击而言异常脆弱,这种攻击会在几个小时内解密敏感的通信,在某些情况下解密甚至能瞬间完成。 1 百万家最为流行的网站中有超过 81,000 家正处于这些脆弱的 HTTPS 协议的保护之下。 +一个国际研究小组于周二发出警告,据称逾 1100 万家网站和邮件服务采用的用以保证服务安全的 [传输层安全协议 TLS][1],对于一种新发现的、成本低廉的攻击而言异常脆弱,这种攻击会在几个小时内解密敏感的通信,在某些情况下解密甚至能瞬间完成。 前一百万家最大的网站中有超过 81,000 个站点正处于这种脆弱的 HTTPS 协议保护之下。 -这种攻击主要针对受 TLS 保护、依赖于 [RSA 加密系统][2]的通信。如果密钥泄露了,即使是间接的由 SSLv2,一种在 20 年前就因为自身缺陷而退休了的 LTS 前辈。该漏洞允许攻击者,可以通过反复使用 SSLv2 创建与服务器连接的方式,解密截获的 TLS 连接。 +这种攻击主要针对依赖于 [RSA 加密系统][2]的 TLS 所保护的通信,密钥会间接的通过 SSLv2 暴露,这是一种在 20 年前就因为自身缺陷而退休了的 TLS 前代协议。该漏洞允许攻击者可以通过反复使用 SSLv2 创建与服务器连接的方式,解密截获的 TLS 连接。 -------------------------------------------------------------------------------- @@ -16,7 +16,7 @@ via: https://www.linux.com/news/software/applications/889455--more-than-11-milli 作者:[ArsTechnica][a] 译者:[Ezio](https://github.com/oska874) -校对:[martin2011qi](https://github.com/martin2011qi) +校对:[martin2011qi](https://github.com/martin2011qi), [wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 6a429bfe56cde11c545f626804ae5854862f6fef Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 7 Mar 2016 15:39:44 +0800 Subject: [PATCH 0496/1469] PUB:20151109 How to send email notifications using Gmail SMTP server on Linux @cposture @martin2011qi --- ...ations using Gmail SMTP server on Linux.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/published/20151109 How to send email notifications using Gmail SMTP server on Linux.md b/published/20151109 How to send email notifications using Gmail SMTP server on Linux.md index 20850869b1..2661a64085 100644 --- a/published/20151109 How to send email notifications using Gmail SMTP server on Linux.md +++ b/published/20151109 How to send email notifications using Gmail SMTP server on Linux.md @@ -1,25 +1,25 @@ 如何在 Linux 上使用 Gmail SMTP 服务器发送邮件通知 ================================================================================ -假定你想配置一个 Linux app,用于从你的服务器或桌面客户端发送邮件信息。邮件信息可能是部分的邮件简报、状态更新(如 [Cachet][1])、监控警报(如 [Monit][2])、磁盘时间(如 [RAID mdadm][3])等等。当你要建立自己的 [邮件发送服务器][4] 传递信息时 ,你可以依赖一个免费使用的公共 SMTP 服务器作为一个变通选项避免遭受维护之苦。 +假定你想配置一个 Linux 应用,用于从你的服务器或桌面客户端发送邮件信息。邮件信息可能是邮件简报、状态更新(如 [Cachet][1])、监控警报(如 [Monit][2])、磁盘时间(如 [RAID mdadm][3])等等。当你要建立自己的 [邮件发送服务器][4] 传递信息时 ,你可以替代使用一个免费的公共 SMTP 服务器,从而避免遭受维护之苦。 -谷歌的 Gmail 服务就是最可靠的 **免费 SMTP 服务器** 之一。想要从 app 发送邮件通知,你仅需在 app 中添加 Gmail 的 SMTP 服务器地址和你的凭证即可。 +谷歌的 Gmail 服务就是最可靠的 **免费 SMTP 服务器** 之一。想要从应用中发送邮件通知,你仅需在应用中添加 Gmail 的 SMTP 服务器地址和你的身份凭证即可。 -选择 Gmail 的 SMTP 服务器的原因之一是各种各样恰当的限制,这些限制主要用于阻止那些经常滥用服务器来发送垃圾邮件和使用邮件营销的家伙。举个例子,你一次只能给至多 100 个地址发送信息,并且一天不能超过 500 个收件人。同样,如果你不想被标为垃圾邮件发送者,你就不能发送过多的不可投递的消息。当你达到任何一个限制,你的 Gmail 账户将被暂时的锁定一天。简而言之,Gmail 的 SMTP 服务器对于你个人的使用是非常棒的,但不适合商业的批量邮件。 +使用 Gmail 的 SMTP 服务器会遇到一些限制,这些限制主要用于阻止那些经常滥用服务器来发送垃圾邮件和使用邮件营销的家伙。举个例子,你一次只能给至多 100 个地址发送信息,并且一天不能超过 500 个收件人。同样,如果你不想被标为垃圾邮件发送者,你就不能发送过多的不可投递的邮件。当你达到任何一个限制,你的 Gmail 账户将被暂时的锁定一天。简而言之,Gmail 的 SMTP 服务器对于你个人的使用是非常棒的,但不适合商业的批量邮件。 说了这么多,是时候向你们展示 **如何在 Linux 环境下使用 Gmail 的 SMTP 服务器** 了。 ### Google Gmail SMTP 服务器设置 ### -如果你想要通过你的 app 使用 Gmail 的 SMTP 服务器发送邮件,请牢记接下来的详细说明。 +如果你想要通过你的应用使用 Gmail 的 SMTP 服务器发送邮件,请牢记接下来的详细说明。 - **邮件发送服务器 (SMTP 服务器)**: smtp.gmail.com - **使用认证**: 是 - **使用安全连接**: 是 -- **用户名**: 你的 Gmail 账户 ID (比如 "alice" 如果你的邮箱为 alice@gmail.com) +- **用户名**: 你的 Gmail 账户 ID (比如 "alice" ,如果你的邮箱为 alice@gmail.com) - **密码**: 你的 Gmail 密码 - **端口**: 587 -确切的配置根据 app 会有所不同。在本教程的剩余部分,我将向你展示一些在 Linux 上使用 Gmail SMTP 服务器的应用示例。 +确切的配置根据应用会有所不同。在本教程的剩余部分,我将向你展示一些在 Linux 上使用 Gmail SMTP 服务器的应用示例。 ### 从命令行发送邮件 ### @@ -35,7 +35,7 @@ $ sudo yum install mutt -创建一个 mutt 配置文件(~/.muttrc),并和下面一样,在文件中指定 Gmail SMTP 服务器信息。将 替换成自己的 Gmail ID。注意该配置只是为了发送邮件而已(而非接收邮件)。 +创建一个 mutt 配置文件(~/.muttrc),并和下面一样,在文件中指定 Gmail SMTP 服务器信息。将 \ 替换成自己的 Gmail ID。注意该配置只是为了发送邮件而已(而非接收邮件)。 $ vi ~/.muttrc @@ -46,7 +46,7 @@ set smtp_url = "smtp://@smtp.gmail.com:587/" set smtp_pass = "" -一切就绪使用 mutt 发送一封邮件: +一切就绪,使用 mutt 发送一封邮件: $ echo "This is an email body." | mutt -s "This is an email subject" alice@yahoo.com @@ -60,7 +60,7 @@ ### 当服务器重启时发送邮件通知 ### -如果你在 [虚拟专用服务器(VPS)][5] 上跑了些重要的网站,建议要监控 VPS 的重启行为。作为一个更为实用的例子,让我们研究如何在你的 VPS 上为每一次重启事件建立邮件通知。这里假设你的 VPS 上使用的是 systemd,并向你展示如何为自动邮件通知创建一个自定义的 systemd 启动服务。 +如果你在 [虚拟专用服务器(VPS)][5] 上跑了些重要的网站,建议监控 VPS 的重启行为。作为一个更为实用的例子,让我们研究如何在你的 VPS 上为每一次重启事件建立邮件通知。这里假设你的 VPS 上使用的是 systemd,并向你展示如何为自动邮件通知创建一个自定义的 systemd 启动服务。 首先创建下面的脚本 reboot_notify.sh,用于负责邮件通知。 @@ -108,9 +108,9 @@ ### 通过服务器使用监控发送邮件通知 ### -作为最后一个例子,让我展示一个现实生活中的应用程序,[Monit][6],这是一款极其有用的服务器监控应用程序。它附有全面的 [VPS][7] 监控能力(比如 CPU、内存、进程、文件系统),和邮件通知功能。 +作为最后一个例子,让我展示一个现实生活中的应用程序,[Monit][6],这是一款极其有用的服务器监控应用程序。它带有全面的 [VPS][7] 监控能力(比如 CPU、内存、进程、文件系统)和邮件通知功能。 -如果你想要接收 VPS 上任何事件导致的且由 Monit 产生的邮件通知,你可以在 Monit 配置文件中添加以下 SMTP 信息。 +如果你想要接收 VPS 上由 Monit 产生的任何事件的邮件通知,你可以在 Monit 配置文件中添加以下 SMTP 信息。 set mailserver smtp.gmail.com port 587 username "" password "" @@ -134,7 +134,7 @@ ### 总结 ### -如你所见,类似 Gmail 这样免费的 SMTP 服务器有着这么多不同的运用方式 。但再次重申,牢记免费的 SMTP 服务器不适用于商业用途,仅仅适用于个人项目。无论你正在任一款 app 中使用 Gmail SMTP 服务器,欢迎自由分享你的用例。 +如你所见,类似 Gmail 这样免费的 SMTP 服务器有着这么多不同的运用方式 。但再次重申,请牢记免费的 SMTP 服务器不适用于商业用途,仅仅适用于个人项目。无论你正在哪款应用中使用 Gmail SMTP 服务器,欢迎自由分享你的用例。 -------------------------------------------------------------------------------- @@ -142,7 +142,7 @@ via: http://xmodulo.com/send-email-notifications-gmail-smtp-server-linux.html 作者:[Dan Nanni][a] 译者:[cposture](https://github.com/cposture) -校对:[martin2011qi](https://github.com/martin2011qi) +校对:[martin2011qi](https://github.com/martin2011qi), [wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a5b4a7fc6efcf3c9113592eb3646cc2d652181b2 Mon Sep 17 00:00:00 2001 From: ZhangXiangping Date: Mon, 7 Mar 2016 16:12:44 +0800 Subject: [PATCH 0497/1469] Update 20151104 How to Install Pure-FTPd with TLS on FreeBSD 10.2.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 个人原因,取消认领。 --- ...20151104 How to Install Pure-FTPd with TLS on FreeBSD 10.2.md | 1 - 1 file changed, 1 deletion(-) diff --git a/sources/tech/20151104 How to Install Pure-FTPd with TLS on FreeBSD 10.2.md b/sources/tech/20151104 How to Install Pure-FTPd with TLS on FreeBSD 10.2.md index 10a40233e8..19ddcf0e97 100644 --- a/sources/tech/20151104 How to Install Pure-FTPd with TLS on FreeBSD 10.2.md +++ b/sources/tech/20151104 How to Install Pure-FTPd with TLS on FreeBSD 10.2.md @@ -1,4 +1,3 @@ -chisper 翻译中 How to Install Pure-FTPd with TLS on FreeBSD 10.2 ================================================================================ FTP or File Transfer Protocol is application layer standard network protocol used to transfer file from the client to the server, after user logged in to the FTP server over the TCP-Network, such as internet. FTP has been round long time ago, much longer then P2P Program, or World Wide Web, and until this day it was a primary method for sharing file with other over the internet and it it remain very popular even today. FTP provide an secure transmission, that protect username, password and encrypt the content with SSL/TLS. From b88c3dce5bc904b5a35ce5d81a608ca3050e4812 Mon Sep 17 00:00:00 2001 From: Ezio Date: Tue, 8 Mar 2016 00:14:56 +0800 Subject: [PATCH 0498/1469] =?UTF-8?q?20160307-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit keywords: Linux Server , SMB , clearos , Zentyal --- ...wo Outstanding All-in-One Linux Servers.md | 104 ++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 sources/tech/20160228 Two Outstanding All-in-One Linux Servers.md diff --git a/sources/tech/20160228 Two Outstanding All-in-One Linux Servers.md b/sources/tech/20160228 Two Outstanding All-in-One Linux Servers.md new file mode 100644 index 0000000000..a291fd2006 --- /dev/null +++ b/sources/tech/20160228 Two Outstanding All-in-One Linux Servers.md @@ -0,0 +1,104 @@ +Two Outstanding All-in-One Linux Servers +================================================ + +keywords: Linux Server , SMB , clearos , Zentyal + +![](http://www.linux.com/images/stories/66866/jack-clear_a.png) + +>Figure 1: The ClearOS setup wizard. + +Back in 2000, Microsoft released their Small Business Server. This product changed the way many people viewed how technology could function within the realm of business. Instead of having multiple machines handle different tasks, you could deploy a single server which would handle email, calendaring, file sharing, directory services, VPN, and a whole lot more. For many of small businesses, this was a serious boon, but for some the cost of the Windows SMB was prohibitive. For yet others, the idea of relying on such a server, designed by Microsoft, simply wasn’t an option. + +For that last group, there are alternatives. In fact, within the realm of Linux and open source, you can choose from several solid platforms that can serve your small business as a one-stop server shop. If your small business has between 10 and 50 employees, the all-in-one server might be the ideal solution to meet your needs. + +Here, I’ll look at two Linux all-in-one servers, so you can see if one of them is the perfect match for your company. + +Remember, these servers are not, in any way, suited for big business or enterprise. Larger companies cannot rely on the all-in-one server simply because a single server cannot take the load expected within the realm of enterprise needs. With that said, here’s what SMBs can expect from a Linux all in one. + +### ClearOS + +[ClearOS][1] was originally released in 2009, under the name ClarkConnect, as a router and gateway distribution. Since then, ClearOS has added all the features necessary to define it as an all-in-one server. ClearOS offers more than just a piece of software. You can also purchase a [ClearBox 100][2] or [ClearBox 300][3]. These servers ship complete with ClearOS and are marketed as IT in a box. Check out the feature comparison/price matrix [here][4]. + +For those with hardware already in-house, you can download one of the following: + +- [ClearOS Community][5] — The community (free) edition of ClearOS + +- [ClearOS Home][6] — Ideal for home offices (details on features and subscription costs, see here) + +- [ClearOS Business][7] — Ideal for small businesses (details on features and subscription costs, see here) + +What do you get with ClearOS? You get a business-class server with a single, elegantly designed web interface. What is unique about ClearOS is that you will get plenty of features in the base server; beyond that, you must add on features from the [Clear Marketplace][8]. From within the Marketplace, you can install free or paid apps that extend the feature set of the ClearOS server. Here you’ll find add-ons for Windows Server Active Directory, OpenLDAP, Flexshares, Antimalware, Cloud, Web access control, Content filtering, and much more. You’ll even find some third-party add-ons such as Google Apps Synchronization, Zarafa Collaboration Platform, and Kaspersky Anti-virus. + +ClearOS is installed like any other Linux distribution (based on Red Hat’s Anaconda installer). Once the install is complete, you will be prompted to set up the networking interface as well as presented with the address to point your browser (on the same network as the ClearOS server). The address will be in the form: + +[https://IP_OF_CLEAROS_SERVER:81][9] + +Where IP_OF_CLEAROS_SERVER is the actual IP address of the server. NOTE: When you first point your browser to the server, you will receive a “Connection is not private” warning. Proceed on to the address so you can continue the setup. + +When the browser finally connects, you will be prompted for the root user credentials (you set the root user password up during initial installation). Once authenticated, you will be presented with the ClearOS setup wizard (Figure 1 above). + +Click the Next button to begin the process of setting up your ClearOS server. The wizard is self-explanatory and, in the end, you will be asked which version of ClearOS you want to use. Click either Community, Home, or Business. Once selected, you will be required to register for an account. Once you’ve created an account and registered the server, you can then move on to updating the server, configuring the server, and adding modules from the marketplace (Figure 2). + +![](http://www.linux.com/images/stories/66866/jack-clear_b.png) + +>Figure 2: Installing modules from the marketplace. + +At this point, you are ready to start digging deep into the configuration of your ClearOS small business server. + +### Zentyal + +[Zentyal][10] is a Ubuntu-based small business server that was, at one point, distributed under the name eBox. Zentyal offers plenty of servers/services to fit your SMB needs: + +- Email — Webmail; Native MS Exchange protocols and Active Directory support; Calendars and contacts; Mobile device email sync; Antivirus/antispam; IMAP, POP, SMTP, CalDAV, and CardDAV support + +- Domain & Directory — Central domain directory management; Multiple organization units; Single sign-on authentication; File sharing; ACLs, Advanced domain management, Printer management + +- Networking & Firewall — Static and DHCP interfaces; Objects & services; Packet filter; Port forwarding + +- Infrastructure — DNS; DHCP; NTP; Certification authority; VPN + +- Firewall + +The installation of Zentyal is very much like that of Ubuntu Server—it’s text based and quite simple: Boot up the install media, make a few quick selections, and wait for the installation to complete. Once the initial, text-based, installation is finished, you are presented with the GUI desktop where a wizard will appear for package selection. Select all the packages you want to install and allow the installer to finish the job. + +Finally, you can log into your Zentyal server via the web interface (point your browser to [https://IP_OF_SERVER:8443][11] — where IP_OF_SERVER is the LAN address of the Zentyal server) or use the standalone, desktop GUI to administer the server (Zentyal includes quick access to an Administrator and User console as well as a Zentyal Administration console). When all systems have been saved and started, you will be presented with the Zentyal Dashboard (Figure 3). + +![](http://www.linux.com/images/stories/66866/jack-zentyal_a.png) + +>Figure 3: The Zentyal Dashboard in action. + +The Dashboard allows you to control all aspects of the server, such as updating, managing servers/services, and getting a quick status update of the server. You can also go into the Components area and install components that you opted out of during installation or update the current package list. Click on Software Management > System Updates and select what you want to update (Figure 4), then click the UPDATE button at the bottom of the screen. + +![](http://www.linux.com/images/stories/66866/jack-zentyal_b.png) + +>Figure 4: Updating your Zentyal server is simple. + +### Which Server Is Right for You? + +The answer to this question depends on what you need. Zentyal is an amazing server that does a great job running your SMB network. If you need a bit more, such as groupware, your best bet is to go with ClearOS. If you don’t need groupware, either server will do an outstanding job. + +I highly recommend installing both of these all-in-one servers to see which will best serve your small company needs. + + +------------------------------------------------------------------------------ + +via: http://www.linux.com/learn/tutorials/882146-two-outstanding-all-in-one-linux-servers + +作者:[Jack Wallen][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/93 +[1]: http://www.linux.com/learn/tutorials/882146-two-outstanding-all-in-one-linux-servers#clearfoundation-overview +[2]: https://www.clearos.com/products/hardware/clearbox-100-series +[3]: https://www.clearos.com/products/hardware/clearbox-300-series +[4]: https://www.clearos.com/products/hardware/clearbox-overview +[5]: http://mirror.clearos.com/clearos/7/iso/x86_64/ClearOS-DVD-x86_64.iso +[6]: http://mirror.clearos.com/clearos/7/iso/x86_64/ClearOS-DVD-x86_64.iso +[7]: http://mirror.clearos.com/clearos/7/iso/x86_64/ClearOS-DVD-x86_64.iso +[8]: https://www.clearos.com/products/purchase/clearos-marketplace-overview +[9]: https://ip_of_clearos_server:81/ +[10]: http://www.zentyal.org/server/ +[11]: https://ip_of_server:8443/ From 9f3c6bba6031decfb2afa598a4f6e770d7e867a7 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 8 Mar 2016 06:21:24 +0800 Subject: [PATCH 0499/1469] PUB:20160218 Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04 @geekpi --- ...FS Plans Are Lining Up For Ubuntu 16.04.md | 24 +++++++++++++++++++ ...FS Plans Are Lining Up For Ubuntu 16.04.md | 24 ------------------- 2 files changed, 24 insertions(+), 24 deletions(-) create mode 100644 published/20160218 Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04.md delete mode 100644 translated/tech/20160218 Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04.md diff --git a/published/20160218 Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04.md b/published/20160218 Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04.md new file mode 100644 index 0000000000..5c5f44c803 --- /dev/null +++ b/published/20160218 Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04.md @@ -0,0 +1,24 @@ +Ubuntu 16.04 为更好支持容器化而采用 ZFS +======================================================= + +![](https://www.phoronix.com/assets/categories/ubuntu.jpg) + +Ubuntu 开发者正在为 [Ubuntu 16.04 加上 ZFS 支持](http://www.phoronix.com/scan.php?page=news_item&px=ZFS-For-Ubuntu-16.04) ,并且对该文件系统的所有支持都已经准备就绪。 + +Ubuntu 16.04 的默认安装将会继续是 ext4,但是 ZFS 支持将会自动构建进 Ubuntu 发布中,模块将在需要时自动加载,zfsutils-linux 将放到 Ubuntu 主分支内,并且通过 Canonical 对商业客户提供支持。 + +对于那些对 Ubuntu 中的 ZFS 感兴趣的人,Canonical 的 Dustin Kirkland 已经写了[一篇新的博客](http://blog.dustinkirkland.com/2016/02/zfs-is-fs-for-containers-in-ubuntu-1604.html),介绍了一些细节及为何“ZFS 是 Ubuntu 16.04 中面向容器使用的文件系统!” + +------------------------------------------------------------------------------ + +via: https://www.phoronix.com/scan.php?page=news_item&px=Ubuntu-ZFS-Continues-16.04&utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+Phoronix+%28Phoronix%29 + +作者:[Michael Larabel][a] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.michaellarabel.com/ + + diff --git a/translated/tech/20160218 Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04.md b/translated/tech/20160218 Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04.md deleted file mode 100644 index efe2ff27bc..0000000000 --- a/translated/tech/20160218 Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04.md +++ /dev/null @@ -1,24 +0,0 @@ -Canonical的ZFS计划将会进入Ubuntu 16.04 -======================================================= - -![](https://www.phoronix.com/assets/categories/ubuntu.jpg) - -Ubuntu开发者正在为[Ubuntu 16.04 加上支持ZFS](http://www.phoronix.com/scan.php?page=news_item&px=ZFS-For-Ubuntu-16.04) ,并且所遇的文件系统支持都已经准备就绪。 - -Ubuntu 16.04的默认安装将会继续是ext4,但是ZFS支持将会自动构建进Ubuntu发布中,模块将在需要时自动加载,zfsutils-linux是Ubuntu的一部分,并且通过Canonical对商业客户提供支持 - -对于那些对Ubuntu中的ZFS感兴趣的人,Canonical的Dustin Kirkland已经写了[一篇新的博客](http://blog.dustinkirkland.com/2016/02/zfs-is-fs-for-containers-in-ubuntu-1604.html)覆盖了一些细节及为何“ZFS是Ubuntu 16.04中为容器使用的文件系统!” - ------------------------------------------------------------------------------- - -via: https://www.phoronix.com/scan.php?page=news_item&px=Ubuntu-ZFS-Continues-16.04&utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+Phoronix+%28Phoronix%29 - -作者:[Michael Larabel][a] -译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.michaellarabel.com/ - - From ae61b5a3cf377610f19d5df6395a4a98720c21e1 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 8 Mar 2016 06:34:37 +0800 Subject: [PATCH 0500/1469] PUB:20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms @geekpi --- ...-Signatures-Using-SHA-256512 Algorithms.md | 30 +++++++++++++++++ translated/news/20160226 Development Release | 0 ...-Signatures-Using-SHA-256512 Algorithms.md | 33 ------------------- 3 files changed, 30 insertions(+), 33 deletions(-) create mode 100644 published/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md delete mode 100644 translated/news/20160226 Development Release delete mode 100644 translated/news/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md diff --git a/published/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md b/published/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md new file mode 100644 index 0000000000..4000153d0e --- /dev/null +++ b/published/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md @@ -0,0 +1,30 @@ +OpenSSH 7.2发布,支持 SHA-256/512 的 RSA 签名 +======================================================== + +**2016.2.29,OpenBSD 项目很高兴地宣布 OpenSSH 7.2发布了,并且很块可在所有支持的平台下载。** + +根据内部[发布公告][1],OpenSSH 7.2 主要是 bug 修复,修改了自 OpenSSH 7.1p2 以来由用户报告和开发团队发现的问题,但是我们可以看到几个新功能。 + +这其中,我们可以提到使用了 SHA-256 或者 SHA-256 512 哈希算法的 RSA 签名;增加了一个 AddKeysToAgent 客户端选项,以添加用于身份验证的 ssh-agent 的私钥;和实现了一个“restrict”级别的 authorized_keys 选项,用于存储密钥限制。 + +此外,现在 ssh_config 中 CertificateFile 选项可以明确列出证书,ssh-keygen 现在能够改变所有支持的格式的密钥注释、密钥指纹现在可以来自标准输入,多个公钥可以放到一个文件。 + +### ssh-keygen 现在支持多证书 + +除了上面提到的,OpenSSH 7.2 增加了 ssh-keygen 多证书的支持,一个一行,实现了 sshd_config ChrootDirectory 及Foreground 的“none”参数,“-c”标志允许 ssh-keyscan 获取证书而不是文本密钥。 + +最后但并非最不重要的,OpenSSH 7.3 不再默认启用 rijndael-cbc(即 AES),blowfish-cbc、cast128-cbc 等古老的算法,同样的还有基于 MD5 和截断的 HMAC 算法。在 Linux 中支持 getrandom() 系统调用。[下载 OpenSSH 7.2][2] 并查看更新日志中的更多细节。 + +-------------------------------------------------------------------------------- + +via: http://news.softpedia.com/news/openssh-7-2-out-now-with-support-for-rsa-signatures-using-sha-256-512-algorithms-501111.shtml + +作者:[Marius Nestor][a] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://news.softpedia.com/editors/browse/marius-nestor +[1]: http://www.openssh.com/txt/release-7.2 +[2]: http://linux.softpedia.com/get/Security/OpenSSH-4474.shtml diff --git a/translated/news/20160226 Development Release b/translated/news/20160226 Development Release deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/translated/news/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md b/translated/news/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md deleted file mode 100644 index d3cf0e8e8b..0000000000 --- a/translated/news/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md +++ /dev/null @@ -1,33 +0,0 @@ -使用SHA-256/512算法作为RSA签名的OpenSSH 7.2发布了 -======================================================== - -**今天,2016.2.29,OpenBSD项目很高兴地宣布OpenSSH 7.2发布了,并且很块可在所有支持的平台下载。** - -根据内部[发布公告][1],该公告附在了文章的最后,OpenSSH 7.2主要是bug修复,修改了自OpenSSH 7.1p2以来由用户报告和开发团队发现的问题,但是我们可以看到几个新功能。 - -这其中,我们可以提到使用了SHA-256 或者 SHA-256 512哈希算法的RSA签名,增加了一个AddKeysToAgent客户端选项添加用于身份验证的ssh-agent的私钥,和实现了一个“restrict”级别的authorized_keys选项用于存储键限制。 - -此外,现在ssh_config中CertificateFile选项可以明确列出证书,ssh-keygen现在能够改所有支持的格式的密钥注释、指纹可以来自标准输入,文件可含多个公钥。 - -### ssh-keygen现在支持多证书 - -除了上面提到的,OpenSSH 7.2正加了ssh-keygen多证书的支持,一个一行,实现了sshd_config ChrootDirectory及前台的0参数,“-c”标志允许ssh-keyscan取回证书而不是文本密钥。 - -最后但并非最不重要的,OpenSSH 7.3不再默认启用rijndael-cbc也叫AES,blowfish-cbc、古老的cast128-cbc密码,同样还有基于MD5和截断的HMAC算法。getrandom()系统调用在Linux中支持。[下载OpenSSH 7.2][2]并在更新日志中查看更细节的在本主要更新中修复的问题。 - - - - --------------------------------------------------------------------------------- - -via: http://news.softpedia.com/news/openssh-7-2-out-now-with-support-for-rsa-signatures-using-sha-256-512-algorithms-501111.shtml - -作者:[Marius Nestor][a] -译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://news.softpedia.com/editors/browse/marius-nestor -[1]: http://www.openssh.com/txt/release-7.2 -[2]: http://linux.softpedia.com/get/Security/OpenSSH-4474.shtml From 713b5517acfaa51371157df316f6959ff22cec25 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 8 Mar 2016 07:28:41 +0800 Subject: [PATCH 0501/1469] PUB:20160218 Best Linux Desktop Environments for 2016 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @GHLandy  翻译的不错,很流畅 --- ...est Linux Desktop Environments for 2016.md | 90 +++++++++++++++++++ ...est Linux Desktop Environments for 2016.md | 90 ------------------- 2 files changed, 90 insertions(+), 90 deletions(-) create mode 100644 published/20160218 Best Linux Desktop Environments for 2016.md delete mode 100644 translated/tech/20160218 Best Linux Desktop Environments for 2016.md diff --git a/published/20160218 Best Linux Desktop Environments for 2016.md b/published/20160218 Best Linux Desktop Environments for 2016.md new file mode 100644 index 0000000000..6ac25a27c5 --- /dev/null +++ b/published/20160218 Best Linux Desktop Environments for 2016.md @@ -0,0 +1,90 @@ +2016:如何选择 Linux 桌面环境 +============================================= + +![](http://www.linux.com/images/stories/66866/DE-2.png) + +Linux 创建了一个友好的环境,为我们提供了选择的可能。比方说,现代大多数的 Linux 发行版都提供不同桌面环境给我们来选择。在本文中,我将挑选一些你可能会在 Linux 中见到的最棒的桌面环境来介绍。 + +## Plasma + +我认为,[KDE 的 Plasma 桌面](https://www.kde.org/workspaces/plasmadesktop/) 是最先进的桌面环境 (LCTT 译注:译者认为,没有什么是最好的,只有最合适的,毕竟每个人的喜好都不可能完全相同)。它是我见过功能最完善和定制性最高的桌面环境;在用户完全自主控制方面,即使是 Mac OS X 和 Windows 也无法与之比拟。 + +我爱 Plasma,因为它自带了一个非常好的文件管理器 —— Dolphin。而相对应 Gnome 环境,我更喜欢 Plasma 的原因就在于这个文件管理器。使用 Gnome 最大的痛苦就是,它的文件管理器——Files——使我无法完成一些基本任务,比如说,批量文件重命名操作。而这个操作对我来说相当重要,因为我喜欢拍摄,但 Gnome 却让我无法批量重命名这些图像文件。而使用 Dolphin 的话,这个操作就像在公园散步一样简单。 + +而且,你可以通过插件来增强 Plasma 的功能。Plasma 有大量的基础软件,如 Krita、Kdenlive、Calligra 办公套件、digiKam、Kwrite 以及由 KDE 社区开发维护的大量应用。 + +Plasma 桌面环境唯一的缺陷就是它默认的邮件客户端——Kmail。它的设置比较困难,我希望 Kmail 设置可以配置地址簿和日历。 + +包括 openSUSE 在内的多数主流发行版多使用 Plasma 作为默认桌面。 + +## GNOME + +[GNOME](https://www.gnome.org/) (GNU Network Object Model Environment,GNU 网络对象模型环境) 由 [Miguel de Icaza](https://en.wikipedia.org/wiki/Miguel_de_Icaza) 和 Federico Mena 在 1997 年的时候创立,这是因为 KDE 使用了 Qt 工具包,而这个工具包是使用专属许可证 (proprietary license) 发布的。不像提供了大量定制的 KDE,GNOME 专注于让事情变得简单。因为其自身的简单性和易用性,GNOME 变得相当流行。而我认为 GNOME 之所以流行的原因在于,Ubuntu——使用 GNOME 作为默认桌面的主流 Linux 发行版之一——对其有着巨大的推动作用。 + +随着时代变化,GNOME 也需要作出相应的改变了。因此,开发者在 GNOME 3 中推出了 GNOME 3 Shell,从而引出了它的全新设计规范。但这同时与 Canonical 的 Ubuntu 计划存在者一些冲突,所以 Canonical 为 GNOME 开发了叫做 Unity 的自己的 Shell。最初,GNOME 3 Shell 因很多争议 (issues) 而困扰不已——最明显的是,升级之后会导致很多扩展无法正常工作。由于设计上的重大改版以及各种问题的出现,GNOME 便产生了很多分支(fork),比如 Cinnamon 和 Mate 桌面。 + +另外,使得 GNOME 让人感兴趣的是,它针对触摸设备做了优化,所以,如果你有一台触屏笔记本电脑的话,GNOME 则是最合适你这台电脑的桌面环境。 + +在 3.18 版本中,GNOME 已经作出了一些令人印象深刻的改动。其中他们所做的最让人感兴趣的是集成了 Google Drive,用户可以把他们的 Google Drive 挂载为远程存储设备,这样就不必再使用浏览器来查看里边的文件了。我也很喜欢 GNOME 里边自带的那个优秀的邮件客户端,它带有日历和地址簿功能。尽管有这么多些优秀的特性,但它的文件管理器使我不再使用 GNOME ,因为我无法处理批量文件重命名。我会坚持使用 Plasma,一直到 GNOME 的开发者修复了这个小缺陷。 + +![](http://www.linux.com/images/stories/66866/DE-fig1.png) + +## Unity + +从技术上来说,[Unity](https://unity.ubuntu.com/) 并不是一个桌面环境,它只是 Canonical 为 Ubuntu 开发的一个图形化 Shell。Unity 运行于 GNOME 桌面之上,并使用很多 GNOME 的应用和工具。Ubuntu 团队分支了一些 GNOME 组件,以便更好的满足 Unity 用户的需求。 + +Unity 在 Ubuntu 的融合(convergence)计划中扮演着重要角色, 在 Unity 8 中,Canonical 公司正在努力将电脑桌面和移动世界结合到一起。Canonical 同时还为 Unity 开发了许多的有趣技术,比如 HUD (Head-up Display,平视显示)。他们还在 lenses 和 scopes 中通过一种独特的技术来让用户方便地找到特定内容。 + +即将发行的 Ubuntu 16.04,将会搭载 Unity 8,那时候用户就可以完全体验开发者为该开源软件添加的所有特性了。其中最大的争议之一,Unity 可选取消集成了 Amazon Ads 和其他服务。而在即将发行的版本,Canonical 从 Dash 移除了 Amazon ads,但却默认保证了系统的隐私性。 + +## Cinnamon + +最初,[Cinnamon](https://en.wikipedia.org/wiki/Cinnamon_(software\)) 由 [Linux Mint](http://www.linuxmint.com/) 开发 —— 这是 DistroWatch.com 上统计出来最流行的发行版。就像 Unity,Cinnamon 是 GNOME Shell 的一个分支。但最后进化为一个独立的桌面环境,这是因为 Linux Mint 的开发者分支了 GNOME 桌面中很多的组件到 Cinnamon,包括 Files ——以满足自身用户的需求。 + +由于 Linux Mint 基于普通版本的 Ubuntu,开发者仍需要去完成 Ubuntu 尚未完成的目标。结果,尽管前途光明,但 Cinnamon 却充满了 Bugs 和问题。随着 17.x 本版的发布,Linux Mint 开始转移到 Ubuntu 的 LTS 版本上,从而他们可以专注于开发 Cinnamon 的核心组件,而不必再去担心代码库。转移到 LTS 的好处是,Cinnamon 变得非常稳定并且基本没有 Bugs 出现。现在,开发者已经开始向桌面环境中添加更多的新特性了。 + +对于那些更喜欢在 GNOME 基础上有一个很好的类 Windows 用户界面的用户来说,Cinnamon 是他们最好的桌面环境。 + +## MATE 桌面 + +[MATE 桌面](http://mate-desktop.com/) 同样是 GNOME 的一个分支,然而,它并不像 Cinnamon 那样由 GNOME 3 分支而来,而是现在已经没有人维护的 GNOME 2 代码库的一个分支。MATE 桌面中的一些开发者并不喜欢 GNOME 3 并且想要“继续坚持” GNOME 2,所以他们使用这个代码库来创建来 MATE。为避免和 GNOME 3 的冲突,他们重命名了全部的包:Nautilus 改为 Caja、Gedit 改为 Pluma 以及 Evince 改为 Atril 等。 + +尽管 MATE 延续了 GNOME 2,但这并不意味着他们使用过时的技术;相反,他们使用了更新的技术来提供一个现代的 GNOME 2 体验。 + +拥有相当高的资源使用率才是 MATE 最令人印象深刻之处。你可将它运行在老旧硬件或者更新一些的但不太强大的硬件上,如树梅派 (Raspberry Pi) 或者 Chromebook Flip。使得它更有让人感兴趣的是,把它运行在一些强大的硬件上,可以节省大多数的资源给其他应用,而桌面环境本身只占用很少的资源。 + +## LXQt + +[LXQt](http://lxqt.org/) 继承了 LXDE ——最轻量级的桌面环境之一。它融合了 LXDE 和 Razor-Qt 两个开源项目。LXQt 的首个可用本版(v 0.9)发布于 2015 年。最初,开发者使用了 Qt4 ,之后为了加快开发速度,而放弃了兼容性,他们移动到 Qt5 和 KDE 框架上。我也在自己的 Arch 系统上尝试使用了 LXQt,它的确是一个非常好的轻量级桌面环境。但在完全接过 LXDE 的传承之前,LXQt 仍有一段很长的路需要走。 + +## Xfce + +[Xfce](http://www.xfce.org/) 早于 KDE 桌面环境,它是最古老和最轻量级的桌面环境。Xfce 的最新版本是 4.15,发布于 2015 年,使用了诸如 GTK+ 3 的大量的现代科技。很多发行版都使用了 Xfce 环境以满足特定需求,比如 Ubuntu Studio ——与 MATE 类似——尽量节省系统资源给其他的应用。并且,许多的著名的 Linux 发行版——包括 Manjaro Linux、PC/OS、Salix 和 Mythbuntu ——都把它作为默认桌面环境。 + +## Budgie + +[Budgie](https://solus-project.com/budgie/) 是一个新型的桌面环境,由 Solus Linux 团队开发和维护。Solus 是一个从零开始构建的新型发行版,而 Budgie 则是它的一个核心组件。Budgie 使用了大量的 GNOME 组件,从而提供一个华丽的用户界面。由于没有该桌面环境的更多信息,我特地联系了 Solus 的核心开发者—— Ikey Doherty。他解释说:“我们搭载了自己的桌面环境—— Budgie 桌面。与其他桌面环境不同的是,Budgie 并不是其他桌面的一个分支,它的目标是彻底融入到 GNOME 协议栈之中。它完全从零开始编写,并特意设计来迎合 Solus 提供的体验。我们会尽可能的和 GNOME 的上游团队协同工作,修复 Bugs,并提倡和支持他们的工作”。 + +## Pantheon + +我想,[Pantheon](https://elementary.io/) 不需要特别介绍了吧,那个优美的 elementary OS 就使用它作为桌面。类似于 Budgie,很多人都认为 Pantheon 也不是 GNOME 的一个分支。elementary OS 团队大多拥有良好的设计从业背景,所以他们会近距离关注每一个细节,这使得 Pantheon 成为一个非常优美的桌面环境。偶尔,它可能缺少像 Plasma 等桌面中的某些特性,但开发者实际上是尽其所能的去坚持设计原则。 + +![](http://www.linux.com/images/stories/66866/DE-3.png) + +## 结论 + +当我写完本文后,我突然意识到来开源和 Linux 的重大好处。总有一些东西适合你。就像 Jon “maddog” Hall 在最近的 SCaLE 14 上说的那样:“是的,现在有 300 多个 Linux 发行版。我可以一个一个去尝试,然后坚持使用我最喜欢的那一个”。 + +所以,尽情享受 Linux 的多样性吧,最后使用最合你意的那一个。 + +------------------------------------------------------------------------------ + +via: http://www.linux.com/news/software/applications/881107-best-linux-desktop-environments-for-2016 + +作者:[Swapnil Bhartiya][a] +译者:[GHLandy](https://github.com/GHLandy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linux.com/community/forums/person/61003 diff --git a/translated/tech/20160218 Best Linux Desktop Environments for 2016.md b/translated/tech/20160218 Best Linux Desktop Environments for 2016.md deleted file mode 100644 index b9306b79be..0000000000 --- a/translated/tech/20160218 Best Linux Desktop Environments for 2016.md +++ /dev/null @@ -1,90 +0,0 @@ -2016:如何选择 Linux 桌面环境 -============================================= - -![](http://www.linux.com/images/stories/66866/DE-2.png) - -Linux 创建了一个相对友好的环境,为我们提供了选择的可能。比方说,现代大多数的 Linux 发行版都提供不同桌面环境给我们来选择。在本文中,我将挑选一些你可能会在 Linux 中见到的相对较好的桌面环境来介绍。 - -## Plasma - -我认为,[KDE’s Plasma desktop](https://www.kde.org/workspaces/plasmadesktop/) 是最高级的桌面环境 (LCTT 译注:译者认为,没有什么是最好的,只有最合适的,毕竟每个人的喜好都不可能完全相同)。它是我见过功能最完善和定制性最高的桌面环境;在用户完全自主控制方面,即使是 Mac OS X 和 Windows 也无法与之比拟。 - -我爱 Plasma,因为它自带了一个非常好的文件管理器——Dolphin。而相对应 Gnome 环境,我更喜欢 Plasma 的原因就在于文件管理器。使用 Gnome 最大的痛苦就是,它的文件管理器——Files——使我无法完成一些基本任务,比如说,批量文件重命名操作。而这个操作对我来说相当重要,因为我喜欢拍摄,但 Gnome 却让我无法批量重命名这些图像文件。而使用 Dolphin 的话,这个操作就像在公园散步一样简单。 - -而且,你可以通过插件来增强 Plasma 的功能。Plasma 有大量的基础软件,如 Krita、Kdenlive、Calligra 办公套件、digiKam、Kwrite 以及由 KDE 社区开发维护的大量应用。 - -Plasma 桌面环境唯一的缺陷就是它默认的邮件客户端——Kmail。它的设置比较困难,我希望 Kmail 设置可以配置地址簿和日历。 - -包括 openSUSE 在内的多数主流发行版多使用 Plasma 作为默认桌面。 - -## GNOME - -[GNOME](https://www.gnome.org/) (GNU Network Object Model Environment,GNU 网络对象模型环境) 由 [Miguel de Icaza](https://en.wikipedia.org/wiki/Miguel_de_Icaza) 和 Federico Mena 在 1997 年的时候创立,这是因为 KDE 使用来 Qt 工具包,而这个工具包是使用专业许可证 (proprietary license) 发布的。和 KDE 不一样的是,GNOME 提供了大量的定制,它专注于让事情变得简单。因为 自身的简单性和易用性,GNOME 变得相当流行。而我认为 GNOME 之所以流行的原因在于,Ubuntu——使用 GNOME 作为默认桌面的主流 Linux 发行版之一——对其有着巨大的推动作用。 - -随着时代变化,GNOME 也需要作出相应的改变了。因此,开发者通过 GNOME 3 推出了 GNOME 3 Shell,从而引出它全新的设计规范。但这同时与 Canonical 的 Ubuntu 计划存在者一些冲突,所以 Canonical 为 GNOME 开发来叫做 Unity 的特有 Shell。最初,GNOME 3 Shell 因很多争议 (issues) 而困扰不已——最明显的是,升级之后会导致很多扩展无法正常工作。由于设计上的重大改版以及各种问题的出现,GNOME 便产生来很多分支,比如 Cinnamon 和 Mate 桌面。 - -也就是说,使得 GNOME 有趣的是,它针对触摸设备做了优化,所以,如果你有一台触屏笔记本电脑的话,GNOME 则是最合适你这台电脑的桌面环境。 - -在 3.18 版本中,GNOME 已经作出了一些令人印象深刻的改动。其中他们所做的最有趣的是集成了 Google Drive,用户可以把他们的 Google Drive 挂载为远程存储设备,这样就不必在使用浏览器来查看里边的文件来。我也很喜欢 GNOME 里边自带的那个优秀的邮件客户端,它带有日历和地址簿功能。尽管有这么多些优秀的特性,但它的文件管理器使我不再使用 GNOME ,因为我无法处理批量文件重命名。我会坚持使用 Plasma,一直到 GNOME 的开发者修复了这个小缺陷。 - -![](http://www.linux.com/images/stories/66866/DE-fig1.png) - -## Unity - -从技术上来说,[Unity](https://unity.ubuntu.com/) 并不是一个桌面环境,它只是 Canonical 为 Ubuntu 开发的一个图形化 Shell。Unity 运行于 GNOME 桌面之上,并使用很多 GNOME 的应用和工具。Ubuntu 团队分支了一些 GNOME 组件,以便更好的满足 Unity 用户的需求。 - -Unity 在 Ubuntu 故事集和 Unity 8 中扮演者重要角色,Canonical 公司正在努力将电脑桌面和移动世界结合到一起。Canonical 同时还为 Unity 开发了许多的有趣技术,比如 HUD (Head-up Display,平视显示)。他们还有一种独特的技术来然用户在镜片上的某范围找到特定内容。 - -即将发行的 Ubuntu 16.04,将会搭载 Unity 8,那时候用户就可以完全体验开发者为该开源软件添加的所有特性了。其中最大的争议就是,Unity 不再集成 Amazon Ads 和其他服务。即将发行的版本,虽然 Canonical 从 Dash 移除了 Amazon ads,但却默认保证了系统的隐私性。 - -## Cinnamon - -最初,[Cinnamon](https://en.wikipedia.org/wiki/Cinnamon_(software)) 由 [Linux Mint](http://www.linuxmint.com/) 开发 —— DistroWatch.com 上统计出来最流行的发行版。就像 Unity,Cinnamon 是 GNOME Shell 的一个分支。但最后进化为一个独立的桌面环境,这是因为 Linux Mint 的开发者分支了 GNOME 桌面中很多的组件到 Cinnamon,包括 Files ——以满足自身用户的需求。 - -由于 Linux Mint 基于普通版本的 Ubuntu,开发者仍需要去完成 Ubuntu 尚未完成的目标。结果,尽管前途光明,但 Cinnamon 却充满了 Bugs 和问题。随着 17.x 本版的发布,Linux Mint 开始移动到 Ubuntu 的 LTS 版本上,从而他们可以专注于开发 Cinnamon 的核心组件,而不必再去担心代码库。移动到 LTS 的好处是,Cinnamon 变得非常稳定并且基本没有 Bugs 出现。现在,开发者已经开始向桌面环境中添加更多的新特性来。 - -对于那些更喜欢在 GNOME 基础上有一个很好的类 Windows 用户界面的用户来说,Cinnamon 是他们最好的桌面环境。 - -## MATE Desktop - -[MATE desktop](http://mate-desktop.com/) 同样是 GNOME 的一个分支,然而,它并不像 Cinnamon 那样由 GNOME 3 分支,而是现在已经没有人维护的 GNOME 2 代码库的一个分支。MATE desktop 中的一些开发者并不喜欢 GNOME 3 并且想要“继续坚持” GNOME 2,所以他们使用这个代码库来创建来 MATE。为避免和 GNOME 3 的冲突,他们重命名了全部的包:Nautilus 改为 Caja、Gedit 改为 Pluma 以及 Evince 改为 Atril 等。 - -尽管 MATE 延续了 GNOME 2,但这并不意味着他们使用过时的技术;相反,他们使用了更新的技术来提供一个现代的 GNOME 2 体验。 - -拥有相当高的资源效率才是 MATE 最令人印象深刻之处。你可将它运行在老旧硬件或者很少更新的强大硬件上,如树梅派 (Raspberry Pi) 或者 Chromebook Flip。使得它更有趣的是,把它运行在一些强大的硬件上,可以节省大多数的资源给其他应用,而桌面环境本身只占用很少的资源。 - -## LXQt - -[LXQt](http://lxqt.org/) 继承了 LXDE ——最轻量级的桌面环境之一。它融合了 LXDE 和 Razor-Qt 两个开源项目。LXQt 的首个可用本版 V 0.9 发布于 2015 年。最初,开发者使用了 Qt4 但向下兼容,之后为了加快开发速度,他们移动到 Qt5 和 KDE 框架上。我也在自己的 Arch 系统上尝试使用了 LXQt,它的确是一个非常好的轻量级桌面环境。但在完全继承 LXDE 之前,LXQt 仍有一段很长的路需要走。 - -## Xfce - -[Xfce](http://www.xfce.org/) 早于 KDE 桌面环境,它是最古老和最轻量级的桌面环境。Xfce 的最新版本是 4.15,发布于 2015 年,使用了诸如 GTK + 3 的大量的现代科技。很多发行版都使用了 Xfce 环境以满足特定需求,比如 Ubuntu Studio ——与 MATE 类似——尽量节省系统资源给其他的应用。并且,许多的著名的 Linux 发行版——包括 Manjaro Linux、PC/OS、Salix 和 Mythbuntu ——都把它作为默认桌面环境。 - -## Budgie - -[Budgie](https://solus-project.com/budgie/) 是一个新型的桌面环境,由 Solus Linux 团队开发和维护。Solus 是一个从零开始构建的新型发行版,而 Budgie 则是它的一个核心组件。Budgie 使用了大量的 GNOME 组件,从而提供一个华丽的用户界面 (UI)。由于没有该桌面环境的更多信息,我特地联系了 Solus 的核心开发者—— Ikey Doherty。他解释说:“我们搭载了自己的桌面环境—— Budgie。与其他桌面环境不同的是,Budgie 并不是其他桌面的一个分支,它的目标是侧底融入到 GNOME 协议栈之中。它完全从零开始编写,并特意的设计来迎合 Solus 提供的体验。我们会尽可能的和 GNOME 的上游团队协同工作,修复 Bugs,并提倡和支持他们的工作”。 - -## Pantheon - -我想,[Pantheon](https://elementary.io/) 不需要特别介绍了吧,那个优美的 elementary OS 就使用它作为桌面。类似于 Budgie,很多人都认为 Pantheon 也不是 GNOME 的一个分支。elementary OS 团队大多拥有良好的设计背景,所以他们会近距离关注每一个细节,这使得 Pantheon 成为一个非常优美的桌面环境。在某个瞬间,它可能缺少像 Plasma 等桌面中的某些特性,但开发者实际上是尽其所能的去坚持设计原则。 - -![](http://www.linux.com/images/stories/66866/DE-3.png) - -## 结论 - -当我写完本文后,我突然意识到来开源和 Linux 的重大好处。总有一个发行版本适合你。就像 Jon “maddog” Hall 在最近的 SCaLE 14 上说的那样:“是的,现在有 300 多个 Linux 发行版。我可以一个一个去尝试,然后坚持使用我最喜欢的那一个”。 - -所以,尽情享受 Linux 的多样性吧,最后使用最合你意的那一个。 - ------------------------------------------------------------------------------- - -via: http://www.linux.com/news/software/applications/881107-best-linux-desktop-environments-for-2016 - -作者:[Swapnil Bhartiya][a] -译者:[GHLandy](https://github.com/GHLandy) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.linux.com/community/forums/person/61003 From 30b627dd8dd9e129ed819acb0001e960cc514f28 Mon Sep 17 00:00:00 2001 From: zpl Date: Tue, 8 Mar 2016 10:09:48 +0800 Subject: [PATCH 0502/1469] [translating] 20151202 A new Mindcraft moment.md --- sources/tech/20151202 A new Mindcraft moment.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20151202 A new Mindcraft moment.md b/sources/tech/20151202 A new Mindcraft moment.md index 79930e8202..92c645ea4b 100644 --- a/sources/tech/20151202 A new Mindcraft moment.md +++ b/sources/tech/20151202 A new Mindcraft moment.md @@ -1,3 +1,4 @@ +zpl1025 A new Mindcraft moment? ======================= From ce7f446503587fece9c0c2f48e3a74e9ec530eac Mon Sep 17 00:00:00 2001 From: Markgolzh Date: Tue, 8 Mar 2016 11:45:33 +0800 Subject: [PATCH 0503/1469] Update 20160303 Top 5 open source command shells for Linux.md --- .../tech/20160303 Top 5 open source command shells for Linux.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160303 Top 5 open source command shells for Linux.md b/sources/tech/20160303 Top 5 open source command shells for Linux.md index 74c135e594..d097928ace 100644 --- a/sources/tech/20160303 Top 5 open source command shells for Linux.md +++ b/sources/tech/20160303 Top 5 open source command shells for Linux.md @@ -1,3 +1,4 @@ +翻译中;by ![zky001](https://github.com/LCTT/TranslateProject/edit/master/sources/tech/20160303%20Top%205%20open%20source%20command%20shells%20for%20Linux.md) Top 5 open source command shells for Linux =============================================== From 6f5538280d2b42e80d335bc86a48333fd1e0e571 Mon Sep 17 00:00:00 2001 From: martin qi Date: Tue, 8 Mar 2016 23:06:44 +0800 Subject: [PATCH 0504/1469] Update and rename translated/share/20151028 Bossie Awards 2015--The best open source networking and security software.md to published/20151028 Bossie Awards 2015--The best open source networking and security software.md --- ...source networking and security software.md | 162 +++++++++++++++++ ...source networking and security software.md | 164 ------------------ 2 files changed, 162 insertions(+), 164 deletions(-) create mode 100644 published/20151028 Bossie Awards 2015--The best open source networking and security software.md delete mode 100644 translated/share/20151028 Bossie Awards 2015--The best open source networking and security software.md diff --git a/published/20151028 Bossie Awards 2015--The best open source networking and security software.md b/published/20151028 Bossie Awards 2015--The best open source networking and security software.md new file mode 100644 index 0000000000..d245fe2a4c --- /dev/null +++ b/published/20151028 Bossie Awards 2015--The best open source networking and security software.md @@ -0,0 +1,162 @@ +2015 Bossie 评选:最佳开源网络和安全软件 +================================================================================ +InfoWorld 在建设网络,运营网络和保障网络安全领域精选出了年度开源工具获奖者。 + +![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-net-sec-100614459-orig.jpg) + +### 最佳开源网络和安全软件 ### + +[BIND](https://en.wikipedia.org/wiki/BIND), [Sendmail](https://en.wikipedia.org/wiki/Sendmail), [OpenSSH](https://en.wikipedia.org/wiki/OpenSSH), [Cacti](https://en.wikipedia.org/wiki/Cactus), [Nagios](https://en.wikipedia.org/wiki/Nagios), [Snort](https://en.wikipedia.org/wiki/Snort_%28software%29) -- 这些为了网络而生的开源软件,好些家伙们老而弥坚。今年在这个范畴的最佳选择中,你会发现中坚、支柱、新人和新贵云集,他们正在完善网络管理,安全监控,漏洞评估,[rootkit](https://en.wikipedia.org/wiki/Rootkit) 检测,以及很多方面。 + +![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-icinga-100614482-orig.jpg) + +### Icinga 2 ### + +Icinga 起先只是系统监控应用 Nagios 的一个分支。[Icinga 2][1] 经历了完全的重写,为用户带来了时尚的界面,对多数据库的支持,以及一个集成众多扩展的 API。凭借着配置好的负载均衡、通知和配置文件,Icinga 2 缩短了在复杂环境下安装的时间。Icinga 2 原生支持 [Graphite](https://github.com/graphite-project/graphite-web)(系统监控应用),轻松为管理员呈现实时性能图表。不过真的让 Icinga 今年重新火起来的原因是 Icinga Web 2 的发布,那是一个支持可拖放定制的 dashboard 和一些流式监控工具的前端图形界面系统 。 + +管理员可以查看,过滤,并把问题按优先顺序排好,同时保持跟踪已经进行的动作。一个新的矩阵视图使管理员能够在一个页面上查看主机和服务。你可以通过查看特定时间段的事件或筛选事件类型来了解哪些事件需要立即关注。虽然 Icinga Web 2 有着全新界面和更为强劲的性能,不过对于传统版 Icinga 和 Web 版 Icinga 的所有常用命令还是照旧支持的。这意味着学习新版工具不耗费额外的时间。 + +-- Fahmida Rashid + +![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-zenoss-100614465-orig.jpg) + +### Zenoss Core ### + +另一个强大的开源软件,[Zenoss Core][2] 为网络管理员提供了一个完整的,一站式解决方案来跟踪和管理所有的应用程序、服务器、存储,网络组件、虚拟化工具、以及企业基础架构的其他元素。管理员可以确保硬件的运行效率并利用 ZenPacks 中模块化设计的插件来扩展功能。 + +Zenoss Core 5,在今年二月发布,保留了已经很强大的工具,并进一步改进以增强用户界面和扩展 dashboard。基于 Web 的控制台和 dashboard 已经是高度可定制并动态调整的存在了,现在新版本还能让管理员混搭多个组件图表到一个图表。想来这定是一个更好的根源分析和因果分析的工具。 + +Portlets 为网络映射、设备问题、守护进程、产品状态、监视列表和事件视图等等提供深入的分析。而且新的 HTML5 图表可以从工具导出。Zenoss 的控制中心支持带外管理并且可监控所有 Zenoss 组件。Zenoss Core 拥有在线备份和恢复、快照和回滚以及多主机部署的新工具。更重要的是,凭借对 Docker 的全面支持,部署起来更快了。 + +-- Fahmida Rashid + +![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-opennms-100614461-orig.jpg) + +### OpenNMS ### + +作为一个非常灵活的网络管理解决方案,[OpenNMS][3] 可以处理任何网络管理任务,无论是设备管理,应用性能监控,库存控制,或事件管理。凭借对 IPv6 的支持,强大的警报系统和记录用户脚本来测试 Web 应用程序的能力,OpenNMS 拥有网络管理员和测试人员需要的一切。OpenNMS 现在变得像一款移动 dashboard,堪称 OpenNMS 指南针,可让网络专家随时,甚至在外出时都可以监视他们的网络。 + +该应用程序的 IOS 版本,可从 [iTunes App Store][4] 上获取,显示故障、节点和告警。下一个版本将提供更多的事件细节、资源图表、以及关于 IP 和 SNMP 接口的信息。安卓版可从 [Google Play][5] 上获取,可在 dashboard 上显示网络可用性,故障和告警,以及确认、提升或清除告警的能力。移动客户端与 OpenNMS Horizon 1.12 或更高版本以及 OpenNMS Meridian 2015.1.0 或更高版本兼容。 + +-- Fahmida Rashid + +![](http://images.techhive.com/images/article/2015/09/bossies-2015-onion-100614460-orig.jpg) + +### Security Onion ### + +如同一个洋葱,网络安全监控是由许多层组成。没有任何一个单一的工具可以让你洞察每一次攻击,为你显示你公司网络中的每一次侦查或是会话的足迹。[Security Onion][6] 在一个简单易用的 Ubuntu 发行版中打包了许多经过验证的工具,这会让你看到谁留在你的网络里,并帮助你隔离这些坏家伙。 + +无论你是采取主动式的网络安全监测还是追查可能的攻击,Security Onion 都可以帮助你。Onion 由传感器、服务器和显示层组成,结合了基于网络和基于主机的入侵检测,全面的网络数据包捕获,并提供了所有类型的日志以供检查和分析。 + +这是一个众星云集的的网络安全工具链,包括用于网络抓包的 [Netsniff-NG](http://www.netsniff-ng.org/)、基于规则的网络入侵检测系统 Snort 和 [Suricata](https://en.wikipedia.org/wiki/Suricata_%28software%29),基于分析的网络监控系统 Bro,基于主机的入侵检测系统 OSSEC 和用于显示、分析和日志管理的 Sguil、Squert、Snorby 和 ELSA (企业日志搜索和归档)。是一个经过精挑细选的工具集,所有的这些全被打包进一个向导式的安装程序并有完整的文档支持,可以帮助你尽可能快地上手监控。 + +-- Victor R. Garza + +![](http://images.techhive.com/images/article/2015/09/bossies-2015-kali-100614458-orig.jpg) + +Kali Linux + +[Kali Linux][7] 背后的团队今年改版了流行的安全 Linux 发行版,使其更快,更全能。Kali 采用全新 4.0 版的内核 ,改进了对硬件和无线驱动程序的支持,并且界面更为流畅。最常用的工具都可从屏幕的侧边栏上轻松找到。而最大的最大的改变是 Kali Linux 现在是一个滚动发行版,具有持续的软件更新。Kali 的核心系统是基于 Debian Jessie,而且该团队会不断地从 Debian 测试版 pull 软件包,并持续的在上面添加 Kali 风格的新特性。 + +该发行版仍然配备满了渗透测试,漏洞分析,安全审查,网络应用分析,无线网络评估,逆向工程,和漏洞利用工具。现在该发行版具有新版本检测系统,当有个别工具可更新时系统会自动通知用户。该发行版还具有一系列设备的 ARM 镜像,包括树莓派、[Chromebook](https://en.wikipedia.org/wiki/Chromebook) 和 [Odroid](https://en.wikipedia.org/wiki/ODROID),也更新了 Android 设备上运行的 [NetHunter](https://www.kali.org/kali-linux-nethunter/) 渗透测试平台。还有其他的变化:Metasploit 的社区版/专业版不再包括在内,因为 Kali 2.0 还没有 [Rapid7 的官方支持][8]。 + +-- Fahmida Rashid + +![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-openvas-100614462-orig.jpg) + +### OpenVAS ### + +开放式漏洞评估系统 [OpenVAS][9],是一个整合多种服务和工具来提供漏洞扫描和漏洞管理的软件框架。该扫描器与每周一次的网络漏洞测试数据配合,或者你可以使用商业数据。该软件框架包括一个命令行界面(以使其可以用脚本运行)和一个带 SSL 安全机制的基于 [Greenbone 安全助手][10] 的浏览器界面。OpenVAS 提供了用于附加功能的各种插件。扫描可以预定运行或按需运行。 + +可通过单一的主控来控制多个 OpenVAS 的安装,这使其成为了一个可扩展的企业漏洞评估工具。该项目兼容的标准使其可以:将扫描结果和配置存储在 SQL 数据库中,在那里他们可以容易地被外部报告工具访问。客户端工具通过基于 XML 的无状态 OpenVAS 管理协议访问 OpenVAS 管理器,所以安全管理员可以扩展该框架的功能。该软件能以软件包或源代码的方式安装在 Windows 或 Linux 上运行,或者作为一个虚拟应用下载。 + +-- Matt Sarrel + +![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-owasp-100614463-orig.jpg) + +### OWASP ### + +[OWASP][11](开放式 Web 应用程序安全项目 )是专注于提高软件安全性的在全球各地拥有分会的非营利组织。由这个社区性的组织提供测试工具、文档、培训和几乎任何你可以想象的开发安全软件相关的软件安全评估和最佳做法。有一些 OWASP 项目已成为很多安全从业者工具箱中的重要组件: + +[ZAP][12](ZED 攻击代理项目)是一个在 Web 应用程序中寻找漏洞的渗透测试工具。ZAP 的设计目标之一是使之易于使用,以便于那些并非安全领域专家的开发人员和的测试人员在使用中能得到帮助。ZAP 提供自动扫描和一套手动测试工具集。 + +[Xenotix XSS Exploit Framework][13] 是一个先进的跨站点脚本漏洞检测和漏洞利用框架,该框架通过在浏览器引擎内执行扫描以获取真实结果。Xenotix 扫描模块使用了三个智能的模糊器,使其可以运行近 5000 种不同的 XSS 有效载荷。API 可以让安全管理员扩展和定制漏洞测试工具包。 + +[O-Saft][14](OWASP SSL 高级审查工具)是一个查看 SSL 证书详细信息和测试 SSL 连接的 SSL 审计工具。这个命令行工具可以在线或离线运行来评估 SSL ,比如密码和配置是否安全。O-Saft 提供了常见漏洞的内置检查,你可以容易地通过编写脚本来扩展这些功能。在 2015 年 5 月加入了一个简单的图形用户界面作为可选的下载项。 + +[OWTF][15](攻击性的 Web 测试框架)是一个遵循 OWASP 测试指南和 NIST 和 PTES 标准的自动化测试工具。该框架同时使用 Web 用户界面和命令行,用于探测 Web 和应用服务器的常见漏洞,如配置失当和软件未打补丁。 + +-- Matt Sarrel + +![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-beef-100614456-orig.jpg) + +### BeEF ### + +Web 浏览器已经成为用于针对客户端的攻击中最常见的载体。[BeEF][15] 浏览器漏洞利用框架项目,是一种广泛使用的用以评估 Web 浏览器安全性的渗透工具。BeEF 通过浏览器来启动客户端攻击,帮助你暴露出客户端系统的安全弱点。BeEF 建立了一个恶意网站,安全管理员用想要测试的浏览器访问该网站。然后 BeEF 发送命令来攻击 Web 浏览器并使用命令在客户端机器上植入软件。随后管理员就可以把客户端机器看作尸体般发动攻击了。 + +BeEF 自带像键盘记录,端口扫描和 Web 代理这样的常用模块,此外你可以编写你自己的模块或直接将命令发送到被控制的测试机上。BeEF 带有少量的演示网页来帮你快速入门,使得编写额外的网页和攻击模块变得非常简单,这使得你可以因地适宜的自定义你的测试。BeEF 是一个非常有价值的评估浏览器和终端安全、学习如何发起基于浏览器攻击的测试工具。可以使用它来向你的用户综合演示,那些恶意软件通常是如何感染客户端设备的。 + +-- Matt Sarrel + +![](http://images.techhive.com/images/article/2015/09/bossies-2015-unhide-100614464-orig.jpg) + +### Unhide ### + +[Unhide][16] 是一个定位开放的 TCP/UDP 端口和隐藏在 UNIX、Linux 和 Windows 上的进程的审查工具。隐藏的端口和进程可能是由于运行 Rootkit 或 LKM(可加载的内核模块) 导致的。Rootkit 可能很难找到并移除,因为它们就是针对隐蔽性设计的,在操作系统和用户前隐藏自己。一个 Rootkit 可以使用 LKM 隐藏其进程或冒充其他进程,让它在机器上运行很长一段时间而不被发现。而 Unhide 可以使管理员们确信他们的系统是干净的。 + +Unhide 实际上是两个单独的脚本:一个用于进程,一个用于端口。该工具查询正在运行的进程、线程和开放的端口并将这些信息与系统中注册的活动比较,报告之间的差异。Unhide 和 WinUnhide 是在运行命令行产生文本输出的非常轻量级的脚本。它们不算优美,但是极为有用。Unhide 还列入了 [Rootkit Hunter][17] 项目中。 + +-- Matt Sarrel + +![](http://images.techhive.com/images/article/2015/09/bossies-2015-main-100614457-orig.jpg) + +查看更多的开源软件优胜者 + +InfoWorld 网站的 2014 年最佳开源奖由下至上表扬了 100 多个开源项目。通过以下链接可以查看更多开源软件中的翘楚: + +[2015 Bossie 评选:最佳开源应用程序][18] + +[2015 Bossie 评选:最佳开源应用程序开发工具][19] + +[2015 Bossie 评选:最佳开源大数据工具][20] + +[2015 Bossie 评选:最佳开源数据中心和云计算软件][21] + +[2015 Bossie 评选:最佳开源桌面和移动端软件][22] + +[2015 Bossie 评选:最佳开源网络和安全软件][23] + +-------------------------------------------------------------------------------- + +via: http://www.infoworld.com/article/2982962/open-source-tools/bossie-awards-2015-the-best-open-source-networking-and-security-software.html + +作者:[InfoWorld staff][a] +译者:[robot527](https://github.com/robot527) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.infoworld.com/author/InfoWorld-staff/ +[1]:https://www.icinga.org/icinga/icinga-2/ +[2]:http://www.zenoss.com/ +[3]:http://www.opennms.org/ +[4]:https://itunes.apple.com/us/app/opennms-compass/id968875097?mt=8 +[5]:https://play.google.com/store/apps/details?id=com.opennms.compass&hl=en +[6]:http://blog.securityonion.net/p/securityonion.html +[7]:https://www.kali.org/ +[8]:https://community.rapid7.com/community/metasploit/blog/2015/08/12/metasploit-on-kali-linux-20 +[9]:http://www.openvas.org/ +[10]:http://www.greenbone.net/ +[11]:https://www.owasp.org/index.php/Main_Page +[12]:https://www.owasp.org/index.php/OWASP_Zed_Attack_Proxy_Project +[13]:https://www.owasp.org/index.php/O-Saft +[14]:https://www.owasp.org/index.php/OWASP_OWTF +[15]:http://www.beefproject.com/ +[16]:http://www.unhide-forensics.info/ +[17]:http://www.rootkit.nl/projects/rootkit_hunter.html +[18]:http://www.infoworld.com/article/2982622/bossie-awards-2015-the-best-open-source-applications.html +[19]:http://www.infoworld.com/article/2982920/bossie-awards-2015-the-best-open-source-application-development-tools.html +[20]:http://www.infoworld.com/article/2982429/bossie-awards-2015-the-best-open-source-big-data-tools.html +[21]:http://www.infoworld.com/article/2982923/bossie-awards-2015-the-best-open-source-data-center-and-cloud-software.html +[22]:http://www.infoworld.com/article/2982630/bossie-awards-2015-the-best-open-source-desktop-and-mobile-software.html +[23]:http://www.infoworld.com/article/2982962/bossie-awards-2015-the-best-open-source-networking-and-security-software.html diff --git a/translated/share/20151028 Bossie Awards 2015--The best open source networking and security software.md b/translated/share/20151028 Bossie Awards 2015--The best open source networking and security software.md deleted file mode 100644 index a073ce5349..0000000000 --- a/translated/share/20151028 Bossie Awards 2015--The best open source networking and security software.md +++ /dev/null @@ -1,164 +0,0 @@ -Martin - -2015 Bossie 评选:最佳开源网络和安全软件 -================================================================================ -InfoWorld 在建设网络,运营网络和保障网络安全领域精选出了年度开源工具获奖者。 - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-net-sec-100614459-orig.jpg) - -### 最佳开源网络和安全软件 ### - -[BIND](https://en.wikipedia.org/wiki/BIND), [Sendmail](https://en.wikipedia.org/wiki/Sendmail), [OpenSSH](https://en.wikipedia.org/wiki/OpenSSH), [Cacti](https://en.wikipedia.org/wiki/Cactus), [Nagios](https://en.wikipedia.org/wiki/Nagios), [Snort](https://en.wikipedia.org/wiki/Snort_%28software%29) -- 这些为了网络而发明的开源软件,许多老家伙和好东西依然强劲。今年在我们这个范畴的最佳选择中,你会发现中坚支柱,新人,和新贵正在完善网络管理,安全监控,漏洞评估,[rootkit](https://en.wikipedia.org/wiki/Rootkit) 检测,以及更多。 - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-icinga-100614482-orig.jpg) - -### Icinga 2 ### - -Icinga 起先只是系统监控应用 Nagios 的一个分叉。为了给用户一个时尚的界面,对多个数据库的支持,以及一个集成众多扩展的 API,[Icinga 2][1] 被完全重写。凭借开箱即用的负载均衡、通知和配置,Icinga 2 缩短了在复杂环境下的安装时间。Icinga 2 原生支持 [Graphite](https://github.com/graphite-project/graphite-web)(系统监控应用),轻松为管理员呈现实时性能图表。但是 Icinga 今年很火是因为它发布了一个支持可拖放可定制 dashboard 和一些流式监控工具的前端图形界面系统 Icinga Web 2。 - -管理员可以查看,过滤,并把问题按优先顺序排好,同时保持跟踪已经进行的动作。一个新的矩阵视图使管理员能够在一个页面上查看主机和服务。您可以查看一个特定时间段的事件或筛选了的事件来了解哪些需要立即关注。Icinga Web 2 能够拥有一个全新界面和更为强劲的性能,然而传统版 Icinga 和 Web 版 Icinga 的所有常用命令仍然可用。这意味着学习新版工具不耗费额外的时间。 - --- Fahmida Rashid - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-zenoss-100614465-orig.jpg) - -### Zenoss Core ### - -另一个强大的开源软件,[Zenoss Core][2] 为网络管理员提供了一个完整的,一站式解决方案来跟踪和管理所有的应用程序、服务器、存储,网络组件、虚拟化工具、以及企业基础架构的其他元素。管理员可以确保硬件的运行效率并利用模块化设计的插件来扩展 ZenPacks 的功能。 - -Zenoss Core 5,在今年二月发布,作为已经很强大的工具,并进一步改进以增强用户界面和扩展 dashboard。基于 Web 的控制台和 dashboard 已经是高度可定制的和动态调整的,现在新版本可让管理员混搭多个组件图表到一个图表。可把它作为一种更好的根源分析和因果分析的工具。 - -Portlets 为网络映射、设备问题、守护进程、产品状态、监视列表和事件视图等等提供深入的分析。而且新的 HTML5 图表可以从工具导出。Zenoss 的控制中心支持带外管理并且可监控所有 Zenoss 组件。Zenoss Core 拥有在线备份和恢复、快照和回滚和多主机部署的新工具。更重要的是,凭借对 Docker 的全面支持,部署起来更快了。 - --- Fahmida Rashid - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-opennms-100614461-orig.jpg) - -### OpenNMS ### - -一个非常灵活的网络管理解决方案,[OpenNMS][3] 可以处理任何网络管理任务,无论是设备管理,应用性能监控,库存控制,或事件管理。凭借对 IPv6 的支持,强大的警报系统,和记录用户脚本来测试 Web 应用程序的能力,OpenNMS 拥有网络管理员和测试人员需要的一切。OpenNMS 现在变得像一款移动 dashboard,堪称 OpenNMS 指南针,可让网络专家随时,甚至当他们外出时都可以监视他们的网络。 - -该应用程序的 IOS 版本,可从 [iTunes App Store][4] 上获取,显示故障、节点和告警。下一个版本将提供更多的事件细节、资源图表、以及关于 IP 和 SNMP 接口的信息。安卓版可从 [Google Play][5] 上获取,可在仪表板上显示网络可用性,故障和告警,以及确认、提升或清除告警的能力。移动客户端与 OpenNMS Horizon 1.12 或更高版本以及 OpenNMS Meridian 2015.1.0 或更高版本兼容。 - --- Fahmida Rashid - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-onion-100614460-orig.jpg) - -### Security Onion ### - -如同一个洋葱,网络安全监控是由许多层组成。没有单一的工具会使你洞察在你公司网络中的每次攻击,或者显示每一次侦查或文本会话给你。[Security Onion][6] 打包了许多经过验证的工具成为一个便于使用的 Ubuntu 发行版,这会让你看到谁留在你的网络里,并帮助你隔离坏家伙。 - -无论你是采取主动式的网络安全监测还是追查可能的攻击,Security Onion 都可以帮助你。由传感器、服务器和显示层组成,Onion 结合了基于网络和基于主机的入侵检测,全面的网络数据包捕获,并提供了所有的各种日志进行检查和分析。 - -众星云集的的网络安全工具链,包括用于网络抓包的 [Netsniff-NG](http://www.netsniff-ng.org/)、基于规则的网络入侵检测系统 Snort 和 [Suricata](https://en.wikipedia.org/wiki/Suricata_%28software%29),基于分析的网络监控系统 Bro,基于主机的入侵检测系统 OSSEC 和用于显示、分析和日志管理的 Sguil、Squert、Snorby 和 ELSA (企业日志搜索和归档)。它是一个经过精挑细选的工具集,全被打包进一个向导驱动式的安装程序并有完整的文档支持,可以帮助你尽可能快地进行监控。 - --- Victor R. Garza - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-kali-100614458-orig.jpg) - -Kali Linux - -[Kali Linux][7] 背后的团队修改了今年流行的安全 Linux 发行版,使其更快,更全能。Kali 采用全新 4.0 版的内核 ,改进了对硬件和无线驱动程序的支持,以及一个更流畅的界面。最流行的工具都可从屏幕的侧边栏上轻松访问。最大的改变?Kali Linux 现在是一个滚动发行版,具有连续的软件更新。Kali 的核心系统是基于 Debian Jessie 发行版,而且该团队会不断地从 Debian 测试版 pull 程序包,同时持续在上面添加新的 Kali 风格的特性。 - -该发行版仍然配备满了渗透测试,漏洞分析,安全审查,网络应用分析,无线网络评估,逆向工程,和漏洞利用工具。现在该发行版具有新版本检测系统,当有个别工具可更新时系统会自动通知用户。该发行版还具有一系列设备的 ARM 映像,包括树莓派、[Chromebook](https://en.wikipedia.org/wiki/Chromebook) 和 [Odroid](https://en.wikipedia.org/wiki/ODROID),也可更新在 Android 设备上运行的 [NetHunter](https://www.kali.org/kali-linux-nethunter/) 渗透测试平台。还有其他的变化:Metasploit 的社区版/专业版不再包括在内,因为 Kali 2.0 还没有 [Rapid7 的官方支持][8]。 - --- Fahmida Rashid - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-openvas-100614462-orig.jpg) - -### OpenVAS ### - -[OpenVAS][9],开源漏洞评估系统,是一种整合多种服务和工具来提供漏洞扫描和漏洞管理的软件框架。该扫描器与每周一次的网络漏洞测试数据配合,或者您可以使用商业数据。该软件框架包括一个命令行界面(所以它可以用脚本运行)和一个带 SSL 安全机制的基于 [Greenbone 安全助手][10] 的浏览器界面。OpenVAS 提供了用于附加功能的各种插件。扫描可以预定运行或按需运行。 - -可通过单一的主控来控制多个 OpenVAS 的安装,使得它成为一个可扩展的企业漏洞评估工具。该项目与兼容这样的标准:扫描结果和配置存储在 SQL 数据库中,在那里他们可以容易地被外部报告工具访问。客户端工具通过基于 XML 的无状态 OpenVAS 管理协议访问 OpenVAS 管理器,所以安全管理员可以扩展该框架的功能。该软件能以包或源代码的方式安装在 Windows 或 Linux 上运行,或者作为一个虚拟设备被下载。 - --- Matt Sarrel - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-owasp-100614463-orig.jpg) - -### OWASP ### - -[OWASP][11],开放的 Web 应用安全项目,是专注于提高软件安全性的全球协会的非营利组织。社区性组织提供测试工具、文档、培训和几乎任何你可以想象的评估软件安全和开发安全软件相关的最佳实践。有几个 OWASP 项目已成为很多安全从业者的工具箱中有价值的组件: - -[ZAP][12],ZED 攻击代理项目,是一个在 Web 应用程序中寻找漏洞的渗透测试工具。ZAP 的设计目标之一是使之易于使用,以便于开发人员和非安全专家的测试人员可以受益于使用它。ZAP 提供了自动扫描器和一套手动测试工具。 - -[Xenotix XSS Exploit Framework][13] 是一款运行浏览器引擎内的扫描来获得实际结果的先进的跨站脚本漏洞检测和漏洞利用框架。Xenotix 扫描器模块采用三个智能的 fuzzer,它可以运行近 5000 个不同的XSS有效载荷。一个 API 可以让安全管理员扩展和定制开发工具包。 - -[O-Saft][14],OWASP SSL 高级审查工具,一个查看 SSL 证书详细信息和测试 SSL 连接的 SSL 审计工具。这个命令行工具可以在线或离线运行来评估 SSL 安全性,比如密码和配置。O-Saft 提供了常见漏洞的内置检查,你可以容易地通过编写脚本来扩展这些功能。在 2015 年 5 月加入了一个简单的图形用户界面作为可选的下载项。 - -[OWTF][15],攻击性的 Web 测试框架,一个遵循 OWASP 测试指南和 NIST 和 PTES 标准的自动化测试工具。该框架使用一个 Web 用户界面和一个命令行,它探测 Web 和应用服务器常见漏洞,如配置不当和未打补丁的软件。 - --- Matt Sarrel - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-beef-100614456-orig.jpg) - -### BeEF ### - -Web 浏览器已经成为用于针对客户端的攻击中最常见的载体。[BeEF][15] 浏览器漏洞利用框架项目,是一种广泛使用的用以评估 Web 浏览器安全性的渗透工具。BeEF 帮助你揭露客户端系统的安全弱点,通过启动浏览器来进行客户端攻击。BeEF 建立了一个恶意网站,安全管理员用想要测试的浏览器访问该网站。然后 BeEF 发送命令来攻击 Web 浏览器并使用命令在客户端机器上植入软件。如果他们是僵尸机 ,管理员可以对客户端机器发动攻击。 - -BeEF 自带像键盘记录器,一个端口扫描器,和 Web 代理这样的常用模块,此外你可以编写你自己的模块或直接将命令发送到僵尸测试机。BeEF 带有少量的演示网页来帮你快速入门使得编写额外的网页和攻击模块很简单,因此你可以自定义测试你的环境。BeEF 是一个评估浏览器和终端安全、学习如何发起基于浏览器的攻击的宝贵的测试工具。可使用它来展示恶意软件通常如何感染客户端设备的演示给你的用户。 - --- Matt Sarrel - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-unhide-100614464-orig.jpg) - -### Unhide ### - -[Unhide][16] 是一个定位开放的 TCP/UDP 端口和隐藏在 UNIX、Linux 和 Windows 上的进程的审查工具。隐藏的端口和进程可以是 rootkit 或 LKM(可加载的内核模块)activity 的结果。rootkit 可能很难找到并移除,因为它们被设计成隐蔽的,对操作系统和用户隐藏自己。一个 rootkit 可以使用内核模块隐藏其进程或冒充其他进程,让它在机器上运行很长一段时间而不被发现。Unhide 可以保证管理员需要的干净系统。 - -Unhide 实际上是两个单独的脚本:一个用于进程,一个用于端口。该工具查询正在运行的进程、线程和开放的端口并将这些信息与系统中注册的活动比较,报告之间的差异。Unhide 和 WinUnhide 是在运行命令行产生文本输出的非常轻量级的脚本。它们不算优美,但是极为有用。Unhide 还列入了 [Rootkit Hunter][17] 项目中。 - --- Matt Sarrel - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-main-100614457-orig.jpg) - -查看更多的开源软件优胜者 - -InfoWorld 网站的 2014 年最佳开源奖从堆栈底部到顶部庆祝了 100 多个开源项目。以下链接指向更多开源软件优胜者: - -[2015 Bossie 评选:最佳开源应用程序][18] - -[2015 Bossie 评选:最佳开源应用程序开发工具][19] - -[2015 Bossie 评选:最佳开源大数据工具][20] - -[2015 Bossie 评选:最佳开源数据中心和云计算软件][21] - -[2015 Bossie 评选:最佳开源桌面和移动端软件][22] - -[2015 Bossie 评选:最佳开源网络和安全软件][23] - --------------------------------------------------------------------------------- - -via: http://www.infoworld.com/article/2982962/open-source-tools/bossie-awards-2015-the-best-open-source-networking-and-security-software.html - -作者:[InfoWorld staff][a] -译者:[robot527](https://github.com/robot527) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.infoworld.com/author/InfoWorld-staff/ -[1]:https://www.icinga.org/icinga/icinga-2/ -[2]:http://www.zenoss.com/ -[3]:http://www.opennms.org/ -[4]:https://itunes.apple.com/us/app/opennms-compass/id968875097?mt=8 -[5]:https://play.google.com/store/apps/details?id=com.opennms.compass&hl=en -[6]:http://blog.securityonion.net/p/securityonion.html -[7]:https://www.kali.org/ -[8]:https://community.rapid7.com/community/metasploit/blog/2015/08/12/metasploit-on-kali-linux-20 -[9]:http://www.openvas.org/ -[10]:http://www.greenbone.net/ -[11]:https://www.owasp.org/index.php/Main_Page -[12]:https://www.owasp.org/index.php/OWASP_Zed_Attack_Proxy_Project -[13]:https://www.owasp.org/index.php/O-Saft -[14]:https://www.owasp.org/index.php/OWASP_OWTF -[15]:http://www.beefproject.com/ -[16]:http://www.unhide-forensics.info/ -[17]:http://www.rootkit.nl/projects/rootkit_hunter.html -[18]:http://www.infoworld.com/article/2982622/bossie-awards-2015-the-best-open-source-applications.html -[19]:http://www.infoworld.com/article/2982920/bossie-awards-2015-the-best-open-source-application-development-tools.html -[20]:http://www.infoworld.com/article/2982429/bossie-awards-2015-the-best-open-source-big-data-tools.html -[21]:http://www.infoworld.com/article/2982923/bossie-awards-2015-the-best-open-source-data-center-and-cloud-software.html -[22]:http://www.infoworld.com/article/2982630/bossie-awards-2015-the-best-open-source-desktop-and-mobile-software.html -[23]:http://www.infoworld.com/article/2982962/bossie-awards-2015-the-best-open-source-networking-and-security-software.html From ff3a7953ec02d5d3626fc060797ee43d6fd8e96a Mon Sep 17 00:00:00 2001 From: runningwater Date: Wed, 9 Mar 2016 00:47:10 +0800 Subject: [PATCH 0505/1469] =?UTF-8?q?=E6=9A=82=E5=AD=98=E4=B8=80=E9=83=A8?= =?UTF-8?q?=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20160225 The Tao of project management.md | 121 ++++++++---------- 1 file changed, 54 insertions(+), 67 deletions(-) diff --git a/sources/tech/20160225 The Tao of project management.md b/sources/tech/20160225 The Tao of project management.md index a8de86ae0b..5cea94472d 100644 --- a/sources/tech/20160225 The Tao of project management.md +++ b/sources/tech/20160225 The Tao of project management.md @@ -1,119 +1,105 @@ -(翻译中 by runningwater) -The Tao of project management +项目管理之道 ================================= ![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BUSINESS_orgchart1.png?itok=DGsp6jB5) -The [Tao Te Ching][1], [believed to have been written][2] by the sage [Lao Tzu][3] in the 6th century BCE, is among the most widely translated texts in existence. It has inspired everything from [religions][4] to [funny movies about dating][5], and authors have used it as a metaphor to explain all kinds of things (even [programming][6]). +[道德经][1],[据确认][2]为公元前六世纪的圣人[老子][3]所编写,是现存被翻译的语言版本最多的经文。从[宗教][4]到[关于约会的有趣电影][5]等一切的一切,它都影响至深,作者们借用它来隐喻,以解释各种各样的事情(甚至是[编程][6])。 -This text is what immediately comes to my mind when thinking about project management in open organizations. +当考虑开放性组织的项目管理时上面这段文字会立马浮现在我脑海。 -That might sound strange. But to understand where I'm coming from, you should start by reading *The Open Organization: Igniting Passion and Performance*, Red Hat president and CEO Jim Whitehurst's manifesto on corporate culture and the new leadership paradigm. In this book, Jim (with a little help from other Red Hatters) explains the difference between conventional organizations (a "top-down" approach, with decisions coming down from central command to employees motivated by promotion and pay) and open organizations (a bottom-up approach, with leaders focused on inspiring purpose and passion so employees are empowered to be and do their best). +这听起来会很奇怪。要理解我为什么会有这种想法,应该是从读了*《开放性组织:点燃激情提升执行力》*这书开始的,它是红帽公司总裁、CEO Jim Whitehurst 所著作的关于企业文化和新领导榜样的宣言。在这本书里,Jim(给予其它红帽子人的一点帮助而) 解释了传统组织机构(“自上而下”的方式,做决定的是高层,命令下达到员工,而员工是通过薪酬和晋升来激励的)和开放组织机构(自下而上,领导专注于激励和鼓励,员工被充分授权使其发挥主观能动性而做得最好)的差异。 -This concept—that employees in open organizations are motivated by passion, purpose, and engagement—plays directly into where I think project managers should focus. +在开放性组织中的员工意味有激情、有目的性和有参与感,这些我认为是项目管理者应该关注的。 -And to explain, I'll return to the *Tao Te Ching*. +要解释这一切,让我们回到*道德经*上来。 -### Don't let your job title define you +### 不要让工作职衔框住自身 ->The tao that can be told ->is not the eternal Tao ->The name that can be named ->is not the eternal Name. +>道,可道, +>非常道; +>名,可名, +>非常名。 ->The unnameable is the eternally real. ->Naming is the origin ->of all particular things. +>无,名天地之始; +>有,名万物之母。 [[1]][7] -What exactly is project management? And what does a project manager do? +项目管理到底是什么?做为一个项目管理者应该做些什么呢? -As you might expect, part of being a project manager is managing projects: gathering requirements, managing stakeholder communication, setting priority, scheduling tasks, helping the team resolve blockers. Many institutions can teach you how to manage projects very well, and these are good skills to have. +如您所想,项目管理者的一部分工作就是管理项目:收集需求、项目相关人员的沟通、设置项目优先级、安排任务、帮助团队解决困扰。许多教育培训机构都可以教授如何做好项目管理,这些技能值得去学习。 -However, literally managing projects is only part of what project managers in open organizations do. These organizations require something more: Courage. If you're good at managing projects (or if you're good at any job, really), then you can start to feel safe in your routine. That's when you know you need to find the courage to take a risk. +然而,在开放性组织中,字面上的项目管理技能仅仅只是项目管理者需要做到一小部分,这些组织需要更多的:勇气。如果您擅长于管理项目(或者是真的擅长于任何工作),那么您就进入了舒适区。这时候就是需要鼓起勇气开始尝试冒险之时。 -Do you have the courage to step outside of your comfort zone? The courage to ask important people challenging questions that might raise eyebrows, but that might also uncover a better way forward? The courage to identify the next thing that needs to be done—then the courage to go and do it? The courage to call out communication gaps and take initiative to fix them? The courage to try things? The courage to fail? +您有勇气跨出舒适区吗?向权威人士提出提出挑战性问题,可能会引发对方的不快,也可能会发现一个好的方法,您有勇气这样做吗?有确定需要做的下一件事,然后真正去完成它的勇气吗?有主动去解决因为沟通空白而留下的问题的勇气吗?有去尝试各种事情的勇气吗?有失败的勇气吗? -The opening passage of the Tao Te Ching (which I cited above) suggests that words, labels, and names are limiting. That includes job titles. In open organizations, project managers don't just perform the rote tasks required to manage projects. They help teams accomplish the organization's mission, however defined. +道德经的开篇(上面引用的)就表明词语、标签、名字这些是有限制的,也包括工作职衔。在开放性组织中,项目经理不仅仅是执行管理项目所需的机械任务,而且要帮助团队完成组织的使命,尽管只是定义。 -### Connect the right people +### 结交正确的人 ->We join spokes together in a wheel, ->but it is the center hole ->that makes the wagon move. +>三十辐共一毂, +>当其无, +>有车之用。 [[11]][8] -One of the most difficult lessons I had to learn as I transitioned into project management was that not having all the answers was perfectly acceptable, even expected. That was new for me. I like having all the answers. But as a project manager, my role is more about connecting people—so the ones who do have the answers can collaborate efficiently. +当我开始学习要过渡到项目管理时,遇到最困难的一课就是并不是所有解决方案都是可接受的,甚至有的连预期都达不到。那对我来说是全新的,我喜欢所有的解决方案。但作为项目管理者,我的角色更多的是与人沟通--因此与那些有解决方案的人合作更有效率。 -This does not mean dodging responsibility or ownership. This means being comfortable saying, "I don't know, but I will find out for you," and closing that loop as quickly as possible. +这决不是逃避责任和不负责的意思。这意味着可以很舒适的说,“我不知道,但我会给您找出答案”,然后就可迅速的关闭此循环。 -Picture a wagon wheel. Without the stability and direction provided by the center hole, the spokes would fall and the wheel collapse in on itself. Project managers in an open organization can help a team maintain forward momentum by bringing the right people together and cultivating the right discussions. +想像马车的车轮。无中心孔的稳定性和方向,辐条车轮会自行崩溃。在一个开放性的组织中,项目管理者可以帮助一个团队,把正确的人凝聚在一起,主持积极讨论,以保持团队一直前进。 -### Trust your team +### 信任您的团队 ->When the Master governs, the people ->are hardly aware that he exists. ->Next best is a leader who is loved. ->Next, one who is feared. ->The worst is one who is despised. +>太上, 不知有之; +>其次,亲而誉之; +>其次,畏之; +>其次,侮之。 > ->If you don't trust the people, ->you make them untrustworthy. +>信不足焉,有不信焉。 > ->The Master doesn't talk, he acts. ->When his work is done, ->the people say, "Amazing: ->we did it, all by ourselves!" +>悠兮,其贵言。功成事遂,百姓皆谓“我自然”。 [[17]][9] -[Rebecca Fernandez][10] once told me that what differentiates leaders in open organizations is not the trust people have in them, but the trust they have in other people. +[Rebecca Fernandez][10]曾经告诉我开放性组织的领导与其它最大的不同点,不是取得别人的信任,而是信任别人。 -Open organizations do a great job hiring smart people who are passionate about what their companies are doing. In order for them to do their best work, we have to give them what they need and then get out of their way. +开放性组织会雇佣那些非常聪明的,且对公司正在做的事情充满激情的人来做工作。为了能使他们能更好的工作,我们会提供其所需,并尊重他们的工作方式。 -Here, I think the above passage from the Tao Te Ching speaks for itself. +至于原因,我认为从道德经中摘出的上面一段就说的很清楚。 -### Be effortless +### 顺其自然 ->The Master does nothing ->yet he leaves nothing undone. ->The ordinary man is always doing things, ->yet many more are left to be done. +>上德无为而无以为;下德为之而有以为。 [[38]][11] -Do you know the type of person who is always extremely busy? The one who seems frazzled and stressed with too many things to do? +你认识总是忙忙碌碌的这种类型的人吗?认识因为有太多事情要做而看起来疲倦和压抑的人吗? -Don't be that person. +不要成为那样的人。 -I know that's easier said than done. The thing that most helps me keep from being that person is remembering that we are all extremely busy. I don't have a single co-worker who is bored. +我知道说比做容易。要远离那种人最有帮助的事就是请记住大家都很忙。我没有那样讨厌的同事。 -But someone needs to be the calm in the middle of the storm. Someone needs to be the person who reassures the team that everything is going to be okay, that we'll find a way to get things done within the parameters dictated by reality and the number of business hours in a day (because that's the truth, and we have to). +但需要有人在狂风暴雨中保持镇定;需要这样的人,能根据实际和一天工作时间的数量找到平衡参数的方式来做工作,并安慰团队让一切都好(因为这是我们正在做的事实)。 -Be that person. +要成为那样的人。 -What this passage of the Tao Te Ching says to me is that the person who's always talking about what she or he is doing has no time to actually do those things. If you can make your job seem effortless to those around you, then you're doing your job right. +道德经所说的,在我理解来就是总是夸夸其谈的人其实并没有干实事。如里您能把工作做的得心应手的话,那就说明您的工作做对了。 -### Be a culture coach +### 作为一个文化传教士 ->When a superior man hears of the Tao, ->he immediately begins to embody it. ->When an average man hears of the Tao, ->he half believes it, half doubts it. ->When a foolish man hears of the Tao, ->he laughs out loud. ->If he didn't laugh, ->it wouldn't be the Tao. +>上士闻道,勤而行之; +>中士闻道,若存若亡; +>下士闻道,大笑之。 +>不笑不足以为道。 [[41]][12] -Last fall, I enrolled an MBA business ethics class with a bunch of federal employees. When I started describing my company's culture, values, and ethics framework, I got the direct impression that both my classmates and my professor thought I was a naive young lady with [a lot of lovely daydreams][13] about how companies should run. They told me things couldn't possibly be as they seemed. They said I should investigate further. +去年秋天,我跟着一群联邦雇员注册了一个工商管理硕士课程。当我开始介绍我公司的文化、价值和伦理框架以及公司如何运行时,我的同学和教授都认为我就像一个天真可爱的小姑娘在做着[许多甜美的白日梦][13],这就是我得到的直接印象。他们告诉我事情并不是如此的。他们告诉我应该进一步考察。 -So I did. +所有我照做了。 -And here's what I found: Things are exactly as they seem. +到现在我发现:正是如此。 -In open organizations, culture matters. Maintaining that culture as an organization grows makes it possible to wake up and look forward to going to work in the morning. I (and other members of open organizations) don't want to "work to live," as my classmates described it. I need to feel a passion and purpose, to understand how the work I do on a daily basis directly contributes to something I believe in. +开放性组织的企业文化。应该跟随着企业的成长而时时维护那些文化,以使它随时精神焕发,充满斗志。我(和其它开源组织的成员)并不想过如我同学所描述的“为生活而工作”。我需要有激情和有目的性;我需要明白自己的日常工作如何对那些有价值的东西服务。 -As a project manager, you might think that your job has nothing to do with cultivating your company's culture on your team. However, it's your job to embody it. +作为一个项目管理者,虽然你的工作与培养你的团队的文化无关,但是工作本身就是文化。 ### Kaizen @@ -168,6 +154,7 @@ via: https://opensource.com/open-organization/16/2/tao-project-management [6]: http://www.mit.edu/~xela/tao.html [7]: http://acc6.its.brooklyn.cuny.edu/~phalsall/texts/taote-v3.html#1 [8]: http://acc6.its.brooklyn.cuny.edu/~phalsall/texts/taote-v3.html#11 +[9]:http://acc6.its.brooklyn.cuny.edu/~phalsall/texts/taote-v3.html#17 [10]: https://opensource.com/users/rebecca [11]: http://acc6.its.brooklyn.cuny.edu/~phalsall/texts/taote-v3.html#38 [12]: http://acc6.its.brooklyn.cuny.edu/~phalsall/texts/taote-v3.html#41 From 8235a9fd5731180e2ae8ba80bc5281d0cea99c26 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 9 Mar 2016 10:51:43 +0800 Subject: [PATCH 0506/1469] PUB:20151204 Review EXT4 vs. Btrfs vs. XFS @ictlyh --- .../20151204 Review EXT4 vs. Btrfs vs. XFS.md | 65 +++++++++++++++++++ .../20151204 Review EXT4 vs. Btrfs vs. XFS.md | 65 ------------------- 2 files changed, 65 insertions(+), 65 deletions(-) create mode 100644 published/20151204 Review EXT4 vs. Btrfs vs. XFS.md delete mode 100644 translated/share/20151204 Review EXT4 vs. Btrfs vs. XFS.md diff --git a/published/20151204 Review EXT4 vs. Btrfs vs. XFS.md b/published/20151204 Review EXT4 vs. Btrfs vs. XFS.md new file mode 100644 index 0000000000..aebbc485b1 --- /dev/null +++ b/published/20151204 Review EXT4 vs. Btrfs vs. XFS.md @@ -0,0 +1,65 @@ +如何选择文件系统:EXT4、Btrfs 和 XFS +================================================================================ +![](http://1969324071.rsc.cdn77.org/wp-content/uploads/2015/09/1385698302_funny_linux_wallpapers.jpg) + +老实说,人们最不曾思考的问题之一是他们的个人电脑中使用了什么文件系统。Windows 和 Mac OS X 用户更没有理由去考虑,因为对于他们的操作系统,只有一种选择,那就是 NTFS 和 HFS+。相反,对于 Linux 系统而言,有很多种文件系统可以选择,现在默认的是广泛采用的 ext4。然而,现在也有改用一种称为 btrfs 文件系统的趋势。那是什么使得 btrfs 更优秀,其它的文件系统又是什么,什么时候我们又能看到 Linux 发行版作出改变呢? + +首先让我们对文件系统以及它们真正干什么有个总体的认识,然后我们再对一些有名的文件系统做详细的比较。 + +### 文件系统是干什么的? ### + +如果你不清楚文件系统是干什么的,一句话总结起来也非常简单。文件系统主要用于控制所有程序在不使用数据时如何存储数据、如何访问数据以及有什么其它信息(元数据)和数据本身相关,等等。听起来要编程实现并不是轻而易举的事情,实际上也确实如此。文件系统一直在改进,包括了更多的功能、更高效地完成它需要做的事情。总而言之,它是所有计算机的基本需求、但并不像听起来那么简单。 + +### 为什么要分区? ### + +由于每个操作系统都能创建或者删除分区,很多人对分区都有模糊的认识。Linux 操作系统即便使用标准安装过程,在同一块磁盘上仍使用多个分区,这看起来很奇怪,因此需要一些解释。拥有不同分区的一个主要目的就是为了在灾难发生时能获得更好的数据安全性。 + +通过将硬盘划分为分区,数据会被分隔以及重组。当事故发生的时候,只有存储在被损坏分区上的数据会被破坏,很大可能上其它分区的数据能得以保留。这个原因可以追溯到 Linux 操作系统还没有日志文件系统、任何电力故障都有可能导致灾难发生的时候。 + +使用分区也考虑到了安全和健壮性原因,因此操作系统部分损坏并不意味着整个计算机就有风险或者会受到破坏。这也是当前采用分区的一个最重要因素。举个例子,用户创建了一些会填满磁盘的脚本、程序或者 web 应用,如果该磁盘只有一个大的分区,如果磁盘满了那么整个系统就不能工作。如果用户把数据保存在不同的分区,那么就只有那个分区会受到影响,而系统分区或者其它数据分区仍能正常运行。 + +记住,拥有一个日志文件系统只能在掉电或者和存储设备意外断开连接时提供数据安全性,并不能在文件系统出现坏块或者发生逻辑错误时保护数据。对于这种情况,用户可以采用廉价磁盘冗余阵列(RAID:Redundant Array of Inexpensive Disks)的方案。 + +### 为什么要切换文件系统? ### + +ext4 文件系统由 ext3 文件系统改进而来,而后者又是从 ext2 文件系统改进而来。虽然 ext4 文件系统已经非常稳定,是过去几年中绝大部分发行版的默认选择,但它是基于陈旧的代码开发而来。另外, Linux 操作系统用户也需要很多 ext4 文件系统本身不提供的新功能。虽然通过某些软件能满足这种需求,但性能会受到影响,在文件系统层次做到这些能获得更好的性能。 + +### Ext4 文件系统 ### + +ext4 还有一些明显的限制。最大文件大小是 16 tebibytes(大概是 17.6 terabytes),这比普通用户当前能买到的硬盘还要大的多。使用 ext4 能创建的最大卷/分区是 1 exbibyte(大概是 1,152,921.5 terabytes)。通过使用多种技巧, ext4 比 ext3 有很大的速度提升。类似一些最先进的文件系统,它是一个日志文件系统,意味着它会对文件在磁盘中的位置以及任何其它对磁盘的更改做记录。纵观它的所有功能,它还不支持透明压缩、重复数据删除或者透明加密。技术上支持了快照,但该功能还处于实验性阶段。 + +### Btrfs 文件系统 ### + +btrfs 有很多不同的叫法,例如 Better FS、Butter FS 或者 B-Tree FS。它是一个几乎完全从头开发的文件系统。btrfs 出现的原因是它的开发者起初希望扩展文件系统的功能使得它包括快照、池化(pooling)、校验以及其它一些功能。虽然和 ext4 无关,它也希望能保留 ext4 中能使消费者和企业受益的功能,并整合额外的能使每个人,尤其是企业受益的功能。对于使用大型软件以及大规模数据库的企业,让多种不同的硬盘看起来一致的文件系统能使他们受益并且使数据整合变得更加简单。删除重复数据能降低数据实际使用的空间,当需要镜像一个单一而巨大的文件系统时使用 btrfs 也能使数据镜像变得简单。 + +用户当然可以继续选择创建多个分区从而无需镜像任何东西。考虑到这种情况,btrfs 能横跨多种硬盘,和 ext4 相比,它能支持 16 倍以上的磁盘空间。btrfs 文件系统一个分区最大是 16 exbibytes,最大的文件大小也是 16 exbibytes。 + +### XFS 文件系统 ### + +XFS 文件系统是扩展文件系统(extent file system)的一个扩展。XFS 是 64 位高性能日志文件系统。对 XFS 的支持大概在 2002 年合并到了 Linux 内核,到了 2009 年,红帽企业版 Linux 5.4 也支持了 XFS 文件系统。对于 64 位文件系统,XFS 支持最大文件系统大小为 8 exbibytes。XFS 文件系统有一些缺陷,例如它不能压缩,删除大量文件时性能低下。目前RHEL 7.0 文件系统默认使用 XFS。 + +### 总结 ### + +不幸的是,还不知道 btrfs 什么时候能到来。官方说,其下一代文件系统仍然被归类为“不稳定”,但是如果用户下载最新版本的 Ubuntu,就可以选择安装到 btrfs 分区上。什么时候 btrfs 会被归类到 “稳定” 仍然是个谜, 直到真的认为它“稳定”之前,用户也不应该期望 Ubuntu 会默认采用 btrfs。有报道说 Fedora 18 会用 btrfs 作为它的默认文件系统,因为到了发布它的时候,应该有了 btrfs 文件系统校验器。由于还没有实现所有的功能,另外和 ext4 相比性能上也比较缓慢,btrfs 还有很多的工作要做。 + +那么,究竟使用哪个更好呢?尽管性能几乎相同,但 ext4 还是赢家。为什么呢?答案在于易用性以及广泛性。对于桌面或者工作站, ext4 仍然是一个很好的文件系统。由于它是默认提供的文件系统,用户可以在上面安装操作系统。同时, ext4 支持最大 1 exabytes 的卷和 16 terabytes 的文件,因此考虑到大小,它也还有很大的进步空间。 + +btrfs 能提供更大的高达 16 exabytes 的卷以及更好的容错,但是,到现在为止,它感觉更像是一个附加的文件系统,而部署一个集成到 Linux 操作系统的文件系统。比如,尽管 btrfs 支持不同的发行版,使用 btrfs 格式化硬盘之前先要有 btrfs-tools 工具,这意味着安装 Linux 操作系统的时候它并不是一个可选项,即便不同发行版之间会有所不同。 + +尽管传输速率非常重要,评价一个文件系统除了文件传输速度之外还有很多因素。btrfs 有很多好用的功能,例如写复制(Copy-on-Write)、扩展校验、快照、清洗、自修复数据、冗余删除以及其它保证数据完整性的功能。和 ZFS 相比 btrfs 缺少 RAID-Z 功能,因此对于 btrfs, RAID 还处于实验性阶段。对于单纯的数据存储,和 ext4 相比 btrfs 似乎更加优秀,但时间会验证一切。 + +迄今为止,对于桌面系统而言,ext4 似乎是一个更好的选择,因为它是默认的文件系统,传输文件时也比 btrfs 更快。btrfs 当然值得尝试、但要在桌面 Linux 上完全取代 ext4 可能还需要一些时间。数据场和大存储池会揭示关于 ext4、XCF 以及 btrfs 不同的场景和差异。 + +如果你有不同或者其它的观点,在下面的评论框中告诉我们吧。 + +-------------------------------------------------------------------------------- + +via: http://www.unixmen.com/review-ext4-vs-btrfs-vs-xfs/ + +作者:[M.el Khamlichi][a] +译者:[ictlyh](http://mutouxiaogui.cn/blog/) +校对:[Caroline](https://github.com/carolinewuyan) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.unixmen.com/author/pirat9/ diff --git a/translated/share/20151204 Review EXT4 vs. Btrfs vs. XFS.md b/translated/share/20151204 Review EXT4 vs. Btrfs vs. XFS.md deleted file mode 100644 index 7f93b149ba..0000000000 --- a/translated/share/20151204 Review EXT4 vs. Btrfs vs. XFS.md +++ /dev/null @@ -1,65 +0,0 @@ -EXT4,Btrfs和XFS 文件系统之点评 -================================================================================ -![](http://1426826955.rsc.cdn77.org/wp-content/uploads/2015/09/1385698302_funny_linux_wallpapers-593x445.jpg) - -老实说,人们最不曾考虑的问题之一是他们的个人电脑中使用了什么文件系统。Windows 和 Mac OS X 用户更没有理由去考虑,因为对于他们的操作系统,只有一种选择,那就是 NTFS 和 HFS+。相反,对于 Linux 系统而言,有很多种文件系统可以选择,现在默认的是广泛采用的 ext4。然而,现在也有改用一种称为 btrfs 文件系统的趋势。那是什么使得 btrfs更优秀,其它的文件系统又是什么,什么时候我们又能看到 Linux 发行版作出改变呢? - -首先让我们对文件系统以及它们真正干什么有个总体的认识,然后我们再对一些有名的文件系统做详细的比较。 - -### 文件系统是干什么的? ### - -如果你不清楚文件系统是干什么的,一句话总结起来也非常简单。文件系统主要用于控制所有程序不再使用数据时如何存储数据、如何访问数据以及有什么其它信息(元数据)和数据本身相关,等等。听起来要编程实现并不是轻而易举的事情,实际上也确实如此。文件系统一直在改进,包括更多的功能、更高效地完成它需要做的事情。总而言之,它是所有计算机的基本需求、但并不像听起来那么简单。 - -### 为什么要分区? ### - -由于每个操作系统都能创建或者删除分区,很多人对分区都有模糊的认识。Linux 操作系统在同一块磁盘上即便使用标准安装过程,仍可以使用多个分区,这看起来很奇怪,因此需要一些解释。拥有不同分区的一个主要目的就是为了在灾难发生时能获得更好的数据安全性。 - -通过将硬盘划分为分区,数据会被分隔以及重组。当事故发生的时候,只有存储在被损坏分区的数据会被破坏,很大可能上其它分区的数据能得以保留。这个原因可以追溯到 Linux 操作系统还没有日志文件系统,任何电力故障都有可能导致灾难发生的时候。 - -使用分区也考虑到了安全和健壮性原因,因此操作系统部分损坏并不意味着整个计算机就有风险或者会受到破坏。这也是当前采用分区的一个最重要因素。举个例子,用户创建了一些会填满磁盘的脚本、程序或者 web 应用,如果该磁盘只有一个大的分区,如果磁盘满了那么整个系统就不能工作。如果用户把数据保存在不同的分区,那么就只有那个分区会受到影响,而系统分区或者其它数据分区仍能正常运行。 - -记住,拥有一个日志文件系统只能在掉电或者和存储设备意外断开连接时提供数据安全性,并不能在文件系统出现坏块或者发生逻辑错误时保护数据。对于这种情况,用户可以采用廉价磁盘冗余阵列(RAID:Redundant Array of Inexpensive Disks)的方案。 - -### 为什么要改变文件系统? ### - -ext4 文件系统由 ext3 文件系统改进而来,而后者又是从 ext2 文件系统改进而来。虽然 ext4 文件系统已经非常稳定,是过去几年中绝大部分发行版的默认选择,但它是基于陈旧的代码开发而来。另外, Linux 操作系统用户也需要很多 ext4 文件系统本身不提供的新功能。虽然通过某些软件能满足这种需求,但性能会受到影响,在文件系统层次做到这些能获得更好的性能。 - -### Ext4 文件系统 ### - -ext4 还有一些明显的限值。最大文件大小是 16tebibytes(大概是 17.6 terabytes),这比普通用户当前能买到的硬盘还要大的多。使用 ext4 能创建的最大卷/分区是 1 exbibyte(大概是 1,152,921.5 terabytes)。通过使用多种技巧, ext4 比 ext3 有很大的速度提升。类似一些最先进的文件系统,它是一个日志文件系统,意味着它会对文件在磁盘中的位置以及任何其它对磁盘的更改做记录。纵观它的所有功能,它还不支持透明压缩、重复数据删除或者透明加密。技术上支持了快照,但该功能还处于实验性阶段。 - -### Btrfs 文件系统 ### - -btrfs 有很多不同的发音,例如 Better FS、Butter FS 或者 B-Tree FS。它是一个几乎完全从头开发的文件系统。btrfs 存在的原因是它的开发者期初希望扩展文件系统的功能使得它包括快照、池化、校验以及其它一些功能。虽然和 ext4 无关,它也希望能保留 ext4 中能使消费者和商家受益的功能,并整合额外的能使每个人,尤其是企业受益的功能。对于使用大型软件以及大规模数据库的企业,对于多种不同的硬盘看起来一致的文件系统能使他们受益并且使数据整合变得更加简单。删除重复数据能降低数据实际使用的空间,当需要镜像一个单一和广泛文件系统时使用 btrfs 也能使数据镜像变得简单。 - -用户当然可以继续选择创建多个分区从而无需镜像任何东西。考虑到这种情况,btrfs 能横跨多种硬盘,和 ext4 相比,它能支持 16 倍以上的驱动空间。btrfs 文件系统一个分区最大是 16 exbibytes,最大的文件大小也是 16 exbibytes。 - -### XFS 文件系统 ### - -XFS 文件系统是扩展文件系统(extent file system)的扩展。XFS 是 64 位高性能日志文件系统。对 XFS 的支持大概在 2002 年合并到了 Linux 内核,到了 2009 年,红帽企业版 Linux 5.4 也支持了 XFS 文件系统。对于 64 位文件系统,XFS 支持最大文件系统大小为 8 exbibytes。XFS 文件系统有一些缺陷,例如它不能压缩,删除大量文件时性能低下。目前RHEL 7.0 文件系统默认使用 XFS。 - -### 总后总结 ### - -不幸的是,还不知道 btrfs 什么时候能到来。官方说,下一代文件系统仍然被归类为“不稳定”,但是如果用户下载最新版本的 Ubuntu,就可以选择安装到 btrfs 分区上。什么时候 btrfs 会被归类到 “稳定” 仍然是个谜, 直到真的认为它“稳定”之前,用户也不应该期望 Ubuntu 会默认采用 btrfs。有报道说 Fedora 18 会用 btrfs 作为它的默认文件系统,因为到了发布它的时候,应该有了 btrfs 文件系统校验器。由于还没有实现所有的功能,另外和 ext4 相比性能上也比较缓慢,btrfs 还有很多的工作要做。 - -那么,究竟使用哪个更好呢?尽管性能几乎相同,但 ext4 还是赢家。为什么呢?答案在于易用性以及广泛性。对于桌面或者工作站, ext4 仍然是一个很好的文件系统。由于默认提供,用户可以在上面安装操作系统。同时, ext4 支持最大 1 exabytes 的卷和 16 terabytes 的文件,因此考虑到大小,它也还有很大的进步空间。 - -btrfs 能提供更大的高达 16 exabytes 的卷以及更好的容错,但是,到现在为止,它感觉更像是一个附加文件系统,而没有集成到 Linux 操作系统。比如,尽管 btrfs 支持不同的发行版,使用 btrfs 格式化硬盘之前先要有 btrfs-tools 工具,这意味着安装 Linux 操作系统的时候它并不是一个可选项,即便不同发行版之间会有差异。 - -尽管传输速率非常重要,评价一个文件系统出了文件传输速度之外还有很多因素。btrfs 有很多好用的功能,例如写复制、扩展校验、快照、清洗、自修复数据、冗余删除以及其它保证数据完整性的功能。和 ZFS 相比 btrfs 缺少 RAID-Z 功能,因此对于 btrfs, RAID 还处于实验性阶段。对于单纯的数据存储,和 ext4 相比 btrfs 似乎更加优秀,但时间会验证一切。 - -迄今为止,对于桌面系统而言,ext4 似乎是一个更好的选择,因为它是默认的文件系统,传输文件时也比 btrfs 更快。btrfs 当然值得尝试、但要在桌面 Linux 上完全取代 ext4 可能还需要一些时间。数据场和大存储池会揭示关于 ext4、XCF 以及 btrfs 不同的故事和差异。 - -如果你有不同或者其它的观点,在下面的评论框中告诉我们吧。 - --------------------------------------------------------------------------------- - -via: http://www.unixmen.com/review-ext4-vs-btrfs-vs-xfs/ - -作者:[M.el Khamlichi][a] -译者:[ictlyh](http://mutouxiaogui.cn/blog/) -校对:[Caroline](https://github.com/carolinewuyan) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.unixmen.com/author/pirat9/ From 2f78133e083ee013125fff48c020515db56006ee Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 9 Mar 2016 11:02:12 +0800 Subject: [PATCH 0507/1469] PUB:20160218 Linux Kernel 4.1.18 LTS Is the Biggest in the Series with Hundreds of Changes @GOLinux --- ...est in the Series with Hundreds of Changes.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) rename {translated/tech => published}/20160218 Linux Kernel 4.1.18 LTS Is the Biggest in the Series with Hundreds of Changes.md (66%) diff --git a/translated/tech/20160218 Linux Kernel 4.1.18 LTS Is the Biggest in the Series with Hundreds of Changes.md b/published/20160218 Linux Kernel 4.1.18 LTS Is the Biggest in the Series with Hundreds of Changes.md similarity index 66% rename from translated/tech/20160218 Linux Kernel 4.1.18 LTS Is the Biggest in the Series with Hundreds of Changes.md rename to published/20160218 Linux Kernel 4.1.18 LTS Is the Biggest in the Series with Hundreds of Changes.md index 4a53818b49..595f245e3b 100644 --- a/translated/tech/20160218 Linux Kernel 4.1.18 LTS Is the Biggest in the Series with Hundreds of Changes.md +++ b/published/20160218 Linux Kernel 4.1.18 LTS Is the Biggest in the Series with Hundreds of Changes.md @@ -1,14 +1,16 @@ -Linux最大版本4.1.18 LTS发布,带来大量修改 +Linux 4.1 系列的最大版本 4.1.18 LTS发布,带来大量修改 ================================================================================= +(LCTT 译注:这是一则过期的消息,但是为了披露更新内容,还是发布出来给大家参考) -**著名的内核维护者Greg Kroah-Hartman貌似正在度假中,因为Sasha Levin有幸在今天,2016年2月16日,的早些时候来[宣布](http://lkml.iu.edu/hypermail/linux/kernel/1602.2/00520.html),第十八个Linux内核维护版本Linux Kernel 4.1 LTS通用版本正式发布。** +**著名的内核维护者Greg Kroah-Hartman貌似正在度假中,因为Sasha Levin2016年2月16日的早些时候来[宣布](http://lkml.iu.edu/hypermail/linux/kernel/1602.2/00520.html),第十八个Linux内核维护版本Linux Kernel 4.1 LTS通用版本正式发布。** -作为长期支持的内核分支,Linux 4.1将再多几年接收到更新和补丁,而今天的维护构建版本也证明一点,就是内核开发者们正致力于统保持该系列在所有使用该版本的GNU/Linux操作系统上稳定和可靠。Linux Kernel 4.1.18 LTS是一个大规模发行版,它带来了总计达228个文件修改,这些修改包含了多达5304个插入修改和1128个删除修改。 +作为长期支持的内核分支,Linux 4.1还会在几年内得到更新和补丁,而今天的维护构建版本也证明一点,就是内核开发者们正致力于保持该系列在所有使用该版本的GNU/Linux操作系统上稳定和可靠。Linux Kernel 4.1.18 LTS是一个大的发布版本,它带来了总计达228个文件修改,这些修改包含了多达5304个插入修改和1128个删除修改。 Linux Kernel 4.1.18 LTS更新了什么呢?好吧,首先是对ARM,ARM64(AArch64),MIPS,PA-RISC,m32r,PowerPC(PPC),s390以及x86等硬件架构的改进。此外,还有对Btrfs,CIFS,NFS,XFS,OCFS2,OverlayFS以及UDF文件系统的加强。对网络堆栈的修复,尤其是对mac80211的修复。同时,还有多核心、加密和mm等方面的改进和对声音的更新。 -“我宣布4.1.18内核正式发布,所有4.1内核系列的用户都应当升级。”Sasha Levin说,“更新的4.1.y git树可以在这里找到:git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.1.y,并且可以在常规kernel.org git网站浏览器:http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary 进行浏览。” -## 大量驱动被更新 +“我宣布4.1.18内核正式发布,所有4.1内核系列的用户都应当升级。”Sasha Levin说,“更新的4.1.y git树可以在这里找到:git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.1.y,并且可以在 kernel.org 的 git 网站上浏览:http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary 进行浏览。” + +### 大量驱动被更新 除了架构、文件系统、声音、网络、加密、mm和核心内核方面的改进之外,Linux Kernel 4.1.18 LTS更新了各个驱动,以提供更好的硬件支持,特别是像蓝牙、DMA、EDAC、GPU(主要是Radeon和Intel i915)、无限带宽技术、IOMMU、IRQ芯片、MD、MMC、DVB、网络(主要是无线)、PCI、SCSI、USB、散热、暂存和Virtio等此类东西。 @@ -18,9 +20,9 @@ Linux Kernel 4.1.18 LTS更新了什么呢?好吧,首先是对ARM,ARM64(A via: http://news.softpedia.com/news/linux-kernel-4-1-18-lts-is-the-biggest-in-the-series-with-hundreds-of-changes-500500.shtml -作者:[Marius Nestor ][a] +作者:[Marius Nestor][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 04fbcf94075c7248e27191e435440710d0f30d7d Mon Sep 17 00:00:00 2001 From: Markgolzh Date: Wed, 9 Mar 2016 13:12:32 +0800 Subject: [PATCH 0508/1469] Update 20160303 Top 5 open source command shells for Linux.md --- .../tech/20160303 Top 5 open source command shells for Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20160303 Top 5 open source command shells for Linux.md b/sources/tech/20160303 Top 5 open source command shells for Linux.md index d097928ace..b9bf5e2e87 100644 --- a/sources/tech/20160303 Top 5 open source command shells for Linux.md +++ b/sources/tech/20160303 Top 5 open source command shells for Linux.md @@ -1,4 +1,4 @@ -翻译中;by ![zky001](https://github.com/LCTT/TranslateProject/edit/master/sources/tech/20160303%20Top%205%20open%20source%20command%20shells%20for%20Linux.md) +翻译中;by ![zky001] Top 5 open source command shells for Linux =============================================== From 7c3cc7e5bcf9f6915a7a67587ea8d78be191d727 Mon Sep 17 00:00:00 2001 From: cposture Date: Wed, 9 Mar 2016 16:14:24 +0800 Subject: [PATCH 0509/1469] translated character 1 --- .../20151220 GCC-Inline-Assembly-HOWTO.md | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md b/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md index f2e09b5c7a..c22e03bfd7 100644 --- a/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md +++ b/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md @@ -1,41 +1,43 @@ 【Translating by cposture 2016-03-01】 * * * -# GCC-Inline-Assembly-HOWTO +# GCC内联汇编HOWTO + v0.1, 01 March 2003. * * * -_This HOWTO explains the use and usage of the inline assembly feature provided by GCC. There are only two prerequisites for reading this article, and that’s obviously a basic knowledge of x86 assembly language and C._ +_本HOWTO文档将讲解GCC提供的内联汇编特性的用途和用法。对于阅读这篇文章,这里只有两个前提要求,很明显,就是x86汇编语言和C语言的基本认识。_ * * * -## 1. Introduction. +## 1. 简介 -## 1.1 Copyright and License. +## 1.1 版权许可 Copyright (C)2003 Sandeep S. -This document is free; you can redistribute and/or modify this under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. +本文档自由共享;你可以重新发布它,并且/或者在遵循自由软件基金会发布的GNU通用公共许可证下修改它;或者该许可证的版本2,或者(按照你的需求)更晚的版本。 -This document is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +发布这篇文档是希望它能够帮助别人,但是没有任何保证;甚至不包括可售性和适用于任何特定目的的保证。关于更详细的信息,可以查看GNU通用许可证。 -## 1.2 Feedback and Corrections. +## 1.2 反馈校正 -Kindly forward feedback and criticism to [Sandeep.S](mailto:busybox@sancharnet.in). I will be indebted to anybody who points out errors and inaccuracies in this document; I shall rectify them as soon as I am informed. +请将反馈和批评一起提交给[Sandeep.S](mailto:busybox@sancharnet.in)。我将感谢任何一个指出本文档中错误和不准确之处的人;一被告知,我会马上改正它们。 -## 1.3 Acknowledgments. +## 1.3 致谢 -I express my sincere appreciation to GNU people for providing such a great feature. Thanks to Mr.Pramode C E for all the helps he did. Thanks to friends at the Govt Engineering College, Trichur for their moral-support and cooperation, especially to Nisha Kurur and Sakeeb S. Thanks to my dear teachers at Govt Engineering College, Trichur for their cooperation. +我对提供如此棒的特性的GNU人们表示真诚的感谢。感谢Mr.Pramode C E所做的所有帮助。感谢在Govt Engineering College和Trichur朋友们的精神支持和合作,尤其是Nisha Kurur和Sakeeb S。 感谢在Gvot Engineering College和Trichur老师们的合作。 -Additionally, thanks to Phillip, Brennan Underwood and colin@nyx.net; Many things here are shamelessly stolen from their works. +另外,感谢Phillip, Brennan Underwood and colin@nyx.net;这里的许多东西都厚颜地直接取自他们的工作成果。 * * * -## 2. Overview of the whole thing. +## 2. 概览 -We are here to learn about GCC inline assembly. What this inline stands for? +在这里,我们将学习GCC内联汇编。这内联表示的是什么呢? + +我们可以要求编译器将一个函数的代码插入到调用者代码中函数被实际调用的地方。这样的函数就是内联函数。这听起来和宏差不多?这两者确实有相似之处。 -We can instruct the compiler to insert the code of a function into the code of its callers, to the point where actually the call is to be made. Such functions are inline functions. Sounds similar to a Macro? Indeed there are similarities. What is the benefit of inline functions? From 4f6d87686af60c3a1c48ff13aad724b0eab17141 Mon Sep 17 00:00:00 2001 From: Stdio A Date: Wed, 9 Mar 2016 17:37:19 +0800 Subject: [PATCH 0510/1469] =?UTF-8?q?20160306=20=E9=80=89=E9=A2=98?= =?UTF-8?q?=E5=B9=B6=E7=BF=BB=E8=AF=915=20Favorite=20Open=20Source=20Djang?= =?UTF-8?q?o=20Packages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... 5 Favorite Open Source Django Packages.md | 166 ++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 sources/talk/yearbook2015/20160306 5 Favorite Open Source Django Packages.md diff --git a/sources/talk/yearbook2015/20160306 5 Favorite Open Source Django Packages.md b/sources/talk/yearbook2015/20160306 5 Favorite Open Source Django Packages.md new file mode 100644 index 0000000000..de57717f56 --- /dev/null +++ b/sources/talk/yearbook2015/20160306 5 Favorite Open Source Django Packages.md @@ -0,0 +1,166 @@ +StdioA Translated + +5 favorite open source Django packages +================================================================================ +![Yearbook cover 2015](https://opensource.com/sites/default/files/styles/image-full-size/public/u23316/osdc-open-source-yearbook-lead8.png?itok=0_5-hdFE) + +Image source: Opensource.com + +_Jacob Kaplan-Moss and Frank Wiles also contributed to this article._ + +Django is built around the concept of [reusable apps][1]: self-contained packages that provide re-usable features. You can build your site by composing these reusable apps, together with your own site-specific code. There's a rich and varied ecosystem of reusable apps available for your use — PyPI lists more than [8,000 Django apps][2] — but how do you know which ones are best? + +To help focus your app search, we've put together this list of our five favorites. They are: +* [Cookiecutter][3]: the best way to start a new Django site. +* [Whitenoise][4]: the best static asset server. +* [Django Rest Framework][5]: the best way to write REST APIs with Django. +* [Wagtail][6]: the best Django-based content-management system. +* [django-allauth][7]: the best way to provide "social login" (e.g., Twitter, Facebook, GitHub, etc). + +We also recommend you check out [Django Packages][8], a directory of reusable Django apps. Django Packages organizes Django apps into "grids" that allow you to compare similar packages and chose between them. You can see which features are offered by each package, as well as usage statistics. (For example: here's the [grid for REST tools][9], which might help you understand why we recommend Django REST Framework.) + +## Why you should trust us? + +We've been using Django for longer than almost anyone. Two of us (Frank and Jacob) worked at the [Lawrence Journal-World][10] (birthplace of Django) before Django was released (and in fact helped make the open source release happen). We've all spent the past eight years running a consultancy that advises companies on how best to use Django. + +So, we've seen the entire history of the Django project and community, and we've seen popular packages come and go. Between the three of us, we've probably tried at least half of these 8,000 apps personally, or we know someone who has. We have a strong understanding of what makes an app solid and reliable, and we have a good understanding of what gives these things staying power. + +## Best way to start a new Django site: [Cookiecutter][3] + +Starting off a new project or app is always a bit of a pain. You can use Django's built in `startproject` but if you're like us, you're particular in how you do things. Cookiecutter solves this by giving you a quick and easy way to define project or app templates that can be easily reused. A quick example, just `pip install cookiecutter` and then run this from the command line: + +```bash +$ cookiecutter https://github.com/marcofucci/cookiecutter-simple-django +``` + +You'll immediately start getting prompted for quick answers, such as the name of your project, repo, author name, email, and a few other bits of configuration. These are used to help fill out the project details. We picked the ever so original '_foo_' to be our repo name. So cookiecutter created a simple Django project in the subdirectory '_foo_'. + +If you poke around in the '_foo_' project a bit, you'll see the other bits of configuration you were prompted for have been templated into the files themselves along with sub-directories as necessary. This "template" is all defined at the GitHub repo URL we used as the only argument when we called `cookiecutter`. This example used a remote GitHub repo as the template; however, note that you can use local file system directories as well, which is perfect for non-reusable scenarios. + +We mention cookiecutter as a great Django package, but honestly it's useful for plain Python or even non-Python-related purposes. Being able to lay things out exactly as you like in an easily repeatable way makes cookiecutter a great tool for keeping your workflow DRY. + +## Best static asset server: [Whitenoise][4] + +For many years, serving your site's static assets—images, JavaScript, CSS—was a pain. The built-in [django.views.static.serve][11] view is, as the documentation states, "not hardened for production use and should be used only as a development aid." But serving media from a "real" web server, such as NGINX or out of a CDN, can be difficult to set up. + +Whitenoise cleanly solves this problem. It's as easy to set up as the development-only static server, and is hardened and optimized for production. Setup is simple: + +1. Make sure you're using Django's [contrib.staticfiles][12] app, and that you've correctly set `STATIC_ROOT` in your settings file. +2. Enable Whitenoise in your `wsgi.py` file: + +```python +from django.core.wsgi import get_wsgi_application +from whitenoise.django import DjangoWhiteNoise + +application = get_wsgi_application() +application = DjangoWhiteNoise(application) +``` + +That's really all it takes! For large applications, you'll likely want to use a dedicated media server and/or a CDN, but for most small- or medium-sized Django sites, Whitenoise is more than powerful enough. + +For more information on Whitenoise, [check out the documentation][13]. + +Best Tool for REST APIs: [Django REST Framework][5] + +REST APIs are quickly becoming a standard feature of modern web applications. An API is really simply talking in JSON rather than HTML, and of course you can do this with just Django. You can craft your own views that set the proper content types and return data in JSON rather than templated HTML responses. This is exactly what many people did before API frameworks such as [Django Rest Framework][14] (a.k.a., DRF) were released. + +Building a REST API with DRF is similar to working with Django's Class Based Views if you're familiar with them, except these are specifically designed and targeted around an API use case. Quite a bit of code is involved in your average API setup, so instead of a code sample to get you excited, we'll highlight some of DRF's features that make your life easier: + +* Automatic browseable API which makes development and manual testing a breeze. Click around in the DRF [demo example][15]. You can view API responses and support POST/PUT/DELETE type operations without having to do anything yourself. +* Easy integration of authentication styles, such as OAuth, Basic Auth, or API Tokens. + Simple permission system for fine-grained control of which users can use which API endpoints and/or actions. +* Built in rate limiting. +* Nearly automatic API documentation when combined with [django-rest-swagger][16]. +* Extensive ecosystem of third-party libraries. + +Although you could certainly build an API without DRF, we can't fathom a reason why you would start off down that path. Even if you don't use all of DRF's features, building up your own API views from their solid base view classes is a huge win in terms of safety, consistency of your API, and development velocity. If you aren't using DRF already, you should set aside some time to check it out. + +## Best Django-based CMS: [Wagtail][6] + +Wagtail is the current darling of the Django CMS world and with good reason. Like most CMS systems, it gives you flexibility to define different types of pages and their content via simple Django models. This takes you from zero to a basically working system in hours, not days. To give you a quick example, to define a Staff page type for people at your company can be as simple as: + +```python +from wagtail.wagtailcore.models import Page +from wagtail.wagtailcore.fields import RichTextField +from wagtail.wagtailadmin.edit_handlers import FieldPanel, MultiFieldPanel +from wagtail.wagtailimages.edit_handlers import ImageChooserPanel + +class StaffPage(Page): + name = models.CharField(max_length=100) + hire_date = models.DateField() + bio = models.RichTextField() + email = models.EmailField() + headshot = models.ForeignKey('wagtailimages.Image', null=True, blank=True) + content_panels = Page.content_panels + [ + FieldPanel('name'), + FieldPanel('hire_date'), + FieldPanel('email'), + FieldPanel('bio', classname="full"), + ImageChoosePanel('headshot'), + ] + +``` + +The real appeal of Wagtail, however, is in its easy-to-use modern admin interface and flexibility. You can control which types of pages are allowed in different areas of the site, add additional complex logic to your pages, and get standard moderation/approval workflows right out of the box. With most CMS systems, at some point you run into a wall you can work around. With Wagtail, we have yet to find a wall we couldn't easy find a door through to make it do exactly what we want in an easy and maintainable way. If you're interested, we wrote up a [deeper dive into Wagtail][17]. + +## Best Social Login Tool: [django-allauth][7] + +django-allauth is a reusable Django application that solves your registration and authentication needs. Whether you need a local or social registration system, django-allauth has you covered. + +The project supports multiple authentication schemes, such as user name or email address. Once a user has signed up, multiple strategies are supported for account verification ranging from none to email verification. Multiple social and email accounts are also supported. Pluggable signup forms are also supports which allows asking additional questions during registration. + +django-allauth supports more than 20 authentication providers, including Facebook, GitHub, Google, and Twitter. If you have an account on a social website that's not supported, then it's most supported through a third-party add-on. The project supports writing custom backends, which allows custom authentication systems to work, too. This is nice for anyone with custom authentication needs. + +django-allauth is easy to setup and has [extensive documentation][18]. The project is also well tested so you know that everything actually works. + +Do you have a favorite Django package? Let us know about it in the comments. + +## About the author + +![Photo][] + +Jeff Triplett + +Lawrence, KS + + +I moved to Lawrence, KS in 2007 to work at the Lawrence Journal-World where Django was invented. I now work at [Revolution Systems (Revsys)][19] in Lawrence, KS as a developer and a consultant. + +I am a co-founder of the [Django Events Foundation North America (DEFNA)][20], Conference Chair for [DjangoCon US][21] 2015 and 2016, and I co-organized [Django Birthday][22] to celebrate the 10 year birthday of Django in its birthplace in Lawrence. + +I am a member of a local trail running group, I love basketball, and I love dreaming about traveling in an airstream across America. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/business/15/12/5-favorite-open-source-django-packages + +作者:[Jeff Triplett][a] +译者:[StdioA](https://github.com/StdioA) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + + +[a]:https://opensource.com/users/jefftriplett +[1]:https://docs.djangoproject.com/en/1.8/intro/reusable-apps/ +[2]:https://pypi.python.org/pypi?:action=browse&c=523 +[3]:https://github.com/audreyr/cookiecutter +[4]:http://whitenoise.evans.io/en/latest/base.html +[5]:http://www.django-rest-framework.org/ +[6]:https://wagtail.io/ +[7]:http://www.intenct.nl/projects/django-allauth/ +[8]:https://www.djangopackages.com/ +[9]:https://www.djangopackages.com/grids/g/rest/ +[10]:http://www2.ljworld.com/news/2015/jul/09/happy-birthday-django/ +[11]:https://docs.djangoproject.com/en/1.8/ref/views/#django.views.static.serve +[12]:https://docs.djangoproject.com/en/1.8/ref/contrib/staticfiles/ +[13]:http://whitenoise.evans.io/en/latest/index.html +[14]:http://www.django-rest-framework.org/ +[15]:http://restframework.herokuapp.com/ +[16]:http://django-rest-swagger.readthedocs.org/en/latest/index.html +[17]:https://opensource.com/business/15/5/wagtail-cms +[18]:http://django-allauth.readthedocs.org/en/latest/ +[19]:http://www.revsys.com/ +[20]:http://defna.org/ +[21]:https://2015.djangocon.us/ +[22]:https://djangobirthday.com/ From 6f0f13a8826606a397cee5c8af7b6e2273282307 Mon Sep 17 00:00:00 2001 From: Stdio A Date: Wed, 9 Mar 2016 17:38:17 +0800 Subject: [PATCH 0511/1469] =?UTF-8?q?5=20Favorite=20Open=20Source=20Django?= =?UTF-8?q?=20Packages=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 --- ... 5 Favorite Open Source Django Packages.md | 166 ------------------ ... 5 Favorite Open Source Django Packages.md | 164 +++++++++++++++++ 2 files changed, 164 insertions(+), 166 deletions(-) delete mode 100644 sources/talk/yearbook2015/20160306 5 Favorite Open Source Django Packages.md create mode 100644 translated/talk/yearbook2015/20160306 5 Favorite Open Source Django Packages.md diff --git a/sources/talk/yearbook2015/20160306 5 Favorite Open Source Django Packages.md b/sources/talk/yearbook2015/20160306 5 Favorite Open Source Django Packages.md deleted file mode 100644 index de57717f56..0000000000 --- a/sources/talk/yearbook2015/20160306 5 Favorite Open Source Django Packages.md +++ /dev/null @@ -1,166 +0,0 @@ -StdioA Translated - -5 favorite open source Django packages -================================================================================ -![Yearbook cover 2015](https://opensource.com/sites/default/files/styles/image-full-size/public/u23316/osdc-open-source-yearbook-lead8.png?itok=0_5-hdFE) - -Image source: Opensource.com - -_Jacob Kaplan-Moss and Frank Wiles also contributed to this article._ - -Django is built around the concept of [reusable apps][1]: self-contained packages that provide re-usable features. You can build your site by composing these reusable apps, together with your own site-specific code. There's a rich and varied ecosystem of reusable apps available for your use — PyPI lists more than [8,000 Django apps][2] — but how do you know which ones are best? - -To help focus your app search, we've put together this list of our five favorites. They are: -* [Cookiecutter][3]: the best way to start a new Django site. -* [Whitenoise][4]: the best static asset server. -* [Django Rest Framework][5]: the best way to write REST APIs with Django. -* [Wagtail][6]: the best Django-based content-management system. -* [django-allauth][7]: the best way to provide "social login" (e.g., Twitter, Facebook, GitHub, etc). - -We also recommend you check out [Django Packages][8], a directory of reusable Django apps. Django Packages organizes Django apps into "grids" that allow you to compare similar packages and chose between them. You can see which features are offered by each package, as well as usage statistics. (For example: here's the [grid for REST tools][9], which might help you understand why we recommend Django REST Framework.) - -## Why you should trust us? - -We've been using Django for longer than almost anyone. Two of us (Frank and Jacob) worked at the [Lawrence Journal-World][10] (birthplace of Django) before Django was released (and in fact helped make the open source release happen). We've all spent the past eight years running a consultancy that advises companies on how best to use Django. - -So, we've seen the entire history of the Django project and community, and we've seen popular packages come and go. Between the three of us, we've probably tried at least half of these 8,000 apps personally, or we know someone who has. We have a strong understanding of what makes an app solid and reliable, and we have a good understanding of what gives these things staying power. - -## Best way to start a new Django site: [Cookiecutter][3] - -Starting off a new project or app is always a bit of a pain. You can use Django's built in `startproject` but if you're like us, you're particular in how you do things. Cookiecutter solves this by giving you a quick and easy way to define project or app templates that can be easily reused. A quick example, just `pip install cookiecutter` and then run this from the command line: - -```bash -$ cookiecutter https://github.com/marcofucci/cookiecutter-simple-django -``` - -You'll immediately start getting prompted for quick answers, such as the name of your project, repo, author name, email, and a few other bits of configuration. These are used to help fill out the project details. We picked the ever so original '_foo_' to be our repo name. So cookiecutter created a simple Django project in the subdirectory '_foo_'. - -If you poke around in the '_foo_' project a bit, you'll see the other bits of configuration you were prompted for have been templated into the files themselves along with sub-directories as necessary. This "template" is all defined at the GitHub repo URL we used as the only argument when we called `cookiecutter`. This example used a remote GitHub repo as the template; however, note that you can use local file system directories as well, which is perfect for non-reusable scenarios. - -We mention cookiecutter as a great Django package, but honestly it's useful for plain Python or even non-Python-related purposes. Being able to lay things out exactly as you like in an easily repeatable way makes cookiecutter a great tool for keeping your workflow DRY. - -## Best static asset server: [Whitenoise][4] - -For many years, serving your site's static assets—images, JavaScript, CSS—was a pain. The built-in [django.views.static.serve][11] view is, as the documentation states, "not hardened for production use and should be used only as a development aid." But serving media from a "real" web server, such as NGINX or out of a CDN, can be difficult to set up. - -Whitenoise cleanly solves this problem. It's as easy to set up as the development-only static server, and is hardened and optimized for production. Setup is simple: - -1. Make sure you're using Django's [contrib.staticfiles][12] app, and that you've correctly set `STATIC_ROOT` in your settings file. -2. Enable Whitenoise in your `wsgi.py` file: - -```python -from django.core.wsgi import get_wsgi_application -from whitenoise.django import DjangoWhiteNoise - -application = get_wsgi_application() -application = DjangoWhiteNoise(application) -``` - -That's really all it takes! For large applications, you'll likely want to use a dedicated media server and/or a CDN, but for most small- or medium-sized Django sites, Whitenoise is more than powerful enough. - -For more information on Whitenoise, [check out the documentation][13]. - -Best Tool for REST APIs: [Django REST Framework][5] - -REST APIs are quickly becoming a standard feature of modern web applications. An API is really simply talking in JSON rather than HTML, and of course you can do this with just Django. You can craft your own views that set the proper content types and return data in JSON rather than templated HTML responses. This is exactly what many people did before API frameworks such as [Django Rest Framework][14] (a.k.a., DRF) were released. - -Building a REST API with DRF is similar to working with Django's Class Based Views if you're familiar with them, except these are specifically designed and targeted around an API use case. Quite a bit of code is involved in your average API setup, so instead of a code sample to get you excited, we'll highlight some of DRF's features that make your life easier: - -* Automatic browseable API which makes development and manual testing a breeze. Click around in the DRF [demo example][15]. You can view API responses and support POST/PUT/DELETE type operations without having to do anything yourself. -* Easy integration of authentication styles, such as OAuth, Basic Auth, or API Tokens. - Simple permission system for fine-grained control of which users can use which API endpoints and/or actions. -* Built in rate limiting. -* Nearly automatic API documentation when combined with [django-rest-swagger][16]. -* Extensive ecosystem of third-party libraries. - -Although you could certainly build an API without DRF, we can't fathom a reason why you would start off down that path. Even if you don't use all of DRF's features, building up your own API views from their solid base view classes is a huge win in terms of safety, consistency of your API, and development velocity. If you aren't using DRF already, you should set aside some time to check it out. - -## Best Django-based CMS: [Wagtail][6] - -Wagtail is the current darling of the Django CMS world and with good reason. Like most CMS systems, it gives you flexibility to define different types of pages and their content via simple Django models. This takes you from zero to a basically working system in hours, not days. To give you a quick example, to define a Staff page type for people at your company can be as simple as: - -```python -from wagtail.wagtailcore.models import Page -from wagtail.wagtailcore.fields import RichTextField -from wagtail.wagtailadmin.edit_handlers import FieldPanel, MultiFieldPanel -from wagtail.wagtailimages.edit_handlers import ImageChooserPanel - -class StaffPage(Page): - name = models.CharField(max_length=100) - hire_date = models.DateField() - bio = models.RichTextField() - email = models.EmailField() - headshot = models.ForeignKey('wagtailimages.Image', null=True, blank=True) - content_panels = Page.content_panels + [ - FieldPanel('name'), - FieldPanel('hire_date'), - FieldPanel('email'), - FieldPanel('bio', classname="full"), - ImageChoosePanel('headshot'), - ] - -``` - -The real appeal of Wagtail, however, is in its easy-to-use modern admin interface and flexibility. You can control which types of pages are allowed in different areas of the site, add additional complex logic to your pages, and get standard moderation/approval workflows right out of the box. With most CMS systems, at some point you run into a wall you can work around. With Wagtail, we have yet to find a wall we couldn't easy find a door through to make it do exactly what we want in an easy and maintainable way. If you're interested, we wrote up a [deeper dive into Wagtail][17]. - -## Best Social Login Tool: [django-allauth][7] - -django-allauth is a reusable Django application that solves your registration and authentication needs. Whether you need a local or social registration system, django-allauth has you covered. - -The project supports multiple authentication schemes, such as user name or email address. Once a user has signed up, multiple strategies are supported for account verification ranging from none to email verification. Multiple social and email accounts are also supported. Pluggable signup forms are also supports which allows asking additional questions during registration. - -django-allauth supports more than 20 authentication providers, including Facebook, GitHub, Google, and Twitter. If you have an account on a social website that's not supported, then it's most supported through a third-party add-on. The project supports writing custom backends, which allows custom authentication systems to work, too. This is nice for anyone with custom authentication needs. - -django-allauth is easy to setup and has [extensive documentation][18]. The project is also well tested so you know that everything actually works. - -Do you have a favorite Django package? Let us know about it in the comments. - -## About the author - -![Photo][] - -Jeff Triplett - -Lawrence, KS - - -I moved to Lawrence, KS in 2007 to work at the Lawrence Journal-World where Django was invented. I now work at [Revolution Systems (Revsys)][19] in Lawrence, KS as a developer and a consultant. - -I am a co-founder of the [Django Events Foundation North America (DEFNA)][20], Conference Chair for [DjangoCon US][21] 2015 and 2016, and I co-organized [Django Birthday][22] to celebrate the 10 year birthday of Django in its birthplace in Lawrence. - -I am a member of a local trail running group, I love basketball, and I love dreaming about traveling in an airstream across America. - --------------------------------------------------------------------------------- - -via: https://opensource.com/business/15/12/5-favorite-open-source-django-packages - -作者:[Jeff Triplett][a] -译者:[StdioA](https://github.com/StdioA) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - - -[a]:https://opensource.com/users/jefftriplett -[1]:https://docs.djangoproject.com/en/1.8/intro/reusable-apps/ -[2]:https://pypi.python.org/pypi?:action=browse&c=523 -[3]:https://github.com/audreyr/cookiecutter -[4]:http://whitenoise.evans.io/en/latest/base.html -[5]:http://www.django-rest-framework.org/ -[6]:https://wagtail.io/ -[7]:http://www.intenct.nl/projects/django-allauth/ -[8]:https://www.djangopackages.com/ -[9]:https://www.djangopackages.com/grids/g/rest/ -[10]:http://www2.ljworld.com/news/2015/jul/09/happy-birthday-django/ -[11]:https://docs.djangoproject.com/en/1.8/ref/views/#django.views.static.serve -[12]:https://docs.djangoproject.com/en/1.8/ref/contrib/staticfiles/ -[13]:http://whitenoise.evans.io/en/latest/index.html -[14]:http://www.django-rest-framework.org/ -[15]:http://restframework.herokuapp.com/ -[16]:http://django-rest-swagger.readthedocs.org/en/latest/index.html -[17]:https://opensource.com/business/15/5/wagtail-cms -[18]:http://django-allauth.readthedocs.org/en/latest/ -[19]:http://www.revsys.com/ -[20]:http://defna.org/ -[21]:https://2015.djangocon.us/ -[22]:https://djangobirthday.com/ diff --git a/translated/talk/yearbook2015/20160306 5 Favorite Open Source Django Packages.md b/translated/talk/yearbook2015/20160306 5 Favorite Open Source Django Packages.md new file mode 100644 index 0000000000..81e999fd80 --- /dev/null +++ b/translated/talk/yearbook2015/20160306 5 Favorite Open Source Django Packages.md @@ -0,0 +1,164 @@ +5个最受喜爱的开源Django包 +================================================================================ +![Yearbook cover 2015](https://opensource.com/sites/default/files/styles/image-full-size/public/u23316/osdc-open-source-yearbook-lead8.png?itok=0_5-hdFE) + +图片来源:Opensource.com + +_Jacob Kaplan-Moss和Frank Wiles也参与了本文的写作。_ + +Django围绕“[可重用应用][1]”观点建立:自我包含了提供可重复使用特性的包。你可以将这些可重用应用组装起来,在加上适用于你的网站的特定代码,来搭建你自己的网站。Django具有一个丰富多样的、由可供你使用的可重用应用组建起来的生态系统——PyPI列出了[超过8000个 Django 应用][2]——可你该如何知道哪些是最好的呢? + +为了节省你的时间,我们总结了五个最受喜爱的 Django 应用。它们是: +- [Cookiecutter][3]: 建立 Django 网站的最佳方式。 +- [Whitenoise][4]: 最棒的静态资源服务器。 +- [Django Rest Framework][5]: 使用 Django 开发 REST API 的最佳方式。 +- [Wagtail][6]: 基于 Django 的最佳内容管理系统。 +- [django-allauth][7]: 提供社交账户登录的最佳应用(如 Twitter, Facebook, GitHub 等)。 + +我们同样推荐你查看 [Django Packages][8],一个可重用 Django 应用的目录。Django Packages 将 Django 应用组织成“表格”,你可以在功能相似的不同应用之间进行比较并做出选择。你可以查看每个包中提供的特性,和使用统计情况。(比如:这是[ REST 工具的表格][9],也许可以帮助你理解我们为何推荐 Django REST Framework. + +## 为什么你应该相信我们? + +我们使用 Django 的时间比几乎其他人都长。在 Django 发布之前,我们当中的两个人(Frank 和 Jacob)在 [Lawrence Journal-World][10] (Django 的发源地)工作(事实上他们两人推动了 Django 开源发布的进程)。我们在过去的八年当中运行着一个咨询公司,来建议公司使用 Django 去将事情做到最好。 + +所以,我们见证了Django项目和社群的完整历史,我们见证了流行软件包的兴起和没落。在我们三个中,我们可能私下试用了8000个应用中的一半以上,或者我们知道谁试用过这些。我们对如何使应用变得坚实可靠有着深刻的理解,并且我们对给予这些应用持久力量的来源也有不错的理解。 + +## 建立Django网站的最佳方式:[Cookiecutter][3] + +建立一个新项目或应用总是有些痛苦。你可以用Django内建的 `startproject`。不过,如果你像我们一样,你可能会对你的办事方式很挑剔。Cookiecutter 为你提供了一个快捷简单的方式来构建易于使用的项目或应用模板,从而解决了这个问题。一个简单的例子:键入 `pip install cookiecutter`,然后在命令行中运行以下命令: + +```bash +$ cookiecutter https://github.com/marcofucci/cookiecutter-simple-django +``` + +接下来你需要回答几个简单的问题,比如你的项目名称、目录、作者名字、E-Mail和其他几个关于配置的小问题。这些能够帮你补充项目相关的细节。我们使用最最原始的 "_foo_" 作为我们的目录名称。所以 cokkiecutter 在子目录 "_foo_" 下建立了一个简单的 Django 项目。 + +如果你在"_foo_"项目中闲逛,你会看见你刚刚选择的其它设置已通过模板,连同子目录一同嵌入到文件当中。这个“模板”在我们刚刚在执行 `cookiecutter` 命令时输入的 Github 仓库 URL 中定义。这个样例工程使用了一个 Github 远程仓库作为模板;不过你也可以使用本地的模板,这在建立非重用项目时非常有用。 + +我们认为 cookiecutter 是一个极棒的 Django 包,但是,事实上其实它在面对纯 Python 甚至非 Python 相关需求时也极为有用。你能够将所有文件依你所愿精确摆放在任何位置上,使得 cookiecutter 成为了一个简化工作流程的极佳工具。 + +## 最棒的静态资源服务器:[Whitenoise][4] + +多年来,托管网站的静态资源——图片、Javascript、CSS——都是一件很痛苦的事情。Django 内建的 [django.views.static.serve][11] 视图,就像Django文章所述的那样,“在生产环境中不可靠,所以只应为开发环境的提供辅助功能。”但使用一个“真正的” Web 服务器,如 NGINX 或者借助 CDN 来托管媒体资源,配置起来会相当困难。 + +Whitenoice 很简洁地解决了这个问题。它可以像在开发环境那样轻易地在生产环境中设置静态服务器,并且针对生产环境进行了加固和优化。它的设置方法极为简单: + +1. 确保你在使用 Django 的 [contrib.staticfiles][12] 应用,并确认你在配置文件中正确设置了 `STATIC_ROOT` 变量。 + +2. 在 `wsgi.py` 文件中启用 Whitenoise: + + ```python + from django.core.wsgi import get_wsgi_application + from whitenoise.django import DjangoWhiteNoise + + application = get_wsgi_application() + application = DjangoWhiteNoise(application) + ``` + +配置它真的就这么简单!对于大型应用,你可能想要使用一个专用的媒体服务器和/或一个 CDN,但对于大多数小型或中型 Django 网站,Whitenoise 已经足够强大。 + +如需查看更多关于 Whitenoise 的信息,[请查看文档][13]。 + +## 开发REST API的最佳工具:[Django REST Framework][5] + +REST API 正在迅速成为现代 Web 应用的标准功能。与一个 API 进行简短的会话,你只需使用 JSON 而不是 HTML,当然你可以只用 Django 做到这些。你可以制作自己的视图,设置合适的 `Content-Type`, 然后返回 JSON 而不是渲染后的 HTML 响应。这是在像 [Django Rest Framework][14](下称DRF)这样的API框架发布之前,大多数人所做的。 + +如果你对 Django 的视图类很熟悉,你会觉得使用DRF构建REST API与使用它们很相似,不过 DRF 只针对特定 API 使用场景而设计。在一般 API 设计中,你会用到它的不少代码,所以我们强调了一些 DRF 的特性来使你更快地接受它,而不是去看一份让你兴奋的示例代码: + +* 可自动预览的 API 可以使你的开发和人工测试轻而易举。你可以查看 DRF 的[示例代码][15]。你可以查看 API 响应,并且它支持 POST/PUT/DELETE 类型的操作,不需要你做任何事。 + + +* 认证方式易于迁移,如OAuth, Basic Auth, 或API Tokens. +* 内建请求速度限制。 +* 当与 [django-rest-swagger][16] 结合时,API文档几乎可以自动生成。 +* 第三方库拥有广泛的生态。 + +当然你可以不依赖 DRF 来构建 API,但我们无法推测你不开始使用 DRF 的原因。就算你不使用 DRF 的全部特性,使用一个成熟的视图库来构建你自己的 API 也会使你的 API 更加一致、完全,更能提高你的开发速度。如果你还没有开始使用 DRF, 你应该找点时间去体验一下。 + +## 以 Django 为基础的最佳 CMS:[Wagtail][6] + +Wagtail是当下Django CMS(内容管理系统)世界中最受人青睐的应用,并且它的热门有足够的理由。就想大多数的 CMS 一样,它具有极佳的灵活性,可以通过简单的 Django 模型来定义不同类型的页面及其内容。使用它,你可以从零开始,在几个小时而不是几天之内来和建造一个基本可以运行的内容管理系统。举一个小例子,为你公司的员工定义一个页面类型可以像下面一样简单: + +```python +from wagtail.wagtailcore.models import Page +from wagtail.wagtailcore.fields import RichTextField +from wagtail.wagtailadmin.edit_handlers import FieldPanel, MultiFieldPanel +from wagtail.wagtailimages.edit_handlers import ImageChooserPanel + +class StaffPage(Page): + name = models.CharField(max_length=100) + hire_date = models.DateField() + bio = models.RichTextField() + email = models.EmailField() + headshot = models.ForeignKey('wagtailimages.Image', null=True, blank=True) + content_panels = Page.content_panels + [ + FieldPanel('name'), + FieldPanel('hire_date'), + FieldPanel('email'), + FieldPanel('bio',classname="full"), + ImageChoosePanel('headshot'), + ] +``` + +然而,Wagtail 真正出彩的地方在于它的灵活性及其易于使用的现代化管理页面。你可以控制不同类型的页面在哪网站的哪些区域可以访问,为页面添加复杂的附加逻辑,还可以极为方便地取得标准的适应/审批工作流。在大多数 CMS 系统中,你会在开发时在某些点上遇到困难。而使用 Wagtail 时,我们经过不懈努力找到了一个突破口,使得让我们轻易地开发出一套简洁稳定的系统,使得程序完全依照我们的想法运行。如果你对此感兴趣,我们写了一篇[深入理解 Wagtail][17]. + +## 提供社交账户登录的最佳工具:[django-allauth][7] + +django-allauth 是一个能够解决你的注册和认证需求的、可重用的Django应用。无论你需要构建本地注册系统还是社交账户注册系统,django-allauth 都能够帮你做到。 + +这个应用支持多种认证体系,比如用户名或电子邮件。一旦用户注册成功,它可以提供从零到电子邮件认证的多种账户验证的策略。同时,它也支持多种社交账户和电子邮件账户关联。它还支持可插拔的注册表单,可让用户在注册时回答一些附加问题。 + +django-allauth 支持多于 20 种认证提供者,包括 Facebook, Github, Google 和 Twitter。如果你发现了一个它不支持的社交网站,那很有可能有一款第三方插件提供该网站的接入支持。这个项目还支持自定义后台开发,可以支持自定义的认证方式。 + +django-allauth 易于配置,且有[完善的文档][18]。该项目通过了很多测试,所以你可以相信它的所有部件都会正常运作。 + +你有最喜爱的 Django 包吗?请在评论中告诉我们。 + +## 关于作者 + +![Photo](https://opensource.com/sites/default/files/styles/profile_pictures/public/pictures/main-one-i-use-everywhere.png?itok=66GC-D1q) + +Jeff Triplett + +劳伦斯,堪萨斯州 + + +我在 2007 年搬到了堪萨斯州的劳伦斯,在 Django 的发源地—— Lawrence Journal-World 工作。我现在在劳伦斯市的 [Revolution Systems (Revsys)][19] 工作,做一位开发者兼顾问。 + +我是[北美 Django 运动基金会(DEFNA)][20]的联合创始人,2015 和 2016 年 [DjangoCon US][21] 的会议主席,而且我在 Django 的发源地劳伦斯参与组织了 [Django Birthday][22] 来庆祝 Django 的 10 岁生日。 + +我是当地越野跑小组的成员,我喜欢篮球,我还喜欢梦见自己随着一道气流游遍美国。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/business/15/12/5-favorite-open-source-django-packages + +作者:[Jeff Triplett][a] +译者:[StdioA](https://github.com/StdioA) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/jefftriplett +[1]:https://docs.djangoproject.com/en/1.8/intro/reusable-apps/ +[2]:https://pypi.python.org/pypi?:action=browse&c=523 +[3]:https://github.com/audreyr/cookiecutter +[4]:http://whitenoise.evans.io/en/latest/base.html +[5]:http://www.django-rest-framework.org/ +[6]:https://wagtail.io/ +[7]:http://www.intenct.nl/projects/django-allauth/ +[8]:https://www.djangopackages.com/ +[9]:https://www.djangopackages.com/grids/g/rest/ +[10]:http://www2.ljworld.com/news/2015/jul/09/happy-birthday-django/ +[11]:https://docs.djangoproject.com/en/1.8/ref/views/#django.views.static.serve +[12]:https://docs.djangoproject.com/en/1.8/ref/contrib/staticfiles/ +[13]:http://whitenoise.evans.io/en/latest/index.html +[14]:http://www.django-rest-framework.org/ +[15]:http://restframework.herokuapp.com/ +[16]:http://django-rest-swagger.readthedocs.org/en/latest/index.html +[17]:https://opensource.com/business/15/5/wagtail-cms +[18]:http://django-allauth.readthedocs.org/en/latest/ +[19]:http://www.revsys.com/ +[20]:http://defna.org/ +[21]:https://2015.djangocon.us/ +[22]:https://djangobirthday.com/ From 6fb68f93ec48052d7f75c43e48a401b2619a6aef Mon Sep 17 00:00:00 2001 From: cposture Date: Wed, 9 Mar 2016 19:13:58 +0800 Subject: [PATCH 0512/1469] translated character 2 --- .../20151220 GCC-Inline-Assembly-HOWTO.md | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md b/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md index c22e03bfd7..1324bfdc33 100644 --- a/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md +++ b/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md @@ -1,12 +1,12 @@ 【Translating by cposture 2016-03-01】 * * * -# GCC内联汇编HOWTO +# GCC 内联汇编 HOWTO v0.1, 01 March 2003. * * * -_本HOWTO文档将讲解GCC提供的内联汇编特性的用途和用法。对于阅读这篇文章,这里只有两个前提要求,很明显,就是x86汇编语言和C语言的基本认识。_ +_本 HOWTO 文档将讲解 GCC 提供的内联汇编特性的用途和用法。对于阅读这篇文章,这里只有两个前提要求,很明显,就是 x86 汇编语言和 C 语言的基本认识。_ * * * @@ -16,36 +16,35 @@ _本HOWTO文档将讲解GCC提供的内联汇编特性的用途和用法。对 Copyright (C)2003 Sandeep S. -本文档自由共享;你可以重新发布它,并且/或者在遵循自由软件基金会发布的GNU通用公共许可证下修改它;或者该许可证的版本2,或者(按照你的需求)更晚的版本。 +本文档自由共享;你可以重新发布它,并且/或者在遵循自由软件基金会发布的 GNU 通用公共许可证下修改它;或者该许可证的版本 2 ,或者(按照你的需求)更晚的版本。 -发布这篇文档是希望它能够帮助别人,但是没有任何保证;甚至不包括可售性和适用于任何特定目的的保证。关于更详细的信息,可以查看GNU通用许可证。 +发布这篇文档是希望它能够帮助别人,但是没有任何保证;甚至不包括可售性和适用于任何特定目的的保证。关于更详细的信息,可以查看 GNU 通用许可证。 ## 1.2 反馈校正 -请将反馈和批评一起提交给[Sandeep.S](mailto:busybox@sancharnet.in)。我将感谢任何一个指出本文档中错误和不准确之处的人;一被告知,我会马上改正它们。 +请将反馈和批评一起提交给 [Sandeep.S](mailto:busybox@sancharnet.in) 。我将感谢任何一个指出本文档中错误和不准确之处的人;一被告知,我会马上改正它们。 ## 1.3 致谢 -我对提供如此棒的特性的GNU人们表示真诚的感谢。感谢Mr.Pramode C E所做的所有帮助。感谢在Govt Engineering College和Trichur朋友们的精神支持和合作,尤其是Nisha Kurur和Sakeeb S。 感谢在Gvot Engineering College和Trichur老师们的合作。 +我对提供如此棒的特性的 GNU 人们表示真诚的感谢。感谢 Mr.Pramode C E 所做的所有帮助。感谢在 Govt Engineering College 和 Trichur 的朋友们的精神支持和合作,尤其是 Nisha Kurur 和 Sakeeb S 。 感谢在 Gvot Engineering College 和 Trichur 的老师们的合作。 -另外,感谢Phillip, Brennan Underwood and colin@nyx.net;这里的许多东西都厚颜地直接取自他们的工作成果。 +另外,感谢 Phillip , Brennan Underwood 和 colin@nyx.net ;这里的许多东西都厚颜地直接取自他们的工作成果。 * * * ## 2. 概览 -在这里,我们将学习GCC内联汇编。这内联表示的是什么呢? +在这里,我们将学习 GCC 内联汇编。这内联表示的是什么呢? 我们可以要求编译器将一个函数的代码插入到调用者代码中函数被实际调用的地方。这样的函数就是内联函数。这听起来和宏差不多?这两者确实有相似之处。 +内联函数的优点是什么呢? -What is the benefit of inline functions? +这种内联方法可以减少函数调用开销。同时如果所有实参的值为常量,它们的已知值可以在编译期允许简化,因此并非所有的内联函数代码都需要被包含。代码大小的影响是不可预测的,这取决于特定的情况。为了声明一个内联函数,我们必须在函数声明中使用 `inline` 关键字。 -This method of inlining reduces the function-call overhead. And if any of the actual argument values are constant, their known values may permit simplifications at compile time so that not all of the inline function’s code needs to be included. The effect on code size is less predictable, it depends on the particular case. To declare an inline function, we’ve to use the keyword `inline` in its declaration. +现在我们正处于一个猜测内联汇编到底是什么的点上。它只不过是一些写为内联函数的汇编程序。在系统编程上,它们方便、快速并且极其有用。我们主要集中学习(GCC)内联汇编函数的基本格式和用法。为了声明内联汇编函数,我们使用 `asm` 关键词。 -Now we are in a position to guess what is inline assembly. Its just some assembly routines written as inline functions. They are handy, speedy and very much useful in system programming. Our main focus is to study the basic format and usage of (GCC) inline assembly functions. To declare inline assembly functions, we use the keyword `asm`. - -Inline assembly is important primarily because of its ability to operate and make its output visible on C variables. Because of this capability, "asm" works as an interface between the assembly instructions and the "C" program that contains it. +内联汇编之所以重要,主要是因为它能在 C 变量上操作和使其输出可见的能力。正是因为此能力, "asm" 起到了汇编指令和 包含它的"C"程序之间的接口作用。 * * * From c9dfda04bed704d1506300763541d5c459cfde18 Mon Sep 17 00:00:00 2001 From: cposture Date: Wed, 9 Mar 2016 20:22:34 +0800 Subject: [PATCH 0513/1469] translated character 3 --- .../20151220 GCC-Inline-Assembly-HOWTO.md | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md b/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md index 1324bfdc33..24e749e829 100644 --- a/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md +++ b/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md @@ -44,47 +44,47 @@ Copyright (C)2003 Sandeep S. 现在我们正处于一个猜测内联汇编到底是什么的点上。它只不过是一些写为内联函数的汇编程序。在系统编程上,它们方便、快速并且极其有用。我们主要集中学习(GCC)内联汇编函数的基本格式和用法。为了声明内联汇编函数,我们使用 `asm` 关键词。 -内联汇编之所以重要,主要是因为它能在 C 变量上操作和使其输出可见的能力。正是因为此能力, "asm" 起到了汇编指令和 包含它的"C"程序之间的接口作用。 +内联汇编之所以重要,主要是因为它可以操作并且使其输出通过 C 变量显示出来。正是因为此能力, "asm" 可以用作汇编指令和包含它的 C 程序之间的接口。 * * * -## 3. GCC Assembler Syntax. +## 3. GCC 汇编语法 -GCC, the GNU C Compiler for Linux, uses **AT&T**/**UNIX** assembly syntax. Here we’ll be using AT&T syntax for assembly coding. Don’t worry if you are not familiar with AT&T syntax, I will teach you. This is quite different from Intel syntax. I shall give the major differences. +GCC , Linux上的 GNU C 编译器,使用 **AT&T** / **UNIX** 汇编语法。在这里,我们将使用 AT&T 语法 进行汇编编码。如果你对 AT&T 语法不熟悉的话,请不要紧张,我会教你的。AT&T 语法和 Intel 语法的差别很大。我会给出主要的区别。 -1. Source-Destination Ordering. +1. 源操作数和目的操作数顺序 - The direction of the operands in AT&T syntax is opposite to that of Intel. In Intel syntax the first operand is the destination, and the second operand is the source whereas in AT&T syntax the first operand is the source and the second operand is the destination. ie, + AT&T 语法的操作数方向和 Intel 语法的刚好相反。在Intel 语法中,第一操作数为目的操作数,第二操作数为源操作数,然而在 AT&T 语法中,第一操作数为源操作数,第二操作数为目的操作数。也就是说, - "Op-code dst src" in Intel syntax changes to + Intel 语法中的 "Op-code dst src" 变为 + + AT&T 语法中的 "Op-code src dst"。 - "Op-code src dst" in AT&T syntax. +2. 寄存器命名 -2. Register Naming. + 寄存器名称有 % 前缀,即如果必须使用 eax,它应该用作 %eax。 - Register names are prefixed by % ie, if eax is to be used, write %eax. +3. 立即数 -3. Immediate Operand. + AT&T 立即数以 ’$’ 为前缀。静态 "C" 变量 也使用 ’$’ 前缀。在 Intel 语法中,十六进制常量以 ’h’ 为后缀,然而AT&T不使用这种语法,这里我们给常量添加前缀 ’0x’。所以,对于十六进制,我们首先看到一个 ’$’,然后是 ’0x’,最后才是常量。 - AT&T immediate operands are preceded by ’$’. For static "C" variables also prefix a ’$’. In Intel syntax, for hexadecimal constants an ’h’ is suffixed, instead of that, here we prefix ’0x’ to the constant. So, for hexadecimals, we first see a ’$’, then ’0x’ and finally the constants. +4. 操作数大小 -4. Operand Size. + 在 AT&T 语法中,存储器操作数的大小取决于操作码名字的最后一个字符。操作码后缀 ’b’ 、’w’、’l’分别指明了字节(byte)(8位)、字(word)(16位)、长型(long)(32位)存储器引用。Intel 语法通过给存储器操作数添加’byte ptr’、 ’word ptr’ 和 ’dword ptr’前缀来实现这一功能。 - In AT&T syntax the size of memory operands is determined from the last character of the op-code name. Op-code suffixes of ’b’, ’w’, and ’l’ specify byte(8-bit), word(16-bit), and long(32-bit) memory references. Intel syntax accomplishes this by prefixing memory operands (not the op-codes) with ’byte ptr’, ’word ptr’, and ’dword ptr’. + 因此,Intel的 "mov al, byte ptr foo" 在 AT&T 语法中为 "movb foo, %al"。 - Thus, Intel "mov al, byte ptr foo" is "movb foo, %al" in AT&T syntax. +5. 存储器操作数 + + 在 Intel 语法中,基址寄存器包含在 ’[’ 和 ’]’ 中,然而在 AT&T 中,它们变为 ’(’ 和 ’)’。另外,在 Intel 语法中, 间接内存引用为 -5. Memory Operands. + section:[base + index*scale + disp], 在 AT&T中变为 - In Intel syntax the base register is enclosed in ’[’ and ’]’ where as in AT&T they change to ’(’ and ’)’. Additionally, in Intel syntax an indirect memory reference is like + section:disp(base, index, scale)。 - section:[base + index*scale + disp], which changes to + 需要牢记的一点是,当一个常量用于 disp 或 scale,不能添加’$’前缀。 - section:disp(base, index, scale) in AT&T. - - One point to bear in mind is that, when a constant is used for disp/scale, ’$’ shouldn’t be prefixed. - -Now we saw some of the major differences between Intel syntax and AT&T syntax. I’ve wrote only a few of them. For a complete information, refer to GNU Assembler documentations. Now we’ll look at some examples for better understanding. +现在我们看到了 Intel 语法和 AT&T 语法之间的一些主要差别。我仅仅写了它们差别的一部分而已。关于更完整的信息,请参考 GNU 汇编文档。现在为了更好地理解,我们可以看一些示例。 > ` > From 3c995d45a886f460070ca6101505567a57781a7d Mon Sep 17 00:00:00 2001 From: alim0x Date: Wed, 9 Mar 2016 20:24:12 +0800 Subject: [PATCH 0514/1469] [translating]23 - The history of Android --- .../The history of Android/23 - The history of Android.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/talk/The history of Android/23 - The history of Android.md b/sources/talk/The history of Android/23 - The history of Android.md index e67dff87e6..f140949d7b 100644 --- a/sources/talk/The history of Android/23 - The history of Android.md +++ b/sources/talk/The history of Android/23 - The history of Android.md @@ -1,3 +1,5 @@ +alim0x translating + The history of Android ================================================================================ ![Another Play Store redesign! This one is very close to the current design and uses cards that make layout changes a piece of cake.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/get-em-Kirill.jpg) @@ -56,4 +58,4 @@ via: http://arstechnica.com/gadgets/2014/06/building-android-a-40000-word-histor [2]:http://arstechnica.com/information-technology/2013/05/hands-on-with-hangouts-googles-new-text-and-video-chat-architecture/ [3]:https://developer.android.com/design/patterns/navigation-drawer.html [a]:http://arstechnica.com/author/ronamadeo -[t]:https://twitter.com/RonAmadeo \ No newline at end of file +[t]:https://twitter.com/RonAmadeo From 063ba12e7efb22f91f28f16f7ca7fa36f1377c19 Mon Sep 17 00:00:00 2001 From: cposture Date: Thu, 10 Mar 2016 02:53:17 +0800 Subject: [PATCH 0515/1469] translated character 4 --- .../20151220 GCC-Inline-Assembly-HOWTO.md | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md b/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md index 24e749e829..39ac8a180f 100644 --- a/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md +++ b/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md @@ -108,29 +108,29 @@ GCC , Linux上的 GNU C 编译器,使用 **AT&T** / **UNIX** 汇编语法。 * * * -## 4. Basic Inline. +## 4. 基本内联 -The format of basic inline assembly is very much straight forward. Its basic form is +基本内联汇编的格式非常直接了当。它的基本格式为 -`asm("assembly code");` +`asm("汇编代码");` -Example. +示例 > ` > > * * * > ->
asm("movl %ecx %eax"); /* moves the contents of ecx to eax */
-> __asm__("movb %bh (%eax)"); /*moves the byte from bh to the memory pointed by eax */
+> 
asm("movl %ecx %eax"); /* 将 ecx 寄存器的内容移至 eax  */
+> __asm__("movb %bh (%eax)"); /* 将 bh 的一个字节数据 移至 eax 寄存器指向的内存 */
 > 
> > * * * > > ` -You might have noticed that here I’ve used `asm` and `__asm__`. Both are valid. We can use `__asm__` if the keyword `asm` conflicts with something in our program. If we have more than one instructions, we write one per line in double quotes, and also suffix a ’\n’ and ’\t’ to the instruction. This is because gcc sends each instruction as a string to **as**(GAS) and by using the newline/tab we send correctly formatted lines to the assembler. +你可能注意到了这里我使用了 `asm ` 和 `__asm__`。这两者都是有效的。如果关键词 `asm` 和我们程序的一些标识符冲突了,我们可以使用 `__asm__`。如果我们的指令多余一条,我们可以写成一行,并用括号括起,也可以为每条指令添加 ’\n’ 和 ’\t’ 后缀。这是因为gcc将每一条当作字符串发送给 **as**(GAS)( GAS 即 GNU 汇编器 ——译者注),并且通过使用换行符/制表符发送正确地格式化行给汇编器。 -Example. +示例 > ` > @@ -146,22 +146,22 @@ Example. > > ` -If in our code we touch (ie, change the contents) some registers and return from asm without fixing those changes, something bad is going to happen. This is because GCC have no idea about the changes in the register contents and this leads us to trouble, especially when compiler makes some optimizations. It will suppose that some register contains the value of some variable that we might have changed without informing GCC, and it continues like nothing happened. What we can do is either use those instructions having no side effects or fix things when we quit or wait for something to crash. This is where we want some extended functionality. Extended asm provides us with that functionality. +如果在代码中,我们涉及到一些寄存器(即改变其内容),但在没有固定这些变化的情况下从汇编中返回,这将会导致一些不好的事情。这是因为 GCC 并不知道寄存器内容的变化,这会导致问题,特别是当编译器做了某些优化。在没有告知 GCC 的情况下,它将会假设一些寄存器存储了我们可能已经改变的变量的值,它会像什么事都没发生一样继续运行(什么事都没发生一样是指GCC不会假设寄存器装入的值是有效的,当退出改变了寄存器值的内联汇编后,寄存器的值不会保存到相应的变量或内存空间 ——译者注)。我们所可以做的是使用这些没有副作用的指令,或者当我们退出时固定这些寄存器,或者等待程序崩溃。这是为什么我们需要一些扩展功能。扩展汇编正好给我们提供了那样的功能。 * * * -## 5. Extended Asm. +## 5. 扩展汇编 -In basic inline assembly, we had only instructions. In extended assembly, we can also specify the operands. It allows us to specify the input registers, output registers and a list of clobbered registers. It is not mandatory to specify the registers to use, we can leave that head ache to GCC and that probably fit into GCC’s optimization scheme better. Anyway the basic format is: +在基本内联汇编中,我们只有指令。然而在扩展汇编中,我们可以同时指定操作数。它允许我们指定输入寄存器、输出寄存器以及修饰寄存器列表。GCC 不强制用户必须指定使用的寄存器。我们可以把头疼的事留给 GCC ,这可能可以更好地适应 GCC 的优化。不管怎樣,基本格式为: > ` > > * * * > ->
       asm ( assembler template 
->            : output operands                  /* optional */
->            : input operands                   /* optional */
->            : list of clobbered registers      /* optional */
+> 
       asm ( 汇编程序模板 
+>            : 输出操作数					/* 可选的 */
+>            : 输入操作数                   /* 可选的 */
+>            : 修饰寄存器列表			    /* 可选的 */
 >            );
 > 
> @@ -169,11 +169,11 @@ In basic inline assembly, we had only instructions. In extended assembly, we can > > ` -The assembler template consists of assembly instructions. Each operand is described by an operand-constraint string followed by the C expression in parentheses. A colon separates the assembler template from the first output operand and another separates the last output operand from the first input, if any. Commas separate the operands within each group. The total number of operands is limited to ten or to the maximum number of operands in any instruction pattern in the machine description, whichever is greater. +汇编程序模板由汇编指令组成.每一个操作数由一个操作数约束字符串所描述,其后紧接一个括弧括起的 C 表达式。冒号用于将汇编程序模板和第一个输出操作数分开,另一个(冒号)用于将最后一个输出操作数和第一个输入操作数分开,如果存在的话。逗号用于分离每一个组内的操作数。总操作数的数目限制在10个,或者机器描述中的任何指令格式中的最大操作数数目,以较大者为准。 -If there are no output operands but there are input operands, you must place two consecutive colons surrounding the place where the output operands would go. +如果没有输出操作数但存在输入操作数,你必须将两个连续的冒号放置于输出操作数原本会放置的地方周围。 -Example: +示例: > ` > @@ -182,7 +182,7 @@ Example: >
        asm ("cld\n\t"
 >              "rep\n\t"
 >              "stosl"
->              : /* no output registers */
+>              : /* 无输出寄存器 */
 >              : "c" (count), "a" (fill_value), "D" (dest)
 >              : "%ecx", "%edi" 
 >              );
@@ -192,7 +192,7 @@ Example:
 > 
 > `
 
-Now, what does this code do? The above inline fills the `fill_value` `count` times to the location pointed to by the register `edi`. It also says to gcc that, the contents of registers `eax` and `edi` are no longer valid. Let us see one more example to make things more clearer.
+现在,这段代码是干什么的?以上的内联汇编是将 `fill_value` 值 连续 `count` 次 拷贝到 寄存器 `edi` 所指位置(每执行stosl一次,寄存器 edi 的值会递增或递减,这取决于是否设置了 direction 标志,因此以上代码实则初始化一个内存块 ——译者注)。 它也告诉 gcc 寄存器 `ecx` 和 `edi` 一直无效(原文为 eax ,但代码修饰寄存器列表中为 ecx,因此这可能为作者的纰漏 ——译者注)。为了使扩展汇编更加清晰,让我们再看一个示例。
 
 > `
 > 
@@ -202,9 +202,9 @@ Now, what does this code do? The above inline fills the `fill_value` `count` 
 >         int a=10, b;
 >         asm ("movl %1, %%eax; 
 >               movl %%eax, %0;"
->              :"=r"(b)        /* output */
->              :"r"(a)         /* input */
->              :"%eax"         /* clobbered register */
+>              :"=r"(b)        /* 输出 */
+>              :"r"(a)         /* 输入 */
+>              :"%eax"         /* 修饰寄存器 */
 >              );       
 > 
> @@ -212,6 +212,7 @@ Now, what does this code do? The above inline fills the `fill_value` `count`  > > ` + Here what we did is we made the value of ’b’ equal to that of ’a’ using assembly instructions. Some points of interest are: * "b" is the output operand, referred to by %0 and "a" is the input operand, referred to by %1. @@ -564,7 +565,6 @@ Now we have covered the basic theory about GCC inline assembly, now we shall con > > * * * > - >
#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
     > type name(type1 arg1,type2 arg2,type3 arg3) \
     > { \
     > long __res; \

From e896356f50417aeb520c5b159047301722d7aaa6 Mon Sep 17 00:00:00 2001
From: Name1e5s <836401406@qq.com>
Date: Fri, 11 Mar 2016 14:15:56 +0800
Subject: [PATCH 0516/1469] Name1e5s translating

---
 ... Startup Process and Services SysVinit Systemd and Upstart.md | 1 +
 1 file changed, 1 insertion(+)

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 2a822e8a45..24d431696d 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,4 @@
+Name1e5s translating......
 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.

From 3e2b2bd1bd5f81d27c26b1bfbcc0be4c5063f3a0 Mon Sep 17 00:00:00 2001
From: cposture 
Date: Sat, 12 Mar 2016 02:26:46 +0800
Subject: [PATCH 0517/1469] translated 6th character

---
 .../20151220 GCC-Inline-Assembly-HOWTO.md     | 141 +++++++++---------
 1 file changed, 71 insertions(+), 70 deletions(-)

diff --git a/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md b/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md
index 39ac8a180f..b60ccad1f3 100644
--- a/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md	
+++ b/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md	
@@ -212,37 +212,36 @@ GCC , Linux上的 GNU C 编译器,使用 **AT&T** / **UNIX** 汇编语法。
 > 
 > `
 
+这里我们所做的是使用汇编指令使 ’b’ 变量的值等于 ’a’ 变量的值。一些有意思的地方是:
 
-Here what we did is we made the value of ’b’ equal to that of ’a’ using assembly instructions. Some points of interest are:
+*	"b" 为输出操作数,用 %0 引用,并且 "a" 为输入操作数,用 %1 引用。
+*	"r" 为操作数约束。之后我们会更详细地了解约束(字符串)。目前,"r" 告诉 GCC 可以使用任一寄存器存储操作数。输出操作数约束应该有一个约束修饰符 "=" 。这修饰符表明它是一个只读的输出操作数。
+*	寄存器名字以两个%为前缀。这有利于 GCC 区分操作数和寄存器。操作数以一个 % 为前缀。
+*	第三个冒号之后的修饰寄存器 %eax 告诉 GCC %eax的值将会在 "asm" 内部被修改,所以 GCC 将不会使用此寄存器存储任何其他值。
 
-*   "b" is the output operand, referred to by %0 and "a" is the input operand, referred to by %1.
-*   "r" is a constraint on the operands. We’ll see constraints in detail later. For the time being, "r" says to GCC to use any register for storing the operands. output operand constraint should have a constraint modifier "=". And this modifier says that it is the output operand and is write-only.
-*   There are two %’s prefixed to the register name. This helps GCC to distinguish between the operands and registers. operands have a single % as prefix.
-*   The clobbered register %eax after the third colon tells GCC that the value of %eax is to be modified inside "asm", so GCC won’t use this register to store any other value.
+当 "asm" 执行完毕, "b" 变量会映射到更新的值,因为它被指定为输出操作数。换句话说, "asm" 内 "b" 变量的修改 应该会被映射到 "asm" 外部。
 
-When the execution of "asm" is complete, "b" will reflect the updated value, as it is specified as an output operand. In other words, the change made to "b" inside "asm" is supposed to be reflected outside the "asm".
+现在,我们可以更详细地看看每一个域。
 
-Now we may look each field in detail.
+## 5.1 汇编程序模板
 
-## 5.1 Assembler Template.
+汇编程序模板包含了被插入到 C 程序的汇编指令集。其格式为:每条指令用双引号圈起,或者整个指令组用双引号圈起。同时每条指令应以分界符结尾。有效的分界符有换行符(\n)和逗号(;)。’\n’ 可以紧随一个制表符(\t)。我们应该都明白使用换行符或制表符的原因了吧?和 C 表达式对应的操作数使用 %0、%1 ... 等等表示。
 
-The assembler template contains the set of assembly instructions that gets inserted inside the C program. The format is like: either each instruction should be enclosed within double quotes, or the entire group of instructions should be within double quotes. Each instruction should also end with a delimiter. The valid delimiters are newline(\n) and semicolon(;). ’\n’ may be followed by a tab(\t). We know the reason of newline/tab, right?. Operands corresponding to the C expressions are represented by %0, %1 ... etc.
+## 5.2 操作数
 
-## 5.2 Operands.
+C 表达式用作 "asm" 内的汇编指令操作数。作为第一双引号内的操作数约束,写下每一操作数。对于输出操作数,在引号内还有一个约束修饰符,其后紧随一个用于表示操作数的 C 表达式。即,
 
-C expressions serve as operands for the assembly instructions inside "asm". Each operand is written as first an operand constraint in double quotes. For output operands, there’ll be a constraint modifier also within the quotes and then follows the C expression which stands for the operand. ie,
+"约束字符串"(C 表达式),它是一个通用格式。对于输出操作数,还有一个额外的修饰符。约束字符串主要用于决定操作数的寻找方式,同时也用于指定使用的寄存器。
 
-"constraint" (C expression) is the general form. For output operands an additional modifier will be there. Constraints are primarily used to decide the addressing modes for operands. They are also used in specifying the registers to be used.
+如果我们使用的操作数多于一个,那么每一个操作数用逗号隔开。
 
-If we use more than one operand, they are separated by comma.
+在汇编程序模板,每个操作数用数字引用。编号方式如下。如果总共有 n 个操作数(包括输入和输出操作数),那么第一个输出操作数编号为 0 ,逐项递增,并且最后一个输入操作数编号为 n - 1 。操作数的最大数目为前一节我们所看到的那样。
 
-In the assembler template, each operand is referenced by numbers. Numbering is done as follows. If there are a total of n operands (both input and output inclusive), then the first output operand is numbered 0, continuing in increasing order, and the last input operand is numbered n-1\. The maximum number of operands is as we saw in the previous section.
+输出操作数表达式必须为左值。输入操作数的要求不像这样严格。它们可以为表达式。扩展汇编特性常常用于编译器自己不知道其存在的机器指令 ;-)。如果输出表达式无法直接寻址(例如,它是一个位域),我们的约束字符串必须给定一个寄存器。在这种情况下,GCC 将会使用该寄存器作为汇编的输出,然后存储该寄存器的内容到输出。
 
-Output operand expressions must be lvalues. The input operands are not restricted like this. They may be expressions. The extended asm feature is most often used for machine instructions the compiler itself does not know as existing ;-). If the output expression cannot be directly addressed (for example, it is a bit-field), our constraint must allow a register. In that case, GCC will use the register as the output of the asm, and then store that register contents into the output.
+正如前面所陈述的一样,普通的输出操作数必须为只写的; GCC 将会假设指令前的操作数值是死的,并且不需要被(提前)生成。扩展汇编也支持输入-输出或者读-写操作数。
 
-As stated above, ordinary output operands must be write-only; GCC will assume that the values in these operands before the instruction are dead and need not be generated. Extended asm also supports input-output or read-write operands.
-
-So now we concentrate on some examples. We want to multiply a number by 5\. For that we use the instruction `lea`.
+所以现在我们来关注一些示例。我们想要求一个数的5次方结果。为了计算该值,我们使用 `lea` 指令。
 
 > `
 > 
@@ -258,7 +257,7 @@ So now we concentrate on some examples. We want to multiply a number by 5\. For
 > 
 > `
 
-Here our input is in ’x’. We didn’t specify the register to be used. GCC will choose some register for input, one for output and does what we desired. If we want the input and output to reside in the same register, we can instruct GCC to do so. Here we use those types of read-write operands. By specifying proper constraints, here we do it.
+这里我们的输入为x。我们不指定使用的寄存器。 GCC 将会选择一些输入寄存器,一个输出寄存器,并且做我们期望的事。如果我们想要输入和输出存在于同一个寄存器里,我们可以要求 GCC 这样做。这里我们使用那些读-写操作数类型。这里我们通过指定合适的约束来实现它。
 
 > `
 > 
@@ -274,7 +273,7 @@ Here our input is in ’x’. We didn’t specify the register to be used. GCC w
 > 
 > `
 
-Now the input and output operands are in the same register. But we don’t know which register. Now if we want to specify that also, there is a way.
+现在输出和输出操作数位于同一个寄存器。但是我们无法得知是哪一个寄存器。现在假如我们也想要指定操作数所在的寄存器,这里有一种方法。
 
 > `
 > 
@@ -290,17 +289,17 @@ Now the input and output operands are in the same register. But we don’t know
 > 
 > `
 
-In all the three examples above, we didn’t put any register to the clobber list. why? In the first two examples, GCC decides the registers and it knows what changes happen. In the last one, we don’t have to put `ecx` on the c lobberlist, gcc knows it goes into x. Therefore, since it can know the value of `ecx`, it isn’t considered clobbered.
+在以上三个示例中,我们并没有添加任何寄存器到修饰寄存器里,为什么?在头两个示例, GCC 决定了寄存器并且它知道发生了什么改变。在最后一个示例,我们不必将 'ecx' 添加到修饰寄存器列表(原文修饰寄存器列表拼写有错,这里已修正 ——译者注), gcc 知道它表示x。因此,因为它可以知道 `ecx` 的值,它就不被当作修饰的(寄存器)了。
 
-## 5.3 Clobber List.
+## 5.3 修饰寄存器列表
 
-Some instructions clobber some hardware registers. We have to list those registers in the clobber-list, ie the field after the third ’**:**’ in the asm function. This is to inform gcc that we will use and modify them ourselves. So gcc will not assume that the values it loads into these registers will be valid. We shoudn’t list the input and output registers in this list. Because, gcc knows that "asm" uses them (because they are specified explicitly as constraints). If the instructions use any other registers, implicitly or explicitly (and the registers are not present either in input or in the output constraint list), then those registers have to be specified in the clobbered list.
+一些指令会破坏一些硬件寄存器。我们不得不在修饰寄存器中列出这些寄存器,即汇编函数内第三个 ’**:**’ 之后的域。这可以通知 gcc 我们将会自己使用和修改这些寄存器。所以 gcc 将不会假设存入这些寄存器的值是有效的。我们不用在这个列表里列出输入输出寄存器。因为 gcc 知道 "asm" 使用了它们(因为它们被显式地指定为约束了)。如果指令隐式或显式地使用了任何其他寄存器,(并且寄存器不能出现在输出或者输出约束列表里),那么不得不在修饰寄存器列表中指定这些寄存器。
 
-If our instruction can alter the condition code register, we have to add "cc" to the list of clobbered registers.
+如果我们的指令可以修改状态寄存器,我们必须将 "cc" 添加进修饰寄存器列表。
 
-If our instruction modifies memory in an unpredictable fashion, add "memory" to the list of clobbered registers. This will cause GCC to not keep memory values cached in registers across the assembler instruction. We also have to add the **volatile** keyword if the memory affected is not listed in the inputs or outputs of the asm.
+如果我们的指令以不可预测的方式修改了内存,那么需要将 "memory" 添加进修饰寄存器列表。这可以使 GCC 不会在汇编指令间保持缓存于寄存器的内存值。如果被影响的内存不在汇编的输入或输出列表中,我们也必须添加 **volatile** 关键词。
 
-We can read and write the clobbered registers as many times as we like. Consider the example of multiple instructions in a template; it assumes the subroutine _foo accepts arguments in registers `eax` and `ecx`.
+我们可以按我们的需求多次读写修饰寄存器。考虑一个模板内的多指令示例;它假设子例程 _foo 接受寄存器 `eax` 和 `ecx` 里的参数。
 
 > `
 > 
@@ -321,35 +320,36 @@ We can read and write the clobbered registers as many times as we like. Consider
 
 ## 5.4 Volatile ...?
 
-If you are familiar with kernel sources or some beautiful code like that, you must have seen many functions declared as `volatile` or `__volatile__` which follows an `asm` or `__asm__`. I mentioned earlier about the keywords `asm` and `__asm__`. So what is this `volatile`?
+如果你熟悉内核源码或者其他像内核源码一样漂亮的代码,你一定见过许多声明为 `volatile` 或者 `__volatile__`的函数,其跟着一个 `asm` 或者 `__asm__`。我之前提过关键词 `asm` 和 `__asm__`。那么什么是 `volatile`呢?
 
-If our assembly statement must execute where we put it, (i.e. must not be moved out of a loop as an optimization), put the keyword `volatile` after asm and before the ()’s. So to keep it from moving, deleting and all, we declare it as
+如果我们的汇编语句必须在我们放置它的地方执行(即,不能作为一种优化被移出循环语句),将关键词 `volatile` 放置在 asm 后面,()的前面。因为为了防止它被移动、删除或者其他操作,我们将其声明为
 
 `asm volatile ( ... : ... : ... : ...);`
 
-Use `__volatile__` when we have to be verymuch careful.
+当我们必须非常谨慎时,请使用 `__volatile__`。
 
-If our assembly is just for doing some calculations and doesn’t have any side effects, it’s better not to use the keyword `volatile`. Avoiding it helps gcc in optimizing the code and making it more beautiful.
+如果我们的汇编只是用于一些计算并且没有任何副作用,不使用 `volatile` 关键词会更好。不使用 `volatile` 可以帮助 gcc 优化代码并使代码更漂亮。
 
-In the section `Some Useful Recipes`, I have provided many examples for inline asm functions. There we can see the clobber-list in detail.
+
+在 `Some Useful Recipes` 一节中,我提供了多个内联汇编函数的例子。这儿我们详细查看修饰寄存器列表。
 
 * * *
 
-## 6. More about constraints.
+## 6. 更多关于约束
 
-By this time, you might have understood that constraints have got a lot to do with inline assembly. But we’ve said little about constraints. Constraints can say whether an operand may be in a register, and which kinds of register; whether the operand can be a memory reference, and which kinds of address; whether the operand may be an immediate constant, and which possible values (ie range of values) it may have.... etc.
+到这个时候,你可能已经了解到约束和内联汇编有很大的关联。但我们很少说到约束。约束用于表明一个操作数是否可以位于寄存器和位于哪个寄存器;是否操作数可以为一个内存引用和哪种地址;是否操作数可以为一个立即数和为哪一个可能的值(即值的范围)。它可以有...等等。
 
-## 6.1 Commonly used constraints.
+## 6.1 常用约束
 
-There are a number of constraints of which only a few are used frequently. We’ll have a look at those constraints.
+在许多约束中,只有小部分是常用的。我们将看看这些约束。
 
-1.  **Register operand constraint(r)**
+1.  **寄存器操作数约束(r)**
 
-    When operands are specified using this constraint, they get stored in General Purpose Registers(GPR). Take the following example:
+	当使用这种约束指定操作数时,它们存储在通用寄存器(GPR)中。请看下面示例:
 
     `asm ("movl %%eax, %0\n" :"=r"(myval));`
 
-    Here the variable myval is kept in a register, the value in register `eax` is copied onto that register, and the value of `myval` is updated into the memory from this register. When the "r" constraint is specified, gcc may keep the variable in any of the available GPRs. To specify the register, you must directly specify the register names by using specific register constraints. They are:
+	这里,变量 myval 保存在寄存器中,寄存器 eax 的值被复制到该寄存器中,并且myval的值从寄存器更新到了内存。当指定 "r" 约束时, gcc 可以将变量保存在任何可用的 GPR 中。为了指定寄存器,你必须使用特定寄存器约束直接地指定寄存器的名字。它们为:
 
     > `
     > 
@@ -367,57 +367,58 @@ There are a number of constraints of which only a few are used frequently. We’
     > 
     > `
 
-2.  **Memory operand constraint(m)**
+2.	**内存操作数约束(m)**
 
-    When the operands are in the memory, any operations performed on them will occur directly in the memory location, as opposed to register constraints, which first store the value in a register to be modified and then write it back to the memory location. But register constraints are usually used only when they are absolutely necessary for an instruction or they significantly speed up the process. Memory constraints can be used most efficiently in cases where a C variable needs to be updated inside "asm" and you really don’t want to use a register to hold its value. For example, the value of idtr is stored in the memory location loc:
+	当操作数位于内存时,任何对它们的操作将直接发生在内存位置,这与寄存器约束相反,后者首先将值存储在要修改的寄存器中,然后将它写回到内存位置。但寄存器约束通常用于一个指令必须使用它们或者它们可以大大提高进程速度的地方。当需要在 "asm" 内更新一个 C 变量,而又不想使用寄存器去保存它的只,使用内存最为有效。例如, idtr 的值存储于内存位置:
 
     `asm("sidt %0\n" : :"m"(loc));`
 
-3.  **Matching(Digit) constraints**
+3.	**匹配(数字)约束**
 
-    In some cases, a single variable may serve as both the input and the output operand. Such cases may be specified in "asm" by using matching constraints.
+	在某些情况下,一个变量可能既充当输入操作数,也充当输出操作数。可以通过使用匹配约束在 "asm" 中指定这种情况。
 
     `asm ("incl %0" :"=a"(var):"0"(var));`
 
-    We saw similar examples in operands subsection also. In this example for matching constraints, the register %eax is used as both the input and the output variable. var input is read to %eax and updated %eax is stored in var again after increment. "0" here specifies the same constraint as the 0th output variable. That is, it specifies that the output instance of var should be stored in %eax only. This constraint can be used:
+	在操作数子节中,我们也看到了一些类似的示例。在这个匹配约束的示例中,寄存器 "%eax" 既用作输入变量,也用作输出变量。 var 输入被读进 %eax ,并且更新的 %eax 再次被存储进 var。这里的 "0" 用于指定与第0个输出变量相同的约束。也就是,它指定 var 输出实例应只被存储在 "%eax" 中。该约束可用于:
 
-    *   In cases where input is read from a variable or the variable is modified and modification is written back to the same variable.
-    *   In cases where separate instances of input and output operands are not necessary.
+	*	在输入从变量读取或变量修改后,修改被写回同一变量的情况
+	*	在不需要将输入操作数实例和输出操作数实例分开的情况
 
-    The most important effect of using matching restraints is that they lead to the efficient use of available registers.
+	使用匹配约束最重要的意义在于它们可以导致有效地使用可用寄存器。
 
-Some other constraints used are:
+其他一些约束:
 
-1.  "m" : A memory operand is allowed, with any kind of address that the machine supports in general.
-2.  "o" : A memory operand is allowed, but only if the address is offsettable. ie, adding a small offset to the address gives a valid address.
+1.	"m" : 允许一个内存操作数使用机器普遍支持的任一种地址。
+2.	"o" : 允许一个内存操作数,但只有当地址是可偏移的。即,该地址加上一个小的偏移量可以得到一个地址。
 3.  "V" : A memory operand that is not offsettable. In other words, anything that would fit the `m’ constraint but not the `o’constraint.
-4.  "i" : An immediate integer operand (one with constant value) is allowed. This includes symbolic constants whose values will be known only at assembly time.
-5.  "n" : An immediate integer operand with a known numeric value is allowed. Many systems cannot support assembly-time constants for operands less than a word wide. Constraints for these operands should use ’n’ rather than ’i’.
-6.  "g" : Any register, memory or immediate integer operand is allowed, except for registers that are not general registers.
+4.	"i" : 允许一个(带有常量)的立即整形操作数。这包括其值仅在汇编时期知道的符号常量。
+5.	"n" : 允许一个带有已知数字的立即整形操作数。许多系统不支持汇编时期的常量,因为操作数少于一个字宽。对于此种操作数,约束应该使用 'n' 而不是'i'。 
+6.	"g" : 允许任一寄存器、内存或者立即整形操作数,不包括通用寄存器之外的寄存器。
 
-Following constraints are x86 specific.
 
-1.  "r" : Register operand constraint, look table given above.
-2.  "q" : Registers a, b, c or d.
-3.  "I" : Constant in range 0 to 31 (for 32-bit shifts).
-4.  "J" : Constant in range 0 to 63 (for 64-bit shifts).
-5.  "K" : 0xff.
-6.  "L" : 0xffff.
-7.  "M" : 0, 1, 2, or 3 (shifts for lea instruction).
-8.  "N" : Constant in range 0 to 255 (for out instruction).
-9.  "f" : Floating point register
-10.  "t" : First (top of stack) floating point register
-11.  "u" : Second floating point register
-12.  "A" : Specifies the `a’ or `d’ registers. This is primarily useful for 64-bit integer values intended to be returned with the `d’ register holding the most significant bits and the `a’ register holding the least significant bits.
+以下约束为x86特有。
 
-## 6.2 Constraint Modifiers.
+1.	"r" : 寄存器操作数约束,查看上面给定的表格。
+2.	"q" : 寄存器 a、b、c 或者 d。
+3.	"I" : 范围从 0 到 31 的常量(对于 32 位移位)。
+4.  "J" : 范围从 0 到 63 的常量(对于 64 位移位)。
+5.	"K" : 0xff。
+6.  "L" : 0xffff。
+7.  "M" : 0, 1, 2, or 3 (lea 指令的移位)。
+8.  "N" : 范围从 0 到 255 的常量(对于 out 指令)。
+9.  "f" : 浮点寄存器
+10.  "t" : 第一个(栈顶)浮点寄存器
+11.  "u" : 第二个浮点寄存器
+12.  "A" : 指定 `a` 或 `d` 寄存器。这主要用于想要返回 64 位整形数,使用 `d` 寄存器保存最高有效位和 `a` 寄存器保存最低有效位。
 
-While using constraints, for more precise control over the effects of constraints, GCC provides us with constraint modifiers. Mostly used constraint modifiers are
+## 6.2 约束修饰符
 
-1.  "=" : Means that this operand is write-only for this instruction; the previous value is discarded and replaced by output data.
-2.  "&" : Means that this operand is an earlyclobber operand, which is modified before the instruction is finished using the input operands. Therefore, this operand may not lie in a register that is used as an input operand or as part of any memory address. An input operand can be tied to an earlyclobber operand if its only use as an input occurs before the early result is written.
+当使用约束时,对于更精确的控制超越了约束作用的需求,GCC 给我们提供了约束修饰符。最常用的约束修饰符为:
 
-    The list and explanation of constraints is by no means complete. Examples can give a better understanding of the use and usage of inline asm. In the next section we’ll see some examples, there we’ll find more about clobber-lists and constraints.
+1.  "=" : 意味着对于这条指令,操作数为只写的;旧值会被忽略并被输出数据所替换。
+2.  "&" : 意味着这个操作数为一个早期的改动操作数,其在该指令完成前通过使用输入操作数被修改了。因此,这个操作数不可以位于一个被用作输出操作数或任何内存地址部分的寄存器。如果在旧值被写入之前它仅用作输入而已,一个输入操作数可以为一个早期改动操作数。
+
+	约束的列表和解释是决不完整的。示例可以给我们一个关于内联汇编的用途和用法的更好的理解。在下一节,我们会看到一些示例,在那里我们会发现更多关于修饰寄存器列表的东西。
 
 * * *
 

From ee4a1ed9806c00effc356ed4bcb030df944bd30b Mon Sep 17 00:00:00 2001
From: Name1e5s <836401406@qq.com>
Date: Sat, 12 Mar 2016 09:34:49 +0800
Subject: [PATCH 0518/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E7=9A=84=E4=B8=8D?=
 =?UTF-8?q?=E5=A5=BD=EF=BC=8C=E9=80=80=E5=9B=9E?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 ... Startup Process and Services SysVinit Systemd and Upstart.md | 1 -
 1 file changed, 1 deletion(-)

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 24d431696d..2a822e8a45 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,4 +1,3 @@
-Name1e5s translating......
 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.

From 386d6a10c68cab1760a8bb35dc42b55040eee957 Mon Sep 17 00:00:00 2001
From: cposture 
Date: Sat, 12 Mar 2016 15:24:02 +0800
Subject: [PATCH 0519/1469] Translating by cposture 2016-03-12

---
 .../20160220 Best Cloud Services For Linux To Replace Copy.md    | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sources/tech/20160220 Best Cloud Services For Linux To Replace Copy.md b/sources/tech/20160220 Best Cloud Services For Linux To Replace Copy.md
index cd2ffee237..8e178b856e 100644
--- a/sources/tech/20160220 Best Cloud Services For Linux To Replace Copy.md	
+++ b/sources/tech/20160220 Best Cloud Services For Linux To Replace Copy.md	
@@ -1,3 +1,4 @@
+[Translating by cposture 2016-03-12]
 Best Cloud Services For Linux To Replace Copy
 ===============================================
 

From 937fe5e12d114083536c432ab84981490f2336b2 Mon Sep 17 00:00:00 2001
From: wxy 
Date: Sat, 12 Mar 2016 19:07:58 +0800
Subject: [PATCH 0520/1469] PUB:20151028 Bossie Awards 2015--The best open
 source networking and security software
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

@robot527 翻译的不错!用心了!
---
 ...source networking and security software.md | 56 +++++++++----------
 1 file changed, 28 insertions(+), 28 deletions(-)

diff --git a/published/20151028 Bossie Awards 2015--The best open source networking and security software.md b/published/20151028 Bossie Awards 2015--The best open source networking and security software.md
index d245fe2a4c..14eb07dee2 100644
--- a/published/20151028 Bossie Awards 2015--The best open source networking and security software.md	
+++ b/published/20151028 Bossie Awards 2015--The best open source networking and security software.md	
@@ -1,6 +1,6 @@
-2015 Bossie 评选:最佳开源网络和安全软件
+网络与安全方面的最佳开源软件
 ================================================================================ 
-InfoWorld 在建设网络,运营网络和保障网络安全领域精选出了年度开源工具获奖者。
+InfoWorld 在部署、运营和保障网络安全领域精选出了年度开源工具获奖者。
 
 ![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-net-sec-100614459-orig.jpg)
 
@@ -12,9 +12,9 @@ InfoWorld 在建设网络,运营网络和保障网络安全领域精选出了
 
 ### Icinga 2 ###
 
-Icinga 起先只是系统监控应用 Nagios 的一个分支。[Icinga 2][1] 经历了完全的重写,为用户带来了时尚的界面,对多数据库的支持,以及一个集成众多扩展的 API。凭借着配置好的负载均衡、通知和配置文件,Icinga 2 缩短了在复杂环境下安装的时间。Icinga 2 原生支持 [Graphite](https://github.com/graphite-project/graphite-web)(系统监控应用),轻松为管理员呈现实时性能图表。不过真的让 Icinga 今年重新火起来的原因是 Icinga Web 2 的发布,那是一个支持可拖放定制的 dashboard 和一些流式监控工具的前端图形界面系统 。
+Icinga 起先只是系统监控应用 Nagios 的一个衍生分支。[Icinga 2][1] 经历了完全的重写,为用户带来了时尚的界面、对多数据库的支持,以及一个集成了众多扩展的 API。凭借着开箱即用的负载均衡、通知和配置文件,Icinga 2 缩短了在复杂环境下安装的时间。Icinga 2 原生支持 [Graphite](https://github.com/graphite-project/graphite-web)(系统监控应用),轻松为管理员呈现实时性能图表。不过真的让 Icinga 今年重新火起来的原因是 Icinga Web 2 的发布,那是一个支持可拖放定制的 仪表盘 和一些流式监控工具的前端图形界面系统。
 
-管理员可以查看,过滤,并把问题按优先顺序排好,同时保持跟踪已经进行的动作。一个新的矩阵视图使管理员能够在一个页面上查看主机和服务。你可以通过查看特定时间段的事件或筛选事件类型来了解哪些事件需要立即关注。虽然 Icinga Web 2 有着全新界面和更为强劲的性能,不过对于传统版 Icinga 和 Web 版 Icinga 的所有常用命令还是照旧支持的。这意味着学习新版工具不耗费额外的时间。
+管理员可以查看、过滤、并按优先顺序排列发现的问题,同时可以跟踪已经采取的动作。一个新的矩阵视图使管理员能够在单一页面上查看主机和服务。你可以通过查看特定时间段的事件或筛选事件类型来了解哪些事件需要立即关注。虽然 Icinga Web 2 有着全新界面和更为强劲的性能,不过对于传统版 Icinga 和 Web 版 Icinga 的所有常用命令还是照旧支持的。这意味着学习新版工具不耗费额外的时间。
 
 -- Fahmida Rashid
 
@@ -22,11 +22,11 @@ Icinga 起先只是系统监控应用 Nagios 的一个分支。[Icinga 2][1] 经
 
 ### Zenoss Core ###
 
-另一个强大的开源软件,[Zenoss Core][2] 为网络管理员提供了一个完整的,一站式解决方案来跟踪和管理所有的应用程序、服务器、存储,网络组件、虚拟化工具、以及企业基础架构的其他元素。管理员可以确保硬件的运行效率并利用 ZenPacks 中模块化设计的插件来扩展功能。
+这是另一个强大的开源软件,[Zenoss Core][2] 为网络管理员提供了一个完整的、一站式解决方案来跟踪和管理所有的应用程序、服务器、存储、网络组件、虚拟化工具、以及企业基础架构的其他元素。管理员可以确保硬件的运行效率并利用 ZenPacks 中模块化设计的插件来扩展功能。
 
-Zenoss Core 5,在今年二月发布,保留了已经很强大的工具,并进一步改进以增强用户界面和扩展 dashboard。基于 Web 的控制台和 dashboard 已经是高度可定制并动态调整的存在了,现在新版本还能让管理员混搭多个组件图表到一个图表。想来这定是一个更好的根源分析和因果分析的工具。
+在2015年二月发布的 Zenoss Core 5 保留了已经很强大的工具,并进一步改进以增强用户界面和扩展 仪表盘。基于 Web 的控制台和 仪表盘 可以高度可定制并动态调整,而现在的新版本还能让管理员混搭多个组件图表到一个图表中。想来这应该是一个更好的根源分析和因果分析的工具。
 
-Portlets 为网络映射、设备问题、守护进程、产品状态、监视列表和事件视图等等提供深入的分析。而且新的 HTML5 图表可以从工具导出。Zenoss 的控制中心支持带外管理并且可监控所有 Zenoss 组件。Zenoss Core 拥有在线备份和恢复、快照和回滚以及多主机部署的新工具。更重要的是,凭借对 Docker 的全面支持,部署起来更快了。
+Portlets 为网络映射、设备问题、守护进程、产品状态、监视列表和事件视图等等提供了深入的分析。而且新版 HTML5 图表可以从工具导出。Zenoss 的控制中心支持带外管理并且可监控所有 Zenoss 组件。Zenoss Core 现在拥有一些新工具,用于在线备份和恢复、快照和回滚以及多主机部署等方面。更重要的是,凭借对 Docker 的全面支持,部署起来更快了。
 
 -- Fahmida Rashid
 
@@ -34,9 +34,9 @@ Portlets 为网络映射、设备问题、守护进程、产品状态、监视
 
 ### OpenNMS ###
 
-作为一个非常灵活的网络管理解决方案,[OpenNMS][3] 可以处理任何网络管理任务,无论是设备管理,应用性能监控,库存控制,或事件管理。凭借对 IPv6 的支持,强大的警报系统和记录用户脚本来测试 Web 应用程序的能力,OpenNMS 拥有网络管理员和测试人员需要的一切。OpenNMS 现在变得像一款移动 dashboard,堪称 OpenNMS 指南针,可让网络专家随时,甚至在外出时都可以监视他们的网络。
+作为一个非常灵活的网络管理解决方案,[OpenNMS][3] 可以处理任何网络管理任务,无论是设备管理、应用性能监控、库存控制,或事件管理。凭借对 IPv6 的支持、强大的警报系统和记录用户脚本来测试 Web 应用程序的能力,OpenNMS 拥有网络管理员和测试人员需要的一切。OpenNMS 现在变得像一款移动版 仪表盘,称之为 OpenNMS Compass,可让网络专家随时,甚至在外出时都可以监视他们的网络。
 
-该应用程序的 IOS 版本,可从 [iTunes App Store][4] 上获取,显示故障、节点和告警。下一个版本将提供更多的事件细节、资源图表、以及关于 IP 和 SNMP 接口的信息。安卓版可从 [Google Play][5] 上获取,可在 dashboard 上显示网络可用性,故障和告警,以及确认、提升或清除告警的能力。移动客户端与 OpenNMS Horizon 1.12 或更高版本以及 OpenNMS Meridian 2015.1.0 或更高版本兼容。
+该应用程序的 IOS 版本,可从 [iTunes App Store][4] 上获取,可以显示故障、节点和告警。下一个版本将提供更多的事件细节、资源图表、以及关于 IP 和 SNMP 接口的信息。安卓版可从 [Google Play][5] 上获取,可在 仪表盘 上显示网络可用性,故障和告警,以及可以确认、提升或清除告警。移动客户端与 OpenNMS Horizon 1.12 或更高版本以及 OpenNMS Meridian 2015.1.0 或更高版本兼容。
 
 -- Fahmida Rashid
 
@@ -44,21 +44,21 @@ Portlets 为网络映射、设备问题、守护进程、产品状态、监视
 
 ### Security Onion ###
 
-如同一个洋葱,网络安全监控是由许多层组成。没有任何一个单一的工具可以让你洞察每一次攻击,为你显示你公司网络中的每一次侦查或是会话的足迹。[Security Onion][6] 在一个简单易用的 Ubuntu 发行版中打包了许多经过验证的工具,这会让你看到谁留在你的网络里,并帮助你隔离这些坏家伙。
+如同一个洋葱,网络安全监控是由许多层组成。没有任何一个单一的工具可以让你洞察每一次攻击,为你显示对你的公司网络中的每一次侦查或是会话的足迹。[Security Onion][6] 在一个简单易用的 Ubuntu 发行版中打包了许多久经考验的工具,可以让你看到谁留在你的网络里,并帮助你隔离这些坏家伙。
 
 无论你是采取主动式的网络安全监测还是追查可能的攻击,Security Onion 都可以帮助你。Onion 由传感器、服务器和显示层组成,结合了基于网络和基于主机的入侵检测,全面的网络数据包捕获,并提供了所有类型的日志以供检查和分析。
 
-这是一个众星云集的的网络安全工具链,包括用于网络抓包的 [Netsniff-NG](http://www.netsniff-ng.org/)、基于规则的网络入侵检测系统 Snort 和 [Suricata](https://en.wikipedia.org/wiki/Suricata_%28software%29),基于分析的网络监控系统 Bro,基于主机的入侵检测系统 OSSEC 和用于显示、分析和日志管理的 Sguil、Squert、Snorby 和 ELSA (企业日志搜索和归档)。是一个经过精挑细选的工具集,所有的这些全被打包进一个向导式的安装程序并有完整的文档支持,可以帮助你尽可能快地上手监控。
+这是一个众星云集的的网络安全工具链,包括用于网络抓包的 [Netsniff-NG](http://www.netsniff-ng.org/)、基于规则的网络入侵检测系统 Snort 和 [Suricata](https://en.wikipedia.org/wiki/Suricata_%28software%29),基于分析的网络监控系统 Bro,基于主机的入侵检测系统 OSSEC 和用于显示、分析和日志管理的 Sguil、Squert、Snorby 和 ELSA (企业日志搜索和归档(Enterprise Log Search and Archive))。它是一个经过精挑细选的工具集,所有的这些全被打包进一个向导式的安装程序并有完整的文档支持,可以帮助你尽可能快地上手监控。
 
 -- Victor R. Garza
 
 ![](http://images.techhive.com/images/article/2015/09/bossies-2015-kali-100614458-orig.jpg)
 
-Kali Linux
+### Kali Linux ###
 
-[Kali Linux][7] 背后的团队今年改版了流行的安全 Linux 发行版,使其更快,更全能。Kali 采用全新 4.0 版的内核 ,改进了对硬件和无线驱动程序的支持,并且界面更为流畅。最常用的工具都可从屏幕的侧边栏上轻松找到。而最大的最大的改变是 Kali Linux 现在是一个滚动发行版,具有持续的软件更新。Kali 的核心系统是基于 Debian Jessie,而且该团队会不断地从 Debian 测试版 pull 软件包,并持续的在上面添加 Kali 风格的新特性。
+[Kali Linux][7] 背后的团队今年为这个流行的安全 Linux 发行版发布了新版本,使其更快,更全能。Kali 采用全新 4.0 版的内核,改进了对硬件和无线驱动程序的支持,并且界面更为流畅。最常用的工具都可从屏幕的侧边栏上轻松找到。而最大的改变是 Kali Linux 现在是一个滚动发行版,具有持续不断的软件更新。Kali 的核心系统是基于 Debian Jessie,而且该团队会不断地从 Debian 测试版拉取最新的软件包,并持续的在上面添加 Kali 风格的新特性。
 
-该发行版仍然配备满了渗透测试,漏洞分析,安全审查,网络应用分析,无线网络评估,逆向工程,和漏洞利用工具。现在该发行版具有新版本检测系统,当有个别工具可更新时系统会自动通知用户。该发行版还具有一系列设备的 ARM 镜像,包括树莓派、[Chromebook](https://en.wikipedia.org/wiki/Chromebook) 和 [Odroid](https://en.wikipedia.org/wiki/ODROID),也更新了 Android 设备上运行的 [NetHunter](https://www.kali.org/kali-linux-nethunter/) 渗透测试平台。还有其他的变化:Metasploit 的社区版/专业版不再包括在内,因为 Kali 2.0 还没有 [Rapid7 的官方支持][8]。
+该发行版仍然配备了很多的渗透测试,漏洞分析,安全审查,网络应用分析,无线网络评估,逆向工程,和漏洞利用工具。现在该发行版具有上游版本检测系统,当有个别工具可更新时系统会自动通知用户。该发行版还提过了一系列 ARM 设备的镜像,包括树莓派、[Chromebook](https://en.wikipedia.org/wiki/Chromebook) 和 [Odroid](https://en.wikipedia.org/wiki/ODROID),同时也更新了 Android 设备上运行的 [NetHunter](https://www.kali.org/kali-linux-nethunter/) 渗透测试平台。还有其他的变化:Metasploit 的社区版/专业版不再包括在内,因为 Kali 2.0 还没有 [Rapid7 的官方支持][8]。
 
 -- Fahmida Rashid
 
@@ -66,9 +66,9 @@ Kali Linux
 
 ### OpenVAS ###
 
-开放式漏洞评估系统 [OpenVAS][9],是一个整合多种服务和工具来提供漏洞扫描和漏洞管理的软件框架。该扫描器与每周一次的网络漏洞测试数据配合,或者你可以使用商业数据。该软件框架包括一个命令行界面(以使其可以用脚本运行)和一个带 SSL 安全机制的基于 [Greenbone 安全助手][10] 的浏览器界面。OpenVAS 提供了用于附加功能的各种插件。扫描可以预定运行或按需运行。
+开放式漏洞评估系统(Open Vulnerability Assessment System) [OpenVAS][9],是一个整合多种服务和工具来提供漏洞扫描和漏洞管理的软件框架。该扫描器可以使用每周更新一次的网络漏洞测试数据,或者你也可以使用商业服务的数据。该软件框架包括一个命令行界面(以使其可以用脚本调用)和一个带 SSL 安全机制的基于 [Greenbone 安全助手][10] 的浏览器界面。OpenVAS 提供了用于附加功能的各种插件。扫描可以预定运行或按需运行。
 
-可通过单一的主控来控制多个 OpenVAS 的安装,这使其成为了一个可扩展的企业漏洞评估工具。该项目兼容的标准使其可以:将扫描结果和配置存储在 SQL 数据库中,在那里他们可以容易地被外部报告工具访问。客户端工具通过基于 XML 的无状态 OpenVAS 管理协议访问 OpenVAS 管理器,所以安全管理员可以扩展该框架的功能。该软件能以软件包或源代码的方式安装在 Windows 或 Linux 上运行,或者作为一个虚拟应用下载。
+可通过单一的主控来控制多个安装好 OpenVAS 的系统,这使其成为了一个可扩展的企业漏洞评估工具。该项目兼容的标准使其可以将扫描结果和配置存储在 SQL 数据库中,这样它们可以容易地被外部报告工具访问。客户端工具通过基于 XML 的无状态 OpenVAS 管理协议访问 OpenVAS 管理器,所以安全管理员可以扩展该框架的功能。该软件能以软件包或源代码的方式安装在 Windows 或 Linux 上运行,或者作为一个虚拟应用下载。
 
 -- Matt Sarrel
 
@@ -76,15 +76,15 @@ Kali Linux
 
 ### OWASP ###
 
-[OWASP][11](开放式 Web 应用程序安全项目 )是专注于提高软件安全性的在全球各地拥有分会的非营利组织。由这个社区性的组织提供测试工具、文档、培训和几乎任何你可以想象的开发安全软件相关的软件安全评估和最佳做法。有一些 OWASP 项目已成为很多安全从业者工具箱中的重要组件:
+[OWASP][11](开放式 Web 应用程序安全项目(Open Web Application Security Project))是一个专注于提高软件安全性的在全球各地拥有分会的非营利组织。这个社区性的组织提供测试工具、文档、培训和几乎任何你可以想象到的开发安全软件相关的软件安全评估和最佳实践。有一些 OWASP 项目已成为很多安全从业者工具箱中的重要组件:
 
-[ZAP][12](ZED 攻击代理项目)是一个在 Web 应用程序中寻找漏洞的渗透测试工具。ZAP 的设计目标之一是使之易于使用,以便于那些并非安全领域专家的开发人员和的测试人员在使用中能得到帮助。ZAP 提供自动扫描和一套手动测试工具集。
+[ZAP][12](ZED 攻击代理项目(Zed Attack Proxy Project))是一个在 Web 应用程序中寻找漏洞的渗透测试工具。ZAP 的设计目标之一是使之易于使用,以便于那些并非安全领域专家的开发人员和测试人员能便于使用。ZAP 提供了自动扫描和一套手动测试工具集。
 
-[Xenotix XSS Exploit Framework][13] 是一个先进的跨站点脚本漏洞检测和漏洞利用框架,该框架通过在浏览器引擎内执行扫描以获取真实结果。Xenotix 扫描模块使用了三个智能的模糊器,使其可以运行近 5000 种不同的 XSS 有效载荷。API 可以让安全管理员扩展和定制漏洞测试工具包。
+[Xenotix XSS Exploit Framework][13] 是一个先进的跨站点脚本漏洞检测和漏洞利用框架,该框架通过在浏览器引擎内执行扫描以获取真实的结果。Xenotix 扫描模块使用了三个智能模糊器( intelligent fuzzers),使其可以运行近 5000 种不同的 XSS 有效载荷。它有个 API 可以让安全管理员扩展和定制漏洞测试工具包。
 
-[O-Saft][14](OWASP SSL 高级审查工具)是一个查看 SSL 证书详细信息和测试 SSL 连接的 SSL 审计工具。这个命令行工具可以在线或离线运行来评估 SSL ,比如密码和配置是否安全。O-Saft 提供了常见漏洞的内置检查,你可以容易地通过编写脚本来扩展这些功能。在 2015 年 5 月加入了一个简单的图形用户界面作为可选的下载项。
+[O-Saft][14](OWASP SSL 高级审查工具(OWASP SSL advanced forensic tool))是一个查看 SSL 证书详细信息和测试 SSL 连接的 SSL 审计工具。这个命令行工具可以在线或离线运行来评估 SSL ,比如算法和配置是否安全。O-Saft 内置提供了常见漏洞的检查,你可以容易地通过编写脚本来扩展这些功能。在 2015 年 5 月加入了一个简单的图形用户界面作为可选的下载项。
 
-[OWTF][15](攻击性的 Web 测试框架)是一个遵循 OWASP 测试指南和 NIST 和 PTES 标准的自动化测试工具。该框架同时使用 Web 用户界面和命令行,用于探测 Web 和应用服务器的常见漏洞,如配置失当和软件未打补丁。
+[OWTF][15](攻击性 Web 测试框架(Offensive Web Testing Framework))是一个遵循 OWASP 测试指南和 NIST 和 PTES 标准的自动化测试工具。该框架同时支持 Web 用户界面和命令行,用于探测 Web 和应用服务器的常见漏洞,如配置失当和软件未打补丁。
 
 -- Matt Sarrel
 
@@ -92,9 +92,9 @@ Kali Linux
 
 ### BeEF ###
 
-Web 浏览器已经成为用于针对客户端的攻击中最常见的载体。[BeEF][15] 浏览器漏洞利用框架项目,是一种广泛使用的用以评估 Web 浏览器安全性的渗透工具。BeEF 通过浏览器来启动客户端攻击,帮助你暴露出客户端系统的安全弱点。BeEF 建立了一个恶意网站,安全管理员用想要测试的浏览器访问该网站。然后 BeEF 发送命令来攻击 Web 浏览器并使用命令在客户端机器上植入软件。随后管理员就可以把客户端机器看作尸体般发动攻击了。
+Web 浏览器已经成为用于针对客户端的攻击中最常见的载体。[BeEF][15] (浏览器漏洞利用框架项目(Browser Exploitation Framework Project)),是一种广泛使用的用以评估 Web 浏览器安全性的渗透工具。BeEF 通过浏览器来启动客户端攻击,帮助你暴露出客户端系统的安全弱点。BeEF 建立了一个恶意网站,安全管理员用想要测试的浏览器访问该网站。然后 BeEF 发送命令来攻击 Web 浏览器并使用命令在客户端机器上植入软件。随后管理员就可以把客户端机器看作不设防般发动攻击了。
 
-BeEF 自带像键盘记录,端口扫描和 Web 代理这样的常用模块,此外你可以编写你自己的模块或直接将命令发送到被控制的测试机上。BeEF 带有少量的演示网页来帮你快速入门,使得编写额外的网页和攻击模块变得非常简单,这使得你可以因地适宜的自定义你的测试。BeEF 是一个非常有价值的评估浏览器和终端安全、学习如何发起基于浏览器攻击的测试工具。可以使用它来向你的用户综合演示,那些恶意软件通常是如何感染客户端设备的。
+BeEF 自带键盘记录器、端口扫描器和 Web 代理这样的常用模块,此外你可以编写你自己的模块或直接将命令发送到被控制的测试机上。BeEF 带有少量的演示网页来帮你快速入门,使得编写更多的网页和攻击模块变得非常简单,让你可以因地适宜的自定义你的测试。BeEF 是一个非常有价值的评估浏览器和终端安全、学习如何发起基于浏览器攻击的测试工具。可以使用它来向你的用户综合演示,那些恶意软件通常是如何感染客户端设备的。
 
 -- Matt Sarrel
 
@@ -102,17 +102,17 @@ BeEF 自带像键盘记录,端口扫描和 Web 代理这样的常用模块,
 
 ### Unhide ###
 
-[Unhide][16] 是一个定位开放的 TCP/UDP 端口和隐藏在 UNIX、Linux 和 Windows 上的进程的审查工具。隐藏的端口和进程可能是由于运行 Rootkit 或 LKM(可加载的内核模块) 导致的。Rootkit 可能很难找到并移除,因为它们就是针对隐蔽性设计的,在操作系统和用户前隐藏自己。一个 Rootkit 可以使用 LKM 隐藏其进程或冒充其他进程,让它在机器上运行很长一段时间而不被发现。而 Unhide 可以使管理员们确信他们的系统是干净的。
+[Unhide][16] 是一个用于定位开放的 TCP/UDP 端口和隐藏在 UNIX、Linux 和 Windows 上的进程的审查工具。隐藏的端口和进程可能是由于运行 Rootkit 或 LKM(可加载的内核模块(loadable kernel module)) 导致的。Rootkit 可能很难找到并移除,因为它们就是专门针对隐蔽性而设计的,可以在操作系统和用户前隐藏自己。一个 Rootkit 可以使用 LKM 隐藏其进程或冒充其他进程,让它在机器上运行很长一段时间而不被发现。而 Unhide 则可以使管理员们确信他们的系统是干净的。
 
-Unhide 实际上是两个单独的脚本:一个用于进程,一个用于端口。该工具查询正在运行的进程、线程和开放的端口并将这些信息与系统中注册的活动比较,报告之间的差异。Unhide 和 WinUnhide 是在运行命令行产生文本输出的非常轻量级的脚本。它们不算优美,但是极为有用。Unhide 还列入了 [Rootkit Hunter][17] 项目中。
+Unhide 实际上是两个单独的脚本:一个用于进程,一个用于端口。该工具查询正在运行的进程、线程和开放的端口并将这些信息与系统中注册的活动比较,报告之间的差异。Unhide 和 WinUnhide 是非常轻量级的脚本,可以运行命令行而产生文本输出。它们不算优美,但是极为有用。Unhide 也包括在 [Rootkit Hunter][17] 项目中。
 
 -- Matt Sarrel
 
 ![](http://images.techhive.com/images/article/2015/09/bossies-2015-main-100614457-orig.jpg)
 
-查看更多的开源软件优胜者
+### 查看更多的开源软件优胜者 ###
 
-InfoWorld 网站的 2014 年最佳开源奖由下至上表扬了 100 多个开源项目。通过以下链接可以查看更多开源软件中的翘楚:
+InfoWorld 网站的 2015 年最佳开源奖由下至上表扬了 100 多个开源项目。通过以下链接可以查看更多开源软件中的翘楚:
 
 [2015 Bossie 评选:最佳开源应用程序][18]
 
@@ -132,7 +132,7 @@ via: http://www.infoworld.com/article/2982962/open-source-tools/bossie-awards-20
 
 作者:[InfoWorld staff][a]
 译者:[robot527](https://github.com/robot527)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
 
 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
 

From 313f15c9005283e66195fdbb7acbed7e4083c0eb Mon Sep 17 00:00:00 2001
From: runningwater 
Date: Sun, 13 Mar 2016 11:23:56 +0800
Subject: [PATCH 0521/1469] =?UTF-8?q?=E6=9A=82=E5=AD=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../20160225 The Tao of project management.md | 21 ++++++++-----------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/sources/tech/20160225 The Tao of project management.md b/sources/tech/20160225 The Tao of project management.md
index 5cea94472d..750bc476dc 100644
--- a/sources/tech/20160225 The Tao of project management.md	
+++ b/sources/tech/20160225 The Tao of project management.md	
@@ -101,24 +101,21 @@
 
 作为一个项目管理者,虽然你的工作与培养你的团队的文化无关,但是工作本身就是文化。
 
-### Kaizen
+### 持续改善
 
->In pursuit of knowledge,
->every day something is added.
->In the practice of the Tao,
->every day something is dropped.
->Less and less do you need to force things,
->until finally you arrive at non-action. When nothing is done,
->nothing is left undone. 
+>为学日益,
+>为道日损,
+>损之又损,以至于无为。无为而无不为,取天下常以无事
 [[48]][14]
 
-The general field of project management is too focused on the latest and greatest tools. But the answer to the question of which tool you should use is always the same: "the simplest."
+虽然项目管理的一般领域都太过于专注最新最强大的的工具,但是您应该使用哪种工具这问题的答案总是一致的:“最简单的”。
 
-For example, I keep my running to-do list in a text file on my desktop because it serves its purpose without unnecessary distractions. Whatever tools, processes, and procedures you introduce to a team should increase efficiency and remove obstacles, not introduce additional complexity. So instead of focusing on the tools, focus on the problem(s) you're using those tools to solve.
+例如,我将任务列表放在桌面的一个文本文件中,因为它很单纯,没有不必要的干扰。您想介绍给团队的,无论是何种工具、流程和程序都应该是能提高效率,排除障碍的,而不是引入额外的复杂性。所以不应该专注于工具本身,而应该专注于使用这些工具来解决的问题。
 
-My favorite part of being a project manager in an Agile world is having the freedom to throw out what doesn't work. This is related to the concept of kaizen, or "continuous improvement." Don't be afraid to try and fail. Failing is the label we've put on the process of learning what works and what doesn't. But it's the only way to improve.
+我最喜欢的一个项目经理在一个灵活的世界是有自由扔什么不工作。在  Agile world 中我喜欢项目管理者能自由的做决定,抛出不能做的工作。这就是改善的概念,或叫“持续改进”。不要害怕尝试和失败。失败是我们在学习的过程中所用的标签,不能代表什么,但这是提高的唯一方式。
 
-The best processes arise organically. As a project manager, you can help your team by supporting them and not trying to force them into anything.
+
+最好的过程都不是一蹴而就的。作为项目管理者,您应该帮助您的团队,支持团队让其自己提升,而不是强迫团队。
 
 ### Practice
 

From 40d7856fa145334e4f1a4ce569858e8c29d117dd Mon Sep 17 00:00:00 2001
From: runningwater 
Date: Mon, 14 Mar 2016 00:22:58 +0800
Subject: [PATCH 0522/1469] =?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

---
 .../tech/20160225 The Tao of project management.md  | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)
 rename {sources => translated}/tech/20160225 The Tao of project management.md (90%)

diff --git a/sources/tech/20160225 The Tao of project management.md b/translated/tech/20160225 The Tao of project management.md
similarity index 90%
rename from sources/tech/20160225 The Tao of project management.md
rename to translated/tech/20160225 The Tao of project management.md
index 750bc476dc..e0238e2cee 100644
--- a/sources/tech/20160225 The Tao of project management.md	
+++ b/translated/tech/20160225 The Tao of project management.md	
@@ -117,19 +117,14 @@
 
 最好的过程都不是一蹴而就的。作为项目管理者,您应该帮助您的团队,支持团队让其自己提升,而不是强迫团队。
 
-### Practice
+### 实践
 
->Some say that my teaching is nonsense.
->Others call it lofty but impractical.
->But to those who have looked inside themselves,
->this nonsense makes perfect sense.
->And to those who put it into practice,
->this loftiness has roots that go deep. 
+>天下皆谓我"道"大,似不肖。夫唯大,故似不肖。若肖,久矣其细也夫!
 [[67]][15]
 
-I believe in what open organizations are doing. What open organizations are doing for the field of management is almost as important as the actual products and services they offer. We have an opportunity to lead by example, to inspire passion and purpose in others, to create working environments that inspire and empower.
+我相信开放性组织正在做的。开放性组织在管理领域的工作几乎和他们所提供的产品和服务一样重要。我们有机会以身作则,激发他人的激情和目的,创造激励和充分授权的工作环境。
 
-I encourage you to find ways to incorporate some of these ideas into your own projects and teams to see what happens. Learn about your organization's mission and how your projects contribute to it. Have courage, expect to try some things that won't work, and don't forget to share the lessons you learn with our community so we can continue to improve.
+我鼓励您们找到办法把这些想法融入到自己的项目和团队中,看看会发生什么。了解组织的使命和您的项目怎么样帮助它们。鼓起勇气,尝试一些不好的事情,同时不要忘记和我们的社区分享你所学到的经验,这样我们就可以继续改进。
 
 
 --------------------------------------------------------------------------------

From 18ebd969b6f358ca6b9793b903ab7324046408d4 Mon Sep 17 00:00:00 2001
From: KS 
Date: Mon, 14 Mar 2016 10:36:24 +0800
Subject: [PATCH 0523/1469] wyangsun translating

---
 .../tech/20160228 Two Outstanding All-in-One Linux Servers.md    | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sources/tech/20160228 Two Outstanding All-in-One Linux Servers.md b/sources/tech/20160228 Two Outstanding All-in-One Linux Servers.md
index a291fd2006..4d6f369aa5 100644
--- a/sources/tech/20160228 Two Outstanding All-in-One Linux Servers.md	
+++ b/sources/tech/20160228 Two Outstanding All-in-One Linux Servers.md	
@@ -1,3 +1,4 @@
+wyangsun translating
 Two Outstanding All-in-One Linux Servers
 ================================================
 

From 7755a0b6652d9f093663dc3c41508cf546ed1eb6 Mon Sep 17 00:00:00 2001
From: Ezio 
Date: Mon, 14 Mar 2016 21:38:46 +0800
Subject: [PATCH 0524/1469] =?UTF-8?q?20160314-1=20=E9=80=89=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

keyword : FOSS , podcast
---
 .../tech/20160314 15 podcasts for FOSS fans   | 79 +++++++++++++++++++
 1 file changed, 79 insertions(+)
 create mode 100644 sources/tech/20160314 15 podcasts for FOSS fans

diff --git a/sources/tech/20160314 15 podcasts for FOSS fans b/sources/tech/20160314 15 podcasts for FOSS fans
new file mode 100644
index 0000000000..222861427e
--- /dev/null
+++ b/sources/tech/20160314 15 podcasts for FOSS fans	
@@ -0,0 +1,79 @@
+15 podcasts for FOSS fans
+=============================
+
+keyword : FOSS , podcast 
+
+![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/oss_podcasts.png?itok=3KwxsunX)
+
+I listen to a lot of podcasts. A lot. On my phone's podcatcher, I am subscribed to around 60 podcasts... and I think that only eight of those have podfaded (died). Unsurprisingly, a fairly sizeable proportion of those remaining alive-and-well subscriptions are shows with a specific interest or relevance to open source software. As I seek to resurrect my own comatose podcast from the nebulous realm of podfadery, I thought it would be great for us as a community to share what we're listening to.
+
+>Quick digression: I understand that there are a lot of "pod"-prefixed words in that first paragraph. Furthermore, I also know that the term itself is related to a proprietary device that, by most accounts, isn't even used for listening to these web-based audio broadcasts. However, the term 'webcast' died in the nineties and 'oggcast' never gathered a substantial foothold among the listening public. As such, in order to ensure that the most people actually know what I'm referring to, I'm essentially forced to use the web-anachronistic, but publicly recognized term, podcast.
+
+I should also mention that a number of these shows involve grown-ups using grown-up language (i.e. swearing). I've tried to indicate which shows these are by putting a red E next to their names, but please do your own due diligence if you're concerned about listening to these shows at work or with children around.
+
+The following lists are podcasts that I keep in heavy rotation (each sublist is listed in alphabetical order). In the first list are the ones I think of as my "general coverage" shows. They tend to either discuss general topics related to free and open source software, or they give a survey of multiple open source projects from one episode to the next.
+
+- [Bad Voltage][1] E — Regular contributor and community moderator here on Opensource.com, Jono Bacon, shares hosting dutes on this podcast with Jeremy Garcia, Stuart Langridge, and Bryan Lunduke, four friends with a variety of digressing and intersecting opinions. That's the most interesting part of the show for me. Of course, they also do product reviews and cover timely news relevant to free and open source software, but it's the banter that I stick around for.
+
+- [FLOSS Weekly][2] — The Twit network of podcasts is a long-time standby in technology broadcasts. Hosted by Randal Schwartz, FLOSS Weekly focuses on covering one open source project each week, typically by interviewing someone relevant in the development of that project. It's a really good show for getting exposed to new open source tools... or learning more about the programs you're already familiar with.
+
+- [Free as in Freedom][3] — Hosted by Bradley Kuhn and Karen Sandler, this show has a specific focus on legal and policy matters as it relates to both specific free and open source projects, as well as open culture in general. The show seems to have gone on a bit of a hiatus since its last episode in November of 2015, but I for one am immensely hopeful that Free as in Freedom emerges victoriously from its battle with being podfaded and returns to its regular bi-weekly schedule.
+
+- [GNU World Order][4] — I think that this show can be best descrbed as a free and open source variety show. Solo host, Klaatu, spends the majority of each show going in-depth at nearly tutorial level with a whole range of specific software tools and workflows. It's a really friendly way to get an open source neophyte up to speed with everything from understanding SSH to playing with digital painting and video. And there's a video component to the show, too, which certainly helps make some of these topics easier to follow.
+
+- [Hacker Public Radio][5] — This is just a well-executed version of a fantastic concept. Hacker Public Radio (HPR) is a community-run daily (well, working-week daily) podcast with a focus on "anything of interest to hackers." Sure there are wide swings in audio quality from show to show, but it's an open platform where anyone can share what they know (or what they think) in that topic space. Show topics include 3D printing, hardware hacking, conference interviews, and more. There are even long-running tutorial series and an audio book club. The monthly recap episodes are particularly useful if you're having trouble picking a place to start. And best of all, you can record your own episode and add it to the schedule. In fact, they actively encourage it.
+
+My next list of open source podcasts are a bit more specific to particular topics or software packages in the free and open source ecosystem.
+
+- [Blender Podcast][6] — Although this podcast is very specific to one particular application—Blender, in case you couldn't guess—many of the topics are relevant to issues faced by users and developers of open source other softrware programs. Hosts Thomas Dinges and Campbell Barton—both on the core development team for Blender—discuss the latest happenings in the Blender community, sometimes with a guest. The release schedule is a bit sporadic, but one of the things I really like about this particular show is the fact that they talk about both user issues and developer issues... and the various intersections of the two. It's a great way for each part of the community to gain insight from the other.
+
+- [Sunday Morning Linux Review][7] — As it's name indicates, SMLR offers a weekly review of topics relevant to Linux. Since around the end of last year, the show has seen a bit of a restructuring. However, that has not detracted from its quality. Tony Bemus, Mary Tomich, and Tom Lawrence deliver a lot of good information, and you can catch them recording their shows live through their website (if you happen to have free time on your Sundays).
+
+- [LinuxLUGcast][8] — The LinuxLUGcast is a community podcast that's really a recording of an online Linux Users Group (LUG) that meets on the first and third Friday of each month. The group meets (and records) via Mumble and discussions range from home builds with single-board computers like the Raspberry Pi to getting help with trying out a new distro. The LUG is open to everyone, but there is a rotating cast of regulars who've made themselves (and their IRC handles) recognizable fixtures on the show. (Full disclosure: I'm a regular on this one)
+
+- [The Open EdTech Podcast][9] — Thaj Sara's Open EdTech Podcast is a fairly new show that so far only has three episodes. However, since there's a really sizeable community of open source users in the field of education (both in teaching and in IT), this show serves an important and underserved segment of our community. I've spoken with Thaj via email and he assures me that new episodes are in the pipe. He just needs to set aside the time to edit them.
+
+- [The Linux Action Show][10] — It would be remiss of me to make a list of open source podcasts and not mention one of the stallwart fixtures in the space: The Linux Action Show. Chris Fisher and Noah Chelliah discuss current news as it pertains to Linux and open source topics while at the same time giving feature attention to specific projects or their own experiences using various open source tools.
+
+This next section is what I'm going to term my "honorable mention" section. These shows are either new or have a more tangential focus on open source software and culture. In any case, I still think readers of Opensource.com would enjoy listening to these shows.
+
+- [Blender Institute Podcast][11] — The Blender Institute—the more commercial creative production spin-off from the Blender Foundation—started hosting their own weekly podcast a few months ago. In the show, artists (and now a developer!) working at the Institute discuss the open content projects they're working on, answer questions about using Blender, and give great insight into how things go (or occasionally don't go) in their day-to-day work.
+
+- [Geek News Radio][12] E — There was a tangible sense of loss about a year ago when the hosts of Linux Outlaws hung up their mics. Well good news! A new show has sprung from its ashes. In episodes of Geek News Radio, Fab Scherschel and Dave Nicholas have a wider focus than Linux Outlaws did. Rather than being an actual news podcast, it's more akin to an informal discussion among friends about video games, movies, technology, and open source (of course).
+
+- [Geekrant][13] — Formerly known as the Everyday Linux Podcast, this show was rebranded at the start of the year to reflect kind of content that the hosts Mark Cockrell, Seth Anderson, and Chris Neves were already discussing. They do discuss open source software and culture, but they also give their own spin and opinions on topics of interest in general geek culture. Topics have a range that includes everything from popular media to network security. (P.S. Opensource.com content manager Jen Wike Huger was a guest on Episode 164.)
+
+- [Open Source Creative][14] E — In case you haven't read my little bio blurb, I also have my own podcast. In this show, I talk about news and topics that are [hopefully] of interest to artists and creatives who use free and open source tools. I record it during my work commute so episode length varies with traffic, and I haven't quite figured out a good way to do interviews safely, but if you listen while you're on your way to work, it'll be like we're carpooling. The show has been on a bit of hiatus for almost a year, but I've commited to making sure it comes back... and soon.
+
+- [Still Untitled][15] E — As you may have noticed from most of the selections on this list, I tend to lean toward the indie side of the spectrum, preferring to listen to shows by people with less of a "name." That said, this show really hits a good place for me. Hosts Adam Savage, Norman Chan, and Will Smith talk about all manner of interesting and geeky things. From Adam's adventures with Mythbusters to maker builds and book reviews, there's rarely ever a show that hasn't been fun for me to listen to.
+
+So there you go! I'm always looking for more interesting shows to listen to on my commute (as I'm sure many others are). What suggestions or recommendations do you have?
+
+
+
+--------------------------------------------------------------------------------
+
+via: https://opensource.com/life/16/3/open-source-podcasts
+
+作者:[Jason van Gumster][a]
+译者:[译者ID](https://github.com/译者ID)
+校对:[校对者ID](https://github.com/校对者ID)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]: https://opensource.com/users/jason-van-gumster
+[1]: http://badvoltage.org/
+[2]: https://twit.tv/shows/floss-weekly
+[3]: http://faif.us/
+[4]: http://gnuworldorder.info/
+[5]: http://hackerpublicradio.org/
+[6]: https://blender-podcast.org/
+[7]: http://smlr.us/
+[8]: http://linuxlugcast.com/
+[9]: http://openedtechpodcast.com/
+[10]: http://www.jupiterbroadcasting.com/tag/linux-action-show/
+[11]: http://podcast.blender.institute/
+[12]: http://sixgun.org/geeknewsradio
+[13]: http://elementopie.com/geekrant-episodes
+[14]: http://monsterjavaguns.com/podcast
+[15]: http://www.tested.com/still-untitled-the-adam-savage-project/

From 54449508830639e7b6258cf20deff02f696c5d26 Mon Sep 17 00:00:00 2001
From: zpl 
Date: Tue, 15 Mar 2016 10:39:06 +0800
Subject: [PATCH 0525/1469] [translated] 20151202 A new Mindcraft moment.md

---
 .../tech/20151202 A new Mindcraft moment.md   | 87 +++++++++----------
 1 file changed, 43 insertions(+), 44 deletions(-)

diff --git a/sources/tech/20151202 A new Mindcraft moment.md b/sources/tech/20151202 A new Mindcraft moment.md
index 92c645ea4b..808124dec2 100644
--- a/sources/tech/20151202 A new Mindcraft moment.md	
+++ b/sources/tech/20151202 A new Mindcraft moment.md	
@@ -1,44 +1,43 @@
-zpl1025
-A new Mindcraft moment?
-=======================
-
-Credit:Jonathan Corbet
-
-It is not often that Linux kernel development attracts the attention of a mainstream newspaper like The Washington Post; lengthy features on the kernel community's approach to security are even more uncommon. So when just such a feature hit the net, it attracted a lot of attention. This article has gotten mixed reactions, with many seeing it as a direct attack on Linux. The motivations behind the article are hard to know, but history suggests that we may look back on it as having given us a much-needed push in a direction we should have been going for some time.
-
-Think back, a moment, to the dim and distant past — April 1999, to be specific. An analyst company named Mindcraft issued a report showing that Windows NT greatly outperformed Red Hat Linux 5.2 and Apache for web-server workloads. The outcry from the Linux community, including from a very young LWN, was swift and strong. The report was a piece of Microsoft-funded FUD trying to cut off an emerging threat to its world-domination plans. The Linux system had been deliberately configured for poor performance. The hardware chosen was not well supported by Linux at the time. And so on.
-
-Once people calmed down a bit, though, one other fact came clear: the Mindcraft folks, whatever their motivations, had a point. Linux did, indeed, have performance problems that were reasonably well understood even at the time. The community then did what it does best: we sat down and fixed the problems. The scheduler got exclusive wakeups, for example, to put an end to thethundering-herd problem in the acceptance of connection requests. Numerous other little problems were fixed. Within a year or so, the kernel's performance on this kind of workload had improved considerably.
-
-The Mindcraft report, in other words, was a much-needed kick in the rear that got the community to deal with issues that had been neglected until then.
-
-The Washington Post article seems clearly slanted toward a negative view of the Linux kernel and its contributors. It freely mixes kernel problems with other issues (the AshleyMadison.com breakin, for example) that were not kernel vulnerabilities at all. The fact that vendors seem to have little interest in getting security fixes to their customers is danced around like a huge elephant in the room. There are rumors of dark forces that drove the article in the hopes of taking Linux down a notch. All of this could well be true, but it should not be allowed to overshadow the simple fact that the article has a valid point.
-
-We do a reasonable job of finding and fixing bugs. Problems, whether they are security-related or not, are patched quickly, and the stable-update mechanism makes those patches available to kernel users. Compared to a lot of programs out there (free and proprietary alike), the kernel is quite well supported. But pointing at our ability to fix bugs is missing a crucial point: fixing security bugs is, in the end, a game of whack-a-mole. There will always be more moles, some of which we will not know about (and will thus be unable to whack) for a long time after they are discovered and exploited by attackers. These bugs leave our users vulnerable, even if the commercial side of Linux did a perfect job of getting fixes to users — which it decidedly does not.
-
-The point that developers concerned about security have been trying to make for a while is that fixing bugs is not enough. We must instead realize that we will never fix them all and focus on making bugs harder to exploit. That means restricting access to information about the kernel, making it impossible for the kernel to execute code in user-space memory, instrumenting the kernel to detect integer overflows, and all the other things laid out in Kees Cook's Kernel Summit talk at the end of October. Many of these techniques are well understood and have been adopted by other operating systems; others will require innovation on our part. But, if we want to adequately defend our users from attackers, these changes need to be made.
-
-Why hasn't the kernel adopted these technologies already? The Washington Post article puts the blame firmly on the development community, and on Linus Torvalds in particular. The culture of the kernel community prioritizes performance and functionality over security and is unwilling to make compromises if they are needed to improve the security of the kernel. There is some truth to this claim; the good news is that attitudes appear to be shifting as the scope of the problem becomes clear. Kees's talk was well received, and it clearly got developers thinking and talking about the issues.
-
-The point that has been missed is that we do not just have a case of Linus fending off useful security patches. There simply are not many such patches circulating in the kernel community. In particular, the few developers who are working in this area have never made a serious attempt to get that work integrated upstream. Getting any large, intrusive patch set merged requires working with the kernel community, making the case for the changes, splitting the changes into reviewable pieces, dealing with review comments, and so on. It can be tiresome and frustrating, but it's how the kernel works, and it clearly results in a more generally useful, more maintainable kernel in the long run.
-
-Almost nobody is doing that work to get new security technologies into the kernel. One might cite a "chilling effect" from the hostile reaction such patches can receive, but that is an inadequate answer: developers have managed to merge many changes over the years despite a difficult initial reaction. Few security developers are even trying.
-
-Why aren't they trying? One fairly obvious answer is that almost nobody is being paid to try. Almost all of the work going into the kernel is done by paid developers and has been for many years. The areas that companies see fit to support get a lot of work and are well advanced in the kernel. The areas that companies think are not their problem are rather less so. The difficulties in getting support for realtime development are a clear case in point. Other areas, such as documentation, tend to languish as well. Security is clearly one of those areas. There are a lot of reasons why Linux lags behind in defensive security technologies, but one of the key ones is that the companies making money on Linux have not prioritized the development and integration of those technologies.
-
-There are signs that things might be changing a bit. More developers are showing interest in security-related issues, though commercial support for their work is still less than it should be. The reaction against security-related changes might be less knee-jerk negative than it used to be. Efforts like the Kernel Self Protection Project are starting to work on integrating existing security technologies into the kernel.
-
-We have a long way to go, but, with some support and the right mindset, a lot of progress can be made in a short time. The kernel community can do amazing things when it sets its mind to it. With luck, the Washington Post article will help to provide the needed impetus for that sort of setting of mind. History suggests that we will eventually see this moment as a turning point, when we were finally embarrassed into doing work that has clearly needed doing for a while. Linux should not have a substandard security story for much longer.
-
----------------------------
-
-via: https://lwn.net/Articles/663474/
-
-作者:Jonathan Corbet
-
-译者:[译者ID](https://github.com/译者ID)
-
-校对:[校对者ID](https://github.com/校对者ID)
-
-
-本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
+又一次 Mindcraft 事件?
+=======================
+
+感谢:Jonathan Corbet
+
+Linux 内核开发很少吸引像华盛顿邮报这样主流媒体的关注,内核社区在安全方面进展的冗长功能列表就更少人看了。所以当这样一个功能发布到网上,就吸引了很多人的注意。关于这篇文章有不同的反应,很多人认为这是对 Linux 直接的攻击。文章背后的动机很难知道,但是从历史经验来看,它也可以看作对我们早就该前进的方向的一次非常必要的推动。
+
+回顾一次在昏暗遥远过去的事件 - 确切地说是 1999 年 4 月。一家叫 Mindcraft 的分析公司发布了一份报告显示 Windows NT 在服务器开销方面完胜 Red Hat Linux 5.2 加 Apache。Linux 社区,包括当时还很年轻的 LWN,的反应很迅速而且强烈。这份报告是微软资助的 FUD 的一部分,用来消除那些全球垄断计划的新兴威胁。报告指出,Linux 系统有意配置成低性能,Linux 不支持当时的很多硬件,等等。
+
+在大家稍微冷静一点后,尽管如此,事实很明显:Mindcraft 的人,不管什么动机,说的也有道理。当时 Linux 确实在性能方面存在一些已经被充分认识到的问题。然后社区做了最正确的事情:我们坐下来解决问题。比如,单独唤醒的调度器可以终结接受连接请求时的惊群问题。其他很多小问题也都解决了。在差不多一年里,内核在这类开销方面的性能已经有了非常大的改善。
+
+这份 Mindcraft 的报告,某种意义上来说,往 Linux 背后踢了很有必要的一脚,推动整个社区去处理一些当时被忽略的事情。
+
+华盛顿邮报的文章明显在鄙视 Linux 内核以及它的贡献者。它随意地混淆了内核问题和其他根本不是内核脆弱性引起的问题(比如,AshleyMadison.com 被黑)。不过供应商没什么兴趣为他们的客户提供安全补丁的事实,就像一头巨象在房间里跳舞一样明显。还有谣言说这篇文章后面的黑暗势力希望打击一下 Linux 的势头。这些也许都是真的,但是也不能掩盖一个简单的事实,就是文章说的确实是真的。
+
+我们会合理地测试并解决问题。而问题,不管是不是安全相关,能很快得到修复,然后再通过稳定更新的机制将这些补丁发布给内核用户。比起外面很多应用程序(免费的和付费的),内核的支持非常好。但是指责我们解决问题的能力时却遗漏了关键的一点:解决安全问题最终是一个打鼹鼠游戏。总是会出来更多的鼹鼠,其中有一些在攻击者发现并利用后很长时间我们都还不知道(所以没法使劲打下去)。尽管商业 Linux 已经非常努力地在将补丁传递给用户,这种问题还是会让我们的用户很受伤 - 只是这并不是故意的。
+
+关键是只是解决问题并不够,一些关心安全性的开发者也已经开始尝试。我们必须认识到,问题永远都解不完,所以要让问题更难被发现和利用。意思就是限制访问内核信息,绝对不允许内核执行用户空间内存的指令,指示内核侦测整数溢出,以及 Kee Cook 在十月底内核峰会的讲话中所提出的其他所有事情。其中许多技术被其他操作系统深刻理解并采用了;它们的创新也有我们的功劳。但是,如果我们想充分保护我们的用户免受攻击,这些改变是必须要做的。
+
+为什么内核还没有引入这些技术?华盛顿邮报的文章坚定地指责开发社区,特别是 Linus Torvalds。内核社区的传统就是相对安全性更侧重于性能和功能,在需要牺牲性能来改善内核安全性时并不愿意折中处理。这些指责一定程度上是对的;好的一面是,因为问题的范围变得清晰,态度看上去有点改善。Kee 的演讲都听进去了,而且很明显让开发者开始思考和讨论这些问题。
+
+而被忽略的一点是,并不仅仅是 Linus 在拒绝有用的安全补丁。而是就没有多少这种补丁在内核社区里流传。特别是,在这个领域工作的开发者就那么些人,而且从没有认真地尝试把自己的工作合并到上游。要合并任何大的侵入性补丁,需要和内核社区一起工作,为改动编写用例,将改动分割成方便审核的碎片,处理审核意见,等等。整个过程可能会有点无聊而且让人沮丧,但这却是内核维护的运作方式,而且很明显只有这样才能在长时间的开发中形成更有用更可维护的内核。 
+
+几乎没有人会走这个流程来将最新的安全技术引入内核。对于这类补丁可能收到的不利反应,有人觉得也许会导致“寒蝉效应”,但是这个说法并不充分:不管最初的反应有多麻烦,多年以来开发者已经合并了大量的改动。而少数安全开发者连试都没试过。
+
+他们为什么不愿意尝试?一个比较明显的答案是,几乎没有人会因此拿到报酬。几乎所有引入内核的工作都由付费开发者完成,而且已经持续多年。公司能看到利润的领域在内核里都有大量的工作以及很好的进展。而公司觉得和它们没关系的领域就不会这样了。为实时开发找到赞助支持的困难就是很明显的例子。其他领域,比如文档,也在慢慢萧条。安全性很明显也属于这类领域。可能有很多原因导致 Linux 落后于防御式安全技术,但是其中最关键的一条是,靠 Linux 赚钱的公司没有重视这些技术的开发和应用。
+
+有迹象显示局面已有所转变。越来越多的开发人员开始关注安全相关问题,尽管对他们工作的商业支持还仍然不够。对于安全相关的改变已经没有之前那样的下意识反应了。像内核自我保护项目这样,已经开始把现存的安全技术集成进入内核了。
+
+我们还有很长的路要走,但是,如果能有一些支持以及正确的思想,短期内能有很大的进展。内核社区在确定了自己的想法后可以做到很让人惊叹的事情。幸运的是,华盛顿邮报的文章将有助于提供形成这种想法的必要动力。在历史的角度上,我们很可能会把这次事件看作一个转折点,我们最终被倒逼着去完成之前很明确需要做的事情。Linux 不应该再继续讲述这个安全不合格的故事了。
+
+---------------------------
+
+via: https://lwn.net/Articles/663474/
+
+作者:Jonathan Corbet
+
+译者:[zpl1025](https://github.com/zpl1025)
+
+校对:[校对者ID](https://github.com/校对者ID)
+
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

From 93fa61462f5be9c3f86de81b7bcd5a33d5cfd5ad Mon Sep 17 00:00:00 2001
From: Ezio 
Date: Tue, 15 Mar 2016 16:23:00 +0800
Subject: [PATCH 0526/1469] =?UTF-8?q?20160314-2=20=E9=80=89=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

keyword: Node.js , opensource , project management  , software
---
 sources/tech/20160314 Healthy Open Source.md | 212 +++++++++++++++++++
 1 file changed, 212 insertions(+)
 create mode 100644 sources/tech/20160314 Healthy Open Source.md

diff --git a/sources/tech/20160314 Healthy Open Source.md b/sources/tech/20160314 Healthy Open Source.md
new file mode 100644
index 0000000000..b36b516758
--- /dev/null
+++ b/sources/tech/20160314 Healthy Open Source.md	
@@ -0,0 +1,212 @@
+Healthy Open Source
+============================
+
+keyword: Node.js , opensource , project management , software
+
+*A walkthrough of the Node.js Foundation’s base contribution policy*.
+
+A lot has changed since io.js and Node.js merged under the Node.js Foundation. The most impressive change, and probably the change that is most relevant to the rest of the community and to open source in general, is the growth in contributors and committers to the project.
+
+A few years ago, Node.js had just a few committers (contributors with write access to the repository in order to merge code and triage bugs). The maintenance overhead for the few committers on Node.js Core was overwhelming and the project began to see a decline in both committers and outside contribution. This resulted in a corresponding decline in releases.
+
+Today, the Node.js project is divided into many components with a full org size of well over 400 members. Node.js Core now has over 50 committers and over 100 contributors per month.
+
+Through this growth we’ve found many tools that help scale the human infrastructure around an Open Source project. We also identified a few core values we believe are fundamental to modern Open Source: transparency, participation, and efficacy. As we continue to scale the way we do Open Source we try to find a balance of these values and adapt the practices we find help to fit the needs of each component of the Node.js project.
+
+Now that Node.js is in a good place, the foundation is looking to promote this kind of sustainability in the ecosystem. Part of this is a new umbrella for additional projects to enter the foundation, of which [Express was recently admitted][1], and the creation of this new contribution policy.
+
+This contribution policy is not universal. It’s meant as a starting point. Additions and alterations to this policy are encouraged so that the process used by each project fits its needs and can continue to change shape as the project grows and faces new challenges.
+
+The [current version][2] is hosted in the Node.js Foundation. We expect to iterate on this over time and encourage people to [log issues][3] with questions and feedback regarding the policy for future iterations.
+
+This document describes a very simple process suitable for most projects in the Node.js ecosystem. Projects are encouraged to adopt this whether they are hosted in the Node.js Foundation or not.
+
+The Node.js project is organized into over a hundred repositories and a few dozen Working Groups. There are large variations in contribution policy between many of these components because each one has different constraints. This document is a minimalist version of the processes and philosophy we’ve found works best everywhere.
+
+We believe that contributors should own their projects, and that includes contribution policies like this. While new foundation projects start with this policy we expect many of them to alter it or possibly diverge from it entirely to suite their own specific needs.
+
+The goal of this document is to create a contribution process that:
+
+* Encourages new contributions.
+
+* Encourages contributors to remain involved.
+
+* Avoids unnecessary processes and bureaucracy whenever possible.
+
+* Creates a transparent decision making process which makes it clear how contributors can be involved in decision making.
+
+Most contribution processes are created by maintainers who feel overwhelmed by outside contributions. These documents have traditionally been about processes that make life easier for a small group of maintainers, often at the cost of attracting new contributors.
+
+We’ve gone the opposite direction. The purpose of this policy is to gain contributors, to retain them as much as possible, and to use a much larger and growing contributor base to manage the corresponding influx of contributions.
+
+As projects mature, there’s a tendency to become top heavy and overly hierarchical as a means of quality control and this is enforced through process. We use process to add transparency that encourages participation which grows the code review pool which leads to better quality control.
+
+This document is based on much prior art in the Node.js community, io.js, and the Node.js project.
+
+This document is based on what we’ve learned growing the Node.js project. Not just the core project, which has been a massive undertaking, but also much smaller sub-projects like the website which have very different needs and, as a result, very different processes.
+
+When we began these reforms in the Node.js project, we were taking a lot of inspiration from the broader Node.js ecosystem. In particular, Rod Vagg’s [OPEN Open Source policy][4]. Rod’s work in levelup and nan is the basis for what we now call “liberal contribution policies.”
+
+### Vocabulary
+
+* A **Contributor** is any individual creating or commenting on an issue or pull request.
+
+* A **Committer** is a subset of contributors who have been given write access to the repository.
+
+* A **TC (Technical Committee)** is a group of committers representing the required technical expertise to resolve rare disputes.
+
+Every person who shows up to comment on an issue or submit code is a member of a project’s community. Just being able to see them means that they have crossed the line from being a user to being a contributor.
+
+Typically open source projects have had a single distinction for those that have write access to the repository and those empowered with decision making. We’ve found this to be inadequate and have separated this into two distinctions which we’ll dive into more a bit later.
+
+![](https://www.linux.com/images/stories/66866/healthy_1.png)
+
+healthy 1Looking at the community in and around a project as a bunch of concentric circles helps to visualize this.
+
+In the outermost circle are users, a subset of those users are contributors, a subset of contributors become committers who can merge code and triage issues. Finally, a smaller group of trusted experts who only get pulled in to the hard problems and can act as a tie-breaker in disputes.
+
+This is what a healthy project should look like. As the demands on the project from increased users rise, so do the contributors, and as contributors increase more are converted into committers. As the committer base grows, more of them rise to the level of expertise where they should be involved in higher level decision making.
+
+![](https://www.linux.com/images/stories/66866/healthy-2.png)
+
+If these groups don’t grow in proportion to each other they can’t carry the load imposed on them by outward growth. A project’s ability to convert people from each of these groups is the only way it can stay healthy if its user base is growing.
+
+This is what unhealthy projects look like in their earliest stages of dysfunction, but imagine that the committers bubble is so small you can’t actually read the word “committers” in it, and imagine this is a logarithmic scale.
+
+healthy-2A massive user base is pushing a lot of contributions onto a very small number of maintainers.
+
+This is when maintainers build processes and barriers to new contributions as a means to manage the workload. Often the problems the project is facing will be attributed to the tools the project is using, especially GitHub.
+
+In Node.js we had all the same problems, resolved them without a change in tooling, and today manage a growing workload much larger than most projects, and GitHub has not been a bottleneck.
+
+We know what happens to unhealthy projects over a long enough time period, more maintainers leave, contributions eventually fall, and **if we’re lucky** users leave it. When we aren’t so lucky adoption continues and years later we’re plagued with security and stability issues in widely adopt software that can’t be effectively maintained.
+
+The number of users a project has is a poor indicator of the health of the project, often it is the most used software that suffers the biggest contribution crisis.
+
+### Logging
+
+Log an issue for any question or problem you might have. When in doubt, log an issue, any additional policies about what to include will be provided in the responses. The only exception is security disclosures which should be sent privately.
+
+The first sentence is surprisingly controversial. A lot of maintainers complain that there isn’t a more heavy handed way of forcing people to read a document before they log an issue on GitHub. We have documents all over projects in the Node.js Foundation about writing good bug reports but, first and foremost, we encourage people to log something and try to avoid putting barriers in the way of that.
+
+Sure, we get bad bugs, but we have a ton of contributors who can immediately work with people who log them to educate them on better practices and treat it as an opportunity to educate. This is why we have documentation on writing good bugs, in order to educate contributors, not as a barrier to entry.
+
+Creating barriers to entry just reduces the number of people there’s a chance to identify, educate and potentially grow into greater contributors.
+
+Of course, never log a public issue about a security disclosure, ever. This is a bit vague about the best private venue because we can’t determine that for every project that adopts this policy, but we’re working on a responsible disclosure mechanism for the broader community (stay tuned).
+
+Committers may direct you to another repository, ask for additional clarifications, and add appropriate metadata before the issue is addressed.
+
+For smaller projects this isn’t a big deal but in Node.js we’ve had to continually break off work into other, more specific, repositories just to keep the volume on a single repo manageable. But all anyone has to do when someone puts something in the wrong place is direct them to the right one.
+
+Another benefit of growing the committer base is that there’s more people to deal with little things, like redirecting issues to other repos, or adding metadata to issues and PRs. This allows developers who are more specialized to focus on just a narrow subset of work rather than triaging issues.
+
+Please be courteous, respectful, and every participant is expected to follow the project’s Code of Conduct.
+
+One thing that can burn out a project is when people show up with a lot of hostility and entitlement. Most of the time this sentiment comes from a feeling that their input isn’t valued. No matter what, a few people will show up who are used to more hostile environments and it’s good to have these kinds of expectations explicit and written down.
+
+And each project should have a Code of Conduct, which is an extension of these expectations that makes people feel safe and respected.
+
+### Contributions
+
+Any change to resources in this repository must be through pull requests. This applies to all changes to documentation, code, binary files, etc. Even long term committers and TC members must use pull requests.
+
+No pull request can be merged without being reviewed.
+
+Every change needs to be a pull request.
+
+A Pull Request captures the entire discussion and review of a change. Allowing some subset of committers to slip things in without a Pull Request gives the impression to potential contributors that they they can’t be involved in the project because they don’t have access to a behind the scenes process or culture.
+
+This isn’t just a good practice, it’s a necessity in order to be transparent enough to attract new contributors.
+
+For non-trivial contributions, pull requests should sit for at least 36 hours to ensure that contributors in other timezones have time to review. Consideration should also be given to weekends and other holiday periods to ensure active committers all have reasonable time to become involved in the discussion and review process if they wish.
+
+Part of being open and inviting to more contributors is making the process accessible to people in timezones all over the world. We don’t want to add an artificial delay in small doc changes but for any change that needs a bit of consideration needs to give people in different parts of the world time to consider it.
+
+In Node.js we actually have an even longer timeline than this, 48 hours on weekdays and 72 on weekends. That might be too much for smaller projects so it is shorter in this base policy but as a project grows it may want to increase this as well.
+
+The default for each contribution is that it is accepted once no committer has an objection. During review committers may also request that a specific contributor who is most versed in a particular area gives a “LGTM” before the PR can be merged. There is no additional “sign off” process for contributions to land. Once all issues brought by committers are addressed it can be landed by any committer.
+
+A key part of the liberal contribution policies we’ve been building is an inversion of the typical code review process. Rather than the default mode for a change to be rejected until enough people sign off, we make the default for every change to land. This puts the onus on reviewers to note exactly what adjustments need to be made in order for it to land.
+
+For new contributors it’s a big leap just to get that initial code up and sent. Viewing the code review process as a series of small adjustments and education, rather than a quality control hierarchy, does a lot to encourage and retain these new contributors.
+
+It’s important not to build processes that encourage a project to be too top heavy, with a few people needing to sign off on every change. Instead, we just mention any committer than we think should weigh in on a specific review. In Node.js we have people who are the experts on OpenSSL, any change to crypto is going to need a LGTM from them. This kind of expertise forms naturally as a project grows and this is a good way to work with it without burning people out.
+
+In the case of an objection being raised in a pull request by another committer, all involved committers should seek to arrive at a consensus by way of addressing concerns being expressed by discussion, compromise on the proposed change, or withdrawal of the proposed change.
+
+This is what we call a lazy consensus seeking process. Most review comments and adjustments are uncontroversial and the process should optimize for getting them in without unnecessary process. When there is disagreement, try to reach an easy consensus among the committers. More than 90% of the time this is simple, easy and obvious.
+
+If a contribution is controversial and committers cannot agree about how to get it to land or if it should land then it should be escalated to the TC. TC members should regularly discuss pending contributions in order to find a resolution. It is expected that only a small minority of issues be brought to the TC for resolution and that discussion and compromise among committers be the default resolution mechanism.
+
+For the minority of changes that are controversial and don’t reach an easy consensus we escalate that to the TC. These are rare but when they do happen it’s good to reach a resolution quickly rather than letting things fester. Contentious issues tend to get a lot of attention, especially by those more casually involved in the project or even entirely outside of it, but they account for a relatively small amount of what the project does every day.
+
+### Becoming a Committer
+
+All contributors who land a non-trivial contribution should be on-boarded in a timely manner, and added as a committer, and be given write access to the repository.
+
+This is where we diverge sharply from open source tradition.
+
+Projects have historically guarded commit rights to their version control system. This made a lot of sense when we were using version control systems like subversion. A single contributor can inadvertently mess up a project pretty badly in older version control systems, but not so much in git. In git, there isn’t a lot that can’t be fixed and so most of the quality controls we put on guarding access are no longer necessary.
+
+Not every committer has the rights to release or make high level decisions, so we can be much more liberal about giving out commit rights. That increases the committer base for code review and bug triage. As a wider range of expertise in the committer pool smaller changes are reviewed and adjusted without the intervention of the more technical contributors, who can spend their time on reviews only they can do.
+
+This is they key to scaling contribution growth: committer growth.
+
+Committers are expected to follow this policy and continue to send pull requests, go through proper review, and have other committers merge their pull requests.
+
+This part is entirely redundant, but on purpose. Just a reminder even once someone is a committer their changes still flow through the same process they followed before.
+
+### TC Process
+
+The TC uses a “consensus seeking” process for issues that are escalated to the TC. The group tries to find a resolution that has no open objections among TC members. If a consensus cannot be reached that has no objections then a majority wins vote is called. It is also expected that the majority of decisions made by the TC are via a consensus seeking process and that voting is only used as a last-resort.
+
+The best solution tends to be the one everyone can agree to so you would think that consensus systems would be the norm. However, **pure consensus** systems incentivize obstructionism which we need to avoid.
+
+In pure consensus everyone essentially has a veto. So, if I don’t want something to happen I’m in a strong position of power over everyone that wants something to happen. They have to convince me, and I don’t have to convince anyone else of anything.
+
+To avoid this we use a system called “consensus seeking” which has a long history outside of open source. It’s quite simple, just attempt to reach a consensus, if a consensus can’t be reached then call for a majority wins vote.
+
+Just the fact that a vote **is a possibility** means that people can’t be obstructionists, whether someone favor a change or not, they have to convince their peers and if they aren’t willing to put in the work to convince their peers then they probably don’t involve themselves in that decision at all.
+
+The way these incentives play out is pretty impressive. We started using this process in io.js and adopted it in Node.js when we merged into the foundation. In that entire time we’ve never actually had to call for a vote, just the fact that we could is enough to keep everyone working together to find a solution and move forward.
+
+Resolution may involve returning the issue to committers with suggestions on how to move forward towards a consensus. It is not expected that a meeting of the TC will resolve all issues on its agenda during that meeting and may prefer to continue the discussion happening among the committers.
+
+A TC tries to resolve things in a timely manner so that people can make progress but often it’s better to provide some additional guidance that pushes the greater contributorship towards resolution without being heavy handed.
+
+Avoid creating big decision hierarchies. Instead, invest in a broad, growing and empowered contributorship that can make progress without intervention. We need to view a constant need for intervention by a few people to make any and every tough decision as the biggest obstacle to healthy Open Source.
+
+Members can be added to the TC at any time. Any committer can nominate another committer to the TC and the TC uses its standard consensus seeking process to evaluate whether or not to add this new member. Members who do not participate consistently at the level of a majority of the other members are expected to resign.
+
+The TC just uses the same consensus seeking process for adding new members as it uses for everything else.
+
+It’s a good idea to encourage committers to nominate people to the TC and not just wait around for TC members to notice the impact some people are having. Listening to the broader committers about who they see as having a big impact keeps the TC’s perspective inline with the rest of the project.
+
+As a project grows it’s important to add people from a variety of skill sets. If people are doing a lot of docs work, or test work, treat the investment they are making as equally valuable as the hard technical stuff.
+
+Projects should have the same ladder, user -> contributor -> commiters -> TC member, for every skill set they want to build into the project to keep it healthy.
+
+I often see long time maintainers worry about adding people who don’t understand every part of the project, as if they have to be involved in every decision. The reality is that people do know their limitations and want to defer hard decisions to people they know have more experience.
+
+Thanks to Greg [Wallace][5] and ashley [williams][6].
+
+--------------------------------------------------------------------------------
+
+via: https://www.linux.com/news/biz-os/governance/892141-healthy-open-source
+
+作者:[Mikeal Rogers][a]
+译者:[译者ID](https://github.com/译者ID)
+校对:[校对者ID](https://github.com/校对者ID)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:https://www.linux.com/community/forums/person/66928
+
+
+[1]: https://medium.com/@nodejs/node-js-foundation-to-add-express-as-an-incubator-project-225fa3008f70#.mc30mvj4m
+[2]: https://github.com/nodejs/TSC/blob/master/BasePolicies/CONTRIBUTING.md
+[3]: https://github.com/nodejs/TSC/issues
+[4]: https://github.com/Level/community/blob/master/CONTRIBUTING.md
+[5]: https://medium.com/@gtewallaceLF
+[6]: https://medium.com/@ag_dubs

From 5f72154fcf34e3b3d25a30da8873ff004f6cffad Mon Sep 17 00:00:00 2001
From: wxy 
Date: Wed, 16 Mar 2016 07:07:29 +0800
Subject: [PATCH 0527/1469] PUB:20151020 18 Years of GNOME Design and Software
 Evolution--Step by Step
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

@HaohongWANG 用心了~
---
 ...gn and Software Evolution--Step by Step.md | 200 ++++++++++++++++++
 ...gn and Software Evolution--Step by Step.md | 200 ------------------
 2 files changed, 200 insertions(+), 200 deletions(-)
 create mode 100644 published/20151020 18 Years of GNOME Design and Software Evolution--Step by Step.md
 delete mode 100644 translated/talk/20151020 18 Years of GNOME Design and Software Evolution--Step by Step.md

diff --git a/published/20151020 18 Years of GNOME Design and Software Evolution--Step by Step.md b/published/20151020 18 Years of GNOME Design and Software Evolution--Step by Step.md
new file mode 100644
index 0000000000..6c579e0d5f
--- /dev/null
+++ b/published/20151020 18 Years of GNOME Design and Software Evolution--Step by Step.md	
@@ -0,0 +1,200 @@
+
+一步一脚印:GNOME十八年进化史
+================================================================================
+注:youtube 视频
+
+
+[GNOME][1] (GNU Object Model Environment)由两位墨西哥的程序员 Miguel de Icaza 和 Federico Mena 始创于1997年8月15日。GNOME 自由软件计划由志愿者和全职开发者来开发一个桌面环境及其应用程序。GNOME 桌面环境的所有部分都由开源软件组成,并且支持Linux, FreeBSD, OpenBSD 等操作系统。
+
+现在就让我穿越到1997年来看看 GNOME 的第一个版本:
+
+### GNOME 1 ###
+
+![GNOME 1.0 - GNOME 发布的第一个重大版本](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/1.0/gnome.png)
+
+*GNOME 1.0 (1997) – GNOME 发布的第一个重大版本*
+
+![GNOME 1.2 Bongo](https://raw.githubusercontent.com/paulcarroty/Articles/master/GNOME_History/1.2/1361441938.or.86429.png)
+
+*GNOME 1.2 “Bongo”,2000*
+
+![GNOME 1.4 Tranquility](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/1.4/1.png)
+
+*GNOME 1.4 “Tranquility”, 2001*
+
+### GNOME 2 ###
+
+![GNOME 2.0](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.0/1.png)
+
+*GNOME 2.0, 2002*
+
+重大更新,基于 GTK+ 2。引入了人机界面指南(Human Interface Guidelines)。
+
+![GNOME 2.2](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.2/GNOME_2.2_catala.png)
+
+*GNOME 2.2 2003*
+
+改进了多媒体和文件管理器。
+
+![GNOME 2.4 Temujin](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.4/gnome-desktop.png)
+
+*GNOME 2.4 “Temujin”, 2003*
+
+首次发布 Epiphany 浏览器,增添了辅助功能(accessibility)。
+
+![GNOME 2.6](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.6/Adam_Hooper.png)
+
+*GNOME 2.6, 2004*
+
+Nautilus 成为主要的文件管理工具,同时引入了新的 GTK+ 对话框。作为对这个版本中变化的结果,创建了一个存在时间不久的分叉版本:GoneME。
+
+![GNOME 2.8](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.8/3.png)
+
+*GNOME 2.8, 2004*
+
+改良了对可移动设备的支持,并新增了 Evolution 邮件应用。
+
+![GNOME 2.10](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.10/GNOME-Screenshot-2.10-FC4.png)
+
+*GNOME 2.10, 2005*
+
+减小了内存需求和提升了性能。增加了新的面板小应用(调制解调器控制、磁盘挂载器和回收站组件)以及 Totem 影片播放器和 Sound Juicer CD抓取工具。
+
+![GNOME 2.12](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.12/gnome-livecd.jpg)
+
+*GNOME 2.12, 2005*
+
+改进了 Nautilus,改进了应用程序间的剪切/粘贴功能和 freedesktop.org 的整合。 新增 Evince PDF 阅读器;新默认主题 Clearlooks;菜单编辑器、钥匙环管理器和管理员工具。基于 GTK+2.8,支持 Cairo。
+
+![GNOME 2.14](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.14/debian4-stable.jpg)
+
+*GNOME 2.14, 2006*
+
+性能提升(某些情况下超过 100%);增强用户界面的易用性;GStreamer 0.10 多媒体框架。增加了 Ekiga 视频会议应用、Deskbar 搜索工具、Pessulus 权限管理器、快速切换用户功能和 Sabayon 系统管理员工具。
+
+![GNOME 2.16](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.16/Gnome-2.16-screenshot.png)
+
+*GNOME 2.16, 2006*
+
+性能提升。增加了 Tomboy 笔记应用、Baobab 磁盘用量分析应用、Orca 屏幕阅读器以及 GNOME 电源管理程序(延长了笔记本电池寿命)。改进了 Totem、Nautilus。Metacity 窗口管理器的合成(compositing)支持。新的图标主题。基于 GTK+ 2.0 的全新打印对话框。
+
+![GNOME 2.18](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.18/Gnome-2.18.1.png)
+
+*GNOME 2.18, 2007*
+
+性能提升。增加了 Seahorse GPG 安全应用,可以对邮件和本地文件进行加密。Baobab 改进了环状图表显示方式的支持。Orca 屏幕阅读器。改进了 Evince、Epiphany、GNOME 电源管理、音量控制。增加了两款新游戏:GNOME 数独和 glChess 国际象棋。支持 MP3 和 AAC 音频解码。
+
+![GNOME 2.20](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.20/rnintroduction-screenshot.png)
+
+*GNOME 2.20, 2007*
+
+发布十周年版本。Evolution 增加了备份功能。改进了 Epiphany、EOG、GNOME 电源管理。Seahorse 中的钥匙环密码管理功能。增加:在 Evince 中可以编辑PDF文档、文件管理界面中整合了搜索模块、自动安装多媒体解码器。
+
+![GNOME 2.22, 2008](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.22/GNOME-2-22-2-Released-2.png)
+
+*GNOME 2.22, 2008*
+
+新增 Cheese 应用,它是一个可以截取网络摄像头和远程桌面图像的工具。Metacity 支持基本的窗口合成(compositing)。引入 GVFS(LCTT译注:GNOME Virtual file system,GNOME 虚拟文件系统)。改善了Totem 播放 DVD 和 YouTube 的效果,支持播放 MythTV。时钟小应用支持国际化。在 Evolution 中新增了谷歌日历以及为信息添加标签的功能。改进了 Evince、Tomboy、 Sound Juicer 和计算器。
+
+![GNOME 2.24](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.24/gnome-224.jpg)
+
+*GNOME 2.24, 2008*
+
+新增了 Empathy 即时通讯软件。Ekiga 升级至3.0版本。Nautilus 支持标签式浏览,更好的支持了多屏幕显示方式和数字电视功能。
+
+![GNOME 2.26](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.26/gnome226-large_001.jpg)
+
+*GNOME 2.26, 2009*
+
+新增光盘刻录应用 Brasero。简化了文件分享的流程。改进了媒体播放器的性能。支持多显示器和指纹识别器。
+
+![GNOME 2.28](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.28/1.png)
+
+*GNOME 2.28, 2009*
+
+增加了 GNOME 蓝牙模块。改进了 Epiphany 网页浏览器、Empathy 即时通讯软件、时间追踪器和辅助功能。GTK+ 升级至2.18版本。
+
+![GNOME 2.30](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.30/GNOME2.30.png)
+
+*GNOME 2.30, 2010*
+
+改进了 Nautilus 文件管理器、Empathy 即时通讯软件、Tomboy、Evince、时间追踪器、Epiphany 和 Vinagre。借助 GVFS 通过 libimobiledevice(LCTT 译注:支持iOS®设备跨平台使用的工具协议库)部分地支持了 iPod 和 iPod Touch 设备。
+
+![GNOME 2.32](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.32/gnome-2-32.png.en_GB.png)
+
+*GNOME 2.32, 2010*
+
+新增 Rygel 媒体分享工具和 GNOME 色彩管理器。改进了 Empathy 即时通讯软件、Evince、Nautilus 文件管理器等。由于计划于2010年9月发布3.0版本,因此大部分开发者的精力都由2.3x转移至了3.0版本。
+
+### GNOME 3 ###
+
+![GNOME 3.0](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/3.0/chat-3-0.png)
+
+*GNOME 3.0, 2011*
+
+引入 GNOME Shell,这是一个重新设计的、具有更简练更集中的选项的框架。基于 Mallard 标记语言的话题导向型帮助系统。支持窗口并列堆叠。启用新的视觉主题和默认字体。采用 GTK+ 3.0,具有更好的语言绑定、主题、触控以及多平台支持。去除了那些长期弃用的 API。
+
+![GNOME 3.2](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/3.2/gdm.png)
+
+*GNOME 3.2、 2011*
+
+支持在线帐户、“浏览器”应用。新增通讯录应用和文档文件管理器。“文件管理器”支持快速预览。较大的整合,文档更完善,以及对外观的改善和各种性能提升。
+
+![GNOME 3.4](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/3.4/application-view.png)
+
+*GNOME 3.4, 2012*
+
+全新外观的 GNOME 3 应用程序:“文件”、Epiphany(更名为“浏览器”)、“GNOME 通讯录”。可以在活动概览中搜索本地文件。支持应用菜单。焕然一新的界面元素:新的颜色拾取器、重新设计的滚动条、更易使用的旋钮以及可隐藏的标题栏。支持平滑滚动。全新的动态壁纸。在系统设置中改进了对 Wacom 数位板的支持。更简便的扩展应用管理。更好的硬件支持。面向主题的帮助文档。在 Empathy 中提供了对视频电话和动态信息的支持。更好的辅助功能:提升 Orca 整合度,增强高对比度模式,以及全新的缩放设置。大量的应用增强和对细节的改进。
+
+![GNOME 3.6](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/3.6/gnome-3-6.png)
+
+*GNOME 3.6, 2012*
+
+全新设计的核心元素:新的应用按钮和改进的活动概览布局。新的登录和锁定界面。重新设计的通知栏。通知现在更智能,可见性更高,同时更容易关闭。改进了系统设置的界面和设定逻辑。用户菜单默认显示关闭电源操作。整合的输入方式。辅助功能一直开启。新的应用:Boxes 桌面虚拟化,曾在 GNOME 3.4中发布过预览版。Clocks 时钟,可以显示世界时间。更新了磁盘用量分析、Empathy 和字体查看器的外观。改进了 Orca 对布莱叶盲文的支持。 在“浏览器”中,用最常访问页面取代了之前的空白起始页,增添了更好的全屏模式并使用了 WebKit2 测试版引擎。 Evolution 开始使用 WebKit 显示邮件内容。 改进了“磁盘”功能。 改进了“文件”应用(即之前的 Nautilus),新增诸如最近访问的文件和搜索等功能。
+
+![GNOME 3.8](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/3.8/applications-view.png)
+
+*GNOME 3.8, 2013*
+
+令人耳目一新的核心组件:新应用界面可以分别显示常用应用及全部应用。窗口布局得到全面改造。新的屏幕即现式(OSD)输入法开关。通知和信息现在会对屏幕边缘的点击作出回应。为那些喜欢传统桌面的用户提供了经典模式。重新设计了设置界面的工具栏。新的初始化引导流程。“GNOME 在线帐户”添加了对更多供应商的支持。“浏览器”正式启用 WebKit2 引擎,有了一个新的私密浏览模式。“文档”支持双页模式并且整合了 “Google 文档”。“通讯录”的 UI 升级。“GNOME 文件”、“GNOME Boxes”和“GNOME 磁盘”都得到了大幅改进。集成了 ownCloud。两款全新的 GNOME 核心应用:“GNOME 时钟”和“GNOME 天气”。
+
+![GNOME 3.10](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/3.10/GNOME-3-10-Release-Schedule-2.png)
+
+*GNOME 3.10, 2013*
+
+全新打造的系统状态区,能够更直观的纵览全局。一系列新应用,包括 “GNOME 地图”、“GNOME 备忘录”、 “GNOME 音乐”和“GNOME 照片”。新的基于位置的功能,如自动时区和世界时钟。支持高分辨率及智能卡。 基于 GLib 2.38 提供了对 D-Bus 的支持。
+
+![GNOME 3.12](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/3.12/app-folders.png)
+
+*GNOME 3.12, 2014*
+
+改进了概览中的键盘导航和窗口选择,基于易用性测试对初始设置进行了修改。有线网络图标重新回到了状态栏上,在“应用”视图中可以自定义应用文件夹。在大量应用的对话框中引入了新的 GTK+ 小工具,同时使用了新的 GTK+ 标签风格。“GNOME 视频”,“GNOME 终端”以及 Gedit 都改用了全新外观,更贴合 HIG(LCTT 译注:Human Interface Guidelines,人机界面指南)。在 GNOME Shell 的终端仿真器中提供了搜索预测功能。增强了对 “GNOME 软件”和高分辨率显示屏的支持。提供了新的录音工具。增加了新的桌面通知接口。在向 Wayland 移植的进度中达到了可用的程度,可用选择性地预览体验。
+
+![GNOME 3.14](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/3.14/Top-Features-of-GNOME-3-14-Gallery-459893-2.jpg)
+
+*GNOME 3.14, 2014*
+
+更炫酷的桌面环境效果,改善了对触摸屏的支持。“GNOME 软件”可以管理安装的插件。在“GNOME 照片”中可以访问 “Google 相册”。重绘了 Evince、数独、扫雷和天气应用的用户界面,同时增加了一款叫做 Hitori 的 GNOME 游戏。
+
+![GNOME 3.16](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/3.16/preview-apps.png)
+
+*GNOME 3.16, 2015*
+
+33000 处改变。主要的修改包括 UI 的配色方案从黑色变成了炭黑色。 增加了即现式滚动条。通知窗口中整合了日历应用。对“文件”,图像查看器和“地图”等大量应用进行了微调。可以预览应用程序。进一步从 X11 向 Wayland 移植。
+
+感谢 GNOME Project 及 [Wikipedia][2] 提供的变更日志!感谢阅读!
+
+
+--------------------------------------------------------------------------------
+
+via: https://tlhp.cf/18-years-of-gnome-evolution/
+
+作者:[Pavlo Rudyi][a]
+译者:[Haohong WANG](https://github.com/HaohongWANG)
+校对:[wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:https://tlhp.cf/author/paul/
+[1]:https://www.gnome.org/
+[2]:https://en.wikipedia.org/wiki/GNOME
diff --git a/translated/talk/20151020 18 Years of GNOME Design and Software Evolution--Step by Step.md b/translated/talk/20151020 18 Years of GNOME Design and Software Evolution--Step by Step.md
deleted file mode 100644
index 614f10bb85..0000000000
--- a/translated/talk/20151020 18 Years of GNOME Design and Software Evolution--Step by Step.md	
+++ /dev/null
@@ -1,200 +0,0 @@
-
-一步一脚印:GNOME十八年进化史
-================================================================================
-注:youtube 视频
-
-
-[GNOME][1] (GNU Object Model Environment)由两位墨西哥的程序员Miguel de Icaza和Federico Mena 始创于1997年8月15日。GNOME自由软件的桌面环境和应用程序计划由志愿者和全职开发者来开发。所有的GNOME桌面环境都由开源软件组成,并且支持Linux, FreeBSD, OpenBSD 等操作系统。
-
-现在就让我穿越到1997年来看看GNOME的第一个版本:
-
-### GNOME 1 ###
-
-![GNOME 1.0 - First major GNOME release](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/1.0/gnome.png)
-
-**GNOME 1.0** (1997) – GNOME 发布的第一个版本
-
-![GNOME 1.2 Bongo](https://raw.githubusercontent.com/paulcarroty/Articles/master/GNOME_History/1.2/1361441938.or.86429.png)
-
-**GNOME 1.2** “Bongo”, 2000
-
-![GNOME 1.4 Tranquility](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/1.4/1.png)
-
-**GNOME 1.4** “Tranquility”, 2001
-
-### GNOME 2 ###
-
-![GNOME 2.0](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.0/1.png)
-
-**GNOME 2.0**, 2002
-
-基于GTK+2的重大更新。引入了人机界面指南。
-
-![GNOME 2.2](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.2/GNOME_2.2_catala.png)
-
-**GNOME 2.2**, 2003
-
-改进了多媒体和文件管理器。
-
-![GNOME 2.4 Temujin](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.4/gnome-desktop.png)
-
-**GNOME 2.4** “Temujin”, 2003
-
-首次发布Epiphany浏览器,增添了辅助功能。
-
-![GNOME 2.6](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.6/Adam_Hooper.png)
-
-**GNOME 2.6**, 2004
-
-启用Nautilus空间文件管理工具同时引入了新的GTK+ (译注:跨平台图形用户界面工具包)对话框。这个转瞬即逝的版本变更被称做是GNOME的一个分支:GoneME。
-
-![GNOME 2.8](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.8/3.png)
-
-**GNOME 2.8**, 2004
-
-改良了对可移动设备的支持并新增了Evolution邮件应用。
-
-![GNOME 2.10](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.10/GNOME-Screenshot-2.10-FC4.png)
-
-**GNOME 2.10**, 2005
-
-减小内存需求,改进显示界面。增加网络控制、磁盘挂载和回收站组件以及Totem影片播放器和Sound Juicer CD抓取工具。
-
-![GNOME 2.12](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.12/gnome-livecd.jpg)
-
-**GNOME 2.12**, 2005
-
-改进了Nautilus以及跨平台剪切/粘贴功能的整合。 新增Evince PDF阅读器;新预设主题Clearlooks;新增菜单编辑器、管理员工具与环状管理器。基于支持Cairo的GTK+2.8。
-
-![GNOME 2.14](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.14/debian4-stable.jpg)
-
-**GNOME 2.14**, 2006
-
-改善显示效果;增强易用性;基于GStreamer 0.10多媒体框架。增加了Ekiga视频会议应用,Deskbar搜索工具,Pessulus权限管理器,和Sabayon系统管理员工具和快速切换用户功能。
-
-![GNOME 2.16](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.16/Gnome-2.16-screenshot.png)
-
-**GNOME 2.16**, 2006
-
-界面改良。增加了Tomboy笔记应用,Baobab磁盘用量分析应用,Orca屏幕朗读器以及GNOME 电源管理程序(以延长笔记本电池寿命);改进了Totem, Nautilus, 使用了新的图标主题。基于GTK+ 2.0 的全新显示对话框。
-
-![GNOME 2.18](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.18/Gnome-2.18.1.png)
-
-**GNOME 2.18**, 2007
-
-界面改良。增加了Seahorse GPG安全应用,可以对邮件和本地文件进行加密;Baobab增加了环状图表显示方式;改进了Orca,Evince, Epiphany, GNOME电源管理,音量控制;增加了两款新游戏:GNOME数独和国际象棋。支持MP3和AAC音频解码。
-
-![GNOME 2.20](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.20/rnintroduction-screenshot.png)
-
-**GNOME 2.20**, 2007
-
-发布十周年版本。Evolution增加了备份功能;改进了Epiphany,EOG,GNOME电源管理以及Seahorse中的Keyring密码管理方式;在Evince中可以编辑PDF文档;文件管理界面中整合了搜索模块;自动安装多媒体解码器。
-
-![GNOME 2.22, 2008](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.22/GNOME-2-22-2-Released-2.png)
-
-**GNOME 2.22**, 2008
-
-新增Cheese应用,它是一个可以截取网络摄像头和远程桌面图像的工具;Metacity支持基本的窗口叠加复合;引入GVFS(译注:GNOME Virtual file system,GNOME虚拟文件系统);改善了Totem播放DVD 和YouTube的效果,支持播放MythTV;在Evolution中新增了谷歌日历以及为信息添加标签的功能;改进了Evince, Tomboy, Sound Juicer和计算器。
-
-![GNOME 2.24](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.24/gnome-224.jpg)
-
-**GNOME 2.24**, 2008
-
-新增了Empathy即时通讯软件,Ekiga升级至3.0版本;Nautilus支持标签式浏览,更好的支持了多屏幕显示方式和数字电视功能。
-
-![GNOME 2.26](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.26/gnome226-large_001.jpg)
-
-**GNOME 2.26**, 2009
-
-新增光盘刻录应用Brasero;简化了文件分享的流程,改进了媒体播放器的性能;支持多显示器和指纹识别器。
-
-![GNOME 2.28](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.28/1.png)
-
-**GNOME 2.28**, 2009
-
-增加了GNOME 蓝牙模块;改进了Epiphany ,Empathy,时间追踪器和辅助功能。GTK+升级至2.18版本。
-
-![GNOME 2.30](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.30/GNOME2.30.png)
-
-**GNOME 2.30**, 2010
-
-改进了Nautilus,Empathy,Tomboy,Evince,Time Tracker,Epiphany和 Vinagre。借助基于libimobiledevice(译注:支持iOS®设备跨平台使用的工具协议库)的GVFS可以访问部分iPod 和iPod Touch。
-
-![GNOME 2.32](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/2.32/gnome-2-32.png.en_GB.png)
-
-**GNOME 2.32**, 2010
-
-新增Rygel 媒体分享工具和GNOME色彩管理器;改进了Empathy即时通讯客户端,Evince,Nautilus文件管理器等。计划于2010年9月发布3.0版本,因此大部分开发者的精力都由2.3x转移至了3.0版本。
-
-### GNOME 3 ###
-
-![GNOME 3.0](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/3.0/chat-3-0.png)
-
-**GNOME 3.0**, 2011
-
-引入GNOME Shell,一个重新设计的、具有更简练更集中的选项的框架。基于Mallard标记语言的话题导向型帮助。支持窗口并列堆叠。启用新的视觉主题和字体。采用GTK+3.0,具有更好的语言绑定,主题,触控以及多平台支持。去除了长期弃用的API。
-
-![GNOME 3.2](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/3.2/gdm.png)
-
-**GNOME 3.2**, 2011
-
-支持在线帐户,Web应用;新增通讯录应用和文档文件管理器;文件管理器支持快速预览;整合性能,更新文档以及对外观的一些小改进。
-
-![GNOME 3.4](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/3.4/application-view.png)
-
-**GNOME 3.4**, 2012
-
-全新的GNOME 3 应用程序外观:文件,Epiphany(更名为Web),GNOME 通讯录。可以在Activities Overview中搜索本地文件。支持应用菜单。焕然一新的界面元素:崭新的颜色拾取器,重新设计的滚动条,更易使用的旋转按钮以及可隐藏的标题栏。支持视角平滑。全新的动态壁纸。在系统设置中增添了对Wacom数位板的支持。更简便的扩展应用管理。更好的硬件支持。面向主题的文档。在Empathy中提供了对视频电话和动态信息的支持。更好的辅助功能:提升Orca整合度,增强高对比度模式适配性,以及全新的缩放设置。大量应用和细节的改进。
-
-![GNOME 3.6](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/3.6/gnome-3-6.png)
-
-**GNOME 3.6**, 2012
-
-全新设计的核心元素:新的应用按钮和改进的Activities Overview布局。新的登陆锁定界面。重新设计的通知栏。通知现在更智能,可见性更高,同时更容易操作。改进了系统设置的界面和设定逻辑。用户菜单默认显示关机操作。整合了输入法。辅助功能一直开启。新的应用:Boxes虚拟机,在GNOME 3.4中发布了预览版。Clocks时钟, 可以显示世界时间。升级了磁盘用量分析,Empathy和 Font Viewer的外观。改进了Orca对布莱叶盲文的支持。 在Web浏览器中, 用最常访问页面取代了之前的空白起始页,增添了更好的全屏模式并使用了WebKit2测试版引擎. Evolution 开始使用WebKit提交邮件。 改进了磁盘功能。 改进了文件管理应用即之前的Nautilus, 新增诸如最近访问的文件和搜索等功能。
-
-![GNOME 3.8](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/3.8/applications-view.png)
-
-**GNOME 3.8**, 2013
-
-令人耳目一新的核心组件:新应用界面可以分别显示常用应用及全部应用,窗口布局得到全面改造。新的屏幕即现式输入法开关。通知和信息现在会对屏幕边缘的点击作出回应。为那些喜欢传统桌面的用户提供了经典模式。重新设计了设置界面的工具栏。新的初始化引导流程。GNOME 在线帐户添加了对更多供应商的支持。浏览器正式启用WebKit2引擎。文档支持双页模式并且整合了Google 文档。通讯录的UI升级。GNOME Files,GNOME Boxes和GNOME Disks都得到了大幅改进。两款全新的GNOME核心应用:GNOME时钟和GNOME天气。
-
-![GNOME 3.10](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/3.10/GNOME-3-10-Release-Schedule-2.png)
-
-**GNOME 3.10**, 2013
-
-全新设计的系统状态界面,能够更直观的纵览全局。一系列新应用,包括GNOME Maps, GNOME Notes, GNOME Music 和GNOME Photos。新的基于位置的功能,如自动时区和世界时间。支持高分辨率及智能卡。 基于GLib 2.38提供了对D-Bus的支持。
-
-![GNOME 3.12](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/3.12/app-folders.png)
-
-**GNOME 3.12**, 2014
-
-改进了Overview中的键盘导航和窗口选择,基于易用性测试对初始设置进行了修改。有线网络重新回到了状态栏上,在应用预览中可以自定义应用文件夹。在大量应用的对话框中引入了新的GTK+小工具同时使用了新的GTK+标签风格。GNOME Videos,GNOME 终端以及Gedit都改用了全新外观,更贴合HIG(译注:Human Interface Guidelines,人机界面指南)。在GNOME Shell的终端仿真器中提供了搜索预测功能。增强了对GNOME软件和高密度显示屏的支持。提供了新的录音工具。增加了新的桌面通知接口。在Wayland中的进程被置于更易使用的位置并可以进行选择性预览。
-
-![GNOME 3.14](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/3.14/Top-Features-of-GNOME-3-14-Gallery-459893-2.jpg)
-
-**GNOME 3.14**, 2014
-
-更炫酷的桌面环境效果,改善了对触摸屏的支持。GNOME Software supports managing installed add-ons. 在GNOME Photos中可以访问Google相册。重绘了Evince,数独,扫雷和天气应用的用户界面,同时增加了一款叫做Hitori 的GNOME游戏。
-
-![GNOME 3.16](https://github.com/paulcarroty/Articles/raw/master/GNOME_History/3.16/preview-apps.png)
-
-**GNOME 3.16**, 2015
-
-33,000处改变。主要修改了UI的配色方案。 增加了即现式滚动条。通知窗口中整合了日历应用。对文件管理器,图像查看器和地图等大量应用进行了微调。可以预览应用程序。进一步使用Wayland取代X11。
-
-感谢GNOME Project及[Wikipedia][2]提供的变更日志!感谢阅读!(译注:原文此处为“敬请期待”。)
-
-
---------------------------------------------------------------------------------
-
-via: https://tlhp.cf/18-years-of-gnome-evolution/
-
-作者:[Pavlo Rudyi][a]
-译者:[Haohong WANG](https://github.com/HaohongWANG)
-校对:[校对者ID](https://github.com/校对者ID)
-
-本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
-
-[a]:https://tlhp.cf/author/paul/
-[1]:https://www.gnome.org/
-[2]:https://en.wikipedia.org/wiki/GNOME

From 7cf2860811bdd99833386fbb9d025d9a9b3ede05 Mon Sep 17 00:00:00 2001
From: wxy 
Date: Wed, 16 Mar 2016 10:19:39 +0800
Subject: [PATCH 0528/1469] PUB:20160220 [Free Download] Vi Cheat Sheet For
 Beginners

@JonathanKang
---
 ... Download] Vi Cheat Sheet For Beginners.md | 78 ++++++++++++++++++
 ... Download] Vi Cheat Sheet For Beginners.md | 79 -------------------
 2 files changed, 78 insertions(+), 79 deletions(-)
 create mode 100644 published/20160220 [Free Download] Vi Cheat Sheet For Beginners.md
 delete mode 100644 translated/tech/20160220 [Free Download] Vi Cheat Sheet For Beginners.md

diff --git a/published/20160220 [Free Download] Vi Cheat Sheet For Beginners.md b/published/20160220 [Free Download] Vi Cheat Sheet For Beginners.md
new file mode 100644
index 0000000000..6993d7ade1
--- /dev/null
+++ b/published/20160220 [Free Download] Vi Cheat Sheet For Beginners.md	
@@ -0,0 +1,78 @@
+初学者 Vi 备忘单
+================================================
+
+![](http://itsfoss.com/wp-content/uploads/2016/01/VI.jpg)
+
+一直以来,我都在给你们分享我使用 Linux 的经验。今天我想分享我的 **Vi 备忘单**。这份备忘单节省了我很多时间,因为我再也不用使用 Google 去搜索这些命令了。
+
+## 基本 Vi 命令
+
+这并不是一个教你使用 [Vi 编辑器](https://en.wikipedia.org/wiki/Vi)的各个方面的详尽教程。事实上,这根本就不是一个教程。这仅仅是一些基本 Vi 命令以及这些命令简单介绍的集合。
+
+命令|解释
+:--|:--
+`:x`|保存文件并退出
+`:q!`|退出但不保存文件
+`i`|在光标左侧插入
+`a`|在光标右侧插入
+`ESC`按键|退出插入模式
+光标键|移动光标
+`/text`|搜索字符串text(大小写敏感)
+`n`|跳到下一个搜索结果
+`x`|删除当前光标处的字符
+`dd`|删除当前光标所在的行
+`u`|撤销上次改变
+`:0`(数字0)|将光标移动到文件开头
+`:n`|将光标移动到第n行
+`G`|将光标移动到文件结尾
+`^`|将光标移动到该行开头
+`$`|将光标移动到该行结尾
+`:set list`|查看文件中特殊字符
+`yy`|复制光标所在行
+`5yy`|复制从光标所在行开始的5行
+`p`|在光标所在行下面粘贴
+
+你可以通过下面的链接下载 PDF 格式的 Vi 备忘录:
+
+[下载 Vi 备忘录](https://drive.google.com/file/d/0By49_3Av9sT1X3dlWkNQa3g2b2c/view?usp=sharing)
+
+你可以把它打印出来放到你的办公桌上,或者把它保存到你的电脑上来使用。
+
+## 我为什么要建立这个 Vi 备忘录?
+
+几年前,当我刚刚接触 Linux 终端时,使用命令行编辑器这个主意使我一惊。我之前在我自己的电脑上使用过桌面版本的 Linux,所以我很乐意使用像 Gedit 这样的有图形界面的编辑器。但是在工作环境中,我不得不使用命令行,并且无法使用图形界面版的编辑器。
+
+我就这么被强迫地使用 Vi 来对远程 Linux 终端上的文件做一些基本的编辑。从这时候我开始了解并钦佩 Vi 的强大之处。
+
+因为在那时候我还是一个 Vi 新手,所以我经常对 Vi 一些操作很困惑。仍然记得第一次使用 Vi 的时候,由于我不知道如何退出 Vi,所以我都无法关闭某个文件。我也只能通过 Google 搜索来找到解决办法。我不得不接受这个尴尬的事实。
+
+从那以后,我就决定制作一个列表来列出我经常会用到的基本 Vi 操作。这个列表,或者你可能称它为备忘录。在我早期使用 Vi 的时候,它对我非常有用。慢慢地,我对 Vi 更加熟悉,我已经可以熟记那些基本编辑命令。到现在,我甚至不需要再去查看我的 Vi 备忘录了。
+
+## 你为什么需要 Vi 备忘录?
+
+我能理解一个刚刚接触 Vi 的人的感受。你最喜欢的 `Ctrl`+`S` 快捷键不能像在其他编辑器那样方便地保存文件。`Ctrl`+`C`和`Ctrl`+`V`理应是通用的用来复制和粘贴的快捷键,但是在 Vi 中却不是这样。
+
+很多人都在使用类似的备忘录帮助他们熟悉各种编程语言或工具,以便让他们可以快速找到常用的下一步或命令。相信我,使用备忘录会给程序员日常工作带来很大便利。
+
+如果你刚刚开始接触 Vi 或者你经常使用但是总是记不住 Vi 操作,那么这份 Vi 备忘录对于你来说是非常有用的。你可以把它保存下来留作以后查询使用。
+
+## 你怎么看待这份备忘录?
+
+至今为止,我一直在克制我自己不要过于依赖终端。我想知道你是怎么发现这篇文章的?你是否想让我分享更多类似的备忘录出来以供你们下载?我很期待你的意见和建议。
+
+------------------------------------------------------------------------------
+
+via: http://itsfoss.com/download-vi-cheat-sheet/
+
+作者:[ABHISHEK][a]
+译者:[JonathanKang](https://github.com/JonathanKang)
+校对:[wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:http://itsfoss.com/author/abhishek/
+
+
+
+
+
diff --git a/translated/tech/20160220 [Free Download] Vi Cheat Sheet For Beginners.md b/translated/tech/20160220 [Free Download] Vi Cheat Sheet For Beginners.md
deleted file mode 100644
index dbf4ef5011..0000000000
--- a/translated/tech/20160220 [Free Download] Vi Cheat Sheet For Beginners.md	
+++ /dev/null
@@ -1,79 +0,0 @@
-【免费下载】初学者Vi备忘单
-================================================
-
-![](http://itsfoss.com/wp-content/uploads/2016/01/VI.jpg)
-
-一直以来,我都在给你们分享我使用Linux的经验。今天我想分享我的**Vi备忘单**。这份备忘单节省了我很多时间,因为我再也不用使用Google去搜索这些命令了。
-
-## Basic Vi commands
-## 基本Vi命令
-
-这并不是一个详尽的教程来教你[Vi编辑器](https://en.wikipedia.org/wiki/Vi)的每一个方面。事实上,这根本就不是一个教程。这仅仅是一些基本Vi命令以及这些命令简单介绍的集合。
-
-命令|解释
-:--|:--
-:x |保存文件并退出
-:q!|退出但不保存文件
-i|在光标左侧插入
-a|在光标右侧插入
-ESC|退出插入模式
-arrows|移动光标
-/text|搜索字符串text(大小写敏感)
-n|跳到下一个搜索结果
-x|删除当前光标处的字符
-dd|删除当前光标所在的行
-u|撤销上次改变
-:0|将光标移动到文件开头
-:n|将光标移动到第n行
-G|将光标移动到文件结尾
-^|将光标移动到该行开头
-$|将光标移动到该行结尾
-:set list|查看文件中特殊字符
-yy|复制光标所在行
-5yy|复制从光标所在行开始的5行
-p|在光标所在行下面粘贴
-
-你可以通过下面的链接下载PDF格式的Vi备忘录:
-
-[下载Vi备忘录](https://drive.google.com/file/d/0By49_3Av9sT1X3dlWkNQa3g2b2c/view?usp=sharing)
-
-你可以把它打印出来放到你的办公桌上,或者把它保存到你的电脑上来使用。
-
-## 我为什么要建立这个Vi备忘录?
-
-几年前,当我刚刚接触Linux终端时,使用命令行编辑器这个主意使我一惊。我之前在我自己的电脑上使用过桌面版本的Linux,所以我很乐意使用像Gedit这样的有图形界面的编辑器。但是在工作环境中,我不得不使用命令行,并且无法使用图形界面版的编辑器。
-
-我就这么被强迫地使用Vi来对远程Linux终端上的文件做一些基本的编辑。从这时候我开始了解并钦佩Vi的强大之处。
-
-因为在那时候我还是一个Vi新手,所以我经常对Vi一些操作很困惑。仍然记得第一次使用Vi的时候,由于我不知道如何退出Vi,所以我都无法关闭某个文件。我也只能通过Google搜索来找到解决办法。我不得不接受这个尴尬的事实。
-
-从那以后,我就决定制作一个列表来列出我经常会用到的基本Vi操作。这个列表,或者你可能称它为备忘录。在我早期使用Vi的时候,它对我非常有用。慢慢地,我对Vi更加熟悉,我已经可以熟记那些基本编辑命令。到现在,我甚至不需要再去查看我的Vi备忘录了。
-
-## 你为什么需要Vi备忘录?
-
-我能理解一个刚刚接触Vi的人的感受。你最喜欢的Ctrl+S快捷键不能像在其他编辑器那样方便地保存文件。Ctrl+C和Ctrl+V理应是通用的用来复制和粘贴的快捷键,但是在Vi中却不是这样。
-
-很多人都在使用类似的备忘录帮助他们熟悉各种编程语言以及用来进行快速检索的“/”工具。相信我,使用备忘录会给程序员日常工作带来很大便利。
-
-如果你刚刚开始接触Vi或者你经常使用但是总是记不住Vi操作,那么这份Vi备忘录对于你来说是非常有用的。你可以把它保存下来留作以后查询使用。
-
-## 你怎么看待这份备忘录?
-
-至今为止,我一直在克制我自己不要过于以来终端。我想知道你是怎么发现这篇文章的?你是否想让我分享更多类似的备忘录出来以供你们下载?我很期待你的意见和建议。
-
-------------------------------------------------------------------------------
-
-via: http://itsfoss.com/download-vi-cheat-sheet/
-
-作者:[ABHISHEK][a]
-译者:[JonathanKang](https://github.com/JonathanKang)
-校对:[校对者ID](https://github.com/校对者ID)
-
-本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
-
-[a]:http://itsfoss.com/author/abhishek/
-
-
-
-
-

From 2686a1ca36ec7e7c688cbb7a62645bf0e4555aef Mon Sep 17 00:00:00 2001
From: wxy 
Date: Wed, 16 Mar 2016 10:46:56 +0800
Subject: [PATCH 0529/1469] PUB:20160218 ST Releases Free Linux IDE for 32-Bit
 MCUs

@martin2011qi
---
 ...Releases Free Linux IDE for 32-Bit MCUs.md | 24 +++++++++----------
 1 file changed, 12 insertions(+), 12 deletions(-)
 rename {translated/tech => published}/20160218 ST Releases Free Linux IDE for 32-Bit MCUs.md (68%)

diff --git a/translated/tech/20160218 ST Releases Free Linux IDE for 32-Bit MCUs.md b/published/20160218 ST Releases Free Linux IDE for 32-Bit MCUs.md
similarity index 68%
rename from translated/tech/20160218 ST Releases Free Linux IDE for 32-Bit MCUs.md
rename to published/20160218 ST Releases Free Linux IDE for 32-Bit MCUs.md
index adc5404a2c..846fa1b035 100644
--- a/translated/tech/20160218 ST Releases Free Linux IDE for 32-Bit MCUs.md	
+++ b/published/20160218 ST Releases Free Linux IDE for 32-Bit MCUs.md	
@@ -1,43 +1,43 @@
-意法半导体为 32 位 微控制器发布了一款自由的 Linux 集成开发环境
+意法半导体为 32 位微控制器发布了一款自由的 Linux 集成开发环境
 =================================================
 
 ![](http://www.linux.com/images/stories/66866/STM32_Nucleo_expansion_board.jpg)
 
-32 位微控制器世界向 Linux 敞开大门。本周,领先的 ARM Cortex-M 供应商意法半导体(ST)[发布了](http://www.st.com/web/en/press/p3781) 一款自由的 Linux 桌面版开发程序,该软件面向其旗下的 STM32 微控制单元(MCU)。包含了 ST 的 STM32CubeMX 配置器和初始化工具,以及其 STM32 [系统工作台(SW4STM32)](http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1533/PF261797) ,这个基于 Eclipse 的 IDE 由工具 Ac6 创建。支撑 SW4STM32 的工具链,论坛,博客以及技术会由 [openSTM32.org](http://www.openstm32.org/tiki-index.php?page=HomePage) 开发社区提供。
+32 位微控制器世界向 Linux 敞开大门。前一段时间,领先的 ARM Cortex-M 供应商意法半导体(ST)[发布了](http://www.st.com/web/en/press/p3781) 一款自由的 Linux 桌面版开发程序,该软件面向其旗下的 STM32 微控制单元(MCU)。包含了 ST 的 STM32CubeMX 配置器和初始化工具,以及其 STM32 [系统工作台(SW4STM32)](http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1533/PF261797) ,这个基于 Eclipse 的 IDE 由工具 Ac6 创建。支撑 SW4STM32 的工具链,论坛,博客以及技术会由 [openSTM32.org](http://www.openstm32.org/tiki-index.php?page=HomePage) 开发社区提供。
 
 “Linux 社区以吸引富有创意的自由思想者而闻名,他们善于交流心得、高效地克服挑战。” Laurent Desseignes,意法半导体微控制器产品部,微控制器生态系统市场经理这么说道:“我们正着手做的是让他们能极端简单的借力 STM32 系列的特性和性能施展自己的才能,运用到富有想象力的新产品的创造中去。
 
 Linux 是物联网(IoT)网关和枢纽,及高端 IoT 终端的领先平台。但是,大部分 IoT 革命,以及可穿戴设备市场基于小型的低功耗微控制器,对 Cortex-M 芯片的运用越来越多。虽然其中的一小部分可以运行精简的 uCLinux (见下文),却没能支持更全面的 Linux 发行版。取而代之的是实时操作系统(RTOS)们或者有时干脆不用 OS 来控制。固件的开发工作一般会在基于 Windows 的集成开发环境(IDE)上完成。
 
-通过 ST 的自由工具,Linux 开发者们可以更容易的开疆拓土。ST 工具中的一些技术在第二季度应该登录 Mac OS/X 平台,与 [STM32 Nucleo](http://www.st.com/web/en/catalog/tools/FM146/CL2167/SC2003?icmp=sc2003_pron_pr-stm32f446_dec2014&sc=stm32nucleo-pr5) ,开发套件,以及评估板同时面世。Nucleo 支持 32 针, 64 针, 和 144 针的版本,并且提供类似 Arduino 连接器这样的插件。
+通过 ST 的自由工具,Linux 开发者们可以更容易的开疆拓土。ST 工具中的一些技术在第二季度应该会登录 Mac OS/X 平台,与 [STM32 Nucleo](http://www.st.com/web/en/catalog/tools/FM146/CL2167/SC2003?icmp=sc2003_pron_pr-stm32f446_dec2014&sc=stm32nucleo-pr5) 、开发套件、以及评估板同时面世。Nucleo 支持 32 针、64 针、和 144 针的版本,并且提供类似 Arduino 连接器这样的插件。
 
 STM32CubeMX 配置器和 IDE SW4STM32 使 Linux 开发者能够配置微控制器并开发调试代码。SW4STM32 支持在 Linux 下通过社区更改版的 [OpenOCD](http://openocd.org/) 使用调试工具 ST-LINK/V2。
 
 据 ST 称,软件兼容 STM32Cube 软件包及标准外设库中的微控制器固件。目标是囊括 ST 的全系列 MCU,从入门级的 Cortex-M0 内核到高性能的 M7 芯片,包括 M0+,M3 和 DSP 扩展的 M4 内核。
 
-ST 并非首个为 Linux 准备 Cortex-M 芯片 IDE 的 32 位 MCU 供应商,但似乎是第一大自由的 Linux 平台。例如NXP,MCU 的市场份额随着近期收购了 Freescale (Kinetis 系列 MCU,等)而增加,提供了一款 IDE [LPCXpresso IDE](http://www.nxp.com/pages/lpcxpresso-ide:LPCXPRESSO)支持 Linux 、Windows 和 Mac。然而,LPCXpresso 每份售价 $450。
+ST 并非首个为 Linux 准备 Cortex-M 芯片 IDE 的 32 位 MCU 供应商,但似乎是第一大自由的 Linux 平台。例如 NXP,MCU 的市场份额随着近期收购了 Freescale (Kinetis 系列 MCU,等)而增加,提供了一款 IDE [LPCXpresso IDE](http://www.nxp.com/pages/lpcxpresso-ide:LPCXPRESSO),支持 Linux 、Windows 和 Mac。然而,LPCXpresso 每份售价 $450。
 
-在其 [SmartFusion FPGA 系统级芯片(SoC)](http://www.microsemi.com/products/fpga-soc/soc-processors/arm-cortex-m3)上集成了 Cortex-M3 芯片的Microsemi,拥有一款 IDE [Libero IDE](http://www.linux.com/news/embedded-mobile/mobile-linux/884961-st-releases-free-linux-ide-for-32-bit-mcus#device-support)适用于 RHEL 和 Windows。然而,Libero 需求许可证,并且 RHEL 版缺乏如 FlashPro 和 SoftConsole 的插件。
+在其 [SmartFusion FPGA 系统级芯片(SoC)](http://www.microsemi.com/products/fpga-soc/soc-processors/arm-cortex-m3)上集成了 Cortex-M3 芯片的 Microsemi,拥有一款 IDE [Libero IDE](http://www.linux.com/news/embedded-mobile/mobile-linux/884961-st-releases-free-linux-ide-for-32-bit-mcus#device-support),适用于 RHEL 和 Windows。然而,Libero 需要许可证才行,并且 RHEL 版缺乏如 FlashPro 和 SoftConsole 的插件。
 
-## 为什么要学习 MCU?
+### 为什么要学习 MCU?
 
 即便 Linux 开发者并没有计划在 Cortex-M 上使用 uClinux,但是 MCU 的知识总会派上用场。特别是牵扯到复杂的 IoT 工程,需要扩展 MCU 终端至云端。
 
-对于历程和业余爱好者的项目,Arduino 板为其访问 MCU 提供了非常便利的接口。然而历程之外,开发者常常就会用更快的 32 位 Cortex-M 芯片以及所带来的附加功能来替代 Arduino 板和板上的那块 8 位 MCU ATmega32u4。这些附加功能包括改进的存储器寻址,用于芯片和各种总线的独立时钟设置,以及芯片 [Cortex-M7](http://www.electronicsnews.com.au/products/stm32-mcus-with-arm-cortex-m7-processors-and-graph)自带的入门级显示芯片。
+对于原型和业余爱好者的项目,Arduino 板为其访问 MCU 提供了非常便利的接口。然而原型之外,开发者常常就会用更快的 32 位 Cortex-M 芯片以及所带来的附加功能来替代 Arduino 板和板上的那块 8 位 MCU ATmega32u4。这些附加功能包括改进的存储器寻址,用于芯片和各种总线的独立时钟设置,以及芯片 [Cortex-M7](http://www.electronicsnews.com.au/products/stm32-mcus-with-arm-cortex-m7-processors-and-graph) 自带的入门级显示芯片。
 
-还有些可能需求 MCU 开发技术的地方有:可穿戴设备、低功耗、低成本和小尺寸给了 MCU 一席之地,还有机器人和无人机这些使用实时处理和电机控制的地方更为受用。在机器人上,你更是有可能看看 Cortex-A 与 Cortex-M 集成在同一个产品中的样子。
+还有些可能需求 MCU 开发技术的地方包括可穿戴设备,低功耗、低成本和小尺寸给了 MCU 一席之地,还有机器人和无人机这些使用实时处理和电机控制的地方更为受用。在机器人上,你更是有可能看看 Cortex-A 与 Cortex-M 集成在同一个产品中的样子。
 
 对于 SoC 芯片还有这样的一种温和的局势,即将 MCU 加入到 Linux 驱动的 Cortex-A 核心中,就如同 [NXP i.MX6 SoloX](http://linuxgizmos.com/freescales-popular-i-mx6-soc-sprouts-a-cortex-m4-mcu/)。虽然大多数的嵌入式项目并不使用这种混合型 SoC 或者说将应用处理器和 MCU 结合在同一产品中,但开发者会渐渐地发现自己工作的生产线、设计所基于的芯片正渐渐的从低端的 MCU 模块发展到 Linux 或安卓驱动的 Cortex-A。
 
-## uClinux 是 Linux 在 MCU 领域的筹码
+### uClinux 是 Linux 在 MCU 领域的筹码
 
 随着物联网的兴起,我们见到越来越多的 SBC 和模块计算机,它们在 32 位的 MCU 上运行着 uClinux。不同于其他的 Linux 发行版,uClinux 并不需要内存管理单元(MMU)。然而,uClinux 对市面上可见 MCU 有更高的内存需求。需求更高端的 Cortex-M4 和 Cortex-M4 微控制器内置内存控制器来支持外部 DRAM 芯片。
 
 [Amptek](http://www.semiconductorstore.com/Amptek/) SBC 在 NXP LPC Cortex-M3 和 -M4 芯片上运行 uClinux,以提供常用的功能类似 WiFi、蓝牙、USB 等众多接口。Arrow 的 [SF2+](http://linuxgizmos.com/iot-dev-kit-runs-uclinux-on-a-microsemi-cortex-m3-fpga-soc/) 物联网开发套件将 uClinux 运行于 SmartFusion2 模块计算机的 Emcraft 系统上,该模块计算机是 Microsemi 的 166MHz Cortex-M3/FPGA SmartFusion2 混合 SoC。
 
-[Emcraft](http://www.emcraft.com/) 销售基于 uClinux 的模块计算机,有 ST 和 NXP 的,也有 Microsemi 的 MCU,是 32 位 MCU 上积极推进 uClinux 的重要角色。日益频繁的 uClinux 开始了与 ARM 本身 [Mbed OS](http://linuxgizmos.com/arm-announces-mbed-os-for-iot-devices/)的对抗,至少在高端的 MCU 工程中需要无线通信和更为复杂的操作规则。Mbed 和 modern 的支持者,开源的 RTOS 们,类似 FreeRTOS 认为 uClinux 需要对 RAM 的需求太高以至于难以压低 IoT 终端的价格然而 Emcraft 与其他 uCLinux 拥趸表示价格并没有如此夸张,而且扩展 Linux 的无线和接口也是相当值得的,即使只是在像 uClinux 这样的精简版上。
+[Emcraft](http://www.emcraft.com/) 销售基于 uClinux 的模块计算机,有 ST 和 NXP 的,也有 Microsemi 的 MCU,是 32 位 MCU 上积极推进 uClinux 的重要角色。日益频繁的 uClinux 开始了与 ARM 本身 [Mbed OS](http://linuxgizmos.com/arm-announces-mbed-os-for-iot-devices/)的对抗,至少在高端的 MCU 工程中需要无线通信和更为复杂的操作规则。Mbed 和 modern 的支持者,开源的 RTOS 们,类似 FreeRTOS 认为 uClinux 需要对 RAM 的需求太高以至于难以压低 IoT 终端的价格,然而 Emcraft 与其他 uCLinux 拥趸表示价格并没有如此夸张,而且扩展 Linux 的无线和接口也是相当值得的,即使只是在像 uClinux 这样的精简版上。
 
-当被问及对于这次 ST 发布的看法,Emcraft 的主任工程师 Vladimir Khusainov 表示:”ST决定将这款开发工具 移植至 Linux 对于 Emcraft 是个好消息,它使得 Linux 用户能轻易的在嵌入式 STM MCU 上展开工作。我们希望那些有机会熟悉 STM 设备,使用 ST 配置器和嵌入式库的用户可以对在目标机上使用嵌入式 Linux (以 uClinux 的形式)感兴趣。“
+当被问及对于这次 ST 发布的看法,Emcraft 的主任工程师 Vladimir Khusainov 表示:“ST决定将这款开发工具 移植至 Linux 对于 Emcraft 是个好消息,它使得 Linux 用户能轻易的在嵌入式 STM MCU 上展开工作。我们希望那些有机会熟悉 STM 设备,使用 ST 配置器和嵌入式库的用户可能对在目标机上使用嵌入式 Linux (以 uClinux 的形式)感兴趣。”
 
 最近关于 Cortex-M4 上运行 uClinux 的概述,可以查看去年 Jim Huang 与 Jeff Liaws 在嵌入式 Linux 大会上使用的[幻灯片](http://events.linuxfoundation.org/sites/events/files/slides/optimize-uclinux.pdf)。更多关于 Cortex-M 处理器可以查看这里过的 [AnandTech 总结](http://www.anandtech.com/show/8400/arms-cortex-m-even-smaller-and-lower-power-cpu-cores)。
 
@@ -47,7 +47,7 @@ via: http://www.linux.com/news/embedded-mobile/mobile-linux/884961-st-releases-f
 
 作者:[Arun Pyasi][a]
 译者:[martin2011qi](https://github.com/martin2011qi)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
 
 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
 

From 26fe48fb1cac6d275d44abdc5a9a6e91dc663a97 Mon Sep 17 00:00:00 2001
From: wxy 
Date: Wed, 16 Mar 2016 10:54:02 +0800
Subject: [PATCH 0530/1469] PUB:20151215 Linux Desktop Fun--Summon Swarms Of
 Penguins To Waddle About The Desktop

@geekpi
---
 ... Of Penguins To Waddle About The Desktop.md | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
 rename {translated/tech => published}/20151215 Linux Desktop Fun--Summon Swarms Of Penguins To Waddle About The Desktop.md (74%)

diff --git a/translated/tech/20151215 Linux Desktop Fun--Summon Swarms Of Penguins To Waddle About The Desktop.md b/published/20151215 Linux Desktop Fun--Summon Swarms Of Penguins To Waddle About The Desktop.md
similarity index 74%
rename from translated/tech/20151215 Linux Desktop Fun--Summon Swarms Of Penguins To Waddle About The Desktop.md
rename to published/20151215 Linux Desktop Fun--Summon Swarms Of Penguins To Waddle About The Desktop.md
index 6c797816f5..4577cb10cb 100644
--- a/translated/tech/20151215 Linux Desktop Fun--Summon Swarms Of Penguins To Waddle About The Desktop.md	
+++ b/published/20151215 Linux Desktop Fun--Summon Swarms Of Penguins To Waddle About The Desktop.md	
@@ -1,15 +1,15 @@
-Linux桌面趣闻:召唤一群企鹅在桌面上行走
+Linux/Unix 桌面趣事:召唤一群企鹅在桌面上行走
 ================================================================================
-XPenguins是一个在窗口播放可爱动物动画的程序。默认情况下,将会从屏幕上方掉落企鹅,沿着你的窗口顶部行走,在窗口变漂浮,滑板,和做其他类似的令人兴奋的事情。现在,你可以把这些可爱的小企鹅大军入侵别人的桌面了。
+XPenguins 是一个在窗口播放可爱动物动画的程序。默认情况下,将会从屏幕上方掉落企鹅,沿着你的窗口顶部行走,在窗口漂浮起来,踩上滑板,和做其他类似的有趣的事情。现在,你可以把这些可爱的小企鹅大军入侵别人的桌面了。
 
 ### 安装XPenguins ###
 
-打开终端(选择程序->附件->终端),接着输入下面的命令来安装XPenguins。首先,输入apt-get update通过请求配置的仓库刷新包的信息,接着安装需要的程序:
+打开终端(选择程序->附件->终端),接着输入下面的命令来安装 XPenguins。首先,输入 `apt-get update` 通过请求配置的仓库刷新包的信息,接着安装需要的程序:
 
     $ sudo apt-get update
     $ sudo apt-get install xpenguins
 
-### 我本地如何启动XPenguins? ###
+### 我本地如何启动 XPenguins? ###
 
 输入下面的命令:
 
@@ -19,15 +19,15 @@ XPenguins是一个在窗口播放可爱动物动画的程序。默认情况下
 
 ![An army of cute little penguins invading the screen](http://files.cyberciti.biz/uploads/tips/2011/07/Workspace-1_002_12_07_2011.png)
 
-一支可爱企鹅军队正在入侵屏幕。
+*一支可爱企鹅军队正在入侵屏幕。*
 
 ![Linux: Cute little penguins walking along the tops of your windows](http://files.cyberciti.biz/uploads/tips/2011/07/Workspace-1_001_12_07_2011.png)
 
-Linux:可爱的小企鹅沿着窗口的顶部行走。
+*可爱的小企鹅沿着窗口的顶部行走。*
 
 ![Xpenguins Screenshot](http://files.cyberciti.biz/uploads/tips/2011/07/xpenguins-screenshot.jpg)
 
-Xpenguins截图
+*Xpenguins 截图*
 
 移动窗口时小心点,小家伙们很容易被压坏。如果你发送中断程序(Ctrl-C),它们会爆炸。
 
@@ -83,7 +83,7 @@ Xpenguins截图
 
 - [XPenguins][1] 主页。
 - man penguins
-- 更多Linux/Unix桌面乐趣在[蒸汽火车][2]和[终端ASCII水族馆][3]。
+- 更多 Linux/Unix 桌面乐趣在[蒸汽火车][2]和[终端ASCII水族馆][3]。
 
 --------------------------------------------------------------------------------
 
@@ -91,7 +91,7 @@ via: http://www.cyberciti.biz/tips/linux-cute-little-xpenguins-walk-along-tops-o
 
 作者:Vivek Gite
 译者:[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 c79100483f50d15a24ff8c60d4779d4c9fea0600 Mon Sep 17 00:00:00 2001
From: wxy 
Date: Wed, 16 Mar 2016 11:16:02 +0800
Subject: [PATCH 0531/1469] PUB:20151215 How to Install Light Table 0.8 in
 Ubuntu 14.04, 15.10

@zky001
---
 ... Light Table 0.8 in Ubuntu 14.04, 15.10.md | 53 +++++++++----------
 1 file changed, 25 insertions(+), 28 deletions(-)
 rename {translated/tech => published}/20151215 How to Install Light Table 0.8 in Ubuntu 14.04, 15.10.md (56%)

diff --git a/translated/tech/20151215 How to Install Light Table 0.8 in Ubuntu 14.04, 15.10.md b/published/20151215 How to Install Light Table 0.8 in Ubuntu 14.04, 15.10.md
similarity index 56%
rename from translated/tech/20151215 How to Install Light Table 0.8 in Ubuntu 14.04, 15.10.md
rename to published/20151215 How to Install Light Table 0.8 in Ubuntu 14.04, 15.10.md
index 3b3f72ac4c..915466448b 100644
--- a/translated/tech/20151215 How to Install Light Table 0.8 in Ubuntu 14.04, 15.10.md	
+++ b/published/20151215 How to Install Light Table 0.8 in Ubuntu 14.04, 15.10.md	
@@ -1,45 +1,42 @@
- 如何在 Ubuntu 14.04, 15.10 中安装Light Table 0.8
+ 如何在 Ubuntu 中安装 Light Table 0.8
 ================================================================================
 ![](http://ubuntuhandbook.org/wp-content/uploads/2014/11/LightTable-IDE-logo-icon.png)
 
-Light Table 在经过一年以上的开发,已经推出了新的稳定发行版本。现在它只为Linux提供64位的二进制包。
+Light Table 在经过一年以上的开发,已经推出了新的稳定发行版本。现在它只为 Linux 提供64位的二进制包。
+
 LightTable 0.8.0的改动:
 
-- 更改: 我们从 NW.js 中选择了 Electron 
-- 更改: LT’s 发行版本与自更新进程在github上面完全的公开
-- 增加: LT 可以由提供的脚本从源码在支持的不同平台上安装
-- 增加: LT’s 大部分的代码库将用npm依赖来安装以取代以forked库安装
-- 增加: 有效文档. 更多详情内容见下面
-- 修复: 版本号>= OSX 10.10的系统下工作的主要的可用性问题
-- 更改: 32位Linux不再提供官方包文件下载,从源码安装仍旧将被支持
-- 修复: ClojureScript eval 在ClojureScript的现代版本可以正常工作
+- 更改: 我们从 NW.js 切换到了 Electron 
+- 更改: Light Table 的发行与自更新进程完全地公开在github上
+- 增加: Light Table 可以用提供的脚本在各个支持的平台上从源码构建
+- 增加: Light Table 大部分的 node 代码库将通过 npm 依赖来安装,以取代以前采用分叉库的方式
+- 增加: 有效文档。更多详情内容见下面
+- 修复: 版本号 >= OSX 10.10的系统下的主要的可用性问题
+- 更改: 官方不再提供 32位 Linux 软件包下载,不过仍然支持从源码构建
+- 修复: ClojureScript eval 支持 ClojureScript 的现代版本
 - 参阅更多 [github.com/LightTable/LightTable/releases][1]
 
 ![LightTable 0.8.0](http://ubuntuhandbook.org/wp-content/uploads/2015/12/lighttable-08.jpg)
 
-### 如何在Ubuntu中安Light Table 0.8.0: ###
+### 如何在 Ubuntu 中安装 Light Table 0.8.0 ###
 
-下面的步骤回指导你怎么样在Ubuntu下安装官方的二进制包,在目前Ubuntu发行版本都适用(**仅仅针对64位**)。
+下面的步骤会指导你怎么样在 Ubuntu 下安装官方的二进制包,在目前的 Ubuntu 发行版本中都适用(**仅仅针对64位**)。
 
 在开始之前,如果你安装了之前的版本请做好备份。
 
-**1.** 
-从以下链接下载LightTable Linux下的二进制文件:
+**1.** 从以下链接下载 LightTable Linux 下的二进制文件:
 
 - [lighttable-0.8.0-linux.tar.gz][2]
 
-**2.** 
-从dash或是应用启动器,或者是Ctrl+Alt+T快捷键打开终端,并且在输入以下命令后敲击回车键:
+**2.** 从 dash 或是应用启动器,或者是 Ctrl+Alt+T 快捷键打开终端,并且在输入以下命令后敲击回车键:
 
     gksudo file-roller ~/Downloads/lighttable-0.8.0-linux.tar.gz
 
 ![open-via-fileroller](http://ubuntuhandbook.org/wp-content/uploads/2015/12/open-via-fileroller.jpg)
 
-如果命令不工作的话从Ubuntu软件中心安装`gksu`。
-
-**3.** 
-之前的命令使用了root用户权限通过档案管理器打开了下载好的存档。
+如果命令不工作的话从 Ubuntu 软件中心安装`gksu`。
 
+**3.** 之前的命令使用了 root 用户权限通过档案管理器打开了下载好的存档。
 
 打开它后,请做以下步骤:
 
@@ -48,17 +45,17 @@ LightTable 0.8.0的改动:
 
 ![extract-lighttable](http://ubuntuhandbook.org/wp-content/uploads/2015/12/extract-lighttable.jpg)
 
-最终你应该安装好了LightTable,可以在/opt/ 目录下查看:
+最终你应该安装好了 LightTable,可以在 /opt/ 目录下查看:
 
 ![lighttable-in-opt](http://ubuntuhandbook.org/wp-content/uploads/2015/12/lighttable-in-opt.jpg)
 
-**4.** 创建一个启动器使你可以从dash工具或是应用启动器打开LightTable。
+**4.** 创建一个启动器使你可以从 dash 工具或是应用启动器打开 LightTable。
 
-打开终端,运行以下命令来创建与编辑一个LightTable的启动文件:
+打开终端,运行以下命令来创建与编辑一个 LightTable 的启动文件:
 
     gksudo gedit /usr/share/applications/lighttable.desktop
 
-通过Gedit文本编辑器打开文件后, 粘贴下面的内容并保存:
+通过 Gedit 文本编辑器打开文件后,粘贴下面的内容并保存:
 
     [Desktop Entry]
     Version=1.0
@@ -81,7 +78,7 @@ LightTable 0.8.0的改动:
     Exec=/opt/LightTable/LightTable -n
     OnlyShowIn=Unity;
     
-        [Desktop Action Document]
+    [Desktop Action Document]
     Name=New File
     Exec=/opt/LightTable/LightTable --command new_file
     OnlyShowIn=Unity;
@@ -90,15 +87,15 @@ LightTable 0.8.0的改动:
 
 ![lighttable-launcher](http://ubuntuhandbook.org/wp-content/uploads/2015/12/lighttable-launcher.jpg)
 
-最后,从dash工具或者是应用启动器打开IDE,好好享受它吧!
+最后,从 dash 工具或者是应用启动器打开 IDE,好好享受它吧!
 
 --------------------------------------------------------------------------------
 
 via: http://ubuntuhandbook.org/index.php/2015/12/install-light-table-0-8-ubuntu-14-04/
 
 作者:[Ji m][a]
-译者:[译者ID](https://github.com/译者ID)
-校对:[校对者ID](https://github.com/校对者ID)
+译者:[zky001](https://github.com/zky001)
+校对:[wxy](https://github.com/wxy)
 
 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
 

From f66e44d3ec3a016235e5e674ecd252c476dfdf9f Mon Sep 17 00:00:00 2001
From: wxy 
Date: Wed, 16 Mar 2016 11:42:10 +0800
Subject: [PATCH 0532/1469] PUB:20160218 Mozilla contributor creates diabetes
 project for the masses

@ynmlml
---
 ...creates diabetes project for the masses.md | 38 ++++++++++++++
 ...creates diabetes project for the masses.md | 51 -------------------
 2 files changed, 38 insertions(+), 51 deletions(-)
 create mode 100644 published/20160218 Mozilla contributor creates diabetes project for the masses.md
 delete mode 100644 translated/tech/20160218 Mozilla contributor creates diabetes project for the masses.md

diff --git a/published/20160218 Mozilla contributor creates diabetes project for the masses.md b/published/20160218 Mozilla contributor creates diabetes project for the masses.md
new file mode 100644
index 0000000000..abaf2fe9d6
--- /dev/null
+++ b/published/20160218 Mozilla contributor creates diabetes project for the masses.md	
@@ -0,0 +1,38 @@
+Mozilla 贡献者为大众创建糖尿病项目
+================================================================
+
+![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/myopensourcestory.png?itok=6TXlAkFi)
+
+
+我的开源生涯从我还是一名高中生开始,我总想着自己能成为一名黑客,没有什么恶意的,只是喜欢钻研代码和硬件那种。我第一次接触开源是2001年,我安装了我的第一个Linux发行版[Lindows](https://en.wikipedia.org/wiki/Linspire)。当然,我也是[Mozilla Firefox](https://www.mozilla.org/en-US/firefox/new/?utm_source=firefox-com&utm_medium=referral)的早期用户。
+
+由于我很早使用Linux,我用的第一个版本是 Lindows 1.0.4(如果我没记错的话),我就立即爱上了它。我没在Lindows上呆太久,而是活跃于多个发行版([Debian](https://www.debian.org/), 
+[Puppy Linux](http://puppylinux.org/main/Overview%20and%20Getting%20Started.htm), [SUSE](https://www.suse.com/), 
+[Slackware](http://www.slackware.com/), [Ubuntu](http://ubuntu.com/)),多年来我一直每天使用着开源软件,从青少年时候直到我成年。
+
+最后,我坚持使用Ubuntu。大概是在Hardy Heron(LCTT 译注:Ubuntu8.04 LTS)发布时候,我开始第一次为Ubuntu做些贡献,在IRC频道和当地社区帮助那些需要帮助的用户。我是通过Ubuntu认识开源的,它在我心里总有着特殊的意义。Ubuntu背后的社区的是非常多样化的、热情的、友好的,每个人都做些共享,是他们共同的目标也是个人目标,这成为他们为开源贡献的动力。
+
+在为Ubuntu贡献一段时间后,我开始了为一些上游项目作贡献,比如Debian、[GNOME](https://www.gnome.org/)、 [Ganeti](https://code.google.com/p/ganeti/),还有许多其他的开源项目。在过去的几年里,我为超过40个开源项目贡献过,有些小的,也有很大的。
+
+在Ubuntu项目方向上有些变化之后,我最终觉得,这不仅对于我是一个尝试新东西的机遇,而且也是我给一些新东西贡献的时候。所以我在2009年参与了Mozilla项目,在IRC帮忙,最终通过参与[Mozilla WebFWD program](https://webfwd.org/),成为一名团队成员,然后是[Mozilla Reps Program](https://reps.mozilla.org/),[Mozilla DevRel Program](https://wiki.mozilla.org/Devrel),刚过两年时间,我成为了火狐社区的发布经理,负责监督Firefox Nightly和Firefox ESR的发布。相比其他开源项目,在为Mozilla贡献中会获得更多有益的经验。在所有我参与过的开源社区中,Mozilla是最不同的,最大的也是最友好的。
+
+这些年来,关于开源我觉得,我越来越遵循自由软件价值观、捍卫隐私和许可协议合规,以及在开放的氛围下工作。我相信这三个主题对于开源来说是非常重要的,虽然许多人并没在意到提倡它们是很重要的。
+
+今天在这,我已不再是别人的开源项目的全职贡献者。最近我被诊断出患有糖尿病,我看到了开源软件中健康软件不是很丰富这一缺口。确实,它不像其它开源软件应用如Linux发行版或浏览器那样活跃。
+
+我最近创立了自己的开源项目[Glucosio](http://www.glucosio.org/),带给人们糖尿病管理和研究的开源软件。经过几年来对开源项目的贡献,和见识过的多种组织结构,使得我作为项目领导能够得心应手。我对于Glucosio的未来很兴奋,但最重要的是未来的开源将在医疗健康领域发展的如何。
+
+医疗保健软件的创新具有很大潜力,我想我们很快就会看到用于改善医疗卫生保健的开源新方案。
+
+
+------------------------------------------------------------------------------
+
+via: https://opensource.com/life/15/11/my-open-source-story-ben-kerensa
+
+作者:[Benjamin Kerensa][a]
+译者:[ynmlml](https://github.com/ynmll)
+校对:[wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:https://opensource.com/users/bkerensa
diff --git a/translated/tech/20160218 Mozilla contributor creates diabetes project for the masses.md b/translated/tech/20160218 Mozilla contributor creates diabetes project for the masses.md
deleted file mode 100644
index de61ff1d7b..0000000000
--- a/translated/tech/20160218 Mozilla contributor creates diabetes project for the masses.md	
+++ /dev/null
@@ -1,51 +0,0 @@
-Mozilla贡献者为群众创建糖尿病项目
-================================================================
-
-![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/myopensourcestory.png?itok=6TXlAkFi)
-
-
-我的开源生涯从我还是一名高中生开始,我总想着自己能成为一名黑客,没有什么恶意的,只是喜欢钻研代码和硬件那种。我第一次接触开源是2001年,
-我安装了我的第一个Linux发行版[Lindows](https://en.wikipedia.org/wiki/Linspire)。当然,我也是[Mozilla Firefox](https://www.mozilla.org/en-US/firefox/new/?utm_source=firefox-com&utm_medium=referral)的早期用户。
-
-由于我很早使用Linux,我用的第一个版本是1.0.4(如果我没记错的话),我就立即爱上了它。我没在Lindows上呆太久,
-而是活跃于多个发行版([Debian](https://www.debian.org/), 
-[Puppy Linux](http://puppylinux.org/main/Overview%20and%20Getting%20Started.htm), [SUSE](https://www.suse.com/), 
-[Slackware](http://www.slackware.com/), [Ubuntu](http://ubuntu.com/)),多年来我一直每天使用着开源软件,从青少年时候直到我成年。
-
-最后,我坚持使用Ubuntu。大概是在Hardy Heron(译者注:Ubuntu8.04 LTS)发布时候,我开始第一次为Ubuntu做些贡献,在IRC频道和当地社区
-帮助那些需要帮助的用户。我是通过Ubuntu认识开源的,它在我心里总有着特殊的意义。Ubuntu背后的社区的是非常多样化的,热情的,友好的,
-每个人都做些共享,是他们共同的目标也是个人目标,这成为他们为开源贡献的动力。
-
-在为Ubuntu贡献一段时间后,我开始了为一些上游项目作贡献,比如Debian, [GNOME](https://www.gnome.org/), 
-[Ganeti](https://code.google.com/p/ganeti/),还有许多其他的开源项目。
-在过去的几年里,我为超过40个开源项目贡献过,有些小的,也有很大的。
-
-在Ubuntu项目方向上有些变化之后,我最终决定不仅对于我是时候该尝试新东西,而且我也想贡献一些新的东西。所以我在2009年参与Mozilla,
-在IRC帮忙,最终通过参与[Mozilla WebFWD program](https://webfwd.org/),成为一名团队成员,接着[Mozilla Reps Program](https://reps.mozilla.org/),
-[Mozilla DevRel Program](https://wiki.mozilla.org/Devrel),刚过两年时间,我成为了火狐社区的发布经理,负责监督Firefox Nightly
-和Firefox ESR的发布。比为其他开源项目,在为Mozilla贡献中会获得更多有益的经验。在所有我参与过的开源社区中,Mozilla是最不同的
-,最大的也是最友好的。
-
-这些年来,关于开源我觉得,免费软件,更具安全的隐私和尊重许可,以及公开的工作,我越来越与这样的价值观相一致。我相信这三个主题
-对于开源来说是非常重要的,虽然许多人并没在意到提倡它们是很重要的。
-
-今天在这,我已不再是全职的他人开源项目的贡献者。最近我被诊断出患有糖尿病,我看到了开源软件中健康软件不是很丰富这一缺口。确实,
-它不像其它开源软件应用如Linux发行版或浏览器那样活跃。
-
-我最近创立了自己的开源项目[Glucosio](http://www.glucosio.org/),带给人们糖尿病管理和研究的开源软件。经过几年来对开源项目的贡献,
-和见过的多种架构,使得我作为项目领导能够得心应手。我对于Glucosio的未来很兴奋,但最重要的是未来的开源将在医疗健康领域发展的如何。
-
-医疗保健软件的创新具有很大潜力,我想我们很快就会看到用于改善医疗卫生保健的开源新方案。
-
-
-------------------------------------------------------------------------------
-
-via: https://opensource.com/life/15/11/my-open-source-story-ben-kerensa
-
-作者:[opensource.com][a]
-译者:[ynmlml](https://github.com/ynmll)
-校对:[校对者ID](https://github.com/校对者ID)
-
-本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
-
-[a]:opensource.com

From 4b8508de7adefa690bd498264f865508d7c8b649 Mon Sep 17 00:00:00 2001
From: VicYu 
Date: Wed, 16 Mar 2016 16:39:41 +0800
Subject: [PATCH 0533/1469] Translating

---
 .../tech/20160226 How to use Python to hack your Eclipse IDE.md | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sources/tech/20160226 How to use Python to hack your Eclipse IDE.md b/sources/tech/20160226 How to use Python to hack your Eclipse IDE.md
index 770c6db479..9f1b1ed359 100644
--- a/sources/tech/20160226 How to use Python to hack your Eclipse IDE.md	
+++ b/sources/tech/20160226 How to use Python to hack your Eclipse IDE.md	
@@ -1,3 +1,5 @@
+	Vic020
+
 How to use Python to hack your Eclipse IDE
 ==============================================
 

From b54dcc381cb10e42347e2e1a93c24297b889a3bd Mon Sep 17 00:00:00 2001
From: wxy 
Date: Wed, 16 Mar 2016 20:39:09 +0800
Subject: [PATCH 0534/1469] PUB:20151027 How to Install Ghost with Nginx on
 FreeBSD 10.2

@ictlyh
---
 ...027 How to Install Ghost with Nginx on FreeBSD 10.2.md | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
 rename {translated/tech => published}/20151027 How to Install Ghost with Nginx on FreeBSD 10.2.md (94%)

diff --git a/translated/tech/20151027 How to Install Ghost with Nginx on FreeBSD 10.2.md b/published/20151027 How to Install Ghost with Nginx on FreeBSD 10.2.md
similarity index 94%
rename from translated/tech/20151027 How to Install Ghost with Nginx on FreeBSD 10.2.md
rename to published/20151027 How to Install Ghost with Nginx on FreeBSD 10.2.md
index f8d78c88f9..c961d47c8a 100644
--- a/translated/tech/20151027 How to Install Ghost with Nginx on FreeBSD 10.2.md	
+++ b/published/20151027 How to Install Ghost with Nginx on FreeBSD 10.2.md	
@@ -1,6 +1,6 @@
 如何在 FreeBSD 10.2 上安装使用 Nginx 的 Ghost
 ================================================================================
-Node.js 是用于开发服务器端应用程序的开源运行时环境。Node.js 应用使用 JavaScript 编写,能在任何有 Node.js 运行时的服务器上运行。它跨平台支持 Linux、Windows、OSX、IBM AIX,也包括 FreeBSD。Node.js 是 Ryan Dahl 以及在 Joyent 工作的其他开发者于 2009 年创建的。它的设计目标就是构建可扩展的网络应用程序。
+Node.js 是用于开发服务器端应用程序的开源的运行时环境。Node.js 应用使用 JavaScript 编写,能在任何有 Node.js 运行时的服务器上运行。它跨平台支持 Linux、Windows、OSX、IBM AIX,也包括 FreeBSD。Node.js 是 Ryan Dahl 以及在 Joyent 工作的其他开发者于 2009 年创建的。它的设计目标就是构建可扩展的网络应用程序。
 
 Ghost 是使用 Node.js 编写的博客平台。它不仅开源,而且有很漂亮的界面设计、对用户友好并且免费。它允许你快速地在网络上发布内容,或者创建你的混合网站。
 
@@ -97,7 +97,7 @@ Ghost 是使用 Node.js 编写的博客平台。它不仅开源,而且有很
 
     npm start --production
 
-通过访问服务器 ip 和 2368 号端口验证。
+通过访问服务器 ip 和 2368 号端口验证一下。
 
 ![Ghost 安装完成](http://blog.linoxide.com/wp-content/uploads/2015/10/Ghost-Installed.png)
 
@@ -189,7 +189,7 @@ Ghost 是使用 Node.js 编写的博客平台。它不仅开源,而且有很
 
 ### 第五步 - 为 Ghost 安装和配置 Nginx ###
 
-默认情况下,ghost 会以单机模式运行,你可以不用 Nginx、apache 或 IIS web 服务器直接运行它。但在这篇指南中我们会安装和配置 nginx 和 ghost 一起使用。
+默认情况下,ghost 会以独立模式运行,你可以不用 Nginx、apache 或 IIS web 服务器直接运行它。但在这篇指南中我们会安装和配置 nginx 和 ghost 一起使用。
 
 用 pkg 命令从 freebsd 库中安装 nginx:
 
@@ -289,7 +289,7 @@ via: http://linoxide.com/linux-how-to/install-ghost-nginx-freebsd-10-2/
 
 作者:[Arul][a]
 译者:[ictlyh](http://mutouxiaogui.cn/blog/)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
 
 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
 

From b81f27ce1f9d56bf8605ac7b1e384efcd434e889 Mon Sep 17 00:00:00 2001
From: wxy 
Date: Wed, 16 Mar 2016 21:19:02 +0800
Subject: [PATCH 0535/1469] PUB:20151105 Linux FAQs with Answers--How to
 install Ubuntu desktop behind a proxy

@strugglingyouth
---
 ... Answers--How to install Ubuntu desktop behind a proxy.md | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
 rename {translated/tech => published}/20151105 Linux FAQs with Answers--How to install Ubuntu desktop behind a proxy.md (97%)

diff --git a/translated/tech/20151105 Linux FAQs with Answers--How to install Ubuntu desktop behind a proxy.md b/published/20151105 Linux FAQs with Answers--How to install Ubuntu desktop behind a proxy.md
similarity index 97%
rename from translated/tech/20151105 Linux FAQs with Answers--How to install Ubuntu desktop behind a proxy.md
rename to published/20151105 Linux FAQs with Answers--How to install Ubuntu desktop behind a proxy.md
index b7c86609bd..0a215a066e 100644
--- a/translated/tech/20151105 Linux FAQs with Answers--How to install Ubuntu desktop behind a proxy.md	
+++ b/published/20151105 Linux FAQs with Answers--How to install Ubuntu desktop behind a proxy.md	
@@ -1,5 +1,4 @@
-
-Linux 有问必答 - 如何通过代理服务器安装 Ubuntu 桌面
+Linux 有问必答 - 如何通过代理服务器安装 Ubuntu 桌面版
 ================================================================================
 > **问题**: 我的电脑通过 HTTP 代理连接到公司网络。当我尝试从 CD-ROM 在计算机上安装 Ubuntu 桌面时,在检索文件时安装程序会被挂起,检索则不会完成,这可能是由于代理造成的。然而问题是,Ubuntu 的安装程序从不要求我在安装过程中配置代理。那我该怎么使用代理来安装 Ubuntu 桌面?
 
@@ -56,7 +55,7 @@ via: http://ask.xmodulo.com/install-ubuntu-desktop-behind-proxy.html
 
 作者:[Dan Nanni][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 c7fe3d5b930cebde86d79b5afe603ad451b0a988 Mon Sep 17 00:00:00 2001
From: XIAOYU <1136299502@qq.com>
Date: Thu, 17 Mar 2016 12:10:50 +0800
Subject: [PATCH 0536/1469] translating by xiaoyu33

translating by xiaoyu33
---
 ...1208 10 tools for visual effects in Linux with Kdenlive.md | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sources/talk/yearbook2015/20151208 10 tools for visual effects in Linux with Kdenlive.md b/sources/talk/yearbook2015/20151208 10 tools for visual effects in Linux with Kdenlive.md
index bf2ba1ff25..690b2c8186 100644
--- a/sources/talk/yearbook2015/20151208 10 tools for visual effects in Linux with Kdenlive.md	
+++ b/sources/talk/yearbook2015/20151208 10 tools for visual effects in Linux with Kdenlive.md	
@@ -1,3 +1,5 @@
+translating by xiaoyu33
+
 10 tools for visual effects in Linux with Kdenlive
 ================================================================================
 ![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life-uploads/kdenlivetoolssummary.png)
@@ -152,4 +154,4 @@ via: https://opensource.com/life/15/12/10-kdenlive-tools
 [3]:http://frei0r.dyne.org/
 [4]:http://www.kodak.com/global/en/professional/products/films/bw/triX2.jhtml
 [5]:https://en.wikipedia.org/wiki/Fear_and_Loathing_in_Las_Vegas_(film)
-[6]:https://en.wikipedia.org/wiki/Dead_Island
\ No newline at end of file
+[6]:https://en.wikipedia.org/wiki/Dead_Island

From cd2f210f4ea0de2027957bd75020c760b0813dd5 Mon Sep 17 00:00:00 2001
From: martin qi 
Date: Thu, 17 Mar 2016 21:53:14 +0800
Subject: [PATCH 0537/1469] =?UTF-8?q?=E5=BC=80=E5=A7=8B=E7=BF=BB=E8=AF=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 ...0317 What we learned in Seoul with AlphaGo | 51 +++++++++++++++++++
 1 file changed, 51 insertions(+)
 create mode 100644 sources/news/20160317 What we learned in Seoul with AlphaGo

diff --git a/sources/news/20160317 What we learned in Seoul with AlphaGo b/sources/news/20160317 What we learned in Seoul with AlphaGo
new file mode 100644
index 0000000000..8eb12005d3
--- /dev/null
+++ b/sources/news/20160317 What we learned in Seoul with AlphaGo	
@@ -0,0 +1,51 @@
+martin
+
+What we learned in Seoul with AlphaGo
+================================================================================
+Go isn't just a game—it's a living, breathing culture of players, analysts, fans, and legends. Over the last 10 days in Seoul, South Korea, we've been lucky enough to witness some of that incredible excitement firsthand. We've also had the chance to see something that's never happened before: [DeepMind's][1] AlphaGo took on and defeated legendary Go player, Lee Sedol (9-dan professional with 18 world titles), marking a major milestone for artificial intelligence.
+
+![Pedestrians checking in on the AlphaGo vs. Lee Sedol Go match on the streets of Seoul (March 13)](https://1.bp.blogspot.com/-vfgUcjyMOmM/Vumk5gXD98I/AAAAAAAASDI/frbYidb1u6gTKGcvFOf8iQVsr9PLoRlBQ/s1600/Press%2BCenter%2BOutdoor%2BScreen%2B2.jpg)
+
+Go may be one of the oldest games in existence, but the attention to our five-game tournament exceeded even our wildest imaginations. Searches for Go rules and Go boards spiked in the U.S. In China, tens of millions watched live streams of the matches, and the “Man vs. Machine Go Showdown” hashtag saw 200 million pageviews on Sina Weibo. Sales of Go boards even [surged][2] in Korea.
+
+Our public test of AlphaGo, however, was about more than winning at Go. We founded DeepMind in 2010 to create general-purpose artificial intelligence (AI) that can learn on its own—and, eventually, be used as a tool to help society solve some of its biggest and most pressing problems, from climate change to disease diagnosis.
+
+Like many researchers before us, we've been developing and testing our algorithms through games. We first revealed [AlphaGo][3] in January—the first AI program that could beat a professional player at the most complex board game mankind has devised, using [deep learning][4] and [reinforcement learning][5]. The [ultimate challenge][6] was for AlphaGo to take on the best Go player of the past decade—Lee Sedol.
+
+To everyone's surprise, including ours, AlphaGo won four of the five games. Commentators noted that AlphaGo played many unprecedented, creative, and even [“beautiful”][7] moves. Based on our data, AlphaGo's bold [move 37][8] in Game 2 had a 1 in 10,000 chance of being played by a human. Lee countered with innovative moves of his own, such as his [move 78][9] against AlphaGo in Game 4—again, a 1 in 10,000 chance of being played—which ultimately resulted in a win.
+
+The final score was 4-1. We're contributing the $1 million in prize money to organizations that support science, technology, engineering and math (STEM) education and Go, as well as UNICEF.
+
+We've learned two important things from this experience. First, this test bodes well for AI's potential in solving other problems. AlphaGo has the ability to look “globally” across a board—and find solutions that humans either have been trained not to play or would not consider. This has huge potential for using AlphaGo-like technology to find solutions that humans don't necessarily see in other areas. Second, while the match has been widely billed as "man vs. machine," AlphaGo is really a human achievement. Lee Sedol and the AlphaGo team both pushed each other toward new ideas, opportunities and solutions—and in the long run that's something we all stand to benefit from.
+
+But as they say about Go in Korean: “Don't be arrogant when you win or you'll lose your luck.” This is just one small, albeit significant, step along the way to making machines smart. We've demonstrated that our cutting edge deep reinforcement learning techniques can be used to make strong Go and [Atari][10] players. Deep neural networks are already used at Google for specific tasks—like [image recognition][11], [speech recognition][12], and [Search ranking][13]. However, we're still a long way from a machine that can learn to flexibly perform the full range of intellectual tasks a human can—the hallmark of true [artificial general intelligence][14].
+
+![Demis and Lee Sedol hold up the signed Go board from the Google DeepMind Challenge Match](https://4.bp.blogspot.com/-LkxNvsR-e1I/Vumk5gmProI/AAAAAAAASDM/J55Y2psqzOwWZ3kau2Pgz6xmazo7XDj_Q/s1600/A26U6150.jpg)
+
+With this tournament, we wanted to test the limits of AlphaGo. The genius of Lee Sedol did that brilliantly—and we'll spend the next few weeks studying the games he and AlphaGo played in detail. And because the machine learning methods we've used in AlphaGo are general purpose, we hope to apply some of these techniques to other challenges in the future. Game on!
+
+--------------------------------------------------------------------------------
+
+via: https://googleblog.blogspot.com/2016/03/what-we-learned-in-seoul-with-alphago.html
+
+作者:[Demis Hassabis][a]
+译者:[译者ID](https://github.com/译者ID)
+校对:[校对者ID](https://github.com/校对者ID)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:http://demishassabis.com/
+[1]:https://deepmind.com/
+[2]:http://www.hankookilbo.com/m/v/3e7deaa26a834f76929a1689ecd388ea
+[3]:https://googleblog.blogspot.com/2016/01/alphago-machine-learning-game-go.html
+[4]:https://en.wikipedia.org/wiki/Deep_learning
+[5]:https://en.wikipedia.org/wiki/Reinforcement_learning
+[6]:https://deepmind.com/alpha-go.html
+[7]:http://www.wired.com/2016/03/sadness-beauty-watching-googles-ai-play-go/
+[8]:https://youtu.be/l-GsfyVCBu0?t=1h17m50s
+[9]:https://youtu.be/yCALyQRN3hw?t=3h10m25s
+[10]:http://googleresearch.blogspot.sg/2015/02/from-pixels-to-actions-human-level.html
+[11]:http://googleresearch.blogspot.sg/2013/06/improving-photo-search-step-across.html
+[12]:http://googleresearch.blogspot.sg/2015/08/the-neural-networks-behind-google-voice.html
+[13]:http://www.bloomberg.com/news/articles/2015-10-26/google-turning-its-lucrative-web-search-over-to-ai-machines
+[14]:https://en.wikipedia.org/wiki/Artificial_general_intelligence

From f2a488cce957410c1b7d8dc0a06a1e1b58cef61f Mon Sep 17 00:00:00 2001
From: martin qi 
Date: Thu, 17 Mar 2016 21:55:25 +0800
Subject: [PATCH 0538/1469] Rename 20160317 What we learned in Seoul with
 AlphaGo to 20160317 What we learned in Seoul with AlphaGo.md

---
 ... AlphaGo => 20160317 What we learned in Seoul with AlphaGo.md} | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename sources/news/{20160317 What we learned in Seoul with AlphaGo => 20160317 What we learned in Seoul with AlphaGo.md} (100%)

diff --git a/sources/news/20160317 What we learned in Seoul with AlphaGo b/sources/news/20160317 What we learned in Seoul with AlphaGo.md
similarity index 100%
rename from sources/news/20160317 What we learned in Seoul with AlphaGo
rename to sources/news/20160317 What we learned in Seoul with AlphaGo.md

From 5af1e26b348989cfe91d46be5fb42c49440a64b5 Mon Sep 17 00:00:00 2001
From: wxy 
Date: Thu, 17 Mar 2016 22:50:03 +0800
Subject: [PATCH 0539/1469] PUB:20151104 Optimize Web Delivery with these Open
 Source Tools
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

@fw8899 用心了~
---
 ...b Delivery with these Open Source Tools.md | 204 ++++++++++++++++++
 ...b Delivery with these Open Source Tools.md | 195 -----------------
 2 files changed, 204 insertions(+), 195 deletions(-)
 create mode 100644 published/20151104 Optimize Web Delivery with these Open Source Tools.md
 delete mode 100644 translated/share/20151104 Optimize Web Delivery with these Open Source Tools.md

diff --git a/published/20151104 Optimize Web Delivery with these Open Source Tools.md b/published/20151104 Optimize Web Delivery with these Open Source Tools.md
new file mode 100644
index 0000000000..e2aed5c634
--- /dev/null
+++ b/published/20151104 Optimize Web Delivery with these Open Source Tools.md	
@@ -0,0 +1,204 @@
+五大开源 Web 代理软件横向比较:Squid、Privoxy、Varnish、Polipo、Tinyproxy
+================================================================================
+Web 代理软件转发 HTTP 请求时并不会改变数据流量。它们可以配置成透明代理,而无需客户端配置。它们还可以作为反向代理放在网站的前端;这样缓存服务器可以为一台或多台 web 服务器提供无限量的用户服务。
+
+网站代理功能多样,有着宽泛的用途:从缓存页面、DNS 和其他查询,到加速 web 服务器响应、降低带宽消耗。代理软件广泛用于大型高访问量的网站,比如纽约时报、卫报, 以及社交媒体网站如 Twitter、Facebook 和 Wikipedia。
+
+页面缓存已经成为优化单位时间内所能吞吐的数据量的至关重要的机制。好的 Web 缓存还能降低延迟,尽可能快地响应页面,让终端用户不至于因等待内容的时间过久而失去耐心。它们还能将频繁访问的内容缓存起来以节省带宽。如果你需要降低服务器负载并改善网站内容响应速度,那缓存软件能带来的好处就绝对值得探索一番。
+
+为深入探查 Linux 下可用的相关软件的质量,我列出了下边5个优秀的开源 web 代理工具。它们中有些功能完备强大,也有几个只需很低的资源就能运行。
+
+### Squid ###
+
+Squid 是一个高性能、开源的代理缓存服务器和 Web 缓存进程,支持 FTP、Internet Gopher、HTTPS 和 SSL 等多种协议。它通过一个非阻塞的、I/O 事件驱动的单一进程处理所有的 IPV4 或 IPV6 协议请求。
+
+Squid 由一个主服务程序 squid,和 DNS 查询程序 dnsserver,另外还有一些可选的请求重写、执行认证程序组件,及一些管理和客户端工具构成。
+
+Squid 提供了丰富的访问控制、认证和日志环境, 用于开发 web 代理和内容服务网站应用。
+
+其特性包括:
+
+- Web 代理:
+    - 通过缓存来降低访问时间和带宽使用
+    - 将元数据和访问特别频繁的对象缓存到内存中
+    - 缓存 DNS 查询
+    - 支持非阻塞的 DNS 查询
+    - 实现了失败请求的未果缓存
+- Squid 缓存可架设为层次结构,或网状结构以节省额外的带宽
+- 通过广泛的访问控制来执行网站访问策略
+- 隐匿请求,如禁用或修改客户端 HTTP 请求头特定属性
+- 反向代理
+- 媒体范围(media-range)限制
+- 支持 SSL
+- 支持 IPv6
+- 错误页面的本地化 - Squid 可以根据访问者的语言选项对每个请求展示本地化的错误页面
+- 连接固定(Connection Pinning )(用于 NTLM Auth Passthrough) - 一种允许 Web 服务器通过 Web 代理使用Microsoft NTLM 安全认证替代 HTTP 标准认证的方案
+- 支持服务质量 (QoS, Quality of Service) 流
+    - 选择一个 TOS/Diffserv 值来标记本地命中
+    - 选择一个 TOS/Diffserv 值来标记对端命中
+    - 选择性地仅标记同级或上级请求
+    - 允许任意发往客户端的 HTTP 响应保持由远程服务器处响应的 TOS 值
+    - 对收到的远程服务器的 TOS 值,在复制之前对指定位进行掩码操作,再发送到客户端
+- SSL Bump (用于 HTTPS 过滤和适配) - Squid-in-the-middle,在 CONNECT 方式的 SSL 隧道中,用配置化的客户端和服务器端证书,对流量进行解密和加密
+- 支持适配模块
+- ICAP 旁路和重试增强 - 通过完全的旁路和动态链式路由扩展 ICAP,来处理多多个适应性服务。
+- 支持 ICY 流式协议 - 俗称 SHOUTcast 多媒体流
+- 动态 SSL 证书生成
+- 支持 ICAP 协议 (Internet Content Adaptation Protocol)
+- 完整的请求日志记录
+- 匿名连接
+
+--
+- 网站: [www.squid-cache.org][1]
+- 开发: 美国国家应用网络研究实验室(NLANR)和网络志愿者
+- 授权: GNU GPL v2
+- 版本号: 4.0.1
+
+### Privoxy ###
+
+Privoxy (Privacy Enhancing Proxy) 是一个非缓存类 Web 代理软件,它自带的高级过滤功能可以用来增强隐私保护、修改页面内容和 HTTP 头部信息、访问控制,以及去除广告和其它招人反感的互联网垃圾。Privoxy 的配置非常灵活,能充分定制已满足各种各样的需求和偏好。它支持单机和多用户网络两种模式。
+
+Privoxy 使用 action 规则来处理浏览器和远程站点间的数据流。
+
+其特性包括: 
+
+- 高度配置化——可以完全定制你的配置
+- 广告拦截
+- Cookie 管理
+- 支持“Connection: keep-alive”。可以无视客户端配置而保持外发的持久连接
+- 支持 IPv6
+- 标签化(Tagging),允许按照客户端和服务器的请求头进行处理
+- 作为拦截(intercepting)代理器运行
+- 巧妙的动作(action)和过滤机制用来处理服务器和客户端的 HTTP 头部
+- 可以与其他代理软件链式使用
+- 整合了基于浏览器的配置和控制工具,能在线跟踪规则和过滤效果,可远程开关
+- 页面过滤(文本替换、根据尺寸大小删除广告栏, 隐藏的“web-bugs”元素和 HTML 容错等)
+- 模块化的配置使得标准配置和用户配置可以存放于不同文件中,这样安装更新就不会覆盖用户的个性化设置
+- 配置文件支持 Perl 兼容的正则表达式,以及更为精妙和灵活的配置语法
+- GIF 去动画
+- 旁路处理大量点击跟踪(click-tracking)脚本(避免脚本重定向)
+- 大多数代理生成的页面(例如 "访问受限" 页面)可由用户自定义HTML模板
+- 自动监测配置文件的修改并重新读取
+- 大多数功能可以基于每个站点或每个 URL 位置来进行控制
+
+--
+
+- 网站: [www.privoxy.org][2]
+- 开发: Fabian Keil(开发领导者), David Schmidt, 和众多其他贡献者
+- 授权: GNU GPL v2
+- 版本号: 3.4.2
+
+### Varnish Cache ###
+
+Varnish Cache 是一个为性能和灵活性而生的 web 加速器。它新颖的架构设计能带来显著的性能提升。根据你的架构,通常情况下它能加速响应速度300-1000倍。Varnish 将页面存储到内存,这样 web 服务器就无需重复地创建相同的页面,只需要在页面发生变化后重新生成。页面内容直接从内存中访问,当然比其他方式更快。
+
+此外 Varnish 能大大提升响应 web 页面的速度,用在任何应用服务器上都能使网站访问速度大幅度地提升。
+
+按经验,Varnish Cache 比较经济的配置是1-16GB内存+ SSD 固态硬盘。
+
+其特性包括: 
+
+- 新颖的设计
+- VCL - 非常灵活的配置语言。VCL 配置会转换成 C,然后编译、加载、运行,灵活且高效
+- 能使用 round-robin 轮询和随机分发两种方式来负载均衡,两种方式下后端服务器都可以设置权重
+- 基于 DNS、随机、散列和客户端 IP 的分发器(Director)
+- 多台后端主机间的负载均衡
+- 支持 Edge Side Includes,包括拼装压缩后的 ESI 片段
+- 重度多线程并发
+- URL 重写
+- 单 Varnish 能够缓存多个虚拟主机
+- 日志数据存储在共享内存中
+- 基本的后端服务器健康检查
+- 优雅地处理后端服务器“挂掉”
+- 命令行界面的管理控制台
+- 使用内联 C 语言来扩展 Varnish
+- 可以与 Apache 用在相同的系统上
+- 单个系统可运行多个 Varnish
+- 支持 HAProxy 代理协议。该协议在每个收到的 TCP 请求——例如 SSL 终止过程中——附加一小段 http 头信息,以记录客户端的真实地址
+- 冷热 VCL 状态
+- 可以用名为 VMOD 的 Varnish 模块来提供插件扩展
+- 通过 VMOD 定义后端主机
+- Gzip 压缩及解压
+- HTTP 流的通过和获取
+- 神圣模式和优雅模式。用 Varnish 作为负载均衡器,神圣模式下可以将不稳定的后端服务器在一段时间内打入黑名单,阻止它们继续提供流量服务。优雅模式允许 Varnish 在获取不到后端服务器状态良好的响应时,提供已过期版本的页面或其它内容。
+- 实验性支持持久化存储,无需 LRU 缓存淘汰
+
+--
+
+- 网站: [www.varnish-cache.org][3]
+- 开发: Varnish Software
+- 授权: FreeBSD
+- 版本号: 4.1.0
+
+### Polipo ###
+
+Polipo 是一个开源的 HTTP 缓存代理,只需要非常低的资源开销。
+
+它监听来自浏览器的 web 页面请求,转发到 web 服务器,然后将服务器的响应转发到浏览器。在此过程中,它能优化和整形网络流量。从本质来讲 Polipo 与 WWWOFFLE 很相似,但其实现技术更接近于 Squid。
+
+Polipo 最开始的目标是作为一个兼容 HTTP/1.1 的代理,理论它能在任何兼容 HTTP/1.1 或更早的 HTTP/1.0 的站点上运行。
+
+其特性包括:
+
+- HTTP 1.1、IPv4 & IPv6、流量过滤和隐私保护增强
+- 如确认远程服务器支持的话,则无论收到的请求是管道处理过的还是在多个连接上同时收到的,都使用 HTTP/1.1 管道(pipelining)
+- 下载被中断时缓存起始部分,当需要续传时用区间(Range)请求来完成下载
+- 将 HTTP/1.0 的客户端请求升级为 HTTP/1.1,然后按照客户端支持的级别进行升级或降级后回复
+- 全面支持 IPv6 (作用域(链路本地)地址除外)
+- 作为 IPv4 和 IPv6 网络的网桥
+- 内容过滤
+- 能使用 Poor Man 多路复用技术(Poor Man's Multiplexing)降低延迟
+- 支持 SOCKS 4 和 SOCKS 5 协议
+- HTTPS 代理
+- 扮演透明代理的角色
+- 可以与 Privoxy 或 tor 一起运行
+
+--
+
+- 网站: [www.pps.univ-paris-diderot.fr/~jch/software/polipo/][4]
+- 开发: Juliusz Chroboczek, Christopher Davis
+- 授权: MIT License
+- 版本号: 1.1.1
+
+### Tinyproxy ###
+
+Tinyproxy 是一个轻量级的开源 web 代理守护进程,其设计目标是快而小。它适用于需要完整 HTTP 代理特性,但系统资源又不足以运行大型代理的场景,比如嵌入式部署。
+
+Tinyproxy 对小规模网络非常有用,这样的场合下大型代理会使系统资源紧张,或有安全风险。Tinyproxy 的一个关键特性是其缓冲连接的理念。从效果上看, Tinyproxy 对服务器的响应进行了高速缓冲,然后按照客户端能够处理的最高速度进行响应。该特性极大的降低了网络延滞带来的问题。 
+
+特性:
+
+- 易于修改
+- 隐匿模式 - 定义哪些 HTTP 头允许通过,哪些又会被拦截
+- 支持 HTTPS - Tinyproxy 允许通过 CONNECT 方法转发 HTTPS 连接,任何情况下都不会修改数据流量
+- 远程监控 - 远程访问代理统计数据,让你能清楚了解代理服务当前的忙碌状态
+- 平均负载监控 - 通过配置,当服务器的负载接近一定值后拒绝新连接
+- 访问控制 - 通过配置,仅允许指定子网或 IP 地址的访问
+- 安全 - 运行无需额外权限,减小了系统受到威胁的概率
+- 基于 URL 的过滤 - 允许基于域和URL的黑白名单
+- 透明代理 - 配置为透明代理,这样客户端就无需任何配置
+- 代理链 - 在流量出口处采用上游代理服务器,而不是直接转发到目标服务器,创建我们所说的代理链
+- 隐私特性 - 限制允许从浏览器收到的来自 HTTP 服务器的数据(例如 cookies),同时限制允许通过的从浏览器到 HTTP 服务器的数据(例如版本信息)
+- 低开销 - 使用 glibc 内存开销只有2MB,CPU 负载按并发连接数线性增长(取决于网络连接速度)。 Tinyproxy 可以运行在老旧的机器上而无需担心性能问题。 
+
+--
+
+- 网站: [banu.com/tinyproxy][5]
+- 开发: Robert James Kaes和其他贡献者
+- 授权: GNU GPL v2
+- 版本号: 1.8.3
+
+--------------------------------------------------------------------------------
+
+via: http://www.linuxlinks.com/article/20151101020309690/WebDelivery.html
+
+译者:[fw8899](https://github.com/fw8899)
+校对:[wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[1]:http://www.squid-cache.org/
+[2]:http://www.privoxy.org/
+[3]:https://www.varnish-cache.org/
+[4]:http://www.pps.univ-paris-diderot.fr/%7Ejch/software/polipo/
+[5]:https://banu.com/tinyproxy/
diff --git a/translated/share/20151104 Optimize Web Delivery with these Open Source Tools.md b/translated/share/20151104 Optimize Web Delivery with these Open Source Tools.md
deleted file mode 100644
index 21fd8ad8e2..0000000000
--- a/translated/share/20151104 Optimize Web Delivery with these Open Source Tools.md	
+++ /dev/null
@@ -1,195 +0,0 @@
-使用开源工具优化Web响应
-================================================================================
-Web代理软件转发HTTP请求时并不会改变数据流量。它们经过配置后,可以免客户端配置,作为透明代理。它们还可以作为网站反向代理的前端;缓存服务器在此能支撑一台或多台web服务器为海量用户提供服务。
-
-网站代理功能多样,有着宽泛的用途:从页面缓存、DNS和其他查询,到加速web服务器响应、降低带宽消耗。代理软件广泛用于大型高访问量的网站,比如纽约时报、卫报, 以及社交媒体网站如Twitter、Facebook和Wikipedia。
-
-页面缓存已经成为优化单位时间内所能吞吐的数据量的至关重要的机制。好的Web缓存还能降低延迟,尽可能快地响应页面,让终端用户不至于因等待内容的时间过久而失去耐心。它们还能将频繁访问的内容缓存起来以节省带宽。如果你需要降低服务器负载并改善网站内容响应速度,那缓存软件能带来的好处就绝对值得探索一番。
-
-为深入探查Linux下可用的相关软件的质量,我列出了下边5个优秀的开源web代理工具。它们中有些功能完备强大,也有几个只需很低的资源就能运行。
-
-### Squid ###
-
-Squid是一个高性能、开源的代理缓存和Web缓存服务器,支持FTP、Internet Gopher、HTTPS和SSL等多种协议。它通过一个非阻塞,I/O事件驱动的单一进程处理所有IPV4或IPV6上的请求。
-
-Squid由一个主服务程序squid,和DNS查询程序dnsserver,另外还有可选的请求重写、执行认证程序组件,及一些管理和客户端工具构成。
-
-Squid提供了丰富的访问控制、认证和日志环境, 用于开发web代理和内容服务网站应用。
-
-其特性包括:
-
-- Web代理:
-    - 通过缓存来降低访问时间和带宽使用
-    - 将元数据和特别热的对象缓存到内存中
-    - 缓存DNS查询
-    - 支持非阻塞的DNS查询
-    - 实现了失败请求的未果缓存
-- Squid缓存可架设为层次结构,或网状结构以节省额外的带宽
-- 通过可扩展的访问控制来执行网站使用条款
-- 隐匿请求,如禁用或修改客户端HTTP请求头特定属性
-- 反向代理
-- 媒体范围限制
-- 支持SSL
-- 支持IPv6
-- 错误页面的本地化 - Squid可以根据访问者的语言选项对每个请求展示本地化的错误页面
-- 连接Pinning(用于NTLM Auth Passthrough) - 一种通过Web代理,允许Web服务器使用Microsoft NTLM安全认证替代HTTP标准认证的方案
-- 支持服务质量 (QoS, Quality of Service) 流
-    - 选择一个TOS/Diffserv值来标记本地命中
-    - 选择一个TOS/Diffserv值来标记邻居命中
-    - 选择性地仅标记同级或上级请求
-    - 允许任意发往客户端的HTTP响应保持由远程服务器处响应的TOS值
-    - 对收到的远程服务器的TOS值,在复制之前对指定位进行掩码操作,再发送到客户端
-- SSL Bump (用于HTTPS过滤和适配) - Squid-in-the-middle,在CONNECT方式的SSL隧道中,用配置化的客户端和服务器端证书,对流量进行解密和加密
-- 支持适配模块
-- ICAP旁路和重试增强 - 通过完全的旁路和动态链式路由扩展ICAP,来处理多多个适应性服务。
-- 支持ICY流式协议 - 俗称SHOUTcast多媒体流
-- 动态SSL证书生产
-- 支持ICAP协议(Internet Content Adaptation Protocol)
-- 完整的请求日志记录
-- 匿名连接
-
-- 网站: [www.squid-cache.org][1]
-- 开发: 美国国家应用网络研究实验室和网络志愿者
-- 授权: GNU GPL v2
-- 版本号: 4.0.1
-
-### Privoxy ###
-
-Privoxy(Privacy Enhancing Proxy)是一个非缓存类Web代理软件,它自带的高级过滤功能用来增强隐私保护,修改页面内容和HTTP头部信息,访问控制,以及去除广告和其它招人反感的互联网垃圾。Privoxy的配置非常灵活,能充分定制已满足各种各样的需求和偏好。它支持单机和多用户网络两种模式。
-
-Privoxy使用Actions规则来处理浏览器和远程站点间的数据流。
-
-其特性包括: 
-
-- 高度配置化
-- 广告拦截
-- Cookie管理
-- 支持"Connection: keep-alive"。可以无视客户端配置而保持持久连接
-- 支持IPv6
-- 标签化,允许按照客户端和服务器的请求头进行处理
-- 作为拦截代理器运行
-- 巧妙的手段和过滤机制用来处理服务器和客户端的HTTP头部
-- 可以与其他代理软件链式使用
-- 整合了基于浏览器的配置和控制工具,能在线跟踪规则和过滤效果,可远程开关
-- 页面过滤(文本替换、根据尺寸大小删除广告栏, 隐藏的"web-bugs"元素和HTML容错等)
-- 模块化的配置使得标准配合和用户配置可以存放于不同文件中,这样安装更新就不会覆盖用户的个性化设置
-- 配置文件支持Perl兼容的正则表达式,以及更为精妙和灵活的配置语法
-- GIF去动画
-- 旁路处理大量click-tracking脚本(避免脚本重定向)
-- 大多数代理生成的页面(例如 "访问受限" 页面)可由用户自定义HTML模板
-- 自动监测配置文件的修改并重新读取
-- 最大特点是可以基于每个站点或每个位置来进行控制
-
-- 网站: [www.privoxy.org][2]
-- 开发: Fabian Keil(开发领导者), David Schmidt, 和众多其他贡献者
-- 授权: GNU GPL v2
-- 版本号: 3.4.2
-
-### Varnish Cache ###
-
-Varnish Cache是一个为性能和灵活性而生的web加速器。它新颖的架构设计能带来显著的性能提升。根据你的架构,通常情况下它能加速响应速度300-1000倍。Varnish将页面存储到内存,这样web服务器就无需重复地创建相同的页面,只需要在页面发生变化后重新生成。页面内容直接从内存中访问,当然比其他方式更快。
-
-此外Varnish能大大提升响应web页面的速度,用任何应用服务器都能使网站访问速度大幅度地提升。
-
-按按经验,Varnish Cache比较经济的配置是1-16GB内存+SSD固态硬盘。
-
-其特性包括: 
-
-- 新颖的设计
-- VCL - 非常灵活的配置语言。VCL配置转换成C,然后编译、加载、运行,灵活且高效
-- 能使用round-robin轮询和随机分发两种方式来负载均衡,两种方式下后端服务器都可以设置权重
-- 基于DNS、随机、散列和客户端IP的分发器
-- 多台后端主机间的负载均衡
-- 支持Edge Side Includes,包括拼装压缩后的ESI片段
-- 多线程并发
-- URL重写
-- 单Varnish缓存多个虚拟主机
-- 日志数据存储在共享内存中
-- 基本的后端服务器健康检查
-- 优雅地处理后端服务器“挂掉”
-- 命令行界面的管理控制台
-- 使用内联C来扩展Varnish
-- 可以与Apache用在相同的系统上
-- 单系统可运行多个Varnish
-- 支持HAProxy代理协议。该协议在每个收到的TCP请求,例如SSL终止过程中,附加小段头信息,以记录客户端的真实地址
-- 冷热VCL状态
-- 用名为VMODs的Varnish模块来提供插件扩展
-- 通过VMODs定义后端主机
-- Gzip压缩及解压
-- HTTP流通过和获取
-- 神圣模式和优雅模式。用Varnish作为负载均衡器,神圣模式下可以将不稳定的后端服务器在一段时间内打入黑名单,阻止它们继续提供流量服务。优雅模式允许Varnish在获取不到后端服务器状态良好的响应时,提供已过期版本的页面或其它内容。
-- 实验性支持持久化存储,无需LRU缓存淘汰
-
-- 网站: [www.varnish-cache.org][3]
-- 开发: Varnish Software
-- 授权: FreeBSD
-- 版本号: 4.1.0
-
-### Polipo ###
-
-Polipo是一个开源的HTTP缓存代理,只需要非常低的资源开销。
-
-它监听来自浏览器的web页面请求,转发到web服务器,然后将服务器的响应转发到浏览器。在此过程中,它能优化和整形网络流量。从本质来讲Polipo与WWWOFFLE很相似,但其实现技术更接近于Squid。
-
-Polipo最开始的目标是作为一个兼容HTTP/1.1的代理,理论它能在任何兼容HTTP/1.1或更早的HTTP/1.0的站点上运行。
-
-其特性包括:
-
-- HTTP 1.1、IPv4 & IPv6、流量过滤和隐私保护增强
-- 如确认远程服务器支持,则无论收到的请求是管道处理过的还是在多个连接上同时收到的,都使用HTTP/1.1管道
-- 下载被中断时缓存起始部分,当需要续传时用区间请求来完成下载
-- 将HTTP/1.0的客户端请求升级为HTTP/1.1,然后按照客户端支持的级别进行升级或降级后回复
-- 全面支持IPv6 (作用域(链路本地)地址除外)
-- 作为IPv4和IPv6网络的网桥
-- 内容过滤
-- 能使用Poor Man多路复用技术降低延迟
-- 支持SOCKS 4和SOCKS 5协议
-- HTTPS代理
-- 扮演透明代理的角色
-- 可以与Privoxy或tor一起运行
-
-- 网站: [www.pps.univ-paris-diderot.fr/~jch/software/polipo/][4]
-- 开发: Juliusz Chroboczek, Christopher Davis
-- 授权: MIT License
-- 版本号: 1.1.1
-
-### Tinyproxy ###
-
-Tinyproxy是一个轻量级的开源web代理守护进程,其设计目标是快而小。它适用于需要完整HTTP代理特性,但系统资源又不足以运行大型代理的场景,比如嵌入式部署。
-
-Tinyproxy对小规模网络非常有用,这样的场合下大型代理会使系统资源紧张,或有安全风险。Tinyproxy的一个关键特性是其缓冲连接的理念。实质上Tinyproxy服务器的响应进行了高速缓冲,然后按照客户端能够处理的最高速度进行响应。该特性极大的降低了网络延滞带来的问题。 
-
-特性:
-
-- 易于修改
-- 隐匿模式 - 定义哪些HTTP头允许通过,哪些又会被拦截
-- 支持HTTPS - Tinyproxy允许通过CONNECT方法转发HTTPS连接,任何情况下都不会修改数据流量
-- 远程监控 - 远程访问代理统计数据,让你能清楚了解代理服务当前的忙碌状态
-- 平均负载监控 - 通过配置,当服务器的负载接近一定值后拒绝新连接
-- 访问控制 - 通过配置,仅允许指定子网或IP地址的访问
-- 安全 - 运行无需额外权限,减小了系统受到威胁的概率
-- 基于URL的过滤 - 允许基于域和URL的黑白名单
-- 透明代理 - 配位为透明代理,这样客户端就无需任何配置
-- 代理链 - 来流量出口处采用上游代理服务器,而不是直接转发到目标服务器,创建我们所说的代理链
-- 隐私特性 - 限制允许从浏览器收到的来自HTTP服务器的数据(例如cookies),同时限制允许通过的从浏览器到HTTP服务器的数据(例如版本信息)
-- 低开销 - 使用glibc内存开销只有2MB,CPU负载按并发连接数线性增长(取决于网络连接速度)。 Tinyproxy可以运行在老旧的机器上而无需担心性能问题。 
-
-- 网站: [banu.com/tinyproxy][5]
-- 开发: Robert James Kaes和其他贡献者
-- 授权: GNU GPL v2
-- 版本号: 1.8.3
-
---------------------------------------------------------------------------------
-
-via: http://www.linuxlinks.com/article/20151101020309690/WebDelivery.html
-
-译者:[fw8899](https://github.com/fw8899)
-校对:[校对者ID](https://github.com/校对者ID)
-
-本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
-
-[1]:http://www.squid-cache.org/
-[2]:http://www.privoxy.org/
-[3]:https://www.varnish-cache.org/
-[4]:http://www.pps.univ-paris-diderot.fr/%7Ejch/software/polipo/
-[5]:https://banu.com/tinyproxy/

From 33d4f96e783cb8ca2b77abda1b6779bb3ec06149 Mon Sep 17 00:00:00 2001
From: wxy 
Date: Thu, 17 Mar 2016 22:50:23 +0800
Subject: [PATCH 0540/1469] =?UTF-8?q?=E6=9B=B4=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 ...ith Answers--How to install Ubuntu desktop behind a proxy.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/published/20151105 Linux FAQs with Answers--How to install Ubuntu desktop behind a proxy.md b/published/20151105 Linux FAQs with Answers--How to install Ubuntu desktop behind a proxy.md
index 0a215a066e..31ca37ab0b 100644
--- a/published/20151105 Linux FAQs with Answers--How to install Ubuntu desktop behind a proxy.md	
+++ b/published/20151105 Linux FAQs with Answers--How to install Ubuntu desktop behind a proxy.md	
@@ -1,4 +1,4 @@
-Linux 有问必答 - 如何通过代理服务器安装 Ubuntu 桌面版
+Linux 有问必答:如何通过代理服务器安装 Ubuntu 桌面版
 ================================================================================
 > **问题**: 我的电脑通过 HTTP 代理连接到公司网络。当我尝试从 CD-ROM 在计算机上安装 Ubuntu 桌面时,在检索文件时安装程序会被挂起,检索则不会完成,这可能是由于代理造成的。然而问题是,Ubuntu 的安装程序从不要求我在安装过程中配置代理。那我该怎么使用代理来安装 Ubuntu 桌面?
 

From 6315c293936bcb009dbc207f9bca61230132b999 Mon Sep 17 00:00:00 2001
From: Ezio 
Date: Fri, 18 Mar 2016 14:52:27 +0800
Subject: [PATCH 0541/1469] =?UTF-8?q?20160318-1=20=E9=80=89=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 ...Raspberry Pi projects for the classroom.md | 92 +++++++++++++++++++
 1 file changed, 92 insertions(+)
 create mode 100644 sources/tech/20151207 5 great Raspberry Pi projects for the classroom.md

diff --git a/sources/tech/20151207 5 great Raspberry Pi projects for the classroom.md b/sources/tech/20151207 5 great Raspberry Pi projects for the classroom.md
new file mode 100644
index 0000000000..d074c2e840
--- /dev/null
+++ b/sources/tech/20151207 5 great Raspberry Pi projects for the classroom.md	
@@ -0,0 +1,92 @@
+5 great Raspberry Pi projects for the classroom
+=====================================================
+
+![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/osdc-open-source-yearbook-lead3.png?itok=fSUS0fIt)
+
+### 1. Minecraft Pi
+
+![](https://opensource.com/sites/default/files/lava.png)
+>Courtesy of the Raspberry Pi Foundation. [CC BY-SA 4.0][1].
+
+Minecraft is the favorite game of pretty much every teenager in the world—and it's one of the most creative games ever to capture the attention of young people. The version that comes with every Raspberry Pi is not only a creative thinking building game, but comes with a programming interface allowing for additional interaction with the Minecraft world through Python code.
+
+Minecraft: Pi Edition is a great way for teachers to engage students with problem solving and writing code to perform tasks. You can use the Python API to build a house and have it follow you wherever you go, build a bridge wherever you walk, make it rain lava, show the temperature in the sky, and anything else your imagination can create.
+
+Read more in "[Getting Started with Minecraft Pi][2]."
+
+### 2. Reaction game and traffic lights
+
+![](https://opensource.com/sites/default/files/pi_traffic_installed_yellow_led_on.jpg)
+>Courtesy of [Low Voltage Labs][3]. [CC BY-SA 4.0][1].
+
+It's really easy to get started with physical computing on Raspberry Pi—just connect up LEDs and buttons to the GPIO pins, and with a few lines of code you can turn lights on and control things with button presses. Once you know the code to do the basics, it's down to your imagination as to what you do next!
+
+If you know how to flash one light, you can flash three. Pick out three LEDs in traffic light colors and you can code the traffic light sequence. If you know how to use a button to a trigger an event, then you have a pedestrian crossing! Also look out for great pre-built traffic light add-ons like [PI-TRAFFIC][4], [PI-STOP][5], [Traffic HAT][6], and more.
+
+It's not always about the code—this can be used as an exercise in understanding how real world systems are devised. Computational thinking is a useful skill in any walk of life.
+
+![](https://opensource.com/sites/default/files/reaction-game.png)
+>Courtesy of the Raspberry Pi Foundation. [CC BY-SA 4.0][1].
+
+Next, try wiring up two buttons and an LED and making a two-player reaction game—let the light come on after a random amount of time and see who can press the button first!
+
+To learn more, check out [GPIO Zero recipes][7]. Everything you need is in [CamJam EduKit 1][8].
+
+### 3. Sense HAT Pixel Pet
+
+The Astro Pi—an augmented Raspberry Pi—is going to space this December, but you haven't missed your chance to get your hands on the hardware. The Sense HAT is the sensor board add-on used in the Astro Pi mission and it's available for anyone to buy. You can use it for data collection, science experiments, games and more. Watch this Gurl Geek Diaries video from Raspberry Pi's Carrie Anne for a great way to get started—by bringing to life an animated pixel pet of your own design on the Sense HAT display:
+
+[video](https://youtu.be/gfRDFvEVz-w)
+
+>Learn more in "[Exploring the Sense HAT][9]."
+
+### 4. Infrared bird box
+
+![](https://opensource.com/sites/default/files/ir-bird-box.png)
+>Courtesy of the Raspberry Pi Foundation. [CC BY-SA 4.0][1].
+
+A great exercise for the whole class to get involved with—place a Raspberry Pi and the NoIR camera module inside a bird box along with some infra-red lights so you can see in the dark, then stream video from the Pi over the network or on the internet. Wait for birds to nest and you can observe them without disturbing them in their habitat.
+
+Learn all about infrared and the light spectrum, and how to adjust the camera focus and control the camera in software.
+
+Learn more in "[Make an infrared bird box][10]."
+
+### 5. Robotics
+
+![](https://opensource.com/sites/default/files/edukit3_1500-alex-eames-sm.jpg)
+>Courtesy of Low Voltage Labs. [CC BY-SA 4.0][1].
+
+With a Raspberry Pi and as little as a couple of motors and a motor controller board, you can build your own robot. There is a vast range of robots you can make, from basic buggies held together by sellotape and a homemade chassis, all the way to self-aware, sensor-laden metallic stallions with camera attachments driven by games controllers.
+
+Learn how to control individual motors with something straightforward like the RTK Motor Controller Board (£8/$12), or dive into the new CamJam robotics kit (£17/$25) which comes with motors, wheels and a couple of sensors—great value and plenty of learning potential.
+
+Alternatively, if you'd like something more hardcore, try PiBorg's [4Borg][11] (£99/$150) or [DiddyBorg][12] (£180/$273) or go the whole hog and treat yourself to their DoodleBorg Metal edition (£250/$380)—and build a mini version of their infamous [DoodleBorg tank][13] (unfortunately not for sale).
+
+Check out the [CamJam robotics kit worksheets][14].
+
+
+------------------------------------------------------------------------------
+
+via: https://opensource.com/education/15/12/5-great-raspberry-pi-projects-classroom
+
+作者:[Ben Nuttall][a]
+译者:[译者ID](https://github.com/译者ID)
+校对:[校对者ID](https://github.com/校对者ID)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]: https://opensource.com/users/bennuttall
+[1]: https://creativecommons.org/licenses/by-sa/4.0/
+[2]: https://opensource.com/life/15/5/getting-started-minecraft-pi
+[3]: http://lowvoltagelabs.com/
+[4]: http://lowvoltagelabs.com/products/pi-traffic/
+[5]: http://4tronix.co.uk/store/index.php?rt=product/product&product_id=390
+[6]: https://ryanteck.uk/hats/1-traffichat-0635648607122.html
+[7]: http://pythonhosted.org/gpiozero/recipes/
+[8]: http://camjam.me/?page_id=236
+[9]: https://opensource.com/life/15/10/exploring-raspberry-pi-sense-hat
+[10]: https://www.raspberrypi.org/learning/infrared-bird-box/
+[11]: https://www.piborg.org/4borg
+[12]: https://www.piborg.org/diddyborg
+[13]: https://www.piborg.org/doodleborg
+[14]: http://camjam.me/?page_id=1035#worksheets

From 6eaa9fd46df494a0718b7d466c9e14b69aae0d2c Mon Sep 17 00:00:00 2001
From: Ezio 
Date: Fri, 18 Mar 2016 14:52:59 +0800
Subject: [PATCH 0542/1469] translating

---
 .../20151207 5 great Raspberry Pi projects for the classroom.md | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sources/tech/20151207 5 great Raspberry Pi projects for the classroom.md b/sources/tech/20151207 5 great Raspberry Pi projects for the classroom.md
index d074c2e840..b1bc89b2a0 100644
--- a/sources/tech/20151207 5 great Raspberry Pi projects for the classroom.md	
+++ b/sources/tech/20151207 5 great Raspberry Pi projects for the classroom.md	
@@ -1,3 +1,5 @@
+ezio
+
 5 great Raspberry Pi projects for the classroom
 =====================================================
 

From c0c483068eddbdc7fad6f4b93b3ecb1565171194 Mon Sep 17 00:00:00 2001
From: martin qi 
Date: Sat, 19 Mar 2016 01:07:27 +0800
Subject: [PATCH 0543/1469] =?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

对 [General purpose] 一词没有把握。
---
 ...7 What we learned in Seoul with AlphaGo.md | 51 -------------------
 ...6 What we learned in Seoul with AlphaGo.md | 49 ++++++++++++++++++
 2 files changed, 49 insertions(+), 51 deletions(-)
 delete mode 100644 sources/news/20160317 What we learned in Seoul with AlphaGo.md
 create mode 100644 translated/news/20160316 What we learned in Seoul with AlphaGo.md

diff --git a/sources/news/20160317 What we learned in Seoul with AlphaGo.md b/sources/news/20160317 What we learned in Seoul with AlphaGo.md
deleted file mode 100644
index 8eb12005d3..0000000000
--- a/sources/news/20160317 What we learned in Seoul with AlphaGo.md	
+++ /dev/null
@@ -1,51 +0,0 @@
-martin
-
-What we learned in Seoul with AlphaGo
-================================================================================
-Go isn't just a game—it's a living, breathing culture of players, analysts, fans, and legends. Over the last 10 days in Seoul, South Korea, we've been lucky enough to witness some of that incredible excitement firsthand. We've also had the chance to see something that's never happened before: [DeepMind's][1] AlphaGo took on and defeated legendary Go player, Lee Sedol (9-dan professional with 18 world titles), marking a major milestone for artificial intelligence.
-
-![Pedestrians checking in on the AlphaGo vs. Lee Sedol Go match on the streets of Seoul (March 13)](https://1.bp.blogspot.com/-vfgUcjyMOmM/Vumk5gXD98I/AAAAAAAASDI/frbYidb1u6gTKGcvFOf8iQVsr9PLoRlBQ/s1600/Press%2BCenter%2BOutdoor%2BScreen%2B2.jpg)
-
-Go may be one of the oldest games in existence, but the attention to our five-game tournament exceeded even our wildest imaginations. Searches for Go rules and Go boards spiked in the U.S. In China, tens of millions watched live streams of the matches, and the “Man vs. Machine Go Showdown” hashtag saw 200 million pageviews on Sina Weibo. Sales of Go boards even [surged][2] in Korea.
-
-Our public test of AlphaGo, however, was about more than winning at Go. We founded DeepMind in 2010 to create general-purpose artificial intelligence (AI) that can learn on its own—and, eventually, be used as a tool to help society solve some of its biggest and most pressing problems, from climate change to disease diagnosis.
-
-Like many researchers before us, we've been developing and testing our algorithms through games. We first revealed [AlphaGo][3] in January—the first AI program that could beat a professional player at the most complex board game mankind has devised, using [deep learning][4] and [reinforcement learning][5]. The [ultimate challenge][6] was for AlphaGo to take on the best Go player of the past decade—Lee Sedol.
-
-To everyone's surprise, including ours, AlphaGo won four of the five games. Commentators noted that AlphaGo played many unprecedented, creative, and even [“beautiful”][7] moves. Based on our data, AlphaGo's bold [move 37][8] in Game 2 had a 1 in 10,000 chance of being played by a human. Lee countered with innovative moves of his own, such as his [move 78][9] against AlphaGo in Game 4—again, a 1 in 10,000 chance of being played—which ultimately resulted in a win.
-
-The final score was 4-1. We're contributing the $1 million in prize money to organizations that support science, technology, engineering and math (STEM) education and Go, as well as UNICEF.
-
-We've learned two important things from this experience. First, this test bodes well for AI's potential in solving other problems. AlphaGo has the ability to look “globally” across a board—and find solutions that humans either have been trained not to play or would not consider. This has huge potential for using AlphaGo-like technology to find solutions that humans don't necessarily see in other areas. Second, while the match has been widely billed as "man vs. machine," AlphaGo is really a human achievement. Lee Sedol and the AlphaGo team both pushed each other toward new ideas, opportunities and solutions—and in the long run that's something we all stand to benefit from.
-
-But as they say about Go in Korean: “Don't be arrogant when you win or you'll lose your luck.” This is just one small, albeit significant, step along the way to making machines smart. We've demonstrated that our cutting edge deep reinforcement learning techniques can be used to make strong Go and [Atari][10] players. Deep neural networks are already used at Google for specific tasks—like [image recognition][11], [speech recognition][12], and [Search ranking][13]. However, we're still a long way from a machine that can learn to flexibly perform the full range of intellectual tasks a human can—the hallmark of true [artificial general intelligence][14].
-
-![Demis and Lee Sedol hold up the signed Go board from the Google DeepMind Challenge Match](https://4.bp.blogspot.com/-LkxNvsR-e1I/Vumk5gmProI/AAAAAAAASDM/J55Y2psqzOwWZ3kau2Pgz6xmazo7XDj_Q/s1600/A26U6150.jpg)
-
-With this tournament, we wanted to test the limits of AlphaGo. The genius of Lee Sedol did that brilliantly—and we'll spend the next few weeks studying the games he and AlphaGo played in detail. And because the machine learning methods we've used in AlphaGo are general purpose, we hope to apply some of these techniques to other challenges in the future. Game on!
-
---------------------------------------------------------------------------------
-
-via: https://googleblog.blogspot.com/2016/03/what-we-learned-in-seoul-with-alphago.html
-
-作者:[Demis Hassabis][a]
-译者:[译者ID](https://github.com/译者ID)
-校对:[校对者ID](https://github.com/校对者ID)
-
-本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
-
-[a]:http://demishassabis.com/
-[1]:https://deepmind.com/
-[2]:http://www.hankookilbo.com/m/v/3e7deaa26a834f76929a1689ecd388ea
-[3]:https://googleblog.blogspot.com/2016/01/alphago-machine-learning-game-go.html
-[4]:https://en.wikipedia.org/wiki/Deep_learning
-[5]:https://en.wikipedia.org/wiki/Reinforcement_learning
-[6]:https://deepmind.com/alpha-go.html
-[7]:http://www.wired.com/2016/03/sadness-beauty-watching-googles-ai-play-go/
-[8]:https://youtu.be/l-GsfyVCBu0?t=1h17m50s
-[9]:https://youtu.be/yCALyQRN3hw?t=3h10m25s
-[10]:http://googleresearch.blogspot.sg/2015/02/from-pixels-to-actions-human-level.html
-[11]:http://googleresearch.blogspot.sg/2013/06/improving-photo-search-step-across.html
-[12]:http://googleresearch.blogspot.sg/2015/08/the-neural-networks-behind-google-voice.html
-[13]:http://www.bloomberg.com/news/articles/2015-10-26/google-turning-its-lucrative-web-search-over-to-ai-machines
-[14]:https://en.wikipedia.org/wiki/Artificial_general_intelligence
diff --git a/translated/news/20160316 What we learned in Seoul with AlphaGo.md b/translated/news/20160316 What we learned in Seoul with AlphaGo.md
new file mode 100644
index 0000000000..ab3c92b4c9
--- /dev/null
+++ b/translated/news/20160316 What we learned in Seoul with AlphaGo.md	
@@ -0,0 +1,49 @@
+我们和 AlphaGo 在首尔学到了什么
+================================================================================
+围棋并不仅仅是一个游戏——她是一伙活生生的玩家们,分析家们,爱好者们以及传奇大师们。在过去的十天里,在韩国首尔,我们有幸亲眼目睹那份难以置信的激动。我们也有幸也目睹了那前所未有的场景:[DeepMind][1] 的 AlphaGo 迎战并战胜了传奇围棋大师,李世石(职业9段,身负 18 个世界头衔),这是人工智能的里程碑。
+
+![Pedestrians checking in on the AlphaGo vs. Lee Sedol Go match on the streets of Seoul (March 13)](https://1.bp.blogspot.com/-vfgUcjyMOmM/Vumk5gXD98I/AAAAAAAASDI/frbYidb1u6gTKGcvFOf8iQVsr9PLoRlBQ/s1600/Press%2BCenter%2BOutdoor%2BScreen%2B2.jpg)
+
+虽说围棋可能是存世的最为悠久的游戏之一了,但对于这五盘比赛的关注度还是大大的超出了我们的想象。搜索围棋规则和围棋盘的用户在美国迅速飙升。在中国,数以千万计的用户通过直播观看了这场比赛,并且新浪微博“人机围棋大战”话题的浏览量破 2 亿。韩国的围棋盘也销量[激增][2]。
+
+然而我们如此公然的测试 AlphaGo,并不仅仅是为了赢棋而已。我们自 2010 年成立 DeepMind,为的是创造出具有独立学习能力的通用型人工智能(AI),并致力于将其作为工具协助解决,从气候变化到诊断疾病,这类最为棘手且急迫的问题为最终目标。 
+
+亦如许多前辈学者们一样,我们也是通过游戏来开发并测试我们的算法的。在一月份,我们第一次披露了 [AlphaGo][3]——作为第一个通过使用 [深度学习][4] 和 [强化学习][5],可以在人类发明的最为复杂的棋盘类游戏中击败职业选手的 AI 程序。而 AlphaGo 迎战过去十年间最厉害的围棋选手——李世石,绝对称得上是 [终极挑战][6]。
+
+结果震惊了包括我们在内的每个人,AlphaGo 五战四胜。评论家指出了 AlphaGo 下出的许多前所未见、极富创意或者要用 [“漂亮”][7] 来形容的妙手。基于我们的数据分析,AlphaGo 在第 2 局中的 [37 手][8],在人类选手中出现的几率仅有万分之一。而李一反常态的创新下法,如第 4 局中的 [78 手][9]——也是既存下法中的万中之一的——这一手也最终造就了一场胜利。
+
+最后比分定格在 4-1。我们为支持科学、技术、工程、数学(STEM)教育和围棋的组织,以及 UNICEF (联合国儿童基金会)赢得了 $1 百万的捐助。
+
+经此一役,我们将收获总结成以下两点:第一,此次测试很好的预示了 AI 有解决其他问题的潜力。AlphaGo 在棋盘上能够做到兼顾“全局”——并找出人类已经被训化而不会走或想到的妙手。运用 AlphaGo 这类的技术,在人类目所不能及的领域中探索,会有很大的潜力。第二,虽说这场比赛已经被广泛的标榜成“人机大战”,但 AlphaGo 却是人类实实在在的成果。无论是李世石还是 AlphaGo 团队相互之间互相促进,产生了新的想法、观点和答案——并且长远来看,我们都将从中受益。
+
+但正如韩国对于围棋的观点:“胜而不骄,是以常胜。”这只是使机器聪明的漫长道路中的一个小小而显著的一步而已。我们已经证明了尖端深度强化学习技术可以被用作制作强大的围棋选手和 [Atari][10] 玩家。深度神经网络在 Google 已经与 [图像识别][11],[语音识别][12] 以及 [搜索排名][13] 一样被应用到具体的任务中了。然而,从会学习的机器到可以像人一样全方位灵活实施智能任务——真正达到 [强人工智能][14] 的特性,此中的道路还很漫长。
+
+![Demis and Lee Sedol hold up the signed Go board from the Google DeepMind Challenge Match](https://4.bp.blogspot.com/-LkxNvsR-e1I/Vumk5gmProI/AAAAAAAASDM/J55Y2psqzOwWZ3kau2Pgz6xmazo7XDj_Q/s1600/A26U6150.jpg)
+
+我们想通过这场比赛来测试 AlphaGo 的极限。李世石大师做的十分出色—我们在接下来的数周内会研究他与 AlphaGo 的对战细节。同时因为我们在 AlphaGo 中使用的机器学习方法是通用型的,我们十分希望在不久的将来,将这种技术应用于其他的挑战中。游戏开始!
+
+--------------------------------------------------------------------------------
+
+via: https://googleblog.blogspot.com/2016/03/what-we-learned-in-seoul-with-alphago.html
+
+作者:[Demis Hassabis][a]
+译者:[martin2011qi](https://github.com/martin2011qi)
+校对:[校对者ID](https://github.com/校对者ID)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:http://demishassabis.com/
+[1]:https://deepmind.com/
+[2]:http://www.hankookilbo.com/m/v/3e7deaa26a834f76929a1689ecd388ea
+[3]:https://googleblog.blogspot.com/2016/01/alphago-machine-learning-game-go.html
+[4]:https://en.wikipedia.org/wiki/Deep_learning
+[5]:https://en.wikipedia.org/wiki/Reinforcement_learning
+[6]:https://deepmind.com/alpha-go.html
+[7]:http://www.wired.com/2016/03/sadness-beauty-watching-googles-ai-play-go/
+[8]:https://youtu.be/l-GsfyVCBu0?t=1h17m50s
+[9]:https://youtu.be/yCALyQRN3hw?t=3h10m25s
+[10]:http://googleresearch.blogspot.sg/2015/02/from-pixels-to-actions-human-level.html
+[11]:http://googleresearch.blogspot.sg/2013/06/improving-photo-search-step-across.html
+[12]:http://googleresearch.blogspot.sg/2015/08/the-neural-networks-behind-google-voice.html
+[13]:http://www.bloomberg.com/news/articles/2015-10-26/google-turning-its-lucrative-web-search-over-to-ai-machines
+[14]:https://en.wikipedia.org/wiki/Artificial_general_intelligence

From 0d972d4ae38777a6095cbfbb6a45109fb2609095 Mon Sep 17 00:00:00 2001
From: zpl 
Date: Sat, 19 Mar 2016 12:26:25 +0800
Subject: [PATCH 0544/1469] move the translated files into right place

---
 {sources => translated}/tech/20151202 A new Mindcraft moment.md | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename {sources => translated}/tech/20151202 A new Mindcraft moment.md (100%)

diff --git a/sources/tech/20151202 A new Mindcraft moment.md b/translated/tech/20151202 A new Mindcraft moment.md
similarity index 100%
rename from sources/tech/20151202 A new Mindcraft moment.md
rename to translated/tech/20151202 A new Mindcraft moment.md

From 077e2a079dcca139cd1cffe849e3fb8cee60d5d2 Mon Sep 17 00:00:00 2001
From: wxy 
Date: Sat, 19 Mar 2016 12:36:22 +0800
Subject: [PATCH 0545/1469] PUB:20150820 Why did you start using Linux

@bazz2
---
 .../20150820 Why did you start using Linux.md | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)
 rename {translated/talk => published}/20150820 Why did you start using Linux.md (87%)

diff --git a/translated/talk/20150820 Why did you start using Linux.md b/published/20150820 Why did you start using Linux.md
similarity index 87%
rename from translated/talk/20150820 Why did you start using Linux.md
rename to published/20150820 Why did you start using Linux.md
index aa48db697c..c0a01c17a2 100644
--- a/translated/talk/20150820 Why did you start using Linux.md	
+++ b/published/20150820 Why did you start using Linux.md	
@@ -1,12 +1,11 @@
 年轻人,你为啥使用 linux
 ================================================================================
-> 今天的开源综述:是什么带你进入 linux 的世界?号外:IBM 基于 Linux 的大型机。以及,你应该抛弃 win10 选择 Linux 的原因。
 
 ### 当初你为何使用 Linux? ###
 
 Linux 越来越流行,很多 OS X 或 Windows 用户都转移到 Linux 阵营了。但是你知道是什么让他们开始使用 Linux 的吗?一个 Reddit 用户在网站上问了这个问题,并且得到了很多有趣的回答。
 
-一个名为 SilverKnight 的用户在 Reddit 的 Linux 板块上问了如下问题:
+一个名为 SilverKnight 的用户在 Reddit 的 Linux 版块上问了如下问题:
 
 > 我知道这个问题肯定被问过了,但我还是想听听年轻一代使用 Linux 的原因,以及是什么让他们坚定地成为 Linux 用户。
 > 
@@ -18,7 +17,7 @@ Linux 越来越流行,很多 OS X 或 Windows 用户都转移到 Linux 阵营
 
 以下是网站上的回复:
 
-> **DoublePlusGood**:我12岁开始使用 Backtrack(现在改名为 Kali),因为我想成为一名黑客(LCTT 译注:原文1337 haxor,1337 是 leet 的火星文写法,意为'火星文',haxor 为 hackor 的火星文写法,意为'黑客',另一种写法是 1377 h4x0r,满满的火星文文化)。我现在一直使用 ArchLinux,因为它给我无限自由,让我对我的电脑可以为所欲为。
+> **DoublePlusGood**:我12岁开始使用 Backtrack(现在改名为 Kali),因为我想成为一名黑客(LCTT 译注:原文“1337 haxor”,1337 是 leet 的火星文写法,意为'火星文',haxor 为 hackor 的火星文写法,意为'黑客',另一种写法是 1377 h4x0r,满满的火星文文化)。我现在一直使用 ArchLinux,因为它给我无限自由,让我对我的电脑可以为所欲为。
 > 
 > **Zack**:我记得是12、3岁的时候使用 Linux,现在15岁了。
 > 
@@ -44,9 +43,9 @@ Linux 越来越流行,很多 OS X 或 Windows 用户都转移到 Linux 阵营
 > 
 > 我很喜欢这个系统。然后在圣诞节的时候我得到树莓派,上面只能跑 Debian,还不能支持其它发行版。
 > 
-> **Cqz**:我9岁的时候有一次玩 Windows 98,结果这货当机了,原因未知。我没有 Windows 安装盘,但我爸的一本介绍编程的杂志上有一张随书附赠的光盘,这张光盘上刚好有 Mandrake Linux 的安装软件,于是我瞬间就成为了 Linux 用户。我当时还不知道自己在玩什么,但是玩得很嗨皮。这些年我虽然在电脑上装了多种 Windows 版本,但是 FLOSS 世界才是我的家。现在我只把 Windows 装在虚拟机上,用来玩游戏。
+> **Cqz**:我9岁的时候有一次玩 Windows 98,结果这货当机了,原因未知。我没有 Windows 安装盘,但我爸的一本介绍编程的杂志上有一张随书附赠的光盘,这张光盘上刚好有 Mandrake Linux 的安装软件,于是我瞬间就成为了 Linux 用户。我当时还不知道自己在玩什么,但是玩得很嗨皮。这些年我虽然在电脑上装了多种 Windows 版本,但是 FLOSS 世界才是我的家(LCTT 译注:FLOSS —— Free/Libre and Open Source Software,自由/开源软件)。现在我只把 Windows 装在虚拟机上,用来玩游戏。
 > 
-> **Tosmarcel**:15岁那年对'编程'这个概念很好奇,然后我开始了哈佛课程'CS50',这个课程要我们安装 Linux 虚拟机用来执行一些命令。当时我问自己为什么 Windows 没有这些命令?于是我 Google 了 Linux,搜索结果出现了 Ubuntu,在安装 Ubuntu。的时候不小心把 Windows 分区给删了。。。当时对 Linux 毫无所知,适应这个系统非常困难。我现在16岁,用 ArchLinux,不想用回 Windows,我爱 ArchLinux。
+> **Tosmarcel**:15岁那年对'编程'这个概念很好奇,然后我开始了哈佛课程'CS50',这个课程要我们安装 Linux 虚拟机用来执行一些命令。当时我问自己为什么 Windows 没有这些命令?于是我 Google 了 Linux,搜索结果出现了 Ubuntu,在安装 Ubuntu 的时候不小心把 Windows 分区给删了。。。当时对 Linux 毫无所知,适应这个系统非常困难。我现在16岁,用 ArchLinux,不想用回 Windows,我爱 ArchLinux。
 > 
 > **Micioonthet**:第一次听说 Linux 是在我5年级的时候,当时去我一朋友家,他的笔记本装的就是 MEPIS(Debian的一个比较老的衍生版),而不是 XP。
 > 
@@ -54,7 +53,7 @@ Linux 越来越流行,很多 OS X 或 Windows 用户都转移到 Linux 阵营
 > 
 > 我13岁那年还没有自己的笔记本电脑,而我另一位朋友总是抱怨他的电脑有多慢,所以我打算把它买下来并修好它。我花了20美元买下了这台装着 Windows Vista 系统、跑满病毒、完全无法使用的惠普笔记本。我不想重装讨厌的 Windows 系统,记得 Linux 是免费的,所以我刻了一张 Ubuntu 14.04 光盘,马上把它装起来,然后我被它的高性能给震精了。
 > 
-> 我的世界(由于它允运行在 JAVA 上,所以当时它是 Linux 下为数不多的几个游戏之一)在 Vista 上只能跑5帧每秒,而在 Ubuntu 上能跑到25帧。
+> “我的世界(Minecraft)”(由于它允许运行在 JAVA 上,所以当时它是 Linux 下为数不多的几个游戏之一)在 Vista 上只能跑5帧每秒,而在 Ubuntu 上能跑到25帧。
 > 
 > 我到现在还会偶尔使用一下那台笔记本,Linux 可不会在乎你的硬件设备有多老。
 > 
@@ -62,9 +61,9 @@ Linux 越来越流行,很多 OS X 或 Windows 用户都转移到 Linux 阵营
 > 
 > **Webtm**:我爹每台电脑都会装多个发行版,有几台是 opensuse 和 Debian,他的个人电脑装的是 Slackware。所以我记得很小的时候一直在玩 debian,但没有投入很多精力,我用了几年的 Windows,然后我爹问我有没有兴趣试试 debian。这是个有趣的经历,在那之后我一直使用 debian。而现在我不用 Linux,转投 freeBSD,5个月了,用得很开心。
 > 
-> 完全控制自己的系统是个很奇妙的体验。开源届有好多酷酷的软件,我认为在自己解决一些问题并且利用这些工具解决其他事情的过程是最有趣的。当然稳定和高效也是吸引我的地方。更不用说它的保密级别了。
+> 完全控制自己的系统是个很奇妙的体验。开源界有好多酷酷的软件,我认为在自己解决一些问题并且利用这些工具解决其他事情的过程是最有趣的。当然稳定和高效也是吸引我的地方。更不用说它的保密级别了。
 > 
-> **Wyronaut**:我今年18,第一次玩 Linux 是13岁,当时玩的 Ubuntu,为啥要碰 Linux?因为我想搭一个'我的世界'的服务器来和小伙伴玩游戏,当时'我的世界'可是个新鲜玩意儿。而搭个私服需要用 Linux 系统。
+> **Wyronaut**:我今年18,第一次玩 Linux 是13岁,当时玩的 Ubuntu,为啥要碰 Linux?因为我想搭一个“我的世界”的服务器来和小伙伴玩游戏,当时“我的世界”可是个新鲜玩意儿。而搭个私服需要用 Linux 系统。
 > 
 > 当时我还是个新手,对着 Linux 的命令行有些傻眼,因为很多东西都要我自己处理。还是多亏了 Google 和维基,我成功地在多台老 PC 上部署了一些简单的服务器,那些早已无人问津的老古董机器又能发挥余热了。
 > 
@@ -90,7 +89,7 @@ Linux 越来越流行,很多 OS X 或 Windows 用户都转移到 Linux 阵营
 > 
 > 老实说我对电脑挺感兴趣的,当我还没接触'自由软件哲学'的时候,我认为 free 是免费的意思。我也不认为命令行界面很让人难以接受,因为我小时候就接触过 DOS 系统。
 > 
-> 我第一个发行版是 Mandrake,在我11岁还是12岁那年我把家里的电脑弄得乱七八糟,然后我一直折腾那台电脑,试着让我技的技能提升一个台阶。现在我在一家公司全职使用 Linux。(请允许我耸个肩)。
+> 我第一个发行版是 Mandrake,在我11岁还是12岁那年我把家里的电脑弄得乱七八糟,然后我一直折腾那台电脑,试着让我自己的技能提升一个台阶。现在我在一家公司全职使用 Linux。(请允许我耸个肩)。
 > 
 > **Matto**:我的电脑是旧货市场淘回来的,装 XP,跑得慢,于是我想换个系统。Google 了一下,发现 Ubuntu。当年我15、6岁,现在23了,就职的公司内部使用 Linux。
 > 
@@ -133,7 +132,7 @@ via: http://www.itworld.com/article/2972587/linux/why-did-you-start-using-linux.
 
 作者:[Jim Lynch][a]
 译者:[bazz2](https://github.com/bazz2)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
 
 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
 

From 86e9efdc55bf9af872ee7ecccb5b5b3f2bcd516a Mon Sep 17 00:00:00 2001
From: zpl 
Date: Sat, 19 Mar 2016 12:38:26 +0800
Subject: [PATCH 0546/1469] [translating] 20160314 15 podcasts for FOSS fans

---
 sources/tech/20160314 15 podcasts for FOSS fans | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sources/tech/20160314 15 podcasts for FOSS fans b/sources/tech/20160314 15 podcasts for FOSS fans
index 222861427e..eae53102ad 100644
--- a/sources/tech/20160314 15 podcasts for FOSS fans	
+++ b/sources/tech/20160314 15 podcasts for FOSS fans	
@@ -1,3 +1,4 @@
+zpl1025
 15 podcasts for FOSS fans
 =============================
 

From 18ef3edd4cd033b0b27b199e272976a30a87c33b Mon Sep 17 00:00:00 2001
From: Ezio 
Date: Sat, 19 Mar 2016 21:59:34 +0800
Subject: [PATCH 0547/1469] =?UTF-8?q?20160319-1=20=E9=80=89=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 ...buntu Core 16.04 LTS and Raspberry Pi 3.md | 35 +++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 sources/tech/20160318 ownCloud Pi Device to Run on Snappy Ubuntu Core 16.04 LTS and Raspberry Pi 3.md

diff --git a/sources/tech/20160318 ownCloud Pi Device to Run on Snappy Ubuntu Core 16.04 LTS and Raspberry Pi 3.md b/sources/tech/20160318 ownCloud Pi Device to Run on Snappy Ubuntu Core 16.04 LTS and Raspberry Pi 3.md
new file mode 100644
index 0000000000..a03f9dd355
--- /dev/null
+++ b/sources/tech/20160318 ownCloud Pi Device to Run on Snappy Ubuntu Core 16.04 LTS and Raspberry Pi 3.md	
@@ -0,0 +1,35 @@
+ownCloud Pi Device to Run on Snappy Ubuntu Core 16.04 LTS and Raspberry Pi 3
+===============================================================================
+
+keyword : ownCloud Pi , Snappy Ubuntu Core 16.04 LTS , Raspberry Pi 3 , Western Digital , PiDrive
+
+### We [reported][1] last year that ownCloud was in talks with WD (Western Digital) Labs to help them develop a community project that would bring a self-hosted cloud storage device in users' homes.
+
+The idea behind the self-hosted device, which will be powered by the ownCloud Server software, was to combine a Raspberry Pi single-board computer with a Western Digital disk drive into an easy-to-install and out-of-the-box container.
+
+Well, it looks like the community's response was more than positive, and many great proposals and ideas were received for the ownCloud Pi project. And today, they have even greater news for us, as the first images are available for [download][2].
+
+The ownCloud Pi images are based on the latest Snappy Ubuntu Core 16.04 LTS operating system, which was designed by Canonical for embedded and IoT (Internet of Things) devices, as well as the new Raspberry Pi 3 Model B SBC.
+
+"We’re looking for help in the ownCloud, Ubuntu, Raspberry Pi and WD Labs communities for help to test and improve them and will be able to make available a first batch of about 30 devices at the end of next week," say the ownCloud developers in today's [announcement][3].
+
+### Current obstacles, challenges, and the road ahead
+
+At the moment, the team is working hard on finishing their ownCloud Pi device solution based on the Xenial Xerus edition of Snappy Ubuntu Core. Thus, the new 64-bit Raspberry Pi 3 computer helps them with the obstacles encountered during previous tests running on the Raspberry Pi 2 board, such as support for files larger than 2GB.
+
+Therefore, it looks like the decision was taken, and the final ownCloud Pi device, which should be available as a preview later this spring, will be powered by the Raspberry Pi 3 single-board computer. In the coming days, we should be able to purchase the first production-ready version of the ownCloud Pi device.
+
+--------------------------------------------------------------------------------
+
+via: http://news.softpedia.com/news/owncloud-pi-device-to-run-on-snappy-ubuntu-core-16-04-lts-and-raspberry-pi-3-501904.shtml
+
+作者:[Marius Nestor][a]
+译者:[译者ID](https://github.com/译者ID)
+校对:[校对者ID](https://github.com/校对者ID)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]: http://news.softpedia.com/editors/browse/marius-nestor
+[1]: http://news.softpedia.com/news/owncloud-partnerships-with-wd-to-bring-self-hosted-cloud-storage-in-users-homes-497512.shtml
+[2]: http://people.canonical.com/~kyrofa/owncloud-pi/
+[3]: https://owncloud.org/blog/wd-labs-raspberry-pi-owncloud-and-ubuntu/

From 981785b0124e390c18d1cf6183bda0da4906a26b Mon Sep 17 00:00:00 2001
From: Ezio 
Date: Sat, 19 Mar 2016 22:06:32 +0800
Subject: [PATCH 0548/1469] =?UTF-8?q?20160319-2=20=E9=80=89=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 ...nced-Based-on-Debian-GNU-Linux 8 Jessie.md | 40 +++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 sources/news/20160318-Robolinux-8.4-LTS-Raptor-Series-Announced-Based-on-Debian-GNU-Linux 8 Jessie.md

diff --git a/sources/news/20160318-Robolinux-8.4-LTS-Raptor-Series-Announced-Based-on-Debian-GNU-Linux 8 Jessie.md b/sources/news/20160318-Robolinux-8.4-LTS-Raptor-Series-Announced-Based-on-Debian-GNU-Linux 8 Jessie.md
new file mode 100644
index 0000000000..059ea0cfe1
--- /dev/null
+++ b/sources/news/20160318-Robolinux-8.4-LTS-Raptor-Series-Announced-Based-on-Debian-GNU-Linux 8 Jessie.md	
@@ -0,0 +1,40 @@
+Robolinux 8.4 LTS "Raptor" Series Announced, Based on Debian GNU/Linux 8 Jessie
+====================================================================================
+
+keyword : Robolinux 8.4 LTS , Robolinux 8.4 Cinnamon , Robolinux 8.4 MATE , Robolinux 8.4 Xfce , Debian 8
+
+> It runs Windows 7 and 10 virus-free in stealth VMs
+
+### The developer of the Robolinux project has announced the release of his latest Robolinux 8.4 LTS "Raptor" series of Debian-based operating systems, which includes numerous software updates and performance improvements.
+
+Usually, the Robolinux developer [announces][1] only one edition at a time for a new major release of the GNU/Linux distribution, but today's announcement includes details about the availability for download of the Robolinux 8.4 LTS Cinnamon, MATE, Xfce, and LXDE editions, as both 64-bit and 32-bit variants.
+
+The long-term supported Robolinux 8.4 series of distributions has been in development for the last three and a half months, during which it has been synchronized with the upstream Debian GNU/Linux 8 (Jessie) repositories, thus adding all the latest security patches and software updates.
+
+"Three and a half months of hard work went into finding every way possible to optimize and speed up our series 8 Robolinux 'Raptor' operating systems," say the devs. "The result is we have significantly decreased the time it takes to load applications, bootup and shutdown all four of our upgraded Robolinux Raptor series versions.
+
+### The Raptor series is supported until 2020
+
+Powered by Debian GNU/Linux 8's Linux 3.16 kernel, all the Robolinux 8.4 LTS "Raptor" editions have been rebased on the current stable Debian 8.3 source code, including over 180 upstream security and application updates. As Google ended support for the 32-bit version of its Google Chrome web browser, Robolinux now switches to Chromium.
+
+Other important software updates include the Mozilla Firefox 45.0 web browser, Mozilla Thunderbird 38.7.0 email and news client, Tor Browser 5.5, and VirtualBox 5.0. As usual, all Robolinux flavors come with numerous popular apps, including but not limited to Google Earth, Skype, Tor, I2P, Kazam, and a collection of useful security and privacy apps.
+
+Robolinux is a distribution targeted at new Linux users, so as expected, it includes the stealth virtual machine technology that lets them run the Microsoft Windows XP, Windows 7, and Windows 10 operating systems virus-free. Best of all, the Robolinux 8 "Raptor" LTS series is supported with software updates and security patches until the year 2020.
+
+While newcomers can [download the Robolinux 8.4 LTS Cinnamon, MATE][2], [Xfce][3], and [LXDE][4] editions right now from our website, current Robolinux 8 users can upgrade to the 8.4 release using the built-in "Robolinux Auto Upgrade" button in the Applications Menu.
+
+--------------------------------------------------------------------------------
+
+via: http://news.softpedia.com/news/robolinux-8-4-lts-raptor-series-announced-based-on-debian-gnu-linux-8-jessie-501899.shtml
+
+作者:[Marius Nestor][a]
+译者:[译者ID](https://github.com/译者ID)
+校对:[校对者ID](https://github.com/校对者ID)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]: http://news.softpedia.com/editors/browse/marius-nestor
+[1]: https://robolinux.org/downloads/v8.4-details.html
+[2]: http://linux.softpedia.com/get/System/Operating-Systems/Linux-Distributions/Robolinux-102332.shtml
+[3]: http://linux.softpedia.com/get/Linux-Distributions/Robolinux-Xfce-103540.shtml
+[4]: http://linux.softpedia.com/get/Linux-Distributions/Robolinux-LXDE-103691.shtml

From c8cd642ba9462897037c74de0c6c14f7b6f6259d Mon Sep 17 00:00:00 2001
From: Ezio 
Date: Sat, 19 Mar 2016 22:16:56 +0800
Subject: [PATCH 0549/1469] Rename
 20160318-Robolinux-8.4-LTS-Raptor-Series-Announced-Based-on-Debian-GNU-Linux
 8 Jessie.md to 20160318
 Robolinux-8.4-LTS-Raptor-Series-Announced-Based-on-Debian-GNU-Linux 8
 Jessie.md
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

修改文件名
---
 ...Raptor-Series-Announced-Based-on-Debian-GNU-Linux 8 Jessie.md} | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename sources/news/{20160318-Robolinux-8.4-LTS-Raptor-Series-Announced-Based-on-Debian-GNU-Linux 8 Jessie.md => 20160318 Robolinux-8.4-LTS-Raptor-Series-Announced-Based-on-Debian-GNU-Linux 8 Jessie.md} (100%)

diff --git a/sources/news/20160318-Robolinux-8.4-LTS-Raptor-Series-Announced-Based-on-Debian-GNU-Linux 8 Jessie.md b/sources/news/20160318 Robolinux-8.4-LTS-Raptor-Series-Announced-Based-on-Debian-GNU-Linux 8 Jessie.md
similarity index 100%
rename from sources/news/20160318-Robolinux-8.4-LTS-Raptor-Series-Announced-Based-on-Debian-GNU-Linux 8 Jessie.md
rename to sources/news/20160318 Robolinux-8.4-LTS-Raptor-Series-Announced-Based-on-Debian-GNU-Linux 8 Jessie.md

From c771d5d10be54c611b0e95945ecdd6c7cf6d698f Mon Sep 17 00:00:00 2001
From: wxy 
Date: Sun, 20 Mar 2016 20:38:23 +0800
Subject: [PATCH 0550/1469] PUB:20160220 Manjaro Linux Is Coming To ARM With
 Manjaro-ARM

@name1e5s
---
 ...Linux Is Coming To ARM With Manjaro-ARM.md | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)
 rename {translated/tech => published}/20160220 Manjaro Linux Is Coming To ARM With Manjaro-ARM.md (60%)

diff --git a/translated/tech/20160220 Manjaro Linux Is Coming To ARM With Manjaro-ARM.md b/published/20160220 Manjaro Linux Is Coming To ARM With Manjaro-ARM.md
similarity index 60%
rename from translated/tech/20160220 Manjaro Linux Is Coming To ARM With Manjaro-ARM.md
rename to published/20160220 Manjaro Linux Is Coming To ARM With Manjaro-ARM.md
index 80670c5c7b..5b8ea027c9 100644
--- a/translated/tech/20160220 Manjaro Linux Is Coming To ARM With Manjaro-ARM.md	
+++ b/published/20160220 Manjaro Linux Is Coming To ARM With Manjaro-ARM.md	
@@ -3,19 +3,24 @@ Manjaro Linux 即将推出支持 ARM 处理器的 Manjaro-ARM
 
 ![](http://itsfoss.com/wp-content/uploads/2016/02/manjaro-arm.jpg)
 
-最近,Manjaro 的开发者为 ARM 处理器发布了一个[ alpha 版本](https://manjaro.github.io/Manjaro-ARM-launched/)。这是这个基于 Arhclinux 的发行版的一大进步,在此之前,它只能在 32 位或者 64 位的个人电脑上运行。
+最近,Manjaro 的开发者为 ARM 处理器发布了一个 [alpha 版本](https://manjaro.github.io/Manjaro-ARM-launched/)。这是这个基于 Archlinux 的发行版的一大进步,在此之前,它只能在 32 位或者 64 位的个人电脑上运行。
 
-根据公告, “[Manjaro Arm](http://manjaro-arm.org/) 项目致力于将简洁可定制的 Manjaro 移植到使用[ ARM 处理器](https://www.arm.com/)的设备上去。这些设备的数量正在上涨并且应用范围广泛。这些设备中最出名的是树莓派和 BeagleBoard“。目前 Alpha 版本仅支持树莓派2,但是毫无疑问,支持的设备数量会随时间增长。
+根据公告, “[Manjaro Arm](http://manjaro-arm.org/) 项目致力于将简洁可定制的 Manjaro 移植到使用 [ARM 处理器](https://www.arm.com/)的设备上去。这些设备的数量越来越多并且应用范围广泛。这些设备中最出名的是树莓派和 BeagleBoard“。目前 Alpha 版本仅支持树莓派2,但是毫无疑问,支持的设备数量会随时间增长。
 
 现在这个项目的开发者有 dodgejcr, Torei, Strit, 和 Ringo32。他们正在寻求更多的人来帮助这个项目发展。除了开发者,[他们还在寻找维护者,论坛版主,管理员,以及设计师](http://manjaro-arm.org/forums/website/looking-for-contributors/?PHPSESSID=876d5c11400e9c25eb727e9965300a9a)。
 
-Manjaro-ARM 将会有四个版本。媒体版本将可以运行Kodi并且允许你很少配置就能创建一个媒体中心。服务器版将会预先配置好 SSH,FTP,LAMP ,你能把你的 ARM 设备当作服务器使用。基本版是一个桌面版本,自带一个 XFCE 桌面。如果你想自己从头折腾系统的话你可以选择迷你版,它没有任何预先配置的包,仅仅包含一个 root 用户。
+Manjaro-ARM 将会有四个版本:
 
-## 我的想法
+- 媒体版本将可以运行 Kodi 并且允许你用很少的配置就能创建一个媒体中心。
+- 服务器版将会预先配置好 SSH,FTP,LAMP ,你能把你的 ARM 设备当作服务器使用。
+- 基本版是一个桌面版本,自带一个 XFCE 桌面。
+- 如果你想自己从头折腾系统的话你可以选择迷你版,它没有任何预先配置的软件包,仅仅包含一个 root 用户。
 
-作为一个 Manjaro 的粉丝(我在 4 个电脑上都安了 Manjaro),听说他们分支出一个 ARM 版我很高兴。 ARM 处理器被用到了越来越多的设备当中。如同评论员 Robert Cringely 所说, [设备制造商开始注意到昂贵的因特尔或者AMD处理器之外的便宜的多的ARM处理器](http://www.cringely.com/2016/01/21/prediction-8-intel-starts-to-become-irrelevent/)。甚至微软(憋打我)都开始考虑将自己的一些软件移植到 ARM 处理器上去。随着 ARM 处理器设备数量的增多,Manjaro 将会带给用户良好的体验。
+### 我的想法
 
-对此,你怎样看待?你希望更多的发行版支持 ARM 吗?或者你认为 ARM 将是昙花一现?在评论区告诉我们。
+作为一个 Manjaro 的粉丝(我在 4 个电脑上都安了 Manjaro),听说他们分支出一个 ARM 版我很高兴。 ARM 处理器被用到了越来越多的设备当中。如同评论员 Robert Cringely 所说, [设备制造商开始注意到昂贵的因特尔、AMD 处理器之外的便宜的多的 ARM 处理器](http://www.cringely.com/2016/01/21/prediction-8-intel-starts-to-become-irrelevent/)。甚至微软(别打我)都开始考虑将自己的一些软件移植到 ARM 处理器上去。随着 ARM 处理器设备数量的增多,Manjaro 将会带给用户良好的体验。
+
+对此,你怎样看?你希望更多的发行版支持 ARM 吗?或者你认为 ARM 将是昙花一现?在评论区告诉我们。
 
 ------------------------------------------------------------------------------
 
@@ -23,7 +28,7 @@ via: http://itsfoss.com/manjaro-linux-arm/
 
 作者:[JOHN PAUL][a]
 译者:[name1e5s](https://github.com/name1e5s)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
 
 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
 

From 35c084e15ec66e477ae98138143539a9e5bcf7c6 Mon Sep 17 00:00:00 2001
From: wxy 
Date: Sun, 20 Mar 2016 21:15:32 +0800
Subject: [PATCH 0551/1469] PUB:20151125 20 Years of GIMP Evolution--Step by
 Step

@GHLandy
---
 ...0 Years of GIMP Evolution--Step by Step.md | 96 +++++++++----------
 1 file changed, 45 insertions(+), 51 deletions(-)
 rename {translated/talk => published}/20151125 20 Years of GIMP Evolution--Step by Step.md (64%)

diff --git a/translated/talk/20151125 20 Years of GIMP Evolution--Step by Step.md b/published/20151125 20 Years of GIMP Evolution--Step by Step.md
similarity index 64%
rename from translated/talk/20151125 20 Years of GIMP Evolution--Step by Step.md
rename to published/20151125 20 Years of GIMP Evolution--Step by Step.md
index 20acfc1ee8..6da552aa39 100644
--- a/translated/talk/20151125 20 Years of GIMP Evolution--Step by Step.md	
+++ b/published/20151125 20 Years of GIMP Evolution--Step by Step.md	
@@ -1,57 +1,51 @@
-GHLandy Translated
-
 GIMP 过去的 20 年:一点一滴的进步
 ================================================================================
 注:youtube 视频
 
 
-[GIMP][1](GNU 图像处理程序)—— 一流的开源免费图像处理程序。加州大学伯克利分校的 Peter Mattis 和 Spencer Kimball 最早在 1995 年的时候就进行了该程序的开发。到了 1997 年,该程序成为了 [GNU Project][2] 官方的一部分,并正式更名为 GIMP。时至今日,GIMP 已经成为了最好的图像编辑器之一,并有最受欢迎的 “GIMP vs Photoshop” 之争。
+[GIMP][1](GNU 图像处理程序(GNU Image Manipulation Program))—— 一流的开源自由的图像处理程序。加州大学伯克利分校的 Peter Mattis 和 Spencer Kimball 早在 1995 年的时候开始了该程序的开发。到了 1997 年,该程序成为了 [GNU Project][2] 官方的一部分,并正式更名为 GIMP。时至今日,GIMP 已经成为了最好的图像编辑器之一,并有经常有 “GIMP vs Photoshop” 之争。
 
-1995 年 11 月 21 日,首版发布:
+### 1995 年 11 月 21 日,首版发布###
 
-> 发布者: Peter Mattis
-> 
-> 发布主题: ANNOUNCE: The GIMP
-> 
-> 日期: 1995-11-21
-> 
-> 消息ID: <48s543$r7b@agate.berkeley.edu>
-> 
-> 新闻组: comp.os.linux.development.apps,comp.os.linux.misc,comp.windows.x.apps
-> 
-> GIMP:通用图像处理程序
-> ------------------------------------------------
-> 
-> GIMP 是为各种图像编辑操作提供一个直观的图形界面而设计的。
-> 
-> 以下是 GIMP 的主要功能介绍:
-> 
->  图像查看
->  -------------
-> 
->    *  支持 8 位,15 位,16 位和 24 位颜色
->    *  8 位色显示的图像序列的稳定算法
->    *  以 RGB 色、灰度和索引色模式查看图像
->    *  同时编辑多个图像
->    *  实时缩放和全图查看
->    *  支持 GIF、JPEG、PNG、TIFF 和 XPM 格式
-> 
->  图像编辑
->  -------------
-> 
->    *  选区工具:包括矩形、椭圆、自由、模糊、贝尔赛曲线以及智能
->    *  变换工具:包括旋转、缩放、剪切和翻转
->    *  绘画工具:包括油漆桶、笔刷、喷枪、克隆、卷积、混合和文本
->    *  效果滤镜:如模糊和边缘检测
->    *  通道和颜色操作:叠加、反相和分解
->    *  组件功能:允许你方便的添加新的文件格式和效果滤镜
->    *  多步撤销/重做功能
+```
+From: Peter Mattis
+Subject: ANNOUNCE: The GIMP
+Date: 1995-11-21
+Message-ID: <48s543$r7b@agate.berkeley.edu>
+Newsgroups: comp.os.linux.development.apps,comp.os.linux.misc,comp.windows.x.apps
 
-1996 年,GIMP 0.54 版
+GIMP:通用图像处理程序
+------------------------------------------------
+
+GIMP 是为各种图像编辑操作提供一个直观的图形界面而设计的。
+以下是 GIMP 的主要功能介绍:
+ 图像查看
+ -------------
+
+   *  支持 8 位,15 位,16 位和 24 位颜色
+   *  8 位色显示图像的排序和 Floyd-Steinberg 抖动算法
+   *  以 RGB 色、灰度和索引色模式查看图像
+   *  同时编辑多个图像
+   *  实时缩放和全图查看
+   *  支持 GIF、JPEG、PNG、TIFF 和 XPM 格式
+
+ 图像编辑
+ -------------
+
+   *  选区工具:包括矩形、椭圆、自由、模糊、贝尔赛曲线以及智能
+   *  变换工具:包括旋转、缩放、剪切和翻转
+   *  绘画工具:包括油漆桶、笔刷、喷枪、克隆、卷积、混合和文本
+   *  效果滤镜:如模糊和边缘检测
+   *  通道和颜色操作:叠加、反相和分解
+   *  组件功能:允许你方便的添加新的文件格式和效果滤镜
+   *  多步撤销/重做功能
+```
+
+### 1996 年,GIMP 0.54 版 ###
 
 ![](https://github.com/paulcarroty/Articles/raw/master/GIMP%20History/054.png)
 
-GIMP 0.54 版需要具备 X11 显示、X-server 以及 Motif 1.2 微件,支持 8 位、15 位、16 位和 24 位的颜色深度和灰度,支持 GIF、JPEG、PNG、TIFF 和 XPM 图像格式。
+GIMP 0.54 版需要具备 X11 显示、X-server 以及 Motif 1.2 组件,支持 8 位、15 位、16 位和 24 位的颜色深度和灰度,支持 GIF、JPEG、PNG、TIFF 和 XPM 图像格式。
 
 基本功能:具备矩形、椭圆、自由、模糊、贝塞尔曲线和智能等选择工具,旋转、缩放、剪切、克隆、混合和翻转等变换工具。
 
@@ -66,7 +60,7 @@ GIMP 0.54 版可以在  Linux、HP-UX、Solaris 和 SGI IRIX 中运行。
 这只是一个开发版本,并非面向用户发布的。GIMP 有了新的工具包——GDK(GIMP Drawing Kit,GIMP 绘图工具)和 GTK(GIMP Toolkit,GIMP 工具包),并弃用 Motif。GIMP 工具包随后也发展成为了 GTK+ 跨平台的微件工具包。新特性:
 
 - 基本的图层功能
-- 子像素采集
+- 子像素取样
 - 笔刷间距
 - 改进剂喷枪功能
 - 绘制模式
@@ -75,7 +69,7 @@ GIMP 0.54 版可以在  Linux、HP-UX、Solaris 和 SGI IRIX 中运行。
 
 ![](https://github.com/paulcarroty/Articles/raw/master/GIMP%20History/099.png)
 
-从 0.99 版本开始,GIMP 有了宏脚本的支持。GTK 及 GTK 功能增强版正式更名为 GTK+。其他更新:
+从 0.99 版本开始,GIMP 有了宏脚本的支持。GTK 及 GDK 功能增强版正式更名为 GTK+。其他更新:
 
 - 支持大体积图像(大于 100M)
 - 新增原生格式 – XCF
@@ -87,8 +81,8 @@ GIMP 0.54 版可以在  Linux、HP-UX、Solaris 和 SGI IRIX 中运行。
 
 GIMP 和 GTK+ 开始分为两个不同的项目。GIMP 官网进行重构,包含新教程、组件和文档。新特性:
 
-- 基于瓦片式的内存管理
-- 组件 API 做了较大改变
+- 基于瓦片式(tile)的内存管理
+- 组件 API 做了大量改变
 - XFC 格式现在支持图层、导航和选择
 - web 界面
 - 在线图像生成
@@ -98,7 +92,7 @@ GIMP 和 GTK+ 开始分为两个不同的项目。GIMP 官网进行重构,包
 新特性:
 
 - 进行了非英文语言翻译
-- 修复 GTK+ 和 GIMP 中的大量bug
+- 修复 GTK+ 和 GIMP 中的大量 bug
 - 增加大量组件
 - 图像映射
 - 新工具:调整大小、测量、加亮、燃烧效果、颜色吸管和翻转等。
@@ -106,7 +100,7 @@ GIMP 和 GTK+ 开始分为两个不同的项目。GIMP 官网进行重构,包
 - 保存前可以进行图像预览
 - 按比例缩放的笔刷进行预览
 - 通过路径进行递归选择
-- 新的窗口导航
+- 新的导航窗口
 - 支持图像拖拽
 - 支持水印
 
@@ -138,7 +132,7 @@ GIMP 和 GTK+ 开始分为两个不同的项目。GIMP 官网进行重构,包
 
 - 更新了图形界面
 - 新的选择工具
-- 继承了 GEGL (GEneric Graphics Library,通用图形库)
+- 集成了 GEGL (GEneric Graphics Library,通用图形库)
 - 为 MDI 行为实现了实用程序窗口提示
 
 ### 2012 年,GIMP 2.8 版 ###
@@ -160,7 +154,7 @@ via: https://tlhp.cf/20-years-of-gimp-evolution/
 
 作者:[Pavlo Rudyi][a]
 译者:[GHLandy](https://github.com/GHLandy)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
 
 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
 

From c6f5b0ce5a5044d335198cd515a3b32597cdadb3 Mon Sep 17 00:00:00 2001
From: Ezio 
Date: Sun, 20 Mar 2016 23:13:22 +0800
Subject: [PATCH 0552/1469] translating

---
 ...Raspberry Pi projects for the classroom.md | 35 ++++++++++++++++---
 1 file changed, 30 insertions(+), 5 deletions(-)

diff --git a/sources/tech/20151207 5 great Raspberry Pi projects for the classroom.md b/sources/tech/20151207 5 great Raspberry Pi projects for the classroom.md
index b1bc89b2a0..b7455d11f7 100644
--- a/sources/tech/20151207 5 great Raspberry Pi projects for the classroom.md	
+++ b/sources/tech/20151207 5 great Raspberry Pi projects for the classroom.md	
@@ -3,57 +3,82 @@ ezio
 5 great Raspberry Pi projects for the classroom
 =====================================================
 
+
+5 个很适合在课堂上演示的树莓派项目
+=====================================================
+
 ![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/osdc-open-source-yearbook-lead3.png?itok=fSUS0fIt)
 
-### 1. Minecraft Pi
+### 1. 我的世界 Pi
 
 ![](https://opensource.com/sites/default/files/lava.png)
 >Courtesy of the Raspberry Pi Foundation. [CC BY-SA 4.0][1].
 
 Minecraft is the favorite game of pretty much every teenager in the world—and it's one of the most creative games ever to capture the attention of young people. The version that comes with every Raspberry Pi is not only a creative thinking building game, but comes with a programming interface allowing for additional interaction with the Minecraft world through Python code.
 
+我的世界是世界上很多青少年最喜欢的一个游戏,而且他也是目前最能激发年轻人创造力的一款游戏。这个树莓派版上自带的我的世界不仅仅是一个具有创造性的建筑游戏,他还是一个具有编程接口、可以通过 Python 与之交互的版本。
+
 Minecraft: Pi Edition is a great way for teachers to engage students with problem solving and writing code to perform tasks. You can use the Python API to build a house and have it follow you wherever you go, build a bridge wherever you walk, make it rain lava, show the temperature in the sky, and anything else your imagination can create.
 
+我的世界:Pi 版对于老师来说是一个非常好的教授学生解决问题和编写代码完成任务的途径。你可以使用 Python API 创建一个房子,并且一直跟随这你的脚步移动,当你需要桥梁的时候给你建造一座桥,让老天呀下雨,显示天空的温度,以及其它你可以想象到的一切东西。
+
 Read more in "[Getting Started with Minecraft Pi][2]."
 
-### 2. Reaction game and traffic lights
+详情请见 "[Getting Started with Minecraft Pi][2]."
+
+### 2. 反应游戏和交通灯 Reaction game and traffic lights
 
 ![](https://opensource.com/sites/default/files/pi_traffic_installed_yellow_led_on.jpg)
 >Courtesy of [Low Voltage Labs][3]. [CC BY-SA 4.0][1].
 
 It's really easy to get started with physical computing on Raspberry Pi—just connect up LEDs and buttons to the GPIO pins, and with a few lines of code you can turn lights on and control things with button presses. Once you know the code to do the basics, it's down to your imagination as to what you do next!
 
+使用树莓派可以很轻松的进行物理计算——只需要连接几个 LED 和按钮到 开发板上的 GPIO 接口,再用几行代码你就可以按下按钮来开灯。一旦你指导了如何使用代码来做这些基本的东西,接下来就可以根据你的想象来做其它事情了。
+
 If you know how to flash one light, you can flash three. Pick out three LEDs in traffic light colors and you can code the traffic light sequence. If you know how to use a button to a trigger an event, then you have a pedestrian crossing! Also look out for great pre-built traffic light add-ons like [PI-TRAFFIC][4], [PI-STOP][5], [Traffic HAT][6], and more.
 
+如果你知道如何让一个灯闪烁,你就可以让三个灯开始闪烁。挑选三个和交通灯一样颜色的 LED 灯,然后编写控制交通灯的代码。如果你知道如何使用按钮触发实践,那么你就可以模拟行人过马路。同时你可以参考其它已经完成的交通灯附件,比如[PI-TRAFFIC][4], [PI-STOP][5], [Traffic HAT][6],等等。
+
 It's not always about the code—this can be used as an exercise in understanding how real world systems are devised. Computational thinking is a useful skill in any walk of life.
 
+代码并不是全部——这些联系只是让你理解真是世界里使如何完成这些事的。计算思维是一个在你一生中都会很有用的技能。
+
 ![](https://opensource.com/sites/default/files/reaction-game.png)
 >Courtesy of the Raspberry Pi Foundation. [CC BY-SA 4.0][1].
 
 Next, try wiring up two buttons and an LED and making a two-player reaction game—let the light come on after a random amount of time and see who can press the button first!
 
+接下来试着接通两个按钮和 LED 灯的电源,实现一个反应游戏 —— 让 LED 灯随机的点亮,然后看是最先按下按钮。
+
 To learn more, check out [GPIO Zero recipes][7]. Everything you need is in [CamJam EduKit 1][8].
 
-### 3. Sense HAT Pixel Pet
+要想了解更多可以看看 [GPIO Zero recipes][7]。你所需要的资料都可以在 [CamJam EduKit 1][8] 找到。
+
+### 3. 电子宠物 Sense HAT Pixel Pet
 
 The Astro Pi—an augmented Raspberry Pi—is going to space this December, but you haven't missed your chance to get your hands on the hardware. The Sense HAT is the sensor board add-on used in the Astro Pi mission and it's available for anyone to buy. You can use it for data collection, science experiments, games and more. Watch this Gurl Geek Diaries video from Raspberry Pi's Carrie Anne for a great way to get started—by bringing to life an animated pixel pet of your own design on the Sense HAT display:
 
+Astro Pi —— 一个增强版的树莓派 —— 将在 12 月问世,但是你并没有错过亲手把玩这个硬件的机会。Sense HAT 是 Astro Pi 的一个传感器扩展板,现在已经开放购买了。你可以使用它来进行数据搜集,科学实验,游戏和其它很多事。可以看看下面树莓派的 Carrie Anne 拍摄的 Gurl Geek Diaries 的视频,里面演示了一种很棒的入门途径——给生活添加一个你自己创造的生动的像素宠物:
+
 [video](https://youtu.be/gfRDFvEVz-w)
 
 >Learn more in "[Exploring the Sense HAT][9]."
+>详见 "[探索 Sense HAT][9]."
 
-### 4. Infrared bird box
+### 4. 红外鸟笼 Infrared bird box
 
 ![](https://opensource.com/sites/default/files/ir-bird-box.png)
 >Courtesy of the Raspberry Pi Foundation. [CC BY-SA 4.0][1].
 
 A great exercise for the whole class to get involved with—place a Raspberry Pi and the NoIR camera module inside a bird box along with some infra-red lights so you can see in the dark, then stream video from the Pi over the network or on the internet. Wait for birds to nest and you can observe them without disturbing them in their habitat.
 
+
+
 Learn all about infrared and the light spectrum, and how to adjust the camera focus and control the camera in software.
 
 Learn more in "[Make an infrared bird box][10]."
 
-### 5. Robotics
+### 5. 机器人 Robotics
 
 ![](https://opensource.com/sites/default/files/edukit3_1500-alex-eames-sm.jpg)
 >Courtesy of Low Voltage Labs. [CC BY-SA 4.0][1].

From 9bc3cd8d9330742394c36f909567de323277e742 Mon Sep 17 00:00:00 2001
From: geekpi 
Date: Mon, 21 Mar 2016 10:01:12 +0800
Subject: [PATCH 0553/1469] translating

---
 ...to Run on Snappy Ubuntu Core 16.04 LTS and Raspberry Pi 3.md | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sources/tech/20160318 ownCloud Pi Device to Run on Snappy Ubuntu Core 16.04 LTS and Raspberry Pi 3.md b/sources/tech/20160318 ownCloud Pi Device to Run on Snappy Ubuntu Core 16.04 LTS and Raspberry Pi 3.md
index a03f9dd355..b9c93cc1cd 100644
--- a/sources/tech/20160318 ownCloud Pi Device to Run on Snappy Ubuntu Core 16.04 LTS and Raspberry Pi 3.md	
+++ b/sources/tech/20160318 ownCloud Pi Device to Run on Snappy Ubuntu Core 16.04 LTS and Raspberry Pi 3.md	
@@ -1,3 +1,5 @@
+----translating----
+
 ownCloud Pi Device to Run on Snappy Ubuntu Core 16.04 LTS and Raspberry Pi 3
 ===============================================================================
 

From b34b5e74da9f6e2de2b7778e8d9eb4dba88b9060 Mon Sep 17 00:00:00 2001
From: geekpi 
Date: Mon, 21 Mar 2016 10:31:28 +0800
Subject: [PATCH 0554/1469] translated

---
 ...buntu Core 16.04 LTS and Raspberry Pi 3.md | 37 -------------------
 ...buntu Core 16.04 LTS and Raspberry Pi 3.md | 37 +++++++++++++++++++
 2 files changed, 37 insertions(+), 37 deletions(-)
 delete mode 100644 sources/tech/20160318 ownCloud Pi Device to Run on Snappy Ubuntu Core 16.04 LTS and Raspberry Pi 3.md
 create mode 100644 translated/tech/20160318 ownCloud Pi Device to Run on Snappy Ubuntu Core 16.04 LTS and Raspberry Pi 3.md

diff --git a/sources/tech/20160318 ownCloud Pi Device to Run on Snappy Ubuntu Core 16.04 LTS and Raspberry Pi 3.md b/sources/tech/20160318 ownCloud Pi Device to Run on Snappy Ubuntu Core 16.04 LTS and Raspberry Pi 3.md
deleted file mode 100644
index b9c93cc1cd..0000000000
--- a/sources/tech/20160318 ownCloud Pi Device to Run on Snappy Ubuntu Core 16.04 LTS and Raspberry Pi 3.md	
+++ /dev/null
@@ -1,37 +0,0 @@
-----translating----
-
-ownCloud Pi Device to Run on Snappy Ubuntu Core 16.04 LTS and Raspberry Pi 3
-===============================================================================
-
-keyword : ownCloud Pi , Snappy Ubuntu Core 16.04 LTS , Raspberry Pi 3 , Western Digital , PiDrive
-
-### We [reported][1] last year that ownCloud was in talks with WD (Western Digital) Labs to help them develop a community project that would bring a self-hosted cloud storage device in users' homes.
-
-The idea behind the self-hosted device, which will be powered by the ownCloud Server software, was to combine a Raspberry Pi single-board computer with a Western Digital disk drive into an easy-to-install and out-of-the-box container.
-
-Well, it looks like the community's response was more than positive, and many great proposals and ideas were received for the ownCloud Pi project. And today, they have even greater news for us, as the first images are available for [download][2].
-
-The ownCloud Pi images are based on the latest Snappy Ubuntu Core 16.04 LTS operating system, which was designed by Canonical for embedded and IoT (Internet of Things) devices, as well as the new Raspberry Pi 3 Model B SBC.
-
-"We’re looking for help in the ownCloud, Ubuntu, Raspberry Pi and WD Labs communities for help to test and improve them and will be able to make available a first batch of about 30 devices at the end of next week," say the ownCloud developers in today's [announcement][3].
-
-### Current obstacles, challenges, and the road ahead
-
-At the moment, the team is working hard on finishing their ownCloud Pi device solution based on the Xenial Xerus edition of Snappy Ubuntu Core. Thus, the new 64-bit Raspberry Pi 3 computer helps them with the obstacles encountered during previous tests running on the Raspberry Pi 2 board, such as support for files larger than 2GB.
-
-Therefore, it looks like the decision was taken, and the final ownCloud Pi device, which should be available as a preview later this spring, will be powered by the Raspberry Pi 3 single-board computer. In the coming days, we should be able to purchase the first production-ready version of the ownCloud Pi device.
-
---------------------------------------------------------------------------------
-
-via: http://news.softpedia.com/news/owncloud-pi-device-to-run-on-snappy-ubuntu-core-16-04-lts-and-raspberry-pi-3-501904.shtml
-
-作者:[Marius Nestor][a]
-译者:[译者ID](https://github.com/译者ID)
-校对:[校对者ID](https://github.com/校对者ID)
-
-本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
-
-[a]: http://news.softpedia.com/editors/browse/marius-nestor
-[1]: http://news.softpedia.com/news/owncloud-partnerships-with-wd-to-bring-self-hosted-cloud-storage-in-users-homes-497512.shtml
-[2]: http://people.canonical.com/~kyrofa/owncloud-pi/
-[3]: https://owncloud.org/blog/wd-labs-raspberry-pi-owncloud-and-ubuntu/
diff --git a/translated/tech/20160318 ownCloud Pi Device to Run on Snappy Ubuntu Core 16.04 LTS and Raspberry Pi 3.md b/translated/tech/20160318 ownCloud Pi Device to Run on Snappy Ubuntu Core 16.04 LTS and Raspberry Pi 3.md
new file mode 100644
index 0000000000..7b65226250
--- /dev/null
+++ b/translated/tech/20160318 ownCloud Pi Device to Run on Snappy Ubuntu Core 16.04 LTS and Raspberry Pi 3.md	
@@ -0,0 +1,37 @@
+ownCloud Pi设备将在Snappy Ubuntu Core 16.04 LTS及树莓派3中运行
+===============================================================================
+
+关键词 : ownCloud Pi , Snappy Ubuntu Core 16.04 LTS , Raspberry Pi 3 , Western Digital , PiDrive
+
+### 我们去年[报道了][1] ownCloud正与西部数据(ownCloud)实验室交谈帮助他们开发一个社区项目,可以在家自托管的云存储设备。
+
+自托管设备背后的理念,是由ownCloud服务端软件承载的,它结合了树莓派和西数硬盘到一个易安装和开箱即用的容器中。
+
+社区的反应看上去很积极,ownCloud Pi收到了许多好的提议和点子。今天,我们收到了一个更好的消息,首个镜像可以[下载][2]了。
+
+ownCloud Pi基于最新的Snappy Ubuntu Core 16.04 LTS系统,它由Canonical为嵌入式和IoT(Internet of Things)及新的树莓派3 Model B设计。
+
+ownCloud的开发者在今天的[声明][3]中称:“我们正在寻求ownCloud、Ubuntu、树莓派和西数实验室的帮助来帮助测试和提高它们,并且可以在下周发布首批30台设备”。
+
+### 目前的阻碍、挑战及前进的路
+
+目前团队正致力于在基于Xenial Xerus版本的Snappy Ubuntu内核上完成他们的ownCloud Pi设备方案。那么,新的64位树莓派3可以帮助它们克服之前在树莓派2上遇到的阻碍,比如支持大于2GB的文件。
+
+由此看来决定已经有了,最终的ownCloud Pi将在今年春天发布预览版,它将会在树莓派3上运行。之后,我们应该就可以购买首批生产就绪版本的ownCloud Pi设备了。
+
+--------------------------------------------------------------------------------
+
+via: http://news.softpedia.com/news/owncloud-pi-device-to-run-on-snappy-ubuntu-core-16-04-lts-and-raspberry-pi-3-501904.shtml
+
+作者:[Marius Nestor][a]
+译者:[geekpi](https://github.com/geekpi)
+校对:[校对者ID](https://github.com/校对者ID)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]: http://news.softpedia.com/editors/browse/marius-nestor
+[1]: http://news.softpedia.com/news/owncloud-partnerships-with-wd-to-bring-self-hosted-cloud-storage-in-users-homes-497512.shtml
+[2]: http://people.canonical.com/~kyrofa/owncloud-pi/
+[3]: https://owncloud.org/blog/wd-labs-raspberry-pi-owncloud-and-ubuntu/
+
+

From 576947f4094384253a7ce4dbd9291f10710a7e03 Mon Sep 17 00:00:00 2001
From: miaolin 
Date: Mon, 21 Mar 2016 20:56:36 +0800
Subject: [PATCH 0555/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E4=BA=86=E4=B8=80?=
 =?UTF-8?q?=E9=83=A8=E5=88=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

别回收,这两天完成
---
 ... Getting to Know Linux File Permissions.md | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/sources/tech/20160218 Getting to Know Linux File Permissions.md b/sources/tech/20160218 Getting to Know Linux File Permissions.md
index 816f499e36..be48dbbe5a 100644
--- a/sources/tech/20160218 Getting to Know Linux File Permissions.md	
+++ b/sources/tech/20160218 Getting to Know Linux File Permissions.md	
@@ -1,28 +1,39 @@
 ynmlml translating 
 Getting to Know Linux File Permissions
 ==========================================
-
+初识Linux文件系统
+==========================================
 ![](http://www.linux.com/images/stories/66866/files_a.png)
 
 One of the most basic tasks in Linux is setting file permissions. Understanding how this is done should be considered a must-know, first step in your travels through the Linux ecosystem. As you might expect, such a fundamental issue within the operating environment hasn’t changed much over the years. In fact, the Linux file permission system is taken directly from the UNIX file permission (and even uses many of the same tools).
+在Linux中最基本的任务就是设置文件权限。理解如何实现是你进入LInux世界的第一步。如您所料,这一基本操作在类UNIX操作系统中大同小异。实际上,Linux文件权限系统就直接来取自UNIX文件权限(甚至使用许多相同的工具)。
 
 But, don’t think for a second that understanding file permissions is something you’ll wind up having to spend days and days studying...it’s actually quite simple. Let’s walk through what you need to know and how to put it all together.
+但不要以为在学习第二种文件权限的时候你需要再次一点一点的学起。事实上会很简单,让我们一起来看看你需要了解哪些内容以及如何使用它们。
 
 ## The Bits and Pieces
+##预备小知识
 
 The first thing you need to understand is what file permissions apply to. Effectively what you do is apply a permission to a group. When you break it down, the concept really is that simple. But what are the permissions and what are the groups?
+首先你要知道文件权限有什么用,有效的设置一个组的权限。当你将其分解,那这个概念就真的很简单了。那到底什么是权限什么是组呢。
 
 There are three types of permissions you can apply:
+你可以设置的3种权限:
 
 - read — gives the group permission to read the file (indicated with `r`)
+- 读 — 允许该组读文件(用`r`表示)
 
 - write — gives the group permission to edit the file (indicated with `w`)
+- 写 — 允许该组写文件(用`w`表示)
 
 - execute — gives the group permission to execute (run) the file (indicated with `x`)
+- 执行 — 允许该组执行(运行)文件(用`x`表示)
 
 To better explain how this is applied to a group, you could, for example, give a group permission to read and write to a file, but not execute the file. Or, you could give a group permission to read and execute a file, but not write to a file. You can even give a group full permission to read, write, and execute a file or strip a group of any access to a file by removing all permissions.
+为了更好的解释为何是应用于一个组,你可是尝试允许一个组读和写一个文件,但不能执行。或者你可以允许一个组读和执行一个文件,但不能写。甚至你可以允许一组有读、写、执行全部的权限,也可以删除全部权限。
 
 Now, what are the groups? There are four:
+那什么是分组呢,有以下4个:
 
 - user — the actual owner of the file
 
@@ -31,8 +42,12 @@ Now, what are the groups? There are four:
 - others — other users not in the file’s group
 
 - all — all users
-
+- user — 文件实际的拥有者
+- group — 用户所在的组
+- others — 用户组内的其他用户
+- all — 所有用户
 For the most part, you will only really ever bother with the first three groups. The all group is really only used as a shortcut (I’ll explain later).
+大多数情况,你只会对前3组进行操作,all这一组只是作为快捷方式(稍后我会解释)。
 
 So far so simple, right? Let’s layer on a bit of complexity.
 

From 3e0aeea596e159b2a2a44540d5ac4cd7acd83d41 Mon Sep 17 00:00:00 2001
From: miaolin 
Date: Tue, 22 Mar 2016 20:51:17 +0800
Subject: [PATCH 0556/1469] Create Getting to Know Linux File Permissions

---
 .../Getting to Know Linux File Permissions    | 160 ++++++++++++++++++
 1 file changed, 160 insertions(+)
 create mode 100644 translated/tech/Getting to Know Linux File Permissions

diff --git a/translated/tech/Getting to Know Linux File Permissions b/translated/tech/Getting to Know Linux File Permissions
new file mode 100644
index 0000000000..fb75030b0a
--- /dev/null
+++ b/translated/tech/Getting to Know Linux File Permissions	
@@ -0,0 +1,160 @@
+初识Linux文件系统
+==========================================
+
+![](http://www.linux.com/images/stories/66866/files_a.png)
+
+在Linux中最基本的任务就是设置文件权限。理解如何实现是你进入LInux世界的第一步。如您所料,这一基本操作在类UNIX操作系统中大同小异。
+实际上,Linux文件权限系统就直接取自UNIX文件权限(甚至使用许多相同的工具)。
+
+但不要以为在学习第二种文件权限系统的时候你需要再次一点一点的学起。事实上会很简单,让我们一起来看看你需要了解哪些内容以及如何使用它们。
+
+##基础概念
+
+首先你要知道文件权限适用于什么,如何有效的设置一个分组的权限。当你将其分解,那这个概念就真的简单多了。那到底什么是权限什么是分组呢。
+
+你可以设置的3种权限:
+
+- 读 — 允许该组读文件(用`r`表示)
+
+- 写 — 允许该组写文件(用`w`表示)
+
+- 执行 — 允许该组执行(运行)文件(用`x`表示)
+
+为了更好的解释为何是应用于一个分组,你可是尝试允许一个分组读和写一个文件,但不能执行。或者你可以允许一个组读和执行一个文件,但不能写。
+甚至你可以允许一组有读、写、执行全部的权限,也可以删除全部权限。
+
+什么是分组呢,有以下4个:
+
+- user — 文件实际的拥有者
+
+- group — 用户所在的组
+
+- others — 用户组内的其他用户
+
+- all — 所有用户
+
+大多数情况,你只会对前3组进行操作,all这一组只是作为快捷方式(稍后我会解释)。
+
+到目前为止很简单,对吧?接下来我们将深入一层。
+
+如果你打开一个终端并运行命令 ls -l ,你将会看到逐行列出当前工作目录下所有的文件和文件夹的列表(如图1).
+
+你会留意到最左边那列是像·-rw-rw-r--·这样的。
+
+实际上这列表该这样看的:
+
+>rw- rw- r--
+
+将其分为如下3部分:
+
+- rw-
+
+- rw-
+
+- r--
+
+权限和组的顺序都很重要,顺序总是:
+
+- 用户 组 其他 — 分组
+
+- 读 写 操作 — 权限
+
+在我们上面示例的权限列表中,用户拥有读/写权限,用户组拥有读/写权限,其他用户仅拥有读权限。这些分组中赋予执行权限的话,就用一个x表示。
+
+## 等效数值
+
+接下来我们让它更复杂一些,每个权限都可以用一个数字表示。这些数字是:
+
+- 读 — 4
+
+- 写 — 2
+
+- 执行— 1
+
+数值代替不是一个一个的替换,你不能像这样:
+
+>-42-42-4--
+
+你该把每个分组的数值相加,给用户读和写权限,你该用4 + 2 得到6。给用户组相同的权限,也是使用相同的数值。假如你只想给其他用户读的权限,
+那就设置它为4。现在用数只表示为:
+
+>664
+
+如果你想给一个文件664权限,你可以使用chmod命令,如:
+
+>chmod 664 FILENAME
+
+FILENAME处为文件名。
+
+## 更改权限
+
+既然你已经理解了文件权限,那是时候学习如何更改这些权限了。就是使用chmod命令来实现。第一步你要知道你能否更改文件权限,
+你必须是文件的所有者或者有权限编辑文件(或者使用su或sudo进行操作)。正因为这样,你不能随意切换目录和更改文件权限。
+
+
+继续用我们的例子(`-rw-rw-r--`),假设这个文件(命名为script.sh)实际是个shell脚本,需要执行。但是你你只想让自己有权限执行这个脚本。
+这个时候,你可能会想:“我需要是文件的权限如`-rwx-rw-r--`这样来设置`x`”。实际你可以这样使用chmod命令:
+
+>chmod u+x script.sh
+
+这时候,列表中显示的应该是 -rwx-rw-r-- 。
+
+如果你想同时让用户及其所在组同时拥有执行权限,命令应该这样:
+
+>chmod ug+x script.sh
+
+
+明白这是怎么工作的了,下面我们让它更有趣些。不管什么原因,你不小心给了所有分组对文件的执行权限(列表中是这样的 `-rwx-rwx-r-x` )。
+如果你想去除其他用户的执行权限,只需运行命令:
+
+>chmod o-x script.sh
+
+如果你想完全删除文件的可执行权限,你可以用两种方法:
+
+>chmod ugo-x script.sh
+
+或者
+
+>chmod a-x script.sh
+
+以上就是所有内容,能使操作更有效率。我希望能避免哪些可能会导致一些问题的操作(例如你不小心对script.sh使用`a-rwx`这样的chmod命令)。
+
+## 目录权限
+
+You can also execute the chmod command on a directory. When you create a new directory as a user, it is typically created with the following permissions:
+你也可以对一个目录执行chmod命令,当你创建一个新的目录,通常新建目录具有这样的权限:
+
+>drwxrwxr-x
+
+注:开头的d表示这是一个目录。
+
+正如你所见,用户及其所在组都对文件夹具有操作权限,但这并不意味着在这文件夹中出创建的问价也具有与其相同的权限
+(创建的文件使用默认系统的权限`-rw-rw-r--`)。但如果你想在新文件夹中创建文件,并且移除用户组的写权限,
+你不用切换到该目录下并对所有文件使用chmod命令。你可以用加上参数R(意味着递归)的chmod命令,同时更改该文件夹及其目录下所有的文件的权限。
+
+现在,假设有一文件夹TEST,里面有一些脚本,所有这些(包括TEST文件夹)拥有权限`-rwxrwxr-x`。如果你想移除用户组的写权限,
+你可以运行命令:
+
+>chmod -R g-w TEST
+
+运行命令`ls -l`,你讲看到列出的TEST文件夹的权限信息是`drwxr-xr-x`。用户组被去除了写权限(其目录下的所有文件也如此)。
+
+## 总结
+
+现在,你应该对基本的Linux文件权限有了深入的理解。对于更高级的东西学起来会很轻松,像setid,setuid和ACLs这些。没有良好的基础,
+你很快就会混淆不清概念的。
+
+Linux文件权限从早期到现在没有太大变化,而且很可能以后也不会。
+
+
+------------------------------------------------------------------------------
+
+via: http://www.linux.com/learn/tutorials/885268-getting-to-know-linux-file-permissions
+
+作者:[Jack Wallen][a]
+译者:[译者ID](https://github.com/ynmlml)
+校对:[校对者ID](https://github.com/校对者ID)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:http://www.linux.com/community/forums/person/93

From 00c8835729298ad51a74c258c5c5a9b22e2e5a5e Mon Sep 17 00:00:00 2001
From: miaolin 
Date: Tue, 22 Mar 2016 20:53:13 +0800
Subject: [PATCH 0557/1469] Delete 20160218 Getting to Know Linux File
 Permissions.md

---
 ... Getting to Know Linux File Permissions.md | 163 ------------------
 1 file changed, 163 deletions(-)
 delete mode 100644 sources/tech/20160218 Getting to Know Linux File Permissions.md

diff --git a/sources/tech/20160218 Getting to Know Linux File Permissions.md b/sources/tech/20160218 Getting to Know Linux File Permissions.md
deleted file mode 100644
index be48dbbe5a..0000000000
--- a/sources/tech/20160218 Getting to Know Linux File Permissions.md	
+++ /dev/null
@@ -1,163 +0,0 @@
-ynmlml translating 
-Getting to Know Linux File Permissions
-==========================================
-初识Linux文件系统
-==========================================
-![](http://www.linux.com/images/stories/66866/files_a.png)
-
-One of the most basic tasks in Linux is setting file permissions. Understanding how this is done should be considered a must-know, first step in your travels through the Linux ecosystem. As you might expect, such a fundamental issue within the operating environment hasn’t changed much over the years. In fact, the Linux file permission system is taken directly from the UNIX file permission (and even uses many of the same tools).
-在Linux中最基本的任务就是设置文件权限。理解如何实现是你进入LInux世界的第一步。如您所料,这一基本操作在类UNIX操作系统中大同小异。实际上,Linux文件权限系统就直接来取自UNIX文件权限(甚至使用许多相同的工具)。
-
-But, don’t think for a second that understanding file permissions is something you’ll wind up having to spend days and days studying...it’s actually quite simple. Let’s walk through what you need to know and how to put it all together.
-但不要以为在学习第二种文件权限的时候你需要再次一点一点的学起。事实上会很简单,让我们一起来看看你需要了解哪些内容以及如何使用它们。
-
-## The Bits and Pieces
-##预备小知识
-
-The first thing you need to understand is what file permissions apply to. Effectively what you do is apply a permission to a group. When you break it down, the concept really is that simple. But what are the permissions and what are the groups?
-首先你要知道文件权限有什么用,有效的设置一个组的权限。当你将其分解,那这个概念就真的很简单了。那到底什么是权限什么是组呢。
-
-There are three types of permissions you can apply:
-你可以设置的3种权限:
-
-- read — gives the group permission to read the file (indicated with `r`)
-- 读 — 允许该组读文件(用`r`表示)
-
-- write — gives the group permission to edit the file (indicated with `w`)
-- 写 — 允许该组写文件(用`w`表示)
-
-- execute — gives the group permission to execute (run) the file (indicated with `x`)
-- 执行 — 允许该组执行(运行)文件(用`x`表示)
-
-To better explain how this is applied to a group, you could, for example, give a group permission to read and write to a file, but not execute the file. Or, you could give a group permission to read and execute a file, but not write to a file. You can even give a group full permission to read, write, and execute a file or strip a group of any access to a file by removing all permissions.
-为了更好的解释为何是应用于一个组,你可是尝试允许一个组读和写一个文件,但不能执行。或者你可以允许一个组读和执行一个文件,但不能写。甚至你可以允许一组有读、写、执行全部的权限,也可以删除全部权限。
-
-Now, what are the groups? There are four:
-那什么是分组呢,有以下4个:
-
-- user — the actual owner of the file
-
-- group — users in the file’s group
-
-- others — other users not in the file’s group
-
-- all — all users
-- user — 文件实际的拥有者
-- group — 用户所在的组
-- others — 用户组内的其他用户
-- all — 所有用户
-For the most part, you will only really ever bother with the first three groups. The all group is really only used as a shortcut (I’ll explain later).
-大多数情况,你只会对前3组进行操作,all这一组只是作为快捷方式(稍后我会解释)。
-
-So far so simple, right? Let’s layer on a bit of complexity.
-
-If you open up a terminal window and issue the command ls -l, you will see a line-by-line listing of all files and folders within the current working directory (Figure 1 above).
-
-If you look in the far left column, you’ll notice listings like `-rw-rw-r--`.
-
-That listing should actually be looked at like so:
-
->rw- rw- r--
-
-As you can see, the listing is broken into three sections:
-
-- rw-
-
-- rw-
-
-- r--
-
-The order is quite important...for both permissions and for groups. The order is always:
-
-- User Group Others — for groups
-
-- Read Write Execute — for permissions
-
-In our permissions listing example above, the User has read/write permission, the Group has read/write permission, and Others has only read permission. Had any of those groups been given executable permissions, it would have been represented with an x.
-
-## Numerical Equivalent
-
-Let’s make this even more complex. Each permission can also be represented by a number. The numbers are:
-
-- Read — 4
-
-- Write — 2
-
-- Execute — 1
-
-The numerical substitution isn’t an apples to apples change. You can’t drop in:
-
->-42-42-4--
-
-Instead, what you do is add up the numbers you want for each group. Let’s stick with our example above (`-rw-rw-r—`). To give the User group read and write permission, you would add up 4+2 to get 6. For the Group, you need the same permissions, so they get the same number. You only want Others to have read permissions, so they get 4. The numerical equivalent is now:
-
->664
-
-So, if you want to give a file 664 permissions, you’d issue the chmod command like this:
-
->chmod 664 FILENAME
-
-where FILENAME is the name of the file.
-
-## Changing Permissions
-
-Now that you understand the actual permissions of files, it’s time to learn how to change those permissions. This is done with the chmod command. One of the first things you must understand is that, to be able to change the permissions of a file, either you must be the owner of the file or you must have permission to edit the file (or have admin access by way of su or sudo). Because of that, you cannot just jump around in the directory structure and change permissions of files at will.
-
-Let’s stick with our example (`-rw-rw-r--`). Suppose this file (we’ll name it script.sh) is actually a shell script and needs to be executed...but you only want to give yourself permission to execute that script. At this point, you should be thinking, “Ah, then I need the permission listing to read `-rwx-rw-r--`!”. To get that `x` bit in there, you’d run the chmod command like so:
-
->chmod u+x script.sh
-
-At this point, the listing will be -rwx-rw-r--.
-
-If you wanted to give both User and Group executable permission, the command would look like:
-
->chmod ug+x script.sh
-
-See how this works? Let’s make it interesting. Say, for whatever reason, you accidentally give all groups executable permissions for that file (so the listing looks like `-rwx-rwx-r-x`). If you want to strip Others of executable permissions, issue the command:
-
->chmod o-x script.sh
-
-What if you want to completely remove executable permission from the file? You can do that two ways:
-
->chmod ugo-x script.sh
-
-or
-
->chmod a-x script.sh
-
-That’s where all comes into play. This is used to make the process a bit more efficient. I prefer to avoid using a as it could lead to issues (such as, when you accidentally issue the command chmod `a-rwx` script.sh).
-
-## Directory Permissions
-
-You can also execute the chmod command on a directory. When you create a new directory as a user, it is typically created with the following permissions:
-
->drwxrwxr-x
-
-NOTE: The leading d indicates it is a directory.
-
-As you can see, both User and Group have executable permission for the folder. This does not mean that any files created in the folder will have the same permissions (files will be created with the default system permissions of `-rw-rw-r--`). But, suppose you do create files in this new directory, and you want to strip Group of write permissions. You don’t have to change into the directory and then issue the chmod command on all the files. You can add the R option (which means recursive) to the chmod command and change the permission on both the folder and all the containing files.
-
-Now, suppose our example is a folder named TEST and within it is a number of scripts — all of which (including the TEST folder) have permissions `-rwxrwxr-x`. If you want to strip Group of write permissions, you could issue the command:
-
->chmod -R g-w TEST
-
-If you now issue the command ls `-l`, you will see the TEST folder now has a permission listing of `drwxr-xr-x`. Group has been stripped of its write permissions (as will all the files within).
-
-## Permission to Conclude
-
-At this point, you should now have a solid understand of the basic Linux file permissions. There are more advanced issues that you can now easily study, such as setuid and setgid and ACLs. Without a good foundation of the basics, however, you’d quickly get lost with those next-level topics.
-
-Linux file permissions haven’t changed much, since the early days. And, they most likely won’t change much going into the future.
-
-
-------------------------------------------------------------------------------
-
-via: http://www.linux.com/learn/tutorials/885268-getting-to-know-linux-file-permissions
-
-作者:[Jack Wallen][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/93

From 25ecd2c82042f12630621ef85a8b72e41eecf021 Mon Sep 17 00:00:00 2001
From: miaolin 
Date: Tue, 22 Mar 2016 21:06:52 +0800
Subject: [PATCH 0558/1469] =?UTF-8?q?=E9=A2=9D=EF=BC=8C=E6=80=8E=E4=B9=88?=
 =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E6=9C=89=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 translated/tech/Getting to Know Linux File Permissions | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/translated/tech/Getting to Know Linux File Permissions b/translated/tech/Getting to Know Linux File Permissions
index fb75030b0a..72edbed84e 100644
--- a/translated/tech/Getting to Know Linux File Permissions	
+++ b/translated/tech/Getting to Know Linux File Permissions	
@@ -1,5 +1,5 @@
 初识Linux文件系统
-==========================================
+================================================================================
 
 ![](http://www.linux.com/images/stories/66866/files_a.png)
 

From b60314b6ab5ee18e82bcac4bbd21e23f165eee8a Mon Sep 17 00:00:00 2001
From: geekpi 
Date: Wed, 23 Mar 2016 09:43:34 +0800
Subject: [PATCH 0559/1469] translating

---
 .../20160220 Former Kubuntu Head Unveils New KDE Project.md     | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sources/tech/20160220 Former Kubuntu Head Unveils New KDE Project.md b/sources/tech/20160220 Former Kubuntu Head Unveils New KDE Project.md
index dc3b2a1a76..5601497176 100644
--- a/sources/tech/20160220 Former Kubuntu Head Unveils New KDE Project.md	
+++ b/sources/tech/20160220 Former Kubuntu Head Unveils New KDE Project.md	
@@ -1,3 +1,5 @@
+translating----geekpi
+
 Former Kubuntu Head Unveils New KDE Project
 ==============================================
 

From aa19f69948807cb19b13e77e8777585f5fde11a5 Mon Sep 17 00:00:00 2001
From: 4357 
Date: Wed, 23 Mar 2016 11:20:53 +0800
Subject: [PATCH 0560/1469] =?UTF-8?q?4357=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

https://github.com/4357
---
 ...20160218 What do Linux developers think of Git and GitHub.md | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sources/tech/20160218 What do Linux developers think of Git and GitHub.md b/sources/tech/20160218 What do Linux developers think of Git and GitHub.md
index 9002025820..b444b0958c 100644
--- a/sources/tech/20160218 What do Linux developers think of Git and GitHub.md	
+++ b/sources/tech/20160218 What do Linux developers think of Git and GitHub.md	
@@ -1,3 +1,5 @@
+@4357 翻译中
+
 What do Linux developers think of Git and GitHub?
 =====================================================
 

From dcb49b8915cac334f8b59be85b85163813c8b162 Mon Sep 17 00:00:00 2001
From: geekpi 
Date: Wed, 23 Mar 2016 11:27:03 +0800
Subject: [PATCH 0561/1469] translated

---
 ...er Kubuntu Head Unveils New KDE Project.md | 37 -------------------
 ...er Kubuntu Head Unveils New KDE Project.md | 35 ++++++++++++++++++
 2 files changed, 35 insertions(+), 37 deletions(-)
 delete mode 100644 sources/tech/20160220 Former Kubuntu Head Unveils New KDE Project.md
 create mode 100644 translated/tech/20160220 Former Kubuntu Head Unveils New KDE Project.md

diff --git a/sources/tech/20160220 Former Kubuntu Head Unveils New KDE Project.md b/sources/tech/20160220 Former Kubuntu Head Unveils New KDE Project.md
deleted file mode 100644
index 5601497176..0000000000
--- a/sources/tech/20160220 Former Kubuntu Head Unveils New KDE Project.md	
+++ /dev/null
@@ -1,37 +0,0 @@
-translating----geekpi
-
-Former Kubuntu Head Unveils New KDE Project
-==============================================
-
-The name Jonathan Riddell should ring a bell if you read Linux and [open source news](http://itsfoss.com/category/news/). He was the creator and longtime lead developer of the [Kubuntu](http://www.kubuntu.org/) distribution. He was [forced out of his position by Ubuntu boss Mark Shuttleworth](http://www.cio.com/article/2926838/linux/mark-shuttleworth-ubuntu-community-council-ask-kubuntu-developer-to-step-down-as-leader.html) last year because he dared to ask what happened to the funds Canonical had raised for Kubuntu. (To the best of my knowledge, Canonical never really answered to his questions about finances.)
-
-![](http://itsfoss.com/wp-content/uploads/2016/02/kde-neon-e1454448724263.png)
-
-## KDE neon logo
-
-On Saturday, Riddell [announced](https://dot.kde.org/2016/01/30/fosdem-announcing-kde-neon) a new project: [KDE neon](http://neon.kde.org.uk/). According to Riddell’s announcement “Neon will provide a way to get the latest KDE software on the day it’s released.”
-
-After reading both the announcement and looking at the brief site, **it appears that neon is a mainly a “rapidly updated software repository” that allows KDE fans to be on the bleeding edge**. Instead of waiting for months for distro developers to release the updated KDE on their repos, you’ll be able to get it hot off the presses.
-
-KDE did state in the [noen FAQ](http://neon.kde.org.uk/faq) that this is not a KDE created distro. In fact, they say “KDE believes it is important to work with many distributions, as each brings unique value and expertise for their respective users. This is one project out of hundreds from KDE.”
-
-![](http://itsfoss.com/wp-content/uploads/2016/02/kde-neon-e1454448830870.jpg)
-
-However, the way the site and the announcement refer to the fact that neon runs on Ubuntu 15.10 (until the next LTS version is available) and that there will soon be images makes me wonder. KDE could be saying this to keep Canonical from seeing this project as a competitor to Kubuntu. If they that there is a demand for KDE neon, they could spin it off as a full distro. Both the announcement and site state that this is a KDE Incubator project, so the future could hold anything for this project.
-
-[KDE neon](http://neon.kde.org.uk/)
-
-Does neon sound like it would be useful for you or are you happy with your current distro’s KDE release rate? Do you think there is room for another KDE distro (if KDE decides to head in that direction)? Let me know in the comment section below.
-
-------------------------------------------------------------------------------
-
-via: http://itsfoss.com/kde-neon-unveiled/
-
-作者:[JOHN PAUL][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/john/
-
diff --git a/translated/tech/20160220 Former Kubuntu Head Unveils New KDE Project.md b/translated/tech/20160220 Former Kubuntu Head Unveils New KDE Project.md
new file mode 100644
index 0000000000..44dc94b9f0
--- /dev/null
+++ b/translated/tech/20160220 Former Kubuntu Head Unveils New KDE Project.md	
@@ -0,0 +1,35 @@
+前Kubuntu领袖发起了新的KDE项目
+==============================================
+
+如果你阅读Linux和[开源新闻](http://itsfoss.com/category/news/)的话应该会对Jonathan Riddell这人很熟悉。它是[Kubuntu](http://www.kubuntu.org/)发行版的创建者及长期的开发领导。他由于敢于询问Canonical基金会对Kubuntu的资金筹集情况[而被Ubuntu的老板Mark Shuttleworth驱逐](http://www.cio.com/article/2926838/linux/mark-shuttleworth-ubuntu-community-council-ask-kubuntu-developer-to-step-down-as-leader.html) (据我所知,Canonical从来没有真正回答过他的这个关于财务的问题。)
+
+![](http://itsfoss.com/wp-content/uploads/2016/02/kde-neon-e1454448724263.png)
+
+## KDE neon 标志
+
+在周日,Riddell[宣布](https://dot.kde.org/2016/01/30/fosdem-announcing-kde-neon)了一个新项目:KDE neon](http://neon.kde.org.uk/)。根据Riddell的声明,“Neon将会在发布时提供最新的KDE软件。”
+
+在看了声明何网站后,**neon似乎主要是一个“快速的软件更新仓库”,它让KDE粉丝可以用上最新的软件**。除了等上数月来等到开发者在他们的仓库中发布新的KDE,你还可以从新闻中了解最新消息。
+
+KDE的确在[noen FAQ](http://neon.kde.org.uk/faq)中声明过这不是一个KDE创建的发行版。事实上,他们说“KDE相信与许多发行版协作是很重要的,因为它们每个都能给用户提供独特的价值和专长。这是KDE成千上万项目中的一个。”
+
+![](http://itsfoss.com/wp-content/uploads/2016/02/kde-neon-e1454448830870.jpg)
+
+然而,网站和公告显示neon会运行在Ubuntu 15.10中(直到有下个长期支持版本)并很快会有让我惊奇的镜像。KDE可能要让Canonical看到此项目是Kubuntu的竞争对手。如果他们有KDE neon的需求,他们将把它拆开作为一个完整的发行版。网站和通告声称这是一个KDE孵化项目,因此未来可能会包含任何东西。
+
+[KDE neon](http://neon.kde.org.uk/)
+
+neon听上去对你有用么,或者你是否对现在的KDE发行版的发布速度满意?你认为是否还有其他KDE发行版的空间(如果KDE决定超这个方向进发)?让我在评论栏知道你们的想法。
+
+------------------------------------------------------------------------------
+
+via: http://itsfoss.com/kde-neon-unveiled/
+
+作者:[JOHN PAUL][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/john/
+

From 84be4eb1384dbad2d4dda3c1a8b48d0d47da0e02 Mon Sep 17 00:00:00 2001
From: miaolin 
Date: Thu, 24 Mar 2016 16:57:51 +0800
Subject: [PATCH 0562/1469] Update and rename Getting to Know Linux File
 Permissions to 20160218 Getting to Know Linux File Permissions

---
 ...missions => 20160218 Getting to Know Linux File Permissions} | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 rename translated/tech/{Getting to Know Linux File Permissions => 20160218 Getting to Know Linux File Permissions} (99%)

diff --git a/translated/tech/Getting to Know Linux File Permissions b/translated/tech/20160218 Getting to Know Linux File Permissions
similarity index 99%
rename from translated/tech/Getting to Know Linux File Permissions
rename to translated/tech/20160218 Getting to Know Linux File Permissions
index 72edbed84e..77b3ed099f 100644
--- a/translated/tech/Getting to Know Linux File Permissions	
+++ b/translated/tech/20160218 Getting to Know Linux File Permissions	
@@ -1,4 +1,4 @@
-初识Linux文件系统
+初识Linux文件权限
 ================================================================================
 
 ![](http://www.linux.com/images/stories/66866/files_a.png)

From 619b6c5fabe4bbdcc56c5b4ec54bbe1eb9a145ad Mon Sep 17 00:00:00 2001
From: Ezio 
Date: Thu, 24 Mar 2016 23:27:07 +0800
Subject: [PATCH 0563/1469] =?UTF-8?q?20160324-1=20=E9=80=89=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 ...uBSD Brings Ubuntu And FreeBSD Together.md | 66 +++++++++++++++++++
 1 file changed, 66 insertions(+)
 create mode 100644 sources/tech/20160320 UbuntuBSD Brings Ubuntu And FreeBSD Together.md

diff --git a/sources/tech/20160320 UbuntuBSD Brings Ubuntu And FreeBSD Together.md b/sources/tech/20160320 UbuntuBSD Brings Ubuntu And FreeBSD Together.md
new file mode 100644
index 0000000000..cca9a74a90
--- /dev/null
+++ b/sources/tech/20160320 UbuntuBSD Brings Ubuntu And FreeBSD Together.md	
@@ -0,0 +1,66 @@
+UbuntuBSD Brings Ubuntu And FreeBSD Together
+=================================================
+
+![](http://itsfoss.com/wp-content/uploads/2016/03/UbuntuBSD.jpg)
+
+Move over [Linux][1], people. UbuntuBSD is bringing the experience of Ubuntu on the top of a FreeBSD kernel.
+
+Quite unsurprisingly, UbuntuBSD has taglined itself as ‘Unix for human beings’. If you remember, Ubuntu uses the tagline ‘Linux for human beings’ and have actually made it possible for a ‘normal human’ to use Linux in last 11 years.
+
+UbuntuBSD aims to do the same. Which is to make Unix accessible and usable by beginners, if I may put it that way. At least, this is what it aims.
+
+### What’s BSD? How is Linux different from it?
+
+If you are a beginner, then you should know the [difference between Unix and Linux][2].
+
+Way before Linux, Unix operating systems was desgined at [AT&T][3] by [Ken Thompson][4], [Denis Ricthie][5] and team. This was back in 1970. You might be surprised to know that Unix is a closed source, properitry operating system. AT&T licensed Unix to various thrid parties, both academic and commercial vendors.
+
+One of the academic vendors is University of California, Berkeley. The Unix operating system developed here is known as [BSD (Berkeley Software Distribution)][6]. One of the most popular open source derivative of BSD is [FreeBSD][7]. Another most popular closed source BSD derviative is Apple’s Mac OS X.
+
+In 1991, Finnish computer science student Linus Torvalds developed his own Unix clone from scratch. This is what we know today as Linux Kernel. Linux distributions add GUI system, GNU utilities (such as cp, mv, ls,date, bash etc), installation & management tools, GNU c/c++ Compilers and various applications on top of the Linux kernel.
+
+### UbuntuBSD is not the first of its kind
+
+When you have get the difference between Unix, Linux and FreeBSD, let me tell you that UbuntuBSD is not the first Linux-ish experience on the top of FreeBSD kernel.
+
+When Debian opted out for [systemd][8], this resulted in the birth of [Debian GNU/kFreeBSD][9] operating system. It is a port of Debian that run on the top of FreeBSD rather than the usual Linux kernel.
+
+UbuntuBSD is a similar implementation of Ubuntu on FreeBSD kernel.
+
+### UbuntuBSD Beta codenamed Escape From SystemD
+
+The first beta release of UbuntuBSD is out and it has been codenamed “Escape from SystemD”. It is based on Ubuntu 15.10 and FreeBSD kernel 10.1.
+
+It ships with [Xfce][10] desktop and is designed for both desktop and server. [ZFS][11] support is included as well. It has text based installer.
+
+### Wanna try?
+
+I won’t suggest that everyone start trying it in excitement. It is still under development and the installer is text based. If you are confident enough, go ahead and download it from the link below but beginners, please stay out, at least for now:
+
+[UbuntuBSD][12]
+
+What do you think of UbuntuBSD?
+
+--------------------------------------------------------------------------------
+
+via: http://itsfoss.com/ubuntubsd-ubuntu-freebsd/
+
+作者:[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/tag/linux/
+[2]: http://www.cyberciti.biz/faq/what-is-the-difference-between-linux-and-unix/
+[3]: https://en.wikipedia.org/wiki/AT%26T
+[4]: https://en.wikipedia.org/wiki/Ken_Thompson
+[5]: https://en.wikipedia.org/wiki/Dennis_Ritchie
+[6]: http://www.bsd.org/
+[7]: https://www.freebsd.org/
+[8]: https://www.freedesktop.org/wiki/Software/systemd/
+[9]: https://www.debian.org/ports/kfreebsd-gnu/
+[10]: http://www.xfce.org/
+[11]: https://en.wikipedia.org/wiki/ZFS
+[12]: https://sourceforge.net/projects/ubuntubsd/

From b944a1c397674fc212d481dfd36d8110da4baa02 Mon Sep 17 00:00:00 2001
From: KS 
Date: Fri, 25 Mar 2016 16:00:44 +0800
Subject: [PATCH 0564/1469] Translated

Translated Two Outstanding All-in-One Linux Servers
---
 ...wo Outstanding All-in-One Linux Servers.md | 105 ------------------
 ...wo Outstanding All-in-One Linux Servers.md | 103 +++++++++++++++++
 2 files changed, 103 insertions(+), 105 deletions(-)
 delete mode 100644 sources/tech/20160228 Two Outstanding All-in-One Linux Servers.md
 create mode 100644 translated/tech/20160228 Two Outstanding All-in-One Linux Servers.md

diff --git a/sources/tech/20160228 Two Outstanding All-in-One Linux Servers.md b/sources/tech/20160228 Two Outstanding All-in-One Linux Servers.md
deleted file mode 100644
index 4d6f369aa5..0000000000
--- a/sources/tech/20160228 Two Outstanding All-in-One Linux Servers.md	
+++ /dev/null
@@ -1,105 +0,0 @@
-wyangsun translating
-Two Outstanding All-in-One Linux Servers
-================================================
-
-keywords: Linux Server , SMB , clearos , Zentyal
-
-![](http://www.linux.com/images/stories/66866/jack-clear_a.png)
-
->Figure 1: The ClearOS setup wizard.
-
-Back in 2000, Microsoft released their Small Business Server. This product changed the way many people viewed how technology could function within the realm of business. Instead of having multiple machines handle different tasks, you could deploy a single server which would handle email, calendaring, file sharing, directory services, VPN, and a whole lot more. For many of small businesses, this was a serious boon, but for some the cost of the Windows SMB was prohibitive. For yet others, the idea of relying on such a server, designed by Microsoft, simply wasn’t an option.
-
-For that last group, there are alternatives. In fact, within the realm of Linux and open source, you can choose from several solid platforms that can serve your small business as a one-stop server shop. If your small business has between 10 and 50 employees, the all-in-one server might be the ideal solution to meet your needs.
-
-Here, I’ll look at two Linux all-in-one servers, so you can see if one of them is the perfect match for your company.
-
-Remember, these servers are not, in any way, suited for big business or enterprise. Larger companies cannot rely on the all-in-one server simply because a single server cannot take the load expected within the realm of enterprise needs. With that said, here’s what SMBs can expect from a Linux all in one.
-
-### ClearOS
-
-[ClearOS][1] was originally released in 2009, under the name ClarkConnect, as a router and gateway distribution. Since then, ClearOS has added all the features necessary to define it as an all-in-one server. ClearOS offers more than just a piece of software. You can also purchase a [ClearBox 100][2] or [ClearBox 300][3]. These servers ship complete with ClearOS and are marketed as IT in a box. Check out the feature comparison/price matrix [here][4].
-
-For those with hardware already in-house, you can download one of the following:
-
-- [ClearOS Community][5] — The community (free) edition of ClearOS
-
-- [ClearOS Home][6] — Ideal for home offices (details on features and subscription costs, see here)
-
-- [ClearOS Business][7] — Ideal for small businesses (details on features and subscription costs, see here)
-
-What do you get with ClearOS? You get a business-class server with a single, elegantly designed web interface. What is unique about ClearOS is that you will get plenty of features in the base server; beyond that, you must add on features from the [Clear Marketplace][8]. From within the Marketplace, you can install free or paid apps that extend the feature set of the ClearOS server. Here you’ll find add-ons for Windows Server Active Directory, OpenLDAP, Flexshares, Antimalware, Cloud, Web access control, Content filtering, and much more. You’ll even find some third-party add-ons such as Google Apps Synchronization, Zarafa Collaboration Platform, and Kaspersky Anti-virus.
-
-ClearOS is installed like any other Linux distribution (based on Red Hat’s Anaconda installer). Once the install is complete, you will be prompted to set up the networking interface as well as presented with the address to point your browser (on the same network as the ClearOS server). The address will be in the form:
-
-[https://IP_OF_CLEAROS_SERVER:81][9]
-
-Where IP_OF_CLEAROS_SERVER is the actual IP address of the server. NOTE: When you first point your browser to the server, you will receive a “Connection is not private” warning. Proceed on to the address so you can continue the setup.
-
-When the browser finally connects, you will be prompted for the root user credentials (you set the root user password up during initial installation). Once authenticated, you will be presented with the ClearOS setup wizard (Figure 1 above).
-
-Click the Next button to begin the process of setting up your ClearOS server. The wizard is self-explanatory and, in the end, you will be asked which version of ClearOS you want to use. Click either Community, Home, or Business. Once selected, you will be required to register for an account. Once you’ve created an account and registered the server, you can then move on to updating the server, configuring the server, and adding modules from the marketplace (Figure 2).
-
-![](http://www.linux.com/images/stories/66866/jack-clear_b.png)
-
->Figure 2: Installing modules from the marketplace.
-
-At this point, you are ready to start digging deep into the configuration of your ClearOS small business server.
-
-### Zentyal
-
-[Zentyal][10] is a Ubuntu-based small business server that was, at one point, distributed under the name eBox. Zentyal offers plenty of servers/services to fit your SMB needs:
-
-- Email — Webmail; Native MS Exchange protocols and Active Directory support; Calendars and contacts; Mobile device email sync; Antivirus/antispam; IMAP, POP, SMTP, CalDAV, and CardDAV support
-
-- Domain & Directory — Central domain directory management; Multiple organization units; Single sign-on authentication; File sharing; ACLs, Advanced domain management, Printer management
-
-- Networking & Firewall — Static and DHCP interfaces; Objects & services; Packet filter; Port forwarding
-
-- Infrastructure — DNS; DHCP; NTP; Certification authority; VPN
-
-- Firewall
-
-The installation of Zentyal is very much like that of Ubuntu Server—it’s text based and quite simple: Boot up the install media, make a few quick selections, and wait for the installation to complete. Once the initial, text-based, installation is finished, you are presented with the GUI desktop where a wizard will appear for package selection. Select all the packages you want to install and allow the installer to finish the job.
-
-Finally, you can log into your Zentyal server via the web interface (point your browser to [https://IP_OF_SERVER:8443][11] — where IP_OF_SERVER is the LAN address of the Zentyal server) or use the standalone, desktop GUI to administer the server (Zentyal includes quick access to an Administrator and User console as well as a Zentyal Administration console). When all systems have been saved and started, you will be presented with the Zentyal Dashboard (Figure 3).
-
-![](http://www.linux.com/images/stories/66866/jack-zentyal_a.png)
-
->Figure 3: The Zentyal Dashboard in action.
-
-The Dashboard allows you to control all aspects of the server, such as updating, managing servers/services, and getting a quick status update of the server. You can also go into the Components area and install components that you opted out of during installation or update the current package list. Click on Software Management > System Updates and select what you want to update (Figure 4), then click the UPDATE button at the bottom of the screen.
-
-![](http://www.linux.com/images/stories/66866/jack-zentyal_b.png)
-
->Figure 4: Updating your Zentyal server is simple.
-
-### Which Server Is Right for You?
-
-The answer to this question depends on what you need. Zentyal is an amazing server that does a great job running your SMB network. If you need a bit more, such as groupware, your best bet is to go with ClearOS. If you don’t need groupware, either server will do an outstanding job.
-
-I highly recommend installing both of these all-in-one servers to see which will best serve your small company needs.
-
-
-------------------------------------------------------------------------------
-
-via: http://www.linux.com/learn/tutorials/882146-two-outstanding-all-in-one-linux-servers
-
-作者:[Jack Wallen][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/93
-[1]: http://www.linux.com/learn/tutorials/882146-two-outstanding-all-in-one-linux-servers#clearfoundation-overview
-[2]: https://www.clearos.com/products/hardware/clearbox-100-series
-[3]: https://www.clearos.com/products/hardware/clearbox-300-series
-[4]: https://www.clearos.com/products/hardware/clearbox-overview
-[5]: http://mirror.clearos.com/clearos/7/iso/x86_64/ClearOS-DVD-x86_64.iso
-[6]: http://mirror.clearos.com/clearos/7/iso/x86_64/ClearOS-DVD-x86_64.iso
-[7]: http://mirror.clearos.com/clearos/7/iso/x86_64/ClearOS-DVD-x86_64.iso
-[8]: https://www.clearos.com/products/purchase/clearos-marketplace-overview
-[9]: https://ip_of_clearos_server:81/
-[10]: http://www.zentyal.org/server/
-[11]: https://ip_of_server:8443/
diff --git a/translated/tech/20160228 Two Outstanding All-in-One Linux Servers.md b/translated/tech/20160228 Two Outstanding All-in-One Linux Servers.md
new file mode 100644
index 0000000000..a60b23aea1
--- /dev/null
+++ b/translated/tech/20160228 Two Outstanding All-in-One Linux Servers.md	
@@ -0,0 +1,103 @@
+两个杰出的一体化Linux服务器
+================================================
+
+关键词:Linux服务器,SMB,clearos,Zentyal
+
+![](http://www.linux.com/images/stories/66866/jack-clear_a.png)
+
+>图1: ClearOS安装向导。
+
+回到2000年,微软发布小型商务服务器。这个产品改变了很多人们对科技在商务领域的看法。你可以部署一个单独的服务器,它能处理邮件,日历,文件共享,目录服务,VPN,以及更多,而不是很多机器处理不同的任务。对很多小型商务来说,这是非常好的恩惠,但是Windows SMB的一些花费是昂贵的。对于其他人,微软设计的依赖于一个服务器的想法,根本不是一个选项。
+
+对于最近的用户群,有些替代品。事实上,在Linux和开源领域里,你可以选择许多稳定的平台,它可以作为一站式服务商店服务于你的小型企业。如果你的小型企业有10到50员工,一体化服务器也许是你所需的理想方案。
+
+这里,我将要看看两个Linux一体化服务器,所以你可以查看他们哪个能完美适用于你的公司。
+
+记住,这些服务器不能,以任何方式,适用于大型商务或企业。大公司无法依靠一体化服务器,仅仅是因为一台服务器不能负荷在企业内所需的企望。除此之外,这就是小型企业可以从Linux一体化服务器期待什么。
+
+### ClearOS
+
+[ClearOS][1]是在2009年在ClarkConnect下发行的,作为一个路由和网关的分支。从那以后,ClearOS已经增加了所有一体化服务器必要的特性。CearOS提供的不仅仅是一个软件。你可以购买一个[ClearBox 100][2] 或[ClearBox 300][3]。这些服务器搭载完整的ClearOS作为一个IT设备被销售。在[这里][4]查看特性比对/价格矩阵。
+
+家里已经有这些硬件,你可以下载这些之一:
+
+- [ClearOS社区][5] — 社区(免费)版的ClearOS
+
+- [ClearOS家庭][6] — 理想的家庭办公室(详细的功能和订阅费用,见这里)
+
+- [ClearOS商务][7] — 理想的小型商务(详细的功能和订阅费用,见这里)
+
+使用ClearOS你得到了什么?你得到了一个单机的业务合作服务器,设计精美的网页。ClearOS独特的是什么?你可以在基础服务中得到很多特性。除了这个,你必须从 [Clear Marketplace][8]增加特性。在市场上,你可以安装免费或付费的应用程序,扩展集的ClearOS服务器的特性。这里你可以找到附加的Windows服务器活动目录,OpenLDAP,Flexshares,Antimalware,云,Web访问控制,内容过滤,还有更多。你甚至可以找到一些第三方组件像谷歌应用同步,Zarafa合作平台,卡巴斯基杀毒。
+
+ClearOS的安装像其他Linux发行版(基于红帽的Anaconda安装程序)。安装完成后,系统将提示您设置网络接口就是提供你浏览器访问的地址(与ClearOS服务器在同一个网络里)。地址格式如下:
+
+[https://IP_OF_CLEAROS_SERVER:81][9]
+
+IP_OF_CLEAROS_SERVER就是服务器的真实IP地址。注:当你第一次在浏览器访问这个服务器时,你将收到一个“Connection is not private”的警告。继续访问这个地址你才能继续设置。
+
+当浏览器连接上,就会提示你root用户认证(在初始化安装中你设置的root用户密码)。一通过认证,你将看到ClearOS的安装向导(上图1)
+
+点击下一步按钮,开始设置你的ClearOS服务器。这个向导无需加以说明,在最后还会问你想用那个版本的ClearOS。点击社区,家庭,或者商业。一旦选择,你就需要注册一个账户。创建了一个账户注册了服务器后,你可以开始更新服务器,配置服务器,从市场添加模块(图2)。
+
+![](http://www.linux.com/images/stories/66866/jack-clear_b.png)
+
+>图2: 从市场安装模块。
+
+此时,你已经准备开始深入挖掘配置你的ClearOS小型商务服务器了。
+
+### Zentyal
+
+[Zentyal][10]是一个基于Ubuntu的小型商务服务器,现在,发布在eBox域名下。Zentyal提供了大量的服务器/服务来适应你的小型商务需求:
+
+- 电子邮件 — 网页邮件;原生微软邮件协议和活动目录支持;日历和通讯录;手机设备电子邮件同步;反病毒/反垃圾;IMAP,POP,SMTP,CalDAV,和CardDAV支持。
+
+- 域和目录 — 核心域目录管理;多个组织单元;单点登录身份验证;文件共享;ACLs,高级域名管理,打印机管理。
+
+- 网络和防火墙 — 静态和DHCP接口;对象和服务;包过滤;端口转发。
+
+- 基础设施 — DNS;DHCP;NTP;认证中心;VPN。
+
+- 防火墙
+
+安装Zentyal很像Ubuntu服务器的文本安装而且很简单:启动安装镜像,做一些选择,等待安装完成。一旦初始化,完成基于文本安装,就提供给你桌面GUI,向导程序提供选择包。选择所有你想安装的包,让安装程序完成这些工作。
+
+最终,你可以通过网页接口来访问Zentyal服务器(浏览器访问[https://IP_OF_SERVER:8443][11] - IP_OF_SERVER是Zentyal服务器的内网地址)或使用独立的桌面GUI来管理服务器(Zentyal包括快速访问管理员和用户控制台就像Zentyal管理控制台)。当全部系统已经保存开启,你将看到Zentyal面板(图3)。
+
+![](http://www.linux.com/images/stories/66866/jack-zentyal_a.png)
+
+>图3: Zentyal活动面板.
+
+这个面板允许你控制服务器所有方面,比如更新,管理服务器/服务,获取服务器的敏捷状态更新。您也可以进入组件领域,然后安装部署过程中选择出来的组件或更新当前的软件包列表。点击 软件管理 > 系统更新 并选择你想更新的(图4),然后在屏幕最底端点击更新按钮。
+
+![](http://www.linux.com/images/stories/66866/jack-zentyal_b.png)
+
+>图4: 更新你的Zentyal服务器很简单。
+
+### 那个服务器适合你?
+
+回答这个问题要看你有什么需求。Zentyal是一个不可思议的服务器,它很好的胜任于你的小型商务网络中。如果你需要更多,如组合软件,你最好赌在ClearOS上。如果你不需要组合软件,任意的服务器将表现杰出的工作。
+
+我强烈建议安装这两个一体化的服务器,看看哪个是你的小公司所需的最好服务。
+
+------------------------------------------------------------------------------
+
+via: http://www.linux.com/learn/tutorials/882146-two-outstanding-all-in-one-linux-servers
+
+作者:[Jack Wallen][a]
+译者:[wyangsun](https://github.com/wyangsun)
+校对:[校对者ID](https://github.com/校对者ID)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]: http://www.linux.com/community/forums/person/93
+[1]: http://www.linux.com/learn/tutorials/882146-two-outstanding-all-in-one-linux-servers#clearfoundation-overview
+[2]: https://www.clearos.com/products/hardware/clearbox-100-series
+[3]: https://www.clearos.com/products/hardware/clearbox-300-series
+[4]: https://www.clearos.com/products/hardware/clearbox-overview
+[5]: http://mirror.clearos.com/clearos/7/iso/x86_64/ClearOS-DVD-x86_64.iso
+[6]: http://mirror.clearos.com/clearos/7/iso/x86_64/ClearOS-DVD-x86_64.iso
+[7]: http://mirror.clearos.com/clearos/7/iso/x86_64/ClearOS-DVD-x86_64.iso
+[8]: https://www.clearos.com/products/purchase/clearos-marketplace-overview
+[9]: https://ip_of_clearos_server:81/
+[10]: http://www.zentyal.org/server/
+[11]: https://ip_of_server:8443/

From e27b7b8402b0038b60b1ba51b5621f75d31beec2 Mon Sep 17 00:00:00 2001
From: wxy 
Date: Sat, 26 Mar 2016 04:49:40 +0800
Subject: [PATCH 0565/1469] PUB:20160316 What we learned in Seoul with AlphaGo

@martin2011qi
---
 .../20160316 What we learned in Seoul with AlphaGo.md       | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
 rename {translated/news => published}/20160316 What we learned in Seoul with AlphaGo.md (97%)

diff --git a/translated/news/20160316 What we learned in Seoul with AlphaGo.md b/published/20160316 What we learned in Seoul with AlphaGo.md
similarity index 97%
rename from translated/news/20160316 What we learned in Seoul with AlphaGo.md
rename to published/20160316 What we learned in Seoul with AlphaGo.md
index ab3c92b4c9..d4e40ab488 100644
--- a/translated/news/20160316 What we learned in Seoul with AlphaGo.md	
+++ b/published/20160316 What we learned in Seoul with AlphaGo.md	
@@ -1,4 +1,4 @@
-我们和 AlphaGo 在首尔学到了什么
+AlphaGo 的首尔之战带来的启示
 ================================================================================
 围棋并不仅仅是一个游戏——她是一伙活生生的玩家们,分析家们,爱好者们以及传奇大师们。在过去的十天里,在韩国首尔,我们有幸亲眼目睹那份难以置信的激动。我们也有幸也目睹了那前所未有的场景:[DeepMind][1] 的 AlphaGo 迎战并战胜了传奇围棋大师,李世石(职业9段,身负 18 个世界头衔),这是人工智能的里程碑。
 
@@ -6,7 +6,7 @@
 
 虽说围棋可能是存世的最为悠久的游戏之一了,但对于这五盘比赛的关注度还是大大的超出了我们的想象。搜索围棋规则和围棋盘的用户在美国迅速飙升。在中国,数以千万计的用户通过直播观看了这场比赛,并且新浪微博“人机围棋大战”话题的浏览量破 2 亿。韩国的围棋盘也销量[激增][2]。
 
-然而我们如此公然的测试 AlphaGo,并不仅仅是为了赢棋而已。我们自 2010 年成立 DeepMind,为的是创造出具有独立学习能力的通用型人工智能(AI),并致力于将其作为工具协助解决,从气候变化到诊断疾病,这类最为棘手且急迫的问题为最终目标。 
+然而我们如此公开的测试 AlphaGo,并不仅仅是为了赢棋而已。我们自 2010 年成立 DeepMind,为的是创造出具有独立学习能力的通用型人工智能(AI),并致力于将其作为工具协助解决,从气候变化到诊断疾病,这类最为棘手且急迫的问题为最终目标。 
 
 亦如许多前辈学者们一样,我们也是通过游戏来开发并测试我们的算法的。在一月份,我们第一次披露了 [AlphaGo][3]——作为第一个通过使用 [深度学习][4] 和 [强化学习][5],可以在人类发明的最为复杂的棋盘类游戏中击败职业选手的 AI 程序。而 AlphaGo 迎战过去十年间最厉害的围棋选手——李世石,绝对称得上是 [终极挑战][6]。
 
@@ -28,7 +28,7 @@ via: https://googleblog.blogspot.com/2016/03/what-we-learned-in-seoul-with-alpha
 
 作者:[Demis Hassabis][a]
 译者:[martin2011qi](https://github.com/martin2011qi)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
 
 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
 

From 78d74229ce512eb12b191f5eded8911ea8d64e50 Mon Sep 17 00:00:00 2001
From: wxy 
Date: Sat, 26 Mar 2016 04:50:51 +0800
Subject: [PATCH 0566/1469] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=A9=E5=B1=95?=
 =?UTF-8?q?=E5=90=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

@ynmlml
---
 ...sions => 20160218 Getting to Know Linux File Permissions.md} | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 rename translated/tech/{20160218 Getting to Know Linux File Permissions => 20160218 Getting to Know Linux File Permissions.md} (99%)

diff --git a/translated/tech/20160218 Getting to Know Linux File Permissions b/translated/tech/20160218 Getting to Know Linux File Permissions.md
similarity index 99%
rename from translated/tech/20160218 Getting to Know Linux File Permissions
rename to translated/tech/20160218 Getting to Know Linux File Permissions.md
index 77b3ed099f..b38cef6f32 100644
--- a/translated/tech/20160218 Getting to Know Linux File Permissions	
+++ b/translated/tech/20160218 Getting to Know Linux File Permissions.md	
@@ -152,7 +152,7 @@ Linux文件权限从早期到现在没有太大变化,而且很可能以后也
 via: http://www.linux.com/learn/tutorials/885268-getting-to-know-linux-file-permissions
 
 作者:[Jack Wallen][a]
-译者:[译者ID](https://github.com/ynmlml)
+译者:[ynmlml](https://github.com/ynmlml)
 校对:[校对者ID](https://github.com/校对者ID)
 
 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出

From 95157c34d73b0fef9ddfb0ecc493c069a7556808 Mon Sep 17 00:00:00 2001
From: wxy 
Date: Sat, 26 Mar 2016 05:10:33 +0800
Subject: [PATCH 0567/1469] PUB:20160220 Former Kubuntu Head Unveils New KDE
 Project

@geekpi
---
 ...er Kubuntu Head Unveils New KDE Project.md | 33 +++++++++++++++++
 ...er Kubuntu Head Unveils New KDE Project.md | 35 -------------------
 2 files changed, 33 insertions(+), 35 deletions(-)
 create mode 100644 published/20160220 Former Kubuntu Head Unveils New KDE Project.md
 delete mode 100644 translated/tech/20160220 Former Kubuntu Head Unveils New KDE Project.md

diff --git a/published/20160220 Former Kubuntu Head Unveils New KDE Project.md b/published/20160220 Former Kubuntu Head Unveils New KDE Project.md
new file mode 100644
index 0000000000..2d57885d46
--- /dev/null
+++ b/published/20160220 Former Kubuntu Head Unveils New KDE Project.md	
@@ -0,0 +1,33 @@
+前 Kubuntu 领袖发起了新的 KDE 项目
+==============================================
+
+如果你经常阅读 Linux 和[开源新闻](http://itsfoss.com/category/news/)的话应该会对 Jonathan Riddell 这人很熟悉。它是 [Kubuntu](http://www.kubuntu.org/) 发行版的创建者及长期的开发领导。他由于敢于质询 Canonical 基金会对 Kubuntu 的资金筹集情况[而被 Ubuntu 的老板 Mark Shuttleworth 所驱逐](http://www.cio.com/article/2926838/linux/mark-shuttleworth-ubuntu-community-council-ask-kubuntu-developer-to-step-down-as-leader.html) (据我所知,Canonical 从来没有真正回答过他的这个关于财务的问题。)
+
+![](http://itsfoss.com/wp-content/uploads/2016/02/kde-neon-e1454448724263.png)
+
+*KDE neon 标志*
+
+在周日,Riddell [宣布](https://dot.kde.org/2016/01/30/fosdem-announcing-kde-neon)了一个新项目:[KDE neon](http://neon.kde.org.uk/)。根据 Riddell 的声明,“Neon 将会提供一个在最新的 KDE 软件一发布就可以获得的途径。”
+
+在看了声明和网站后,**neon 似乎主要是一个“快速的软件更新仓库”,它让 KDE 粉丝可以用上最新的软件**。除了等上数月来等到开发者在他们的仓库中发布新的 KDE 软件外,你将可以在软件一出来就得到它。
+
+KDE 的确在 [noen FAQ](http://neon.kde.org.uk/faq) 中声明过这不是一个 KDE 创建的发行版。事实上,他们说“KDE 相信与许多发行版协作是很重要的,因为它们每个都能给用户提供独特的价值和专长。这是 KDE 成千上万项目中的一个。”
+
+![](http://itsfoss.com/wp-content/uploads/2016/02/kde-neon-e1454448830870.jpg)
+
+然而,网站和公告显示 neon 会运行在 Ubuntu 15.10 中(直到有下个长期支持版本)并很快会有让我惊奇的情景。KDE 可能要让 Canonical 把此项目视作 Kubuntu 的竞争对手。如果他们发现 KDE neon 有前景,他们就能把它变成一个完整的发行版。网站和通告声称这是一个 KDE 孵化项目,因此未来可能会包含任何东西。
+
+neon 听上去对你有用么,或者你是否对你当前的发行版的 KDE 发布速度满意?你认为是否还有其他 KDE 发行版的空间(如果 KDE 决定朝这个方向进发)?让我在评论栏知道你们的想法。
+
+------------------------------------------------------------------------------
+
+via: http://itsfoss.com/kde-neon-unveiled/
+
+作者:[JOHN PAUL][a]
+译者:[geekpi](https://github.com/geekpi)
+校对:[wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:http://itsfoss.com/author/john/
+
diff --git a/translated/tech/20160220 Former Kubuntu Head Unveils New KDE Project.md b/translated/tech/20160220 Former Kubuntu Head Unveils New KDE Project.md
deleted file mode 100644
index 44dc94b9f0..0000000000
--- a/translated/tech/20160220 Former Kubuntu Head Unveils New KDE Project.md	
+++ /dev/null
@@ -1,35 +0,0 @@
-前Kubuntu领袖发起了新的KDE项目
-==============================================
-
-如果你阅读Linux和[开源新闻](http://itsfoss.com/category/news/)的话应该会对Jonathan Riddell这人很熟悉。它是[Kubuntu](http://www.kubuntu.org/)发行版的创建者及长期的开发领导。他由于敢于询问Canonical基金会对Kubuntu的资金筹集情况[而被Ubuntu的老板Mark Shuttleworth驱逐](http://www.cio.com/article/2926838/linux/mark-shuttleworth-ubuntu-community-council-ask-kubuntu-developer-to-step-down-as-leader.html) (据我所知,Canonical从来没有真正回答过他的这个关于财务的问题。)
-
-![](http://itsfoss.com/wp-content/uploads/2016/02/kde-neon-e1454448724263.png)
-
-## KDE neon 标志
-
-在周日,Riddell[宣布](https://dot.kde.org/2016/01/30/fosdem-announcing-kde-neon)了一个新项目:KDE neon](http://neon.kde.org.uk/)。根据Riddell的声明,“Neon将会在发布时提供最新的KDE软件。”
-
-在看了声明何网站后,**neon似乎主要是一个“快速的软件更新仓库”,它让KDE粉丝可以用上最新的软件**。除了等上数月来等到开发者在他们的仓库中发布新的KDE,你还可以从新闻中了解最新消息。
-
-KDE的确在[noen FAQ](http://neon.kde.org.uk/faq)中声明过这不是一个KDE创建的发行版。事实上,他们说“KDE相信与许多发行版协作是很重要的,因为它们每个都能给用户提供独特的价值和专长。这是KDE成千上万项目中的一个。”
-
-![](http://itsfoss.com/wp-content/uploads/2016/02/kde-neon-e1454448830870.jpg)
-
-然而,网站和公告显示neon会运行在Ubuntu 15.10中(直到有下个长期支持版本)并很快会有让我惊奇的镜像。KDE可能要让Canonical看到此项目是Kubuntu的竞争对手。如果他们有KDE neon的需求,他们将把它拆开作为一个完整的发行版。网站和通告声称这是一个KDE孵化项目,因此未来可能会包含任何东西。
-
-[KDE neon](http://neon.kde.org.uk/)
-
-neon听上去对你有用么,或者你是否对现在的KDE发行版的发布速度满意?你认为是否还有其他KDE发行版的空间(如果KDE决定超这个方向进发)?让我在评论栏知道你们的想法。
-
-------------------------------------------------------------------------------
-
-via: http://itsfoss.com/kde-neon-unveiled/
-
-作者:[JOHN PAUL][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/john/
-

From 87a63e99503f80c205ea13c578284f808559f5a4 Mon Sep 17 00:00:00 2001
From: Name1e5s <836401406@qq.com>
Date: Sat, 26 Mar 2016 09:37:54 +0800
Subject: [PATCH 0568/1469] name1e5s translating ...

---
 .../20160320 UbuntuBSD Brings Ubuntu And FreeBSD Together.md     | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sources/tech/20160320 UbuntuBSD Brings Ubuntu And FreeBSD Together.md b/sources/tech/20160320 UbuntuBSD Brings Ubuntu And FreeBSD Together.md
index cca9a74a90..0c07d3982e 100644
--- a/sources/tech/20160320 UbuntuBSD Brings Ubuntu And FreeBSD Together.md	
+++ b/sources/tech/20160320 UbuntuBSD Brings Ubuntu And FreeBSD Together.md	
@@ -1,3 +1,4 @@
+name1e5s translating...
 UbuntuBSD Brings Ubuntu And FreeBSD Together
 =================================================
 

From 4612965c57c32bd7bc1147606a0754f3c1e44029 Mon Sep 17 00:00:00 2001
From: Name1e5s <836401406@qq.com>
Date: Sat, 26 Mar 2016 10:44:13 +0800
Subject: [PATCH 0569/1469] [translated]UbuntuBSD Brings Ubuntu And FreeBSD
 Together

---
 ...uBSD Brings Ubuntu And FreeBSD Together.md | 67 -------------------
 ...uBSD Brings Ubuntu And FreeBSD Together.md | 66 ++++++++++++++++++
 2 files changed, 66 insertions(+), 67 deletions(-)
 delete mode 100644 sources/tech/20160320 UbuntuBSD Brings Ubuntu And FreeBSD Together.md
 create mode 100644 translated/tech/20160320 UbuntuBSD Brings Ubuntu And FreeBSD Together.md

diff --git a/sources/tech/20160320 UbuntuBSD Brings Ubuntu And FreeBSD Together.md b/sources/tech/20160320 UbuntuBSD Brings Ubuntu And FreeBSD Together.md
deleted file mode 100644
index 0c07d3982e..0000000000
--- a/sources/tech/20160320 UbuntuBSD Brings Ubuntu And FreeBSD Together.md	
+++ /dev/null
@@ -1,67 +0,0 @@
-name1e5s translating...
-UbuntuBSD Brings Ubuntu And FreeBSD Together
-=================================================
-
-![](http://itsfoss.com/wp-content/uploads/2016/03/UbuntuBSD.jpg)
-
-Move over [Linux][1], people. UbuntuBSD is bringing the experience of Ubuntu on the top of a FreeBSD kernel.
-
-Quite unsurprisingly, UbuntuBSD has taglined itself as ‘Unix for human beings’. If you remember, Ubuntu uses the tagline ‘Linux for human beings’ and have actually made it possible for a ‘normal human’ to use Linux in last 11 years.
-
-UbuntuBSD aims to do the same. Which is to make Unix accessible and usable by beginners, if I may put it that way. At least, this is what it aims.
-
-### What’s BSD? How is Linux different from it?
-
-If you are a beginner, then you should know the [difference between Unix and Linux][2].
-
-Way before Linux, Unix operating systems was desgined at [AT&T][3] by [Ken Thompson][4], [Denis Ricthie][5] and team. This was back in 1970. You might be surprised to know that Unix is a closed source, properitry operating system. AT&T licensed Unix to various thrid parties, both academic and commercial vendors.
-
-One of the academic vendors is University of California, Berkeley. The Unix operating system developed here is known as [BSD (Berkeley Software Distribution)][6]. One of the most popular open source derivative of BSD is [FreeBSD][7]. Another most popular closed source BSD derviative is Apple’s Mac OS X.
-
-In 1991, Finnish computer science student Linus Torvalds developed his own Unix clone from scratch. This is what we know today as Linux Kernel. Linux distributions add GUI system, GNU utilities (such as cp, mv, ls,date, bash etc), installation & management tools, GNU c/c++ Compilers and various applications on top of the Linux kernel.
-
-### UbuntuBSD is not the first of its kind
-
-When you have get the difference between Unix, Linux and FreeBSD, let me tell you that UbuntuBSD is not the first Linux-ish experience on the top of FreeBSD kernel.
-
-When Debian opted out for [systemd][8], this resulted in the birth of [Debian GNU/kFreeBSD][9] operating system. It is a port of Debian that run on the top of FreeBSD rather than the usual Linux kernel.
-
-UbuntuBSD is a similar implementation of Ubuntu on FreeBSD kernel.
-
-### UbuntuBSD Beta codenamed Escape From SystemD
-
-The first beta release of UbuntuBSD is out and it has been codenamed “Escape from SystemD”. It is based on Ubuntu 15.10 and FreeBSD kernel 10.1.
-
-It ships with [Xfce][10] desktop and is designed for both desktop and server. [ZFS][11] support is included as well. It has text based installer.
-
-### Wanna try?
-
-I won’t suggest that everyone start trying it in excitement. It is still under development and the installer is text based. If you are confident enough, go ahead and download it from the link below but beginners, please stay out, at least for now:
-
-[UbuntuBSD][12]
-
-What do you think of UbuntuBSD?
-
---------------------------------------------------------------------------------
-
-via: http://itsfoss.com/ubuntubsd-ubuntu-freebsd/
-
-作者:[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/tag/linux/
-[2]: http://www.cyberciti.biz/faq/what-is-the-difference-between-linux-and-unix/
-[3]: https://en.wikipedia.org/wiki/AT%26T
-[4]: https://en.wikipedia.org/wiki/Ken_Thompson
-[5]: https://en.wikipedia.org/wiki/Dennis_Ritchie
-[6]: http://www.bsd.org/
-[7]: https://www.freebsd.org/
-[8]: https://www.freedesktop.org/wiki/Software/systemd/
-[9]: https://www.debian.org/ports/kfreebsd-gnu/
-[10]: http://www.xfce.org/
-[11]: https://en.wikipedia.org/wiki/ZFS
-[12]: https://sourceforge.net/projects/ubuntubsd/
diff --git a/translated/tech/20160320 UbuntuBSD Brings Ubuntu And FreeBSD Together.md b/translated/tech/20160320 UbuntuBSD Brings Ubuntu And FreeBSD Together.md
new file mode 100644
index 0000000000..19b1118194
--- /dev/null
+++ b/translated/tech/20160320 UbuntuBSD Brings Ubuntu And FreeBSD Together.md	
@@ -0,0 +1,66 @@
+将 Ubuntu 和 FreeBSD 融合在一起的发行版 :UbuntuBSD
+========================================================
+
+![](http://itsfoss.com/wp-content/uploads/2016/03/UbuntuBSD.jpg)
+
+不止是在 [Linux][1] 的内核上面你才能体验到 Ubuntu 的快捷方便,伙计们。UbuntuBSD 可以让你在 FreeBSD 的内核上面也能体验到那种方便快捷。
+
+UbuntuBSD 称自己是‘Unix for human beings’,这一点也不人惊讶。如过你能想起来的话,Ubuntu 使用的标语是‘Linux for human beings’并且在过去的 11 年里它确实让一个‘正常人’有可能用上 Linux。
+
+UbuntuBSD 有着同样的想法。它想让新手能够接触到 Unix ,以及能使用它,如果我能这样说的话。至少,这就是它的目标。
+
+### 什么是BSD ? 它和 Linux 有哪些不同? ###
+
+如果你是新手,那么你需要知道 [Unix和Linux的区别][2].
+
+在 Linux 出现之前,Unix 由 [AT&T][3] 的  [Ken Thompson][4], [Denis Ricthie][5] 以及他们的团队设计。这是在可以算作上古时期的 1970 发生的事。当你知道 Unix 是一个闭源的,有产权的操作系统时你可能会感到惊讶。AT&T  给了很多第三方许可,无论是学术机构还是企业。
+
+美国加州大学伯克利分校是其中一个拿到许可的学术机构。在那里开发的 Unix 系统叫做  [BSD (Berkeley Software Distribution)][6]。BSD 的最出名的开源分支是  [FreeBSD][7],另一个最流行的闭源分支是苹果的 Mac OS X。
+
+在 1991 年。芬兰的计算机系大学生 Linus Torvalds 从头写了自己的 Unix 系统的复制品。这就是我们今天熟知的 Linux 内核。Linux 的发行版在内核的基础上添加了图形界面,GNU 的那一套(cp, mv, ls,date, bash 什么的),安装/管理工具,GNU C/C++ 编译器以及很多应用。
+
+### UbuntuBSD 不是这种发行版的开端
+
+在你知道了 Linux,Unix,FreeBSD 之间的区别之后。我要告诉你的是 UbuntuBSD 不是第一个要在 FreeBSD 内核上作出类似 Linux 的感觉的发行版。
+
+当 Debian 选择使用 [systemd][8] 之后,[Debian GNU/kFreeBSD][9]诞生了。它使用的不是通常的Linux内核,而是 Debian 在 FreeBSD 内核上的移植。
+
+与Debian GNU/kFreeBSD 类似,UbuntuBSD 是 Ubuntu 在 FreeBSD 内核上的移植。
+
+### UbuntuBSD Beta 版代号: Escape From SystemD 
+
+UbuntuBSD 的第一个版本已经发布,代号为“Escape From SystemD ”。它基于 Ubuntu 15.10 和 FreeBSD 10.1.
+
+它的默认桌面环境为 [Xfce][10] ,桌面以及服务器均可使用。 对于 [ZFS][11] 的支持也包含在这个版本中。开发者还提供了一个文本界面的安装器。
+
+### 想试试?
+
+我不建议任何人马上就去高兴的尝试这个系统。它仍在开发并且安装器还是文本界面的。如果你足够自信的话,直接去下载体验吧。但是如果你是新手的话,请等一段时间,至少不要现在就去尝试:
+
+[UbuntuBSD][12]
+
+你认为 UbuntuBSD 怎么样? 兹瓷不兹瓷它?
+
+--------------------------------------------------------------------------------
+
+via: http://itsfoss.com/ubuntubsd-ubuntu-freebsd/
+
+作者:[ABHISHEK][a]
+译者:[name1e5s](https://github.com/name1e5s)
+校对:[校对者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/tag/linux/
+[2]: http://www.cyberciti.biz/faq/what-is-the-difference-between-linux-and-unix/
+[3]: https://en.wikipedia.org/wiki/AT%26T
+[4]: https://en.wikipedia.org/wiki/Ken_Thompson
+[5]: https://en.wikipedia.org/wiki/Dennis_Ritchie
+[6]: http://www.bsd.org/
+[7]: https://www.freebsd.org/
+[8]: https://www.freedesktop.org/wiki/Software/systemd/
+[9]: https://www.debian.org/ports/kfreebsd-gnu/
+[10]: http://www.xfce.org/
+[11]: https://en.wikipedia.org/wiki/ZFS
+[12]: https://sourceforge.net/projects/ubuntubsd/

From 0ea8507d5d43b9aa9599fabea594fd5cbc13677d Mon Sep 17 00:00:00 2001
From: Ray 
Date: Sun, 27 Mar 2016 16:12:06 +0800
Subject: [PATCH 0570/1469] =?UTF-8?q?WingCuengRay=E7=BF=BB=E8=AF=91?=
 =?UTF-8?q?=E4=B8=AD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 ... Startup Process and Services SysVinit Systemd and Upstart.md | 1 +
 1 file changed, 1 insertion(+)

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 2a822e8a45..ecd47794b0 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,4 @@
+WingCuengRay翻译中
 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.

From 49a468e9ce12458be05d2138e84fb835fbe24631 Mon Sep 17 00:00:00 2001
From: wxy 
Date: Mon, 28 Mar 2016 05:54:24 +0800
Subject: [PATCH 0571/1469] PUB:Part 1 - LFCS--How to use GNU 'sed' Command to
 Create Edit and Manipulate files in Linux.md
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

@Xuanwo 翻译的很细致
---
 ...eate Edit and Manipulate files in Linux.md | 226 ++++++++++++++++++
 ...eate Edit and Manipulate files in Linux.md | 220 -----------------
 2 files changed, 226 insertions(+), 220 deletions(-)
 create mode 100644 published/LFCS/Part 1 - LFCS--How to use GNU 'sed' Command to Create Edit and Manipulate files in Linux.md
 delete mode 100644 translated/tech/LFCS/Part 1 - LFCS--How to use GNU 'sed' Command to Create Edit and Manipulate files in Linux.md

diff --git a/published/LFCS/Part 1 - LFCS--How to use GNU 'sed' Command to Create Edit and Manipulate files in Linux.md b/published/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..dd19d6dc69
--- /dev/null
+++ b/published/LFCS/Part 1 - LFCS--How to use GNU 'sed' Command to Create Edit and Manipulate files in Linux.md	
@@ -0,0 +1,226 @@
+LFCS 系列第一讲:如何在 Linux 上使用 GNU sed 等命令来创建、编辑和操作文件
+================================================================================
+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 基金会认证系统管理员——第一讲*
+
+请观看下面关于 Linux 基金会认证计划的演示:
+
+
+
+该系列将命名为《LFCS 系列第一讲》至《LFCS 系列第十讲》并覆盖关于 Ubuntu、CentOS 以及 openSUSE 的下列话题。
+
+- 第一讲:如何在 Linux 上使用 GNU sed 等命令来创建、编辑和操作文件
+- 第二讲:如何安装和使用 vi/m 全功能文字编辑器
+- 第三讲:归档文件/目录并在文件系统中寻找文件
+- 第四讲:为存储设备分区,格式化文件系统和配置交换分区
+- 第五讲:在 Linux 中挂载/卸载本地和网络(Samba & NFS)文件系统
+- 第六讲:组合分区作为 RAID 设备——创建&管理系统备份
+- 第七讲:管理系统启动进程和服务(使用 SysVinit, Systemd 和 Upstart)
+- 第八讲:管理用户和组,文件权限和属性以及启用账户的 sudo 权限
+- 第九讲:用 Yum,RPM,Apt,Dpkg,Aptitude,Zypper 进行 Linux 软件包管理
+- 第十讲:学习简单的 Shell 脚本编程和文件系统故障排除
+
+	重要提示:由于自 2016/2 开始 LFCS 认证要求有所变化,我们增加发布了下列必需的内容。要准备这个考试,推荐你也看看我们的 LFCE 系列。
+
+- 第十一讲:怎样使用 vgcreate、lvcreate 和 lvextend  命令创建和管理 LVM
+- 第十二讲:怎样安装帮助文档和工具来探索 Linux
+- 第十三讲:怎样配置和排错 GRUB
+
+本文是覆盖这个参加 LFCS 认证考试的所必需的范围和技能的十三个教程的第一讲。话说了那么多,快打开你的终端,让我们开始吧!
+
+### 处理 Linux 中的文本流 ###
+
+Linux 将程序中的输入和输出当成字符流或者字符序列。在开始理解重定向和管道之前,我们必须先了解三种最重要的I/O(Input and Output,输入和输出)流,事实上,它们都是特殊的文件(根据 UNIX 和 Linux 中的约定,数据流和外围设备(设备文件)也被视为普通文件)。
+
+在 \> (重定向操作符) 和 | (管道操作符)之间的区别是:前者将命令与文件相连接,而后者将命令的输出和另一个命令相连接。
+
+    # command > file
+    # command1 | command2
+
+由于重定向操作符会静默地创建或覆盖文件,我们必须特别小心谨慎地使用它,并且永远不要把它和管道混淆起来。在 Linux 和 UNIX 系统上管道的优势是:第一个命令的输出不会写入一个文件而是直接被第二个命令读取。
+
+在下面的操作练习中,我们将会使用这首诗——《A happy child》(作者未知)
+
+![cat command](http://www.tecmint.com/wp-content/uploads/2014/10/cat-command.png)
+
+*cat 命令样例*
+
+#### 使用 sed ####
+
+sed 是流编辑器(stream editor)的缩写。为那些不懂术语的人额外解释一下,流编辑器是用来在一个输入流(文件或者管道中的输入)执行基本的文本转换的工具。
+
+sed 最基本的用法是字符替换。我们将通过把每个出现的小写 y 改写为大写 Y 并且将输出重定向到 ahappychild2.txt 开始。g 标志表示 sed 应该替换文件每一行中所有应当替换的实例。如果这个标志省略了,sed 将会只替换每一行中第一次出现的实例。
+
+**基本语法:**
+
+    # sed 's/term/replacement/flag' file
+
+**我们的样例:**
+
+    # sed 's/y/Y/g' ahappychild.txt > ahappychild2.txt
+
+![sed command](http://www.tecmint.com/wp-content/uploads/2014/10/sed-command.png)
+
+*sed 命令样例*
+
+如果你要在替换文本中搜索或者替换特殊字符(如 /,\,&),你需要使用反斜杠对它进行转义。
+
+例如,我们要用一个符号来替换一个文字,与此同时我们将把一行最开始出现的第一个 I 替换为 You。
+
+    # 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 替换字符串*
+
+在上面的命令中,众所周知 \^(插入符号)是正则表达式中用来表示一行开头的符号。
+
+正如你所看到的,我们可以通过使用分号分隔以及用括号包裹来把两个或者更多的替换命令(并在它们中使用正则表达式)连接起来。
+
+另一种 sed 的用法是显示或者删除文件中选中的一部分。在下面的样例中,将会显示 /var/log/messages 中从6月8日开始的头五行。
+
+    # sed -n '/^Jun  8/ p' /var/log/messages | sed -n 1,5p
+
+请注意,在默认的情况下,sed 会打印每一行。我们可以使用 -n 选项来覆盖这一行为并且告诉 sed 只需要打印(用 p来表示)文件(或管道)中匹配的部分(第一个命令中指定以“Jun  8” 开头的行,第二个命令中指定一到五行)。
+
+最后,可能有用的技巧是当检查脚本或者配置文件的时候可以保留文件本身并且删除注释。下面的单行 sed 命令删除(d)空行或者是开头为`#`的行(| 字符对两个正则表达式进行布尔 OR 操作)。
+
+    # sed '/^#\|^$/d' apache2.conf
+
+![sed match string](http://www.tecmint.com/wp-content/uploads/2014/10/sed-match-string.png)
+
+*sed 匹配字符串*
+
+#### uniq 命令 ####
+
+uniq 命令允许我们返回或者删除文件中重复的行,默认写到标准输出。我们必须注意到,除非两个重复的行相邻,否则uniq 命令不会删除他们。因此,uniq 经常和一个前置的 sort 命令(一种用来对文本行进行排序的算法)搭配使用。默认情况下,sort 使用第一个字段(用空格分隔)作为关键字段。要指定一个不同的关键字段,我们需要使用 -k 选项。
+
+**样例**
+
+du –sch /path/to/directory/* 命令将会以人类可读的格式返回在指定目录下每一个子文件夹和文件的磁盘空间使用情况(也会显示每个目录总体的情况),而且不是按照大小输出,而是按照子文件夹和文件的名称。我们可以使用下面的命令来让它通过大小排序。
+
+    # du -sch /var/* | sort -h
+
+![sort command](http://www.tecmint.com/wp-content/uploads/2014/10/sort-command.jpg)
+
+*sort 命令样例*
+
+你可以通过使用下面的命令告诉 uniq 比较每一行的前6个字符(-w 6)(这里是指定的日期)来统计日志事件的个数,而且在每一行的开头输出出现的次数(-c)。
+
+
+    # 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)
+
+*文件中的统计数字*
+
+最后,你可以组合使用 sort 和 uniq 命令(通常如此)。看看下面文件中捐助者、捐助日期和金额的列表。假设我们想知道有多少个捐助者。我们可以使用下面的命令来分隔第一字段(字段由冒号分隔),按名称排序并且删除重复的行。
+
+    # 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)
+
+*寻找文件中不重复的记录*
+
+- 也可阅读: [13个“cat”命令样例][1]
+
+#### grep 命令 ####
+
+grep 在文件(或命令输出)中搜索指定正则表达式,并且在标准输出中输出匹配的行。
+
+**样例**
+
+显示文件 /etc/passwd 中用户 gacanepa 的信息,忽略大小写。
+
+    # grep -i gacanepa /etc/passwd
+
+![grep Command](http://www.tecmint.com/wp-content/uploads/2014/10/grep-command.jpg)
+
+*grep 命令样例*
+
+显示 /etc 文件夹下所有 rc 开头并跟随任意数字的内容。
+
+    # 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)
+
+*使用 grep 列出内容*
+
+- 也可阅读: [12个“grep”命令样例][2]
+
+#### tr 命令使用技巧 ####
+
+tr 命令可以用来从标准输入中转换(改变)或者删除字符,并将结果写入到标准输出中。
+
+**样例**
+
+把 sortuniq.txt 文件中所有的小写改为大写。
+
+    # cat sortuniq.txt | tr [:lower:] [:upper:]
+
+![Sort Strings in File](http://www.tecmint.com/wp-content/uploads/2014/10/sort-strings.jpg)
+
+*排序文件中的字符串*
+
+压缩`ls –l`输出中的分隔符为一个空格。
+
+    # ls -l | tr -s ' '
+
+![Squeeze Delimiter](http://www.tecmint.com/wp-content/uploads/2014/10/squeeze-delimeter.jpg)
+
+*压缩分隔符*
+
+#### cut 命令使用方法 ####
+
+cut 命令可以基于字节(-b选项)、字符(-c)或者字段(-f)提取部分输入(从标准输入或者文件中)并且将结果输出到标准输出。在最后一种情况下(基于字段),默认的字段分隔符是一个制表符,但可以由 -d 选项来指定不同的分隔符。
+
+**样例**
+
+从 /etc/passwd 中提取用户账户和他们被分配的默认 shell(-d 选项允许我们指定分界符,-f 选项指定那些字段将被提取)。
+
+    # cat /etc/passwd | cut -d: -f1,7
+
+![Extract User Accounts](http://www.tecmint.com/wp-content/uploads/2014/10/extract-user-accounts.jpg)
+
+*提取用户账户*
+
+将以上命令结合起来,我们将使用 last 命令的输出中第一和第三个非空文件创建一个文本流。我们将使用 grep 作为第一过滤器来检查用户 gacanepa 的会话,然后将分隔符压缩至一个空格(tr -s ' ')。下一步,我们将使用 cut 来提取第一和第三个字段,最后使用第二个字段(本样例中,指的是IP地址)来排序之后,再用 uniq 去重。
+
+    # 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 命令样例*
+
+上面的命令显示了如何将多个命令和管道结合起来,以便根据我们的要求得到过滤后的数据。你也可以逐步地使用它以帮助你理解输出是如何从一个命令传输到下一个命令的(顺便说一句,这是一个非常好的学习经验!)
+
+### 总结 ###
+
+尽管这个例子(以及在当前教程中的其他实例)第一眼看上去可能不是非常有用,但是他们是体验在 Linux 命令行中创建、编辑和操作文件的一个非常好的开始。请随时留下你的问题和意见——不胜感激!
+
+#### 参考链接 ####
+
+- [关于 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]
+译者:[Xuanwo](https://github.com/Xuanwo)
+校对:[wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:http://www.tecmint.com/author/gacanepa/
+[1]:https://linux.cn/article-2336-1.html
+[2]:https://linux.cn/article-2250-1.html
+[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
+[6]:http://www.tecmint.com/installing-network-services-and-configuring-services-at-system-boot/
\ No newline at end of file
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
deleted file mode 100644
index 79e263d7e0..0000000000
--- a/translated/tech/LFCS/Part 1 - LFCS--How to use GNU 'sed' Command to Create Edit and Manipulate files in Linux.md	
+++ /dev/null
@@ -1,220 +0,0 @@
-Translating by Xuanwo
-
-LFCS系列第一讲:如何在Linux上使用GNU'sed'命令来创建、编辑和操作文件
-================================================================================
-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基金会认证系统管理员——第一讲
-
-请观看下面关于Linux基金会认证计划的演示:
-
-
-
-该系列将命名为《LFCS系列第一讲》至《LFCS系列第十讲》并覆盖关于Ubuntu,CentOS以及openSUSE的下列话题。
-
-- 第一讲:如何在Linux上使用GNU'sed'命令来创建、编辑和操作文件
-- 第二讲:如何安装和使用vi/m全功能文字编辑器
-- 第三讲:归档文件/目录和在文件系统中寻找文件
-- 第四讲:为存储设备分区,格式化文件系统和配置交换分区
-- 第五讲:在Linux中挂载/卸载本地和网络(Samba & NFS)文件系统
-- 第六讲:组合分区作为RAID设备——创建&管理系统备份
-- 第七讲:管理系统启动进程和服务(使用SysVinit, Systemd 和 Upstart)
-- 第八讲:管理用户和组,文件权限和属性以及启用账户的sudo权限
-- 第九讲:Linux包管理与Yum,RPM,Apt,Dpkg,Aptitude,Zypper
-- 第十讲:学习简单的Shell脚本和文件系统故障排除
-
-本文是覆盖这个参加LFCS认证考试的所必需的范围和能力的十个教程的第一讲。话说了那么多,快打开你的终端,让我们开始吧!
-
-### 处理Linux中的文本流 ###
-
-Linux将程序中的输入和输出当成字符流或者字符序列。在开始理解重定向和管道之前,我们必须先了解三种最重要的I/O(Input and Output,输入和输出)流,事实上,它们都是特殊的文件(根据UNIX和Linux中的约定,数据流和外围设备或者设备文件也被视为普通文件)。
-
-> (重定向操作符) 和 | (管道操作符)之间的区别是:前者将命令与文件相连接,而后者将命令的输出和另一个命令相连接。
-
-    # command > file
-    # command1 | command2
-
-由于重定向操作符静默创建或覆盖文件,我们必须特别小心谨慎地使用它,并且永远不要把它和管道混淆起来。在Linux和UNIX系统上管道的优势是:第一个命令的输出不会写入一个文件而是直接被第二个命令读取。
-
-在下面的操作练习中,我们将会使用这首诗——《A happy child》(匿名作者)
-
-![cat command](http://www.tecmint.com/wp-content/uploads/2014/10/cat-command.png)
-
-cat 命令样例
-
-#### 使用 sed ####
-
-sed是流编辑器(stream editor)的缩写。为那些不懂术语的人额外解释一下,流编辑器是用来在一个输入流(文件或者管道中的输入)执行基本的文本转换的工具。
-
-sed最基本的用法是字符替换。我们将通过把每个出现的小写y改写为大写Y并且将输出重定向到ahappychild2.txt开始。g标志表示sed应该替换文件每一行中所有应当替换的实例。如果这个标志省略了,sed将会只替换每一行中第一次出现的实例。
-
-**基本语法:**
-
-    # sed ‘s/term/replacement/flag’ file
-
-**我们的样例:**
-
-    # sed ‘s/y/Y/g’ ahappychild.txt > ahappychild2.txt
-
-![sed command](http://www.tecmint.com/wp-content/uploads/2014/10/sed-command.png)
-
-sed 命令样例
-
-如果你要在替换文本中搜索或者替换特殊字符(如/,\,&),你需要使用反斜杠对它进行转义。
-
-例如,我们将会用一个符号来替换一个文字。与此同时,我们将把一行最开始出现的第一个I替换为You。
-
-    # 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 替换字符串
-
-在上面的命令中,^(插入符号)是众所周知用来表示一行开头的正则表达式。
-
-正如你所看到的,我们可以通过使用分号分隔以及用括号包裹来把两个或者更多的替换命令(并在他们中使用正则表达式)链接起来。
-
-另一种sed的用法是显示或者删除文件中选中的一部分。在下面的样例中,将会显示/var/log/messages中从6月8日开始的头五行。
-
-    # sed -n '/^Jun  8/ p' /var/log/messages | sed -n 1,5p
-
-请注意,在默认的情况下,sed会打印每一行。我们可以使用-n选项来覆盖这一行为并且告诉sed只需要打印(用p来表示)文件(或管道)中匹配的部分(第一种情况下行开头的第一个6月8日以及第二种情况下的一到五行*此处翻译欠妥,需要修正*)。
-
-最后,可能有用的技巧是当检查脚本或者配置文件的时候可以保留文件本身并且删除注释。下面的单行sed命令删除(d)空行或者是开头为`#`的行(|字符返回两个正则表达式之间的布尔值)。
-
-    # sed '/^#\|^$/d' apache2.conf
-
-![sed match string](http://www.tecmint.com/wp-content/uploads/2014/10/sed-match-string.png)
-
-sed 匹配字符串
-
-#### uniq C命令 ####
-
-uniq命令允许我们返回或者删除文件中重复的行,默认写入标准输出。我们必须注意到,除非两个重复的行相邻,否则uniq命令不会删除他们。因此,uniq经常和前序排序(此处翻译欠妥)(一种用来对文本行进行排序的算法)搭配使用。默认情况下,排序使用第一个字段(用空格分隔)作为关键字段。要指定一个不同的关键字段,我们需要使用-k选项。
-
-**样例**
-
-du –sch /path/to/directory/* 命令将会以人类可读的格式返回在指定目录下每一个子文件夹和文件的磁盘空间使用情况(也会显示每个目录总体的情况),而且不是按照大小输出,而是按照子文件夹和文件的名称。我们可以使用下面的命令来让它通过大小排序。
-
-    # du -sch /var/* | sort –h
-
-![sort command](http://www.tecmint.com/wp-content/uploads/2014/10/sort-command.jpg)
-
-sort 命令样例
-
-你可以通过使用下面的命令告诉uniq比较每一行的前6个字符(-w 6)(指定了不同的日期)来统计日志事件的个数,而且在每一行的开头输出出现的次数(-c)。
-
-
-    # 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)
-
-统计文件中数字
-
-最后,你可以组合使用sort和uniq命令(通常如此)。考虑下面文件中捐助者,捐助日期和金额的列表。假设我们想知道有多少个捐助者。我们可以使用下面的命令来分隔第一字段(字段由冒号分隔),按名称排序并且删除重复的行。
-
-    # 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)
-
-寻找文件中不重复的记录
-
-- 也可阅读: [13个“cat”命令样例][1]
-
-#### grep 命令 ####
-
-grep在文件(或命令输出)中搜索指定正则表达式并且在标准输出中输出匹配的行。
-
-**样例**
-
-显示文件/etc/passwd中用户gacanepa的信息,忽略大小写。
-
-    # grep -i gacanepa /etc/passwd
-
-![grep Command](http://www.tecmint.com/wp-content/uploads/2014/10/grep-command.jpg)
-
-grep 命令样例
-
-显示/etc文件夹下所有rc开头并跟随任意数字的内容。
-
-    # 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)
-
-使用grep列出内容
-
-- 也可阅读: [12个“grep”命令样例][2]
-
-#### tr 命令使用技巧 ####
-
-tr命令可以用来从标准输入中翻译(改变)或者删除字符并将结果写入到标准输出中。
-
-**样例**
-
-把sortuniq.txt文件中所有的小写改为大写。
-
-    # cat sortuniq.txt | tr [:lower:] [:upper:]
-
-![Sort Strings in File](http://www.tecmint.com/wp-content/uploads/2014/10/sort-strings.jpg)
-
-排序文件中的字符串
-
-压缩`ls –l`输出中的定界符至一个空格。
-    # ls -l | tr -s ' '
-
-![Squeeze Delimiter](http://www.tecmint.com/wp-content/uploads/2014/10/squeeze-delimeter.jpg)
-
-压缩分隔符
-
-#### cut 命令使用方法 ####
-
-cut命令可以基于字节数(-b选项),字符(-c)或者字段(-f)提取部分输入(从标准输入或者文件中)并且将结果输出到标准输出。在最后一种情况下(基于字段),默认的字段分隔符是一个tab,但不同的分隔符可以由-d选项来指定。
-
-**样例**
-
-从/etc/passwd中提取用户账户和他们被分配的默认shell(-d选项允许我们指定分界符,-f选项指定那些字段将被提取)。
-
-    # cat /etc/passwd | cut -d: -f1,7
-
-![Extract User Accounts](http://www.tecmint.com/wp-content/uploads/2014/10/extract-user-accounts.jpg)
-
-提取用户账户
-
-总结一下,我们将使用最后一个命令的输出中第一和第三个非空文件创建一个文本流。我们将使用grep作为第一过滤器来检查用户gacanepa的会话,然后将分隔符压缩至一个空格(tr -s ' ')。下一步,我们将使用cut来提取第一和第三个字段,最后使用第二个字段(本样例中,指的是IP地址)来排序之后再用uniq去重。
-
-    # 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 命令样例
-
-上面的命令显示了如何将多个命令和管道结合起来以便根据我们的愿望得到过滤后的数据。你也可以逐步地使用它以帮助你理解输出是如何从一个命令传输到下一个命令的(顺便说一句,这是一个非常好的学习经验!)
-
-### 总结 ###
-
-尽管这个例子(以及在当前教程中的其他实例)第一眼看上去可能不是非常有用,但是他们是体验在Linux命令行中创建,编辑和操作文件的一个非常好的开始。请随时留下你的问题和意见——不胜感激!
-
-#### 参考链接 ####
-
-- [关于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]
-译者:[Xuanwo](https://github.com/Xuanwo)
-校对:[校对者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

From d23e599510f4a3bcf4f7edc8ced1f65f942410ff Mon Sep 17 00:00:00 2001
From: wxy 
Date: Mon, 28 Mar 2016 09:49:42 +0800
Subject: [PATCH 0572/1469] PUB:20151109 Install Android On BQ Aquaris Ubuntu
 Phone In Linux

@zpl1025
---
 ...oid On BQ Aquaris Ubuntu Phone In Linux.md | 20 +++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
 rename {translated/tech => published}/20151109 Install Android On BQ Aquaris Ubuntu Phone In Linux.md (83%)

diff --git a/translated/tech/20151109 Install Android On BQ Aquaris Ubuntu Phone In Linux.md b/published/20151109 Install Android On BQ Aquaris Ubuntu Phone In Linux.md
similarity index 83%
rename from translated/tech/20151109 Install Android On BQ Aquaris Ubuntu Phone In Linux.md
rename to published/20151109 Install Android On BQ Aquaris Ubuntu Phone In Linux.md
index 73397819cd..59946de678 100644
--- a/translated/tech/20151109 Install Android On BQ Aquaris Ubuntu Phone In Linux.md	
+++ b/published/20151109 Install Android On BQ Aquaris Ubuntu Phone In Linux.md	
@@ -4,7 +4,7 @@
 
 如果你正好拥有全球第一支运行 Ubuntu 的手机并且希望将 **BQ Aquaris E4.5 自带的 Ubuntu 系统换成 Android **,那这篇文章能帮你点小忙。
 
-有一万种理由来解释为什么要将 Ubuntu 换成主流 Android OS。其中最主要的一个,就是这个系统本身仍然处于非常早期的阶段,针对的目标用户仍然是开发者和爱好者。不管你的理由是什么,要谢谢 bq 提供的工具,让我们能非常轻松地在 BQ Aquaris 上安装 Android OS。
+有一万种理由来解释为什么要将 Ubuntu 换成主流 Android OS。其中最主要的一个,就是这个系统本身仍然处于非常早期的阶段,针对的目标用户仍然是开发者和爱好者。不管你的理由是什么,要谢谢 BQ 提供的工具,让我们能非常轻松地在 BQ Aquaris 上安装 Android OS。
 
 下面让我们一起看下在 BQ Aquaris 上安装 Android 需要做哪些事情。
 
@@ -20,7 +20,7 @@
 
 #### 第一步:下载 Android 固件 ####
 
-首先是下载可以在 BQ Aquaris E4.5 上运行的 Android 固件。幸运的是我们可以在 bq 的技术支持网站找到。可以从下面的链接直接下载,差不多 650 MB:
+首先是下载可以在 BQ Aquaris E4.5 上运行的 Android 固件。幸运的是我们可以在 BQ 的技术支持网站找到。可以从下面的链接直接下载,差不多 650 MB:
 
 - [下载为 BQ Aquaris E4.5 制作的 Android][1]
 
@@ -28,21 +28,21 @@
 
 我建议去[ bq 的技术支持网站][2]下载最新的固件。
 
-下载完成后解压。在解压后的目录里,找到一个名字是 **MT6582_Android_scatter.txt** 的文件。后面将要用到它。
+下载完成后解压。在解压后的目录里,找到一个名字是 **MT6582\_Android\_scatter.txt** 的文件。后面将要用到它。
 
 #### 第二步:下载刷机工具 ####
 
-bq 已经提供了自己的刷机工具,Herramienta MTK Flash Tool,可以轻松地给设备安装 Andriod 或者 Ubuntu 系统。你可以从下面的链接下载工具:
+BQ 已经提供了自己的刷机工具,Herramienta MTK Flash Tool,可以轻松地给设备安装 Andriod 或者 Ubuntu 系统。你可以从下面的链接下载工具:
 
 - [下载 MTK Flash Tool][3]
 
-考虑到刷机工具在以后可能会升级,你总是可以从[bq 技术支持网站][4]上找到最新的版本。
+考虑到刷机工具在以后可能会升级,你总是可以从 [BQ 技术支持网站][4]上找到最新的版本。
 
 下载完后解压。之后应该可以在目录里找到一个叫 **flash_tool** 的可执行文件。我们稍后会用到。
 
 #### 第三步:移除冲突的软件包(可选) ####
 
-如果你正在用最新版本的 Ubuntu 或 基于 Ubuntu 的 Linux 发行版,稍后可能会碰到 “BROM ERROR : S_UNDEFINED_ERROR (1001)” 错误。
+如果你正在用最新版本的 Ubuntu 或 基于 Ubuntu 的 Linux 发行版,稍后可能会碰到 “BROM ERROR : S\_UNDEFINED\_ERROR (1001)” 错误。
 
 要避免这个错误,你需要卸载有冲突的软件包。可以使用下面的命令:
 
@@ -52,7 +52,7 @@ bq 已经提供了自己的刷机工具,Herramienta MTK Flash Tool,可以轻
 
     sudo service udev restart
 
-检查一下内核模块 cdc_acm 可能存在的边际效应,运行下面的命令:
+检查一下内核模块 cdc_acm 可能存在的副作用,运行下面的命令:
 
     lsmod | grep cdc_acm
 
@@ -76,7 +76,7 @@ bq 已经提供了自己的刷机工具,Herramienta MTK Flash Tool,可以轻
 
 ![Replace Ubuntu with Android](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/11/Install-Android-bq-aquaris-Ubuntu-1.jpeg)
 
-还记得之前第一步里提到的 **MT6582_Android_scatter.txt** 文件吗?这个文本文件就在你第一步中下载的 Android 固件解压后的目录里。点击 Scatter-loading(上图中)然后选中 MT6582_Android_scatter.txt 文件。
+还记得之前第一步里提到的 **MT6582\_Android\_scatter.txt** 文件吗?这个文本文件就在你第一步中下载的 Android 固件解压后的目录里。点击 Scatter-loading(上图中)然后选中 MT6582\_Android\_scatter.txt 文件。
 
 之后,你将看到类似下面图片里的一些绿色线条:
 
@@ -104,7 +104,7 @@ bq 已经提供了自己的刷机工具,Herramienta MTK Flash Tool,可以轻
 
 ### 总结 ###
 
-要感谢厂商提供的工具,让我们可以轻松地 **在 bq Ubuntu 手机上刷 Android**。当然,你可以使用相同的步骤将 Android 替换回 Ubuntu。只是下载的时候选 Ubuntu 固件而不是 Android。
+要感谢厂商提供的工具,让我们可以轻松地 **在  BQ Ubuntu 手机上刷 Android**。当然,你可以使用相同的步骤将 Android 替换回 Ubuntu。只是下载的时候选 Ubuntu 固件而不是 Android。
 
 希望这篇文章可以帮你将你的 bq 手机上的 Ubuntu 刷成 Android。如果有什么问题或建议,可以在下面留言区里讨论。
 
@@ -114,7 +114,7 @@ via: http://itsfoss.com/install-android-ubuntu-phone/
 
 作者:[Abhishek][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 15f4d736e0c18c1a7b92edb4c35263b996e4b243 Mon Sep 17 00:00:00 2001
From: wxy 
Date: Mon, 28 Mar 2016 09:58:39 +0800
Subject: [PATCH 0573/1469] PUB:20151123 How to Install Cockpit in Fedora or
 CentOS or RHEL or Arch Linux

@ictlyh
---
 ... Fedora or CentOS or RHEL or Arch Linux.md | 148 ------------------
 1 file changed, 148 deletions(-)
 delete mode 100644 translated/tech/20151123 How to Install Cockpit in Fedora or CentOS or RHEL or Arch Linux.md

diff --git a/translated/tech/20151123 How to Install Cockpit in Fedora or CentOS or RHEL or Arch Linux.md b/translated/tech/20151123 How to Install Cockpit in Fedora or CentOS or RHEL or Arch Linux.md
deleted file mode 100644
index 38a89dcbc2..0000000000
--- a/translated/tech/20151123 How to Install Cockpit in Fedora or CentOS or RHEL or Arch Linux.md	
+++ /dev/null
@@ -1,148 +0,0 @@
-如何在 Fedora/CentOS/RHEL 或 Arch Linux 上安装 Cockpit
-================================================================================
-Cockpit 是一个免费开源的服务器管理软件,它使得我们可以通过它好看的 web 前端界面轻松地管理我们的 GNU/Linux 服务器。Cockpit 使得 linux 系统管理员、系统维护员和开发者能轻松地管理他们的服务器并执行一些简单的任务,例如管理存储、检测日志、启动或停止服务以及一些其它任务。它的报告界面添加了一些很好的功能使得可以轻松地在终端和 web 界面之间切换。另外,它不仅使得管理一台服务器变得简单,更重要的是只需要一个单击就可以在一个地方同时管理多个通过网络连接的服务器。它非常轻量级,web 界面也非常简单易用。在这篇博文中,我们会学习如何安装 Cockpit 并用它管理我们的运行着 Fedora、CentOS、Arch Linux 以及 RHEL 发行版操作系统的服务器。下面是 Cockpit 在我们的 GNU/Linux 服务器中一些非常棒的功能:
-
-1. 它包含 systemd 服务管理器。
-2. 有一个用于故障排除和日志分析的 Journal 日志查看器。
-3. 包括 LVM 在内的存储配置比以前任何时候都要简单。
-4. 用 Cockpit 可以进行基本的网络配置。
-5. 可以轻松地添加和删除用户以及管理多台服务器。
-
-### 1. 安装 Cockpit ###
-
-首先,我们需要在我们基于 linux 的服务器上安装 Cockpit。大部分发行版的官方软件仓库中都有可用的 cockpit 安装包。这篇博文中,我们会在 Fedora 22、CentOS 7、Arch Linux 和 RHEL 7 中通过它们的官方软件仓库安装 Cockpit。
-
-#### CentOS / RHEL ####
-
-CentOS 和 RHEL 官方软件库中有可用的 Cockpit。我们只需要用 yum 管理器就可以安装。只需要以 sudo/root 权限运行下面的命令就可以安装它。
-
-    # yum install cockpit
-
-![Centos 上安装 Cockpit](http://blog.linoxide.com/wp-content/uploads/2015/10/install-cockpit-centos.png)
-
-#### Fedora 22/21 ####
-
-和 CentOS 一样, Fedora 的官方软件库默认也有可用的 Cockpit。我们只需要用 dnf 软件包管理器就可以安装 Cockpit。
-
-    # dnf install cockpit
-
-![Fedora 上安装 Cockpit](http://blog.linoxide.com/wp-content/uploads/2015/10/install-cockpit-fedora.png)
-
-#### Arch Linux ####
-
-现在 Arch Linux 官方软件库中还没有可用的 Cockpit,但 Arch 用户库(Arch User Repository,AUR)有。只需要运行下面的 yaourt 命令就可以安装。
-
-    # yaourt cockpit
-
-![Arch linux 上安装 Cockpit](http://blog.linoxide.com/wp-content/uploads/2015/10/install-cockpit-archlinux.png)
-
-### 2. 启动并启用 Cockpit ###
-
-成功安装完 Cockpit,我们就要用服务/守护进程管理器启动 Cockpit 服务。到了 2015 年,尽管一些 linux 发行版仍然运行 SysVinit 管理守护进程,但大部分 linux 发行版都采用了 Systemd,Cockpit 使用 systemd 完成从运行守护进程到服务几乎所有的功能。因此,我们只能在运行着 Systemd 的最新的 linux 发行版中安装 Cockpit。要启动 Cockpit 并让它在每次系统重启时自动启动,我们需要在终端或控制台中运行下面的命令。
-    # systemctl start cockpit
-
-    # systemctl enable cockpit.socket
-
-	创建从 /etc/systemd/system/sockets.target.wants/cockpit.socket 到 /usr/lib/systemd/system/cockpit.socket 的符号链接。
-
-### 3. 允许通过防火墙 ###
-
-启动 Cockpit 并使得它能在每次系统重启时自动启动后,我们现在要给它配置防火墙。由于我们的服务器上运行着防火墙程序,我们需要允许它通过某些端口使得从服务器外面可以访问 Cockpit。
-
-#### Firewalld ####
-
-    # firewall-cmd --add-service=cockpit --permanent
-
-    success
-
-    # firewall-cmd --reload
-
-    success
-
-![允许 Cockpit 通过 Firewalld](http://blog.linoxide.com/wp-content/uploads/2015/10/cockpit-allowing-firewalld.png)
-
-#### Iptables ####
-
-    # iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-
-    # service iptables save
-
-### 4. 访问 Cockpit Web 界面 ###
-
-下面,我们终于要通过 web 浏览器访问 Cockpit web 界面了。根据配置,我们只需要用浏览器打开 https://ip-address:9090 或 https://server.domain.com:9090。在我们这篇博文中,我们用浏览器打开 https://128.199.114.17:9090,正如下图所示。
-
-![通过 SSL 访问 Cockpit Web 服务](http://blog.linoxide.com/wp-content/uploads/2015/10/cockpit-webserver-ssl-proceed.png)
-
-此时会出现一个 SSL 认证警告,因为我们正在使用一个自签名认证。我们只需要忽略这个警告并进入到登录页面,在 chrome/chromium 中,我们需要点击 Show Advanced 然后点击 **Proceed to 128.199.114.17 (unsafe)**。
-
-![Cockpit 登录界面](http://blog.linoxide.com/wp-content/uploads/2015/10/cockpit-login-screen.png)
-
-现在,要进入仪表盘,我们需要输入详细的登录信息。这里,用户名和密码和用于登录我们的 linux 服务器的用户名和密码相同。当我们输入登录信息并点击 Log In 按钮后,我们就会进入到 Cockpit 仪表盘。
-
-![Cockpit 仪表盘](http://blog.linoxide.com/wp-content/uploads/2015/10/cockpit-dashboard.png)
-
-这里我们可以看到所有的菜单以及 CPU、磁盘、网络、存储使用情况的可视化结果。仪表盘正如上图所示。
-
-#### 服务 ####
-
-要管理服务,我们需要点击 web 页面右边菜单中的 Services 按钮。然后,我们会看到服务被分成了 5 个类别,目标、系统服务、套接字、计时器和路径。
-
-![Cockpit 服务](http://blog.linoxide.com/wp-content/uploads/2015/10/cockpit-services.png)
- 
-#### Docker 容器 ####
-
-我们甚至可以用 Cockpit 管理 docker 容器。用 Cockpit 监控和管理 Docker 容器非常简单。由于我们的服务器中没有安装运行 docker,我们需要点击 Start Docker。
-
-
-![Cockpit 容器](http://blog.linoxide.com/wp-content/uploads/2015/10/cockpit-container.png)
-
-Cockpit 会自动在我们的服务器上安装和运行 docker。启动之后,我们就会看到下面的截图。然后我们就可以按照需求管理 docker 镜像、容器。
-
-![Cockpit 容器管理](http://blog.linoxide.com/wp-content/uploads/2015/10/cockpit-containers-mangement.png)
-
-#### Journal 日志查看器 ####
-
-Cockpit 有个日志查看器,它把错误、警告、注意分到不同的标签页。我们也有一个 All 标签页,在这里可以看到所有的日志信息。
-
-![Cockpit Journal 日志](http://blog.linoxide.com/wp-content/uploads/2015/10/cockpit-journal-logs.png)
-
-#### 网络 ####
-
-在网络部分,我们可以看到两个可视化发送和接收速度的图。我们可以看到这里有一个可用网卡的列表,还有 Add Bond、Bridge、VLAN 的选项。如果我们需要配置一个网卡,我们只需要点击网卡名称。在下面,我们可以看到网络的 Journal 日志信息。
-
-![Cockpit Network](http://blog.linoxide.com/wp-content/uploads/2015/10/cockpit-network.png)
-
-#### 存储 ####
-
-现在,用 Cockpit 可以方便地查看硬盘的读写速度。我们可以查看存储的 Journal 日志以便进行故障排除和修复。在页面中还有一个已用空间的可视化图。我们甚至可以卸载、格式化、删除一块硬盘的某个分区。它还有类似创建 RAID 设备、卷组等攻能。
-
-![Cockpit Storage](http://blog.linoxide.com/wp-content/uploads/2015/10/cockpit-storage.png)
-
-#### 用户管理 ####
-
-通过 Cockpit Web 界面我们可以方便地创建新用户。在这里创建的账户会应用到系统用户账户。我们可以用它更改密码、指定角色、以及删除用户账户。
-
-![Cockpit Accounts](http://blog.linoxide.com/wp-content/uploads/2015/10/cockpit-accounts.png)
-
-#### 实时终端 ####
-
-Cockpit 还有一个很棒的特性。是的,我们可以执行命令,用 Cockpit 界面提供的实时终端执行任务。这使得我们可以根据我们的需求在 web 界面和终端之间自由切换。
-
-![Cockpit 终端](http://blog.linoxide.com/wp-content/uploads/2015/10/cockpit-terminal.png)
-
-### 总结 ###
-
-Cockpit 是由 [Red Hat][1] 开发的使得管理服务器变得轻松简单的免费开源软件。它非常适合于进行简单的系统管理任务和新手系统管理员。它仍然处于开发阶段,还没有稳定版发行。因此不适合于生产环境。它是针对最新的默认安装了 systemd 的 Fedora、CentOS、Arch Linux、RHEL 系统开发的。如果你想在 Ubuntu 上安装 Cockpit,你可以通过 PPA 访问,但现在已经过期了。如果你有任何疑问、建议,请在下面的评论框中反馈给我们,这样我们可以改进和更新我们的内容。非常感谢 ! 
-
---------------------------------------------------------------------------------
-
-via: http://linoxide.com/linux-how-to/install-cockpit-fedora-centos-rhel-arch-linux/
-
-作者:[Arun Pyasi][a]
-译者:[ictlyh](http://mutouxiaogui.cn/blog/)
-校对:[校对者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/
\ No newline at end of file

From da1e4e1140dad46bd2546efcb16d80ee1afa28e0 Mon Sep 17 00:00:00 2001
From: wxy 
Date: Tue, 29 Mar 2016 05:36:33 +0800
Subject: [PATCH 0574/1469] PUB:Part 2 - LFCS--How to Install and Use vi or vim
 as a Full Text Editor.md

@GHLandy
---
 ...and Use vi or vim as a Full Text Editor.md | 251 +++++++++++
 ...and Use vi or vim as a Full Text Editor.md | 392 ------------------
 2 files changed, 251 insertions(+), 392 deletions(-)
 create mode 100644 published/LFCS/Part 2 - LFCS--How to Install and Use vi or vim as a Full Text Editor.md
 delete mode 100644 translated/tech/LFCS/Part 2 - LFCS--How to Install and Use vi or vim as a Full Text Editor.md

diff --git a/published/LFCS/Part 2 - LFCS--How to Install and Use vi or vim as a Full Text Editor.md b/published/LFCS/Part 2 - LFCS--How to Install and Use vi or vim as a Full Text Editor.md
new file mode 100644
index 0000000000..d7d962de0f
--- /dev/null
+++ b/published/LFCS/Part 2 - LFCS--How to Install and Use vi or vim as a Full Text Editor.md	
@@ -0,0 +1,251 @@
+LFCS 系列第二讲:如何安装和使用纯文本编辑器 vi/vim
+================================================================================
+
+几个月前, Linux 基金会发起了 LFCS (Linux Foundation Certified System administrator,Linux 基金会认证系统管理员)认证,以帮助世界各地的人来验证他们能够在 Linux 系统上做从基础的到中级的系统管理任务:如系统支持、第一手的故障诊断和处理、以及何时向上游支持团队提出问题的智能决策。
+
+![Learning VI Editor in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/LFCS-Part-2.png)
+
+*在 Linux 中学习 vi 编辑器*
+
+请简要看看一下视频,里边介绍了 Linux 基金会认证的程序。
+
+注:youtube 视频
+
+
+
+这篇文章是系列教程的第二讲,在这个部分中,我们会介绍 vi/vim 基本的文件编辑操作,帮助读者理解编辑器中的三个模式,这是 LFCS 认证考试中必须掌握的。
+
+### 使用 vi/vim 执行基本的文件编辑操作 ###
+
+vi 是为 Unix 而生的第一个全屏文本编辑器。它的设计小巧简单,对于仅仅使用过诸如 NotePad++ 或 gedit 等图形界面的文本编辑器的用户来说,使用起来可能存在一些困难。
+
+为了使用 vi,我们必须首先理解这个强大的程序操作中的三种模式,方便我们后边学习这个强大的文本处理软件的相关操作。
+
+请注意,大多数的现代 Linux 发行版都集成了 vi 的变种——— vim(Vi IMproved,改进版 VI),相比于 vi,它有更多新功能。所以,我们会在本教程中交替使用 vi 和 vim。
+
+如果你的发行版还没有安装 vim,你可以通过以下方法来安装:
+
+- Ubuntu 及其衍生版:apt-get update && apt-get install vim
+- 以 Red-Hat 为基础的发行版:yum update && yum install vim
+- openSUSE :zypper update && zypper install vim
+
+### 我为什么要学习 vi ###
+
+至少有以下两个理由:
+
+1. 因为它是 POSIX 标准的一部分,所以不管你使用什么发行版 vi 总是可用的。
+
+2. vi 基本不消耗多少系统资源,并且允许我们仅仅通过键盘来完成任何可能的任务。
+
+此外,vi 有着非常丰富的内置帮助手册,程序打开后就可以通过 `:help` 命令来查看。这个内置帮助手册比 vi/vim 的 man 页面包含了更多信息。
+
+![vi Man Pages](http://www.tecmint.com/wp-content/uploads/2014/10/vi-man-pages.png)
+
+*vi Man 页面*
+
+#### 启动 vi ####
+
+可以通过在命令提示符下输入 vi 来启动。
+
+![Start vi Editor](http://www.tecmint.com/wp-content/uploads/2014/10/start-vi-editor.png)
+
+*使用 vi 编辑器*
+
+然后按下字母 i,你就可以开始输入了。或者通过下面的方法来启动 vi:
+
+    # vi filename
+
+这样会打开一个名为 filename 的缓存区(buffer)(稍后会详细介绍缓存区),在你编辑完成之后就可以存储在磁盘中了。
+
+#### 理解 vi 的三个模式 ####
+
+1. 在命令(command)模式中,vi 允许用户浏览该文件并输入由一个或多个字母组成的、简短的、大小写敏感的 vi 命令。这些命令的大部分都可以增加一个前缀数字表示执行次数。
+
+	比如:`yy`(或`Y`) 复制当前的整行,`3yy`(或`3Y`) 复制当前整行和下边紧接着的两行(总共3行)。通过 `Esc` 键可以随时进入命令模式(而不管当前工作在什么模式下)。事实上,在命令模式下,键盘上所有的输入都被解释为命令而非文本,这往往使得初学者困惑不已。
+
+2. 在末行(ex)模式中,我们可以处理文件(包括保存当前文件和运行外部程序)。我们必须在命令模式下输入一个冒号(`:`),才能进入这个模式,紧接着是要在末行模式下使用的命令。执行之后 vi 自动回到命令模式。
+
+3. 在文本输入(insert)模式(通常在命令模式下使用字母 `i` 进入这个模式)中,我们可以随意输入文本。大多数的键入将以文本形式输出到屏幕(一个重要的例外是`Esc`键,它将退出文本编辑模式并回到命令模式)。
+
+![vi Insert Mode](http://www.tecmint.com/wp-content/uploads/2014/10/vi-insert-mode.png)
+
+*vi 文本插入模式*
+
+#### vi 命令 ####
+
+下面的表格列出常用的 vi 命令。文件编辑的命令可以通过添加叹号的命令强制执行(如,`:q!` 命令强制退出编辑器而不保存文件)。
+
+|关键命令|描述|
+|------|:--:|
+|`h` 或 ←|光标左移一个字符|
+|`j` 或 ↓|光标下移一行|
+|`k` 或 ↑|光标上移一行|
+|`l` (小写字母 L) 或 →|光标右移一个字符|
+|`H`|光标移至屏幕顶行|
+|`L`|光标移至屏幕末行|
+|`G`|光标移至文件末行|
+|`w`|光标右移一个词|
+|`b`|光标左移一个词|
+|`0` (数字零)|光标移至行首|
+|`^`|光标移至当前行第一个非空格字符|
+|`$`|光标移至当前行行尾|
+|`Ctrl-B`|向后翻页|
+|`Ctrl-F`|向前翻页|
+|`i`|在光标所在位置插入文本|
+|`I` (大写字母 i)|在当前行首插入文本|
+|`J` (大写字母 j)|将下一行与当前行合并(下一行上移到当前行)|
+|`a`|在光标所在位置后追加文本|
+|`o` (小写字母 O)|在当前行下边插入空白行|
+|`O` (大写字母 O)|在当前行上边插入空白行|
+|`r`|替换光标所在位置的一个字符|
+|`R`|从光标所在位置开始覆盖插入文本|
+|`x`|删除光标所在位置的字符|
+|`X`|立即删除光标所在位置之前(左边)的一个字符|
+|`dd`|剪切当前整行文本(为了之后进行粘贴)|
+|`D`|剪切光标所在位置到行末的文本(该命令等效于 `d$`)|
+|`yX`|给出一个移动命令 X (如 `h`、`j`、`H`、`L` 等),复制适当数量的字符、单词或者从光标开始到一定数量的行|
+|`yy` 或 `Y`|复制当前整行|
+|`p`|粘贴在光标所在位置之后(下一行)|
+|`P`|粘贴在光标所在位置之前(上一行)
+|`.` (句点)|重复最后一个命令|
+|`u`|撤销最后一个命令|
+|`U`|撤销最后一行的最后一个命令,只有光标仍在最后一行才能执行。|
+|`n`|在查找中跳到下一个匹配项|
+|`N`|在查找中跳到前一个匹配项|
+|`:n`|下一个文件,编辑多个指定文件时,该命令加载下一个文件。|
+|`:e file`|加载新文件来替代当前文件|
+|`:r file`|将新文件的内容插入到光标所在位置的下一行|
+|`:q`|退出并放弃更改|
+|`:w file`|将当期打开的缓存区保存为file。如果是追加到已存在的文件中,则使用 :`w >> file` 命令|
+|`:wq`|保存当前文件的内容并退出。等效于 `x!` 和 `ZZ`|
+|`:r! command`|执行 command 命令,并将命令的输出插入到光标所在位置的下一行|
+
+#### vi 选项 ####
+
+下列选项可以让你在运行 Vim 的时候很方便(需要写入到 `~/.vimrc` 文件):
+
+    # 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编辑器选项*
+
+- set number 当 vi 打开或新建文件时,显示行号。
+- syntax on 打开语法高亮(对应多个文件扩展名),以便源码文件和配置文件更具可读性。
+- set tabstop=4 设置制表符间距为 4 个空格(默认为 8)。
+- set autoindent 将前一行的缩进应用于下一行。 
+
+#### 查找和替换 ####
+
+vi 具有通过查找将光标移动到(在单独一行或者整个文件中的)指定位置。它还可自动或者通过用户确认来执行文本替换。
+
+a) 在行内查找。`f` 命令在当前行查找指定字符,并将光标移动到指定字符出现的位置。
+
+例如,命令 `fh` 会在本行中将光标移动到字母`h`下一次出现的位置。注意,字母 `f` 和你要查找的字符都不会出现在屏幕上,但是当你按下回车的时候,要查找的字符会被高亮显示。
+
+比如,以下是在命令模式按下 `f4` 之后的结果。
+
+![Search String in Vi](http://www.tecmint.com/wp-content/uploads/2014/10/vi-search-string.png)
+
+*在 vi 中查找字符*
+
+b) 在整个文件内查找。使用 `/` 命令,紧接着需要查找的单词或短语。这个查找可以通过使用 `n` 命令或者 `N` 重复查找上一个查找的字符串。以下是在命令模式键入 `/Jane` 的查找结果。
+
+![Vi Search String in File](http://www.tecmint.com/wp-content/uploads/2014/10/vi-search-line.png)
+
+*在 vi 中查找字符*
+
+c) vi 通过使用命令来完成多行或者整个文件的替换操作(类似于 sed)。我们可以使用以下命令,使得整个文件中的单词 “old” 替换为 “young”。
+
+    :%s/old/young/g
+
+**注意**:冒号位于命令的最前面。
+
+![Vi Search and Replace](http://www.tecmint.com/wp-content/uploads/2014/10/vi-search-and-replace.png)
+
+*vi 的查找和替换*
+
+冒号 (`:`) 进入末行模式,在本例中 `s` 表示替换,`%` 是从第一行到最后一行的表示方式(也可以使用 nm 表示范围,即第 n 行到第 m 行),old 是查找模式,young 是用来替换的文本,`g` 表示在每个查找出来的字符串都进行替换。
+
+另外,在命令最后增加一个 `c`,可以在每一个匹配项替换前进行确认。
+
+    :%s/old/young/gc
+
+将旧文本替换为新文本前,vi/vim 会向我们显示以下信息:
+
+![Replace String in Vi](http://www.tecmint.com/wp-content/uploads/2014/10/vi-replace-old-with-young.png)
+
+*vi 中替换字符串*
+
+- `y`: 执行替换(yes)
+- `n`: 跳过这个匹配字符的替换并转到下一个(no)
+- `a`: 在当前匹配字符及后边的相同项全部执行替换
+- `q` 或 `Esc`: 取消替换
+- `l` (小写 L): 执行本次替换并退出
+- `Ctrl-e`, `Ctrl-y`: 下翻页,上翻页,查看相应的文本来进行替换
+
+#### 同时编辑多个文件 ####
+
+我们在命令提示符输入 vim file1 file2 file3 如下:
+
+    # vim file1 file2 file3
+
+vim 会首先打开 file1,要跳到 file2 需用 :n 命令。当需要打开前一个文件时,:N 就可以了。
+
+为了从 file1 跳到 file3
+
+a) `:buffers` 命令会显示当前正在编辑的文件列表
+
+    :buffers
+
+![Edit Multiple Files](http://www.tecmint.com/wp-content/uploads/2014/10/vi-edit-multiple-files.png)
+
+*编辑多个文件*
+
+b) `:buffer 3` 命令(后边没有 s)会打开第三个文件 file3 进行编辑。
+
+在上边的图片中,标记符号 `#` 表示该文件当前已被打开,但是是在后台,而 `%a` 标记的文件是正在被编辑的。另外,文件号(如上边例子的 3)后边的空格表示该文件还没有被打开。
+
+#### vi 的临时缓存区 ####
+
+为了复制连续的多行(比如,假设为 4 行)到一个名为 a 的临时缓存区(与文件无关),并且还要将这些行粘贴到在当前 vi 会话文件中的其它位置,我们需要:
+
+1. 按下 `Esc` 键以确认 vi 处在命令模式
+
+2. 将光标放在我们希望复制的第一行文本
+
+3. 输入 `a4yy` 复制当前行和接下来的 3 行,进入一个名为 a 的缓存区。我们可以继续编辑我们的文件————我们不需要立即插入刚刚复制的行。
+
+4. 当到了需要使用刚刚复制的那些行的位置,在 `p`(小写)或 `P`(大写)命令前使用`a`来将复制行插入到名为 a 的 缓存区:
+	- 输入 `ap`,复制行将插入到光标位置所在行的下一行。
+	- 输入 `aP`,复制行将插入到光标位置所在行的上一行。
+
+如果愿意,我们可以重复上述步骤,将缓存区 a 中的内容插入到我们文件的多个位置。像本节中这样的一个临时缓存区,会在当前窗口关闭时释放掉。
+
+### 总结 ###
+
+像我们看到的一样,vi/vim 在命令接口下是一个强大而灵活的文本编辑器。通过以下链接,随时分享你自己的技巧和评论。
+
+#### 参考链接 ####
+
+- [关于 LFCS][1]
+- [为什么需要 Linux 基金会认证?][2]
+- [注册 LFCS 考试][3]
+
+--------------------------------------------------------------------------------
+
+via: http://www.tecmint.com/vi-editor-usage/
+
+作者:[Gabriel Cánepa][a]
+译者:[GHLandy](https://github.com/GHLandy)
+校对:[东风唯笑](https://github.com/dongfengweixiao), [wxy](https://github.com/wxy)
+
+本文由 [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
diff --git a/translated/tech/LFCS/Part 2 - LFCS--How to Install and Use vi or vim as a Full Text Editor.md b/translated/tech/LFCS/Part 2 - LFCS--How to Install and Use vi or vim as a Full Text Editor.md
deleted file mode 100644
index c7f3d5140c..0000000000
--- a/translated/tech/LFCS/Part 2 - LFCS--How to Install and Use vi or vim as a Full Text Editor.md	
+++ /dev/null
@@ -1,392 +0,0 @@
-GHLandy Translated
-
-LFCS系列第二讲:如何安装和使用纯文本编辑器vi/vim
-
-================================================================================
-
-几个月前, Linux 基金会发起了 LFCS (Linux Foundation Certified System administrator,Linux 基金会认证系统管理员)认证,以帮助世界各地的人来验证他们能够在 Linux 系统上做基本的中间系统管理任务:如系统支持,第一手的故障诊断和处理,以及何时向上游支持团队提出问题的智能决策。
-
-![Learning VI Editor in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/LFCS-Part-2.png)
-
-在 Linux 中学习 vi 编辑器
-
-请简要看看一下视频,里边介绍了 Linux 基金会认证的程序。
-
-注:youtube 视频
-
-
-
-这篇文章是《十个教程》系列的第二部分,在这个部分,我们会介绍 vi/vim 基本的文件编辑操作,帮助读者理解编辑器中的三个模式,这是LFCS认证考试中必须掌握的。
-
-### 使用 vi/vim 执行基本的文件编辑操作 ###
-
-vi 是为 Unix 而生的第一个全屏文本编辑器。它的设计小巧简单,对于仅仅使用过诸如 NotePad++ 或 gedit 等图形界面的文本编辑器的用户来说,使用起来可能存在一些困难。
-
-为了使用 vi,我们必须首先理解这个强大的程序操作中的三种模式,方便我们后边学习这个强大的文本处理软件的相关操作。
-
-请注意,大多数的现代 Linux 发行版都集成了 vi 的变种——— vim(Vi IMproved,VI 的改进),相比于 vi,它有更多新功能。所以,我们会在本教程中交替使用 vi 和 vim。
-
-如果你的发行版还没有安装 vim,你可以通过以下方法来安装:
-
-- Ubuntu 及其衍生版:apt-get update && apt-get install vim
-- 以 Red-Hat 为基础的发行版:yum update && yum install vim
-- openSUSE :zypper update && zypper install vim
-
-### 我为什么要学习 vi ###
-
-至少有以下两个理由:
-
-1.因为它是 POSIX 标准的一部分,所以不管你使用什么发行版 vi 总是可用的。
-
-2.vi 基本不消耗多少系统资源,并且允许我们仅仅通过键盘来完成任何可能的任务。
-
-此外,vi 有的非常丰富的内置帮助手册,程序打开后就可以通过 :help 命令来查看。这个内置帮助手册比 vi/vim 的 man 页面包含了更多信息。
-
-![vi Man Pages](http://www.tecmint.com/wp-content/uploads/2014/10/vi-man-pages.png)
-
-vi Man 页面
-
-#### 启动 vi ####
-
-可以通过在命令提示符下输入 vi 来启动。
-
-![Start vi Editor](http://www.tecmint.com/wp-content/uploads/2014/10/start-vi-editor.png)
-
-使用 vi 编辑器
-
-然后按下字母 i,你就可以开始输入了。或者通过下面的方法来启动 vi:
-
-    # vi filename
-
-这样会打开一个名为 filename 的 buffer(稍后详细介绍 buffer),在你编辑完成之后就可以存储在磁盘中了。
-
-#### 理解 vi 的三个模式 ####
-
-1.在命令模式中,vi 允许用户浏览该文件并输入由一个或多个字母组成简短的、大小写敏感的 vi 命令。这些命令的大部分都可以增加一个前缀数字表示执行次数。
-
-比如:yy(或Y) 复制当前的整行,3yy(或3Y) 复制当前整行和下边紧接着的两行(总共3行)。通过 Esc 键可以随时进入命令模式(而不管当前工作在什么模式下)。事实上,在命令模式下,键盘上所有的输入都被解释为命令而非文本,这往往使得初学者困惑不已。
-
-2.在末行模式中,我们可以处理文件(包括保存当前文件和运行外部程序)。我们必须在命令模式下输入一个冒号(:),才能进入这个模式,紧接着是需要使用的末行模式下的命令。执行之后 vi 自动回到命令模式。
-
-3.在文本输入模式(通常使用字母  i 进入这个模式)中,我们可以随意输入文本。大多数的键入将以文本形式输出到屏幕(一个重要的例外是Esc键,它将退出文本编辑模式并回到命令模式)。
-
-![vi Insert Mode](http://www.tecmint.com/wp-content/uploads/2014/10/vi-insert-mode.png)
-
-vi 文本插入模式
-
-#### vi 命令 ####
-
-下面的表格列出常用的 vi 命令。文件版本的命令可以通过添加叹号的命令强制执行(如,:q! 命令强制退出编辑器而不保存文件)。
-
-注:表格
-
-  -  
-  -  
-  
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      
-      
-    
-  
-
 关键命令 描述
 h 或 ← 光标左移一个字符
 j 或 ↓ 光标下移一行
 k 或 ↑ 光标上移一行
 l (小写 L) 或 → 光标右移一个字符
 H 光标移至屏幕顶行
 L 光标移至屏幕末行
 G 光标移至文件末行
 w 光标右移一个词
 b 光标左移一个词
 0 (零) 光标移至行首
 ^ 光标移至当前行第一个非空格字符
 $ 光标移至当前行行尾
 Ctrl-B 向后翻页
 Ctrl-F 向前翻页
 i 在光标所在位置插入文本
 I (大写 i) 在当前行首插入文本
 J (大写 j) 将下一行与当前行合并(下一行上移到当前行)
 a 在光标所在位置后追加文本
 o (小写 O) 在当前行下边插入空白行
 O (大写 o) 在当前行上边插入空白行
 r 替换光标所在位置的字符
 R 光标所在位置覆盖插入文本
 x 删除光标所在位置的字符
 X 立即删除光标所在位置之前(左边)的一个字符
 dd 剪切当前整行文本(为了之后进行粘贴)
 D 剪切光标所在位置到行末的文本(该命令等效于 d$)
 yX 给 X 命令一个移动长度,复制适当数量的字符、单词或者从光标开始到一定数量的行
 yy 或 Y 复制当前整行
 p 粘贴在光标所在位置之后(下一行)
 P 粘贴在光标所在位置之前(上一行)
 . (句点) 重复最后一个命令
 u 撤销最后一个命令
 U 撤销最后一行的最后一个命令,只有光标仍在最后一行才能执行。
 n 在查找中跳到下一个匹配项
 N 在查找中跳到前一个匹配项
 :n 下一个文件,编辑多个指定文件时,该命令加载下一个文件。
 :e file 加载新文件来替代当前文件
 :r file 将新文件的内容插入到光标所在位置的下一行
 :q 退出并放弃更改
 :w file 将当期打开的buffer保存为file。如果是追加到已存在的文件中,则使用 :w >> file 命令
 :wq 保存当前文件的内容并退出。等效于 x! 和 ZZ
 :r! command 执行 command 命令,并将命令的输出插入到光标所在位置的下一行
- -#### vi 选项 #### - -下列选项将会在启动 Vim 的时候进行加载(需要写入到~/.vimrc文件): - - # 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编辑器选项 - -- set number 当 vi 打开或新建文件时,显示行号。 -- syntax on 打开语法高亮(对应多个文件扩展名),以便源码文件和配置文件更具可读性。 -- set tabstop=4 设置制表符间距为 4 个空格(默认为 8)。 -- set autoindent 将前一行的缩进应用于下一行。 - -#### 查找和替换 #### - -vi 具有通过查找将光标移动到(在单独一行或者整个文件中的)指定位置。它还可自动或者通过用户确认来执行文本替换。 - -a) 在行内查找。f 命令在当前行查找指定字符,并将光标移动到指定字符出现的位置。 - -例如,命令 fh 会在本行中将光标实例字母h出现的位置。注意,字母 f 和你要查找的字符都不会出现在屏幕上,但是当你按下回车的时候,要查找的字符会被高亮显示。 - -比如,以下是在命令模式按下 f4 之后的结果。 - -![Search String in Vi](http://www.tecmint.com/wp-content/uploads/2014/10/vi-search-string.png) - -在 vi 中查找字符。 - -b) 在整个文件内查找。使用 / 命令,紧接着需要查找的单词或短语。这个查找可以通过使用 n 命令或者 N 重复查找上一个查找的字符串。以下是在命令模式键入 /Jane 的查找结果。 - -![Vi Search String in File](http://www.tecmint.com/wp-content/uploads/2014/10/vi-search-line.png) - -在vi中查找字符 - -c) vi 通过使用命令来完成多行或者整个文件的替换操作(类似于 sed)。我们可以使用以下命令,使得整个文件中的单词 “old” 替换为 “young”。 - - :%s/old/young/g - -**注意**:冒号位于命令的最前面。 - -![Vi Search and Replace](http://www.tecmint.com/wp-content/uploads/2014/10/vi-search-and-replace.png) - -vi 的查找和替换 - -冒号 (:) 进入末行模式,在本例中 s 表示替换,% 是从第一行到最后一行的表示方式(也可以使用 nm 表示范围,即第 n 行到第 m 行),old 是查找模式,young 是用来替换的文本,g 表示在每个查找出来的字符串都进行替换。 - -另外,在命令最后增加一个 c,可以在每一个匹配项替换前进行确认。 - - :%s/old/young/gc - -将就文本替换为新文本前,vi/vim 会想我们显示一下信息: - -![Replace String in Vi](http://www.tecmint.com/wp-content/uploads/2014/10/vi-replace-old-with-young.png) - -vi 中替换字符串 - -- y: 执行替换(yes) -- n: 跳过这个匹配字符的替换并转到下一个(no) -- a: 在当前匹配字符及后边的相同项全部执行替换 -- q 或 Esc: 取消替换 -- l (小写 L): 执行本次替换并退出 -- Ctrl-e, Ctrl-y: 下翻页,上翻页,查看相应的文本来进行替换 - -#### 同时编辑多个文件 #### - -我们在命令提示符输入 vim file1 file2 file3 如下: - - # vim file1 file2 file3 - -vim 会首先打开 file1,要跳到 file2 需用 :n 命令。当需要打开前一个文件时,:N 就可以了。 - -为了从 file1 跳到 file3 - -a) :buffers 命令会显示当前正在编辑的文件列表 - - :buffers - -![Edit Multiple Files](http://www.tecmint.com/wp-content/uploads/2014/10/vi-edit-multiple-files.png) - -编辑多个文件 - -b) :buffer 3 命令(后边没有 s)会打开 file 进行编辑。 - -在上边的图片中,标记符号 # 表示该文件当前已被打开在后台,而 %a 标记的文件是正在被编辑的。另外,文件号(如上边例子的 3)后边的空格表示该文件还没有被打开。 - -#### vi 的临时 buffers #### - -为了复制连续的多行(比如,假设为 4 行)到一个名为 a 的临时 buffer(与文件无关),并且还要将这些行粘贴到在当前 vi 会话文件中的其它位置,我们需要: - -1. 按下 Esc 键以确认 vi 处在命令模式 - -2. 将光标放在我们希望复制的第一行文本 - -3. 输入 a4yy 复制当前行和接下来的 3 行,进入一个名为 a 的 buffer。我们一继续编辑我们的文件————我们不需要立即插入刚刚复制的行。 - -4. 当到了需要使用刚刚复制行的位置,在 p(小写)或 P(大写)命令来讲复制行插入到名为 a 的 buffer: - -- 输入 ap,复制行将插入到光标位置所在行的下一行。 -- 输入 aP,复制行将插入到光标位置所在行的上一行。 - -如果愿意,我们可以重复上述步骤,将 buffer a 中的内容插入到我们文件的多个位置。一个临时 buffer,像本次会话中的一样,会在当前窗口关闭时释放掉。 - -### 总结 ### - -像我们看到的一样,vi/vim 在命令接口下是一个强大而灵活的文本编辑器。通过以下链接,随时分享你自己的技巧和评论。 - -#### 参考链接 #### - -- [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] -译者:[GHLandy](https://github.com/GHLandy) -校对:[东风唯笑](https://github.com/dongfengweixiao) - -本文由 [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 From 0f4e053413e6ba48b212bdb3a66a575a2e236c2b Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 30 Mar 2016 06:02:14 +0800 Subject: [PATCH 0575/1469] PUB:Part 3 - LFCS--How to Archive or Compress Files and Directories Setting File Attributes and Finding Files in Linux.md @GHLandy --- ...e Attributes and Finding Files in Linux.md | 216 +++++------------- 1 file changed, 62 insertions(+), 154 deletions(-) rename {translated/tech => published}/LFCS/Part 3 - LFCS--How to Archive or Compress Files and Directories Setting File Attributes and Finding Files in Linux.md (52%) diff --git a/translated/tech/LFCS/Part 3 - LFCS--How to Archive or Compress Files and Directories Setting File Attributes and Finding Files in Linux.md b/published/LFCS/Part 3 - LFCS--How to Archive or Compress Files and Directories Setting File Attributes and Finding Files in Linux.md similarity index 52% rename from translated/tech/LFCS/Part 3 - LFCS--How to Archive or Compress Files and Directories Setting File Attributes and Finding Files in Linux.md rename to published/LFCS/Part 3 - LFCS--How to Archive or Compress Files and Directories Setting File Attributes and Finding Files in Linux.md index 876fa4d3af..d99008cc29 100644 --- a/translated/tech/LFCS/Part 3 - LFCS--How to Archive or Compress Files and Directories Setting File Attributes and Finding Files in Linux.md +++ b/published/LFCS/Part 3 - LFCS--How to Archive or Compress Files and Directories Setting File Attributes and Finding Files in Linux.md @@ -1,165 +1,72 @@ -GHLandy Translated - -LFCS 系列第三讲:如何在 Linux 中归档/压缩文件及目录、设置文件属性和搜索文件 - +LFCS 系列第三讲:归档/压缩文件及目录、设置文件属性和搜索文件 ================================================================================ -最近,Linux 基金会发起了 一个全新的 LFCS(Linux Foundation Certified Sysadmin,Linux 基金会认证系统管理员)认证,旨在让遍布全世界的人都有机会参加该认证的考试,并且通过考试的人将会得到关于他们有能力在 Linux 上执行基本的中间系统管理任务的认证证书。这项认证包括了对已运行的系统和服务的支持、一流水平的问题解决和分析以及决定何时将问题反映给工程师团队的能力。 + +最近,Linux 基金会发起了一个全新的 LFCS(Linux Foundation Certified Sysadmin,Linux 基金会认证系统管理员)认证,旨在让遍布全世界的人都有机会参加该认证的考试,通过考试的人将表明他们有能力在 Linux 上执行基本的中级系统管理任务。这项认证包括了对已运行的系统和服务的支持、一流水平的问题解决和分析以及决定何时将问题反映给工程师团队的能力。 ![Linux Foundation Certified Sysadmin – Part 3](http://www.tecmint.com/wp-content/uploads/2014/10/lfcs-Part-3.png) -LFCS 系列第三讲 +*LFCS 系列第三讲* 请看以下视频,这里边讲给出 Linux 基金会认证程序的一些想法。 注:youtube 视频 -本讲是《十套教程》系列中的第三讲,在这一讲中,我们会涵盖如何在文件系统中归档/压缩文件及目录、设置文件属性和搜索文件等内容,这些都是 LFCS 认证中必须掌握的知识。 +本讲是系列教程中的第三讲,在这一讲中,我们会涵盖如何在文件系统中归档/压缩文件及目录、设置文件属性和搜索文件等内容,这些都是 LFCS 认证中必须掌握的知识。 ### 归档和压缩的相关工具 ### -文件归档工具将一堆文件整合到一个单独的归档文件之后,我们可以将归档文件备份到不同类型的媒介或者通过网络传输和发送 Email 来备份。在 Linux 中使用频率最高的归档实用工具是 tar。当归档工具和压缩工具一起使用的时候,可以减少同一文件和信息在硬盘中的存储空间。 +文件归档工具将一堆文件整合到一个单独的归档文件之后,我们可以将归档文件备份到不同类型的介质或者通过网络传输和发送 Email 来备份。在 Linux 中使用频率最高的归档实用工具是 tar。当归档工具和压缩工具一起使用的时候,可以减少同一文件和信息在硬盘中的存储空间。 #### tar 使用工具 #### -tar 将一组文件打包到一个单独的归档文件(通常叫做 tar 文件或者 tarball)。tar 这个名称最初代表磁带存档程序(tape archiver),但现在我们可以用它来归档任意类型的可读写媒介上边的数据,而不是只能归档磁带数据。tar 通常与 gzip、bzip2 或者 xz 等压缩工具一起使用,生成一个压缩的 tarball。 +tar 将一组文件打包到一个单独的归档文件(通常叫做 tar 文件或者 tarball)。tar 这个名称最初代表磁带存档程序(tape archiver),但现在我们可以用它来归档任意类型的可读写介质上边的数据,而不是只能归档磁带数据。tar 通常与 gzip、bzip2 或者 xz 等压缩工具一起使用,生成一个压缩的 tarball。 **基本语法:** # tar [选项] [路径名 ...] -其中 ... 代表指定那些文件进行归档操作的表达式 +其中 ... 代表指定哪些文件进行归档操作的表达式 #### tar 的常用命令 #### -注:表格 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
长选项简写描述
 –create c 创建 tar 归档文件
 –concatenate A 将一存档与已有的存档合并
 –append r 把要存档的文件追加到归档文件的末尾
 –update u 更新新文件到归档文件中去
 –diff 或 –compare d 比较存档与当前文件的不同之处
 –file archive f 使用档案文件或设备
 –list t 列出 tarball 中的内容
 –extract 或 –get x 从归档文件中释放文件
+ +|长选项|简写|描述| +|-----|:---:|:---| +| -create| c| 创建 tar 归档文件| +| -concatenate| A| 将一存档与已有的存档合并| +| -append| r| 把要存档的文件追加到归档文件的末尾| +| -update| u| 更新新文件到归档文件中去| +| -diff 或 -compare| d| 比较存档与当前文件的不同之处| +| -file archive| f| 使用档案文件或归档设备| +| -list| t| 列出 tarball 中的内容| +| -extract 或 -get| x| 从归档文件中释放文件| + #### 常用的操作修饰符 #### 注:表格 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
长选项缩写描述
 –directory dir C 执行归档操作前,先转到指定目录
 –same-permissions p 保持原始的文件权限
 –verbose v 列出所有的读取或提取文件。但这个标识符与 –list 一起使用的时候,还会显示出文件大小、属主和时间戳的信息
 –verify W 写入存档后进行校验
 –exclude file — 不把指定文件包含在内
 –exclude=pattern X 以PATTERN模式排除文件
 –gzip 或 –gunzip z 通过gzip压缩归档
 –bzip2 j 通过bzip2压缩归档
 –xz J 通过xz压缩归档
-Gzip 是最古老的压缩工具,压缩率最小,bzip2 的压缩率稍微高一点。另外,xz是最新的压缩工具,压缩率最好。xz 具有最佳压缩率的代价是:完成压缩操作花费最多时间,压缩过程中占有较多系统资源。 +|长选项|缩写|描述| +|-----|:--:|:--| +| -directory dir| C| 执行归档操作前,先转到指定目录| +| -same-permissions| p| 保持原始的文件权限| +| -verbose| v| 列出所有的读取或提取的文件。但这个标识符与 -list 一起使用的时候,还会显示出文件大小、属主和时间戳的信息| +| -verify| W| 写入存档后进行校验| +| -exclude file| | 不把指定文件包含在内| +| -exclude=pattern| X| 以PATTERN模式排除文件| +| -gzip 或 -gunzip| z| 通过gzip压缩归档| +| -bzip2| j| 通过bzip2压缩归档| +| -xz| J| 通过xz压缩归档| + + +Gzip 是最古老的压缩工具,压缩率最小,bzip2 的压缩率稍微高一点。另外,xz 是最新的压缩工具,压缩率最好。xz 具有最佳压缩率的代价是:完成压缩操作花费最多时间,压缩过程中占有较多系统资源。 通常,通过这些工具压缩的 tar 文件相应的具有 .gz、.bz2 或 .xz的扩展名。在下列的例子中,我们使用 file1、file2、file3、file4 和 file5 进行演示。 **通过 gzip、bzip2 和 xz 压缩归档** -归档当前工作目录的所有文件,并以 gzip、bzip2 和 xz 压缩刚刚的归档文件(请注意,用正则表达式来指定那些文件应该归档——这是为了防止归档工具包前一步生成的文件打包进来)。 +归档当前工作目录的所有文件,并以 gzip、bzip2 和 xz 压缩刚刚的归档文件(请注意,用正则表达式来指定哪些文件应该归档——这是为了防止将归档工具包前一步生成的文件打包进来)。 # tar czf myfiles.tar.gz file[0-9] # tar cjf myfiles.tar.bz2 file[0-9] @@ -167,7 +74,7 @@ Gzip 是最古老的压缩工具,压缩率最小,bzip2 的压缩率稍微高 ![Compress Multiple Files Using tar](http://www.tecmint.com/wp-content/uploads/2014/10/Compress-Multiple-Files.png) -压缩多个文件 +*压缩多个文件* **列举 tarball 中的内容和更新/追加文件到归档文件中** @@ -177,7 +84,7 @@ Gzip 是最古老的压缩工具,压缩率最小,bzip2 的压缩率稍微高 ![Check Files in tar Archive](http://www.tecmint.com/wp-content/uploads/2014/10/List-Archive-Content.png) -列举归档文件中的内容 +*列举归档文件中的内容* 运行一下任意一条命令: @@ -206,19 +113,19 @@ Gzip 是最古老的压缩工具,压缩率最小,bzip2 的压缩率稍微高 假设你现在需要备份用户的家目录。一个有经验的系统管理员会选择忽略所有视频和音频文件再备份(也可能是公司规定)。 -可能你最先想到的方法是在备份是时候,忽略扩展名为 .mp3 和 .mp4(或者其他格式)的文件。但如果你有些自作聪明的用户将扩展名改为 .txt 或者 .bkp,那你的方法就不灵了。为了发现并排除音频或者视频文件,你需要先检查文件类型。以下 shell 脚本可以代你完成类型检查: +可能你最先想到的方法是在备份的时候,忽略扩展名为 .mp3 和 .mp4(或者其他格式)的文件。但如果你有些自作聪明的用户将扩展名改为 .txt 或者 .bkp,那你的方法就不灵了。为了发现并排除音频或者视频文件,你需要先检查文件类型。以下 shell 脚本可以代你完成类型检查: #!/bin/bash # 把需要进行备份的目录传递给 $1 参数. DIR=$1 - #排除文件类型中包含了 mpeg 字符串的文件,然后创建 tarball 并进行压缩。 + # 排除文件类型中包含了 mpeg 字符串的文件,然后创建 tarball 并进行压缩。 # -若文件类型中包含 mpeg 字符串, $?(最后执行的命令的退出状态)返回 0,然后文件名被定向到排除选项。否则返回 1。 # -若 $? 等于 0,该文件从需要备份文件的列表排除。 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) -排除文件进行备份 +*排除文件进行备份* **使用 tar 保持文件的原有权限进行恢复** @@ -228,7 +135,7 @@ Gzip 是最古老的压缩工具,压缩率最小,bzip2 的压缩率稍微高 ![Restore Files from tar Archive](http://www.tecmint.com/wp-content/uploads/2014/10/Restore-tar-Backup-Files.png) -从归档文件中恢复 +*从归档文件中恢复* **扩展阅读:** @@ -243,31 +150,31 @@ find 命令用于递归搜索目录树中包含指定字符的文件和目录, #### 基本语法:#### -# find [需搜索的目录] [表达式] + # find [需搜索的目录] [表达式] **通过文件大小递归搜索文件** -以下命令会搜索当前目录(.)及其下两层子目录(-maxdepth 3,包含当前目录及往下两层的子目录)大于 2 MB(-size +2M)的所有文件(-f)。 +以下命令会搜索当前目录(.)及其下两层子目录(-maxdepth 3,包含当前目录及往下两层的子目录)中大于 2 MB(-size +2M)的所有文件(-f)。 # 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) - -通过文件大小搜索文件 +* +通过文件大小搜索文件* **搜索符合一定规则的文件并将其删除** -有时候,777 权限的文件通常为外部攻击者打开便利之门。不管是以何种方式,让所有人都可以对文件进行任意操作都是不安全的。对此,我们采取一个相对激进的方法——删除这些文件(‘{ }’用来“聚集”搜索的结果)。 +有时候,777 权限的文件通常为外部攻击者打开便利之门。不管是以何种方式,让所有人都可以对文件进行任意操作都是不安全的。对此,我们采取一个相对激进的方法——删除这些文件('{}' + 用来“聚集”搜索的结果)。 # 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) -搜索 777 权限的文件 +*搜索 777 权限的文件* **按访问时间和修改时间搜索文件** -搜索 /etc 目录下访问时间(-atime)或修改时间(-mtime)大于或小于 6 个月或者刚好 6 个月的配置文件。 +搜索 /etc 目录下访问时间(-atime)或修改时间(-mtime)大于(+180)或小于(-180) 6 个月或者刚好(180) 6 个月的配置文件。 按照下面例子对命令进行修改: @@ -275,7 +182,7 @@ find 命令用于递归搜索目录树中包含指定字符的文件和目录, ![Find Files by Modification Time](http://www.tecmint.com/wp-content/uploads/2014/10/Find-Modified-Files.png) -按修改时间搜索文件 +*按修改时间搜索文件* - 扩展阅读: [35 Practical Examples of Linux ‘find’ Command][3] @@ -301,11 +208,11 @@ new_mode 可以是 3 位八进制数值或者对应权限的表达式。 八进制数值可以从二进制数值进行等值转换,通过下列方法来计算文件属主、同组用户和其他用户权限对应的二进制数值: -一个确定权限的二进制数值表现为 2 的幂(r=2^2,w=2^1,x=2^0),当权限省缺时,二进制数值为 0。如下: +一个确定权限的二进制数值表现为 2 的幂(r=2\^2,w=2\^1,x=2\^0),当权限省缺时,二进制数值为 0。如下: ![Linux File Permissions](http://www.tecmint.com/wp-content/uploads/2014/10/File-Permissions.png) -文件权限 +*文件权限* 使用八进制数值设置上图的文件权限,请输入: @@ -313,7 +220,6 @@ new_mode 可以是 3 位八进制数值或者对应权限的表达式。 通过 u、g 和 o 分别代表用户、同组用户和其他用户,然后你也可以使用权限表达式来单独对用户设置文件的权限模式。也可以通过 a 代表所有用户,然后设置文件权限。通过 + 号或者 - 号相应的赋予或移除文件权限。 - **为所有用户撤销一个 shell 脚本的执行权限** 正如之前解释的那样,我们可以通过 - 号为需要移除权限的属主、同组用户、其他用户或者所有用户去掉指定的文件权限。下面命令中的短横线(-)可以理解为:移除(-)所有用户(a)的 backup.sh 文件执行权限(x)。 @@ -324,11 +230,13 @@ new_mode 可以是 3 位八进制数值或者对应权限的表达式。 当我们使用 3 位八进制数值为文件设置权限的时候,第一位数字代表属主权限,第二位数字代表同组用户权限,第三位数字代表其他用户的权限: -- 属主:(r=2^2 + w=2^1 + x=2^0 = 7) -- 同组用户:(r=2^2 + w=2^1 + x=2^0 = 7) -- 其他用户:(r=2^2 + w=0 + x=0 = 4), +- 属主:(r=2\^2 + w=2\^1 + x=2\^0 = 7) +- 同组用户:(r=2\^2 + w=2\^1 + x=2\^0 = 7) +- 其他用户:(r=2\^2 + w=0 + x=0 = 4) - # chmod 774 myfile +命令如下: + + # chmod 774 myfile 随着练习时间的推移,你会知道何种情况下使用哪种方式来更改文件的权限模式的效果最好。 @@ -336,7 +244,7 @@ new_mode 可以是 3 位八进制数值或者对应权限的表达式。 ![Linux File Listing](http://www.tecmint.com/wp-content/uploads/2014/10/Linux-File-Listing.png) -列举 Linux 文件 +*列举 Linux 文件* 通过 chown 命令可以对文件的归属权进行更改,可以同时或者分开更改属主和属组。其基本语法为: @@ -367,9 +275,9 @@ new_mode 可以是 3 位八进制数值或者对应权限的表达式。 先行感谢! 参考链接 -- [About the LFCS][4] -- [Why get a Linux Foundation Certification?][5] -- [Register for the LFCS exam][6] +- [关于 LFCS][4] +- [为什么需要 Linux 基金会认证?][5] +- [注册 LFCS 考试][6] -------------------------------------------------------------------------------- @@ -377,7 +285,7 @@ via: http://www.tecmint.com/compress-files-and-finding-files-in-linux/ 作者:[Gabriel Cánepa][a] 译者:[GHLandy](https://github.com/GHLandy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 85227effb82d67a9591f2805c36f037bc5e5f0be Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 30 Mar 2016 08:25:36 +0800 Subject: [PATCH 0576/1469] PUB:20151116 Linux FAQs with Answers--How to install Node.js on Linux @strugglingyouth --- ...s with Answers--How to install Node.js on Linux.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) rename {translated/tech => published}/20151116 Linux FAQs with Answers--How to install Node.js on Linux.md (76%) diff --git a/translated/tech/20151116 Linux FAQs with Answers--How to install Node.js on Linux.md b/published/20151116 Linux FAQs with Answers--How to install Node.js on Linux.md similarity index 76% rename from translated/tech/20151116 Linux FAQs with Answers--How to install Node.js on Linux.md rename to published/20151116 Linux FAQs with Answers--How to install Node.js on Linux.md index 8ccca22632..6482a87d2c 100644 --- a/translated/tech/20151116 Linux FAQs with Answers--How to install Node.js on Linux.md +++ b/published/20151116 Linux FAQs with Answers--How to install Node.js on Linux.md @@ -1,12 +1,12 @@ -Linux 有问必答 - 如何在 Linux 上安装 Node.js +Linux 有问必答:如何在 Linux 上安装 Node.js ================================================================================ > **问题**: 如何在你的 Linux 发行版上安装 Node.js? -[Node.js][1] 是建立在谷歌的 V8 JavaScript 引擎服务器端的软件平台上。在构建高性能的服务器端应用程序上,Node.js 在 JavaScript 中已是首选方案。是什么让使用 Node.js 库和应用程序的 [庞大生态系统][2] 来开发服务器后台变得如此流行。Node.js 自带一个被称为 npm 的命令行工具可以让你轻松地安装它,进行版本控制并使用 npm 的在线仓库来管理 Node.js 库和应用程序的依赖关系。 +[Node.js][1] 是建立在谷歌的 V8 JavaScript 引擎服务器端的软件平台上。在构建高性能的服务器端应用程序上,Node.js 在 JavaScript 中已是首选方案。是什么让使用 Node.js 库和应用程序的[庞大生态系统][2]来开发服务器后台变得如此流行。Node.js 自带一个被称为 npm 的命令行工具可以让你轻松地安装它,进行版本控制并使用 npm 的在线仓库来管理 Node.js 库和应用程序的依赖关系。 -在本教程中,我将介绍 **如何在主流 Linux 发行版上安装 Node.js,包括Debian,Ubuntu,Fedora 和 CentOS** 。 +在本教程中,我将介绍 **如何在主流 Linux 发行版上安装 Node.js,包括 Debian,Ubuntu,Fedora 和 CentOS** 。 -Node.js 在一些发行版上作为预构建的程序包(如,Fedora 或 Ubuntu),而在其他发行版上你需要源码安装。由于 Node.js 发展比较快,建议从源码安装最新版而不是安装一个过时的预构建的程序包。最新的 Node.js 自带 npm(Node.js 的包管理器),让你可以轻松的安装 Node.js 的外部模块。 +Node.js 在一些发行版上有预构建的程序包(如,Fedora 或 Ubuntu),而在其他发行版上你需要通过源码安装。由于 Node.js 发展比较快,建议从源码安装最新版而不是安装一个过时的预构建的程序包。最新的 Node.js 自带 npm(Node.js 的包管理器),让你可以轻松的安装 Node.js 的外部模块。 ### 在 Debian 上安装 Node.js on ### @@ -64,7 +64,6 @@ Node.js 被包含在 Fedora 的 base 仓库中。因此,你可以在 Fedora ### 在 Arch Linux 上安装 Node.js ### -Node.js is available in the Arch Linux community repository. Thus installation is as simple as running: Node.js 在 Arch Linux 的社区库中可以找到。所以安装很简单,只要运行: @@ -82,7 +81,7 @@ via: http://ask.xmodulo.com/install-node-js-linux.html 作者:[Dan Nanni][a] 译者:[strugglingyou](https://github.com/strugglingyou) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From fdaa767a4ccf3ae2b0e7bc701c299ba57165fb91 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 30 Mar 2016 08:36:10 +0800 Subject: [PATCH 0577/1469] PUB:20160318 ownCloud Pi Device to Run on Snappy Ubuntu Core 16.04 LTS and Raspberry Pi 3 @geekpi --- ...buntu Core 16.04 LTS and Raspberry Pi 3.md | 36 ++++++++++++++++++ ...buntu Core 16.04 LTS and Raspberry Pi 3.md | 37 ------------------- 2 files changed, 36 insertions(+), 37 deletions(-) create mode 100644 published/20160318 ownCloud Pi Device to Run on Snappy Ubuntu Core 16.04 LTS and Raspberry Pi 3.md delete mode 100644 translated/tech/20160318 ownCloud Pi Device to Run on Snappy Ubuntu Core 16.04 LTS and Raspberry Pi 3.md diff --git a/published/20160318 ownCloud Pi Device to Run on Snappy Ubuntu Core 16.04 LTS and Raspberry Pi 3.md b/published/20160318 ownCloud Pi Device to Run on Snappy Ubuntu Core 16.04 LTS and Raspberry Pi 3.md new file mode 100644 index 0000000000..d49e0ef0f7 --- /dev/null +++ b/published/20160318 ownCloud Pi Device to Run on Snappy Ubuntu Core 16.04 LTS and Raspberry Pi 3.md @@ -0,0 +1,36 @@ +ownCloud Pi 设备将运行在 Snappy Ubuntu Core 16.04 LTS 及树莓派3上 +=============================================================================== + + +我们去年[报道了][1] ownCloud 正与西部数据(Western Digital)实验室沟通,帮助他们开发一个社区项目,将给用户带来可以在家中自托管的云存储设备。 + +自托管设备背后的理念,是由 ownCloud 服务端软件承载的,它结合了树莓派和西数硬盘到一个易安装和开箱即用的容器中。 + +社区的反应看上去很积极,ownCloud Pi 项目收到了许多好的提议和点子。今天,我们收到了一个更好的消息,首个镜像可以[下载][2]了。 + +ownCloud Pi 基于最新的 Snappy Ubuntu Core 16.04 LTS 系统,它由 Canonical 为嵌入式和 物联网(Internet of Things)设备所设计,包括新的树莓派3 Model B。 + +ownCloud 的开发者在今天的[声明][3]中称:“我们正在寻求来自 ownCloud、Ubuntu、树莓派和西数实验室等社区的帮助来测试和提高它们,并且可以在下周发布首批30台设备”。 + +### 目前的阻碍、挑战及前进的路 + +目前团队正致力于在基于 Xenial Xerus 版本的 Snappy Ubuntu 内核上完成他们的 ownCloud Pi 设备方案。这样,新的64位树莓派3可以帮助它们克服之前在树莓派2上遇到的阻碍,比如支持大于2GB的文件。 + +由此看来,最终的 ownCloud Pi 将在今年春天发布预览版,它将会在树莓派3上运行。之后,我们应该就可以购买首批可用于产品环境版本的 ownCloud Pi 设备了。 + +-------------------------------------------------------------------------------- + +via: http://news.softpedia.com/news/owncloud-pi-device-to-run-on-snappy-ubuntu-core-16-04-lts-and-raspberry-pi-3-501904.shtml + +作者:[Marius Nestor][a] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://news.softpedia.com/editors/browse/marius-nestor +[1]: http://news.softpedia.com/news/owncloud-partnerships-with-wd-to-bring-self-hosted-cloud-storage-in-users-homes-497512.shtml +[2]: http://people.canonical.com/~kyrofa/owncloud-pi/ +[3]: https://owncloud.org/blog/wd-labs-raspberry-pi-owncloud-and-ubuntu/ + + diff --git a/translated/tech/20160318 ownCloud Pi Device to Run on Snappy Ubuntu Core 16.04 LTS and Raspberry Pi 3.md b/translated/tech/20160318 ownCloud Pi Device to Run on Snappy Ubuntu Core 16.04 LTS and Raspberry Pi 3.md deleted file mode 100644 index 7b65226250..0000000000 --- a/translated/tech/20160318 ownCloud Pi Device to Run on Snappy Ubuntu Core 16.04 LTS and Raspberry Pi 3.md +++ /dev/null @@ -1,37 +0,0 @@ -ownCloud Pi设备将在Snappy Ubuntu Core 16.04 LTS及树莓派3中运行 -=============================================================================== - -关键词 : ownCloud Pi , Snappy Ubuntu Core 16.04 LTS , Raspberry Pi 3 , Western Digital , PiDrive - -### 我们去年[报道了][1] ownCloud正与西部数据(ownCloud)实验室交谈帮助他们开发一个社区项目,可以在家自托管的云存储设备。 - -自托管设备背后的理念,是由ownCloud服务端软件承载的,它结合了树莓派和西数硬盘到一个易安装和开箱即用的容器中。 - -社区的反应看上去很积极,ownCloud Pi收到了许多好的提议和点子。今天,我们收到了一个更好的消息,首个镜像可以[下载][2]了。 - -ownCloud Pi基于最新的Snappy Ubuntu Core 16.04 LTS系统,它由Canonical为嵌入式和IoT(Internet of Things)及新的树莓派3 Model B设计。 - -ownCloud的开发者在今天的[声明][3]中称:“我们正在寻求ownCloud、Ubuntu、树莓派和西数实验室的帮助来帮助测试和提高它们,并且可以在下周发布首批30台设备”。 - -### 目前的阻碍、挑战及前进的路 - -目前团队正致力于在基于Xenial Xerus版本的Snappy Ubuntu内核上完成他们的ownCloud Pi设备方案。那么,新的64位树莓派3可以帮助它们克服之前在树莓派2上遇到的阻碍,比如支持大于2GB的文件。 - -由此看来决定已经有了,最终的ownCloud Pi将在今年春天发布预览版,它将会在树莓派3上运行。之后,我们应该就可以购买首批生产就绪版本的ownCloud Pi设备了。 - --------------------------------------------------------------------------------- - -via: http://news.softpedia.com/news/owncloud-pi-device-to-run-on-snappy-ubuntu-core-16-04-lts-and-raspberry-pi-3-501904.shtml - -作者:[Marius Nestor][a] -译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://news.softpedia.com/editors/browse/marius-nestor -[1]: http://news.softpedia.com/news/owncloud-partnerships-with-wd-to-bring-self-hosted-cloud-storage-in-users-homes-497512.shtml -[2]: http://people.canonical.com/~kyrofa/owncloud-pi/ -[3]: https://owncloud.org/blog/wd-labs-raspberry-pi-owncloud-and-ubuntu/ - - From 0275663dda81c2ffded4966a4617bbe27bce7051 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 30 Mar 2016 08:47:34 +0800 Subject: [PATCH 0578/1469] PUB:20160320 UbuntuBSD Brings Ubuntu And FreeBSD Together @name1e5s --- ...uBSD Brings Ubuntu And FreeBSD Together.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) rename {translated/tech => published}/20160320 UbuntuBSD Brings Ubuntu And FreeBSD Together.md (59%) diff --git a/translated/tech/20160320 UbuntuBSD Brings Ubuntu And FreeBSD Together.md b/published/20160320 UbuntuBSD Brings Ubuntu And FreeBSD Together.md similarity index 59% rename from translated/tech/20160320 UbuntuBSD Brings Ubuntu And FreeBSD Together.md rename to published/20160320 UbuntuBSD Brings Ubuntu And FreeBSD Together.md index 19b1118194..259fc347d1 100644 --- a/translated/tech/20160320 UbuntuBSD Brings Ubuntu And FreeBSD Together.md +++ b/published/20160320 UbuntuBSD Brings Ubuntu And FreeBSD Together.md @@ -3,29 +3,29 @@ ![](http://itsfoss.com/wp-content/uploads/2016/03/UbuntuBSD.jpg) -不止是在 [Linux][1] 的内核上面你才能体验到 Ubuntu 的快捷方便,伙计们。UbuntuBSD 可以让你在 FreeBSD 的内核上面也能体验到那种方便快捷。 +不止是在 Linux 的内核上面你才能体验到 Ubuntu 的快捷方便,伙计们。UbuntuBSD 可以让你在 FreeBSD 的内核上面也能体验到那种方便快捷。 -UbuntuBSD 称自己是‘Unix for human beings’,这一点也不人惊讶。如过你能想起来的话,Ubuntu 使用的标语是‘Linux for human beings’并且在过去的 11 年里它确实让一个‘正常人’有可能用上 Linux。 +UbuntuBSD 称自己是 ‘Unix for human beings’,这一点也不人惊讶。如过你能想起来的话,Ubuntu 使用的标语是 ‘Linux for human beings’ 并且在过去的 11 年里它确实让一个‘正常人’有可能用上 Linux。 -UbuntuBSD 有着同样的想法。它想让新手能够接触到 Unix ,以及能使用它,如果我能这样说的话。至少,这就是它的目标。 +UbuntuBSD 有着同样的想法。它想让新手能够接触到 Unix ,以及能使用它——如果我能这样说的话。至少,这就是它的目标。 -### 什么是BSD ? 它和 Linux 有哪些不同? ### +### 什么是 BSD ? 它和 Linux 有哪些不同? ### -如果你是新手,那么你需要知道 [Unix和Linux的区别][2]. +如果你是新手,那么你需要知道 [Unix 和 Linux 的区别][2]. -在 Linux 出现之前,Unix 由 [AT&T][3] 的 [Ken Thompson][4], [Denis Ricthie][5] 以及他们的团队设计。这是在可以算作上古时期的 1970 发生的事。当你知道 Unix 是一个闭源的,有产权的操作系统时你可能会感到惊讶。AT&T 给了很多第三方许可,无论是学术机构还是企业。 +在 Linux 出现之前,Unix 由 [AT&T][3] 的 [Ken Thompson][4]、 [Denis Ricthie][5] 以及他们的团队设计。这是在可以算作计算机上古时期的 1970 发生的事。当你知道 Unix 是一个闭源的,有产权的操作系统时你可能会感到惊讶。AT&T 给了很多第三方许可,包括学术机构和企业。 美国加州大学伯克利分校是其中一个拿到许可的学术机构。在那里开发的 Unix 系统叫做 [BSD (Berkeley Software Distribution)][6]。BSD 的最出名的开源分支是 [FreeBSD][7],另一个最流行的闭源分支是苹果的 Mac OS X。 -在 1991 年。芬兰的计算机系大学生 Linus Torvalds 从头写了自己的 Unix 系统的复制品。这就是我们今天熟知的 Linux 内核。Linux 的发行版在内核的基础上添加了图形界面,GNU 的那一套(cp, mv, ls,date, bash 什么的),安装/管理工具,GNU C/C++ 编译器以及很多应用。 +在 1991 年。芬兰的计算机系大学生 Linus Torvalds 从头写了自己的 Unix 系统的复制品。这就是我们今天熟知的 Linux 内核。Linux 的发行版在内核的基础上添加了图形界面、GNU 的那一套(cp, mv, ls,date, bash 什么的)、安装/管理工具,GNU C/C++ 编译器以及很多应用。 ### UbuntuBSD 不是这种发行版的开端 在你知道了 Linux,Unix,FreeBSD 之间的区别之后。我要告诉你的是 UbuntuBSD 不是第一个要在 FreeBSD 内核上作出类似 Linux 的感觉的发行版。 -当 Debian 选择使用 [systemd][8] 之后,[Debian GNU/kFreeBSD][9]诞生了。它使用的不是通常的Linux内核,而是 Debian 在 FreeBSD 内核上的移植。 +当 Debian 选择使用 [systemd][8] 之后,[Debian GNU/kFreeBSD][9]诞生了。它使用的不是通常的 Linux 内核,而是 将 Debian 移植到了 FreeBSD 内核上。 -与Debian GNU/kFreeBSD 类似,UbuntuBSD 是 Ubuntu 在 FreeBSD 内核上的移植。 +与 Debian GNU/kFreeBSD 类似,UbuntuBSD 是将 Ubuntu 移植到了 FreeBSD 内核上。 ### UbuntuBSD Beta 版代号: Escape From SystemD @@ -35,7 +35,7 @@ UbuntuBSD 的第一个版本已经发布,代号为“Escape From SystemD ” ### 想试试? -我不建议任何人马上就去高兴的尝试这个系统。它仍在开发并且安装器还是文本界面的。如果你足够自信的话,直接去下载体验吧。但是如果你是新手的话,请等一段时间,至少不要现在就去尝试: +我不建议任何人马上就去开心地去尝试这个系统。它仍在开发并且安装器还是文本界面的。不过如果你足够自信的话,直接去下载体验吧。但是如果你是新手的话,请等一段时间,至少不要现在就去尝试: [UbuntuBSD][12] @@ -47,13 +47,13 @@ via: http://itsfoss.com/ubuntubsd-ubuntu-freebsd/ 作者:[ABHISHEK][a] 译者:[name1e5s](https://github.com/name1e5s) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://itsfoss.com/author/abhishek/ [1]: http://itsfoss.com/tag/linux/ -[2]: http://www.cyberciti.biz/faq/what-is-the-difference-between-linux-and-unix/ +[2]: https://linux.cn/article-3159-1.html [3]: https://en.wikipedia.org/wiki/AT%26T [4]: https://en.wikipedia.org/wiki/Ken_Thompson [5]: https://en.wikipedia.org/wiki/Dennis_Ritchie From a3ade2a9582d2364c045af11a1c607c822a8778a Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 1 Apr 2016 09:46:55 +0800 Subject: [PATCH 0579/1469] translating --- ... a tiny 64-bit ARM processor for the Internet of Things.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sources/tech/20160221 NXP unveils a tiny 64-bit ARM processor for the Internet of Things.md b/sources/tech/20160221 NXP unveils a tiny 64-bit ARM processor for the Internet of Things.md index 2acebc8473..1740b261e2 100644 --- a/sources/tech/20160221 NXP unveils a tiny 64-bit ARM processor for the Internet of Things.md +++ b/sources/tech/20160221 NXP unveils a tiny 64-bit ARM processor for the Internet of Things.md @@ -1,3 +1,5 @@ +Translating---geekpi + NXP unveils a tiny 64-bit ARM processor for the Internet of Things ========================================================================= @@ -35,3 +37,5 @@ via: http://venturebeat.com/2016/02/21/nxp-unveils-a-small-and-tiny-64-bit-arm-p [3]:http://venturebeat.com/tag/nxp/ [4]:http://venturebeat.com/tag/nxp-semiconductors/ [5]:http://www.nxp.com/ + + From b4c41e07069d2a30d687bdc0bc4735d58225849d Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 1 Apr 2016 10:25:52 +0800 Subject: [PATCH 0580/1469] translated --- ...RM processor for the Internet of Things.md | 41 ------------------- ...RM processor for the Internet of Things.md | 39 ++++++++++++++++++ 2 files changed, 39 insertions(+), 41 deletions(-) delete mode 100644 sources/tech/20160221 NXP unveils a tiny 64-bit ARM processor for the Internet of Things.md create mode 100644 translated/tech/20160221 NXP unveils a tiny 64-bit ARM processor for the Internet of Things.md diff --git a/sources/tech/20160221 NXP unveils a tiny 64-bit ARM processor for the Internet of Things.md b/sources/tech/20160221 NXP unveils a tiny 64-bit ARM processor for the Internet of Things.md deleted file mode 100644 index 1740b261e2..0000000000 --- a/sources/tech/20160221 NXP unveils a tiny 64-bit ARM processor for the Internet of Things.md +++ /dev/null @@ -1,41 +0,0 @@ -Translating---geekpi - -NXP unveils a tiny 64-bit ARM processor for the Internet of Things -========================================================================= - -**TAGS**:[ARM][1], [INTERNET OF THINGS][2], [NXP][3], [NXP SEMICONDUCTORS][4] - -![](http://1u88jj3r4db2x4txp44yqfj1.wpengine.netdna-cdn.com/wp-content/uploads/2016/02/nxp-930x556.jpg) - -[NXP Semiconductors][5] has unveiled what it calls the world’s smallest and lowest-power 64-bit ARM processor for the Internet of Things (IoT). - -The tiny QorIQ LS1012A delivers networking-grade security and performance acceleration to battery-powered, space-constrained applications. This includes powering applications for Internet of Things, or everyday objects that are smart and connected. If IoT is to reach its potential of $1.7 trillion by 2020 (as estimated by market researcher IDC), it’s going to need processors like the new one from NXP, which was unveiled at the Embedded World 2016 event in Nuremberg, Germany. - -The chip has a 64-bit ARMv8 processor with network packet acceleration and built-in security. It fits in a 9.6 mm-square space and draws about 1 watt of power. Potential applications include next-generation IoT gateways, portable entertainment platforms, high-performance portable storage applications, mobile hard disk drives, and mobile storage for cameras, tablets, and other rechargeable devices. - -Additionally, the LS1012A is the first processor designed specifically for an emerging new storage solution, dubbed object-based storage. Object-based storage relies on a smart hard disk drive that is directly connected to the data center’s Ethernet network. The processor must be small enough to be integrated directly on the circuit board for a hard disk drive. - -“The groundbreaking combination of low power, tiny footprint and networking-grade performance of NXP’s LS1012 processor is ideal for consumer, networking and Internet of Things applications alike,” said Tareq Bustami, senior vice president and general manager of NXP’s Digital Networking division, in a statement. “This unique blend of capabilities unleashes embedded systems designers and developers to imagine and create radically innovative end-products across a broad spectrum of high-growth markets.” - -NXP said it is the only 1-watt, 64-bit processor in the market to combine such a comprehensive set of high-speed peripherals in a single chip, thus enabling lower system-level costs. And due to innovative packaging, the processor can be routed on low-cost circuit boards. - -NXP’s LS1012A will be available in April 2016 and can be ordered now. NXP has more than 45,000 employees in 35 countries. - --------------------------------------------------------------------------------- - -via: http://venturebeat.com/2016/02/21/nxp-unveils-a-small-and-tiny-64-bit-arm-processor-for-the-internet-of-things/ - -作者:[DEAN TAKAHASHI][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://venturebeat.com/author/dean-takahashi/ -[1]:http://venturebeat.com/tag/arm/ -[2]:http://venturebeat.com/tag/internet-of-things/ -[3]:http://venturebeat.com/tag/nxp/ -[4]:http://venturebeat.com/tag/nxp-semiconductors/ -[5]:http://www.nxp.com/ - - diff --git a/translated/tech/20160221 NXP unveils a tiny 64-bit ARM processor for the Internet of Things.md b/translated/tech/20160221 NXP unveils a tiny 64-bit ARM processor for the Internet of Things.md new file mode 100644 index 0000000000..6711f5d4a6 --- /dev/null +++ b/translated/tech/20160221 NXP unveils a tiny 64-bit ARM processor for the Internet of Things.md @@ -0,0 +1,39 @@ +NXP 揭幕了一块超小型物联网64位ARM处理器 +========================================================================= + +**标签**:[ARM][1], [物联网][2], [NXP][3], [NXP 半导体][4] + +![](http://1u88jj3r4db2x4txp44yqfj1.wpengine.netdna-cdn.com/wp-content/uploads/2016/02/nxp-930x556.jpg) + +[NXP 半导体][5]揭幕了一块声称世界上最小的用于物联网(IoT)的低功耗64位ARM处理器。 + +这片小型的QorIQ LS1012A为电池供电,大小受限的应用提供了网络级的安全和性能加速。这包括了运行物联网应用,或者任何智能及可连接的设备。如果物联网能在2020达到1.7万亿美金的潜力(由IDC研究员估算市场得出),那么它将需要像NXP这样的处理器,该处理器在德国纽伦堡的Embedded World 2016 上揭开了什么的面纱。 + +该芯片带有64位ARMv8芯片,拥有网络包加速及内置的安全。它占用9.6平方毫米的空间,并且大约消耗1瓦特的电力。潜在的应用包括下一代的物联网网关、可携带娱乐平台、高性能可携带存储应用、移动硬盘、相机的移动存储、平板及其他可充电的设备。 + +除此之外,LS1012A是第一款为新起的基于对象的存储方案设计的处理器,基于对象存储基于智能硬盘,它直接连接到以太网数据中心。处理器必须足够小才能直接集成在硬盘的集成电路上。 + +NXP的高级副总裁及数字网络部的经理Tareq Bustami说:“低功耗、占用空间小及网络级性能这些突破性组合的NXP LS1012处理器是消费者、物联网相关应用的理想选择。独有的混合能力解放了物联网设计者及开发者使得他们可以在这个高增长的市场中想象并创造更多创新产品。” + +NXP说这是唯一一个能够结合全面的高速外围在一个芯片中的1瓦特、64位处理器,这意味着低系统功耗。归功于创新的封装,该处理器可以在低成本的电路板中布线。 + +NXP的LS1012A可以在2016年4月开始发货,并且现在可以订货。NXP在全球35个国家拥有超过4,5000名员工。 + +-------------------------------------------------------------------------------- + +via: http://venturebeat.com/2016/02/21/nxp-unveils-a-small-and-tiny-64-bit-arm-processor-for-the-internet-of-things/ + +作者:[DEAN TAKAHASHI][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://venturebeat.com/author/dean-takahashi/ +[1]:http://venturebeat.com/tag/arm/ +[2]:http://venturebeat.com/tag/internet-of-things/ +[3]:http://venturebeat.com/tag/nxp/ +[4]:http://venturebeat.com/tag/nxp-semiconductors/ +[5]:http://www.nxp.com/ + + From 4f36bd62ed0417cc5a63a287020b131f0c6129cc Mon Sep 17 00:00:00 2001 From: alim0x Date: Fri, 1 Apr 2016 23:53:36 +0800 Subject: [PATCH 0581/1469] [translated]23 - The history of Android --- .../23 - The history of Android.md | 61 ------------------- .../23 - The history of Android.md | 57 +++++++++++++++++ 2 files changed, 57 insertions(+), 61 deletions(-) delete mode 100644 sources/talk/The history of Android/23 - The history of Android.md create mode 100644 translated/talk/The history of Android/23 - The history of Android.md diff --git a/sources/talk/The history of Android/23 - The history of Android.md b/sources/talk/The history of Android/23 - The history of Android.md deleted file mode 100644 index f140949d7b..0000000000 --- a/sources/talk/The history of Android/23 - The history of Android.md +++ /dev/null @@ -1,61 +0,0 @@ -alim0x translating - -The history of Android -================================================================================ -![Another Play Store redesign! This one is very close to the current design and uses cards that make layout changes a piece of cake.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/get-em-Kirill.jpg) -Another Play Store redesign! This one is very close to the current design and uses cards that make layout changes a piece of cake. -Photo by Ron Amadeo - -### Out-of-cycle updates—who needs a new OS? ### - -In between Android 4.2 and 4.3, Google went on an out-of-cycle update tear and showed just how much Android could be improved without having to fire up the arduous OTA update process. Thanks to the [Google Play Store and Play Services][1], all of these updates were able to be delivered without updating any core system components. - -In April 2013, Google released a major redesign to the Google Play Store. Like most redesigns from here on out, the new Play Store fully adopted the Google Now aesthetic, with white cards on a gray background. The action bar changed color based on the current content section, and since the first screen featured content from all sections of the store, the action bar was a neutral gray. Buttons to navigate to the content sections were now given top billing, and below that was usually a promotional block or rows of recommended apps. - -In April 2013, Google released a major redesign to the Google Play Store. Like most redesigns from here on out, the new Play Store fully adopted the Google Now aesthetic, with white cards on a gray background. The action bar changed color based on the current content section, and since the first screen featured content from all sections of the store, the action bar was a neutral gray. Buttons to navigate to the content sections were now given top billing, and below that was usually a promotional block or rows of recommended apps. - -![The individual content sections are beautifully color-coded.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/content-rainbow.jpg) -The individual content sections are beautifully color-coded. -Photo by Ron Amadeo - -The new Play Store showed off the real power of Google’s card design language, which enabled a fully responsive layout across all screen sizes. One large card could be stuck next to several little cards, larger-screened devices could show more cards, and rather than stretch things in horizontal mode, more cards could just be added to a row. The Play Store content editors were free to play with the layout of the cards, too; a big release that needed to be highlighted could get a larger card. This design would eventually trickle down to the other Google Play content apps, finally resulting in a unified design. - -![Hangouts replaced Google Talk and is now continually developed by the Google+ team.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/talkvhangouts2.jpg) -Hangouts replaced Google Talk and is now continually developed by the Google+ team. -Photo by Ron Amadeo - -Google I/O, the company's annual developer conference, was usually where a new Android version was announced. But at the 2013 edition, Google made just as many improvements without having to update the OS. - -One of the biggest things announced at the show was an update to Google Talk, Google's instant messaging platform. For a long time, Google shipped four text communication apps for Android: Google Talk, Google+ Messenger, Messaging (the SMS app), and Google Voice. Having four apps that accomplished the same task—sending a text message to someone—was very confusing for users. At I/O, Google killed Google Talk and started their messaging product over from scratch, creating [Google Hangouts][2]. While initially it only replaced Google Talk, the plan for Hangouts was to unify all of Google's various messaging apps into a single interface. - -The layout of the Hangouts UI really wasn't drastically different from Google Talk. The main page contained your open conversations, and tapping on one opened a chat page. The design was updated, the chat page now used a card-style display for each paragraph, and the chat list was now a "drawer"-style interface, meaning you could open it with a horizontal swipe. Hangouts had read receipts and a typing status indicator, and group chat was now a primary feature. - -Google+ was the center of Hangouts now, so much so that the full name of the product was actually "Google+ Hangouts." Hangouts was completely integrated with the Google+ desktop site so that video and chats could be made from one to the other. Identity and avatars were pulled from Google+, and tapping on an avatar would open that person's Google+ profile. And much like the change from Browser to Google Chrome, core Android functionality was passed off to a separate team—the Google+ team—as opposed to being a side product of the very busy Android engineers. With the Google+ takeover, Android's main IM client now became a continually developed application. It was placed into the Play Store and received fairly regular updates. - -![The new navigation drawer interface.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/navigation_drawer_overview1.png) -The new navigation drawer interface. -Photo by [developer.android.com][3] - -Google also introduced a new design element for the action bar: the navigation drawer. This drawer was shown as a set of three lines next to the app icon in the top-right corner. By tapping on it or dragging from the edge of the screen to the right, a side-mounted menu would appear. As the name implies, this was used to navigate around the app, and it would show several top-level locations within the app. This allowed the first screen to show content, and it gave users a consistent, easy-to-access place for navigation elements. The nav drawer was basically a super-sized version of the normal menu, scrollable and docked to the right side. - ----------- - -![Ron Amadeo](http://cdn.arstechnica.net/wp-content//uploads/authors/ron-amadeo-sq.jpg) - -[Ron Amadeo][a] / Ron is the Reviews Editor at Ars Technica, where he specializes in Android OS and Google products. He is always on the hunt for a new gadget and loves to rip things apart to see how they work. - -[@RonAmadeo][t] - --------------------------------------------------------------------------------- - -via: http://arstechnica.com/gadgets/2014/06/building-android-a-40000-word-history-of-googles-mobile-os/23/ - -译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[1]:http://arstechnica.com/gadgets/2013/09/balky-carriers-and-slow-oems-step-aside-google-is-defragging-android/ -[2]:http://arstechnica.com/information-technology/2013/05/hands-on-with-hangouts-googles-new-text-and-video-chat-architecture/ -[3]:https://developer.android.com/design/patterns/navigation-drawer.html -[a]:http://arstechnica.com/author/ronamadeo -[t]:https://twitter.com/RonAmadeo diff --git a/translated/talk/The history of Android/23 - The history of Android.md b/translated/talk/The history of Android/23 - The history of Android.md new file mode 100644 index 0000000000..a6693ee6ec --- /dev/null +++ b/translated/talk/The history of Android/23 - The history of Android.md @@ -0,0 +1,57 @@ +安卓编年史 +================================================================================ +![Play 商店又一次重新设计!这一版非常接近现在的设计,卡片结构让改变布局变得易如反掌。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/get-em-Kirill.jpg) +Play 商店又一次重新设计!这一版非常接近现在的设计,卡片结构让改变布局变得易如反掌。 +Ron Amadeo 供图 + +### 周期外更新——谁需要一个新系统? ### + +在安卓 4.2 和安卓 4.3 之间,谷歌进行了一次周期外更新,显示了有多少安卓可以不经过费力的 OTA 更新而得到改进。得益于[谷歌 Play 商店和 Play 服务][1],这些更新可以在不更新任何系统核心组件的前提下送达。 + +2013 年 4 月,谷歌发布了谷歌 Play 商店的一个主要设计改动。就如同在这之后的大多数重新设计,新的 Play 商店完全接受了 Google Now 审美,即在灰色背景上的白色卡片。操作栏基于当前页面内容部分更改颜色,由于首屏内容以商店的各部分为主,操作栏颜色是中性的灰色。导航至内容部分的按钮指向热门付费,在那下面通常是一块促销内容或一组推荐应用。 + +![独立的内容部分有漂亮的颜色。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/content-rainbow.jpg) +独立的内容部分有漂亮的颜色。 +Ron Amadeo 供图 + +新的 Play 商店展现了谷歌卡片设计语言的真正力量,在所有的屏幕尺寸上能够拥有响应式布局。一张大的卡片能够和若干小卡片组合,大屏幕设备能够显示更多的卡片,而且相对于拉伸来适应横屏模式,可以通过在一行显示更多卡片来适应。Play 商店的内容编辑们也可以自由地使用卡片布局;需要关注的大更新可以获得更大的卡片。这个设计最终会慢慢渗透向其它谷歌 Play 内容应用,最后拥有一个统一的设计。 + +![Hangouts 取代了 Google Talk,现在仍由 Google+ 团队继续开发。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/talkvhangouts2.jpg) +Hangouts 取代了 Google Talk,现在仍由 Google+ 团队继续开发。 +Ron Amadeo 供图 + +Google I/O,谷歌的年度开发者会议,通常会宣布一个新的安卓版本。但是 2013 年的会议,谷歌只是发布了一些改进而没有系统更新。 + +谷歌宣布的大事件之一是 Google Talk 的更新,谷歌的即时消息平台。在很长一段时间里,谷歌随安卓附四个文本交流应用:Google Talk,Google+ Messenger,信息(短信应用),Google Voice。拥有四个应用来完成相同的任务——给某人发送文本消息——对用户来说很混乱。在 I/O 上,谷歌结束了 Google Talk 并且从头开始创建全新的消息产品 [Google Hangouts][2]。虽然最初只是想替代 Google Talk,Hangouts 的计划是统一所有谷歌的不同的消息应用到统一的界面下。 + +Hangouts 的用户界面布局真的和 Google Talk 没什么大的差别。主页面包含你的聊天会话,点击某一项就能进入聊天页面。界面设计上有所更新,聊天页面现在使用了卡片风格来显示每个段落,并且聊天列表是个“抽屉”风格的界面,这意味着你可以通过水平滑动打开它。Hangouts 有已读回执和输入状态指示,并且群聊现在是个主要特性。 + +Google+ 是 Hangouts 的中心,所以产品的全名实际上是“Google+ Hangouts”。Hangouts 完全整合到了 Google+ 桌面站点。身份和头像直接从 Google+ 拉取,点击头像会打开用户的 Google+ 资料。和将浏览器换为 Google Chrome 类似,核心安卓功能交给了一个单独的团队——Google+ 团队——作为对应用成为繁忙的安卓工程师的副产品的反对。随着 Google+ 团队的接手,安卓的主要即时通讯客户端现在成为一个持续开发的应用。它被放进了 Play 商店并且有稳定的更新频率。 + +![新导航抽屉界面。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/navigation_drawer_overview1.png) +新导航抽屉界面。 +图片来自 [developer.android.com][3] + +谷歌还给操作栏引入了新的设计元素:导航抽屉。这个抽屉显示为在左上角应用图标旁的三道横线。点击或从屏幕左边缘向右滑动,会出现一个侧边菜单目录。就像名字所指明的,这个是用来应用内导航的,它会显示若干应用内的顶层位置。这使得应用首屏可以用来显示内容,也给了用户一致的,易于访问的导航元素。导航抽屉基本上就是个大号的菜单,可以滚动并且固定在左侧。 + +---------- + +![Ron Amadeo](http://cdn.arstechnica.net/wp-content//uploads/authors/ron-amadeo-sq.jpg) + +[Ron Amadeo][a] / Ron是Ars Technica的评论编缉,专注于安卓系统和谷歌产品。他总是在追寻新鲜事物,还喜欢拆解事物看看它们到底是怎么运作的。 + +[@RonAmadeo][t] + +-------------------------------------------------------------------------------- + +via: http://arstechnica.com/gadgets/2014/06/building-android-a-40000-word-history-of-googles-mobile-os/23/ + +译者:[alim0x](https://github.com/alim0x) 校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[1]:http://arstechnica.com/gadgets/2013/09/balky-carriers-and-slow-oems-step-aside-google-is-defragging-android/ +[2]:http://arstechnica.com/information-technology/2013/05/hands-on-with-hangouts-googles-new-text-and-video-chat-architecture/ +[3]:https://developer.android.com/design/patterns/navigation-drawer.html +[a]:http://arstechnica.com/author/ronamadeo +[t]:https://twitter.com/RonAmadeo From 2a8397bcbce8d617486ce0fdce55025c8a69789b Mon Sep 17 00:00:00 2001 From: alim0x Date: Fri, 1 Apr 2016 23:55:33 +0800 Subject: [PATCH 0582/1469] [translating]24 - The history of Android --- .../The history of Android/24 - The history of Android.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/talk/The history of Android/24 - The history of Android.md b/sources/talk/The history of Android/24 - The history of Android.md index b95ceb29c7..3ed860adca 100644 --- a/sources/talk/The history of Android/24 - The history of Android.md +++ b/sources/talk/The history of Android/24 - The history of Android.md @@ -1,3 +1,5 @@ +alim0x traslating + The history of Android ================================================================================ ![The slick new Google Play Music app, which changed from Tron to a perfect match for the Play Store.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/Goooogleplaymusic.jpg) @@ -79,4 +81,4 @@ via: http://arstechnica.com/gadgets/2014/06/building-android-a-40000-word-histor [1]:http://live.arstechnica.com/liveblog-google-io-2013-keynote/ [2]:http://arstechnica.com/gadgets/2014/03/in-depth-with-android-wear-googles-quantum-leap-of-a-smartwatch-os/ [a]:http://arstechnica.com/author/ronamadeo -[t]:https://twitter.com/RonAmadeo \ No newline at end of file +[t]:https://twitter.com/RonAmadeo From 0a73e6b607dd6a28d93421df08da9860f94d61aa Mon Sep 17 00:00:00 2001 From: XIAOYU <1136299502@qq.com> Date: Sat, 2 Apr 2016 13:31:57 +0800 Subject: [PATCH 0583/1469] =?UTF-8?q?=E5=8F=96=E6=B6=88=E8=AE=A4=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 最近没空翻译了,取消认领。 --- ...151208 10 tools for visual effects in Linux with Kdenlive.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/sources/talk/yearbook2015/20151208 10 tools for visual effects in Linux with Kdenlive.md b/sources/talk/yearbook2015/20151208 10 tools for visual effects in Linux with Kdenlive.md index 690b2c8186..c017d22de2 100644 --- a/sources/talk/yearbook2015/20151208 10 tools for visual effects in Linux with Kdenlive.md +++ b/sources/talk/yearbook2015/20151208 10 tools for visual effects in Linux with Kdenlive.md @@ -1,5 +1,3 @@ -translating by xiaoyu33 - 10 tools for visual effects in Linux with Kdenlive ================================================================================ ![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life-uploads/kdenlivetoolssummary.png) From 8f57057b4957b609ae223973b0adc034198b3426 Mon Sep 17 00:00:00 2001 From: alim0x Date: Sat, 2 Apr 2016 23:55:41 +0800 Subject: [PATCH 0584/1469] [translating]24 - The history of Android - Part I --- .../24 - The history of Android.md | 48 +++++++++---------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/sources/talk/The history of Android/24 - The history of Android.md b/sources/talk/The history of Android/24 - The history of Android.md index 3ed860adca..fa6750d427 100644 --- a/sources/talk/The history of Android/24 - The history of Android.md +++ b/sources/talk/The history of Android/24 - The history of Android.md @@ -1,36 +1,34 @@ -alim0x traslating - -The history of Android +安卓编年史 ================================================================================ -![The slick new Google Play Music app, which changed from Tron to a perfect match for the Play Store.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/Goooogleplaymusic.jpg) -The slick new Google Play Music app, which changed from Tron to a perfect match for the Play Store. -Photo by Ron Amadeo +![漂亮的新 Google Play Music 应用,从电子风格转向完美契合 Play 商店的风格。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/Goooogleplaymusic.jpg) +漂亮的新 Google Play Music 应用,从电子风格转向完美契合 Play 商店的风格。 +Ron Amadeo 供图 -Another app update pushed out at I/O was a new Google Music app. The app was completely redesigned, finally doing away with the blue-on-blue design introduced in Honeycomb. Play Music's design was unified with the new Play Store released a few months earlier, with a responsive white card layout. Music was also one of the first major apps to take advantage of the new navigation drawer style. Along with the new app, Google launched Google Play Music All Access, an all-you-can-eat subscription service for $10 a month. Google Music now had a subscription plan, à la carte purchasing, and a cloud music locker. This version also introduced "Instant Mix," a mode where Google would cloud-compute a playlist of similar songs. +在 I/O 大会推出的另一个应用更新是 Google Music 应用。音乐应用经过了完全的重新设计,最终摆脱了蜂巢中引入的蓝底蓝色调的设计。Play Music 的设计和几个月前发布的 Play 商店一致,有着响应式的白色卡片布局。Music 同时还是最早采用新抽屉导航样式的主要应用之一。谷歌还随新应用发布了 Google Play Music All Access,每月 10 美元的包月音乐订阅服务。Google Music 现在拥有订阅计划,音乐购买,以及云端音乐存储空间。这个版本还引入了“Instant Mix”,谷歌会在云端给相似的歌曲计算出一份歌单。 -![A game showing support for Google Play Games. This lineup shows the Play Store game feature descriptions, the permissions box triggered by signing into the game, a Play Games notification, and the achievements screen.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/gooooogleplaygames.jpg) -A game showing support for Google Play Games. This lineup shows the Play Store game feature descriptions, the permissions box triggered by signing into the game, a Play Games notification, and the achievements screen. -Photo by Ron Amadeo +![一个展示对 Google Play Games 支持的游戏。上面是 Play 商店游戏特性描述,登陆游戏触发的权限对话框,Play Games 通知,以及成就界面。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/gooooogleplaygames.jpg) +一个展示对 Google Play Games 支持的游戏。上面是 Play 商店游戏特性描述,登陆游戏触发的权限对话框,Play Games 通知,以及成就界面。 +Ron Amadeo 供图 -Google also introduced "Google Play Games," a back-end service that developers could plug into their games. The service was basically an Android version of Xbox Live or Apple's Game Center. Developers could build Play Games support into their game, which would easily let them integrate achievements, leaderboards, multiplayer, matchmaking, user accounts, and cloud saves by using Google's back-end services. +谷歌还引入了“Google Play Games”,一个后端服务,开发者可以将其附加到游戏中。这项服务简单说就是安卓版的 Xbox Live 或苹果的 Game Center。开发者可以给游戏添加 Play Games 支持,这样就能通过使用谷歌的后端服务,更简单地集成成就,多人游戏,游戏匹配,用户账户以及云端存档到游戏中。 -Play Games was the start of Google's big push into gaming. Just like standalone GPS units, flip phones, and MP3 players, smartphone makers were hoping standalone gaming devices would be turned into nothing more than a smartphone feature bullet point. Why buy a Nintendo DS or PS Vita when you had a smartphone with you? An easy-to-use multiplayer service would be a big part of this, and we've still yet to see the final consequence of this move. Today, Google and Apple are both rumored to be planning living room gaming devices. +Play Games 是谷歌在游戏方面推进的开始。就像单独的 GPS 设备,翻盖手机,以及 MP3 播放器,智能手机的生产者希望游戏设备能够变成智能手机的一个功能点。当你有部智能手机的时候你为什么还有买个任天堂 DS 或 PS Vita 呢?一个易于使用的多人游戏服务是这项计划的重要部分,我们仍能看到这个决定最后的成果。在今天,坊间都在传言谷歌和苹果有关于客厅游戏设备的计划。 -![Google Keep, Google's first note taking service since Google Notebook.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/goooglekeep.jpg) -Google Keep, Google's first note taking service since Google Notebook. -Photo by Ron Amadeo +![Google Keep,谷歌自 Google Notebook 以来第一个笔记服务。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/goooglekeep.jpg) +Google Keep,谷歌自 Google Notebook 以来第一个笔记服务。 +Ron Amadeo 供图 -It was clear some products were developed in time for presentation at Google I/O, [but the three-and-a-half hour keynote][1] was already so massive, some things were cut from being announced. Once the smoke cleared three days after Google I/O, Google introduced Google Keep, a note taking app for Android and the Web. Keep was a fairly straightforward affair, applying the responsive Google Now-style design to a note taking app. Users could change the size of the cards from a multi-column layout to a single column view. Notes could consist of plain text, checklists, voice note with automatic transcription, or pictures. Note cards could be dragged around and rearranged on the main screen, and you could even assign a color to a note. +毫无疑问一些产品为了赶上 Google I/O 大会的发布准时开发完成了,[但是三个半小时内的主题][1]已经够多了,一些产品在大会的发布上忽略了。Google I/O 大会的三天后一切都清楚了,谷歌带来了 Google Keep,一个用于安卓和在线的笔记应用。Keep 看起来很简单,就是一个用上了响应式 Google-Now 风格设计的笔记应用。用户可以改变卡片的尺寸,从多栏布局改为单列视图。笔记可以由文本,清单,自动转文本的语音或者图片组成。笔记卡片可以拖动并在主界面重新组织,你甚至可以给笔记换个颜色。 -![Gmail 4.5, which switched to the new navigation drawer design and merged the action bars, thanks to some clever button elimination.](http://cdn.arstechnica.net/wp-content/uploads/2014/05/gmail.png) -Gmail 4.5, which switched to the new navigation drawer design and merged the action bars, thanks to some clever button elimination. -Photo by Ron Amadeo +![Gmail 4.5,换上了新的导航抽屉设计,去掉了几个按钮并将操作栏合并到了抽屉里。](http://cdn.arstechnica.net/wp-content/uploads/2014/05/gmail.png) +Gmail 4.5,换上了新的导航抽屉设计,去掉了几个按钮并将操作栏合并到了抽屉里。 +Ron Amadeo 供图 -After I/O, not much was safe from Google's out-of-cycle updating. In June 2013, Google released a redesigned version of Gmail. The headline feature of the new design was the new navigation drawer interface that was introduced a month earlier at Google I/O. The most eye catching change was the addition of Google+ profile pictures instead of checkboxes. While the checkboxes were visibly removed, they were still there, just tap on a picture. +在 I/O 大会之后,没有哪些应用不在谷歌的周期外更新里。2013 年 6 月,谷歌发布了新版设计的 Gmail。最显眼的变化就是一个月前 Google I/O 大会引入的新导航抽屉界面。最吸引眼球的变化是用上了 Google+ 资料图片来取代复选框。虽然复选框看起来被去掉了,它们其实还在那,点击邮件左边的图片就是了。 -![The new Google Maps, which switched to an all-white Google Now-style theme.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/newmaps11.png.) -The new Google Maps, which switched to an all-white Google Now-style theme. -Photo by Ron Amadeo +![新谷歌地图,换上了全白的 Google-Now 风格主题。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/newmaps11.png) +新谷歌地图,换上了全白的 Google-Now 风格主题。 +Ron Amadeo 供图 One month later, Google released a completely overhauled version of Google Maps to the Play Store. It was the first ground-up redesign of Google Maps since Ice Cream Sandwich. The new version fully adopted the Google Now white card aesthetic, and it greatly reduced the amount of stuff on the screen. The new Google Maps seemed to have a design mandate to always show a map on the screen somewhere, as you’ll be hard pressed to find something other than the settings that fully covers the map. @@ -38,7 +36,7 @@ This version of Google Maps seemed to live in its own little design world. The w ![The new Google Maps cut a lot of fat and displayed more information on a single screen.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/newmaps21.png) The new Google Maps cut a lot of fat and displayed more information on a single screen. -Photo by Ron Amadeo +Ron Amadeo 供图 The left picture shows what popped up when you tapped on the search bar (along with the keyboard, which had been closed). In the past, Google would show an empty page below a blank search bar, but in Maps, Google used that space to link to the new “Local" page. The “blank" search results displayed links to common, browsable results like restaurant listings, gas stations, and attractions. At the bottom of the results page was a list of nearby results from your search history and an option to manually cache parts of the map. @@ -52,7 +50,7 @@ Android 4.3 would have been an incredible update if Google had done the traditio ![Android Wear plugging into Android 4.3's Notification access screen.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/2014-03-28-12.231.jpg) Android Wear plugging into Android 4.3's Notification access screen. -Photo by Ron Amadeo +Ron Amadeo 供图 Google made no qualms about the low importance of 4.3, calling the newest release "Jelly Bean" (the third one in a row). Android 4.3's feature list read like a laundry list of things Google couldn't update from the Play Store or through Google Play Services, mostly consisting of low-level framework changes for developers. From ffc516007ccc80ba70825bf172b34f80d485c162 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 3 Apr 2016 00:25:40 +0800 Subject: [PATCH 0585/1469] =?UTF-8?q?=E9=83=A8=E5=88=86=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=EF=BC=8C=E6=9C=AA=E5=AE=8C=E6=88=90=E4=BD=9C=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...d Services SysVinit Systemd and Upstart.md | 230 ++++++++++++++++++ 1 file changed, 230 insertions(+) create mode 100644 translated/tech/LFCS/Part 7 - LFCS--Managing System Startup Process and Services SysVinit Systemd and Upstart.md diff --git a/translated/tech/LFCS/Part 7 - LFCS--Managing System Startup Process and Services SysVinit Systemd and Upstart.md b/translated/tech/LFCS/Part 7 - LFCS--Managing System Startup Process and Services SysVinit Systemd and Upstart.md new file mode 100644 index 0000000000..34e08ec0f7 --- /dev/null +++ b/translated/tech/LFCS/Part 7 - LFCS--Managing System Startup Process and Services SysVinit Systemd and Upstart.md @@ -0,0 +1,230 @@ +WingCuengRay翻译中 +翻译部分,未经自校验 +Part 7 - LFCS: Managing System Startup Process and Services (SysVinit, Systemd and Upstart) +============================================================== +几个月前,Linux 基金会发布了 LFCS (Linux Foundation Certified Sysadmin) 认证,这是一则振奋人心的消息,它的目标是让全世界各地的人们的的中级 Linux 系统管理能力得到认证。这能力包括了对处于运行状态的系统和服务的支持,发现并分析实际问题,并且知道何时向开发团队提交问题。 + +![Linux Foundation Certified Sysadmin – Part 7](http://www.tecmint.com/wp-content/uploads/2014/10/lfcs-Part-7.png) + +Linux Foundation Certified Sysadmin - Part7 + +下面的视频简单地介绍了 Linux 基金认证的流程。 + +注:youtube 视频 + +本章是10个系列教程中的第7章,在这个部分,我们会解释如何去管理 Linux 系统启动进程和服务,这是 LFCS 认证考试中必须的。 + +### Linux 启动进程的管理 ### +Linux 系统的启动进程包括了几个阶段,每一个阶段都代表了一个不同的**component**。下图简单概括了启动的流程并且展示了所有阶段的主要组成部分。 + +![Linux Boot Process](http://www.tecmint.com/wp-content/uploads/2014/10/Linux-Boot-Process.png) + + +Linux 启动流程 + +当你按下电脑上的开机按钮,装载在主板电可擦写只读存储器 (EEPROM) 中的固件 (BIOS) 会执行开机自检 (Power-On Self Test) 检查系统的硬件状态。当开机自检完成后,固件会寻找并载入位于第一块硬盘中的主引导记录 (MBR) 或者 EFI 分区中的 boot loader stage1,然后将控制权转交给它。第一阶段的 boot loader 在第一块硬盘中的主引导记录 (MBR 或者 EFI 分区中。 + +#### MBR 引导启动 #### +MBR 在 BIOS 设置的可启动硬盘的第一扇区,其大小是 512 字节。 + +- 起始 446 字节: bootloader 包括了可执行代码与错误消息文本。 +- 随后 64 字节: 分区表包括了四条硬盘分区(主分区或扩展分区)的记录。此外,每条分区记录指出了分区的状态(有效/无效),大小和每个分区的开始/结束扇区。 +- 最后 2 字节: 用于MBR校验检查的幻数 (magic number)。 + +**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) + +**恢复 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) + +在 Linux 的 MBR 恢复 + +### EFI/UFEFI 引导启动 ### +在 EFI/UEFI 引导的系统中,UEFI固件会读取其配置,根据配置决定启动哪一个 UEFI appliction,并且从哪里启动(例如,在 EFI 分区所在的磁盘)。 + +然后,第二阶段的引导程序被加载运行。GRUB[GRand Unified Boot] 是 Linux 上最流行的启动管理器。**如今有两个不同的版本供大多数的系统使用**。 + +- GRUB Legacy 配置文件: /boot/grub/menu.lst (旧版本,EFI/UEFI 不支持) +- GRUB2 配置文件: 大多数为 /etc/default/grub + +虽然 LFCS 资格认证没有明确要求了解关于 GRUB 内部知识,但如果你能勇敢地承受系统崩溃的风险(为了保险,你可能希望先在虚拟机上尝试),你可以尝试自己去修改这些文件。 + + # update-grub + +在修改完 GRUB 的配置文件后,需要以 root 权限运行以上指令让修改生效。 + +GRUB 主要加载了默认的内核和 initrd 或 initramfs 镜像。简单来说,initrd 和 initramfs 帮助进行了硬件的检测,内核模块的加载和设备的探查,**这对于挂载真正的根文件系统来说是必须的**。 + +为了得到一个用户交互界面,一旦根文件系统被挂载,内核便执行系统服务管进程 (init 或者 systemd,其进程标识或者 PID 通常是 1 )来启动正常的用户空间进程。 + +init 和 systemd 都是守护进程,因为它们是系统那个第一个启动的服务(在启动期间)和最后一个终止的服务(在关机时)。 + +![Systemd and Init](http://www.tecmint.com/wp-content/uploads/2014/10/systemd-and-init.png) + +Systemd and Init + +### 服务的启动 (SysVinit) ### +Linux 中的运行级别机制通过控制不同服务的运行来指定系统的不同使用方式。换言之,运行级别决定在当前的运行模式下哪些任务能够运行(哪些不能)。 + +基于 System V Unix 继承下来的传统,当计算机进入一个指定的运行级别时(或者说,进入一个与当前系统不同的运行级别时),系统通过传递用于控制启动和停止服务的执行脚本来执行启动进程。 + +在每一个运行级别,每一个服务能被设置为运行状态或者关闭状态(如果正在运行)。大多数发行版在最新版本中抛弃了System V的标准,支持一种新的被称为systemd的系统服务管理进程(也就是系统守护进程),不过出于兼容性考虑,systemd通常支持 sysv 命令。这意味着你能够在基本systemd发行版上运行大多数sysv int工具。 + +- 参考: [Why ‘systemd’ replaces ‘init’ in Linux][1] + +除了启动系统进程,init 还根据 /etc/inittab 文件决定必须进入哪一个运行级别。 + +注:表格 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Runlevel Description
0 挂起系统。运行级别 0 是一个用于快速关闭系统的特殊过渡态。
1 该模式也被称为 s 或 S。这个运行模式有时被叫作维护模式。根据发行版的不同,在这个运行级别启动的服务也不同。这通常用于可能被正常系统操作损坏的**low-level system maintenance(低级别系统维护)**
2 多用户模式。在 Debian 及其衍生版中,这是默认的运行级别,包括了可用的图形登陆。在基于红帽 (Red-Hat 的系统中,这是没有网络功能的多用户模式。
3  在基于 Red-Hat 的系统中,这是默认的多用户模式,此模式会运行除图形环境之外的所有东西。基于 Debian 的系统通常不使用此运行级别 4,5 和此级别。
4 默认不使用,因此可用于用户定制。
5 在基于红帽的系统,这是完整的带图形界面的多用户模式。此运行级别类似于运行级别 3,不过多了 GUI 的登陆界面。
6 重启系统
+ +我们能够使用`init` 命令在不同运行级别之间切换: `init N` (N是上面列出的运行级别之一)。注意并不推荐使用这种方法改变一个运行中系统的运行级别,因为它没有发出警告信息给已登陆用户(这会令他们工作丢失,任务异常终止)。 + +相反,应该使用`shutdown`命令重启系统(发送一条警告信息给所有的登陆用户,并阻止另外的用户登陆);然而,必须先在 /etc/inittab 文件中编辑系统启动的默认运行级别。 + +因此,以 root 权限寻找 /etc/inittab 中的下行,然后按照下列步骤正确地在运行级别之间切换: + + id:2:initdefault: + +然后使用 vim 之类文本编辑器(在本系列的第二章介绍了如何在 Linux 中使用 vi/vim 编辑器)将数字 2 改变成你想要的运行级别。 + +接下来以 root 权限运行: + + # shutdown -r now + +最后一条命令会重启系统并让其在下一次启动期间以指定的运行级别启动,然后系统会运行在 /etc/rc[runlevel].d 目录下的脚本以决定哪些服务会被启动哪些不会。例如,下图处于运行级别2的系统. + +![Change Runlevels in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Change-Runlevels-in-Linux.jpeg) + +Linux 运行级别的变更 + +## 使用 chkconfig 管理服务 + +为了在引导时启动/禁止系统服务,我们需要使用`chkconfig`(在 CentOS/openSUSE)和`sys-rc-conf`(在 Debian 及其衍生版中)命令。这工具能够告诉我们在一个特定运行级别的服务预配置状态。 + +- 参考: [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)** + +在上图中我们能够看到 `postfix` 被设置为当系统进入级别 2~5 时启动,而 `mysqld` 默认是在级别 2~4 时运行。假设这些不是我们期望的行为。 + +例如,我们也需要在运行级别 5 启动`mysqld`,并且在级别 4 和 5 中关闭 `postfix`。这是我们要做的(以 root 权限执行以下命令) + +**为一个特定的运行级别启动服务** + + # chkconfig --level [level(s)] service on + # chkconfig --level 5 mysqld on + +**为一个特定的运行级别禁止服务** + + # chkconfig --level [level(s)] service off + # chkconfig --level 45 posifix off + +![Enable Disable Services in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Enable-Disable-Services.png) + +启动禁止服务 + +我们可以使用 `sysv-rc-conf` 在基于 Debian 的系统执行类似的操作。 + +#### 使用 `sysv-rc-conf` 管理服务 + +设置一个服务使其能在一个特定的运行级别启动,禁止在其他运行级别启动。 + + +1. 我们用以下命令查看 `mdadm` 服务在哪些运行级别上启动。 +```c +# 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) + + 查看服务的运行级别 + +2. 我们使用 `sysv-rc-conf` 命令禁止 `mdadm` 在除了 2 以外的运行级别中启动。根据需要(使用空格键)选择或取消(可以使用上下左右方向键移动)。 +``` +# sys-rc-conf +``` + ![SysV Runlevel Config](http://www.tecmint.com/wp-content/uploads/2014/10/SysV-Runlevel-Config.png) + + Sys Runlevel Config + + 然后按 q 退出 + +3. 重启系统并运行第一步中的命令 + + ``` + # 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) + + 验证服务运行级别 + + 在上图中我们可以看到 `mdadm` 被修改为只在运行级别 2 上启动。 + +### 什么是 systemd ?### + +systemd 是较多 Linux 发行版采用的另一种系统服务管理软件。它允许系统启动期间进程并行启动(不像 sysinit 那么慢。因为 sysint 只能逐个启动进程,检查进程间依赖关系然后等待守护工作以启动更多服务),并且为系统动态管理资源。 + +因此,服务仅当需要时才被启动(以免浪费系统资源)而不是在引导时启动。 + +运行以下命令,查看系统中所有运行中服务进程的状态,**包括systemd native和SysV services**。 + +``` +# systemctl +``` + +![Check All Running Processes in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Check-All-Running-Processes.png) + +查看所有运行中的服务进程 From 4bf0057cc851cf87468966976916dc197233e013 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 3 Apr 2016 10:42:51 +0800 Subject: [PATCH 0586/1469] =?UTF-8?q?=E5=BD=92=E6=A1=A3201603?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- published/{ => 201603}/20150820 Why did you start using Linux.md | 0 ... Years of GNOME Design and Software Evolution--Step by Step.md | 0 .../20151027 How to Install Ghost with Nginx on FreeBSD 10.2.md | 0 ...2015--The best open source networking and security software.md | 0 ...20151104 Optimize Web Delivery with these Open Source Tools.md | 0 ... with Answers--How to install Ubuntu desktop behind a proxy.md | 0 ...o send email notifications using Gmail SMTP server on Linux.md | 0 ...0151109 Install Android On BQ Aquaris Ubuntu Phone In Linux.md | 0 ...16 Linux FAQs with Answers--How to install Node.js on Linux.md | 0 .../20151125 20 Years of GIMP Evolution--Step by Step.md | 0 published/{ => 201603}/20151204 Review EXT4 vs. Btrfs vs. XFS.md | 0 ...51215 How to Install Light Table 0.8 in Ubuntu 14.04, 15.10.md | 0 ... Fun--Summon Swarms Of Penguins To Waddle About The Desktop.md | 0 .../20160218 Best Linux Desktop Environments for 2016.md | 0 ...160218 Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04.md | 0 ...8 LTS Is the Biggest in the Series with Hundreds of Changes.md | 0 ...Mozilla contributor creates diabetes project for the masses.md | 0 .../20160218 ST Releases Free Linux IDE for 32-Bit MCUs.md | 0 .../20160220 Former Kubuntu Head Unveils New KDE Project.md | 0 .../20160220 Manjaro Linux Is Coming To ARM With Manjaro-ARM.md | 0 .../20160220 [Free Download] Vi Cheat Sheet For Beginners.md | 0 .../20160226 Development Release- Xubuntu 16.04 Beta 1.md | 0 ...with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md | 0 ...1 Million HTTPS Websites Imperiled by New Decryption Attack.md | 0 .../20160316 What we learned in Seoul with AlphaGo.md | 0 ...e to Run on Snappy Ubuntu Core 16.04 LTS and Raspberry Pi 3.md | 0 .../20160320 UbuntuBSD Brings Ubuntu And FreeBSD Together.md | 0 27 files changed, 0 insertions(+), 0 deletions(-) rename published/{ => 201603}/20150820 Why did you start using Linux.md (100%) rename published/{ => 201603}/20151020 18 Years of GNOME Design and Software Evolution--Step by Step.md (100%) rename published/{ => 201603}/20151027 How to Install Ghost with Nginx on FreeBSD 10.2.md (100%) rename published/{ => 201603}/20151028 Bossie Awards 2015--The best open source networking and security software.md (100%) rename published/{ => 201603}/20151104 Optimize Web Delivery with these Open Source Tools.md (100%) rename published/{ => 201603}/20151105 Linux FAQs with Answers--How to install Ubuntu desktop behind a proxy.md (100%) rename published/{ => 201603}/20151109 How to send email notifications using Gmail SMTP server on Linux.md (100%) rename published/{ => 201603}/20151109 Install Android On BQ Aquaris Ubuntu Phone In Linux.md (100%) rename published/{ => 201603}/20151116 Linux FAQs with Answers--How to install Node.js on Linux.md (100%) rename published/{ => 201603}/20151125 20 Years of GIMP Evolution--Step by Step.md (100%) rename published/{ => 201603}/20151204 Review EXT4 vs. Btrfs vs. XFS.md (100%) rename published/{ => 201603}/20151215 How to Install Light Table 0.8 in Ubuntu 14.04, 15.10.md (100%) rename published/{ => 201603}/20151215 Linux Desktop Fun--Summon Swarms Of Penguins To Waddle About The Desktop.md (100%) rename published/{ => 201603}/20160218 Best Linux Desktop Environments for 2016.md (100%) rename published/{ => 201603}/20160218 Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04.md (100%) rename published/{ => 201603}/20160218 Linux Kernel 4.1.18 LTS Is the Biggest in the Series with Hundreds of Changes.md (100%) rename published/{ => 201603}/20160218 Mozilla contributor creates diabetes project for the masses.md (100%) rename published/{ => 201603}/20160218 ST Releases Free Linux IDE for 32-Bit MCUs.md (100%) rename published/{ => 201603}/20160220 Former Kubuntu Head Unveils New KDE Project.md (100%) rename published/{ => 201603}/20160220 Manjaro Linux Is Coming To ARM With Manjaro-ARM.md (100%) rename published/{ => 201603}/20160220 [Free Download] Vi Cheat Sheet For Beginners.md (100%) rename published/{ => 201603}/20160226 Development Release- Xubuntu 16.04 Beta 1.md (100%) rename published/{ => 201603}/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md (100%) rename published/{ => 201603}/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md (100%) rename published/{ => 201603}/20160316 What we learned in Seoul with AlphaGo.md (100%) rename published/{ => 201603}/20160318 ownCloud Pi Device to Run on Snappy Ubuntu Core 16.04 LTS and Raspberry Pi 3.md (100%) rename published/{ => 201603}/20160320 UbuntuBSD Brings Ubuntu And FreeBSD Together.md (100%) diff --git a/published/20150820 Why did you start using Linux.md b/published/201603/20150820 Why did you start using Linux.md similarity index 100% rename from published/20150820 Why did you start using Linux.md rename to published/201603/20150820 Why did you start using Linux.md diff --git a/published/20151020 18 Years of GNOME Design and Software Evolution--Step by Step.md b/published/201603/20151020 18 Years of GNOME Design and Software Evolution--Step by Step.md similarity index 100% rename from published/20151020 18 Years of GNOME Design and Software Evolution--Step by Step.md rename to published/201603/20151020 18 Years of GNOME Design and Software Evolution--Step by Step.md diff --git a/published/20151027 How to Install Ghost with Nginx on FreeBSD 10.2.md b/published/201603/20151027 How to Install Ghost with Nginx on FreeBSD 10.2.md similarity index 100% rename from published/20151027 How to Install Ghost with Nginx on FreeBSD 10.2.md rename to published/201603/20151027 How to Install Ghost with Nginx on FreeBSD 10.2.md diff --git a/published/20151028 Bossie Awards 2015--The best open source networking and security software.md b/published/201603/20151028 Bossie Awards 2015--The best open source networking and security software.md similarity index 100% rename from published/20151028 Bossie Awards 2015--The best open source networking and security software.md rename to published/201603/20151028 Bossie Awards 2015--The best open source networking and security software.md diff --git a/published/20151104 Optimize Web Delivery with these Open Source Tools.md b/published/201603/20151104 Optimize Web Delivery with these Open Source Tools.md similarity index 100% rename from published/20151104 Optimize Web Delivery with these Open Source Tools.md rename to published/201603/20151104 Optimize Web Delivery with these Open Source Tools.md diff --git a/published/20151105 Linux FAQs with Answers--How to install Ubuntu desktop behind a proxy.md b/published/201603/20151105 Linux FAQs with Answers--How to install Ubuntu desktop behind a proxy.md similarity index 100% rename from published/20151105 Linux FAQs with Answers--How to install Ubuntu desktop behind a proxy.md rename to published/201603/20151105 Linux FAQs with Answers--How to install Ubuntu desktop behind a proxy.md diff --git a/published/20151109 How to send email notifications using Gmail SMTP server on Linux.md b/published/201603/20151109 How to send email notifications using Gmail SMTP server on Linux.md similarity index 100% rename from published/20151109 How to send email notifications using Gmail SMTP server on Linux.md rename to published/201603/20151109 How to send email notifications using Gmail SMTP server on Linux.md diff --git a/published/20151109 Install Android On BQ Aquaris Ubuntu Phone In Linux.md b/published/201603/20151109 Install Android On BQ Aquaris Ubuntu Phone In Linux.md similarity index 100% rename from published/20151109 Install Android On BQ Aquaris Ubuntu Phone In Linux.md rename to published/201603/20151109 Install Android On BQ Aquaris Ubuntu Phone In Linux.md diff --git a/published/20151116 Linux FAQs with Answers--How to install Node.js on Linux.md b/published/201603/20151116 Linux FAQs with Answers--How to install Node.js on Linux.md similarity index 100% rename from published/20151116 Linux FAQs with Answers--How to install Node.js on Linux.md rename to published/201603/20151116 Linux FAQs with Answers--How to install Node.js on Linux.md diff --git a/published/20151125 20 Years of GIMP Evolution--Step by Step.md b/published/201603/20151125 20 Years of GIMP Evolution--Step by Step.md similarity index 100% rename from published/20151125 20 Years of GIMP Evolution--Step by Step.md rename to published/201603/20151125 20 Years of GIMP Evolution--Step by Step.md diff --git a/published/20151204 Review EXT4 vs. Btrfs vs. XFS.md b/published/201603/20151204 Review EXT4 vs. Btrfs vs. XFS.md similarity index 100% rename from published/20151204 Review EXT4 vs. Btrfs vs. XFS.md rename to published/201603/20151204 Review EXT4 vs. Btrfs vs. XFS.md diff --git a/published/20151215 How to Install Light Table 0.8 in Ubuntu 14.04, 15.10.md b/published/201603/20151215 How to Install Light Table 0.8 in Ubuntu 14.04, 15.10.md similarity index 100% rename from published/20151215 How to Install Light Table 0.8 in Ubuntu 14.04, 15.10.md rename to published/201603/20151215 How to Install Light Table 0.8 in Ubuntu 14.04, 15.10.md diff --git a/published/20151215 Linux Desktop Fun--Summon Swarms Of Penguins To Waddle About The Desktop.md b/published/201603/20151215 Linux Desktop Fun--Summon Swarms Of Penguins To Waddle About The Desktop.md similarity index 100% rename from published/20151215 Linux Desktop Fun--Summon Swarms Of Penguins To Waddle About The Desktop.md rename to published/201603/20151215 Linux Desktop Fun--Summon Swarms Of Penguins To Waddle About The Desktop.md diff --git a/published/20160218 Best Linux Desktop Environments for 2016.md b/published/201603/20160218 Best Linux Desktop Environments for 2016.md similarity index 100% rename from published/20160218 Best Linux Desktop Environments for 2016.md rename to published/201603/20160218 Best Linux Desktop Environments for 2016.md diff --git a/published/20160218 Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04.md b/published/201603/20160218 Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04.md similarity index 100% rename from published/20160218 Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04.md rename to published/201603/20160218 Canonical's ZFS Plans Are Lining Up For Ubuntu 16.04.md diff --git a/published/20160218 Linux Kernel 4.1.18 LTS Is the Biggest in the Series with Hundreds of Changes.md b/published/201603/20160218 Linux Kernel 4.1.18 LTS Is the Biggest in the Series with Hundreds of Changes.md similarity index 100% rename from published/20160218 Linux Kernel 4.1.18 LTS Is the Biggest in the Series with Hundreds of Changes.md rename to published/201603/20160218 Linux Kernel 4.1.18 LTS Is the Biggest in the Series with Hundreds of Changes.md diff --git a/published/20160218 Mozilla contributor creates diabetes project for the masses.md b/published/201603/20160218 Mozilla contributor creates diabetes project for the masses.md similarity index 100% rename from published/20160218 Mozilla contributor creates diabetes project for the masses.md rename to published/201603/20160218 Mozilla contributor creates diabetes project for the masses.md diff --git a/published/20160218 ST Releases Free Linux IDE for 32-Bit MCUs.md b/published/201603/20160218 ST Releases Free Linux IDE for 32-Bit MCUs.md similarity index 100% rename from published/20160218 ST Releases Free Linux IDE for 32-Bit MCUs.md rename to published/201603/20160218 ST Releases Free Linux IDE for 32-Bit MCUs.md diff --git a/published/20160220 Former Kubuntu Head Unveils New KDE Project.md b/published/201603/20160220 Former Kubuntu Head Unveils New KDE Project.md similarity index 100% rename from published/20160220 Former Kubuntu Head Unveils New KDE Project.md rename to published/201603/20160220 Former Kubuntu Head Unveils New KDE Project.md diff --git a/published/20160220 Manjaro Linux Is Coming To ARM With Manjaro-ARM.md b/published/201603/20160220 Manjaro Linux Is Coming To ARM With Manjaro-ARM.md similarity index 100% rename from published/20160220 Manjaro Linux Is Coming To ARM With Manjaro-ARM.md rename to published/201603/20160220 Manjaro Linux Is Coming To ARM With Manjaro-ARM.md diff --git a/published/20160220 [Free Download] Vi Cheat Sheet For Beginners.md b/published/201603/20160220 [Free Download] Vi Cheat Sheet For Beginners.md similarity index 100% rename from published/20160220 [Free Download] Vi Cheat Sheet For Beginners.md rename to published/201603/20160220 [Free Download] Vi Cheat Sheet For Beginners.md diff --git a/published/20160226 Development Release- Xubuntu 16.04 Beta 1.md b/published/201603/20160226 Development Release- Xubuntu 16.04 Beta 1.md similarity index 100% rename from published/20160226 Development Release- Xubuntu 16.04 Beta 1.md rename to published/201603/20160226 Development Release- Xubuntu 16.04 Beta 1.md diff --git a/published/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md b/published/201603/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md similarity index 100% rename from published/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md rename to published/201603/20160229-OpenSSH-7.2-Out-Now-with-Support-for-RSA-Signatures-Using-SHA-256512 Algorithms.md diff --git a/published/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md b/published/201603/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md similarity index 100% rename from published/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md rename to published/201603/20160301 More than 11 Million HTTPS Websites Imperiled by New Decryption Attack.md diff --git a/published/20160316 What we learned in Seoul with AlphaGo.md b/published/201603/20160316 What we learned in Seoul with AlphaGo.md similarity index 100% rename from published/20160316 What we learned in Seoul with AlphaGo.md rename to published/201603/20160316 What we learned in Seoul with AlphaGo.md diff --git a/published/20160318 ownCloud Pi Device to Run on Snappy Ubuntu Core 16.04 LTS and Raspberry Pi 3.md b/published/201603/20160318 ownCloud Pi Device to Run on Snappy Ubuntu Core 16.04 LTS and Raspberry Pi 3.md similarity index 100% rename from published/20160318 ownCloud Pi Device to Run on Snappy Ubuntu Core 16.04 LTS and Raspberry Pi 3.md rename to published/201603/20160318 ownCloud Pi Device to Run on Snappy Ubuntu Core 16.04 LTS and Raspberry Pi 3.md diff --git a/published/20160320 UbuntuBSD Brings Ubuntu And FreeBSD Together.md b/published/201603/20160320 UbuntuBSD Brings Ubuntu And FreeBSD Together.md similarity index 100% rename from published/20160320 UbuntuBSD Brings Ubuntu And FreeBSD Together.md rename to published/201603/20160320 UbuntuBSD Brings Ubuntu And FreeBSD Together.md From cd089a6ed71ab30a3c501cd1babc58716aca88e3 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 3 Apr 2016 10:43:10 +0800 Subject: [PATCH 0587/1469] PUB:20151109 How to Configure Tripwire IDS on Debian @geekpi --- ...How to Configure Tripwire IDS on Debian.md | 51 +++++++++---------- 1 file changed, 25 insertions(+), 26 deletions(-) rename {translated/tech => published}/20151109 How to Configure Tripwire IDS on Debian.md (79%) diff --git a/translated/tech/20151109 How to Configure Tripwire IDS on Debian.md b/published/20151109 How to Configure Tripwire IDS on Debian.md similarity index 79% rename from translated/tech/20151109 How to Configure Tripwire IDS on Debian.md rename to published/20151109 How to Configure Tripwire IDS on Debian.md index 23bf8eef65..b9f134c361 100644 --- a/translated/tech/20151109 How to Configure Tripwire IDS on Debian.md +++ b/published/20151109 How to Configure Tripwire IDS on Debian.md @@ -1,39 +1,38 @@ -如何在Debian中配置Tripewire IDS +如何在 Debian 中配置 Tripewire IDS ================================================================================ -本文是一篇关于Debian中安装和配置Tripewire的文章。它是Linux环境下基于主机的入侵检测系统(IDS)。tripwire的高级功能有检测并报告任何Linux中未授权的更改(文件和目录)。tripewire安装之后,会先创建一个基本的数据库,tripewire监控并检测新文件的创建修改和谁修改了它等等。如果修改过是合法的,你可以接受修改并更新tripwire的数据库。 +本文是一篇关于 Debian 中安装和配置 Tripewire 的文章。它是 Linux 环境下基于主机的入侵检测系统(IDS)。tripwire 的高级功能有检测并报告任何 Linux 中未授权的(文件和目录)的更改。tripewire 安装之后,会先创建一个基本的数据库,tripewire 监控并检测新文件的创建修改和谁修改了它等等。如果修改是合法的,你可以接受修改并更新 tripwire 的数据库。 ### 安装和配置 ### -tripwire在Debian VM中的安装如下。 +tripwire 在 Debian VM 中的安装如下。 # apt-get install tripwire ![installation](http://blog.linoxide.com/wp-content/uploads/2015/11/installation.png) -安装中,tripwire会有下面的配置提示。 +安装中,tripwire 会有下面的配置提示。 #### 站点密钥创建 #### -tripwire需要一个站点口令来加密tripwire的配置文件tw.cfg和策略文件tw.pol。tripewire使用指定的密码加密两个文件。一个tripewire实例必须指定站点口令。 - +tripwire 需要一个站点口令(site passphrase)来加密 tripwire 的配置文件 tw.cfg 和策略文件 tw.pol。tripewire 使用指定的密码加密两个文件。一个 tripewire 实例必须指定站点口令。 ![site key1](http://blog.linoxide.com/wp-content/uploads/2015/11/site-key1.png) #### 本地密钥口令 #### -本地口令用来保护tripwire数据库和报告文件。本地密钥用于阻止非授权的tripewire数据库修改。 +本地口令用来保护 tripwire 数据库和报告文件。本地密钥用于阻止非授权的 tripewire 数据库修改。 ![local key1](http://blog.linoxide.com/wp-content/uploads/2015/11/local-key1.png) -#### Tripwire配置路径 #### +#### tripwire 配置路径 #### -tripewire配置存储在/etc/tripwire/twcfg.txt。它用于生成加密的配置文件tw.cfg。 +tripewire 配置存储在 /etc/tripwire/twcfg.txt。它用于生成加密的配置文件 tw.cfg。 ![configuration file](http://blog.linoxide.com/wp-content/uploads/2015/11/configuration-file.png) -**Tripwire策略路径** +**tripwire 策略路径** -tripwire在/etc/tripwire/twpol.txt中保存策略文件。它用于生成加密的策略文件tw.pol。 +tripwire 在 /etc/tripwire/twpol.txt 中保存策略文件。它用于生成加密的策略文件 tw.pol。 ![tripwire policy](http://blog.linoxide.com/wp-content/uploads/2015/11/tripwire-policy.png) @@ -41,9 +40,9 @@ tripwire在/etc/tripwire/twpol.txt中保存策略文件。它用于生成加密 ![installed tripewire1](http://blog.linoxide.com/wp-content/uploads/2015/11/installed-tripewire1.png) -#### Tripwire配置文件 (twcfg.txt) #### +#### tripwire 配置文件 (twcfg.txt) #### -tripewire配置文件(twcfg.txt)细节如下图所示。加密策略文件(tw.pol),站点密钥(site.key)和本地密钥(hostname-local.key)如下所示。 +tripewire 配置文件(twcfg.txt)细节如下图所示。加密策略文件(tw.pol)、站点密钥(site.key)和本地密钥(hostname-local.key)在后面展示。 ROOT =/usr/sbin @@ -79,9 +78,9 @@ tripewire配置文件(twcfg.txt)细节如下图所示。加密策略文件 TEMPDIRECTORY =/tmp -#### Tripwire策略配置 #### +#### tripwire 策略配置 #### -在生成基础数据库之前先配置tripwire配置。有必要经用一些策略如/dev、 /proc 、/root/mail等。详细的twpol.txt策略文件如下所示。 +在生成基础数据库之前先配置 tripwire 配置。有必要经用一些策略如 /dev、 /proc 、/root/mail 等。详细的 twpol.txt 策略文件如下所示。 @@section GLOBAL TWBIN = /usr/sbin; @@ -121,10 +120,10 @@ tripewire配置文件(twcfg.txt)细节如下图所示。加密策略文件 # vulnerability # - # Tripwire Binaries + # tripwire Binaries # ( - rulename = "Tripwire Binaries", + rulename = "tripwire Binaries", severity = $(SIG_HI) ) { @@ -237,9 +236,9 @@ tripewire配置文件(twcfg.txt)细节如下图所示。加密策略文件 #/proc -> $(Device) ; } -#### Tripwire 报告 #### +#### tripwire 报告 #### -**tripwire –check** 命令检查twpol.txt文件并基于此文件生成tripwire报告如下。如果twpol.txt中有任何错误,tripwire不会生成报告。 +**tripwire-check** 命令检查 twpol.txt 文件并基于此文件生成 tripwire 报告如下。如果 twpol.txt 中有任何错误,tripwire 不会生成报告。 ![tripwire report](http://blog.linoxide.com/wp-content/uploads/2015/11/tripwire-report.png) @@ -255,7 +254,7 @@ tripewire配置文件(twcfg.txt)细节如下图所示。加密策略文件 Wrote report file: /var/lib/tripwire/report/VMdebian-20151024-122322.twr - Open Source Tripwire(R) 2.4.2.2 Integrity Check Report + Open Source tripwire(R) 2.4.2.2 Integrity Check Report Report generated by: root @@ -299,13 +298,13 @@ tripewire配置文件(twcfg.txt)细节如下图所示。加密策略文件 Other binaries 66 0 0 0 - Tripwire Binaries 100 0 0 0 + tripwire Binaries 100 0 0 0 Other libraries 66 0 0 0 Root file-system executables 100 0 0 0 - Tripwire Data Files 100 0 0 0 + tripwire Data Files 100 0 0 0 System boot changes 100 0 0 0 @@ -351,9 +350,9 @@ tripewire配置文件(twcfg.txt)细节如下图所示。加密策略文件 *** End of report *** - Open Source Tripwire 2.4 Portions copyright 2000 Tripwire, Inc. Tripwire is a registered + Open Source tripwire 2.4 Portions copyright 2000 tripwire, Inc. tripwire is a registered - trademark of Tripwire, Inc. This software comes with ABSOLUTELY NO WARRANTY; + trademark of tripwire, Inc. This software comes with ABSOLUTELY NO WARRANTY; for details use --version. This is free software which may be redistributed @@ -365,7 +364,7 @@ tripewire配置文件(twcfg.txt)细节如下图所示。加密策略文件 ### 总结 ### -本篇中,我们学习安装配置开源入侵检测软件tripwire。首先生成基础数据库并通过比较检测出任何改动(文件/文件夹)。然而,tripwire并不是实时监测的IDS。 +本篇中,我们学习安装配置开源入侵检测软件 tripwire。首先生成基础数据库并通过比较检测出任何改动(文件/文件夹)。然而,tripwire 并不是实时监测的 IDS。 -------------------------------------------------------------------------------- @@ -373,7 +372,7 @@ via: http://linoxide.com/security/configure-tripwire-ids-debian/ 作者:[nido][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 689a64448665ef81e649a1346ea8686ba7d3137b Mon Sep 17 00:00:00 2001 From: alim0x Date: Mon, 4 Apr 2016 00:03:58 +0800 Subject: [PATCH 0588/1469] [translated]24 - The history of Android --- .../24 - The history of Android.md | 82 ------------------ .../24 - The history of Android.md | 83 +++++++++++++++++++ 2 files changed, 83 insertions(+), 82 deletions(-) delete mode 100644 sources/talk/The history of Android/24 - The history of Android.md create mode 100644 translated/talk/The history of Android/24 - The history of Android.md diff --git a/sources/talk/The history of Android/24 - The history of Android.md b/sources/talk/The history of Android/24 - The history of Android.md deleted file mode 100644 index fa6750d427..0000000000 --- a/sources/talk/The history of Android/24 - The history of Android.md +++ /dev/null @@ -1,82 +0,0 @@ -安卓编年史 -================================================================================ -![漂亮的新 Google Play Music 应用,从电子风格转向完美契合 Play 商店的风格。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/Goooogleplaymusic.jpg) -漂亮的新 Google Play Music 应用,从电子风格转向完美契合 Play 商店的风格。 -Ron Amadeo 供图 - -在 I/O 大会推出的另一个应用更新是 Google Music 应用。音乐应用经过了完全的重新设计,最终摆脱了蜂巢中引入的蓝底蓝色调的设计。Play Music 的设计和几个月前发布的 Play 商店一致,有着响应式的白色卡片布局。Music 同时还是最早采用新抽屉导航样式的主要应用之一。谷歌还随新应用发布了 Google Play Music All Access,每月 10 美元的包月音乐订阅服务。Google Music 现在拥有订阅计划,音乐购买,以及云端音乐存储空间。这个版本还引入了“Instant Mix”,谷歌会在云端给相似的歌曲计算出一份歌单。 - -![一个展示对 Google Play Games 支持的游戏。上面是 Play 商店游戏特性描述,登陆游戏触发的权限对话框,Play Games 通知,以及成就界面。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/gooooogleplaygames.jpg) -一个展示对 Google Play Games 支持的游戏。上面是 Play 商店游戏特性描述,登陆游戏触发的权限对话框,Play Games 通知,以及成就界面。 -Ron Amadeo 供图 - -谷歌还引入了“Google Play Games”,一个后端服务,开发者可以将其附加到游戏中。这项服务简单说就是安卓版的 Xbox Live 或苹果的 Game Center。开发者可以给游戏添加 Play Games 支持,这样就能通过使用谷歌的后端服务,更简单地集成成就,多人游戏,游戏匹配,用户账户以及云端存档到游戏中。 - -Play Games 是谷歌在游戏方面推进的开始。就像单独的 GPS 设备,翻盖手机,以及 MP3 播放器,智能手机的生产者希望游戏设备能够变成智能手机的一个功能点。当你有部智能手机的时候你为什么还有买个任天堂 DS 或 PS Vita 呢?一个易于使用的多人游戏服务是这项计划的重要部分,我们仍能看到这个决定最后的成果。在今天,坊间都在传言谷歌和苹果有关于客厅游戏设备的计划。 - -![Google Keep,谷歌自 Google Notebook 以来第一个笔记服务。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/goooglekeep.jpg) -Google Keep,谷歌自 Google Notebook 以来第一个笔记服务。 -Ron Amadeo 供图 - -毫无疑问一些产品为了赶上 Google I/O 大会的发布准时开发完成了,[但是三个半小时内的主题][1]已经够多了,一些产品在大会的发布上忽略了。Google I/O 大会的三天后一切都清楚了,谷歌带来了 Google Keep,一个用于安卓和在线的笔记应用。Keep 看起来很简单,就是一个用上了响应式 Google-Now 风格设计的笔记应用。用户可以改变卡片的尺寸,从多栏布局改为单列视图。笔记可以由文本,清单,自动转文本的语音或者图片组成。笔记卡片可以拖动并在主界面重新组织,你甚至可以给笔记换个颜色。 - -![Gmail 4.5,换上了新的导航抽屉设计,去掉了几个按钮并将操作栏合并到了抽屉里。](http://cdn.arstechnica.net/wp-content/uploads/2014/05/gmail.png) -Gmail 4.5,换上了新的导航抽屉设计,去掉了几个按钮并将操作栏合并到了抽屉里。 -Ron Amadeo 供图 - -在 I/O 大会之后,没有哪些应用不在谷歌的周期外更新里。2013 年 6 月,谷歌发布了新版设计的 Gmail。最显眼的变化就是一个月前 Google I/O 大会引入的新导航抽屉界面。最吸引眼球的变化是用上了 Google+ 资料图片来取代复选框。虽然复选框看起来被去掉了,它们其实还在那,点击邮件左边的图片就是了。 - -![新谷歌地图,换上了全白的 Google-Now 风格主题。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/newmaps11.png) -新谷歌地图,换上了全白的 Google-Now 风格主题。 -Ron Amadeo 供图 - -One month later, Google released a completely overhauled version of Google Maps to the Play Store. It was the first ground-up redesign of Google Maps since Ice Cream Sandwich. The new version fully adopted the Google Now white card aesthetic, and it greatly reduced the amount of stuff on the screen. The new Google Maps seemed to have a design mandate to always show a map on the screen somewhere, as you’ll be hard pressed to find something other than the settings that fully covers the map. - -This version of Google Maps seemed to live in its own little design world. The white search bar “floated" above the map, with maps showing on the sides and top of the bar. That didn't really make it seem like the traditional Action Bar design. The navigation drawer, in the top left on every other app, was in the bottom left. There was no up button, app icon, or overflow button on the main screen. - -![The new Google Maps cut a lot of fat and displayed more information on a single screen.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/newmaps21.png) -The new Google Maps cut a lot of fat and displayed more information on a single screen. -Ron Amadeo 供图 - -The left picture shows what popped up when you tapped on the search bar (along with the keyboard, which had been closed). In the past, Google would show an empty page below a blank search bar, but in Maps, Google used that space to link to the new “Local" page. The “blank" search results displayed links to common, browsable results like restaurant listings, gas stations, and attractions. At the bottom of the results page was a list of nearby results from your search history and an option to manually cache parts of the map. - -The right set of images shows location page. The map shown in the top of the Maps 7 screenshot isn’t a thumbnail; that’s the full map view. In the new version of Google Maps, a location was displayed as a card that “floats" overtop of the main map, and the map was repositioned to center on the location. Scrolling up would move the card up and cover the map, and scrolling down would show the whole map with the result reduced to a small strip at the bottom. If the location was part of a list of search results, swiping left and right would move through the results. - -The location pages were redesigned to be much more useful at a glance. On the first page, the new version added critical information, like the location on a map, the review score, and the number of reviews. Since this is a phone, and the software will be dialing for you, the phone number was deemed pointless and was removed. The old version showed the distance to the location in miles, while the new version of Google Maps showed the distance in terms of time, based on traffic and preferred mode of transportation—a much more useful metric. The new version also put a share button front and center, which made coordination over IM or text messaging a lot easier. - -### Android 4.3, Jelly Bean—getting wearable support out early ### - -Android 4.3 would have been an incredible update if Google had done the traditional thing and not released updates between 4.3 and 4.2 through the Play Store. If the new Play Store, Gmail, Maps, Books, Music, Hangouts, Keep, and Play Games were bundled into a big brick as a new version of Android, it would have been hailed as the biggest release ever. Google didn't need to do hold back features anymore though. With very little left that required an OS update, at the end of July 2013, Google released the seemingly insignificant update called "Android 4.3." - -![Android Wear plugging into Android 4.3's Notification access screen.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/2014-03-28-12.231.jpg) -Android Wear plugging into Android 4.3's Notification access screen. -Ron Amadeo 供图 - -Google made no qualms about the low importance of 4.3, calling the newest release "Jelly Bean" (the third one in a row). Android 4.3's feature list read like a laundry list of things Google couldn't update from the Play Store or through Google Play Services, mostly consisting of low-level framework changes for developers. - -Many of the additions seemed to fit a singular purpose, though—Android 4.3 was Google's trojan horse for wearable computing support. 4.3 added support for Bluetooth Low Energy, a way to wirelessly connect Android to another device and pass data back and forth while using a very small amount of power—an integral feature to a wearable device. Android 4.3 also added a "Notification Access" API, which allowed apps to completely replicate and control the notification panel. Apps could display notification text and pictures and interact with the notification the same way users do—namely pressing action buttons and dismissing notifications. Doing this from an on-board app when you have the notification panel is useless, but on a device that is separate from your phone, replicating the information in the notification panel becomes much more useful. One of the few apps that plugged into this was "Android Wear Preview," which used the notification API to power most of the interface for Android Wear. - -The "4.3 is for wearables" theory explained the relatively low number of features in 4.3: it was pushed out the door to give OEMs time to update devices in time for the launch of [Android Wear][2]. The plan seems to have worked. Android Wear requires Android 4.3 and up, which has been out for so long now that most major flagships have updated. - -Android 4.3 was not all that exciting, but Android releases from here on out didn't need to be all that exciting. Everything became so modularized that Google could push updates out as soon as they were done through Google Play, rather than drop everything in one huge brick as an OS update. - ----------- - -![Ron Amadeo](http://cdn.arstechnica.net/wp-content//uploads/authors/ron-amadeo-sq.jpg) - -[Ron Amadeo][a] / Ron is the Reviews Editor at Ars Technica, where he specializes in Android OS and Google products. He is always on the hunt for a new gadget and loves to rip things apart to see how they work. - -[@RonAmadeo][t] - --------------------------------------------------------------------------------- - -via: http://arstechnica.com/gadgets/2014/06/building-android-a-40000-word-history-of-googles-mobile-os/24/ - -译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[1]:http://live.arstechnica.com/liveblog-google-io-2013-keynote/ -[2]:http://arstechnica.com/gadgets/2014/03/in-depth-with-android-wear-googles-quantum-leap-of-a-smartwatch-os/ -[a]:http://arstechnica.com/author/ronamadeo -[t]:https://twitter.com/RonAmadeo diff --git a/translated/talk/The history of Android/24 - The history of Android.md b/translated/talk/The history of Android/24 - The history of Android.md new file mode 100644 index 0000000000..71d1736a12 --- /dev/null +++ b/translated/talk/The history of Android/24 - The history of Android.md @@ -0,0 +1,83 @@ +安卓编年史 +================================================================================ +![漂亮的新 Google Play Music 应用,从电子风格转向完美契合 Play 商店的风格。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/Goooogleplaymusic.jpg) +漂亮的新 Google Play Music 应用,从电子风格转向完美契合 Play 商店的风格。 +Ron Amadeo 供图 + +在 I/O 大会推出的另一个应用更新是 Google Music 应用。音乐应用经过了完全的重新设计,最终摆脱了蜂巢中引入的蓝底蓝色调的设计。Play Music 的设计和几个月前发布的 Play 商店一致,有着响应式的白色卡片布局。Music 同时还是最早采用新抽屉导航样式的主要应用之一。谷歌还随新应用发布了 Google Play Music All Access,每月 10 美元的包月音乐订阅服务。Google Music 现在拥有订阅计划,音乐购买,以及云端音乐存储空间。这个版本还引入了“Instant Mix”,谷歌会在云端给相似的歌曲计算出一份歌单。 + +![一个展示对 Google Play Games 支持的游戏。上面是 Play 商店游戏特性描述,登陆游戏触发的权限对话框,Play Games 通知,以及成就界面。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/gooooogleplaygames.jpg) +一个展示对 Google Play Games 支持的游戏。上面是 Play 商店游戏特性描述,登陆游戏触发的权限对话框,Play Games 通知,以及成就界面。 +Ron Amadeo 供图 + +谷歌还引入了“Google Play Games”,一个后端服务,开发者可以将其附加到游戏中。这项服务简单说就是安卓版的 Xbox Live 或苹果的 Game Center。开发者可以给游戏添加 Play Games 支持,这样就能通过使用谷歌的后端服务,更简单地集成成就,多人游戏,游戏匹配,用户账户以及云端存档到游戏中。 + +Play Games 是谷歌在游戏方面推进的开始。就像单独的 GPS 设备,翻盖手机,以及 MP3 播放器,智能手机的生产者希望游戏设备能够变成智能手机的一个功能点。当你有部智能手机的时候你为什么还有买个任天堂 DS 或 PS Vita 呢?一个易于使用的多人游戏服务是这项计划的重要部分,我们仍能看到这个决定最后的成果。在今天,坊间都在传言谷歌和苹果有关于客厅游戏设备的计划。 + +![Google Keep,谷歌自 Google Notebook 以来第一个笔记服务。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/goooglekeep.jpg) +Google Keep,谷歌自 Google Notebook 以来第一个笔记服务。 +Ron Amadeo 供图 + +毫无疑问一些产品为了赶上 Google I/O 大会的发布准时开发完成了,[但是三个半小时内的主题][1]已经够多了,一些产品在大会的发布上忽略了。Google I/O 大会的三天后一切都清楚了,谷歌带来了 Google Keep,一个用于安卓和在线的笔记应用。Keep 看起来很简单,就是一个用上了响应式 Google-Now 风格设计的笔记应用。用户可以改变卡片的尺寸,从多栏布局改为单列视图。笔记可以由文本,清单,自动转文本的语音或者图片组成。笔记卡片可以拖动并在主界面重新组织,你甚至可以给笔记换个颜色。 + +![Gmail 4.5,换上了新的导航抽屉设计,去掉了几个按钮并将操作栏合并到了抽屉里。](http://cdn.arstechnica.net/wp-content/uploads/2014/05/gmail.png) +Gmail 4.5,换上了新的导航抽屉设计,去掉了几个按钮并将操作栏合并到了抽屉里。 +Ron Amadeo 供图 + +在 I/O 大会之后,没有哪些应用不在谷歌的周期外更新里。2013 年 6 月,谷歌发布了新版设计的 Gmail。最显眼的变化就是一个月前 Google I/O 大会引入的新导航抽屉界面。最吸引眼球的变化是用上了 Google+ 资料图片来取代复选框。虽然复选框看起来被去掉了,它们其实还在那,点击邮件左边的图片就是了。 + +![新谷歌地图,换上了全白的 Google-Now 风格主题。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/newmaps11.png) +新谷歌地图,换上了全白的 Google-Now 风格主题。 +Ron Amadeo 供图 + +一个月后,谷歌在 Play 商店发布了全新的谷歌地图。这是谷歌地图自冰淇淋三明治以来第一个经过细致地重新设计的版本。新版本完全适配了 Google Now 白色卡片审美,还大大减少了屏幕上显示的元素。新版谷歌地图似乎设计时有意使地图总是显示在屏幕上,你很难找到除了设置页面之外还能完全覆盖地图显示的选项。 + +这个版本的谷歌地图看起来活在它自己的小小设计世界中。白色的搜索栏“浮动”在地图之上,地图显示部分在它旁边和上面都有。这和传统的操作栏设计有所不同。一般在应用左上角的导航抽屉,在这里是在左下角。这里的主界面没有向上按钮,应用图标,也没有浮动按钮。 + +![新谷歌地图轻量化了许多,在一屏内能够显示更多的信息。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/newmaps21.png) +新谷歌地图轻量化了许多,在一屏内能够显示更多的信息。 +Ron Amadeo 供图 + +左边的图片显示的是点击了搜索栏后的效果(带键盘,这里关闭了)。过去谷歌在空搜索栏下面显示一个空页面,但在地图中,谷歌利用这些空间链接到新的“本地”页面。搜索结果页显示一般信息的结果,比如餐馆,加油站,以及景点。在结果页的底部是个列表,显示你的搜索历史和手动缓存部分地图的选项。 + +右侧图片显示的是地点页面。上面地图 7.0 的截图里显示的地图不是略缩图,它是完整的地图视图。在新版的谷歌地图中,地点作为卡片浮动显示在主地图之上,地图重新居中显示该地点。向上滑动可以让卡片覆盖地图,向下滑动可以显示带有底部一小条结果的完整地图。如果该地点是搜索结果列表中的一个,左右滑动可以在结果之间切换。 + +地点页面重新设计以显示更有用的信息概览。在第一页,新版添加了重要信息,比如地图上的位置,点评得分,以及点评数目。因为这是个手机,所以软件内可以直接拨打电话,电话号码的显示被认为是毫无意义的,被去掉了。旧版地点显示到那里的距离,新版谷歌地图显示到那里的时间,基于交通状况和偏好的交通方式——一个更加实用的衡量方式。新版还在中间放了个分享按钮,这使得通过即时通讯或短信协调的时候更加方便。 + +### Android 4.3,果冻豆——早早支持可穿戴设备 ### + +如果谷歌没有在安卓 4.3 和安卓 4.2 之间通过 Play 商店发布更新的话,安卓 4.3 会是个不可思议的更新。如果新版 Play 商店,Gmail,地图,书籍,音乐,Hangouts 环聊,以及 Play Games 打包作为新版安卓的一部分,它将会作为有史以来最大的发布受到欢呼。虽然谷歌没必要延后新功能的发布。有了 Play 服务框架,只剩很少的部分需要系统更新,2013 年 7 月底谷歌发布了看似无关紧要的“安卓 4.3”。 + +![安卓 4.3 通知访问权限界面的可穿戴设备选项。 +](http://cdn.arstechnica.net/wp-content/uploads/2014/03/2014-03-28-12.231.jpg) +安卓 4.3 通知访问权限界面的可穿戴设备选项。 +Ron Amadeo 供图 + +谷歌也毫无疑问地认为 4.3 的重要性不高,将新版也叫做“果冻豆”(第三个叫果冻豆的版本了)。安卓 4.3 的新功能列表像是谷歌无法通过 Play 商店或谷歌 Play 服务更新的部分的细目清单,大部分包含了为开发者作出的底层架构改动。 + +但许多新增功能似乎只为了一个目的——安卓 4.3 是谷歌对可穿戴计算支持的特洛伊木马。4.3 加入了低功耗蓝牙支持,使用很少的能耗将安卓和其它设备连接到一起并传输数据——可穿戴设备的必要特性。安卓 4.3 还添加了“通知访问权限”API,允许应用完全复制和控制通知面板。应用可以显示通知文本以及和用户操作一样地和通知交互——也就是点击操作按钮和消除通知。当你有个通知面板时从本机应用做这个操作没什么意义,但是在一个独立于你手机的设备上,复制通知面板的消息就显得很有用了。为数不多的接入的应用是 “Android Wear Preview(安卓可穿戴预览)”,使用了通知 API 驱动大部分的 Android Wear 界面。 + +“4.3 是给可穿戴设备准备的”这个理论解释了 4.3 相对较少的新特性:它的推出是为了给 OEM 厂商时间去升级设备,为 [Android Wear][2] 的发布做准备。这个计划看起来起作用了。Android Wear 要求 安卓 4.3 及以上版本,安卓 4.3 已经发布很长时间了,大部分主要的旗舰设备都已经升级了。 + +安卓并没有那么激动人心,但安卓从现在起的新版也不需要那么激动人心了。一切都变得那么模块化了,谷歌可以通过 Google Play 在它们完成时随时推送更新,不用再作为一个大系统更新来更新这么多组件。 + +---------- + +![Ron Amadeo](http://cdn.arstechnica.net/wp-content//uploads/authors/ron-amadeo-sq.jpg) + +[Ron Amadeo][a] / Ron是Ars Technica的评论编缉,专注于安卓系统和谷歌产品。他总是在追寻新鲜事物,还喜欢拆解事物看看它们到底是怎么运作的。 + +[@RonAmadeo][t] + +-------------------------------------------------------------------------------- + +via: http://arstechnica.com/gadgets/2014/06/building-android-a-40000-word-history-of-googles-mobile-os/24/ + +译者:[alim0x](https://github.com/alim0x) 校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[1]:http://live.arstechnica.com/liveblog-google-io-2013-keynote/ +[2]:http://arstechnica.com/gadgets/2014/03/in-depth-with-android-wear-googles-quantum-leap-of-a-smartwatch-os/ +[a]:http://arstechnica.com/author/ronamadeo +[t]:https://twitter.com/RonAmadeo From b8b94f4ca73048a7a2a2c53e119bd4df3e7f5bee Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 4 Apr 2016 05:24:12 +0800 Subject: [PATCH 0589/1469] PUB:Part 4 - LFCS--Partitioning Storage Devices, Formatting Filesystems and Configuring Swap Partition @GHLandy --- ...esystems and Configuring Swap Partition.md | 52 +++++++++---------- 1 file changed, 25 insertions(+), 27 deletions(-) rename {translated/tech => published}/LFCS/Part 4 - LFCS--Partitioning Storage Devices, Formatting Filesystems and Configuring Swap Partition.md (82%) diff --git a/translated/tech/LFCS/Part 4 - LFCS--Partitioning Storage Devices, Formatting Filesystems and Configuring Swap Partition.md b/published/LFCS/Part 4 - LFCS--Partitioning Storage Devices, Formatting Filesystems and Configuring Swap Partition.md similarity index 82% rename from translated/tech/LFCS/Part 4 - LFCS--Partitioning Storage Devices, Formatting Filesystems and Configuring Swap Partition.md rename to published/LFCS/Part 4 - LFCS--Partitioning Storage Devices, Formatting Filesystems and Configuring Swap Partition.md index 987ea4a7f8..77bd84087c 100644 --- a/translated/tech/LFCS/Part 4 - LFCS--Partitioning Storage Devices, Formatting Filesystems and Configuring Swap Partition.md +++ b/published/LFCS/Part 4 - LFCS--Partitioning Storage Devices, Formatting Filesystems and Configuring Swap Partition.md @@ -1,13 +1,11 @@ -GHLandy Translated - -LFCS 系列第四讲:分区存储设备、格式化文件系统和配置交换分区 - +LFCS 系列第四讲:对存储设备分区、格式化文件系统和配置交换分区 ================================================================================ + 去年八月份,Linux 基金会发起了 LFCS(Linux Foundation Certified Sysadmin,Linux 基金会认证系统管理员)认证,给所有系统管理员一个展现自己的机会。通过基础考试后,他们可以胜任在 Linux 上的整体运维工作:包括系统支持、一流水平的诊断和监控以及在必要之时向其他支持团队提交帮助请求等。 ![Linux Foundation Certified Sysadmin – Part 4](http://www.tecmint.com/wp-content/uploads/2014/10/lfcs-Part-4.png) -LFCS 系列第四讲 +*LFCS 系列第四讲* 需要注意的是,Linux 基金会认证是非常严格的,通过与否完全要看个人能力。通过在线链接,你可以随时随地参加 Linux 基金会认证考试。所以,你再也不用到考试中心了,只需要不断提高自己的专业技能和经验就可去参加考试了。 @@ -16,13 +14,13 @@ LFCS 系列第四讲 注:youtube 视频 -本讲是《十套教程》系列中的第四讲。在本讲中,我们将涵盖分区存储设备、格式化文件系统和配置交换分区等内容,这些都是 LFCS 认证中的必备知识。 +本讲是系列教程中的第四讲。在本讲中,我们将涵盖对存储设备进行分区、格式化文件系统和配置交换分区等内容,这些都是 LFCS 认证中的必备知识。 -### 分区存储设备 ### +### 对存储设备分区 ### 分区是一种将单独的硬盘分成一个或多个区的手段。一个分区只是硬盘的一部分,我们可以认为这部分是独立的磁盘,里边包含一个单一类型的文件系统。分区表则是将硬盘上这些分区与分区标识符联系起来的索引。 -在 Linux 中,IBM PC 兼容系统里边用于管理传统 MBR(最新到2009年)分区的工具是 fdisk。对于 GPT(2010年至今)分区,我们使用 gdisk。这两个工具都可以通过程序名后面加上设备名称(如 /dev/sdb)进行调用。 +在 Linux 上,IBM PC 兼容系统里边用于管理传统 MBR(用到2009年)分区的工具是 fdisk。对于 GPT(2010年至今)分区,我们使用 gdisk。这两个工具都可以通过程序名后面加上设备名称(如 /dev/sdb)进行调用。 #### 使用 fdisk 管理 MBR 分区 #### @@ -34,17 +32,17 @@ LFCS 系列第四讲 ![fdisk Help Menu](http://www.tecmint.com/wp-content/uploads/2014/10/fdisk-help.png) -fdisk 帮助菜单 +*fdisk 帮助菜单* 上图中,使用频率最高的选项已高亮显示。你可以随时按下 “p” 显示分区表。 ![Check Partition Table in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Show-Partition-Table.png) -显示分区表 +*显示分区表* Id 列显示由 fdisk 分配给每个分区的分区类型(分区 id)。一个分区类型代表一种文件系统的标识符,简单来说,包括该分区上数据的访问方法。 -请注意,每个分区类型的全面都全面讲解将超出了本教程的范围——本系列教材主要专注于 LFCS 测试,因能力为主。 +请注意,每个分区类型的全面讲解将超出了本教程的范围——本系列教材主要专注于 LFCS 测试,以考试为主。 **下面列出一些 fdisk 常用选项:** @@ -58,25 +56,25 @@ Id 列显示由 fdisk 分配给每个分区的分区类型(分区 id)。一 ![fdisk Command Options](http://www.tecmint.com/wp-content/uploads/2014/10/fdisk-options.png) -fdisk 命令选项 +*fdisk 命令选项* 按下 “n” 后接着按下 “p” 会创建新一个主分区。最后,你可以使用所有的默认值(这将占用所有的可用空间),或者像下面一样自定义分区大小。 ![Create New Partition in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-New-Partition.png) -创建新分区 +*创建新分区* 若 fdisk 分配的分区 Id 并不是我们想用的,可以按下 “t” 来更改。 ![Change Partition Name in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Change-Partition-Name.png) -更改分区类型 +*更改分区类型* 全部设置好分区后,按下 “w” 将更改保存到硬盘分区表上。 ![Save Partition Changes](http://www.tecmint.com/wp-content/uploads/2014/10/Save-Partition-Changes.png) -保存分区更改 +*保存分区更改* #### 使用 gdisk 管理 GPT 分区 #### @@ -88,7 +86,7 @@ fdisk 命令选项 ![Create GPT Partitions in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-GPT-Partitions.png) -创建 GPT 分区 +*创建 GPT 分区* 使用 GPT 分区方案,我们可以在同一个硬盘上创建最多 128 个分区,单个分区最大以 PB 为单位,而 MBR 分区方案最大的只能 2TB。 @@ -96,7 +94,7 @@ fdisk 命令选项 ![gdisk Command Options](http://www.tecmint.com/wp-content/uploads/2014/10/gdisk-options.png) -gdisk 命令选项 +*gdisk 命令选项* ### 格式化文件系统 ### @@ -106,14 +104,14 @@ gdisk 命令选项 ![Check Filesystems Type in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Filesystems.png) -检查文件系统类型 +*检查文件系统类型* 选择文件系统取决于你的需求。你应该考虑到每个文件系统的优缺点以及其特点。选择文件系统需要看的两个重要属性: - 日志支持,允许从系统崩溃事件中快速恢复数据。 -- 安全增强式 Linux(SELinux)支持,按照项目 wiki 所说,“安全增强式 Linux 允许用户和管理员更好的把握访问控制权限”。 +- 安全增强式 Linux(SELinux)支持,按照项目 wiki 所说,“安全增强式 Linux 允许用户和管理员更好的控制访问控制权限”。 -在接下来的例子中,我们通过 mkfs 在 /dev/sdb1上创建 ext4 文件系统(支持日志和 SELinux),标卷为 Tecmint。mkfs 基本语法如下: +在接下来的例子中,我们通过 mkfs 在 /dev/sdb1 上创建 ext4 文件系统(支持日志和 SELinux),标卷为 Tecmint。mkfs 基本语法如下: # mkfs -t [filesystem] -L [label] device 或者 @@ -121,7 +119,7 @@ gdisk 命令选项 ![Create ext4 Filesystems in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-ext4-Filesystems.png) -创建 ext4 文件系统 +*创建 ext4 文件系统* ### 创建并启用交换分区 ### @@ -129,7 +127,7 @@ gdisk 命令选项 下面列出选择交换分区大小的经验法则: -物理内存不高于 2GB 时,取两倍物理内存大小即可;物理内存在 2GB 以上时,取一倍物理内存大小即可;并且所取大小应该大于 32MB。 +> 物理内存不高于 2GB 时,取两倍物理内存大小即可;物理内存在 2GB 以上时,取一倍物理内存大小即可;并且所取大小应该大于 32MB。 所以,如果: @@ -142,7 +140,7 @@ M为物理内存大小,S 为交换分区大小,单位 GB,那么: 记住,这只是基本的经验。对于作为系统管理员的你,才是决定是否使用交换分区及其大小的关键。 -要配置交换分区,首先要划分一个常规分区,大小像我们之前演示的那样来选取。然后添加以下条目到 /etc/fstab 文件中(其中的X要更改为对应的 b 或 c)。 +要配置交换分区,首先要划分一个常规分区,大小像我们之前演示的那样来选取。然后添加以下条目到 /etc/fstab 文件中(其中的 X 要更改为对应的 b 或 c)。 /dev/sdX1 swap swap sw 0 0 @@ -163,15 +161,15 @@ M为物理内存大小,S 为交换分区大小,单位 GB,那么: ![Create-Swap-Partition in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-Swap-Partition.png) -创建交换分区 +*创建交换分区* ![Add Swap Partition in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Enable-Swap-Partition.png) -启用交换分区 +*启用交换分区* ### 结论 ### -在你的系统管理员之路上,创建分区(包括交换分区)和格式化文件系统是非常重要的一部。我希望本文中所给出的技巧指导你到达你的管理员目标。随时在本讲评论区中发表你的技巧和想法,一起为社区做贡献。 +在你的系统管理员之路上,创建分区(包括交换分区)和格式化文件系统是非常重要的一步。我希望本文中所给出的技巧指导你到达你的管理员目标。随时在本讲评论区中发表你的技巧和想法,一起为社区做贡献。 参考链接 @@ -185,7 +183,7 @@ via: http://www.tecmint.com/create-partitions-and-filesystems-in-linux/ 作者:[Gabriel Cánepa][a] 译者:[GHLandy](https://github.com/GHLandy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 3a8eb74434953ed2da4745089da5253d0a32383c Mon Sep 17 00:00:00 2001 From: alim0x Date: Mon, 4 Apr 2016 14:57:28 +0800 Subject: [PATCH 0590/1469] [translating]25 - The history of Android --- .../The history of Android/25 - The history of Android.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/talk/The history of Android/25 - The history of Android.md b/sources/talk/The history of Android/25 - The history of Android.md index 39eeb55768..779aa31ce2 100644 --- a/sources/talk/The history of Android/25 - The history of Android.md +++ b/sources/talk/The history of Android/25 - The history of Android.md @@ -1,3 +1,5 @@ +alim0x translating + The history of Android ================================================================================ ![The LG-made Nexus 5, the launch device for KitKat.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/nexus56.jpg) @@ -67,4 +69,4 @@ via: http://arstechnica.com/gadgets/2014/06/building-android-a-40000-word-histor [4]:http://arstechnica.com/gadgets/2014/03/in-depth-with-android-wear-googles-quantum-leap-of-a-smartwatch-os/ [5]:http://arstechnica.com/gadgets/2013/11/google-just-pulled-a-facebook-home-kitkats-primary-interface-is-google-search/ [a]:http://arstechnica.com/author/ronamadeo -[t]:https://twitter.com/RonAmadeo \ No newline at end of file +[t]:https://twitter.com/RonAmadeo From 96cce3d9a7b9e051498db2cbcc0f6004049099ea Mon Sep 17 00:00:00 2001 From: alim0x Date: Mon, 4 Apr 2016 17:52:03 +0800 Subject: [PATCH 0591/1469] [translated]25 - The history of Android --- .../25 - The history of Android.md | 72 ------------------- .../25 - The history of Android.md | 71 ++++++++++++++++++ 2 files changed, 71 insertions(+), 72 deletions(-) delete mode 100644 sources/talk/The history of Android/25 - The history of Android.md create mode 100644 translated/talk/The history of Android/25 - The history of Android.md diff --git a/sources/talk/The history of Android/25 - The history of Android.md b/sources/talk/The history of Android/25 - The history of Android.md deleted file mode 100644 index 779aa31ce2..0000000000 --- a/sources/talk/The history of Android/25 - The history of Android.md +++ /dev/null @@ -1,72 +0,0 @@ -alim0x translating - -The history of Android -================================================================================ -![The LG-made Nexus 5, the launch device for KitKat.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/nexus56.jpg) -The LG-made Nexus 5, the launch device for KitKat. - -Android 4.4, KitKat—more polish; less memory usage - -Google got really cute with the launch of Android 4.4. The company [teamed up with Nestlé][1] to name the OS "KitKat," and it launched on Halloween, October 31, 2013. Nestlé produced limited-edition Android-shaped KitKat bars, and KitKat packaging in stores promoted the new OS while offering a chance to win a Nexus 7. - -KitKat launched with a new Nexus device, the Nexus 5. The new flagship had the biggest display yet: a five-inch, 1920x1080 LCD. Despite the bigger screen size, LG—again the manufacturer for the device—was able to fit the Nexus 5 into the same dimensions as a Galaxy Nexus or Nexus 4. - -The Nexus 5 was specced comparatively to the highest-end phones at the time, with a 2.3Ghz Snapdragon 800 processor and 2GB of RAM. The phone was again sold unlocked on the Play Store, but while most phones with specs like this would go for $600-$700, Google sold the Nexus 5 for only $350. - -One of the most important improvements in KitKat was one you couldn't see: significantly lower memory usage. For KitKat, Google started a concerted effort to lower memory usage across the OS and bundled apps called "Project Svelte." After tons of optimization work and a "low memory" mode that disabled expensive graphical effects, Android could now run on as little as 340MB of RAM. Lower memory requirements were a big deal, because devices in the developing world—the biggest growth markets for smartphones—often ran on only 512MB of RAM. Ice Cream Sandwich's more advanced UI significantly raised the system requirements of Android devices, which left many low-end devices—even newly released low-end devices—stuck on Gingerbread. The lower system requirements of KitKat meant to bring these cheap devices back into the fold. With KitKat, Google hoped to finally kill Gingerbread (which, at the time of writing, is around 20 percent of the market). Just in case the lower system requirements weren't enough, there have even been reports that Google will [no longer license][2] the Google apps to Gingerbread devices. - -Besides bringing low-end phones to a modern version of the OS, Project Svelte's lower memory requirements were to be a boon to wearable computers, too. Google Glass [announced][3] it was also switching to the slimmer OS, and [Android Wear][4] ran on KitKat, too. The lower memory requirements in Android 4.4 and the notification API and Bluetooth LE support in 4.3 came together nicely to support wearable computing. - -KitKat also featured a lot of polish to the core OS interfaces that couldn't be updated via the Play Store. The System UI, Dialer, Clock, and Settings all saw updates. - -![KitKat's transparent bars on the Google Now Launcher.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/1homescreenz.png) -KitKat's transparent bars on the Google Now Launcher. -Photo by Ron Amadeo - -KitKat not only got rid of the unpopular lines to the left and right sides of the lock screen—it completely disabled lock screen widgets by default! Google obviously felt multiple lock screens and multiple home screens were a little to complicated for new users, so lock screen widgets now needed to be enabled in the settings. The lopsided time here and in the clock app was switched to a symmetrical weight, which looked a lot nicer. - -In KitKat, apps had the ability to make the system and status bars transparent, which significantly changed the look of the OS. The bars now blended into the wallpaper and any other app that chose to enable transparent bars. The bars could also be completely hidden by any app via a new feature called “immersive" mode. - -KitKat was the final nail in the “Tron" coffin, removing almost all traces of blue from the operating system. The status bar icons were changed from a blue to a neutral white. The status and system bars on the home screen weren’t completely transparent; a dark gradient was added to the top and bottom of the screen so that the white icons would still be visible on a light background. - -![Tweaks to Google Now and the folders.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/nowfolders.png) -Tweaks to Google Now and the folders. -Photo by Ron Amadeo - -The home screen that shipped with KitKat on the Nexus 5 was actually exclusive to the Nexus 5 for a few months, but it could now be on any Nexus device. The new home screen was called the "Google Now Launcher," and it was actually [the Google Search app][5]. Yes, Google Search grew from a simple search box to an entire home screen, and in KitKat, it drew the wallpaper, icons, app drawer, widgets, home screen settings, Google Now, and, of course, the search box. Thanks to Search now running the entire home screen, any time the home screen was open and the screen was on, voice commands could be activated by saying “OK Google." This was pointed out to the user with introductory “Say 'OK Google' text in the search bar, which would fade away after a few uses. - -Google Now was more integrated, too. Besides the usual swipe up from the system bar, Google Now was also the leftmost home screen. The new version brought some design tweaks as well. The Google logo was moved into the search bar, and the whole top area was compacted. A few card designs were cleaned up, and a new set of buttons at the bottom led to reminders, customization options, and an overflow button with settings, feedback, and help. Since Google Now was part of the home screen, it got transparent system and status bars, too. - -Transparency and “brightening up" certain parts of the OS were design themes in KitKat. Black was removed in the status and system bars by switching to transparent, and the black background of the folders was switched to white. - -![A screenshot showing the new, cleaner app screen layout, and a composite image of the app lineup.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/apps.png) -A screenshot showing the new, cleaner app screen layout, and a composite image of the app lineup. -Photo by Ron Amadeo - -The KitKat icon lineup changed significantly from 4.3. To be more dramatic, it was a bloodbath, with Google removing seven icons over the 4.3 loadout. Google Hangouts could handle SMS now, so the Messaging app was removed. Hangouts also took over Google+ Messenger duties, so that app shortcut was cut. Google Currents was removed as a default app, as it would soon be killed—along with Google Play Magazines—in favor of Google Play Newsstand. Google Maps was beaten back into a single icon, which meant Local and Navigation shortcuts were removed. The impossible-to-understand Movie Studio was cut, too—Google must have realized no one wants to edit movies on a phone. Thanks to the home screen “OK Google" hotword detection, the Voice Search icon was rendered redundant and removed. Depressingly, the long abandoned News & Weather app remained. - -There was a new app called “Photos"—really the Google+ app—which took over picture management duties. On the Nexus 5, the Gallery and Google+ Photos were pretty similar, but in newer builds of KitKat present on Google Play Edition devices, the Gallery was completely replaced by Google+ photos. Play Games was an interface for Google’s back-end multiplayer service—a Googly version of Xbox Live or Apple’s Game Center. Google Drive, which existed for years as a Play Store app, was finally made a default app. Google bought Quickoffice back in June 2012, now finally deeming the app acceptable for inclusion by default. While Drive opened Google Documents, Quickoffice opened Microsoft Office Documents. If keeping track, that was two document editing apps and two photo editing apps included on most KitKat loadouts. - ----------- - -![Ron Amadeo](http://cdn.arstechnica.net/wp-content//uploads/authors/ron-amadeo-sq.jpg) - -[Ron Amadeo][a] / Ron is the Reviews Editor at Ars Technica, where he specializes in Android OS and Google products. He is always on the hunt for a new gadget and loves to rip things apart to see how they work. - -[@RonAmadeo][t] - --------------------------------------------------------------------------------- - -via: http://arstechnica.com/gadgets/2014/06/building-android-a-40000-word-history-of-googles-mobile-os/25/ - -译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[1]:http://arstechnica.com/gadgets/2013/09/official-the-next-edition-of-android-is-kitkat-version-4-4/ -[2]:http://www.androidpolice.com/2014/02/10/rumor-google-to-begin-forcing-oems-to-certify-android-devices-with-a-recent-os-version-if-they-want-google-apps/ -[3]:http://www.androidpolice.com/2014/03/01/glass-xe14-delayed-until-its-ready-promises-big-changes-and-a-move-to-kitkat/ -[4]:http://arstechnica.com/gadgets/2014/03/in-depth-with-android-wear-googles-quantum-leap-of-a-smartwatch-os/ -[5]:http://arstechnica.com/gadgets/2013/11/google-just-pulled-a-facebook-home-kitkats-primary-interface-is-google-search/ -[a]:http://arstechnica.com/author/ronamadeo -[t]:https://twitter.com/RonAmadeo diff --git a/translated/talk/The history of Android/25 - The history of Android.md b/translated/talk/The history of Android/25 - The history of Android.md new file mode 100644 index 0000000000..01b93c71a9 --- /dev/null +++ b/translated/talk/The history of Android/25 - The history of Android.md @@ -0,0 +1,71 @@ +安卓编年史 +================================================================================ +![LG 制造的 Nexus 5,奇巧(KitKat)的首发设备。 +](http://cdn.arstechnica.net/wp-content/uploads/2014/03/nexus56.jpg) +LG 制造的 Nexus 5,奇巧(KitKat)的首发设备。 + +Android 4.4,奇巧——更完美;更少的内存占用 + +谷歌安卓 4.4 的发布确实很讨巧。谷歌和[雀巢公司合作][1],新版系统的代号是“奇巧(KitKat)”,并且它是在 2013 年 10 月 31 日发布的,也就是万圣节。雀巢公司推出了限量版带安卓机器人的奇巧巧克力,它的包装也帮助新版系统推广,消费者有机会赢取一台 Nexus 7。 + +一部新的 Nexus 设备也随奇巧一同发布,就是 Nexus 5。新旗舰拥有迄今最大的显示屏:一块五英寸,1920x1080 分辨率的 LCD 显示屏。除了更大尺寸的屏幕,LG——Nexus 5 的制造商——还将 Nexus 5 的机器大小控制得和 Galaxy Nexus 或 Nexus 4 差不多。 + +Nexus 5 相对同时期的高端手机配置算是标准了,拥有 2.3Ghz 骁龙 800 处理器和 2GB 内存。手机再次在 Play 商店销售无锁版,相同配置的大多数手机价格都在 600 到 700 美元之间,但 Nexus 5 的售价仅为 350 美元。 + +奇巧最重要的改进之一你并不能看到:显著减少的内存占用。对奇巧而言,谷歌齐心协力开始了降低系统和预装应用内存占用的努力,称作“Project Svelte”。经过了无数的优化工作和通过一个“低内存模式”(禁用图形开销大的特效),安卓现在可以在 340MB 内存下运行。低内存需求是件了不起的事,因为在发展中国家的设备——智能手机增长最快的市场——许多设备的内存仅有 512MB。冰淇淋三明治更高级的 UI 显著提高了对安卓设备的系统配置要求,这使得很多低端设备——甚至是新发布的低端设备——的安卓版本停留在姜饼。奇巧更低的配置需求意味着这些廉价设备能够跟上脚步。有了奇巧,谷歌希望完全消灭姜饼(写下本文时姜饼的市场占有率还在 20% 左右)。为了防止更低的系统需求还不够有效,甚至有报道称谷歌将[不再授权][2]谷歌应用给姜饼设备。 + +除了给低端设备带来更现代版本的系统,Project Svelte 更低的内存需求同样对可穿戴设备也是个好消息。Google Glass [宣布][3]它会切换到这个更精简的系统,[Android Wear][4] 同样也运行在奇巧之上。安卓 4.4 带来的更低的内存需求以及 4.3 中的通知消息 API 和低功耗蓝牙支持给了可穿戴计算漂亮的支持。 + +奇巧的亮点还有无数精心打磨过的核心系统界面,它们无法通过 Play 商店升级。系统界面,拨号盘,时钟还有设置都能看到升级。 + +![奇巧在 Google Now 启动器下的透明系统栏。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/1homescreenz.png) +奇巧在 Google Now 启动器下的透明系统栏。 +Ron Amadeo 供图 + +奇巧不仅去掉了讨人厌的锁屏左右屏的线框——它还默认完全禁用了锁屏小部件!谷歌明显感觉到了多屏锁屏和锁屏主屏对新用户来说有点复杂,所以锁屏小部件现在需要从设置里启用。锁屏和时钟里不平衡的时间字体换成了一个对称的字重,看起来好看多了。 + +在奇巧中,应用拥有将系统栏和状态栏透明的能力,显著地改变了系统的外观。系统栏和状态栏现在混合到壁纸和启用透明栏的应用中去了。这些栏还能通过新功能“沉浸”模式完全被应用隐藏。 + +奇巧是“电子”科幻风格棺材上的最后一颗钉子,几乎完全移除了系统的蓝色痕迹。状态栏图标由蓝色变成中性的白色。主屏的状态栏和系统栏并不是完全透明的;它们有深色的渐变,这样在使用浅色壁纸的时候白色的图标还能轻易地识别出来。 + +![Google Now 和文件夹的调整。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/nowfolders.png) +Google Now 和文件夹的调整。 +Ron Amadeo 供图 + +在 Nexus 5 上随奇巧到来的主屏实际上由 Nexus 5 独占了几个月,但现在任何 Nexus 设备都能拥有它了。新的主屏叫做“Google Now Launcher”,它实际上是[谷歌搜索应用][5]。是的,谷歌搜索从一个简单的搜索框成长到了整个主屏幕,并且在奇巧中,它涉及了壁纸,图标,应用抽屉,小部件,主屏设置,Google Now,当然,还有搜索框。由于搜索现在运行在整个主屏幕,任何时候只要打开了主屏并且屏幕是点亮的,就可以通过说“OK Google”激活语音命令。在搜索栏有引导用户说出“OK Google”的文本,在几次使用后这个介绍会隐去。 + +Google Now 的集成度现在更高了。除了通常的系统栏上滑激活,Google Now 还占据了最左侧的主屏。新版还引入了一些设计上的调整。谷歌的 logo 移到了搜索栏内,整个顶部区域更紧凑了。显示更多卡片的设计被去除了,新添加的一组底部按钮指向备忘录,自定义选项,以及一个更多操作按钮,里面由设置,反馈,以及帮助。因为 Google Now 是主屏幕的一部分,所以它也拥有透明 的系统栏和状态栏。 + +透明以及让系统的特定部分“更明亮”是奇巧的设计主题。黑色调通过透明化从状态栏和系统栏移除了,文件夹的黑色背景也换为了白色。 + +![新的,更加干净的应用列表,以及完整的应用阵容。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/apps.png) +新的,更加清爽的应用列表,以及完整的应用阵容。 +Ron Amadeo 供图 + +奇巧的图标阵容相对 4.3 有显著的变化。更戏剧化地说,这是一场大屠杀,谷歌从 4.3 的配置中移除了七个图标。谷歌 Hangouts 现在能够处理短信,所以信息应用被去除了。Hangouts 同时还接手了 Google Messenger 的职责,所以它的图标也不见了。Google Currents 不再作为默认应用预装,因为它不久后就会被终结——和它一起的还有 Google Play Magazines(Play 杂志),取代它们的是 Google Play Newsstand(Play 报刊亭)。谷歌地图被打回一个图标,这意味着本地和导航的快捷方式被去掉了。难以理解的 Movie Studio 也被去除了——谷歌肯定已经意识到了没人想在手机上剪辑电影。有了主屏的“OK Google”关键词检测,语音搜索图标的呈现就显得多余了,因而将其移除。令人沮丧的是,没人用的新闻和天气应用还在。 + +有个新应用“Photos(相片)”——实际上是 Google+ 的一部分——接手了图片管理的工作。在 Nexus 5 上,相册和 Google+ 相片十分相似,但在 Google Play 版设备上更新版的奇巧中,相册已经完全被 Google+ 相片所取代。Play Games 是谷歌的后端多用户游戏服务——谷歌版的 Xbox Live 或苹果的 Game Center。Google Drive,已经在 Play 商店存在数年的应用,终于成为了内置应用。谷歌 2012 年 6 月收购的 Quickoffice 也进入了内置应用阵容。Drive 可以打开 Google 文档,Quickoffice 可以打开微软 Office 文档。如果细细追究起来,在大多数奇巧中包含了两个文档编辑应用和两个相片编辑应用。 + +---------- + +![Ron Amadeo](http://cdn.arstechnica.net/wp-content//uploads/authors/ron-amadeo-sq.jpg) + +[Ron Amadeo][a] / Ron是Ars Technica的评论编缉,专注于安卓系统和谷歌产品。他总是在追寻新鲜事物,还喜欢拆解事物看看它们到底是怎么运作的。 + +[@RonAmadeo][t] + +-------------------------------------------------------------------------------- + +via: http://arstechnica.com/gadgets/2014/06/building-android-a-40000-word-history-of-googles-mobile-os/25/ + +译者:[alim0x](https://github.com/alim0x) 校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[1]:http://arstechnica.com/gadgets/2013/09/official-the-next-edition-of-android-is-kitkat-version-4-4/ +[2]:http://www.androidpolice.com/2014/02/10/rumor-google-to-begin-forcing-oems-to-certify-android-devices-with-a-recent-os-version-if-they-want-google-apps/ +[3]:http://www.androidpolice.com/2014/03/01/glass-xe14-delayed-until-its-ready-promises-big-changes-and-a-move-to-kitkat/ +[4]:http://arstechnica.com/gadgets/2014/03/in-depth-with-android-wear-googles-quantum-leap-of-a-smartwatch-os/ +[5]:http://arstechnica.com/gadgets/2013/11/google-just-pulled-a-facebook-home-kitkats-primary-interface-is-google-search/ +[a]:http://arstechnica.com/author/ronamadeo +[t]:https://twitter.com/RonAmadeo From f1d4a3b9d524317ffae005560455c7eaa5597d4c Mon Sep 17 00:00:00 2001 From: alim0x Date: Mon, 4 Apr 2016 17:53:35 +0800 Subject: [PATCH 0592/1469] [translating]26 - The history of Android --- .../The history of Android/26 - The history of Android.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/talk/The history of Android/26 - The history of Android.md b/sources/talk/The history of Android/26 - The history of Android.md index 3f9e1427ba..ed0ff30fb3 100644 --- a/sources/talk/The history of Android/26 - The history of Android.md +++ b/sources/talk/The history of Android/26 - The history of Android.md @@ -1,3 +1,5 @@ +alim0x translating + The history of Android ================================================================================ ![The new "add to home screen" interface was definitely inspired by Honeycomb.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/homesetupthrowback.png) @@ -84,4 +86,4 @@ via: http://arstechnica.com/gadgets/2014/06/building-android-a-40000-word-histor [5]:http://userexperienceawards.com/uxa2012/ [6]:http://arstechnica.com/gadgets/2014/04/googles-next-design-challenge-unify-app-design-across-platforms/ [a]:http://arstechnica.com/author/ronamadeo -[t]:https://twitter.com/RonAmadeo \ No newline at end of file +[t]:https://twitter.com/RonAmadeo From cc421b59aa76db532e215be9a4c20c79fe03a37f Mon Sep 17 00:00:00 2001 From: alim0x Date: Mon, 4 Apr 2016 21:13:14 +0800 Subject: [PATCH 0593/1469] [translated]26 - The history of Android --- .../26 - The history of Android.md | 89 ------------------- .../26 - The history of Android.md | 87 ++++++++++++++++++ 2 files changed, 87 insertions(+), 89 deletions(-) delete mode 100644 sources/talk/The history of Android/26 - The history of Android.md create mode 100644 translated/talk/The history of Android/26 - The history of Android.md diff --git a/sources/talk/The history of Android/26 - The history of Android.md b/sources/talk/The history of Android/26 - The history of Android.md deleted file mode 100644 index ed0ff30fb3..0000000000 --- a/sources/talk/The history of Android/26 - The history of Android.md +++ /dev/null @@ -1,89 +0,0 @@ -alim0x translating - -The history of Android -================================================================================ -![The new "add to home screen" interface was definitely inspired by Honeycomb.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/homesetupthrowback.png) -The new "add to home screen" interface was definitely inspired by Honeycomb. -Photo by Ron Amadeo - -KitKat added a nice throwback to Honeycomb with the home screen configuration screen. On the massive 10-inch screen of a Honeycomb tablet (right picture, above), long pressing on the home screen background would present you with a zoomed-out view of all your home screens. Widgets could be dragged from the bottom widget drawer into any home screen—it was very handy. When it came time to bring the Honeycomb interface to phones, from Android 4.0 all the way to 4.3, Google skipped this design and left it to the larger screened devices, presenting only a list of options after a long press (center picture). - -For KitKat though, Google finally came up with a solution. After a long press, 4.4 presented a slightly zoomed out view—you could see the current home screen and the screens to the left and right of it. Tapping on the “widgets" button would open a full screen list of widget thumbnails, but after long-pressing on a widget, you were thrown back into the zoomed-out view and could scroll through home screen pages and place the icon where you wanted. By dragging an icon or widget all the way past the rightmost home page, you could create a new home page. - -![Contacts and the Keyboard both removed any trace of blue.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/RIP33B5E5.png) -Contacts and the Keyboard both removed any trace of blue. -Photo by Ron Amadeo - -KitKat was the end of the line for the Tron design. In most parts of the OS, any remaining blue highlights were removed in favor of gray. In the People app, blue was sucked out of the header and the letter separators in the contact list. The pictures swapped sides and the bottom bar was changed to a light gray to match the top. The Keyboard, which injected the color blue into nearly every app, was changed to gray-on-gray-on-gray. That wasn't a bad thing. Apps should be allowed to have their own color scheme—forcing a potentially clashing color on them via the keyboard wasn’t good design. - -![The first three screenshots show KitKat's dialer, and the last one is 4.3.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/phone.png) -The first three screenshots show KitKat's dialer, and the last one is 4.3. -Photo by Ron Amadeo - -Google completely revamped the dialer in KitKat, creating a wild new design that changed the way users thought about a phone. Actual numbers in the new dialer were hidden as much as possible—there wasn’t even a dial pad on the main screen. The primary interface for making a phone call was now a search bar! If you wanted to call someone in your contacts, just type their name in; if you wanted to call a business, just type the business name in and the dialer would search through Google Maps’ extensive database of phone numbers. It worked incredibly well and was something only Google could pull off. - -If searching for numbers wasn’t your thing, the app also intelligently displayed a listing for the previous phone call, your most-contacted people, and a link to all contacts. At the bottom were links to your call history, the now old school number pad, and the usual overflow button containing a settings page. - -![Office stuff: Google Drive, which was now packed in, and the printing support.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/googledrive-and-printing.png) -Office stuff: Google Drive, which was now packed in, and the printing support. -Photo by Ron Amadeo - -It was amazing it took this long, but in KitKat, Google Drive was finally included as a default app. Drive allowed users to create and edit Google Docs spreadsheets and documents, scan documents with the camera and upload them as PDFs, or view (but not edit) presentations. Drive, by this point, had a great, modern design with a slide-out navigation drawer and a Google Now-style card design. - -For even more mobile office fun, KitKat included an OS-level printing framework. At the bottom of the settings was a "Printing" screen, and any printer OEM could make a plugin for it. Google Cloud Print was, of course, one of the first supporters. Once your printer was hooked up to Cloud Print, either natively or through a computer with Chrome installed, you could print to it over the Internet. Apps needed to support the printing framework, too. Pressing the little "i" button on Google Drive would show information about the document and give you the option to print it. Just like a desktop OS, a print dialog would pop up with settings like copies, paper size, and page selection. - -![The "Photos" section of the Google+ app, which replaced the Gallery.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/that-is-one-dead-gallery.png) -The "Photos" section of the Google+ app, which replaced the Gallery. -Photo by Ron Amadeo - -Google+ Photos and the Gallery initially shipped together on the Nexus 5, but in a later build of KitKat on Google Play devices, the Gallery was axed and Google+ completely took over photo duties. The new app changed the photo app from a light theme to a dark theme, and Google+ Photos brought a modern navigation drawer design. - -Android had long included an instant upload feature, which would automatically backup all pictures on Google’s cloud storage, first on Picasa and later on Google+. The big benefit of G+ Photos over the Gallery was that it could finally manage those cloud-stored photos. Little cloud icons in the lower right of a photo indicated backup status, and it would fill from right to left to indicate an upload-in-progress. G+ photos brought its own photo editor along with support for a million of other Google+ photo features, like highlights, auto awesome, and, of course, sharing to Google+. - -![Tweaks to the Clock app, which added an alarms tab and changed the time input dialog.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/clocks.png) -Tweaks to the Clock app, which added an alarms tab and changed the time input dialog. -Photo by Ron Amadeo - -Google changed the excellent time picker that was introduced in 4.2 to this strange clock interface, which was both slower and less precise than the old interface. First you were presented with a one-handed clock which you used to choose the hour, then that clock went away and another one-handed clock allowed you to choose the minute. Having to spin the minute hand or tap a spot on the clock face made it very difficult to pick times in non-five-minute increments. Unlike the old time picker, which required you to pick a time period, this just defaulted to AM (again making it possible to accidentally be off by 12 hours). - -### Today—Android everywhere ### - -![](http://cdn.arstechnica.net/wp-content/uploads/2014/05/android-everywhere2.png) -Photo by Google/Sony/Motorola/Ron Amadeo - -What started out as a curious BlackBerry clone from a search engine company became the most popular OS in the world from one of the biggest titans in the tech industry. Android has become Google's de-facto consumer operating system, and it powers phones, tablets, Google Glass, Google TV, and more. [Parts of it][1] are even used in the Chromecast. In the future, Google will be bringing Android to watches and wearables with [Android Wear][2], and the [Open Automotive Alliance][3] will be bringing Android to cars. Google will be making a renewed commitment to the living room soon, too, with [Android TV][4]. The OS is such a core pillar of Google, that events that are supposed to cover company-wide products, like Google I/O, end up becoming Android launch parties. - -![Top row: the Google Play content stores. Bottom row: the Google Play Apps.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/2014-03-30-03.08.jpg) -Top row: the Google Play content stores. Bottom row: the Google Play Apps. -Photo by Ron Amadeo - -What was once the ugly duckling of the mobile industry has transformed so much it now [wins design awards][5] for its user interface. The design of things like Google Now have affected everything the company produces, with even the desktop sites like Search, Google+, YouTube, and Maps getting in on the card design unity. The design keeps evolving as well. Google's next plan is to [unify design][6] across not just Android, but all of its products. The goal is to take something like Gmail and make it feel the same, whether you're using it on Android, a desktop browser, or a watch. - -Google outsourced so many pieces of Android to the Play Store, that version releases are becoming less and less necessary. Google decided the best way to beat carrier and OEM update issues was to sidestep those roadblocks completely. From here on out, there isn't much left to include in an Android update other than core under-the-hood changes—but even many APIs have been pushed to Google Play Services. If you just look at version releases, it seems like Android development has slowed down from the peak 2.5-month release cycle. But the reality is Google can now continually push out improvements to the Play Store in a never-ending, somewhat subtler stream of updates. - -With 1.5 million activations per day, Android has no where to go but up. In the future, Android will be headed from phones and tablets to cars and watches, and the lower system requirements of KitKat will drive phones to even lower prices in the developing world. The bottom line? More and more people will get online. And for many of those people, Android will be not just their phone but their primary computing device. With Android leading the charge for Google in so many areas, the OS that started off as a tiny acquisition has become one of Google's most important products. - ----------- - -![Ron Amadeo](http://cdn.arstechnica.net/wp-content//uploads/authors/ron-amadeo-sq.jpg) - -[Ron Amadeo][a] / Ron is the Reviews Editor at Ars Technica, where he specializes in Android OS and Google products. He is always on the hunt for a new gadget and loves to rip things apart to see how they work. - -[@RonAmadeo][t] - --------------------------------------------------------------------------------- - -via: http://arstechnica.com/gadgets/2014/06/building-android-a-40000-word-history-of-googles-mobile-os/26/ - -译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[1]:http://blog.gtvhacker.com/2013/chromecast-exploiting-the-newest-device-by-google/ -[2]:http://arstechnica.com/gadgets/2014/03/in-depth-with-android-wear-googles-quantum-leap-of-a-smartwatch-os/ -[3]:http://arstechnica.com/information-technology/2014/01/open-automotive-alliance-aims-to-bring-android-inside-the-car/ -[4]:http://arstechnica.com/gadgets/2014/04/documents-point-to-android-tv-googles-latest-bid-for-the-living-room/ -[5]:http://userexperienceawards.com/uxa2012/ -[6]:http://arstechnica.com/gadgets/2014/04/googles-next-design-challenge-unify-app-design-across-platforms/ -[a]:http://arstechnica.com/author/ronamadeo -[t]:https://twitter.com/RonAmadeo diff --git a/translated/talk/The history of Android/26 - The history of Android.md b/translated/talk/The history of Android/26 - The history of Android.md new file mode 100644 index 0000000000..2abd7a9a70 --- /dev/null +++ b/translated/talk/The history of Android/26 - The history of Android.md @@ -0,0 +1,87 @@ +安卓编年史 +================================================================================ +![新的“添加到主屏幕”界面无疑受到了蜂巢的启发。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/homesetupthrowback.png) +新的“添加到主屏幕”界面无疑受到了蜂巢的启发。 +Ron Amadeo 供图 + +奇巧的主屏幕配置界面漂亮地对蜂巢进行了复古。在有巨大的 10 英寸屏幕的蜂巢平板上(上方右侧图片),长按主屏背景会向你展现一个所有主屏幕的缩放视图。可以从下面的小部件抽屉里将它们拖放到任意主屏上——这很方便。在将蜂巢的界面带到手机上时,从安卓 4.0 直到 4.3,谷歌都跳过了这个设计,把它留给了大屏幕设备,在手机上长按后只显示一个选项列表(中间的图片)。 + +但在奇巧上,谷歌最终给出了解决方案。在长按后,4.4 呈现一个略微缩放的视图——你可以看到当前主屏以及它左右侧的屏幕。点击“小部件”按钮会打开一个小部件略缩图的完整列表,但是长按一个小部件后,你会回到缩放视图,并且你可以在主屏页面之间滚动,将图标放在你想要的位置。将图标或者小部件拖动过最右侧的主屏页面,你可以创建一个新的主屏页面。 + +![联系人和去掉所有蓝色痕迹的键盘。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/RIP33B5E5.png) +联系人和去掉所有蓝色痕迹的键盘。 +Ron Amadeo 供图 + +奇巧是电子风格设计的完结。在系统的大多数部分,剩下的蓝色高亮都被换成了灰色。在联系人应用中,头部和联系人列表字母分割线的蓝色都移除掉了。图片的位置换了一侧,底栏变成了浅灰色以和顶部相称。几乎将蓝色渗透进每个应用的键盘,现在是灰底灰色灰高亮。这可不是件坏事。应用应该允许有它们自己的配色方案——在键盘上强迫存在潜在的颜色冲突可不是个好设计。 + +![前三张是奇巧的拨号盘,最后一张是 4.3 的。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/phone.png) +前三张是奇巧的拨号盘,最后一张是 4.3 的。 +Ron Amadeo 供图 + +谷歌完全重制了奇巧中的拨号,创造了一个疯狂的设计,改变了用户对手机的思考方式。实际上新版拨号中的数字都被尽可能地隐藏了——在首屏上甚至没有拨号盘。打电话的主要界面现在是个搜索栏!如果你想给你的联系人打电话,只要在搜索栏输入他的名字;如果你想给一个公司打电话,只要输入公司的名字,拨号会通过谷歌地图庞大的数据库找到号码。它工作得令人难以置信的好,这是只有谷歌才能完成的事情。 + +如果搜索不是你的菜的话,应用还会智能地显示通话记录列表,最常联系人,还有指向所有联系人的链接。底部的链接指向你的通话记录,传统的拨号盘,以及常规的更多操作按钮,包含一个设置页面。 + +![Office 相关:新的内置应用 Google Drive,以及打印支持。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/googledrive-and-printing.png) +Office 相关:新的内置应用 Google Drive,以及打印支持。 +Ron Amadeo 供图 + +在奇巧中 Google Drive 终于作为内置应用包含了进来,令人惊奇的是这居然用了这么长时间。Drive 允许用户创建和编辑 Google Docs 表格和文档,用相机扫描文档并作为 PDF 上传,或者查看(不能编辑)演示文稿。Drive 的设计十分现代,侧面拥有滑出式导航抽屉,并且是 Google Now 风格卡片式设计。 + +为了有更多的移动办公乐趣,奇巧包含了系统级打印框架。在设置的底部有“打印”设置界面,任何打印机 OEM 厂商都可以为它写个插件。谷歌云打印自然是首批支持者之一。只要你的打印机和云打印相连接,无论是本地或通过一台装有 Chrome 浏览器的电脑,你都可以借助网络进行打印。应用同样也需要支持打印框架。点击 Google Drive 里的“i”按钮会显示文档信息,并且给你打印的选项。就像桌面系统那样,会弹出一个设置对话框,有打印份数,纸张尺寸,以及页面选择等选项。 + +![Google+ 应用的“相片”部分,它取代了相册。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/that-is-one-dead-gallery.png) +Google+ 应用的“相片”部分,它取代了相册。 +Ron Amadeo 供图 + +Google+ 相片和相册最初都在 Nexus 5 上随附,但在 Google Play 设备稍晚版本的奇巧上,相册被砍掉了,Google+ 完全接手了相片管理。新应用的主题从深色变成了浅色,Google+ 相片还带来了现代的导航抽屉设计。 + +安卓一直以来都有即时上传功能,它会自动备份所有图片到谷歌的云存储,开始是 Picasa 后来是 Google+。G+ 相片相比相册最大的好处是它可以管理那些云端存储的图片。图片右下角的云图标指示备份状态,它会从右到左地填满来指示正在上传。G+ 相片带来了它自己的照片编辑器,还有许多其它的 Google+ 图片功能,比如高亮,自动美化,当然,还有分享到 Google+。 + +![时钟应用的调整,添加了一个闹钟页面并修改了时间输入框。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/clocks.png) +时钟应用的调整,添加了一个闹钟页面并修改了时间输入框。 +Ron Amadeo 供图 + +谷歌将 4.2 引入的优秀时间选择器换成了一个奇怪的时钟界面,操作起来比旧界面更慢了也更不精确了。首先是个可以选择小时的单指针时钟,然后显示的是另一个选择分钟的单指针时钟。选择的时候要转动分针或点击数字,这让用用户很难选择不是整五分钟的时间增量。不像之前的时间选择器需要选择一个时间段,这里默认时间段是 AM(重复一下,这样设置的时候容易不小心偏差 12 小时)。 + +### 今日安卓无处不在 ### + +![](http://cdn.arstechnica.net/wp-content/uploads/2014/05/android-everywhere2.png) +图片来自 Google/Sony/Motorola/Ron Amadeo + +一开始从一家搜索引擎公司的古怪的黑莓复制品,一步一步到如今科技界巨头之一在世界上最流行的系统。安卓已经成为谷歌的实际消费者操作系统,它驱动着手机,平板,Google Glass,Google TV,甚至更多。[它的一部分][1]甚至还用到了 Chromecast 中。在未来,谷歌还会将 [Android Wear][2] 带到手表和可穿戴设备上,[开放汽车联盟][3] 要将安卓带到汽车上。不久后会谷歌再次承诺对客厅的计划,带上 [Android TV][4]。这个系统对谷歌是如此重要的支柱,原本应该覆盖全公司产品的大会活动,比如 Google I/O,俨然成为了安卓发布派对。 + +![上排:谷歌 Play 内容商店。下排:谷歌 Play 应用。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/2014-03-30-03.08.jpg) +上排:谷歌 Play 内容商店。下排:谷歌 Play 应用。 +Ron Amadeo 供图 + +移动产业曾经的的丑小鸭脱胎换骨,它的用户界面还[赢得了设计奖项][5]。像 Google Now 一样的设计风格影响了整个公司的产品,甚至连像搜索,Google+,Youtube,以及地图这样的桌面站点都加入了卡片式设计中。设计也在不断地演进。谷歌下一步[统一设计][6]的计划不仅是面对安卓,也包括了所有的产品。谷歌的目标是让你不管在安卓,还是桌面浏览器,或是一个手表上,使用像 Gmail 这样的服务时都能有一样的体验。 + +谷歌将很多安卓的组件转移到 Play 商店,这样版本发布就越来越不重要了。谷歌决定了解决运营商和 OEM 厂商更新问题的最佳途径,就是完全绕开这些绊脚石。从这里开始,在一个安卓更新里除了核心底层变动外就没什么内容了——但是更多的 API 被加入了谷歌 Play 服务。如果你只看版本更新的话,相对安卓高峰期 2.5 个月的发布周期来说开发已经放缓了。但实际情况是谷歌现在可以持续将改进推送到 Play 商店,从周期发布变成了永无止境,有些微妙的更新流。 + +每天 150 万台设备激活,安卓除了增长就是增长。在未来,安卓会是手机和平板到汽车和手表的领军者,奇巧更低的系统配置要求也会让发展中国家的手机价格更低。结果呢?越来越多的人会来到线上。对那里的大多数人来说,安卓不止是他们的手机,也是他们首要的计算设备。随着安卓为谷歌领导掌管众多领域,从一个小收购而来的系统逐渐成长为了谷歌最重要的产品。 + +---------- + +![Ron Amadeo](http://cdn.arstechnica.net/wp-content//uploads/authors/ron-amadeo-sq.jpg) + +[Ron Amadeo][a] / Ron是Ars Technica的评论编缉,专注于安卓系统和谷歌产品。他总是在追寻新鲜事物,还喜欢拆解事物看看它们到底是怎么运作的。 + +[@RonAmadeo][t] + +-------------------------------------------------------------------------------- + +via: http://arstechnica.com/gadgets/2014/06/building-android-a-40000-word-history-of-googles-mobile-os/26/ + +译者:[alim0x](https://github.com/alim0x) 校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[1]:http://blog.gtvhacker.com/2013/chromecast-exploiting-the-newest-device-by-google/ +[2]:http://arstechnica.com/gadgets/2014/03/in-depth-with-android-wear-googles-quantum-leap-of-a-smartwatch-os/ +[3]:http://arstechnica.com/information-technology/2014/01/open-automotive-alliance-aims-to-bring-android-inside-the-car/ +[4]:http://arstechnica.com/gadgets/2014/04/documents-point-to-android-tv-googles-latest-bid-for-the-living-room/ +[5]:http://userexperienceawards.com/uxa2012/ +[6]:http://arstechnica.com/gadgets/2014/04/googles-next-design-challenge-unify-app-design-across-platforms/ +[a]:http://arstechnica.com/author/ronamadeo +[t]:https://twitter.com/RonAmadeo From 1373c5195086d0c99e9f7e6d898a16675e13f041 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 5 Apr 2016 09:37:13 +0800 Subject: [PATCH 0594/1469] PUB:20151126 Microsoft and Linux--True Romance or Toxic Love @sonofelice --- ...t and Linux--True Romance or Toxic Love.md | 77 +++++++++++++++++++ ...t and Linux--True Romance or Toxic Love.md | 77 ------------------- 2 files changed, 77 insertions(+), 77 deletions(-) create mode 100644 published/20151126 Microsoft and Linux--True Romance or Toxic Love.md delete mode 100644 translated/talk/20151126 Microsoft and Linux--True Romance or Toxic Love.md diff --git a/published/20151126 Microsoft and Linux--True Romance or Toxic Love.md b/published/20151126 Microsoft and Linux--True Romance or Toxic Love.md new file mode 100644 index 0000000000..4499e7273f --- /dev/null +++ b/published/20151126 Microsoft and Linux--True Romance or Toxic Love.md @@ -0,0 +1,77 @@ +微软和 Linux :真正的浪漫还是有毒的爱情? +================================================================================ +时不时的我们会读到一个能让你喝咖啡呛到或者把热拿铁喷到你显示器上的新闻故事。微软最近宣布的对 Linux 的钟爱就是这样一个鲜明的例子。 + +从常识来讲,微软和自由开源软件(FOSS)运动就是恒久的敌人。在很多人眼里,微软体现了过分的贪婪,而这正为自由开源软件运动(FOSS)所拒绝。另外,之前微软就已经给自由开源软件社区贴上了"一伙强盗"的标签。 + +我们能够理解为什么微软一直以来都害怕免费的操作系统。免费操作系统结合挑战微软核心产品线的开源应用时,就威胁到了微软在台式机和笔记本电脑市场的控制地位。 + +尽管微软有对在台式机主导地位的担忧,在网络服务器市场 Linux 却有着最高的影响力。今天,大多数的服务器都是 Linux 系统。包括世界上最繁忙的站点服务器。对微软来说,看到这么多无法装到兜里的许可证的营收一定是非常痛苦的。 + +掌上设备是微软输给自由软件的另一个领域。曾几何时,微软的 Windows CE 和 Pocket PC 操作系统走在移动计算的前沿。Windows PDA 设备是最闪亮的和豪华的产品。但是这一切在苹果公司发布了iphone之后都结束了。从那时起,安卓就开始进入公众视野,Windows 的移动产品开始被忽略被遗忘。而安卓平台是建立在自由开源的组件的基础上的。 + +由于安卓平台的开放性,安卓的市场份额在迅速扩大。不像 IOS,任何一个手机制造商都可以发布安卓手机。也不像Windows 手机,安卓没有许可费用。这对消费者来说是件好事。这也导致了许多强大却又价格低廉的手机制造商在世界各地涌现。这非常明确的证明了自由开源软件(FOSS)的价值。 + +在服务器和移动计算的角逐中失利对微软来说是非常惨重的损失。考虑一下服务器和移动计算这两个加起来所占有的市场大小,台式机市场似乎是死水一潭。没有人喜欢失败,尤其是涉及到金钱。并且,微软确实有许多东西正在慢慢失去。你可能期望着微软自尝苦果。在过去,确实如此。 + +微软使用了各种可以支配的手段来对 Linux 和自由开源软件(FOSS)进行反击,从宣传到专利威胁。尽管这种攻击确实减慢了适配 Linux 的步伐,但却从来没有让 Linux 的脚步停下。 + +所以,当微软在开源大会和重大事件上拿出印有“Microsoft Loves Linux”的T恤和徽章时,请原谅我们表现出来的震惊。这是真的吗?微软真的爱 Linux ? + +当然,公关的口号和免费的T恤并不代表真理。行动胜于雄辩。当你思考一下微软的行动时,微软的立场就变得有点模棱两可了。 + +一方面,微软招募了几百名 Linux 开发者和系统管理员。将 .NET 核心框架作为一个开源的项目进行了发布,并提供了跨平台的支持(这样 .NET 就可以跑在 OS X 和 Linux 上了)。并且,微软与 Linux 公司合作把最流行的发行版本放到了 Azure 平台上。事实上,微软已经走的如此之远以至于要为 Azure 数据中心开发自己的 Linux 发行版了。 + +另一方面,微软继续直接通过法律或者傀儡公司来对开源项目进行攻击。很明显,微软在与自由软件的所有权较量上并没有发自内心的进行大的道德转变。那为什么要公开申明对 Linux 的钟爱之情呢? + +一个显而易见的事实:微软是一个经营性实体。对股东来说是一个投资工具,对雇员来说是收入来源。微软所做的只有一个终极目标:盈利。微软并没有表现出来爱或者恨(尽管这是一个最常见的指控)。 + +所以问题不应该是"微软真的爱 Linux 吗?"相反,我们应该问,微软是怎么从这一切中获利的。 + +让我们以 .NET 核心框架的开源发行为例。这一举动使得 .NET 的运行时环境移植到任何平台都很轻松。这使得微软的 .NET 框架所涉及到的范围远远大于 Windows 平台。 + +开放 .NET 的核心包,最终使得 .NET 开发者开发跨平台的 app 成为可能,比如 OS X、Linux 甚至安卓——都基于同一个核心代码库。 + +从开发者角度来讲,这使得 .NET 框架比之前更有吸引力了。能够从单一的代码库触及到多个平台,使得使用 .NET 框架开发的任何 app 戏剧性的扩大了潜在的目标市场。 + +另外,一个强大的开源社区能够提供给开发者一些代码来在他们自己的项目中进行复用。所以,开源项目的可利用性也将会成就 .NET 框架。 + +更进一步讲,开放 .NET 的核心代码能够减少跨越不同平台所产生的碎片,意味着对消费者来说有对 app 更广的选择。无论是开源软件还是专用的 app,都有更多的选择。 + +从微软的角度来讲,会得到一队开发者大军。微软可以通过销售培训、证书、技术支持、开发者工具(包括 Visual Studio)和应用扩展来获利。 + +我们应该自问的是,这对自由软件社区有利还是有弊? + +.NET 框架的大范围适用意味着许多参与竞争的开源项目的消亡,迫使我们会跟着微软的节奏走下去。 + +先抛开 .NET 不谈,微软正在花费大量的精力在 Azure 云计算平台对 Linux 的支持上。要记得,Azure 最初是 Windows 的 Azure。Windows 服务器是唯一能够支持 Azure 的操作系统。今天,Azure 也提供了对多个 Linux 发行版的支持。 + +关于此,有一个原因:付费给需要或者想要 Linux 服务的顾客。如果微软不提供 Linux 虚拟机,那些顾客就会跟别人合作了。 + +看上去好像是微软意识到“Linux 就在这里”的这样一个现实。微软不能真正的消灭它,所以必须接收它。 + +这又把我们带回到那个问题:关于微软和 Linux 为什么有这么多的流言?我们在谈论这个问题,因为微软希望我们思考这个问题。毕竟,所有这些谈资都会追溯到微软,不管是在新闻稿、博客还是会议上的公开声明。微软在努力吸引大家对其在 Linux 专业知识方面的注意力。 + +首席架构师 Kamala Subramaniam 的博文声明 Azure Cloud Switch 背后的其他企图会是什么?ACS 是一个定制的 Linux 发行版。微软用它来对 Azure 数据中心的交换机硬件进行自动配置。 + +ACS 不是公开的。它是用于 Azure 内部使用的。别人也不太可能找到这个发行版其他的用途。事实上,Subramaniam 在她的博文中也表述了同样的观点。 + +所以,微软不会通过卖 ACS 来获利,也不会通过赠送它而增加用户基数。相反,微软在 Linux 和 Azure 上花费精力,以加强其在 Linux 云计算平台方面的地位。 + +微软最近迷上 Linux 对社区来说是好消息吗? + +我们不应该慢慢忘记微软的“拥抱、扩展、消灭(Embrace, Extend and Exterminate)”的诅咒。现在,微软处在拥抱 Linux 的初期阶段。微软会通过定制扩展和专有“标准”来分裂社区吗? + +发表评论吧,让我们知道你是怎么想的。 + +-------------------------------------------------------------------------------- + +via: http://www.linuxjournal.com/content/microsoft-and-linux-true-romance-or-toxic-love-0 + +作者:[James Darvell][a] +译者:[sonofelice](https://github.com/sonofelice) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linuxjournal.com/users/james-darvell \ No newline at end of file diff --git a/translated/talk/20151126 Microsoft and Linux--True Romance or Toxic Love.md b/translated/talk/20151126 Microsoft and Linux--True Romance or Toxic Love.md deleted file mode 100644 index d16ed99114..0000000000 --- a/translated/talk/20151126 Microsoft and Linux--True Romance or Toxic Love.md +++ /dev/null @@ -1,77 +0,0 @@ -微软和 Linux :真正的浪漫还是有毒的爱情? -================================================================================ -时不时的我们会读到一个能让你喝咖啡呛到或者把热拿铁喷到你显示器上的新闻故事。微软最近宣布的对 Linux 的钟爱就是这样一个鲜明的例子。 - -从常识来讲,微软和自由开源软件(FOSS)运动就是恒久的敌人。在很多人眼里,微软体现了过分的贪婪,而这正为自由开源软件运动(FOSS)所拒绝。另外,之前微软就已经给自由开源软件社区贴上了"一伙强盗"的标签。 - -我们能够理解为什么微软一直以来都害怕免费的操作系统。免费操作系统结合挑战微软核心产品线的开源应用时,就威胁到了微软在台式机和笔记本电脑市场的控制地位。 - -尽管微软有对在台式机主导地位的担忧,在网络服务器市场 Linux 却有着最高的影响力。今天,大多数的服务器都是 Linux 系统。包括世界上最繁忙的站点服务器。对微软来说,看到这么多没有被声明的许可证收入一定是非常痛苦的。 - -掌上设备是微软输给免费软件的另一个领域。曾几何时,微软的 Windows CE 和 Pocket PC 操作系统走在移动计算的前沿。Windows PDA 设备是最闪亮的和豪华的产品。但是这一切在苹果公司发布了iphone之后都结束了。从那时起,安卓已经开始进入公众视野,Windows的移动产品开始被忽略被遗忘。而安卓平台是建立在免费开源的组件的基础上的。 - -由于安卓平台的开放性,安卓的市场份额在迅速扩大。不像 IOS,任何一个手机制造商都可以发布安卓手机。也不像Windows手机,安卓没有许可费用。这对消费者来说是件好事。这也导致了许多强大却又价格低廉的手机制造商在世界各地涌现。这非常明确的证明了自由开源软件(FOSS)的价值。 - -在服务器和移动计算的角逐中失利对微软来说是非常惨重的损失。考虑一下服务器和移动计算这两个加起来所占有的市场大小,台式机市场似乎是死水一潭。没有人喜欢失败,尤其是涉及到金钱。并且,微软确实有许多正在慢慢失去。你可能期望着微软自尝苦果。在过去,确实如此。 - -微软使用了各种可以支配的手段来对 Linux 和自由开源软件(FOSS)进行反击,从宣传到专利威胁。尽管这种攻击确实减慢了适配 Linux 的步伐,但却从来没有让 Linux 的脚步停下。 - -所以,当微软在开源大会和重大事件上拿出印有"Microsoft Loves Linux"的T-恤和徽章时,请原谅我们表现出来的震惊。这是真的吗?微软真的爱 Linux ? - -当然,公关的口号和免费的T-恤并不代表真理。行动胜于雄辩。当你思考一下微软的行动时,微软的立场就变得有点模棱两可了。 - -一方面,微软招募了几百名 Linux 开发者和系统管理员。将 .NET 核心框架作为一个开源的项目进行了发布,并提供了跨平台的支持(这样 .NET 就可以跑在 OS X 和 Linux 上了)。并且,微软与 Linux 公司合作把最流行的发型版本放到了Azure平台上。事实上,微软已经走的如此之远以至于要为Azure数据中心开发自己的Linux发行版了。 - -另一方面,微软继续直接通过法律或者傀儡公司来对开源项目进行攻击。很明显,微软在与自由软件的所有权较量上并没有发自内心的进行大的道德转变。那为什么要公开生命对Linux的钟爱之情呢? - -一个显而易见的事实:微软是一个经营性实体。对股东来说是一个投资工具,对雇员来说是收入来源。微软所做的只有一个终极目标:盈利。微软并没有表现出来爱或者恨(尽管这是一个最常见的指控)。 - -所以问题不应该是"微软真的爱 Linux 吗?"相反,我们应该问,微软是怎么从这一切中获利的。 - -让我们以 .NET 核心框架的开源发行为例。这一举动使得任何平台都很容易进入 .NET 的运行时环境。这使得微软的.NET框架所涉及到的范围远远大于Windows平台。 - -开放 .NET 的核心包,最终使得 .NET 开发者开发跨平台的app成为可能,比如OS X,Linux甚至安卓——都基于同一个核心代码库。 - -从开发者角度来讲,这使得.NET框架比之前更有吸引力了。能够从单一的代码库就可以触及到多个平台,使得使用.NET框架开发的任何app戏剧性的扩大了潜在的目标市场。 - -另外,一个强大的开源社区能够提供给开发者一些代码来在他们自己的项目中进行服用。所以,开源项目的可利用性也将会成就.NET框架。 - -更进一步讲,开放 .NET 的核心代码能够减少跨越不同平台锁产生的碎片,意味着对消费者来说有对app更广的选择。无论是开源软件还是专用的app,都有更多的选择。 - -从微软的角度来讲,会得到一队开发者大军。微软可以通过销售培训、证书、技术支持、开发者工具(包括Visual Studio)和应用扩展来获利。 - -我们应该自问的是,这对自由软件社区有利还是有弊? - -.NET 框架的大范围适用意味着许多参与竞争的开源项目的消亡,迫使我们会跟着微软的节奏走下去。 - -先抛开.NET不谈,微软正在花费大量的精力在Linux对Azure云计算平台的支持上。要记得,Azure最初是Windows的Azure。Windows服务器是唯一能够支持Azure的操作系统。今天,Azure也提供了对多个Linux发行版的支持。 - -关于此,有一个原因:付费给需要或者想要Linux服务的顾客。如果微软不提供Linux虚拟机,那些顾客就会跟别人合作了。 - -看上去好像是微软意识到"Linux就在这里"的这样一个现实。微软不能真正的消灭它,所以必须接收它。 - -这又把我们带回到那个问题:关于微软和Linux为什么有这么多的流言?我们在谈论这个问题,因为微软希望我们思考这个问题。毕竟,所有这些谈资都会追溯到微软,不管是在新闻稿、博客还是会议上的公开声明。微软在努力吸引大家对其在Linux专业知识方面的注意力。 - -首席架构师 Kamala Subramaniam 的博文声明Azure Cloud Switch背后的其他企图会是什么?ACS是一个定制的Linux发行版。微软用它来对Azure数据中心的开关硬件进行自动配置。 - -ACS不是公开的。它是用于Azure内部使用的。别人也不太可能找到这个发行版其他的用途。事实上,Subramaniam 在她的博文中也表述了同样的观点。 - -所以,微软不会通过卖ACS来获利,也不会因为放弃使用而获得一个用户基础。相反,微软在Linux和Azure上花费经历,加强其在Linux云计算平台方面的地位。 - -微软最近迷上Linux对社区来说是好消息吗? - -我们不应该慢慢忘记微软的"拥抱、扩展、消灭"的诅咒。现在,微软处在拥抱Linux的初期阶段。微软会通过定制扩展和专有标准来分裂社区吗? - -赶紧评论吧,让我们知道你是怎么想的。 - --------------------------------------------------------------------------------- - -via: http://www.linuxjournal.com/content/microsoft-and-linux-true-romance-or-toxic-love-0 - -作者:[James Darvell][a] -译者:[sonofelice](https://github.com/sonofelice) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.linuxjournal.com/users/james-darvell \ No newline at end of file From ba4100d39716ccde39113ca3ac7d8f693f6837a9 Mon Sep 17 00:00:00 2001 From: alim0x Date: Tue, 5 Apr 2016 09:44:30 +0800 Subject: [PATCH 0595/1469] [translating]8 things to do after installing openSUSE Leap --- ...151202 8 things to do after installing openSUSE Leap 42.1.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20151202 8 things to do after installing openSUSE Leap 42.1.md b/sources/tech/20151202 8 things to do after installing openSUSE Leap 42.1.md index b941c3d611..8456c9c46a 100644 --- a/sources/tech/20151202 8 things to do after installing openSUSE Leap 42.1.md +++ b/sources/tech/20151202 8 things to do after installing openSUSE Leap 42.1.md @@ -1,3 +1,5 @@ +alim0x translating + 8 things to do after installing openSUSE Leap 42.1 ================================================================================ ![Credit: Metropolitan Transportation/Flicrk](http://images.techhive.com/images/article/2015/11/things-to-do-100626947-primary.idge.jpg) From 15bb9c838be97deee426b5d3fac707e34e785772 Mon Sep 17 00:00:00 2001 From: pengkai Date: Tue, 5 Apr 2016 12:38:43 +0800 Subject: [PATCH 0596/1469] kylepeng93 is translating --- .../20160225 How to add open source experience to your resume.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160225 How to add open source experience to your resume.md b/sources/tech/20160225 How to add open source experience to your resume.md index 73e22c2b8b..8a3a3e09cf 100644 --- a/sources/tech/20160225 How to add open source experience to your resume.md +++ b/sources/tech/20160225 How to add open source experience to your resume.md @@ -1,3 +1,4 @@ +kylepeng93 is translating!!! How to add open source experience to your resume ================================================== From 2469f5580888e36b1934243e0da51a7d8bb038ea Mon Sep 17 00:00:00 2001 From: Zhengyu_Li Date: Tue, 5 Apr 2016 21:33:55 +0800 Subject: [PATCH 0597/1469] Update 20160218 A Linux-powered microwave oven.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [翻译中]20160218 A Linux-powered microwave oven.md --- sources/tech/20160218 A Linux-powered microwave oven.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160218 A Linux-powered microwave oven.md b/sources/tech/20160218 A Linux-powered microwave oven.md index 109212ad14..47db1ae9d6 100644 --- a/sources/tech/20160218 A Linux-powered microwave oven.md +++ b/sources/tech/20160218 A Linux-powered microwave oven.md @@ -1,3 +1,4 @@ +translating by yuba0604 A Linux-powered microwave oven ================================================================================ From 0bdd4580470df8a137f28f55bd04699a87213b80 Mon Sep 17 00:00:00 2001 From: alim0x Date: Wed, 6 Apr 2016 21:38:24 +0800 Subject: [PATCH 0598/1469] [translated]8 things to do after installing openSUSE Leap --- ... do after installing openSUSE Leap 42.1.md | 110 ------------------ ... do after installing openSUSE Leap 42.1.md | 108 +++++++++++++++++ 2 files changed, 108 insertions(+), 110 deletions(-) delete mode 100644 sources/tech/20151202 8 things to do after installing openSUSE Leap 42.1.md create mode 100644 translated/tech/20151202 8 things to do after installing openSUSE Leap 42.1.md diff --git a/sources/tech/20151202 8 things to do after installing openSUSE Leap 42.1.md b/sources/tech/20151202 8 things to do after installing openSUSE Leap 42.1.md deleted file mode 100644 index 8456c9c46a..0000000000 --- a/sources/tech/20151202 8 things to do after installing openSUSE Leap 42.1.md +++ /dev/null @@ -1,110 +0,0 @@ -alim0x translating - -8 things to do after installing openSUSE Leap 42.1 -================================================================================ -![Credit: Metropolitan Transportation/Flicrk](http://images.techhive.com/images/article/2015/11/things-to-do-100626947-primary.idge.jpg) -Credit: [Metropolitan Transportation/Flicrk][1] - -> You've installed openSUSE on your PC. Here's what to do next. - -[openSUSE Leap is indeed a huge leap][2], allowing users to run a distro that has the same DNA of SUSE Linux Enterprise. Like any other operating system, some work is needed to get it set up for optimal use. - -Following are some of the things that I did after installing openSUSE Leap on my PC (these are not applicable for server installations). None of them are mandatory, and you may be fine with the basic install. But if you need more out of your openSUSE Leap, follow me. - -### 1. Adding Packman repository ### - -Due to software patents and licences, openSUSE, like many Linux distributions, doesn't offer many applications, codecs, and drivers through official repositories (repos). Instead, these are made available through 3rd party or community repos. The first and most important repository is 'Packman'. Since these repos are not enabled by default, we have to add them. You can do so either using YaST (one of the gems of openSUSE) or by command line (instructions below). - -![o42 yast repo](http://images.techhive.com/images/article/2015/11/o42-yast-repo-100626952-large970.idge.png) -Adding Packman repositories. - -Using YaST, go to the Software Repositories section. Click on the 'Add’ button and select 'Community Repositories.' Click 'next.' And once the repos are loaded, select the Packman Repository. Click 'OK,' then import the trusted GnuPG key by clicking on the 'Trust' button. - -Or, using the terminal you can add and enable the Packman repo using the following command: - - zypper ar -f -n packmanhttp://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Leap_42.1/ packman - -Once the repo is added, you have access to many more packages. To install any application or package, open YaST Software Manager, search for the package and install it. - -### 2. Install VLC ### - -VLC is the Swiss Army knife of media players and can play virtually any media file. You can install VLC from YaST Software Manager or from software.opensuse.org. You will need to install two packages: vlc and vlc-codecs. - -If using terminal, run the following command: - - sudo zypper install vlc vlc-codecs - -### 3. Install Handbrake ### - -If you need to transcode or convert your video files from one format to another, [Handbrake is the tools for you][3]. Handbrake is available through repositories we enabled, so just search for it in YaST and install. - -If you are using the terminal, run the following command: - - sudo zypper install handbrake-cli handbrake-gtk - -(Pro tip: VLC can also transcode audio and video files.) - -### 4. Install Chrome ### - -OpenSUSE comes with Firefox as the default browser. But since Firefox isn't capable of playing restricted media such as Netflix, I recommend installing Chrome. This takes some extra work. First you need to import the trusted key from Google. Open the terminal app and run the 'wget' command to download the key: - - wget https://dl.google.com/linux/linux_signing_key.pub - -Then import the key: - - sudo rpm --import linux_signing_key.pub - -Now head over to the [Google Chrome website][4] and download the 64 bit .rpm file. Once downloaded run the following command to install the browser: - - sudo zypper install /PATH_OF_GOOGLE_CHROME.rpm - -### 5. Install Nvidia drivers ### - -OpenSUSE Leap will work out of the box even if you have Nvidia or ATI graphics cards. However, if you do need the proprietary drivers for gaming or any other purpose, you can install such drivers, but some extra work is needed. - -First you need to add the Nvidia repositories; it's the same procedure we used to add Packman repositories using YaST. The only difference is that you will choose Nvidia from the Community Repositories section. Once it's added, go to **Software Management > Extras** and select 'Extras/Install All Matching Recommended Packages'. - -![o42 nvidia](http://images.techhive.com/images/article/2015/11/o42-nvidia-100626950-large.idge.png) - -It will open a dialogue box showing all the packages it's going to install, click OK and follow the instructions. You can also run the following command after adding the Nvidia repository to install the needed Nvidia drivers: - - sudo zypper inr - -(Note: I have never used AMD/ATI cards so I have no experience with them.) - -### 6. Install media codecs ### - -Once you have VLC installed you won't need to install media codecs, but if you are using other apps for media playback you will need to install such codecs. Some developers have written scripts/tools which makes it a much easier process. Just go to [this page][5] and install the entire pack by clicking on the appropriate button. It will open YaST and install the packages automatically (of source you will have to give the root password and trust the GnuPG key, as usual). - -### 7. Install your preferred email client ### - -OpenSUSE comes with Kmail or Evolution, depending on the Desktop Environment you installed on the system. I run Plasma, which comes with Kmail, and this email client leaves a lot to be desired. I suggest trying Thunderbird or Evolution mail. All major email clients are available through official repositories. You can also check my [handpicked list of the best email clients for Linux][7]. - -### 8. Enable Samba services from Firewall ### - -OpenSUSE offers a much more secure system out of the box, compared to other distributions. But it also requires a little bit more work for a new user. If you are using Samba protocol to share files within your local network then you will have to allow that service from the Firewall. - -![o42 firewall](http://images.techhive.com/images/article/2015/11/o42-firewall-100626948-large970.idge.png) -Allow Samba Client and Server from Firewall settings. - -Open YaST and search for Firewall. Once in Firewall settings, go to 'Allowed Services' where you will see a drop down list under 'Service to allow.' Select 'Samba Client,' then click 'Add.' Do the same with the 'Samba Server' option. Once both are added, click 'Next,' then click 'Finish,' and now you will be able to share folders from your openSUSE system and also access other machines over the local network. - -That's pretty much all that I did on my new openSUSE system to set it up just the way I like it. If you have any questions, please feel free to ask in the comments below. - --------------------------------------------------------------------------------- - -via: http://www.itworld.com/article/3003865/open-source-tools/8-things-to-do-after-installing-opensuse-leap-421.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://www.flickr.com/photos/mtaphotos/11200079265/ -[2]:https://www.linux.com/news/software/applications/865760-opensuse-leap-421-review-the-most-mature-linux-distribution -[3]:https://www.linux.com/learn/tutorials/857788-how-to-convert-videos-in-linux-using-the-command-line -[4]:https://www.google.com/intl/en/chrome/browser/desktop/index.html#brand=CHMB&utm_campaign=en&utm_source=en-ha-na-us-sk&utm_medium=ha -[5]:http://opensuse-community.org/ -[6]:http://www.itworld.com/article/2875981/the-5-best-open-source-email-clients-for-linux.html diff --git a/translated/tech/20151202 8 things to do after installing openSUSE Leap 42.1.md b/translated/tech/20151202 8 things to do after installing openSUSE Leap 42.1.md new file mode 100644 index 0000000000..109bf6c11d --- /dev/null +++ b/translated/tech/20151202 8 things to do after installing openSUSE Leap 42.1.md @@ -0,0 +1,108 @@ +装好 openSUSE Leap 42.1 之后要做的 8 件事 +================================================================================ +![Credit: Metropolitan Transportation/Flicrk](http://images.techhive.com/images/article/2015/11/things-to-do-100626947-primary.idge.jpg) +致谢:[Metropolitan Transportation/Flicrk][1] + +> 你已经在你的电脑上安装了 openSUSE。这是你接下来要做的。 + +[openSUSE Leap 确实是个巨大的飞跃][2],它允许用户运行一个和 SUSE Linux 企业版拥有一样基因的发行版。和其它系统一样,在使用它之前需要做些优化设置。 + +下面是一些我在安装 openSUSE 到我的电脑上之后做的一些事情(不适用于服务器)。这里面没有强制性要求的设置,基本安装对来说你也可能足够了。但如果你想获得更好的 openSUSE Leap 体验,那就跟着我往下看吧。 + +### 1. 添加 Packman 仓库 ### + +由于专利和授权等原因,openSUSE 和许多 Linux 发行版一样,不通过官方仓库(repos)提供一些软件,解码器,以及驱动等。取而代之的是通过第三方或社区仓库来提供。第一个也是最重要的仓库是“Packman”。因为这些仓库不是默认启用的,我们需要添加它们。你可以通过 YaST (openSUSE 的特色之一)或者命令行完成(如下方介绍)。 + +![o42 yast repo](http://images.techhive.com/images/article/2015/11/o42-yast-repo-100626952-large970.idge.png) +添加 Packman 仓库。 + +使用 YsST,打开软件源部分。点击“添加”按钮并选择“社区仓库(Community Repositories)”。点击“下一步”。一旦仓库列表加载出来了,选择 Packman 仓库。点击“确认”,然后点击“信任”导入信任的 GnuPG 密钥。 + +或者在终端里使用以下命令添加并启用 Packman 仓库: + + zypper ar -f -n packmanhttp://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Leap_42.1/ packman + +仓库添加之后,你就能接触到更多的包了。想安装任意软件或包,打开 YaST 软件管理器,搜索并安装即可。 + +### 2. 安装 VLC ### + +VLC 是媒体播放器里的瑞士军刀,几乎可以播放任何媒体文件。你可以从 YaST 软件管理器 或 software.opensuse.org 安装 VLC。你需要安装两个包:vlc 和 vlc-codecs。 + +如果你用终端,运行以下命令: + + sudo zypper install vlc vlc-codecs + +### 3. 安装 Handbrake ### + +如果你需要转码或转换视频文件格式,[Handbrake 是你的不二之选][3]。Handbrake 就在我们启用的仓库中,所以只要在 YaST 中搜索并安装它。 + +如果你用终端,运行以下命令: + + sudo zypper install handbrake-cli handbrake-gtk + +(提示:VLC 也能转码音频和视频文件。) + +### 4. 安装 Chrome ### + +openSUSE 的默认浏览器是 Firefox。但是因为 Firefox 不能胜任播放专有媒体,比如 Netflix,我推荐安装 Chrome。这需要额外的工作。首先你需要从谷歌导入信任密钥。打开终端执行“wget”命令下载密钥: + + wget https://dl.google.com/linux/linux_signing_key.pub + +然后导入密钥: + + sudo rpm --import linux_signing_key.pub + +现在到 [Google Chrome 网站][4] 去,下载 64 位 .rpm 文件。下载完成后执行以下命令安装浏览器: + + sudo zypper install /PATH_OF_GOOGLE_CHROME.rpm + +### 5. 安装 Nvidia 驱动 ### + +即便你有 Nvidia 或 ATI 显卡,openSUSE Leap 也能够开箱即用。但是,如果你需要专有驱动来游戏或其它目的,你可以安装这些驱动,但需要一点额外的工作。 + +首先你需要添加 Nvidia 源;它的步骤和使用 YaST 添加 Packman 仓库是一样的。唯一的不同是你需要在社区仓库部分选择 Nvidia。添加好了之后,到 **软件管理 > 附加** 去并选择“附加/安装所有匹配的推荐包”。 + +![o42 nvidia](http://images.techhive.com/images/article/2015/11/o42-nvidia-100626950-large.idge.png) + +它会打开一个对话框,显示所有将要安装的包,点击确认后按介绍操作。添加了 Nvidia 源之后你也可以通过命令安装需要的 Nvidia 驱动: + + sudo zypper inr + +(注:我没使用过 AMD/ATI 显卡,所以这方面我没有经验。) + +### 6. 安装媒体解码器 ### + +你安装 VLC 之后就不需要安装媒体解码器了,但如果你要使用其它软件来播放媒体的话就需要安装了。一些开发者写了脚本/工具来简化这个过程。打开[这个页面][5]并点击合适的按钮安装完整的包。他会打开 YaST 并自动安装包(当然通常你还需要提供 root 权限密码并信任 GnuPG 密钥)。 + +### 7. 安装你偏好的电子邮件客户端 ### + +openSUSE 自带 Kmail 或 Evolution,这取决于你安装的桌面环境。我用的是 Plasma,自带 Kmail,这个邮件客户端还有许多地方有待改进。我建议可以试试 Thunderbird 或 Evolution。所有主要的邮件客户端都能在官方仓库找到。你还可以看看我的[精心挑选的 Linux 最佳邮件客户端][7]。 + +### 8. 在防火墙允许 Samba 服务 ### + +相比于其它发行版,openSUSE 默认提供了更加安全的系统。但对新用户来说它也需要一点设置。如果你正在使用 Samba 协议分享文件到本地网络的话,你需要在防火墙允许该服务。 + +![o42 firewall](http://images.techhive.com/images/article/2015/11/o42-firewall-100626948-large970.idge.png) +在防火墙设置里允许 Samba 客户端和服务端 + +打开 YaST 并搜索 Firewall。在防火墙设置里,到“允许的服务”那里你会在“要允许的服务”下面看到一个下拉列表。选择“Samba 客户端”,然后点击“添加”。对“Samba 服务端”也一样地添加。都添加了之后,点击“下一步”,然后点击“完成”,现在你就可以通过本地网络从你的 openSUSE 分享文件以及访问其它机器了。 + +这差不多就是我以我喜欢的方式对我的新 openSUSE 系统做的所有设置了。如果你有任何问题,欢迎在评论区提问。 + +-------------------------------------------------------------------------------- + +via: http://www.itworld.com/article/3003865/open-source-tools/8-things-to-do-after-installing-opensuse-leap-421.html + +作者:[Swapnil Bhartiya][a] +译者:[alim0x](https://github.com/alim0x) +校对:[校对者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://www.flickr.com/photos/mtaphotos/11200079265/ +[2]:https://www.linux.com/news/software/applications/865760-opensuse-leap-421-review-the-most-mature-linux-distribution +[3]:https://www.linux.com/learn/tutorials/857788-how-to-convert-videos-in-linux-using-the-command-line +[4]:https://www.google.com/intl/en/chrome/browser/desktop/index.html#brand=CHMB&utm_campaign=en&utm_source=en-ha-na-us-sk&utm_medium=ha +[5]:http://opensuse-community.org/ +[6]:http://www.itworld.com/article/2875981/the-5-best-open-source-email-clients-for-linux.html From 7ee00c44b04f30c5b7c3f08fbd82e9310aaa4b54 Mon Sep 17 00:00:00 2001 From: alim0x Date: Thu, 7 Apr 2016 22:38:15 +0800 Subject: [PATCH 0599/1469] =?UTF-8?q?[=E9=80=89=E9=A2=98=E5=B9=B6=E7=BF=BB?= =?UTF-8?q?=E8=AF=91]20160405=20Ubuntu=20Budgie=20Could=20Be=20the=20New?= =?UTF-8?q?=20Flavor=20of=20Ubuntu=20Linux,=20as=20Part=20of=20Ubuntu=2016?= =?UTF-8?q?.10?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...f Ubuntu Linux, as Part of Ubuntu 16.10.md | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 sources/news/20160405 Ubuntu Budgie Could Be the New Flavor of Ubuntu Linux, as Part of Ubuntu 16.10.md diff --git a/sources/news/20160405 Ubuntu Budgie Could Be the New Flavor of Ubuntu Linux, as Part of Ubuntu 16.10.md b/sources/news/20160405 Ubuntu Budgie Could Be the New Flavor of Ubuntu Linux, as Part of Ubuntu 16.10.md new file mode 100644 index 0000000000..de815c9f67 --- /dev/null +++ b/sources/news/20160405 Ubuntu Budgie Could Be the New Flavor of Ubuntu Linux, as Part of Ubuntu 16.10.md @@ -0,0 +1,44 @@ +alim0x translating + +Ubuntu Budgie Could Be the New Flavor of Ubuntu Linux, as Part of Ubuntu 16.10 +=== + +> The Beta 2 of Budgie-Remix is now ready for testing. + +Last month we told you about a new GNU/Linux distribution called [Budgie-Remix][1], whose ultimate goal is to become an official Ubuntu Linux flavor, possibly under the name of Ubuntu Budgie. + +Today, Budgie-Remix developer David Mohammed informs Softpedia about the progress made with the project, which Canonical founder [Mark Shuttleworth said][2] that it would definitely support if there were a community around the packaging, as well as the availability of the second Beta build for the upcoming 16.04 release. + +Since our [initial report][3], it looks like David Mohammed managed to get in contact with the Ubuntu MATE project leader Martin Wimpress, who urged him to target Ubuntu 16.10 for an official status of his soon-to-be-named Ubuntu flavor built on top of the Budgie desktop environment created by the amazing team of developers from [Solus][4]. + +"We've hit Beta 2 this week with lots of goodies and also we have the support of Martin Wimpress (Ubuntu MATE project leader)," said David Mohammed exclusively for Softpedia. "He has urged us to target 16.10 for official status - that is certainly a major challenge - and we need the community to help out/join us to make this happen!" + +### Ubuntu Budgie 16.10 might see the light of day in October 2016 ### + +On April 21, Canonical will release the next LTS (Long Term Support) release of Ubuntu Linux, the Xenial Xerus a.k.a. Ubuntu 16.04, and we might be able to get an early taste of what could become the official Ubuntu Budgie flavor, as Budgie-Remix 16.04. But until then, you can help the developer [test drive the Beta 2 release][5]. + +Immediately after the release of Ubuntu 16.04 LTS (Xenial Xerus), the Ubuntu developers will concentrate all of their efforts on the next version, Ubuntu 16.10, which should arrive later this year, sometimes at the end of October, and Ubuntu Budgie 16.10 might also be announced as an official Ubuntu flavor. + +![Budgie-Remix 16.04 Beta 2](http://i1-news.softpedia-static.com/images/news2/ubuntu-budgie-could-be-the-new-flavor-of-ubuntu-linux-as-part-of-ubuntu-16-10-502573-2.jpg) + +![Budgie Applications Menu](http://i1-news.softpedia-static.com/images/news2/ubuntu-budgie-could-be-the-new-flavor-of-ubuntu-linux-as-part-of-ubuntu-16-10-502573-3.jpg) + +![Budgie Raven notification and customization center](http://i1-news.softpedia-static.com/images/news2/ubuntu-budgie-could-be-the-new-flavor-of-ubuntu-linux-as-part-of-ubuntu-16-10-502573-4.jpg) + +![Nautilus file manager](http://i1-news.softpedia-static.com/images/news2/ubuntu-budgie-could-be-the-new-flavor-of-ubuntu-linux-as-part-of-ubuntu-16-10-502573-5.jpg) + +---------------------------------- + +via: http://news.softpedia.com/news/ubuntu-budgie-could-be-the-new-flavor-of-ubuntu-linux-as-part-of-ubuntu-16-10-502573.shtml + +作者:Marius Nestor +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]: https://launchpad.net/budgie-remix +[2]: https://plus.google.com/+programmerslab/posts/CSvbSvgcdcv +[3]: http://news.softpedia.com/news/budgie-remix-could-become-ubuntu-budgie-download-and-test-it-501231.shtml +[4]: https://solus-project.com/ +[5]: https://sourceforge.net/projects/budgie-remix/files/beta2/ From dcf3d4c941a30731a1f164a36968c8b4a883216e Mon Sep 17 00:00:00 2001 From: alim0x Date: Fri, 8 Apr 2016 21:50:21 +0800 Subject: [PATCH 0600/1469] [translated]buntu Budgie Could Be the New Flavor of Ubuntu Linux, as Part of Ubuntu 16.10 --- ...f Ubuntu Linux, as Part of Ubuntu 16.10.md | 44 ------------------- ...f Ubuntu Linux, as Part of Ubuntu 16.10.md | 43 ++++++++++++++++++ 2 files changed, 43 insertions(+), 44 deletions(-) delete mode 100644 sources/news/20160405 Ubuntu Budgie Could Be the New Flavor of Ubuntu Linux, as Part of Ubuntu 16.10.md create mode 100644 translated/news/20160405 Ubuntu Budgie Could Be the New Flavor of Ubuntu Linux, as Part of Ubuntu 16.10.md diff --git a/sources/news/20160405 Ubuntu Budgie Could Be the New Flavor of Ubuntu Linux, as Part of Ubuntu 16.10.md b/sources/news/20160405 Ubuntu Budgie Could Be the New Flavor of Ubuntu Linux, as Part of Ubuntu 16.10.md deleted file mode 100644 index de815c9f67..0000000000 --- a/sources/news/20160405 Ubuntu Budgie Could Be the New Flavor of Ubuntu Linux, as Part of Ubuntu 16.10.md +++ /dev/null @@ -1,44 +0,0 @@ -alim0x translating - -Ubuntu Budgie Could Be the New Flavor of Ubuntu Linux, as Part of Ubuntu 16.10 -=== - -> The Beta 2 of Budgie-Remix is now ready for testing. - -Last month we told you about a new GNU/Linux distribution called [Budgie-Remix][1], whose ultimate goal is to become an official Ubuntu Linux flavor, possibly under the name of Ubuntu Budgie. - -Today, Budgie-Remix developer David Mohammed informs Softpedia about the progress made with the project, which Canonical founder [Mark Shuttleworth said][2] that it would definitely support if there were a community around the packaging, as well as the availability of the second Beta build for the upcoming 16.04 release. - -Since our [initial report][3], it looks like David Mohammed managed to get in contact with the Ubuntu MATE project leader Martin Wimpress, who urged him to target Ubuntu 16.10 for an official status of his soon-to-be-named Ubuntu flavor built on top of the Budgie desktop environment created by the amazing team of developers from [Solus][4]. - -"We've hit Beta 2 this week with lots of goodies and also we have the support of Martin Wimpress (Ubuntu MATE project leader)," said David Mohammed exclusively for Softpedia. "He has urged us to target 16.10 for official status - that is certainly a major challenge - and we need the community to help out/join us to make this happen!" - -### Ubuntu Budgie 16.10 might see the light of day in October 2016 ### - -On April 21, Canonical will release the next LTS (Long Term Support) release of Ubuntu Linux, the Xenial Xerus a.k.a. Ubuntu 16.04, and we might be able to get an early taste of what could become the official Ubuntu Budgie flavor, as Budgie-Remix 16.04. But until then, you can help the developer [test drive the Beta 2 release][5]. - -Immediately after the release of Ubuntu 16.04 LTS (Xenial Xerus), the Ubuntu developers will concentrate all of their efforts on the next version, Ubuntu 16.10, which should arrive later this year, sometimes at the end of October, and Ubuntu Budgie 16.10 might also be announced as an official Ubuntu flavor. - -![Budgie-Remix 16.04 Beta 2](http://i1-news.softpedia-static.com/images/news2/ubuntu-budgie-could-be-the-new-flavor-of-ubuntu-linux-as-part-of-ubuntu-16-10-502573-2.jpg) - -![Budgie Applications Menu](http://i1-news.softpedia-static.com/images/news2/ubuntu-budgie-could-be-the-new-flavor-of-ubuntu-linux-as-part-of-ubuntu-16-10-502573-3.jpg) - -![Budgie Raven notification and customization center](http://i1-news.softpedia-static.com/images/news2/ubuntu-budgie-could-be-the-new-flavor-of-ubuntu-linux-as-part-of-ubuntu-16-10-502573-4.jpg) - -![Nautilus file manager](http://i1-news.softpedia-static.com/images/news2/ubuntu-budgie-could-be-the-new-flavor-of-ubuntu-linux-as-part-of-ubuntu-16-10-502573-5.jpg) - ----------------------------------- - -via: http://news.softpedia.com/news/ubuntu-budgie-could-be-the-new-flavor-of-ubuntu-linux-as-part-of-ubuntu-16-10-502573.shtml - -作者:Marius Nestor -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[1]: https://launchpad.net/budgie-remix -[2]: https://plus.google.com/+programmerslab/posts/CSvbSvgcdcv -[3]: http://news.softpedia.com/news/budgie-remix-could-become-ubuntu-budgie-download-and-test-it-501231.shtml -[4]: https://solus-project.com/ -[5]: https://sourceforge.net/projects/budgie-remix/files/beta2/ diff --git a/translated/news/20160405 Ubuntu Budgie Could Be the New Flavor of Ubuntu Linux, as Part of Ubuntu 16.10.md b/translated/news/20160405 Ubuntu Budgie Could Be the New Flavor of Ubuntu Linux, as Part of Ubuntu 16.10.md new file mode 100644 index 0000000000..899d8b5920 --- /dev/null +++ b/translated/news/20160405 Ubuntu Budgie Could Be the New Flavor of Ubuntu Linux, as Part of Ubuntu 16.10.md @@ -0,0 +1,43 @@ +Ubuntu Budgie 将在 Ubuntu 16.10 中成为新官方分支发行版 +=== + +> Budgie-Remix Beta 2 已经就绪以供测试。 + +上个月我们介绍了一个新 GNU/Linux 发行版 [Budgie-Remix][1],它的终极目标是成为一个 Ubuntu 官方分支发行版,可能会使用 Ubuntu Budgie 这个名字。 + +![Budgie-Remix 16.04 Beta 2](http://i1-news.softpedia-static.com/images/news2/ubuntu-budgie-could-be-the-new-flavor-of-ubuntu-linux-as-part-of-ubuntu-16-10-502573-2.jpg) + +今天,Budgie-Remix 的开发者 David Mohammed 向 Softpedia 通报了项目进度,以及为即将到来的 16.04 发布的第二个 Beta 版本。Cononical 的创始人 [Mark Shuttleworth 说过][2]如果能够有围绕这个包的社区,它肯定会得到支持。 + +自我们[最初的报道][3]以来,David Mohammed 似乎与 Ubuntu MATE 项目的领导者 Martin Wimpress 取得了联系,后者敦促他以 Ubuntu 16.10 作为他还未正式命名的 Ubuntu 分支的官方版本目标。这个分支发行版构建于 Budgie 桌面环境之上,它是超赞的 [Solus][4] 开发者团队创建的。 + +“我们本周完成了 Beta 2 版本的开发以及很多其它东西,而且我们还有 Martin Wimpress (Ubuntu MATE 项目领导者)的支持,”David Mohammed 对 Softpedia 独家爆料。”他还敦促我们以 16.10 作为成为官方版本的目标——那当然是个主要的挑战——并且我们还需要社区的帮助/加入我们来让这一切成为现实!” + +### Ubuntu Budgie 16.10 可能在 2016 年 10 月到来 ### + +4 月 21 日,Canonical 将会发布 Ubuntu Linux 的下一个 LTS(Long Term Support,长期支持)版本,Xenial Xerus 好客的非洲地松鼠,也就是 Ubuntu 16.04,并且我们有可能能够以 Budgie-Remix 16.04 的名义提前尝试将成为官方分支的 Ubuntu Budgie。但在那之前,你可以帮助开发者[测试 Beta 2 版本][5]。 + +在 Ubuntu 16.04 LTS(Xenial Xerus)发布之后,Ubuntu 的开发者们就会立即将注意力转移到下一个版本的开发上。下一个版本 Ubuntu 16.10 应该会在 10 月底到来,并且 Ubuntu Budgie 也可能宣布成为 Ubuntu 官方分支发行版。 + + +![Budgie Applications Menu](http://i1-news.softpedia-static.com/images/news2/ubuntu-budgie-could-be-the-new-flavor-of-ubuntu-linux-as-part-of-ubuntu-16-10-502573-3.jpg) + +![Budgie Raven notification and customization center](http://i1-news.softpedia-static.com/images/news2/ubuntu-budgie-could-be-the-new-flavor-of-ubuntu-linux-as-part-of-ubuntu-16-10-502573-4.jpg) + +![Nautilus file manager](http://i1-news.softpedia-static.com/images/news2/ubuntu-budgie-could-be-the-new-flavor-of-ubuntu-linux-as-part-of-ubuntu-16-10-502573-5.jpg) + +---------------------------------- + +via: http://news.softpedia.com/news/ubuntu-budgie-could-be-the-new-flavor-of-ubuntu-linux-as-part-of-ubuntu-16-10-502573.shtml + +作者:Marius Nestor +译者:[alim0x](https://github.com/alim0x) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]: https://launchpad.net/budgie-remix +[2]: https://plus.google.com/+programmerslab/posts/CSvbSvgcdcv +[3]: http://news.softpedia.com/news/budgie-remix-could-become-ubuntu-budgie-download-and-test-it-501231.shtml +[4]: https://solus-project.com/ +[5]: https://sourceforge.net/projects/budgie-remix/files/beta2/ From fd96b979145bf084aeaefc9d3bd5724e4a1bc1c0 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 10 Apr 2016 21:28:22 +0800 Subject: [PATCH 0601/1469] =?UTF-8?q?20160410-1=20=E9=80=89=E9=A2=98LFCS?= =?UTF-8?q?=E4=B8=93=E9=A2=9811?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...gcreate, lvcreate and lvextend Commands.md | 206 ++++++++++++++++++ 1 file changed, 206 insertions(+) create mode 100644 sources/tech/LFCS/Part 11 - How to Manage and Create LVM Using vgcreate, lvcreate and lvextend Commands.md diff --git a/sources/tech/LFCS/Part 11 - How to Manage and Create LVM Using vgcreate, lvcreate and lvextend Commands.md b/sources/tech/LFCS/Part 11 - How to Manage and Create LVM Using vgcreate, lvcreate and lvextend Commands.md new file mode 100644 index 0000000000..4d2a9d7a13 --- /dev/null +++ b/sources/tech/LFCS/Part 11 - How to Manage and Create LVM Using vgcreate, lvcreate and lvextend Commands.md @@ -0,0 +1,206 @@ +Part 11 - How to Manage and Create LVM Using vgcreate, lvcreate and lvextend Commands +============================================================================================ + +Because of the changes in the LFCS exam requirements effective Feb. 2, 2016, we are adding the necessary topics to the [LFCS series][1] published here. To prepare for this exam, your are highly encouraged to use the [LFCE series][2] as well. + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Manage-LVM-and-Create-LVM-Partition-in-Linux.png) +>LFCS: Manage LVM and Create LVM Partition – Part 11 + +One of the most important decisions while installing a Linux system is the amount of storage space to be allocated for system files, home directories, and others. If you make a mistake at that point, growing a partition that has run out of space can be burdensome and somewhat risky. + +**Logical Volumes Management** (also known as **LVM**), which have become a default for the installation of most (if not all) Linux distributions, have numerous advantages over traditional partitioning management. Perhaps the most distinguishing feature of LVM is that it allows logical divisions to be resized (reduced or increased) at will without much hassle. + +The structure of the LVM consists of: + +* One or more entire hard disks or partitions are configured as physical volumes (PVs). +* A volume group (**VG**) is created using one or more physical volumes. You can think of a volume group as a single storage unit. +* Multiple logical volumes can then be created in a volume group. Each logical volume is somewhat equivalent to a traditional partition – with the advantage that it can be resized at will as we mentioned earlier. + +In this article we will use three disks of **8 GB** each (**/dev/sdb**, **/dev/sdc**, and **/dev/sdd**) to create three physical volumes. You can either create the PVs directly on top of the device, or partition it first. + +Although we have chosen to go with the first method, if you decide to go with the second (as explained in [Part 4 – Create Partitions and File Systems in Linux][3] of this series) make sure to configure each partition as type `8e`. + +### Creating Physical Volumes, Volume Groups, and Logical Volumes + +To create physical volumes on top of **/dev/sdb**, **/dev/sdc**, and **/dev/sdd**, do: + +``` +# pvcreate /dev/sdb /dev/sdc /dev/sdd +``` + +You can list the newly created PVs with: + +``` +# pvs +``` + +and get detailed information about each PV with: + +``` +# pvdisplay /dev/sdX +``` + +(where **X** is b, c, or d) + +If you omit `/dev/sdX` as parameter, you will get information about all the PVs. + +To create a volume group named `vg00` using `/dev/sdb` and `/dev/sdc` (we will save `/dev/sdd` for later to illustrate the possibility of adding other devices to expand storage capacity when needed): + +``` +# vgcreate vg00 /dev/sdb /dev/sdc +``` + +As it was the case with physical volumes, you can also view information about this volume group by issuing: + +``` +# vgdisplay vg00 +``` + +Since `vg00` is formed with two **8 GB** disks, it will appear as a single **16 GB** drive: + +![](http://www.tecmint.com/wp-content/uploads/2016/03/List-LVM-Volume-Groups.png) +>List LVM Volume Groups + +When it comes to creating logical volumes, the distribution of space must take into consideration both current and future needs. It is considered good practice to name each logical volume according to its intended use. + +For example, let’s create two LVs named `vol_projects` (**10 GB**) and `vol_backups` (remaining space), which we can use later to store project documentation and system backups, respectively. + +The `-n` option is used to indicate a name for the LV, whereas `-L` sets a fixed size and `-l` (lowercase L) is used to indicate a percentage of the remaining space in the container VG. + +``` +# lvcreate -n vol_projects -L 10G vg00 +# lvcreate -n vol_backups -l 100%FREE vg00 +``` + +As before, you can view the list of LVs and basic information with: + +``` +# lvs +``` + +and detailed information with + +``` +# lvdisplay +``` + +To view information about a single **LV**, use **lvdisplay** with the **VG** and **LV** as parameters, as follows: + +``` +# lvdisplay vg00/vol_projects +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/03/List-Logical-Volume.png) +>List Logical Volume + +In the image above we can see that the LVs were created as storage devices (refer to the LV Path line). Before each logical volume can be used, we need to create a filesystem on top of it. + +We’ll use ext4 as an example here since it allows us both to increase and reduce the size of each LV (as opposed to xfs that only allows to increase the size): + +``` +# mkfs.ext4 /dev/vg00/vol_projects +# mkfs.ext4 /dev/vg00/vol_backups +``` + +In the next section we will explain how to resize logical volumes and add extra physical storage space when the need arises to do so. + +### Resizing Logical Volumes and Extending Volume Groups + +Now picture the following scenario. You are starting to run out of space in `vol_backups`, while you have plenty of space available in `vol_projects`. Due to the nature of LVM, we can easily reduce the size of the latter (say **2.5 GB**) and allocate it for the former, while resizing each filesystem at the same time. + +Fortunately, this is as easy as doing: + +``` +# lvreduce -L -2.5G -r /dev/vg00/vol_projects +# lvextend -l +100%FREE -r /dev/vg00/vol_backups +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Resize-Reduce-Logical-Volume-and-Volume-Group.png) +>Resize Reduce Logical Volume and Volume Group + +It is important to include the minus `(-)` or plus `(+)` signs while resizing a logical volume. Otherwise, you’re setting a fixed size for the LV instead of resizing it. + +It can happen that you arrive at a point when resizing logical volumes cannot solve your storage needs anymore and you need to buy an extra storage device. Keeping it simple, you will need another disk. We are going to simulate this situation by adding the remaining PV from our initial setup (`/dev/sdd`). + +To add `/dev/sdd` to `vg00`, do + +``` +# vgextend vg00 /dev/sdd +``` + +If you run vgdisplay `vg00` before and after the previous command, you will see the increase in the size of the VG: + +``` +# vgdisplay vg00 +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/03/List-Volume-Group-Size.png) +>Check Volume Group Disk Size + +Now you can use the newly added space to resize the existing LVs according to your needs, or to create additional ones as needed. + +### Mounting Logical Volumes on Boot and on Demand + +Of course there would be no point in creating logical volumes if we are not going to actually use them! To better identify a logical volume we will need to find out what its `UUID` (a non-changing attribute that uniquely identifies a formatted storage device) is. + +To do that, use blkid followed by the path to each device: + +``` +# blkid /dev/vg00/vol_projects +# blkid /dev/vg00/vol_backups +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Find-Logical-Volume-UUID.png) +>Find Logical Volume UUID + +Create mount points for each LV: + +``` +# mkdir /home/projects +# mkdir /home/backups +``` + +and insert the corresponding entries in `/etc/fstab` (make sure to use the UUIDs obtained before): + +``` +UUID=b85df913-580f-461c-844f-546d8cde4646 /home/projects ext4 defaults 0 0 +UUID=e1929239-5087-44b1-9396-53e09db6eb9e /home/backups ext4 defaults 0 0 +``` + +Then save the changes and mount the LVs: + +``` +# mount -a +# mount | grep home +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Find-Logical-Volume-UUID.png) +>Find Logical Volume UUID + +When it comes to actually using the LVs, you will need to assign proper `ugo+rwx` permissions as explained in [Part 8 – Manage Users and Groups in Linux][4] of this series. + +### Summary + +In this article we have introduced [Logical Volume Management][5], a versatile tool to manage storage devices that provides scalability. When combined with RAID (which we explained in [Part 6 – Create and Manage RAID in Linux][6] of this series), you can enjoy not only scalability (provided by LVM) but also redundancy (offered by RAID). + +In this type of setup, you will typically find `LVM` on top of `RAID`, that is, configure RAID first and then configure LVM on top of it. + +If you have questions about this article, or suggestions to improve it, feel free to reach us using the comment 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/installing-network-services-and-configuring-services-at-system-boot/ +[3]: http://www.tecmint.com/create-partitions-and-filesystems-in-linux/ +[4]: http://www.tecmint.com/manage-users-and-groups-in-linux/ +[5]: http://www.tecmint.com/create-lvm-storage-in-linux/ +[6]: http://www.tecmint.com/creating-and-managing-raid-backups-in-linux/ From 6fc8994f8a28d1849acc1c29dacfc2f678f14394 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 10 Apr 2016 21:42:46 +0800 Subject: [PATCH 0602/1469] =?UTF-8?q?20160410-2=20=E9=80=89=E9=A2=98LFCS?= =?UTF-8?q?=E4=B8=93=E9=A2=9812?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Installed Help Documentations and Tools.md | 180 ++++++++++++++++++ 1 file changed, 180 insertions(+) create mode 100644 sources/tech/LFCS/Part 12 - LFCS: How to Explore Linux with Installed Help Documentations and Tools.md diff --git a/sources/tech/LFCS/Part 12 - LFCS: How to Explore Linux with Installed Help Documentations and Tools.md b/sources/tech/LFCS/Part 12 - LFCS: How to Explore Linux with Installed Help Documentations and Tools.md new file mode 100644 index 0000000000..45ccb57f95 --- /dev/null +++ b/sources/tech/LFCS/Part 12 - LFCS: How to Explore Linux with Installed Help Documentations and Tools.md @@ -0,0 +1,180 @@ +Part 12 - LFCS: How to Explore Linux with Installed Help Documentations and Tools +================================================================================== + +Because of the changes in the LFCS exam requirements effective Feb. 2, 2016, we are adding the necessary topics to the [LFCS series][1] published here. To prepare for this exam, your are highly encouraged to use the [LFCE series][2] as well. + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Explore-Linux-with-Documentation-and-Tools.png) +>LFCS: Explore Linux with Installed Documentations and Tools – Part 12 + +Once you get used to working with the command line and feel comfortable doing so, you realize that a regular Linux installation includes all the documentation you need to use and configure the system. + +Another good reason to become familiar with command line help tools is that in the [LFCS][3] and [LFCE][4] exams, those are the only sources of information you can use – no internet browsing and no googling. It’s just you and the command line. + +For that reason, in this article we will give you some tips to effectively use the installed docs and tools in order to prepare to pass the **Linux Foundation Certification** exams. + +### Linux Man Pages + +A man page, short for manual page, is nothing less and nothing more than what the word suggests: a manual for a given tool. It contains the list of options (with explanation) that the command supports, and some man pages even include usage examples as well. + +To open a man page, use the **man command** followed by the name of the tool you want to learn more about. For example: + +``` +# man diff +``` + +will open the manual page for `diff`, a tool used to compare text files line by line (to exit, simply hit the q key.). + +Let’s say we want to compare two text files named `file1` and `file2` in Linux. These files contain the list of packages that are installed in two Linux boxes with the same distribution and version. + +Doing a `diff` between `file1` and `file2` will tell us if there is a difference between those lists: + +``` +# diff file1 file2 +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Compare-Two-Text-Files-in-Linux.png) +>Compare Two Text Files in Linux + +where the `<` sign indicates lines missing in `file2`. If there were lines missing in `file1`, they would be indicated by the `>` sign instead. + +On the other hand, **7d6** means line **#7** in file should be deleted in order to match `file2` (same with **24d22** and **41d38**), and 65,67d61 tells us we need to remove lines **65** through **67** in file one. If we make these corrections, both files will then be identical. + +Alternatively, you can display both files side by side using the `-y` option, according to the man page. You may find this helpful to more easily identify missing lines in files: + +``` +# diff -y file1 file2 +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Compare-and-List-Difference-of-Two-Files.png) +>Compare and List Difference of Two Files + +Also, you can use `diff` to compare two binary files. If they are identical, `diff` will exit silently without output. Otherwise, it will return the following message: “**Binary files X and Y differ**”. + +### The –help Option + +The `--help` option, available in many (if not all) commands, can be considered a short manual page for that specific command. Although it does not provide a comprehensive description of the tool, it is an easy way to obtain information on the usage of a program and a list of its available options at a quick glance. + +For example, + +``` +# sed --help +``` + +shows the usage of each option available in sed (the stream editor). + +One of the classic examples of using `sed` consists of replacing characters in files. Using the `-i` option (described as “**edit files in place**”), you can edit a file without opening it. If you want to make a backup of the original contents as well, use the `-i` option followed by a SUFFIX to create a separate file with the original contents. + +For example, to replace each occurrence of the word `Lorem` with `Tecmint` (case insensitive) in `lorem.txt` and create a new file with the original contents of the file, do: + +``` +# less lorem.txt | grep -i lorem +# sed -i.orig 's/Lorem/Tecmint/gI' lorem.txt +# less lorem.txt | grep -i lorem +# less lorem.txt.orig | grep -i lorem +``` + +Please note that every occurrence of `Lorem` has been replaced with `Tecmint` in `lorem.txt`, and the original contents of `lorem.txt` has been saved to `lorem.txt.orig`. + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Replace-A-String-in-File.png) +>Replace A String in Files + +### Installed Documentation in /usr/share/doc + +This is probably my favorite pick. If you go to `/usr/share/doc` and do a directory listing, you will see lots of directories with the names of the installed tools in your Linux system. + +According to the [Filesystem Hierarchy Standard][5], these directories contain useful information that might not be in the man pages, along with templates and configuration files to make configuration easier. + +For example, let’s consider `squid-3.3.8` (version may vary from distribution to distribution) for the popular HTTP proxy and [squid cache server][6]. + +Let’s `cd` into that directory: + +``` +# cd /usr/share/doc/squid-3.3.8 +``` + +and do a directory listing: + +``` +# ls +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/03/List-Files-in-Linux.png) +>Linux Directory Listing with ls Command + +You may want to pay special attention to `QUICKSTART` and `squid.conf.documented`. These files contain an extensive documentation about Squid and a heavily commented configuration file, respectively. For other packages, the exact names may differ (as **QuickRef** or **00QUICKSTART**, for example), but the principle is the same. + +Other packages, such as the Apache web server, provide configuration file templates inside `/usr/share/doc`, that will be helpful when you have to configure a standalone server or a virtual host, to name a few cases. + +### GNU info Documentation + +You can think of info documents as man pages on steroids. As such, they not only provide help for a specific tool, but also they do so with hyperlinks (yes, hyperlinks in the command line!) that allow you to navigate from a section to another using the arrow keys and Enter to confirm. + +Perhaps the most illustrative example is: + +``` +# info coreutils +``` + +Since coreutils contains the [basic file, shell and text manipulation utilities][7] which are expected to exist on every operating system, you can reasonably expect a detailed description for each one of those categories in info **coreutils**. + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Info-Coreutils.png) +>Info Coreutils + +As it is the case with man pages, you can exit an info document by pressing the `q` key. + +Additionally, GNU info can be used to display regular man pages as well when followed by the tool name. For example: + +``` +# info tune2fs +``` + +will return the man page of **tune2fs**, the ext2/3/4 filesystems management tool. + +And now that we’re at it, let’s review some of the uses of **tune2fs**: + +Display information about the filesystem on top of **/dev/mapper/vg00-vol_backups**: + +``` +# tune2fs -l /dev/mapper/vg00-vol_backups +``` + +Set a filesystem volume name (Backups in this case): + +``` +# tune2fs -L Backups /dev/mapper/vg00-vol_backups +``` + +Change the check intervals and `/` or mount counts (use the `-c` option to set a number of mount counts and `/` or the `-i` option to set a check interval, where **d=days, w=weeks, and m=months**). + +``` +# tune2fs -c 150 /dev/mapper/vg00-vol_backups # Check every 150 mounts +# tune2fs -i 6w /dev/mapper/vg00-vol_backups # Check every 6 weeks +``` + +All of the above options can be listed with the `--help` option, or viewed in the man page. + +### Summary + +Regardless of the method that you choose to invoke help for a given tool, knowing that they exist and how to use them will certainly come in handy in the exam. Do you know of any other tools that can be used to look up documentation? Feel free to share with the Tecmint community using the form below. + +Questions and other comments are more than welcome as well. + +-------------------------------------------------------------------------------- + +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/installing-network-services-and-configuring-services-at-system-boot/ +[3]: http://www.tecmint.com/sed-command-to-create-edit-and-manipulate-files-in-linux/ +[4]: http://www.tecmint.com/installing-network-services-and-configuring-services-at-system-boot/ +[5]: http://www.tecmint.com/linux-directory-structure-and-important-files-paths-explained/ +[6]: http://www.tecmint.com/configure-squid-server-in-linux/ +[7]: http://www.tecmint.com/sed-command-to-create-edit-and-manipulate-files-in-linux/ +[8]: From 7f58906e36bdd46682bfa8712b2a259985a466e8 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 10 Apr 2016 21:59:21 +0800 Subject: [PATCH 0603/1469] =?UTF-8?q?20160410-3=20=E9=80=89=E9=A2=98LFCS?= =?UTF-8?q?=E4=B8=93=E9=A2=9813?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...leshoot Grand Unified Bootloader (GRUB).md | 185 ++++++++++++++++++ 1 file changed, 185 insertions(+) create mode 100644 sources/tech/LFCS/Part 13 - LFCS: How to Configure and Troubleshoot Grand Unified Bootloader (GRUB).md diff --git a/sources/tech/LFCS/Part 13 - LFCS: How to Configure and Troubleshoot Grand Unified Bootloader (GRUB).md b/sources/tech/LFCS/Part 13 - LFCS: How to Configure and Troubleshoot Grand Unified Bootloader (GRUB).md new file mode 100644 index 0000000000..cf24c51b58 --- /dev/null +++ b/sources/tech/LFCS/Part 13 - LFCS: How to Configure and Troubleshoot Grand Unified Bootloader (GRUB).md @@ -0,0 +1,185 @@ +Part 13 - LFCS: How to Configure and Troubleshoot Grand Unified Bootloader (GRUB) +===================================================================================== + +Because of the changes in the LFCS exam requirements effective Feb. 2, 2016, we are adding the necessary topics to the [LFCS series][1] published here. To prepare for this exam, your are highly encouraged to use the [LFCE series][2] as well. + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Configure-Troubleshoot-Grub-Boot-Loader.png) +>LFCS: Configure and Troubleshoot Grub Boot Loader – Part 13 + +In this article we will introduce you to GRUB and explain why a boot loader is necessary, and how it adds versatility to the system. + +The [Linux boot process][3] from the time you press the power button of your computer until you get a fully-functional system follows this high-level sequence: + +* 1. A process known as **POST** (**Power-On Self Test**) performs an overall check on the hardware components of your computer. +* 2. When **POST** completes, it passes the control over to the boot loader, which in turn loads the Linux kernel in memory (along with **initramfs**) and executes it. The most used boot loader in Linux is the **GRand Unified Boot loader**, or **GRUB** for short. +* 3. The kernel checks and accesses the hardware, and then runs the initial process (mostly known by its generic name “**init**”) which in turn completes the system boot by starting services. + +In Part 7 of this series (“[SysVinit, Upstart, and Systemd][4]”) we introduced the [service management systems and tools][5] used by modern Linux distributions. You may want to review that article before proceeding further. + +### Introducing GRUB Boot Loader + +Two major **GRUB** versions (**v1** sometimes called **GRUB Legacy** and **v2**) can be found in modern systems, although most distributions use **v2** by default in their latest versions. Only **Red Hat Enterprise Linux 6** and its derivatives still use **v1** today. + +Thus, we will focus primarily on the features of **v2** in this guide. + +Regardless of the **GRUB** version, a boot loader allows the user to: + +* 1). modify the way the system behaves by specifying different kernels to use, +* 2). choose between alternate operating systems to boot, and +* 3). add or edit configuration stanzas to change boot options, among other things. + +Today, **GRUB** is maintained by the **GNU** project and is well documented in their website. You are encouraged to use the [GNU official documentation][6] while going through this guide. + +When the system boots you are presented with the following **GRUB** screen in the main console. Initially, you are prompted to choose between alternate kernels (by default, the system will boot using the latest kernel) and are allowed to enter a **GRUB** command line (with `c`) or edit the boot options (by pressing the `e` key). + +![](http://www.tecmint.com/wp-content/uploads/2016/03/GRUB-Boot-Screen.png) +>GRUB Boot Screen + +One of the reasons why you would consider booting with an older kernel is a hardware device that used to work properly and has started “acting up” after an upgrade (refer to [this link][7] in the AskUbuntu forums for an example). + +The **GRUB v2** configuration is read on boot from `/boot/grub/grub.cfg` or `/boot/grub2/grub.cfg`, whereas `/boot/grub/grub.conf` or `/boot/grub/menu.lst` are used in **v1**. These files are NOT to be edited by hand, but are modified based on the contents of `/etc/default/grub` and the files found inside `/etc/grub.d`. + +In a **CentOS 7**, here’s the configuration file that is created when the system is first installed: + +``` +GRUB_TIMEOUT=5 +GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)" +GRUB_DEFAULT=saved +GRUB_DISABLE_SUBMENU=true +GRUB_TERMINAL_OUTPUT="console" +GRUB_CMDLINE_LINUX="vconsole.keymap=la-latin1 rd.lvm.lv=centos_centos7-2/swap crashkernel=auto vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos_centos7-2/root rhgb quiet" +GRUB_DISABLE_RECOVERY="true" +``` + +In addition to the online documentation, you can also find the GNU GRUB manual using info as follows: + +``` +# info grub +``` + +If you’re interested specifically in the options available for /etc/default/grub, you can invoke the configuration section directly: + +``` +# info -f grub -n 'Simple configuration' +``` + +Using the command above you will find out that `GRUB_TIMEOUT` sets the time between the moment when the initial screen appears and the system automatic booting begins unless interrupted by the user. When this variable is set to `-1`, boot will not be started until the user makes a selection. + +When multiple operating systems or kernels are installed in the same machine, `GRUB_DEFAULT` requires an integer value that indicates which OS or kernel entry in the GRUB initial screen should be selected to boot by default. The list of entries can be viewed not only in the splash screen shown above, but also using the following command: + +### In CentOS and openSUSE: + +``` +# awk -F\' '$1=="menuentry " {print $2}' /boot/grub2/grub.cfg +``` + +### In Ubuntu: + +``` +# awk -F\' '$1=="menuentry " {print $2}' /boot/grub/grub.cfg +``` + +In the example shown in the below image, if we wish to boot with the kernel version **3.10.0-123.el7.x86_64** (4th entry), we need to set `GRUB_DEFAULT` to `3` (entries are internally numbered beginning with zero) as follows: + +``` +GRUB_DEFAULT=3 +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Boot-System-with-Old-Kernel-Version.png) +>Boot System with Old Kernel Version + +One final GRUB configuration variable that is of special interest is `GRUB_CMDLINE_LINUX`, which is used to pass options to the kernel. The options that can be passed through GRUB to the kernel are well documented in the [Kernel Parameters file][8] and in [man 7 bootparam][9]. + +Current options in my **CentOS 7** server are: + +``` +GRUB_CMDLINE_LINUX="vconsole.keymap=la-latin1 rd.lvm.lv=centos_centos7-2/swap crashkernel=auto vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos_centos7-2/root rhgb quiet" +``` + +Why would you want to modify the default kernel parameters or pass extra options? In simple terms, there may be times when you need to tell the kernel certain hardware parameters that it may not be able to determine on its own, or to override the values that it would detect. + +This happened to me not too long ago when I tried **Vector Linux**, a derivative of **Slackware**, on my 10-year old laptop. After installation it did not detect the right settings for my video card so I had to modify the kernel options passed through GRUB in order to make it work. + +Another example is when you need to bring the system to single-user mode to perform maintenance tasks. You can do this by appending the word single to `GRUB_CMDLINE_LINUX` and rebooting: + +``` +GRUB_CMDLINE_LINUX="vconsole.keymap=la-latin1 rd.lvm.lv=centos_centos7-2/swap crashkernel=auto vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos_centos7-2/root rhgb quiet single" +``` + +After editing `/etc/defalt/grub`, you will need to run `update-grub` (Ubuntu) or `grub2-mkconfig -o /boot/grub2/grub.cfg` (**CentOS** and **openSUSE**) afterwards to update `grub.cfg` (otherwise, changes will be lost upon boot). + +This command will process the boot configuration files mentioned earlier to update `grub.cfg`. This method ensures changes are permanent, while options passed through GRUB at boot time will only last during the current session. + +### Fixing Linux GRUB Issues + +If you install a second operating system or if your GRUB configuration file gets corrupted due to human error, there are ways you can get your system back on its feet and be able to boot again. + +In the initial screen, press `c` to get a GRUB command line (remember that you can also press `e` to edit the default boot options), and use help to bring the available commands in the GRUB prompt: + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Fix-Grub-Issues-in-Linux.png) +>Fix Grub Configuration Issues in Linux + +We will focus on **ls**, which will list the installed devices and filesystems, and we will examine what it finds. In the image below we can see that there are 4 hard drives (`hd0` through `hd3`). + +Only `hd0` seems to have been partitioned (as evidenced by msdos1 and msdos2, where 1 and 2 are the partition numbers and msdos is the partitioning scheme). + +Let’s now examine the first partition on `hd0` (**msdos1**) to see if we can find GRUB there. This approach will allow us to boot Linux and there use other high level tools to repair the configuration file or reinstall GRUB altogether if it is needed: + +``` +# ls (hd0,msdos1)/ +``` + +As we can see in the highlighted area, we found the `grub2` directory in this partition: + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Find-Grub-Configuration.png) +>Find Grub Configuration + +Once we are sure that GRUB resides in (**hd0,msdos1**), let’s tell GRUB where to find its configuration file and then instruct it to attempt to launch its menu: + +``` +set prefix=(hd0,msdos1)/grub2 +set root=(hd0,msdos1) +insmod normal +normal +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Find-and-Launch-Grub-Menu.png) +>Find and Launch Grub Menu + +Then in the GRUB menu, choose an entry and press **Enter** to boot using it. Once the system has booted you can issue the `grub2-install /dev/sdX` command (change `sdX` with the device you want to install GRUB on). The boot information will then be updated and all related files be restored. + +``` +# grub2-install /dev/sdX +``` + +Other more complex scenarios are documented, along with their suggested fixes, in the [Ubuntu GRUB2 Troubleshooting guide][10]. The concepts explained there are valid for other distributions as well. + +### Summary + +In this article we have introduced you to GRUB, indicated where you can find documentation both online and offline, and explained how to approach an scenario where a system has stopped booting properly due to a bootloader-related issue. + +Fortunately, GRUB is one of the tools that is best documented and you can easily find help either in the installed docs or online using the resources we have shared in this article. + +Do you have questions or comments? Don’t hesitate to let us know using the comment form below. We look forward to hearing from you! + +-------------------------------------------------------------------------------- + +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/installing-network-services-and-configuring-services-at-system-boot/ +[3]: http://www.tecmint.com/linux-boot-process/ +[4]: http://www.tecmint.com/linux-boot-process-and-manage-services/ +[5]: http://www.tecmint.com/best-linux-log-monitoring-and-management-tools/ +[6]: http://www.gnu.org/software/grub/manual/ +[7]: http://askubuntu.com/questions/82140/how-can-i-boot-with-an-older-kernel-version +[8]: https://www.kernel.org/doc/Documentation/kernel-parameters.txt +[9]: http://man7.org/linux/man-pages/man7/bootparam.7.html +[10]: https://help.ubuntu.com/community/Grub2/Troubleshooting From a83f054b65978f85da496ee08d18961e8b51ae11 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 10 Apr 2016 22:17:13 +0800 Subject: [PATCH 0604/1469] =?UTF-8?q?20160410-4=20=E9=80=89=E9=A2=98LFCS?= =?UTF-8?q?=E4=B8=93=E9=A2=9814?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Set Process Limits on a Per-User Basis.md | 273 ++++++++++++++++++ 1 file changed, 273 insertions(+) create mode 100644 sources/tech/LFCS/Part 14 - Monitor Linux Processes Resource Usage and Set Process Limits on a Per-User Basis.md diff --git a/sources/tech/LFCS/Part 14 - Monitor Linux Processes Resource Usage and Set Process Limits on a Per-User Basis.md b/sources/tech/LFCS/Part 14 - Monitor Linux Processes Resource Usage and Set Process Limits on a Per-User Basis.md new file mode 100644 index 0000000000..82bb9b4a74 --- /dev/null +++ b/sources/tech/LFCS/Part 14 - Monitor Linux Processes Resource Usage and Set Process Limits on a Per-User Basis.md @@ -0,0 +1,273 @@ +Part 14 - Monitor Linux Processes Resource Usage and Set Process Limits on a Per-User Basis +============================================================================================= + +Because of the changes in the LFCS exam requirements effective Feb. 2, 2016, we are adding the necessary topics to the [LFCS series][1] published here. To prepare for this exam, your are highly encouraged to use the [LFCE series][2] as well. + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Linux-Process-Monitoring-Set-Process-Limits-Per-User.png) +>Monitor Linux Processes and Set Process Limits Per User – Part 14 + +Every Linux system administrator needs to know how to verify the integrity and availability of hardware, resources, and key processes. In addition, setting resource limits on a per-user basis must also be a part of his / her skill set. + +In this article we will explore a few ways to ensure that the system both hardware and the software is behaving correctly to avoid potential issues that may cause unexpected production downtime and money loss. + +### Linux Reporting Processors Statistics + +With **mpstat** you can view the activities for each processor individually or the system as a whole, both as a one-time snapshot or dynamically. + +In order to use this tool, you will need to install **sysstat**: + +``` +# yum update && yum install sysstat [On CentOS based systems] +# aptitutde update && aptitude install sysstat [On Ubuntu based systems] +# zypper update && zypper install sysstat [On openSUSE systems] +``` + +Read more about sysstat and it’s utilities at [Learn Sysstat and Its Utilities mpstat, pidstat, iostat and sar in Linux][3] + +Once you have installed **mpstat**, use it to generate reports of processors statistics. + +To display **3** global reports of CPU utilization (`-u`) for all CPUs (as indicated by `-P` ALL) at a 2-second interval, do: + +``` +# mpstat -P ALL -u 2 3 +``` + +### Sample Output + +``` +Linux 3.19.0-32-generic (tecmint.com) Wednesday 30 March 2016 _x86_64_ (4 CPU) + +11:41:07 IST CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle +11:41:09 IST all 5.85 0.00 1.12 0.12 0.00 0.00 0.00 0.00 0.00 92.91 +11:41:09 IST 0 4.48 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 94.53 +11:41:09 IST 1 2.50 0.00 0.50 0.00 0.00 0.00 0.00 0.00 0.00 97.00 +11:41:09 IST 2 6.44 0.00 0.99 0.00 0.00 0.00 0.00 0.00 0.00 92.57 +11:41:09 IST 3 10.45 0.00 1.99 0.00 0.00 0.00 0.00 0.00 0.00 87.56 + +11:41:09 IST CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle +11:41:11 IST all 11.60 0.12 1.12 0.50 0.00 0.00 0.00 0.00 0.00 86.66 +11:41:11 IST 0 10.50 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 88.50 +11:41:11 IST 1 14.36 0.00 1.49 2.48 0.00 0.00 0.00 0.00 0.00 81.68 +11:41:11 IST 2 2.00 0.50 1.00 0.00 0.00 0.00 0.00 0.00 0.00 96.50 +11:41:11 IST 3 19.40 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 79.60 + +11:41:11 IST CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle +11:41:13 IST all 5.69 0.00 1.24 0.00 0.00 0.00 0.00 0.00 0.00 93.07 +11:41:13 IST 0 2.97 0.00 1.49 0.00 0.00 0.00 0.00 0.00 0.00 95.54 +11:41:13 IST 1 10.78 0.00 1.47 0.00 0.00 0.00 0.00 0.00 0.00 87.75 +11:41:13 IST 2 2.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 97.00 +11:41:13 IST 3 6.93 0.00 0.50 0.00 0.00 0.00 0.00 0.00 0.00 92.57 + +Average: CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle +Average: all 7.71 0.04 1.16 0.21 0.00 0.00 0.00 0.00 0.00 90.89 +Average: 0 5.97 0.00 1.16 0.00 0.00 0.00 0.00 0.00 0.00 92.87 +Average: 1 9.24 0.00 1.16 0.83 0.00 0.00 0.00 0.00 0.00 88.78 +Average: 2 3.49 0.17 1.00 0.00 0.00 0.00 0.00 0.00 0.00 95.35 +Average: 3 12.25 0.00 1.16 0.00 0.00 0.00 0.00 0.00 0.00 86.59 +``` + +To view the same statistics for a specific **CPU** (**CPU 0** in the following example), use: + +``` +# mpstat -P 0 -u 2 3 +``` + +### Sample Output + +``` +Linux 3.19.0-32-generic (tecmint.com) Wednesday 30 March 2016 _x86_64_ (4 CPU) + +11:42:08 IST CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle +11:42:10 IST 0 3.00 0.00 0.50 0.00 0.00 0.00 0.00 0.00 0.00 96.50 +11:42:12 IST 0 4.08 0.00 0.00 2.55 0.00 0.00 0.00 0.00 0.00 93.37 +11:42:14 IST 0 9.74 0.00 0.51 0.00 0.00 0.00 0.00 0.00 0.00 89.74 +Average: 0 5.58 0.00 0.34 0.85 0.00 0.00 0.00 0.00 0.00 93.23 +``` + +The output of the above commands shows these columns: + +* `CPU`: Processor number as an integer, or the word all as an average for all processors. +* `%usr`: Percentage of CPU utilization while running user level applications. +* `%nice`: Same as `%usr`, but with nice priority. +* `%sys`: Percentage of CPU utilization that occurred while executing kernel applications. This does not include time spent dealing with interrupts or handling hardware. +* `%iowait`: Percentage of time when the given CPU (or all) was idle, during which there was a resource-intensive I/O operation scheduled on that CPU. A more detailed explanation (with examples) can be found [here][4]. +* `%irq`: Percentage of time spent servicing hardware interrupts. +* `%soft`: Same as `%irq`, but with software interrupts. +* `%steal`: Percentage of time spent in involuntary wait (steal or stolen time) when a virtual machine, as guest, is “winning” the hypervisor’s attention while competing for the CPU(s). This value should be kept as small as possible. A high value in this field means the virtual machine is stalling – or soon will be. +* `%guest`: Percentage of time spent running a virtual processor. +* `%idle`: percentage of time when CPU(s) were not executing any tasks. If you observe a low value in this column, that is an indication of the system being placed under a heavy load. In that case, you will need to take a closer look at the process list, as we will discuss in a minute, to determine what is causing it. + +To put the place the processor under a somewhat high load, run the following commands and then execute mpstat (as indicated) in a separate terminal: + +``` +# dd if=/dev/zero of=test.iso bs=1G count=1 +# mpstat -u -P 0 2 3 +# ping -f localhost # Interrupt with Ctrl + C after mpstat below completes +# mpstat -u -P 0 2 3 +``` + +Finally, compare to the output of **mpstat** under “normal” circumstances: + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Report-Processors-Related-Statistics.png) +>Report Linux Processors Related Statistics + +As you can see in the image above, **CPU 0** was under a heavy load during the first two examples, as indicated by the `%idle` column. + +In the next section we will discuss how to identify these resource-hungry processes, how to obtain more information about them, and how to take appropriate action. + +### Reporting Linux Processes + +To list processes sorting them by CPU usage, we will use the well known `ps` command with the `-eo` (to select all processes with user-defined format) and `--sort` (to specify a custom sorting order) options, like so: + +``` +# ps -eo pid,ppid,cmd,%cpu,%mem --sort=-%cpu +``` + +The above command will only show the `PID`, `PPID`, the command associated with the process, and the percentage of CPU and RAM usage sorted by the percentage of CPU usage in descending order. When executed during the creation of the .iso file, here’s the first few lines of the output: + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Find-Linux-Processes-By-CPU-Usage.png) +>Find Linux Processes By CPU Usage + +Once we have identified a process of interest (such as the one with `PID=2822`), we can navigate to `/proc/PID` (`/proc/2822` in this case) and do a directory listing. + +This directory is where several files and subdirectories with detailed information about this particular process are kept while it is running. + +#### For example: + +* `/proc/2822/io` contains IO statistics for the process (number of characters and bytes read and written, among others, during IO operations). +* `/proc/2822/attr/current` shows the current SELinux security attributes of the process. +* `/proc/2822/cgroup` describes the control groups (cgroups for short) to which the process belongs if the CONFIG_CGROUPS kernel configuration option is enabled, which you can verify with: + +``` +# cat /boot/config-$(uname -r) | grep -i cgroups +``` + +If the option is enabled, you should see: + +``` +CONFIG_CGROUPS=y +``` + +Using `cgroups` you can manage the amount of allowed resource usage on a per-process basis as explained in Chapters 1 through 4 of the [Red Hat Enterprise Linux 7 Resource Management guide][5], in Chapter 9 of the [openSUSE System Analysis and Tuning guide][6], and in the [Control Groups section of the Ubuntu 14.04 Server documentation][7]. + +The `/proc/2822/fd` is a directory that contains one symbolic link for each file descriptor the process has opened. The following image shows this information for the process that was started in tty1 (the first terminal) to create the **.iso** image: + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Find-Linux-Process-Information.png) +>Find Linux Process Information + +The above image shows that **stdin** (file descriptor **0**), **stdout** (file descriptor **1**), and **stderr** (file descriptor **2**) are mapped to **/dev/zero**, **/root/test.iso**, and **/dev/tty1**, respectively. + +More information about `/proc` can be found in “The `/proc` filesystem” document kept and maintained by Kernel.org, and in the Linux Programmer’s Manual. + +### Setting Resource Limits on a Per-User Basis in Linux + +If you are not careful and allow any user to run an unlimited number of processes, you may eventually experience an unexpected system shutdown or get locked out as the system enters an unusable state. To prevent this from happening, you should place a limit on the number of processes users can start. + +To do this, edit **/etc/security/limits.conf** and add the following line at the bottom of the file to set the limit: + +``` +* hard nproc 10 +``` + +The first field can be used to indicate either a user, a group, or all of them `(*)`, whereas the second field enforces a hard limit on the number of process (nproc) to **10**. To apply changes, logging out and back in is enough. + +Thus, let’s see what happens if a certain user other than root (either a legitimate one or not) attempts to start a shell fork bomb. If we had not implemented limits, this would initially launch two instances of a function, and then duplicate each of them in a neverending loop. Thus, it would eventually bringing your system to a crawl. + +However, with the above restriction in place, the fork bomb does not succeed but the user will still get locked out until the system administrator kills the process associated with it: + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Shell-Fork-Bomb.png) +>Run Shell Fork Bomb + +**TIP**: Other possible restrictions made possible by **ulimit** are documented in the `limits.conf` file. + +### Linux Other Process Management Tools + +In addition to the tools discussed previously, a system administrator may also need to: + +**a)** Modify the execution priority (use of system resources) of a process using **renice**. This means that the kernel will allocate more or less system resources to the process based on the assigned priority (a number commonly known as “**niceness**” in a range from `-20` to `19`). + +The lower the value, the greater the execution priority. Regular users (other than root) can only modify the niceness of processes they own to a higher value (meaning a lower execution priority), whereas root can modify this value for any process, and may increase or decrease it. + +The basic syntax of renice is as follows: + +``` +# renice [-n] identifier +``` + +If the argument after the new priority value is not present (empty), it is set to PID by default. In that case, the niceness of process with **PID=identifier** is set to ``. + +**b)** Interrupt the normal execution of a process when needed. This is commonly known as [“killing” the process][9]. Under the hood, this means sending the process a signal to finish its execution properly and release any used resources in an orderly manner. + +To [kill a process][10], use the **kill** command as follows: + +``` +# kill PID +``` + +Alternatively, you can use [pkill to terminate all processes][11] of a given owner `(-u)`, or a group owner `(-G)`, or even those processes which have a PPID in common `(-P)`. These options may be followed by the numeric representation or the actual name as identifier: + +``` +# pkill [options] identifier +``` + +For example, + +``` +# pkill -G 1000 +``` + +will kill all processes owned by group with `GID=1000`. + +And, + +``` +# pkill -P 4993 +``` + +will kill all processes whose `PPID is 4993`. + +Before running a `pkill`, it is a good idea to test the results with `pgrep` first, perhaps using the `-l` option as well to list the processes’ names. It takes the same options but only returns the PIDs of processes (without taking any further action) that would be killed if `pkill` is used. + +``` +# pgrep -l -u gacanepa +``` + +This is illustrated in the next image: + +![](http://www.tecmint.com/wp-content/uploads/2016/03/List-User-Running-Processes.png) +>Find User Running Processes in Linux + +### Summary + +In this article we have explored a few ways to monitor resource usage in order to verify the integrity and availability of critical hardware and software components in a Linux system. + +We have also learned how to take appropriate action (either by adjusting the execution priority of a given process or by terminating it) under unusual circumstances. + +We hope the concepts explained in this tutorial have been helpful. If you have any questions or comments, feel free to reach us using the contact 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/installing-network-services-and-configuring-services-at-system-boot/ +[3]: http://www.tecmint.com/sysstat-commands-to-monitor-linux/ +[4]: http://veithen.github.io/2013/11/18/iowait-linux.html +[5]: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Resource_Management_Guide/index.html +[6]: https://doc.opensuse.org/documentation/leap/tuning/html/book.sle.tuning/cha.tuning.cgroups.html +[7]: https://help.ubuntu.com/lts/serverguide/cgroups.html +[8]: http://man7.org/linux/man-pages/man5/proc.5.html +[9]: http://www.tecmint.com/kill-processes-unresponsive-programs-in-ubuntu/ +[10]: http://www.tecmint.com/find-and-kill-running-processes-pid-in-linux/ +[11]: http://www.tecmint.com/how-to-kill-a-process-in-linux/ From cd50e7545fa5c1a368c103bdecb66bbf45198d1e Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 11 Apr 2016 09:15:12 +0800 Subject: [PATCH 0605/1469] PUB:Part 5 - LFCS--How to Mount or Unmount Local and Network Samba and NFS Filesystems in Linux @GHLandy --- ...work Samba and NFS Filesystems in Linux.md | 66 ++++++++----------- 1 file changed, 28 insertions(+), 38 deletions(-) rename {translated/tech => published}/LFCS/Part 5 - LFCS--How to Mount or Unmount Local and Network Samba and NFS Filesystems in Linux.md (76%) diff --git a/translated/tech/LFCS/Part 5 - LFCS--How to Mount or Unmount Local and Network Samba and NFS Filesystems in Linux.md b/published/LFCS/Part 5 - LFCS--How to Mount or Unmount Local and Network Samba and NFS Filesystems in Linux.md similarity index 76% rename from translated/tech/LFCS/Part 5 - LFCS--How to Mount or Unmount Local and Network Samba and NFS Filesystems in Linux.md rename to published/LFCS/Part 5 - LFCS--How to Mount or Unmount Local and Network Samba and NFS Filesystems in Linux.md index 1551f4de0c..50344e5da0 100644 --- a/translated/tech/LFCS/Part 5 - LFCS--How to Mount or Unmount Local and Network Samba and NFS Filesystems in Linux.md +++ b/published/LFCS/Part 5 - LFCS--How to Mount or Unmount Local and Network Samba and NFS Filesystems in Linux.md @@ -1,22 +1,18 @@ -GHLandy Translated - LFCS 系列第五讲:如何在 Linux 中挂载/卸载本地文件系统和网络文件系统(Samba 和 NFS) - ================================================================================ -Linux 基金会已经发起了一个全新的 LFCS(Linux Foundation Certified Sysadmin,Linux 基金会认证系统管理员)认证,旨在让来自世界各地的人有机会参加到 LFCS 测试,获得关于有能力在 Linux 系统中执行中间系统管理任务的认证。该认证包括:维护正在运行的系统和服务的能力、全面监控和分析的能力以及何时上游团队请求支持的决策能力。 +Linux 基金会已经发起了一个全新的 LFCS(Linux Foundation Certified Sysadmin,Linux 基金会认证系统管理员)认证,旨在让来自世界各地的人有机会参加到 LFCS 测试,获得关于有能力在 Linux 系统中执行中间系统管理任务的认证。该认证包括:维护正在运行的系统和服务的能力、全面监控和分析的能力以及何时向上游团队请求支持的决策能力。 ![Linux Foundation Certified Sysadmin – Part 5](http://www.tecmint.com/wp-content/uploads/2014/10/lfcs-Part-5.png) -LFCS 系列第五讲 +*LFCS 系列第五讲* 请看以下视频,这里边介绍了 Linux 基金会认证程序。 注:youtube 视频 -本讲是《十套教程》系列中的第三讲,在这一讲里边,我们会解释如何在 Linux 中挂载/卸载本地和网络文件系统。这些都是 LFCS 认证中的必备知识。 - +本讲是系列教程中的第五讲,在这一讲里边,我们会解释如何在 Linux 中挂载/卸载本地和网络文件系统。这些都是 LFCS 认证中的必备知识。 ### 挂载文件系统 ### @@ -26,20 +22,19 @@ LFCS 系列第五讲 换句话说,管理存储设备的第一步就是把设备关联到文件系统树。要完成这一步,通常可以这样:用 mount 命令来进行临时挂载(用完的时候,使用 umount 命令来卸载),或者通过编辑 /etc/fstab 文件之后重启系统来永久性挂载,这样每次开机都会进行挂载。 - 不带任何选项的 mount 命令,可以显示当前已挂载的文件系统。 # mount ![Check Mounted Filesystem in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/check-mounted-filesystems.png) -检查已挂载的文件系统 +*检查已挂载的文件系统* 另外,mount 命令通常用来挂载文件系统。其基本语法如下: # mount -t type device dir -o options -该命令会指引内核在设备上找到的文件系统(如已格式化为指定类型的文件系统)挂载到指定目录。像这样的形式,mount 命令不会再到 /etc/fstab 文件中进行确认。 +该命令会指引内核将在设备上找到的文件系统(如已格式化为指定类型的文件系统)挂载到指定目录。像这样的形式,mount 命令不会再到 /etc/fstab 文件中进行确认。 除非像下面,挂载指定的目录或者设备: @@ -59,20 +54,17 @@ mount 命令会尝试寻找挂载点,如果找不到就会查找设备(上 读作: -设备 dev/mapper/debian-home 的格式为 ext4,挂载在 /home 下,并且有以下挂载选项: rw,relatime,user_xattr,barrier=1,data=ordered。 +设备 dev/mapper/debian-home 挂载在 /home 下,它被格式化为 ext4,并且有以下挂载选项: rw,relatime,user_xattr,barrier=1,data=ordered。 **mount 命令选项** 下面列出 mount 命令的常用选项 - -- async:运许在将要挂载的文件系统上进行异步 I/O 操作 -- auto:标志文件系统通过 mount -a 命令挂载,与 noauto 相反。 - -- defaults:该选项为 async,auto,dev,exec,nouser,rw,suid 的一个别名。注意,多个选项必须由逗号隔开并且中间没有空格。倘若你不小心在两个选项中间输入了一个空格,mount 命令会把后边的字符解释为另一个参数。 +- async:允许在将要挂载的文件系统上进行异步 I/O 操作 +- auto:标示该文件系统通过 mount -a 命令挂载,与 noauto 相反。 +- defaults:该选项相当于 `async,auto,dev,exec,nouser,rw,suid` 的组合。注意,多个选项必须由逗号隔开并且中间没有空格。倘若你不小心在两个选项中间输入了一个空格,mount 命令会把后边的字符解释为另一个参数。 - loop:将镜像文件(如 .iso 文件)挂载为 loop 设备。该选项可以用来模拟显示光盘中的文件内容。 - noexec:阻止该文件系统中可执行文件的执行。与 exec 选项相反。 - - nouser:阻止任何用户(除 root 用户外) 挂载或卸载文件系统。与 user 选项相反。 - remount:重新挂载文件系统。 - ro:只读模式挂载。 @@ -91,7 +83,7 @@ mount 命令会尝试寻找挂载点,如果找不到就会查找设备(上 ![Mount Device in Read Write Mode](http://www.tecmint.com/wp-content/uploads/2014/10/Mount-Device-Read-Write.png) -可读写模式挂载设备 +*可读写模式挂载设备* **以默认模式挂载设备** @@ -102,26 +94,25 @@ mount 命令会尝试寻找挂载点,如果找不到就会查找设备(上 ![Mount Device in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Mount-Device.png) -挂载设备 +*挂载设备* 在这个例子中,我们发现写入文件和命令都完美执行了。 ### 卸载设备 ### -使用 umount 命令卸载设备,意味着将所有的“在使用”数据全部写入到文件系统了,然后可以安全移除文件系统。请注意,倘若你移除一个没有事先正确卸载的文件系统,就会有造成设备损坏和数据丢失的风险。 +使用 umount 命令卸载设备,意味着将所有的“在使用”数据全部写入到文件系统,然后可以安全移除文件系统。请注意,倘若你移除一个没有事先正确卸载的设备,就会有造成设备损坏和数据丢失的风险。 -也就是说,你必须设备的盘符或者挂载点中退出,才能卸载设备。换言之,当前工作目录不能是需要卸载设备的挂载点。否则,系统将返回设备繁忙的提示信息。 +也就是说,你必须“离开”设备的块设备描述符或者挂载点,才能卸载设备。换言之,你的当前工作目录不能是需要卸载设备的挂载点。否则,系统将返回设备繁忙的提示信息。 ![Unmount Device in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Unmount-Device.png) -卸载设备 +*卸载设备* 离开需卸载设备的挂载点最简单的方法就是,运行不带任何选项的 cd 命令,这样会回到当前用户的家目录。 - ### 挂载常见的网络文件系统 ### -最常用的两种网络文件系统是 SMB(Server Message Block,服务器消息块)和 NFS(Network File System,网络文件系统)。如果你只向类 Unix 客户端提供共享,用 NFS 就可以了,如果是向 Windows 和其他类 Unix客户端提供共享服务,就需要用到 Samba 了。 +最常用的两种网络文件系统是 SMB(Server Message Block,服务器消息块)和 NFS(Network File System,网络文件系统)。如果你只向类 Unix 客户端提供共享,用 NFS 就可以了,如果是向 Windows 和其他类 Unix 客户端提供共享服务,就需要用到 Samba 了。 扩展阅读 @@ -130,13 +121,13 @@ mount 命令会尝试寻找挂载点,如果找不到就会查找设备(上 下面的例子中,假设 Samba 和 NFS 已经在地址为 192.168.0.10 的服务器上架设好了(请注意,架设 NFS 服务器也是 LFCS 考试中需要考核的能力,我们会在后边中提到)。 - #### 在 Linux 中挂载 Samba 共享 #### 第一步:在 Red Hat 以 Debian 系发行版中安装 samba-client、samba-common 和 cifs-utils 软件包,如下: # yum update && yum install samba-client samba-common cifs-utils # aptitude update && aptitude install samba-client samba-common cifs-utils + 然后运行下列命令,查看服务器上可用的 Samba 共享。 # smbclient -L 192.168.0.10 @@ -145,7 +136,7 @@ mount 命令会尝试寻找挂载点,如果找不到就会查找设备(上 ![Mount Samba Share in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Mount-Samba-Share.png) -挂载 Samba 共享 +*挂载 Samba 共享* 上图中,已经对可以挂载到我们本地系统上的共享进行高亮显示。你只需要与一个远程服务器上的合法用户名及密码就可以访问共享了。 @@ -164,7 +155,7 @@ mount 命令会尝试寻找挂载点,如果找不到就会查找设备(上 ![Mount Password Protect Samba Share](http://www.tecmint.com/wp-content/uploads/2014/10/Mount-Password-Protect-Samba-Share.png) -挂载有密码保护的 Samba 共享 +*挂载有密码保护的 Samba 共享* #### 在 Linux 系统中挂载 NFS 共享 #### @@ -185,7 +176,7 @@ mount 命令会尝试寻找挂载点,如果找不到就会查找设备(上 ![Mount NFS Share in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Mount-NFS-Share.png) -挂载 NFS 共享 +*挂载 NFS 共享* ### 永久性挂载文件系统 ### @@ -197,13 +188,12 @@ mount 命令会尝试寻找挂载点,如果找不到就会查找设备(上 其中: -- : 第一个字段指定挂载的设备。大多数发行版本都通过分区的标卷(label)或者 UUID 来指定。这样做可以避免分区号改变是带来的错误。 -- : 第二字段指定挂载点。 -- :文件系统的类型代码与 mount 命令挂载文件系统时使用的类型代码是一样的。通过 auto 类型代码可以让内核自动检测文件系统,这对于可移动设备来说非常方便。注意,该选项可能不是对所有文件系统可用。 -- : 一个(或多个)挂载选项。 -- : 你可能把这个字段设置为 0(否则设置为 1),使得系统启动时禁用 dump 工具(dump 程序曾经是一个常用的备份工具,但现在越来越少用了)对文件系统进行备份。 - -- : 这个字段指定启动系统是是否通过 fsck 来检查文件系统的完整性。0 表示 fsck 不对文件系统进行检查。数字越大,优先级越低。因此,根分区(/)最可能使用数字 1,其他所有需要检查的分区则是以数字 2. +- \: 第一个字段指定挂载的设备。大多数发行版本都通过分区的标卷(label)或者 UUID 来指定。这样做可以避免分区号改变时带来的错误。 +- \: 第二个字段指定挂载点。 +- \ :文件系统的类型代码与 mount 命令挂载文件系统时使用的类型代码是一样的。通过 auto 类型代码可以让内核自动检测文件系统,这对于可移动设备来说非常方便。注意,该选项可能不是对所有文件系统可用。 +- \: 一个(或多个)挂载选项。 +- \: 你可能把这个字段设置为 0(否则设置为 1),使得系统启动时禁用 dump 工具(dump 程序曾经是一个常用的备份工具,但现在越来越少用了)对文件系统进行备份。 +- \: 这个字段指定启动系统是是否通过 fsck 来检查文件系统的完整性。0 表示 fsck 不对文件系统进行检查。数字越大,优先级越低。因此,根分区(/)最可能使用数字 1,其他所有需要检查的分区则是以数字 2. **Mount 命令例示** @@ -211,7 +201,7 @@ mount 命令会尝试寻找挂载点,如果找不到就会查找设备(上 LABEL=TECMINT /mnt ext4 rw,noexec 0 0 -2. 若你想在系统启动时挂载 DVD 光驱中的内容,添加已下语句。 +2. 若你想在系统启动时挂载 DVD 光驱中的内容,添加以下语句。 /dev/sr0 /media/cdrom0 iso9660 ro,user,noauto 0 0 @@ -219,7 +209,7 @@ mount 命令会尝试寻找挂载点,如果找不到就会查找设备(上 ### 总结 ### -可以放心,在命令行中挂载/卸载本地和网络文件系统将是你作为系统管理员的日常责任的一部分。同时,你需要掌握 /etc/fstab 文件的编写。希望本文对你有帮助。随时在下边发表评论(或者提问),并分享本文到你的朋友圈。 +不用怀疑,在命令行中挂载/卸载本地和网络文件系统将是你作为系统管理员的日常责任的一部分。同时,你需要掌握 /etc/fstab 文件的编写。希望本文对你有帮助。随时在下边发表评论(或者提问),并分享本文到你的朋友圈。 参考链接 @@ -234,7 +224,7 @@ via: http://www.tecmint.com/mount-filesystem-in-linux/ 作者:[Gabriel Cánepa][a] 译者:[GHLandy](https://github.com/GHLandy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 6fc772fea1e2a0709021e2b5a1f906437d3ee8a8 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 11 Apr 2016 09:15:47 +0800 Subject: [PATCH 0606/1469] PUB:20151028 10 Tips for 10x Application Performance @oska874 --- ...10 Tips for 10x Application Performance.md | 199 +++++++++--------- 1 file changed, 98 insertions(+), 101 deletions(-) diff --git a/translated/tech/20151028 10 Tips for 10x Application Performance.md b/translated/tech/20151028 10 Tips for 10x Application Performance.md index 55cd24bd9a..9641a2e546 100644 --- a/translated/tech/20151028 10 Tips for 10x Application Performance.md +++ b/translated/tech/20151028 10 Tips for 10x Application Performance.md @@ -1,208 +1,207 @@ -10 Tips for 10x Application Performance - 将程序性能提高十倍的10条建议 ================================================================================ -提高web 应用的性能从来没有比现在更关键过。网络经济的比重一直在增长;全球经济超过5% 的价值是在因特网上产生的(数据参见下面的资料)。我们的永远在线、超级连接的世界意味着用户的期望值也处于历史上的最高点。如果你的网站不能及时的响应,或者你的app 不能无延时的工作,用户会很快的投奔到你的竞争对手那里。 +提高 web 应用的性能从来没有比现在更重要过。网络经济的比重一直在增长;全球经济超过 5% 的价值是在因特网上产生的(数据参见下面的资料)。这个时刻在线的超连接世界意味着用户对其的期望值也处于历史上的最高点。如果你的网站不能及时的响应,或者你的 app 不能无延时的工作,用户会很快的投奔到你的竞争对手那里。 -举一个例子,一份亚马逊十年前做过的研究可以证明,甚至在那个时候,网页加载时间每减少100毫秒,收入就会增加1%。另一个最近的研究特别强调一个事实,即超过一半的网站拥有着在调查中说他们会因为应用程序性能的问题流失用户。 +举一个例子,一份亚马逊十年前做过的研究可以证明,甚至在那个时候,网页加载时间每减少100毫秒,收入就会增加1%。另一个最近的研究特别强调一个事实,即超过一半的网站拥有者在调查中承认它们会因为应用程序性能的问题流失用户。 -网站到底需要多块呢?对于页面加载,每增加1秒钟就有4%的用户放弃使用。顶级的电子商务站点的页面在第一次交互时可以做到1秒到3秒加载时间,而这是提供最高舒适度的速度。很明显这种利害关系对于web 应用来说很高,而且在不断的增加。 +网站到底需要多快呢?对于页面加载,每增加1秒钟就有4%的用户放弃使用。顶级的电子商务站点的页面在第一次交互时可以做到1秒到3秒加载时间,而这是提供最高舒适度的速度。很明显这种利害关系对于 web 应用来说很高,而且在不断的增加。 -想要提高效率很简单,但是看到实际结果很难。要在旅途上帮助你,这篇blog 会给你提供10条最高可以10倍的提升网站性能的建议。这是系列介绍提高应用程序性能的第一篇文章,包括测试充分的优化技术和一点NGIX 的帮助。这个系列给出了潜在的提高安全性的帮助。 +想要提高效率很简单,但是看到实际结果很难。为了在你的探索之旅上帮助到你,这篇文章会给你提供10条最高可以提升10倍网站性能的建议。这是系列介绍提高应用程序性能的第一篇文章,包括充分测试的优化技术和一点 NGINX 的帮助。这个系列也给出了潜在的提高安全性的帮助。 ### Tip #1: 通过反向代理来提高性能和增加安全性 ### -如果你的web 应用运行在单个机器上,那么这个办法会明显的提升性能:只需要添加一个更快的机器,更好的处理器,更多的内存,更快的磁盘阵列,等等。然后新机器就可以更快的运行你的WordPress 服务器, Node.js 程序, Java 程序,以及其它程序。(如果你的程序要访问数据库服务器,那么这个办法还是很简单:添加两个更快的机器,以及在两台电脑之间使用一个更快的链路。) +如果你的 web 应用运行在单个机器上,那么这个办法会明显的提升性能:只需要换一个更快的机器,更好的处理器,更多的内存,更快的磁盘阵列,等等。然后新机器就可以更快的运行你的 WordPress 服务器, Node.js 程序, Java 程序,以及其它程序。(如果你的程序要访问数据库服务器,那么解决方法依然很简单:添加两个更快的机器,以及在两台电脑之间使用一个更快的链路。) -问题是,机器速度可能并不是问题。web 程序运行慢经常是因为计算机一直在不同的任务之间切换:和用户的成千上万的连接,从磁盘访问文件,运行代码,等等。应用服务器可能会抖动-内存不足,将内存数据写会磁盘,以及多个请求等待一个任务完成,如磁盘I/O。 +问题是,机器速度可能并不是问题。web 程序运行慢经常是因为计算机一直在不同的任务之间切换:通过成千上万的连接和用户交互,从磁盘访问文件,运行代码,等等。应用服务器可能会抖动(thrashing)-比如说内存不足、将内存数据交换到磁盘,以及有多个请求要等待某个任务完成,如磁盘I/O。 -你可以采取一个完全不同的方案来替代升级硬件:添加一个反向代理服务器来分担部分任务。[反向代理服务器][1] 位于运行应用的机器的前端,是用来处理网络流量的。只有反向代理服务器是直接连接到互联网的;和程序的通讯都是通过一个快速的内部网络完成的。 +你可以采取一个完全不同的方案来替代升级硬件:添加一个反向代理服务器来分担部分任务。[反向代理服务器][1] 位于运行应用的机器的前端,是用来处理网络流量的。只有反向代理服务器是直接连接到互联网的;和应用服务器的通讯都是通过一个快速的内部网络完成的。 -使用反向代理服务器可以将应用服务器从等待用户与web 程序交互解放出来,这样应用服务器就可以专注于为反向代理服务器构建网页,让其能够传输到互联网上。而应用服务器就不需要在能带客户端的响应,可以运行与接近优化过的性能水平。 +使用反向代理服务器可以将应用服务器从等待用户与 web 程序交互解放出来,这样应用服务器就可以专注于为反向代理服务器构建网页,让其能够传输到互联网上。而应用服务器就不需要等待客户端的响应,其运行速度可以接近于优化后的性能水平。 -添加方向代理服务器还可以给你的web 服务器安装带来灵活性。比如,一个已知类型的服务器已经超载了,那么就可以轻松的添加另一个相同的服务器;如果某个机器宕机了,也可以很容易的被替代。 +添加反向代理服务器还可以给你的 web 服务器安装带来灵活性。比如,一个某种类型的服务器已经超载了,那么就可以轻松的添加另一个相同的服务器;如果某个机器宕机了,也可以很容易替代一个新的。 -因为反向代理带来的灵活性,所以方向代理也是一些性能加速功能的必要前提,比如: +因为反向代理带来的灵活性,所以反向代理也是一些性能加速功能的必要前提,比如: -- **负载均衡** (参见 [Tip #2][2]) – 负载均衡运行在方向代理服务器上,用来将流量均衡分配给一批应用。有了合适的负载均衡,你就可以在不改变程序的前提下添加应用服务器。 -- **缓存静态文件** (参见 [Tip #3][3]) – 直接读取的文件,比如图像或者代码,可以保存在方向代理服务器,然后直接发给客户端,这样就可以提高速度、分担应用服务器的负载,可以让应用运行的更快 -- **网站安全** – 反响代理服务器可以提高网站安全性,以及快速的发现和响应攻击,保证应用服务器处于被保护状态。 +- **负载均衡** (参见 [Tip #2][2]) – 负载均衡运行在反向代理服务器上,用来将流量均衡分配给一批应用。有了合适的负载均衡,你就可以添加应用服务器而根本不用修改应用。 +- **缓存静态文件** (参见 [Tip #3][3]) – 直接读取的文件,比如图片或者客户端代码,可以保存在反向代理服务器,然后直接发给客户端,这样就可以提高速度、分担应用服务器的负载,可以让应用运行的更快。 +- **网站安全** – 反向代理服务器可以提高网站安全性,以及快速的发现和响应攻击,保证应用服务器处于被保护状态。 -NGINX 软件是一个专门设计的反响代理服务器,也包含了上述的多种功能。NGINX 使用事件驱动的方式处理问题,着回避传统的服务器更加有效率。NGINX plus 天价了更多高级的反向代理特性,比如程序[健康度检查][4],专门用来处理request 路由,高级缓冲和相关支持。 +NGINX 软件为用作反向代理服务器而专门设计,也包含了上述的多种功能。NGINX 使用事件驱动的方式处理请求,这会比传统的服务器更加有效率。NGINX plus 添加了更多高级的反向代理特性,比如应用的[健康度检查][4],专门用来处理请求路由、高级缓冲和相关支持。 ![NGINX Worker Process helps increase application performance](https://www.nginx.com/wp-content/uploads/2015/10/Graph-11.png) ### Tip #2: 添加负载平衡 ### -添加一个[负载均衡服务器][5] 是一个相当简单的用来提高性能和网站安全性的的方法。使用负载均衡讲流量分配到多个服务器,是用来替代只使用一个巨大且高性能web 服务器的方案。即使程序写的不好,或者在扩容方面有困难,只使用负载均衡服务器就可以很好的提高用户体验。 +添加一个[负载均衡服务器][5] 是一个相当简单的用来提高性能和网站安全性的的方法。与其将核心 Web 服务器变得越来越大和越来越强,不如使用负载均衡将流量分配到多个服务器。即使程序写的不好,或者在扩容方面有困难,仅是使用负载均衡服务器就可以很好的提高用户体验。 -负载均衡服务器首先是一个反响代理服务器(参见[Tip #1][6])——它接收来自互联网的流量,然后转发请求给另一个服务器。小戏法是负载均衡服务器支持两个或多个应用服务器,使用[分配算法][7]将请求转发给不同服务器。最简单的负载均衡方法是轮转法,只需要将新的请求发给列表里的下一个服务器。其它的方法包括将请求发给负载最小的活动连接。NGINX plus 拥有将特定用户的会话分配给同一个服务器的[能力][8]. +负载均衡服务器首先是一个反向代理服务器(参见[Tip #1][6])——它接受来自互联网的流量,然后转发请求给另一个服务器。特别是负载均衡服务器支持两个或多个应用服务器,使用[分配算法][7]将请求转发给不同服务器。最简单的负载均衡方法是轮转法(round robin),每个新的请求都会发给列表里的下一个服务器。其它的复制均衡方法包括将请求发给活动连接最少的服务器。NGINX plus 拥有将特定用户的会话分配给同一个服务器的[能力][8]。 -负载均衡可以很好的提高性能是因为它可以避免某个服务器过载而另一些服务器却没有流量来处理。它也可以简单的扩展服务器规模,因为你可以添加多个价格相对便宜的服务器并且保证它们被充分利用了。 +负载均衡可以很好的提高性能是因为它可以避免某个服务器过载而另一些服务器却没有需要处理的流量。它也可以简单的扩展服务器规模,因为你可以添加多个价格相对便宜的服务器并且保证它们被充分利用了。 -可以进行负载均衡的协议包括HTTP, HTTPS, SPDY, HTTP/2, WebSocket,[FastCGI][9],SCGI,uwsgi, memcached,以及集中其它的应用类型,包括采用TCP 第4层协议的程序。分析你的web 应用来决定那些你要使用以及那些地方的性能不足。 +可以进行负载均衡的协议包括 HTTP、HTTPS、SPDY、HTTP/2、WebSocket、[FastCGI][9]、SCGI、uwsgi、 memcached 等,以及几种其它的应用类型,包括基于 TCP 的应用和其它的第4层协议的程序。分析你的 web 应用来决定你要使用哪些以及哪些地方性能不足。 -相同的服务器或服务器群可以被用来进行负载均衡,也可以用来处理其它的任务,如SSL 终止,提供对客户端使用的HTTP/1/x 和 HTTP/2 ,以及缓存静态文件。 +相同的服务器或服务器群可以被用来进行负载均衡,也可以用来处理其它的任务,如 SSL 末端服务器,支持客户端的 HTTP/1.x 和 HTTP/2 请求,以及缓存静态文件。 -NGINX 经常被用来进行负载均衡;要想了解更多的情况可以访问我们的[overview blog post][10], [configuration blog post][11], [ebook][12] 以及相关网站 [webinar][13], 和 [documentation][14]。我们的商业版本 [NGINX Plus][15] 支持更多优化了的负载均衡特性,如基于服务器响应时间的加载路由和Microsoft’s NTLM 协议上的负载均衡。 +NGINX 经常被用于进行负载均衡;要想了解更多的情况,可以下载我们的电子书 [选择软件负载均衡器的五个理由][10]。你也可以从 [使用 NGINX 和 NGINX Plus 配置负载均衡,第一部分][11] 中了解基本的配置指导,在 NGINX Plus 管理员指南中有完整的 [NGINX 负载均衡][12]的文档。。我们的商业版本 [NGINX Plus][15] 支持更多优化了的负载均衡特性,如基于服务器响应时间的加载路由和Microsoft’s NTLM 协议上的负载均衡。 ### Tip #3: 缓存静态和动态的内容 ### -缓存通过加速内容的传输速度来提高web 应用的性能。它可以采用一下集中策略:当需要的时候预处理要传输的内容,保存数据到速度更快的设备,把数据存储在距离客户端更近的位置,或者结合起来使用。 +缓存可以通过加速内容的传输速度来提高 web 应用的性能。它可以采用以下几种策略:当需要的时候预处理要传输的内容,保存数据到速度更快的设备,把数据存储在距离客户端更近的位置,或者将这几种方法结合起来使用。 -下面要考虑两种不同类型数据的缓冲: +有两种不同类型数据的缓冲: -- **静态内容缓存**。不经常变化的文件,比如图像(JPEG,PNG) 和代码(CSS,JavaScript),可以保存在边缘服务器,这样就可以快速的从内存和磁盘上提取。 -- **动态内容缓存**。很多web 应用回针对每个网页请求生成不同的HTML 页面。在短时间内简单的缓存每个生成HTML 内容,就可以很好的减少要生成的内容的数量,这完全可以达到你的要求。 +- **静态内容缓存**。不经常变化的文件,比如图像(JPEG、PNG) 和代码(CSS,JavaScript),可以保存在外围服务器上,这样就可以快速的从内存和磁盘上提取。 +- **动态内容缓存**。很多 web 应用会针对每次网页请求生成一个新的 HTML 页面。在短时间内简单的缓存生成的 HTML 内容,就可以很好的减少要生成的内容的数量,而且这些页面足够新,可以满足你的需要。 -举个例子,如果一个页面每秒会被浏览10次,你将它缓存1 秒,99%请求的页面都会直接从缓存提取。如果你将将数据分成静态内容,甚至新生成的页面可能都是由这些缓存构成的。 +举个例子,如果一个页面每秒会被浏览10次,你将它缓存 1 秒,90%请求的页面都会直接从缓存提取。如果你分开缓存静态内容,甚至新生成的页面可能都是由这些缓存构成的。 -下面由是web 应用发明的三种主要的缓存技术: +下面由是 web 应用发明的三种主要的缓存技术: -- **缩短数据与用户的距离**。把一份内容的拷贝放的离用户更近点来减少传输时间。 +- **缩短数据与用户的网络距离**。把一份内容的拷贝放的离用户更近的节点来减少传输时间。 - **提高内容服务器的速度**。内容可以保存在一个更快的服务器上来减少提取文件的时间。 -- **从过载服务器拿走数据**。机器经常因为要完成某些其它的任务而造成某个任务的执行速度比测试结果要差。将数据缓存在不同的机器上可以提高缓存资源和非缓存资源的效率,而这知识因为主机没有被过度使用。 +- **从过载服务器上移走数据**。机器经常因为要完成某些其它的任务而造成某个任务的执行速度比测试结果要差。将数据缓存在不同的机器上可以提高缓存资源和非缓存资源的性能,而这是因为主机没有被过度使用。 -对web 应用的缓存机制可以web 应用服务器内部实现。第一,缓存动态内容是用来减少应用服务器加载动态内容的时间。然后,缓存静态内容(包括动态内容的临时拷贝)是为了更进一步的分担应用服务器的负载。而且缓存之后会从应用服务器转移到对用户而言更快、更近的机器,从而减少应用服务器的压力,减少提取数据和传输数据的时间。 +对 web 应用的缓存机制可以在 web 应用服务器内部实现。首先,缓存动态内容是用来减少应用服务器加载动态内容的时间。其次,缓存静态内容(包括动态内容的临时拷贝)是为了更进一步的分担应用服务器的负载。而且缓存之后会从应用服务器转移到对用户而言更快、更近的机器,从而减少应用服务器的压力,减少提取数据和传输数据的时间。 改进过的缓存方案可以极大的提高应用的速度。对于大多数网页来说,静态数据,比如大图像文件,构成了超过一半的内容。如果没有缓存,那么这可能会花费几秒的时间来提取和传输这类数据,但是采用了缓存之后不到1秒就可以完成。 -举一个在实际中缓存是如何使用的例子, NGINX 和NGINX Plus使用了两条指令来[设置缓存机制][16]:proxy_cache_path 和 proxy_cache。你可以指定缓存的位置和大小,文件在缓存中保存的最长时间和其他一些参数。使用第三条(而且是相当受欢迎的一条)指令,proxy_cache_use_stale,如果服务器提供新鲜内容是忙或者挂掉之类的信息,你甚至可以让缓存提供旧的内容,这样客户端就不会一无所得。从用户的角度来看这可以很好的提高你的网站或者应用的上线时间。 +举一个在实际中缓存是如何使用的例子, NGINX 和 NGINX Plus 使用了两条指令来[设置缓存机制][16]:proxy_cache_path 和 proxy_cache。你可以指定缓存的位置和大小、文件在缓存中保存的最长时间和其它一些参数。使用第三条(而且是相当受欢迎的一条)指令 proxy_cache_use_stale,如果提供新鲜内容的服务器忙碌或者挂掉了,你甚至可以让缓存提供较旧的内容,这样客户端就不会一无所得。从用户的角度来看这可以很好的提高你的网站或者应用的可用时间。 -NGINX plus 拥有[高级缓存特性][17],包括对[缓存清除][18]的支持和在[仪表盘][19]上显示缓存状态信息。 +NGINX plus 有个[高级缓存特性][17],包括对[缓存清除][18]的支持和在[仪表盘][19]上显示缓存状态信息。 -要想获得更多关于NGINX 的缓存机制的信息可以浏览NGINX Plus 管理员指南中的 [reference documentation][20] 和 [NGINX Content Caching][21] 。 +要想获得更多关于 NGINX 的缓存机制的信息可以浏览 NGINX Plus 管理员指南中的 [参考文档][20] 和 [NGINX 内容缓存][21] 。 -**注意**:缓存机制分布于应用开发者、投资决策者以及实际的系统运维人员之间。本文提到的一些复杂的缓存机制从[DevOps 的角度][23]来看很具有价值,即对集应用开发者、架构师以及运维操作人员的功能为一体的工程师来说可以满足他们对站点功能性、响应时间、安全性和商业结果,如完成的交易数。 +**注意**:缓存机制分布于应用开发者、投资决策者以及实际的系统运维人员之间。本文提到的一些复杂的缓存机制从[DevOps 的角度][23]来看很具有价值,即对集应用开发者、架构师以及运维操作人员的功能为一体的工程师来说可以满足它们对站点功能性、响应时间、安全性和商业结果(如完成的交易数)等需要。 ### Tip #4: 压缩数据 ### 压缩是一个具有很大潜力的提高性能的加速方法。现在已经有一些针对照片(JPEG 和PNG)、视频(MPEG-4)和音乐(MP3)等各类文件精心设计和高压缩率的标准。每一个标准都或多或少的减少了文件的大小。 -文本数据 —— 包括HTML(包含了纯文本和HTL 标签),CSS和代码,比如Javascript —— 经常是未经压缩就传输的。压缩这类数据会在对应用程序性能的感觉上,特别是处于慢速或受限的移动网络的客户端,产生不成比例的影响。 +文本数据 —— 包括HTML(包含了纯文本和 HTML 标签),CSS 和代码,比如 Javascript —— 经常是未经压缩就传输的。压缩这类数据会在对应用程序性能的感觉上,特别是处于慢速或受限的移动网络的客户端,产生更大的影响。 -这是因为文本数据经常是用户与网页交互的有效数据,而多媒体数据可能更多的是起提供支持或者装饰的作用。聪明的内容压缩可以减少HTML,Javascript,CSS和其他文本内容对贷款的要求,通常可以减少30% 甚至更多的带宽和相应的页面加载时间。 +这是因为文本数据经常是用户与网页交互的有效数据,而多媒体数据可能更多的是起提供支持或者装饰的作用。智能的内容压缩可以减少 HTML,Javascript,CSS和其它文本内容对带宽的要求,通常可以减少 30% 甚至更多的带宽和相应的页面加载时间。 -如果你是用SSL,压缩可以减少需要进行SSL 编码的的数据量,而这些编码操作会占用一些CPU时间而抵消了压缩数据减少的时间。 +如果你使用 SSL,压缩可以减少需要进行 SSL 编码的的数据量,而这些编码操作会占用一些 CPU 时间而抵消了压缩数据减少的时间。 -压缩文本数据的方法很多,举个例子,在定义小说文本压缩模式的[HTTP/2 部分]就专门为适应头数据。另一个例子是可以在NGINX 里打开使用GZIP 压缩文本。你在你的服务里[预压缩文本数据][25]之后,你就可以直接使用gzip_static 指令来处理压缩过的.gz 版本。 +压缩文本数据的方法很多,举个例子,在定义小说文本压缩模式的 [HTTP/2 部分]就对于头数据来特别适合。另一个例子是可以在 NGINX 里打开使用 GZIP 压缩。你在你的服务里[预先压缩文本数据][25]之后,你就可以直接使用 gzip_static 指令来处理压缩过的 .gz 版本。 ### Tip #5: 优化 SSL/TLS ### -安全套接字([SSL][26]) 协议和它的继承者,传输层安全(TLS)协议正在被越来越多的网站采用。SSL/TLS 对从原始服务器发往用户的数据进行加密提高了网站的安全性。影响这个趋势的部分原因是Google 正在使用SSL/TLS,这在搜索引擎排名上是一个正面的影响因素。 +安全套接字([SSL][26]) 协议和它的下一代版本传输层安全(TLS)协议正在被越来越多的网站采用。SSL/TLS 对从原始服务器发往用户的数据进行加密提高了网站的安全性。影响这个趋势的部分原因是 Google 正在使用 SSL/TLS,这在搜索引擎排名上是一个正面的影响因素。 -尽管SSL/TLS 越来越流行,但是使用加密对速度的影响也让很多网站望而却步。SSL/TLS 之所以让网站变的更慢,原因有二: +尽管 SSL/TLS 越来越流行,但是使用加密对速度的影响也让很多网站望而却步。SSL/TLS 之所以让网站变的更慢,原因有二: -1. 任何一个连接第一次连接时的握手过程都需要传递密钥。而采用HTTP/1.x 协议的浏览器在建立多个连接时会对每个连接重复上述操作。 -2. 数据在传输过程中需要不断的在服务器加密、在客户端解密。 +1. 任何一个连接第一次连接时的握手过程都需要传递密钥。而采用 HTTP/1.x 协议的浏览器在建立多个连接时会对每个连接重复上述操作。 +2. 数据在传输过程中需要不断的在服务器端加密、在客户端解密。 -要鼓励使用SSL/TLS,HTTP/2 和SPDY(在[下一章][27]会描述)的作者设计新的协议来让浏览器只需要对一个浏览器会话使用一个连接。这会大大的减少上述两个原因中的一个浪费的时间。然而现在可以用来提高应用程序使用SSL/TLS 传输数据的性能的方法不止这些。 +为了鼓励使用 SSL/TLS,HTTP/2 和 SPDY(在[下一章][27]会描述)的作者设计了新的协议来让浏览器只需要对一个浏览器会话使用一个连接。这会大大的减少上述第一个原因所浪费的时间。然而现在可以用来提高应用程序使用 SSL/TLS 传输数据的性能的方法不止这些。 -web 服务器有对应的机制优化SSL/TLS 传输。举个例子,NGINX 使用[OpenSSL][28]运行在普通的硬件上提供接近专用硬件的传输性能。NGINX [SSL 性能][29] 有详细的文档,而且把对SSL/TLS 数据进行加解密的时间和CPU 占用率降低了很多。 +web 服务器有对应的机制优化 SSL/TLS 传输。举个例子,NGINX 使用 [OpenSSL][28] 运行在普通的硬件上提供了接近专用硬件的传输性能。NGINX 的 [SSL 性能][29] 有详细的文档,而且把对 SSL/TLS 数据进行加解密的时间和 CPU 占用率降低了很多。 -更进一步,在这篇[blog][30]有详细的说明如何提高SSL/TLS 性能,可以总结为一下几点: +更进一步,参考这篇[文章][30]了解如何提高 SSL/TLS 性能的更多细节,可以总结为一下几点: -- **会话缓冲**。使用指令[ssl_session_cache][31]可以缓存每个新的SSL/TLS 连接使用的参数。 -- **会话票据或者ID**。把SSL/TLS 的信息保存在一个票据或者ID 里可以流畅的复用而不需要重新握手。 -- **OCSP 分割**。通过缓存SSL/TLS 证书信息来减少握手时间。 +- **会话缓冲**。使用指令 [ssl_session_cache][31] 可以缓存每个新的 SSL/TLS 连接使用的参数。 +- **会话票据或者 ID**。把 SSL/TLS 的信息保存在一个票据或者 ID 里可以流畅的复用而不需要重新握手。 +- **OCSP 分割**。通过缓存 SSL/TLS 证书信息来减少握手时间。 -NGINX 和NGINX Plus 可以被用作SSL/TLS 终结——处理客户端流量的加密和解密,而同时和其他服务器进行明文通信。使用[这几步][32] 来设置NGINX 和NGINX Plus 处理SSL/TLS 终止。同时,这里还有一些NGINX Plus 和接收TCP 连接的服务器一起使用时的[特有的步骤][33] +NGINX 和 NGINX Plus 可以被用作 SSL/TLS 服务端,用于处理客户端流量的加密和解密,而同时以明文方式和其它服务器进行通信。要设置 NGINX 和 NGINX Plus 作为 SSL/TLS 服务端,参看 [HTTPS 连接][32] 和[加密的 TCP 连接][33] ### Tip #6: 使用 HTTP/2 或 SPDY ### -对于已经使用了SSL/TLS 的站点,HTTP/2 和SPDY 可以很好的提高性能,因为每个连接只需要一次握手。而对于没有使用SSL/TLS 的站点来说,HTTP/2 和SPDY会在响应速度上有些影响(通常会将度效率)。 +对于已经使用了 SSL/TLS 的站点,HTTP/2 和 SPDY 可以很好的提高性能,因为每个连接只需要一次握手。而对于没有使用 SSL/TLS 的站点来说,从响应速度的角度来说 HTTP/2 和 SPDY 将让迁移到 SSL/TLS 没有什么压力(原本会降低效率)。 -Google 在2012年开始把SPDY 作为一个比HTTP/1.x 更快速的协议来推荐。HTTP/2 是目前IETF 标准,他也基于SPDY。SPDY 已经被广泛的支持了,但是很快就会被HTTP/2 替代。 +Google 在2012年开始把 SPDY 作为一个比 HTTP/1.x 更快速的协议来推荐。HTTP/2 是目前 IETF 通过的标准,是基于 SPDY 的。SPDY 已经被广泛的支持了,但是很快就会被 HTTP/2 替代。 -SPDY 和HTTP/2 的关键是用单连接来替代多路连接。单个连接是被复用的,所以它可以同时携带多个请求和响应的分片。 +SPDY 和 HTTP/2 的关键是用单一连接来替代多路连接。单个连接是被复用的,所以它可以同时携带多个请求和响应的分片。 -通过使用一个连接这些协议可以避免过多的设置和管理多个连接,就像浏览器实现了HTTP/1.x 一样。单连接在对SSL 特别有效,这是因为它可以最小化SSL/TLS 建立安全链接时的握手时间。 +通过使用单一连接,这些协议可以避免像在实现了 HTTP/1.x 的浏览器中一样建立和管理多个连接。单一连接在对 SSL 特别有效,这是因为它可以最小化 SSL/TLS 建立安全链接时的握手时间。 -SPDY 协议需要使用SSL/TLS, 而HTTP/2 官方并不需要,但是目前所有支持HTTP/2的浏览器只有在使能了SSL/TLS 的情况下才会使用它。这就意味着支持HTTP/2 的浏览器只有在网站使用了SSL 并且服务器接收HTTP/2 流量的情况下才会启用HTTP/2。否则的话浏览器就会使用HTTP/1.x 协议。 +SPDY 协议需要使用 SSL/TLS,而 HTTP/2 官方标准并不需要,但是目前所有支持 HTTP/2 的浏览器只有在启用了 SSL/TLS 的情况下才能使用它。这就意味着支持 HTTP/2 的浏览器只有在网站使用了 SSL 并且服务器接收 HTTP/2 流量的情况下才会启用 HTTP/2。否则的话浏览器就会使用 HTTP/1.x 协议。 -当你实现SPDY 或者HTTP/2时,你不再需要通常的HTTP 性能优化方案,比如域分隔资源聚合,以及图像登记。这些改变可以让你的代码和部署变得更简单和更易于管理。要了解HTTP/2 带来的这些变化可以浏览我们的[白皮书][34]。 +当你实现 SPDY 或者 HTTP/2 时,你不再需要那些常规的 HTTP 性能优化方案,比如按域分割、资源聚合,以及图像拼合。这些改变可以让你的代码和部署变得更简单和更易于管理。要了解 HTTP/2 带来的这些变化可以浏览我们的[白皮书][34]。 ![NGINX Supports SPDY and HTTP/2 for increased web application performance](https://www.nginx.com/wp-content/uploads/2015/10/http2-27.png) -作为支持这些协议的一个样例,NGINX 已经从一开始就支持了SPDY,而且[大部分使用SPDY 协议的网站][35]都运行的是NGINX。NGINX 同时也[很早][36]对HTTP/2 的提供了支持,从2015 年9月开始开源NGINX 和NGINX Plus 就[支持][37]它了。 +作为支持这些协议的一个样例,NGINX 已经从一开始就支持了 SPDY,而且[大部分使用 SPDY 协议的网站][35]都运行的是 NGINX。NGINX 同时也[很早][36]对 HTTP/2 的提供了支持,从2015 年9月开始,开源版 NGINX 和 NGINX Plus 就[支持][37]它了。 -经过一段时间,我们NGINX 希望更多的站点完全是能SSL 并且向HTTP/2 迁移。这将会提高安全性,同时新的优化手段也会被发现和实现,更简单的代码表现的更加优异。 +经过一段时间,我们 NGINX 希望更多的站点完全启用 SSL 并且向 HTTP/2 迁移。这将会提高安全性,同时也会找到并实现新的优化手段,简化的代码表现的会更加优异。 ### Tip #7: 升级软件版本 ### -一个提高应用性能的简单办法是根据软件的稳定性和性能的评价来选在你的软件栈。进一步说,因为高性能组件的开发者更愿意追求更高的性能和解决bug ,所以值得使用最新版本的软件。新版本往往更受开发者和用户社区的关注。更新的版本往往会利用到新的编译器优化,包括对新硬件的调优。 +一个提高应用性能的简单办法是根据软件的稳定性和性能的评价来选在你的软件栈。进一步说,因为高性能组件的开发者更愿意追求更高的性能和解决 bug ,所以值得使用最新版本的软件。新版本往往更受开发者和用户社区的关注。更新的版本往往会利用到新的编译器优化,包括对新硬件的调优。 -稳定的新版本通常比旧版本具有更好的兼容性和更高的性能。一直进行软件更新,可以非常简单的保持软件保持最佳的优化,解决掉bug,以及安全性的提高。 +稳定的新版本通常比旧版本具有更好的兼容性和更高的性能。一直进行软件更新,可以非常简单的保持软件保持最佳的优化,解决掉 bug,以及提高安全性。 -一直使用旧版软件也会组织你利用新的特性。比如上面说到的HTTP/2,目前要求OpenSSL 1.0.1.在2016 年中期开始将会要求1.0.2 ,而这是在2015年1月才发布的。 +一直使用旧版软件也会阻止你利用新的特性。比如上面说到的 HTTP/2,目前要求 OpenSSL 1.0.1。在2016 年中期开始将会要求1.0.2 ,而它是在2015年1月才发布的。 -NGINX 用户可以开始迁移到[NGINX 最新的开源软件][38] 或者[NGINX Plus][39];他们都包含了罪行的能力,如socket分区和线程池(见下文),这些都已经为性能优化过了。然后好好看看的你软件栈,把他们升级到你能能升级道德最新版本吧。 +NGINX 用户可以开始迁移到 [NGINX 最新的开源软件][38] 或者 [NGINX Plus][39];它们都包含了最新的能力,如 socket 分割和线程池(见下文),这些都已经为性能优化过了。然后好好看看的你软件栈,把它们升级到你能升级到的最新版本吧。 -### Tip #8: linux 系统性能调优 ### +### Tip #8: Linux 系统性能调优 ### -linux 是大多数web 服务器使用操作系统,而且作为你的架构的基础,Linux 表现出明显可以提高性能的机会。默认情况下,很多linux 系统都被设置为使用很少的资源,匹配典型的桌面应用负载。这就意味着web 应用需要最少一些等级的调优才能达到最大效能。 +Linux 是大多数 web 服务器使用的操作系统,而且作为你的架构的基础,Linux 显然有不少提高性能的可能。默认情况下,很多 Linux 系统都被设置为使用很少的资源,以符合典型的桌面应用使用。这就意味着 web 应用需要一些微调才能达到最大效能。 -Linux 优化是转变们针对web 服务器方面的。以NGINX 为例,这里有一些在加速linux 时需要强调的变化: +这里的 Linux 优化是专门针对 web 服务器方面的。以 NGINX 为例,这里有一些在加速 Linux 时需要强调的变化: -- **缓冲队列**。如果你有挂起的连接,那么你应该考虑增加net.core.somaxconn 的值,它代表了可以缓存的连接的最大数量。如果连接线直太小,那么你将会看到错误信息,而你可以逐渐的增加这个参数知道错误信息停止出现。 -- **文件描述符**。NGINX 对一个连接使用最多2个文件描述符。如果你的系统有很多连接,你可能就需要提高sys.fs.file_max ,增加系统对文件描述符数量整体的限制,这样子才能支持不断增加的负载需求。 -- **临时端口**。当使用代理时,NGINX 会为每个上游服务器创建临时端口。你可以设置net.ipv4.ip_local_port_range 来提高这些端口的范围,增加可用的端口。你也可以减少非活动的端口的超时判断来重复使用端口,这可以通过net.ipv4.tcp_fin_timeout 来设置,这可以快速的提高流量。 +- **缓冲队列**。如果你有挂起的连接,那么你应该考虑增加 net.core.somaxconn 的值,它代表了可以缓存的连接的最大数量。如果连接限制太小,那么你将会看到错误信息,而你可以逐渐的增加这个参数直到错误信息停止出现。 +- **文件描述符**。NGINX 对一个连接使用最多2个文件描述符。如果你的系统有很多连接请求,你可能就需要提高sys.fs.file_max ,以增加系统对文件描述符数量整体的限制,这样才能支持不断增加的负载需求。 +- **临时端口**。当使用代理时,NGINX 会为每个上游服务器创建临时端口。你可以设置net.ipv4.ip_local_port_range 来提高这些端口的范围,增加可用的端口号。你也可以减少非活动的端口的超时判断来重复使用端口,这可以通过 net.ipv4.tcp_fin_timeout 来设置,这可以快速的提高流量。 -对于NGINX 来说,可以查阅[NGINX 性能调优指南][40]来学习如果优化你的Linux 系统,这样子它就可以很好的适应大规模网络流量而不会超过工作极限。 +对于 NGINX 来说,可以查阅 [NGINX 性能调优指南][40]来学习如果优化你的 Linux 系统,这样它就可以很好的适应大规模网络流量而不会超过工作极限。 ### Tip #9: web 服务器性能调优 ### -无论你是用哪种web 服务器,你都需要对它进行优化来提高性能。下面的推荐手段可以用于任何web 服务器,但是一些设置是针对NGINX的。关键的优化手段包括: +无论你是用哪种 web 服务器,你都需要对它进行优化来提高性能。下面的推荐手段可以用于任何 web 服务器,但是一些设置是针对 NGINX 的。关键的优化手段包括: -- **f访问日志**。不要把每个请求的日志都直接写回磁盘,你可以在内存将日志缓存起来然后一批写回磁盘。对于NGINX 来说添加给指令*access_log* 添加参数 *buffer=size* 可以让系统在缓存满了的情况下才把日志写到此哦按。如果你添加了参数**flush=time** ,那么缓存内容会每隔一段时间再写回磁盘。 -- **缓存**。缓存掌握了内存中的部分资源知道满了位置,这可以让与客户端的通信更加高效。与内存中缓存不匹配的响应会写回磁盘,而这就会降低效能。当NGINX [启用][42]了缓存机制后,你可以使用指令*proxy_buffer_size* 和 *proxy_buffers* 来管理缓存。 -- **客户端保活**。保活连接可以减少开销,特别是使用SSL/TLS时。对于NGINX 来说,你可以增加*keepalive_requests* 的值,从默认值100 开始修改,这样一个客户端就可以转交一个指定的连接,而且你也可以通过增加*keepalive_timeout* 的值来允许保活连接存活更长时间,结果就是让后来的请求处理的更快速。 -- **上游保活**。上游的连接——即连接到应用服务器、数据库服务器等机器的连接——同样也会收益于连接保活。对于上游连接老说,你可以增加*保活时间*,即每个工人进程的空闲保活连接个数。这就可以提高连接的复用次数,减少需要重新打开全新的连接次数。更多关于保活连接的信息可以参见[blog][41]. -- **限制**。限制客户端使用的资源可以提高性能和安全性。对于NGINX 来说指令*limit_conn* 和 *limit_conn_zone* 限制了每个源的连接数量,而*limit_rate* 限制了带宽。这些限制都可以阻止合法用户*攫取* 资源,同时夜避免了攻击。指令*limit_req* 和 *limit_req_zone* 限制了客户端请求。对于上游服务器来说,可以在上游服务器的配置块里使用max_conns 可以限制连接到上游服务器的连接。 这样可以避免服务器过载。关联的队列指令会创建一个队列来在连接数抵达*max_conn* 限制时在指定的长度的时间内保存特定数量的请求。 -- **工人进程**。工人进程负责处理请求。NGINX 采用事件驱动模型和依赖操作系统的机制来有效的讲请求分发给不同的工人进程。这条建议推荐设置每个CPU 的参数*worker_processes* 。如果需要的话,工人连接的最大数(默认512)可以安全在大部分系统增加,是指找到最适合你的系统的值。 -- **套接字分割**。通常一个套接字监听器会把新连接分配给所有工人进程。套接字分割会未每个工人进程创建一个套接字监听器,这样一来以内核分配连接给套接字就成为可能了。折可以减少锁竞争,并且提高多核系统的性能,要使能[套接字分隔][43]需要在监听指令里面加上复用端口参数。 -- **线程池**。一个计算机进程可以处理一个缓慢的操作。对于web 服务器软件来说磁盘访问会影响很多更快的操作,比如计算或者在内存中拷贝。使用了线程池之后慢操作可以分配到不同的任务集,而主进程可以一直运行快速操作。当磁盘操作完成后结果会返回给主进程的循环。在NGINX理有两个操作——read()系统调用和sendfile() ——被分配到了[线程池][44] +- **访问日志**。不要把每个请求的日志都直接写回磁盘,你可以在内存将日志缓存起来然后批量写回磁盘。对于NGINX 来说,给指令 **access_log** 添加参数 **buffer=size** 可以让系统在缓存满了的情况下才把日志写到磁盘。如果你添加了参数 **flush=time** ,那么缓存内容会每隔一段时间再写回磁盘。 +- **缓存**。缓存会在内存中存放部分响应,直到满了为止,这可以让与客户端的通信更加高效。内存放不下的响应会写回磁盘,而这就会降低效能。当 NGINX [启用][42]了缓存机制后,你可以使用指令 **proxy_buffer_size** 和 **proxy_buffers** 来管理缓存。 +- **客户端保活**。保活连接可以减少开销,特别是使用 SSL/TLS 时。对于 NGINX 来说,你可以从 **keepalive_requests** 的默认值 100 开始增加最大连接数,这样一个客户端就可以在一个指定的连接上请求多次,而且你也可以通过增加 **keepalive_timeout** 的值来允许保活连接存活更长时间,这样就可以让后来的请求处理的更快速。 +- **上游保活**。上游的连接——即连接到应用服务器、数据库服务器等机器的连接——同样也会受益于连接保活。对于上游连接来说,你可以增加 **keepalive**,即每个工人进程的空闲保活连接个数。这就可以提高连接的复用次数,减少需要重新打开全新连接的次数。更多关于保活连接的信息可以参见[这篇“ HTTP 保活连接和性能”][41]。 +- **限制**。限制客户端使用的资源可以提高性能和安全性。对于 NGINX 来说,指令 **limit_conn** 和 **limit_conn_zone** 限制了给定来源的连接数量,而 **limit_rate** 限制了带宽。这些限制都可以阻止合法用户*扒取*资源,同时也避免了攻击。指令 **limit_req** 和 **limit_req_zone** 限制了客户端请求。对于上游服务器来说,可以在 upstream 的配置块里的 server 指令使用 max_conns 参数来限制连接到上游服务器的连接数。 这样可以避免服务器过载。关联的 queue 指令会创建一个队列来在连接数抵达 **max_conn** 限制时在指定长度的时间内保存特定数量的请求。 +- **工人进程**。工人进程负责处理请求。NGINX 采用事件驱动模型和操作系统特定的机制来有效的将请求分发给不同的工人进程。这条建议推荐设置 **worker_processes** 为每个 CPU 一个 。worker_connections 的最大数(默认512)可以在大部分系统上根据需要增加,实验性地找到最适合你的系统的值。 +- **套接字分割**。通常一个套接字监听器会把新连接分配给所有工人进程。套接字分割会为每个工人进程创建一个套接字监听器,这样一来以当套接字监听器可用时,内核就会将连接分配给它。这可以减少锁竞争,并且提高多核系统的性能,要启用[套接字分隔][43]需要在 **listen** 指令里面加上 **reuseport** 参数。 +- **线程池**。计算机进程可能被一个单一的缓慢的操作所占用。对于 web 服务器软件来说,磁盘访问会影响很多更快的操作,比如计算或者在内存中拷贝。使用了线程池之后慢操作可以分配到不同的任务集,而主进程可以一直运行快速操作。当磁盘操作完成后结果会返回给主进程的循环。在 NGINX 里有两个操作——read() 系统调用和 sendfile() ——被分配到了[线程池][44] ![Thread pools help increase application performance by assigning a slow operation to a separate set of tasks](https://www.nginx.com/wp-content/uploads/2015/10/Graph-17.png) -**技巧**。当改变任务操作系统或支持服务的设置时,一次只改变一个参数然后测试性能。如果修改引起问题了,或者不能让你的系统更快那么就改回去。 +**技巧**。当改变任何操作系统或支持服务的设置时,一次只改变一个参数然后测试性能。如果修改引起问题了,或者不能让你的系统更快,那么就改回去。 -在[blog][45]可以看到更详细的NGINX 调优方法。 +在[文章“调优 NGINX 性能”][45]里可以看到更详细的 NGINX 调优方法。 ### Tip #10: 监视系统活动来解决问题和瓶颈 ### -在应用开发中要使得系统变得非常高效的关键是监视你的系统在现实世界运行的性能。你必须能通过特定的设备和你的web 基础设施上监控程序活动。 +在应用开发中要使得系统变得非常高效的关键是监视你的系统在现实世界运行的性能。你必须能通过特定的设备和你的 web 基础设施上监控程序活动。 -监视活动是最积极的——他会告诉你发生了什么,把问题留给你发现和最终解决掉。 +监视活动是最积极的——它会告诉你发生了什么,把问题留给你发现和最终解决掉。 -监视可以发现集中不同的问题。它们包括: +监视可以发现几种不同的问题。它们包括: - 服务器宕机。 - 服务器出问题一直在丢失连接。 - 服务器出现大量的缓存未命中。 - 服务器没有发送正确的内容。 -应用的总体性能监控工具,比如New Relic 和Dynatrace,可以帮助你监控到从远处加载网页的时间,二NGINX 可以帮助你监控到应用发送的时 间。当你需要考虑为基础设施添加容量以满足流量需求时,应用性能数据可以告诉你你的优化措施的确起作用了。 +应用的总体性能监控工具,比如 New Relic 和 Dynatrace,可以帮助你监控到从远程加载网页的时间,而 NGINX 可以帮助你监控到应用交付端。当你需要考虑为基础设施添加容量以满足流量需求时,应用性能数据可以告诉你你的优化措施的确起作用了。 -为了帮助开发者快速的发现、解决问题,NGINX Plus 增加了[应用感知健康度检查][46] ——对重复出现的常规事件进行综合分析并在问题出现时向你发出警告。NGINX Plus 同时提供[会话过滤][47] 功能,折可以组织当前任务未完成之前不接受新的连接,另一个功能是慢启动,允许一个从错误恢复过来的服务器追赶上负载均衡服务器群的速度。当有使用得当时,健康度检查可以让你在问题变得严重到影响用户体验前就发现它,而会话过滤和慢启动可以让你替换服务器,并且这个过程不会对性能和正常运行时间产生负面影响。这个表格就展示了NGINX Plus 内建模块在web 基础设施[监视活活动][48]的仪表盘,包括了服务器群,TCP 连接和缓存等信息。 +为了帮助开发者快速的发现、解决问题,NGINX Plus 增加了[应用感知健康度检查][46] ——对重复出现的常规事件进行综合分析并在问题出现时向你发出警告。NGINX Plus 同时提供[会话过滤][47] 功能,这可以阻止当前任务完成之前接受新的连接,另一个功能是慢启动,允许一个从错误恢复过来的服务器追赶上负载均衡服务器群的进度。当使用得当时,健康度检查可以让你在问题变得严重到影响用户体验前就发现它,而会话过滤和慢启动可以让你替换服务器,并且这个过程不会对性能和正常运行时间产生负面影响。下图就展示了内建的 NGINX Plus 模块[实时活动监视][48]的仪表盘,包括了服务器群,TCP 连接和缓存信息等 Web 架构信息。 ![Use real-time application performance monitoring tools to identify and resolve issues quickly](https://www.nginx.com/wp-content/uploads/2015/10/Screen-Shot-2015-10-05-at-4.16.32-PM.png) ### 总结: 看看10倍性能提升的效果 ### -这些性能提升方案对任何一个web 应用都可用并且效果都很好,而实际效果取决于你的预算,如你能花费的时间,目前实现方案的差距。所以你该如何对你自己的应用实现10倍性能提升? +这些性能提升方案对任何一个 web 应用都可用并且效果都很好,而实际效果取决于你的预算、你能花费的时间、目前实现方案的差距。所以你该如何对你自己的应用实现10倍性能提升? -为了指导你了解每种优化手段的潜在影响,这里是是上面详述的每个优化方法的关键点,虽然你的里程肯定大不相同: +为了指导你了解每种优化手段的潜在影响,这里是上面详述的每个优化方法的关键点,虽然你的情况肯定大不相同: -- **反向代理服务器和负载均衡**。没有负载均衡或者负载均衡很差都会造成间断的极低性能。增加一个反向代理,比如NGINX可以避免web应用程序在内存和磁盘之间抖动。负载均衡可以将过载服务器的任务转移到空闲的服务器,还可以轻松的进行扩容。这些改变都可以产生巨大的性能提升,很容易就可以比你现在的实现方案的最差性能提高10倍,对于总体性能来说可能提高的不多,但是也是有实质性的提升。 -- **缓存动态和静态数据**。如果你又一个web 服务器负担过重,那么毫无疑问肯定是你的应用服务器,只通过缓存动态数据就可以在峰值时间提高10倍的性能。缓存静态文件可以提高个位数倍的性能。 -- **压缩数据**。使用媒体文件压缩格式,比如图像格式JPEG,图形格式PNG,视频格式MPEG-4,音乐文件格式MP3可以极大的提高性能。一旦这些都用上了,然后压缩文件数据可以提高初始页面加载速度提高两倍。 -- **优化SSL/TLS**。安全握手会对性能产生巨大的影响,对他们的优化可能会对初始响应特别是重文本站点产生2倍的提升。优化SSL/TLS 下媒体文件只会产生很小的性能提升。 -- **使用HTTP/2 和SPDY*。当你使用了SSL/TLS,这些协议就可以提高整个站点的性能。 -- **对linux 和web 服务器软件进行调优**。比如优化缓存机制,使用保活连接,分配时间敏感型任务到不同的线程池可以明显的提高性能;举个例子,线程池可以加速对磁盘敏感的任务[近一个数量级][49]. +- **反向代理服务器和负载均衡**。没有负载均衡或者负载均衡很差都会造成间歇的性能低谷。增加一个反向代理,比如 NGINX ,可以避免 web 应用程序在内存和磁盘之间波动。负载均衡可以将过载服务器的任务转移到空闲的服务器,还可以轻松的进行扩容。这些改变都可以产生巨大的性能提升,很容易就可以比你现在的实现方案的最差性能提高10倍,对于总体性能来说可能提高的不多,但是也是有实质性的提升。 +- **缓存动态和静态数据**。如果你有一个负担过重的 web 服务器,那么毫无疑问肯定是你的应用服务器,只通过缓存动态数据就可以在峰值时间提高10倍的性能。缓存静态文件可以提高几倍的性能。 +- **压缩数据**。使用媒体文件压缩格式,比如图像格式 JPEG,图形格式 PNG,视频格式 MPEG-4,音乐文件格式 MP3 可以极大的提高性能。一旦这些都用上了,然后压缩文件数据可以将初始页面加载速度提高两倍。 +- **优化 SSL/TLS**。安全握手会对性能产生巨大的影响,对它们的优化可能会对初始响应产生2倍的提升,特别是对于大量文本的站点。优化 SSL/TLS 下媒体文件只会产生很小的性能提升。 +- **使用 HTTP/2 和 SPDY*。当你使用了 SSL/TLS,这些协议就可以提高整个站点的性能。 +- **对 Linux 和 web 服务器软件进行调优**。比如优化缓存机制,使用保活连接,分配时间敏感型任务到不同的线程池可以明显的提高性能;举个例子,线程池可以加速对磁盘敏感的任务[近一个数量级][49]。 + +我们希望你亲自尝试这些技术。我们希望知道你说取得的各种性能提升案例。请在下面评论栏分享你的结果或者在标签 #NGINX 和 #webperf 下 tweet 你的故事。 -我们希望你亲自尝试这些技术。我们希望这些提高应用性能的手段可以被你实现。请在下面评论栏分享你的结果 或者在标签#NGINX 和#webperf 下tweet 你的故事。 ### 网上资源 ### [Statista.com – Share of the internet economy in the gross domestic product in G-20 countries in 2016][50] @@ -215,11 +214,11 @@ Linux 优化是转变们针对web 服务器方面的。以NGINX 为例,这里 -------------------------------------------------------------------------------- -via: https://www.nginx.com/blog/10-tips-for-10x-application-performance/?hmsr=toutiao.io&utm_medium=toutiao.io&utm_source=toutiao.io +via: https://www.nginx.com/blog/10-tips-for-10x-application-performance/ 作者:[Floyd Smith][a] -译者:[Ezio]](https://github.com/oska874) -校对:[校对者ID](https://github.com/校对者ID) +译者:[Ezio](https://github.com/oska874) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -233,11 +232,9 @@ via: https://www.nginx.com/blog/10-tips-for-10x-application-performance/?hmsr=to [7]:https://www.nginx.com/resources/admin-guide/load-balancer/ [8]:https://www.nginx.com/blog/load-balancing-with-nginx-plus/ [9]:https://www.digitalocean.com/community/tutorials/understanding-and-implementing-fastcgi-proxying-in-nginx -[10]:https://www.nginx.com/blog/five-reasons-use-software-load-balancer/ +[10]:https://www.nginx.com/resources/library/five-reasons-choose-software-load-balancer/ [11]:https://www.nginx.com/blog/load-balancing-with-nginx-plus/ -[12]:https://www.nginx.com/resources/ebook/five-reasons-choose-software-load-balancer/ -[13]:https://www.nginx.com/resources/webinars/choose-software-based-load-balancer-45-min/ -[14]:https://www.nginx.com/resources/admin-guide/load-balancer/ +[12]:https://www.nginx.com/resources/admin-guide/load-balancer// [15]:https://www.nginx.com/products/ [16]:https://www.nginx.com/blog/nginx-caching-guide/ [17]:https://www.nginx.com/products/content-caching-nginx-plus/ From f865c5da17df1f0c8fc47835e36d49b280b6dedf Mon Sep 17 00:00:00 2001 From: VicYu Date: Tue, 12 Apr 2016 10:23:31 +0800 Subject: [PATCH 0607/1469] Translated 20160226 How to use Python to hack your Eclipse IDE.md --- ... to use Python to hack your Eclipse IDE.md | 217 ------------------ ... to use Python to hack your Eclipse IDE.md | 215 +++++++++++++++++ 2 files changed, 215 insertions(+), 217 deletions(-) delete mode 100644 sources/tech/20160226 How to use Python to hack your Eclipse IDE.md create mode 100644 translated/tech/20160226 How to use Python to hack your Eclipse IDE.md diff --git a/sources/tech/20160226 How to use Python to hack your Eclipse IDE.md b/sources/tech/20160226 How to use Python to hack your Eclipse IDE.md deleted file mode 100644 index 9f1b1ed359..0000000000 --- a/sources/tech/20160226 How to use Python to hack your Eclipse IDE.md +++ /dev/null @@ -1,217 +0,0 @@ - Vic020 - -How to use Python to hack your Eclipse IDE -============================================== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/lightbulb_computer_person_general_.png?itok=ZY3UuQQa) - -The Eclipse Advanced Scripting Environment ([EASE][1]) project is a new but powerful set of plugins that enables you to quickly hack your Eclipse IDE. - -Eclipse is a powerful framework that can be extended in many different ways by using its built-in plugin mechanism. However, writing and deploying a new plugin can be cumbersome if all you want is a bit of additional functionality. Now, using EASE, there's a better way to do that, without having to write a single line of Java code. EASE provides a way to easily automate workbench functionality using scripting languages such as Python or Javascript. - -In this article, based on my [talk][2] at EclipseCon North America this year, I'll cover the basics of how to set up your Eclipse environment with Python and EASE and look at a few ideas to supercharge your IDE with the power of Python. - -### Setup and run "Hello World" - -The examples in this article are based on the Java-implementation of Python, Jython. You can install EASE directly into your existing Eclipse IDE. In this example we use Eclipse [Mars][3] and install EASE itself, its modules and the Jython engine. - -From within the Eclipse Install Dialog (`Help>Install New Software`...), install EASE: [http://download.eclipse.org/ease/update/nightly][4] - -And, select the following components: - -- EASE Core feature - -- EASE core UI feature - -- EASE Python Developer Resources - -- EASE modules (Incubation) - -This will give you EASE and its modules. The main one we are interested in is the Resource module that gives you access to the Eclipse workspace, projects, and files API. - -![](https://opensource.com/sites/default/files/1_installease_nightly.png) - - -After those have been successfully installed, next install the EASE Jython engine: [https://dl.bintray.com/pontesegger/ease-jython/][5]. Once the plugins are installed, test EASE out. Create a new project and add in a new file called hello.py with this content: - -``` -print "hello world" -``` - -Select the file, right click, and select 'Run as -> EASE script'. You should see "Hello World" appear in the console. - -Now you can start writing Python scripts that can access the workspace and projects. This power can be used for all sorts of hacks, below are just a few ideas. - -### Improve your code quality - -Maintaining good code quality can be a tiresome job especially when dealing with a large codebase or when lots of developers are involved. Some of this pain can be made easier with a script, such as for batch formatting for a set of files, or even fixing certain files to [remove unix line endings][6] for easy comparison in source control like git. Another nice thing to do is use a script to generate Eclipse markers to highlight code that could do with improving. Here's an example script that you could use to add task markers for all "printStackTrace" methods it detects in Java files. See the source code: [markers.py][7] - -To run, copy the file to your workspace, then right click and select 'Run as -> EASE script'. - -``` -loadModule('/System/Resources') -``` - -from org.eclipse.core.resources import IMarker - -``` -for ifile in findFiles("*.java"): - file_name = str(ifile.getLocation()) - print "Processing " + file_name - with open(file_name) as f: - for line_no, line in enumerate(f, start=1): - if "printStackTrace" in line: - marker = ifile.createMarker(IMarker.TASK) - marker.setAttribute(IMarker.TRANSIENT, True) - marker.setAttribute(IMarker.LINE_NUMBER, line_no) - marker.setAttribute(IMarker.MESSAGE, "Fix in Sprint 2: " + line.strip()) - -``` - -If you have any java files with printStackTraces you will be able to see the newly created markers in the Tasks view and in the editor margin. - -![](https://opensource.com/sites/default/files/2_codequality.png) - -### Automate tedious tasks - -When you are working with several projects you may want to automate some tedious, repetitive tasks. Perhaps you need to add in a copyright header to the beginning of each source file, or update source files when adopting a new framework. For instance, when we first switched to using Tycho and Maven, we had to add a pom.xml to each project. This is easily done using a few lines of Python. Then when Tycho provided support for pom-less builds, we wanted to remove unnecessary pom files. Again, a few lines of Python script enabled this. As an example, here is a script which adds a README.md file to every open project in your workspace, noting if they are Java or Python projects. See the source code: [add_readme.py][8]. - -To run, copy the file to your workspace, then right click and select 'Run as -> EASE script'. - -loadModule('/System/Resources') - -``` -for iproject in getWorkspace().getProjects(): - if not iproject.isOpen(): - continue - - ifile = iproject.getFile("README.md") - - if not ifile.exists(): - contents = "# " + iproject.getName() + "\n\n" - if iproject.hasNature("org.eclipse.jdt.core.javanature"): - contents += "A Java Project\n" - elif iproject.hasNature("org.python.pydev.pythonNature"): - contents += "A Python Project\n" - writeFile(ifile, contents) -``` - -The result should be that every open project will have a README.md file, with Java and Python projects having an additional descriptive line. - -![](https://opensource.com/sites/default/files/3_tedioustask.png) - -### Prototype new features - -You can also use a Python script to hack a quick-fix for some much wanted functionality, or as a prototype to help demonstrate to your team or users how you envision a feature. For instance, one feature Eclipse IDE doesn't currently support is auto-save on the current file you are working on. Although this feature is in the works for future releases, you can have a quick and dirty version that autosaves every 30 seconds or when the editor is deactivated. Below is a snippet of the main method. See the full source: [autosave.py][9] - -``` -def save_dirty_editors(): - workbench = getService(org.eclipse.ui.IWorkbench) - for window in workbench.getWorkbenchWindows(): - for page in window.getPages(): - for editor_ref in page.getEditorReferences(): - part = editor_ref.getPart(False) - if part and part.isDirty(): - print "Auto-Saving", part.getTitle() - part.doSave(None) -``` - -Before running this script you will need to turn on the 'Allow Scripts to run code in UI thread' setting by checking the box under Window > Preferences > Scripting. Then you can add the file to your workspace, right click on it and select 'Run As>EASE Script'. A save message is printed out in the Console view every time an editor is saved. To turn off the autosave just stop the script by pressing the 'Terminate' red square button in the Console view. - -![](https://opensource.com/sites/default/files/4_prototype.png) - -### Quickly extend the user interface with custom buttons, menus, etc - -One of the best things about EASE is that it allows you to take your scripts and quickly hook them into UI elements of the IDE, for example, as a new button or new menu item. No need to write Java or have a new plugin, just add a couple of lines to your script header—it's that simple. - -Here's an example for a simplistic script that creates us three new projects. - -``` -# name : Create fruit projects -# toolbar : Project Explorer -# description : Create fruit projects - -loadModule("/System/Resources") - -for name in ["banana", "pineapple", "mango"]: - createProject(name) -``` - -The comment lines specify to EASE to add a button to the Project Explorer toolbar. Here's another script that adds a button to the same toolbar to delete those three projects. See the source files: [createProjects.py][10] and [deleteProjects.py][11] - -``` -# name :Delete fruit projects -# toolbar : Project Explorer -# description : Get rid of the fruit projects - -loadModule("/System/Resources") - -for name in ["banana", "pineapple", "mango"]: - project = getProject(name) - project.delete(0, None) -``` - -To get the buttons to appear, add the two script files to a new project—let's call it 'ScriptsProject'. Then go to Windows > Preference > Scripting > Script Locations. Click on the 'Add Workspace' button and select the ScriptsProject. This project now becomes a default location for locating script files. You should see the buttons show up in the Project Explorer without needing to restart your IDE. You should be able to quickly create and delete the projects using your newly added buttons. - -![](https://opensource.com/sites/default/files/5_buttons.png) - -### Integrate with third-party tools - -Every now and then you may need to use a tool outside the Eclipse ecosystem (sad but true, it has a lot but it does not do everything). For those occasions it might be quite handy to wrap calling that call to the tool in a script. Here's an example that allows you to integrate with explorer.exe, and add it to the content menu so you could instantly open a file browser using the current selection. See the source code: [explorer.py][12] - -``` -# name : Explore from here -# popup : enableFor(org.eclipse.core.resources.IResource) -# description : Start a file browser using current selection -loadModule("/System/Platform") -loadModule('/System/UI') - -selection = getSelection() -if isinstance(selection, org.eclipse.jface.viewers.IStructuredSelection): - selection = selection.getFirstElement() - -if not isinstance(selection, org.eclipse.core.resources.IResource): - selection = adapt(selection, org.eclipse.core.resources.IResource) - -if isinstance(selection, org.eclipse.core.resources.IFile): - selection = selection.getParent() - -if isinstance(selection, org.eclipse.core.resources.IContainer): - runProcess("explorer.exe", [selection.getLocation().toFile().toString()]) -``` - -To get the menu to appear, add the script to a new project—let's call it 'ScriptsProject'. Then go to Windows > Preference > Scripting > Script Locations. Click on the 'Add Workspace' button and select the ScriptsProject. You should see the new menu item show up in the context menu when you right-click on a file. Select this action to bring up a file browser. (Note this functionality already exists in Eclipse but this example is one you could adapt to other third-party tools). - -![](https://opensource.com/sites/default/files/6_explorer.png) - -The Eclipse Advanced Scripting Environment provides a great way to get more out of your Eclipse IDE by leveraging the power of Python. It is a project in its infancy so there is so much more to come. Learn more [about the project][13] and get involved by signing up for the [forum][14]. - -I'll be talking more about EASE at [Eclipsecon North America][15] 2016. My talk [Scripting Eclipse with Python][16] will go into how you can use not just Jython, but C-Python and how this functionality can be extended specifically for scientific use-cases. - --------------------------------------------------------------------------------- - -via: https://opensource.com/life/16/2/how-use-python-hack-your-ide - -作者:[Tracy Miranda][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/tracymiranda -[1]: https://eclipse.org/ease/ -[2]: https://www.eclipsecon.org/na2016/session/scripting-eclipse-python -[3]: https://www.eclipse.org/downloads/packages/eclipse-ide-eclipse-committers-451/mars1 -[4]: http://download.eclipse.org/ease/update/nightly -[5]: https://dl.bintray.com/pontesegger/ease-jython/ -[6]: http://code.activestate.com/recipes/66434-change-line-endings/ -[7]: https://gist.github.com/tracymiranda/6556482e278c9afc421d -[8]: https://gist.github.com/tracymiranda/f20f233b40f1f79b1df2 -[9]: https://gist.github.com/tracymiranda/e9588d0976c46a987463 -[10]: https://gist.github.com/tracymiranda/55995daaea9a4db584dc -[11]: https://gist.github.com/tracymiranda/baa218fc2c1a8e898194 -[12]: https://gist.github.com/tracymiranda/8aa3f0fc4bf44f4a5cd3 -[13]: https://eclipse.org/ease/ -[14]: https://dev.eclipse.org/mailman/listinfo/ease-dev -[15]: https://www.eclipsecon.org/na2016 -[16]: https://www.eclipsecon.org/na2016/session/scripting-eclipse-python diff --git a/translated/tech/20160226 How to use Python to hack your Eclipse IDE.md b/translated/tech/20160226 How to use Python to hack your Eclipse IDE.md new file mode 100644 index 0000000000..1bf132fe15 --- /dev/null +++ b/translated/tech/20160226 How to use Python to hack your Eclipse IDE.md @@ -0,0 +1,215 @@ +用Python打造你的Eclipse +============================================== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/lightbulb_computer_person_general_.png?itok=ZY3UuQQa) + +Eclipse高级脚本环境([EASE][1])项目虽然还在开发中,但是不是不得承认它非常强大,让我们可以快速打造自己的Eclipse开发环境. + +依据Eclipse强大的框架,可以通过其内建的插件系统全方面的扩展Eclipse.然而,编写和部署一个新的插件还是十分笨重,即使只是需要一个额外的小功能。但是,现在依托EASE,可以方便实用Python或者Javascript脚本语言来扩展。 + +本文中,根据我在今年北美的EclipseCon大会上的[演讲][2],我介绍包括安装Eclipse的Python和EASE环境,并包括使用强力Python来增压你的IDE。 + +### 安装并运行 "Hello World" + +本文中的例子使用Java实现的Python解释,Jython。Eclipse可以直接安装EASE环境。本例中使用Eclipse[Mars][3],它已经自带了EASE环境,包和Jython引擎。 + +使用Eclipse安装对话框(`Help>Install New Software`...),安装EASE[http://download.eclipse.org/ease/update/nightly][4] + +选择下列组件: + +- EASE Core feature + +- EASE core UI feature + +- EASE Python Developer Resources + +- EASE modules (Incubation) + +包括了EASE和模组。但是我们比较关心Resource包,此包可以访问Eclipse工作空间,项目和文件API。 + +![](https://opensource.com/sites/default/files/1_installease_nightly.png) + + +成功安装后,接下来安装Jython引擎[https://dl.bintray.com/pontesegger/ease-jython/][5].完成后,测试下。新建一个项目并新建一个hello.py文件,输入: + +``` +print "hello world" +``` + +选中这个文件,右击,选中'Run as -> EASE script'.这样就可以在控制台看到"Hello world"的输出. + +配置完成,现在就可以轻松使用Python来控制工作空间和项目了. + +### 提升你的代码质量 + +管理良好的代码质量本身是一件非常烦恼的事情,尤其是当需要处理一个大量代码库和要许多工程师参与的时候.而这些痛苦可以通过脚本来减轻,比如大量文字排版,或者[去掉文件中的unix行结束符][6]来使更容易比较.其他很棒的事情包括使用脚本让Eclipse markers高亮代码.这里有一些例子,你可以加入到task markers ,用"printStackTrace"方法在java文件中探测.请看[源码][7] + +运行,拷贝文件到工作空间,右击运行. + +``` +loadModule('/System/Resources') +``` + +from org.eclipse.core.resources import IMarker + +``` +for ifile in findFiles("*.java"): + file_name = str(ifile.getLocation()) + print "Processing " + file_name + with open(file_name) as f: + for line_no, line in enumerate(f, start=1): + if "printStackTrace" in line: + marker = ifile.createMarker(IMarker.TASK) + marker.setAttribute(IMarker.TRANSIENT, True) + marker.setAttribute(IMarker.LINE_NUMBER, line_no) + marker.setAttribute(IMarker.MESSAGE, "Fix in Sprint 2: " + line.strip()) + +``` + +如果你的任何java文件中包含了printStackTraces,你就可以看见编辑器的侧边栏上自动加上的标记. + +![](https://opensource.com/sites/default/files/2_codequality.png) + +### 自动构建繁琐任务 + +当同时工作在多个项目的时候,肯定需要需要完成许多繁杂,重复的任务.可能你需要在所有源文件头上加入CopyRight, 或者采用新框架时候自动更新文件.例如,当从Tycho迁移到Maven时候,我们给每一个项目必须添加pom.xml文件.使用Python可以很轻松的完成这个任务.只从Tycho提供无pom构建后,我们也需要移除不要的pom文件.同样,只需要几行代码就可以完成这个任务.例如,这里有个脚本可以在每一个打开的工作空间项目上加入README.md.请看源代码[add_readme.py][8]. + +拷贝文件到工作空间,右击并选择"Run as -> EASE script" + +loadModule('/System/Resources') + +``` +for iproject in getWorkspace().getProjects(): + if not iproject.isOpen(): + continue + + ifile = iproject.getFile("README.md") + + if not ifile.exists(): + contents = "# " + iproject.getName() + "\n\n" + if iproject.hasNature("org.eclipse.jdt.core.javanature"): + contents += "A Java Project\n" + elif iproject.hasNature("org.python.pydev.pythonNature"): + contents += "A Python Project\n" + writeFile(ifile, contents) +``` + +脚本结果会在打开的项目中加入README.md,java和Python项目还会自动加上一行描述. + +![](https://opensource.com/sites/default/files/3_tedioustask.png) + +### 构建新功能 + +Python脚本可以快速构建一些需要的附加功能,或者给团队和用户快速构建demo.例如,一个现在Eclipse目前不支持的功能,自动保存工作的文件.即使这个功能将会很快提供,但是你现在就可以马上拥有一个能30秒自动保存的编辑器.以下是主方法的片段.请看下列代码:[autosave.py][9] + +``` +def save_dirty_editors(): + workbench = getService(org.eclipse.ui.IWorkbench) + for window in workbench.getWorkbenchWindows(): + for page in window.getPages(): + for editor_ref in page.getEditorReferences(): + part = editor_ref.getPart(False) + if part and part.isDirty(): + print "Auto-Saving", part.getTitle() + part.doSave(None) +``` + +在运行脚本之前,你需要勾选'Allow Scripts to run code in UI thread'设定,这个设定在Window > Preferences > Scripting中.然后添加脚本到工作空间,右击和选择"Run as > EASE Script".每10秒自动保存的信息就会在控制台输出.关掉自动保存脚本,只需要在点击控制台的红色方框. + +![](https://opensource.com/sites/default/files/4_prototype.png) + +### 快速扩展用户界面 + +EASE最棒的事情是可以通过脚本与UI元素挂钩,可以调整你的IDE,例如,在菜单中新建一个按钮.不需要编写java代码或者新的插件,只需要增加几行代码. + +下面是一个简单的基脚本示例,用来产生三个新项目. + +``` +# name : Create fruit projects +# toolbar : Project Explorer +# description : Create fruit projects + +loadModule("/System/Resources") + +for name in ["banana", "pineapple", "mango"]: + createProject(name) +``` + +上述特别的EASE增加了一个按钮到项目浏览工具条.下面这个脚本是用来删除这三个项目.请看源码[createProjects.py][10]和[deleteProjects.py][11]. + +``` +# name :Delete fruit projects +# toolbar : Project Explorer +# description : Get rid of the fruit projects + +loadModule("/System/Resources") + +for name in ["banana", "pineapple", "mango"]: + project = getProject(name) + project.delete(0, None) +``` + +为了使脚本启动生效按钮,增加脚本到'ScriptsProject'文件夹.然后选择Windows > Preference > Scripting > Script 中定位到文件夹.点击'Add Workspace'按钮和选择ScriptProject项目.这个项目现在将会在启动时默认加载.你可以发现Project Explorer上出现了这两个按钮,这样你就可以通过这两个按钮快速增加删除项目. + +![](https://opensource.com/sites/default/files/5_buttons.png) + +### 整合三方工具 + +无论何时,你可能需要除了Eclipse生态系统以外的工具.这些时候你会发将他们包装在一个脚本来调用会非常方便.这里有一个简单的例子让你整合explorer.exe,并加入它到右键菜单栏,这样点击图标就可以打开浏览器浏览当前文件.请看源码[explorer.py][12] + +``` +# name : Explore from here +# popup : enableFor(org.eclipse.core.resources.IResource) +# description : Start a file browser using current selection +loadModule("/System/Platform") +loadModule('/System/UI') + +selection = getSelection() +if isinstance(selection, org.eclipse.jface.viewers.IStructuredSelection): + selection = selection.getFirstElement() + +if not isinstance(selection, org.eclipse.core.resources.IResource): + selection = adapt(selection, org.eclipse.core.resources.IResource) + +if isinstance(selection, org.eclipse.core.resources.IFile): + selection = selection.getParent() + +if isinstance(selection, org.eclipse.core.resources.IContainer): + runProcess("explorer.exe", [selection.getLocation().toFile().toString()]) +``` + +为了让菜单显示增加,像之前一样加入'ScriptProject'.在文件上右击,你看弹出菜单是不是出现了图标.选择Explore from here. + +![](https://opensource.com/sites/default/files/6_explorer.png) + +Eclipse高级基本环境提供一套很棒的扩展功能,使得Eclipse IDE能使用Python来轻易扩展.虽然这个项目还在婴儿期,但是[关于这个项目][13]更多更棒的功能也正在加紧开发中,如果你想为这个贡献,请到[论坛][14]讨论. + +2016年[Eclipsecon North America][15]会议将会发布更多EASE细节.我的演讲[Scripting Eclipse with Python][16]也会不单介绍Jython,也包括C-Python和其他功能性扩展的实战例子. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/16/2/how-use-python-hack-your-ide + +作者:[Tracy Miranda][a] +译者:[VicYu/Vic020](http://vicyu.net) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/tracymiranda +[1]: https://eclipse.org/ease/ +[2]: https://www.eclipsecon.org/na2016/session/scripting-eclipse-python +[3]: https://www.eclipse.org/downloads/packages/eclipse-ide-eclipse-committers-451/mars1 +[4]: http://download.eclipse.org/ease/update/nightly +[5]: https://dl.bintray.com/pontesegger/ease-jython/ +[6]: http://code.activestate.com/recipes/66434-change-line-endings/ +[7]: https://gist.github.com/tracymiranda/6556482e278c9afc421d +[8]: https://gist.github.com/tracymiranda/f20f233b40f1f79b1df2 +[9]: https://gist.github.com/tracymiranda/e9588d0976c46a987463 +[10]: https://gist.github.com/tracymiranda/55995daaea9a4db584dc +[11]: https://gist.github.com/tracymiranda/baa218fc2c1a8e898194 +[12]: https://gist.github.com/tracymiranda/8aa3f0fc4bf44f4a5cd3 +[13]: https://eclipse.org/ease/ +[14]: https://dev.eclipse.org/mailman/listinfo/ease-dev +[15]: https://www.eclipsecon.org/na2016 +[16]: https://www.eclipsecon.org/na2016/session/scripting-eclipse-python From ce273b97cd834b8e9ef48cc9f9300c541f85a226 Mon Sep 17 00:00:00 2001 From: willowyoung <1079902707@qq.com> Date: Tue, 12 Apr 2016 13:34:53 +0800 Subject: [PATCH 0608/1469] Translating by willowyoung --- ...ocessing at NASA with open source tools.md | 1 + ...Installed Help Documentations and Tools.md | 180 ----------------- ...leshoot Grand Unified Bootloader (GRUB).md | 185 ------------------ 3 files changed, 1 insertion(+), 365 deletions(-) delete mode 100644 sources/tech/LFCS/Part 12 - LFCS: How to Explore Linux with Installed Help Documentations and Tools.md delete mode 100644 sources/tech/LFCS/Part 13 - LFCS: How to Configure and Troubleshoot Grand Unified Bootloader (GRUB).md diff --git a/sources/tech/20160304 Image processing at NASA with open source tools.md b/sources/tech/20160304 Image processing at NASA with open source tools.md index 7bf6d8297d..4833b7bf93 100644 --- a/sources/tech/20160304 Image processing at NASA with open source tools.md +++ b/sources/tech/20160304 Image processing at NASA with open source tools.md @@ -1,3 +1,4 @@ +Translating By willowyoung Image processing at NASA with open source tools ======================================================= diff --git a/sources/tech/LFCS/Part 12 - LFCS: How to Explore Linux with Installed Help Documentations and Tools.md b/sources/tech/LFCS/Part 12 - LFCS: How to Explore Linux with Installed Help Documentations and Tools.md deleted file mode 100644 index 45ccb57f95..0000000000 --- a/sources/tech/LFCS/Part 12 - LFCS: How to Explore Linux with Installed Help Documentations and Tools.md +++ /dev/null @@ -1,180 +0,0 @@ -Part 12 - LFCS: How to Explore Linux with Installed Help Documentations and Tools -================================================================================== - -Because of the changes in the LFCS exam requirements effective Feb. 2, 2016, we are adding the necessary topics to the [LFCS series][1] published here. To prepare for this exam, your are highly encouraged to use the [LFCE series][2] as well. - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Explore-Linux-with-Documentation-and-Tools.png) ->LFCS: Explore Linux with Installed Documentations and Tools – Part 12 - -Once you get used to working with the command line and feel comfortable doing so, you realize that a regular Linux installation includes all the documentation you need to use and configure the system. - -Another good reason to become familiar with command line help tools is that in the [LFCS][3] and [LFCE][4] exams, those are the only sources of information you can use – no internet browsing and no googling. It’s just you and the command line. - -For that reason, in this article we will give you some tips to effectively use the installed docs and tools in order to prepare to pass the **Linux Foundation Certification** exams. - -### Linux Man Pages - -A man page, short for manual page, is nothing less and nothing more than what the word suggests: a manual for a given tool. It contains the list of options (with explanation) that the command supports, and some man pages even include usage examples as well. - -To open a man page, use the **man command** followed by the name of the tool you want to learn more about. For example: - -``` -# man diff -``` - -will open the manual page for `diff`, a tool used to compare text files line by line (to exit, simply hit the q key.). - -Let’s say we want to compare two text files named `file1` and `file2` in Linux. These files contain the list of packages that are installed in two Linux boxes with the same distribution and version. - -Doing a `diff` between `file1` and `file2` will tell us if there is a difference between those lists: - -``` -# diff file1 file2 -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Compare-Two-Text-Files-in-Linux.png) ->Compare Two Text Files in Linux - -where the `<` sign indicates lines missing in `file2`. If there were lines missing in `file1`, they would be indicated by the `>` sign instead. - -On the other hand, **7d6** means line **#7** in file should be deleted in order to match `file2` (same with **24d22** and **41d38**), and 65,67d61 tells us we need to remove lines **65** through **67** in file one. If we make these corrections, both files will then be identical. - -Alternatively, you can display both files side by side using the `-y` option, according to the man page. You may find this helpful to more easily identify missing lines in files: - -``` -# diff -y file1 file2 -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Compare-and-List-Difference-of-Two-Files.png) ->Compare and List Difference of Two Files - -Also, you can use `diff` to compare two binary files. If they are identical, `diff` will exit silently without output. Otherwise, it will return the following message: “**Binary files X and Y differ**”. - -### The –help Option - -The `--help` option, available in many (if not all) commands, can be considered a short manual page for that specific command. Although it does not provide a comprehensive description of the tool, it is an easy way to obtain information on the usage of a program and a list of its available options at a quick glance. - -For example, - -``` -# sed --help -``` - -shows the usage of each option available in sed (the stream editor). - -One of the classic examples of using `sed` consists of replacing characters in files. Using the `-i` option (described as “**edit files in place**”), you can edit a file without opening it. If you want to make a backup of the original contents as well, use the `-i` option followed by a SUFFIX to create a separate file with the original contents. - -For example, to replace each occurrence of the word `Lorem` with `Tecmint` (case insensitive) in `lorem.txt` and create a new file with the original contents of the file, do: - -``` -# less lorem.txt | grep -i lorem -# sed -i.orig 's/Lorem/Tecmint/gI' lorem.txt -# less lorem.txt | grep -i lorem -# less lorem.txt.orig | grep -i lorem -``` - -Please note that every occurrence of `Lorem` has been replaced with `Tecmint` in `lorem.txt`, and the original contents of `lorem.txt` has been saved to `lorem.txt.orig`. - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Replace-A-String-in-File.png) ->Replace A String in Files - -### Installed Documentation in /usr/share/doc - -This is probably my favorite pick. If you go to `/usr/share/doc` and do a directory listing, you will see lots of directories with the names of the installed tools in your Linux system. - -According to the [Filesystem Hierarchy Standard][5], these directories contain useful information that might not be in the man pages, along with templates and configuration files to make configuration easier. - -For example, let’s consider `squid-3.3.8` (version may vary from distribution to distribution) for the popular HTTP proxy and [squid cache server][6]. - -Let’s `cd` into that directory: - -``` -# cd /usr/share/doc/squid-3.3.8 -``` - -and do a directory listing: - -``` -# ls -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/03/List-Files-in-Linux.png) ->Linux Directory Listing with ls Command - -You may want to pay special attention to `QUICKSTART` and `squid.conf.documented`. These files contain an extensive documentation about Squid and a heavily commented configuration file, respectively. For other packages, the exact names may differ (as **QuickRef** or **00QUICKSTART**, for example), but the principle is the same. - -Other packages, such as the Apache web server, provide configuration file templates inside `/usr/share/doc`, that will be helpful when you have to configure a standalone server or a virtual host, to name a few cases. - -### GNU info Documentation - -You can think of info documents as man pages on steroids. As such, they not only provide help for a specific tool, but also they do so with hyperlinks (yes, hyperlinks in the command line!) that allow you to navigate from a section to another using the arrow keys and Enter to confirm. - -Perhaps the most illustrative example is: - -``` -# info coreutils -``` - -Since coreutils contains the [basic file, shell and text manipulation utilities][7] which are expected to exist on every operating system, you can reasonably expect a detailed description for each one of those categories in info **coreutils**. - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Info-Coreutils.png) ->Info Coreutils - -As it is the case with man pages, you can exit an info document by pressing the `q` key. - -Additionally, GNU info can be used to display regular man pages as well when followed by the tool name. For example: - -``` -# info tune2fs -``` - -will return the man page of **tune2fs**, the ext2/3/4 filesystems management tool. - -And now that we’re at it, let’s review some of the uses of **tune2fs**: - -Display information about the filesystem on top of **/dev/mapper/vg00-vol_backups**: - -``` -# tune2fs -l /dev/mapper/vg00-vol_backups -``` - -Set a filesystem volume name (Backups in this case): - -``` -# tune2fs -L Backups /dev/mapper/vg00-vol_backups -``` - -Change the check intervals and `/` or mount counts (use the `-c` option to set a number of mount counts and `/` or the `-i` option to set a check interval, where **d=days, w=weeks, and m=months**). - -``` -# tune2fs -c 150 /dev/mapper/vg00-vol_backups # Check every 150 mounts -# tune2fs -i 6w /dev/mapper/vg00-vol_backups # Check every 6 weeks -``` - -All of the above options can be listed with the `--help` option, or viewed in the man page. - -### Summary - -Regardless of the method that you choose to invoke help for a given tool, knowing that they exist and how to use them will certainly come in handy in the exam. Do you know of any other tools that can be used to look up documentation? Feel free to share with the Tecmint community using the form below. - -Questions and other comments are more than welcome as well. - --------------------------------------------------------------------------------- - -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/installing-network-services-and-configuring-services-at-system-boot/ -[3]: http://www.tecmint.com/sed-command-to-create-edit-and-manipulate-files-in-linux/ -[4]: http://www.tecmint.com/installing-network-services-and-configuring-services-at-system-boot/ -[5]: http://www.tecmint.com/linux-directory-structure-and-important-files-paths-explained/ -[6]: http://www.tecmint.com/configure-squid-server-in-linux/ -[7]: http://www.tecmint.com/sed-command-to-create-edit-and-manipulate-files-in-linux/ -[8]: diff --git a/sources/tech/LFCS/Part 13 - LFCS: How to Configure and Troubleshoot Grand Unified Bootloader (GRUB).md b/sources/tech/LFCS/Part 13 - LFCS: How to Configure and Troubleshoot Grand Unified Bootloader (GRUB).md deleted file mode 100644 index cf24c51b58..0000000000 --- a/sources/tech/LFCS/Part 13 - LFCS: How to Configure and Troubleshoot Grand Unified Bootloader (GRUB).md +++ /dev/null @@ -1,185 +0,0 @@ -Part 13 - LFCS: How to Configure and Troubleshoot Grand Unified Bootloader (GRUB) -===================================================================================== - -Because of the changes in the LFCS exam requirements effective Feb. 2, 2016, we are adding the necessary topics to the [LFCS series][1] published here. To prepare for this exam, your are highly encouraged to use the [LFCE series][2] as well. - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Configure-Troubleshoot-Grub-Boot-Loader.png) ->LFCS: Configure and Troubleshoot Grub Boot Loader – Part 13 - -In this article we will introduce you to GRUB and explain why a boot loader is necessary, and how it adds versatility to the system. - -The [Linux boot process][3] from the time you press the power button of your computer until you get a fully-functional system follows this high-level sequence: - -* 1. A process known as **POST** (**Power-On Self Test**) performs an overall check on the hardware components of your computer. -* 2. When **POST** completes, it passes the control over to the boot loader, which in turn loads the Linux kernel in memory (along with **initramfs**) and executes it. The most used boot loader in Linux is the **GRand Unified Boot loader**, or **GRUB** for short. -* 3. The kernel checks and accesses the hardware, and then runs the initial process (mostly known by its generic name “**init**”) which in turn completes the system boot by starting services. - -In Part 7 of this series (“[SysVinit, Upstart, and Systemd][4]”) we introduced the [service management systems and tools][5] used by modern Linux distributions. You may want to review that article before proceeding further. - -### Introducing GRUB Boot Loader - -Two major **GRUB** versions (**v1** sometimes called **GRUB Legacy** and **v2**) can be found in modern systems, although most distributions use **v2** by default in their latest versions. Only **Red Hat Enterprise Linux 6** and its derivatives still use **v1** today. - -Thus, we will focus primarily on the features of **v2** in this guide. - -Regardless of the **GRUB** version, a boot loader allows the user to: - -* 1). modify the way the system behaves by specifying different kernels to use, -* 2). choose between alternate operating systems to boot, and -* 3). add or edit configuration stanzas to change boot options, among other things. - -Today, **GRUB** is maintained by the **GNU** project and is well documented in their website. You are encouraged to use the [GNU official documentation][6] while going through this guide. - -When the system boots you are presented with the following **GRUB** screen in the main console. Initially, you are prompted to choose between alternate kernels (by default, the system will boot using the latest kernel) and are allowed to enter a **GRUB** command line (with `c`) or edit the boot options (by pressing the `e` key). - -![](http://www.tecmint.com/wp-content/uploads/2016/03/GRUB-Boot-Screen.png) ->GRUB Boot Screen - -One of the reasons why you would consider booting with an older kernel is a hardware device that used to work properly and has started “acting up” after an upgrade (refer to [this link][7] in the AskUbuntu forums for an example). - -The **GRUB v2** configuration is read on boot from `/boot/grub/grub.cfg` or `/boot/grub2/grub.cfg`, whereas `/boot/grub/grub.conf` or `/boot/grub/menu.lst` are used in **v1**. These files are NOT to be edited by hand, but are modified based on the contents of `/etc/default/grub` and the files found inside `/etc/grub.d`. - -In a **CentOS 7**, here’s the configuration file that is created when the system is first installed: - -``` -GRUB_TIMEOUT=5 -GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)" -GRUB_DEFAULT=saved -GRUB_DISABLE_SUBMENU=true -GRUB_TERMINAL_OUTPUT="console" -GRUB_CMDLINE_LINUX="vconsole.keymap=la-latin1 rd.lvm.lv=centos_centos7-2/swap crashkernel=auto vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos_centos7-2/root rhgb quiet" -GRUB_DISABLE_RECOVERY="true" -``` - -In addition to the online documentation, you can also find the GNU GRUB manual using info as follows: - -``` -# info grub -``` - -If you’re interested specifically in the options available for /etc/default/grub, you can invoke the configuration section directly: - -``` -# info -f grub -n 'Simple configuration' -``` - -Using the command above you will find out that `GRUB_TIMEOUT` sets the time between the moment when the initial screen appears and the system automatic booting begins unless interrupted by the user. When this variable is set to `-1`, boot will not be started until the user makes a selection. - -When multiple operating systems or kernels are installed in the same machine, `GRUB_DEFAULT` requires an integer value that indicates which OS or kernel entry in the GRUB initial screen should be selected to boot by default. The list of entries can be viewed not only in the splash screen shown above, but also using the following command: - -### In CentOS and openSUSE: - -``` -# awk -F\' '$1=="menuentry " {print $2}' /boot/grub2/grub.cfg -``` - -### In Ubuntu: - -``` -# awk -F\' '$1=="menuentry " {print $2}' /boot/grub/grub.cfg -``` - -In the example shown in the below image, if we wish to boot with the kernel version **3.10.0-123.el7.x86_64** (4th entry), we need to set `GRUB_DEFAULT` to `3` (entries are internally numbered beginning with zero) as follows: - -``` -GRUB_DEFAULT=3 -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Boot-System-with-Old-Kernel-Version.png) ->Boot System with Old Kernel Version - -One final GRUB configuration variable that is of special interest is `GRUB_CMDLINE_LINUX`, which is used to pass options to the kernel. The options that can be passed through GRUB to the kernel are well documented in the [Kernel Parameters file][8] and in [man 7 bootparam][9]. - -Current options in my **CentOS 7** server are: - -``` -GRUB_CMDLINE_LINUX="vconsole.keymap=la-latin1 rd.lvm.lv=centos_centos7-2/swap crashkernel=auto vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos_centos7-2/root rhgb quiet" -``` - -Why would you want to modify the default kernel parameters or pass extra options? In simple terms, there may be times when you need to tell the kernel certain hardware parameters that it may not be able to determine on its own, or to override the values that it would detect. - -This happened to me not too long ago when I tried **Vector Linux**, a derivative of **Slackware**, on my 10-year old laptop. After installation it did not detect the right settings for my video card so I had to modify the kernel options passed through GRUB in order to make it work. - -Another example is when you need to bring the system to single-user mode to perform maintenance tasks. You can do this by appending the word single to `GRUB_CMDLINE_LINUX` and rebooting: - -``` -GRUB_CMDLINE_LINUX="vconsole.keymap=la-latin1 rd.lvm.lv=centos_centos7-2/swap crashkernel=auto vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos_centos7-2/root rhgb quiet single" -``` - -After editing `/etc/defalt/grub`, you will need to run `update-grub` (Ubuntu) or `grub2-mkconfig -o /boot/grub2/grub.cfg` (**CentOS** and **openSUSE**) afterwards to update `grub.cfg` (otherwise, changes will be lost upon boot). - -This command will process the boot configuration files mentioned earlier to update `grub.cfg`. This method ensures changes are permanent, while options passed through GRUB at boot time will only last during the current session. - -### Fixing Linux GRUB Issues - -If you install a second operating system or if your GRUB configuration file gets corrupted due to human error, there are ways you can get your system back on its feet and be able to boot again. - -In the initial screen, press `c` to get a GRUB command line (remember that you can also press `e` to edit the default boot options), and use help to bring the available commands in the GRUB prompt: - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Fix-Grub-Issues-in-Linux.png) ->Fix Grub Configuration Issues in Linux - -We will focus on **ls**, which will list the installed devices and filesystems, and we will examine what it finds. In the image below we can see that there are 4 hard drives (`hd0` through `hd3`). - -Only `hd0` seems to have been partitioned (as evidenced by msdos1 and msdos2, where 1 and 2 are the partition numbers and msdos is the partitioning scheme). - -Let’s now examine the first partition on `hd0` (**msdos1**) to see if we can find GRUB there. This approach will allow us to boot Linux and there use other high level tools to repair the configuration file or reinstall GRUB altogether if it is needed: - -``` -# ls (hd0,msdos1)/ -``` - -As we can see in the highlighted area, we found the `grub2` directory in this partition: - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Find-Grub-Configuration.png) ->Find Grub Configuration - -Once we are sure that GRUB resides in (**hd0,msdos1**), let’s tell GRUB where to find its configuration file and then instruct it to attempt to launch its menu: - -``` -set prefix=(hd0,msdos1)/grub2 -set root=(hd0,msdos1) -insmod normal -normal -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Find-and-Launch-Grub-Menu.png) ->Find and Launch Grub Menu - -Then in the GRUB menu, choose an entry and press **Enter** to boot using it. Once the system has booted you can issue the `grub2-install /dev/sdX` command (change `sdX` with the device you want to install GRUB on). The boot information will then be updated and all related files be restored. - -``` -# grub2-install /dev/sdX -``` - -Other more complex scenarios are documented, along with their suggested fixes, in the [Ubuntu GRUB2 Troubleshooting guide][10]. The concepts explained there are valid for other distributions as well. - -### Summary - -In this article we have introduced you to GRUB, indicated where you can find documentation both online and offline, and explained how to approach an scenario where a system has stopped booting properly due to a bootloader-related issue. - -Fortunately, GRUB is one of the tools that is best documented and you can easily find help either in the installed docs or online using the resources we have shared in this article. - -Do you have questions or comments? Don’t hesitate to let us know using the comment form below. We look forward to hearing from you! - --------------------------------------------------------------------------------- - -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/installing-network-services-and-configuring-services-at-system-boot/ -[3]: http://www.tecmint.com/linux-boot-process/ -[4]: http://www.tecmint.com/linux-boot-process-and-manage-services/ -[5]: http://www.tecmint.com/best-linux-log-monitoring-and-management-tools/ -[6]: http://www.gnu.org/software/grub/manual/ -[7]: http://askubuntu.com/questions/82140/how-can-i-boot-with-an-older-kernel-version -[8]: https://www.kernel.org/doc/Documentation/kernel-parameters.txt -[9]: http://man7.org/linux/man-pages/man7/bootparam.7.html -[10]: https://help.ubuntu.com/community/Grub2/Troubleshooting From 0e78d951d0d2d27d03dc4fdd6f9dee397aeae69c Mon Sep 17 00:00:00 2001 From: Zhengyu_Li Date: Tue, 12 Apr 2016 17:56:11 +0800 Subject: [PATCH 0609/1469] Delete 20160218 A Linux-powered microwave oven.md --- ...20160218 A Linux-powered microwave oven.md | 51 ------------------- 1 file changed, 51 deletions(-) delete mode 100644 sources/tech/20160218 A Linux-powered microwave oven.md diff --git a/sources/tech/20160218 A Linux-powered microwave oven.md b/sources/tech/20160218 A Linux-powered microwave oven.md deleted file mode 100644 index 47db1ae9d6..0000000000 --- a/sources/tech/20160218 A Linux-powered microwave oven.md +++ /dev/null @@ -1,51 +0,0 @@ -translating by yuba0604 -A Linux-powered microwave oven -================================================================================ - -Scratching an itch is a recurring theme in presentations at [linux.conf.au](http://linux.conf.au/). As the open-hardware movement gains strength, more and more of these itches relate to the physical world, not just the digital. David Tulloh used his [presentation [WebM]](http://mirror.linux.org.au/linux.conf.au/2016/04_Thursday/D4.303_Costa_Theatre/Linux_driven_microwave.webm) on the “Linux Driven Microwave” to discuss how annoying microwave ovens can be and to describe his project to build something less irritating. - -Tulloh's story began when he obtained a microwave oven, admittedly an inexpensive one, with a user interface even worse than the norm. Setting the time required pressing buttons so hard that the microwave tended to get pushed away — a fact that was elegantly balanced by the door handle requiring a sufficiently hard tug to return the oven to its original position. While this is clearly an extreme case, Tulloh lamented that microwave ovens really hadn't improved noticeably in recent decades. They may have gotten a little cheaper and gained a few features that few people could use without poring over the instruction manual — the implied contrast to smartphones, which are widely used with little instruction, was clear. - -This microwave oven was not a lost cause — it gave its life to the greater good and became the prototype for an idea that Tulloh hopes to turn into a crowd-funded project if he can find the right match between features and demand: a Linux-driven microwave oven. - -![](https://static.lwn.net/images/2016/lca-oven-sm.jpg) - -## Adding novelty - -Adding a smartphone-like touchscreen and a network connection and encouraging a community to build innovative apps such as recipe sharing are fairly obvious ideas once you think to put “Linux” and “microwave oven” together, but Tulloh's vision and prototype lead well beyond there. Two novel features that have been fitted are a thermal camera and a scale for measuring weight. - -The thermal camera provides an eight-by-eight-pixel image of the contents of the oven with a precision of about two degrees. This is enough to detect if a glass of milk is about to boil over, or if the steak being thawed is in danger of getting cooked. In either case, the power can be reduced or removed. If appropriate, an alert can be sounded. This would not be the first microwave to be temperature sensitive — GE sold microwave ovens with temperature probes decades ago — but an always-present sensor is much more useful than a manually inserted probe, especially when there is an accessible API behind it. - -The second innovation is a built-in scale to weigh the food (and container) being cooked. Many recipes give cooking-time guidance based on weight and some microwave ovens allow you to enter the weight manually so it can do a calculation for you. With built-in scales, that can become automatic. Placing a scale reliably under the rotating plate typical of many microwave ovens would be a mechanical challenge that Tulloh did not think worth confronting. Instead his design is based on the “flat-plate” or “flat-bed” style of oven — placing a sensor at each of the four corners is mechanically straightforward and gives good results. - - [User interface] -Once you have these extra sensors — weight and temperature — connected to a suitable logic engine, more interesting possibilities can be explored. A cup of cold milk from the fridge will have a particular weight and temperature profile with a modest degree of error. Tulloh suggested that situation could be detected and some relevant options such as “Boil” or “Warm” could be offered for easy selection (a mock up of the interface is at right, a clickable version is [here](http://mwgui.tulloh.id.au/)). Simple machine learning could extend this to create a personalized experience. It would be easy to collect a history of starting profiles and cooking choices; when those patterns are detected, the most likely cooking choices could be made the easiest to select. - -![](https://static.lwn.net/images/2016/lca-ovengui-sm.png) - -## Overcoming staleness - -Beyond just new functionality, Tulloh wants to improve the functionality that already exists. Door handles as stiff as on Tulloh's cheap microwave may not be common, but few microwave oven doors seem designed to make life easy for people with physical handicaps. There are regulatory restrictions, particularly in the US, that require the oven to function only if there is positive confirmation that the door is actually shut. This confirmation must be resilient against simple fraud, so poking a stick in the hole must not trick the oven into working with the door open. In fact, there must be two independent confirmations and, if they disagree, a fuse must be blown so that a service call is required. Tulloh believes that a magnetic latch would provide much greater flexibility (including easy software control) and that magnetic keying similar to that used in a [magnetic keyed lock](https://en.wikipedia.org/wiki/Magnetic_keyed_lock) would allow the magnetic latch to pass certification. - -Another pain point with microwave ovens is the annoying sounds they make. Tulloh has discarded the beeper and hooked up a speaker to the Banana Pi that is controlling his prototype. This allows for more pleasant and configurable alerts as well as for advice and guidance through a text-to-speech system. Adding a microphone for voice control is an obvious next step. - -Many microwave ovens can do more than just set a time and a power level — they provide a range of power profiles for cooking, warming, defrosting, and so on. Adding precise temperature sensing will allow the community to extend this range substantially. A question from Andrew Tridgell in the audience wondered if tempering chocolate — a process that requires very precise temperature control — would be possible. Tulloh had no experience with the process, and couldn't make promises, but thought it was certainly worth looking in to. Even if that doesn't work out, it shows clear potential for value to be gained from community input. - -## Availability - -Tulloh would very much like to get these Linux-enabled microwave ovens out into the world to create a community and see where it goes. Buying existing ovens and replacing the electronics is not seen as a viable option. The result would be ugly and, given that a small-run smart microwave will inevitably cost more, potential buyers are going to want something that doesn't look completely out of place in their kitchen. - -Many components are available off-the-shelf (magnetron, processor board, thermal sensor) and others, such as a USB interface for the thermal sensor, are easily built. Prototype software is, of course, already available on [GitHub](https://github.com/lod?tab=repositories). The case and door are more of a challenge and would need to be made to order. Tulloh wants to turn this adversity into an opportunity by providing the option for left-handed microwave ovens and a variety of colors. - -A quick survey of the audience suggested that few people would hastily commit to his target price of $AU1000 for a new, improved, open oven. Whether a bit more time for reflection and a wider audience might tip the balance is hard to know. The idea is intriguing, so it seems worth watching Tulloh's [blog](http://david.tulloh.id.au/category/microwave/) for updates. - - ------------------------------------------------------------------------------- - -via: https://lwn.net/Articles/674877/ - -作者:Neil Brown -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 5b52719582d612112e7bade6297325b61b3a1a83 Mon Sep 17 00:00:00 2001 From: Zhengyu_Li Date: Tue, 12 Apr 2016 17:58:18 +0800 Subject: [PATCH 0610/1469] =?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 --- .../tech/A Linux-powered microwave oven | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 translated/tech/A Linux-powered microwave oven diff --git a/translated/tech/A Linux-powered microwave oven b/translated/tech/A Linux-powered microwave oven new file mode 100644 index 0000000000..57aaace3a7 --- /dev/null +++ b/translated/tech/A Linux-powered microwave oven @@ -0,0 +1,55 @@ +一个Linux驱动的微波炉 +================================================================================ + +[linux.conf.au](http://linux.conf.au/)里的人们都有一种想到什么就动手去实现的想法。随着硬件开源运动不断地发展壮大,这种想法越来越多,与现实世界联系的越来越紧密,而不仅仅存在于数字世界中。David Tulloh用他制作的[Linux驱动的微波炉 [WebM]](http://mirror.linux.org.au/linux.conf.au/2016/04_Thursday/D4.303_Costa_Theatre/Linux_driven_microwave.webm)来展示一个差劲的微波炉会多么难用以及说明他的项目可以改造这些微波炉使得它们不那么讨人厌。 + +Tulloh的故事要从他买到了一个公认很便宜的微波炉开始说起,它的用户界面比其它微波炉默认的还要糟糕。设定时间时必须使劲按按钮以至于把微波炉都向后推了一段距离——而事实上必须要用力拉仓门把手才能把微波炉拖回原来的位置,这形成了一个“优雅”的平衡。当然这只是极端情况。Tulloh很郁闷因为这个微波炉近十年来都没有一丁点明显的改善。他可能买到了一个又小又便宜的微波炉,而且特点是大部分人不研究使用手册就不会使用它——和智能手机的对比更加明显:智能手机只需知道一点点的操作指南并且被广泛使用。 + +改造这个微波炉不一定没有前途,“让微波炉重获新生”——这个想法成为了一个原型,如果Tulloh可以再平衡一下想做的功能和需求之间的关系的话他希望这变成一个众筹项目:一个Linux驱动的微波炉。 + +![](https://static.lwn.net/images/2016/lca-oven-sm.jpg) + +## 加一点新奇的小玩意 + + + +如果你把“Linux”和“微波炉”联系在一起的话就可能想到给微波炉加上一个智能手机式的触摸屏和网络链接,然后再通过社区做一款微波炉的“革命性”的手机应用,想到这些就像做菜想到分享食谱一样显而易见。但Tulloh的目标和他的原型远远超过这些,他做了两个新奇的功能——热感相机和称量物体质量的称重装置。 + +这个热感相机提供一个精确度两自由度的八乘八像素的图片,这足够发现一杯牛奶是否加热到沸腾或者牛排是否解冻到快不能用来烹饪。不论发生哪种情况,功率都可以减小或者关掉。而且在必要的时候会发出警报。这可能不是第一个可以检测温度的微波炉——GE在十年前就开始卖带温度探针的微波炉了——但是一个一直工作的内置传感器比一个手工探针有用多了尤其是有一个可用的API支持的时候。 + +第二个新发明是一个嵌入的称重装置,它可以在加热之前称量食物(和容器)。很多食谱根据质量给出指导的烹饪时间,很多微波炉支持你手动输入质量以便它帮你计算。利用内置的称重装置,这一过程可以变成自动化的。在许多微波炉的转盘下面稳固地放置一个称重装置是一个机械方面的挑战不过Tulloh觉得这个问题不难处理。反而他对微波炉的设计是基于“平板”或者“平板挂车”的风格——在四角各放置一个传感器,这不仅在机械实现上很简单而且很好的达到了要求。 + + +[用户界面] +一旦你有了这些额外添加的并与逻辑引擎相连的质量温度传感器,你可以去尝试更多好玩的可能。一杯刚从冰箱里拿出来的冰牛奶的质量温度分布可能会有适度误差。Tulloh发现这种情况可以被检测到而且提供一些有关的像“煮沸”或者“加热”的选项也是容易做到的(下面有一个模拟的界面,可点击操作的版本请点击右边链接 [here](http://mwgui.tulloh.id.au/)) + +![](https://static.lwn.net/images/2016/lca-ovengui-sm.png) + +## 改造陈旧的东西 + +除了才开发出来的新功能,Tulloh还想要提升那些原本就提供的功能。可能不是所有微波炉的门把手都像Tulloh那个廉价的一样僵硬,但是很少有微波炉将把手设计的让残疾人也能轻松使用。这些缺陷都是可调整的,尤其是在美国,微波炉应该在仓门关闭的时候给出一个确定关闭的提示。这种确认必须是可靠的以预防那些伪劣产品,所以在仓门闭合时固定的槽位里添加一个短杆以确认仓门开闭状态,不误使微波炉在仓门开着的时候工作。事实上,必须要两个相互联系的机关,如果他们提供的结果不一致, +保险丝必须断开以便启动一个呼叫服务。Tulloh认为提供一个磁力门闩有更大的灵活性(包含简单的软件控制)并且像磁控也同样用于[磁性钥匙锁](https://en.wikipedia.org/wiki/Magnetic_keyed_lock),它可以让磁力门闩确认微波炉门是否关闭。 + +微波炉的另一个痛点是它会发出令人厌烦的声音。Tulloh去掉了蜂鸣器并且使用香蕉派(类似于树莓派的单片机开发板)控制他的微波炉。这可以通过一个把文本转换成语音的系统来用令人愉悦而且可配置的警报来提示和引导使用者。显然,下一步就是装上一个用来控制声音的扩音器。 + + +许多微波炉除了定时和设置功率档位之外还可以做更多的事情——它们为烹饪,加热,化冻等提供一系列的功率谱。加上一个精确的温度测量装置感觉会为这个图表大大扩展它们的序列。Andrew Tridgell对一个问题很好奇,加热巧克力——一个需要非常精确的温度控制的过程——是否是可能的。Tulloh没有过这方面的经验,他不敢保证这个一定可以,但是这个实验结果的确值得期待。即使没做成这件事,它也显出了潜在价值——社区接下来可以更进一步去做这件事。 + +## 实用性怎么样? + +Tulloh十分乐意向全世界分享这个linux驱动的微波炉,他希望看到(因为这件事)形成一个社区并且想看到它接下来的走势。买一个现成的微波炉并且替换掉里面的电子元件看起来不是一个可行的点子。最后的结果可能会很糟,而买一个小巧智能的微波炉必然要花掉(比自己改造)更多的钱,但是潜在的顾客不想在他们的厨房里看到乱七八糟又不协调的东西。 + +许多零件都是现成的可以买到的(磁电管,处理器板,热传感器等等),像USB接口的热传感器,而且都很容易安装。软件原型当然也开源在[GitHub](https://github.com/lod?tab=repositories)。这个样例和微波炉门有不小的挑战性并且很可能要定制。Tulloh想要通过提供左侧开仓门的微波炉和颜色多样化的选项来转逆境为机遇。 + +一个对读者的快速调查:很少有人会贸然承诺他会为了一个全新的升级过的烤箱付出1000澳大利亚元。当然,很难知道是否会有充足的时间和足够多的读者来完成这个调查。这整个项目看起来很有趣。所以Tulloh的[博客](http://david.tulloh.id.au/category/microwave/) (点击这里)也很值得一看。 + +------------------------------------------------------------------------------ + +via: https://lwn.net/Articles/674877/ + +作者:Neil Brown +译者:yuba0604(https://github.com/yuba0604) + +译者水平有限,敬请指正。(lizhengyu@gmail.com) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 02d1c429269ad702c1dffc8f82ad7b79242f6849 Mon Sep 17 00:00:00 2001 From: Zhengyu_Li Date: Tue, 12 Apr 2016 18:00:02 +0800 Subject: [PATCH 0611/1469] Rename A Linux-powered microwave oven to 20160218 A Linux-powered microwave oven.md --- ... microwave oven => 20160218 A Linux-powered microwave oven.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename translated/tech/{A Linux-powered microwave oven => 20160218 A Linux-powered microwave oven.md} (100%) diff --git a/translated/tech/A Linux-powered microwave oven b/translated/tech/20160218 A Linux-powered microwave oven.md similarity index 100% rename from translated/tech/A Linux-powered microwave oven rename to translated/tech/20160218 A Linux-powered microwave oven.md From f910ab4e4be940e36017954a5a87ff58b8e3f24c Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 12 Apr 2016 19:37:50 +0800 Subject: [PATCH 0612/1469] translating --- ...nter Admin Suite Should Bring Order to Containerization.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sources/tech/20160223 New Docker Data Center Admin Suite Should Bring Order to Containerization.md b/sources/tech/20160223 New Docker Data Center Admin Suite Should Bring Order to Containerization.md index 48ea41d7b3..8e33955b14 100644 --- a/sources/tech/20160223 New Docker Data Center Admin Suite Should Bring Order to Containerization.md +++ b/sources/tech/20160223 New Docker Data Center Admin Suite Should Bring Order to Containerization.md @@ -1,3 +1,5 @@ +translating---geekpi + New Docker Data Center Admin Suite Should Bring Order to Containerization =============================================================================== @@ -47,3 +49,5 @@ via: http://linoxide.com/linux-how-to/calico-virtual-private-networking-docker/ [a]:http://techcrunch.com/author/ron-miller/ [1]: https://www.docker.com/ [2]: http://techcrunch.com/2014/08/04/docker-sells-dotcloud-to-cloudcontrol-to-focus-on-core-container-business/ + + From ab521a4767c396498d9fb272341657c2df9ebcae Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 12 Apr 2016 21:07:23 +0800 Subject: [PATCH 0613/1469] translated --- ... Should Bring Order to Containerization.md | 53 ------------------- ... Should Bring Order to Containerization.md | 50 +++++++++++++++++ 2 files changed, 50 insertions(+), 53 deletions(-) delete mode 100644 sources/tech/20160223 New Docker Data Center Admin Suite Should Bring Order to Containerization.md create mode 100644 translated/tech/20160223 New Docker Data Center Admin Suite Should Bring Order to Containerization.md diff --git a/sources/tech/20160223 New Docker Data Center Admin Suite Should Bring Order to Containerization.md b/sources/tech/20160223 New Docker Data Center Admin Suite Should Bring Order to Containerization.md deleted file mode 100644 index 8e33955b14..0000000000 --- a/sources/tech/20160223 New Docker Data Center Admin Suite Should Bring Order to Containerization.md +++ /dev/null @@ -1,53 +0,0 @@ -translating---geekpi - -New Docker Data Center Admin Suite Should Bring Order to Containerization -=============================================================================== - -![](https://tctechcrunch2011.files.wordpress.com/2016/02/shutterstock_119411227.jpg?w=738) - -[Docker][1] announced a new container control center today it’s calling the Docker Datacenter (DDC), an integrated administrative console that has been designed to give large and small businesses control over creating, managing and shipping containers. - -The DDC is a new tool made up of various commercial pieces including Docker Universal Control Plane (which also happens to be generally available today) and Docker Trusted Registry. It also includes open source pieces such as Docker Engine. The idea is to give companies the ability to manage the entire lifecycle of Dockerized applications from one central administrative interface. - -Customers actually were the driving force behind this new tool. While companies liked the agility that Docker containers give them, they also wanted management control over administration, security and governance around the containers they were creating and shipping, Scott Johnston, SVP of product management told TechCrunch. - -The company has called this Containers as a Service (CaaS), mostly because when customers came to them asking for this type of administrative control, that’s how they described it, Johnston said. - - -![](https://tctechcrunch2011.files.wordpress.com/2016/02/screen-shot-2016-02-23-at-7-56-54-am.png?w=680&h=401) - ->Image courtesy of Docker - -Like many open source projects, Docker gained a strong following among developers first, but as it grew in popularity, the companies these developers were working for wanted a straight-forward way to track and manage them. - -That’s exactly what DDC is designed to do. It gives developers the agility they need to create containerized applications, while providing operations with the tools they need to bring order to the process. - -In practice this means that developers can create a set of containerized components, have them approved for deployment by operations and then have access to a library of fully certified images. This lets developers pull the pieces they need across a range of applications without having to reinvent the wheel every time. That should speed up application development and deployment (and add to the agility that containers should in theory be providing in the first place). - -This aspect appealed to Beta customer ADP. The payroll services giant particularly liked having this central repository of images available to developers. - -“As part of our initiative to modernize our business-critical applications to microservices, ADP has been investigating solutions that would enable our developers to leverage a central library of IT-vetted and secured core services that they could rapidly iterate on,” said Keith Fulton, Chief Technology Officer at ADP said in a statement. - -Docker was launched in 2010 by founder Solomon Hykes as dotCloud. He pivoted the company to Docker in 2013, [selling dotCloud in August][2], 2014 to focus completely on Docker. - -The company came out of the gate like gangbusters a couple of years ago raising $180 million ($168 million since becoming Docker) over five rounds, according to CrunchBase. What caught the attention of investors was that Docker offered a way to deliver applications for the modern age called containers, a way of building, managing and shipping distributed applications. - -Containerization enables developers to create these distributed applications made up of small discrete pieces that run across multiple servers, as opposed to the large monolithic applications companies used to create running on a single server. - -Pricing for Docker Datacenter starts at $150 per node per month. - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/calico-virtual-private-networking-docker/ - -作者:[ Ron Miller][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://techcrunch.com/author/ron-miller/ -[1]: https://www.docker.com/ -[2]: http://techcrunch.com/2014/08/04/docker-sells-dotcloud-to-cloudcontrol-to-focus-on-core-container-business/ - - diff --git a/translated/tech/20160223 New Docker Data Center Admin Suite Should Bring Order to Containerization.md b/translated/tech/20160223 New Docker Data Center Admin Suite Should Bring Order to Containerization.md new file mode 100644 index 0000000000..147294c547 --- /dev/null +++ b/translated/tech/20160223 New Docker Data Center Admin Suite Should Bring Order to Containerization.md @@ -0,0 +1,50 @@ +新的Docker数据中心管理套件使容器化变得更加井然有序 +=============================================================================== + +![](https://tctechcrunch2011.files.wordpress.com/2016/02/shutterstock_119411227.jpg?w=738) + +[Docker][1]今天宣布了一个新的容器控制中心,称为Docker数据中心(DDC),被设计用于大型和小型企业能够创建、管理和分发容器的一个集成管理控制台。 + +DDC是由包括Docker Universal Control Plane(也是今天发布)和Docker Trusted Registry等不同的商业组件组成。它也包括了开源组件比如Docker Engine。这个主意能让公司能够在一个中心管理界面中就能够管理整个Docker化程序的生命周期。 + +产品SVP Scott Johnston告诉TechCrunch:“客户催使了这个新工具的产生。公司不仅喜欢Docker给他们带来的敏捷性,它们也希望在创建和分发容器的过程中可以进行行政、安全和管理。” + +Johnston说:“公司称这个为容器即服务(Caas),大多是是因为当客户来询问这个管理的类型时,它们是这样描述的。” + +![](https://tctechcrunch2011.files.wordpress.com/2016/02/screen-shot-2016-02-23-at-7-56-54-am.png?w=680&h=401) + +>Docker免费镜像 + +像许多开源项目那样,Docker首先获得了许多开发者的追随,但是它也很快在那些想直接追踪管理它们的开发者的公司中流行。 + +这就是DDC设计的目的。它给开发者创建容器化应用的敏捷性,也让运维变得井井有条。 + +实际中这意味着开发者可以创建一系列容器化的组件,批准部署后就可以获得一个完全认证的镜像。这可以让开发这一系列的程序中拉取他们所需而不必每次重新发明轮子。这可以加速应用的开发和部署(理论上提升了容器提供的灵活性)。 + +这方面吸引了Beta客户ADP。工资服务业巨头特别喜欢让这个中心镜像仓库提供给开发人员。 + +ADP的CTO Keith Fulton在声明中称:“作为我们将关键业务微服务化倡议的一部分,ADP正在研究能够然开发人员可以利用IT审核过的中央库和安全的核心服务进行快速迭代的方案。” + +Docker在2010年由dotcloud的Solomon Hykes发布。他在2013年将公司的重心移到Docker上,并在[8月dotCloud][2],2014年完全聚焦在Docker上。 + +根据CrunchBase的消息,公司几年来在5轮融资后势如破竹般获得了1亿8000万美元融资(自从成为Docker后获得了1亿6千8百万美元)。吸引投资者关注的是Docker提供了一种称为容器的现在分发应用的方式,可以构建、管理何分发分布式应用。 + +容器化可以让开发者创建由多个小的分布在不同服务器上的分布式应用,而不是一个运行在一个单独服务器上的独立应用。 + +DDC每月每节点150美金起。 + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/calico-virtual-private-networking-docker/ + +作者:[ Ron Miller][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://techcrunch.com/author/ron-miller/ +[1]: https://www.docker.com/ +[2]: http://techcrunch.com/2014/08/04/docker-sells-dotcloud-to-cloudcontrol-to-focus-on-core-container-business/ + + From f7f4b9bf2805629699c786860cd07e4c2cd0a677 Mon Sep 17 00:00:00 2001 From: Zhengyu_Li Date: Wed, 13 Apr 2016 20:02:26 +0800 Subject: [PATCH 0614/1469] Update 20160314 Healthy Open Source.md Translating by yuba0604 --- sources/tech/20160314 Healthy Open Source.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160314 Healthy Open Source.md b/sources/tech/20160314 Healthy Open Source.md index b36b516758..57dd559284 100644 --- a/sources/tech/20160314 Healthy Open Source.md +++ b/sources/tech/20160314 Healthy Open Source.md @@ -1,3 +1,4 @@ +Translating by yuba0604 Healthy Open Source ============================ From 05ccef7a899c85f83a311abc220539e3b7c5849c Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 15 Apr 2016 15:18:37 +0800 Subject: [PATCH 0615/1469] =?UTF-8?q?=E5=9B=9E=E6=94=B6=E8=B6=85=E6=9C=9F?= =?UTF-8?q?=E6=96=87=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @bestony @bioIkke @GHLandy @RickyGong @CoderBOBO @zpl1025 注意,文件丢了一个扩展名。 --- .../news/20160129 Recognizing correct code.md | 53 --- ...rom Facebook, IBM, Yahoo, and more news.md | 72 ---- ...ased ahead of impending OpenSSL updates.md | 42 --- ...nced-Based-on-Debian-GNU-Linux 8 Jessie.md | 40 --- ... open source board games to play online.md | 194 ---------- ...en source application development tools.md | 336 ------------------ ...2015--The best open source applications.md | 238 ------------- ...15--The best open source big data tools.md | 287 --------------- ...n source data center and cloud software.md | 261 -------------- ...open source desktop and mobile software.md | 223 ------------ ...s--Linus Torvalds Answers Your Question.md | 186 ---------- ...cketing System in Fedora 22 or Centos 7.md | 1 - ...tall Pure-FTPd with TLS on FreeBSD 10.2.md | 154 -------- ...0151227 Ubuntu Touch, three years later.md | 68 ---- ...eps to Start Your Linux SysAdmin Career.md | 1 - ...to Best Manage Encryption Keys on Linux.md | 2 - ...Systems Patched for Critical glibc Flaw.md | 2 - ...er Tools With Wercker’s Open Source CLI.md | 1 - ... => 20160314 15 podcasts for FOSS fans.md} | 0 19 files changed, 2161 deletions(-) delete mode 100644 sources/news/20160129 Recognizing correct code.md delete mode 100644 sources/news/20160227 Zephyr Project for Internet of Things, releases from Facebook, IBM, Yahoo, and more news.md delete mode 100644 sources/news/20160229 Node.js 5.7 released ahead of impending OpenSSL updates.md delete mode 100644 sources/news/20160318 Robolinux-8.4-LTS-Raptor-Series-Announced-Based-on-Debian-GNU-Linux 8 Jessie.md delete mode 100644 sources/share/20150901 5 best open source board games to play online.md delete mode 100644 sources/share/20151028 Bossie Awards 2015--The best open source application development tools.md delete mode 100644 sources/share/20151028 Bossie Awards 2015--The best open source applications.md delete mode 100644 sources/share/20151028 Bossie Awards 2015--The best open source big data tools.md delete mode 100644 sources/share/20151028 Bossie Awards 2015--The best open source data center and cloud software.md delete mode 100644 sources/share/20151028 Bossie Awards 2015--The best open source desktop and mobile software.md delete mode 100644 sources/talk/20150709 Interviews--Linus Torvalds Answers Your Question.md delete mode 100644 sources/tech/20151104 How to Install Pure-FTPd with TLS on FreeBSD 10.2.md delete mode 100644 sources/tech/20151227 Ubuntu Touch, three years later.md rename sources/tech/{20160314 15 podcasts for FOSS fans => 20160314 15 podcasts for FOSS fans.md} (100%) diff --git a/sources/news/20160129 Recognizing correct code.md b/sources/news/20160129 Recognizing correct code.md deleted file mode 100644 index 60b94b895d..0000000000 --- a/sources/news/20160129 Recognizing correct code.md +++ /dev/null @@ -1,53 +0,0 @@ -# Recognizing correct code - -Automatic bug-repair system fixes 10 times as many errors as its predecessors. ------- -DongShuaike is translating. - -MIT researchers have developed a machine-learning system that can comb through repairs to open-source computer programs and learn their general properties, in order to produce new repairs for a different set of programs. - -The researchers tested their system on a set of programming errors, culled from real open-source applications, that had been compiled to evaluate automatic bug-repair systems. Where those earlier systems were able to repair one or two of the bugs, the MIT system repaired between 15 and 18, depending on whether it settled on the first solution it found or was allowed to run longer. - -While an automatic bug-repair tool would be useful in its own right, professor of electrical engineering and computer science Martin Rinard, whose group developed the new system, believes that the work could have broader ramifications. - -“One of the most intriguing aspects of this research is that we’ve found that there are indeed universal properties of correct code that you can learn from one set of applications and apply to another set of applications,” Rinard says. “If you can recognize correct code, that has enormous implications across all software engineering. This is just the first application of what we hope will be a brand-new, fabulous technique.” - -Fan Long, a graduate student in electrical engineering and computer science at MIT, presented a paper describing the new system at the Symposium on Principles of Programming Languages last week. He and Rinard, his advisor, are co-authors. - -Users of open-source programs catalogue bugs they encounter on project websites, and contributors to the projects post code corrections, or “patches,” to the same sites. So Long was able to write a computer script that automatically extracted both the uncorrected code and patches for 777 errors in eight common open-source applications stored in the online repository GitHub. - -**Feature performance** - -As with [all][1] machine-learning systems, the crucial aspect of Long and Rinard’s design was the selection of a “[feature set][2]” that the system would analyze. The researchers concentrated on values stored in memory — either variables, which can be modified during a program’s execution, or constants, which can’t. They identified 30 prime characteristics of a given value: It might be involved in an operation, such as addition or multiplication, or a comparison, such as greater than or equal to; it might be local, meaning it occurs only within a single block of code, or global, meaning that it’s accessible to the program as a whole; it might be the variable that represents the final result of a calculation; and so on. - -Long and Rinard wrote a computer program that evaluated all the possible relationships between these characteristics in successive lines of code. More than 3,500 such relationships constitute their feature set. Their machine-learning algorithm then tried to determine what combination of features most consistently predicted the success of a patch. - -“All the features we’re trying to look at are relationships between the patch you insert and the code you are trying to patch,” Long says. “Typically, there will be good connections in the correct patches, corresponding to useful or productive program logic. And there will be bad patterns that mean disconnections in program logic or redundant program logic that are less likely to be successful.” - -**Ranking candidates** - -In earlier work, Long had developed an algorithm that attempts to repair program bugs by systematically modifying program code. The modified code is then subjected to a suite of tests designed to elicit the buggy behavior. This approach may find a modification that passes the tests, but it could take a prohibitively long time. Moreover, the modified code may still contain errors that the tests don’t trigger. - -Long and Rinard’s machine-learning system works in conjunction with this earlier algorithm, ranking proposed modifications according to the probability that they are correct before subjecting them to time-consuming tests. - -The researchers tested their system, which they call Prophet, on a set of 69 program errors that had cropped up in eight popular open-source programs. Of those, 19 are amenable to the type of modifications that Long’s algorithm uses; the other 50 have more complicated problems that involve logical inconsistencies across larger swaths of code. - -When Long and Rinard configured their system to settle for the first solution that passed the bug-eliciting tests, it was able to correctly repair 15 of the 19 errors; when they allowed it to run for 12 hours per problem, it repaired 18. - -Of course, that still leaves the other 50 errors in the test set untouched. In ongoing work, Long is working on a machine-learning system that will look at more coarse-grained manipulation of program values across larger stretches of code, in the hope of producing a bug-repair system that can handle more complex errors. - -“A revolutionary aspect of Prophet is how it leverages past successful patches to learn new ones,” says Eran Yahav, an associate professor of computer science at the Technion in Israel. “It relies on the insight that despite differences between software projects, fixes — patches — applied to projects often have commonalities that can be learned from. Using machine learning to learn from ‘big code’ holds the promise to revolutionize many programming tasks — code completion, reverse-engineering, et cetera.” - --------------------------------------------------------------------------------- - -via: http://news.mit.edu/2016/faster-automatic-bug-repair-code-errors-0129 - -作者:Larry Hardesty -译者:[译者ID](https://github.com/翻译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[1]:http://news.mit.edu/2013/teaching-computers-to-see-by-learning-to-see-like-computers-0919 -[2]:http://news.mit.edu/2015/automating-big-data-analysis-1016 - diff --git a/sources/news/20160227 Zephyr Project for Internet of Things, releases from Facebook, IBM, Yahoo, and more news.md b/sources/news/20160227 Zephyr Project for Internet of Things, releases from Facebook, IBM, Yahoo, and more news.md deleted file mode 100644 index 518256d0e9..0000000000 --- a/sources/news/20160227 Zephyr Project for Internet of Things, releases from Facebook, IBM, Yahoo, and more news.md +++ /dev/null @@ -1,72 +0,0 @@ -Zephyr Project for Internet of Things, releases from Facebook, IBM, Yahoo, and more news -=========================================================================================== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/weekly_news_roundup_tv.png?itok=eqUoW1gU) - -In this week's edition of our open source news roundup, we take a look at the new IoT project from the Linux Foundation, three big corporations releasing open source, and more. - -**News roundup for February 21 - 26, 2016** - -### Linux Foundation unveils the Zephyr Project - -The Internet of Things (IoT) is shaping up to be the next big thing in consumer technology. At the moment, most IoT solutions are proprietary and closed source. Open source is making numerous in-roads into the IoT world, and that's undoubtedly going to accelerate now that the Linux Foundation has [announced the Zephyr Project][1]. - -The Zephyr Project, according to ZDNet, "hopes to bring vendors and developers together under a single operating system which could make the development of connected devices an easier, less expensive and more stable process." The Project "aims to incorporate input from the open source and embedded developer communities and to encourage collaboration on the RTOS (real-time operating system)," according to the [Linux Foundation's press release][2]. - -Currently, Intel Corporation, NXP Semiconductors N.V., Synopsys, Inc., and UbiquiOS Technology Limited are the main supporters of the project. The Linux Foundation intends to attract other IoT vendors to this effort as well. - -### Releases from Facebook, IBM, Yahoo - -As we all know, open source isn't just about individuals or small groups hacking on code and hardware. Quite a few large corporations have significant investments in open source. This past week, three of them affirmed their commitment to open source. - -Yahoo again waded into open source waters this week with the [release of CaffeOnSpark][3] artificial intelligence software under an Apache 2.0 license. CaffeOnSpark performs "a popular type of AI called 'deep learning' on the vast swaths of data kept in its Hadoop open-source file system for storing big data," according to VentureBeat. If you're curious, you can [find the source code on GitHub][4]. - -Earlier this week, Facebook "[unveiled a new project that seeks not only to accelerate the evolution of technologies that drive our mobile networks, but to freely share this work with the world’s telecoms][5]," according to Wired. The company plans to build "everything from new wireless radios to nee optical fiber equipment." The designs, according to Facebook, will be open source so any telecom firm can use them. - -As part of the [Open Mainframe Project][6], IBM has open sourced the code for its Anomaly Detection Engine (ADE) for Linux logs. [According to IBM][7], "ADE detects anomalous time slices and messages in Linux logs using statistical learning" to detect suspicious behaviour. You can grab the [source code for ADE][8] from GitHub. - -### European Union to fund research - -The European Research Council, the European Union's science and technology funding body, is [funding four open source research projects][9] to the tune of about €2 million. According to joinup.ec.europa.eu, the projects being funded are: - -- A code audit of Mozilla's open source Rust programming language - -- An initiative at INRIA (France's national computer science research center) studying secure programming - -- A project at Austria's Technische Universitat Graz testing "ways to secure code against attacks that exploit certain properties of the computer hardware" - -- The "development of techniques to prove popular cryptographic protocols and schemes" at IST Austria - -### In other news - -- [Infosys' newest weapon: open source][10] - -- [Intel demonstrates Android smartphone running a Linux desktop][11] - -- [BeeGFS file system goes open source][12] - -A big thanks, as always, to the Opensource.com moderators and staff for their help this week. - --------------------------------------------------------------------------------- - -via: https://opensource.com/life/16/2/weekly-news-feb-26 - -作者:[Scott Nesbitt][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/scottnesbitt -[1]: http://www.zdnet.com/article/the-linux-foundations-zephyr-project-building-an-operating-system-for-iot-devices/ -[2]: http://www.linuxfoundation.org/news-media/announcements/2016/02/linux-foundation-announces-project-build-real-time-operating-system -[3]: http://venturebeat.com/2016/02/24/yahoo-open-sources-caffeonspark-deep-learning-framework-for-hadoop/ -[4]: https://github.com/yahoo/CaffeOnSpark -[5]: http://www.wired.com/2016/02/facebook-open-source-wireless-gear-forge-5g-world/ -[6]: https://www.openmainframeproject.org/ -[7]: http://openmainframeproject.github.io/ade/ -[8]: https://github.com/openmainframeproject/ade -[9]: https://joinup.ec.europa.eu/node/149541 -[10]: http://www.businessinsider.in/Exclusive-Infosys-is-using-Open-Source-as-its-mostlethal-weapon-yet/articleshow/51109129.cms -[11]: http://www.theregister.co.uk/2016/02/23/move_over_continuum_intel_shows_android_smartphone_powering_bigscreen_linux/ -[12]: http://insidehpc.com/2016/02/beegfs-parallel-file-system-now-open-source/ diff --git a/sources/news/20160229 Node.js 5.7 released ahead of impending OpenSSL updates.md b/sources/news/20160229 Node.js 5.7 released ahead of impending OpenSSL updates.md deleted file mode 100644 index 659df2e1f3..0000000000 --- a/sources/news/20160229 Node.js 5.7 released ahead of impending OpenSSL updates.md +++ /dev/null @@ -1,42 +0,0 @@ -Node.js 5.7 released ahead of impending OpenSSL updates -============================================================= - -![](http://images.techhive.com/images/article/2014/09/nodejs-100449932-primary.idge.jpg) - ->Once again, OpenSSL fixes must be evaluated by keepers of the popular server-side JavaScript platform - -The Node.js Foundation is gearing up this week for fixes to OpenSSL that could mean updates to Node.js itself. - -Releases to OpenSSL due on Tuesday will fix defects deemed to be of "high" severity, Rod Vagg, foundation technical steering committee director, said [in a blog post][1] on Monday. Within a day of the OpenSSL releases, the Node.js crypto team will assess their impacts, saying, "Please be prepared for the possibility of important updates to Node.js v0.10, v0.12, v4 and v5 soon after Tuesday, the 1st of March." - -[ Deep Dive: [How to rethink security for the new world of IT][2]. | Discover how to secure your systems with InfoWorld's [Security newsletter][3]. ] - -The high severity status actually means the issues are of lower risks than critical, perhaps affecting less-common configurations or less likely to be exploitable. Due to an embargo, the exact nature of these fixes and their impact on Node.js remain uncertain, said Vagg. "Node.js v0.10 and v0.12 both use OpenSSL v1.0.1, and Node.js v4 and v5 both use OpenSSL v1.0.2, and releases from nodejs.org and some other popular distribution sources are statically compiled. Therefore, all active release lines are impacted by this update." OpenSSL also impacted Node.js in December, [when two critical vulnerabilities were fixed][4]. - -The latest OpenSSL developments follow [the release of Node.js 5.7.0][5], which is clearing a path for the upcoming Node.js 6. Version 5 is the main focus for active development, said foundation representative Mikeal Rogers, "However, v5 won't be supported long-term, and most users will want to wait for v6, which will be released by the end of April, for the new features that are landing in v5." - -Release 5.7 has more predictability for C++ add-ons' interactions with JavaScript. Node.js can invoke JavaScript code from C++ code, and in version 5.7, the C++ node::MakeCallback() API is now re-entrant; calling it from inside another MakeCallback() call no longer causes the nextTick queue or Promises microtask queue to be processed out of order, [according to release notes][6]. - -Also fixed is an HTTP bug where handling headers mistakenly trigger an "upgrade" event where the server just advertises protocols. The bug can prevent HTTP clients from communicating with HTTP2-enabled servers. Version 5.7 performance improvements are featured in the path, querystring, streams, and process.nextTick modules. - -This story, "Node.js 5.7 released ahead of impending OpenSSL updates" was originally published by [InfoWorld][7]. - - --------------------------------------------------------------------------------- - -via: http://www.itworld.com/article/3039005/security/nodejs-57-released-ahead-of-impending-openssl-updates.html - -作者:[Paul Krill][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/Paul-Krill/ -[1]: https://nodejs.org/en/blog/vulnerability/openssl-march-2016/ -[2]: http://www.infoworld.com/resources/17273/security-management/how-to-rethink-security-for-the-new-world-of-it#tk.ifw-infsb -[3]: http://www.infoworld.com/newsletters/signup.html#tk.ifw-infsb -[4]: http://www.infoworld.com/article/3012157/security/why-nodejs-waited-for-openssl-security-update-before-patching.html -[5]: https://nodejs.org/en/blog/release/v5.7.0/ -[6]: https://nodejs.org/en/blog/release/v5.7.0/ -[7]: http://www.infoworld.com/ diff --git a/sources/news/20160318 Robolinux-8.4-LTS-Raptor-Series-Announced-Based-on-Debian-GNU-Linux 8 Jessie.md b/sources/news/20160318 Robolinux-8.4-LTS-Raptor-Series-Announced-Based-on-Debian-GNU-Linux 8 Jessie.md deleted file mode 100644 index 059ea0cfe1..0000000000 --- a/sources/news/20160318 Robolinux-8.4-LTS-Raptor-Series-Announced-Based-on-Debian-GNU-Linux 8 Jessie.md +++ /dev/null @@ -1,40 +0,0 @@ -Robolinux 8.4 LTS "Raptor" Series Announced, Based on Debian GNU/Linux 8 Jessie -==================================================================================== - -keyword : Robolinux 8.4 LTS , Robolinux 8.4 Cinnamon , Robolinux 8.4 MATE , Robolinux 8.4 Xfce , Debian 8 - -> It runs Windows 7 and 10 virus-free in stealth VMs - -### The developer of the Robolinux project has announced the release of his latest Robolinux 8.4 LTS "Raptor" series of Debian-based operating systems, which includes numerous software updates and performance improvements. - -Usually, the Robolinux developer [announces][1] only one edition at a time for a new major release of the GNU/Linux distribution, but today's announcement includes details about the availability for download of the Robolinux 8.4 LTS Cinnamon, MATE, Xfce, and LXDE editions, as both 64-bit and 32-bit variants. - -The long-term supported Robolinux 8.4 series of distributions has been in development for the last three and a half months, during which it has been synchronized with the upstream Debian GNU/Linux 8 (Jessie) repositories, thus adding all the latest security patches and software updates. - -"Three and a half months of hard work went into finding every way possible to optimize and speed up our series 8 Robolinux 'Raptor' operating systems," say the devs. "The result is we have significantly decreased the time it takes to load applications, bootup and shutdown all four of our upgraded Robolinux Raptor series versions. - -### The Raptor series is supported until 2020 - -Powered by Debian GNU/Linux 8's Linux 3.16 kernel, all the Robolinux 8.4 LTS "Raptor" editions have been rebased on the current stable Debian 8.3 source code, including over 180 upstream security and application updates. As Google ended support for the 32-bit version of its Google Chrome web browser, Robolinux now switches to Chromium. - -Other important software updates include the Mozilla Firefox 45.0 web browser, Mozilla Thunderbird 38.7.0 email and news client, Tor Browser 5.5, and VirtualBox 5.0. As usual, all Robolinux flavors come with numerous popular apps, including but not limited to Google Earth, Skype, Tor, I2P, Kazam, and a collection of useful security and privacy apps. - -Robolinux is a distribution targeted at new Linux users, so as expected, it includes the stealth virtual machine technology that lets them run the Microsoft Windows XP, Windows 7, and Windows 10 operating systems virus-free. Best of all, the Robolinux 8 "Raptor" LTS series is supported with software updates and security patches until the year 2020. - -While newcomers can [download the Robolinux 8.4 LTS Cinnamon, MATE][2], [Xfce][3], and [LXDE][4] editions right now from our website, current Robolinux 8 users can upgrade to the 8.4 release using the built-in "Robolinux Auto Upgrade" button in the Applications Menu. - --------------------------------------------------------------------------------- - -via: http://news.softpedia.com/news/robolinux-8-4-lts-raptor-series-announced-based-on-debian-gnu-linux-8-jessie-501899.shtml - -作者:[Marius Nestor][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://news.softpedia.com/editors/browse/marius-nestor -[1]: https://robolinux.org/downloads/v8.4-details.html -[2]: http://linux.softpedia.com/get/System/Operating-Systems/Linux-Distributions/Robolinux-102332.shtml -[3]: http://linux.softpedia.com/get/Linux-Distributions/Robolinux-Xfce-103540.shtml -[4]: http://linux.softpedia.com/get/Linux-Distributions/Robolinux-LXDE-103691.shtml diff --git a/sources/share/20150901 5 best open source board games to play online.md b/sources/share/20150901 5 best open source board games to play online.md deleted file mode 100644 index c14fecc697..0000000000 --- a/sources/share/20150901 5 best open source board games to play online.md +++ /dev/null @@ -1,194 +0,0 @@ -5 best open source board games to play online -================================================================================ -I have always had a fascination with board games, in part because they are a device of social interaction, they challenge the mind and, most importantly, they are great fun to play. In my misspent youth, myself and a group of friends gathered together to escape the horrors of the classroom, and indulge in a little escapism. The time provided an outlet for tension and rivalry. Board games help teach diplomacy, how to make and break alliances, bring families and friends together, and learn valuable lessons. - -I had a panache for abstract strategy games such as chess and draughts, as well as word games. I can still never resist a game of Escape from Colditz, a strategy card and dice-based board game, or Risk; two timeless multi-player strategy board games. But Catan remains my favourite board game. - -Board games have seen a resurgence in recent years, and Linux has a good range of board games to choose from. There is a credible implementation of Catan called Pioneers. But for my favourite implementations of classic board games to play online, check out the recommendations below. - ----------- - -### TripleA ### - -![TripleA in action](http://www.linuxlinks.com/portal/content/reviews/Games2/Screenshot-TripleA.png) - -TripleA is an open source online turn based strategy game. It allows people to implement and play various strategy board games (ie. Axis & Allies). The TripleA engine has full networking support for online play, support for sounds, XML support for game files, and has its own imaging subsystem that allows for customized user editable maps to be used. TripleA is versatile, scalable and robust. - -TripleA started out as a World War II simulation, but now includes different conflicts, as well as variations and mods of popular games and maps. TripleA comes with multiple games and over 100 more games can be downloaded from the user community. - -Features include: - -- Good interface and attractive graphics -- Optional scenarios -- Multiplayer games -- TripleA comes with the following supported games that uses its game engine (just to name a few): - - Axis & Allies : Classic edition (2nd, 3rd with options enabled) - - Axis & Allies : Revised Edition - - Pact of Steel A&A Variant - - Big World 1942 A&A Variant - - Four if by Sea - - Battle Ship Row - - Capture The Flag - - Minimap -- Hot-seat -- Play By EMail mode allows persons to play a game via EMail without having to be connected to each other online - - More time to think out moves - - Only need to come online to send your turn to the next player - - Dice rolls are done by a dedicated dice server that is independent of TripleA - - All dice rolls are PGP Verified and email to every player - - Every move and every dice roll is logged and saved in TripleA's History Window - - An online game can be later continued under PBEM mode - - Hard for others to cheat -- Hosted online lobby -- Utilities for editing maps -- Website: [triplea.sourceforge.net][1] -- Developer: Sean Bridges (original developer), Mark Christopher Duncan -- License: GNU GPL v2 -- Version Number: 1.8.0.7 - ----------- - -### Domination ### - -![Domination in action](http://www.linuxlinks.com/portal/content/reviews/Games2/Screenshot-Domination.png) - -Domination is an open source game that shares common themes with the hugely popular Risk board game. It has many game options and includes many maps. - -In the classic “World Domination” game of military strategy, you are battling to conquer the world. To win, you must launch daring attacks, defend yourself to all fronts, and sweep across vast continents with boldness and cunning. But remember, the dangers, as well as the rewards, are high. Just when the world is within your grasp, your opponent might strike and take it all away! - -Features include: - -- Simple to learn - - Domination - you must occupy all countries on the map, and thereby eliminate all opponents. These can be long, drawn out games - - Capital - each player has a country they have selected as a Capital. To win the game, you must occupy all Capitals - - Mission - each player draws a random mission. The first to complete their mission wins. Missions may include the elimination of a certain colour, occupation of a particular continent, or a mix of both -- Map editor -- Simple map format -- Multiplayer network play -- Single player -- Hotseat -- 5 user interfaces -- Game types: -- Play online -- Website: [domination.sourceforge.net][2] -- Developer: Yura Mamyrin, Christian Weiske, Mike Chaten, and many others -- License: GNU GPL v3 -- Version Number: 1.1.1.5 - ----------- - -### PyChess ### - -![Micro-Max in action](http://www.linuxlinks.com/portal/content/reviews/Games/Screenshot-Pychess.jpg) - -PyChess is a Gnome inspired chess client written in Python. - -The goal of PyChess, is to provide a fully featured, nice looking, easy to use chess client for the gnome-desktop. - -The client should be usable both to those totally new to chess, those who want to play an occasional game, and those who wants to use the computer to further enhance their play. - -Features include: - -- Attractive interface -- Chess Engine Communication Protocol (CECP) and Univeral Chess Interface (UCI) Engine support -- Free online play on the Free Internet Chess Server (FICS) -- Read and writes PGN, EPD and FEN chess file formats -- Built-in Python based engine -- Undo and pause functions -- Board and piece animation -- Drag and drop -- Tabbed interface -- Hints and spyarrows -- Opening book sidepanel using sqlite -- Score plot sidepanel -- "Enter game" in pgn dialog -- Optional sounds -- Legal move highlighting -- Internationalised or figure pieces in notation -- Website: [www.pychess.org][3] -- Developer: Thomas Dybdahl Ahle -- License: GNU GPL v2 -- Version Number: 0.12 Anderssen rc4 - ----------- - -### Scrabble ### - -![Scrabble in action](http://www.linuxlinks.com/portal/content/reviews/Games2/Screenshot-Scrabble3D.png) - -Scrabble3D is a highly customizable Scrabble game that not only supports Classic Scrabble and Superscrabble but also 3D games and own boards. You can play local against the computer or connect to a game server to find other players. - -Scrabble is a board game with the goal to place letters crossword like. Up to four players take part and get a limited amount of letters (usually 7 or 8). Consecutively, each player tries to compose his letters to one or more word combining with the placed words on the game array. The value of the move depends on the letters (rare letter get more points) and bonus fields which multiply the value of a letter or the whole word. The player with most points win. - -This idea is extended with Scrabble3D to the third dimension. Of course, a classic game with 15x15 fields or Superscrabble with 21x21 fields can be played and you may configure any field setting by yourself. The game can be played by the provided freeware program against Computer, other local players or via internet. Last but not least it's possible to connect to a game server to find other players and to obtain a rating. Most options are configurable, including the number and valuation of letters, the used dictionary, the language of dialogs and certainly colors, fonts etc. - -Features include: - -- Configurable board, letterset and design -- Board in OpenGL graphics with user-definable wavefront model -- Game against computer with support of multithreading -- Post-hoc game analysis with calculation of best move by computer -- Match with other players connected on a game server -- NSA rating and highscore at game server -- Time limit of games -- Localization; use of non-standard digraphs like CH, RR, LL and right to left reading -- Multilanguage help / wiki -- Network games are buffered and asynchronous games are possible -- Running games can be kibitzed -- International rules including italian "Cambio Secco" -- Challenge mode, What-if-variant, CLABBERS, etc -- Website: [sourceforge.net/projects/scrabble][4] -- Developer: Heiko Tietze -- License: GNU GPL v3 -- Version Number: 3.1.3 - ----------- - -### Backgammon ### - -![Backgammon in action](http://www.linuxlinks.com/portal/content/reviews/Games/Screenshot-gnubg.png) - -GNU Backgammon (gnubg) is a strong backgammon program (world-class with a bearoff database installed) usable either as an engine by other programs or as a standalone backgammon game. It is able to play and analyze both money games and tournament matches, evaluate and roll out positions, and more. - -In addition to supporting simple play, it also has extensive analysis features, a tutor mode, adjustable difficulty, and support for exporting annotated games. - -It currently plays at about the level of a championship flight tournament player and is gradually improving. - -gnubg can be played on numerous on-line backgammon servers, such as the First Internet Backgammon Server (FIBS). - -Features include: - -- A command line interface (with full command editing features if GNU readline is available) that lets you play matches and sessions against GNU Backgammon with a rough ASCII representation of the board on text terminals -- Support for a GTK+ interface with a graphical board window. Both 2D and 3D graphics are available -- Tournament match and money session cube handling and cubeful play -- Support for both 1-sided and 2-sided bearoff databases: 1-sided bearoff database for 15 checkers on the first 6 points and optional 2-sided database kept in memory. Optional larger 1-sided and 2-sided databases stored on disk -- Automated rollouts of positions, with lookahead and race variance reduction where appropriate. Rollouts may be extended -- Functions to generate legal moves and evaluate positions at varying search depths -- Neural net functions for giving cubeless evaluations of all other contact and race positions -- Automatic and manual annotation (analysis and commentary) of games and matches -- Record keeping of statistics of players in games and matches (both native inside GNU Backgammon and externally using relational databases and Python) -- Loading and saving analyzed games and matches as .sgf files (Smart Game Format) -- Exporting positions, games and matches to: (.eps) Encapsulated Postscript, (.gam) Jellyfish Game, (.html) HTML, (.mat) Jellyfish Match, (.pdf) PDF, (.png) Portable Network Graphics, (.pos) Jellyfish Position, (.ps) PostScript, (.sgf) Gnu Backgammon File, (.tex) LaTeX, (.txt) Plain Text, (.txt) Snowie Text -- Import of matches and positions from a number of file formats: (.bkg) Hans Berliner's BKG Format, (.gam) GammonEmpire Game, (.gam) PartyGammon Game, (.mat) Jellyfish Match, (.pos) Jellyfish Position, (.sgf) Gnu Backgammon File, (.sgg) GamesGrid Save Game, (.tmg) TrueMoneyGames, (.txt) Snowie Text -- Python Scripting -- Native language support; 10 languages complete or in progress -- Website: [www.gnubg.org][5] -- Developer: Joseph Heled, Oystein Johansen, Jonathan Kinsey, David Montgomery, Jim Segrave, Joern Thyssen, Gary Wong and contributors -- License: GPL v2 -- Version Number: 1.05.000 - --------------------------------------------------------------------------------- - -via: http://www.linuxlinks.com/article/20150830011533893/BoardGames.html - -作者:Frazer Kline -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[1]:http://triplea.sourceforge.net/ -[2]:http://domination.sourceforge.net/ -[3]:http://www.pychess.org/ -[4]:http://sourceforge.net/projects/scrabble/ -[5]:http://www.gnubg.org/ diff --git a/sources/share/20151028 Bossie Awards 2015--The best open source application development tools.md b/sources/share/20151028 Bossie Awards 2015--The best open source application development tools.md deleted file mode 100644 index b99752ea7b..0000000000 --- a/sources/share/20151028 Bossie Awards 2015--The best open source application development tools.md +++ /dev/null @@ -1,336 +0,0 @@ -Bossie Awards 2015: The best open source application development tools -================================================================================ -InfoWorld's top picks among platforms, frameworks, databases, and all the other tools that programmers use - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-app-dev-100613767-orig.jpg) - -### The best open source development tools ### - -There must be a better way, right? The developers are the ones who find it. This year's winning projects in the application development category include client-side frameworks, server-side frameworks, mobile frameworks, databases, languages, libraries, editors, and yeah, Docker. These are our top picks among all of the tools that make it faster and easier to build better applications. - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-docker-100613773-orig.jpg) - -### Docker ### - -The darling of container fans almost everywhere, [Docker][2] provides a low-overhead way to isolate an application or service’s environment, which serves its stated goal of being an open platform for building, shipping, and running distributed applications. Docker has been widely supported, even among those seeking to replace the Docker container format with an alternative, more secure runtime and format, specifically Rkt and AppC. Heck, Microsoft Visual Studio now supports deploying into a Docker container too. - -Docker’s biggest impact has been on virtual machine environments. Since Docker containers run inside the operating system, many more Docker containers than virtual machines can run in a given amount of RAM. This is important because RAM is usually the scarcest and most expensive resource in a virtualized environment. - -There are hundreds of thousands of runnable public images on Docker Hub, of which a few hundred are official, and the rest are from the community. You describe Docker images with a Dockerfile and build images locally from the Docker command line. You can add both public and private image repositories to Docker Hub. - --- Martin Heller - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-nodejs-iojs-100613778-orig.jpg) - -### Node.js and io.js ### - -[Node.js][2] -- and its recently reunited fork [io.js][3] -- is a platform built on [Google Chrome's V8 JavaScript runtime][4] for building fast, scalable, network applications. Node uses an event-driven, nonblocking I/O model without threads. In general, Node tends to take less memory and CPU resources than other runtime engines, such as Java and the .Net Framework. For example, a typical Node.js Web server can run well in a 512MB instance on Cloud Foundry or a 512MB Docker container. - -The Node repository on GitHub has more than 35,000 stars and more than 8,000 forks. The project, sponsored primarily by Joyent, has more than 600 contributors. Some of the more famous Node applications are 37Signals, [Ancestry.com][5], Chomp, the Wall Street Journal online, FeedHenry, [GE.com][6], Mockingbird, [Pearson.com][7], Shutterstock, and Uber. The popular IoT back-end Node-RED is built on Node, as are many client apps, such as Brackets and Nuclide. - --- Martin Heller - -![](rticle/2015/09/bossies-2015-angularjs-100613766-orig.jpg) - -### AngularJS ### - -[AngularJS][8] (or simply Angular, among friends) is a Model-View-Whatever (MVW) JavaScript AJAX framework that extends HTML with markup for dynamic views and data binding. Angular is especially good for developing single-page Web applications and linking HTML forms to models and JavaScript controllers. - -The weird sounding Model-View-Whatever pattern is an attempt to include the Model-View-Controller, Model-View-ViewModel, and Model-View-Presenter patterns under one moniker. The differences among these three closely related patterns are the sorts of topics that programmers love to argue about fiercely; the Angular developers decided to opt out of the discussion. - -Basically, Angular automatically synchronizes data from your UI (view) with your JavaScript objects (model) through two-way data binding. To help you structure your application better and make it easy to test, AngularJS teaches the browser how to do dependency injection and inversion of control. - -Angular was created by Google and open-sourced under the MIT license; there are currently more than 1,200 contributors to the project on GitHub, and the repository has more than 40,000 stars and 18,000 forks. The Angular site lists [210 “neat things” built with Angular][9]. - --- Martin Heller - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-react-100613782-orig.jpg) - -### React ### - -[React][10] is a JavaScript library for building a UI or view, typically for single-page applications. Note that React does not implement anything having to do with a model or controller. React pages can render on the server or the client; rendering on the server (with Node.js) is typically much faster. People often combine React with AngularJS to create complete applications. - -React combines JavaScript and HTML in a single file, optionally a JSX component. React fans like the way JSX components combine views and their related functionality in one file, though that flies in the face of the last decade of Web development trends, which were all about separating the markup and the code. React fans also claim that you can’t understand it until you’ve tried it. Perhaps you should; the React repository on GitHub has 26,000 stars. - -[React Native][11] implements React with native iOS controls; the React Native command line uses Node and Xcode. [ReactJS.Net][12] integrates React with [ASP.Net][13] and C#. React is available under a BSD license with a patent license grant from Facebook. - --- Martin Heller - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-atom-100613768-orig.jpg) - -### Atom ### - -[Atom][14] is an open source, hackable desktop editor from GitHub, based on Web technologies. It’s a full-featured tool with a fuzzy finder; fast projectwide search and replace; multiple cursors and selections; multiple panes, snippets, code folding; and the ability to import TextMate grammars and themes. Out of the box, Atom displayed proper syntax highlighting for every programming language on which I tried it, except for F# and C#; I fixed that easily by loading those packages from within Atom. Not surprising, Atom has tight integration with GitHub. - -The skeleton of Atom has been separated from the guts and called the Electron shell, providing an open source way to build cross-platform desktop apps with Web technologies. Visual Studio Code is built on the Electron shell, as are a number of proprietary and open source apps, including Slack and Kitematic. Facebook Nuclide adds significant functionality to Atom, including remote development and support for Flow, Hack, and Mercurial. - -On the downside, updating Atom packages can become painful, especially if you have many of them installed. The Nuclide packages seem to be the worst offenders -- they not only take a long time to update, they run CPU-intensive Node processes to do so. - --- Martin Heller - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-brackets-100613769-orig.jpg) - -### Brackets ### - -[Brackets][15] is a lightweight editor for Web design that Adobe developed and open-sourced, drawing heavily on other open source projects. The idea is to build better tooling for JavaScript, HTML, CSS, and related open Web technologies. Brackets itself is written in JavaScript, HTML, and CSS, and the developers use Brackets to build Brackets. The editor portion is based on another open source project, CodeMirror, and the Brackets native shell is based on Google’s Chromium Embedded Framework. - -Brackets features a clean UI, with the ability to open a quick inline editor that displays all of the related CSS for some HTML, or all of the related JavaScript for some scripting, and a live preview for Web pages that you are editing. New in Brackets 1.4 is instant search in files, easier preferences editing, the ability to enable and disable extensions individually, improved text rendering on Macs, and Greek and Cyrillic character support. Last November, Adobe started shipping a preview version of Extract for Brackets, which can pull out design information from Photoshop files, as part of the default download for Brackets. - --- Martin Heller - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-typescript-100613786-orig.jpg) - -### TypeScript ### - -[TypeScript][16] is a portable, duck-typed superset of JavaScript that compiles to plain JavaScript. The goal of the project is to make JavaScript usable for large applications. In pursuit of that goal, TypeScript adds optional types, classes, and modules to JavaScript, and it supports tools for large-scale JavaScript applications. Typing gets rid of some of the nonsensical and potentially buggy default behavior in JavaScript, for example: - - > 1 + "1" - '11' - -“Duck” typing means that the type checking focuses on the shape of the data values; TypeScript describes basic types, interfaces, and classes. While the current version of JavaScript does not support traditional, class-based, object-oriented programming, the ECMAScript 6 specification does. TypeScript compiles ES6 classes into plain, compatible JavaScript, with prototype-based objects, unless you enable ES6 output using the `--target` compiler option. - -Visual Studio includes TypeScript in the box, starting with Visual Studio 2013 Update 2. You can also edit TypeScript in Visual Studio Code, WebStorm, Atom, Sublime Text, and Eclipse. - -When using an external JavaScript library, or new host API, you'll need to use a declaration file (.d.ts) to describe the shape of the library. You can often find declaration files in the [DefinitelyTyped][17] repository, either by browsing, using the [TSD definition manager][18], or using NuGet. - -TypeScript’s GitHub repository has more than 6,000 stars. - --- Martin Heller - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-swagger-100613785-orig.jpg) - -### Swagger ### - -[Swagger][19] is a language-agnostic interface to RESTful APIs, with tooling that gives you interactive documentation, client SDK generation, and discoverability. It’s one of several recent attempts to codify the description of RESTful APIs, in the spirit of WSDL for XML Web Services (2000) and CORBA for distributed object interfaces (1991). - -The tooling makes Swagger especially interesting. [Swagger-UI][20] automatically generates beautiful documentation and a live API sandbox from a Swagger-compliant API. The [Swagger codegen][21] project allows generation of client libraries automatically from a Swagger-compliant server. - -[Swagger Editor][22] lets you edit Swagger API specifications in YAML inside your browser and preview documentations in real time. Valid Swagger JSON descriptions can then be generated and used with the full Swagger tooling. - -The [Swagger JS][23] library is a fast way to enable a JavaScript client to communicate with a Swagger-enabled server. Additional clients exist for Clojure, Go, Java, .Net, Node.js, Perl, PHP, Python, Ruby, and Scala. - -The [Amazon API Gateway][24] is a managed service for API management at scale. It can import Swagger specifications using an open source [Swagger Importer][25] tool. - -Swagger and friends use the Apache 2.0 license. - --- Martin Heller - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-polymer-100613781-orig.jpg) - -### Polymer ### - -The [Polymer][26] library is a lightweight, “sugaring” layer on top of the Web components APIs to help in building your own Web components. It adds several features for greater ease in building complex elements, such as creating custom element registration, adding markup to your element, configuring properties on your element, setting the properties with attributes, data binding with mustache syntax, and internal styling of elements. - -Polymer also includes libraries of prebuilt elements. The Iron library includes elements for working with layout, user input, selection, and scaffolding apps. The Paper elements implement Google's Material Design. The Gold library includes elements for credit card input fields for e-commerce, the Neon elements implement animations, the Platinum library implements push messages and offline caching, and the Google Web Components library is exactly what it says; it includes wrappers for YouTube, Firebase, Google Docs, Hangouts, Google Maps, and Google Charts. - -Polymer Molecules are elements that wrap other JavaScript libraries. The only Molecule currently implemented is for marked, a Markdown library. The Polymer repository on GitHub currently has 12,000 stars. The software is distributed under a BSD-style license. - --- Martin Heller - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-ionic-100613775-orig.jpg) - -### Ionic ### - -The [Ionic][27] framework is a front-end SDK for building hybrid mobile apps, using Angular.js and Cordova, PhoneGap, or Trigger.io. Ionic was designed to be similar in spirit to the Android and iOS SDKs, and to do a minimum of DOM manipulation and use hardware-accelerated transitions to keep the rendering speed high. Ionic is focused mainly on the look and feel and UI interaction of your app. - -In addition to the framework, Ionic encompasses an ecosystem of mobile development tools and resources. These include Chrome-based tools, Angular extensions for Cordova capabilities, back-end services, a development server, and a shell View App to enable testers to use your Ionic code on their devices without the need for you to distribute beta apps through the App Store or Google Play. - -Appery.io integrated Ionic into its low-code builder in July 2015. Ionic’s GitHub repository has more than 18,000 stars and more than 3,000 forks. Ionic is distributed under an MIT license and currently runs in UIWebView for iOS 7 and later, and in Android 4.1 and up. - --- Martin Heller - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-cordova-100613771-orig.jpg) - -### Cordova ### - -[Apache Cordova][28] is the open source project spun off when Adobe acquired PhoneGap from Nitobi. Cordova is a set of device APIs, plus some tooling, that allows a mobile app developer to access native device functionality like the camera and accelerometer from JavaScript. When combined with a UI framework like Angular, it allows a smartphone app to be developed with only HTML, CSS, and JavaScript. By using Cordova plug-ins for multiple devices, you can generate hybrid apps that share a large portion of their code but also have access to a wide range of platform capabilities. The HTML5 markup and code runs in a WebView hosted by the Cordova shell. - -Cordova is one of the cross-platform mobile app options supported by Visual Studio 2015. Several companies offer online builders for Cordova apps, similar to the Adobe PhoneGap Build service. Online builders save you from having to install and maintain most of the device SDKs on which Cordova relies. - --- Martin Heller - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-famous-100613774-orig.jpg) - -### Famous Engine ### - -The high-performance Famo.us JavaScript framework introduced last year has become the [Famous Engine][29] and [Famous Framework][30]. The Famous Engine runs in a mixed mode, with the DOM and WebGL under a single coordinate system. As before, Famous structures applications in a scene graph hierarchy, but now it produces very little garbage (reducing the garbage collector overhead) and sustains 60FPS animations. - -The Famous Physics engine has been refactored to its own, fine-grained module so that you can load only the features you need. Other improvements since last year include streamlined eventing, improved sizing, decoupling the scene graph from the rendering pipeline by using a draw command buffer, and switching to a fully open MIT license. - -The new Famous Framework is an alpha-stage developer preview built on the Famous Engine; its goal is creating reusable, composable, and interchangeable UI widgets and applications. Eventually, Famous hopes to replace the jQuery UI widgets with Famous Framework widgets, but while it's promising, the Famous Framework is nowhere near production-ready. - --- Martin Heller - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-mongodb-rev-100614248-orig.jpg) - -### MongoDB ### - -[MongoDB][31] is no stranger to the Bossies or to the ever-growing and ever-competitive NoSQL market. If you still aren't familiar with this very popular technology, here's a brief overview: MongoDB is a cross-platform document-oriented database, favoring JSON-like documents with dynamic schemas that make data integration easier and faster. - -MongoDB has attractive features, including but not limited to ad hoc queries, flexible indexing, replication, high availability, automatic sharding, load balancing, and aggregation. - -The big, bold move with [version 3.0 this year][32] was the new WiredTiger storage engine. We can now have document-level locking. This makes “normal” applications a whole lot more scalable and makes MongoDB available to more use cases. - -MongoDB has a growing open source ecosystem with such offerings as the [TokuMX engine][33], from the famous MySQL bad boys Percona. The long list of MongoDB customers includes heavy hitters such as Craigslist, eBay, Facebook, Foursquare, Viacom, and the New York Times. - --- Andrew Oliver - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-couchbase-100614851-orig.jpg) - -### Couchbase ### - -[Couchbase][34] is another distributed, document-oriented database that has been making waves in the NoSQL world for quite some time now. Couchbase and MongoDB often compete, but they each have their sweet spots. Couchbase tends to outperform MongoDB when doing more in memory is possible. - -Additionally, Couchbase’s mobile features allow you to disconnect and ship a database in compact format. This allows you to scale down as well as up. This is useful not just for mobile devices but also for specialized applications, like shipping medical records across radio waves in Africa. - -This year Couchbase added N1QL, a SQL-based query language that did away with Couchbase’s biggest obstacle, requiring static views. The new release also introduced multidimensional scaling. This allows individual scaling of services such as querying, indexing, and data storage to improve performance, instead of adding an entire, duplicate node. - --- Andrew C. Oliver - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-cassandra-100614852-orig.jpg) - -### Cassandra ### - -[Cassandra][35] is the other white meat of column family databases. HBase might be included with your favorite Hadoop distribution, but Cassandra is the one people deliberately deploy for specialized applications. There are good reasons for this. - -Cassandra was designed for high workloads of both writes and reads where millisecond consistency isn't as important as throughput. HBase is optimized for reads and greater write consistency. To a large degree, Cassandra tends to be used for operational systems and HBase more for data warehouse and batch-system-type use cases. - -While Cassandra has not received as much attention as other NoSQL databases and slipped into a quiet period a couple years back, it is widely used and deployed, and it's a great fit for time series, product catalog, recommendations, and other applications. If you want to keep a cluster up “no matter what” with multiple masters and multiple data centers, and you need to scale with lots of reads and lots of writes, Cassandra might just be your Huckleberry. - --- Andrew C. Oliver - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-orientdb-100613780-orig.jpg) - -### OrientDB ### - -[OrientDB][36] is an interesting hybrid in the NoSQL world, combining features from a document database, where individual documents can have multiple fields without necessarily defining a schema, and a graph database, which consists of a set of nodes and edges. At a basic level, OrientDB considers the document as a vertex, and relationships between fields as graph edges. Because the relationships between elements are part of the record, no costly joins are required when querying data. - -Like most databases today, OrientDB offers linear scalability via a distributed architecture. Adding capacity is a matter of simply adding more nodes to the cluster. Queries are written in a variant of SQL that is extended to support graph concepts. It's not exactly SQL, but data analysts shouldn't have too much trouble adapting. Language bindings are available for most commonly used languages, such as R, Scala, .Net, and C, and those integrating OrientDB into their applications will find an active user community to get help from. - --- Steven Nunez - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-rethinkdb-100613783-orig.jpg) - -### RethinkDB ### - -[RethinkDB][37] is a scalable, real-time JSON database with the ability to continuously push updated query results to applications that subscribe to changes. There are official RethinkDB drivers for Ruby, Python, and JavaScript/Node.js, and community-supported drivers for more than a dozen other languages, including C#, Go, and PHP. - -It’s temping to confuse RethinkDB with real-time sync APIs, such as Firebase and PubNub. RethinkDB can be run as a cloud service like Firebase and PubNub, but you can also install it on your own hardware or Docker containers. RethinkDB does more than synchronize: You can run arbitrary RethinkDB queries, including table joins, subqueries, geospatial queries, and aggregation. Finally, RethinkDB is designed to be accessed from an application server, not a browser. - -Where MongoDB requires you to poll the database to see changes, RethinkDB lets you subscribe to a stream of changes to a query result. You can shard and scale RethinkDB easily, unlike MongoDB. Also unlike relational databases, RethinkDB does not give you full ACID support or strong schema enforcement, although it can perform joins. - -The RethinkDB repository has 10,000 stars on GitHub, a remarkably high number for a database. It is licensed with the Affero GPL 3.0; the drivers are licensed with Apache 2.0. - --- Martin Heller - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-rust-100613784-orig.jpg) - -### Rust ### - -[Rust][38] is a syntactically C-like systems programming language from Mozilla Research that guarantees memory safety and offers painless concurrency (that is, no data races). It does not have a garbage collector and has minimal runtime overhead. Rust is strongly typed with type inference. This is all promising. - -Rust was designed for performance. It doesn’t yet demonstrate great performance, however, so now the mantra seems to be that it runs as fast as C++ code that implements all the safety checks built into Rust. I’m not sure whether I believe that, as in many cases the strictest safety checks for C/C++ code are done by static and dynamic analysis and testing, which don’t add any runtime overhead. Perhaps Rust performance will come with time. - -So far, the only tools for Rust are the Cargo package manager and the rustdoc documentation generator, plus a couple of simple Rust plug-ins for programming editors. As far as we have heard, there is no shipping software that was actually built with Rust. Now that Rust has reached the 1.0 milestone, we might expect that to change. - -Rust is distributed with a dual Apache 2.0 and MIT license. With 13,000 stars on its GitHub repository, Rust is certainly attracting attention, but when and how it will deliver real benefits remains to be seen. - --- Martin Heller - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-opencv-100613779-orig.jpg) - -### OpenCV ### - -[OpenCV][39] (Open Source Computer Vision Library) is a computer vision and machine learning library that contains about 500 algorithms, such as face detection, moving object tracking, image stitching, red-eye removal, machine learning, and eye movement tracking. It runs on Windows, Mac OS X, Linux, Android, and iOS. - -OpenCV has official C++, C, Python, Java, and MATLAB interfaces, and wrappers in other languages such as C#, Perl, and Ruby. CUDA and OpenCL interfaces are under active development. OpenCV was originally (1999) an Intel Research project in Russia; from there it moved to the robotics research lab Willow Garage (2008) and finally to [OpenCV.org][39] (2012) with a core team at Itseez, current source on GitHub, and stable snapshots on SourceForge. - -Users of OpenCV include Google, Yahoo, Microsoft, Intel, IBM, Sony, Honda, and Toyota. There are currently more than 6,000 stars and 5,000 forks on the GitHub repository. The project uses a BSD license. - --- Martin Heller - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-llvm-100613777-orig.jpg) - -### LLVM ### - -The [LLVM Project][40] is a collection of modular and reusable compiler and tool chain technologies, which originated at the University of Illinois. LLVM has grown to include a number of subprojects, several of which are interesting in their own right. LLVM is distributed with Debian, Ubuntu, and Apple Xcode, among others, and it’s used in commercial products from the likes of Adobe (including After Effects), Apple (including Objective-C and Swift), Cray, Intel, NVIDIA, and Siemens. A few of the open source projects that depend on LLVM are PyPy, Mono, Rubinius, Pure, Emscripten, Rust, and Julia. Microsoft has recently contributed LLILC, a new LLVM-based compiler for .Net, to the .Net Foundation. - -The main LLVM subprojects are the core libraries, which provide optimization and code generation; Clang, a C/C++/Objective-C compiler that’s about three times faster than GCC; LLDB, a much faster debugger than GDB; libc++, an implementation of the C++ 11 Standard Library; and OpenMP, for parallel programming. - --- Martin Heller - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-main-100613823-orig.jpg) - -### Read about more open source winners ### - -InfoWorld's Best of Open Source Awards for 2014 celebrate more than 100 open source projects, from the bottom of the stack to the top. Follow these links to more open source winners: - -[Bossie Awards 2015: The best open source applications][41] - -[Bossie Awards 2015: The best open source application development tools][42] - -[Bossie Awards 2015: The best open source big data tools][43] - -[Bossie Awards 2015: The best open source data center and cloud software][44] - -[Bossie Awards 2015: The best open source desktop and mobile software][45] - -[Bossie Awards 2015: The best open source networking and security software][46] - --------------------------------------------------------------------------------- - -via: http://www.infoworld.com/article/2982920/open-source-tools/bossie-awards-2015-the-best-open-source-application-development-tools.html - -作者:[InfoWorld staff][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.infoworld.com/author/InfoWorld-staff/ -[1]:https://www.docker.com/ -[2]:https://nodejs.org/en/ -[3]:https://iojs.org/en/ -[4]:https://developers.google.com/v8/?hl=en -[5]:http://www.ancestry.com/ -[6]:http://www.ge.com/ -[7]:https://www.pearson.com/ -[8]:https://angularjs.org/ -[9]:https://builtwith.angularjs.org/ -[10]:https://facebook.github.io/react/ -[11]:https://facebook.github.io/react-native/ -[12]:http://reactjs.net/ -[13]:http://asp.net/ -[14]:https://atom.io/ -[15]:http://brackets.io/ -[16]:http://www.typescriptlang.org/ -[17]:http://definitelytyped.org/ -[18]:http://definitelytyped.org/tsd/ -[19]:http://swagger.io/ -[20]:https://github.com/swagger-api/swagger-ui -[21]:https://github.com/swagger-api/swagger-codegen -[22]:https://github.com/swagger-api/swagger-editor -[23]:https://github.com/swagger-api/swagger-js -[24]:http://aws.amazon.com/cn/api-gateway/ -[25]:https://github.com/awslabs/aws-apigateway-importer -[26]:https://www.polymer-project.org/ -[27]:http://ionicframework.com/ -[28]:https://cordova.apache.org/ -[29]:http://famous.org/ -[30]:http://famous.org/framework/ -[31]:https://www.mongodb.org/ -[32]:http://www.infoworld.com/article/2878738/nosql/first-look-mongodb-30-for-mature-audiences.html -[33]:http://www.infoworld.com/article/2929772/nosql/mongodb-crossroads-growth-or-openness.html -[34]:http://www.couchbase.com/nosql-databases/couchbase-server -[35]:https://cassandra.apache.org/ -[36]:http://orientdb.com/ -[37]:http://rethinkdb.com/ -[38]:https://www.rust-lang.org/ -[39]:http://opencv.org/ -[40]:http://llvm.org/ -[41]:http://www.infoworld.com/article/2982622/bossie-awards-2015-the-best-open-source-applications.html -[42]:http://www.infoworld.com/article/2982920/bossie-awards-2015-the-best-open-source-application-development-tools.html -[43]:http://www.infoworld.com/article/2982429/bossie-awards-2015-the-best-open-source-big-data-tools.html -[44]:http://www.infoworld.com/article/2982923/bossie-awards-2015-the-best-open-source-data-center-and-cloud-software.html -[45]:http://www.infoworld.com/article/2982630/bossie-awards-2015-the-best-open-source-desktop-and-mobile-software.html -[46]:http://www.infoworld.com/article/2982962/bossie-awards-2015-the-best-open-source-networking-and-security-software.html diff --git a/sources/share/20151028 Bossie Awards 2015--The best open source applications.md b/sources/share/20151028 Bossie Awards 2015--The best open source applications.md deleted file mode 100644 index 29fced5cc9..0000000000 --- a/sources/share/20151028 Bossie Awards 2015--The best open source applications.md +++ /dev/null @@ -1,238 +0,0 @@ -Bossie Awards 2015: The best open source applications -================================================================================ -InfoWorld's top picks in open source business applications, enterprise integration, and middleware - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-applications-100614669-orig.jpg) - -### The best open source applications ### - -Applications -- ERP, CRM, HRM, CMS, BPM -- are not only fertile ground for three-letter acronyms, they're the engines behind every modern business. Our top picks in the category include back- and front-office solutions, marketing automation, lightweight middleware, heavyweight middleware, and other tools for moving data around, mixing it together, and magically transforming it into smarter business decisions. - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-xtuple-100614684-orig.jpg) - -### xTuple ### - -Small and midsize companies with light manufacturing or distribution needs have a friend in [xTuple][1]. This modular ERP/CRM combo bundles operations and financial control, product and inventory management, and CRM and sales support. Its relatively simple install lets you deploy all of the modules or only what you need today -- helping trim support costs without sacrificing customization later. - -This summer’s release brought usability improvements to the UI and a generous number of bug fixes. Recent updates also yielded barcode scanning and label printing for mobile warehouse workers, an enhanced workflow module (built with Plv8, a wrapper around Google’s V8 JavaScript engine that lets you write stored procedures for PostgreSQL in JavaScript), and quality management tools that are sure to get mileage on shop floors. - -The xTuple codebase is JavaScript from stem to stern. The server components can all be installed locally, in xTuple’s cloud, or deployed as an appliance. A mobile Web client, and mobile CRM features, augment a good native desktop client. - --- James R. Borck - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-odoo-100614678-orig.jpg) - -### Odoo ### - -[Odoo][2] used to be known as OpenERP. Last year the company raised private capital and broadened its scope. Today Odoo is a one-stop shop for back office and customer-facing applications -- replete with content management, business intelligence, and e-commerce modules. - -Odoo 8 fronts accounting, invoicing, project management, resource planning, and customer relationship management tools with a flexible Web interface that can be tailored to your company’s workflow. Add-on modules for warehouse management and HR, as well as for live chat and analytics, round out the solution. - -This year saw Odoo focused primarily on usability updates. A recently released sales planner helps sales groups track KPIs, and a new tips feature lends in-context help. Odoo 9 is right around the corner with alpha builds showing customer portals, Web form creation tools, mobile and VoIP services, and integration hooks to eBay and Amazon. - -Available for Windows and Linux, and as a SaaS offering, Odoo gives small and midsized companies an accessible set of tools to manage virtually every aspect of their business. - --- James R. Borck - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-idempiere-100614673-orig.jpg) - -### iDempiere ### - -Small and midsize companies have great choices in Odoo and xTuple. Larger manufacturing and distribution companies will need something more. For them, there’s [iDempiere][3] -- a well maintained offshoot of ADempiere with OSGi modularity. - -iDempiere implements a fully loaded ERP, supply chain, and CRM suite right out of the box. Built with Java, iDempiere supports both PostgreSQL and Oracle Database, and it can be customized extensively through modules built to the OSGi specification. iDempiere is perfectly suited to managing complex business scenarios involving multiple partners, requiring dynamic reporting, or employing point-of-sale and warehouse services. - -Being enterprise-ready comes with a price. iDempiere’s feature-rich tools and complexity impose a steep learning curve and require a commitment to integration support. Of course, those costs are offset by savings from the software’s free GPL2 licensing. iDempiere’s easy install script, small resource footprint, and clean interface also help alleviate some of the startup pains. There’s even a virtual appliance available on Sourceforge to get you started. - --- James R. Borck - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-suitecrm-100614680-orig.jpg) - -### SuiteCRM ### - -SugarCRM held the sweet spot in open source CRM since, well, forever. Then last year Sugar announced it would no longer contribute to the open source Community Edition. Into the ensuing vacuum rushed [SuiteCRM][4] – a fork of the final Sugar code. - -SuiteCRM 7.2 creates an experience on a par with SugarCRM Professional’s marketing, sales, and service tools. With add-on modules for workflow, reporting, and security, as well as new innovations like Lucene-driven search, taps for social media, and a beta reveal of new desktop notifications, SuiteCRM is on solid footing. - -The Advanced Open Sales module provides a familiar migration path from Sugar, while commercial support is available from the likes of [SalesAgility][5], the company that forked SuiteCRM in the first place. In little more than a year, SuiteCRM rescued the code, rallied an inspired community, and emerged as a new leader in open source CRM. Who needs Sugar? - --- James R. Borck - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-civicrm-100614671-orig.jpg) - -### CiviCRM ### - -We typically focus attention on CRM vis-à-vis small and midsize business requirements. But nonprofit and advocacy groups need to engage with their “customers” too. Enter [CiviCRM][6]. - -CiviCRM addresses the needs of nonprofits with tools for fundraising and donation processing, membership management, email tracking, and event planning. Granular access control and security bring role-based permissions to views, keeping paid staff and volunteers partitioned and productive. This year CiviCRM continued to develop with new features like simple A/B testing and monitoring for email campaigns. - -CiviCRM deploys as a plug-in to your WordPress, Drupal, or Joomla content management system -- a dead-simple install if you already have one of these systems in place. If you don’t, CiviCRM is an excellent reason to deploy the CMS. It’s a niche-filling solution that allows nonprofits to start using smarter, tailored tools for managing constituencies, without steep hurdles and training costs. - --- James R. Borck - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-mautic-100614677-orig.jpg) - -### Mautic ### - -For marketers, the Internet -- Web, email, social, all of it -- is the stuff dreams are made on. [Mautic][7] allows you to create Web and email campaigns that track and nurture customer engagement, then roll all of the data into detailed reports to gain insight into customer needs and wants and how to meet them. - -Open source options in marketing automation are few, but Mautic’s extensibility stands out even against closed solutions like IBM’s Silverpop. Mautic even integrates with popular third-party email marketing solutions (MailChimp, Constant Contact) and social media platforms (Facebook, Twitter, Google+, Instagram) with quick-connect widgets. - -The developers of Mautic could stand to broaden the features for list segmentation and improve the navigability of their UI. Usability is also hindered by sparse documentation. But if you’re willing to rough it out long enough to learn your way, you’ll find a gem -- and possibly even gold -- in Mautic. - --- James R. Borck - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-orangehrm-100614679-orig.jpg) - -### OrangeHRM ### - -The commercial software market in the human resource management space is rather fragmented, with Talent, HR, and Workforce Management startups all vying for a slice of the pie. It’s little wonder the open source world hasn’t found much direction either, with the most ambitious HRM solutions often locked inside larger ERP distributions. [OrangeHRM][8] is a standout. - -OrangeHRM tackles employee administration from recruitment and applicant tracking to performance reviews, with good audit trails throughout. An employee portal provides self-serve access to personal employment information, time cards, leave requests, and personnel documents, helping reduce demands on HR staff. - -OrangeHRM doesn’t yet address niche aspects like talent management (social media, collaboration, knowledge banks), but it’s remarkably full-featured. Professional and Enterprise options offer more advanced functionality (in areas such as recruitment, training, on/off-boarding, document management, and mobile device access), while community modules are available for the likes of Active Directory/LDAP integration, advanced reporting, and even insurance benefit management. - --- James R. Borck - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-libreoffice-100614675-orig.jpg) - -### LibreOffice ### - -[LibreOffice][9] is the easy choice for best open source office productivity suite. Originally forked from OpenOffice, Libre has been moving at a faster clip than OpenOffice ever since, drawing more developers and producing more new features than its rival. - -LibreOffice 5.0, released only last month, offers UX improvements that truly enhance usability (like visual previews to style changes in the sidebar), brings document editing to Android devices (previously a view-only prospect), and finally delivers on a 64-bit Windows codebase. - -LibreOffice still lacks a built-in email client and a personal information manager, not to mention the real-time collaborative document editing available in Microsoft Office. But Libre can run off of a USB flash disk for portability, natively supports a greater number of graphic and file formats, and creates hybrid PDFs with embedded ODF files for full-on editing. Libre even imports Apple Pages documents, in addition to opening and saving all Microsoft Office formats. - -LibreOffice has done a solid job of tightening its codebase and delivering enhancements at a regular clip. With a new cloud version under development, LibreOffice will soon be more liberating than ever. - --- James R. Borck - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-bonita-100614672-orig.jpg) - -### Bonita BPM ### - -Open source BPM has become a mature, cost-effective alternative to the top proprietary solutions. Having led the charge since 2009, Bonitasoft continues to raise the bar. The new [Bonita BPM 7][10] release impresses with innovative features that simplify code generation and shorten development cycles for BPM app creation. - -Most important to the new version, though, is better abstraction of underlying core business logic from UI and data components, allowing UIs and processes to be developed independently. This new MVC approach reduces downtime for live upgrades (no more recompilation!) and eases application maintenance. - -Bonita contains a winning set of connectors to a broad range of enterprise systems (ERP, CRM, databases) as well as to Web services. Complementing its process weaving tools, a new form designer (built on AngularJS/Bootstrap) goes a long way toward improving UI creation for the Web-centric and mobile workforce. - --- James R. Borck - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-camunda-100614670-orig.jpg) - -### Camunda BPM ### - -Many open source solutions, like Bonita BPM, offer solid, drop-in functionality. Dig into the code base, though, and you may find it’s not the cleanest to build upon. Enterprise Java developers who hang out under the hood should check out [Camunda BPM][11]. - -Forked from Alfresco Activiti (a creation of former Red Hat jBPM developers), Camunda BPM delivers a tight, Java-based BPMN 2.0 engine in support of human workflow activities, case management, and systems process automation that can be embedded in your Java apps or run as a container service in Tomcat. Camunda’s ecosystem offers an Eclipse plug-in for process modeling and the Cockpit dashboard brings real-time monitoring and management over running processes. - -The Enterprise version adds WebSphere and WebLogic Server support. Additional incentives for the Enterprise upgrade include Saxon-driven XSLT templating (sidestepping the scripting engine) and add-ons to improve process management and exception handling. - -Camunda is a solid BPM engine ready for build-out and one of the first open source process managers to introduce DMN (Decision Model and Notation) support, which helps to simplify complex rules-based modeling alongside BPMN. DMN support is currently at the alpha stage. - --- James R. Borck - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-talend-100614681-orig.jpg) - -### Talend Open Studio ### - -No open source ETL or EAI solution comes close to [Talend Open Studio][12] in functionality, performance, or support of modern integration trends. This year Talend unleashed Open Studio 6, a new version with a streamlined UI and smarter tooling that brings it more in line with Talend’s cloud-based offering. - -Using Open Studio you can visually design, test, and debug orchestrations that connect, transform, and synchronize data across a broad range of real-time applications and data resources. Talend’s wealth of connectors provides support for most any endpoint -- from flat files to Hadoop to Amazon S3. Packaged editions focus on specific scenarios such as big data integration, ESB, and data integrity monitoring. - -New support for Java 8 brings a speed boost. The addition of support for MariaDB and for in-memory processing with MemSQL, as well as updates to the ESB engine, keep Talend in step with the community’s needs. Version 6 was a long time coming, but no less welcome for that. Talend Open Studio is still first in managing complex data integration -- in-house, in the cloud, or increasingly, a combination of the two. - --- James R. Borck - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-warewolf-100614683-orig.jpg) - -### Warewolf ESB ### - -Complex integration patterns may demand the strengths of a Talend to get the job done. But for many lightweight microservices, the overhead of a full-fledged enterprise integration solution is extreme overkill. - -[Warewolf ESB][13] combines a streamlined .Net-based process engine with visual development tools to provide for dead simple messaging and application payload routing in a native Windows environment. The Warewolf ESB is an “easy service bus,” not an enterprise service bus. - -Drag-and-drop tooling in the design studio makes quick work of configuring connections and logic flows. Built-in wizardry handles Web services definitions and database calls, and it can even tap Windows DLLs and the command line directly. Using the visual debugger, you can inspect execution streams (if not yet actually step through them), then package everything for remote deployment. - -Warewolf is still a .40.5 release and undergoing major code changes. It also lacks native connectors, easy transforms, and any means of scalability management. Be aware that the precompiled install demands collection of some usage statistics (I wish they would stop that). But Warewolf ESB is fast, free, and extensible. It’s a quirky, upstart project that offers definite benefits to Windows integration architects. - --- James R. Borck - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-knime-100614674-orig.jpg) - -### KNIME ### - -[KNIME][14] takes a code-free approach to predictive analytics. Using a graphical workbench, you wire together workflows from an abundant library of processing nodes, which handle data access, transformation, analysis, and visualization. With KNIME, you can pull data from databases and big data platforms, run ETL transformations, perform data mining with R, and produce custom reports in the end. - -The company was busy this year rolling out the KNIME 2.12 update. The new release introduces MongoDB support, XPath nodes with autoquery creation, and a new view controller (based on the D3 JavaScript library) that creates interactive data visualizations on the fly. It also includes additional statistical nodes and a REST interface (KNIME Server edition) that provides services-based access to workflows. - -KNIME’s core analytics engine is free open source. The company offers several fee-based extensions for clustering and collaboration. (A portion of your licensing fee actually funds the open source project.) KNIME Server (on-premise or cloud) ups the ante with security, collaboration, and workflow repositories -- all serving to inject analytics more productively throughout your business lines. - --- James R. Borck - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-teiid-100614682-orig.jpg) - -### Teiid ### - -[Teiid][15] is a data virtualization system that allows applications to use data from multiple, heterogeneous data stores. Currently a JBoss project, Teiid is backed by years of development from MetaMatrix and a long history of addressing the data access needs of the largest enterprise environments. I even see [uses for Teiid in Hadoop and big data environments][16]. - -In essence, Teiid allows you to connect all of your data sources into a “virtual” mega data source. You can define caching semantics, transforms, and other “configuration not code” transforms to load from multiple data sources using plain old SQL, XQuery, or procedural queries. - -Teiid is primarily accessible through JBDC and has built-in support for Web services. Red Hat sells Teiid as [JBoss Data Virtualization][17]. - --- Andrew C. Oliver - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-main-100614676-orig.jpg) - -### Read about more open source winners ### - -InfoWorld's Best of Open Source Awards for 2014 celebrate more than 100 open source projects, from the bottom of the stack to the top. Follow these links to more open source winners: - -[Bossie Awards 2015: The best open source applications][18] - -[Bossie Awards 2015: The best open source application development tools][19] - -[Bossie Awards 2015: The best open source big data tools][20] - -[Bossie Awards 2015: The best open source data center and cloud software][21] - -[Bossie Awards 2015: The best open source desktop and mobile software][22] - -[Bossie Awards 2015: The best open source networking and security software][23] - --------------------------------------------------------------------------------- - -via: http://www.infoworld.com/article/2982622/open-source-tools/bossie-awards-2015-the-best-open-source-applications.html - -作者:[InfoWorld staff][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.infoworld.com/author/InfoWorld-staff/ -[1]:http://xtuple.org/ -[2]:http://odoo.com/ -[3]:http://idempiere.org/ -[4]:http://suitecrm.com/ -[5]:http://salesagility.com/ -[6]:http://civicrm.org/ -[7]:https://www.mautic.org/ -[8]:http://www.orangehrm.com/ -[9]:http://libreoffice.org/ -[10]:http://www.bonitasoft.com/ -[11]:http://camunda.com/ -[12]:http://talend.com/ -[13]:http://warewolf.io/ -[14]:http://www.knime.org/ -[15]:http://teiid.jboss.org/ -[16]:http://www.infoworld.com/article/2922180/application-development/database-virtualization-or-i-dont-want-to-do-etl-anymore.html -[17]:http://www.jboss.org/products/datavirt/overview/ -[18]:http://www.infoworld.com/article/2982622/bossie-awards-2015-the-best-open-source-applications.html -[19]:http://www.infoworld.com/article/2982920/bossie-awards-2015-the-best-open-source-application-development-tools.html -[20]:http://www.infoworld.com/article/2982429/bossie-awards-2015-the-best-open-source-big-data-tools.html -[21]:http://www.infoworld.com/article/2982923/bossie-awards-2015-the-best-open-source-data-center-and-cloud-software.html -[22]:http://www.infoworld.com/article/2982630/bossie-awards-2015-the-best-open-source-desktop-and-mobile-software.html -[23]:http://www.infoworld.com/article/2982962/bossie-awards-2015-the-best-open-source-networking-and-security-software.html \ No newline at end of file diff --git a/sources/share/20151028 Bossie Awards 2015--The best open source big data tools.md b/sources/share/20151028 Bossie Awards 2015--The best open source big data tools.md deleted file mode 100644 index 0cf65ea3a8..0000000000 --- a/sources/share/20151028 Bossie Awards 2015--The best open source big data tools.md +++ /dev/null @@ -1,287 +0,0 @@ -Bossie Awards 2015: The best open source big data tools -================================================================================ -InfoWorld's top picks in distributed data processing, streaming analytics, machine learning, and other corners of large-scale data analytics - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-big-data-100613944-orig.jpg) - -### The best open source big data tools ### - -How many Apache projects can sit on a pile of big data? Fire up your Hadoop cluster, and you might be able to count them. Among this year's Bossies in big data, you'll find the fastest, widest, and deepest newfangled solutions for large-scale SQL, stream processing, sort-of stream processing, and in-memory analytics, not to mention our favorite maturing members of the Hadoop ecosystem. It seems everyone has a nail to drive into MapReduce's coffin. - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-spark-100613962-orig.jpg) - -### Spark ### - -With hundreds of contributors, [Spark][1] is one of the most active and fastest-growing Apache projects, and with heavyweights like IBM throwing their weight behind the project and major corporations bringing applications into large-scale production, the momentum shows no signs of letting up. - -The sweet spot for Spark continues to be machine learning. Highlights since last year include the replacement of the SchemaRDD with a Dataframes API, similar to those found in R and Pandas, making data access much simpler than with the raw RDD interface. Also new are ML pipelines for building repeatable machine learning workflows, expanded and optimized support for various storage formats, simpler interfaces to machine learning algorithms, improvements in the display of cluster resources usage, and task tracking. - -On by default in Spark 1.5 is the off-heap memory manager, Tungsten, which offers much faster processing by fine-tuning data structure layout in memory. Finally, the new website, [spark-packages.org][2], with more than 100 third-party libraries, adds many useful features from the community. - --- Steven Nunez - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-storm-100614149-orig.jpg) - -### Storm ### - -[Apache Storm][3] is a Clojure-based distributed computation framework primarily for streaming real-time analytics. Storm is based on the [disruptor pattern][4] for low-latency complex event processing created LMAX. Unlike Spark, Storm can do single events as opposed to “micro-batches,” and it has a lower memory footprint. In my experience, it scales better for streaming, especially when you’re mainly streaming to ingest data into other data sources. - -Storm’s profile has been eclipsed by Spark, but Spark is inappropriate for many streaming applications. Storm is frequently used with Apache Kafka. - --- Andrew C. Oliver - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-h2o-100613950-orig.jpg) - -### H2O ### - -[H2O][5] is a distributed, in-memory processing engine for machine learning that boasts an impressive array of algorithms. Previously only available for R users, version 3.0 adds Python and Java language bindings, as well as a Spark execution engine for the back end. The best way to view H20 is as a very large memory extension of your R environment. Instead of working directly on large data sets, the R extensions communicate via a REST API with the H2O cluster, where H2O does the heavy lifting. - -Several useful R packages such as ddply have been wrapped, allowing you to use them on data sets larger than the amount of RAM on the local machine. You can run H2O on EC2, on a Hadoop/YARN cluster, and on Docker containers. With Sparkling Water (Spark plus H2O) you can access Spark RDDs on the cluster side by side to, for example, process a data frame with Spark before passing it to an H2O machine learning algorithm. - --- Steven Nunez - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-apex-100613943-orig.jpg) - -### Apex ### - -[Apex][6] is an enterprise-grade, big data-in-motion platform that unifies stream processing as well as batch processing. A native YARN application, Apex processes streaming data in a scalable, fault-tolerant manner and provides all the common stream operators out of the box. One of the best things about Apex is that it natively supports the common event processing guarantees (exactly once, at least once, at most once). Formerly a commercial product by DataTorrent, Apex's roots show in the quality of the documentation, examples, code, and design. Devops and application development are cleanly separated, and user code generally doesn't have to be aware that it is running in a streaming cluster. - -A related project, [Malhar][7], offers more than 300 commonly used operators and application templates that implement common business logic. The Malhar libraries significantly reduce the time it takes to develop an Apex application, and there are connectors (operators) for storage, file systems, messaging systems, databases, and nearly anything else you might want to connect to from an application. The operators can all be extended or customized to meet individual business's requirements. All Malhar components are available under the Apache license. - --- Steven Nunez - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-druid-100613947-orig.jpg) - -### Druid ### - -[Druid][8], which moved to a commercially friendly Apache license in February of this year, is best described as a hybrid, “event streams meet OLAP” solution. Originally developed to analyze online events for ad markets, Druid allows users to do arbitrary and interactive exploration of time series data. Some of the key features include low-latency ingest of events, fast aggregations, and approximate and exact calculations. - -At the heart of Druid is a custom data store that uses specialized nodes to handle each part of the problem. Real-time ingest is managed by real-time nodes (JVMs) that eventually flush data to historical nodes that are responsible for data that has aged. Broker nodes direct queries in a scatter-gather fashion to both real-time and historical nodes to give the user a complete picture of events. Benchmarked at a sustained 500K events per second and 1 million events per second peak, Druid is ideal as a real-time dashboard for ad-tech, network traffic, and other activity streams. - --- Steven Nunez - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-flink-100613949-orig.jpg) - -### Flink ### - -At its core, [Flink][9] is a data flow engine for event streams. Although superficially similar to Spark, Flink takes a different approach to in-memory processing. First, Flink was designed from the start as a stream processor. Batch is simply a special case of a stream with a beginning and an end, and Flink offers APIs for dealing with each case, the DataSet API (batch) and the DataStream API. Developers coming from the MapReduce world should feel right at home working with the DataSet API, and porting applications to Flink should be straightforward. In many ways Flink mirrors the simplicity and consistency that helped make Spark so popular. Like Spark, Flink is written in Scala. - -The developers of Flink clearly thought out usage and operations too: Flink works natively with YARN and Tez, and it uses an off-heap memory management scheme to work around some of the JVM limitations. A peek at the Flink JIRA site shows a healthy pace of development, and you’ll find an active community on the mailing lists and on StackOverflow as well. - --- Steven Nunez - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-elastic-100613948-orig.jpg) - -### Elasticsearch ### - -[Elasticsearch][10] is a distributed document search server based on [Apache Lucene][11]. At its heart, Elasticsearch builds indices on JSON-formatted documents in nearly real time, enabling fast, full-text, schema-free queries. Combined with the open source Kibana dashboard, you can create impressive visualizations of your real-time data in a simple point-and-click fashion. - -Elasticsearch is easy to set up and easy to scale, automatically making use of new hardware by rebalancing shards as required. The query syntax isn't at all SQL-like, but it is intuitive enough for anyone familiar with JSON. Most users won't be interacting at that level anyway. Developers can use the native JSON-over-HTTP interface or one of the several language bindings available, including Ruby, Python, PHP, Perl, .Net, Java, and JavaScript. - --- Steven Nunez - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-slamdata-100613961-orig.jpg) - -### SlamData ### - -If you are seeking a user-friendly tool to visualize and understand your newfangled NoSQL data, take a look at [SlamData][12]. SlamData allows you to query nested JSON data using familiar SQL syntax, without relocation or transformation. - -One of the technology’s main features is its connectors. From MongoDB to HBase, Cassandra, and Apache Spark, SlamData taps external data sources with the industry's most advanced “pushdown” processing technology, performing transformations and analytics close to the data. - -While you might ask, “Wouldn’t I be better off building a data lake or data warehouse?” consider the companies that were born in NoSQL. Skipping the ETL and simply connecting a visualization tool to a replica offers distinct advantages -- not only in terms of how up-to-date the data is, but in how many moving parts you have to maintain. - --- Andrew C. Oliver - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-drill-100613946-orig.jpg) - -### Drill ### - -[Drill][13] is a distributed system for interactive analysis of large-scale data sets, inspired by [Google's Dremel][14]. Designed for low-latency analysis of nested data, Drill has a stated design goal of scaling to 10,000 servers and querying petabytes of data and trillions of records. - -Nested data can be obtained from a variety of data sources (such as HDFS, HBase, Amazon S3, and Azure Blobs) and in multiple formats (including JSON, Avro, and protocol buffers), and you don't need to specify a schema up front (“schema on read”). - -Drill uses ANSI SQL:2003 for its query language, so there's no learning curve for data engineers to overcome, and it allows you to join data across multiple data sources (for example, joining a table in HBase with logs in HDFS). Finally, Drill offers ODBC and JDBC interfaces to connect your favorite BI tools. - --- Steven Nunez - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-hbase-100613951-orig.jpg) - -### HBase ### - -[HBase][15] reached the 1.x milestone this year and continues to improve. Like other nonrelational distributed datastores, HBase excels at returning search results very quickly and for this reason is often used to back search engines, such as the ones at eBay, Bloomberg, and Yahoo. As a stable and mature software offering, HBase does not get fresh features as frequently as newer projects, but that's often good for enterprises. - -Recent improvements include the addition of high-availability region servers, support for rolling upgrades, and YARN compatibility. Features in the works include scanner updates that promise to improve performance and the ability to use HBase as a persistent store for streaming applications like Storm and Spark. HBase can also be queried SQL style via the [Phoenix][16] project, now out of incubation, whose SQL compatibility is steadily improving. Phoenix recently added a Spark connector and the ability to add custom user-defined functions. - --- Steven Nunez - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-hive-100613952-orig.jpg) - -### Hive ### - -Although stable and mature for several years, [Hive][17] reached the 1.0 version milestone this year and continues to be the best solution when really heavy SQL lifting (many petabytes) is required. The community continues to focus on improving the speed, scale, and SQL compliance of Hive. Currently at version 1.2, significant improvements since its last Bossie include full ACID semantics, cross-data center replication, and a cost-based optimizer. - -Hive 1.2 also brought improved SQL compliance, making it easier for organizations to use it to off-load ETL jobs from their existing data warehouses. In the pipeline are speed improvements with an in-memory cache called LLAP (which, from the looks of the JIRAs, is about ready for release), the integration of Spark machine learning libraries, and improved SQL constructs like nonequi joins, interval types, and subqueries. - --- Steven Nunez - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-kylin-100613955-orig.jpg) - -### Kylin ### - -[Kylin][18] is an application developed at eBay for processing very large OLAP cubes via ANSI SQL, a task familiar to most data analysts. If you think about how many items are on sale now and in the past at eBay, and all the ways eBay might want to slice and dice data related to those items, you will begin to understand the types of queries Kylin was designed for. - -Like most other analysis applications, Kylin supports multiple access methods, including JDBC, ODBC, and a REST API for programmatic access. Although Kylin is still in incubation at Apache, and the community nascent, the project is well documented and the developers are responsive and eager to understand customer use cases. Getting up and running with a starter cube was a snap. If you have a need for analysis of extremely large cubes, you should take a look at Kylin. - --- Steven Nunez - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-cdap-100613945-orig.jpg) - -### CDAP ### - -[CDAP][19] (Cask Data Access Platform) is a framework running on top of Hadoop that abstracts away the complexity of building and running big data applications. CDAP is organized around two core abstractions: data and applications. CDAP Datasets are logical representations of data that behave uniformly regardless of the underlying storage layer; CDAP Streams provide similar support for real-time data. - -Applications use CDAP services for things such as distributed transactions and service discovery to shield developers from the low-level details of Hadoop. CDAP comes with a data ingestion framework and a few prebuilt applications and “packs” for common tasks like ETL and website analytics, along with support for testing, debugging, and security. Like most formerly commercial (closed source) projects, CDAP benefits from good documentation, tutorials, and examples. - --- Steven Nunez - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-ranger-100613960-orig.jpg) - -### Ranger ### - -Security has long been a sore spot with Hadoop. It isn’t (as is frequently reported) that Hadoop is “insecure” or “has no security.” Rather, the truth was more that Hadoop had too much security, though not in a good way. I mean that every component had its own authentication and authorization implementation that wasn’t integrated with the rest of platform. - -Hortonworks acquired XA/Secure in May, and [a few renames later][20] we have [Ranger][21]. Ranger pulls many of the key components of Hadoop together under one security umbrella, allowing you to set a “policy” that ties your Hadoop security to your existing ACL-based Active Directory authentication and authorization. Ranger gives you one place to manage Hadoop access control, one place to audit, one place to manage the encryption, and a pretty Web page to do it from. - --- Andrew C. Oliver - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-mesos-100613957-orig.jpg) - -### Mesos ### - -[Mesos][22], developed at the [AMPLab][23] at U.C. Berkeley that also brought us Spark, takes a different approach to managing cluster computing resources. The best way to describe Mesos is as a distributed microkernel for the data center. Mesos provides a minimal set of operating system mechanisms like inter-process communications, disk access, and memory to higher-level applications, called “frameworks” in Mesos-speak, that run in what is analogous to user space. Popular frameworks for Mesos include [Chronos][24] and [Aurora][25] for building ETL pipelines and job scheduling, and a few big data processing applications including Hadoop, Storm, and Spark, which have been ported to run as Mesos frameworks. - -Mesos applications (frameworks) negotiate for cluster resources using a two-level scheduling mechanism, so writing a Mesos application is unlikely to feel like a familiar experience to most developers. Although Mesos is a young project, momentum is growing, and with Spark being an exceptionally good fit for Mesos, we're likely to see more from Mesos in the coming years. - --- Steven Nunez - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-nifi-100613958-orig.jpg) - -### NiFi ### - -[NiFi][26] is an incubating Apache project to automate the flow of data between systems. It doesn't operate in the traditional space that Kafka and Storm do, but rather in the space between external devices and the data center. NiFi was originally developed by the NSA and donated to the open source community in 2014. It has a strong community of developers and users within various government agencies. - -NiFi isn't like anything else in the current big data ecosystem. It is much closer to a tradition EAI (enterprise application integration) tool than a data processing platform, although simple transformations are possible. One interesting feature is the ability to debug and change data flows in real time. Although not quite a REPL (read, eval, print loop), this kind of paradigm dramatically shortens the development cycle by not requiring a compile-deploy-test-debug workflow. Other interesting features include a strong “chain of custody,” where each piece of data can be tracked from beginning to end, along with any changes made along the way. You can also prioritize data flows so that time-sensitive information can be received as quickly as possible, bypassing less time-critical events. - --- Steven Nunez - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-kafka-100613954-orig.jpg) - -### Kafka ### - -[Kafka][27] has emerged as the de-facto standard for distributed publish-subscribe messaging in the big data space. Its design allows brokers to support thousands of clients at high rates of sustained message throughput, while maintaining durability through a distributed commit log. Kafka does this by maintaining what is essentially a single log file in HDFS. Since HDFS is a distributed storage system that keeps redundant copies, Kafka is protected. - -When consumers want to read messages, Kafka looks up their offset in the central log and sends them. Because messages are not deleted immediately, adding consumers or replaying historical messages does not impose additional costs. Kafka has been benchmarked at 2 million writes per second by its developers at LinkedIn. Despite Kafka’s sub-1.0 version number, Kafka is a mature and stable product, in use in some of the largest clusters in the world. - --- Steven Nunez - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-opentsdb-100613959-orig.jpg) - -### OpenTSDB ### - -[OpenTSDB][28] is a time series database built on HBase. It was designed specifically for analyzing data collected from applications, mobile devices, networking equipment, and other hardware devices. The custom HBase schema used to store the time series data has been designed for fast aggregations and minimal storage requirements. - -By using HBase as the underlying storage layer, OpenTSDB gains the distributed and reliable characteristics of that system. Users don't interact with HBase directly; instead events are written to the system via the time series daemon (TSD), which can be scaled out as required to handle high-throughput situations. There are a number of prebuilt connectors to publish data to OpenTSDB, and clients to read data from Ruby, Python, and other languages. OpenTSDB isn't strong on creating interactive graphics, but several third-party tools fill that gap. If you are already using HBase and want a simple way to store event data, OpenTSDB might be just the thing. - --- Steven Nunez - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-jupyter-100613953-orig.jpg) - -### Jupyter ### - -Everybody's favorite notebook application went generic. [Jupyter][29] is “the language-agnostic parts of IPython” spun out into an independent package. Although Jupyter itself is written in Python, the system is modular. Now you can have an IPython-like interface, along with notebooks for sharing code, documentation, and data visualizations, for nearly any language you like. - -At least [50 language][30] kernels are already supported, including LISP, R, Ruby, F#, Perl, and Scala. In fact, even IPython itself is simply a Python module for Jupyter. Communication with the language kernel is via a REPL (read, eval, print loop) protocol, similar to [nREPL][31] or [Slime][32]. It is nice to see such a useful piece of software receiving significant [nonprofit funding][33] to further its development, such as parallel execution and multi-user notebooks. Behold, open source at its best. - --- Steven Nunez - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-zeppelin-100613963-orig.jpg) - -### Zeppelin ### - -While still in incubation, [Apache Zeppelin][34] is nevertheless stirring the data analytics and visualization pot. The Web-based notebook enables users to ingest, discover, analyze, and visualize their data. The notebook also allows you to collaborate with others to make data-driven, interactive documents incorporating a growing number of programming languages. - -This technology also boasts an integration with Spark and an interpreter concept allowing any language or data processing back end to be plugged into Zeppelin. Currently Zeppelin supports interpreters such as Scala, Python, SparkSQL, Hive, Markdown, and Shell. - -Zeppelin is still immature. I wanted to put a demo up but couldn’t find an easy way to disable “shell” as an execution option (among other things). However, it already looks better visually than IPython Notebook, which is the popular incumbent in this space. If you don’t want to spring for DataBricks Cloud or need something open source and extensible, this is the most promising distributed computing notebook around -- especially if you’re a Sparky type. - --- Andrew C. Oliver - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-main-100613956-orig.jpg) - -### Read about more open source winners ### - -InfoWorld's Best of Open Source Awards for 2014 celebrate more than 100 open source projects, from the bottom of the stack to the top. Follow these links to more open source winners: - -[Bossie Awards 2015: The best open source applications][35] - -[Bossie Awards 2015: The best open source application development tools][36] - -[Bossie Awards 2015: The best open source big data tools][37] - -[Bossie Awards 2015: The best open source data center and cloud software][38] - -[Bossie Awards 2015: The best open source desktop and mobile software][39] - -[Bossie Awards 2015: The best open source networking and security software][40] - --------------------------------------------------------------------------------- - -via: http://www.infoworld.com/article/2982429/open-source-tools/bossie-awards-2015-the-best-open-source-big-data-tools.html - -作者:[InfoWorld staff][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.infoworld.com/author/InfoWorld-staff/ -[1]:https://spark.apache.org/ -[2]:http://spark-packages.org/ -[3]:https://storm.apache.org/ -[4]:https://lmax-exchange.github.io/disruptor/ -[5]:http://h2o.ai/product/ -[6]:https://www.datatorrent.com/apex/ -[7]:https://github.com/DataTorrent/Malhar -[8]:https://druid.io/ -[9]:https://flink.apache.org/ -[10]:https://www.elastic.co/products/elasticsearch -[11]:http://lucene.apache.org/ -[12]:http://teiid.jboss.org/ -[13]:https://drill.apache.org/ -[14]:http://research.google.com/pubs/pub36632.html -[15]:http://hbase.apache.org/ -[16]:http://phoenix.apache.org/ -[17]:https://hive.apache.org/ -[18]:https://kylin.incubator.apache.org/ -[19]:http://cdap.io/ -[20]:http://www.infoworld.com/article/2973381/application-development/apache-ranger-chuck-norris-hadoop-security.html -[21]:https://ranger.incubator.apache.org/ -[22]:http://mesos.apache.org/ -[23]:https://amplab.cs.berkeley.edu/ -[24]:http://nerds.airbnb.com/introducing-chronos/ -[25]:http://aurora.apache.org/ -[26]:http://nifi.apache.org/ -[27]:https://kafka.apache.org/ -[28]:http://opentsdb.net/ -[29]:http://jupyter.org/ -[30]:http://https//github.com/ipython/ipython/wiki/IPython-kernels-for-other-languages -[31]:https://github.com/clojure/tools.nrepl -[32]:https://github.com/slime/slime -[33]:http://blog.jupyter.org/2015/07/07/jupyter-funding-2015/ -[34]:https://zeppelin.incubator.apache.org/ -[35]:http://www.infoworld.com/article/2982622/bossie-awards-2015-the-best-open-source-applications.html -[36]:http://www.infoworld.com/article/2982920/bossie-awards-2015-the-best-open-source-application-development-tools.html -[37]:http://www.infoworld.com/article/2982429/bossie-awards-2015-the-best-open-source-big-data-tools.html -[38]:http://www.infoworld.com/article/2982923/bossie-awards-2015-the-best-open-source-data-center-and-cloud-software.html -[39]:http://www.infoworld.com/article/2982630/bossie-awards-2015-the-best-open-source-desktop-and-mobile-software.html -[40]:http://www.infoworld.com/article/2982962/bossie-awards-2015-the-best-open-source-networking-and-security-software.html \ No newline at end of file diff --git a/sources/share/20151028 Bossie Awards 2015--The best open source data center and cloud software.md b/sources/share/20151028 Bossie Awards 2015--The best open source data center and cloud software.md deleted file mode 100644 index 5640c75137..0000000000 --- a/sources/share/20151028 Bossie Awards 2015--The best open source data center and cloud software.md +++ /dev/null @@ -1,261 +0,0 @@ -Bossie Awards 2015: The best open source data center and cloud software -================================================================================ -InfoWorld's top picks of the year in open source platforms, infrastructure, management, and orchestration software - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-data-center-cloud-100613986-orig.jpg) - -### The best open source data center and cloud software ### - -You might have heard about this new thing called Docker containers. Developers love them because you can build them with a script, add services in layers, and push them right from your MacBook Pro to a server for testing. It works because they're superlightweight, unlike those now-archaic virtual machines. Containers -- and other lightweight approaches to deliver services -- are changing the shape of operating systems, applications, and the tools to manage them. Our Bossie winners in data center and cloud are leading the charge. - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-docker-100613987-orig.jpg) - -### Docker Machine, Compose, and Swarm ### - -Docker’s open source container technology has been adopted by the major public clouds and is being built into the next version of Windows Server. Allowing developers and operations teams to separate applications from infrastructure, Docker is a powerful data center automation tool. - -However, containers are only part of the Docker story. Docker also provides a series of tools that allow you to use the Docker API to automate the entire container lifecycle, as well as handling application design and orchestration. - -[Machine][1] allows you to automate the provisioning of Docker Containers. Starting with a command line, you can use a single line of code to target one or more hosts, deploy the Docker engine, and even join it to a Swarm cluster. There’s support for most hypervisors and cloud platforms – all you need are your access credentials. - -[Swarm][2] handles clustering and scheduling, and it can be integrated with Mesos for more advanced scheduling capabilities. You can use Swarm to build a pool of container hosts, allowing your apps to scale out as demand increases. Applications and all of their dependencies can be defined with [Compose][3], which lets you link containers together into a distributed application and launch them as a group. Compose descriptions work across platforms, so you can take a developer configuration and quickly deploy in production. - --- Simon Bisson - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-coreos-rkt-100613985-orig.jpg) - -### CoreOS and Rkt ### - -A thin, lightweight server OS, [CoreOS][4] is based on Google’s Chromium OS. Instead of using a package manager to install functions, it’s designed to be used with Linux containers. By using containers to extend a thin core, CoreOS allows you to quickly deploy applications, working well on cloud infrastructures. - -CoreOS’s container management tooling, fleet, is designed to treat a cluster of CoreOS servers as a single unit, with tools for managing high availability and for deploying containers to the cluster based on resource availability. A cross-cluster key/value store, etcd, handles device management and supports service discovery. If a node fails, etcd can quickly restore state on a new replica, giving you a distributed configuration management platform that’s linked to CoreOS’s automated update service. - -While CoreOS is perhaps best known for its Docker support, the CoreOS team is developing its own container runtime, rkt, with its own container format, the App Container Image. Also compatible with Docker containers, rkt has a modular architecture that allows different containerization systems (even hardware virtualization, in a proof of concept from Intel) to be plugged in. However, rkt is still in the early stages of development, so isn’t quite production ready. - --- Simon Bisson - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-rancheros-100613997-orig.jpg) - -### RancherOS ### - -As we abstract more and more services away from the underlying operating system using containers, we can start thinking about what tomorrow’s operating system will look like. Similar to our applications, it’s going to be a modular set of services running on a thin kernel, self-configuring to offer only the services our applications need. - -[RancherOS][5] is a glimpse of what that OS might look like. Blending the Linux kernel with Docker, RancherOS is a minimal OS suitable for hosting container-based applications in cloud infrastructures. Instead of using standard Linux packaging techniques, RancherOS leverages Docker to host Linux user-space services and applications in separate container layers. A low-level Docker instance is first to boot, hosting system services in their own containers. Users' applications run in a higher-level Docker instance, separate from the system containers. If one of your containers crashes, the host keeps running. - -RancherOS is only 20MB in size, so it's easy to replicate across a data center. It’s also designed to be managed using automation tools, not manually, with API-level access that works with Docker’s management tools as well as with Rancher Labs’ own cloud infrastructure and management tools. - --- Simon Bisson - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-kubernetes-100613991-orig.jpg) - -### Kubernetes ### - -Google’s [Kubernetes][6] container orchestration system is designed to manage and run applications built in Docker and Rocket containers. Focused on managing microservice applications, Kubernetes lets you distribute your containers across a cluster of hosts, while handling scaling and ensuring managed services run reliably. - -With containers providing an application abstraction layer, Kubernetes is an application-centric management service that supports many modern development paradigms, with a focus on user intent. That means you launch applications, and Kubernetes will manage the containers to run within the parameters you set, using the Kubernetes scheduler to make sure it gets the resources it needs. Containers are grouped into pods and managed by a replication engine that can recover failed containers or add more pods as applications scale. - -Kubernetes powers Google’s own Container Engine, and it runs on a range of other cloud and data center services, including AWS and Azure, as well as vSphere and Mesos. Containers can be either loosely or tightly coupled, so applications not designed for cloud PaaS operations can be migrated to the cloud as a tightly coupled set of containers. Kubernetes also supports rapid deployment of applications to a cluster, giving you an endpoint for a continuous delivery process. - --- Simon Bisson - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-mesos-100613993-orig.jpg) - -### Mesos ### - -Turning a data center into a private or public cloud requires more than a hypervisor. It requires a new operating layer that can manage the data center resources as if they were a single computer, handling resources and scheduling. Described as a “distributed systems kernel,” [Apache Mesos][7] allows you to manage thousands of servers, using containers to host applications and APIs to support parallel application development. - -At the heart of Mesos is a set of daemons that expose resources to a central scheduler. Tasks are distributed across nodes, taking advantage of available CPU and memory. One key approach is the ability for applications to reject offered resources if they don’t meet requirements. It’s an approach that works well for big data applications, and you can use Mesos to run Hadoop and Cassandra distributed databases, as well as Apache’s own Spark data processing engine. There’s also support for the Jenkins continuous integration server, allowing you to run build and test workers in parallel on a cluster of servers, dynamically adjusting the tasks depending on workload. - -Designed to run on Linux and Mac OS X, Mesos has also recently been ported to Windows to support the development of scalable parallel applications on Azure. - --- Simon Bisson - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-smartos-100614849-orig.jpg) - -### SmartOS and SmartDataCenter ### - -Joyent’s [SmartDataCenter][8] is the software that runs its public cloud, adding a management platform on top of its [SmartOS][9] thin server OS. A descendent of OpenSolaris that combines Zones containers and the KVM hypervisor, SmartOS is an in-memory operating system, quick to boot from a USB stick and run on bare-metal servers. - -Using SmartOS, you can quickly deploy a set of lightweight servers that can be programmatically managed via a set of JSON APIs, with functionality delivered via virtual machines, downloaded by built-in image management tools. Through the use of VMs, all userland operations are isolated from the underlying OS, reducing the security exposure of both the host and guests. - -SmartDataCenter runs on SmartOS servers, with one server running as a dedicated management node, and the rest of a cluster operating as compute nodes. You can get started with a Cloud On A Laptop build (available as a VMware virtual appliance) that lets you experiment with the management server. In a live data center, you’ll deploy SmartOS on your servers, using ZFS to handle storage – which includes your local image library. Services are deployed as images, with components stored in an object repository. - -The combination of SmartDataCenter and SmartOS builds on the experience of Joyent’s public cloud, giving you a tried and tested set of tools that can help you bootstrap your own cloud data center. It’s an infrastructure focused on virtual machines today, but laying the groundwork for tomorrow. A related Joyent project, [sdc-docker][10], exposes an entire SmartDataCenter cluster as a single Docker host, driven by native Docker commands. - --- Simon Bisson - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-sensu-100614850-orig.jpg) - -### Sensu ### - -Managing large-scale data centers isn’t about working with server GUIs, it’s about automating scripts based on information from monitoring tools and services, routing information from sensors and logs, and then delivering actions to applications. One tool that’s beginning to offer this functionality is [Sensu][11], often described as a “monitoring router.” - -Scripts running across your data center deliver information to Sensu, which then routes it to the appropriate handler, using a publish-and-subscribe architecture based on RabbitMQ. Servers can be distributed, delivering published check results to handler code. You might see results in email, or in a Slack room, or in Sensu’s own dashboards. Message formats are defined in JSON files, or mutators used to format data on the fly, and messages can be filtered to one or more event handlers. - -Sensu is still a relatively young tool, but it’s one that shows a lot of promise. If you’re going to automate your data center, you’re going to need a tool like this not only to show you what’s happening, but to deliver that information where it’s most needed. A commercial option adds support for integration with third-party applications, but much of what you need to manage a data center is in the open source release. - --- Simon Bisson - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-prometheus-100613996-orig.jpg) - -### Prometheus ### - -Managing a modern data center is a complex task. Racks of servers need to be treated like cattle rather than pets, and you need a monitoring system designed to handle hundreds and thousands of nodes. Monitoring applications presents special challenges, and that’s where [Prometheus][12] comes in to play. A service monitoring system designed to deliver alerts to operators, Prometheus can run on everything from a single laptop to a highly available cluster of monitoring servers. - -Time series data is captured and stored, then compared against patterns to identify faults and problems. You’ll need to expose data on HTTP endpoints, using a YAML file to configure the server. A browser-based reporting tool handles displaying data, with an expression console where you can experiment with queries. Dashboards can be created with a GUI builder, or written using a series of templates, letting you deliver application consoles that can be managed using version control systems such as Git. - -Captured data can be managed using expressions, which make it easy to aggregate data from several sources -- for example, letting you bring performance data from a series of Web endpoints into one store. An experimental alert manager module delivers alerts to common collaboration and devops tools, including Slack and PagerDuty. Official client libraries for common languages like Go and Java mean it’s easy to add Prometheus support to your applications and services, while third-party options extend Prometheus to Node.js and .Net. - --- Simon Bisson - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-elk-100613988-orig.jpg) - -### Elasticsearch, Logstash, and Kibana ### - -Running a modern data center generates a lot of data, and it requires tools to get information out of that data. That’s where the combination of Elasticsearch, Logstash, and Kibana, often referred to as the ELK stack, comes into play. - -Designed to handle scalable search across a mix of content types, including structured and unstructured documents, [Elasticsearch][13] builds on Apache’s Lucene information retrieval tools, with a RESTful JSON API. It’s used to provide search for sites like Wikipedia and GitHub, using a distributed index with automated load balancing and routing. - -Under the fabric of a modern cloud is a physical array of servers, running as VM hosts. Monitoring many thousands of servers needs centralized logs. [Logstash][14] harvests and filters the logs generated by those servers (and by the applications running on them), using a forwarder on each physical and virtual machine. Logstash-formatted data is then delivered to Elasticsearch, giving you a search index that can be quickly scaled as you add more servers. - -At a higher level, [Kibana][15] adds a visualization layer to Elasticsearch, providing a Web dashboard for exploring and analyzing the data. Dashboards can be created around custom searches and shared with your team, providing a quick, easy-to-digest devops information feed. - --- Simon Bisson - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-ansible-100613984-orig.jpg) - -### Ansible ### - -Managing server configuration is a key element of any devops approach to managing a modern data center or a cloud infrastructure. Configuration management tooling that takes a desired state approach to simplifies systems management at cloud scale, using server and application descriptions to handle server and application deployment. - -[Ansible][16] offers a minimal management service, using SSH to manage Unix nodes and PowerShell to work with Windows servers, with no need to deploy agents. An Ansible Playbook describes the state of a server or service in YAML, deploying Ansible modules to servers that handle configuration and removing them once the service is running. You can use Playbooks to orchestrate tasks -- for example, deploying several Web endpoints with a single script. - -It’s possible to make module creation and Playbook delivery part of a continuous delivery process, using build tools to deliver configurations and automate deployment. Ansible can pull in information from cloud service providers, simplifying management of virtual machines and networks. Monitoring tools in Ansible are able to trigger additional deployments automatically, helping manage and control cloud services, as well as working to manage resources used by large-scale data platforms like Hadoop. - --- Simon Bisson - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-jenkins-100613990-orig.jpg) - -### Jenkins ### - -Getting continuous delivery right requires more than a structured way of handling development; it also requires tools for managing test and build. That’s where the [Jenkins][17] continuous integration server comes in. Jenkins works with your choice of source control, your test harnesses, and your build server. It’s a flexible tool, initially designed for working with Java but now extended to support Web and mobile development and even to build Windows applications. - -Jenkins is perhaps best thought of as a switching network, shunting files through a test and build process, and responding to signals from the various tools you’re using – thanks to a library of more than 1,000 plug-ins. These include tools for integrating Jenkins with both local Git instances and GitHub so that it's possible to extend a continuous development model into your build and delivery processes. - -Using an automation tool like Jenkins is as much about adopting a philosophy as it is about implementing a build process. Once you commit to continuous integration as part of a continuous delivery model, you’ll be running test and build cycles as soon as code is delivered to your source control release branch – and delivering it to users as soon as it’s in the main branch. - --- Simon Bisson - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-nodejs-iojs-100613995-orig.jpg) - -### Node.js and io.js ### - -Modern cloud applications are built using different design patterns from the familiar n-tier enterprise and Web apps. They’re distributed, event-driven collections of services that can be quickly scaled and can support many thousands of simultaneous users. One key technology in this new paradigm is [Node.js][18], used by many major cloud platforms and easy to install as part of a thin server or container on cloud infrastructure. - -Key to the success of Node.js is the Npm package format, which allows you to quickly install extensions to the core Node.js service. These include frameworks like Express and Seneca, which help build scalable applications. A central registry handles package distribution, and dependencies are automatically installed. - -While the [io.js][19] fork exposed issues with project governance, it also allowed a group of developers to push forward adding ECMAScript 6 support to an Npm-compatible engine. After reconciliation between the two teams, the Node.js and io.js codebases have been merged, with new releases now coming from the io.js code repository. - -Other forks, like Microsoft’s io.js fork to add support for its 64-bit Chakra JavaScript engine alongside Google’s V8, are likely to be merged back into the main branch over the next year, keeping the Node.js platform evolving and cementing its role as the preferred host for cloud-scale microservices. - --- Simon Bisson - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-seneca-100613998-orig.jpg) - -### Seneca ### - -The developers of the [Seneca][20] microservice framework have a motto: “Build it now, scale it later!” It’s an apt maxim for anyone thinking about developing microservices, as it allows you to start small, then add functionality as your service grows. - -Seneca is at heart an implementation of the [actor/message design pattern][21], focused on using Node.js as a switching engine that takes in messages, processes their contents, and sends an appropriate response, either to the message originator or to another service. By focusing on the message patterns that map to business use cases, it’s relatively easy to take Seneca and quickly build a minimum viable product for your application. A plug-in architecture makes it easy to integrate Seneca with other tools and to quickly add functionality to your services. - -You can easily add new patterns to your codebase or break existing patterns into separate services as the needs of your application grow or change. One pattern can also call another, allowing quick code reuse. It’s also easy to add Seneca to a message bus, so you can use it as a framework for working with data from Internet of things devices, as all you need to do is define a listening port where JSON data is delivered. - -Services may not be persistent, and Seneca gives you the option of using a built-in object relational mapping layer to handle data abstraction, with plug-ins for common databases. - --- Simon Bisson - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-netcore-aspnet-100613994-orig.jpg) - -### .Net Core and ASP.Net vNext ### - -Microsoft’s [open-sourcing of .Net][22] is bringing much of the company’s Web platform into the open. The new [.Net Core][23] release runs on Windows, on OS X, and on Linux. Currently migrating from Microsoft’s Codeplex repository to GitHub, .Net Core offers a more modular approach to .Net, allowing you to install the functions you need as you need them. - -Currently under development is [ASP.Net 5][24], an open source version of the Web platform, which runs on .Net Core. You can work with it as the basis of Web apps using Microsoft’s MVC 6 framework. There’s also support for the new SignalR libraries, which add support for WebSockets and other real-time communications protocols. - -If you’re planning on using Microsoft’s new Nano server, you’ll be writing code against .Net Core, as it’s designed for thin environments. The new DNX, the .Net Execution environment, simplifies deployment of ASP.Net applications on a wide range of platforms, with tools for packaging code and for booting a runtime on a host. Features are added using the NuGet package manager, letting you use only the libraries you want. - -Microsoft’s open source .Net is still very young, but there’s a commitment in Redmond to ensure it’s successful. Support in Microsoft’s own next-generation server operating systems means it has a place in both the data center and the cloud. - --- Simon Bisson - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-glusterfs-100613989-orig.jpg) - -### GlusterFS ### - -[GlusterFS][25] is a distributed file system. Gluster aggregates various storage servers into one large parallel network file system. You can [even use it in place of HDFS in a Hadoop cluster][26] or in place of an expensive SAN system -- or both. While HDFS is great for Hadoop, having a general-purpose distributed file system that doesn’t require you to transfer data to another location to analyze it is a key advantage. - -In an era of commoditized hardware, commoditized computing, and increased performance and latency requirements, buying a big, fat expensive EMC SAN and hoping it fits all of your needs (it won’t) is no longer your sole viable option. GlusterFS was acquired by Red Hat in 2011. - --- Andrew C. Oliver - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-main-100613992-orig.jpg) - -### Read about more open source winners ### - -InfoWorld's Best of Open Source Awards for 2014 celebrate more than 100 open source projects, from the bottom of the stack to the top. Follow these links to more open source winners: - -[Bossie Awards 2015: The best open source applications][27] - -[Bossie Awards 2015: The best open source application development tools][28] - -[Bossie Awards 2015: The best open source big data tools][29] - -[Bossie Awards 2015: The best open source data center and cloud software][30] - -[Bossie Awards 2015: The best open source desktop and mobile software][31] - -[Bossie Awards 2015: The best open source networking and security software][32] - --------------------------------------------------------------------------------- - -via: http://www.infoworld.com/article/2982923/open-source-tools/bossie-awards-2015-the-best-open-source-data-center-and-cloud-software.html - -作者:[InfoWorld staff][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.infoworld.com/author/InfoWorld-staff/ -[1]:https://www.docker.com/docker-machine -[2]:https://www.docker.com/docker-swarm -[3]:https://www.docker.com/docker-compose -[4]:https://coreos.com/ -[5]:http://rancher.com/rancher-os/ -[6]:http://kubernetes.io/ -[7]:https://mesos.apache.org/ -[8]:https://github.com/joyent/sdc -[9]:https://smartos.org/ -[10]:https://github.com/joyent/sdc-docker -[11]:https://sensuapp.org/ -[12]:http://prometheus.io/ -[13]:https://www.elastic.co/products/elasticsearch -[14]:https://www.elastic.co/products/logstash -[15]:https://www.elastic.co/products/kibana -[16]:http://www.ansible.com/home -[17]:https://jenkins-ci.org/ -[18]:https://nodejs.org/en/ -[19]:https://iojs.org/en/ -[20]:http://senecajs.org/ -[21]:http://www.infoworld.com/article/2976422/application-development/how-to-use-actors-in-distributed-applications.html -[22]:http://www.infoworld.com/article/2846450/microsoft-net/microsoft-open-sources-server-side-net-launches-visual-studio-2015-preview.html -[23]:https://dotnet.github.io/core/ -[24]:http://www.asp.net/vnext -[25]:http://www.gluster.org/ -[26]:http://www.gluster.org/community/documentation/index.php/Hadoop -[27]:http://www.infoworld.com/article/2982622/bossie-awards-2015-the-best-open-source-applications.html -[28]:http://www.infoworld.com/article/2982920/bossie-awards-2015-the-best-open-source-application-development-tools.html -[29]:http://www.infoworld.com/article/2982429/bossie-awards-2015-the-best-open-source-big-data-tools.html -[30]:http://www.infoworld.com/article/2982923/bossie-awards-2015-the-best-open-source-data-center-and-cloud-software.html -[31]:http://www.infoworld.com/article/2982630/bossie-awards-2015-the-best-open-source-desktop-and-mobile-software.html -[32]:http://www.infoworld.com/article/2982962/bossie-awards-2015-the-best-open-source-networking-and-security-software.html \ No newline at end of file diff --git a/sources/share/20151028 Bossie Awards 2015--The best open source desktop and mobile software.md b/sources/share/20151028 Bossie Awards 2015--The best open source desktop and mobile software.md deleted file mode 100644 index 83b2b24a2e..0000000000 --- a/sources/share/20151028 Bossie Awards 2015--The best open source desktop and mobile software.md +++ /dev/null @@ -1,223 +0,0 @@ -Bossie Awards 2015: The best open source desktop and mobile software -================================================================================ -InfoWorld's top picks in open source productivity tools, desktop utilities, and mobile apps - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-desktop-mobile-100614439-orig.jpg) - -### The best open source desktop and mobile software ### - -Open source on the desktop has a long and distinguished history, and many of our Bossie winners in this category go back many years. Packed with features and still improving, some of these tools offer compelling alternatives to pricey commercial software. Others are utilities that we lean on daily for one reason or another -- the can openers and potato peelers of desktop productivity. One or two of them either plug holes in Windows, or they go the distance where Windows falls short. - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-libreoffice-100614436-orig.jpg) - -### LibreOffice ### - -With the major release of version 5 in August, the Document Foundation’s [LibreOffice][1] offers a completely redesigned user interface, better compatibility with Microsoft Office (including good-but-not-great DOCX, XLSX, and PPTX file format support), and significant improvements to Calc, the spreadsheet application. - -Set against a turbulent background, the LibreOffice effort split from OpenOffice.org in 2010. In 2011, Oracle announced it would no longer support OpenOffice.org, and handed the trademark to the Apache Software Foundation. Since then, it has become [increasingly clear][2] that LibreOffice is winning the race for developers, features, and users. - --- Woody Leonhard - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-firefox-100614426-orig.jpg) - -### Firefox ### - -In the battle of the big browsers, [Firefox][3] gets our vote over its longtime open source rival Chromium for two important reasons: - -• **Memory use**. Chromium, like its commercial cousin Chrome, has a nasty propensity to glom onto massive amounts of memory. - -• **Privacy**. Witness the [recent controversy][4] over Chromium automatically downloading a microphone snooping program to respond to “OK, Google.” - -Firefox may not have the most features or the down-to-the-millisecond fastest rendering engine. But it’s solid, stingy with resources, highly extensible, and most of all, it comes with no strings attached. There’s no ulterior data-gathering motive. - --- Woody Leonhard - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-thunderbird-100614433-orig.jpg) - -### Thunderbird ### - -A longtime favorite email client, Mozilla’s [Thunderbird][5], may be getting a bit long in the tooth, but it’s still supported and showing signs of life. The latest version, 38.2, arrived in August, and there are plans for more development. - -Mozilla officially pulled its people off the project back in July 2012, but a hardcore group of volunteers, led by Kent James and the all-volunteer Thunderbird Council, continues to toil away. While you won’t find the latest email innovations in Thunderbird, you will find a solid core of basic functions based on local storage. If having mail in the cloud spooks you, it’s a good, private alternative. And if James goes ahead with his idea of encrypting Thunderbird mail end-to-end, there may be significant new life in the old bird. - --- Woody Leonhard - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-notepad-100614432-orig.jpg) - -### Notepad++ ### - -If Windows Notepad handles all of your text editing (and source code editing and HTML editing) needs, more power to ya. For Windows users who yearn for a little bit more in a text editor, there’s Don Ho’s [Notepad++][6], which is the editor I turn to, over and over again. - -With tabbed views, drag-and-drop, color-coded hints for completing HTML commands, bookmarks, macro recording, shortcut keys, and every text encoding format you’re likely to encounter, Notepad++ takes text to a new level. We get frequent updates, too, with the latest in August. - --- Woody Leonhard - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-vlc-100614435-orig.jpg) - -### VLC ### - -The stalwart [VLC][7] (formerly known as VideoLan Client) runs almost any kind of media file on almost any platform. Yes, it even works as a remote control on Apple Watch. - -The tiled Universal app version for Windows 10, in the Windows Store, draws some criticism for instability and lack of control, but in most cases VLC works, and it works well -- without external codecs. It even supports Blu-ray formats with two new libraries. - -The desktop version is a must-have for Windows 10, unless you’re ready to run the advertising gauntlets that are the Universal Groove Music and Movies & TV apps from Microsoft. VLC received a major [feature update][8] in February and a comprehensive bug fix in April. - --- Woody Leonhard - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-7-zip-100614429-orig.jpg) - -### 7-Zip ### - -Long recognized as the preeminent open source ZIP archive manager for Windows, [7-Zip][9] works like a champ, even on the Windows 10 desktop. Full coverage for RAR files, which can be problematic in Windows, combine with password-protected file creation and support for self-extracting ZIPs. It’s one of those programs that just works. - -Yes, it would be nice to get a more modern file picker. Yes, it would be interesting to see a tiled Universal app version. But even without the fancy bells and whistles, 7-Zip deserves a place on every Windows desktop. - --- Woody Leonhard - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-handbrake-100614427-orig.jpg) - -### Handbrake ### - -If you want to convert your DVDs (or video files in any commonly used format) into a file in some other format, or simply scrape them off a silver coaster, [Handbrake][10] is the way to do it. If you’re a Windows user, Handbrake is almost indispensible, since Microsoft doesn’t believe in ripping DVDs. - -Handbrake presents a number of handy presets for optimizing conversions for your target device (iPod, iPad, Android Tablet, and so on) It’s simple, and it’s fast. With the latest round of bug fixes released in June, Handbrake’s keeping up on maintenance -- and it works fine on the Windows 10 desktop. - --- Woody Leonhard - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-keepass-100614430-orig.jpg) - -### KeePass ### - -I’ll confess that I almost gave up on [KeePass][11] because the primary download site goes to Sourceforge. That means you have to be extremely careful which boxes are checked and what you click on (and when) as you attempt to download and install the software. While KeePass itself is 100 percent clean open source (GNU GPL), Sourceforge doesn’t feel so constrained, and its [installers reek of crapware][12]. - -One of many local-file password storage programs, KeePass distinguishes itself with broad scope, as well as its ability to run on all sorts of platforms, no installation required. KeePass will save not only passwords, but also credit card information and freely structured information. It provides a strong random password generator, and the database itself is locked with AES and Twofish, so nobody’s going to crack it. And it’s kept up to date, with a new stable release last month. - --- Woody Leonhard - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-virtualbox-100614434-orig.jpg) - -### VirtualBox ### - -With a major release published in July, Oracle’s open source [VirtualBox][13] -- available for Windows, OS X, Linux, even Solaris --continues to give commercial counterparts VMware Workstation, VMware Fusion, Parallels Desktop, and Microsoft’s Hyper-V a hard run for their money. The Oracle team is still getting the final Windows 10 bugs ironed out, but come to think of it, so is Microsoft. - -VirtualBox doesn’t quite match the performance or polish of the VMware and Parallels products, but it’s getting closer. Version 5 brought long-awaited drag-and-drop support, making it easier to move files between VMs and host. - -I prefer VirtualBox over Hyper-V because it’s easy to control external devices. In Hyper-V, for example, getting sound to work is a pain in the neck, but in VirtualBox it only takes a click in setup. The shared clipboard between VM and host works wonders. Running speed on both is roughly the same, with a slight advantage to Hyper-V. But managing VirtualBox machines is much easier. - --- Woody Leonhard - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-inkscape-100614428-orig.jpg) - -### Inkscape ### - -If you stand in awe of the designs created with Adobe Illustrator (or even CorelDraw), take a close look at [Inkscape][14]. Scalable vector images never looked so good. - -Version 0.91, released in January, uses a new internal graphics rendering engine called Cairo, sponsored by Google, to make the app run faster and allow for more accurate rendering. Inkscape will read and write SVG, PNG, PDF, even EPS, and many other formats. It can export Flash XML Graphics, HTML5 Canvas, and XAML, among others. - -There’s a strong community around Inkscape, and it’s built for easy extensibility. It’s available for Windows, OS X, and Linux. - --- Woody Leonhard - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-keepassdroid-100614431-orig.jpg) - -### KeePassDroid ### - -Trying to remember all of the passwords we need today is impossible, and creating new ones to meet stringent password policy requirements can be agonizing. A port of KeePass for Android, [KeePassDroid][15] brings sanity preserving password management to mobile devices. - -Like KeyPass, KeyPassDroid makes creating and accessing passwords easy, requiring you to recall only a single master password. It supports both DES and Twofish algorithms for encrypting all passwords, and it goes a step further by encrypting the entire password database, not only the password fields. Notes and other password pertinent information are encrypted too. - -While KeePassDroid's interface is minimal -- dated, some would say -- it gets the job done with bare-bones efficiency. Need to generate passwords that have certain character sets and lengths? KeePassDroid can do that with ease. With more than a million downloads on the Google Play Store, you could say this app definitely fills a need. - --- Victor R. Garza - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-prey-100615300-orig.jpg) - -### Prey ### - -Loss or theft of mobile devices is all too common these days. While there are many tools in the enterprise to manage and erase data either misplaced or stolen from an organization, [Prey][16] facilitates the recovery of the phone, laptop, or tablet, and not just the wiping of potentially sensitive information from the device. - -Prey is a Web service that works with an open source installed agent for Linux, OS X, Windows, Android, and iOS devices. Prey tracks your lost or stolen device by using either the device's GPS, the native geolocation provided by newer operating systems, or an associated Wi-Fi hotspot to home in on the location. - -If your smartphone is lost or stolen, send a text message to the device to activate Prey. For stolen tablets or laptops, use the Prey Project's cloud-based control panel to select the device as missing. The Prey agent on any device can then take a screenshot of the active applications, turn on the camera to catch a thief's image, reset the device to the factory settings, or fully lock down the device. - -Should you want to retrieve your lost items, the Prey Project strongly suggests you contact your local police to have them assist you. - --- Victor R. Garza - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-orbot-100615299-orig.jpg) - -### Orbot ### - -The premiere proxy application for Android, [Orbot][17] leverages the volunteer-operated network of virtual tunnels called Tor (The Onion Router) to keep all communications private. Orbot works with companion applications [Orweb][18] for secure Web browsing and [ChatSecure][19] for secure chat. In fact, any Android app that allows its proxy settings to be changed can be secured with Orbot. - -One thing to remember about the Tor network is that it's designed for secure, lightweight communications, not for pulling down torrents or watching YouTube videos. Surfing media-rich sites like Facebook can be painfully slow. Your Orbot communications won't be blazing fast, but they will stay private and confidential. - --- Victor R. Garza - -![](http://images.techhive.com/images/article/2015/09/bossies-2015-tails-100615301-orig.jpg) - -### Tails ### - -[Tails][20], or The Amnesic Incognito Live System, is a Linux Live OS that can be booted from a USB stick, DVD, or SD card. It’s often used covertly in the Deep Web to secure traffic when purchasing illicit substances, but it can also be used to avoid tracking, support freedom of speech, circumvent censorship, and promote liberty. - -Leveraging Tor (The Onion Router), Tails keeps all communications secure and private and promises to leave no trace on any computer after it’s used. It performs disk encryption with LUKS, protects instant messages with OTR, encrypts Web traffic with the Tor Browser and HTTPS Everywhere, and securely deletes files via Nautilus Wipe. Tails even has an office suite, image editor, and the like. - -Now, it's always possible to be traced while using any system if you're not careful, so be vigilant when using Tails and follow good privacy practices, like turning off JavaScript while using Tor. And be aware that Tails isn't necessarily going to be speedy, even while using a fiber connect, but that's what you pay for anonymity. - --- Victor R. Garza - -![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-main-100614438-orig.jpg) - -### Read about more open source winners ### - -InfoWorld's Best of Open Source Awards for 2014 celebrate more than 100 open source projects, from the bottom of the stack to the top. Follow these links to more open source winners: - -[Bossie Awards 2015: The best open source applications][21] - -[Bossie Awards 2015: The best open source application development tools][22] - -[Bossie Awards 2015: The best open source big data tools][23] - -[Bossie Awards 2015: The best open source data center and cloud software][24] - -[Bossie Awards 2015: The best open source desktop and mobile software][25] - -[Bossie Awards 2015: The best open source networking and security software][26] - --------------------------------------------------------------------------------- - -via: http://www.infoworld.com/article/2982630/open-source-tools/bossie-awards-2015-the-best-open-source-desktop-and-mobile-software.html - -作者:[InfoWorld staff][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.infoworld.com/author/InfoWorld-staff/ -[1]:https://www.libreoffice.org/download/libreoffice-fresh/ -[2]:http://lwn.net/Articles/637735/ -[3]:https://www.mozilla.org/en-US/firefox/new/ -[4]:https://nakedsecurity.sophos.com/2015/06/24/not-ok-google-privacy-advocates-take-on-the-chromium-team-and-win/ -[5]:https://www.mozilla.org/en-US/thunderbird/ -[6]:https://notepad-plus-plus.org/ -[7]:http://www.videolan.org/vlc/index.html -[8]:http://www.videolan.org/press/vlc-2.2.0.html -[9]:http://www.7-zip.org/ -[10]:https://handbrake.fr/ -[11]:http://keepass.info/ -[12]:http://www.infoworld.com/article/2931753/open-source-software/sourceforge-the-end-cant-come-too-soon.html -[13]:https://www.virtualbox.org/ -[14]:https://inkscape.org/en/download/windows/ -[15]:http://www.keepassdroid.com/ -[16]:http://preyproject.com/ -[17]:https://www.torproject.org/docs/android.html.en -[18]:https://guardianproject.info/apps/orweb/ -[19]:https://guardianproject.info/apps/chatsecure/ -[20]:https://tails.boum.org/ -[21]:http://www.infoworld.com/article/2982622/bossie-awards-2015-the-best-open-source-applications.html -[22]:http://www.infoworld.com/article/2982920/bossie-awards-2015-the-best-open-source-application-development-tools.html -[23]:http://www.infoworld.com/article/2982429/bossie-awards-2015-the-best-open-source-big-data-tools.html -[24]:http://www.infoworld.com/article/2982923/bossie-awards-2015-the-best-open-source-data-center-and-cloud-software.html -[25]:http://www.infoworld.com/article/2982630/bossie-awards-2015-the-best-open-source-desktop-and-mobile-software.html -[26]:http://www.infoworld.com/article/2982962/bossie-awards-2015-the-best-open-source-networking-and-security-software.html \ No newline at end of file diff --git a/sources/talk/20150709 Interviews--Linus Torvalds Answers Your Question.md b/sources/talk/20150709 Interviews--Linus Torvalds Answers Your Question.md deleted file mode 100644 index c27e90fd7d..0000000000 --- a/sources/talk/20150709 Interviews--Linus Torvalds Answers Your Question.md +++ /dev/null @@ -1,186 +0,0 @@ -[translating by ray] - -Interviews: Linus Torvalds Answers Your Question -================================================================================ -Last Thursday you had a chance to [ask Linus Torvalds][1] about programming, hardware, and all things Linux. You can read his answers to those questions below. If you'd like to see what he had to say the last time we sat down with him, [you can do so here][2]. - -**Productivity** -by DoofusOfDeath - -> You've somehow managed to originate two insanely useful pieces of software: Linux, and Git. Do you think there's anything in your work habits, your approach to choosing projects, etc., that have helped you achieve that level of productivity? Or is it just the traditional combination of talent, effort, and luck? - -**Linus**: I'm sure it's pretty much always that "talent, effort and luck". I'll leave it to others to debate how much of each... - -I'd love to point out some magical work habit that makes it all happen, but I doubt there really is any. Especially as the work habits I had wrt the kernel and Git have been so different. - -With Git, I think it was a lot about coming at a problem with fresh eyes (not having ever really bought into the traditional SCM mindset), and really trying to think about the issues, and spending a fair amount of time thinking about what the real problems were and what I wanted the design to be. And then the initial self-hosting code took about a day to write (ok, that was "self-hosting" in only the weakest sense, but still). - -And with Linux, obviously, things were very different - the big designs came from the outside, and it took half a year to host itself, and it hadn't even started out as a kernel to begin with. Clearly not a lot of thinking ahead and planning involved ;). So very different circumstances indeed. - -What both the kernel and Git have, and what I think is really important (and I guess that counts as a "work habit"), is a maintainer that stuck to it, and was responsive, responsible and sane. Too many projects falter because they don't have people that stick with them, or have people who have an agenda that doesn't match reality or the user expectations. - -But it's very important to point out that for Git, that maintainer was not me. Junio Hamano really should get pretty much all the credit for Git. Credit where credit is due. I'll take credit for the initial implementation and design of Git - it may not be perfect, but ten years on it still is very solid and very clearly the same basic design. But I'll take even _more_ credit for recognizing that Junio had his head screwed on right, and was the person to drive the project. And all the rest of the credit goes to him. - -Of course, that kind of segues into something else the kernel and Git do have in common: while I still maintain the kernel, I did end up finding a lot of smart people to maintain all the different parts of it. So while one important work habit is that "stick to it" persistence that you need to really take a project from a not-quite-usable prototype to something bigger and better, another important work-habit is probably to also "let go" and not try to own and control the project too much. Let other people really help you - guide the process but don't get in their way. - -**init system** -by lorinc - -> There wasn't a decent unix-like kernel, you wrote one which ultimately became the most used. There wasn't a decent version control software, you wrote one which ultimately became the most love. Do you think we already have a decent init system, or do you have plan to write one that will ultimately settle the world on that hot topic? - -**Linus**: You can say the word "systemd", It's not a four-letter word. Seven letters. Count them. - -I have to say, I don't really get the hatred of systemd. I think it improves a lot on the state of init, and no, I don't see myself getting into that whole area. - -Yeah, it may have a few odd corners here and there, and I'm sure you'll find things to despise. That happens in every project. I'm not a huge fan of the binary logging, for example. But that's just an example. I much prefer systemd's infrastructure for starting services over traditional init, and I think that's a much bigger design decision. - -Yeah, I've had some personality issues with some of the maintainers, but that's about how you handle bug reports and accept blame (or not) for when things go wrong. If people thought that meant that I dislike systemd, I will have to disappoint you guys. - -**Can Valve change the Linux gaming market?** -by Anonymous Coward - -> Do you think Valve is capable of making Linux a primary choice for gamers? - -**Linus**: "Primary"? Probably not where it's even aiming. I think consoles (and all those handheld and various mobile platforms that "real gamers" seem to dismiss as toys) are likely much more primary, and will stay so. - -I think Valve wants to make sure they can control their own future, and Linux and ValveOS is probably partly to explore a more "console-like" Valve experience (ie the whole "get a box set up for a single main purpose", as opposed to a more PC-like experience), and partly as a "second source" against Microsoft, who is a competitor in the console area. Keeping your infrastructure suppliers honest by making sure you have alternatives sounds like a good strategy, and particularly so when those suppliers may be competing with you directly elsewhere. - -So I don't think the aim is really "primary". "Solid alternative" is I think the aim. Of course, let's see where it goes after that. - -But I really have not been involved. People like Greg and the actual graphics driver guys have been in much more direct contact with Valve. I think it's great to see gaming on Linux, but at the same time, I'm personally not really much of a gamer. - -**The future of RT-Linux?** -by nurhussein - -> According to Thomas Gleixner, [the future of the realtime patchset to Linux is in doubt][2], as it is difficult to secure funding from interested parties on this functionality even though it is both useful and important: What are your thoughts on this, and what do you think we need to do to get more support behind the RT patchset, especially considering Linux's increasing use in embedded systems where realtime functionality is undoubtedly useful. - -**Linus**: So I think this is one of those things where the markets decide how important rtLinux ends up being, and I suspect there are more than enough companies who end up wanting and using rtLinux that the project isn't really going anywhere. The complaints by Thomas were - I think - a wake-up call to the companies who end up wanting the extended hard realtime patches. - -So I suspect there are companies and groups like OSADL that end up funding and helping with rtLinux, and that it isn't going away. - -**Rigor and developments** -by hcs_$reboot - -> The most complex program running on a machine is arguably its OS, especially the kernel. Linux (kernel) reached the top level in terms of performance, reliability and versatility. You have been criticized quite a few times for some virulent mails addressed to developers. Do you think Linux would be where it is without managing the project with an iron fist? To go further, do you think some other main OSS project would benefit from a more rigorous management approach? - -**Linus**: One of the nice things about open source is how it allows people to really concentrate on what they are good at, and it has been a huge advantage for Linux that we've had people who are interested in the marketing side and selling Linux, as well as the legal side etc. - -And that is all in addition, of course, to the original "we're motivated by the technology" people like me. And even within that "we're motivated by technology" group, you most certainly don't need to find _everything_ interesting, you can find the area you are passionate about and really care about and want to work on. - -That's _fundamentally_ how open source works. - -Now, if somebody is passionate about some "good management" thing, go wild, and try to get involved, and try to manage things. It's not what _I_ am interested in, but hey, the proof is in the pudding - anybody who thinks they have a new rigorous management approach that they think will help some part of the process, go wild. - -Now, I personally suspect that it wouldn't work - not only are tech people an ornery lot to begin with (that whole "herding cats" thing), just look at all the crazy arguments on the internet. And ask yourself what actually holds an open source project like the kernel together? I think you need to be very oriented towards the purely technical solutions, simply because then you have tangible and real issues you can discuss (and argue about) with fairly clear-cut hard answers. It's the only thing people can really agree on in the big picture. - -So the Linux approach to "management" has been to put technology first. That's rigorous enough for me. But as mentioned, it's a free-for-all. Anybody can come in and try to do better. Really. - -And btw, it's worth noting that there are obviously specific smaller development teams where other management models work fine. Most of the individual developers are parts of teams inside particular companies, and within the confines of that company, there may well be a very strict rigorous management model. Similarly, within the confines of a particular productization effort there may be particular goals and models for that particular team that transcend that general "technical issues" thing. - -Just to give a concrete example, the "development kernel" tree that I maintain works fundamentally differently and with very different rules from the "stable tree" that Greg does, which in turn is maintained very differently from what a distribution team within a Linux company does inside its maintenance kernel team. - -So there's certainly room for different approaches to managing those very different groups. But do I think you can "rigorously manage" people on the internet? No. - -**Functional languages?** -by EmeraldBot - -> While historically you've been a C and Assembly guy (and the odd shell scripting and such), what do you think of functional languages such as Lisp, Closure, Haskell, etc? Do you see any advantages to them, or do you view them as frivolous and impractical? If you decide to do so, thanks for taking the time to answer my question! You're a legend at what you do, and I think it's awesome that the significantly less interesting me can ask you a question like this. - -**Linus**: I may be a fan of C (with a certain fondness for assembly, just because it's so close to the machine), but that's very much about a certain context. I work at a level where those languages make sense. I certainly don't think that tools like Haskell etc are "frivolous and impractical" in general, although on a kernel level (or in a source control management system) I suspect they kind of are. - -Many moons ago I worked on sparse (the C parser and analyzer), and one of my coworkers was a Haskell fan, and did incredible example transformations in very simple (well, to him) code - stuff that is just nasty to write in C because it's pretty high-level, there's tons of memory management, and you're really talking about implementing fairly abstract and high-level rules with pattern matching etc. - -So I'm definitely not a functional language kind of guy - it's not how I learnt programming, and it really isn't very relevant to what I do, and I wouldn't recognize Haskell code if it bit me in the ass and called me names. But no, I wouldn't call them frivolous. - -**Critical software to the use of Linux** -by TWX - -> Mr. Torvalds, For many uses of Linux such as on the desktop, other software beyond the kernel and the base GNU tools are required. What other projects would you like to see given priority, and what would you like to see implemented or improved? Admittedly I thought most about X-Windows when asking this question; but I don't doubt that other daemons or systems can be just as important to the user experience. Thank you for your efforts all these years. - -**Linus**: Hey, I don't really have any particular project I would want to champion, largely because we all have so different requirements on the desktop. There's just no single thing that stands out as being hugely more important than others to me. - -What I do wish particularly desktop developers cared about is "consistency of experience". And by that I don't mean some kind of enforced visual consistency between different applications to make things "look coherent". No, I'm just talking about the pain and uncertainty users go through with upgrades, and understanding that while your project may be the most important project to *you* (because it's what you do), to your users, your project is likely just a fairly small and irrelevant part of their experience, and it's not very central at all, and they've learnt the quirks about that thing they don't even care about, and you really shouldn't break their expectations. Because it turns out that that is how you really make people hate their desktop. - -This is not at all Linux-specific, of course - just look at the less than enthusiastic reception that other operating system redesigns have received. But I really wish that we hadn't had *both* of the major Linux desktop environments have to learn this (well, I hope they learnt) the hard way, and both of them ending up blaming their users rather than themselves. - -**"anykernel"-style portable drivers?** -by staalmannen - -> What do you think about the "anykernel" concept (invented by another Finn btw) used in NetBSD? Basically, they have modularized the code so that a driver can be built either in a monolithic kernel or for user space without source code changes ( rumpkernel.org ). The drivers are highly portable and used in Genode os (L4 type kernels), minix etc... Would this be possible or desirable for Linux? Apparently there is one attempt called "libos"... - -**Linus**: So I have bad experiences with "portable" drivers. Writing drivers to some common environment tends to force some ridiculously nasty impedance matching abstractions that just get in the way and make things really hard to read and modify. It gets particularly nasty when everybody ends up having complicated - and differently so - driver subsystems to handle a lot of commonalities for a certain class of drivers (say a network driver, or a USB driver), and the different operating systems really have very different approaches and locking rules etc. - -I haven't seen anykernel drivers, but from past experience my reaction to "portable device drivers" is to run away, screaming like little girl. As they say in Swedish "Bränt barn luktar illa". - -**Processor Architecture** -by swv3752 - -> Several years ago, you were employed by Transmeta designing the Crusoe processor. I understand you are quite knowledgeable about cpu architecture. What are your thoughts on the Current Intel and AMD x86 CPUs particularly in comparison with ARM and IBM's Power8 CPUs? Where do you see the advantages of each one? - -**Linus**: I'm no CPU architect, I just play one on TV. - -But yes, I've been close to the CPU both as part of my kernel work, and as part of a processor company, and working at that level for a long time just means that you end up having fairly strong opinions. One of the things that my experiences at Transmeta convinced me of, for example, was that there's definitely very much a limit to what software should care about. I loved working at Transmeta, I loved the whole startup company environment, I loved working with really smart people, but in the end I ended up absolutely *not* loving to work with overly simple hardware (I also didn't love the whole IPO process, and what that did to the company culture, but that's a different thing). - -Because there's only so much that software can do to compensate. - -Something similar happened with my kernel work on the alpha architecture, which also started out as being an overly simplified implementation in the name of being small and supposedly running really fast. While I really started out liking the alpha architecture for being so clean, I ended up detesting how fragile the architecture implementations were (and by the time that got fixed in the 21264, I had given up on alpha). - -So I've come to absolutely detest CPU's that need a lot of compiler smarts or special tuning to go fast. Life is too short to waste on in-order CPU's, or on hardware designers who think software should take care of the pieces that they find to be too complicated to handle themselves, and as a result just left undone. "Weak memory ordering" is just another example. - -Thankfully, most of the industry these days seems to agree. Yes, there are still in-order cores, but nobody tries to make excuses for them any more: they are for the truly cheap and low-end market. - -I tend to really like the modern Intel cores in particular, which tend to take that "let's not be stupid" really to heart. With the kernel being so threaded, I end up caring a lot about things like memory ordering etc, and the Intel big-core CPU's tend to be in a class of their own there. As a software person who cares about performance and looks at instruction profiles etc, it's just so *nice* to see that the CPU doesn't have some crazy glass jaw where you have to be very careful. - -**GPU kernels** -by maraist - -> Is there any inspiration that a GPU based kernel / scheduler has for you? How might Linux be improved to better take advantage of GPU-type batch execution models. Given that you worked transmeta and JIT compiled host-targeted runtimes. GPUs 1,000-thread schedulers seem like the next great paradigm for the exact type of machines that Linux does best on. - -**Linus**: I don't think we'll see the kernel ever treat GPU threads the way we treat CPU threads. Not with the current model of GPU's (and that model doesn't really seem to be changing all that much any more). - -Yes, GPU's are getting much better, and now generally have virtual memory and the ability to preempt execution, and you could run an OS on them. But the scheduling latencies are pretty high, and the threads are not really "independent" (ie they tend to share a lot of state - like the virtual address space and a large shared register set), so GPU "threads" don't tend to work like CPU threads. You'd schedule them all-or-nothing, so if you were to switch processes, you'd treat the GPU as one entity where you switch all the threads at once. - -So it really wouldn't look like a thousand threads to the kernel. The GPU would still be scheduled as one single entity (or maybe a couple of entities depending on how the GPU is partitioned). The fact that that single entity works by doing a lot of things in massive parallelism is kind of immaterial for the kernel that doesn't end up seeing that parallelism as separate threads. - -**alleged danger of Artificial Intelligence** -by peter303 - -> Some computer experts like Marvin Minsky, Larry Page, Ray Kuzweil think A.I. will be a great gift to Mankind. Others like Bill Joy and Elon Musk are fearful of potential danger. Where do you stand, Linus? - -**Linus**: I just don't see the thing to be fearful of. - -We'll get AI, and it will almost certainly be through something very much like recurrent neural networks. And the thing is, since that kind of AI will need training, it won't be "reliable" in the traditional computer sense. It's not the old rule-based prolog days, when people thought they'd *understand* what the actual decisions were in an AI. - -And that all makes it very interesting, of course, but it also makes it hard to productize. Which will very much limit where you'll actually find those neural networks, and what kinds of network sizes and inputs and outputs they'll have. - -So I'd expect just more of (and much fancier) rather targeted AI, rather than anything human-like at all. Language recognition, pattern recognition, things like that. I just don't see the situation where you suddenly have some existential crisis because your dishwasher is starting to discuss Sartre with you. - -The whole "Singularity" kind of event? Yeah, it's science fiction, and not very good SciFi at that, in my opinion. Unending exponential growth? What drugs are those people on? I mean, really.. - -It's like Moore's law - yeah, it's very impressive when something can (almost) be plotted on an exponential curve for a long time. Very impressive indeed when it's over many decades. But it's _still_ just the beginning of the "S curve". Anybody who thinks any different is just deluding themselves. There are no unending exponentials. - -**Is the kernel basically a finished project?** -by NaCh0 - -> Aside from adding drivers and refactoring algorithms when performance limits are discovered, is there anything left for the kernel? Maybe it's a failure of tech journalism but we never hear about the next big thing in kernel land anymore. - -**Linus**: I don't think there's much of a "next big thing" in the kernel. - -I wouldn't say that there is nothing but drivers (and architectures are kind of "CPU drivers) and improving scalability left, because I'm constantly amazed by how many new things people figure out are still good ideas. But they tend to still be pretty incremental improvements. An OS kernel doesn't look *that* radically different from what it was 40 years ago, and that's fine. I think radical new ideas are often overrated, and the thing that really matters in the end is that plodding detail work. That's how technology evolves. - -And judging by how our kernel releases are going, there's no end in sight for that "plodding detail work". And it's still as interesting as it ever was. - --------------------------------------------------------------------------------- - -via: http://linux.slashdot.org/story/15/06/30/0058243/interviews-linus-torvalds-answers-your-question - -作者:[samzenpus][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:samzenpus@slashdot.org -[1]:http://interviews.slashdot.org/story/15/06/24/1718247/interview-ask-linus-torvalds-a-question -[2]:http://meta.slashdot.org/story/12/10/11/0030249/linus-torvalds-answers-your-questions -[3]:https://lwn.net/Articles/604695/ 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 index 49244c96d2..6624a3c590 100644 --- 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 @@ -1,4 +1,3 @@ -translated by bestony 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. diff --git a/sources/tech/20151104 How to Install Pure-FTPd with TLS on FreeBSD 10.2.md b/sources/tech/20151104 How to Install Pure-FTPd with TLS on FreeBSD 10.2.md deleted file mode 100644 index 19ddcf0e97..0000000000 --- a/sources/tech/20151104 How to Install Pure-FTPd with TLS on FreeBSD 10.2.md +++ /dev/null @@ -1,154 +0,0 @@ -How to Install Pure-FTPd with TLS on FreeBSD 10.2 -================================================================================ -FTP or File Transfer Protocol is application layer standard network protocol used to transfer file from the client to the server, after user logged in to the FTP server over the TCP-Network, such as internet. FTP has been round long time ago, much longer then P2P Program, or World Wide Web, and until this day it was a primary method for sharing file with other over the internet and it it remain very popular even today. FTP provide an secure transmission, that protect username, password and encrypt the content with SSL/TLS. - -Pure-FTPd is free FTP Server with strong and focus on the software security. It was great choice for you if you want to provide a fast, secure, lightweight with feature rich FTP Services. Pure-FTPd can be install on variety of Unix-like operating system, include Linux and FreeBSD. Pure-FTPd is created by Frank Dennis in 2001, based on Troll-FTPd, and until now is actively developed by a team led by Dennis. - -In this tutorial we will provide about installation and configuration of "**Pure-FTPd**" with Unix-like operating system FreeBSD 10.2. - -### Step 1 - Update system ### - -The first thing you must do is to install and update the freebsd repository, please connect to your server with SSH and then type command below as sudo/root : - - freebsd-update fetch - freebsd-update install - -### Step 2 - Install Pure-FTPd ### - -You can install Pure-FTPd from the ports method, but in this tutorial we will install from the freebsd repository with "**pkg**" command. So, now let's install : - - pkg install pure-ftpd - -Once installation is finished, please add pure-ftpd to the start at the boot time with sysrc command below : - - sysrc pureftpd_enable=yes - -### Step 3 - Configure Pure-FTPd ### - -Configuration file for Pure-FTPd is located at directory "/usr/local/etc/", please go to the directory and copy the sample configuration for pure-ftpd to "**pure-ftpd.conf**". - - cd /usr/local/etc/ - cp pure-ftpd.conf.sample pure-ftpd.conf - -Now edit the file configuration with nano editor : - - nano -c pure-ftpd.conf - -Note : -c option to show line number on nano. - -Go to line 59 and change the value of "VerboseLog" to "**yes**". This option is allow you as administrator to see the log all command used by the users. - - VerboseLog yes - -And now look at line 126 "PureDB" for virtual-users configuration. Virtual users is a simple mechanism to store a list of users, with their password, name, uid, directory, etc. It's just like /etc/passwd. But it's not /etc/passwd. It's a different file and only for FTP. In this tutorial we will store the list of user to the file "**/usr/local/etc/pureftpd.passwd**" and "**/usr/local/etc/pureftpd.pdb**". Please uncomment that line and change the path for the file to "/usr/local/etc/pureftpd.pdb". - - PureDB /usr/local/etc/pureftpd.pdb - -Next, uncomment on the line 336 "**CreateHomeDir**", this option make you easy to add the virtual users, allow automatically create home directories if they are missing. - - CreateHomeDir yes - -Save and exit. - -Next, start pure-ftpd with service command : - - service pure-ftpd start - -### Step 4 - Adding New Users ### - -At this step FTP server is started without error, but you can not log in to the FTP Server, because the default configuration of pure-ftpd is disabled for anonymous users. We need to create new users with home directory, and then give it the password for login. - -On thing you must do befere you add new user to pure-ftpd virtual-user is to create a system user for this, lets create new system user "**vftp**" and the default group is same as username, with home directory "**/home/vftp/**". - - pw useradd vftp -s /sbin/nologin -w no -d /home/vftp \ - -c "Virtual User Pure-FTPd" -m - -Now you can add the new user for the FTP Server with "**pure-pw**" command. For an example here, we will create new user named "**akari**", so please see command below : - - pure-pw useradd akari -u vftp -g vftp -d /home/vftp/akari - Password: TYPE YOUR PASSWORD - -that command will create user "**akari**" and the data stored at the file "**/usr/local/etc/pureftpd.passwd**", not at /etc/passwd file, so this means is that you can easily create FTP-only accounts without messing up your system accounts. - -Next, you must generate the PureDB user database with this command : - - pure-pw mkdb - -Now restart the pure-ftpd services and try connect with user "akari" : - - service pure-ftpd restart - -Trying to connect with user akari : - - ftp SERVERIP - -![FTP Connect user akari](http://blog.linoxide.com/wp-content/uploads/2015/10/FTP-Connect-user-akari.png) - -**NOTE :** - -If you want to add new user again, you can use "**pure-pw**" command. And if you want to delete the current user, you can use this : - - pure-pw userdel useryouwanttodelete - pure-pw mkdb - -### Step 5 - Add SSL/TLS to Pure-FTPd ### - -Pure-FTPd supports encryption using TLS security mechanisms. To support for TLS/SSL, make sure the OpenSSL library is already installed on your freebsd system. - -Now you must generate new "**self-signed certificate**" on the directory "**/etc/ssl/private**". Before you generate the certificate, please create new directory there called "private". - - cd /etc/ssl/ - mkdir private - cd private/ - -Now generate "self-signed certificate" with openssl command below : - - openssl req -x509 -nodes -newkey rsa:2048 -sha256 -keyout \ - /etc/ssl/private/pure-ftpd.pem \ - -out /etc/ssl/private/pure-ftpd.pem - -FILL ALL WITH YOUR PERSONAL INFO. - -![Generate Certificate pem](http://blog.linoxide.com/wp-content/uploads/2015/10/Generate-Certificate-pem.png) - -Next, change the certificate permission : - - chmod 600 /etc/ssl/private/*.pem - -Once the certifcate is generated, Edit the pure-ftpd configuration file : - - nano -c /usr/local/etc/pure-ftpd.conf - -Uncomment on line **423** to enable the TLS : - - TLS 1 - -And line **439** for the certificate file path : - - CertFile /etc/ssl/private/pure-ftpd.pem - -Save and exit, then restart the pure-ftpd services : - - service pure-ftpd restart - -Now let's test the Pure-FTPd that work with TLS/SSL. I'm here use "**FileZilla**" to connect to the FTP Server, and use user "**akari**" that have been created. - -![Pure-FTPd with TLS SUpport](http://blog.linoxide.com/wp-content/uploads/2015/10/Pure-FTPd-with-TLS-SUpport.png) - -Pure-FTPd with TLS on FreeBSD 10.2 successfully. - -### Conclusion ### - -FTP or File Transfer Protocol is standart protocol used to transfer file between users and the server. One of the best, lightweight and secure FTP Server Software is Pure-FTPd. It is secure and support for TLS/SSL encryption mechanism. Pure-FTPd is easy to to install and configure, you can manage the user with virtual user support, and it is make you as sysadmin is easy to manage the user if you have a much user ftp server. - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/install-pure-ftpd-tls-freebsd-10-2/ - -作者:[Arul][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/arulm/ diff --git a/sources/tech/20151227 Ubuntu Touch, three years later.md b/sources/tech/20151227 Ubuntu Touch, three years later.md deleted file mode 100644 index 3d467163cf..0000000000 --- a/sources/tech/20151227 Ubuntu Touch, three years later.md +++ /dev/null @@ -1,68 +0,0 @@ -Back in early 2013, your editor [dedicated a sacrificial handset][2] to the testing of the then-new Ubuntu Touch distribution. At that time, things were so unbaked that the distribution came with mocked-up data for unready apps; it even came with a set of fake tweets. Nearly three years later, it seemed time to give Ubuntu Touch another try on another sacrificial device. This distribution has certainly made some progress in those years, but, sadly, it still seems far from being a competitive offering in this space. -In particular, your editor tested version 16.04r3 from the testing channel on a Nexus 4 handset. The Nexus 4 is certainly past its prime at the end of 2015, but it still functions as a credible Android device. It is, in any case, the only phone handset on [the list of supported devices][1] other than the three that were sold (in locations far from your editor's home) with Ubuntu Touch pre-installed. It is a bit discouraging that Ubuntu Touch is not supported on a more recent device; the Nexus 4 was discontinued over two years ago. - -People who are accustomed to putting strange systems on Nexus devices know the drill fairly well: unlock the bootloader, install a new recovery image if necessary, then use the **fastboot** tool to flash a new image. Ubuntu Touch does not work that way; instead, one must use a set of tools available only on the Ubuntu desktop distribution. Your editor's current menagerie of systems does not include any of those, but, fortunately, running the Ubuntu 15.10 distribution off a USB drive works just fine. It must be said, though, that Ubuntu appears not to have gotten the memo regarding high-DPI laptop displays; 15.10 is an exercise in eyestrain on such a device. - -Once the requisite packages have been installed, the **ubuntu-device-flash** command can be used to install Ubuntu Touch on the phone. It finds the installation image wherever Canonical hides them (it's not obvious where that is) and puts it onto the phone; the process, on the Nexus 4, took about three hours — a surprisingly long time. Among other things, it installs a Ubuntu-specific recovery image, regardless of whether that should be necessary or not. The installation takes up about 4.5GB of space on the device. At the end, the phone reboots and comes up with the Ubuntu Touch lock screen, which has changed little in the last three years. The first boot takes a discouragingly long time, but subsequent reboots are faster, perhaps faster than Android on the same device. - -Alas, that's about the only thing that is faster than Android. The phone starts sluggish and gets worse as time goes on. At one point it took a solid minute to get the dialer screen up on the running device. Scrolling can be jerky and unpleasant to work with. At least once, the phone bogged down to the point that there was little alternative to shutting it down and starting over. - -Logging into the device over the USB connection offers some clues as to why that might be. There were no less than 258 processes running on the system. A number of them have "evolution" in their name, which is never a good sign even on a heftier system. Daemons like NetworkManager and pulseaudio are running. In general, Ubuntu Touch seems to have a large number of relatively large moving parts, leading, seemingly, to memory pressure and a certain amount of thrashing. - -Three years ago, Ubuntu Touch was built on an Android chassis. There are still bits of Android that show up here and there (it uses binder, for example), but a number of those components have been replaced. This release runs an Android-derived kernel that identifies itself as "3.4.0-7 #39-Ubuntu". 3.4.0 was released in May 2012, so it is getting a bit long in the tooth; the 3.4.0 number suggests this kernel hasn't even gotten the stable updates that followed that release. Finding the source for the kernel in this distribution is not easy; it must almost certainly be hidden somewhere in this Gerrit repository, but your editor ran out of time while trying to find it. The SurfaceFlinger display manager has been replaced by Ubuntu's own Mir, with Unity providing the interface. Upstart is the init system, despite the fact that Ubuntu has moved to systemd on desktop systems. - -When one moves beyond the command-line interface and starts playing with the touchscreen, one finds that the basics of the interface resemble what was demonstrated three years ago. Swiping from the left edge brings the [Overview screen] Unity icon bar (but no longer switches to a home screen; the "home screen" concept doesn't really seem to exist anymore). Swiping from the right will either switch to another application or produce an overview of running applications; it's not clear how it decides which. The overview provides a cute oblique view of the running applications; it's sufficient to choose one, but seems somewhat wasteful of screen space. Swiping up from the bottom produces an application-specific menu — usually. - -![][3] - - -The swipe gestures work well enough once one gets used to them, but there is scope for confusion. The camera app, for example, will instruct the user to "swipe left for photo roll," but, unless one is careful to avoid [Swipe left] the right edge of the screen, that gesture will yield the overview screen instead. One can learn subtleties like "swipes involving the edge" and "swipes avoiding the edge," but one could argue that such an interface is more difficult than it needs to be and less discoverable than it could be. - -![][4] - -Speaking of the camera app, it takes pictures as one might expect, and it has gained a high-dynamic-range mode in recent years. It still has no support for stitching together photos in a panorama or "photo sphere" mode, though. - -![][5] - -The base distribution comes with a fairly basic set of apps. Many of them appear to be interfaces to an associated web page; the Amazon, GMail, and Facebook apps, for example. Something called "Shorts" appears to be an RSS reader, though it seems impervious to the addition of arbitrary feeds. There is a terminal app, but it prompts for a password — a bit surprising [Terminal emulator] given that no password had ever been supplied for the device (it turns out that one should use the screen-lock PIN here). It's not clear that this extra level of "security" is helpful, given that the user involved is already able to install, launch, and run applications on the device, but so it goes. - -Despite the presence of all those evolution processes, there is no IMAP-capable email app; there are also no mapping apps. There is a rudimentary web browser with Ubuntu branding; it appears that this browser is based on Chromium. The weather app is limited to a few dozen hardwired locations worldwide; the closest supported location to LWN headquarters was Houston, which, one assumes, is unlikely to be dealing with the foot of snow your editor had to shovel while partway through this article. One suspects we would have heard about that. - -![][6] - -Inevitably, there is a store from which one can obtain other apps. There are, for example, a couple of seemingly capable, OpenStreetMap-based mapping apps there, including one that claims turn-by-turn navigation, but nothing requiring GPS access worked in your editor's tests. Games abound, of course, but [Maps] there is little in the way of apps that are well known in the Android or iOS worlds. The store will refuse to allow the installation of apps until one creates a "Ubuntu One" account; that is unfortunate, but most Android users never get anywhere near that far before having to create or supply a Google account. - -![][7] - -Canonical puts a fair amount of energy into promoting its "scopes," which are said to be better than apps for the aggregation of content. In truth, they seem to just be another type of app with a focus on gathering information from more than one source. Although, with "branded scopes," the "more than one source" part is often deliberately put by the wayside. Your editor played around with scopes for a while, but, in truth, could not find what was supposed to make them special. - -Permissions management in Ubuntu Touch resembles that found in recent Android releases: the user will be prompted the first time an application tries to exercise a specific privilege. As with Android, the number of [Permissions request] actions requiring privilege is relatively small, and "connect to any arbitrary site on the Internet" is not among them. Access to location information or the camera, though, will generate a prompt. There is also, again as with Android, a way to control which applications are allowed to place notifications on the screen. - -Ubuntu Touch still seems to drain the battery far more quickly than Android does on the same device. Indeed, it is barely able to get through the night while sitting idle. There is a cute battery app that offers a couple of "ways to reduce battery use," but it lacks Android's ability to say which apps are actually draining the battery (though, it must be said, that information from Android is often less helpful than one might hope). - -![][8] - -The keyboard now has proper multi-lingual support (though there is no visual indication of which language is currently in effect) and, as with Android, one can switch between languages on the fly. It offers word suggestions, does [Keyboard] spelling correction, and all the usual things. One missing feature, though, is "swipe" typing which, your editor has found, can speed the process of inputting text on a small keyboard considerably. There is also no voice input; no major loss from your editor's point of view, but others will probably see that differently. - -There is a lot to like in Ubuntu Touch. There is some appeal to running something that looks like a proper Linux system, even if it still has a number of Ubuntu-specific components. One does not get the sense that the device is watching quite as closely as Android devices do, though it's not entirely clear, for example, what happens with location data or where it might be stored. In any case, a Ubuntu device clearly has more free software on it than most alternatives do; there is no proprietary "play services" layer maintaining control over the system. - -Sadly, though, this distribution still is not up to the capabilities and the performance of the big alternatives. Switching to Ubuntu Touch means settling for a much slower system, running on a severely limited set of devices, with a relative scarcity of apps to choose from. Your editor would very much like to see a handset distribution that is more free and more open than the alternatives, but that distribution must also be competitive with those alternatives, and that does not seem to be the case here. Unless Canonical can find a way to close the performance and feature gaps with Android, it seems unlikely to have much hope of achieving uptake that is within a few orders of magnitude of Android's. - --------------------------------------- - -via: https://lwn.net/Articles/667983/ - -作者:Jonathan Corbet -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[1]: https://developer.ubuntu.com/en/start/ubuntu-for-devices/devices/ -[2]: https://lwn.net/Articles/540138/ -[3]: https://static.lwn.net/images/2015/utouch/overview-sm.png -[4]: https://static.lwn.net/images/2015/utouch/camera-swipe-sm.png -[5]: https://static.lwn.net/images/2015/utouch/terminal.png -[6]: https://static.lwn.net/images/2015/utouch/gps-sm.png -[7]: https://static.lwn.net/images/2015/utouch/camera-perm.png -[8]: https://static.lwn.net/images/2015/utouch/schifo.png diff --git a/sources/tech/20160218 7 Steps to Start Your Linux SysAdmin Career.md b/sources/tech/20160218 7 Steps to Start Your Linux SysAdmin Career.md index 6df151f9f6..60b8f7fc75 100644 --- a/sources/tech/20160218 7 Steps to Start Your Linux SysAdmin Career.md +++ b/sources/tech/20160218 7 Steps to Start Your Linux SysAdmin Career.md @@ -1,4 +1,3 @@ -bioIkke 翻译中 7 Steps to Start Your Linux SysAdmin Career =============================================== diff --git a/sources/tech/20160218 How to Best Manage Encryption Keys on Linux.md b/sources/tech/20160218 How to Best Manage Encryption Keys on Linux.md index 468414fdfa..19aab96541 100644 --- a/sources/tech/20160218 How to Best Manage Encryption Keys on Linux.md +++ b/sources/tech/20160218 How to Best Manage Encryption Keys on Linux.md @@ -1,5 +1,3 @@ -GHLandy Translating - How to Best Manage Encryption Keys on Linux ============================================= diff --git a/sources/tech/20160218 Linux Systems Patched for Critical glibc Flaw.md b/sources/tech/20160218 Linux Systems Patched for Critical glibc Flaw.md index 14e950a611..19c654e27e 100644 --- a/sources/tech/20160218 Linux Systems Patched for Critical glibc Flaw.md +++ b/sources/tech/20160218 Linux Systems Patched for Critical glibc Flaw.md @@ -1,5 +1,3 @@ -Ricky Gong 翻译中 - Linux Systems Patched for Critical glibc Flaw ================================================= diff --git a/sources/tech/20160222 Achieving Enterprise-Ready Container Tools With Wercker’s Open Source CLI.md b/sources/tech/20160222 Achieving Enterprise-Ready Container Tools With Wercker’s Open Source CLI.md index 2f7d6f7f8d..81f7467719 100644 --- a/sources/tech/20160222 Achieving Enterprise-Ready Container Tools With Wercker’s Open Source CLI.md +++ b/sources/tech/20160222 Achieving Enterprise-Ready Container Tools With Wercker’s Open Source CLI.md @@ -1,6 +1,5 @@ Achieving Enterprise-Ready Container Tools With Wercker’s Open Source CLI =========================================== -#CoderBOBO translating For enterprises, containers offer more efficient build environments, cloud-native applications and migration from legacy systems to the cloud. But enterprise adoption of the technology -- Docker specifically -- has been hampered by, among other issues, [a lack of mature developer tools][1]. diff --git a/sources/tech/20160314 15 podcasts for FOSS fans b/sources/tech/20160314 15 podcasts for FOSS fans.md similarity index 100% rename from sources/tech/20160314 15 podcasts for FOSS fans rename to sources/tech/20160314 15 podcasts for FOSS fans.md From 5fdbcb365c2efdc99463254201319d4745853958 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 15 Apr 2016 15:42:56 +0800 Subject: [PATCH 0616/1469] PUB:20160405 Ubuntu Budgie Could Be the New Flavor of Ubuntu Linux, as Part of Ubuntu 16.10 @alim0x --- ...New Flavor of Ubuntu Linux, as Part of Ubuntu 16.10.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename {translated/news => published}/20160405 Ubuntu Budgie Could Be the New Flavor of Ubuntu Linux, as Part of Ubuntu 16.10.md (82%) diff --git a/translated/news/20160405 Ubuntu Budgie Could Be the New Flavor of Ubuntu Linux, as Part of Ubuntu 16.10.md b/published/20160405 Ubuntu Budgie Could Be the New Flavor of Ubuntu Linux, as Part of Ubuntu 16.10.md similarity index 82% rename from translated/news/20160405 Ubuntu Budgie Could Be the New Flavor of Ubuntu Linux, as Part of Ubuntu 16.10.md rename to published/20160405 Ubuntu Budgie Could Be the New Flavor of Ubuntu Linux, as Part of Ubuntu 16.10.md index 899d8b5920..0470818ba6 100644 --- a/translated/news/20160405 Ubuntu Budgie Could Be the New Flavor of Ubuntu Linux, as Part of Ubuntu 16.10.md +++ b/published/20160405 Ubuntu Budgie Could Be the New Flavor of Ubuntu Linux, as Part of Ubuntu 16.10.md @@ -7,15 +7,15 @@ Ubuntu Budgie 将在 Ubuntu 16.10 中成为新官方分支发行版 ![Budgie-Remix 16.04 Beta 2](http://i1-news.softpedia-static.com/images/news2/ubuntu-budgie-could-be-the-new-flavor-of-ubuntu-linux-as-part-of-ubuntu-16-10-502573-2.jpg) -今天,Budgie-Remix 的开发者 David Mohammed 向 Softpedia 通报了项目进度,以及为即将到来的 16.04 发布的第二个 Beta 版本。Cononical 的创始人 [Mark Shuttleworth 说过][2]如果能够有围绕这个包的社区,它肯定会得到支持。 +今天,Budgie-Remix 的开发者 David Mohammed 向 Softpedia 通报了项目进度,以及为即将到来的 16.04 发布了第二个 Beta 版本。Cononical 的创始人 [Mark Shuttleworth 说过][2]如果能够有围绕这个发行版的社区,它肯定会得到支持。 -自我们[最初的报道][3]以来,David Mohammed 似乎与 Ubuntu MATE 项目的领导者 Martin Wimpress 取得了联系,后者敦促他以 Ubuntu 16.10 作为他还未正式命名的 Ubuntu 分支的官方版本目标。这个分支发行版构建于 Budgie 桌面环境之上,它是超赞的 [Solus][4] 开发者团队创建的。 +自我们[最初的报道][3]以来,David Mohammed 似乎与 Ubuntu MATE 项目的领导者 Martin Wimpress 取得了联系,后者敦促他以 Ubuntu 16.10 作为他还未正式命名的 Ubuntu 分支的官方版本目标。这个分支发行版构建于 Budgie 桌面环境之上,该桌面环境是由超赞的 [Solus][4] 开发者团队创建的。 “我们本周完成了 Beta 2 版本的开发以及很多其它东西,而且我们还有 Martin Wimpress (Ubuntu MATE 项目领导者)的支持,”David Mohammed 对 Softpedia 独家爆料。”他还敦促我们以 16.10 作为成为官方版本的目标——那当然是个主要的挑战——并且我们还需要社区的帮助/加入我们来让这一切成为现实!” ### Ubuntu Budgie 16.10 可能在 2016 年 10 月到来 ### -4 月 21 日,Canonical 将会发布 Ubuntu Linux 的下一个 LTS(Long Term Support,长期支持)版本,Xenial Xerus 好客的非洲地松鼠,也就是 Ubuntu 16.04,并且我们有可能能够以 Budgie-Remix 16.04 的名义提前尝试将成为官方分支的 Ubuntu Budgie。但在那之前,你可以帮助开发者[测试 Beta 2 版本][5]。 +4 月 21 日,Canonical 将会发布 Ubuntu Linux 的下一个 LTS(Long Term Support,长期支持)版本:Xenial Xerus——好客的非洲地松鼠——也就是 Ubuntu 16.04。我们有可能能够提前体验到 Budgie-Remix 16.04,以后它也许成为了官方分支的 Ubuntu Budgie 。但在那之前,你可以帮助开发者[测试 Beta 2 版本][5]。 在 Ubuntu 16.04 LTS(Xenial Xerus)发布之后,Ubuntu 的开发者们就会立即将注意力转移到下一个版本的开发上。下一个版本 Ubuntu 16.10 应该会在 10 月底到来,并且 Ubuntu Budgie 也可能宣布成为 Ubuntu 官方分支发行版。 @@ -32,7 +32,7 @@ via: http://news.softpedia.com/news/ubuntu-budgie-could-be-the-new-flavor-of-ubu 作者:Marius Nestor 译者:[alim0x](https://github.com/alim0x) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 6cd34d0ae02fee6d46bfeb8f1e32cfbb8684fc12 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 15 Apr 2016 21:17:57 +0800 Subject: [PATCH 0617/1469] PUB:20151028 10 Tips for 10x Application Performance --- .../20151028 10 Tips for 10x Application Performance.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20151028 10 Tips for 10x Application Performance.md (100%) diff --git a/translated/tech/20151028 10 Tips for 10x Application Performance.md b/published/20151028 10 Tips for 10x Application Performance.md similarity index 100% rename from translated/tech/20151028 10 Tips for 10x Application Performance.md rename to published/20151028 10 Tips for 10x Application Performance.md From a0d545db329a175f9bbf40d3dee76dad5cc4640d Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 15 Apr 2016 21:36:16 +0800 Subject: [PATCH 0618/1469] PUB:20160220 Make Sudo Insult User For Each Incorrect Password Attempt @geekpi --- ...ser For Each Incorrect Password Attempt.md | 58 +++++++++++++++++++ ...ser For Each Incorrect Password Attempt.md | 58 ------------------- 2 files changed, 58 insertions(+), 58 deletions(-) create mode 100644 published/20160220 Make Sudo Insult User For Each Incorrect Password Attempt.md delete mode 100644 translated/tech/20160220 Make Sudo Insult User For Each Incorrect Password Attempt.md diff --git a/published/20160220 Make Sudo Insult User For Each Incorrect Password Attempt.md b/published/20160220 Make Sudo Insult User For Each Incorrect Password Attempt.md new file mode 100644 index 0000000000..973c95b666 --- /dev/null +++ b/published/20160220 Make Sudo Insult User For Each Incorrect Password Attempt.md @@ -0,0 +1,58 @@ +输错密码?这个 sudo 会“嘲讽”你 +=========================================================== + +你在 Linux 终端中会有很多的乐趣。我今天要讲的不是在[终端中跑火车](http://itsfoss.com/ubuntu-terminal-train/)。 + +我今天要讲的技巧可以放松你的心情。前面一篇文章中,你学习了[如何在命令行中增加 sudo 命令的超时](http://itsfoss.com/change-sudo-password-timeout-ubuntu/)。今天的文章中,我会向你展示如何让 sudo 在输错密码的时候“嘲讽”你(或者其他人)。 + +对我讲的感到疑惑?这里,让我们看下这张 gif 来了解下 sudo 是如何在你输错密码之后“嘲讽”你的。 + +![](http://itsfoss.com/wp-content/uploads/2016/02/sudo-insults-Linux.gif) + +那么,为什么要这么做?毕竟,“嘲讽”不会让你的一天开心,不是么? + +对我来说,一点小技巧都是有趣的,并且要比以前的“密码错误”的错误提示更有趣。另外,我可以向我的朋友展示来逗弄他们(这个例子中是通过自由开源软件)。我很肯定你有你自己的理由来使用这个技巧的。 + +## 在 sudo 中启用“嘲讽” + +你可以在`sudo`配置中增加下面的行来启用“嘲讽”功能: + +``` +Defaults insults +``` + +让我们看看该如何做。打开终端并使用下面的命令: + +``` +sudo visudo +``` + +这会在 [nano](http://www.nano-editor.org/)中打开配置文件。 + +> 是的,我知道传统的 ‘visudo’ 应该在 vi 中打开 `/etc/sudoers` 文件,但是 Ubuntu 及基于它的发行版会使用 nano 打开。由于我们在讨论vi,这里有一份 [vi 速查表](http://itsfoss.com/download-vi-cheat-sheet)可以在你决定使用 vi 的时候使用。 + +回到编辑 sudeors 文件界面,你需要找出 Defaults 所在的行。简单的很,只需要在文件的开头加上`Defaults insults`,就像这样: + +![](http://itsfoss.com/wp-content/uploads/2016/02/sudo-insults-Linux-Mint.png) + +如果你正在使用 nano,使用`Ctrl+X`来退出编辑器。在退出的时候,它会询问你是否保存更改。要保存更改,按下“Y”。 + +一旦你保存了 sudoers 文件之后,打开终端并使用 sudo 运行各种命令。故意输错密码并享受嘲讽吧:) + +sudo 可能会生气的。看见没,他甚至在我再次输错之后威胁我。哈哈。 + +![](http://itsfoss.com/wp-content/uploads/2016/02/sudo-insults-Linux-Mint-1.jpeg) + +如果你喜欢这个终端技巧,你也可以查看[其他终端技巧的文章](http://itsfoss.com/category/terminal-tricks/)。如果你有其他有趣的技巧,在评论中分享。 + +------------------------------------------------------------------------------ + +via: http://itsfoss.com/sudo-insult-linux/ + +作者:[ABHISHEK][a] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ diff --git a/translated/tech/20160220 Make Sudo Insult User For Each Incorrect Password Attempt.md b/translated/tech/20160220 Make Sudo Insult User For Each Incorrect Password Attempt.md deleted file mode 100644 index 0a0008ab8d..0000000000 --- a/translated/tech/20160220 Make Sudo Insult User For Each Incorrect Password Attempt.md +++ /dev/null @@ -1,58 +0,0 @@ -让sudo在用户输错密码时侮辱用户 -=========================================================== - -你在Linux终端中会有很多的乐趣。我今天要讲的不是在[终端中跑火车](http://itsfoss.com/ubuntu-terminal-train/)。 - -我今天要讲的技巧可以放松你的心情。前面一篇文章中,你学习了[如何在命令行中增加sudo命令的超时](http://itsfoss.com/change-sudo-password-timeout-ubuntu/)。今天的文章中,我会向你展示如让sudo在输错密码的时候侮辱你(或者其他人)。 - - -对我讲的感到疑惑?这里,让我们看下这张gif来了解sudo如何在你输错密码之后侮辱你的。 - -![](http://itsfoss.com/wp-content/uploads/2016/02/sudo-insults-Linux.gif) - -现在,你为什要这么做?毕竟,侮辱不会让你的一天开心,不是么? - -对我来说,一点小技巧都是有趣的,并且要比以前的“密码错误”的错误提示更有趣。另外,我可以向我的朋友展示娱乐(这个例子中是通过自由开源软件)。我很肯定你有你自己的里有来使用这个技巧的。 - -## 在sudo中启用侮辱 - -你可以在`sudo`配置中增加下面的行来启用侮辱功能: - -``` -Defaults insults -``` - -让我们看看该如何做。打开终端并使用下面的命令: - -``` -sudo visudo -``` - -这会在[nano](http://www.nano-editor.org/)中打开配置文件。使得,我知道传统的‘visudo’应该在vi中打开`/etc/sudoers` 文件,但是Ubuntu及基于它的发行版会使用nano打开。由于我们再讨论vi,这里有一份[vi速查表](http://itsfoss.com/download-vi-cheat-sheet)可以在你决定使用vi的时候使用。 - -回到编辑sudeors文件界面,你需要找出Defaults所在的行。幸运的是,只需要在文件的开头加上“Defaults insults”,就像这样: - -![](http://itsfoss.com/wp-content/uploads/2016/02/sudo-insults-Linux-Mint.png) - -如果你正在使用nano,使用`Ctrl+X`来退出编辑器。在退出的时候,它会询问你是否保存更改。要保存更改,按下“Y”。 - -一旦你保存了sudoers文件之后,打开终端并在任何命令中使用sudo。故意输错密码病享受辱骂:) - -sudo可能会讨厌的。看见没,他甚至在我再次输错之后威胁我。哈哈 - -![](http://itsfoss.com/wp-content/uploads/2016/02/sudo-insults-Linux-Mint-1.jpeg) - -如果你喜欢这个终端技巧,你也可以查看[其他终端技巧的文章](http://itsfoss.com/category/terminal-tricks/)。如果你有其他有趣的技巧,在评论中分享。 - - ------------------------------------------------------------------------------- - -via: http://itsfoss.com/sudo-insult-linux/ - -作者:[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 5948bf19ffbe7410a9b53bd82b1ec3b59c063973 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 15 Apr 2016 21:47:12 +0800 Subject: [PATCH 0619/1469] PUB:20160223 BeeGFS Parallel File System Goes Open Source @name1e5s --- ...3 BeeGFS Parallel File System Goes Open Source.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) rename {translated/tech => published}/20160223 BeeGFS Parallel File System Goes Open Source.md (57%) diff --git a/translated/tech/20160223 BeeGFS Parallel File System Goes Open Source.md b/published/20160223 BeeGFS Parallel File System Goes Open Source.md similarity index 57% rename from translated/tech/20160223 BeeGFS Parallel File System Goes Open Source.md rename to published/20160223 BeeGFS Parallel File System Goes Open Source.md index 2aeadbc3fb..6c9691b5c6 100644 --- a/translated/tech/20160223 BeeGFS Parallel File System Goes Open Source.md +++ b/published/20160223 BeeGFS Parallel File System Goes Open Source.md @@ -3,25 +3,25 @@ ![](http://insidehpc.com/wp-content/uploads/2015/08/beegfs.jpg) -今天(2月23日) ThinkParQ 宣布完整的 [BeeGFS 并行文件系统][1] 的源码现已开源。由于 BeeGFS 是专为要求性能的环境开发的,所以它在开发时十分注重安装的简单以及高度的灵活性,包括融合了在存储服务器同时做计算任务时需要的设置。随着系统中的服务器以及存储设备的增加,文件系统的容量以及性能将是需求的拓展点,无论是小型集群还是多达上千个节点的企业级系统。 +2月23日 ThinkParQ 宣布完整的 [BeeGFS 并行文件系统][1] 的源码现已开源。由于 BeeGFS 是专为要求性能的环境开发的,所以它在开发时十分注重安装的简易性以及高度灵活性,包括融合了在存储服务器同时做计算任务时需要的设置。随着系统中的服务器以及存储设备的增加,文件系统的容量以及性能将是需求的拓展点,无论是小型集群还是多达上千个节点的企业级系统。 -第一次官方声明开放 BeeGFS 的源码是在 2013 年的国际超级计算大会上发布的。这个声明是在欧洲的百亿亿次级超算项目 [DEEP-ER][2] 的背景下做出的,在这个项目里为了得到更好的 I/O 要求,一些微小的进步被设计并应用。对于运算量高达百亿亿次的系统,不同的软硬件必须有效的协同工作才能得到最佳的拓展性。因此,开源 BeeGFS 是让一个百亿亿次的集群的所有组成部分高效的发挥作用的一步。 +官方第一次声明开放 BeeGFS 的源码是在 2013 年的国际超级计算大会上发布的。这个声明是在欧洲的百亿亿次级超算项目 [DEEP-ER][2] 的背景下做出的,在这个项目里为了得到更好的 I/O 要求,做出了一些新的改进。对于运算量高达百亿亿次的系统,不同的软硬件必须有效的协同工作才能得到最佳的拓展性。因此,开源 BeeGFS 是让一个百亿亿次的集群的所有组成部分高效的发挥作用的一步。 -“当我们的一些用户对于 BeeGFS 十分容易安装并且不用费心管理而感到高兴时,另外一些用户则想要知道它是如何运行的以便于更好的优化他们的应用,使得他们可以监控它或者把它移植到其他的平台上,比如 BSD,” Sven Breuner 说道,他是 ThinkParQ (BeeGFS 背后的公司)的 CEO,“而且,把 BeeGFS 移植到其他的非 X86 架构,比如 ARM 或者 Power,也是社区等着要做的一件事。” +“当我们的一些用户对于 BeeGFS 十分容易安装并且不用费心管理而感到高兴时,另外一些用户则想要知道它是如何运行的以便于更好的优化他们的应用,使得他们可以监控它或者把它移植到其他的平台上,比如 BSD,” Sven Breuner 说道,他是 ThinkParQ (BeeGFS 背后的公司)的 CEO,“而且,把 BeeGFS 移植到其他的非 X86 架构,比如 ARM 或者 Power,也是社区即将要做的一件事。” 对于未来的采购来说,ARM 技术的稳步发展确实使得它成为了一个越来越有趣的技术。因此, BeeGFS 的团队也参与了 [ExaNeSt][3],一个来自欧洲的新的百亿亿次级超算计划,这个计划致力于使 ARM 的生态能为高性能的工作负载做好准备。“尽管现在 BeeGFS 在 ARM 处理器上可以算是开箱即用,这个项目也将给我们机会来证明我们在这个架构上也能完全发挥其性能。”, Bernd Lietzow , BeeGFS 中 ExaNeSt 的领导者补充道。 - 作为一个有着 25 K 行 C++ 代码的元数据服务以及约 15 K 行存储服务的项目,BeeGFS 相对比较容易理解和拓展,不只是对于大神,对于对文件系统有兴趣的大学生也是这样。在 GitHub 上已经有很多的为 BeeGFS 写的项目,比如基于浏览器的监控或者 Docker 一体化。 +作为一个有着 25 K 行 C++ 代码的元数据服务以及约 15 K 行存储服务的项目,BeeGFS 相对比较容易理解和拓展,不只是对于大神,对于对文件系统有兴趣的大学生也是这样。在 GitHub 上已经有很多的为 BeeGFS 写的项目,比如基于浏览器的监控或者 Docker 一体化。 有关新闻显示, [BeeGFS 用户大会][4]将于 5 月 18-19 日在德国凯泽斯劳滕举行。 ----------------------------------------------------------------------------------------- -via: http://insidehpc.com/2016/02/beegfs-parallel-file-system-now-open-source/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+InsideHPC+%28insideHPC.com%29 +via: http://insidehpc.com/2016/02/beegfs-parallel-file-system-now-open-source/ 作者:[staff][a] 译者:[name1e5s](https://github.com/name1e5s) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From fe3b69eda7cf3ef2580f899de3cfd588694f9e21 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 15 Apr 2016 21:51:06 +0800 Subject: [PATCH 0620/1469] =?UTF-8?q?=E5=9B=9E=E6=94=B6Part=207=20-=20LFCS?= =?UTF-8?q?--Managing=20System=20Startup=20Process=20and=20Services=20SysV?= =?UTF-8?q?init=20Systemd=20and=20Upstart.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...d Services SysVinit Systemd and Upstart.md | 1 - ...d Services SysVinit Systemd and Upstart.md | 230 ------------------ 2 files changed, 231 deletions(-) delete mode 100644 translated/tech/LFCS/Part 7 - LFCS--Managing System Startup Process and Services SysVinit Systemd and Upstart.md 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 ecd47794b0..2a822e8a45 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,4 +1,3 @@ -WingCuengRay翻译中 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. diff --git a/translated/tech/LFCS/Part 7 - LFCS--Managing System Startup Process and Services SysVinit Systemd and Upstart.md b/translated/tech/LFCS/Part 7 - LFCS--Managing System Startup Process and Services SysVinit Systemd and Upstart.md deleted file mode 100644 index 34e08ec0f7..0000000000 --- a/translated/tech/LFCS/Part 7 - LFCS--Managing System Startup Process and Services SysVinit Systemd and Upstart.md +++ /dev/null @@ -1,230 +0,0 @@ -WingCuengRay翻译中 -翻译部分,未经自校验 -Part 7 - LFCS: Managing System Startup Process and Services (SysVinit, Systemd and Upstart) -============================================================== -几个月前,Linux 基金会发布了 LFCS (Linux Foundation Certified Sysadmin) 认证,这是一则振奋人心的消息,它的目标是让全世界各地的人们的的中级 Linux 系统管理能力得到认证。这能力包括了对处于运行状态的系统和服务的支持,发现并分析实际问题,并且知道何时向开发团队提交问题。 - -![Linux Foundation Certified Sysadmin – Part 7](http://www.tecmint.com/wp-content/uploads/2014/10/lfcs-Part-7.png) - -Linux Foundation Certified Sysadmin - Part7 - -下面的视频简单地介绍了 Linux 基金认证的流程。 - -注:youtube 视频 - -本章是10个系列教程中的第7章,在这个部分,我们会解释如何去管理 Linux 系统启动进程和服务,这是 LFCS 认证考试中必须的。 - -### Linux 启动进程的管理 ### -Linux 系统的启动进程包括了几个阶段,每一个阶段都代表了一个不同的**component**。下图简单概括了启动的流程并且展示了所有阶段的主要组成部分。 - -![Linux Boot Process](http://www.tecmint.com/wp-content/uploads/2014/10/Linux-Boot-Process.png) - - -Linux 启动流程 - -当你按下电脑上的开机按钮,装载在主板电可擦写只读存储器 (EEPROM) 中的固件 (BIOS) 会执行开机自检 (Power-On Self Test) 检查系统的硬件状态。当开机自检完成后,固件会寻找并载入位于第一块硬盘中的主引导记录 (MBR) 或者 EFI 分区中的 boot loader stage1,然后将控制权转交给它。第一阶段的 boot loader 在第一块硬盘中的主引导记录 (MBR 或者 EFI 分区中。 - -#### MBR 引导启动 #### -MBR 在 BIOS 设置的可启动硬盘的第一扇区,其大小是 512 字节。 - -- 起始 446 字节: bootloader 包括了可执行代码与错误消息文本。 -- 随后 64 字节: 分区表包括了四条硬盘分区(主分区或扩展分区)的记录。此外,每条分区记录指出了分区的状态(有效/无效),大小和每个分区的开始/结束扇区。 -- 最后 2 字节: 用于MBR校验检查的幻数 (magic number)。 - -**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) - -**恢复 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) - -在 Linux 的 MBR 恢复 - -### EFI/UFEFI 引导启动 ### -在 EFI/UEFI 引导的系统中,UEFI固件会读取其配置,根据配置决定启动哪一个 UEFI appliction,并且从哪里启动(例如,在 EFI 分区所在的磁盘)。 - -然后,第二阶段的引导程序被加载运行。GRUB[GRand Unified Boot] 是 Linux 上最流行的启动管理器。**如今有两个不同的版本供大多数的系统使用**。 - -- GRUB Legacy 配置文件: /boot/grub/menu.lst (旧版本,EFI/UEFI 不支持) -- GRUB2 配置文件: 大多数为 /etc/default/grub - -虽然 LFCS 资格认证没有明确要求了解关于 GRUB 内部知识,但如果你能勇敢地承受系统崩溃的风险(为了保险,你可能希望先在虚拟机上尝试),你可以尝试自己去修改这些文件。 - - # update-grub - -在修改完 GRUB 的配置文件后,需要以 root 权限运行以上指令让修改生效。 - -GRUB 主要加载了默认的内核和 initrd 或 initramfs 镜像。简单来说,initrd 和 initramfs 帮助进行了硬件的检测,内核模块的加载和设备的探查,**这对于挂载真正的根文件系统来说是必须的**。 - -为了得到一个用户交互界面,一旦根文件系统被挂载,内核便执行系统服务管进程 (init 或者 systemd,其进程标识或者 PID 通常是 1 )来启动正常的用户空间进程。 - -init 和 systemd 都是守护进程,因为它们是系统那个第一个启动的服务(在启动期间)和最后一个终止的服务(在关机时)。 - -![Systemd and Init](http://www.tecmint.com/wp-content/uploads/2014/10/systemd-and-init.png) - -Systemd and Init - -### 服务的启动 (SysVinit) ### -Linux 中的运行级别机制通过控制不同服务的运行来指定系统的不同使用方式。换言之,运行级别决定在当前的运行模式下哪些任务能够运行(哪些不能)。 - -基于 System V Unix 继承下来的传统,当计算机进入一个指定的运行级别时(或者说,进入一个与当前系统不同的运行级别时),系统通过传递用于控制启动和停止服务的执行脚本来执行启动进程。 - -在每一个运行级别,每一个服务能被设置为运行状态或者关闭状态(如果正在运行)。大多数发行版在最新版本中抛弃了System V的标准,支持一种新的被称为systemd的系统服务管理进程(也就是系统守护进程),不过出于兼容性考虑,systemd通常支持 sysv 命令。这意味着你能够在基本systemd发行版上运行大多数sysv int工具。 - -- 参考: [Why ‘systemd’ replaces ‘init’ in Linux][1] - -除了启动系统进程,init 还根据 /etc/inittab 文件决定必须进入哪一个运行级别。 - -注:表格 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Runlevel Description
0 挂起系统。运行级别 0 是一个用于快速关闭系统的特殊过渡态。
1 该模式也被称为 s 或 S。这个运行模式有时被叫作维护模式。根据发行版的不同,在这个运行级别启动的服务也不同。这通常用于可能被正常系统操作损坏的**low-level system maintenance(低级别系统维护)**
2 多用户模式。在 Debian 及其衍生版中,这是默认的运行级别,包括了可用的图形登陆。在基于红帽 (Red-Hat 的系统中,这是没有网络功能的多用户模式。
3  在基于 Red-Hat 的系统中,这是默认的多用户模式,此模式会运行除图形环境之外的所有东西。基于 Debian 的系统通常不使用此运行级别 4,5 和此级别。
4 默认不使用,因此可用于用户定制。
5 在基于红帽的系统,这是完整的带图形界面的多用户模式。此运行级别类似于运行级别 3,不过多了 GUI 的登陆界面。
6 重启系统
- -我们能够使用`init` 命令在不同运行级别之间切换: `init N` (N是上面列出的运行级别之一)。注意并不推荐使用这种方法改变一个运行中系统的运行级别,因为它没有发出警告信息给已登陆用户(这会令他们工作丢失,任务异常终止)。 - -相反,应该使用`shutdown`命令重启系统(发送一条警告信息给所有的登陆用户,并阻止另外的用户登陆);然而,必须先在 /etc/inittab 文件中编辑系统启动的默认运行级别。 - -因此,以 root 权限寻找 /etc/inittab 中的下行,然后按照下列步骤正确地在运行级别之间切换: - - id:2:initdefault: - -然后使用 vim 之类文本编辑器(在本系列的第二章介绍了如何在 Linux 中使用 vi/vim 编辑器)将数字 2 改变成你想要的运行级别。 - -接下来以 root 权限运行: - - # shutdown -r now - -最后一条命令会重启系统并让其在下一次启动期间以指定的运行级别启动,然后系统会运行在 /etc/rc[runlevel].d 目录下的脚本以决定哪些服务会被启动哪些不会。例如,下图处于运行级别2的系统. - -![Change Runlevels in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Change-Runlevels-in-Linux.jpeg) - -Linux 运行级别的变更 - -## 使用 chkconfig 管理服务 - -为了在引导时启动/禁止系统服务,我们需要使用`chkconfig`(在 CentOS/openSUSE)和`sys-rc-conf`(在 Debian 及其衍生版中)命令。这工具能够告诉我们在一个特定运行级别的服务预配置状态。 - -- 参考: [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)** - -在上图中我们能够看到 `postfix` 被设置为当系统进入级别 2~5 时启动,而 `mysqld` 默认是在级别 2~4 时运行。假设这些不是我们期望的行为。 - -例如,我们也需要在运行级别 5 启动`mysqld`,并且在级别 4 和 5 中关闭 `postfix`。这是我们要做的(以 root 权限执行以下命令) - -**为一个特定的运行级别启动服务** - - # chkconfig --level [level(s)] service on - # chkconfig --level 5 mysqld on - -**为一个特定的运行级别禁止服务** - - # chkconfig --level [level(s)] service off - # chkconfig --level 45 posifix off - -![Enable Disable Services in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Enable-Disable-Services.png) - -启动禁止服务 - -我们可以使用 `sysv-rc-conf` 在基于 Debian 的系统执行类似的操作。 - -#### 使用 `sysv-rc-conf` 管理服务 - -设置一个服务使其能在一个特定的运行级别启动,禁止在其他运行级别启动。 - - -1. 我们用以下命令查看 `mdadm` 服务在哪些运行级别上启动。 -```c -# 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) - - 查看服务的运行级别 - -2. 我们使用 `sysv-rc-conf` 命令禁止 `mdadm` 在除了 2 以外的运行级别中启动。根据需要(使用空格键)选择或取消(可以使用上下左右方向键移动)。 -``` -# sys-rc-conf -``` - ![SysV Runlevel Config](http://www.tecmint.com/wp-content/uploads/2014/10/SysV-Runlevel-Config.png) - - Sys Runlevel Config - - 然后按 q 退出 - -3. 重启系统并运行第一步中的命令 - - ``` - # 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) - - 验证服务运行级别 - - 在上图中我们可以看到 `mdadm` 被修改为只在运行级别 2 上启动。 - -### 什么是 systemd ?### - -systemd 是较多 Linux 发行版采用的另一种系统服务管理软件。它允许系统启动期间进程并行启动(不像 sysinit 那么慢。因为 sysint 只能逐个启动进程,检查进程间依赖关系然后等待守护工作以启动更多服务),并且为系统动态管理资源。 - -因此,服务仅当需要时才被启动(以免浪费系统资源)而不是在引导时启动。 - -运行以下命令,查看系统中所有运行中服务进程的状态,**包括systemd native和SysV services**。 - -``` -# systemctl -``` - -![Check All Running Processes in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Check-All-Running-Processes.png) - -查看所有运行中的服务进程 From a3f5ca650e47004417a15af60bacb33f0a723a1d Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 15 Apr 2016 22:24:06 +0800 Subject: [PATCH 0621/1469] =?UTF-8?q?PUB:Part=206=20-=20LFCS--Assembling?= =?UTF-8?q?=20Partitions=20as=20RAID=20Devices=20=E2=80=93=20Creating=20&?= =?UTF-8?q?=20Managing=20System=20Backups?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @cpsoture --- ...es – Creating & Managing System Backups.md | 283 +++++++++++++++++ ...es – Creating & Managing System Backups.md | 284 ------------------ 2 files changed, 283 insertions(+), 284 deletions(-) create mode 100644 published/LFCS/Part 6 - LFCS--Assembling Partitions as RAID Devices – Creating & Managing System Backups.md delete mode 100644 translated/tech/LFCS/Part 6 - LFCS--Assembling Partitions as RAID Devices – Creating & Managing System Backups.md diff --git a/published/LFCS/Part 6 - LFCS--Assembling Partitions as RAID Devices – Creating & Managing System Backups.md b/published/LFCS/Part 6 - LFCS--Assembling Partitions as RAID Devices – Creating & Managing System Backups.md new file mode 100644 index 0000000000..ff480868ac --- /dev/null +++ b/published/LFCS/Part 6 - LFCS--Assembling Partitions as RAID Devices – Creating & Managing System Backups.md @@ -0,0 +1,283 @@ +LFCS 系列第六讲:组装分区为RAID设备——创建和管理系统备份 +========================================================= +Linux 基金会已经发起了一个全新的 LFCS(Linux Foundation Certified Sysadmin,Linux 基金会认证系统管理员)认证,旨在让来自世界各地的人有机会参加到 LFCS 测试,获得关于有能力在 Linux 系统中执行中级系统管理任务的认证。该认证包括:维护正在运行的系统和服务的能力、全面监控和分析的能力以及何时向上游团队请求支持的决策能力。 + +![Linux Foundation Certified Sysadmin – Part 6](http://www.tecmint.com/wp-content/uploads/2014/10/lfcs-Part-6.png) + +*LFCS 系列第六讲* + +以下视频介绍了 Linux 基金会认证程序。 + +注:youtube 视频 + + +本讲是系列教程中的第六讲,在这一讲里,我们将会解释如何将分区组装为 RAID 设备——创建和管理系统备份。这些都是 LFCS 认证中的必备知识。 + +### 了解RAID ### + +这种被称为独立磁盘冗余阵列(Redundant Array of Independent Disks)(RAID)的技术是将多个硬盘组合成一个单独逻辑单元的存储解决方案,它提供了数据冗余功能并且改善硬盘的读写操作性能。 + +然而,实际的容错和磁盘 I/O 性能硬盘取决于如何将多个硬盘组装成磁盘阵列。根据可用的设备和容错/性能的需求,RAID 被分为不同的级别,你可以参考 RAID 系列文章以获得每个 RAID 级别更详细的解释。 + +- [在 Linux 下使用 RAID(一):介绍 RAID 的级别和概念][1] + +我们选择用于创建、组装、管理、监视软件 RAID 的工具,叫做 mdadm (multiple disk admin 的简写)。 + +``` +---------------- Debian 及衍生版 ---------------- +# aptitude update && aptitude install mdadm +``` + +``` +---------------- Red Hat 和基于 CentOS 的系统 ---------------- +# yum update && yum install mdadm +``` + +``` +---------------- openSUSE 上 ---------------- +# zypper refresh && zypper install mdadm # +``` + +#### 将分区组装成 RAID 设备 #### + +组装已有分区作为 RAID 设备的过程由以下步骤组成。 + +**1. 使用 mdadm 创建阵列** + +如果先前其中一个分区已经格式化,或者作为了另一个 RAID 阵列的一部分,你会被提示以确认创建一个新的阵列。假设你已经采取了必要的预防措施以避免丢失重要数据,那么可以安全地输入 Y 并且按下回车。 + +``` +# 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) + +*创建 RAID 阵列* + +**2. 检查阵列的创建状态** + +在创建了 RAID 阵列之后,你可以检查使用以下命令检查阵列的状态。 + + + # 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) + +*检查 RAID 阵列的状态* + +**3. 格式化 RAID 设备** + +如本系列[第四讲][2]所介绍的,按照你的需求/要求采用某种文件系统格式化你的设备。 + +**4. 监控 RAID 阵列服务** + +让监控服务时刻监视你的 RAID 阵列。把`# mdadm --detail --scan`命令输出结果添加到 `/etc/mdadm/mdadm.conf`(Debian及其衍生版)或者`/etc/mdadm.conf`(Cent0S/openSUSE),如下。 + + # mdadm --detail --scan + + +![Monitor RAID Array](http://www.tecmint.com/wp-content/uploads/2014/10/Monitor-RAID-Array.png) + +*监控 RAID 阵列* + + # mdadm --assemble --scan [Assemble the array] + +为了确保服务能够开机启动,需要以 root 权限运行以下命令。 + +**Debian 及其衍生版** + +Debian 及其衍生版能够通过下面步骤使服务默认开机启动: + + # update-rc.d mdadm defaults + +在 `/etc/default/mdadm` 文件中添加下面这一行 + + AUTOSTART=true + + +**CentOS 和 openSUSE(systemd-based)** + + # systemctl start mdmonitor + # systemctl enable mdmonitor + +**CentOS 和 openSUSE(SysVinit-based)** + + # service mdmonitor start + # chkconfig mdmonitor on + +**5. 检查RAID磁盘故障** + +在支持冗余的的 RAID 级别中,在需要时会替换故障的驱动器。当磁盘阵列中的设备出现故障时,仅当存在我们第一次创建阵列时预留的备用设备时,磁盘阵列会将自动启动重建。 + +![Check RAID Faulty Disk](http://www.tecmint.com/wp-content/uploads/2014/10/Check-RAID-Faulty-Disk.png) + +*检查 RAID 故障磁盘* + +否则,我们需要手动将一个额外的物理驱动器插入到我们的系统,并且运行。 + + # mdadm /dev/md0 --add /dev/sdX1 + +/dev/md0 是出现了问题的阵列,而 /dev/sdx1 是新添加的设备。 + +**6. 拆解一个工作阵列** + +如果你需要使用工作阵列的设备创建一个新的阵列,你可能不得不去拆解已有工作阵列——(可选步骤) + + # 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. 设置邮件通知** + +你可以配置一个用于发送通知的有效邮件地址或者系统账号(确保在 mdadm.conf 文件中有下面这一行)。——(可选步骤) + + MAILADDR root + +在这种情况下,来自 RAID 后台监控程序所有的通知将会发送到你的本地 root 账号的邮件箱中。其中一个类似的通知如下。 + +说明:此次通知事件和第5步中的例子相关。此处一个设备被标志为错误,并且一个空闲的设备自动地被 mdadm 加入到阵列。我们用完了所有“健康的”空闲设备,因此我们得到了通知。 + +![RAID Monitoring Alerts](http://www.tecmint.com/wp-content/uploads/2014/10/RAID-Monitoring-Alerts.png) + +*RAID 监控通知* + +#### 了解 RAID 级别 #### + +**RAID 0** + +阵列总大小是最小分区大小的 n 倍,n 是阵列中独立磁盘的个数(你至少需要两个驱动器/磁盘)。运行下面命令,使用 /dev/sdb1 和 /dev/sdc1 分区组装一个 RAID 0 阵列。 + + # mdadm --create --verbose /dev/md0 --level=stripe --raid-devices=2 /dev/sdb1 /dev/sdc1 + +常见用途:用于支持性能比容错更重要的实时应用程序的设置 + +**RAID 1 (又名镜像)** + +阵列总大小等于最小分区大小(你至少需要两个驱动器/磁盘)。运行下面命令,使用 /dev/sdb1 和 /dev/sdc1 分区组装一个 RAID 1 阵列。 + + # mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sdb1 /dev/sdc1 + +常见用途:操作系统的安装或者重要的子文件夹,例如 /home + +**RAID 5 (又名奇偶校验码盘)** + +阵列总大小将是最小分区大小的 (n-1) 倍。所减少的大小用于奇偶校验(冗余)计算(你至少需要3个驱动器/磁盘)。 + +说明:你可以指定一个空闲设备 (/dev/sde1) 替换问题出现时的故障部分(分区)。运行下面命令,使用 /dev/sdb1, /dev/sdc1, /dev/sdd1,/dev/sde1 组装一个 RAID 5 阵列,其中 /dev/sde1 作为空闲分区。 + + # mdadm --create --verbose /dev/md0 --level=5 --raid-devices=3 /dev/sdb1 /dev/sdc1 /dev/sdd1 --spare-devices=1 /dev/sde1 + +常见用途:Web 和文件服务 + +**RAID 6 (又名双重奇偶校验码盘)** + +阵列总大小为(n*s)-2*s,其中n为阵列中独立磁盘的个数,s为最小磁盘大小。 + +说明:你可以指定一个空闲分区(在这个例子为 /dev/sdf1)替换问题出现时的故障部分(分区)。 + +运行下面命令,使用 /dev/sdb1, /dev/sdc1, /dev/sdd1, /dev/sde1 和 /dev/sdf1 组装 RAID 6 阵列,其中 /dev/sdf1 作为空闲分区。 + + # mdadm --create --verbose /dev/md0 --level=6 --raid-devices=4 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde --spare-devices=1 /dev/sdf1 + +常见用途:大容量、高可用性要求的文件服务器和备份服务器。 + +**RAID 1+0 (又名镜像条带)** + +因为 RAID 1+0 是 RAID 0 和 RAID 1 的组合,所以阵列总大小是基于两者的公式计算的。首先,计算每一个镜像的大小,然后再计算条带的大小。 + + # mdadm --create --verbose /dev/md0 --level=10 --raid-devices=4 /dev/sd[b-e]1 --spare-devices=1 /dev/sdf1 + +常见用途:需要快速 IO 操作的数据库和应用服务器 + +#### 创建和管理系统备份 #### + +记住, RAID 其所有的价值不是在于备份的替换者!在黑板上写上1000次,如果你需要的话,但无论何时一定要记住它。在我们开始前,我们必须注意的是,没有一个放之四海皆准的针对所有系统备份的解决方案,但这里有一些东西,是你在规划一个备份策略时需要考虑的。 + +- 你的系统将用于什么?(桌面或者服务器?如果系统是应用于后者,那么最重要的服务是什么?哪个配置是痛点?) +- 你每隔多久备份你的系统? +- 你需要备份的数据是什么(比如文件/文件夹/数据库转储)?你还可以考虑是否需要备份大型文件(比如音频和视频文件)。 +- 这些备份将会存储在哪里(物理位置和媒体)? + +**备份你的数据** + +方法1:使用 dd 命令备份整个磁盘。你可以在任意时间点通过创建一个准确的镜像来备份一整个硬盘或者是分区。注意当设备是离线时,这种方法效果最好,也就是说它没有被挂载并且没有任何进程的 I/O 操作访问它。 + +这种备份方法的缺点是镜像将具有和磁盘或分区一样的大小,即使实际数据占用的是一个很小的比例。比如,如果你想要为只使用了10%的20GB的分区创建镜像,那么镜像文件将仍旧是20GB。换句话来讲,它不仅包含了备份的实际数据,而且也包含了整个分区。如果你想完整备份你的设备,那么你可以考虑使用这个方法。 + +**从现有的设备创建一个镜像文件** + + # dd if=/dev/sda of=/system_images/sda.img + 或者 + --------------------- 可选地,你可以压缩镜像文件 ------------------- + # dd if=/dev/sda | gzip -c > /system_images/sda.img.gz + +**从镜像文件恢复备份** + + # dd if=/system_images/sda.img of=/dev/sda + 或者 + --------------------- 根据你创建镜像文件时的选择(译者注:比如压缩) ---------------- + # gzip -dc /system_images/sda.img.gz | dd of=/dev/sda + +方法2:使用 tar 命令备份确定的文件/文件夹——已经在本系列[第三讲][3]中讲了。如果你想要备份指定的文件/文件夹(配置文件,用户主目录等等),你可以使用这种方法。 + +方法3:使用 rsync 命令同步文件。rsync 是一种多功能远程(和本地)文件复制工具。如果你想要从网络设备备份或同步文件,rsync 是一种选择。 + + +无论是你是正在同步两个本地文件夹还是本地 < — > 挂载在本地文件系统的远程文件夹,其基本语法是一样的。 + + # rsync -av source_directory destination_directory + +在这里,-a 递归遍历子目录(如果它们存在的话),维持符号链接、时间戳、权限以及原本的属主/属组,-v 显示详细过程。 + +![rsync Synchronizing Files](http://www.tecmint.com/wp-content/uploads/2014/10/rsync-synchronizing-Files.png) + +*rsync 同步文件* + +除此之外,如果你想增加在网络上传输数据的安全性,你可以通过 ssh 协议使用 rsync。 + +**通过 ssh 同步本地到远程文件夹** + + # rsync -avzhe ssh backups root@remote_host:/remote_directory/ + +这个示例,本地主机上的 backups 文件夹将与远程主机上的 /root/remote_directory 的内容同步。 + +在这里,-h 选项以易读的格式显示文件的大小,-e 标志用于表示一个 ssh 连接。 + +![rsync Synchronize Remote Files](http://www.tecmint.com/wp-content/uploads/2014/10/rsync-synchronize-Remote-Files.png) + +*rsync 同步远程文件* + +**通过ssh同步远程到本地文件夹** + +在这种情况下,交换前面示例中的 source 和 destination 文件夹。 + + # rsync -avzhe ssh root@remote_host:/remote_directory/ backups + +请注意这些只是 rsync 用法的三个示例而已(你可能遇到的最常见的情形)。对于更多有关 rsync 命令的示例和用法 ,你可以查看下面的文章。 + +- [在 Linux 下同步文件的10个 rsync命令][4] + +### 总结 ### + +作为一个系统管理员,你需要确保你的系统表现得尽可能好。如果你做好了充分准备,并且如果你的数据完整性能被诸如 RAID 和系统日常备份的存储技术支持,那你将是安全的。 + +如果你有有关完善这篇文章的问题、评论或者进一步的想法,可以在下面畅所欲言。除此之外,请考虑通过你的社交网络简介分享这系列文章。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/creating-and-managing-raid-backups-in-linux/ + +作者:[Gabriel Cánepa][a] +译者:[cpsoture](https://github.com/cposture) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:https://linux.cn/article-6085-1.html +[2]:https://linux.cn/article-7187-1.html +[3]:https://linux.cn/article-7171-1.html +[4]:http://www.tecmint.com/rsync-local-remote-file-synchronization-commands/ + diff --git a/translated/tech/LFCS/Part 6 - LFCS--Assembling Partitions as RAID Devices – Creating & Managing System Backups.md b/translated/tech/LFCS/Part 6 - LFCS--Assembling Partitions as RAID Devices – Creating & Managing System Backups.md deleted file mode 100644 index 5de5004424..0000000000 --- a/translated/tech/LFCS/Part 6 - LFCS--Assembling Partitions as RAID Devices – Creating & Managing System Backups.md +++ /dev/null @@ -1,284 +0,0 @@ -LFCS 系列第六讲:组装分区为RAID设备——创建和管理系统备份 -========================================================= -Linux 基金会已经发起了一个全新的 LFCS(Linux Foundation Certified Sysadmin,Linux 基金会认证系统管理员)认证,旨在让来自世界各地的人有机会参加到 LFCS 测试,获得关于有能力在 Linux 系统中执行中间系统管理任务的认证。该认证包括:维护正在运行的系统和服务的能力、全面监控和分析的能力以及何时上游团队请求支持的决策能力。 - -![Linux Foundation Certified Sysadmin – Part 6](http://www.tecmint.com/wp-content/uploads/2014/10/lfcs-Part-6.png) - -LFCS 系列第六讲 - -以下视频介绍了 Linux 基金会认证程序。 - -注:youtube 视频 - - -本讲是《十套教程》系列中的第六讲,在这一讲里,我们将会解释如何组装分区为RAID设备——创建和管理系统备份。这些都是 LFCS 认证中的必备知识。 - -### 了解RAID ### - -一种被称为独立磁盘冗余阵列(RAID)的技术是将多个硬盘组合成一个单独逻辑单元的存储解决方案,它提供了数据冗余功能并且改善硬盘的读写操作性能。 - -然而,实际的容错和磁盘I/O性能硬盘取决于如何将多个硬盘组装成磁盘阵列。根据可用的设备和容错/性能的需求,RAID被分为不同的级别,你可以在Tecmint.com上参考RAID系列文章以获得每个RAID级别更详细的解释。 - -- RAID Guide: [What is RAID, Concepts of RAID and RAID Levels Explained][1] - -我们选择用于创建、组装、管理、监视软件RAID的工具,叫做mdadm(multiple disk 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 # -``` - -#### 组装分区作为RAID设备 #### - -组装已有分区作为RAID设备的过程由以下步骤组成。 - -**1. 使用mdadm创建阵列** - -如果先前其中一个分区被格式化,或者作为了另一个RAID阵列的一部分,你会被提示以确认创建一个新的阵列。假设你已经采取了必要的预防措施以避免丢失重要数据,那么可以安全地输入Y并且按下回车。 - -``` -# 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) - -创建RAID阵列 - -**2. 检查阵列的创建状态** - -在创建了RAID阵列之后,你可以检查使用以下命令检查阵列的状态。 - - - # 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) - -检查RAID阵列的状态 - -**3. 格式化RAID设备** - -如本系列[Part 4][2]所介绍的,按照你的需求/要求采用某种文件系统格式化你的设备。 - -4. 监控RAID阵列服务 - -指示监控服务时刻监视你的RAID阵列。把```# mdadm --detail --scan```命令输出结果添加到/etc/mdadm/mdadm.conf(Debian和derivatives)或者/etc/mdadm.conf(Cent0S/openSUSE),如下。 - - # mdadm --detail --scan - - -![Monitor RAID Array](http://www.tecmint.com/wp-content/uploads/2014/10/Monitor-RAID-Array.png) - -监控RAID阵列 - - # mdadm --assemble --scan [Assemble the array] - -为了确保服务能够开机启动,需要以root权限运行以下命令。 - -**Debian 和 Derivatives** - -Debian 和 Derivatives能够通过下面步骤使服务默认开机启动 - - # update-rc.d mdadm defaults - -在/etc/default/mdadm文件中添加下面这一行 - - AUTOSTART=true - - -**CentOS 和 openSUSE(systemd-based)** - - # systemctl start mdmonitor - # systemctl enable mdmonitor - -**CentOS 和 openSUSEi(SysVinit-based)** - - # service mdmonitor start - # chkconfig mdmonitor on - -**5. 检查RAID磁盘故障** - -在支持冗余的的RAID级别中,在需要时会替换故障的驱动器。当磁盘阵列中的设备出现故障时,仅当存在我们第一次创建阵列时预留的备用设备时,磁盘阵列会将自动启动重建。 - -![Check RAID Faulty Disk](http://www.tecmint.com/wp-content/uploads/2014/10/Check-RAID-Faulty-Disk.png) - -检查RAID故障磁盘 - -否则,我们需要手动连接一个额外的物理驱动器到我们的系统,并且运行。 - - # mdadm /dev/md0 --add /dev/sdX1 - -/dev/md0是出现了问题的阵列,而/dev/sdx1是新添加的设备。 - -**6. 分解一个工作阵列** - -如果你需要使用工作阵列的设备创建一个新的阵列,你可能不得不去分解已有工作阵列——(可选步骤) - - # 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. 设置邮件通知** - -你可以配置一个用于发送通知的有效邮件地址或者系统账号(确保在mdadm.conf文件中有下面这一行)。——(可选步骤) - - MAILADDR root - -在这种情况下,来自RAID后台监控程序所有的通知将会发送到你的本地root账号的邮件箱中。其中一个类似的通知如下。 - -说明:此次通知事件和第5步中的例子相关。一个设备被标志为错误并且一个空闲的设备自动地被mdadm加入到阵列。我们用完了所有"健康的"空闲设备,因此我们得到了通知。 - -![RAID Monitoring Alerts](http://www.tecmint.com/wp-content/uploads/2014/10/RAID-Monitoring-Alerts.png) - -RAID监控通知 - -#### 了解RAID级别 #### - -** RAID 0 ** - -阵列总大小是最小分区大小的n倍,n是阵列中独立磁盘的个数(你至少需要两个驱动器/磁盘)。运行下面命令,使用/dev/sdb1和/dev/sdc1分区组装一个RAID 0 阵列。 - - # mdadm --create --verbose /dev/md0 --level=stripe --raid-devices=2 /dev/sdb1 /dev/sdc1 - -常见用途:用于支持性能比容错更重要的实时应用程序的设置 - -**RAID 1 (又名镜像/Mirroring)** - -阵列总大小等于最小分区大小(你至少需要两个驱动器/磁盘)。运行下面命令,使用/dev/sdb1和/dev/sdc1分区组装一个RAID 1 阵列。 - - # mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sdb1 /dev/sdc1 - -常见用途:操作系统的安装或者重要的子文件夹,例如 /home - -**RAID 5 (又名奇偶校验码盘/drives with Parity)** - -阵列总大小将是最小分区大小的(n-1)倍。//用于奇偶校验(冗余)计算(你至少需要3个驱动器/磁盘)。 - -说明:你可以指定一个空闲设备(/dev/sde1)替换问题出现时的故障部分(分区)。运行下面命令,使用/dev/sdb1, /dev/sdc1, /dev/sdd1,/dev/sde1组装一个RAID 5 阵列,其中/dev/sde1作为空闲分区。 - - # mdadm --create --verbose /dev/md0 --level=5 --raid-devices=3 /dev/sdb1 /dev/sdc1 /dev/sdd1 --spare-devices=1 /dev/sde1 - -常见用途:Web和文件服务 - -**RAID 6 (又名双重奇偶校验码盘/drives with double Parity)** - -阵列总大小为(n*s)-2*s,其中n为阵列中独立磁盘的个数,s为最小磁盘大小。 - -说明:你可以指定一个空闲分区(在这个例子为/dev/sdf1)替换问题出现时的故障部分(分区)。 - -运行下面命令,使用/dev/sdb1, /dev/sdc1, /dev/sdd1, /dev/sde1和/dev/sdf1组装RAID 6阵列,其中/dev/sdf1作为空闲分区。 - - # mdadm --create --verbose /dev/md0 --level=6 --raid-devices=4 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde --spare-devices=1 /dev/sdf1 - -常见用途:大容量、高可用性要求的文件服务器和备份服务器。 - -**RAID 1+0 (又名镜像条带/stripe of mirrors)** - -因为RAID 1+0是RAID 0 和 RAID 1的组合,所以阵列总大小是基于两者的公式计算的。首先,计算每一个镜像的大小,然后再计算条带的大小。 - - - # mdadm --create --verbose /dev/md0 --level=10 --raid-devices=4 /dev/sd[b-e]1 --spare-devices=1 /dev/sdf1 - -常见用途:需要快速IO操作的数据库和应用服务器 - -#### 创建和管理系统备份 #### - -记住RAID其所有的价值不是在于备份的替换者是对你有益的!在黑板上写上1000次,如果你需要的话,但无论何时一定要记住它。在我们开始前,我们必须注意的是,没有一个放之四海皆准的针对所有系统备份的解决方案,但这里有一些东西,是你在规划一个备份策略时需要考虑的。 - -- 你的系统将用于什么?(桌面或者服务器?如果系统是应用于后者,那么最重要的服务是什么——//其配置?) -- 你每隔多久备份你的系统? -- 你需要备份的数据是什么(比如 文件/文件夹/数据库转储)?你还可以考虑是否需要备份大型文件(比如音频和视频文件)。 -- 这些备份将会存储在哪里(物理位置和媒体)? - -**备份你的数据** - -方法1:使用dd命令备份整个磁盘。你可以在任意时间点通过创建一个准确的镜像来备份一整个硬盘或者是分区。注意当设备是离线时,这种方法效果最好,也就是说它没有被挂载并且没有任何进程的I/O操作访问它。 - -这种备份方法的缺点是镜像将具有和磁盘或分区一样的大小,即使实际数据占用的是一个很小的比例。比如,如果你想要为只使用了10%的20GB的分区创建镜像,那么镜像文件将仍旧是20GB。换句话来讲,它不仅包含了备份的实际数据,而且也包含了整个分区。如果你想完整备份你的设备,那么你可以考虑使用这个方法。 - -**从现有的设备创建一个镜像文件** - - # dd if=/dev/sda of=/system_images/sda.img - 或者 - --------------------- 可选地,你可以压缩镜像文件 ------------------- - # dd if=/dev/sda | gzip -c > /system_images/sda.img.gz - -**从镜像文件恢复备份** - - # dd if=/system_images/sda.img of=/dev/sda - 或者 - --------------------- 根据你创建镜像文件时的选择(译者注:比如压缩) ---------------- - # gzip -dc /system_images/sda.img.gz | dd of=/dev/sda - -方法2:使用tar命令备份确定的文件/文件夹——已经在本系列[Part 3][3]中讲了。如果你想要备份指定的文件/文件夹(配置文件,用户主目录等等),你可以使用这种方法。 - -方法3:使用rsync命令同步文件。rsync是一种多功能远程(和本地)文件复制工具。如果你想要从网络设备备份或同步文件,rsync是一种选择。 - - -无论是你是正在同步两个本地文件夹还是本地 < — > 挂载在本地文件系统的远程文件夹,其基本语法是一样的。 - - # rsync -av source_directory destination directory - -在这里,-a 递归遍历子目录(如果它们存在的话),维持符号链接、时间戳、权限以及原本的属主/属组,-v 显示详细过程。 - -![rsync Synchronizing Files](http://www.tecmint.com/wp-content/uploads/2014/10/rsync-synchronizing-Files.png) - -rsync 同步文件 - -除此之外,如果你想增加在网络上传输数据的安全性,你可以通过rsync使用ssh协议。 - -**通过ssh同步本地 → 远程文件夹** - - # rsync -avzhe ssh backups root@remote_host:/remote_directory/ - -这个示例,本地主机上的backups文件夹将与远程主机上的/root/remote_directory的内容同步。 - -在这里,-h 选项以人可读的格式显示文件的大小,-e 标志用于表示一个ssh连接。 - -![rsync Synchronize Remote Files](http://www.tecmint.com/wp-content/uploads/2014/10/rsync-synchronize-Remote-Files.png) - -rsync 同步远程文件 - -**通过ssh同步远程 → 本地 文件夹** - -在这种情况下,交换前面示例中的source和destination文件夹。 - - # rsync -avzhe ssh root@remote_host:/remote_directory/ backups - -请注意这些只是rsync用法的三个示例而已(你可能遇到的最常见的情形)。对于更多有关rsync命令的示例和用法 ,你可以查看下面的文章。 - -- Read Also: [10 rsync Commands to Sync Files in Linux][4] - -### Summary ### - -作为一个系统管理员,你需要确保你的系统表现得尽可能好。如果你做好了充分准备,并且如果你的数据完整性能被诸如RAID和系统日常备份的存储技术支持,那你将是安全的。 - -如果你有有关完善这篇文章的问题、评论或者进一步的想法,可以在下面畅所欲言。除此之外,请考虑通过你的社交网络简介分享这系列文章。 - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/creating-and-managing-raid-backups-in-linux/ - -作者:[Gabriel Cánepa][a] -译者:[cpsoture](https://github.com/cposture) -校对:[校对者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/ - From e5f0d14989cbc509908229c7e197b8ecd0224087 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 16 Apr 2016 21:07:28 +0800 Subject: [PATCH 0622/1469] =?UTF-8?q?20160416-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...dopts Open Container Project Components.md | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 sources/tech/20160415 Docker 1.11 Adopts Open Container Project Components.md diff --git a/sources/tech/20160415 Docker 1.11 Adopts Open Container Project Components.md b/sources/tech/20160415 Docker 1.11 Adopts Open Container Project Components.md new file mode 100644 index 0000000000..b10e13fe95 --- /dev/null +++ b/sources/tech/20160415 Docker 1.11 Adopts Open Container Project Components.md @@ -0,0 +1,48 @@ +Docker 1.11 Adopts Open Container Project Components +======================================================= + +![](http://images.techhive.com/images/article/2015/01/docker-620x465-100559026-primary.idge.jpg) + +>Docker's participation in the Open Container project has come full circle, as the latest version of Docker is now built with components donated by Docker to the OCP + +The biggest news about [Docker 1.11][1] isn't features in the application, but that it uses component versions standardized under the aegis of the Open Container Project. + +Last year, Docker donated the core of its [runC][2] runtime to the OCP as a basis for building container tools. The same went for [containerd][3], a daemon or server used to control instances of runC. Docker 1.11 now uses the donated and publicly worked-on versions of those projects. + +>[ Dig into the the red-hot open source framework in InfoWorld's [beginner's guide to Docker][4]. Pick it up today! | Get a digest of the day's top tech stories in the [InfoWorld Daily newsletter][5]. ] + +>Docker is making this move to challenge the narrative that its container ecosystem is still [dictated chiefly by Docker itself][6]. It isn't donating its container specs and runtime details to the OCP merely for show; it wants the future development of the project to be as open-ended and inclusive as possible. + +![](http://images.techhive.com/images/article/2016/04/docker-runc-100656060-large.idge.png) + +>Docker 1.11 has been reworked to use the runC and containerd components contributed to the Open Container Project. The runC engine can be swapped out and replaced if needed. + +[Two chief committers][7] on runC are Docker employees, but committers from Virtuozzo (of Parallels fame), Red Hat's OpenShift and Project Atomic projects, Huawei, GE Healthcare, and Suse Linux have all been regulars as well. + +The more visible changes in Docker 1.11 reflect this. Previously, the Docker runtime was the only one available within Docker, and critics felt this limited users' choices. The runc runtime is now swappable; while Docker ships with runc as the default engine, any other compatible engine can be swapped in. (Docker also wants it to be possible to do this without having to kill and restart currently running containers, but that's an improvement scheduled for later.) + +Docker is making a case for this OCP-based development process as an inherently better method to create its product. "Splitting Docker up into focused independent tools means more focused maintainers, and ultimately better quality software," stated Docker in its [official blog post][8] announcing 1.11. + +Aside from fixing long-standing bugs and ensuring the runC/containerd version of Docker didn't slow down, Docker has rolled a slew of improvements into Docker 1.11. Docker Engine now supports VLANs and IPv6 service discovery, and it automatically performs DNS round-robin load balancing across multiple containers that have the same alias. + + + +------------------------------------------------------------------------------ + +via: http://www.infoworld.com/article/3055966/open-source-tools/docker-111-adopts-open-container-project-components.html + +作者:[Serdar Yegulalp][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.infoworld.com/author/Serdar-Yegulalp/ +[1]: https://blog.docker.com/2016/04/docker-engine-1-11-runc/ +[2]: http://runc.io/ +[3]: https://containerd.tools/ +[4]: http://www.infoworld.com/resources/16373/application-virtualization/the-beginners-guide-to-docker#tk.ifw-infsb +[5]: http://www.infoworld.com/newsletters/signup.html#tk.ifw-infsb +[6]: http://www.infoworld.com/article/2876801/application-virtualization/docker-reorganization-grows-up.html +[7]: https://github.com/opencontainers/runc/graphs/contributors +[8]: https://blog.docker.com/2016/04/docker-engine-1-11-runc/ From 3cebe0a33a79b0cb0afa119be3feefbddf9a58c2 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 16 Apr 2016 21:13:08 +0800 Subject: [PATCH 0623/1469] =?UTF-8?q?20160416-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ith Extensive File Control Capabilities.md | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 sources/news/20160415 ownCloud 9.0 Enterprise Edition Arrives with Extensive File Control Capabilities.md diff --git a/sources/news/20160415 ownCloud 9.0 Enterprise Edition Arrives with Extensive File Control Capabilities.md b/sources/news/20160415 ownCloud 9.0 Enterprise Edition Arrives with Extensive File Control Capabilities.md new file mode 100644 index 0000000000..6249163578 --- /dev/null +++ b/sources/news/20160415 ownCloud 9.0 Enterprise Edition Arrives with Extensive File Control Capabilities.md @@ -0,0 +1,32 @@ +ownCloud 9.0 Enterprise Edition Arrives with Extensive File Control Capabilities +================================================================================== + +>ownCloud, Inc. has had the great pleasure of [announcing][1] the availability of the Enterprise Edition (EE) of its powerful ownCloud 9.0 self-hosting cloud server solution. + +Engineered exclusively for small- and medium-sized business, as well as major organizations and enterprises, [ownCloud 9.0 Enterprise Edition][2] is now available with extensive file control capabilities and all the cool new features that made the open-source version of the project famous amongst Linux users. + +Prominent new features in ownCloud 9.0 Enterprise Edition are built-in Auto-Tagging and File Firewall apps, which have been based on some of the new features of ownCloud 9.0, such as file tags, file comments, as well as notifications and activities enhancements. This offers system administrators the ability to set rules and classifications for shared documents based on user- or system-applied tags. + +"To illustrate how this can work, imagine working in a publicly traded company which has to be very careful not to release financial information ahead of official disclosure," reads the [announcement][3]. "While sharing this information internally it could end up in a folder which is shared through a public link. By assigning a special system tag, admins can configure the system to ensure the files are not available for download despite this mistake." + +### Used by over 8 million people around the globe + +ownCloud 9.0 is the best release of the open-source self-hosting cloud server software so far, which is currently used by over 8 million users around the globe. The release has brought a huge number of new features, such as code signing, as well as dozens of under-the-hood improvements and cosmetic changes. ownCloud 9.0 also got its first point release, version 9.0.1, last week, which [introduced even more enhancements][4]. + +And now, enterprises can take advantage of ownCloud 9.0's new features to differentiate between storage type and location, as well as the location of users, groups, and clients. ownCloud 9.0 Enterprise Edition gives them extensive access control, which is perfect if they have strict company guidelines or work with all sorts of regulations and rules. Below, you can see the File Firewall and Auto-Tagging apps in action. + +------------------------------------------------------------------------------ + +via: http://news.softpedia.com/news/owncloud-9-0-enterprise-edition-arrives-with-extensive-file-control-capabilities-502985.shtml + +作者:[Marius Nestor][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://news.softpedia.com/editors/browse/marius-nestor +[1]: https://owncloud.com/blog-introducing-owncloud-9-enterprise-edition/ +[2]: https://owncloud.com/ +[3]: https://owncloud.org/blog/owncloud-9-0-enterprise-edition-is-now-available/ +[4]: http://news.softpedia.com/news/owncloud-9-0-gets-its-first-point-release-over-120-improvements-introduced-502698.shtml From 9f99323e3b9302b931d48401633c5a102099bf2f Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 16 Apr 2016 21:16:38 +0800 Subject: [PATCH 0624/1469] =?UTF-8?q?20160416-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...017 Because of SUSE Linux Enterprise 12.md | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 sources/news/20160414 Linux Kernel 3.12 to Be Supported Until 2017 Because of SUSE Linux Enterprise 12.md diff --git a/sources/news/20160414 Linux Kernel 3.12 to Be Supported Until 2017 Because of SUSE Linux Enterprise 12.md b/sources/news/20160414 Linux Kernel 3.12 to Be Supported Until 2017 Because of SUSE Linux Enterprise 12.md new file mode 100644 index 0000000000..5f8bf0a944 --- /dev/null +++ b/sources/news/20160414 Linux Kernel 3.12 to Be Supported Until 2017 Because of SUSE Linux Enterprise 12.md @@ -0,0 +1,31 @@ +Linux Kernel 3.12 to Be Supported Until 2017 Because of SUSE Linux Enterprise 12 +================================================================================== + +>Linux kernel developer Jiri Slaby has announced the release of the fifty-eighth maintenance build of the long-term supported Linux 3.12 kernel series, as well as a modification to its EOL status. + +Linux kernel 3.12.58 LTS is now available, and those running it on their Linux kernel-based operating system must update as soon as possible. And the good news is that the Linux 3.12 branch is here to stay for one more year, until 2017, because SUSE Linux Enterprise (SLE) 12 Service Pack 1 is based on it. + +"Since SLE12-SP1 is based upon 3.12 and its EOL is in 2017, move the EOL of 3.12 to 2017 too," said Jiri Slaby in a [patch announcement][1] sent to one of Linux kernel's mailing lists, where he has also revealed the "end of life" statuses for other kernel branches, such as August 2016 for Linux 3.14, January 2017 for Linux 3.18, or September 2017 for Linux 4.1. + +### What's new in Linux kernel 3.12.58 LTS + +If you're wondering what's new in Linux kernel 3.12.58 LTS, we can tell you that, according to the [appended shortlog][2], it is a pretty healthy update that changes a total of 114 files, with 835 insertions and 298 deletions. Among the changes, we can notice the usual sound and networking stack improvements, and many updated drivers. + +There are also multiple improvements to the x86 hardware architecture, along with small fixes for the Xtensa and s390 ones. Filesystems like NFS, OCFS2, Btrfs, JBD2, and XFS have also received various fixes, and among the updated drivers, we can mention USB, Xen, MD, MTD, media, SCSI, TTY, networking, ATA, Bluetooth, hwmon, EDAC, and CPUFreq. + +As usual, you can [download the Linux kernel 3.12.58 LTS sources][3] right now via our website or directly from kernel.org. Please update your GNU/Linux operating system as soon as possible if it is powered by a kernel from the Linux 3.12 series. + +------------------------------------------------------------------------------ + +via: http://www.linux.com/news/featured-blogs/191-linux-training/834644-7-steps-to-start-your-linux-sysadmin-career + +作者:[Marius Nestor][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://news.softpedia.com/editors/browse/marius-nestor +[1]: http://lkml.iu.edu/hypermail/linux/kernel/1604.1/00792.html +[2]: http://www.spinics.net/lists/stable/msg128634.html +[3]: http://linux.softpedia.com/get/System/Operating-Systems/Kernels/Linux-Kernel-Stable-1960.shtml From 9b9327a507fda1635d6c70170d17b6e075cef693 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 16 Apr 2016 21:30:27 +0800 Subject: [PATCH 0625/1469] =?UTF-8?q?20160416-4=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... to navigating OpenStack Infrastructure.md | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 sources/tech/20160416 A newcomer's guide to navigating OpenStack Infrastructure.md diff --git a/sources/tech/20160416 A newcomer's guide to navigating OpenStack Infrastructure.md b/sources/tech/20160416 A newcomer's guide to navigating OpenStack Infrastructure.md new file mode 100644 index 0000000000..5a12f7a3d1 --- /dev/null +++ b/sources/tech/20160416 A newcomer's guide to navigating OpenStack Infrastructure.md @@ -0,0 +1,76 @@ +A newcomer's guide to navigating OpenStack Infrastructure +=========================================================== + +New contributors to OpenStack are welcome, but having a road map for navigating within this maturing, fast-paced open source community doesn't hurt. At OpenStack Summit in Austin, [Paul Belanger][1] (Red Hat, Inc.), [Elizabeth K. Joseph][2] (HPE), and [Christopher Aedo][3] (IBM) will lead a session on [OpenStack Infrastructure for Beginners][4]. In this interview, they offer tips and resources to help onboard new OpenStack contributors. + +![](https://opensource.com/sites/default/files/images/life/Interview%20banner%20Q%26A.png) + +**Your talk description says you'll be "diving into the heart of infrastructure and explain everything you need to know about the systems that keep OpenStack working." That's a tall order for a 40-minute time slot. What are the top things beginners should know about OpenStack infrastructure?** + +**Elizabeth K. Joseph (EKJ)**: We don't use GitHub for OpenStack patches. This is something that trips up a lot of new contributors because we do maintain mirrors of all our repositories on GitHub for historical reasons. Instead we use a fully open source code review and continuous integration (CI) system maintained by the OpenStack Infrastructure team. Relatedly, since we run a CI system, every change proposed to OpenStack is tested before merging. + +**Paul Belanger (PB)**: A lot of passionate people in the project, so don't get discouraged if your patch gets a -1. + +**Christopher Aedo (CA)**: The community wants to help you succeed, don't be afraid to ask questions or ask for pointers to more information to improve your understanding. + +### Which online resources would you recommend for beginners to fill in the holes for what you can't cover in your talk? + +**PB**: Definitely our [OpenStack Project Infrastructure documentation][5]. At lot of effort has been taken to keep it up to date as much as possible. Every system used in running OpenStack as a project has a dedicated page, even the OpenStack cloud the Infrastructure teams is bringing online. + +**EKJ**: I'll echo what Paul said about the Infrastructure documentation, and add that we love seeing patches from folks who are learning. We often don't realize what we're missing in terms of documentation until someone asks. So read, learn, and then help us fill in the gaps. You can ask questions on the [openstack-infra mailing list][6] or in our IRC channel at #openstack-infra on Freenode. + +**CA**: I love [this detailed post][7] about building images, by Ian Wienand. + +### Which "gotchas" should new OpenStack contributors look out for? + +**EKJ**: Contributing is not just about submitting new code and new features; the OpenStack community places a very high value on doing code reviews. If you want people to look at a patch you submitted, consider reviewing some of the work of others and providing clear and constructive feedback. The more your fellow contributors know about your work and see you doing reviews, the more likely you'll get your code reviewed in a timely manner. + +**CA**: I see a lot of newcomers getting tripped up with [Gerrit][8]. Read through the [developer workflow][9] in the Developers Guide, and then maybe read through it one more time. If you're not used to Gerrit, it can seem confusing and overwhelming at first, but walking through a few code reviews usually makes it all come together. Also, I'm a big fan of IRC. It can be a great place to get help, but it's best if you can maintain a persistent presence so people can answer your questions even if you're not "there" at that particular moment. (Read [IRC, the secret to success in open source][10].) You don't need to be "always on," but the ability to easily scroll back in a channel and catch up on a conversation can be invaluable. + +**PB**: I agree with both Elizabeth and Chris—Gerrit is what to look out for. It is going to be the hub of your development effort. Not only will you be submitting code for people to review, but you'll also be reviewing other contributors' code. Watch out for the Gerrit UI; it can be confusing at times. I'd recommend trying out [Gertty][11], which is a console-based interface to the Gerrit Code Review system, which happens to be a project driven by OpenStack Infrastructure. + +### What resources do you recommend for beginners to help them network with other OpenStack contributors? + +**PB**: For me, it was using IRC and joining the #openstack-infra channel on Freenode ([IRC logs][12]). There is a lot of fantastic information and people in that channel. You get to see the day-to-day operations of the OpenStack project, and once you know how the project works, you'll have a better understanding on how to contribute to its future. + +**CA**: I want to second that note for IRC; staying on IRC throughout the day made a huge difference for me in terms of feeling informed and connected. It's also such a great way to get help when you're stuck with someone on one of the projects—the ones with active IRC channels always have someone around willing to get your issues sorted out. + +**EKJ**: The [openstack-dev mailing list][13] is quite important for staying up to date with news about projects you're working on inside of OpenStack, so I recommend subscribing to that. The mailing list uses subject tags to separate projects, so you can instruct your email client to use those and focus on threads that impact projects you care about. Beyond online resources, many OpenStack groups have popped up all over the world that serve the needs of both users and contributors to OpenStack, and many of them routinely have talks and events with key OpenStack contributors. You can search on Meetup.com in your area, or search on [groups.openstack.org][14] to see if there is an OpenStack group in your area. Finally, there are the [OpenStack Summits][15], which happen every six months, and where we'll be giving our Infrastructure talk. In their current format, the summits consist of both a user conference and a developer conference in one space to talk about everything related to OpenStack, past, present, and future. + +### In which areas does OpenStack need to improve to become more beginner-friendly? + +**PB**: I think our [account-setup][16] process could be made easier for new contributors, especially how many steps are needed to submit your first patch. There is a large cost to enroll into OpenStack development model, which maybe be too much for contributors; however, once enrolled, the model works fantastic for developers. + +**CA**: We have a very pro-developer community, but the focus is on developing OpenStack itself, with less consideration given to the users of OpenStack clouds. We need to bring in application developers and encourage more people to develop things that run beautifully on OpenStack clouds, and encourage them to share those apps in the [Community App Catalog][17]. We can do this by continuing to improve our API standards and by ensuring different libraries (like libcloud, phpopencloud, and others) continue to work reliably for developers. Oh, also by sponsoring more OpenStack hackathons! All these things can ease entry for newcomers, which will lead to them sticking around. + +**EKJ**: I've worked on open source software for many years, but for a large number of OpenStack developers, this is the first open source project they've every worked on. I've found that their proprietary software background doesn't prepare them for the open source ideals, methodologies, and collaboration techniques used in an open source project. I'd love to see us do a better job of welcoming people who have this proprietary software background and working with them so they can truly understand the value of what they're working on in the open source software community. + +### I think 2016 is shaping up to be the Year of the Open Source Haiku. Explain OpenStack to beginners via Haiku. + +**PB**: OpenStack runs clouds If you enjoy free software Submit your first patch + +**CA**: In the near future OpenStack will rule the world Help make it happen! + +**EKJ**: OpenStack is free Deploy on your own servers And run your own cloud! + +*Paul, Elizabeth*, and Christopher will be [speaking at OpenStack Summit][18] in Austin on Monday, April 25, starting at 11:15am. + + +[1]: https://twitter.com/pabelanger +[2]: https://twitter.com/pleia2 +[3]: https://twitter.com/docaedo +[4]: https://www.openstack.org/summit/austin-2016/summit-schedule/events/7337 +[5]: http://docs.openstack.org/infra/system-config/ +[6]: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-infra +[7]: https://www.technovelty.org/openstack/image-building-in-openstack-ci.html +[8]: https://code.google.com/p/gerrit/ +[9]: http://docs.openstack.org/infra/manual/developers.html#development-workflow +[10]: https://developer.ibm.com/opentech/2015/12/20/irc-the-secret-to-success-in-open-source/ +[11]: https://pypi.python.org/pypi/gertty +[12]: http://eavesdrop.openstack.org/irclogs/%23openstack-infra/ +[13]: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev +[14]: https://groups.openstack.org/ +[15]: https://www.openstack.org/summit/ +[16]: http://docs.openstack.org/infra/manual/developers.html#account-setup +[17]: https://apps.openstack.org/ +[18]: https://www.openstack.org/summit/austin-2016/summit-schedule/events/7337 From 44632443306f0c6008903afe9b9bae2ba8ef0cd8 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 16 Apr 2016 21:31:43 +0800 Subject: [PATCH 0626/1469] =?UTF-8?q?update=2020160416-4=20=E9=80=89?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...'s guide to navigating OpenStack Infrastructure.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sources/tech/20160416 A newcomer's guide to navigating OpenStack Infrastructure.md b/sources/tech/20160416 A newcomer's guide to navigating OpenStack Infrastructure.md index 5a12f7a3d1..4fa50b0a45 100644 --- a/sources/tech/20160416 A newcomer's guide to navigating OpenStack Infrastructure.md +++ b/sources/tech/20160416 A newcomer's guide to navigating OpenStack Infrastructure.md @@ -56,6 +56,17 @@ New contributors to OpenStack are welcome, but having a road map for navigating *Paul, Elizabeth*, and Christopher will be [speaking at OpenStack Summit][18] in Austin on Monday, April 25, starting at 11:15am. +------------------------------------------------------------------------------ + +via: https://opensource.com/business/16/4/interview-openstack-infrastructure-beginners + +作者:[linux.com][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://rikkiendsley.com/ [1]: https://twitter.com/pabelanger [2]: https://twitter.com/pleia2 [3]: https://twitter.com/docaedo From 4a2537b44507c57b797dd27f0493c639ba0a8aa6 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 17 Apr 2016 08:34:06 +0800 Subject: [PATCH 0627/1469] PUB:20151114 How to Setup Drone - a Continuous Integration Service in Linux @oska874 --- ...Continuous Integration Service in Linux.md | 317 ++++++++++++++++++ ...Continuous Integration Service in Linux.md | 317 ------------------ 2 files changed, 317 insertions(+), 317 deletions(-) create mode 100644 published/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md delete mode 100644 translated/tech/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md diff --git a/published/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md b/published/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md new file mode 100644 index 0000000000..a22718badc --- /dev/null +++ b/published/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md @@ -0,0 +1,317 @@ +如何在 linux 上配置持续集成服务 - Drone +============================================================== + +如果你对一次又一次的克隆、构建、测试和部署代码感到厌倦了,可以考虑一下持续集成。持续集成简称 CI,是一种像我们一样的频繁提交的代码库,构建、测试和部署的软件工程实践。CI 可以帮助我们快速的集成新代码到已有的代码库。如果这个过程是自动化进行的,那么就会提高开发的速度,因为这可以减少开发人员手工构建和测试的时间。[Drone][1] 是一个自由开源项目,用来提供一个非常棒的持续集成服务的环境,采用 Apache 2.0 协议发布。它已经集成近很多代码库提供商,比如 Github、Bitbucket 以及 Google Code,它可以从代码库提取代码,使我们可以对包括 PHP, Node, Ruby, Go, Dart, Python, C/C++, JAVA 等等在内的各种语言编译构建。它是如此一个强大的平台,它使用了容器和 docker 技术,这让用户每次构建都可以在保证隔离的条件下完全控制他们自己的构建环境。 + +### 1. 安装 Docker ### + +首先,我们要安装 docker,因为这是 Drone 的工作流的最关键的元素。Drone 合理的利用了 docker 来构建和测试应用。容器技术提高了应用部署的效率。要安装 docker ,我们需要在不同的 linux 发行版本运行下面对应的命令,我们这里会说明 Ubuntu 14.04 和 CentOS 7 两个版本。 + +#### Ubuntu #### + +要在 Ubuntu 上安装 Docker ,我们只需要运行下面的命令。 + + # apt-get update + # apt-get install docker.io + +安装之后我们需要使用`service` 命令重启 docker 引擎。 + + # service docker restart + +然后我们让 docker 在系统启动时自动启动。 + + # update-rc.d docker defaults + + Adding system startup for /etc/init.d/docker ... + /etc/rc0.d/K20docker -> ../init.d/docker + /etc/rc1.d/K20docker -> ../init.d/docker + /etc/rc6.d/K20docker -> ../init.d/docker + /etc/rc2.d/S20docker -> ../init.d/docker + /etc/rc3.d/S20docker -> ../init.d/docker + /etc/rc4.d/S20docker -> ../init.d/docker + /etc/rc5.d/S20docker -> ../init.d/docker + +#### CentOS #### + +第一,我们要更新机器上已经安装的软件包。我们可以使用下面的命令。 + + # sudo yum update + +要在 centos 上安装 docker,我们可以简单的运行下面的命令。 + + # curl -sSL https://get.docker.com/ | sh + +安装好 docker 引擎之后我么只需要简单使用下面的`systemd` 命令启动 docker,因为 centos 7 的默认初始化系统是 systemd。 + + # systemctl start docker + +然后我们要让 docker 在系统启动时自动启动。 + + # systemctl enable docker + + ln -s '/usr/lib/systemd/system/docker.service' '/etc/systemd/system/multi-user.target.wants/docker.service' + +### 2. 安装 SQlite 驱动 ### + +Drone 默认使用 SQlite3 数据库服务器来保存数据和信息。它会在 /var/lib/drone/ 自动创建名为 drone.sqlite 的数据库来处理数据库模式的创建和迁移。要安装 SQlite3 我们要完成以下几步。 + +#### Ubuntu 14.04 #### + +因为 SQlite3 存在于 Ubuntu 14.04 的默认软件库,我们只需要简单的使用 apt 命令安装它。 + + # apt-get install libsqlite3-dev + +#### CentOS 7 #### + +要在 Centos 7 上安装需要使用下面的 yum 命令。 + + # yum install sqlite-devel + +### 3. 安装 Drone ### + +最后,我们安装好依赖的软件,我们现在更进一步的接近安装 Drone。在这一步里我们只简单的从官方链接下载对应的二进制软件包,然后使用默认软件包管理器安装 Drone。 + +#### Ubuntu #### + +我们将使用 wget 从官方的 [Debian 文件下载链接][2]下载 drone 的 debian 软件包。下面就是下载命令。 + + # wget downloads.drone.io/master/drone.deb + + Resolving downloads.drone.io (downloads.drone.io)... 54.231.48.98 + Connecting to downloads.drone.io (downloads.drone.io)|54.231.48.98|:80... connected. + HTTP request sent, awaiting response... 200 OK + Length: 7722384 (7.4M) [application/x-debian-package] + Saving to: 'drone.deb' + 100%[======================================>] 7,722,384 1.38MB/s in 17s + 2015-11-06 14:09:28 (456 KB/s) - 'drone.deb' saved [7722384/7722384] + +下载好之后,我们将使用 dpkg 软件包管理器安装它。 + + # dpkg -i drone.deb + + Selecting previously unselected package drone. + (Reading database ... 28077 files and directories currently installed.) + Preparing to unpack drone.deb ... + Unpacking drone (0.3.0-alpha-1442513246) ... + Setting up drone (0.3.0-alpha-1442513246) ... + Your system ubuntu 14: using upstart to control Drone + drone start/running, process 9512 + +#### CentOS #### + +在 CentOS 机器上我们要使用 wget 命令从[下载链接][3]下载 RPM 包。 + + # wget downloads.drone.io/master/drone.rpm + + --2015-11-06 11:06:45-- http://downloads.drone.io/master/drone.rpm + Resolving downloads.drone.io (downloads.drone.io)... 54.231.114.18 + Connecting to downloads.drone.io (downloads.drone.io)|54.231.114.18|:80... connected. + HTTP request sent, awaiting response... 200 OK + Length: 7763311 (7.4M) [application/x-redhat-package-manager] + Saving to: ‘drone.rpm’ + 100%[======================================>] 7,763,311 1.18MB/s in 20s + 2015-11-06 11:07:06 (374 KB/s) - ‘drone.rpm’ saved [7763311/7763311] + +然后我们使用 yum 安装 rpm 包。 + + # yum localinstall drone.rpm + +### 4. 配置端口 ### + +安装完成之后,我们要先进行配置才能工作起来。drone 的配置文件在**/etc/drone/drone.toml** 。默认情况下 drone 的 web 接口使用的是80,而这也是 http 默认的端口,如果我们修改它,请按下面所示的修改配置文件里 server 块对应的值。 + + [server] + port=":80" + +### 5. 集成 Github ### + +为了运行 Drone 我们必须设置最少一个和 GitHub、GitHub 企业版,Gitlab,Gogs,Bitbucket 关联的集成点。在本文里我们只集成了 github,但是如果我们要集成其他的服务,我们可以在配置文件做修改。为了集成 github 我们需要在github 的设置里创建一个新的应用:https://github.com/settings/developers 。 + +![Registering App Github](http://blog.linoxide.com/wp-content/uploads/2015/11/registering-app-github.png) + +要创建一个应用,我们需要在 `New Application` 页面点击 `Register`,然后如下所示填表。 + +![Registering OAuth app github](http://blog.linoxide.com/wp-content/uploads/2015/11/registering-OAuth-app-github.png) + +我们应该保证在应用的配置项里设置了**授权回调链接**,链接看起来类似 `http://drone.linoxide.com/api/auth/github.com`。然后我们点击注册应用。所有都做好之后我们会看到我们需要在我们的 Drone 配置文件里配置的客户端 ID 和客户端密钥。 + +![Client ID and Secret Token](http://blog.linoxide.com/wp-content/uploads/2015/11/client-id-secret-token.png) + +在这些都完成之后我们需要使用文本编辑器编辑 drone 配置文件,比如使用下面的命令。 + + # nano /etc/drone/drone.toml + +然后我们会在 drone 的配置文件里面找到`[github]` 部分,紧接着的是下面所示的配置内容 + + [github] + client="3dd44b969709c518603c" + secret="4ee261abdb431bdc5e96b19cc3c498403853632a" + # orgs=[] + # open=false + +![Configuring Github Drone](http://blog.linoxide.com/wp-content/uploads/2015/11/configuring-github-drone-e1446835124465.png) + +### 6. 配置 SMTP 服务器 ### + +如果我们想让 drone 使用 email 发送通知,那么我们需要在 SMTP 配置里面设置我们的 SMTP 服务器。如果我们已经有了一个 SMTP 服务,那就只需要简单的使用它的配置文件就行了,但是因为我们没有一个 SMTP 服务器,我们需要安装一个 MTA 比如 Postfix,然后在 drone 配置文件里配置好 SMTP。 + +#### Ubuntu #### + +在 ubuntu 里使用下面的 apt 命令安装 postfix。 + + # apt-get install postfix + +#### CentOS #### + +在 CentOS 里使用下面的 yum 命令安装 postfix。 + + # yum install postfix + +安装好之后,我们需要编辑我们的 postfix 配置文件。 + + # nano /etc/postfix/main.cf + +然后我们要把 myhostname 的值替换为我们自己的 FQDN,比如 drone.linoxide.com。 + + myhostname = drone.linoxide.com + +现在开始配置 drone 配置文件里的 SMTP 部分。 + + # nano /etc/drone/drone.toml + +找到`[smtp]` 部分补充上下面的内容。 + + [smtp] + host = "drone.linoxide.com" + port = "587" + from = "root@drone.linoxide.com" + user = "root" + pass = "password" + +![Configuring SMTP Drone](http://blog.linoxide.com/wp-content/uploads/2015/11/configuring-smtp-drone.png) + +注意:这里的 **user** 和 **pass** 参数强烈推荐一定要改成某个具体用户的配置。 + +### 7. 配置 Worker ### + +如我们所知的 drone 利用了 docker 完成构建、测试任务,我们需要把 docker 配置为 drone 的 worker。要完成这些需要修改 drone 配置文件里的`[worker]` 部分。 + + # nano /etc/drone/drone.toml + +然后取消底下几行的注释并且补充上下面的内容。 + + [worker] + nodes=[ + "unix:///var/run/docker.sock", + "unix:///var/run/docker.sock" + ] + +这里我们只设置了两个节点,这意味着上面的配置文件只能同时执行2 个构建操作。要提高并发性可以增大节点的值。 + + [worker] + nodes=[ + "unix:///var/run/docker.sock", + "unix:///var/run/docker.sock", + "unix:///var/run/docker.sock", + "unix:///var/run/docker.sock" + ] + +使用上面的配置文件 drone 被配置为使用本地的 docker 守护程序可以同时构建4个任务。 + +### 8. 重启 Drone ### + +最后,当所有的安装和配置都准备好之后,我们现在要在本地的 linux 机器上启动 drone 服务器。 + +#### Ubuntu #### + +因为 ubuntu 14.04 使用了 sysvinit 作为默认的初始化系统,所以只需要简单执行下面的 service 命令就可以启动 drone 了。 + + # service drone restart + +要让 drone 在系统启动时也自动运行,需要运行下面的命令。 + + # update-rc.d drone defaults + +#### CentOS #### + +因为 CentOS 7使用 systemd 作为初始化系统,所以只需要运行下面的 systemd 命令就可以重启 drone。 + + # systemctl restart drone + +要让 drone 自动运行只需要运行下面的命令。 + + # systemctl enable drone + +### 9. 添加防火墙例外规则 ### + +众所周知 drone 默认使用了80 端口而我们又没有修改它,所以我们需要配置防火墙程序允许80 端口(http)开放并允许其他机器可以通过网络连接。 + +#### Ubuntu 14.04 #### + +iptables 是最流行的防火墙程序,并且 ubuntu 默认安装了它。我们需要修改 iptable 以暴露端口80,这样我们才能让 drone 的 web 界面在网络上被大家访问。 + + # iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT + # /etc/init.d/iptables save + +#### CentOS 7 #### + +因为 CentOS 7 默认安装了 systemd,它使用 firewalld 作为防火墙程序。为了在 firewalld 上打开80端口(http 服务),我们需要执行下面的命令。 + + # firewall-cmd --permanent --add-service=http + + success + + # firewall-cmd --reload + + success + +### 10. 访问 web 界面 ### + +现在我们将在我们最喜欢的浏览器上通过 web 界面打开 drone。要完成这些我们要把浏览器指向运行 drone 的服务器。因为 drone 默认使用80 端口而我们有没有修改过,所以我们只需要在浏览器里根据我们的配置输入`http://ip-address/` 或 `http://drone.linoxide.com` 就行了。在我们正确的完成了上述操作后,我们就可以看到登录界面了。 + +![Login Github Drone](http://blog.linoxide.com/wp-content/uploads/2015/11/login-github-drone-e1446834688394.png) + +因为在上面的步骤里配置了 Github,我们现在只需要简单的选择 github 然后进入应用授权步骤,这些完成后我们就可以进入工作台了。 + +![Drone Dashboard](http://blog.linoxide.com/wp-content/uploads/2015/11/drone-dashboard.png) + +这里它会同步我们在 github 上的代码库,然后询问我们要在 drone 上构建那个代码库。 + +![Activate Repository](http://blog.linoxide.com/wp-content/uploads/2015/11/activate-repository-e1446835574595.png) + +这一步完成后,它会询问我们在代码库里添加`.drone.yml` 文件的新名称,并且在这个文件里定义构建的过程和配置项,比如使用那个 docker 镜像,执行那些命令和脚本来编译,等等。 + +我们按照下面的内容来配置我们的`.drone.yml`。 + + image: python + script: + - python helloworld.py + - echo "Build has been completed." + +这一步完成后我们就可以使用 drone 应用里的 YAML 格式的配置文件来构建我们的应用了。所有对代码库的提交和改变此时都会同步到这个仓库。一旦提交完成了,drone 就会自动开始构建。 + +![Building Application Drone](http://blog.linoxide.com/wp-content/uploads/2015/11/building-application-drone.png) + +所有操作都完成后,我们就能在终端看到构建的结果了。 + +![Build Success Drone](http://blog.linoxide.com/wp-content/uploads/2015/11/build-success-drone.png) + +### 总结 ### + +在本文中我们学习了如何安装一个可以工作的使用 drone 的持续集成平台。如果我们愿意我们甚至可以从 drone.io 官方提供的服务开始工作。我们可以根据自己的需求从免费的服务或者收费服务开始。它通过漂亮的 web 界面和强大的功能改变了持续集成的世界。它可以集成很多第三方应用和部署平台。如果你有任何问题、建议可以直接反馈给我们,谢谢。 + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/setup-drone-continuous-integration-linux/ + +作者:[Arun Pyasi][a] +译者:[ezio](https://github.com/oska874) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ +[1]:https://drone.io/ +[2]:http://downloads.drone.io/master/drone.deb +[3]:http://downloads.drone.io/master/drone.rpm +[4]:https://github.com/settings/developers diff --git a/translated/tech/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md b/translated/tech/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md deleted file mode 100644 index 077c945b9c..0000000000 --- a/translated/tech/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md +++ /dev/null @@ -1,317 +0,0 @@ -如何在linux 上配置持续集成服务 - Drone -============================================================== - -如果你对一次又一次的克隆、构建、测试和部署代码感到厌倦了,可以考虑一下持续集成。持续集成也就是CI,是软件工程的像我们一样的频繁提交的代码库,构建、测试和部署的实践。CI 帮助我们快速的集成新代码到已有的代码基线。如果这个过程是自动化进行的,那么就会提高开发的速度,因为这可以减少开发人员手工构建和测试的时间。[Drone][1] 是一个免费的开源项目,用来提供一个非常棒的持续集成服务的环境,采用了Apache 2.0 协议。它已经集成近很多代码库提供商,比如Github、Bitbucket 以及Google COde,并且它可以从代码库提取代码,使我们可以编译多种语言,包括PHP, Node, Ruby, Go, Dart, Python, C/C++, JAVA 等等。它是如此一个强大的平台是因为它每次构建都使用了容器和docker 技术,这让用户可以在保证隔离的条件下完全控制他们自己的构建环境。 - -### 1. 安装 Docker ### - -首先,我们要安装docker,因为这是Drone 的工作流的最关键的元素。Drone 合理的利用了docker 来构建和测试应用。容器技术提高了应用部署的效率。要安装docker ,我们需要在不同的linux 发行版本运行下面对应的命令,我们这里会说明Ubuntu 14.04 和CentOS 7 两个版本。 - -#### Ubuntu #### - -要在Ubuntu 上安装Docker ,我们只需要运行下面的命令。 - - # apt-get update - # apt-get install docker.io - -安装之后我们需要使用`service` 命令重启docker 引擎。 - - # service docker restart - -然后我们让docker 在系统启动时自动启动。 - - # update-rc.d docker defaults - - Adding system startup for /etc/init.d/docker ... - /etc/rc0.d/K20docker -> ../init.d/docker - /etc/rc1.d/K20docker -> ../init.d/docker - /etc/rc6.d/K20docker -> ../init.d/docker - /etc/rc2.d/S20docker -> ../init.d/docker - /etc/rc3.d/S20docker -> ../init.d/docker - /etc/rc4.d/S20docker -> ../init.d/docker - /etc/rc5.d/S20docker -> ../init.d/docker - -#### CentOS #### - -第一,我们要更新机器上已经安装的软件包。我们可以使用下面的命令。 - - # sudo yum update - -要在centos 上安装docker,我们可以简单的运行下面的命令。 - - # curl -sSL https://get.docker.com/ | sh - -安装好docker 引擎之后我么只需要简单实用下面的`systemd` 命令启动docker,因为centos 7 的默认init 系统是systemd。 - - # systemctl start docker - -然后我们要让docker 在系统启动时自动启动。 - - # systemctl enable docker - - ln -s '/usr/lib/systemd/system/docker.service' '/etc/systemd/system/multi-user.target.wants/docker.service' - -### 2. 安装 SQlite 驱动 ### - -Drone 默认使用SQLite3 数据库服务器来保存数据和信息。它会在/var/lib/drone/ 自动创建名为drone.sqlite 的数据库来处理数据库模式的创建和迁移。要安装SQLite3 我们要完成以下几步。 - -#### Ubuntu 14.04 #### - -因为SQLite3 存在于Ubuntu 14.04 的默认软件库,我们只需要简单的使用apt 命令安装它。 - - # apt-get install libsqlite3-dev - -#### CentOS 7 #### - -要在Centos 7 上安装选哟使用下面的yum 命令。 - - # yum install sqlite-devel - -### 3. 安装 Drone ### - -最后,我们安装好依赖的软件,我们现在更进一步的接近安装Drone。在这一步里我们值简单的从官方链接下载对应的二进制软件包,然后使用默认软件包管理器安装Drone。 - -#### Ubuntu #### - -我们将使用wget 从官方的[Debian 文件下载链接][2]下载drone 的debian 软件包。下面就是下载命令。 - - # wget downloads.drone.io/master/drone.deb - - Resolving downloads.drone.io (downloads.drone.io)... 54.231.48.98 - Connecting to downloads.drone.io (downloads.drone.io)|54.231.48.98|:80... connected. - HTTP request sent, awaiting response... 200 OK - Length: 7722384 (7.4M) [application/x-debian-package] - Saving to: 'drone.deb' - 100%[======================================>] 7,722,384 1.38MB/s in 17s - 2015-11-06 14:09:28 (456 KB/s) - 'drone.deb' saved [7722384/7722384] - -下载好之后,我们将使用dpkg 软件包管理器安装它。 - - # dpkg -i drone.deb - - Selecting previously unselected package drone. - (Reading database ... 28077 files and directories currently installed.) - Preparing to unpack drone.deb ... - Unpacking drone (0.3.0-alpha-1442513246) ... - Setting up drone (0.3.0-alpha-1442513246) ... - Your system ubuntu 14: using upstart to control Drone - drone start/running, process 9512 - -#### CentOS #### - -在CentOS 机器上我们要使用wget 命令从[下载链接][3]下载RPM 包。 - - # wget downloads.drone.io/master/drone.rpm - - --2015-11-06 11:06:45-- http://downloads.drone.io/master/drone.rpm - Resolving downloads.drone.io (downloads.drone.io)... 54.231.114.18 - Connecting to downloads.drone.io (downloads.drone.io)|54.231.114.18|:80... connected. - HTTP request sent, awaiting response... 200 OK - Length: 7763311 (7.4M) [application/x-redhat-package-manager] - Saving to: ‘drone.rpm’ - 100%[======================================>] 7,763,311 1.18MB/s in 20s - 2015-11-06 11:07:06 (374 KB/s) - ‘drone.rpm’ saved [7763311/7763311] - -然后我们使用yum 安装rpm 包。 - - # yum localinstall drone.rpm - -### 4. 配置端口 ### - -安装完成之后,我们要使它工作要先进行配置。drone 的配置文件在**/etc/drone/drone.toml** 。默认情况下drone 的web 接口使用的是80,而这也是http 默认的端口,如果我们要下面所示的修改配置文件里server 块对应的值。 - - [server] - port=":80" - -### 5. 集成 Github ### - -为了运行Drone 我们必须设置最少一个和GitHub、GitHub 企业版,Gitlab,Gogs,Bitbucket 关联的集成点。在本文里我们只集成了github,但是如果哦我们要集成其他的我们可以在配置文件做修改。为了集成github 我们需要在[github setting] 创建一个新的应用。 - -![Registering App Github](http://blog.linoxide.com/wp-content/uploads/2015/11/registering-app-github.png) - -要创建一个应用,我们需要在`New Application` 页面点击`Register`,然后如下所示填表。 - -![Registering OAuth app github](http://blog.linoxide.com/wp-content/uploads/2015/11/registering-OAuth-app-github.png) - -我们应该保证在应用的配置项里设置了**授权了的回调链接**,链接看起来像`http://drone.linoxide.com/api/auth/github.com`。然后我们点击注册应用。所有都做好之后我们会看到我们需要在我们的Drone 配置文件里配置的客户端ID 和客户端密钥。 - -![Client ID and Secret Token](http://blog.linoxide.com/wp-content/uploads/2015/11/client-id-secret-token.png) - -在这些都完成之后我们需要使用文本编辑器编辑drone 配置文件,比如使用下面的命令。 - - # nano /etc/drone/drone.toml - -然后我们会在drone 的配置文件里面找到`[github]` 部分,紧接着的是下面所示的配置内容 - - [github] - client="3dd44b969709c518603c" - secret="4ee261abdb431bdc5e96b19cc3c498403853632a" - # orgs=[] - # open=false - -![Configuring Github Drone](http://blog.linoxide.com/wp-content/uploads/2015/11/configuring-github-drone-e1446835124465.png) - -### 6. 配置 SMTP 服务器 ### - -如果我们想让drone 使用email 发送通知,那么我们需要在SMTP 配置里面设置我们的SMTP 服务器。如果我们已经有了一个SMTP 服务,那就只需要简单的使用它的配置文件就行了,但是因为我们没有一个SMTP 服务器,我们需要安装一个MTA 比如Postfix,然后在drone 配置文件里配置好SMTP。 - -#### Ubuntu #### - -在ubuntu 里使用下面的apt 命令安装postfix。 - - # apt-get install postfix - -#### CentOS #### - -在CentOS 里使用下面的yum 命令安装postfix。 - - # yum install postfix - -安装好之后,我们需要编辑我们的postfix 配置文件。 - - # nano /etc/postfix/main.cf - -然后我们要把myhostname 的值替换为我们自己的FQDN,比如drone.linoxide.com。 - - myhostname = drone.linoxide.com - -现在开始配置drone 配置文件里的SMTP 部分。 - - # nano /etc/drone/drone.toml - -找到`[smtp]` 部分补充上下面的内容。 - - [smtp] - host = "drone.linoxide.com" - port = "587" - from = "root@drone.linoxide.com" - user = "root" - pass = "password" - -![Configuring SMTP Drone](http://blog.linoxide.com/wp-content/uploads/2015/11/configuring-smtp-drone.png) - -注意:这里的**user** 和 **pass** 参数强烈推荐一定要改成一个用户的配置。 - -### 7. 配置 Worker ### - -如我们所知的drone 利用了docker 完成构建、测试任务,我们需要把docker 配置为drone 的worker。要完成这些需要修改drone 配置文件里的`[worker]` 部分。 - - # nano /etc/drone/drone.toml - -然后取消底下几行的注释并且补充上下面的内容。 - - [worker] - nodes=[ - "unix:///var/run/docker.sock", - "unix:///var/run/docker.sock" - ] - -这里我们只设置了两个节点,这意味着上面的配置文件只能同时执行2 个构建操作。要提高并发性可以增大节点的值。 - - [worker] - nodes=[ - "unix:///var/run/docker.sock", - "unix:///var/run/docker.sock", - "unix:///var/run/docker.sock", - "unix:///var/run/docker.sock" - ] - -使用上面的配置文件drone 被配置为使用本地的docker 守护程序可以同时构建4个任务。 - -### 8. 重启 Drone ### - -最后,当所有的安装和配置都准备好之后,我们现在要在本地的linux 机器上启动drone 服务器。 - -#### Ubuntu #### - -因为ubuntu 14.04 使用了sysvinit 作为默认的init 系统,所以只需要简单执行下面的service 命令就可以启动drone 了。 - - # service drone restart - -要让drone 在系统启动时也自动运行,需要运行下面的命令。 - - # update-rc.d drone defaults - -#### CentOS #### - -因为CentOS 7使用systemd 作为init 系统,所以只需要运行下面的systemd 命令就可以重启drone。 - - # systemctl restart drone - -要让drone 自动运行只需要运行下面的命令。 - - # systemctl enable drone - -### 9. 添加防火墙例外 ### - -众所周知drone 默认使用了80 端口而我们又没有修改他,所以我们需要配置防火墙程序允许80 端口(http)开发并允许其他机器可以通过网络连接。 - -#### Ubuntu 14.04 #### - -iptables 是最流行的防火墙程序,并且ubuntu 默认安装了它。我们需要修改iptable 暴露端口80,这样我们才能让drone 的web 界面在网络上被大家访问。 - - # iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT - # /etc/init.d/iptables save - -#### CentOS 7 #### - -因为CentOS 7 默认安装了systemd,它使用firewalld 作为防火墙程序。为了在firewalld 上打开80端口(http 服务),我们需要执行下面的命令。 - - # firewall-cmd --permanent --add-service=http - - success - - # firewall-cmd --reload - - success - -### 10. 访问web 界面 ### - -现在我们将在我们最喜欢的浏览器上通过web 界面打开drone。要完成这些我们要把浏览器指向运行drone 的服务器。因为drone 默认使用80 端口而我们有没有修改过,所以我们只需要在浏览器里根据我们的配置输入`http://ip-address/` 或 `http://drone.linoxide.com` 就行了。在我们正确的完成了上述操作后,我们就可以看到登陆界面了。 - -![Login Github Drone](http://blog.linoxide.com/wp-content/uploads/2015/11/login-github-drone-e1446834688394.png) - -因为在上面的步骤里配置了Github,我们现在只需要简单的选择github然后进入应用授权步骤,这些完成后我们就可以进入工作台了。 - -![Drone Dashboard](http://blog.linoxide.com/wp-content/uploads/2015/11/drone-dashboard.png) - -这里它会同步我们在github 上的代码库,然后询问我们要在drone 上构建那个代码库。 - -![Activate Repository](http://blog.linoxide.com/wp-content/uploads/2015/11/activate-repository-e1446835574595.png) - -这一步完成后,它会询问我们在代码库里添加`.drone.yml` 文件的新名称,并且在这个文件里定义构建的过程和配置项,比如使用那个docker 镜像,执行那些命令和脚本来编译,等等。 - -我们按照下面的内容来配置我们的`.drone.yml`。 - - image: python - script: - - python helloworld.py - - echo "Build has been completed." - -这一步完成后我们就可以使用drone 应用里的YAML 格式的配置文件来构建我们的应用了。所有对代码库的提交和改变此时都会同步到这个仓库。一旦提交完成了,drone 就会自动开始构建。 - -![Building Application Drone](http://blog.linoxide.com/wp-content/uploads/2015/11/building-application-drone.png) - -所有操作都完成后,我们就能在终端看到构建的结果了。 - -![Build Success Drone](http://blog.linoxide.com/wp-content/uploads/2015/11/build-success-drone.png) - -### 总结 ### - -在本文中我们学习了如何安装一个可以工作的使用drone 的持续集成平台。如果我们愿意我们甚至可以从drone.io 官方提供的服务开始工作。我们可以根据自己的需求从免费的服务或者收费服务开始。它通过漂亮的web界面和强大的功能改变了持续集成的世界。它可以集成很多第三方应用和部署平台。如果你有任何问题、建议可以直接反馈给我们,谢谢。 - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/setup-drone-continuous-integration-linux/ - -作者:[Arun Pyasi][a] -译者:[ezio](https://github.com/oska874) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/arunp/ -[1]:https://drone.io/ -[2]:http://downloads.drone.io/master/drone.deb -[3]:http://downloads.drone.io/master/drone.rpm -[4]:https://github.com/settings/developers From 58fbdaae45f8565aab62de591ebb9efda3828c70 Mon Sep 17 00:00:00 2001 From: alim0x Date: Sun, 17 Apr 2016 14:05:04 +0800 Subject: [PATCH 0628/1469] [translating]20160414 Linux Kernel 3.12 to Be Supported Until 2017 --- ... Supported Until 2017 Because of SUSE Linux Enterprise 12.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/news/20160414 Linux Kernel 3.12 to Be Supported Until 2017 Because of SUSE Linux Enterprise 12.md b/sources/news/20160414 Linux Kernel 3.12 to Be Supported Until 2017 Because of SUSE Linux Enterprise 12.md index 5f8bf0a944..efe01db4ef 100644 --- a/sources/news/20160414 Linux Kernel 3.12 to Be Supported Until 2017 Because of SUSE Linux Enterprise 12.md +++ b/sources/news/20160414 Linux Kernel 3.12 to Be Supported Until 2017 Because of SUSE Linux Enterprise 12.md @@ -1,3 +1,5 @@ +alim0x translating + Linux Kernel 3.12 to Be Supported Until 2017 Because of SUSE Linux Enterprise 12 ================================================================================== From 6f35d8678f5716e3984f0d736f6b7f31249cdfba Mon Sep 17 00:00:00 2001 From: alim0x Date: Sun, 17 Apr 2016 14:48:54 +0800 Subject: [PATCH 0629/1469] [translated]20160414 Linux Kernel 3.12 to Be Supported Until 2017 --- ...017 Because of SUSE Linux Enterprise 12.md | 33 ------------------- ...017 Because of SUSE Linux Enterprise 12.md | 31 +++++++++++++++++ 2 files changed, 31 insertions(+), 33 deletions(-) delete mode 100644 sources/news/20160414 Linux Kernel 3.12 to Be Supported Until 2017 Because of SUSE Linux Enterprise 12.md create mode 100644 translated/news/20160414 Linux Kernel 3.12 to Be Supported Until 2017 Because of SUSE Linux Enterprise 12.md diff --git a/sources/news/20160414 Linux Kernel 3.12 to Be Supported Until 2017 Because of SUSE Linux Enterprise 12.md b/sources/news/20160414 Linux Kernel 3.12 to Be Supported Until 2017 Because of SUSE Linux Enterprise 12.md deleted file mode 100644 index efe01db4ef..0000000000 --- a/sources/news/20160414 Linux Kernel 3.12 to Be Supported Until 2017 Because of SUSE Linux Enterprise 12.md +++ /dev/null @@ -1,33 +0,0 @@ -alim0x translating - -Linux Kernel 3.12 to Be Supported Until 2017 Because of SUSE Linux Enterprise 12 -================================================================================== - ->Linux kernel developer Jiri Slaby has announced the release of the fifty-eighth maintenance build of the long-term supported Linux 3.12 kernel series, as well as a modification to its EOL status. - -Linux kernel 3.12.58 LTS is now available, and those running it on their Linux kernel-based operating system must update as soon as possible. And the good news is that the Linux 3.12 branch is here to stay for one more year, until 2017, because SUSE Linux Enterprise (SLE) 12 Service Pack 1 is based on it. - -"Since SLE12-SP1 is based upon 3.12 and its EOL is in 2017, move the EOL of 3.12 to 2017 too," said Jiri Slaby in a [patch announcement][1] sent to one of Linux kernel's mailing lists, where he has also revealed the "end of life" statuses for other kernel branches, such as August 2016 for Linux 3.14, January 2017 for Linux 3.18, or September 2017 for Linux 4.1. - -### What's new in Linux kernel 3.12.58 LTS - -If you're wondering what's new in Linux kernel 3.12.58 LTS, we can tell you that, according to the [appended shortlog][2], it is a pretty healthy update that changes a total of 114 files, with 835 insertions and 298 deletions. Among the changes, we can notice the usual sound and networking stack improvements, and many updated drivers. - -There are also multiple improvements to the x86 hardware architecture, along with small fixes for the Xtensa and s390 ones. Filesystems like NFS, OCFS2, Btrfs, JBD2, and XFS have also received various fixes, and among the updated drivers, we can mention USB, Xen, MD, MTD, media, SCSI, TTY, networking, ATA, Bluetooth, hwmon, EDAC, and CPUFreq. - -As usual, you can [download the Linux kernel 3.12.58 LTS sources][3] right now via our website or directly from kernel.org. Please update your GNU/Linux operating system as soon as possible if it is powered by a kernel from the Linux 3.12 series. - ------------------------------------------------------------------------------- - -via: http://www.linux.com/news/featured-blogs/191-linux-training/834644-7-steps-to-start-your-linux-sysadmin-career - -作者:[Marius Nestor][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://news.softpedia.com/editors/browse/marius-nestor -[1]: http://lkml.iu.edu/hypermail/linux/kernel/1604.1/00792.html -[2]: http://www.spinics.net/lists/stable/msg128634.html -[3]: http://linux.softpedia.com/get/System/Operating-Systems/Kernels/Linux-Kernel-Stable-1960.shtml diff --git a/translated/news/20160414 Linux Kernel 3.12 to Be Supported Until 2017 Because of SUSE Linux Enterprise 12.md b/translated/news/20160414 Linux Kernel 3.12 to Be Supported Until 2017 Because of SUSE Linux Enterprise 12.md new file mode 100644 index 0000000000..ea71e0512b --- /dev/null +++ b/translated/news/20160414 Linux Kernel 3.12 to Be Supported Until 2017 Because of SUSE Linux Enterprise 12.md @@ -0,0 +1,31 @@ +因 SUSE Linux Enterprise 12,Linux Kernel 3.12 的支持延长至 2017 年 +================================================================================== + +>Linux 内核开发者 Jiri Slaby 已经宣布了 Linux 3.12 系列内核的第 58 个长期支持维护版本,以及关于生命周期状态的一些修改。 + +Linux Kernel 3.12.58 LTS(长期支持版)已经可用,那些运行该版本内核的 Linux 操作系统应尽快升级。有个好消息是 Linux 3.12 分支的支持将延长一年至 2017 年,因为 SUSE Linux Enterprise (SLE) 12 Service Pack 1 正是基于该分支。 + +“因为 SLE12-SP1 基于 3.12 之上,并且它的生命周期持续到 2017 年,所以将 3.12 的生命周期结束也修改到 2017 年,”Jiri Slaby 在发到 Linux 内核邮件列表的一个[补丁声明][1]中说道,同时他还公布了其它内核分支的生命周期结束时间(EOL,end of life),比如 Linux 3.14 为 2016 年 8 月,Linux 3.18 为 2017 年 1 月,Linux 4.1 是 2017 年 9 月。 + +### Linux kernel 3.12.58 LTS 改动 + +如果你想知道 Linux kernel 3.12.58 LTS 中有哪些改动,我们能告诉你的是,通过[附加的短日志][2]可知,这是一个健康的更新,改动涉及 114 个文件,有 835 行插入和 298 行删除。在这些改动之中,我们注意到多数是声音和网络栈的改进,以及许多驱动的更新。 + +更新中还有多个对 x86 硬件架构的改进,以及一些对 Xtensa 和 s390 的小修复。文件系统,如 NFS,OCFS2,Btrfs,JBD2 还有 XFS 也都收到了不同的修复,在驱动的更新中可以提到的还有 USB,Xen,MD,MTD,媒体,SCSI,TTY,网络,ATA,蓝牙,hwmon,EDAC 以及 CPUFreq。 + +和往常一样,你现在就可以从我们网站(linux.com)或直接从 kernel.org [下载 Linux kernel 3.12.58 LTS 的源码][3]。如果您的 GNU/Linux 操作系统运行的是 Linux 3.12 系列内核,请尽快升级您的内核。 + +------------------------------------------------------------------------------ + +via: http://www.linux.com/news/featured-blogs/191-linux-training/834644-7-steps-to-start-your-linux-sysadmin-career + +作者:[Marius Nestor][a] +译者:[alim0x](https://github.com/alim0x) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://news.softpedia.com/editors/browse/marius-nestor +[1]: http://lkml.iu.edu/hypermail/linux/kernel/1604.1/00792.html +[2]: http://www.spinics.net/lists/stable/msg128634.html +[3]: http://linux.softpedia.com/get/System/Operating-Systems/Kernels/Linux-Kernel-Stable-1960.shtml From a6ba3c6523327cf2245cb3d8966af21729dec7a1 Mon Sep 17 00:00:00 2001 From: Ping Date: Mon, 18 Apr 2016 08:42:34 +0800 Subject: [PATCH 0630/1469] [Translating] 20160303 Top 5 open source command shells for Linux.md --- .../tech/20160303 Top 5 open source command shells for Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20160303 Top 5 open source command shells for Linux.md b/sources/tech/20160303 Top 5 open source command shells for Linux.md index b9bf5e2e87..8705ad2981 100644 --- a/sources/tech/20160303 Top 5 open source command shells for Linux.md +++ b/sources/tech/20160303 Top 5 open source command shells for Linux.md @@ -1,4 +1,4 @@ -翻译中;by ![zky001] +翻译中;by ping Top 5 open source command shells for Linux =============================================== From 29d7787654b118631607399d534f6a5022a746e6 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 18 Apr 2016 16:00:04 +0800 Subject: [PATCH 0631/1469] translating --- ...15 Docker 1.11 Adopts Open Container Project Components.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sources/tech/20160415 Docker 1.11 Adopts Open Container Project Components.md b/sources/tech/20160415 Docker 1.11 Adopts Open Container Project Components.md index b10e13fe95..3c4f860e49 100644 --- a/sources/tech/20160415 Docker 1.11 Adopts Open Container Project Components.md +++ b/sources/tech/20160415 Docker 1.11 Adopts Open Container Project Components.md @@ -1,3 +1,5 @@ +Translating---geekpi + Docker 1.11 Adopts Open Container Project Components ======================================================= @@ -46,3 +48,5 @@ via: http://www.infoworld.com/article/3055966/open-source-tools/docker-111-adopt [6]: http://www.infoworld.com/article/2876801/application-virtualization/docker-reorganization-grows-up.html [7]: https://github.com/opencontainers/runc/graphs/contributors [8]: https://blog.docker.com/2016/04/docker-engine-1-11-runc/ + + From 57e6d3d644285c6bb08d6ad9592ba2eb8f978006 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 18 Apr 2016 17:48:06 +0800 Subject: [PATCH 0632/1469] translated --- ...dopts Open Container Project Components.md | 52 ------------------- ...dopts Open Container Project Components.md | 50 ++++++++++++++++++ 2 files changed, 50 insertions(+), 52 deletions(-) delete mode 100644 sources/tech/20160415 Docker 1.11 Adopts Open Container Project Components.md create mode 100644 translated/tech/20160415 Docker 1.11 Adopts Open Container Project Components.md diff --git a/sources/tech/20160415 Docker 1.11 Adopts Open Container Project Components.md b/sources/tech/20160415 Docker 1.11 Adopts Open Container Project Components.md deleted file mode 100644 index 3c4f860e49..0000000000 --- a/sources/tech/20160415 Docker 1.11 Adopts Open Container Project Components.md +++ /dev/null @@ -1,52 +0,0 @@ -Translating---geekpi - -Docker 1.11 Adopts Open Container Project Components -======================================================= - -![](http://images.techhive.com/images/article/2015/01/docker-620x465-100559026-primary.idge.jpg) - ->Docker's participation in the Open Container project has come full circle, as the latest version of Docker is now built with components donated by Docker to the OCP - -The biggest news about [Docker 1.11][1] isn't features in the application, but that it uses component versions standardized under the aegis of the Open Container Project. - -Last year, Docker donated the core of its [runC][2] runtime to the OCP as a basis for building container tools. The same went for [containerd][3], a daemon or server used to control instances of runC. Docker 1.11 now uses the donated and publicly worked-on versions of those projects. - ->[ Dig into the the red-hot open source framework in InfoWorld's [beginner's guide to Docker][4]. Pick it up today! | Get a digest of the day's top tech stories in the [InfoWorld Daily newsletter][5]. ] - ->Docker is making this move to challenge the narrative that its container ecosystem is still [dictated chiefly by Docker itself][6]. It isn't donating its container specs and runtime details to the OCP merely for show; it wants the future development of the project to be as open-ended and inclusive as possible. - -![](http://images.techhive.com/images/article/2016/04/docker-runc-100656060-large.idge.png) - ->Docker 1.11 has been reworked to use the runC and containerd components contributed to the Open Container Project. The runC engine can be swapped out and replaced if needed. - -[Two chief committers][7] on runC are Docker employees, but committers from Virtuozzo (of Parallels fame), Red Hat's OpenShift and Project Atomic projects, Huawei, GE Healthcare, and Suse Linux have all been regulars as well. - -The more visible changes in Docker 1.11 reflect this. Previously, the Docker runtime was the only one available within Docker, and critics felt this limited users' choices. The runc runtime is now swappable; while Docker ships with runc as the default engine, any other compatible engine can be swapped in. (Docker also wants it to be possible to do this without having to kill and restart currently running containers, but that's an improvement scheduled for later.) - -Docker is making a case for this OCP-based development process as an inherently better method to create its product. "Splitting Docker up into focused independent tools means more focused maintainers, and ultimately better quality software," stated Docker in its [official blog post][8] announcing 1.11. - -Aside from fixing long-standing bugs and ensuring the runC/containerd version of Docker didn't slow down, Docker has rolled a slew of improvements into Docker 1.11. Docker Engine now supports VLANs and IPv6 service discovery, and it automatically performs DNS round-robin load balancing across multiple containers that have the same alias. - - - ------------------------------------------------------------------------------- - -via: http://www.infoworld.com/article/3055966/open-source-tools/docker-111-adopts-open-container-project-components.html - -作者:[Serdar Yegulalp][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://www.infoworld.com/author/Serdar-Yegulalp/ -[1]: https://blog.docker.com/2016/04/docker-engine-1-11-runc/ -[2]: http://runc.io/ -[3]: https://containerd.tools/ -[4]: http://www.infoworld.com/resources/16373/application-virtualization/the-beginners-guide-to-docker#tk.ifw-infsb -[5]: http://www.infoworld.com/newsletters/signup.html#tk.ifw-infsb -[6]: http://www.infoworld.com/article/2876801/application-virtualization/docker-reorganization-grows-up.html -[7]: https://github.com/opencontainers/runc/graphs/contributors -[8]: https://blog.docker.com/2016/04/docker-engine-1-11-runc/ - - diff --git a/translated/tech/20160415 Docker 1.11 Adopts Open Container Project Components.md b/translated/tech/20160415 Docker 1.11 Adopts Open Container Project Components.md new file mode 100644 index 0000000000..98e8d49c06 --- /dev/null +++ b/translated/tech/20160415 Docker 1.11 Adopts Open Container Project Components.md @@ -0,0 +1,50 @@ +Docker 1.11采纳了开源容器项目组件 +======================================================= + +![](http://images.techhive.com/images/article/2015/01/docker-620x465-100559026-primary.idge.jpg) + +>Docker参与的开源项目完成了一个闭环,最新构建的Docker采用了Docker贡献给OCP的组件。 + +[Docker 1.11][1]最大的新闻并不是它的功能,而是它使用了在OCP支持下的标准化的组件版本。 + +去年,Docker贡献了它的[runC][2]核心给OCP作为构建构建容器工具的基础。同样还有[containerd][3],作为守护进程或者服务端用于控制runC的实例。Docker 1.11现在使用的是捐赠和公开的版本。 + +>在InfoWorld的[Docker初学者指南][4]中深入这个热门开源框架。今天就拿来看!|在[InfoWorld每日简讯][5]中获取今日的技术新闻。 + +>Docker此举挑战了它的容器生态仍[主要由Docker自身决定][6]的传说。它并不是为了作秀才将容器规范和运行时细节贡献给OCP。它希望项目将来的开发越开放和广泛越好。 + +![](http://images.techhive.com/images/article/2016/04/docker-runc-100656060-large.idge.png) + +>Docker 1.11已经用贡献给OCP的runC和containerd进行了重构。runC如果需要可以被交换出去并被替换。 + +runC的[两位主要提交者][7]来自Docker,但是来自Virtuozzo(Parallels fame)、OpenShift、Project Atomic、华为、GE Healthcare、Suse Linux也都是提交的常客。 + +Docker 1.11中一个更明显的变化是先前Docker运行时在Docker中是唯一可用的,并且评论家认为这个会限制用户的选择。runC运行时现在是可交换的;虽然Docker在发布时将runC作为默认的引擎,但是任何兼容的引擎都可以被交换进入。(Docker同样希望它可以不用杀死并重启现在运行的容器,但是这个作为今后的改进规划。) + +Docker正在将基于OCP开发流程作为内部更好的方式去创建它的产品。在它的发布1.11的[官方博客中称][8]:“将Docker切分成独立的工具意味着更专注的维护者,最终有更好的软件质量。” + +除了修复长期以来存在的问题何确保Docker的runC/containerd跟上步伐,Docker还在Docker 1.11中加入了一些改进。Docker Engine现在支持VLAN和IPv6服务发现,并且会自动在多个相同别名容器间执行DNS轮询负载均衡。 + + + +------------------------------------------------------------------------------ + +via: http://www.infoworld.com/article/3055966/open-source-tools/docker-111-adopts-open-container-project-components.html + +作者:[Serdar Yegulalp][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.infoworld.com/author/Serdar-Yegulalp/ +[1]: https://blog.docker.com/2016/04/docker-engine-1-11-runc/ +[2]: http://runc.io/ +[3]: https://containerd.tools/ +[4]: http://www.infoworld.com/resources/16373/application-virtualization/the-beginners-guide-to-docker#tk.ifw-infsb +[5]: http://www.infoworld.com/newsletters/signup.html#tk.ifw-infsb +[6]: http://www.infoworld.com/article/2876801/application-virtualization/docker-reorganization-grows-up.html +[7]: https://github.com/opencontainers/runc/graphs/contributors +[8]: https://blog.docker.com/2016/04/docker-engine-1-11-runc/ + + From e7141ee257ce8e48a89a19c261847816ca0bf08b Mon Sep 17 00:00:00 2001 From: willowyoung <1079902707@qq.com> Date: Mon, 18 Apr 2016 23:37:53 +0800 Subject: [PATCH 0633/1469] Translated by willowyoung --- ...ocessing at NASA with open source tools.md | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 translated/tech/20160304 Image processing at NASA with open source tools.md diff --git a/translated/tech/20160304 Image processing at NASA with open source tools.md b/translated/tech/20160304 Image processing at NASA with open source tools.md new file mode 100644 index 0000000000..e3d59b0f51 --- /dev/null +++ b/translated/tech/20160304 Image processing at NASA with open source tools.md @@ -0,0 +1,71 @@ +# 在NASA中使用开源工具进行图像处理 + +关键词:NASA,图像处理,Node.js,OpenCV + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/nasa_spitzer_space_pink_spiral.jpg?itok=3XEUstkl) + +这个已逝的夏天,我是位于格伦的 [NASA](http://www.nasa.gov/centers/glenn/home/index.html) [GVIS](https://ocio.grc.nasa.gov/gvis/) 实验室的研究生,我将我对开源的热情带到了那里。我的任务是提高我们实验室对 Dan Schroeder 开发的一个开源流体动力学模拟器的贡献。原本的模拟器为用户呈现出可以用鼠标绘制的障碍,用来计算流体动力学模型。我们团队的贡献是加入图像处理的代码,这些代码分析实况视频的每一帧以显示一个物体如何与液体相互作用。而且,我们还要做更多事情。 + +我们想要让图像处理部分更加健全,所以我致力于改善图像处理库。 + +基于新的库,模拟器可以检测轮廓、进行空间坐标变换以及找到物体的质心。图像处理并不直接与流体动力学模拟器物理相关。它用摄像头检测物体,并且获取物体轮廓,为流体模拟器创建一个障碍物。然后,流体模拟器启动,输出结果会被投射到真实物体上。 + +我的目标是通过以下三种方式改进模拟器: + +1. 找寻物体的轮廓 +2. 找寻物体的质心 +3. 能对物体中心进行相关的精确转换 + +我的导师建议我安装 [Node.js](http://nodejs.org/), [OpenCV](http://opencv.org/), 和 [Node.js bindings for OpenCV](https://github.com/peterbraden/node-opencv).。在等待软件安装的过程中,我查看了 OpenCV 的 [GitHub 主页](https://github.com/peterbraden/node-opencv) 上的示例源码。我发现示例源码使用 JavaScript 写的,而我还不懂 JavaScript ,所以我在 Codecademy 上学了一些课程。两天后,我对 JavaScript 依旧生疏,不过我还是开始了我的项目。。。它包含了更多的JavaScript。 + +示例的轮廓检测代码工作得很好。事实上,它使得我用几个小时就完成了第一个目标!为了获取一幅图片的轮廓,它看起来像这样: + +![](https://opensource.com/sites/default/files/resize/image_processing_nasa_1-520x293.jpg) + +> 包括所有轮廓的原始图, + +示例的检测轮廓的代码工作得有点好过头了。不仅物体的轮廓被检测到了,整个图片中的轮廓都检测到了。这会导致模拟器要与那些没用的轮廓打交道。这是一个严重的问题,因为它会返回错误的数据。为了避免模拟器接触到不想要的轮廓,我加了一个区域约束。轮廓要位于一定的区域范围内才会被画出来。区域约束使得轮廓变干净了。 + +![](https://opensource.com/sites/default/files/resize/image_processing_nasa_2-520x293.jpg) + +> 过滤后的轮廓,包含了阴影轮廓 + +虽然无关的轮廓没有了,但是图像还有个问题。图像本该只有一个轮廓,但是它来回绕了自己两次,没有完整地圈起来。区域在这里不能作为决定因素,所以必须试试其他方式。 + +这一次,我不是直接去找寻轮廓,而是先将图片转换成二值图。二值图是转换之后只有黑白像素的图片。为了获取到二值图我先把彩色图转成灰度图。转换之后我再用阈值函数对图片进行处理。阈值函数遍历图片每个像素点的值,如果值小于 30 ,像素的颜色就会改成黑色。否则则反。在原始图片转换成二值图之后,结果变成这样: + +![](https://opensource.com/sites/default/files/resize/image_processing_nasa_3-520x293.jpg) + +> 二值图。 + +然后我获取了二值图的轮廓,结果是一个更干净的轮廓,没有了阴影轮廓。 + +![](https://opensource.com/sites/default/files/image_processing_nasa_4.jpg) + +> 最后的干净轮廓。 + +这个时候,我可以获取干净的轮廓、计算质心了。可惜的是,我没有足够的时间去完成质心的相关变换。因为我的实习时间不多了,我开始考虑我在这段有限时间内能做的其它事情。其中一个就是边界矩形。边界矩形是包含了图片轮廓的最小四边形。边界矩形很重要,因为它是在页面上缩放轮廓的关键。虽然很遗憾我没时间利用边界矩形做更多事情,但是我仍然想去了解更多,因为这是个很有用的工具。 + +最后,经过以上的努力,我完成了对图像的处理! + +![](https://opensource.com/sites/default/files/resize/image_processing_nasa_5-521x293.jpg) + +> 最后图像,红色的边界矩形和质心。 + +当这些图像处理代码写完之后,我用我的代码替代了模拟器中的老代码。非常意外的,它可以工作。 + +嗯,基本可以。 + +程序有内存泄露,每 1/10 秒泄露 100MB 。我很高兴原因不是我的代码。坏消息是修复它并不是我能控制的。好消息是有个解决方法我可以使用。它并不是最理想的,方法是不断检查模拟器使用的内存,当使用内存超过 1 GB,重新启动模拟器。 + +在 NASA 实验室,我们使用很多的开源软件,没有这些开源软件的帮助,我不可能完成这些工作。 + +* * * + +via: [https://opensource.com/life/16/3/image-processing-nasa](https://opensource.com/life/16/3/image-processing-nasa) + +作者:[Lauren Egts](https://opensource.com/users/laurenegts) +译者:[willowyoung](https://github.com/willowyoung) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From e2fb125a7a0433d498bcb4e636efbb229c967e9b Mon Sep 17 00:00:00 2001 From: cposture Date: Tue, 19 Apr 2016 15:49:19 +0800 Subject: [PATCH 0634/1469] Translated by cposture --- .../20151220 GCC-Inline-Assembly-HOWTO.md | 632 ++++++++++++++++++ ...loud Services For Linux To Replace Copy.md | 135 ++++ 2 files changed, 767 insertions(+) create mode 100644 translated/tech/20151220 GCC-Inline-Assembly-HOWTO.md create mode 100644 translated/tech/20160220 Best Cloud Services For Linux To Replace Copy.md diff --git a/translated/tech/20151220 GCC-Inline-Assembly-HOWTO.md b/translated/tech/20151220 GCC-Inline-Assembly-HOWTO.md new file mode 100644 index 0000000000..e0e1fc6d50 --- /dev/null +++ b/translated/tech/20151220 GCC-Inline-Assembly-HOWTO.md @@ -0,0 +1,632 @@ +* * * + +# GCC 内联汇编 HOWTO + +v0.1, 01 March 2003. +* * * + +_本 HOWTO 文档将讲解 GCC 提供的内联汇编特性的用途和用法。对于阅读这篇文章,这里只有两个前提要求,很明显,就是 x86 汇编语言和 C 语言的基本认识。_ + +* * * + +## 1. 简介 + +## 1.1 版权许可 + +Copyright (C)2003 Sandeep S. + +本文档自由共享;你可以重新发布它,并且/或者在遵循自由软件基金会发布的 GNU 通用公共许可证下修改它;或者该许可证的版本 2 ,或者(按照你的需求)更晚的版本。 + +发布这篇文档是希望它能够帮助别人,但是没有任何保证;甚至不包括可售性和适用于任何特定目的的保证。关于更详细的信息,可以查看 GNU 通用许可证。 + +## 1.2 反馈校正 + +请将反馈和批评一起提交给 [Sandeep.S](mailto:busybox@sancharnet.in) 。我将感谢任何一个指出本文档中错误和不准确之处的人;一被告知,我会马上改正它们。 + +## 1.3 致谢 + +我对提供如此棒的特性的 GNU 人们表示真诚的感谢。感谢 Mr.Pramode C E 所做的所有帮助。感谢在 Govt Engineering College 和 Trichur 的朋友们的精神支持和合作,尤其是 Nisha Kurur 和 Sakeeb S 。 感谢在 Gvot Engineering College 和 Trichur 的老师们的合作。 + +另外,感谢 Phillip , Brennan Underwood 和 colin@nyx.net ;这里的许多东西都厚颜地直接取自他们的工作成果。 + +* * * + +## 2. 概览 + +在这里,我们将学习 GCC 内联汇编。这内联表示的是什么呢? + +我们可以要求编译器将一个函数的代码插入到调用者代码中函数被实际调用的地方。这样的函数就是内联函数。这听起来和宏差不多?这两者确实有相似之处。 + +内联函数的优点是什么呢? + +这种内联方法可以减少函数调用开销。同时如果所有实参的值为常量,它们的已知值可以在编译期允许简化,因此并非所有的内联函数代码都需要被包含。代码大小的影响是不可预测的,这取决于特定的情况。为了声明一个内联函数,我们必须在函数声明中使用 `inline` 关键字。 + +现在我们正处于一个猜测内联汇编到底是什么的点上。它只不过是一些写为内联函数的汇编程序。在系统编程上,它们方便、快速并且极其有用。我们主要集中学习(GCC)内联汇编函数的基本格式和用法。为了声明内联汇编函数,我们使用 `asm` 关键词。 + +内联汇编之所以重要,主要是因为它可以操作并且使其输出通过 C 变量显示出来。正是因为此能力, "asm" 可以用作汇编指令和包含它的 C 程序之间的接口。 + +* * * + +## 3. GCC 汇编语法 + +GCC , Linux上的 GNU C 编译器,使用 **AT&T** / **UNIX** 汇编语法。在这里,我们将使用 AT&T 语法 进行汇编编码。如果你对 AT&T 语法不熟悉的话,请不要紧张,我会教你的。AT&T 语法和 Intel 语法的差别很大。我会给出主要的区别。 + +1. 源操作数和目的操作数顺序 + + AT&T 语法的操作数方向和 Intel 语法的刚好相反。在Intel 语法中,第一操作数为目的操作数,第二操作数为源操作数,然而在 AT&T 语法中,第一操作数为源操作数,第二操作数为目的操作数。也就是说, + + Intel 语法中的 "Op-code dst src" 变为 + + AT&T 语法中的 "Op-code src dst"。 + +2. 寄存器命名 + + 寄存器名称有 % 前缀,即如果必须使用 eax,它应该用作 %eax。 + +3. 立即数 + + AT&T 立即数以 ’$’ 为前缀。静态 "C" 变量 也使用 ’$’ 前缀。在 Intel 语法中,十六进制常量以 ’h’ 为后缀,然而AT&T不使用这种语法,这里我们给常量添加前缀 ’0x’。所以,对于十六进制,我们首先看到一个 ’$’,然后是 ’0x’,最后才是常量。 + +4. 操作数大小 + + 在 AT&T 语法中,存储器操作数的大小取决于操作码名字的最后一个字符。操作码后缀 ’b’ 、’w’、’l’分别指明了字节(byte)(8位)、字(word)(16位)、长型(long)(32位)存储器引用。Intel 语法通过给存储器操作数添加’byte ptr’、 ’word ptr’ 和 ’dword ptr’前缀来实现这一功能。 + + 因此,Intel的 "mov al, byte ptr foo" 在 AT&T 语法中为 "movb foo, %al"。 + +5. 存储器操作数 + + 在 Intel 语法中,基址寄存器包含在 ’[’ 和 ’]’ 中,然而在 AT&T 中,它们变为 ’(’ 和 ’)’。另外,在 Intel 语法中, 间接内存引用为 + + section:[base + index*scale + disp], 在 AT&T中变为 + + section:disp(base, index, scale)。 + + 需要牢记的一点是,当一个常量用于 disp 或 scale,不能添加’$’前缀。 + +现在我们看到了 Intel 语法和 AT&T 语法之间的一些主要差别。我仅仅写了它们差别的一部分而已。关于更完整的信息,请参考 GNU 汇编文档。现在为了更好地理解,我们可以看一些示例。 + +> ` +> +>
+------------------------------+------------------------------------+
+> |       Intel Code             |      AT&T Code                     |
+> +------------------------------+------------------------------------+
+> | mov     eax,1                |  movl    $1,%eax                   |   
+> | mov     ebx,0ffh             |  movl    $0xff,%ebx                |   
+> | int     80h                  |  int     $0x80                     |   
+> | mov     ebx, eax             |  movl    %eax, %ebx                |
+> | mov     eax,[ecx]            |  movl    (%ecx),%eax               |
+> | mov     eax,[ebx+3]          |  movl    3(%ebx),%eax              | 
+> | mov     eax,[ebx+20h]        |  movl    0x20(%ebx),%eax           |
+> | add     eax,[ebx+ecx*2h]     |  addl    (%ebx,%ecx,0x2),%eax      |
+> | lea     eax,[ebx+ecx]        |  leal    (%ebx,%ecx),%eax          |
+> | sub     eax,[ebx+ecx*4h-20h] |  subl    -0x20(%ebx,%ecx,0x4),%eax |
+> +------------------------------+------------------------------------+
+> 
+> +> ` + +* * * + +## 4. 基本内联 + +基本内联汇编的格式非常直接了当。它的基本格式为 + +`asm("汇编代码");` + +示例 + +> ` +> +> * * * +> +>
asm("movl %ecx %eax"); /* 将 ecx 寄存器的内容移至 eax  */
+> __asm__("movb %bh (%eax)"); /* 将 bh 的一个字节数据 移至 eax 寄存器指向的内存 */
+> 
+> +> * * * +> +> ` + +你可能注意到了这里我使用了 `asm ` 和 `__asm__`。这两者都是有效的。如果关键词 `asm` 和我们程序的一些标识符冲突了,我们可以使用 `__asm__`。如果我们的指令多余一条,我们可以写成一行,并用括号括起,也可以为每条指令添加 ’\n’ 和 ’\t’ 后缀。这是因为gcc将每一条当作字符串发送给 **as**(GAS)( GAS 即 GNU 汇编器 ——译者注),并且通过使用换行符/制表符发送正确地格式化行给汇编器。 + +示例 + +> ` +> +> * * * +> +>
 __asm__ ("movl %eax, %ebx\n\t"
+>           "movl $56, %esi\n\t"
+>           "movl %ecx, $label(%edx,%ebx,$4)\n\t"
+>           "movb %ah, (%ebx)");
+> 
+> +> * * * +> +> ` + +如果在代码中,我们涉及到一些寄存器(即改变其内容),但在没有固定这些变化的情况下从汇编中返回,这将会导致一些不好的事情。这是因为 GCC 并不知道寄存器内容的变化,这会导致问题,特别是当编译器做了某些优化。在没有告知 GCC 的情况下,它将会假设一些寄存器存储了我们可能已经改变的变量的值,它会像什么事都没发生一样继续运行(什么事都没发生一样是指GCC不会假设寄存器装入的值是有效的,当退出改变了寄存器值的内联汇编后,寄存器的值不会保存到相应的变量或内存空间 ——译者注)。我们所可以做的是使用这些没有副作用的指令,或者当我们退出时固定这些寄存器,或者等待程序崩溃。这是为什么我们需要一些扩展功能。扩展汇编正好给我们提供了那样的功能。 + +* * * + +## 5. 扩展汇编 + +在基本内联汇编中,我们只有指令。然而在扩展汇编中,我们可以同时指定操作数。它允许我们指定输入寄存器、输出寄存器以及修饰寄存器列表。GCC 不强制用户必须指定使用的寄存器。我们可以把头疼的事留给 GCC ,这可能可以更好地适应 GCC 的优化。不管怎樣,基本格式为: + +> ` +> +> * * * +> +>
       asm ( 汇编程序模板 
+>            : 输出操作数					/* 可选的 */
+>            : 输入操作数                   /* 可选的 */
+>            : 修饰寄存器列表			    /* 可选的 */
+>            );
+> 
+> +> * * * +> +> ` + +汇编程序模板由汇编指令组成.每一个操作数由一个操作数约束字符串所描述,其后紧接一个括弧括起的 C 表达式。冒号用于将汇编程序模板和第一个输出操作数分开,另一个(冒号)用于将最后一个输出操作数和第一个输入操作数分开,如果存在的话。逗号用于分离每一个组内的操作数。总操作数的数目限制在10个,或者机器描述中的任何指令格式中的最大操作数数目,以较大者为准。 + +如果没有输出操作数但存在输入操作数,你必须将两个连续的冒号放置于输出操作数原本会放置的地方周围。 + +示例: + +> ` +> +> * * * +> +>
        asm ("cld\n\t"
+>              "rep\n\t"
+>              "stosl"
+>              : /* 无输出寄存器 */
+>              : "c" (count), "a" (fill_value), "D" (dest)
+>              : "%ecx", "%edi" 
+>              );
+> 
+> +> * * * +> +> ` + +现在,这段代码是干什么的?以上的内联汇编是将 `fill_value` 值 连续 `count` 次 拷贝到 寄存器 `edi` 所指位置(每执行stosl一次,寄存器 edi 的值会递增或递减,这取决于是否设置了 direction 标志,因此以上代码实则初始化一个内存块 ——译者注)。 它也告诉 gcc 寄存器 `ecx` 和 `edi` 一直无效(原文为 eax ,但代码修饰寄存器列表中为 ecx,因此这可能为作者的纰漏 ——译者注)。为了使扩展汇编更加清晰,让我们再看一个示例。 + +> ` +> +> * * * +> +>
        
+>         int a=10, b;
+>         asm ("movl %1, %%eax; 
+>               movl %%eax, %0;"
+>              :"=r"(b)        /* 输出 */
+>              :"r"(a)         /* 输入 */
+>              :"%eax"         /* 修饰寄存器 */
+>              );       
+> 
+> +> * * * +> +> ` + +这里我们所做的是使用汇编指令使 ’b’ 变量的值等于 ’a’ 变量的值。一些有意思的地方是: + +* "b" 为输出操作数,用 %0 引用,并且 "a" 为输入操作数,用 %1 引用。 +* "r" 为操作数约束。之后我们会更详细地了解约束(字符串)。目前,"r" 告诉 GCC 可以使用任一寄存器存储操作数。输出操作数约束应该有一个约束修饰符 "=" 。这修饰符表明它是一个只读的输出操作数。 +* 寄存器名字以两个%为前缀。这有利于 GCC 区分操作数和寄存器。操作数以一个 % 为前缀。 +* 第三个冒号之后的修饰寄存器 %eax 告诉 GCC %eax的值将会在 "asm" 内部被修改,所以 GCC 将不会使用此寄存器存储任何其他值。 + +当 "asm" 执行完毕, "b" 变量会映射到更新的值,因为它被指定为输出操作数。换句话说, "asm" 内 "b" 变量的修改 应该会被映射到 "asm" 外部。 + +现在,我们可以更详细地看看每一个域。 + +## 5.1 汇编程序模板 + +汇编程序模板包含了被插入到 C 程序的汇编指令集。其格式为:每条指令用双引号圈起,或者整个指令组用双引号圈起。同时每条指令应以分界符结尾。有效的分界符有换行符(\n)和逗号(;)。’\n’ 可以紧随一个制表符(\t)。我们应该都明白使用换行符或制表符的原因了吧?和 C 表达式对应的操作数使用 %0、%1 ... 等等表示。 + +## 5.2 操作数 + +C 表达式用作 "asm" 内的汇编指令操作数。作为第一双引号内的操作数约束,写下每一操作数。对于输出操作数,在引号内还有一个约束修饰符,其后紧随一个用于表示操作数的 C 表达式。即, + +"约束字符串"(C 表达式),它是一个通用格式。对于输出操作数,还有一个额外的修饰符。约束字符串主要用于决定操作数的寻找方式,同时也用于指定使用的寄存器。 + +如果我们使用的操作数多于一个,那么每一个操作数用逗号隔开。 + +在汇编程序模板,每个操作数用数字引用。编号方式如下。如果总共有 n 个操作数(包括输入和输出操作数),那么第一个输出操作数编号为 0 ,逐项递增,并且最后一个输入操作数编号为 n - 1 。操作数的最大数目为前一节我们所看到的那样。 + +输出操作数表达式必须为左值。输入操作数的要求不像这样严格。它们可以为表达式。扩展汇编特性常常用于编译器自己不知道其存在的机器指令 ;-)。如果输出表达式无法直接寻址(例如,它是一个位域),我们的约束字符串必须给定一个寄存器。在这种情况下,GCC 将会使用该寄存器作为汇编的输出,然后存储该寄存器的内容到输出。 + +正如前面所陈述的一样,普通的输出操作数必须为只写的; GCC 将会假设指令前的操作数值是死的,并且不需要被(提前)生成。扩展汇编也支持输入-输出或者读-写操作数。 + +所以现在我们来关注一些示例。我们想要求一个数的5次方结果。为了计算该值,我们使用 `lea` 指令。 + +> ` +> +> * * * +> +>
        asm ("leal (%1,%1,4), %0"
+>              : "=r" (five_times_x)
+>              : "r" (x) 
+>              );
+> 
+> +> * * * +> +> ` + +这里我们的输入为x。我们不指定使用的寄存器。 GCC 将会选择一些输入寄存器,一个输出寄存器,并且做我们期望的事。如果我们想要输入和输出存在于同一个寄存器里,我们可以要求 GCC 这样做。这里我们使用那些读-写操作数类型。这里我们通过指定合适的约束来实现它。 + +> ` +> +> * * * +> +>
        asm ("leal (%0,%0,4), %0"
+>              : "=r" (five_times_x)
+>              : "0" (x) 
+>              );
+> 
+> +> * * * +> +> ` + +现在输出和输出操作数位于同一个寄存器。但是我们无法得知是哪一个寄存器。现在假如我们也想要指定操作数所在的寄存器,这里有一种方法。 + +> ` +> +> * * * +> +>
        asm ("leal (%%ecx,%%ecx,4), %%ecx"
+>              : "=c" (x)
+>              : "c" (x) 
+>              );
+> 
+> +> * * * +> +> ` + +在以上三个示例中,我们并没有添加任何寄存器到修饰寄存器里,为什么?在头两个示例, GCC 决定了寄存器并且它知道发生了什么改变。在最后一个示例,我们不必将 'ecx' 添加到修饰寄存器列表(原文修饰寄存器列表拼写有错,这里已修正 ——译者注), gcc 知道它表示x。因此,因为它可以知道 `ecx` 的值,它就不被当作修饰的(寄存器)了。 + +## 5.3 修饰寄存器列表 + +一些指令会破坏一些硬件寄存器。我们不得不在修饰寄存器中列出这些寄存器,即汇编函数内第三个 ’**:**’ 之后的域。这可以通知 gcc 我们将会自己使用和修改这些寄存器。所以 gcc 将不会假设存入这些寄存器的值是有效的。我们不用在这个列表里列出输入输出寄存器。因为 gcc 知道 "asm" 使用了它们(因为它们被显式地指定为约束了)。如果指令隐式或显式地使用了任何其他寄存器,(并且寄存器不能出现在输出或者输出约束列表里),那么不得不在修饰寄存器列表中指定这些寄存器。 + +如果我们的指令可以修改状态寄存器,我们必须将 "cc" 添加进修饰寄存器列表。 + +如果我们的指令以不可预测的方式修改了内存,那么需要将 "memory" 添加进修饰寄存器列表。这可以使 GCC 不会在汇编指令间保持缓存于寄存器的内存值。如果被影响的内存不在汇编的输入或输出列表中,我们也必须添加 **volatile** 关键词。 + +我们可以按我们的需求多次读写修饰寄存器。考虑一个模板内的多指令示例;它假设子例程 _foo 接受寄存器 `eax` 和 `ecx` 里的参数。 + +> ` +> +> * * * +> +>
        asm ("movl %0,%%eax;
+>               movl %1,%%ecx;
+>               call _foo"
+>              : /* no outputs */
+>              : "g" (from), "g" (to)
+>              : "eax", "ecx"
+>              );
+> 
+> +> * * * +> +> ` + +## 5.4 Volatile ...? + +如果你熟悉内核源码或者其他像内核源码一样漂亮的代码,你一定见过许多声明为 `volatile` 或者 `__volatile__`的函数,其跟着一个 `asm` 或者 `__asm__`。我之前提过关键词 `asm` 和 `__asm__`。那么什么是 `volatile`呢? + +如果我们的汇编语句必须在我们放置它的地方执行(即,不能作为一种优化被移出循环语句),将关键词 `volatile` 放置在 asm 后面,()的前面。因为为了防止它被移动、删除或者其他操作,我们将其声明为 + +`asm volatile ( ... : ... : ... : ...);` + +当我们必须非常谨慎时,请使用 `__volatile__`。 + +如果我们的汇编只是用于一些计算并且没有任何副作用,不使用 `volatile` 关键词会更好。不使用 `volatile` 可以帮助 gcc 优化代码并使代码更漂亮。 + + +在 `Some Useful Recipes` 一节中,我提供了多个内联汇编函数的例子。这儿我们详细查看修饰寄存器列表。 + +* * * + +## 6. 更多关于约束 + +到这个时候,你可能已经了解到约束和内联汇编有很大的关联。但我们很少说到约束。约束用于表明一个操作数是否可以位于寄存器和位于哪个寄存器;是否操作数可以为一个内存引用和哪种地址;是否操作数可以为一个立即数和为哪一个可能的值(即值的范围)。它可以有...等等。 + +## 6.1 常用约束 + +在许多约束中,只有小部分是常用的。我们将看看这些约束。 + +1. **寄存器操作数约束(r)** + + 当使用这种约束指定操作数时,它们存储在通用寄存器(GPR)中。请看下面示例: + + `asm ("movl %%eax, %0\n" :"=r"(myval));` + + 这里,变量 myval 保存在寄存器中,寄存器 eax 的值被复制到该寄存器中,并且myval的值从寄存器更新到了内存。当指定 "r" 约束时, gcc 可以将变量保存在任何可用的 GPR 中。为了指定寄存器,你必须使用特定寄存器约束直接地指定寄存器的名字。它们为: + + > ` + > + >
+---+--------------------+
+    > | r |    Register(s)     |
+    > +---+--------------------+
+    > | a |   %eax, %ax, %al   |
+    > | b |   %ebx, %bx, %bl   |
+    > | c |   %ecx, %cx, %cl   |
+    > | d |   %edx, %dx, %dl   |
+    > | S |   %esi, %si        |
+    > | D |   %edi, %di        |
+    > +---+--------------------+
+    > 
+ > + > ` + +2. **内存操作数约束(m)** + + 当操作数位于内存时,任何对它们的操作将直接发生在内存位置,这与寄存器约束相反,后者首先将值存储在要修改的寄存器中,然后将它写回到内存位置。但寄存器约束通常用于一个指令必须使用它们或者它们可以大大提高进程速度的地方。当需要在 "asm" 内更新一个 C 变量,而又不想使用寄存器去保存它的只,使用内存最为有效。例如, idtr 的值存储于内存位置: + + `asm("sidt %0\n" : :"m"(loc));` + +3. **匹配(数字)约束** + + 在某些情况下,一个变量可能既充当输入操作数,也充当输出操作数。可以通过使用匹配约束在 "asm" 中指定这种情况。 + + `asm ("incl %0" :"=a"(var):"0"(var));` + + 在操作数子节中,我们也看到了一些类似的示例。在这个匹配约束的示例中,寄存器 "%eax" 既用作输入变量,也用作输出变量。 var 输入被读进 %eax ,并且更新的 %eax 再次被存储进 var。这里的 "0" 用于指定与第0个输出变量相同的约束。也就是,它指定 var 输出实例应只被存储在 "%eax" 中。该约束可用于: + + * 在输入从变量读取或变量修改后,修改被写回同一变量的情况 + * 在不需要将输入操作数实例和输出操作数实例分开的情况 + + 使用匹配约束最重要的意义在于它们可以导致有效地使用可用寄存器。 + +其他一些约束: + +1. "m" : 允许一个内存操作数使用机器普遍支持的任一种地址。 +2. "o" : 允许一个内存操作数,但只有当地址是可偏移的。即,该地址加上一个小的偏移量可以得到一个地址。 +3. "V" : A memory operand that is not offsettable. In other words, anything that would fit the `m’ constraint but not the `o’constraint. +4. "i" : 允许一个(带有常量)的立即整形操作数。这包括其值仅在汇编时期知道的符号常量。 +5. "n" : 允许一个带有已知数字的立即整形操作数。许多系统不支持汇编时期的常量,因为操作数少于一个字宽。对于此种操作数,约束应该使用 'n' 而不是'i'。 +6. "g" : 允许任一寄存器、内存或者立即整形操作数,不包括通用寄存器之外的寄存器。 + + +以下约束为x86特有。 + +1. "r" : 寄存器操作数约束,查看上面给定的表格。 +2. "q" : 寄存器 a、b、c 或者 d。 +3. "I" : 范围从 0 到 31 的常量(对于 32 位移位)。 +4. "J" : 范围从 0 到 63 的常量(对于 64 位移位)。 +5. "K" : 0xff。 +6. "L" : 0xffff。 +7. "M" : 0, 1, 2, or 3 (lea 指令的移位)。 +8. "N" : 范围从 0 到 255 的常量(对于 out 指令)。 +9. "f" : 浮点寄存器 +10. "t" : 第一个(栈顶)浮点寄存器 +11. "u" : 第二个浮点寄存器 +12. "A" : 指定 `a` 或 `d` 寄存器。这主要用于想要返回 64 位整形数,使用 `d` 寄存器保存最高有效位和 `a` 寄存器保存最低有效位。 + +## 6.2 约束修饰符 + +当使用约束时,对于更精确的控制超越了约束作用的需求,GCC 给我们提供了约束修饰符。最常用的约束修饰符为: + +1. "=" : 意味着对于这条指令,操作数为只写的;旧值会被忽略并被输出数据所替换。 +2. "&" : 意味着这个操作数为一个早期的改动操作数,其在该指令完成前通过使用输入操作数被修改了。因此,这个操作数不可以位于一个被用作输出操作数或任何内存地址部分的寄存器。如果在旧值被写入之前它仅用作输入而已,一个输入操作数可以为一个早期改动操作数。 + + 约束的列表和解释是决不完整的。示例可以给我们一个关于内联汇编的用途和用法的更好的理解。在下一节,我们会看到一些示例,在那里我们会发现更多关于修饰寄存器列表的东西。 + +* * * + +## 7. 一些实用的诀窍 + +现在我们已经介绍了关于 GCC 内联汇编的基础理论,现在我们将专注于一些简单的例子。将内联汇编函数写成宏的形式总是非常方便的。我们可以在内核代码里看到许多汇编函数。(usr/src/linux/include/asm/*.h)。 + +1. 首先我们从一个简单的例子入手。我们将写一个两个数相加的程序。 + + > ` + > + > * * * + > + >
int main(void)
+    > {
+    >         int foo = 10, bar = 15;
+    >         __asm__ __volatile__("addl  %%ebx,%%eax"
+    >                              :"=a"(foo)
+    >                              :"a"(foo), "b"(bar)
+    >                              );
+    >         printf("foo+bar=%d\n", foo);
+    >         return 0;
+    > }
+    > 
+ > + > * * * + > + > ` + + 这里我们要求 GCC 将 foo 存放于 %eax,将 bar 存放于 %ebx,同时我们也想要在 %eax 中存放结果。'=' 符号表示它是一个输出寄存器。现在我们可以以其他方式将一个整数加到一个变量。 + + > ` + > + > * * * + > + >
 __asm__ __volatile__(
+    >                       "   lock       ;\n"
+    >                       "   addl %1,%0 ;\n"
+    >                       : "=m"  (my_var)
+    >                       : "ir"  (my_int), "m" (my_var)
+    >                       :                                 /* 无修饰寄存器列表 */
+    >                       );
+    > 
+ > + > * * * + > + > ` + + 这是一个原子加法。为了移除原子性,我们可以移除指令 'lock'。在输出域中,"=m" 表明 my_var 是一个输出且位于内存。类似地,"ir" 表明 my_int 是一个整型,并应该存在于其他寄存器(回想我们上面看到的表格)。没有寄存器位于修饰寄存器列表中。 + +2. 现在我们将在一些寄存器/变量上展示一些操作,并比较值。 + + > ` + > + > * * * + > + >
 __asm__ __volatile__(  "decl %0; sete %1"
+    >                       : "=m" (my_var), "=q" (cond)
+    >                       : "m" (my_var) 
+    >                       : "memory"
+    >                       );
+    > 
+ > + > * * * + > + > ` + + 这里,my_var 的值减 1 ,并且如果结果的值为 0,则变量 cond 置 1。我们可以通过添加指令 "lock;\n\t" 作为汇编模板的第一条指令来添加原子性。 + + 以类似的方式,为了增加 my_var,我们可以使用 "incl %0" 而不是 "decl %0"。 + + 这里需要注意的点为(i)my_var 是一个存储于内存的变量。(ii)cond 位于任何一个寄存器 eax、ebx、ecx、edx。约束 "=q" 保证这一点。(iii)同时我们可以看到 memory 位于修饰寄存器列表中。也就是说,代码将改变内存中的内容。 + +3. 如何置1或清0寄存器中的一个比特位。作为下一个诀窍,我们将会看到它。 + + > ` + > + > * * * + > + >
__asm__ __volatile__(   "btsl %1,%0"
+    >                       : "=m" (ADDR)
+    >                       : "Ir" (pos)
+    >                       : "cc"
+    >                       );
+    > 
+ > + > * * * + > + > ` + + 这里,ADDR 变量(一个内存变量)的 'pos' 位置上的比特被设置为 1。我们可以使用 'btrl' 来清楚由 'btsl' 设置的比特位。pos 的约束 "Ir" 表明 pos 位于寄存器并且它的值为 0-31(x86 相关约束)。也就是说,我们可以设置/清除 ADDR 变量上第 0 到 31 位的任一比特位。因为条件码会被改变,所以我们将 "cc" 添加进修饰寄存器列表。 + +4. 现在我们看看一些更为复杂而有用的函数。字符串拷贝。 + + > ` + > + > * * * + > + >
static inline char * strcpy(char * dest,const char *src)
+    > {
+    > int d0, d1, d2;
+    > __asm__ __volatile__(  "1:\tlodsb\n\t"
+    >                        "stosb\n\t"
+    >                        "testb %%al,%%al\n\t"
+    >                        "jne 1b"
+    >                      : "=&S" (d0), "=&D" (d1), "=&a" (d2)
+    >                      : "0" (src),"1" (dest) 
+    >                      : "memory");
+    > return dest;
+    > }
+    > 
+ > + > * * * + > + > ` + + 源地址存放于 esi,目标地址存放于 edi,同时开始拷贝,当我们到达 **0** 时,拷贝完成。约束 "&S"、"&D"、"&a" 表明寄存器 esi、edi和 eax 早期的修饰寄存器,也就是说,它们的内容在函数完成前会被改变。这里很明显可以知道为什么 "memory" 会放在修饰寄存器列表。 + + 我们可以看到一个类似的函数,它能移动双字块数据。注意函数被声明为一个宏。 + + > ` + > + > * * * + > + >
#define mov_blk(src, dest, numwords) \
+    > __asm__ __volatile__ (                                          \
+    >                        "cld\n\t"                                \
+    >                        "rep\n\t"                                \
+    >                        "movsl"                                  \
+    >                        :                                        \
+    >                        : "S" (src), "D" (dest), "c" (numwords)  \
+    >                        : "%ecx", "%esi", "%edi"                 \
+    >                        )
+    > 
+ > + > * * * + > + > ` + + 这里我们没有输出,所以寄存器 ecx、esi和 edi 的内容发生改变,这是块移动的副作用。因此我们必须将它们添加进修饰寄存器列表。 + +5. 在 Linux 中,系统调用使用 GCC 内联汇编实现。让我们看看如何实现一个系统调用。所有的系统调用被写成宏(linux/unistd.h)。例如,带有三个参数的系统调用被定义为如下所示的宏。 + + > ` + > + > * * * + > + > type name(type1 arg1,type2 arg2,type3 arg3) \ + > { \ + > long __res; \ + > __asm__ volatile ( "int $0x80" \ + > : "=a" (__res) \ + > : "0" (__NR_##name),"b" ((long)(arg1)),"c" ((long)(arg2)), \ + > "d" ((long)(arg3))); \ + > __syscall_return(type,__res); \ + > } + >
+ > + > * * * + > + > ` + + 无论何时调用带有三个参数的系统调用,以上展示的宏用于执行调用。系统调用号位于 eax 中,每个参数位于 ebx、ecx、edx 中。最后 "int 0x80" 是一条用于执行系统调用的指令。返回值被存储于 eax 中。 + + 每个系统调用都以类似的方式实现。Exit 是一个单一参数的系统调用,让我们看看它的代码看起来会是怎样。它如下所示。 + + > ` + > + > * * * + > + >
{
+    >         asm("movl $1,%%eax;         /* SYS_exit is 1 */
+    >              xorl %%ebx,%%ebx;      /* Argument is in ebx, it is 0 */
+    >              int  $0x80"            /* Enter kernel mode */
+    >              );
+    > }
+    > 
+ > + > * * * + > + > ` + + Exit 的系统调用号是 1 同时它的参数是 0。因此我们分配 eax 包含 1,ebx 包含 0,同时通过 `int $0x80` 执行 `exit(0)`。这就是 exit 的工作原理。 + +* * * + +## 8. 结束语 + +这篇文档已经将 GCC 内联汇编过了一遍。一旦你理解了基本概念,你便不难采取自己的行动。我们看了许多例子,它们有助于理解 GCC 内联汇编的常用特性。 + +GCC 内联是一个极大的主题,这篇文章是不完整的。更多关于我们讨论过的语法细节可以在 GNU 汇编器的官方文档上获取。类似地,对于一个完整的约束列表,可以参考 GCC 的官方文档。 + +当然,Linux 内核 大规模地使用 GCC 内联。因此我们可以在内核源码中发现许多各种各样的例子。它们可以帮助我们很多。 + +如果你发现任何的错别字,或者本文中的信息已经过时,请告诉我们。 + +* * * + +## 9. 参考 + +1. [Brennan’s Guide to Inline Assembly](http://www.delorie.com/djgpp/doc/brennan/brennan_att_inline_djgpp.html) +2. [Using Assembly Language in Linux](http://linuxassembly.org/articles/linasm.html) +3. [Using as, The GNU Assembler](http://www.gnu.org/manual/gas-2.9.1/html_mono/as.html) +4. [Using and Porting the GNU Compiler Collection (GCC)](http://gcc.gnu.org/onlinedocs/gcc_toc.html) +5. [Linux Kernel Source](http://ftp.kernel.org/) + +* * * +via: http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html + + 作者:[Sandeep.S](mailto:busybox@sancharnet.in) 译者:[cposture](https://github.com/cposture) 校对:[]() + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/translated/tech/20160220 Best Cloud Services For Linux To Replace Copy.md b/translated/tech/20160220 Best Cloud Services For Linux To Replace Copy.md new file mode 100644 index 0000000000..ce9380b600 --- /dev/null +++ b/translated/tech/20160220 Best Cloud Services For Linux To Replace Copy.md @@ -0,0 +1,135 @@ +替代 Copy 的 Linux 最佳云服务 +=============================================== + +![](http://itsfoss.com/wp-content/uploads/2016/02/Linux-cloud-services.jpg) + +云存储服务 Copy 即将关闭,我们 Linux 用户是时候该寻找其他优秀的** Copy 之外的 Linux 云存储服务**。 + +全部文件将会在 2016年5月1号 被删除。如果你是 Copy 的用户,你应该保存你的文件并将它们移至其他地方。 + +在过去的两年里,Copy 已经成为了我最喜爱的云存储。它为我提供了大量的免费空间并且带有桌面平台的原生应用程序,包括 Linux 和移动平台如 iOS 和 Android。 + +对我来说,它是一个非常棒的云存储,在应用中我获得了大量的免费存储空间(380 GB)并且享受着桌面系统和移动系统之间的无缝体验。但是这些'方便免费的存储',15 GB 为注册,5 GB 为每次推荐,使我想到如果 Copy 没有获得商业用户,他们将会马上停业。如此巨大的免费存储空间仅意味着他们没有像 Dropbox 所做的一样针对个别用户。 + +当我从 Copy.com 看到它即将关闭的消息,我的担忧成真了。事实上,Copy 并不孤独。它的母公司 [Barracuda Networks](https://www.barracuda.com/)正经历一段困难时期并且已经[雇佣 Morgan Stanely 寻找 合适的卖家](http://www.bloomberg.com/news/articles/2016-02-01/barracuda-networks-said-to-work-with-morgan-stanley-to-seek-sale)(s) + +无论什么理由,我们所知道的是 Copy 将会成为历史,我们需要寻找相似的**优秀的 Linux 云服务**。我之所以强调 Linux 是因为其他流行的云存储服务,如[微软的OneDrive](https://onedrive.live.com/about/en-us/) 和 [Google Drive](https://www.google.com/drive/) 都没有提供本地 Linux 客户端。这是微软预计的事情,但是谷歌对 Linux 的冷漠令人震惊。 + +## Linux 下 Copy 的最佳替代者 + +现在,作为一个 Linux 存储,在云存储中你需要什么?让我们猜猜: + +- 大量的免费空间。毕竟,个人用户无法每月支付巨额款项。 +- 原生的 Linux 客户端。因此你能够使用提供的服务,方便地同步文件,而不用做一些特殊的调整或者定时执行脚本。 +- 其他桌面系统的客户端,比如 Windows 和 OS X。便携性是必要的,并且同步设备间的文件是一种很好的缓解。 +- Android 和 iOS 的移动应用程序。在今天的现代世界里,你需要连接所有设备。 + +我不将自托管的云服务计算在内,比如 OwnCloud 或 [Seafile](https://www.seafile.com/en/home/) ,因为它们需要自己建立和运行一个服务器。这不适合所有想要类似 Copy 的云服务的家庭用户。 + +让我们看看可以用于替代 Linux 下 Copy.com 的服务有什么。 + +## Mega + +![](http://itsfoss.com/wp-content/uploads/2016/02/Mega-Linux.jpg) + +如果你是一个 It’s FOSS 的普通读者,你可能已经看过我之前的一篇有关[Mega on Linux](http://itsfoss.com/install-mega-cloud-storage-linux/)的文章。这种云服务由[Megaupload scandal](https://en.wikipedia.org/wiki/Megaupload) 公司下臭名昭著的[Kim Dotcom](https://en.wikipedia.org/wiki/Kim_Dotcom)提供。这也使一些用户怀疑它,因为 Kim Dotcom 已经很长一段时间成为美国当局的目标。 + +Mega 拥有方便免费云服务下你所期望的一切。它给每个个人用户提供 50 GB 的免费存储空间。提供Linux 和其他平台下的原生客户端,并带有端到端的加密。原生的 Linux 客户端运行良好,可以无缝地跨平台同步。你也能在浏览器上查看操作你的文件。 + +### 优点: + +- 50 GB 的免费存储空间 +- 端到端的加密 +- Linux 和其他平台下的原生客户端,例如 Windows,Mac OS X,Android,iOS + +### 缺点: + +- Mega 拥有者见不得人的过去 + +[Mega](https://mega.nz/) + +## Hubic + +![](http://itsfoss.com/wp-content/uploads/2016/02/hubic.jpeg) + +Hubic 是一个来自法国公司的云服务。Hubic 在注册时也提供了 25 GB 免费存储空间。你可以通过推荐Hubic给朋友将空间扩大至 50 GB (对免费用户来说)。 + +Hubic 提供 Linux 客户端,其还是 beta 版本(至今已经两年了)。Hubic 拥有官方的 Linux 客户端,但是它局限在命令行。我没有去测试移动版本。 + +Hubic 拥有一些不错的功能。除了简单的用户界面、文件共享等等,它还有备份的功能,你可以定期地归档你的重要文件。 + +### 优点: + +- 25 GB 免费存储空间,可扩大至 50 GB +- 支持多个平台 +- 备份功能 + +### 缺点: + +- beta 版本的 Linux 客户端,只支持命令行 + +[Hubic](https://hubic.com/) + +## pCloud + +![](http://itsfoss.com/wp-content/uploads/2016/02/pCloud-Linux.jpeg) + +pCloud 是另一款欧洲的发行软件,但这一次从瑞士横跨法国边境。专注于加密和安全,pCloud 为每一个注册者提供 10 GB 的免费存储空间。你可以通过邀请好友、在社交媒体上分享链接等方式将空间增加至 20 GB。 + +它拥有云服务的所有标准特性,例如文件共享、同步、选择性同步等等。pCloud 也有跨平台原生客户端,当然包括 Linux。 + +Linux 客户端 容易使用,并在 Linux Mint 17.3 下的有限测试中表现良好。 + +### 优点: + +- 10 GB 免费存储空间,可扩大至 20 GB +- 运行良好的带有 GUI 的 Linux 客户端 + +### 缺点: + +- 加密是一个付费功能 + +[pCloud](https://www.pcloud.com/) + +## Yandex Disk + +![](http://itsfoss.com/wp-content/uploads/2016/02/Yandex.jpg) + +俄罗斯互联网巨人 Yandex 拥有 Google 所拥有的一切东西。搜索引擎、分析学、网站管理工具、邮箱、网页浏览器和云存储服务。 + +Yandex Disk 在注册时提供了 10 GB 的免费云存储空间。它有多平台的原生客户端,包括 Linux。然而,官方的 Linux 客户端只是命令行而已。你可以获取[非官方的 GUI 版本的 Yandex Disk 客户端](https://mintguide.org/tools/265-yd-tools-gui-indicator-for-yandexdisk-free-cloud-storage-in-linux-mint.html)。Yandex Disk 支持文件共享链接,同时带有其他标准的云存储特性。 + +### 优点: + +- 10 GB 的免费存储空间,可通过推荐的方式扩大至 20 GB + +### 缺点: + +- 只有命令行客户端 + +[Yandex Disk](https://disk.yandex.com/) + +## 公正而深思熟虑的删节 + +我从列表中删减了[Dropbox](https://www.dropbox.com/)、[SpiderOak](https://spideroak.com/)。Dropbox 对 Linux 来说非常优秀,但是它的免费存储空间限制在 2 GB。在过去的几年里,我已设法将其扩大超过 21 GB,但那又是另一件事了。 + +SpiderOak 也仅提供了 2 GB 的免费存储空间,你无法在网页浏览器上操作文件。 + +OwnCloud 需要属于自己的服务器包括建立,因此它并非人见人爱。并且它确切不符合一个典型云服务的标准。 + +## 结论 + +如果你问我应该使用什么替代 Copy,我的答案是 Mega。它带有大量的免费云存储空间和优秀的 Linux 客户端。在** Linux 下最佳云存储服务**的列表中,你的选择是什么?你更喜欢哪一个呢? + + +------------------------------------------------------------------------------ + +via: http://itsfoss.com/cloud-services-linux/ + +作者:[ABHISHEK][a] +译者:[cposture](https://github.com/cposture) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ From 4eef1eb5b7f74dfaab41084831c45e5c2ab3d2d0 Mon Sep 17 00:00:00 2001 From: cposture Date: Tue, 19 Apr 2016 16:02:36 +0800 Subject: [PATCH 0635/1469] Translating by cposture --- .../20151220 GCC-Inline-Assembly-HOWTO.md | 633 ------------------ ...to Best Manage Encryption Keys on Linux.md | 1 + ...loud Services For Linux To Replace Copy.md | 136 ---- 3 files changed, 1 insertion(+), 769 deletions(-) delete mode 100644 sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md delete mode 100644 sources/tech/20160220 Best Cloud Services For Linux To Replace Copy.md diff --git a/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md b/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md deleted file mode 100644 index b60ccad1f3..0000000000 --- a/sources/tech/20151220 GCC-Inline-Assembly-HOWTO.md +++ /dev/null @@ -1,633 +0,0 @@ -【Translating by cposture 2016-03-01】 -* * * - -# GCC 内联汇编 HOWTO - -v0.1, 01 March 2003. -* * * - -_本 HOWTO 文档将讲解 GCC 提供的内联汇编特性的用途和用法。对于阅读这篇文章,这里只有两个前提要求,很明显,就是 x86 汇编语言和 C 语言的基本认识。_ - -* * * - -## 1. 简介 - -## 1.1 版权许可 - -Copyright (C)2003 Sandeep S. - -本文档自由共享;你可以重新发布它,并且/或者在遵循自由软件基金会发布的 GNU 通用公共许可证下修改它;或者该许可证的版本 2 ,或者(按照你的需求)更晚的版本。 - -发布这篇文档是希望它能够帮助别人,但是没有任何保证;甚至不包括可售性和适用于任何特定目的的保证。关于更详细的信息,可以查看 GNU 通用许可证。 - -## 1.2 反馈校正 - -请将反馈和批评一起提交给 [Sandeep.S](mailto:busybox@sancharnet.in) 。我将感谢任何一个指出本文档中错误和不准确之处的人;一被告知,我会马上改正它们。 - -## 1.3 致谢 - -我对提供如此棒的特性的 GNU 人们表示真诚的感谢。感谢 Mr.Pramode C E 所做的所有帮助。感谢在 Govt Engineering College 和 Trichur 的朋友们的精神支持和合作,尤其是 Nisha Kurur 和 Sakeeb S 。 感谢在 Gvot Engineering College 和 Trichur 的老师们的合作。 - -另外,感谢 Phillip , Brennan Underwood 和 colin@nyx.net ;这里的许多东西都厚颜地直接取自他们的工作成果。 - -* * * - -## 2. 概览 - -在这里,我们将学习 GCC 内联汇编。这内联表示的是什么呢? - -我们可以要求编译器将一个函数的代码插入到调用者代码中函数被实际调用的地方。这样的函数就是内联函数。这听起来和宏差不多?这两者确实有相似之处。 - -内联函数的优点是什么呢? - -这种内联方法可以减少函数调用开销。同时如果所有实参的值为常量,它们的已知值可以在编译期允许简化,因此并非所有的内联函数代码都需要被包含。代码大小的影响是不可预测的,这取决于特定的情况。为了声明一个内联函数,我们必须在函数声明中使用 `inline` 关键字。 - -现在我们正处于一个猜测内联汇编到底是什么的点上。它只不过是一些写为内联函数的汇编程序。在系统编程上,它们方便、快速并且极其有用。我们主要集中学习(GCC)内联汇编函数的基本格式和用法。为了声明内联汇编函数,我们使用 `asm` 关键词。 - -内联汇编之所以重要,主要是因为它可以操作并且使其输出通过 C 变量显示出来。正是因为此能力, "asm" 可以用作汇编指令和包含它的 C 程序之间的接口。 - -* * * - -## 3. GCC 汇编语法 - -GCC , Linux上的 GNU C 编译器,使用 **AT&T** / **UNIX** 汇编语法。在这里,我们将使用 AT&T 语法 进行汇编编码。如果你对 AT&T 语法不熟悉的话,请不要紧张,我会教你的。AT&T 语法和 Intel 语法的差别很大。我会给出主要的区别。 - -1. 源操作数和目的操作数顺序 - - AT&T 语法的操作数方向和 Intel 语法的刚好相反。在Intel 语法中,第一操作数为目的操作数,第二操作数为源操作数,然而在 AT&T 语法中,第一操作数为源操作数,第二操作数为目的操作数。也就是说, - - Intel 语法中的 "Op-code dst src" 变为 - - AT&T 语法中的 "Op-code src dst"。 - -2. 寄存器命名 - - 寄存器名称有 % 前缀,即如果必须使用 eax,它应该用作 %eax。 - -3. 立即数 - - AT&T 立即数以 ’$’ 为前缀。静态 "C" 变量 也使用 ’$’ 前缀。在 Intel 语法中,十六进制常量以 ’h’ 为后缀,然而AT&T不使用这种语法,这里我们给常量添加前缀 ’0x’。所以,对于十六进制,我们首先看到一个 ’$’,然后是 ’0x’,最后才是常量。 - -4. 操作数大小 - - 在 AT&T 语法中,存储器操作数的大小取决于操作码名字的最后一个字符。操作码后缀 ’b’ 、’w’、’l’分别指明了字节(byte)(8位)、字(word)(16位)、长型(long)(32位)存储器引用。Intel 语法通过给存储器操作数添加’byte ptr’、 ’word ptr’ 和 ’dword ptr’前缀来实现这一功能。 - - 因此,Intel的 "mov al, byte ptr foo" 在 AT&T 语法中为 "movb foo, %al"。 - -5. 存储器操作数 - - 在 Intel 语法中,基址寄存器包含在 ’[’ 和 ’]’ 中,然而在 AT&T 中,它们变为 ’(’ 和 ’)’。另外,在 Intel 语法中, 间接内存引用为 - - section:[base + index*scale + disp], 在 AT&T中变为 - - section:disp(base, index, scale)。 - - 需要牢记的一点是,当一个常量用于 disp 或 scale,不能添加’$’前缀。 - -现在我们看到了 Intel 语法和 AT&T 语法之间的一些主要差别。我仅仅写了它们差别的一部分而已。关于更完整的信息,请参考 GNU 汇编文档。现在为了更好地理解,我们可以看一些示例。 - -> ` -> ->
+------------------------------+------------------------------------+
-> |       Intel Code             |      AT&T Code                     |
-> +------------------------------+------------------------------------+
-> | mov     eax,1                |  movl    $1,%eax                   |   
-> | mov     ebx,0ffh             |  movl    $0xff,%ebx                |   
-> | int     80h                  |  int     $0x80                     |   
-> | mov     ebx, eax             |  movl    %eax, %ebx                |
-> | mov     eax,[ecx]            |  movl    (%ecx),%eax               |
-> | mov     eax,[ebx+3]          |  movl    3(%ebx),%eax              | 
-> | mov     eax,[ebx+20h]        |  movl    0x20(%ebx),%eax           |
-> | add     eax,[ebx+ecx*2h]     |  addl    (%ebx,%ecx,0x2),%eax      |
-> | lea     eax,[ebx+ecx]        |  leal    (%ebx,%ecx),%eax          |
-> | sub     eax,[ebx+ecx*4h-20h] |  subl    -0x20(%ebx,%ecx,0x4),%eax |
-> +------------------------------+------------------------------------+
-> 
-> -> ` - -* * * - -## 4. 基本内联 - -基本内联汇编的格式非常直接了当。它的基本格式为 - -`asm("汇编代码");` - -示例 - -> ` -> -> * * * -> ->
asm("movl %ecx %eax"); /* 将 ecx 寄存器的内容移至 eax  */
-> __asm__("movb %bh (%eax)"); /* 将 bh 的一个字节数据 移至 eax 寄存器指向的内存 */
-> 
-> -> * * * -> -> ` - -你可能注意到了这里我使用了 `asm ` 和 `__asm__`。这两者都是有效的。如果关键词 `asm` 和我们程序的一些标识符冲突了,我们可以使用 `__asm__`。如果我们的指令多余一条,我们可以写成一行,并用括号括起,也可以为每条指令添加 ’\n’ 和 ’\t’ 后缀。这是因为gcc将每一条当作字符串发送给 **as**(GAS)( GAS 即 GNU 汇编器 ——译者注),并且通过使用换行符/制表符发送正确地格式化行给汇编器。 - -示例 - -> ` -> -> * * * -> ->
 __asm__ ("movl %eax, %ebx\n\t"
->           "movl $56, %esi\n\t"
->           "movl %ecx, $label(%edx,%ebx,$4)\n\t"
->           "movb %ah, (%ebx)");
-> 
-> -> * * * -> -> ` - -如果在代码中,我们涉及到一些寄存器(即改变其内容),但在没有固定这些变化的情况下从汇编中返回,这将会导致一些不好的事情。这是因为 GCC 并不知道寄存器内容的变化,这会导致问题,特别是当编译器做了某些优化。在没有告知 GCC 的情况下,它将会假设一些寄存器存储了我们可能已经改变的变量的值,它会像什么事都没发生一样继续运行(什么事都没发生一样是指GCC不会假设寄存器装入的值是有效的,当退出改变了寄存器值的内联汇编后,寄存器的值不会保存到相应的变量或内存空间 ——译者注)。我们所可以做的是使用这些没有副作用的指令,或者当我们退出时固定这些寄存器,或者等待程序崩溃。这是为什么我们需要一些扩展功能。扩展汇编正好给我们提供了那样的功能。 - -* * * - -## 5. 扩展汇编 - -在基本内联汇编中,我们只有指令。然而在扩展汇编中,我们可以同时指定操作数。它允许我们指定输入寄存器、输出寄存器以及修饰寄存器列表。GCC 不强制用户必须指定使用的寄存器。我们可以把头疼的事留给 GCC ,这可能可以更好地适应 GCC 的优化。不管怎樣,基本格式为: - -> ` -> -> * * * -> ->
       asm ( 汇编程序模板 
->            : 输出操作数					/* 可选的 */
->            : 输入操作数                   /* 可选的 */
->            : 修饰寄存器列表			    /* 可选的 */
->            );
-> 
-> -> * * * -> -> ` - -汇编程序模板由汇编指令组成.每一个操作数由一个操作数约束字符串所描述,其后紧接一个括弧括起的 C 表达式。冒号用于将汇编程序模板和第一个输出操作数分开,另一个(冒号)用于将最后一个输出操作数和第一个输入操作数分开,如果存在的话。逗号用于分离每一个组内的操作数。总操作数的数目限制在10个,或者机器描述中的任何指令格式中的最大操作数数目,以较大者为准。 - -如果没有输出操作数但存在输入操作数,你必须将两个连续的冒号放置于输出操作数原本会放置的地方周围。 - -示例: - -> ` -> -> * * * -> ->
        asm ("cld\n\t"
->              "rep\n\t"
->              "stosl"
->              : /* 无输出寄存器 */
->              : "c" (count), "a" (fill_value), "D" (dest)
->              : "%ecx", "%edi" 
->              );
-> 
-> -> * * * -> -> ` - -现在,这段代码是干什么的?以上的内联汇编是将 `fill_value` 值 连续 `count` 次 拷贝到 寄存器 `edi` 所指位置(每执行stosl一次,寄存器 edi 的值会递增或递减,这取决于是否设置了 direction 标志,因此以上代码实则初始化一个内存块 ——译者注)。 它也告诉 gcc 寄存器 `ecx` 和 `edi` 一直无效(原文为 eax ,但代码修饰寄存器列表中为 ecx,因此这可能为作者的纰漏 ——译者注)。为了使扩展汇编更加清晰,让我们再看一个示例。 - -> ` -> -> * * * -> ->
        
->         int a=10, b;
->         asm ("movl %1, %%eax; 
->               movl %%eax, %0;"
->              :"=r"(b)        /* 输出 */
->              :"r"(a)         /* 输入 */
->              :"%eax"         /* 修饰寄存器 */
->              );       
-> 
-> -> * * * -> -> ` - -这里我们所做的是使用汇编指令使 ’b’ 变量的值等于 ’a’ 变量的值。一些有意思的地方是: - -* "b" 为输出操作数,用 %0 引用,并且 "a" 为输入操作数,用 %1 引用。 -* "r" 为操作数约束。之后我们会更详细地了解约束(字符串)。目前,"r" 告诉 GCC 可以使用任一寄存器存储操作数。输出操作数约束应该有一个约束修饰符 "=" 。这修饰符表明它是一个只读的输出操作数。 -* 寄存器名字以两个%为前缀。这有利于 GCC 区分操作数和寄存器。操作数以一个 % 为前缀。 -* 第三个冒号之后的修饰寄存器 %eax 告诉 GCC %eax的值将会在 "asm" 内部被修改,所以 GCC 将不会使用此寄存器存储任何其他值。 - -当 "asm" 执行完毕, "b" 变量会映射到更新的值,因为它被指定为输出操作数。换句话说, "asm" 内 "b" 变量的修改 应该会被映射到 "asm" 外部。 - -现在,我们可以更详细地看看每一个域。 - -## 5.1 汇编程序模板 - -汇编程序模板包含了被插入到 C 程序的汇编指令集。其格式为:每条指令用双引号圈起,或者整个指令组用双引号圈起。同时每条指令应以分界符结尾。有效的分界符有换行符(\n)和逗号(;)。’\n’ 可以紧随一个制表符(\t)。我们应该都明白使用换行符或制表符的原因了吧?和 C 表达式对应的操作数使用 %0、%1 ... 等等表示。 - -## 5.2 操作数 - -C 表达式用作 "asm" 内的汇编指令操作数。作为第一双引号内的操作数约束,写下每一操作数。对于输出操作数,在引号内还有一个约束修饰符,其后紧随一个用于表示操作数的 C 表达式。即, - -"约束字符串"(C 表达式),它是一个通用格式。对于输出操作数,还有一个额外的修饰符。约束字符串主要用于决定操作数的寻找方式,同时也用于指定使用的寄存器。 - -如果我们使用的操作数多于一个,那么每一个操作数用逗号隔开。 - -在汇编程序模板,每个操作数用数字引用。编号方式如下。如果总共有 n 个操作数(包括输入和输出操作数),那么第一个输出操作数编号为 0 ,逐项递增,并且最后一个输入操作数编号为 n - 1 。操作数的最大数目为前一节我们所看到的那样。 - -输出操作数表达式必须为左值。输入操作数的要求不像这样严格。它们可以为表达式。扩展汇编特性常常用于编译器自己不知道其存在的机器指令 ;-)。如果输出表达式无法直接寻址(例如,它是一个位域),我们的约束字符串必须给定一个寄存器。在这种情况下,GCC 将会使用该寄存器作为汇编的输出,然后存储该寄存器的内容到输出。 - -正如前面所陈述的一样,普通的输出操作数必须为只写的; GCC 将会假设指令前的操作数值是死的,并且不需要被(提前)生成。扩展汇编也支持输入-输出或者读-写操作数。 - -所以现在我们来关注一些示例。我们想要求一个数的5次方结果。为了计算该值,我们使用 `lea` 指令。 - -> ` -> -> * * * -> ->
        asm ("leal (%1,%1,4), %0"
->              : "=r" (five_times_x)
->              : "r" (x) 
->              );
-> 
-> -> * * * -> -> ` - -这里我们的输入为x。我们不指定使用的寄存器。 GCC 将会选择一些输入寄存器,一个输出寄存器,并且做我们期望的事。如果我们想要输入和输出存在于同一个寄存器里,我们可以要求 GCC 这样做。这里我们使用那些读-写操作数类型。这里我们通过指定合适的约束来实现它。 - -> ` -> -> * * * -> ->
        asm ("leal (%0,%0,4), %0"
->              : "=r" (five_times_x)
->              : "0" (x) 
->              );
-> 
-> -> * * * -> -> ` - -现在输出和输出操作数位于同一个寄存器。但是我们无法得知是哪一个寄存器。现在假如我们也想要指定操作数所在的寄存器,这里有一种方法。 - -> ` -> -> * * * -> ->
        asm ("leal (%%ecx,%%ecx,4), %%ecx"
->              : "=c" (x)
->              : "c" (x) 
->              );
-> 
-> -> * * * -> -> ` - -在以上三个示例中,我们并没有添加任何寄存器到修饰寄存器里,为什么?在头两个示例, GCC 决定了寄存器并且它知道发生了什么改变。在最后一个示例,我们不必将 'ecx' 添加到修饰寄存器列表(原文修饰寄存器列表拼写有错,这里已修正 ——译者注), gcc 知道它表示x。因此,因为它可以知道 `ecx` 的值,它就不被当作修饰的(寄存器)了。 - -## 5.3 修饰寄存器列表 - -一些指令会破坏一些硬件寄存器。我们不得不在修饰寄存器中列出这些寄存器,即汇编函数内第三个 ’**:**’ 之后的域。这可以通知 gcc 我们将会自己使用和修改这些寄存器。所以 gcc 将不会假设存入这些寄存器的值是有效的。我们不用在这个列表里列出输入输出寄存器。因为 gcc 知道 "asm" 使用了它们(因为它们被显式地指定为约束了)。如果指令隐式或显式地使用了任何其他寄存器,(并且寄存器不能出现在输出或者输出约束列表里),那么不得不在修饰寄存器列表中指定这些寄存器。 - -如果我们的指令可以修改状态寄存器,我们必须将 "cc" 添加进修饰寄存器列表。 - -如果我们的指令以不可预测的方式修改了内存,那么需要将 "memory" 添加进修饰寄存器列表。这可以使 GCC 不会在汇编指令间保持缓存于寄存器的内存值。如果被影响的内存不在汇编的输入或输出列表中,我们也必须添加 **volatile** 关键词。 - -我们可以按我们的需求多次读写修饰寄存器。考虑一个模板内的多指令示例;它假设子例程 _foo 接受寄存器 `eax` 和 `ecx` 里的参数。 - -> ` -> -> * * * -> ->
        asm ("movl %0,%%eax;
->               movl %1,%%ecx;
->               call _foo"
->              : /* no outputs */
->              : "g" (from), "g" (to)
->              : "eax", "ecx"
->              );
-> 
-> -> * * * -> -> ` - -## 5.4 Volatile ...? - -如果你熟悉内核源码或者其他像内核源码一样漂亮的代码,你一定见过许多声明为 `volatile` 或者 `__volatile__`的函数,其跟着一个 `asm` 或者 `__asm__`。我之前提过关键词 `asm` 和 `__asm__`。那么什么是 `volatile`呢? - -如果我们的汇编语句必须在我们放置它的地方执行(即,不能作为一种优化被移出循环语句),将关键词 `volatile` 放置在 asm 后面,()的前面。因为为了防止它被移动、删除或者其他操作,我们将其声明为 - -`asm volatile ( ... : ... : ... : ...);` - -当我们必须非常谨慎时,请使用 `__volatile__`。 - -如果我们的汇编只是用于一些计算并且没有任何副作用,不使用 `volatile` 关键词会更好。不使用 `volatile` 可以帮助 gcc 优化代码并使代码更漂亮。 - - -在 `Some Useful Recipes` 一节中,我提供了多个内联汇编函数的例子。这儿我们详细查看修饰寄存器列表。 - -* * * - -## 6. 更多关于约束 - -到这个时候,你可能已经了解到约束和内联汇编有很大的关联。但我们很少说到约束。约束用于表明一个操作数是否可以位于寄存器和位于哪个寄存器;是否操作数可以为一个内存引用和哪种地址;是否操作数可以为一个立即数和为哪一个可能的值(即值的范围)。它可以有...等等。 - -## 6.1 常用约束 - -在许多约束中,只有小部分是常用的。我们将看看这些约束。 - -1. **寄存器操作数约束(r)** - - 当使用这种约束指定操作数时,它们存储在通用寄存器(GPR)中。请看下面示例: - - `asm ("movl %%eax, %0\n" :"=r"(myval));` - - 这里,变量 myval 保存在寄存器中,寄存器 eax 的值被复制到该寄存器中,并且myval的值从寄存器更新到了内存。当指定 "r" 约束时, gcc 可以将变量保存在任何可用的 GPR 中。为了指定寄存器,你必须使用特定寄存器约束直接地指定寄存器的名字。它们为: - - > ` - > - >
+---+--------------------+
-    > | r |    Register(s)     |
-    > +---+--------------------+
-    > | a |   %eax, %ax, %al   |
-    > | b |   %ebx, %bx, %bl   |
-    > | c |   %ecx, %cx, %cl   |
-    > | d |   %edx, %dx, %dl   |
-    > | S |   %esi, %si        |
-    > | D |   %edi, %di        |
-    > +---+--------------------+
-    > 
- > - > ` - -2. **内存操作数约束(m)** - - 当操作数位于内存时,任何对它们的操作将直接发生在内存位置,这与寄存器约束相反,后者首先将值存储在要修改的寄存器中,然后将它写回到内存位置。但寄存器约束通常用于一个指令必须使用它们或者它们可以大大提高进程速度的地方。当需要在 "asm" 内更新一个 C 变量,而又不想使用寄存器去保存它的只,使用内存最为有效。例如, idtr 的值存储于内存位置: - - `asm("sidt %0\n" : :"m"(loc));` - -3. **匹配(数字)约束** - - 在某些情况下,一个变量可能既充当输入操作数,也充当输出操作数。可以通过使用匹配约束在 "asm" 中指定这种情况。 - - `asm ("incl %0" :"=a"(var):"0"(var));` - - 在操作数子节中,我们也看到了一些类似的示例。在这个匹配约束的示例中,寄存器 "%eax" 既用作输入变量,也用作输出变量。 var 输入被读进 %eax ,并且更新的 %eax 再次被存储进 var。这里的 "0" 用于指定与第0个输出变量相同的约束。也就是,它指定 var 输出实例应只被存储在 "%eax" 中。该约束可用于: - - * 在输入从变量读取或变量修改后,修改被写回同一变量的情况 - * 在不需要将输入操作数实例和输出操作数实例分开的情况 - - 使用匹配约束最重要的意义在于它们可以导致有效地使用可用寄存器。 - -其他一些约束: - -1. "m" : 允许一个内存操作数使用机器普遍支持的任一种地址。 -2. "o" : 允许一个内存操作数,但只有当地址是可偏移的。即,该地址加上一个小的偏移量可以得到一个地址。 -3. "V" : A memory operand that is not offsettable. In other words, anything that would fit the `m’ constraint but not the `o’constraint. -4. "i" : 允许一个(带有常量)的立即整形操作数。这包括其值仅在汇编时期知道的符号常量。 -5. "n" : 允许一个带有已知数字的立即整形操作数。许多系统不支持汇编时期的常量,因为操作数少于一个字宽。对于此种操作数,约束应该使用 'n' 而不是'i'。 -6. "g" : 允许任一寄存器、内存或者立即整形操作数,不包括通用寄存器之外的寄存器。 - - -以下约束为x86特有。 - -1. "r" : 寄存器操作数约束,查看上面给定的表格。 -2. "q" : 寄存器 a、b、c 或者 d。 -3. "I" : 范围从 0 到 31 的常量(对于 32 位移位)。 -4. "J" : 范围从 0 到 63 的常量(对于 64 位移位)。 -5. "K" : 0xff。 -6. "L" : 0xffff。 -7. "M" : 0, 1, 2, or 3 (lea 指令的移位)。 -8. "N" : 范围从 0 到 255 的常量(对于 out 指令)。 -9. "f" : 浮点寄存器 -10. "t" : 第一个(栈顶)浮点寄存器 -11. "u" : 第二个浮点寄存器 -12. "A" : 指定 `a` 或 `d` 寄存器。这主要用于想要返回 64 位整形数,使用 `d` 寄存器保存最高有效位和 `a` 寄存器保存最低有效位。 - -## 6.2 约束修饰符 - -当使用约束时,对于更精确的控制超越了约束作用的需求,GCC 给我们提供了约束修饰符。最常用的约束修饰符为: - -1. "=" : 意味着对于这条指令,操作数为只写的;旧值会被忽略并被输出数据所替换。 -2. "&" : 意味着这个操作数为一个早期的改动操作数,其在该指令完成前通过使用输入操作数被修改了。因此,这个操作数不可以位于一个被用作输出操作数或任何内存地址部分的寄存器。如果在旧值被写入之前它仅用作输入而已,一个输入操作数可以为一个早期改动操作数。 - - 约束的列表和解释是决不完整的。示例可以给我们一个关于内联汇编的用途和用法的更好的理解。在下一节,我们会看到一些示例,在那里我们会发现更多关于修饰寄存器列表的东西。 - -* * * - -## 7. Some Useful Recipes. - -Now we have covered the basic theory about GCC inline assembly, now we shall concentrate on some simple examples. It is always handy to write inline asm functions as MACRO’s. We can see many asm functions in the kernel code. (/usr/src/linux/include/asm/*.h). - -1. First we start with a simple example. We’ll write a program to add two numbers. - - > ` - > - > * * * - > - >
int main(void)
-    > {
-    >         int foo = 10, bar = 15;
-    >         __asm__ __volatile__("addl  %%ebx,%%eax"
-    >                              :"=a"(foo)
-    >                              :"a"(foo), "b"(bar)
-    >                              );
-    >         printf("foo+bar=%d\n", foo);
-    >         return 0;
-    > }
-    > 
- > - > * * * - > - > ` - - Here we insist GCC to store foo in %eax, bar in %ebx and we also want the result in %eax. The ’=’ sign shows that it is an output register. Now we can add an integer to a variable in some other way. - - > ` - > - > * * * - > - >
 __asm__ __volatile__(
-    >                       "   lock       ;\n"
-    >                       "   addl %1,%0 ;\n"
-    >                       : "=m"  (my_var)
-    >                       : "ir"  (my_int), "m" (my_var)
-    >                       :                                 /* no clobber-list */
-    >                       );
-    > 
- > - > * * * - > - > ` - - This is an atomic addition. We can remove the instruction ’lock’ to remove the atomicity. In the output field, "=m" says that my_var is an output and it is in memory. Similarly, "ir" says that, my_int is an integer and should reside in some register (recall the table we saw above). No registers are in the clobber list. - -2. Now we’ll perform some action on some registers/variables and compare the value. - - > ` - > - > * * * - > - >
 __asm__ __volatile__(  "decl %0; sete %1"
-    >                       : "=m" (my_var), "=q" (cond)
-    >                       : "m" (my_var) 
-    >                       : "memory"
-    >                       );
-    > 
- > - > * * * - > - > ` - - Here, the value of my_var is decremented by one and if the resulting value is `0` then, the variable cond is set. We can add atomicity by adding an instruction "lock;\n\t" as the first instruction in assembler template. - - In a similar way we can use "incl %0" instead of "decl %0", so as to increment my_var. - - Points to note here are that (i) my_var is a variable residing in memory. (ii) cond is in any of the registers eax, ebx, ecx and edx. The constraint "=q" guarantees it. (iii) And we can see that memory is there in the clobber list. ie, the code is changing the contents of memory. - -3. How to set/clear a bit in a register? As next recipe, we are going to see it. - - > ` - > - > * * * - > - >
__asm__ __volatile__(   "btsl %1,%0"
-    >                       : "=m" (ADDR)
-    >                       : "Ir" (pos)
-    >                       : "cc"
-    >                       );
-    > 
- > - > * * * - > - > ` - - Here, the bit at the position ’pos’ of variable at ADDR ( a memory variable ) is set to `1` We can use ’btrl’ for ’btsl’ to clear the bit. The constraint "Ir" of pos says that, pos is in a register, and it’s value ranges from 0-31 (x86 dependant constraint). ie, we can set/clear any bit from 0th to 31st of the variable at ADDR. As the condition codes will be changed, we are adding "cc" to clobberlist. - -4. Now we look at some more complicated but useful function. String copy. - - > ` - > - > * * * - > - >
static inline char * strcpy(char * dest,const char *src)
-    > {
-    > int d0, d1, d2;
-    > __asm__ __volatile__(  "1:\tlodsb\n\t"
-    >                        "stosb\n\t"
-    >                        "testb %%al,%%al\n\t"
-    >                        "jne 1b"
-    >                      : "=&S" (d0), "=&D" (d1), "=&a" (d2)
-    >                      : "0" (src),"1" (dest) 
-    >                      : "memory");
-    > return dest;
-    > }
-    > 
- > - > * * * - > - > ` - - The source address is stored in esi, destination in edi, and then starts the copy, when we reach at **0**, copying is complete. Constraints "&S", "&D", "&a" say that the registers esi, edi and eax are early clobber registers, ie, their contents will change before the completion of the function. Here also it’s clear that why memory is in clobberlist. - - We can see a similar function which moves a block of double words. Notice that the function is declared as a macro. - - > ` - > - > * * * - > - >
#define mov_blk(src, dest, numwords) \
-    > __asm__ __volatile__ (                                          \
-    >                        "cld\n\t"                                \
-    >                        "rep\n\t"                                \
-    >                        "movsl"                                  \
-    >                        :                                        \
-    >                        : "S" (src), "D" (dest), "c" (numwords)  \
-    >                        : "%ecx", "%esi", "%edi"                 \
-    >                        )
-    > 
- > - > * * * - > - > ` - - Here we have no outputs, so the changes that happen to the contents of the registers ecx, esi and edi are side effects of the block movement. So we have to add them to the clobber list. - -5. In Linux, system calls are implemented using GCC inline assembly. Let us look how a system call is implemented. All the system calls are written as macros (linux/unistd.h). For example, a system call with three arguments is defined as a macro as shown below. - - > ` - > - > * * * - > - > type name(type1 arg1,type2 arg2,type3 arg3) \ - > { \ - > long __res; \ - > __asm__ volatile ( "int $0x80" \ - > : "=a" (__res) \ - > : "0" (__NR_##name),"b" ((long)(arg1)),"c" ((long)(arg2)), \ - > "d" ((long)(arg3))); \ - > __syscall_return(type,__res); \ - > } - >
- > - > * * * - > - > ` - - Whenever a system call with three arguments is made, the macro shown above is used to make the call. The syscall number is placed in eax, then each parameters in ebx, ecx, edx. And finally "int 0x80" is the instruction which makes the system call work. The return value can be collected from eax. - - Every system calls are implemented in a similar way. Exit is a single parameter syscall and let’s see how it’s code will look like. It is as shown below. - - > ` - > - > * * * - > - >
{
-    >         asm("movl $1,%%eax;         /* SYS_exit is 1 */
-    >              xorl %%ebx,%%ebx;      /* Argument is in ebx, it is 0 */
-    >              int  $0x80"            /* Enter kernel mode */
-    >              );
-    > }
-    > 
- > - > * * * - > - > ` - - The number of exit is "1" and here, it’s parameter is 0\. So we arrange eax to contain 1 and ebx to contain 0 and by `int $0x80`, the `exit(0)` is executed. This is how exit works. - -* * * - -## 8. Concluding Remarks. - -This document has gone through the basics of GCC Inline Assembly. Once you have understood the basic concept it is not difficult to take steps by your own. We saw some examples which are helpful in understanding the frequently used features of GCC Inline Assembly. - -GCC Inlining is a vast subject and this article is by no means complete. More details about the syntax’s we discussed about is available in the official documentation for GNU Assembler. Similarly, for a complete list of the constraints refer to the official documentation of GCC. - -And of-course, the Linux kernel use GCC Inline in a large scale. So we can find many examples of various kinds in the kernel sources. They can help us a lot. - -If you have found any glaring typos, or outdated info in this document, please let us know. - -* * * - -## 9. References. - -1. [Brennan’s Guide to Inline Assembly](http://www.delorie.com/djgpp/doc/brennan/brennan_att_inline_djgpp.html) -2. [Using Assembly Language in Linux](http://linuxassembly.org/articles/linasm.html) -3. [Using as, The GNU Assembler](http://www.gnu.org/manual/gas-2.9.1/html_mono/as.html) -4. [Using and Porting the GNU Compiler Collection (GCC)](http://gcc.gnu.org/onlinedocs/gcc_toc.html) -5. [Linux Kernel Source](http://ftp.kernel.org/) - -* * * -via: http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html - - 作者:[Sandeep.S](mailto:busybox@sancharnet.in) 译者:[](https://github.com/) 校对:[]() - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/sources/tech/20160218 How to Best Manage Encryption Keys on Linux.md b/sources/tech/20160218 How to Best Manage Encryption Keys on Linux.md index 19aab96541..1648ac6263 100644 --- a/sources/tech/20160218 How to Best Manage Encryption Keys on Linux.md +++ b/sources/tech/20160218 How to Best Manage Encryption Keys on Linux.md @@ -1,3 +1,4 @@ +[Translating by cposture] How to Best Manage Encryption Keys on Linux ============================================= diff --git a/sources/tech/20160220 Best Cloud Services For Linux To Replace Copy.md b/sources/tech/20160220 Best Cloud Services For Linux To Replace Copy.md deleted file mode 100644 index 8e178b856e..0000000000 --- a/sources/tech/20160220 Best Cloud Services For Linux To Replace Copy.md +++ /dev/null @@ -1,136 +0,0 @@ -[Translating by cposture 2016-03-12] -Best Cloud Services For Linux To Replace Copy -=============================================== - -![](http://itsfoss.com/wp-content/uploads/2016/02/Linux-cloud-services.jpg) - -Cloud storage service Copy is shutting down and it is time for us Linux users to look for a worthy **cloud storage alternative to Copy for Linux**. - -All files will be deleted on May 1st, 2016. If you are a Copy user, you should save your files and move it to other - -Copy has been my favorite cloud storage for past couple of years. It gave me plenty of free storage and came with native apps for desktop platforms including Linux and mobile platforms as iOS and Android. - -It was a perfect Cloud storage for me where I get plenty of free storage (380 GB) with a seamless experience between desktop and mobile OSes. But this ‘easy free storage’, 15GB for signup and 5Gb for each referral, had me thinking that if Copy doesn’t get business customers, they will be running out of business soon. Such huge free storage only meant that they were not targeting individual customers like Dropbox do. - -My fear came true when I read about the shutting down of Copy.com. In fact, Copy is not alone. Its parent company [Barracuda Networks](https://www.barracuda.com/) is going through a rough patch and has [hired Morgan Stanely to look for suitable buyer](http://www.bloomberg.com/news/articles/2016-02-01/barracuda-networks-said-to-work-with-morgan-stanley-to-seek-sale)(s). - -Whatever be the reason, all we know is that Copy will soon be history and we need to find similarly **good cloud services for Linux**. I am putting emphasis on Linux because other popular cloud storage services like [Microsoft’s OneDrive](https://onedrive.live.com/about/en-us/) and [Google Drive](https://www.google.com/drive/) do not provide native Linux client. This is something expected out of Microsoft but [Google’s apathy towards Linux](http://itsfoss.com/google-hates-desktop-linux/) is shocking. - -## Best Copy alternatives for Linux - -Now, what do you want in a cloud storage services as a Linux storage? Let me guess: - -- Lots of free storage. After all, individuals cannot pay hefty amounts every month. -- Native Linux client. So that you can synchronize files easily with the server without doing special tweaking or running scripts at regular intervals. -- Desktop clients for other desktop OSes i.e. Windows and OS X. Portability is a necessity and syncing files between devices is such a good relief. -- Mobile apps for Android and iOS. In today’s modern world, you need to be connected across all the devices. - -I am not counting the self-hosted cloud services like OwnCloud or [Seafile](https://www.seafile.com/en/home/) because they require set-up and run a server. This is not apt for all home users who want a Copy like cloud service. - -Let’s see what are the services that you could use to replace Copy.com on Linux. - -## Mega - -![](http://itsfoss.com/wp-content/uploads/2016/02/Mega-Linux.jpg) - -If you are a regular It’s FOSS reader, you might have come across my earlier article about [Mega on Linux](http://itsfoss.com/install-mega-cloud-storage-linux/). This cloud service is an offering by the infamous [Kim Dotcom](https://en.wikipedia.org/wiki/Kim_Dotcom) of [Megaupload scandal](https://en.wikipedia.org/wiki/Megaupload). This also makes some users skeptical about it because Kim Dotcom has been a target by US authorities for a long time. - -Mega has everything that you would expect in a hassle free cloud service. It provides 50 GB of free storage to individual users. Provide native clients for Linux and other platforms and also has end to end encryption. The native Linux client works fine and the sync across the device is seamless. You can also view and access your files in a web browser. - -### Pros: - -- 50 GB of free storage -- End to end encryption -- Native clients for Linux and other platforms such as Windows, Mac OS X, Android, iOS - -### Cons: - -- Shady past of the owner - -[Mega](https://mega.nz/) - -## Hubic - -![](http://itsfoss.com/wp-content/uploads/2016/02/hubic.jpeg) - -Hubic is a cloud service from French company [OVH](https://www.ovh.com/fr/). Hubic also offers 25 GB of free cloud storage at sign up. You can further extend it to 50GB (for free users) by referring it to friends. - -Hubic has a Linux client which is in beta (for over two years now). Hubic has an official Linux client but it is limited to command line. I did not go on to test the mobile versions. - -Hubic boasts of some nice features though. Apart from simple to use interface, file sharing etc, it has a Backup feature where you can archive your important files regularly. - -### Pros: - -- 25 GB of free storage, extendable up to 50 GB -- Available on multiple platforms -- Backup feature - -### Cons: - -- Linux client in beta, only available in command line - -[Hubic](https://hubic.com/) - -## pCloud - -![](http://itsfoss.com/wp-content/uploads/2016/02/pCloud-Linux.jpeg) - -pCloud is another European offering but this time across the French border, from Switzerland. Focused on encryption and security, pCloud offers 10 GB of free storage for each signup. You can further increase it up to 20 GB by inviting friends, sharing links on social media etc. - -It has all the standard features of a cloud service such as file sharing and synchronization, selective syncing etc. pCloud also has native clients across platforms, including Linux of course. - -Linux client is easy to use and worked well in my limited testing on Linux Mint 17.3. - -### Pros: - -- 10 GB of free storage, extendable up to 20 GB -- A good working Linux client with GUI - -### Cons: - -- Encryption is a premium feature - -[pCloud](https://www.pcloud.com/) - -## Yandex Disk - -![](http://itsfoss.com/wp-content/uploads/2016/02/Yandex.jpg) - -Russian internet giant Yandex has everything that Google has. A search engine, analytics and webmaster tool, email, web browser and cloud storage service. - -Yandex Disk offers 10 GB of free cloud storage on sign up. It has native clients for multiple platforms, including Linux. However, the official Linux client is only command line. You can get [unofficial GUI client for Yandex disk](https://mintguide.org/tools/265-yd-tools-gui-indicator-for-yandexdisk-free-cloud-storage-in-linux-mint.html) though. File sharing via links is available as along with other standard cloud storage feature. - -### Pros: - -- 10 GB of free storage, extendable up to 20 GB via referrals. - -### Cons: - -- Only command line client available - -[Yandex Disk](https://disk.yandex.com/) - -## Honorable and deliberate omissions - -I have deliberately skipped [Dropbox](https://www.dropbox.com/), [SpiderOak](https://spideroak.com/) from the list. Dropbox is excellent for Linux but the free storage is limited to 2 GB. Over the past several years, I have managed to increase it to over 21 GB, but that’s another story. - -SpiderOak also provides only 2 GB of free storage and you cannot access it in a web browser. - -OwnCloud needs its own server and set-up and thus it is not everyone’s cup of tea. And it certainly doesn’t fit the criteria of a typical cloud service. - -## Verdict - -If you ask me what I am going to use in place of Copy, my answer is Mega. It has plenty of free cloud storage and a great Linux desktop client. What is your choice among this list of **best cloud storage services for Linux**? Which one do you prefer? - - ------------------------------------------------------------------------------- - -via: http://itsfoss.com/cloud-services-linux/ - -作者:[ABHISHEK][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://itsfoss.com/author/abhishek/ From a01e028699f47f8592a2a72753ef44c78de4f529 Mon Sep 17 00:00:00 2001 From: cposture Date: Tue, 19 Apr 2016 16:10:38 +0800 Subject: [PATCH 0636/1469] as --- .../tech/20160218 How to Best Manage Encryption Keys on Linux.md | 1 - 1 file changed, 1 deletion(-) diff --git a/sources/tech/20160218 How to Best Manage Encryption Keys on Linux.md b/sources/tech/20160218 How to Best Manage Encryption Keys on Linux.md index 1648ac6263..19aab96541 100644 --- a/sources/tech/20160218 How to Best Manage Encryption Keys on Linux.md +++ b/sources/tech/20160218 How to Best Manage Encryption Keys on Linux.md @@ -1,4 +1,3 @@ -[Translating by cposture] How to Best Manage Encryption Keys on Linux ============================================= From e0627f1cc11a5217de54b8a42266286d0c073ca9 Mon Sep 17 00:00:00 2001 From: willowyoung <1079902707@qq.com> Date: Tue, 19 Apr 2016 17:06:29 +0800 Subject: [PATCH 0637/1469] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=B7=B2=E7=BF=BB?= =?UTF-8?q?=E8=AF=91=E5=8E=9F=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ocessing at NASA with open source tools.md | 82 ------------------- 1 file changed, 82 deletions(-) delete mode 100644 sources/tech/20160304 Image processing at NASA with open source tools.md diff --git a/sources/tech/20160304 Image processing at NASA with open source tools.md b/sources/tech/20160304 Image processing at NASA with open source tools.md deleted file mode 100644 index 4833b7bf93..0000000000 --- a/sources/tech/20160304 Image processing at NASA with open source tools.md +++ /dev/null @@ -1,82 +0,0 @@ -Translating By willowyoung -Image processing at NASA with open source tools -======================================================= - -keyword: NASA , Image Process , Node.js , OpenCV - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/nasa_spitzer_space_pink_spiral.jpg?itok=3XEUstkl) - -This past summer, I was an intern at the [GVIS][1] Lab at [NASA][2] Glenn, where I brought my passion for open source into the lab. My task was to improve our lab's contributions to an open source fluid flow dynamics [simulation][3] developed by Dan Schroeder. The original simulation presents obstacles that users can draw in with their mouse to model computational fluid dynamics. My team contributed by adding image processing code that analyzes each frame of a live video feed to show how a physical object interacts with a fluid. But, there was more for us to do. - -We wanted to make the image processing more robust, so I worked on improving the image processing library. - -With the new library, the simulation would be able to detect contours, perform coordinate transformations in place, and find the center of mass of an object. The image processing doesn't directly relate to the physics of the fluid flow dynamics simulation. It detects the object with a camera and creates a barrier for the fluid flow simulation by getting the outline of the object. Then, the fluid flow simulation runs, and the output is projected down onto the actual object. - -My goal was to improve the simulation in three ways: - -1. to find accurate contours of an object -2. to find the center of mass of an object -3. to be able to perform accurate transformations about the center of an object - -My mentor recommended that I install [Node.js][4], [OpenCV][5], and the [Node.js bindings for OpenCV][6]. While I was waiting for those to install, I looked at the example code on the OpenCV bindings on their [GitHub page][7]. I discovered that the example code was in JavaScript, so because I didn’t know JavaScript, I started a short course from Codecademy. Two days later, I was sick of JavaScript but ready to start my project... which involved yet more JavaScript. - -The example contour-finding code worked well. In fact, it allowed me to accomplish my first goal in a matter of hours! To get the contours of an image, here's what it looked like: - -![](https://opensource.com/sites/default/files/resize/image_processing_nasa_1-520x293.jpg) ->The original image with all of the contours. - -The example contour-finding code worked a bit too well. Instead of the contour of the object being detected, all of the contours in the image were detected. This would have resulted in the simulation interacting with all of the unwanted contours. This is a problem because it would return incorrect data. To keep the simulation from interacting with the unwanted contours, I added an area constraint. If the contour was in a certain area range, then it would be drawn. The area constraint resulted in a much cleaner contour. - -![](https://opensource.com/sites/default/files/resize/image_processing_nasa_2-520x293.jpg) ->The filtered contour with the shadow contour. - -Though the extraneous contours weren't detected, there was still a problem with the image. There was only one contour in the image, but it doubled back on itself and wasn't complete. Area couldn't be a deciding factor here, so it was time to try something else. - -This time around, instead of immediately finding the contours, I first converted the image into a binary image. A binary image is an image where each pixel is either black or white. To get a binary image I first converted the color image to grayscale. Once the image was in grayscale, I called the threshold method on the image. The threshold method went through the image pixel by pixel and if the color value of the pixel was less than 30, the pixel color would be changed to black. Otherwise, the pixel value would be turned to white. After the original image was converted to a binary image, the resulting image looked like this: - -![](https://opensource.com/sites/default/files/resize/image_processing_nasa_3-520x293.jpg) ->The binary image. - -Then I got the contours from the binary image, which resulted in a much cleaner contour, without the shadow contour. - -![](https://opensource.com/sites/default/files/image_processing_nasa_4.jpg) ->The final clean contour. - -At this point, I was able to get clean contours and detect the center of mass. Unfortunately, I didn't have enough time to be able to complete transformations about the center of mass. Since I only had a few days left in my internship, I started to think about other things I could do within a limited time span. One of those things was the bounding rectangle. The bounding rectangle is a quadrilateral with the smallest area that contains the entire contour of an image. The bounding rectangle is important because it is key in scaling the contour on the page. Unfortunately I didn't have time to do much with the bounding rectangle, but I still wanted to learn about it because it's a useful tool. - -Finally, after all of that, I was able to finish processing the image! - -![](https://opensource.com/sites/default/files/resize/image_processing_nasa_5-521x293.jpg) ->The final image with bounding rectangle and center of mass in red. - -Once the image processing code was complete, I replaced the old image processing code in the simulation with my code. To my surprise, it worked! - -Well, mostly. - -The program had a memory leak in it, which leaked 100MB every 1/10 of a second. I was glad that it wasn’t because of my code. The bad thing was that fixing it was out of my control. The good thing was that there was a workaround that I could use. It was less than ideal, but it checked the amount of memory the simulation was using and when it used more than 1 GiB, the simulation restarted. - -At the NASA lab, we use a lot of open source software, and my work there isn't possible without it. - --------------------------------------------------------------------------------- - -via: https://opensource.com/life/16/3/image-processing-nasa - -作者:[Lauren Egts][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/laurenegts -[1]: https://ocio.grc.nasa.gov/gvis/ -[2]: http://www.nasa.gov/centers/glenn/home/index.html -[3]: http://physics.weber.edu/schroeder/fluids/ -[4]: http://nodejs.org/ -[5]: http://opencv.org/ -[6]: https://github.com/peterbraden/node-opencv -[7]: https://github.com/peterbraden/node-opencv - - - - - From 5265e6fca4f562a9fdd2740d0bebf672df8d8a6c Mon Sep 17 00:00:00 2001 From: vim-kakali <1799225723@qq.com> Date: Wed, 20 Apr 2016 00:53:04 +0800 Subject: [PATCH 0638/1469] vim-kakali translating --- sources/talk/20151227 Upheaval in the Debian Live project.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/talk/20151227 Upheaval in the Debian Live project.md b/sources/talk/20151227 Upheaval in the Debian Live project.md index d663d09b17..3fa8179aa3 100644 --- a/sources/talk/20151227 Upheaval in the Debian Live project.md +++ b/sources/talk/20151227 Upheaval in the Debian Live project.md @@ -1,3 +1,5 @@ +vim-kakali is translating. + While the event had a certain amount of drama surrounding it, the [announcement][1] of the end for the [Debian Live project][2] seems likely to have less of an impact than it first appeared. The loss of the lead developer will certainly be felt—and the treatment he and the project received seems rather baffling—but the project looks like it will continue in some form. So Debian will still have tools to create live CDs and other media going forward, but what appears to be a long-simmering dispute between project founder and leader Daniel Baumann and the Debian CD and installer teams has been "resolved", albeit in an unfortunate fashion. The November 9 announcement from Baumann was titled "An abrupt End to Debian Live". In that message, he pointed to a number of different events over the nearly ten years since the [project was founded][3] that indicated to him that his efforts on Debian Live were not being valued, at least by some. The final straw, it seems, was an "intent to package" (ITP) bug [filed][4] by Iain R. Learmonth that impinged on the namespace used by Debian Live. From 0ff459f46f10652a78884c74b4a44ee9ed516d5a Mon Sep 17 00:00:00 2001 From: pengkai Date: Wed, 20 Apr 2016 22:30:55 +0800 Subject: [PATCH 0639/1469] translated --- ...d open source experience to your resume.md | 92 ------------------- ...d open source experience to your resume.md | 56 +++++++++++ 2 files changed, 56 insertions(+), 92 deletions(-) delete mode 100644 sources/tech/20160225 How to add open source experience to your resume.md create mode 100644 translated/tech/20160225 How to add open source experience to your resume.md diff --git a/sources/tech/20160225 How to add open source experience to your resume.md b/sources/tech/20160225 How to add open source experience to your resume.md deleted file mode 100644 index 8a3a3e09cf..0000000000 --- a/sources/tech/20160225 How to add open source experience to your resume.md +++ /dev/null @@ -1,92 +0,0 @@ -kylepeng93 is translating!!! -How to add open source experience to your resume -================================================== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/lightning-test.png?itok=aMceg0Vg) - - -In this article, I'll share my technique for leveraging open source contributions to stand out as a great candidate for a job in the technology field. - -No goal can be accomplished without first being set. Before jumping into a new commitment or spending the evening overhauling your resume, it pays to clearly define the traits of the job you're seeking. Your resume is a piece of persuasive writing, so you have to know your audience for it to reach its full potential. Your resume's audience is anyone with the need for your skills and the budget to hire you. When editing, read your resume while imagining what it's like to be in their position. Do you look like a candidate that you would hire? - -I personally find it helpful to make a list of the key traits that the ideal candidate for my target job displays. I gather this list from a combination of personal experience, reading job postings, and asking colleagues in similar roles. LinkedIn and conferences are great places to find people happy to offer this sort of advice. Many people enjoy talking about themselves, and inviting them to tell part of their own story to help you expand your knowledge makes everyone feel good. As you talk to others about their career paths, you'll gain insights not only into how to land the jobs you want, but also into which traits or behaviors correspond to ending up in situations you'd rather avoid. - -For example, the list of key traits for a junior role might look like this: - -### Technical: - -- Experience with CI, Jenkins preferred - -- Strong scripting background in Python and Ruby - -- Familiarity with Eclipse IDE - -- Basic Git and Bash - -### Personal: - -- Self-directed learner - -- Clear communication and documentation skills - -- Experience working on a multi-person development team ("team player") - -- Familiarity with issue tracker workflow - -### Apply anyway - -Remember, you don't have to meet every single criterion listed in a job description to get an interview. - -The job description describes whoever left the role, and if you start out knowing everything you've likely signed yourself up for a few years that don't challenge or expand your skill set. If you're nervous about missing a particular technology on the list, do some research into it to see whether comparable skills from another experience would apply. For example, someone who's never used [Jenkins][1] might still understand the principles of continuous integration testing from working on a project that uses [Buildbot][2] or [Travis CI][3]. - -If you're applying at a larger company, they probably have an entire department and comprehensive screening process to make sure they don't hire any candidate unable to succeed in a role. That means it's your job to apply and their job to decide whether to reject you. Don't prematurely reject yourself from the job by refusing to apply. - -Now you have an idea of what job you want and what skills you'll need to impress your interviewers. The next steps to take will vary based on how much experience you've already got. - -### Tailoring existing involvement - -Start by making a list of all the projects you've been involved with in the past few years. One way to get a quick list of things you've worked on lately is to navigate to the **Repositories** tab of your GitHub profile and filter the list by clicking on **Forks**. Additionally, look down your [Organizations][4] list for places you might have been engaging in leadership roles. If you already have a resume, make sure you've included everything from these lists under experience. - -Consider any IRC channel where you have special permissions as a potential leadership experience. Check your Meetup and Eventbrite accounts and add any events that you organize or volunteer at to your list. Skim your calendar for the past year and note any volunteering, mentoring, or public speaking engagements. - -Now for the hard part: Map the list of required skills onto the list of experiences. I like to assign a letter or number to each trait needed for the job, then mark the same symbol next to every piece of experience or involvement where you demonstrated the trait. When in doubt, claim it anyway—your problem is more likely a reluctance to brag than actual incompetence. - -This is the point in the process at which resume writers are often fettered by reluctance to risk overselling their own skills. It often helps to re-frame the question as: "Did someone who organized a meetup show leadership and planning skills?" Rather than: "Did I personally show these skills when I organized that meetup?". - -If you've been sufficiently thorough at figuring out where your free time has gone for the past year or two and you code a lot, you might now be facing a surprising problem: Too many items to fit on a single-page resume! If anything on your list of experiences didn't demonstrate any of the skills you're trying to showcase, cross it off. If an item demonstrates few skills and you don't have any stories that you enjoy telling about it, cross it off. If this abridged list of things you've done still won't fit in the format of a resume, prioritize the experiences from which you gained a relevant story or extensive experience with a desired technology. - -At this point, it should be obvious if you need a better piece of experience to hone a particular skill. Consider using an issue aggregator like OpenHatch to find an open source project where you build and practice your skills with the tool or technology that you're missing. - -### Make your resume beautiful - -A resume's beauty comes from conciseness, clarity, and layout. Each piece of experience should be accompanied by enough information for a reader to immediately know why you included it, but no more. Each type of information should be formatted consistently throughout the document—it's distracting to have some dates italicized or right-aligned and others not. - -Typeset your resume using a tool that makes these goals easy to achieve. I enjoy using [LaTeX][5], since its macro system makes visual consistency easy and most interviewers recognize it immediately. Your tool of choice might be [LibreOffice][6] or HTML, depending on your skills and how you want to distribute your resume. - -Remember that a digitally submitted resume might be scanned for keywords, so it can help to use the same acronyms as the job posting when describing your experiences. To make your resume easy for your interviewer to use, place the most important information first. - -Coders often struggle to quantify balance and layout when typesetting a document. My favorite technique for stepping back and assessing whether my document's whitespace is in the right place is to fullscreen the PDF or print it out, then look at it in a mirror. If you're using LibreOffice Writer, save a copy of your resume then change the font to that of a language you can't read. Both of these techniques forcibly pull you out of reading the content, and allow you to see the overall layout of the document in a new light. They take you from a "That sentence is poorly worded!" critique to noticing things like "It looks funny to have only a single word on that line." - -Finally, double check that your resume displays correctly in the media where it will be seen. If you're distributing it as a web page, test it at different screen widths in multiple browsers. If it's a PDF, open it on your phone or a friend's computer to make sure all the fonts it needs are available. - -### Next steps - -Finally, don't let the content that you worked so hard on for your resume go to waste! Mirror it to your LinkedIn account—complete with the buzzwords from the job posting—and don't be surprised if recruiters start reaching out to you. Even if the jobs they're describing aren't a good fit right now, you can leverage their time and interest to get feedback on what's working well about your resume and what isn't. - --------------------------------------------------------------------------------- - -via: https://opensource.com/business/16/2/add-open-source-to-your-resume - -作者:[edunham][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/edunham -[1]: https://jenkins-ci.org/ -[2]: http://buildbot.net/ -[3]: https://travis-ci.org/ -[4]: https://github.com/settings/organizations -[5]: https://www.latex-project.org/ -[6]: https://www.libreoffice.org/download/libreoffice-fresh/ diff --git a/translated/tech/20160225 How to add open source experience to your resume.md b/translated/tech/20160225 How to add open source experience to your resume.md new file mode 100644 index 0000000000..234038f878 --- /dev/null +++ b/translated/tech/20160225 How to add open source experience to your resume.md @@ -0,0 +1,56 @@ +怎样将开源经历添加到你的简历中去 +================================================== +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/lightning-test.png?itok=aMceg0Vg) +在这篇文章中,我将会分享我的一些方法,目的是让你因为曾经为开源事业作出贡献的经历使得你在技术领域的求职中脱颖而出。 +凡事预则立,不预则废。在你即将进入一个新的领域或者正准备花费整个晚上来彻底完善你的简历之前,先来定义你正在寻找的工作的特征是值得的。你的简历是一张有说服力的作品,因此你必须了解你的观众,从而让它发挥出所有的潜力。看你简历的可能是任何需要你的技能并且恰好能在预算之内聘用你的人。当编辑简历的时候,读一读你的简历上的内容,同时想象一下它们最应该被书写的位置。你看起来像是一个你将会聘用的候选人吗? + +在我看来,我发现对于我所要求的目标职位的所有理想候选人,针对他们每个人的特点列出一张清单有时候是很有帮助的。我将他们每个人的特点清单合并到他们的个人经历中,并阅读工作记录,然后以同样的角色询问同事们。人际关系网和会议是很好的地方去寻求一些乐意提供这种建议的人。一些人喜欢谈论他们自己,并且邀请他们去讲述他们自己的故事的一部分来帮助你去拓展你的知识面,通过这样方式可以使每个人感觉更好。当你和其他人谈论他们的职业路线时,你不仅将会明白怎样去得到你想要从事的工作,而且还能知道你应该避免哪些容易让你失去工作机会的情况和行为。 +例如,对于一个差劲的角色,有关于他的关键特性列表可能看起来像下面这样: +###技术: +- 拥有计算机从业方面的经验,更加容易受到Jenkins的青睐。 +- 深厚的脚本编写背景,如Python和Ruby +- 精通eclipse的使用 +- 基本的git和bash知识 +###个人而言: +- 自我学习者 +- 良好的交流和文档技巧 +- 在团队开发方面富有经验 +- 精通事件捕捉工作流 +###以任意方式应用 +记住,你没有必要为了得到一份工作而去满足上面的工作描述列表中列出的每个标准。工作细节描述了任何人都可以离开这个角色,如果你已经知道你即将签约并为之工作几年的公司的全部信息,并且这份工作并不会让你觉得有什么挑战性,或者要求你去拓展你你的技能。如果你对你无法满足清单上的技能列表而感到紧张,那么检查一下自己是否有来自其他经历并能与之媲美的技能。 +例如,即使有些人从来没有使用过Jenkins,那他也可能从之前使用过Buildbot或者travis CI的项目经验中明白持续集成测试的原则。 +如果你正在申请一家大型公司,而他们可能拥有一个专门的部门和一套完整的筛选过程来确保他们不会聘用任何不能胜任职位的候选人。也就是说,在你求职的过程中,你所能做的只是提交申请,而决定是否拒绝你是公司管理层的工作。不要过早的将工作拒之门外。 +现在你已经知道了你的任务是什么,并且还知道你将需要哪些技能去完成这次面试。下一步要做的取决与你已经获取到的经验。 +### 制造已经存在的事物之间的关联 +列出一张你过去几年曾经参与过的所有项目。下面是一条快速得到这张清单的方式,生成一个跳转到你的github上的库的导航器,但是需要过滤掉你从其他地方复制过来的项目。除此之外,检查下你的清单上是否有曾经处于领导地位的项目。如果你已经有了一份简历,那么请确保你已经将你所有的经历都列在了上面。 +考虑下任何一个你曾经作为一个潜在的领导经历并拥有过特权的IRC项目。检查你的会唔和聚会并将你曾经组织过或者作为志愿者参与过的事情添加到你的清单上面。略过你前几年的日程并且标注所有志愿行动或者有作为导师的经历又或者有接触过的公共演讲. +现在进入了比较艰难的环节了,将清单上列出的必备技能与个人经历列表上的内容一一对照,我喜欢给工作需要的每个特性用一个字母或者数字作为标记,然后在每一段你经历或参与过并表现出了某一特性的地方标记相同的符号。当你产生怀疑的时候,无论如何也要加上它,尽管这样做更像是在吹嘘,但也好过显示出你的无能。 +在我们写简历的时候常常被这样的情况所困扰,就是我们不愿冒着过分吹嘘自己的技能的风险。这通常会帮助我们重新考虑这个问题,比如我们会考虑那些组织了会晤的人会表现出更好的领导才能和计划技巧吗?而不是当我组织这个会晤的时候我是否展示出了这些技巧。 +如果你已经充分了解了你在过去的几年里的业余时间都是怎么度过的或者你写了很多代码,那么你可能现在正面临着一个令人奇怪的问题,你已经拥有了太多的经验以至于一张纸的简历已经无法容纳下这些经验了。那么,如果那些列在你的清单上的经验无法证明你尝试去表现的任何技能的话,那么请扔掉它们吧。如果这份已经被缩短的简历清单上的内容仍然超过一张单页纸的容量的话,那么将你的经验按照一定的优先级排序,例如根据你获得了相关的故事或丰富的经验与所需的技术。 +在这一方面,显而易见,如果你想要磨练一个独特的技能,那么你就需要一个不错的经历。考虑使用一个类似OpenHatch的问题聚合器,并用它来寻找一个通过使用你从没使用过的工具和技术来锻炼你的技能的开源项目。 +让你的简历更加漂亮 +一份简历是否美观取决于它的简洁度,清晰度和布局。每一段经历都应该通过足够的信息来展示给读者并让他们立刻就能明白为什么你要将它包含进去,而且恰到好处。每种类型的信息都应该使用一致的文档格式来表示,一份含有斜体格式或者右对齐格式的或者其他与整体风格不协调的数据绝对会让看的人十分反感。 +使用工具来给你的简历排版会使之前设定的目标更加容易实现。我喜欢使用LaTeX,因为它 +的宏系统能够使可视化一致性变得更加容易,并且大量的面试官都能一眼就认出他。你的工具的选择可能是LibreOffice或者HTML,这取决于你的技能和你希望怎样去发布你的简历。 +记住一点,一份以数字方式提交的简历可以通过关键字被浏览到。因此,当你需要描述你的工作经历的时候使用和工作招聘告示一样的英文缩写对你的求职会有很大的帮助。为了让你的简历更加容易被面试官所使用,首先就要放上最重要的信息。 +程序员通常难以在为文档排版时量化平衡和布局。我最喜欢的技术是回退并评估我的文档的空格是否处于正确的位置,而这样做的目的就是我的PDF可以全屏显示或者打印出来,然后 +在镜像里面查看它。如果你正在使用LibreOffice Writer,保存一份你的简历的副本,然后将你的简历中的字体换成一种你无法阅读的语言。这两种技术都强制将你从阅读的内容中脱离出来,让你以一种新的方式查看文档的整体布局。他们把你从一个”那句话措辞不当!”对注意到的事物的批评,比如“在这条线上只有一个字,看起来很有趣”。 +最后,再次检查你的简历是否在它将要的展示的多媒体上看起来完全正确。如果你以网页的形式发布它,那么在不同屏幕大小的浏览器中测试它的效果。如果它是一份PDF文档,那么在你的手机或者你的朋友的电脑上面打开它,并确保它所需要的字体都是可用的。 +接下来的步骤 +最后,不要让你辛苦做出来的简历被浪费了,利用你的LinkedIn帐号把它做成一个镜像。当招聘人员找到你的时候也不要感到奇怪。尽管他们描述的工作内容并不是恰好适合你,但是你可以利用他们的时间和兴趣来得到关于你的简历中有哪些地方好与不好的反馈信息。 +-------------------------------------------------------------------------------- +via: https://opensource.com/business/16/2/add-open-source-to-your-resume + +作者:[edunham][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/edunham +[1]: https://jenkins-ci.org/ +[2]: http://buildbot.net/ +[3]: https://travis-ci.org/ +[4]: https://github.com/settings/organizations +[5]: https://www.latex-project.org/ +[6]: https://www.libreoffice.org/download/libreoffice-fresh/ From d756dfb5f16c36a9b09c894647e5efae50ebd1f8 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 21 Apr 2016 06:27:08 +0800 Subject: [PATCH 0640/1469] PUB:20160212 How to Add New Disk in Linux CentOS 7 Without Rebooting @runningwater --- ...isk in Linux CentOS 7 Without Rebooting.md | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) rename {translated/tech => published}/20160212 How to Add New Disk in Linux CentOS 7 Without Rebooting.md (77%) diff --git a/translated/tech/20160212 How to Add New Disk in Linux CentOS 7 Without Rebooting.md b/published/20160212 How to Add New Disk in Linux CentOS 7 Without Rebooting.md similarity index 77% rename from translated/tech/20160212 How to Add New Disk in Linux CentOS 7 Without Rebooting.md rename to published/20160212 How to Add New Disk in Linux CentOS 7 Without Rebooting.md index adfb7f556f..cc4d031bc1 100644 --- a/translated/tech/20160212 How to Add New Disk in Linux CentOS 7 Without Rebooting.md +++ b/published/20160212 How to Add New Disk in Linux CentOS 7 Without Rebooting.md @@ -1,11 +1,11 @@ -如何在CentOS 7 中添加新磁盘而不用重启系统 +如何在 CentOS 7 中添加新磁盘而不用重启系统 ================================================================================ -对大多数系统管理员来说扩充 Linux 服务器的磁盘空间是日常的工作之一。因此这篇文章会在通过使用 Linux 命令,在 CentOS 7 系统上演示一些简单的操作步骤来扩充您的磁盘空间而不需要重启您的生产服务器。关于扩充和增加新的磁盘到 Linux 系统,我们会提及多种方法和多种可行性,所以可按您所需选择最适用的一种。 +对大多数系统管理员来说扩充 Linux 服务器的磁盘空间是日常的工作之一。因此这篇文章会通过使用 Linux 命令,在 CentOS 7 系统上演示一些简单的操作步骤来扩充您的磁盘空间而不需要重启您的生产服务器。关于扩充和增加新的磁盘到 Linux 系统,我们会提及多种方法和多种可行性,可按您所需选择最适用的一种。 -### 1. 为虚拟机客户端扩充磁盘空间: ### +### 1. 在虚拟机客户端扩充磁盘空间: ### -在为 Linux 系统增加磁盘卷之前,您需要添加一块新的物理磁盘或是从正使用的 VMware vShere、工作站或着其它的基础虚拟环境软件中进行设置,从而扩充一块系统正使用的虚拟磁盘空间。 +在为 Linux 系统增加磁盘卷之前,您首先需要添加一块新的物理磁盘,或在 VMware vShere、VMware 工作站以及你使用的其它虚拟环境软件中进行设置来增加一块虚拟磁盘的容量。 ![Increase disk](http://blog.linoxide.com/wp-content/uploads/2016/02/1.png) @@ -22,7 +22,7 @@ ### 3. 扩展空间而无需重启虚拟机 ### -现在运行如下命令就可以来扩展操作系统的物理卷磁盘空间,而且不需要重启虚拟机,系统会重新扫描 SCSI (注:Small Computer System Interface 小型计算机系统接口)总线并添加 SCSI 设备。 +现在运行如下命令,通过重新扫描 SCSI (注:Small Computer System Interface 小型计算机系统接口)总线并添加 SCSI 设备,系统就可以扩展操作系统的物理卷磁盘空间,而且不需要重启虚拟机。 # ls /sys/class/scsi_host/ # echo "- - -" > /sys/class/scsi_host/host0/scan @@ -35,7 +35,7 @@ # echo 1 > /sys/class/scsi_device/0\:0\:0\:0/device/rescan # echo 1 > /sys/class/scsi_device/2\:0\:0\:0/device/rescan -如下图所示,会重新扫描 SCSI 总线,随后我们从虚拟机客户端设置的磁盘大小会正常显示。 +如下图所示,会重新扫描 SCSI 总线,随后我们在虚拟机客户端设置的磁盘大小会正常显示。 ![Rescan disk device](http://blog.linoxide.com/wp-content/uploads/2016/02/3.png) @@ -85,7 +85,7 @@ ### 5. 创建物理卷: ### -根据提示运行 'partprob' 或 'kpartx' 命令以使分区表被真正使用,然后使用如下的命令来创建新的物理卷。 +根据上述提示,运行 'partprob' 或 'kpartx' 命令以使分区表生效,然后使用如下的命令来创建新的物理卷。 # partprobe # pvresize /dev/sda3 @@ -107,7 +107,7 @@ # xfs_growfs /dev/mapper/centos-root -'/' 分区的大小已经成功的增加了,可以使用 'df' 命令来检查您磁盘驱动的大小。如图示。 +'/' 分区的大小已经成功的增加了,可以使用 'df' 命令来检查您磁盘驱动器的大小。如图示。 ![Increase disk space](http://blog.linoxide.com/wp-content/uploads/2016/02/3C.png) @@ -129,7 +129,7 @@ # echo "- - -" > /sys/class/scsi_host/host1/scan # echo "- - -" > /sys/class/scsi_host/host2/scan -列出您的 SCSI 设备的名称 +列出您的 SCSI 设备的名称: # ls /sys/class/scsi_device/ # echo 1 > /sys/class/scsi_device/1\:0\:0\:0/device/rescan @@ -139,7 +139,7 @@ ![Scanning new disk](http://blog.linoxide.com/wp-content/uploads/2016/02/3F.png) -一旦新增的磁盘可见就可以运行下面的命令来创建新的物理卷,然后增加到卷组,如下示。 +一旦新增的磁盘可见,就可以运行下面的命令来创建新的物理卷,然后增加到卷组,如下示。 # pvcreate /dev/sdb # vgextend centos /dev/sdb @@ -157,16 +157,15 @@ ### 结论: ### -在 Linux CentOS 7 系统上,使用这篇文章所述的操作步骤来扩充您的任意逻辑卷的磁盘空间,此管理磁盘分区的操作过程是非常简单的。您不需要重启生产线上的服务器,只是简单的重扫描下 SCSI 设备,和扩展您想要的 LVM(逻辑卷管理)。我们希望这文章对您有用。可自由的发表有用的评论和建议。 +在 Linux CentOS 7 系统上管理磁盘分区的操作过程是非常简单的,可以使用这篇文章所述的操作步骤来扩充您的任意逻辑卷的磁盘空间。您不需要重启生产线上的服务器,只是简单的重扫描下 SCSI 设备,和扩展您想要的 LVM(逻辑卷管理)。我们希望这文章对您有用。请随意的发表有用的评论和建议。 -------------------------------------------------------------------------------- via: http://linoxide.com/linux-how-to/add-new-disk-centos-7-without-rebooting/ 作者:[Kashif S][a] -译者:[runningwater](https://github.com/runningwater -) -校对:[校对者ID](https://github.com/校对者ID) +译者:[runningwater](https://github.com/runningwater) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From afd71510e1f3bca5b8a45cf48d2ec2083d44b268 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 25 Apr 2016 19:21:39 +0800 Subject: [PATCH 0641/1469] PUB:20160226 How to use Python to hack your Eclipse IDE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Vic020 翻译的有点随意。 --- ... to use Python to hack your Eclipse IDE.md | 209 +++++++++++++++++ ... to use Python to hack your Eclipse IDE.md | 215 ------------------ 2 files changed, 209 insertions(+), 215 deletions(-) create mode 100644 published/20160226 How to use Python to hack your Eclipse IDE.md delete mode 100644 translated/tech/20160226 How to use Python to hack your Eclipse IDE.md diff --git a/published/20160226 How to use Python to hack your Eclipse IDE.md b/published/20160226 How to use Python to hack your Eclipse IDE.md new file mode 100644 index 0000000000..ab2e21d5fa --- /dev/null +++ b/published/20160226 How to use Python to hack your Eclipse IDE.md @@ -0,0 +1,209 @@ +用 Python 打造你的 Eclipse +============================================== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/lightbulb_computer_person_general_.png?itok=ZY3UuQQa) + +Eclipse 高级脚本环境([EASE][1])项目虽然还在开发中,但是必须要承认它非常强大,它让我们可以快速打造自己的Eclipse 开发环境。 + +依据 Eclipse 强大的框架,可以通过其内建的插件系统全方面的扩展 Eclipse。然而,编写和部署一个新的插件还是十分麻烦,即使你只是需要一个额外的小功能。不过,现在依托于 EASE,你可以不用写任何一行 Java 代码就可以方便的做到这点。EASE 是一种使用 Python 或者 Javascript 这样的脚本语言自动实现这些功能的平台。 + +本文中,根据我在今年北美的 EclipseCon 大会上的[演讲][2],我将介绍如何用 Python 和 EASE 设置你的 Eclipse 环境,并告诉如何发挥 Python 的能量让你的 IDE 跑的飞起。 + +### 安装并运行 "Hello World" + +本文中的例子使用 Python 的 Java 实现 Jython。你可以将 EASE 直接安装到你已有的 Eclipse IDE 中。本例中使用[Eclipse Mars][3],并安装 EASE 环境本身以及它的模块和 Jython 引擎。 + +使用 Eclipse 安装对话框(`Help>Install New Software`...),安装 EASE[http://download.eclipse.org/ease/update/nightly][4], + +选择下列组件: + +- EASE Core feature +- EASE core UI feature +- EASE Python Developer Resources +- EASE modules (Incubation) + +这会安装 EASE 及其模块。这里我们要注意一下 Resource 模块,此模块可以访问 Eclipse 工作空间、项目和文件 API。 + +![](https://opensource.com/sites/default/files/1_installease_nightly.png) + +成功安装后,接下来安装 EASE Jython 引擎 [https://dl.bintray.com/pontesegger/ease-jython/][5] 。完成后,测试下。新建一个项目并新建一个 hello.py 文件,输入: + +``` +print "hello world" +``` + +选中这个文件,右击并选择“Run as -> EASE script”。这样就可以在控制台看到“Hello world”的输出。 + +现在就可以编写 Python 脚本来访问工作空间和项目了。这种方法可以用于各种定制,下面只是一些思路。 + +### 提升你的代码质量 + +管理良好的代码质量本身是一件非常烦恼的事情,尤其是当需要处理一个大型代码库或者要许多工程师参与的时候。而这些痛苦可以通过脚本来减轻,比如批量格式化一些文件,或者[去掉文件中的 unix 式的行结束符][6]来使得在 git 之类的源代码控制系统中比较差异更加容易。另外一个更好的用途是使用脚本来生成 Eclipse markers 以高亮你可以改善的代码。这里有一些示例脚本,你可以用来在 java 文件中所有找到的“printStackTrace”方法中加入task markers 。请看[源码][7]。 + +拷贝该文件到工作空间来运行,右击并选择“Run as -> EASE script”。 + +``` +loadModule('/System/Resources') + +from org.eclipse.core.resources import IMarker + +for ifile in findFiles("*.java"): + file_name = str(ifile.getLocation()) + print "Processing " + file_name + with open(file_name) as f: + for line_no, line in enumerate(f, start=1): + if "printStackTrace" in line: + marker = ifile.createMarker(IMarker.TASK) + marker.setAttribute(IMarker.TRANSIENT, True) + marker.setAttribute(IMarker.LINE_NUMBER, line_no) + marker.setAttribute(IMarker.MESSAGE, "Fix in Sprint 2: " + line.strip()) + +``` + +如果你的 java 文件中包含了 printStackTraces,你就可以看见任务视图和编辑器侧边栏上自动新加的标记。 + +![](https://opensource.com/sites/default/files/2_codequality.png) + +### 自动构建繁琐任务 + +当同时工作在多个项目的时候,肯定需要完成许多繁杂、重复的任务。可能你需要在所有源文件头上加入版权信息,或者采用新框架时候自动更新文件。例如,当首次切换到 Tycho 和 Maven 的时候,我们需要 giel每个项目添加 pom.xml 文件。使用几行 Python 代码可以很轻松的完成这个任务。然后当 Tycho 支持无 pom 构建后,我们需要移除不要的 pom 文件。同样,几行代码就可以搞定这个任务,例如,这里有个脚本可以在每一个打开的工作空间项目上加入 README.md。请看源代码 [add_readme.py][8]。 + +拷贝该文件到工作空间来运行,右击并选择“Run as -> EASE script”。 + +``` +loadModule('/System/Resources') + +for iproject in getWorkspace().getProjects(): + if not iproject.isOpen(): + continue + + ifile = iproject.getFile("README.md") + + if not ifile.exists(): + contents = "# " + iproject.getName() + "\n\n" + if iproject.hasNature("org.eclipse.jdt.core.javanature"): + contents += "A Java Project\n" + elif iproject.hasNature("org.python.pydev.pythonNature"): + contents += "A Python Project\n" + writeFile(ifile, contents) +``` + +脚本运行的结果会在每个打开的项目中加入 README.md,java 和 Python 的项目还会自动加上一行描述。 + +![](https://opensource.com/sites/default/files/3_tedioustask.png) + +### 构建新功能 + +你可以使用 Python 脚本来快速构建一些急需的功能,或者做个原型给团队和用户演示你想要的功能。例如,一个 Eclipse 目前不支持的功能是自动保存你正在工作的文件。即使这个功能将会很快提供,但是你现在就可以马上拥有一个能每隔 30 秒或处于后台时自动保存的编辑器。以下是主要方法的片段。请看下列代码:[autosave.py][9]。 + +``` +def save_dirty_editors(): + workbench = getService(org.eclipse.ui.IWorkbench) + for window in workbench.getWorkbenchWindows(): + for page in window.getPages(): + for editor_ref in page.getEditorReferences(): + part = editor_ref.getPart(False) + if part and part.isDirty(): + print "Auto-Saving", part.getTitle() + part.doSave(None) +``` + +在运行脚本之前,你需要勾选 'Allow Scripts to run code in UI thread' 设定,这个设定在 Window > Preferences > Scripting 中。然后添加该脚本到工作空间,右击并选择“Run as > EASE Script”。每次编辑器自动保存时,控制台就会输出一个保存的信息。要关掉自动保存脚本,只需要点击控制台的红色方块的停止按钮即可。 + +![](https://opensource.com/sites/default/files/4_prototype.png) + +### 快速扩展用户界面 + +EASE 最棒的事情是可以将你的脚本与 IDE 界面上元素(比如一个新的按钮或菜单)结合起来。不需要编写 java 代码或者安装新的插件,只需要在你的脚本前面增加几行代码。 + +下面是一个简单的脚本示例,用来创建三个新项目。 + +``` +# name : Create fruit projects +# toolbar : Project Explorer +# description : Create fruit projects + +loadModule("/System/Resources") + +for name in ["banana", "pineapple", "mango"]: + createProject(name) +``` + +上述注释会专门告诉 EASE 增加了一个按钮到 Project Explorer 工具条。下面这个脚本是用来增加一个删除这三个项目的按钮的。请看源码 [createProjects.py][10] 和 [deleteProjects.py][11]。 + +``` +# name :Delete fruit projects +# toolbar : Project Explorer +# description : Get rid of the fruit projects + +loadModule("/System/Resources") + +for name in ["banana", "pineapple", "mango"]: + project = getProject(name) + project.delete(0, None) +``` + +为了使按钮显示出来,增加这两个脚本到一个新的项目,假如叫做 'ScriptsProject'。然后到 Windows > Preference > Scripting > Script Location,点击 'Add Workspace' 按钮并选择 ScriptProject 项目。这个项目现在会成为放置脚本的默认位置。你可以发现 Project Explorer 上出现了这两个按钮,这样你就可以通过这两个新加的按钮快速增加和删除项目。 + +![](https://opensource.com/sites/default/files/5_buttons.png) + +### 整合第三方工具 + +不管怎么说,你可能需要除了 Eclipse 生态系统以外的工具(这是真的,虽然 Eclipse 已经很丰富了,但是不是什么都有)。这些时候你会发现将他们包装在一个脚本来调用会非常方便。这里有一个简单的例子让你整合资源管理器,并将它加入到右键菜单栏,这样点击图标就可以打开资源管理器浏览当前文件。请看源码 [explorer.py][12]。 + +``` +# name : Explore from here +# popup : enableFor(org.eclipse.core.resources.IResource) +# description : Start a file browser using current selection +loadModule("/System/Platform") +loadModule('/System/UI') + +selection = getSelection() +if isinstance(selection, org.eclipse.jface.viewers.IStructuredSelection): + selection = selection.getFirstElement() + +if not isinstance(selection, org.eclipse.core.resources.IResource): + selection = adapt(selection, org.eclipse.core.resources.IResource) + +if isinstance(selection, org.eclipse.core.resources.IFile): + selection = selection.getParent() + +if isinstance(selection, org.eclipse.core.resources.IContainer): + runProcess("explorer.exe", [selection.getLocation().toFile().toString()]) +``` + +为了让这个菜单显示出来,像之前一样将该文件加入一个新项目,比如说 'ScriptProject'。然后到 Windows > Preference > Scripting > Script Locations,点击“Add Workspace”并选择 'ScriptProject' 项目。当你在文件上右击鼠标键,你会看到弹出菜单出现了新的菜单项。点击它就会出现资源管理器。(注意,这个功能已经出现在 Eclipse 中了,但是你可以在这个例子中换成其它第三方工具。) + +![](https://opensource.com/sites/default/files/6_explorer.png) + +Eclipse 高级基本环境 (EASE)提供一套很棒的扩展功能,使得 Eclipse IDE 能使用 Python 来轻松扩展。虽然这个项目还在早期,但是[关于这个项目][13]更多更棒的功能也正在加紧开发中,如果你想为它做出贡献,请到[论坛][14]讨论。 + +我会在 2016 年的 [Eclipsecon North America][15] 会议上发布更多 EASE 细节。我的演讲 [Scripting Eclipse with Python][16] 也会不单会介绍 Jython,也包括 C-Python 和这个功能在科学领域是如何扩展的。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/16/2/how-use-python-hack-your-ide + +作者:[Tracy Miranda][a] +译者:[VicYu/Vic020](http://vicyu.net) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/tracymiranda +[1]: https://eclipse.org/ease/ +[2]: https://www.eclipsecon.org/na2016/session/scripting-eclipse-python +[3]: https://www.eclipse.org/downloads/packages/eclipse-ide-eclipse-committers-451/mars1 +[4]: http://download.eclipse.org/ease/update/nightly +[5]: https://dl.bintray.com/pontesegger/ease-jython/ +[6]: http://code.activestate.com/recipes/66434-change-line-endings/ +[7]: https://gist.github.com/tracymiranda/6556482e278c9afc421d +[8]: https://gist.github.com/tracymiranda/f20f233b40f1f79b1df2 +[9]: https://gist.github.com/tracymiranda/e9588d0976c46a987463 +[10]: https://gist.github.com/tracymiranda/55995daaea9a4db584dc +[11]: https://gist.github.com/tracymiranda/baa218fc2c1a8e898194 +[12]: https://gist.github.com/tracymiranda/8aa3f0fc4bf44f4a5cd3 +[13]: https://eclipse.org/ease/ +[14]: https://dev.eclipse.org/mailman/listinfo/ease-dev +[15]: https://www.eclipsecon.org/na2016 +[16]: https://www.eclipsecon.org/na2016/session/scripting-eclipse-python diff --git a/translated/tech/20160226 How to use Python to hack your Eclipse IDE.md b/translated/tech/20160226 How to use Python to hack your Eclipse IDE.md deleted file mode 100644 index 1bf132fe15..0000000000 --- a/translated/tech/20160226 How to use Python to hack your Eclipse IDE.md +++ /dev/null @@ -1,215 +0,0 @@ -用Python打造你的Eclipse -============================================== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/lightbulb_computer_person_general_.png?itok=ZY3UuQQa) - -Eclipse高级脚本环境([EASE][1])项目虽然还在开发中,但是不是不得承认它非常强大,让我们可以快速打造自己的Eclipse开发环境. - -依据Eclipse强大的框架,可以通过其内建的插件系统全方面的扩展Eclipse.然而,编写和部署一个新的插件还是十分笨重,即使只是需要一个额外的小功能。但是,现在依托EASE,可以方便实用Python或者Javascript脚本语言来扩展。 - -本文中,根据我在今年北美的EclipseCon大会上的[演讲][2],我介绍包括安装Eclipse的Python和EASE环境,并包括使用强力Python来增压你的IDE。 - -### 安装并运行 "Hello World" - -本文中的例子使用Java实现的Python解释,Jython。Eclipse可以直接安装EASE环境。本例中使用Eclipse[Mars][3],它已经自带了EASE环境,包和Jython引擎。 - -使用Eclipse安装对话框(`Help>Install New Software`...),安装EASE[http://download.eclipse.org/ease/update/nightly][4] - -选择下列组件: - -- EASE Core feature - -- EASE core UI feature - -- EASE Python Developer Resources - -- EASE modules (Incubation) - -包括了EASE和模组。但是我们比较关心Resource包,此包可以访问Eclipse工作空间,项目和文件API。 - -![](https://opensource.com/sites/default/files/1_installease_nightly.png) - - -成功安装后,接下来安装Jython引擎[https://dl.bintray.com/pontesegger/ease-jython/][5].完成后,测试下。新建一个项目并新建一个hello.py文件,输入: - -``` -print "hello world" -``` - -选中这个文件,右击,选中'Run as -> EASE script'.这样就可以在控制台看到"Hello world"的输出. - -配置完成,现在就可以轻松使用Python来控制工作空间和项目了. - -### 提升你的代码质量 - -管理良好的代码质量本身是一件非常烦恼的事情,尤其是当需要处理一个大量代码库和要许多工程师参与的时候.而这些痛苦可以通过脚本来减轻,比如大量文字排版,或者[去掉文件中的unix行结束符][6]来使更容易比较.其他很棒的事情包括使用脚本让Eclipse markers高亮代码.这里有一些例子,你可以加入到task markers ,用"printStackTrace"方法在java文件中探测.请看[源码][7] - -运行,拷贝文件到工作空间,右击运行. - -``` -loadModule('/System/Resources') -``` - -from org.eclipse.core.resources import IMarker - -``` -for ifile in findFiles("*.java"): - file_name = str(ifile.getLocation()) - print "Processing " + file_name - with open(file_name) as f: - for line_no, line in enumerate(f, start=1): - if "printStackTrace" in line: - marker = ifile.createMarker(IMarker.TASK) - marker.setAttribute(IMarker.TRANSIENT, True) - marker.setAttribute(IMarker.LINE_NUMBER, line_no) - marker.setAttribute(IMarker.MESSAGE, "Fix in Sprint 2: " + line.strip()) - -``` - -如果你的任何java文件中包含了printStackTraces,你就可以看见编辑器的侧边栏上自动加上的标记. - -![](https://opensource.com/sites/default/files/2_codequality.png) - -### 自动构建繁琐任务 - -当同时工作在多个项目的时候,肯定需要需要完成许多繁杂,重复的任务.可能你需要在所有源文件头上加入CopyRight, 或者采用新框架时候自动更新文件.例如,当从Tycho迁移到Maven时候,我们给每一个项目必须添加pom.xml文件.使用Python可以很轻松的完成这个任务.只从Tycho提供无pom构建后,我们也需要移除不要的pom文件.同样,只需要几行代码就可以完成这个任务.例如,这里有个脚本可以在每一个打开的工作空间项目上加入README.md.请看源代码[add_readme.py][8]. - -拷贝文件到工作空间,右击并选择"Run as -> EASE script" - -loadModule('/System/Resources') - -``` -for iproject in getWorkspace().getProjects(): - if not iproject.isOpen(): - continue - - ifile = iproject.getFile("README.md") - - if not ifile.exists(): - contents = "# " + iproject.getName() + "\n\n" - if iproject.hasNature("org.eclipse.jdt.core.javanature"): - contents += "A Java Project\n" - elif iproject.hasNature("org.python.pydev.pythonNature"): - contents += "A Python Project\n" - writeFile(ifile, contents) -``` - -脚本结果会在打开的项目中加入README.md,java和Python项目还会自动加上一行描述. - -![](https://opensource.com/sites/default/files/3_tedioustask.png) - -### 构建新功能 - -Python脚本可以快速构建一些需要的附加功能,或者给团队和用户快速构建demo.例如,一个现在Eclipse目前不支持的功能,自动保存工作的文件.即使这个功能将会很快提供,但是你现在就可以马上拥有一个能30秒自动保存的编辑器.以下是主方法的片段.请看下列代码:[autosave.py][9] - -``` -def save_dirty_editors(): - workbench = getService(org.eclipse.ui.IWorkbench) - for window in workbench.getWorkbenchWindows(): - for page in window.getPages(): - for editor_ref in page.getEditorReferences(): - part = editor_ref.getPart(False) - if part and part.isDirty(): - print "Auto-Saving", part.getTitle() - part.doSave(None) -``` - -在运行脚本之前,你需要勾选'Allow Scripts to run code in UI thread'设定,这个设定在Window > Preferences > Scripting中.然后添加脚本到工作空间,右击和选择"Run as > EASE Script".每10秒自动保存的信息就会在控制台输出.关掉自动保存脚本,只需要在点击控制台的红色方框. - -![](https://opensource.com/sites/default/files/4_prototype.png) - -### 快速扩展用户界面 - -EASE最棒的事情是可以通过脚本与UI元素挂钩,可以调整你的IDE,例如,在菜单中新建一个按钮.不需要编写java代码或者新的插件,只需要增加几行代码. - -下面是一个简单的基脚本示例,用来产生三个新项目. - -``` -# name : Create fruit projects -# toolbar : Project Explorer -# description : Create fruit projects - -loadModule("/System/Resources") - -for name in ["banana", "pineapple", "mango"]: - createProject(name) -``` - -上述特别的EASE增加了一个按钮到项目浏览工具条.下面这个脚本是用来删除这三个项目.请看源码[createProjects.py][10]和[deleteProjects.py][11]. - -``` -# name :Delete fruit projects -# toolbar : Project Explorer -# description : Get rid of the fruit projects - -loadModule("/System/Resources") - -for name in ["banana", "pineapple", "mango"]: - project = getProject(name) - project.delete(0, None) -``` - -为了使脚本启动生效按钮,增加脚本到'ScriptsProject'文件夹.然后选择Windows > Preference > Scripting > Script 中定位到文件夹.点击'Add Workspace'按钮和选择ScriptProject项目.这个项目现在将会在启动时默认加载.你可以发现Project Explorer上出现了这两个按钮,这样你就可以通过这两个按钮快速增加删除项目. - -![](https://opensource.com/sites/default/files/5_buttons.png) - -### 整合三方工具 - -无论何时,你可能需要除了Eclipse生态系统以外的工具.这些时候你会发将他们包装在一个脚本来调用会非常方便.这里有一个简单的例子让你整合explorer.exe,并加入它到右键菜单栏,这样点击图标就可以打开浏览器浏览当前文件.请看源码[explorer.py][12] - -``` -# name : Explore from here -# popup : enableFor(org.eclipse.core.resources.IResource) -# description : Start a file browser using current selection -loadModule("/System/Platform") -loadModule('/System/UI') - -selection = getSelection() -if isinstance(selection, org.eclipse.jface.viewers.IStructuredSelection): - selection = selection.getFirstElement() - -if not isinstance(selection, org.eclipse.core.resources.IResource): - selection = adapt(selection, org.eclipse.core.resources.IResource) - -if isinstance(selection, org.eclipse.core.resources.IFile): - selection = selection.getParent() - -if isinstance(selection, org.eclipse.core.resources.IContainer): - runProcess("explorer.exe", [selection.getLocation().toFile().toString()]) -``` - -为了让菜单显示增加,像之前一样加入'ScriptProject'.在文件上右击,你看弹出菜单是不是出现了图标.选择Explore from here. - -![](https://opensource.com/sites/default/files/6_explorer.png) - -Eclipse高级基本环境提供一套很棒的扩展功能,使得Eclipse IDE能使用Python来轻易扩展.虽然这个项目还在婴儿期,但是[关于这个项目][13]更多更棒的功能也正在加紧开发中,如果你想为这个贡献,请到[论坛][14]讨论. - -2016年[Eclipsecon North America][15]会议将会发布更多EASE细节.我的演讲[Scripting Eclipse with Python][16]也会不单介绍Jython,也包括C-Python和其他功能性扩展的实战例子. - --------------------------------------------------------------------------------- - -via: https://opensource.com/life/16/2/how-use-python-hack-your-ide - -作者:[Tracy Miranda][a] -译者:[VicYu/Vic020](http://vicyu.net) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/tracymiranda -[1]: https://eclipse.org/ease/ -[2]: https://www.eclipsecon.org/na2016/session/scripting-eclipse-python -[3]: https://www.eclipse.org/downloads/packages/eclipse-ide-eclipse-committers-451/mars1 -[4]: http://download.eclipse.org/ease/update/nightly -[5]: https://dl.bintray.com/pontesegger/ease-jython/ -[6]: http://code.activestate.com/recipes/66434-change-line-endings/ -[7]: https://gist.github.com/tracymiranda/6556482e278c9afc421d -[8]: https://gist.github.com/tracymiranda/f20f233b40f1f79b1df2 -[9]: https://gist.github.com/tracymiranda/e9588d0976c46a987463 -[10]: https://gist.github.com/tracymiranda/55995daaea9a4db584dc -[11]: https://gist.github.com/tracymiranda/baa218fc2c1a8e898194 -[12]: https://gist.github.com/tracymiranda/8aa3f0fc4bf44f4a5cd3 -[13]: https://eclipse.org/ease/ -[14]: https://dev.eclipse.org/mailman/listinfo/ease-dev -[15]: https://www.eclipsecon.org/na2016 -[16]: https://www.eclipsecon.org/na2016/session/scripting-eclipse-python From 4b832efeff0bf90f06a6f625cd7ef4a38769311f Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 25 Apr 2016 23:12:44 +0800 Subject: [PATCH 0642/1469] Create 20151207 5 great Raspberry Pi projects for the classroom.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 请校对 --- ...Raspberry Pi projects for the classroom.md | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 translated/tech/20151207 5 great Raspberry Pi projects for the classroom.md diff --git a/translated/tech/20151207 5 great Raspberry Pi projects for the classroom.md b/translated/tech/20151207 5 great Raspberry Pi projects for the classroom.md new file mode 100644 index 0000000000..6c86172f7a --- /dev/null +++ b/translated/tech/20151207 5 great Raspberry Pi projects for the classroom.md @@ -0,0 +1,94 @@ +5 个很适合在课堂上演示的树莓派项目 +===================================================== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/osdc-open-source-yearbook-lead3.png?itok=fSUS0fIt) + +### 1. 我的世界: Pi + +![](https://opensource.com/sites/default/files/lava.png) +>Courtesy of the Raspberry Pi Foundation. [CC BY-SA 4.0][1]. + +我的世界是世界上很多青少年最喜欢的一个游戏,而且他也是目前最能激发年轻人创造力的一款游戏。这个树莓派版上自带的我的世界不仅仅是一个具有创造性的建筑游戏,他还是一个具有编程接口、可以通过 Python 与之交互的版本。 + +我的世界:Pi 版对于老师来说是一个非常好的教授学生解决问题和编写代码完成任务的途径。你可以使用 Python API 创建一个房子,并且一直跟随这你的脚步移动,当你需要桥梁的时候给你建造一座桥,让老天呀下雨,显示天空的温度,以及其它你可以想象到的一切东西。 + +详情请见 "[Getting Started with Minecraft Pi][2]." + +### 2. 反应游戏和交通灯 + +![](https://opensource.com/sites/default/files/pi_traffic_installed_yellow_led_on.jpg) +>源于 [Low Voltage Labs][3]. [CC BY-SA 4.0][1]. + +使用树莓派可以很轻松的进行物理计算——只需要连接几个 LED 和按钮到 开发板上的 GPIO 接口,再用几行代码你就可以按下按钮来开灯。一旦你指导了如何使用代码来做这些基本的东西,接下来就可以根据你的想象来做其它事情了。 + +如果你知道如何让一个灯闪烁,你就可以让三个灯开始闪烁。挑选三个和交通灯一样颜色的 LED 灯,然后编写控制交通灯的代码。如果你知道如何使用按钮触发实践,那么你就可以模拟行人过马路。同时你可以参考其它已经完成的交通灯附件,比如[PI-TRAFFIC][4], [PI-STOP][5], [Traffic HAT][6],等等。 + +代码并不是全部——这些联系只是让你理解真是世界里使如何完成这些事的。计算思维是一个在你一生中都会很有用的技能。 + +![](https://opensource.com/sites/default/files/reaction-game.png) +>源于 Raspberry Pi 基金会. [CC BY-SA 4.0][1]. + + +接下来试着接通两个按钮和 LED 灯的电源,实现一个反应游戏 —— 让 LED 灯随机的点亮,然后看是最先按下按钮。 + + +要想了解更多可以看看 [GPIO Zero recipes][7]。你所需要的资料都可以在 [CamJam EduKit 1][8] 找到。 + +### 3. 电子宠物 + +Astro Pi —— 一个增强版的树莓派 —— 将在 12 月问世,但是你并没有错过亲手把玩这个硬件的机会。Sense HAT 是 Astro Pi 的一个传感器扩展板,现在已经开放购买了。你可以使用它来进行数据搜集,科学实验,游戏和其它很多事。可以看看下面树莓派的 Carrie Anne 拍摄的 Gurl Geek Diaries 的视频,里面演示了一种很棒的入门途径——给生活添加一个你自己创造的生动的像素宠物: + +[video](https://youtu.be/gfRDFvEVz-w) + +>详见 "[探索 Sense HAT][9]." + +### 4. 红外鸟笼 + +![](https://opensource.com/sites/default/files/ir-bird-box.png) +>源于 Raspberry Pi 基金会. [CC BY-SA 4.0][1]. + +让整个班级都可以参与进来的好主意是在鸟笼立方一个树莓派和夜视镜头,以及一些红外线灯,这样子你就可以在黑暗中看见鸟笼里的情况了,然后使用树莓派通过网络串流视频。然后就可以等待小鸟归笼了,你可以在不干扰小鸟习惯的情况下观察他们了。 + +要了解更多有关红外线和光谱的知识,以及如何调校摄像头和使用软件控制摄像头,可以访问 [Make an infrared bird box][10]。 + + + +### 5. 机器人 + +![](https://opensource.com/sites/default/files/edukit3_1500-alex-eames-sm.jpg) +>源于 Raspberry Pi 基金会. [CC BY-SA 4.0][1]. + +只需要一个树莓派和很少几个电机和电机控制器,你就可以制作一个你自己的机器人。你可以制作的机器人有很多种,从简单的由几个轮子和自制底盘拼凑小车,到由游戏控制器驱动的、具有自我意识、配备了传感器、装配了摄像头的金属种马。 + +要学习如何控制不同的电机,可以使用 RTK 电机驱动开发板入门或者使用配置了电机、轮子和传感器的 CamJam 机器人开发套件——具有很大的价值和大量的学习潜力——深入学习。 + +或者,如果你还想了解更多核心内容,可以试试 PiBorg 的 [4Borg][11] 和 [DiddyBorg][12],或者购买 Metal 版 DoodleBorg ,然后构建一个最小版本的 [DoodleBorg tank][13]。 + +详情可见 [机器人装备表][14]。 + + +------------------------------------------------------------------------------ + +via: https://opensource.com/education/15/12/5-great-raspberry-pi-projects-classroom + +作者:[Ben Nuttall][a] +译者:[ezio](https://github.com/oska874) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/bennuttall +[1]: https://creativecommons.org/licenses/by-sa/4.0/ +[2]: https://opensource.com/life/15/5/getting-started-minecraft-pi +[3]: http://lowvoltagelabs.com/ +[4]: http://lowvoltagelabs.com/products/pi-traffic/ +[5]: http://4tronix.co.uk/store/index.php?rt=product/product&product_id=390 +[6]: https://ryanteck.uk/hats/1-traffichat-0635648607122.html +[7]: http://pythonhosted.org/gpiozero/recipes/ +[8]: http://camjam.me/?page_id=236 +[9]: https://opensource.com/life/15/10/exploring-raspberry-pi-sense-hat +[10]: https://www.raspberrypi.org/learning/infrared-bird-box/ +[11]: https://www.piborg.org/4borg +[12]: https://www.piborg.org/diddyborg +[13]: https://www.piborg.org/doodleborg +[14]: http://camjam.me/?page_id=1035#worksheets From 092ee100c8cc2ec3a51c58cc1a90ebd15884ef48 Mon Sep 17 00:00:00 2001 From: alim0x Date: Tue, 26 Apr 2016 23:42:21 +0800 Subject: [PATCH 0643/1469] [translating]7 Steps to Start Your Linux SysAdmin Career --- ...0160218 7 Steps to Start Your Linux SysAdmin Career.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sources/tech/20160218 7 Steps to Start Your Linux SysAdmin Career.md b/sources/tech/20160218 7 Steps to Start Your Linux SysAdmin Career.md index 60b8f7fc75..df4989eba9 100644 --- a/sources/tech/20160218 7 Steps to Start Your Linux SysAdmin Career.md +++ b/sources/tech/20160218 7 Steps to Start Your Linux SysAdmin Career.md @@ -1,9 +1,11 @@ +alim0x translating + 7 Steps to Start Your Linux SysAdmin Career =============================================== Linux is hot right now. Everybody is looking for Linux talent. Recruiters are knocking down the doors of anybody with Linux experience, and there are tens of thousands of jobs waiting to be filled. But what if you want to take advantage of this trend and you’re new to Linux? How do you get started? -1. Install Linux +1. Install Linux It should almost go without saying, but the first key to learning Linux is to install Linux. Both the LFS101x and the LFS201 courses include detailed sections on installing and configuring Linux for the first time. @@ -43,7 +45,7 @@ Linux is hot right now. Everybody is looking for Linux talent. Recruiters are kn - [https://forums.opensuse.org/forum.php](https://forums.opensuse.org/forum.php) - - [http://wiki.centos.org/Documentation](http://wiki.centos.org/Documentation) + - [http://wiki.centos.org/Documentation](http://wiki.centos.org/Documentation) 7. Learn To Love The Documentation @@ -64,5 +66,3 @@ via: http://www.linux.com/news/featured-blogs/191-linux-training/834644-7-steps- 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:linux.com - - From 8bf56f8751173c30d9f3d1a4350513decc93e5fc Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 27 Apr 2016 05:58:00 +0800 Subject: [PATCH 0644/1469] PUB:20160414 Linux Kernel 3.12 to Be Supported Until 2017 Because of SUSE Linux Enterprise 12 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 通过而不发布(过期) --- ...Be Supported Until 2017 Because of SUSE Linux Enterprise 12.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/news => published}/20160414 Linux Kernel 3.12 to Be Supported Until 2017 Because of SUSE Linux Enterprise 12.md (100%) diff --git a/translated/news/20160414 Linux Kernel 3.12 to Be Supported Until 2017 Because of SUSE Linux Enterprise 12.md b/published/20160414 Linux Kernel 3.12 to Be Supported Until 2017 Because of SUSE Linux Enterprise 12.md similarity index 100% rename from translated/news/20160414 Linux Kernel 3.12 to Be Supported Until 2017 Because of SUSE Linux Enterprise 12.md rename to published/20160414 Linux Kernel 3.12 to Be Supported Until 2017 Because of SUSE Linux Enterprise 12.md From d7d07724a23b265a55219e5f64856d39556a640e Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 27 Apr 2016 05:58:54 +0800 Subject: [PATCH 0645/1469] =?UTF-8?q?=E6=92=A4=E9=94=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ith Extensive File Control Capabilities.md | 32 ------------------- 1 file changed, 32 deletions(-) delete mode 100644 sources/news/20160415 ownCloud 9.0 Enterprise Edition Arrives with Extensive File Control Capabilities.md diff --git a/sources/news/20160415 ownCloud 9.0 Enterprise Edition Arrives with Extensive File Control Capabilities.md b/sources/news/20160415 ownCloud 9.0 Enterprise Edition Arrives with Extensive File Control Capabilities.md deleted file mode 100644 index 6249163578..0000000000 --- a/sources/news/20160415 ownCloud 9.0 Enterprise Edition Arrives with Extensive File Control Capabilities.md +++ /dev/null @@ -1,32 +0,0 @@ -ownCloud 9.0 Enterprise Edition Arrives with Extensive File Control Capabilities -================================================================================== - ->ownCloud, Inc. has had the great pleasure of [announcing][1] the availability of the Enterprise Edition (EE) of its powerful ownCloud 9.0 self-hosting cloud server solution. - -Engineered exclusively for small- and medium-sized business, as well as major organizations and enterprises, [ownCloud 9.0 Enterprise Edition][2] is now available with extensive file control capabilities and all the cool new features that made the open-source version of the project famous amongst Linux users. - -Prominent new features in ownCloud 9.0 Enterprise Edition are built-in Auto-Tagging and File Firewall apps, which have been based on some of the new features of ownCloud 9.0, such as file tags, file comments, as well as notifications and activities enhancements. This offers system administrators the ability to set rules and classifications for shared documents based on user- or system-applied tags. - -"To illustrate how this can work, imagine working in a publicly traded company which has to be very careful not to release financial information ahead of official disclosure," reads the [announcement][3]. "While sharing this information internally it could end up in a folder which is shared through a public link. By assigning a special system tag, admins can configure the system to ensure the files are not available for download despite this mistake." - -### Used by over 8 million people around the globe - -ownCloud 9.0 is the best release of the open-source self-hosting cloud server software so far, which is currently used by over 8 million users around the globe. The release has brought a huge number of new features, such as code signing, as well as dozens of under-the-hood improvements and cosmetic changes. ownCloud 9.0 also got its first point release, version 9.0.1, last week, which [introduced even more enhancements][4]. - -And now, enterprises can take advantage of ownCloud 9.0's new features to differentiate between storage type and location, as well as the location of users, groups, and clients. ownCloud 9.0 Enterprise Edition gives them extensive access control, which is perfect if they have strict company guidelines or work with all sorts of regulations and rules. Below, you can see the File Firewall and Auto-Tagging apps in action. - ------------------------------------------------------------------------------- - -via: http://news.softpedia.com/news/owncloud-9-0-enterprise-edition-arrives-with-extensive-file-control-capabilities-502985.shtml - -作者:[Marius Nestor][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://news.softpedia.com/editors/browse/marius-nestor -[1]: https://owncloud.com/blog-introducing-owncloud-9-enterprise-edition/ -[2]: https://owncloud.com/ -[3]: https://owncloud.org/blog/owncloud-9-0-enterprise-edition-is-now-available/ -[4]: http://news.softpedia.com/news/owncloud-9-0-gets-its-first-point-release-over-120-improvements-introduced-502698.shtml From c582d5ddbe0b2f1bb26e2137659d334149def5a5 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 27 Apr 2016 07:52:54 +0800 Subject: [PATCH 0646/1469] PUB:20151119 Going Beyond Hello World Containers is Hard Stuff @oska874 --- ...nd Hello World Containers is Hard Stuff.md | 101 +++++++++--------- 1 file changed, 48 insertions(+), 53 deletions(-) rename {translated/tech => published}/20151119 Going Beyond Hello World Containers is Hard Stuff.md (59%) diff --git a/translated/tech/20151119 Going Beyond Hello World Containers is Hard Stuff.md b/published/20151119 Going Beyond Hello World Containers is Hard Stuff.md similarity index 59% rename from translated/tech/20151119 Going Beyond Hello World Containers is Hard Stuff.md rename to published/20151119 Going Beyond Hello World Containers is Hard Stuff.md index c42b278787..f4e7b89720 100644 --- a/translated/tech/20151119 Going Beyond Hello World Containers is Hard Stuff.md +++ b/published/20151119 Going Beyond Hello World Containers is Hard Stuff.md @@ -1,42 +1,41 @@ -要超越Hello World 容器是件困难的事情 +从 Hello World 容器进阶是件困难的事情 ================================================================================ -在[我的上一篇文章里][1], 我介绍了Linux 容器背后的技术的概念。我写了我知道的一切。容器对我来说也是比较新的概念。我写这篇文章的目的就是鼓励我真正的来学习这些东西。 +在[我的上一篇文章里][1], 我介绍了 Linux 容器背后的技术的概念。我写了我知道的一切。容器对我来说也是比较新的概念。我写这篇文章的目的就是鼓励我真正的来学习这些东西。 -我打算在使用中学习。首先实践,然后上手并记录下我是怎么走过来的。我假设这里肯定有很多想"Hello World" 这种类型的知识帮助我快速的掌握基础。然后我能够更进一步,构建一个微服务容器或者其它东西。 +我打算在使用中学习。首先实践,然后上手并记录下我是怎么走过来的。我假设这里肯定有很多像 "Hello World" 这种类型的知识帮助我快速的掌握基础。然后我能够更进一步,构建一个微服务容器或者其它东西。 -我的意思是还会比着更难吗,对吧? +我想,它应该不会有多难的。 -错了。 +但是我错了。 -可能对某些人来说这很简单,因为他们会耗费大量的时间专注在操作工作上。但是对我来说实际上是很困难的,可以从我在Facebook 上的状态展示出来的挫折感就可以看出了。 +可能对某些人来说这很简单,因为他们在运维工作方面付出了大量的时间。但是对我来说实际上是很困难的,可以从我在Facebook 上的状态展示出来的挫折感就可以看出了。 -但是还有一个好消息:我最终让它工作了。而且他工作的还不错。所以我准备分享向你分享我如何制作我的第一个微服务容器。我的痛苦可能会节省你不少时间呢。 +但是还有一个好消息:我最终搞定了。而且它工作的还不错。所以我准备分享向你分享我如何制作我的第一个微服务容器。我的痛苦可能会节省你不少时间呢。 -如果你曾经发现或者从来都没有发现自己处在这种境地:像我这样的人在这里解决一些你不需要解决的问题。 +如果你曾经发现你也处于过这种境地,不要害怕:像我这样的人都能搞定,所以你也肯定行。 让我们开始吧。 - ### 一个缩略图微服务 ### -我设计的微服务在理论上很简单。以JPG 或者PNG 格式在HTTP 终端发布一张数字照片,然后获得一个100像素宽的缩略图。 +我设计的微服务在理论上很简单。以 JPG 或者 PNG 格式在 HTTP 终端发布一张数字照片,然后获得一个100像素宽的缩略图。 -下面是它实际的效果: +下面是它的流程: ![container-diagram-0](https://deis.com/images/blog-images/containers-hard-0.png) -我决定使用NodeJS 作为我的开发语言,使用[ImageMagick][2] 来转换缩略图。 +我决定使用 NodeJS 作为我的开发语言,使用 [ImageMagick][2] 来转换缩略图。 我的服务的第一版的逻辑如下所示: ![container-diagram-1](https://deis.com/images/blog-images/containers-hard-1.png) -我下载了[Docker Toolbox][3],用它安装了Docker 的快速启动终端。Docker 快速启动终端使得创建容器更简单了。终端会启动一个装好了Docker 的Linux 虚拟机,它允许你在一个终端里运行Docker 命令。 +我下载了 [Docker Toolbox][3],用它安装了 Docker 的快速启动终端(Docker Quickstart Terminal)。Docker 快速启动终端使得创建容器更简单了。终端会启动一个装好了 Docker 的 Linux 虚拟机,它允许你在一个终端里运行 Docker 命令。 -虽然在我的例子里,我的操作系统是Mac OS X。但是Windows 下也有相同的工具。 +虽然在我的例子里,我的操作系统是 Mac OS X。但是 Windows 下也有相同的工具。 -我准备使用Docker 快速启动终端里为我的微服务创建一个容器镜像,然后从这个镜像运行容器。 +我准备使用 Docker 快速启动终端里为我的微服务创建一个容器镜像,然后从这个镜像运行容器。 Docker 快速启动终端就运行在你使用的普通终端里,就像这样: @@ -44,11 +43,11 @@ Docker 快速启动终端就运行在你使用的普通终端里,就像这样 ### 第一个小问题和第一个大问题### -所以我用NodeJS 和ImageMagick 瞎搞了一通然后让我的服务在本地运行起来了。 +我用 NodeJS 和 ImageMagick 瞎搞了一通,然后让我的服务在本地运行起来了。 -然后我创建了Dockerfile,这是Docker 用来构建容器的配置脚本。(我会在后面深入介绍构建和Dockerfile) +然后我创建了 Dockerfile,这是 Docker 用来构建容器的配置脚本。(我会在后面深入介绍构建过程和 Dockerfile) -这是我运行Docker 快速启动终端的命令: +这是我运行 Docker 快速启动终端的命令: $ docker build -t thumbnailer:0.1 @@ -58,32 +57,31 @@ Docker 快速启动终端就运行在你使用的普通终端里,就像这样 呃。 -我估摸着过了15分钟:我忘记了在末尾参数输入一个点`.`。 +我估摸着过了15分钟我才反应过来:我忘记了在末尾参数输入一个点`.`。 正确的指令应该是这样的: $ docker build -t thumbnailer:0.1 . +但是这不是我遇到的最后一个问题。 -但是这不是我最后一个问题。 - -我让这个镜像构建好了,然后我Docker 快速启动终端输入了[`run` 命令][4]来启动容器,名字叫`thumbnailer:0.1`: +我让这个镜像构建好了,然后我在 Docker 快速启动终端输入了 [`run` 命令][4]来启动容器,名字叫 `thumbnailer:0.1`: $ docker run -d -p 3001:3000 thumbnailer:0.1 -参数`-p 3001:3000` 让NodeJS 微服务在Docker 内运行在端口3000,而在主机上则是3001。 +参数 `-p 3001:3000` 让 NodeJS 微服务在 Docker 内运行在端口3000,而绑定在宿主主机上的3001。 -到目前卡起来都很好,对吧? +到目前看起来都很好,对吧? 错了。事情要马上变糟了。 -我指定了在Docker 快速启动中端里用命令`docker-machine` 运行的Docker 虚拟机的ip地址: +我通过运行 `docker-machine` 命令为这个 Docker 快速启动终端里创建的虚拟机指定了 ip 地址: $ docker-machine ip default -这句话返回了默认虚拟机的IP地址,即运行docker 的虚拟机。对于我来说,这个ip 地址是192.168.99.100。 +这句话返回了默认虚拟机的 IP 地址,它运行在 Docker 快速启动终端里。在我这里,这个 ip 地址是 192.168.99.100。 -我浏览网页http://192.168.99.100:3001/ ,然后找到了我创建的上传图片的网页: +我浏览网页 http://192.168.99.100:3001/ ,然后找到了我创建的上传图片的网页: ![container-diagram-3](https://deis.com/images/blog-images/containers-hard-3.png) @@ -91,13 +89,13 @@ Docker 快速启动终端就运行在你使用的普通终端里,就像这样 但是它并没有工作。 -终端告诉我他无法找到我的微服务需要的`/upload` 目录。 +终端告诉我他无法找到我的微服务需要的 `/upload` 目录。 -现在开始记住,我已经在此耗费了将近一天的时间-从浪费时间到研究问题。我此时感到了一些挫折感。 +现在,你要知道,我已经在此耗费了将近一天的时间-从浪费时间到研究问题。我此时感到了一些挫折感。 然后灵光一闪。某人记起来微服务不应该自己做任何数据持久化的工作!保存数据应该是另一个服务的工作。 -所以容器找不到目录`/upload` 的原因到底是什么?这个问题的根本就是我的微服务在基础设计上就有问题。 +所以容器找不到目录 `/upload` 的原因到底是什么?这个问题的根本就是我的微服务在基础设计上就有问题。 让我们看看另一幅图: @@ -109,7 +107,7 @@ Docker 快速启动终端就运行在你使用的普通终端里,就像这样 ![container-diagram-5](https://deis.com/images/blog-images/containers-hard-5.png) -这是我用NodeJS 写的在内存工作、生成缩略图的代码: +这是我用 NodeJS 写的在内存运行、生成缩略图的代码: // Bind to the packages var express = require('express'); @@ -171,19 +169,19 @@ Docker 快速启动终端就运行在你使用的普通终端里,就像这样 module.exports = router; -好了,回到正轨,已经可以在我的本地机器正常工作了。我该去休息了。 +好了,一切回到了正轨,已经可以在我的本地机器正常工作了。我该去休息了。 -但是,在我测试把这个微服务当作一个普通的Node 应用运行在本地时... +但是,在我测试把这个微服务当作一个普通的 Node 应用运行在本地时... ![Containers Hard](https://deis.com/images/blog-images/containers-hard-6.png) -它工作的很好。现在我要做的就是让他在容器里面工作。 +它工作的很好。现在我要做的就是让它在容器里面工作。 第二天我起床后喝点咖啡,然后创建一个镜像——这次没有忘记那个"."! $ docker build -t thumbnailer:01 . -我从缩略图工程的根目录开始构建。构建命令使用了根目录下的Dockerfile。它是这样工作的:把Dockerfile 放到你想构建镜像的地方,然后系统就默认使用这个Dockerfile。 +我从缩略图项目的根目录开始构建。构建命令使用了根目录下的 Dockerfile。它是这样工作的:把 Dockerfile 放到你想构建镜像的地方,然后系统就默认使用这个 Dockerfile。 下面是我使用的Dockerfile 的内容: @@ -209,7 +207,7 @@ Docker 快速启动终端就运行在你使用的普通终端里,就像这样 ### 第二个大问题 ### -我运行了`build` 命令,然后出了这个错: +我运行了 `build` 命令,然后出了这个错: Do you want to continue? [Y/n] Abort. @@ -217,7 +215,7 @@ Docker 快速启动终端就运行在你使用的普通终端里,就像这样 我猜测微服务出错了。我回到本地机器,从本机启动微服务,然后试着上传文件。 -然后我从NodeJS 获得了这个错误: +然后我从 NodeJS 获得了这个错误: Error: spawn convert ENOENT @@ -225,25 +223,25 @@ Docker 快速启动终端就运行在你使用的普通终端里,就像这样 我搜索了我能想到的所有的错误原因。差不多4个小时后,我想:为什么不重启一下机器呢? -重启了,你猜猜结果?错误消失了!(译注:万能的重启) +重启了,你猜猜结果?错误消失了!(LCTT 译注:万能的“重启试试”) 继续。 -### 将精灵关进瓶子 ### +### 将精灵关进瓶子里 ### 跳回正题:我需要完成构建工作。 -我使用[`rm` 命令][5]删除了虚拟机里所有的容器。 +我使用 [`rm` 命令][5]删除了虚拟机里所有的容器。 $ docker rm -f $(docker ps -a -q) `-f` 在这里的用处是强制删除运行中的镜像。 -然后删除了全部Docker 镜像,用的是[命令`rmi`][6]: +然后删除了全部 Docker 镜像,用的是[命令 `rmi`][6]: $ docker rmi if $(docker images | tail -n +2 | awk '{print $3}') -我重新执行了命令构建镜像,安装容器,运行微服务。然后过了一个充满自我怀疑和沮丧的一个小时,我告诉我自己:这个错误可能不是微服务的原因。 +我重新执行了重新构建镜像、安装容器、运行微服务的整个过程。然后过了一个充满自我怀疑和沮丧的一个小时,我告诉我自己:这个错误可能不是微服务的原因。 所以我重新看到了这个错误: @@ -251,19 +249,17 @@ Docker 快速启动终端就运行在你使用的普通终端里,就像这样 The command '/bin/sh -c apt-get install imagemagick libmagickcore-dev libmagickwand-dev' returned a non-zero code: 1 -这太打击我了:构建脚本好像需要有人从键盘输入Y! 但是,这是一个非交互的Dockerfile 脚本啊。这里并没有键盘。 +这太打击我了:构建脚本好像需要有人从键盘输入 Y! 但是,这是一个非交互的 Dockerfile 脚本啊。这里并没有键盘。 -回到Dockerfile,脚本元来时这样的: +回到 Dockerfile,脚本原来是这样的: RUN apt-get update RUN apt-get install -y nodejs nodejs-legacy npm RUN apt-get install imagemagick libmagickcore-dev libmagickwand-dev RUN apt-get clean -The second `apt-get` command is missing the `-y` flag which causes "yes" to be given automatically where usually it would be prompted for. -第二个`apt-get` 忘记了`-y` 标志,这才是错误的根本原因。 +第二个`apt-get` 忘记了`-y` 标志,它用于自动应答提示所需要的“yes”。这才是错误的根本原因。 -I added the missing `-y` to the command: 我在这条命令后面添加了`-y` : RUN apt-get update @@ -281,7 +277,6 @@ I added the missing `-y` to the command: $ docker run -d -p 3001:3000 thumbnailer:0.1 -Got the IP address of the Virtual Machine: 获取了虚拟机的IP 地址: $ docker-machine ip default @@ -298,11 +293,11 @@ Got the IP address of the Virtual Machine: 在容器里面工作了,我的第一次啊! -### 这意味着什么? ### +### 这让我学到了什么? ### -很久以前,我接受了这样一个道理:当你刚开始尝试某项技术时,即使是最简单的事情也会变得很困难。因此,我压抑了要成为房间里最聪明的人的欲望。然而最近几天尝试容器的过程就是一个充满自我怀疑的旅程。 +很久以前,我接受了这样一个道理:当你刚开始尝试某项技术时,即使是最简单的事情也会变得很困难。因此,我不会把自己当成最聪明的那个人,然而最近几天尝试容器的过程就是一个充满自我怀疑的旅程。 -但是你想知道一些其它的事情吗?这篇文章是我在凌晨2点完成的,而每一个折磨的小时都值得了。为什么?因为这段时间你将自己全身心投入了喜欢的工作里。这件事很难,对于所有人来说都不是很容易就获得结果的。但是不要忘记:你在学习技术,运行世界的技术。 +但是你想知道一些其它的事情吗?这篇文章是我在凌晨2点完成的,而每一个受折磨的时刻都值得了。为什么?因为这段时间你将自己全身心投入了喜欢的工作里。这件事很难,对于所有人来说都不是很容易就获得结果的。但是不要忘记:你在学习技术,运行世界的技术。 P.S. 了解一下Hello World 容器的两段视频,这里会有 [Raziel Tabib’s][7] 的精彩工作内容。 @@ -320,12 +315,12 @@ via: https://deis.com/blog/2015/beyond-hello-world-containers-hard-stuff 作者:[Bob Reselman][a] 译者:[Ezio](https://github.com/oska874) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:https://deis.com/blog -[1]:http://deis.com/blog/2015/developer-journey-linux-containers +[1]:https://linux.cn/article-6594-1.html [2]:https://github.com/rsms/node-imagemagick [3]:https://www.docker.com/toolbox [4]:https://docs.docker.com/reference/commandline/run/ From 3e4188e4790184fede01f36d7b58029e3511304a Mon Sep 17 00:00:00 2001 From: alim0x Date: Wed, 27 Apr 2016 21:16:36 +0800 Subject: [PATCH 0647/1469] [translated]7 Steps to Start Your Linux SysAdmin Career --- ...eps to Start Your Linux SysAdmin Career.md | 47 +++++++++---------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/sources/tech/20160218 7 Steps to Start Your Linux SysAdmin Career.md b/sources/tech/20160218 7 Steps to Start Your Linux SysAdmin Career.md index df4989eba9..e6b4fa62ab 100644 --- a/sources/tech/20160218 7 Steps to Start Your Linux SysAdmin Career.md +++ b/sources/tech/20160218 7 Steps to Start Your Linux SysAdmin Career.md @@ -1,39 +1,38 @@ -alim0x translating - -7 Steps to Start Your Linux SysAdmin Career +七步开始你的 Linux 系统管理员生涯 =============================================== -Linux is hot right now. Everybody is looking for Linux talent. Recruiters are knocking down the doors of anybody with Linux experience, and there are tens of thousands of jobs waiting to be filled. But what if you want to take advantage of this trend and you’re new to Linux? How do you get started? -1. Install Linux +Linux 现在是个大热门。每个人都在寻求 Linux 才能。招聘人员对有 Linux 经验的人求贤若渴,还有无数的职位虚位以待。但是如果你是 Linux 新手,又想要赶上这波热潮,该从何开始下手呢? - It should almost go without saying, but the first key to learning Linux is to install Linux. Both the LFS101x and the LFS201 courses include detailed sections on installing and configuring Linux for the first time. +1. 安装 Linux -2. Take LFS101x + 这应该是不言而喻的,但学习 Linux 的第一关键就是安装 Linux。LFS101x 和 LFS201 课程都包含第一次安装和配置 Linux 的详细内容。 - If you are completely new to Linux, the best place to start is our free [LFS101x Introduction](https://www.edx.org/course/introduction-linux-linuxfoundationx-lfs101x-2) to Linux course. This online course is hosted by edX.org, and explores the various tools and techniques commonly used by Linux system administrators and end users to achieve their day-to-day work in a Linux environment. It is designed for experienced computer users who have limited or no previous exposure to Linux, whether they are working in an individual or enterprise environment. This course will give you a good working knowledge of Linux from both a graphical and command line perspective, allowing you to easily navigate through any of the major Linux distributions. +2. 完成 LFS101x 课程 -3. Look into LFS201 + 如果你是 Linux 完完全全的新手,最佳的起点是免费的 Linux 课程 [LFS101x Introduction](https://www.edx.org/course/introduction-linux-linuxfoundationx-lfs101x-2)。这个在线课程在 edX.org,探索 Linux 系统管理员和终端用户常用的各种工具和技能以及日常 Linux 工作环境。该课程是为有一定经验但较少或没有接触过 Linux 的电脑用户设计的,不论他们是在个人还是企业环境中工作。这个课程会从图形界面和命令行教会你有用的 Linux 知识,让你能够了解主流的 Linux 发行版。 - Once you’ve completed LFS101x, you’re ready to start diving into the more complicated tasks in Linux that will be required of you as a professional sysadmin. To gain those skills, you’ll want to take [LFS201 Essentials of Linux System Administration](http://training.linuxfoundation.org/linux-courses/system-administration-training/essentials-of-system-administration). The course gives you in-depth explanations and instructions for each topic, along with plenty of exercises and labs to help you get real, hands-on experience with the subject matter. +3. 看看 LFS201 课程 - If you would rather have a live instructor teach you or you have an employer who is interested in helping you become a Linux sysadmin, you might also be interested in LFS220 Linux System Administration. This course includes all the same topics as the LFS201 course, but is taught by an expert instructor who can guide you through the labs and answer any questions you have on the topics covered in the course. + 在你完成 LFS101x 之后,你就准备好开始进入 Linux 更加复杂的任务了,这是成为一名专业的系统管理员所必须的。为了掌握这些技能,你应该看看 [LFS201 Essentials of Linux System Administration](http://training.linuxfoundation.org/linux-courses/system-administration-training/essentials-of-system-administration) 这个课程。该课程对每个话题进行了深度的解释和介绍,还有大量的练习和实验,帮助你获得相关主题实际的上手经验。 -4. Practice! + 如果你更愿意有个教练或者你的雇主对将你培养成 Linux 系统管理员有兴趣,你可能会对 LFS220 Linux System Administration 有兴趣。这个课程有 LFS201 中所有的主题,但是它是由专家专人教授的,帮助你进行实验以及解答你在课程主题中的问题。 - Practice makes perfect, and that’s as true for Linux as it is for any musical instrument or sport. Once you’ve installed Linux, use it regularly. Perform key tasks over and over again until you can do them easily without reference material. Learn the ins and outs of the command line as well as the GUI. This practice will ensure that you’ve got the skills and knowledge to be successful as a professional Linux sysadmin. +4. 练习! -5. Get Certified + 熟能生巧,和对任何乐器或运动适用一样,这对 Linux 来说也一样适用。在你安装 Linux 之后,经常使用它。一遍遍地练习关键任务,直到你不需要参考材料也能轻而易举地完成。练习命令行和图形界面的输入输出。这些练习能够保证你掌握成为成功的 Linux 系统管理员所必需的知识和技能。 - After you’ve taken LFS201 or LFS220 and you’ve gotten some practice, you are now ready to get certified as a system administrator. You’ll need this certification because this is how you will prove to employers that you have the necessary skills to be a professional Linux sysadmin. +5. 获得认证 - There are several Linux certifications on the market today, and all of them have their place. However, most of these certifications are either centered on a specific distro (like Red Hat) or are purely knowledge-based and don’t demonstrate actual skill with Linux. The Linux Foundation Certified System Administrator certification is an excellent alternative for someone looking for a flexible, meaningful entry-level certification. + 在你完成 LFS201 或 LFS220 并且充分练习之后,你现在已经准备好获得系统管理员的认证了。你需要这个证书,因为你需要向雇主证明你拥有一名专业 Linux 系统管理员必需的技能。 -6. Get Involved + 现在有一些不同的 Linux 证书,它们有它们的独到之处。但是,它们里大部分不是在特定发行版(如红帽)上认证,就是纯粹的知识测试,没有演示 Linux 的实际技能。Linux 基金会认证系统管理员(Linux Foundation Certified System Administrator)证书对想要一个灵活的,有意义的初级证书的人来说是个优秀的替代。 - At this point you may also want to consider joining up with a local Linux Users Group (or LUG), if there’s one in your area. These groups are usually composed of people of all ages and experience levels, so regardless of where you are at with your Linux experience, you can find people with similar skill levels to bond with, or more advanced Linux users who can help answer questions and point you towards helpful resources. To find out if there’s a LUG near you, try looking on meetup.com, check with a nearby university, or just do a simple Internet search. +6. 参与进来 - There are also many online communities available to you as you learn Linux. These sites and communities provide help and support to both individuals new to Linux or experienced administrators: + 如果你所在的地方有本地 Linux 用户组(Linux Users Group,LUG)的话,这时候你可能还想要考虑加入他们。这些组织通常由各种年龄和经验水平的人组成,所以不管你的 Linux 经验水平如何,你都能找到和你类似技能水平的人互助,或是更高水平的 Linux 用户来解答你的问题以及介绍有用的资源。要想知道你附近有没有 LUG,上 meet.com 看看,或是附近的大学,又或是上网搜索一下。 + + 还有不少在线社区可以在你学习 Linux 的时候帮助你。这些站点和社区向 Linux 新手和有经验的管理员都能够提供帮助和支持: - [Linux Admin subreddit](https://www.reddit.com/r/linuxadmin) @@ -47,20 +46,20 @@ Linux is hot right now. Everybody is looking for Linux talent. Recruiters are kn - [http://wiki.centos.org/Documentation](http://wiki.centos.org/Documentation) -7. Learn To Love The Documentation +7. 学会热爱文档 - Last but not least, if you ever get stuck on something within Linux, don’t forget about Linux’s included documentation. Using the commands man (for manual), info and help, you can find information on virtually every aspect of Linux, right from within the operating system. The usefulness of these built-in resources cannot be overstated, and you’ll find yourself using them throughout your career, so you might as well get familiar with them early on. + 最后但同样重要的是,如果你困在 Linux 的某些地方,别忘了 Linux 包含的文档。使用命令 man(manual,手册),info 和 help,你从系统内就可以找到 Linux 几乎所有方面的信息。这些内置资源的用处再夸大也不为过,你会发现你在生涯中始终会用到,所以你可能最好早点掌握使用它们。 - Interested in learning more about starting your IT career with Linux? Check out our free ebook “[A Brief Guide To Starting Your IT Career In Linux](http://training.linuxfoundation.org/sysadmin-it-career-guide).” + 想要了解更多开始你 Linux IT 生涯的信息?查看我们免费的电子书“[开始你 Linux IT 生涯的简短指南](http://training.linuxfoundation.org/sysadmin-it-career-guide)”。 -[Download Now](http://training.linuxfoundation.org/sysadmin-it-career-guide) +[立刻下载](http://training.linuxfoundation.org/sysadmin-it-career-guide) ------------------------------------------------------------------------------ via: http://www.linux.com/news/featured-blogs/191-linux-training/834644-7-steps-to-start-your-linux-sysadmin-career 作者:[linux.com][a] -译者:[译者ID](https://github.com/译者ID) +译者:[alim0x](https://github.com/alim0x) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From b9fc96145465e2ec995d2a4dfa23438f626f4f3e Mon Sep 17 00:00:00 2001 From: alim0x Date: Wed, 27 Apr 2016 22:40:14 +0800 Subject: [PATCH 0648/1469] move file --- .../tech/20160218 7 Steps to Start Your Linux SysAdmin Career.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20160218 7 Steps to Start Your Linux SysAdmin Career.md (100%) diff --git a/sources/tech/20160218 7 Steps to Start Your Linux SysAdmin Career.md b/translated/tech/20160218 7 Steps to Start Your Linux SysAdmin Career.md similarity index 100% rename from sources/tech/20160218 7 Steps to Start Your Linux SysAdmin Career.md rename to translated/tech/20160218 7 Steps to Start Your Linux SysAdmin Career.md From 29c3cbd844400c94192658565576ee4a2836328e Mon Sep 17 00:00:00 2001 From: vim-kakali <1799225723@qq.com> Date: Thu, 28 Apr 2016 12:32:00 +0800 Subject: [PATCH 0649/1469] translated --- ...227 Upheaval in the Debian Live project.md | 68 --------------- ...227 Upheaval in the Debian Live project.md | 83 +++++++++++++++++++ 2 files changed, 83 insertions(+), 68 deletions(-) delete mode 100644 sources/talk/20151227 Upheaval in the Debian Live project.md create mode 100644 translated/20151227 Upheaval in the Debian Live project.md diff --git a/sources/talk/20151227 Upheaval in the Debian Live project.md b/sources/talk/20151227 Upheaval in the Debian Live project.md deleted file mode 100644 index 3fa8179aa3..0000000000 --- a/sources/talk/20151227 Upheaval in the Debian Live project.md +++ /dev/null @@ -1,68 +0,0 @@ -vim-kakali is translating. - -While the event had a certain amount of drama surrounding it, the [announcement][1] of the end for the [Debian Live project][2] seems likely to have less of an impact than it first appeared. The loss of the lead developer will certainly be felt—and the treatment he and the project received seems rather baffling—but the project looks like it will continue in some form. So Debian will still have tools to create live CDs and other media going forward, but what appears to be a long-simmering dispute between project founder and leader Daniel Baumann and the Debian CD and installer teams has been "resolved", albeit in an unfortunate fashion. - -The November 9 announcement from Baumann was titled "An abrupt End to Debian Live". In that message, he pointed to a number of different events over the nearly ten years since the [project was founded][3] that indicated to him that his efforts on Debian Live were not being valued, at least by some. The final straw, it seems, was an "intent to package" (ITP) bug [filed][4] by Iain R. Learmonth that impinged on the namespace used by Debian Live. - -Given that one of the main Debian Live packages is called "live-build", the new package's name, "live-build-ng", was fairly confrontational in and of itself. Live-build-ng is meant to be a wrapper around the [vmdebootstrap][5] tool for creating live media (CDs and USB sticks), which is precisely the role Debian Live is filling. But when Baumann [asked][6] Learmonth to choose a different name for his package, he got an "interesting" [reply][7]: - -``` -It is worth noting that live-build is not a Debian project, it is an external project that claims to be an official Debian project. This is something that needs to be fixed. -There is no namespace issue, we are building on the existing live-config and live-boot packages that are maintained and bringing these into Debian as native projects. If necessary, these will be forks, but I'm hoping that won't have to happen and that we can integrate these packages into Debian and continue development in a collaborative manner. -live-build has been deprecated by debian-cd, and live-build-ng is replacing it. In a purely Debian context at least, live-build is deprecated. live-build-ng is being developed in collaboration with debian-cd and D-I [Debian Installer]. -``` - -Whether or not Debian Live is an "official" Debian project (or even what "official" means in this context) has been disputed in the thread. Beyond that, though, Neil Williams (who is the maintainer of vmdebootstrap) [provided some][8] explanation for the switch away from Debian Live: - -``` -vmdebootstrap is being extended explicitly to provide support for a replacement for live-build. This work is happening within the debian-cd team to be able to solve the existing problems with live-build. These problems include reliability issues, lack of multiple architecture support and lack of UEFI support. vmdebootstrap has all of these, we do use support from live-boot and live-config as these are out of the scope for vmdebootstrap. -``` - -Those seem like legitimate complaints, but ones that could have been fixed within the existing project. Instead, though, something of a stealth project was evidently undertaken to replace live-build. As Baumann [pointed out][9], nothing was posted to the debian-live mailing list about the plans. The ITP was the first notice that anyone from the Debian Live project got about the plans, so it all looks like a "secret plan"—something that doesn't sit well in a project like Debian. - -As might be guessed, there were multiple postings that supported Baumann's request to rename "live-build-ng", followed by many that expressed dismay at his decision to stop working on Debian Live. But Learmonth and Williams were adamant that replacing live-build is needed. Learmonth did [rename][10] live-build-ng to a perhaps less confrontational name: live-wrapper. He noted that his aim had been to add the new tool to the Debian Live project (and "bring the Debian Live project into Debian"), but things did not play out that way. - -``` -I apologise to everyone that has been upset by the ITP bug. The software is not yet ready for use as a full replacement for live-build, and it was filed to let people know that the work was ongoing and to collect feedback. This sort of worked, but the feedback wasn't the kind I was looking for. -``` - -The backlash could perhaps have been foreseen. Communication is a key aspect of free-software communities, so a plan to replace the guts of a project seems likely to be controversial—more so if it is kept under wraps. For his part, Baumann has certainly not been perfect—he delayed the "wheezy" release by [uploading an unsuitable syslinux package][11] and [dropped down][12] from a Debian Developer to a Debian Maintainer shortly thereafter—but that doesn't mean he deserves this kind of treatment. There are others involved in the project as well, of course, so it is not just Baumann who is affected. - -One of those other people is Ben Armstrong, who has been something of a diplomat during the event and has tried to smooth the waters. He started with a [post][13] that celebrated the project and what Baumann and the team had accomplished over the years. As he noted, the [list of downstream projects][14] for Debian Live is quite impressive. In another post, he also [pointed out][15] that the project is not dead: - -``` -If the Debian CD team succeeds in their efforts and produces a replacement that is viable, reliable, well-tested, and a suitable candidate to replace live-build, this can only be good for Debian. If they are doing their job, they will not "[replace live-build with] an officially improved, unreliable, little-tested alternative". I've seen no evidence so far that they operate that way. And in the meantime, live-build remains in the archive -- there is no hurry to remove it, so long as it remains in good shape, and there is not yet an improved successor to replace it. -``` - -On November 24, Armstrong also [posted][16] an update (and to [his blog][17]) on Debian Live. It shows some good progress made in the two weeks since Baumann's exit; there are even signs of collaboration between the project and the live-wrapper developers. There is also a [to-do list][18], as well as the inevitable call for more help. That gives reason to believe that all of the drama surrounding the project was just a glitch—avoidable, perhaps, but not quite as dire as it might have seemed. - - ---------------------------------- - -via: https://lwn.net/Articles/665839/ - -作者:Jake Edge -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - - -[1]: https://lwn.net/Articles/666127/ -[2]: http://live.debian.net/ -[3]: https://www.debian.org/News/weekly/2006/08/ -[4]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804315 -[5]: http://liw.fi/vmdebootstrap/ -[6]: https://lwn.net/Articles/666173/ -[7]: https://lwn.net/Articles/666176/ -[8]: https://lwn.net/Articles/666181/ -[9]: https://lwn.net/Articles/666208/ -[10]: https://lwn.net/Articles/666321/ -[11]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=699808 -[12]: https://nm.debian.org/public/process/14450 -[13]: https://lwn.net/Articles/666336/ -[14]: http://live.debian.net/project/downstream/ -[15]: https://lwn.net/Articles/666338/ -[16]: https://lwn.net/Articles/666340/ -[17]: http://syn.theti.ca/2015/11/24/debian-live-after-debian-live/ -[18]: https://wiki.debian.org/DebianLive/TODO diff --git a/translated/20151227 Upheaval in the Debian Live project.md b/translated/20151227 Upheaval in the Debian Live project.md new file mode 100644 index 0000000000..7d03ce831a --- /dev/null +++ b/translated/20151227 Upheaval in the Debian Live project.md @@ -0,0 +1,83 @@ +Debian Live项目的剧变 + +围绕Debian Live 项目发生了很多戏剧性事件,但是有一个关于Debian Live项目][1]结束的[公告][2],它比项目第一次出现的时候影响力还小。这个项目的创始人退出必定是有原因的,社区对他的待遇和项目的收效是很令人沮丧的,但是这个项目还是会以其他的形式继续下去。所以Debian仍然会有很多的工具去在创造启动光盘和其他介质的道路上继续向前。项目创始人Dabiel Baumann和Debian CD团队以及安装检测团队之间出现的长期争论已经被"解决"了,尽管是用这样一种有遗憾的方式。                                      + +在11月9日,Baumann发表了题为"Dabian Live项目的突然结束"的一篇公告。在那篇短文中,他一一列举出了自从这个和他有关的[项目被发起][3]以来10间发生的不同的事件,可以表明他在Debian Live项目上的努力一直没有被重视,至少从这些方面。最具决定性的因素是因为在"包的含义"上存在冲突,R.Learmonth[申请][4]了新的包名,而这却侵犯了在Debian Live上使用的命名空间。 + +考虑到最主要的Debian Live包之一被命名为"live-build",而新的包名却叫"live-build-ng",这简直是对"live-build"的挑战。live-build-ng意为一种围绕[vmdebootstrap][5]【译者注:创造真实的和虚拟机Debian的磁盘映像】工具的外部包装,这种包装是为了创造live介质(光盘和USB的插入),也是Debian Live最需要的的部分。但是当 Baumann Learmonth[要求][6]为他的包换一个不同的名字的时候,他得到了一个“有趣”的[回复][7]: + +``` + +live-build不是一个Debian项目,这件事应该受到我们的关注,它是一个外部的项目。但是社区要求它成为一个官方的Debian项目,这件事需要我们敲定。 +这不是命名空间的问题,我们要将以目前维护的live配置和live启动包为基础,把它加入到Debian的本地项目。如果迫不得已的话,这将会有很多分支,但是我希望它不要发生,这样的话我们就可以把这些包整合到Debian中继续以一种协作的方式去开发。 +live-build已经被debian-cd放弃,live-build-ng将会取代它。至少在一个精简的Debian环境中,live-build会被放弃。live-build-ng将要通过debian-cd和Debian安装者合作的方式去开发。 +``` + + + +Debian Live 是一个“官方的”Debian项目(或者可以狭义的"官方"),尽管它因为思路上的不同产生过争论.除此之外,vmdebootstrap的维护者Neil Willians为脱离Debian Live项目[提供了如下的解释][8]: + +``` + +为了更好的支持live-build的代替者,vmdebootstrap肯定会被推广。这项工作会由debian-cd团队来负责,debian-cd能够用live-build解决目前存在的问题。 这些问题包括可靠性问题,以及不能很好的支持多种机器和UEFI等。 vmdebootstrap也存在着这些问题,我们用来自于对live-boot和live-config的支持情况来确定vmdebootstrap的功能。 +``` + + + +这些想要取代"live-build"的说辞看起来有道理,但是目前的项目存在的上述问题已经得到了初步解决。相反的,一些秘密的项目很明显的意图是取代live-build。正如Baumann[指出][9]的,这些计划没有被加入到debian-live的邮件列表中。人们可以从Debian Live项目中得到这些计划的信息也是因为这一次的ITP事件。所以它看起来像是一个"秘密计划"—有些东西在一个像Debian这样的项目中不能很好的安排。 + +人们可能已经猜到了,有很多帖子都支持Baumann[重命名][10]"live-build-ng"的请求,但是紧跟着,人们就因为他要停止在Debian Live 上继续工作的决定而变得沮丧。但是Learmonth 和 Williams却坚定不移,他们两人都是取代live-build所需要的开发者。Learmonth 给“live-build-ng”换了一个新的有很少争议性的名字:Live-wrapper。他说他的目标是为Debian Live项目加入新的工具(并且“把Debian Live 项目引入Debian里面),但是完成这件事还需要很大的努力。 + + +``` + +我向已经被ITP问题所困扰的每个人道歉。作为live-build的取代者,live-wrapper这个软件的稳定性还很差,为了让人们知道工作的进展同时收集反馈,它已经被存档。虽然有了这部分的工作,但是收到的反馈并不是我所需要的。 +``` + +这种对于取代live-build的强烈的反对或许已经被预知到了。自由软件社区的沟通和交流很关键,所以,替换一个项目核心的计划是很有争议的——更何况这个计划一直不被人们所知。从Banumann的角度来说,他当然不是完美的,他通过上传和下载一个不合适的[syslinux包][11]来延迟“wheezy”的发布,并且从那以后他从一个Debian发起人[成为][12]了一个Debian维护者。——但是他也不应该受到这种对待。当然,这个项目还有其他人参与,所以不仅仅是Baumann受到了影响。 + +Ben Armstrong是这些人中的其中之一,在这个事件中,他很圆滑地处理了一些事,并且想从这个事件中全身而退。他从一个邮件[13]开始,这个邮件是为了庆祝这个项目以及他和他的团队在过去几年完成的一些工作。正如他所说,这种基于Debian Live的[下流项目列表][14]是很令人振奋的。在另一个邮件中,他也[指出][15]了这个项目不是没有生命力的: + + +``` + +如果Debian CD开发团队通过他们的努力获得成功,这样产品的替换就会是可行的、可靠的、利于测试的,同时有一个合适的候选者去取代live-build,这对于Debian项目有利无害。如果他们继续做这件事,他们不会“用一个官方改良的,不可靠的,几乎没有测试的待选者取代live-build”。到目前为止,我还没有看到他们那样做。其间,live-build仍在存档,没有很快删除,它仍然处于良好状态,并没有一种改进的继任者来取代它。 +``` + + +11月24号,Armstrong也在[他的博客][16]上[发布][17]了一个有关Debian Live的新消息。它展示了自从 Baumann退出后两周内的让人高兴的进展。可以说是在这个项目和live-wrapper开发者之间产生合作的里程碑。博客上也有了一个[计划表][18],同时不可避免地寻求更多的帮助。他也列举了一些理由,试图让人们相信围绕项目发生的戏剧性事件仅仅是一个可以避免的小问题,而不是像现在这样。 + + + + + + +--------------------------------- + +via: https://lwn.net/Articles/665839/ + +作者:Jake Edge +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + + +[1]: https://lwn.net/Articles/666127/ +[2]: http://live.debian.net/ +[3]: https://www.debian.org/News/weekly/2006/08/ +[4]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804315 +[5]: http://liw.fi/vmdebootstrap/ +[6]: https://lwn.net/Articles/666173/ +[7]: https://lwn.net/Articles/666176/ +[8]: https://lwn.net/Articles/666181/ +[9]: https://lwn.net/Articles/666208/ +[10]: https://lwn.net/Articles/666321/ +[11]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=699808 +[12]: https://nm.debian.org/public/process/14450 +[13]: https://lwn.net/Articles/666336/ +[14]: http://live.debian.net/project/downstream/ +[15]: https://lwn.net/Articles/666338/ +[16]: https://lwn.net/Articles/666340/ +[17]: http://syn.theti.ca/2015/11/24/debian-live-after-debian-live/ +[18]: https://wiki.debian.org/DebianLive/TODO From a73783565ee232e15ebaaf91e4d84c5dd7867032 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 30 Apr 2016 23:28:56 +0800 Subject: [PATCH 0650/1469] =?UTF-8?q?20160430-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...9 Master OpenStack with 5 new tutorials.md | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 sources/tech/20160429 Master OpenStack with 5 new tutorials.md diff --git a/sources/tech/20160429 Master OpenStack with 5 new tutorials.md b/sources/tech/20160429 Master OpenStack with 5 new tutorials.md new file mode 100644 index 0000000000..34ef86c06a --- /dev/null +++ b/sources/tech/20160429 Master OpenStack with 5 new tutorials.md @@ -0,0 +1,37 @@ +Master OpenStack with 5 new tutorials +======================================= + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/education/EDUCATION_tools.png?itok=ybxr0Qe9) + + +Returning from OpenStack Summit this week, I am reminded of just how vast the open source cloud ecosystem is and just how many different projects and concepts you need to be familiar with in order to succeed. Although, we're actually quite fortunate with the resources available for keeping up. In addition to the [official documentation][1], many great educational tools are out there, from third party training and certification, to in-person events, and many community-contributed tutorials as well. + +To help you stay on top of things, every month we round up a collection of new tutorials, how-tos, guides, and tips created by the OpenStack community. Here are some of the great pieces published this past month. + +- First up, if you're looking for a (reasonably) affordable home OpenStack test lab, the Intel NUC is a great platform to consider. Small in form factor, but reasonably well-powered, you can get a literal stack of them running OpenStack pretty quickly with this guide to using [TripleO to deploy OpenStack][2] on the NUC, and read about some common quirks to watch out for. +- After you've been running OpenStack for a while, the various processes keeping your cloud alive have probably generated quite a pile of log files. While some are probably safe to purge, you still need to have a plan for managing them. Here are some [quick thoughts][3] on managing logs in Ceilometer after nine-months in to a production deployment. +- The OpenStack infrastructure project can be an intimidating place for a newcomer just trying to land a patch. What's a gate job, what's a test, and what are all of these steps my commit is going through? Get a quick overview of the whole process from Arie Bregman in this [handy blog post][4]. +- Compute hosts fail occasionally, and whether the cause is hardware or software, the good news is that OpenStack makes it easy to migrate your running instance to another host. However, some people have found the commands to perform this migration a little confusing. Learn the difference between the migrate and evacuate commands in plain English in [this great writeup][5]. +- Network Functions Virtualization technologies require some functionality from OpenStack that are outside of what other users might be familiar with. For example, SR-IOV and PCI passthrough are ways of exposing physical hardware directly for maximizing performance. Learn the [steps involved][6] to make this happen within an OpenStack deployment. + +That wraps up our collection for this month, but if you're still looking for more, be sure to check out our past archive of [OpenStack tutorials][7] for even more learning resources. And if there's a tutorial or guide you think we ought to include in our next roundup, be sure to let us know in the comments below. + +------------------------------------------------------------------------------ + +via: https://opensource.com/business/16/4/master-openstack-new-tutorials + +作者:[Jason Baker][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jason-baker + +[1]: http://docs.openstack.org/ +[2]: http://acksyn.org/posts/2016/03/tripleo-on-nucs/ +[3]: http://silverskysoft.com/open-stack-xwrpr/2016/03/long-term-openstack-usage-summary/ +[4]: http://abregman.com/2016/03/05/openstack-infra-jenkins-jobs/ +[5]: http://www.danplanet.com/blog/2016/03/03/evacuate-in-nova-one-command-to-confuse-us-all/ +[6]: https://trickycloud.wordpress.com/2016/03/28/openstack-for-nfv-applications-sr-iov-and-pci-passthrough/ +[7]: https://opensource.com/resources/openstack-tutorials From bd6963ce0ed88f5e6fae09708d719fe0f243d5ab Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 30 Apr 2016 23:37:32 +0800 Subject: [PATCH 0651/1469] =?UTF-8?q?20160430-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...hy and how I became a software engineer.md | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 sources/tech/20160429 Why and how I became a software engineer.md diff --git a/sources/tech/20160429 Why and how I became a software engineer.md b/sources/tech/20160429 Why and how I became a software engineer.md new file mode 100644 index 0000000000..722464168f --- /dev/null +++ b/sources/tech/20160429 Why and how I became a software engineer.md @@ -0,0 +1,101 @@ +Why and how I became a software engineer +========================================== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/myopensourcestory.png?itok=6TXlAkFi) + +The year was 1989. The city was Kampala, Uganda. + +In their infinite wisdom, my parents decided that instead of all the troublemaking I was getting into at home, they would send me off to my uncle's office to learn how to use a computer. A few days later, I found myself on the 21st floor in a cramped room with six or seven other teens and a brand new computer on a desk perpendicular to the teacher's desk. It was made abundantly clear that we were not skilled enough to touch it. After three frustrating weeks of writing and perfecting DOS commands, the magic moment happened. It was my turn to type **copy doc.txt d:**. + +The alien scratching noises that etched a simple text file onto the five-inch floppy sounded like beautiful music. For a while, that floppy disk was my most prized possession. I copied everything I could onto it. However, in 1989, Ugandans tended to take life pretty seriously, and messing around with computers, copying files, and formatting disks did not count as serious. I had to focus on my education, which led me away from computer science and into architectural engineering. + +Like any young person of my generation, a multitude of job titles and skills acquisition filled the years in between. I taught kindergarten, taught adults how to use software, worked in a clothing store, and served as a paid usher in a church. While I earned my degree at the University of Kansas, I worked as a tech assistant to the technical administrator, which is really just a fancy title for someone who messes around with the student database. + +By the time I graduated in 2007, technology had become inescapable. Every aspect of architectural engineering was deeply intertwined with computer science, so we all inadvertently learned simple programming skills. For me, that part was always more fascinating. But because I had to be a serious engineer, I developed a secret hobby: writing science fiction. + +In my stories, I lived vicariously through the lives of my heroines. They were scientists with amazing programming skills who were always getting embroiled in adventures and fighting tech scallywags with technology they invented, sometimes inventing them on the spot. Sometimes the new tech I came up with was based on real-world inventions. Other times it was the stuff I read about or saw in the science fiction I consumed. This meant that I had to understand how the tech worked and my research led me to some interesting subreddits and e-zines. + +### Open source: The ultimate goldmine + +Throughout my experiences, the fascinating weeks I'd spent writing out DOS commands remained a prominent influence, bleeding into little side projects and occupying valuable study time. As soon as Geocities became available to all Yahoo! Users, I created a website where I published blurry pictures that I'd taken on a tiny digital camera. I created websites for free, helped friends and family fix issues they had with their computers, and created a library database for a church. + +This meant that I was always researching and trying to find more information about how things could be made better. The Internet gods blessed me and open source fell into my lap. Suddenly, 30-day trials and restrictive licenses became a ghost of computing past. I could continue to create using GIMP, Inkscape, and OpenOffice. + +### Time to get serious + +I was fortunate to have a business partner who saw the magic in my stories. She too is a dreamer and visionary who imagines a better connected world that functions efficiently and conveniently. Together, we came up with several solutions to pain points we experienced in the journey to success, but implementation had been a problem. We both lacked the skills to make our products come to life, something that was made evident every time we approached investors with our ideas. + +We needed to learn to program. So, at the end of the summer in 2015, we embarked on a journey that would lead us right to the front steps of Holberton School, a community-driven, project-based school in San Francisco. + +My business partner came to me one morning and started a conversation the way she does when she has a new crazy idea that I'm about to get sucked into. + +**Zee**: Gloria, I'm going to tell you something and I want you to listen first before you say no. + +**Me**: No. + +**Zee**: We're going to be applying to go to a school for full-stack engineers. + +**Me**: What? + +**Zee**: Here, look! We're going to learn how to program by applying to this school. + +**Me**: I don't understand. We're doing online courses in Python and... + +**Zee**: This is different. Trust me. + +**Me**: What about the... + +**Zee**: That's not trusting me. + +**Me**: Fine. Show me. + +### Removing the bias + +What I read sounded similar to something we had seen online. It was too good to be true, but we decided to give it a try, jump in with both feet, and see what would come out of it. + +To become students, we had to go through a four-step selection process based solely on talent and motivation, not on the basis of educational degree or programming experience. The selection process is the beginning of the curriculum, so we started learning and collaborating through it. + +It has been my experience—and that of my business partner—that the process of applying for anything was an utter bore compared to the application process Holberton School created. It was like a game. If you completed a challenge, you got to go to the next level, where another fascinating challenge awaited. We created Twitter accounts, blogged on Medium, learned HTML and CSS in order to create a website, and created a vibrant community online even before we knew who was going to get to go. + +The most striking thing about the online community was how varied our experience with computers was, and how our background and gender did not factor into the choices that were being made by the founders (who we secretly called "The Trinity"). We just enjoyed being together and talking to each other. We were all smart people on a journey to increasing our nerd cred by learning how to code. + +For much of the application process, our identities were not very evident. For example, my business partner's name does not indicate her gender or race. It was during the final step, a video chat, that The Trinity even knew she was a woman of color. Thus far, only her enthusiasm and talent had propelled her through the levels. The color of her skin and her gender did not hinder nor help her. How cool is that? + +The night we got our acceptance letters, we knew our lives were about to change in ways we had only dreamt of. On the 22nd of January 2016, we walked into 98 Battery Street to meet our fellow [Hippokampoiers][2] for the first time. It was evident then, as it had been before, that the Trinity had started something amazing. They had assembled a truly diverse collection of passionate and enthusiastic people who had dedicated themselves to become full-stack engineers. + +The school is an experience like no other. Every day is an intense foray into some facet of programming. We're handed a project and, with a little guidance, we use every resource available to us to find the solution. The premise that [Holberton School][1] is built upon is that information is available to us in more places than we've ever had before. MOOCs, tutorials, the availability of open source software and projects, and online communities are all bursting at the seams with knowledge that shakes up some of the projects we have to complete. And with the support of the invaluable team of mentors to guide us to solutions, the school becomes more than just a school; we've become a community of learners. I would highly recommend this school for anyone who is interested in software engineering and is also interested in the learning style. The next class is in October 2016 and is accepting new applications. It's both terrifying and exhilarating, but so worth it. + +### Open source matters + +My earliest experience with an open source operating system was [Fedora][3], a [Red Hat][4]-sponsored project. During a panicked conversation with an IRC member, she recommended this free OS. I had never installed my own OS before, but it sparked my interest in open source and my dependence on open source software for my computing needs. We are advocates for open source contribution, creation, and use. Our projects are on GitHub where anyone can use or contribute to them. We also have the opportunity to access existing open source projects to use or contribute to in our own way. Many of the tools that we use at school are open source, such as Fedora, [Vagrant][5], [VirtualBox][6], [GCC][7], and [Discourse][8], to name a few. + +As I continue on my journey to becoming a software engineer, I still dream of a time when I will be able to contribute to the open source community and be able to share my knowledge with others. + +### Diversity Matters + +Standing in the room and talking to 29 other bright-eyed learners was intoxicating. 40% of the people there were women and 44% were people of color. These numbers become very important when you are a woman of color in a field that has been famously known for its lack of diversity. It was an oasis in the tech Mecca of the world. I knew I had arrived. + +The notion of becoming a full-stack engineer is daunting, and you may even struggle to know what that means. It is a challenging road to travel with immeasurable rewards to reap. The future is run by technology, and you are an important part of that bright future. While the media continues to trip over handling the issue of diversity in tech companies, know that whoever you are, whatever your background is, whatever your reasons might be for becoming a full-stack engineer, you can find a place to thrive. + +But perhaps most importantly, a strong reminder of the role of women in the history of computing can help more women return to the tech world, and they can be fully engaged without hesitation due to their gender or their capabilities as women. Their talents will help shape the future not just of tech, but of the world. + + +------------------------------------------------------------------------------ + +via: https://opensource.com/life/16/4/my-open-source-story-gloria-bwandungi + +作者:[Gloria Bwandungi][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/nappybrain +[1]: https://www.holbertonschool.com/ +[2]: https://twitter.com/hippokampoiers +[3]: https://en.wikipedia.org/wiki/Fedora_(operating_system) +[4]: https://www.redhat.com/ +[5]: https://www.vagrantup.com/ +[6]: https://www.virtualbox.org/ +[7]: https://gcc.gnu.org/ +[8]: https://www.discourse.org/ From 7a63d4d8ae261a266b71bd30f08101e2dc8cafc3 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Sun, 1 May 2016 13:52:31 +0800 Subject: [PATCH 0652/1469] Translating sources/tech/LFCS/Part 14 - Monitor Linux Processes Resource Usage and Set Process Limits on a Per-User Basis.md --- ... Resource Usage and Set Process Limits on a Per-User Basis.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/LFCS/Part 14 - Monitor Linux Processes Resource Usage and Set Process Limits on a Per-User Basis.md b/sources/tech/LFCS/Part 14 - Monitor Linux Processes Resource Usage and Set Process Limits on a Per-User Basis.md index 82bb9b4a74..877a3ee12f 100644 --- a/sources/tech/LFCS/Part 14 - Monitor Linux Processes Resource Usage and Set Process Limits on a Per-User Basis.md +++ b/sources/tech/LFCS/Part 14 - Monitor Linux Processes Resource Usage and Set Process Limits on a Per-User Basis.md @@ -1,3 +1,4 @@ +ictlyh Translating Part 14 - Monitor Linux Processes Resource Usage and Set Process Limits on a Per-User Basis ============================================================================================= From 9c36452fa1f917f1423771db805c7521ab12160f Mon Sep 17 00:00:00 2001 From: ictlyh Date: Sun, 1 May 2016 18:24:25 +0800 Subject: [PATCH 0653/1469] Translated translated/tech/LFCS/Part 14 - Monitor Linux Processes Resource Usage and Set Process Limits on a Per-User Basis.md --- ... Set Process Limits on a Per-User Basis.md | 274 ----------------- ... Set Process Limits on a Per-User Basis.md | 275 ++++++++++++++++++ 2 files changed, 275 insertions(+), 274 deletions(-) delete mode 100644 sources/tech/LFCS/Part 14 - Monitor Linux Processes Resource Usage and Set Process Limits on a Per-User Basis.md create mode 100644 translated/tech/LFCS/Part 14 - Monitor Linux Processes Resource Usage and Set Process Limits on a Per-User Basis.md diff --git a/sources/tech/LFCS/Part 14 - Monitor Linux Processes Resource Usage and Set Process Limits on a Per-User Basis.md b/sources/tech/LFCS/Part 14 - Monitor Linux Processes Resource Usage and Set Process Limits on a Per-User Basis.md deleted file mode 100644 index 877a3ee12f..0000000000 --- a/sources/tech/LFCS/Part 14 - Monitor Linux Processes Resource Usage and Set Process Limits on a Per-User Basis.md +++ /dev/null @@ -1,274 +0,0 @@ -ictlyh Translating -Part 14 - Monitor Linux Processes Resource Usage and Set Process Limits on a Per-User Basis -============================================================================================= - -Because of the changes in the LFCS exam requirements effective Feb. 2, 2016, we are adding the necessary topics to the [LFCS series][1] published here. To prepare for this exam, your are highly encouraged to use the [LFCE series][2] as well. - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Linux-Process-Monitoring-Set-Process-Limits-Per-User.png) ->Monitor Linux Processes and Set Process Limits Per User – Part 14 - -Every Linux system administrator needs to know how to verify the integrity and availability of hardware, resources, and key processes. In addition, setting resource limits on a per-user basis must also be a part of his / her skill set. - -In this article we will explore a few ways to ensure that the system both hardware and the software is behaving correctly to avoid potential issues that may cause unexpected production downtime and money loss. - -### Linux Reporting Processors Statistics - -With **mpstat** you can view the activities for each processor individually or the system as a whole, both as a one-time snapshot or dynamically. - -In order to use this tool, you will need to install **sysstat**: - -``` -# yum update && yum install sysstat [On CentOS based systems] -# aptitutde update && aptitude install sysstat [On Ubuntu based systems] -# zypper update && zypper install sysstat [On openSUSE systems] -``` - -Read more about sysstat and it’s utilities at [Learn Sysstat and Its Utilities mpstat, pidstat, iostat and sar in Linux][3] - -Once you have installed **mpstat**, use it to generate reports of processors statistics. - -To display **3** global reports of CPU utilization (`-u`) for all CPUs (as indicated by `-P` ALL) at a 2-second interval, do: - -``` -# mpstat -P ALL -u 2 3 -``` - -### Sample Output - -``` -Linux 3.19.0-32-generic (tecmint.com) Wednesday 30 March 2016 _x86_64_ (4 CPU) - -11:41:07 IST CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle -11:41:09 IST all 5.85 0.00 1.12 0.12 0.00 0.00 0.00 0.00 0.00 92.91 -11:41:09 IST 0 4.48 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 94.53 -11:41:09 IST 1 2.50 0.00 0.50 0.00 0.00 0.00 0.00 0.00 0.00 97.00 -11:41:09 IST 2 6.44 0.00 0.99 0.00 0.00 0.00 0.00 0.00 0.00 92.57 -11:41:09 IST 3 10.45 0.00 1.99 0.00 0.00 0.00 0.00 0.00 0.00 87.56 - -11:41:09 IST CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle -11:41:11 IST all 11.60 0.12 1.12 0.50 0.00 0.00 0.00 0.00 0.00 86.66 -11:41:11 IST 0 10.50 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 88.50 -11:41:11 IST 1 14.36 0.00 1.49 2.48 0.00 0.00 0.00 0.00 0.00 81.68 -11:41:11 IST 2 2.00 0.50 1.00 0.00 0.00 0.00 0.00 0.00 0.00 96.50 -11:41:11 IST 3 19.40 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 79.60 - -11:41:11 IST CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle -11:41:13 IST all 5.69 0.00 1.24 0.00 0.00 0.00 0.00 0.00 0.00 93.07 -11:41:13 IST 0 2.97 0.00 1.49 0.00 0.00 0.00 0.00 0.00 0.00 95.54 -11:41:13 IST 1 10.78 0.00 1.47 0.00 0.00 0.00 0.00 0.00 0.00 87.75 -11:41:13 IST 2 2.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 97.00 -11:41:13 IST 3 6.93 0.00 0.50 0.00 0.00 0.00 0.00 0.00 0.00 92.57 - -Average: CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle -Average: all 7.71 0.04 1.16 0.21 0.00 0.00 0.00 0.00 0.00 90.89 -Average: 0 5.97 0.00 1.16 0.00 0.00 0.00 0.00 0.00 0.00 92.87 -Average: 1 9.24 0.00 1.16 0.83 0.00 0.00 0.00 0.00 0.00 88.78 -Average: 2 3.49 0.17 1.00 0.00 0.00 0.00 0.00 0.00 0.00 95.35 -Average: 3 12.25 0.00 1.16 0.00 0.00 0.00 0.00 0.00 0.00 86.59 -``` - -To view the same statistics for a specific **CPU** (**CPU 0** in the following example), use: - -``` -# mpstat -P 0 -u 2 3 -``` - -### Sample Output - -``` -Linux 3.19.0-32-generic (tecmint.com) Wednesday 30 March 2016 _x86_64_ (4 CPU) - -11:42:08 IST CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle -11:42:10 IST 0 3.00 0.00 0.50 0.00 0.00 0.00 0.00 0.00 0.00 96.50 -11:42:12 IST 0 4.08 0.00 0.00 2.55 0.00 0.00 0.00 0.00 0.00 93.37 -11:42:14 IST 0 9.74 0.00 0.51 0.00 0.00 0.00 0.00 0.00 0.00 89.74 -Average: 0 5.58 0.00 0.34 0.85 0.00 0.00 0.00 0.00 0.00 93.23 -``` - -The output of the above commands shows these columns: - -* `CPU`: Processor number as an integer, or the word all as an average for all processors. -* `%usr`: Percentage of CPU utilization while running user level applications. -* `%nice`: Same as `%usr`, but with nice priority. -* `%sys`: Percentage of CPU utilization that occurred while executing kernel applications. This does not include time spent dealing with interrupts or handling hardware. -* `%iowait`: Percentage of time when the given CPU (or all) was idle, during which there was a resource-intensive I/O operation scheduled on that CPU. A more detailed explanation (with examples) can be found [here][4]. -* `%irq`: Percentage of time spent servicing hardware interrupts. -* `%soft`: Same as `%irq`, but with software interrupts. -* `%steal`: Percentage of time spent in involuntary wait (steal or stolen time) when a virtual machine, as guest, is “winning” the hypervisor’s attention while competing for the CPU(s). This value should be kept as small as possible. A high value in this field means the virtual machine is stalling – or soon will be. -* `%guest`: Percentage of time spent running a virtual processor. -* `%idle`: percentage of time when CPU(s) were not executing any tasks. If you observe a low value in this column, that is an indication of the system being placed under a heavy load. In that case, you will need to take a closer look at the process list, as we will discuss in a minute, to determine what is causing it. - -To put the place the processor under a somewhat high load, run the following commands and then execute mpstat (as indicated) in a separate terminal: - -``` -# dd if=/dev/zero of=test.iso bs=1G count=1 -# mpstat -u -P 0 2 3 -# ping -f localhost # Interrupt with Ctrl + C after mpstat below completes -# mpstat -u -P 0 2 3 -``` - -Finally, compare to the output of **mpstat** under “normal” circumstances: - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Report-Processors-Related-Statistics.png) ->Report Linux Processors Related Statistics - -As you can see in the image above, **CPU 0** was under a heavy load during the first two examples, as indicated by the `%idle` column. - -In the next section we will discuss how to identify these resource-hungry processes, how to obtain more information about them, and how to take appropriate action. - -### Reporting Linux Processes - -To list processes sorting them by CPU usage, we will use the well known `ps` command with the `-eo` (to select all processes with user-defined format) and `--sort` (to specify a custom sorting order) options, like so: - -``` -# ps -eo pid,ppid,cmd,%cpu,%mem --sort=-%cpu -``` - -The above command will only show the `PID`, `PPID`, the command associated with the process, and the percentage of CPU and RAM usage sorted by the percentage of CPU usage in descending order. When executed during the creation of the .iso file, here’s the first few lines of the output: - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Find-Linux-Processes-By-CPU-Usage.png) ->Find Linux Processes By CPU Usage - -Once we have identified a process of interest (such as the one with `PID=2822`), we can navigate to `/proc/PID` (`/proc/2822` in this case) and do a directory listing. - -This directory is where several files and subdirectories with detailed information about this particular process are kept while it is running. - -#### For example: - -* `/proc/2822/io` contains IO statistics for the process (number of characters and bytes read and written, among others, during IO operations). -* `/proc/2822/attr/current` shows the current SELinux security attributes of the process. -* `/proc/2822/cgroup` describes the control groups (cgroups for short) to which the process belongs if the CONFIG_CGROUPS kernel configuration option is enabled, which you can verify with: - -``` -# cat /boot/config-$(uname -r) | grep -i cgroups -``` - -If the option is enabled, you should see: - -``` -CONFIG_CGROUPS=y -``` - -Using `cgroups` you can manage the amount of allowed resource usage on a per-process basis as explained in Chapters 1 through 4 of the [Red Hat Enterprise Linux 7 Resource Management guide][5], in Chapter 9 of the [openSUSE System Analysis and Tuning guide][6], and in the [Control Groups section of the Ubuntu 14.04 Server documentation][7]. - -The `/proc/2822/fd` is a directory that contains one symbolic link for each file descriptor the process has opened. The following image shows this information for the process that was started in tty1 (the first terminal) to create the **.iso** image: - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Find-Linux-Process-Information.png) ->Find Linux Process Information - -The above image shows that **stdin** (file descriptor **0**), **stdout** (file descriptor **1**), and **stderr** (file descriptor **2**) are mapped to **/dev/zero**, **/root/test.iso**, and **/dev/tty1**, respectively. - -More information about `/proc` can be found in “The `/proc` filesystem” document kept and maintained by Kernel.org, and in the Linux Programmer’s Manual. - -### Setting Resource Limits on a Per-User Basis in Linux - -If you are not careful and allow any user to run an unlimited number of processes, you may eventually experience an unexpected system shutdown or get locked out as the system enters an unusable state. To prevent this from happening, you should place a limit on the number of processes users can start. - -To do this, edit **/etc/security/limits.conf** and add the following line at the bottom of the file to set the limit: - -``` -* hard nproc 10 -``` - -The first field can be used to indicate either a user, a group, or all of them `(*)`, whereas the second field enforces a hard limit on the number of process (nproc) to **10**. To apply changes, logging out and back in is enough. - -Thus, let’s see what happens if a certain user other than root (either a legitimate one or not) attempts to start a shell fork bomb. If we had not implemented limits, this would initially launch two instances of a function, and then duplicate each of them in a neverending loop. Thus, it would eventually bringing your system to a crawl. - -However, with the above restriction in place, the fork bomb does not succeed but the user will still get locked out until the system administrator kills the process associated with it: - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Shell-Fork-Bomb.png) ->Run Shell Fork Bomb - -**TIP**: Other possible restrictions made possible by **ulimit** are documented in the `limits.conf` file. - -### Linux Other Process Management Tools - -In addition to the tools discussed previously, a system administrator may also need to: - -**a)** Modify the execution priority (use of system resources) of a process using **renice**. This means that the kernel will allocate more or less system resources to the process based on the assigned priority (a number commonly known as “**niceness**” in a range from `-20` to `19`). - -The lower the value, the greater the execution priority. Regular users (other than root) can only modify the niceness of processes they own to a higher value (meaning a lower execution priority), whereas root can modify this value for any process, and may increase or decrease it. - -The basic syntax of renice is as follows: - -``` -# renice [-n] identifier -``` - -If the argument after the new priority value is not present (empty), it is set to PID by default. In that case, the niceness of process with **PID=identifier** is set to ``. - -**b)** Interrupt the normal execution of a process when needed. This is commonly known as [“killing” the process][9]. Under the hood, this means sending the process a signal to finish its execution properly and release any used resources in an orderly manner. - -To [kill a process][10], use the **kill** command as follows: - -``` -# kill PID -``` - -Alternatively, you can use [pkill to terminate all processes][11] of a given owner `(-u)`, or a group owner `(-G)`, or even those processes which have a PPID in common `(-P)`. These options may be followed by the numeric representation or the actual name as identifier: - -``` -# pkill [options] identifier -``` - -For example, - -``` -# pkill -G 1000 -``` - -will kill all processes owned by group with `GID=1000`. - -And, - -``` -# pkill -P 4993 -``` - -will kill all processes whose `PPID is 4993`. - -Before running a `pkill`, it is a good idea to test the results with `pgrep` first, perhaps using the `-l` option as well to list the processes’ names. It takes the same options but only returns the PIDs of processes (without taking any further action) that would be killed if `pkill` is used. - -``` -# pgrep -l -u gacanepa -``` - -This is illustrated in the next image: - -![](http://www.tecmint.com/wp-content/uploads/2016/03/List-User-Running-Processes.png) ->Find User Running Processes in Linux - -### Summary - -In this article we have explored a few ways to monitor resource usage in order to verify the integrity and availability of critical hardware and software components in a Linux system. - -We have also learned how to take appropriate action (either by adjusting the execution priority of a given process or by terminating it) under unusual circumstances. - -We hope the concepts explained in this tutorial have been helpful. If you have any questions or comments, feel free to reach us using the contact 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/installing-network-services-and-configuring-services-at-system-boot/ -[3]: http://www.tecmint.com/sysstat-commands-to-monitor-linux/ -[4]: http://veithen.github.io/2013/11/18/iowait-linux.html -[5]: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Resource_Management_Guide/index.html -[6]: https://doc.opensuse.org/documentation/leap/tuning/html/book.sle.tuning/cha.tuning.cgroups.html -[7]: https://help.ubuntu.com/lts/serverguide/cgroups.html -[8]: http://man7.org/linux/man-pages/man5/proc.5.html -[9]: http://www.tecmint.com/kill-processes-unresponsive-programs-in-ubuntu/ -[10]: http://www.tecmint.com/find-and-kill-running-processes-pid-in-linux/ -[11]: http://www.tecmint.com/how-to-kill-a-process-in-linux/ diff --git a/translated/tech/LFCS/Part 14 - Monitor Linux Processes Resource Usage and Set Process Limits on a Per-User Basis.md b/translated/tech/LFCS/Part 14 - Monitor Linux Processes Resource Usage and Set Process Limits on a Per-User Basis.md new file mode 100644 index 0000000000..c6db6be7cc --- /dev/null +++ b/translated/tech/LFCS/Part 14 - Monitor Linux Processes Resource Usage and Set Process Limits on a Per-User Basis.md @@ -0,0 +1,275 @@ +LFCS 系列第十四讲: Linux 进程资源使用监控和基于每个用户的进程限制设置 +============================================================================================= + +由于 2016 年 2 月 2 号开始启用了新的 LFCS 考试要求,我们在已经发表的 [LFCS 系列][1] 基础上增加了一些必要的主题。为了准备考试,同时也建议你看看 [LFCE 系列][2] 文章。 + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Linux-Process-Monitoring-Set-Process-Limits-Per-User.png) +>第十四讲: 监控 Linux 进程并为每个用户设置进程限制 + +每个 Linux 系统管理员都应该知道如何验证硬件、资源和主要进程的完整性和可用性。另外,基于每个用户设置资源限制也是其中一项必备技能。 + +在这篇文章中,我们会介绍一些能够确保系统硬件和软件正常工作的方法,这些方法能够避免潜在的会导致生产环境下线或钱财损失的问题发生。 + +### 报告 Linux 进程统计信息 + +你可以使用 **mpstat** 单独查看每个处理器或者系统整体的活动,可以是每次一个快照或者动态更新。 + +为了使用这个工具,你首先需要安装 **sysstat**: + +``` +# yum update && yum install sysstat [基于 CentOS 的系统] +# aptitutde update && aptitude install sysstat [基于 Ubuntu 的系统] +# zypper update && zypper install sysstat [基于 openSUSE 的系统] +``` + +你可以在 [在 Linux 中学习 Sysstat 和其中的工具 mpstat、pidstat、iostat 和 sar][3] 了解更多和 sysstat 和其中的工具相关的信息。 + +安装完 **mpstat** 之后,就可以使用它生成处理器统计信息的报告。 + +你可以使用下面的命令每隔 2 秒显示所有 CPU(用 `-P` ALL 表示) 的 CPU 利用率(`-u`),共显示 **3** 次。 + +``` +# mpstat -P ALL -u 2 3 +``` + +### 事例输出 + +``` +Linux 3.19.0-32-generic (tecmint.com) Wednesday 30 March 2016 _x86_64_ (4 CPU) + +11:41:07 IST CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle +11:41:09 IST all 5.85 0.00 1.12 0.12 0.00 0.00 0.00 0.00 0.00 92.91 +11:41:09 IST 0 4.48 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 94.53 +11:41:09 IST 1 2.50 0.00 0.50 0.00 0.00 0.00 0.00 0.00 0.00 97.00 +11:41:09 IST 2 6.44 0.00 0.99 0.00 0.00 0.00 0.00 0.00 0.00 92.57 +11:41:09 IST 3 10.45 0.00 1.99 0.00 0.00 0.00 0.00 0.00 0.00 87.56 + +11:41:09 IST CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle +11:41:11 IST all 11.60 0.12 1.12 0.50 0.00 0.00 0.00 0.00 0.00 86.66 +11:41:11 IST 0 10.50 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 88.50 +11:41:11 IST 1 14.36 0.00 1.49 2.48 0.00 0.00 0.00 0.00 0.00 81.68 +11:41:11 IST 2 2.00 0.50 1.00 0.00 0.00 0.00 0.00 0.00 0.00 96.50 +11:41:11 IST 3 19.40 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 79.60 + +11:41:11 IST CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle +11:41:13 IST all 5.69 0.00 1.24 0.00 0.00 0.00 0.00 0.00 0.00 93.07 +11:41:13 IST 0 2.97 0.00 1.49 0.00 0.00 0.00 0.00 0.00 0.00 95.54 +11:41:13 IST 1 10.78 0.00 1.47 0.00 0.00 0.00 0.00 0.00 0.00 87.75 +11:41:13 IST 2 2.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 97.00 +11:41:13 IST 3 6.93 0.00 0.50 0.00 0.00 0.00 0.00 0.00 0.00 92.57 + +Average: CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle +Average: all 7.71 0.04 1.16 0.21 0.00 0.00 0.00 0.00 0.00 90.89 +Average: 0 5.97 0.00 1.16 0.00 0.00 0.00 0.00 0.00 0.00 92.87 +Average: 1 9.24 0.00 1.16 0.83 0.00 0.00 0.00 0.00 0.00 88.78 +Average: 2 3.49 0.17 1.00 0.00 0.00 0.00 0.00 0.00 0.00 95.35 +Average: 3 12.25 0.00 1.16 0.00 0.00 0.00 0.00 0.00 0.00 86.59 +``` + +要查看指定的 **CPU**(在下面的例子中是 **CPU 0**),可以使用: + +``` +# mpstat -P 0 -u 2 3 +``` + +### 事例输出 + +``` +Linux 3.19.0-32-generic (tecmint.com) Wednesday 30 March 2016 _x86_64_ (4 CPU) + +11:42:08 IST CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle +11:42:10 IST 0 3.00 0.00 0.50 0.00 0.00 0.00 0.00 0.00 0.00 96.50 +11:42:12 IST 0 4.08 0.00 0.00 2.55 0.00 0.00 0.00 0.00 0.00 93.37 +11:42:14 IST 0 9.74 0.00 0.51 0.00 0.00 0.00 0.00 0.00 0.00 89.74 +Average: 0 5.58 0.00 0.34 0.85 0.00 0.00 0.00 0.00 0.00 93.23 +``` + +上面命令的输出包括这些列: + +* `CPU`: 整数表示的处理器号或者 all 表示所有处理器的平局值。 +* `%usr`: 运行在用户级别的应用的 CPU 利用率百分数。 +* `%nice`: 和 `%usr` 相同,但有 nice 优先级。 +* `%sys`: 执行内核应用的 CPU 利用率百分比。这不包括用于处理中断或者硬件请求的时间。 +* `%iowait`: 指定(或所有) CPU 的空闲时间百分比,这表示当前 CPU 处于 I/O 操作密集的状态。更详细的解释(附带示例)可以查看[这里][4]。 +* `%irq`: 用于处理硬件中断的时间所占百分比。 +* `%soft`: 和 `%irq` 相同,但是软中断。 +* `%steal`: 当一个客户虚拟机在竞争 CPU 时,非自主等待(时间片窃取)所占时间的百分比。应该保持这个值尽可能小。如果这个值很大,意味着虚拟机正在或者将要停止运转。 +* `%guest`: 运行虚拟处理器所用的时间百分比。 +* `%idle`: CPU(s) 没有运行任何任务所占时间的百分比。如果你观察到这个值很小,意味着系统负载很重。在这种情况下,你需要查看详细的进程列表、以及下面将要讨论的内容来确定这是什么原因导致的。 + +运行下面的命令使处理器处于极高负载,然后在另一个终端执行 mpstat 命令: + +``` +# dd if=/dev/zero of=test.iso bs=1G count=1 +# mpstat -u -P 0 2 3 +# ping -f localhost # Interrupt with Ctrl + C after mpstat below completes +# mpstat -u -P 0 2 3 +``` + +最后,和 “正常” 情况下 **mpstat** 的输出作比较: + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Report-Processors-Related-Statistics.png) +> Linux 处理器相关统计信息报告 + +正如你在上面图示中看到的,在前面两个例子中,根据 `%idle` 的值可以判断 **CPU 0** 负载很高。 + +在下一部分,我们会讨论如何识别资源饥饿型进程,如何获取更多和它们相关的信息,以及如何采取恰当的措施。 + +### Linux 进程报告 + +我们可以使用有名的 `ps` 命令,用 `-eo` 选项(根据用户定义格式选中所有进程) 和 `--sort` 选项(指定自定义排序顺序)按照 CPU 使用率排序列出进程,例如: + +``` +# ps -eo pid,ppid,cmd,%cpu,%mem --sort=-%cpu +``` + +上面的命令只会显示 `PID`、`PPID`、和进程相关的命令、 CPU 使用率以及 RAM 使用率,并按照 CPU 使用率降序排序。创建 .iso 文件的时候运行上面的命令,下面是输出的前面几行: + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Find-Linux-Processes-By-CPU-Usage.png) +>根据 CPU 使用率查找进程 + +一旦我们找到了感兴趣的进程(例如 `PID=2822` 的进程),我们就可以进入 `/proc/PID`(本例中是 `/proc/2822`) 列出目录内容。 + +这个目录就是进程运行的时候保存多个关于该进程详细信息的文件和子目录的目录。 + +#### 例如: + +* `/proc/2822/io` 包括该进程的 IO 统计信息( IO 操作时的读写字符数)。 +* `/proc/2822/attr/current` 显示了进程当前的 SELinux 安全属性。 +* `/proc/2822/attr/current` shows the current SELinux security attributes of the process. +* `/proc/2822/cgroup` 如果启用了 CONFIG_CGROUPS 内核设置选项,这会显示该进程所属的控制组(简称 cgroups),你可以使用下面命令验证是否启用了 CONFIG_CGROUPS: + +``` +# cat /boot/config-$(uname -r) | grep -i cgroups +``` + +如果启用了该选项,你应该看到: + +``` +CONFIG_CGROUPS=y +``` + +根据 [红帽企业版 Linux 7 资源管理指南][5] 第一到四章的内容、[openSUSE 系统分析和调优指南][6] 第九章、[Ubuntu 14.04 服务器文档 Control Groups 章节][7],你可以使用 `cgroups` 管理每个进程允许使用的资源数目。 + +`/proc/2822/fd` 这个目录包含每个打开的描述进程的文件的符号链接。下面的截图显示了 tty1(第一个终端) 中创建 **.iso** 镜像进程的相关信息: + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Find-Linux-Process-Information.png) +>查找 Linux 进程信息 + +上面的截图显示 **stdin**(文件描述符 **0**)、**stdout**(文件描述符 **1**)、**stderr**(文件描述符 **2**) 相应地被映射到 **/dev/zero**、 **/root/test.iso** 和 **/dev/tty1**。 + +更多关于 `/proc` 信息的可以查看 Kernel.org 维护的 “`/proc` 文件系统” 和 Linux 开发者手册。 + +### 在 Linux 中为每个用户设置资源限制 + +如果你不够小心、让任意用户使用不受限制的进程数,最终你可能会遇到意外的系统关机或者由于系统进入不可用的状态而被锁住。为了防止这种情况发生,你应该为用户可以启动的进程数目设置上限。 + +你可以在 **/etc/security/limits.conf** 文件末尾添加下面一行来设置限制: + +``` +* hard nproc 10 +``` + +第一个字段可以用来表示一个用户、组或者所有`(*)`, 第二个字段强制限制可以使用的进程数目(nproc) 为 **10**。退出并重新登录就可以使设置生效。 + +然后,让我们来看看非 root 用户(合法用户或非法用户) 试图引起 shell fork bomb[WiKi][12] 时会发生什么。如果我们没有设置限制, shell fork bomb 会无限制地启动函数的两个实例,然后无限循环地复制任意一个实例。最终导致你的系统卡死。 + +但是,如果使用了上面的限制,fort bomb 就不会成功,但用户仍然会被锁在外面直到系统管理员杀死相关的进程。 + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Shell-Fork-Bomb.png) +>运行 Shell Fork Bomb + +**提示**: `limits.conf` 文件中可以查看其它 **ulimit** 可以更改的限制。 + +### 其它 Linux 进程管理工具 + +除了上面讨论的工具, 一个系统管理员还可能需要: + +**a)** 通过使用 **renice** 调整执行优先级(系统资源使用)。这意味着内核会根据分配的优先级(众所周知的 “**niceness**”,它是一个范围从 `-20` 到 `19` 的整数)给进程分配更多或更少的系统资源。 + +这个值越小,执行优先级越高。普通用户(而非 root)只能调高他们所有的进程的 niceness 值(意味着更低的优先级),而 root 用户可以调高或调低任何进程的 niceness 值。 + +renice 命令的基本语法如下: + +``` +# renice [-n] identifier +``` + +如果没有 new priority 后面的参数(为空),默认就是 PID。在这种情况下, **PID=identifier** 的进程的 niceness 值会被设置为 ``。 + +**b)** 需要的时候中断一个进程的正常执行。这也就是通常所说的 [“杀死”进程][9]。实质上,这意味着给进程发送一个信号使它恰当地结束运行并以有序的方式释放任何占用的资源。 + +按照下面的方式使用 **kill** 命令[杀死进程][10]: + +``` +# kill PID +``` + +另外,你也可以使用 [pkill][11] 结束指定用户`(-u)`、指定组`(-G)` 甚至有共同 PPID`(-P)` 的所有进程。这些选项后面可以使用数字或者名称表示的标识符。 + +``` +# pkill [options] identifier +``` + +例如: + +``` +# pkill -G 1000 +``` + +会杀死组 `GID=1000` 的所有进程。 + +而 + +``` +# pkill -P 4993 +``` + +会杀死 `PPID 是 4993` 的所有进程。 + +在运行 `pkill` 之前,先用 `pgrep` 测试结果、或者使用 `-l` 选项列出进程名称是一个很好的办法。它需要和 `pkill` 相同的参数、但是只会返回进程的 PID(而不会有其它操作),而 `pkill` 会杀死进程。 + +``` +# pgrep -l -u gacanepa +``` + +用下面的图片说明: + +![](http://www.tecmint.com/wp-content/uploads/2016/03/List-User-Running-Processes.png) +>在 Linux 中查找用户运行的进程 + +### 总结 + +在这篇文章中我们探讨了一些监控资源使用的方法,以便验证 Linux 系统中重要硬件和软件组件的完整性和可用性。 + +我们也学习了如何在特殊情况下采取恰当的措施(通过调整给定进程的执行优先级或者结束进程)。 + +我们希望本篇中介绍的概念能对你有所帮助。如果你有任何疑问或者评论,可以使用下面的联系方式联系我们。 + + + + + +-------------------------------------------------------------------------------- + +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/installing-network-services-and-configuring-services-at-system-boot/ +[3]: http://www.tecmint.com/sysstat-commands-to-monitor-linux/ +[4]: http://veithen.github.io/2013/11/18/iowait-linux.html +[5]: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Resource_Management_Guide/index.html +[6]: https://doc.opensuse.org/documentation/leap/tuning/html/book.sle.tuning/cha.tuning.cgroups.html +[7]: https://help.ubuntu.com/lts/serverguide/cgroups.html +[8]: http://man7.org/linux/man-pages/man5/proc.5.html +[9]: http://www.tecmint.com/kill-processes-unresponsive-programs-in-ubuntu/ +[10]: http://www.tecmint.com/find-and-kill-running-processes-pid-in-linux/ +[11]: http://www.tecmint.com/how-to-kill-a-process-in-linux/ +[12]: https://en.wikipedia.org/wiki/Fork_bomb From 7350ee58828b7c8dc93e6f22ecb0670ccbe63544 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 1 May 2016 22:01:02 +0800 Subject: [PATCH 0654/1469] =?UTF-8?q?20160501-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit lxd --- ... 3 - LXD 2.0 - Your first LXD container.md | 559 ++++++++++++++++++ 1 file changed, 559 insertions(+) create mode 100644 sources/tech/LXD/Part 3 - LXD 2.0 - Your first LXD container.md diff --git a/sources/tech/LXD/Part 3 - LXD 2.0 - Your first LXD container.md b/sources/tech/LXD/Part 3 - LXD 2.0 - Your first LXD container.md new file mode 100644 index 0000000000..6dac73d080 --- /dev/null +++ b/sources/tech/LXD/Part 3 - LXD 2.0 - Your first LXD container.md @@ -0,0 +1,559 @@ +Part 3 - LXD 2.0: Your first LXD container +========================================== + +This is the third blog post in this series about LXD 2.0. + +As there are a lot of commands involved with managing LXD containers, this post is rather long. If you’d instead prefer a quick step-by-step tour of those same commands, you can [try our online demo instead][1]! + +![](https://linuxcontainers.org/static/img/containers.png) + +### Creating and starting a new container + +As I mentioned in the previous posts, the LXD command line client comes pre-configured with a few image sources. Ubuntu is the best covered with official images for all its releases and architectures but there also are a number of unofficial images for other distributions. Those are community generated and maintained by LXC upstream contributors. + +### Ubuntu + +If all you want is the best supported release of Ubuntu, all you have to do is: + +``` +lxc launch ubuntu: +``` + +Note however that the meaning of this will change as new Ubuntu LTS releases are released. So for scripting use, you should stick to mentioning the actual release you want (see below). + +### Ubuntu 14.04 LTS + +To get the latest, tested, stable image of Ubuntu 14.04 LTS, you can simply run: + +``` +lxc launch ubuntu:14.04 +``` + +In this mode, a random container name will be picked. +If you prefer to specify your own name, you may instead do: + +``` +lxc launch ubuntu:14.04 c1 +``` + +Should you want a specific (non-primary) architecture, say a 32bit Intel image, you can do: + +``` +lxc launch ubuntu:14.04/i386 c2 +``` + +### Current Ubuntu development release + +The “ubuntu:” remote used above only provides official, tested images for Ubuntu. If you instead want untested daily builds, as is appropriate for the development release, you’ll want to use the “ubuntu-daily:” remote instead. + +``` +lxc launch ubuntu-daily:devel c3 +``` + +In this example, whatever the latest Ubuntu development release is will automatically be picked. + +You can also be explicit, for example by using the code name: + +``` +lxc launch ubuntu-daily:xenial c4 +``` + +### Latest Alpine Linux + +Alpine images are available on the “images:” remote and can be launched with: + +``` +lxc launch images:alpine/3.3/amd64 c5 +``` + +### And many more + +A full list of the Ubuntu images can be obtained with: + +``` +lxc image list ubuntu: +lxc image list ubuntu-daily: +``` + +And of all the unofficial images: + +``` +lxc image list images: +``` + +A list of all the aliases (friendly names) available on a given remote can also be obtained with (for the “ubuntu:” remote): + +``` +lxc image alias list ubuntu: +``` + +### Creating a container without starting it + +If you want to just create a container or a batch of container but not also start them immediately, you can just replace “lxc launch” by “lxc init”. All the options are identical, the only different is that it will not start the container for you after creation. + +``` +lxc init ubuntu: +``` + +### Information about your containers + +#### Listing the containers + +To list all your containers, you can do: + +``` +lxc list +``` + +There are a number of options you can pass to change what columns are displayed. On systems with a lot of containers, the default columns can be a bit slow (due to having to retrieve network information from the containers), you may instead want: + +``` +lxc list --fast +``` + +Which shows a different set of columns that require less processing on the server side. + +You can also filter based on name or properties: + +``` +stgraber@dakara:~$ lxc list security.privileged=true ++------+---------+---------------------+-----------------------------------------------+------------+-----------+ +| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS | ++------+---------+---------------------+-----------------------------------------------+------------+-----------+ +| suse | RUNNING | 172.17.0.105 (eth0) | 2607:f2c0:f00f:2700:216:3eff:fef2:aff4 (eth0) | PERSISTENT | 0 | ++------+---------+---------------------+-----------------------------------------------+------------+-----------+ +``` + +In this example, only containers that are privileged (user namespace disabled) are listed. + +``` +stgraber@dakara:~$ lxc list --fast alpine ++-------------+---------+--------------+----------------------+----------+------------+ +| NAME | STATE | ARCHITECTURE | CREATED AT | PROFILES | TYPE | ++-------------+---------+--------------+----------------------+----------+------------+ +| alpine | RUNNING | x86_64 | 2016/03/20 02:11 UTC | default | PERSISTENT | ++-------------+---------+--------------+----------------------+----------+------------+ +| alpine-edge | RUNNING | x86_64 | 2016/03/20 02:19 UTC | default | PERSISTENT | ++-------------+---------+--------------+----------------------+----------+------------+ +``` + +And in this example, only the containers which have “alpine” in their names (complex regular expressions are also supported). + +#### Getting detailed information from a container + +As the list command obviously can’t show you everything about a container in a nicely readable way, you can query information about an individual container with: + +``` +lxc info +``` + +For example: + +``` +stgraber@dakara:~$ lxc info zerotier +Name: zerotier +Architecture: x86_64 +Created: 2016/02/20 20:01 UTC +Status: Running +Type: persistent +Profiles: default +Pid: 31715 +Processes: 32 +Ips: + eth0: inet 172.17.0.101 + eth0: inet6 2607:f2c0:f00f:2700:216:3eff:feec:65a8 + eth0: inet6 fe80::216:3eff:feec:65a8 + lo: inet 127.0.0.1 + lo: inet6 ::1 + lxcbr0: inet 10.0.3.1 + lxcbr0: inet6 fe80::c0a4:ceff:fe52:4d51 + zt0: inet 29.17.181.59 + zt0: inet6 fd80:56c2:e21c:0:199:9379:e711:b3e1 + zt0: inet6 fe80::79:e7ff:fe0d:5123 +Snapshots: + zerotier/blah (taken at 2016/03/08 23:55 UTC) (stateless) + ``` + +### Life-cycle management commands + +Those are probably the most obvious commands of any container or virtual machine manager but they still need to be covered. + +Oh and all of them accept multiple container names for batch operation. + +#### start + +Starting a container is as simple as: + +``` +lxc start +``` + +#### stop + +Stopping a container can be done with: + +``` +lxc stop +``` + +If the container isn’t cooperating (not responding to SIGPWR), you can force it with: + +``` +lxc stop --force +``` + +#### restart + +Restarting a container is done through: + +``` +lxc restart +``` + +And if not cooperating (not responding to SIGINT), you can force it with: + +``` +lxc restart --force +``` + +#### pause + +You can also “pause” a container. In this mode, all the container tasks will be sent the equivalent of a SIGSTOP which means that they will still be visible and will still be using memory but they won’t get any CPU time from the scheduler. + +This is useful if you have a CPU hungry container that takes quite a while to start but that you aren’t constantly using. You can let it start, then pause it, then start it again when needed. + +``` +lxc pause +``` + +#### delete + +Lastly, if you want a container to go away, you can delete it for good with: + +``` +lxc delete +``` + +Note that you will have to pass “–force” if the container is currently running. + +### Container configuration + +LXD exposes quite a few container settings, including resource limitation, control of container startup and a variety of device pass-through options. The full list is far too long to cover in this post but it’s available [here][2]. + +As far as devices go, LXD currently supports the following device types: + +- disk +This can be a physical disk or partition being mounted into the container or a bind-mounted path from the host. +- nic +A network interface. It can be a bridged virtual ethernet interrface, a point to point device, an ethernet macvlan device or an actual physical interface being passed through to the container. +- unix-block +A UNIX block device, e.g. /dev/sda +- unix-char +A UNIX character device, e.g. /dev/kvm +- none +This special type is used to hide a device which would otherwise be inherited through profiles. + +#### Configuration profiles + +The list of all available profiles can be obtained with: + +``` +lxc profile list +``` + +To see the content of a given profile, the easiest is to use: + +``` +lxc profile show +``` + +And should you want to change anything inside it, use: + +``` +lxc profile edit +``` + +You can change the list of profiles which apply to a given container with: + +``` +lxc profile apply ,,,... +``` + +#### Local configuration + +For things that are unique to a container and so don’t make sense to put into a profile, you can just set them directly against the container: + +``` +lxc config edit +``` + +This behaves the exact same way as “profile edit” above. + +Instead of opening the whole thing in a text editor, you can also modify individual keys with: + +``` +lxc config set +``` +Or add devices, for example: + +``` +lxc config device add my-container kvm unix-char path=/dev/kvm +``` + +Which will setup a /dev/kvm entry for the container named “my-container”. + +The same can be done for a profile using “lxc profile set” and “lxc profile device add”. + +#### Reading the configuration + +You can read the container local configuration with: + +``` +lxc config show +``` + +Or to get the expanded configuration (including all the profile keys): + +``` +lxc config show --expanded +``` + +For example: + +``` +stgraber@dakara:~$ lxc config show --expanded zerotier +name: zerotier +profiles: +- default +config: + security.nesting: "true" + user.a: b + volatile.base_image: a49d26ce5808075f5175bf31f5cb90561f5023dcd408da8ac5e834096d46b2d8 + volatile.eth0.hwaddr: 00:16:3e:ec:65:a8 + volatile.last_state.idmap: '[{"Isuid":true,"Isgid":false,"Hostid":100000,"Nsid":0,"Maprange":65536},{"Isuid":false,"Isgid":true,"Hostid":100000,"Nsid":0,"Maprange":65536}]' +devices: + eth0: + name: eth0 + nictype: macvlan + parent: eth0 + type: nic + limits.ingress: 10Mbit + limits.egress: 10Mbit + root: + path: / + size: 30GB + type: disk + tun: + path: /dev/net/tun + type: unix-char +ephemeral: false +``` + +That one is very convenient to check what will actually be applied to a given container. + +#### Live configuration update + +Note that unless indicated in the documentation, all configuration keys and device entries are applied to affected containers live. This means that you can add and remove devices or alter the security profile of running containers without ever having to restart them. + +### Getting a shell + +LXD lets you execute tasks directly into the container. The most common use of this is to get a shell in the container or to run some admin tasks. + +The benefit of this compared to SSH is that you’re not dependent on the container being reachable over the network or on any software or configuration being present inside the container. + +Execution environment + +One thing that’s a bit unusual with the way LXD executes commands inside the container is that it’s not itself running inside the container, which means that it can’t know what shell to use, what environment variables to set or what path to use for your home directory. + +Commands executed through LXD will always run as the container’s root user (uid 0, gid 0) with a minimal PATH environment variable set and a HOME environment variable set to /root. + +Additional environment variables can be passed through the command line or can be set permanently against the container through the “environment.” configuration options. + +#### Executing commands + +Getting a shell inside a container is typically as simple as: + +``` +lxc exec bash +``` + +That’s assuming the container does actually have bash installed. + + +More complex commands require the use of a separator for proper argument parsing: + +``` +lxc exec -- ls -lh / +``` + +To set or override environment variables, you can use the “–env” argument, for example: + +``` +stgraber@dakara:~$ lxc exec zerotier --env mykey=myvalue env | grep mykey +mykey=myvalue +``` + +### Managing files + +Because LXD has direct access to the container’s file system, it can directly read and write any file inside the container. This can be very useful to pull log files or exchange files with the container. + +#### Pulling a file from the container + +To get a file from the container, simply run: + +``` +lxc file pull / +``` + +For example: + +``` +stgraber@dakara:~$ lxc file pull zerotier/etc/hosts hosts +``` + +Or to read it to standard output: + +``` +stgraber@dakara:~$ lxc file pull zerotier/etc/hosts - +127.0.0.1 localhost + +# The following lines are desirable for IPv6 capable hosts +::1 ip6-localhost ip6-loopback +fe00::0 ip6-localnet +ff00::0 ip6-mcastprefix +ff02::1 ip6-allnodes +ff02::2 ip6-allrouters +ff02::3 ip6-allhosts +``` + +#### Pushing a file to the container + +Push simply works the other way: + +``` +lxc file push / +``` + +#### Editing a file directly + +Edit is a convenience function which simply pulls a given path, opens it in your default text editor and then pushes it back to the container when you close it: + +``` +lxc file edit / +``` + +### Snapshot management + +LXD lets you snapshot and restore containers. Snapshots include the entirety of the container’s state (including running state if –stateful is used), which means all container configuration, container devices and the container file system. + +#### Creating a snapshot + +You can snapshot a container with: + +``` +lxc snapshot +``` + +It’ll get named snapX where X is an incrementing number. + +Alternatively, you can name your snapshot with: + +``` +lxc snapshot +``` + +#### Listing snapshots + +The number of snapshots a container has is listed in “lxc list”, but the actual snapshot list is only visible in “lxc info”. + +``` +lxc info +``` + +#### Restoring a snapshot + +To restore a snapshot, simply run: + +``` +lxc restore +``` + +#### Renaming a snapshot + +Renaming a snapshot can be done by moving it with: + +``` +lxc move / / +``` + +#### Creating a new container from a snapshot + +You can create a new container which will be identical to another container’s snapshot except for the volatile information being reset (MAC address): + +``` +lxc copy / +``` + +#### Deleting a snapshot + +And finally, to delete a snapshot, just run: + +``` +lxc delete / +``` + +### Cloning and renaming + +Getting clean distribution images is all nice and well, but sometimes you want to install a bunch of things into your container, configure it and then branch it into a bunch of other containers. + +#### Copying a container + +To copy a container and effectively clone it into a new one, just run: + +``` +lxc copy +``` + +The destination container will be identical in every way to the source one, except it won’t have any snapshot and volatile keys (MAC address) will be reset. + +#### Moving a container + +LXD lets you copy and move containers between hosts, but that will get covered in a later post. + +For now, the “move” command can be used to rename a container with: + +``` +lxc move +``` + +The only requirement is that the container be stopped, everything else will be kept exactly as it was, including the volatile information (MAC address and such). + +### Conclusion + +This pretty long post covered most of the commands you’re likely to use in day to day operation. + +Obviously a lot of those commands have extra arguments that let you be more efficient or tweak specific aspects of your LXD containers. The best way to learn about all of those is to go through the help for those you care about (–help). + +### Extra information + +The main LXD website is at: +Development happens on Github at: +Mailing-list support happens on: +IRC support happens in: #lxcontainers on irc.freenode.net + +And if you don’t want or can’t install LXD on your own machine, you can always [try it online instead][1]! + + +-------------------------------------------------------------------------------- + +via: https://www.stgraber.org/2016/03/19/lxd-2-0-your-first-lxd-container-312/ + +作者:[Stéphane Graber][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.stgraber.org/author/stgraber/ +[1]: https://linuxcontainers.org/lxd/try-it +[2]: https://github.com/lxc/lxd/blob/master/doc/configuration.md From 2bb5c6a2c30540a40df2fc16c1c9aca18b451b9e Mon Sep 17 00:00:00 2001 From: alim0x Date: Mon, 2 May 2016 15:25:45 +0800 Subject: [PATCH 0655/1469] [translating]An Introduction to SELinux --- sources/tech/20160204 An Introduction to SELinux.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sources/tech/20160204 An Introduction to SELinux.md b/sources/tech/20160204 An Introduction to SELinux.md index dc5968ad00..dbf579c461 100644 --- a/sources/tech/20160204 An Introduction to SELinux.md +++ b/sources/tech/20160204 An Introduction to SELinux.md @@ -1,3 +1,5 @@ +alim0x translating + An Introduction to SELinux =============================== @@ -37,7 +39,7 @@ Sounds relatively simple, right? There’s actually more to it than that, but fo ### The Modes -SELinux has three modes (which can be set by the user). These modes will dictate how SELinux acts upon subject request. The modes are: +SELinux has three modes (which can be set by the user). These modes will dictate how SELinux acts upon subject request. The modes are: - Enforcing — SELinux policy is enforced and subjects will be denied or granted access to objects based on the SELinux policy rules @@ -57,7 +59,7 @@ You can change the SELinux mode from the command line or in the /etc/selinux/con 3. Issue the command setenforce 1 -4. Issue the command getenforce to ensure the mode has been set (Figure 2) +4. Issue the command getenforce to ensure the mode has been set (Figure 2) ![](https://www.linux.com/images/stories/66866/jack-selinux_b.png) From 0a465a9535c95e36475929d8585db99f03559961 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Mon, 2 May 2016 16:01:03 +0800 Subject: [PATCH 0656/1469] Translating sources/tech/LFCS/Part 7 - LFCS--Managing System Startup Process and Services SysVinit Systemd and Upstart.md --- ... Startup Process and Services SysVinit Systemd and Upstart.md | 1 + 1 file changed, 1 insertion(+) 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 2a822e8a45..af3ac034be 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,4 @@ +ictlyh Translating 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. From f1259934f8af8b592b957f207416b753b5dcdbed Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 2 May 2016 21:35:38 +0800 Subject: [PATCH 0657/1469] =?UTF-8?q?20160502-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Part 1 - LXD 2.0: Introduction to LXD.md | 156 ++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 sources/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md diff --git a/sources/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md b/sources/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md new file mode 100644 index 0000000000..bc25ecc57c --- /dev/null +++ b/sources/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md @@ -0,0 +1,156 @@ +Part 1 - LXD 2.0: Introduction to LXD +====================================== + +This is the first blog post [in this series about LXD 2.0][1]. + +![](https://linuxcontainers.org/static/img/containers.png) + +### A few common questions about LXD + +#### What’s LXD? + +At its simplest, LXD is a daemon which provides a REST API to drive LXC containers. + +Its main goal is to provide a user experience that’s similar to that of virtual machines but using Linux containers rather than hardware virtualization. + + +#### How does LXD relate to Docker/Rkt? + +This is by far the question we get the most, so lets address it immediately! + +LXD focuses on system containers, also called infrastructure containers. That is, a LXD container runs a full Linux system, exactly as it would be when run on metal or in a VM. + +Those containers will typically be long running and based on a clean distribution image. Traditional configuration management tools and deployment tools can be used with LXD containers exactly as you would use them for a VM, cloud instance or physical machine. + +In contrast, Docker focuses on ephemeral, stateless, minimal containers that won’t typically get upgraded or re-configured but instead just be replaced entirely. That makes Docker and similar projects much closer to a software distribution mechanism than a machine management tool. + +The two models aren’t mutually exclusive either. You can absolutely use LXD to provide full Linux systems to your users who can then install Docker inside their LXD container to run the software they want. + +#### Why LXD? + +We’ve been working on LXC for a number of years now. LXC is great at what it does, that is, it provides a very good set of low-level tools and a library to create and manage containers. + +However that kind of low-level tools aren’t necessarily very user friendly. They require a lot of initial knowledge to understand what they do and how they work. Keeping backward compatibility with older containers and deployment methods has also prevented LXC from using some security features by default, leading to more manual configuration for users. + +We see LXD as the opportunity to address those shortcomings. On top of being a long running daemon which lets us address a lot of the LXC limitations like dynamic resource restrictions, container migration and efficient live migration, it also gave us the opportunity to come up with a new default experience, that’s safe by default and much more user focused. + +### The main LXD components + +There are a number of main components that make LXD, those are typically visible in the LXD directory structure, in its command line client and in the API structure itself. + +#### Containers + +Containers in LXD are made of: + +- A filesystem (rootfs) +- A list of configuration options, including resource limits, environment, security options and more +- A bunch of devices like disks, character/block unix devices and network interfaces +- A set of profiles the container inherits configuration from (see below) +- Some properties (container architecture, ephemeral or persistent and the name) +- Some runtime state (when using CRIU for checkpoint/restore) + +#### Snapshots + +Container snapshots are identical to containers except for the fact that they are immutable, they can be renamed, destroyed or restored but cannot be modified in any way. + +It is worth noting that because we allow storing the container runtime state, this effectively gives us the concept of “stateful” snapshots. That is, the ability to rollback the container including its cpu and memory state at the time of the snapshot. + +#### Images + +LXD is image based, all LXD containers come from an image. Images are typically clean Linux distribution images similar to what you would use for a virtual machine or cloud instance. + +It is possible to “publish” a container, making an image from it which can then be used by the local or remote LXD hosts. + +Images are uniquely identified by their sha256 hash and can be referenced by using their full or partial hash. Because typing long hashes isn’t particularly user friendly, images can also have any number of properties applied to them, allowing for an easy search through the image store. Aliases can also be set as a one to one mapping between a unique user friendly string and an image hash. + +LXD comes pre-configured with three remote image servers (see remotes below): + +- “ubuntu:” provides stable Ubuntu images +- “ubunt-daily:” provides daily builds of Ubuntu +- “images:” is a community run image server providing images for a number of other Linux distributions using the upstream LXC templates +Remote images are automatically cached by the LXD daemon and kept for a number of days (10 by default) since they were last used before getting expired. + +Additionally LXD also automatically updates remote images (unless told otherwise) so that the freshest version of the image is always available locally. + +#### Profiles + +Profiles are a way to define container configuration and container devices in one place and then have it apply to any number of containers. + +A container can have multiple profiles applied to it. When building the final container configuration (known as expanded configuration), the profiles will be applied in the order they were defined in, overriding each other when the same configuration key or device is found. Then the local container configuration is applied on top of that, overriding anything that came from a profile. + +LXD ships with two pre-configured profiles: + +- “default” is automatically applied to all containers unless an alternative list of profiles is provided by the user. This profile currently does just one thing, define a “eth0” network device for the container. +- “docker” is a profile you can apply to a container which you want to allow to run Docker containers. It requests LXD load some required kernel modules, turns on container nesting and sets up a few device entries. + +#### Remotes + +As I mentioned earlier, LXD is a networked daemon. The command line client that comes with it can therefore talk to multiple remote LXD servers as well as image servers. + +By default, our command line client comes with the following remotes defined + +local: (default remote, talks to the local LXD daemon over a unix socket) +ubuntu: (Ubuntu image server providing stable builds) +ubuntu-daily: (Ubuntu image server providing daily builds) +images: (images.linuxcontainers.org image server) +Any combination of those remotes can be used with the command line client. + +You can also add any number of remote LXD hosts that were configured to listen to the network. Either anonymously if they are a public image server or after going through authentication when managing remote containers. + +It’s that remote mechanism that makes it possible to interact with remote image servers as well as copy or move containers between hosts. + +### Security + +One aspect that was core to our design of LXD was to make it as safe as possible while allowing modern Linux distributions to run inside it unmodified. + +The main security features used by LXD through its use of the LXC library are: + +- Kernel namespaces. Especially the user namespace as a way to keep everything the container does separate from the rest of the system. LXD uses the user namespace by default (contrary to LXC) and allows for the user to turn it off on a per-container basis (marking the container “privileged”) when absolutely needed. +- Seccomp. To filter some potentially dangerous system calls. +- AppArmor: To provide additional restrictions on mounts, socket, ptrace and file access. Specifically restricting cross-container communication. +- Capabilities. To prevent the container from loading kernel modules, altering the host system time, … +- CGroups. To restrict resource usage and prevent DoS attacks against the host. +Rather than exposing those features directly to the user as LXC would, we’ve built a new configuration language which abstracts most of those into something that’s more user friendly. For example, one can tell LXD to pass any host device into the container without having to also lookup its major/minor numbers to manually update the cgroup policy. + +Communications with LXD itself are secured using TLS 1.2 with a very limited set of allowed ciphers. When dealing with hosts outside of the system certificate authority, LXD will prompt the user to validate the remote fingerprint (SSH style), then cache the certificate for future use. + +### The REST API + +Everything that LXD does is done over its REST API. There is no other communication channel between the client and the daemon. + +The REST API can be access over a local unix socket, only requiring group membership for authentication or over a HTTPs socket using a client certificate for authentication. + +The structure of the REST API matches the different components described above and is meant to be very simple and intuitive to use. + +When a more complex communication mechanism is required, LXD will negotiate websockets and use those for the rest of the communication. This is used for interactive console session, container migration and for event notification. + +With LXD 2.0, comes the /1.0 stable API. We will not break backward compatibility within the /1.0 API endpoint however we may add extra features to it, which we’ll signal by declaring additional API extensions that the client can look for. + +### Containers at scale + +While LXD provides a good command line client, that client isn’t meant to manage thousands of containers on multiple hosts. For that kind of use cases, we have nova-lxd which is an OpenStack plugin that makes OpenStack treat LXD containers in the exact same way it would treat VMs. + +This allows for very large deployments of LXDs on a large number of hosts, using the OpenStack APIs to manage network, storage and load-balancing. + +### Extra information + +The main LXD website is at: +Development happens on Github at: +Mailing-list support happens on: +IRC support happens in: #lxcontainers on irc.freenode.net + +And if you can’t wait until the next few posts to try LXD, you can [take our guided tour online][2] and try it for free right from your web browser! + +-------------------------------------------------------------------------------- + +via: https://www.stgraber.org/2016/03/19/lxd-2-0-your-first-lxd-container-312/ + +作者:[Stéphane Graber][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.stgraber.org/author/stgraber/ +[1]: https://www.stgraber.org/2016/03/11/lxd-2-0-blog-post-series-012/ +[2]: https://linuxcontainers.org/lxd/try-it From cfb84eb18396ae0bd4ed0c45127940d48a10abbe Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 2 May 2016 21:37:42 +0800 Subject: [PATCH 0658/1469] Update Part 3 - LXD 2.0 - Your first LXD container.md --- .../tech/LXD/Part 3 - LXD 2.0 - Your first LXD container.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sources/tech/LXD/Part 3 - LXD 2.0 - Your first LXD container.md b/sources/tech/LXD/Part 3 - LXD 2.0 - Your first LXD container.md index 6dac73d080..7bf9ba5b16 100644 --- a/sources/tech/LXD/Part 3 - LXD 2.0 - Your first LXD container.md +++ b/sources/tech/LXD/Part 3 - LXD 2.0 - Your first LXD container.md @@ -1,7 +1,7 @@ Part 3 - LXD 2.0: Your first LXD container ========================================== -This is the third blog post in this series about LXD 2.0. +This is the third blog post [in this series about LXD 2.0][0]. As there are a lot of commands involved with managing LXD containers, this post is rather long. If you’d instead prefer a quick step-by-step tour of those same commands, you can [try our online demo instead][1]! @@ -554,6 +554,7 @@ via: https://www.stgraber.org/2016/03/19/lxd-2-0-your-first-lxd-container-312/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:https://www.stgraber.org/author/stgraber/ +[a]: https://www.stgraber.org/author/stgraber/ +[0]: https://www.stgraber.org/2016/03/11/lxd-2-0-blog-post-series-012/ [1]: https://linuxcontainers.org/lxd/try-it [2]: https://github.com/lxc/lxd/blob/master/doc/configuration.md From 3ade3e75864c23dda26cea71bbe892735e7f62fa Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 2 May 2016 21:45:27 +0800 Subject: [PATCH 0659/1469] Update Part 1 - LXD 2.0: Introduction to LXD.md --- sources/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md b/sources/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md index bc25ecc57c..a80ad34453 100644 --- a/sources/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md +++ b/sources/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md @@ -143,7 +143,7 @@ And if you can’t wait until the next few posts to try LXD, you can [take our g -------------------------------------------------------------------------------- -via: https://www.stgraber.org/2016/03/19/lxd-2-0-your-first-lxd-container-312/ +via: https://www.stgraber.org/2016/03/11/lxd-2-0-introduction-to-lxd-112/ 作者:[Stéphane Graber][a] 译者:[译者ID](https://github.com/译者ID) From af4beaa4758365ad79ff2b2fac710dff0a983714 Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 2 May 2016 21:52:39 +0800 Subject: [PATCH 0660/1469] =?UTF-8?q?20160502-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...LXD 2.0: Installing and configuring LXD.md | 230 ++++++++++++++++++ 1 file changed, 230 insertions(+) create mode 100644 sources/tech/LXD/Part 2 - LXD 2.0: Installing and configuring LXD.md diff --git a/sources/tech/LXD/Part 2 - LXD 2.0: Installing and configuring LXD.md b/sources/tech/LXD/Part 2 - LXD 2.0: Installing and configuring LXD.md new file mode 100644 index 0000000000..56dc7ba607 --- /dev/null +++ b/sources/tech/LXD/Part 2 - LXD 2.0: Installing and configuring LXD.md @@ -0,0 +1,230 @@ +Part 2 - LXD 2.0: Installing and configuring LXD +================================================= + +This is the second blog post in this series about LXD 2.0. + +![](https://linuxcontainers.org/static/img/containers.png) + +### Where to get LXD and how to install it + +There are many ways to get the latest and greatest LXD. We recommend you use LXD with the latest LXC and Linux kernel to benefit from all its features but we try to degrade gracefully where possible to support older Linux distributions. + +#### The Ubuntu archive + +All new releases of LXD get uploaded to the Ubuntu development release within a few minutes of the upstream release. That package is then used to seed all the other source of packages for Ubuntu users. + +If you are using the Ubuntu development release (16.04), you can simply do: + +``` +sudo apt install lxd +``` + +If you are running Ubuntu 14.04, we have backport packages available for you with: + +``` +sudo apt -t trusty-backports install lxd +``` + +#### The Ubuntu Core store + +Users of Ubuntu Core on the stable release can install LXD with: + +``` +sudo snappy install lxd.stgraber +``` + +#### The official Ubuntu PPA + +Users of other Ubuntu releases such as Ubuntu 15.10 can find LXD packages in the following PPA (Personal Package Archive): + +``` +sudo apt-add-repository ppa:ubuntu-lxc/stable +sudo apt update +sudo apt dist-upgrade +sudo apt install lxd +``` + +#### The Gentoo archive + +Gentoo has pretty recent LXD packages available too, you can install those with: + +``` +sudo emerge --ask lxd +``` + +#### From source + +Building LXD from source isn’t very difficult if you are used to building Go projects. Note however that you will need the LXC development headers. In order to run LXD, your distribution also needs a recent Linux kernel (3.13 at least), recent LXC (1.1.5 or higher), LXCFS and a version of shadow that supports user sub-uid/gid allocations. + +The latest instructions on building LXD from source can be found in the [upstream README][2]. + +### Networking on Ubuntu + +The Ubuntu packages provide you with a “lxdbr0” bridge as a convenience. This bridge comes unconfigured by default, offering only IPv6 link-local connectivity through an HTTP proxy. + +To reconfigure the bridge and add some IPv4 or IPv6 subnet to it, you can run: + +``` +sudo dpkg-reconfigure -p medium lxd +``` + +Or go through the whole LXD step by step setup (see below) with: + +``` +sudo lxd init +``` + +### Storage backends + +LXD supports a number of storage backends. It’s best to know what backend you want to use prior to starting to use LXD as we do not support moving existing containers or images between backends. + +A feature comparison table of the different backends can be found [here][3]. + +#### ZFS + +Our recommendation is ZFS as it supports all the features LXD needs to offer the fastest and most reliable container experience. This includes per-container disk quotas, immediate snapshot/restore, optimized migration (send/receive) and instant container creation from an image. It is also considered more mature than btrfs. + +To use ZFS with LXD, you first need ZFS on your system. + +If using Ubuntu 16.04, simply install it with: + +``` +sudo apt install zfsutils-linux +``` + +On Ubuntu 15.10, you can install it with: + +``` +sudo apt install zfsutils-linux zfs-dkms +``` + +And on older releases, you can use the zfsonlinux PPA: + +``` +sudo apt-add-repository ppa:zfs-native/stable +sudo apt update +sudo apt install ubuntu-zfs +``` + +To configure LXD to use it, simply run: + +``` +sudo lxd init +``` + +This will ask you a few questions about what kind of zfs configuration you’d like for your LXD and then configure it for you. + +#### btrfs + +If ZFS isn’t available, then btrfs offers the same level of integration with the exception that it doesn’t properly report disk usage inside the container (quotas do apply though). +btrfs also has the nice property that it can nest properly which ZFS doesn’t yet. That is, if you plan on using LXD inside LXD, btrfs is worth considering. + +LXD doesn’t need any configuration to use btrfs, you just need to make sure that /var/lib/lxd is stored on a btrfs filesystem and LXD will automatically make use of it for you. + +#### LVM + +If ZFS and btrfs aren’t an option for you, you can still get some of their benefits by using LVM instead. LXD uses LVM with thin provisioning, creating an LV for each image and container and using LVM snapshots as needed. + +To configure LXD to use LVM, create a LVM VG and run: + +``` +lxc config set storage.lvm_vg_name "THE-NAME-OF-YOUR-VG" +``` + +By default LXD uses ext4 as the filesystem for all the LVs. You can change that to XFS if you’d like: + +``` +lxc config set storage.lvm_fstype xfs +``` + +#### Simple directory + +If none of the above are an option for you, LXD will still work but without any of those advanced features. It will simply create a directory for each container, unpack the image tarballs for each container creation and do a full filesystem copy on container copy or snapshot. + +All features are supported except for disk quotas, but this is very wasteful of disk space and also very slow. If you have no other choice, it will work, but you should really consider one of the alternatives above. + + + +### More daemon configuration + +The complete list of configuration options for the LXD daemon can be found [here][4]. + +#### Network configuration + +By default LXD doesn’t listen to the network. The only way to talk to it is over a local unix socket at /var/lib/lxd/unix.socket. + +To have it listen to the network, there are two useful keys to set: + +``` +lxc config set core.https_address [::] +lxc config set core.trust_password some-secret-string +``` + +The first instructs LXD to bind the “::” IPv6 address, namely, all addresses on the machine. You can obviously replace this by a specific IPv4 or IPv6 address and can append the TCP port you’d like it to bind (defaults to 8443). + +The second sets a password which is used for remote clients to add themselves to the LXD certificate trust store. When adding the LXD host, they will be prompted for the password, if the password matches, the LXD daemon will store their client certificate and they’ll be trusted, never needing the password again (it can be changed or unset entirely at that point). + +You can also choose not to set a password and instead manually trust each new client by having them give you their “client.crt” file (from ~/.config/lxc) and add it to the trust store yourself with: + +``` +lxc config trust add client.crt +``` + +#### Proxy configuration + +In most setups, you’ll want the LXD daemon to fetch images from remote servers. + +If you are in an environment where you must go through a HTTP(s) proxy to reach the outside world, you’ll want to set a few configuration keys or alternatively make sure that the standard PROXY environment variables are set in the daemon’s environment. + +``` +lxc config set core.proxy_http http://squid01.internal:3128 +lxc config set core.proxy_https http://squid01.internal:3128 +lxc config set core.proxy_ignore_hosts image-server.local +``` + +With those, all transfers initiated by LXD will use the squid01.internal HTTP proxy, except for traffic to the server at image-server.local + +#### Image management + +LXD does dynamic image caching. When instructed to create a container from a remote image, it will download that image into its image store, mark it as cached and record its origin. After a number of days without seeing any use (10 by default), the image is automatically removed. Every few hours (6 by default), LXD also goes looking for a newer version of the image and updates its local copy. + +All of that can be configured through the following configuration options: + +``` +lxc config set images.remote_cache_expiry 5 +lxc config set images.auto_update_interval 24 +lxc config set images.auto_update_cached false +``` + +Here we are instructing LXD to override all of those defaults and instead cache images for up to 5 days since they were last used, look for image updates every 24 hours and only update images which were directly marked as such (–auto-update flag in lxc image copy) but not the images which were automatically cached by LXD. + +### Conclusion + +At this point you should have a working version of the latest LXD release, you can now start playing with it on your own or wait for the next blog post where we’ll create our first container and play with the LXD command line tool. + +### Extra information + +The main LXD website is at: +Development happens on Github at: +Mailing-list support happens on: +IRC support happens in: #lxcontainers on irc.freenode.net + +And if you don’t want or can’t install LXD on your own machine, you can always [try it online instead][1]! + + +-------------------------------------------------------------------------------- + +via: https://www.stgraber.org/2016/03/19/lxd-2-0-your-first-lxd-container-312/ + +作者:[Stéphane Graber][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.stgraber.org/author/stgraber/ +[0]: https://www.stgraber.org/2016/03/11/lxd-2-0-blog-post-series-012/ +[1]: https://linuxcontainers.org/lxd/try-it +[2]: https://github.com/lxc/lxd/blob/master/README.md +[3]: https://github.com/lxc/lxd/blob/master/doc/storage-backends.md +[4]: https://github.com/lxc/lxd/blob/master/doc/configuration.md From 4f1b1dc3c47ebbf402712202095ddf7b3574d610 Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 2 May 2016 21:53:48 +0800 Subject: [PATCH 0661/1469] Rename Part 3 - LXD 2.0 - Your first LXD container.md to Part 3 - LXD 2.0: Your first LXD container.md --- ...container.md => Part 3 - LXD 2.0: Your first LXD container.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/tech/LXD/{Part 3 - LXD 2.0 - Your first LXD container.md => Part 3 - LXD 2.0: Your first LXD container.md} (100%) diff --git a/sources/tech/LXD/Part 3 - LXD 2.0 - Your first LXD container.md b/sources/tech/LXD/Part 3 - LXD 2.0: Your first LXD container.md similarity index 100% rename from sources/tech/LXD/Part 3 - LXD 2.0 - Your first LXD container.md rename to sources/tech/LXD/Part 3 - LXD 2.0: Your first LXD container.md From 8246b259c4895eb1dd807f6a759c70df6721f3a8 Mon Sep 17 00:00:00 2001 From: Ezio Date: Tue, 3 May 2016 09:54:32 +0800 Subject: [PATCH 0662/1469] translating by ezio --- sources/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md b/sources/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md index a80ad34453..b228894c75 100644 --- a/sources/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md +++ b/sources/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md @@ -1,3 +1,5 @@ +translating by ezio + Part 1 - LXD 2.0: Introduction to LXD ====================================== From 4a07b2e0b8fbb460c4e063466c1be13064c352cc Mon Sep 17 00:00:00 2001 From: Ezio Date: Tue, 3 May 2016 10:21:17 +0800 Subject: [PATCH 0663/1469] Update Part 1 - LXD 2.0: Introduction to LXD.md --- .../Part 1 - LXD 2.0: Introduction to LXD.md | 54 ++++++++++--------- 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/sources/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md b/sources/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md index b228894c75..4c33d2fc8f 100644 --- a/sources/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md +++ b/sources/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md @@ -1,46 +1,52 @@ translating by ezio -Part 1 - LXD 2.0: Introduction to LXD +Part 1 - LXD 2.0: LXD 入门 ====================================== -This is the first blog post [in this series about LXD 2.0][1]. +这是 [LXD 2.0 系列介绍文章][1]的第一篇。 ![](https://linuxcontainers.org/static/img/containers.png) -### A few common questions about LXD -#### What’s LXD? +### 关于 LXD 几个常见问题 + +#### 什么是 LXD ? At its simplest, LXD is a daemon which provides a REST API to drive LXC containers. Its main goal is to provide a user experience that’s similar to that of virtual machines but using Linux containers rather than hardware virtualization. +简单来说 LXD 就是一个提供了 REST API 的 LXC 容器管理器。 -#### How does LXD relate to Docker/Rkt? +LXD 最主要的目标就是使用 Linux 容器而不是硬件虚拟化向用户提供一种接近虚拟机的使用体验。 -This is by far the question we get the most, so lets address it immediately! +#### LXD 和 Docker/Rkt 又有什么关系呢 ? -LXD focuses on system containers, also called infrastructure containers. That is, a LXD container runs a full Linux system, exactly as it would be when run on metal or in a VM. +这是一个最常被问起的问题,现在就让我们直接指出其中的不同吧。 -Those containers will typically be long running and based on a clean distribution image. Traditional configuration management tools and deployment tools can be used with LXD containers exactly as you would use them for a VM, cloud instance or physical machine. +LXD 聚焦于系统容器,通常也被称为架构容器。这就是说 LXD 容器实际上运行了一个完整的 Linux 操作系统,就像在裸机或虚拟机上运行的一样。 -In contrast, Docker focuses on ephemeral, stateless, minimal containers that won’t typically get upgraded or re-configured but instead just be replaced entirely. That makes Docker and similar projects much closer to a software distribution mechanism than a machine management tool. +这些容器一般都是基于一个干净的发布镜像,会长时间运行。传统的配置管理工具和发布工具可以和 LXD 一起使用,就像你在虚拟机、云或者物理机器上使用一样。 -The two models aren’t mutually exclusive either. You can absolutely use LXD to provide full Linux systems to your users who can then install Docker inside their LXD container to run the software they want. +相对的, Docker 关注于短视的、无状态的最小容器,这些容器通常并不会升级或者重新配置,它们一般都是作为一个整体被替换掉。这就使得 Docker 和类似的项目更像是一种软件发布机制,而不是一个机器管理工具。 -#### Why LXD? +这两种模型并不是完全互斥的。你完全可以使用 LXD 为你的用户提供一个完整的 Linux 系统,而他们可以在 LXD 上面安装 Docker 来运行他们想要的软件。 -We’ve been working on LXC for a number of years now. LXC is great at what it does, that is, it provides a very good set of low-level tools and a library to create and manage containers. -However that kind of low-level tools aren’t necessarily very user friendly. They require a lot of initial knowledge to understand what they do and how they work. Keeping backward compatibility with older containers and deployment methods has also prevented LXC from using some security features by default, leading to more manual configuration for users. +#### 为什么要用 LXD? -We see LXD as the opportunity to address those shortcomings. On top of being a long running daemon which lets us address a lot of the LXC limitations like dynamic resource restrictions, container migration and efficient live migration, it also gave us the opportunity to come up with a new default experience, that’s safe by default and much more user focused. +我们已经在 LXC 上工作了好几个年头了。 LXC 成功的实现了它的目标,它提供了一系列很棒的底层工具和库来创建、管理容器。 -### The main LXD components +然而这些底层工具的使用界面对用户并不是很友好。他们需要用户有很多的基础知识来理解他们要干什么和怎么去干。同时向后兼容旧的容器和部署策略已经阻止 LXC 默认使用一些安全特性,这导致用户需要进行更多人工操作来实现本可以自动完成的工作。 + +我们把 LXD 作为解决这些缺陷的一个很好的机会。作为一个长时间运行的守护进程可以让我们定位到很多 LXC 的限制,比如动态资源限制,容器迁移和有效的进行在线迁移,它同时也给了我们机会来提供一个新的默认体验:默认开启安全特性,对用户更加友好。 + + +### LXD 的主要组件 There are a number of main components that make LXD, those are typically visible in the LXD directory structure, in its command line client and in the API structure itself. -#### Containers +#### 容器 Containers in LXD are made of: @@ -51,13 +57,13 @@ Containers in LXD are made of: - Some properties (container architecture, ephemeral or persistent and the name) - Some runtime state (when using CRIU for checkpoint/restore) -#### Snapshots +#### 快照 Container snapshots are identical to containers except for the fact that they are immutable, they can be renamed, destroyed or restored but cannot be modified in any way. It is worth noting that because we allow storing the container runtime state, this effectively gives us the concept of “stateful” snapshots. That is, the ability to rollback the container including its cpu and memory state at the time of the snapshot. -#### Images +#### 镜像 LXD is image based, all LXD containers come from an image. Images are typically clean Linux distribution images similar to what you would use for a virtual machine or cloud instance. @@ -74,7 +80,7 @@ Remote images are automatically cached by the LXD daemon and kept for a number o Additionally LXD also automatically updates remote images (unless told otherwise) so that the freshest version of the image is always available locally. -#### Profiles +#### 配置 Profiles are a way to define container configuration and container devices in one place and then have it apply to any number of containers. @@ -85,7 +91,7 @@ LXD ships with two pre-configured profiles: - “default” is automatically applied to all containers unless an alternative list of profiles is provided by the user. This profile currently does just one thing, define a “eth0” network device for the container. - “docker” is a profile you can apply to a container which you want to allow to run Docker containers. It requests LXD load some required kernel modules, turns on container nesting and sets up a few device entries. -#### Remotes +#### 远程 As I mentioned earlier, LXD is a networked daemon. The command line client that comes with it can therefore talk to multiple remote LXD servers as well as image servers. @@ -101,7 +107,7 @@ You can also add any number of remote LXD hosts that were configured to listen t It’s that remote mechanism that makes it possible to interact with remote image servers as well as copy or move containers between hosts. -### Security +### 安全性 One aspect that was core to our design of LXD was to make it as safe as possible while allowing modern Linux distributions to run inside it unmodified. @@ -116,7 +122,7 @@ Rather than exposing those features directly to the user as LXC would, we’ve b Communications with LXD itself are secured using TLS 1.2 with a very limited set of allowed ciphers. When dealing with hosts outside of the system certificate authority, LXD will prompt the user to validate the remote fingerprint (SSH style), then cache the certificate for future use. -### The REST API +### REST 接口 Everything that LXD does is done over its REST API. There is no other communication channel between the client and the daemon. @@ -128,13 +134,13 @@ When a more complex communication mechanism is required, LXD will negotiate webs With LXD 2.0, comes the /1.0 stable API. We will not break backward compatibility within the /1.0 API endpoint however we may add extra features to it, which we’ll signal by declaring additional API extensions that the client can look for. -### Containers at scale +### 容器规模化 While LXD provides a good command line client, that client isn’t meant to manage thousands of containers on multiple hosts. For that kind of use cases, we have nova-lxd which is an OpenStack plugin that makes OpenStack treat LXD containers in the exact same way it would treat VMs. This allows for very large deployments of LXDs on a large number of hosts, using the OpenStack APIs to manage network, storage and load-balancing. -### Extra information +### 额外信息 The main LXD website is at: Development happens on Github at: From cc2a52290c4381863422aacc022e7a3a9a96a427 Mon Sep 17 00:00:00 2001 From: Ezio Date: Tue, 3 May 2016 10:43:24 +0800 Subject: [PATCH 0664/1469] translating by ezio --- .../LXD/Part 2 - LXD 2.0: Installing and configuring LXD.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/LXD/Part 2 - LXD 2.0: Installing and configuring LXD.md b/sources/tech/LXD/Part 2 - LXD 2.0: Installing and configuring LXD.md index 56dc7ba607..5f6f492ce1 100644 --- a/sources/tech/LXD/Part 2 - LXD 2.0: Installing and configuring LXD.md +++ b/sources/tech/LXD/Part 2 - LXD 2.0: Installing and configuring LXD.md @@ -1,3 +1,5 @@ +translating by ezio + Part 2 - LXD 2.0: Installing and configuring LXD ================================================= From 860c74a8234c5c14253664161bdca1e377ee7761 Mon Sep 17 00:00:00 2001 From: Ezio Date: Tue, 3 May 2016 11:13:26 +0800 Subject: [PATCH 0665/1469] Update Part 2 - LXD 2.0: Installing and configuring LXD.md --- ...LXD 2.0: Installing and configuring LXD.md | 66 +++++++++---------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/sources/tech/LXD/Part 2 - LXD 2.0: Installing and configuring LXD.md b/sources/tech/LXD/Part 2 - LXD 2.0: Installing and configuring LXD.md index 5f6f492ce1..079b91c429 100644 --- a/sources/tech/LXD/Part 2 - LXD 2.0: Installing and configuring LXD.md +++ b/sources/tech/LXD/Part 2 - LXD 2.0: Installing and configuring LXD.md @@ -1,43 +1,43 @@ translating by ezio -Part 2 - LXD 2.0: Installing and configuring LXD +Part 2 - LXD 2.0: 安装与配置 ================================================= -This is the second blog post in this series about LXD 2.0. +这是 LXD 2.0 [系列介绍文章][2]的第二篇。 ![](https://linuxcontainers.org/static/img/containers.png) -### Where to get LXD and how to install it +### 安装篇 There are many ways to get the latest and greatest LXD. We recommend you use LXD with the latest LXC and Linux kernel to benefit from all its features but we try to degrade gracefully where possible to support older Linux distributions. -#### The Ubuntu archive +#### Ubuntu 标准版 All new releases of LXD get uploaded to the Ubuntu development release within a few minutes of the upstream release. That package is then used to seed all the other source of packages for Ubuntu users. -If you are using the Ubuntu development release (16.04), you can simply do: +如果使用 Ubuntu 16.04 则可以直接安装: ``` sudo apt install lxd ``` -If you are running Ubuntu 14.04, we have backport packages available for you with: +如果运行的是 Ubuntu 14.04,可以这样安装: ``` sudo apt -t trusty-backports install lxd ``` -#### The Ubuntu Core store +#### Ubuntu Core -Users of Ubuntu Core on the stable release can install LXD with: +使用Ubuntu Core 稳定版的用户可以使用下面的命令安装 LXD: ``` sudo snappy install lxd.stgraber ``` -#### The official Ubuntu PPA +#### ubuntu 官方 PPA -Users of other Ubuntu releases such as Ubuntu 15.10 can find LXD packages in the following PPA (Personal Package Archive): +是哟个其他 Ubuntu 发布版 —— 比如 Ubuntu 15.10 —— 的用户可以添加下面的 PPA (Personal Package Archive) 来安装: ``` sudo apt-add-repository ppa:ubuntu-lxc/stable @@ -46,21 +46,21 @@ sudo apt dist-upgrade sudo apt install lxd ``` -#### The Gentoo archive +#### Gentoo -Gentoo has pretty recent LXD packages available too, you can install those with: +Gentoo 已经有了最新的 LXD 安装包,你可以直接安装: ``` sudo emerge --ask lxd ``` -#### From source +#### 源代码 Building LXD from source isn’t very difficult if you are used to building Go projects. Note however that you will need the LXC development headers. In order to run LXD, your distribution also needs a recent Linux kernel (3.13 at least), recent LXC (1.1.5 or higher), LXCFS and a version of shadow that supports user sub-uid/gid allocations. The latest instructions on building LXD from source can be found in the [upstream README][2]. -### Networking on Ubuntu +### ubuntu 上的网络配置 The Ubuntu packages provide you with a “lxdbr0” bridge as a convenience. This bridge comes unconfigured by default, offering only IPv6 link-local connectivity through an HTTP proxy. @@ -76,7 +76,7 @@ Or go through the whole LXD step by step setup (see below) with: sudo lxd init ``` -### Storage backends +### 存储系统 LXD supports a number of storage backends. It’s best to know what backend you want to use prior to starting to use LXD as we do not support moving existing containers or images between backends. @@ -86,21 +86,22 @@ A feature comparison table of the different backends can be found [here][3]. Our recommendation is ZFS as it supports all the features LXD needs to offer the fastest and most reliable container experience. This includes per-container disk quotas, immediate snapshot/restore, optimized migration (send/receive) and instant container creation from an image. It is also considered more mature than btrfs. -To use ZFS with LXD, you first need ZFS on your system. -If using Ubuntu 16.04, simply install it with: +要和 LXD 一起使用 ZFS ,你需要首先在你的系统上安装 ZFS。 + +如果你是用的是 Ubuntu 16.04 , 你只需要简单的使用命令安装: ``` sudo apt install zfsutils-linux ``` -On Ubuntu 15.10, you can install it with: +在 Ubuntu 15.10 上你可以这样安装: ``` sudo apt install zfsutils-linux zfs-dkms ``` -And on older releases, you can use the zfsonlinux PPA: +如果是更旧的版本,你需要这样安装: ``` sudo apt-add-repository ppa:zfs-native/stable @@ -108,7 +109,7 @@ sudo apt update sudo apt install ubuntu-zfs ``` -To configure LXD to use it, simply run: +配置 LXD 只需要简单的执行下面的命令: ``` sudo lxd init @@ -139,7 +140,7 @@ By default LXD uses ext4 as the filesystem for all the LVs. You can change that lxc config set storage.lvm_fstype xfs ``` -#### Simple directory +#### 简单目录 If none of the above are an option for you, LXD will still work but without any of those advanced features. It will simply create a directory for each container, unpack the image tarballs for each container creation and do a full filesystem copy on container copy or snapshot. @@ -147,11 +148,11 @@ All features are supported except for disk quotas, but this is very wasteful of -### More daemon configuration +### 配置篇 The complete list of configuration options for the LXD daemon can be found [here][4]. -#### Network configuration +#### 网络配置 By default LXD doesn’t listen to the network. The only way to talk to it is over a local unix socket at /var/lib/lxd/unix.socket. @@ -172,7 +173,7 @@ You can also choose not to set a password and instead manually trust each new cl lxc config trust add client.crt ``` -#### Proxy configuration +#### 代理配置 In most setups, you’ll want the LXD daemon to fetch images from remote servers. @@ -186,7 +187,7 @@ lxc config set core.proxy_ignore_hosts image-server.local With those, all transfers initiated by LXD will use the squid01.internal HTTP proxy, except for traffic to the server at image-server.local -#### Image management +#### 镜像管理 LXD does dynamic image caching. When instructed to create a container from a remote image, it will download that image into its image store, mark it as cached and record its origin. After a number of days without seeing any use (10 by default), the image is automatically removed. Every few hours (6 by default), LXD also goes looking for a newer version of the image and updates its local copy. @@ -200,19 +201,18 @@ lxc config set images.auto_update_cached false Here we are instructing LXD to override all of those defaults and instead cache images for up to 5 days since they were last used, look for image updates every 24 hours and only update images which were directly marked as such (–auto-update flag in lxc image copy) but not the images which were automatically cached by LXD. -### Conclusion +### 总结 At this point you should have a working version of the latest LXD release, you can now start playing with it on your own or wait for the next blog post where we’ll create our first container and play with the LXD command line tool. -### Extra information +### 额外信息 -The main LXD website is at: -Development happens on Github at: -Mailing-list support happens on: -IRC support happens in: #lxcontainers on irc.freenode.net - -And if you don’t want or can’t install LXD on your own machine, you can always [try it online instead][1]! +LXD 的主站在: +LXD 的 GitHub 仓库: +LXD 的邮件列表: +LXD 的 IRC 频道: #lxcontainers on irc.freenode.net +如果你不想或者不能在你的机器上安装 LXD ,你可以[试试在线版的 LXD][1] 。 -------------------------------------------------------------------------------- From 981b20fbd4060aa3aab0382361abba76b45102b0 Mon Sep 17 00:00:00 2001 From: alim0x Date: Tue, 3 May 2016 21:52:36 +0800 Subject: [PATCH 0666/1469] [translated]20160204 An Introduction to SELinux --- .../20160204 An Introduction to SELinux.md | 138 ----------------- .../20160204 An Introduction to SELinux.md | 139 ++++++++++++++++++ 2 files changed, 139 insertions(+), 138 deletions(-) delete mode 100644 sources/tech/20160204 An Introduction to SELinux.md create mode 100644 translated/tech/20160204 An Introduction to SELinux.md diff --git a/sources/tech/20160204 An Introduction to SELinux.md b/sources/tech/20160204 An Introduction to SELinux.md deleted file mode 100644 index dbf579c461..0000000000 --- a/sources/tech/20160204 An Introduction to SELinux.md +++ /dev/null @@ -1,138 +0,0 @@ -alim0x translating - -An Introduction to SELinux -=============================== - -![](https://www.linux.com/images/stories/66866/jack2-selinux_a.png) - ->Figure 1: The getenforce command reporting SELinux is set to Enforcing. - -Way back in kernel 2.6, a new security system was introduced to provide a mechanism for supporting access control security policies. This system was [Security Enhanced Linux (SELinux)][1] and was introduced by the [National Security Administration (NSA)][2] to incorporate a strong Mandatory Access Control architecture into the subsystems of the Linux kernel. - -If you’ve spent your entire Linux career either disabling or ignoring SELinux, this article is dedicated to you — an introduction to the system that lives “under the hood” of your Linux desktop or server to limit privilege or even eliminate the possibility of damage should programs or daemons become compromised. - -Before I begin, you should know that SELinux is primarily a tool for Red Hat Linux and its derivatives. The likes of Ubuntu and SUSE (and their derivatives) make use of AppArmor. SELinux and AppArmor are significantly different. You can install SELinux on SUSE, openSUSE, Ubuntu, etc., but it’s an incredibly challenging task unless you’re very well versed in Linux. - -With that said, let me introduce you to SELinux. - -### DAC vs. MAC - -The old-guard standard form of access control on Linux was Discretionary Access Control (DAC). With this form, an application or daemon runs under either User ID (UID) or Set owner User ID (SUID) and holds object permissions (for files, sockets, and other processes) of that user. This made it easier for malicious code to be run with a permission set that would grant it access to crucial subsystems. - -Mandatory Access Control (MAC), on the other hand, enforces the separation of information based on both confidentiality and integrity to enable the confinement of damage. The confinement unit operates independently of the traditional Linux security mechanisms and has no concept of a superuser. - -### How SELinux Works - -Consider these pieces of the SELinux puzzle: - -- Subjects - -- Objects - -- Policy - -- Mode - -When a subject (such as an application) attempts to access an object (such as a file), the SELinux Security Server (inside the kernel) runs a check against the Policy Database. Depending on the current mode, if the SELinux Security Server grants permission, the subject is given access to the object. If the SELinux Security Server denies permission, a denied message is logged in /var/log/messages. - -Sounds relatively simple, right? There’s actually more to it than that, but for the sake of introduction, those are the important steps. - -### The Modes - -SELinux has three modes (which can be set by the user). These modes will dictate how SELinux acts upon subject request. The modes are: - -- Enforcing — SELinux policy is enforced and subjects will be denied or granted access to objects based on the SELinux policy rules - -- Permissive — SELinux policy is not enforced and does not deny access, although denials are logged - -- Disabled — SELinux is completely disabled - -Out of the box, most systems have SELinux set to Enforcing. How do you know what mode your system is currently running? You can use a simple command to report the mode; that command is getenforce. This command is incredibly simple to use (as it has the singular purpose of reporting the SELinux mode). To use this tool, open up a terminal window and issue the command getenforce. The report will come back with either, Enforcing, Permissive, or Disabled (see Figure 1 above). - -Setting the SELinux mode is actually quite simple — depending upon the mode you want to set. Understand this: It is never recommended to set SELinux to Disable. Why? When you do this, you open up the possibility that files on your disk will be mislabeled and require a re-label to fix. It is also not possible to change the mode of a system when it has been booted in Disabled mode. Your best modes are either Enabled or Permissive. - -You can change the SELinux mode from the command line or in the /etc/selinux/config file. To set the mod via command line, you use the setenforce tool. To set the mode to Enforcing, do the following: - -1. Open up a terminal window - -2. Issue the command su and then enter your administrator password - -3. Issue the command setenforce 1 - -4. Issue the command getenforce to ensure the mode has been set (Figure 2) - -![](https://www.linux.com/images/stories/66866/jack-selinux_b.png) - ->Figure 2: Setting the SELinux mode to Enforcing. - -To set the mode to Permissive, do this: - -1. Open up a terminal window - -2. Issue the command su and then enter your administrator password - -3. Issue the command setenforce 0 - -4. Issue the command getenforce to ensure the mode has been set (Figure 3) - -![](https://www.linux.com/images/stories/66866/jack-selinux_c.png) - ->Figure 3: Setting the SELinux mode to Permissive. - -NOTE: Setting the mode via command line overrides the setting in the SELinux config file. - -If you’d prefer to set the mode in the SELinux command file, open up that particular file in your favorite text editor and look for the line: - ->SELINUX=permissive - -You can change the mode to suit your preference and then save the file. - -There is also a third method of changing the SELinux mode (via the bootloader), but I don’t recommend it for a beginning user. - -### Policy Type - -There are two types of SELinux policies: - -- Targeted — only targeted network daemons (dhcpd, httpd, named, nscd, ntpd, portmap, snmpd, squid, and syslogd) are protected - -- Strict — full SELinux protection for all daemons - -You can change the policy type within the /etc/selinux/config file. Open the file in your favorite text editor and look for the line: - ->SELINUXTYPE=targeted - -Change the option in that line to either targeted or strict to match your needs. - -### Checking the Full SELinux Status - -There is a handy SELinux tool you might want to know about that will display a detailed status report of your SELinux-enabled system. The command is run from a terminal window like this: - ->sestatus -v - -You should see output similar to that shown in Figure 4. - -![](https://www.linux.com/images/stories/66866/jack-selinux_d.png) - ->Figure 4: The output of the sestatus -v command. - -### Just Scratching the Surface - -As you might expect, I have only scratched the surface of SELinux. It is quite a complex system and will require diving much deeper to obtain a solid understanding of how it works for you and how you can make it better work for your desktops and servers. I still have yet to cover troubleshooting and creating custom SELinux policies. - -SELinux is a powerful tool that any Linux administrator should know. Now that you’ve been introduced, I highly recommend you return to Linux.com (when more tutorials on the subject are posted) or take a look at the [NSA SELinux documentation][3] for very in-depth tutorials. - - --------------------------------------------------------------------------------- - -via: https://www.linux.com/learn/docs/ldp/883671-an-introduction-to-selinux - -作者:[Jack Wallen][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.linux.com/community/forums/person/93 -[1]: http://selinuxproject.org/page/Main_Page -[2]: https://www.nsa.gov/research/selinux/ -[3]: https://www.nsa.gov/research/selinux/docs.shtml diff --git a/translated/tech/20160204 An Introduction to SELinux.md b/translated/tech/20160204 An Introduction to SELinux.md new file mode 100644 index 0000000000..bc82106189 --- /dev/null +++ b/translated/tech/20160204 An Introduction to SELinux.md @@ -0,0 +1,139 @@ +An Introduction to SELinux +=============================== + +![](https://www.linux.com/images/stories/66866/jack2-selinux_a.png) + +>图 1:getenforce 命令显示 SELinux 的状态是 Enforcing 启用状态。 + +回到 Kernel 2.6 时代,那时候引入了一个新的安全系统,用以提供访问控制安全策略的机制。这个系统就是 [Security Enhanced Linux (SELinux)][1],它是由[美国国家安全局(NSA)][2]引入的,合并进 Linux 内核子系统的强制控制访问架构实现。 + +如果你在你整个 Linux 生涯中禁用或忽略 SELinux,这篇文章就是为你量身定制的——对存在于你的 Linux 桌面或服务器之下的 SELinux 系统的介绍,它能够限制权限,甚至消除程序或守护进程的妥协而造成破坏的可能性。 + +在我开始之前,你应该了解的是 SELinux 主要是红帽 Red Hat Linux 以及它的衍生发行版的一个工具。这就类似 Ubuntu 和 SUSE(以及它们的衍生发行版)使用 AppArmor 一样。SELinux 和 AppArmor 有显著的不同。你可以在 SUSE,openSUSE,Ubuntu 等等发行版上安装 SELinux,但这是项难以置信的挑战,除非你十分精通 Linux。 + +说了这么多,让我来向你介绍 SELinux。 + +### DAC vs. MAC + +Linux 上保守的访问控制标准是自主访问控制(Discretionary Access Control,DAC)。在这种形式下,一个软件或守护进程运行在 User ID(UID)或 Set User ID(SUID)下,并且拥有该用户的目标权限(文件,套接字,以及其它进程)。这使得恶意代码很容易运行在特定权限之下,从而取得访问关键的子系统的权限。 + +另一方面,强制访问控制(Mandatory Access Control,MAC)基于保密性和完整性强制信息的隔离以限制破坏。限制单元相对于传统的 Linux 安全机制独立运作,并且没有超级用户的概念。 + +### SELinux 如何工作 + +考虑一下 SELinux 的相关概念: + +- Subjects 主体 + +- Objects 目标 + +- Policy 策略 + +- Mode 模式 + +当一个主体(Subject,如一个程序)尝试访问一个目标(Object,如一个文件),SELinux 安全服务器(SELinux Security Server,在内核中)从策略数据库中运行一个检查。基于当前的模式,如果 SELinux 安全服务器授予权限,该主体就能够访问该目标。如果 SELinux 安全服务器拒绝了权限,一条拒绝信息会被记录到 /var/log/messages。 + +听起来相对比较简单是不是?实际上过程要更加复杂,但为了简单介绍,这些是重要的步骤。 + +### 模式 + +SELinux 有三个模式(可以由用户设置)。这些模式将规定 SELinux 在主体请求时如何应对。这些模式是: + +- Enforcing — SELinux 策略强制执行,基于 SELinux 策略规则授予或拒绝主体对目标的访问 + +- Permissive — SELinux 策略不强制执行,不实际拒绝访问,但会有警告信息且拒绝会写入日志 + +- Disabled — 完全禁用 SELinux + +默认情况下,大部分系统的 SELinux 设置为 Enforcing。你要如何知道你的系统当前是什么模式?你可以使用一条简单的命令来查看,这条命令就是 getenforce。这个命令用起来难以置信的简单(因为它仅仅用来报告 SELinux 的模式)。要使用这个工具,打开一个终端窗口并执行 getenforce 命令。命令会返回 Enforcing,Permissive,或者 Disabled(见上方图 1)。 + +设置 SELinux 的模式实际上很简单——取决于你想设置什么模式。记住:永远不推荐关闭 SELinux。为什么?当你这么做了,你就有了这种可能性:你磁盘上的文件可能会被打上错误的标签,需要你重新标签来修复。而且你无法修改一个以 Disabled 模式启动的系统的模式。你的最佳模式是 Enforcing 或者 Permissive。 + +你可以从命令行或 /etc/selinux/config 文件更改 SELinux 的模式。要从命令行设置模式,你可以使用 setenforce 工具。要设置 Enforcing 模式,按下面这么做: + +1. 打开一个终端窗口 + +2. 执行 su 然后输入你的管理员密码 + +3. 执行 setenforce 1 + +4. 执行 getenforce 确定模式已经正确设置(图 2) + +![](https://www.linux.com/images/stories/66866/jack-selinux_b.png) + +>图 2:设置 SELinux 模式为 Enforcing。 + +要设置模式为 Permissive,这么做: + +1. 打开一个终端窗口 + +2. 执行 su 然后输入你的管理员密码 + +3. 执行 setenforce 0 + +4. 执行 getenforce 确定模式已经正确设置(图 3) + +![](https://www.linux.com/images/stories/66866/jack-selinux_c.png) + +>图 3:设置 SELinux 模式为 Permissive. + +注:通过命令行设置模式会覆盖 SELinux 配置文件中的设置。 + +如果你更愿意在 SELinux 命令文件中设置模式,用你喜欢的编辑器打开那个文件找到这一行: + +>SELINUX=permissive + +你可以按你的偏好设置模式,然后保存文件。 + +还有第三种方法修改 SELinux 的模式(通过 bootloader),但我不推荐新用户这么做。 + +### 策略类型 + +SELinux 策略有两种: + +- Targeted — 只有目标网络进程(dhcpd,httpd,named,nscd,ntpd,portmap,snmpd,squid,以及 syslogd)受保护 + +- Strict — 对所有进程完全的 SELinux 保护 + +你可以在 /etc/selinux/config 文件中修改策略类型。用你喜欢的编辑器打开这个文件找到这一行: + +>SELINUXTYPE=targeted + +修改这个选项为 targeted 或 strict 以满足你的需求。 + +### 检查完整的 SELinux 状态 + +有个方便的 SELinux 工具,你可能想要用它来获取你启用了 SELinux 的系统的详细状态报告。这个命令在终端像这样运行: + +>sestatus -v + +你可以看到像图 4 那样的输出。 + +![](https://www.linux.com/images/stories/66866/jack-selinux_d.png) + +>图 4:sestatus -v 命令的输出。 + +### 仅是皮毛 + +和你预想的一样,我只介绍了 SELinux 的一点皮毛。SELinux 的确是个复杂的系统,想要更扎实地理解它是如何工作的,以及了解如何让它更好地为你的桌面或服务器工作需要更加地深入。我的内容还没有覆盖到疑难解答和创建自定义 SELinux 策略。 + +SELinux 是所有 Linux 管理员都应该知道的强大工具。现在已经向你介绍了 SELinux,我强烈推荐你回到 Linux.com(当有更多关于此话题的文章发表的时候)或看看 [NSA SELinux 文档][3] 获得更加深入的指南。 + +LCTT - 相关阅读:[鸟哥的 Linux 私房菜——程序管理与 SELinux 初探][4] + + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/learn/docs/ldp/883671-an-introduction-to-selinux + +作者:[Jack Wallen][a] +译者:[alim0x](https://github.com/alim0x) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.linux.com/community/forums/person/93 +[1]: http://selinuxproject.org/page/Main_Page +[2]: https://www.nsa.gov/research/selinux/ +[3]: https://www.nsa.gov/research/selinux/docs.shtml +[4]: http://vbird.dic.ksu.edu.tw/linux_basic/0440processcontrol_5.php From c5bb7de061f2d89b27edf38ca4b64479cec5b750 Mon Sep 17 00:00:00 2001 From: Purling Nayuki Date: Wed, 4 May 2016 02:39:22 +0800 Subject: [PATCH 0667/1469] Proofread 20151227 Upheaval in the Debian Live project Moved original file to news folder though it's a little bit obsolete. --- ...227 Upheaval in the Debian Live project.md | 83 ------------------- ...227 Upheaval in the Debian Live project.md | 67 +++++++++++++++ 2 files changed, 67 insertions(+), 83 deletions(-) delete mode 100644 translated/20151227 Upheaval in the Debian Live project.md create mode 100644 translated/news/20151227 Upheaval in the Debian Live project.md diff --git a/translated/20151227 Upheaval in the Debian Live project.md b/translated/20151227 Upheaval in the Debian Live project.md deleted file mode 100644 index 7d03ce831a..0000000000 --- a/translated/20151227 Upheaval in the Debian Live project.md +++ /dev/null @@ -1,83 +0,0 @@ -Debian Live项目的剧变 - -围绕Debian Live 项目发生了很多戏剧性事件,但是有一个关于Debian Live项目][1]结束的[公告][2],它比项目第一次出现的时候影响力还小。这个项目的创始人退出必定是有原因的,社区对他的待遇和项目的收效是很令人沮丧的,但是这个项目还是会以其他的形式继续下去。所以Debian仍然会有很多的工具去在创造启动光盘和其他介质的道路上继续向前。项目创始人Dabiel Baumann和Debian CD团队以及安装检测团队之间出现的长期争论已经被"解决"了,尽管是用这样一种有遗憾的方式。                                      - -在11月9日,Baumann发表了题为"Dabian Live项目的突然结束"的一篇公告。在那篇短文中,他一一列举出了自从这个和他有关的[项目被发起][3]以来10间发生的不同的事件,可以表明他在Debian Live项目上的努力一直没有被重视,至少从这些方面。最具决定性的因素是因为在"包的含义"上存在冲突,R.Learmonth[申请][4]了新的包名,而这却侵犯了在Debian Live上使用的命名空间。 - -考虑到最主要的Debian Live包之一被命名为"live-build",而新的包名却叫"live-build-ng",这简直是对"live-build"的挑战。live-build-ng意为一种围绕[vmdebootstrap][5]【译者注:创造真实的和虚拟机Debian的磁盘映像】工具的外部包装,这种包装是为了创造live介质(光盘和USB的插入),也是Debian Live最需要的的部分。但是当 Baumann Learmonth[要求][6]为他的包换一个不同的名字的时候,他得到了一个“有趣”的[回复][7]: - -``` - -live-build不是一个Debian项目,这件事应该受到我们的关注,它是一个外部的项目。但是社区要求它成为一个官方的Debian项目,这件事需要我们敲定。 -这不是命名空间的问题,我们要将以目前维护的live配置和live启动包为基础,把它加入到Debian的本地项目。如果迫不得已的话,这将会有很多分支,但是我希望它不要发生,这样的话我们就可以把这些包整合到Debian中继续以一种协作的方式去开发。 -live-build已经被debian-cd放弃,live-build-ng将会取代它。至少在一个精简的Debian环境中,live-build会被放弃。live-build-ng将要通过debian-cd和Debian安装者合作的方式去开发。 -``` - - - -Debian Live 是一个“官方的”Debian项目(或者可以狭义的"官方"),尽管它因为思路上的不同产生过争论.除此之外,vmdebootstrap的维护者Neil Willians为脱离Debian Live项目[提供了如下的解释][8]: - -``` - -为了更好的支持live-build的代替者,vmdebootstrap肯定会被推广。这项工作会由debian-cd团队来负责,debian-cd能够用live-build解决目前存在的问题。 这些问题包括可靠性问题,以及不能很好的支持多种机器和UEFI等。 vmdebootstrap也存在着这些问题,我们用来自于对live-boot和live-config的支持情况来确定vmdebootstrap的功能。 -``` - - - -这些想要取代"live-build"的说辞看起来有道理,但是目前的项目存在的上述问题已经得到了初步解决。相反的,一些秘密的项目很明显的意图是取代live-build。正如Baumann[指出][9]的,这些计划没有被加入到debian-live的邮件列表中。人们可以从Debian Live项目中得到这些计划的信息也是因为这一次的ITP事件。所以它看起来像是一个"秘密计划"—有些东西在一个像Debian这样的项目中不能很好的安排。 - -人们可能已经猜到了,有很多帖子都支持Baumann[重命名][10]"live-build-ng"的请求,但是紧跟着,人们就因为他要停止在Debian Live 上继续工作的决定而变得沮丧。但是Learmonth 和 Williams却坚定不移,他们两人都是取代live-build所需要的开发者。Learmonth 给“live-build-ng”换了一个新的有很少争议性的名字:Live-wrapper。他说他的目标是为Debian Live项目加入新的工具(并且“把Debian Live 项目引入Debian里面),但是完成这件事还需要很大的努力。 - - -``` - -我向已经被ITP问题所困扰的每个人道歉。作为live-build的取代者,live-wrapper这个软件的稳定性还很差,为了让人们知道工作的进展同时收集反馈,它已经被存档。虽然有了这部分的工作,但是收到的反馈并不是我所需要的。 -``` - -这种对于取代live-build的强烈的反对或许已经被预知到了。自由软件社区的沟通和交流很关键,所以,替换一个项目核心的计划是很有争议的——更何况这个计划一直不被人们所知。从Banumann的角度来说,他当然不是完美的,他通过上传和下载一个不合适的[syslinux包][11]来延迟“wheezy”的发布,并且从那以后他从一个Debian发起人[成为][12]了一个Debian维护者。——但是他也不应该受到这种对待。当然,这个项目还有其他人参与,所以不仅仅是Baumann受到了影响。 - -Ben Armstrong是这些人中的其中之一,在这个事件中,他很圆滑地处理了一些事,并且想从这个事件中全身而退。他从一个邮件[13]开始,这个邮件是为了庆祝这个项目以及他和他的团队在过去几年完成的一些工作。正如他所说,这种基于Debian Live的[下流项目列表][14]是很令人振奋的。在另一个邮件中,他也[指出][15]了这个项目不是没有生命力的: - - -``` - -如果Debian CD开发团队通过他们的努力获得成功,这样产品的替换就会是可行的、可靠的、利于测试的,同时有一个合适的候选者去取代live-build,这对于Debian项目有利无害。如果他们继续做这件事,他们不会“用一个官方改良的,不可靠的,几乎没有测试的待选者取代live-build”。到目前为止,我还没有看到他们那样做。其间,live-build仍在存档,没有很快删除,它仍然处于良好状态,并没有一种改进的继任者来取代它。 -``` - - -11月24号,Armstrong也在[他的博客][16]上[发布][17]了一个有关Debian Live的新消息。它展示了自从 Baumann退出后两周内的让人高兴的进展。可以说是在这个项目和live-wrapper开发者之间产生合作的里程碑。博客上也有了一个[计划表][18],同时不可避免地寻求更多的帮助。他也列举了一些理由,试图让人们相信围绕项目发生的戏剧性事件仅仅是一个可以避免的小问题,而不是像现在这样。 - - - - - - ---------------------------------- - -via: https://lwn.net/Articles/665839/ - -作者:Jake Edge -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - - -[1]: https://lwn.net/Articles/666127/ -[2]: http://live.debian.net/ -[3]: https://www.debian.org/News/weekly/2006/08/ -[4]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804315 -[5]: http://liw.fi/vmdebootstrap/ -[6]: https://lwn.net/Articles/666173/ -[7]: https://lwn.net/Articles/666176/ -[8]: https://lwn.net/Articles/666181/ -[9]: https://lwn.net/Articles/666208/ -[10]: https://lwn.net/Articles/666321/ -[11]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=699808 -[12]: https://nm.debian.org/public/process/14450 -[13]: https://lwn.net/Articles/666336/ -[14]: http://live.debian.net/project/downstream/ -[15]: https://lwn.net/Articles/666338/ -[16]: https://lwn.net/Articles/666340/ -[17]: http://syn.theti.ca/2015/11/24/debian-live-after-debian-live/ -[18]: https://wiki.debian.org/DebianLive/TODO diff --git a/translated/news/20151227 Upheaval in the Debian Live project.md b/translated/news/20151227 Upheaval in the Debian Live project.md new file mode 100644 index 0000000000..9b3d4dc2f0 --- /dev/null +++ b/translated/news/20151227 Upheaval in the Debian Live project.md @@ -0,0 +1,67 @@ +Debian Live项目的剧变 +================================================================================== + +尽管围绕 Debian Live 项目发生了很多戏剧性事件,关于 [Debian Live 项目][1]结束的[公告][2]的影响力甚至小于该项目首次出现时的公告。主要开发者的离开是最显而易见的损失,而社区对他本人及其项目的态度是很令人困惑的,但是这个项目也许还是会以其他的形式继续下去。所以 Debian 仍然会有更多的工具去创造启动光盘和其他介质。尽管是用这样一种有遗憾的方式,项目创始人 Dabiel Baumann 和 Debian CD 团队以及安装检测团队之间出现的长期争论已经被「解决」了。                                      +在 11 月 9 日, Baumann 发表了题为「 Debian Live 项目的突然结束」的一篇公告。在那篇短文中,他一一列举出了自从这个和他有关的[项目被发起][3]以来近 10 年间发生的不同的事件,这些事件可以表明他在 Debian Live 项目上的努力一直没有被重视或没有被足够重视。最具决定性的因素是因为在「包的含义」上存在冲突, R.Learmonth [申请][4]了新的包名,而这侵犯了在 Debian Live 上使用的命名空间。 + +考虑到最主要的 Debian Live 包之一被命名为 live-build ,而 R.Learmonth 申请的新包名却是 live-build-ng ,这简直是对 live-build 的挑战。 live-build-ng 意为一种围绕 [vmdebootstrap][5]【译者注:创造真实的和虚拟机Debian的磁盘映像】工具的外部包装,这种包装是为了创造 live 介质(光盘和USB的插入),也是 Debian Live 最需要的的部分。但是当 Baumann Learmonth [要求][6]为他的包换一个不同的名字的时候,他得到了一个「有趣」的[回复][7]: + +``` +应该注意到, live-build 不是一个 Debian 项目,它是一个声称自己是官方 Debian 项目的外部项目,这是一个需要我们解决的问题。 +这不是命名空间的问题,我们要将以目前维护的 live-config 和 live-boot 包为基础,把它们加入到 Debian 的本地项目。如果迫不得已的话,这将会有很多分支,但是我希望它不要发生,这样的话我们就可以把这些包整合到 Debian 中并继续以一种协作的方式去开发。 +live-build 已经被 debian-cd 放弃,live-build-ng 将会取代它。至少在一个精简的 Debian 环境中,live-build 会被放弃。我们(开发团队)正在与 debian-cd 和 Debian Installer 团队合作开发 live-build-ng 。 +``` + +Debian Live 是一个「官方的」 Debian 项目(也可以是狭义的「官方」),尽管它因为思路上的不同产生过争论。除此之外, vmdebootstrap 的维护者 Neil Willians 为脱离 Debian Live 项目[提供了如下的解释][8]: + +``` +为了更好的支持 live-build 的代替者, vmdebootstrap 肯定会被推广。为了能够用 live-build 解决目前存在的问题,这项工作会由 debian-cd 团队来负责。这些问题包括可靠性问题,以及不能很好的支持多种机器和 UEFI 等。 vmdebootstrap 也存在着这些问题,我们用来自于对 live-boot 和 live-config 的支持情况来确定 vmdebootstrap 的功能。 +``` + +这些抱怨听起来合情合理,但是它们可能已经在目前的项目中得到了解决。然而一些秘密的项目有很明显的取代 live-build 的意图。正如 Baumann [指出][9]的,这些计划没有被发布到 debian-live 的邮件列表中。人们首次从 Debian Live 项目中获知这些计划正是因为这一次的ITP事件,所以它看起来像是一个「秘密计划」——有些事情在像 Debian 这样的项目中得不到很好的安排。 + +人们可能已经猜到了,有很多帖子都支持 Baumann [重命名][10] live-build-ng 的请求,但是紧接着,人们就因为他要停止继续在 Debian Live 上工作的决定而变得沮丧。然而 Learmonth 和 Williams 却坚持认为取代 live-build 很有必要。Learmonth 给 live-build-ng 换了一个争议性也许小一些的名字: live-wrapper 。他说他的目标是为 Debian Live 项目加入新的工具(并且「把 Debian Live 项目引入 Debian 里面」),但是完成这件事还需要很大的努力。 + +``` +我向已经被 ITP 问题所困扰的每个人道歉。我们已经告知大家 live-wrapper 还不足以完全替代 live-build 且开发工作仍在进行以收集反馈。尽管有了这部分的工作,我们收到的反馈缺并不是我们所需要的。 +``` + +这种对于取代 live-build 的强烈反对或许已经被预知到了。自由软件社区的沟通和交流很关键,所以,计划去替换一个项目的核心很容易引起争议——更何况是一个一直不为人所知的计划。从 Banumann 的角度来说,他当然不是完美的,他因为上传个不合适的 [syslinux 包][11]导致了 wheezy 的延迟发布,并且从那以后他被从 Debian 开发者暂时[降级][12]为 Debian 维护者。但是这不意味着他应该受到这种对待。当然,这个项目还有其他人参与,所以不仅仅是 Baumann 受到了影响。 + +Ben Armstrong 是其他参与者中的一位,在这个事件中,他很圆滑地处理了一些事,并且想从这个事件中全身而退。他从一封邮件[13]开始,这个邮件是为了庆祝这个项目,以及他和他的团队在过去几年取得的成果。正如他所说, Debian Live 的[下游项目列表][14]是很令人振奋的。在另一封邮件中,他也[指出][15]了这个项目不是没有生命力的: + +``` +如果 Debian CD 开发团队通过他们的努力开发出可行的、可靠的、经过完善测试替代品,以及一个合适的取代 live-build 的候选者,这对于 Debian 项目有利无害。如果他们继续做这件事,他们不会「用一个官方改良,但不可靠且几乎没有经过测试的待选者取代 live-build 」。到目前为止,我还没有看到他们那样做的迹象。其间, live-build 仍保留在存档中——它仍然处于良好状态,且没有一种经过改良的继任者来取代它,因此开发团队没有必要尽快删除它。 +``` + +11 月 24 号, Armstrong 也在[他的博客][16]上[发布][17]了一个有关 Debian Live 的新消息。它展示了从 Baumann 退出起两周内的令人高兴的进展。甚至有迹象表明 Debian Live 项目与 live-wrapper 开发者开展了合作。博客上也有了一个[计划表][18],同时不可避免地寻求更多的帮助。这让人们有理由相信围绕项目发生的戏剧性事件仅仅是一个小摩擦——也许不可避免,但绝不是像现在看起来这么糟糕。 + +--------------------------------- + +via: https://lwn.net/Articles/665839/ + +作者:Jake Edge +译者:[vim-kakali](https://github.com/vim-kakali) +校对:[PurlingNayuki](https://github.com/PurlingNayuki) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + + +[1]: https://lwn.net/Articles/666127/ +[2]: http://live.debian.net/ +[3]: https://www.debian.org/News/weekly/2006/08/ +[4]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804315 +[5]: http://liw.fi/vmdebootstrap/ +[6]: https://lwn.net/Articles/666173/ +[7]: https://lwn.net/Articles/666176/ +[8]: https://lwn.net/Articles/666181/ +[9]: https://lwn.net/Articles/666208/ +[10]: https://lwn.net/Articles/666321/ +[11]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=699808 +[12]: https://nm.debian.org/public/process/14450 +[13]: https://lwn.net/Articles/666336/ +[14]: http://live.debian.net/project/downstream/ +[15]: https://lwn.net/Articles/666338/ +[16]: https://lwn.net/Articles/666340/ +[17]: http://syn.theti.ca/2015/11/24/debian-live-after-debian-live/ +[18]: https://wiki.debian.org/DebianLive/TODO From 2e120295fef699836401cd1f359ab774e444a0fc Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 4 May 2016 09:43:47 +0800 Subject: [PATCH 0668/1469] Update Part 1 - LXD 2.0: Introduction to LXD.md --- .../Part 1 - LXD 2.0: Introduction to LXD.md | 72 +++++++++---------- 1 file changed, 35 insertions(+), 37 deletions(-) diff --git a/sources/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md b/sources/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md index 4c33d2fc8f..373a8c03dc 100644 --- a/sources/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md +++ b/sources/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md @@ -12,10 +12,6 @@ Part 1 - LXD 2.0: LXD 入门 #### 什么是 LXD ? -At its simplest, LXD is a daemon which provides a REST API to drive LXC containers. - -Its main goal is to provide a user experience that’s similar to that of virtual machines but using Linux containers rather than hardware virtualization. - 简单来说 LXD 就是一个提供了 REST API 的 LXC 容器管理器。 LXD 最主要的目标就是使用 Linux 容器而不是硬件虚拟化向用户提供一种接近虚拟机的使用体验。 @@ -44,68 +40,70 @@ LXD 聚焦于系统容器,通常也被称为架构容器。这就是说 LXD ### LXD 的主要组件 -There are a number of main components that make LXD, those are typically visible in the LXD directory structure, in its command line client and in the API structure itself. +LXD 是由几个主要组件构成的,在它的命令行客户端和 API结构体里,这些组件都是 LXD 目录结构下可见的。 #### 容器 -Containers in LXD are made of: +LXD 中的容器包括以下及部分: -- A filesystem (rootfs) -- A list of configuration options, including resource limits, environment, security options and more -- A bunch of devices like disks, character/block unix devices and network interfaces -- A set of profiles the container inherits configuration from (see below) -- Some properties (container architecture, ephemeral or persistent and the name) -- Some runtime state (when using CRIU for checkpoint/restore) +- 根文件系统 +- 设备:包括磁盘、unix 字符/块设备、网络接口 +- 一组继承而来的容器配置文件 +- 属性(容器架构,暂时的或持久的,容器名) +- 运行时状态(当时为了记录检查点、恢复时用到了 CRIU时) #### 快照 -Container snapshots are identical to containers except for the fact that they are immutable, they can be renamed, destroyed or restored but cannot be modified in any way. +容器快照和容器是一回事,只不过快照是不可修改的,只能被重命名,销毁或者用来恢复系统,但是无论如何都不能被修改。 -It is worth noting that because we allow storing the container runtime state, this effectively gives us the concept of “stateful” snapshots. That is, the ability to rollback the container including its cpu and memory state at the time of the snapshot. +值得注意的是,因为我们允许用户保存容器的运行时状态,这就有效的为我们提供了“有状态”的快照的功能。这就是说我们可以使用快照回滚容器的 cpu 和内存。 #### 镜像 -LXD is image based, all LXD containers come from an image. Images are typically clean Linux distribution images similar to what you would use for a virtual machine or cloud instance. +LXD 是基于镜像实现的,所有的 LXD 容器都是来自于镜像。容器镜像经常是一些干净的 Linux 发布版的镜像,类似于你们在虚拟机和云实例上使用的镜像。 -It is possible to “publish” a container, making an image from it which can then be used by the local or remote LXD hosts. +所以就可以“发布”容器:使用容器制作一个镜像,然后可以在本地或者远程 LXD 主机上使用。 -Images are uniquely identified by their sha256 hash and can be referenced by using their full or partial hash. Because typing long hashes isn’t particularly user friendly, images can also have any number of properties applied to them, allowing for an easy search through the image store. Aliases can also be set as a one to one mapping between a unique user friendly string and an image hash. +镜像通常使用 sha256 来区分,同时也可以使用它的全部或部分哈希码。因为输入长长的哈希码对用户来说不好,所以镜像可以使用几个自身的属性来区分,这就允许让用户在镜像商店里方便搜索镜像。别名也可以用来把对用户友好的字符串 1 比 1 的映射成镜像的哈希码。 -LXD comes pre-configured with three remote image servers (see remotes below): +LXD 安装时已经配置好了三个远程镜像服务器(参见下面的远程一节): -- “ubuntu:” provides stable Ubuntu images -- “ubunt-daily:” provides daily builds of Ubuntu -- “images:” is a community run image server providing images for a number of other Linux distributions using the upstream LXC templates -Remote images are automatically cached by the LXD daemon and kept for a number of days (10 by default) since they were last used before getting expired. +- “ubuntu:” 提供稳定版的 Ubuntu 镜像 +- “ubuntu-daily:” 提供每天构建出来的 Ubuntu +- “images:” 社区维护的镜像服务器,提供一系列的 Linux 发布版,使用的是上游 LXC 的模板 + +LXD 守护进程会从镜像上次被使用开始自动缓存远程镜像一段时间(默认是 10 天),然后这些镜像才会失效。 + +此外 LXD 还会自动更新远程镜像(除非指明不更新),所以本地的镜像会一直是最新版的。 -Additionally LXD also automatically updates remote images (unless told otherwise) so that the freshest version of the image is always available locally. #### 配置 -Profiles are a way to define container configuration and container devices in one place and then have it apply to any number of containers. +配置文件是一种在一处定义容器配置和容器设备,然后应用到一系列容器的方法。 -A container can have multiple profiles applied to it. When building the final container configuration (known as expanded configuration), the profiles will be applied in the order they were defined in, overriding each other when the same configuration key or device is found. Then the local container configuration is applied on top of that, overriding anything that came from a profile. +一个容器可以被应用多个配置文件。当构建最终容器配置时(即通常的扩展配置),这些配置文件都会按照他们定义顺序被应用到容器上,当有重名的配置,新的会覆盖掉旧的。然后本地容器配置会应用在这些之上,覆盖所有来自配置文件的选项。 -LXD ships with two pre-configured profiles: +LXD 自带两种预配置的配置文件: -- “default” is automatically applied to all containers unless an alternative list of profiles is provided by the user. This profile currently does just one thing, define a “eth0” network device for the container. -- “docker” is a profile you can apply to a container which you want to allow to run Docker containers. It requests LXD load some required kernel modules, turns on container nesting and sets up a few device entries. +- “default” 配置是自动应用在所有容器之上,除非用户提供了一系列替代的配置文件。目前这个配置文件只做一件事,为容器定义 “eth0” 网络设备。 +- “docker” 配置是一个允许你在容器里运行 Docker 容器的配置文件。它会要求 LXD 加载一些需要的内核模块,这样就能允许容器嵌套,并且创建一些设备入口。 #### 远程 -As I mentioned earlier, LXD is a networked daemon. The command line client that comes with it can therefore talk to multiple remote LXD servers as well as image servers. +如我之前提到的, LXD 是一个基于网络的守护进程。附带的命令行客户端可以与多个远程 LXD 服务器、镜像服务器通信。 -By default, our command line client comes with the following remotes defined +默认情况下我们的命令行客户端会与下面几个预定义的远程服务器通信: -local: (default remote, talks to the local LXD daemon over a unix socket) -ubuntu: (Ubuntu image server providing stable builds) -ubuntu-daily: (Ubuntu image server providing daily builds) -images: (images.linuxcontainers.org image server) -Any combination of those remotes can be used with the command line client. +- local:(默认的远程服务器,使用 UNIX socket 和本地的 LXD 守护进程通信) +- ubuntu:(buntu 镜像服务器,提供稳定版的 Ubuntu 镜像) +- ubuntu-daily:(Ubuntu 镜像服务器,提供每天构建出来的 Ubuntu) +- images:(images.linuxcontainers.org 镜像服务器) -You can also add any number of remote LXD hosts that were configured to listen to the network. Either anonymously if they are a public image server or after going through authentication when managing remote containers. +所有这些远程服务器的组合都可以在命令行客户端里使用。 -It’s that remote mechanism that makes it possible to interact with remote image servers as well as copy or move containers between hosts. +你也可以添加任意数量的远程 LXD 主机来监听网络。匿名服务器如果是开放镜像服务器,或者通过认证可以管理远程容器的镜像服务器,都可以添加进来。 + +正是这种远程机制使得和远程镜像服务器交互就像在主机间复制、移动容器成为可能。 ### 安全性 From d596b5ea8972d4df070601da4a39ff3743071306 Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 4 May 2016 10:08:45 +0800 Subject: [PATCH 0669/1469] Update Part 1 - LXD 2.0: Introduction to LXD.md --- .../Part 1 - LXD 2.0: Introduction to LXD.md | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/sources/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md b/sources/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md index 373a8c03dc..2e748d098c 100644 --- a/sources/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md +++ b/sources/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md @@ -107,18 +107,20 @@ LXD 自带两种预配置的配置文件: ### 安全性 -One aspect that was core to our design of LXD was to make it as safe as possible while allowing modern Linux distributions to run inside it unmodified. +我们设计 LXD 时的一个核心要求就当现代 Linux 发布版运行在容器里的时候要尽可能的安全。 -The main security features used by LXD through its use of the LXC library are: +LXD 使用的主要安全特是通过使用 LXC 库实现的: -- Kernel namespaces. Especially the user namespace as a way to keep everything the container does separate from the rest of the system. LXD uses the user namespace by default (contrary to LXC) and allows for the user to turn it off on a per-container basis (marking the container “privileged”) when absolutely needed. -- Seccomp. To filter some potentially dangerous system calls. -- AppArmor: To provide additional restrictions on mounts, socket, ptrace and file access. Specifically restricting cross-container communication. -- Capabilities. To prevent the container from loading kernel modules, altering the host system time, … -- CGroups. To restrict resource usage and prevent DoS attacks against the host. -Rather than exposing those features directly to the user as LXC would, we’ve built a new configuration language which abstracts most of those into something that’s more user friendly. For example, one can tell LXD to pass any host device into the container without having to also lookup its major/minor numbers to manually update the cgroup policy. +- 内核名字空间。特别是用户名字空间是一种让容器和系统剩余部分完全分割的方法。LXD 默认使用用户名字空间(和 LXC 相反),允许用户在需要的时候以容器为单位进行打开、关闭。 +- Seccomp 系统调用。用来隔离潜在危险的系统调用。 +- AppArmor:对 mount、socket、ptrace 和文件访问提供额外的限制。特别是限制跨容器通信。 +- Capabilities。组织容器加载内核模块,修改主机系统时间,等等。 +- CGroups。限制资源使用,防止对主机的 DoS 攻击。 -Communications with LXD itself are secured using TLS 1.2 with a very limited set of allowed ciphers. When dealing with hosts outside of the system certificate authority, LXD will prompt the user to validate the remote fingerprint (SSH style), then cache the certificate for future use. + +和 LXC 直接将这些特性暴露出来不同, 为了对用户友好 ,LXD 构建了一个新的配置语言把大部分的这些特性都抽象封装起来。举了例子,一个用户可以告诉 LXD 把主机设备放进容器而不需要手动检查他们的主/次设备号来更新 CGroup 策略。 + +和 LXD 本身通信是基于使用 TLS 1.2 的链路,这些链路只允许使用有限的几个被允许的密钥。当和那些经过系统证书认证之外的主机通信时, LXD 会提示用户验证主机的远程足迹(SSH 方式),然后把足迹缓存起来以供以后使用。 ### REST 接口 From 9054c17dfc98486580d48ccb1e39ab49ac059b80 Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 4 May 2016 12:50:12 +0800 Subject: [PATCH 0670/1469] Update Part 1 - LXD 2.0: Introduction to LXD.md --- .../tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sources/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md b/sources/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md index 2e748d098c..750dce0e43 100644 --- a/sources/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md +++ b/sources/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md @@ -124,15 +124,15 @@ LXD 使用的主要安全特是通过使用 LXC 库实现的: ### REST 接口 -Everything that LXD does is done over its REST API. There is no other communication channel between the client and the daemon. +LXD 的工作都是通过 REST 接口实现的。在客户端和守护进程之间并没有其他的通讯手段。 -The REST API can be access over a local unix socket, only requiring group membership for authentication or over a HTTPs socket using a client certificate for authentication. +REST 接口可以通过本地的 unix socket 访问,这只需要经过组认证,或者经过 HTTP 套接字使用客户端认证进行通信。 -The structure of the REST API matches the different components described above and is meant to be very simple and intuitive to use. +REST 接口的结构能够和上文所说的不同的组件匹配,是一种简单、直观的使用方法。 -When a more complex communication mechanism is required, LXD will negotiate websockets and use those for the rest of the communication. This is used for interactive console session, container migration and for event notification. +当需要一种复杂的通信机制时, LXD 将会进行websocket 协商完成剩余的通信工作。主要用于交互式终端会话,容器迁移和事件通知。 -With LXD 2.0, comes the /1.0 stable API. We will not break backward compatibility within the /1.0 API endpoint however we may add extra features to it, which we’ll signal by declaring additional API extensions that the client can look for. +LXD 2.0 附带了 1.0 版的 API。我们虽然在 1.0 版 API 添加了额外的特性,但是这不会在 1.0 版 API 的端点里破坏向后兼容性,我们会声明额外的 API 扩展使得客户端可以找到新的接口。 ### 容器规模化 From 461c872ae0de43bbc52537ef77b2b04ee6fb16ad Mon Sep 17 00:00:00 2001 From: VicYu Date: Wed, 4 May 2016 13:00:31 +0800 Subject: [PATCH 0671/1469] Update 20160429 Master OpenStack with 5 new tutorials.md --- sources/tech/20160429 Master OpenStack with 5 new tutorials.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160429 Master OpenStack with 5 new tutorials.md b/sources/tech/20160429 Master OpenStack with 5 new tutorials.md index 34ef86c06a..b43952bc2f 100644 --- a/sources/tech/20160429 Master OpenStack with 5 new tutorials.md +++ b/sources/tech/20160429 Master OpenStack with 5 new tutorials.md @@ -1,3 +1,5 @@ + Vic020 + Master OpenStack with 5 new tutorials ======================================= From 17f0cbff3d5b55190b0b54a92dea7e3892a9f067 Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 4 May 2016 13:28:58 +0800 Subject: [PATCH 0672/1469] translated --- .../LXD/Part 1 - LXD 2.0: Introduction to LXD.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/sources/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md b/sources/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md index 750dce0e43..9e21eb1aa7 100644 --- a/sources/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md +++ b/sources/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md @@ -1,5 +1,3 @@ -translating by ezio - Part 1 - LXD 2.0: LXD 入门 ====================================== @@ -136,18 +134,18 @@ LXD 2.0 附带了 1.0 版的 API。我们虽然在 1.0 版 API 添加了额外 ### 容器规模化 -While LXD provides a good command line client, that client isn’t meant to manage thousands of containers on multiple hosts. For that kind of use cases, we have nova-lxd which is an OpenStack plugin that makes OpenStack treat LXD containers in the exact same way it would treat VMs. +虽然 LXD 提供了一个很好的命令行客户端,但是这个客户端并不能管理多个主机的大量的容器。在这种使用情况下,我们可以使用 OpenStack 的插件 nova-lxd ,它可以使得 OpenStack 像使用虚拟机一样使用 LXD 容器。 -This allows for very large deployments of LXDs on a large number of hosts, using the OpenStack APIs to manage network, storage and load-balancing. +这就允许在大量的主机上部署大量的 LXD 容器,然后使用 OpenStack 的 API 来管理网络、存储以及负载均衡。 ### 额外信息 -The main LXD website is at: -Development happens on Github at: -Mailing-list support happens on: -IRC support happens in: #lxcontainers on irc.freenode.net +LXD 的主站在: +LXD 的 GitHub 仓库: +LXD 的邮件列表: +LXD 的 IRC 频道: #lxcontainers on irc.freenode.net -And if you can’t wait until the next few posts to try LXD, you can [take our guided tour online][2] and try it for free right from your web browser! +如果你不想或者不能在你的机器上安装 LXD ,你可以在 web 上[试试在线版的 LXD][2] 。 -------------------------------------------------------------------------------- From 3d85a8e67d707c631659ce19208aa67badc0d788 Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 4 May 2016 13:30:13 +0800 Subject: [PATCH 0673/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= =?UTF-8?q?=EF=BC=8C=E8=AF=B7=E6=A0=A1=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md (100%) diff --git a/sources/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md b/translated/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md similarity index 100% rename from sources/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md rename to translated/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md From 8dd41c4263fe47f0fee73de6e7d33d1ce721d5db Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 4 May 2016 13:33:08 +0800 Subject: [PATCH 0674/1469] =?UTF-8?q?=E8=AF=B7=E6=A0=A1=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- translated/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/translated/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md b/translated/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md index 9e21eb1aa7..f8ed83a482 100644 --- a/translated/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md +++ b/translated/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md @@ -141,8 +141,11 @@ LXD 2.0 附带了 1.0 版的 API。我们虽然在 1.0 版 API 添加了额外 ### 额外信息 LXD 的主站在: + LXD 的 GitHub 仓库: + LXD 的邮件列表: + LXD 的 IRC 频道: #lxcontainers on irc.freenode.net 如果你不想或者不能在你的机器上安装 LXD ,你可以在 web 上[试试在线版的 LXD][2] 。 @@ -152,7 +155,7 @@ LXD 的 IRC 频道: #lxcontainers on irc.freenode.net via: https://www.stgraber.org/2016/03/11/lxd-2-0-introduction-to-lxd-112/ 作者:[Stéphane Graber][a] -译者:[译者ID](https://github.com/译者ID) +译者:[ezio](https://github.com/oska874) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 36d702e61788254b29969d2eee4a80b369a01964 Mon Sep 17 00:00:00 2001 From: pengkai Date: Wed, 4 May 2016 13:58:39 +0800 Subject: [PATCH 0675/1469] kylepeng93 is translating --- sources/tech/LXD/Part 3 - LXD 2.0: Your first LXD container.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/LXD/Part 3 - LXD 2.0: Your first LXD container.md b/sources/tech/LXD/Part 3 - LXD 2.0: Your first LXD container.md index 7bf9ba5b16..1da7e4ec62 100644 --- a/sources/tech/LXD/Part 3 - LXD 2.0: Your first LXD container.md +++ b/sources/tech/LXD/Part 3 - LXD 2.0: Your first LXD container.md @@ -1,3 +1,4 @@ +kylepeng93 is translating Part 3 - LXD 2.0: Your first LXD container ========================================== From 9a8784ec08034a071030b0f09f36e263643558ef Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 4 May 2016 00:32:25 -0700 Subject: [PATCH 0676/1469] =?UTF-8?q?=E5=BD=92=E6=A1=A3201605?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20151028 10 Tips for 10x Application Performance.md | 0 .../20151109 How to Configure Tripwire IDS on Debian.md | 0 ... to Setup Drone - a Continuous Integration Service in Linux.md | 0 .../20151119 Going Beyond Hello World Containers is Hard Stuff.md | 0 .../20151126 Microsoft and Linux--True Romance or Toxic Love.md | 0 ...212 How to Add New Disk in Linux CentOS 7 Without Rebooting.md | 0 ...0 Make Sudo Insult User For Each Incorrect Password Attempt.md | 0 .../20160223 BeeGFS Parallel File System Goes Open Source.md | 0 .../20160226 How to use Python to hack your Eclipse IDE.md | 0 ... Be the New Flavor of Ubuntu Linux, as Part of Ubuntu 16.10.md | 0 ...Be Supported Until 2017 Because of SUSE Linux Enterprise 12.md | 0 11 files changed, 0 insertions(+), 0 deletions(-) rename published/{ => 201604}/20151028 10 Tips for 10x Application Performance.md (100%) rename published/{ => 201604}/20151109 How to Configure Tripwire IDS on Debian.md (100%) rename published/{ => 201604}/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md (100%) rename published/{ => 201604}/20151119 Going Beyond Hello World Containers is Hard Stuff.md (100%) rename published/{ => 201604}/20151126 Microsoft and Linux--True Romance or Toxic Love.md (100%) rename published/{ => 201604}/20160212 How to Add New Disk in Linux CentOS 7 Without Rebooting.md (100%) rename published/{ => 201604}/20160220 Make Sudo Insult User For Each Incorrect Password Attempt.md (100%) rename published/{ => 201604}/20160223 BeeGFS Parallel File System Goes Open Source.md (100%) rename published/{ => 201604}/20160226 How to use Python to hack your Eclipse IDE.md (100%) rename published/{ => 201604}/20160405 Ubuntu Budgie Could Be the New Flavor of Ubuntu Linux, as Part of Ubuntu 16.10.md (100%) rename published/{ => 201604}/20160414 Linux Kernel 3.12 to Be Supported Until 2017 Because of SUSE Linux Enterprise 12.md (100%) diff --git a/published/20151028 10 Tips for 10x Application Performance.md b/published/201604/20151028 10 Tips for 10x Application Performance.md similarity index 100% rename from published/20151028 10 Tips for 10x Application Performance.md rename to published/201604/20151028 10 Tips for 10x Application Performance.md diff --git a/published/20151109 How to Configure Tripwire IDS on Debian.md b/published/201604/20151109 How to Configure Tripwire IDS on Debian.md similarity index 100% rename from published/20151109 How to Configure Tripwire IDS on Debian.md rename to published/201604/20151109 How to Configure Tripwire IDS on Debian.md diff --git a/published/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md b/published/201604/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md similarity index 100% rename from published/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md rename to published/201604/20151114 How to Setup Drone - a Continuous Integration Service in Linux.md diff --git a/published/20151119 Going Beyond Hello World Containers is Hard Stuff.md b/published/201604/20151119 Going Beyond Hello World Containers is Hard Stuff.md similarity index 100% rename from published/20151119 Going Beyond Hello World Containers is Hard Stuff.md rename to published/201604/20151119 Going Beyond Hello World Containers is Hard Stuff.md diff --git a/published/20151126 Microsoft and Linux--True Romance or Toxic Love.md b/published/201604/20151126 Microsoft and Linux--True Romance or Toxic Love.md similarity index 100% rename from published/20151126 Microsoft and Linux--True Romance or Toxic Love.md rename to published/201604/20151126 Microsoft and Linux--True Romance or Toxic Love.md diff --git a/published/20160212 How to Add New Disk in Linux CentOS 7 Without Rebooting.md b/published/201604/20160212 How to Add New Disk in Linux CentOS 7 Without Rebooting.md similarity index 100% rename from published/20160212 How to Add New Disk in Linux CentOS 7 Without Rebooting.md rename to published/201604/20160212 How to Add New Disk in Linux CentOS 7 Without Rebooting.md diff --git a/published/20160220 Make Sudo Insult User For Each Incorrect Password Attempt.md b/published/201604/20160220 Make Sudo Insult User For Each Incorrect Password Attempt.md similarity index 100% rename from published/20160220 Make Sudo Insult User For Each Incorrect Password Attempt.md rename to published/201604/20160220 Make Sudo Insult User For Each Incorrect Password Attempt.md diff --git a/published/20160223 BeeGFS Parallel File System Goes Open Source.md b/published/201604/20160223 BeeGFS Parallel File System Goes Open Source.md similarity index 100% rename from published/20160223 BeeGFS Parallel File System Goes Open Source.md rename to published/201604/20160223 BeeGFS Parallel File System Goes Open Source.md diff --git a/published/20160226 How to use Python to hack your Eclipse IDE.md b/published/201604/20160226 How to use Python to hack your Eclipse IDE.md similarity index 100% rename from published/20160226 How to use Python to hack your Eclipse IDE.md rename to published/201604/20160226 How to use Python to hack your Eclipse IDE.md diff --git a/published/20160405 Ubuntu Budgie Could Be the New Flavor of Ubuntu Linux, as Part of Ubuntu 16.10.md b/published/201604/20160405 Ubuntu Budgie Could Be the New Flavor of Ubuntu Linux, as Part of Ubuntu 16.10.md similarity index 100% rename from published/20160405 Ubuntu Budgie Could Be the New Flavor of Ubuntu Linux, as Part of Ubuntu 16.10.md rename to published/201604/20160405 Ubuntu Budgie Could Be the New Flavor of Ubuntu Linux, as Part of Ubuntu 16.10.md diff --git a/published/20160414 Linux Kernel 3.12 to Be Supported Until 2017 Because of SUSE Linux Enterprise 12.md b/published/201604/20160414 Linux Kernel 3.12 to Be Supported Until 2017 Because of SUSE Linux Enterprise 12.md similarity index 100% rename from published/20160414 Linux Kernel 3.12 to Be Supported Until 2017 Because of SUSE Linux Enterprise 12.md rename to published/201604/20160414 Linux Kernel 3.12 to Be Supported Until 2017 Because of SUSE Linux Enterprise 12.md From b46148b4a26d087fb8b9edbe88ffc273e4587f1b Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 4 May 2016 00:33:06 -0700 Subject: [PATCH 0677/1469] PUB:20151202 KDE vs GNOME vs XFCE Desktop @kylepeng93 --- .../20151202 KDE vs GNOME vs XFCE Desktop.md | 53 +++++++++++++++++++ .../20151202 KDE vs GNOME vs XFCE Desktop.md | 47 ---------------- 2 files changed, 53 insertions(+), 47 deletions(-) create mode 100644 published/20151202 KDE vs GNOME vs XFCE Desktop.md delete mode 100644 translated/talk/20151202 KDE vs GNOME vs XFCE Desktop.md diff --git a/published/20151202 KDE vs GNOME vs XFCE Desktop.md b/published/20151202 KDE vs GNOME vs XFCE Desktop.md new file mode 100644 index 0000000000..4eb3044958 --- /dev/null +++ b/published/20151202 KDE vs GNOME vs XFCE Desktop.md @@ -0,0 +1,53 @@ +KDE、GNOME 和 XFCE 桌面比较 +================================================================================ +![](http://1426826955.rsc.cdn77.org/wp-content/uploads/2013/07/300px-Xfce_logo.svg_.png) + +这么多年来,很多人一直都在他们的 linux 桌面端使用 KDE 或者 GNOME 桌面环境。在这两个桌面环境多年不断发展的同时,其它的桌面也在持续增加它们的用户规模。举个例子说,在轻量级桌面环境下,XFCE 一举成为了最受欢迎的桌面环境,相较于 LXDE 缺少的优美视觉效果,默认配置下的 XFCE 在这方面就可以打败前者。XFCE 提供的功能特性都能在 GNOME2 下得到,然而,在一些较老的计算机上,它的轻量级的特性却能取得更好的效果。 + +### 桌面主题定制 ### + +用户完成安装之后,XFCE 看起来可能会有一点无趣,因为它在视觉上还缺少一些吸引力。但是,请不要误解我的话, XFCE 仍然拥有漂亮的桌面,但是对于大多数刚刚接触 XFCE 桌面环境的人来说,可能它看起来像香草一样普普通通。不过好消息是当我们想要给 XFCE 安装新的主题的时候,这会是一个十分轻松的过程,因为你能够快速的找到你喜欢的 XFCE 主题,之后你就可以将它解压到一个合适的目录中。从这一点上来说,XFCE 自带的一个放在“外观”下的重要的图形界面工具可以帮助用户更加容易的选择中意的主题,这可能是目前在 XFCE 上这方面最好用的工具了。如果用户按照上面的建议去做的话,对于想要尝试使用 XFCE 的任何用户来说都将不存在困难。 + +在 GNOME 桌面上,用户也可以按照类似上面的方法去做。不过,其中最主要的不同点就是在你做之前,用户必须手动下载并安装 GNOME Tweak Tool。当然,对于使用来说都不会有什么障碍,但是对于用户来说,使用 XFCE 安装和激活主题并不需要去额外去下载安装各种调整工具,这可能是他们无法忽略的一个优势。而在 GNOME 上,尤其是在用户已经下载并安装了 GNOME Tweak tool 之后,你仍将必须确保你已经安装了“用户主题扩展”。 + +同 XFCE 一样,用户需要去搜索并下载自己喜欢的主题,然后,用户可以再次使用 GNOME Tweak tool,并点击该工具界面左边的“外观”按钮,接着用户便可以直接查看页面底部并点击文件浏览按钮,然后浏览到那个压缩的文件夹并打开。当完成这些之后,用户将会看到一个告诉用户已经成功应用了主题的对话框,这样你的主题便已经安装完成。然后用户就可以简单的使用下拉菜单来选择他们想要的主题。和 XFCE 一样,主题激活的过程也是十分简单的,然而,对于因为要使用一个新的主题而去下载一个没有预先安装到系统里面的应用,这种情况也是需要考虑的。 + +最后,就是 KDE 桌面主题定制的过程了。和 XFCE 一样,不需要去下载额外的工具来安装主题。从这点来看,让人有种XFCE 可能要被 KDE 战胜了的感觉。不仅在 KDE 上可以完全使用图形用户界面来安装主题,而且甚至只需要用户点击获取新主题的按钮就可以找到、查看新的主题,并且最后自动安装。 + +然而,我们应该注意到 KDE 相比 XFCE 而言,是一个更加健壮完善的桌面环境。当然,对于主要以极简设计为目的的桌面来说,缺失一些更多的功能是有一定的道理的。为此,我们要为这样优秀的功能给 KDE 加分。 + +### MATE 不是一个轻量级的桌面环境 ### + +在继续比较 XFCE、GNOME3 和 KDE 之前,对于老手我们需要澄清一下,我们没有将 MATE 桌面环境加入到我们的比较中。MATE 可被看作是 GNOME2 的另一个衍生品,但是它并没有主要作为一款轻量级或者快捷桌面出现。相反,它的主要目的是成为一款更加传统和舒适的桌面环境,并使它的用户在使用它时就像在家里一样舒适。 + +另一方面,XFCE 生来就是要实现他自己的一系列使命。XFCE 给它的用户提供了一个更轻量而仍保持吸引人的视觉体验的桌面环境。然后,对于一些认为 MATE 也是一款轻量级的桌面环境的人来说,其实 MATE 真正的目标并不是成为一款轻量级的桌面环境。这两种选择在各自安装了一款好的主题之后看起来都会让人觉得非常具有吸引力。 + +### 桌面导航 ### + +XFCE 除了桌面,还提供了一个醒目的导航器。任何使用过传统的 Windows 或者 GNOME 2/MATE 桌面环境的用户都可以在没有任何帮助的情况下自如的使用新安装的 XFCE 桌面环境的导航器。紧接着,添加小程序到面板中也是很显眼的。就像找一个已经安装的应用程序一样,直接使用启动器并点击你想要运行的应用程序图标就行。除了 LXDE 和 MATE 之外,还没有其他的桌面的导航器可以做到如此简单。不仅如此,更好的是控制面板的使用是非常容易使用的,对于刚刚使用这个新桌面的用户来说这是一个非常大的好处。如果用户更喜欢通过老式的方法去使用他们的桌面,那么 GNOME 就不合适。通过热角而取代了最小化按钮,加上其他的应用排布方式,这可以让大多数新用户易于使用它。 + +如果用户来自类似 Windows 这样的桌面环境,那么这些用户需要摒弃这些习惯,不能简单的通过鼠标右击一下就将一个小程序添加到他们的工作空间顶部。与此相反,它可以通过使用扩展来实现。GNOME 是可以安装拓展的,并且是非常的容易,这些容易之处体现在只需要用户简单的使用位于 GNOME 扩展页面上的 on/off 开关即可。不过,用户必须知道这个东西,才能真正使用上这个功能。 + +另一方面,GNOME 正在它的外观中体现它的设计理念,即为用户提供一个直观和易用的控制面板。你可能认为那并不是什么大事,但是,在我看来,它确实是我认为值得称赞并且有必要被提及的方面。KDE 给它的用户提供了更多的传统桌面使用体验,并通过提供相似的启动器和一种更加类似的获取软件的方式的能力来迎合来自 Windows 的用户。添加小部件或者小程序到 KDE 桌面是件非常简单的事情,只需要在桌面上右击即可。唯一的问题是 KDE 中这个功能不好发现,就像 KDE 中的其它东西一样,对于用户来说好像是隐藏的。KDE 的用户可能不同意我的观点,但我仍然坚持我的说法。 + +要增加一个小部件,只要在“我的面板”上右击就可以看见面板选项,但是并不是安装小部件的一个直观的方法。你并不能看见“添加部件”,除非你选择了“面板选项”,然后才能看见“添加部件”。这对我来说不是个问题,但是对于一些用户来说,它变成了不必要的困惑。而使事情变得更复杂的是,在用户能够找到部件区域后,他们后来发现一种称为“活动”的新术语。它和部件在同一个地方,可是它在自己的区域却是另外一种行为。 + +现在请不要误解我,KDE 中的活动特性是很不错的,也是很有价值的,但是从可用性的角度看,为了不让新手感到困惑,它更加适合于放在另一个菜单项。用户各有不同,但是让新用户多测试一段时间可以让它不断改进。对“活动”的批评先放一边,KDE 添加新部件的方法的确很棒。与 KDE 的主题一样,用户不能通过使用提供的图形用户界面浏览和自动安装部件。这是一个有点神奇的功能,但是它这样也可以工作。KDE 的控制面板可能和用户希望的样子不一样,它不是足够的简单。但是有一点很清楚,这将是他们致力于改进的地方。 + +### 因此,XFCE 是最好的桌面环境,对吗? ### + +就我自己而言,我在我的计算机上使用 GNOME、KDE,并在我的办公室和家里的电脑上使用 Xfce。我也有一些老机器在使用 Openbox 和 LXDE。每一个桌面的体验都可以给我提供一些有用的东西,可以帮助我以适合的方式使用每台机器。对我来说,Xfce 是我的心中的挚爱,因为 Xfce 是一个我使用了多年的桌面环境。但对于这篇文章,我是用我日常使用的机器来撰写的,事实上,它用的是 GNOME。 + +这篇文章的主要思想是,对于那些正在寻找稳定的、传统的、容易理解的桌面环境的用户来说,我还是觉得 Xfce 能提供好一点的用户体验。欢迎您在评论部分和我们分享你的意见。 + +-------------------------------------------------------------------------------- + +via: http://www.unixmen.com/kde-vs-gnome-vs-xfce-desktop/ + +作者:[M.el Khamlichi][a] +译者:[kylepeng93](https://github.com/kylepeng93) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.unixmen.com/author/pirat9/ diff --git a/translated/talk/20151202 KDE vs GNOME vs XFCE Desktop.md b/translated/talk/20151202 KDE vs GNOME vs XFCE Desktop.md deleted file mode 100644 index bdbaf2cdbd..0000000000 --- a/translated/talk/20151202 KDE vs GNOME vs XFCE Desktop.md +++ /dev/null @@ -1,47 +0,0 @@ -translating by kylepeng93 -KDE,GNOME和XFCE的较量 -================================================================================ -![](http://1426826955.rsc.cdn77.org/wp-content/uploads/2013/07/300px-Xfce_logo.svg_.png) -这么多年来,很多人一直都在他们的linux桌面端使用KDE或者GNOME桌面环境。这两个桌面环境经过多年的发展之后仍然在继续增加他们的用户基数。然而,在轻量级桌面环境下,XFCE一举成为了最受欢迎的桌面环境,相较于LXDE缺少的优美视觉效果,默认配置下的XFCE就可以在这方面打败前者。XFCE提供了用户能在GNOME2下使用的所有功能特性。但是,必须承认,在一些太老的计算机上,它的轻量级的特性并不能得到很好的效果。 - -### 桌面主题定制 ### -用户完成安装之后,XFCE看起来可能会有一点无聊,因为它在视觉上还缺少一些吸引力。但是,请不要误解我的话,XFCE仍然拥有漂亮的桌面,可能看起来像是用户眼中的香草,正如大多数刚刚接触XFCE桌面环境的人。好消息是当我们给XFCE安装新的主题的时候,这会是一个十分容易的过程,因为你能够快速的找到你喜欢的XFCE主题,之后,你可以将它解压到一个合适的目录中。从这一点上来说,XFCE自带的一个重要的图形界面工具可以帮助用户更加容易的选中你已经选好的主题,这可能是目前在XFCE上最好用的工具了。如果用户按照上面的指示去做的话,对于任何想要尝试使用XFCE的用户来说将不存在任何困难。 - -在GNOME桌面上,用户也可以按照上面的方法去做。不过,其中最主要的不同点就是用户必须手动下载并安装GNOME Tweak Tool,这样才能继续你想做的事。当然,对于使用任何一种方式都不会有什么障碍,但是对于用户来说,使用XFCE安装和激活主题并不需要去额外的下载并安装任何tweak tool可能是他们无法忽略的一个优势。而在GNOME上,尤其是在用户已经下载并安装了GNOME Tweak tool之后,你仍将必须确保你已经安装了用户主题拓展。 - -在XFCE一样,用户将会去搜索并下载自己喜欢的主题,然后,用户可以重新使用GNOME Tweak tool,并点击该工具界面左边的Appearance按钮,接着用户便可以简单的通过点击相应的按钮并选择自己已经下载好的主题来使用自己的主题,当一切都完成之后,用户将会看到一个告诉用户已经成功应用了主题的对话框,这样,你的主题便已经安装完成。对于这一点,用户可以简单的使用滚动条来选择他们想要的主题。和XFCE一样,主题激活的过程也是十分简单的,然而,对于因为要使用一个新的主题而下载一个不被包含的应用的需求也是需要考虑的。 - -最后,就是KDE桌面主题定制的过程了。和XFCE一样,不需要去下载额外的工具来安装主题。从这点来看,让人有种XFCE必将使KDE成为最后的赢家的感觉。不仅在KDE上可以完全使用图形用户界面来安装主题,而且甚至只需要用户点击获取新主题的按钮就可以定位,查看,并且最后自动安装新的主题。 - -然而,我们不应该认为KDE相比XFCE是一个更加稳定的桌面环境。因此,现在正是我们思考为什么一些额外的功能可能会从桌面环境中移除来达到最小化的目的。为此,我们都必须为拥有这样出色的功能而给予KDE更多的支持。 - -### MATE不是一个轻量级的桌面环境 ### -在继续比较XFCE,GNOME3和KDE之前,必须对这方面的老手作一个事先说明,我们不会将MATE桌面环境加入到我们的比较中。MATE可被认为是GNOME2的另一个衍生品,但是它并没有声称是作为一款轻量级或者快捷桌面。相反,它的主要目的是成为一款更加传统和舒适的桌面环境,并使它的用户感觉就像在家里使用它一样。 - -另一方面,XFCE生来就是要实现他自己的一系列使命。XFCE给它的用户提供一个更加轻量级的桌面环境,至今仍然有着吸引人的桌面视觉体验。然后,对于一些认为MATE也是一款轻量级的桌面环境的人来说,其实MATE真正的目标并不是成为一款轻量级的桌面环境。这两个选择在各自安装了一款好的主题之后看起来都会让人觉得非常具有吸引力。 - -### 桌面导航 ### -XFCE在窗口之外提供了一个显眼的导航器。任何使用过传统的windows或者GNOME 2/MATE桌面环境的用户都可以在没有任何帮助的情况下自如的使用新安装的XFCE桌面环境的导航器。紧接着,添加小程序到面板中也是很明显的。和找到已经安装的应用程序一样,直接使用启动器并点击你想要运行的应用程序图标。除了LXDE和MATE之外,还没有其他的桌面的导航器可以做到如此简单。不仅如此,更加简单的是对控制面板的使用,对于刚刚使用这个新桌面的每个用户来说这是一个非常大的好处。如果用户更喜欢通过老式的方法去使用他们的桌面,对于GNOME来说,这不是一个问题。和没有最小化按钮形成的用户关注热点一样,加上其他应用布局方法,这将使新用户更加容易习惯这个风格设计。 - -如果用户来自windows桌面环境,那么这些用户将要放弃这些习惯,因为,他们将不能简单的通过鼠标右击一下就可以将一个小程序添加到他们的工作空间的顶部。与此相反,它可以通过使用拓展来实现。GNOME中的KDE拓展是可用的,并且是非常的容易,这些容易之处体现在只需要用户简单的使用位于GNOME拓展页面上的on/off开关。用户必须清楚,只能通过访问该页面才能使用这个功能。 - -另一方面,GNOME正在它的外观中体现它的设计理念,即为用户提供一个直观和易用的控制面板。你可能认为那并不是什么大事,但是,在我看来,它确实是我认为值得称赞并且有必要被提及的方面。KDE提供给它的用户大量传统的桌面使用体验,并通过提供相似的启动器和一种更加类似的获取软件的方式的能力来迎合来自windows的用户。添加小图标或者小程序到KDE桌面是件非常简单的事情,只需要在桌面的底部右击即可。只有在KDE的使用中才会存在的的问题,对于KDE用户寻找的很多KDE的特性实际上都是隐藏的。KDE的用户可能会指责这我的观点,但我仍然坚持我的说法。 - -为了增加小部件,仅仅在我的面板上右击就可以看见面板选项,但是并不是安装小部件的一个快速的方法。通常在你选择面板选项之前你都不会看到添加的小部件,然后,就添加小部件吧。这对我来说不是个问题,但是后来对于一些用户来说,它变成了不必要的困惑。而使事情变得更加复杂,用户管理定位部件区域后,他们后来发现一种称为“Activities”的品牌新术语。在同一地区的小部件,但它是在自己的领域是什么。 - -现在请不要误解我,KDE中的活动特性是很不错的,也是很有价值的,但是从可用性的角度看,为了不让新手感到困惑,它更加适合于应用在另一个目录选项。欢迎来自用户的分歧,,但为了测试这个新手对一些长时间的可以一遍又一遍的证明它是正确的。责骂放在一边,KDE添加新部件的方法的确很棒。与KDE的主题一样,用户不能通过使用提供的图形用户界面浏览和自动安装部件。这是一个神奇的功能,也可以是这样的方式去庆祝。KDE的控制面板可能和用户希望的样子不一样,它不是足够的简单。但是有一点很清楚,这将是他们致力于改进的地方。 - -### 因此,XFCE是最好的桌面环境,对吗? ### -我在我的计算机上使用GNOME,KDE,并在我的办公室和家里的电脑上使用Xfce。我也有一些老机器在使用Openbox和LXDE。每一个使用桌面的经验都可以给我提供一些有用的东西,可以帮助我使用每台机器,因为我认为它是合适的。对我来说,在我的心里有一个柔软的地方,因为Xfce作为一个桌面环境,我坚持使用了很多年。但在这篇文章中,我只是在写我使用电脑的日常,事实上,它是GNOME。 -这篇文章的主要思想是我还是觉得Xfce能提供好一点的用户体验,对于那些正在寻找稳定的、传统的、容易理解的桌面环境的用户来说,XFCE是理想的。欢迎您在评论部分和我们分享你的意见。 --------------------------------------------------------------------------------- - -via: http://www.unixmen.com/kde-vs-gnome-vs-xfce-desktop/ - -作者:[M.el Khamlichi][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.unixmen.com/author/pirat9/ From 00ccc5e744f6017240b18d82330ba4309869a2e4 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 4 May 2016 00:34:07 -0700 Subject: [PATCH 0678/1469] PUB:20151227 Upheaval in the Debian Live project MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @vim-kakali 请参考 @PurlingNayuki 的校对,包括内容和格式的调整。@PurlingNayuki 你速度好快! --- .../20151227 Upheaval in the Debian Live project.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/news => published}/20151227 Upheaval in the Debian Live project.md (100%) diff --git a/translated/news/20151227 Upheaval in the Debian Live project.md b/published/20151227 Upheaval in the Debian Live project.md similarity index 100% rename from translated/news/20151227 Upheaval in the Debian Live project.md rename to published/20151227 Upheaval in the Debian Live project.md From 6b7e639eb9531017916f3b8acef16b6572a363bb Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 4 May 2016 16:00:19 +0800 Subject: [PATCH 0679/1469] =?UTF-8?q?20160504-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LXD/Part 4 - LXD 2.0: Resource control.md | 405 ++++++++++++++++++ 1 file changed, 405 insertions(+) create mode 100644 sources/tech/LXD/Part 4 - LXD 2.0: Resource control.md diff --git a/sources/tech/LXD/Part 4 - LXD 2.0: Resource control.md b/sources/tech/LXD/Part 4 - LXD 2.0: Resource control.md new file mode 100644 index 0000000000..178c46ea32 --- /dev/null +++ b/sources/tech/LXD/Part 4 - LXD 2.0: Resource control.md @@ -0,0 +1,405 @@ +Part 4 - LXD 2.0: Resource control +====================================== + +This is the fourth blog post [in this series about LXD 2.0][0]. + +As there are a lot of commands involved with managing LXD containers, this post is rather long. If you’d instead prefer a quick step-by-step tour of those same commands, you can [try our online demo instead][1]! + +![](https://linuxcontainers.org/static/img/containers.png) + +### Available resource limits + +LXD offers a variety of resource limits. Some of those are tied to the container itself, like memory quotas, CPU limits and I/O priorities. Some are tied to a particular device instead, like I/O bandwidth or disk usage limits. + +As with all LXD configuration, resource limits can be dynamically changed while the container is running. Some may fail to apply, for example if setting a memory value smaller than the current memory usage, but LXD will try anyway and report back on failure. + +All limits can also be inherited through profiles in which case each affected container will be constrained by that limit. That is, if you set limits.memory=256MB in the default profile, every container using the default profile (typically all of them) will have a memory limit of 256MB. + +We don’t support resource limits pooling where a limit would be shared by a group of containers, there is simply no good way to implement something like that with the existing kernel APIs. + +#### Disk + +This is perhaps the most requested and obvious one. Simply setting a size limit on the container’s filesystem and have it enforced against the container. + +And that’s exactly what LXD lets you do! +Unfortunately this is far more complicated than it sounds. Linux doesn’t have path-based quotas, instead most filesystems only have user and group quotas which are of little use to containers. + +This means that right now LXD only supports disk limits if you’re using the ZFS or btrfs storage backend. It may be possible to implement this feature for LVM too but this depends on the filesystem being used with it and gets tricky when combined with live updates as not all filesystems allow online growth and pretty much none of them allow online shrink. + +#### CPU + +When it comes to CPU limits, we support 4 different things: + +* Just give me X CPUs + + In this mode, you let LXD pick a bunch of cores for you and then load-balance things as more containers and CPUs go online/offline. + + The container only sees that number of CPU. +* Give me a specific set of CPUs (say, core 1, 3 and 5) + + Similar to the first mode except that no load-balancing is happening, you’re stuck with those cores no matter how busy they may be. +* Give me 20% of whatever you have + + In this mode, you get to see all the CPUs but the scheduler will restrict you to 20% of the CPU time but only when under load! So if the system isn’t busy, your container can have as much fun as it wants. When containers next to it start using the CPU, then it gets capped. +* Out of every measured 200ms, give me 50ms (and no more than that) + + This mode is similar to the previous one in that you get to see all the CPUs but this time, you can only use as much CPU time as you set in the limit, no matter how idle the system may be. On a system without over-commit this lets you slice your CPU very neatly and guarantees constant performance to those containers. + +It’s also possible to combine one of the first two with one of the last two, that is, request a set of CPUs and then further restrict how much CPU time you get on those. + +On top of that, we also have a generic priority knob which is used to tell the scheduler who wins when you’re under load and two containers are fighting for the same resource. + +#### Memory + +Memory sounds pretty simple, just give me X MB of RAM! + +And it absolutely can be that simple. We support that kind of limits as well as percentage based requests, just give me 10% of whatever the host has! + +Then we support some extra stuff on top. For example, you can choose to turn swap on and off on a per-container basis and if it’s on, set a priority so you can choose what container will have their memory swapped out to disk first! + +Oh and memory limits are “hard” by default. That is, when you run out of memory, the kernel out of memory killer will start having some fun with your processes. + +Alternatively you can set the enforcement policy to “soft”, in which case you’ll be allowed to use as much memory as you want so long as nothing else is. As soon as something else wants that memory, you won’t be able to allocate anything until you’re back under your limit or until the host has memory to spare again. + +#### Network I/O + +Network I/O is probably our simplest looking limit, trust me, the implementation really isn’t simple though! + +We support two things. The first is a basic bit/s limits on network interfaces. You can set a limit of ingress and egress or just set the “max” limit which then applies to both. This is only supported for “bridged” and “p2p” type interfaces. + +The second thing is a global network I/O priority which only applies when the network interface you’re trying to talk through is saturated. + +#### Block I/O + +I kept the weirdest for last. It may look straightforward and feel like that to the user but there are a bunch of cases where it won’t exactly do what you think it should. + +What we support here is basically identical to what I described in Network I/O. + +You can set IOps or byte/s read and write limits directly on a disk device entry and there is a global block I/O priority which tells the I/O scheduler who to prefer. + +The weirdness comes from how and where those limits are applied. Unfortunately the underlying feature we use to implement those uses full block devices. That means we can’t set per-partition I/O limits let alone per-path. + +It also means that when using ZFS or btrfs which can use multiple block devices to back a given path (with or without RAID), we effectively don’t know what block device is providing a given path. + +This means that it’s entirely possible, in fact likely, that a container may have multiple disk entries (bind-mounts or straight mounts) which are coming from the same underlying disk. + +And that’s where things get weird. To make things work, LXD has logic to guess what block devices back a given path, this does include interrogating the ZFS and btrfs tools and even figures things out recursively when it finds a loop mounted file backing a filesystem. + +That logic while not perfect, usually yields a set of block devices that should have a limit applied. LXD then records that and moves on to the next path. When it’s done looking at all the paths, it gets to the very weird part. It averages the limits you’ve set for every affected block devices and then applies those. + +That means that “in average” you’ll be getting the right speed in the container, but it also means that you can’t have a “/fast” and a “/slow” directory both coming from the same physical disk and with differing speed limits. LXD will let you set it up but in the end, they’ll both give you the average of the two values. + +### How does it all work? + +Most of the limits described above are applied through the Linux kernel Cgroups API. That’s with the exception of the network limits which are applied through good old “tc”. + +LXD at startup time detects what cgroups are enabled in your kernel and will only apply the limits which your kernel support. Should you be missing some cgroups, a warning will also be printed by the daemon which will then get logged by your init system. + +On Ubuntu 16.04, everything is enabled by default with the exception of swap memory accounting which requires you pass the “swapaccount=1” kernel boot parameter. + +### Applying some limits + +All the limits described above are applied directly to the container or to one of its profiles. Container-wide limits are applied with: + +``` +lxc config set CONTAINER KEY VALUE +``` + +or for a profile: + +``` +lxc profile set PROFILE KEY VALUE +``` + +while device-specific ones are applied with: + +``` +lxc config device set CONTAINER DEVICE KEY VALUE +``` + +or for a profile: + +``` +lxc profile device set PROFILE DEVICE KEY VALUE +``` + +The complete list of valid configuration keys, device types and device keys can be [found here][1]. + +#### CPU + +To just limit a container to any 2 CPUs, do: + +``` +lxc config set my-container limits.cpu 2 +``` + +To pin to specific CPU cores, say the second and fourth: + +``` +lxc config set my-container limits.cpu 1,3 +``` + +More complex pinning ranges like this works too: + +``` +lxc config set my-container limits.cpu 0-3,7-11 +``` + +The limits are applied live, as can be seen in this example: + +``` +stgraber@dakara:~$ lxc exec zerotier -- cat /proc/cpuinfo | grep ^proces +processor : 0 +processor : 1 +processor : 2 +processor : 3 +stgraber@dakara:~$ lxc config set zerotier limits.cpu 2 +stgraber@dakara:~$ lxc exec zerotier -- cat /proc/cpuinfo | grep ^proces +processor : 0 +processor : 1 +``` + +Note that to avoid utterly confusing userspace, lxcfs arranges the /proc/cpuinfo entries so that there are no gaps. + +As with just about everything in LXD, those settings can also be applied in profiles: + +``` +stgraber@dakara:~$ lxc exec snappy -- cat /proc/cpuinfo | grep ^proces +processor : 0 +processor : 1 +processor : 2 +processor : 3 +stgraber@dakara:~$ lxc profile set default limits.cpu 3 +stgraber@dakara:~$ lxc exec snappy -- cat /proc/cpuinfo | grep ^proces +processor : 0 +processor : 1 +processor : 2 +``` + +To limit the CPU time of a container to 10% of the total, set the CPU allowance: + +``` +lxc config set my-container limits.cpu.allowance 10% +``` + +Or to give it a fixed slice of CPU time: + +``` +lxc config set my-container limits.cpu.allowance 25ms/200ms +``` + +And lastly, to reduce the priority of a container to a minimum: + +``` +lxc config set my-container limits.cpu.priority 0 +``` + +#### Memory + +To apply a straightforward memory limit run: + +``` +lxc config set my-container limits.memory 256MB +``` + +(The supported suffixes are kB, MB, GB, TB, PB and EB) + +To turn swap off for the container (defaults to enabled): + +``` +lxc config set my-container limits.memory.swap false +``` + +To tell the kernel to swap this container’s memory first: + +``` +lxc config set my-container limits.memory.swap.priority 0 +``` + +And finally if you don’t want hard memory limit enforcement: + +``` +lxc config set my-container limits.memory.enforce soft +``` + +#### Disk and block I/O + +Unlike CPU and memory, disk and I/O limits are applied to the actual device entry, so you either need to edit the original device or mask it with a more specific one. + +To set a disk limit (requires btrfs or ZFS): + +``` +lxc config device set my-container root size 20GB +``` + +For example: + +``` +stgraber@dakara:~$ lxc exec zerotier -- df -h / +Filesystem Size Used Avail Use% Mounted on +encrypted/lxd/containers/zerotier 179G 542M 178G 1% / +stgraber@dakara:~$ lxc config device set zerotier root size 20GB +stgraber@dakara:~$ lxc exec zerotier -- df -h / +Filesystem Size Used Avail Use% Mounted on +encrypted/lxd/containers/zerotier 20G 542M 20G 3% / +``` + +To restrict speed you can do the following: + +``` +lxc config device set my-container root limits.read 30MB +lxc config device set my-container root.limits.write 10MB +``` + +Or to restrict IOps instead: + +``` +lxc config device set my-container root limits.read 20Iops +lxc config device set my-container root limits.write 10Iops +``` + +And lastly, if you’re on a busy system with over-commit, you may want to also do: + +``` +lxc config set my-container limits.disk.priority 10 +``` + +To increase the I/O priority for that container to the maximum. + +#### Network I/O + +Network I/O is basically identical to block I/O as far the knobs available. + +For example: + +``` +stgraber@dakara:~$ lxc exec zerotier -- wget http://speedtest.newark.linode.com/100MB-newark.bin -O /dev/null +--2016-03-26 22:17:34-- http://speedtest.newark.linode.com/100MB-newark.bin +Resolving speedtest.newark.linode.com (speedtest.newark.linode.com)... 50.116.57.237, 2600:3c03::4b +Connecting to speedtest.newark.linode.com (speedtest.newark.linode.com)|50.116.57.237|:80... connected. +HTTP request sent, awaiting response... 200 OK +Length: 104857600 (100M) [application/octet-stream] +Saving to: '/dev/null' + +/dev/null 100%[===================>] 100.00M 58.7MB/s in 1.7s + +2016-03-26 22:17:36 (58.7 MB/s) - '/dev/null' saved [104857600/104857600] + +stgraber@dakara:~$ lxc profile device set default eth0 limits.ingress 100Mbit +stgraber@dakara:~$ lxc profile device set default eth0 limits.egress 100Mbit +stgraber@dakara:~$ lxc exec zerotier -- wget http://speedtest.newark.linode.com/100MB-newark.bin -O /dev/null +--2016-03-26 22:17:47-- http://speedtest.newark.linode.com/100MB-newark.bin +Resolving speedtest.newark.linode.com (speedtest.newark.linode.com)... 50.116.57.237, 2600:3c03::4b +Connecting to speedtest.newark.linode.com (speedtest.newark.linode.com)|50.116.57.237|:80... connected. +HTTP request sent, awaiting response... 200 OK +Length: 104857600 (100M) [application/octet-stream] +Saving to: '/dev/null' + +/dev/null 100%[===================>] 100.00M 11.4MB/s in 8.8s + +2016-03-26 22:17:56 (11.4 MB/s) - '/dev/null' saved [104857600/104857600] +``` + +And that’s how you throttle an otherwise nice gigabit connection to a mere 100Mbit/s one! + +And as with block I/O, you can set an overall network priority with: + +``` +lxc config set my-container limits.network.priority 5 +``` + +### Getting the current resource usage + +The [LXD API][2] exports quite a bit of information on current container resource usage, you can get: + +* Memory: current, peak, current swap and peak swap +* Disk: current disk usage +* Network: bytes and packets received and transferred for every interface + +And now if you’re running a very recent LXD (only in git at the time of this writing), you can also get all of those in “lxc info”: + +``` +stgraber@dakara:~$ lxc info zerotier +Name: zerotier +Architecture: x86_64 +Created: 2016/02/20 20:01 UTC +Status: Running +Type: persistent +Profiles: default +Pid: 29258 +Ips: + eth0: inet 172.17.0.101 + eth0: inet6 2607:f2c0:f00f:2700:216:3eff:feec:65a8 + eth0: inet6 fe80::216:3eff:feec:65a8 + lo: inet 127.0.0.1 + lo: inet6 ::1 + lxcbr0: inet 10.0.3.1 + lxcbr0: inet6 fe80::f0bd:55ff:feee:97a2 + zt0: inet 29.17.181.59 + zt0: inet6 fd80:56c2:e21c:0:199:9379:e711:b3e1 + zt0: inet6 fe80::79:e7ff:fe0d:5123 +Resources: + Processes: 33 + Disk usage: + root: 808.07MB + Memory usage: + Memory (current): 106.79MB + Memory (peak): 195.51MB + Swap (current): 124.00kB + Swap (peak): 124.00kB + Network usage: + lxcbr0: + Bytes received: 0 bytes + Bytes sent: 570 bytes + Packets received: 0 + Packets sent: 0 + zt0: + Bytes received: 1.10MB + Bytes sent: 806 bytes + Packets received: 10957 + Packets sent: 10957 + eth0: + Bytes received: 99.35MB + Bytes sent: 5.88MB + Packets received: 64481 + Packets sent: 64481 + lo: + Bytes received: 9.57kB + Bytes sent: 9.57kB + Packets received: 81 + Packets sent: 81 +Snapshots: + zerotier/blah (taken at 2016/03/08 23:55 UTC) (stateless) +``` + +### Conclusion + +The LXD team spent quite a few months iterating over the language we’re using for those limits. It’s meant to be as simple as it can get while remaining very powerful and specific when you want it to. + +Live application of those limits and inheritance through profiles makes it a very powerful tool to live manage the load on your servers without impacting the running services. + +### Extra information + +The main LXD website is at: +Development happens on Github at: +Mailing-list support happens on: +IRC support happens in: #lxcontainers on irc.freenode.net + +And if you don’t want or can’t install LXD on your own machine, you can always [try it online instead][3]! + + +-------------------------------------------------------------------------------- + +via: https://www.stgraber.org/2016/03/19/lxd-2-0-your-first-lxd-container-312/ + +作者:[Stéphane Graber][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.stgraber.org/author/stgraber/ +[0]: https://www.stgraber.org/2016/03/11/lxd-2-0-blog-post-series-012/ +[1]: https://github.com/lxc/lxd/blob/master/doc/configuration.md +[2]: https://github.com/lxc/lxd/blob/master/doc/rest-api.md +[3]: https://linuxcontainers.org/lxd/try-it From f1094fc9f4b6bf9932d0d970bcda6e4be4e1bad5 Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 4 May 2016 16:10:47 +0800 Subject: [PATCH 0680/1469] =?UTF-8?q?20160504-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/LXD/Part 5 - LXD 2.0: Image management.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 sources/tech/LXD/Part 5 - LXD 2.0: Image management.md diff --git a/sources/tech/LXD/Part 5 - LXD 2.0: Image management.md b/sources/tech/LXD/Part 5 - LXD 2.0: Image management.md new file mode 100644 index 0000000000..3a69aadd00 --- /dev/null +++ b/sources/tech/LXD/Part 5 - LXD 2.0: Image management.md @@ -0,0 +1,7 @@ +Part 5 - LXD 2.0: Image management +================================== +<正文待补充> + + + +原文:https://www.stgraber.org/2016/03/30/lxd-2-0-image-management-512/ From f110d02330299f58652ddba71ccbc14d73814c65 Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 4 May 2016 16:11:43 +0800 Subject: [PATCH 0681/1469] =?UTF-8?q?20160306-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rt 6 - LXD 2.0: Remote hosts and container migration.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 sources/tech/LXD/Part 6 - LXD 2.0: Remote hosts and container migration.md diff --git a/sources/tech/LXD/Part 6 - LXD 2.0: Remote hosts and container migration.md b/sources/tech/LXD/Part 6 - LXD 2.0: Remote hosts and container migration.md new file mode 100644 index 0000000000..95c825a30e --- /dev/null +++ b/sources/tech/LXD/Part 6 - LXD 2.0: Remote hosts and container migration.md @@ -0,0 +1,7 @@ +Part 6 - LXD 2.0: Remote hosts and container migration +======================================================= + +<正文待补充> + + +https://www.stgraber.org/2016/04/12/lxd-2-0-remote-hosts-and-container-migration-612/ From 12949d4661238b4aadb5affd73978d487a528a5a Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 4 May 2016 16:12:39 +0800 Subject: [PATCH 0682/1469] =?UTF-8?q?20160306-4=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/LXD/Part 7 - LXD 2.0: Docker in LXD.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 sources/tech/LXD/Part 7 - LXD 2.0: Docker in LXD.md diff --git a/sources/tech/LXD/Part 7 - LXD 2.0: Docker in LXD.md b/sources/tech/LXD/Part 7 - LXD 2.0: Docker in LXD.md new file mode 100644 index 0000000000..60bb3883df --- /dev/null +++ b/sources/tech/LXD/Part 7 - LXD 2.0: Docker in LXD.md @@ -0,0 +1,6 @@ +Part 7 - LXD 2.0: Docker in LXD +================================== + +<正文待补充> + +原文: https://www.stgraber.org/2016/04/13/lxd-2-0-docker-in-lxd-712/ From 81de00207daa9d689bde2d5c4b7d4f9104f6a59d Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 4 May 2016 16:13:27 +0800 Subject: [PATCH 0683/1469] =?UTF-8?q?20160306-5=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/LXD/Part 7 - LXD 2.0: LXD in LXD.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 sources/tech/LXD/Part 7 - LXD 2.0: LXD in LXD.md diff --git a/sources/tech/LXD/Part 7 - LXD 2.0: LXD in LXD.md b/sources/tech/LXD/Part 7 - LXD 2.0: LXD in LXD.md new file mode 100644 index 0000000000..bdb26be75d --- /dev/null +++ b/sources/tech/LXD/Part 7 - LXD 2.0: LXD in LXD.md @@ -0,0 +1,6 @@ +Part 7 - LXD 2.0: LXD in LXD +============================== + +<原文待补充> + +原文:https://www.stgraber.org/2016/04/14/lxd-2-0-lxd-in-lxd-812/ From b146d488a2323fa086324d10dac9e29fb65e5e00 Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 4 May 2016 16:14:16 +0800 Subject: [PATCH 0684/1469] =?UTF-8?q?20160306-6=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/LXD/Part 9 - LXD 2.0: Live migration.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 sources/tech/LXD/Part 9 - LXD 2.0: Live migration.md diff --git a/sources/tech/LXD/Part 9 - LXD 2.0: Live migration.md b/sources/tech/LXD/Part 9 - LXD 2.0: Live migration.md new file mode 100644 index 0000000000..7be46f6a00 --- /dev/null +++ b/sources/tech/LXD/Part 9 - LXD 2.0: Live migration.md @@ -0,0 +1,6 @@ +Part 9 - LXD 2.0: Live migration +================================= + +<正文待补充> + +原文:https://www.stgraber.org/2016/04/25/lxd-2-0-live-migration-912/ From 1058b3399606e06dc1e541d72627dc9924d5e10f Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 4 May 2016 16:15:11 +0800 Subject: [PATCH 0685/1469] =?UTF-8?q?20160504-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/LXD/Part 4 - LXD 2.0: Resource control.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/LXD/Part 4 - LXD 2.0: Resource control.md b/sources/tech/LXD/Part 4 - LXD 2.0: Resource control.md index 178c46ea32..e404cccffa 100644 --- a/sources/tech/LXD/Part 4 - LXD 2.0: Resource control.md +++ b/sources/tech/LXD/Part 4 - LXD 2.0: Resource control.md @@ -390,7 +390,7 @@ And if you don’t want or can’t install LXD on your own machine, you can alwa -------------------------------------------------------------------------------- -via: https://www.stgraber.org/2016/03/19/lxd-2-0-your-first-lxd-container-312/ +via: https://www.stgraber.org/2016/03/26/lxd-2-0-resource-control-412/ 作者:[Stéphane Graber][a] 译者:[译者ID](https://github.com/译者ID) From 6564cc0aaaef3f0f67124665031a15d2a686eca1 Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 4 May 2016 16:16:12 +0800 Subject: [PATCH 0686/1469] =?UTF-8?q?20160504-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From 2177dbc5a3c9d69f9dae4e880c61f7730d990b89 Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 4 May 2016 16:17:57 +0800 Subject: [PATCH 0687/1469] =?UTF-8?q?20160504-5=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...- LXD 2.0: LXD in LXD.md => Part 8 - LXD 2.0: LXD in LXD.md} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename sources/tech/LXD/{Part 7 - LXD 2.0: LXD in LXD.md => Part 8 - LXD 2.0: LXD in LXD.md} (80%) diff --git a/sources/tech/LXD/Part 7 - LXD 2.0: LXD in LXD.md b/sources/tech/LXD/Part 8 - LXD 2.0: LXD in LXD.md similarity index 80% rename from sources/tech/LXD/Part 7 - LXD 2.0: LXD in LXD.md rename to sources/tech/LXD/Part 8 - LXD 2.0: LXD in LXD.md index bdb26be75d..76c361e517 100644 --- a/sources/tech/LXD/Part 7 - LXD 2.0: LXD in LXD.md +++ b/sources/tech/LXD/Part 8 - LXD 2.0: LXD in LXD.md @@ -1,4 +1,4 @@ -Part 7 - LXD 2.0: LXD in LXD +Part 8 - LXD 2.0: LXD in LXD ============================== <原文待补充> From 772cba3035747d49f6e5ed838bf11cfd369d41b4 Mon Sep 17 00:00:00 2001 From: Purling Nayuki Date: Wed, 4 May 2016 17:24:07 +0800 Subject: [PATCH 0688/1469] Proofread LXD/Part 1 - LXD 2.0: Introduction to LXD --- .../Part 1 - LXD 2.0: Introduction to LXD.md | 70 +++++++++---------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/translated/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md b/translated/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md index f8ed83a482..011f385881 100644 --- a/translated/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md +++ b/translated/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md @@ -10,7 +10,7 @@ Part 1 - LXD 2.0: LXD 入门 #### 什么是 LXD ? -简单来说 LXD 就是一个提供了 REST API 的 LXC 容器管理器。 +简单地说, LXD 就是一个提供了 REST API 的 LXC 容器管理器。 LXD 最主要的目标就是使用 Linux 容器而不是硬件虚拟化向用户提供一种接近虚拟机的使用体验。 @@ -18,27 +18,27 @@ LXD 最主要的目标就是使用 Linux 容器而不是硬件虚拟化向用户 这是一个最常被问起的问题,现在就让我们直接指出其中的不同吧。 -LXD 聚焦于系统容器,通常也被称为架构容器。这就是说 LXD 容器实际上运行了一个完整的 Linux 操作系统,就像在裸机或虚拟机上运行的一样。 +LXD 聚焦于系统容器,通常也被称为架构容器。这就是说 LXD 容器实际上如在裸机或虚拟机上运行一般运行了一个完整的 Linux 操作系统。 -这些容器一般都是基于一个干净的发布镜像,会长时间运行。传统的配置管理工具和发布工具可以和 LXD 一起使用,就像你在虚拟机、云或者物理机器上使用一样。 +这些容器一般基于一个干净的发布镜像并会长时间运行。传统的配置管理工具和部署工具可以如在虚拟机、云和物理机器上一样与 LXD 一起使用。 -相对的, Docker 关注于短视的、无状态的最小容器,这些容器通常并不会升级或者重新配置,它们一般都是作为一个整体被替换掉。这就使得 Docker 和类似的项目更像是一种软件发布机制,而不是一个机器管理工具。 +相对的, Docker 关注于短期的、无状态的最小容器,这些容器通常并不会升级或者重新配置,而是作为一个整体被替换掉。这就使得 Docker 及类似项目更像是一种软件发布机制,而不是一个机器管理工具。 -这两种模型并不是完全互斥的。你完全可以使用 LXD 为你的用户提供一个完整的 Linux 系统,而他们可以在 LXD 上面安装 Docker 来运行他们想要的软件。 +这两种模型并不是完全互斥的。你完全可以使用 LXD 为你的用户提供一个完整的 Linux 系统,而他们可以在 LXD 内安装 Docker 来运行他们想要的软件。 #### 为什么要用 LXD? -我们已经在 LXC 上工作了好几个年头了。 LXC 成功的实现了它的目标,它提供了一系列很棒的底层工具和库来创建、管理容器。 +我们已经持续开发并改进 LXC 好几年了。 LXC 成功的实现了它的目标,它提供了一系列很棒的用于创建和管理容器的底层工具和库。 -然而这些底层工具的使用界面对用户并不是很友好。他们需要用户有很多的基础知识来理解他们要干什么和怎么去干。同时向后兼容旧的容器和部署策略已经阻止 LXC 默认使用一些安全特性,这导致用户需要进行更多人工操作来实现本可以自动完成的工作。 +然而这些底层工具的使用界面对用户并不是很友好。使用它们需要用户有很多的基础知识以理解它们的工作方式和目的。同时,向后兼容旧的容器和部署策略也使得 LXC 无法默认使用一些安全特性,这导致用户需要进行更多人工操作来实现本可以自动完成的工作。 -我们把 LXD 作为解决这些缺陷的一个很好的机会。作为一个长时间运行的守护进程可以让我们定位到很多 LXC 的限制,比如动态资源限制,容器迁移和有效的进行在线迁移,它同时也给了我们机会来提供一个新的默认体验:默认开启安全特性,对用户更加友好。 +我们把 LXD 作为解决这些缺陷的一个很好的机会。作为一个长时间运行的守护进程, LXD 可以绕开 LXC 的许多限制,比如动态资源限制、无法进行容器迁移和高效的在线迁移;同时,它也为创造新的默认体验提供了机会:默认开启安全特性,对用户更加友好。 ### LXD 的主要组件 -LXD 是由几个主要组件构成的,在它的命令行客户端和 API结构体里,这些组件都是 LXD 目录结构下可见的。 +LXD 是由几个主要组件构成的,这些组件都是 LXD 目录结构、命令行客户端和 API 结构体里下可见的。 #### 容器 @@ -54,15 +54,15 @@ LXD 中的容器包括以下及部分: 容器快照和容器是一回事,只不过快照是不可修改的,只能被重命名,销毁或者用来恢复系统,但是无论如何都不能被修改。 -值得注意的是,因为我们允许用户保存容器的运行时状态,这就有效的为我们提供了“有状态”的快照的功能。这就是说我们可以使用快照回滚容器的 cpu 和内存。 +值得注意的是,因为我们允许用户保存容器的运行时状态,这就有效的为我们提供了“有状态”的快照的功能。这就是说我们可以使用快照回滚容器的 CPU 和内存。 #### 镜像 -LXD 是基于镜像实现的,所有的 LXD 容器都是来自于镜像。容器镜像经常是一些干净的 Linux 发布版的镜像,类似于你们在虚拟机和云实例上使用的镜像。 +LXD 是基于镜像实现的,所有的 LXD 容器都是来自于镜像。容器镜像通常是一些纯净的 Linux 发行版的镜像,类似于你们在虚拟机和云实例上使用的镜像。 -所以就可以“发布”容器:使用容器制作一个镜像,然后可以在本地或者远程 LXD 主机上使用。 +所以就可以「发布」容器:使用容器制作一个镜像并在本地或者远程 LXD 主机上使用。 -镜像通常使用 sha256 来区分,同时也可以使用它的全部或部分哈希码。因为输入长长的哈希码对用户来说不好,所以镜像可以使用几个自身的属性来区分,这就允许让用户在镜像商店里方便搜索镜像。别名也可以用来把对用户友好的字符串 1 比 1 的映射成镜像的哈希码。 +镜像通常使用全部或部分 sha256 哈希码来区分。因为输入长长的哈希码对用户来说不好,所以镜像可以使用几个自身的属性来区分,这就使得用户在镜像商店里方便搜索镜像。别名也可以用来 1 对 1 地把对用户友好的名字映射到某个镜像的哈希码。 LXD 安装时已经配置好了三个远程镜像服务器(参见下面的远程一节): @@ -70,55 +70,55 @@ LXD 安装时已经配置好了三个远程镜像服务器(参见下面的远 - “ubuntu-daily:” 提供每天构建出来的 Ubuntu - “images:” 社区维护的镜像服务器,提供一系列的 Linux 发布版,使用的是上游 LXC 的模板 -LXD 守护进程会从镜像上次被使用开始自动缓存远程镜像一段时间(默认是 10 天),然后这些镜像才会失效。 +LXD 守护进程会从镜像上次被使用开始自动缓存远程镜像一段时间(默认是 10 天),超过时限后这些镜像才会失效。 -此外 LXD 还会自动更新远程镜像(除非指明不更新),所以本地的镜像会一直是最新版的。 +此外, LXD 还会自动更新远程镜像(除非指明不更新),所以本地的镜像会一直是最新版的。 #### 配置 配置文件是一种在一处定义容器配置和容器设备,然后应用到一系列容器的方法。 -一个容器可以被应用多个配置文件。当构建最终容器配置时(即通常的扩展配置),这些配置文件都会按照他们定义顺序被应用到容器上,当有重名的配置,新的会覆盖掉旧的。然后本地容器配置会应用在这些之上,覆盖所有来自配置文件的选项。 +一个容器可以被应用多个配置文件。当构建最终容器配置时(即通常的扩展配置),这些配置文件都会按照他们定义顺序被应用到容器上,当有重名的配置时,新的会覆盖掉旧的。然后本地容器设置会在这些基础上应用,覆盖所有来自配置文件的选项。 LXD 自带两种预配置的配置文件: -- “default” 配置是自动应用在所有容器之上,除非用户提供了一系列替代的配置文件。目前这个配置文件只做一件事,为容器定义 “eth0” 网络设备。 -- “docker” 配置是一个允许你在容器里运行 Docker 容器的配置文件。它会要求 LXD 加载一些需要的内核模块,这样就能允许容器嵌套,并且创建一些设备入口。 +- 「 default 」配置是自动应用在所有容器之上,除非用户提供了一系列替代的配置文件。目前这个配置文件只做一件事,为容器定义 eth0 网络设备。 +- 「 docker” 」配置是一个允许你在容器里运行 Docker 容器的配置文件。它会要求 LXD 加载一些需要的内核模块以支持容器嵌套并创建一些设备入口。 #### 远程 如我之前提到的, LXD 是一个基于网络的守护进程。附带的命令行客户端可以与多个远程 LXD 服务器、镜像服务器通信。 -默认情况下我们的命令行客户端会与下面几个预定义的远程服务器通信: +默认情况下,我们的命令行客户端会与下面几个预定义的远程服务器通信: - local:(默认的远程服务器,使用 UNIX socket 和本地的 LXD 守护进程通信) -- ubuntu:(buntu 镜像服务器,提供稳定版的 Ubuntu 镜像) -- ubuntu-daily:(Ubuntu 镜像服务器,提供每天构建出来的 Ubuntu) -- images:(images.linuxcontainers.org 镜像服务器) +- ubuntu:( Ubuntu 镜像服务器,提供稳定版的 Ubuntu 镜像) +- ubuntu-daily:( Ubuntu 镜像服务器,提供每天构建出来的 Ubuntu ) +- images:( images.linuxcontainers.org 镜像服务器) 所有这些远程服务器的组合都可以在命令行客户端里使用。 -你也可以添加任意数量的远程 LXD 主机来监听网络。匿名服务器如果是开放镜像服务器,或者通过认证可以管理远程容器的镜像服务器,都可以添加进来。 +你也可以添加任意数量的远程 LXD 主机来监听网络。匿名的开放镜像服务器,或者通过认证可以管理远程容器的镜像服务器,都可以添加进来。 -正是这种远程机制使得和远程镜像服务器交互就像在主机间复制、移动容器成为可能。 +正是这种远程机制使得与远程镜像服务器交互及在主机间复制、移动容器成为可能。 ### 安全性 -我们设计 LXD 时的一个核心要求就当现代 Linux 发布版运行在容器里的时候要尽可能的安全。 +我们设计 LXD 时的一个核心要求,就是在不修改现代 Linux 发行版的前提下,使容器尽可能的安全。 -LXD 使用的主要安全特是通过使用 LXC 库实现的: +LXD 使用的、通过使用 LXC 库实现的主要安全特性有: -- 内核名字空间。特别是用户名字空间是一种让容器和系统剩余部分完全分割的方法。LXD 默认使用用户名字空间(和 LXC 相反),允许用户在需要的时候以容器为单位进行打开、关闭。 +- 内核名字空间。尤其是用户名字空间,它让容器和系统剩余部分完全分离。LXD 默认使用用户名字空间(和 LXC 相反),并允许用户在需要的时候以容器为单位打开或关闭。 - Seccomp 系统调用。用来隔离潜在危险的系统调用。 - AppArmor:对 mount、socket、ptrace 和文件访问提供额外的限制。特别是限制跨容器通信。 -- Capabilities。组织容器加载内核模块,修改主机系统时间,等等。 +- Capabilities。阻止容器加载内核模块,修改主机系统时间,等等。 - CGroups。限制资源使用,防止对主机的 DoS 攻击。 -和 LXC 直接将这些特性暴露出来不同, 为了对用户友好 ,LXD 构建了一个新的配置语言把大部分的这些特性都抽象封装起来。举了例子,一个用户可以告诉 LXD 把主机设备放进容器而不需要手动检查他们的主/次设备号来更新 CGroup 策略。 +为了对用户友好 , LXD 构建了一个新的配置语言把大部分的这些特性都抽象封装起来,而不是如 LXC 一般直接将这些特性暴露出来。举了例子,一个用户可以告诉 LXD 把主机设备放进容器而不需要手动检查他们的主/次设备号来更新 CGroup 策略。 -和 LXD 本身通信是基于使用 TLS 1.2 的链路,这些链路只允许使用有限的几个被允许的密钥。当和那些经过系统证书认证之外的主机通信时, LXD 会提示用户验证主机的远程足迹(SSH 方式),然后把足迹缓存起来以供以后使用。 +和 LXD 本身通信是基于使用 TLS 1.2 保护的链路,这些链路只允许使用有限的几个被允许的密钥。当和那些经过系统证书认证之外的主机通信时, LXD 会提示用户验证主机的远程足迹(SSH 方式),然后把足迹缓存起来以供以后使用。 ### REST 接口 @@ -128,13 +128,13 @@ REST 接口可以通过本地的 unix socket 访问,这只需要经过组认 REST 接口的结构能够和上文所说的不同的组件匹配,是一种简单、直观的使用方法。 -当需要一种复杂的通信机制时, LXD 将会进行websocket 协商完成剩余的通信工作。主要用于交互式终端会话,容器迁移和事件通知。 +当需要一种复杂的通信机制时, LXD 将会进行 websocket 协商完成剩余的通信工作。这主要用于交互式终端会话、容器迁移和事件通知。 -LXD 2.0 附带了 1.0 版的 API。我们虽然在 1.0 版 API 添加了额外的特性,但是这不会在 1.0 版 API 的端点里破坏向后兼容性,我们会声明额外的 API 扩展使得客户端可以找到新的接口。 +LXD 2.0 附带了 1.0 版的稳定 API。虽然我们在 1.0 版 API 添加了额外的特性,但是这不会在 1.0 版 API 的端点里破坏向后兼容性,因为我们会声明额外的 API 扩展使得客户端可以找到新的接口。 ### 容器规模化 -虽然 LXD 提供了一个很好的命令行客户端,但是这个客户端并不能管理多个主机的大量的容器。在这种使用情况下,我们可以使用 OpenStack 的插件 nova-lxd ,它可以使得 OpenStack 像使用虚拟机一样使用 LXD 容器。 +虽然 LXD 提供了一个很好的命令行客户端,但是这个客户端并不能管理多个主机上大量的容器。在这种使用情况下,我们可以使用 OpenStack 的 nova-lxd 插件,它可以使 OpenStack 像使用虚拟机一样使用 LXD 容器。 这就允许在大量的主机上部署大量的 LXD 容器,然后使用 OpenStack 的 API 来管理网络、存储以及负载均衡。 @@ -148,7 +148,7 @@ LXD 的邮件列表: LXD 的 IRC 频道: #lxcontainers on irc.freenode.net -如果你不想或者不能在你的机器上安装 LXD ,你可以在 web 上[试试在线版的 LXD][2] 。 +如果你不想或者不能在你的机器上安装 LXD ,你可以在 web 上[试试在线版的 LXD] [2] 。 -------------------------------------------------------------------------------- @@ -156,7 +156,7 @@ via: https://www.stgraber.org/2016/03/11/lxd-2-0-introduction-to-lxd-112/ 作者:[Stéphane Graber][a] 译者:[ezio](https://github.com/oska874) -校对:[校对者ID](https://github.com/校对者ID) +校对:[PurlingNayuki](https://github.com/PurlingNayuki) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 654aed05cd8c243bddd89fabc64cfe878363ff40 Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 5 May 2016 10:00:00 +0800 Subject: [PATCH 0689/1469] Update Part 2 - LXD 2.0: Installing and configuring LXD.md --- ...LXD 2.0: Installing and configuring LXD.md | 54 ++++++++++--------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/sources/tech/LXD/Part 2 - LXD 2.0: Installing and configuring LXD.md b/sources/tech/LXD/Part 2 - LXD 2.0: Installing and configuring LXD.md index 079b91c429..9f00e4eed2 100644 --- a/sources/tech/LXD/Part 2 - LXD 2.0: Installing and configuring LXD.md +++ b/sources/tech/LXD/Part 2 - LXD 2.0: Installing and configuring LXD.md @@ -9,11 +9,11 @@ Part 2 - LXD 2.0: 安装与配置 ### 安装篇 -There are many ways to get the latest and greatest LXD. We recommend you use LXD with the latest LXC and Linux kernel to benefit from all its features but we try to degrade gracefully where possible to support older Linux distributions. +获得 LXD 有很多种办法。我们推荐你是用配合最新版的 LXC 和 Linux 内核使用 LXD,这样就可以享受到它的全部特性,但是注意,我们现在也在慢慢的降低对旧版本 Linux 发布版的支持。 #### Ubuntu 标准版 -All new releases of LXD get uploaded to the Ubuntu development release within a few minutes of the upstream release. That package is then used to seed all the other source of packages for Ubuntu users. +所有新发布的 LXD 都会在发布几分钟后上传到 Ubuntu 开发版的安装源里。这个安装包然后就会当作种子给全部其他的安装包源,供 Ubuntu 用户使用。 如果使用 Ubuntu 16.04 则可以直接安装: @@ -56,21 +56,21 @@ sudo emerge --ask lxd #### 源代码 -Building LXD from source isn’t very difficult if you are used to building Go projects. Note however that you will need the LXC development headers. In order to run LXD, your distribution also needs a recent Linux kernel (3.13 at least), recent LXC (1.1.5 or higher), LXCFS and a version of shadow that supports user sub-uid/gid allocations. +如果你曾经编译过 Go 工程,那么从源代码编译 LXD 并不是十分困难。然而要住你的是你需要 LXC 的开发头文件。为了运行 LXD , 你的 发布版铜须也需要使用比较新的内核(最起码是 3.13),比较新的 LXC (1.1.4 或更高版本) ,LXCFS 以及支持用户子 uid/gid 分配的 shadow 。 -The latest instructions on building LXD from source can be found in the [upstream README][2]. +从源代码编译 LXD 的最新指令可以在[上游 README][2]里找到。 ### ubuntu 上的网络配置 -The Ubuntu packages provide you with a “lxdbr0” bridge as a convenience. This bridge comes unconfigured by default, offering only IPv6 link-local connectivity through an HTTP proxy. +Ubuntu 的安装包会很方便的给你提供一个 "lxdbr0" 网桥。这个网桥默认是没有配置过的,只提供通过 HTTP 代理的 IPV6 的本地连接。 -To reconfigure the bridge and add some IPv4 or IPv6 subnet to it, you can run: +要配置这个网桥和添加 IPV4 、 IPV6 子网,你可以运行下面的命令: ``` sudo dpkg-reconfigure -p medium lxd ``` -Or go through the whole LXD step by step setup (see below) with: +或者直接通过 LXD 初始化命令一步一步的配置: ``` sudo lxd init @@ -78,14 +78,13 @@ sudo lxd init ### 存储系统 -LXD supports a number of storage backends. It’s best to know what backend you want to use prior to starting to use LXD as we do not support moving existing containers or images between backends. +LXD 提供了集中存储后端。在开始使用 LXD 之前,你最好直到自己想要的后端,因为我们不支持在后端之间迁移已经生成的容器。 -A feature comparison table of the different backends can be found [here][3]. +各个[后端特性的比较表格][3]可以在这里找到。 #### ZFS -Our recommendation is ZFS as it supports all the features LXD needs to offer the fastest and most reliable container experience. This includes per-container disk quotas, immediate snapshot/restore, optimized migration (send/receive) and instant container creation from an image. It is also considered more mature than btrfs. - +我们的推荐是 ZFS , 因为他能支持 LXD 的全部特性,同时提供最快和最可靠的容器体验。它包括了以容器为单位的磁盘配额,直接快照和恢复,优化了的迁移(发送/接收),以及快速从镜像创建容器。它同时也被认为要比 btrfs 更成熟。 要和 LXD 一起使用 ZFS ,你需要首先在你的系统上安装 ZFS。 @@ -115,26 +114,28 @@ sudo apt install ubuntu-zfs sudo lxd init ``` -This will ask you a few questions about what kind of zfs configuration you’d like for your LXD and then configure it for you. +这条命令接下来会想你提问一下你想要的 ZFS 的配置,然后为你配置好 ZFS 。 #### btrfs -If ZFS isn’t available, then btrfs offers the same level of integration with the exception that it doesn’t properly report disk usage inside the container (quotas do apply though). -btrfs also has the nice property that it can nest properly which ZFS doesn’t yet. That is, if you plan on using LXD inside LXD, btrfs is worth considering. +如果 ZFS 不可用,那么 btrfs 可以提供相同级别的集成,除了不会合理的报告容器内的磁盘使用情况(虽然配额还是可以用的)。 -LXD doesn’t need any configuration to use btrfs, you just need to make sure that /var/lib/lxd is stored on a btrfs filesystem and LXD will automatically make use of it for you. +btrfs 同时拥有很好的嵌套属性,而这时 ZFS 所不具有的。也就是说如果你计划在 LXD 中再使用 LXD ,那么 btrfs 就很值得你考虑一下。 + +使用 btrfs 的话,LXD 不需要进行任何的配置,你只需要保证 `/var/lib/lxd` 是保存在 btrfs 文件系统中,然后 LXD 就会自动为你使用 btrfs 了。 #### LVM -If ZFS and btrfs aren’t an option for you, you can still get some of their benefits by using LVM instead. LXD uses LVM with thin provisioning, creating an LV for each image and container and using LVM snapshots as needed. +如果 ZFS 和 btrfs 都不是你想要的,你仍然可以考虑使用 LVM。 LXD 会以自动精简配置的方式使用 LVM,为每个镜像和容器创建 LV,如果需要的话也会使用 LVM 的快照功能。 + +要配置 LXD 使用 LVM,需要创建一个 LVM 的 VG ,然后运行: -To configure LXD to use LVM, create a LVM VG and run: ``` lxc config set storage.lvm_vg_name "THE-NAME-OF-YOUR-VG" ``` -By default LXD uses ext4 as the filesystem for all the LVs. You can change that to XFS if you’d like: +默认情况下 LXD 使用 ext4 作为全部 LV 的文件系统。如果你喜欢的话可以改成 XFS: ``` lxc config set storage.lvm_fstype xfs @@ -142,21 +143,19 @@ lxc config set storage.lvm_fstype xfs #### 简单目录 -If none of the above are an option for you, LXD will still work but without any of those advanced features. It will simply create a directory for each container, unpack the image tarballs for each container creation and do a full filesystem copy on container copy or snapshot. +如果上面全部方案你都不打算使用, LXD 还可以工作,但是不会使用任何高级特性。它只会为每个容器创建一个目录,然后在创建每个容器时解压缩镜像的压缩包,在容器拷贝和快照时会进行一次完整的文件系统拷贝。 -All features are supported except for disk quotas, but this is very wasteful of disk space and also very slow. If you have no other choice, it will work, but you should really consider one of the alternatives above. - - +除了磁盘配额以外的特性都是支持的,但是很浪费磁盘空间,并且非常慢。如果你没有其他选择,这还是可以工作的,但是你还是需要认真的考虑一下上面的几个方案。 ### 配置篇 -The complete list of configuration options for the LXD daemon can be found [here][4]. +LXD 守护进程的完整配置项列表可以在[这里找到][4]。 #### 网络配置 -By default LXD doesn’t listen to the network. The only way to talk to it is over a local unix socket at /var/lib/lxd/unix.socket. +默认情况下 LXD 不会监听网络。和它通信的唯一办法是使用本地 unix socket 通过 `/var/lib/lxd/unix.socket` 进行通信。 -To have it listen to the network, there are two useful keys to set: +要让 LXD 监听网络,下面有两个有用的命令: ``` lxc config set core.https_address [::] @@ -208,8 +207,11 @@ At this point you should have a working version of the latest LXD release, you c ### 额外信息 LXD 的主站在: + LXD 的 GitHub 仓库: + LXD 的邮件列表: + LXD 的 IRC 频道: #lxcontainers on irc.freenode.net 如果你不想或者不能在你的机器上安装 LXD ,你可以[试试在线版的 LXD][1] 。 @@ -219,7 +221,7 @@ LXD 的 IRC 频道: #lxcontainers on irc.freenode.net via: https://www.stgraber.org/2016/03/19/lxd-2-0-your-first-lxd-container-312/ 作者:[Stéphane Graber][a] -译者:[译者ID](https://github.com/译者ID) +译者:[ezio](https://github.com/oska874) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From fc97797762024265989ba4393e9cca85f3652901 Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 5 May 2016 11:58:32 +0800 Subject: [PATCH 0690/1469] Update Part 2 - LXD 2.0: Installing and configuring LXD.md --- .../LXD/Part 2 - LXD 2.0: Installing and configuring LXD.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sources/tech/LXD/Part 2 - LXD 2.0: Installing and configuring LXD.md b/sources/tech/LXD/Part 2 - LXD 2.0: Installing and configuring LXD.md index 9f00e4eed2..2f30288a2d 100644 --- a/sources/tech/LXD/Part 2 - LXD 2.0: Installing and configuring LXD.md +++ b/sources/tech/LXD/Part 2 - LXD 2.0: Installing and configuring LXD.md @@ -162,11 +162,11 @@ lxc config set core.https_address [::] lxc config set core.trust_password some-secret-string ``` -The first instructs LXD to bind the “::” IPv6 address, namely, all addresses on the machine. You can obviously replace this by a specific IPv4 or IPv6 address and can append the TCP port you’d like it to bind (defaults to 8443). +第一条命令将 LXD 绑定到 IPV6 地址 “::”,也就是监听机器的所有 IPV6 地址。你可以显式的使用一个特定的 IPV4 或者 IPV6 地址替代默认地址,如果你想绑定 TCP 端口(默认是 8443)的话可以在地址后面添加端口号即可。 -The second sets a password which is used for remote clients to add themselves to the LXD certificate trust store. When adding the LXD host, they will be prompted for the password, if the password matches, the LXD daemon will store their client certificate and they’ll be trusted, never needing the password again (it can be changed or unset entirely at that point). +第二条命令设置了密码,可以让远程客户端用来把自己添加到 LXD 可信证书中心。如果已经给主机设置了密码,当添加 LXD 主机时会提示输入密码, LXD 守护进程会保存他们的客户端的证书以确保客户端是可信的,这样就不需要再次输入密码(可以随时设置和取消) -You can also choose not to set a password and instead manually trust each new client by having them give you their “client.crt” file (from ~/.config/lxc) and add it to the trust store yourself with: +你也可以选择不设置密码,然后通过给每个客户端发送 "client.crt" (来自于 `~/.config/lxc`)文件,然后把它添加到你自己的可信中信来实现人工验证每个新客户端是否可信,可以使用下面的命令: ``` lxc config trust add client.crt From d759e47fa5f18fafdc2968ae1957110a1e20a204 Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 5 May 2016 12:45:30 +0800 Subject: [PATCH 0691/1469] =?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 --- ...art 2 - LXD 2.0: Installing and configuring LXD.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sources/tech/LXD/Part 2 - LXD 2.0: Installing and configuring LXD.md b/sources/tech/LXD/Part 2 - LXD 2.0: Installing and configuring LXD.md index 2f30288a2d..8e405254d3 100644 --- a/sources/tech/LXD/Part 2 - LXD 2.0: Installing and configuring LXD.md +++ b/sources/tech/LXD/Part 2 - LXD 2.0: Installing and configuring LXD.md @@ -188,9 +188,9 @@ With those, all transfers initiated by LXD will use the squid01.internal HTTP pr #### 镜像管理 -LXD does dynamic image caching. When instructed to create a container from a remote image, it will download that image into its image store, mark it as cached and record its origin. After a number of days without seeing any use (10 by default), the image is automatically removed. Every few hours (6 by default), LXD also goes looking for a newer version of the image and updates its local copy. +LXD 使用动态镜像缓存。当从远程镜像创建容器的时候,它会自动把镜像下载到本地镜像商店,同时标志为已缓存并记录来源。几天后(默认10天)如果没有再被使用,那么这个镜像就会自动被删除。每个几小时(默认是6小时) LXD 还会检查一下这个镜像是否有新版本,然后更新镜像的本地拷贝。 -All of that can be configured through the following configuration options: +所有这些都可以通过下面的配置选项进行配置: ``` lxc config set images.remote_cache_expiry 5 @@ -198,11 +198,12 @@ lxc config set images.auto_update_interval 24 lxc config set images.auto_update_cached false ``` -Here we are instructing LXD to override all of those defaults and instead cache images for up to 5 days since they were last used, look for image updates every 24 hours and only update images which were directly marked as such (–auto-update flag in lxc image copy) but not the images which were automatically cached by LXD. +这些命令让 LXD 修改了它的默认属性,缓存期替换为 5 天,更新间隔为 24 小时,而且只更新那些标志为自动更新的镜像(lxc 镜像拷贝有标志 `–auto-update`)而不是 LXD 自动缓存的镜像。 + ### 总结 -At this point you should have a working version of the latest LXD release, you can now start playing with it on your own or wait for the next blog post where we’ll create our first container and play with the LXD command line tool. +到这里为止,你就应该有了一个可以工作的、最新版的 LXD ,现在你可以开始用 LXD 了,或者等待我们的下一条博文,那时我们会介绍如何创建第一个容器以及使用 LXD 命令行工具操作容器。 ### 额外信息 @@ -218,7 +219,7 @@ LXD 的 IRC 频道: #lxcontainers on irc.freenode.net -------------------------------------------------------------------------------- -via: https://www.stgraber.org/2016/03/19/lxd-2-0-your-first-lxd-container-312/ +via: https://www.stgraber.org/2016/03/15/lxd-2-0-installing-and-configuring-lxd-212/ 作者:[Stéphane Graber][a] 译者:[ezio](https://github.com/oska874) From 0187ce4c5c35355cacd3aced0aa99920bc876dc2 Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 5 May 2016 12:46:52 +0800 Subject: [PATCH 0692/1469] Rename sources/tech/LXD/Part 2 - LXD 2.0: Installing and configuring LXD.md to translated/tech/LXD/Part 2 - LXD 2.0: Installing and configuring LXD.md --- .../tech/LXD/Part 2 - LXD 2.0: Installing and configuring LXD.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/LXD/Part 2 - LXD 2.0: Installing and configuring LXD.md (100%) diff --git a/sources/tech/LXD/Part 2 - LXD 2.0: Installing and configuring LXD.md b/translated/tech/LXD/Part 2 - LXD 2.0: Installing and configuring LXD.md similarity index 100% rename from sources/tech/LXD/Part 2 - LXD 2.0: Installing and configuring LXD.md rename to translated/tech/LXD/Part 2 - LXD 2.0: Installing and configuring LXD.md From 4d00e7e90f044cedf31e149f8a96c954b348a0ce Mon Sep 17 00:00:00 2001 From: carolinewuyan <309866211@qq.com> Date: Thu, 5 May 2016 15:36:32 +0800 Subject: [PATCH 0693/1469] =?UTF-8?q?=E5=B7=B2=E6=A0=A1=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... do after installing openSUSE Leap 42.1.md | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/translated/tech/20151202 8 things to do after installing openSUSE Leap 42.1.md b/translated/tech/20151202 8 things to do after installing openSUSE Leap 42.1.md index 109bf6c11d..ef5434da3d 100644 --- a/translated/tech/20151202 8 things to do after installing openSUSE Leap 42.1.md +++ b/translated/tech/20151202 8 things to do after installing openSUSE Leap 42.1.md @@ -1,28 +1,28 @@ -装好 openSUSE Leap 42.1 之后要做的 8 件事 +安装 openSUSE Leap 42.1 之后要做的 8 件事 ================================================================================ ![Credit: Metropolitan Transportation/Flicrk](http://images.techhive.com/images/article/2015/11/things-to-do-100626947-primary.idge.jpg) 致谢:[Metropolitan Transportation/Flicrk][1] -> 你已经在你的电脑上安装了 openSUSE。这是你接下来要做的。 +> 你已经在你的电脑上安装了 openSUSE,这是你接下来要做的。 -[openSUSE Leap 确实是个巨大的飞跃][2],它允许用户运行一个和 SUSE Linux 企业版拥有一样基因的发行版。和其它系统一样,在使用它之前需要做些优化设置。 +[openSUSE Leap 确实是个巨大的飞跃][2],它允许用户运行一个和 SUSE Linux 企业版拥有一样基因的发行版。和其它系统一样,为了实现最佳的使用效果,在使用它之前需要做些优化设置。 -下面是一些我在安装 openSUSE 到我的电脑上之后做的一些事情(不适用于服务器)。这里面没有强制性要求的设置,基本安装对来说你也可能足够了。但如果你想获得更好的 openSUSE Leap 体验,那就跟着我往下看吧。 +下面是一些我在我的电脑上安装 openSUSE Leap 之后做的一些事情(不适用于服务器)。这里面没有强制性要求的设置,基本安装对你来说也可能足够了。但如果你想获得更好的 openSUSE Leap 体验,那就跟着我往下看吧。 ### 1. 添加 Packman 仓库 ### -由于专利和授权等原因,openSUSE 和许多 Linux 发行版一样,不通过官方仓库(repos)提供一些软件,解码器,以及驱动等。取而代之的是通过第三方或社区仓库来提供。第一个也是最重要的仓库是“Packman”。因为这些仓库不是默认启用的,我们需要添加它们。你可以通过 YaST (openSUSE 的特色之一)或者命令行完成(如下方介绍)。 +由于专利和授权等原因,openSUSE 和许多 Linux 发行版一样,不通过官方仓库(repos)提供一些软件、解码器,以及驱动等。取而代之的是通过第三方或社区仓库来提供。第一个也是最重要的仓库是“Packman”。因为这些仓库不是默认启用的,我们需要添加它们。你可以通过 YaST(openSUSE 的特色之一)或者命令行完成(如下方介绍)。 ![o42 yast repo](http://images.techhive.com/images/article/2015/11/o42-yast-repo-100626952-large970.idge.png) 添加 Packman 仓库。 -使用 YsST,打开软件源部分。点击“添加”按钮并选择“社区仓库(Community Repositories)”。点击“下一步”。一旦仓库列表加载出来了,选择 Packman 仓库。点击“确认”,然后点击“信任”导入信任的 GnuPG 密钥。 +使用 YaST,打开软件源部分。点击“添加”按钮并选择“社区仓库(Community Repositories)”。点击“下一步”。一旦仓库列表加载出来了,选择 Packman 仓库。点击“确认”,然后点击“信任”导入信任的 GnuPG 密钥。 或者在终端里使用以下命令添加并启用 Packman 仓库: zypper ar -f -n packmanhttp://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Leap_42.1/ packman -仓库添加之后,你就能接触到更多的包了。想安装任意软件或包,打开 YaST 软件管理器,搜索并安装即可。 +仓库添加之后,你就可以使用更多的包了。想安装任意软件或包,打开 YaST 软件管理器,搜索并安装即可。 ### 2. 安装 VLC ### @@ -34,7 +34,7 @@ VLC 是媒体播放器里的瑞士军刀,几乎可以播放任何媒体文件 ### 3. 安装 Handbrake ### -如果你需要转码或转换视频文件格式,[Handbrake 是你的不二之选][3]。Handbrake 就在我们启用的仓库中,所以只要在 YaST 中搜索并安装它。 +如果你需要转码或转换视频文件格式,[Handbrake 是你的不二之选][3]。Handbrake 就在我们启用的仓库中,所以只需要在 YaST 中搜索并安装它即可。 如果你用终端,运行以下命令: @@ -44,7 +44,7 @@ VLC 是媒体播放器里的瑞士军刀,几乎可以播放任何媒体文件 ### 4. 安装 Chrome ### -openSUSE 的默认浏览器是 Firefox。但是因为 Firefox 不能胜任播放专有媒体,比如 Netflix,我推荐安装 Chrome。这需要额外的工作。首先你需要从谷歌导入信任密钥。打开终端执行“wget”命令下载密钥: +openSUSE 的默认浏览器是 Firefox。但是因为 Firefox 不能够播放专有媒体,比如 Netflix,我推荐安装 Chrome。这需要额外的工作。首先你需要从谷歌导入信任密钥。打开终端执行“wget”命令下载密钥: wget https://dl.google.com/linux/linux_signing_key.pub @@ -72,11 +72,11 @@ openSUSE 的默认浏览器是 Firefox。但是因为 Firefox 不能胜任播放 ### 6. 安装媒体解码器 ### -你安装 VLC 之后就不需要安装媒体解码器了,但如果你要使用其它软件来播放媒体的话就需要安装了。一些开发者写了脚本/工具来简化这个过程。打开[这个页面][5]并点击合适的按钮安装完整的包。他会打开 YaST 并自动安装包(当然通常你还需要提供 root 权限密码并信任 GnuPG 密钥)。 +你安装 VLC 之后就不需要安装媒体解码器了,但如果你要使用其它软件来播放媒体的话就需要安装了。一些开发者写了脚本/工具来简化这个过程。打开[这个页面][5]并点击合适的按钮安装完整的包。它会打开 YaST 并自动安装包(当然通常你还需要提供 root 权限密码并信任 GnuPG 密钥)。 -### 7. 安装你偏好的电子邮件客户端 ### +### 7. 安装你喜欢的电子邮件客户端 ### -openSUSE 自带 Kmail 或 Evolution,这取决于你安装的桌面环境。我用的是 Plasma,自带 Kmail,这个邮件客户端还有许多地方有待改进。我建议可以试试 Thunderbird 或 Evolution。所有主要的邮件客户端都能在官方仓库找到。你还可以看看我的[精心挑选的 Linux 最佳邮件客户端][7]。 +openSUSE 自带 Kmail 或 Evolution,这取决于你安装的桌面环境。我用的是 Plasma,自带 Kmail,这个邮件客户端还有许多地方有待改进。我建议可以试试 Thunderbird 或 Evolution。所有主要的邮件客户端都能在官方仓库找到。你还可以看看我[精心挑选的 Linux 最佳邮件客户端][7]。 ### 8. 在防火墙允许 Samba 服务 ### @@ -85,7 +85,7 @@ openSUSE 自带 Kmail 或 Evolution,这取决于你安装的桌面环境。我 ![o42 firewall](http://images.techhive.com/images/article/2015/11/o42-firewall-100626948-large970.idge.png) 在防火墙设置里允许 Samba 客户端和服务端 -打开 YaST 并搜索 Firewall。在防火墙设置里,到“允许的服务”那里你会在“要允许的服务”下面看到一个下拉列表。选择“Samba 客户端”,然后点击“添加”。对“Samba 服务端”也一样地添加。都添加了之后,点击“下一步”,然后点击“完成”,现在你就可以通过本地网络从你的 openSUSE 分享文件以及访问其它机器了。 +打开 YaST 并搜索 Firewall。在防火墙设置里,进入到“允许的服务(Allowed Services)”,你会在“要允许的服务(Service to allow)”下面看到一个下拉列表。选择“Samba 客户端”,然后点击“添加”。同样方法添加“Samba 服务器”。都添加了之后,点击“下一步”,然后点击“完成”,现在你就可以通过本地网络从你的 openSUSE 分享文件以及访问其它机器了。 这差不多就是我以我喜欢的方式对我的新 openSUSE 系统做的所有设置了。如果你有任何问题,欢迎在评论区提问。 @@ -95,7 +95,7 @@ via: http://www.itworld.com/article/3003865/open-source-tools/8-things-to-do-aft 作者:[Swapnil Bhartiya][a] 译者:[alim0x](https://github.com/alim0x) -校对:[校对者ID](https://github.com/校对者ID) +校对:[Caroline](https://github.com/carolinewuyan) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ea79a2f555eda7d7c74d54737ade5be163b87115 Mon Sep 17 00:00:00 2001 From: vim-kakali <1799225723@qq.com> Date: Thu, 5 May 2016 17:32:04 +0800 Subject: [PATCH 0694/1469] vim-kakal --- ...rce Linux Distributions Would Presidential Hopefuls Run.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 index 2a850a7468..cfb653f702 100644 --- 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 @@ -1,3 +1,5 @@ +vim-kakali translating + Which Open Source Linux Distributions Would Presidential Hopefuls Run? ================================================================================ ![Republican presidential candidate Donald Trump @@ -50,4 +52,4 @@ via: http://thevarguy.com/open-source-application-software-companies/081715/whic [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 +[7]:http://ubuntu.com/ From d4d536b295605d2f24b797d66fdb0c6f54083aea Mon Sep 17 00:00:00 2001 From: alim0x Date: Thu, 5 May 2016 22:10:30 +0800 Subject: [PATCH 0695/1469] [translating]20160301 The Evolving Markrt for ... --- ...lving Market for Commercial Software Built On Open Source.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160301 The Evolving Market for Commercial Software Built On Open Source.md b/sources/tech/20160301 The Evolving Market for Commercial Software Built On Open Source.md index 85ba752bfa..5cd6a2f1c1 100644 --- a/sources/tech/20160301 The Evolving Market for Commercial Software Built On Open Source.md +++ b/sources/tech/20160301 The Evolving Market for Commercial Software Built On Open Source.md @@ -1,3 +1,5 @@ +alim0x translating + The Evolving Market for Commercial Software Built On Open Source ===================================================================== From dfad964c88a4ff6bb7ccbcbe5f624d125444c328 Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 6 May 2016 10:04:18 +0800 Subject: [PATCH 0696/1469] =?UTF-8?q?20160504-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit update --- .../LXD/Part 5 - LXD 2.0: Image management.md | 453 +++++++++++++++++- 1 file changed, 452 insertions(+), 1 deletion(-) diff --git a/sources/tech/LXD/Part 5 - LXD 2.0: Image management.md b/sources/tech/LXD/Part 5 - LXD 2.0: Image management.md index 3a69aadd00..1e2e9ace01 100644 --- a/sources/tech/LXD/Part 5 - LXD 2.0: Image management.md +++ b/sources/tech/LXD/Part 5 - LXD 2.0: Image management.md @@ -1,7 +1,458 @@ Part 5 - LXD 2.0: Image management ================================== -<正文待补充> +This is the fifth blog post [in this series about LXD 2.0][0]. + +As there are a lot of commands involved with managing LXD containers, this post is rather long. If you’d instead prefer a quick step-by-step tour of those same commands, you can [try our online demo instead][1]! + +![](https://linuxcontainers.org/static/img/containers.png) + +### Container images + +If you’ve used LXC before, you probably remember those LXC “templates”, basically shell scripts that spit out a container filesystem and a bit of configuration. + +Most templates generate the filesystem by doing a full distribution bootstrapping on your local machine. This may take quite a while, won’t work for all distributions and may require significant network bandwidth. + +Back in LXC 1.0, I wrote a “download” template which would allow users to download pre-packaged container images, generated on a central server from the usual template scripts and then heavily compressed, signed and distributed over https. A lot of our users switched from the old style container generation to using this new, much faster and much more reliable method of creating a container. + +With LXD, we’re taking this one step further by being all-in on the image based workflow. All containers are created from an image and we have advanced image caching and pre-loading support in LXD to keep the image store up to date. + +### Interacting with LXD images + +Before digging deeper into the image format, lets quickly go through what LXD lets you do with those images. + +#### Transparently importing images + +All containers are created from an image. The image may have come from a remote image server and have been pulled using its full hash, short hash or an alias, but in the end, every LXD container is created from a local image. + +Here are a few examples: + +``` +lxc launch ubuntu:14.04 c1 +lxc launch ubuntu:75182b1241be475a64e68a518ce853e800e9b50397d2f152816c24f038c94d6e c2 +lxc launch ubuntu:75182b1241be c3 +``` + +All of those refer to the same remote image (at the time of this writing), the first time one of those is run, the remote image will be imported in the local LXD image store as a cached image, then the container will be created from it. + +The next time one of those commands are run, LXD will only check that the image is still up to date (when not referring to it by its fingerprint), if it is, it will create the container without downloading anything. + +Now that the image is cached in the local image store, you can also just start it from there without even checking if it’s up to date: + +``` +lxc launch 75182b1241be c4 +``` + +And lastly, if you have your own local image under the name “myimage”, you can just do: + +``` +lxc launch my-image c5 +``` + +If you want to change some of that automatic caching and expiration behavior, there are instructions in an earlier post in this series. + +#### Manually importing images + +##### Copying from an image server + +If you want to copy some remote image into your local image store but not immediately create a container from it, you can use the “lxc image copy” command. It also lets you tweak some of the image flags, for example: + +``` +lxc image copy ubuntu:14.04 local: +``` + +This simply copies the remote image into the local image store. + +If you want to be able to refer to your copy of the image by something easier to remember than its fingerprint, you can add an alias at the time of the copy: + +``` +lxc image copy ubuntu:12.04 local: --alias old-ubuntu +lxc launch old-ubuntu c6 +``` + +And if you would rather just use the aliases that were set on the source server, you can ask LXD to copy the for you: + +lxc image copy ubuntu:15.10 local: --copy-aliases +lxc launch 15.10 c7 +All of the copies above were one-shot copy, so copying the current version of the remote image into the local image store. If you want to have LXD keep the image up to date, as it does for the ones stored in its cache, you need to request it with the `–auto-update` flag: + +``` +lxc image copy images:gentoo/current/amd64 local: --alias gentoo --auto-update +``` + +##### Importing a tarball + +If someone provides you with a LXD image as a single tarball, you can import it with: + +``` +lxc image import +``` + +If you want to set an alias at import time, you can do it with: + +``` +lxc image import --alias random-image +``` + +Now if you were provided with two tarballs, identify which contains the LXD metadata. Usually the tarball name gives it away, if not, pick the smallest of the two, metadata tarballs are tiny. Then import them both together with: + +``` +lxc image import +``` + +##### Importing from a URL + +“lxc image import” also works with some special URLs. If you have an https web server which serves a path with the LXD-Image-URL and LXD-Image-Hash headers set, then LXD will pull that image into its image store. + +For example you can do: + +``` +lxc image import https://dl.stgraber.org/lxd --alias busybox-amd64 +``` + +When pulling the image, LXD also sets some headers which the remote server could check to return an appropriate image. Those are LXD-Server-Architectures and LXD-Server-Version. + +This is meant as a poor man’s image server. It can be made to work with any static web server and provides a user friendly way to import your image. + +#### Managing the local image store + +Now that we have a bunch of images in our local image store, lets see what we can do with them. We’ve already covered the most obvious, creating containers from them but there are a few more things you can do with the local image store. + +##### Listing images + +To get a list of all images in the store, just run “lxc image list”: + +``` +stgraber@dakara:~$ lxc image list ++---------------+--------------+--------+------------------------------------------------------+--------+----------+------------------------------+ +| ALIAS | FINGERPRINT | PUBLIC | DESCRIPTION | ARCH | SIZE | UPLOAD DATE | ++---------------+--------------+--------+------------------------------------------------------+--------+----------+------------------------------+ +| alpine-32 | 6d9c131efab3 | yes | Alpine edge (i386) (20160329_23:52) | i686 | 2.50MB | Mar 30, 2016 at 4:36am (UTC) | ++---------------+--------------+--------+------------------------------------------------------+--------+----------+------------------------------+ +| busybox-amd64 | 74186c79ca2f | no | Busybox x86_64 | x86_64 | 0.79MB | Mar 30, 2016 at 4:33am (UTC) | ++---------------+--------------+--------+------------------------------------------------------+--------+----------+------------------------------+ +| gentoo | 1a134c5951e0 | no | Gentoo current (amd64) (20160329_14:12) | x86_64 | 232.50MB | Mar 30, 2016 at 4:34am (UTC) | ++---------------+--------------+--------+------------------------------------------------------+--------+----------+------------------------------+ +| my-image | c9b6e738fae7 | no | Scientific Linux 6 x86_64 (default) (20160215_02:36) | x86_64 | 625.34MB | Mar 2, 2016 at 4:56am (UTC) | ++---------------+--------------+--------+------------------------------------------------------+--------+----------+------------------------------+ +| old-ubuntu | 4d558b08f22f | no | ubuntu 12.04 LTS amd64 (release) (20160315) | x86_64 | 155.09MB | Mar 30, 2016 at 4:30am (UTC) | ++---------------+--------------+--------+------------------------------------------------------+--------+----------+------------------------------+ +| w (11 more) | d3703a994910 | no | ubuntu 15.10 amd64 (release) (20160315) | x86_64 | 153.35MB | Mar 30, 2016 at 4:31am (UTC) | ++---------------+--------------+--------+------------------------------------------------------+--------+----------+------------------------------+ +| | 75182b1241be | no | ubuntu 14.04 LTS amd64 (release) (20160314) | x86_64 | 118.17MB | Mar 30, 2016 at 4:27am (UTC) | ++---------------+--------------+--------+------------------------------------------------------+--------+----------+------------------------------+ +``` + +You can filter based on the alias or fingerprint simply by doing: + +``` +stgraber@dakara:~$ lxc image list amd64 ++---------------+--------------+--------+-----------------------------------------+--------+----------+------------------------------+ +| ALIAS | FINGERPRINT | PUBLIC | DESCRIPTION | ARCH | SIZE | UPLOAD DATE | ++---------------+--------------+--------+-----------------------------------------+--------+----------+------------------------------+ +| busybox-amd64 | 74186c79ca2f | no | Busybox x86_64 | x86_64 | 0.79MB | Mar 30, 2016 at 4:33am (UTC) | ++---------------+--------------+--------+-----------------------------------------+--------+----------+------------------------------+ +| w (11 more) | d3703a994910 | no | ubuntu 15.10 amd64 (release) (20160315) | x86_64 | 153.35MB | Mar 30, 2016 at 4:31am (UTC) | ++---------------+--------------+--------+-----------------------------------------+--------+----------+------------------------------+ +``` + +Or by specifying a key=value filter of image properties: + +``` +stgraber@dakara:~$ lxc image list os=ubuntu ++-------------+--------------+--------+---------------------------------------------+--------+----------+------------------------------+ +| ALIAS | FINGERPRINT | PUBLIC | DESCRIPTION | ARCH | SIZE | UPLOAD DATE | ++-------------+--------------+--------+---------------------------------------------+--------+----------+------------------------------+ +| old-ubuntu | 4d558b08f22f | no | ubuntu 12.04 LTS amd64 (release) (20160315) | x86_64 | 155.09MB | Mar 30, 2016 at 4:30am (UTC) | ++-------------+--------------+--------+---------------------------------------------+--------+----------+------------------------------+ +| w (11 more) | d3703a994910 | no | ubuntu 15.10 amd64 (release) (20160315) | x86_64 | 153.35MB | Mar 30, 2016 at 4:31am (UTC) | ++-------------+--------------+--------+---------------------------------------------+--------+----------+------------------------------+ +| | 75182b1241be | no | ubuntu 14.04 LTS amd64 (release) (20160314) | x86_64 | 118.17MB | Mar 30, 2016 at 4:27am (UTC) | ++-------------+--------------+--------+---------------------------------------------+--------+----------+------------------------------+ +``` + +To see everything LXD knows about a given image, you can use “lxc image info”: + +``` +stgraber@castiana:~$ lxc image info ubuntu +Fingerprint: e8a33ec326ae7dd02331bd72f5d22181ba25401480b8e733c247da5950a7d084 +Size: 139.43MB +Architecture: i686 +Public: no +Timestamps: + Created: 2016/03/15 00:00 UTC + Uploaded: 2016/03/16 05:50 UTC + Expires: 2017/04/26 00:00 UTC +Properties: + version: 12.04 + aliases: 12.04,p,precise + architecture: i386 + description: ubuntu 12.04 LTS i386 (release) (20160315) + label: release + os: ubuntu + release: precise + serial: 20160315 +Aliases: + - ubuntu +Auto update: enabled +Source: + Server: https://cloud-images.ubuntu.com/releases + Protocol: simplestreams + Alias: precise/i386 +``` + +##### Editing images + +A convenient way to edit image properties and some of the flags is to use: + +lxc image edit +This opens up your default text editor with something like this: + +autoupdate: true +properties: + aliases: 14.04,default,lts,t,trusty + architecture: amd64 + description: ubuntu 14.04 LTS amd64 (release) (20160314) + label: release + os: ubuntu + release: trusty + serial: "20160314" + version: "14.04" +public: false +You can change any property you want, turn auto-update on and off or mark an image as publicly available (more on that later). + +##### Deleting images + +Remove an image is a simple matter of running: + +``` +lxc image delete +``` + +Note that you don’t have to remove cached entries, those will automatically be removed by LXD after they expire (by default, after 10 days since they were last used). + +##### Exporting images + +If you want to get image tarballs from images currently in your image store, you can use “lxc image export”, like: + +``` +stgraber@dakara:~$ lxc image export old-ubuntu . +Output is in . +stgraber@dakara:~$ ls -lh *.tar.xz +-rw------- 1 stgraber domain admins 656 Mar 30 00:55 meta-ubuntu-12.04-server-cloudimg-amd64-lxd.tar.xz +-rw------- 1 stgraber domain admins 156M Mar 30 00:55 ubuntu-12.04-server-cloudimg-amd64-lxd.tar.xz +``` + +#### Image formats + +LXD right now supports two image layouts, unified or split. Both of those are effectively LXD-specific though the latter makes it easier to re-use the filesystem with other container or virtual machine runtimes. + +LXD being solely focused on system containers, doesn’t support any of the application container “standard” image formats out there, nor do we plan to. + +Our images are pretty simple, they’re made of a container filesystem, a metadata file describing things like when the image was made, when it expires, what architecture its for, … and optionally a bunch of file templates. + +See this document for up to date details on the [image format][1]. + +##### Unified image (single tarball) + +The unified image format is what LXD uses when generating images itself. They are a single big tarball, containing the container filesystem inside a “rootfs” directory, have the metadata.yaml file at the root of the tarball and any template goes into a “templates” directory. + +Any compression (or none at all) can be used for that tarball. The image hash is the sha256 of the resulting compressed tarball. + +##### Split image (two tarballs) + +This format is most commonly used by anyone rolling their own images and who already have a compressed filesystem tarball. + +They are made of two distinct tarball, the first contains just the metadata bits that LXD uses, so the metadata.yaml file at the root and any template in the “templates” directory. + +The second tarball contains only the container filesystem directly at its root. Most distributions already produce such tarballs as they are common for bootstrapping new machines. This image format allows re-using them unmodified. + +Any compression (or none at all) can be used for either tarball, they can absolutely use different compression algorithms. The image hash is the sha256 of the concatenation of the metadata and rootfs tarballs. + +##### Image metadata + +A typical metadata.yaml file looks something like: + +``` +architecture: "i686" +creation_date: 1458040200 +properties: + architecture: "i686" + description: "Ubuntu 12.04 LTS server (20160315)" + os: "ubuntu" + release: "precise" +templates: + /var/lib/cloud/seed/nocloud-net/meta-data: + when: + - start + template: cloud-init-meta.tpl + /var/lib/cloud/seed/nocloud-net/user-data: + when: + - start + template: cloud-init-user.tpl + properties: + default: | + #cloud-config + {} + /var/lib/cloud/seed/nocloud-net/vendor-data: + when: + - start + template: cloud-init-vendor.tpl + properties: + default: | + #cloud-config + {} + /etc/init/console.override: + when: + - create + template: upstart-override.tpl + /etc/init/tty1.override: + when: + - create + template: upstart-override.tpl + /etc/init/tty2.override: + when: + - create + template: upstart-override.tpl + /etc/init/tty3.override: + when: + - create + template: upstart-override.tpl + /etc/init/tty4.override: + when: + - create + template: upstart-override.tpl +``` + +##### Properties + +The two only mandatory fields are the creation date (UNIX EPOCH) and the architecture. Everything else can be left unset and the image will import fine. + +The extra properties are mainly there to help the user figure out what the image is about. The “description” property for example is what’s visible in “lxc image list”. The other properties can be used by the user to search for specific images using key/value search. + +Those properties can then be edited by the user through “lxc image edit” in contrast, the creation date and architecture fields are immutable. + +##### Templates + +The template mechanism allows for some files in the container to be generated or re-generated at some point in the container lifecycle. + +We use the pongo2 templating engine for those and we export just about everything we know about the container to the template. That way you can have custom images which use user-defined container properties or normal LXD properties to change the content of some specific files. + +As you can see in the example above, we’re using those in Ubuntu to seed cloud-init and to turn off some init scripts. + +### Creating your own images + +LXD being focused on running full Linux systems means that we expect most users to just use clean distribution images and not spin their own image. + +However there are a few cases where having your own images is useful. Such as having pre-configured images of your production servers or building your own images for a distribution or architecture that we don’t build images for. + +#### Turning a container into an image + +The easiest way by far to build an image with LXD is to just turn a container into an image. + +This can be done with: + +``` +lxc launch ubuntu:14.04 my-container +lxc exec my-container bash + +lxc publish my-container --alias my-new-image +``` + +You can even turn a past container snapshot into a new image: + +``` +lxc publish my-container/some-snapshot --alias some-image +``` + +#### Manually building an image + +Building your own image is also pretty simple. + +1. Generate a container filesystem. This entirely depends on the distribution you’re using. For Ubuntu and Debian, it would be by using debootstrap. +2. Configure anything that’s needed for the distribution to work properly in a container (if anything is needed). +3. Make a tarball of that container filesystem, optionally compress it. +4. Write a new metadata.yaml file based on the one described above. +5. Create another tarball containing that metadata.yaml file. +6. Import those two tarballs as a LXD image with: + ``` + lxc image import --alias some-name + ``` + +You will probably need to go through this a few times before everything works, tweaking things here and there, possibly adding some templates and properties. + +### Publishing your images + +All LXD daemons act as image servers. Unless told otherwise all images loaded in the image store are marked as private and so only trusted clients can retrieve those images, but should you want to make a public image server, all you have to do is tag a few images as public and make sure you LXD daemon is listening to the network. + +#### Just running a public LXD server + +The easiest way to share LXD images is to run a publicly visible LXD daemon. + +You typically do that by running: + +``` +lxc config set core.https_address "[::]:8443" +``` + +Remote users can then add your server as a public image server with: + +``` +lxc remote add --public +``` + +They can then use it just as they would any of the default image servers. As the remote server was added with “–public”, no authentication is required and the client is restricted to images which have themselves been marked as public. + +To change what images are public, just “lxc image edit” them and set the public flag to true. + +#### Use a static web server + +As mentioned above, “lxc image import” supports downloading from a static http server. The requirements are basically: + +* The server must support HTTPs with a valid certificate, TLS1.2 and EC ciphers +* When hitting the URL provided to “lxc image import”, the server must return an answer including the LXD-Image-Hash and LXD-Image-URL HTTP headers + +If you want to make this dynamic, you can have your server look for the LXD-Server-Architectures and LXD-Server-Version HTTP headers which LXD will provide when fetching the image. This allows you to return the right image for the server’s architecture. + +#### Build a simplestreams server + +The “ubuntu:” and “ubuntu-daily:” remotes aren’t using the LXD protocol (“images:” is), those are instead using a different protocol called simplestreams. + +simplestreams is basically an image server description format, using JSON to describe a list of products and files related to those products. + +It is used by a variety of tools like OpenStack, Juju, MAAS, … to find, download or mirror system images and LXD supports it as a native protocol for image retrieval. + +While certainly not the easiest way to start providing LXD images, it may be worth considering if your images can also be used by some of those other tools. + +More information can be found here. + +### Conclusion + +I hope this gave you a good idea of how LXD manages its images and how to build and distribute your own. The ability to have the exact same image easily available bit for bit on a bunch of globally distributed system is a big step up from the old LXC days and leads the way to more reproducible infrastructure. + +### Extra information + +The main LXD website is at: +Development happens on Github at: +Mailing-list support happens on: +IRC support happens in: #lxcontainers on irc.freenode.net + +And if you don’t want or can’t install LXD on your own machine, you can always [try it online instead][3]! +-------------------------------------------------------------------------------- + +via: https://www.stgraber.org/2016/03/30/lxd-2-0-image-management-512/ + +作者:[Stéphane Graber][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.stgraber.org/author/stgraber/ +[0]: https://www.stgraber.org/2016/03/11/lxd-2-0-blog-post-series-012/ +[1]: https://github.com/lxc/lxd/blob/master/doc/image-handling.md +[2]: https://launchpad.net/simplestreams +[3]: https://linuxcontainers.org/lxd/try-it 原文:https://www.stgraber.org/2016/03/30/lxd-2-0-image-management-512/ From 4634a12411cce1ea4ec8caeef4c39e32b126f1c7 Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 6 May 2016 10:29:16 +0800 Subject: [PATCH 0697/1469] =?UTF-8?q?20160506-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nfessions of a cross-platform developer.md | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 sources/talk/20160505 Confessions of a cross-platform developer.md diff --git a/sources/talk/20160505 Confessions of a cross-platform developer.md b/sources/talk/20160505 Confessions of a cross-platform developer.md new file mode 100644 index 0000000000..807dfd544b --- /dev/null +++ b/sources/talk/20160505 Confessions of a cross-platform developer.md @@ -0,0 +1,72 @@ +Confessions of a cross-platform developer +============================================= + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/business_clouds.png?itok=cucHuJnU) + +[Andreia Gaita][1] is giving a talk at this year's OSCON, titled [Confessions of a cross-platform developer][2]. She's a long-time open source and [Mono][3] contributor, and develops primarily in C#/C++. Andreia works at GitHub, where she's focused on building the GitHub Extension manager for Visual Studio. + +I caught up with Andreia ahead of her talk to ask about cross-platform development and what she's learned in her 16 years as a cross-platform developer. + +![](https://opensource.com/sites/default/files/images/life/Interview%20banner%20Q%26A.png) + +**What languages have you found easiest and hardest to develop cross-platform code for?** + +It's less about which languages are good and more about the libraries and tooling available for those languages. The compilers/interpreters/build systems available for languages determine how easy it is to do cross-platform work with them (or whether it's even possible), and the libraries available for UI and native system access determine how deep you can integrate with the OS. With that in mind, I found C# to be the best for cross-platform work. The language itself includes features that allow fast native calls and accurate memory mapping, which you really need if you want your code to talk to the OS and native libraries. When I need very specific OS integration, I switch to C or C++. + +**What cross-platform toolkits/abstractions have you used?** + +Most of my cross-platform work has been developing tools, libraries and bindings for other people to develop cross-platform applications with, mostly in Mono/C# and C/C++. I don't get to use a lot of abstractions at that level, beyond glib and friends. I mostly rely on Mono for any cross-platform app that includes a UI, and Unity3D for the occasional game development. I play with Electron every now and then. + +**What has been your approach to build systems, and how does this vary by language or platform?** + +I try to pick the build system that is most suited for the language(s) I'm using. That way, it'll (hopefully) give me less headaches. It needs to allow for platform and architecture selection, be smart about build artifact locations (for multiple parallel builds), and be decently configurable. Most of the time I have projects combining C/C++ and C# and I want to build all the different configurations at the same time from the same source tree (Debug, Release, Windows, OSX, Linux, Android, iOS, etc, etc.), and that usually requires selecting and invoking different compilers with different flags per output build artifact. So the build system has to let me do all of this without getting (too much) in my way. I try out different build systems every now and then, just to see what's new, but in the end, I end up going back to makefiles and a combination of either shell and batch scripts or Perl scripts for driving them (because if I want users to build my things, I'd better pick a command line script language that is available everywhere). + +**How do you balance the desire for native look and feel with the need for uniform user interfaces?** + +Cross-platform UI is hard! I've implemented several cross-platform GUIs over the years, and it's the one thing for which I don't think there's an optimal solution. There's basically two options. You can pick a cross-platform GUI toolkit and do a UI that doesn't feel quite right in all the platforms you support, with a small codebase and low maintenance cost. Or you can choose to develop platform-specific UIs that will look and feel native and well integrated with a larger codebase and higher maintenance cost. The decision really depends on the type of app, how many features it has, how many resources you have, and how many platforms you're shipping to. + +In the end, I think there's an increase in users' tolerance for "One UI To Rule Them All" with frameworks like Electron. I have a Chromium+C+C# framework side project that will one day hopefully allow me build Electron-style apps in C#, giving me the best of both worlds. + +**Has building/packaging dependencies been an issue for you?** + +I'm very conservative about my use of dependencies, having been bitten so many times by breaking ABIs, clashing symbols, and missing packages. I decide which OS version(s) I'm targeting and pick the lowest common denominator release available of a dependency to minimize issues. That usually means having five different copies of Xcode and OSX Framework libraries, five different versions of Visual Studio installed side-to-side on the same machine, multiple clang and gcc versions, and a bunch of VMs running various other distros. If I'm unsure of the state of packages in the OS I'm targeting, I will sometimes link statically and sometimes submodule dependencies to make sure they're always available. And most of all, I avoid the bleeding edge unless I really, really need something there. + +**Do you use continuous integration, code review, and related tools?** + +All the time! It's the only way to keep sane. The first thing I do on a project is set up cross-platform build scripts to ensure everything is automateable as early as possible. When you're targeting multiple platforms, CI is essential. It's impossible for everyone to build all the different combinations of platforms in one machine, and as soon as you're not building all of them you're going to break something without being aware of it. In a shared multi-platform codebase, different people own different platforms and features, so the only way to guarantee quality is to have cross-team code reviews combined with CI and other analysis tools. It's no different than other software projects, there's just more points of failure. + +**Do you rely on automated build testing, or do you tend to build on each platform and test locally?** + +For tools and libraries that don't include UIs, I can usually get away with automated build testing. If there's a UI, then I need to do both—reliable, scriptable UI automation for existing GUI toolkits is rare to non-existent, so I would have to either invest in creating UI automation tools that work across all the platforms I want to support, or I do it manually. If a project uses a custom UI toolkit (like, say, an OpenGL UI like Unity3D does), then it's fairly easy to develop scriptable automation tools and automate most of that stuff. Still, there's nothing like the human ability to break things with a couple of clicks! + +**If you are developing cross-platform, do you support cross-editor build systems so that you can use Visual Studio on Windows, Qt Creator on Linux, and XCode on Mac? Or do you tend toward supporting one platform such as Eclipse on all platforms?** + +I favor cross-editor build systems. I prefer generating project files for different IDEs (preferably in a way that makes it easier to add more IDEs), with build scripts that can drive builds from the IDEs for the platform they're on. Editors are the most important tool for a developer. It takes time and effort to learn them, and they're not interchangeable. I have my favorite editors and tools, and everyone else should be able to use their favorite tool, too. + +**What is your preferred editor/development environment/IDE for cross-platform development?** + +The cross-platform developer is cursed with having to pick the lowest common denominator editor that works across the most platforms. I love Visual Studio, but I can't rely on it for anything except Windows work (and you really don't want to make Windows your primary cross-compiling platform), so I can't make it my primary IDE. Even if I could, an essential skill of cross-platform development is to know and use as many platforms as possible. That means really knowing them—using the platform's editors and libraries, getting to know the OS and its assumptions, behaviors, and limitations, etc. To do that and keep my sanity (and my shortcut muscle memory), I have to rely on cross-platform editors. So, I use Emacs and Sublime. + +**What are some of your favorite past and current cross-platform projects?** + +Mono is my all-time favorite, hands down, and most of the others revolve around it in some way. Gluezilla was a Mozilla binding I did years ago to allow C# apps to embed web browser views, and that one was a doozy. At one point I had a Winforms app, built on Linux, running on Windows with an embedded GTK view in it that was running a Mozilla browser view. The CppSharp project (formerly Cxxi, formerly CppInterop) is a project I started to generate C# bindings for C++ libraries so that you could call, create instances of, and subclass C++ classes from C#. It was done in such a way that it would detect at runtime what platform you'd be running on and what compiler was used to create the native library and generate the correct C# bindings for it. That was fun! + +**Where do you see cross-platform development heading in the future?** + +The way we build native applications is already changing, and I feel like the visual differences between the various desktop operating systems are going to become even more blurred so that it will become easier to build cross-platform apps that integrate reasonably well without being fully native. Unfortunately, that might mean applications will be worse in terms of accessibility and less innovative when it comes to using the OS to its full potential. Cross-platform development of tools, libraries, and runtimes is something that we know how to do well, but there's still a lot of work to do with cross-platform application development. + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/business/16/5/oscon-interview-andreia-gaita + +作者:[Marcus D. Hanwell ][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mhanwell +[1]: https://twitter.com/sh4na +[2]: http://conferences.oreilly.com/oscon/open-source-us/public/schedule/detail/48702 +[3]: http://www.mono-project.com/ From 27cb03f2a78329851f4f7608176decef769dff94 Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 6 May 2016 11:39:44 +0800 Subject: [PATCH 0698/1469] =?UTF-8?q?20160506-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ction of Drupal, IoT, and open hardware.md | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 sources/tech/20160502 The intersection of Drupal, IoT, and open hardware.md diff --git a/sources/tech/20160502 The intersection of Drupal, IoT, and open hardware.md b/sources/tech/20160502 The intersection of Drupal, IoT, and open hardware.md new file mode 100644 index 0000000000..751024fb3a --- /dev/null +++ b/sources/tech/20160502 The intersection of Drupal, IoT, and open hardware.md @@ -0,0 +1,52 @@ +The intersection of Drupal, IoT, and open hardware +======================================================= + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/drupal_blue_gray_lead.jpeg?itok=t7W_KD-D) + + +Meet [Amber Matz][1], a Production Manager and Trainer at [Drupalize.Me][3], a service of Lullabot Education. When she's not tinkering around with Arduinos, Raspberry Pis, and electronic wearables, you can find her wrangling presenters for the Portland Drupal User Group. + +Coming up at [DrupalCon NOLA][3], Amber will host a session about Drupal and IoT. If you're attending and want to learn about the intersection of open hardware, IoT, and Drupal, this session is for you. If you're not able to join us in New Orleans, Amber has some pretty cool things to share. In this interview, she tells us how she got involved with Drupal, a few of her favorite open hardware projects, and what the future holds for IoT and Drupal. + +![](https://opensource.com/sites/default/files/images/life/Interview%20banner%20Q%26A.png) + +**How did you get involved with the Drupal community?** + +Back in the day, I was working at a large nonprofit in the "webmaster's office" of the marketing department and was churning out custom PHP/MySQL forms like nobody's business. I finally got weary of that and starting hunting around the web for a better way. I found Drupal 6 and starting diving in on my own. Years later, after a career shift and a move, I discovered the Portland Drupal User Group and landed a job as a full-time Drupal developer. I continued to regularly attend the meetups in Portland, which I found to be a great source of community, friendships, and professional development. Eventually, I landed a job with Lullabot as a trainer creating content for Drupalize.Me. Now, I'm managing the Drupalize.Me content pipeline, creating Drupal 8 content, and am very much involved in the Portland Drupal community. I'm this year's coordinator, finding and scheduling speakers. + +**We have to know: What is Arduino prototyping, how did you discover it, and what's the coolest thing you've done with an Arduino?** + +Arduino, Raspberry Pi, and wearable electronics have been these terms that I've heard thrown around for years. I found [Adafruit's Wearable Electronics][4] with Becky Stern YouTube show years ago (which, up until recently, when Becky moved on, aired every Wednesday). I was fascinated by wearables and even ordered an LED sewing kit but never did anything with it. I just didn't get it. I had no background in electronics whatsoever, and while I was fascinated by the projects I was finding, I didn't see how I could ever make anything like that. It seemed so out of reach. + +Finally, I found a Coursera "Internet of Things" specialization. (So trendy, right?) But I was immediately hooked! I finally got an explanation of what an Arduino was, along with all these other important terms and concepts. I ordered the recommended Arduino starter kit, which came with a getting started booklet. When I made that first LED blink, it was pure delight. I had two weeks' vacation over the holidays and after Christmas, and I did nothing but make and program Arduino circuits from the getting started booklet. It was oddly so relaxing! I enjoyed it so much. + +In January, I started creating my own prototypes. When I found out I was emceeing our company retreat's lightning talks, I created a Lightning Talk Visual Timer prototype with five LEDs and an Arduino. + +![](https://opensource.com/sites/default/files/resize/amber-arduino-lightning-talk-timer-400x400.jpg) + +It was a huge hit. I also made my first wearable project, a glowing hoodie, using the Arduino IDE compatible Gemma microcontroller, a tiny round sewable component, to which I sewed using conductive thread, a conductive slider connected to a hoodie's drawstring, which controlled the colors of five NeoPixels sewn around the inside of the hood. So that's what I mean by prototyping: Making crazy projects that are fun and maybe even a little practical. + +**What are the biggest opportunities for Drupal and IoT?** + +IoT isn't that much different than the web services and decoupling Drupal trends. It's the movement of data from thing one to thing two and the rendering of that data into something useful. But how does it get there? And what do you do with it? You think there are a lot of solutions, and apps, and frameworks, and APIs out there now? With IoT, that's only going to continue to increase—exponentially. What I've found is that given any device or any "thing", there is a way to connect it to the Internet—many ways. And there are plenty of code libraries out there to help makers get their data from thing one to thing two. + +So where does Drupal fit in? Web services, for one, is going to be the first obvious place. But as a maker, I don't want to spend my time coding custom modules in Drupal. I want to plug and play! So I would love to see modules emerge that connect with IoT Cloud APIs and services like ThingSpeak and Adafruit.io and IFTTT and others. I think there's an opportunity, too, for a business to build an IoT cloud service in Drupal that allows people to send and store their sensor data, visualize it charts and graphs, and build widgets that react to certain values or thresholds. Each of these IoT Cloud API services fill a slightly different niche, and there's plenty of room for others. + +**What are a few things you're looking forward to at DrupalCon?** + +I love reconnecting with Drupal friends, meeting new people, and also seeing Lullabot and Drupalize.Me co-workers (we're distributed companies)! There's so much to learn with Drupal 8 and it's been overwhelming at times to put together training materials for our customers. So, I'm looking forward to attending Drupal 8-related sessions and getting up-to-speed on the latest developments. Finally, I'm really curious about New Orleans! I haven't been there since 2004 and I'm excited to see what's changed. + +**Tell us about your DrupalCon talk Beyond the blink: Add Drupal to your IoT playground. Why should someone attend? What are the major takeaways?** + +My session title, Beyond the blink: Add Drupal to your IoT playground, in itself is so full of assumptions that first off I'm going to get everyone up to speed and on the same page. You don't need to know anything about Arduino, the Internet of Things, or even Drupal to follow along. We'll start with making an LED blink with an Arduino, and then I want to talk about what the main takeaways have been for me: Play, learn, teach, and make. I'll show examples that have inspired me and that will hopefully inspire and encourage others in the audience to give it a try. Then, it's demo time! + +First, thing one. Thing one is a Build Notifier Tower Light. In this demo, I'll show how I connected the Tower Light to the Internet and how I got it to respond to data received from a Cloud API service. Next, Thing two. Thing two is a "weather watch" in the form of a steampunk iPhone case. It's got small LED matrix that displays an icon of the local-to-me weather, a barometric pressure and temperature sensor, a GPS module, and a Bluetooth LE module, all connected and controlled with an Adafruit Flora microcontroller. Thing two sends weather and location data to Adafruit.io by connecting to an app on my iPhone over Bluetooth and sends it up to the cloud using an MQTT protocol! Then, on the Drupal side, I'm pulling down that data from the cloud, updating a block with the weather, and updating a map. So folks will get a taste of what you can do with web services, maps, and blocks in Drupal 8, too. + +It's been a brain-melting adventure learning and making these demo prototypes, and I hope others will come to the session and catch a little of this contagious enthusiasm I have for this intersection of technologies! I'm very excited to share what I've discovered. + + + +[1]: https://www.drupal.org/u/amber-himes-matz +[2]: https://drupalize.me/ +[3]: https://events.drupal.org/neworleans2016/ +[4]: https://www.adafruit.com/beckystern From 268194d76dd61c84886d9c79647512905169b815 Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 6 May 2016 11:45:30 +0800 Subject: [PATCH 0699/1469] =?UTF-8?q?20160506-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 开启 “我的开源路” 系列 --- .../20160429 Why and how I became a software engineer.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk/my-open-source-story}/20160429 Why and how I became a software engineer.md (100%) diff --git a/sources/tech/20160429 Why and how I became a software engineer.md b/sources/talk/my-open-source-story/20160429 Why and how I became a software engineer.md similarity index 100% rename from sources/tech/20160429 Why and how I became a software engineer.md rename to sources/talk/my-open-source-story/20160429 Why and how I became a software engineer.md From e8506bf62ab616d18895a4c40ae48224728294ae Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 6 May 2016 11:49:18 +0800 Subject: [PATCH 0700/1469] =?UTF-8?q?20160506-4=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Silicon Valley shares her 'nerd' story.md | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 sources/talk/my-open-source-story/20160505 A daughter of Silicon Valley shares her 'nerd' story.md diff --git a/sources/talk/my-open-source-story/20160505 A daughter of Silicon Valley shares her 'nerd' story.md b/sources/talk/my-open-source-story/20160505 A daughter of Silicon Valley shares her 'nerd' story.md new file mode 100644 index 0000000000..afb210298d --- /dev/null +++ b/sources/talk/my-open-source-story/20160505 A daughter of Silicon Valley shares her 'nerd' story.md @@ -0,0 +1,82 @@ +A daughter of Silicon Valley shares her 'nerd' story +======================================================= + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/myopensourcestory.png?itok=6TXlAkFi) + +Back in 2014, my colleague [Crystal Beasley][1] started a thread of women in tech/hackers posting their "nerd stories" in response to some comments out there on the Internet about the lack of women in tech. This is my nerd story, shared with you because I do believe in role models, and I do believe that there are many paths one can take to a satisfying challenging career and a life that helps one fulfill their goals. + +### Growing up with computers + +I am, among other things, a daughter of Silicon Valley. Mine is not a story of arriving at tech from the sidelines, or of dedication from childhood. It is more a story of how exposure shapes you—of the power of being marinated in a culture, if you will. This is not the story of a straight path or a clear dedication from childhood to one goal. It is a story of intense privilege, I am aware. + +I was born in Manhattan, but we lived in New Jersey while my dad was working on a PhD in computer science at Rutgers on the GI Bill. When I was four, someone at school asked me what my dad did for a living and I said, "He watches TV and hunts for bugs, but I never seen 'em." He had a dumb terminal at home, presumably for his job at Bolt Beranek Newman working on the artificial intelligence aspects of the early Internet. I was watching. + +I did not get to play with dad's bug hunting TV, but I was steeped in tech from an early age, and I value the gift of that early exposure. Early exposure is one of the things we must give to the future nerds—take time to talk to the kids you know about what you do! + +![](https://opensource.com/sites/default/files/resize/moss-520x433.png) + +>My dad's terminal was similar, if not identical, to this one. CC BY-SA 4.0 + +When I was six, we moved to California. Dad was taking a job at Xerox PARC. I remember thinking that the city would be full of bears, because there was a bear on the flag. In 1979, Palo Alto was a college town and still had orchards and open space. + +After a year of public school in Palo Alto, my sisters and I were sent to Peninsula School, a "democratic model" school that shaped me deeply. Curiosity and creativity were considered central curriculum values, and education was led substantively by group decisions of the students ourselves. We rarely saw anything one would call a computer at school, but home was another story. + +After his days at Xerox PARC, dad went to Apple, where he worked on and brought home the first computers I played with: the Apple II and the LISA. My dad was on the original LISA development team, and I vividly remember that he made us "play" the mousing tutorial over and over because he wanted my 3 year-old sister to be comfortable with it... and she was. + +![](https://opensource.com/sites/default/files/resize/600px-apple_lisa-520x520.jpg) + +>Our LISA computer pretty much looked like this. See the mouse? CC BY-SA 4.0 + +At the same time in school, while I was great at conceptual math, I floundered in basic computation. One teacher at my first school told my parents, and me, that I was bad at math and "stupid." While I excelled in our "regular" math program, understanding logical puzzles beyond what one expects of a 7 year-old, I could not successfully complete the math "drills" we had to do at the beginning of each day. She called me stupid, and I didn't forget it. I didn't get back to believing in my own logical and algorithmic mental capabilities for more than 10 years after that. Do not underestimate the power of the words you say to children. + +Years of playing with dad's computers followed. He went from Apple to EA to SGI, and I played with all his machines. This led to us having what we thought was the coolest house in town, because we had an SGI machine on which to play Doom in our garage. I didn't code much at all, but what I got from those years, I see now, was a measure of fearlessness about trying out new technologies. At the same time, my mom, whose background was literature and education, became a technical writer and showed me both that careers can change and that it is possible to manage a technical career and motherhood together. I would not say that was easy for her, but she made it look easy to me. You'd think that all of this early exposure might send me straight into a technical degree and career. It did not. + +### Undergrad years + +I thought I wanted to be an elementary school teacher, and I enrolled at Mills College with every intention of doing that. Instead, I moved toward women's studies and later theology, primarily driven by one of my great desires in life: to understand human motivation and work for a better world. + +At the same time, I was for the first time being exposed to the full power of the Internet. In 1991, it was a very heady thing to have your own unix shell account and a world of people to talk to. I learned a lot from just "playing" online, and more from having people around willing to answer my many questions. It turned out that these same explorations led me down my career path at least as much as any formal academic education. All information is useful. I do not think it is any accident that this critical period of learning and exposure happened at a women's college where a brilliant woman ran the CS department. We were not just allowed, but encouraged to explore many paths in that rarified atmosphere of empowerment (we had access to lots and lots of technology and to smart people who wanted to help), and I did. I've always been grateful for it. It was also where I learned about geek culture. + +I went to grad school to study feminist theology, but technology was in my blood by then. When I realized I didn't want to be a professor or an academic ethicist, I left academia and came home with a lot of school debt and not a lot of ideas. + +### A new beginning + +I was stunned, in 1995, at the power I saw in the World Wide Web to connect people and share thoughts and information (I still am). I wanted in on it. It occurred to me that I could go into the "family business," but not really how. I started working as a temporary contractor at offices in the valley and tried a few things (writing very basic databases on semiconductor data, pre-press work for technical manuals, filing payroll stubs) before I landed my first "real" tech job at Sun Microsystems. It was a very exciting place to be. (We were, after all, "the dot in dot-com.") + +At Sun, I stuck my neck out, trying as many new things as I could. I worked firsthand at HTMLing (What? It's a word!) white papers, then hacking basic surveying tools (Perl, mostly) for beta programs. Then I became a program manager for Solaris beta programs, and at last got my first whiff of open source in running beta programs for Open Solaris. + +The biggest thing I did was learn. I found it to be an atmosphere where engineering and education were both valued, and where my questions were not "stupid." I was lucky in my choices of mentors and friends. I took every class I could, read every book I could, and tried to give myself the technical, business, and project management skill sets I hadn't obtained in school before deciding to take the oft-discussed "mommy break" to prepare for the birth of my second child. + +### Getting back to work + +When I was ready to go back to work, Sun was no longer a viable place to go. So, I gathered my contacts (networking is your friend) and my consulting skills and ended up with a rather long-term contract release managing a web "portal" (in 2005, everything was a portal) and exposing myself to everything I could about CRMs, release methodology, localization, networking, and more. I explain all of this background mostly because my biggest lesson was that the education I got was in what I tried and in what I failed to do, as much as in what I succeeded at. I think we need role models for that, too. + +In many respects, the entire first part of my career was my technical education. It was a different time and place—I worked on supporting women and other underrepresented minorities in the organization, but it was not as overtly difficult to be a woman in tech then. I was undoubtedly blind to some issues at the time, but there's also a case to be made that our industry has become more misogynistic, not less. + +After all of this, I still did not see myself as a role model, or as highly technical. I was quite shocked when a geek friend I knew from parenting circles encouraged me to apply for a job as product manager at a very obscure seeming and highly technical nonprofit open source infrastructure shop (Internet Systems Consortium, makers of BIND, the widely deployed open source DNS nameserver, and operators of one of the 13 root nameservers). For the longest time, I couldn't figure out why they hired me! I knew very little about DNS, infrastructure, or protocol development, but I found my mentors again and flourished. I spent my time traveling, working on critical processes, figuring out how to work with highly international teams, solving hairy problems, and most of all, embracing open source and the vibrant community that loved and supported our efforts so very much. I learned most of all, again, by making mistakes. I learned what it takes to build a vision for a product, and how building things in the open and in community takes all sorts of specific skills, talent, and patience, but adds so much value. + +### Becoming a mentor + +It was while I was at ISC that, through the amazing [TechWomen program][2] (which brings technical women from the Middle East and North Africa to Silicon Valley for mentoring), I got hooked on mentoring and supporting other women in tech, particularly in open source and open culture. It was when I started mentoring that I started believing in my own abilities, too. That was a long lesson to learn. + +When I first read the advert for TechWomen mentors, I didn't think they would even want to talk to me! My impostor syndrome was so strong. I was so shocked when I was asked to mentor the first cohort (and every one after that for six years), but I am learning to believe that I earned these things. Impostor Syndrome is real, but over time it can be overcome. + +### Today + +In the end, I had to leave my job at ISC. Luckily, my work and my values brought me to Mozilla, where I've been both perseverant and lucky enough to have several meaningful roles. Today, I'm the senior program manager of diversity and inclusion. I work full-time on building a more diverse and inclusive Mozilla, standing on the shoulders of giants who did the same before me and in partnership with many of the smartest and kindest people I know. I've followed my passion for empowering people to find meaningful ways to contribute to the Internet I believe the world needs: an expansion of the one that excited me so long ago. And I get to see a lot of the world while I do it! + +Taking a new approach to changing culture through organizational and behavioral interventions is such an incredible way to connect my entire trajectory—from my early academics through my career to now. It's a new challenge every day, and I guess that's what I love most about working in tech and in particular on the open web. The very pluralistic nature of the web that first drew me in is the same possibility I still seek—a world where there is opportunity for all and where there are resources for people no matter their backgrounds. Role models, mentors, resources, and, above all, respect are essential components of evolving tech and open source culture to be all that I believe it can be—including access and opportunity for all of us. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/16/5/my-open-source-story-larissa-shapiro + +作者:[Larissa Shapiro][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/larissa-shapiro +[1]: http://skinnywhitegirl.com/blog/my-nerd-story/1101/ +[2]: https://www.techwomen.org/mentorship/why-i-keep-coming-back-to-mentor-with-techwomen From b92c14255c44c0ef0f161fe91dbfa2d4417693a2 Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 6 May 2016 12:41:09 +0800 Subject: [PATCH 0701/1469] translating by martin2011qi @martin2011qi --- .../20160429 Why and how I became a software engineer.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/talk/my-open-source-story/20160429 Why and how I became a software engineer.md b/sources/talk/my-open-source-story/20160429 Why and how I became a software engineer.md index 722464168f..0fb8b3d549 100644 --- a/sources/talk/my-open-source-story/20160429 Why and how I became a software engineer.md +++ b/sources/talk/my-open-source-story/20160429 Why and how I became a software engineer.md @@ -1,3 +1,5 @@ +translating by martin2011qi + Why and how I became a software engineer ========================================== From 636f491cba43d65ca19e3b53418735a691ec7d02 Mon Sep 17 00:00:00 2001 From: carolinewuyan <309866211@qq.com> Date: Fri, 6 May 2016 16:45:00 +0800 Subject: [PATCH 0702/1469] =?UTF-8?q?=E5=B7=B2=E6=A0=A1=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Raspberry Pi projects for the classroom.md | 31 +++++++++---------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/translated/tech/20151207 5 great Raspberry Pi projects for the classroom.md b/translated/tech/20151207 5 great Raspberry Pi projects for the classroom.md index 6c86172f7a..490708355d 100644 --- a/translated/tech/20151207 5 great Raspberry Pi projects for the classroom.md +++ b/translated/tech/20151207 5 great Raspberry Pi projects for the classroom.md @@ -8,9 +8,9 @@ ![](https://opensource.com/sites/default/files/lava.png) >Courtesy of the Raspberry Pi Foundation. [CC BY-SA 4.0][1]. -我的世界是世界上很多青少年最喜欢的一个游戏,而且他也是目前最能激发年轻人创造力的一款游戏。这个树莓派版上自带的我的世界不仅仅是一个具有创造性的建筑游戏,他还是一个具有编程接口、可以通过 Python 与之交互的版本。 +我的世界是世界上几乎每一个青少年都特别喜欢的一款游戏,而且它成功抓住了年轻人眼球,成为目前最能激发年轻人创造力的游戏之一。这个树莓派版本自带的我的世界不仅仅是一个具有创造性的建筑游戏,还是一个具有编程接口,可以通过 Python 与之交互的版本。 -我的世界:Pi 版对于老师来说是一个非常好的教授学生解决问题和编写代码完成任务的途径。你可以使用 Python API 创建一个房子,并且一直跟随这你的脚步移动,当你需要桥梁的时候给你建造一座桥,让老天呀下雨,显示天空的温度,以及其它你可以想象到的一切东西。 +我的世界:Pi 版对于老师来说是一个教授学生解决问题和编写代码完成任务的好方式。你可以使用 Python API 创建一个房子,并且一直跟随这你的脚步移动,在所到之处建造一座桥,让天空落下熔岩雨滴,在空中显示温度,以及其它你可以想象到的一切东西。 详情请见 "[Getting Started with Minecraft Pi][2]." @@ -19,24 +19,22 @@ ![](https://opensource.com/sites/default/files/pi_traffic_installed_yellow_led_on.jpg) >源于 [Low Voltage Labs][3]. [CC BY-SA 4.0][1]. -使用树莓派可以很轻松的进行物理计算——只需要连接几个 LED 和按钮到 开发板上的 GPIO 接口,再用几行代码你就可以按下按钮来开灯。一旦你指导了如何使用代码来做这些基本的东西,接下来就可以根据你的想象来做其它事情了。 +使用树莓派可以很轻松地进行物理计算,只需要连接几个 LED 和按钮到开发板上的 GPIO 接口,再用几行代码你就可以按下按钮来开灯。一旦你了解了如何使用代码来完成这些基本的操作,接下来就可以根据你的想象来做其它事情了。 -如果你知道如何让一个灯闪烁,你就可以让三个灯开始闪烁。挑选三个和交通灯一样颜色的 LED 灯,然后编写控制交通灯的代码。如果你知道如何使用按钮触发实践,那么你就可以模拟行人过马路。同时你可以参考其它已经完成的交通灯附件,比如[PI-TRAFFIC][4], [PI-STOP][5], [Traffic HAT][6],等等。 +如果你知道如何让一个灯闪烁,你就可以控制三个灯闪烁。挑选三个和交通灯一样颜色的 LED 灯,然后编写控制交通灯的代码。如果你知道如何使用按钮触发事件,那么你就可以模拟一个行人过马路。同时你可以参考其它已经完成的交通灯附件,比如[PI-TRAFFIC][4], [PI-STOP][5], [Traffic HAT][6],等等。 -代码并不是全部——这些联系只是让你理解真是世界里使如何完成这些事的。计算思维是一个在你一生中都会很有用的技能。 +代码并不是全部——这只是一个演练,让你理解现实世界里系统是如何完成设计的。计算思维是一个让你终身受用的技能。 ![](https://opensource.com/sites/default/files/reaction-game.png) >源于 Raspberry Pi 基金会. [CC BY-SA 4.0][1]. - -接下来试着接通两个按钮和 LED 灯的电源,实现一个反应游戏 —— 让 LED 灯随机的点亮,然后看是最先按下按钮。 - +接下来试着接通两个按钮和 LED 灯的电源,实现一个双玩家的反应游戏 —— 让 LED 灯随机时间点亮,然后看是谁抢先按下按钮。 要想了解更多可以看看 [GPIO Zero recipes][7]。你所需要的资料都可以在 [CamJam EduKit 1][8] 找到。 -### 3. 电子宠物 +### 3. Sense HAT 电子宠物 -Astro Pi —— 一个增强版的树莓派 —— 将在 12 月问世,但是你并没有错过亲手把玩这个硬件的机会。Sense HAT 是 Astro Pi 的一个传感器扩展板,现在已经开放购买了。你可以使用它来进行数据搜集,科学实验,游戏和其它很多事。可以看看下面树莓派的 Carrie Anne 拍摄的 Gurl Geek Diaries 的视频,里面演示了一种很棒的入门途径——给生活添加一个你自己创造的生动的像素宠物: +Astro Pi —— 一个增强版的树莓派 —— 将在 12 月问世,但是你并没有错过亲手把玩这个硬件的机会。Sense HAT 是使用在 Astro Pi 的一个传感器扩展板,现在已经开放购买了。你可以使用它来进行数据搜集、科学实验,游戏等等。可以看看下面树莓派的 Carrie Anne 拍摄的 Gurl Geek Diaries 的视频,里面演示了一种很棒的入门途径——在 Sense HAT 屏幕上自己设计一个生动的像素宠物: [video](https://youtu.be/gfRDFvEVz-w) @@ -47,9 +45,9 @@ Astro Pi —— 一个增强版的树莓派 —— 将在 12 月问世,但是 ![](https://opensource.com/sites/default/files/ir-bird-box.png) >源于 Raspberry Pi 基金会. [CC BY-SA 4.0][1]. -让整个班级都可以参与进来的好主意是在鸟笼立方一个树莓派和夜视镜头,以及一些红外线灯,这样子你就可以在黑暗中看见鸟笼里的情况了,然后使用树莓派通过网络串流视频。然后就可以等待小鸟归笼了,你可以在不干扰小鸟习惯的情况下观察他们了。 +让整个班级都可以参与进来的好主意是在鸟笼里放置一个树莓派和夜视镜头,以及一些红外线灯,这样子你就可以在黑暗中看见鸟笼里的情况了,然后使用树莓派通过网络串流视频。然后就可以等待小鸟归笼了,你可以在不打扰的情况下近距离观察小窝里的它们了。 -要了解更多有关红外线和光谱的知识,以及如何调校摄像头和使用软件控制摄像头,可以访问 [Make an infrared bird box][10]。 +要了解更多有关红外线和光谱的知识,以及如何校准摄像头焦点和使用软件控制摄像头,可以访问 [Make an infrared bird box][10]。 @@ -58,22 +56,21 @@ Astro Pi —— 一个增强版的树莓派 —— 将在 12 月问世,但是 ![](https://opensource.com/sites/default/files/edukit3_1500-alex-eames-sm.jpg) >源于 Raspberry Pi 基金会. [CC BY-SA 4.0][1]. -只需要一个树莓派和很少几个电机和电机控制器,你就可以制作一个你自己的机器人。你可以制作的机器人有很多种,从简单的由几个轮子和自制底盘拼凑小车,到由游戏控制器驱动的、具有自我意识、配备了传感器、装配了摄像头的金属种马。 +只需要一个树莓派、很少的几个电机和电机控制器,你就可以自己动手制作一个机器人。可以制作的机器人有很多种,从简单的由几个轮子和自制底盘拼凑的简单小车,到由游戏控制器驱动、具有自我意识、配备了传感器,安装了摄像头的金属种马。 -要学习如何控制不同的电机,可以使用 RTK 电机驱动开发板入门或者使用配置了电机、轮子和传感器的 CamJam 机器人开发套件——具有很大的价值和大量的学习潜力——深入学习。 +要学习如何控制不同的电机,可以使用 RTK 电机驱动开发板入门或者使用配置了电机、轮子和传感器的 CamJam 机器人开发套件——具有很大的价值和大量的学习潜力。 -或者,如果你还想了解更多核心内容,可以试试 PiBorg 的 [4Borg][11] 和 [DiddyBorg][12],或者购买 Metal 版 DoodleBorg ,然后构建一个最小版本的 [DoodleBorg tank][13]。 +或者,如果你还想了解更多核心内容,可以试试 PiBorg 的 [4Borg][11](£99/$150)和 [DiddyBorg][12](£180/$273),或者购买 Metal 版 DoodleBorg (£250/$380),然后构建一个最小版本的 [DoodleBorg tank][13](非卖品)。 详情可见 [机器人装备表][14]。 - ------------------------------------------------------------------------------ via: https://opensource.com/education/15/12/5-great-raspberry-pi-projects-classroom 作者:[Ben Nuttall][a] 译者:[ezio](https://github.com/oska874) -校对:[校对者ID](https://github.com/校对者ID) +校对:[Caroline](https://github.com/carolinewuyan) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 404762e335a82c1d98f941bf28cb8736f739ccec Mon Sep 17 00:00:00 2001 From: carolinewuyan <309866211@qq.com> Date: Fri, 6 May 2016 16:48:18 +0800 Subject: [PATCH 0703/1469] =?UTF-8?q?=E5=B7=B2=E6=A0=A1=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20151207 5 great Raspberry Pi projects for the classroom.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20151207 5 great Raspberry Pi projects for the classroom.md b/translated/tech/20151207 5 great Raspberry Pi projects for the classroom.md index 490708355d..5204511c1d 100644 --- a/translated/tech/20151207 5 great Raspberry Pi projects for the classroom.md +++ b/translated/tech/20151207 5 great Raspberry Pi projects for the classroom.md @@ -6,7 +6,7 @@ ### 1. 我的世界: Pi ![](https://opensource.com/sites/default/files/lava.png) ->Courtesy of the Raspberry Pi Foundation. [CC BY-SA 4.0][1]. +>源于 Raspberry Pi 基金会. [CC BY-SA 4.0][1]. 我的世界是世界上几乎每一个青少年都特别喜欢的一款游戏,而且它成功抓住了年轻人眼球,成为目前最能激发年轻人创造力的游戏之一。这个树莓派版本自带的我的世界不仅仅是一个具有创造性的建筑游戏,还是一个具有编程接口,可以通过 Python 与之交互的版本。 From bc37fb186a2b31d92f08817ce54231a55a7e5503 Mon Sep 17 00:00:00 2001 From: Name1e5s <836401406@qq.com> Date: Sat, 7 May 2016 18:03:12 +0800 Subject: [PATCH 0704/1469] Name1e5s translating... --- ...60505 A daughter of Silicon Valley shares her 'nerd' story.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/talk/my-open-source-story/20160505 A daughter of Silicon Valley shares her 'nerd' story.md b/sources/talk/my-open-source-story/20160505 A daughter of Silicon Valley shares her 'nerd' story.md index afb210298d..2ef0f680b0 100644 --- a/sources/talk/my-open-source-story/20160505 A daughter of Silicon Valley shares her 'nerd' story.md +++ b/sources/talk/my-open-source-story/20160505 A daughter of Silicon Valley shares her 'nerd' story.md @@ -1,3 +1,4 @@ +Name1e5s translating... A daughter of Silicon Valley shares her 'nerd' story ======================================================= From 2313cbf811230a018b470101ab219c5b055197fe Mon Sep 17 00:00:00 2001 From: sonofelice Date: Sat, 7 May 2016 18:21:50 +0800 Subject: [PATCH 0705/1469] =?UTF-8?q?sonofelice=20=E7=BF=BB=E8=AF=919=20Ke?= =?UTF-8?q?y=20Trends=20in=20Hybrid=20Cloud=20Computing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sonofelice 翻译9 Key Trends in Hybrid Cloud Computing --- sources/tech/20160218 9 Key Trends in Hybrid Cloud Computing.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160218 9 Key Trends in Hybrid Cloud Computing.md b/sources/tech/20160218 9 Key Trends in Hybrid Cloud Computing.md index 003405b4b7..4c6e74ed2d 100644 --- a/sources/tech/20160218 9 Key Trends in Hybrid Cloud Computing.md +++ b/sources/tech/20160218 9 Key Trends in Hybrid Cloud Computing.md @@ -1,3 +1,4 @@ +sonofelice translating 9 Key Trends in Hybrid Cloud Computing ======================================== From 08398858f2cfeec2c5dc815c4622e097f86b4c15 Mon Sep 17 00:00:00 2001 From: Purling Nayuki Date: Sun, 8 May 2016 01:06:36 +0800 Subject: [PATCH 0706/1469] Proofread 20151019 Gaming On Linux--All You Need To Know --- ...9 Gaming On Linux--All You Need To Know.md | 62 +++++++++---------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/translated/talk/20151019 Gaming On Linux--All You Need To Know.md b/translated/talk/20151019 Gaming On Linux--All You Need To Know.md index d43b548f7c..b58f822c72 100644 --- a/translated/talk/20151019 Gaming On Linux--All You Need To Know.md +++ b/translated/talk/20151019 Gaming On Linux--All You Need To Know.md @@ -4,27 +4,27 @@ Linux上的游戏:所有你需要知道的 ** 我能在 Linux 上玩游戏吗 ?** -这是打算[投奔 Linux 阵营][1]的人最经常问的问题之一。毕竟,在 Linux 上面玩游戏经常被认为有点难以实现。事实上,一些人甚至考虑他们能不能在 Linux 上看电影或者听音乐。考虑到这些,关于 Linux 的平台的游戏的问题是很现实的。「 +这是打算[投奔 Linux 阵营][1]的人最经常问的问题之一。毕竟,在 Linux 上面玩游戏经常被认为有点难以实现。事实上,一些人甚至考虑他们能不能在 Linux 上看电影或者听音乐。考虑到这些,关于 Linux 的平台的游戏的问题是很现实的。 -在本文中,我将解答大多数 Linux 新手关于在 Linux 打游戏的问题。例如 Linux 下能不能玩游戏,如果能的话,在**哪里下载游戏**或者如何获取有关游戏的信息。 +在本文中,我将解答大多数 Linux 新手关于在 Linux 中打游戏的问题。例如 Linux 下能不能玩游戏,如果能的话,在哪里**下载游戏**或者如何获取有关游戏的信息。 -但是在此之前,我需要说明一下。我不是一个 PC 上的玩家或者说我不认为我是一个在 Linux 桌面上完游玩戏的家伙。我更喜欢在 PS4 上玩游戏并且我不关心 PC 上的游戏甚至也不关心手机上的游戏(我没有给我的任何一个朋友安利糖果传奇)。这也就是你很少在 It's FOSS 上很少看见关于 [Linux 上的游戏][2]的部分。 +但是在此之前,我需要说明一下。我不是一个 PC 上的玩家或者说我不认为我是一个在 Linux 桌面游戏玩家。我更喜欢在 PS4 上玩游戏并且我不关心 PC 上的游戏甚至也不关心手机上的游戏(我没有给我的任何一个朋友安利糖果传奇)。这也就是你很少能在 It's FOSS 上很少看见关于 [Linux 上的游戏][2]的原因。 -所以我为什么要写这个主题? +所以我为什么要提到这个主题? -因为别人问过我几次有关 Linux 上的游戏的问题并且我想要写出来一个能解答这些问题的 Linux 上的游戏指南。注意,在这里我不只是讨论 Ubuntu 上的游戏。我讨论的是在所有的 Linux 上的游戏。 +因为别人问过我几次有关 Linux 上的游戏的问题并且我想要写出来一个能解答这些问题的 Linux 游戏指南。注意,在这里我不只是讨论在 Ubuntu 上玩游戏。我讨论的是在所有的 Linux 上的游戏。 ### 我能在 Linux 上玩游戏吗 ? ### 是,但不是完全是。 -“是”,是指你能在Linux上玩游戏;“不完全是”,是指你不能在 Linux 上玩 ’所有的游戏‘。 +“是”,是指你能在Linux上玩游戏;“不完全是”,是指你不能在 Linux 上玩 ‘所有的游戏’。 -什么?你是拒绝的?不必这样。我的意思是你能在 Linux 上玩很多流行的游戏,比如[反恐精英以及地铁:最后的曙光][3]等。但是你可能不能玩到所有在 Windows 上流行的最新游戏,比如[实况足球2015][4]。 +感到迷惑了吗?不必这样。我的意思是你能在 Linux 上玩很多流行的游戏,比如[反恐精英以及地铁:最后的曙光][3]等。但是你可能不能玩到所有在 Windows 上流行的最新游戏,比如[实况足球 2015 ][4]。 -在我看来,造成这种情况的原因是 Linux 在桌面系统中仅占不到 2%,这占比使得大多数开发者没有在 Linux 上发布他们的游戏的打算。 +在我看来,造成这种情况的原因是 Linux 在桌面系统中仅占不到 2%,这样的占比使得大多数开发者没有开发其游戏的 Linux 版的动力。 -这就意味指大多数近年来被提及的比较多的游戏很有可能不能在 Linux 上玩。不要灰心。我们能以某种方式在 Linux 上玩这些游戏,我们将在下面的章节中讨论这些方法。但是,在此之前,让我们看看在 Linux 上能玩的游戏的种类。 +这就意味指大多数近年来被提及的比较多的游戏很有可能不能在 Linux 上玩。不要灰心。还有别的方式在 Linux 上玩这些游戏,我们将在下面的章节中讨论这些方法。但是,在此之前,让我们看看在 Linux 上能玩的游戏的种类。 要我说的话,我会把那些游戏分为四类: @@ -33,7 +33,7 @@ Linux上的游戏:所有你需要知道的 3. 浏览器里的游戏 4. 终端里的游戏 -让我们以最重要的 Linux 的原生游戏开始。 +让我们以最重要的一类, Linux 的原生游戏开始。 --------- @@ -41,15 +41,15 @@ Linux上的游戏:所有你需要知道的 原生游戏指的是官方支持 Linux 的游戏。这些游戏有原生的 Linux 客户端并且能像在 Linux 上的其他软件一样不需要附加的步骤就能安装在 Linux 上面(我们将在下一节讨论)。 -所以,如你所见,这里有一些为 Linux 开发的游戏,下一个问题就是在哪能找到这些游戏以及如何安装。我将列出来一些让你玩到游戏的渠道了。 +所以,如你所见,有一些为 Linux 开发的游戏,下一个问题就是在哪能找到这些游戏以及如何安装。我将列出一些让你玩到游戏的渠道。 #### Steam #### ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/09/Install-Steam-Ubuntu-11.jpeg) -“[Steam][5] 是一个游戏的分发平台。就如同 Kindle 是电子书的分发平台,iTunes 是音乐的分发平台一样,Steam 也具有那样的功能。它给了你购买和安装游戏,玩多人游戏以及在它的平台上关注其他游戏的选项。这些游戏被[ DRM ][6]所保护。” +“[Steam][5] 是一个游戏的分发平台。就如同 Kindle 是电子书的分发平台, iTunes 是音乐的分发平台一样, Steam 也具有那样的功能。它提供购买和安装游戏,玩多人游戏以及在它的平台上关注其他游戏的选项。其上的游戏被[ DRM ][6]所保护。” -两年以前,游戏平台 Steam 宣布支持 Linux,这在当时是一个大新闻。这是 Linux 上玩游戏被严肃的对待的一个迹象。尽管这个决定更多地影响了他们自己的基于 Linux 游戏平台[ Steam OS][7]。这仍然是令人欣慰的事情,因为它给 Linux 带来了一大堆游戏。 +两年以前,游戏平台 Steam 宣布支持 Linux ,这在当时是一个大新闻。这是 Linux 上玩游戏被严肃对待的一个迹象。尽管这个决定更多地影响了他们自己的基于 Linux 游戏平台以及一个独立 Linux 发行版[ Steam OS][7] ,这仍然是令人欣慰的事情,因为它给 Linux 带来了一大堆游戏。 我已经写了一篇详细的关于安装以及使用 Steam 的文章。如果你想开始使用 Steam 的话,读读那篇文章。 @@ -57,23 +57,23 @@ Linux上的游戏:所有你需要知道的 #### GOG.com #### -[GOG.com][9] 失灵一个与 Steam 类似的平台。与 Steam 一样,你能在这上面找到数以百计的 Linux 游戏,你可以购买和安装它们。如果游戏支持好几个平台,尼卡一在多个操作系统上安装他们。你买到你账户的游戏你可以随时玩。捏可以在你想要下载的任何时间下载。 +[GOG.com][9] 是另一个与 Steam 类似的平台。与 Steam 一样,你能在这上面找到数以百计的 Linux 游戏,并购买和安装它们。如果游戏支持好几个平台,你可以在多个操作系统上安装他们。你可以随时游玩使用你的账户购买的游戏。你也可以在任何时间下载。 GOG.com 与 Steam 不同的是前者仅提供没有 DRM 保护的游戏以及电影。而且,GOG.com 完全是基于网页的,所以你不需要安装类似 Steam 的客户端。你只需要用浏览器下载游戏然后安装到你的系统上。 #### Portable Linux Games #### -[Portable Linux Games][10] 是一个集聚了不少 Linux 游戏的网站。这家网站最特别以及最好的就是你能离线安装这些游戏。 +[Portable Linux Games][10] 是一个集聚了不少 Linux 游戏的网站。这家网站最特别以及最好的点就是你能离线安装这些游戏。 -你下载到的文件包含所有的依赖(仅需 Wine 以及 Perl)并且他们也是与平台无关的。你所需要的仅仅是下载文件并且双击来启动安装程序。你也可以把文件储存起来以用于将来的安装,如果你网速不够快的话我很推荐您这样做。 +你下载到的文件包含所有的依赖(仅需 Wine 以及 Perl)并且他们也是与平台无关的。你所需要的仅仅是下载文件并且双击来启动安装程序。你也可以把文件储存起来以用于将来的安装。如果你网速不够快的话,我很推荐你这样做。 #### Game Drift 游戏商店 #### -[Game Drift][11] 是一个只专注于游戏的基于 Ubuntu 的 Linux 发行版。但是如果你不想只为游戏就去安装这个发行版的话,你也可以经常上线看哪个游戏可以在 Linux 上运行并且安装他们。 +[Game Drift][11] 是一个只专注于游戏的基于 Ubuntu 的 Linux 发行版。但是如果你不想只为游戏就去安装这个发行版的话,你也可以经常去它的在线游戏商店去看哪个游戏可以在 Linux 上运行并且安装他们。 #### Linux Game Database #### -如其名字所示,[Linux Game Database][12]是一个收集了很多 Linux 游戏的网站。你能在这里浏览诸多类型的游戏并从游戏开发者的网站下载/安装这些游戏。作为这家网站的会员,你甚至可以为游戏打分。LGDB,有点像 Linux 游戏界的 IMDB 或者 IGN. +如其名字所示,[Linux Game Database][12]是一个收集了很多 Linux 游戏的网站。你能在这里浏览诸多类型的游戏并从游戏开发者的网站下载/安装这些游戏。作为这家网站的会员,你甚至可以为游戏打分。 LGDB 有点像 Linux 游戏界的 IMDB 或者 IGN. #### Penguspy #### @@ -81,7 +81,7 @@ GOG.com 与 Steam 不同的是前者仅提供没有 DRM 保护的游戏以及电 #### 软件源 #### -看看你自己的发行版的软件源。那里可能有一些游戏。如果你用 Ubuntu 的话,它的软件中心里有一个游戏的分类。在一些其他的发行版里也有,比如 Liux Mint 等。 +看看你自己的发行版的软件源。其中可能有一些游戏。如果你用 Ubuntu 的话,它的软件中心里有一个游戏的分类。在一些其他的发行版里也有,比如 Linux Mint 等。 ---------- @@ -89,19 +89,19 @@ GOG.com 与 Steam 不同的是前者仅提供没有 DRM 保护的游戏以及电 ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/10/Wine-Linux.png) -到现在为止,我们一直在讨论 Linux 的原生游戏。但是并没有很多 Linux 上的原生游戏,或者说,火的不要不要的游戏大多不支持 Linux,但是都支持 Windows PC。所以,如何在 Linux 上玩 Wendows 的游戏? +到现在为止,我们一直在讨论 Linux 的原生游戏。但是并没有很多 Linux 上的原生游戏,或者更准确地说,火的不要不要的游戏大多不支持 Linux,但是都支持 Windows PC 。所以,如何在 Linux 上玩 Windows 的游戏? -幸好,由于我们有 Wine, PlayOnLinux 和 CrossOver 等工具,我们能在 Linux 上玩不少的 Wendows 游戏。 +幸好,由于我们有 Wine 、 PlayOnLinux 和 CrossOver 等工具,我们能在 Linux 上玩不少的 Windows 游戏。 #### Wine #### -Wine 是一个能使 Wendows 应用在类似 Linux, BSD 和 OS X 上运行的兼容层。在 Wine 的帮助下,你可以在 Linux 下安装以及使用很多 Windows 下的应用。 +Wine 是一个能使 Windows 应用在类似 Linux , BSD 和 OS X 上运行的兼容层。在 Wine 的帮助下,你可以在 Linux 下安装以及使用很多 Windows 下的应用。 [在 Ubuntu 上安装 Wine][14]或者在其他 Linux 上安装 Wine 是很简单的,因为大多数发行版的软件源里都有它。这里也有一个很大的[ Wine 支持的应用的数据库][15]供您浏览。 #### CrossOver #### -[CrossOver][16] 是 Wine 的增强版,它给 Wine 提供了专业的技术上的支持。但是与 Wine 不同, CrossOver 不是免费的。你需要购买许可。好消息是它会把更新也贡献到 Wine 的开发者那里并且事实上加速了 Wine 的开发使得 Wine 能支持更多的 Windows 上的游戏和应用。如果你可以一年支付 48 美元,你可以购买 CrossOver 并得到他们提供的技术支持。 +[CrossOver][16] 是 Wine 的增强版,它给 Wine 提供了专业的技术上的支持。但是与 Wine 不同, CrossOver 不是免费的。你需要购买许可。好消息是它会把更新也贡献到 Wine 的开发者那里并且事实上加速了 Wine 的开发使得 Wine 能支持更多的 Windows 上的游戏和应用。如果你可以接受每年支付 48 美元,你可以购买 CrossOver 并得到他们提供的技术支持。 ### PlayOnLinux ### @@ -113,9 +113,9 @@ PlayOnLinux 也基于 Wine 但是执行程序的方式略有不同。它有着 ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/10/Chrome-Web-Store.jpeg) -不必说你也应该知道有非常多的基于网页的游戏,这些游戏都可以在任何操作系统里运行,无论是 Windows,Linux,还是 OS X。大多数让人上瘾的手机游戏,比如[帝国之战][18]就有官方的网页版。 +不必说你也应该知道有非常多的基于网页的游戏,这些游戏都可以在任何操作系统里运行,无论是 Windows ,Linux ,还是 OS X 。大多数让人上瘾的手机游戏,比如[帝国之战][18]就有官方的网页版。 -除了这些,还有 [Google Chrome在线商店][19],你可以在 Linux 上玩更多的这些游戏。这些 Chrome 上的游戏可以像一个单独的应用一样安装并从应用菜单中打开,一些游戏就算是离线也能运行。 +除了这些,还有 [Google Chrome 在线商店][19],你可以在 Linux 上玩更多的这些游戏。这些 Chrome 上的游戏可以像一个单独的应用一样安装并从应用菜单中打开,一些游戏就算是离线也能运行。 ---------- @@ -123,7 +123,7 @@ PlayOnLinux 也基于 Wine 但是执行程序的方式略有不同。它有着 ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/03/nSnake_Linux_terminal_game.jpeg) -使用 Linux 的一个附加优势就是可以使用命令行终端玩游戏。我知道这不是最好的玩游戏的 方法,但是在终端里玩[贪吃蛇][20]或者 [2048][21] 很有趣。在[这个博客][21]中有一些好玩的的终端游戏。你可以浏览并安装你喜欢的游戏。 +使用 Linux 的一个附加优势就是可以使用命令行终端玩游戏。我知道这不是最好的玩游戏的方法,但是在终端里玩[贪吃蛇][20]或者 [2048][21] 很有趣。在[这个博客][21]中有一些好玩的的终端游戏。你可以浏览并安装你喜欢的游戏。 ---------- @@ -131,21 +131,21 @@ PlayOnLinux 也基于 Wine 但是执行程序的方式略有不同。它有着 当你了解了不少的在 Linux 上你可以玩到的游戏以及你如何使用他们,下一个问题就是如何保持游戏的版本是最新的。对于这件事,我建议你看看下面的博客,这些博客能告诉你 Linux 游戏世界的最新消息: -- [Gaming on Linux][23]:我认为我把它叫做 Linux 游戏的门户并没有错误。在这你可以得到关于 Linux 的游戏的最新的传言以及新闻。最近, Gaming on Linux 有了一个由 Linux 游戏爱好者组成的漂亮的社区。 +- [Gaming on Linux][23]:我认为我把它叫做 Linux 游戏专业门户并没有错误。在这你可以得到关于 Linux 的游戏的最新的传言以及新闻。它经常更新, 还有由 Linux 游戏爱好者组成的优秀社区。 - [Free Gamer][24]:一个专注于免费开源的游戏的博客。 - [Linux Game News][25]:一个提供很多的 Linux 游戏的升级的 Tumbler 博客。 #### 还有别的要说的吗? #### -我认为让你知道如何开始在 Linux 上的游戏人生是一个好事。如果你仍然不能被说服。我推荐你做个[双系统][26],把 Linux 作为你的主要桌面系统,当你想玩游戏时,重启到 Windows。这是一个对游戏妥协的解决办法。 +我认为让你知道如何开始在 Linux 上的游戏人生是一个好事。如果你仍然不能被说服,我推荐你做个[双系统][26],把 Linux 作为你的主要桌面系统,当你想玩游戏时,重启到 Windows。这是一个对游戏妥协的解决办法。 -现在,这里是你说出你自己的状况的时候了。你在 Linux 上玩游戏吗?你最喜欢什么游戏?你关注了哪些游戏博客? +现在,这里是你说出你自己的想法的时候了。你在 Linux 上玩游戏吗?你最喜欢什么游戏?你关注了哪些游戏博客? 投票项目: 你怎样在 Linux 上玩游戏? -- 我玩原生 Linux 游戏,我也用 Wine 以及 PlayOnLinux 运行 Windows 游戏 +- 我玩原生 Linux 游戏,也用 Wine 以及 PlayOnLinux 运行 Windows 游戏 - 我喜欢网页游戏 - 我喜欢终端游戏 - 我只玩原生 Linux 游戏 @@ -167,7 +167,7 @@ via: http://itsfoss.com/linux-gaming-guide/ 作者:[Abhishek][a] 译者:[name1e5s](https://github.com/name1e5s) -校对:[校对者ID](https://github.com/校对者ID) +校对:[PurlingNayuki](https://github.com/PurlingNayuki) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 3ef908138d5ddb3497d022c3c047219a14ebf7e8 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 8 May 2016 08:29:31 +0800 Subject: [PATCH 0707/1469] =?UTF-8?q?20160508-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...action-packed experience with Wikipedia.md | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 sources/talk/my-open-source-story/20160415 A four year, action-packed experience with Wikipedia.md diff --git a/sources/talk/my-open-source-story/20160415 A four year, action-packed experience with Wikipedia.md b/sources/talk/my-open-source-story/20160415 A four year, action-packed experience with Wikipedia.md new file mode 100644 index 0000000000..c40a7dafa3 --- /dev/null +++ b/sources/talk/my-open-source-story/20160415 A four year, action-packed experience with Wikipedia.md @@ -0,0 +1,74 @@ +A four year, action-packed experience with Wikipedia +======================================================= + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/wikipedia_checkuser_lead.jpg?itok=4lVDjSSM) + + +I consider myself to be an Odia Wikimedian. I contribute [Odia][1] knowledge (the predominant language of the Indian state of [Odisha][2]) to many Wikimedia projects, like Wikipedia and Wikisource, by writing articles and correcting mistakes in articles. I also contribute to Hindi and English Wikipedia articles. + +![](https://opensource.com/sites/default/files/resize/1st_day_at_odia_wikipedia_workshop_image_source_facebook-200x133.jpg) + +My love for Wikimedia started while I was reading an article about the [Bangladesh Liberation war][3] on the English Wikipedia after my 10th board exam (like, an annual exam for 10th grade students in America). By mistake I clicked on a link that took me to an India Wikipedia article, and I started reading. Something was written in Odia on the lefthand side of the article, so I clicked on that, and reached a [ଭାରତ/Bhārat][4] article on the Odia Wikipedia. I was excited to find a Wikipedia article in my native language! + +![](https://opensource.com/sites/default/files/resize/introducing_wikipedia_at_google_io_image_by_gdg_bhubaneswar-251x166.png) + +A banner inviting readers to be part of the 2nd Bhubaneswar workshop on April 1, 2012 sparked my curiousity. I had never contributed to Wikipedia before, only used it for research, and I wasn't familiar with open source and the community contribution process. Plus, I was only 15 years old. I registered. There were many language enthusiasts at the workshop, and all older than me. My father encouraged me to the participate despite my fear; he has played an important role—he's not a Wikimedian, like me, but his encouragement has helped me change Odia Wikipedia and participate in community activities. + +I believe that knowledge about Odia language and literature needs to improve—there are many misconceptions and knowledge gaps—so, I help organize events and workshops for Odia Wikipedia. On my accomplished list at the point, I have: + +* initiated three major edit-a-thons in Odia Wikipedia: Women's Day 2015, Women's Day 2016, abd [Nabakalebara edit-a-thon 2015][5] +* initiated a photograph contest to get more [Rathyatra][6] images from all over the India +* represented Odia Wikipedia during two events by Google ([Google I/O extended][7] and Google Dev Fest) +* spoke at [Perception][8] 2015 and the first [Open Access India][9] meetup + +![](https://opensource.com/sites/default/files/resize/bengali_wikipedia_10th_anniversary_cc-by-sa4.0_biswaroop_ganguly-251x166.jpg) + +I was just an editor to Wikipedia projects until last year, in January 2015, when I attended [Bengali Wikipedia's 10th anniversary conference][10] and [Vishnu][11], the director of the [Center for Internet and Society][12] at the time, invited me to attend the [Train the Trainer][13] Program. I was inspired to start doing outreach for Odia Wikipedia and hosting meetups for [GLAM]14] activities and training new Wikimedians. These experience taught me how to work with a community of contributors. + +[Ravi][15], the director of Wikimedia India at the time, also played an important role in my journey. He trusted me and made me a part of [Wiki Loves Food][16], a public photo competition on Wikimedia Commons, and the organizing committee of [Wikiconference India 2016][17]. During Wiki Loves Food 2015, my team helped add 10,000+ CC BY-SA images on Wikimedia Commons. Ravi further solidified my commitment by sharing a lot of information with me about the Wikimedia movement, and his own journey, during [Odia Wikipedia's 13th anniversary][18]. + +Less than a year later, in December 2015, I became a Program Associate at the Center for Internet and Society's [Access to Knowledge program][19] (CIS-A2K). One of my proud moments was at a workshop in Puri, India where we helped bring 20 new Wikimedian editors to the Odia Wikimedia community. Now, I mentor Wikimedians during an informal meetup called [WikiTungi][20] Puri. I am working with this group to make Odia Wikiquotes a live project. I am also dedicated to bridging the gender gap in Odia Wikipedia. [Eight female editors][21] are now helping to organize meetups and workshops, and participate in the [Women's History month edit-a-thon][22]. + +During my brief but action-packed journey during the four years since, I have also been involved in the [Wikipedia Education Program][23], the [newsletter team][24], and two global edit-a-thons: [Art and Feminsim][25] and [Menu Challenge][26]. I look forward to the many more to come! + +I would also like to thank [Sameer][27] and [Anna][28] (both previous members of the Wikipedia Education Program). + +------------------------------------------------------------------------------ + +via: https://opensource.com/life/16/4/my-open-source-story-gloria-bwandungi + +作者:[Sailesh Patnaik][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/saileshpat +[1]: https://en.wikipedia.org/wiki/Odia_language +[2]: https://en.wikipedia.org/wiki/Odisha +[3]: https://en.wikipedia.org/wiki/Bangladesh_Liberation_War +[4]: https://or.wikipedia.org/s/d2 +[5]: https://or.wikipedia.org/s/toq +[6]: https://commons.wikimedia.org/wiki/Commons:The_Rathyatra_Challenge +[7]: http://cis-india.org/openness/blog-old/odia-wikipedia-meets-google-developer-group +[8]: http://perception.cetb.in/events/odia-wikipedia-event/ +[9]: https://opencon2015kolkata.sched.org/speaker/sailesh.patnaik007 +[10]: https://meta.wikimedia.org/wiki/Bengali_Wikipedia_10th_Anniversary_Celebration_Kolkata +[11]: https://www.facebook.com/vishnu.vardhan.50746?fref=ts +[12]: http://cis-india.org/ +[13]: https://meta.wikimedia.org/wiki/CIS-A2K/Events/Train_the_Trainer_Program/2015 +[14]: https://en.wikipedia.org/wiki/Wikipedia:GLAM +[15]: https://www.facebook.com/ravidreams?fref=ts +[16]: https://commons.wikimedia.org/wiki/Commons:Wiki_Loves_Food +[17]: https://meta.wikimedia.org/wiki/WikiConference_India_2016 +[18]: https://or.wikipedia.org/s/sml +[19]: https://meta.wikimedia.org/wiki/CIS-A2K +[20]: https://or.wikipedia.org/s/xgx +[21]: https://or.wikipedia.org/s/ysg +[22]: https://or.wikipedia.org/s/ynj +[23]: https://outreach.wikimedia.org/wiki/Education +[24]: https://outreach.wikimedia.org/wiki/Talk:Education/News#Call_for_volunteers +[25]: https://en.wikipedia.org/wiki/User_talk:Saileshpat#Barnstar_for_Art_.26_Feminism_Challenge +[26]: https://opensource.com/life/15/11/tasty-translations-the-open-source-way +[27]: https://www.facebook.com/samirsharbaty?fref=ts +[28]: https://www.facebook.com/anna.koval.737?fref=ts From 1da9cd9bc2403cd394fd4403e1f6204e22a9c0ac Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 8 May 2016 08:30:37 +0800 Subject: [PATCH 0708/1469] =?UTF-8?q?20160508-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0415 A four year, action-packed experience with Wikipedia.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/my-open-source-story/20160415 A four year, action-packed experience with Wikipedia.md b/sources/talk/my-open-source-story/20160415 A four year, action-packed experience with Wikipedia.md index c40a7dafa3..9c45c209e9 100644 --- a/sources/talk/my-open-source-story/20160415 A four year, action-packed experience with Wikipedia.md +++ b/sources/talk/my-open-source-story/20160415 A four year, action-packed experience with Wikipedia.md @@ -35,7 +35,7 @@ I would also like to thank [Sameer][27] and [Anna][28] (both previous members of ------------------------------------------------------------------------------ -via: https://opensource.com/life/16/4/my-open-source-story-gloria-bwandungi +via: https://opensource.com/life/16/4/my-open-source-story-sailesh-patnaik 作者:[Sailesh Patnaik][a] 译者:[译者ID](https://github.com/译者ID) From 424b0a635ee82bfbd76d5383de9d927c0bc5eedb Mon Sep 17 00:00:00 2001 From: Name1e5s <836401406@qq.com> Date: Sun, 8 May 2016 13:06:22 +0800 Subject: [PATCH 0709/1469] [Translated]20160505 A daughter of Silicon Valley shares her 'nerd' story --- ... Silicon Valley shares her 'nerd' story.md | 83 ------------------- ... Silicon Valley shares her 'nerd' story.md | 82 ++++++++++++++++++ 2 files changed, 82 insertions(+), 83 deletions(-) delete mode 100644 sources/talk/my-open-source-story/20160505 A daughter of Silicon Valley shares her 'nerd' story.md create mode 100644 translated/talk/my-open-source-story/20160505 A daughter of Silicon Valley shares her 'nerd' story.md diff --git a/sources/talk/my-open-source-story/20160505 A daughter of Silicon Valley shares her 'nerd' story.md b/sources/talk/my-open-source-story/20160505 A daughter of Silicon Valley shares her 'nerd' story.md deleted file mode 100644 index 2ef0f680b0..0000000000 --- a/sources/talk/my-open-source-story/20160505 A daughter of Silicon Valley shares her 'nerd' story.md +++ /dev/null @@ -1,83 +0,0 @@ -Name1e5s translating... -A daughter of Silicon Valley shares her 'nerd' story -======================================================= - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/myopensourcestory.png?itok=6TXlAkFi) - -Back in 2014, my colleague [Crystal Beasley][1] started a thread of women in tech/hackers posting their "nerd stories" in response to some comments out there on the Internet about the lack of women in tech. This is my nerd story, shared with you because I do believe in role models, and I do believe that there are many paths one can take to a satisfying challenging career and a life that helps one fulfill their goals. - -### Growing up with computers - -I am, among other things, a daughter of Silicon Valley. Mine is not a story of arriving at tech from the sidelines, or of dedication from childhood. It is more a story of how exposure shapes you—of the power of being marinated in a culture, if you will. This is not the story of a straight path or a clear dedication from childhood to one goal. It is a story of intense privilege, I am aware. - -I was born in Manhattan, but we lived in New Jersey while my dad was working on a PhD in computer science at Rutgers on the GI Bill. When I was four, someone at school asked me what my dad did for a living and I said, "He watches TV and hunts for bugs, but I never seen 'em." He had a dumb terminal at home, presumably for his job at Bolt Beranek Newman working on the artificial intelligence aspects of the early Internet. I was watching. - -I did not get to play with dad's bug hunting TV, but I was steeped in tech from an early age, and I value the gift of that early exposure. Early exposure is one of the things we must give to the future nerds—take time to talk to the kids you know about what you do! - -![](https://opensource.com/sites/default/files/resize/moss-520x433.png) - ->My dad's terminal was similar, if not identical, to this one. CC BY-SA 4.0 - -When I was six, we moved to California. Dad was taking a job at Xerox PARC. I remember thinking that the city would be full of bears, because there was a bear on the flag. In 1979, Palo Alto was a college town and still had orchards and open space. - -After a year of public school in Palo Alto, my sisters and I were sent to Peninsula School, a "democratic model" school that shaped me deeply. Curiosity and creativity were considered central curriculum values, and education was led substantively by group decisions of the students ourselves. We rarely saw anything one would call a computer at school, but home was another story. - -After his days at Xerox PARC, dad went to Apple, where he worked on and brought home the first computers I played with: the Apple II and the LISA. My dad was on the original LISA development team, and I vividly remember that he made us "play" the mousing tutorial over and over because he wanted my 3 year-old sister to be comfortable with it... and she was. - -![](https://opensource.com/sites/default/files/resize/600px-apple_lisa-520x520.jpg) - ->Our LISA computer pretty much looked like this. See the mouse? CC BY-SA 4.0 - -At the same time in school, while I was great at conceptual math, I floundered in basic computation. One teacher at my first school told my parents, and me, that I was bad at math and "stupid." While I excelled in our "regular" math program, understanding logical puzzles beyond what one expects of a 7 year-old, I could not successfully complete the math "drills" we had to do at the beginning of each day. She called me stupid, and I didn't forget it. I didn't get back to believing in my own logical and algorithmic mental capabilities for more than 10 years after that. Do not underestimate the power of the words you say to children. - -Years of playing with dad's computers followed. He went from Apple to EA to SGI, and I played with all his machines. This led to us having what we thought was the coolest house in town, because we had an SGI machine on which to play Doom in our garage. I didn't code much at all, but what I got from those years, I see now, was a measure of fearlessness about trying out new technologies. At the same time, my mom, whose background was literature and education, became a technical writer and showed me both that careers can change and that it is possible to manage a technical career and motherhood together. I would not say that was easy for her, but she made it look easy to me. You'd think that all of this early exposure might send me straight into a technical degree and career. It did not. - -### Undergrad years - -I thought I wanted to be an elementary school teacher, and I enrolled at Mills College with every intention of doing that. Instead, I moved toward women's studies and later theology, primarily driven by one of my great desires in life: to understand human motivation and work for a better world. - -At the same time, I was for the first time being exposed to the full power of the Internet. In 1991, it was a very heady thing to have your own unix shell account and a world of people to talk to. I learned a lot from just "playing" online, and more from having people around willing to answer my many questions. It turned out that these same explorations led me down my career path at least as much as any formal academic education. All information is useful. I do not think it is any accident that this critical period of learning and exposure happened at a women's college where a brilliant woman ran the CS department. We were not just allowed, but encouraged to explore many paths in that rarified atmosphere of empowerment (we had access to lots and lots of technology and to smart people who wanted to help), and I did. I've always been grateful for it. It was also where I learned about geek culture. - -I went to grad school to study feminist theology, but technology was in my blood by then. When I realized I didn't want to be a professor or an academic ethicist, I left academia and came home with a lot of school debt and not a lot of ideas. - -### A new beginning - -I was stunned, in 1995, at the power I saw in the World Wide Web to connect people and share thoughts and information (I still am). I wanted in on it. It occurred to me that I could go into the "family business," but not really how. I started working as a temporary contractor at offices in the valley and tried a few things (writing very basic databases on semiconductor data, pre-press work for technical manuals, filing payroll stubs) before I landed my first "real" tech job at Sun Microsystems. It was a very exciting place to be. (We were, after all, "the dot in dot-com.") - -At Sun, I stuck my neck out, trying as many new things as I could. I worked firsthand at HTMLing (What? It's a word!) white papers, then hacking basic surveying tools (Perl, mostly) for beta programs. Then I became a program manager for Solaris beta programs, and at last got my first whiff of open source in running beta programs for Open Solaris. - -The biggest thing I did was learn. I found it to be an atmosphere where engineering and education were both valued, and where my questions were not "stupid." I was lucky in my choices of mentors and friends. I took every class I could, read every book I could, and tried to give myself the technical, business, and project management skill sets I hadn't obtained in school before deciding to take the oft-discussed "mommy break" to prepare for the birth of my second child. - -### Getting back to work - -When I was ready to go back to work, Sun was no longer a viable place to go. So, I gathered my contacts (networking is your friend) and my consulting skills and ended up with a rather long-term contract release managing a web "portal" (in 2005, everything was a portal) and exposing myself to everything I could about CRMs, release methodology, localization, networking, and more. I explain all of this background mostly because my biggest lesson was that the education I got was in what I tried and in what I failed to do, as much as in what I succeeded at. I think we need role models for that, too. - -In many respects, the entire first part of my career was my technical education. It was a different time and place—I worked on supporting women and other underrepresented minorities in the organization, but it was not as overtly difficult to be a woman in tech then. I was undoubtedly blind to some issues at the time, but there's also a case to be made that our industry has become more misogynistic, not less. - -After all of this, I still did not see myself as a role model, or as highly technical. I was quite shocked when a geek friend I knew from parenting circles encouraged me to apply for a job as product manager at a very obscure seeming and highly technical nonprofit open source infrastructure shop (Internet Systems Consortium, makers of BIND, the widely deployed open source DNS nameserver, and operators of one of the 13 root nameservers). For the longest time, I couldn't figure out why they hired me! I knew very little about DNS, infrastructure, or protocol development, but I found my mentors again and flourished. I spent my time traveling, working on critical processes, figuring out how to work with highly international teams, solving hairy problems, and most of all, embracing open source and the vibrant community that loved and supported our efforts so very much. I learned most of all, again, by making mistakes. I learned what it takes to build a vision for a product, and how building things in the open and in community takes all sorts of specific skills, talent, and patience, but adds so much value. - -### Becoming a mentor - -It was while I was at ISC that, through the amazing [TechWomen program][2] (which brings technical women from the Middle East and North Africa to Silicon Valley for mentoring), I got hooked on mentoring and supporting other women in tech, particularly in open source and open culture. It was when I started mentoring that I started believing in my own abilities, too. That was a long lesson to learn. - -When I first read the advert for TechWomen mentors, I didn't think they would even want to talk to me! My impostor syndrome was so strong. I was so shocked when I was asked to mentor the first cohort (and every one after that for six years), but I am learning to believe that I earned these things. Impostor Syndrome is real, but over time it can be overcome. - -### Today - -In the end, I had to leave my job at ISC. Luckily, my work and my values brought me to Mozilla, where I've been both perseverant and lucky enough to have several meaningful roles. Today, I'm the senior program manager of diversity and inclusion. I work full-time on building a more diverse and inclusive Mozilla, standing on the shoulders of giants who did the same before me and in partnership with many of the smartest and kindest people I know. I've followed my passion for empowering people to find meaningful ways to contribute to the Internet I believe the world needs: an expansion of the one that excited me so long ago. And I get to see a lot of the world while I do it! - -Taking a new approach to changing culture through organizational and behavioral interventions is such an incredible way to connect my entire trajectory—from my early academics through my career to now. It's a new challenge every day, and I guess that's what I love most about working in tech and in particular on the open web. The very pluralistic nature of the web that first drew me in is the same possibility I still seek—a world where there is opportunity for all and where there are resources for people no matter their backgrounds. Role models, mentors, resources, and, above all, respect are essential components of evolving tech and open source culture to be all that I believe it can be—including access and opportunity for all of us. - --------------------------------------------------------------------------------- - -via: https://opensource.com/life/16/5/my-open-source-story-larissa-shapiro - -作者:[Larissa Shapiro][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/larissa-shapiro -[1]: http://skinnywhitegirl.com/blog/my-nerd-story/1101/ -[2]: https://www.techwomen.org/mentorship/why-i-keep-coming-back-to-mentor-with-techwomen diff --git a/translated/talk/my-open-source-story/20160505 A daughter of Silicon Valley shares her 'nerd' story.md b/translated/talk/my-open-source-story/20160505 A daughter of Silicon Valley shares her 'nerd' story.md new file mode 100644 index 0000000000..4c4463df63 --- /dev/null +++ b/translated/talk/my-open-source-story/20160505 A daughter of Silicon Valley shares her 'nerd' story.md @@ -0,0 +1,82 @@ +A daughter of Silicon Valley shares her 'nerd' story +======================================================= + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/myopensourcestory.png?itok=6TXlAkFi) + +在 2014 年,为了对网上一些关于女性在科技行业的缺失的评论作出回应,我的同事 [Crystal Beasley][1] 建立了一个能让在科技/信息安全方面工作的女性在网络上分享自己的“天才之路”。这篇文章就是我的故事。我把我的故事与你们分享是因为我相信榜样的力量,我也相信有一个人有很多的方式进入一个让自己满意的有挑战性的工作和一个实现了所有目标的人生。 + +### 和电脑相伴的童年 + +我,在其他的光环之下,是硅谷的女儿。我的故事不是一个观众变成舞台的主角的故事。也不是从小就为这份事业做贡献的故事。这个故事更多的是关于环境如何塑造你 — 通过它的那种已然存在的文化来改变你,如果你想要被改变的话。这不是从小就看是努力并为一个明确的目标而奋斗的故事,我知道这是关于特权的故事。 + +我出生在曼哈顿,但是我在新泽西州长大,因为我的爸爸作为一个退伍军人在那里的罗格斯大学攻读计算机科学的博士学位。当我四岁时,学校里有人问我我的爸爸干什么谋生时,我说,“他就是看电视和捕捉小虫子,但是我从没有见过那些小虫子”(译者注:小虫子,bug)。他在家里有一台哑终端,这大概与他在博尔特-贝拉尼克-纽曼公司的工作有关,他会通过早期的互联网来进行它在人工智能方面的工作。我就在旁边看着。 + +我没能玩上父亲的会抓小虫子的电视,但是我很早就接触到了技术领域,我很珍惜这个礼物。提早的熏陶对于一个未来的天才是十分必要的 — 所以,请花时间和你的小孩谈谈他以后要做什么! + +![](https://opensource.com/sites/default/files/resize/moss-520x433.png) + +>我父亲的终端和这个很类似——如果不是这个的话 CC BY-SA 4.0 + +当我六岁时,我们搬到了加州。父亲在施乐的研究中心找到了一个工作。我记得那时我认为这个城市一定有很多熊,因为在它的旗帜上都有一个熊。在1979年,帕洛阿尔托还是一个大学城,还有果园和开阔地带。 + +在帕洛阿尔托的公立学校待了一年之后,我的姐姐和我被送到了“半岛学校”,这个“模范学校”对我造成了深刻的影响。在那里,好奇心和创新意识是被推崇的,教育也是有学生自己决定的。我们很少在学校看到能叫做电脑的东西,但是在家就不同了。 + +在父亲从施乐辞职之后,他就去了苹果,在那里他帮助研发——以及带回家让我玩的第一批电脑就是:Apple II 和 LISA。我的父亲在原先的 LISA 的研发团队。我直到现在还深刻的记得他让我们一次又一次的“玩鼠标”场景,因为他想让我的 3 岁大的妹妹对这个东西感到舒服——她也确实那样。 + +![](https://opensource.com/sites/default/files/resize/600px-apple_lisa-520x520.jpg) + +>我们的 LISA 看起来就像这样,看到鼠标了吗?CC BY-SA 4.0 + +在学校,我的数学的概念学得不错,但是基本计算却惨不忍睹。我的第一个学校的老师告诉我的家长,还有我,说我的数学很差以及我很“笨”。虽然我在“常规的”数学项目中表现出色,能理解一个 7 岁的孩子能理解的逻辑谜题,但是我不能完成我们每天早上都要做的“练习”。她说我傻,这事我不会忘记。在那之后的十年我都没能相信自己的逻辑能力和算法的水平。不要 低估你给孩子的说的话的力量。 + +在我玩了几年爸爸的电脑之后,他从苹果跳到了 EA 又跳到了 SGI,我又体验了他带回来的新玩意。这让我们认为我们家的房子是镇里最酷的,因为我们在车库里有一个能玩 Doom 的 SGI 的机器。我不会太多的编程,但是现在我发现,在那些年里我对尝试新的科技不再恐惧。同时,我的学文学和教育的母亲,成为了一个科技行业的作家,她向我证实了一个人的职业可以改变以及科技行业的人也可以做母亲。我不是说这对她来说很简单,但是她让我认为这件是看起来很简单。你可能回想这些早期的熏陶能把我带到科技行业,但是它没有。 + +### 本科时光 + +我想我要成为一个小学教师,我就读米尔斯学院就是想要做这个。但是后来我开始研究女性,后来有研究神学,我这样做仅仅是由于我自己的一个渴求:我希望能理解人类的意志以及为更好的世界而努力。 + +同时,我也感受到了互联网的巨大力量。在 1991 年,拥有你自己的 UNIX 的账户是很令人高兴的事,这件事值得你向全世界的人吹嘘。我仅仅从在互联网中“玩”就学到了不少,从那些愿意回答我提出的问题的人那里学到的就更多了。这些学习对我的职业生涯的影响不亚于我在学校教育部之中学到的知识。没有没有用的信息。我在一个女子学院度过了影响我一生的关键时期,然后那个女子学院的一个辉煌的女人跑进了计算机院,我不忍为这是一个事故。在那个老师的权力不算太大的学院,我们不止是被允许,甚至是被鼓励去尝试很多的道路(我们能接触到很多很多的科技,还能有聪明人来供我们求助),我也确实那样做了。我十分感激当年的教育。在那个学院,我也了解了什么是极客文化。 + +之后我去了研究生院去学习 女权主义神学,但是技术行业的气息已经渗入我的灵魂。当我知道我不能成为一个教授或者一个专家时,我离开了学术圈,带着债务和很多点子回到了家。 + +### 新的开端 + +在 1995 年,我被我看见的万维网连接 人们以及分享想法和信息的能力所震惊(直到现在仍是如此)。我想要进入这个行业。看起来我好像要“女承父业”,但是我不知道我会用什么方式来这样做。我开始在硅谷做临时工,在我在太阳微系统公司得到我的第一个“技术”职位前做一些事情(为数据写最基础的数据库,技术手册印发钱的事务,备份工资单的存跟)。这些事很让人激动。(毕竟,我们是“点 com”的那个”点“)。 + +在 Sun ,我努力学习,尽可能多的尝试我新事物。我的第一个工作是网页化(啥?这是一个单独的词汇)论文以及为测试中的 Solaris 修改一些基础的服务工具(大多数是Perl写的)。在那里最终在 Open Solaris 的测试版运行时我感受到了开源的力量。 + +在那里我学到了一个很重要的事情。我发现在同样重视工程和教育的地方有一种气氛,在那里我的问题不再显得“傻”。我很庆幸我选对了导师和朋友。在决定为第二个孩子的出生产假之前,我上每一堂我能上的课程,读每一本我能读的书,尝试自学我在学校没有学习过的技术,商业以及项目管理方面的技能。 + +### 重回工作 + +当我准备重新工作时,Sun 已经不是一个值得回去的地方。所以,我收集了很多人的信息(网络是你的朋友),利用我的沟通技能最终建立了一个互联网门户(2005 年时,一切皆门户),并且开始了解 CRM,发布产品的方式,本地化,网络等知识。我这么做是基于我过去的尝试以及失败的经历所得出的教训,也是这个教训让我成功。我也认为我们需要这个方面的榜样。 + +从很多方面来看,我的职业生涯的第一部分是 我的技术上的自我教育。这事发生的时间和地点都和现在不一样——我在帮助女性和其他弱势群体的组织工作,但是我之后成为一个技术行业的女性。当时我无疑,没有看到这个行业的缺陷,现在这个行业更加的厌恶女性,而不是更加喜欢她们。 + +在这些事情之后,我还没有把自己当作一个榜样,或者一个高级技术人员。当我的一个在父母的圈子里认识极客朋友鼓励我申请一个看起来定位十分模糊且技术性很强的开源的非盈利基础设施商店(互联网系统协会,BIND,一个广泛部署的开源服务器的开发商,13 台 DNS 根域名服务器之一的运营商)的项目经理时,我很震惊。有很长一段时间,我都不知道他们为什么要雇佣我!我对 DNS ,基础设备,以及协议的开发知之甚少,但是我再次遇到了老师,并再度开始飞速发展。我花时间旅行,在关键流程攻关,搞清楚如何与高度国际化的团队合作,解决麻烦的问题,最重要的是,拥抱支持我们的开源和充满活力的社区。我几乎重新学了一切,通过试错的方式。我学习如何构思一个产品。如何通过建设开源社区,领导那些有这特定才能,技能和耐心的人,是他们给了产品价值。 + +### 成为别人的导师 + +当我在 ISC 工作时,我通过 [TechWomen 项目][2] (一个让来自中东和北非的技术行业的女性带到硅谷来接受教育的计划),我开始喜欢教学生以及支持那些女性,特别是在开源行业中奋斗的。这也就是我开始相信自己的能力的开端。我还需要学很多。 + +当我第一次读 TechWomen 的广告时,我认为那些导师甚至都不会想要和我说话!我有冒名顶替综合征。当他们邀请我成为第一批导师(以及以后 6 年的导师)时,我很震惊,但是现在我学会了相信这些都是我努力得到的待遇。冒名顶替综合征是真实的,但是它能被时间冲淡。 + +### 现在 + +最后,我不得不离开我在 ISC 的工作。幸运的是,我的工作以及我的价值让我进入了 Mozilla ,在这里我的努力和我的幸运让我在这里有着重要的作用。现在,我是一名支持多样性的包容的高级项目经理。我致力于构建一个更多样化,更有包容性的 Mozilla ,站在之前的做同样事情的巨人的肩膀上,与最聪明友善的人们一起工作。我用我的激情来让人们找到贡献一个世界需要的互联网的有意义的方式:这让我兴奋了很久。我能看见,我做到了! + +通过对组织和个人行为的干预来用一种新的方法来改变一种文化这件事情和我的人生有着十分奇怪的联系 —— 从我的早期的学术生涯,到职业生涯再到现在。每天都是一个新的挑战,我想我最喜欢的就是在科技行业的工作,尤其是在开放互联网的工作。互联网天然的多元性是它最开始吸引我的原因,也是我还在寻求的——一个所有人都有获取的资源可能性,无论背景如何。榜样,导师,资源,以及最重要的,对不断发展的技术和开源文化的尊重能实现我相信它能实现的事 —— 包括给任何的平等的接入权和机会。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/16/5/my-open-source-story-larissa-shapiro + +作者:[Larissa Shapiro][a] +译者:[name1e5s](https://github.com/name1e5s) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/larissa-shapiro +[1]: http://skinnywhitegirl.com/blog/my-nerd-story/1101/ +[2]: https://www.techwomen.org/mentorship/why-i-keep-coming-back-to-mentor-with-techwomen From 36e44067607e34fc17afed464f4b0f808cb7198b Mon Sep 17 00:00:00 2001 From: Name1e5s <836401406@qq.com> Date: Sun, 8 May 2016 13:12:32 +0800 Subject: [PATCH 0710/1469] Title changed.... --- ...0505 A daughter of Silicon Valley shares her 'nerd' story.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/talk/my-open-source-story/20160505 A daughter of Silicon Valley shares her 'nerd' story.md b/translated/talk/my-open-source-story/20160505 A daughter of Silicon Valley shares her 'nerd' story.md index 4c4463df63..279a7fd843 100644 --- a/translated/talk/my-open-source-story/20160505 A daughter of Silicon Valley shares her 'nerd' story.md +++ b/translated/talk/my-open-source-story/20160505 A daughter of Silicon Valley shares her 'nerd' story.md @@ -1,4 +1,4 @@ -A daughter of Silicon Valley shares her 'nerd' story +”硅谷的女儿“的天才故事 ======================================================= ![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/myopensourcestory.png?itok=6TXlAkFi) From 00c09fb6d37220e0352b46a6f65495fa30e82569 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 8 May 2016 13:29:49 +0800 Subject: [PATCH 0711/1469] =?UTF-8?q?20160506-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0: Remote hosts and container migration.md | 206 +++++++++++++++++- 1 file changed, 204 insertions(+), 2 deletions(-) diff --git a/sources/tech/LXD/Part 6 - LXD 2.0: Remote hosts and container migration.md b/sources/tech/LXD/Part 6 - LXD 2.0: Remote hosts and container migration.md index 95c825a30e..bbeb4f3eea 100644 --- a/sources/tech/LXD/Part 6 - LXD 2.0: Remote hosts and container migration.md +++ b/sources/tech/LXD/Part 6 - LXD 2.0: Remote hosts and container migration.md @@ -1,7 +1,209 @@ Part 6 - LXD 2.0: Remote hosts and container migration ======================================================= -<正文待补充> +This is the third blog post [in this series about LXD 2.0][0]. + +![](https://linuxcontainers.org/static/img/containers.png) + +### Remote protocols + +LXD 2.0 supports two protocols: + +* LXD 1.0 API: That’s the REST API used between the clients and a LXD daemon as well as between LXD daemons when copying/moving images and containers. +* Simplestreams: The Simplestreams protocol is a read-only, image-only protocol used by both the LXD client and daemon to get image information and import images from some public image servers (like the Ubuntu images). + +Everything below will be using the first of those two. + +### Security + +Authentication for the LXD API is done through client certificate authentication over TLS 1.2 using recent ciphers. When two LXD daemons must exchange information directly, a temporary token is generated by the source daemon and transferred through the client to the target daemon. This token may only be used to access a particular stream and is immediately revoked so cannot be re-used. + +To avoid Man In The Middle attacks, the client tool also sends the certificate of the source server to the target. That means that for a particular download operation, the target server is provided with the source server URL, a one-time access token for the resource it needs and the certificate that the server is supposed to be using. This prevents MITM attacks and only give temporary access to the object of the transfer. + +### Network requirements + +LXD 2.0 uses a model where the target of an operation (the receiving end) is connecting directly to the source to fetch the data. + +This means that you must ensure that the target server can connect to the source directly, updating any needed firewall along the way. + +We have [a plan][1] to allow this to be reversed and also to allow proxying through the client itself for those rare cases where draconian firewalls are preventing any communication between the two hosts. + +### Interacting with remote hosts + +Rather than having our users have to always provide hostname or IP addresses and then validating certificate information whenever they want to interact with a remote host, LXD is using the concept of “remotes”. + +By default, the only real LXD remote configured is “local:” which also happens to be the default remote (so you don’t have to type its name). The local remote uses the LXD REST API to talk to the local daemon over a unix socket. + +### Adding a remote + +Say you have two machines with LXD installed, your local machine and a remote host that we’ll call “foo”. + +First you need to make sure that “foo” is listening to the network and has a password set, so get a remote shell on it and run: + +``` +lxc config set core.https_address [::]:8443 +lxc config set core.trust_password something-secure +``` + +Now on your local LXD, we just need to make it visible to the network so we can transfer containers and images from it: + +lxc config set core.https_address [::]:8443 +Now that the daemon configuration is done on both ends, you can add “foo” to your local client with: + +``` +lxc remote add foo 1.2.3.4 +``` + +(replacing 1.2.3.4 by your IP address or FQDN) + +You’ll see something like this: + +``` +stgraber@dakara:~$ lxc remote add foo 2607:f2c0:f00f:2770:216:3eff:fee1:bd67 +Certificate fingerprint: fdb06d909b77a5311d7437cabb6c203374462b907f3923cefc91dd5fce8d7b60 +ok (y/n)? y +Admin password for foo: +Client certificate stored at server: foo +``` + +You can then list your remotes and you’ll see “foo” listed there: + +``` +stgraber@dakara:~$ lxc remote list ++-----------------+-------------------------------------------------------+---------------+--------+--------+ +| NAME | URL | PROTOCOL | PUBLIC | STATIC | ++-----------------+-------------------------------------------------------+---------------+--------+--------+ +| foo | https://[2607:f2c0:f00f:2770:216:3eff:fee1:bd67]:8443 | lxd | NO | NO | ++-----------------+-------------------------------------------------------+---------------+--------+--------+ +| images | https://images.linuxcontainers.org:8443 | lxd | YES | NO | ++-----------------+-------------------------------------------------------+---------------+--------+--------+ +| local (default) | unix:// | lxd | NO | YES | ++-----------------+-------------------------------------------------------+---------------+--------+--------+ +| ubuntu | https://cloud-images.ubuntu.com/releases | simplestreams | YES | YES | ++-----------------+-------------------------------------------------------+---------------+--------+--------+ +| ubuntu-daily | https://cloud-images.ubuntu.com/daily | simplestreams | YES | YES | ++-----------------+-------------------------------------------------------+---------------+--------+--------+ +``` + +### Interacting with it + +Ok, so we have a remote server defined, what can we do with it now? + +Well, just about everything you saw in the posts until now, the only difference being that you must tell LXD what host to run against. + +For example: + +``` +lxc launch ubuntu:14.04 c1 +``` + +Will run on the default remote (“lxc remote get-default”) which is your local host. + +``` +lxc launch ubuntu:14.04 foo:c1 +``` + +Will instead run on foo. + +Listing running containers on a remote host can be done with: + +``` +stgraber@dakara:~$ lxc list foo: ++------+---------+---------------------+-----------------------------------------------+------------+-----------+ +| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS | ++------+---------+---------------------+-----------------------------------------------+------------+-----------+ +| c1 | RUNNING | 10.245.81.95 (eth0) | 2607:f2c0:f00f:2770:216:3eff:fe43:7994 (eth0) | PERSISTENT | 0 | ++------+---------+---------------------+-----------------------------------------------+------------+-----------+ +``` + +One thing to keep in mind is that you have to specify the remote host for both images and containers. So if you have a local image called “my-image” on “foo” and want to create a container called “c2” from it, you have to run: + +``` +lxc launch foo:my-image foo:c2 +``` + +Finally, getting a shell into a remote container works just as you would expect: + +``` +lxc exec foo:c1 bash +``` + +### Copying containers + +Copying containers between hosts is as easy as it sounds: + +``` +lxc copy foo:c1 c2 +``` +And you’ll have a new local container called “c2” created from a copy of the remote “c1” container. This requires “c1” to be stopped first, but you could just copy a snapshot instead and do it while the source container is running: + +``` +lxc snapshot foo:c1 current +lxc copy foo:c1/current c3 +``` + +### Moving containers + +Unless you’re doing live migration (which will be covered in a later post), you have to stop the source container prior to moving it, after which everything works as you’d expect. + +``` +lxc stop foo:c1 +lxc move foo:c1 local: +``` + +This example is functionally identical to: + +``` +lxc stop foo:c1 +lxc move foo:c1 c1 +``` + +### How this all works + +Interactions with remote containers work as you would expect, rather than using the REST API over a local Unix socket, LXD just uses the exact same API over a remote HTTPS transport. + +Where it gets a bit trickier is when interaction between two daemons must occur, as is the case for copy and move. + +In those cases the following happens: + +1. The user runs “lxc move foo:c1 c1”. +2. The client contacts the local: remote to check for an existing “c1” container. +3. The client fetches container information from “foo”. +4. The client requests a migration token from the source “foo” daemon. +5. The client sends that migration token as well as the source URL and “foo”‘s certificate to the local LXD daemon alongside the container configuration and devices. +6. The local LXD daemon then connects directly to “foo” using the provided token + A. It connects to a first control websocket + B. It negotiates the filesystem transfer protocol (zfs send/receive, btrfs send/receive or plain rsync) + C. If available locally, it unpacks the image which was used to create the source container. This is to avoid needless data transfer. + D. It then transfers the container and any of its snapshots as a delta. +7. If succesful, the client then instructs “foo” to delete the source container. + +### Try all this online + +Don’t have two machines to try remote interactions and moving/copying containers? + +That’s okay, you can test it all online using our [demo service][2]. +The included step-by-step walkthrough even covers it! + +### Extra information + +The main LXD website is at: +Development happens on Github at: +Mailing-list support happens on: +IRC support happens in: #lxcontainers on irc.freenode.net -https://www.stgraber.org/2016/04/12/lxd-2-0-remote-hosts-and-container-migration-612/ +-------------------------------------------------------------------------------- + +via: https://www.stgraber.org/2016/03/19/lxd-2-0-your-first-lxd-container-312/ + +作者:[Stéphane Graber][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.stgraber.org/author/stgraber/ +[0]: https://www.stgraber.org/2016/03/11/lxd-2-0-blog-post-series-012/ +[1]: https://github.com/lxc/lxd/issues/553 +[2]: https://linuxcontainers.org/lxd/try-it/ From 85ba77f9d3af8d1a826196a5d8419886810cc29a Mon Sep 17 00:00:00 2001 From: sonofelice Date: Sun, 8 May 2016 16:36:25 +0800 Subject: [PATCH 0712/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=909?= =?UTF-8?q?=20Key=20Trends=20in=20Hybrid=20Cloud=20Computing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译完成9 Key Trends in Hybrid Cloud Computing --- ... 9 Key Trends in Hybrid Cloud Computing.md | 75 ------------------ ... 9 Key Trends in Hybrid Cloud Computing.md | 76 +++++++++++++++++++ 2 files changed, 76 insertions(+), 75 deletions(-) delete mode 100644 sources/tech/20160218 9 Key Trends in Hybrid Cloud Computing.md create mode 100644 translated/tech/20160218 9 Key Trends in Hybrid Cloud Computing.md diff --git a/sources/tech/20160218 9 Key Trends in Hybrid Cloud Computing.md b/sources/tech/20160218 9 Key Trends in Hybrid Cloud Computing.md deleted file mode 100644 index 4c6e74ed2d..0000000000 --- a/sources/tech/20160218 9 Key Trends in Hybrid Cloud Computing.md +++ /dev/null @@ -1,75 +0,0 @@ -sonofelice translating -9 Key Trends in Hybrid Cloud Computing -======================================== - -All three forms of cloud computing – public, private, and hybrid – have undergone considerable evolution since the concepts first gained the attention of IT years ago. Hybrid cloud is the overwhelming favorite form of the cloud, with [88% of firms surveyed](https://www.greenhousedata.com/blog/hybrid-continues-to-be-most-popular-cloud-option-adoption-accelerating) rating it as important or critical to their business. - -The lightning-fast evolution of hybrid cloud means the conventional wisdom of a year or two back is already obsolete. So we asked several industry analysts where they saw the hybrid cloud headed in 2016 and got some interesting answers. - -1. **2016 might be the year that we get hybrid cloud to actually work.** - - By its very nature, hybrid cloud relies on private cloud, which has proven elusive for most enterprises. The fact is that the public cloud – Amazon, Google, Microsoft – have had much more investment and a longer head start. The private cloud has hamstrung the hybrid cloud's growth and usability. - - There hasn't been as much investment in the private cloud because by its very nature, the private cloud means keeping and investing in your own data center. And many public cloud providers are pushing enterprises to reduce or eliminate their data center spending all together. - - However, this year will see the private cloud start to catch up thanks to advances in OpenStack and Microsoft's Azure Stack, which is basically a private cloud in a box. The tools, infrastructures, and architectures to support hybrid cloud are also becoming much more robust. - -2. **Containers, microservices, and unikernels will bolster the hybrid cloud.** - - These are all cloud native technologies and will all be more or less mainstream by the end of 2016, analysts predict. They are maturing rapidly and serving as a viable alternative to virtual machines, which require more resources. - - More importantly, they work in an on-premises scenario as well as an off-premises scenario. Containerization and orchestration allow rapid scale up, scale out, and service migration between public and private cloud, making it even easier to move your services around. - -3. **Data and relevance take center stage** - - The cloud, in all its forms, has been in growth mode. That makes it a technology story. But with the cloud shifting into maturity, data and relevance become more important, according to the consultancy [Avoa](http://avoa.com/2016/01/01/2016-is-the-year-of-data-and-relevance/). At first, the cloud and Big Data were all about sucking up as much data as possible. Then they worried about what to do with it. - - In 2016, organizations will hone their craft in how data is collected and used. There is still much progress to be made in the technological and cultural aspects that must be dealt with. But 2016 should bring a renewed focus on the importance of data from all aspects and finding the most relevant information, not just lots of it. - -4. **Cloud services move beyond just on-demand workloads** - - AWS got its start as a place where a programmer/developer could spin up a VM real quick, get some work done, and get off. That's the essence of on-demand use, and given how much it can cost to leave those services constantly running, there is almost a disincentive to keep them running 24/7. - - However, IT organizations are starting to act as service brokers to provide all manner of IT services to their in-house users. This can be anything from in-house IT services, public cloud infrastructure providers, platform-as-a-service, and software-as-a-service. - - They will increasingly recognize the value of tools like cloud management platforms to provide consistent policy-based management over many of these different services. And they will see the value of technology such as containers to enhance portability. However, cloud service brokering in the sense of rapidly moving workloads between clouds for price arbitrage and related reasons will continue to be a non-starter. - -5. **Service providers become cloud service providers** - - Up to now, buying cloud services has been a direct sale model. The user was frequently the buyer of AWS EC2 services, either through officially recognized channels at work or through Shadow IT. But as cloud services become more comprehensive, and the menu of services more confusing, more and more people are turning to resellers and services providers to act as the purchaser of IT services for them. - - A recent survey by 2nd Watch, a Seattle-based cloud services provider, found nearly 85 percent of IT executives in the United States would be willing to pay a small premium to buy public cloud from a channel partner if it were to make it less complex. And about four out of every five within that 85 percent would shell out an extra 15 percent or more, the survey found. One in three executives surveyed said they could use the help in buying, using, and managing public cloud services. - -6. **IoT and cloud is to 2016 what mobile and cloud was to 2012** - - IoT is gaining mindshare and, more importantly, it's moving from test beds to real use cases. The cloud is a vital part for IoT due to its distributed nature, and for industrial IoT, where machinery and heavy equipment talk to back-end systems, a hybrid cloud will be most natural driver because the connection, data collection, and processing will happen in a hybrid cloud environment, due to perceived benefits of the private cloud side, like security and privacy. - -7. **The NIST definition of the cloud begins to break down** - - In 2011, the National Institute of Standards and Technology published "[The NIST Definition of Cloud Computing](http://csrc.nist.gov/publications/nistpubs/800-145/SP800-145.pdf)" (PDF) that became the standard definitions of private, public, and hybrid cloud terms and as-a-service models. - - Over time, though, the definitions have changed. IaaS has become much more complex, supporting things like OpenStack, [Swift](https://wiki.openstack.org/wiki/Swift) for object storage and [Neutron networking](https://wiki.openstack.org/wiki/Neutron). PaaS seems to be fading out because there's little that separates it from traditional middleware application development. And SaaS, which was just apps accessed through a browser, is losing steam because with so many cloud APIs for apps and services, you can access them through anything, not just a browser. - -8. **Analytics becomes more important** - - Analytics will be a huge growth opportunity for hybrid cloud because the high volume of data used in analytics is well suited to cloud, with its advantages of large scale and elasticity. For some forms of analytics, like highly sensitive data, then the private cloud will still rule. But the private cloud is part of the hybrid cloud, so either way, hybrid cloud wins. - -9. **Security takes on a new urgency** - - As hybrid cloud grows in 2016 and adds all kinds of new technologies, like IoT and containers, this just adds more vulnerable surface areas for data breaches. Add to it the tendency to rush into a new technology and then secure it later, which happens all the time, along with inexperienced technologists who don't think to secure the system – and you have a recipe for disaster. - - When new technologies come out, management discipline almost always lags and we think about securing the technology later. Containers are a good example. You can download all kinds of sample containers from Docker, but do you know where it came from? Docker had to go back and add security verifications after it started letting people download and run containers without any idea what was really in it. - - Mobile technologies like Path and Snapchat had major security problems a few years back as the smartphone market was taking off. It's inevitable that a new technology will be exploited by the bad guys. So security researchers will have their hands full trying to secure these new technologies. Probably after they get deployed. - ------------------------------------------------------------------------------- - -via: http://www.datamation.com/cloud-computing/9-key-trends-in-hybrid-cloud-computing.html - -作者:[Andy Patrizio][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.datamation.com/author/Andy-Patrizio-90720.html diff --git a/translated/tech/20160218 9 Key Trends in Hybrid Cloud Computing.md b/translated/tech/20160218 9 Key Trends in Hybrid Cloud Computing.md new file mode 100644 index 0000000000..5efec75ec3 --- /dev/null +++ b/translated/tech/20160218 9 Key Trends in Hybrid Cloud Computing.md @@ -0,0 +1,76 @@ +混合云计算的9大关键趋势 +======================================== + +自从几年前云计算的概念受到IT界的关注以来,公有云、私有云和混合云这三种云计算方式都有了可观的演进。其中混合云计算方式是最热门的云计算方式,在接受调查的公司中,有[88%的公司](https://www.greenhousedata.com/blog/hybrid-continues-to-be-most-popular-cloud-option-adoption-accelerating)将混合云计算摆在至关重要的地位。 + +混合云计算的疾速演进意味着一两年前的传统观念已经过时了。为此,我们询问了几个行业分析师,混合云在2016年的走势将会如何,我们得到了几个比较有意思的答案。 + +1. **2016年可能是我们将混合云投入使用的一年。** + + 混合云从本质上来说依赖于私有云,这对企业来说是比较难实现的。事实上,亚马逊,谷歌和微软的公有云已经进行了大量的投资,并且起步也比较早。私有云拖了混合云发展和使用的后腿。 + + 私有云没有得到这么多的投资,这是有私有云的性质决定的。私有云意味着维护和投资你自己的数据中心。许多公有云提供商正在推动企业减少或者消除他们的数据中心。 + + 然而,得益于OpenStack的发展和微软的 Azure Stack ,这两者基本上就是封装在一个盒子里的私有云,我们将会看到私有云慢慢追上公有云的发展步伐。支持混合云的工具、基础设施和架构也变得更加健壮。 + + +2. **容器,微服务和unikernels将会促进混合云的发展。** + + 分析师预言,到2016年底,这些原生云技术会或多或少成为主流的。这些云技术正在快速成熟,将会成为虚拟机的一个替代品,而虚拟机需要更多的资源。 + + 更重要的是,他们既能工作在在线场景,也能工作在离线场景。容器化和编排允许快速的扩大规模,进行公有云和私有云之间的服务迁移,使你能够更容易移动你的服务。 + +3. **数据和相关性占据核心舞台。** + + 所有的云计算方式都处在发展模式。这使得云计算变成了一个技术类的故事。咨询公司[Avoa](http://avoa.com/2016/01/01/2016-is-the-year-of-data-and-relevance/)称,随着云趋于成熟,数据和相关性变得越来越重要。起初,云计算和大数据都是关于怎么吸收尽可能多的数据,然后他们担心如何处理这海量的数据。 + + 2016年,相关组织将会继续锤炼如何进行数据收集和使用的相关技术。在必须处理的技术和文化方面仍然有待提高。但是2016年应该重新将关注点放在从各个方面考虑的数据重要性上,发现最相关的信息,而不只是数据的数量。 + +4. **云服务将超越按需工作负载。** + + AWS(Amazon Web Services)起初是提供给程序员或者是开发人员能够快速启动虚拟机,做一些工作然后离线的一个地方。这就是按需使用的本质。要让这些服务持续运行,几乎需要全天候工作。 + + 然而,IT组织正开始作为服务代理,为内部用户提供各种IT服务。可以是内部IT服务,公有云基础架构提供商,平台服务和软件服务。 + + 他们将越来越多的认识到想云管理平台这样的工具的价值。云管理平台可以提供针对不同服务的基于策略的一致性管理。他们也将看到像提高可移植性的容器等技术的价值。然而,云服务代理,在不同云之间快速移动的工作负载进行价格套利或者相关原因的意义上来讲,仍然是行不通的。 + +5. **服务提供商转变成了云服务提供商。** + + 到目前为止,购买云服务成了直销模式。AWS EC2 服务的使用者通常变成了购买者,通过官方认证渠道或者通过影子IT。但是随着云服务越来越全面,提供的服务菜单越来越复杂,越来越多的人转向了经销商,服务提供商转变成了他们IT服务的购买者。 + + 2nd Watch (2nd Watch是为企业提供云管理的 AWS 的首选合作伙伴)最近的一项调查发现,在美国将近85%的IT高管愿意支付一个小的溢价从渠道商那里购买公有云服务,如果购买过程变得不再那么复杂。根据调查,这85%的高管有五分之四的愿意支付额外的15%或者更多。三分之一的受访高管表示,他们可以使用帮助来购买、使用和管理公有云服务。 + +6. **物联网和云对于2016年的意义好比移动和云对2012年的意义。** + + 物联网获得了广泛的关注,更重要的是,物联网已经从测试场景进行了实际应用。云的分布式特性使得云成为了物联网非常重要的一部分,对于工业物联网,与后端系统交互的机械和重型设备,混合云将会成为最自然的驱动者,连接,数据采集和处理将会发生在混合云环境中,这得益于私有云在安全和隐私方面的好处。 + +7. **NIST 对云的定义开始瓦解。** + + 2011年,美国国家标准与技术研究院发布了“[ NIST 对于云计算的定义](http://csrc.nist.gov/publications/nistpubs/800-145/SP800-145.pdf)”(PDF),这个定义成为了私有云、公有云、混合云和 aas模板的标准定义。 + + 然而随着时间的推移,定义开始改变。Iaas变得更加复杂,开始支持OpenStack,[Swift](https://wiki.openstack.org/wiki/Swift) 对象存储和神经网络这样的项目。Paas似乎正在消退,因为Paas和传统的中间件开发几乎无异。Saas,只是通过浏览器进行访问的应用,也正在失去发展动力,因为许多app和服务提供了许多云接口,你可以通过各种手段调用接口,不仅仅通过浏览器。 + +8. **分析变得更加重要** + + 对于混合云计算来说,分析将会成为一个巨大的增长机遇,云计算具有规模大、灵活性高的优势,使得云计算非常适合需要海量数据的分析工作。对于某些分析方式,比如高度敏感的数据,私有云仍然是主导地位但是私有云也是混合云的一部分。因此,无论如何,混合云计算胜出。 + +9. **安全仍然是一个非常紧迫的问题。** + + 随着混合云计算在2016年的发展,以及对物联网和容器等新技术的引进,这同时也增加了更多的脆弱可攻破的地方从而导致数据泄露。先增加使用新技术的趋势,然后再去考虑安全性,这种问题经常发生,同时还有缺少经验的工程师不去考虑系统的安全问题,总有一天你会尝到灾难的后果的。 + + 当一项新技术出来,管理规范总是落后于安全问题产生后,然后我们才考虑去保护技术。容器就是一个很鲜明的例子。你可以从Docker下周各种示例容器,但是你知道你下载的东西来自哪里么?在人们在对容器内容不知情的情况下下载并运行了容器之后,Docker不得不重新加上安全验证。 + + 像Path和Snapchat这样的移动技术在智能手机市场火起来之后也出现了重大的安全问题。一项新技术被恶意利用无可避免。所以安全研究人员需要通过各种手段来保证新技术的安全性。很有可能在部署之后才会发现安全问题。 + + +------------------------------------------------------------------------------ + +via: http://www.datamation.com/cloud-computing/9-key-trends-in-hybrid-cloud-computing.html + +作者:[Andy Patrizio][a] +译者:[棣琦](https://github.com/sonofelice) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.datamation.com/author/Andy-Patrizio-90720.html From 7b9dacc10a469015373582f48aa7ec899c601d16 Mon Sep 17 00:00:00 2001 From: Purling Nayuki Date: Sun, 8 May 2016 18:24:05 +0800 Subject: [PATCH 0713/1469] Proofread 20151124 Review--5 memory debuggers for Linux coding --- ...ew--5 memory debuggers for Linux coding.md | 150 +++++++++--------- 1 file changed, 75 insertions(+), 75 deletions(-) diff --git a/translated/talk/20151124 Review--5 memory debuggers for Linux coding.md b/translated/talk/20151124 Review--5 memory debuggers for Linux coding.md index b49ba9e40a..2335222ac8 100644 --- a/translated/talk/20151124 Review--5 memory debuggers for Linux coding.md +++ b/translated/talk/20151124 Review--5 memory debuggers for Linux coding.md @@ -3,11 +3,11 @@ ![](http://images.techhive.com/images/article/2015/11/penguinadmin-2400px-100627186-primary.idge.jpg) Credit: [Moini][1] -作为一个程序员,我知道我总在犯错误——事实是,怎么可能会不犯错的!程序员也是人啊。有的错误能在编码过程中及时发现,而有些却得等到软件测试才显露出来。然而,有一类错误并不能在这两个时期被排除,从而导致软件不能正常运行,甚至是提前中止。 +作为一个程序员,我知道我总在犯错误——事实是,怎么可能会不犯错的!程序员也是人啊。有的错误能在编码过程中及时发现,而有些却得等到软件测试才显露出来。然而,还有一类错误并不能在这两个时期被排除,从而导致软件不能正常运行,甚至是提前中止。 -想到了吗?我说的就是内存相关的错误。手动调试这些错误不仅耗时,而且很难发现并纠正。值得一提的是,这种错误非常地常见,特别是在一些软件里,这些软件是用C/C++这类允许[手动管理内存][2]的语言编写的。 +想到了吗?我说的就是内存相关的错误。手动调试这些错误不仅耗时,而且很难发现并纠正。值得一提的是,这种错误非常常见,特别是在用 C/C++ 这类允许[手动管理内存][2]的语言编写的软件里。 -幸运的是,现行有一些编程工具能够帮你找到软件程序中这些内存相关的错误。在这些工具集中,我评定了五款Linux可用的,流行、免费并且开源的内存调试器:Dmalloc、Electric Fence、 Memcheck、 Memwatch以及Mtrace。日常编码过程中我已经把这五个调试器用了个遍,所以这些点评是建立在我的实际体验之上的。 +幸运的是,现行有一些编程工具能够帮你找到软件程序中这些内存相关的错误。在这些工具集中,我评定了五款Linux可用的,流行、免费并且开源的内存调试器: Dmalloc 、 Electric Fence 、 Memcheck 、 Memwatch 以及 Mtrace 。在日常编码中,我已经把这五个调试器用了个遍,所以这些点评是建立在我的实际体验之上的。 ### [Dmalloc][3] ### @@ -15,11 +15,11 @@ Credit: [Moini][1] **点评版本**:5.5.2 -**Linux支持**:所有种类 +**支持的 Linux**:所有种类 -**许可**:知识共享署名-相同方式共享许可证3.0 +**许可**:知识共享署名-相同方式共享许可证 3.0 -Dmalloc是Gray Watson开发的一款内存调试工具。它实现成库,封装了标准内存管理函数如**malloc(), calloc(), free()**等,使得程序员得以检测出有问题的代码。 +Dmalloc 是 Gray Watson 开发的一款内存调试工具。它实现成库,封装了标准内存管理函数如 *malloc() , calloc() , free()* 等,使程序员得以检测出有问题的代码。 ![cw dmalloc output](http://images.techhive.com/images/article/2015/11/cw_dmalloc-output-100627040-large.idge.png) Dmalloc @@ -28,29 +28,29 @@ Dmalloc #### 更新内容 #### -5.5.2版本是一个[bug修复发行版][6],同时修复了构建和安装的问题。 +5.5.2 版本是一个 [bug 修复发行版][6],同时修复了构建和安装的问题。 #### 有何优点 #### -Dmalloc最大的优点是可以进行任意配置。比如说,你可以配置以支持C++程序和多线程应用。Dmalloc还提供一个有用的功能:运行时可配置,这表示在Dmalloc执行时,可以轻易地使能或者禁能它提供的特性。 +Dmalloc 最大的优点就是高度可配置性。比如说,你可以配置以支持 C++ 程序和多线程应用。 Dmalloc 还提供一个有用的功能:运行时可配置,这表示在 Dmalloc 执行时,可以轻易地使能或者禁能它提供的特性。 -你还可以配合[GNU Project Debugger (GDB)][7]来使用Dmalloc,只需要将dmalloc.gdb文件(位于Dmalloc源码包中的contrib子目录里)的内容添加到你的主目录中的.gdbinit文件里即可。 +你还可以配合 [GNU Project Debugger (GDB)][7]来使用 Dmalloc ,只需要将 *dmalloc.gdb* 文件(位于 Dmalloc 源码包中的 contrib 子目录里)的内容添加到你的主目录中的 *.gdbinit* 文件里即可。 -另外一个优点让我对Dmalloc爱不释手的是它有大量的资料文献。前往官网的[Documentation标签][8],可以获取任何内容,有关于如何下载、安装、运行,怎样使用库,和Dmalloc所提供特性的细节描述,及其输入文件的解释。里面还有一个章节介绍了一般问题的解决方法。 +另外一个让我对 Dmalloc 爱不释手的优点是它有大量的资料文献。前往官网的 [Documentation 标签][8],可以获取所有关于如何下载、安装、运行,怎样使用库,和 Dmalloc 所提供特性的细节描述,及其输入文件的解释。其中还有一个章节介绍了一般问题的解决方法。 #### 注意事项 #### -跟Mtrace一样,Dmalloc需要程序员改动他们的源代码。比如说你可以(必须的)添加头文件**dmalloc.h**,工具就能汇报产生问题的调用的文件或行号。这个功能非常有用,因为它节省了调试的时间。 +跟 Mtrace 一样, Dmalloc 需要程序员改动他们的源代码。比如说你可以(必须的)添加头文件 *dmalloc.h* ,工具就能汇报产生问题的调用的文件或行号。这个功能非常有用,因为它节省了调试的时间。 -除此之外,还需要在编译你的程序时,把Dmalloc库(编译源码包时产生的)链接进去。 +除此之外,还需要在编译你的程序时,把 Dmalloc 库(编译源码包时产生的)链接进去。 -然而,还有点更麻烦的事,需要设置一个环境变量,命名为**DMALLOC_OPTION**,以供工具在运行时配置内存调试特性,以及输出文件的路径。可以手动为该环境变量分配一个值,不过初学者可能会觉得这个过程有点困难,因为你想使能的Dmalloc特性是存在于这个值之中的——表示为各自的十六进制值的累加。[这里][9]有详细介绍。 +然而,还有点更麻烦的事,需要设置一个环境变量,命名为 *DMALLOC_OPTION* ,以供工具在运行时配置内存调试特性,以及输出文件的路径。可以手动为该环境变量分配一个值,不过初学者可能会觉得这个过程有点困难,因为该值的一部分用来表示要启用的 Dmalloc 特性——表示为各自的十六进制值的累加。[这里][9]有详细介绍。 -一个比较简单方法设置这个环境变量是使用[Dmalloc实用指令][10],这是专为这个目的设计的方法。 +一个比较简单方法设置这个环境变量是使用 [Dmalloc 实用指令][10],这是专为这个目的设计的方法。 #### 总结 #### -Dmalloc真正的优势在于它的可配置选项。而且高度可移植,曾经成功移植到多种操作系统如AIX、BSD/OS、DG/UX、Free/Net/OpenBSD、GNU/Hurd、HPUX、Irix、Linux、MS-DOG、NeXT、OSF、SCO、Solaris、SunOS、Ultrix、Unixware甚至Unicos(运行在Cray T3E主机上)。虽然Dmalloc有很多东西需要学习,但是它所提供的特性值得为之付出。 +Dmalloc 真正的优势在于它的可配置选项。而且高度可移植,曾经成功移植到多种操作系统如 AIX 、 BSD/OS 、 DG/UX 、 Free/Net/OpenBSD 、 GNU/Hurd 、 HPUX 、 Irix 、 Linux 、 MS-DOG 、 NeXT 、 OSF 、 SCO 、 Solaris 、 SunOS 、 Ultrix 、 Unixware 甚至 Unicos(运行在 Cray T3E 主机上)。虽然使用 Dmalloc 需要学习许多知识,但是它所提供的特性值得为之付出。 ### [Electric Fence][15] ### @@ -58,95 +58,95 @@ Dmalloc真正的优势在于它的可配置选项。而且高度可移植,曾 **点评版本**:2.2.3 -**Linux支持**:所有种类 +**支持的 Linux**:所有种类 **许可**:GNU 通用公共许可证 (第二版) -Electric Fence是Bruce Perens开发的一款内存调试工具,它以库的形式实现,你的程序需要链接它。Electric Fence能检测出[栈][11]内存溢出和访问已经释放的内存。 +Electric Fence 是 Bruce Perens 开发的一款内存调试工具,它以库的形式实现,你的程序需要链接它。Electric Fence 能检测出[栈][11]内存溢出和访问已经释放的内存。 ![cw electric fence output](http://images.techhive.com/images/article/2015/11/cw_electric-fence-output-100627041-large.idge.png) Electric Fence -顾名思义,Electric Fence在每个申请的缓存边界建立了fence(防护),任何非法内存访问都会导致[段错误][12]。这个调试工具同时支持C和C++编程。 +顾名思义, Electric Fence 在每个申请的缓存边界建立了 virtual fence(虚拟围栏),任何非法内存访问都会导致[段错误][12]。这个调试工具同时支持 C 和 C++ 程序。 #### 更新内容 #### -2.2.3版本修复了工具的构建系统,使得-fno-builtin-malloc选项能真正传给[GNU Compiler Collection (GCC)][13]。 +2.2.3 版本修复了工具的构建系统,使得 `-fno-builtin-malloc` 选项能真正传给 [GNU Compiler Collection (GCC)][13]。 #### 有何优点 #### -我喜欢Electric Fence首要的一点是(Memwatch、Dmalloc和Mtrace所不具有的),这个调试工具不需要你的源码做任何的改动,你只需要在编译的时候把它的库链接进你的程序即可。 +我喜欢 Electric Fence 首要的一点是它(不同于 Memwatch 、 Dmalloc 和 Mtrace ,)不需要你的源码做任何的改动,你只需要在编译的时候把它的库链接进你的程序即可。 -其次,Electric Fence实现一个方法,确认导致越界访问(a bounds violation)的第一个指令就是引起段错误的原因。这比在后面再发现问题要好多了。 +其次, Electric Fence 的实现保证了导致越界访问( a bounds violation )的第一个指令就是引起段错误的原因。这比在后面再发现问题要好多了。 -不管是否有检测出错误,Electric Fence经常会在输出产生版权信息。这一点非常有用,由此可以确定你所运行的程序已经启用了Electric Fence。 +不管是否有检测出错误, Electric Fence 都会在输出产生版权信息。这一点非常有用,由此可以确定你所运行的程序已经启用了 Electric Fence 。 #### 注意事项 #### -另一方面,我对Electric Fence真正念念不忘的是它检测内存泄漏的能力。内存泄漏是C/C++软件最常见也是最难隐秘的问题之一。不过,Electric Fence不能检测出堆内存溢出,而且也不是线程安全的。 +另一方面,我对 Electric Fence 真正念念不忘的是它检测内存泄漏的能力。内存泄漏是 C/C++ 软件最常见也是最难隐秘的问题之一。不过, Electric Fence 不能检测出堆内存溢出,而且也不是线程安全的。 -基于Electric Fence会在用户分配内存区的前后分配禁止访问的虚拟内存页,如果你过多的进行动态内存分配,将会导致你的程序消耗大量的额外内存。 +由于 Electric Fence 会在用户分配内存区的前后分配禁止访问的虚拟内存页,如果你过多的进行动态内存分配,将会导致你的程序消耗大量的额外内存。 -Electric Fence还有一个局限是不能明确指出错误代码所在的行号。它所能做只是在监测到内存相关错误时产生段错误。想要定位行号,需要借助[The Gnu Project Debugger (GDB)][14]这样的调试工具来调试你启用了Electric Fence的程序。 +Electric Fence 还有一个局限是不能明确指出错误代码所在的行号。它所能做只是在监测到内存相关错误时产生段错误。想要定位行号,需要借助 [The Gnu Project Debugger ( GDB )][14]这样的调试工具来调试启用了 Electric Fence 的程序。 -最后一点,Electric Fence虽然能检测出大部分的缓冲区溢出,有一个例外是,如果所申请的缓冲区大小不是系统字长的倍数,这时候溢出(即使只有几个字节)就不能被检测出来。 +最后一点,尽管 Electric Fence 能检测出大部分的缓冲区溢出,有一个例外是,如果所申请的缓冲区大小不是系统字长的倍数,这时候溢出(即使只有几个字节)就不能被检测出来。 #### 总结 #### -尽管有那么多的局限,但是Electric Fence的优点却在于它的易用性。程序只要链接工具一次,Electric Fence就可以在监测出内存相关问题的时候报警。不过,如同前面所说,Electric Fence需要配合像GDB这样的源码调试器使用。 +尽管局限性较大, Electric Fence 的易用性仍然是加分项。只要链接一次程序, Electric Fence 就可以在监测出内存相关问题的时候报警。不过,如同前面所说, Electric Fence 需要配合像 GDB 这样的源码调试器使用。 ### [Memcheck][16] ### -**开发者**:[Valgrind开发团队][17] +**开发者**:[Valgrind 开发团队][17] **点评版本**:3.10.1 -**Linux支持**:所有种类 +**支持的 Linux**:所有种类 **许可**:通用公共许可证 -[Valgrind][18]是一个提供好几款调试和Linux程序性能分析工具的套件。虽然Valgrind和编写语言各不相同(有Java、Perl、Python、Assembly code、ortran、Ada等等)的程序配合工作,但是它所提供的工具大部分都意在支持C/C++所编写的程序。 +[Valgrind][18] 是一个提供好几款调试和 Linux 程序性能分析工具的套件。虽然 Valgrind 能和编写语言各不相同(有 Java 、 Perl 、 Python 、 Assembly code 、 ortran 、 Ada等等)的程序配合工作,但是它所提供的工具主要针对用 C/C++ 所编写的程序。 -Memcheck作为内存错误检测器,是一款最受欢迎的Memcheck工具。它能够检测出诸多问题诸如内存泄漏、无效的内存访问、未定义变量的使用以及栈内存分配和释放相关的问题等。 +Memcheck ,一款内存错误检测器,是其中最受欢迎的工具。它能够检测出如内存泄漏、无效的内存访问、未定义变量的使用以及栈内存分配和释放相关的问题等诸多问题。 #### 更新内容 #### -工具套件(3.10.1)的[发行版][19]是一个副版本,主要修复了3.10.0版本发现的bug。除此之外,从主版本backport一些包,修复了缺失的AArch64 ARMv8指令和系统调用。 +工具套件( 3.10.1 )的[发行版][19]是一个副版本,主要修复了 3.10.0 版本发现的 bug 。除此之外,从主版本向后移植(标音: backport )一些包,修复了缺失的 AArch64 ARMv8 指令和系统调用。 #### 有何优点 #### -同其它所有Valgrind工具一样,Memcheck也是基本的命令行实用程序。它的操作非常简单:通常我们会使用诸如prog arg1 arg2格式的命令来运行程序,而Memcheck只要求你多加几个值即可,就像valgrind --leak-check=full prog arg1 arg2。 +同其它所有 Valgrind 工具一样, Memcheck 也是命令行实用程序。它的操作非常简单:通常我们会使用诸如 prog arg1 arg2 格式的命令来运行程序,而 Memcheck 只要求你多加几个值即可,如 valgrind --leak-check=full prog arg1 arg2 。 ![cw memcheck output](http://images.techhive.com/images/article/2015/11/cw_memcheck-output-100627037-large.idge.png) Memcheck -(注意:因为Memcheck是Valgrind的默认工具所以无需提及Memcheck。但是,需要在编译程序之初带上-g参数选项,这一步会添加调试信息,使得Memcheck的错误信息会包含正确的行号。) +(注意:因为 Memcheck 是 Valgrind 的默认工具所以无需提及 Memcheck。但是,需要在编译程序之初带上 -g 参数选项,这一步会添加调试信息,使得 Memcheck 的错误信息会包含正确的行号。) -我真正倾心于Memcheck的是它提供了很多命令行选项(如上所述的--leak-check选项),如此不仅能控制工具运转还可以控制它的输出。 +我真正倾心于 Memcheck 的是它提供了很多命令行选项(如上所述的 *--leak-check* 选项),如此不仅能控制工具运转还可以控制它的输出。 -举个例子,可以开启--track-origins选项,以查看程序源码中未初始化的数据。可以开启--show-mismatched-frees选项让Memcheck匹配内存的分配和释放技术。对于C语言所写的代码,Memcheck会确保只能使用free()函数来释放内存,malloc()函数来申请内存。而对C++所写的源码,Memcheck会检查是否使用了delete或delete[]操作符来释放内存,以及new或者new[]来申请内存。 +举个例子,可以开启 *--track-origins* 选项,以查看程序源码中未初始化的数据;可以开启 *--show-mismatched-frees* 选项让 Memcheck 匹配内存的分配和释放技术。对于 C 语言所写的代码, Memcheck 会确保只能使用 *free()* 函数来释放内存, *malloc()* 函数来申请内存。而对 C++ 所写的源码, Memcheck 会检查是否使用了 *delete* 或 *delete[]* 操作符来释放内存,以及 *new* 或者*new[]* 来申请内存。 -Memcheck最好的特点,尤其是对于初学者来说的,是它会给用户建议使用那个命令行选项能让输出更加有意义。比如说,如果你不使用基本的--leak-check选项,Memcheck会在输出时建议“使用--leak-check=full重新运行,查看更多泄漏内存细节”。如果程序有未初始化的变量,Memcheck会产生信息“使用--track-origins=yes,查看未初始化变量的定位”。 +Memcheck 最好的特点,尤其是对于初学者来说,是它会给用户建议使用哪个命令行选项能让输出更加有意义。比如说,如果你不使用基本的 *--leak-check* 选项, Memcheck 会在输出时建议“使用 --leak-check=full 重新运行以查看更多泄漏内存细节”。如果程序有未初始化的变量, Memcheck 会产生信息“使用 --track-origins=yes 以查看未初始化变量的定位”。 -Memcheck另外一个有用的特性是它可以[创建抑制文件(suppression files)][20],由此可以忽略特定不能修正的错误,这样Memcheck运行时就不会每次都报警了。值得一提的是,Memcheck会去读取默认抑制文件来忽略系统库(比如C库)中的报错,这些错误在系统创建之前就已经存在了。可以选择创建一个新的抑制文件,或是编辑现有的(通常是/usr/lib/valgrind/default.supp)。 +Memcheck 另外一个有用的特性是它可以[创建抑制文件( suppression files )][20],由此可以忽略特定不能修正的错误,这样 Memcheck 运行时就不会每次都报警了。值得一提的是, Memcheck 会去读取默认抑制文件来忽略系统库(比如 C 库)中的报错,这些错误在系统创建之前就已经存在了。可以选择创建一个新的抑制文件,或是编辑现有的文件(通常是*/usr/lib/valgrind/default.supp*)。 -Memcheck还有高级功能,比如可以使用[定制内存分配器][22]来[检测内存错误][21]。除此之外,Memcheck提供[监控命令][23],当用到Valgrind的内置gdbserver,以及[客户端请求][24]机制(不仅能把程序的行为告知Memcheck,还可以进行查询)时可以使用。 +Memcheck 还有高级功能,比如可以使用[定制内存分配器][22]来[检测内存错误][21]。除此之外, Memcheck 提供[监控命令][23],当用到 Valgrind 内置的 gdbserver ,以及[客户端请求][24]机制(不仅能把程序的行为告知 Memcheck ,还可以进行查询)时可以使用。 #### 注意事项 #### -毫无疑问,Memcheck可以节省很多调试时间以及省去很多麻烦。但是它使用了很多内存,导致程序执行变慢([由资料可知][25],大概花上20至30倍时间)。 +毫无疑问, Memcheck 可以节省很多调试时间以及省去很多麻烦。但是它使用了很多内存,导致程序执行变慢([由文档可知][25],大概花上 20 至 30 倍时间)。 -除此之外,Memcheck还有其它局限。根据用户评论,Memcheck明显不是[线程安全][26]的;它不能检测出 [静态缓冲区溢出][27];还有就是,一些Linux程序如[GNU Emacs][28],目前还不能使用Memcheck。 +除此之外, Memcheck 还有其它局限。根据用户评论, Memcheck 明显不是[线程安全][26]的;它不能检测出 [静态缓冲区溢出][27];还有就是,一些 Linux 程序如 [GNU Emacs][28] 目前还不能使用 Memcheck 。 -如果有兴趣,可以在[这里][29]查看Valgrind详尽的局限性说明。 +如果有兴趣,可以在[这里][29]查看 Valgrind 详尽的局限性说明。 #### 总结 #### -无论是对于初学者还是那些需要高级特性的人来说,Memcheck都是一款便捷的内存调试工具。如果你仅需要基本调试和错误核查,Memcheck会非常容易上手。而当你想要使用像抑制文件或者监控指令这样的特性,就需要花一些功夫学习了。 +无论是对于初学者还是那些需要高级特性的人来说, Memcheck 都是一款便捷的内存调试工具。如果你仅需要基本调试和错误核查, Memcheck 会非常容易上手。而当你想要使用像抑制文件或者监控指令这样的特性,就需要花一些功夫学习了。 -虽然罗列了大量的局限性,但是Valgrind(包括Memcheck)在它的网站上声称全球有[成千上万程序员][30]使用了此工具。开发团队称收到来自超过30个国家的用户反馈,而这些用户的工程代码有的高达2.5千万行。 +虽然罗列了大量的局限性,但是 Valgrind(包括 Memcheck )在它的网站上声称全球有[成千上万程序员][30]使用了此工具。开发团队称收到来自超过 30 个国家的用户反馈,而这些用户的工程代码有的高达 2.5 千万行。 ### [Memwatch][31] ### @@ -154,40 +154,40 @@ Memcheck还有高级功能,比如可以使用[定制内存分配器][22]来[ **点评版本**:2.71 -**Linux支持**:所有种类 +**支持的 Linux**:所有种类 **许可**:GNU通用公共许可证 - -Memwatch是由Johan Lindh开发的内存调试工具,虽然它主要扮演内存泄漏检测器的角色,但是它也具有检测其它如[重复释放跟踪和内存错误释放][32]、缓冲区溢出和下溢、[野指针][33]写入等等内存相关问题的能力(根据网页介绍所知)。 -Memwatch支持用C语言所编写的程序。可以在C++程序中使用它,但是这种做法并不提倡(由Memwatch源码包随附的Q&A文件中可知)。 +Memwatch 是由 Johan Lindh 开发的内存调试工具,虽然它主要扮演内存泄漏检测器的角色,但是(根据网页介绍)它也具有检测其它如[重复释放跟踪和内存错误释放][32]、缓冲区溢出和下溢、[野指针][33]写入等等内存相关问题的能力。 + +Memwatch 支持用 C 语言所编写的程序。也可以在 C++ 程序中使用它,但是这种做法并不提倡(由 Memwatch 源码包随附的 Q&A 文件中可知)。 #### 更新内容 #### -这个版本添加了ULONG_LONG_MAX以区分32位和64位程序。 +这个版本添加了 *ULONG_LONG_MAX* 以区分 32 位和 64 位程序。 #### 有何优点 #### -跟Dmalloc一样,Memwatch也有优秀的文献资料。参考USING文件,可以学习如何使用Memwatch,可以了解Memwatch是如何初始化、如何清理以及如何进行I/O操作的,等等不一而足。还有一个FAQ文件,旨在帮助用户解决使用过程遇到的一般问题。最后还有一个test.c文件提供工作案例参考。 +跟 Dmalloc 一样, Memwatch 也有优秀的文档资料。参考 USING 文件,可以学习如何使用 Memwatch ,可以了解 Memwatch 是如何初始化、如何清理以及如何进行 I/O 操作,等等。还有一个 FAQ 文件,旨在帮助用户解决使用过程遇到的一般问题。最后还有一个 *test.c* 文件提供工作案例参考。 ![cw memwatch output](http://images.techhive.com/images/article/2015/11/cw_memwatch_output-100627038-large.idge.png) Memwatch -不同于Mtrace,Memwatch的输出产生的日志文件(通常是memwatch.log)是人类可阅读格式。而且,Memwatch每次运行时总会拼接内存调试输出到此文件末尾,而不是进行覆盖(译改)。如此便可在需要之时,轻松查看之前的输出信息。 +不同于 Mtrace , Memwatch 的输出产生的日志文件(通常是 *memwatch.log* )是人类可阅读格式。而且, Memwatch 每次运行时总会拼接内存调试输出到文件末尾。如此便可在需要之时,轻松查看之前的输出信息。 -同样值得一提的是当你执行了启用Memwatch的程序,Memwatch会在[标准输出][34]中产生一个单行输出,告知发现了错误,然后你可以在日志文件中查看输出细节。如果没有产生错误信息,就可以确保日志文件不会写入任何错误,多次运行的话能实际节省时间。 +同样值得一提的是当你执行了启用 Memwatch 的程序, Memwatch 会在[标准输出][34]中产生一个单行输出,告知发现了错误,然后你可以在日志文件中查看输出细节。如果没有产生错误信息,就可以确保日志文件不会写入任何错误,多次运行的话确实能节省时间。 -另一个我喜欢的优点是Memwatch同样在源码中提供一个方法,你可以据此获取Memwatch的输出信息,然后任由你进行处理(参考Memwatch源码中的mwSetOutFunc()函数获取更多有关的信息)。 +另一个我喜欢的优点是 Memwatch 还提供了在源码中获取其输出信息的方式,你可以获取信息,然后任由你进行处理(参考 Memwatch 源码中的 *mwSetOutFunc()* 函数获取更多有关的信息)。 #### 注意事项 #### -跟Mtrace和Dmalloc一样,Memwatch也需要你往你的源文件里增加代码:你需要把memwatch.h这个头文件包含进你的代码。而且,编译程序的时候,你需要连同memwatch.c一块编译;或者你可以把已经编译好的目标模块包含起来,然后在命令行定义MEMWATCH和MW_STDIO变量。不用说,想要在输出中定位行号,-g编译器选项也少不了。 +跟 Mtrace 和 Dmalloc 一样, Memwatch 也需要你往你的源文件里增加代码:你需要把 *memwatch.h* 这个头文件包含进你的代码。而且,编译程序的时候,你需要连同 *memwatch.c* 一块编译;或者你可以把已经编译好的目标模块包含起来,然后在命令行定义 *MEMWATCH* 和 *MW_STDIO* 变量。不用说,想要在输出中定位行号, -g 编译器选项也少不了。 -还有一些没有具备的特性。比如Memwatch不能检测出往一块已经被释放的内存写入操作,或是在分配的内存块之外的读取操作。而且,Memwatch也不是线程安全的。还有一点,正如我在开始时指出,在C++程序上运行Memwatch的结果是不能预料的。 +此外, Memwatch 缺少一些特性。比如 Memwatch 不能检测出往一块已经被释放的内存写入操作,或是在分配的内存块之外的读取操作。而且, Memwatch 也不是线程安全的。还有一点,正如我在开始时指出,在 C++ 程序上运行 Memwatch 的结果是不能预料的。 #### 总结 #### -Memcheck可以检测很多内存相关的问题,在处理C程序时是非常便捷的调试工具。因为源码小巧,所以可以从中了解Memcheck如何运转,有需要的话可以调试它,甚至可以根据自身需求扩展升级它的功能。 +Memcheck 可以检测很多内存相关的问题,在处理 C 程序时是非常便捷的调试工具。因为源码小巧,所以可以从中了解 Memcheck 如何运转,有需要的话可以调试它,甚至可以根据自身需求扩展升级它的功能。 ### [Mtrace][35] ### @@ -195,60 +195,60 @@ Memcheck可以检测很多内存相关的问题,在处理C程序时是非常 **点评版本**: 2.21 -**Linux支持**:所有种类 +**支持的 Linux**:所有种类 -**许可**:GNU通用公共许可证 +**许可**:GNU 通用公共许可证 -Mtrace是[GNU C库][36]中的一款内存调试工具,同时支持Linux C和C++程序,检测由malloc()和free()函数的不对等调用所引起的内存泄漏问题。 +Mtrace 是 [GNU C 库][36]中的一款内存调试工具,同时支持 Linux 上的 C 和 C++ 程序,检测由 *malloc()* 和 *free()* 函数的不对等调用所引起的内存泄漏问题。 ![cw mtrace output](http://images.techhive.com/images/article/2015/11/cw_mtrace-output-100627039-large.idge.png) Mtrace -Mtrace实现为对mtrace()函数的调用,跟踪程序中所有malloc/free调用,在用户指定的文件中记录相关信息。文件以一种机器可读的格式记录数据,所以有一个Perl脚本(同样命名为mtrace)用来把文件转换并展示为人类可读格式。 +Mtrace 实现为对 *mtrace()* 函数的调用,跟踪程序中所有 malloc/free 调用,并在用户指定的文件中记录相关信息。文件以一种机器可读的格式记录数据,所以有一个 Perl 脚本(同样命名为 mtrace )用来把文件转换并展示为人类可读格式。 #### 更新内容 #### -[Mtrace源码][37]和[Perl文件][38]同GNU C库(2.21版本)一起释出,除了更新版权日期,其它别无改动。 +[Mtrace 源码][37]和 [Perl 文件][38]同 GNU C 库( 2.21 版本)一起释出,除了更新版权日期,其它别无改动。 #### 有何优点 #### -Mtrace最优秀的特点是非常简单易学。你只需要了解在你的源码中如何以及何处添加mtrace()及其对立的muntrace()函数,还有如何使用Mtrace的Perl脚本。后者非常简单,只需要运行指令mtrace (例子见开头截图最后一条指令)。 +Mtrace 最优秀的特点是非常简单易学。你只需要了解在你的源码中如何以及何处添加mtrace()及其对立的muntrace()函数,还有如何使用Mtrace的Perl脚本。后者非常简单,只需要运行指令 *mtrace *(例子见开头截图最后一条指令)。 -Mtrace另外一个优点是它的可收缩性,体现在,不仅可以使用它来调试完整的程序,还可以使用它来检测程序中独立模块的内存泄漏。只需在每个模块里调用mtrace()和muntrace()即可。 +Mtrace 另外一个优点是它的可收缩性,体现在,不仅可以使用它来调试完整的程序,还可以使用它来检测程序中独立模块的内存泄漏。只需在每个模块里调用 *mtrace()* 和 *muntrace()* 即可。 -最后一点,因为Mtrace会在mtace()(在源码中添加的函数)执行时被触发,因此可以很灵活地[使用信号][39]动态地(在程序执行周期内)使能Mtrace。 +最后一点,因为 Mtrace 会在 *mtace()*(在源码中添加的函数)执行时被触发,因此可以很灵活地[使用信号][39]动态地(在程序执行周期内)使能 Mtrace 。 #### 注意事项 #### -因为mtrace()和mauntrace()函数(在mcheck.h文件中声明,所以必须在源码中包含此头文件)的调用是Mtrace运行(mauntrace()函数并非[总是必要][40])的根本,因此Mtrace要求程序员至少改动源码一次。 +因为 *mtrace()* 和 *mauntrace()* 函数(声明在 *mcheck.h* 文件中,所以必须在源码中包含此头文件)的调用是 Mtrace 运行( *mauntrace()* 函数并非[总是必要][40])的根本,因此 Mtrace 要求程序员至少改动源码一次。 -了解需要在编译程序的时候带上-g选项([GCC][41]和[G++][42]编译器均由提供),才能使调试工具在输出展示正确的行号。除此之外,有些程序(取决于源码体积有多大)可能会花很长时间进行编译。最后,带-g选项编译会增加了可执行文件的内存(因为提供了额外的调试信息),因此记得程序需要在测试结束,不带-g选项重新进行编译。 +需要注意的是,在编译程序的时候带上 -g 选项( [GCC][41] 和 [G++][42] 编译器均有提供),才能使调试工具在输出展示正确的行号。除此之外,有些程序(取决于源码体积有多大)可能会花很长时间进行编译。最后,带 -g 选项编译会增加了可执行文件的内存(因为提供了额外的调试信息),因此记得程序需要在测试结束后,不带 -g 选项重新进行编译。 -使用Mtrace,你需要掌握Linux环境变量的基本知识,因为在程序执行之前,需要把用户指定文件(mtrace()函数用以记载全部信息)的路径设置为环境变量MALLOC_TRACE的值。 +使用 Mtrace ,你需要掌握 Linux 环境变量的基本知识,因为在程序执行之前,需要把用户指定的文件( *mtrace()* 函数将会记录全部信息到其中)路径设置为环境变量 *MALLOC_TRACE* 的值。 -Mtrace在检测内存泄漏和尝试释放未经过分配的内存方面存在局限。它不能检测其它内存相关问题如非法内存访问、使用未初始化内存。而且,[有人抱怨][43]Mtrace不是[线程安全][44]的。 +Mtrace 在检测内存泄漏和尝试释放未经过分配的内存方面存在局限。它不能检测其它内存相关问题如非法内存访问、使用未初始化内存。而且,[有人抱怨][43] Mtrace 不是[线程安全][44]的。 ### 总结 ### 不言自明,我在此讨论的每款内存调试器都有其优点和局限。所以,哪一款适合你取决于你所需要的特性,虽然有时候容易安装和使用也是一个决定因素。 -要想捕获软件程序中的内存泄漏,Mtrace最适合不过了。它还可以节省时间。由于Linux系统已经预装了此工具,对于不能联网或者不可以下载第三方调试调试工具的情况,Mtrace也是极有助益的。 +要想捕获软件程序中的内存泄漏, Mtrace 最适合不过了。它还可以节省时间。由于 Linux 系统已经预装了此工具,对于不能联网或者不可以下载第三方调试调试工具的情况, Mtrace 也是极有助益的。 -另一方面,相比Mtrace,,Dmalloc不仅能检测更多错误类型,还你呢个提供更多特性,比如运行时可配置、GDB集成。而且,Dmalloc不像这里所说的其它工具,它是线程安全的。更不用说它的详细资料了,这让Dmalloc成为初学者的理想选择。 +另一方面,相比 Mtrace , Dmalloc 不仅能检测更多错误类型,还提供更多特性,比如运行时可配置、 GDB 集成。而且, Dmalloc 不像这里所说的其它工具,它是线程安全的。更不用说它的详细资料了,这让 Dmalloc 成为初学者的理想选择。 -虽然Memwatch的资料比Dmalloc的更加丰富,而且还能检测更多的错误种类,但是你只能在C语言写就的软件程序上使用它。一个让Memwatch脱颖而出的特性是它允许在你的程序源码中处理它的输出,这对于想要定制输出格式来说是非常有用的。 +虽然 Memwatch 的资料比 Dmalloc 的更加丰富,而且还能检测更多的错误种类,但是你只能在 C 语言写就的程序中使用它。一个让 Memwatch 脱颖而出的特性是它允许在你的程序源码中处理它的输出,这对于想要定制输出格式来说是非常有用的。 -如果改动程序源码非你所愿,那么使用Electric Fence吧。不过,请记住,Electric Fence只能检测两种错误类型,而此二者均非内存泄漏。还有就是,需要了解GDB基础以最大程序发挥这款内存调试工具的作用。 +如果改动程序源码非你所愿,那么使用 Electric Fence 吧。不过,请记住, Electric Fence 只能检测两种错误类型,而此二者均非内存泄漏。还有就是,需要了解 GDB 基础以最大化发挥这款内存调试工具的作用。 -Memcheck可能是这当中综合性最好的了。相比这里所说其它工具,它检测更多的错误类型,提供更多的特性,而且不需要你的源码做任何改动。但请注意,基本功能并不难上手,但是想要使用它的高级特性,就必须学习相关的专业知识了。 +Memcheck 可能是其中综合性最好的了。相比这里提及的其它工具,它能检测更多的错误类型,提供更多的特性,而且不需要你的源码做任何改动。但请注意,基本功能并不难上手,但是想要使用它的高级特性,就必须学习相关的专业知识了。 -------------------------------------------------------------------------------- via: http://www.computerworld.com/article/3003957/linux/review-5-memory-debuggers-for-linux-coding.html 作者:[Himanshu Arora][a] -译者:[译者ID](https://github.com/soooogreen) -校对:[校对者ID](https://github.com/校对者ID) +译者:[soooogreen](https://github.com/soooogreen) +校对:[PurlingNayuki](https://github.com/PurlingNayuki) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9bd6bcca6268335935b009839ec50bb7b23ad0d8 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 8 May 2016 21:36:04 +0800 Subject: [PATCH 0714/1469] PUB:20151019 Gaming On Linux--All You Need To Know @name1e5s @PurlingNayuki --- .../20151019 Gaming On Linux--All You Need To Know.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename {translated/talk => published}/20151019 Gaming On Linux--All You Need To Know.md (99%) diff --git a/translated/talk/20151019 Gaming On Linux--All You Need To Know.md b/published/20151019 Gaming On Linux--All You Need To Know.md similarity index 99% rename from translated/talk/20151019 Gaming On Linux--All You Need To Know.md rename to published/20151019 Gaming On Linux--All You Need To Know.md index b58f822c72..a7e3e9b91b 100644 --- a/translated/talk/20151019 Gaming On Linux--All You Need To Know.md +++ b/published/20151019 Gaming On Linux--All You Need To Know.md @@ -2,7 +2,7 @@ Linux上的游戏:所有你需要知道的 ================================================================================ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/10/Gaming-on-Linux.jpeg) -** 我能在 Linux 上玩游戏吗 ?** +**我能在 Linux 上玩游戏吗 ?** 这是打算[投奔 Linux 阵营][1]的人最经常问的问题之一。毕竟,在 Linux 上面玩游戏经常被认为有点难以实现。事实上,一些人甚至考虑他们能不能在 Linux 上看电影或者听音乐。考虑到这些,关于 Linux 的平台的游戏的问题是很现实的。 From 42b2b4903f45a8ff25317539cd9e76c706e6374a Mon Sep 17 00:00:00 2001 From: alim0x Date: Sun, 8 May 2016 22:17:09 +0800 Subject: [PATCH 0715/1469] [translated]20160301 The Evolving Markrt for ... --- ...ommercial Software Built On Open Source.md | 42 ------------------- ...ommercial Software Built On Open Source.md | 36 ++++++++++++++++ 2 files changed, 36 insertions(+), 42 deletions(-) delete mode 100644 sources/tech/20160301 The Evolving Market for Commercial Software Built On Open Source.md create mode 100644 translated/tech/20160301 The Evolving Market for Commercial Software Built On Open Source.md diff --git a/sources/tech/20160301 The Evolving Market for Commercial Software Built On Open Source.md b/sources/tech/20160301 The Evolving Market for Commercial Software Built On Open Source.md deleted file mode 100644 index 5cd6a2f1c1..0000000000 --- a/sources/tech/20160301 The Evolving Market for Commercial Software Built On Open Source.md +++ /dev/null @@ -1,42 +0,0 @@ -alim0x translating - -The Evolving Market for Commercial Software Built On Open Source -===================================================================== - -![](https://www.linux.com/images/stories/41373/Structure-event-photo.jpg) ->Attendees listen to a presentation during Structure at the UCSF Mission Bay Conference Center, where Structure Data 2016 will take place. Image credit: Structure Events. - -It's really hard to understate the impact of open source projects on the enterprise software market these days; open source integration became the norm so quickly we could be forgiven for missing the turning point. - -Hadoop, for example, changed more than just the world of data analysis. It gave rise to a new generation of data companies that created their own software around open source projects, tweaking and supporting that code as needed, much like how Red Hat embraced Linux in the 1990s and early 2000s. And this software is increasingly delivered over public clouds, rather than run on the buyer's own servers, enabling an amazing degree of operational flexibility but raising all sorts of new questions about licensing, support, and pricing. - -We've been following this closely over the years when putting together the lineup for our Structure Data conference, and Structure Data 2016 is no exception. The CEOs of three of the most important companies in big data operating around Hadoop -- Hortonworks, Cloudera and MapR -- will share the stage to discuss how they sell enterprise software and services around open source projects, generating cash while giving back to that community project at the same time. - -There was a time when making money on enterprise software was easier. Once purchased by a customer, a mega-package of software from an enterprise vendor turned into its own cash register, generating something close to lifetime income from maintenance contracts and periodic upgrades to software that became harder and harder to displace as it became the heart of a customer’s business. Customers grumbled about lock-in, but they didn't really have much of a choice if they wanted to make their workforce more productive. - -That is no longer the case. While an awful lot of companies are still stuck running immense software packages critical to their infrastructure, new projects are being deployed on cloud servers using open source technologies. This makes it much easier to upgrade one's capabilities without having to rip out a huge software package and reinstall something else, and it also allows companies to pay as they go, rather than paying for a bunch of features they'll never use. - -And there are a lot of customers who want to take advantage of open source projects without building and supporting a team of engineers to tweak one of those projects for their own unique needs. Those customers are willing to pay for software packages whose value is based on the delta between the open source projects and the proprietary features laid on top of that project. - -This is especially true for infrastructure-related software. Sure, your customers could install their own tweaks to a project like Hadoop or Spark or Node.js, but there's money to be made helping those customers out with a customizable package that lets them implement some of today's vital open source technologies without having to do all of the heavy lifting themselves. Just look at Structure Data 2016 presenters such as Confluent (Kafka), Databricks (Spark), and the Cloudera-Hortonworks-MapR (Hadoop) trio. - -There's certainly something to be said for having a vendor to yell at when things go wrong. If your engineers botch the implementation of an open source project, you've only yourself to blame. But If you contract with a company that is willing to guarantee certain performance and uptime metrics inside of a service-level agreement, you're willing to pay for support, guidance, and a chance to yell at somebody outside of your organization when inevitable problems crop up. - -The evolving market for commercial software on top of open source projects is something we've been tracking at Structure Data for years, and we urge you to join us in San Francisco March 9 and 10 if this is a topic near and dear to your heart. - - --------------------------------------------------------------------------------- - -via: https://www.linux.com/news/enterprise/cloud-computing/889564-the-evolving-market-for-commercial-software-built-on-open-source- - -作者:[Tom Krazit ][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.linux.com/community/forums/person/70513 - - - - diff --git a/translated/tech/20160301 The Evolving Market for Commercial Software Built On Open Source.md b/translated/tech/20160301 The Evolving Market for Commercial Software Built On Open Source.md new file mode 100644 index 0000000000..c45b3eb760 --- /dev/null +++ b/translated/tech/20160301 The Evolving Market for Commercial Software Built On Open Source.md @@ -0,0 +1,36 @@ +构建在开源之上的商业软件市场持续成长 +===================================================================== + +![](https://www.linux.com/images/stories/41373/Structure-event-photo.jpg) +> 与会者在 Structure 上听取演讲,Structure Data 2016 也将在 UCSF Mission Bay 会议中心举办。图片来源:Structure Events。 + +如今真的很难低估开源项目对于企业软件市场的影响;开源集成如此快速地形成了规范,我们没能捕捉到转折点也情有可原。 + +举个例子,Hadoop,改变的不止是数据分析的世界。它引领了新一代数据公司,它们围绕开源项目创造自己的软件,按需调整和支持那些代码,更像红帽在 90 年代和 21 世纪早期拥抱 Linux 那样。软件越来越多地通过公有云交付,而不是购买者自己的服务器,拥有了令人惊奇的操作灵活性,但同时也带来了一些关于授权,支持以及价格之类的新问题。 + +我们多年来持续追踪这个趋势,它们组成了我们的 Structure Data 会议,而 Structure Data 2016 也不例外。三家围绕 Hadoop 最重要的大数据公司——Hortonworks,Cloudera 和 MapR——的 CEO 将会共同讨论它们是如何销售他们围绕开源项目的企业软件和服务,获利的同时回报那个社区项目。 + +以前在企业软件上获利是很容易的事情。一个客户购买了之后,企业供应商的一系列大型软件就变成了它自己的收银机,从维护合同和阶段性升级中获得近乎终生的收入,软件也越来越难以被替代,因为它已经成为了客户的业务核心。客户抱怨这种绑定,但如果它们想提高工作队伍的生产力也确实没有多少选择。 + +而现在的情况不再是这样了。尽管无数的公司还陷于在他们的基础设施上运行至关重要的巨大软件包,新的项目被使用开源技术部署到云服务器上。这让升级功能不再需要去掉大量软件包再重新安装别的,同时也让公司按需付费,而不是为一堆永远用不到的特性买单。 + +有很多客户想要利用开源项目的优势,而又不想建立和支持一支工程师队伍来调整开源项目以满足自己的需求。这些客户愿意为开源项目和在这之上的专有特性之间的差异付费。 + +这对于基础设施相关的软件来说格外正确。当然,你的客户们可以安装他们自己对项目的调整,比如 Hadoop,Spark 或 Node.js,但付费可以帮助他们自定义包部署如今重要的开源技术而不用自己干这些活儿。只需看看 Structure Data 2016 的发言者就明白了,比如 Confluent(Kafka),Databricks(Spark),以及 Cloudera-Hortonworks-MapR(Hadoop)三人组。 + +当然还有一个值得提到的是在出错的时候有个供应商给你指责。如果你的工程师弄糟了开源项目的实现,那你只能怪你自己了。但是如果你和一个愿意保证在服务级别的特定性能和正常运行时间指标的公司签订了合同,你就是愿意为支持,指导,以及在突然出现不可避免的问题时朝你公司外的人发火的机会买单。 + +构建在开源之上的商业软件市场的持续成长是我们在 Structure Data 上追踪多年的内容,如果这个话题正合你意,我们鼓励你加入我们,在旧金山,3 月 9 日和 10 日。 + + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/enterprise/cloud-computing/889564-the-evolving-market-for-commercial-software-built-on-open-source- + +作者:[Tom Krazit ][a] +译者:[alim0x](https://github.com/alim0x) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/community/forums/person/70513 From 024fc67a61b6472a2118833a226d52339379d83b Mon Sep 17 00:00:00 2001 From: ezio Date: Mon, 9 May 2016 10:24:10 +0800 Subject: [PATCH 0716/1469] rename for windows users --- ...container.md => Part 3 - LXD 2.0--Your first LXD container.md} | 0 ... Resource control.md => Part 4 - LXD 2.0--Resource control.md} | 0 ... Image management.md => Part 5 - LXD 2.0--Image management.md} | 0 ... => Part 6 - LXD 2.0--Remote hosts and container migration.md} | 0 ...D 2.0: Docker in LXD.md => Part 7 - LXD 2.0--Docker in LXD.md} | 0 ...8 - LXD 2.0: LXD in LXD.md => Part 8 - LXD 2.0--LXD in LXD.md} | 0 ...2.0: Live migration.md => Part 9 - LXD 2.0--Live migration.md} | 0 ...duction to LXD.md => Part 1 - LXD 2.0--Introduction to LXD.md} | 0 ...LXD.md => Part 2 - LXD 2.0--Installing and configuring LXD.md} | 0 9 files changed, 0 insertions(+), 0 deletions(-) rename sources/tech/LXD/{Part 3 - LXD 2.0: Your first LXD container.md => Part 3 - LXD 2.0--Your first LXD container.md} (100%) rename sources/tech/LXD/{Part 4 - LXD 2.0: Resource control.md => Part 4 - LXD 2.0--Resource control.md} (100%) rename sources/tech/LXD/{Part 5 - LXD 2.0: Image management.md => Part 5 - LXD 2.0--Image management.md} (100%) rename sources/tech/LXD/{Part 6 - LXD 2.0: Remote hosts and container migration.md => Part 6 - LXD 2.0--Remote hosts and container migration.md} (100%) rename sources/tech/LXD/{Part 7 - LXD 2.0: Docker in LXD.md => Part 7 - LXD 2.0--Docker in LXD.md} (100%) rename sources/tech/LXD/{Part 8 - LXD 2.0: LXD in LXD.md => Part 8 - LXD 2.0--LXD in LXD.md} (100%) rename sources/tech/LXD/{Part 9 - LXD 2.0: Live migration.md => Part 9 - LXD 2.0--Live migration.md} (100%) rename translated/tech/LXD/{Part 1 - LXD 2.0: Introduction to LXD.md => Part 1 - LXD 2.0--Introduction to LXD.md} (100%) rename translated/tech/LXD/{Part 2 - LXD 2.0: Installing and configuring LXD.md => Part 2 - LXD 2.0--Installing and configuring LXD.md} (100%) diff --git a/sources/tech/LXD/Part 3 - LXD 2.0: Your first LXD container.md b/sources/tech/LXD/Part 3 - LXD 2.0--Your first LXD container.md similarity index 100% rename from sources/tech/LXD/Part 3 - LXD 2.0: Your first LXD container.md rename to sources/tech/LXD/Part 3 - LXD 2.0--Your first LXD container.md diff --git a/sources/tech/LXD/Part 4 - LXD 2.0: Resource control.md b/sources/tech/LXD/Part 4 - LXD 2.0--Resource control.md similarity index 100% rename from sources/tech/LXD/Part 4 - LXD 2.0: Resource control.md rename to sources/tech/LXD/Part 4 - LXD 2.0--Resource control.md diff --git a/sources/tech/LXD/Part 5 - LXD 2.0: Image management.md b/sources/tech/LXD/Part 5 - LXD 2.0--Image management.md similarity index 100% rename from sources/tech/LXD/Part 5 - LXD 2.0: Image management.md rename to sources/tech/LXD/Part 5 - LXD 2.0--Image management.md diff --git a/sources/tech/LXD/Part 6 - LXD 2.0: Remote hosts and container migration.md b/sources/tech/LXD/Part 6 - LXD 2.0--Remote hosts and container migration.md similarity index 100% rename from sources/tech/LXD/Part 6 - LXD 2.0: Remote hosts and container migration.md rename to sources/tech/LXD/Part 6 - LXD 2.0--Remote hosts and container migration.md diff --git a/sources/tech/LXD/Part 7 - LXD 2.0: Docker in LXD.md b/sources/tech/LXD/Part 7 - LXD 2.0--Docker in LXD.md similarity index 100% rename from sources/tech/LXD/Part 7 - LXD 2.0: Docker in LXD.md rename to sources/tech/LXD/Part 7 - LXD 2.0--Docker in LXD.md diff --git a/sources/tech/LXD/Part 8 - LXD 2.0: LXD in LXD.md b/sources/tech/LXD/Part 8 - LXD 2.0--LXD in LXD.md similarity index 100% rename from sources/tech/LXD/Part 8 - LXD 2.0: LXD in LXD.md rename to sources/tech/LXD/Part 8 - LXD 2.0--LXD in LXD.md diff --git a/sources/tech/LXD/Part 9 - LXD 2.0: Live migration.md b/sources/tech/LXD/Part 9 - LXD 2.0--Live migration.md similarity index 100% rename from sources/tech/LXD/Part 9 - LXD 2.0: Live migration.md rename to sources/tech/LXD/Part 9 - LXD 2.0--Live migration.md diff --git a/translated/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md b/translated/tech/LXD/Part 1 - LXD 2.0--Introduction to LXD.md similarity index 100% rename from translated/tech/LXD/Part 1 - LXD 2.0: Introduction to LXD.md rename to translated/tech/LXD/Part 1 - LXD 2.0--Introduction to LXD.md diff --git a/translated/tech/LXD/Part 2 - LXD 2.0: Installing and configuring LXD.md b/translated/tech/LXD/Part 2 - LXD 2.0--Installing and configuring LXD.md similarity index 100% rename from translated/tech/LXD/Part 2 - LXD 2.0: Installing and configuring LXD.md rename to translated/tech/LXD/Part 2 - LXD 2.0--Installing and configuring LXD.md From 73b06dc23e34ba2afde01eb3288894a06fe33fce Mon Sep 17 00:00:00 2001 From: ezio Date: Mon, 9 May 2016 10:35:29 +0800 Subject: [PATCH 0717/1469] =?UTF-8?q?=E5=9B=9E=E6=94=B6=E8=BF=87=E6=9C=9F?= =?UTF-8?q?=E6=96=87=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ng List of Raspberry Pi 2 Distributions.md | 68 ----------------- ...e Becomes Real With First Ubuntu Tablet.md | 73 ------------------- 2 files changed, 141 deletions(-) delete mode 100644 sources/tech/20160218 Tizen 3.0 Joins Growing List of Raspberry Pi 2 Distributions.md delete mode 100644 sources/tech/20160220 Convergence Becomes Real With First Ubuntu Tablet.md diff --git a/sources/tech/20160218 Tizen 3.0 Joins Growing List of Raspberry Pi 2 Distributions.md b/sources/tech/20160218 Tizen 3.0 Joins Growing List of Raspberry Pi 2 Distributions.md deleted file mode 100644 index 062fcae483..0000000000 --- a/sources/tech/20160218 Tizen 3.0 Joins Growing List of Raspberry Pi 2 Distributions.md +++ /dev/null @@ -1,68 +0,0 @@ -Tizen 3.0 Joins Growing List of Raspberry Pi 2 Distributions -============================================================== - -Last week’s news that Tizen 3.0 has been ported to the Raspberry Pi 2 Model B is the latest example of how the year-old ARMv7 version of the Pi is attracting ports from more powerful Linux distributions, most notably Fedora, Ubuntu MATE, and Snappy. The [Samsung Open Source Group’s Tizen for Pi][1] project has been underway for several years, achieving several beta releases, and now the effort has shifted to the new Tizen 3.0. It’s still in beta, but now you can create builds for the Pi 2 using tools from the [Yocto][2] Project and [OpenEmbedded project][3]. - -Tizen 3.0 offers performance and security improvements, multiple-user and 64-bit support, and an Internet of Things (IoT) framework. Samsung, the principal backer of the [Linux Foundation hosted Tizen project][4], is using the Pi port to expand the base of developers using Tizen for IoT projects, according to an [IDG News Service post][5] that reported on the port. - -Although Samsung finally [shipped a Tizen-based][6] phone in India last summer, and Gear smartwatches continue to use Tizen, the main focus now appears to be on IoT. At CES last month, Samsung [announced][7] that all of its Tizen-based, 2016 Smart TVs will be able to act as SmartThings home automation hubs, letting users monitor the household while watching TV. - -### The Growing List of Pi Distros - -[Elinux.org][8] lists some 46 ARMv6-ready distributions that run on all the Raspberry Pi boards. A separate listing notes two ARMv7-only distros that require the ARMv7 Raspberry Pi 2: Ubuntu MATE, which replaces the resource-intensive Unity desktop with the Gnome 2.0 flavored MATE, and Windows 10 IoT Core. The prominent placement of a Microsoft distribution is not as controversial as one might have thought. To many younger Linux developers and casual Pi hackers, Microsoft is just another tech company, not so much the evil empire loathed by old-time Linux hackers. - -Windows 10 IoT Core isn’t the only non-Linux distro running on the Pi. There’s also the Unix-like FreeBSD and NetBSD, as well as the revived RISC OS Pi version of the old Acorn Computers OS. Some of the 48 operating systems on the Elinux.org list are incomplete, out-of-date, or dedicated to limited niches. [DistroWatch][9] offers a more manageable list of 20. - -The [Raspberry Pi Foundation][10] still prominently posts a download page for its homegrown, Debian-based Raspbian, in both standard and NOOBS packages. This lightweight distro is still the most popular and typically the highest rated Linux build for the Pi. The Scratch-ready distro is especially equally suited for desktop use and embedded hacking with home automation gear, robots, and other IoT gizmos. Raspbian recently [received an update][11] with an experimental OpenGL driver for doing hardware acceleration on the VideoCore IV GPU used with the Pi 2’s Broadcom BCM2836 SoC. - -The Pi Foundation also lists several [third-party downloads][12]. In addition to Windows 10 IoT Core and and Ubuntu MATE, the list includes the lightweight, transactionally focused [Snappy Ubuntu Core][13] for the Pi 2. Canonical is aiming Snappy at those who want an app platform and cloud integration in embedded devices like drones and IoT devices. Snappy also came out last week in a version designed for [Intel NUC mini-PCs][14]. The Pi Foundation also posts images for RISC OS and the education-focused PINET. There are also two media center distros related to KODI/XBMC: OSMC and OpenElec. - -In addition to its list of 48 released distros, Elinux.org lists several “announced” distros including Firefox OS, [openSUSE][15], Meego MER & XBMC, Puppy, RPi-Buildroot, and Aros. Missing, however, is Tizen, as well as newly announced ports such as [Manjaro-ARM][16] and the CentOS 7-based [CentOS AltArch 7][17] for the Pi 2, Banana Pi, and CubieTruck SBCs. - -### Android Still Pi in the Sky - -Elinux.org’s “announced” list also includes Android and a Miracast-like program called Android Transporter. People have been trying to port Android to the Pi for years; yet, even with the more suitable [Pi 2][18] shipping for a year now, Android is still pretty much a no-show. Android can run on lower-powered SoCs than the Pi 2’s quad-core, Cortex-A7, but the limited 1GB of RAM and the lack of GPU acceleration are big challenges. Perhaps Raspbian’s OpenGL driver could be ported to Android as well, although the Pi Foundation does not seem very interested in Android. - -There are several Android-for-Pi projects in the works, but without the foundation’s backing, there is still nothing close to a complete port. Projects include an [AOSP Marshmallow][19] patch-set from Peter Yoon, as well as a [RaspAnd][20] release based on the Ubuntu-based RaspEx, which makes use of the Aptoide package manager to load some Android 5.1 apps on a Pi 2. The [Razdroid project][21], which aims to tap into the secrets of Broadcom hardware acceleration, seems to have stalled. - -Most Rasp Pi users, however, appear more interested in [Ubuntu MATE][22], which was never optimized for ARMv6, and Fedora. For years, Pi users have run the lightweight spin-down of Fedora called Pidora, but with the Pi 2, they can now try the real thing. The Raspberry Pi Foundation has yet to post Fedora, but the recent [betas of the Pi 2 port][23] have received high marks. - -Other Linux distributions that regularly make Top Pi distro lists include Arch Linux, which unlike most ports from mature Linux distros, works just fine on ARMv6. A recent [TechRadar Top 5 list][24] includes several more niche distros in addition to Raspbian. These include the OSMC media player environment, RetroPie for playing classic games, OpenMediaVault for turning your Pi into a NAS, and Pi MusicBox, based on the Mopidy music streaming server. - -Beyond Ubuntu, Fedora, and Tizen, other distros, both arcane and general, are heading for the Pi 2, as well. The platform is rapidly expanding the boundaries of, as well as redefining the meaning of, desktop Linux. - ------------------------------------------------------------------------------- - -via: http://www.linux.com/news/embedded-mobile/mobile-linux/886126-tizen-30-joins-growing-list-of-raspberry-pi-2-distros - -作者:[Eric Brown][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/42808 -[1]:http://blogs.s-osg.org/bringing-tizen-to-a-raspberry-pi-2-near-you/ -[2]:https://www.yoctoproject.org/ -[3]:http://www.openembedded.org/wiki/Main_Page -[4]:https://www.tizen.org/ -[5]:http://www.cio.com/article/3031812/samsung-hopes-raspberry-pi-can-spread-tizen-os-adoption.html -[6]:http://www.linux.com/news/embedded-mobile/mobile-linux/837843-samsung-sells-a-million-tizen-phones-as-mozilla-rethinks-firefox-os -[7]:http://www.linux.com/news/embedded-mobile/mobile-linux/877879-linux-based-drones-upstage-other-mobile-gadgets-at-ces -[8]:http://elinux.org/RPi_Distributions -[9]:https://distrowatch.com/search.php?category=Raspberry+Pi -[10]:https://www.raspberrypi.org/ -[11]:http://news.softpedia.com/news/raspbian-gets-experimental-opengl-driver-gpu-now-used-for-acceleration-500152.shtml -[12]:https://www.raspberrypi.org/downloads/ -[13]:http://www.linux.com/news/embedded-mobile/mobile-linux/804659-ubuntu-snappy-leads-mobile-linux-migration-to-iot -[14]:https://insights.ubuntu.com/2016/02/10/ubuntu-core-is-available-for-the-intel-nuc/ -[15]:https://www.reddit.com/r/openSUSE/comments/3hxrz4/opensuse_on_a_raspberry_pi_2_armv7/ -[16]:http://www.linux-arm.info/index.php/1103-hands-on-more-adventures-with-manjaro-arm-for-the-raspberry-pi-2 -[17]:http://www.linux-arm.info/index.php/1054-centos-altarch-7-now-available-for-aarch64-powerpc64-powerpc8-le-and-armhfp -[18]:http://www.linux.com/news/embedded-mobile/mobile-linux/807087-faster-raspberry-pi-2-says-yes-to-ubuntu-and-windows-but-wheres-android -[19]:http://www.linux.com/news/embedded-mobile/mobile-linux/886126-tizen-30-joins-growing-list-of-raspberry-pi-2-distros#!topic/android-rpi/YW_gGr8wZkk -[20]:https://extonlinux.wordpress.com/2015/04/05/run-android-5-1-lollipop-exton-build-on-your-raspberry-pi-2/ -[21]:https://www.raspberrypi.org/forums/viewtopic.php?f=73&t=19106 -[22]:https://ubuntu-mate.org/raspberry-pi/ -[23]:https://chisight.wordpress.com/2015/10/19/fedora-22-or-23-on-raspberry-pi-2/ -[24]:http://www.techradar.com/us/news/software/5-of-the-most-popular-raspberry-pi-distros-1292537 diff --git a/sources/tech/20160220 Convergence Becomes Real With First Ubuntu Tablet.md b/sources/tech/20160220 Convergence Becomes Real With First Ubuntu Tablet.md deleted file mode 100644 index a7beb58156..0000000000 --- a/sources/tech/20160220 Convergence Becomes Real With First Ubuntu Tablet.md +++ /dev/null @@ -1,73 +0,0 @@ -Convergence Becomes Real With First Ubuntu Tablet -==================================================== - -![](http://itsfoss.com/wp-content/uploads/2016/02/front-landscape-1-e1454624669422.jpg) - -First Ubuntu tablet has been just announced. Canonical, parent company of Ubuntu, and Spanish hardware manufacturer BQ are all set to unveil the first Ubuntu tablet at Mobile World Congress, later this month. - -BQ is also the manufacturer of the [first Ubuntu Phone](http://itsfoss.com/ubuntu-phone-specification-release-date-pricing/). The partnership between Canonical and BQ extends to the tablet as well. - -Ubuntu has been running the [#reinvent campaign on social media](https://business.facebook.com/media/set/?set=a.656637987810305.1073741827.115098615297581&type=3) and the web ahead of the launch to generate curiosity over the tablet. But does an Ubuntu fan really need a dedicated campaign to know about such things? I think not. - -Ahead of this launch, specifications of the Ubuntu tablet and some teasers have been released. No surprises that the main focus has been on [convergence](https://insights.ubuntu.com/2015/10/20/ubuntus-path-to-convergence/). - -[Ubuntu Phone has demonstrated convergence](http://www.omgubuntu.co.uk/2015/02/new-video-shows-off-ubuntu-convergence-demoed-on-tablet-phone) several times in the past. Ubuntu tablet takes it to the next level. Just adding an HDMI cable makes it to a full-fledged desktop. All you need is a keyboard and a mouse. - -![](http://itsfoss.com/wp-content/uploads/2016/02/convergence-ubuntu-e1454624459103.jpg) - -## BQ Ubuntu tablet specification - -BQ will be using its trusted [Aquaris M10](http://www.bq.com/es/aquaris-m10) series to launch an Ubuntu edition. This is a strategy they used earlier with Ubuntu Phone where they launched an Ubuntu edition of their Aquaris e4.5 Android smartphone. - -Aquaris M10 boasts of a decent hardware and an enormous 10 inches screen size. A quick list of specification includes: - -- 10.1 inch multi-touch screen -- MediaTek Quad Core MT8163A processor up to 1.5GHz -- High capacity Li-Po battery (7280mAh) -- Full HD (1080p) camera for super-sharp video recording -- 2GB RAM and 16GB internal memory -- MicroSD slot for extra storage (up to 64GB) -- 12 megapixel camera with autofocus and dual flash -- Frontal speakers -- Micro HDMI slot -- Dimensions: 246 x 171 x 8.2mm -- Lightweight at only 470g - -These proposed specifications have been taken from Ubuntu’s official website which doesn’t match up with the Aquaris M10 specification on BQ website though. Ubuntu website shows a 12 MP camera while BQ website has 8 MP max. - -As you can see, first Ubuntu tablet is not really a power horse. In 2016, 2GB of RAM doesn’t seem to be sufficient. Moreover, the closed source MediaTek processors are another let down of the first Ubuntu Phone. - -However, a supposed price tag of Euro 260 (the Android version costs the same) is a positive factor here and considering its capability to converge into a desktop, 10 inches screen keeps it in the entry level Netbook section. - -The 470 g weight is another plus factor. - -## First look at Ubuntu tablet - -While Ubuntu tablet will be officially unveiled at Mobile World Congress, you can have a glimpse of its looks and functionings in the pictures below: - -![](http://itsfoss.com/wp-content/uploads/2016/02/tablet-overview-hero-300x182.png) - -## Price, availability and release date - -BQ Aquaris M10 Ubuntu edition will go on sale in the second quarter of the year 2016. Guessing from Ubuntu Phone experience, it should be available for Europe and UK first and later in other parts of the world. - -The price should be around 260-270 Euro. This too is an estimate based on the price of the Android version. - -## Up for the grab? - -I was not very convinced at the first Ubuntu Phone. However, I think Ubuntu tablet is a better device than the Ubuntu Phone. With Snappy coming in action, Ubuntu tablet has the potential to become a mobile device cum desktop. - -What do you think of it? - ------------------------------------------------------------------------------- - -via: http://itsfoss.com/ubuntu-tablet/ - -作者:[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/ - From 30c8e2f46aba4cb58a4e99d7465a6390510c33cf Mon Sep 17 00:00:00 2001 From: tinyeyeser Date: Mon, 9 May 2016 11:30:31 +0800 Subject: [PATCH 0718/1469] =?UTF-8?q?=E5=B7=B2=E6=A0=A1=E5=AF=B9=20by?= =?UTF-8?q?=E5=B0=8F=E7=9C=BC=E5=84=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Doubly linked list in the Linux Kernel.md | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/translated/tech/20151122 Doubly linked list in the Linux Kernel.md b/translated/tech/20151122 Doubly linked list in the Linux Kernel.md index 631d918813..c11e968a18 100644 --- a/translated/tech/20151122 Doubly linked list in the Linux Kernel.md +++ b/translated/tech/20151122 Doubly linked list in the Linux Kernel.md @@ -5,7 +5,7 @@ Linux 内核里的数据结构——双向链表 -------------------------------------------------------------------------------- -Linux 内核自己实现了双向链表,可以在[include/linux/list.h](https://github.com/torvalds/linux/blob/master/include/linux/list.h)找到定义。我们将会从双向链表数据结构开始`内核的数据结构`。为什么?因为它在内核里使用的很广泛,你只需要在[free-electrons.com](http://lxr.free-electrons.com/ident?i=list_head) 检索一下就知道了。 +Linux 内核自己实现了双向链表,可以在[include/linux/list.h](https://github.com/torvalds/linux/blob/master/include/linux/list.h)找到定义。我们将会从双向链表数据结构开始介绍`内核里的数据结构`。为什么?因为它在内核里使用的很广泛,你只需要在[free-electrons.com](http://lxr.free-electrons.com/ident?i=list_head) 检索一下就知道了。 首先让我们看一下在[include/linux/types.h](https://github.com/torvalds/linux/blob/master/include/linux/types.h) 里的主结构体: @@ -25,7 +25,7 @@ struct GList { }; ``` -通常来说一个链表会包含一个指向某个项目的指针。但是内核的实现并没有这样做。所以问题来了:`链表在哪里保存数据呢?`。实际上内核里实现的链表实际上是`侵入式链表`。侵入式链表并不在节点内保存数据-节点仅仅包含指向前后节点的指针,然后把数据是附加到链表的。这就使得这个数据结构是通用的,使用起来就不需要考虑节点数据的类型了。 +通常来说一个链表结构会包含一个指向某个项目的指针。但是Linux内核中的链表实现并没有这样做。所以问题来了:`链表在哪里保存数据呢?`。实际上,内核里实现的链表是`侵入式链表`。侵入式链表并不在节点内保存数据-它的节点仅仅包含指向前后节点的指针,以及指向链表节点数据部分的指针——数据就是这样附加在链表上的。这就使得这个数据结构是通用的,使用起来就不需要考虑节点数据的类型了。 比如: @@ -36,7 +36,7 @@ struct nmi_desc { }; ``` -让我们看几个例子来理解一下在内核里是如何使用`list_head` 的。如上所述,在内核里有实在很多不同的地方用到了链表。我们来看一个在杂项字符驱动里面的使用的例子。在 [drivers/char/misc.c](https://github.com/torvalds/linux/blob/master/drivers/char/misc.c) 的杂项字符驱动API 被用来编写处理小型硬件和虚拟设备的小驱动。这些驱动共享相同的主设备号: +让我们看几个例子来理解一下在内核里是如何使用`list_head` 的。如上所述,在内核里有很多很多不同的地方都用到了链表。我们来看一个在杂项字符驱动里面的使用的例子。在 [drivers/char/misc.c](https://github.com/torvalds/linux/blob/master/drivers/char/misc.c) 的杂项字符驱动API 被用来编写处理小型硬件或虚拟设备的小驱动。这些驱动共享相同的主设备号: ```C #define MISC_MAJOR 10 @@ -84,7 +84,7 @@ struct miscdevice }; ``` -可以看到结构体的第四个变量`list` 是所有注册过的设备的链表。在源代码文件的开始可以看到这个链表的定义: +可以看到结构体`miscdevice`的第四个变量`list` 是所有注册过的设备的链表。在源代码文件的开始可以看到这个链表的定义: ```C static LIST_HEAD(misc_list); @@ -103,7 +103,7 @@ static LIST_HEAD(misc_list); #define LIST_HEAD_INIT(name) { &(name), &(name) } ``` -现在来看看注册杂项设备的函数`misc_register`。它在开始就用 `INIT_LIST_HEAD` 初始化了`miscdevice->list`。 +现在来看看注册杂项设备的函数`misc_register`。它在开始就用函数 `INIT_LIST_HEAD` 初始化了`miscdevice->list`。 ```C INIT_LIST_HEAD(&misc->list); @@ -119,13 +119,13 @@ static inline void INIT_LIST_HEAD(struct list_head *list) } ``` -在函数`device_create` 创建了设备后我们就用下面的语句将设备添加到设备链表: +接下来,在函数`device_create` 创建了设备后,我们就用下面的语句将设备添加到设备链表: ``` list_add(&misc->list, &misc_list); ``` -内核文件`list.h` 提供了项链表添加新项的API 接口。我们来看看它的实现: +内核文件`list.h` 提供了向链表添加新项的API 接口。我们来看看它的实现: ```C @@ -138,8 +138,8 @@ static inline void list_add(struct list_head *new, struct list_head *head) 实际上就是使用3个指定的参数来调用了内部函数`__list_add`: * new - 新项。 -* head - 新项将会被添加到`head`之前. -* head->next - `head` 之后的项。 +* head - 新项将会插在`head`的后面 +* head->next - 插入前,`head` 后面的项。 `__list_add`的实现非常简单: @@ -155,9 +155,9 @@ static inline void __list_add(struct list_head *new, } ``` -我们会在`prev`和`next` 之间添加一个新项。所以我们用宏`LIST_HEAD_INIT`定义的`misc` 链表会包含指向`miscdevice->list` 的向前指针和向后指针。 +这里,我们在`prev`和`next` 之间添加了一个新项。所以我们开始时用宏`LIST_HEAD_INIT`定义的`misc` 链表会包含指向`miscdevice->list` 的向前指针和向后指针。 -这里有一个问题:如何得到列表的内容呢?这里有一个特殊的宏: +这儿还有一个问题:如何得到列表的内容呢?这里有一个特殊的宏: ```C #define list_entry(ptr, type, member) \ @@ -166,7 +166,7 @@ static inline void __list_add(struct list_head *new, 使用了三个参数: -* ptr - 指向链表头的指针; +* ptr - 指向结构 `list_head` 的指针; * type - 结构体类型; * member - 在结构体内类型为`list_head` 的变量的名字; @@ -207,7 +207,7 @@ int main() { 最终会打印`2` -下一点就是`typeof`,它也很简单。就如你从名字所理解的,它仅仅返回了给定变量的类型。当我第一次看到宏`container_of`的实现时,让我觉得最奇怪的就是`container_of`中的0.实际上这个指针巧妙的计算了从结构体特定变量的偏移,这里的`0`刚好就是位宽里的零偏移。让我们看一个简单的例子: +下一点就是`typeof`,它也很简单。就如你从名字所理解的,它仅仅返回了给定变量的类型。当我第一次看到宏`container_of`的实现时,让我觉得最奇怪的就是表达式`((type *)0)`中的0.实际上这个指针巧妙的计算了从结构体特定变量的偏移,这里的`0`刚好就是位宽里的零偏移。让我们看一个简单的例子: ```C #include @@ -226,13 +226,13 @@ int main() { 结果显示`0x5`。 -下一个宏`offsetof` 会计算从结构体的某个变量的相对于结构体起始地址的偏移。它的实现和上面类似: +下一个宏`offsetof`会计算从结构体起始地址到某个给定结构字段的偏移。它的实现和上面类似: ```C #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) ``` -现在我们来总结一下宏`container_of`。只需要知道结构体里面类型为`list_head` 的变量的名字和结构体容器的类型,它可以通过结构体的变量`list_head`获得结构体的起始地址。在宏定义的第一行,声明了一个指向结构体成员变量`ptr`的指针`__mptr`,并且把`ptr` 的地址赋给它。现在`ptr` 和`__mptr` 指向了同一个地址。从技术上讲我们并不需要这一行,但是它可以方便的进行类型检查。第一行保证了特定的结构体(参数`type`)包含成员变量`member`。第二行代码会用宏`offsetof`计算成员变量相对于结构体起始地址的偏移,然后从结构体的地址减去这个偏移,最后就得到了结构体。 +现在我们来总结一下宏`container_of`。只需给定结构体中`list_head`类型 字段的地址、名字和结构体容器的类型,它就可以返回结构体的起始地址。在宏定义的第一行,声明了一个指向结构体成员变量`ptr`的指针`__mptr`,并且把`ptr` 的地址赋给它。现在`ptr` 和`__mptr` 指向了同一个地址。从技术上讲我们并不需要这一行,但是它可以方便地进行类型检查。第一行保证了特定的结构体(参数`type`)包含成员变量`member`。第二行代码会用宏`offsetof`计算成员变量相对于结构体起始地址的偏移,然后从结构体的地址减去这个偏移,最后就得到了结构体。 当然了`list_add` 和 `list_entry`不是``提供的唯一功能。双向链表的实现还提供了如下API: From 3db59a8d65e75ee6291c67a556bc9f11494232d9 Mon Sep 17 00:00:00 2001 From: zpl1025 Date: Mon, 9 May 2016 11:44:35 +0800 Subject: [PATCH 0719/1469] [translating] 20160502 The intersection of Drupal, IoT, and open hardware.md --- ...0160502 The intersection of Drupal, IoT, and open hardware.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160502 The intersection of Drupal, IoT, and open hardware.md b/sources/tech/20160502 The intersection of Drupal, IoT, and open hardware.md index 751024fb3a..43ee75fae6 100644 --- a/sources/tech/20160502 The intersection of Drupal, IoT, and open hardware.md +++ b/sources/tech/20160502 The intersection of Drupal, IoT, and open hardware.md @@ -1,3 +1,4 @@ +zpl1025 The intersection of Drupal, IoT, and open hardware ======================================================= From bcb7787beec5881741db0cbde0efb7afbfb253cf Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 9 May 2016 10:19:43 +0800 Subject: [PATCH 0720/1469] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BA=86=E6=88=90?= =?UTF-8?q?=E5=91=98=E5=90=8D=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 76 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 46 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 7fbc7a5f36..cfa5aee47e 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ 简介 ------------------------------- -LCTT是“Linux中国”([http://linux.cn/](http://linux.cn/))的翻译组,负责从国外优秀媒体翻译Linux相关的技术、资讯、杂文等内容。 +LCTT是“Linux中国”([https://linux.cn/](https://linux.cn/))的翻译组,负责从国外优秀媒体翻译Linux相关的技术、资讯、杂文等内容。 -LCTT已经拥有近百余名活跃成员,并欢迎更多的Linux志愿者加入我们的团队。 +LCTT已经拥有几百名活跃成员,并欢迎更多的Linux志愿者加入我们的团队。 ![logo](http://img.linux.net.cn/static/image/common/lctt_logo.png) @@ -52,13 +52,15 @@ LCTT的组成 * 2015/04/19 发起 LFS-BOOK-7.7-systemd 项目。 * 2015/06/09 提升ictlyh和dongfengweixiao为Core Translators成员。 * 2015/11/10 提升strugglingyouth、FSSlc、Vic020、alim0x为Core Translators成员。 +* 2016/05/09 提升PurlingNayuki为校对。 活跃成员 ------------------------------- 目前 TP 活跃成员有: -- CORE @wxy, -- CORE @DeadFire, +- Leader @wxy, +- Source @oska874, +- Proofreader @PurlingNayuki, - CORE @geekpi, - CORE @GOLinux, - CORE @ictlyh, @@ -71,6 +73,7 @@ LCTT的组成 - CORE @Vic020, - CORE @dongfengweixiao, - CORE @alim0x, +- Senior @DeadFire, - Senior @reinoir, - Senior @tinyeyeser, - Senior @vito-L, @@ -80,41 +83,42 @@ LCTT的组成 - ZTinoZ, - theo-l, - luoxcat, -- disylee, +- martin2011qi, - wi-cuckoo, +- disylee, - haimingfg, - KayGuoWhu, - wwy-hust, -- martin2011qi, -- cvsher, +- felixonmars, - su-kaiyao, +- ivo-wang, +- GHLandy, +- cvsher, +- wyangsun, +- DongShuaike, - flsf, - SPccman, - Stevearzh +- mr-ping, - Linchenguang, -- oska874 - Linux-pdz, - 2q1w2007, -- felixonmars, -- wyangsun, -- MikeCoder, -- mr-ping, -- xiqingongzi - H-mudcup, -- zhangboyue, +- cposture, +- xiqingongzi, - goreliu, -- DongShuaike, +- NearTan, - TxmszLou, - ZhouJ-sh, - wangjiezhe, -- NearTan, - icybreaker, - shipsw, - johnhoow, +- soooogreen, - linuhap, -- boredivan, - blueabysm, -- liaoishere, +- boredivan, +- name1e5s, - yechunxiao19, - l3b2w1, - XLCYun, @@ -122,43 +126,55 @@ LCTT的组成 - tenght, - coloka, - luoyutiantang, -- yupmoon, +- sonofelice, - jiajia9linuxer, - scusjs, - tnuoccalanosrep, - woodboow, - 1w2b3l, +- JonathanKang, - crowner, - mtunique, - dingdongnigetou, - CNprober, -- JonathanKang, -- Medusar, - hyaocuk, - szrlee, +- KnightJoker, - Xuanwo, - nd0104, +- jerryling315, - xiaoyu33, - guodongxiaren, -- zzlyzq, -- yujianxuechuan, -- ailurus1991, +- ynmlml, +- kylepeng93, - ggaaooppeenngg, - Ricky-Gong, +- zky001, +- Flowsnow, - lfzark, - 213edu, - Tanete, - liuaiping, -- jerryling315, +- bestony, +- Timeszoro, +- rogetfan, +- itsang, +- JeffDing, +- Yuking-net, + +- MikeCoder, +- zhangboyue, +- liaoishere, +- yupmoon, +- Medusar, +- zzlyzq, +- yujianxuechuan, +- ailurus1991, - tomatoKiller, - stduolc, - shaohaolin, -- Timeszoro, -- rogetfan, - FineFan, - kingname, -- jasminepeng, -- JeffDing, - CHINAANSHE, (按提交行数排名前百) @@ -173,7 +189,7 @@ LFS 项目活跃成员有: - @KevinSJ - @Yuking-net -(更新于2015/11/29) +(更新于2016/05/09) 谢谢大家的支持! From fa862ff68404f9f1463db5df73edd9a1e2c31682 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 9 May 2016 11:49:30 +0800 Subject: [PATCH 0721/1469] PUB:20160204 An Introduction to SELinux @alim0x --- .../20160204 An Introduction to SELinux.md | 127 ++++++++++++++++ .../20160204 An Introduction to SELinux.md | 139 ------------------ 2 files changed, 127 insertions(+), 139 deletions(-) create mode 100644 published/20160204 An Introduction to SELinux.md delete mode 100644 translated/tech/20160204 An Introduction to SELinux.md diff --git a/published/20160204 An Introduction to SELinux.md b/published/20160204 An Introduction to SELinux.md new file mode 100644 index 0000000000..777a4094a0 --- /dev/null +++ b/published/20160204 An Introduction to SELinux.md @@ -0,0 +1,127 @@ +SELinux 入门 +=============================== + +回到 Kernel 2.6 时代,那时候引入了一个新的安全系统,用以提供访问控制安全策略的机制。这个系统就是 [Security Enhanced Linux (SELinux)][1],它是由[美国国家安全局(NSA)][2]贡献的,它为 Linux 内核子系统引入了一个健壮的强制控制访问(Mandatory Access Control)架构。 + +如果你在之前的 Linux 生涯中都禁用或忽略了 SELinux,这篇文章就是专门为你写的:这是一篇对存在于你的 Linux 桌面或服务器之下的 SELinux 系统的介绍,它能够限制权限,甚至消除程序或守护进程的脆弱性而造成破坏的可能性。 + +在我开始之前,你应该已经了解的是 SELinux 主要是红帽 Red Hat Linux 以及它的衍生发行版上的一个工具。类似地, Ubuntu 和 SUSE(以及它们的衍生发行版)使用的是 AppArmor。SELinux 和 AppArmor 有显著的不同。你可以在 SUSE,openSUSE,Ubuntu 等等发行版上安装 SELinux,但这是项难以置信的挑战,除非你十分精通 Linux。 + +说了这么多,让我来向你介绍 SELinux。 + +### DAC vs. MAC + +Linux 上传统的访问控制标准是自主访问控制(Discretionary Access Control,DAC)。在这种形式下,一个软件或守护进程以 User ID(UID)或 Set owner User ID(SUID)的身份运行,并且拥有该用户的目标(文件、套接字、以及其它进程)权限。这使得恶意代码很容易运行在特定权限之下,从而取得访问关键的子系统的权限。 + +另一方面,强制访问控制(Mandatory Access Control,MAC)基于保密性和完整性强制信息的隔离以限制破坏。该限制单元独立于传统的 Linux 安全机制运作,并且没有超级用户的概念。 + +### SELinux 如何工作 + +考虑一下 SELinux 的相关概念: + +- 主体(Subjects) +- 目标(Objects) +- 策略(Policy) +- 模式(Mode) + +当一个主体(Subject,如一个程序)尝试访问一个目标(Object,如一个文件),SELinux 安全服务器(SELinux Security Server,在内核中)从策略数据库(Policy Database)中运行一个检查。基于当前的模式(mode),如果 SELinux 安全服务器授予权限,该主体就能够访问该目标。如果 SELinux 安全服务器拒绝了权限,就会在 /var/log/messages 中记录一条拒绝信息。 + +听起来相对比较简单是不是?实际上过程要更加复杂,但为了简化介绍,只列出了重要的步骤。 + +### 模式 + +SELinux 有三个模式(可以由用户设置)。这些模式将规定 SELinux 在主体请求时如何应对。这些模式是: + +- Enforcing (强制)— SELinux 策略强制执行,基于 SELinux 策略规则授予或拒绝主体对目标的访问 +- Permissive (宽容)— SELinux 策略不强制执行,不实际拒绝访问,但会有拒绝信息写入日志 +- Disabled (禁用)— 完全禁用 SELinux + +![](https://www.linux.com/images/stories/66866/jack2-selinux_a.png) + +*图 1:getenforce 命令显示 SELinux 的状态是 Enforcing 启用状态。* + +默认情况下,大部分系统的 SELinux 设置为 Enforcing。你要如何知道你的系统当前是什么模式?你可以使用一条简单的命令来查看,这条命令就是 `getenforce`。这个命令用起来难以置信的简单(因为它仅仅用来报告 SELinux 的模式)。要使用这个工具,打开一个终端窗口并执行 `getenforce` 命令。命令会返回 Enforcing、Permissive,或者 Disabled(见上方图 1)。 + +设置 SELinux 的模式实际上很简单——取决于你想设置什么模式。记住:**永远不推荐关闭 SELinux**。为什么?当你这么做了,就会出现这种可能性:你磁盘上的文件可能会被打上错误的权限标签,需要你重新标记权限才能修复。而且你无法修改一个以 Disabled 模式启动的系统的模式。你的最佳模式是 Enforcing 或者 Permissive。 + +你可以从命令行或 `/etc/selinux/config` 文件更改 SELinux 的模式。要从命令行设置模式,你可以使用 `setenforce` 工具。要设置 Enforcing 模式,按下面这么做: + +1. 打开一个终端窗口 +2. 执行 `su` 然后输入你的管理员密码 +3. 执行 `setenforce 1` +4. 执行 `getenforce` 确定模式已经正确设置(图 2) + +![](https://www.linux.com/images/stories/66866/jack-selinux_b.png) + +*图 2:设置 SELinux 模式为 Enforcing。* + +要设置模式为 Permissive,这么做: + +1. 打开一个终端窗口 +2. 执行 `su` 然后输入你的管理员密码 +3. 执行 `setenforce 0` +4. 执行 `getenforce` 确定模式已经正确设置(图 3) + +![](https://www.linux.com/images/stories/66866/jack-selinux_c.png) + +*图 3:设置 SELinux 模式为 Permissive。* + +注:通过命令行设置模式会覆盖 SELinux 配置文件中的设置。 + +如果你更愿意在 SELinux 命令文件中设置模式,用你喜欢的编辑器打开那个文件找到这一行: + + SELINUX=permissive + +你可以按你的偏好设置模式,然后保存文件。 + +还有第三种方法修改 SELinux 的模式(通过 bootloader),但我不推荐新用户这么做。 + +### 策略类型 + +SELinux 策略有两种: + +- Targeted — 只有目标网络进程(dhcpd,httpd,named,nscd,ntpd,portmap,snmpd,squid,以及 syslogd)受保护 +- Strict — 对所有进程完全的 SELinux 保护 + +你可以在 `/etc/selinux/config` 文件中修改策略类型。用你喜欢的编辑器打开这个文件找到这一行: + + SELINUXTYPE=targeted + +修改这个选项为 targeted 或 strict 以满足你的需求。 + +### 检查完整的 SELinux 状态 + +有个方便的 SELinux 工具,你可能想要用它来获取你启用了 SELinux 的系统的详细状态报告。这个命令在终端像这样运行: + + sestatus -v + +你可以看到像图 4 那样的输出。 + +![](https://www.linux.com/images/stories/66866/jack-selinux_d.png) + +*图 4:sestatus -v 命令的输出。* + +### 仅是皮毛 + +和你预想的一样,我只介绍了 SELinux 的一点皮毛。SELinux 的确是个复杂的系统,想要更扎实地理解它是如何工作的,以及了解如何让它更好地为你的桌面或服务器工作需要更加地深入学习。我的内容还没有覆盖到疑难解答和创建自定义 SELinux 策略。 + +SELinux 是所有 Linux 管理员都应该知道的强大工具。现在已经向你介绍了 SELinux,我强烈推荐你回到 Linux.com(当有更多关于此话题的文章发表的时候)或看看 [NSA SELinux 文档][3] 获得更加深入的指南。 + +LCTT - 相关阅读:[鸟哥的 Linux 私房菜——程序管理与 SELinux 初探][4] + + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/learn/docs/ldp/883671-an-introduction-to-selinux + +作者:[Jack Wallen][a] +译者:[alim0x](https://github.com/alim0x) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.linux.com/community/forums/person/93 +[1]: http://selinuxproject.org/page/Main_Page +[2]: https://www.nsa.gov/research/selinux/ +[3]: https://www.nsa.gov/research/selinux/docs.shtml +[4]: http://vbird.dic.ksu.edu.tw/linux_basic/0440processcontrol_5.php diff --git a/translated/tech/20160204 An Introduction to SELinux.md b/translated/tech/20160204 An Introduction to SELinux.md deleted file mode 100644 index bc82106189..0000000000 --- a/translated/tech/20160204 An Introduction to SELinux.md +++ /dev/null @@ -1,139 +0,0 @@ -An Introduction to SELinux -=============================== - -![](https://www.linux.com/images/stories/66866/jack2-selinux_a.png) - ->图 1:getenforce 命令显示 SELinux 的状态是 Enforcing 启用状态。 - -回到 Kernel 2.6 时代,那时候引入了一个新的安全系统,用以提供访问控制安全策略的机制。这个系统就是 [Security Enhanced Linux (SELinux)][1],它是由[美国国家安全局(NSA)][2]引入的,合并进 Linux 内核子系统的强制控制访问架构实现。 - -如果你在你整个 Linux 生涯中禁用或忽略 SELinux,这篇文章就是为你量身定制的——对存在于你的 Linux 桌面或服务器之下的 SELinux 系统的介绍,它能够限制权限,甚至消除程序或守护进程的妥协而造成破坏的可能性。 - -在我开始之前,你应该了解的是 SELinux 主要是红帽 Red Hat Linux 以及它的衍生发行版的一个工具。这就类似 Ubuntu 和 SUSE(以及它们的衍生发行版)使用 AppArmor 一样。SELinux 和 AppArmor 有显著的不同。你可以在 SUSE,openSUSE,Ubuntu 等等发行版上安装 SELinux,但这是项难以置信的挑战,除非你十分精通 Linux。 - -说了这么多,让我来向你介绍 SELinux。 - -### DAC vs. MAC - -Linux 上保守的访问控制标准是自主访问控制(Discretionary Access Control,DAC)。在这种形式下,一个软件或守护进程运行在 User ID(UID)或 Set User ID(SUID)下,并且拥有该用户的目标权限(文件,套接字,以及其它进程)。这使得恶意代码很容易运行在特定权限之下,从而取得访问关键的子系统的权限。 - -另一方面,强制访问控制(Mandatory Access Control,MAC)基于保密性和完整性强制信息的隔离以限制破坏。限制单元相对于传统的 Linux 安全机制独立运作,并且没有超级用户的概念。 - -### SELinux 如何工作 - -考虑一下 SELinux 的相关概念: - -- Subjects 主体 - -- Objects 目标 - -- Policy 策略 - -- Mode 模式 - -当一个主体(Subject,如一个程序)尝试访问一个目标(Object,如一个文件),SELinux 安全服务器(SELinux Security Server,在内核中)从策略数据库中运行一个检查。基于当前的模式,如果 SELinux 安全服务器授予权限,该主体就能够访问该目标。如果 SELinux 安全服务器拒绝了权限,一条拒绝信息会被记录到 /var/log/messages。 - -听起来相对比较简单是不是?实际上过程要更加复杂,但为了简单介绍,这些是重要的步骤。 - -### 模式 - -SELinux 有三个模式(可以由用户设置)。这些模式将规定 SELinux 在主体请求时如何应对。这些模式是: - -- Enforcing — SELinux 策略强制执行,基于 SELinux 策略规则授予或拒绝主体对目标的访问 - -- Permissive — SELinux 策略不强制执行,不实际拒绝访问,但会有警告信息且拒绝会写入日志 - -- Disabled — 完全禁用 SELinux - -默认情况下,大部分系统的 SELinux 设置为 Enforcing。你要如何知道你的系统当前是什么模式?你可以使用一条简单的命令来查看,这条命令就是 getenforce。这个命令用起来难以置信的简单(因为它仅仅用来报告 SELinux 的模式)。要使用这个工具,打开一个终端窗口并执行 getenforce 命令。命令会返回 Enforcing,Permissive,或者 Disabled(见上方图 1)。 - -设置 SELinux 的模式实际上很简单——取决于你想设置什么模式。记住:永远不推荐关闭 SELinux。为什么?当你这么做了,你就有了这种可能性:你磁盘上的文件可能会被打上错误的标签,需要你重新标签来修复。而且你无法修改一个以 Disabled 模式启动的系统的模式。你的最佳模式是 Enforcing 或者 Permissive。 - -你可以从命令行或 /etc/selinux/config 文件更改 SELinux 的模式。要从命令行设置模式,你可以使用 setenforce 工具。要设置 Enforcing 模式,按下面这么做: - -1. 打开一个终端窗口 - -2. 执行 su 然后输入你的管理员密码 - -3. 执行 setenforce 1 - -4. 执行 getenforce 确定模式已经正确设置(图 2) - -![](https://www.linux.com/images/stories/66866/jack-selinux_b.png) - ->图 2:设置 SELinux 模式为 Enforcing。 - -要设置模式为 Permissive,这么做: - -1. 打开一个终端窗口 - -2. 执行 su 然后输入你的管理员密码 - -3. 执行 setenforce 0 - -4. 执行 getenforce 确定模式已经正确设置(图 3) - -![](https://www.linux.com/images/stories/66866/jack-selinux_c.png) - ->图 3:设置 SELinux 模式为 Permissive. - -注:通过命令行设置模式会覆盖 SELinux 配置文件中的设置。 - -如果你更愿意在 SELinux 命令文件中设置模式,用你喜欢的编辑器打开那个文件找到这一行: - ->SELINUX=permissive - -你可以按你的偏好设置模式,然后保存文件。 - -还有第三种方法修改 SELinux 的模式(通过 bootloader),但我不推荐新用户这么做。 - -### 策略类型 - -SELinux 策略有两种: - -- Targeted — 只有目标网络进程(dhcpd,httpd,named,nscd,ntpd,portmap,snmpd,squid,以及 syslogd)受保护 - -- Strict — 对所有进程完全的 SELinux 保护 - -你可以在 /etc/selinux/config 文件中修改策略类型。用你喜欢的编辑器打开这个文件找到这一行: - ->SELINUXTYPE=targeted - -修改这个选项为 targeted 或 strict 以满足你的需求。 - -### 检查完整的 SELinux 状态 - -有个方便的 SELinux 工具,你可能想要用它来获取你启用了 SELinux 的系统的详细状态报告。这个命令在终端像这样运行: - ->sestatus -v - -你可以看到像图 4 那样的输出。 - -![](https://www.linux.com/images/stories/66866/jack-selinux_d.png) - ->图 4:sestatus -v 命令的输出。 - -### 仅是皮毛 - -和你预想的一样,我只介绍了 SELinux 的一点皮毛。SELinux 的确是个复杂的系统,想要更扎实地理解它是如何工作的,以及了解如何让它更好地为你的桌面或服务器工作需要更加地深入。我的内容还没有覆盖到疑难解答和创建自定义 SELinux 策略。 - -SELinux 是所有 Linux 管理员都应该知道的强大工具。现在已经向你介绍了 SELinux,我强烈推荐你回到 Linux.com(当有更多关于此话题的文章发表的时候)或看看 [NSA SELinux 文档][3] 获得更加深入的指南。 - -LCTT - 相关阅读:[鸟哥的 Linux 私房菜——程序管理与 SELinux 初探][4] - - --------------------------------------------------------------------------------- - -via: https://www.linux.com/learn/docs/ldp/883671-an-introduction-to-selinux - -作者:[Jack Wallen][a] -译者:[alim0x](https://github.com/alim0x) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.linux.com/community/forums/person/93 -[1]: http://selinuxproject.org/page/Main_Page -[2]: https://www.nsa.gov/research/selinux/ -[3]: https://www.nsa.gov/research/selinux/docs.shtml -[4]: http://vbird.dic.ksu.edu.tw/linux_basic/0440processcontrol_5.php From 64d68242cb87e5c4cd87499f8190d40226ec2e0c Mon Sep 17 00:00:00 2001 From: tinyeyeser Date: Mon, 9 May 2016 14:53:51 +0800 Subject: [PATCH 0722/1469] =?UTF-8?q?=E5=B7=B2=E6=A0=A1=E5=AF=B9=20by?= =?UTF-8?q?=E5=B0=8F=E7=9C=BC=E5=84=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20151122 Doubly linked list in the Linux Kernel.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20151122 Doubly linked list in the Linux Kernel.md b/translated/tech/20151122 Doubly linked list in the Linux Kernel.md index c11e968a18..1a5772320e 100644 --- a/translated/tech/20151122 Doubly linked list in the Linux Kernel.md +++ b/translated/tech/20151122 Doubly linked list in the Linux Kernel.md @@ -253,6 +253,6 @@ int main() { via: https://github.com/0xAX/linux-insides/edit/master/DataStructures/dlist.md 译者:[Ezio](https://github.com/oska874) -校对:[校对者ID](https://github.com/校对者ID) +校对:[Mr小眼儿](https://github.com/tinyeyeser) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ea9da368369434f87c40b4f17607c1d477a54379 Mon Sep 17 00:00:00 2001 From: tinyeyeser Date: Mon, 9 May 2016 15:59:42 +0800 Subject: [PATCH 0723/1469] =?UTF-8?q?=E5=B7=B2=E6=A0=A1=E5=AF=B9=20by?= =?UTF-8?q?=E5=B0=8F=E7=9C=BC=E5=84=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Tape Managements Commands For Sysadmins.md | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/translated/tech/20151130 Useful Linux and Unix Tape Managements Commands For Sysadmins.md b/translated/tech/20151130 Useful Linux and Unix Tape Managements Commands For Sysadmins.md index f115444665..1985d63960 100644 --- a/translated/tech/20151130 Useful Linux and Unix Tape Managements Commands For Sysadmins.md +++ b/translated/tech/20151130 Useful Linux and Unix Tape Managements Commands For Sysadmins.md @@ -1,6 +1,6 @@ -15条给系统管理员的实用 Linux/Unix 磁带管理命令 +给系统管理员的15条实用 Linux/Unix 磁带管理命令 ================================================================================ -磁带设备应只用于定期的文件归档或将数据从一台服务器传送至另一台。通常磁带设备与 Unix 机器连接,用 mt 或 mtx 控制。你可以将所有的数据备份到磁盘(也许是云中)和磁带设备。在这个教程中你将会了解到: +磁带设备应只用于定期的文件归档或将数据从一台服务器传送至另一台。通常磁带设备与 Unix 机器连接,用 mt 或 mtx 控制。强烈建议您将所有的数据同时备份到磁盘(也许是云中)和磁带设备中。在本教程中你将会了解到: - 磁带设备名 - 管理磁带驱动器的基本命令 @@ -8,12 +8,13 @@ ### 为什么备份? ### -一个备份设备是很重要的: +一个备份计划对定期备份文件来说很有必要,如果你宁愿选择不备份,那么丢失重要数据的风险会大大增加。有了备份,你就有了从磁盘故障中恢复的能力。备份还可以帮助你抵御: -- 从磁盘故障中恢复的能力 - 意外的文件删除 - 文件或文件系统损坏 - 服务器完全毁坏,包括由于火灾或其他问题导致的同盘备份毁坏 +- 硬盘或SSD崩溃 +- 病毒或勒索软件破坏或删除文件 你可以使用磁带归档备份整个服务器并将其离线存储。 @@ -23,7 +24,7 @@ 图01:磁带文件标记 -每个磁带设备能存储多个备份文件。磁带备份文件通过 cpio,tar,dd 等命令创建。但是,磁带设备可以由各种程序打开,写入数据,并关闭。你可以存储若干备份(磁带文件)到一个物理磁带上。在每个磁带文件之间有个“磁带文件标记”。这个是用来指示一个物理磁带上磁带文件的结尾以及另一个文件的开始。你需要使用 mt 命令来定位磁带(快进,倒带和标记)。 +每个磁带设备能存储多个备份文件。磁带备份文件通过 cpio,tar,dd 等命令创建。同时,磁带设备可以由多种程序打开、写入数据、及关闭。你可以存储若干备份(磁带文件)到一个物理磁带上。在每个磁带文件之间有个“磁带文件标记”。这用来指示一个物理磁带上磁带文件的结尾以及另一个文件的开始。你需要使用 mt 命令来定位磁带(快进,倒带和标记)。 #### 磁带上的数据是如何存储的 #### @@ -87,7 +88,7 @@ 图03:Linux 服务器上已安装的磁带设备 -### mt 命令实例 ### +### mt 命令示例 ### 在 Linux 和类Unix系统上,mt 命令用来控制磁带驱动器的操作,比如查看状态或查找磁带上的文件或写入磁带控制标记。下列大多数命令需要作为 root 用户执行。语法如下: @@ -111,7 +112,7 @@ mt -f /dev/nsa0 status #FreeBSD mt -f /dev/rmt/1 status #Unix unity 1 也就是 tape device no. 1 -你可以像下面一样使用 shell 循环调查系统并定位所有的磁带驱动器: +你可以像下面一样使用 shell 循环语句遍历一个系统并定位其所有的磁带驱动器: for d in 0 1 2 3 4 5 do @@ -133,7 +134,7 @@ mt -f /dev/mt/0 off mt -f /dev/st0 eject -### 4:擦除磁带(倒带,在可以的情况下卸载磁带) ### +### 4:擦除磁带(倒带,在支持的情况下卸载磁带) ### mt erase mt -f /dev/st0 erase #Linux @@ -179,7 +180,7 @@ bsfm 后退指定的文件标记数目。磁带定位在下一个文件的第一块。 - asf The tape is positioned at the beginning of the count file. Positioning is done by first rewinding the tape and then spacing forward over count filemarks.磁带定位在 + asf 磁带定位在指定文件标记数目的开始位置。定位通过先倒带,再前进指定的文件标记数目来实现。 fsr 前进指定的记录数。 @@ -413,7 +414,7 @@ via: http://www.cyberciti.biz/hardware/unix-linux-basic-tape-management-commands 作者:Vivek Gite 译者:[alim0x](https://github.com/alim0x) -校对:[校对者ID](https://github.com/校对者ID) +校对:[Mr小眼儿](https://github.com/tinyeyeser) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 0f73a1098ef6b7a3bc3155d754ebeb72a65cb546 Mon Sep 17 00:00:00 2001 From: hkurj <663831938@qq.com> Date: Mon, 9 May 2016 21:35:09 +0800 Subject: [PATCH 0724/1469] hkurj translating --- ...60415 A four year, action-packed experience with Wikipedia.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/talk/my-open-source-story/20160415 A four year, action-packed experience with Wikipedia.md b/sources/talk/my-open-source-story/20160415 A four year, action-packed experience with Wikipedia.md index 9c45c209e9..4621c50a97 100644 --- a/sources/talk/my-open-source-story/20160415 A four year, action-packed experience with Wikipedia.md +++ b/sources/talk/my-open-source-story/20160415 A four year, action-packed experience with Wikipedia.md @@ -1,3 +1,4 @@ +hkurj translating A four year, action-packed experience with Wikipedia ======================================================= From 9243e460525bcf3a2a99b36df0a77d3445c63c29 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 10 May 2016 05:13:47 +0800 Subject: [PATCH 0725/1469] PUB:20151202 8 things to do after installing openSUSE Leap 42.1 @alim0x @carolinewuyan --- ... do after installing openSUSE Leap 42.1.md | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) rename {translated/tech => published}/20151202 8 things to do after installing openSUSE Leap 42.1.md (87%) diff --git a/translated/tech/20151202 8 things to do after installing openSUSE Leap 42.1.md b/published/20151202 8 things to do after installing openSUSE Leap 42.1.md similarity index 87% rename from translated/tech/20151202 8 things to do after installing openSUSE Leap 42.1.md rename to published/20151202 8 things to do after installing openSUSE Leap 42.1.md index ef5434da3d..38cefbf356 100644 --- a/translated/tech/20151202 8 things to do after installing openSUSE Leap 42.1.md +++ b/published/20151202 8 things to do after installing openSUSE Leap 42.1.md @@ -1,20 +1,22 @@ 安装 openSUSE Leap 42.1 之后要做的 8 件事 ================================================================================ ![Credit: Metropolitan Transportation/Flicrk](http://images.techhive.com/images/article/2015/11/things-to-do-100626947-primary.idge.jpg) -致谢:[Metropolitan Transportation/Flicrk][1] -> 你已经在你的电脑上安装了 openSUSE,这是你接下来要做的。 +*致谢:[Metropolitan Transportation/Flicrk][1]* -[openSUSE Leap 确实是个巨大的飞跃][2],它允许用户运行一个和 SUSE Linux 企业版拥有一样基因的发行版。和其它系统一样,为了实现最佳的使用效果,在使用它之前需要做些优化设置。 +> 如果你已经在你的电脑上安装了 openSUSE,这就是你接下来要做的。 -下面是一些我在我的电脑上安装 openSUSE Leap 之后做的一些事情(不适用于服务器)。这里面没有强制性要求的设置,基本安装对你来说也可能足够了。但如果你想获得更好的 openSUSE Leap 体验,那就跟着我往下看吧。 +[openSUSE Leap 确实是个巨大的飞跃][2],它允许用户运行一个和 SUSE Linux 企业版拥有同样基因的发行版。和其它系统一样,为了实现最佳的使用效果,在使用它之前需要做些优化设置。 + +下面是一些我在我的电脑上安装 openSUSE Leap 之后做的一些事情(不适用于服务器)。这里面没有强制性的设置,基本安装对你来说也可能足够了。但如果你想获得更好的 openSUSE Leap 体验,那就跟着我往下看吧。 ### 1. 添加 Packman 仓库 ### 由于专利和授权等原因,openSUSE 和许多 Linux 发行版一样,不通过官方仓库(repos)提供一些软件、解码器,以及驱动等。取而代之的是通过第三方或社区仓库来提供。第一个也是最重要的仓库是“Packman”。因为这些仓库不是默认启用的,我们需要添加它们。你可以通过 YaST(openSUSE 的特色之一)或者命令行完成(如下方介绍)。 ![o42 yast repo](http://images.techhive.com/images/article/2015/11/o42-yast-repo-100626952-large970.idge.png) -添加 Packman 仓库。 + +*添加 Packman 仓库。* 使用 YaST,打开软件源部分。点击“添加”按钮并选择“社区仓库(Community Repositories)”。点击“下一步”。一旦仓库列表加载出来了,选择 Packman 仓库。点击“确认”,然后点击“信任”导入信任的 GnuPG 密钥。 @@ -58,7 +60,7 @@ openSUSE 的默认浏览器是 Firefox。但是因为 Firefox 不能够播放专 ### 5. 安装 Nvidia 驱动 ### -即便你有 Nvidia 或 ATI 显卡,openSUSE Leap 也能够开箱即用。但是,如果你需要专有驱动来游戏或其它目的,你可以安装这些驱动,但需要一点额外的工作。 +即便你使用 Nvidia 或 ATI 显卡,openSUSE Leap 也能够开箱即用。但是,如果你需要专有驱动来游戏或其它目的,你可以安装这些驱动,但需要一点额外的工作。 首先你需要添加 Nvidia 源;它的步骤和使用 YaST 添加 Packman 仓库是一样的。唯一的不同是你需要在社区仓库部分选择 Nvidia。添加好了之后,到 **软件管理 > 附加** 去并选择“附加/安装所有匹配的推荐包”。 @@ -76,14 +78,15 @@ openSUSE 的默认浏览器是 Firefox。但是因为 Firefox 不能够播放专 ### 7. 安装你喜欢的电子邮件客户端 ### -openSUSE 自带 Kmail 或 Evolution,这取决于你安装的桌面环境。我用的是 Plasma,自带 Kmail,这个邮件客户端还有许多地方有待改进。我建议可以试试 Thunderbird 或 Evolution。所有主要的邮件客户端都能在官方仓库找到。你还可以看看我[精心挑选的 Linux 最佳邮件客户端][7]。 +openSUSE 自带 Kmail 或 Evolution,这取决于你安装的桌面环境。我用的是 KDE Plasma 自带的 Kmail,这个邮件客户端还有许多地方有待改进。我建议可以试试 Thunderbird 或 Evolution。所有主要的邮件客户端都能在官方仓库找到。你还可以看看我[精心挑选的 Linux 最佳邮件客户端][7]。 ### 8. 在防火墙允许 Samba 服务 ### 相比于其它发行版,openSUSE 默认提供了更加安全的系统。但对新用户来说它也需要一点设置。如果你正在使用 Samba 协议分享文件到本地网络的话,你需要在防火墙允许该服务。 ![o42 firewall](http://images.techhive.com/images/article/2015/11/o42-firewall-100626948-large970.idge.png) -在防火墙设置里允许 Samba 客户端和服务端 + +*在防火墙设置里允许 Samba 客户端和服务端* 打开 YaST 并搜索 Firewall。在防火墙设置里,进入到“允许的服务(Allowed Services)”,你会在“要允许的服务(Service to allow)”下面看到一个下拉列表。选择“Samba 客户端”,然后点击“添加”。同样方法添加“Samba 服务器”。都添加了之后,点击“下一步”,然后点击“完成”,现在你就可以通过本地网络从你的 openSUSE 分享文件以及访问其它机器了。 From 1b7fb67c2a58df07ad86c982174d575983fd7bab Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 10 May 2016 05:37:20 +0800 Subject: [PATCH 0726/1469] PUB:20151122 Doubly linked list in the Linux Kernel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @oska874 @tinyeyeser 可以将译文投递到原项目处 --- ... Doubly linked list in the Linux Kernel.md | 49 ++++++++++--------- 1 file changed, 25 insertions(+), 24 deletions(-) rename {translated/tech => published}/20151122 Doubly linked list in the Linux Kernel.md (73%) diff --git a/translated/tech/20151122 Doubly linked list in the Linux Kernel.md b/published/20151122 Doubly linked list in the Linux Kernel.md similarity index 73% rename from translated/tech/20151122 Doubly linked list in the Linux Kernel.md rename to published/20151122 Doubly linked list in the Linux Kernel.md index 1a5772320e..d21ae7ded6 100644 --- a/translated/tech/20151122 Doubly linked list in the Linux Kernel.md +++ b/published/20151122 Doubly linked list in the Linux Kernel.md @@ -4,10 +4,9 @@ Linux 内核里的数据结构——双向链表 双向链表 -------------------------------------------------------------------------------- +Linux 内核中自己实现了双向链表,可以在 [include/linux/list.h](https://github.com/torvalds/linux/blob/master/include/linux/list.h) 找到定义。我们将会首先从双向链表数据结构开始介绍**内核里的数据结构**。为什么?因为它在内核里使用的很广泛,你只需要在 [free-electrons.com](http://lxr.free-electrons.com/ident?i=list_head) 检索一下就知道了。 -Linux 内核自己实现了双向链表,可以在[include/linux/list.h](https://github.com/torvalds/linux/blob/master/include/linux/list.h)找到定义。我们将会从双向链表数据结构开始介绍`内核里的数据结构`。为什么?因为它在内核里使用的很广泛,你只需要在[free-electrons.com](http://lxr.free-electrons.com/ident?i=list_head) 检索一下就知道了。 - -首先让我们看一下在[include/linux/types.h](https://github.com/torvalds/linux/blob/master/include/linux/types.h) 里的主结构体: +首先让我们看一下在 [include/linux/types.h](https://github.com/torvalds/linux/blob/master/include/linux/types.h) 里的主结构体: ```C struct list_head { @@ -15,7 +14,7 @@ struct list_head { }; ``` -你可能注意到这和你以前见过的双向链表的实现方法是不同的。举个例子来说,在[glib](http://www.gnu.org/software/libc/) 库里是这样实现的: +你可能注意到这和你以前见过的双向链表的实现方法是不同的。举个例子来说,在 [glib](http://www.gnu.org/software/libc/) 库里是这样实现的: ```C struct GList { @@ -25,7 +24,7 @@ struct GList { }; ``` -通常来说一个链表结构会包含一个指向某个项目的指针。但是Linux内核中的链表实现并没有这样做。所以问题来了:`链表在哪里保存数据呢?`。实际上,内核里实现的链表是`侵入式链表`。侵入式链表并不在节点内保存数据-它的节点仅仅包含指向前后节点的指针,以及指向链表节点数据部分的指针——数据就是这样附加在链表上的。这就使得这个数据结构是通用的,使用起来就不需要考虑节点数据的类型了。 +通常来说一个链表结构会包含一个指向某个项目的指针。但是 Linux 内核中的链表实现并没有这样做。所以问题来了:**链表在哪里保存数据呢?**。实际上,内核里实现的链表是**侵入式链表(Intrusive list)**。侵入式链表并不在节点内保存数据-它的节点仅仅包含指向前后节点的指针,以及指向链表节点数据部分的指针——数据就是这样附加在链表上的。这就使得这个数据结构是通用的,使用起来就不需要考虑节点数据的类型了。 比如: @@ -36,7 +35,7 @@ struct nmi_desc { }; ``` -让我们看几个例子来理解一下在内核里是如何使用`list_head` 的。如上所述,在内核里有很多很多不同的地方都用到了链表。我们来看一个在杂项字符驱动里面的使用的例子。在 [drivers/char/misc.c](https://github.com/torvalds/linux/blob/master/drivers/char/misc.c) 的杂项字符驱动API 被用来编写处理小型硬件或虚拟设备的小驱动。这些驱动共享相同的主设备号: +让我们看几个例子来理解一下在内核里是如何使用 `list_head` 的。如上所述,在内核里有很多很多不同的地方都用到了链表。我们来看一个在杂项字符驱动里面的使用的例子。在 [drivers/char/misc.c](https://github.com/torvalds/linux/blob/master/drivers/char/misc.c) 的杂项字符驱动 API 被用来编写处理小型硬件或虚拟设备的小驱动。这些驱动共享相同的主设备号: ```C #define MISC_MAJOR 10 @@ -68,7 +67,7 @@ crw------- 1 root root 10, 63 Mar 21 12:01 vga_arbiter crw------- 1 root root 10, 137 Mar 21 12:01 vhci ``` -现在让我们看看它是如何使用链表的。首先看一下结构体`miscdevice`: +现在让我们看看它是如何使用链表的。首先看一下结构体 `miscdevice`: ```C struct miscdevice @@ -97,13 +96,13 @@ static LIST_HEAD(misc_list); struct list_head name = LIST_HEAD_INIT(name) ``` -然后使用宏`LIST_HEAD_INIT` 进行初始化,这会使用变量`name` 的地址来填充`prev`和`next` 结构体的两个变量。 +然后使用宏 `LIST_HEAD_INIT` 进行初始化,这会使用变量`name` 的地址来填充`prev`和`next` 结构体的两个变量。 ```C #define LIST_HEAD_INIT(name) { &(name), &(name) } ``` -现在来看看注册杂项设备的函数`misc_register`。它在开始就用函数 `INIT_LIST_HEAD` 初始化了`miscdevice->list`。 +现在来看看注册杂项设备的函数`misc_register`。它在一开始就用函数 `INIT_LIST_HEAD` 初始化了`miscdevice->list`。 ```C INIT_LIST_HEAD(&misc->list); @@ -125,7 +124,7 @@ static inline void INIT_LIST_HEAD(struct list_head *list) list_add(&misc->list, &misc_list); ``` -内核文件`list.h` 提供了向链表添加新项的API 接口。我们来看看它的实现: +内核文件`list.h` 提供了向链表添加新项的 API 接口。我们来看看它的实现: ```C @@ -205,9 +204,9 @@ int main() { } ``` -最终会打印`2` +最终会打印出`2` -下一点就是`typeof`,它也很简单。就如你从名字所理解的,它仅仅返回了给定变量的类型。当我第一次看到宏`container_of`的实现时,让我觉得最奇怪的就是表达式`((type *)0)`中的0.实际上这个指针巧妙的计算了从结构体特定变量的偏移,这里的`0`刚好就是位宽里的零偏移。让我们看一个简单的例子: +下一点就是`typeof`,它也很简单。就如你从名字所理解的,它仅仅返回了给定变量的类型。当我第一次看到宏`container_of`的实现时,让我觉得最奇怪的就是表达式`((type *)0)`中的0。实际上这个指针巧妙的计算了从结构体特定变量的偏移,这里的`0`刚好就是位宽里的零偏移。让我们看一个简单的例子: ```C #include @@ -236,21 +235,23 @@ int main() { 当然了`list_add` 和 `list_entry`不是``提供的唯一功能。双向链表的实现还提供了如下API: -* list_add -* list_add_tail -* list_del -* list_replace -* list_move -* list_is_last -* list_empty -* list_cut_position -* list_splice -* list_for_each -* list_for_each_entry +* list\_add +* list\_add\_tail +* list\_del +* list\_replace +* list\_move +* list\_is\_last +* list\_empty +* list\_cut\_position +* list\_splice +* list\_for\_each +* list\_for\_each\_entry 等等很多其它API。 -via: https://github.com/0xAX/linux-insides/edit/master/DataStructures/dlist.md +---- + +via: https://github.com/0xAX/linux-insides/blob/master/DataStructures/dlist.md 译者:[Ezio](https://github.com/oska874) 校对:[Mr小眼儿](https://github.com/tinyeyeser) From 8b1a24ceab9827616e930d978773f604952034e2 Mon Sep 17 00:00:00 2001 From: tinyeyeser Date: Tue, 10 May 2016 16:20:25 +0800 Subject: [PATCH 0727/1469] =?UTF-8?q?=E5=B7=B2=E6=A0=A1=E5=AF=B9=20by?= =?UTF-8?q?=E5=B0=8F=E7=9C=BC=E5=84=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Top 4 open source issue tracking tools.md | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/translated/tech/20160218 Top 4 open source issue tracking tools.md b/translated/tech/20160218 Top 4 open source issue tracking tools.md index 840a3d80fc..1ffd21a759 100644 --- a/translated/tech/20160218 Top 4 open source issue tracking tools.md +++ b/translated/tech/20160218 Top 4 open source issue tracking tools.md @@ -1,19 +1,19 @@ -排名前4的开源漏洞追踪工具 +开源问题跟踪管理工具Top4 ======================================== -生活充满了漏洞。 +生活充满了bug。 -无论怎样小心计划,无论花多少时间去设计,在执行阶段当轮胎压在路上,任何工程都会有未知的问题。也无妨。也许对于任何一个组织的最佳弹性衡量不是他们如何一切都按计划运行地处理事情,而是,当出现磕磕碰碰时他们处理速度。 +无论怎样小心计划,无论花多少时间去设计,在执行阶段当轮胎压在路上,任何工程都会有未知的问题。也无妨。也许对于任何一个组织的最佳弹性衡量不是他们如何一切都按计划运行地处理事情,而是,当出现磕磕碰碰时他们如何驾驭。 -一个任意工程管理流程的关键工具,特别是在软件开发领域,是一个问题追踪系统。基础很简单;允许漏洞在合作的方式被打开,追踪,和解决,同时很容易跟随进展。除了基本功能,还有很多专注于满足特定需求的选择,和使用案例,包括软件开发和更多。你可能熟悉托管版本的这些工具,像 [GitHub Issues](https://guides.github.com/features/issues/)或者[Launchpad](https://launchpad.net/),这些是他们自己开放的资源。 +对任何一个项目管理流程来说,特别是在软件开发领域,都需要一个关键工具——问题跟踪管理系统。其基本功能很简单:可以对bug进行查看、追踪,并以协作的方式解决bug,有了它,我们更容易跟随整个过程的进展。除了基本功能,还有很多专注于满足特定需求的选项及功能,使用场景不仅限于软件开发。你可能已经熟悉某些托管版本的工具,像 [GitHub Issues](https://guides.github.com/features/issues/)或者[Launchpad](https://launchpad.net/),其中一些工具已经有了自己的开源社区。 -让我们看一看四个管理漏洞和问题的优秀选择,全部开源代码、易于下载和自我托管。要清楚,我们可能没有办法在这里列出每一个问题跟踪工具;然而,这有四个我们偏爱的,基于功能丰富和项目背后的社区项目的规模。还有其他,可以肯定的是,如果你有一个好的理由你喜欢的没有列在这里,一定要让我们知道这是你最喜欢的工具,在下面的评论中使它脱颖而出。 +接下来,这四个bug问题跟踪管理软件的极佳备选,全部开源、易于下载,自己就可以部署。先说好,我们可能没有办法在这里列出每一个问题跟踪工具;相反,我们列出这四个,基于的是其丰富的功能和项目背后的社区规模。当然,肯定还有其他类似软件,如果你喜欢的没有列在这里,如果你有一个好的理由,一定要让我们知道,在下面的评论中使它脱颖而出吧。 ## Redmine -[Redmine](http://www.redmine.org/) 是一个流行的漏洞追踪工具建立在Ruby on Rails和可以追溯到2006年。很多类似于Trac,另一方面我们最爱的是,Redmine可以管理多个项目然后整合了多种版本控制系统。除了基本问题追踪,Redmine也提供论坛,wiki,时间跟踪工具,和生成甘特图和日历的能力来跟踪项目的进展。 +[Redmine](http://www.redmine.org/) 是一个很流行的追踪管理工具,基于Ruby on Rails构建,可以追溯到2006年。很多方面类似于Trac(另一个我们的最爱),Redmine可以管理多个项目,整合了多种版本控制系统。除了基本问题追踪,Redmine也提供论坛,wiki,时间跟踪工具,同时,它还具有生成甘特图表(Gantt charts)和日历的能力,用来跟踪项目的进展。 -Redmine的设置相当灵活,支持多种数据库后端和几十种语言,还是可定制的,可以添加自定义字段到问题,用户,工程和更多。通过社区创建的插件和主题它可以进一步定制。 +Redmine的设置相当灵活,支持多种数据库后端和几十种语言,还是可定制的,可以向问题(issue)、用户、工程等添加自定义字段。通过社区创建的插件和主题它可以进一步定制。 如果你想试一试,一个[在线演示](http://demo.redmine.org/)可提供使用。Redmine在开源[GPL版本2](http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)下许可;开源代码可以在工程的[svn仓库](https://svn.redmine.org/redmine)或在[GitHub](https://github.com/redmine/redmine)镜像上找到。 @@ -21,19 +21,19 @@ Redmine的设置相当灵活,支持多种数据库后端和几十种语言, ## Bugzilla -[Bugzilla](https://www.bugzilla.org/)是另一个流行的有漏洞追踪功能的开发工具。从名字您可能已经猜到了,Bugzilla最初是[Mozilla基金会](https://www.mozilla.org/en-US/)创建,用来跟踪当时称为网景通信套件开发漏洞的。为了更好的通过性从原来的Tcl移植到Perl路径,Bugzilla是一个比较老的和更广泛采用的问题跟踪系统,因为它用在许多著名的开源项目如GNOME,KDE,Linux内核本身。 +[Bugzilla](https://www.bugzilla.org/)是另一个流行的具备问题跟踪能力的开发工具。从名字您可能已经猜到了,Bugzilla最初是[Mozilla基金会](https://www.mozilla.org/en-US/)创建的,用来跟踪当时称为网景通信套件中的bug。为了更好的可读性,它从原来的Tcl移植到Perl,Bugzilla是一个比较老,但却广泛采用的问题跟踪系统,它被用在许多著名的开源项目如GNOME、KDE,以及Linux内核本身。 -拥有一些先进的工具,从通知到共享搜索重复的漏洞检测,Bugzilla是一个功能更丰富的选项。Bugzilla有高级搜索系统与全面的报表工具,生成图表和自动化计划报告的能力。像Redmine,Bugzilla是可扩展和可定制的,两者在字段本身像能创建自定义漏洞工作流一样。它也支持多种后端数据库,和自带的多语言支持。 +从通知到重复bug检测再到搜索共享,Bugzilla拥有许多高级工具,是一个功能更丰富的选项。Bugzilla拥有一套高级搜索系统以及全面的报表工具,具有生成图表和自动化按计划生成报告的能力。像Redmine一样,Bugzilla是可扩展和可定制的,除了字段本身,还能针对bug创建自定义工作流。它也支持多种后端数据库,和自带的多语言支持。 -Bugzilla在[Mozilla公共许可证](https://en.wikipedia.org/wiki/Mozilla_Public_License)下许可,你可以读取他们[未来路线图](https://www.bugzilla.org/status/roadmap.html)还有在官网尝试一个[示例服务](https://landfill.bugzilla.org/) +Bugzilla在[Mozilla公共许可证](https://en.wikipedia.org/wiki/Mozilla_Public_License)下许可,你可以读取他们的[未来路线图](https://www.bugzilla.org/status/roadmap.html)还有在官网尝试一个[示例服务](https://landfill.bugzilla.org/) ![](https://opensource.com/sites/default/files/images/business-uploads/issues-bugzilla.png) ## Trac -[Trac](http://trac.edgewall.org/browser)自称是使用简单的方法基于web的软件工程管理软件,但不要混淆极简主义与缺乏功能。 +[Trac](http://trac.edgewall.org/browser)自称是基于web的极简主义软件工程管理软件,这里请不要混淆极简主义与缺乏功能。 -python编写,Trac紧密结合它的漏洞跟踪与它的wiki系统和你选择的版本控制系统。项目管理能力突出,如生成的里程碑和路线图,一个可定制的报表系统,大事记,支持多资源库,内置的垃圾邮件过滤,还可以使用很多一般的语言。如其他漏洞追踪软件我们已经看到,有很多插件可进一步扩展其基本特性。 +由python编写的Trac,将其漏洞跟踪能力与它的wiki系统和版本控制系统轻度整合。项目管理能力突出,如生成里程碑和路线图,一个可定制的报表系统,大事记,支持多资源库,内置的垃圾邮件过滤,还可以使用很多通用语言。如其他我们已经看到的漏洞追踪软件,有很多插件可进一步扩展其基本特性。 Trac是在改进的[BSD许可](http://trac.edgewall.org/wiki/TracLicense)下获得开放源码许可,虽然更老的版本发布在GPL下。你可以在一个[自托管仓库](http://trac.edgewall.org/browser)预览Trac的源码或者查看他们的[路线图](http://trac.edgewall.org/wiki/TracRoadmap)对未来的规划。 @@ -41,13 +41,13 @@ Trac是在改进的[BSD许可](http://trac.edgewall.org/wiki/TracLicense)下获 ## Mantis -[Mantis](https://www.mantisbt.org/)是这次收集中我们将看的最后一个工具,一个基于PHP且有16年历史的漏洞跟踪工具。另外漏洞跟踪支持多种不同的版本控制系统和一个事件驱动的通知系统,Mantis有一个与其他工具类似的功能设置。虽然它不本身包含一个wiki,它整合很多流行的wiki平台且本地化到多种语言。 +[Mantis](https://www.mantisbt.org/)是这次合集中我们将看到的最后一个工具,基于PHP,且有16年历史。作为另一个支持多种不同版本控制系统和事件驱动通知系统的bug跟踪管理软件,Mantis有一个与其他工具类似的功能设置。虽然它不本身包含wiki,但它整合了很多流行的wiki平台且本地化到多种语言。 Mantis在[GPL版本2](http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)下获得开源许可证书;你可以在[GitHub](https://github.com/mantisbt/mantisbt)浏览他的源代码或查看自托管[路线图](https://www.mantisbt.org/bugs/roadmap_page.php?project=mantisbt&version=1.3.x)对未来的规划。一个示例,你可以查看他们的内部[漏洞跟踪](https://www.mantisbt.org/bugs/my_view_page.php)。 ![](https://opensource.com/sites/default/files/images/business-uploads/issues-mantis.png) -正如我们指出的,这四个不是唯一的选项。想要探索更多?[Apache Bloodhound](https://issues.apache.org/bloodhound/),[Fossil](http://fossil-scm.org/index.html/doc/trunk/www/index.wiki),[The Bug Genie](http://www.thebuggenie.com/),还有很多可替换品都有专注的追随者,每个都有不同的优点和缺点。另外,一些工具在我们[项目管理](https://opensource.com/business/15/1/top-project-management-tools-2015)摘要有问题跟踪功能。所以,哪个是你首选的跟踪和挤压漏洞的工具? +正如我们指出的,这四个不是唯一的选项。想要探索更多?[Apache Bloodhound](https://issues.apache.org/bloodhound/),[Fossil](http://fossil-scm.org/index.html/doc/trunk/www/index.wiki),[The Bug Genie](http://www.thebuggenie.com/),还有很多可替换品都有专注的追随者,每个都有不同的优点和缺点。另外,一些工具在我们[项目管理](https://opensource.com/business/15/1/top-project-management-tools-2015)摘要有问题跟踪功能。所以,哪个是你首选的跟踪和碾压bug的工具? ------------------------------------------------------------------------------ @@ -56,7 +56,7 @@ via: https://opensource.com/business/16/2/top-issue-support-and-bug-tracking-too 作者:[Jason Baker][a] 译者:[wyangsun](https://github.com/wyangsun) -校对:[校对者ID](https://github.com/校对者ID) +校对:[Mr小眼儿](https://github.com/tinyeyeser) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From b1c5b451bfeb13a9333a18056925f4f968d90adc Mon Sep 17 00:00:00 2001 From: VicYu Date: Tue, 10 May 2016 17:51:42 +0800 Subject: [PATCH 0728/1469] Translated 20160429 Master OpenStack with 5 new tutorials.md --- ...9 Master OpenStack with 5 new tutorials.md | 39 ------------------- ...9 Master OpenStack with 5 new tutorials.md | 37 ++++++++++++++++++ 2 files changed, 37 insertions(+), 39 deletions(-) delete mode 100644 sources/tech/20160429 Master OpenStack with 5 new tutorials.md create mode 100644 translated/tech/20160429 Master OpenStack with 5 new tutorials.md diff --git a/sources/tech/20160429 Master OpenStack with 5 new tutorials.md b/sources/tech/20160429 Master OpenStack with 5 new tutorials.md deleted file mode 100644 index b43952bc2f..0000000000 --- a/sources/tech/20160429 Master OpenStack with 5 new tutorials.md +++ /dev/null @@ -1,39 +0,0 @@ - Vic020 - -Master OpenStack with 5 new tutorials -======================================= - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/education/EDUCATION_tools.png?itok=ybxr0Qe9) - - -Returning from OpenStack Summit this week, I am reminded of just how vast the open source cloud ecosystem is and just how many different projects and concepts you need to be familiar with in order to succeed. Although, we're actually quite fortunate with the resources available for keeping up. In addition to the [official documentation][1], many great educational tools are out there, from third party training and certification, to in-person events, and many community-contributed tutorials as well. - -To help you stay on top of things, every month we round up a collection of new tutorials, how-tos, guides, and tips created by the OpenStack community. Here are some of the great pieces published this past month. - -- First up, if you're looking for a (reasonably) affordable home OpenStack test lab, the Intel NUC is a great platform to consider. Small in form factor, but reasonably well-powered, you can get a literal stack of them running OpenStack pretty quickly with this guide to using [TripleO to deploy OpenStack][2] on the NUC, and read about some common quirks to watch out for. -- After you've been running OpenStack for a while, the various processes keeping your cloud alive have probably generated quite a pile of log files. While some are probably safe to purge, you still need to have a plan for managing them. Here are some [quick thoughts][3] on managing logs in Ceilometer after nine-months in to a production deployment. -- The OpenStack infrastructure project can be an intimidating place for a newcomer just trying to land a patch. What's a gate job, what's a test, and what are all of these steps my commit is going through? Get a quick overview of the whole process from Arie Bregman in this [handy blog post][4]. -- Compute hosts fail occasionally, and whether the cause is hardware or software, the good news is that OpenStack makes it easy to migrate your running instance to another host. However, some people have found the commands to perform this migration a little confusing. Learn the difference between the migrate and evacuate commands in plain English in [this great writeup][5]. -- Network Functions Virtualization technologies require some functionality from OpenStack that are outside of what other users might be familiar with. For example, SR-IOV and PCI passthrough are ways of exposing physical hardware directly for maximizing performance. Learn the [steps involved][6] to make this happen within an OpenStack deployment. - -That wraps up our collection for this month, but if you're still looking for more, be sure to check out our past archive of [OpenStack tutorials][7] for even more learning resources. And if there's a tutorial or guide you think we ought to include in our next roundup, be sure to let us know in the comments below. - ------------------------------------------------------------------------------- - -via: https://opensource.com/business/16/4/master-openstack-new-tutorials - -作者:[Jason Baker][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jason-baker - -[1]: http://docs.openstack.org/ -[2]: http://acksyn.org/posts/2016/03/tripleo-on-nucs/ -[3]: http://silverskysoft.com/open-stack-xwrpr/2016/03/long-term-openstack-usage-summary/ -[4]: http://abregman.com/2016/03/05/openstack-infra-jenkins-jobs/ -[5]: http://www.danplanet.com/blog/2016/03/03/evacuate-in-nova-one-command-to-confuse-us-all/ -[6]: https://trickycloud.wordpress.com/2016/03/28/openstack-for-nfv-applications-sr-iov-and-pci-passthrough/ -[7]: https://opensource.com/resources/openstack-tutorials diff --git a/translated/tech/20160429 Master OpenStack with 5 new tutorials.md b/translated/tech/20160429 Master OpenStack with 5 new tutorials.md new file mode 100644 index 0000000000..18cbbf2435 --- /dev/null +++ b/translated/tech/20160429 Master OpenStack with 5 new tutorials.md @@ -0,0 +1,37 @@ +Master OpenStack with 5 new tutorials +5篇文章快速掌握OpenStack +======================================= + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/education/EDUCATION_tools.png?itok=ybxr0Qe9) + +回顾这周的OpenStack峰会,我仍然回味着开源云生态系统的浩瀚无垠,并且需要熟悉多少个不同的项目和概念才能获得成功.但是,我们却如此的幸运有许多资源让我们跟随项目的脚步.不单是[官方文档][1],还包括了许多学习的工具,来自三方的组织的培训和认证,也有个人的分享,以及许多社区贡献的教程. + +为了让我们保持获得最新消息,每一个月我们将会整合发布,penStack社区的最新教程,指导,和小贴士等.下面是我们过去几个月最棒的发布分享. + +- 首先,如果你正在寻找一个靠谱实惠的OpenStack测试实验室,Intel NUC是最值得考虑的平台.麻雀虽小,五脏俱全,通过指导文章,可以很轻松的按照教程在NUC上使用[Triple0部署OpenStack][2],并且还可以轻松预防一些常见的怪异问题. +- 当你已经运行的一段时间OpenStack后,你会发现在你的云系统上许多组件生成了大量日志.其中一些是可以安全删除的,你同样需要一个计划去管理这些日志.参看这篇文章[突然的想法][3]学习在部署9个月后Celiometer上如何管理日志. +- 对于OpenStack基础设施项目的新手,想要提交补丁到OpenStack是相当困难的.入口在哪里,测试怎么做,我的提交步骤是怎么样的?可以通过Arie Bregman的[博客文章][4]快速了解整个提交过程. +- 突发计算节点失效,不知道是硬件还是软件问题,好消息是OpenStack提供了一套非常简单的迁移计划让当机节点迁移到别的主机.然而,许多人发现使用这个命令总会遇到一些问题.可以学习[这篇文章][5]来理解migrate和evacuate命令的不同. +- 网络功能虚拟化技术需要OpenStack的额外用户不熟悉的知识。例如,SR-IOV和PCI直通是最大限度地提高物理硬件性能的方式.学习[部署步骤][6]使OpenStack部署获得更多效能. + +这些文章基本涵盖了本月推送,如果你还需要更多文章,可以检索过去推送的[OpenStack文献][7]来获取更多资源.如果有新的教程或指导,你认为我们应该推荐,请在评论中告诉我们,谢谢. + +------------------------------------------------------------------------------ + +via: https://opensource.com/business/16/4/master-openstack-new-tutorials + +作者:[Jason Baker][a] +译者:[VicYu/Vic020](http://vicyu.net) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jason-baker + +[1]: http://docs.openstack.org/ +[2]: http://acksyn.org/posts/2016/03/tripleo-on-nucs/ +[3]: http://silverskysoft.com/open-stack-xwrpr/2016/03/long-term-openstack-usage-summary/ +[4]: http://abregman.com/2016/03/05/openstack-infra-jenkins-jobs/ +[5]: http://www.danplanet.com/blog/2016/03/03/evacuate-in-nova-one-command-to-confuse-us-all/ +[6]: https://trickycloud.wordpress.com/2016/03/28/openstack-for-nfv-applications-sr-iov-and-pci-passthrough/ +[7]: https://opensource.com/resources/openstack-tutorials From 2d1473d3a72b7ab2615e820f119b08490263c33b Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 11 May 2016 08:22:23 +0800 Subject: [PATCH 0729/1469] PUB:20151130 Useful Linux and Unix Tape Managements Commands For Sysadmins @alim0x @tinyeyeser --- ...Tape Managements Commands For Sysadmins.md | 64 +++++++++---------- 1 file changed, 32 insertions(+), 32 deletions(-) rename {translated/tech => published}/20151130 Useful Linux and Unix Tape Managements Commands For Sysadmins.md (90%) diff --git a/translated/tech/20151130 Useful Linux and Unix Tape Managements Commands For Sysadmins.md b/published/20151130 Useful Linux and Unix Tape Managements Commands For Sysadmins.md similarity index 90% rename from translated/tech/20151130 Useful Linux and Unix Tape Managements Commands For Sysadmins.md rename to published/20151130 Useful Linux and Unix Tape Managements Commands For Sysadmins.md index 1985d63960..5bf991fef4 100644 --- a/translated/tech/20151130 Useful Linux and Unix Tape Managements Commands For Sysadmins.md +++ b/published/20151130 Useful Linux and Unix Tape Managements Commands For Sysadmins.md @@ -13,7 +13,7 @@ - 意外的文件删除 - 文件或文件系统损坏 - 服务器完全毁坏,包括由于火灾或其他问题导致的同盘备份毁坏 -- 硬盘或SSD崩溃 +- 硬盘或 SSD 崩溃 - 病毒或勒索软件破坏或删除文件 你可以使用磁带归档备份整个服务器并将其离线存储。 @@ -22,7 +22,7 @@ ![Fig.01: Tape file marks](http://s0.cyberciti.org/uploads/cms/2015/10/tape-format.jpg) -图01:磁带文件标记 +*图01:磁带文件标记* 每个磁带设备能存储多个备份文件。磁带备份文件通过 cpio,tar,dd 等命令创建。同时,磁带设备可以由多种程序打开、写入数据、及关闭。你可以存储若干备份(磁带文件)到一个物理磁带上。在每个磁带文件之间有个“磁带文件标记”。这用来指示一个物理磁带上磁带文件的结尾以及另一个文件的开始。你需要使用 mt 命令来定位磁带(快进,倒带和标记)。 @@ -30,7 +30,7 @@ ![Fig.02: How data is stored on a tape](http://s0.cyberciti.org/uploads/cms/2015/10/how-data-is-stored-on-a-tape.jpg) -图02:磁带上的数据是如何存储的 +*图02:磁带上的数据是如何存储的* 所有的数据使用 tar 以连续磁带存储格式连续地存储。第一个磁带归档会从磁带的物理开始端开始存储(tar #0)。接下来的就是 tar #1,以此类推。 @@ -60,22 +60,22 @@ 输入下列命令: - ## Linux(更多信息参阅 man) ## + ### Linux(更多信息参阅 man) ### lsscsi lsscsi -g - ## IBM AIX ## + ### IBM AIX ### lsdev -Cc tape lsdev -Cc adsm lscfg -vl rmt* - ## Solaris Unix ## + ### Solaris Unix ### cfgadm –a cfgadm -al luxadm probe iostat -En - ## HP-UX Unix ## + ### HP-UX Unix ### ioscan Cf ioscan -funC tape ioscan -fnC tape @@ -86,11 +86,11 @@ ![Fig.03: Installed tape devices on Linux server](http://s0.cyberciti.org/uploads/cms/2015/10/linux-find-tape-devices-command.jpg) -图03:Linux 服务器上已安装的磁带设备 +*图03:Linux 服务器上已安装的磁带设备* ### mt 命令示例 ### -在 Linux 和类Unix系统上,mt 命令用来控制磁带驱动器的操作,比如查看状态或查找磁带上的文件或写入磁带控制标记。下列大多数命令需要作为 root 用户执行。语法如下: +在 Linux 和类 Unix 系统上,mt 命令用来控制磁带驱动器的操作,比如查看状态或查找磁带上的文件或写入磁带控制标记。下列大多数命令需要作为 root 用户执行。语法如下: mt -f /tape/device/name operation @@ -98,7 +98,7 @@ 你可以设置 TAPE shell 变量。这是磁带驱动器的路径名。在 FreeBSD 上默认的(如果变量没有设置,而不是 null)是 /dev/nsa0。可以通过 mt 命令的 -f 参数传递变量覆盖它,就像下面解释的那样。 - ## 添加到你的 shell 配置文件 ## + ### 添加到你的 shell 配置文件 ### TAPE=/dev/st1 #Linux TAPE=/dev/rmt/2 #Unix TAPE=/dev/nsa3 #FreeBSD @@ -106,11 +106,11 @@ ### 1:显示磁带/驱动器状态 ### - mt status #Use default - mt -f /dev/rmt/0 status #Unix - mt -f /dev/st0 status #Linux - mt -f /dev/nsa0 status #FreeBSD - mt -f /dev/rmt/1 status #Unix unity 1 也就是 tape device no. 1 + mt status ### Use default + mt -f /dev/rmt/0 status ### Unix + mt -f /dev/st0 status ### Linux + mt -f /dev/nsa0 status ### FreeBSD + mt -f /dev/rmt/1 status ### Unix unity 1 也就是 tape device no. 1 你可以像下面一样使用 shell 循环语句遍历一个系统并定位其所有的磁带驱动器: @@ -208,7 +208,7 @@ mt -f /dev/st0 rewind; dd if=/dev/st0 of=- - ## tar 格式 ## + ### tar 格式 ### tar tvf {DEVICE} {Directory-FileName} tar tvf /dev/st0 tar tvf /dev/st0 desktop @@ -216,40 +216,40 @@ ### 12:使用 dump 或 ufsdump 备份分区 ### - ## Unix 备份 c0t0d0s2 分区 ## + ### Unix 备份 c0t0d0s2 分区 ### ufsdump 0uf /dev/rmt/0 /dev/rdsk/c0t0d0s2 - ## Linux 备份 /home 分区 ## + ### Linux 备份 /home 分区 ### dump 0uf /dev/nst0 /dev/sda5 dump 0uf /dev/nst0 /home - ## FreeBSD 备份 /usr 分区 ## + ### FreeBSD 备份 /usr 分区 ### dump -0aL -b64 -f /dev/nsa0 /usr ### 12:使用 ufsrestore 或 restore 恢复分区 ### - ## Unix ## + ### Unix ### ufsrestore xf /dev/rmt/0 - ## Unix 交互式恢复 ## + ### Unix 交互式恢复 ### ufsrestore if /dev/rmt/0 - ## Linux ## + ### Linux ### restore rf /dev/nst0 - ## 从磁带媒介上的第6个备份交互式恢复 ## + ### 从磁带媒介上的第6个备份交互式恢复 ### restore isf 6 /dev/nst0 - ## FreeBSD 恢复 ufsdump 格式 ## + ### FreeBSD 恢复 ufsdump 格式 ### restore -i -f /dev/nsa0 ### 13:从磁带开头开始写入(见图02) ### - ## 这会覆盖磁带上的所有数据 ## + ### 这会覆盖磁带上的所有数据 ### mt -f /dev/st1 rewind - ### 备份 home ## + ### 备份 home ### tar cvf /dev/st1 /home - ## 离线并卸载磁带 ## + ### 离线并卸载磁带 ### mt -f /dev/st0 offline 从磁带开头开始恢复: @@ -260,22 +260,22 @@ ### 14:从最后一个 tar 后开始写入(见图02) ### - ## 这会保留之前写入的数据 ## + ### 这会保留之前写入的数据 ### mt -f /dev/st1 eom - ### 备份 home ## + ### 备份 home ### tar cvf /dev/st1 /home - ## 卸载 ## + ### 卸载 ### mt -f /dev/st0 offline ### 15:从 tar number 2 后开始写入(见图02) ### - ## 在 tar number 2 之后写入(应该是 2+1) + ### 在 tar number 2 之后写入(应该是 2+1)### mt -f /dev/st0 asf 3 tar cvf /dev/st0 /usr - ## asf 等效于 fsf ## + ### asf 等效于 fsf ### mt -f /dev/sf0 rewind mt -f /dev/st0 fsf 2 From 4cc38307f7439cc75587efa92a19aa9df6f03832 Mon Sep 17 00:00:00 2001 From: Purling Nayuki Date: Wed, 11 May 2016 15:12:43 +0800 Subject: [PATCH 0730/1469] Proofread 20160429 Master OpenStack with 5 new tutorials --- ...9 Master OpenStack with 5 new tutorials.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/translated/tech/20160429 Master OpenStack with 5 new tutorials.md b/translated/tech/20160429 Master OpenStack with 5 new tutorials.md index 18cbbf2435..710baacbb3 100644 --- a/translated/tech/20160429 Master OpenStack with 5 new tutorials.md +++ b/translated/tech/20160429 Master OpenStack with 5 new tutorials.md @@ -1,20 +1,20 @@ -Master OpenStack with 5 new tutorials +MMaster OpenStack with 5 new tutorials 5篇文章快速掌握OpenStack ======================================= ![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/education/EDUCATION_tools.png?itok=ybxr0Qe9) -回顾这周的OpenStack峰会,我仍然回味着开源云生态系统的浩瀚无垠,并且需要熟悉多少个不同的项目和概念才能获得成功.但是,我们却如此的幸运有许多资源让我们跟随项目的脚步.不单是[官方文档][1],还包括了许多学习的工具,来自三方的组织的培训和认证,也有个人的分享,以及许多社区贡献的教程. +回顾这周的 OpenStack 峰会,我仍然回味着开源云生态系统的浩瀚无垠,并且需要熟悉多少个不同的项目和概念才能获得成功。但是,我们是幸运的,因为有许多资源让我们跟随项目的脚步。除了[官方文档][1]外,我们还有许多来自三方组织的培训和认证、个人分享,以及许多社区贡献的学习资源。 -为了让我们保持获得最新消息,每一个月我们将会整合发布,penStack社区的最新教程,指导,和小贴士等.下面是我们过去几个月最棒的发布分享. +为了让我们保持获得最新消息,每个月我们将会整合发布 OpenStack 社区的最新教程、指导和小贴士等。下面是我们过去几个月最棒的发布分享。 -- 首先,如果你正在寻找一个靠谱实惠的OpenStack测试实验室,Intel NUC是最值得考虑的平台.麻雀虽小,五脏俱全,通过指导文章,可以很轻松的按照教程在NUC上使用[Triple0部署OpenStack][2],并且还可以轻松预防一些常见的怪异问题. -- 当你已经运行的一段时间OpenStack后,你会发现在你的云系统上许多组件生成了大量日志.其中一些是可以安全删除的,你同样需要一个计划去管理这些日志.参看这篇文章[突然的想法][3]学习在部署9个月后Celiometer上如何管理日志. -- 对于OpenStack基础设施项目的新手,想要提交补丁到OpenStack是相当困难的.入口在哪里,测试怎么做,我的提交步骤是怎么样的?可以通过Arie Bregman的[博客文章][4]快速了解整个提交过程. -- 突发计算节点失效,不知道是硬件还是软件问题,好消息是OpenStack提供了一套非常简单的迁移计划让当机节点迁移到别的主机.然而,许多人发现使用这个命令总会遇到一些问题.可以学习[这篇文章][5]来理解migrate和evacuate命令的不同. -- 网络功能虚拟化技术需要OpenStack的额外用户不熟悉的知识。例如,SR-IOV和PCI直通是最大限度地提高物理硬件性能的方式.学习[部署步骤][6]使OpenStack部署获得更多效能. +- 首先,如果你正在寻找一个靠谱实惠的 OpenStack 测试实验室, Intel NUC 是最值得考虑的平台.麻雀虽小,五脏俱全,通过指导文章,可以很轻松的按照教程在 NUC 上使用 [TripleO 部署 OpenStack][2] ,并且还可以轻松预防一些常见的怪异问题。 +- 当你已经运行的一段时间 OpenStack 后,你会发现在你的云系统上许多组件生成了大量日志。其中一些是可以安全删除的,而你需要一个管理这些日志的方案。参考在部署生产 9 个月后使用 Celiometer 管理日志的[一些思考][3]。 +- 对于 OpenStack 基础设施项目的新手,想要提交补丁到 OpenStack 是相当困难的。入口在哪里,测试怎么做,我的提交步骤是怎么样的?可以通过 Arie Bregman 的[博客文章][4]快速了解整个提交过程。 +- 突发计算节点失效,不知道是硬件还是软件问题。好消息是 OpenStack 提供了一套非常简单的迁移计划可以让迁移当机节点到别的主机。然而,迁移过程中使用的命令令许多人感到困惑。可以通过[这篇文章][5]来理解 migrate 和 evacuate 命令的不同。 +- 网络功能虚拟化技术需要 OpenStack 中的额外的功能,而用户可能不熟悉它们。例如, SR-IOV 和 PCI 直通是最大限度地提高物理硬件性能的方式。可以学习[部署步骤][6]以使 OpenStack 的性能最大化。 -这些文章基本涵盖了本月推送,如果你还需要更多文章,可以检索过去推送的[OpenStack文献][7]来获取更多资源.如果有新的教程或指导,你认为我们应该推荐,请在评论中告诉我们,谢谢. +这些文章基本涵盖了本月(译者注: 4 月)推送,如果你还需要更多文章,可以检索过去推送的 [OpenStack 文献][7]来获取更多资源。如果有你认为我们应该推荐的新教程,请在评论中告诉我们,谢谢。 ------------------------------------------------------------------------------ @@ -22,7 +22,7 @@ via: https://opensource.com/business/16/4/master-openstack-new-tutorials 作者:[Jason Baker][a] 译者:[VicYu/Vic020](http://vicyu.net) -校对:[校对者ID](https://github.com/校对者ID) +校对:[PurlingNayuki](https://github.com/PurlingNayuki) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From b9bff95411ad5f7737e9f1a9e0edf7c1c9165b07 Mon Sep 17 00:00:00 2001 From: Purling Nayuki Date: Wed, 11 May 2016 15:15:24 +0800 Subject: [PATCH 0731/1469] Proofread: Fix typo in 20160429 Master OpenStack with 5 new tutorials --- .../tech/20160429 Master OpenStack with 5 new tutorials.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20160429 Master OpenStack with 5 new tutorials.md b/translated/tech/20160429 Master OpenStack with 5 new tutorials.md index 710baacbb3..47ad95b663 100644 --- a/translated/tech/20160429 Master OpenStack with 5 new tutorials.md +++ b/translated/tech/20160429 Master OpenStack with 5 new tutorials.md @@ -1,4 +1,4 @@ -MMaster OpenStack with 5 new tutorials +Master OpenStack with 5 new tutorials 5篇文章快速掌握OpenStack ======================================= From 788dcd5af6bf05c70f6c472a45e7de66cb47d2be Mon Sep 17 00:00:00 2001 From: Purling Nayuki Date: Wed, 11 May 2016 16:00:23 +0800 Subject: [PATCH 0732/1469] Proofread 20160304 Image processing at NASA with open source tools --- ...ocessing at NASA with open source tools.md | 34 ++++++++++++------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/translated/tech/20160304 Image processing at NASA with open source tools.md b/translated/tech/20160304 Image processing at NASA with open source tools.md index e3d59b0f51..a26b96936c 100644 --- a/translated/tech/20160304 Image processing at NASA with open source tools.md +++ b/translated/tech/20160304 Image processing at NASA with open source tools.md @@ -4,27 +4,27 @@ ![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/nasa_spitzer_space_pink_spiral.jpg?itok=3XEUstkl) -这个已逝的夏天,我是位于格伦的 [NASA](http://www.nasa.gov/centers/glenn/home/index.html) [GVIS](https://ocio.grc.nasa.gov/gvis/) 实验室的研究生,我将我对开源的热情带到了那里。我的任务是提高我们实验室对 Dan Schroeder 开发的一个开源流体动力学模拟器的贡献。原本的模拟器为用户呈现出可以用鼠标绘制的障碍,用来计算流体动力学模型。我们团队的贡献是加入图像处理的代码,这些代码分析实况视频的每一帧以显示一个物体如何与液体相互作用。而且,我们还要做更多事情。 +在刚结束的这个夏天里,我是 [NASA 格伦中心][1] [GVIS][2] 实验室的实习生,我将我对开源的热情带到了那里。我的任务是改进我们实验室对 Dan Schroeder 开发的一个开源流体动力学模拟器的贡献。原本的模拟器可以显示用户用鼠标绘制的障碍物,并建立计算流体动力学模型。我们团队的贡献是加入图像处理的代码,分析实况视频的每一帧以显示特定的物体如何与液体相互作用。而且,我们还要做更多事情。 -我们想要让图像处理部分更加健全,所以我致力于改善图像处理库。 +我们想要让图像处理部分更加健壮,所以我致力于改善图像处理库。 -基于新的库,模拟器可以检测轮廓、进行空间坐标变换以及找到物体的质心。图像处理并不直接与流体动力学模拟器物理相关。它用摄像头检测物体,并且获取物体轮廓,为流体模拟器创建一个障碍物。然后,流体模拟器启动,输出结果会被投射到真实物体上。 +得益于新的库,模拟器可以检测轮廓、进行空间坐标变换以及找到物体的质心。图像处理并不直接与流体动力学模拟器物理相关。它用摄像头检测物体,并且获取物体轮廓,为流体模拟器创建一个障碍物。随后,流体模拟器开始运行,而输出结果会被投射到真实物体上。 -我的目标是通过以下三种方式改进模拟器: +我的目标是通过以下三个方面改进模拟器: 1. 找寻物体的轮廓 2. 找寻物体的质心 3. 能对物体中心进行相关的精确转换 -我的导师建议我安装 [Node.js](http://nodejs.org/), [OpenCV](http://opencv.org/), 和 [Node.js bindings for OpenCV](https://github.com/peterbraden/node-opencv).。在等待软件安装的过程中,我查看了 OpenCV 的 [GitHub 主页](https://github.com/peterbraden/node-opencv) 上的示例源码。我发现示例源码使用 JavaScript 写的,而我还不懂 JavaScript ,所以我在 Codecademy 上学了一些课程。两天后,我对 JavaScript 依旧生疏,不过我还是开始了我的项目。。。它包含了更多的JavaScript。 +我的导师建议我安装 [Node.js](http://nodejs.org/) 、 [OpenCV](http://opencv.org/) 和 [Node.js bindings for OpenCV](https://github.com/peterbraden/node-opencv)。在等待软件安装的过程中,我查看了 OpenCV 的 [GitHub 主页][3]上的示例源码。我发现示例源码使用 JavaScript 写的,而我还不懂 JavaScript ,所以我在 Codecademy 上学了一些课程。两天后,我对 JavaScript 依旧生疏,不过我还是开始了我的项目…它包含了更多的 JavaScript 。 -示例的轮廓检测代码工作得很好。事实上,它使得我用几个小时就完成了第一个目标!为了获取一幅图片的轮廓,它看起来像这样: +检测轮廓的示例代码工作得很好。事实上,它使得我用几个小时就完成了第一个目标!获取一幅图片的轮廓,它看起来像这样: ![](https://opensource.com/sites/default/files/resize/image_processing_nasa_1-520x293.jpg) > 包括所有轮廓的原始图, -示例的检测轮廓的代码工作得有点好过头了。不仅物体的轮廓被检测到了,整个图片中的轮廓都检测到了。这会导致模拟器要与那些没用的轮廓打交道。这是一个严重的问题,因为它会返回错误的数据。为了避免模拟器接触到不想要的轮廓,我加了一个区域约束。轮廓要位于一定的区域范围内才会被画出来。区域约束使得轮廓变干净了。 +检测轮廓的示例代码工作得有点好过头了。不仅物体的轮廓被检测到了,整个图片中的轮廓都检测到了。这会导致模拟器要与那些没用的轮廓打交道。这是一个严重的问题,因为它会返回错误的数据。为了避免模拟器接触到不想要的轮廓,我加了一个区域约束。轮廓要位于一定的区域范围内才会被画出来。区域约束使得轮廓变干净了。 ![](https://opensource.com/sites/default/files/resize/image_processing_nasa_2-520x293.jpg) @@ -44,21 +44,25 @@ > 最后的干净轮廓。 -这个时候,我可以获取干净的轮廓、计算质心了。可惜的是,我没有足够的时间去完成质心的相关变换。因为我的实习时间不多了,我开始考虑我在这段有限时间内能做的其它事情。其中一个就是边界矩形。边界矩形是包含了图片轮廓的最小四边形。边界矩形很重要,因为它是在页面上缩放轮廓的关键。虽然很遗憾我没时间利用边界矩形做更多事情,但是我仍然想去了解更多,因为这是个很有用的工具。 +这个时候,我可以获取干净的轮廓、计算质心了。可惜的是,我没有足够的时间去完成质心的相关变换。由于我的实习时间只剩下几天了,我开始考虑我在这段有限时间内能做的其它事情。其中一个就是边界矩形。边界矩形是包含了图片轮廓的最小四边形。边界矩形很重要,因为它是在页面上缩放轮廓的关键。虽然很遗憾我没时间利用边界矩形做更多事情,但是我仍然想学习它,因为它是个很有用的工具。 最后,经过以上的努力,我完成了对图像的处理! ![](https://opensource.com/sites/default/files/resize/image_processing_nasa_5-521x293.jpg) -> 最后图像,红色的边界矩形和质心。 +> 最终图像,红色的边界矩形和质心。 -当这些图像处理代码写完之后,我用我的代码替代了模拟器中的老代码。非常意外的,它可以工作。 +当这些图像处理代码写完之后,我用我的代码替代了模拟器中的老代码。令我意外的是,它可以工作。 嗯,基本可以。 -程序有内存泄露,每 1/10 秒泄露 100MB 。我很高兴原因不是我的代码。坏消息是修复它并不是我能控制的。好消息是有个解决方法我可以使用。它并不是最理想的,方法是不断检查模拟器使用的内存,当使用内存超过 1 GB,重新启动模拟器。 + -在 NASA 实验室,我们使用很多的开源软件,没有这些开源软件的帮助,我不可能完成这些工作。 +( Youtube 演示视频) + +程序有内存泄露,每 1/10 秒泄露 100MB 。我很高兴原因不是我的代码。坏消息是我并不能修复它。好消息是仍然有解决方法。它并非最理想的,但我可以使用。这个方法是不断检查模拟器使用的内存,当使用内存超过 1GB 时,重新启动模拟器。 + +在 NASA 实验室,我们会使用很多的开源软件,没有这些开源软件的帮助,我不可能完成这些工作。 * * * @@ -66,6 +70,10 @@ via: [https://opensource.com/life/16/3/image-processing-nasa](https://opensource 作者:[Lauren Egts](https://opensource.com/users/laurenegts) 译者:[willowyoung](https://github.com/willowyoung) -校对:[校对者ID](https://github.com/校对者ID) +校对:[PurlingNayuki](https://github.com/PurlingNayuki) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]: http://www.nasa.gov/centers/glenn/home/index.html +[2]: https://ocio.grc.nasa.gov/gvis/ +[3]: https://github.com/peterbraden/node-opencv From 6040ac9b7d7e1caa5c302d3b39417c2e2d6aae3f Mon Sep 17 00:00:00 2001 From: tinyeyeser Date: Wed, 11 May 2016 16:09:43 +0800 Subject: [PATCH 0733/1469] =?UTF-8?q?=E5=B7=B2=E6=A0=A1=E5=AF=B9=20by?= =?UTF-8?q?=E5=B0=8F=E7=9C=BC=E5=84=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...123 Data Structures in the Linux Kernel.md | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/translated/tech/20151123 Data Structures in the Linux Kernel.md b/translated/tech/20151123 Data Structures in the Linux Kernel.md index 78526e6d94..899a69af3d 100644 --- a/translated/tech/20151123 Data Structures in the Linux Kernel.md +++ b/translated/tech/20151123 Data Structures in the Linux Kernel.md @@ -1,14 +1,14 @@ -Linux内核数据结构 +Linux内核中的数据结构 —— 基数树 ================================================================================ 基数树 Radix tree -------------------------------------------------------------------------------- -正如你所知道的,Linux内核提供了许多不同的库和函数,它们实现了不同的数据结构和算法。在这部分,我们将研究其中一种数据结构——[基数树 Radix tree](http://en.wikipedia.org/wiki/Radix_tree)。在Linux内核中,有两个与基数树实现和API相关的文件: +正如你所知道的,Linux内核提供了许多不同的库和函数,它们实现了不同的数据结构和算法。在这部分,我们将研究其中一种数据结构——[基数树 Radix tree](http://en.wikipedia.org/wiki/Radix_tree)。在 Linux 内核中,有两个文件与基数树的实现和API相关: * [include/linux/radix-tree.h](https://github.com/torvalds/linux/blob/master/include/linux/radix-tree.h) * [lib/radix-tree.c](https://github.com/torvalds/linux/blob/master/lib/radix-tree.c) -让我们讨论什么是`基数树`吧。基数树是一种`压缩的字典树`,而[字典树](http://en.wikipedia.org/wiki/Trie)是实现了关联数组接口并允许以`键值对`方式存储值的一种数据结构。该键通常是字符串,但能够使用任何数据类型。字典树因为它的节点而与`n叉树`不同。字典树的节点不存储键;相反,字典树的一个节点存储单个字符的标签。与一个给定节点关联的键可以通过从根遍历到该节点获得。举个例子: +让我们先说说什么是 `基数树` 吧。基数树是一种 `压缩的字典树 (compressed trie)` ,而[字典树](http://en.wikipedia.org/wiki/Trie)是实现了关联数组接口并允许以 `键值对` 方式存储值的一种数据结构。这里的键通常是字符串,但可以使用任意数据类型。字典树因为它的节点而与 `n叉树` 不同。字典树的节点不存储键,而是存储单个字符的标签。与一个给定节点关联的键可以通过从根遍历到该节点获得。举个例子: ```                +-----------+ @@ -39,9 +39,9 @@ Linux内核数据结构                             +-----------+ ``` -因此在这个例子中,我们可以看到一个有着两个键`go`和`cat`的`字典树`。压缩的字典树或者`基数树`和`字典树`不同于所有只有一个孩子的中间节点都被删除。 +因此在这个例子中,我们可以看到一个有着两个键 `go` 和 `cat` 的 `字典树` 。压缩的字典树或者说 `基数树` ,它和 `字典树` 的不同之处在于,所有只有一个孩子的中间节点都被删除。 -Linu内核中的基数树是映射值到整形键的一种数据结构。[include/linux/radix-tree.h](https://github.com/torvalds/linux/blob/master/include/linux/radix-tree.h)文件中的以下结构体表示了基数树: +Linux 内核中的基数树是把值映射到整形键的一种数据结构。[include/linux/radix-tree.h](https://github.com/torvalds/linux/blob/master/include/linux/radix-tree.h)文件中的以下结构体描述了基数树: ```C struct radix_tree_root { @@ -51,15 +51,15 @@ struct radix_tree_root { }; ``` -这个结构体表示了一个基数树的根,并包含了3个域成员: +这个结构体描述了一个基数树的根,它包含了3个域成员: * `height` - 树的高度; -* `gfp_mask` - 告诉如何执行动态内存分配; +* `gfp_mask` - 告知如何执行动态内存分配; * `rnode` - 孩子节点指针. -我们第一个要讨论的域是`gfp_mask`: +我们第一个要讨论的字段是 `gfp_mask` : -底层内核内存动态分配函数以一组标志作为` gfp_mask `,用于描述如何执行动态内存分配。这些控制分配进程的`GFP_`标志拥有以下值:(`GF_NOIO`标志)意味着睡眠等待内存,(`__GFP_HIGHMEM`标志)意味着高端内存能够被使用,(`GFP_ATOMIC`标志)意味着分配进程拥有高优先级并不能睡眠等等。 +底层内核的内存动态分配函数以一组标志作为 `gfp_mask` ,用于描述如何执行动态内存分配。这些控制分配进程的 `GFP_` 标志拥有以下值:( `GF_NOIO` 标志)意味着睡眠以及等待内存,( `__GFP_HIGHMEM` 标志)意味着高端内存能够被使用,( `GFP_ATOMIC` 标志)意味着分配进程拥有高优先级并不能睡眠等等。 * `GFP_NOIO` - 睡眠等待内存 * `__GFP_HIGHMEM` - 高端内存能够被使用; @@ -67,7 +67,7 @@ struct radix_tree_root { 等等。 -下一个域是`rnode`: +下一个字段是`rnode`: ```C struct radix_tree_node { @@ -86,7 +86,7 @@ struct radix_tree_node { unsigned long tags[RADIX_TREE_MAX_TAGS][RADIX_TREE_TAG_LONGS]; }; ``` -这个结构体包含的信息有父节点中的偏移以及到底端(叶节点)的高度、孩子节点的个数以及用于访问和释放节点的域成员。这些域成员描述如下: +这个结构体包含的信息有父节点中的偏移以及到底端(叶节点)的高度、孩子节点的个数以及用于访问和释放节点的字段成员。这些字段成员描述如下: * `path` - 父节点中的偏移和到底端(叶节点)的高度 * `count` - 孩子节点的个数; @@ -95,20 +95,20 @@ struct radix_tree_node { * `rcu_head` - 用于释放节点; * `private_list` - 由树的用户使用; -`radix_tree_node`的最后两个成员——`tags`和`slots`非常重要且令人关注。Linux内核基数树的每个节点都包含一组存储指向数据指针的slots。Linux内核基数树实现的空slots存储`NULL`值。Linux内核中的基数树也支持与`radix_tree_node`结构体的`tags`域相关联的标签。标签允许在基数树存储的记录中设置各个位。 +`radix_tree_node` 的最后两个成员—— `tags` 和 `slots` 非常重要且令人关注。Linux 内核基数树的每个节点都包含了一组指针槽( slots ),槽里存储着指向数据的指针。在Linux内核基数树的实现中,空槽存储的是 `NULL` 。Linux内核中的基数树也支持标签( tags ),它与 `radix_tree_node` 结构体的 `tags` 字段相关联。有了标签,我们就可以对基数树中存储的记录以单个比特位( bit )进行设置。 既然我们了解了基数树的结构,那么该是时候看一下它的API了。 Linux内核基数树API --------------------------------------------------------------------------------- -我们从结构体的初始化开始。有两种方法初始化一个新的基数树。第一种是使用`RADIX_TREE`宏: +我们从结构体的初始化开始。有两种方法初始化一个新的基数树。第一种是使用 `RADIX_TREE` 宏: ```C RADIX_TREE(name, gfp_mask); ```` -正如你所看到的,我们传递`name`参数,所以使用`RADIX_TREE`宏,我们能够定义和初始化基数树为给定的名字。`RADIX_TREE`的实现是简单的: +正如你所看到的,我们传递了 `name` 参数,所以通过 `RADIX_TREE` 宏,我们能够定义和初始化基数树为给定的名字。`RADIX_TREE` 的实现很简单: ```C #define RADIX_TREE(name, mask) \ @@ -121,16 +121,16 @@ RADIX_TREE(name, gfp_mask); } ``` -在`RADIX_TREE`宏的开始,我们使用给定的名字定义`radix_tree_root`结构体实例,并使用给定的mask调用`RADIX_TREE_INIT`宏。`RADIX_TREE_INIT`宏只是初始化`radix_tree_root`结构体为默认值和给定的mask而已。 +在 `RADIX_TREE` 宏的开始,我们使用给定的名字定义 `radix_tree_root` 结构体实例,并使用给定的 mask 调用 `RADIX_TREE_INIT` 宏。 而 `RADIX_TREE_INIT` 宏则是使用默认值和给定的mask对 `radix_tree_root` 结构体进行了初始化。 -第二种方法是亲手定义`radix_tree_root`结构体,并且将它和mask传给`INIT_RADIX_TREE`宏: +第二种方法是手动定义`radix_tree_root`结构体,并且将它和mask传给 `INIT_RADIX_TREE` 宏: ```C struct radix_tree_root my_radix_tree; INIT_RADIX_TREE(my_tree, gfp_mask_for_my_radix_tree); ``` -where: +`INIT_RADIX_TREE` 宏的定义如下: ```C #define INIT_RADIX_TREE(root, mask) \ @@ -141,20 +141,20 @@ do { \ } while (0) ``` -和`RADIX_TREE_INIT`宏所做的初始化一样,初始化为默认值。 +和`RADIX_TREE_INIT`宏所做的初始化工作一样,`INIT_RADIX_TREE` 宏使用默认值和给定的 mask 完成初始化工作。 -接下来是用于从基数树插入和删除数据的两个函数: +接下来是用于向基数树插入和删除数据的两个函数: * `radix_tree_insert`; * `radix_tree_delete`; -第一个函数`radix_tree_insert`需要3个参数: +第一个函数 `radix_tree_insert` 需要3个参数: * 基数树的根; * 索引键; * 插入的数据; -`radix_tree_delete`函数需要和`radix_tree_insert`一样的一组参数,但是没有data。 +`radix_tree_delete` 函数需要和 `radix_tree_insert` 一样的一组参数,但是不需要传入要删除的数据。 基数树的搜索以两种方法实现: @@ -167,7 +167,7 @@ do { \ * 基数树的根; * 索引键; -这个函数尝试在树中查找给定的键,并返回和该键相关联的记录。第二个函数`radix_tree_gang_lookup`有以下的函数签名: +这个函数尝试在树中查找给定的键,并返回和该键相关联的记录。第二个函数 `radix_tree_gang_lookup` 有以下的函数签名: ```C unsigned int radix_tree_gang_lookup(struct radix_tree_root *root, @@ -176,9 +176,9 @@ unsigned int radix_tree_gang_lookup(struct radix_tree_root *root, unsigned int max_items); ``` -和返回记录的个数,(results指向的数据)按键排序并从第一个索引开始。返回的记录个数将不会超过`max_items`。 +它返回的是记录的个数。 `results` 中的结果,按键排序,并从第一个索引开始。返回的记录个数将不会超过 `max_items` 的值。 -最后一个函数`radix_tree_lookup_slot`将会返回包含数据的slot。 +最后一个函数`radix_tree_lookup_slot`将会返回包含数据的指针槽。 链接 --------------------------------------------------------------------------------- @@ -192,7 +192,7 @@ via: https://github.com/0xAX/linux-insides/edit/master/DataStructures/radix-tree 作者:[0xAX] 译者:[cposture](https://github.com/cposture) -校对:[校对者ID](https://github.com/校对者ID) +校对:[Mr小眼儿](https://github.com/tinyeyeser) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From f61b9adc838aa3ca7f37064ea28153b80a337f47 Mon Sep 17 00:00:00 2001 From: vim-kakali <1799225723@qq.com> Date: Wed, 11 May 2016 19:39:23 +0800 Subject: [PATCH 0734/1469] translated --- ...minism and increasing diversity in tech.md | 2 +- ...butions Would Presidential Hopefuls Run.md | 55 -------------- ...151117 How bad a boss is Linus Torvalds.md | 2 +- ...butions Would Presidential Hopefuls Run.md | 72 +++++++++++++++++++ 4 files changed, 74 insertions(+), 57 deletions(-) delete mode 100644 sources/talk/20150820 Which Open Source Linux Distributions Would Presidential Hopefuls Run.md create mode 100644 translated/news/20150820 Which Open Source Linux Distributions Would Presidential Hopefuls Run.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 index 36f5642c10..10a30119e1 100644 --- 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 @@ -78,4 +78,4 @@ via: http://opensource.com/life/15/8/patricia-torvalds-interview [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 +[7]:https://www.facebook.com/groups/LadiesStormHackathons/ 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 deleted file mode 100644 index cfb653f702..0000000000 --- a/sources/talk/20150820 Which Open Source Linux Distributions Would Presidential Hopefuls Run.md +++ /dev/null @@ -1,55 +0,0 @@ -vim-kakali translating - -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/ diff --git a/sources/talk/20151117 How bad a boss is Linus Torvalds.md b/sources/talk/20151117 How bad a boss is Linus Torvalds.md index 76e9f4c244..7ebba90483 100644 --- a/sources/talk/20151117 How bad a boss is Linus Torvalds.md +++ b/sources/talk/20151117 How bad a boss is Linus Torvalds.md @@ -75,4 +75,4 @@ via: http://www.computerworld.com/article/3004387/it-management/how-bad-a-boss-i [1]:http://www.computerworld.com/article/2874475/linus-torvalds-diversity-gaffe-brings-out-the-best-and-worst-of-the-open-source-world.html [2]:http://www.zdnet.com/article/linux-4-3-released-after-linus-torvalds-scraps-brain-damage-code/ [3]:http://lkml.iu.edu/hypermail/linux/kernel/1510.3/02866.html -[4]:http://sarah.thesharps.us/2015/10/05/closing-a-door/ \ No newline at end of file +[4]:http://sarah.thesharps.us/2015/10/05/closing-a-door/ diff --git a/translated/news/20150820 Which Open Source Linux Distributions Would Presidential Hopefuls Run.md b/translated/news/20150820 Which Open Source Linux Distributions Would Presidential Hopefuls Run.md new file mode 100644 index 0000000000..a7419bd07a --- /dev/null +++ b/translated/news/20150820 Which Open Source Linux Distributions Would Presidential Hopefuls Run.md @@ -0,0 +1,72 @@ +总统更乐意使用哪种开源Linux分支? +================================================================================ +![Republican presidential candidate Donald Trump +](http://thevarguy.com/site-files/thevarguy.com/files/imagecache/medium_img/uploads/2015/08/donaldtrump.jpg) + + + +共和党总统候选人Donald Trump【译者注:唐纳德·特朗普,美国地产大亨、作家、主持人】 + + +如果人们要竞选总统,而决定因素却是使用Linux或另一个开源操作系统,那么这样的系统会属于哪个分支呢?关键是存在与其他很多事情有关的问题,而这正好使我们很难抉择;比如,一些“政治立场”问题,或者是要判断某一个分支诞生时为它的名字加上感叹号是否合适——而这些问题一直被忽视。而忽视到此就结束了:接下来是时事新闻工作者关于总统大选和Linux分支的报道。 + + +对于那些已经看了很多年我的文字的人来说(除了我亲爱的的编辑之外,他们是不是也不够幸运一直听我的瞎扯?),这些话听起来很熟悉,这是因为我在去年的总统选举期间写了一个[similar post][1]。一些有趣的读者把这里面的内容看的很正式,然而我并不是这样想的,所以我会花点时间阐述我的观点:事实上,我不认为开源软件和政治运动对于一些事情有多大的意义。我写那样的文章仅仅是新的一周的自我消遣罢了。 + + + +当然,你也可以去了解更多的你想知道的东西,毕竟你才是读者。 + +###Linux分支:共和党人的选择### + +今天,我只是谈及一些有关共和主义的话题,我甚至只会谈论他们的其中一部分。因为共和党的期望提名太多了以至于我写满了整篇文章。由此开始: + + +如果**Jeb (Jeb!?) Bush**使用Linux,它定是[Debian][2]。Debian属于一个相当无趣的分支,它是为真正意义上的黑客设计的,这样的黑客通过使用这样的操作系统快速成长,并且乐此不疲。而且他们可以通过攻击一些初级开源爱好者的电脑来大捞一笔。当然,这也使得Debian显得很枯燥,所以它已有的用户基础一直在缩减。 + + + +**Scott Walker**是一个[Damn Small Linux][3] (DSL) 用户。这个系统仅仅需要50MB的硬盘空间和16MB的RAM便可完美运行。DSL可以使一台20年前的486计算机充满活力;而这恰好满足了**Scott Walker**消减硬件成本的需求。当然,你使用DSL的体验也是最原始的;这个系统平台只能够运行一个浏览器。但是至少你在1993年购买的机器现在仍然能很好的工作,这样你也不用浪费钱财购买新的电脑硬件。 + + +**Chris Christie**会使用哪种系统呢?他肯定会依赖于一次设置便可持续工作的逻辑Linux灾难恢复方案,而这就是[Relax-and-Recover Linux][4]。Christie使用它主要是因为他的政治工作,从那次华盛顿大桥事故后,他的政治动力就受到了影响。不管它是否能够让Christie挽回一切事故,但是当他的电脑死机的时候,至少可以找到一些意外丢失的机密邮件。 + + + +对于**Carly Fiorina**,她不否定将要使用来自于[Hewlett-Packard][6] (HPQ)的软件为 "[The Machine][5]"开发操作系统,HPQ是她在1999年到2005年这6年期间所管理的公司。事实上,这种机器可以运行部分不同操作系统,而我不知道这些系统是否是基于Linux的; **Carly Fiorina**被惠普公司辞退后,开发操作系统工作就开始了。尽管如此,她仍然是她研究的计算机领域中的成功管理者。同时这也意味着她和惠普的联系彻底绝。 + + + +这才是重点,你也猜到了,他就是**Donald Trump**。想要拥有免费的、优秀的操作系统,他可能会用数百万美元去雇佣一个精英黑客团队去定制属于自己的操作系统;同时他也可以向别人炫耀自己的财力。他可能会吹嘘自己的操作系统是目前最好的系统。它肯定没有使用POSIX【译者注:可移植操作系统接口】或者采用一些其他的标准,因为那样的话就需要提供一些其他的很多的规则。人们也不知道它的运行方式,因此,如果**Donald Trump**向人们展示了他的系统的运行方式,很明显他可能会把所有的机密都泄露给了伊斯兰国家,这是相当冒险的。 + + + +非此即彼,如果**Donald Trump**非要选择一种已有的类Linux操作系统, [Ubuntu][7]是明智的选择。而**Donald Trump**也是Ubuntu的开发者,他和他的团队通过使用他们已有的应用程序接口去定制他们认为的真正的开源软件。自由软件纯化论者却很不喜欢这种开发模式,他们很反感使用Ubuntu,反而很多其他人更喜欢Ubuntu。当然,用户自己的这种仅仅在软件和政治上的不同立场也是无伤大雅的,即使这样的分歧可能会一直存在。 + + +###敬请期待### + + +如果你想知道为什么我还没有提到民主党候人,别想了。我不会在这篇文章中提及他们,因为我一直对民主党和共和党保持中立观点(我个人认为,像美国这样的的情况,只有两个政党是不合理的;事实上,这种意义上的民主就显得很可笑,所以我不太相信这些党派候选人)。 + + +相反,也可能会有很多人关心民主党候选人使用的Linux分支。后续的帖子中我会提及的,请拭目以待。 + +-------------------------------------------------------------------------------- + +via: http://thevarguy.com/open-source-application-software-companies/081715/which-open-source-linux-distributions-would-presidential- + +作者:[Christopher Tozzi][a] +译者:[vim-kakali](https://github.com/vim-kakali) +校对:[校对者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/ From 2a6c3ea7aa165fe0d7e1b8185d40726505ff7761 Mon Sep 17 00:00:00 2001 From: Purling Nayuki Date: Wed, 11 May 2016 21:08:03 +0800 Subject: [PATCH 0735/1469] Proofread 20150820 Which Open Source Linux Distributions Would Presidential Hopefuls Run --- ...butions Would Presidential Hopefuls Run.md | 125 ++++++++---------- 1 file changed, 53 insertions(+), 72 deletions(-) diff --git a/translated/news/20150820 Which Open Source Linux Distributions Would Presidential Hopefuls Run.md b/translated/news/20150820 Which Open Source Linux Distributions Would Presidential Hopefuls Run.md index a7419bd07a..30a81a51da 100644 --- a/translated/news/20150820 Which Open Source Linux Distributions Would Presidential Hopefuls Run.md +++ b/translated/news/20150820 Which Open Source Linux Distributions Would Presidential Hopefuls Run.md @@ -1,72 +1,53 @@ -总统更乐意使用哪种开源Linux分支? -================================================================================ -![Republican presidential candidate Donald Trump -](http://thevarguy.com/site-files/thevarguy.com/files/imagecache/medium_img/uploads/2015/08/donaldtrump.jpg) - - - -共和党总统候选人Donald Trump【译者注:唐纳德·特朗普,美国地产大亨、作家、主持人】 - - -如果人们要竞选总统,而决定因素却是使用Linux或另一个开源操作系统,那么这样的系统会属于哪个分支呢?关键是存在与其他很多事情有关的问题,而这正好使我们很难抉择;比如,一些“政治立场”问题,或者是要判断某一个分支诞生时为它的名字加上感叹号是否合适——而这些问题一直被忽视。而忽视到此就结束了:接下来是时事新闻工作者关于总统大选和Linux分支的报道。 - - -对于那些已经看了很多年我的文字的人来说(除了我亲爱的的编辑之外,他们是不是也不够幸运一直听我的瞎扯?),这些话听起来很熟悉,这是因为我在去年的总统选举期间写了一个[similar post][1]。一些有趣的读者把这里面的内容看的很正式,然而我并不是这样想的,所以我会花点时间阐述我的观点:事实上,我不认为开源软件和政治运动对于一些事情有多大的意义。我写那样的文章仅仅是新的一周的自我消遣罢了。 - - - -当然,你也可以去了解更多的你想知道的东西,毕竟你才是读者。 - -###Linux分支:共和党人的选择### - -今天,我只是谈及一些有关共和主义的话题,我甚至只会谈论他们的其中一部分。因为共和党的期望提名太多了以至于我写满了整篇文章。由此开始: - - -如果**Jeb (Jeb!?) Bush**使用Linux,它定是[Debian][2]。Debian属于一个相当无趣的分支,它是为真正意义上的黑客设计的,这样的黑客通过使用这样的操作系统快速成长,并且乐此不疲。而且他们可以通过攻击一些初级开源爱好者的电脑来大捞一笔。当然,这也使得Debian显得很枯燥,所以它已有的用户基础一直在缩减。 - - - -**Scott Walker**是一个[Damn Small Linux][3] (DSL) 用户。这个系统仅仅需要50MB的硬盘空间和16MB的RAM便可完美运行。DSL可以使一台20年前的486计算机充满活力;而这恰好满足了**Scott Walker**消减硬件成本的需求。当然,你使用DSL的体验也是最原始的;这个系统平台只能够运行一个浏览器。但是至少你在1993年购买的机器现在仍然能很好的工作,这样你也不用浪费钱财购买新的电脑硬件。 - - -**Chris Christie**会使用哪种系统呢?他肯定会依赖于一次设置便可持续工作的逻辑Linux灾难恢复方案,而这就是[Relax-and-Recover Linux][4]。Christie使用它主要是因为他的政治工作,从那次华盛顿大桥事故后,他的政治动力就受到了影响。不管它是否能够让Christie挽回一切事故,但是当他的电脑死机的时候,至少可以找到一些意外丢失的机密邮件。 - - - -对于**Carly Fiorina**,她不否定将要使用来自于[Hewlett-Packard][6] (HPQ)的软件为 "[The Machine][5]"开发操作系统,HPQ是她在1999年到2005年这6年期间所管理的公司。事实上,这种机器可以运行部分不同操作系统,而我不知道这些系统是否是基于Linux的; **Carly Fiorina**被惠普公司辞退后,开发操作系统工作就开始了。尽管如此,她仍然是她研究的计算机领域中的成功管理者。同时这也意味着她和惠普的联系彻底绝。 - - - -这才是重点,你也猜到了,他就是**Donald Trump**。想要拥有免费的、优秀的操作系统,他可能会用数百万美元去雇佣一个精英黑客团队去定制属于自己的操作系统;同时他也可以向别人炫耀自己的财力。他可能会吹嘘自己的操作系统是目前最好的系统。它肯定没有使用POSIX【译者注:可移植操作系统接口】或者采用一些其他的标准,因为那样的话就需要提供一些其他的很多的规则。人们也不知道它的运行方式,因此,如果**Donald Trump**向人们展示了他的系统的运行方式,很明显他可能会把所有的机密都泄露给了伊斯兰国家,这是相当冒险的。 - - - -非此即彼,如果**Donald Trump**非要选择一种已有的类Linux操作系统, [Ubuntu][7]是明智的选择。而**Donald Trump**也是Ubuntu的开发者,他和他的团队通过使用他们已有的应用程序接口去定制他们认为的真正的开源软件。自由软件纯化论者却很不喜欢这种开发模式,他们很反感使用Ubuntu,反而很多其他人更喜欢Ubuntu。当然,用户自己的这种仅仅在软件和政治上的不同立场也是无伤大雅的,即使这样的分歧可能会一直存在。 - - -###敬请期待### - - -如果你想知道为什么我还没有提到民主党候人,别想了。我不会在这篇文章中提及他们,因为我一直对民主党和共和党保持中立观点(我个人认为,像美国这样的的情况,只有两个政党是不合理的;事实上,这种意义上的民主就显得很可笑,所以我不太相信这些党派候选人)。 - - -相反,也可能会有很多人关心民主党候选人使用的Linux分支。后续的帖子中我会提及的,请拭目以待。 - --------------------------------------------------------------------------------- - -via: http://thevarguy.com/open-source-application-software-companies/081715/which-open-source-linux-distributions-would-presidential- - -作者:[Christopher Tozzi][a] -译者:[vim-kakali](https://github.com/vim-kakali) -校对:[校对者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/ +总统更乐意使用哪种开源Linux分支? +================================================================================ +![Republican presidential candidate Donald Trump +](http://thevarguy.com/site-files/thevarguy.com/files/imagecache/medium_img/uploads/2015/08/donaldtrump.jpg) + +共和党总统候选人 Donald Trump【译者注:唐纳德·特朗普,美国地产大亨、作家、主持人】 + +如果人们要竞选总统,而决定因素却是使用 Linux 或其他的开源操作系统,那么这样的系统会是哪个发行版呢?关键是存在与其他很多事情有关的问题,而这正好使我们很难抉择;比如,一些“政治立场”问题,或者是要判断某一个分支诞生时为它的名字加上感叹号是否合适——而这些问题一直被忽视。而忽视到此就结束了:接下来是时事新闻工作者关于总统大选和 Linux 分支的报道。 + +对于那些已经看了很多年我的文字的人来说(除了我亲爱的的编辑之外,他们一直听我的瞎扯是不是倒霉到家了?),这些话听起来很熟悉,这是因为我在去年的总统选举期间写了一篇[类似的文章][1]。一些有趣的读者把这里面的内容看的很正式,然而我并不是这样想的,所以我会花点时间阐述我的观点:事实上,我不认为开源软件和政治运动对于一些事情有多大的意义。我写那样的文章仅仅是新的一周的自我消遣罢了。 + +当然,你也可以去了解更多的你想知道的东西,毕竟你才是读者。 + +### Linux 分支:共和党人的选择 ### + +今天,我只是谈及一些有关共和主义的话题,我甚至只会谈论他们的其中一部分。因为共和党的期望提名太多了以至于我写满了整篇文章。由此开始: + +如果 **Jeb (Jeb!?) Bush** 使用 Linux,它一定是 [Debian][2]。Debian 属于一个相当无趣的分支,它是为真正意义上的黑客设计的,它们将快速成长起来并清理经验不甚丰富的开源爱好者造成的混乱视为一大使命。当然,这也使得Debian显得很枯燥,所以它已有的用户基础一直在缩减。 + +**Scott Walker** 是一个 [Damn Small Linux][3] (DSL) 用户。这个系统仅仅需要 50MB 的硬盘空间和 16MB 的 RAM 便可完美运行。DSL 可以使一台 20 年前的 486 计算机充满活力;而这恰好满足了 **Scott Walker** 消减硬件成本的需求。当然,你使用 DSL 的体验也是最原始的;这个系统平台只能够运行一个浏览器。但是至少你在 1993 年购买的机器现在仍然能很好的工作,这样你也不用浪费钱财购买新的电脑硬件。 + +**Chris Christie** 会使用哪种系统呢?他肯定会依赖于一次设置便可持续工作的裸机 Linux 灾难恢复方案,而这就是 [Relax-and-Recover Linux][4]。Christie 使用它主要是因为他的政治工作,从那次华盛顿大桥事故后,他的政治动力就受到了影响。不管它是否能够让 Christie 挽回一切事故,但是当他的电脑死机的时候,至少可以找到一些意外丢失的机密邮件。 + +至于 **Carly Fiorina**,她无疑将要使用 [Hewlett-Packard][6] (HPQ)为“[The Machine][5]”操作系统开发的软件,HPQ 是她在 1999 年到 2005 年这 6 年期间所管理的公司。事实上,这种机器可以运行部分不同操作系统,而我们并不清楚这些系统是否基于 Linux;**Carly Fiorina** 被惠普公司辞退后,开发操作系统工作就开始了。尽管如此,她仍然是她研究的计算机领域中的成功管理者。同时这也意味着她很难与惠普的彻底断绝关系。 + +最后——这才是重点,你也猜到了——**Donald Trump**。想要拥有免费的、优秀的操作系统,他可能会用数百万美元去雇佣一个精英黑客团队去定制属于自己的操作系统;同时他也可以向别人炫耀自己的财力。他可能会吹嘘自己的操作系统是目前最好的系统。它肯定没有兼容 POSIX【译者注:可移植操作系统接口】或者采用一些其他的标准,因为那样的话就需要提供一些其他的很多的规则。同时这个系统完全不提供任何文档,因为如果 **Donald Trump** 向人们展示了他的系统的运行方式,很明显他会经受所有机密被泄露至伊斯兰国家的风险。 + +非此即彼,如果 **Donald Trump** 非要选择一种已有的 Linux 操作系统, [Ubuntu][7] 应该是明智的选择。而 **Donald Trump** 也是 Ubuntu 的开发者,他和他的团队按照他们的想法,通过开发他们自由的甚至是专有的应用和接口去打造他们认为的开源软件。自由软件纯化论者却很不喜欢这种开发模式,他们很反感使用 Ubuntu,反而很多其他人更喜欢 Ubuntu。当然,长远来看,关于这种做法的争论(无论是政治领域还是软件领域)还待见分晓。 + +### 敬请期待 ### + +如果你想知道为什么我还没有提到民主党候人,别想了。我不会在这篇文章中提及他们,因为我一直对民主党和共和党保持中立观点(我个人认为,像美国这样的的情况,只有两个政党是不合理的;事实上,这种意义上的民主就显得很可笑,所以我不太相信这些党派候选人)。 + +相反,也可能会有很多人关心民主党候选人使用的Linux分支。后续的帖子中我会提及的,请拭目以待。 + +-------------------------------------------------------------------------------- + +via: http://thevarguy.com/open-source-application-software-companies/081715/which-open-source-linux-distributions-would-presidential- + +作者:[Christopher Tozzi][a] +译者:[vim-kakali](https://github.com/vim-kakali) +校对:[PurlingNayuki](https://github.com/PurlingNayuki) + +本文由 [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/ From 46b106bb7a390f09a0e80292b30271fb5ed42f71 Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 11 May 2016 21:30:43 +0800 Subject: [PATCH 0736/1469] =?UTF-8?q?20160511-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LXD/Part 7 - LXD 2.0--Docker in LXD.md | 143 +++++++++++++++++- 1 file changed, 141 insertions(+), 2 deletions(-) diff --git a/sources/tech/LXD/Part 7 - LXD 2.0--Docker in LXD.md b/sources/tech/LXD/Part 7 - LXD 2.0--Docker in LXD.md index 60bb3883df..bf4fe35c4f 100644 --- a/sources/tech/LXD/Part 7 - LXD 2.0--Docker in LXD.md +++ b/sources/tech/LXD/Part 7 - LXD 2.0--Docker in LXD.md @@ -1,6 +1,145 @@ Part 7 - LXD 2.0: Docker in LXD ================================== -<正文待补充> +This is the third blog post [in this series about LXD 2.0][0]. -原文: https://www.stgraber.org/2016/04/13/lxd-2-0-docker-in-lxd-712/ +![](https://linuxcontainers.org/static/img/containers.png) + +### Why run Docker inside LXD + +As I briefly covered in the [first post of this series][1], LXD’s focus is system containers. That is, we run a full unmodified Linux distribution inside our containers. LXD for all intent and purposes doesn’t care about the workload running in the container. It just sets up the container namespaces and security policies, then spawns /sbin/init and waits for the container to stop. + +Application containers such as those implemented by Docker or Rkt are pretty different in that they are used to distribute applications, will typically run a single main process inside them and be much more ephemeral than a LXD container. + +Those two container types aren’t mutually exclusive and we certainly see the value of using Docker containers to distribute applications. That’s why we’ve been working hard over the past year to make it possible to run Docker inside LXD. + +This means that with Ubuntu 16.04 and LXD 2.0, you can create containers for your users who will then be able to connect into them just like a normal Ubuntu system and then run Docker to install the services and applications they want. + +### Requirements + +There are a lot of moving pieces to make all of this working and we got it all included in Ubuntu 16.04: + +- A kernel with CGroup namespace support (4.4 Ubuntu or 4.6 mainline) +- LXD 2.0 using LXC 2.0 and LXCFS 2.0 +- A custom version of Docker (or one built with all the patches that we submitted) +- A Docker image which behaves when confined by user namespaces, or alternatively make the parent LXD container a privileged container (security.privileged=true) + +### Running a basic Docker workload + +Enough talking, lets run some Docker containers! + +First of all, you need an Ubuntu 16.04 container which you can get with: + +``` +lxc launch ubuntu-daily:16.04 docker -p default -p docker +``` + +The “-p default -p docker” instructs LXD to apply both the “default” and “docker” profiles to the container. The default profile contains the basic network configuration while the docker profile tells LXD to load a few required kernel modules and set up some mounts for the container. The docker profile also enables container nesting. + +Now lets make sure the container is up to date and install docker: + +``` +lxc exec docker -- apt update +lxc exec docker -- apt dist-upgrade -y +lxc exec docker -- apt install docker.io -y +``` + +And that’s it! You’ve got Docker installed and running in your container. +Now lets start a basic web service made of two Docker containers: + +``` +stgraber@dakara:~$ lxc exec docker -- docker run --detach --name app carinamarina/hello-world-app +Unable to find image 'carinamarina/hello-world-app:latest' locally +latest: Pulling from carinamarina/hello-world-app +efd26ecc9548: Pull complete +a3ed95caeb02: Pull complete +d1784d73276e: Pull complete +72e581645fc3: Pull complete +9709ddcc4d24: Pull complete +2d600f0ec235: Pull complete +c4cf94f61cbd: Pull complete +c40f2ab60404: Pull complete +e87185df6de7: Pull complete +62a11c66eb65: Pull complete +4c5eea9f676d: Pull complete +498df6a0d074: Pull complete +Digest: sha256:6a159db50cb9c0fbe127fb038ed5a33bb5a443fcdd925ec74bf578142718f516 +Status: Downloaded newer image for carinamarina/hello-world-app:latest +c8318f0401fb1e119e6c5bb23d1e706e8ca080f8e44b42613856ccd0bf8bfb0d + +stgraber@dakara:~$ lxc exec docker -- docker run --detach --name web --link app:helloapp -p 80:5000 carinamarina/hello-world-web +Unable to find image 'carinamarina/hello-world-web:latest' locally +latest: Pulling from carinamarina/hello-world-web +efd26ecc9548: Already exists +a3ed95caeb02: Already exists +d1784d73276e: Already exists +72e581645fc3: Already exists +9709ddcc4d24: Already exists +2d600f0ec235: Already exists +c4cf94f61cbd: Already exists +c40f2ab60404: Already exists +e87185df6de7: Already exists +f2d249ff479b: Pull complete +97cb83fe7a9a: Pull complete +d7ce7c58a919: Pull complete +Digest: sha256:c31cf04b1ab6a0dac40d0c5e3e64864f4f2e0527a8ba602971dab5a977a74f20 +Status: Downloaded newer image for carinamarina/hello-world-web:latest +d7b8963401482337329faf487d5274465536eebe76f5b33c89622b92477a670f +``` + +With those two Docker containers now running, we can then get the IP address of our LXD container and access the service! + +``` +stgraber@dakara:~$ lxc list ++--------+---------+----------------------+----------------------------------------------+------------+-----------+ +| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS | ++--------+---------+----------------------+----------------------------------------------+------------+-----------+ +| docker | RUNNING | 172.17.0.1 (docker0) | 2001:470:b368:4242:216:3eff:fe55:45f4 (eth0) | PERSISTENT | 0 | +| | | 10.178.150.73 (eth0) | | | | ++--------+---------+----------------------+----------------------------------------------+------------+-----------+ + +stgraber@dakara:~$ curl http://10.178.150.73 +The linked container said... "Hello World!" +``` + +### Conclusion + +That’s it! It’s really that simple to run Docker containers inside a LXD container. + +Now as I mentioned earlier, not all Docker images will behave as well as my example, that’s typically because of the extra confinement that comes with LXD, specifically the user namespace. + +Only the overlayfs storage driver of Docker works in this mode. That storage driver may come with its own set of limitation which may further limit how many images will work in this environment. + +If your workload doesn’t work properly and you trust the user inside the LXD container, you can try: + +``` +lxc config set docker security.privileged true +lxc restart docker +``` + +That will de-activate the user namespace and will run the container in privileged mode. + +Note however that in this mode, root inside the container is the same uid as root on the host. There are a number of known ways for users to escape such containers and gain root privileges on the host, so you should only ever do that if you’d trust the user inside your LXD container with root privileges on the host. + +### Extra information + +The main LXD website is at: +Development happens on Github at: +Mailing-list support happens on: +IRC support happens in: #lxcontainers on irc.freenode.net + + +-------------------------------------------------------------------------------- + +via: https://www.stgraber.org/2016/04/13/lxd-2-0-docker-in-lxd-712/ + +作者:[Stéphane Graber][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.stgraber.org/author/stgraber/ +[0]: https://www.stgraber.org/2016/03/11/lxd-2-0-blog-post-series-012/ +[1]: https://www.stgraber.org/2016/03/11/lxd-2-0-introduction-to-lxd-112/ +[2]: https://linuxcontainers.org/lxd/try-it/ From b54faae06699c6c0b2c7881824fc32019aa12d83 Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 11 May 2016 21:36:18 +0800 Subject: [PATCH 0737/1469] =?UTF-8?q?20150511-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/LXD/Part 8 - LXD 2.0--LXD in LXD.md | 124 +++++++++++++++++- 1 file changed, 122 insertions(+), 2 deletions(-) diff --git a/sources/tech/LXD/Part 8 - LXD 2.0--LXD in LXD.md b/sources/tech/LXD/Part 8 - LXD 2.0--LXD in LXD.md index 76c361e517..85d9873313 100644 --- a/sources/tech/LXD/Part 8 - LXD 2.0--LXD in LXD.md +++ b/sources/tech/LXD/Part 8 - LXD 2.0--LXD in LXD.md @@ -1,6 +1,126 @@ Part 8 - LXD 2.0: LXD in LXD ============================== -<原文待补充> +This is the eighth blog post [in this series about LXD 2.0][0]. -原文:https://www.stgraber.org/2016/04/14/lxd-2-0-lxd-in-lxd-812/ +![](https://linuxcontainers.org/static/img/containers.png) + +### Introduction + +In the previous post I covered how to run [Docker inside LXD][1] which is a good way to get access to the portfolio of application provided by Docker while running in the safety of the LXD environment. + +One use case I mentioned was offering a LXD container to your users and then have them use their container to run Docker. Well, what if they themselves want to run other Linux distributions inside their container using LXD, or even allow another group of people to have access to a Linux system by running a container for them? + +Turns out, LXD makes it very simple to allow your users to run nested containers. + +### Nesting LXD + +The most simple case can be shown by using an Ubuntu 16.04 image. Ubuntu 16.04 cloud images come with LXD pre-installed. The daemon itself isn’t running as it’s socket-activated so it doesn’t use any resources until you actually talk to it. + +So lets start an Ubuntu 16.04 container with nesting enabled: + +``` +lxc launch ubuntu-daily:16.04 c1 -c security.nesting=true +``` + +You can also set the security.nesting key on an existing container with: + +``` +lxc config set security.nesting true +``` + +Or for all containers using a particular profile with: + +``` +lxc profile set security.nesting true +``` + +With that container started, you can now get a shell inside it, configure LXD and spawn a container: + +``` +stgraber@dakara:~$ lxc launch ubuntu-daily:16.04 c1 -c security.nesting=true +Creating c1 +Starting c1 + +stgraber@dakara:~$ lxc exec c1 bash +root@c1:~# lxd init +Name of the storage backend to use (dir or zfs): dir + +We detected that you are running inside an unprivileged container. +This means that unless you manually configured your host otherwise, +you will not have enough uid and gid to allocate to your containers. + +LXD can re-use your container's own allocation to avoid the problem. +Doing so makes your nested containers slightly less safe as they could +in theory attack their parent container and gain more privileges than +they otherwise would. + +Would you like to have your containers share their parent's allocation (yes/no)? yes +Would you like LXD to be available over the network (yes/no)? no +Do you want to configure the LXD bridge (yes/no)? yes +Warning: Stopping lxd.service, but it can still be activated by: + lxd.socket +LXD has been successfully configured. + +root@c1:~# lxc launch ubuntu:14.04 trusty +Generating a client certificate. This may take a minute... +If this is your first time using LXD, you should also run: sudo lxd init + +Creating trusty +Retrieving image: 100% +Starting trusty + +root@c1:~# lxc list ++--------+---------+-----------------------+----------------------------------------------+------------+-----------+ +| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS | ++--------+---------+-----------------------+----------------------------------------------+------------+-----------+ +| trusty | RUNNING | 10.153.141.124 (eth0) | fd7:f15d:d1d6:da14:216:3eff:fef1:4002 (eth0) | PERSISTENT | 0 | ++--------+---------+-----------------------+----------------------------------------------+------------+-----------+ +root@c1:~# +``` + +It really is that simple! + +### The online demo server + +As this post is pretty short, I figured I would spend a bit of time to talk about the [demo server][2] we’re running. We also just reached the 10000 sessions mark earlier today! + +That server is basically just a normal LXD running inside a pretty beefy virtual machine with a tiny daemon implementing the REST API used by our website. + +When you accept the terms of service, a new LXD container is created for you with security.nesting enabled as we saw above. You are then attached to that container as you would when using “lxc exec” except that we’re doing it using websockets and javascript. + +The containers you then create inside this environment are all nested LXD containers. +You can then nest even further in there if you want to. + +We are using the whole range of [LXD resource limitations][3] to prevent one user’s actions from impacting the others and pretty closely monitor the server for any sign of abuse. + +If you want to run your own similar server, you can grab the code for our website and the daemon with: + +``` +git clone https://github.com/lxc/linuxcontainers.org +git clone https://github.com/lxc/lxd-demo-server +``` + +### Extra information + +The main LXD website is at: +Development happens on Github at: +Mailing-list support happens on: +IRC support happens in: #lxcontainers on irc.freenode.net + + +-------------------------------------------------------------------------------- + +via: https://www.stgraber.org/2016/04/14/lxd-2-0-lxd-in-lxd-812/ + +作者:[Stéphane Graber][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.stgraber.org/author/stgraber/ +[0]: https://www.stgraber.org/2016/03/11/lxd-2-0-blog-post-series-012/ +[1]: https://www.stgraber.org/2016/04/13/lxd-2-0-docker-in-lxd-712/ +[2]: https://linuxcontainers.org/lxd/try-it/ +[3]: https://www.stgraber.org/2016/03/26/lxd-2-0-resource-control-412/ From be6667966757a8f337dff561873685ce51d65a5c Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 11 May 2016 21:36:49 +0800 Subject: [PATCH 0738/1469] =?UTF-8?q?20150511-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/LXD/Part 7 - LXD 2.0--Docker in LXD.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/LXD/Part 7 - LXD 2.0--Docker in LXD.md b/sources/tech/LXD/Part 7 - LXD 2.0--Docker in LXD.md index bf4fe35c4f..d9b35735b8 100644 --- a/sources/tech/LXD/Part 7 - LXD 2.0--Docker in LXD.md +++ b/sources/tech/LXD/Part 7 - LXD 2.0--Docker in LXD.md @@ -1,7 +1,7 @@ Part 7 - LXD 2.0: Docker in LXD ================================== -This is the third blog post [in this series about LXD 2.0][0]. +This is the seventh blog post [in this series about LXD 2.0][0]. ![](https://linuxcontainers.org/static/img/containers.png) From 3718792549e28b9f72ee4303db456c481147427d Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 11 May 2016 21:42:57 +0800 Subject: [PATCH 0739/1469] =?UTF-8?q?20150511-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LXD/Part 9 - LXD 2.0--Live migration.md | 326 +++++++++++++++++- 1 file changed, 324 insertions(+), 2 deletions(-) diff --git a/sources/tech/LXD/Part 9 - LXD 2.0--Live migration.md b/sources/tech/LXD/Part 9 - LXD 2.0--Live migration.md index 7be46f6a00..51f9c8b1a7 100644 --- a/sources/tech/LXD/Part 9 - LXD 2.0--Live migration.md +++ b/sources/tech/LXD/Part 9 - LXD 2.0--Live migration.md @@ -1,6 +1,328 @@ Part 9 - LXD 2.0: Live migration ================================= -<正文待补充> +This is the ninth blog post [in this series about LXD 2.0][0]. -原文:https://www.stgraber.org/2016/04/25/lxd-2-0-live-migration-912/ +![](https://linuxcontainers.org/static/img/containers.png) + +### Introduction + +One of the very exciting feature of LXD 2.0, albeit experimental, is the support for container checkpoint and restore. + +Simply put, checkpoint/restore means that the running container state can be serialized down to disk and then restored, either on the same host as a stateful snapshot of the container or on another host which equates to live migration. + +### Requirements + +To have access to container live migration and stateful snapshots, you need the following: + +- A very recent Linux kernel, 4.4 or higher. +- CRIU 2.0, possibly with some cherry-picked commits depending on your exact kernel configuration. +- Run LXD directly on the host. It’s not possible to use those features with container nesting. +- For migration, the target machine must at least implement the instruction set of the source, the target kernel must at least offer the same syscalls as the source and any kernel filesystem which was mounted on the source must also be mountable on the target. + +All the needed dependencies are provided by Ubuntu 16.04 LTS, in which case, all you need to do is install CRIU itself: + +``` +apt install criu +``` + +### Using the thing + +#### Stateful snapshots + +A normal container snapshot looks like: + +``` +stgraber@dakara:~$ lxc snapshot c1 first +stgraber@dakara:~$ lxc info c1 | grep first + first (taken at 2016/04/25 19:35 UTC) (stateless) + ``` + +A stateful snapshot instead looks like: + +``` +stgraber@dakara:~$ lxc snapshot c1 second --stateful +stgraber@dakara:~$ lxc info c1 | grep second + second (taken at 2016/04/25 19:36 UTC) (stateful) + ``` + +This means that all the container runtime state was serialized to disk and included as part of the snapshot. Restoring one such snapshot is done as you would a stateless one: + +``` +stgraber@dakara:~$ lxc restore c1 second +stgraber@dakara:~$ +``` + +#### Stateful stop/start + +Say you want to reboot your server for a kernel update or similar maintenance. Rather than have to wait for all the containers to start from scratch after reboot, you can do: + +``` +stgraber@dakara:~$ lxc stop c1 --stateful +``` + +The container state will be written to disk and then picked up the next time you start it. + +You can even look at what the state looks like: + +``` +root@dakara:~# tree /var/lib/lxd/containers/c1/rootfs/state/ +/var/lib/lxd/containers/c1/rootfs/state/ +├── cgroup.img +├── core-101.img +├── core-102.img +├── core-107.img +├── core-108.img +├── core-109.img +├── core-113.img +├── core-114.img +├── core-122.img +├── core-125.img +├── core-126.img +├── core-127.img +├── core-183.img +├── core-1.img +├── core-245.img +├── core-246.img +├── core-50.img +├── core-52.img +├── core-95.img +├── core-96.img +├── core-97.img +├── core-98.img +├── dump.log +├── eventfd.img +├── eventpoll.img +├── fdinfo-10.img +├── fdinfo-11.img +├── fdinfo-12.img +├── fdinfo-13.img +├── fdinfo-14.img +├── fdinfo-2.img +├── fdinfo-3.img +├── fdinfo-4.img +├── fdinfo-5.img +├── fdinfo-6.img +├── fdinfo-7.img +├── fdinfo-8.img +├── fdinfo-9.img +├── fifo-data.img +├── fifo.img +├── filelocks.img +├── fs-101.img +├── fs-113.img +├── fs-122.img +├── fs-183.img +├── fs-1.img +├── fs-245.img +├── fs-246.img +├── fs-50.img +├── fs-52.img +├── fs-95.img +├── fs-96.img +├── fs-97.img +├── fs-98.img +├── ids-101.img +├── ids-113.img +├── ids-122.img +├── ids-183.img +├── ids-1.img +├── ids-245.img +├── ids-246.img +├── ids-50.img +├── ids-52.img +├── ids-95.img +├── ids-96.img +├── ids-97.img +├── ids-98.img +├── ifaddr-9.img +├── inetsk.img +├── inotify.img +├── inventory.img +├── ip6tables-9.img +├── ipcns-var-10.img +├── iptables-9.img +├── mm-101.img +├── mm-113.img +├── mm-122.img +├── mm-183.img +├── mm-1.img +├── mm-245.img +├── mm-246.img +├── mm-50.img +├── mm-52.img +├── mm-95.img +├── mm-96.img +├── mm-97.img +├── mm-98.img +├── mountpoints-12.img +├── netdev-9.img +├── netlinksk.img +├── netns-9.img +├── netns-ct-9.img +├── netns-exp-9.img +├── packetsk.img +├── pagemap-101.img +├── pagemap-113.img +├── pagemap-122.img +├── pagemap-183.img +├── pagemap-1.img +├── pagemap-245.img +├── pagemap-246.img +├── pagemap-50.img +├── pagemap-52.img +├── pagemap-95.img +├── pagemap-96.img +├── pagemap-97.img +├── pagemap-98.img +├── pages-10.img +├── pages-11.img +├── pages-12.img +├── pages-13.img +├── pages-1.img +├── pages-2.img +├── pages-3.img +├── pages-4.img +├── pages-5.img +├── pages-6.img +├── pages-7.img +├── pages-8.img +├── pages-9.img +├── pipes-data.img +├── pipes.img +├── pstree.img +├── reg-files.img +├── remap-fpath.img +├── route6-9.img +├── route-9.img +├── rule-9.img +├── seccomp.img +├── sigacts-101.img +├── sigacts-113.img +├── sigacts-122.img +├── sigacts-183.img +├── sigacts-1.img +├── sigacts-245.img +├── sigacts-246.img +├── sigacts-50.img +├── sigacts-52.img +├── sigacts-95.img +├── sigacts-96.img +├── sigacts-97.img +├── sigacts-98.img +├── signalfd.img +├── stats-dump +├── timerfd.img +├── tmpfs-dev-104.tar.gz.img +├── tmpfs-dev-109.tar.gz.img +├── tmpfs-dev-110.tar.gz.img +├── tmpfs-dev-112.tar.gz.img +├── tmpfs-dev-114.tar.gz.img +├── tty.info +├── unixsk.img +├── userns-13.img +└── utsns-11.img + +0 directories, 154 files +``` + +Restoring the container can be done with a simple: + +``` +stgraber@dakara:~$ lxc start c1 +``` + +### Live migration + +Live migration is basically the same as the stateful stop/start above, except that the container directory and configuration happens to be moved to another machine too. + +``` +stgraber@dakara:~$ lxc list c1 ++------+---------+-----------------------+----------------------------------------------+------------+-----------+ +| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS | ++------+---------+-----------------------+----------------------------------------------+------------+-----------+ +| c1 | RUNNING | 10.178.150.197 (eth0) | 2001:470:b368:4242:216:3eff:fe19:27b0 (eth0) | PERSISTENT | 2 | ++------+---------+-----------------------+----------------------------------------------+------------+-----------+ + +stgraber@dakara:~$ lxc list s-tollana: ++------+-------+------+------+------+-----------+ +| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS | ++------+-------+------+------+------+-----------+ + +stgraber@dakara:~$ lxc move c1 s-tollana: + +stgraber@dakara:~$ lxc list c1 ++------+-------+------+------+------+-----------+ +| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS | ++------+-------+------+------+------+-----------+ + +stgraber@dakara:~$ lxc list s-tollana: ++------+---------+-----------------------+----------------------------------------------+------------+-----------+ +| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS | ++------+---------+-----------------------+----------------------------------------------+------------+-----------+ +| c1 | RUNNING | 10.178.150.197 (eth0) | 2001:470:b368:4242:216:3eff:fe19:27b0 (eth0) | PERSISTENT | 2 | ++------+---------+-----------------------+----------------------------------------------+------------+-----------+ +``` + +### Limitations + +As I said before, checkpoint/restore of containers is still pretty new and we’re still very much working on this feature, fixing issues as we are made aware of them. We do need more people trying this feature and sending us feedback, I would however not recommend using this in production just yet. + +The current list of issues we’re tracking is [available on Launchpad][1]. + +We expect a basic Ubuntu container with a few services to work properly with CRIU in Ubuntu 16.04. However more complex containers, using device passthrough, complex network services or special storage configurations are likely to fail. + +Whenever possible, CRIU will fail at dump time, rather than at restore time. In such cases, the source container will keep running, the snapshot or migration will simply fail and a log file will be generated for debugging. + +In rare cases, CRIU fails to restore the container, in which case the source container will still be around but will be stopped and will have to be manually restarted. + +### Sending bug reports + +We’re tracking bugs related to checkpoint/restore against the CRIU Ubuntu package on Launchpad. Most of the work to fix those bugs will then happen upstream either on CRIU itself or the Linux kernel, but it’s easier for us to track things this way. + +To file a new bug report, head here. + +Please make sure to include: + +The command you ran and the error message as displayed to you + +- Output of “lxc info” (*) +- Output of “lxc info ” +- Output of “lxc config show –expanded ” +- Output of “dmesg” (*) +- Output of “/proc/self/mountinfo” (*) +- Output of “lxc exec — cat /proc/self/mountinfo” +- Output of “uname -a” (*) +- The content of /var/log/lxd.log (*) +- The content of /etc/default/lxd-bridge (*) +- A tarball of /var/log/lxd// (*) + +If reporting a migration bug as opposed to a stateful snapshot or stateful stop bug, please include the data for both the source and target for any of the above which has been marked with a (*). + +### Extra information + +The CRIU website can be found at: + +The main LXD website is at: + +Development happens on Github at: + +Mailing-list support happens on: + +IRC support happens in: #lxcontainers on irc.freenode.net + + +-------------------------------------------------------------------------------- + +via: https://www.stgraber.org/2016/03/19/lxd-2-0-your-first-lxd-container-312/ + +作者:[Stéphane Graber][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.stgraber.org/author/stgraber/ +[0]: https://www.stgraber.org/2016/03/11/lxd-2-0-blog-post-series-012/ +[1]: https://bugs.launchpad.net/ubuntu/+source/criu/+bugs +[3]: https://launchpad.net/ubuntu/+source/criu/+filebug?no-redirect From 943a78716503f97b05a645b778d511a98d6eac03 Mon Sep 17 00:00:00 2001 From: Purling Nayuki Date: Thu, 12 May 2016 13:31:42 +0800 Subject: [PATCH 0740/1469] Fix typos --- ...e Linux Distributions Would Presidential Hopefuls Run.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/translated/news/20150820 Which Open Source Linux Distributions Would Presidential Hopefuls Run.md b/translated/news/20150820 Which Open Source Linux Distributions Would Presidential Hopefuls Run.md index 30a81a51da..e87e93ca32 100644 --- a/translated/news/20150820 Which Open Source Linux Distributions Would Presidential Hopefuls Run.md +++ b/translated/news/20150820 Which Open Source Linux Distributions Would Presidential Hopefuls Run.md @@ -21,11 +21,11 @@ **Chris Christie** 会使用哪种系统呢?他肯定会依赖于一次设置便可持续工作的裸机 Linux 灾难恢复方案,而这就是 [Relax-and-Recover Linux][4]。Christie 使用它主要是因为他的政治工作,从那次华盛顿大桥事故后,他的政治动力就受到了影响。不管它是否能够让 Christie 挽回一切事故,但是当他的电脑死机的时候,至少可以找到一些意外丢失的机密邮件。 -至于 **Carly Fiorina**,她无疑将要使用 [Hewlett-Packard][6] (HPQ)为“[The Machine][5]”操作系统开发的软件,HPQ 是她在 1999 年到 2005 年这 6 年期间所管理的公司。事实上,这种机器可以运行部分不同操作系统,而我们并不清楚这些系统是否基于 Linux;**Carly Fiorina** 被惠普公司辞退后,开发操作系统工作就开始了。尽管如此,她仍然是她研究的计算机领域中的成功管理者。同时这也意味着她很难与惠普的彻底断绝关系。 +至于 **Carly Fiorina**,她无疑将要使用 [Hewlett-Packard][6] (HPQ)为“[The Machine][5]”操作系统开发的软件,HPQ 是她在 1999 年到 2005 年这 6 年期间所管理的公司。事实上,这种机器可以运行部分不同操作系统,而我们并不清楚这些系统是否基于 Linux;**Carly Fiorina** 被惠普公司辞退后,开发操作系统工作就开始了。尽管如此,她仍然是她研究的计算机领域中的成功管理者。同时这也意味着她很难与惠普彻底断绝关系。 -最后——这才是重点,你也猜到了——**Donald Trump**。想要拥有免费的、优秀的操作系统,他可能会用数百万美元去雇佣一个精英黑客团队去定制属于自己的操作系统;同时他也可以向别人炫耀自己的财力。他可能会吹嘘自己的操作系统是目前最好的系统。它肯定没有兼容 POSIX【译者注:可移植操作系统接口】或者采用一些其他的标准,因为那样的话就需要提供一些其他的很多的规则。同时这个系统完全不提供任何文档,因为如果 **Donald Trump** 向人们展示了他的系统的运行方式,很明显他会经受所有机密被泄露至伊斯兰国家的风险。 +最后——这才是重点,你也猜到了——**Donald Trump**。想要拥有免费的、优秀的操作系统的他,可能会用数百万美元去雇佣一个精英黑客团队去定制属于自己的操作系统;同时他也可以向别人炫耀自己的财力。他可能会吹嘘自己的操作系统是目前最好的系统。它肯定没有兼容 POSIX【译者注:可移植操作系统接口】或者采用一些其他的标准,因为那样的话就需要提供一些其他的很多的规则。同时这个系统完全不提供任何文档,因为如果 **Donald Trump** 向人们展示了他的系统的运行方式,很明显他会经受所有机密被泄露至伊斯兰国家的风险。 -非此即彼,如果 **Donald Trump** 非要选择一种已有的 Linux 操作系统, [Ubuntu][7] 应该是明智的选择。而 **Donald Trump** 也是 Ubuntu 的开发者,他和他的团队按照他们的想法,通过开发他们自由的甚至是专有的应用和接口去打造他们认为的开源软件。自由软件纯化论者却很不喜欢这种开发模式,他们很反感使用 Ubuntu,反而很多其他人更喜欢 Ubuntu。当然,长远来看,关于这种做法的争论(无论是政治领域还是软件领域)还待见分晓。 +非此即彼,如果 **Donald Trump** 非要选择一种已有的 Linux 操作系统, [Ubuntu][7] 应该是明智的选择。而 **Donald Trump** 也是 Ubuntu 的开发者,他和他的团队按照他们的想法,通过开发他们自有的甚至是专有的应用和接口去打造他们认为的开源软件。自由软件纯化论者却很不喜欢这种开发模式,他们很反感使用 Ubuntu,反而很多其他人更喜欢 Ubuntu。当然,长远来看,关于这种做法的争论(无论是政治领域还是软件领域)还待见分晓。 ### 敬请期待 ### From 15da08fd841b06edba8d4c79dc5adaaa72d66d1a Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 12 May 2016 21:20:14 +0800 Subject: [PATCH 0741/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/LXD/Part 4 - LXD 2.0--Resource control.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sources/tech/LXD/Part 4 - LXD 2.0--Resource control.md b/sources/tech/LXD/Part 4 - LXD 2.0--Resource control.md index e404cccffa..736c5b84bc 100644 --- a/sources/tech/LXD/Part 4 - LXD 2.0--Resource control.md +++ b/sources/tech/LXD/Part 4 - LXD 2.0--Resource control.md @@ -1,3 +1,6 @@ +ezio is translating + + Part 4 - LXD 2.0: Resource control ====================================== From e4e812e422e93fd5d4cb0d98598b9ff23169e18a Mon Sep 17 00:00:00 2001 From: vim-kakali <1799225723@qq.com> Date: Fri, 13 May 2016 16:18:24 +0800 Subject: [PATCH 0742/1469] vim-kakali translating --- .../20160505 Confessions of a cross-platform developer.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sources/talk/20160505 Confessions of a cross-platform developer.md b/sources/talk/20160505 Confessions of a cross-platform developer.md index 807dfd544b..0f6af84070 100644 --- a/sources/talk/20160505 Confessions of a cross-platform developer.md +++ b/sources/talk/20160505 Confessions of a cross-platform developer.md @@ -1,3 +1,7 @@ +vim-kakali translating + + + Confessions of a cross-platform developer ============================================= From edc75c98c9a9b269823119a29ef1c4f670c5aae8 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 14 May 2016 18:19:44 +0800 Subject: [PATCH 0743/1469] PUB:20150820 Which Open Source Linux Distributions Would Presidential Hopefuls Run MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @vim-kakali , @PurlingNayuki ,我认为这篇文章的翻译和校对都存在一些问题,因此我做了较大篇幅的修正,请参考比较。可能也有错误或者大家有不同的翻译意见,希望可以展开讨论。 --- ...butions Would Presidential Hopefuls Run.md | 53 +++++++++++++++++++ ...butions Would Presidential Hopefuls Run.md | 53 ------------------- 2 files changed, 53 insertions(+), 53 deletions(-) create mode 100644 published/20150820 Which Open Source Linux Distributions Would Presidential Hopefuls Run.md delete mode 100644 translated/news/20150820 Which Open Source Linux Distributions Would Presidential Hopefuls Run.md diff --git a/published/20150820 Which Open Source Linux Distributions Would Presidential Hopefuls Run.md b/published/20150820 Which Open Source Linux Distributions Would Presidential Hopefuls Run.md new file mode 100644 index 0000000000..87c91930b3 --- /dev/null +++ b/published/20150820 Which Open Source Linux Distributions Would Presidential Hopefuls Run.md @@ -0,0 +1,53 @@ +如果总统候选人们要使用 Linux 发行版,他们会选择哪个? +================================================================================ +![Republican presidential candidate Donald Trump +](http://thevarguy.com/site-files/thevarguy.com/files/imagecache/medium_img/uploads/2015/08/donaldtrump.jpg) + +*共和党总统候选人 Donald Trump【译者注:唐纳德·特朗普,美国地产大亨、作家、主持人】* + +如果要竞选总统的人们使用 Linux 或其他的开源操作系统,那么会使用哪个发行版呢?问题的关键是存在许多其它的因素,比如,一些“政治立场”问题,或者是给一个发行版的名字添加上感叹号是否合适——而这问题一直被忽视。先不管这些忽视:接下来是时事新闻工作者关于总统大选和 Linux 发行版的报道。 + +对于那些已经看了很多年我的文字的人来说(除了我亲爱的的编辑之外,他们一直听我的瞎扯是不是倒霉到家了?),这篇文章听起来很熟悉,这是因为我在去年的总统选举期间写了一篇[类似的文章][1]。一些读者把这篇文章的内容看的比我想象的还要严肃,所以我会花点时间阐述我的观点:事实上,我不认为开源软件和政治运动彼此之间有多大的关系。我写那样的文章仅仅是新的一周的自我消遣罢了。 + +当然,你也可以认为它们彼此相关,毕竟你才是读者。 + +### Linux 发行版之选:共和党人们 ### + +今天,我只是谈及一些有关共和党人们的话题,我甚至只会谈论他们的其中一部分。因为共和党的提名人太多了,以至于我写满了整篇文章。由此开始: + +如果 **Jeb (Jeb!?) Bush** 使用 Linux,它一定是 [Debian][2]。Debian 属于一个相当无趣的分支,它是为真正意义上的、成熟的黑客设计的,这些人将清理那些由经验不甚丰富的开源爱好者所造成的混乱视为一大使命。当然,这也使得 Debian 显得很枯燥,所以它已有的用户基数一直在缩减。 + +**Scott Walker** ,对于他来说,应该是一个 [Damn Small Linux][3] (DSL) 用户。这个系统仅仅需要 50MB 的硬盘空间和 16MB 的 RAM 便可运行。DSL 可以使一台 20 年前的 486 计算机焕发新春,而这恰好符合了 **Scott Walker** 所主张的消减成本计划。当然,你在 DSL 上的用户体验也十分原始,这个系统平台只能够运行一个浏览器。但是至少你你不用浪费钱财购买新的电脑硬件,你那台 1993 年购买的机器仍然可以为你好好的工作。 + +**Chris Christie** 会使用哪种系统呢?他肯定会使用 [Relax-and-Recover Linux][4],它号称“一次搞定(Setup-and-forget)的裸机 Linux 灾难恢复方案” 。从那次不幸的华盛顿大桥事故后,“一次搞定(Setup-and-forget)”基本上便成了 Christie 的政治主张。不管灾难恢复是否能够让 Christie 最终挽回一切,但是当他的电脑死机的时候,至少可以找到一两封意外丢失的机密邮件。 + +至于 **Carly Fiorina**,她无疑将要使用 [惠普][6] (HPQ)为“[The Machine][5]”开发的操作系统,她在 1999 年到 2005 年这 6 年期间管理的这个公司。事实上,The Machine 可以运行几种不同的操作系统,也许是基于 Linux 的,也许不是,我们并不太清楚,它的开发始于 **Carly Fiorina** 在惠普公司的任期结束后。不管怎么说,作为 IT 圈里一个成功的管理者,这是她履历里面重要的组成部分,同时这也意味着她很难与惠普彻底断绝关系。 + +最后,但并不是不重要,你也猜到了——**Donald Trump**。他显然会动用数百万美元去雇佣一个精英黑客团队去定制属于自己的操作系统——尽管他原本是想要免费获得一个完美的、现成的操作系统——然后还能向别人炫耀自己的财力。他可能会吹嘘自己的操作系统是目前最好的系统,虽然它可能没有兼容 POSIX 或者一些其它的标准,因为那样的话就需要花掉更多的钱。同时这个系统也将根本不会提供任何文档,因为如果 **Donald Trump** 向人们解释他的系统的实际运行方式,他会冒着所有机密被泄露至伊斯兰国家的风险,绝对是这样的。 + +另外,如果 **Donald Trump** 非要选择一种已有的 Linux 平台的话, [Ubuntu][7] 应该是明智的选择。就像 **Donald Trump** 一样, Ubuntu 的开发者秉承“我们做自己想要做的”原则,通过他们自己的实现来构建开源软件。自由软件纯化论者却很反感 Ubuntu 这一点,但是很多普通用户却更喜欢一些。当然,无论你是不是一个纯粹论者,无论是在软件领域还是政治领域,还需要时间才能知道分晓。 + +### 敬请期待 ### + +如果你想知道为什么我还没有提到民主党候选人,别想多了。我没有在这篇文章中提及他们,是因为我对民主党并不比共和党喜欢更多或更少一点(我个人认为,这种只有两个政党的美国特色是不荒谬的,根本不能体现民主,我也不相信这些党派候选人)。 + +另一方面,也可能会有很多人关心民主党候选人使用的 Linux 发行版。后续的帖子中我会提及的,请拭目以待。 + +-------------------------------------------------------------------------------- + +via: http://thevarguy.com/open-source-application-software-companies/081715/which-open-source-linux-distributions-would-presidential- + +作者:[Christopher Tozzi][a] +译者:[vim-kakali](https://github.com/vim-kakali) +校对:[PurlingNayuki](https://github.com/PurlingNayuki), [wxy](https://github.com/wxy/) + +本文由 [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/ diff --git a/translated/news/20150820 Which Open Source Linux Distributions Would Presidential Hopefuls Run.md b/translated/news/20150820 Which Open Source Linux Distributions Would Presidential Hopefuls Run.md deleted file mode 100644 index e87e93ca32..0000000000 --- a/translated/news/20150820 Which Open Source Linux Distributions Would Presidential Hopefuls Run.md +++ /dev/null @@ -1,53 +0,0 @@ -总统更乐意使用哪种开源Linux分支? -================================================================================ -![Republican presidential candidate Donald Trump -](http://thevarguy.com/site-files/thevarguy.com/files/imagecache/medium_img/uploads/2015/08/donaldtrump.jpg) - -共和党总统候选人 Donald Trump【译者注:唐纳德·特朗普,美国地产大亨、作家、主持人】 - -如果人们要竞选总统,而决定因素却是使用 Linux 或其他的开源操作系统,那么这样的系统会是哪个发行版呢?关键是存在与其他很多事情有关的问题,而这正好使我们很难抉择;比如,一些“政治立场”问题,或者是要判断某一个分支诞生时为它的名字加上感叹号是否合适——而这些问题一直被忽视。而忽视到此就结束了:接下来是时事新闻工作者关于总统大选和 Linux 分支的报道。 - -对于那些已经看了很多年我的文字的人来说(除了我亲爱的的编辑之外,他们一直听我的瞎扯是不是倒霉到家了?),这些话听起来很熟悉,这是因为我在去年的总统选举期间写了一篇[类似的文章][1]。一些有趣的读者把这里面的内容看的很正式,然而我并不是这样想的,所以我会花点时间阐述我的观点:事实上,我不认为开源软件和政治运动对于一些事情有多大的意义。我写那样的文章仅仅是新的一周的自我消遣罢了。 - -当然,你也可以去了解更多的你想知道的东西,毕竟你才是读者。 - -### Linux 分支:共和党人的选择 ### - -今天,我只是谈及一些有关共和主义的话题,我甚至只会谈论他们的其中一部分。因为共和党的期望提名太多了以至于我写满了整篇文章。由此开始: - -如果 **Jeb (Jeb!?) Bush** 使用 Linux,它一定是 [Debian][2]。Debian 属于一个相当无趣的分支,它是为真正意义上的黑客设计的,它们将快速成长起来并清理经验不甚丰富的开源爱好者造成的混乱视为一大使命。当然,这也使得Debian显得很枯燥,所以它已有的用户基础一直在缩减。 - -**Scott Walker** 是一个 [Damn Small Linux][3] (DSL) 用户。这个系统仅仅需要 50MB 的硬盘空间和 16MB 的 RAM 便可完美运行。DSL 可以使一台 20 年前的 486 计算机充满活力;而这恰好满足了 **Scott Walker** 消减硬件成本的需求。当然,你使用 DSL 的体验也是最原始的;这个系统平台只能够运行一个浏览器。但是至少你在 1993 年购买的机器现在仍然能很好的工作,这样你也不用浪费钱财购买新的电脑硬件。 - -**Chris Christie** 会使用哪种系统呢?他肯定会依赖于一次设置便可持续工作的裸机 Linux 灾难恢复方案,而这就是 [Relax-and-Recover Linux][4]。Christie 使用它主要是因为他的政治工作,从那次华盛顿大桥事故后,他的政治动力就受到了影响。不管它是否能够让 Christie 挽回一切事故,但是当他的电脑死机的时候,至少可以找到一些意外丢失的机密邮件。 - -至于 **Carly Fiorina**,她无疑将要使用 [Hewlett-Packard][6] (HPQ)为“[The Machine][5]”操作系统开发的软件,HPQ 是她在 1999 年到 2005 年这 6 年期间所管理的公司。事实上,这种机器可以运行部分不同操作系统,而我们并不清楚这些系统是否基于 Linux;**Carly Fiorina** 被惠普公司辞退后,开发操作系统工作就开始了。尽管如此,她仍然是她研究的计算机领域中的成功管理者。同时这也意味着她很难与惠普彻底断绝关系。 - -最后——这才是重点,你也猜到了——**Donald Trump**。想要拥有免费的、优秀的操作系统的他,可能会用数百万美元去雇佣一个精英黑客团队去定制属于自己的操作系统;同时他也可以向别人炫耀自己的财力。他可能会吹嘘自己的操作系统是目前最好的系统。它肯定没有兼容 POSIX【译者注:可移植操作系统接口】或者采用一些其他的标准,因为那样的话就需要提供一些其他的很多的规则。同时这个系统完全不提供任何文档,因为如果 **Donald Trump** 向人们展示了他的系统的运行方式,很明显他会经受所有机密被泄露至伊斯兰国家的风险。 - -非此即彼,如果 **Donald Trump** 非要选择一种已有的 Linux 操作系统, [Ubuntu][7] 应该是明智的选择。而 **Donald Trump** 也是 Ubuntu 的开发者,他和他的团队按照他们的想法,通过开发他们自有的甚至是专有的应用和接口去打造他们认为的开源软件。自由软件纯化论者却很不喜欢这种开发模式,他们很反感使用 Ubuntu,反而很多其他人更喜欢 Ubuntu。当然,长远来看,关于这种做法的争论(无论是政治领域还是软件领域)还待见分晓。 - -### 敬请期待 ### - -如果你想知道为什么我还没有提到民主党候人,别想了。我不会在这篇文章中提及他们,因为我一直对民主党和共和党保持中立观点(我个人认为,像美国这样的的情况,只有两个政党是不合理的;事实上,这种意义上的民主就显得很可笑,所以我不太相信这些党派候选人)。 - -相反,也可能会有很多人关心民主党候选人使用的Linux分支。后续的帖子中我会提及的,请拭目以待。 - --------------------------------------------------------------------------------- - -via: http://thevarguy.com/open-source-application-software-companies/081715/which-open-source-linux-distributions-would-presidential- - -作者:[Christopher Tozzi][a] -译者:[vim-kakali](https://github.com/vim-kakali) -校对:[PurlingNayuki](https://github.com/PurlingNayuki) - -本文由 [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/ From a890ab283011bb733da579e875f3e1e5021909cb Mon Sep 17 00:00:00 2001 From: ictlyh Date: Sat, 14 May 2016 19:44:53 +0800 Subject: [PATCH 0744/1469] Translated sources/tech/LFCS/Part 7 - LFCS--Managing System Startup Process and Services SysVinit Systemd and Upstart.md --- ...d Services SysVinit Systemd and Upstart.md | 67 ++++++++++++++++--- 1 file changed, 58 insertions(+), 9 deletions(-) rename {sources => translated}/tech/LFCS/Part 7 - LFCS--Managing System Startup Process and Services SysVinit Systemd and Upstart.md (70%) diff --git a/sources/tech/LFCS/Part 7 - LFCS--Managing System Startup Process and Services SysVinit Systemd and Upstart.md b/translated/tech/LFCS/Part 7 - LFCS--Managing System Startup Process and Services SysVinit Systemd and Upstart.md similarity index 70% rename from sources/tech/LFCS/Part 7 - LFCS--Managing System Startup Process and Services SysVinit Systemd and Upstart.md rename to translated/tech/LFCS/Part 7 - LFCS--Managing System Startup Process and Services SysVinit Systemd and Upstart.md index af3ac034be..b902fd23d9 100644 --- a/sources/tech/LFCS/Part 7 - LFCS--Managing System Startup Process and Services SysVinit Systemd and Upstart.md +++ b/translated/tech/LFCS/Part 7 - LFCS--Managing System Startup Process and Services SysVinit Systemd and Upstart.md @@ -1,92 +1,127 @@ -ictlyh Translating +LFCS 系列第七讲: 通过 SysVinit、Systemd 和 Upstart 管理系统自启动进程和服务 Part 7 - LFCS: Managing System Startup Process and Services (SysVinit, Systemd and Upstart) ================================================================================ +几个月前, Linux 基金会宣布 LFCS(Linux 基金会认证系统管理员) 认证诞生了,这个令人兴奋的新计划定位于让来自全球各地的初级到中级的 Linux 系统管理员得到认证。这其中包括维护已经在运行的系统和服务能力、第一手的问题查找和分析能力、以及决定何时向开发团队提交问题的能力。 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 基金会认证系统管理员 Linux Foundation Certified Sysadmin – Part 7 +下面的视频简要介绍了 Linux 基金会认证计划。 The following video describes an brief introduction to The Linux Foundation Certification Program. 注:youtube 视频 +这篇博文是 10 指南系列中的第七篇,在这篇文章中,我们会介绍如何管理 Linux 系统自启动进程和服务,这是 LFCS 认证考试要求的一部分。 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. +### 管理 Linux 自启动进程 ### ### Managing the Linux Startup Process ### +Linux 系统的启动程序包括多个阶段,每个阶段由一个不同的组件表示。下面的图示简要总结了启动过程以及所有包括的主要组件。 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 启动过程 Linux Boot Process +当你按下你机器上的电源键时, 存储在主板 EEPROM 芯片中的固件初始化 POST(通电自检) 检查系统硬件资源的状态。POST 结束后,固件会搜索并加载位于第一块可用磁盘上的 MBR 或 EFI 分区的第一阶段引导程序,并把控制权交给引导程序。 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 方式 #### #### MBR Method #### +MBR 是位于 BISO 设置中标记为可启动磁盘上的第一个扇区,大小是 512 个字节。 The MBR is located in the first sector of the disk marked as bootable in the BIOS settings and is 512 bytes in size. +- 前面 446 个字节:包括可执行代码和错误信息文本的引导程序 +- 接下来的 64 个字节:四个分区(主分区或扩展分区)中每个分区一条记录的分区表。其中,每条记录标示了每个一个分区的状态(是否活跃)、大小以及开始和结束扇区。 +- 最后 2 个字节: MBR 有效性检查的魔数。 - 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. +下面的命令对 MBR 进行备份(在本例中,/dev/sda 是第一块硬盘)。结果文件 mbr.bkp 在分区表被破坏、例如系统不可引导时能排上用场。 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. +当然,为了后面需要的时候能使用它,我们需要把它保存到别的地方(例如一个 USB 设备)。该文件能帮助我们重新恢复 MBR,这只在我们操作过程中没有改变硬盘驱动布局时才有效。 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. +**备份 MBR** **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) +在 Linux 中备份 MBR Backup MBR in Linux +**恢复 MBR** **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) +在 Linux 中恢复 MBR Restore MBR in Linux +#### EFI/UEFI 方式 #### #### EFI/UEFI Method #### +对于使用 EFI/UEFI 方式的系统, UEFI 固件读取它的设置来决定从哪里启动哪个 UEFI 应用。(例如, EFI 分区位于哪块磁盘或分区)。 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). +接下来,加载并运行第二阶段引导程序(又名引导管理器)。GRUB[GRand Unified Boot] 是 Linux 中最常使用的引导管理器。今天大部分使用的系统中都能找到它两个中的其中一个版本。 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 有效配置文件: /boot/grub/menu.lst(旧发行版, EFI/UEFI 固件不支持)。 +- GRUB2 配置文件: 通常是 /etc/default/grub。 - GRUB legacy configuration file: /boot/grub/menu.lst (older distributions, not supported by EFI/UEFI firmwares). - GRUB2 configuration file: most likely, /etc/default/grub. +尽管 LFCS 考试目标没有明确要求了解 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 +为了使更改生效,你需要以 root 用户修改 GRUB 的配置。 As root after modifying GRUB’s configuration in order to apply the changes. +首先, GRUB 加载默认的内核以及 initrd 或 initramfs 镜像。补充一句,initrd 或者 initramfs 帮助完成硬件检测、内核模块加载、以及发现挂载根目录文件系统需要的设备。 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. +一旦真正的根目录文件系统启动,为了显示用户界面,内核就会执行系统和服务管理器(init 或 systemd,进程号 PID 一般为 1)开始普通用户态的引导程序。 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. +init 和 systemd 都是管理其它守护进程的守护进程(后台进程),它们总是最先启动(系统引导时),最后结束(系统关闭时)。 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 +Systemd 和 Init +### 自启动服务(SysVinit) ### ### Starting Services (SysVinit) ### +Linux 中运行等级的概念表示通过控制运行哪些服务来以不同方式使用系统。换句话说,运行等级控制着当前执行状态下可以完成什么任务(以及什么不能完成)。 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). +传统上,这个启动过程是基于起源于 System V Unix 的形式,通过执行脚本启动或者停止服务从而使机器进入指定的运行等级(换句话说,是一个不同的系统运行模式)。 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). +在每个运行等级中,独立服务可以设置为运行、或者在运行时关闭。一些主流发行版的最新版本中,已经移除了标准的 System V,而用一个称为 systemd(表示系统守护进程)的新服务和系统管理器代替,但为了兼容性,通常也支持 sysv 命令。这意味着你可以在基于 systemd 的发行版中运行大部分有名的 sysv 初始化工具。 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] +- 推荐阅读: [Linux 为什么用 ‘systemd’ 代替 ‘init’][1] +除了启动系统进程,init 还会查看 /etc/inittab 来决定进入哪个运行等级。 Besides starting the system process, init looks to the /etc/inittab file to decide what runlevel must be entered. 注:表格 @@ -102,61 +137,73 @@ Besides starting the system process, init looks to the /etc/inittab file to deci 0 -  Halt the system. Runlevel 0 is a special transitional state used to shutdown the system quickly. +  停止系统。运行等级 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. +  别名为 s 或 S,这个运行等级有时候也称为维护模式。在这个运行等级启动的服务由于发行版不同而不同。通常用于正常系统操作损坏时低级别的系统维护。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. +  多用户。在 Debian 系统及其衍生版中,这是默认的运行等级,还包括了一个图形化登录(如果有的话)。在基于红帽的系统中,这是没有网络的多用户模式。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. +  在基于红帽的系统中,这是默认的多用户模式,运行除了图形化环境以外的所有东西。基于 Debian 的系统中通常不会使用这个运行等级以及等级 4 和 5。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. +  通常默认情况下不使用,可用于自定制。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. +  基于红帽的系统中,支持 GUI 登录的完全多用户模式。这个运行等级和等级 3 类似,但是有可用的 GUI 登录。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. +  重启系统。Reboot the system. +要在运行等级之间切换,我们只需要使用 init 命令更改运行等级:init N(其中 N 是上面列出的一个运行等级)。 +请注意这并不是运行中的系统切换运行等级的推荐方式,因为它不会给已经登录的用户发送警告(因而导致他们丢失工作以及进程异常终结)。 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). +相反,应该用 shutdown 命令重启系统(它首先发送警告信息给所有已经登录的用户,并锁住任何新的登录;然后再给 init 发送信号切换运行等级)但是,首先要在 /etc/inittab 文件中设置好默认的运行等级(系统引导到的等级)。 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. +因为这个原因,按照下面的步骤切当地切换运行等级。以 root 用户在 /etc/inittab 中查找下面的行。 For that reason, follow these steps to properly switch between runlevels, As root, look for the following line in /etc/inittab. id:2:initdefault: +并用你喜欢的文本编辑器,例如 vim(本系列的[第二讲 : 如何在 Linux 中使用 vi/vim 编辑器][2]),更改数字 2 为想要的运行等级。 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). +然后,以 root 用户执行 Next, run as root. # shutdown -r now +最后一个命令会重启系统,并使它在下一次引导时进入指定的运行等级,并会执行保存在 /etc/rc[runlevel].d 目录中的脚本以决定应该启动什么服务、不应该启动什么服务。例如,在下面的系统中运行等级 2。 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) +在 Linux 中更改运行等级 Change Runlevels in Linux +#### 使用 chkconfig 管理服务 #### #### Manage Services using chkconfig #### +为了在启动时启动或者停用系统服务,我们可以在 CentOS / openSUSE 中使用 [chkconfig 命令][3],在 Debian 及其衍生版中使用 sysv-rc-conf 命令。这个工具还能告诉我们对于一个指定的运行等级预先配置的状态是什么。 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. +- 推荐阅读: [如何在 Linux 中停止和停用不想要的服务][4] - Read Also: [How to Stop and Disable Unwanted Services in Linux][4] +列出某个服务的运行等级配置。 Listing the runlevel configuration for a service. # chkconfig --list [service name] @@ -165,8 +212,10 @@ Listing the runlevel configuration for a service. ![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). From 4a8e4315d6b3d1df79bc8d0d9255beed9e652440 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Sat, 14 May 2016 23:21:00 +0800 Subject: [PATCH 0745/1469] Translated tech/LFCS/Part 7 - LFCS--Managing System Startup Process and Services SysVinit Systemd and Upstart.md --- ...d Services SysVinit Systemd and Upstart.md | 204 +++++++----------- 1 file changed, 79 insertions(+), 125 deletions(-) diff --git a/translated/tech/LFCS/Part 7 - LFCS--Managing System Startup Process and Services SysVinit Systemd and Upstart.md b/translated/tech/LFCS/Part 7 - LFCS--Managing System Startup Process and Services SysVinit Systemd and Upstart.md index b902fd23d9..0c4c1ac766 100644 --- a/translated/tech/LFCS/Part 7 - LFCS--Managing System Startup Process and Services SysVinit Systemd and Upstart.md +++ b/translated/tech/LFCS/Part 7 - LFCS--Managing System Startup Process and Services SysVinit Systemd and Upstart.md @@ -1,128 +1,92 @@ LFCS 系列第七讲: 通过 SysVinit、Systemd 和 Upstart 管理系统自启动进程和服务 -Part 7 - LFCS: Managing System Startup Process and Services (SysVinit, Systemd and Upstart) ================================================================================ 几个月前, Linux 基金会宣布 LFCS(Linux 基金会认证系统管理员) 认证诞生了,这个令人兴奋的新计划定位于让来自全球各地的初级到中级的 Linux 系统管理员得到认证。这其中包括维护已经在运行的系统和服务能力、第一手的问题查找和分析能力、以及决定何时向开发团队提交问题的能力。 -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 基金会认证系统管理员 -Linux Foundation Certified Sysadmin – Part 7 下面的视频简要介绍了 Linux 基金会认证计划。 -The following video describes an brief introduction to The Linux Foundation Certification Program. 注:youtube 视频 这篇博文是 10 指南系列中的第七篇,在这篇文章中,我们会介绍如何管理 Linux 系统自启动进程和服务,这是 LFCS 认证考试要求的一部分。 -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. ### 管理 Linux 自启动进程 ### -### Managing the Linux Startup Process ### Linux 系统的启动程序包括多个阶段,每个阶段由一个不同的组件表示。下面的图示简要总结了启动过程以及所有包括的主要组件。 -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 启动过程 -Linux Boot Process 当你按下你机器上的电源键时, 存储在主板 EEPROM 芯片中的固件初始化 POST(通电自检) 检查系统硬件资源的状态。POST 结束后,固件会搜索并加载位于第一块可用磁盘上的 MBR 或 EFI 分区的第一阶段引导程序,并把控制权交给引导程序。 -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 方式 #### -#### MBR Method #### MBR 是位于 BISO 设置中标记为可启动磁盘上的第一个扇区,大小是 512 个字节。 -The MBR is located in the first sector of the disk marked as bootable in the BIOS settings and is 512 bytes in size. - 前面 446 个字节:包括可执行代码和错误信息文本的引导程序 - 接下来的 64 个字节:四个分区(主分区或扩展分区)中每个分区一条记录的分区表。其中,每条记录标示了每个一个分区的状态(是否活跃)、大小以及开始和结束扇区。 - 最后 2 个字节: MBR 有效性检查的魔数。 -- 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. 下面的命令对 MBR 进行备份(在本例中,/dev/sda 是第一块硬盘)。结果文件 mbr.bkp 在分区表被破坏、例如系统不可引导时能排上用场。 -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. 当然,为了后面需要的时候能使用它,我们需要把它保存到别的地方(例如一个 USB 设备)。该文件能帮助我们重新恢复 MBR,这只在我们操作过程中没有改变硬盘驱动布局时才有效。 -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. **备份 MBR** -**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) 在 Linux 中备份 MBR -Backup MBR in Linux **恢复 MBR** -**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) 在 Linux 中恢复 MBR -Restore MBR in Linux #### EFI/UEFI 方式 #### -#### EFI/UEFI Method #### -对于使用 EFI/UEFI 方式的系统, UEFI 固件读取它的设置来决定从哪里启动哪个 UEFI 应用。(例如, EFI 分区位于哪块磁盘或分区)。 -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). +对于使用 EFI/UEFI 方式的系统, UEFI 固件读取它的设置来决定从哪里启动哪个 UEFI 应用。(例如, EFI 分区位于哪块磁盘或分区。 接下来,加载并运行第二阶段引导程序(又名引导管理器)。GRUB[GRand Unified Boot] 是 Linux 中最常使用的引导管理器。今天大部分使用的系统中都能找到它两个中的其中一个版本。 -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 有效配置文件: /boot/grub/menu.lst(旧发行版, EFI/UEFI 固件不支持)。 - GRUB2 配置文件: 通常是 /etc/default/grub。 -- GRUB legacy configuration file: /boot/grub/menu.lst (older distributions, not supported by EFI/UEFI firmwares). -- GRUB2 configuration file: most likely, /etc/default/grub. 尽管 LFCS 考试目标没有明确要求了解 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 为了使更改生效,你需要以 root 用户修改 GRUB 的配置。 -As root after modifying GRUB’s configuration in order to apply the changes. 首先, GRUB 加载默认的内核以及 initrd 或 initramfs 镜像。补充一句,initrd 或者 initramfs 帮助完成硬件检测、内核模块加载、以及发现挂载根目录文件系统需要的设备。 -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. 一旦真正的根目录文件系统启动,为了显示用户界面,内核就会执行系统和服务管理器(init 或 systemd,进程号 PID 一般为 1)开始普通用户态的引导程序。 -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. init 和 systemd 都是管理其它守护进程的守护进程(后台进程),它们总是最先启动(系统引导时),最后结束(系统关闭时)。 -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 和 Init ### 自启动服务(SysVinit) ### -### Starting Services (SysVinit) ### Linux 中运行等级的概念表示通过控制运行哪些服务来以不同方式使用系统。换句话说,运行等级控制着当前执行状态下可以完成什么任务(以及什么不能完成)。 -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). 传统上,这个启动过程是基于起源于 System V Unix 的形式,通过执行脚本启动或者停止服务从而使机器进入指定的运行等级(换句话说,是一个不同的系统运行模式)。 -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). 在每个运行等级中,独立服务可以设置为运行、或者在运行时关闭。一些主流发行版的最新版本中,已经移除了标准的 System V,而用一个称为 systemd(表示系统守护进程)的新服务和系统管理器代替,但为了兼容性,通常也支持 sysv 命令。这意味着你可以在基于 systemd 的发行版中运行大部分有名的 sysv 初始化工具。 -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] - 推荐阅读: [Linux 为什么用 ‘systemd’ 代替 ‘init’][1] 除了启动系统进程,init 还会查看 /etc/inittab 来决定进入哪个运行等级。 -Besides starting the system process, init looks to the /etc/inittab file to decide what runlevel must be entered. 注:表格 @@ -137,74 +101,63 @@ Besides starting the system process, init looks to the /etc/inittab file to deci - + - + - + - + - + - + - +
0 停止系统。运行等级 0 是一个用于快速关闭系统的特殊过渡状态。Halt the system. Runlevel 0 is a special transitional state used to shutdown the system quickly. 停止系统。运行等级 0 是一个用于快速关闭系统的特殊过渡状态。
1 别名为 s 或 S,这个运行等级有时候也称为维护模式。在这个运行等级启动的服务由于发行版不同而不同。通常用于正常系统操作损坏时低级别的系统维护。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. 别名为 s 或 S,这个运行等级有时候也称为维护模式。在这个运行等级启动的服务由于发行版不同而不同。通常用于正常系统操作损坏时低级别的系统维护。
2 多用户。在 Debian 系统及其衍生版中,这是默认的运行等级,还包括了一个图形化登录(如果有的话)。在基于红帽的系统中,这是没有网络的多用户模式。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. 多用户。在 Debian 系统及其衍生版中,这是默认的运行等级,还包括了一个图形化登录(如果有的话)。在基于红帽的系统中,这是没有网络的多用户模式。
3 在基于红帽的系统中,这是默认的多用户模式,运行除了图形化环境以外的所有东西。基于 Debian 的系统中通常不会使用这个运行等级以及等级 4 和 5。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. 在基于红帽的系统中,这是默认的多用户模式,运行除了图形化环境以外的所有东西。基于 Debian 的系统中通常不会使用这个运行等级以及等级 4 和 5。
4 通常默认情况下不使用,可用于自定制。Typically unused by default and therefore available for customization. 通常默认情况下不使用,可用于自定制。
5 基于红帽的系统中,支持 GUI 登录的完全多用户模式。这个运行等级和等级 3 类似,但是有可用的 GUI 登录。On Red-Hat based systems, full multiuser mode with GUI login. This runlevel is like level 3, but with a GUI login available. 基于红帽的系统中,支持 GUI 登录的完全多用户模式。这个运行等级和等级 3 类似,但是有可用的 GUI 登录。
6 重启系统。Reboot the system. 重启系统。
要在运行等级之间切换,我们只需要使用 init 命令更改运行等级:init N(其中 N 是上面列出的一个运行等级)。 请注意这并不是运行中的系统切换运行等级的推荐方式,因为它不会给已经登录的用户发送警告(因而导致他们丢失工作以及进程异常终结)。 -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). 相反,应该用 shutdown 命令重启系统(它首先发送警告信息给所有已经登录的用户,并锁住任何新的登录;然后再给 init 发送信号切换运行等级)但是,首先要在 /etc/inittab 文件中设置好默认的运行等级(系统引导到的等级)。 -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. 因为这个原因,按照下面的步骤切当地切换运行等级。以 root 用户在 /etc/inittab 中查找下面的行。 -For that reason, follow these steps to properly switch between runlevels, As root, look for the following line in /etc/inittab. id:2:initdefault: 并用你喜欢的文本编辑器,例如 vim(本系列的[第二讲 : 如何在 Linux 中使用 vi/vim 编辑器][2]),更改数字 2 为想要的运行等级。 -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). 然后,以 root 用户执行 -Next, run as root. # shutdown -r now 最后一个命令会重启系统,并使它在下一次引导时进入指定的运行等级,并会执行保存在 /etc/rc[runlevel].d 目录中的脚本以决定应该启动什么服务、不应该启动什么服务。例如,在下面的系统中运行等级 2。 -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) 在 Linux 中更改运行等级 -Change Runlevels in Linux #### 使用 chkconfig 管理服务 #### -#### Manage Services using chkconfig #### 为了在启动时启动或者停用系统服务,我们可以在 CentOS / openSUSE 中使用 [chkconfig 命令][3],在 Debian 及其衍生版中使用 sysv-rc-conf 命令。这个工具还能告诉我们对于一个指定的运行等级预先配置的状态是什么。 -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. - 推荐阅读: [如何在 Linux 中停止和停用不想要的服务][4] -- 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 @@ -213,95 +166,95 @@ Listing the runlevel configuration for a service. ![Listing Runlevel Configuration](http://www.tecmint.com/wp-content/uploads/2014/10/Listing-Runlevel-Configuration.png) 列出运行等级配置 -Listing Runlevel Configuration +从上图中我们可以看出,当系统进入运行等级 2 到 5 的时候就会启动 postfix,而默认情况下运行等级 2 到 4 时会运行 mysqld。现在假设我们并不希望如此。 -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. +例如,我们希望运行等级为 5 时也启动 mysqld,运行等级为 4 或 5 时关闭 postfix。下面分别针对两种情况进行设置(以 root 用户执行以下命令)。 -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) +![在 Linux 中启用/停用服务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. +我们在基于 Debian 的系统中使用 sysv-rc-conf 完成类似任务。 -#### Manage Services using sysv-rc-conf #### +#### 使用 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. +1. 我们可以用下面的命令查看启动 mdadm 时的运行等级。 # 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 +![查看运行中服务的运行等级Check Runlevel of Service Running](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Service-Runlevel.png) -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). +查看运行中服务的运行等级 + +2. 我们使用 sysv-rc-conf 设置防止 mdadm 在运行等级2 之外的其它等级启动。只需根据需要(你可以使用上下左右按键)选中或取消选中(通过空格键)。 # sysv-rc-conf -![SysV Runlevel Config](http://www.tecmint.com/wp-content/uploads/2014/10/SysV-Runlevel-Config.png) +![Sysv 运行等级配置SysV Runlevel Config](http://www.tecmint.com/wp-content/uploads/2014/10/SysV-Runlevel-Config.png) -SysV Runlevel Config +Sysv 运行等级配置 -Then press q to quit. +然后输入 q 退出。 -3. We will restart the system and run again the command from STEP 1. +3. 重启系统并从步骤 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](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. +从上图中我们可以看出 mdadm 配置为只在运行等级 2 上启动。 -### What About systemd? ### +### 那关于 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. +systemd 是另外一个被多种主流 Linux 发行版采用的服务和系统管理器。它的目标是允许系统启动时多个任务尽可能并行(而 sysvinit 并非如此,sysvinit 一般比较慢,因为它每次只启动一个进程,而且会检查彼此之间是否有依赖,在启动其它服务之前还要等待守护进程启动),充当运行中系统动态资源管理的角色。 -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. +要查看你系统中运行的原生 systemd 服务和 Sysv 服务,可以用以下的命令。 # systemctl -![Check All Running Processes in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Check-All-Running-Processes.png) +![在 Linux 中查看运行中的进程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 +LOAD 一列显示了单元(UNIT 列,显示服务或者由 systemd 维护的其它进程)是否正确加载,ACTIVE 和 SUB 列则显示了该单元当前的状态。 -When the ACTIVE column indicates that an unit’s status is other than active, we can check what happened using. +显示服务当前状态的信息 + +当 ACTIVE 列显示某个单元状态并非活跃时,我们可以使用以下命令查看具体原因。 # systemctl status [unit] -For example, in the image above, media-samba.mount is in failed state. Let’s run. +例如,上图中 media-samba.mount 处于失败状态。我们可以运行: # systemctl status media-samba.mount -![Check Linux Service Status](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Service-Status.png) +![查看 Linux 服务状态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. +我们可以看到 media-samba.mount 失败的原因是 host dev1 上的挂载进程无法找到 //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. +一旦 //192.168.0.10/gacanepa 上的共享网络可用,我们可以再来尝试启动、停止以及重启 media-samba.mount 单元。执行每次操作之后,我们都执行 systemctl stats media-samba.mout 来查看它的状态。 # systemctl start media-samba.mount # systemctl status media-samba.mount @@ -309,59 +262,60 @@ Once the network share //192.168.0.10/gacanepa becomes available, let’s try to # 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](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. +使用 systemd 你可以在系统启动时启用或停用某服务 - # systemctl enable [service] # enable a service - # systemctl disable [service] # prevent a service from starting at boot + # systemctl enable [service] # 启用服务 + # systemctl disable [service] # 阻止服务随系统启动 -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) +启用或停用某服务随系统启动包括在 /etc/systemd/system/multi-user.target.wants 目录添加或者删除符号链接。 -Enabling Disabling Services +![启用或停用服务](http://www.tecmint.com/wp-content/uploads/2014/10/Enabling-Disabling-Services.jpeg) -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. +基于事件的 Upstart 是 /sbin/init 守护进程的替代品,它仅为在需要那些服务的时候启动服务而生,(或者当它们在运行时管理它们),以及处理发生的实践,因此 Upstart 优于基于依赖的 sysvinit 系统。 -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. +一开始它是为 Ubuntu 发行版开发的,但在红帽企业版 Linux 6.0 中得到使用。尽管希望它能在所有 Linux 发行版中替代 sysvinit,但它已经被 systemd 超越。2014 年 2 月 14 日,Mark Shuttleworth(Canonical Ltd. 创建者)发布声明之后的 Ubuntu 发行版采用 systemd 作为默认初始化守护进程。 -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. +由于 Sysv 启动脚本已经流行很长时间了,很多软件包中都包括了 Sysv 启动脚本。为了兼容这些软件, Upstart 提供了兼容模式:它可以运行保存在常用位置(/etc/rc.d/rc?.d, /etc/init.d/rc?.d, /etc/rc?.d或其它类似的位置)的Sysv 启动脚本。因此,如果我们安装了一个还没有 Upstart 配置脚本的软件,仍然可以用原来的方式启动它。 -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. +另外,如果我们还安装了类似 [chkconfig][5] 的工具,你还可以和在基于 sysvinit 的系统中一样用它们管理基于 Sysv 的服务。 -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. +Upstart 脚本除了支持 Sysv 启动脚本,还支持基于多种方式启动或者停用服务;例如, Upstart 可以在一个特定硬件设备连接上的时候启动一个服务。 -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. +使用 Upstart以及它原生脚本的系统替换了 /etc/inittab 文件和 /etc/init 目录下和运行等级相关的以 .conf 作为后缀的 Sysv 启动脚本目录。 -These *.conf scripts (also known as job definitions) generally consists of the following: +这些 *.conf 脚本(也称为任务定义)通常包括以下几部分: -- 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 @@ -380,30 +334,30 @@ For example, # 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. +要使更改生效,你要让 upstart 重新加载它的配置文件。 # 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. +其中 yourjobname 是之前 yourjobname.conf 脚本中添加的任务名称。 -A more complete and detailed reference guide for Upstart is available in the project’s web site under the menu “[Cookbook][6]”. +关于 Upstart 更完整和详细的介绍可以参考该项目网站的 “[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. +了解 Linux 启动进程对于你进行错误处理、调整计算机系统以及根据需要运行服务非常有用。 -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) +译者:[ictlyh](http://mutouxiaogui.cn/blog/) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 8a721cf1f6ea95c1847737dee074efe0c0de266a Mon Sep 17 00:00:00 2001 From: ezio Date: Sun, 15 May 2016 11:20:07 +0800 Subject: [PATCH 0746/1469] =?UTF-8?q?=E5=9B=9E=E6=94=B6=E8=BF=87=E6=9C=9F?= =?UTF-8?q?=E6=96=87=E7=AB=A0?= 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 ---------- ... How to Configure OpenNMS on CentOS 7.x.md | 219 ------------ ...co Virtual Private Networking on Docker.md | 322 ------------------ ...Raspberry Pi projects for the classroom.md | 119 ------- 4 files changed, 839 deletions(-) delete mode 100644 sources/tech/20150817 How to Install OsTicket Ticketing System in Fedora 22 or Centos 7.md delete mode 100644 sources/tech/20150906 How to Configure OpenNMS on CentOS 7.x.md delete mode 100644 sources/tech/20151012 Getting Started to Calico Virtual Private Networking on Docker.md delete mode 100644 sources/tech/20151207 5 great Raspberry Pi projects for the classroom.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 deleted file mode 100644 index 6624a3c590..0000000000 --- a/sources/tech/20150817 How to Install OsTicket Ticketing System in Fedora 22 or Centos 7.md +++ /dev/null @@ -1,179 +0,0 @@ -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 diff --git a/sources/tech/20150906 How to Configure OpenNMS on CentOS 7.x.md b/sources/tech/20150906 How to Configure OpenNMS on CentOS 7.x.md deleted file mode 100644 index f209c8e45c..0000000000 --- a/sources/tech/20150906 How to Configure OpenNMS on CentOS 7.x.md +++ /dev/null @@ -1,219 +0,0 @@ -How to Configure OpenNMS on CentOS 7.x -================================================================================ -Systems management and monitoring services are very important that provides information to view important systems management information that allow us to to make decisions based on this information. To make sure the network is running at its best and to minimize the network downtime we need to improve application performance. So, in this article we will make you understand the step by step procedure to setup OpenNMS in your IT infrastructure. OpenNMS is a free open source enterprise level network monitoring and management platform that provides information to allow us to make decisions in regards to future network and capacity planning. - -OpenNMS designed to manage tens of thousands of devices from a single server as well as manage unlimited devices using a cluster of servers. It includes a discovery engine to automatically configure and manage network devices without operator intervention. It is written in Java and is published under the GNU General Public License. OpenNMS is known for its scalability with its main functional areas in services monitoring, data collection using SNMP and event management and notifications. - -### Installing OpenNMS RPM Repository ### - -We will start from the installation of OpenNMS RPM for our CentOs 7.1 operating system as its available for most of the RPM-based distributions through Yum at their official link http://yum.opennms.org/ . - -![OpenNMS RPM](http://blog.linoxide.com/wp-content/uploads/2015/08/18.png) - -Then open your command line interface of CentOS 7.1 and login with root credentials to run the below command with “wget” to get the required RPM. - - [root@open-nms ~]# wget http://yum.opennms.org/repofiles/opennms-repo-stable-rhel7.noarch.rpm - -![Download RPM](http://blog.linoxide.com/wp-content/uploads/2015/08/26.png) - -Now we need to install this repository so that the OpenNMS package information could be available through yum for installation. Let’s run the command below with same root level credentials to do so. - - [root@open-nms ~]# rpm -Uvh opennms-repo-stable-rhel7.noarch.rpm - -![Installing RPM](http://blog.linoxide.com/wp-content/uploads/2015/08/36.png) - -### Installing Prerequisite Packages for OpenNMS ### - -Now before we start installation of OpenNMS, let’s make sure you’ve done the following prerequisites. - -**Install JDK 7** - -Its recommended that you install the latest stable Java 7 JDK from Oracle for the best performance to integrate JDK in our YUM repository as a fallback. Let’s go to the Oracle Java 7 SE JDK download page, accept the license if you agree, choose the platform and architecture. Once it has finished downloading, execute it from the command-line and then install the resulting JDK rpm. - -Else run the below command to install using the Yum from the the available system repositories. - - [root@open-nms ~]# yum install java-1.7.0-openjdk-1.7.0.85-2.6.1.2.el7_1 - -Once you have installed the Java you can confirm its installation using below command and check its installed version. - - [root@open-nms ~]# java -version - -![Java version](http://blog.linoxide.com/wp-content/uploads/2015/08/46.png) - -**Install PostgreSQL** - -Now we will install the PostgreSQL that is a must requirement to setup the database for OpenNMS. PostgreSQL is included in all of the major YUM-based distributions. To install, simply run the below command. - - [root@open-nms ~]# yum install postgresql postgresql-server - -![Installing Postgresql](http://blog.linoxide.com/wp-content/uploads/2015/08/55.png) - -### Prepare the Database for OpenNMS ### - -Once you have installed PostgreSQL, now you'll need to make sure that PostgreSQL is up and active. Let’s run the below command to first initialize the database and then start its services. - - [root@open-nms ~]# /sbin/service postgresql initdb - [root@open-nms ~]# /sbin/service postgresql start - -![start DB](http://blog.linoxide.com/wp-content/uploads/2015/08/64.png) - -Now to confirm the status of your PostgreSQL database you can run the below command. - - [root@open-nms ~]# service postgresql status - -![PostgreSQL status](http://blog.linoxide.com/wp-content/uploads/2015/08/74.png) - -To ensure that PostgreSQL will start after a reboot, use the “systemctl”command to enable start on bootup using below command. - - [root@open-nms ~]# systemctl enable postgresql - ln -s '/usr/lib/systemd/system/postgresql.service' '/etc/systemd/system/multi-user.target.wants/postgresql.service' - -### Configure PostgreSQL ### - -Locate the Postgres “data” directory. Often this is located in /var/lib/pgsql/data directory and Open the postgresql.conf file in text editor and configure the following parameters as shown. - - [root@open-nms ~]# vim /var/lib/pgsql/data/postgresql.conf - ----------- - - #------------------------------------------------------------------------------ - # CONNECTIONS AND AUTHENTICATION - #------------------------------------------------------------------------------ - - listen_addresses = 'localhost' - max_connections = 256 - - #------------------------------------------------------------------------------ - # RESOURCE USAGE (except WAL) - #------------------------------------------------------------------------------ - - shared_buffers = 1024MB - -**User Access to the Database** - -PostgreSQL only allows you to connect if you are logged in to the local account name that matches the PostgreSQL user. Since OpenNMS runs as root, it cannot connect as a "postgres" or "opennms" user by default, so we have to change the configuration to allow user access to the database by opening the below configuration file. - - [root@open-nms ~]# vim /var/lib/pgsql/data/pg_hba.conf - -Update the configuration file as shown below and change the METHOD settings from "ident" to "trust" - -![user access to db](http://blog.linoxide.com/wp-content/uploads/2015/08/84.png) - -Write and quit the file to make saved changes and then restart PostgreSQL services. - - [root@open-nms ~]# service postgresql restart - -### Starting OpenNMS Installation ### - -Now we are ready go with installation of OpenNMS as we have almost don with its prerequisites. Using the YUM packaging system will download and install all of the required components and their dependencies, if they are not already installed on your system. -So let's riun th belwo command to start OpenNMS installation that will pull everything you need to have a working OpenNMS, including the OpenNMS core, web UI, and a set of common plugins. - - [root@open-nms ~]# yum -y install opennms - -![OpenNMS Installation](http://blog.linoxide.com/wp-content/uploads/2015/08/93.png) - -The above command will ends up with successful installation of OpenNMS and its derivative packages. - -### Configure JAVA for OpenNMS ### - -In order to integrate the default version of Java with OpenNMS we will run the below command. - - [root@open-nms ~]# /opt/opennms/bin/runjava -s - -![java integration](http://blog.linoxide.com/wp-content/uploads/2015/08/102.png) - -### Run the OpenNMS installer ### - -Now it's time to start the OpenNMS installer that will create and configure the OpenNMS database, while the same command will be used in case we want to update it to the latest version. To do so, we will run the following command. - - [root@open-nms ~]# /opt/opennms/bin/install -dis - -The above install command will take many options with following mechanism. - --d - to update the database --i - to insert any default data that belongs in the database --s - to create or update the stored procedures OpenNMS uses for certain kinds of data access - - ============================================================================== - OpenNMS Installer - ============================================================================== - - Configures PostgreSQL tables, users, and other miscellaneous settings. - - DEBUG: Platform is IPv6 ready: true - - searching for libjicmp.so: - - trying to load /usr/lib64/libjicmp.so: OK - - searching for libjicmp6.so: - - trying to load /usr/lib64/libjicmp6.so: OK - - searching for libjrrd.so: - - trying to load /usr/lib64/libjrrd.so: OK - - using SQL directory... /opt/opennms/etc - - using create.sql... /opt/opennms/etc/create.sql - 17:27:51.178 [Main] INFO org.opennms.core.schema.Migrator - PL/PgSQL call handler exists - 17:27:51.180 [Main] INFO org.opennms.core.schema.Migrator - PL/PgSQL language exists - - checking if database "opennms" is unicode... ALREADY UNICODE - - Creating imports directory (/opt/opennms/etc/imports... OK - - Checking for old import files in /opt/opennms/etc... DONE - INFO 16/08/15 17:27:liquibase: Reading from databasechangelog - Installer completed successfully! - - ============================================================================== - OpenNMS Upgrader - ============================================================================== - - OpenNMS is currently stopped - Found upgrade task SnmpInterfaceRrdMigratorOnline - Found upgrade task KscReportsMigrator - Found upgrade task JettyConfigMigratorOffline - Found upgrade task DataCollectionConfigMigratorOffline - Processing RequisitionsMigratorOffline: Remove non-ip-snmp-primary and non-ip-interfaces from requisitions: NMS-5630, NMS-5571 - - Running pre-execution phase - Backing up: /opt/opennms/etc/imports - - Running post-execution phase - Removing backup /opt/opennms/etc/datacollection.zip - - Finished in 0 seconds - - Upgrade completed successfully! - -### Firewall configurations to Allow OpenNMS ### - -Here we have to allow OpenNMS management interface port 8980 through firewall or router to access the management web interface from the remote systems. So use the following commands to do so. - - [root@open-nms etc]# firewall-cmd --permanent --add-port=8980/tcp - [root@open-nms etc]# firewall-cmd --reload - -### Start OpenNMS and Login to Web Interface ### - -Let's start OpenNMS service and enable to it start at each bootup by using the below command. - - [root@open-nms ~]#systemctl start opennms - [root@open-nms ~]#systemctl enable opennms - -Once the services are up are ready to go with its web management interface. Open your web browser and access it with your server's IP address and 8980 port. - -http://servers_ip:8980/ - -Give the username and password where as the default username and password is admin/admin. - -![opennms login](http://blog.linoxide.com/wp-content/uploads/2015/08/opennms-login.png) - -After successful authentication with your provided username and password you will be directed towards the the Home page of OpenNMS where you can configure the new monitoring devices/nodes/services etc. - -![opennms home](http://blog.linoxide.com/wp-content/uploads/2015/08/opennms-home.png) - -### Conclusion ### - -Congratulations! we have successfully setup OpenNMS on CentOS 7.1. So, at the end of this tutorial, you are now able to install and configure OpenNMS with its prerequisites that included PostgreSQL and JAVA setup. So let's enjoy with the great network monitoring system with open source roots using OpenNMS that provide a bevy of features at no cost than their high-end competitors, and can scale to monitor large numbers of network nodes. - --------------------------------------------------------------------------------- - -via: http://linoxide.com/monitoring-2/install-configure-opennms-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/ diff --git a/sources/tech/20151012 Getting Started to Calico Virtual Private Networking on Docker.md b/sources/tech/20151012 Getting Started to Calico Virtual Private Networking on Docker.md deleted file mode 100644 index 27d60729e9..0000000000 --- a/sources/tech/20151012 Getting Started to Calico Virtual Private Networking on Docker.md +++ /dev/null @@ -1,322 +0,0 @@ -Getting Started to Calico Virtual Private Networking on Docker -================================================================================ -Calico is a free and open source software for virtual networking in data centers. It is a pure Layer 3 approach to highly scalable datacenter for cloud virtual networking. It seamlessly integrates with cloud orchestration system such as openstack, docker clusters in order to enable secure IP communication between virtual machines and containers. It implements a highly productive vRouter in each node that takes advantage of the existing Linux kernel forwarding engine. Calico works in such an awesome technology that it has the ability to peer directly with the data center’s physical fabric whether L2 or L3, without the NAT, tunnels on/off ramps, or overlays. Calico makes full utilization of docker to run its containers in the nodes which makes it multi-platform and very easy to ship, pack and deploy. Calico has the following salient features out of the box. - -- It can scale tens of thousands of servers and millions of workloads. -- Calico is easy to deploy, operate and diagnose. -- It is open source software licensed under Apache License version 2 and uses open standards. -- It supports container, virtual machines and bare metal workloads. -- It supports both IPv4 and IPv6 internet protocols. -- It is designed internally to support rich, flexible and secure network policy. - -In this tutorial, we'll perform a virtual private networking between two nodes running Calico in them with Docker Technology. Here are some easy steps on how we can do that. - -### 1. Installing etcd ### - -To get started with the calico virtual private networking, we'll need to have a linux machine running etcd. As CoreOS comes preinstalled and preconfigured with etcd, we can use CoreOS but if we want to configure Calico in other linux distributions, then we'll need to setup it in our machine. As we are running Ubuntu 14.04 LTS, we'll need to first install and configure etcd in our machine. To install etcd in our Ubuntu box, we'll need to add the official ppa repository of Calico by running the following command in the machine which we want to run etcd server. Here, we'll be installing etcd in our 1st node. - - # apt-add-repository ppa:project-calico/icehouse - - The primary source of Ubuntu packages for Project Calico based on OpenStack Icehouse, an open source solution for virtual networking in cloud data centers. Find out more at http://www.projectcalico.org/ - More info: https://launchpad.net/~project-calico/+archive/ubuntu/icehouse - Press [ENTER] to continue or ctrl-c to cancel adding it - gpg: keyring `/tmp/tmpi9zcmls1/secring.gpg' created - gpg: keyring `/tmp/tmpi9zcmls1/pubring.gpg' created - gpg: requesting key 3D40A6A7 from hkp server keyserver.ubuntu.com - gpg: /tmp/tmpi9zcmls1/trustdb.gpg: trustdb created - gpg: key 3D40A6A7: public key "Launchpad PPA for Project Calico" imported - gpg: Total number processed: 1 - gpg: imported: 1 (RSA: 1) - OK - -Then, we'll need to edit /etc/apt/preferences and make changes to prefer Calico-provided packages for Nova and Neutron. - - # nano /etc/apt/preferences - -We'll need to add the following lines into it. - - Package: * - Pin: release o=LP-PPA-project-calico-* - Pin-Priority: 100 - -![Calico PPA Config](http://blog.linoxide.com/wp-content/uploads/2015/10/calico-ppa-config.png) - -Next, we'll also need to add the official BIRD PPA for Ubuntu 14.04 LTS so that bugs fixes are installed before its available on the Ubuntu repo. - - # add-apt-repository ppa:cz.nic-labs/bird - - The BIRD Internet Routing Daemon PPA (by upstream & .deb maintainer) - More info: https://launchpad.net/~cz.nic-labs/+archive/ubuntu/bird - Press [ENTER] to continue or ctrl-c to cancel adding it - gpg: keyring `/tmp/tmphxqr5hjf/secring.gpg' created - gpg: keyring `/tmp/tmphxqr5hjf/pubring.gpg' created - gpg: requesting key F9C59A45 from hkp server keyserver.ubuntu.com - apt-ggpg: /tmp/tmphxqr5hjf/trustdb.gpg: trustdb created - gpg: key F9C59A45: public key "Launchpad Datov� schr�nky" imported - gpg: Total number processed: 1 - gpg: imported: 1 (RSA: 1) - OK - -Now, after the PPA jobs are done, we'll now gonna update the local repository index and then install etcd in our machine. - - # apt-get update - -To install etcd in our ubuntu machine, we'll gonna run the following apt command. - - # apt-get install etcd python-etcd - -### 2. Starting Etcd ### - -After the installation is complete, we'll now configure the etcd configuration file. Here, we'll edit **/etc/init/etcd.conf** using a text editor and append the line exec **/usr/bin/etcd** and make it look like below configuration. - - # nano /etc/init/etcd.conf - exec /usr/bin/etcd --name="node1" \ - --advertise-client-urls="http://10.130.65.71:2379,http://10.130.65.71:4001" \ - --listen-client-urls="http://0.0.0.0:2379,http://0.0.0.0:4001" \ - --listen-peer-urls "http://0.0.0.0:2380" \ - --initial-advertise-peer-urls "http://10.130.65.71:2380" \ - --initial-cluster-token $(uuidgen) \ - --initial-cluster "node1=http://10.130.65.71:2380" \ - --initial-cluster-state "new" - -![Configuring ETCD](http://blog.linoxide.com/wp-content/uploads/2015/10/configuring-etcd.png) - -**Note**: In the above configuration, we'll need to replace 10.130.65.71 and node-1 with the private ip address and hostname of your etcd server box. After done with editing, we'll need to save and exit the file. - -We can get the private ip address of our etcd server by running the following command. - - # ifconfig - -![ifconfig](http://blog.linoxide.com/wp-content/uploads/2015/10/ifconfig1.png) - -As our etcd configuration is done, we'll now gonna start our etcd service in our Ubuntu node. To start etcd daemon, we'll gonna run the following command. - - # service etcd start - -After done, we'll have a check if etcd is really running or not. To ensure that, we'll need to run the following command. - - # service etcd status - -### 3. Installing Docker ### - -Next, we'll gonna install Docker in both of our nodes running Ubuntu. To install the latest release of docker, we'll simply need to run the following command. - - # curl -sSL https://get.docker.com/ | sh - -![Docker Engine Installation](http://blog.linoxide.com/wp-content/uploads/2015/10/docker-engine-installation.png) - -After the installation is completed, we'll gonna start the docker daemon in-order to make sure that its running before we move towards Calico. - - # service docker restart - - docker stop/waiting - docker start/running, process 3056 - -### 3. Installing Calico ### - -We'll now install calico in our linux machine in-order to run the calico containers. We'll need to install Calico in every node which we're wanting to connect into the Calico network. To install Calico, we'll need to run the following command under root or sudo permission. - -#### On 1st Node #### - - # wget https://github.com/projectcalico/calico-docker/releases/download/v0.6.0/calicoctl - - --2015-09-28 12:08:59-- https://github.com/projectcalico/calico-docker/releases/download/v0.6.0/calicoctl - Resolving github.com (github.com)... 192.30.252.129 - Connecting to github.com (github.com)|192.30.252.129|:443... connected. - ... - Resolving github-cloud.s3.amazonaws.com (github-cloud.s3.amazonaws.com)... 54.231.9.9 - Connecting to github-cloud.s3.amazonaws.com (github-cloud.s3.amazonaws.com)|54.231.9.9|:443... connected. - HTTP request sent, awaiting response... 200 OK - Length: 6166661 (5.9M) [application/octet-stream] - Saving to: 'calicoctl' - 100%[=========================================>] 6,166,661 1.47MB/s in 6.7s - 2015-09-28 12:09:08 (898 KB/s) - 'calicoctl' saved [6166661/6166661] - - # chmod +x calicoctl - -After done with making it executable, we'll gonna make the binary calicoctl available as the command in any directory. To do so, we'll need to run the following command. - - # mv calicoctl /usr/bin/ - -#### On 2nd Node #### - - # wget https://github.com/projectcalico/calico-docker/releases/download/v0.6.0/calicoctl - - --2015-09-28 12:09:03-- https://github.com/projectcalico/calico-docker/releases/download/v0.6.0/calicoctl - Resolving github.com (github.com)... 192.30.252.131 - Connecting to github.com (github.com)|192.30.252.131|:443... connected. - ... - Resolving github-cloud.s3.amazonaws.com (github-cloud.s3.amazonaws.com)... 54.231.8.113 - Connecting to github-cloud.s3.amazonaws.com (github-cloud.s3.amazonaws.com)|54.231.8.113|:443... connected. - HTTP request sent, awaiting response... 200 OK - Length: 6166661 (5.9M) [application/octet-stream] - Saving to: 'calicoctl' - 100%[=========================================>] 6,166,661 1.47MB/s in 5.9s - 2015-09-28 12:09:11 (1022 KB/s) - 'calicoctl' saved [6166661/6166661] - - # chmod +x calicoctl - -After done with making it executable, we'll gonna make the binary calicoctl available as the command in any directory. To do so, we'll need to run the following command. - - # mv calicoctl /usr/bin/ - -Likewise, we'll need to execute the above commands to install in every other nodes. - -### 4. Starting Calico services ### - -After we have installed calico on each of our nodes, we'll gonna start our Calico services. To start the calico services, we'll need to run the following commands. - -#### On 1st Node #### - - # calicoctl node - - WARNING: Unable to detect the xt_set module. Load with `modprobe xt_set` - WARNING: Unable to detect the ipip module. Load with `modprobe ipip` - No IP provided. Using detected IP: 10.130.61.244 - Pulling Docker image calico/node:v0.6.0 - Calico node is running with id: fa0ca1f26683563fa71d2ccc81d62706e02fac4bbb08f562d45009c720c24a43 - -#### On 2nd Node #### - -Next, we'll gonna export a global variable in order to connect our calico nodes to the same etcd server which is hosted in node1 in our case. To do so, we'll need to run the following command in each of our nodes. - - # export ETCD_AUTHORITY=10.130.61.244:2379 - -Then, we'll gonna run calicoctl container in our every our second node. - - # calicoctl node - - WARNING: Unable to detect the xt_set module. Load with `modprobe xt_set` - WARNING: Unable to detect the ipip module. Load with `modprobe ipip` - No IP provided. Using detected IP: 10.130.61.245 - Pulling Docker image calico/node:v0.6.0 - Calico node is running with id: 70f79c746b28491277e28a8d002db4ab49f76a3e7d42e0aca8287a7178668de4 - -This command should be executed in every nodes in which we want to start our Calico services. The above command start a container in the respective node. To check if the container is running or not, we'll gonna run the following docker command. - - # docker ps - -![Docker Running Containers](http://blog.linoxide.com/wp-content/uploads/2015/10/docker-running-containers.png) - -If we see the output something similar to the output shown below then we can confirm that Calico containers are up and running. - -### 5. Starting Containers ### - -Next, we'll need to start few containers in each of our nodes running Calico services. We'll assign a different name to each of the containers running ubuntu. Here, workload-A, workload-B, etc has been assigned as the unique name for each of the containers. To do so, we'll need to run the following command. - -#### On 1st Node #### - - # docker run --net=none --name workload-A -tid ubuntu - - Unable to find image 'ubuntu:latest' locally - latest: Pulling from library/ubuntu - ... - 91e54dfb1179: Already exists - library/ubuntu:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security. - Digest: sha256:73fbe2308f5f5cb6e343425831b8ab44f10bbd77070ecdfbe4081daa4dbe3ed1 - Status: Downloaded newer image for ubuntu:latest - a1ba9105955e9f5b32cbdad531cf6ecd9cab0647d5d3d8b33eca0093605b7a18 - - # docker run --net=none --name workload-B -tid ubuntu - - 89dd3d00f72ac681bddee4b31835c395f14eeb1467300f2b1b9fd3e704c28b7d - -#### On 2nd Node #### - - # docker run --net=none --name workload-C -tid ubuntu - - Unable to find image 'ubuntu:latest' locally - latest: Pulling from library/ubuntu - ... - 91e54dfb1179: Already exists - library/ubuntu:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security. - Digest: sha256:73fbe2308f5f5cb6e343425831b8ab44f10bbd77070ecdfbe4081daa4dbe3ed1 - Status: Downloaded newer image for ubuntu:latest - 24e2d5d7d6f3990b534b5643c0e483da5b4620a1ac2a5b921b2ba08ebf754746 - - # docker run --net=none --name workload-D -tid ubuntu - - c6f28d1ab8f7ac1d9ccc48e6e4234972ed790205c9ca4538b506bec4dc533555 - -Similarly, if we have more nodes, we can run ubuntu docker container into it by running the above command with assigning a different container name. - -### 6. Assigning IP addresses ### - -After we have got our docker containers running in each of our hosts, we'll go for adding a networking support to the containers. Now, we'll gonna assign a new ip address to each of the containers using calicoctl. This will add a new network interface to the containers with the assigned ip addresses. To do so, we'll need to run the following commands in the hosts running the containers. - -#### On 1st Node #### - - # calicoctl container add workload-A 192.168.0.1 - # calicoctl container add workload-B 192.168.0.2 - -#### On 2nd Node #### - - # calicoctl container add workload-C 192.168.0.3 - # calicoctl container add workload-D 192.168.0.4 - -### 7. Adding Policy Profiles ### - -After our containers have got networking interfaces and ip address assigned, we'll now need to add policy profiles to enable networking between the containers each other. After adding the profiles, the containers will be able to communicate to each other only if they have the common profiles assigned. That means, if they have different profiles assigned, they won't be able to communicate to eachother. So, before being able to assign. we'll need to first create some new profiles. That can be done in either of the hosts. Here, we'll run the following command in 1st Node. - - # calicoctl profile add A_C - - Created profile A_C - - # calicoctl profile add B_D - - Created profile B_D - -After the profile has been created, we'll simply add our workload to the required profile. Here, in this tutorial, we'll place workload A and workload C in a common profile A_C and workload B and D in a common profile B_D. To do so, we'll run the following command in our hosts. - -#### On 1st Node #### - - # calicoctl container workload-A profile append A_C - # calicoctl container workload-B profile append B_D - -#### On 2nd Node #### - - # calicoctl container workload-C profile append A_C - # calicoctl container workload-D profile append B_D - -### 8. Testing the Network ### - -After we've added a policy profile to each of our containers using Calicoctl, we'll now test whether our networking is working as expected or not. We'll take a node and a workload and try to communicate with the other containers running in same or different nodes. And due to the profile, we should be able to communicate only with the containers having a common profile. So, in this case, workload A should be able to communicate with only C and vice versa whereas workload A shouldn't be able to communicate with B or D. To test the network, we'll gonna ping the containers having common profiles from the 1st host running workload A and B. - -We'll first ping workload-C having ip 192.168.0.3 using workload-A as shown below. - - # docker exec workload-A ping -c 4 192.168.0.3 - -Then, we'll ping workload-D having ip 192.168.0.4 using workload-B as shown below. - - # docker exec workload-B ping -c 4 192.168.0.4 - -![Ping Test Success](http://blog.linoxide.com/wp-content/uploads/2015/10/ping-test-success.png) - -Now, we'll check if we're able to ping the containers having different profiles. We'll now ping workload-D having ip address 192.168.0.4 using workload-A. - - # docker exec workload-A ping -c 4 192.168.0.4 - -After done, we'll try to ping workload-C having ip address 192.168.0.3 using workload-B. - - # docker exec workload-B ping -c 4 192.168.0.3 - -![Ping Test Failed](http://blog.linoxide.com/wp-content/uploads/2015/10/ping-test-failed.png) - -Hence, the workloads having same profiles could ping each other whereas having different profiles couldn't ping to each other. - -### Conclusion ### - -Calico is an awesome project providing an easy way to configure a virtual network using the latest docker technology. It is considered as a great open source solution for virtual networking in cloud data centers. Calico is being experimented by people in different cloud platforms like AWS, DigitalOcean, GCE and more these days. As Calico is currently under experiment, its stable version hasn't been released yet and is still in pre-release. The project consists a well documented documentations, tutorials and manuals in their [official documentation site][2]. - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/calico-virtual-private-networking-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://docs.projectcalico.org/ \ No newline at end of file diff --git a/sources/tech/20151207 5 great Raspberry Pi projects for the classroom.md b/sources/tech/20151207 5 great Raspberry Pi projects for the classroom.md deleted file mode 100644 index b7455d11f7..0000000000 --- a/sources/tech/20151207 5 great Raspberry Pi projects for the classroom.md +++ /dev/null @@ -1,119 +0,0 @@ -ezio - -5 great Raspberry Pi projects for the classroom -===================================================== - - -5 个很适合在课堂上演示的树莓派项目 -===================================================== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/osdc-open-source-yearbook-lead3.png?itok=fSUS0fIt) - -### 1. 我的世界 Pi - -![](https://opensource.com/sites/default/files/lava.png) ->Courtesy of the Raspberry Pi Foundation. [CC BY-SA 4.0][1]. - -Minecraft is the favorite game of pretty much every teenager in the world—and it's one of the most creative games ever to capture the attention of young people. The version that comes with every Raspberry Pi is not only a creative thinking building game, but comes with a programming interface allowing for additional interaction with the Minecraft world through Python code. - -我的世界是世界上很多青少年最喜欢的一个游戏,而且他也是目前最能激发年轻人创造力的一款游戏。这个树莓派版上自带的我的世界不仅仅是一个具有创造性的建筑游戏,他还是一个具有编程接口、可以通过 Python 与之交互的版本。 - -Minecraft: Pi Edition is a great way for teachers to engage students with problem solving and writing code to perform tasks. You can use the Python API to build a house and have it follow you wherever you go, build a bridge wherever you walk, make it rain lava, show the temperature in the sky, and anything else your imagination can create. - -我的世界:Pi 版对于老师来说是一个非常好的教授学生解决问题和编写代码完成任务的途径。你可以使用 Python API 创建一个房子,并且一直跟随这你的脚步移动,当你需要桥梁的时候给你建造一座桥,让老天呀下雨,显示天空的温度,以及其它你可以想象到的一切东西。 - -Read more in "[Getting Started with Minecraft Pi][2]." - -详情请见 "[Getting Started with Minecraft Pi][2]." - -### 2. 反应游戏和交通灯 Reaction game and traffic lights - -![](https://opensource.com/sites/default/files/pi_traffic_installed_yellow_led_on.jpg) ->Courtesy of [Low Voltage Labs][3]. [CC BY-SA 4.0][1]. - -It's really easy to get started with physical computing on Raspberry Pi—just connect up LEDs and buttons to the GPIO pins, and with a few lines of code you can turn lights on and control things with button presses. Once you know the code to do the basics, it's down to your imagination as to what you do next! - -使用树莓派可以很轻松的进行物理计算——只需要连接几个 LED 和按钮到 开发板上的 GPIO 接口,再用几行代码你就可以按下按钮来开灯。一旦你指导了如何使用代码来做这些基本的东西,接下来就可以根据你的想象来做其它事情了。 - -If you know how to flash one light, you can flash three. Pick out three LEDs in traffic light colors and you can code the traffic light sequence. If you know how to use a button to a trigger an event, then you have a pedestrian crossing! Also look out for great pre-built traffic light add-ons like [PI-TRAFFIC][4], [PI-STOP][5], [Traffic HAT][6], and more. - -如果你知道如何让一个灯闪烁,你就可以让三个灯开始闪烁。挑选三个和交通灯一样颜色的 LED 灯,然后编写控制交通灯的代码。如果你知道如何使用按钮触发实践,那么你就可以模拟行人过马路。同时你可以参考其它已经完成的交通灯附件,比如[PI-TRAFFIC][4], [PI-STOP][5], [Traffic HAT][6],等等。 - -It's not always about the code—this can be used as an exercise in understanding how real world systems are devised. Computational thinking is a useful skill in any walk of life. - -代码并不是全部——这些联系只是让你理解真是世界里使如何完成这些事的。计算思维是一个在你一生中都会很有用的技能。 - -![](https://opensource.com/sites/default/files/reaction-game.png) ->Courtesy of the Raspberry Pi Foundation. [CC BY-SA 4.0][1]. - -Next, try wiring up two buttons and an LED and making a two-player reaction game—let the light come on after a random amount of time and see who can press the button first! - -接下来试着接通两个按钮和 LED 灯的电源,实现一个反应游戏 —— 让 LED 灯随机的点亮,然后看是最先按下按钮。 - -To learn more, check out [GPIO Zero recipes][7]. Everything you need is in [CamJam EduKit 1][8]. - -要想了解更多可以看看 [GPIO Zero recipes][7]。你所需要的资料都可以在 [CamJam EduKit 1][8] 找到。 - -### 3. 电子宠物 Sense HAT Pixel Pet - -The Astro Pi—an augmented Raspberry Pi—is going to space this December, but you haven't missed your chance to get your hands on the hardware. The Sense HAT is the sensor board add-on used in the Astro Pi mission and it's available for anyone to buy. You can use it for data collection, science experiments, games and more. Watch this Gurl Geek Diaries video from Raspberry Pi's Carrie Anne for a great way to get started—by bringing to life an animated pixel pet of your own design on the Sense HAT display: - -Astro Pi —— 一个增强版的树莓派 —— 将在 12 月问世,但是你并没有错过亲手把玩这个硬件的机会。Sense HAT 是 Astro Pi 的一个传感器扩展板,现在已经开放购买了。你可以使用它来进行数据搜集,科学实验,游戏和其它很多事。可以看看下面树莓派的 Carrie Anne 拍摄的 Gurl Geek Diaries 的视频,里面演示了一种很棒的入门途径——给生活添加一个你自己创造的生动的像素宠物: - -[video](https://youtu.be/gfRDFvEVz-w) - ->Learn more in "[Exploring the Sense HAT][9]." ->详见 "[探索 Sense HAT][9]." - -### 4. 红外鸟笼 Infrared bird box - -![](https://opensource.com/sites/default/files/ir-bird-box.png) ->Courtesy of the Raspberry Pi Foundation. [CC BY-SA 4.0][1]. - -A great exercise for the whole class to get involved with—place a Raspberry Pi and the NoIR camera module inside a bird box along with some infra-red lights so you can see in the dark, then stream video from the Pi over the network or on the internet. Wait for birds to nest and you can observe them without disturbing them in their habitat. - - - -Learn all about infrared and the light spectrum, and how to adjust the camera focus and control the camera in software. - -Learn more in "[Make an infrared bird box][10]." - -### 5. 机器人 Robotics - -![](https://opensource.com/sites/default/files/edukit3_1500-alex-eames-sm.jpg) ->Courtesy of Low Voltage Labs. [CC BY-SA 4.0][1]. - -With a Raspberry Pi and as little as a couple of motors and a motor controller board, you can build your own robot. There is a vast range of robots you can make, from basic buggies held together by sellotape and a homemade chassis, all the way to self-aware, sensor-laden metallic stallions with camera attachments driven by games controllers. - -Learn how to control individual motors with something straightforward like the RTK Motor Controller Board (£8/$12), or dive into the new CamJam robotics kit (£17/$25) which comes with motors, wheels and a couple of sensors—great value and plenty of learning potential. - -Alternatively, if you'd like something more hardcore, try PiBorg's [4Borg][11] (£99/$150) or [DiddyBorg][12] (£180/$273) or go the whole hog and treat yourself to their DoodleBorg Metal edition (£250/$380)—and build a mini version of their infamous [DoodleBorg tank][13] (unfortunately not for sale). - -Check out the [CamJam robotics kit worksheets][14]. - - ------------------------------------------------------------------------------- - -via: https://opensource.com/education/15/12/5-great-raspberry-pi-projects-classroom - -作者:[Ben Nuttall][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/bennuttall -[1]: https://creativecommons.org/licenses/by-sa/4.0/ -[2]: https://opensource.com/life/15/5/getting-started-minecraft-pi -[3]: http://lowvoltagelabs.com/ -[4]: http://lowvoltagelabs.com/products/pi-traffic/ -[5]: http://4tronix.co.uk/store/index.php?rt=product/product&product_id=390 -[6]: https://ryanteck.uk/hats/1-traffichat-0635648607122.html -[7]: http://pythonhosted.org/gpiozero/recipes/ -[8]: http://camjam.me/?page_id=236 -[9]: https://opensource.com/life/15/10/exploring-raspberry-pi-sense-hat -[10]: https://www.raspberrypi.org/learning/infrared-bird-box/ -[11]: https://www.piborg.org/4borg -[12]: https://www.piborg.org/diddyborg -[13]: https://www.piborg.org/doodleborg -[14]: http://camjam.me/?page_id=1035#worksheets From 849699211b51b3b9b70a6102874f691cbd51e9f7 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 15 May 2016 11:40:21 +0800 Subject: [PATCH 0747/1469] =?UTF-8?q?20160515-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ata processing with Cassandra and Spark.md | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 sources/tech/20160511 An introduction to data processing with Cassandra and Spark.md diff --git a/sources/tech/20160511 An introduction to data processing with Cassandra and Spark.md b/sources/tech/20160511 An introduction to data processing with Cassandra and Spark.md new file mode 100644 index 0000000000..149ab6fbb7 --- /dev/null +++ b/sources/tech/20160511 An introduction to data processing with Cassandra and Spark.md @@ -0,0 +1,50 @@ +An introduction to data processing with Cassandra and Spark +============================================================== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/osdc_520x292_opendata_0613mm.png?itok=mzC0Tb28) + + +There's been a huge surge of interest around the Apache Cassandra database due to the increasing uptime and performance demands of modern cloud applications. + +So, what is Apache Cassandra? A distributed OLTP database built for high availability and linear scalability. When people ask what Cassandra is used for, think about the type of system you want close to the customer. This is ultimately the system that our users interact with. Applications that must always be available: product catalogs, IoT, medical systems, and mobile applications. In these categories downtime can mean loss of revenue or even more dire outcomes depending on your specific use case. Netflix was one of the earliest adopters of this project, which was open sourced in 2008, and their contributions, along with successes, put it on the radar of the masses. + +Cassandra became a top level Apache Software Foundation project in 2010 and has been riding the wave in popularity since then. Now even knowledge in Cassandra gets you serious returns in the job market. It's both crazy and awesome to consider a NoSQL and open source technology could perform this sort of disruption next to the giants of enterprise SQL. This begs the question, what makes it so popular? + +Cassandra has the ability to be always on in spite of massive hardware and network failures by utilizing a design first widely discussed in [the Dynamo paper from Amazon][1]. By using a peer to peer model, with no single point of failure, we can survive rack failure and even complete network partitions. We can deal with an entire data center failure without impacting our customer's experience. A distributed system that plans for failure is a properly planned distributed system, because frankly, failures are just going to happen. With Cassandra, we accept that cruel fact of life, and bake it into the database's architecture and functionality. + +We know what you’re thinking, "But, I’m coming from a relational background, isn't this going to be a daunting transition?" The answer is somewhat yes and no. Data modeling with Cassandra will feel familiar to developers coming from the relational world. We use tables to model our data, and CQL, the Cassandra Query Language, to query the database. However, unlike SQL, Cassandra supports more complex data structures such as nested and user defined types. For instance, instead of creating a dedicated table to store likes on a cat photo, we can store that data in a collection with the photo itself enabling faster, sequential lookups. That's expressed very naturally in CQL. In our photo table we may want to track the name, URL, and the people that liked the photo. + +![](https://opensource.com/sites/default/files/resize/screen_shot_2016-05-06_at_7.17.33_am-350x198.png) + +In a high performance system milliseconds matter for both user experience and for customer retention. Expensive JOIN operations limit our ability to scale out by adding unpredictable network calls. By denormalizing our data so it can be fetched in as few requests as possible, we profit from the trend of decreasing costs in disk space and in return get predictable, high performance applications. We embrace the concept of denormalization with Cassandra because it offers a pretty appealing tradeoff. + +We're obviously not just limited to storing likes on cat photos. Cassandra is a optimized for high write throughput. This makes it the perfect solution for big data applications where we’re constantly ingesting data. Time series and IoT use cases are growing at a steady rate in both demand and appearance in the market, and we're continuously finding ways to utilize the data we collect to improve our technological application. + +This brings us to the next step, we've talked about storing our data in a modern, cost-effective fashion, but how do we get even more horsepower? Meaning, once we've collected all that data, what do we do with it? How can we analyze hundreds of terabytes efficiently? How can we react to information we're receiving in real-time, making decisions in seconds rather than hours? Enter Apache Spark. + +Spark is the next step in the evolution of big data processing. Hadoop and MapReduce were revolutionary projects, giving the big data world an opportunity to crunch all the data we've collected. Spark takes our big data analysis to the next level by drastically improving performance and massively decreasing code complexity. Through Spark, we can perform massive batch processing calculations, react quickly to stream processing, make smart decisions through machine learning, and understand complex, recursive relationships through graph traversals. It’s not just about offering your customers a fast and reliable connection to their application (which is what Cassandra offers), it's also about being able to leverage insights from the data Cassandra stores to make more intelligent business decisions and better cater to customer needs. + +You can check out the [Spark-Cassandra Connector][2] (open source) and give it a shot. To learn more about both technologies, we highly recommend the free self-paced courses on [DataStax Academy][3]. + +Have fun digging in and learning some killer new technology! If you want to learn more, check out our [OSCON tutorial][4], with a hands on exploration into the worlds of both Cassandra and Spark. + +We also love taking questions on Twitter, so give us a shout and we’ll try to help: [Dani][5] and [Jon][6]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/16/5/basics-cassandra-and-spark-data-processing + +作者:[Jon Haddad][a],[Dani Traphagen][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://twitter.com/rustyrazorblade +[b]: https://opensource.com/users/dtrapezoid +[1]: http://www.allthingsdistributed.com/files/amazon-dynamo-sosp2007.pdf +[2]: https://github.com/datastax/spark-cassandra-connector +[3]: https://academy.datastax.com/ +[4]: http://conferences.oreilly.com/oscon/open-source-us/public/schedule/detail/49162 +[5]: https://twitter.com/dtrapezoid +[6]: https://twitter.com/rustyrazorblade From 0f082c887259262d50cfb1109d53a22f87b1f78e Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 15 May 2016 11:47:09 +0800 Subject: [PATCH 0748/1469] =?UTF-8?q?20160515-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rt Devices, Security Concerns, and More.md | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 sources/talk/20160506 Linus Torvalds Talks IoT, Smart Devices, Security Concerns, and More.md diff --git a/sources/talk/20160506 Linus Torvalds Talks IoT, Smart Devices, Security Concerns, and More.md b/sources/talk/20160506 Linus Torvalds Talks IoT, Smart Devices, Security Concerns, and More.md new file mode 100644 index 0000000000..e17c33bd81 --- /dev/null +++ b/sources/talk/20160506 Linus Torvalds Talks IoT, Smart Devices, Security Concerns, and More.md @@ -0,0 +1,46 @@ +Linus Torvalds Talks IoT, Smart Devices, Security Concerns, and More[video] +=========================================================================== + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/elc-linus-b.jpg?itok=6WwnCSjL) +>Dirk Hohndel interviews Linus Torvalds at ELC. + +For the first time in the 11-year history of the [Embedded Linux Conference (ELC)][0], held in San Diego, April 4-6, the keynotes included a discussion with Linus Torvalds. The creator and lead overseer of the Linux kernel, and “the reason we are all here,” in the words of his interviewer, Intel Chief Linux and Open Source Technologist Dirk Hohndel, seemed upbeat about the state of Linux in embedded and Internet of Things applications. Torvalds very presence signaled that embedded Linux, which has often been overshadowed by Linux desktop, server, and cloud technologies, had come of age. + +![](https://www.linux.com/sites/lcom/files/styles/floated_images/public/elc-linus_0.jpg?itok=FNPIDe8k) +>Linus Torvalds speaking at Embedded Linux Conference. + +IoT was the main topic at ELC, which included an OpenIoT Summit track, and the chief topic in the Torvalds interview. + +“Maybe you won’t see Linux at the IoT leaf nodes, but anytime you have a hub, you will need it,” Torvalds told Hohndel. “You need smart devices especially if you have 23 [IoT standards]. If you have all these stupid devices that don’t necessarily run Linux, and they all talk with slightly different standards, you will need a lot of smart devices. We will never have one completely open standard, one ring to rule them all, but you will have three of four major protocols, and then all these smart hubs that translate.” + +Torvalds remained customarily philosophical when Hohndel asked about the gaping security holes in IoT. “I don’t worry about security because there’s not a lot we can do,” he said. “IoT is unpatchable -- it’s a fact of life.” + +The Linux creator seemed more concerned about the lack of timely upstream contributions from one-off embedded projects, although he noted there have been significant improvements in recent years, partially due to consolidation on hardware. + +“The embedded world has traditionally been hard to interact with as an open source developer, but I think that’s improving,” Torvalds said. “The ARM community has become so much better. Kernel people can now actually keep up with some of the hardware improvements. It’s improving, but we’re not nearly there yet.” + +Torvalds admitted to being more at home on the desktop than in embedded and to having “two left hands” when it comes to hardware. + +“I’ve destroyed things with a soldering iron many times,” he said. “I’m not really set up to do hardware.” On the other hand, Torvalds guessed that if he were a teenager today, he would be fiddling around with a Raspberry Pi or BeagleBone. “The great part is if you’re not great at soldering, you can just buy a new one.” + +Meanwhile, Torvalds vowed to continue fighting for desktop Linux for another 25 years. “I’ll wear them down,” he said with a smile. + +Watch the full video, below. + +Get the Latest on Embedded Linux and IoT. Access 150+ recorded sessions from Embedded Linux Conference 2016. [Watch Now][1]. + +[video](https://youtu.be/tQKUWkR-wtM) + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/linus-torvalds-talks-iot-smart-devices-security-concerns-and-more-video + +作者:[ERIC BROWN][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/ericstephenbrown +[0]: http://events.linuxfoundation.org/events/embedded-linux-conference +[1]: http://go.linuxfoundation.org/elc-openiot-summit-2016-videos?utm_source=lf&utm_medium=blog&utm_campaign=linuxcom From db9a8c2bbb36947e80ed72bf6148d70efdf8e5fd Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 15 May 2016 11:55:30 +0800 Subject: [PATCH 0749/1469] =?UTF-8?q?20160515-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...se: Six Unsung Apache Big Data Projects.md | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 sources/tech/20160510 On the Rise: Six Unsung Apache Big Data Projects.md diff --git a/sources/tech/20160510 On the Rise: Six Unsung Apache Big Data Projects.md b/sources/tech/20160510 On the Rise: Six Unsung Apache Big Data Projects.md new file mode 100644 index 0000000000..76d97b7505 --- /dev/null +++ b/sources/tech/20160510 On the Rise: Six Unsung Apache Big Data Projects.md @@ -0,0 +1,80 @@ +On the Rise: Six Unsung Apache Big Data Projects +================================================= + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/star-clusters-74052_1920.jpg?itok=HJISFdwo) +>Creative Commons Zero + +Countless organizations around the world are now working with data sets so large and complex that traditional data processing applications can no longer drive optimized analytics and insights. That’s the problem that the new wave of Big Data applications aims to solve, and the Apache Software Foundation (ASF) has recently graduated a slew of interesting open source Big Data projects to Top-Level status. That means that they will get active development and strong community support. + +Most people have heard of Apache Spark, [a Big Data processing framework][1] with built-in modules for streaming, SQL, machine learning and graph processing. IBM and other companies are pouring billions of development dollars into Spark initiatives, and NASA and the [SETI Institute][2] are collaborating to analyze terabytes of complex deep space radio signals using Spark’s machine learning capabilities in a hunt for patterns that might betray the presence of intelligent extraterrestrial life. + +![](https://www.linux.com/sites/lcom/files/styles/floated_images/public/asf.jpg?itok=wtu0hq36) + +However, several other recently elevated Apache Big Data projects deserve attention, too. In fact, some of them may produce ecosystems of activity and development that will rival Spark’s. In conjunction with this week’s [ApacheCon North America conference][3] and Apache: Big Data events, this article will round up the Apache Big Data projects that you should know about. + +Here are six projects on the rise: + +### Kylin + +Apache recently [announced][4] that its Kylin project, an open source Big Data project born at eBay, has graduated to Top-Level status. Kylin is an open source Distributed Analytics Engine designed to provide an SQL interface and multi-dimensional analysis (OLAP) on Apache Hadoop, supporting extremely large datasets. It is still widely used at eBay and at a few other organizations. + +"Apache Kylin's incubation journey has demonstrated the value of Open Source governance at ASF and the power of building an open-source community and ecosystem around the project," said Luke Han, Vice President of Apache Kylin. "Our community is engaging the world's biggest local developer community in alignment with the Apache Way." + +As an OLAP-on-Hadoop solution, Apache Kylin aims to fill the gap between Big Data exploration and human use, "enabling interactive analysis on massive datasets with sub-second latency for analysts, end users, developers, and data enthusiasts," according to developers. "Apache Kylin brings back business intelligence (BI) to Apache Hadoop to unleash the value of Big Data," they added. + +### Lens + +Apache also recently [announced][5] that Apache Lens, an open source Big Data and analytics tool, has graduated from the Apache Incubator to become a Top-Level Project (TLP). According to the announcement: "Apache Lens is a Unified Analytics platform. It provides an optimal execution environment for analytical queries in the unified view. Apache Lens aims to cut the Data Analytics silos by providing a single view of data across multiple tiered data stores." + +"By providing an online analytical processing (OLAP) model on top of data, Lens seamlessly integrates Apache Hadoop with traditional data warehouses to appear as one. It also provides query history and statistics for queries running in the system along with query life cycle management." + +"Incubating Apache Lens has been an amazing experience at the ASF," said Amareshwari Sriramadasu, Vice President of Apache Lens. "Apache Lens solves a very critical problem in Big Data analytics space with respect to end users. It enables business users, analysts, data scientists, developers and other users to do complex analysis with ease, without knowing the underlying data layout." + +### Ignite + +The ASF has also [announced][6] that Apache Ignite has become a top-level project. It's an open source effort to build an in-memory data fabric. + +“Apache Ignite is a high-performance, integrated and distributed In-Memory Data Fabric for computing and transacting on large-scale data sets in real-time, "orders of magnitude faster than possible with traditional disk-based or flash technologies," according to Apache community members. “It is designed to easily power both existing and new applications in a distributed, massively parallel architecture on affordable, industry-standard hardware.” + +### Brooklyn + +The foundation [announced][7] that Apache Brooklyn is now a Top-Level Project (TLP), "signifying that the project's community and products have been well-governed under the ASF's meritocratic process and principles." Brooklyn is an application blueprint and management platform used for integrating services across multiple data centers as well as and a wide range of software in the cloud. + +According to the Brooklyn announcement: "With modern applications being composed of many components, and increasing interest in micro-services architecture, the deployment and ongoing evolution of deployed apps is an increasingly difficult problem. Apache Brooklyn’s blueprints provide a clear, concise way to model an application, its components and their configuration, and the relationships between components, before deploying to public Cloud or private infrastructure. Policy-based management, built on the foundation of autonomic computing theory, continually evaluates the running application and makes modifications to it to keep it healthy and optimize for metrics such as cost and responsiveness." + +Brooklyn is in use at some notable organizations. Cloud service providers Canopy and Virtustream have created product offerings built on Brooklyn. IBM has also made extensive use of Apache Brooklyn in order to migrate large workloads from AWS to IBM Softlayer. + +### Apex + +In April, the Apache Software Foundation [elevated][8] its Apex project to Top-Level status. It is billed as “a large scale, high throughput, low latency, fault tolerant, unified Big Data stream and batch processing platform for the Apache Hadoop ecosystem.” Apex works in conjunction with Apache Hadoop YARN, a resource management platform for working with Hadoop clusters. + +### Tajo + +Finally, Apache Tajo, an advanced open source data warehousing system in Apache Hadoop, is another new Big Data project to know about. Apache claims that Tajo provides the ability to rapidly extract more intelligence for Hadoop deployments, third party databases, and commercial business intelligence tools. + +Clearly, although Apache Spark draws the bulk of the headlines, it is not the only Big Data tool from Apache to keep your eyes on. As this year continues, Apache likely will graduate even more compelling Big Data projects to Top-Level status, where they will benefit from optimized development resources and more. + + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/enterprise/systems-management/887177-achieving-enterprise-ready-container-tools-with-werckers-open-source-cli + +作者:[SAM DEAN][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/sam-dean +[1]: https://www.linux.com/news/apache-spark-16-strong-typing-faster-throughput +[2]: http://www.seti.org/ +[3]: http://events.linuxfoundation.org/events/apachecon-north-america +[4]: http://globenewswire.com/news-release/2015/12/08/793713/0/en/The-Apache-Software-Foundation-Announces-Apache-Kylin-as-a-Top-Level-Project.html +[5]: http://globenewswire.com/news-release/2015/08/26/763513/10147133/en/The-Apache-Software-Foundation-Announces-Apache-tm-Lens-tm-as-a-Top-Level-Project.html +[6]: http://globenewswire.com/news-release/2015/08/25/763148/10146997/en/The-Apache-Software-Foundation-Announces-Apache-tm-Ignite-tm-as-a-Top-Level-Project.html +[7]: http://globenewswire.com/news-release/2015/11/23/789504/0/en/The-Apache-Software-Foundation-Announces-Apache-Brooklyn-as-a-Top-Level-Project.html +[8]: https://globenewswire.com/news-release/2016/04/25/832114/0/en/The-Apache-Software-Foundation-Announces-Apache-Apex-as-a-Top-Level-Project.html + + + + From a1d4ad07969ab517b59332f67b2d7587e3072bc7 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 15 May 2016 12:06:27 +0800 Subject: [PATCH 0750/1469] =?UTF-8?q?20160511-4=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...11 4 Container Networking Tools to Know.md | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 sources/tech/20160511 4 Container Networking Tools to Know.md diff --git a/sources/tech/20160511 4 Container Networking Tools to Know.md b/sources/tech/20160511 4 Container Networking Tools to Know.md new file mode 100644 index 0000000000..5b80791c6f --- /dev/null +++ b/sources/tech/20160511 4 Container Networking Tools to Know.md @@ -0,0 +1,63 @@ +4 Container Networking Tools to Know +======================================= + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/network-crop.jpeg?itok=Na1tb9aR) +>[Creative Commons Zero][1] + +With so many new cloud computing technologies, tools, and techniques to keep track of, it can be hard to know where to start learning new skills. This series on [next-gen cloud technologies][2] aims to help you get up to speed on the important projects and products in emerging and rapidly changing areas such as software-defined networking (SDN) , containers, and the space where they coincide: container networking. + +The relationship between containers and networks remains challenging for enterprise container deployment. Containers need networking functionality to connect distributed applications. Part of the challenge, according to a recent [Enterprise Networking Planet][3] article, is “to deploy containers in a way that provides the isolation they need to function as their own self-contained data environments while still maintaining effective connectivity.” + +[Docker][4], the popular container platform, uses software-defined virtual networks to connect containers with the local network. Additionally, it uses Linux bridging features and virtual extensible LAN (VXLAN) technology so containers can communicate with each other in the same Swarm, or cluster. Docker’s plug-in architecture also allows other network management tools, such as those listed below, to control containers. + +Innovation in container networking has enabled containers to connect with other containers across hosts. This enables developers to start an application in a container on a host in a development environment and transition it across testing and then into a production environment enabling continuous integration, agility, and rapid deployment. + +Container networking tools help accomplish container networking scalability, mainly by: + +1) enabling complex, multi-host systems to be distributed across multiple container hosts. + +2) enabling orchestration for container systems spanning a tremendous number of hosts across multiple public and private cloud platforms. + +![](https://www.linux.com/sites/lcom/files/styles/floated_images/public/john-willis_k.jpg?itok=lTsH9eqI) +>John Willis speaking at Open Networking Summit 2016. + +For more information, check out the [Docker Networking Tutorial][5] video, which was presented by Brent Salisbury and John Willis at the recent [Open Networking Summit (ONS)][6]. This and many other ONS keynotes and presentations can be found [here][7]. + +Container networking tools and projects you should know about include: + +[Calico][8] -- The Calico project (from [Metaswitch][9]) leverages Border Gateway Protocol (BGP) and integrates with cloud orchestration systems for secure IP communication between virtual machines and containers. + +[Flannel][10] -- Flannel (previously called rudder) from [CoreOS][11] provides an overlay network that can be used as an alternative to existing SDN solutions. + +[Weaveworks][12] -- The Weaveworks projects for managing containers include [Weave Net][13], Weave Scope, and Weave Flux. Weave Net is a tool for building and deploying Docker container networks. + +[Canal][14] -- Just this week, CoreOS and Tigera announced the formation of a new open source project called Canal. According to the announcement, the Canal project aims to combine aspects of Calico and Flannel, "weaving security policy into both the network fabric and the cloud orchestrator." + +You can learn more about container management, software-defined networking, and other next-gen cloud technologies through The Linux Foundation’s free “Cloud Infrastructure Technologies” course -- a massively open online course being offered through edX. [Registration for this course is open now][15], and course content will be available in June. + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/4-container-networking-tools-know + +作者:[AMBER ANKERHOLZ][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/aankerholz +[1]: https://www.linux.com/licenses/category/creative-commons-zero +[2]: https://www.linux.com/news/5-next-gen-cloud-technologies-you-should-know +[3]: http://www.enterprisenetworkingplanet.com/datacenter/datacenter-blog/container-networking-challenges-for-the-enterprise.html +[4]: https://docs.docker.com/engine/userguide/networking/dockernetworks/ +[5]: https://youtu.be/Le0bEg4taak +[6]: http://events.linuxfoundation.org/events/open-networking-summit +[7]: https://www.linux.com/watch-videos-from-ons2016 +[8]: https://www.projectcalico.org/ +[9]: http://www.metaswitch.com/cloud-network-virtualization +[10]: https://coreos.com/blog/introducing-rudder/ +[11]: https://coreos.com/ +[12]: https://www.weave.works/ +[13]: https://www.weave.works/products/weave-net/ +[14]: https://github.com/tigera/canal +[15]: https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-cloud-infrastructure-technologies?utm_source=linuxcom&utm_medium=article&utm_campaign=cloud%20mooc%20article%201 From 05d3ca22870bc60193ff17bd5d46fd7bcee894c8 Mon Sep 17 00:00:00 2001 From: zpl1025 Date: Sun, 15 May 2016 12:36:26 +0800 Subject: [PATCH 0751/1469] [translated] 20160502 The intersection of Drupal, IoT, and open hardware.md --- ...ction of Drupal, IoT, and open hardware.md | 53 ---------------- ...ction of Drupal, IoT, and open hardware.md | 62 +++++++++++++++++++ 2 files changed, 62 insertions(+), 53 deletions(-) delete mode 100644 sources/tech/20160502 The intersection of Drupal, IoT, and open hardware.md create mode 100644 translated/tech/20160502 The intersection of Drupal, IoT, and open hardware.md diff --git a/sources/tech/20160502 The intersection of Drupal, IoT, and open hardware.md b/sources/tech/20160502 The intersection of Drupal, IoT, and open hardware.md deleted file mode 100644 index 43ee75fae6..0000000000 --- a/sources/tech/20160502 The intersection of Drupal, IoT, and open hardware.md +++ /dev/null @@ -1,53 +0,0 @@ -zpl1025 -The intersection of Drupal, IoT, and open hardware -======================================================= - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/drupal_blue_gray_lead.jpeg?itok=t7W_KD-D) - - -Meet [Amber Matz][1], a Production Manager and Trainer at [Drupalize.Me][3], a service of Lullabot Education. When she's not tinkering around with Arduinos, Raspberry Pis, and electronic wearables, you can find her wrangling presenters for the Portland Drupal User Group. - -Coming up at [DrupalCon NOLA][3], Amber will host a session about Drupal and IoT. If you're attending and want to learn about the intersection of open hardware, IoT, and Drupal, this session is for you. If you're not able to join us in New Orleans, Amber has some pretty cool things to share. In this interview, she tells us how she got involved with Drupal, a few of her favorite open hardware projects, and what the future holds for IoT and Drupal. - -![](https://opensource.com/sites/default/files/images/life/Interview%20banner%20Q%26A.png) - -**How did you get involved with the Drupal community?** - -Back in the day, I was working at a large nonprofit in the "webmaster's office" of the marketing department and was churning out custom PHP/MySQL forms like nobody's business. I finally got weary of that and starting hunting around the web for a better way. I found Drupal 6 and starting diving in on my own. Years later, after a career shift and a move, I discovered the Portland Drupal User Group and landed a job as a full-time Drupal developer. I continued to regularly attend the meetups in Portland, which I found to be a great source of community, friendships, and professional development. Eventually, I landed a job with Lullabot as a trainer creating content for Drupalize.Me. Now, I'm managing the Drupalize.Me content pipeline, creating Drupal 8 content, and am very much involved in the Portland Drupal community. I'm this year's coordinator, finding and scheduling speakers. - -**We have to know: What is Arduino prototyping, how did you discover it, and what's the coolest thing you've done with an Arduino?** - -Arduino, Raspberry Pi, and wearable electronics have been these terms that I've heard thrown around for years. I found [Adafruit's Wearable Electronics][4] with Becky Stern YouTube show years ago (which, up until recently, when Becky moved on, aired every Wednesday). I was fascinated by wearables and even ordered an LED sewing kit but never did anything with it. I just didn't get it. I had no background in electronics whatsoever, and while I was fascinated by the projects I was finding, I didn't see how I could ever make anything like that. It seemed so out of reach. - -Finally, I found a Coursera "Internet of Things" specialization. (So trendy, right?) But I was immediately hooked! I finally got an explanation of what an Arduino was, along with all these other important terms and concepts. I ordered the recommended Arduino starter kit, which came with a getting started booklet. When I made that first LED blink, it was pure delight. I had two weeks' vacation over the holidays and after Christmas, and I did nothing but make and program Arduino circuits from the getting started booklet. It was oddly so relaxing! I enjoyed it so much. - -In January, I started creating my own prototypes. When I found out I was emceeing our company retreat's lightning talks, I created a Lightning Talk Visual Timer prototype with five LEDs and an Arduino. - -![](https://opensource.com/sites/default/files/resize/amber-arduino-lightning-talk-timer-400x400.jpg) - -It was a huge hit. I also made my first wearable project, a glowing hoodie, using the Arduino IDE compatible Gemma microcontroller, a tiny round sewable component, to which I sewed using conductive thread, a conductive slider connected to a hoodie's drawstring, which controlled the colors of five NeoPixels sewn around the inside of the hood. So that's what I mean by prototyping: Making crazy projects that are fun and maybe even a little practical. - -**What are the biggest opportunities for Drupal and IoT?** - -IoT isn't that much different than the web services and decoupling Drupal trends. It's the movement of data from thing one to thing two and the rendering of that data into something useful. But how does it get there? And what do you do with it? You think there are a lot of solutions, and apps, and frameworks, and APIs out there now? With IoT, that's only going to continue to increase—exponentially. What I've found is that given any device or any "thing", there is a way to connect it to the Internet—many ways. And there are plenty of code libraries out there to help makers get their data from thing one to thing two. - -So where does Drupal fit in? Web services, for one, is going to be the first obvious place. But as a maker, I don't want to spend my time coding custom modules in Drupal. I want to plug and play! So I would love to see modules emerge that connect with IoT Cloud APIs and services like ThingSpeak and Adafruit.io and IFTTT and others. I think there's an opportunity, too, for a business to build an IoT cloud service in Drupal that allows people to send and store their sensor data, visualize it charts and graphs, and build widgets that react to certain values or thresholds. Each of these IoT Cloud API services fill a slightly different niche, and there's plenty of room for others. - -**What are a few things you're looking forward to at DrupalCon?** - -I love reconnecting with Drupal friends, meeting new people, and also seeing Lullabot and Drupalize.Me co-workers (we're distributed companies)! There's so much to learn with Drupal 8 and it's been overwhelming at times to put together training materials for our customers. So, I'm looking forward to attending Drupal 8-related sessions and getting up-to-speed on the latest developments. Finally, I'm really curious about New Orleans! I haven't been there since 2004 and I'm excited to see what's changed. - -**Tell us about your DrupalCon talk Beyond the blink: Add Drupal to your IoT playground. Why should someone attend? What are the major takeaways?** - -My session title, Beyond the blink: Add Drupal to your IoT playground, in itself is so full of assumptions that first off I'm going to get everyone up to speed and on the same page. You don't need to know anything about Arduino, the Internet of Things, or even Drupal to follow along. We'll start with making an LED blink with an Arduino, and then I want to talk about what the main takeaways have been for me: Play, learn, teach, and make. I'll show examples that have inspired me and that will hopefully inspire and encourage others in the audience to give it a try. Then, it's demo time! - -First, thing one. Thing one is a Build Notifier Tower Light. In this demo, I'll show how I connected the Tower Light to the Internet and how I got it to respond to data received from a Cloud API service. Next, Thing two. Thing two is a "weather watch" in the form of a steampunk iPhone case. It's got small LED matrix that displays an icon of the local-to-me weather, a barometric pressure and temperature sensor, a GPS module, and a Bluetooth LE module, all connected and controlled with an Adafruit Flora microcontroller. Thing two sends weather and location data to Adafruit.io by connecting to an app on my iPhone over Bluetooth and sends it up to the cloud using an MQTT protocol! Then, on the Drupal side, I'm pulling down that data from the cloud, updating a block with the weather, and updating a map. So folks will get a taste of what you can do with web services, maps, and blocks in Drupal 8, too. - -It's been a brain-melting adventure learning and making these demo prototypes, and I hope others will come to the session and catch a little of this contagious enthusiasm I have for this intersection of technologies! I'm very excited to share what I've discovered. - - - -[1]: https://www.drupal.org/u/amber-himes-matz -[2]: https://drupalize.me/ -[3]: https://events.drupal.org/neworleans2016/ -[4]: https://www.adafruit.com/beckystern diff --git a/translated/tech/20160502 The intersection of Drupal, IoT, and open hardware.md b/translated/tech/20160502 The intersection of Drupal, IoT, and open hardware.md new file mode 100644 index 0000000000..7cfffd953f --- /dev/null +++ b/translated/tech/20160502 The intersection of Drupal, IoT, and open hardware.md @@ -0,0 +1,62 @@ +Drupal, IoT 和开源硬件的交叉点 +======================================================= + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/drupal_blue_gray_lead.jpeg?itok=t7W_KD-D) + + +认识一下 [Amber Matz][1],来自由 Lullabot Education 提供的 [Drupalize.Me][3] 的生产经理以及培训师。当她没有倒腾 Arduino,Raspberry Pi 以及电子穿戴设备时,通常会在波特兰 Drupal 用户组里和主持人争论。 + +在即将举行的 [DrupalCon NOLA][3] 大会上,Amber 将主持一个关于 Drupal 和 IoT 的主题。如果你会去参加,也想了解下开源硬件,IoT 和 Drupal 之间的交叉点,那这个将很合适。如果你去不了新奥尔良的现场也没关系,Amber 还分享了许多很酷的事情。在这次采访中,她讲述了自己参与 Drupal 的原因,一些她自己喜欢的开源硬件项目,以及 IoT 和 Drupal 的未来。 + +![](https://opensource.com/sites/default/files/images/life/Interview%20banner%20Q%26A.png) + +**你是怎么加入 Drupal 社区的?** + +在这之前,我在一家大型非盈利性机构市场部的“站长办公室”工作,大量产出没人喜欢的定制 PHP/MySQL 表格。终于我觉得这样很烦并开始在网上寻找更好的方式。然后我找到了 Drupal 6 并开始自己沉迷进去。多年以后,在准备职业转换的时候,发现了波特兰 Drupal 用户组,然后在里面找了一份全职的 Drupal 开发者工作。我一直经常参加在波特兰的聚会,我觉得它是一种很好的社区,交友,以及专业开发的资源。一个偶然的机会,我在 Lullabot 找了一份培训师的工作为 Drupalize.Me 提供内容。现在,我管理着 Drupalize.Me 的内容管道,创建 Drupal 8 的内容,还很大程度地参与到波特兰 Drupal 社区中。我是今年的协调员,寻找并规划演讲者。 + +**我们得明白:什么是 Arduino 原型,你是怎么找到它的,以及你用 Arduino 做过的最酷的事是什么?** + +Arduino,Raspberry Pi,以及可穿戴电子设备,这些年到处都能听到这些术语。我在几年前通过 Becky Stern YouTube 秀(最近由 Becky 继续主持,每周三播出)发现了 [Adafruit 的可穿戴电子设备][4]。我被那些可穿戴设备迷住了,还订了一套 LED 缝制工具,不过没做出任何东西。我就是没搞懂。我没有任何电子相关的背景,而且在我被那些项目吸引的时候,我根本不知道怎么做出那样的东西。看上去太遥远了。 + +后来,我找到一个 Coursera 的“物联网”专题。(很时髦,对吧?)但我很快就喜欢上了。我最终找到了 Arduino 是什么的解释,以及所有这些其他的重要术语和概念。我订了一套推荐的 Arduino 初学者套件,还附带了一本如何上手的小册子。当我第一次让 LED 闪烁的时候,开心极了。我在圣诞节以及之后有两个星期的假期,然后我什么都没干,就一直根据初学者小册子给 Arduino 电路编程。很奇怪我觉得很放松!我太喜欢了。 + +一月份的时候,我开始构思我自己的原型设备。在知道我要主持公司培训的开场白时,我用五个 LED 灯和 Arduino 搭建了一个开场白视觉计时器。 + +![](https://opensource.com/sites/default/files/resize/amber-arduino-lightning-talk-timer-400x400.jpg) + +这是一次巨大的成功。我还做了我的第一个可穿戴项目,一件会发光的连帽衫,使用了和 Arduino IDE 兼容的 Gemma 微控制器,一个小的圆形可缝制部件,然后用可导电的线缝起来,将一个滑动可变电阻和衣服帽口的收缩绳连在一起,用来控制缝到帽子里的五个 NeoPixel 灯的颜色。这就是我对原型设计的看法:开展一些很好玩也可能会有点实际用途的疯狂项目。 + +**Drupal 和 IoT 带来的最大机遇是什么??** + +IoT 和网站服务以及 Drupal 分层趋势实际并没有太大差别。就是将数据从一个物体传送到另一个物体,然后将数据转换成一些有用的东西。但数据是如何送达?能用来做点什么?你觉得现在就有一大堆现成的解决方案,应用,中间层,以及 API?采用 IoT,这只会继续成指数增长。我觉得,给我任何一个设备或“物体”,需要只用一种方式来将它连接到因特网的无线可能上。然后有现成的各种代码库来帮助制作者将他们的数据从一个物体送到另一个物体。 + +那么 Drupal 在这里处于什么位置?首先,网站服务将是第一个明显的地方。但作为一个制作者,我不希望将时间花在编写 Drupal 的订制模块上。我想要的是即插即用!所以我很高兴出现这样的模块能连接 IoT 云端 API 和服务,比如 ThingSpeak,Adafruit.io,IFTTT,以及其他的。我觉得也有一个很好的商业机会,在 Drupal 里构建一套 IoT 云服务,允许用户发送和存储他们的传感器数据,并可以制成表格和图像,还可以写一些插件可以响应特定数据或阙值。每一个 IoT 云 API 服务都是一个细分的机会,所以能留下很大空间给其他人。 + +**这次 DrupalCon 你有哪些期待?** + +我喜欢重新联系 Drupal 上的朋友,认识一些新的人,还能见到 Lullabot 和 Drupalize.Me 的同事(我们是分布式的公司)!Drupal 8 有太多东西可以去探索了,不可抗拒地要帮我们的客户收集培训资料。所以,我很期待参与一些 Drupal 8 相关的主题,以及跟上最新的开发活动。最后,我对新奥尔良也很感兴趣!我曾经在 2004 年去过,很期待将这次将看到哪些改变。 + +**谈一谈你这次 DrupalCon 上的演讲,超越闪烁:将 Drupal 加到你的 IoT 游乐场中。别人为什么要参与?他们最重要的收获会是什么?** + +我的主题的标题是,超越闪烁:将 Drupal 加到你的 IoT 游乐场中,本身有很多假设,我将让所有人都放在同一速度和层次。你不需要了解任何关于 Arduino,物联网,甚至是 Drupal,都能跟上。我将从用 Arduino 让 LED 灯闪烁开始,然后我会谈一下我自己在这里面的最大收获:玩,学,教,和做。我会列出一些曾经激发过我的例子,它们也很有希望能激发和鼓励其他听众去尝试一下。然后,就是展示时间! + +首先,第一个东西。它是一个构建提醒信号灯。在这个展示里,我会说明如何将信号灯连到互联网上,以及如何响应从云 API 服务收到的数据。然后,第二个东西。它是一个蒸汽朋克风格 iPhone 外壳形式的“天气手表”。有一个小型 LED 矩阵用来显示我的天气的图标,一个气压和温度传感器,一个 GPS 模块,以及一个 Bluetooth LE 模块,都连接到一个 Adafruit Flora 微控制器上。第二个东西能通过蓝牙连接到我的 iPhone 上的一个应用,并将天气和位置数据通过 MQTT 协议发到 Adafruit.io 的服务器!然后,在 Drupal 这边,我会从云端下载这些数据,根据天气更新一个功能块,然后更新地图。所以大家也能体验一下通过网站服务,地图和 Drupal 8 的功能块所能做的事情。 + +学习和制作这些展示原型是一次烧脑的探险,我也希望有人能参与这个主题并感染一点我对这个技术交叉的传染性热情!我很兴奋能分享一些我的发现。 + + +------------------------------------------------------------------------------ + +via: https://opensource.com/business/16/5/drupalcon-interview-amber-matz + +作者:[Jason Hibbets][a] +译者:[zpl1025](https://github.com/zpl1025) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jhibbets +[1]: https://www.drupal.org/u/amber-himes-matz +[2]: https://drupalize.me/ +[3]: https://events.drupal.org/neworleans2016/ +[4]: https://www.adafruit.com/beckystern From 5069ba41d243b6c99fdeaa2c531b9e710548da20 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 15 May 2016 12:44:20 +0800 Subject: [PATCH 0752/1469] =?UTF-8?q?20160515-5=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...actor Authentication for Login and sudo.md | 116 ++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 sources/tech/20160513 How to Set Up 2-Factor Authentication for Login and sudo.md diff --git a/sources/tech/20160513 How to Set Up 2-Factor Authentication for Login and sudo.md b/sources/tech/20160513 How to Set Up 2-Factor Authentication for Login and sudo.md new file mode 100644 index 0000000000..81cf285cf0 --- /dev/null +++ b/sources/tech/20160513 How to Set Up 2-Factor Authentication for Login and sudo.md @@ -0,0 +1,116 @@ +How to Set Up 2-Factor Authentication for Login and sudo +========================================================== + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/auth_crop.png?itok=z_cdYZZf) +>[Used with permission][1] + +Security is all the rage—as it should be. We live in a world where data is an incredibly valuable currency, and you’re always at risk of loss. Because of this, you must do everything you can to ensure what you hold on your desktops and servers is safe. To that end, administrators and users will create incredibly complex passwords, employ password managers, and more. But, what if I told you could take the login to your Linux servers and desktops one step—nay, two steps—further? Thanks to the [Google Authenticator][2], you can. On top of that, it’s incredibly easy to set up. + +I am going to walk you through the process of setting up two-factor authentication for use on login and sudo. I will demonstrate this on a Ubuntu 16.04 desktop, but the process works for the server as well. To handle the two-factor side of things, I will be making use of the Google Authenticator. + +There is one very important caveat to this: Once you’ve set this up, you will not be able to log into the account (or issue sudo commands) without a six-digit code from the authenticator. This also adds another step for you, so if having to pull out your smartphone every time you need to log into your Linux machine (or use sudo), this might not be for you. Remember, however, this added step brings with it an extra layer of security you wouldn’t have otherwise. + +With that said, let’s set this up. + +### Installing the Necessary Components + +There are two pieces of this puzzle that must be installed—both in the form of the Google Authenticator. The first is the smartphone app. Here’s how to install from the Google Play Store: + +1. Open the Google Play Store on your Android device + +2. Search for google authenticator + +3. Locate and tap the entry by Google Inc. + +4. Tap Install + +5. Tap Accept + +6. Allow the installation to complete + +Now let’s move on to installing the authenticator on your Linux machine. Here’s how: + +1. Open a terminal window + +2. Issue the command sudo apt-get install google-authenticator + +3. Type your sudo password and hit Enter + +4. If prompted, type y and hit Enter + +5. Allow the installation to complete + +It’s now time to configure the login process to work with the google-authenticator. + +### Configuration + +Just one file must be edited to add two-step authentication for both login and sudo usage. The file is /etc/pam.d/common-auth. Open it and look for the line: + +``` +auth [success=1 default=ignore] pam_unix.so nullok_secure +``` + +Above that line, add the following: + +``` +auth required pam_google_authenticator.so +``` + +Save and close the file. + +The next step is to set up google-authenticator for every user on the system (otherwise, they will not be able to log in). For example’s sake, we’ll assume there are two users on your system: jack and olivia. We’ll first set this up for jack (we’ll assume this is the account we’ve been working with all along). + +Open up a terminal window and issue the command google-authenticator. You will be asked a series of questions (each of which you should answer with a y. The questions are: + +* Do you want me to update your "/home/jlwallen/.google_authenticator" file (y/n) y + +* Do you want to disallow multiple uses of the same authentication token? This restricts you to one login about every 30s, but it increases your chances to notice or even prevent man-in-the-middle attacks (y/n) + +* By default, tokens are good for 30 seconds, and to compensate for possible time-skew between the client and the server, we allow an extra token before and after the current time. If you experience problems with poor time synchronization, you can increase the window from its default size of 1:30min to about 4min. Do you want to do so (y/n) + +* If the computer that you are logging into isn't hardened against brute-force login attempts, you can enable rate-limiting for the authentication module. By default, this limits attackers to no more than 3 login attempts every 30s. Do you want to enable rate-limiting (y/n) + +Once you’ve answered these questions, you’ll be presented with your secret key, a verification code, and five emergency scratch codes. Print out the scratch codes and keep them with you. These codes can be used if you do not have your phone (each code is a one-time use only). The secret key is what you use to set up the account on the Google Authenticator app and the verification code is a one-time use code that you can use immediately (if needed). + +### Setting Up the App + +You now have the user jack set up. Before you can set up the user olivia, you need to add an account for jack on the Google Authenticator app. Open the app and the, from the main window, tap the menu button (three vertical dots in the upper right hand corner). Tap Set up account and then tap Enter provided key. In the next window (Figure 1), you will enter 16-digit secret key provided when you issued the google-authenticator app. Give the account a name (so you will remember which account this is to be used on) and tap ADD. + +![](https://www.linux.com/sites/lcom/files/styles/floated_images/public/auth_a.png?itok=xSMkd-Mf) +>Figure 1: Adding a new account to the Google Authenticator app. + +Now that you’ve added the account, you will be presented with six-digit keys that will be requested every time you log in or attempt to use sudo. + +Finally, you have to set up the other accounts on the system. As I mentioned, we’re going to set up the account called olivia. Here’s how: + +1. Open up a terminal window + +2. Issue the command sudo su olivia + +3. Open the Google Authenticator on your smartphone + +4. Type the six digit authentication code (provided by the app) in the terminal window (Figure 2) and hit Enter + +5. Type your sudo password and hit Enter + +6. As the new user, issue the google-authenticator command, answer the questions, and record the keys and codes provided + +After you’ve successfully set up the user olivia, with the google-authenticator command, add a new account on the Google Authenticator app with that user’s info (in the same manner you did for the initial user). You should now have accounts on the Google Authenticator app for both jack and olivia. + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/auth_b.png?itok=FH36V1r0) +>Figure 2: Entering the six-digit authentication code for sudo. + +That’s it. Every time you attempt to log into your machine (or use sudo), you will be required to provide a six-digit authentication key, before you can enter your user password. Your Linux machine is now far more secure than it was before adding two-factor authentication. Although some might consider this process a hassle, I highly recommend setting it up...especially for machines that house sensitive data. + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/auth_b.png?itok=FH36V1r0 + +作者:[JACK WALLEN][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +[a]: https://www.linux.com/users/jlwallen +[1]: https://www.linux.com/licenses/category/used-permission +[2]: https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2 + From 9bb424eb15956506937d9c20daf80569c3263203 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 15 May 2016 12:47:40 +0800 Subject: [PATCH 0753/1469] =?UTF-8?q?20160515-6=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ing sys admin works his way up in Linux.md | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 sources/talk/my-open-source-story/20160510 Aspiring sys admin works his way up in Linux.md diff --git a/sources/talk/my-open-source-story/20160510 Aspiring sys admin works his way up in Linux.md b/sources/talk/my-open-source-story/20160510 Aspiring sys admin works his way up in Linux.md new file mode 100644 index 0000000000..7a2cc8d071 --- /dev/null +++ b/sources/talk/my-open-source-story/20160510 Aspiring sys admin works his way up in Linux.md @@ -0,0 +1,38 @@ +Aspiring sys admin works his way up in Linux +=============================================== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BIZ_workplay.png?itok=uQqFssrf) + +I first saw Linux in action around 2001 at my first job. I was as an account manager for an Austrian automotive industry supplier and shared an office with our IT guy. He was creating a CD burning station (one of those huge things that can burn and print several CDs simultaneously) so that we could create and send CDs of our car parts catalogue to customers. While the burning station was originally designed for Windows, he just could not get it to work. He eventually gave up on Windows and turned to Linux, and it worked flawlessly. + +For me, it was all kind of arcane. Most of the work was done on the command line, which looked like DOS but was much more powerful (even back then, I recognized this). I had been a Mac user since 1993, and a CLI (command line interface) seemed a bit old fashioned to me at the time. + +It was not until years later—I believe around 2009—that I really discovered Linux for myself. By then, I had moved to the Netherlands and found a job working for a retail supplier. It was a small company (about 20 people) where, aside from my normal job as a key account manager, I had involuntarily become the first line of IT support. Whenever something didn't work, people first came to me before calling the expensive external IT consultant. + +One of my colleagues had fallen for a phishing attack and clicked on an .exe file in an email that appeared to be from DHL. (Yes, it does happen.) His computer got completely taken over and he could not do anything. Even a complete reformat wouldn't help, as the virus kept rearing it's ugly head. I only later learned that it probably had written itself to the MBR (Master Boot Record). By this time, the contract with the external IT consultant had been terminated due to cost savings. + +I turned to Ubuntu to get my colleague to work again. And work it did—like a charm. The computer was humming along again, and I got all the important applications to work like they should. In some ways it wasn't the most elegant solution, I'll admit, yet he (and I) liked the speed and stability of the system. + +However, my colleague was so entrenched in the Windows world that he just couldn't get used to the fact that some things were done differently. He just kept complaining. (Sound familiar?) + +While my colleague couldn't bear that things were done differently, I noticed that this was much less of an issue for me as a Mac user. There were more similarities. I was intrigued. So, I installed a dual boot with Ubuntu on my work laptop and found that I got much more work done in less time and it was much easier to get the machine to do what I wanted. Ever since then I've been regularly using several Linux distros, with Ubuntu and Elementary being my personal favorites. + +At the moment, I am unemployed and hence have a lot of time to educate myself. Because I've always had an interest in IT, I am working to get into Linux systems administration. But is awfully hard to get a chance to show your knowledge nowadays because 95% of what I have learned over the years can't be shown on a paper with a stamp on it. Interviews are the place for me to have a conversation about what I know. So, I signed up for Linux certifications that I hope give me the boost I need. + +I have also been contributing to open source for some time. I started by doing translations (English to German) for the xTuple ERP and have since moved on to doing Mozilla "customer service" on Twitter, filing bug reports, etc. I evangelize for free and open software (with varying degrees of success) and financially support several FOSS advocate organizations (DuckDuckGo, bof.nl, EFF, GIMP, LibreCAD, Wikipedia, and many others) whenever I can. I am also currently working to set up a regional privacy cafe. + +Aside from that, I have started working on my first book. It's supposed to be a lighthearted field manual for normal people about computer privacy and security, which I hope to self-publish by the end of the year. (The book will be licensed under Creative Commons.) As for content, you can expect that I will explain in detail why privacy is important and what is wrong with the whole "I have nothing to hide" mentality. But the biggest part will be instructions how to get rid of pesky ad-trackers, encrypting your hard disk and mail, chat OTR, how to use TOR, etc. While it's a manual first, I aim for a tone that is casual and easy to understand spiced up with stories of personal experiences. + +I still love my Macs and will use them whenever I can afford it (mainly because of the great construction), but Linux is always there in a VM and is used for most of my daily work. Nothing fancy here, though: word processing (LibreOffice and Scribus), working on my website and blog (Wordpress and Jekyll), editing some pictures (Shotwell and Gimp), listening to music (Rhythmbox), and pretty much every other task that comes along. + +Whichever way my job hunt turns out, I know that Linux will always be my go-to system. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/16/5/my-linux-story-rene-raggl + +作者:[Rene Raggl][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +[a]: https://opensource.com/users/rraggl From ada80430b5d849b36718c88a50319b840e03758c Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 15 May 2016 12:53:49 +0800 Subject: [PATCH 0754/1469] =?UTF-8?q?20160515-7=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...re contributing to open source projects.md | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 sources/talk/20160510 65% of companies are contributing to open source projects.md diff --git a/sources/talk/20160510 65% of companies are contributing to open source projects.md b/sources/talk/20160510 65% of companies are contributing to open source projects.md new file mode 100644 index 0000000000..ad3b4ef680 --- /dev/null +++ b/sources/talk/20160510 65% of companies are contributing to open source projects.md @@ -0,0 +1,63 @@ +65% of companies are contributing to open source projects +========================================================== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BUSINESS_openseries.png?itok=s7lXChId) + +This year marks the 10th annual Future of Open Source Survey to examine trends in open source, hosted by Black Duck and North Bridge. The big takeaway from the survey this year centers around the mainstream acceptance of open source today and how much has changed over the last decade. + +The [2016 Future of Open Source Survey][1] analyzed responses from nearly 3,400 professionals. Developers made their voices heard in the survey this year, comprising roughly 70% of the participants. The group that showed exponential growth were security professionals, whose participation increased by over 450%. Their participation shows the increasing interest in ensuring that the open source community pays attention to security issues in open source software and securing new technologies as they emerge. + +Black Duck's [Open Source Rookies][2] of the Year awards identify some of these emerging technologies, like Docker and Kontena in containers. Containers themselves have seen huge growth this year–76% of respondents say their company has some plans to use containers. And an amazing 59% of respondents are already using containers in a variety of deployments, from development and testing to internal and external production environment. The developer community has embraced containers as a way to get their code out quickly and easily. + +It's not surprising that the survey shows a miniscule number of organizations having no developers contributing to open source software. When large corporations like Microsoft and Apple open source some of their solutions, developers gain new opportunities to participate in open source. I certainly hope this trend will continue, with more software developers contributing to open source projects at work and outside of work. + +### Highlights from the 2016 survey + +#### Business value + +* Open source is an essential element in development strategy with more than 65% of respondents relying on open source to speed development. +* More than 55% leverage open source within their production environments. + +#### Engine for innovation + +* Respondents reported use of open source to drive innovation through faster, more agile development; accelerated time to market and vastly superior interoperability. +* Additional innovation is afforded by open source's quality of solutions; competitive features and technical capabilities; and ability to customize. + +#### Proliferation of open source business models and investment + +* More diverse business models are emerging that promise to deliver more value to open source companies than ever before. They are not as dependent on SaaS and services/support. +* Open source private financing has increased almost 4x in five years. + +#### Security and management + +The development of best-in-class open source security and management practices has not kept pace with growth in adoption. Despite a proliferation of expensive, high-profile open source breaches in recent years, the survey revealed that: + +* 50% of companies have no formal policy for selecting and approving open source code. +* 47% of companies don’t have formal processes in place to track open source code, limiting their visibility into their open source and therefore their ability to control it. +* More than one-third of companies have no process for identifying, tracking or remediating known open source vulnerabilities. + +#### Open source participation on the rise + +The survey revealed an active corporate open source community that spurs innovation, delivers exponential value and shares camaraderie: + +* 67% of respondents report actively encouraging developers to engage in and contribute to open source projects. +* 65% of companies are contributing to open source projects. +* One in three companies have a fulltime resource dedicated to open source projects. +* 59% of respondents participate in open source projects to gain competitive edge. + +Black Duck and North Bridge learned a great deal this year about security, policy, business models and more from the survey, and we’re excited to share these findings. Thank you to our many collaborators and all the respondents for taking the time to take the survey. It’s been a great ten years, and I am happy that we can safely say that the future of open source is full of possibilities. + +Learn more, see the [full results][3]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/business/16/5/2016-future-open-source-survey + +作者:[Haidee LeClair][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +[a]: https://opensource.com/users/blackduck2016 +[1]: http://www.slideshare.net/blackducksoftware/2016-future-of-open-source-survey-results +[2]: https://info.blackducksoftware.com/OpenSourceRookies2015.html +[3]: http://www.slideshare.net/blackducksoftware/2016-future-of-open-source-survey-results%C2%A0 From 105a8d226cc76d137ab4d5ab26606b7be19f0957 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 15 May 2016 12:58:32 +0800 Subject: [PATCH 0755/1469] =?UTF-8?q?20160515-8=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...160316 Growing a career alongside Linux.md | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 sources/talk/my-open-source-story/20160316 Growing a career alongside Linux.md diff --git a/sources/talk/my-open-source-story/20160316 Growing a career alongside Linux.md b/sources/talk/my-open-source-story/20160316 Growing a career alongside Linux.md new file mode 100644 index 0000000000..24799508c3 --- /dev/null +++ b/sources/talk/my-open-source-story/20160316 Growing a career alongside Linux.md @@ -0,0 +1,49 @@ +Growing a career alongside Linux +================================== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/OPENHERE_blue.png?itok=3eqp-7gT) + +My Linux story started in 1998 and continues today. Back then, I worked for The Gap managing thousands of desktops running [OS/2][1] (and a few years later, [Warp 3.0][2]). As an OS/2 guy, I was really happy then. The desktops hummed along and it was quite easy to support thousands of users with the tools the GAP had built. Changes were coming, though. + +In November of 1998, I received an invitation to join a brand new startup which would focus on Linux in the enterprise. This startup became quite famous as [Linuxcare][2]. + +### My time at Linuxcare + +I had played with Linux a bit, but had never considered delivering it to enterprise customers. Mere months later (which is a turn of the corner in startup time and space), I was managing a line of business that let enterprises get their hardware, software, and even books certified on a few flavors of Linux that were popular back then. + +I supported customers like IBM, Dell, and HP in ensuring their hardware ran Linux successfully. You hear a lot now about preloading Linux on hardware today, but way back then I was invited to Dell to discuss getting a laptop certified to run Linux for an upcoming trade show. Very exciting times! We also supported IBM and HP on a number of certification efforts that spanned a few years. + +Linux was changing fast, much like it always has. It gained hardware support for more key devices like sound, network, graphics. At around that time, I shifted from RPM-based systems to [Debian][3] for my personal use. + +### Using Linux through the years + +Fast forward some years and I worked at a number of companies that did Linux as hardened appliances, Linux as custom software, and Linux in the data center. By the mid 2000s, I was busy doing consulting for that rather large software company in Redmond around some analysis and verification of Linux compared to their own solutions. My personal use had not changed though—I would still run Debian testing systems on anything I could. + +I really appreciated the flexibility of a distribution that floated and was forever updated. Debian is one of the most fun and well supported distributions and has the best community I've ever been a part of. + +When I look back at my own adoption of Linux, I remember with fondness the numerous Linux Expo trade shows in San Jose, San Francisco, Boston, and New York in the early and mid 2000's. At Linuxcare we always did fun and funky booths, and walking the show floor always resulted in getting re-acquainted with old friends. Rumors of work were always traded, and the entire thing underscored the fun of using Linux in real endeavors. + +The rise of virtualization and cloud has really made the use of Linux even more interesting. When I was with Linuxcare, we partnered with a small 30-person company in Palo Alto. We would drive to their offices and get things ready for a trade show that they would attend with us. Who would have ever known that little startup would become VMware? + +I have so many stories, and there were so many people I was so fortunate to meet and work with. Linux has evolved in so many ways and has become so important. And even with its increasing importance, Linux is still fun to use. I think its openness and the ability to modify it has contributed to a legion of new users, which always astounds me. + +### Today + +I've moved away from doing mainstream Linux things over the past five years. I manage large scale infrastructure projects that include a variety of OSs (both proprietary and open), but my heart has always been with Linux. + +The constant evolution and fun of using Linux has been a driving force for me for over the past 18 years. I started with the 2.0 Linux kernel and have watched it become what it is now. It's a remarkable thing. An organic thing. A cool thing. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/16/3/my-linux-story-michael-perry + +作者:[Michael Perry][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +[a]: https://opensource.com/users/mpmilestogo +[1]: https://en.wikipedia.org/wiki/OS/2 +[2]: https://archive.org/details/IBMOS2Warp3Collection +[3]: https://en.wikipedia.org/wiki/Linuxcare +[4]: https://www.debian.org/ +[5]: From 4c56beb7781bf87c983463e2cec90200545f66ca Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 15 May 2016 13:03:07 +0800 Subject: [PATCH 0756/1469] =?UTF-8?q?20160515-9=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...omputer virus, sys admin looks to Linux.md | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 sources/talk/my-open-source-story/20160330 After a nasty computer virus, sys admin looks to Linux.md diff --git a/sources/talk/my-open-source-story/20160330 After a nasty computer virus, sys admin looks to Linux.md b/sources/talk/my-open-source-story/20160330 After a nasty computer virus, sys admin looks to Linux.md new file mode 100644 index 0000000000..3fb63afa4f --- /dev/null +++ b/sources/talk/my-open-source-story/20160330 After a nasty computer virus, sys admin looks to Linux.md @@ -0,0 +1,54 @@ +After a nasty computer virus, sys admin looks to Linux +======================================================= + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/OPENHERE_blue.png?itok=3eqp-7gT) + +My first brush with open source came while I was working for my university as a part-time system administrator in 2001. I was part of a small group that created business case studies for teaching not just in the university, but elsewhere in academia. + +As the team grew, the need for a robust LAN setup with file serving, intranet applications, domain logons, etc. emerged. Our IT infrastructure consisted mostly of bootstrapped Windows 98 computers that had become too old for the university's IT labs and were reassigned to our department. + +### Discovering Linux + +One day, as part of the university's IT procurement plan, our department received an IBM server. We planned to use it as an Internet gateway, domain controller, file and backup server, and intranet application host. + +Upon unboxing, we noticed that it came with Red Hat Linux CDs. No one on our 22-person team (including me) knew anything about Linux. After a few days of research, I met a friend of a friend who did Linux RTOS programming for a living. I asked him for some help installing it. + +It was heady stuff as I watched the friend load up the CD drive with the first of the installation CDs and boot into the Anaconda install system. In about an hour we had completed the basic installation, but still had no working internet connection. + +Another hour of tinkering got us connected to the Internet, but we still weren't anywhere near domain logons or Internet gateway functionality. After another weekend of tinkering, we were able to instruct our Windows 98 terminals to accept the IP of the the Linux PC as the proxy so that we had a working shared Internet connection. But domain logons were still some time away. + +We downloaded [Samba][1] over our awfully slow phone modem connection and hand configured it to serve as the domain controller. File services were also enabled via NFS Kernel Server and creating user directories and making the necessary adjustments and configurations on Windows 98 in Network Neighborhood. + +This setup ran flawlessly for quite some time, and we eventually decided to get started with Intranet applications for timesheet management and some other things. By this time, I was leaving the organization and had handed over most of the sys admin stuff to someone who replaced me. + +### A second Linux experience + +In 2004, I got into Linux once again. My wife ran an independent staff placement business that used data from services like Monster.com to connect clients with job seekers. + +Being the more computer literate of the two of us, it was my job to set things right with the computer or Internet when things went wrong. We also needed to experiment with a lot of tools for sifting through the mountains of resumes and CVs she had to go through on a daily basis. + +Windows [BSoDs][2] were a routine affair, but that was tolerable as long as the data we paid for was safe. I had to spend a few hours each week creating backups. + +One day, we had a virus that simply would not go away. Little did we know what was happening to the data on the slave disk. When it finally failed, we plugged in the week-old slave backup and it failed a week later. Our second backup simply refused to boot up. It was time for professional help, so we took our PC to a reputable repair shop. After two days, we learned that some malware or virus had wiped certain file types, including our paid data, clean. + +This was a body blow to my wife's business plans and meant lost contracts and delayed invoice payments. I had in the interim travelled abroad on business and purchased my first laptop computer from [Computex 2004][3] in Taiwan. It had Windows XP pre-installed, but I wanted to replace it with Linux. I had read that Linux was ready for the desktop and that [Mandrake Linux][4] was a good choice. My first attempt at installation went without a glitch. Everything worked beautifully. I used [OpenOffice][5] for my writing, presentation, and spreadsheet needs. + +We got new hard drives for our computer and installed Mandrake Linux on them. OpenOffice replaced Microsoft Office. We relied on webmail for mailing needs, and [Mozilla Firefox][6] was a welcome change in November 2004. My wife saw the benefits immediately, as there were no crashes or virus/malware infections. More importantly, we bade goodbye to the frequent crashes that plagued Windows 98 and XP. She continued to use the same distribution. + +I, on the other hand, started playing around with other distributions. I love distro-hopping and trying out new ones every once in a while. I also regularly try and test out web applications like Drupal, Joomla, and WordPress on Apache and NGINX stacks. And now our son, who was born in 2006, grew up on Linux. He's very happy with Tux Paint, Gcompris, and SMPlayer. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/16/3/my-linux-story-soumya-sarkar + +作者:[Soumya Sarkar][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +[a]: https://opensource.com/users/ssarkarhyd +[1]: https://www.samba.org/ +[2]: https://en.wikipedia.org/wiki/Blue_Screen_of_Death +[3]: https://en.wikipedia.org/wiki/Computex_Taipei +[4]: https://en.wikipedia.org/wiki/Mandriva_Linux +[5]: http://www.openoffice.org/ +[6]: https://www.mozilla.org/en-US/firefox/new/ From ca948618682a6b9ad1f11b47d23d9c242cb260f5 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 15 May 2016 13:11:03 +0800 Subject: [PATCH 0757/1469] =?UTF-8?q?20160515-10=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...301 Linux gives me all the tools I need.md | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 sources/talk/my-open-source-story/20160301 Linux gives me all the tools I need.md diff --git a/sources/talk/my-open-source-story/20160301 Linux gives me all the tools I need.md b/sources/talk/my-open-source-story/20160301 Linux gives me all the tools I need.md new file mode 100644 index 0000000000..b1689f4164 --- /dev/null +++ b/sources/talk/my-open-source-story/20160301 Linux gives me all the tools I need.md @@ -0,0 +1,56 @@ +Linux gives me all the tools I need +========================================== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/OPENHERE_blue.png?itok=3eqp-7gT) + +[Linux][0] is all around us. It's [on our phones][1] in the form of Android. It's [used on the International Space Station][2]. It [provides much of the backbone of the Internet][3]. And yet many people never notice it. Discovering Linux is a rewarding endeavor. Lots of other people have [shared their Linux stories][4] on Opensource.com, and now it's my turn. + +I still remember when I first discovered Linux in 2008. The person who helped me discover Linux was my father, Socrates Ballais. He was an economics professor here in Tacloban City, Philippines. He was also a technology enthusiast. He taught me a lot about computers and technology, but only advocated using Linux as a fallback operating system in case Windows fails. + +### My earliest days + +Before we had a computer in the home, I was a Windows user. I played games, created documents, and did all the other things kids do with computers. I didn't know what Linux was or what it was used for. The Windows logo was my symbol for a computer. + +When we got our first computer, my father installed Linux ([Ubuntu][5] 8.04) on it. Being the curious kid I was, I booted into the operating system. I was astonished with the interface. It was beautiful. I found it to be very user friendly. For some time, all I did in Ubuntu was play the bundled games. I would do my school work in Windows. + +### The first install + +Four years later, I decided that I would reinstall Windows on our family computer. Without hesitation, I also decided to install Ubuntu. With that, I had fallen in love with Linux (again). Over time, I became more adept with Ubuntu and would casually advocate its use to my friends. When I got my first laptop, I installed it right away. + +### Today + +Today, Linux is my go-to operating system. When I need to do something on a computer, I do it in Linux. For documents and presentations, I use Microsoft Office via [Wine][6]. For my web needs, there's [Chrome and Firefox][7]. For email, there's [Geary][8]. You can do pretty much everything with Linux. + +Most, if not all, of my programming work is done in Linux. The lack of a standard Integrated Development Environment (IDE) like [Visual Studio][9] or [XCode][10] taught me to be flexible and learn more things as a programmer. Now a text editor and a compiler/interpreter are all I need to start coding. I only use an IDE in cases when it's the best tool for accomplishing a task at hand. I find Linux to be more developer-friendly than Windows. To generalize, Linux gives me all the tools I need to develop software. + +Today, I am the co-founder and CTO of a startup called [Creatomiv Studios][11]. I use Linux to develop code for the backend server of our latest project, Basyang. I'm also an amateur photographer, and use [GIMP][12] and [Darktable][13] to edit and manage photos. For communication with my team, I use [Telegram][14]. + +### The beauty of Linux + +Many may see Linux as an operating system only for those who love solving complicated problems and working on the command line. Others may see it as a rubbish operating system lacking the support of many companies. However, I see Linux as a thing of beauty and a tool for creation. I love Linux the way it is and hope to see it continue to grow. + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/16/3/my-linux-story-sean-ballais + +作者:[Sean Francis N. Ballais][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +[a]: https://opensource.com/users/seanballais +[0]: https://opensource.com/resources/what-is-linux +[1]: http://www.howtogeek.com/189036/android-is-based-on-linux-but-what-does-that-mean/ +[2]: http://www.extremetech.com/extreme/155392-international-space-station-switches-from-windows-to-linux-for-improved-reliability +[3]: https://www.youtube.com/watch?v=JzsLkbwi1LA +[4]: https://opensource.com/tags/my-linux-story +[5]: http://ubuntu.com/ +[6]: https://www.winehq.org/ +[7]: https://www.google.com/chrome/browser/desktop/index.html +[8]: https://wiki.gnome.org/Apps/Geary +[9]: https://www.visualstudio.com/en-us/visual-studio-homepage-vs.aspx +[10]: https://developer.apple.com/xcode/ +[11]: https://www.facebook.com/CreatomivStudios/ +[12]: https://www.gimp.org/ +[13]: http://www.darktable.org/ +[14]: https://telegram.org/ From b6029cd4e8d6ad35888b3e48ba478c324d2de18f Mon Sep 17 00:00:00 2001 From: ictlyh Date: Sun, 15 May 2016 17:23:31 +0800 Subject: [PATCH 0758/1469] Translating sources/tech/20160513 How to Set Up 2-Factor Authentication for Login and sudo.md --- ...3 How to Set Up 2-Factor Authentication for Login and sudo.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160513 How to Set Up 2-Factor Authentication for Login and sudo.md b/sources/tech/20160513 How to Set Up 2-Factor Authentication for Login and sudo.md index 81cf285cf0..0a4a6ae0af 100644 --- a/sources/tech/20160513 How to Set Up 2-Factor Authentication for Login and sudo.md +++ b/sources/tech/20160513 How to Set Up 2-Factor Authentication for Login and sudo.md @@ -1,3 +1,4 @@ +ictlyh Translating How to Set Up 2-Factor Authentication for Login and sudo ========================================================== From 6a3836fff4748f87aa84894ba1b8e30ce5de7aae Mon Sep 17 00:00:00 2001 From: ezio Date: Sun, 15 May 2016 17:44:12 +0800 Subject: [PATCH 0759/1469] rename for windows user --- ...orvalds Talks IoT Smart Devices Security Concerns and More.md} | 0 ...0330 After a nasty computer virus sys admin looks to Linux.md} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename sources/talk/{20160506 Linus Torvalds Talks IoT, Smart Devices, Security Concerns, and More.md => 20160506 Linus Torvalds Talks IoT Smart Devices Security Concerns and More.md} (100%) rename sources/talk/my-open-source-story/{20160330 After a nasty computer virus, sys admin looks to Linux.md => 20160330 After a nasty computer virus sys admin looks to Linux.md} (100%) diff --git a/sources/talk/20160506 Linus Torvalds Talks IoT, Smart Devices, Security Concerns, and More.md b/sources/talk/20160506 Linus Torvalds Talks IoT Smart Devices Security Concerns and More.md similarity index 100% rename from sources/talk/20160506 Linus Torvalds Talks IoT, Smart Devices, Security Concerns, and More.md rename to sources/talk/20160506 Linus Torvalds Talks IoT Smart Devices Security Concerns and More.md diff --git a/sources/talk/my-open-source-story/20160330 After a nasty computer virus, sys admin looks to Linux.md b/sources/talk/my-open-source-story/20160330 After a nasty computer virus sys admin looks to Linux.md similarity index 100% rename from sources/talk/my-open-source-story/20160330 After a nasty computer virus, sys admin looks to Linux.md rename to sources/talk/my-open-source-story/20160330 After a nasty computer virus sys admin looks to Linux.md From 8566fa608409bc0c9adc9669058e1e054928d386 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 15 May 2016 18:31:23 +0800 Subject: [PATCH 0760/1469] =?UTF-8?q?=E8=AF=B7=E6=A0=A1=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LXD/Part 2 - LXD 2.0--Installing and configuring LXD.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/translated/tech/LXD/Part 2 - LXD 2.0--Installing and configuring LXD.md b/translated/tech/LXD/Part 2 - LXD 2.0--Installing and configuring LXD.md index 8e405254d3..3464cd07eb 100644 --- a/translated/tech/LXD/Part 2 - LXD 2.0--Installing and configuring LXD.md +++ b/translated/tech/LXD/Part 2 - LXD 2.0--Installing and configuring LXD.md @@ -1,5 +1,3 @@ -translating by ezio - Part 2 - LXD 2.0: 安装与配置 ================================================= From 67793aa8b7ba041be2c54bcf65f7985a1fa19b0b Mon Sep 17 00:00:00 2001 From: ictlyh Date: Sun, 15 May 2016 19:05:24 +0800 Subject: [PATCH 0761/1469] Translated: sources/tech/20160513 How to Set Up 2-Factor Authentication for Login and sudo.md Remove: sources/tech/20160510 On the Rise: Six Unsung Apache Big Data Projects.md --- ...se: Six Unsung Apache Big Data Projects.md | 80 ------------ ...actor Authentication for Login and sudo.md | 117 ------------------ ...actor Authentication for Login and sudo.md | 117 ++++++++++++++++++ 3 files changed, 117 insertions(+), 197 deletions(-) delete mode 100644 sources/tech/20160510 On the Rise: Six Unsung Apache Big Data Projects.md delete mode 100644 sources/tech/20160513 How to Set Up 2-Factor Authentication for Login and sudo.md create mode 100644 translated/tech/20160513 How to Set Up 2-Factor Authentication for Login and sudo.md diff --git a/sources/tech/20160510 On the Rise: Six Unsung Apache Big Data Projects.md b/sources/tech/20160510 On the Rise: Six Unsung Apache Big Data Projects.md deleted file mode 100644 index 76d97b7505..0000000000 --- a/sources/tech/20160510 On the Rise: Six Unsung Apache Big Data Projects.md +++ /dev/null @@ -1,80 +0,0 @@ -On the Rise: Six Unsung Apache Big Data Projects -================================================= - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/star-clusters-74052_1920.jpg?itok=HJISFdwo) ->Creative Commons Zero - -Countless organizations around the world are now working with data sets so large and complex that traditional data processing applications can no longer drive optimized analytics and insights. That’s the problem that the new wave of Big Data applications aims to solve, and the Apache Software Foundation (ASF) has recently graduated a slew of interesting open source Big Data projects to Top-Level status. That means that they will get active development and strong community support. - -Most people have heard of Apache Spark, [a Big Data processing framework][1] with built-in modules for streaming, SQL, machine learning and graph processing. IBM and other companies are pouring billions of development dollars into Spark initiatives, and NASA and the [SETI Institute][2] are collaborating to analyze terabytes of complex deep space radio signals using Spark’s machine learning capabilities in a hunt for patterns that might betray the presence of intelligent extraterrestrial life. - -![](https://www.linux.com/sites/lcom/files/styles/floated_images/public/asf.jpg?itok=wtu0hq36) - -However, several other recently elevated Apache Big Data projects deserve attention, too. In fact, some of them may produce ecosystems of activity and development that will rival Spark’s. In conjunction with this week’s [ApacheCon North America conference][3] and Apache: Big Data events, this article will round up the Apache Big Data projects that you should know about. - -Here are six projects on the rise: - -### Kylin - -Apache recently [announced][4] that its Kylin project, an open source Big Data project born at eBay, has graduated to Top-Level status. Kylin is an open source Distributed Analytics Engine designed to provide an SQL interface and multi-dimensional analysis (OLAP) on Apache Hadoop, supporting extremely large datasets. It is still widely used at eBay and at a few other organizations. - -"Apache Kylin's incubation journey has demonstrated the value of Open Source governance at ASF and the power of building an open-source community and ecosystem around the project," said Luke Han, Vice President of Apache Kylin. "Our community is engaging the world's biggest local developer community in alignment with the Apache Way." - -As an OLAP-on-Hadoop solution, Apache Kylin aims to fill the gap between Big Data exploration and human use, "enabling interactive analysis on massive datasets with sub-second latency for analysts, end users, developers, and data enthusiasts," according to developers. "Apache Kylin brings back business intelligence (BI) to Apache Hadoop to unleash the value of Big Data," they added. - -### Lens - -Apache also recently [announced][5] that Apache Lens, an open source Big Data and analytics tool, has graduated from the Apache Incubator to become a Top-Level Project (TLP). According to the announcement: "Apache Lens is a Unified Analytics platform. It provides an optimal execution environment for analytical queries in the unified view. Apache Lens aims to cut the Data Analytics silos by providing a single view of data across multiple tiered data stores." - -"By providing an online analytical processing (OLAP) model on top of data, Lens seamlessly integrates Apache Hadoop with traditional data warehouses to appear as one. It also provides query history and statistics for queries running in the system along with query life cycle management." - -"Incubating Apache Lens has been an amazing experience at the ASF," said Amareshwari Sriramadasu, Vice President of Apache Lens. "Apache Lens solves a very critical problem in Big Data analytics space with respect to end users. It enables business users, analysts, data scientists, developers and other users to do complex analysis with ease, without knowing the underlying data layout." - -### Ignite - -The ASF has also [announced][6] that Apache Ignite has become a top-level project. It's an open source effort to build an in-memory data fabric. - -“Apache Ignite is a high-performance, integrated and distributed In-Memory Data Fabric for computing and transacting on large-scale data sets in real-time, "orders of magnitude faster than possible with traditional disk-based or flash technologies," according to Apache community members. “It is designed to easily power both existing and new applications in a distributed, massively parallel architecture on affordable, industry-standard hardware.” - -### Brooklyn - -The foundation [announced][7] that Apache Brooklyn is now a Top-Level Project (TLP), "signifying that the project's community and products have been well-governed under the ASF's meritocratic process and principles." Brooklyn is an application blueprint and management platform used for integrating services across multiple data centers as well as and a wide range of software in the cloud. - -According to the Brooklyn announcement: "With modern applications being composed of many components, and increasing interest in micro-services architecture, the deployment and ongoing evolution of deployed apps is an increasingly difficult problem. Apache Brooklyn’s blueprints provide a clear, concise way to model an application, its components and their configuration, and the relationships between components, before deploying to public Cloud or private infrastructure. Policy-based management, built on the foundation of autonomic computing theory, continually evaluates the running application and makes modifications to it to keep it healthy and optimize for metrics such as cost and responsiveness." - -Brooklyn is in use at some notable organizations. Cloud service providers Canopy and Virtustream have created product offerings built on Brooklyn. IBM has also made extensive use of Apache Brooklyn in order to migrate large workloads from AWS to IBM Softlayer. - -### Apex - -In April, the Apache Software Foundation [elevated][8] its Apex project to Top-Level status. It is billed as “a large scale, high throughput, low latency, fault tolerant, unified Big Data stream and batch processing platform for the Apache Hadoop ecosystem.” Apex works in conjunction with Apache Hadoop YARN, a resource management platform for working with Hadoop clusters. - -### Tajo - -Finally, Apache Tajo, an advanced open source data warehousing system in Apache Hadoop, is another new Big Data project to know about. Apache claims that Tajo provides the ability to rapidly extract more intelligence for Hadoop deployments, third party databases, and commercial business intelligence tools. - -Clearly, although Apache Spark draws the bulk of the headlines, it is not the only Big Data tool from Apache to keep your eyes on. As this year continues, Apache likely will graduate even more compelling Big Data projects to Top-Level status, where they will benefit from optimized development resources and more. - - --------------------------------------------------------------------------------- - -via: https://www.linux.com/news/enterprise/systems-management/887177-achieving-enterprise-ready-container-tools-with-werckers-open-source-cli - -作者:[SAM DEAN][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.linux.com/users/sam-dean -[1]: https://www.linux.com/news/apache-spark-16-strong-typing-faster-throughput -[2]: http://www.seti.org/ -[3]: http://events.linuxfoundation.org/events/apachecon-north-america -[4]: http://globenewswire.com/news-release/2015/12/08/793713/0/en/The-Apache-Software-Foundation-Announces-Apache-Kylin-as-a-Top-Level-Project.html -[5]: http://globenewswire.com/news-release/2015/08/26/763513/10147133/en/The-Apache-Software-Foundation-Announces-Apache-tm-Lens-tm-as-a-Top-Level-Project.html -[6]: http://globenewswire.com/news-release/2015/08/25/763148/10146997/en/The-Apache-Software-Foundation-Announces-Apache-tm-Ignite-tm-as-a-Top-Level-Project.html -[7]: http://globenewswire.com/news-release/2015/11/23/789504/0/en/The-Apache-Software-Foundation-Announces-Apache-Brooklyn-as-a-Top-Level-Project.html -[8]: https://globenewswire.com/news-release/2016/04/25/832114/0/en/The-Apache-Software-Foundation-Announces-Apache-Apex-as-a-Top-Level-Project.html - - - - diff --git a/sources/tech/20160513 How to Set Up 2-Factor Authentication for Login and sudo.md b/sources/tech/20160513 How to Set Up 2-Factor Authentication for Login and sudo.md deleted file mode 100644 index 0a4a6ae0af..0000000000 --- a/sources/tech/20160513 How to Set Up 2-Factor Authentication for Login and sudo.md +++ /dev/null @@ -1,117 +0,0 @@ -ictlyh Translating -How to Set Up 2-Factor Authentication for Login and sudo -========================================================== - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/auth_crop.png?itok=z_cdYZZf) ->[Used with permission][1] - -Security is all the rage—as it should be. We live in a world where data is an incredibly valuable currency, and you’re always at risk of loss. Because of this, you must do everything you can to ensure what you hold on your desktops and servers is safe. To that end, administrators and users will create incredibly complex passwords, employ password managers, and more. But, what if I told you could take the login to your Linux servers and desktops one step—nay, two steps—further? Thanks to the [Google Authenticator][2], you can. On top of that, it’s incredibly easy to set up. - -I am going to walk you through the process of setting up two-factor authentication for use on login and sudo. I will demonstrate this on a Ubuntu 16.04 desktop, but the process works for the server as well. To handle the two-factor side of things, I will be making use of the Google Authenticator. - -There is one very important caveat to this: Once you’ve set this up, you will not be able to log into the account (or issue sudo commands) without a six-digit code from the authenticator. This also adds another step for you, so if having to pull out your smartphone every time you need to log into your Linux machine (or use sudo), this might not be for you. Remember, however, this added step brings with it an extra layer of security you wouldn’t have otherwise. - -With that said, let’s set this up. - -### Installing the Necessary Components - -There are two pieces of this puzzle that must be installed—both in the form of the Google Authenticator. The first is the smartphone app. Here’s how to install from the Google Play Store: - -1. Open the Google Play Store on your Android device - -2. Search for google authenticator - -3. Locate and tap the entry by Google Inc. - -4. Tap Install - -5. Tap Accept - -6. Allow the installation to complete - -Now let’s move on to installing the authenticator on your Linux machine. Here’s how: - -1. Open a terminal window - -2. Issue the command sudo apt-get install google-authenticator - -3. Type your sudo password and hit Enter - -4. If prompted, type y and hit Enter - -5. Allow the installation to complete - -It’s now time to configure the login process to work with the google-authenticator. - -### Configuration - -Just one file must be edited to add two-step authentication for both login and sudo usage. The file is /etc/pam.d/common-auth. Open it and look for the line: - -``` -auth [success=1 default=ignore] pam_unix.so nullok_secure -``` - -Above that line, add the following: - -``` -auth required pam_google_authenticator.so -``` - -Save and close the file. - -The next step is to set up google-authenticator for every user on the system (otherwise, they will not be able to log in). For example’s sake, we’ll assume there are two users on your system: jack and olivia. We’ll first set this up for jack (we’ll assume this is the account we’ve been working with all along). - -Open up a terminal window and issue the command google-authenticator. You will be asked a series of questions (each of which you should answer with a y. The questions are: - -* Do you want me to update your "/home/jlwallen/.google_authenticator" file (y/n) y - -* Do you want to disallow multiple uses of the same authentication token? This restricts you to one login about every 30s, but it increases your chances to notice or even prevent man-in-the-middle attacks (y/n) - -* By default, tokens are good for 30 seconds, and to compensate for possible time-skew between the client and the server, we allow an extra token before and after the current time. If you experience problems with poor time synchronization, you can increase the window from its default size of 1:30min to about 4min. Do you want to do so (y/n) - -* If the computer that you are logging into isn't hardened against brute-force login attempts, you can enable rate-limiting for the authentication module. By default, this limits attackers to no more than 3 login attempts every 30s. Do you want to enable rate-limiting (y/n) - -Once you’ve answered these questions, you’ll be presented with your secret key, a verification code, and five emergency scratch codes. Print out the scratch codes and keep them with you. These codes can be used if you do not have your phone (each code is a one-time use only). The secret key is what you use to set up the account on the Google Authenticator app and the verification code is a one-time use code that you can use immediately (if needed). - -### Setting Up the App - -You now have the user jack set up. Before you can set up the user olivia, you need to add an account for jack on the Google Authenticator app. Open the app and the, from the main window, tap the menu button (three vertical dots in the upper right hand corner). Tap Set up account and then tap Enter provided key. In the next window (Figure 1), you will enter 16-digit secret key provided when you issued the google-authenticator app. Give the account a name (so you will remember which account this is to be used on) and tap ADD. - -![](https://www.linux.com/sites/lcom/files/styles/floated_images/public/auth_a.png?itok=xSMkd-Mf) ->Figure 1: Adding a new account to the Google Authenticator app. - -Now that you’ve added the account, you will be presented with six-digit keys that will be requested every time you log in or attempt to use sudo. - -Finally, you have to set up the other accounts on the system. As I mentioned, we’re going to set up the account called olivia. Here’s how: - -1. Open up a terminal window - -2. Issue the command sudo su olivia - -3. Open the Google Authenticator on your smartphone - -4. Type the six digit authentication code (provided by the app) in the terminal window (Figure 2) and hit Enter - -5. Type your sudo password and hit Enter - -6. As the new user, issue the google-authenticator command, answer the questions, and record the keys and codes provided - -After you’ve successfully set up the user olivia, with the google-authenticator command, add a new account on the Google Authenticator app with that user’s info (in the same manner you did for the initial user). You should now have accounts on the Google Authenticator app for both jack and olivia. - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/auth_b.png?itok=FH36V1r0) ->Figure 2: Entering the six-digit authentication code for sudo. - -That’s it. Every time you attempt to log into your machine (or use sudo), you will be required to provide a six-digit authentication key, before you can enter your user password. Your Linux machine is now far more secure than it was before adding two-factor authentication. Although some might consider this process a hassle, I highly recommend setting it up...especially for machines that house sensitive data. - --------------------------------------------------------------------------------- - -via: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/auth_b.png?itok=FH36V1r0 - -作者:[JACK WALLEN][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -[a]: https://www.linux.com/users/jlwallen -[1]: https://www.linux.com/licenses/category/used-permission -[2]: https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2 - diff --git a/translated/tech/20160513 How to Set Up 2-Factor Authentication for Login and sudo.md b/translated/tech/20160513 How to Set Up 2-Factor Authentication for Login and sudo.md new file mode 100644 index 0000000000..1ed524c4d4 --- /dev/null +++ b/translated/tech/20160513 How to Set Up 2-Factor Authentication for Login and sudo.md @@ -0,0 +1,117 @@ +如何为登录和 sudo 设置双重认证 +========================================================== + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/auth_crop.png?itok=z_cdYZZf) +>[Used with permission][1] + +安全就是一切。我们生活的当今世界,数据具有令人难以置信的价值,而你也一直处于数据丢失的风险之中。因此,你必须想尽办法保证你桌面系统和服务器中东西的安全。结果,管理员和用户就会创建极其复杂的密码、使用密码管理器甚至其它更复杂的东西。但是,如果我告诉你你可以只需要一步-至多两步就能登录到你的 Linux 服务器或桌面系统中呢?多亏了 [Google Authenticator][2],现在你可以做到了。在这之上配置也极其简单。 + +我会给你简要介绍为登录和 sudo 设值双重认证的步骤。我基于 Ubuntu 16.04 桌面系统进行介绍,但这些步骤也适用于其它服务器。为了做到双重认证,我会使用 Google Authenticator。 + +这里有个非常重要的警告:一旦你设置了认证,没有一个从认证器中获得的由 6 个数字组成的验证码你就不可能登录账户(或者执行 sudo 命令)。这也给你增加了一步额外的操作,因此如果你不想每次登录到 Linux 服务器(或者使用 sudo)的时候都要拿出你的智能手机,这个方案就不适合你。但你也要记住,这额外的一个步骤也给你带来一层其它方法无法给予的保护。 + +话不多说,开始吧。 + +### 安装必要的组件 + +安装 Google 认证,首先要解决两个问题。一是安装智能机应用。下面是如何从 Google 应用商店安装的方法: + +1. 在你的安卓设备中打开 Google 应用商店 + +2. 搜索 google 认证 + +3. 找到并点击有 Google 标识的应用 + +4. 点击安装 + +5. 点击 接受 + +6. 等待安装完成 + +接下来,我们继续在你的 Linux 机器上安装认证。步骤如下: + +1. 打开一个终端窗口 + +2. 输入命令 sudo apt-get install google-authenticator + +3. 输入你的 sudo 密码并敲击回车 + +4. 如果有弹窗提示,输入 y 并敲击回车 + +5. 等待安装完成 + +接下来配置使用 google-authenticator 进行登录。 + +### 配置 + +要为登录和 sudo 添加两阶段认证只需要编辑一个文件。也就是 /etc/pam.d/common-auth。打开并找到如下一行: +Just one file must be edited to add two-step authentication for both login and sudo usage. The file is /etc/pam.d/common-auth. Open it and look for the line + +``` +auth [success=1 default=ignore] pam_unix.so nullok_secure +``` + +在这行上面添加: + +``` +auth required pam_google_authenticator.so +``` + +保存并关闭文件。 + +下一步就是为系统中的每个用户设置 google-authenticator(否则会不允许他们登录)。为了简单起见,我们假设你的系统中有两个用户:jack 和 olivia。首先为 jack 设置(我们假设这是我们一直使用的账户)。 + +打开一个终端窗口并输入命令 google-authenticator。之后会问你一系列的问题(每个问题你都应该用 y 回答)。问题包括: + +* 是否允许更新你的 "/home/jlwallen/.google_authenticator" 文件 (y/n) y + +* 是否禁止多个用户使用同一个认证令牌?这会限制你每 30 秒内只能登录一次,但能增加你注意到甚至防止中间人攻击的可能 (y/n) + +* 默认情况下令牌时长为 30 秒即可,为了补偿客户端和服务器之间可能出现的时间偏差,我们允许添加一个当前时间之前或之后的令牌。如果你无法进行时间同步,你可以把时间窗口由默认的 1:30 分钟增加到 4 分钟。是否希望如此 (y/n) + +* 如果你尝试登陆的计算机没有针对蛮力登陆进行加固,你可以为验证模块启用速率限制。默认情况下,限制攻击者每 30 秒不能尝试登陆超过 3 次。是否启用速率限制 (y/n) + +一旦完成了问题回答,你就会看到你的密钥、验证码以及 5 个紧急刮码。把刮码输出保存起来。你可以在无法使用手机的时候使用它们(每个刮码仅限使用一次)。密钥用于你在 Google Authenticator 上设置账户,验证码是你能立即使用(如果需要)的一次性验证码。 + +### 设置应用 + +现在你已经配置好了用户 jack。在设置用户 olivia 之前,你需要在 Google Authenticator 应用上为 jack 添加账户。在主屏幕上打开应用,点击 菜单 按钮(右上角三个竖排点)。点击添加账户然后输入提供的密钥。在下一个窗口(示意图1),你需要输入你运行 google-authenticator 应用时提供的 16 个数字的密钥。给账户取个名字(以便你记住这用于哪个账户),然后点击添加。 + +![](https://www.linux.com/sites/lcom/files/styles/floated_images/public/auth_a.png?itok=xSMkd-Mf) +>Figure 1: 在 Google Authenticator 应用上新建账户 + +添加完账户之后,你就会看到一个 6 个数字的密码,你每次登录或者使用 sudo 的时候都会需要这个密码。 + +最后,在系统上设置其它账户。正如之前提到的,我们会设置一个叫 olivia 的账户。步骤如下: + +1. 打开一个终端窗口 + +2. 输入命令 sudo su olivia + +3. 在智能机上打开 Google Authenticator + +4. 在终端窗口(示意图2)中输入(应用提供的) 6 位数字验证码并敲击回车 + +5. 输入你的 sudo 密码并敲击回车 + +6. 以新用户输入命令 google-authenticator,回答问题并记录生成的密钥和验证码。 + +成功为 olivia 用户设置好之后,用 google-authenticator 命令,在 Google Authenticator 应用上根据用户信息(和之前为第一个用户添加账户相同)添加一个新的账户。现在你在 Google Authenticator 应用上就会有 jack 和 olivia 两个账户了。 + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/auth_b.png?itok=FH36V1r0) +>Figure 2: 为 sudo 输入 6位数字验证码 + +好了,就是这些。每次你尝试登陆系统(或者使用 sudo) 的时候,在你输入用户密码之前,都会要求你输入提供的 6 位数字验证码。现在你的 Linux 机器就比添加双重认证之前安全多了。虽然有些人会认为这非常麻烦,我仍然推荐使用,尤其是那些保存了敏感数据的机器。 + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/auth_b.png?itok=FH36V1r0 + +作者:[JACK WALLEN][a] +译者:[ictlyh](http://mutouxiaogui.cn/blog/) +校对:[校对者ID](https://github.com/校对者ID) + +[a]: https://www.linux.com/users/jlwallen +[1]: https://www.linux.com/licenses/category/used-permission +[2]: https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2 + From 70463eae9605135a8a53c31c9e8140391d1342a0 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 15 May 2016 20:57:07 +0800 Subject: [PATCH 0762/1469] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rce Linux Distributions Would Presidential Hopefuls Run.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/published/20150820 Which Open Source Linux Distributions Would Presidential Hopefuls Run.md b/published/20150820 Which Open Source Linux Distributions Would Presidential Hopefuls Run.md index 87c91930b3..22b7c1e498 100644 --- a/published/20150820 Which Open Source Linux Distributions Would Presidential Hopefuls Run.md +++ b/published/20150820 Which Open Source Linux Distributions Would Presidential Hopefuls Run.md @@ -17,11 +17,11 @@ 如果 **Jeb (Jeb!?) Bush** 使用 Linux,它一定是 [Debian][2]。Debian 属于一个相当无趣的分支,它是为真正意义上的、成熟的黑客设计的,这些人将清理那些由经验不甚丰富的开源爱好者所造成的混乱视为一大使命。当然,这也使得 Debian 显得很枯燥,所以它已有的用户基数一直在缩减。 -**Scott Walker** ,对于他来说,应该是一个 [Damn Small Linux][3] (DSL) 用户。这个系统仅仅需要 50MB 的硬盘空间和 16MB 的 RAM 便可运行。DSL 可以使一台 20 年前的 486 计算机焕发新春,而这恰好符合了 **Scott Walker** 所主张的消减成本计划。当然,你在 DSL 上的用户体验也十分原始,这个系统平台只能够运行一个浏览器。但是至少你你不用浪费钱财购买新的电脑硬件,你那台 1993 年购买的机器仍然可以为你好好的工作。 +**Scott Walker** ,对于他来说,应该是一个 [Damn Small Linux][3] (DSL) 用户。这个系统仅仅需要 50MB 的硬盘空间和 16MB 的 RAM 便可运行。DSL 可以使一台 20 年前的 486 计算机焕发新春,而这恰好符合了 **Scott Walker** 所主张的消减成本计划。当然,你在 DSL 上的用户体验也十分原始,这个系统平台只能够运行一个浏览器。但是至少你不用浪费钱财购买新的电脑硬件,你那台 1993 年购买的机器仍然可以为你好好的工作。 **Chris Christie** 会使用哪种系统呢?他肯定会使用 [Relax-and-Recover Linux][4],它号称“一次搞定(Setup-and-forget)的裸机 Linux 灾难恢复方案” 。从那次不幸的华盛顿大桥事故后,“一次搞定(Setup-and-forget)”基本上便成了 Christie 的政治主张。不管灾难恢复是否能够让 Christie 最终挽回一切,但是当他的电脑死机的时候,至少可以找到一两封意外丢失的机密邮件。 -至于 **Carly Fiorina**,她无疑将要使用 [惠普][6] (HPQ)为“[The Machine][5]”开发的操作系统,她在 1999 年到 2005 年这 6 年期间管理的这个公司。事实上,The Machine 可以运行几种不同的操作系统,也许是基于 Linux 的,也许不是,我们并不太清楚,它的开发始于 **Carly Fiorina** 在惠普公司的任期结束后。不管怎么说,作为 IT 圈里一个成功的管理者,这是她履历里面重要的组成部分,同时这也意味着她很难与惠普彻底断绝关系。 +至于 **Carly Fiorina**,她无疑将要使用 [惠普][6] (HPQ)为“[The Machine][5]”开发的操作系统,她在 1999 年到 2005 年这 6 年期间管理该公司。事实上,The Machine 可以运行几种不同的操作系统,也许是基于 Linux 的,也许不是,我们并不太清楚,它的开发始于 **Carly Fiorina** 在惠普公司的任期结束后。不管怎么说,作为 IT 圈里一个成功的管理者,这是她履历里面重要的组成部分,同时这也意味着她很难与惠普彻底断绝关系。 最后,但并不是不重要,你也猜到了——**Donald Trump**。他显然会动用数百万美元去雇佣一个精英黑客团队去定制属于自己的操作系统——尽管他原本是想要免费获得一个完美的、现成的操作系统——然后还能向别人炫耀自己的财力。他可能会吹嘘自己的操作系统是目前最好的系统,虽然它可能没有兼容 POSIX 或者一些其它的标准,因为那样的话就需要花掉更多的钱。同时这个系统也将根本不会提供任何文档,因为如果 **Donald Trump** 向人们解释他的系统的实际运行方式,他会冒着所有机密被泄露至伊斯兰国家的风险,绝对是这样的。 From ea571e68dded4515c6ee05cf7a16519c2e144a24 Mon Sep 17 00:00:00 2001 From: kyle Date: Sun, 15 May 2016 20:59:14 +0800 Subject: [PATCH 0763/1469] translated --- index.html.1 | 356 +++++++++++ ...t 3 - LXD 2.0--Your first LXD container.md | 561 ------------------ test | 11 + ...t 3 - LXD 2.0--Your first LXD container.md | 438 ++++++++++++++ 4 files changed, 805 insertions(+), 561 deletions(-) create mode 100644 index.html.1 delete mode 100644 sources/tech/LXD/Part 3 - LXD 2.0--Your first LXD container.md create mode 100644 test create mode 100644 translated/tech/LXD/Part 3 - LXD 2.0--Your first LXD container.md diff --git a/index.html.1 b/index.html.1 new file mode 100644 index 0000000000..3188a12288 --- /dev/null +++ b/index.html.1 @@ -0,0 +1,356 @@ + + + + + + + + + + + + + + + + + + + + + + + + How people build software · GitHub + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Skip to content + + + + + + + + + + + + +
+ +
+
+ + +
+ +
+
+
+
+

How people build software

+

Millions of developers use GitHub to build personal projects, support their businesses, and work together on open source technologies.

+
+ +
+
+
+ +
+
+

Welcome home, developers

+

GitHub fosters a fast, flexible, and collaborative development process that lets you work on your own or with others.

+
+
+
+
+ +

For everything you build

+

Host and manage your code on GitHub. You can keep your work private or share it with the world.

+
+
+ +

A better way to work

+

From hobbyists to professionals, GitHub helps developers simplify the way they build software.

+
+
+ +

Millions of projects

+

GitHub is home to millions of open source projects. Try one out or get inspired to create your own.

+
+
+ +

One platform, from start to finish

+

With hundreds of integrations, GitHub is flexible enough to be at the center of your development process.

+
+
+
+
+ +
+
+

Who uses GitHub?

+
+
+ + + +
+
+
+ +
+ NASA is on GitHub +
+
+
+
+ +
+
+
+ +
+ Public projects are always free. Private plans start at $7/month. +
+
+
+
+ + + +
+ + + + + + + + + +
+ + + Something went wrong with that request. Please try again. +
+ + + + + + + + + + + + + + + diff --git a/sources/tech/LXD/Part 3 - LXD 2.0--Your first LXD container.md b/sources/tech/LXD/Part 3 - LXD 2.0--Your first LXD container.md deleted file mode 100644 index 1da7e4ec62..0000000000 --- a/sources/tech/LXD/Part 3 - LXD 2.0--Your first LXD container.md +++ /dev/null @@ -1,561 +0,0 @@ -kylepeng93 is translating -Part 3 - LXD 2.0: Your first LXD container -========================================== - -This is the third blog post [in this series about LXD 2.0][0]. - -As there are a lot of commands involved with managing LXD containers, this post is rather long. If you’d instead prefer a quick step-by-step tour of those same commands, you can [try our online demo instead][1]! - -![](https://linuxcontainers.org/static/img/containers.png) - -### Creating and starting a new container - -As I mentioned in the previous posts, the LXD command line client comes pre-configured with a few image sources. Ubuntu is the best covered with official images for all its releases and architectures but there also are a number of unofficial images for other distributions. Those are community generated and maintained by LXC upstream contributors. - -### Ubuntu - -If all you want is the best supported release of Ubuntu, all you have to do is: - -``` -lxc launch ubuntu: -``` - -Note however that the meaning of this will change as new Ubuntu LTS releases are released. So for scripting use, you should stick to mentioning the actual release you want (see below). - -### Ubuntu 14.04 LTS - -To get the latest, tested, stable image of Ubuntu 14.04 LTS, you can simply run: - -``` -lxc launch ubuntu:14.04 -``` - -In this mode, a random container name will be picked. -If you prefer to specify your own name, you may instead do: - -``` -lxc launch ubuntu:14.04 c1 -``` - -Should you want a specific (non-primary) architecture, say a 32bit Intel image, you can do: - -``` -lxc launch ubuntu:14.04/i386 c2 -``` - -### Current Ubuntu development release - -The “ubuntu:” remote used above only provides official, tested images for Ubuntu. If you instead want untested daily builds, as is appropriate for the development release, you’ll want to use the “ubuntu-daily:” remote instead. - -``` -lxc launch ubuntu-daily:devel c3 -``` - -In this example, whatever the latest Ubuntu development release is will automatically be picked. - -You can also be explicit, for example by using the code name: - -``` -lxc launch ubuntu-daily:xenial c4 -``` - -### Latest Alpine Linux - -Alpine images are available on the “images:” remote and can be launched with: - -``` -lxc launch images:alpine/3.3/amd64 c5 -``` - -### And many more - -A full list of the Ubuntu images can be obtained with: - -``` -lxc image list ubuntu: -lxc image list ubuntu-daily: -``` - -And of all the unofficial images: - -``` -lxc image list images: -``` - -A list of all the aliases (friendly names) available on a given remote can also be obtained with (for the “ubuntu:” remote): - -``` -lxc image alias list ubuntu: -``` - -### Creating a container without starting it - -If you want to just create a container or a batch of container but not also start them immediately, you can just replace “lxc launch” by “lxc init”. All the options are identical, the only different is that it will not start the container for you after creation. - -``` -lxc init ubuntu: -``` - -### Information about your containers - -#### Listing the containers - -To list all your containers, you can do: - -``` -lxc list -``` - -There are a number of options you can pass to change what columns are displayed. On systems with a lot of containers, the default columns can be a bit slow (due to having to retrieve network information from the containers), you may instead want: - -``` -lxc list --fast -``` - -Which shows a different set of columns that require less processing on the server side. - -You can also filter based on name or properties: - -``` -stgraber@dakara:~$ lxc list security.privileged=true -+------+---------+---------------------+-----------------------------------------------+------------+-----------+ -| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS | -+------+---------+---------------------+-----------------------------------------------+------------+-----------+ -| suse | RUNNING | 172.17.0.105 (eth0) | 2607:f2c0:f00f:2700:216:3eff:fef2:aff4 (eth0) | PERSISTENT | 0 | -+------+---------+---------------------+-----------------------------------------------+------------+-----------+ -``` - -In this example, only containers that are privileged (user namespace disabled) are listed. - -``` -stgraber@dakara:~$ lxc list --fast alpine -+-------------+---------+--------------+----------------------+----------+------------+ -| NAME | STATE | ARCHITECTURE | CREATED AT | PROFILES | TYPE | -+-------------+---------+--------------+----------------------+----------+------------+ -| alpine | RUNNING | x86_64 | 2016/03/20 02:11 UTC | default | PERSISTENT | -+-------------+---------+--------------+----------------------+----------+------------+ -| alpine-edge | RUNNING | x86_64 | 2016/03/20 02:19 UTC | default | PERSISTENT | -+-------------+---------+--------------+----------------------+----------+------------+ -``` - -And in this example, only the containers which have “alpine” in their names (complex regular expressions are also supported). - -#### Getting detailed information from a container - -As the list command obviously can’t show you everything about a container in a nicely readable way, you can query information about an individual container with: - -``` -lxc info -``` - -For example: - -``` -stgraber@dakara:~$ lxc info zerotier -Name: zerotier -Architecture: x86_64 -Created: 2016/02/20 20:01 UTC -Status: Running -Type: persistent -Profiles: default -Pid: 31715 -Processes: 32 -Ips: - eth0: inet 172.17.0.101 - eth0: inet6 2607:f2c0:f00f:2700:216:3eff:feec:65a8 - eth0: inet6 fe80::216:3eff:feec:65a8 - lo: inet 127.0.0.1 - lo: inet6 ::1 - lxcbr0: inet 10.0.3.1 - lxcbr0: inet6 fe80::c0a4:ceff:fe52:4d51 - zt0: inet 29.17.181.59 - zt0: inet6 fd80:56c2:e21c:0:199:9379:e711:b3e1 - zt0: inet6 fe80::79:e7ff:fe0d:5123 -Snapshots: - zerotier/blah (taken at 2016/03/08 23:55 UTC) (stateless) - ``` - -### Life-cycle management commands - -Those are probably the most obvious commands of any container or virtual machine manager but they still need to be covered. - -Oh and all of them accept multiple container names for batch operation. - -#### start - -Starting a container is as simple as: - -``` -lxc start -``` - -#### stop - -Stopping a container can be done with: - -``` -lxc stop -``` - -If the container isn’t cooperating (not responding to SIGPWR), you can force it with: - -``` -lxc stop --force -``` - -#### restart - -Restarting a container is done through: - -``` -lxc restart -``` - -And if not cooperating (not responding to SIGINT), you can force it with: - -``` -lxc restart --force -``` - -#### pause - -You can also “pause” a container. In this mode, all the container tasks will be sent the equivalent of a SIGSTOP which means that they will still be visible and will still be using memory but they won’t get any CPU time from the scheduler. - -This is useful if you have a CPU hungry container that takes quite a while to start but that you aren’t constantly using. You can let it start, then pause it, then start it again when needed. - -``` -lxc pause -``` - -#### delete - -Lastly, if you want a container to go away, you can delete it for good with: - -``` -lxc delete -``` - -Note that you will have to pass “–force” if the container is currently running. - -### Container configuration - -LXD exposes quite a few container settings, including resource limitation, control of container startup and a variety of device pass-through options. The full list is far too long to cover in this post but it’s available [here][2]. - -As far as devices go, LXD currently supports the following device types: - -- disk -This can be a physical disk or partition being mounted into the container or a bind-mounted path from the host. -- nic -A network interface. It can be a bridged virtual ethernet interrface, a point to point device, an ethernet macvlan device or an actual physical interface being passed through to the container. -- unix-block -A UNIX block device, e.g. /dev/sda -- unix-char -A UNIX character device, e.g. /dev/kvm -- none -This special type is used to hide a device which would otherwise be inherited through profiles. - -#### Configuration profiles - -The list of all available profiles can be obtained with: - -``` -lxc profile list -``` - -To see the content of a given profile, the easiest is to use: - -``` -lxc profile show -``` - -And should you want to change anything inside it, use: - -``` -lxc profile edit -``` - -You can change the list of profiles which apply to a given container with: - -``` -lxc profile apply ,,,... -``` - -#### Local configuration - -For things that are unique to a container and so don’t make sense to put into a profile, you can just set them directly against the container: - -``` -lxc config edit -``` - -This behaves the exact same way as “profile edit” above. - -Instead of opening the whole thing in a text editor, you can also modify individual keys with: - -``` -lxc config set -``` -Or add devices, for example: - -``` -lxc config device add my-container kvm unix-char path=/dev/kvm -``` - -Which will setup a /dev/kvm entry for the container named “my-container”. - -The same can be done for a profile using “lxc profile set” and “lxc profile device add”. - -#### Reading the configuration - -You can read the container local configuration with: - -``` -lxc config show -``` - -Or to get the expanded configuration (including all the profile keys): - -``` -lxc config show --expanded -``` - -For example: - -``` -stgraber@dakara:~$ lxc config show --expanded zerotier -name: zerotier -profiles: -- default -config: - security.nesting: "true" - user.a: b - volatile.base_image: a49d26ce5808075f5175bf31f5cb90561f5023dcd408da8ac5e834096d46b2d8 - volatile.eth0.hwaddr: 00:16:3e:ec:65:a8 - volatile.last_state.idmap: '[{"Isuid":true,"Isgid":false,"Hostid":100000,"Nsid":0,"Maprange":65536},{"Isuid":false,"Isgid":true,"Hostid":100000,"Nsid":0,"Maprange":65536}]' -devices: - eth0: - name: eth0 - nictype: macvlan - parent: eth0 - type: nic - limits.ingress: 10Mbit - limits.egress: 10Mbit - root: - path: / - size: 30GB - type: disk - tun: - path: /dev/net/tun - type: unix-char -ephemeral: false -``` - -That one is very convenient to check what will actually be applied to a given container. - -#### Live configuration update - -Note that unless indicated in the documentation, all configuration keys and device entries are applied to affected containers live. This means that you can add and remove devices or alter the security profile of running containers without ever having to restart them. - -### Getting a shell - -LXD lets you execute tasks directly into the container. The most common use of this is to get a shell in the container or to run some admin tasks. - -The benefit of this compared to SSH is that you’re not dependent on the container being reachable over the network or on any software or configuration being present inside the container. - -Execution environment - -One thing that’s a bit unusual with the way LXD executes commands inside the container is that it’s not itself running inside the container, which means that it can’t know what shell to use, what environment variables to set or what path to use for your home directory. - -Commands executed through LXD will always run as the container’s root user (uid 0, gid 0) with a minimal PATH environment variable set and a HOME environment variable set to /root. - -Additional environment variables can be passed through the command line or can be set permanently against the container through the “environment.” configuration options. - -#### Executing commands - -Getting a shell inside a container is typically as simple as: - -``` -lxc exec bash -``` - -That’s assuming the container does actually have bash installed. - - -More complex commands require the use of a separator for proper argument parsing: - -``` -lxc exec -- ls -lh / -``` - -To set or override environment variables, you can use the “–env” argument, for example: - -``` -stgraber@dakara:~$ lxc exec zerotier --env mykey=myvalue env | grep mykey -mykey=myvalue -``` - -### Managing files - -Because LXD has direct access to the container’s file system, it can directly read and write any file inside the container. This can be very useful to pull log files or exchange files with the container. - -#### Pulling a file from the container - -To get a file from the container, simply run: - -``` -lxc file pull / -``` - -For example: - -``` -stgraber@dakara:~$ lxc file pull zerotier/etc/hosts hosts -``` - -Or to read it to standard output: - -``` -stgraber@dakara:~$ lxc file pull zerotier/etc/hosts - -127.0.0.1 localhost - -# The following lines are desirable for IPv6 capable hosts -::1 ip6-localhost ip6-loopback -fe00::0 ip6-localnet -ff00::0 ip6-mcastprefix -ff02::1 ip6-allnodes -ff02::2 ip6-allrouters -ff02::3 ip6-allhosts -``` - -#### Pushing a file to the container - -Push simply works the other way: - -``` -lxc file push / -``` - -#### Editing a file directly - -Edit is a convenience function which simply pulls a given path, opens it in your default text editor and then pushes it back to the container when you close it: - -``` -lxc file edit / -``` - -### Snapshot management - -LXD lets you snapshot and restore containers. Snapshots include the entirety of the container’s state (including running state if –stateful is used), which means all container configuration, container devices and the container file system. - -#### Creating a snapshot - -You can snapshot a container with: - -``` -lxc snapshot -``` - -It’ll get named snapX where X is an incrementing number. - -Alternatively, you can name your snapshot with: - -``` -lxc snapshot -``` - -#### Listing snapshots - -The number of snapshots a container has is listed in “lxc list”, but the actual snapshot list is only visible in “lxc info”. - -``` -lxc info -``` - -#### Restoring a snapshot - -To restore a snapshot, simply run: - -``` -lxc restore -``` - -#### Renaming a snapshot - -Renaming a snapshot can be done by moving it with: - -``` -lxc move / / -``` - -#### Creating a new container from a snapshot - -You can create a new container which will be identical to another container’s snapshot except for the volatile information being reset (MAC address): - -``` -lxc copy / -``` - -#### Deleting a snapshot - -And finally, to delete a snapshot, just run: - -``` -lxc delete / -``` - -### Cloning and renaming - -Getting clean distribution images is all nice and well, but sometimes you want to install a bunch of things into your container, configure it and then branch it into a bunch of other containers. - -#### Copying a container - -To copy a container and effectively clone it into a new one, just run: - -``` -lxc copy -``` - -The destination container will be identical in every way to the source one, except it won’t have any snapshot and volatile keys (MAC address) will be reset. - -#### Moving a container - -LXD lets you copy and move containers between hosts, but that will get covered in a later post. - -For now, the “move” command can be used to rename a container with: - -``` -lxc move -``` - -The only requirement is that the container be stopped, everything else will be kept exactly as it was, including the volatile information (MAC address and such). - -### Conclusion - -This pretty long post covered most of the commands you’re likely to use in day to day operation. - -Obviously a lot of those commands have extra arguments that let you be more efficient or tweak specific aspects of your LXD containers. The best way to learn about all of those is to go through the help for those you care about (–help). - -### Extra information - -The main LXD website is at: -Development happens on Github at: -Mailing-list support happens on: -IRC support happens in: #lxcontainers on irc.freenode.net - -And if you don’t want or can’t install LXD on your own machine, you can always [try it online instead][1]! - - --------------------------------------------------------------------------------- - -via: https://www.stgraber.org/2016/03/19/lxd-2-0-your-first-lxd-container-312/ - -作者:[Stéphane Graber][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.stgraber.org/author/stgraber/ -[0]: https://www.stgraber.org/2016/03/11/lxd-2-0-blog-post-series-012/ -[1]: https://linuxcontainers.org/lxd/try-it -[2]: https://github.com/lxc/lxd/blob/master/doc/configuration.md diff --git a/test b/test new file mode 100644 index 0000000000..3fcac2634a --- /dev/null +++ b/test @@ -0,0 +1,11 @@ + 1. 移动光标到本行。 + + 2. 接着按 v 键,将光标移动至下面第五个条目上。您会注意到之间的文本被高亮了。 + + 3. 然后按 : 字符。您将看到屏幕底部会出现 :'<,'> 。 + + 4. 现在请输入 w TEST,其中 TEST 是一个未被使用的文件名。确认您看到了 + :'<,'>w TEST 之后按 <回车> 键。 + + 5. 这时 Vim 会把选中的行写入到以 TEST 命名的文件中去。使用 :!dir 或 :!ls + 确认文件被正确保存。这次先别删除它!我们在下一讲中会用到它。 diff --git a/translated/tech/LXD/Part 3 - LXD 2.0--Your first LXD container.md b/translated/tech/LXD/Part 3 - LXD 2.0--Your first LXD container.md new file mode 100644 index 0000000000..4b6dcfd8aa --- /dev/null +++ b/translated/tech/LXD/Part 3 - LXD 2.0--Your first LXD container.md @@ -0,0 +1,438 @@ +kylepeng93 is translating +你的地一个LXD容器 +========================================== + +这是第三篇发布的博客[LXD2.0系列] +由于在管理LXD容器时涉及到大量的命令,所以这篇文章的篇幅是比较长的,如果你更喜欢使用同样的命令来快速的一步步实现整个过程,你可以[尝试我们的在线示例]! +![](https://linuxcontainers.org/static/img/containers.png) + +### 创建并启动一个新的容器 +正如我在先前的文章中提到的一样,LXD命令行客户端使用了少量的图片来做了一个预配置。Ubuntu的所有发行版和架构平台都拥有最好的官方图片,但是对于其他的发行版仍然有大量的非官方图片,那些图片都是由社区制作并且被LXC上层贡献者所维护。 +### Ubuntu +如果你想要支持最为完善的ubuntu版本,你可以按照下面的去做: +``` +lxc launch ubuntu: +``` +注意,这里所做的解释会随着ubuntu LTS的发布而变化。因此对于你使用的脚本应该取决于下面提到的具体你想要安装的版本: +###Ubuntu14.04 LTS +得到最新的,已经测试过的,稳定的ubuntu14.04 LTS镜像,你可以简单的执行: +``` +lxc launch ubuntu:14.04 +``` +这该模式下,一个任意的容器名将会被指定给它。 +如果你更喜欢指定一个你自己的命令,你可以这样做: +``` +lxc launch ubuntu:14.04 c1 +``` + +如果你想要指定一个特定的体系架构(非主要的),比如32位Intel镜像,你可以这样做: +``` +lxc launch ubuntu:14.04/i386 c2 +``` + +### 当前的Ubuntu开发版本 +上面使用的“ubuntu:”远程方式只会给你提供官方的并经过测试的ubuntu镜像。但是如果你想要未经测试过的日常构建版本,开发版可能对你来说是合适的,你将要使用“ubuntu-daily”来远程获取。 +``` +lxc launch ubuntu-daily:devel c3 +``` + +在这个例子中,最新的ubuntu开发版本将会被选自动选中。 +你也可以更加精确,比如你可以使用代号名: +``` +lxc launch ubuntu-daily:xenial c4 +``` + +### 最新的Alpine Linux +Alpine镜像在“Images:”远程中可用,可以通过如下命令执行: +``` +lxc launch images:alpine/3.3/amd64 c5 +``` + +### And many more +### 其他 +所有ubuntu镜像列表可以这样获得: +``` +lxc image list ubuntu: +lxc image list ubuntu-daily: +``` + +所有的非官方镜像: +``` +lxc image list images: +``` + +所有给定的可用远程别名清单可以这样获得(针对“ubuntu:”远程): +``` +lxc image alias list ubuntu: +``` + + +### 创建但不启动一个容器 +如果你想创建一个容器或者一批容器,但是你不想马上启动他们,你可以使用“lxc init”替换掉“lxc launch”。所有的选项都是相同的,唯一的不同就是它并不会在你创建完成之后启动容器。 +``` +lxc init ubuntu: +``` + +### 关于你的容器的信息 +### 列出所有的容器 +为了列出你的所有容器,你可以这样这做: +``` +lxc list +``` + +有大量的选项供你选择来改变被显示出来的列。在一个拥有大量容器的系统上,默认显示的列可能会有点慢(因为必须获取容器中的网络信息),你可以这样做来避免这种情况: +``` +lxc list --fast +``` + +上面的命令显示了一个不同的列的集合,这个集合在服务器端需要处理的信息更少。 +你也可以基于名字或者属性来过滤掉一些东西: +``` +stgraber@dakara:~$ lxc list security.privileged=true ++------+---------+---------------------+-----------------------------------------------+------------+-----------+ +| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS | ++------+---------+---------------------+-----------------------------------------------+------------+-----------+ +| suse | RUNNING | 172.17.0.105 (eth0) | 2607:f2c0:f00f:2700:216:3eff:fef2:aff4 (eth0) | PERSISTENT | 0 | ++------+---------+---------------------+-----------------------------------------------+------------+-----------+ +``` + +在这个例子中,只有那些有特权(用户命名空间不可用)的容器才会被列出来。 +``` +stgraber@dakara:~$ lxc list --fast alpine ++-------------+---------+--------------+----------------------+----------+------------+ +| NAME | STATE | ARCHITECTURE | CREATED AT | PROFILES | TYPE | ++-------------+---------+--------------+----------------------+----------+------------+ +| alpine | RUNNING | x86_64 | 2016/03/20 02:11 UTC | default | PERSISTENT | ++-------------+---------+--------------+----------------------+----------+------------+ +| alpine-edge | RUNNING | x86_64 | 2016/03/20 02:19 UTC | default | PERSISTENT | ++-------------+---------+--------------+----------------------+----------+------------+ +``` + +在这个例子中,只有在名字中带有“alpine”的容器才会被列出来(支持复杂的正则表达式)。 +### 获取容器的详细信息 +由于list命令显然不能以一种友好的可读方式显示容器的所有信息,因此你可以使用如下方式来查询单个容器的信息: +``` +lxc info +``` + +例如: +``` +stgraber@dakara:~$ lxc info zerotier +Name: zerotier +Architecture: x86_64 +Created: 2016/02/20 20:01 UTC +Status: Running +Type: persistent +Profiles: default +Pid: 31715 +Processes: 32 +Ips: + eth0: inet 172.17.0.101 + eth0: inet6 2607:f2c0:f00f:2700:216:3eff:feec:65a8 + eth0: inet6 fe80::216:3eff:feec:65a8 + lo: inet 127.0.0.1 + lo: inet6 ::1 + lxcbr0: inet 10.0.3.1 + lxcbr0: inet6 fe80::c0a4:ceff:fe52:4d51 + zt0: inet 29.17.181.59 + zt0: inet6 fd80:56c2:e21c:0:199:9379:e711:b3e1 + zt0: inet6 fe80::79:e7ff:fe0d:5123 +Snapshots: + zerotier/blah (taken at 2016/03/08 23:55 UTC) (stateless) + ``` + +### 生命周期管理命令 +这些命令对于任何容器或者虚拟机管理器或许都是最普通的命令,但是它们仍然需要被涉及到。 +所有的这些命令在批量操作时都能接受多个容器名。 +### 启动 +启动一个容器就向下面一样简单: +``` +lxc start +``` + +### 停止 +停止一个容器可以这样来完成: +``` +lxc stop +``` + +如果容器不合作(即没有对发出的信号产生回应),这时候,你可以使用下面的方式强制执行: +``` +lxc stop --force +``` + +### 重启 +通过下面的命令来重启一个容器: +``` +lxc restart +``` + +如果容器不合作(即没有对发出的信号产生回应),你可以使用下面的方式强制执行: +``` +lxc restart --force +``` + +### 暂停 +你也可以“暂停”一个容器,在这种模式下,所有的容器任务将会被发送相同的信号,这也意味着他们将仍然是可见的,并且仍然会占用内存,但是他们不会从调度程序中得到任何的CPU时间片。 +如果你有一个CPU的饥饿容器,而这个容器需要一点时间来启动,但是你却并 不会经常用到它。这时候,你可以先启动它,然后将它暂停,并在你需要它的时候再启动它。 +``` +lxc pause +``` + +### 删除 +最后,如果你不需要这个容器了,你可以用下面的命令删除它: +``` +lxc delete +``` + +注意,如果容器还处于运行状态时你将必须使用“-forece”。 +### 容器的配置 +LXD拥有大量的容器配置设定,包括资源限制,容器启动控制以及对各种设备是否允许访问的配置选项。完整的清单因为太长所以并没有在本文中列出,但是,你可以从[here]获取它。 +就设备而言,LXD当前支持下面列出的这些设备: +- 磁盘 +既可以是一块物理磁盘,也可以只是一个被挂挂载到容器上的分区,还可以是一个来自主机的绑定挂载路径。 +- 网络接口卡 +一块网卡。它可以是一块桥接的虚拟网卡,或者是一块点对点设备,还可以是一块以太局域网设备或者一块已经被连接到容器的真实物理接口。 +- unix块 +一个UNIX块设备,比如/dev/sda +- unix字符 +一块UNIX字符设备,比如/dev/kvm +- none +这种特殊类型被用来隐藏那种可以通过profiles文件被继承的设备。 + +### 配置profiles文件 +所有可用的profiles的文件列表可以这样获取: +``` +lxc profile list +``` + +为了看到给定profile文件的内容,最简单的方式是这样做: +``` +lxc profile show +``` + +你可能想要改变文件里面的内容,可以这样做: +``` +lxc profile edit +``` + +你可以使用如下命令来改变profiles的列表并将这种变化应用到给定的容器中: +``` +lxc profile apply ,,,... +``` + +### 本地配置 +For things that are unique to a container and so don’t make sense to put into a profile, you can just set them directly against the container: + +``` +lxc config edit +``` + +上面的命令将会完成和“profile edit”命令一样的功能。 + +即使不在文本编辑器中打开整个文件的内容,你也可以像这样修改单独的键: +``` +lxc config set +``` +或者添加设备,例如 +``` +lxc config device add my-container kvm unix-char path=/dev/kvm +``` + +上面的命令将会为名为“my-container”的容器打开一个/dev/kvm入口。 +对一个profile文件使用“lxc profile set”和“lxc profile device add”命令也能实现上面的功能。 +#### 读取配置 +你可以使用如下命令来阅读容器的本地配置: +``` +lxc config show +``` + +或者得到已经被展开了的配置(包含了所有的键值): +``` +lxc config show --expanded +``` + +例如: +``` +stgraber@dakara:~$ lxc config show --expanded zerotier +name: zerotier +profiles: +- default +config: + security.nesting: "true" + user.a: b + volatile.base_image: a49d26ce5808075f5175bf31f5cb90561f5023dcd408da8ac5e834096d46b2d8 + volatile.eth0.hwaddr: 00:16:3e:ec:65:a8 + volatile.last_state.idmap: '[{"Isuid":true,"Isgid":false,"Hostid":100000,"Nsid":0,"Maprange":65536},{"Isuid":false,"Isgid":true,"Hostid":100000,"Nsid":0,"Maprange":65536}]' +devices: + eth0: + name: eth0 + nictype: macvlan + parent: eth0 + type: nic + limits.ingress: 10Mbit + limits.egress: 10Mbit + root: + path: / + size: 30GB + type: disk + tun: + path: /dev/net/tun + type: unix-char +ephemeral: false +``` + +这样做可以很方便的检查有哪些配置属性被应用到了给定的容器。 +### 实时配置更新 +注意,除非在文档中已经被明确指出,否则所有的键值和设备入口都会被应用到受影响的实时容器。这意味着你可以添加和移除某些设备或者在不重启容器的情况下修改正在运行的容器的安全profile配置文件。 +### 获得一个shell +LXD允许你对容器中的任务进行直接的操作。最常用的做法是在容器中得到一个shell或者执行一些管理员任务。 +和SSH相比,这样做的好处是你可以接触到独立与容器之外的网络或者任何一个软件又或者任何一个能够在容器内可见的文件配置。 +执行环境 +对比LXD在容器内执行命令的方式,有一点是不同的,那就是它自身并不是在容器中运行。这也意味着它不知道该使用什么样的shell,以及设置什么样的环境变量和哪里是它的家目录。 +通过LXD来执行命令必须总是在最小路径环境变量集并且HONE环境变量必须为/root的情况下以容器的超级用户身份来执行(即uid为0,gid为0)。 +其他的环境变量可以通过命令行来设置,或者在“environment.”配置文件中设置成永久环境变量。 +### 执行命令 +在容器中获得一个shell可以简单的执行下列命令得到: +``` +lxc exec bash +``` + +当然,这样做的前提是容器内已经安装了bash。 + +更多复杂的命令要求有对参数分隔符的合理使用。 +``` +lxc exec -- ls -lh / +``` + +如果想要设置或者重写变量,你可以使用“-env”参数,例如: +``` +stgraber@dakara:~$ lxc exec zerotier --env mykey=myvalue env | grep mykey +mykey=myvalue +``` + +### 管理文件 +因为LXD可以直接访问容器的文件系统,因此,它可以直接往容器中读取和写入任意文件。当我们需要提取日志文件或者与容器发生交互时,这个特性是很有用的。 +#### 从容器中取回一个文件 +想要从容器中获得一个文件,简单的执行下列命令: +``` +lxc file pull / +``` + +例如: +``` +stgraber@dakara:~$ lxc file pull zerotier/etc/hosts hosts +``` + +或者将它读取到标准输出: +``` +stgraber@dakara:~$ lxc file pull zerotier/etc/hosts - +127.0.0.1 localhost + +# 下面的所有行对于支持IPv6的主机是有用的 +::1 ip6-localhost ip6-loopback +fe00::0 ip6-localnet +ff00::0 ip6-mcastprefix +ff02::1 ip6-allnodes +ff02::2 ip6-allrouters +ff02::3 ip6-allhosts +``` + +#### 向容器发送一个文件 + +发送会简单的以另一种方式完成: +``` +lxc file push / +``` + +#### 直接编辑一个文件 +当只是简单的提取一个给定的路径时,编辑是一个很方便的功能,在你的默认文本编辑器中打开它,这样在你关闭编辑器时会自动将编辑的内容保存到容器。 +``` +lxc file edit / +``` + +### 快照管理 +LXD允许你对容器执行快照功能并恢复它。快照包括了容器在某一时刻的完整状态(如果-stateful被使用的话将会包括运行状态),这也意味着所有的容器配置,容器设备和容器文件系统也会被包保存。 +#### 创建一个快照 +你可以使用下面的命令来执行快照功能: +``` +lxc snapshot +``` + +命令执行完成之后将会生成名为snapX(X为一个自动增长的数)的记录。 +除此之外,你还可以使用如下命令命名你的快照: +``` +lxc snapshot +``` + +#### 列出所有的快照 +一个容器的所有快照的数量可以使用“lxc list”来得到,但是真正的快照列表只能执行“lxc info”命令才能看到。 +``` +lxc info +``` + +#### 恢复快照 +为了恢复快照,你可以简单的执行下面的命令: +``` +lxc restore +``` + +#### 给快照重命名 +可以使用如下命令来给快照重命名: +``` +lxc move / / +``` + +#### 从快照中创建一个新的容器 +你可以使用快照来创建一个新的容器,而这个新的容器除了一些可变的信息将会被重置之外(例如MAC地址)其余所有信息都将和快照完全相同。 +``` +lxc copy / +``` + +#### 删除一个快照 + +最后,你可以执行下面的命令来删除一个快照: +``` +lxc delete / +``` + +### 克隆并重命名 +得到一个纯净的发行版镜像总是让人感到愉悦,但是,有时候你想要安装一系列的软件到你的容器中,这时,你需要配置它然后将它分割并分配到多个其他的容器中。 +#### 复制一个容器 +为了复制一个容器并有效的将它克隆到一个新的容器中,你可以执行下面的命令: +``` +lxc copy +``` +目标容器在所有方面将会完全和源容器等同。除非它没有 +目标容器在所有方面将会完全和源容器等同。除了新的容器没有任何源容器的快照以及一些可变值将会被重置之外(例如MAC地址)。 +#### 移除一个快照 +LXD允许你复制容器并在主机之间移动它。但是,关于这一点将在后面的文章中介绍。 +现在,“move”命令将会被用作给容器重命名。 +``` +lxc move +``` + +唯一的要求就是当容器被停止时,容器内的任何事情都会被保存成它本来的样子,包括可变化的信息(类似MAC地址等)。 +### 结论 +这篇如此长的文章介绍了大多数你可能会在日常操作中使用到的命令。 +很显然,那些如此之多的命令都会有额外的可以让你的命令更加有效率或者可以让你指定你的LXD容器的某个具体方面的参数。最好的学习这些命令的方式就是深入学习它们的帮助文档,当然。只是对于那些你真正需要用到的命令参数。 +### 额外的信息 +LXD的主要网站是: +Github上的开发说明: +邮件列表支持: +IRC支持: #lxcontainers on irc.freenode.net +如果你不想或者不能在你的机器上安装LXD,你可以[try it online instead][1]! + +-------------------------------------------------------------------------------- + +来自于:https://www.stgraber.org/2016/03/19/lxd-2-0-your-first-lxd-container-312/ +作者:[Stéphane Graber][a] +译者:[kylepeng93](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.stgraber.org/author/stgraber/ +[0]: https://www.stgraber.org/2016/03/11/lxd-2-0-blog-post-series-012/ +[1]: https://linuxcontainers.org/lxd/try-it +[2]: https://github.com/lxc/lxd/blob/master/doc/configuration.md From 1da48286956f1047e70134dc45812257288839ac Mon Sep 17 00:00:00 2001 From: kyle Date: Sun, 15 May 2016 21:09:20 +0800 Subject: [PATCH 0764/1469] translated --- index.html.1 | 356 --------------------------------------------------- 1 file changed, 356 deletions(-) delete mode 100644 index.html.1 diff --git a/index.html.1 b/index.html.1 deleted file mode 100644 index 3188a12288..0000000000 --- a/index.html.1 +++ /dev/null @@ -1,356 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - How people build software · GitHub - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Skip to content - - - - - - - - - - - - -
- -
-
- - -
- -
-
-
-
-

How people build software

-

Millions of developers use GitHub to build personal projects, support their businesses, and work together on open source technologies.

-
- -
-
-
- -
-
-

Welcome home, developers

-

GitHub fosters a fast, flexible, and collaborative development process that lets you work on your own or with others.

-
-
-
-
- -

For everything you build

-

Host and manage your code on GitHub. You can keep your work private or share it with the world.

-
-
- -

A better way to work

-

From hobbyists to professionals, GitHub helps developers simplify the way they build software.

-
-
- -

Millions of projects

-

GitHub is home to millions of open source projects. Try one out or get inspired to create your own.

-
-
- -

One platform, from start to finish

-

With hundreds of integrations, GitHub is flexible enough to be at the center of your development process.

-
-
-
-
- -
-
-

Who uses GitHub?

-
-
- - - -
-
-
- -
- NASA is on GitHub -
-
-
-
- -
-
-
- -
- Public projects are always free. Private plans start at $7/month. -
-
-
-
- - - -
- - - - - - - - - -
- - - Something went wrong with that request. Please try again. -
- - - - - - - - - - - - - - - From 6ad5a2c3b0ef6864c0d388bc0ae8246c83f109eb Mon Sep 17 00:00:00 2001 From: kyle Date: Sun, 15 May 2016 21:14:47 +0800 Subject: [PATCH 0765/1469] translated --- test | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 test diff --git a/test b/test deleted file mode 100644 index 3fcac2634a..0000000000 --- a/test +++ /dev/null @@ -1,11 +0,0 @@ - 1. 移动光标到本行。 - - 2. 接着按 v 键,将光标移动至下面第五个条目上。您会注意到之间的文本被高亮了。 - - 3. 然后按 : 字符。您将看到屏幕底部会出现 :'<,'> 。 - - 4. 现在请输入 w TEST,其中 TEST 是一个未被使用的文件名。确认您看到了 - :'<,'>w TEST 之后按 <回车> 键。 - - 5. 这时 Vim 会把选中的行写入到以 TEST 命名的文件中去。使用 :!dir 或 :!ls - 确认文件被正确保存。这次先别删除它!我们在下一讲中会用到它。 From 86ea7ee56c0b5f647ad9f2cdfd36d724ee547e8f Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 16 May 2016 22:23:54 +0800 Subject: [PATCH 0766/1469] =?UTF-8?q?20160516-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...n source from a recruiter's perspective.md | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 sources/talk/20160516 Open source from a recruiter's perspective.md diff --git a/sources/talk/20160516 Open source from a recruiter's perspective.md b/sources/talk/20160516 Open source from a recruiter's perspective.md new file mode 100644 index 0000000000..15fc396139 --- /dev/null +++ b/sources/talk/20160516 Open source from a recruiter's perspective.md @@ -0,0 +1,51 @@ +Open source from a recruiter's perspective +============================================ + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BIZ_workplay.png?itok=uQqFssrf) + +I fell in love with technology when I went to my first open source convention in 2012. + +After spending years in recruiting, I decided to take a job specializing in big data at [Greythorn][1]. I had been trying to learn the ropes for a few months leading up to [OSCON][2], but going to the conference sped that process up like crazy. There were so many brilliant people all in one place, and everyone was willing to share what they knew. It wasn't because they were trying to sell me anything, but because they were all so passionate about what they were working on. + +I soon realized that, in many ways, the open source and big data industry was less an industry and more of a community. That's why I now try to pay it forward and share what I've learned about open source with those who are just getting started in their careers. + +### Why employers want open source contributors + +Many clients tell me that although they want a candidate who has an exceptional technical mind, the ideal person should also really like this stuff. When you are passionate about something, you find yourself working on it even when you aren't getting paid. + +My clients often ask, "Do they code in their spare time?" "Can I find their work anywhere?" "What do they really enjoy?" Open source contributors are often at an advantage because they check these boxes, and not only are their projects out in the open—so is the evidence of their coding proficiency. + +#### Why recruiters search for open source contributors + +Solid tech recruiters understand the technologies and roles they're recruiting for, and they're going to assess your skills accordingly. But I'll admit that many of us have found that the best candidates we've come across have a tendency to be involved in open source, so we often just start our search there. Recruiters provide value to clients when they find candidates who are motivated to work on a team to create something awesome, because that's basically the description of a top-performing employee. + +It makes sense to me: When you take really smart people and give them the chance to be collaborative—for the sake of making something that works really well or may change the landscape of our everyday lives—it creates an energy that can be addictive. + +### What open source contributors can do to build a happy career + +There are obvious things you can do to leverage your open source work to build your career: Put your code on GitHub, participate in projects, go to conferences and join panels and workshops, etc. These are worthwhile, but more than anything you need to know what will make you happy in your work. + +Ask yourself questions like... + +* **Is it important to work for a company that gives back to the open source and software community?** I find that some of my best candidates insist on this, and it makes a huge difference in their job satisfaction. +* **Do you want to work for a company that is based on open source?** The culture is often different in these environments, and it helps to know if that's where you think you'll fit best. +* **Are there people you'd specifically like to work with?** Although you can always try to join the same projects, the odds of collaborating with and learning from someone you admire are better if your day jobs align at the same company. + +Once you know your own career priorities, it's easier to filter out the jobs that won't move you closer to your goals—and if you're working with a recruiter, it helps them match you with the right employer and team. + +Although I don't contribute code, I'll always share what I've learned with those who are working on their career in open source. This community is made up of supportive and smart people, and I love that I've been able to be a small part of it. + + +------------------------------------------------------------------------------ + +via: https://opensource.com/business/16/5/open-source-recruiters-perspective + +作者:[Lindsey Thorne][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/lindsey-thorne +[1]: http://www.greythorn.com/ +[2]: http://conferences.oreilly.com/oscon From 724b0feea00843d611c45bed0283e326f105446f Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 16 May 2016 22:32:50 +0800 Subject: [PATCH 0767/1469] =?UTF-8?q?20160516-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...r operating system of 21st century cars.md | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 sources/talk/20160516 Linux will be the major operating system of 21st century cars.md diff --git a/sources/talk/20160516 Linux will be the major operating system of 21st century cars.md b/sources/talk/20160516 Linux will be the major operating system of 21st century cars.md new file mode 100644 index 0000000000..ec7a33aaa6 --- /dev/null +++ b/sources/talk/20160516 Linux will be the major operating system of 21st century cars.md @@ -0,0 +1,38 @@ +Linux will be the major operating system of 21st century cars +=============================================================== + +>Cars are more than engines and good looking bodies. They're also complex computing devices so, of course, Linux runs inside them. + +Linux doesn't just run your servers and, via Android, your phones. It also runs your cars. Of course, no one has ever bought a car for its operating system. But Linux is already powering the infotainment, heads-up display and connected car 4G and Wi-Fi systems for such major car manufacturers as Toyota, Nissan, and Jaguar Land Rover and [Linux is on its way to Ford][1], Mazda, Mitsubishi, and Subaru cars. + +![](http://zdnet4.cbsistatic.com/hub/i/2016/05/10/743f0c14-6458-4d1e-8723-d2d94d0d0e69/c297b7d52e27e97d8721d4cb46bb371b/agl-logo.jpg) +>All the Linux and open-source car software efforts have now been unified under the Automotive Grade Linux project. + +Software companies are also getting into this Internet of mobile things act. Movimento, Oracle, Qualcomm, Texas Instruments, UIEvolution and VeriSilicon have all [joined the Automotive Grade Linux (AGL)][2] project. The [AGL][3] is a collaborative open-source project devoted to creating a common, Linux-based software stack for the connected car. + +AGL has seen tremendous growth over the past year as demand for connected car technology and infotainment are rapidly increasing," said Dan Cauchy, the Linux Foundation's General Manager of Automotive, in a statement. + +Cauchy continued, "Our membership base is not only growing rapidly, but it is also diversifying across various business interests, from semiconductors and in-vehicle software to IoT and connected cloud services. This is a clear indication that the connected car revolution has broad implications across many industry verticals." + +These companies have joined after AGL's recent announcement of a new AGL Unified Code Base (UCB). This new Linux distribution is based on AGL and two other car open-source projects: [Tizen][4] and the [GENIVI Alliance][5]. UCB is a second-generation car Linux. It was built from the ground up to address automotive specific applications. It handles navigation, communications, safety, security and infotainment functionality, + +"The automotive industry needs a standard open operating system and framework to enable automakers and suppliers to quickly bring smartphone-like capabilities to the car," said Cauchy. "This new distribution integrates the best components from AGL, Tizen, GENIVI and related open-source code into a single AGL Unified Code Base, allowing car-makers to leverage a common platform for rapid innovation. The AGL UCB distribution will play a huge role in the adoption of Linux-based systems for all functions in the vehicle." + +He's right. Since its release in January 2016, four car companies and ten new software businesses have joined AGL. Esso, now Exxon, made the advertising slogan, "Put a tiger in your tank!" famous. I doubt that "Put a penguin under your hood" will ever become well-known, but that's exactly what's happening. Linux is well on its way to becoming the major operating system of 21st century cars. + +------------------------------------------------------------------------------ + +via: http://www.zdnet.com/article/the-linux-in-your-car-movement-gains-momentum/ + +作者:[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]: https://www.automotivelinux.org/news/announcement/2016/01/ford-mazda-mitsubishi-motors-and-subaru-join-linux-foundation-and +[2]: https://www.automotivelinux.org/news/announcement/2016/05/oracle-qualcomm-innovation-center-texas-instruments-and-others-support +[3]: https://www.automotivelinux.org/ +[4]: https://www.tizen.org/ +[5]: http://www.genivi.org/ From b6f9b754b58382c48b4a0caaf783254f54d8e759 Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 16 May 2016 22:43:03 +0800 Subject: [PATCH 0768/1469] =?UTF-8?q?20160516-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20160512 Bitmap in Linux Kernel.md | 397 ++++++++++++++++++ 1 file changed, 397 insertions(+) create mode 100644 sources/tech/20160512 Bitmap in Linux Kernel.md diff --git a/sources/tech/20160512 Bitmap in Linux Kernel.md b/sources/tech/20160512 Bitmap in Linux Kernel.md new file mode 100644 index 0000000000..b7e832ba0a --- /dev/null +++ b/sources/tech/20160512 Bitmap in Linux Kernel.md @@ -0,0 +1,397 @@ +Data Structures in the Linux Kernel +================================================================================ + +Bit arrays and bit operations in the Linux kernel +-------------------------------------------------------------------------------- + +Besides different [linked](https://en.wikipedia.org/wiki/Linked_data_structure) and [tree](https://en.wikipedia.org/wiki/Tree_%28data_structure%29) based data structures, the Linux kernel provides [API](https://en.wikipedia.org/wiki/Application_programming_interface) for [bit arrays](https://en.wikipedia.org/wiki/Bit_array) or `bitmap`. Bit arrays are heavily used in the Linux kernel and following source code files contain common `API` for work with such structures: + +* [lib/bitmap.c](https://github.com/torvalds/linux/blob/master/lib/bitmap.c) +* [include/linux/bitmap.h](https://github.com/torvalds/linux/blob/master/include/linux/bitmap.h) + +Besides these two files, there is also architecture-specific header file which provides optimized bit operations for certain architecture. We consider [x86_64](https://en.wikipedia.org/wiki/X86-64) architecture, so in our case it will be: + +* [arch/x86/include/asm/bitops.h](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) + +header file. As I just wrote above, the `bitmap` is heavily used in the Linux kernel. For example a `bit array` is used to store set of online/offline processors for systems which support [hot-plug](https://www.kernel.org/doc/Documentation/cpu-hotplug.txt) cpu (more about this you can read in the [cpumasks](https://0xax.gitbooks.io/linux-insides/content/Concepts/cpumask.html) part), a `bit array` stores set of allocated [irqs](https://en.wikipedia.org/wiki/Interrupt_request_%28PC_architecture%29) during initialization of the Linux kernel and etc. + +So, the main goal of this part is to see how `bit arrays` are implemented in the Linux kernel. Let's start. + +Declaration of bit array +================================================================================ + +Before we will look on `API` for bitmaps manipulation, we must know how to declare it in the Linux kernel. There are two common method to declare own bit array. The first simple way to declare a bit array is to array of `unsigned long`. For example: + +```C +unsigned long my_bitmap[8] +``` + +The second way is to use the `DECLARE_BITMAP` macro which is defined in the [include/linux/types.h](https://github.com/torvalds/linux/blob/master/include/linux/types.h) header file: + +```C +#define DECLARE_BITMAP(name,bits) \ + unsigned long name[BITS_TO_LONGS(bits)] +``` + +We can see that `DECLARE_BITMAP` macro takes two parameters: + +* `name` - name of bitmap; +* `bits` - amount of bits in bitmap; + +and just expands to the definition of `unsigned long` array with `BITS_TO_LONGS(bits)` elements, where the `BITS_TO_LONGS` macro converts a given number of bits to number of `longs` or in other words it calculates how many `8` byte elements in `bits`: + +```C +#define BITS_PER_BYTE 8 +#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) +#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) +``` + +So, for example `DECLARE_BITMAP(my_bitmap, 64)` will produce: + +```python +>>> (((64) + (64) - 1) / (64)) +1 +``` + +and: + +```C +unsigned long my_bitmap[1]; +``` + +After we are able to declare a bit array, we can start to use it. + +Architecture-specific bit operations +================================================================================ + +We already saw above a couple of source code and header files which provide [API](https://en.wikipedia.org/wiki/Application_programming_interface) for manipulation of bit arrays. The most important and widely used API of bit arrays is architecture-specific and located as we already know in the [arch/x86/include/asm/bitops.h](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) header file. + +First of all let's look at the two most important functions: + +* `set_bit`; +* `clear_bit`. + +I think that there is no need to explain what these function do. This is already must be clear from their name. Let's look on their implementation. If you will look into the [arch/x86/include/asm/bitops.h](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) header file, you will note that each of these functions represented by two variants: [atomic](https://en.wikipedia.org/wiki/Linearizability) and not. Before we will start to dive into implementations of these functions, first of all we must to know a little about `atomic` operations. + +In simple words atomic operations guarantees that two or more operations will not be performed on the same data concurrently. The `x86` architecture provides a set of atomic instructions, for example [xchg](http://x86.renejeschke.de/html/file_module_x86_id_328.html) instruction, [cmpxchg](http://x86.renejeschke.de/html/file_module_x86_id_41.html) instruction and etc. Besides atomic instructions, some of non-atomic instructions can be made atomic with the help of the [lock](http://x86.renejeschke.de/html/file_module_x86_id_159.html) instruction. It is enough to know about atomic operations for now, so we can begin to consider implementation of `set_bit` and `clear_bit` functions. + +First of all, let's start to consider `non-atomic` variants of this function. Names of non-atomic `set_bit` and `clear_bit` starts from double underscore. As we already know, all of these functions are defined in the [arch/x86/include/asm/bitops.h](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) header file and the first function is `__set_bit`: + +```C +static inline void __set_bit(long nr, volatile unsigned long *addr) +{ + asm volatile("bts %1,%0" : ADDR : "Ir" (nr) : "memory"); +} +``` + +As we can see it takes two arguments: + +* `nr` - number of bit in a bit array. +* `addr` - address of a bit array where we need to set bit. + +Note that the `addr` parameter is defined with `volatile` keyword which tells to compiler that value maybe changed by the given address. The implementation of the `__set_bit` is pretty easy. As we can see, it just contains one line of [inline assembler](https://en.wikipedia.org/wiki/Inline_assembler) code. In our case we are using the [bts](http://x86.renejeschke.de/html/file_module_x86_id_25.html) instruction which selects a bit which is specified with the first operand (`nr` in our case) from the bit array, stores the value of the selected bit in the [CF](https://en.wikipedia.org/wiki/FLAGS_register) flags register and set this bit. + +Note that we can see usage of the `nr`, but there is `addr` here. You already might guess that the secret is in `ADDR`. The `ADDR` is the macro which is defined in the same header code file and expands to the string which contains value of the given address and `+m` constraint: + +```C +#define ADDR BITOP_ADDR(addr) +#define BITOP_ADDR(x) "+m" (*(volatile long *) (x)) +``` + +Besides the `+m`, we can see other constraints in the `__set_bit` function. Let's look on they and try to understand what do they mean: + +* `+m` - represents memory operand where `+` tells that the given operand will be input and output operand; +* `I` - represents integer constant; +* `r` - represents register operand + +Besides these constraint, we also can see - the `memory` keyword which tells compiler that this code will change value in memory. That's all. Now let's look at the same function but at `atomic` variant. It looks more complex that its `non-atomic` variant: + +```C +static __always_inline void +set_bit(long nr, volatile unsigned long *addr) +{ + if (IS_IMMEDIATE(nr)) { + asm volatile(LOCK_PREFIX "orb %1,%0" + : CONST_MASK_ADDR(nr, addr) + : "iq" ((u8)CONST_MASK(nr)) + : "memory"); + } else { + asm volatile(LOCK_PREFIX "bts %1,%0" + : BITOP_ADDR(addr) : "Ir" (nr) : "memory"); + } +} +``` + +First of all note that this function takes the same set of parameters that `__set_bit`, but additionally marked with the `__always_inline` attribute. The `__always_inline` is macro which defined in the [include/linux/compiler-gcc.h](https://github.com/torvalds/linux/blob/master/include/linux/compiler-gcc.h) and just expands to the `always_inline` attribute: + +```C +#define __always_inline inline __attribute__((always_inline)) +``` + +which means that this function will be always inlined to reduce size of the Linux kernel image. Now let's try to understand implementation of the `set_bit` function. First of all we check a given number of bit at the beginning of the `set_bit` function. The `IS_IMMEDIATE` macro defined in the same [header](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) file and expands to the call of the builtin [gcc](https://en.wikipedia.org/wiki/GNU_Compiler_Collection) function: + +```C +#define IS_IMMEDIATE(nr) (__builtin_constant_p(nr)) +``` + +The `__builtin_constant_p` builtin function returns `1` if the given parameter is known to be constant at compile-time and returns `0` in other case. We no need to use slow `bts` instruction to set bit if the given number of bit is known in compile time constant. We can just apply [bitwise or](https://en.wikipedia.org/wiki/Bitwise_operation#OR) for byte from the give address which contains given bit and masked number of bits where high bit is `1` and other is zero. In other case if the given number of bit is not known constant at compile-time, we do the same as we did in the `__set_bit` function. The `CONST_MASK_ADDR` macro: + +```C +#define CONST_MASK_ADDR(nr, addr) BITOP_ADDR((void *)(addr) + ((nr)>>3)) +``` + +expands to the give address with offset to the byte which contains a given bit. For example we have address `0x1000` and the number of bit is `0x9`. So, as `0x9` is `one byte + one bit` our address with be `addr + 1`: + +```python +>>> hex(0x1000 + (0x9 >> 3)) +'0x1001' +``` + +The `CONST_MASK` macro represents our given number of bit as byte where high bit is `1` and other bits are `0`: + +```C +#define CONST_MASK(nr) (1 << ((nr) & 7)) +``` + +```python +>>> bin(1 << (0x9 & 7)) +'0b10' +``` + +In the end we just apply bitwise `or` for these values. So, for example if our address will be `0x4097` and we need to set `0x9` bit: + +```python +>>> bin(0x4097) +'0b100000010010111' +>>> bin((0x4097 >> 0x9) | (1 << (0x9 & 7))) +'0b100010' +``` + +the `ninth` bit will be set. + +Note that all of these operations are marked with `LOCK_PREFIX` which is expands to the [lock](http://x86.renejeschke.de/html/file_module_x86_id_159.html) instruction which guarantees atomicity of this operation. + +As we already know, besides the `set_bit` and `__set_bit` operations, the Linux kernel provides two inverse functions to clear bit in atomic and non-atomic context. They are `clear_bit` and `__clear_bit`. Both of these functions are defined in the same [header file](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) and takes the same set of arguments. But not only arguments are similar. Generally these functions are very similar on the `set_bit` and `__set_bit`. Let's look on the implementation of the non-atomic `__clear_bit` function: + +```C +static inline void __clear_bit(long nr, volatile unsigned long *addr) +{ + asm volatile("btr %1,%0" : ADDR : "Ir" (nr)); +} +``` + +Yes. As we see, it takes the same set of arguments and contains very similar block of inline assembler. It just uses the [btr](http://x86.renejeschke.de/html/file_module_x86_id_24.html) instruction instead of `bts`. As we can understand form the function's name, it clears a given bit by the given address. The `btr` instruction acts like `btr`. This instruction also selects a given bit which is specified in the first operand, stores its value in the `CF` flag register and clears this bit in the given bit array which is specifed with second operand. + +The atomic variant of the `__clear_bit` is `clear_bit`: + +```C +static __always_inline void +clear_bit(long nr, volatile unsigned long *addr) +{ + if (IS_IMMEDIATE(nr)) { + asm volatile(LOCK_PREFIX "andb %1,%0" + : CONST_MASK_ADDR(nr, addr) + : "iq" ((u8)~CONST_MASK(nr))); + } else { + asm volatile(LOCK_PREFIX "btr %1,%0" + : BITOP_ADDR(addr) + : "Ir" (nr)); + } +} +``` + +and as we can see it is very similar on `set_bit` and just contains two differences. The first difference it uses `btr` instruction to clear bit when the `set_bit` uses `bts` instruction to set bit. The second difference it uses negated mask and `and` instruction to clear bit in the given byte when the `set_bit` uses `or` instruction. + +That's all. Now we can set and clear bit in any bit array and and we can go to other operations on bitmasks. + +Most widely used operations on a bit arrays are set and clear bit in a bit array in the Linux kernel. But besides this operations it is useful to do additional operations on a bit array. Yet another widely used operation in the Linux kernel - is to know is a given bit set or not in a bit array. We can achieve this with the help of the `test_bit` macro. This macro is defined in the [arch/x86/include/asm/bitops.h](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) header file and expands to the call of the `constant_test_bit` or `variable_test_bit` depends on bit number: + +```C +#define test_bit(nr, addr) \ + (__builtin_constant_p((nr)) \ + ? constant_test_bit((nr), (addr)) \ + : variable_test_bit((nr), (addr))) +``` + +So, if the `nr` is known in compile time constant, the `test_bit` will be expanded to the call of the `constant_test_bit` function or `variable_test_bit` in other case. Now let's look at implementations of these functions. Let's start from the `variable_test_bit`: + +```C +static inline int variable_test_bit(long nr, volatile const unsigned long *addr) +{ + int oldbit; + + asm volatile("bt %2,%1\n\t" + "sbb %0,%0" + : "=r" (oldbit) + : "m" (*(unsigned long *)addr), "Ir" (nr)); + + return oldbit; +} +``` + +The `variable_test_bit` function takes similar set of arguments as `set_bit` and other function take. We also may see inline assembly code here which executes [bt](http://x86.renejeschke.de/html/file_module_x86_id_22.html) and [sbb](http://x86.renejeschke.de/html/file_module_x86_id_286.html) instruction. The `bt` or `bit test` instruction selects a given bit which is specified with first operand from the bit array which is specified with the second operand and stores its value in the [CF](https://en.wikipedia.org/wiki/FLAGS_register) bit of flags register. The second `sbb` instruction substracts first operand from second and subscrtact value of the `CF`. So, here write a value of a given bit number from a given bit array to the `CF` bit of flags register and execute `sbb` instruction which calculates: `00000000 - CF` and writes the result to the `oldbit`. + +The `constant_test_bit` function does the same as we saw in the `set_bit`: + +```C +static __always_inline int constant_test_bit(long nr, const volatile unsigned long *addr) +{ + return ((1UL << (nr & (BITS_PER_LONG-1))) & + (addr[nr >> _BITOPS_LONG_SHIFT])) != 0; +} +``` + +It generates a byte where high bit is `1` and other bits are `0` (as we saw in `CONST_MASK`) and applies bitwise [and](https://en.wikipedia.org/wiki/Bitwise_operation#AND) to the byte which contains a given bit number. + +The next widely used bit array related operation is to change bit in a bit array. The Linux kernel provides two helper for this: + +* `__change_bit`; +* `change_bit`. + +As you already can guess, these two variants are atomic and non-atomic as for example `set_bit` and `__set_bit`. For the start, let's look at the implementation of the `__change_bit` function: + +```C +static inline void __change_bit(long nr, volatile unsigned long *addr) +{ + asm volatile("btc %1,%0" : ADDR : "Ir" (nr)); +} +``` + +Pretty easy, is not it? The implementation of the `__change_bit` is the same as `__set_bit`, but instead of `bts` instruction, we are using [btc](http://x86.renejeschke.de/html/file_module_x86_id_23.html). This instruction selects a given bit from a given bit array, stores its value in the `CF` and changes its value by the applying of complement operation. So, a bit with value `1` will be `0` and vice versa: + +```python +>>> int(not 1) +0 +>>> int(not 0) +1 +``` + +The atomic version of the `__change_bit` is the `change_bit` function: + +```C +static inline void change_bit(long nr, volatile unsigned long *addr) +{ + if (IS_IMMEDIATE(nr)) { + asm volatile(LOCK_PREFIX "xorb %1,%0" + : CONST_MASK_ADDR(nr, addr) + : "iq" ((u8)CONST_MASK(nr))); + } else { + asm volatile(LOCK_PREFIX "btc %1,%0" + : BITOP_ADDR(addr) + : "Ir" (nr)); + } +} +``` + +It is similar on `set_bit` function, but also has two differences. The first difference is `xor` operation instead of `or` and the second is `bts` instead of `bts`. + +For this moment we know the most important architecture-specific operations with bit arrays. Time to look at generic bitmap API. + +Common bit operations +================================================================================ + +Besides the architecture-specific API from the [arch/x86/include/asm/bitops.h](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) header file, the Linux kernel provides common API for manipulation of bit arrays. As we know from the beginning of this part, we can find it in the [include/linux/bitmap.h](https://github.com/torvalds/linux/blob/master/include/linux/bitmap.h) header file and additionally in the * [lib/bitmap.c](https://github.com/torvalds/linux/blob/master/lib/bitmap.c) source code file. But before these source code files let's look into the [include/linux/bitops.h](https://github.com/torvalds/linux/blob/master/include/linux/bitops.h) header file which provides a set of useful macro. Let's look on some of they. + +First of all let's look at following four macros: + +* `for_each_set_bit` +* `for_each_set_bit_from` +* `for_each_clear_bit` +* `for_each_clear_bit_from` + +All of these macros provide iterator over certain set of bits in a bit array. The first macro iterates over bits which are set, the second does the same, but starts from a certain bits. The last two macros do the same, but iterates over clear bits. Let's look on implementation of the `for_each_set_bit` macro: + +```C +#define for_each_set_bit(bit, addr, size) \ + for ((bit) = find_first_bit((addr), (size)); \ + (bit) < (size); \ + (bit) = find_next_bit((addr), (size), (bit) + 1)) +``` + +As we may see it takes three arguments and expands to the loop from first set bit which is returned as result of the `find_first_bit` function and to the last bit number while it is less than given size. + +Besides these four macros, the [arch/x86/include/asm/bitops.h](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) provides API for rotation of `64-bit` or `32-bit` values and etc. + +The next [header](https://github.com/torvalds/linux/blob/master/include/linux/bitmap.h) file which provides API for manipulation with a bit arrays. For example it provdes two functions: + +* `bitmap_zero`; +* `bitmap_fill`. + +To clear a bit array and fill it with `1`. Let's look on the implementation of the `bitmap_zero` function: + +```C +static inline void bitmap_zero(unsigned long *dst, unsigned int nbits) +{ + if (small_const_nbits(nbits)) + *dst = 0UL; + else { + unsigned int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long); + memset(dst, 0, len); + } +} +``` + +First of all we can see the check for `nbits`. The `small_const_nbits` is macro which defined in the same header [file](https://github.com/torvalds/linux/blob/master/include/linux/bitmap.h) and looks: + +```C +#define small_const_nbits(nbits) \ + (__builtin_constant_p(nbits) && (nbits) <= BITS_PER_LONG) +``` + +As we may see it checks that `nbits` is known constant in compile time and `nbits` value does not overflow `BITS_PER_LONG` or `64`. If bits number does not overflow amount of bits in a `long` value we can just set to zero. In other case we need to calculate how many `long` values do we need to fill our bit array and fill it with [memset](http://man7.org/linux/man-pages/man3/memset.3.html). + +The implementation of the `bitmap_fill` function is similar on implementation of the `biramp_zero` function, except we fill a given bit array with `0xff` values or `0b11111111`: + +```C +static inline void bitmap_fill(unsigned long *dst, unsigned int nbits) +{ + unsigned int nlongs = BITS_TO_LONGS(nbits); + if (!small_const_nbits(nbits)) { + unsigned int len = (nlongs - 1) * sizeof(unsigned long); + memset(dst, 0xff, len); + } + dst[nlongs - 1] = BITMAP_LAST_WORD_MASK(nbits); +} +``` + +Besides the `bitmap_fill` and `bitmap_zero` functions, the [include/linux/bitmap.h](https://github.com/torvalds/linux/blob/master/include/linux/bitmap.h) header file provides `bitmap_copy` which is similar on the `bitmap_zero`, but just uses [memcpy](http://man7.org/linux/man-pages/man3/memcpy.3.html) instead of [memset](http://man7.org/linux/man-pages/man3/memset.3.html). Also it provides bitwise operations for bit array like `bitmap_and`, `bitmap_or`, `bitamp_xor` and etc. We will not consider implementation of these functions because it is easy to understand implementations of these functions if you understood all from this part. Anyway if you are interested how did these function implemented, you may open [include/linux/bitmap.h](https://github.com/torvalds/linux/blob/master/include/linux/bitmap.h) header file and start to research. + +That's all. + +Links +================================================================================ + +* [bitmap](https://en.wikipedia.org/wiki/Bit_array) +* [linked data structures](https://en.wikipedia.org/wiki/Linked_data_structure) +* [tree data structures](https://en.wikipedia.org/wiki/Tree_%28data_structure%29) +* [hot-plug](https://www.kernel.org/doc/Documentation/cpu-hotplug.txt) +* [cpumasks](https://0xax.gitbooks.io/linux-insides/content/Concepts/cpumask.html) +* [IRQs](https://en.wikipedia.org/wiki/Interrupt_request_%28PC_architecture%29) +* [API](https://en.wikipedia.org/wiki/Application_programming_interface) +* [atomic operations](https://en.wikipedia.org/wiki/Linearizability) +* [xchg instruction](http://x86.renejeschke.de/html/file_module_x86_id_328.html) +* [cmpxchg instruction](http://x86.renejeschke.de/html/file_module_x86_id_41.html) +* [lock instruction](http://x86.renejeschke.de/html/file_module_x86_id_159.html) +* [bts instruction](http://x86.renejeschke.de/html/file_module_x86_id_25.html) +* [btr instruction](http://x86.renejeschke.de/html/file_module_x86_id_24.html) +* [bt instruction](http://x86.renejeschke.de/html/file_module_x86_id_22.html) +* [sbb instruction](http://x86.renejeschke.de/html/file_module_x86_id_286.html) +* [btc instruction](http://x86.renejeschke.de/html/file_module_x86_id_23.html) +* [man memcpy](http://man7.org/linux/man-pages/man3/memcpy.3.html) +* [man memset](http://man7.org/linux/man-pages/man3/memset.3.html) +* [CF](https://en.wikipedia.org/wiki/FLAGS_register) +* [inline assembler](https://en.wikipedia.org/wiki/Inline_assembler) +* [gcc](https://en.wikipedia.org/wiki/GNU_Compiler_Collection) + + +------------------------------------------------------------------------------ + +via: https://github.com/0xAX/linux-insides/blob/master/DataStructures/bitmap.md + +作者:[0xAX][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://twitter.com/0xAX From b4cfdcb0bf910cdf7a6c640363bf8fad411d1c46 Mon Sep 17 00:00:00 2001 From: Ezio Date: Tue, 17 May 2016 13:30:29 +0800 Subject: [PATCH 0769/1469] =?UTF-8?q?=E5=B7=B2=E6=A0=A1=E5=AF=B9=20?= =?UTF-8?q?=E2=80=9D5=20memory=20debuggers=20for=20Linux=20coding=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ew--5 memory debuggers for Linux coding.md | 113 +++++++++--------- 1 file changed, 56 insertions(+), 57 deletions(-) diff --git a/translated/talk/20151124 Review--5 memory debuggers for Linux coding.md b/translated/talk/20151124 Review--5 memory debuggers for Linux coding.md index 2335222ac8..424d91bba4 100644 --- a/translated/talk/20151124 Review--5 memory debuggers for Linux coding.md +++ b/translated/talk/20151124 Review--5 memory debuggers for Linux coding.md @@ -1,38 +1,38 @@ 点评:Linux编程中五款内存调试器 ================================================================================ ![](http://images.techhive.com/images/article/2015/11/penguinadmin-2400px-100627186-primary.idge.jpg) -Credit: [Moini][1] +>Credit: [Moini][1] -作为一个程序员,我知道我总在犯错误——事实是,怎么可能会不犯错的!程序员也是人啊。有的错误能在编码过程中及时发现,而有些却得等到软件测试才显露出来。然而,还有一类错误并不能在这两个时期被排除,从而导致软件不能正常运行,甚至是提前中止。 +作为一个程序员,我知道我肯定会犯错误——怎么可能不犯错!程序员也是人啊。有的错误能在编码过程中及时发现,而有些却得等到软件测试了才能显露出来。然而,还有一类错误并不能在这两个阶段被解决,这就导致软件不能正常运行,甚至是提前终止。 -想到了吗?我说的就是内存相关的错误。手动调试这些错误不仅耗时,而且很难发现并纠正。值得一提的是,这种错误非常常见,特别是在用 C/C++ 这类允许[手动管理内存][2]的语言编写的软件里。 +如果你还没猜出是那种错误,我说的就是和内存相关的错误。手动调试这些错误不仅耗时,而且很难发现并纠正。值得一提的是,这种错误很常见,特别是在用 C/C++ 这类允许[手动管理内存][2]的语言编写的软件里。 -幸运的是,现行有一些编程工具能够帮你找到软件程序中这些内存相关的错误。在这些工具集中,我评定了五款Linux可用的,流行、免费并且开源的内存调试器: Dmalloc 、 Electric Fence 、 Memcheck 、 Memwatch 以及 Mtrace 。在日常编码中,我已经把这五个调试器用了个遍,所以这些点评是建立在我的实际体验之上的。 +幸运的是,现行有一些编程工具能够帮你在软件程序中咋猴岛这些和内存相关的错误。在这些工具集中,我评估了五款 Linux 下可用的,流行、免费并且开源的内存调试器: Dmalloc 、 Electric Fence 、 Memcheck 、 Memwatch 以及 Mtrace 。在日常编码中,我已经用过这五个调试器了,所以这些评估是建立在我的实际体验之上的。 ### [Dmalloc][3] ### **开发者**:Gray Watson -**点评版本**:5.5.2 +**评估版本**:5.5.2 -**支持的 Linux**:所有种类 +**支持的 Linux 版本**:所有种类 -**许可**:知识共享署名-相同方式共享许可证 3.0 +**许可**: CC 3.0 -Dmalloc 是 Gray Watson 开发的一款内存调试工具。它实现成库,封装了标准内存管理函数如 *malloc() , calloc() , free()* 等,使程序员得以检测出有问题的代码。 +Dmalloc 是 Gray Watson 开发的一款内存调试工具。它是作为库来实现的,封装了标准内存管理函数如 *malloc() , calloc() , free()* 等,使程序员得以检测出有问题的代码。 ![cw dmalloc output](http://images.techhive.com/images/article/2015/11/cw_dmalloc-output-100627040-large.idge.png) Dmalloc -如同工具的网页所列,这个调试器提供的特性包括内存泄漏跟踪、[重复释放(double free)][4]错误跟踪、以及[越界写入(fence-post write)][5]检测。其它特性包括文件/行号报告、普通统计记录。 +如同工具的网页所示,这个调试器提供的特性包括内存泄漏跟踪、[重复释放内存(double free)][4]错误跟踪、以及[越界写入(fence-post write)][5]检测。其它特性包括报告错误的文件/行号、通用的数据统计记录。 #### 更新内容 #### -5.5.2 版本是一个 [bug 修复发行版][6],同时修复了构建和安装的问题。 +5.5.2 版本是一个 [bug 修正发行版][6],修复了几个有关构建和安装的问题。 #### 有何优点 #### -Dmalloc 最大的优点就是高度可配置性。比如说,你可以配置以支持 C++ 程序和多线程应用。 Dmalloc 还提供一个有用的功能:运行时可配置,这表示在 Dmalloc 执行时,可以轻易地使能或者禁能它提供的特性。 +Dmalloc 最大的优点就是高度可配置性。比如说,你可以配置以支持 C++ 程序和多线程应用。 Dmalloc 还提供一个有用的功能:运行时可配置,这表示在 Dmalloc 执行时,可以轻易地使能或者禁能它提供的一些特性。 你还可以配合 [GNU Project Debugger (GDB)][7]来使用 Dmalloc ,只需要将 *dmalloc.gdb* 文件(位于 Dmalloc 源码包中的 contrib 子目录里)的内容添加到你的主目录中的 *.gdbinit* 文件里即可。 @@ -42,7 +42,7 @@ Dmalloc 最大的优点就是高度可配置性。比如说,你可以配置以 跟 Mtrace 一样, Dmalloc 需要程序员改动他们的源代码。比如说你可以(必须的)添加头文件 *dmalloc.h* ,工具就能汇报产生问题的调用的文件或行号。这个功能非常有用,因为它节省了调试的时间。 -除此之外,还需要在编译你的程序时,把 Dmalloc 库(编译源码包时产生的)链接进去。 +除此之外,还需要在编译你的程序时,把 Dmalloc 库(编译 Dmalloc 源码包时产生的)链接进去。 然而,还有点更麻烦的事,需要设置一个环境变量,命名为 *DMALLOC_OPTION* ,以供工具在运行时配置内存调试特性,以及输出文件的路径。可以手动为该环境变量分配一个值,不过初学者可能会觉得这个过程有点困难,因为该值的一部分用来表示要启用的 Dmalloc 特性——表示为各自的十六进制值的累加。[这里][9]有详细介绍。 @@ -56,19 +56,18 @@ Dmalloc 真正的优势在于它的可配置选项。而且高度可移植,曾 **开发者**:Bruce Perens -**点评版本**:2.2.3 +**评估版本**:2.2.3 -**支持的 Linux**:所有种类 +**支持的 Linux 版本**:所有种类 -**许可**:GNU 通用公共许可证 (第二版) +**许可**:GPL v2 -Electric Fence 是 Bruce Perens 开发的一款内存调试工具,它以库的形式实现,你的程序需要链接它。Electric Fence 能检测出[栈][11]内存溢出和访问已经释放的内存。 +Electric Fence 是 Bruce Perens 开发的一款内存调试工具,它以库的形式实现,你的程序需要链接它。Electric Fence 能检测出[堆][11]内存溢出和访问已经释放的内存。 ![cw electric fence output](http://images.techhive.com/images/article/2015/11/cw_electric-fence-output-100627041-large.idge.png) Electric Fence -顾名思义, Electric Fence 在每个申请的缓存边界建立了 virtual fence(虚拟围栏),任何非法内存访问都会导致[段错误][12]。这个调试工具同时支持 C 和 C++ 程序。 - +顾名思义, Electric Fence 在每个申请的缓存边界建立了虚拟围栏,这样以来任何非法的内存访问都会导致[段错误][12]。这个调试工具同时支持 C 和 C++ 程序。 #### 更新内容 #### @@ -76,19 +75,19 @@ Electric Fence #### 有何优点 #### -我喜欢 Electric Fence 首要的一点是它(不同于 Memwatch 、 Dmalloc 和 Mtrace ,)不需要你的源码做任何的改动,你只需要在编译的时候把它的库链接进你的程序即可。 +我喜欢 Electric Fence 的首要一点是它不同于 Memwatch 、 Dmalloc 和 Mtrace ,不需要堆你的源码做任何的改动,你只需要在编译的时候把它的库链接进你的程序即可。 -其次, Electric Fence 的实现保证了导致越界访问( a bounds violation )的第一个指令就是引起段错误的原因。这比在后面再发现问题要好多了。 +其次, Electric Fence 的实现保证了产生越界访问的第一个指令就会引起段错误。这比在后面再发现问题要好多了。 不管是否有检测出错误, Electric Fence 都会在输出产生版权信息。这一点非常有用,由此可以确定你所运行的程序已经启用了 Electric Fence 。 #### 注意事项 #### -另一方面,我对 Electric Fence 真正念念不忘的是它检测内存泄漏的能力。内存泄漏是 C/C++ 软件最常见也是最难隐秘的问题之一。不过, Electric Fence 不能检测出堆内存溢出,而且也不是线程安全的。 +另一方面,我对 Electric Fence 真正念念不忘的是它检测内存泄漏的能力。内存泄漏是 C/C++ 软件最常见也是最不容易发现的问题之一。不过, Electric Fence 不能检测出栈溢出,而且也不是线程安全的。 由于 Electric Fence 会在用户分配内存区的前后分配禁止访问的虚拟内存页,如果你过多的进行动态内存分配,将会导致你的程序消耗大量的额外内存。 -Electric Fence 还有一个局限是不能明确指出错误代码所在的行号。它所能做只是在监测到内存相关错误时产生段错误。想要定位行号,需要借助 [The Gnu Project Debugger ( GDB )][14]这样的调试工具来调试启用了 Electric Fence 的程序。 +Electric Fence 还有一个局限是不能明确指出错误代码所在的行号。它所能做只是在检测到内存相关错误时产生段错误。想要定位错误的行号,需要借助 [GDB][14]这样的调试工具来调试启用了 Electric Fence 的程序。 最后一点,尽管 Electric Fence 能检测出大部分的缓冲区溢出,有一个例外是,如果所申请的缓冲区大小不是系统字长的倍数,这时候溢出(即使只有几个字节)就不能被检测出来。 @@ -101,50 +100,50 @@ Electric Fence 还有一个局限是不能明确指出错误代码所在的行 **开发者**:[Valgrind 开发团队][17] -**点评版本**:3.10.1 +**评估版本**:3.10.1 -**支持的 Linux**:所有种类 +**支持的 Linux 发行版**:所有种类 -**许可**:通用公共许可证 +**许可**:GPL -[Valgrind][18] 是一个提供好几款调试和 Linux 程序性能分析工具的套件。虽然 Valgrind 能和编写语言各不相同(有 Java 、 Perl 、 Python 、 Assembly code 、 ortran 、 Ada等等)的程序配合工作,但是它所提供的工具主要针对用 C/C++ 所编写的程序。 +[Valgrind][18] 是一个提供好几款调试和分析 Linux 程序性能的工具套件。虽然 Valgrind 能和不同语言——Java 、 Perl 、 Python 、 Assembly code 、 ortran 、 Ada 灯——编写的程序一起工作,但是它主要还针对使用 C/C++ 所编写的程序。 -Memcheck ,一款内存错误检测器,是其中最受欢迎的工具。它能够检测出如内存泄漏、无效的内存访问、未定义变量的使用以及栈内存分配和释放相关的问题等诸多问题。 +Memcheck ,一款内存错误检测器,是其中最受欢迎的工具。它能够检测出如内存泄漏、无效的内存访问、未定义变量的使用以及堆内存分配和释放相关的问题等诸多问题。 #### 更新内容 #### -工具套件( 3.10.1 )的[发行版][19]是一个副版本,主要修复了 3.10.0 版本发现的 bug 。除此之外,从主版本向后移植(标音: backport )一些包,修复了缺失的 AArch64 ARMv8 指令和系统调用。 +[工具套件( 3.10.1 )][19]主要修复了 3.10.0 版本发现的 bug 。除此之外,从主版本向后移植一些包,修复了缺失的 AArch64 ARMv8 指令和系统调用。 -#### 有何优点 #### +#### 有何优点 #### -同其它所有 Valgrind 工具一样, Memcheck 也是命令行实用程序。它的操作非常简单:通常我们会使用诸如 prog arg1 arg2 格式的命令来运行程序,而 Memcheck 只要求你多加几个值即可,如 valgrind --leak-check=full prog arg1 arg2 。 +同其它所有 Valgrind 工具一样, Memcheck 也是命令行程序。它的操作非常简单:通常我们会使用诸如 `prog arg1 arg2` 格式的命令来运行程序,而 Memcheck 只要求你多加几个值即可,如 `valgrind --leak-check=full prog arg1 arg2` 。 ![cw memcheck output](http://images.techhive.com/images/article/2015/11/cw_memcheck-output-100627037-large.idge.png) Memcheck -(注意:因为 Memcheck 是 Valgrind 的默认工具所以无需提及 Memcheck。但是,需要在编译程序之初带上 -g 参数选项,这一步会添加调试信息,使得 Memcheck 的错误信息会包含正确的行号。) +(注意:因为 Memcheck 是 Valgrind 的默认工具所以在命令行执行命令时无需提及 Memcheck。但是,需要在编译程序之初带上 `-g` 参数选项,这一步会添加调试信息,使得 Memcheck 的错误信息会包含正确的行号。) 我真正倾心于 Memcheck 的是它提供了很多命令行选项(如上所述的 *--leak-check* 选项),如此不仅能控制工具运转还可以控制它的输出。 举个例子,可以开启 *--track-origins* 选项,以查看程序源码中未初始化的数据;可以开启 *--show-mismatched-frees* 选项让 Memcheck 匹配内存的分配和释放技术。对于 C 语言所写的代码, Memcheck 会确保只能使用 *free()* 函数来释放内存, *malloc()* 函数来申请内存。而对 C++ 所写的源码, Memcheck 会检查是否使用了 *delete* 或 *delete[]* 操作符来释放内存,以及 *new* 或者*new[]* 来申请内存。 -Memcheck 最好的特点,尤其是对于初学者来说,是它会给用户建议使用哪个命令行选项能让输出更加有意义。比如说,如果你不使用基本的 *--leak-check* 选项, Memcheck 会在输出时建议“使用 --leak-check=full 重新运行以查看更多泄漏内存细节”。如果程序有未初始化的变量, Memcheck 会产生信息“使用 --track-origins=yes 以查看未初始化变量的定位”。 +Memcheck 最好的特点,尤其是对于初学者来说,是它会给用户建议使用哪个命令行选项能让输出更加有意义。比如说,如果你不使用基本的 *--leak-check* 选项, Memcheck 会在输出时给出建议:“使用 --leak-check=full 重新运行以查看更多泄漏内存细节”。如果程序有未初始化的变量, Memcheck 会产生信息:“使用 --track-origins=yes 以查看未初始化变量的定位”。 -Memcheck 另外一个有用的特性是它可以[创建抑制文件( suppression files )][20],由此可以忽略特定不能修正的错误,这样 Memcheck 运行时就不会每次都报警了。值得一提的是, Memcheck 会去读取默认抑制文件来忽略系统库(比如 C 库)中的报错,这些错误在系统创建之前就已经存在了。可以选择创建一个新的抑制文件,或是编辑现有的文件(通常是*/usr/lib/valgrind/default.supp*)。 +Memcheck 另外一个有用的特性是它可以[创建抑制文件( suppression files )][20],由此可以略过特定的不能修正的错误,这样 Memcheck 运行时就不会每次都报警了。值得一提的是, Memcheck 会去读取默认抑制文件来忽略系统库(比如 C 库)中的报错,这些错误在系统创建之前就已经存在了。可以选择创建一个新的抑制文件,或是编辑现有的文件(通常是*/usr/lib/valgrind/default.supp*)。 Memcheck 还有高级功能,比如可以使用[定制内存分配器][22]来[检测内存错误][21]。除此之外, Memcheck 提供[监控命令][23],当用到 Valgrind 内置的 gdbserver ,以及[客户端请求][24]机制(不仅能把程序的行为告知 Memcheck ,还可以进行查询)时可以使用。 #### 注意事项 #### -毫无疑问, Memcheck 可以节省很多调试时间以及省去很多麻烦。但是它使用了很多内存,导致程序执行变慢([由文档可知][25],大概花上 20 至 30 倍时间)。 +毫无疑问, Memcheck 可以节省很多调试时间以及省去很多麻烦。但是它使用了很多内存,导致程序执行变慢([由文档可知][25],大概会花费 20 至 30 倍时间)。 -除此之外, Memcheck 还有其它局限。根据用户评论, Memcheck 明显不是[线程安全][26]的;它不能检测出 [静态缓冲区溢出][27];还有就是,一些 Linux 程序如 [GNU Emacs][28] 目前还不能使用 Memcheck 。 +除此之外, Memcheck 还有其它局限。根据用户评论, Memcheck 很明显不是[线程安全][26]的;它不能检测出 [静态缓冲区溢出][27];还有就是,一些 Linux 程序如 [GNU Emacs][28] 目前还不能配合 Memcheck 工作。 -如果有兴趣,可以在[这里][29]查看 Valgrind 详尽的局限性说明。 +如果有兴趣,可以在[这里][29]查看 Valgrind 局限性的详细说明。 #### 总结 #### -无论是对于初学者还是那些需要高级特性的人来说, Memcheck 都是一款便捷的内存调试工具。如果你仅需要基本调试和错误核查, Memcheck 会非常容易上手。而当你想要使用像抑制文件或者监控指令这样的特性,就需要花一些功夫学习了。 +无论是对于初学者还是那些需要高级特性的人来说, Memcheck 都是一款便捷的内存调试工具。如果你仅需要基本调试和错误检查, Memcheck 会非常容易上手。而当你想要使用像抑制文件或者监控指令这样的特性,就需要花一些功夫学习了。 虽然罗列了大量的局限性,但是 Valgrind(包括 Memcheck )在它的网站上声称全球有[成千上万程序员][30]使用了此工具。开发团队称收到来自超过 30 个国家的用户反馈,而这些用户的工程代码有的高达 2.5 千万行。 @@ -152,13 +151,13 @@ Memcheck 还有高级功能,比如可以使用[定制内存分配器][22]来[ **开发者**:Johan Lindh -**点评版本**:2.71 +**评估版本**:2.71 -**支持的 Linux**:所有种类 +**支持的 Linux 发行版**:所有种类 -**许可**:GNU通用公共许可证 +**许可**:GNU GPL -Memwatch 是由 Johan Lindh 开发的内存调试工具,虽然它主要扮演内存泄漏检测器的角色,但是(根据网页介绍)它也具有检测其它如[重复释放跟踪和内存错误释放][32]、缓冲区溢出和下溢、[野指针][33]写入等等内存相关问题的能力。 +Memwatch 是由 Johan Lindh 开发的内存调试工具,虽然它扮演的主要角色是内存泄漏检测器,但是(根据网页介绍)它也具有检测其它如[内存重复释放和错误释放][32]、缓冲区溢出和下溢、[野指针][33]写入等等内存相关问题的能力。 Memwatch 支持用 C 语言所编写的程序。也可以在 C++ 程序中使用它,但是这种做法并不提倡(由 Memwatch 源码包随附的 Q&A 文件中可知)。 @@ -173,7 +172,7 @@ Memwatch 支持用 C 语言所编写的程序。也可以在 C++ 程序中使用 ![cw memwatch output](http://images.techhive.com/images/article/2015/11/cw_memwatch_output-100627038-large.idge.png) Memwatch -不同于 Mtrace , Memwatch 的输出产生的日志文件(通常是 *memwatch.log* )是人类可阅读格式。而且, Memwatch 每次运行时总会拼接内存调试输出到文件末尾。如此便可在需要之时,轻松查看之前的输出信息。 +不同于 Mtrace , Memwatch 产生的日志文件(通常是 *memwatch.log* )是人类可阅读的格式。而且, Memwatch 每次运行时总会把内存调试结果拼接到输出文件的末尾。如此便可在需要之时轻松查看之前的输出信息。 同样值得一提的是当你执行了启用 Memwatch 的程序, Memwatch 会在[标准输出][34]中产生一个单行输出,告知发现了错误,然后你可以在日志文件中查看输出细节。如果没有产生错误信息,就可以确保日志文件不会写入任何错误,多次运行的话确实能节省时间。 @@ -183,7 +182,7 @@ Memwatch 跟 Mtrace 和 Dmalloc 一样, Memwatch 也需要你往你的源文件里增加代码:你需要把 *memwatch.h* 这个头文件包含进你的代码。而且,编译程序的时候,你需要连同 *memwatch.c* 一块编译;或者你可以把已经编译好的目标模块包含起来,然后在命令行定义 *MEMWATCH* 和 *MW_STDIO* 变量。不用说,想要在输出中定位行号, -g 编译器选项也少不了。 -此外, Memwatch 缺少一些特性。比如 Memwatch 不能检测出往一块已经被释放的内存写入操作,或是在分配的内存块之外的读取操作。而且, Memwatch 也不是线程安全的。还有一点,正如我在开始时指出,在 C++ 程序上运行 Memwatch 的结果是不能预料的。 +此外, Memwatch 缺少一些特性。比如 Memwatch 不能检测出对一块已经被释放的内存进行写入操作,或是在分配的内存块之外的进行读取操作。而且, Memwatch 也不是线程安全的。还有一点,正如我在开始时指出,在 C++ 程序上运行 Memwatch 的结果是不能预料的。 #### 总结 #### @@ -191,20 +190,20 @@ Memcheck 可以检测很多内存相关的问题,在处理 C 程序时是非 ### [Mtrace][35] ### -**开发者**: Roland McGrath and Ulrich Drepper +**开发者**: Roland McGrath 和 Ulrich Drepper -**点评版本**: 2.21 +**评估版本**: 2.21 -**支持的 Linux**:所有种类 +**支持的 Linux 发行版**:所有种类 -**许可**:GNU 通用公共许可证 +**许可**:GNU GPL -Mtrace 是 [GNU C 库][36]中的一款内存调试工具,同时支持 Linux 上的 C 和 C++ 程序,检测由 *malloc()* 和 *free()* 函数的不对等调用所引起的内存泄漏问题。 +Mtrace 是 [GNU C 库][36]中的一款内存调试工具,同时支持 Linux 上的 C 和 C++ 程序,可以检测由函数 *malloc()* 和 *free()* 不匹配的调用所引起的内存泄漏问题。 ![cw mtrace output](http://images.techhive.com/images/article/2015/11/cw_mtrace-output-100627039-large.idge.png) Mtrace -Mtrace 实现为对 *mtrace()* 函数的调用,跟踪程序中所有 malloc/free 调用,并在用户指定的文件中记录相关信息。文件以一种机器可读的格式记录数据,所以有一个 Perl 脚本(同样命名为 mtrace )用来把文件转换并展示为人类可读格式。 +Mtrace 的实现实际上是 *mtrace()* 函数,它可以跟踪程序中所有 malloc/free 调用,并在用户指定的文件中记录相关信息。文件以一种机器可读的格式记录数据,所以有一个 Perl 脚本——同样命名为 mtrace ——用来把文件转换并为人类可读格式。 #### 更新内容 #### @@ -212,21 +211,21 @@ Mtrace 实现为对 *mtrace()* 函数的调用,跟踪程序中所有 malloc/fr #### 有何优点 #### -Mtrace 最优秀的特点是非常简单易学。你只需要了解在你的源码中如何以及何处添加mtrace()及其对立的muntrace()函数,还有如何使用Mtrace的Perl脚本。后者非常简单,只需要运行指令 *mtrace *(例子见开头截图最后一条指令)。 +Mtrace 最好的地方是它非常简单易学。你只需要了解在你的源码中如何以及何处添加 mtrace() 及对应的 muntrace() 函数,还有如何使用 Mtrace 的 Perl 脚本。后者非常简单,只需要运行指令 *mtrace *(例子见开头截图最后一条指令)。 -Mtrace 另外一个优点是它的可收缩性,体现在,不仅可以使用它来调试完整的程序,还可以使用它来检测程序中独立模块的内存泄漏。只需在每个模块里调用 *mtrace()* 和 *muntrace()* 即可。 +Mtrace 另外一个优点是它的可收缩性,这体现在不仅可以使用它来调试完整的程序,还可以使用它来检测程序中独立模块的内存泄漏。只需在每个模块里调用 *mtrace()* 和 *muntrace()* 即可。 -最后一点,因为 Mtrace 会在 *mtace()*(在源码中添加的函数)执行时被触发,因此可以很灵活地[使用信号][39]动态地(在程序执行周期内)使能 Mtrace 。 +最后一点,因为 Mtrace 会在 *mtrace()*——在源码中添加的函数——执行时被触发,因此可以很灵活地[使用信号][39]动态地(在程序执行时)使能 Mtrace 。 #### 注意事项 #### -因为 *mtrace()* 和 *mauntrace()* 函数(声明在 *mcheck.h* 文件中,所以必须在源码中包含此头文件)的调用是 Mtrace 运行( *mauntrace()* 函数并非[总是必要][40])的根本,因此 Mtrace 要求程序员至少改动源码一次。 +因为 *mtrace()* 和 *mauntrace()* 函数 —— 声明在 *mcheck.h* 文件中,所以必须在源码中包含此头文件 —— 的调用是 Mtrace 工作的基础运行( *mauntrace()* 函数并非[总是必要][40]),因此 Mtrace 要求程序员至少改动源码一次。 -需要注意的是,在编译程序的时候带上 -g 选项( [GCC][41] 和 [G++][42] 编译器均有提供),才能使调试工具在输出展示正确的行号。除此之外,有些程序(取决于源码体积有多大)可能会花很长时间进行编译。最后,带 -g 选项编译会增加了可执行文件的内存(因为提供了额外的调试信息),因此记得程序需要在测试结束后,不带 -g 选项重新进行编译。 +需要注意的是,在编译程序的时候带上 -g 选项( [GCC][41] 和 [G++][42] 编译器均有提供),才能使调试工具在输出结果时展示正确的行号。除此之外,有些程序(取决于源码体积有多大)可能会花很长时间进行编译。最后,带 -g 选项编译会增加了可执行文件的大小(因为提供了额外的调试信息),因此记得程序需要在测试结束后,不带 -g 选项重新进行编译。 -使用 Mtrace ,你需要掌握 Linux 环境变量的基本知识,因为在程序执行之前,需要把用户指定的文件( *mtrace()* 函数将会记录全部信息到其中)路径设置为环境变量 *MALLOC_TRACE* 的值。 +使用 Mtrace ,你需要掌握 Linux 环境变量的基本知识,因为在程序执行之前,需要把用户把环境变量 *MALLOC_TRACE* 的值设为指定的文件( *mtrace()* 函数将会记录全部信息到其中)路径。 -Mtrace 在检测内存泄漏和尝试释放未经过分配的内存方面存在局限。它不能检测其它内存相关问题如非法内存访问、使用未初始化内存。而且,[有人抱怨][43] Mtrace 不是[线程安全][44]的。 +Mtrace 在检测内存泄漏和试图释放未经过分配的内存方面存在局限。它不能检测其它内存相关问题如非法内存访问、使用未初始化内存。而且,[有人抱怨][43] Mtrace 不是[线程安全][44]的。 ### 总结 ### @@ -248,7 +247,7 @@ via: http://www.computerworld.com/article/3003957/linux/review-5-memory-debugger 作者:[Himanshu Arora][a] 译者:[soooogreen](https://github.com/soooogreen) -校对:[PurlingNayuki](https://github.com/PurlingNayuki) +校对:[PurlingNayuki](https://github.com/PurlingNayuki),[ezio](https://github.com/oska874) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a852300d1755bcbb6dd8a6de65cad62d3e36d683 Mon Sep 17 00:00:00 2001 From: martin qi Date: Tue, 17 May 2016 22:51:09 +0800 Subject: [PATCH 0770/1469] Update and rename sources/talk/my-open-source-story/20160429 Why and how I became a software engineer.md to translated/talk/my-open-source-story/20160429 Why and how I became a software engineer.md --- ...hy and how I became a software engineer.md | 103 ------------------ ...hy and how I became a software engineer.md | 101 +++++++++++++++++ 2 files changed, 101 insertions(+), 103 deletions(-) delete mode 100644 sources/talk/my-open-source-story/20160429 Why and how I became a software engineer.md create mode 100644 translated/talk/my-open-source-story/20160429 Why and how I became a software engineer.md diff --git a/sources/talk/my-open-source-story/20160429 Why and how I became a software engineer.md b/sources/talk/my-open-source-story/20160429 Why and how I became a software engineer.md deleted file mode 100644 index 0fb8b3d549..0000000000 --- a/sources/talk/my-open-source-story/20160429 Why and how I became a software engineer.md +++ /dev/null @@ -1,103 +0,0 @@ -translating by martin2011qi - -Why and how I became a software engineer -========================================== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/myopensourcestory.png?itok=6TXlAkFi) - -The year was 1989. The city was Kampala, Uganda. - -In their infinite wisdom, my parents decided that instead of all the troublemaking I was getting into at home, they would send me off to my uncle's office to learn how to use a computer. A few days later, I found myself on the 21st floor in a cramped room with six or seven other teens and a brand new computer on a desk perpendicular to the teacher's desk. It was made abundantly clear that we were not skilled enough to touch it. After three frustrating weeks of writing and perfecting DOS commands, the magic moment happened. It was my turn to type **copy doc.txt d:**. - -The alien scratching noises that etched a simple text file onto the five-inch floppy sounded like beautiful music. For a while, that floppy disk was my most prized possession. I copied everything I could onto it. However, in 1989, Ugandans tended to take life pretty seriously, and messing around with computers, copying files, and formatting disks did not count as serious. I had to focus on my education, which led me away from computer science and into architectural engineering. - -Like any young person of my generation, a multitude of job titles and skills acquisition filled the years in between. I taught kindergarten, taught adults how to use software, worked in a clothing store, and served as a paid usher in a church. While I earned my degree at the University of Kansas, I worked as a tech assistant to the technical administrator, which is really just a fancy title for someone who messes around with the student database. - -By the time I graduated in 2007, technology had become inescapable. Every aspect of architectural engineering was deeply intertwined with computer science, so we all inadvertently learned simple programming skills. For me, that part was always more fascinating. But because I had to be a serious engineer, I developed a secret hobby: writing science fiction. - -In my stories, I lived vicariously through the lives of my heroines. They were scientists with amazing programming skills who were always getting embroiled in adventures and fighting tech scallywags with technology they invented, sometimes inventing them on the spot. Sometimes the new tech I came up with was based on real-world inventions. Other times it was the stuff I read about or saw in the science fiction I consumed. This meant that I had to understand how the tech worked and my research led me to some interesting subreddits and e-zines. - -### Open source: The ultimate goldmine - -Throughout my experiences, the fascinating weeks I'd spent writing out DOS commands remained a prominent influence, bleeding into little side projects and occupying valuable study time. As soon as Geocities became available to all Yahoo! Users, I created a website where I published blurry pictures that I'd taken on a tiny digital camera. I created websites for free, helped friends and family fix issues they had with their computers, and created a library database for a church. - -This meant that I was always researching and trying to find more information about how things could be made better. The Internet gods blessed me and open source fell into my lap. Suddenly, 30-day trials and restrictive licenses became a ghost of computing past. I could continue to create using GIMP, Inkscape, and OpenOffice. - -### Time to get serious - -I was fortunate to have a business partner who saw the magic in my stories. She too is a dreamer and visionary who imagines a better connected world that functions efficiently and conveniently. Together, we came up with several solutions to pain points we experienced in the journey to success, but implementation had been a problem. We both lacked the skills to make our products come to life, something that was made evident every time we approached investors with our ideas. - -We needed to learn to program. So, at the end of the summer in 2015, we embarked on a journey that would lead us right to the front steps of Holberton School, a community-driven, project-based school in San Francisco. - -My business partner came to me one morning and started a conversation the way she does when she has a new crazy idea that I'm about to get sucked into. - -**Zee**: Gloria, I'm going to tell you something and I want you to listen first before you say no. - -**Me**: No. - -**Zee**: We're going to be applying to go to a school for full-stack engineers. - -**Me**: What? - -**Zee**: Here, look! We're going to learn how to program by applying to this school. - -**Me**: I don't understand. We're doing online courses in Python and... - -**Zee**: This is different. Trust me. - -**Me**: What about the... - -**Zee**: That's not trusting me. - -**Me**: Fine. Show me. - -### Removing the bias - -What I read sounded similar to something we had seen online. It was too good to be true, but we decided to give it a try, jump in with both feet, and see what would come out of it. - -To become students, we had to go through a four-step selection process based solely on talent and motivation, not on the basis of educational degree or programming experience. The selection process is the beginning of the curriculum, so we started learning and collaborating through it. - -It has been my experience—and that of my business partner—that the process of applying for anything was an utter bore compared to the application process Holberton School created. It was like a game. If you completed a challenge, you got to go to the next level, where another fascinating challenge awaited. We created Twitter accounts, blogged on Medium, learned HTML and CSS in order to create a website, and created a vibrant community online even before we knew who was going to get to go. - -The most striking thing about the online community was how varied our experience with computers was, and how our background and gender did not factor into the choices that were being made by the founders (who we secretly called "The Trinity"). We just enjoyed being together and talking to each other. We were all smart people on a journey to increasing our nerd cred by learning how to code. - -For much of the application process, our identities were not very evident. For example, my business partner's name does not indicate her gender or race. It was during the final step, a video chat, that The Trinity even knew she was a woman of color. Thus far, only her enthusiasm and talent had propelled her through the levels. The color of her skin and her gender did not hinder nor help her. How cool is that? - -The night we got our acceptance letters, we knew our lives were about to change in ways we had only dreamt of. On the 22nd of January 2016, we walked into 98 Battery Street to meet our fellow [Hippokampoiers][2] for the first time. It was evident then, as it had been before, that the Trinity had started something amazing. They had assembled a truly diverse collection of passionate and enthusiastic people who had dedicated themselves to become full-stack engineers. - -The school is an experience like no other. Every day is an intense foray into some facet of programming. We're handed a project and, with a little guidance, we use every resource available to us to find the solution. The premise that [Holberton School][1] is built upon is that information is available to us in more places than we've ever had before. MOOCs, tutorials, the availability of open source software and projects, and online communities are all bursting at the seams with knowledge that shakes up some of the projects we have to complete. And with the support of the invaluable team of mentors to guide us to solutions, the school becomes more than just a school; we've become a community of learners. I would highly recommend this school for anyone who is interested in software engineering and is also interested in the learning style. The next class is in October 2016 and is accepting new applications. It's both terrifying and exhilarating, but so worth it. - -### Open source matters - -My earliest experience with an open source operating system was [Fedora][3], a [Red Hat][4]-sponsored project. During a panicked conversation with an IRC member, she recommended this free OS. I had never installed my own OS before, but it sparked my interest in open source and my dependence on open source software for my computing needs. We are advocates for open source contribution, creation, and use. Our projects are on GitHub where anyone can use or contribute to them. We also have the opportunity to access existing open source projects to use or contribute to in our own way. Many of the tools that we use at school are open source, such as Fedora, [Vagrant][5], [VirtualBox][6], [GCC][7], and [Discourse][8], to name a few. - -As I continue on my journey to becoming a software engineer, I still dream of a time when I will be able to contribute to the open source community and be able to share my knowledge with others. - -### Diversity Matters - -Standing in the room and talking to 29 other bright-eyed learners was intoxicating. 40% of the people there were women and 44% were people of color. These numbers become very important when you are a woman of color in a field that has been famously known for its lack of diversity. It was an oasis in the tech Mecca of the world. I knew I had arrived. - -The notion of becoming a full-stack engineer is daunting, and you may even struggle to know what that means. It is a challenging road to travel with immeasurable rewards to reap. The future is run by technology, and you are an important part of that bright future. While the media continues to trip over handling the issue of diversity in tech companies, know that whoever you are, whatever your background is, whatever your reasons might be for becoming a full-stack engineer, you can find a place to thrive. - -But perhaps most importantly, a strong reminder of the role of women in the history of computing can help more women return to the tech world, and they can be fully engaged without hesitation due to their gender or their capabilities as women. Their talents will help shape the future not just of tech, but of the world. - - ------------------------------------------------------------------------------- - -via: https://opensource.com/life/16/4/my-open-source-story-gloria-bwandungi - -作者:[Gloria Bwandungi][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/nappybrain -[1]: https://www.holbertonschool.com/ -[2]: https://twitter.com/hippokampoiers -[3]: https://en.wikipedia.org/wiki/Fedora_(operating_system) -[4]: https://www.redhat.com/ -[5]: https://www.vagrantup.com/ -[6]: https://www.virtualbox.org/ -[7]: https://gcc.gnu.org/ -[8]: https://www.discourse.org/ diff --git a/translated/talk/my-open-source-story/20160429 Why and how I became a software engineer.md b/translated/talk/my-open-source-story/20160429 Why and how I became a software engineer.md new file mode 100644 index 0000000000..2e024c33bf --- /dev/null +++ b/translated/talk/my-open-source-story/20160429 Why and how I became a software engineer.md @@ -0,0 +1,101 @@ +我成为一名软件工程师的原因和经历 +========================================== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/myopensourcestory.png?itok=6TXlAkFi) + +1989 年乌干达首都,坎帕拉。 + +赞美我的父母,他们机智的把我送到叔叔的办公室,去学着用电脑,而非将我留在家里添麻烦。几日后,我和另外六、七个小孩,还有一台放置在与讲台相垂直课桌子上的崭新电脑,一起置身于 21 层楼高的狭小房间中。很明显我们还不够格去碰那家伙。在长达三周无趣的 DOS 命令学习后,终于迎来了这美妙的时光。终于轮到我来输 **copy doc.txt d:** 了。 + +那奇怪的声音其实是将一个简单文件写入五英寸软盘的声音,但听起来却像音乐般美妙。那段时间,这块软盘简直成为了我的至宝。我把所有我可以拷贝的东西都放在上面了。然而,1989 年的乌干达,人们的生活十分正经,相较而言捣鼓电脑,拷贝文件还有格式化磁盘就称不上正经。我不得不专注于自己的学业,这让我离开了计算机科学走入了建筑工程学。 + +在这些年里,我和同龄人一样,干过很多份工作也学到了许多技能。我教过幼儿园的小朋友,也教过大人如何使用软件,在服装店工作过,还在教堂中担任过付费招待。在我获取堪萨斯大学的学位时,我正在技术高管的手下做技术助理,其实也就听上去比较洋气,也就是搞搞学生数据库而已。 + +当我 2007 年毕业时,这些技术已经变得不可或缺。建筑工程学的方方面面都与计算机科学深深的交织在一起,所以我们也都在不经意间也都学了些简单的编程知识。我对于这方面一直很着迷。但由于我不得不成为一位正经的工程师,所以我发展了一项私人爱好:写科幻小说。 + +在我的故事中,我以我笔下的女英雄的形式存在。她们都是编程能力出众的科学家,总是在冒险的途中用自己的技术发明战胜那些渣渣们,有时发明要在战斗中进行。我想出的这些“新技术”,一般基于真实世界中的发明。也有些是从买来的科幻小说中读到的。这就意味着我需要了解这些技术的原理,而且我的研究使我有意无意的关注了许多有趣的 subreddit 和电子杂志 + +### 开源:巨大的宝库 + +在我的经历中,那几周花在 DOS 命令上的时间仍然记忆犹新,在一些偏门的项目上耗费心血,并占据了宝贵的学习时间。Geocities 一向所有 Yahoo! 用户开放,我就创建了一个网站,用于发布一些由我用小型数码相机拍摄的个人图片。这个网站是我随性而为的,用来帮助家人和朋友,解决一些他们所遇到的电脑问题。同时也为教堂搭建了一个图书馆数据库。 + +这意味着,我需要一直研究并尝试获取更多的信息,使它们变得更棒。上帝保佑,让互联网和开源砸在了我的面前。然后,30 天试用和 license 限制对我而言就变成了过去式。我可以完全不受这些限制,持续的使用 GIMP、Inkscape 和 OpenOffice。 + +### 是时候正经了 + +我很幸运,有商业伙伴看出了我故事中的奇妙。她也是个想象力丰富的人,对更高效、更便捷的互联这个世界,充满了各种美好的想法。我们根据我们以往成功道路中经历的痛点制定了解决方案,但执行却成了一个问题。我们都缺乏那种将产品带入生活的能力,每当我们试图将想法带到投资人面前时,都表现的尤为突出。 + +我们需要学习编程。所以在 2015 年的夏末,我们踏上了征途,来到了 Holberton 学校的阶前。那是一所座落于旧金山由社区推进,基于项目教学的学校。 + +我的商业伙伴一天早上找到我,并开始了一段充满她方式的对话,每当她有疯狂想法想要拉我入伙时。 + +**Zee**: Gloria,我想和你说点事,在拒绝前能先听我说完吗? + +**Me**: 不行。 + +**Zee**: 我们想要申请一所学校的全栈工程师。 + +**Me**: 什么? + +**Zee**: 就是这,看!就是这所学校,我们要申请这所学校学习编程。 + +**Me**: 我不明白。我们不是正在网上学 Python 和… + +**Zee**: 这不一样。相信我。 + +**Me**: 那… + +**Zee**: 还不相信吗? + +**Me**: 好吧…我看看。 + +### 抛开偏见 + +我看到的和我们在网上听说的几乎差不多。这简直太棒了,以至于让人觉得不太真实,但我们还是决定尝试一下,双脚起跳,看看结果如何。 + +要成为学生,我们需要经历四个步骤,仅仅是针对才能和态度,无关学历和编程经历的筛选。筛选便是课程的开始,通过它我们开始学习与合作。 + +根据我和我合作伙伴的经验,相比 Holberton 学校的申请流程,其他的申请流程实在是太无聊了。就像场游戏。如果你完成了一项挑战,你就能通往下一关,在那里有别的有趣的挑战正等着你。我们创建了 Twitter 账号,在 Medium 上写博客,为了创建网站而学习 HTML 和 CSS, 打造了一个充满活力的社区,虽然在此之前我们并不知晓有谁会来。 + +在线社区最吸引人的就是我们使用电脑的经验是多种多样的,而我们的背景和性别并非创始人(我们私下里称他为“The Trinity(三位一体)”)做出选择的因素。大家只是喜欢聚在一块交流。我们都是通过学习编程来提升自己计算机技术的聪明人。 + +相较于其他的的申请流程,我们不需要泄露很多的身份信息。就像我的商业伙伴,她的名字里看不出她的性别和种族。直到最后一个步骤,在视频聊天的时候, The Trinity 才知道她是一位有色人种女性。迄今为止,促使她达到这个程度的只是她的热情和才华。肤色和性别,并没有妨碍或者帮助到她。还有比这更酷的吗? + +那个我们获得录取通知书的晚上,我们知道我们的命运已经改变,我们获得了原先梦寐以求的生活。2016 年 1 月 22 日,我们来到北至巴特瑞大街 98 号,去见我们的小伙伴 [Hippokampoiers][2],这是我们的初次见面。很明显,在见面之前,“The Trinity”就已经开始做一些令人激动的事了。他们已经聚集了一批形形色色的人,他们都专注于成为全栈工程师,并为之乐此不疲。 + +这所大学有种与众不同的体验。感觉每天都是向编程的一次竭力的冲锋。我们着手的工程,并不会有很多指导,我们需要使用一切我们可以使用的资源找出解决方案。[Holberton 学校][1] 的办学宗旨便是向学员提供,相较于我们已知而言,更为多样的信息渠道。MOOCs(大型开放式课程)、教程、可用的开源软件和项目,以及线上社区层出不穷,将我们完成项目所需要的知识全都衔接了起来。加之宝贵的导师团队来指导我们制定解决方案,这所学校变得并不仅仅是一所学校;我们已经成为了求学者的社区。任何对软件工程感兴趣并对这种学习方法感兴趣的人,我都十分推荐这所学校。下次开课在 2016 年 10 月,并且会接受新的申请。虽然会让人有些悲喜交加,但是那真的很值得。 + +### 开源问题 + +我最早使用的开源系统是 [Fedora][3],一个 [Red Hat][4] 赞助的项目。在与 IRC 中一名成员一番惊慌失措的交流后,她推荐了这款免费的系统。 虽然在此之前,我还未独自安装过操作系统,但是这激起了我对开源的兴趣和日常使用计算机时对开源软件的依赖性。我们提倡为开源贡献代码,创造并使用开源的项目。我们的项目就在 Github 上,任何人都可以使用或是向它贡献出自己的力量。我们也会使用或以自己的方式为一些既存的开源项目做出贡献。在学校里,我们使用的大部分工具是开源的,例如 Fedora、[Vagrant][5]、[VirtualBox][6]、[GCC][7] 和 [Discourse][8],仅举几例。 + +重回软件工程师之路以后,我始终憧憬着有这样一个时刻——能为开源社区做出一份贡献,能与他人分享我所掌握的知识。 + +### Diversity Matters + +站在教室里,在着 29 双明亮的眼睛关注下交流心得,真是令人陶醉。学员中有 40% 是女性,有 44% 的有色人种。当你是一位有色人种且为女性,并身处于这个以缺乏多样而著名的领域时,这些数字就变得非常重要了。那是高科技圣地麦加上的绿洲。我知道我做到了。 + +想要成为一个全栈的工程师是十分困难的,你甚至很难了解这意味着什么。这是一条充满挑战的路途,道路四周布满了对收获的未知。科技推动着未来飞速发展,而你也是美好未来很重要的一部分。虽然媒体在持续的关注解决科技公司的多样化的问题,但是如果能认清自己,了解自己,知道自己为什么想成为一名全栈工程师,这样你便能觅得一处生根发芽。 + +不过可能最重要的是,提醒人们女性在计算机的发展史上扮演着多么重要的角色,以帮助更多的女性回归到科技界,并使她们充满期待,而非对自己的性别与能力感到犹豫。她们的才能将会描绘出不仅仅是科技的未来,而是整个世界的未来。 + + +------------------------------------------------------------------------------ + +via: https://opensource.com/life/16/4/my-open-source-story-gloria-bwandungi + +作者:[Gloria Bwandungi][a] +译者:[martin2011qi](https://github.com/martin2011qi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/nappybrain +[1]: https://www.holbertonschool.com/ +[2]: https://twitter.com/hippokampoiers +[3]: https://en.wikipedia.org/wiki/Fedora_(operating_system) +[4]: https://www.redhat.com/ +[5]: https://www.vagrantup.com/ +[6]: https://www.virtualbox.org/ +[7]: https://gcc.gnu.org/ +[8]: https://www.discourse.org/ From 401da5a979504f8e68ddfa64375430352d42f98f Mon Sep 17 00:00:00 2001 From: Purling Nayuki Date: Tue, 17 May 2016 23:11:31 +0800 Subject: [PATCH 0771/1469] Proofread Part 2 - LXD 2.0--Installing and configuring LXD --- ...LXD 2.0--Installing and configuring LXD.md | 80 +++++++++---------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/translated/tech/LXD/Part 2 - LXD 2.0--Installing and configuring LXD.md b/translated/tech/LXD/Part 2 - LXD 2.0--Installing and configuring LXD.md index 3464cd07eb..fe386f3229 100644 --- a/translated/tech/LXD/Part 2 - LXD 2.0--Installing and configuring LXD.md +++ b/translated/tech/LXD/Part 2 - LXD 2.0--Installing and configuring LXD.md @@ -1,4 +1,4 @@ -Part 2 - LXD 2.0: 安装与配置 +Part 2 - LXD 2.0: 安装与配置 ================================================= 这是 LXD 2.0 [系列介绍文章][2]的第二篇。 @@ -7,19 +7,19 @@ Part 2 - LXD 2.0: 安装与配置 ### 安装篇 -获得 LXD 有很多种办法。我们推荐你是用配合最新版的 LXC 和 Linux 内核使用 LXD,这样就可以享受到它的全部特性,但是注意,我们现在也在慢慢的降低对旧版本 Linux 发布版的支持。 +有很多种办法可以获得 LXD。我们推荐你配合最新版的 LXC 和 Linux 内核使用 LXD,这样就可以享受到它的全部特性。需要注意的是,我们现在也在慢慢的降低对旧版本 Linux 发布版的支持。 #### Ubuntu 标准版 所有新发布的 LXD 都会在发布几分钟后上传到 Ubuntu 开发版的安装源里。这个安装包然后就会当作种子给全部其他的安装包源,供 Ubuntu 用户使用。 -如果使用 Ubuntu 16.04 则可以直接安装: +如果使用 Ubuntu 16.04,可以直接安装: ``` sudo apt install lxd ``` -如果运行的是 Ubuntu 14.04,可以这样安装: +如果运行的是 Ubuntu 14.04,则可以这样安装: ``` sudo apt -t trusty-backports install lxd @@ -27,15 +27,15 @@ sudo apt -t trusty-backports install lxd #### Ubuntu Core -使用Ubuntu Core 稳定版的用户可以使用下面的命令安装 LXD: +使用 Ubuntu Core 稳定版的用户可以使用下面的命令安装 LXD: ``` sudo snappy install lxd.stgraber ``` -#### ubuntu 官方 PPA +#### Ubuntu 官方 PPA -是哟个其他 Ubuntu 发布版 —— 比如 Ubuntu 15.10 —— 的用户可以添加下面的 PPA (Personal Package Archive) 来安装: +使用其他 Ubuntu 发布版 —— 比如 Ubuntu 15.10 —— 的用户可以添加下面的 PPA(Personal Package Archive)来安装: ``` sudo apt-add-repository ppa:ubuntu-lxc/stable @@ -46,23 +46,23 @@ sudo apt install lxd #### Gentoo -Gentoo 已经有了最新的 LXD 安装包,你可以直接安装: +Gentoo 已经有了最新的 LXD 包,你可以直接安装: ``` sudo emerge --ask lxd ``` -#### 源代码 +#### 使用源代码安装 -如果你曾经编译过 Go 工程,那么从源代码编译 LXD 并不是十分困难。然而要住你的是你需要 LXC 的开发头文件。为了运行 LXD , 你的 发布版铜须也需要使用比较新的内核(最起码是 3.13),比较新的 LXC (1.1.4 或更高版本) ,LXCFS 以及支持用户子 uid/gid 分配的 shadow 。 +如果你曾经编译过 Go 语言的项目,那么从源代码编译 LXD 并不是十分困难。然而注意,你需要 LXC 的开发头文件。为了运行 LXD, 你的发布版需也要使用比较新的内核(最起码是 3.13)、比较新的 LXC (1.1.4 或更高版本)、LXCFS 以及支持用户子 uid/gid 分配的 shadow。 -从源代码编译 LXD 的最新指令可以在[上游 README][2]里找到。 +从源代码编译 LXD 的最新教程可以在[上游 README][2]里找到。 -### ubuntu 上的网络配置 +### Ubuntu 上的网络配置 -Ubuntu 的安装包会很方便的给你提供一个 "lxdbr0" 网桥。这个网桥默认是没有配置过的,只提供通过 HTTP 代理的 IPV6 的本地连接。 +Ubuntu 的安装包会很方便的给你提供一个“lxdbr0”网桥。这个网桥默认是没有配置过的,只提供通过 HTTP 代理的 IPv6 的本地连接。 -要配置这个网桥和添加 IPV4 、 IPV6 子网,你可以运行下面的命令: +要配置这个网桥并添加 IPv4 、 IPv6 子网,你可以运行下面的命令: ``` sudo dpkg-reconfigure -p medium lxd @@ -74,15 +74,15 @@ sudo dpkg-reconfigure -p medium lxd sudo lxd init ``` -### 存储系统 +### 存储后端 -LXD 提供了集中存储后端。在开始使用 LXD 之前,你最好直到自己想要的后端,因为我们不支持在后端之间迁移已经生成的容器。 +LXD 提供了许多集中存储后端。在开始使用 LXD 之前,你应该决定将要使用的后端,因为我们不支持在后端之间迁移已经生成的容器。 -各个[后端特性的比较表格][3]可以在这里找到。 +各个[后端特性比较表][3]可以在[这里][3]找到。 #### ZFS -我们的推荐是 ZFS , 因为他能支持 LXD 的全部特性,同时提供最快和最可靠的容器体验。它包括了以容器为单位的磁盘配额,直接快照和恢复,优化了的迁移(发送/接收),以及快速从镜像创建容器。它同时也被认为要比 btrfs 更成熟。 +我们的推荐是 ZFS, 因为它能支持 LXD 的全部特性,同时提供最快和最可靠的容器体验。它包括了以容器为单位的磁盘配额,即时快照和恢复,优化了的迁移(发送/接收),以及快速从镜像创建容器的能力。它同时也被认为要比 btrfs 更成熟。 要和 LXD 一起使用 ZFS ,你需要首先在你的系统上安装 ZFS。 @@ -98,7 +98,7 @@ sudo apt install zfsutils-linux sudo apt install zfsutils-linux zfs-dkms ``` -如果是更旧的版本,你需要这样安装: +如果是更旧的版本,你需要从 zfsonlinux PPA 安装: ``` sudo apt-add-repository ppa:zfs-native/stable @@ -106,27 +106,27 @@ sudo apt update sudo apt install ubuntu-zfs ``` -配置 LXD 只需要简单的执行下面的命令: +配置 LXD 只需要执行下面的命令: ``` sudo lxd init ``` -这条命令接下来会想你提问一下你想要的 ZFS 的配置,然后为你配置好 ZFS 。 +这条命令接下来会向你提问一下一些 ZFS 的配置细节,然后为你配置好 ZFS。 #### btrfs -如果 ZFS 不可用,那么 btrfs 可以提供相同级别的集成,除了不会合理的报告容器内的磁盘使用情况(虽然配额还是可以用的)。 +如果 ZFS 不可用,那么 btrfs 可以提供相同级别的集成,但不会合理地报告容器内的磁盘使用情况(虽然配额仍然可用)。 -btrfs 同时拥有很好的嵌套属性,而这时 ZFS 所不具有的。也就是说如果你计划在 LXD 中再使用 LXD ,那么 btrfs 就很值得你考虑一下。 +btrfs 同时拥有很好的嵌套属性,而这是 ZFS 所不具有的。也就是说如果你计划在 LXD 中再使用 LXD,那么 btrfs 就很值得你考虑。 -使用 btrfs 的话,LXD 不需要进行任何的配置,你只需要保证 `/var/lib/lxd` 是保存在 btrfs 文件系统中,然后 LXD 就会自动为你使用 btrfs 了。 +使用 btrfs 的话,LXD 不需要进行任何的配置,你只需要保证 `/var/lib/lxd` 保存在 btrfs 文件系统中,然后 LXD 就会自动为你使用 btrfs 了。 #### LVM -如果 ZFS 和 btrfs 都不是你想要的,你仍然可以考虑使用 LVM。 LXD 会以自动精简配置的方式使用 LVM,为每个镜像和容器创建 LV,如果需要的话也会使用 LVM 的快照功能。 +如果 ZFS 和 btrfs 都不是你想要的,你还可以考虑使用 LVM 以获得部分特性。 LXD 会以自动精简配置的方式使用 LVM,为每个镜像和容器创建 LV,如果需要的话也会使用 LVM 的快照功能。 -要配置 LXD 使用 LVM,需要创建一个 LVM 的 VG ,然后运行: +要配置 LXD 使用 LVM,需要创建一个 LVM VG,然后运行: ``` @@ -141,9 +141,9 @@ lxc config set storage.lvm_fstype xfs #### 简单目录 -如果上面全部方案你都不打算使用, LXD 还可以工作,但是不会使用任何高级特性。它只会为每个容器创建一个目录,然后在创建每个容器时解压缩镜像的压缩包,在容器拷贝和快照时会进行一次完整的文件系统拷贝。 +如果上面全部方案你都不打算使用,LXD 依然能在不使用任何高级特性情况下工作。它会为每个容器创建一个目录,然后在创建每个容器时解压缩镜像的压缩包,并在容器拷贝和快照时进行一次完整的文件系统拷贝。 -除了磁盘配额以外的特性都是支持的,但是很浪费磁盘空间,并且非常慢。如果你没有其他选择,这还是可以工作的,但是你还是需要认真的考虑一下上面的几个方案。 +除了磁盘配额以外的特性都是支持的,但是很浪费磁盘空间,并且非常慢。如果你没有其他选择,这还是可以工作的,但是你还是需要认真的考虑一下上面的几个替代方案。 ### 配置篇 @@ -151,7 +151,7 @@ LXD 守护进程的完整配置项列表可以在[这里找到][4]。 #### 网络配置 -默认情况下 LXD 不会监听网络。和它通信的唯一办法是使用本地 unix socket 通过 `/var/lib/lxd/unix.socket` 进行通信。 +默认情况下 LXD 不会监听网络。和它通信的唯一办法是通过 `/var/lib/lxd/unix.socket` 使用本地 unix socket 进行通信。 要让 LXD 监听网络,下面有两个有用的命令: @@ -160,11 +160,11 @@ lxc config set core.https_address [::] lxc config set core.trust_password some-secret-string ``` -第一条命令将 LXD 绑定到 IPV6 地址 “::”,也就是监听机器的所有 IPV6 地址。你可以显式的使用一个特定的 IPV4 或者 IPV6 地址替代默认地址,如果你想绑定 TCP 端口(默认是 8443)的话可以在地址后面添加端口号即可。 +第一条命令将 LXD 绑定到 IPv6 地址 “::”,也就是监听机器的所有 IPv6 地址。你可以显式的使用一个特定的 IPv4 或者 IPv6 地址替代默认地址,如果你想绑定 TCP 端口(默认是 8443)的话可以在地址后面添加端口号即可。 -第二条命令设置了密码,可以让远程客户端用来把自己添加到 LXD 可信证书中心。如果已经给主机设置了密码,当添加 LXD 主机时会提示输入密码, LXD 守护进程会保存他们的客户端的证书以确保客户端是可信的,这样就不需要再次输入密码(可以随时设置和取消) +第二条命令设置了密码,用于让远程客户端用来把自己添加到 LXD 可信证书中心。如果已经给主机设置了密码,当添加 LXD 主机时会提示输入密码,LXD 守护进程会保存他们的客户端的证书以确保客户端是可信的,这样就不需要再次输入密码(可以随时设置和取消)。 -你也可以选择不设置密码,然后通过给每个客户端发送 "client.crt" (来自于 `~/.config/lxc`)文件,然后把它添加到你自己的可信中信来实现人工验证每个新客户端是否可信,可以使用下面的命令: +你也可以选择不设置密码,然后通过给每个客户端发送“client.crt”(来自于 `~/.config/lxc`)文件,然后把它添加到你自己的可信中信来实现人工验证每个新客户端是否可信,可以使用下面的命令: ``` lxc config trust add client.crt @@ -172,9 +172,9 @@ lxc config trust add client.crt #### 代理配置 -In most setups, you’ll want the LXD daemon to fetch images from remote servers. +大多数情况下,你会想让 LXD 守护进程从远程服务器上获取镜像。 -If you are in an environment where you must go through a HTTP(s) proxy to reach the outside world, you’ll want to set a few configuration keys or alternatively make sure that the standard PROXY environment variables are set in the daemon’s environment. +如果你处在一个必须通过 HTTP(s) 代理链接外网的环境下,你需要对 LXD 做一些配置,或保证已在守护进程的环境中设置正确的 PROXY 环境变量。 ``` lxc config set core.proxy_http http://squid01.internal:3128 @@ -182,11 +182,11 @@ lxc config set core.proxy_https http://squid01.internal:3128 lxc config set core.proxy_ignore_hosts image-server.local ``` -With those, all transfers initiated by LXD will use the squid01.internal HTTP proxy, except for traffic to the server at image-server.local +以上代码使所有 LXD 发起的数据传输都使用 squid01.internal HTTP 代理,但与在 image-server.local 的服务器的数据传输则是例外。 #### 镜像管理 -LXD 使用动态镜像缓存。当从远程镜像创建容器的时候,它会自动把镜像下载到本地镜像商店,同时标志为已缓存并记录来源。几天后(默认10天)如果没有再被使用,那么这个镜像就会自动被删除。每个几小时(默认是6小时) LXD 还会检查一下这个镜像是否有新版本,然后更新镜像的本地拷贝。 +LXD 使用动态镜像缓存。当从远程镜像创建容器的时候,它会自动把镜像下载到本地镜像商店,同时标志为已缓存并记录来源。几天后(默认 10 天)如果某个镜像没有被使用过,那么它就会自动地被删除。每个几小时(默认是 6 小时)LXD 还会检查一下这个镜像是否有新版本,然后更新镜像的本地拷贝。 所有这些都可以通过下面的配置选项进行配置: @@ -196,12 +196,12 @@ lxc config set images.auto_update_interval 24 lxc config set images.auto_update_cached false ``` -这些命令让 LXD 修改了它的默认属性,缓存期替换为 5 天,更新间隔为 24 小时,而且只更新那些标志为自动更新的镜像(lxc 镜像拷贝有标志 `–auto-update`)而不是 LXD 自动缓存的镜像。 +这些命令让 LXD 修改了它的默认属性,缓存期替换为 5 天,更新间隔为 24 小时,而且只更新那些标记为自动更新的镜像(lxc 镜像拷贝被标记为 `–auto-update`)而不是 LXD 自动缓存的镜像。 ### 总结 -到这里为止,你就应该有了一个可以工作的、最新版的 LXD ,现在你可以开始用 LXD 了,或者等待我们的下一条博文,那时我们会介绍如何创建第一个容器以及使用 LXD 命令行工具操作容器。 +到这里为止,你就应该有了一个可以工作的、最新版的 LXD,现在你可以开始用 LXD 了,或者等待我们的下一篇博文,我们会在其中介绍如何创建第一个容器以及使用 LXD 命令行工具操作容器。 ### 额外信息 @@ -213,7 +213,7 @@ LXD 的邮件列表: LXD 的 IRC 频道: #lxcontainers on irc.freenode.net -如果你不想或者不能在你的机器上安装 LXD ,你可以[试试在线版的 LXD][1] 。 +如果你不想或者不能在你的机器上安装 LXD ,你可以[试试在线版的 LXD][1]。 -------------------------------------------------------------------------------- @@ -221,7 +221,7 @@ via: https://www.stgraber.org/2016/03/15/lxd-2-0-installing-and-configuring-lxd- 作者:[Stéphane Graber][a] 译者:[ezio](https://github.com/oska874) -校对:[校对者ID](https://github.com/校对者ID) +校对:[PurlingNayuki](https://github.com/PurlingNayuki) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 917ea80685819b39438194574ed4de9f170024b1 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 18 May 2016 08:59:30 +0800 Subject: [PATCH 0772/1469] PUB:20151123 Data Structures in the Linux Kernel @cposture @tinyeyeser --- ...123 Data Structures in the Linux Kernel.md | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) rename {translated/tech => published}/20151123 Data Structures in the Linux Kernel.md (75%) diff --git a/translated/tech/20151123 Data Structures in the Linux Kernel.md b/published/20151123 Data Structures in the Linux Kernel.md similarity index 75% rename from translated/tech/20151123 Data Structures in the Linux Kernel.md rename to published/20151123 Data Structures in the Linux Kernel.md index 899a69af3d..d46d4293c4 100644 --- a/translated/tech/20151123 Data Structures in the Linux Kernel.md +++ b/published/20151123 Data Structures in the Linux Kernel.md @@ -1,4 +1,4 @@ -Linux内核中的数据结构 —— 基数树 +Linux 内核里的数据结构 —— 基数树 ================================================================================ 基数树 Radix tree @@ -11,35 +11,35 @@ Linux内核中的数据结构 —— 基数树 让我们先说说什么是 `基数树` 吧。基数树是一种 `压缩的字典树 (compressed trie)` ,而[字典树](http://en.wikipedia.org/wiki/Trie)是实现了关联数组接口并允许以 `键值对` 方式存储值的一种数据结构。这里的键通常是字符串,但可以使用任意数据类型。字典树因为它的节点而与 `n叉树` 不同。字典树的节点不存储键,而是存储单个字符的标签。与一个给定节点关联的键可以通过从根遍历到该节点获得。举个例子: ``` -               +-----------+ -               |           | -               |    " "    | + +-----------+ | | -        +------+-----------+------+ -        |                         | -        |                         | -   +----v------+            +-----v-----+ -   |           |            |           | -   |    g      |            |     c     | + | " " | + | | + +------+-----------+------+ + | | + | | + +----v------+ +-----v-----+ | | | | -   +-----------+            +-----------+ -        |                         | -        |                         | -   +----v------+            +-----v-----+ -   |           |            |           | -   |    o      |            |     a     | + | g | | c | | | | | -   +-----------+            +-----------+ -                                  | -                                  | -                            +-----v-----+ -                            |           | -                            |     t     | + +-----------+ +-----------+ + | | + | | + +----v------+ +-----v-----+ + | | | | + | o | | a | + | | | | + +-----------+ +-----------+ + | + | + +-----v-----+ | | -                            +-----------+ + | t | + | | + +-----------+ ``` -因此在这个例子中,我们可以看到一个有着两个键 `go` 和 `cat` 的 `字典树` 。压缩的字典树或者说 `基数树` ,它和 `字典树` 的不同之处在于,所有只有一个孩子的中间节点都被删除。 +因此在这个例子中,我们可以看到一个有着两个键 `go` 和 `cat` 的 `字典树` 。压缩的字典树也叫做 `基数树` ,它和 `字典树` 的不同之处在于,所有只有一个子节点的中间节点都被删除。 Linux 内核中的基数树是把值映射到整形键的一种数据结构。[include/linux/radix-tree.h](https://github.com/torvalds/linux/blob/master/include/linux/radix-tree.h)文件中的以下结构体描述了基数树: @@ -86,10 +86,10 @@ struct radix_tree_node { unsigned long tags[RADIX_TREE_MAX_TAGS][RADIX_TREE_TAG_LONGS]; }; ``` -这个结构体包含的信息有父节点中的偏移以及到底端(叶节点)的高度、孩子节点的个数以及用于访问和释放节点的字段成员。这些字段成员描述如下: +这个结构体包含的信息有父节点中的偏移以及到底端(叶节点)的高度、子节点的个数以及用于访问和释放节点的字段成员。这些字段成员描述如下: * `path` - 父节点中的偏移和到底端(叶节点)的高度 -* `count` - 孩子节点的个数; +* `count` - 子节点的个数; * `parent` - 父节点指针; * `private_data` - 由树的用户使用; * `rcu_head` - 用于释放节点; @@ -188,9 +188,9 @@ unsigned int radix_tree_gang_lookup(struct radix_tree_root *root, -------------------------------------------------------------------------------- -via: https://github.com/0xAX/linux-insides/edit/master/DataStructures/radix-tree.md +via: https://github.com/0xAX/linux-insides/blob/master/DataStructures/radix-tree.md -作者:[0xAX] +作者:0xAX 译者:[cposture](https://github.com/cposture) 校对:[Mr小眼儿](https://github.com/tinyeyeser) From 6a60da452fde75eae9c17deab9be738cc2f7e039 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 18 May 2016 09:43:40 +0800 Subject: [PATCH 0773/1469] PUB:20151124 Review--5 memory debuggers for Linux coding @soooogreen @PurlingNayuki @oska874 --- ...ew--5 memory debuggers for Linux coding.md | 78 ++++++++++--------- 1 file changed, 41 insertions(+), 37 deletions(-) rename {translated/talk => published}/20151124 Review--5 memory debuggers for Linux coding.md (74%) diff --git a/translated/talk/20151124 Review--5 memory debuggers for Linux coding.md b/published/20151124 Review--5 memory debuggers for Linux coding.md similarity index 74% rename from translated/talk/20151124 Review--5 memory debuggers for Linux coding.md rename to published/20151124 Review--5 memory debuggers for Linux coding.md index 424d91bba4..4c2e8373a0 100644 --- a/translated/talk/20151124 Review--5 memory debuggers for Linux coding.md +++ b/published/20151124 Review--5 memory debuggers for Linux coding.md @@ -1,4 +1,4 @@ -点评:Linux编程中五款内存调试器 +点评五款用于 Linux 编程的内存调试器 ================================================================================ ![](http://images.techhive.com/images/article/2015/11/penguinadmin-2400px-100627186-primary.idge.jpg) >Credit: [Moini][1] @@ -7,7 +7,7 @@ 如果你还没猜出是那种错误,我说的就是和内存相关的错误。手动调试这些错误不仅耗时,而且很难发现并纠正。值得一提的是,这种错误很常见,特别是在用 C/C++ 这类允许[手动管理内存][2]的语言编写的软件里。 -幸运的是,现行有一些编程工具能够帮你在软件程序中咋猴岛这些和内存相关的错误。在这些工具集中,我评估了五款 Linux 下可用的,流行、免费并且开源的内存调试器: Dmalloc 、 Electric Fence 、 Memcheck 、 Memwatch 以及 Mtrace 。在日常编码中,我已经用过这五个调试器了,所以这些评估是建立在我的实际体验之上的。 +幸运的是,现行有一些编程工具能够帮你在软件程序中找到这些和内存相关的错误。在这些工具集中,我评估了五款支持 Linux 的、流行的、自由开源的内存调试器: Dmalloc 、 Electric Fence 、 Memcheck 、 Memwatch 以及 Mtrace 。在日常编码中,我已经用过这五个调试器了,所以这些评估是建立在我的实际体验之上的。 ### [Dmalloc][3] ### @@ -19,10 +19,11 @@ **许可**: CC 3.0 -Dmalloc 是 Gray Watson 开发的一款内存调试工具。它是作为库来实现的,封装了标准内存管理函数如 *malloc() , calloc() , free()* 等,使程序员得以检测出有问题的代码。 +Dmalloc 是 Gray Watson 开发的一款内存调试工具。它是作为库来实现的,封装了标准内存管理函数如`malloc() , calloc() , free()`等,使程序员得以检测出有问题的代码。 ![cw dmalloc output](http://images.techhive.com/images/article/2015/11/cw_dmalloc-output-100627040-large.idge.png) -Dmalloc + +*Dmalloc* 如同工具的网页所示,这个调试器提供的特性包括内存泄漏跟踪、[重复释放内存(double free)][4]错误跟踪、以及[越界写入(fence-post write)][5]检测。其它特性包括报告错误的文件/行号、通用的数据统计记录。 @@ -32,19 +33,19 @@ Dmalloc #### 有何优点 #### -Dmalloc 最大的优点就是高度可配置性。比如说,你可以配置以支持 C++ 程序和多线程应用。 Dmalloc 还提供一个有用的功能:运行时可配置,这表示在 Dmalloc 执行时,可以轻易地使能或者禁能它提供的一些特性。 +Dmalloc 最大的优点就是高度可配置性。比如说,你可以配置它以支持 C++ 程序和多线程应用。 Dmalloc 还提供一个有用的功能:运行时可配置,这表示在 Dmalloc 执行时,可以轻易地启用或者禁用它提供的一些特性。 -你还可以配合 [GNU Project Debugger (GDB)][7]来使用 Dmalloc ,只需要将 *dmalloc.gdb* 文件(位于 Dmalloc 源码包中的 contrib 子目录里)的内容添加到你的主目录中的 *.gdbinit* 文件里即可。 +你还可以配合 [GNU Project Debugger (GDB)][7]来使用 Dmalloc ,只需要将`dmalloc.gdb`文件(位于 Dmalloc 源码包中的 contrib 子目录里)的内容添加到你的主目录中的`.gdbinit`文件里即可。 -另外一个让我对 Dmalloc 爱不释手的优点是它有大量的资料文献。前往官网的 [Documentation 标签][8],可以获取所有关于如何下载、安装、运行,怎样使用库,和 Dmalloc 所提供特性的细节描述,及其输入文件的解释。其中还有一个章节介绍了一般问题的解决方法。 +另外一个让我对 Dmalloc 爱不释手的优点是它有大量的资料文献。前往官网的 [Documentation 栏目][8],可以获取所有关于如何下载、安装、运行、怎样使用库,和 Dmalloc 所提供特性的细节描述,及其生成的输出文件的解释。其中还有一个章节介绍了一般问题的解决方法。 #### 注意事项 #### -跟 Mtrace 一样, Dmalloc 需要程序员改动他们的源代码。比如说你可以(必须的)添加头文件 *dmalloc.h* ,工具就能汇报产生问题的调用的文件或行号。这个功能非常有用,因为它节省了调试的时间。 +跟 Mtrace 一样, Dmalloc 需要程序员改动他们的源代码。比如说你可以(也是必须的)添加头文件`dmalloc.h`,工具就能汇报产生问题的调用的文件或行号。这个功能非常有用,因为它节省了调试的时间。 除此之外,还需要在编译你的程序时,把 Dmalloc 库(编译 Dmalloc 源码包时产生的)链接进去。 -然而,还有点更麻烦的事,需要设置一个环境变量,命名为 *DMALLOC_OPTION* ,以供工具在运行时配置内存调试特性,以及输出文件的路径。可以手动为该环境变量分配一个值,不过初学者可能会觉得这个过程有点困难,因为该值的一部分用来表示要启用的 Dmalloc 特性——表示为各自的十六进制值的累加。[这里][9]有详细介绍。 +然而,还有点更麻烦的事,需要设置一个环境变量,命名为`DMALLOC_OPTION`,以供工具在运行时配置内存调试特性,比如定义输出文件的路径。可以手动为该环境变量分配一个值,不过初学者可能会觉得这个过程有点困难,因为该值的一部分用来表示要启用的 Dmalloc 特性——以十六进制值的累加值表示。[这里][9]有详细介绍。 一个比较简单方法设置这个环境变量是使用 [Dmalloc 实用指令][10],这是专为这个目的设计的方法。 @@ -65,9 +66,10 @@ Dmalloc 真正的优势在于它的可配置选项。而且高度可移植,曾 Electric Fence 是 Bruce Perens 开发的一款内存调试工具,它以库的形式实现,你的程序需要链接它。Electric Fence 能检测出[堆][11]内存溢出和访问已经释放的内存。 ![cw electric fence output](http://images.techhive.com/images/article/2015/11/cw_electric-fence-output-100627041-large.idge.png) -Electric Fence -顾名思义, Electric Fence 在每个申请的缓存边界建立了虚拟围栏,这样以来任何非法的内存访问都会导致[段错误][12]。这个调试工具同时支持 C 和 C++ 程序。 +*Electric Fence* + +顾名思义, Electric Fence 在每个所申请的缓存边界建立了虚拟围栏,这样一来任何非法的内存访问都会导致[段错误][12]。这个调试工具同时支持 C 和 C++ 程序。 #### 更新内容 #### @@ -75,7 +77,7 @@ Electric Fence #### 有何优点 #### -我喜欢 Electric Fence 的首要一点是它不同于 Memwatch 、 Dmalloc 和 Mtrace ,不需要堆你的源码做任何的改动,你只需要在编译的时候把它的库链接进你的程序即可。 +我喜欢 Electric Fence 的首要一点是它不同于 Memwatch 、 Dmalloc 和 Mtrace ,不需要对你的源码做任何的改动,你只需要在编译的时候把它的库链接进你的程序即可。 其次, Electric Fence 的实现保证了产生越界访问的第一个指令就会引起段错误。这比在后面再发现问题要好多了。 @@ -95,7 +97,6 @@ Electric Fence 还有一个局限是不能明确指出错误代码所在的行 尽管局限性较大, Electric Fence 的易用性仍然是加分项。只要链接一次程序, Electric Fence 就可以在监测出内存相关问题的时候报警。不过,如同前面所说, Electric Fence 需要配合像 GDB 这样的源码调试器使用。 - ### [Memcheck][16] ### **开发者**:[Valgrind 开发团队][17] @@ -106,30 +107,31 @@ Electric Fence 还有一个局限是不能明确指出错误代码所在的行 **许可**:GPL -[Valgrind][18] 是一个提供好几款调试和分析 Linux 程序性能的工具套件。虽然 Valgrind 能和不同语言——Java 、 Perl 、 Python 、 Assembly code 、 ortran 、 Ada 灯——编写的程序一起工作,但是它主要还针对使用 C/C++ 所编写的程序。 +[Valgrind][18] 是一个提供好几款调试和分析 Linux 程序性能的工具的套件。虽然 Valgrind 能和不同语言——Java 、 Perl 、 Python 、 Assembly code 、 ortran 、 Ada 等——编写的程序一起工作,但是它主要还是针对使用 C/C++ 所编写的程序。 Memcheck ,一款内存错误检测器,是其中最受欢迎的工具。它能够检测出如内存泄漏、无效的内存访问、未定义变量的使用以及堆内存分配和释放相关的问题等诸多问题。 #### 更新内容 #### -[工具套件( 3.10.1 )][19]主要修复了 3.10.0 版本发现的 bug 。除此之外,从主版本向后移植一些包,修复了缺失的 AArch64 ARMv8 指令和系统调用。 +[工具套件( 3.10.1 )][19]主要修复了 3.10.0 版本发现的 bug 。除此之外,“从主干开发版本向后移植的一些补丁,修复了缺失的 AArch64 ARMv8 指令和系统调用”。 #### 有何优点 #### 同其它所有 Valgrind 工具一样, Memcheck 也是命令行程序。它的操作非常简单:通常我们会使用诸如 `prog arg1 arg2` 格式的命令来运行程序,而 Memcheck 只要求你多加几个值即可,如 `valgrind --leak-check=full prog arg1 arg2` 。 ![cw memcheck output](http://images.techhive.com/images/article/2015/11/cw_memcheck-output-100627037-large.idge.png) -Memcheck -(注意:因为 Memcheck 是 Valgrind 的默认工具所以在命令行执行命令时无需提及 Memcheck。但是,需要在编译程序之初带上 `-g` 参数选项,这一步会添加调试信息,使得 Memcheck 的错误信息会包含正确的行号。) +*Memcheck* -我真正倾心于 Memcheck 的是它提供了很多命令行选项(如上所述的 *--leak-check* 选项),如此不仅能控制工具运转还可以控制它的输出。 +(注意:因为 Memcheck 是 Valgrind 的默认工具,所以在命令行执行命令时无需提及 Memcheck。但是,需要在编译程序之初带上 `-g` 参数选项,这一步会添加调试信息,使得 Memcheck 的错误信息会包含正确的行号。) -举个例子,可以开启 *--track-origins* 选项,以查看程序源码中未初始化的数据;可以开启 *--show-mismatched-frees* 选项让 Memcheck 匹配内存的分配和释放技术。对于 C 语言所写的代码, Memcheck 会确保只能使用 *free()* 函数来释放内存, *malloc()* 函数来申请内存。而对 C++ 所写的源码, Memcheck 会检查是否使用了 *delete* 或 *delete[]* 操作符来释放内存,以及 *new* 或者*new[]* 来申请内存。 +我真正倾心于 Memcheck 的是它提供了很多命令行选项(如上所述的`--leak-check`选项),如此不仅能控制工具运转还可以控制它的输出。 -Memcheck 最好的特点,尤其是对于初学者来说,是它会给用户建议使用哪个命令行选项能让输出更加有意义。比如说,如果你不使用基本的 *--leak-check* 选项, Memcheck 会在输出时给出建议:“使用 --leak-check=full 重新运行以查看更多泄漏内存细节”。如果程序有未初始化的变量, Memcheck 会产生信息:“使用 --track-origins=yes 以查看未初始化变量的定位”。 +举个例子,可以开启`--track-origins`选项,以查看程序源码中未初始化的数据;可以开启`--show-mismatched-frees`选项让 Memcheck 匹配内存的分配和释放技术。对于 C 语言所写的代码, Memcheck 会确保只能使用`free()`函数来释放内存,`malloc()`函数来申请内存。而对 C++ 所写的源码, Memcheck 会检查是否使用了`delete`或`delete[]`操作符来释放内存,以及`new`或者`new[]`来申请内存。 -Memcheck 另外一个有用的特性是它可以[创建抑制文件( suppression files )][20],由此可以略过特定的不能修正的错误,这样 Memcheck 运行时就不会每次都报警了。值得一提的是, Memcheck 会去读取默认抑制文件来忽略系统库(比如 C 库)中的报错,这些错误在系统创建之前就已经存在了。可以选择创建一个新的抑制文件,或是编辑现有的文件(通常是*/usr/lib/valgrind/default.supp*)。 +Memcheck 最好的特点,尤其是对于初学者来说,是它会给用户建议使用哪个命令行选项能让输出更加有意义。比如说,如果你不使用基本的`--leak-check`选项, Memcheck 会在输出时给出建议:“使用 --leak-check=full 重新运行以查看更多泄漏内存细节”。如果程序有未初始化的变量, Memcheck 会产生信息:“使用 --track-origins=yes 以查看未初始化变量的定位”。 + +Memcheck 另外一个有用的特性是它可以[创建抑制文件( suppression files )][20],由此可以略过特定的不能修正的错误,这样 Memcheck 运行时就不会每次都报警了。值得一提的是, Memcheck 会去读取默认抑制文件来忽略系统库(比如 C 库)中的报错,这些错误在系统创建之前就已经存在了。可以选择创建一个新的抑制文件,或是编辑现有的文件(通常是`/usr/lib/valgrind/default.supp`)。 Memcheck 还有高级功能,比如可以使用[定制内存分配器][22]来[检测内存错误][21]。除此之外, Memcheck 提供[监控命令][23],当用到 Valgrind 内置的 gdbserver ,以及[客户端请求][24]机制(不仅能把程序的行为告知 Memcheck ,还可以进行查询)时可以使用。 @@ -145,7 +147,7 @@ Memcheck 还有高级功能,比如可以使用[定制内存分配器][22]来[ 无论是对于初学者还是那些需要高级特性的人来说, Memcheck 都是一款便捷的内存调试工具。如果你仅需要基本调试和错误检查, Memcheck 会非常容易上手。而当你想要使用像抑制文件或者监控指令这样的特性,就需要花一些功夫学习了。 -虽然罗列了大量的局限性,但是 Valgrind(包括 Memcheck )在它的网站上声称全球有[成千上万程序员][30]使用了此工具。开发团队称收到来自超过 30 个国家的用户反馈,而这些用户的工程代码有的高达 2.5 千万行。 +虽然罗列了大量的局限性,但是 Valgrind(包括 Memcheck )在它的网站上声称全球有[成千上万程序员][30]使用了此工具。开发团队称收到来自超过 30 个国家的用户反馈,而这些用户的工程代码有的高达两千五百万行。 ### [Memwatch][31] ### @@ -163,24 +165,25 @@ Memwatch 支持用 C 语言所编写的程序。也可以在 C++ 程序中使用 #### 更新内容 #### -这个版本添加了 *ULONG_LONG_MAX* 以区分 32 位和 64 位程序。 +这个版本添加了`ULONG_LONG_MAX`以区分 32 位和 64 位程序。 #### 有何优点 #### -跟 Dmalloc 一样, Memwatch 也有优秀的文档资料。参考 USING 文件,可以学习如何使用 Memwatch ,可以了解 Memwatch 是如何初始化、如何清理以及如何进行 I/O 操作,等等。还有一个 FAQ 文件,旨在帮助用户解决使用过程遇到的一般问题。最后还有一个 *test.c* 文件提供工作案例参考。 +跟 Dmalloc 一样, Memwatch 也有优秀的文档资料。参考 USING 文件,可以学习如何使用 Memwatch ,可以了解 Memwatch 是如何初始化、如何清理以及如何进行 I/O 操作,等等。还有一个 FAQ 文件,旨在帮助用户解决使用过程遇到的一般问题。最后还有一个`test.c`文件提供工作案例参考。 ![cw memwatch output](http://images.techhive.com/images/article/2015/11/cw_memwatch_output-100627038-large.idge.png) -Memwatch -不同于 Mtrace , Memwatch 产生的日志文件(通常是 *memwatch.log* )是人类可阅读的格式。而且, Memwatch 每次运行时总会把内存调试结果拼接到输出文件的末尾。如此便可在需要之时轻松查看之前的输出信息。 +*Memwatch* + +不同于 Mtrace , Memwatch 产生的日志文件(通常是`memwatch.log`)是人类可阅读的格式。而且, Memwatch 每次运行时总会把内存调试结果拼接到输出该文件的末尾。如此便可在需要之时轻松查看之前的输出信息。 同样值得一提的是当你执行了启用 Memwatch 的程序, Memwatch 会在[标准输出][34]中产生一个单行输出,告知发现了错误,然后你可以在日志文件中查看输出细节。如果没有产生错误信息,就可以确保日志文件不会写入任何错误,多次运行的话确实能节省时间。 -另一个我喜欢的优点是 Memwatch 还提供了在源码中获取其输出信息的方式,你可以获取信息,然后任由你进行处理(参考 Memwatch 源码中的 *mwSetOutFunc()* 函数获取更多有关的信息)。 +另一个我喜欢的优点是 Memwatch 还提供了在源码中获取其输出信息的方式,你可以获取信息,然后任由你进行处理(参考 Memwatch 源码中的`mwSetOutFunc()`函数获取更多有关的信息)。 #### 注意事项 #### -跟 Mtrace 和 Dmalloc 一样, Memwatch 也需要你往你的源文件里增加代码:你需要把 *memwatch.h* 这个头文件包含进你的代码。而且,编译程序的时候,你需要连同 *memwatch.c* 一块编译;或者你可以把已经编译好的目标模块包含起来,然后在命令行定义 *MEMWATCH* 和 *MW_STDIO* 变量。不用说,想要在输出中定位行号, -g 编译器选项也少不了。 +跟 Mtrace 和 Dmalloc 一样, Memwatch 也需要你往你的源文件里增加代码:你需要把`memwatch.h`这个头文件包含进你的代码。而且,编译程序的时候,你需要连同`memwatch.c`一块编译;或者你可以把已经编译好的目标模块包含起来,然后在命令行定义`MEMWATCH`和`MW_STDIO`变量。不用说,想要在输出中定位行号, -g 编译器选项也少不了。 此外, Memwatch 缺少一些特性。比如 Memwatch 不能检测出对一块已经被释放的内存进行写入操作,或是在分配的内存块之外的进行读取操作。而且, Memwatch 也不是线程安全的。还有一点,正如我在开始时指出,在 C++ 程序上运行 Memwatch 的结果是不能预料的。 @@ -198,12 +201,13 @@ Memcheck 可以检测很多内存相关的问题,在处理 C 程序时是非 **许可**:GNU GPL -Mtrace 是 [GNU C 库][36]中的一款内存调试工具,同时支持 Linux 上的 C 和 C++ 程序,可以检测由函数 *malloc()* 和 *free()* 不匹配的调用所引起的内存泄漏问题。 +Mtrace 是 [GNU C 库][36]中的一款内存调试工具,同时支持 Linux 上的 C 和 C++ 程序,可以检测由函数`malloc()`和`free()`不匹配的调用所引起的内存泄漏问题。 ![cw mtrace output](http://images.techhive.com/images/article/2015/11/cw_mtrace-output-100627039-large.idge.png) -Mtrace -Mtrace 的实现实际上是 *mtrace()* 函数,它可以跟踪程序中所有 malloc/free 调用,并在用户指定的文件中记录相关信息。文件以一种机器可读的格式记录数据,所以有一个 Perl 脚本——同样命名为 mtrace ——用来把文件转换并为人类可读格式。 +*Mtrace* + +Mtrace 实际上是实现了一个名为`mtrace()`的函数,它可以跟踪程序中所有 malloc/free 调用,并在用户指定的文件中记录相关信息。文件以一种机器可读的格式记录数据,所以有一个 Perl 脚本——同样命名为 mtrace ——用来把文件转换并为人类可读格式。 #### 更新内容 #### @@ -211,19 +215,19 @@ Mtrace 的实现实际上是 *mtrace()* 函数,它可以跟踪程序中所有 #### 有何优点 #### -Mtrace 最好的地方是它非常简单易学。你只需要了解在你的源码中如何以及何处添加 mtrace() 及对应的 muntrace() 函数,还有如何使用 Mtrace 的 Perl 脚本。后者非常简单,只需要运行指令 *mtrace *(例子见开头截图最后一条指令)。 +Mtrace 最好的地方是它非常简单易学。你只需要了解在你的源码中如何以及何处添加 mtrace() 及对应的 muntrace() 函数,还有如何使用 Mtrace 的 Perl 脚本。后者非常简单,只需要运行指令`mtrace `(例子见开头截图最后一条指令)。 -Mtrace 另外一个优点是它的可收缩性,这体现在不仅可以使用它来调试完整的程序,还可以使用它来检测程序中独立模块的内存泄漏。只需在每个模块里调用 *mtrace()* 和 *muntrace()* 即可。 +Mtrace 另外一个优点是它的可伸缩性,这体现在不仅可以使用它来调试完整的程序,还可以使用它来检测程序中独立模块的内存泄漏。只需在每个模块里调用`mtrace()`和`muntrace()`即可。 -最后一点,因为 Mtrace 会在 *mtrace()*——在源码中添加的函数——执行时被触发,因此可以很灵活地[使用信号][39]动态地(在程序执行时)使能 Mtrace 。 +最后一点,因为 Mtrace 会在`mtrace()`——在源码中添加的函数——执行时被触发,因此可以很灵活地[使用信号][39]动态地(在程序执行时)使能 Mtrace 。 #### 注意事项 #### -因为 *mtrace()* 和 *mauntrace()* 函数 —— 声明在 *mcheck.h* 文件中,所以必须在源码中包含此头文件 —— 的调用是 Mtrace 工作的基础运行( *mauntrace()* 函数并非[总是必要][40]),因此 Mtrace 要求程序员至少改动源码一次。 +因为`mtrace()`和`mauntrace()`函数 —— 声明在`mcheck.h`文件中,所以必须在源码中包含此头文件 —— 的调用是 Mtrace 工作的基础(`mauntrace()`函数并非[总是必要][40]),因此 Mtrace 要求程序员至少改动源码一次。 需要注意的是,在编译程序的时候带上 -g 选项( [GCC][41] 和 [G++][42] 编译器均有提供),才能使调试工具在输出结果时展示正确的行号。除此之外,有些程序(取决于源码体积有多大)可能会花很长时间进行编译。最后,带 -g 选项编译会增加了可执行文件的大小(因为提供了额外的调试信息),因此记得程序需要在测试结束后,不带 -g 选项重新进行编译。 -使用 Mtrace ,你需要掌握 Linux 环境变量的基本知识,因为在程序执行之前,需要把用户把环境变量 *MALLOC_TRACE* 的值设为指定的文件( *mtrace()* 函数将会记录全部信息到其中)路径。 +使用 Mtrace ,你需要掌握 Linux 环境变量的基本知识,因为在程序执行之前,需要把用户把环境变量`MALLOC_TRACE`的值设为指定的文件(`mtrace()`函数将会记录全部信息到其中)路径。 Mtrace 在检测内存泄漏和试图释放未经过分配的内存方面存在局限。它不能检测其它内存相关问题如非法内存访问、使用未初始化内存。而且,[有人抱怨][43] Mtrace 不是[线程安全][44]的。 @@ -237,7 +241,7 @@ Mtrace 在检测内存泄漏和试图释放未经过分配的内存方面存在 虽然 Memwatch 的资料比 Dmalloc 的更加丰富,而且还能检测更多的错误种类,但是你只能在 C 语言写就的程序中使用它。一个让 Memwatch 脱颖而出的特性是它允许在你的程序源码中处理它的输出,这对于想要定制输出格式来说是非常有用的。 -如果改动程序源码非你所愿,那么使用 Electric Fence 吧。不过,请记住, Electric Fence 只能检测两种错误类型,而此二者均非内存泄漏。还有就是,需要了解 GDB 基础以最大化发挥这款内存调试工具的作用。 +如果改动程序源码非你所愿,那么使用 Electric Fence 吧。不过,请记住, Electric Fence 只能检测两种错误类型,而此二者均非内存泄漏。还有就是,需要基本了解 GDB 以最大化发挥这款内存调试工具的作用。 Memcheck 可能是其中综合性最好的了。相比这里提及的其它工具,它能检测更多的错误类型,提供更多的特性,而且不需要你的源码做任何改动。但请注意,基本功能并不难上手,但是想要使用它的高级特性,就必须学习相关的专业知识了。 From 8def8133c619937ac2afc2afdbdb49171424dc72 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 18 May 2016 10:35:39 +0800 Subject: [PATCH 0774/1469] PUB:20151207 5 great Raspberry Pi projects for the classroom @carolinewuyan @oska874 --- ...Raspberry Pi projects for the classroom.md | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) rename {translated/tech => published}/20151207 5 great Raspberry Pi projects for the classroom.md (87%) diff --git a/translated/tech/20151207 5 great Raspberry Pi projects for the classroom.md b/published/20151207 5 great Raspberry Pi projects for the classroom.md similarity index 87% rename from translated/tech/20151207 5 great Raspberry Pi projects for the classroom.md rename to published/20151207 5 great Raspberry Pi projects for the classroom.md index 5204511c1d..ddf2258d97 100644 --- a/translated/tech/20151207 5 great Raspberry Pi projects for the classroom.md +++ b/published/20151207 5 great Raspberry Pi projects for the classroom.md @@ -6,18 +6,20 @@ ### 1. 我的世界: Pi ![](https://opensource.com/sites/default/files/lava.png) ->源于 Raspberry Pi 基金会. [CC BY-SA 4.0][1]. -我的世界是世界上几乎每一个青少年都特别喜欢的一款游戏,而且它成功抓住了年轻人眼球,成为目前最能激发年轻人创造力的游戏之一。这个树莓派版本自带的我的世界不仅仅是一个具有创造性的建筑游戏,还是一个具有编程接口,可以通过 Python 与之交互的版本。 +*源于 Raspberry Pi 基金会. [CC BY-SA 4.0][1]* + +“我的世界”是世界上几乎每一个青少年都特别喜欢的一款游戏,而且它成功抓住了年轻人眼球,成为目前最能激发年轻人创造力的游戏之一。这个树莓派版本自带的我的世界不仅仅是一个具有创造性的建筑游戏,还是一个具有编程接口,可以通过 Python 与之交互的版本。 我的世界:Pi 版对于老师来说是一个教授学生解决问题和编写代码完成任务的好方式。你可以使用 Python API 创建一个房子,并且一直跟随这你的脚步移动,在所到之处建造一座桥,让天空落下熔岩雨滴,在空中显示温度,以及其它你可以想象到的一切东西。 -详情请见 "[Getting Started with Minecraft Pi][2]." +详情请见 "[我的世界: Pi 入门][2]" ### 2. 反应游戏和交通灯 ![](https://opensource.com/sites/default/files/pi_traffic_installed_yellow_led_on.jpg) ->源于 [Low Voltage Labs][3]. [CC BY-SA 4.0][1]. + +*源于 [Low Voltage Labs][3]. [CC BY-SA 4.0][1]* 使用树莓派可以很轻松地进行物理计算,只需要连接几个 LED 和按钮到开发板上的 GPIO 接口,再用几行代码你就可以按下按钮来开灯。一旦你了解了如何使用代码来完成这些基本的操作,接下来就可以根据你的想象来做其它事情了。 @@ -26,7 +28,8 @@ 代码并不是全部——这只是一个演练,让你理解现实世界里系统是如何完成设计的。计算思维是一个让你终身受用的技能。 ![](https://opensource.com/sites/default/files/reaction-game.png) ->源于 Raspberry Pi 基金会. [CC BY-SA 4.0][1]. + +*源于 Raspberry Pi 基金会. [CC BY-SA 4.0][1]* 接下来试着接通两个按钮和 LED 灯的电源,实现一个双玩家的反应游戏 —— 让 LED 灯随机时间点亮,然后看是谁抢先按下按钮。 @@ -38,25 +41,25 @@ Astro Pi —— 一个增强版的树莓派 —— 将在 12 月问世,但是 [video](https://youtu.be/gfRDFvEVz-w) ->详见 "[探索 Sense HAT][9]." +> 详见 "[探索 Sense HAT][9]." ### 4. 红外鸟笼 ![](https://opensource.com/sites/default/files/ir-bird-box.png) ->源于 Raspberry Pi 基金会. [CC BY-SA 4.0][1]. + +*源于 Raspberry Pi 基金会. [CC BY-SA 4.0][1]* 让整个班级都可以参与进来的好主意是在鸟笼里放置一个树莓派和夜视镜头,以及一些红外线灯,这样子你就可以在黑暗中看见鸟笼里的情况了,然后使用树莓派通过网络串流视频。然后就可以等待小鸟归笼了,你可以在不打扰的情况下近距离观察小窝里的它们了。 -要了解更多有关红外线和光谱的知识,以及如何校准摄像头焦点和使用软件控制摄像头,可以访问 [Make an infrared bird box][10]。 - - +要了解更多有关红外线和光谱的知识,以及如何校准摄像头焦点和使用软件控制摄像头,可以访问 [打造一个红外鸟笼][10]。 ### 5. 机器人 ![](https://opensource.com/sites/default/files/edukit3_1500-alex-eames-sm.jpg) ->源于 Raspberry Pi 基金会. [CC BY-SA 4.0][1]. -只需要一个树莓派、很少的几个电机和电机控制器,你就可以自己动手制作一个机器人。可以制作的机器人有很多种,从简单的由几个轮子和自制底盘拼凑的简单小车,到由游戏控制器驱动、具有自我意识、配备了传感器,安装了摄像头的金属种马。 +*源于 Raspberry Pi 基金会. [CC BY-SA 4.0][1]* + +只需要一个树莓派、很少的几个电机和电机控制器,你就可以自己动手制作一个机器人。可以制作的机器人有很多种,从简单的由几个轮子和自制底盘拼凑的简单小车,到由游戏控制器驱动、具有自我意识、配备了传感器,安装了摄像头的金属小马。 要学习如何控制不同的电机,可以使用 RTK 电机驱动开发板入门或者使用配置了电机、轮子和传感器的 CamJam 机器人开发套件——具有很大的价值和大量的学习潜力。 From 1d586ec845e76f91f58822a8624a5a48b9c22e2d Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 18 May 2016 10:52:46 +0800 Subject: [PATCH 0775/1469] PUB:20160415 Docker 1.11 Adopts Open Container Project Components @geekpi --- ...dopts Open Container Project Components.md | 48 ++++++++++++++++++ ...dopts Open Container Project Components.md | 50 ------------------- 2 files changed, 48 insertions(+), 50 deletions(-) create mode 100644 published/20160415 Docker 1.11 Adopts Open Container Project Components.md delete mode 100644 translated/tech/20160415 Docker 1.11 Adopts Open Container Project Components.md diff --git a/published/20160415 Docker 1.11 Adopts Open Container Project Components.md b/published/20160415 Docker 1.11 Adopts Open Container Project Components.md new file mode 100644 index 0000000000..9b73c52b8c --- /dev/null +++ b/published/20160415 Docker 1.11 Adopts Open Container Project Components.md @@ -0,0 +1,48 @@ +Docker 1.11 采纳了开源容器项目(OCP)组件 +======================================================= + +![](http://images.techhive.com/images/article/2015/01/docker-620x465-100559026-primary.idge.jpg) + +> Docker 在开放容器项目(Open Container Project,OCP)中的参与度达成圆满,最新构建的Docker采用了Docker 贡献给 OCP 的组件。 + +新发布的 [Docker 1.11][1] 的最大新闻并不是它的功能,而是它使用了在 OCP 支持下的标准化的组件版本。 + +去年,Docker 贡献了它的 [runC][2] 核心给 OCP 作为构建构建容器工具的基础。同样还有 [containerd][3],作为守护进程或者服务端用于控制 runC 的实例。Docker 1.11 现在使用的就是这个捐赠和公开的版本。 + + +Docker 此举挑战了它的容器生态仍[主要由 Docker 自身决定][6]这个说法。它并不是为了作秀才将容器规范和运行时细节贡献给 OCP。它希望项目将来的开发越开放和广泛越好。 + +![](http://images.techhive.com/images/article/2016/04/docker-runc-100656060-large.idge.png) + +> Docker 1.11 已经用贡献给 OCP 的 runC 和 containerd 进行了重构。runC 如果需要的话可以换成另外一个。 + +runC 的[两位主要提交者][7]来自 Docker,但是来自 Virtuozzo(Parallels fame)、OpenShift、Project Atomic、华为、GE Healthcare、Suse Linux 也都是提交人员里面的常客。 + +Docker 1.11 中一个更明显的变化是先前 Docker runtime 在 Docker 中是唯一可用的,并且评论家认为这个会限制用户的选择。runC runtime 现在是可替换的;虽然 Docker 在发布时将 runC 作为默认引擎,但是任何兼容的引擎都可以用来替换它。(Docker 同样希望它可以不用杀死并重启现在运行的容器,但是这个作为今后的改进规划。) + +Docker 正在将基于 OCP 的开发流程作为内部创建其产品的更好方式。在它发布 1.11 的[官方博客中称][8]:“将 Docker 切分成独立的工具意味着更专注的维护者,最终会有更好的软件质量。” + +除了修复长期以来存在的问题和确保 Docker 的 runC/containerd 跟上步伐,Docker 还在 Docker 1.11 中加入了一些改进。Docker Engine 现在支持 VLAN 和 IPv6 服务发现,并且会自动在多个相同别名容器间执行 DNS 轮询负载均衡。 + + +------------------------------------------------------------------------------ + +via: http://www.infoworld.com/article/3055966/open-source-tools/docker-111-adopts-open-container-project-components.html + +作者:[Serdar Yegulalp][a] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.infoworld.com/author/Serdar-Yegulalp/ +[1]: https://blog.docker.com/2016/04/docker-engine-1-11-runc/ +[2]: http://runc.io/ +[3]: https://containerd.tools/ +[4]: http://www.infoworld.com/resources/16373/application-virtualization/the-beginners-guide-to-docker#tk.ifw-infsb +[5]: http://www.infoworld.com/newsletters/signup.html#tk.ifw-infsb +[6]: http://www.infoworld.com/article/2876801/application-virtualization/docker-reorganization-grows-up.html +[7]: https://github.com/opencontainers/runc/graphs/contributors +[8]: https://blog.docker.com/2016/04/docker-engine-1-11-runc/ + + diff --git a/translated/tech/20160415 Docker 1.11 Adopts Open Container Project Components.md b/translated/tech/20160415 Docker 1.11 Adopts Open Container Project Components.md deleted file mode 100644 index 98e8d49c06..0000000000 --- a/translated/tech/20160415 Docker 1.11 Adopts Open Container Project Components.md +++ /dev/null @@ -1,50 +0,0 @@ -Docker 1.11采纳了开源容器项目组件 -======================================================= - -![](http://images.techhive.com/images/article/2015/01/docker-620x465-100559026-primary.idge.jpg) - ->Docker参与的开源项目完成了一个闭环,最新构建的Docker采用了Docker贡献给OCP的组件。 - -[Docker 1.11][1]最大的新闻并不是它的功能,而是它使用了在OCP支持下的标准化的组件版本。 - -去年,Docker贡献了它的[runC][2]核心给OCP作为构建构建容器工具的基础。同样还有[containerd][3],作为守护进程或者服务端用于控制runC的实例。Docker 1.11现在使用的是捐赠和公开的版本。 - ->在InfoWorld的[Docker初学者指南][4]中深入这个热门开源框架。今天就拿来看!|在[InfoWorld每日简讯][5]中获取今日的技术新闻。 - ->Docker此举挑战了它的容器生态仍[主要由Docker自身决定][6]的传说。它并不是为了作秀才将容器规范和运行时细节贡献给OCP。它希望项目将来的开发越开放和广泛越好。 - -![](http://images.techhive.com/images/article/2016/04/docker-runc-100656060-large.idge.png) - ->Docker 1.11已经用贡献给OCP的runC和containerd进行了重构。runC如果需要可以被交换出去并被替换。 - -runC的[两位主要提交者][7]来自Docker,但是来自Virtuozzo(Parallels fame)、OpenShift、Project Atomic、华为、GE Healthcare、Suse Linux也都是提交的常客。 - -Docker 1.11中一个更明显的变化是先前Docker运行时在Docker中是唯一可用的,并且评论家认为这个会限制用户的选择。runC运行时现在是可交换的;虽然Docker在发布时将runC作为默认的引擎,但是任何兼容的引擎都可以被交换进入。(Docker同样希望它可以不用杀死并重启现在运行的容器,但是这个作为今后的改进规划。) - -Docker正在将基于OCP开发流程作为内部更好的方式去创建它的产品。在它的发布1.11的[官方博客中称][8]:“将Docker切分成独立的工具意味着更专注的维护者,最终有更好的软件质量。” - -除了修复长期以来存在的问题何确保Docker的runC/containerd跟上步伐,Docker还在Docker 1.11中加入了一些改进。Docker Engine现在支持VLAN和IPv6服务发现,并且会自动在多个相同别名容器间执行DNS轮询负载均衡。 - - - ------------------------------------------------------------------------------- - -via: http://www.infoworld.com/article/3055966/open-source-tools/docker-111-adopts-open-container-project-components.html - -作者:[Serdar Yegulalp][a] -译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://www.infoworld.com/author/Serdar-Yegulalp/ -[1]: https://blog.docker.com/2016/04/docker-engine-1-11-runc/ -[2]: http://runc.io/ -[3]: https://containerd.tools/ -[4]: http://www.infoworld.com/resources/16373/application-virtualization/the-beginners-guide-to-docker#tk.ifw-infsb -[5]: http://www.infoworld.com/newsletters/signup.html#tk.ifw-infsb -[6]: http://www.infoworld.com/article/2876801/application-virtualization/docker-reorganization-grows-up.html -[7]: https://github.com/opencontainers/runc/graphs/contributors -[8]: https://blog.docker.com/2016/04/docker-engine-1-11-runc/ - - From a3f6f50ebbd349548835a51d279a0d270ac8a956 Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 18 May 2016 19:50:04 +0800 Subject: [PATCH 0776/1469] =?UTF-8?q?20160518-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0160516 Scaling Collaboration in DevOps.md | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 sources/tech/20160516 Scaling Collaboration in DevOps.md diff --git a/sources/tech/20160516 Scaling Collaboration in DevOps.md b/sources/tech/20160516 Scaling Collaboration in DevOps.md new file mode 100644 index 0000000000..ea1e193b96 --- /dev/null +++ b/sources/tech/20160516 Scaling Collaboration in DevOps.md @@ -0,0 +1,67 @@ +Scaling Collaboration in DevOps +================================= + +![](http://devops.com/wp-content/uploads/2016/05/ScalingCollaboration.jpg) + +Those familiar with DevOps generally agree that it is equally as much about culture as it is about technology. There are certainly tools and practices involved in the effective implementation of DevOps, but the foundation of DevOps success is how well [teams and individuals collaborate][1] across the enterprise to get things done more rapidly, efficiently and effectively. + +Most DevOps platforms and tools are designed with scalability in mind. DevOps environments often run in the cloud and tend to be volatile. It’s important for the software that supports DevOps to be able to scale in real time to address spikes and lulls in demand. The same thing is true for the human element as well, but scaling collaboration is a whole different story. + +Collaboration across the enterprise is critical for DevOps success. Great code and development needs to make it over the finish line to production to benefit customers. The challenge organizations face is how to do that seamlessly and with as much speed and automation as possible without sacrificing quality or performance. How can businesses streamline code development and deployment, while maintaining visibility, governance and compliance? + +### Emerging Trends + +First, I want to provide some background and share some data gathered by 451 Research on DevOps and DevOps adoption in general. Cloud, agile and DevOps capabilities are important for organizations today—both in perception and reality. 451 sees enterprise adoption of these things, as well as container technologies, growing—including increased usage in production environments. + +There are a number of advantages to embracing these technologies and methodologies, such as increased flexibility and speed, reduction of costs, improvements in resilience and reliability, and fitness for new or emerging applications. According to 451 Research, organizations also face some barriers including a lack of familiarity and required skills internally, the immaturity of these emerging technologies, and cost and security concerns. + +In the “[Voice of the Enterprise: SDI Q4 2015 survey][2],” 451 Research found that more than half of the respondents (51.7 percent) consider themselves to be late adopters, or even the last adopters of new technology. The flip side of that is that almost half (48.3 percent) label themselves as first or early adopters. + +Those general sentiments are reflected in the survey responses to other questions. When asked about implementation of containers, 50.3 percent stated it is not in their plans at all, while the remaining 49.7 percent are in some state of planning, pilot or active use of container technologies. Nearly two-thirds (65.1 percent) indicated that they use agile development methodologies for application development, but only 39.6 percent responded that they’ve embraced DevOps approaches. Nevertheless, while agile software development has been in the industry for years, 451 notes the impressive adoption of containers and DevOps, given they are emergent trends. + +When asked what the top three IT pain points are, the leading responses were cost or budget, insufficient staff and legacy software issues. As organizations move to cloud, DevOps, and containers issues such as these will need to be addressed, along with how to scale both technologies and collaboration effectively. + +### The Current State + +The industry—driven in large part by the DevOps revolution—is in the midst of a sea change, where software development is becoming more highly integrated across the entire business. The creation of software is less segregated and is more and more a function of collaboration and socialization. + +Concepts and methodologies that were novel or niche just a few years ago have matured quickly to become the mainstream technologies and frameworks that are driving value today. Businesses rely on concepts such as agile, lean, virtualization, cloud, automation and microservices to streamline development and enable them to work more effectively and efficiently at the same time. + +To adapt and evolve, enterprises need to accomplish a number of key tasks. The challenge companies face today is how to accelerate development while reducing costs. Organizations need to eliminate the barriers that exist between IT and the rest of the business, and work cooperatively toward a strategy that provides more effectiveness in a technology-driven, competitive environment. + +Agile, cloud, DevOps and containers all play a role in that process, but the one thing that binds it all is effective collaboration. Each of these technologies and methodologies provides unique benefits, but the real value comes from the organization as a whole—and the tools and platforms used by the organization—being able to collaborate at scale. Successful DevOps implementations also require participation from other stakeholders beyond development and IT operations teams, including security, database, storage and line-of-business teams. + +### Collaboration-as-a-Platform + +There are services and platforms online—such as GitHub—that facilitate and streamline collaboration. The online platform functions as a code repository, but the value extends beyond just providing a place to store code. + +Such a [collaboration platform][4] helps developers and teams collaborate more effectively because it provides a community where the code and process can be shared and discussed. Managers can monitor progress and track what code is shipping next. Developers can experiment with new ideas in a safe environment before taking those experiments to a live production environment, and new ideas and experiments can be effectively communicated to the appropriate teams. + +One of the keys to more agile development and DevOps is to allow developers to test things and gather relevant feedback quickly. The goal is to produce quality code and features faster, not to waste time setting up and managing infrastructure or scheduling more meetings to talk about it. The GitHub platform, for example, enables more effective and scalable collaboration because code review can occur when it is most convenient for the participants. There is no need to try and coordinate and schedule code review meetings, so the developers can continue to work uninterrupted, resulting in greater productivity and job satisfaction. + +Steven Anderson of Sendachi noted that GitHub is a collaboration platform, but it’s also a place for your tools to work with you, too. This means it can help not only with collaboration and continuous integration, but also with code quality. + +One of the benefits of a collaboration platform is that large teams of developers can be broken down into smaller teams that can focus more efficiently on specific components. It also allows things such as document sharing alongside code development to blur the lines between technical and non-technical contributions and enable increased collaboration and visibility. + +### Collaboration is Key + +The importance of collaboration can’t be stressed enough. It is a key tenet of DevOps culture, and it’s vital to agile development and maintaining a competitive edge in today’s world. Executive or management support and internal evangelism are important. Organizations also need to embrace the culture shift—blending skills across functional areas toward a common goal. + +With that culture established, though, effective collaboration is crucial. A collaboration platform is an essential element of collaborating at scale because it streamlines productivity and reduces redundancy and effort, and yields higher quality results at the same time. + + +-------------------------------------------------------------------------------- + +via: http://devops.com/2016/05/16/scaling-collaboration-devops/ + +作者:[TONY BRADLEY][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://devops.com/author/tonybsg/ +[1]: http://devops.com/2014/12/15/four-strategies-supporting-devops-collaboration/ +[2]: https://451research.com/ +[3]: https://451research.com/customer-insight-voice-of-the-enterprise-overview +[4]: http://devops.com/events/analytics-of-collaboration-on-github/ From 82010d8daffaf7c14706764e26395f709c4e8660 Mon Sep 17 00:00:00 2001 From: "eric.xiaozhen" Date: Thu, 19 May 2016 09:58:43 +0800 Subject: [PATCH 0777/1469] Request to translate this article --- .../talk/20160516 Open source from a recruiter's perspective.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/talk/20160516 Open source from a recruiter's perspective.md b/sources/talk/20160516 Open source from a recruiter's perspective.md index 15fc396139..e8d48f77d0 100644 --- a/sources/talk/20160516 Open source from a recruiter's perspective.md +++ b/sources/talk/20160516 Open source from a recruiter's perspective.md @@ -1,3 +1,4 @@ +eriwoon 翻译中 -- 2106-May-19 Open source from a recruiter's perspective ============================================ From f3724ec48293f4a45bc73b19d1f8df616afbede1 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 19 May 2016 22:09:20 +0800 Subject: [PATCH 0778/1469] PUB:Part 7 - LFCS--Managing System Startup Process and Services SysVinit Systemd and Upstart @ictlyh --- ...d Services SysVinit Systemd and Upstart.md | 124 +++++++----------- 1 file changed, 47 insertions(+), 77 deletions(-) rename {translated/tech => published}/LFCS/Part 7 - LFCS--Managing System Startup Process and Services SysVinit Systemd and Upstart.md (72%) diff --git a/translated/tech/LFCS/Part 7 - LFCS--Managing System Startup Process and Services SysVinit Systemd and Upstart.md b/published/LFCS/Part 7 - LFCS--Managing System Startup Process and Services SysVinit Systemd and Upstart.md similarity index 72% rename from translated/tech/LFCS/Part 7 - LFCS--Managing System Startup Process and Services SysVinit Systemd and Upstart.md rename to published/LFCS/Part 7 - LFCS--Managing System Startup Process and Services SysVinit Systemd and Upstart.md index 0c4c1ac766..ff987c3e9b 100644 --- a/translated/tech/LFCS/Part 7 - LFCS--Managing System Startup Process and Services SysVinit Systemd and Upstart.md +++ b/published/LFCS/Part 7 - LFCS--Managing System Startup Process and Services SysVinit Systemd and Upstart.md @@ -1,35 +1,35 @@ -LFCS 系列第七讲: 通过 SysVinit、Systemd 和 Upstart 管理系统自启动进程和服务 +LFCS 系列第七讲:通过 SysVinit、Systemd 和 Upstart 管理系统自启动进程和服务 ================================================================================ -几个月前, Linux 基金会宣布 LFCS(Linux 基金会认证系统管理员) 认证诞生了,这个令人兴奋的新计划定位于让来自全球各地的初级到中级的 Linux 系统管理员得到认证。这其中包括维护已经在运行的系统和服务能力、第一手的问题查找和分析能力、以及决定何时向开发团队提交问题的能力。 +几个月前, Linux 基金会宣布 LFCS (Linux 基金会认证系统管理员) 认证诞生了,这个令人兴奋的新计划定位于让来自全球各地的初级到中级的 Linux 系统管理员得到认证。这其中包括维护已经在运行的系统和服务的能力、第一手的问题查找和分析能力、以及决定何时向开发团队提交问题的能力。 ![Linux Foundation Certified Sysadmin – Part 7](http://www.tecmint.com/wp-content/uploads/2014/10/lfcs-Part-7.png) -第七讲: Linux 基金会认证系统管理员 +*第七讲: Linux 基金会认证系统管理员* 下面的视频简要介绍了 Linux 基金会认证计划。 注:youtube 视频 -这篇博文是 10 指南系列中的第七篇,在这篇文章中,我们会介绍如何管理 Linux 系统自启动进程和服务,这是 LFCS 认证考试要求的一部分。 +本讲是系列教程中的第七讲,在这篇文章中,我们会介绍如何管理 Linux 系统自启动进程和服务,这是 LFCS 认证考试要求的一部分。 ### 管理 Linux 自启动进程 ### -Linux 系统的启动程序包括多个阶段,每个阶段由一个不同的组件表示。下面的图示简要总结了启动过程以及所有包括的主要组件。 +Linux 系统的启动程序包括多个阶段,每个阶段由一个不同的图示块表示。下面的图示简要总结了启动过程以及所有包括的主要组件。 ![Linux Boot Process](http://www.tecmint.com/wp-content/uploads/2014/10/Linux-Boot-Process.png) -Linux 启动过程 +*Linux 启动过程* -当你按下你机器上的电源键时, 存储在主板 EEPROM 芯片中的固件初始化 POST(通电自检) 检查系统硬件资源的状态。POST 结束后,固件会搜索并加载位于第一块可用磁盘上的 MBR 或 EFI 分区的第一阶段引导程序,并把控制权交给引导程序。 +当你按下你机器上的电源键时,存储在主板 EEPROM 芯片中的固件初始化 POST(通电自检) 检查系统硬件资源的状态。POST 结束后,固件会搜索并加载位于第一块可用磁盘上的 MBR 或 EFI 分区的第一阶段引导程序,并把控制权交给引导程序。 #### MBR 方式 #### -MBR 是位于 BISO 设置中标记为可启动磁盘上的第一个扇区,大小是 512 个字节。 +MBR 是位于 BIOS 设置中标记为可启动磁盘上的第一个扇区,大小是 512 个字节。 - 前面 446 个字节:包括可执行代码和错误信息文本的引导程序 - 接下来的 64 个字节:四个分区(主分区或扩展分区)中每个分区一条记录的分区表。其中,每条记录标示了每个一个分区的状态(是否活跃)、大小以及开始和结束扇区。 -- 最后 2 个字节: MBR 有效性检查的魔数。 +- 最后 2 个字节: MBR 有效性检查的魔法数。 下面的命令对 MBR 进行备份(在本例中,/dev/sda 是第一块硬盘)。结果文件 mbr.bkp 在分区表被破坏、例如系统不可引导时能排上用场。 @@ -41,7 +41,7 @@ MBR 是位于 BISO 设置中标记为可启动磁盘上的第一个扇区,大 ![Backup MBR in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Backup-MBR-in-Linux.png) -在 Linux 中备份 MBR +*在 Linux 中备份 MBR* **恢复 MBR** @@ -49,7 +49,7 @@ MBR 是位于 BISO 设置中标记为可启动磁盘上的第一个扇区,大 ![Restore MBR in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Restore-MBR-in-Linux.png) -在 Linux 中恢复 MBR +*在 Linux 中恢复 MBR* #### EFI/UEFI 方式 #### @@ -74,11 +74,11 @@ init 和 systemd 都是管理其它守护进程的守护进程(后台进程) ![Systemd and Init](http://www.tecmint.com/wp-content/uploads/2014/10/systemd-and-init.png) -Systemd 和 Init +*Systemd 和 Init* ### 自启动服务(SysVinit) ### -Linux 中运行等级的概念表示通过控制运行哪些服务来以不同方式使用系统。换句话说,运行等级控制着当前执行状态下可以完成什么任务(以及什么不能完成)。 +Linux 中运行等级通过控制运行哪些服务来以不同方式使用系统。换句话说,运行等级控制着当前执行状态下可以完成什么任务(以及什么不能完成)。 传统上,这个启动过程是基于起源于 System V Unix 的形式,通过执行脚本启动或者停止服务从而使机器进入指定的运行等级(换句话说,是一个不同的系统运行模式)。 @@ -88,47 +88,17 @@ Linux 中运行等级的概念表示通过控制运行哪些服务来以不同 除了启动系统进程,init 还会查看 /etc/inittab 来决定进入哪个运行等级。 -注:表格 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Runlevel Description
0 停止系统。运行等级 0 是一个用于快速关闭系统的特殊过渡状态。
1 别名为 s 或 S,这个运行等级有时候也称为维护模式。在这个运行等级启动的服务由于发行版不同而不同。通常用于正常系统操作损坏时低级别的系统维护。
2 多用户。在 Debian 系统及其衍生版中,这是默认的运行等级,还包括了一个图形化登录(如果有的话)。在基于红帽的系统中,这是没有网络的多用户模式。
3 在基于红帽的系统中,这是默认的多用户模式,运行除了图形化环境以外的所有东西。基于 Debian 的系统中通常不会使用这个运行等级以及等级 4 和 5。
4 通常默认情况下不使用,可用于自定制。
5 基于红帽的系统中,支持 GUI 登录的完全多用户模式。这个运行等级和等级 3 类似,但是有可用的 GUI 登录。
6 重启系统。
+ +|Runlevel| Description| +|--------|------------| +|0|停止系统。运行等级 0 是一个用于快速关闭系统的特殊过渡状态。| +|1|别名为 s 或 S,这个运行等级有时候也称为维护模式。在这个运行等级启动的服务由于发行版不同而不同。通常用于正常系统操作损坏时低级别的系统维护。| +|2|多用户。在 Debian 系统及其衍生版中,这是默认的运行等级,还包括了一个图形化登录(如果有的话)。在基于红帽的系统中,这是没有网络的多用户模式。| +|3|在基于红帽的系统中,这是默认的多用户模式,运行除了图形化环境以外的所有东西。基于 Debian 的系统中通常不会使用这个运行等级以及等级 4 和 5。| +|4|通常默认情况下不使用,可用于自定制。| +|5|基于红帽的系统中,支持 GUI 登录的完全多用户模式。这个运行等级和等级 3 类似,但是有可用的 GUI 登录。| +|6|重启系统。| + 要在运行等级之间切换,我们只需要使用 init 命令更改运行等级:init N(其中 N 是上面列出的一个运行等级)。 请注意这并不是运行中的系统切换运行等级的推荐方式,因为它不会给已经登录的用户发送警告(因而导致他们丢失工作以及进程异常终结)。 @@ -139,7 +109,7 @@ Linux 中运行等级的概念表示通过控制运行哪些服务来以不同 id:2:initdefault: -并用你喜欢的文本编辑器,例如 vim(本系列的[第二讲 : 如何在 Linux 中使用 vi/vim 编辑器][2]),更改数字 2 为想要的运行等级。 +并用你喜欢的文本编辑器,例如 vim(本系列的 [LFCS 系列第二讲:如何安装和使用纯文本编辑器 vi/vim][2]),更改数字 2 为想要的运行等级。 然后,以 root 用户执行 @@ -149,7 +119,7 @@ Linux 中运行等级的概念表示通过控制运行哪些服务来以不同 ![Change Runlevels in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Change-Runlevels-in-Linux.jpeg) -在 Linux 中更改运行等级 +*在 Linux 中更改运行等级* #### 使用 chkconfig 管理服务 #### @@ -165,7 +135,7 @@ Linux 中运行等级的概念表示通过控制运行哪些服务来以不同 ![Listing Runlevel Configuration](http://www.tecmint.com/wp-content/uploads/2014/10/Listing-Runlevel-Configuration.png) -列出运行等级配置 +*列出运行等级配置* 从上图中我们可以看出,当系统进入运行等级 2 到 5 的时候就会启动 postfix,而默认情况下运行等级 2 到 4 时会运行 mysqld。现在假设我们并不希望如此。 @@ -183,7 +153,7 @@ Linux 中运行等级的概念表示通过控制运行哪些服务来以不同 ![在 Linux 中启用/停用服务Enable Disable Services in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Enable-Disable-Services.png) -启用/停用服务 +*启用/停用服务* 我们在基于 Debian 的系统中使用 sysv-rc-conf 完成类似任务。 @@ -193,32 +163,32 @@ Linux 中运行等级的概念表示通过控制运行哪些服务来以不同 1. 我们可以用下面的命令查看启动 mdadm 时的运行等级。 - # ls -l /etc/rc[0-6].d | grep -E 'rc[0-6]|mdadm' + # 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](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Service-Runlevel.png) -查看运行中服务的运行等级 + *查看运行中服务的运行等级* 2. 我们使用 sysv-rc-conf 设置防止 mdadm 在运行等级2 之外的其它等级启动。只需根据需要(你可以使用上下左右按键)选中或取消选中(通过空格键)。 - # sysv-rc-conf + # sysv-rc-conf -![Sysv 运行等级配置SysV Runlevel Config](http://www.tecmint.com/wp-content/uploads/2014/10/SysV-Runlevel-Config.png) + ![Sysv 运行等级配置SysV Runlevel Config](http://www.tecmint.com/wp-content/uploads/2014/10/SysV-Runlevel-Config.png) -Sysv 运行等级配置 + *Sysv 运行等级配置* -然后输入 q 退出。 + 然后输入 q 退出。 3. 重启系统并从步骤 1 开始再操作一遍。 - # ls -l /etc/rc[0-6].d | grep -E 'rc[0-6]|mdadm' + # 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](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-Service-Runlevel.png) -验证服务运行等级 + *验证服务运行等级* -从上图中我们可以看出 mdadm 配置为只在运行等级 2 上启动。 + 从上图中我们可以看出 mdadm 配置为只在运行等级 2 上启动。 ### 那关于 systemd 呢? ### @@ -232,11 +202,11 @@ systemd 是另外一个被多种主流 Linux 发行版采用的服务和系统 ![在 Linux 中查看运行中的进程Check All Running Processes in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Check-All-Running-Processes.png) -查看运行中的进程 +*查看运行中的进程* LOAD 一列显示了单元(UNIT 列,显示服务或者由 systemd 维护的其它进程)是否正确加载,ACTIVE 和 SUB 列则显示了该单元当前的状态。 -显示服务当前状态的信息 +**显示服务当前状态的信息** 当 ACTIVE 列显示某个单元状态并非活跃时,我们可以使用以下命令查看具体原因。 @@ -248,7 +218,7 @@ LOAD 一列显示了单元(UNIT 列,显示服务或者由 systemd 维护的 ![查看 Linux 服务状态Check Linux Service Status](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Service-Status.png) -查看服务状态 +*查看服务状态* 我们可以看到 media-samba.mount 失败的原因是 host dev1 上的挂载进程无法找到 //192.168.0.10/gacanepa 上的共享网络。 @@ -262,9 +232,9 @@ LOAD 一列显示了单元(UNIT 列,显示服务或者由 systemd 维护的 # 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) +![启动停止服务](http://www.tecmint.com/wp-content/uploads/2014/10/Starting-Stoping-Service.jpeg) -启动停止服务 +*启动停止服务* **启用或停用某服务随系统启动** @@ -278,7 +248,7 @@ LOAD 一列显示了单元(UNIT 列,显示服务或者由 systemd 维护的 ![启用或停用服务](http://www.tecmint.com/wp-content/uploads/2014/10/Enabling-Disabling-Services.jpeg) -启用或停用服务 +*启用或停用服务* 你也可以用下面的命令查看某个服务的当前状态(启用或者停用)。 @@ -358,13 +328,13 @@ via: http://www.tecmint.com/linux-boot-process-and-manage-services/ 作者:[Gabriel Cánepa][a] 译者:[ictlyh](http://mutouxiaogui.cn/blog/) -校对:[校对者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/gacanepa/ [1]:http://www.tecmint.com/systemd-replaces-init-in-linux/ -[2]:http://www.tecmint.com/vi-editor-usage/ +[2]:https://linux.cn/article-7165-1.html [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/ From 00f2e0e11c865569941e20e1165d3e73ca4944e5 Mon Sep 17 00:00:00 2001 From: hkurj <663831938@qq.com> Date: Thu, 19 May 2016 22:15:12 +0800 Subject: [PATCH 0779/1469] ok --- ...action-packed experience with Wikipedia.md | 75 ------------------- ...action-packed experience with Wikipedia.md | 74 ++++++++++++++++++ 2 files changed, 74 insertions(+), 75 deletions(-) delete mode 100644 sources/talk/my-open-source-story/20160415 A four year, action-packed experience with Wikipedia.md create mode 100644 translated/talk/my-open-source-story/20160415 A four year, action-packed experience with Wikipedia.md diff --git a/sources/talk/my-open-source-story/20160415 A four year, action-packed experience with Wikipedia.md b/sources/talk/my-open-source-story/20160415 A four year, action-packed experience with Wikipedia.md deleted file mode 100644 index 4621c50a97..0000000000 --- a/sources/talk/my-open-source-story/20160415 A four year, action-packed experience with Wikipedia.md +++ /dev/null @@ -1,75 +0,0 @@ -hkurj translating -A four year, action-packed experience with Wikipedia -======================================================= - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/wikipedia_checkuser_lead.jpg?itok=4lVDjSSM) - - -I consider myself to be an Odia Wikimedian. I contribute [Odia][1] knowledge (the predominant language of the Indian state of [Odisha][2]) to many Wikimedia projects, like Wikipedia and Wikisource, by writing articles and correcting mistakes in articles. I also contribute to Hindi and English Wikipedia articles. - -![](https://opensource.com/sites/default/files/resize/1st_day_at_odia_wikipedia_workshop_image_source_facebook-200x133.jpg) - -My love for Wikimedia started while I was reading an article about the [Bangladesh Liberation war][3] on the English Wikipedia after my 10th board exam (like, an annual exam for 10th grade students in America). By mistake I clicked on a link that took me to an India Wikipedia article, and I started reading. Something was written in Odia on the lefthand side of the article, so I clicked on that, and reached a [ଭାରତ/Bhārat][4] article on the Odia Wikipedia. I was excited to find a Wikipedia article in my native language! - -![](https://opensource.com/sites/default/files/resize/introducing_wikipedia_at_google_io_image_by_gdg_bhubaneswar-251x166.png) - -A banner inviting readers to be part of the 2nd Bhubaneswar workshop on April 1, 2012 sparked my curiousity. I had never contributed to Wikipedia before, only used it for research, and I wasn't familiar with open source and the community contribution process. Plus, I was only 15 years old. I registered. There were many language enthusiasts at the workshop, and all older than me. My father encouraged me to the participate despite my fear; he has played an important role—he's not a Wikimedian, like me, but his encouragement has helped me change Odia Wikipedia and participate in community activities. - -I believe that knowledge about Odia language and literature needs to improve—there are many misconceptions and knowledge gaps—so, I help organize events and workshops for Odia Wikipedia. On my accomplished list at the point, I have: - -* initiated three major edit-a-thons in Odia Wikipedia: Women's Day 2015, Women's Day 2016, abd [Nabakalebara edit-a-thon 2015][5] -* initiated a photograph contest to get more [Rathyatra][6] images from all over the India -* represented Odia Wikipedia during two events by Google ([Google I/O extended][7] and Google Dev Fest) -* spoke at [Perception][8] 2015 and the first [Open Access India][9] meetup - -![](https://opensource.com/sites/default/files/resize/bengali_wikipedia_10th_anniversary_cc-by-sa4.0_biswaroop_ganguly-251x166.jpg) - -I was just an editor to Wikipedia projects until last year, in January 2015, when I attended [Bengali Wikipedia's 10th anniversary conference][10] and [Vishnu][11], the director of the [Center for Internet and Society][12] at the time, invited me to attend the [Train the Trainer][13] Program. I was inspired to start doing outreach for Odia Wikipedia and hosting meetups for [GLAM]14] activities and training new Wikimedians. These experience taught me how to work with a community of contributors. - -[Ravi][15], the director of Wikimedia India at the time, also played an important role in my journey. He trusted me and made me a part of [Wiki Loves Food][16], a public photo competition on Wikimedia Commons, and the organizing committee of [Wikiconference India 2016][17]. During Wiki Loves Food 2015, my team helped add 10,000+ CC BY-SA images on Wikimedia Commons. Ravi further solidified my commitment by sharing a lot of information with me about the Wikimedia movement, and his own journey, during [Odia Wikipedia's 13th anniversary][18]. - -Less than a year later, in December 2015, I became a Program Associate at the Center for Internet and Society's [Access to Knowledge program][19] (CIS-A2K). One of my proud moments was at a workshop in Puri, India where we helped bring 20 new Wikimedian editors to the Odia Wikimedia community. Now, I mentor Wikimedians during an informal meetup called [WikiTungi][20] Puri. I am working with this group to make Odia Wikiquotes a live project. I am also dedicated to bridging the gender gap in Odia Wikipedia. [Eight female editors][21] are now helping to organize meetups and workshops, and participate in the [Women's History month edit-a-thon][22]. - -During my brief but action-packed journey during the four years since, I have also been involved in the [Wikipedia Education Program][23], the [newsletter team][24], and two global edit-a-thons: [Art and Feminsim][25] and [Menu Challenge][26]. I look forward to the many more to come! - -I would also like to thank [Sameer][27] and [Anna][28] (both previous members of the Wikipedia Education Program). - ------------------------------------------------------------------------------- - -via: https://opensource.com/life/16/4/my-open-source-story-sailesh-patnaik - -作者:[Sailesh Patnaik][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/saileshpat -[1]: https://en.wikipedia.org/wiki/Odia_language -[2]: https://en.wikipedia.org/wiki/Odisha -[3]: https://en.wikipedia.org/wiki/Bangladesh_Liberation_War -[4]: https://or.wikipedia.org/s/d2 -[5]: https://or.wikipedia.org/s/toq -[6]: https://commons.wikimedia.org/wiki/Commons:The_Rathyatra_Challenge -[7]: http://cis-india.org/openness/blog-old/odia-wikipedia-meets-google-developer-group -[8]: http://perception.cetb.in/events/odia-wikipedia-event/ -[9]: https://opencon2015kolkata.sched.org/speaker/sailesh.patnaik007 -[10]: https://meta.wikimedia.org/wiki/Bengali_Wikipedia_10th_Anniversary_Celebration_Kolkata -[11]: https://www.facebook.com/vishnu.vardhan.50746?fref=ts -[12]: http://cis-india.org/ -[13]: https://meta.wikimedia.org/wiki/CIS-A2K/Events/Train_the_Trainer_Program/2015 -[14]: https://en.wikipedia.org/wiki/Wikipedia:GLAM -[15]: https://www.facebook.com/ravidreams?fref=ts -[16]: https://commons.wikimedia.org/wiki/Commons:Wiki_Loves_Food -[17]: https://meta.wikimedia.org/wiki/WikiConference_India_2016 -[18]: https://or.wikipedia.org/s/sml -[19]: https://meta.wikimedia.org/wiki/CIS-A2K -[20]: https://or.wikipedia.org/s/xgx -[21]: https://or.wikipedia.org/s/ysg -[22]: https://or.wikipedia.org/s/ynj -[23]: https://outreach.wikimedia.org/wiki/Education -[24]: https://outreach.wikimedia.org/wiki/Talk:Education/News#Call_for_volunteers -[25]: https://en.wikipedia.org/wiki/User_talk:Saileshpat#Barnstar_for_Art_.26_Feminism_Challenge -[26]: https://opensource.com/life/15/11/tasty-translations-the-open-source-way -[27]: https://www.facebook.com/samirsharbaty?fref=ts -[28]: https://www.facebook.com/anna.koval.737?fref=ts diff --git a/translated/talk/my-open-source-story/20160415 A four year, action-packed experience with Wikipedia.md b/translated/talk/my-open-source-story/20160415 A four year, action-packed experience with Wikipedia.md new file mode 100644 index 0000000000..ce5bb497d7 --- /dev/null +++ b/translated/talk/my-open-source-story/20160415 A four year, action-packed experience with Wikipedia.md @@ -0,0 +1,74 @@ +在维基激动人心的四年 +======================================================= + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/wikipedia_checkuser_lead.jpg?itok=4lVDjSSM) + + +我自认为自己是个奥迪亚的维基人。我通过写文章和纠正错误的文章贡献[奥迪亚][1]知识(在印度的[奥里萨邦][2]的主要的语言 )给很多维基项目,像维基百科和维基文库,我也为用印地语和英语写的维基文章做贡献。 + +![](https://opensource.com/sites/default/files/resize/1st_day_at_odia_wikipedia_workshop_image_source_facebook-200x133.jpg) + +我对维基的爱从我第 10 次考试(像在美国的 10 年级学生的年级考试)之后看到的英文维基文章[孟加拉解放战争][3]开始。一不小心我打开了印度维基文章的链接,,并且开始阅读它. 在文章左边有用奥迪亚语写的东西, 所以我点击了一下, 打开了一篇在奥迪亚维基上的 [????/Bhārat][4] 文章. 发现了用母语写的维基让我很激动! + +![](https://opensource.com/sites/default/files/resize/introducing_wikipedia_at_google_io_image_by_gdg_bhubaneswar-251x166.png) + +一个邀请读者参加 2014 年 4 月 1 日第二次布巴内斯瓦尔的研讨会的标语引起了我的好奇。我过去从来没有为维基做过贡献, 只用它搜索过, 我并不熟悉开源和社区贡献流程。加上,我只有 15 岁。我注册了。在研讨会上有很多语言爱好者,我是中间最年轻的一个。尽管我害怕我父亲还是鼓励我去参与。他起了非常重要的作用—他不是一个维基媒体人,和我不一样,但是他的鼓励给了我改变奥迪亚维基的动力和参加社区活动的勇气。 + +我相信奥迪亚语言和文学需要改进很多错误的想法和知识缺口所以,我帮助组织关于奥迪亚维基的活动和和研讨会,我完成了如下列表: + +* 发起3次主要的 edit-a-thons 在奥迪亚维基:2015 年妇女节,2016年妇女节, abd [Nabakalebara edit-a-thon 2015][5] +* 在全印度发起了征集[檀车节][6]图片的比赛 +* 在谷歌的两大事件([谷歌I/O大会扩展][7]和谷歌开发节)中代表奥迪亚维基 +* 在2015[Perception][8]和第一次[Open Access India][9]会议 + +![](https://opensource.com/sites/default/files/resize/bengali_wikipedia_10th_anniversary_cc-by-sa4.0_biswaroop_ganguly-251x166.jpg) + +我只编辑维基项目到了去年,在 2015 年一月,当我出席[孟加拉语维基百科的十周年会议][10]和[毗瑟挐]活动时[11],[互联网和社会中心][12]主任,邀请我参加[培训培训师][13] 计划。我的灵感始于扩展奥迪亚维基,为[华丽][14]的活动举办的聚会和培训新的维基人。这些经验告诉我作为一个贡献者该如何为社区工作。 + +[Ravi][15],在当时维基的主任,在我的旅程也发挥了重要作用。他非常相信我让我参与到了[Wiki Loves Food][16],维基共享中的公共摄影比赛,组织方是[2016 印度维基会议][17]。在2015的 Loves Food 活动期间,我的团队在维基共享中加入了 10,000+ 有 CC BY-SA 协议的图片。Ravi 进一步巩固了我的承诺,和我分享很多关于维基媒体运动的信息,和他自己在 [奥迪亚维基百科13周年][18]的经历。 + +不到一年后,在 2015 年十二月,我成为了网络与社会中心的[获取知识的程序][19]的项目助理( CIS-A2K 运动)。我自豪的时刻之一是在普里的研讨会,我们从印度带了 20 个新的维基人来编辑奥迪亚维基媒体社区。现在,我的指导者在一个普里非正式聚会被叫作[WikiTungi][20]。我和这个小组一起工作,把 wikiquotes 变成一个真实的计划项目。在奥迪亚维基我也致力于缩小性别差距。[八个女编辑][21]也正帮助组织聚会和研讨会,参加 [Women's History month edit-a-thon][22]。 + +在我四年短暂而令人激动的旅行之中,我也参与到 [维基百科的教育项目][23],[通讯团队][24],两个全球的 edit-a-thons: [Art and Feminsim][25] 和 [Menu Challenge][26]。我期待着更多的到来! + +我还要感谢 [Sameer][27] 和 [Anna][28](都是之前维基百科教育计划的成员)。 + +------------------------------------------------------------------------------ + +via: https://opensource.com/life/16/4/my-open-source-story-sailesh-patnaik + +作者:[Sailesh Patnaik][a] +译者:[译者ID](https://github.com/hkurj) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/saileshpat +[1]: https://en.wikipedia.org/wiki/Odia_language +[2]: https://en.wikipedia.org/wiki/Odisha +[3]: https://en.wikipedia.org/wiki/Bangladesh_Liberation_War +[4]: https://or.wikipedia.org/s/d2 +[5]: https://or.wikipedia.org/s/toq +[6]: https://commons.wikimedia.org/wiki/Commons:The_Rathyatra_Challenge +[7]: http://cis-india.org/openness/blog-old/odia-wikipedia-meets-google-developer-group +[8]: http://perception.cetb.in/events/odia-wikipedia-event/ +[9]: https://opencon2015kolkata.sched.org/speaker/sailesh.patnaik007 +[10]: https://meta.wikimedia.org/wiki/Bengali_Wikipedia_10th_Anniversary_Celebration_Kolkata +[11]: https://www.facebook.com/vishnu.vardhan.50746?fref=ts +[12]: http://cis-india.org/ +[13]: https://meta.wikimedia.org/wiki/CIS-A2K/Events/Train_the_Trainer_Program/2015 +[14]: https://en.wikipedia.org/wiki/Wikipedia:GLAM +[15]: https://www.facebook.com/ravidreams?fref=ts +[16]: https://commons.wikimedia.org/wiki/Commons:Wiki_Loves_Food +[17]: https://meta.wikimedia.org/wiki/WikiConference_India_2016 +[18]: https://or.wikipedia.org/s/sml +[19]: https://meta.wikimedia.org/wiki/CIS-A2K +[20]: https://or.wikipedia.org/s/xgx +[21]: https://or.wikipedia.org/s/ysg +[22]: https://or.wikipedia.org/s/ynj +[23]: https://outreach.wikimedia.org/wiki/Education +[24]: https://outreach.wikimedia.org/wiki/Talk:Education/News#Call_for_volunteers +[25]: https://en.wikipedia.org/wiki/User_talk:Saileshpat#Barnstar_for_Art_.26_Feminism_Challenge +[26]: https://opensource.com/life/15/11/tasty-translations-the-open-source-way +[27]: https://www.facebook.com/samirsharbaty?fref=ts +[28]: https://www.facebook.com/anna.koval.737?fref=ts From 182bb5bcab56ab86b557cbf58f3bb29a925f73d4 Mon Sep 17 00:00:00 2001 From: hkurj <663831938@qq.com> Date: Thu, 19 May 2016 22:16:08 +0800 Subject: [PATCH 0780/1469] ok --- ...0415 A four year, action-packed experience with Wikipedia.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/talk/my-open-source-story/20160415 A four year, action-packed experience with Wikipedia.md b/translated/talk/my-open-source-story/20160415 A four year, action-packed experience with Wikipedia.md index ce5bb497d7..b2be6a7a01 100644 --- a/translated/talk/my-open-source-story/20160415 A four year, action-packed experience with Wikipedia.md +++ b/translated/talk/my-open-source-story/20160415 A four year, action-packed experience with Wikipedia.md @@ -23,7 +23,7 @@ ![](https://opensource.com/sites/default/files/resize/bengali_wikipedia_10th_anniversary_cc-by-sa4.0_biswaroop_ganguly-251x166.jpg) -我只编辑维基项目到了去年,在 2015 年一月,当我出席[孟加拉语维基百科的十周年会议][10]和[毗瑟挐]活动时[11],[互联网和社会中心][12]主任,邀请我参加[培训培训师][13] 计划。我的灵感始于扩展奥迪亚维基,为[华丽][14]的活动举办的聚会和培训新的维基人。这些经验告诉我作为一个贡献者该如何为社区工作。 +我只编辑维基项目到了去年,在 2015 年一月,当我出席[孟加拉语维基百科的十周年会议][10]和[毗瑟挐][11]活动时,[互联网和社会中心][12]主任,邀请我参加[培训培训师][13] 计划。我的灵感始于扩展奥迪亚维基,为[华丽][14]的活动举办的聚会和培训新的维基人。这些经验告诉我作为一个贡献者该如何为社区工作。 [Ravi][15],在当时维基的主任,在我的旅程也发挥了重要作用。他非常相信我让我参与到了[Wiki Loves Food][16],维基共享中的公共摄影比赛,组织方是[2016 印度维基会议][17]。在2015的 Loves Food 活动期间,我的团队在维基共享中加入了 10,000+ 有 CC BY-SA 协议的图片。Ravi 进一步巩固了我的承诺,和我分享很多关于维基媒体运动的信息,和他自己在 [奥迪亚维基百科13周年][18]的经历。 From f051e571046137604fc03fff4817b3f234cd6dc1 Mon Sep 17 00:00:00 2001 From: cposture Date: Fri, 20 May 2016 01:29:44 +0800 Subject: [PATCH 0781/1469] Translating by cposture --- sources/tech/20160512 Bitmap in Linux Kernel.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160512 Bitmap in Linux Kernel.md b/sources/tech/20160512 Bitmap in Linux Kernel.md index b7e832ba0a..06297fa204 100644 --- a/sources/tech/20160512 Bitmap in Linux Kernel.md +++ b/sources/tech/20160512 Bitmap in Linux Kernel.md @@ -1,3 +1,4 @@ +[Translating By cposture 20160520] Data Structures in the Linux Kernel ================================================================================ From b00b9fbf4ed6ce3482532cfc2f5f0d5cf76428f8 Mon Sep 17 00:00:00 2001 From: Kevin Sicong Jiang Date: Thu, 19 May 2016 23:42:26 -0500 Subject: [PATCH 0782/1469] Translation in progress by KevinSJ (#3992) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @KevinSJ 下次最好在本地的repo 里面提交一次,再发起 PR 。万一我手抖了弄错了就不好了 --- ...n introduction to data processing with Cassandra and Spark.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160511 An introduction to data processing with Cassandra and Spark.md b/sources/tech/20160511 An introduction to data processing with Cassandra and Spark.md index 149ab6fbb7..46331a9ae5 100644 --- a/sources/tech/20160511 An introduction to data processing with Cassandra and Spark.md +++ b/sources/tech/20160511 An introduction to data processing with Cassandra and Spark.md @@ -1,3 +1,4 @@ +Translating KevinSJ An introduction to data processing with Cassandra and Spark ============================================================== From 8ed7798fd9392bdfde0610edcca48ac86cf7331f Mon Sep 17 00:00:00 2001 From: FSSlc Date: Fri, 20 May 2016 22:58:49 +0800 Subject: [PATCH 0783/1469] =?UTF-8?q?=E9=A6=96=E6=AC=A1=E6=A0=A1=E5=AF=B9?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20160225 The Tao of project management.md | 106 ++++++++---------- 1 file changed, 45 insertions(+), 61 deletions(-) diff --git a/translated/tech/20160225 The Tao of project management.md b/translated/tech/20160225 The Tao of project management.md index e0238e2cee..758a7d0217 100644 --- a/translated/tech/20160225 The Tao of project management.md +++ b/translated/tech/20160225 The Tao of project management.md @@ -4,63 +4,55 @@ ![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BUSINESS_orgchart1.png?itok=DGsp6jB5) -[道德经][1],[据确认][2]为公元前六世纪的圣人[老子][3]所编写,是现存被翻译的语言版本最多的经文。从[宗教][4]到[关于约会的有趣电影][5]等一切的一切,它都影响至深,作者们借用它来隐喻,以解释各种各样的事情(甚至是[编程][6])。 +[道德经][1],[被认为][2]是由圣人[老子][3]于公元前六世纪时所编写,是现存最为广泛翻译的经文之一。从[宗教][4]到[关于约会的有趣电影][5]等方方面面,它都深深地影响着它们,作者们借用它来做隐喻,以解释各种各样的事情(甚至是[编程][6])。 -当考虑开放性组织的项目管理时上面这段文字会立马浮现在我脑海。 +在思考有关开放性组织的项目管理时,我的脑海中便立马浮现出上面的这段文字。 -这听起来会很奇怪。要理解我为什么会有这种想法,应该是从读了*《开放性组织:点燃激情提升执行力》*这书开始的,它是红帽公司总裁、CEO Jim Whitehurst 所著作的关于企业文化和新领导榜样的宣言。在这本书里,Jim(给予其它红帽子人的一点帮助而) 解释了传统组织机构(“自上而下”的方式,做决定的是高层,命令下达到员工,而员工是通过薪酬和晋升来激励的)和开放组织机构(自下而上,领导专注于激励和鼓励,员工被充分授权使其发挥主观能动性而做得最好)的差异。 +这听起来可能会有点奇怪。若要理解我的这种想法从何而来,你应该读读 +*《开放性组织:点燃激情提升执行力》* 这本书,它是红帽公司总裁、首席执行官 Jim Whitehurst 所写的一本有关企业文化和新领导力范式的宣言。在这本书中,Jim(还有来自其他红帽人的一点帮助)解释了传统组织机构(一种 “自上而下” 的方式,来自高层的决策被传达到员工,而员工通过晋升和薪酬来激励)和开放性组织机构(一种 自下而上 的方式,领导专注于激励和鼓励,员工被充分授权以各尽其能)之间的差异。 -在开放性组织中的员工意味有激情、有目的性和有参与感,这些我认为是项目管理者应该关注的。 +在开放性组织中的员工都是被激情、目标和参与感所激励,这个观点正是我认为项目管理者所应该关注的。 -要解释这一切,让我们回到*道德经*上来。 +要解释这一切,我将从*道德经*上寻找依据。 ### 不要让工作职衔框住自身 ->道,可道, ->非常道; ->名,可名, ->非常名。 +>道,可道也,非恒道也。名,可名也,非恒名也。 ->无,名天地之始; ->有,名万物之母。 +>“无”,名天地之始;“有”,名万物之母。 [[1]][7] -项目管理到底是什么?做为一个项目管理者应该做些什么呢? +项目管理到底是什么?作为一个项目管理者应该做些什么呢? -如您所想,项目管理者的一部分工作就是管理项目:收集需求、项目相关人员的沟通、设置项目优先级、安排任务、帮助团队解决困扰。许多教育培训机构都可以教授如何做好项目管理,这些技能值得去学习。 +如您所想,项目管理者的一部分工作就是管理项目:收集需求、与项目相关人员沟通、设置项目优先级、安排任务、帮助团队解决困扰。许多机构都可以教你如何做好项目管理,并且这些技能你值得拥有。 -然而,在开放性组织中,字面上的项目管理技能仅仅只是项目管理者需要做到一小部分,这些组织需要更多的:勇气。如果您擅长于管理项目(或者是真的擅长于任何工作),那么您就进入了舒适区。这时候就是需要鼓起勇气开始尝试冒险之时。 +然而,在开放性组织中,字面上的项目管理技能仅仅只是项目管理者需要做到一小部分,这些组织需要更多其他的东西:即勇气。如果你擅长于管理项目(或者是真的擅长于任何工作),那么你就进入了舒适区。这时候就是需要鼓起勇气开始尝试冒险之时。 -您有勇气跨出舒适区吗?向权威人士提出提出挑战性问题,可能会引发对方的不快,也可能会发现一个好的方法,您有勇气这样做吗?有确定需要做的下一件事,然后真正去完成它的勇气吗?有主动去解决因为沟通空白而留下的问题的勇气吗?有去尝试各种事情的勇气吗?有失败的勇气吗? +您有勇气跨出舒适区吗?向权威人士提出挑战性的问题,可能会引发对方的不快,但也可能会开启一个更好的方法,您有勇气这样做吗?有确定需要做的下一件事,然后真正去完成它的勇气吗?有主动去解决因为交流的鸿沟而遗留下来的问题的勇气吗?有去尝试各种事情的勇气吗?有失败的勇气吗? -道德经的开篇(上面引用的)就表明词语、标签、名字这些是有限制的,也包括工作职衔。在开放性组织中,项目经理不仅仅是执行管理项目所需的机械任务,而且要帮助团队完成组织的使命,尽管只是定义。 +道德经的开篇(上面引用的)就表明词语、标签、名字这些是有限制的,当然也包括工作职衔。在开放性组织中,项目经理不仅仅是执行管理项目所需的机械任务,而且要帮助团队完成组织的使命,尽管这已经被限定了。 -### 结交正确的人 +### 联系起合适的人 ->三十辐共一毂, ->当其无, ->有车之用。 +>三十辐共一轂,当其无,有车之用。 [[11]][8] -当我开始学习要过渡到项目管理时,遇到最困难的一课就是并不是所有解决方案都是可接受的,甚至有的连预期都达不到。那对我来说是全新的,我喜欢所有的解决方案。但作为项目管理者,我的角色更多的是与人沟通--因此与那些有解决方案的人合作更有效率。 +当我过渡到项目管理的工作时,我必须学会的最为困难的一课是:并不是所有解决方案都是完全可接受的,甚至有的连预期都达不到。这对我来说是全新的,我喜欢所有的解决方案。但作为项目管理者,我的角色更多的是与人沟通--使得那些确实有解决方案的人可以更高效地合作。 -这决不是逃避责任和不负责的意思。这意味着可以很舒适的说,“我不知道,但我会给您找出答案”,然后就可迅速的关闭此循环。 +这并不是逃避责任或者不负责。这意味着可以很舒适的说,“我不知道,但我会给你找出答案”,然后就可迅速地结束这个循环。 -想像马车的车轮。无中心孔的稳定性和方向,辐条车轮会自行崩溃。在一个开放性的组织中,项目管理者可以帮助一个团队,把正确的人凝聚在一起,主持积极讨论,以保持团队一直前进。 +想像一下马车的车轮,如果没有毂中的孔洞所提供的稳定性和方向,辐条便会失去支持,车轮也会散架。在一个开放性的组织中,项目管理者可以通过把合适的人凝聚在一起,培养正确的讨论话题来帮助团队保持持续向前的动力。 -### 信任您的团队 +### 信任你的团队 ->太上, 不知有之; ->其次,亲而誉之; ->其次,畏之; ->其次,侮之。 +>太上,不知有之;其次,亲而誉之;其次,畏之;其次,侮之。 > >信不足焉,有不信焉。 > ->悠兮,其贵言。功成事遂,百姓皆谓“我自然”。 +>悠兮,其贵言。功成事遂,百姓皆谓:“我自然”。 [[17]][9] -[Rebecca Fernandez][10]曾经告诉我开放性组织的领导与其它最大的不同点,不是取得别人的信任,而是信任别人。 +[Rebecca Fernandez][10]曾经告诉我开放性组织的领导与其它组织的领导者最大的不同点在于,我们不取得别人的信任,而是信任别人。 开放性组织会雇佣那些非常聪明的,且对公司正在做的事情充满激情的人来做工作。为了能使他们能更好的工作,我们会提供其所需,并尊重他们的工作方式。 @@ -71,61 +63,54 @@ >上德无为而无以为;下德为之而有以为。 [[38]][11] -你认识总是忙忙碌碌的这种类型的人吗?认识因为有太多事情要做而看起来疲倦和压抑的人吗? +你认识那类总是极其忙碌的人吗?认识那些因为有太多事情要做而看起来疲倦和压抑的人吗? 不要成为那样的人。 -我知道说比做容易。要远离那种人最有帮助的事就是请记住大家都很忙。我没有那样讨厌的同事。 +我知道说比做容易。帮助我没有成为那类人的最重要的东西是:我时刻记着*大家都很忙*这件事。我没有一个那样无聊的同事。 -但需要有人在狂风暴雨中保持镇定;需要这样的人,能根据实际和一天工作时间的数量找到平衡参数的方式来做工作,并安慰团队让一切都好(因为这是我们正在做的事实)。 +但总需要有人成为在狂风暴雨中仍保持镇定的人。总需要有人能够宽慰团队告诉他们一切都会好起来,我们将在现实和一天中工作时间有限的情况下,找到方法使得任务能够完成(因为事实就是这样的,而且我们必须这样)。 -要成为那样的人。 +成为那样的人吧。 -道德经所说的,在我理解来就是总是夸夸其谈的人其实并没有干实事。如里您能把工作做的得心应手的话,那就说明您的工作做对了。 +对于上面这段道德经所说的,我的理解是那些总是谈论他或她正在做什么的人实际上并*没有时间*去做他们谈论的事。如果相比于你周围的人,你能把你的工作做的毫不费劲,那就说明你的工作做对了。 -### 作为一个文化传教士 +### 做一名文化传教士 ->上士闻道,勤而行之; ->中士闻道,若存若亡; ->下士闻道,大笑之。 ->不笑不足以为道。 +>上士闻道,勤而行之;中士闻道,若存若亡;下士闻道,大笑之。不笑不足以為道。 [[41]][12] -去年秋天,我跟着一群联邦雇员注册了一个工商管理硕士课程。当我开始介绍我公司的文化、价值和伦理框架以及公司如何运行时,我的同学和教授都认为我就像一个天真可爱的小姑娘在做着[许多甜美的白日梦][13],这就是我得到的直接印象。他们告诉我事情并不是如此的。他们告诉我应该进一步考察。 +去年秋天,我跟着一群联邦雇员注册了一个工商管理硕士课程。当我开始介绍我们公司的文化、价值和伦理框架时,我得到的直接印象是:我的同学和教授都认为我就像一个天真可爱的小姑娘,做着许多关于公司应该如何运作的[甜美白日梦][13]。他们告诉我事情不可能是它们看起来的那样,他们还告诉我应该进一步考察。 -所有我照做了。 +所以我照做了。 -到现在我发现:正是如此。 +然而我发现的是:事情*恰好*是他们看起来的那样。 -开放性组织的企业文化。应该跟随着企业的成长而时时维护那些文化,以使它随时精神焕发,充满斗志。我(和其它开源组织的成员)并不想过如我同学所描述的“为生活而工作”。我需要有激情和有目的性;我需要明白自己的日常工作如何对那些有价值的东西服务。 +在开放性组织,关于企业文化,人们应该随着企业的成长而时时维护那些文化,以使它随时精神焕发,充满斗志。我(和其它开源组织的成员)并不想过如我同学所描述的那样,“为生活而工作”。我需要有激情、有目标,需要明白自己的日常工作是如何对那些我所坚信的东西做贡献的。 -作为一个项目管理者,虽然你的工作与培养你的团队的文化无关,但是工作本身就是文化。 +作为一个项目管理者,你可能会认为在你的团队中,你的工作对培养你们公司的企业文化没有多少帮助。然而你的工作正是孕育文化本身。 -### 持续改善 +### Kaizen (持续改善) ->为学日益, ->为道日损, ->损之又损,以至于无为。无为而无不为,取天下常以无事 +>为学日益,为道日损。损之又损,以至于无为。无为而无不为。 [[48]][14] -虽然项目管理的一般领域都太过于专注最新最强大的的工具,但是您应该使用哪种工具这问题的答案总是一致的:“最简单的”。 +项目管理的一般领域都太过于专注最新、最强大的的工具,但对于应该使用哪种工具,这个问题的答案总是一致的:“最简单的”。 -例如,我将任务列表放在桌面的一个文本文件中,因为它很单纯,没有不必要的干扰。您想介绍给团队的,无论是何种工具、流程和程序都应该是能提高效率,排除障碍的,而不是引入额外的复杂性。所以不应该专注于工具本身,而应该专注于使用这些工具来解决的问题。 +例如,我将任务列表放在桌面的一个文本文件中,因为它很单纯,不会受到不必要的干扰。您想介绍给团队的,无论是何种工具、流程和程序都应该是能提高效率,排除障碍的,而不是引入额外的复杂性。所以与其专注于工具,还不如专注于要使用这些工具来解决的*问题*。 -我最喜欢的一个项目经理在一个灵活的世界是有自由扔什么不工作。在 Agile world 中我喜欢项目管理者能自由的做决定,抛出不能做的工作。这就是改善的概念,或叫“持续改进”。不要害怕尝试和失败。失败是我们在学习的过程中所用的标签,不能代表什么,但这是提高的唯一方式。 +作为一个项目经理,我最喜爱的部分是在敏捷世界中,我有自由抛弃那些没有成效的东西的权利。这与 kaizen 的概念相关,或叫 “持续改进”。不要害怕尝试和失败。失败是我们在探索什么能够起作用,什么不能起作用的过程中所用的标签,这是提高的唯一方式。 - -最好的过程都不是一蹴而就的。作为项目管理者,您应该帮助您的团队,支持团队让其自己提升,而不是强迫团队。 +最好的过程都不是一蹴而就的。作为项目管理者,你应该通过支持他们,而不是强迫他们去做某些事来帮助你的团队。 ### 实践 >天下皆谓我"道"大,似不肖。夫唯大,故似不肖。若肖,久矣其细也夫! [[67]][15] -我相信开放性组织正在做的。开放性组织在管理领域的工作几乎和他们所提供的产品和服务一样重要。我们有机会以身作则,激发他人的激情和目的,创造激励和充分授权的工作环境。 - -我鼓励您们找到办法把这些想法融入到自己的项目和团队中,看看会发生什么。了解组织的使命和您的项目怎么样帮助它们。鼓起勇气,尝试一些不好的事情,同时不要忘记和我们的社区分享你所学到的经验,这样我们就可以继续改进。 +我相信开放性组织正在做的事。开放性组织在管理领域的工作几乎与他们提供的产品和服务一样重要。我们有机会以身作则,激发他人的激情和目的,创造激励和充分授权的工作环境。 +我鼓励你们找到办法把这些想法融入到自己的项目和团队中,看看会发生什么。了解你们组织的使命,知晓你的项目是如何为这个使命做贡献的。鼓起勇气,尝试某些看起来没有多少成效的事,同时不要忘记和我们的社区分享你所学到的经验,这样我们就可以继续改进。 -------------------------------------------------------------------------------- @@ -133,7 +118,7 @@ via: https://opensource.com/open-organization/16/2/tao-project-management 作者:[Allison Matlack][a] 译者:[runningwater](https://github.com/runningwater) -校对:[校对者ID](https://github.com/校对者ID) +校对:[FSSlc](https://github.com/FSSlc) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -146,11 +131,10 @@ via: https://opensource.com/open-organization/16/2/tao-project-management [6]: http://www.mit.edu/~xela/tao.html [7]: http://acc6.its.brooklyn.cuny.edu/~phalsall/texts/taote-v3.html#1 [8]: http://acc6.its.brooklyn.cuny.edu/~phalsall/texts/taote-v3.html#11 -[9]:http://acc6.its.brooklyn.cuny.edu/~phalsall/texts/taote-v3.html#17 +[9]: http://acc6.its.brooklyn.cuny.edu/~phalsall/texts/taote-v3.html#17 [10]: https://opensource.com/users/rebecca [11]: http://acc6.its.brooklyn.cuny.edu/~phalsall/texts/taote-v3.html#38 [12]: http://acc6.its.brooklyn.cuny.edu/~phalsall/texts/taote-v3.html#41 [13]: https://opensource.com/open-organization/15/9/reflections-open-organization-starry-eyed-dreamer [14]: http://acc6.its.brooklyn.cuny.edu/~phalsall/texts/taote-v3.html#48 -[15]: http://acc6.its.brooklyn.cuny.edu/~phalsall/texts/taote-v3.html#67 - +[15]: http://acc6.its.brooklyn.cuny.edu/~phalsall/texts/taote-v3.html#67 \ No newline at end of file From adb009ba1e6a6cefcc6ef150cb3c8b4e6fd90596 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 21 May 2016 10:16:31 +0800 Subject: [PATCH 0784/1469] =?UTF-8?q?20160521-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit python3 , encrypt , --- ...160518 Python 3: An Intro to Encryption.md | 278 ++++++++++++++++++ 1 file changed, 278 insertions(+) create mode 100644 sources/tech/20160518 Python 3: An Intro to Encryption.md diff --git a/sources/tech/20160518 Python 3: An Intro to Encryption.md b/sources/tech/20160518 Python 3: An Intro to Encryption.md new file mode 100644 index 0000000000..43c042d5c1 --- /dev/null +++ b/sources/tech/20160518 Python 3: An Intro to Encryption.md @@ -0,0 +1,278 @@ +Python 3: An Intro to Encryption +=================================== + +Python 3 doesn’t have very much in its standard library that deals with encryption. Instead, you get hashing libraries. We’ll take a brief look at those in the chapter, but the primary focus will be on the following 3rd party packages: PyCrypto and cryptography. We will learn how to encrypt and decrypt strings with both of these libraries. + +--- + +### Hashing + +If you need secure hashes or message digest algorithms, then Python’s standard library has you covered in the **hashlib** module. It includes the FIPS secure hash algorithms SHA1, SHA224, SHA256, SHA384, and SHA512 as well as RSA’s MD5 algorithm. Python also supports the adler32 and crc32 hash functions, but those are in the **zlib** module. + +One of the most popular uses of hashes is storing the hash of a password instead of the password itself. Of course, the hash has to be a good one or it can be decrypted. Another popular use case for hashes is to hash a file and then send the file and its hash separately. Then the person receiving the file can run a hash on the file to see if it matches the hash that was sent. If it does, then that means no one has changed the file in transit. + + +Let’s try creating an md5 hash: + +``` +>>> import hashlib +>>> md5 = hashlib.md5() +>>> md5.update('Python rocks!') +Traceback (most recent call last): + File "", line 1, in + md5.update('Python rocks!') +TypeError: Unicode-objects must be encoded before hashing +>>> md5.update(b'Python rocks!') +>>> md5.digest() +b'\x14\x82\xec\x1b#d\xf6N}\x16*+[\x16\xf4w' +``` + +Let’s take a moment to break this down a bit. First off, we import **hashlib** and then we create an instance of an md5 HASH object. Next we add some text to the hash object and we get a traceback. It turns out that to use the md5 hash, you have to pass it a byte string instead of a regular string. So we try that and then call it’s **digest** method to get our hash. If you prefer the hex digest, we can do that too: + +``` +>>> md5.hexdigest() +'1482ec1b2364f64e7d162a2b5b16f477' +``` + +There’s actually a shortcut method of creating a hash, so we’ll look at that next when we create our sha512 hash: + +``` +>>> sha = hashlib.sha1(b'Hello Python').hexdigest() +>>> sha +'422fbfbc67fe17c86642c5eaaa48f8b670cbed1b' +``` + +As you can see, we can create our hash instance and call its digest method at the same time. Then we print out the hash to see what it is. I chose to use the sha1 hash as it has a nice short hash that will fit the page better. But it’s also less secure, so feel free to try one of the others. + +--- + +### Key Derivation + +Python has pretty limited support for key derivation built into the standard library. In fact, the only method that hashlib provides is the **pbkdf2_hmac** method, which is the PKCS#5 password-based key derivation function 2. It uses HMAC as its psuedorandom function. You might use something like this for hashing your password as it supports a salt and iterations. For example, if you were to use SHA-256 you would need a salt of at least 16 bytes and a minimum of 100,000 iterations. + +As a quick aside, a salt is just random data that you use as additional input into your hash to make it harder to “unhash” your password. Basically it protects your password from dictionary attacks and pre-computed rainbow tables. + +Let’s look at a simple example: + +``` +>>> import binascii +>>> dk = hashlib.pbkdf2_hmac(hash_name='sha256', + password=b'bad_password34', + salt=b'bad_salt', + iterations=100000) +>>> binascii.hexlify(dk) +b'6e97bad21f6200f9087036a71e7ca9fa01a59e1d697f7e0284cd7f9b897d7c02' +``` + +Here we create a SHA256 hash on a password using a lousy salt but with 100,000 iterations. Of course, SHA is not actually recommended for creating keys of passwords. Instead you should use something like **scrypt** instead. Another good option would be the 3rd party package, bcrypt. It is designed specifically with password hashing in mind. + +--- + +### PyCryptodome + +The PyCrypto package is probably the most well known 3rd party cryptography package for Python. Sadly PyCrypto’s development stopping in 2012. Others have continued to release the latest version of PyCryto so you can still get it for Python 3.5 if you don’t mind using a 3rd party’s binary. For example, I found some binary Python 3.5 wheels for PyCrypto on Github (https://github.com/sfbahr/PyCrypto-Wheels). + +Fortunately there is a fork of the project called PyCrytodome that is a drop-in replacement for PyCrypto. To install it for Linux, you can use the following pip command: + + +``` +pip install pycryptodome +``` + +Windows is a bit different: + +``` +pip install pycryptodomex +``` + +If you run into issues, it’s probably because you don’t have the right dependencies installed or you need a compiler for Windows. Check out the PyCryptodome [website][1] for additional installation help or to contact support. + +Also worth noting is that PyCryptodome has many enhancements over the last version of PyCrypto. It is well worth your time to visit their home page and see what new features exist. + +### Encrypting a String + +Once you’re done checking their website out, we can move on to some examples. For our first trick, we’ll use DES to encrypt a string: + +``` +>>> from Crypto.Cipher import DES +>>> key = 'abcdefgh' +>>> def pad(text): + while len(text) % 8 != 0: + text += ' ' + return text +>>> des = DES.new(key, DES.MODE_ECB) +>>> text = 'Python rocks!' +>>> padded_text = pad(text) +>>> encrypted_text = des.encrypt(text) +Traceback (most recent call last): + File "", line 1, in + encrypted_text = des.encrypt(text) + File "C:\Programs\Python\Python35-32\lib\site-packages\Crypto\Cipher\blockalgo.py", line 244, in encrypt + return self._cipher.encrypt(plaintext) +ValueError: Input strings must be a multiple of 8 in length +>>> encrypted_text = des.encrypt(padded_text) +>>> encrypted_text +b'>\xfc\x1f\x16x\x87\xb2\x93\x0e\xfcH\x02\xd59VQ' +``` + +This code is a little confusing, so let’s spend some time breaking it down. First off, it should be noted that the key size for DES encryption is 8 bytes, which is why we set our key variable to a size letter string. The string that we will be encrypting must be a multiple of 8 in length, so we create a function called **pad** that can pad any string out with spaces until it’s a multiple of 8. Next we create an instance of DES and some text that we want to encrypt. We also create a padded version of the text. Just for fun, we attempt to encrypt the original unpadded variant of the string which raises a **ValueError**. Here we learn that we need that padded string after all, so we pass that one in instead. As you can see, we now have an encrypted string! + +Of course the example wouldn’t be complete if we didn’t know how to decrypt our string: + +``` +>>> des.decrypt(encrypted_text) +b'Python rocks! ' +``` + +Fortunately, that is very easy to accomplish as all we need to do is call the **decrypt** method on our des object to get our decrypted byte string back. Our next task is to learn how to encrypt and decrypt a file with PyCrypto using RSA. But first we need to create some RSA keys! + +### Create an RSA Key + +If you want to encrypt your data with RSA, then you’ll need to either have access to a public / private RSA key pair or you will need to generate your own. For this example, we will just generate our own. Since it’s fairly easy to do, we will do it in Python’s interpreter: + +``` +>>> from Crypto.PublicKey import RSA +>>> code = 'nooneknows' +>>> key = RSA.generate(2048) +>>> encrypted_key = key.exportKey(passphrase=code, pkcs=8, + protection="scryptAndAES128-CBC") +>>> with open('/path_to_private_key/my_private_rsa_key.bin', 'wb') as f: + f.write(encrypted_key) +>>> with open('/path_to_public_key/my_rsa_public.pem', 'wb') as f: + f.write(key.publickey().exportKey()) +``` + +First we import **RSA** from **Crypto.PublicKey**. Then we create a silly passcode. Next we generate an RSA key of 2048 bits. Now we get to the good stuff. To generate a private key, we need to call our RSA key instance’s **exportKey** method and give it our passcode, which PKCS standard to use and which encryption scheme to use to protect our private key. Then we write the file out to disk. + +Next we create our public key via our RSA key instance’s **publickey** method. We used a shortcut in this piece of code by just chaining the call to exportKey with the publickey method call to write it to disk as well. + +### Encrypting a File + +Now that we have both a private and a public key, we can encrypt some data and write it to a file. Here’s a pretty standard example: + +``` +from Crypto.PublicKey import RSA +from Crypto.Random import get_random_bytes +from Crypto.Cipher import AES, PKCS1_OAEP + +with open('/path/to/encrypted_data.bin', 'wb') as out_file: + recipient_key = RSA.import_key( + open('/path_to_public_key/my_rsa_public.pem').read()) + session_key = get_random_bytes(16) + + cipher_rsa = PKCS1_OAEP.new(recipient_key) + out_file.write(cipher_rsa.encrypt(session_key)) + + cipher_aes = AES.new(session_key, AES.MODE_EAX) + data = b'blah blah blah Python blah blah' + ciphertext, tag = cipher_aes.encrypt_and_digest(data) + + out_file.write(cipher_aes.nonce) + out_file.write(tag) + out_file.write(ciphertext) +``` + +The first three lines cover our imports from PyCryptodome. Next we open up a file to write to. Then we import our public key into a variable and create a 16-byte session key. For this example we are going to be using a hybrid encryption method, so we use PKCS#1 OAEP, which is Optimal asymmetric encryption padding. This allows us to write a data of an arbitrary length to the file. Then we create our AES cipher, create some data and encrypt the data. This will return the encrypted text and the MAC. Finally we write out the nonce, MAC (or tag) and the encrypted text. + +As an aside, a nonce is an arbitrary number that is only used for crytographic communication. They are usually random or pseudorandom numbers. For AES, it must be at least 16 bytes in length. Feel free to try opening the encrypted file in your favorite text editor. You should just see gibberish. + +Now let’s learn how to decrypt our data: + +``` +from Crypto.PublicKey import RSA +from Crypto.Cipher import AES, PKCS1_OAEP + +code = 'nooneknows' + +with open('/path/to/encrypted_data.bin', 'rb') as fobj: + private_key = RSA.import_key( + open('/path_to_private_key/my_rsa_key.pem').read(), + passphrase=code) + + enc_session_key, nonce, tag, ciphertext = [ fobj.read(x) + for x in (private_key.size_in_bytes(), + 16, 16, -1) ] + + cipher_rsa = PKCS1_OAEP.new(private_key) + session_key = cipher_rsa.decrypt(enc_session_key) + + cipher_aes = AES.new(session_key, AES.MODE_EAX, nonce) + data = cipher_aes.decrypt_and_verify(ciphertext, tag) + +print(data) +``` + +If you followed the previous example, this code should be pretty easy to parse. In this case, we are opening our encrypted file for reading in binary mode. Then we import our private key. Note that when you import the private key, you must give it your passcode. Otherwise you will get an error. Next we read in our file. You will note that we read in the private key first, then the next 16 bytes for the nonce, which is followed by the next 16 bytes which is the tag and finally the rest of the file, which is our data. + +Then we need to decrypt our session key, recreate our AES key and decrypt the data. + +You can use PyCryptodome to do much, much more. However we need to move on and see what else we can use for our cryptographic needs in Python. + +--- + +### The cryptography package + +The **cryptography** package aims to be “cryptography for humans” much like the **requests** library is “HTTP for Humans”. The idea is that you will be able to create simple cryptographic recipes that are safe and easy-to-use. If you need to, you can drop down to low=level cryptographic primitives, which require you to know what you’re doing or you might end up creating something that’s not very secure. + +If you are using Python 3.5, you can install it with pip, like so: + +``` +pip install cryptography +``` + +You will see that cryptography installs a few dependencies along with itself. Assuming that they all completed successfully, we can try encrypting some text. Let’s give the **Fernet** symmetric encryption algorithm. The Fernet algorithm guarantees that any message you encrypt with it cannot be manipulated or read without the key you define. Fernet also support key rotation via **MultiFernet**. Let’s take a look at a simple example: + +``` +>>> from cryptography.fernet import Fernet +>>> cipher_key = Fernet.generate_key() +>>> cipher_key +b'APM1JDVgT8WDGOWBgQv6EIhvxl4vDYvUnVdg-Vjdt0o=' +>>> cipher = Fernet(cipher_key) +>>> text = b'My super secret message' +>>> encrypted_text = cipher.encrypt(text) +>>> encrypted_text +(b'gAAAAABXOnV86aeUGADA6mTe9xEL92y_m0_TlC9vcqaF6NzHqRKkjEqh4d21PInEP3C9HuiUkS9f' + b'6bdHsSlRiCNWbSkPuRd_62zfEv3eaZjJvLAm3omnya8=') +>>> decrypted_text = cipher.decrypt(encrypted_text) +>>> decrypted_text +b'My super secret message' +``` + +First off we need to import Fernet. Next we generate a key. We print out the key to see what it looks like. As you can see, it’s a random byte string. If you want, you can try running the **generate_key** method a few times. The result will always be different. Next we create our Fernet cipher instance using our key. + +Now we have a cipher we can use to encrypt and decrypt our message. The next step is to create a message worth encrypting and then encrypt it using the **encrypt** method. I went ahead and printed our the encrypted text so you can see that you can no longer read the text. To **decrypt** our super secret message, we just call decrypt on our cipher and pass it the encrypted text. The result is we get a plain text byte string of our message. + +--- + +### Wrapping Up + +This chapter barely scratched the surface of what you can do with PyCryptodome and the cryptography packages. However it does give you a decent overview of what can be done with Python in regards to encrypting and decrypting strings and files. Be sure to read the documentation and start experimenting to see what else you can do! + +--- + +### Related Reading + +PyCrypto Wheels for Python 3 on [github][2] + +PyCryptodome [documentation][3] + +Python’s Cryptographic [Services][4] + +The cryptography package’s [website][5] + +------------------------------------------------------------------------------ + +via: http://www.blog.pythonlibrary.org/2016/05/18/python-3-an-intro-to-encryption/ + +作者:[Mike][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.blog.pythonlibrary.org/author/mld/ +[1]: http://pycryptodome.readthedocs.io/en/latest/ +[2]: https://github.com/sfbahr/PyCrypto-Wheels +[3]: http://pycryptodome.readthedocs.io/en/latest/src/introduction.html +[4]: https://docs.python.org/3/library/crypto.html +[5]: https://cryptography.io/en/latest/ From e09c30b9119649247e05e6b3c5b51628e72ab03f Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 21 May 2016 15:21:53 +0800 Subject: [PATCH 0785/1469] =?UTF-8?q?20160521-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit docker , Raspberry PI --- ... Rapid prototyping with docker-compose.md | 142 ++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 sources/tech/20160512 Rapid prototyping with docker-compose.md diff --git a/sources/tech/20160512 Rapid prototyping with docker-compose.md b/sources/tech/20160512 Rapid prototyping with docker-compose.md new file mode 100644 index 0000000000..0c67223697 --- /dev/null +++ b/sources/tech/20160512 Rapid prototyping with docker-compose.md @@ -0,0 +1,142 @@ + +Rapid prototyping with docker-compose +======================================== + +In this write-up we'll look at a Node.js prototype for **finding stock of the Raspberry PI Zero** from three major outlets in the UK. + +I wrote the code and deployed it to an Ubuntu VM in Azure within a single evening of hacking. Docker and the docker-compose tool made the deployment and update process extremely quick. + +### Remember linking? + +If you've already been through the [Hands-On Docker tutorial][1] then you will have experience linking Docker containers on the command line. Linking a Node hit counter to a Redis server on the command line may look like this: + +``` +$ docker run -d -P --name redis1 +$ docker run -d hit_counter -p 3000:3000 --link redis1:redis +``` + +Now imagine your application has three tiers + +- Web front-end +- Batch tier for processing long running tasks +- Redis or mongo database + +Explicit linking through `--link` is just about manageable with a couple of containers, but can get out of hand as we add more tiers or containers to the application. + +### Enter docker-compose + +![](http://blog.alexellis.io/content/images/2016/05/docker-compose-logo-01.png) +>Docker Compose logo + +The docker-compose tool is part of the standard Docker Toolbox and can also be downloaded separately. It provides a rich set of features to configure all of an application's parts through a plain-text YAML file. + +The above example would look like this: + +``` +version: "2.0" +services: + redis1: + image: redis + hit_counter: + build: ./hit_counter + ports: + - 3000:3000 +``` + +From Docker 1.10 onwards we can take advantage of network overlays to help us scale out across multiple hosts. Prior to this linking only worked across a single host. The `docker-compose scale` command can be used to bring on more computing power as the need arises. + +>View the [docker-compose][2] reference on docker.com + +### Real-world example: Raspberry PI Stock Alert + +![](http://blog.alexellis.io/content/images/2016/05/Raspberry_Pi_Zero_ver_1-3_1_of_3_large.JPG) +>The new Raspberry PI Zero v1.3 image courtesy of Pimoroni + +There is a huge buzz around the Raspberry PI Zero - a tiny microcomputer with a 1GHz CPU and 512MB RAM capable of running full Linux, Docker, Node.js, Ruby and many other popular open-source tools. One of the best things about the PI Zero is that costs only 5 USD. That also means that stock gets snapped up really quickly. + +*If you want to try Docker or Swarm on the PI check out the tutorial below.* + +>[Docker Swarm on the PI Zero][3] + +### Original site: whereismypizero.com + +I found a webpage which used screen scraping to find whether 4-5 of the most popular outlets had stock. + +- The site contained a static HTML page +- Issued one XMLHttpRequest per outlet accessing /public/api/ +- The server issued the HTTP request to each shop and performed the scraping + +Every call to /public/api/ took 3 seconds to execute and using Apache Bench (ab) I was only able to get through 0.25 requests per second. + +### Reinventing the wheel + +The retailers didn't seem to mind whereismypizero.com scraping their sites for stock, so I set about writing a similar tool from the ground up. I had the intention of handing a much higher amount of requests per second through caching and de-coupling the scrape from the web tier. Redis was the perfect tool for the job. It allowed me to set an automatically expiring key/value pair (i.e. a simple cache) and also to transmit messages between Node processes through pub/sub. + +>Fork or star the code on Github: [alexellis/pi_zero_stock][4] + +If you've worked with Node.js before then you will know it is single-threaded and that any CPU intensive tasks such as parsing HTML or JSON could lead to a slow-down. One way to mitigate that is to use a second worker process and a Redis messaging channel as connective tissue between this and the web tier. + +- Web tier + -Gives 200 for cache hit (Redis key exists for store) + -Gives 202 for cache miss (Redis key doesn't exist, so issues message) + -Since we are only ever reading a Redis key the response time is very quick. +- Stock Fetcher + -Performs HTTP request + -Scrapes for different types of web stores + -Updates a Redis key with a cache expire of 60 seconds + -Also locks a Redis key to prevent too many in-flight HTTP requests to the web stores. +``` +version: "2.0" +services: + web: + build: ./web/ + ports: + - "3000:3000" + stock_fetch: + build: ./stock_fetch/ + redis: + image: redis +``` + +*The docker-compose.yml file from the example.* + +Once I had this working locally deploying to an Ubuntu 16.04 image in the cloud (Azure) took less than 5 minutes. I logged in, cloned the repository and typed in `docker compose up -d`. That was all it took - rapid prototyping a whole system doesn't get much better. Anyone (including the owner of whereismypizero.com) can deploy the new solution with just two lines: + +``` +$ git clone https://github.com/alexellis/pi_zero_stock +$ docker-compose up -d +``` + +Updating the site is easy and just involves a `git pull` followed by a `docker-compose up -d` with the `--build` argument passed along. + +If you are still linking your Docker containers manually, try Docker Compose for yourself or my code below: + +>Fork or star the code on Github: [alexellis/pi_zero_stock][5] + +### Check out the test site + +The test site is currently deployed now using docker-compose. + +>[stockalert.alexellis.io][6] + +![](http://blog.alexellis.io/content/images/2016/05/Screen-Shot-2016-05-16-at-22-34-26-1.png) + +Preview as of 16th of May 2016 + +---------- +via: http://blog.alexellis.io/rapid-prototype-docker-compose/ + +作者:[Alex Ellis][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://blog.alexellis.io/author/alex/ +[1]: http://blog.alexellis.io/handsondocker +[2]: https://docs.docker.com/compose/compose-file/ +[3]: http://blog.alexellis.io/dockerswarm-pizero/ +[4]: https://github.com/alexellis/pi_zero_stock +[5]: https://github.com/alexellis/pi_zero_stock +[6]: http://stockalert.alexellis.io/ + From abe380f19dfca8d160106bcd204f662dd6f002c8 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 22 May 2016 19:47:46 +0800 Subject: [PATCH 0786/1469] =?UTF-8?q?20160522-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cloud , storage --- ...sharing: integrating Pydio and ownCloud.md | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 sources/tech/20160519 The future of sharing: integrating Pydio and ownCloud.md diff --git a/sources/tech/20160519 The future of sharing: integrating Pydio and ownCloud.md b/sources/tech/20160519 The future of sharing: integrating Pydio and ownCloud.md new file mode 100644 index 0000000000..0461fda34d --- /dev/null +++ b/sources/tech/20160519 The future of sharing: integrating Pydio and ownCloud.md @@ -0,0 +1,65 @@ +The future of sharing: integrating Pydio and ownCloud +========================================================= + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BIZ_darwincloud_520x292_0311LL.png?itok=5yWIaEDe) +>Image by : +opensource.com + +The open source file sharing ecosystem accommodates a large variety of projects, each supplying their own solution, and each with a different approach. There are a lot of reasons to choose an open source solution rather than commercial solutions like Dropbox, Google Drive, iCloud, or OneDrive. These solutions offer to take away worries about managing your data but come with certain limitations, including a lack of control and integration into existing infrastructure. + +There are quite a few file sharing and sync alternatives available to users, including ownCloud and Pydio. + +### Pydio + +The Pydio (Put your data in orbit) project was founded by musician Charles du Jeu, who needed a way to share large audio files with his bandmates. [Pydio][1] is a file sharing and sync solution, with multiple storage backends, designed with developers and system administrators in mind. It has over one million downloads worldwide and has been translated into 27 languages. + +Open source from the very start, the project grew organically on [SourceForge][2] and now finds its home on [GitHub][3]. + +The user interface is based on Google's [Material Design][4]. Users can use an existing legacy file infrastructure or set up Pydio with an on-premise approach, and use web, desktop, and mobile applications to manage their assets everywhere. For administrators, the fine-grained access rights are a powerful tool for configuring access to assets.​ + +On the [Pydio community page][5], you will find several resources to get you up to speed quickly. The Pydio website gives some clear guidelines on [how to contribute][6] to the Pydio repositories on GitHub. The [forum][7] includes sections for developers and community. + +### ownCloud + +[ownCloud][8] has over 8 million users worldwide and is an open source, self-hosted file sync and sharing technology. There are sync clients for all major platforms as well as WebDAV through a web interface. ownCloud has an easy to use interface, powerful administrator tools, and extensive sharing and collaboration features—designed to give users control over their data. + +ownCloud's open architecture is extensible via an API and offers a platform for apps. Over 300 applications have been written, featuring capabilities like handling calendar, contacts, mail, music, passwords, notes, and many other types of data. ownCloud provides security, scales from a Raspberry Pi to a cluster with petabytes of storage and millions of users, and is developed by an international community of hundreds of contributors. + +### Federated sharing + +File sharing is starting to shift toward teamwork, and standardization provides a solid basis for such collaboration. + +Federated sharing, a new open standard supported by the [OpenCloudMesh][9] project, is a step in that direction. Among other things, it allows for the sharing of files and folders between servers that support this, like Pydio and ownCloud instances. + +First introduced in ownCloud 7, this server-to-server sharing allows you to mount file shares from remote servers, in effect creating your own cloud of clouds. You can create direct share links with users on other servers that support federated cloud sharing. + +Implementing this new API allows for deeper integration between storage solutions while maintaining the security, control, and attributes of the original platforms. + +"Exchanging and sharing files is something that is essential today and tomorrow," ownCloud founder Frank Karlitschek said. "Because of that, it is important to do this in a federated and distributed way without centralized data silos. The number one design goal [of federated sharing] is to enable sharing in the most seamless and easiest way while protecting the security and privacy of the users." + +### What's next? + +An initiative like OpenCloudMesh will extend this new open standard of file sharing through cooperation of institutions and companies like Pydio and ownCloud. ownCloud 9 has already introduced the ability for federated servers to exchange user lists, enabling the same seamless auto-complete experience you have with users on your own server. In the future, the idea of having a (federated!) set of central address book servers that can be used to search for others' federated cloud IDs might bring inter-cloud collaboration to an even higher level. + +The initiative will undoubtedly contribute to already growing open technical community within which members can easily discuss, develop, and contribute to the "OCM sharing API" as a vendor-neutral protocol. All leading partners of the OCM project are fully committed to the open API design principle and welcome other open source file share and sync communities to participate and join the connected cloud. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/business/16/5/sharing-files-pydio-owncloud + +作者:[ben van 't ende][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/benvantende +[1]: https://pydio.com/ +[2]: https://sourceforge.net/projects/ajaxplorer/ +[3]: https://github.com/pydio/ +[4]: https://www.google.com/design/spec/material-design/introduction.html +[5]: https://pydio.com/en/community +[6]: https://pydio.com/en/community/contribute +[7]: https://pydio.com/forum/f +[8]: https://owncloud.org/ +[9]: https://wiki.geant.org/display/OCM/Open+Cloud+Mesh From 35ac596b5b89c7bde9c3cccf7e88e63a4438ba67 Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 23 May 2016 09:23:28 +0800 Subject: [PATCH 0787/1469] =?UTF-8?q?20160523-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ubuntu,snap --- ...S UBUNTU’S SNAP PACKAGING REALLY SECURE.md | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 sources/tech/20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md diff --git a/sources/tech/20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md b/sources/tech/20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md new file mode 100644 index 0000000000..2752b5855f --- /dev/null +++ b/sources/tech/20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md @@ -0,0 +1,54 @@ +IS UBUNTU’S SNAP PACKAGING REALLY SECURE +========================================== + + +The recent release of [Ubuntu 16.04 LTS has brought a number of new features][1], one of which we covered was the [inclusion of ZFS][2]. Another feature that many people have been talking about is the Snap package format. But according to one of the developers of [CoreOS][3], the Snap packages are not as safe as the claim. + +### WHAT ARE SNAP PACKAGES? + +Snap packages are inspired by containers. This new package format allows [developers to issue updates for applications running on Ubuntu Long-Term-Support (LTS) releases][4]. This gives users the option to run a stable operating system, but keep their applications updated. This is accomplished by including all of the application’s dependencies in the same package. This prevents the program from breaking when a dependency updates. + +Another advantage of Snap packages is that the applications are isolated from the rest of the system. This means that if you change something with a Snap package, it will not affect the rest of the system. It also prevents other applications from accessing your private information, which makes it harder for hackers to get your data. + +### BUT WAIT… + +According to [Matthew Garrett][5], Snap can’t quite deliver on the last promise. Garret works as a Linux kernel developer and security developer at CoreOS, so he should know what he’s talking about. + +[According to Garret][6], “Any Snap package you install is completely capable of copying all your private data to wherever it wants with very little difficulty.” + +[ZDnet][7] reported: + +>*“To prove his point, he built a proof-of-concept attack package in Snap, which first shows an “adorable” teddy bear and then logs keystrokes from Firefox and could be used to steal private SSH keys. The PoC actually injects a harmless command, but could be tweaked to include a cURL session to steal SSH keys.”* + +### BUT WAIT A LITTLE MORE… + +Is it really that Snap has security flaws? Apparently not so. + +Garret himself said that this problem was caused by the X11 window system and did not affect mobile devices that use Mir. So, it is the flaw in X11 that does it. It’s not Snap itself. + +>how X11 trusts applications is a well-known security risk. Snap doesn’t change X11’s trust model, so the fact that applications can see what other applications are doing isn’t a weakness in the new package format, but rather X11’s. + +Garrett is just actually trying to show that when Canonical is all praises for Snap and its security; Snap applications are not fully sandboxed. They are as risky as any other binaries. + +Keeping the fact in mind that Ubuntu 16.04 still uses X11 display, and not Mir, downloading and installing Snap packages from unknown sources might be harmful. But that’s the case with any other packaging, isn’t it? + +In related articles, you should check out [how to use Snap packages in Ubuntu 16.04][8]. And do let us know of your views on Snap and its security. + +---------- +via: http://itsfoss.com/snap-package-securrity-issue/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 + +作者:[ John Paul][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/john/ +[1]: http://itsfoss.com/features-ubuntu-1604/ +[2]: http://itsfoss.com/oracle-canonical-lawsuit/ +[3]: https://en.wikipedia.org/wiki/CoreOS +[4]: https://insights.ubuntu.com/2016/04/13/snaps-for-classic-ubuntu/ +[5]: https://mjg59.dreamwidth.org/l +[6]: https://mjg59.dreamwidth.org/42320.html +[7]: http://www.zdnet.com/article/linux-expert-matthew-garrett-ubuntu-16-04s-new-snap-format-is-a-security-risk/ +[8]: http://itsfoss.com/use-snap-packages-ubuntu-16-04/ From 5a220dbdd7d1be0ade05d8ecae63d727f07d37ee Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 23 May 2016 09:36:41 +0800 Subject: [PATCH 0788/1469] =?UTF-8?q?20160523-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ubuntu , orb , package --- ...: NEW GENERATION OF LINUX APPS ARE HERE.md | 142 ++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 sources/tech/20160520 ORB: NEW GENERATION OF LINUX APPS ARE HERE.md diff --git a/sources/tech/20160520 ORB: NEW GENERATION OF LINUX APPS ARE HERE.md b/sources/tech/20160520 ORB: NEW GENERATION OF LINUX APPS ARE HERE.md new file mode 100644 index 0000000000..8ea5e6b803 --- /dev/null +++ b/sources/tech/20160520 ORB: NEW GENERATION OF LINUX APPS ARE HERE.md @@ -0,0 +1,142 @@ +ORB: NEW GENERATION OF LINUX APPS ARE HERE +============================================= + +![](http://itsfoss.com/wp-content/uploads/2016/05/ORB-Apps.jpeg) + +We have talked about [installing applications offline in Ubuntu][1] before. And we are going to talk about it once again. + +[Orbital Apps][2] has brought us a new type of application package, **ORB**, with portable applications, interactive installer support and offline usage ability. + +Portable applications are always handy. Mostly because they can run on-the-fly without needing any administrator privileges, and also it can be carried around on small USB sticks along with all their settings and data. And these interactive installers will be able to allow us to install applications with ease. + +### OPEN RUNNABLE BUNDLE (ORB) + +ORB is a free & open-source package format and it’s different from the others in numerous ways. Some of the specifications of ORB is followings: + +- **Compression**: All the packages are compressed with squashfs making them up-to 60% smaller. +- **Portable Mode**: If a portable ORB application is run from a removable drive, it’ll store its settings and data on that drive. +- **Security**: All ORB packages are signed with PGP/RSA and distributed via TLS 1.2. +- **Offline**: All the dependencies are bundled with the package, so no downloading dependencies anymore. +- **Open package**: ORB packages can be mounted as ISO images. + +### VARIETY + +ORB applications are now available in two varieties: + +- Portable Applications +- SuperDEB + +#### 1. PORTABLE ORB APPLICATIONS + +Portable ORB Applications is capable of running right away without needing any installation beforehand. That means it’ll need no administrator privileges and no dependencies! You can just download them from the Orbital Apps website and get to work. + +And as it supports Portable Mode, you can copy it on a USB stick and carry it around. All its settings and data will be stored with it on that USB stick. Just connect the USB stick with any system running on Ubuntu 16.04 and you’ll be ready to go. + +##### AVAILABLE PORTABLE APPLICATIONS + +Currently, more than 35 applications are available as portable packages, including some very popular applications like: [Deluge][3], [Firefox][4], [GIMP][5], [Libreoffice][6], [uGet][7] & [VLC][8]. + +For a full list of available packages, check the [Portable ORB Apps list][9]. + +##### USING PORTABLE APPLICATION + +Follow the steps for using Portable ORB Applications: + +- Download your desired package from the Orbital Apps site. +- Move it wherever you want (local drive / USB stick). +- Open the directory where you’ve stored the ORB package. + +![](http://itsfoss.com/wp-content/uploads/2016/05/using-portable-orb-app-1-1024x576.jpg) + +- Open Properties of the ORB package. + +![](http://itsfoss.com/wp-content/uploads/2016/05/using-portable-orb-app-2.jpg) +>Add Execute permission to ORB package + +- Add Execute permission from Permissions tab. +- Double-click on it. + +Wait for a few seconds as it prepares itself for running. And you’re good to go. + +#### 2. SUPERDEB + +Another variety of ORB Applications is SuperDEB. SuperDEBs are easy and interactive installers that make the software installation process a lot smoother. If you don’t like to install software from terminal or software centers, SuperDEB is exactly for you. + +And the most interesting part is that you won’t need an active internet connection for installing as all the dependencies are bundled with the installer. + +##### AVAILABLE SUPERDEBS + +More than 60 applications are currently available as SuperDEB. Some of the popular software among them are: [Chromium][10], [Deluge][3], [Firefox][4], [GIMP][5], [Libreoffice][6], [uGet][7] & [VLC][8]. + +For a full list of available SuperDEBs, check the [SuperDEB list][11]. + +##### USING SUPERDEB INSTALLER + +- Download your desired SuperDEB from Orbital Apps site. +- Add **Execute permission** to it just like before ( Properties > Permissions ). +- Double-click on the SuperDEB installer and follow the interactive instructions: + +![](http://itsfoss.com/wp-content/uploads/2016/05/Using-SuperDEB-Installer-1.png) +>Click OK + +![](http://itsfoss.com/wp-content/uploads/2016/05/Using-SuperDEB-Installer-2.png) +>Enter your password and proceed + +![](http://itsfoss.com/wp-content/uploads/2016/05/Using-SuperDEB-Installer-3.png) +>It’ll start Installing… + +![](http://itsfoss.com/wp-content/uploads/2016/05/Using-SuperDEB-Installer-4.png) +>And soon it’ll be done… + +- After finishing the installation, you’re good to use it normally. + +### ORB APPS COMPATIBILITY + +According to Orbital Apps, they are fully compatible with Ubuntu 16.04 [64 bit]. + +>Reading suggestion: [How To Know If You Have 32 Bit or 64 Bit Computer in Ubuntu][12]. + +As for other distros compatibility is not guaranteed. But we can say that, it’ll work on any Ubuntu 16.04 flavors (UbuntuMATE, UbuntuGNOME, Lubuntu, Xubuntu etc.) and Ubuntu 16.04 based distros (like upcoming Linux Mint 18). We currently have no information if Orbital Apps is planning on expanding its support for other Ubuntu versions/Linux Distros or not. + +If you’re going to use Portable ORB applications often on your system, you can consider installing ORB Launcher. It’s not necessary but is recommended installing to get an improved experience. The shortest method of installing ORB Launcher is opening the terminal and enter the following command: + +``` +wget -O - https://www.orbital-apps.com/orb.sh | bash +``` + +You can find the detailed instructions at [official documentation][13]. + +### WHAT IF I NEED AN APP THAT’S NOT LISTED? + +If you need an application as ORB package that is not available right now, you can [contact][14] Orbital Apps. And the good news is, Orbital Apps is working hard and planning on releasing a tool for creating ORB packages. So, hopefully, soon we’ll be able to make ORB packages ourselves! + +Just to add, this was about installing apps offline. If you are interested, you should read [how to update or upgrade Ubuntu offline][15]. + +So, what do you think about Orbital Apps’ Portable Applications and SuperDEB installers? Will you try them? + + +---------------------------------- +via: http://itsfoss.com/orb-linux-apps/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 + +作者:[Munif Tanjim][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/munif/ +[1]: http://itsfoss.com/cube-lets-install-linux-applications-offline/ +[2]: https://www.orbital-apps.com/ +[3]: https://www.orbital-apps.com/download/portable_apps_linux/deluge +[4]: https://www.orbital-apps.com/download/portable_apps_linux/firefox +[5]: https://www.orbital-apps.com/download/portable_apps_linux/gimp +[6]: https://www.orbital-apps.com/download/portable_apps_linux/libreoffice +[7]: https://www.orbital-apps.com/download/portable_apps_linux/uget +[8]: https://www.orbital-apps.com/download/portable_apps_linux/vlc +[9]: https://www.orbital-apps.com/download/portable_apps_linux/ +[10]: https://www.orbital-apps.com/download/superdeb_installers/ubuntu_16.04_64bits/chromium/ +[11]: https://www.orbital-apps.com/superdebs/ubuntu_16.04_64bits/ +[12]: http://itsfoss.com/32-bit-64-bit-ubuntu/ +[13]: https://www.orbital-apps.com/documentation +[14]: https://www.orbital-apps.com/contact +[15]: http://itsfoss.com/upgrade-or-update-ubuntu-offline-without-internet/ From 20a7e2822a13e2c768307900c7d693a72df8e37c Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 23 May 2016 11:42:12 +0800 Subject: [PATCH 0789/1469] PUB:20151201 Backup (System Restore Point) your Ubuntu or Linux Mint with SystemBack @DongShuaike --- ...ur Ubuntu or Linux Mint with SystemBack.md | 44 +++++++++++++++++++ ...ur Ubuntu or Linux Mint with SystemBack.md | 43 ------------------ 2 files changed, 44 insertions(+), 43 deletions(-) create mode 100644 published/20151201 Backup (System Restore Point) your Ubuntu or Linux Mint with SystemBack.md delete mode 100644 translated/tech/20151201 Backup (System Restore Point) your Ubuntu or Linux Mint with SystemBack.md diff --git a/published/20151201 Backup (System Restore Point) your Ubuntu or Linux Mint with SystemBack.md b/published/20151201 Backup (System Restore Point) your Ubuntu or Linux Mint with SystemBack.md new file mode 100644 index 0000000000..aeb82f69e4 --- /dev/null +++ b/published/20151201 Backup (System Restore Point) your Ubuntu or Linux Mint with SystemBack.md @@ -0,0 +1,44 @@ +使用 SystemBack 备份/还原你的 Ubuntu/Linux Mint +================================================= + +对于任何一款允许用户还原电脑到之前状态(包括文件系统,安装的应用,以及系统设置)的操作系统来说,系统还原功能都是必备功能,它可以恢复系统故障以及其他的问题。 + +有的时候安装一个程序或者驱动可能让你的系统黑屏。系统还原则可以让你电脑里面的系统文件(LCTT 译注:是系统文件,并非普通文件,详情请看**注意**部分)和程序恢复到之前工作正常时候的状态,进而让你远离那让人头痛的排障过程了,而且它也不会影响你的文件,照片或者其他数据。 + +简单的系统备份还原工具 [Systemback](https://launchpad.net/systemback) 可以让你很容易地创建系统备份以及用户配置文件。一旦遇到问题,你可以简单地恢复到系统先前的状态。它还有一些额外的特征包括系统复制,系统安装以及Live系统创建。 + +**截图** + +![systemback](http://2.bp.blogspot.com/-2UPS3yl3LHw/VlilgtGAlvI/AAAAAAAAGts/ueRaAghXNvc/s1600/systemback-1.jpg) + +![systemback](http://2.bp.blogspot.com/-7djBLbGenxE/Vlilgk-FZHI/AAAAAAAAGtk/2PVNKlaPO-c/s1600/systemback-2.jpg) + +![](http://3.bp.blogspot.com/-beZYwKrsT4o/VlilgpThziI/AAAAAAAAGto/cwsghXFNGRA/s1600/systemback-3.jpg) + +![](http://1.bp.blogspot.com/-t_gmcoQZrvM/VlilhLP--TI/AAAAAAAAGt0/GWBg6bGeeaI/s1600/systemback-5.jpg) + +**注意**:使用系统还原不会还原你自己的文件、音乐、电子邮件或者其他任何类型的私人文件。对不同用户来讲,这既是优点又是缺点。坏消息是它不会还原你意外删除的文件,不过你可以通过一个文件恢复程序来解决这个问题。如果你的计算机没有创建还原点,那么系统恢复就无法奏效,所以这个工具就无法帮助你(还原系统),如果你尝试恢复一个主要问题,你将需要移步到另外的步骤来进行故障排除。 + +> 适用于 Ubuntu 15.10 Wily/16.04/15.04 Vivid/14.04 Trusty/Linux Mint 14.x/其他Ubuntu衍生版,打开终端,将下面这些命令复制过去: + +终端命令: + +``` +sudo add-apt-repository ppa:nemh/systemback +sudo apt-get update +sudo apt-get install systemback + +``` + +大功告成。 + +-------------------------------------------------------------------------------- + +via: http://www.noobslab.com/2015/11/backup-system-restore-point-your.html + +译者:[DongShuaike](https://github.com/DongShuaike) +校对:[Caroline](https://github.com/carolinewuyan) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:https://launchpad.net/systemback diff --git a/translated/tech/20151201 Backup (System Restore Point) your Ubuntu or Linux Mint with SystemBack.md b/translated/tech/20151201 Backup (System Restore Point) your Ubuntu or Linux Mint with SystemBack.md deleted file mode 100644 index c931365600..0000000000 --- a/translated/tech/20151201 Backup (System Restore Point) your Ubuntu or Linux Mint with SystemBack.md +++ /dev/null @@ -1,43 +0,0 @@ -# 使用 SystemBack 备份你的 Ubuntu/Linux Mint(系统还原) - -对于任何一款允许用户还原电脑到之前状态(包括文件系统,安装的应用,以及系统设置)的操作系统来说,系统还原都是必备功能,可以恢复系统故障以及其他的问题。 - -有的时候安装一个程序或者驱动可能让你的系统黑屏。系统还原则让你电脑里面的系统文件(译者注:是系统文件,并非普通文件,详情请看**注意**部分)和程序恢复到之前工作正常时候的状态,进而让你远离那让人头痛的排障过程了。而且它也不会影响你的文件,照片或者其他数据。 - -简单的系统备份还原工具[Systemback](https://launchpad.net/systemback)让你很容易地创建系统备份以及用户配置文件。一旦遇到问题,你可以简单地恢复到系统先前的状态。它还有一些额外的特征包括系统复制,系统安装以及Live系统创建。 - -截图 - -![systemback](http://2.bp.blogspot.com/-2UPS3yl3LHw/VlilgtGAlvI/AAAAAAAAGts/ueRaAghXNvc/s1600/systemback-1.jpg) - -![systemback](http://2.bp.blogspot.com/-7djBLbGenxE/Vlilgk-FZHI/AAAAAAAAGtk/2PVNKlaPO-c/s1600/systemback-2.jpg) - -![](http://3.bp.blogspot.com/-beZYwKrsT4o/VlilgpThziI/AAAAAAAAGto/cwsghXFNGRA/s1600/systemback-3.jpg) - -![](http://1.bp.blogspot.com/-t_gmcoQZrvM/VlilhLP--TI/AAAAAAAAGt0/GWBg6bGeeaI/s1600/systemback-5.jpg) - -**注意**:使用系统还原不会还原你的文件,音乐,电子邮件或者其他任何类型的私人文件。对不同用户来讲,这既是优点又是缺点。坏消息是它不会还原你意外删除的文件,不过你可以通过一个文件恢复程序来解决这个问题。如果你的计算机没有还原点,那么系统恢复就无法奏效,所以这个工具就无法帮助你(还原系统),如果你尝试恢复一个主要问题,你将需要移步到另外的步骤来进行故障排除。 - -> > >适用于Ubuntu 15.10 Wily/16.04/15.04 Vivid/14.04 Trusty/Linux Mint 14.x/其他Ubuntu衍生版,打开终端,将下面这些命令复制过去: - -终端命令: - -``` -sudo add-apt-repository ppa:nemh/systemback -sudo apt-get update -sudo apt-get install systemback - -``` - -大功告成。 - --------------------------------------------------------------------------------- - -via: http://www.noobslab.com/2015/11/backup-system-restore-point-your.html - -译者:[DongShuaike](https://github.com/DongShuaike) -校对:[Caroline](https://github.com/carolinewuyan) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[1]:https://launchpad.net/systemback From ddcaa22c2647772ebd00e27527684833263b68b7 Mon Sep 17 00:00:00 2001 From: Ezio Date: Tue, 24 May 2016 09:31:42 +0800 Subject: [PATCH 0790/1469] =?UTF-8?q?20160524-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit editor --- ...DERN OPEN SOURCE CODE EDITORS FOR LINUX.md | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 sources/tech/20160516 4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX.md diff --git a/sources/tech/20160516 4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX.md b/sources/tech/20160516 4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX.md new file mode 100644 index 0000000000..f17cbf551c --- /dev/null +++ b/sources/tech/20160516 4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX.md @@ -0,0 +1,86 @@ +4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX +================================================== + +![](http://itsfoss.com/wp-content/uploads/2015/01/Best_Open_Source_Editors.jpeg) + +Looking for **best programming editors in Linux**? If you ask the old school Linux users, their answer would be Vi, Vim, Emacs, Nano etc. But I am not talking about them. I am going to talk about new age, cutting edge, great looking, sleek and yet powerful, feature rich **best open source code editors for Linux** that would enhance your programming experience. + +### BEST MODERN OPEN SOURCE EDITORS FOR LINUX + +I use Ubuntu as my main desktop and hence I have provided installation instructions for Ubuntu based distributions. But this doesn’t make this list as **best text editors for Ubuntu** because the list is apt for any Linux distribution. Just to add, the list is not in any particular priority order. + +### BRACKETS + +![](http://itsfoss.com/wp-content/uploads/2015/01/brackets_UI.jpeg) + +[Brackets][1] is an open source code editor from [Adobe][2]. Brackets focuses exclusively on the needs of web designers with built in support for HTML, CSS and Java Script. It’s light weight and yet powerful. It provides you with inline editing and live preview. There are plenty of plugins available to further enhance your experience with Brackets. + +To [install Brackets in Ubuntu][3] and Ubuntu based distributions such as Linux Mint, you can use this unofficial PPA: + +``` +sudo add-apt-repository ppa:webupd8team/brackets +sudo apt-get update +sudo apt-get install brackets +``` + +For other Linux distributions, you can get the source code as well as binaries for Linux, OS X and Windows on its website. + +[Download Brackets Source Code and Binaries](https://github.com/adobe/brackets/releases) + +### ATOM + +![](http://itsfoss.com/wp-content/uploads/2014/08/Atom_Editor.jpeg) + +[Atom][4] is another modern and sleek looking open source editor for programmers. Atom is developed by Github and promoted as a “hackable text editor for the 21st century”. The looks of Atom resembles a lot like Sublime Text editor, a hugely popular but closed source text editors among programmers. + +Atom has recently released .deb and .rpm packages so that one can easily install Atom in Debian and Fedora based Linux distributions. Of course, its source code is available as well. + + +[Download Atom .deb](https://atom.io/download/deb) + +[Download Atom .rpm](https://atom.io/download/rpm) + +[Get Atom source code](https://github.com/atom/atom/blob/master/docs/build-instructions/linux.md) + +### LIME TEXT + +![](http://itsfoss.com/wp-content/uploads/2014/08/LimeTextEditor.jpeg) + +So you like Sublime Text editor but you are not comfortable with the fact that it is not open source. No worries. We have an [open source clone of Sublime Text][5], called [Lime Text][6]. It is built on Go, HTML and QT. The reason behind cloning of Sublime Text is that there are numerous bugs in Sublime Text 2 and Sublime Text 3 is in beta since forever. There are no transparency in its development, on whether the bugs are being fixed or not. + +So open source lovers, rejoice and get the source code of Lime Text from the link below: + +[Get Lime Text Source Code](https://github.com/limetext/lime) + +### LIGHT TABLE + +![](http://itsfoss.com/wp-content/uploads/2015/01/Light_Table.jpeg) + +Flaunted as “the next generation code editor”, [Light Table][7] is another modern looking, feature rich open source editor which is more of an IDE than a mere text editor. There are numerous extensions available to enhance its capabilities. Inline evaluation is what you would love in it. You have to use it to believe how useful Light Table actually is. + +[Install Light Table in Ubuntu Linux](http://itsfoss.com/install-lighttable-ubuntu/) + +### WHAT’S YOUR PICK? + +No, we are not limited to just four code editors in Linux. The list was about modern editors for programmers. Of course, you have plenty of other options such as [Notepad++ alternative Notepadqq][8] or [SciTE][9] and many more. So, among these four, which one is your favorite code editor for Linux? + + +---------- +via: http://itsfoss.com/best-modern-open-source-code-editors-for-linux/?utm_source=newsletter&utm_medium=email&utm_campaign=offline_and_portable_linux_apps_and_other_linux_stories + +作者:[Abhishek Prakash][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://brackets.io/ +[2]: http://www.adobe.com/ +[3]: http://itsfoss.com/install-brackets-ubuntu/ +[4]: https://atom.io/ +[5]: http://itsfoss.com/lime-text-open-source-alternative/ +[6]: http://limetext.org/ +[7]: http://lighttable.com/ +[8]: http://itsfoss.com/notepadqq-notepad-for-linux/ +[9]: http://itsfoss.com/scite-the-notepad-for-linux/ From 305a7e7b3809ff46186fc0a781b105c92230cea5 Mon Sep 17 00:00:00 2001 From: alim0x Date: Tue, 24 May 2016 09:41:05 +0800 Subject: [PATCH 0791/1469] [translating]20160516 4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX (#3994) --- ...20160516 4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160516 4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX.md b/sources/tech/20160516 4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX.md index f17cbf551c..93bf396c4a 100644 --- a/sources/tech/20160516 4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX.md +++ b/sources/tech/20160516 4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX.md @@ -1,3 +1,5 @@ +alim0x translating + 4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX ================================================== From 2bb497d0b0b897f4f4845c6836bdb3bd177ff662 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 24 May 2016 16:03:21 +0800 Subject: [PATCH 0792/1469] PUB:20160225 The Tao of project management MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @runningwater @FSSlc 不错! --- .../20160225 The Tao of project management.md | 108 ++++++++++++++---- 1 file changed, 84 insertions(+), 24 deletions(-) rename {translated/tech => published}/20160225 The Tao of project management.md (57%) diff --git a/translated/tech/20160225 The Tao of project management.md b/published/20160225 The Tao of project management.md similarity index 57% rename from translated/tech/20160225 The Tao of project management.md rename to published/20160225 The Tao of project management.md index 758a7d0217..938484b498 100644 --- a/translated/tech/20160225 The Tao of project management.md +++ b/published/20160225 The Tao of project management.md @@ -1,4 +1,4 @@ -项目管理之道 +《道德经》之项目管理 ================================= @@ -8,8 +8,7 @@ 在思考有关开放性组织的项目管理时,我的脑海中便立马浮现出上面的这段文字。 -这听起来可能会有点奇怪。若要理解我的这种想法从何而来,你应该读读 -*《开放性组织:点燃激情提升执行力》* 这本书,它是红帽公司总裁、首席执行官 Jim Whitehurst 所写的一本有关企业文化和新领导力范式的宣言。在这本书中,Jim(还有来自其他红帽人的一点帮助)解释了传统组织机构(一种 “自上而下” 的方式,来自高层的决策被传达到员工,而员工通过晋升和薪酬来激励)和开放性组织机构(一种 自下而上 的方式,领导专注于激励和鼓励,员工被充分授权以各尽其能)之间的差异。 +这听起来可能会有点奇怪。若要理解我的这种想法从何而来,你应该读读 *《开放性组织:点燃激情提升执行力》* 这本书,它是红帽公司总裁、首席执行官 Jim Whitehurst 所写的一本有关企业文化和新领导力范式的宣言。在这本书中,Jim(还有来自其他红帽人的一点帮助)解释了传统组织机构(一种 “自上而下” 的方式,来自高层的决策被传达到员工,而员工通过晋升和薪酬来激励)和开放性组织机构(一种 自下而上 的方式,领导专注于激励和鼓励,员工被充分授权以各尽其能)之间的差异。 在开放性组织中的员工都是被激情、目标和参与感所激励,这个观点正是我认为项目管理者所应该关注的。 @@ -17,27 +16,39 @@ ### 不要让工作职衔框住自身 ->道,可道也,非恒道也。名,可名也,非恒名也。 +> 道,可道也,(The tao that can be told) ->“无”,名天地之始;“有”,名万物之母。 +> 非恒道也。(is not the eternal Tao) + +> 名,可名也,(The name that can be named) + +> 非恒名也。(is not the eternal Name.) + +> “无”,名天地之始;(The unnameable is the eternally real.) + +> “有”,名万物之母。(Naming is the origin of all particular things.) [[1]][7] 项目管理到底是什么?作为一个项目管理者应该做些什么呢? 如您所想,项目管理者的一部分工作就是管理项目:收集需求、与项目相关人员沟通、设置项目优先级、安排任务、帮助团队解决困扰。许多机构都可以教你如何做好项目管理,并且这些技能你值得拥有。 -然而,在开放性组织中,字面上的项目管理技能仅仅只是项目管理者需要做到一小部分,这些组织需要更多其他的东西:即勇气。如果你擅长于管理项目(或者是真的擅长于任何工作),那么你就进入了舒适区。这时候就是需要鼓起勇气开始尝试冒险之时。 +然而,在开放性组织中,字面上的项目管理技能仅仅只是项目管理者需要做到的一小部分,这些组织需要更多其他的东西:即勇气。如果你擅长于管理项目(或者是真的擅长于任何工作),那么你就进入了舒适区。这时候就是需要鼓起勇气开始尝试冒险之时。 您有勇气跨出舒适区吗?向权威人士提出挑战性的问题,可能会引发对方的不快,但也可能会开启一个更好的方法,您有勇气这样做吗?有确定需要做的下一件事,然后真正去完成它的勇气吗?有主动去解决因为交流的鸿沟而遗留下来的问题的勇气吗?有去尝试各种事情的勇气吗?有失败的勇气吗? -道德经的开篇(上面引用的)就表明词语、标签、名字这些是有限制的,当然也包括工作职衔。在开放性组织中,项目经理不仅仅是执行管理项目所需的机械任务,而且要帮助团队完成组织的使命,尽管这已经被限定了。 +道德经的开篇(上面引用的)就表明词语(words)、标签(labels)、名字(names)这些是有限制的,当然也包括工作职衔。在开放性组织中,项目经理不仅仅是执行管理项目所需的机械任务,而且要帮助团队完成组织的使命,尽管这已经被限定了。 ### 联系起合适的人 ->三十辐共一轂,当其无,有车之用。 +> 三十辐共一轂,(We join spokes together in a wheel,) + +> 当其无,(but it is the center hole) + +> 有车之用。(that makes the wagon move.) [[11]][8] -当我过渡到项目管理的工作时,我必须学会的最为困难的一课是:并不是所有解决方案都是完全可接受的,甚至有的连预期都达不到。这对我来说是全新的,我喜欢所有的解决方案。但作为项目管理者,我的角色更多的是与人沟通--使得那些确实有解决方案的人可以更高效地合作。 +当我过渡到项目管理的工作时,我必须学会的最为困难的一课是:并不是所有解决方案都是可完全地接受,甚至有的连预期都达不到。这对我来说是全新的一页。我*喜欢*全部都能解决。但作为项目管理者,我的角色更多的是与人沟通--使得那些确实有解决方案的人可以更高效地合作。 这并不是逃避责任或者不负责。这意味着可以很舒适的说,“我不知道,但我会给你找出答案”,然后就可迅速地结束这个循环。 @@ -45,14 +56,28 @@ ### 信任你的团队 ->太上,不知有之;其次,亲而誉之;其次,畏之;其次,侮之。 -> ->信不足焉,有不信焉。 -> ->悠兮,其贵言。功成事遂,百姓皆谓:“我自然”。 +>太上,不知有之;(When the Master governs, the people +are hardly aware that he exists.) + +> 其次,亲而誉之;(Next best is a leader who is loved.) + +> 其次,畏之;(Next, one who is feared.) + +> 其次,侮之。(The worst is one who is despised.) + +>信不足焉,(If you don't trust the people,) + +>有不信焉。(you make them untrustworthy.) + +>悠兮,其贵言。(The Master doesn't talk, he acts.) + +> 功成事遂,(When his work is done,) + +> 百姓皆谓:“我自然”。(the people say, "Amazing: +we did it, all by ourselves!") [[17]][9] -[Rebecca Fernandez][10]曾经告诉我开放性组织的领导与其它组织的领导者最大的不同点在于,我们不取得别人的信任,而是信任别人。 +[Rebecca Fernandez][10] 曾经告诉我开放性组织的领导与其它组织的领导者最大的不同点在于,我们不是去取得别人的信任,而是信任别人。 开放性组织会雇佣那些非常聪明的,且对公司正在做的事情充满激情的人来做工作。为了能使他们能更好的工作,我们会提供其所需,并尊重他们的工作方式。 @@ -60,7 +85,11 @@ ### 顺其自然 ->上德无为而无以为;下德为之而有以为。 +>上德无为而无以为;(The Master does nothing +yet he leaves nothing undone.) + +>下德为之而有以为。(The ordinary man is always doing things, +yet many more are left to be done.) [[38]][11] 你认识那类总是极其忙碌的人吗?认识那些因为有太多事情要做而看起来疲倦和压抑的人吗? @@ -77,35 +106,65 @@ ### 做一名文化传教士 ->上士闻道,勤而行之;中士闻道,若存若亡;下士闻道,大笑之。不笑不足以為道。 +>上士闻道,(When a superior man hears of the Tao,) + +> 勤而行之;(he immediately begins to embody it.) + +> 中士闻道,(When an average man hears of the Tao,) + +>若存若亡;(he half believes it, half doubts it.) + +> 下士闻道,(When a foolish man hears of the Tao,) + +> 大笑之。(he laughs out loud.) + +> 不笑不足以為道。(If he didn't laugh,it wouldn't be the Tao.) [[41]][12] -去年秋天,我跟着一群联邦雇员注册了一个工商管理硕士课程。当我开始介绍我们公司的文化、价值和伦理框架时,我得到的直接印象是:我的同学和教授都认为我就像一个天真可爱的小姑娘,做着许多关于公司应该如何运作的[甜美白日梦][13]。他们告诉我事情不可能是它们看起来的那样,他们还告诉我应该进一步考察。 +去年秋天,我和一群联邦雇员参加了一堂 MBA 的商业准则课程。当我开始介绍我们公司的文化、价值和伦理框架时,我得到的直接印象是:我的同学和教授都认为我就像一个天真可爱的小姑娘,做着许多关于公司应该如何运作的[甜美白日梦][13]。他们告诉我事情不可能是他们看起来的那样,他们还告诉我应该进一步考察。 所以我照做了。 然而我发现的是:事情*恰好*是他们看起来的那样。 -在开放性组织,关于企业文化,人们应该随着企业的成长而时时维护那些文化,以使它随时精神焕发,充满斗志。我(和其它开源组织的成员)并不想过如我同学所描述的那样,“为生活而工作”。我需要有激情、有目标,需要明白自己的日常工作是如何对那些我所坚信的东西做贡献的。 +在开放性组织,关于企业文化,人们应该随着企业的成长而时时维护那些文化,以使它随时精神焕发,充满斗志。我(和其它开源组织的成员)并不想过着如我同学们所描述的那样,“为生活而工作”。我需要有激情、有目标,需要明白自己的日常工作是如何对那些我所坚信的东西做贡献的。 作为一个项目管理者,你可能会认为在你的团队中,你的工作对培养你们公司的企业文化没有多少帮助。然而你的工作正是孕育文化本身。 ### Kaizen (持续改善) ->为学日益,为道日损。损之又损,以至于无为。无为而无不为。 +>为学日益,(In pursuit of knowledge,every day something is added.) + +> 为道日损。(In the practice of the Tao,every day something is dropped.) + +> 损之又损,(Less and less do you need to force things,) + +> 以至于无为。(until finally you arrive at non-action. ) + +> 无为而无不为。(When nothing is done,nothing is left undone.) [[48]][14] -项目管理的一般领域都太过于专注最新、最强大的的工具,但对于应该使用哪种工具,这个问题的答案总是一致的:“最简单的”。 +项目管理的常规领域都太过于专注最新、最强大的的工具,但对于应该使用哪种工具,这个问题的答案总是一致的:“最简单的”。 例如,我将任务列表放在桌面的一个文本文件中,因为它很单纯,不会受到不必要的干扰。您想介绍给团队的,无论是何种工具、流程和程序都应该是能提高效率,排除障碍的,而不是引入额外的复杂性。所以与其专注于工具,还不如专注于要使用这些工具来解决的*问题*。 -作为一个项目经理,我最喜爱的部分是在敏捷世界中,我有自由抛弃那些没有成效的东西的权利。这与 kaizen 的概念相关,或叫 “持续改进”。不要害怕尝试和失败。失败是我们在探索什么能够起作用,什么不能起作用的过程中所用的标签,这是提高的唯一方式。 +作为一个项目经理,我最喜爱的部分是在敏捷世界中,我有自由抛弃那些没有成效的东西的权利。这与 [kaizen][16] 的概念相关,或叫 “持续改进”。不要害怕尝试和失败。失败是我们在探索什么能够起作用,什么不能起作用的过程中所用的标签,这是提高的唯一方式。 最好的过程都不是一蹴而就的。作为项目管理者,你应该通过支持他们,而不是强迫他们去做某些事来帮助你的团队。 ### 实践 ->天下皆谓我"道"大,似不肖。夫唯大,故似不肖。若肖,久矣其细也夫! +>天下皆谓我"道"大,(Some say that my teaching is nonsense.) + +> 似不肖。(Others call it lofty but impractical.) + +> 夫唯大,(But to those who have looked inside themselves,) + +> 故似不肖。(this nonsense makes perfect sense.) + +>若肖,(And to those who put it into practice,) + +> 久矣其细也夫!(this loftiness has roots that go deep.) [[67]][15] 我相信开放性组织正在做的事。开放性组织在管理领域的工作几乎与他们提供的产品和服务一样重要。我们有机会以身作则,激发他人的激情和目的,创造激励和充分授权的工作环境。 @@ -137,4 +196,5 @@ via: https://opensource.com/open-organization/16/2/tao-project-management [12]: http://acc6.its.brooklyn.cuny.edu/~phalsall/texts/taote-v3.html#41 [13]: https://opensource.com/open-organization/15/9/reflections-open-organization-starry-eyed-dreamer [14]: http://acc6.its.brooklyn.cuny.edu/~phalsall/texts/taote-v3.html#48 -[15]: http://acc6.its.brooklyn.cuny.edu/~phalsall/texts/taote-v3.html#67 \ No newline at end of file +[15]: http://acc6.its.brooklyn.cuny.edu/~phalsall/texts/taote-v3.html#67 +[16]: https://www.kaizen.com/about-us/definition-of-kaizen.html \ No newline at end of file From 684d4581ea4a8794d0fe442b7777aca4c07ee149 Mon Sep 17 00:00:00 2001 From: alim0x Date: Tue, 24 May 2016 21:45:36 +0800 Subject: [PATCH 0793/1469] [translated]20160516 4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX --- ...DERN OPEN SOURCE CODE EDITORS FOR LINUX.md | 44 +++++++++---------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/sources/tech/20160516 4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX.md b/sources/tech/20160516 4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX.md index 93bf396c4a..cbced20708 100644 --- a/sources/tech/20160516 4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX.md +++ b/sources/tech/20160516 4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX.md @@ -1,23 +1,21 @@ -alim0x translating - -4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX +Linux 上四个最佳的现代开源代码编辑器 ================================================== ![](http://itsfoss.com/wp-content/uploads/2015/01/Best_Open_Source_Editors.jpeg) -Looking for **best programming editors in Linux**? If you ask the old school Linux users, their answer would be Vi, Vim, Emacs, Nano etc. But I am not talking about them. I am going to talk about new age, cutting edge, great looking, sleek and yet powerful, feature rich **best open source code editors for Linux** that would enhance your programming experience. +在寻找 **Linux 上最好的代码编辑器**?如果你问那些老派的 Linux 用户,他们的答案肯定是 Vi,Vim,Emacs,Nano 等等。但我不讨论它们。我要讨论的是最新的,美观,优美强大,功能丰富,能够提高你编程体验的,**最好的 Linux 开源代码编辑器**。 -### BEST MODERN OPEN SOURCE EDITORS FOR LINUX +### Linux 上最佳的现代开源代码编辑器 -I use Ubuntu as my main desktop and hence I have provided installation instructions for Ubuntu based distributions. But this doesn’t make this list as **best text editors for Ubuntu** because the list is apt for any Linux distribution. Just to add, the list is not in any particular priority order. +我使用 Ubuntu 作为我的主力系统,因此提供的安装说明适用于基于 Ubuntu 的发行版。但这并不会让这个列表变成 **Ubuntu 上的最佳文本编辑器**,因为这些编辑器对所有 Linux 发行版都适用。多说一句,这个清单没有任何优先顺序。 ### BRACKETS ![](http://itsfoss.com/wp-content/uploads/2015/01/brackets_UI.jpeg) -[Brackets][1] is an open source code editor from [Adobe][2]. Brackets focuses exclusively on the needs of web designers with built in support for HTML, CSS and Java Script. It’s light weight and yet powerful. It provides you with inline editing and live preview. There are plenty of plugins available to further enhance your experience with Brackets. +[Brackets][1] 是 [Adobe][2] 的一个开源代码编辑器。Brackets 专注与 web 设计师的需求,内置 HTML,CSS 和 JavaScript 支持。它很轻量,也很强大。它提供了行内编辑和实时预览。还有无数可用的插件,进一步加强你在 Brackets 上的体验。 -To [install Brackets in Ubuntu][3] and Ubuntu based distributions such as Linux Mint, you can use this unofficial PPA: +在 Ubuntu 以及基于 Ubuntu 的发行版(比如 Linux Mint)上[安装 Brackets][3] 的话,你可以用这个非官方的 PPA: ``` sudo add-apt-repository ppa:webupd8team/brackets @@ -25,53 +23,53 @@ sudo apt-get update sudo apt-get install brackets ``` -For other Linux distributions, you can get the source code as well as binaries for Linux, OS X and Windows on its website. +至于其它 Linux 发行版,你可以从它的网站上获取到适用于 Linux,OS X 和 Windows 源码和二进制文件。 -[Download Brackets Source Code and Binaries](https://github.com/adobe/brackets/releases) +[下载 Brackets 源码和二进制包](https://github.com/adobe/brackets/releases) ### ATOM ![](http://itsfoss.com/wp-content/uploads/2014/08/Atom_Editor.jpeg) -[Atom][4] is another modern and sleek looking open source editor for programmers. Atom is developed by Github and promoted as a “hackable text editor for the 21st century”. The looks of Atom resembles a lot like Sublime Text editor, a hugely popular but closed source text editors among programmers. +[Atom][4] 是另一个给程序员开源代码编辑器,现代而且美观。Atom 是由 Github 开发的,宣称是“21世纪的可定制文本编辑器”。Atom 的外观看起来类似 Sublime Text,一个在程序员中很流行但是闭源的文本编辑器。 -Atom has recently released .deb and .rpm packages so that one can easily install Atom in Debian and Fedora based Linux distributions. Of course, its source code is available as well. +Atom 最近发布了 .deb 和 .rpm 包,所以你可以轻而易举地在基于 Debian 和 Fedora 的 Linux 发行版上安装它。当然,它的源代码也是提供了的。 -[Download Atom .deb](https://atom.io/download/deb) +[下载 Atom .deb](https://atom.io/download/deb) -[Download Atom .rpm](https://atom.io/download/rpm) +[下载 Atom .rpm](https://atom.io/download/rpm) -[Get Atom source code](https://github.com/atom/atom/blob/master/docs/build-instructions/linux.md) +[获取 Atom 源码](https://github.com/atom/atom/blob/master/docs/build-instructions/linux.md) ### LIME TEXT ![](http://itsfoss.com/wp-content/uploads/2014/08/LimeTextEditor.jpeg) -So you like Sublime Text editor but you are not comfortable with the fact that it is not open source. No worries. We have an [open source clone of Sublime Text][5], called [Lime Text][6]. It is built on Go, HTML and QT. The reason behind cloning of Sublime Text is that there are numerous bugs in Sublime Text 2 and Sublime Text 3 is in beta since forever. There are no transparency in its development, on whether the bugs are being fixed or not. +你喜欢 Sublime Text 但是你对它是闭源的这一事实感觉不是很舒服?别担心,我们有 [Sublime Text 的开源克隆版][5],叫做 [Lime Text][6]。它是基于 Go,HTML 和 QT 的。克隆 Sublime Text 的原因是 Sublime Text 2 中有无数 bug,而 Sublime Text 3 看起来会永远处于 beta 之中。它的开发过程并不透明,也就无从得知 bug 是否被修复了。 -So open source lovers, rejoice and get the source code of Lime Text from the link below: +所以开源爱好者们,开心地去下面这个链接下载 Lime Text 的源码吧: -[Get Lime Text Source Code](https://github.com/limetext/lime) +[获取 Lime Text 源码](https://github.com/limetext/lime) ### LIGHT TABLE ![](http://itsfoss.com/wp-content/uploads/2015/01/Light_Table.jpeg) -Flaunted as “the next generation code editor”, [Light Table][7] is another modern looking, feature rich open source editor which is more of an IDE than a mere text editor. There are numerous extensions available to enhance its capabilities. Inline evaluation is what you would love in it. You have to use it to believe how useful Light Table actually is. +标榜“下一代代码编辑器”,[Light Table][7] 是另一个外观现代,功能丰富的开源代码编辑器,它更像一个 IDE 而不仅仅是个文本编辑器。它还有无数扩展用以加强它的功能。也许你会喜欢它的行内求值。你得用用它才会相信 Light Table 有多好用。 -[Install Light Table in Ubuntu Linux](http://itsfoss.com/install-lighttable-ubuntu/) +[在 Ubuntu 上安装 Light Table](http://itsfoss.com/install-lighttable-ubuntu/) -### WHAT’S YOUR PICK? +### 你的选择是? -No, we are not limited to just four code editors in Linux. The list was about modern editors for programmers. Of course, you have plenty of other options such as [Notepad++ alternative Notepadqq][8] or [SciTE][9] and many more. So, among these four, which one is your favorite code editor for Linux? +不,我们的选择没有限制在这四个 Linux 代码编辑器之中。这个清单只是关于程序员的现代编辑器。当然,你还有很多选择,比如 [Notepad++ 的替代选择 Notepadqq][8] 或 [SciTE][9] 以及更多。那么,在上面四个中,对 Linux 而言哪个是你最喜欢的代码编辑器? ---------- via: http://itsfoss.com/best-modern-open-source-code-editors-for-linux/?utm_source=newsletter&utm_medium=email&utm_campaign=offline_and_portable_linux_apps_and_other_linux_stories 作者:[Abhishek Prakash][a] -译者:[译者ID](https://github.com/译者ID) +译者:[alim0x](https://github.com/alim0x) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From d9dae92abe4ff91a508afb62d9a6698bc0b5a88e Mon Sep 17 00:00:00 2001 From: alim0x Date: Tue, 24 May 2016 21:57:30 +0800 Subject: [PATCH 0794/1469] Move file and adjust some translation --- ...BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) rename {sources => translated}/tech/20160516 4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX.md (85%) diff --git a/sources/tech/20160516 4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX.md b/translated/tech/20160516 4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX.md similarity index 85% rename from sources/tech/20160516 4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX.md rename to translated/tech/20160516 4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX.md index cbced20708..f3045322f3 100644 --- a/sources/tech/20160516 4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX.md +++ b/translated/tech/20160516 4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX.md @@ -7,13 +7,13 @@ Linux 上四个最佳的现代开源代码编辑器 ### Linux 上最佳的现代开源代码编辑器 -我使用 Ubuntu 作为我的主力系统,因此提供的安装说明适用于基于 Ubuntu 的发行版。但这并不会让这个列表变成 **Ubuntu 上的最佳文本编辑器**,因为这些编辑器对所有 Linux 发行版都适用。多说一句,这个清单没有任何优先顺序。 +我使用 Ubuntu 作为我的主力系统,因此提供的安装说明适用于基于 Ubuntu 的发行版。但这并不会让这个列表变成 **Ubuntu 上的最佳文本编辑器**,因为这些编辑器对所有 Linux 发行版都适用。多说一句,这个清单没有任何先后顺序。 ### BRACKETS ![](http://itsfoss.com/wp-content/uploads/2015/01/brackets_UI.jpeg) -[Brackets][1] 是 [Adobe][2] 的一个开源代码编辑器。Brackets 专注与 web 设计师的需求,内置 HTML,CSS 和 JavaScript 支持。它很轻量,也很强大。它提供了行内编辑和实时预览。还有无数可用的插件,进一步加强你在 Brackets 上的体验。 +[Brackets][1] 是 [Adobe][2] 的一个开源代码编辑器。Brackets 专注于 web 设计师的需求,内置 HTML,CSS 和 JavaScript 支持。它很轻量,也很强大。它提供了行内编辑和实时预览。还有无数可用的插件,进一步加强你在 Brackets 上的体验。 在 Ubuntu 以及基于 Ubuntu 的发行版(比如 Linux Mint)上[安装 Brackets][3] 的话,你可以用这个非官方的 PPA: @@ -31,9 +31,9 @@ sudo apt-get install brackets ![](http://itsfoss.com/wp-content/uploads/2014/08/Atom_Editor.jpeg) -[Atom][4] 是另一个给程序员开源代码编辑器,现代而且美观。Atom 是由 Github 开发的,宣称是“21世纪的可定制文本编辑器”。Atom 的外观看起来类似 Sublime Text,一个在程序员中很流行但是闭源的文本编辑器。 +[Atom][4] 是另一个给程序员的开源代码编辑器,现代而且美观。Atom 是由 Github 开发的,宣称是“21世纪的可定制文本编辑器”。Atom 的外观看起来类似 Sublime Text,一个在程序员中很流行但是闭源的文本编辑器。 -Atom 最近发布了 .deb 和 .rpm 包,所以你可以轻而易举地在基于 Debian 和 Fedora 的 Linux 发行版上安装它。当然,它的源代码也是提供了的。 +Atom 最近发布了 .deb 和 .rpm 包,所以你可以轻而易举地在基于 Debian 和 Fedora 的 Linux 发行版上安装它。当然,它也提供了源代码。 [下载 Atom .deb](https://atom.io/download/deb) @@ -56,13 +56,13 @@ Atom 最近发布了 .deb 和 .rpm 包,所以你可以轻而易举地在基于 ![](http://itsfoss.com/wp-content/uploads/2015/01/Light_Table.jpeg) -标榜“下一代代码编辑器”,[Light Table][7] 是另一个外观现代,功能丰富的开源代码编辑器,它更像一个 IDE 而不仅仅是个文本编辑器。它还有无数扩展用以加强它的功能。也许你会喜欢它的行内求值。你得用用它才会相信 Light Table 有多好用。 +[Light Table][7] 是另一个外观现代,功能丰富的开源代码编辑器,标榜“下一代代码编辑器”,它更像一个 IDE 而不仅仅是个文本编辑器。它还有无数扩展用以加强它的功能。也许你会喜欢它的行内求值。你得用用它才会相信 Light Table 有多好用。 [在 Ubuntu 上安装 Light Table](http://itsfoss.com/install-lighttable-ubuntu/) ### 你的选择是? -不,我们的选择没有限制在这四个 Linux 代码编辑器之中。这个清单只是关于程序员的现代编辑器。当然,你还有很多选择,比如 [Notepad++ 的替代选择 Notepadqq][8] 或 [SciTE][9] 以及更多。那么,在上面四个中,对 Linux 而言哪个是你最喜欢的代码编辑器? +不,我们的选择没有限制在这四个 Linux 代码编辑器之中。这个清单只是关于程序员的现代编辑器。当然,你还有很多选择,比如 [Notepad++ 的替代选择 Notepadqq][8] 或 [SciTE][9] 以及更多。那么,上面四个中,在 Linux 上而言你最喜欢哪个代码编辑器? ---------- From 9f10cd8b574823319cee97331f2424dbe10241be Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 25 May 2016 20:16:51 +0800 Subject: [PATCH 0795/1469] =?UTF-8?q?20160525-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit linux , car , IVI --- ...Driving cars into the future with Linux.md | 104 ++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 sources/talk/20160523 Driving cars into the future with Linux.md diff --git a/sources/talk/20160523 Driving cars into the future with Linux.md b/sources/talk/20160523 Driving cars into the future with Linux.md new file mode 100644 index 0000000000..38ef546789 --- /dev/null +++ b/sources/talk/20160523 Driving cars into the future with Linux.md @@ -0,0 +1,104 @@ +Driving cars into the future with Linux +=========================================== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/open-snow-car-osdc-lead.png?itok=IgYZ6mNY) + +I don't think much about it while I'm driving, but I sure do love that my car is equipped with a system that lets me use a few buttons and my voice to call my wife, mom, and children. That same system allows me to choose whether I listen to music streaming from the cloud, satellite radio, or the more traditional AM/FM radio. I also get weather updates and can direct my in-vehicle GPS to find the fastest route to my next destination. [In-vehicle infotainment][1], or IVI as it's known in the industry, has become ubiquitous in today's newest automobiles. + +A while ago, I had to travel hundreds of miles by plane and then rent a car. Happily, I discovered that my rental vehicle was equipped with IVI technology similar to my own car. In no time, I was connected via Bluetooth, had uploaded my contacts into the system, and was calling home to let my family know I arrived safely and my hosts to let them know I was en route to their home. + +In a recent [news roundup][2], Scott Nesbitt cited an article that said Ford Motor Company is getting substantial backing from a rival automaker for its open source [Smart Device Link][3] (SDL) middleware framework, which supports mobile phones. SDL is a project of the [GENIVI Alliance][4], a nonprofit committed to building middleware to support open source in-vehicle infotainment systems. According to [Steven Crumb][5], executive director of GENIVI, their [membership][6] is broad and includes Daimler Group, Hyundai, Volvo, Nissan, Honda, and 170 others. + +In order to remain competitive in the industry, automotive companies need a middleware system that can support the various human machine interface technologies available to consumers today. Whether you own an Android, iOS, or other device, automotive OEMs want their units to be able to support these systems. Furthermore, these IVI systems must be adaptable enough to support the ever decreasing half-life of mobile technology. OEMs want to provide value and add services in their IVI stacks that will support a variety of options for their customers. Enter Linux and open source software. + +In addition to GENIVI's efforts, the [Linux Foundation][7] sponsors the [Automotive Grade Linux][8] (AGL) workgroup, a software foundation dedicated to finding open source solutions for automotive applications. Although AGL will initially focus on IVI systems, they envision branching out to include [telematics][9], heads up displays, and other control systems. AGL has over 50 members at this time, including Jaguar, Toyota, and Nissan, and in a [recent press release][10] announced that Ford, Mazda, Mitsubishi, and Subaru have joined. + +To find out more, we interviewed two leaders in this emerging field. Specifically, we wanted to know how Linux and open source software are being used and if they are in fact changing the face of the automotive industry. First, we talk to [Alison Chaiken][11], a software engineer at Peloton Technology and an expert on automotive Linux, cybersecurity, and transparency. She previously worked for Mentor Graphics, Nokia, and the Stanford Linear Accelerator. Then, we chat with [Steven Crumb][12], executive director of GENIVI, who got started in open source in high-performance computing environments (supercomputers and early cloud computing). He says that though he's not a coder anymore, he loves to help organizations solve real business problems with open source software. + +### Interview with Alison Chaiken (by [Deb Nicholson][13]) + +#### How did you get interested in the automotive software space? + +I was working on [MeeGo][14] in phones at Nokia in 2009 when the project was cancelled. I thought, what's next? A colleague was working on [MeeGo-IVI][15], an early automotive Linux distribution. "Linux is going to be big in cars," I thought, so I headed in that direction. + +#### Can you tell us what aspects you're working on these days? + +I'm currently working for a startup on an advanced cruise control system that uses real-time Linux to increase the safety and fuel economy of big-rig trucks. I love working in this area, as no one would disagree that trucking can be improved. + +#### There have been a few stories about hacked cars in recent years. Can open source solutions help address this issue? + +I presented a talk on precisely this topic, on how Linux can (and cannot) contribute to security solutions in automotive at Southern California Linux Expo 2016 ([Slides][16]). Notably, GENIVI and Automotive Grade Linux have published their code and both projects take patches via Git. Please send your fixes upstream! Many eyes make all bugs shallow. + +#### Law enforcement agencies and insurance companies could find plenty of uses for data about drivers. How easy will it be for them to obtain this information? + +Good question. The Dedicated Short Range Communication Standard (IEEE-1609) takes great pains to keep drivers participating in Wi-Fi safety messaging anonymous. Still, if you're posting to Twitter from your car, someone will be able to track you. + +#### What can developers and private citizens do to make sure civil liberties are protected as automotive technology evolves? + +The Electronic Frontier Foundation (EFF) has done an excellent job of keeping on top of automotive issues, having commented through official channels on what data may be stored in automotive "black boxes" and on how DMCA's Provision 1201 applies to cars. + +#### What are some of the exciting things you see coming for drivers in the next few years? + +Adaptive cruise control and collision avoidance systems are enough of an advance to save lives. As they roll out through vehicle fleets, I truly believe that fatalities will decline. If that's not exciting, I don't know what is. Furthermore, capabilities like automated parking assist will make cars easier to drive and reduce fender-benders. + +#### What needs to be built and how can people get involved? + +Automotive Grade Linux is developed in the open and runs on cheap hardware (e.g. Raspberry Pi 2 and moderately priced Renesas Porter board) that anyone can buy. GENIVI automotive Linux middleware consortium has lots of software publicly available via Git. Furthermore, there is the ultra cool [OSVehicle open hardware][17] automotive platform. + +#### There are many ways for Linux software and open hardware folks with moderate budgets to get involved. Join us at #automotive on Freenode IRC if you have questions. + +### Interview with Steven Crumb (by Don Watkins) + +#### What's so huge about GENIVI's approach to IVI? + +GENIVI filled a huge gap in the automotive industry by pioneering the use of free and open source software, including Linux, for non-safety-critical automotive software like in-vehicle infotainment (IVI) systems. As consumers came to expect the same functionality in their vehicles as on their smartphones, the amount of software required to support IVI functions grew exponentially. The increased amount of software has also increased the costs of building the IVI systems and thus slowed time to market. + +GENIVI's use of open source software and a community development model has saved automakers and their software suppliers significant amounts of money while significantly reducing the time to market. I'm excited about GENIVI because we've been fortunate to lead a revolution of sorts in the automotive industry by slowly evolving organizations from a highly structured and proprietary methodology to a community-based approach. We're not done yet, but it's been a privilege to take part in a transformation that is yielding real benefits. + +#### How do your major members drive the direction of GENIVI? + +GENIVI has a lot of members and non-members contributing to our work. As with many open source projects, any company can influence the technical output by simply contributing code, patches, and time to test. With that said, BMW, Mercedes-Benz, Hyundai Motor, Jaguar Land Rover, PSA, Renault/Nissan, and Volvo are all active adopters of and contributors to GENIVI—and many other OEMs have IVI solutions in their cars that extensively use GENIVI's software. + +#### What licenses cover the contributed code? + +GENIVI employs a number of licenses ranging from (L)GPLv2 to MPLv2 to Apache 2.0. Some of our tools use the Eclipse license. We have a [public licensing policy][18] that details our licensing preferences. + +#### How does a person or group get involved? How important are community contributions to the ongoing success of the project? + +GENIVI does its development completely in the open ([projects.genivi.org][19]) and thus, anyone interested in using open software in automotive is welcome to participate. That said, the alliance can fund its continued development in the open through companies [joining GENIVI][20] as members. GENIVI members enjoy a wide variety of benefits, not the least of which is participation in the global community of 140 companies that has been developed over the last six years. + +Community is hugely important to GENIVI, and we could not have produced and maintained the valuable software we developed over the years without an active community of contributors. We've worked hard to make contributing to GENIVI as simple as joining an [email list][21] and connecting to the people in the various software projects. We use standard practices employed by many open source projects and provide high-quality tools and infrastructure to help developers feel at home and be productive. + +Regardless of someone's familiarity with the automotive software, they are welcome to join our community. People have modified cars for years, so for many people there is a natural draw to anything automotive. Software is the new domain for cars, and GENIVI wants to be the open door for anyone interested in working with automotive, open source software. + +------------------------------- +via: https://opensource.com/business/16/5/interview-alison-chaiken-steven-crumb + +作者:[Don Watkins][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[1]: https://en.wikipedia.org/wiki/In_car_entertainment +[2]: https://opensource.com/life/16/1/weekly-news-jan-9 +[3]: http://projects.genivi.org/smartdevicelink/home +[4]: http://www.genivi.org/ +[5]: https://www.linkedin.com/in/stevecrumb +[6]: http://www.genivi.org/genivi-members +[7]: http://www.linuxfoundation.org/ +[8]: https://www.automotivelinux.org/ +[9]: https://en.wikipedia.org/wiki/Telematics +[10]: https://www.automotivelinux.org/news/announcement/2016/01/ford-mazda-mitsubishi-motors-and-subaru-join-linux-foundation-and +[11]: https://www.linkedin.com/in/alison-chaiken-3ba456b3 +[12]: https://www.linkedin.com/in/stevecrumb +[13]: https://opensource.com/users/eximious +[14]: https://en.wikipedia.org/wiki/MeeGo +[15]: http://webinos.org/deliverable-d026-target-platform-requirements-and-ipr/automotive/ +[16]: http://she-devel.com/Chaiken_automotive_cybersecurity.pdf +[17]: https://www.osvehicle.com/ +[18]: http://projects.genivi.org/how +[19]: http://projects.genivi.org/ +[20]: http://genivi.org/join +[21]: http://lists.genivi.org/mailman/listinfo/genivi-projects From b7968ec4071b96ec0c01ac1192c3adc8a1917490 Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 25 May 2016 20:53:41 +0800 Subject: [PATCH 0796/1469] =?UTF-8?q?20160525-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit container , Raspberry Pi , Arduino --- ...can learn from Arduino and Raspberry Pi.md | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 sources/talk/20160525 What containers and unikernels can learn from Arduino and Raspberry Pi.md diff --git a/sources/talk/20160525 What containers and unikernels can learn from Arduino and Raspberry Pi.md b/sources/talk/20160525 What containers and unikernels can learn from Arduino and Raspberry Pi.md new file mode 100644 index 0000000000..a1d6257d4d --- /dev/null +++ b/sources/talk/20160525 What containers and unikernels can learn from Arduino and Raspberry Pi.md @@ -0,0 +1,51 @@ +What containers and unikernels can learn from Arduino and Raspberry Pi +========================================================================== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/bus-containers.png?itok=vM7_7vs0) + + +Just the other day, I was speaking with a friend who is a mechanical engineer. He works on computer assisted braking systems for semi trucks and mentioned that his company has [Arduinos][1] all over the office. The idea is to encourage people to quickly experiment with new ideas. He also mentioned that Arduinos are more expensive than printed circuits. I was surprised by his comment about price, because coming from the software side of things, my perceptions of Arduinos was that they cost less than designing a specialized circuit. + +I had always viewed [Arduinos][2] and [Raspberry Pi][3] as these cool, little, specialized devices that can be used to make all kinds of fun gadgets. I came from the software side of the world and have always considered Linux on x86 and x86-64 "general purpose." The truth is, Arduinos are not specialized. In fact, they are very general purpose. They are fairly small, fairly cheap, and extremely flexible—that's why they caught on like wildfire. They have all kinds of I/O ports and expansion cards. They allow a maker to go out and build something cool really quickly. They even allow companies to build new products quickly. + +The unit price for an Arduino is much higher than a printed circuit, but time to a minimum viable idea is much lower. With a printed circuit, the unit price can be driven much lower but the upfront capital investment is much higher. So, long story short, the answer is—it depends. + +### Unikernels, rump kernels, and container hosts + +Enter unikernels, rump kernels, and minimal Linux distributions—these operating systems are purpose-built for specific use cases. These specialized operating systems are kind of like printed circuits. They require some up-front investment in planning and design to utilize, but could provide a great performance increase when deploying a specific workload at scale. + +Minimal operating systems such as Red Hat Enterprise Linux Atomic or CoreOS are purpose-built to run containers. They are small, quick, easily configured at boot time, and run containers quite well. The downside is that it requires extra engineering to add third-party extensions such as monitoring agents or tools for virtualization. Some side-loaded tooling needs redesigned as super-privileged containers. This extra engineering could be worth it if you are building a big enough container environment, but might not be necessary to just try out containers. + +Containers provide the ability to run standard workloads (things built on [glibc][4], etc.). The advantage is that the workload artifact (Docker image) can be built and tested on your desktop and deployed in production on completely different hardware or in the cloud with confidence that it will run with the same characteristics. In the production environment, container hosts are still configured by the operations teams, but the application is controlled by the developer. This is a sort of a best of both worlds. + +Unikernels and rump kernels are also purpose-built, but go a step further. The entire operating system is configured at build time by the developer or architect. This has benefits and challenges. + +One benefit is that the developer can control a lot about how the workload will run. Theoretically, a developer could try out [different TCP stacks][5] for different performance characteristics and choose the best one. The developer can configure the IP address ahead of time or have the system configure itself at boot with DHCP. The developer can also cut out anything that is not necessary for their application. There is also the promise of increased performance because of less [context switching][6]. + +There are also challenges with unikernels. Currently, there is a lot of tooling missing. It's much like a printed circuit world right now. A developer has to invest a lot of time and energy discerning if all of the right libraries exist, or they have to change the way their application works. There may also be challenges with how the "embedded" operating system is configured at runtime. Finally, every time a major change is made to the OS, it requires [going back to the developer][7] to change it. This is not a clean separation between development and operations, so I envision some organizational changes being necessary to truly adopt this model. + +### Conclusion + +There is a lot of interesting buzz around specialized container hosts, rump kernels, and unikernels because they hold the potential to revolutionize certain workloads (embedded, cloud, etc.). Keep your eye on this exciting, fast moving space, but cautiously. + +Currently, unikernels seem quite similar to building printed circuits. They require a lot of upfront investment to utilize and are very specialized, providing benefits for certain workloads. In the meantime containers are quite interesting even for conventional workloads and don't require as much investment. Typically an operations team should be able to port an application to containers, whereas it takes real re-engineering to port an application to unikernels and the industry is still not quite sure what workloads can be ported to unikernels. + +Here's to an exciting future of containers, rump kernels, and unikernels! + +-------------------------------------- +via: https://opensource.com/business/16/5/containers-unikernels-learn-arduino-raspberry-pi + +作者:[Scott McCarty][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/fatherlinux +[1]: https://opensource.com/resources/what-arduino +[2]: https://opensource.com/life/16/4/arduino-day-3-projects +[3]: https://opensource.com/resources/what-raspberry-pi +[4]: https://en.wikipedia.org/wiki/GNU_C_Library +[5]: http://www.eetasia.com/ARTICLES/2001JUN/2001JUN18_NTEK_CT_AN5.PDF +[6]: https://en.wikipedia.org/wiki/Context_switch +[7]: http://developers.redhat.com/blog/2016/05/18/3-reasons-i-should-build-my-containerized-applications-on-rhel-and-openshift/ From d25ebf4b5ebc8161ecb4bb05c693bfca60661bb7 Mon Sep 17 00:00:00 2001 From: robot527 Date: Wed, 25 May 2016 22:26:07 +0800 Subject: [PATCH 0797/1469] translating ... modified: sources/tech/20160218 Linux Systems Patched for Critical glibc Flaw.md --- .../20160218 Linux Systems Patched for Critical glibc Flaw.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160218 Linux Systems Patched for Critical glibc Flaw.md b/sources/tech/20160218 Linux Systems Patched for Critical glibc Flaw.md index 19c654e27e..18559701b4 100644 --- a/sources/tech/20160218 Linux Systems Patched for Critical glibc Flaw.md +++ b/sources/tech/20160218 Linux Systems Patched for Critical glibc Flaw.md @@ -1,3 +1,5 @@ +robot527 translating + Linux Systems Patched for Critical glibc Flaw ================================================= From 04bb5e7109e5d086357b2f70b8983365087034b5 Mon Sep 17 00:00:00 2001 From: "eric.xiaozhen" Date: Thu, 26 May 2016 09:43:09 +0800 Subject: [PATCH 0798/1469] translated --- ...n source from a recruiter's perspective.md | 52 ------------------- ...n source from a recruiter's perspective.md | 49 +++++++++++++++++ 2 files changed, 49 insertions(+), 52 deletions(-) delete mode 100644 sources/talk/20160516 Open source from a recruiter's perspective.md create mode 100644 translated/talk/20160516 Open source from a recruiter's perspective.md diff --git a/sources/talk/20160516 Open source from a recruiter's perspective.md b/sources/talk/20160516 Open source from a recruiter's perspective.md deleted file mode 100644 index e8d48f77d0..0000000000 --- a/sources/talk/20160516 Open source from a recruiter's perspective.md +++ /dev/null @@ -1,52 +0,0 @@ -eriwoon 翻译中 -- 2106-May-19 -Open source from a recruiter's perspective -============================================ - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BIZ_workplay.png?itok=uQqFssrf) - -I fell in love with technology when I went to my first open source convention in 2012. - -After spending years in recruiting, I decided to take a job specializing in big data at [Greythorn][1]. I had been trying to learn the ropes for a few months leading up to [OSCON][2], but going to the conference sped that process up like crazy. There were so many brilliant people all in one place, and everyone was willing to share what they knew. It wasn't because they were trying to sell me anything, but because they were all so passionate about what they were working on. - -I soon realized that, in many ways, the open source and big data industry was less an industry and more of a community. That's why I now try to pay it forward and share what I've learned about open source with those who are just getting started in their careers. - -### Why employers want open source contributors - -Many clients tell me that although they want a candidate who has an exceptional technical mind, the ideal person should also really like this stuff. When you are passionate about something, you find yourself working on it even when you aren't getting paid. - -My clients often ask, "Do they code in their spare time?" "Can I find their work anywhere?" "What do they really enjoy?" Open source contributors are often at an advantage because they check these boxes, and not only are their projects out in the open—so is the evidence of their coding proficiency. - -#### Why recruiters search for open source contributors - -Solid tech recruiters understand the technologies and roles they're recruiting for, and they're going to assess your skills accordingly. But I'll admit that many of us have found that the best candidates we've come across have a tendency to be involved in open source, so we often just start our search there. Recruiters provide value to clients when they find candidates who are motivated to work on a team to create something awesome, because that's basically the description of a top-performing employee. - -It makes sense to me: When you take really smart people and give them the chance to be collaborative—for the sake of making something that works really well or may change the landscape of our everyday lives—it creates an energy that can be addictive. - -### What open source contributors can do to build a happy career - -There are obvious things you can do to leverage your open source work to build your career: Put your code on GitHub, participate in projects, go to conferences and join panels and workshops, etc. These are worthwhile, but more than anything you need to know what will make you happy in your work. - -Ask yourself questions like... - -* **Is it important to work for a company that gives back to the open source and software community?** I find that some of my best candidates insist on this, and it makes a huge difference in their job satisfaction. -* **Do you want to work for a company that is based on open source?** The culture is often different in these environments, and it helps to know if that's where you think you'll fit best. -* **Are there people you'd specifically like to work with?** Although you can always try to join the same projects, the odds of collaborating with and learning from someone you admire are better if your day jobs align at the same company. - -Once you know your own career priorities, it's easier to filter out the jobs that won't move you closer to your goals—and if you're working with a recruiter, it helps them match you with the right employer and team. - -Although I don't contribute code, I'll always share what I've learned with those who are working on their career in open source. This community is made up of supportive and smart people, and I love that I've been able to be a small part of it. - - ------------------------------------------------------------------------------- - -via: https://opensource.com/business/16/5/open-source-recruiters-perspective - -作者:[Lindsey Thorne][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/lindsey-thorne -[1]: http://www.greythorn.com/ -[2]: http://conferences.oreilly.com/oscon diff --git a/translated/talk/20160516 Open source from a recruiter's perspective.md b/translated/talk/20160516 Open source from a recruiter's perspective.md new file mode 100644 index 0000000000..200b6ed48c --- /dev/null +++ b/translated/talk/20160516 Open source from a recruiter's perspective.md @@ -0,0 +1,49 @@ +ͷôԴ +============================================ + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BIZ_workplay.png?itok=uQqFssrf) + +2012 ʱҳϯһԴľۻᣬ֮Ҿϲҵ + +ͷܶ꣬ [Greythorn][1] ˾רŴ´ݷƸԼ֮ǰѧϰ˼´ݣǵҲμ [OSCON][2] Դᣬŷ֮ǰѧϰôЧʡOSCON ۼ˷dzˣÿ˶ԸǵĵáԭƷΪϲ + +Һܿʶ˵Դʹһҵ˵һcommunityҲΪʲôرҴӿԴѧĶңرǸЩո̤빤ˡ + +### ΪʲôϲԴߣcontributor +ҵͻ˵һ˵ļȻҪϲԼµĹҪȰԼĹϰ岻Ӱ๤㶼̲סӰࡣ + +ҵĿͻҲʣû¶ʱд𣿡ĶҵǵƷأʲôѽʱԴߵƾͳˣΪǸġĿԴǵҲԴ + +#### ΪʲôͷѰҿԴ + +ӲɿƼҵͷ˽⼼֪ԼһʲôˣͷҲȷ˽ļܡҷ֣ͷҵ˲źܶʱҲԴǾֱȥԴѰǵĿꡣͷǻ߹ҵǸϲŶһ˲IJƷͬҪ + +˵ĿĿǸıδǵЩŶ֮ԼͻᰮԼĹ + +### Դεõõְҵ + +ôĹ׸Ϊ֪أѴŵGithubϣԴĿμӻֵȵȡЩ벻ջġ + +ԳһԼ + +* **ڵĹ˾ǷԴҪ**ܶ˲Ŷǿһ㣬ҲἫǶԹȡ +* **ƷǷڿԴ**ڿԴĹ˾ĻΧ˾ڲͬҲѡְλʱҪǵ⡣ +* **ûر֮ˣ**ȻʱĿŶݻ͵ˣǹͰˡ + +˽Լ׷ô˵Щʺְλͼ򵥶ˣһͷҵϵĹŶӵĻʹˡ + +ȻԼд룬һҴӿԴѧĶҡԴһȺڷɣҺܿҲССһӡ + +------------------------------------------------------------------------------ + +via: https://opensource.com/business/16/5/open-source-recruiters-perspective + +ߣ[Lindsey Thorne][a] +ߣ[eriwoon](https://github.com/eriwoon) +Уԣ[УID](https://github.com/УID) + + [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](https://linux.cn/) Ƴ + +[a]: https://opensource.com/users/lindsey-thorne +[1]: http://www.greythorn.com/ +[2]: http://conferences.oreilly.com/oscon From 37b55febf4201763980f1aed698e634eb4ce9958 Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 26 May 2016 22:28:37 +0800 Subject: [PATCH 0799/1469] =?UTF-8?q?20160526-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit linux , nodejs --- ...OS : LINUX DISTRIBUTION FOR NODE LOVERS.md | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 sources/tech/20160514 NODEOS : LINUX DISTRIBUTION FOR NODE LOVERS.md diff --git a/sources/tech/20160514 NODEOS : LINUX DISTRIBUTION FOR NODE LOVERS.md b/sources/tech/20160514 NODEOS : LINUX DISTRIBUTION FOR NODE LOVERS.md new file mode 100644 index 0000000000..55b7690423 --- /dev/null +++ b/sources/tech/20160514 NODEOS : LINUX DISTRIBUTION FOR NODE LOVERS.md @@ -0,0 +1,53 @@ +NODEOS : LINUX DISTRIBUTION FOR NODE LOVERS +================================================ + +![](http://itsfoss.com/wp-content/uploads/2016/05/node-os-linux.jpg) + +[NodeOS][1], the operating system based on [Node.js][2], is now heading towards its version 1.0 following the release of its first [Release Candidate][3] last year. + +If this is the first time you’re hearing about it, NodeOS is the first ever operating system powered by Node.js & [npm][4] and built on top of the [Linux][5] Kernel. [Jacob Groundwater][6] introduced this project in mid-2013. The primary technologies used in building the system are: + +- **Linux Kernel**: The entire OS is built off the Linux Kernel. +- **Node.js runtime**: Node is used as the primary runtime. +- **npm Packages**: npm is used for package management. + +NodeOS source is hosted on [Github Repository][7]. So, anybody interested can easily contribute and report bugs. Users can build from source or use the [pre-built images][8] available. The build process and quick start guide can be found at project repository. + +The idea behind NodeOS is to provide just enough to let npm run on it and then the rest of the functionalities will come from npm packages. So, the users have access the vast collection of about 250,000 packages and that number is continuously increasing every day. And everything being open-source, it’s always easy to patch bugs and add more packages to npm according to your need. + +NodeOS core development is separated into layers and the general structure includes: + +- **barebones** – custom Linux kernel along with an initramfs that boots to a Node.js REPL +- **initramfs** – Initram filesystem to mount the users partition & boot the system +- **rootfs** – Read-only partition image hosting the Linux kernel & initramfs files +- **usersfs** – multi-user filesystem (as traditional OSes) + +NodeOS aims to be able to run on virtually any platforms, including – **Real Hardware** (personal computers or SOCs), **Cloud platforms, Virtual machines, PaaS providers, Containers** (Docker & Vagga ) etc. And so far, it seems that they’re doing pretty good. On March 3, [Jesús Leganés Combarro][9], NodeOS member on GitHub, [announced][10] that: + +>**NodeOS is not a toy OS anymore**, and it’s very capable to be used on production environments for real use cases from now on. + +So, if you are a die-hard fan of Node.js and/or have a knack for trying new things, this might be the thing for you to try. And in related post, you should read about these niche [Linux distributions for specific usage][11]. + + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/nodeos-operating-system/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 + +作者:[Munif Tanjim][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/munif/ +[1]: http://node-os.com/ +[2]: https://nodejs.org/en/ +[3]: https://github.com/NodeOS/NodeOS/releases/tag/v1.0-RC1 +[4]: https://www.npmjs.com/ +[5]: http://itsfoss.com/tag/linux/ +[6]: https://github.com/groundwater +[7]: https://github.com/nodeos/nodeos +[8]: https://github.com/NodeOS/NodeOS/releases +[9]: https://github.com/piranna +[10]: https://github.com/NodeOS/NodeOS/issues/216 +[11]: http://itsfoss.com/weird-ubuntu-based-linux-distributions/ From 1622096bc64597a037118d0e24d2c5d1e61e6872 Mon Sep 17 00:00:00 2001 From: dongfengweixiao Date: Thu, 26 May 2016 22:56:16 +0800 Subject: [PATCH 0800/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= =?UTF-8?q?=EF=BC=9A20160426=20IS=20UBUNTU=E2=80=99S=20SNAP....?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译完成:20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md --- ...S UBUNTU’S SNAP PACKAGING REALLY SECURE.md | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 translated/20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md diff --git a/translated/20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md b/translated/20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md new file mode 100644 index 0000000000..f898f3536d --- /dev/null +++ b/translated/20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md @@ -0,0 +1,60 @@ +Ubuntu 的 SNAP 封装真的足够安全? +========================================== + + +最近发布的 Ubuntu 16.04 LTS 版本带来了一些新功能,其中之一就是对 ZFS 格式文件系统的支持。 +另一个值得广为讨论的特性就是 Snap 格式的软件包。不过,据 CoreOS 的开发者之一所述, +Snap 封装并不像声称的那样安全。 + +### 什么是 Snap 格式? + +Snap 封装受容器的启发。这种新的封装格式允许开发人员发布运行于 Ubuntu Long-Term-Support (LTS) releases 之上的应用程序更新。 +这就可以让用户虽然运行着稳定版本的系统,但却能够让应用程序保持最新的状态。之所以能够这样, +是因为软件包本身就包含了程序运行的所有依赖。这可以防止依赖的软件更新后软件挂掉。 + +### 然而…… + +据 [Matthew Garrett][5] 的说法,Snap 封装不能完全兑现最后的承诺。Garret 最为 Linux +内核的开发人员和 CoreOS 的安全性相关工作的开发者,我想他一定知道自己在说些什么。 + +[According to Garret][6], “仅需要克服一点点困难,安装的任何 Snap 格式的软件包就能够将你的私有数据复制到任何地方”。 + +[ZDnet][7] 的报道: + +>*“为了证明自己的观点,他在Snap中构建了一个仅用于验证原理的攻击包,它首先会显示一个可爱的泰迪熊, +然后将会记录按键点击事件,并且能够窃取私人的 SSH 密钥。这个仅用于验证原理的工具包实际上注入的是一个无害的命令, +但是却能够修改 cURL session 过程来窃取 SSH 密钥。” + +### 但是稍等…… +难道 Snap 真的有安全缺陷?当然不是啦! + +Garret 自己也说,此问题仅出现在使用 X11 窗口的系统上,而对于那些使用 Mir 的移动设备无效。 +所以这个缺陷是 X11 的而不是 Snap 的。 + +>X11 是如何对应用程序进行受信是一个众所周知的安全风险。Snap 并没有更改 X11 的受信模型。 +所以一个应用程序能够看到其它应用程序的行为并不是新的包格式的缺点,而是 X11 的。 + +Garrett 实际上仅仅是想要表达,当 Canonical 歌颂 Snap 和它的安全性时,Snap 应用程序并不是完全沙盒化的。 +和其他二进制文件一样,它们也存在风险。 + +牢记 Ubuntu 16.04 当前还在使用 X11 而不是 Mir 的事实,从未知的源下载和安全 Snap 格式的软件包具有风险,然而其它不也是如此嘛?! + +相关链接: [如何在 Ubuntu 16.04 中使用 Snap 格式软件包][8]。期待您分享关于 Snap 格式及其安全性的观点。 +---------- +via: http://itsfoss.com/snap-package-securrity-issue/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 + +作者:[ John Paul][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/john/ +[1]: http://itsfoss.com/features-ubuntu-1604/ +[2]: http://itsfoss.com/oracle-canonical-lawsuit/ +[3]: https://en.wikipedia.org/wiki/CoreOS +[4]: https://insights.ubuntu.com/2016/04/13/snaps-for-classic-ubuntu/ +[5]: https://mjg59.dreamwidth.org/l +[6]: https://mjg59.dreamwidth.org/42320.html +[7]: http://www.zdnet.com/article/linux-expert-matthew-garrett-ubuntu-16-04s-new-snap-format-is-a-security-risk/ +[8]: http://itsfoss.com/use-snap-packages-ubuntu-16-04/ From 80d76f707f45512f0ccca993b5fa647a5606ce66 Mon Sep 17 00:00:00 2001 From: dongfengweixiao Date: Thu, 26 May 2016 22:57:14 +0800 Subject: [PATCH 0801/1469] =?UTF-8?q?=E5=B7=B2=E7=BB=8F=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E7=BF=BB=E8=AF=91=2020160426=20IS=20UBUNTU=E2=80=99S=20SNAP=20?= =?UTF-8?q?....?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 已经完成翻译 --- ...S UBUNTU’S SNAP PACKAGING REALLY SECURE.md | 54 ------------------- 1 file changed, 54 deletions(-) delete mode 100644 sources/tech/20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md diff --git a/sources/tech/20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md b/sources/tech/20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md deleted file mode 100644 index 2752b5855f..0000000000 --- a/sources/tech/20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md +++ /dev/null @@ -1,54 +0,0 @@ -IS UBUNTU’S SNAP PACKAGING REALLY SECURE -========================================== - - -The recent release of [Ubuntu 16.04 LTS has brought a number of new features][1], one of which we covered was the [inclusion of ZFS][2]. Another feature that many people have been talking about is the Snap package format. But according to one of the developers of [CoreOS][3], the Snap packages are not as safe as the claim. - -### WHAT ARE SNAP PACKAGES? - -Snap packages are inspired by containers. This new package format allows [developers to issue updates for applications running on Ubuntu Long-Term-Support (LTS) releases][4]. This gives users the option to run a stable operating system, but keep their applications updated. This is accomplished by including all of the application’s dependencies in the same package. This prevents the program from breaking when a dependency updates. - -Another advantage of Snap packages is that the applications are isolated from the rest of the system. This means that if you change something with a Snap package, it will not affect the rest of the system. It also prevents other applications from accessing your private information, which makes it harder for hackers to get your data. - -### BUT WAIT… - -According to [Matthew Garrett][5], Snap can’t quite deliver on the last promise. Garret works as a Linux kernel developer and security developer at CoreOS, so he should know what he’s talking about. - -[According to Garret][6], “Any Snap package you install is completely capable of copying all your private data to wherever it wants with very little difficulty.” - -[ZDnet][7] reported: - ->*“To prove his point, he built a proof-of-concept attack package in Snap, which first shows an “adorable” teddy bear and then logs keystrokes from Firefox and could be used to steal private SSH keys. The PoC actually injects a harmless command, but could be tweaked to include a cURL session to steal SSH keys.”* - -### BUT WAIT A LITTLE MORE… - -Is it really that Snap has security flaws? Apparently not so. - -Garret himself said that this problem was caused by the X11 window system and did not affect mobile devices that use Mir. So, it is the flaw in X11 that does it. It’s not Snap itself. - ->how X11 trusts applications is a well-known security risk. Snap doesn’t change X11’s trust model, so the fact that applications can see what other applications are doing isn’t a weakness in the new package format, but rather X11’s. - -Garrett is just actually trying to show that when Canonical is all praises for Snap and its security; Snap applications are not fully sandboxed. They are as risky as any other binaries. - -Keeping the fact in mind that Ubuntu 16.04 still uses X11 display, and not Mir, downloading and installing Snap packages from unknown sources might be harmful. But that’s the case with any other packaging, isn’t it? - -In related articles, you should check out [how to use Snap packages in Ubuntu 16.04][8]. And do let us know of your views on Snap and its security. - ----------- -via: http://itsfoss.com/snap-package-securrity-issue/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 - -作者:[ John Paul][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/john/ -[1]: http://itsfoss.com/features-ubuntu-1604/ -[2]: http://itsfoss.com/oracle-canonical-lawsuit/ -[3]: https://en.wikipedia.org/wiki/CoreOS -[4]: https://insights.ubuntu.com/2016/04/13/snaps-for-classic-ubuntu/ -[5]: https://mjg59.dreamwidth.org/l -[6]: https://mjg59.dreamwidth.org/42320.html -[7]: http://www.zdnet.com/article/linux-expert-matthew-garrett-ubuntu-16-04s-new-snap-format-is-a-security-risk/ -[8]: http://itsfoss.com/use-snap-packages-ubuntu-16-04/ From ae31eb2c390e69cc153502322ae9b18800c5e908 Mon Sep 17 00:00:00 2001 From: dongfengweixiao Date: Thu, 26 May 2016 23:03:14 +0800 Subject: [PATCH 0802/1469] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=94=99=E5=88=AB?= =?UTF-8?q?=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改错别字 --- translated/20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md b/translated/20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md index f898f3536d..f2585bf33d 100644 --- a/translated/20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md +++ b/translated/20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md @@ -14,7 +14,7 @@ Snap 封装受容器的启发。这种新的封装格式允许开发人员发布 ### 然而…… -据 [Matthew Garrett][5] 的说法,Snap 封装不能完全兑现最后的承诺。Garret 最为 Linux +据 [Matthew Garrett][5] 的说法,Snap 封装不能完全兑现最后的承诺。Garret 作为 Linux 内核的开发人员和 CoreOS 的安全性相关工作的开发者,我想他一定知道自己在说些什么。 [According to Garret][6], “仅需要克服一点点困难,安装的任何 Snap 格式的软件包就能够将你的私有数据复制到任何地方”。 From f61f31a7aae4dd873d1416d3a65dc7ab014c61b7 Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 27 May 2016 00:02:15 +0800 Subject: [PATCH 0803/1469] =?UTF-8?q?20160526-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fedora , openstack , web --- ...st Fedora 24 Beta in an OpenStack cloud.md | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 sources/tech/20160524 Test Fedora 24 Beta in an OpenStack cloud.md diff --git a/sources/tech/20160524 Test Fedora 24 Beta in an OpenStack cloud.md b/sources/tech/20160524 Test Fedora 24 Beta in an OpenStack cloud.md new file mode 100644 index 0000000000..c550880223 --- /dev/null +++ b/sources/tech/20160524 Test Fedora 24 Beta in an OpenStack cloud.md @@ -0,0 +1,77 @@ +Test Fedora 24 Beta in an OpenStack cloud +=========================================== + +![](https://major.io/wp-content/uploads/2012/01/fedorainfinity.png) + +Although there are a few weeks remaining before [Fedora 24][1] is released, you can test out the Fedora 24 Beta release today! This is a great way to get [a sneak peek at new features][2] and help find bugs that still need a fix. + +The [Fedora Cloud][3] image is available for download from your favorite [local mirror][4] or directly from [Fedora’s servers][5]. In this post, I’ll show you how to import this image into an OpenStack environment and begin testing Fedora 24 Beta. + +One last thing: this is beta software. It has been reliable for me so far, but your experience may vary. I would recommend waiting for the final release before deploying any mission critical applications on it. + +### Importing the image + +The older glance client (version 1) allows you to import an image from a URL that is reachable from your OpenStack environment. This is helpful since my OpenStack cloud has a much faster connection to the internet (1 Gbps) than my home does (~ 20 mbps upload speed). However, the functionality to import from a URL was [removed in version 2 of the glance client][6]. The [OpenStackClient][7] doesn’t offer the feature either. + +There are two options here: + +- Install an older version of the glance client +- Use Horizon (the web dashboard) + +Getting an older version of glance client installed is challenging. The OpenStack requirements file for the liberty release [leaves the version of glance client without a maximum version cap][8] and it’s difficult to get all of the dependencies in order to make the older glance client work. + +Let’s use Horizon instead so we can get back to the reason for the post. + +### Adding an image in Horizon + +Log into the Horizon panel and click Compute > Images. Click + Create Image at the top right of the page and a new window should appear. Add this information in the window: + +- **Name**: Fedora 24 Cloud Beta +- **Image Source**: Image Location +- **Image Location**: http://mirrors.kernel.org/fedora/releases/test/24_Beta/CloudImages/x86_64/images/Fedora-Cloud-Base-24_Beta-1.6.x86_64.qcow2 +- **Format**: QCOW2 – QEMU Emulator +- **Copy Data**: ensure the box is checked + +When you’re finished, the window should look like this: + +![](https://major.io/wp-content/uploads/2016/05/horizon_image.png) + +Click Create Image and the images listing should show Saving for a short period of time. Once it switches to Active, you’re ready to build an instance. + +### Building the instance + +Since we’re already in Horizon, we can finish out the build process there. + +On the image listing page, find the row with the image we just uploaded and click Launch Instance on the right side. A new window will appear. The Image Name drop down should already have the Fedora 24 Beta image selected. From here, just choose an instance name, select a security group and keypair (on the Access & Security tab), and a network (on the Networking tab). Be sure to choose a flavor that has some available storage as well (m1.tiny is not enough). + +Click Launch and wait for the instance to boot. + +Once the instance build has finished, you can connect to the instance over ssh as the fedora user. If your [security group allows the connection][9] and your keypair was configured correctly, you should be inside your new Fedora 24 Beta instance! + +Not sure what to do next? Here are some suggestions: + +- Update all packages and reboot (to ensure that you are testing the latest updates) +- Install some familiar applications and verify that they work properly +- Test out your existing automation or configuration management tools +- Open bug tickets! + +-------------------------------------------------------------------------------- + +via: https://major.io/2016/05/24/test-fedora-24-beta-openstack-cloud/ + +作者:[major.io][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://major.io/about-the-racker-hacker/ +[1]: https://fedoraproject.org/wiki/Releases/24/Schedule +[2]: https://fedoraproject.org/wiki/Releases/24/ChangeSet +[3]: https://getfedora.org/en/cloud/ +[4]: https://admin.fedoraproject.org/mirrormanager/mirrors/Fedora/24/x86_64 +[5]: https://getfedora.org/en/cloud/download/ +[6]: https://wiki.openstack.org/wiki/Glance-v2-v1-client-compatability +[7]: http://docs.openstack.org/developer/python-openstackclient/ +[8]: https://github.com/openstack/requirements/blob/stable/liberty/global-requirements.txt#L159 +[9]: https://major.io/2016/05/16/troubleshooting-openstack-network-connectivity/ From e7a8ea803b136327e46b94cf8fc7389248769676 Mon Sep 17 00:00:00 2001 From: David Dai Date: Fri, 27 May 2016 10:15:38 +0800 Subject: [PATCH 0804/1469] Translate 20160301 Linux gives me all the tools I need (#3998) --- .../20160301 Linux gives me all the tools I need.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/talk/my-open-source-story/20160301 Linux gives me all the tools I need.md b/sources/talk/my-open-source-story/20160301 Linux gives me all the tools I need.md index b1689f4164..b092044827 100644 --- a/sources/talk/my-open-source-story/20160301 Linux gives me all the tools I need.md +++ b/sources/talk/my-open-source-story/20160301 Linux gives me all the tools I need.md @@ -1,3 +1,5 @@ +StdioA Translating + Linux gives me all the tools I need ========================================== From a83e3ae5a44485f78219587fd02ae863cc2a7aeb Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 27 May 2016 10:18:18 +0800 Subject: [PATCH 0805/1469] =?UTF-8?q?20160523-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改文件名 for windows --- ...md => 20160520 ORB - NEW GENERATION OF LINUX APPS ARE HERE.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/tech/{20160520 ORB: NEW GENERATION OF LINUX APPS ARE HERE.md => 20160520 ORB - NEW GENERATION OF LINUX APPS ARE HERE.md} (100%) diff --git a/sources/tech/20160520 ORB: NEW GENERATION OF LINUX APPS ARE HERE.md b/sources/tech/20160520 ORB - NEW GENERATION OF LINUX APPS ARE HERE.md similarity index 100% rename from sources/tech/20160520 ORB: NEW GENERATION OF LINUX APPS ARE HERE.md rename to sources/tech/20160520 ORB - NEW GENERATION OF LINUX APPS ARE HERE.md From 4a9146cb5d44b961df7bfb8249d0f366569692fc Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 27 May 2016 10:26:14 +0800 Subject: [PATCH 0806/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= =?UTF-8?q?=EF=BC=8C=E8=AF=B7=E6=A0=A1=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移动到对应目录 @dongfengweixiao --- .../20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md | 1 + 1 file changed, 1 insertion(+) rename translated/{ => tech}/20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md (99%) diff --git a/translated/20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md b/translated/tech/20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md similarity index 99% rename from translated/20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md rename to translated/tech/20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md index f2585bf33d..891af48b0b 100644 --- a/translated/20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md +++ b/translated/tech/20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md @@ -40,6 +40,7 @@ Garrett 实际上仅仅是想要表达,当 Canonical 歌颂 Snap 和它的安 牢记 Ubuntu 16.04 当前还在使用 X11 而不是 Mir 的事实,从未知的源下载和安全 Snap 格式的软件包具有风险,然而其它不也是如此嘛?! 相关链接: [如何在 Ubuntu 16.04 中使用 Snap 格式软件包][8]。期待您分享关于 Snap 格式及其安全性的观点。 + ---------- via: http://itsfoss.com/snap-package-securrity-issue/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 From fb72e1620690ccb24d4062de37ecb8a3909a60c1 Mon Sep 17 00:00:00 2001 From: cposture Date: Fri, 27 May 2016 19:56:10 +0800 Subject: [PATCH 0807/1469] Translating by cposture --- sources/tech/20160518 Python 3: An Intro to Encryption.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160518 Python 3: An Intro to Encryption.md b/sources/tech/20160518 Python 3: An Intro to Encryption.md index 43c042d5c1..f80702a771 100644 --- a/sources/tech/20160518 Python 3: An Intro to Encryption.md +++ b/sources/tech/20160518 Python 3: An Intro to Encryption.md @@ -1,3 +1,4 @@ +[Translating by cposture] Python 3: An Intro to Encryption =================================== From cbf1008263ccaf56baf3a24c598a469056c25f90 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 27 May 2016 22:50:43 +0800 Subject: [PATCH 0808/1469] =?UTF-8?q?PUB:20160426=20IS=20UBUNTU=E2=80=99S?= =?UTF-8?q?=20SNAP=20PACKAGING=20REALLY=20SECURE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @dongfengweixiao --- ...S UBUNTU’S SNAP PACKAGING REALLY SECURE.md | 53 ++++++++++++++++ ...S UBUNTU’S SNAP PACKAGING REALLY SECURE.md | 61 ------------------- 2 files changed, 53 insertions(+), 61 deletions(-) create mode 100644 published/20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md delete mode 100644 translated/tech/20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md diff --git a/published/20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md b/published/20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md new file mode 100644 index 0000000000..42da17d2b7 --- /dev/null +++ b/published/20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md @@ -0,0 +1,53 @@ +Ubuntu 的 snap 软件包封装真的安全吗? +========================================== + +最近发布的 [Ubuntu 16.04 LTS 版本带来了一些新功能[1],其中之一就是对 [ZFS 格式文件系统的支持][2]。另一个值得广为讨论的特性就是 Snap 软件包格式。不过,据 [CoreOS][3] 的开发者之一所述,Snap 软件包并不像声称的那样安全。 + +### 什么是 Snap 软件包? + +Snap 软件包的灵感来自容器。这种新的封装格式允许[开发人员为运行于 Ubuntu 长期支持版本 (LTS)之上的应用程序发布更新][4]。这就可以让用户虽然运行着稳定版本的操作系统,但却能够让应用程序保持最新的状态。之所以能够这样,是因为软件包本身就包含了程序运行的所有依赖。这可以防止依赖的软件更新后软件挂掉。 + +snap 软件包的另外一个优势是应用与系统的其它部分是隔离的。这意味着如果你改变了 snap 软件包的一些东西,它不会影响到系统的其它部分。这也可以防止其它的应用访问你的隐私信息,从而使骇客根据难以获取你的数据。 + +### 然而…… + +据 [Matthew Garrett][5] 的说法,Snap 软件包不能完全兑现上述承诺。Garret 作为 Linux 内核的开发人员和 CoreOS 的安全性方面的开发者,我想他一定知道自己在说些什么。 + +[据 Garret 说][6], “仅需要克服一点点困难,安装的任何 Snap 格式的软件包就完全能够将你所有的私有数据复制到任何地方”。 + +[ZDnet][7] 的报道: + +> “为了证明自己的观点,他在 Snap 中构建了一个仅用于验证其原理的用于破坏的软件包,它首先会显示一个可爱的泰迪熊,然后将会记录 Firefox 的键盘按键事件,并且能够窃取 SSH 私钥。这个仅用于验证原理的软件包实际上注入的是一个无害的命令,但是却能够修改成一个窃取 SSH 密钥的 cURL 会话。” + +### 但是稍等…… + +难道 Snap 真的有安全缺陷?事实上却不是! + +Garret 自己也说,此问题仅出现在使用 X11 窗口系统上,而对于那些使用 Mir 的移动设备无效。所以这个缺陷是 X11 的而不是 Snap 的。 + +> X11 是如何信任应用程序的,这是一个众所周知的安全风险。Snap 并没有更改 X11 的信任模型。所以一个应用程序能够看到其它应用程序的行为并不是这种新的封装格式的缺点,而是 X11 的。 + +Garrett 实际上想表达的只是,当 Canonical 歌颂 Snap 和它的安全性时,Snap 应用程序并不是完全沙盒化的。和其他二进制文件一样,它们也存在风险。 + +请牢记 Ubuntu 16.04 当前还在使用 X11 而不是 Mir 的事实,从未知的源下载和安装 Snap 格式的软件包也许还是有风险的,然而其它不也是如此嘛?! + +相关链接: [如何在 Ubuntu 16.04 中使用 Snap 软件包][8]。期待您分享关于 Snap 格式及其安全性的观点。 + +---------- +via: http://itsfoss.com/snap-package-securrity-issue/ + +作者:[John Paul][a] +译者:[dongfengweixiao](https://github.com/dongfengweixiao) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://itsfoss.com/author/john/ +[1]: http://itsfoss.com/features-ubuntu-1604/ +[2]: http://itsfoss.com/oracle-canonical-lawsuit/ +[3]: https://en.wikipedia.org/wiki/CoreOS +[4]: https://insights.ubuntu.com/2016/04/13/snaps-for-classic-ubuntu/ +[5]: https://mjg59.dreamwidth.org/l +[6]: https://mjg59.dreamwidth.org/42320.html +[7]: http://www.zdnet.com/article/linux-expert-matthew-garrett-ubuntu-16-04s-new-snap-format-is-a-security-risk/ +[8]: http://itsfoss.com/use-snap-packages-ubuntu-16-04/ diff --git a/translated/tech/20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md b/translated/tech/20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md deleted file mode 100644 index 891af48b0b..0000000000 --- a/translated/tech/20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md +++ /dev/null @@ -1,61 +0,0 @@ -Ubuntu 的 SNAP 封装真的足够安全? -========================================== - - -最近发布的 Ubuntu 16.04 LTS 版本带来了一些新功能,其中之一就是对 ZFS 格式文件系统的支持。 -另一个值得广为讨论的特性就是 Snap 格式的软件包。不过,据 CoreOS 的开发者之一所述, -Snap 封装并不像声称的那样安全。 - -### 什么是 Snap 格式? - -Snap 封装受容器的启发。这种新的封装格式允许开发人员发布运行于 Ubuntu Long-Term-Support (LTS) releases 之上的应用程序更新。 -这就可以让用户虽然运行着稳定版本的系统,但却能够让应用程序保持最新的状态。之所以能够这样, -是因为软件包本身就包含了程序运行的所有依赖。这可以防止依赖的软件更新后软件挂掉。 - -### 然而…… - -据 [Matthew Garrett][5] 的说法,Snap 封装不能完全兑现最后的承诺。Garret 作为 Linux -内核的开发人员和 CoreOS 的安全性相关工作的开发者,我想他一定知道自己在说些什么。 - -[According to Garret][6], “仅需要克服一点点困难,安装的任何 Snap 格式的软件包就能够将你的私有数据复制到任何地方”。 - -[ZDnet][7] 的报道: - ->*“为了证明自己的观点,他在Snap中构建了一个仅用于验证原理的攻击包,它首先会显示一个可爱的泰迪熊, -然后将会记录按键点击事件,并且能够窃取私人的 SSH 密钥。这个仅用于验证原理的工具包实际上注入的是一个无害的命令, -但是却能够修改 cURL session 过程来窃取 SSH 密钥。” - -### 但是稍等…… -难道 Snap 真的有安全缺陷?当然不是啦! - -Garret 自己也说,此问题仅出现在使用 X11 窗口的系统上,而对于那些使用 Mir 的移动设备无效。 -所以这个缺陷是 X11 的而不是 Snap 的。 - ->X11 是如何对应用程序进行受信是一个众所周知的安全风险。Snap 并没有更改 X11 的受信模型。 -所以一个应用程序能够看到其它应用程序的行为并不是新的包格式的缺点,而是 X11 的。 - -Garrett 实际上仅仅是想要表达,当 Canonical 歌颂 Snap 和它的安全性时,Snap 应用程序并不是完全沙盒化的。 -和其他二进制文件一样,它们也存在风险。 - -牢记 Ubuntu 16.04 当前还在使用 X11 而不是 Mir 的事实,从未知的源下载和安全 Snap 格式的软件包具有风险,然而其它不也是如此嘛?! - -相关链接: [如何在 Ubuntu 16.04 中使用 Snap 格式软件包][8]。期待您分享关于 Snap 格式及其安全性的观点。 - ----------- -via: http://itsfoss.com/snap-package-securrity-issue/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 - -作者:[ John Paul][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/john/ -[1]: http://itsfoss.com/features-ubuntu-1604/ -[2]: http://itsfoss.com/oracle-canonical-lawsuit/ -[3]: https://en.wikipedia.org/wiki/CoreOS -[4]: https://insights.ubuntu.com/2016/04/13/snaps-for-classic-ubuntu/ -[5]: https://mjg59.dreamwidth.org/l -[6]: https://mjg59.dreamwidth.org/42320.html -[7]: http://www.zdnet.com/article/linux-expert-matthew-garrett-ubuntu-16-04s-new-snap-format-is-a-security-risk/ -[8]: http://itsfoss.com/use-snap-packages-ubuntu-16-04/ From 1fe23001aa6a888b5bc3cebde3760a4361058bd8 Mon Sep 17 00:00:00 2001 From: qingyunha Date: Sat, 28 May 2016 00:32:21 +0800 Subject: [PATCH 0809/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= =?UTF-8?q?=2020160527=20A=20Python=20Interpreter=20Written=20in=20Python?= =?UTF-8?q?=20(#4000)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @qingyunha merged --- ... A Python Interpreter Written in Python.md | 996 ++++++++++++++++++ 1 file changed, 996 insertions(+) create mode 100644 translated/tech/20160527 A Python Interpreter Written in Python.md diff --git a/translated/tech/20160527 A Python Interpreter Written in Python.md b/translated/tech/20160527 A Python Interpreter Written in Python.md new file mode 100644 index 0000000000..dbf8dc7cf4 --- /dev/null +++ b/translated/tech/20160527 A Python Interpreter Written in Python.md @@ -0,0 +1,996 @@ +用Python实现Python解释器 +=== + +_Allison是Dropbox的工程师,在那里她维护着世界上最大的由Python客户组成的网络。在Dropbox之前,她是Recurse Center的导师, 曾在纽约写作。在北美的PyCon做过关于Python内部机制的演讲,并且她喜欢奇怪的bugs。她的博客地址是[akaptur.com](http://akaptur.com)._ + +## Introduction + +Byterun是一个用Python实现的Python解释器。随着我在Byterun上的工作,我惊讶并很高兴地的发现,这个Python解释器的基础结构可以满足500行的限制。在这一章我们会搞清楚这个解释器的结构,给你足够的知识探索下去。我们的目标不是向你展示解释器的每个细节---像编程和计算机科学其他有趣的领域一样,你可能会投入几年的时间去搞清楚这个主题。 + +Byterun是Ned Batchelder和我完成的,建立在Paul Swartz的工作之上。它的结构和主要的Python实现(CPython)差不多,所以理解Byterun会帮助你理解大多数解释器特别是CPython解释器。(如果你不知道你用的是什么Python,那么很可能它就是CPython)。尽管Byterun很小,但它能执行大多数简单的Python程序。 + +### A Python Interpreter + +在开始之前,让我们缩小一下“Pyhton解释器”的意思。在讨论Python的时候,“解释器”这个词可以用在很多不同的地方。有的时候解释器指的是REPL,当你在命令行下敲下`python`时所得到的交互式环境。有时候人们会相互替代的使用Python解释器和Python来说明执行Python代码的这一过程。在本章,“解释器”有一个更精确的意思:执行Python程序过程中的最后一步。 + +在解释器接手之前,Python会执行其他3个步骤:词法分析,语法解析和编译。这三步合起来把源代码转换成_code object_,它包含着解释器可以理解的指令。而解释器的工作就是解释code object中的指令。 + +你可能很奇怪执行Python代码会有编译这一步。Python通常被称为解释型语言,就像Ruby,Perl一样,它们和编译型语言相对,比如C,Rust。然而,这里的术语并不是它看起来的那样精确。大多数解释型语言包括Python,确实会有编译这一步。而Python被称为解释型的原因是相对于编译型语言,它在编译这一步的工作相对较少(解释器做相对多的工作)。在这章后面你会看到,Python的编译器比C语言编译器需要更少的关于程序行为的信息。 + +### A Python Python Interpreter + +Byterun是一个用Python写的Python解释器,这点可能让你感到奇怪,但没有比用C语言写C语言编译器更奇怪。(事实上,广泛使用的gcc编译器就是用C语言本身写的)你可以用几乎的任何语言写一个Python解释器。 + +用Python写Python既有优点又有缺点。最大的缺点就是速度:用Byterun执行代码要比用CPython执行慢的多,CPython解释器是用C语言实现的并做了优化。然而Byterun是为了学习而设计的,所以速度对我们不重要。使用Python最大优点是我们可以*仅仅*实现解释器,而不用担心Python运行时的部分,特别是对象系统。比如当Byterun需要创建一个类时,它就会回退到“真正”的Python。另外一个优势是Byterun很容易理解,部分原因是它是用高级语言写的(Python!)(另外我们不会对解释器做优化 --- 再一次,清晰和简单比速度更重要) + +## Building an Interpreter + +在我们考察Byterun代码之前,我们需要一些对解释器结构的高层次视角。Python解释器是如何工作的? + +Python解释器是一个_虚拟机_,模拟真实计算机的软件。我们这个虚拟机是栈机器,它用几个栈来完成操作(与之相对的是寄存器机器,它从特定的内存地址读写数据)。 + +Python解释器是一个_字节码解释器_:它的输入是一些命令集合称作_字节码_。当你写Python代码时,词法分析器,语法解析器和编译器生成code object让解释器去操作。每个code object都包含一个要被执行的指令集合 --- 它就是字节码 --- 另外还有一些解释器需要的信息。字节码是Python代码的一个_中间层表示_:它以一种解释器可以理解的方式来表示源代码。这和汇编语言作为C语言和机器语言的中间表示很类似。 + +### A Tiny Interpreter + +为了让说明更具体,让我们从一个非常小的解释器开始。它只能计算两个数的和,只能理解三个指令。它执行的所有代码只是这三个指令的不同组合。下面就是这三个指令: + +- `LOAD_VALUE` +- `ADD_TWO_VALUES` +- `PRINT_ANSWER` + +我们不关心词法,语法和编译,所以我们也不在乎这些指令是如何产生的。你可以想象,你写下`7 + 5`,然后一个编译器为你生成那三个指令的组合。如果你有一个合适的编译器,你甚至可以用Lisp的语法来写,只要它能生成相同的指令。 + +假设 + +```python +7 + 5 +``` + +生成这样的指令集: + +```python +what_to_execute = { + "instructions": [("LOAD_VALUE", 0), # the first number + ("LOAD_VALUE", 1), # the second number + ("ADD_TWO_VALUES", None), + ("PRINT_ANSWER", None)], + "numbers": [7, 5] } +``` + +Python解释器是一个_栈机器_,所以它必须通过操作栈来完成这个加法。(\aosafigref{500l.interpreter.stackmachine}.)解释器先执行第一条指令,`LOAD_VALUE`,把第一个数压到栈中。接着它把第二个数也压到栈中。然后,第三条指令,`ADD_TWO_VALUES`,先把两个数从栈中弹出,加起来,再把结果压入栈中。最后一步,把结果弹出并输出。 + +\aosafigure[240pt]{interpreter-images/interpreter-stack.png}{A stack machine}{500l.interpreter.stackmachine} + +`LOAD_VALUE`这条指令告诉解释器把一个数压入栈中,但指令本身并没有指明这个数是多少。指令需要一个额外的信息告诉解释器去哪里找到这个数。所以我们的指令集有两个部分:指令本身和一个常量列表。(在Python中,字节码就是我们称为的“指令”,而解释器执行的是_code object_。) + +为什么不把数字直接嵌入指令之中?想象一下,如果我们加的不是数字,而是字符串。我们可不想把字符串这样的东西加到指令中,因为它可以有任意的长度。另外,我们这种设计也意味着我们只需要对象的一份拷贝,比如这个加法 `7 + 7`, 现在常量表 `"numbers"`只需包含一个`7`。 + +你可能会想为什么会需要除了`ADD_TWO_VALUES`之外的指令。的确,对于我们两个数加法,这个例子是有点人为制作的意思。然而,这个指令却是建造更复杂程序的轮子。比如,就我们目前定义的三个指令,只要给出正确的指令组合,我们可以做三个数的加法,或者任意个数的加法。同时,栈提供了一个清晰的方法去跟踪解释器的状态,这为我们增长的复杂性提供了支持。 + +现在让我们来完成我们的解释器。解释器对象需要一个栈,它可以用一个列表来表示。它还需要一个方法来描述怎样执行每条指令。比如,`LOAD_VALUE`会把一个值压入栈中。 + +```python +class Interpreter: + def __init__(self): + self.stack = [] + + def LOAD_VALUE(self, number): + self.stack.append(number) + + def PRINT_ANSWER(self): + answer = self.stack.pop() + print(answer) + + def ADD_TWO_VALUES(self): + first_num = self.stack.pop() + second_num = self.stack.pop() + total = first_num + second_num + self.stack.append(total) +``` + +这三个方法完成了解释器所理解的三条指令。但解释器还需要一样东西:一个能把所有东西结合在一起并执行的方法。这个方法就叫做`run_code`, 它把我们前面定义的字典结构`what-to-execute`作为参数,循环执行里面的每条指令,如何指令有参数,处理参数,然后调用解释器对象中相应的方法。 + +```python + def run_code(self, what_to_execute): + instructions = what_to_execute["instructions"] + numbers = what_to_execute["numbers"] + for each_step in instructions: + instruction, argument = each_step + if instruction == "LOAD_VALUE": + number = numbers[argument] + self.LOAD_VALUE(number) + elif instruction == "ADD_TWO_VALUES": + self.ADD_TWO_VALUES() + elif instruction == "PRINT_ANSWER": + self.PRINT_ANSWER() +``` + +为了测试,我们创建一个解释器对象,然后用前面定义的 7 + 5 的指令集来调用`run_code`。 + +```python + interpreter = Interpreter() + interpreter.run_code(what_to_execute) +``` + +显然,它会输出12 + +尽管我们的解释器功能受限,但这个加法过程几乎和真正的Python解释器是一样的。这里,我们还有几点要注意。 + +首先,一些指令需要参数。在真正的Python bytecode中,大概有一半的指令有参数。像我们的例子一样,参数和指令打包在一起。注意_指令_的参数和传递给对应方法的参数是不同的。 + +第二,指令`ADD_TWO_VALUES`不需要任何参数,它从解释器栈中弹出所需的值。这正是以栈为基础的解释器的特点。 + +记得我们说过只要给出合适的指令集,不需要对解释器做任何改变,我们就能做多个数的加法。考虑下面的指令集,你觉得会发生什么?如果你有一个合适的编译器,什么代码才能编译出下面的指令集? + +```python + what_to_execute = { + "instructions": [("LOAD_VALUE", 0), + ("LOAD_VALUE", 1), + ("ADD_TWO_VALUES", None), + ("LOAD_VALUE", 2), + ("ADD_TWO_VALUES", None), + ("PRINT_ANSWER", None)], + "numbers": [7, 5, 8] } +``` + +从这点出发,我们开始看到这种结构的可扩展性:我们可以通过向解释器对象增加方法来描述更多的操作(只要有一个编译器能为我们生成组织良好的指令集)。 + +#### Variables + +接下来给我们的解释器增加变量的支持。我们需要一个保存变量值的指令,`STORE_NAME`;一个取变量值的指令`LOAD_NAME`;和一个变量到值的映射关系。目前,我们会忽略命名空间和作用域,所以我们可以把变量和值的映射直接存储在解释器对象中。最后,我们要保证`what_to_execute`除了一个常量列表,还要有个变量名字的列表。 + +```python +>>> def s(): +... a = 1 +... b = 2 +... print(a + b) +# a friendly compiler transforms `s` into: + what_to_execute = { + "instructions": [("LOAD_VALUE", 0), + ("STORE_NAME", 0), + ("LOAD_VALUE", 1), + ("STORE_NAME", 1), + ("LOAD_NAME", 0), + ("LOAD_NAME", 1), + ("ADD_TWO_VALUES", None), + ("PRINT_ANSWER", None)], + "numbers": [1, 2], + "names": ["a", "b"] } +``` + +我们的新的的实现在下面。为了跟踪哪名字绑定到那个值,我们在`__init__`方法中增加一个`environment`字典。我们也增加了`STORE_NAME`和`LOAD_NAME`方法,它们获得变量名,然后从`environment`字典中设置或取出这个变量值。 + +现在指令参数就有两个不同的意思,它可能是`numbers`列表的索引,也可能是`names`列表的索引。解释器通过检查所执行的指令就能知道是那种参数。而我们打破这种逻辑 ,把指令和它所用何种参数的映射关系放在另一个单独的方法中。 + +```python +class Interpreter: + def __init__(self): + self.stack = [] + self.environment = {} + + def STORE_NAME(self, name): + val = self.stack.pop() + self.environment[name] = val + + def LOAD_NAME(self, name): + val = self.environment[name] + self.stack.append(val) + + def parse_argument(self, instruction, argument, what_to_execute): + """ Understand what the argument to each instruction means.""" + numbers = ["LOAD_VALUE"] + names = ["LOAD_NAME", "STORE_NAME"] + + if instruction in numbers: + argument = what_to_execute["numbers"][argument] + elif instruction in names: + argument = what_to_execute["names"][argument] + + return argument + + def run_code(self, what_to_execute): + instructions = what_to_execute["instructions"] + for each_step in instructions: + instruction, argument = each_step + argument = self.parse_argument(instruction, argument, what_to_execute) + + if instruction == "LOAD_VALUE": + self.LOAD_VALUE(argument) + elif instruction == "ADD_TWO_VALUES": + self.ADD_TWO_VALUES() + elif instruction == "PRINT_ANSWER": + self.PRINT_ANSWER() + elif instruction == "STORE_NAME": + self.STORE_NAME(argument) + elif instruction == "LOAD_NAME": + self.LOAD_NAME(argument) +``` + +仅仅五个指令,`run_code`这个方法已经开始变得冗长了。如果保持这种结构,那么每条指令都需要一个`if`分支。这里,我们要利用Python的动态方法查找。我们总会给一个称为`FOO`的指令定义一个名为`FOO`的方法,这样我们就可用Python的`getattr`函数在运行时动态查找方法,而不用这个大大的分支结构。`run_code`方法现在是这样: + +```python + def execute(self, what_to_execute): + instructions = what_to_execute["instructions"] + for each_step in instructions: + instruction, argument = each_step + argument = self.parse_argument(instruction, argument, what_to_execute) + bytecode_method = getattr(self, instruction) + if argument is None: + bytecode_method() + else: + bytecode_method(argument) +``` + +## Real Python Bytecode + +现在,放弃我们的小指令集,去看看真正的Python字节码。字节码的结构和我们的小解释器的指令集差不多,除了字节码用一个字节而不是一个名字来指示这条指令。为了理解它的结构,我们将考察一个函数的字节码。考虑下面这个例子: + +```python +>>> def cond(): +... x = 3 +... if x < 5: +... return 'yes' +... else: +... return 'no' +... +``` + +Python在运行时会暴露一大批内部信息,并且我们可以通过REPL直接访问这些信息。对于函数对象`cond`,`cond.__code__`是与其关联的code object,而`cond.__code__.co_code`就是它的字节码。当你写Python代码时,你永远也不会想直接使用这些属性,但是这可以让我们做出各种恶作剧,同时也可以看看内部机制。 + +```python +>>> cond.__code__.co_code # the bytecode as raw bytes +b'd\x01\x00}\x00\x00|\x00\x00d\x02\x00k\x00\x00r\x16\x00d\x03\x00Sd\x04\x00Sd\x00 + \x00S' +>>> list(cond.__code__.co_code) # the bytecode as numbers +[100, 1, 0, 125, 0, 0, 124, 0, 0, 100, 2, 0, 107, 0, 0, 114, 22, 0, 100, 3, 0, 83, + 100, 4, 0, 83, 100, 0, 0, 83] +``` + +当我们直接输出这个字节码,它看起来完全无法理解 --- 唯一我们了解的是它是一串字节。很幸运,我们有一个很强大的工具可以用:Python标准库中的`dis`模块。 + +`dis`是一个字节码反汇编器。反汇编器以为机器而写的底层代码作为输入,比如汇编代码和字节码,然后以人类可读的方式输出。当我们运行`dis.dis`, 它输出每个字节码的解释。 + +```python +>>> dis.dis(cond) + 2 0 LOAD_CONST 1 (3) + 3 STORE_FAST 0 (x) + + 3 6 LOAD_FAST 0 (x) + 9 LOAD_CONST 2 (5) + 12 COMPARE_OP 0 (<) + 15 POP_JUMP_IF_FALSE 22 + + 4 18 LOAD_CONST 3 ('yes') + 21 RETURN_VALUE + + 6 >> 22 LOAD_CONST 4 ('no') + 25 RETURN_VALUE + 26 LOAD_CONST 0 (None) + 29 RETURN_VALUE +``` + +这些都是什么意思?让我们以第一条指令`LOAD_CONST`为例子。第一列的数字(`2`)表示对应源代码的行数。第二列的数字是字节码的索引,告诉我们指令`LOAD_CONST`在0位置。第三列是指令本身对应的人类可读的名字。如果第四列存在,它表示指令的参数。如果第5列存在,它是一个关于参数是什么的提示。 + +考虑这个字节码的前几个字节:[100, 1, 0, 125, 0, 0]。这6个字节表示两条带参数的指令。我们可以使用`dis.opname`,一个字节到可读字符串的映射,来找到指令100和指令125代表是什么: + +```python +>>> dis.opname[100] +'LOAD_CONST' +>>> dis.opname[125] +'STORE_FAST' +``` + +第二和第三个字节 --- 1 ,0 ---是`LOAD_CONST`的参数,第五和第六个字节 --- 0,0 --- 是`STORE_FAST`的参数。就像我们前面的小例子,`LOAD_CONST`需要知道的到哪去找常量,`STORE_FAST`需要找到名字。(Python的`LOAD_CONST`和我们小例子中的`LOAD_VALUE`一样,`LOAD_FAST`和`LOAD_NAME`一样)。所以这六个字节代表第一行源代码`x = 3`.(为什么用两个字节表示指令的参数?如果Python使用一个字节,每个code object你只能有256个常量/名字,而用两个字节,就增加到了256的平方,65536个)。 + +### Conditionals and Loops + +到目前为止,我们的解释器只能一条接着一条的执行指令。这有个问题,我们经常会想多次执行某个指令,或者在特定的条件下跳过它们。为了可以写循环和分支结构,解释器必须能够在指令中跳转。在某种程度上,Python在字节码中使用`GOTO`语句来处理循环和分支!让我们再看一个`cond`函数的反汇编结果: + +```python +>>> dis.dis(cond) + 2 0 LOAD_CONST 1 (3) + 3 STORE_FAST 0 (x) + + 3 6 LOAD_FAST 0 (x) + 9 LOAD_CONST 2 (5) + 12 COMPARE_OP 0 (<) + 15 POP_JUMP_IF_FALSE 22 + + 4 18 LOAD_CONST 3 ('yes') + 21 RETURN_VALUE + + 6 >> 22 LOAD_CONST 4 ('no') + 25 RETURN_VALUE + 26 LOAD_CONST 0 (None) + 29 RETURN_VALUE +``` + +第三行的条件表达式`if x < 5`被编译成四条指令:`LOAD_FAST`, `LOAD_CONST`, `COMPARE_OP`和 `POP_JUMP_IF_FALSE`。`x < 5`对应加载`x`,加载5,比较这两个值。指令`POP_JUMP_IF_FALSE`完成`if`语句。这条指令把栈顶的值弹出,如果值为真,什么都不发生。如果值为假,解释器会跳转到另一条指令。 + +这条将被加载的指令称为跳转目标,它作为指令`POP_JUMP`的参数。这里,跳转目标是22,索引为22的指令是`LOAD_CONST`,对应源码的第6行。(`dis`用`>>`标记跳转目标。)如果`X < 5`为假,解释器会忽略第四行(`return yes`),直接跳转到第6行(`return "no"`)。因此解释器通过跳转指令选择性的执行指令。 + +Python的循环也依赖于跳转。在下面的字节码中,`while x < 5`这一行产生了和`if x < 10`几乎一样的字节码。在这两种情况下,解释器都是先执行比较,然后执行`POP_JUMP_IF_FALSE`来控制下一条执行哪个指令。第四行的最后一条字节码`JUMP_ABSOLUT`(循环体结束的地方),让解释器返回到循环开始的第9条指令处。当 `x < 10`变为假,`POP_JUMP_IF_FALSE`会让解释器跳到循环的终止处,第34条指令。 + +```python +>>> def loop(): +... x = 1 +... while x < 5: +... x = x + 1 +... return x +... +>>> dis.dis(loop) + 2 0 LOAD_CONST 1 (1) + 3 STORE_FAST 0 (x) + + 3 6 SETUP_LOOP 26 (to 35) + >> 9 LOAD_FAST 0 (x) + 12 LOAD_CONST 2 (5) + 15 COMPARE_OP 0 (<) + 18 POP_JUMP_IF_FALSE 34 + + 4 21 LOAD_FAST 0 (x) + 24 LOAD_CONST 1 (1) + 27 BINARY_ADD + 28 STORE_FAST 0 (x) + 31 JUMP_ABSOLUTE 9 + >> 34 POP_BLOCK + + 5 >> 35 LOAD_FAST 0 (x) + 38 RETURN_VALUE +``` + +### Explore Bytecode + +我希望你用`dis.dis`来试试你自己写的函数。一些有趣的问题值得探索: + +- 对解释器而言for循环和while循环有什么不同? +- 能不能写出两个不同函数,却能产生相同的字节码? +- `elif`是怎么工作的?列表推导呢? + +## Frames + +到目前为止,我们已经知道了Python虚拟机是一个栈机器。它能顺序执行指令,在指令间跳转,压入或弹出栈值。但是这和我们期望的解释器还有一定距离。在前面的那个例子中,最后一条指令是`RETURN_VALUE`,它和`return`语句相对应。但是它返回到哪里去呢? + +为了回答这个问题,我们必须再增加一层复杂性:frame。一个frame是一些信息的集合和代码的执行上下文。frames在Python代码执行时动态的创建和销毁。每个frame对应函数的一次调用。--- 所以每个frame只有一个code object与之关联,而一个code object可以有多个frame。比如你有一个函数递归的调用自己10次,这会产生11个frame,每次调用对应一个,再加上启动模块对应的一个frame。总的来说,Python程序的每个作用域有一个frame,比如,模块,函数,类。 + +Frame存在于_调用栈_中,一个和我们之前讨论的完全不同的栈。(你最熟悉的栈就是调用栈,就是你经常看到的异常回溯,每个以"File 'program.py'"开始的回溯对应一个frame。)解释器在执行字节码时操作的栈,我们叫它_数据栈_。其实还有第三个栈,叫做_块栈_,用于特定的控制流块,比如循环和异常处理。调用栈中的每个frame都有它自己的数据栈和块栈。 + +让我们用一个具体的例子来说明。假设Python解释器执行到标记为3的地方。解释器正在`foo`函数的调用中,它接着调用`bar`。下面是frame调用栈,块栈和数据栈的示意图。我们感兴趣的是解释器先从最底下的`foo()`开始,接着执行`foo`的函数体,然后到达`bar`。 + +```python +>>> def bar(y): +... z = y + 3 # <--- (3) ... and the interpreter is here. +... return z +... +>>> def foo(): +... a = 1 +... b = 2 +... return a + bar(b) # <--- (2) ... which is returning a call to bar ... +... +>>> foo() # <--- (1) We're in the middle of a call to foo ... +3 +``` + +\aosafigure[240pt]{interpreter-images/interpreter-callstack.png}{The call stack}{500l.interpreter.callstack} + +现在,解释器在`bar`函数的调用中。调用栈中有3个frame:一个对应于模块层,一个对应函数`foo`,别一个对应函数`bar`。(\aosafigref{500l.interpreter.callstack}.)一旦`bar`返回,与它对应的frame就会从调用栈中弹出并丢弃。 + +字节码指令`RETURN_VALUE`告诉解释器在frame间传递一个值。首先,它把位于调用栈栈顶的frame中的数据栈的栈顶值弹出。然后把整个frame弹出丢弃。最后把这个值压到下一个frame的数据栈中。 + +当Ned Batchelder和我在写Byterun时,很长一段时间我们的实现中一直有个重大的错误。我们整个虚拟机中只有一个数据栈,而不是每个frame都有一个。我们写了很多测试代码,同时在Byterun和真正的Python上运行,希望得到一致结果。我们几乎通过了所有测试,只有一样东西不能通过,那就是生成器。最后,通过仔细的阅读CPython的源码,我们发现了错误所在[^thanks]。把数据栈移到每个frame就解决了这个问题。 + +[^thanks]: 感谢 Michael Arntzenius 对这个bug的洞悉。 + +回头在看看这个bug,我惊讶的发现Python真的很少依赖于每个frame有一个数据栈这个特性。在Python中几乎所有的操作都会清空数据栈,所以所有的frame公用一个数据栈是没问题的。在上面的例子中,当`bar`执行完后,它的数据栈为空。即使`foo`公用这一个栈,它的值也不会受影响。然而,对应生成器,一个关键的特点是它能暂停一个frame的执行,返回到其他的frame,一段时间后它能返回到原来的frame,并以它离开时的相同状态继续执行。 + +## Byterun + +现在我们有足够的Python解释器的知识背景去考察Byterun。 + +Byterun中有四种对象。 + +- `VirtualMachine`类,它管理高层结构,frame调用栈,指令到操作的映射。这是一个比前面`Inteprter`对象更复杂的版本。 +- `Frame`类,每个`Frame`类都有一个code object,并且管理者其他一些必要的状态信息,全局和局部命名空间,指向调用它的frame的指针和最后执行的字节码指令。 +- `Function`类,它被用来代替真正的Python函数。回想一下,调用函数时会创建一个新的frame。我们自己实现`Function`,所以我们控制新frame的创建。 +- `Block`类,它只是包装了block的3个属性。(block的细节不是解释器的核心,我们不会花时间在它身上,把它列在这里,是因为Byterun需要它。) + +### The `VirtualMachine` Class + +程序运行时只有一个`VirtualMachine`被创建,因为我们只有一个解释器。`VirtualMachine`保存调用栈,异常状态,在frame中传递的返回值。它的入口点是`run_code`方法,它以编译后的code object为参数,以创建一个frame为开始,然后运行这个frame。这个frame可能再创建出新的frame;调用栈随着程序的运行增长缩短。当第一个frame返回时,执行结束。 + +```python +class VirtualMachineError(Exception): + pass + +class VirtualMachine(object): + def __init__(self): + self.frames = [] # The call stack of frames. + self.frame = None # The current frame. + self.return_value = None + self.last_exception = None + + def run_code(self, code, global_names=None, local_names=None): + """ An entry point to execute code using the virtual machine.""" + frame = self.make_frame(code, global_names=global_names, + local_names=local_names) + self.run_frame(frame) + +``` + +### The `Frame` Class + +接下来,我们来写`Frame`对象。frame是一个属性的集合,它没有任何方法。前面提到过,这些属性包括由编译器生成的code object;局部,全局和内置命名空间;前一个frame的引用;一个数据栈;一个块栈;最后执行的指令指针。(对于内置命名空间我们需要多做一点工作,Python在不同模块中对这个命名空间有不同的处理;但这个细节对我们的虚拟机不重要。) + +```python +class Frame(object): + def __init__(self, code_obj, global_names, local_names, prev_frame): + self.code_obj = code_obj + self.global_names = global_names + self.local_names = local_names + self.prev_frame = prev_frame + self.stack = [] + if prev_frame: + self.builtin_names = prev_frame.builtin_names + else: + self.builtin_names = local_names['__builtins__'] + if hasattr(self.builtin_names, '__dict__'): + self.builtin_names = self.builtin_names.__dict__ + + self.last_instruction = 0 + self.block_stack = [] +``` + +接着,我们在虚拟机中增加对frame的操作。这有3个帮助函数:一个创建新的frame的方法,和压栈和出栈的方法。第四个函数,`run_frame`,完成执行frame的主要工作,待会我们再讨论这个方法。 + +```python +class VirtualMachine(object): + [... snip ...] + + # Frame manipulation + def make_frame(self, code, callargs={}, global_names=None, local_names=None): + if global_names is not None and local_names is not None: + local_names = global_names + elif self.frames: + global_names = self.frame.global_names + local_names = {} + else: + global_names = local_names = { + '__builtins__': __builtins__, + '__name__': '__main__', + '__doc__': None, + '__package__': None, + } + local_names.update(callargs) + frame = Frame(code, global_names, local_names, self.frame) + return frame + + def push_frame(self, frame): + self.frames.append(frame) + self.frame = frame + + def pop_frame(self): + self.frames.pop() + if self.frames: + self.frame = self.frames[-1] + else: + self.frame = None + + def run_frame(self): + pass + # we'll come back to this shortly +``` + +### The `Function` Class + +`Function`的实现有点扭曲,但是大部分的细节对理解解释器不重要。重要的是当调用函数时 --- `__call__`方法被调用 --- 它创建一个新的`Frame`并运行它。 + +```python +class Function(object): + """ + Create a realistic function object, defining the things the interpreter expects. + """ + __slots__ = [ + 'func_code', 'func_name', 'func_defaults', 'func_globals', + 'func_locals', 'func_dict', 'func_closure', + '__name__', '__dict__', '__doc__', + '_vm', '_func', + ] + + def __init__(self, name, code, globs, defaults, closure, vm): + """You don't need to follow this closely to understand the interpreter.""" + self._vm = vm + self.func_code = code + self.func_name = self.__name__ = name or code.co_name + self.func_defaults = tuple(defaults) + self.func_globals = globs + self.func_locals = self._vm.frame.f_locals + self.__dict__ = {} + self.func_closure = closure + self.__doc__ = code.co_consts[0] if code.co_consts else None + + # Sometimes, we need a real Python function. This is for that. + kw = { + 'argdefs': self.func_defaults, + } + if closure: + kw['closure'] = tuple(make_cell(0) for _ in closure) + self._func = types.FunctionType(code, globs, **kw) + + def __call__(self, *args, **kwargs): + """When calling a Function, make a new frame and run it.""" + callargs = inspect.getcallargs(self._func, *args, **kwargs) + # Use callargs to provide a mapping of arguments: values to pass into the new + # frame. + frame = self._vm.make_frame( + self.func_code, callargs, self.func_globals, {} + ) + return self._vm.run_frame(frame) + +def make_cell(value): + """Create a real Python closure and grab a cell.""" + # Thanks to Alex Gaynor for help with this bit of twistiness. + fn = (lambda x: lambda: x)(value) + return fn.__closure__[0] +``` + +接着,回到`VirtualMachine`对象,我们对数据栈的操作也增加一些帮助方法。字节码操作的栈总是在当前frame的数据栈。这些帮助函数让我们能实现`POP_TOP`,`LOAD_FAST`字节码,并且让其他操作栈的指令可读性更高。 + +```python +class VirtualMachine(object): + [... snip ...] + + # Data stack manipulation + def top(self): + return self.frame.stack[-1] + + def pop(self): + return self.frame.stack.pop() + + def push(self, *vals): + self.frame.stack.extend(vals) + + def popn(self, n): + """Pop a number of values from the value stack. + A list of `n` values is returned, the deepest value first. + """ + if n: + ret = self.frame.stack[-n:] + self.frame.stack[-n:] = [] + return ret + else: + return [] +``` + +在我们运行frame之前,我们还需两个方法。 + +第一个方法,`parse_byte_and_args`,以一个字节码为输入,先检查它是否有参数,如果有,就解析它的参数。这个方法同时也更新frame的`last_instruction`属性,它指向最后执行的指令。一条没有参数的指令只有一个字节长度,而有参数的字节有3个字节长。参数的意义依赖于指令是什么。比如,前面说过,指令`POP_JUMP_IF_FALSE`,它的参数指的是跳转目标。`BUILD_LIST`, 它的参数是列表的个数。`LOAD_CONST`,它的参数是常量的索引。 + +一些指令用简单的数字作为参数。对于另一些,虚拟机需要一点努力去发现它含意。标准库中的`dis`模块中有一个备忘单,它解释什么参数有什么意思,这让我们的代码更加简洁。比如,列表`dis.hasname`告诉我们`LOAD_NAME`, `IMPORT_NAME`,`LOAD_GLOBAL`,以及另外的9个指令都有同样的意思:名字列表的索引。 + +```python +class VirtualMachine(object): + [... snip ...] + + def parse_byte_and_args(self): + f = self.frame + opoffset = f.last_instruction + byteCode = f.code_obj.co_code[opoffset] + f.last_instruction += 1 + byte_name = dis.opname[byteCode] + if byteCode >= dis.HAVE_ARGUMENT: + # index into the bytecode + arg = f.code_obj.co_code[f.last_instruction:f.last_instruction+2] + f.last_instruction += 2 # advance the instruction pointer + arg_val = arg[0] + (arg[1] * 256) + if byteCode in dis.hasconst: # Look up a constant + arg = f.code_obj.co_consts[arg_val] + elif byteCode in dis.hasname: # Look up a name + arg = f.code_obj.co_names[arg_val] + elif byteCode in dis.haslocal: # Look up a local name + arg = f.code_obj.co_varnames[arg_val] + elif byteCode in dis.hasjrel: # Calculate a relative jump + arg = f.last_instruction + arg_val + else: + arg = arg_val + argument = [arg] + else: + argument = [] + + return byte_name, argument +``` + +下一个方法是`dispatch`,它查看给定的指令并执行相应的操作。在CPython中,这个分派函数用一个巨大的switch语句实现,有超过1500行的代码。幸运的是,我们用的是Python,我们的代码会简洁的多。我们会为每一个字节码名字定义一个方法,然后用`getattr`来查找。就像我们前面的小解释器一样,如果一条指令叫做`FOO_BAR`,那么它对应的方法就是`byte_FOO_BAR`。现在,我们先把这些方法当做一个黑盒子。每个指令方法都会返回`None`或者一个字符串`why`,有些情况下虚拟机需要这个额外`why`信息。这些指令方法的返回值,仅作为解释器状态的内部指示,千万不要和执行frame的返回值相混淆。 + + +```python +class VirtualMachine(object): + [... snip ...] + + def dispatch(self, byte_name, argument): + """ Dispatch by bytename to the corresponding methods. + Exceptions are caught and set on the virtual machine.""" + + # When later unwinding the block stack, + # we need to keep track of why we are doing it. + why = None + try: + bytecode_fn = getattr(self, 'byte_%s' % byte_name, None) + if bytecode_fn is None: + if byte_name.startswith('UNARY_'): + self.unaryOperator(byte_name[6:]) + elif byte_name.startswith('BINARY_'): + self.binaryOperator(byte_name[7:]) + else: + raise VirtualMachineError( + "unsupported bytecode type: %s" % byte_name + ) + else: + why = bytecode_fn(*argument) + except: + # deal with exceptions encountered while executing the op. + self.last_exception = sys.exc_info()[:2] + (None,) + why = 'exception' + + return why + + def run_frame(self, frame): + """Run a frame until it returns (somehow). + Exceptions are raised, the return value is returned. + """ + self.push_frame(frame) + while True: + byte_name, arguments = self.parse_byte_and_args() + + why = self.dispatch(byte_name, arguments) + + # Deal with any block management we need to do + while why and frame.block_stack: + why = self.manage_block_stack(why) + + if why: + break + + self.pop_frame() + + if why == 'exception': + exc, val, tb = self.last_exception + e = exc(val) + e.__traceback__ = tb + raise e + + return self.return_value +``` + +### The `Block` Class + +在我们完成每个字节码方法前,我们简单的讨论一下块。一个块被用于某种控制流,特别是异常处理和循环。它负责保证当操作完成后数据栈处于正确的状态。比如,在一个循环中,一个特殊的迭代器会存在栈中,当循环完成时它从栈中弹出。解释器需要检查循环仍在继续还是已经停止。 + +为了跟踪这些额外的信息,解释器设置了一个标志来指示它的状态。我们用一个变量`why`实现这个标志,它可以是`None`或者是下面几个字符串这一,`"continue"`, `"break"`,`"excption"`,`return`。他们指示对块栈和数据栈进行什么操作。回到我们迭代器的例子,如果块栈的栈顶是一个`loop`块,`why`是`continue`,迭代器就因该保存在数据栈上,不是如果`why`是`break`,迭代器就会被弹出。 + +块操作的细节比较精细,我们不会花时间在这上面,但是有兴趣的读者值得仔细的看看。 + +```python +Block = collections.namedtuple("Block", "type, handler, stack_height") + +class VirtualMachine(object): + [... snip ...] + + # Block stack manipulation + def push_block(self, b_type, handler=None): + level = len(self.frame.stack) + self.frame.block_stack.append(Block(b_type, handler, stack_height)) + + def pop_block(self): + return self.frame.block_stack.pop() + + def unwind_block(self, block): + """Unwind the values on the data stack corresponding to a given block.""" + if block.type == 'except-handler': + # The exception itself is on the stack as type, value, and traceback. + offset = 3 + else: + offset = 0 + + while len(self.frame.stack) > block.level + offset: + self.pop() + + if block.type == 'except-handler': + traceback, value, exctype = self.popn(3) + self.last_exception = exctype, value, traceback + + def manage_block_stack(self, why): + """ """ + frame = self.frame + block = frame.block_stack[-1] + if block.type == 'loop' and why == 'continue': + self.jump(self.return_value) + why = None + return why + + self.pop_block() + self.unwind_block(block) + + if block.type == 'loop' and why == 'break': + why = None + self.jump(block.handler) + return why + + if (block.type in ['setup-except', 'finally'] and why == 'exception'): + self.push_block('except-handler') + exctype, value, tb = self.last_exception + self.push(tb, value, exctype) + self.push(tb, value, exctype) # yes, twice + why = None + self.jump(block.handler) + return why + + elif block.type == 'finally': + if why in ('return', 'continue'): + self.push(self.return_value) + + self.push(why) + + why = None + self.jump(block.handler) + return why + return why +``` + +## The Instructions + +剩下了的就是完成那些指令方法了:`byte_LOAD_FAST`,`byte_BINARY_MODULO`等等。而这些指令的实现并不是很有趣,这里我们只展示了一小部分,完整的实现在这儿https://github.com/nedbat/byterun。(足够执行我们前面所述的所有代码了。) + +```python +class VirtualMachine(object): + [... snip ...] + + ## Stack manipulation + + def byte_LOAD_CONST(self, const): + self.push(const) + + def byte_POP_TOP(self): + self.pop() + + ## Names + def byte_LOAD_NAME(self, name): + frame = self.frame + if name in frame.f_locals: + val = frame.f_locals[name] + elif name in frame.f_globals: + val = frame.f_globals[name] + elif name in frame.f_builtins: + val = frame.f_builtins[name] + else: + raise NameError("name '%s' is not defined" % name) + self.push(val) + + def byte_STORE_NAME(self, name): + self.frame.f_locals[name] = self.pop() + + def byte_LOAD_FAST(self, name): + if name in self.frame.f_locals: + val = self.frame.f_locals[name] + else: + raise UnboundLocalError( + "local variable '%s' referenced before assignment" % name + ) + self.push(val) + + def byte_STORE_FAST(self, name): + self.frame.f_locals[name] = self.pop() + + def byte_LOAD_GLOBAL(self, name): + f = self.frame + if name in f.f_globals: + val = f.f_globals[name] + elif name in f.f_builtins: + val = f.f_builtins[name] + else: + raise NameError("global name '%s' is not defined" % name) + self.push(val) + + ## Operators + + BINARY_OPERATORS = { + 'POWER': pow, + 'MULTIPLY': operator.mul, + 'FLOOR_DIVIDE': operator.floordiv, + 'TRUE_DIVIDE': operator.truediv, + 'MODULO': operator.mod, + 'ADD': operator.add, + 'SUBTRACT': operator.sub, + 'SUBSCR': operator.getitem, + 'LSHIFT': operator.lshift, + 'RSHIFT': operator.rshift, + 'AND': operator.and_, + 'XOR': operator.xor, + 'OR': operator.or_, + } + + def binaryOperator(self, op): + x, y = self.popn(2) + self.push(self.BINARY_OPERATORS[op](x, y)) + + COMPARE_OPERATORS = [ + operator.lt, + operator.le, + operator.eq, + operator.ne, + operator.gt, + operator.ge, + lambda x, y: x in y, + lambda x, y: x not in y, + lambda x, y: x is y, + lambda x, y: x is not y, + lambda x, y: issubclass(x, Exception) and issubclass(x, y), + ] + + def byte_COMPARE_OP(self, opnum): + x, y = self.popn(2) + self.push(self.COMPARE_OPERATORS[opnum](x, y)) + + ## Attributes and indexing + + def byte_LOAD_ATTR(self, attr): + obj = self.pop() + val = getattr(obj, attr) + self.push(val) + + def byte_STORE_ATTR(self, name): + val, obj = self.popn(2) + setattr(obj, name, val) + + ## Building + + def byte_BUILD_LIST(self, count): + elts = self.popn(count) + self.push(elts) + + def byte_BUILD_MAP(self, size): + self.push({}) + + def byte_STORE_MAP(self): + the_map, val, key = self.popn(3) + the_map[key] = val + self.push(the_map) + + def byte_LIST_APPEND(self, count): + val = self.pop() + the_list = self.frame.stack[-count] # peek + the_list.append(val) + + ## Jumps + + def byte_JUMP_FORWARD(self, jump): + self.jump(jump) + + def byte_JUMP_ABSOLUTE(self, jump): + self.jump(jump) + + def byte_POP_JUMP_IF_TRUE(self, jump): + val = self.pop() + if val: + self.jump(jump) + + def byte_POP_JUMP_IF_FALSE(self, jump): + val = self.pop() + if not val: + self.jump(jump) + + ## Blocks + + def byte_SETUP_LOOP(self, dest): + self.push_block('loop', dest) + + def byte_GET_ITER(self): + self.push(iter(self.pop())) + + def byte_FOR_ITER(self, jump): + iterobj = self.top() + try: + v = next(iterobj) + self.push(v) + except StopIteration: + self.pop() + self.jump(jump) + + def byte_BREAK_LOOP(self): + return 'break' + + def byte_POP_BLOCK(self): + self.pop_block() + + ## Functions + + def byte_MAKE_FUNCTION(self, argc): + name = self.pop() + code = self.pop() + defaults = self.popn(argc) + globs = self.frame.f_globals + fn = Function(name, code, globs, defaults, None, self) + self.push(fn) + + def byte_CALL_FUNCTION(self, arg): + lenKw, lenPos = divmod(arg, 256) # KWargs not supported here + posargs = self.popn(lenPos) + + func = self.pop() + frame = self.frame + retval = func(*posargs) + self.push(retval) + + def byte_RETURN_VALUE(self): + self.return_value = self.pop() + return "return" +``` + +## Dynamic Typing: What the Compiler Doesn't Know + +你可能听过Python是一种动态语言 --- 是它是动态类型的。在我们建造解释器的过程中,已经透露出这样的信息。 + +动态的一个意思是很多工作在运行时完成。前面我们看到Python的编译器没有很多关于代码真正做什么的信息。举个例子,考虑下面这个简单的函数`mod`。它取两个参数,返回它们的模运算值。从它的字节码中,我们看到变量`a`和`b`首先被加载,然后字节码`BINAY_MODULO`完成这个模运算。 + +```python +>>> def mod(a, b): +... return a % b +>>> dis.dis(mod) + 2 0 LOAD_FAST 0 (a) + 3 LOAD_FAST 1 (b) + 6 BINARY_MODULO + 7 RETURN_VALUE +>>> mod(19, 5) +4 +``` + +计算19 % 5得4,--- 一点也不奇怪。如果我们用不同类的参数呢? + +```python +>>> mod("by%sde", "teco") +'bytecode' +``` + +刚才发生了什么?你可能见过这样的语法,格式化字符串。 + +``` +>>> print("by%sde" % "teco") +bytecode +``` + +用符号`%`去格式化字符串会调用字节码`BUNARY_MODULO`.它取栈顶的两个值求模,不管这两个值是字符串,数字或是你自己定义的类的实例。字节码在函数编译时生成(或者说,函数定义时)相同的字节码会用于不同类的参数。 + +Python的编译器关于字节码的功能知道的很少。而取决于解释器来决定`BINAYR_MODULO`应用于什么类型的对象并完成正确的操作。这就是为什么Python被描述为_动态类型_:直到运行前你不必知道这个函数参数的类型。相反,在一个静态类型语言中,程序员需要告诉编译器参数的类型是什么(或者编译器自己推断出参数的类型。) + +编译器的无知是优化Python的一个挑战 --- 只看字节码,而不真正运行它,你就不知道每条字节码在干什么!你可以定义一个类,实现`__mod__`方法,当你对这个类的实例使用`%`时,Python就会自动调用这个方法。所以,`BINARY_MODULO`其实可以运行任何代码。 + +看看下面的代码,第一个`a % b`看起来没有用。 + +```python +def mod(a,b): + a % b + return a %b +``` + +不幸的是,对这段代码进行静态分析 --- 不运行它 --- 不能确定第一个`a % b`没有做任何事。用 `%`调用`__mod__`可能会写一个文件,或是和程序的其他部分交互,或者其他任何可以在Python中完成的事。很难优化一个你不知道它会做什么的函数。在Russell Power和Alex Rubinsteyn的优秀论文中写道,“我们可以用多快的速度解释Python?”,他们说,“在普遍缺乏类型信息下,每条指令必须被看作一个`INVOKE_ARBITRARY_METHOD`。” + +## Conclusion + +Byterun是一个比CPython容易理解的简洁的Python解释器。Byterun复制了CPython的主要结构:一个基于栈的指令集称为字节码,它们顺序执行或在指令间跳转,向栈中压入和从中弹出数据。解释器随着函数和生成器的调用和返回,动态的创建,销毁frame,并在frame间跳转。Byterun也有着和真正解释器一样的限制:因为Python使用动态类型,解释器必须在运行时决定指令的正确行为。 + +我鼓励你去反汇编你的程序,然后用Byterun来运行。你很快会发现这个缩短版的Byterun所没有实现的指令。完整的实现在https://github.com/nedbat/byterun,或者仔细阅读真正的CPython解释器`ceval.c`,你也可以实现自己的解释器! + +## Acknowledgements + +Thanks to Ned Batchelder for originating this project and guiding my contributions, Michael Arntzenius for his help debugging the code and editing the prose, Leta Montopoli for her edits, and the entire Recurse Center community for their support and interest. Any errors are my own. + +-------------------------------------- +via:http://aosabook.org/en/500L/a-python-interpreter-written-in-python.html + +作者: Allison Kaptur Allison + +译者:[qingyunha](https://github.com/qingyunha) + +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 9415b5b74954aac10a1a5c1827e23a9960fb37e2 Mon Sep 17 00:00:00 2001 From: mudongliang Date: Fri, 27 May 2016 14:16:35 -0400 Subject: [PATCH 0810/1469] translation apply --- .../tech/20160218 How to Best Manage Encryption Keys on Linux.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160218 How to Best Manage Encryption Keys on Linux.md b/sources/tech/20160218 How to Best Manage Encryption Keys on Linux.md index 19aab96541..e09f88db3e 100644 --- a/sources/tech/20160218 How to Best Manage Encryption Keys on Linux.md +++ b/sources/tech/20160218 How to Best Manage Encryption Keys on Linux.md @@ -1,3 +1,4 @@ +mudongliang translating How to Best Manage Encryption Keys on Linux ============================================= From 3bbb70b826d9930a66ff979e52f190445b73ff64 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 28 May 2016 09:27:16 +0800 Subject: [PATCH 0811/1469] PUB:20160223 Intel shows budget Android phone powering big-screen Linux @geekpi --- ...Android phone powering big-screen Linux.md | 34 +++++++++++++++++++ ...Android phone powering big-screen Linux.md | 34 ------------------- 2 files changed, 34 insertions(+), 34 deletions(-) create mode 100644 published/20160223 Intel shows budget Android phone powering big-screen Linux.md delete mode 100644 translated/tech/20160223 Intel shows budget Android phone powering big-screen Linux.md diff --git a/published/20160223 Intel shows budget Android phone powering big-screen Linux.md b/published/20160223 Intel shows budget Android phone powering big-screen Linux.md new file mode 100644 index 0000000000..45f9f05032 --- /dev/null +++ b/published/20160223 Intel shows budget Android phone powering big-screen Linux.md @@ -0,0 +1,34 @@ +Intel 展示了可在大屏幕显示 Linux 系统的低端 Android 手机 +============================================================== + +![](https://regmedia.co.uk/2016/02/23/intel-bigscreen.jpg?x=648&y=348&crop=1) + +在世界移动大会 **MWC16** 上 Intel 展示了称之为“大屏体验”的一款的 Android 智能手机,它在插入一个外部显示后运行了一个完整的 Linux 桌面。 + +这个概念大体上与微软在 Windows 10 手机中的 Continuum 相似,但是 Continuum 面向的是高端设备,Intel 的项目面向的是低端智能机和新兴市场。 + +在巴塞罗那的这场大会上展示的是拥有 Atom x3、2GB RAM 和 16GB 存储以及支持外部显示的的 SoFIA(Intel 架构的智能或功能手机)智能机原型。插上键盘、鼠标和显示,它就变成了一台桌面 Linux,并可以选择在大屏幕的一个窗口中显示 Android 桌面。 + +Intel 的拓荒小组(Path Finding Group)经理 Nir Metzer 告诉我们:“Android 基于 Linux 内核,因此我们运行在一个内核上,我们有一个 Android 栈和一个 Linux 栈,并且我们共享同一个环境,因此文件系统是相同的。电话是全功能的。” + +Metzer 说:“我有一个多窗口环境。只要我插入显示器后就可以使用电子表格,我可以进行拖放操作,播放音频。在一个低端平台实现这一切是一个挑战。” + +现在当连上外部显示器时设备的屏幕显示是空白的,但是 Metzer 说下个版本的 Atom X3 会支持双显示。 + +其使用的 Linux 版本是由 Intel 维护的。Metzer 说:“我们需要将 Linux 和 Android 保持一致。框架是预安装的,你不能下载任何 app。” + +英特尔在移动世界大会上向手机制造商们推销这一想法,但却没有实际说希望购买该设备的消费者。Metzer 说:“芯片已经准备好了,已经为量产准备好了。明天就可以进入生产。但是这要看商业需求。” + +-------------------------------------------------------------------------------- + +via: http://www.theregister.co.uk/2016/02/23/move_over_continuum_intel_shows_android_smartphone_powering_bigscreen_linux/ + +作者:[Tim Anderson][a] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.theregister.co.uk/Author/2878 + + diff --git a/translated/tech/20160223 Intel shows budget Android phone powering big-screen Linux.md b/translated/tech/20160223 Intel shows budget Android phone powering big-screen Linux.md deleted file mode 100644 index aedd61f966..0000000000 --- a/translated/tech/20160223 Intel shows budget Android phone powering big-screen Linux.md +++ /dev/null @@ -1,34 +0,0 @@ -Intel展示了带动大屏幕Linux的便宜Android手机 -============================================================== - -![](https://regmedia.co.uk/2016/02/23/intel-bigscreen.jpg?x=648&y=348&crop=1) - -在世界移动会议**MWC16**上Intel展示了称之为“大屏体验”的一款的Android智能手机,它在插入一个外部显示后运行了一个完整的Linux桌面。 - -这个概念大体上与微软在Windows 10手机中的Continuum相似,但是Continuum面向的是高端设备,Intel的项目面向的是低端智能机何新兴市场。 - -显示上Barcelona是拥有Atom x3、2GB RAM和16GB存储以及支持外部显示的的SoFIA(Intel架构的只能或功能手机)智能机原型。插上键盘、鼠标何显示,它就变成了一台桌面Linux,可以选择在大屏幕中显示Android桌面。 - -Intel的拓荒小组经理Nir Metzer告诉Reg:“Android基于Linux内核,因此我们运行的是一个内核,我们有一个Android栈和一个Linux栈,并且我们共享一个上下文,因此文件系统是相同的。电话是全功能的。” - -Metzer说:“我有一个多窗口环境。只要我插入后就可以做电子表格,我可以拖拽、播放音频。在一个低端平台实现这一切是一个挑战。” - -现在当连上外部显示器时设备的屏幕显示的空白,但是Metzer说下个版本的Atom X3会支持双显示。 - -使用的Linux版本是由Intel维护的。Metzer说:“我们需要将Linux和Android保持一致。框架是预安装的,你不能下载任何app” - -英特尔在移动世界大会上向手机制造商们推销这一想法,但却没有实际报告购买该设备的消费者。Metzer说:“芯片已经准备好了,已经为量产准备好了。这可以明天进入生产。这是一个商业决定。” - --------------------------------------------------------------------------------- - -via: http://www.theregister.co.uk/2016/02/23/move_over_continuum_intel_shows_android_smartphone_powering_bigscreen_linux/ - -作者:[Tim Anderson][a] -译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.theregister.co.uk/Author/2878 - - From 50fb557a139cf6c63921821a045ffac865856806 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 28 May 2016 09:41:16 +0800 Subject: [PATCH 0812/1469] PUB:20160429 Master OpenStack with 5 new tutorials @Vic020 @PurlingNayuki --- ...0160429 Master OpenStack with 5 new tutorials.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) rename {translated/tech => published}/20160429 Master OpenStack with 5 new tutorials.md (70%) diff --git a/translated/tech/20160429 Master OpenStack with 5 new tutorials.md b/published/20160429 Master OpenStack with 5 new tutorials.md similarity index 70% rename from translated/tech/20160429 Master OpenStack with 5 new tutorials.md rename to published/20160429 Master OpenStack with 5 new tutorials.md index 47ad95b663..7f189b8f51 100644 --- a/translated/tech/20160429 Master OpenStack with 5 new tutorials.md +++ b/published/20160429 Master OpenStack with 5 new tutorials.md @@ -1,18 +1,17 @@ -Master OpenStack with 5 new tutorials -5篇文章快速掌握OpenStack +推荐五篇 OpenStack 的新指南 ======================================= ![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/education/EDUCATION_tools.png?itok=ybxr0Qe9) -回顾这周的 OpenStack 峰会,我仍然回味着开源云生态系统的浩瀚无垠,并且需要熟悉多少个不同的项目和概念才能获得成功。但是,我们是幸运的,因为有许多资源让我们跟随项目的脚步。除了[官方文档][1]外,我们还有许多来自三方组织的培训和认证、个人分享,以及许多社区贡献的学习资源。 +回顾这周的 OpenStack 峰会,我仍然回味着开源云生态系统的浩瀚无垠,有那么多需要了解的项目及概念才能获得成功。不过我们很幸运,因为有许多资源让我们跟随着项目的脚步。除了[官方文档][1]外,我们还有许多来自第三方提供的培训和认证、个人分享,以及许多社区贡献的学习资源。 为了让我们保持获得最新消息,每个月我们将会整合发布 OpenStack 社区的最新教程、指导和小贴士等。下面是我们过去几个月最棒的发布分享。 -- 首先,如果你正在寻找一个靠谱实惠的 OpenStack 测试实验室, Intel NUC 是最值得考虑的平台.麻雀虽小,五脏俱全,通过指导文章,可以很轻松的按照教程在 NUC 上使用 [TripleO 部署 OpenStack][2] ,并且还可以轻松预防一些常见的怪异问题。 +- 首先,如果你正在寻找一个靠谱实惠的 OpenStack 测试实验室, Intel NUC 是最值得考虑的平台。麻雀虽小,五脏俱全,通过指导文章,可以很轻松的按照教程在 NUC 上使用 [TripleO 部署 OpenStack][2] ,并且还可以轻松避开一些常见的古怪问题。 - 当你已经运行的一段时间 OpenStack 后,你会发现在你的云系统上许多组件生成了大量日志。其中一些是可以安全删除的,而你需要一个管理这些日志的方案。参考在部署生产 9 个月后使用 Celiometer 管理日志的[一些思考][3]。 -- 对于 OpenStack 基础设施项目的新手,想要提交补丁到 OpenStack 是相当困难的。入口在哪里,测试怎么做,我的提交步骤是怎么样的?可以通过 Arie Bregman 的[博客文章][4]快速了解整个提交过程。 -- 突发计算节点失效,不知道是硬件还是软件问题。好消息是 OpenStack 提供了一套非常简单的迁移计划可以让迁移当机节点到别的主机。然而,迁移过程中使用的命令令许多人感到困惑。可以通过[这篇文章][5]来理解 migrate 和 evacuate 命令的不同。 -- 网络功能虚拟化技术需要 OpenStack 中的额外的功能,而用户可能不熟悉它们。例如, SR-IOV 和 PCI 直通是最大限度地提高物理硬件性能的方式。可以学习[部署步骤][6]以使 OpenStack 的性能最大化。 +- 对于 OpenStack 基础设施项目的新手,想要提交补丁到 OpenStack 是相当困难的。入口在哪里,测试怎么做,我的提交步骤是怎么样的?可以通过 Arie Bregman 的这篇[博客文章][4]快速了解整个提交过程。 +- 突发计算节点失效,不知道是硬件还是软件问题。不过好消息是 OpenStack 提供了一套非常简单的迁移计划可以让你迁移当机节点到别的主机。然而,迁移过程中使用的命令令许多人感到困惑。可以通过[这篇文章][5]来理解 migrate 和 evacuate 命令的不同。 +- 网络功能虚拟化技术需要 OpenStack 之外的一些功能,而用户可能不熟悉它们。例如, SR-IOV 和 PCI 直通是最大限度地提高物理硬件性能的方式。可以学习[部署步骤][6]以使 OpenStack 的性能最大化。 这些文章基本涵盖了本月(译者注: 4 月)推送,如果你还需要更多文章,可以检索过去推送的 [OpenStack 文献][7]来获取更多资源。如果有你认为我们应该推荐的新教程,请在评论中告诉我们,谢谢。 From 2ac616c1579a8afcc7aa994627e7b1f42dca51c0 Mon Sep 17 00:00:00 2001 From: David Dai Date: Sat, 28 May 2016 10:09:37 +0800 Subject: [PATCH 0813/1469] Translated 20160301 Linux gives me all the tools I need.md (#4002) * Translated 20160301 Linux gives me all the tools I need.md * Remove 'Translating' header --- ...301 Linux gives me all the tools I need.md | 58 ------------------- ...301 Linux gives me all the tools I need.md | 56 ++++++++++++++++++ 2 files changed, 56 insertions(+), 58 deletions(-) delete mode 100644 sources/talk/my-open-source-story/20160301 Linux gives me all the tools I need.md create mode 100644 translated/talk/my-open-source-story/20160301 Linux gives me all the tools I need.md diff --git a/sources/talk/my-open-source-story/20160301 Linux gives me all the tools I need.md b/sources/talk/my-open-source-story/20160301 Linux gives me all the tools I need.md deleted file mode 100644 index b092044827..0000000000 --- a/sources/talk/my-open-source-story/20160301 Linux gives me all the tools I need.md +++ /dev/null @@ -1,58 +0,0 @@ -StdioA Translating - -Linux gives me all the tools I need -========================================== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/OPENHERE_blue.png?itok=3eqp-7gT) - -[Linux][0] is all around us. It's [on our phones][1] in the form of Android. It's [used on the International Space Station][2]. It [provides much of the backbone of the Internet][3]. And yet many people never notice it. Discovering Linux is a rewarding endeavor. Lots of other people have [shared their Linux stories][4] on Opensource.com, and now it's my turn. - -I still remember when I first discovered Linux in 2008. The person who helped me discover Linux was my father, Socrates Ballais. He was an economics professor here in Tacloban City, Philippines. He was also a technology enthusiast. He taught me a lot about computers and technology, but only advocated using Linux as a fallback operating system in case Windows fails. - -### My earliest days - -Before we had a computer in the home, I was a Windows user. I played games, created documents, and did all the other things kids do with computers. I didn't know what Linux was or what it was used for. The Windows logo was my symbol for a computer. - -When we got our first computer, my father installed Linux ([Ubuntu][5] 8.04) on it. Being the curious kid I was, I booted into the operating system. I was astonished with the interface. It was beautiful. I found it to be very user friendly. For some time, all I did in Ubuntu was play the bundled games. I would do my school work in Windows. - -### The first install - -Four years later, I decided that I would reinstall Windows on our family computer. Without hesitation, I also decided to install Ubuntu. With that, I had fallen in love with Linux (again). Over time, I became more adept with Ubuntu and would casually advocate its use to my friends. When I got my first laptop, I installed it right away. - -### Today - -Today, Linux is my go-to operating system. When I need to do something on a computer, I do it in Linux. For documents and presentations, I use Microsoft Office via [Wine][6]. For my web needs, there's [Chrome and Firefox][7]. For email, there's [Geary][8]. You can do pretty much everything with Linux. - -Most, if not all, of my programming work is done in Linux. The lack of a standard Integrated Development Environment (IDE) like [Visual Studio][9] or [XCode][10] taught me to be flexible and learn more things as a programmer. Now a text editor and a compiler/interpreter are all I need to start coding. I only use an IDE in cases when it's the best tool for accomplishing a task at hand. I find Linux to be more developer-friendly than Windows. To generalize, Linux gives me all the tools I need to develop software. - -Today, I am the co-founder and CTO of a startup called [Creatomiv Studios][11]. I use Linux to develop code for the backend server of our latest project, Basyang. I'm also an amateur photographer, and use [GIMP][12] and [Darktable][13] to edit and manage photos. For communication with my team, I use [Telegram][14]. - -### The beauty of Linux - -Many may see Linux as an operating system only for those who love solving complicated problems and working on the command line. Others may see it as a rubbish operating system lacking the support of many companies. However, I see Linux as a thing of beauty and a tool for creation. I love Linux the way it is and hope to see it continue to grow. - - --------------------------------------------------------------------------------- - -via: https://opensource.com/life/16/3/my-linux-story-sean-ballais - -作者:[Sean Francis N. Ballais][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -[a]: https://opensource.com/users/seanballais -[0]: https://opensource.com/resources/what-is-linux -[1]: http://www.howtogeek.com/189036/android-is-based-on-linux-but-what-does-that-mean/ -[2]: http://www.extremetech.com/extreme/155392-international-space-station-switches-from-windows-to-linux-for-improved-reliability -[3]: https://www.youtube.com/watch?v=JzsLkbwi1LA -[4]: https://opensource.com/tags/my-linux-story -[5]: http://ubuntu.com/ -[6]: https://www.winehq.org/ -[7]: https://www.google.com/chrome/browser/desktop/index.html -[8]: https://wiki.gnome.org/Apps/Geary -[9]: https://www.visualstudio.com/en-us/visual-studio-homepage-vs.aspx -[10]: https://developer.apple.com/xcode/ -[11]: https://www.facebook.com/CreatomivStudios/ -[12]: https://www.gimp.org/ -[13]: http://www.darktable.org/ -[14]: https://telegram.org/ diff --git a/translated/talk/my-open-source-story/20160301 Linux gives me all the tools I need.md b/translated/talk/my-open-source-story/20160301 Linux gives me all the tools I need.md new file mode 100644 index 0000000000..5c746acab8 --- /dev/null +++ b/translated/talk/my-open-source-story/20160301 Linux gives me all the tools I need.md @@ -0,0 +1,56 @@ +Linux 给了我所有所需的工具 +========================================== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/OPENHERE_blue.png?itok=3eqp-7gT) + +[Linux][0] 就在我们身边。它以 Android 的形式[存在我们的手机中][1],它[在国际空间站中被使用][2],它[还是互联网的主要支柱][3],可是迄今为止很多人从未留意过它。对 Linux 的探索是一种很有成就感的尝试。很多人都在 Opensource.com [分享过他们与 Linux 的故事][4]。现在,轮到我了。 + +我依然记得我在 2008 年第一次探索 Linux 的时刻。协助我探索 Linux 的人是我的父亲,Socrates Ballais。他是菲律宾塔克洛班的一名经济学专家,也是一个技术狂热者。他教会了我许多计算机技术方面的知识,但只提倡我将 Linux 作为 Windows 崩溃后的备用操作系统。 + +### 从前的日子 + +在我们在家中购置电脑之前,我曾是一个 Windows 用户。我使用电脑玩游戏,制作文档,做那些小孩子都会用电脑做的事。我不知道什么是 Linux,更不知道它的用处。在那个时候,电脑在我心中的象征就是一个 Windows 的商标。 + +当我们买到第一台电脑时,我爸爸在上面安装了 Linux ([Ubuntu][5] 8.04)。充满了好奇心的我,第一次引导进入了那个操作系统。我被它的用户界面震惊了。它非常漂亮,而且我发现它对用户很友好。在那之后的一段时间,我只会使用 Linux 它内置的几款游戏。我还是会在 Windows 中做我的家庭作业。 + +### 第一次安装 + +4 年后,我决定为家里的电脑重新安装 Windows。我同时毫不犹豫地安装了 Ubuntu。从那次开始,我(再次)爱上了 Linux。随着时间推移,我慢慢适应了 Ubuntu,还会无意地将它推荐给我的朋友。当我拿到我的第一台笔记本电脑时,我立刻在上面安装了它。 + +### 现在 + +如今,Linux 是我的默认操作系统。当我需要使用电脑做一些工作时,我会在 Linux 中完成。至于文档和幻灯片,我会通过 [Wine][6] 来使用微软的 Office 办公软件。我会用 [Chrome 和 Firefox][7] 来满足我的上网需要,会用 [Geary][8] 来收发邮件。你可以使用 Linux 来做很多很多事情。 + +我的大多数——并不是全部——编程工作都会在 Linux 中完成。像 [Visual Studio][9] 和 [XCode][10] 这样的基本集成开发环境 (IDE) 的缺乏教会我这个程序员如何变得灵活、如何去学习更多知识。现在,我只需要一个文本编辑器和一个编译器/解释器就可以开始编程。只有当 IDE 是我完成手头上的任务的最佳最佳工具时,我才会使用它。总而言之,Linux 给了我开发软件所需要的一切工具。 + +现在,我是一个名叫 [Creatomiv Studios][11] 的初创公司的联合创始人和首席技术官。我使用 Linux 来编写我们的最新产品 Basyang 的后端服务器代码。我还是一个业余摄影家,使用 [GIMP][12] 和 [Darktable][13] 来编辑、管理照片。至于团队沟通,我会使用 [Telegram][14]。 + +### Linux 之美 + +很多人认为 Linux 只是为那些喜欢解决复杂问题或者在命令行中工作的人而生的操作系统。还有些人会认为它就是一个缺乏公司支持维护的垃圾。不过,我认为 Linux 是一个完美的操作系统,也是一个为创造而生的绝佳工具。所以我热爱 Linux,同时希望看到它继续成长。 + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/16/3/my-linux-story-sean-ballais + +作者:[Sean Francis N. Ballais][a] +译者:[StdioA](https://github.com/StdioA) +校对:[校对者ID](https://github.com/校对者ID) + +[a]: https://opensource.com/users/seanballais +[0]: https://opensource.com/resources/what-is-linux +[1]: http://www.howtogeek.com/189036/android-is-based-on-linux-but-what-does-that-mean/ +[2]: http://www.extremetech.com/extreme/155392-international-space-station-switches-from-windows-to-linux-for-improved-reliability +[3]: https://www.youtube.com/watch?v=JzsLkbwi1LA +[4]: https://opensource.com/tags/my-linux-story +[5]: http://ubuntu.com/ +[6]: https://www.winehq.org/ +[7]: https://www.google.com/chrome/browser/desktop/index.html +[8]: https://wiki.gnome.org/Apps/Geary +[9]: https://www.visualstudio.com/en-us/visual-studio-homepage-vs.aspx +[10]: https://developer.apple.com/xcode/ +[11]: https://www.facebook.com/CreatomivStudios/ +[12]: https://www.gimp.org/ +[13]: http://www.darktable.org/ +[14]: https://telegram.org/ From e9edeaa63d290fe5cc992e76481f8498475f5701 Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 27 May 2016 21:18:08 -0500 Subject: [PATCH 0814/1469] =?UTF-8?q?20160528-1=20=E9=80=89=E9=A2=98=20(#4?= =?UTF-8?q?003)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 20160527 选题 python , linux , script * 20160528-1 选题 python , linux , script , Tutorial --- ...ramming and Scripting in Linux – Part 1.md | 182 ++++++++++++++++++ 1 file changed, 182 insertions(+) create mode 100644 sources/tech/20160525 Getting Started with Python Programming and Scripting in Linux – Part 1.md diff --git a/sources/tech/20160525 Getting Started with Python Programming and Scripting in Linux – Part 1.md b/sources/tech/20160525 Getting Started with Python Programming and Scripting in Linux – Part 1.md new file mode 100644 index 0000000000..14ec294b04 --- /dev/null +++ b/sources/tech/20160525 Getting Started with Python Programming and Scripting in Linux – Part 1.md @@ -0,0 +1,182 @@ +Getting Started with Python Programming and Scripting in Linux – Part 1 +=============================================================================== + + +It has been said (and often required by recruitment agencies) that system administrators need to be proficient in a scripting language. While most of us may be comfortable using [Bash][1] (or other shell of our choice) to run command-line scripts, a powerful language such as Python can add several benefits. + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Learn-Python-Programming-Scripting-in-Linux.png) +>Learn Python Programming Scripting in Linux + +To begin with, Python allows us to access the tools of the command-line environment and to make use of Object Oriented Programming features (more on this later in this article). + +On top of it, learning Python can boost your career in the fields of [desktop applications][2] and [data science][3]. + +Being so easy to learn, so vastly used, and having a plethora of ready-to-use modules (external files that contain Python statements), no wonder Python is the preferred language to teach programming to first-year computer science students in the United States. + +In this 2-article series we will review the fundamentals of Python in hopes that you will find it useful as a springboard to get you started with programming and as a quick-reference guide afterwards. That said, let’s get started. + +### Python in Linux + +Python versions 2.x and 3.x are usually available in most modern Linux distributions out of the box. You can enter a Python shell by typing `python` or `python3` in your terminal emulator and exit with `quit()`: + +``` +$ which python +$ which python3 +$ python -v +$ python3 -v +$ python +>>> quit() +$ python3 +>>> quit() +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Running-Python-Commands-on-Linux.png) +>Running Python Commands on Linux + +If you want to discard Python 2.x and use 3.x instead when you type python, you can modify the corresponding symbolic links as follows: + +``` +$ sudo rm /usr/bin/python +$ cd /usr/bin +$ ln -s python3.2 python # Choose the Python 3.x binary here +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Remove-Python-2-and-Use-Python-3.png) +>Remove Python 2 and Use Python 3 + +By the way, it is important to note that although versions 2.x are still used, they are not actively maintained. For that reason, you may want to consider switching to 3.x as indicated above. Since there are some syntax differences between 2.x and 3.x, we will focus on the latter in this series. + +Another way you can use Python in Linux is through the IDLE (the Python Integrated Development Environment), a graphical user interface for writing Python code. Before installing it, it is a good idea to perform a search to find out what are the versions available for your distribution: + +``` +# aptitude search idle [Debian and derivatives] +# yum search idle [CentOS and Fedora] +# dnf search idle [Fedora 23+ version] +``` + +Then, you can install it as follows: + +``` +$ sudo aptitude install idle-python3.2 # I'm using Linux Mint 13 +``` + +Once installed, you will see the following screen after launching the IDLE. While it resembles the Python shell, you can do more with the IDLE than with the shell. + +For example, you can: + +1. open external files easily (File → Open). + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Python-Shell.png) +>Python Shell + +2) copy (`Ctrl + C`) and paste (`Ctrl + V`) text, 3) find and replace text, 4) show possible completions (a feature known as Intellisense or Autocompletion in other IDEs), 5) change the font type and size, and much more. + +On top of this, you can use the IDLE to create desktop applications. + +Since we will not be developing a desktop application in this 2-article series, feel free to choose between the IDLE and the Python shell to follow the examples. + +### Basic Operations with Python + +As it is to be expected, you can perform arithmetic operations (feel free to use as many parentheses as needed to perform all the operations you want!) and manipulate text strings very easily with Python. + +You can also assign the results of operations to variables and display them in the screen. A handy feature in Python is concatenation – just supply the values of variables and / or strings in a comma-delimited list (inside parentheses) to the print function and it will return the sentence composed by the items in the sequence: + +``` +>>> a = 5 +>>> b = 8 +>>> x = b / a +>>> x +1.6 +>>> print(b, "divided by", a, "equals", x) +``` + +Note that you can mix variables of different types (numbers, strings, booleans, etc) and once you have assigned a value to a variable you can change the data type without problems later (for this reason Python is said to be a dynamically typed language). + +If you attempt to do this in a statically typed language (such as Java or C#), an error will be thrown. + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Learn-Python-Basic-Operations.png) +>Learn Python Basic Operations + +### A brief comment about Object Oriented Programming + +In Object Oriented Programming (OOP), all entities in a program are represented as objects and thus they can interact with others. As such, they have properties and most of them can perform actions (known as methods). + +For example, let’s suppose we want to create a dog object. Some of the possible properties are color, breed, age, etc, whereas some of the actions a dog can perform are bark(), eat(), sleep(), and many others. + +Methods names, as you can see, are followed by a set of parentheses which may (or may not) contain one (or more) arguments (values that are passed to the method). + +Let’s illustrate these concepts with one of the basic object types in Python: lists. + +### Illustrating methods and properties of objects: Lists in Python + +A list is an ordered group of items, which do not necessarily have to be all of the same data type. To create an empty list named rockBands, use a pair of square brackets as follows: + +To append an item to the end of the list, pass the item to the `append()` method as follows: + +``` +>>> rockBands = [] +>>> rockBands.append("The Beatles") +>>> rockBands.append("Pink Floyd") +>>> rockBands.append("The Rolling Stones") +``` + +To remove an item from the list, we can pass the specific element to the remove() method, or the position of the element (count starts at zero) in the list to pop(). + +In other words, we can use either of the following options to remove “The Beatles” from the list: + +``` +>>> rockBands.remove("The Beatles") +``` + +or + +``` +>>> rockBands.pop(0) +``` + +You can display the list of available methods for an object by pressing Ctrl + Space once you’ve typed the name followed by a dot: + +![](http://www.tecmint.com/wp-content/uploads/2016/05/List-Available-Python-Methods.png) +>List Available Python Methods + +A property of a list object is the number of items it contains. It is actually called length and is invoked by passing the list as argument to the len built-in function (by the way, the print statement, which we exemplified earlier-, is another Python built-in function). + +If you type len followed by an opening parentheses in the IDLE, you will see the default syntax of the function: + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Python-len-Function.png) +>Python len Function + +Now what about the individual items of the list. Do they have methods and properties as well? The answer is yes. For example, you can convert a string item to uppercase and get the number of characters it contains as follows: + +``` +>>> rockBands[0].upper() +'THE BEATLES' +>>> len(rockBands[0]) +11 +``` + +### Summary + +In this article we have provided a brief introduction to Python, its command-line shell, and the IDLE, and demonstrated how to perform arithmetic calculations, how to store values in variables, how to print back those values to the screen (either on its own or as part of a concatenation), and explained through a practical example what are the methods and properties of an object. + +In the next article we will discuss control flow with conditionals and loops. We will also demonstrate how to use what we have learned to write a script to help us in our sysadmin tasks. + +Does Python sound like something you would like to learn more about? Stay tuned for the second part in this series (where among other things we will combine the bounties of Python and command-line tools in a script), and also consider buying our Ultimate Python Coding bundle (more details [here][4]). + +As always, you can count on us if you have any questions about this article. Just send us a message using the contact form below and we will get back to you as soon as possible. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/learn-python-programming-and-scripting-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/category/bash-shell/ +[2]: http://www.tecmint.com/create-gui-applications-in-linux/ +[3]: http://www.datasciencecentral.com/profiles/blogs/the-guide-to-learning-python-for-data-science-2 +[4]: http://www.tecmint.com/learn-python-programming-online-with-ultimate-python-coding/ From 8ec9db5a4c5763c0b598b347b72d6fd760488012 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 28 May 2016 10:19:44 +0800 Subject: [PATCH 0815/1469] PUB:20151215 Linux or Unix Desktop Fun--Text Mode ASCII-art Box and Comment Drawing @zky001 --- ... Mode ASCII-art Box and Comment Drawing.md | 58 +++++++++---------- 1 file changed, 26 insertions(+), 32 deletions(-) rename {translated/tech => published}/20151215 Linux or Unix Desktop Fun--Text Mode ASCII-art Box and Comment Drawing.md (71%) diff --git a/translated/tech/20151215 Linux or Unix Desktop Fun--Text Mode ASCII-art Box and Comment Drawing.md b/published/20151215 Linux or Unix Desktop Fun--Text Mode ASCII-art Box and Comment Drawing.md similarity index 71% rename from translated/tech/20151215 Linux or Unix Desktop Fun--Text Mode ASCII-art Box and Comment Drawing.md rename to published/20151215 Linux or Unix Desktop Fun--Text Mode ASCII-art Box and Comment Drawing.md index ce9c76f324..639f29b851 100644 --- a/translated/tech/20151215 Linux or Unix Desktop Fun--Text Mode ASCII-art Box and Comment Drawing.md +++ b/published/20151215 Linux or Unix Desktop Fun--Text Mode ASCII-art Box and Comment Drawing.md @@ -1,18 +1,14 @@ - -Linux / Unix 桌面娱乐 : -文字模式的带有ASCII艺术的Box与评论绘制 - +Linux/Unix 桌面趣事:文字模式下的 ASCII 艺术与注释绘画 ================================================================================ -Boxes 命令不仅是一个文本过滤器,同时是一个很少人知道的可以为了乐趣或者需要在它的输入文本或者代码周围画各种ASCII艺术画的工具。你可以迅速创建邮件签名,或者使用各种编程语言创建局部评论。这个命令计划被vim文本编辑器使用,但是也可以被支持过滤的文本编辑器使用,同时从命令行作为一个单独的工具使用。 - +boxes 命令不仅是一个文本过滤器,同时是一个很少人知道的有趣工具,它可以在输入的文本或者代码周围框上各种ASCII 艺术画。你可以用它快速创建邮件签名,或者在各种编程语言中留下评论块。这个命令可以在 vim 文本编辑器中使用,但是也可以在各种支持过滤器的文本编辑器中使用,同时也可以在命令行中单独使用。 ### 任务: 安装 boxes ### -使用 [apt-get command][1] 在 Debian / Ubuntu Linux中安装 boxes : +使用 [apt-get 命令][1] 在 Debian / Ubuntu Linux 中安装 boxes: $ sudo apt-get install boxes -输出示例 : +输出示例: Reading package lists... Done Building dependency tree @@ -28,11 +24,11 @@ Boxes 命令不仅是一个文本过滤器,同时是一个很少人知道的 Processing triggers for man-db ... Setting up boxes (1.0.1a-2.3) ... -RHEL / CentOS / Fedora Linux 用户, 使用 [yum command to install boxes][2] (首先 [enable EPEL repo as described here][3]): +RHEL / CentOS / Fedora Linux 用户, 使用 [yum 命令来安装][2] boxes,(请先[启用 EPEL 软件仓库][3]): # yum install boxes -输出示例 : +输出示例: Loaded plugins: rhnplugin Setting up Install Process @@ -64,21 +60,21 @@ RHEL / CentOS / Fedora Linux 用户, 使用 [yum command to install boxes][2] ( boxes.x86_64 0:1.1-8.el6 Complete! -FreeBSD 用户可以按如下来使用 : +FreeBSD 用户可以按如下使用: cd /usr/ports/misc/boxes/ && make install clean -或者,使用 pkg_add 命令来增加包: +或者,使用 pkg_add 命令来增加包: # pkg_add -r boxes -### 在一些给定文本周围画出任何种类的box ### +### 在一些给定文本周围画出任何种类的包围框 ### -输入下列命令 : +输入下列命令: echo "This is a test" | boxes -或者,通过设置要使用的设计的名字来使用 : +或者,指定要使用的图案的名字: echo -e "\n\tVivek Gite\n\tvivek@nixcraft.com\n\twww.cyberciti.biz" | boxes -d dog @@ -86,31 +82,29 @@ FreeBSD 用户可以按如下来使用 : ![Unix / Linux: Boxes Command To Draw Various Designs](http://s0.cyberciti.org/uploads/l/tips/2012/06/unix-linux-boxes-draw-dog-design.png) -Fig.01: Unix / Linux: Boxes 命令来画出各式各样的设计 +*图01: Unix / Linux: Boxes 命令来画出各式各样的图案 * -#### 怎么样输出所有的设计 #### +#### 怎么样输出所有的图案 #### -语法如下: +语法如下: boxes option pipe | boxes options echo "text" | boxes -d foo boxes -l -设计 -d 选项设置要使用的设计的名字 . 语法如下: - +-d 选项用来设置要使用的图案的名字。语法如下: echo "Text" | boxes -d design pipe | boxes -d desig --l 选项列出所有设计 . 它显示在配置文件中的所有的box设计图,同时也显示关于其创作者的信息。 +-l 选项列出所有图案。它显示了在配置文件中的所有的框线设计图,同时也显示关于其创作者的信息。 - boxes -l boxes -l | more boxes -l | less -输出示例: +输出示例: 43 Available Styles in "/etc/boxes/boxes-config": ------------------------------------------------- @@ -146,20 +140,21 @@ Fig.01: Unix / Linux: Boxes 命令来画出各式各样的设计 output truncated .. -### 在使用vi/vim文本编辑器时如何通过boxes过滤文本? ### +### 在使用 vi/vim 文本编辑器时如何通过 boxes 过滤文本? ### -你可以使用vi或vim支持的任何附加命令,在这个例子中, [insert current date and time][4], 输入: +你可以在 vi 或 vim 中使用任何外部命令,比如在这个例子中,[插入当前日期和时间][4],输入: !!date 或者 :r !date -你需要在vim中输入以上命令来读取数据命令的输出,这将在当前行后面加入日期和时分秒: + +你需要在 vim 中输入以上命令来读取 date 命令的输出,这将在当前行后面加入日期和时分秒: Tue Jun 12 00:05:38 IST 2012 -你可以用boxes命令做到同样的. 创建一个作为样本的shell脚本或者如下的一个c程序: +你可以用 boxes 命令做到同样的功能。如下创建一个作为示例的 shell 脚本或者c程序: #!/bin/bash @@ -167,7 +162,7 @@ Fig.01: Unix / Linux: Boxes 命令来画出各式各样的设计 Author: Vivek Gite Last updated on: Tue Jun, 12 2012 -现在输入如下 (将光标移到第二行,也就是以"Purpose: ..."开头的行) +现在输入如下(将光标移到第二行,也就是以“Purpose: ...”开头的行) 3!!boxes @@ -184,11 +179,10 @@ Fig.01: Unix / Linux: Boxes 命令来画出各式各样的设计 注:youtube 视频 -(Video:01: boxes command in action. BTW, this is my first video so go easy on me and let me know what you think.) -另见 +参见 -- boxes man 手册 +- boxes 帮助手册 -------------------------------------------------------------------------------- @@ -196,7 +190,7 @@ via: http://www.cyberciti.biz/tips/unix-linux-draw-any-kind-of-boxes-around-text 作者:Vivek Gite 译者:[zky001](https://github.com/zky001) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 4aa64d3f1006148d11d2f19d5102e0cf8f75b98f Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 28 May 2016 10:30:38 +0800 Subject: [PATCH 0816/1469] =?UTF-8?q?20160528-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit linux , software , best --- ...LINUX PHOTO MANAGEMENT SOFTWARE IN 2016.md | 161 ++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 sources/tech/20160526 BEST LINUX PHOTO MANAGEMENT SOFTWARE IN 2016.md diff --git a/sources/tech/20160526 BEST LINUX PHOTO MANAGEMENT SOFTWARE IN 2016.md b/sources/tech/20160526 BEST LINUX PHOTO MANAGEMENT SOFTWARE IN 2016.md new file mode 100644 index 0000000000..1b1cbc2110 --- /dev/null +++ b/sources/tech/20160526 BEST LINUX PHOTO MANAGEMENT SOFTWARE IN 2016.md @@ -0,0 +1,161 @@ +BEST LINUX PHOTO MANAGEMENT SOFTWARE IN 2016 +============================================= + +![](http://itsfoss.com/wp-content/uploads/2016/05/Best-Linux-Photo-Management-Software.jpg) + +When it comes to Linux applications, at times there are so many choices and alternatives. But sometimes there are only a few options. + +One of our readers had requested to make a list of decent **Linux photo management software**. Something that could replace now defunct Picasa on Linux. + +Turns out, though not many, there are some really good applications for managing photo libraries available out there. Either you have a huge collection of photos or only a few of them, one of these options ought to suit your needs. + +This list of **best photo management applications for Linux** is different from our earlier list of [best photo applications for Linux][1]. That list contained image related applications for various purposes such as editing, painting etc., while this list deals with only photo managing applications. + +So, here we go. I’ve also included the installation commands of these applications for Ubuntu and its derivatives. All you need to do is open a terminal and run those. + +### [GTHUMB](https://wiki.gnome.org/Apps/gthumb) + +![](http://itsfoss.com/wp-content/uploads/2016/05/gThumb-1-1024x540.jpg) +>gThumb Photo Editing + +gThumb is a lightweight photo management application built mainly for GNOME desktop environment. It includes all the basic photo management features as well as some editing and advance operations. Some of the main features of gThumb are: + +- Image Viewer: Supports all the major image format (including GIF) and metadata (EXIF, XMP etc). +- Image Browser: All the basic browsing operations (thumbnails, move, copy, delete etc) and bookmarking support. +- Image Organizer: Organize photos with tags, catalogs and Libraries. Importing photos from Digital Cameras. Web albums (Picasa, Flickr, Facebook etc) integration. +- Image Editor: Basic photo editing operations, filters, format conversion etc. + +And there’s much more, check the official [gThumb feature][2] list. If you use GNOME or GNOME based desktop environments (like MATE) you should definitely try this one out. + +#### GTHUMB INSTALLATION + +``` +sudo apt-get install gthumb +``` + + +### [DIGIKAM][3] + +![](http://itsfoss.com/wp-content/uploads/2016/05/digiKam-1-1024x540.png) +>digiKam + +digiKam is mainly developed for KDE, but works just as well on other desktop environments. It comes with a lot of features with an interface that works nicely. The main features of digiKam includes: + +- Photo Organizer: Albums, sub-albums, tags, comments, metadata, sorting support. +- Photo Importer: Import support from Digital Cameras, USB devices, Web Albums (including Picasa & Facebook) and some other features. +- Photo Exporter: Export support for various online platforms and format conversion. +- Photo Editor: Wide range of photo editing operations. + +digiKam is certainly one of the best Linux photo management software, if not best. + +#### DIGIKAM INSTALLATION + +``` +sudo apt-get install digikam +``` + +### [SHOTWELL][4] + +![](http://itsfoss.com/wp-content/uploads/2016/05/Shotwell-1-1024x540.png) +>Shotwell + +Shotwell photo manager is also for GNOME desktop environment. Shotwell, while isn’t as feature-rich as gThumb, does what it promises. The main features of Shotwell are: + +- Import photos from Disks or Digital Cameras. +- Event, tags and folder based organization. +- Basic photo editing features and format conversion. +- Supports uploading to web services (Facebook, Flickr, Tumblr etc). + +If you want something simple, you can check this one out. + +#### SHOTWELL INSTALLATION + +``` +sudo apt-get install shotwell +``` + +### [KPHOTOALBUM][5] + +![](http://itsfoss.com/wp-content/uploads/2016/05/KPhotoAlbum-1-1024x540.png) +>KPhotoAlbum + +KPhotoAlbum is a photo management application also intended to be used on [KDE desktop environment][6]. What makes KPhotoAlbum unique is its categorization process and time-based browsing. You can categorize photos by People, Places, Events etc. And for time-based browsing, it has a dedicated timeline or Date Bar at the bottom of the user interface. + +KPhotoAlbum comes with a wide range of features for photo management and editing. Some of the main features include: + +- Advance photo organization (with categories, sub-categories, tags, metadata, annotation support and much more). +- Wide range of import and export options (including almost every major photo sharing platforms). +- Various editing options (includes batch operations). + +All these advanced organization features do have their downsides – user has to do most of them manually. But if you’re a KDE lover, this can be a good pick. You can use KPhotoAlbum on other desktop environments too, but it delivers the optimal experience on KDE. + +#### KPHOTOALBUM INSTALLATION + +``` +sudo apt-get install kphotoalbum +``` + +### [DARKTABLE][7] + +![](http://itsfoss.com/wp-content/uploads/2016/05/darktable-1-1024x540.png) +>Darktable + +Darktable is more of a photo editing application than an organizer. Darktable stands out for its own user interface regardless of the desktop environment you might be using, and of course for its editing capabilities. The basic features include: + +- Basic photo organization. +- Advance and feature-rich photo editing. +- Export support for Picasa & Flickr and format conversion. + +If you’re into photo editing and retouching, Darktable is a nice choice. + +> Reading Suggestion: [How to install Darktable 2.0 in Ubuntu via PPA][8] + +#### DARKTABLE INSTALLATION + +``` +sudo add-apt-repository ppa:pmjdebruijn/darktable-release +sudo apt-get update +sudo apt-get install darktable +``` + +### OTHERS + +If you want a simple application for pulling images from your portable devices (cameras, phones, portable drives etc) and storing them on your Hard Disk, using [Rapid Photo Downloader][9] is a no-brainer. It is an incredible application for importing and backing up photos from portable devices. The installation and configuration process is quite easy and simple. + +For installing Rapid Photo Downloader on Ubuntu, fire up a terminal and run this command: + +``` +sudo apt-get install rapid-photo-downloader +``` + +If you are still interested in trying a few more options, here you go: + +- [GNOME Photos][10] (Photo viewer for GNOME desktop environment) +- [Gwenview][11] (Photo viewer for KDE desktop environment) +- [Picty][12] (Open-source photo collection manager) + +So, are you using, or plan to use, any one of these applications? Which, according to you is the best photo management application for Ubuntu or any other Linux? Do you have any favorites to term as Linux photo manager? Do share your views. + + +---------- +via: http://itsfoss.com/linux-photo-management-software/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 + +作者:[Munif Tanjim][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/munif/ +[1]: http://itsfoss.com/image-applications-ubuntu-linux/ +[2]: https://wiki.gnome.org/Apps/gthumb/features +[3]: https://www.digikam.org/ +[4]: https://wiki.gnome.org/Apps/Shotwell +[5]: https://www.kphotoalbum.org/ +[6]: https://www.kde.org/ +[7]: http://www.darktable.org/ +[8]: http://itsfoss.com/darktable-20-released-installation-ppa/ +[9]: http://www.damonlynch.net/rapid/index.html +[10]: https://wiki.gnome.org/Apps/Photos +[11]: https://userbase.kde.org/Gwenview +[12]: https://github.com/spillz/picty From 98d71b5279b0a90be7792f0c380ee0e0a0a68a94 Mon Sep 17 00:00:00 2001 From: alim0x Date: Sat, 28 May 2016 11:10:29 +0800 Subject: [PATCH 0817/1469] [translating]20160520 ORB - NEW GENERATION OF LINUX APPS ARE HERE --- .../20160520 ORB - NEW GENERATION OF LINUX APPS ARE HERE.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160520 ORB - NEW GENERATION OF LINUX APPS ARE HERE.md b/sources/tech/20160520 ORB - NEW GENERATION OF LINUX APPS ARE HERE.md index 8ea5e6b803..1402151642 100644 --- a/sources/tech/20160520 ORB - NEW GENERATION OF LINUX APPS ARE HERE.md +++ b/sources/tech/20160520 ORB - NEW GENERATION OF LINUX APPS ARE HERE.md @@ -1,3 +1,5 @@ +alim0x translating + ORB: NEW GENERATION OF LINUX APPS ARE HERE ============================================= From 1860a20537070ea1a219468ef5bf147bf01e59d5 Mon Sep 17 00:00:00 2001 From: David Dai Date: Sat, 28 May 2016 11:22:42 +0800 Subject: [PATCH 0818/1469] =?UTF-8?q?Translating=2020160525=20Getting=20St?= =?UTF-8?q?arted=20with=20Python=20Programming=20and=20Scripting=20in=20Li?= =?UTF-8?q?nux=20=E2=80=93=20Part=201=20(#4005)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...d with Python Programming and Scripting in Linux – Part 1.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160525 Getting Started with Python Programming and Scripting in Linux – Part 1.md b/sources/tech/20160525 Getting Started with Python Programming and Scripting in Linux – Part 1.md index 14ec294b04..dac5b0385f 100644 --- a/sources/tech/20160525 Getting Started with Python Programming and Scripting in Linux – Part 1.md +++ b/sources/tech/20160525 Getting Started with Python Programming and Scripting in Linux – Part 1.md @@ -1,3 +1,5 @@ +StdioA translating + Getting Started with Python Programming and Scripting in Linux – Part 1 =============================================================================== From 4c2d37795549ceab632f78794c4c293de557a676 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 28 May 2016 12:02:58 +0800 Subject: [PATCH 0819/1469] translating --- .../20160514 NODEOS : LINUX DISTRIBUTION FOR NODE LOVERS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160514 NODEOS : LINUX DISTRIBUTION FOR NODE LOVERS.md b/sources/tech/20160514 NODEOS : LINUX DISTRIBUTION FOR NODE LOVERS.md index 55b7690423..f1b70daa36 100644 --- a/sources/tech/20160514 NODEOS : LINUX DISTRIBUTION FOR NODE LOVERS.md +++ b/sources/tech/20160514 NODEOS : LINUX DISTRIBUTION FOR NODE LOVERS.md @@ -1,3 +1,5 @@ +translating----geekpi + NODEOS : LINUX DISTRIBUTION FOR NODE LOVERS ================================================ From cc26c6aea732c7fd7aa42d880311ea0de932131a Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 28 May 2016 13:55:11 +0800 Subject: [PATCH 0820/1469] translated --- ...OS : LINUX DISTRIBUTION FOR NODE LOVERS.md | 55 ------------------- ...OS : LINUX DISTRIBUTION FOR NODE LOVERS.md | 53 ++++++++++++++++++ 2 files changed, 53 insertions(+), 55 deletions(-) delete mode 100644 sources/tech/20160514 NODEOS : LINUX DISTRIBUTION FOR NODE LOVERS.md create mode 100644 translated/tech/20160514 NODEOS : LINUX DISTRIBUTION FOR NODE LOVERS.md diff --git a/sources/tech/20160514 NODEOS : LINUX DISTRIBUTION FOR NODE LOVERS.md b/sources/tech/20160514 NODEOS : LINUX DISTRIBUTION FOR NODE LOVERS.md deleted file mode 100644 index f1b70daa36..0000000000 --- a/sources/tech/20160514 NODEOS : LINUX DISTRIBUTION FOR NODE LOVERS.md +++ /dev/null @@ -1,55 +0,0 @@ -translating----geekpi - -NODEOS : LINUX DISTRIBUTION FOR NODE LOVERS -================================================ - -![](http://itsfoss.com/wp-content/uploads/2016/05/node-os-linux.jpg) - -[NodeOS][1], the operating system based on [Node.js][2], is now heading towards its version 1.0 following the release of its first [Release Candidate][3] last year. - -If this is the first time you’re hearing about it, NodeOS is the first ever operating system powered by Node.js & [npm][4] and built on top of the [Linux][5] Kernel. [Jacob Groundwater][6] introduced this project in mid-2013. The primary technologies used in building the system are: - -- **Linux Kernel**: The entire OS is built off the Linux Kernel. -- **Node.js runtime**: Node is used as the primary runtime. -- **npm Packages**: npm is used for package management. - -NodeOS source is hosted on [Github Repository][7]. So, anybody interested can easily contribute and report bugs. Users can build from source or use the [pre-built images][8] available. The build process and quick start guide can be found at project repository. - -The idea behind NodeOS is to provide just enough to let npm run on it and then the rest of the functionalities will come from npm packages. So, the users have access the vast collection of about 250,000 packages and that number is continuously increasing every day. And everything being open-source, it’s always easy to patch bugs and add more packages to npm according to your need. - -NodeOS core development is separated into layers and the general structure includes: - -- **barebones** – custom Linux kernel along with an initramfs that boots to a Node.js REPL -- **initramfs** – Initram filesystem to mount the users partition & boot the system -- **rootfs** – Read-only partition image hosting the Linux kernel & initramfs files -- **usersfs** – multi-user filesystem (as traditional OSes) - -NodeOS aims to be able to run on virtually any platforms, including – **Real Hardware** (personal computers or SOCs), **Cloud platforms, Virtual machines, PaaS providers, Containers** (Docker & Vagga ) etc. And so far, it seems that they’re doing pretty good. On March 3, [Jesús Leganés Combarro][9], NodeOS member on GitHub, [announced][10] that: - ->**NodeOS is not a toy OS anymore**, and it’s very capable to be used on production environments for real use cases from now on. - -So, if you are a die-hard fan of Node.js and/or have a knack for trying new things, this might be the thing for you to try. And in related post, you should read about these niche [Linux distributions for specific usage][11]. - - --------------------------------------------------------------------------------- - -via: http://itsfoss.com/nodeos-operating-system/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 - -作者:[Munif Tanjim][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/munif/ -[1]: http://node-os.com/ -[2]: https://nodejs.org/en/ -[3]: https://github.com/NodeOS/NodeOS/releases/tag/v1.0-RC1 -[4]: https://www.npmjs.com/ -[5]: http://itsfoss.com/tag/linux/ -[6]: https://github.com/groundwater -[7]: https://github.com/nodeos/nodeos -[8]: https://github.com/NodeOS/NodeOS/releases -[9]: https://github.com/piranna -[10]: https://github.com/NodeOS/NodeOS/issues/216 -[11]: http://itsfoss.com/weird-ubuntu-based-linux-distributions/ diff --git a/translated/tech/20160514 NODEOS : LINUX DISTRIBUTION FOR NODE LOVERS.md b/translated/tech/20160514 NODEOS : LINUX DISTRIBUTION FOR NODE LOVERS.md new file mode 100644 index 0000000000..d189753fd5 --- /dev/null +++ b/translated/tech/20160514 NODEOS : LINUX DISTRIBUTION FOR NODE LOVERS.md @@ -0,0 +1,53 @@ +NODEOS: NODE爱好者的Linux发行版 +================================================ + +![](http://itsfoss.com/wp-content/uploads/2016/05/node-os-linux.jpg) + +[NodeOS][1]是一个基于[Node.js][2]的操作系统,自去年的首个[发布候选版][3]之后正朝着它的1.0版本进发。 + +如果你是第一次听到它,NodeOS是首个在[Linux][5]内核之上由Node.js和[npm][4]驱动的操作系统。[Jacob Groundwater][6]仔2013年中介绍了这个项目。操作系统中用到的主要技术是: + +- **Linux 内核**: 这个系统内置了Linux内核 +- **Node.js 运行时**: Node作为主要的运行时 +- **npm 包管理**: npm作为包管理 + +NodeOS源码托管在[Github][7]上,因此,任何感兴趣的人都可以轻松贡献或者报告bug。用户可以从源码构建或者使用[预编译镜像][8]。构建过程及使用可以在项目仓库中找到。 + +NodeOS背后的思想是提供足够npm运行的环境,剩余的功能就可以来自npm包管理。因此,用户可以使用大量的大约250,000的包,并且这个数目每天都还在增长。并且所有的都是开源的,你可以根据你的需要很容易地打补丁或者增加更多的包。 + +NodeOS核心开发被分离成了不同的层,基本的结构包含: + +- **barebones** – 带有可以启动到Node.js REPL的initramfs的自定义内核 +- **initramfs** – =用于挂载用户分区以及启动系统的initram文件系统 +- **rootfs** – 托管linux内核及initramfs文件的只读分区 +- **usersfs** – 多用户文件系统(如传统系统一样) + +NodeOS的目标是可以仔任何平台上运行,包括- **真实的硬件(用户计算机或者SoC)**、**云平台、虚拟机、PaaS提供商,容器**(Docker和Vagga)等等。如今看来,它做得似乎不错。在3.3号,NodeOS的成员[Jesús Leganés Combarro][9]在Github上[宣布][10]: + +>**NodeOS不再是一个玩具系统了**,它现在开始可以用在有实际需求的生产环境中了。 + +因此,如果你是Node.js的死忠或者乐于尝试新鲜事物,这或许值得你一试。在相关的文章中,你应该了解这些[Linux发行版的具体用法][11] + + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/nodeos-operating-system/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 + +作者:[Munif Tanjim][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/munif/ +[1]: http://node-os.com/ +[2]: https://nodejs.org/en/ +[3]: https://github.com/NodeOS/NodeOS/releases/tag/v1.0-RC1 +[4]: https://www.npmjs.com/ +[5]: http://itsfoss.com/tag/linux/ +[6]: https://github.com/groundwater +[7]: https://github.com/nodeos/nodeos +[8]: https://github.com/NodeOS/NodeOS/releases +[9]: https://github.com/piranna +[10]: https://github.com/NodeOS/NodeOS/issues/216 +[11]: http://itsfoss.com/weird-ubuntu-based-linux-distributions/ From a8ac5c747250faf9e83eb6c10247aa47f090facc Mon Sep 17 00:00:00 2001 From: Stdio A Date: Sat, 28 May 2016 15:51:31 +0800 Subject: [PATCH 0821/1469] Translated 20160525 Getting Started with Python Programming and Scripting in Linux - Part 1 --- ...ramming and Scripting in Linux – Part 1.md | 184 ----------------- ...ramming and Scripting in Linux – Part 1.md | 187 ++++++++++++++++++ 2 files changed, 187 insertions(+), 184 deletions(-) delete mode 100644 sources/tech/20160525 Getting Started with Python Programming and Scripting in Linux – Part 1.md create mode 100644 translated/tech/20160525 Getting Started with Python Programming and Scripting in Linux – Part 1.md diff --git a/sources/tech/20160525 Getting Started with Python Programming and Scripting in Linux – Part 1.md b/sources/tech/20160525 Getting Started with Python Programming and Scripting in Linux – Part 1.md deleted file mode 100644 index dac5b0385f..0000000000 --- a/sources/tech/20160525 Getting Started with Python Programming and Scripting in Linux – Part 1.md +++ /dev/null @@ -1,184 +0,0 @@ -StdioA translating - -Getting Started with Python Programming and Scripting in Linux – Part 1 -=============================================================================== - - -It has been said (and often required by recruitment agencies) that system administrators need to be proficient in a scripting language. While most of us may be comfortable using [Bash][1] (or other shell of our choice) to run command-line scripts, a powerful language such as Python can add several benefits. - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Learn-Python-Programming-Scripting-in-Linux.png) ->Learn Python Programming Scripting in Linux - -To begin with, Python allows us to access the tools of the command-line environment and to make use of Object Oriented Programming features (more on this later in this article). - -On top of it, learning Python can boost your career in the fields of [desktop applications][2] and [data science][3]. - -Being so easy to learn, so vastly used, and having a plethora of ready-to-use modules (external files that contain Python statements), no wonder Python is the preferred language to teach programming to first-year computer science students in the United States. - -In this 2-article series we will review the fundamentals of Python in hopes that you will find it useful as a springboard to get you started with programming and as a quick-reference guide afterwards. That said, let’s get started. - -### Python in Linux - -Python versions 2.x and 3.x are usually available in most modern Linux distributions out of the box. You can enter a Python shell by typing `python` or `python3` in your terminal emulator and exit with `quit()`: - -``` -$ which python -$ which python3 -$ python -v -$ python3 -v -$ python ->>> quit() -$ python3 ->>> quit() -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Running-Python-Commands-on-Linux.png) ->Running Python Commands on Linux - -If you want to discard Python 2.x and use 3.x instead when you type python, you can modify the corresponding symbolic links as follows: - -``` -$ sudo rm /usr/bin/python -$ cd /usr/bin -$ ln -s python3.2 python # Choose the Python 3.x binary here -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Remove-Python-2-and-Use-Python-3.png) ->Remove Python 2 and Use Python 3 - -By the way, it is important to note that although versions 2.x are still used, they are not actively maintained. For that reason, you may want to consider switching to 3.x as indicated above. Since there are some syntax differences between 2.x and 3.x, we will focus on the latter in this series. - -Another way you can use Python in Linux is through the IDLE (the Python Integrated Development Environment), a graphical user interface for writing Python code. Before installing it, it is a good idea to perform a search to find out what are the versions available for your distribution: - -``` -# aptitude search idle [Debian and derivatives] -# yum search idle [CentOS and Fedora] -# dnf search idle [Fedora 23+ version] -``` - -Then, you can install it as follows: - -``` -$ sudo aptitude install idle-python3.2 # I'm using Linux Mint 13 -``` - -Once installed, you will see the following screen after launching the IDLE. While it resembles the Python shell, you can do more with the IDLE than with the shell. - -For example, you can: - -1. open external files easily (File → Open). - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Python-Shell.png) ->Python Shell - -2) copy (`Ctrl + C`) and paste (`Ctrl + V`) text, 3) find and replace text, 4) show possible completions (a feature known as Intellisense or Autocompletion in other IDEs), 5) change the font type and size, and much more. - -On top of this, you can use the IDLE to create desktop applications. - -Since we will not be developing a desktop application in this 2-article series, feel free to choose between the IDLE and the Python shell to follow the examples. - -### Basic Operations with Python - -As it is to be expected, you can perform arithmetic operations (feel free to use as many parentheses as needed to perform all the operations you want!) and manipulate text strings very easily with Python. - -You can also assign the results of operations to variables and display them in the screen. A handy feature in Python is concatenation – just supply the values of variables and / or strings in a comma-delimited list (inside parentheses) to the print function and it will return the sentence composed by the items in the sequence: - -``` ->>> a = 5 ->>> b = 8 ->>> x = b / a ->>> x -1.6 ->>> print(b, "divided by", a, "equals", x) -``` - -Note that you can mix variables of different types (numbers, strings, booleans, etc) and once you have assigned a value to a variable you can change the data type without problems later (for this reason Python is said to be a dynamically typed language). - -If you attempt to do this in a statically typed language (such as Java or C#), an error will be thrown. - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Learn-Python-Basic-Operations.png) ->Learn Python Basic Operations - -### A brief comment about Object Oriented Programming - -In Object Oriented Programming (OOP), all entities in a program are represented as objects and thus they can interact with others. As such, they have properties and most of them can perform actions (known as methods). - -For example, let’s suppose we want to create a dog object. Some of the possible properties are color, breed, age, etc, whereas some of the actions a dog can perform are bark(), eat(), sleep(), and many others. - -Methods names, as you can see, are followed by a set of parentheses which may (or may not) contain one (or more) arguments (values that are passed to the method). - -Let’s illustrate these concepts with one of the basic object types in Python: lists. - -### Illustrating methods and properties of objects: Lists in Python - -A list is an ordered group of items, which do not necessarily have to be all of the same data type. To create an empty list named rockBands, use a pair of square brackets as follows: - -To append an item to the end of the list, pass the item to the `append()` method as follows: - -``` ->>> rockBands = [] ->>> rockBands.append("The Beatles") ->>> rockBands.append("Pink Floyd") ->>> rockBands.append("The Rolling Stones") -``` - -To remove an item from the list, we can pass the specific element to the remove() method, or the position of the element (count starts at zero) in the list to pop(). - -In other words, we can use either of the following options to remove “The Beatles” from the list: - -``` ->>> rockBands.remove("The Beatles") -``` - -or - -``` ->>> rockBands.pop(0) -``` - -You can display the list of available methods for an object by pressing Ctrl + Space once you’ve typed the name followed by a dot: - -![](http://www.tecmint.com/wp-content/uploads/2016/05/List-Available-Python-Methods.png) ->List Available Python Methods - -A property of a list object is the number of items it contains. It is actually called length and is invoked by passing the list as argument to the len built-in function (by the way, the print statement, which we exemplified earlier-, is another Python built-in function). - -If you type len followed by an opening parentheses in the IDLE, you will see the default syntax of the function: - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Python-len-Function.png) ->Python len Function - -Now what about the individual items of the list. Do they have methods and properties as well? The answer is yes. For example, you can convert a string item to uppercase and get the number of characters it contains as follows: - -``` ->>> rockBands[0].upper() -'THE BEATLES' ->>> len(rockBands[0]) -11 -``` - -### Summary - -In this article we have provided a brief introduction to Python, its command-line shell, and the IDLE, and demonstrated how to perform arithmetic calculations, how to store values in variables, how to print back those values to the screen (either on its own or as part of a concatenation), and explained through a practical example what are the methods and properties of an object. - -In the next article we will discuss control flow with conditionals and loops. We will also demonstrate how to use what we have learned to write a script to help us in our sysadmin tasks. - -Does Python sound like something you would like to learn more about? Stay tuned for the second part in this series (where among other things we will combine the bounties of Python and command-line tools in a script), and also consider buying our Ultimate Python Coding bundle (more details [here][4]). - -As always, you can count on us if you have any questions about this article. Just send us a message using the contact form below and we will get back to you as soon as possible. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/learn-python-programming-and-scripting-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/category/bash-shell/ -[2]: http://www.tecmint.com/create-gui-applications-in-linux/ -[3]: http://www.datasciencecentral.com/profiles/blogs/the-guide-to-learning-python-for-data-science-2 -[4]: http://www.tecmint.com/learn-python-programming-online-with-ultimate-python-coding/ diff --git a/translated/tech/20160525 Getting Started with Python Programming and Scripting in Linux – Part 1.md b/translated/tech/20160525 Getting Started with Python Programming and Scripting in Linux – Part 1.md new file mode 100644 index 0000000000..24df8ca66b --- /dev/null +++ b/translated/tech/20160525 Getting Started with Python Programming and Scripting in Linux – Part 1.md @@ -0,0 +1,187 @@ +Linux 平台下 Python 脚本编程入门 – Part 1 +=============================================================================== + + +众所周知,系统管理员需要精通一门脚本语言,而且招聘机构列出的职位需求上也会这么写。大多数人会认为 Bash (或者其他的 shell 语言)用起来很方便,但一些强大的语言(比如 Python)会给你带来一些其它的好处。 + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Learn-Python-Programming-Scripting-in-Linux.png) +> 在 Linux 中学习 Python 脚本编程 + +首先,我们会使用 Python 的命令行工具,还会接触到 Python 的面向对象特性(这篇文章的后半部分会谈到它)。 + +最后,学习 Python + 可以助力于你在[桌面应用开发][2]及[数据科学领域][3]的事业。 + +容易上手,广泛使用,拥有海量“开箱即用”的模块(它是一组包含 Python 声明的外部文件),Python 理所当然地成为了美国计算机专业大学生在一年级时所上的程序设计课所用语言的不二之选。 + +在这个由两篇文章构成的系列中,我们将回顾 Python +的基础部分,希望初学编程的你能够将这篇实用的文章作为一个编程入门的跳板,和日后使用 Python 时的一篇快速指引。 + +### Linux 中的 Python + +Python 2.x 和 3.x 通常已经内置在现代 Linux 发行版中,你可以立刻使用它。你可以终端模拟器中输入 `python` 或 `python3` 来进入 Python shell, 并输入 `quit()` 退出。 + +``` +$ which python +$ which python3 +$ python -v +$ python3 -v +$ python +>>> quit() +$ python3 +>>> quit() +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Running-Python-Commands-on-Linux.png) +> 在 Linux 中运行 Python 命令 + +如果你希望在键入 `python` 时使用 Python 3.x 而不是 2.x,你可以像下面一样更改对应的符号链接: + +``` +$ sudo rm /usr/bin/python +$ cd /usr/bin +$ ln -s python3.2 python # Choose the Python 3.x binary here +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Remove-Python-2-and-Use-Python-3.png) +> 删除 Python 2,使用 Python 3 + +顺便一提,有一点需要注意:尽管 Python 2.x 仍旧被使用,但它并不会被积极维护。因此,你可能要考虑像上面指示的那样来切换到 3.x。2.x 和 3.x 的语法有一些不同,我们会在这个系列文章中使用后者。 + +另一个在 Linux 中使用 Python 的方法是通过 IDLE (the Python Integrated Development Environment),一个为编写 Python 代码而生的图形用户界面。在安装它之前,你最好查看一下适用于你的 Linux 发行版的 IDLE 可用版本。 + +``` +# aptitude search idle [Debian 及其衍生发行版] +# yum search idle [CentOS 和 Fedora] +# dnf search idle [Fedora 23+ 版本] +``` + +然后,你可以像下面一样安装它: + +``` +$ sudo aptitude install idle-python3.2 # I'm using Linux Mint 13 +``` + +安装成功后,你会看到 IDLE 的运行画面。它很像 Python shell,但是你可以用它做更多 Python shell 做不了的事。 + +比如,你可以: + +1. 轻松打开外部文件 (File → Open); + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Python-Shell.png) +> Python Shell + +2. 复制 (`Ctrl + C`) 和粘贴 (`Ctrl + V`) 文本; +3. 查找和替换文本; +4. 显示可能的代码补全(一个在其他 IDE 里可能叫做 Intellisense 或者 Autocompletion 的功能); +5. 更改字体和字号,等等。 + +最厉害的是,你可以用 IDLE 创建桌面工程。 + +我们在这两篇文章中不会开发桌面应用,所以你可以根据喜好来选择 IDLE 或 Python shell 去运行下面的例子。 + +### Python 中的基本运算 + +就像你预料的那样,你能够直接进行算术操作(你可以在所有操作中使用足够多的括号!),还可以轻松地使用 Python 拼接字符串。 + +你还可以将运算结果赋给一个变量,然后在屏幕上显示它。Python 有一个叫做输出 (concatenation) 的实用功能——把一串变量和/或字符串用逗号分隔,然后在 print 函数中插入,它会返回一个由你刚才提供的变量依序构成的句子: + +``` +>>> a = 5 +>>> b = 8 +>>> x = b / a +>>> x +1.6 +>>> print(b, "divided by", a, "equals", x) +``` + +注意,你可以将不同类型的变量(数字,字符串,布尔符号等等)混合在一起。当你将一个值赋给一个变量后,你可以随后更改它的类型,不会有任何问题(因此,Python 被称为动态类型语言)。 + +如果你尝试在静态类型语言中(如 Java 或 C#)做这件事,它将抛出一个错误。 + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Learn-Python-Basic-Operations.png) +> 学习 Python 的基本操作 + +### 面向对象编程的简单介绍 + +在面向对象编程(OOP)中,程序中的所有实体都会由对象的形式呈现,所以它们可以与其他对象交互。因此,对象拥有属性,而且大多数对象可以完成动作(这被称为对象的方法)。 + +举个例子:我们来想象一下,创建一个对象“狗”。它可能拥有的一些属性有`颜色`、`品种`、`年龄`等等,而它可以完成的动作有 `叫()`、`吃()`、`睡觉()`,诸如此类。 + +你可以看到,方法名后面会跟着一对括号,他们当中可能会包含一个或多个参数(向方法中传递的值),也有可能什么都不包含。 + +我们用 Python 的基本对象类型之一——列表来解释这些概念。 + +### 解释对象的属性和方法:Python 中的列表 + +列表是条目的有序组合,而这些条目所属的数据类型并不需要相同。我们像下面一样来使用一对方括号,来创建一个名叫 `rockBands` 的列表: + +你可以向 `rockBands` 的 `append()` 方法传递条目,来将它添加到列表的尾部,就像下面这样: + +``` +>>> rockBands = [] +>>> rockBands.append("The Beatles") +>>> rockBands.append("Pink Floyd") +>>> rockBands.append("The Rolling Stones") +``` + +为了从列表中移除元素,我们可以向 `remove()` 方法传递特定元素,或向 `pop()` 中传递列表中待删除元素的位置(从 0 开始计数)。 + +换句话说,我们可以用下面这种方法来从列表中删除 “The Beatles”: + +``` +>>> rockBands.remove("The Beatles") +``` + +或者用这种方法: + +``` +>>> rockBands.pop(0) +``` + +如果你输入了对象的名字,然后在后面输入了一个点,你可以按 Ctrl + 空格来显示这个对象的可用方法列表。 + +![](http://www.tecmint.com/wp-content/uploads/2016/05/List-Available-Python-Methods.png) +> 列出可用的 Python 方法 + +列表中含有的元素个数是它的一个属性。它通常被叫做“长度”,你可以通过向内建函数 `len` 传递一个列表作为它的参数来显示该列表的长度(顺便一提,之前的例子中提到的 print 语句,是 Python 的另一个内建函数)。 + +如果你在 IDLE 中输入 `len`,然后跟上一个不闭合的括号,你会看到这个函数的默认语法: + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Python-len-Function.png) +> Python 的 len 函数 + +现在我们来看看列表中的特定条目。他们也有属性和方法吗?答案是肯定的。比如,你可以将一个字符串条目装换为大写形式,并获取这个字符串所包含的字符数量。像下面这样做: + +``` +>>> rockBands[0].upper() +'THE BEATLES' +>>> len(rockBands[0]) +11 +``` + +### 总结 + +在这篇文章中,我们简要介绍了 Python,它的命令行 shell,IDLE,展示了如何执行算术运算,如何在变量中存储数据,如何使用 `print` 函数在屏幕上重新显示那些数据(无论是它们本身还是它们的一部分),还通过一个实际的例子解释了对象的属性和方法。 + +下一篇文章中,我们会展示如何使用条件语句和循环语句来实现流程控制。我们也会解释如何编写一个脚本来帮助我们完成系统管理任务。 + +你是不是想继续学习一些有关 Python 的知识呢?敬请期待本系列的第二部分(我们会将 Python 的慷慨、脚本中的命令行工具与其他部分结合在一起),你还可以考虑购买我们的《终极 Python 编程》系列教程([这里][4]有详细信息)。 + +像往常一样,如果你对这篇文章有什么问题,可以向我们寻求帮助。你可以使用下面的联系表单向我们发送留言,我们会尽快回复你。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/learn-python-programming-and-scripting-in-linux/ + +作者:[Gabriel Cánepa][a] +译者:[StdioA](https://github.com/StdioA) +校对:[校对者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/category/bash-shell/ +[2]: http://www.tecmint.com/create-gui-applications-in-linux/ +[3]: http://www.datasciencecentral.com/profiles/blogs/the-guide-to-learning-python-for-data-science-2 +[4]: http://www.tecmint.com/learn-python-programming-online-with-ultimate-python-coding/ From 1a82c20dc69fabd1cb8dc5081b2252d47079c217 Mon Sep 17 00:00:00 2001 From: SarishiNoHara Date: Sat, 28 May 2016 16:15:50 +0200 Subject: [PATCH 0822/1469] BEST LINUX PHOTO MANAGEMENT SOFTWARE IN 2016.md (#4010) translating... --- .../20160526 BEST LINUX PHOTO MANAGEMENT SOFTWARE IN 2016.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160526 BEST LINUX PHOTO MANAGEMENT SOFTWARE IN 2016.md b/sources/tech/20160526 BEST LINUX PHOTO MANAGEMENT SOFTWARE IN 2016.md index 1b1cbc2110..9e3e630282 100644 --- a/sources/tech/20160526 BEST LINUX PHOTO MANAGEMENT SOFTWARE IN 2016.md +++ b/sources/tech/20160526 BEST LINUX PHOTO MANAGEMENT SOFTWARE IN 2016.md @@ -1,3 +1,5 @@ +translating by sarishinohara + BEST LINUX PHOTO MANAGEMENT SOFTWARE IN 2016 ============================================= From ed2663977a6de104162cc9631628452a1b8e26a7 Mon Sep 17 00:00:00 2001 From: alim0x Date: Sat, 28 May 2016 23:11:39 +0800 Subject: [PATCH 0823/1469] [translated]20160520 ORB - NEW GENERATION OF LINUX APPS ARE HERE --- ...- NEW GENERATION OF LINUX APPS ARE HERE.md | 144 ------------------ ...- NEW GENERATION OF LINUX APPS ARE HERE.md | 142 +++++++++++++++++ 2 files changed, 142 insertions(+), 144 deletions(-) delete mode 100644 sources/tech/20160520 ORB - NEW GENERATION OF LINUX APPS ARE HERE.md create mode 100644 translated/tech/20160520 ORB - NEW GENERATION OF LINUX APPS ARE HERE.md diff --git a/sources/tech/20160520 ORB - NEW GENERATION OF LINUX APPS ARE HERE.md b/sources/tech/20160520 ORB - NEW GENERATION OF LINUX APPS ARE HERE.md deleted file mode 100644 index 1402151642..0000000000 --- a/sources/tech/20160520 ORB - NEW GENERATION OF LINUX APPS ARE HERE.md +++ /dev/null @@ -1,144 +0,0 @@ -alim0x translating - -ORB: NEW GENERATION OF LINUX APPS ARE HERE -============================================= - -![](http://itsfoss.com/wp-content/uploads/2016/05/ORB-Apps.jpeg) - -We have talked about [installing applications offline in Ubuntu][1] before. And we are going to talk about it once again. - -[Orbital Apps][2] has brought us a new type of application package, **ORB**, with portable applications, interactive installer support and offline usage ability. - -Portable applications are always handy. Mostly because they can run on-the-fly without needing any administrator privileges, and also it can be carried around on small USB sticks along with all their settings and data. And these interactive installers will be able to allow us to install applications with ease. - -### OPEN RUNNABLE BUNDLE (ORB) - -ORB is a free & open-source package format and it’s different from the others in numerous ways. Some of the specifications of ORB is followings: - -- **Compression**: All the packages are compressed with squashfs making them up-to 60% smaller. -- **Portable Mode**: If a portable ORB application is run from a removable drive, it’ll store its settings and data on that drive. -- **Security**: All ORB packages are signed with PGP/RSA and distributed via TLS 1.2. -- **Offline**: All the dependencies are bundled with the package, so no downloading dependencies anymore. -- **Open package**: ORB packages can be mounted as ISO images. - -### VARIETY - -ORB applications are now available in two varieties: - -- Portable Applications -- SuperDEB - -#### 1. PORTABLE ORB APPLICATIONS - -Portable ORB Applications is capable of running right away without needing any installation beforehand. That means it’ll need no administrator privileges and no dependencies! You can just download them from the Orbital Apps website and get to work. - -And as it supports Portable Mode, you can copy it on a USB stick and carry it around. All its settings and data will be stored with it on that USB stick. Just connect the USB stick with any system running on Ubuntu 16.04 and you’ll be ready to go. - -##### AVAILABLE PORTABLE APPLICATIONS - -Currently, more than 35 applications are available as portable packages, including some very popular applications like: [Deluge][3], [Firefox][4], [GIMP][5], [Libreoffice][6], [uGet][7] & [VLC][8]. - -For a full list of available packages, check the [Portable ORB Apps list][9]. - -##### USING PORTABLE APPLICATION - -Follow the steps for using Portable ORB Applications: - -- Download your desired package from the Orbital Apps site. -- Move it wherever you want (local drive / USB stick). -- Open the directory where you’ve stored the ORB package. - -![](http://itsfoss.com/wp-content/uploads/2016/05/using-portable-orb-app-1-1024x576.jpg) - -- Open Properties of the ORB package. - -![](http://itsfoss.com/wp-content/uploads/2016/05/using-portable-orb-app-2.jpg) ->Add Execute permission to ORB package - -- Add Execute permission from Permissions tab. -- Double-click on it. - -Wait for a few seconds as it prepares itself for running. And you’re good to go. - -#### 2. SUPERDEB - -Another variety of ORB Applications is SuperDEB. SuperDEBs are easy and interactive installers that make the software installation process a lot smoother. If you don’t like to install software from terminal or software centers, SuperDEB is exactly for you. - -And the most interesting part is that you won’t need an active internet connection for installing as all the dependencies are bundled with the installer. - -##### AVAILABLE SUPERDEBS - -More than 60 applications are currently available as SuperDEB. Some of the popular software among them are: [Chromium][10], [Deluge][3], [Firefox][4], [GIMP][5], [Libreoffice][6], [uGet][7] & [VLC][8]. - -For a full list of available SuperDEBs, check the [SuperDEB list][11]. - -##### USING SUPERDEB INSTALLER - -- Download your desired SuperDEB from Orbital Apps site. -- Add **Execute permission** to it just like before ( Properties > Permissions ). -- Double-click on the SuperDEB installer and follow the interactive instructions: - -![](http://itsfoss.com/wp-content/uploads/2016/05/Using-SuperDEB-Installer-1.png) ->Click OK - -![](http://itsfoss.com/wp-content/uploads/2016/05/Using-SuperDEB-Installer-2.png) ->Enter your password and proceed - -![](http://itsfoss.com/wp-content/uploads/2016/05/Using-SuperDEB-Installer-3.png) ->It’ll start Installing… - -![](http://itsfoss.com/wp-content/uploads/2016/05/Using-SuperDEB-Installer-4.png) ->And soon it’ll be done… - -- After finishing the installation, you’re good to use it normally. - -### ORB APPS COMPATIBILITY - -According to Orbital Apps, they are fully compatible with Ubuntu 16.04 [64 bit]. - ->Reading suggestion: [How To Know If You Have 32 Bit or 64 Bit Computer in Ubuntu][12]. - -As for other distros compatibility is not guaranteed. But we can say that, it’ll work on any Ubuntu 16.04 flavors (UbuntuMATE, UbuntuGNOME, Lubuntu, Xubuntu etc.) and Ubuntu 16.04 based distros (like upcoming Linux Mint 18). We currently have no information if Orbital Apps is planning on expanding its support for other Ubuntu versions/Linux Distros or not. - -If you’re going to use Portable ORB applications often on your system, you can consider installing ORB Launcher. It’s not necessary but is recommended installing to get an improved experience. The shortest method of installing ORB Launcher is opening the terminal and enter the following command: - -``` -wget -O - https://www.orbital-apps.com/orb.sh | bash -``` - -You can find the detailed instructions at [official documentation][13]. - -### WHAT IF I NEED AN APP THAT’S NOT LISTED? - -If you need an application as ORB package that is not available right now, you can [contact][14] Orbital Apps. And the good news is, Orbital Apps is working hard and planning on releasing a tool for creating ORB packages. So, hopefully, soon we’ll be able to make ORB packages ourselves! - -Just to add, this was about installing apps offline. If you are interested, you should read [how to update or upgrade Ubuntu offline][15]. - -So, what do you think about Orbital Apps’ Portable Applications and SuperDEB installers? Will you try them? - - ----------------------------------- -via: http://itsfoss.com/orb-linux-apps/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 - -作者:[Munif Tanjim][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/munif/ -[1]: http://itsfoss.com/cube-lets-install-linux-applications-offline/ -[2]: https://www.orbital-apps.com/ -[3]: https://www.orbital-apps.com/download/portable_apps_linux/deluge -[4]: https://www.orbital-apps.com/download/portable_apps_linux/firefox -[5]: https://www.orbital-apps.com/download/portable_apps_linux/gimp -[6]: https://www.orbital-apps.com/download/portable_apps_linux/libreoffice -[7]: https://www.orbital-apps.com/download/portable_apps_linux/uget -[8]: https://www.orbital-apps.com/download/portable_apps_linux/vlc -[9]: https://www.orbital-apps.com/download/portable_apps_linux/ -[10]: https://www.orbital-apps.com/download/superdeb_installers/ubuntu_16.04_64bits/chromium/ -[11]: https://www.orbital-apps.com/superdebs/ubuntu_16.04_64bits/ -[12]: http://itsfoss.com/32-bit-64-bit-ubuntu/ -[13]: https://www.orbital-apps.com/documentation -[14]: https://www.orbital-apps.com/contact -[15]: http://itsfoss.com/upgrade-or-update-ubuntu-offline-without-internet/ diff --git a/translated/tech/20160520 ORB - NEW GENERATION OF LINUX APPS ARE HERE.md b/translated/tech/20160520 ORB - NEW GENERATION OF LINUX APPS ARE HERE.md new file mode 100644 index 0000000000..cc212e7a4c --- /dev/null +++ b/translated/tech/20160520 ORB - NEW GENERATION OF LINUX APPS ARE HERE.md @@ -0,0 +1,142 @@ +ORB:新一代 Linux 应用 +============================================= + +![](http://itsfoss.com/wp-content/uploads/2016/05/ORB-Apps.jpeg) + +我们之前讨论过[在 Ubuntu 上离线安装应用][1]。我们现在要再次讨论它。 + +[Orbital Apps][2] 给我们带来了新的软件包类型,**ORB**,它带有便携软件,交互式安装向导支持,以及离线使用的能力。 + +便携软件很方便。主要是因为它们能够无需任何管理员权限直接运行,也能够带着所有的设置和数据随U盘存储。而交互式的安装向导也能让我们轻松地安装应用。 + +### 开放可运行包 OPEN RUNNABLE BUNDLE (ORB) + +ORB 是一个免费和开源的包格式,它和其它包格式在很多方面有所不同。ORB 的一些特性: + +- **压缩**:所有的包经过压缩,使用 squashfs,体积最多减少 60%。 +- **便携模式**:如果一个便携 ORB 应用是从可移动设备运行的,它会把所有设置和数据存储在那之上。 +- **安全**:所有的 ORB 包使用 PGP/RSA 签名,通过 TLS 1.2 分发。 +- **离线**:所有的依赖都打包进软件包,所以不再需要下载依赖。 +- **开放包**:ORB 包可以作为 ISO 镜像挂载。 + +### 种类 + +ORB 应用现在有两种类别: + +- 便携软件 +- SuperDEB + +#### 1. 便携 ORB 软件 + +便携 ORB 软件可以立即运行而不需要任何的事先安装。那意味着它不需要管理员权限和依赖!你可以直接从 Orbital Apps 网站下载下来就能使用。 + +并且由于它支持便携模式,你可以将它拷贝到U盘携带。它所有的设置和数据会和它一起存储在U盘。只需将U盘连接到任何运行 Ubuntu 16.04 的机器上就行了。 + +##### 可用便携软件 + +目前有超过 35 个软件以便携包的形式提供,包括一些十分流行的软件,比如:[Deluge][3],[Firefox][4],[GIMP][5],[Libreoffice][6],[uGet][7] 以及 [VLC][8]。 + +完整的可用包列表可以查阅 [便携 ORB 软件列表][9]。 + +##### 使用便携软件 + +按照以下步骤使用便携 ORB 软件: + +- 从 Orbital Apps 网站下载想要的软件包。 +- 将其移动到想要的位置(本地磁盘/U盘)。 +- 打开存储 ORB 包的目录。 + +![](http://itsfoss.com/wp-content/uploads/2016/05/using-portable-orb-app-1-1024x576.jpg) + +- 打开 ORB 包的属性。 + +![](http://itsfoss.com/wp-content/uploads/2016/05/using-portable-orb-app-2.jpg) +>给 ORB 包添加运行权限 + +- 在权限标签页添加运行权限。 +- 双击打开它。 + +等待几秒,让它准备好运行。大功告成。 + +#### 2. SuperDEB + +另一种类型的 ORB 软件是 SuperDEB。SuperDEB 很简单,交互式安装向导能够让软件安装过程顺利得多。如果你不喜欢从终端或软件中心安装软件,superDEB 就是你的菜。 + +最有趣的部分是你安装时不需要一个互联网连接,因为所有的依赖都由安装向导打包了。 + +##### 可用的 SuperDEB + +超过 60 款软件以 SuperDEB 的形式提供。其中一些流行的有:[Chromium][10],[Deluge][3],[Firefox][4],[GIMP][5],[Libreoffice][6],[uGet][7] 以及 [VLC][8]。 + +完整的可用 SuperDEB 列表,参阅 [SuperDEB 列表][11]。 + +##### 使用 SuperDEB 安装向导 + +- 从 Orbital Apps 网站下载需要的 SuperDEB。 +- 像前面一样给它添加**运行权限**(属性 > 权限)。 +- 双击 SuperDEB 安装向导并按下列说明操作: + +![](http://itsfoss.com/wp-content/uploads/2016/05/Using-SuperDEB-Installer-1.png) +>点击 OK + +![](http://itsfoss.com/wp-content/uploads/2016/05/Using-SuperDEB-Installer-2.png) +>输入你的密码并继续 + +![](http://itsfoss.com/wp-content/uploads/2016/05/Using-SuperDEB-Installer-3.png) +>它会开始安装… + +![](http://itsfoss.com/wp-content/uploads/2016/05/Using-SuperDEB-Installer-4.png) +>一会儿他就完成了… + +- 完成安装之后,你就可以正常使用了。 + +### ORB 软件兼容性 + +从 Orbital Apps 可知,它们完全适配 Ubuntu 16.04 [64 bit]。 + +>阅读建议:[如何在 Ubuntu 获知你的是电脑 32 位还是 64 位的][12]。 + +至于其它发行版兼容性不受保证。但我们可以说,它在所有 Ubuntu 16.04 衍生版(UbuntuMATE,UbuntuGNOME,Lubuntu,Xubuntu 等)以及基于 Ubuntu 16.04 的发行版(比如即将到来的 Linux Mint 18)上都适用。我们现在还不清楚 Orbital Apps 是否有计划拓展它的支持到其它版本 Ubuntu 或 Linux 发行版上。 + +如果你在你的系统上经常使用便携 ORB 软件,你可以考虑安装 ORB 启动器。它不是必需的,但是推荐安装它以获取更佳的体验。最简短的 ORB 启动器安装流程是打开终端输入以下命令: + +``` +wget -O - https://www.orbital-apps.com/orb.sh | bash +``` + +你可以在[官方文档][13]找到更加详细的介绍。 + +### 如果我需要的软件不在列表里? + +如果你需要一个当前并没有可用 ORB 包的软件,你可以[联系][14] Orbital Apps。好消息是,Orbital Apps 正在致力于推出一个创建 ORB 包的工具。所以,不久后我们有希望可以自己制作 ORB 包! + +多说一句,这个文章是关于离线安装软件的。如果你感兴趣的话,你可以看看[如何离线更新或升级 Ubuntu][15]。 + +所以,你怎么看 Orbital Apps 的便携软件和 SuperDEB 安装向导?你会试试吗? + + +---------------------------------- +via: http://itsfoss.com/orb-linux-apps/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 + +作者:[Munif Tanjim][a] +译者:[alim0x](https://github.com/alim0x) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/munif/ +[1]: http://itsfoss.com/cube-lets-install-linux-applications-offline/ +[2]: https://www.orbital-apps.com/ +[3]: https://www.orbital-apps.com/download/portable_apps_linux/deluge +[4]: https://www.orbital-apps.com/download/portable_apps_linux/firefox +[5]: https://www.orbital-apps.com/download/portable_apps_linux/gimp +[6]: https://www.orbital-apps.com/download/portable_apps_linux/libreoffice +[7]: https://www.orbital-apps.com/download/portable_apps_linux/uget +[8]: https://www.orbital-apps.com/download/portable_apps_linux/vlc +[9]: https://www.orbital-apps.com/download/portable_apps_linux/ +[10]: https://www.orbital-apps.com/download/superdeb_installers/ubuntu_16.04_64bits/chromium/ +[11]: https://www.orbital-apps.com/superdebs/ubuntu_16.04_64bits/ +[12]: http://itsfoss.com/32-bit-64-bit-ubuntu/ +[13]: https://www.orbital-apps.com/documentation +[14]: https://www.orbital-apps.com/contact +[15]: http://itsfoss.com/upgrade-or-update-ubuntu-offline-without-internet/ From da07e37c3ad6879ded414349f92ea69aab4b542e Mon Sep 17 00:00:00 2001 From: sarishinohara Date: Sat, 28 May 2016 19:21:02 +0200 Subject: [PATCH 0824/1469] translated --- ...LINUX PHOTO MANAGEMENT SOFTWARE IN 2016.md | 163 ----------------- ...LINUX PHOTO MANAGEMENT SOFTWARE IN 2016.md | 172 ++++++++++++++++++ 2 files changed, 172 insertions(+), 163 deletions(-) delete mode 100644 sources/tech/20160526 BEST LINUX PHOTO MANAGEMENT SOFTWARE IN 2016.md create mode 100644 translated/tech/20160526 BEST LINUX PHOTO MANAGEMENT SOFTWARE IN 2016.md diff --git a/sources/tech/20160526 BEST LINUX PHOTO MANAGEMENT SOFTWARE IN 2016.md b/sources/tech/20160526 BEST LINUX PHOTO MANAGEMENT SOFTWARE IN 2016.md deleted file mode 100644 index 9e3e630282..0000000000 --- a/sources/tech/20160526 BEST LINUX PHOTO MANAGEMENT SOFTWARE IN 2016.md +++ /dev/null @@ -1,163 +0,0 @@ -translating by sarishinohara - -BEST LINUX PHOTO MANAGEMENT SOFTWARE IN 2016 -============================================= - -![](http://itsfoss.com/wp-content/uploads/2016/05/Best-Linux-Photo-Management-Software.jpg) - -When it comes to Linux applications, at times there are so many choices and alternatives. But sometimes there are only a few options. - -One of our readers had requested to make a list of decent **Linux photo management software**. Something that could replace now defunct Picasa on Linux. - -Turns out, though not many, there are some really good applications for managing photo libraries available out there. Either you have a huge collection of photos or only a few of them, one of these options ought to suit your needs. - -This list of **best photo management applications for Linux** is different from our earlier list of [best photo applications for Linux][1]. That list contained image related applications for various purposes such as editing, painting etc., while this list deals with only photo managing applications. - -So, here we go. I’ve also included the installation commands of these applications for Ubuntu and its derivatives. All you need to do is open a terminal and run those. - -### [GTHUMB](https://wiki.gnome.org/Apps/gthumb) - -![](http://itsfoss.com/wp-content/uploads/2016/05/gThumb-1-1024x540.jpg) ->gThumb Photo Editing - -gThumb is a lightweight photo management application built mainly for GNOME desktop environment. It includes all the basic photo management features as well as some editing and advance operations. Some of the main features of gThumb are: - -- Image Viewer: Supports all the major image format (including GIF) and metadata (EXIF, XMP etc). -- Image Browser: All the basic browsing operations (thumbnails, move, copy, delete etc) and bookmarking support. -- Image Organizer: Organize photos with tags, catalogs and Libraries. Importing photos from Digital Cameras. Web albums (Picasa, Flickr, Facebook etc) integration. -- Image Editor: Basic photo editing operations, filters, format conversion etc. - -And there’s much more, check the official [gThumb feature][2] list. If you use GNOME or GNOME based desktop environments (like MATE) you should definitely try this one out. - -#### GTHUMB INSTALLATION - -``` -sudo apt-get install gthumb -``` - - -### [DIGIKAM][3] - -![](http://itsfoss.com/wp-content/uploads/2016/05/digiKam-1-1024x540.png) ->digiKam - -digiKam is mainly developed for KDE, but works just as well on other desktop environments. It comes with a lot of features with an interface that works nicely. The main features of digiKam includes: - -- Photo Organizer: Albums, sub-albums, tags, comments, metadata, sorting support. -- Photo Importer: Import support from Digital Cameras, USB devices, Web Albums (including Picasa & Facebook) and some other features. -- Photo Exporter: Export support for various online platforms and format conversion. -- Photo Editor: Wide range of photo editing operations. - -digiKam is certainly one of the best Linux photo management software, if not best. - -#### DIGIKAM INSTALLATION - -``` -sudo apt-get install digikam -``` - -### [SHOTWELL][4] - -![](http://itsfoss.com/wp-content/uploads/2016/05/Shotwell-1-1024x540.png) ->Shotwell - -Shotwell photo manager is also for GNOME desktop environment. Shotwell, while isn’t as feature-rich as gThumb, does what it promises. The main features of Shotwell are: - -- Import photos from Disks or Digital Cameras. -- Event, tags and folder based organization. -- Basic photo editing features and format conversion. -- Supports uploading to web services (Facebook, Flickr, Tumblr etc). - -If you want something simple, you can check this one out. - -#### SHOTWELL INSTALLATION - -``` -sudo apt-get install shotwell -``` - -### [KPHOTOALBUM][5] - -![](http://itsfoss.com/wp-content/uploads/2016/05/KPhotoAlbum-1-1024x540.png) ->KPhotoAlbum - -KPhotoAlbum is a photo management application also intended to be used on [KDE desktop environment][6]. What makes KPhotoAlbum unique is its categorization process and time-based browsing. You can categorize photos by People, Places, Events etc. And for time-based browsing, it has a dedicated timeline or Date Bar at the bottom of the user interface. - -KPhotoAlbum comes with a wide range of features for photo management and editing. Some of the main features include: - -- Advance photo organization (with categories, sub-categories, tags, metadata, annotation support and much more). -- Wide range of import and export options (including almost every major photo sharing platforms). -- Various editing options (includes batch operations). - -All these advanced organization features do have their downsides – user has to do most of them manually. But if you’re a KDE lover, this can be a good pick. You can use KPhotoAlbum on other desktop environments too, but it delivers the optimal experience on KDE. - -#### KPHOTOALBUM INSTALLATION - -``` -sudo apt-get install kphotoalbum -``` - -### [DARKTABLE][7] - -![](http://itsfoss.com/wp-content/uploads/2016/05/darktable-1-1024x540.png) ->Darktable - -Darktable is more of a photo editing application than an organizer. Darktable stands out for its own user interface regardless of the desktop environment you might be using, and of course for its editing capabilities. The basic features include: - -- Basic photo organization. -- Advance and feature-rich photo editing. -- Export support for Picasa & Flickr and format conversion. - -If you’re into photo editing and retouching, Darktable is a nice choice. - -> Reading Suggestion: [How to install Darktable 2.0 in Ubuntu via PPA][8] - -#### DARKTABLE INSTALLATION - -``` -sudo add-apt-repository ppa:pmjdebruijn/darktable-release -sudo apt-get update -sudo apt-get install darktable -``` - -### OTHERS - -If you want a simple application for pulling images from your portable devices (cameras, phones, portable drives etc) and storing them on your Hard Disk, using [Rapid Photo Downloader][9] is a no-brainer. It is an incredible application for importing and backing up photos from portable devices. The installation and configuration process is quite easy and simple. - -For installing Rapid Photo Downloader on Ubuntu, fire up a terminal and run this command: - -``` -sudo apt-get install rapid-photo-downloader -``` - -If you are still interested in trying a few more options, here you go: - -- [GNOME Photos][10] (Photo viewer for GNOME desktop environment) -- [Gwenview][11] (Photo viewer for KDE desktop environment) -- [Picty][12] (Open-source photo collection manager) - -So, are you using, or plan to use, any one of these applications? Which, according to you is the best photo management application for Ubuntu or any other Linux? Do you have any favorites to term as Linux photo manager? Do share your views. - - ----------- -via: http://itsfoss.com/linux-photo-management-software/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 - -作者:[Munif Tanjim][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/munif/ -[1]: http://itsfoss.com/image-applications-ubuntu-linux/ -[2]: https://wiki.gnome.org/Apps/gthumb/features -[3]: https://www.digikam.org/ -[4]: https://wiki.gnome.org/Apps/Shotwell -[5]: https://www.kphotoalbum.org/ -[6]: https://www.kde.org/ -[7]: http://www.darktable.org/ -[8]: http://itsfoss.com/darktable-20-released-installation-ppa/ -[9]: http://www.damonlynch.net/rapid/index.html -[10]: https://wiki.gnome.org/Apps/Photos -[11]: https://userbase.kde.org/Gwenview -[12]: https://github.com/spillz/picty diff --git a/translated/tech/20160526 BEST LINUX PHOTO MANAGEMENT SOFTWARE IN 2016.md b/translated/tech/20160526 BEST LINUX PHOTO MANAGEMENT SOFTWARE IN 2016.md new file mode 100644 index 0000000000..24cb248921 --- /dev/null +++ b/translated/tech/20160526 BEST LINUX PHOTO MANAGEMENT SOFTWARE IN 2016.md @@ -0,0 +1,172 @@ +2016年最佳 Linux 图像管理软件 +============================================= + +![](http://itsfoss.com/wp-content/uploads/2016/05/Best-Linux-Photo-Management-Software.jpg) + +通常谈及 Linux 上的应用程序时,我们有很多选择,但有时候选择的余地却很小。 + +有一些读者要我们做一个合宜的**图像管理软件**列表,来代替 Linux 上已被弃用的 Picasa 应用。 + +其实 Linux 平台上还是有很多很好的图像管理软件的,你可以根据你图片库的大小选择合适的应用。 + +这个列表和我们先前的 [最佳图像程序应用][1] 有些差别,上次我们介绍了图像编辑软件,绘图软件等,而这次的介绍主要集中在图像管理软件上。 + +好,下面我们开始介绍。我会详细说明在 Ubuntu 下的安装命令以及衍生的命令,我们只需要打开终端运行这些命令。 + +### [GTHUMB](https://wiki.gnome.org/Apps/gthumb) + +![](http://itsfoss.com/wp-content/uploads/2016/05/gThumb-1-1024x540.jpg) +>gThumb 图像编辑器 + +gThumb 是在 GNOME 桌面环境下的一个轻量级的图像管理应用,它涵盖了基本图像管理功能,编辑图片以及更加高级的操作,gThumb 主要功能如下: + +- 图片查看:支持所有主流的图片格式(包括gif)和元数据(EXIF, XMP 等)。 + +- 图片浏览:所有基础的浏览操作(缩略图,移动,复制,删除等)以及书签支持。 + +- 图片管理:使用标签操作图片,目录和图片库。从数码相机,网络相册(Picasa,Flickr,Facebook等)整合,导入图片。 + +- 图片编辑:基本图像编辑操作,滤镜,格式转换等。 + +- 更多功能请参考官方 [gThumb功能][2] 列表。如果你使用的是 GNOME 或者基于 GNOME 的桌面环境(如 MATE),那么你一定要试用一下。 + +#### GTHUMB 安装 + +``` +sudo apt-get install gthumb +``` + + +### [DIGIKAM][3] + +![](http://itsfoss.com/wp-content/uploads/2016/05/digiKam-1-1024x540.png) +>digiKam + +digiKam 主要为 KDE 而设计,在其他桌面环境下也可以使用。它有很多很好的图像界面功能,主要功能如下所示: + +- 图片管理:相册,子相册,标签,评论,元数据,排序支持。 + +- 图片导入:支持从数码相机,USB设备,网络相册(包括 Picasa 和 Facebook)导入,以及另外一些功能。 + +- 图片输出:支持输出至很多网络在线平台,以及各式转换。 + +- 图片编辑:支持很多图像编辑的操作。 + +digiKam 是众多优秀图像管理软件之一。 + +#### DIGIKAM 安装 + +``` +sudo apt-get install digikam +``` + +### [SHOTWELL][4] + +![](http://itsfoss.com/wp-content/uploads/2016/05/Shotwell-1-1024x540.png) +>Shotwell + +Shotwell 图像管理也是为 GNOME 桌面环境设计,虽然功能不及 gThumb 多,但满足了基本需求。主要功能如下: + +- 从磁盘或数码相机导入图片。 + +- 项目,标签和文件夹管理。 + +- 基本图片编辑功能和格式转换。 + +- 支持上传至网络平台(Facebook,Flickr,Tumblr 等)。 + +如果你想要一款功能相对简单的应用,你可以尝试一下这个。 + +#### SHOTWELL 安装 + +``` +sudo apt-get install shotwell +``` + +### [KPHOTOALBUM][5] + +![](http://itsfoss.com/wp-content/uploads/2016/05/KPhotoAlbum-1-1024x540.png) +>KPhotoAlbum + +KPhotoAlbum 是一款在 KDE 桌面环境下的图像管理应用。它有一些独特的功能:分类和基于时间浏览。你可以基于人物,地点,时间分类;另外在用户图形界面底部会显示时间栏。 + +KPhotoAlbum 有很多图像管理和编辑功能,主要功能包括: + +- 高级图片操作(目录,子目录,标签,元数据,注释等)。 + +- 图片导入导出功能(包括主流图片分享平台)。 + +- 众多编辑功能(包括批量处理)。 + +这些高级的功能有它们的缺点,就是用户需要手工操作。但如果你是KDE爱好者,这是个好的选择。它完美适用 KDE,但是你也可以在非 KDE 桌面环境下使用 KPhotoAlbum。 + +#### KPHOTOALBUM 安装 + +``` +sudo apt-get install kphotoalbum +``` + +### [DARKTABLE][7] + +![](http://itsfoss.com/wp-content/uploads/2016/05/darktable-1-1024x540.png) +>Darktable + +Darktable 相较于图像管理更偏向于图像编辑。Darktable 有良好的用户图形界面,对桌面环境没有特殊的要求,以及图像编辑功能。它的基本功能如下: + +- 基本图片管理。 + +- 众多高级的图片编辑功能。 + +- 支持导出至 Picasa 和 Flickr 和格式转换。 + +如果你喜欢照片编辑和润色,Darktable 是个好的选择。 + +> 推荐阅读:[怎样在Ubuntu下通过PPA安装Darktable 2.0][8] + +#### DARKTABLE 安装 + +``` +sudo add-apt-repository ppa:pmjdebruijn/darktable-release +sudo apt-get update +sudo apt-get install darktable +``` + +### 其它 + +如果你想要功能简单的应用,比如从便携设备(相机,手机,便携设备等)中导入照片并存入磁盘,使用 [Rapid Photo Downloader][9],它很适合从便携设备中导入和备份图片,而且安装配置过程简单。 + +在 Ubuntu 上安装 Rapid Photo Downloade,打开终端输入命令: + +``` +sudo apt-get install rapid-photo-downloader +``` + +如果你想尝试更多的选择: +- [GNOME Photos][10] (GNOME桌面环境下的图像查看器) +- [Gwenview][11] (KDE桌面环境下的图像查看器) +- [Picty][12] (开源图像管理器) + +那么,你正在使用,或者打算使用其中一款应用吗?你有其它更好的推荐吗?你有最喜欢的 Linux 图像管理软件吗?分享你的观点。 + +---------- +via: http://itsfoss.com/linux-photo-management-software/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 + +作者:[Munif Tanjim][a] +译者:[sarishinohara](https://github.com/sarishinohara) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://itsfoss.com/author/munif/ +[1]: http://itsfoss.com/image-applications-ubuntu-linux/ +[2]: https://wiki.gnome.org/Apps/gthumb/features +[3]: https://www.digikam.org/ +[4]: https://wiki.gnome.org/Apps/Shotwell +[5]: https://www.kphotoalbum.org/ +[6]: https://www.kde.org/ +[7]: http://www.darktable.org/ +[8]: http://itsfoss.com/darktable-20-released-installation-ppa/ +[9]: http://www.damonlynch.net/rapid/index.html +[10]: https://wiki.gnome.org/Apps/Photos +[11]: https://userbase.kde.org/Gwenview +[12]: https://github.com/spillz/picty From 591fa82e100b2efa01677b84465490dd0c70c7db Mon Sep 17 00:00:00 2001 From: mudongliang Date: Sun, 29 May 2016 00:51:52 -0400 Subject: [PATCH 0825/1469] translated --- ...to Best Manage Encryption Keys on Linux.md | 100 +++++++++--------- 1 file changed, 49 insertions(+), 51 deletions(-) diff --git a/sources/tech/20160218 How to Best Manage Encryption Keys on Linux.md b/sources/tech/20160218 How to Best Manage Encryption Keys on Linux.md index e09f88db3e..b833d94658 100644 --- a/sources/tech/20160218 How to Best Manage Encryption Keys on Linux.md +++ b/sources/tech/20160218 How to Best Manage Encryption Keys on Linux.md @@ -1,110 +1,108 @@ -mudongliang translating -How to Best Manage Encryption Keys on Linux +Linux 如何最好地管理加密密钥 ============================================= ![](http://www.linux.com/images/stories/41373/key-management-diagram.png) -Storing SSH encryption **keys** and memorizing passwords can be a headache. But unfortunately in today's world of malicious hackers and exploits, basic security precautions are an essential practice. For a lot of general users, this amounts to simply memorizing passwords and perhaps finding a good program to store the passwords, as we remind such users not to use the same password for every site. But for those of us in various IT fields, we need to take this up a level. We have to deal with encryption keys such as SSH keys, not just passwords. +存储 SSH 的加密秘钥以及记住密码一直是一个让人头疼的问题。但是不幸的是,在当前充满了恶意黑客和攻击的世界中,基本的安全预警是必不可少的。对于大量的普通用户,它相当于简单地记住密码,也可能寻找一个好程序去存储密码,正如我们提醒这些用户不要在每个网站都有相同的密码。但是对于在各个 IT 领域的我们,我们需要将这个提高一个层次。我们不得不处理加密秘钥,比如 SSH 密钥,而不只是密码。 -Here's a scenario: I have a server running on a cloud that I use for my main git repository. I have multiple computers I work from. All of those computers need to log into that central server to push to and pull from. I have git set up to use SSH. When git uses SSH, git essentially logs into the server in the same way you would if you were to launch a command line into the server with the SSH command. In order to configure everything, I created a config file in my .ssh directory that contains a Host entry providing a name for the server, the host name, the user to log in as, and the path to a key file. I can then test this configuration out by simply typing the command +设想一个场景:我有一个运行在云上的服务器,用于我的主 git 库。我有很多台工作电脑。所有电脑都需要登陆中央服务器去 push 与 pull。我设置 git 使用 SSH。当 git 使用 SSH, git 实际上以相同的方式登陆服务器,就好像你通过 SSH 命令打开一个服务器的命令行。为了配置所有内容,我在我的 .ssh 目录下创建一个配置文件,其中包含一个有服务器名字,主机名,登陆用户,密钥文件的路径的主机项。之后我可以通过输入命令来测试这个配置。 >ssh gitserver -And soon I'm presented with the server's bash shell. Now I can configure git to use this same entry to log in with the stored key. Easy enough, except for one problem: For each computer I use to log into that server, I need to have a key file. That means more than one key file floating around. I have several such keys on this computer, and several such keys on my other computers. In the same way everyday users have a gazillion passwords, it's easy for us IT folks to end up with a gazillion key files. What to do? +很快我得到了服务器的 bash shell。现在我可以配置 git 使用相同项与存储的密钥来登陆服务器。很简单,除了一个问题,对于每一个我用于登陆服务器的电脑,我需要有一个密钥文件。那意味着需要不止一个密钥文件。当前这台电脑和我的其他电脑都存储有这些密钥文件。同样的,用户每天有特大量的密码,对于我们 IT人员,很容易结束这特大量的密钥文件。怎么办呢? -## Cleaning Up +## 清理 -Before starting out with a program to help you manage your keys, you have to lay some groundwork on how your keys should be handled, and whether the questions we're asking even make sense. And that requires first and foremost that you understand where your public keys go and where your private keys go. I'm going to assume you know: +在开始使用程序去帮助你管理你的密钥之前,你不得不在你的密码应该怎么处理和我们问的问题是否有意义这两个方面打下一些基础。同时,这需要第一,也是最重要的,你明白你的公钥和私钥的使用位置。我将设想你知道: + +1. 公钥和私钥之间的差异; -1. The difference between a public key and private key +2. 为什么你不可以从公钥生成私钥,但是你可以逆向生成? -2. Why you can't generate a private key from a public key but you can do the reverse +3. `authorized_keys` 文件的目的以及它的内容; -3. The purpose of the authorized_keys file and what goes in it +4. 你如何使用私钥去登陆服务器,其中服务器上的 `authorized_keys` 文件中存有相应的公钥; -4. How you use private keys to log into a server that has the corresponding public key in its authorized_keys file. +这里有一个例子。当你在亚马逊的网络服务上创建一个云服务器,你必须提供一个 SSH 密码,用于连接你的服务器。每一个密钥有一个公开的部分,和私密的部分。因为你想保持你的服务器安全,乍看之下你可能要将你的私钥放到服务器上,同时你自己带着公钥。毕竟,你不想你的服务器被公开访问,对吗?但是实际上这是逆向的。 -Here's an example. When you create a cloud server on Amazon Web Services, you have to provide an SSH key that you'll use for connecting to your server. Each key has a public part and a private part. Because you want your server to stay secure, at first glance it might seem you put the private key onto that server, and that you take the public key with you. After all, you don't want that server to be publicly accessible, right? But that's actually backwards. +你把自己的公钥放到 AWS 服务器,同时你持有你自己的私钥用于登陆服务器。你保护私钥,同时保持私钥在自己一方,而不是在一些远程服务器上,正如上图中所示。 -You put the public key on the AWS server, and you hold onto your private key for logging into the server. You guard that private key and keep it by your side, not on some remote server, as shown in the figure above. +原因如下:如果公钥公之于众,他们不可以登陆服务器,因为他们没有私钥。进一步说,如果有人成功攻入你的服务器,他们所能找到的只是公钥。你不可以从公钥生成私钥。同时如果你在其他的服务器上使用相同的密钥,他们不可以使用它去登陆别的电脑。 -Here's why: If the public key were to become known to others, they wouldn't be able to log into the server since they don't have the private key. Further, if somebody did manage to break into your server, all they would find is a public key. You can't generate a private key from a public key. And so if you're using that same key on other servers, they wouldn't be able to use it to log into those other computers. +这就是为什么你把你自己的公钥放到你的服务器上以便通过 SSH 登陆这些服务器。你持有这些私钥,不要让这些私钥脱离你的控制。 -And that's why you put your public key on your servers for logging into them through SSH. The private keys stay with you. You don't let those private keys out of your hands. +但是还有麻烦。试想一下我 git 服务器的例子。我要做一些决定。有时我登陆架设在别的地方的开发服务器。在开发服务器上,我需要连接我的 git 服务器。如何使我的开发服务器连接 git 服务器?通过使用私钥。同时这里面还有麻烦。这个场景需要我把私钥放置到一个架设在别的地方的服务器上。这相当危险。 -But there's still trouble. Consider the case of my git server. I had some decisions to make. Sometimes I'm logged into a development server that's hosted elsewhere. While on that dev box, I need to connect to my git server. How can the dev box connect to the git server? By using the private key. And therein lies trouble. This scenario requires I put a private key on a server that is hosted elsewhere, which is potentially dangerous. +一个进一步的场景:如果我要使用一个密钥去登陆许多的服务器,怎么办?如果一个入侵者得到这个私钥,他或她将拥有私钥,并且得到服务器的全部虚拟网络的权限,同时准备做一些严重的破坏。这一点也不好。 -Now a further scenario: What if I were to use a single key to log into multiple servers? If an intruder got hold of this one private key, he or she would have that private key and gain access to the full virtual network of servers, ready to do some serious damage. Not good at all. +同时那当然会带来一个别的问题,我真的应该在这些其他服务器上使用相同的密钥?因为我刚才描述的,那会非常危险的。 -And that, of course, brings up the other question: Should I really use the same key for those other servers? That's could be dangerous because of what I just described. +最后,这听起来有些混乱,但是有一些简单的解决方案。让我们有条理地组织一下: -In the end, this sounds messy, but there are some simple solutions. Let's get organized. +(注意你有很多地方需要密钥登陆服务器,但是我提出这个作为一个场景去向你展示当你处理密钥的时候你面对的问题) -(Note that there are many places you need to use keys besides just logging into servers, but I'm presenting this as one scenario to show you what you're faced with when dealing with keys.) +## 关于口令句 -## Regarding Passphrases +当你创建你的密钥时,你可以选择是否包含一个口令字,这个口令字会在使用私钥的时候是必不可少的。有了这个口令字,私钥文件本身会被口令字加密。例如,如果你有一个公钥存储在服务器上,同时你使用私钥去登陆服务器的时候,你会被提示,输入口令字。没有口令字,这个密钥是无法使用的。或者,你可以配置你的密钥不需要口令字。然后所有你需要的只是用于登陆服务器的密钥文件。 -When you create your keys, you have the option to include a passphrase that is required when using the private key. With this passphrase, the private key file itself is encrypted using the passphrase. For example, if you have a public key stored on a server and you use the private key to log into that server, you'll be prompted to enter a passphrase. Without the passphrase, the key cannot be used. Alternatively, you can configure your key without a passphrase to begin with. Then all you need is the key file to log into the server. +普遍上,不使用口令字对于用户来说是更容易的,但是我强烈建议在很多情况下使用口令字,原因是,如果私钥文件被偷了,偷密钥的人仍然不可以使用它,除非他或者她可以找到口令字。在理论上,这个将节省你很多时间,因为你可以在攻击者发现口令字之前,从服务器上删除公钥文件,从而保护你的系统。还有一些别的原因去使用口令字,但是这个原因对我来说在很多场合更有价值。(举一个例子,我的 Android 平板上有 VNC 软件。平板上有我的密钥。如果我的平板被偷了之后,我会马上从服务器上删除公钥,使得它的私钥没有作用,无论有没有口令字。)但是在一些情况下我不使用口令字,是因为我正在登陆的服务器上没有什么有价值的数据。它取决于情境。 -Generally going without a passphrase is easier on the users, but one reason I strongly recommend using the passphrase in many situations is this: If the private key file gets stolen, the person who steals it still can't use it until he or she is able to find out the passphrase. In theory, this will save you time as you remove the public key from the server before the attacker can discover the passphrase, thus protecting your system. There are other reasons to use a passphrase, but this one alone makes it worth it to me in many situations. (As an example, I have VNC software on an Android tablet. The tablet holds my private key. If my tablet gets stolen, I'll immediately revoke the public key from the server it logs into, rendering its private key useless, with or without the passphrase.) But in some cases I don't use it, because the server I'm logging into might not have much valuable data on it. It depends on the situation. +## 服务器基础设施 -## Server Infrastructure +你如何设置自己服务器的基础设置将会影响到你如何管理你的密钥。例如,如果你有很多用户登陆,你将需要决定每个用户是否需要一个单独的密钥。(普遍来说,他们应该;你不会想要用户之间共享私钥。那样当一个用户离开组织或者失去信任时,你可以删除那个用户的公钥,而不需要必须给其他人生成新的密钥。相似地,通过共享密钥,他们能以其他人的身份登录,这就更坏了。)但是另外一个问题,你如何配置你的服务器。你是否使用工具,比如 Puppet,配置大量的服务器?同时你是否基于你自己的镜像创建大量的服务器?当你复制你的服务器,你是否需要为每个人设置相同的密钥?不同的云服务器软件允许你配置这个;你可以让这些服务器使用相同的密钥,或者给每一个生成一个新的密钥。 -How you design your infrastructure of servers will impact how you manage your keys. For example, if you have multiple users logging in, you'll need to decide whether each user gets a separate key. (Generally speaking, they should; you don't want users sharing private keys. That way if one user leaves the organization or loses trust, you can revoke that user's key without having to generate new keys for everyone else. And similarly, by sharing keys they could log in as each other, which is also bad.) But another issue is how you're allocating your servers. Do you allocate a lot of servers using tools such as Puppet, for example? And do you create multiple servers based on your own images? When you replicate your servers, do you need to have the same key for each? Different cloud server software allows you to configure this how you choose; you can have the servers get the same key, or have a new one generated for each. +如果你在处理复制的服务器,它可能导致混淆如果用户需要使用不同的密钥登陆两个不同的系统。但是另一方面,服务器共享相同的密钥会有安全风险。或者,第三,如果你的密钥有除了登陆之外的需要(比如挂载加密的驱动),之后你会在很多地方需要相同的密钥。正如你所看到的,你是否需要在不同的服务器上使用相同的密钥不是我为你做的决定;这其中有权衡,而且你需要去决定什么是最好的。 -If you're dealing with replicated servers, it can get confusing if the users need to use different keys to log into two different servers that are otherwise similar. But on the other hand, there could be security risks by having the servers share the same keys. Or, on the third hand, if your keys are needed for something other than logging in (such as mounting an encrypted drive), then you would need the same key in multiple places. As you can see, whether you need to use the same keys across different servers is not a decision I can make for you; there are trade offs, and you need to decide for yourself what's best. +最终,你可能会有: -In the end, you're likely to have: +- 需要登录的多个服务器 -- Multiple servers that need to be logged into +- 多个用户登陆不同的服务器,每个都有自己的密钥 -- Multiple users logging into different servers, each with their own key +- 每个用户多个密钥当他们登陆不同的服务器的时候 -- Multiple keys for each user as they log into different servers. +(如果你正在别的情况下使用密钥,相同的普遍概念会应用于如何使用密钥,需要多少密钥,他们是否共享,你如何处理密钥的私密部分和公开部分。) -(If you're using keys in other situations, as you likely are, the same general concepts will apply regarding how keys are used, how many keys are needed, whether they're shared, and how you handle private and public parts of keys.) +## 安全方法 -## Method of safety +知道你的基础设施和独一无二的情况,你需要组合一个密钥管理方案,它会引导你去分发和存储你的密钥。比如,正如我之前提到的,如果我的平板被偷了,我会从我服务器上删除公钥,期望在平板在用于访问服务器。同样的,我会在我的整体计划中考虑以下内容: -Knowing your infrastructure and unique situation, you need to put together a key management plan that will help guide you on how you distribute and store your keys. For example, earlier I mentioned that if my tablet gets stolen, I will revoke the public key from my server, hopefully before the tablet can be used to access the server. As such, I can allow for the following in my overall plan: +1. 移动设备上的私钥没有问题,但是必须包含口令字; -1. Private keys are okay on mobile devices, but they must include a passphrase +2. 必须有一个方法可以快速地从服务器上删除公钥。 -2. There must exist a way to quickly revoke public keys from a server. +在你的情况中,你可能决定,你不想在自己经常登录的系统上使用口令字;比如,这个系统可能是一个开发者一天登录多次的测试机器。这没有问题,但是你需要调整你的规则。你可能添加一条规则,不可以通过移动设备登录机器。换句话说,你需要根据自己的状况构建你的协议,不要假设某个方案放之四海而皆准。 -In your situation, you might decide you just don't want to use passphrases for a system you log into regularly; for example, the system might be a test machine that the developers log into many times a day. That's fine, but then you'll need to adjust your rules a bit. You might include a rule that that machine is not to be logged into from mobile devices. In other words, you need to build your protocols based on your own situation, and not assume one size fits all. +## 软件 -## Software +至于软件,毫不意外,现实世界中并没有很多好的,可用的软件解决方案去存储和管理你的私钥。但是应该有吗?考虑到这个,如果你有一个程序存储你所有服务器的全部密钥,并且这个程序被一个核心密钥锁住,那么你的密钥就真的安全了吗?或者,同样的,如果你的密钥被放置在你的硬盘上,用于 SSH 程序快速访问,那样一个密钥管理软件是否真正提供了任何保护吗? -On to software. Surprisingly, there aren't a lot of good, solid software solutions for storing and managing your private keys. But should there be? Consider this: If you have a program storing all your keys for all your servers, and that program is locked down by a quick password, are your keys really secure? Or, similarly, if your private keys are sitting on your hard drive for quick access by the SSH program, is a key management software really providing any protection? +但是对于整体基础设施和创建,管理公钥,有许多的解决方案。我已经提到了 Puppet。在 Puppet 的世界中,你创建模块来以不同的方式管理你的服务器。这个想法是服务器是动态的,而且不必要准确地复制其他机器。[这里有一个聪明的途径](http://manuel.kiessling.net/2014/03/26/building-manageable-server-infrastructures-with-puppet-part-4/),它在不同的服务器上使用相同的密钥,但是对于每一个用户使用不同的 Puppet 模块。这个方案可能适合你,也可能不适合你。 -But for overall infrastructure and creating and managing public keys, there are some solutions. I already mentioned Puppet. In the Puppet world, you create modules to manage your servers in different ways. The idea is that servers are dynamic and not necessarily exact duplicates of each other. [Here's one clever approach](http://manuel.kiessling.net/2014/03/26/building-manageable-server-infrastructures-with-puppet-part-4/) that uses the same keys on different servers, but uses a different Puppet module for each user. This solution may or may not apply to you. +或者,另一个选项就是完全换挡。在 Docker 的世界中,你可以采取一个不同的方式,正如[关于 SSH 和 Docker 博客](http://blog.docker.com/2014/06/why-you-dont-need-to-run-sshd-in-docker/)所描述的。 -Or, another option is to shift gears altogether. In the world of Docker, you can take a different approach, as described in [this blog regarding SSH and Docker](http://blog.docker.com/2014/06/why-you-dont-need-to-run-sshd-in-docker/). +但是怎么样管理私钥?如果你搜索,你无法找到很多的软件选择,原因我之前提到过;密钥存放在你的硬盘上,一个管理软件可能无法提到很多额外的安全。但是我确实使用这种方法来管理我的密钥: -But what about managing the private keys? If you search, you're not going to find many software options, for the reasons I mentioned earlier; the private keys are sitting on your hard drive, and a management program might not provide much additional security. But I do manage my keys using this method: +首先,我的 `.ssh/config` 文件中有很多的主机项。我有一个我登陆的主机项,但是有时我对于一个单独的主机有不止一项。如果我有很多登陆,那种情况就会发生。对于架设我的 git 库的服务器,我有两个不同的登陆项;一个限制于 git,另一个为普遍目的的 bash 访问。这个为 git 设置的登陆选项在机器上有极大的限制。还记得我之前说的关于我存在于远程开发机器上的 git 密钥吗?好了。虽然这些密钥可以登陆到我其中一个服务器,但是使用的账号是被严格限制的。 -First, I have multiple Host entries in my .ssh/config file. I have an entry for hosts that I log into, but sometimes I have more than one entry for a single host. That happens if I have multiple logins. I have two different logins for the server hosting my git repository; one is strictly for git, and the other is for general-purpose bash access. The one for git has greatly restricted rights on that machine. Remember what I said earlier about my git keys living on remote development machines? There we go. Although those keys can log into one of my servers, the accounts used are severely limited. +其次,大部分的私钥都包含口令字。(对于处理不得不多次输入口令字的情况,考虑使用 [ssh-agent](http://blog.docker.com/2014/06/why-you-dont-need-to-run-sshd-in-docker/)。) - Second, most of these private keys include a passphrase. (For dealing with having to type the passphrase multiple times, considering using [ssh-agent](http://blog.docker.com/2014/06/why-you-dont-need-to-run-sshd-in-docker/).) +再次,我确实有许多服务器,我想要更加小心地防御,并且在我 host 文件中并没有这样的项。这更加接近于社交工程方面,因为密钥文件还存在于那里,但是可能需要攻击者花费更长的时间去定位这个密钥文件,分析出来他们攻击的机器。在这些例子中,我只是手动打出来长的 SSH 命令。(这真不怎么坏。) -Third, I do have some servers that I want to guard a bit more carefully, and I don't have an entry into my Host file. This is more a social engineering aspect, because the key files are still present, but it might take an intruder a bit longer to locate the key file and figure out which machine they go with. In those cases, I just type out the long ssh command manually. (It's really not that bad.) +同时你可以看出来我没有使用任何特别的软件去管理这些私钥。 -And you can see that I'm not using any special software to manage these private keys. +## 无放之四海而皆准的方案 -## One Size Doesn't Fit All - -We occasionally get questions at linux.com for advice on good software for managing keys. But let's take a step back. The question actually needs to be re-framed, because there isn't a one-size-fits-all solution. The questions you ask should be based on your own situation. Are you simply trying to find a place to store your key files? Are you looking for a way to manage multiple users each with their own public key that needs to be inserted into the authorized_keys file? - -Throughout this article, I've covered the basics of how all this fits together, and hopefully at this point you'll see that how you manage your keys, and whatever software you look for (if you even need additional software at all), should happen only after you ask the right questions. +我们偶然间收到 linux.com 的问题,关于管理密钥的好软件的建议。但是让我们后退一步。这个问题事实上需要重新定制,因为没有一个普适的解决方案。你问的问题基于你自己的状况。你是否简单地尝试找到一个位置去存储你的密钥文件?你是否寻找一个方法去管理多用户问题,其中每个人都需要将他们自己的公钥插入到 `authorized_keys` 文件中? +通过这篇文章,我已经囊括了基础知识,希望到此你明白如何管理你的密钥,并且,只有当你问了正确的问题,无论你寻找任何软件(甚至你需要另外的软件),它都会出现。 ------------------------------------------------------------------------------ via: http://www.linux.com/learn/tutorials/838235-how-to-best-manage-encryption-keys-on-linux 作者:[Jeff Cogswell][a] -译者:[译者ID](https://github.com/译者ID) +译者:[mudongliang](https://github.com/mudongliang) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 693d7d6082bdcbeb7f30be4c1096bdb0d47fb5ef Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 29 May 2016 16:01:27 +0800 Subject: [PATCH 0826/1469] =?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 @mudongliang --- .../tech/20160218 How to Best Manage Encryption Keys on Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20160218 How to Best Manage Encryption Keys on Linux.md (100%) diff --git a/sources/tech/20160218 How to Best Manage Encryption Keys on Linux.md b/translated/tech/20160218 How to Best Manage Encryption Keys on Linux.md similarity index 100% rename from sources/tech/20160218 How to Best Manage Encryption Keys on Linux.md rename to translated/tech/20160218 How to Best Manage Encryption Keys on Linux.md From 0f7c20db13b8fc60ff40c85c0be816b1e9acb2ca Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 29 May 2016 16:15:02 +0800 Subject: [PATCH 0827/1469] PUB:20160516 Open source from a recruiter's perspective MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @eriwoon 翻译的不错!文笔流畅,把握准确。 --- ...n source from a recruiter's perspective.md | 50 +++++++++++++++++++ ...n source from a recruiter's perspective.md | 49 ------------------ 2 files changed, 50 insertions(+), 49 deletions(-) create mode 100644 published/20160516 Open source from a recruiter's perspective.md delete mode 100644 translated/talk/20160516 Open source from a recruiter's perspective.md diff --git a/published/20160516 Open source from a recruiter's perspective.md b/published/20160516 Open source from a recruiter's perspective.md new file mode 100644 index 0000000000..31402662e2 --- /dev/null +++ b/published/20160516 Open source from a recruiter's perspective.md @@ -0,0 +1,50 @@ +猎头们怎么看开源 +============================================ + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BIZ_workplay.png?itok=uQqFssrf) + +2012 年时候,我出席了一个开源社区的聚会,打那之后我就喜欢上了这个行业。 + +我做猎头很多年,现在我在 [Greythorn][1] 公司专门从事大数据方向招聘。我自己之前学习了几个月大数据,可是当我参加了 [OSCON][2] 开源大会,才发现之前的学习多么低效率。OSCON 里聚集了非常多聪明的人,他们每个人都很愿意分享他们的心得。分享的原因不是他们想推销产品,纯粹是因为喜欢。 + +我很快意识到,与其说开源和大数据是一个行业,不如说他们是一个社区(community)。这也是为什么我现在特别想把我从开源中学到的东西分享给大家,特别是给那些刚刚踏入工作的新人。 + +### 为什么雇主喜欢开源贡献者(contributor) + +我的许多客户跟我说过:一个人的技术虽然重要,但真心**喜欢**自己从事的工作更重要。如果你热爱自己的工作,即便老板不给加班工资你都忍不住想加班。 + +我的客户也经常问,“这个人没事儿的时候写代码吗?”“我能在哪儿找到他们的作品呢?”“他们有什么爱好呀?”这时候开源社区贡献者的优势就出来了,因为上面的问题就是给他们量身定做的。他们做的项目开源,这就是他们编码能力的例证。 + +#### 为什么猎头在寻找开源贡献者 + +硬派科技行业猎头了解技术,知道自己在找一个什么样的人,这样的猎头也能正确的了解对象的技能。我发现,猎头们找到的最优秀的人才很多时候也在做开源,所以我们经常直接去开源社区寻找我们的目标。猎头们会告诉雇主,“我们找到的那个人喜欢和团队一起创造了不起的产品”,而这基本上是优秀雇主共同的要求。 + +所以说:如果你的项目目标是改变人类的未来,那当这些聪明人来到你的团队之后,他们自己就会爱上自己的工作。 + +### 开源贡献者如何得到更好的职业生涯呢 + +怎么让你的贡献更广为人知呢:把代码放到 Github 上;做开源项目;参加会议和研讨等等。做这些事情你会有意想不到的收获的。 + +可以尝试问一下自己: + +* **你觉得所在的公司是否回馈开源社区这件事重要吗?**很多优秀的人才都强调这一点,回馈社区也会极大的提升他们对工作本身的满意度。 +* **你在做产品是否基于开源软件?**基于开源软件的公司的文化氛围会与其他公司与众不同,这也是你选择职位时候需要考虑的问题。 +* **你有没有特别想与之工作的人?**虽然你可以随时换项目,但如果团队里有你崇拜或者欣赏的人,那工作就棒极了。 + +假如你了解自己的人生追求,那么过滤掉那些不适合你的职位就简单多了;假如你有一个相熟的猎头,那找到相合的雇主和团队的机会就大多了。 + +虽然我自己不写代码,但我会把我从开源社区中学到的东西分享给大家。开源社区是由一大群聪明又乐于分享的人组成,我很开心我也是其中小小的一份子。 + +------------------------------------------------------------------------------ + +via: https://opensource.com/business/16/5/open-source-recruiters-perspective + +作者:[Lindsey Thorne][a] +译者:[eriwoon](https://github.com/eriwoon) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/lindsey-thorne +[1]: http://www.greythorn.com/ +[2]: http://conferences.oreilly.com/oscon diff --git a/translated/talk/20160516 Open source from a recruiter's perspective.md b/translated/talk/20160516 Open source from a recruiter's perspective.md deleted file mode 100644 index 200b6ed48c..0000000000 --- a/translated/talk/20160516 Open source from a recruiter's perspective.md +++ /dev/null @@ -1,49 +0,0 @@ -ͷôԴ -============================================ - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BIZ_workplay.png?itok=uQqFssrf) - -2012 ʱҳϯһԴľۻᣬ֮Ҿϲҵ - -ͷܶ꣬ [Greythorn][1] ˾רŴ´ݷƸԼ֮ǰѧϰ˼´ݣǵҲμ [OSCON][2] Դᣬŷ֮ǰѧϰôЧʡOSCON ۼ˷dzˣÿ˶ԸǵĵáԭƷΪϲ - -Һܿʶ˵Դʹһҵ˵һcommunityҲΪʲôرҴӿԴѧĶңرǸЩո̤빤ˡ - -### ΪʲôϲԴߣcontributor -ҵͻ˵һ˵ļȻҪϲԼµĹҪȰԼĹϰ岻Ӱ๤㶼̲סӰࡣ - -ҵĿͻҲʣû¶ʱд𣿡ĶҵǵƷأʲôѽʱԴߵƾͳˣΪǸġĿԴǵҲԴ - -#### ΪʲôͷѰҿԴ - -ӲɿƼҵͷ˽⼼֪ԼһʲôˣͷҲȷ˽ļܡҷ֣ͷҵ˲źܶʱҲԴǾֱȥԴѰǵĿꡣͷǻ߹ҵǸϲŶһ˲IJƷͬҪ - -˵ĿĿǸıδǵЩŶ֮ԼͻᰮԼĹ - -### Դεõõְҵ - -ôĹ׸Ϊ֪أѴŵGithubϣԴĿμӻֵȵȡЩ벻ջġ - -ԳһԼ - -* **ڵĹ˾ǷԴҪ**ܶ˲Ŷǿһ㣬ҲἫǶԹȡ -* **ƷǷڿԴ**ڿԴĹ˾ĻΧ˾ڲͬҲѡְλʱҪǵ⡣ -* **ûر֮ˣ**ȻʱĿŶݻ͵ˣǹͰˡ - -˽Լ׷ô˵Щʺְλͼ򵥶ˣһͷҵϵĹŶӵĻʹˡ - -ȻԼд룬һҴӿԴѧĶҡԴһȺڷɣҺܿҲССһӡ - ------------------------------------------------------------------------------- - -via: https://opensource.com/business/16/5/open-source-recruiters-perspective - -ߣ[Lindsey Thorne][a] -ߣ[eriwoon](https://github.com/eriwoon) -Уԣ[УID](https://github.com/УID) - - [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](https://linux.cn/) Ƴ - -[a]: https://opensource.com/users/lindsey-thorne -[1]: http://www.greythorn.com/ -[2]: http://conferences.oreilly.com/oscon From 2e93258a60db1b6af7436d3de799c11ef611b3a6 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 29 May 2016 17:15:38 +0800 Subject: [PATCH 0828/1469] PUB:20151202 A new Mindcraft moment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @zpl1025 这篇翻译的不错,不过我更想将华盛顿邮报那篇长文翻译过来 /cry --- published/20151202 A new Mindcraft moment.md | 46 +++++++++++++++++++ .../tech/20151202 A new Mindcraft moment.md | 43 ----------------- 2 files changed, 46 insertions(+), 43 deletions(-) create mode 100644 published/20151202 A new Mindcraft moment.md delete mode 100644 translated/tech/20151202 A new Mindcraft moment.md diff --git a/published/20151202 A new Mindcraft moment.md b/published/20151202 A new Mindcraft moment.md new file mode 100644 index 0000000000..cfb240e220 --- /dev/null +++ b/published/20151202 A new Mindcraft moment.md @@ -0,0 +1,46 @@ +又一次 Mindcraft 事件? +======================= + +Linux 内核开发很少吸引像华盛顿邮报这样主流媒体的关注,内核社区在安全方面进展的冗长功能列表就更少人看了。所以当[这样一个专题][1]发布到网上,就吸引了很多人的注意(LCTT 译注:华盛顿邮报发表了一篇很长的[专题文章][2],批评 Linux “没有一个系统性的机制以在骇客之前发现和解决安全问题,或引入更新的防御技术”,“Linux 内核开发社区没有一个首席安全官”等等)。关于这篇文章有不同的反应,很多人认为这是对 Linux 直接的攻击。文章背后的动机很难知道,但是从历史经验来看,它也可以看作对我们早就该前进的方向的一次非常必要的推动。 + +回顾一件昏暗遥远过去的事件 - 确切地说是在 1999 年 4 月。一家叫 Mindcraft 的分析公司发布了一份[报告][3]显示 Windows NT 在 Web 服务器开销方面完胜 Red Hat Linux 5.2 加 Apache。Linux 社区,包括当时还[很年轻的 LWN][4],对此反应很迅速而且强烈。这份报告是微软资助的 FUD 的一部分,用来消除那些全球垄断计划的新兴威胁。报告中所用的 Linux 系统有意配置成低性能,同时选择了当时 Linux 并不能很好支持的硬件,等等。 + +在大家稍微冷静一点后,尽管如此,事实很明显:Mindcraft 的人,不管什么动机,说的也有一定道理。当时 Linux 确实在性能方面存在一些已经被充分认识到的问题。然后社区做了最正确的事情:我们坐下来解决问题。比如,单独唤醒的调度器可以解决接受连接请求时的[惊群问题][5]。其他很多小问题也都解决了。在差不多一年里,内核在这类开销方面的性能已经有了非常大的改善。 + +这份 Mindcraft 的报告,某种意义上来说,往 Linux 屁股上踢了很有必要的一脚,推动整个社区去处理一些当时被忽略的事情。 + +华盛顿邮报的文章明显以负面的看法看待 Linux 内核以及它的贡献者。它随意地混淆了内核问题和其他根本不是内核脆弱性引起的问题(比如,AshleyMadison.com 被黑)。不过供应商没什么兴趣为他们的客户提供安全补丁的事实,就像一头在房间里巨象一样明显。还有谣言说这篇文章后面的黑暗势力希望打击一下 Linux 的势头。这些也许都是真的,但是也不能掩盖一个简单的事实,就是文章说的确实是真的。 + +我们会合理地测试并解决问题。而这些问题,不管是不是安全相关,能很快得到修复,然后再通过稳定更新的机制将这些补丁发布给内核用户。比起外面很多应用程序(自由的和商业的),内核的支持工作做的非常好。但是指责我们解决问题的能力时却遗漏了关键的一点:解决安全问题终究来说是一个打鼹鼠游戏。总是会出来更多的鼹鼠,其中有一些在攻击者发现并利用后很长时间我们都还不知道(所以没法使劲打下去)。尽管 Linux 的商业支持已经非常努力地在将补丁传递给用户,这种问题还是会让我们的用户很受伤 - 只是这并不是故意的。 + +关键是只是解决问题并不够,一些关心安全性的开发者也已经开始尝试做些什么。我们必须认识到,缺陷永远都解决不完,所以要让缺陷更难被发现和利用。这意思就是限制访问内核信息,绝对不允许内核执行用户空间内存中的指令,让内核去侦测整形溢出,以及 [Kee Cook 在十月底内核峰会的讲话][6]中所提出的其他所有事情。其中许多技术被其他操作系统深刻理解并采用了;另外一些需要我们去创新。但是,如果我们想充分保护我们的用户免受攻击,这些改变是必须要做的。 + +为什么内核还没有引入这些技术?华盛顿邮报的文章坚定地指责开发社区,特别是 Linus Torvalds。内核社区的传统就是相对安全性更侧重于性能和功能,在需要牺牲性能来改善内核安全性时并不愿意折衷处理。这些指责一定程度上是对的;好的一面是,因为问题的范围变得清晰,态度看上去有所改善。Kee 的演讲都听进去了,而且很明显让开发者开始思考和讨论这些问题了。 + +而被忽略的一点是,并不仅仅是 Linus 在拒绝有用的安全补丁。而是就没有多少这种补丁在内核社区里流传。特别是,在这个领域工作的开发者就那么些人,而且从没有认真地尝试把自己的工作整合到上游。要合并任何大的侵入性补丁,需要和内核社区一起工作,为这些改动编写用例,将改动分割成方便审核的碎片,处理审核意见,等等。整个过程可能会有点无聊而且让人沮丧,但这却是内核维护的运作方式,而且很明显只有这样才能在长时间的开发中形成更有用更可维护的内核。 + +几乎没有人会走这个流程来将最新的安全技术引入内核。对于这类补丁可能收到的不利反应,有人觉得也许会导致“寒蝉效应”,但是这个说法并不充分:不管最初的反应有多麻烦,多年以来开发者已经合并了大量的改动。而少数安全开发者连试都没试过。 + +他们为什么不愿意尝试?一个比较明显的答案是,几乎没有人会因此拿到报酬。几乎所有引入内核的工作都由付费开发者完成,而且已经持续多年。公司能看到利润的领域在内核里都有大量的工作以及很好的进展。而公司觉得和它们没关系的领域就不会这样了。为实时 Linux 的开发找到赞助支持的困难就是很明显的例子。其他领域,比如文档,也在慢慢萧条。安全性很明显也属于这类领域。可能有很多原因导致 Linux 落后于防御式安全技术,但是其中最关键的一条是,靠 Linux 赚钱的公司没有重视这些技术的开发和应用。 + +有迹象显示局面已有所转变。越来越多的开发人员开始关注安全相关问题,尽管对他们工作的商业支持还仍然不够。对于安全相关的改变已经没有之前那样的下意识反应了。像[内核自我保护项目][7]这样,已经开始把现有的安全技术集成进入内核了。 + +我们还有很长的路要走,但是,如果能有一些支持以及正确的观念,短期内就能有很大的进展。内核社区在确定了自己的想法后可以做到很让人惊叹的事情。幸运的是,华盛顿邮报的文章将有助于提供形成这种想法的必要动力。以历史的角度看,我们很可能会把这次事件看作一个转折点,我们最终被倒逼着去完成之前很明确需要做的事情。Linux 不应该再继续讲述这个安全不合格的故事了。 + +--------------------------- + +via: https://lwn.net/Articles/663474/ + +作者:Jonathan Corbet +译者:[zpl1025](https://github.com/zpl1025) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]: https://lwn.net/Articles/663338/ +[2]:http://www.washingtonpost.com/sf/business/2015/11/05/net-of-insecurity-the-kernel-of-the-argument/ +[3]: http://www.mindcraft.com/whitepapers/nts4rhlinux.html +[4]: https://static.lwn.net/1999/features/MindCraft1.0.php3 +[5]: https://en.wikipedia.org/wiki/Thundering_herd_problem +[6]: https://lwn.net/Articles/662219/ +[7]: https://lwn.net/Articles/663361/ \ No newline at end of file diff --git a/translated/tech/20151202 A new Mindcraft moment.md b/translated/tech/20151202 A new Mindcraft moment.md deleted file mode 100644 index 808124dec2..0000000000 --- a/translated/tech/20151202 A new Mindcraft moment.md +++ /dev/null @@ -1,43 +0,0 @@ -又一次 Mindcraft 事件? -======================= - -感谢:Jonathan Corbet - -Linux 内核开发很少吸引像华盛顿邮报这样主流媒体的关注,内核社区在安全方面进展的冗长功能列表就更少人看了。所以当这样一个功能发布到网上,就吸引了很多人的注意。关于这篇文章有不同的反应,很多人认为这是对 Linux 直接的攻击。文章背后的动机很难知道,但是从历史经验来看,它也可以看作对我们早就该前进的方向的一次非常必要的推动。 - -回顾一次在昏暗遥远过去的事件 - 确切地说是 1999 年 4 月。一家叫 Mindcraft 的分析公司发布了一份报告显示 Windows NT 在服务器开销方面完胜 Red Hat Linux 5.2 加 Apache。Linux 社区,包括当时还很年轻的 LWN,的反应很迅速而且强烈。这份报告是微软资助的 FUD 的一部分,用来消除那些全球垄断计划的新兴威胁。报告指出,Linux 系统有意配置成低性能,Linux 不支持当时的很多硬件,等等。 - -在大家稍微冷静一点后,尽管如此,事实很明显:Mindcraft 的人,不管什么动机,说的也有道理。当时 Linux 确实在性能方面存在一些已经被充分认识到的问题。然后社区做了最正确的事情:我们坐下来解决问题。比如,单独唤醒的调度器可以终结接受连接请求时的惊群问题。其他很多小问题也都解决了。在差不多一年里,内核在这类开销方面的性能已经有了非常大的改善。 - -这份 Mindcraft 的报告,某种意义上来说,往 Linux 背后踢了很有必要的一脚,推动整个社区去处理一些当时被忽略的事情。 - -华盛顿邮报的文章明显在鄙视 Linux 内核以及它的贡献者。它随意地混淆了内核问题和其他根本不是内核脆弱性引起的问题(比如,AshleyMadison.com 被黑)。不过供应商没什么兴趣为他们的客户提供安全补丁的事实,就像一头巨象在房间里跳舞一样明显。还有谣言说这篇文章后面的黑暗势力希望打击一下 Linux 的势头。这些也许都是真的,但是也不能掩盖一个简单的事实,就是文章说的确实是真的。 - -我们会合理地测试并解决问题。而问题,不管是不是安全相关,能很快得到修复,然后再通过稳定更新的机制将这些补丁发布给内核用户。比起外面很多应用程序(免费的和付费的),内核的支持非常好。但是指责我们解决问题的能力时却遗漏了关键的一点:解决安全问题最终是一个打鼹鼠游戏。总是会出来更多的鼹鼠,其中有一些在攻击者发现并利用后很长时间我们都还不知道(所以没法使劲打下去)。尽管商业 Linux 已经非常努力地在将补丁传递给用户,这种问题还是会让我们的用户很受伤 - 只是这并不是故意的。 - -关键是只是解决问题并不够,一些关心安全性的开发者也已经开始尝试。我们必须认识到,问题永远都解不完,所以要让问题更难被发现和利用。意思就是限制访问内核信息,绝对不允许内核执行用户空间内存的指令,指示内核侦测整数溢出,以及 Kee Cook 在十月底内核峰会的讲话中所提出的其他所有事情。其中许多技术被其他操作系统深刻理解并采用了;它们的创新也有我们的功劳。但是,如果我们想充分保护我们的用户免受攻击,这些改变是必须要做的。 - -为什么内核还没有引入这些技术?华盛顿邮报的文章坚定地指责开发社区,特别是 Linus Torvalds。内核社区的传统就是相对安全性更侧重于性能和功能,在需要牺牲性能来改善内核安全性时并不愿意折中处理。这些指责一定程度上是对的;好的一面是,因为问题的范围变得清晰,态度看上去有点改善。Kee 的演讲都听进去了,而且很明显让开发者开始思考和讨论这些问题。 - -而被忽略的一点是,并不仅仅是 Linus 在拒绝有用的安全补丁。而是就没有多少这种补丁在内核社区里流传。特别是,在这个领域工作的开发者就那么些人,而且从没有认真地尝试把自己的工作合并到上游。要合并任何大的侵入性补丁,需要和内核社区一起工作,为改动编写用例,将改动分割成方便审核的碎片,处理审核意见,等等。整个过程可能会有点无聊而且让人沮丧,但这却是内核维护的运作方式,而且很明显只有这样才能在长时间的开发中形成更有用更可维护的内核。 - -几乎没有人会走这个流程来将最新的安全技术引入内核。对于这类补丁可能收到的不利反应,有人觉得也许会导致“寒蝉效应”,但是这个说法并不充分:不管最初的反应有多麻烦,多年以来开发者已经合并了大量的改动。而少数安全开发者连试都没试过。 - -他们为什么不愿意尝试?一个比较明显的答案是,几乎没有人会因此拿到报酬。几乎所有引入内核的工作都由付费开发者完成,而且已经持续多年。公司能看到利润的领域在内核里都有大量的工作以及很好的进展。而公司觉得和它们没关系的领域就不会这样了。为实时开发找到赞助支持的困难就是很明显的例子。其他领域,比如文档,也在慢慢萧条。安全性很明显也属于这类领域。可能有很多原因导致 Linux 落后于防御式安全技术,但是其中最关键的一条是,靠 Linux 赚钱的公司没有重视这些技术的开发和应用。 - -有迹象显示局面已有所转变。越来越多的开发人员开始关注安全相关问题,尽管对他们工作的商业支持还仍然不够。对于安全相关的改变已经没有之前那样的下意识反应了。像内核自我保护项目这样,已经开始把现存的安全技术集成进入内核了。 - -我们还有很长的路要走,但是,如果能有一些支持以及正确的思想,短期内能有很大的进展。内核社区在确定了自己的想法后可以做到很让人惊叹的事情。幸运的是,华盛顿邮报的文章将有助于提供形成这种想法的必要动力。在历史的角度上,我们很可能会把这次事件看作一个转折点,我们最终被倒逼着去完成之前很明确需要做的事情。Linux 不应该再继续讲述这个安全不合格的故事了。 - ---------------------------- - -via: https://lwn.net/Articles/663474/ - -作者:Jonathan Corbet - -译者:[zpl1025](https://github.com/zpl1025) - -校对:[校对者ID](https://github.com/校对者ID) - - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d67730971aaf29524caa9b49f97b5842309f1704 Mon Sep 17 00:00:00 2001 From: robot527 Date: Sun, 29 May 2016 21:31:40 +0800 Subject: [PATCH 0829/1469] Translated 20160218 Linux Systems Patched for Critical glibc Flaw (#4014) deleted: sources/tech/20160218 Linux Systems Patched for Critical glibc Flaw.md new file: translated/tech/20160218 Linux Systems Patched for Critical glibc Flaw.md --- ...Systems Patched for Critical glibc Flaw.md | 52 ------------------- ...Systems Patched for Critical glibc Flaw.md | 50 ++++++++++++++++++ 2 files changed, 50 insertions(+), 52 deletions(-) delete mode 100644 sources/tech/20160218 Linux Systems Patched for Critical glibc Flaw.md create mode 100644 translated/tech/20160218 Linux Systems Patched for Critical glibc Flaw.md diff --git a/sources/tech/20160218 Linux Systems Patched for Critical glibc Flaw.md b/sources/tech/20160218 Linux Systems Patched for Critical glibc Flaw.md deleted file mode 100644 index 18559701b4..0000000000 --- a/sources/tech/20160218 Linux Systems Patched for Critical glibc Flaw.md +++ /dev/null @@ -1,52 +0,0 @@ -robot527 translating - -Linux Systems Patched for Critical glibc Flaw -================================================= - -**Google exposed a critical flaw affecting major Linux distributions. The glibc flaw could have potentially led to remote code execution.** - -Linux users today are scrambling to patch a critical flaw in the core glibc open-source library that could be exposing systems to a remote code execution risk. The glibc vulnerability is identified as CVE-2015-7547 and is titled, "getaddrinfo stack-based buffer overflow." - -The glibc, or GNU C Library, is an open-source implementation of the C and C++ programming language libraries and is part of every major Linux distribution. Google engineers came across the CVE-2015-7547 issue when they were attempting to connect into a certain host system and a segmentation fault (segfault) occurred, causing the connection to crash. Further investigation revealed that glibc was at fault and the crash could potentially achieve an arbitrary remote code execution condition. - -"The glibc DNS client side resolver is vulnerable to a stack-based buffer overflow when the getaddrinfo() library function is used," Google wrote in a blog post. "Software using this function may be exploited with attacker-controlled domain names, attacker-controlled DNS [Domain Name System] servers, or through a man-in-the-middle attack." - -Actually exploiting the CVE-2015-7547 issue is not trivial, but it is possible. To prove that the issue can be exploited, Google has published proof-of-concept (PoC) code on GitHub that demonstrates if an end user or system is vulnerable. - -"The server code triggers the vulnerability and therefore will crash the client code," the GitHub PoC page states. - -Mark Loveless, senior security researcher at Duo Security, explained that the main risk of CVE-2015-7547 is to Linux client-based applications that rely on DNS responses. - -"There are some specific conditions, so not every single application will be impacted, but it appears that several command-line utilities, including the popular SSH [Secure Shell] client could trigger the flaw," Loveless told eWEEK. "We deem this serious mainly because of the existing risks to Linux systems, but also because of the potential for other issues." - -Other issues could potentially include a risk of an email-based attack that triggers the vulnerable glibc getaddrinfo() library call. Also of note is the fact that the vulnerability was in the code for years before it was discovered. - -Google's engineers were not the first or only group to discover the security risk in glibc. The issue was first reported to a glibc bug [tracker](https://sourceware.org/bugzilla/show_bug.cgi?id=1866) on July 13, 2015. The roots of the flaw go back even further with the actual code commit that introduced the flaw first in glibc 2.9, which was released in May 2008. - -Linux vendor Red Hat also independently was looking at the bug in glibc and on Jan. 6, 2016, Google and Red Hat developers confirmed that they had been independently working on the same vulnerability as part of the initial private discussion with upstream glibc maintainers. - -"Once it was confirmed that both teams were working on the same vulnerability, we collaborated on potential fixes, mitigations and regression testing," Florian Weimer, principal software engineer for product security at Red Hat, told eWEEK. "We also worked together to make the test coverage as wide as possible to catch any related problems in the code to help prevent future issues." - -It took years to discover that there was a security issue with the glibc code because that flaw isn't obvious or immediately apparent. - -"To diagnose bugs in a networking component, like a DNS resolver, it is common to look at packet traces which were captured while the issue was encountered," Weimer said. "Such packet captures were not available in this case, so some experimentation was needed to reproduce the exact scenario that triggered the bug." - -Weimer added that once the packet captures were available, considerable effort went into validating the fix, leading to a series of refinements culminating in the regression test suite that was contributed upstream to the glibc project. - -In many cases in Linux, the Security Enhanced Linux (SELinux) mandatory access security controls can mitigate the risk of potential vulnerabilities, but that's not the case with the new glibc issue. - -"The risk is a compromise of important system functionality due to the execution of arbitrary code supplied by an attacker," Weimer said. "A suitable SELinux policy can contain some of the damage an attacker might do and constrain their access to the system, but DNS is used by many applications and system components, so SELinux policies offer only limited containment for this issue." - -Alongside the vulnerability disclosure today, there is now a patch available to mitigate the potential risk of CVE-2015-7547. - ------------------------------------------------------------------------------- - -via: http://www.eweek.com/security/linux-systems-patched-for-critical-glibc-flaw.html - -作者:[Michael Kerner][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://twitter.com/TechJournalist diff --git a/translated/tech/20160218 Linux Systems Patched for Critical glibc Flaw.md b/translated/tech/20160218 Linux Systems Patched for Critical glibc Flaw.md new file mode 100644 index 0000000000..284ac99fa0 --- /dev/null +++ b/translated/tech/20160218 Linux Systems Patched for Critical glibc Flaw.md @@ -0,0 +1,50 @@ +修补 Linux 系统 glibc 严重漏洞 +================================================= + +**谷歌揭露的一个严重漏洞影响主流的 Linux 发行版。glibc 的漏洞可能导致远程代码执行。** + +Linux 用户今天都竞相给一个可以使系统暴露在远程代码执行风险中的核心 glibc 开放源码库的严重漏洞打补丁。glibc 的漏洞被确定为 CVE-2015-7547,题为“getaddrinfo 基于堆栈的缓冲区溢出”。 + +glibc,或 GNU C 库,是一个开放源码的 C 和 C++ 编程语言库的实现,是每一个主流 Linux 发行版的一部分。谷歌工程师们在他们试图连接到某个主机系统时发生了一个段错误导致连接崩溃,偶然发现了 CVE-2015-7547 问题。进一步的研究表明, glibc 有缺陷而且该崩溃可能实现任意远程代码执行的条件。 + +谷歌在一篇博客文章中写道, “当 getaddrinfo() 库函数被使用时,glibc 的 DNS 客户端解析器易受基于堆栈缓冲区溢出的攻击,使用该功能的软件可能被利用为攻击者控制的域名,攻击者控制的 DNS[域名系统] 服务器,或通过中间人攻击。” + +其实利用 CVE-2015-7547 问题并不简单,但它是可能的。为了证明这个问题能被利用,谷歌发布了论证一个终端用户或系统是否易受攻击的概念验证(POC)代码到 GitHub 上。 + +GitHub 上的 POC 网页声明“服务器代码触发漏洞,因此会使客户端代码崩溃”。 + +Duo Security 公司的高级安全研究员 Mark Loveless 解释说 CVE-2015-7547 的主要风险在于 Linux 上依赖于 DNS 响应的基于客户端的应用程序。 + +Loveless 告诉 eWEEK “需要一些特定的条件,所以不是每个应用程序都会受到影响,但似乎一些命令行工具,包括流行的 SSH[安全 Shell] 客户端都可能触发该漏洞,我们认为这是严重的,主要是因为对 Linux 系统存在的风险,但也因为潜在的其他问题。” + +其他问题可能包括一种触发调用易受攻击的 glibc 库 getaddrinfo() 的基于电子邮件攻击的风险。另外值得注意的是,该漏洞被发现之前已存在于代码之中多年。 + +谷歌的工程师不是第一或唯一发现 glibc 中的安全风险的团体。这个问题于 2015 年 7 月 13 日首先被报告给了 glibc 的 bug[跟踪系统](https://sourceware.org/bugzilla/show_bug.cgi?id=1866)。该缺陷的根源可以更进一步追溯到在 2008 五月发布的 glibc 2.9 的代码提交时首次引入缺陷。 + +Linux 厂商红帽也独立找到了 glibc 中的这个 bug,而且在 2016 年 1 月 6 日,谷歌和红帽开发人员证实,他们作为最初与上游 glibc 的维护者私下讨论的部分人员,已经独立在为同一个漏洞工作。 + +红帽产品安全首席软件工程师 Florian Weimer 告诉 eWEEK “一旦确认了两个团队都在为同一个漏洞工作,我们合作进行可能的修复,缓解措施和回归测试,我们还共同努力,使测试覆盖尽可能广,捕捉代码中的任何相关问题,以帮助避免今后更多问题。” + +由于缺陷不明显或不易立即显现,我们花了几年时间才发现 glibc 代码有一个安全问题。 + +Weimer 说“要诊断一个网络组件的漏洞,如 DNS 解析器,当遇到问题时通常要看被抓数据包的踪迹,在这种情况下这样的抓包不适用,所以需要一些实验来重现触发这个 bug 的确切场景。” + +Weimer 补充说,一旦可以抓取数据包,大量精力投入到验证修复程序中,最终导致回归测试套件一系列的改进,有助于上游 glibc 项目。 + +在许多情况下,安全增强式 Linux (SELinux) 的强制访问安全控制可以减少潜在漏洞风险,除了这个 glibc 的新问题。 + +Weimer 说“由于攻击者提供的任意代码的执行,风险是重要系统功能的一个妥协。一个合适的 SELinux 策略可以遏制一些攻击者可能会做的损害,并限制他们访问系统,但是 DNS 被许多应用程序和系统组件使用,所以 SELinux 策略只提供了针对此问题有限的遏制。” + +在揭露漏洞的今天,现在有一个可用的补丁来减少 CVE-2015-7547 的潜在风险。 + +------------------------------------------------------------------------------ + +via: http://www.eweek.com/security/linux-systems-patched-for-critical-glibc-flaw.html + +作者:[Michael Kerner][a] +译者:[robot527](https://github.com/robot527) +校对:[校对者 ID](https://github.com/校对者 ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux 中国](https://linux.cn/) 荣誉推出 + +[a]:https://twitter.com/TechJournalist From 820066b96f0fc195d6b12e8c6f77e582b9fc38c0 Mon Sep 17 00:00:00 2001 From: "Fuliang.Li" Date: Sun, 29 May 2016 23:56:40 +0800 Subject: [PATCH 0830/1469] =?UTF-8?q?=E5=85=88=E6=8F=90=E4=BA=A4=E5=B7=B2?= =?UTF-8?q?=E7=BF=BB=E8=AF=91=E9=83=A8=E5=88=86=EF=BC=8C=E8=A1=A8=E6=98=8E?= =?UTF-8?q?=E8=BF=98=E5=9C=A8=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ng and Linux Filesystem Troubleshooting.md | 46 ++++++++++--------- 1 file changed, 24 insertions(+), 22 deletions(-) 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 65a853bc84..199d65957e 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,52 +1,54 @@ -GHLandy Translating +LFCS 第十讲:学习简单的 Shell 脚本编程和文件系统故障排除 -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. +Linux 基金会发起了 LFCS 认证 (Linux Foundation Certified Sysadmin, Linux 基金会认证系统管理员),这是一个全新的认证体系,主要目标是让全世界任何人都有机会考取认证。认证内容为 Linux 中间系统的管理,主要包括:系统运行和服务的维护、全面监控和分析的能力以及问题来临时何时想上游团队请求帮助的决策能力 ![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 +LFCS 系列第十讲 -Check out the following video that guides you an introduction to the Linux Foundation Certification Program. +请看以下视频,这里边介绍了 Linux 基金会认证程序。 注: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. +本讲是系列教程中的第十讲,主要集中讲解简单的 Shell 脚本编程和文件系统故障排除。这两块内容都是 LFCS 认证中的必备考点。 -### Understanding Terminals and Shells ### +### 理解终端 (Terminals) 和 Shell ### -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. +- Shell 是一个程序,它将命令传递给操作系统来执行。 +- Terminal 也是一个程序,作为最终用户,我们需要使用它与 Shell 来交互。比如,下边的图片是 GNOME Terminal。 ![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. +启动 Shell 之后,会呈现一个命令提示符 (也称为命令行) 提示我们 Shell 已经做好了准备,接受标准输入设备输入的命令,这个标准输入设备通常是键盘。 -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. +你可以参考该系列文章的 [第一讲 使用命令创建、编辑和操作文件][1] 来温习一些常用的命令。 -Linux provides a range of options for shells, the following being the most common: +Linux 为提供了许多可以选用的 Shell,下面列出一些常用的: **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. +Bash 代表 Bourne Again Shell,它是 GNU 项目默认的 Shell。它借鉴了 Korn shell (ksh) 和 C shell (csh) 中有用的特性,并同时对性能进行了提升。它同时也是 LFCS 认证中所涵盖的风发行版中默认 Shell,也是本系列教程将使用的 Shell。 **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 +Bash Shell 是一个比较古老的 shell,一次多年来都是多数类 Unix 系统的默认 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. +**ksh 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. +Korn SHell (ksh shell) 也是一个 Unix shell,是贝尔实验室 (Bell Labs) 的 David Korn 在 19 世纪 80 年代初的时候开发的。它兼容 Bourne shell ,并同时包含了 C shell 中的多数特性。 -### Basic Shell Scripting ### + +一个 shell 脚本仅仅只是一个可执行的文本文件,里边包含一条条可执行命令。 + +### 简单的 Shell 脚本编程 ### 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. @@ -292,7 +294,7 @@ If we’re only interested in finding out what’s wrong (without trying to fix 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. @@ -305,7 +307,7 @@ If you have any questions or comments, they are always welcome – so don’t he via: http://www.tecmint.com/linux-basic-shell-scripting-and-linux-filesystem-troubleshooting/ 作者:[Gabriel Cánepa][a] -译者:[译者ID](https://github.com/译者ID) +译者:[GHLandy](https://github.com/GHLandy) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 9fac016cc2082bfc90d7ab3961961a31aeef9826 Mon Sep 17 00:00:00 2001 From: Bestony Date: Mon, 30 May 2016 21:06:14 +0800 Subject: [PATCH 0831/1469] Translating by Bestony (#4018) --- sources/tech/20160516 Scaling Collaboration in DevOps.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160516 Scaling Collaboration in DevOps.md b/sources/tech/20160516 Scaling Collaboration in DevOps.md index ea1e193b96..bee9ab5415 100644 --- a/sources/tech/20160516 Scaling Collaboration in DevOps.md +++ b/sources/tech/20160516 Scaling Collaboration in DevOps.md @@ -1,3 +1,4 @@ +Translating by Bestony Scaling Collaboration in DevOps ================================= From 5b09fac9f8c711c0cd4374e4fe920eb040796a27 Mon Sep 17 00:00:00 2001 From: Dongliang Mu Date: Mon, 30 May 2016 09:45:04 -0400 Subject: [PATCH 0832/1469] remove useless line (#4017) --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index cfa5aee47e..e68f260b71 100644 --- a/README.md +++ b/README.md @@ -161,7 +161,6 @@ LCTT的组成 - itsang, - JeffDing, - Yuking-net, - - MikeCoder, - zhangboyue, - liaoishere, From c39fc2017e27c25e78b72b32412819067e3de718 Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 30 May 2016 22:08:10 +0800 Subject: [PATCH 0833/1469] =?UTF-8?q?20160530-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...P 2.0 Support for Nginx on Ubuntu 16.04.md | 302 ++++++++++++++++++ 1 file changed, 302 insertions(+) create mode 100644 sources/tech/20160530 Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md diff --git a/sources/tech/20160530 Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md b/sources/tech/20160530 Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md new file mode 100644 index 0000000000..e6b143cc00 --- /dev/null +++ b/sources/tech/20160530 Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md @@ -0,0 +1,302 @@ +Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04 +===================================================================================== + + +The LEMP stack is an acronym which represents is a group of packages (Linux OS, Nginx web server, MySQL\MariaDB database and PHP server-side dynamic programming language) which are used to deploy dynamic web applications and web pages. + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Install-Nginx-with-FastCGI-on-Ubuntu-16.04.png) +>Install Nginx with MariaDB 10, PHP 7 and HTTP 2.0 Support on Ubuntu 16.04 + +This tutorial will guide you on how to install a LEMP stack (Nginx with MariaDB and PHP7) on Ubuntu 16.04 server. + +Requirements + +[Installation of Ubuntu 16.04 Server Edition][1] + +### Step 1: Install the Nginx Web Server + +#### 1. Nginx is a modern and resources efficient web server used to display web pages to visitors on the internet. We’ll start by installing Nginx web server from Ubuntu official repositories by using the [apt command line][2]. + +``` +$ sudo apt-get install nginx +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Install-Nginx-on-Ubuntu-16.04.png) +>Install Nginx on Ubuntu 16.04 + +#### 2. Next, issue the [netstat][3] and [systemctl][4] commands in order to confirm if Nginx is started and binds on port 80. + +``` +$ netstat -tlpn +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Check-Nginx-Network-Port-Connection.png) +>Check Nginx Network Port Connection + +``` +$ sudo systemctl status nginx.service +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Check-Nginx-Service-Status.png) +>Check Nginx Service Status + +Once you have the confirmation that the server is started you can open a browser and navigate to your server IP address or DNS record using HTTP protocol in order to visit Nginx default web page. + +``` +http://IP-Address +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Verify-Nginx-Webpage.png) +>Verify Nginx Webpage + +### Step 2: Enable Nginx HTTP/2.0 Protocol + +#### 3. The HTTP/2.0 protocol which is build by default in the latest release of Nginx binaries on Ubuntu 16.04 works only in conjunction with SSL and promises a huge speed improvement in loading web SSL web pages. + +To enable the protocol in Nginx on Ubuntu 16.04, first navigate to Nginx available sites configuration files and backup the default configuration file by issuing the below command. + +``` +$ cd /etc/nginx/sites-available/ +$ sudo mv default default.backup +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Backup-Nginx-Sites-Configuration-File.png) +>Backup Nginx Sites Configuration File + +#### 4. Then, using a text editor create a new default page with the below instructions: + +``` +server { + listen 443 ssl http2 default_server; + listen [::]:443 ssl http2 default_server; + + root /var/www/html; + + index index.html index.htm index.php; + + server_name 192.168.1.13; + + location / { + try_files $uri $uri/ =404; + } + + ssl_certificate /etc/nginx/ssl/nginx.crt; + ssl_certificate_key /etc/nginx/ssl/nginx.key; + + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + ssl_prefer_server_ciphers on; + ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5; + ssl_dhparam /etc/nginx/ssl/dhparam.pem; + ssl_session_cache shared:SSL:20m; + ssl_session_timeout 180m; + resolver 8.8.8.8 8.8.4.4; + add_header Strict-Transport-Security "max-age=31536000; + #includeSubDomains" always; + + + location ~ \.php$ { + include snippets/fastcgi-php.conf; + fastcgi_pass unix:/run/php/php7.0-fpm.sock; + } + + location ~ /\.ht { + deny all; + } + +} + +server { + listen 80; + listen [::]:80; + server_name 192.168.1.13; + return 301 https://$server_name$request_uri; +} +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Enable-Nginx-HTTP-2-Protocol.png) +>Enable Nginx HTTP 2 Protocol + +The above configuration snippet enables the use of `HTTP/2.0` by adding the http2 parameter to all SSL listen directives. + +Also, the last part of the excerpt enclosed in server directive is used to redirect all non-SSL traffic to SSL/TLS default host. Also, replace the `server_name` directive to match your own IP address or DNS record (FQDN preferably). + +#### 5. Once you finished editing Nginx default configuration file with the above settings, generate and list the SSL certificate file and key by executing the below commands. + +Fill the certificate with your own custom settings and pay attention to Common Name setting to match your DNS FQDN record or your server IP address that will be used to access the web page. + +``` +$ sudo mkdir /etc/nginx/ssl +$ sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/ssl/nginx.key -out /etc/nginx/ssl/nginx.crt +$ ls /etc/nginx/ssl/ +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Generate-SSL-Certificate-and-Key.png) +>Generate SSL Certificate and Key for Nginx + +#### 6. Also, create a strong DH cypher, which was changed on the above configuration file on `ssl_dhparam` instruction line, by issuing the below command: + +``` +$ sudo openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Create-Diffie-Hellman-Key.png) +>Create Diffie-Hellman Key + +#### 7. Once the `Diffie-Hellman` key has been created, verify if Nginx configuration file is correctly written and can be applied by Nginx web server and restart the daemon to reflect changes by running the below commands. + +``` +$ sudo nginx -t +$ sudo systemctl restart nginx.service +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Check-Nginx-Configuration.png) +>Check Nginx Configuration + +#### 8. In order to test if Nginx uses HTTP/2.0 protocol issue the below command. The presence of `h2` advertised protocol confirms that Nginx has been successfully configured to use HTTP/2.0 protocol. All modern up-to-date browsers should support this protocol by default. + +``` +$ openssl s_client -connect localhost:443 -nextprotoneg '' +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Test-Nginx-HTTP-2-Protocol.png) +>Test Nginx HTTP 2.0 Protocol + +### Step 3: Install PHP 7 Interpreter + +Nginx can be used with PHP dynamic processing language interpreter to generate dynamic web content with the help of FastCGI process manager obtained by installing the php-fpm binary package from Ubuntu official repositories. + +#### 9. In order to grab PHP7.0 and the additional packages that will allow PHP to communicate with Nginx web server issue the below command on your server console: + +``` +$ sudo apt install php7.0 php7.0-fpm +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Install-PHP-7-PHP-FPM-for-Ngin.png) +>Install PHP 7 and PHP-FPM for Ngin + +#### 10. Once the PHP7.0 interpreter has been successfully installed on your machine, start and check php7.0-fpm daemon by issuing the below command: + +``` +$ sudo systemctl start php7.0-fpm +$ sudo systemctl status php7.0-fpm +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Start-Verify-php-fpm-Service.png) +>Start and Verify php-fpm Service + +#### 11. The current configuration file of Nginx is already configured to use PHP FastCGI process manager in order to server dynamic content. + +The server block that enables Nginx to use PHP interpreter is presented on the below excerpt, so no further modifications of default Nginx configuration file are required. + +``` +location ~ \.php$ { + include snippets/fastcgi-php.conf; + fastcgi_pass unix:/run/php/php7.0-fpm.sock; + } +``` + +Below is a screenshot of what instructions you need to uncomment and modify is case of an original Nginx default configuration file. + + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Enable-PHP-FastCGI-for-Nginx.png) +>Enable PHP FastCGI for Nginx + +#### 12. To test Nginx web server relation with PHP FastCGI process manager create a PHP `info.php` test configuration file by issuing the below command and verify the settings by visiting this configuration file using the below address: `http://IP_or domain/info.php`. + +``` +$ sudo su -c 'echo "" |tee /var/www/html/info.php' +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Create-PHP-Info-File.png) +>Create PHP Info File + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Verify-PHP-FastCGI-Info.png) +>Verify PHP FastCGI Info + +Also check if HTTP/2.0 protocol is advertised by the server by locating the line `$_SERVER[‘SERVER_PROTOCOL’]` on PHP Variables block as illustrated on the below screenshot. + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Check-HTTP-2.0-Protocol-Info.png) +>Check HTTP 2.0 Protocol Info + +#### 13. In order to install extra PHP7.0 modules use the `apt search php7.0` command to find a PHP module and install it. + +Also, try to install the following PHP modules which can come in handy in case you are planning to [install WordPress][5] or other CMS. + +``` +$ sudo apt install php7.0-mcrypt php7.0-mbstring +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Install-PHP-7-Modules.png) +>Install PHP 7 Modules + +#### 14. To register the PHP extra modules just restart PHP-FPM daemon by issuing the below command. + +``` +$ sudo systemctl restart php7.0-fpm.service +``` + +### Step 4: Install MariaDB Database + +#### 15. Finally, in order to complete our LEMP stack we need the MariaDB database component to store and manage website data. + +Install MariaDB database management system by running the below command and restart PHP-FPM service in order to use MySQL module to access the database. + +``` +$ sudo apt install mariadb-server mariadb-client php7.0-mysql +$ sudo systemctl restart php7.0-fpm.service +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Install-MariaDB-for-Nginx.png) +>Install MariaDB for Nginx + +#### 16. To secure the MariaDB installation, run the security script provided by the binary package from Ubuntu repositories which will ask you set a root password, remove anonymous users, disable root login remotely and remove test database. + +Run the script by issuing the below command and answer all questions with yes. Use the below screenshot as a guide. + +``` +$ sudo mysql_secure_installation +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Secure-MariaDB-Installation-for-Nginx.png) +>Secure MariaDB Installation for Nginx + +#### 17. To configure MariaDB so that ordinary users can access the database without system sudo privileges, go to MySQL command line interface with root privileges and run the below commands on MySQL interpreter: + +``` +$ sudo mysql +MariaDB> use mysql; +MariaDB> update user set plugin=’‘ where User=’root’; +MariaDB> flush privileges; +MariaDB> exit +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/MariaDB-User-Permissions.png) +>MariaDB User Permissions + +Finally, login to MariaDB database and run an arbitrary command without root privileges by executing the below command: + +``` +$ mysql -u root -p -e 'show databases' +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Check-MariaDB-Databases.png) +>Check MariaDB Databases + +That’ all! Now you have a **LEMP** stack configured on **Ubuntu 16.04** server that allows you to deploy complex dynamic web applications that can interact with databases. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/install-nginx-mariadb-php7-http2-on-ubuntu-16-04/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tecmint+%28Tecmint%3A+Linux+Howto%27s+Guide%29 + +作者:[Matei Cezar ][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.tecmint.com/author/cezarmatei/ +[1]: http://www.tecmint.com/installation-of-ubuntu-16-04-server-edition/ +[2]: http://www.tecmint.com/apt-advanced-package-command-examples-in-ubuntu/ +[3]: http://www.tecmint.com/20-netstat-commands-for-linux-network-management/ +[4]: http://www.tecmint.com/manage-services-using-systemd-and-systemctl-in-linux/ +[5]: http://www.tecmint.com/install-wordpress-using-lamp-or-lemp-on-rhel-centos-fedora/ From cae29dd5f6ab8ec7891e7fdedb391385852fd947 Mon Sep 17 00:00:00 2001 From: Dongliang Mu Date: Mon, 30 May 2016 11:21:20 -0400 Subject: [PATCH 0834/1469] proofread Linux File Permission (#4019) --- ... Getting to Know Linux File Permissions.md | 68 ++++++++----------- 1 file changed, 28 insertions(+), 40 deletions(-) diff --git a/translated/tech/20160218 Getting to Know Linux File Permissions.md b/translated/tech/20160218 Getting to Know Linux File Permissions.md index b38cef6f32..2730806d61 100644 --- a/translated/tech/20160218 Getting to Know Linux File Permissions.md +++ b/translated/tech/20160218 Getting to Know Linux File Permissions.md @@ -1,16 +1,15 @@ 初识Linux文件权限 ================================================================================ +在 Linux 中最基本的任务之一就是设置文件权限。理解如何实现是你进入 LInux 世界的第一步。如您所料,这一基本操作在类 UNIX 操作系统中大同小异。实际上,Linux 文件权限系统就直接取自于 UNIX 文件权限(甚至使用许多相同的工具)。 + ![](http://www.linux.com/images/stories/66866/files_a.png) -在Linux中最基本的任务就是设置文件权限。理解如何实现是你进入LInux世界的第一步。如您所料,这一基本操作在类UNIX操作系统中大同小异。 -实际上,Linux文件权限系统就直接取自UNIX文件权限(甚至使用许多相同的工具)。 - -但不要以为在学习第二种文件权限系统的时候你需要再次一点一点的学起。事实上会很简单,让我们一起来看看你需要了解哪些内容以及如何使用它们。 +但不要以为理解文件权限需要长时间的学习。事实上会很简单,让我们一起来看看你需要了解哪些内容以及如何使用它们。 ##基础概念 -首先你要知道文件权限适用于什么,如何有效的设置一个分组的权限。当你将其分解,那这个概念就真的简单多了。那到底什么是权限什么是分组呢。 +你要明白的第一件事是文件权限适用于什么。你做的更有效的就是设置一个分组的权限。当你将其分解,那这个概念就真的简单多了。那到底什么是权限,什么是分组呢? 你可以设置的3种权限: @@ -20,32 +19,31 @@ - 执行 — 允许该组执行(运行)文件(用`x`表示) -为了更好的解释为何是应用于一个分组,你可是尝试允许一个分组读和写一个文件,但不能执行。或者你可以允许一个组读和执行一个文件,但不能写。 -甚至你可以允许一组有读、写、执行全部的权限,也可以删除全部权限。 +为了更好地解释这如何应用于一个分组,例如,你允许一个分组读和写一个文件,但不能执行。或者,你可以允许一个组读和执行一个文件,但不能写。甚至你可以允许一组有读、写、执行全部的权限,也可以删除全部权限来剥夺组权限。 -什么是分组呢,有以下4个: +现在,什么是分组呢,有以下4个: - user — 文件实际的拥有者 - group — 用户所在的组 -- others — 用户组内的其他用户 +- others — 用户组外的其他用户 - all — 所有用户 -大多数情况,你只会对前3组进行操作,all这一组只是作为快捷方式(稍后我会解释)。 +大多数情况,你只会对前3组进行操作,`all` 这一组只是作为快捷方式(稍后我会解释)。 到目前为止很简单,对吧?接下来我们将深入一层。 -如果你打开一个终端并运行命令 ls -l ,你将会看到逐行列出当前工作目录下所有的文件和文件夹的列表(如图1). +如果你打开一个终端并运行命令 `ls -l`,你将会看到逐行列出当前工作目录下所有的文件和文件夹的列表(如图1). -你会留意到最左边那列是像·-rw-rw-r--·这样的。 +你会留意到最左边那列是像 `-rw-rw-r--` 这样的。 实际上这列表该这样看的: >rw- rw- r-- -将其分为如下3部分: +正如你所见,列表将其分为如下3部分: - rw- @@ -55,11 +53,11 @@ 权限和组的顺序都很重要,顺序总是: -- 用户 组 其他 — 分组 +- 所属者 所属组 其他人 — 分组 -- 读 写 操作 — 权限 +- 读 写 执行 — 权限 -在我们上面示例的权限列表中,用户拥有读/写权限,用户组拥有读/写权限,其他用户仅拥有读权限。这些分组中赋予执行权限的话,就用一个x表示。 +在我们上面示例的权限列表中,所属者拥有读/写权限,所属组拥有读/写权限,其他人用户仅拥有读权限。这些分组中赋予执行权限的话,就用一个x表示。 ## 等效数值 @@ -75,8 +73,7 @@ >-42-42-4-- -你该把每个分组的数值相加,给用户读和写权限,你该用4 + 2 得到6。给用户组相同的权限,也是使用相同的数值。假如你只想给其他用户读的权限, -那就设置它为4。现在用数只表示为: +你该把每个分组的数值相加,给用户读和写权限,你该用 4 + 2 得到 6。给用户组相同的权限,也是使用相同的数值。假如你只想给其他用户读的权限,那就设置它为4。现在用数值表示为: >664 @@ -84,27 +81,24 @@ >chmod 664 FILENAME -FILENAME处为文件名。 +FILENAME 处为文件名。 ## 更改权限 -既然你已经理解了文件权限,那是时候学习如何更改这些权限了。就是使用chmod命令来实现。第一步你要知道你能否更改文件权限, -你必须是文件的所有者或者有权限编辑文件(或者使用su或sudo进行操作)。正因为这样,你不能随意切换目录和更改文件权限。 +既然你已经理解了文件权限,那是时候学习如何更改这些权限了。就是使用chmod命令来实现。第一步你要知道你能否更改文件权限,你必须是文件的所有者或者有权限编辑文件(或者使用su或sudo进行操作)。正因为这样,你不能随意切换目录和更改文件权限。 - -继续用我们的例子(`-rw-rw-r--`),假设这个文件(命名为script.sh)实际是个shell脚本,需要执行。但是你你只想让自己有权限执行这个脚本。 -这个时候,你可能会想:“我需要是文件的权限如`-rwx-rw-r--`这样来设置`x`”。实际你可以这样使用chmod命令: +继续用我们的例子 (`-rw-rw-r--`)。假设这个文件(命名为 script.sh)实际是个shell脚本,需要被执行,但是你只想让自己有权限执行这个脚本。这个时候,你可能会想:“我需要是文件的权限如 `-rwx-rw-r--`”。为了设置 `x` 权限位,你可以这样使用 `chmod` 命令: >chmod u+x script.sh 这时候,列表中显示的应该是 -rwx-rw-r-- 。 -如果你想同时让用户及其所在组同时拥有执行权限,命令应该这样: +如果你想同时让用户及其所属组同时拥有执行权限,命令应该这样: >chmod ug+x script.sh +明白这是怎么工作的了吗?下面我们让它更有趣些。不管什么原因,你不小心给了所有分组对文件的执行权限(列表中是这样的 `-rwx-rwx-r-x`)。 -明白这是怎么工作的了,下面我们让它更有趣些。不管什么原因,你不小心给了所有分组对文件的执行权限(列表中是这样的 `-rwx-rwx-r-x` )。 如果你想去除其他用户的执行权限,只需运行命令: >chmod o-x script.sh @@ -117,35 +111,29 @@ FILENAME处为文件名。 >chmod a-x script.sh -以上就是所有内容,能使操作更有效率。我希望能避免哪些可能会导致一些问题的操作(例如你不小心对script.sh使用`a-rwx`这样的chmod命令)。 +以上就是所有内容,能使操作更有效率。我希望能避免哪些可能会导致一些问题的操作(例如你不小心对 script.sh 使用 `a-rwx` 这样的chmod命令)。 ## 目录权限 -You can also execute the chmod command on a directory. When you create a new directory as a user, it is typically created with the following permissions: -你也可以对一个目录执行chmod命令,当你创建一个新的目录,通常新建目录具有这样的权限: +你也可以对一个目录执行 `chmod` 命令。当你作为用户创建一个新的目录,通常新建目录具有这样的权限: >drwxrwxr-x -注:开头的d表示这是一个目录。 +注:开头的 `d` 表示这是一个目录。 -正如你所见,用户及其所在组都对文件夹具有操作权限,但这并不意味着在这文件夹中出创建的问价也具有与其相同的权限 -(创建的文件使用默认系统的权限`-rw-rw-r--`)。但如果你想在新文件夹中创建文件,并且移除用户组的写权限, -你不用切换到该目录下并对所有文件使用chmod命令。你可以用加上参数R(意味着递归)的chmod命令,同时更改该文件夹及其目录下所有的文件的权限。 +正如你所见,用户及其所在组都对文件夹具有操作权限,但这并不意味着在这文件夹中出创建的问价也具有与其相同的权限(创建的文件使用默认系统的权限 `-rw-rw-r--`)。但如果你想在新文件夹中创建文件,并且移除用户组的写权限,你不用切换到该目录下并对所有文件使用chmod命令。你可以用加上参数R(意味着递归)的 `chmod` 命令,同时更改该文件夹及其目录下所有的文件的权限。 -现在,假设有一文件夹TEST,里面有一些脚本,所有这些(包括TEST文件夹)拥有权限`-rwxrwxr-x`。如果你想移除用户组的写权限, -你可以运行命令: +现在,假设有一文件夹 TEST,里面有一些脚本,所有这些(包括 TEST 文件夹)拥有权限 `-rwxrwxr-x`。如果你想移除用户组的写权限,你可以运行命令: >chmod -R g-w TEST -运行命令`ls -l`,你讲看到列出的TEST文件夹的权限信息是`drwxr-xr-x`。用户组被去除了写权限(其目录下的所有文件也如此)。 +运行命令 `ls -l`,你讲看到列出的 TEST 文件夹的权限信息是 `drwxr-xr-x`。用户组被去除了写权限(其目录下的所有文件也如此)。 ## 总结 -现在,你应该对基本的Linux文件权限有了深入的理解。对于更高级的东西学起来会很轻松,像setid,setuid和ACLs这些。没有良好的基础, -你很快就会混淆不清概念的。 - -Linux文件权限从早期到现在没有太大变化,而且很可能以后也不会。 +现在,你应该对基本的Linux文件权限有了深入的理解。对于更高级的东西学起来会很轻松,像`setid`,`setuid` 和 `ACLs` 这些。没有良好的基础,你很快就会混淆不清概念的。 +Linux 文件权限从早期到现在没有太大变化,而且很可能以后也不会。 ------------------------------------------------------------------------------ From cf2189c02a83424959740c34a137c2376426c575 Mon Sep 17 00:00:00 2001 From: mudongliang Date: Mon, 30 May 2016 11:41:30 -0400 Subject: [PATCH 0835/1469] proofread add open source experience to your resume --- ...d open source experience to your resume.md | 88 ++++++++++++------- 1 file changed, 57 insertions(+), 31 deletions(-) diff --git a/translated/tech/20160225 How to add open source experience to your resume.md b/translated/tech/20160225 How to add open source experience to your resume.md index 234038f878..3a990bc074 100644 --- a/translated/tech/20160225 How to add open source experience to your resume.md +++ b/translated/tech/20160225 How to add open source experience to your resume.md @@ -1,49 +1,75 @@ 怎样将开源经历添加到你的简历中去 ================================================== ![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/lightning-test.png?itok=aMceg0Vg) -在这篇文章中,我将会分享我的一些方法,目的是让你因为曾经为开源事业作出贡献的经历使得你在技术领域的求职中脱颖而出。 -凡事预则立,不预则废。在你即将进入一个新的领域或者正准备花费整个晚上来彻底完善你的简历之前,先来定义你正在寻找的工作的特征是值得的。你的简历是一张有说服力的作品,因此你必须了解你的观众,从而让它发挥出所有的潜力。看你简历的可能是任何需要你的技能并且恰好能在预算之内聘用你的人。当编辑简历的时候,读一读你的简历上的内容,同时想象一下它们最应该被书写的位置。你看起来像是一个你将会聘用的候选人吗? -在我看来,我发现对于我所要求的目标职位的所有理想候选人,针对他们每个人的特点列出一张清单有时候是很有帮助的。我将他们每个人的特点清单合并到他们的个人经历中,并阅读工作记录,然后以同样的角色询问同事们。人际关系网和会议是很好的地方去寻求一些乐意提供这种建议的人。一些人喜欢谈论他们自己,并且邀请他们去讲述他们自己的故事的一部分来帮助你去拓展你的知识面,通过这样方式可以使每个人感觉更好。当你和其他人谈论他们的职业路线时,你不仅将会明白怎样去得到你想要从事的工作,而且还能知道你应该避免哪些容易让你失去工作机会的情况和行为。 -例如,对于一个差劲的角色,有关于他的关键特性列表可能看起来像下面这样: +在这篇文章中,我将会分享我的技术,让大家利用开源贡献在技术领域的求职中脱颖而出,成为强有力的候选者。 + +凡事预则立,不预则废。在你即将进入一个新的领域或者正准备熬夜彻查你的简历之前,清楚定义你正在寻找的工作的特征是值得的。你的简历是一部有说服力的作品,因此你必须了解你的观众,从而让它发挥出所有的潜力。看你简历的可能是任何需要你的技能并且能在预算之内聘用你的人。当编辑简历的时候,读一读你的简历上的内容,同时想象一下,以他们的角度怎么看待这份简历。你看起来像是一个你将会聘用的候选人吗? + +我个人认为,对于目标职位的理想候选人所表现出来的关键特征,列出一张清单是很有帮助的。我从个人经历,如阅读工作帖、询问相同角色的同事,的组合中收集这个列表。LinkedIn 和会议是很好的地方去寻求一些乐意提供这种建议的人。一些人喜欢谈论他们自己,并且邀请他们去讲述他们自己故事的一部分来帮助你去拓展你的知识面,通过这样方式可以使每个人感觉更好。当你和其他人谈论他们的职业路线时,你不仅将会明白怎样去得到你想要从事的工作,而且还能知道你应该避免那些容易让你失去工作机会的特征或行为。 + +例如,对于一个低级角色,他的关键特征列表可能如下所示: + ###技术: -- 拥有计算机从业方面的经验,更加容易受到Jenkins的青睐。 -- 深厚的脚本编写背景,如Python和Ruby -- 精通eclipse的使用 -- 基本的git和bash知识 + +- 拥有 CI(Continuous Integration) 方面的经验,特别是 Jenkins +- 深厚的脚本编写背景,如 Python 和 Ruby +- 精通 Eclipse IDE +- 基本的 Git 和 Bash 知识 + ###个人而言: + - 自我学习者 -- 良好的交流和文档技巧 +- 良好的交流和文档技 - 在团队开发方面富有经验 -- 精通事件捕捉工作流 +- 精通事件跟踪工作流 (issue tracker workflow) + ###以任意方式应用 -记住,你没有必要为了得到一份工作而去满足上面的工作描述列表中列出的每个标准。工作细节描述了任何人都可以离开这个角色,如果你已经知道你即将签约并为之工作几年的公司的全部信息,并且这份工作并不会让你觉得有什么挑战性,或者要求你去拓展你你的技能。如果你对你无法满足清单上的技能列表而感到紧张,那么检查一下自己是否有来自其他经历并能与之媲美的技能。 -例如,即使有些人从来没有使用过Jenkins,那他也可能从之前使用过Buildbot或者travis CI的项目经验中明白持续集成测试的原则。 -如果你正在申请一家大型公司,而他们可能拥有一个专门的部门和一套完整的筛选过程来确保他们不会聘用任何不能胜任职位的候选人。也就是说,在你求职的过程中,你所能做的只是提交申请,而决定是否拒绝你是公司管理层的工作。不要过早的将工作拒之门外。 -现在你已经知道了你的任务是什么,并且还知道你将需要哪些技能去完成这次面试。下一步要做的取决与你已经获取到的经验。 + +记住,你没有必要为了得到一份工作而去满足上面的工作描述列表中列出的每个标准。 + +工作细节描述了任何人都可以离开这个角色,如果你已经知道你即将签约并为之工作几年的公司的全部信息,并且这份工作并不会让你觉得有什么挑战性,或者要求你去拓展你你的技能。如果你对你无法满足清单上的技能列表而感到紧张,那么检查一下自己是否有来自其他经历并能与之媲美的技能。例如,即使有些人从来没有使用过 Jenkins,那他也可能从之前使用过 Buildbot 或者 travis CI 的项目经验中明白持续集成测试的原则。 + +如果你正在申请一家大型公司,他们可能拥有一个专门的部门和一套完整的筛选过程来确保他们不会聘用任何不能胜任职位的候选人。也就是说,在你求职的过程中,你所能做的只是提交申请,而决定是否拒绝你是公司管理层的工作。不要过早地将工作拒之门外。 + +现在你已经知道了你的任务是什么,并且还知道你需要的技能让面试官印象深刻。下一步要做的取决与你已经获取到的经验。 + ### 制造已经存在的事物之间的关联 -列出一张你过去几年曾经参与过的所有项目。下面是一条快速得到这张清单的方式,生成一个跳转到你的github上的库的导航器,但是需要过滤掉你从其他地方复制过来的项目。除此之外,检查下你的清单上是否有曾经处于领导地位的项目。如果你已经有了一份简历,那么请确保你已经将你所有的经历都列在了上面。 -考虑下任何一个你曾经作为一个潜在的领导经历并拥有过特权的IRC项目。检查你的会唔和聚会并将你曾经组织过或者作为志愿者参与过的事情添加到你的清单上面。略过你前几年的日程并且标注所有志愿行动或者有作为导师的经历又或者有接触过的公共演讲. -现在进入了比较艰难的环节了,将清单上列出的必备技能与个人经历列表上的内容一一对照,我喜欢给工作需要的每个特性用一个字母或者数字作为标记,然后在每一段你经历或参与过并表现出了某一特性的地方标记相同的符号。当你产生怀疑的时候,无论如何也要加上它,尽管这样做更像是在吹嘘,但也好过显示出你的无能。 -在我们写简历的时候常常被这样的情况所困扰,就是我们不愿冒着过分吹嘘自己的技能的风险。这通常会帮助我们重新考虑这个问题,比如我们会考虑那些组织了会晤的人会表现出更好的领导才能和计划技巧吗?而不是当我组织这个会晤的时候我是否展示出了这些技巧。 + +列出一张你过去几年曾经参与过的所有项目。下面是一条快速得到这张清单的方法,跳转到你的 Github profile 中的**库**标签页,并且过滤掉 fork 过来的项目。除此之外,检查下你的清单上是否有曾经处于领导地位的项目。如果你已经有了一份简历,那么请确保你已经将你所有的经历都列在了上面。 + +考虑下任何一个你曾经作为一个潜在的领导经历并拥有过特权的 IRC 频道。检查你的 Meetup 和Eventbrite 账号,并将你曾经组织过或者作为志愿者参与过的活动添加到你的清单上。浏览你前几年的日程并且标注所有志愿服务,或者有作为导师的经历,又或者参与过的公共演讲。 + +现在进入了比较艰难的环节了,将清单上列出的必备技能与个人经历列表上的内容一一对照,我喜欢给工作需要的每个特征用一个字母或者数字作为标记,然后在每一段你经历或参与过并表现出了某一特征的地方标记相同的符号。当你产生怀疑的时候,无论如何也要加上它,尽管这样做更像是在吹嘘,但也好过显示出你的无能。 + +在我们写简历的时候常常被这样的情况所困扰,就是我们不愿冒着过分吹嘘自己的技能的风险。这通常会帮助我们重新考虑这个问题,“我们会考虑那些组织了会晤的人会表现出更好的领导才能和计划技巧吗?”,而不是“当我组织这个会晤的时候我是否展示出了这些技巧?”。 + 如果你已经充分了解了你在过去的几年里的业余时间都是怎么度过的或者你写了很多代码,那么你可能现在正面临着一个令人奇怪的问题,你已经拥有了太多的经验以至于一张纸的简历已经无法容纳下这些经验了。那么,如果那些列在你的清单上的经验无法证明你尝试去表现的任何技能的话,那么请扔掉它们吧。如果这份已经被缩短的简历清单上的内容仍然超过一张单页纸的容量的话,那么将你的经验按照一定的优先级排序,例如根据你获得了相关的故事或丰富的经验与所需的技术。 -在这一方面,显而易见,如果你想要磨练一个独特的技能,那么你就需要一个不错的经历。考虑使用一个类似OpenHatch的问题聚合器,并用它来寻找一个通过使用你从没使用过的工具和技术来锻炼你的技能的开源项目。 -让你的简历更加漂亮 -一份简历是否美观取决于它的简洁度,清晰度和布局。每一段经历都应该通过足够的信息来展示给读者并让他们立刻就能明白为什么你要将它包含进去,而且恰到好处。每种类型的信息都应该使用一致的文档格式来表示,一份含有斜体格式或者右对齐格式的或者其他与整体风格不协调的数据绝对会让看的人十分反感。 -使用工具来给你的简历排版会使之前设定的目标更加容易实现。我喜欢使用LaTeX,因为它 -的宏系统能够使可视化一致性变得更加容易,并且大量的面试官都能一眼就认出他。你的工具的选择可能是LibreOffice或者HTML,这取决于你的技能和你希望怎样去发布你的简历。 -记住一点,一份以数字方式提交的简历可以通过关键字被浏览到。因此,当你需要描述你的工作经历的时候使用和工作招聘告示一样的英文缩写对你的求职会有很大的帮助。为了让你的简历更加容易被面试官所使用,首先就要放上最重要的信息。 -程序员通常难以在为文档排版时量化平衡和布局。我最喜欢的技术是回退并评估我的文档的空格是否处于正确的位置,而这样做的目的就是我的PDF可以全屏显示或者打印出来,然后 -在镜像里面查看它。如果你正在使用LibreOffice Writer,保存一份你的简历的副本,然后将你的简历中的字体换成一种你无法阅读的语言。这两种技术都强制将你从阅读的内容中脱离出来,让你以一种新的方式查看文档的整体布局。他们把你从一个”那句话措辞不当!”对注意到的事物的批评,比如“在这条线上只有一个字,看起来很有趣”。 -最后,再次检查你的简历是否在它将要的展示的多媒体上看起来完全正确。如果你以网页的形式发布它,那么在不同屏幕大小的浏览器中测试它的效果。如果它是一份PDF文档,那么在你的手机或者你的朋友的电脑上面打开它,并确保它所需要的字体都是可用的。 -接下来的步骤 -最后,不要让你辛苦做出来的简历被浪费了,利用你的LinkedIn帐号把它做成一个镜像。当招聘人员找到你的时候也不要感到奇怪。尽管他们描述的工作内容并不是恰好适合你,但是你可以利用他们的时间和兴趣来得到关于你的简历中有哪些地方好与不好的反馈信息。 + +在这一方面,显而易见,如果你想要磨练一个独特的技能,那么你就需要一个不错的经历。考虑使用一个类似 OpenHatch 的问题聚合器,并用它来寻找一个通过使用你从没使用过的工具和技术来锻炼你的技能的开源项目。 + +### 让你的简历更加漂亮 + +一份简历是否美观取决于它的简洁度,清晰度和布局。每一段经历都应该通过足够的信息来展示给读者,并让他们立刻明白为什么你要将它包含进去,而且恰到好处。每种类型的信息都应该使用一致的文档格式来表示,一份含有斜体格式或者右对齐格式的或者其他与整体风格不协调的数据绝对会让人分心。 + +使用工具来给你的简历排版会使之前设定的目标更加容易实现。我喜欢使用 [LaTeX][5],因为它 +的宏系统能够使可视化一致性变得更加容易,并且大量的面试官都能一眼就认出它。你的工具的选择可能是 LibreOffice 或者 HTML,这取决于你的技能和你希望怎样去发布你的简历。 + +记住一点,一份以电子方式提交的简历可以通过关键字被浏览到。因此,当你需要描述你的工作经历的时候使用和工作招聘告示一样的英文缩写对你的求职会有很大的帮助。为了让你的简历更加容易被面试官所使用,首先就要放上最重要的信息。 + +程序员通常难以在为文档排版时量化平衡和布局。我最喜欢的回退和评估我的文档的空格是否处于正确的位置技术,就是全屏显示我的PDF或者打印出来,然后在镜像里面查看它。如果你正在使用 LibreOffice Writer,保存一份你的简历的副本,然后将你的简历中的字体换成一种你无法阅读的语言。这两种技术都强制将你从阅读的内容中脱离出来,让你以一种新的方式查看文档的整体布局。他们把你从一个“那句话措辞不当!”这样的批评到注意到,如“在这条线上只有一个字,看起来很有趣”之类的事情。 + +最后,再次检查你的简历是否在它将要的展示的多媒体上看起来完全正确。如果你以网页的形式发布它,那么在不同屏幕大小的浏览器中测试它的效果。如果它是一份 PDF 文档,那么在你的手机或者你的朋友的电脑上面打开它,并确保它所需要的字体都是可用的。 + +###接下来的步骤 + +最后,不要让你辛苦做出来的简历内容浪费了,利用你的 LinkedIn 帐号把它做成一个镜像(完全使用招聘公告中的流行词),同时当招聘人员找到你的时候也不要感到奇怪。尽管他们描述的工作内容并不是恰好适合你,但是你可以利用他们的时间和兴趣来得到关于你的简历中有哪些地方好与不好的反馈信息。 -------------------------------------------------------------------------------- via: https://opensource.com/business/16/2/add-open-source-to-your-resume 作者:[edunham][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[pengkai](https://github.com/pengkai) +校对:[mudongliang](https://github.com/mudongliang) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 214fd7f68c9e11be432789fa5127530cece0048c Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 31 May 2016 08:19:53 +0800 Subject: [PATCH 0836/1469] PUB:20160301 Linux gives me all the tools I need MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @StdioA 翻译的很好,校对很轻松~ --- .../20160301 Linux gives me all the tools I need.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk/my-open-source-story => published}/20160301 Linux gives me all the tools I need.md (92%) diff --git a/translated/talk/my-open-source-story/20160301 Linux gives me all the tools I need.md b/published/20160301 Linux gives me all the tools I need.md similarity index 92% rename from translated/talk/my-open-source-story/20160301 Linux gives me all the tools I need.md rename to published/20160301 Linux gives me all the tools I need.md index 5c746acab8..0ac2e84c02 100644 --- a/translated/talk/my-open-source-story/20160301 Linux gives me all the tools I need.md +++ b/published/20160301 Linux gives me all the tools I need.md @@ -3,7 +3,7 @@ Linux 给了我所有所需的工具 ![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/OPENHERE_blue.png?itok=3eqp-7gT) -[Linux][0] 就在我们身边。它以 Android 的形式[存在我们的手机中][1],它[在国际空间站中被使用][2],它[还是互联网的主要支柱][3],可是迄今为止很多人从未留意过它。对 Linux 的探索是一种很有成就感的尝试。很多人都在 Opensource.com [分享过他们与 Linux 的故事][4]。现在,轮到我了。 +[Linux][0] 就在我们身边。它以 Android 的形式[存在我们的手机中][1],它[用在国际空间站中][2],它[还是互联网的主要支柱][3],可是迄今为止很多人从未留意过它。对 Linux 的探索是一种很有成就感的尝试。很多人都在 Opensource.com [分享过他们与 Linux 的故事][4]。现在,轮到我了。 我依然记得我在 2008 年第一次探索 Linux 的时刻。协助我探索 Linux 的人是我的父亲,Socrates Ballais。他是菲律宾塔克洛班的一名经济学专家,也是一个技术狂热者。他教会了我许多计算机技术方面的知识,但只提倡我将 Linux 作为 Windows 崩溃后的备用操作系统。 @@ -36,7 +36,7 @@ via: https://opensource.com/life/16/3/my-linux-story-sean-ballais 作者:[Sean Francis N. Ballais][a] 译者:[StdioA](https://github.com/StdioA) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) [a]: https://opensource.com/users/seanballais [0]: https://opensource.com/resources/what-is-linux From c5e1a5839e836caaf27c50a1961e5278f700d317 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 31 May 2016 09:05:24 +0800 Subject: [PATCH 0837/1469] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=90=8D=E4=B8=AD=E7=89=B9=E6=AE=8A=E5=AD=97=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...md => 20160514 NODEOS - LINUX DISTRIBUTION FOR NODE LOVERS.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename translated/tech/{20160514 NODEOS : LINUX DISTRIBUTION FOR NODE LOVERS.md => 20160514 NODEOS - LINUX DISTRIBUTION FOR NODE LOVERS.md} (100%) diff --git a/translated/tech/20160514 NODEOS : LINUX DISTRIBUTION FOR NODE LOVERS.md b/translated/tech/20160514 NODEOS - LINUX DISTRIBUTION FOR NODE LOVERS.md similarity index 100% rename from translated/tech/20160514 NODEOS : LINUX DISTRIBUTION FOR NODE LOVERS.md rename to translated/tech/20160514 NODEOS - LINUX DISTRIBUTION FOR NODE LOVERS.md From f6c54b796ca0ac211a7fe46adc2d526d650159ac Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 31 May 2016 11:20:54 +0800 Subject: [PATCH 0838/1469] PUB:20160225 How to add open source experience to your resume @pengkai @mudongliang --- ...d open source experience to your resume.md | 83 +++++++++++++++++++ ...d open source experience to your resume.md | 82 ------------------ 2 files changed, 83 insertions(+), 82 deletions(-) create mode 100644 published/20160225 How to add open source experience to your resume.md delete mode 100644 translated/tech/20160225 How to add open source experience to your resume.md diff --git a/published/20160225 How to add open source experience to your resume.md b/published/20160225 How to add open source experience to your resume.md new file mode 100644 index 0000000000..cff9f4c6f1 --- /dev/null +++ b/published/20160225 How to add open source experience to your resume.md @@ -0,0 +1,83 @@ +怎样将开源经历添加到你的简历中去 +================================================== +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/lightning-test.png?itok=aMceg0Vg) + +在这篇文章中,我将会分享我的方法,让大家利用开源贡献在技术领域的求职中脱颖而出,成为强有力的候选者。 + +凡事预则立,不预则废。在你即将进入一个新的领域或者正准备熬夜修订你的简历之前,清楚地定义你正在寻找的工作的特征是值得的。你的简历是一部有说服力的作品,因此你必须了解你的观众,从而让它发挥出所有的潜力。看你简历的可能是任何需要你的技能并且能在预算之内聘用你的人。当编辑简历的时候,读一读你的简历上的内容,同时想象一下,以他们的角度怎么看待这份简历。你看起来像是一个“你”将会聘用的候选人吗? + +我个人认为,对于目标职位的理想候选人所表现出来的关键特征,列出一张清单是很有帮助的。我结合了个人经验、阅读工作招聘信息、询问相同角色的同事等方面来收集这个清单。LinkedIn 和各种会议是寻求一些乐意提供这种建议的人的很好的地方。一些人喜欢谈论他们自己,那么通过邀请他们讲述他们自己的一些故事可以帮助你来拓展你的知识面,这样大家都会感觉很好。当你和其他人谈论他们的职业路线时,你不仅将会明白怎样去得到你想要从事的工作,而且还能知道你应该避免那些容易让你失去工作机会的特征或行为。 + +例如,对于一个不太资深的工作位置来说,关键特征列表可能如下所示: + +###技术方面: + +- 拥有 CI (持续集成) 方面的经验,特别是 Jenkins +- 深厚的脚本编写背景,如 Python 和 Ruby +- 精通 Eclipse IDE +- 基本的 Git 和 Bash 知识 + +###个人而言: + +- 自我驱动的学习者 +- 良好的交流和文档技巧 +- 在团队开发方面富有经验(团队成员) +- 精通事件跟踪的工作流 + +###尽管去申请职位 + +记住,你没有必要为了得到一份工作而去满足上面的工作描述列表中列出的每个标准。 + +工作细节(JD)描述了这个角色,让你一开始就知道你即将签约并为之工作几年的公司的全部信息,并且这份工作并不会让你觉得有什么挑战性,或者要求你去拓展你的技能。如果你对你无法满足清单上的技能列表而感到紧张,那么检查一下自己是否有来自其他方面的经历并能与之媲美的技能。例如,即使有些人从来没有使用过 [Jenkins][1],那他也可能从之前使用过 [Buildbot][2] 或者 [travis CI][3] 的项目经验中明白持续集成测试的原则。 + +如果你正在申请一家大型公司,他们可能拥有一个专门的部门和一套完整的筛选过程来确保他们不会聘用任何不能胜任职位的候选人。也就是说,在你求职的过程中,你所能做的只是提交申请,而决定是否拒绝你是公司管理层的工作。不要过早地将工作拒之门外。 + +现在你已经知道了你的任务是什么,并且还知道你将需要让面试官印象深刻的技巧。下一步要做的取决于你已有的经验。 + +### 制造已经存在的事物之间的关联 + +列出一张你过去几年曾经参与过的所有项目。下面是一条快速得到这张清单的方法,跳转到你的 Github profile 中的**Repositories**标签页,并且过滤掉 fork 过来的项目。除此之外,检查下你的清单上是否有曾经处于领导地位的[Organizations][4]。如果你已经有了一份简历,那么请确保你已经将你所有的经历都列在了上面。 + +考虑下任何一个你曾经作为一个潜在的领导经历并拥有过特权的 IRC 频道。检查下你的 Meetup 和Eventbrite 账号,并将你曾经组织过或者作为志愿者参与过的活动添加到你的清单上。浏览你前几年的日程并且标注所有志愿服务,或者有作为导师的经历,又或者参与过的公共演讲。 + +现在进入了比较艰难的环节了,将清单上列出的必备技能与个人经历列表上的内容一一对照,我喜欢给该工作所需要的每个特征用一个字母或者数字作为标记,然后在每一段你经历或参与过并表现出了某一特征的地方标记相同的符号。当你不太确定的时候,那就毫不犹豫地标记上它,尽管这样做更像是在吹嘘,但也好过显示出你的无能。 + +在我们写简历的时候常常被这样的情况所困扰,就是我们不愿冒着过分吹嘘自己的技能的风险。通常应该这样去想,“那些组织了聚会的人会表现出了更好的领导才能和计划技巧吗?”,而不是“当我组织了这个聚会的时候我是否展示出了这些技巧?”。 + +如果你已经充分了解了你在过去的一两年里的业余时间都是怎么度过的,而且你写了很多代码,那么你可能现在正面临着一个令人奇怪的问题,你已经拥有了太多的经验以至于一张纸的简历已经无法容纳下这些经验了。那么,如果那些列在你的清单上的经验,但无法证明你尝试去表现的任何技能的话,那么请扔掉它们吧。如果这份已经被缩短的简历清单上的内容仍然超过一张单页纸的容量的话,那么将你的经验按照一定的优先级排序,例如根据与所需技术的相关经历或丰富经验。 + +在这一方面,显而易见,如果你想要磨练一个独特的技能,那么你就需要一个不错的经历。考虑使用一个类似 [OpenHatch][7] 的问题聚合器,并用它来寻找一个通过使用你从没使用过的工具和技术来锻炼你的技能的开源项目。 + +### 让你的简历更加漂亮 + +一份简历是否美观取决于它的简洁度、清晰度和布局。每一段经历都应该通过足够的信息来展示给读者,并让他们立刻明白为什么你要将它包含进去,而且恰到好处。每种类型的信息都应该使用一致的文档格式来表示,一份含有斜体格式的日期或者右对齐的或者与整体风格不协调的部分绝对会让人分心。 + +使用工具来给你的简历排版会使之前设定的目标更加容易实现。我喜欢使用 [LaTeX][5],因为它的宏系统能够使可视化一致性变得更加容易,并且大量的面试官都能一眼就认出它。你的工具的选择可能是 [LibreOffice][6] 或者 HTML,这取决于你的技能和你希望怎样去发布你的简历。 + +记住一点,一份以电子方式提交的简历可以通过关键字被浏览到。因此,当你需要描述你的工作经历的时候使用和工作招聘告示一样的英文缩写对你的求职会有很大的帮助。为了让你的简历更加容易被面试官看到,首先就要放上最重要的信息。 + +程序员通常难以在为文档排版时量化平衡和布局。我最喜欢的修改和评估我的文档中的空格是否处于正确位置的技术,就是全屏显示我的 PDF 或者打印出来,然后在镜子里面查看它。如果你正在使用 LibreOffice Writer,保存一份你的简历的副本,然后将你的简历中的字体换成一种你看不懂的语言。这两种技术都强制将你从阅读的内容中脱离出来,让你以一种新的方式查看文档的整体布局。他们把你从一个“那句话措辞不当!”这样的批评转到了注意如“在这行上只有一个字,看起来挺逗”之类的事情。 + +最后,再次检查你的简历是否在它将要的展示的多媒体上看起来完全正确。如果你以网页的形式发布它,那么在不同屏幕大小的浏览器中测试它的效果。如果它是一份 PDF 文档,那么在你的手机或者你的朋友的电脑上打开它,并确保它所需要的字体都是可用的。 + +###接下来的步骤 + +最后,不要让你辛苦做出来的简历内容浪费了,将它完整的复制到你的 LinkedIn 帐号上(完全使用招聘公告中的流行词),然后毫无疑问招聘人员就会找到你了。尽管他们描述的工作内容并不是恰好适合你,但是你可以利用他们的时间和兴趣来得到关于你的简历中有哪些地方好与不好的反馈信息。 + +-------------------------------------------------------------------------------- +via: https://opensource.com/business/16/2/add-open-source-to-your-resume + +作者:[edunham][a] +译者:[pengkai](https://github.com/pengkai) +校对:[mudongliang](https://github.com/mudongliang),[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/edunham +[1]: https://jenkins-ci.org/ +[2]: http://buildbot.net/ +[3]: https://travis-ci.org/ +[4]: https://github.com/settings/organizations +[5]: https://www.latex-project.org/ +[6]: https://www.libreoffice.org/download/libreoffice-fresh/ +[7]: http://openhatch.org/ diff --git a/translated/tech/20160225 How to add open source experience to your resume.md b/translated/tech/20160225 How to add open source experience to your resume.md deleted file mode 100644 index 3a990bc074..0000000000 --- a/translated/tech/20160225 How to add open source experience to your resume.md +++ /dev/null @@ -1,82 +0,0 @@ -怎样将开源经历添加到你的简历中去 -================================================== -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/lightning-test.png?itok=aMceg0Vg) - -在这篇文章中,我将会分享我的技术,让大家利用开源贡献在技术领域的求职中脱颖而出,成为强有力的候选者。 - -凡事预则立,不预则废。在你即将进入一个新的领域或者正准备熬夜彻查你的简历之前,清楚定义你正在寻找的工作的特征是值得的。你的简历是一部有说服力的作品,因此你必须了解你的观众,从而让它发挥出所有的潜力。看你简历的可能是任何需要你的技能并且能在预算之内聘用你的人。当编辑简历的时候,读一读你的简历上的内容,同时想象一下,以他们的角度怎么看待这份简历。你看起来像是一个你将会聘用的候选人吗? - -我个人认为,对于目标职位的理想候选人所表现出来的关键特征,列出一张清单是很有帮助的。我从个人经历,如阅读工作帖、询问相同角色的同事,的组合中收集这个列表。LinkedIn 和会议是很好的地方去寻求一些乐意提供这种建议的人。一些人喜欢谈论他们自己,并且邀请他们去讲述他们自己故事的一部分来帮助你去拓展你的知识面,通过这样方式可以使每个人感觉更好。当你和其他人谈论他们的职业路线时,你不仅将会明白怎样去得到你想要从事的工作,而且还能知道你应该避免那些容易让你失去工作机会的特征或行为。 - -例如,对于一个低级角色,他的关键特征列表可能如下所示: - -###技术: - -- 拥有 CI(Continuous Integration) 方面的经验,特别是 Jenkins -- 深厚的脚本编写背景,如 Python 和 Ruby -- 精通 Eclipse IDE -- 基本的 Git 和 Bash 知识 - -###个人而言: - -- 自我学习者 -- 良好的交流和文档技 -- 在团队开发方面富有经验 -- 精通事件跟踪工作流 (issue tracker workflow) - -###以任意方式应用 - -记住,你没有必要为了得到一份工作而去满足上面的工作描述列表中列出的每个标准。 - -工作细节描述了任何人都可以离开这个角色,如果你已经知道你即将签约并为之工作几年的公司的全部信息,并且这份工作并不会让你觉得有什么挑战性,或者要求你去拓展你你的技能。如果你对你无法满足清单上的技能列表而感到紧张,那么检查一下自己是否有来自其他经历并能与之媲美的技能。例如,即使有些人从来没有使用过 Jenkins,那他也可能从之前使用过 Buildbot 或者 travis CI 的项目经验中明白持续集成测试的原则。 - -如果你正在申请一家大型公司,他们可能拥有一个专门的部门和一套完整的筛选过程来确保他们不会聘用任何不能胜任职位的候选人。也就是说,在你求职的过程中,你所能做的只是提交申请,而决定是否拒绝你是公司管理层的工作。不要过早地将工作拒之门外。 - -现在你已经知道了你的任务是什么,并且还知道你需要的技能让面试官印象深刻。下一步要做的取决与你已经获取到的经验。 - -### 制造已经存在的事物之间的关联 - -列出一张你过去几年曾经参与过的所有项目。下面是一条快速得到这张清单的方法,跳转到你的 Github profile 中的**库**标签页,并且过滤掉 fork 过来的项目。除此之外,检查下你的清单上是否有曾经处于领导地位的项目。如果你已经有了一份简历,那么请确保你已经将你所有的经历都列在了上面。 - -考虑下任何一个你曾经作为一个潜在的领导经历并拥有过特权的 IRC 频道。检查你的 Meetup 和Eventbrite 账号,并将你曾经组织过或者作为志愿者参与过的活动添加到你的清单上。浏览你前几年的日程并且标注所有志愿服务,或者有作为导师的经历,又或者参与过的公共演讲。 - -现在进入了比较艰难的环节了,将清单上列出的必备技能与个人经历列表上的内容一一对照,我喜欢给工作需要的每个特征用一个字母或者数字作为标记,然后在每一段你经历或参与过并表现出了某一特征的地方标记相同的符号。当你产生怀疑的时候,无论如何也要加上它,尽管这样做更像是在吹嘘,但也好过显示出你的无能。 - -在我们写简历的时候常常被这样的情况所困扰,就是我们不愿冒着过分吹嘘自己的技能的风险。这通常会帮助我们重新考虑这个问题,“我们会考虑那些组织了会晤的人会表现出更好的领导才能和计划技巧吗?”,而不是“当我组织这个会晤的时候我是否展示出了这些技巧?”。 - -如果你已经充分了解了你在过去的几年里的业余时间都是怎么度过的或者你写了很多代码,那么你可能现在正面临着一个令人奇怪的问题,你已经拥有了太多的经验以至于一张纸的简历已经无法容纳下这些经验了。那么,如果那些列在你的清单上的经验无法证明你尝试去表现的任何技能的话,那么请扔掉它们吧。如果这份已经被缩短的简历清单上的内容仍然超过一张单页纸的容量的话,那么将你的经验按照一定的优先级排序,例如根据你获得了相关的故事或丰富的经验与所需的技术。 - -在这一方面,显而易见,如果你想要磨练一个独特的技能,那么你就需要一个不错的经历。考虑使用一个类似 OpenHatch 的问题聚合器,并用它来寻找一个通过使用你从没使用过的工具和技术来锻炼你的技能的开源项目。 - -### 让你的简历更加漂亮 - -一份简历是否美观取决于它的简洁度,清晰度和布局。每一段经历都应该通过足够的信息来展示给读者,并让他们立刻明白为什么你要将它包含进去,而且恰到好处。每种类型的信息都应该使用一致的文档格式来表示,一份含有斜体格式或者右对齐格式的或者其他与整体风格不协调的数据绝对会让人分心。 - -使用工具来给你的简历排版会使之前设定的目标更加容易实现。我喜欢使用 [LaTeX][5],因为它 -的宏系统能够使可视化一致性变得更加容易,并且大量的面试官都能一眼就认出它。你的工具的选择可能是 LibreOffice 或者 HTML,这取决于你的技能和你希望怎样去发布你的简历。 - -记住一点,一份以电子方式提交的简历可以通过关键字被浏览到。因此,当你需要描述你的工作经历的时候使用和工作招聘告示一样的英文缩写对你的求职会有很大的帮助。为了让你的简历更加容易被面试官所使用,首先就要放上最重要的信息。 - -程序员通常难以在为文档排版时量化平衡和布局。我最喜欢的回退和评估我的文档的空格是否处于正确的位置技术,就是全屏显示我的PDF或者打印出来,然后在镜像里面查看它。如果你正在使用 LibreOffice Writer,保存一份你的简历的副本,然后将你的简历中的字体换成一种你无法阅读的语言。这两种技术都强制将你从阅读的内容中脱离出来,让你以一种新的方式查看文档的整体布局。他们把你从一个“那句话措辞不当!”这样的批评到注意到,如“在这条线上只有一个字,看起来很有趣”之类的事情。 - -最后,再次检查你的简历是否在它将要的展示的多媒体上看起来完全正确。如果你以网页的形式发布它,那么在不同屏幕大小的浏览器中测试它的效果。如果它是一份 PDF 文档,那么在你的手机或者你的朋友的电脑上面打开它,并确保它所需要的字体都是可用的。 - -###接下来的步骤 - -最后,不要让你辛苦做出来的简历内容浪费了,利用你的 LinkedIn 帐号把它做成一个镜像(完全使用招聘公告中的流行词),同时当招聘人员找到你的时候也不要感到奇怪。尽管他们描述的工作内容并不是恰好适合你,但是你可以利用他们的时间和兴趣来得到关于你的简历中有哪些地方好与不好的反馈信息。 --------------------------------------------------------------------------------- -via: https://opensource.com/business/16/2/add-open-source-to-your-resume - -作者:[edunham][a] -译者:[pengkai](https://github.com/pengkai) -校对:[mudongliang](https://github.com/mudongliang) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/edunham -[1]: https://jenkins-ci.org/ -[2]: http://buildbot.net/ -[3]: https://travis-ci.org/ -[4]: https://github.com/settings/organizations -[5]: https://www.latex-project.org/ -[6]: https://www.libreoffice.org/download/libreoffice-fresh/ From f4fff4818befcf07d58d292041a57cd761b98306 Mon Sep 17 00:00:00 2001 From: Ezio Date: Tue, 31 May 2016 12:49:07 +0800 Subject: [PATCH 0839/1469] =?UTF-8?q?20160531-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... HOW TO USE WEBP IMAGES IN UBUNTU LINUX.md | 180 ++++++++++++++++++ 1 file changed, 180 insertions(+) create mode 100644 sources/tech/20160531 HOW TO USE WEBP IMAGES IN UBUNTU LINUX.md diff --git a/sources/tech/20160531 HOW TO USE WEBP IMAGES IN UBUNTU LINUX.md b/sources/tech/20160531 HOW TO USE WEBP IMAGES IN UBUNTU LINUX.md new file mode 100644 index 0000000000..45cc53157e --- /dev/null +++ b/sources/tech/20160531 HOW TO USE WEBP IMAGES IN UBUNTU LINUX.md @@ -0,0 +1,180 @@ +HOW TO USE WEBP IMAGES IN UBUNTU LINUX +========================================= + +![](http://itsfoss.com/wp-content/uploads/2016/05/support-webp-ubuntu-linux.jpg) +>Brief: This guide shows you how to view WebP images in Linux and how to convert WebP images to JPEG or PNG format. + +###WHAT IS WEBP? + +It’s been over five years since Google introduced [WebP file format][0] for images. WebP provides lossy and lossless compression and WebP compressed files are around 25% smaller in size when compared to JPEG compression, Google claims. + +Google aimed WebP to become the new standard for images on the web but I don’t see it happening. It’s over five years and it’s still not adopted as a standard except in Google’s ecosystem. But as we know, Google is pushy about its technologies. Few months back Google changed all the images on Google Plus to WebP. + +If you download those images from Google Plus using Google Chrome, you’ll have WebP images, no matter if you had uploaded PNG or JPEG. And that’s not the problem. The actual problem is when you try to open that files in Ubuntu using the default GNOME Image Viewer and you see this error: + +>**Could not find XYZ.webp** +>**Unrecognized image file format** + +![](http://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-1.png) +>GNOME Image Viewer doesn’t support WebP images + +In this tutorial, we shall see + +- how to add WebP support in Linux +- list of programs that support WebP images +- how to convert WebP images to PNG or JPEG +- how to download WebP images directly as PNG images + +### HOW TO VIEW WEBP IMAGES IN UBUNTU AND OTHER LINUX + +[GNOME Image Viewer][3], the default image viewer in many Linux distributions including Ubuntu, doesn’t support WebP images. There are no plugins available at present that could enable GNOME Image Viewer to add WebP support. + +This means that we simply cannot use GNOME Image Viewer to open WebP files in Linux. A better alternative is [gThumb][4] that supports WebP images by default. + +To install gThumb in Ubuntu and other Ubuntu based Linux distributions, use the command below: + +``` +sudo apt-get install gthumb +``` + +Once installed, you can simply rightly click on the WebP image and select gThumb to open it. You should be able to see it now: + +![](http://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-2.jpeg) +>WebP image in gThumb + +### MAKE GTHUMB THE DEFAULT APPLICATION FOR WEBP IMAGES IN UBUNTU + +For Ubuntu beginners, if you like to make gThumb the default application for opening WebP files, just follow the steps below: + +#### Step 1: Right click on the WebP image and select Properties. + +![](http://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-3.png) +>Select Properties from Right Click menu + +#### Step 2: Go to Open With tab, select gThumb and click on Set as default. + +![](http://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-4.png) +>Make gThumb the default application for WebP images in Ubuntu + +### MAKE GTHUMB THE DEFAULT APPLICATIONS FOR ALL IMAGES + +gThumb has a lot more to offer than Image Viewer. For example, you can do simple editing, add color filters to the images etc. Adding the filter is not as effective as XnRetro, the dedicated tool for [adding Instagram like effects on Linux][5], but the basic filters are available. + +I liked gThumb a lot and decided to make it the default image viewer. If you also want to make gThumb the default application for all kind of images in Ubuntu, follow the steps below: + +####Step 1: Open System Settings + +![](http://itsfoss.com/wp-content/uploads/2014/04/System_Settings_ubuntu_1404.jpeg) + +#### Step 2: Go to Details. + +![](http://itsfoss.com/wp-content/uploads/2013/11/System_settings_Ubuntu_1.jpeg) + +#### Step 3: Select gThumb as the default applications for images here. + +![](http://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-5.png) + +### ALTERNATIVE PROGRAMS TO OPEN WEBP FILES IN LINUX + +It is possible that you might not like gThumb. If that’s the case, you can choose one of the following applications to view WebP images in Linux: + +- [XnView][6] (Not open source) +- GIMP with unofficial WebP plugin that can be installed via this [PPA][7] that is available until Ubuntu 15.10. I’ll cover this part in another article. +- [Gwenview][8] + +### CONVERT WEBP IMAGES TO PNG AND JPEG IN LINUX + +There are two ways to convert WebP images in Linux: + +- Command line +- GUI + +#### 1. USING COMMAND LINE TO CONVERT WEBP IMAGES IN LINUX + +You need to install WebP tools first. Open a terminal and use the following command: + +``` +sudo apt-get install webp +``` + +##### CONVERT JPEG/PNG TO WEBP + +We’ll use cwebp command (does it mean compress to WebP?) to convert JPEG or PNG files to WebP. The command format is like: + +``` +cwebp -q [image_quality] [JPEG/PNG_filename] -o [WebP_filename] +``` + +For example, you can use the following command: + +``` +cwebp -q 90 example.jpeg -o example.webp +``` + +##### CONVERT WEBP TO JPEG/PNG + +To convert WebP images to JPEG or PNG, we’ll use dwebp command. The command format is: + +``` +dwebp [WebP_filename] -o [PNG_filename] +``` + +An example of this command could be: + +``` +dwebp example.webp -o example.png +``` + +#### 2. USING GUI TOOL TO CONVERT WEBP TO JPEG/PNG + +For this purpose, we will use XnConvert which is a free but not open source application. You can download the installer files from their website: + +[Download XnConvert][1] + +Note that XnConvert is a powerful tool that you can use for batch resizing images. However, in this tutorial, we shall only see how to convert a single WebP image to PNG/JPEG. + +Open XnConvert and select the input file: + +![](http://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-6.jpeg) + +In the Output tab, select the output format you want it to be converted. Once you have selected the output format, click on Convert. + +![](http://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-7.jpeg) + +That’s all you need to do to convert WebP images to PNG, JPEg or any other image format of your choice. + +### DOWNLOAD WEBP IMAGES AS PNG DIRECTLY IN CHROME WEB BROWSER + +Probably you don’t like WebP image format at all and you don’t want to install a new software just to view WebP images in Linux. It will be a bigger pain if you have to convert the WebP file for future use. + +An easier and less painful way to deal with is to install a Chrome extension Save Image as PNG. With this extension, you can simply right click on a WebP image and save it as PNG directly. + +![](http://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-8.png) +>Saving WebP image as PNG in Google Chrome + +[Get Save Image as PNG extension][2] + +### WHAT’S YOUR PICK? + +I hope this detailed tutorial helped you to get WebP support on Linux and helped you to convert WebP images. How do you handle WebP images in Linux? Which tool do you use? From the above described methods, which one did you like the most? + + +---------------------- +via: http://itsfoss.com/webp-ubuntu-linux/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 + +作者:[Abhishek Prakash][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/ +[0]: https://developers.google.com/speed/webp/ +[1]: http://www.xnview.com/en/xnconvert/#downloads +[2]: https://chrome.google.com/webstore/detail/save-image-as-png/nkokmeaibnajheohncaamjggkanfbphi?utm_source=chrome-ntp-icon +[3]: https://wiki.gnome.org/Apps/EyeOfGnome +[4]: https://wiki.gnome.org/Apps/gthumb +[5]: http://itsfoss.com/add-instagram-effects-xnretro-ubuntu-linux/ +[6]: http://www.xnview.com/en/xnviewmp/#downloads +[7]: https://launchpad.net/~george-edison55/+archive/ubuntu/webp +[8]: https://userbase.kde.org/Gwenview From 46a0239c4d723091d4bfd49f947a52c93531ac55 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Tue, 31 May 2016 21:15:02 +0800 Subject: [PATCH 0840/1469] Update 20160530 Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md --- ... 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160530 Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md b/sources/tech/20160530 Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md index e6b143cc00..ef713fff0f 100644 --- a/sources/tech/20160530 Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md +++ b/sources/tech/20160530 Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md @@ -1,3 +1,5 @@ +Translating by strugglingyouth + Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04 ===================================================================================== From d094d2c9874de5b047a69481e664b658d1ec2269 Mon Sep 17 00:00:00 2001 From: alim0x Date: Thu, 2 Jun 2016 12:08:22 +0800 Subject: [PATCH 0841/1469] [translating]HOW TO USE WEBP IMAGES IN UBUNTU LINUX --- sources/tech/20160531 HOW TO USE WEBP IMAGES IN UBUNTU LINUX.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160531 HOW TO USE WEBP IMAGES IN UBUNTU LINUX.md b/sources/tech/20160531 HOW TO USE WEBP IMAGES IN UBUNTU LINUX.md index 45cc53157e..0012c5ca51 100644 --- a/sources/tech/20160531 HOW TO USE WEBP IMAGES IN UBUNTU LINUX.md +++ b/sources/tech/20160531 HOW TO USE WEBP IMAGES IN UBUNTU LINUX.md @@ -1,3 +1,5 @@ +alim0x translating + HOW TO USE WEBP IMAGES IN UBUNTU LINUX ========================================= From cd6058f5bdb9bbb595cbfc4f3c28480e41236c00 Mon Sep 17 00:00:00 2001 From: alim0x Date: Thu, 2 Jun 2016 20:51:48 +0800 Subject: [PATCH 0842/1469] [translated]HOW TO USE WEBP IMAGES IN UBUNTU LINUX --- ... HOW TO USE WEBP IMAGES IN UBUNTU LINUX.md | 182 ------------------ ... HOW TO USE WEBP IMAGES IN UBUNTU LINUX.md | 181 +++++++++++++++++ 2 files changed, 181 insertions(+), 182 deletions(-) delete mode 100644 sources/tech/20160531 HOW TO USE WEBP IMAGES IN UBUNTU LINUX.md create mode 100644 translated/tech/20160531 HOW TO USE WEBP IMAGES IN UBUNTU LINUX.md diff --git a/sources/tech/20160531 HOW TO USE WEBP IMAGES IN UBUNTU LINUX.md b/sources/tech/20160531 HOW TO USE WEBP IMAGES IN UBUNTU LINUX.md deleted file mode 100644 index 0012c5ca51..0000000000 --- a/sources/tech/20160531 HOW TO USE WEBP IMAGES IN UBUNTU LINUX.md +++ /dev/null @@ -1,182 +0,0 @@ -alim0x translating - -HOW TO USE WEBP IMAGES IN UBUNTU LINUX -========================================= - -![](http://itsfoss.com/wp-content/uploads/2016/05/support-webp-ubuntu-linux.jpg) ->Brief: This guide shows you how to view WebP images in Linux and how to convert WebP images to JPEG or PNG format. - -###WHAT IS WEBP? - -It’s been over five years since Google introduced [WebP file format][0] for images. WebP provides lossy and lossless compression and WebP compressed files are around 25% smaller in size when compared to JPEG compression, Google claims. - -Google aimed WebP to become the new standard for images on the web but I don’t see it happening. It’s over five years and it’s still not adopted as a standard except in Google’s ecosystem. But as we know, Google is pushy about its technologies. Few months back Google changed all the images on Google Plus to WebP. - -If you download those images from Google Plus using Google Chrome, you’ll have WebP images, no matter if you had uploaded PNG or JPEG. And that’s not the problem. The actual problem is when you try to open that files in Ubuntu using the default GNOME Image Viewer and you see this error: - ->**Could not find XYZ.webp** ->**Unrecognized image file format** - -![](http://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-1.png) ->GNOME Image Viewer doesn’t support WebP images - -In this tutorial, we shall see - -- how to add WebP support in Linux -- list of programs that support WebP images -- how to convert WebP images to PNG or JPEG -- how to download WebP images directly as PNG images - -### HOW TO VIEW WEBP IMAGES IN UBUNTU AND OTHER LINUX - -[GNOME Image Viewer][3], the default image viewer in many Linux distributions including Ubuntu, doesn’t support WebP images. There are no plugins available at present that could enable GNOME Image Viewer to add WebP support. - -This means that we simply cannot use GNOME Image Viewer to open WebP files in Linux. A better alternative is [gThumb][4] that supports WebP images by default. - -To install gThumb in Ubuntu and other Ubuntu based Linux distributions, use the command below: - -``` -sudo apt-get install gthumb -``` - -Once installed, you can simply rightly click on the WebP image and select gThumb to open it. You should be able to see it now: - -![](http://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-2.jpeg) ->WebP image in gThumb - -### MAKE GTHUMB THE DEFAULT APPLICATION FOR WEBP IMAGES IN UBUNTU - -For Ubuntu beginners, if you like to make gThumb the default application for opening WebP files, just follow the steps below: - -#### Step 1: Right click on the WebP image and select Properties. - -![](http://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-3.png) ->Select Properties from Right Click menu - -#### Step 2: Go to Open With tab, select gThumb and click on Set as default. - -![](http://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-4.png) ->Make gThumb the default application for WebP images in Ubuntu - -### MAKE GTHUMB THE DEFAULT APPLICATIONS FOR ALL IMAGES - -gThumb has a lot more to offer than Image Viewer. For example, you can do simple editing, add color filters to the images etc. Adding the filter is not as effective as XnRetro, the dedicated tool for [adding Instagram like effects on Linux][5], but the basic filters are available. - -I liked gThumb a lot and decided to make it the default image viewer. If you also want to make gThumb the default application for all kind of images in Ubuntu, follow the steps below: - -####Step 1: Open System Settings - -![](http://itsfoss.com/wp-content/uploads/2014/04/System_Settings_ubuntu_1404.jpeg) - -#### Step 2: Go to Details. - -![](http://itsfoss.com/wp-content/uploads/2013/11/System_settings_Ubuntu_1.jpeg) - -#### Step 3: Select gThumb as the default applications for images here. - -![](http://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-5.png) - -### ALTERNATIVE PROGRAMS TO OPEN WEBP FILES IN LINUX - -It is possible that you might not like gThumb. If that’s the case, you can choose one of the following applications to view WebP images in Linux: - -- [XnView][6] (Not open source) -- GIMP with unofficial WebP plugin that can be installed via this [PPA][7] that is available until Ubuntu 15.10. I’ll cover this part in another article. -- [Gwenview][8] - -### CONVERT WEBP IMAGES TO PNG AND JPEG IN LINUX - -There are two ways to convert WebP images in Linux: - -- Command line -- GUI - -#### 1. USING COMMAND LINE TO CONVERT WEBP IMAGES IN LINUX - -You need to install WebP tools first. Open a terminal and use the following command: - -``` -sudo apt-get install webp -``` - -##### CONVERT JPEG/PNG TO WEBP - -We’ll use cwebp command (does it mean compress to WebP?) to convert JPEG or PNG files to WebP. The command format is like: - -``` -cwebp -q [image_quality] [JPEG/PNG_filename] -o [WebP_filename] -``` - -For example, you can use the following command: - -``` -cwebp -q 90 example.jpeg -o example.webp -``` - -##### CONVERT WEBP TO JPEG/PNG - -To convert WebP images to JPEG or PNG, we’ll use dwebp command. The command format is: - -``` -dwebp [WebP_filename] -o [PNG_filename] -``` - -An example of this command could be: - -``` -dwebp example.webp -o example.png -``` - -#### 2. USING GUI TOOL TO CONVERT WEBP TO JPEG/PNG - -For this purpose, we will use XnConvert which is a free but not open source application. You can download the installer files from their website: - -[Download XnConvert][1] - -Note that XnConvert is a powerful tool that you can use for batch resizing images. However, in this tutorial, we shall only see how to convert a single WebP image to PNG/JPEG. - -Open XnConvert and select the input file: - -![](http://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-6.jpeg) - -In the Output tab, select the output format you want it to be converted. Once you have selected the output format, click on Convert. - -![](http://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-7.jpeg) - -That’s all you need to do to convert WebP images to PNG, JPEg or any other image format of your choice. - -### DOWNLOAD WEBP IMAGES AS PNG DIRECTLY IN CHROME WEB BROWSER - -Probably you don’t like WebP image format at all and you don’t want to install a new software just to view WebP images in Linux. It will be a bigger pain if you have to convert the WebP file for future use. - -An easier and less painful way to deal with is to install a Chrome extension Save Image as PNG. With this extension, you can simply right click on a WebP image and save it as PNG directly. - -![](http://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-8.png) ->Saving WebP image as PNG in Google Chrome - -[Get Save Image as PNG extension][2] - -### WHAT’S YOUR PICK? - -I hope this detailed tutorial helped you to get WebP support on Linux and helped you to convert WebP images. How do you handle WebP images in Linux? Which tool do you use? From the above described methods, which one did you like the most? - - ----------------------- -via: http://itsfoss.com/webp-ubuntu-linux/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 - -作者:[Abhishek Prakash][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/ -[0]: https://developers.google.com/speed/webp/ -[1]: http://www.xnview.com/en/xnconvert/#downloads -[2]: https://chrome.google.com/webstore/detail/save-image-as-png/nkokmeaibnajheohncaamjggkanfbphi?utm_source=chrome-ntp-icon -[3]: https://wiki.gnome.org/Apps/EyeOfGnome -[4]: https://wiki.gnome.org/Apps/gthumb -[5]: http://itsfoss.com/add-instagram-effects-xnretro-ubuntu-linux/ -[6]: http://www.xnview.com/en/xnviewmp/#downloads -[7]: https://launchpad.net/~george-edison55/+archive/ubuntu/webp -[8]: https://userbase.kde.org/Gwenview diff --git a/translated/tech/20160531 HOW TO USE WEBP IMAGES IN UBUNTU LINUX.md b/translated/tech/20160531 HOW TO USE WEBP IMAGES IN UBUNTU LINUX.md new file mode 100644 index 0000000000..c08efbc683 --- /dev/null +++ b/translated/tech/20160531 HOW TO USE WEBP IMAGES IN UBUNTU LINUX.md @@ -0,0 +1,181 @@ +在 Ubuntu Linux 中使用 WEBP 图片 +========================================= + +![](http://itsfoss.com/wp-content/uploads/2016/05/support-webp-ubuntu-linux.jpg) +>简介:这篇指南会向你展示如何在 Linux 下查看 WebP 图片以及将 WebP 图片转换为 JPEG 或 PNG 格式。 + +### 什么是 WEBP? + +Google 为图片推出 [WebP 文件格式][0]已经超过五年了。Google 说,WebP 提供有损和无损压缩,相比 JPEG 压缩,WebP 压缩文件大小能更小约 25%。 + +Google 的目标是让 WebP 成为 web 图片的新标准,但是我没能看到这一切发生。已经五年过去了,除了谷歌的生态系统以外它仍未被接受成为一个标准。但正如我们所知的,Google 对它的技术很有进取心。几个月前 Google 将 Google Plus 的所有图片改为了 WebP 格式。 + +如果你用 Google Chrome 从 Google Plus 上下载那些图片,你会得到 WebP 图片,不论你之前上传的是 PNG 还是 JPEG。这都不是重点。真正的问题在于当你尝试着在 Ubuntu 中使用默认的 GNOME 图片查看器打开它时你会看到如下错误: + +> **Could not find XYZ.webp(无法找到 XYZ.webp)** + +> **Unrecognized image file format(未识别文件格式)** + +![](http://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-1.png) +>GNOME 图片查看器不支持 WebP 图片 + +在这个教程里,我们会看到 + +- 如何在 Linux 中添加 WebP 支持 +- 支持 WebP 图片的程序列表 +- 如何将 WebP 图片转换到 PNG 或 JPEG +- 如何将 WebP 图片直接下载为 PNG 格式 + +### 如何在 Ubuntu 以及其它 Linux 发行版中查看 WebP 图片 + +[GNOME 图片查看器][3]是许多 Linux 发行版的默认图片查看器,包括 Ubuntu,它不支持 WebP 图片。目前也没有可用的插件给 GNOME 图片查看器添加 WebP 支持。 + +这无非是意味着我们不能在 Linux 上用 GNOME 图片查看器打开 WebP 文件而已。一个更好的替代品,[gThumb][4],默认就支持 WebP 图片。 + +要在 Ubuntu 以及其它基于 Ubuntu 的发行版上安装 gThumb 的话,使用以下命令: + +``` +sudo apt-get install gthumb +``` + +一旦安装完成,你就可以简单地右键点击 WebP 图片,选择 gThumb 来打开它。你现在应该可以看到如下画面: + +![](http://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-2.jpeg) +>gThumb 中显示的 WebP 图片 + +### 让 gThumb 成为 Ubuntu 中 WebP 图片的默认应用 + +对 Ubuntu 新手而言,如果你想要让 gThumb 成为打开 WebP 文件的默认应用,跟着以下步骤操作: + +#### 步骤 1:右键点击 WebP 文件选择属性。 + +![](http://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-3.png) +>从右键菜单中选择属性 + +#### 步骤 2:转到打开方式标签,选择 gThumb 并点击设置为默认。 + +![](http://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-4.png) +>让 gThumb 成为 Ubuntu 中 WebP 图片的默认应用 + +### 让 gThumb 成为所有图片的默认应用 + +gThumb 的功能比图片查看器更多。举个例子,你可以做一些简单的编辑,给图片添加滤镜等。添加滤镜的效率没有 XnRetro(在[ Linux 下添加类似 Instagram 滤镜效果][5]的专用工具)那么高,但它还是有一些基础的滤镜可以用。 + +我非常喜欢 gThumb 并且决定让它成为默认的图片查看器。如果你也想在 Ubuntu 中让 gThumb 成为所有图片的默认默认应用,遵照以下步骤操作: + +#### 步骤1:打开系统设置 + +![](http://itsfoss.com/wp-content/uploads/2014/04/System_Settings_ubuntu_1404.jpeg) + +#### 步骤2:转到详情(Details) + +![](http://itsfoss.com/wp-content/uploads/2013/11/System_settings_Ubuntu_1.jpeg) + +#### 步骤3:在这里将 gThumb 设置为图片的默认应用 + +![](http://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-5.png) + +### Linux 上打开 WebP 文件的替代程序 + +可能你不喜欢 gThumb。如果这样的话,你可以选择下列应用来在 Linux 中查看 WebP 图片: + +- [XnView][6](非开源) +- GIMP 加上非官方 WebP 插件,可以从这个 [PPA][7] 安装,支持到 Ubuntu 15.10。我会在另一篇文章里提到。 +- [Gwenview][8] + +### 在 Linux 中将 WebP 图片转换为 PNG 和 JPEG + +在 Linux 上转换 WebP 图片有两种途径: + +- 命令行 +- 图形界面 + +#### 1.在 Linux 使用命令行转换 WebP 图片 + +你需要先安装 WebP 工具。打开终端并使用下列命令: + +``` +sudo apt-get install webp +``` + +##### 将 JPEG/PNG 转换为 WebP + +我们将使用 cwebp 命令(它代表压缩为 WebP 吗?)来将 JPEG 或 PNG 文件转换为 WebP。命令格式是这样的: + +``` +cwebp -q [图片质量] [JPEG/PNG_文件名] -o [WebP_文件名] +``` + +举个例子,你可以使用下列命令: + +``` +cwebp -q 90 example.jpeg -o example.webp +``` + +##### 将 WebP 转换为 JPEG/PNG + +要将 WebP 图片转换为 JPEG 或 PNG,我们将使用 dwebp 命令。命令格式是: + +``` +dwebp [WebP_文件名] -o [PNG_文件名] +``` + +该命令的一个例子: + +``` +dwebp example.webp -o example.png +``` + +#### 2.使用图形工具将 WebP 转换为 JPEG/PNG + +要实现这个目标,我们要使用 XnConvert,它是免费的应用但不是开源的。你可以从他们的网站上下载安装文件: + +[下载 XnConvert][1] + +XnConvert 是个强大的工具,你可以用它来批量修改图片尺寸。但在这个教程里,我们只能看到如何将单个 WebP 图片转换为 PNG/JPEG。 + +打开 XnConvert 并选择输入文件: + +![](http://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-6.jpeg) + +在输出标签,选择你想要的输出格式。选择完后点击转换。 + +![](http://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-7.jpeg) + +要将 WebP 图片转换为 PNG,JPEG 或其它你选择的图片格式,这就是你所需要做的一切了。 + +### 在 Chrome 浏览器中直接将 WebP 图片下载为 PNG + +也许你一点都不喜欢 WebP 图片格式,也不想在 Linux 仅仅为了查看 WebP 图片而安装一个新软件。如果你不得不将 WebP 文件转换以备将来使用,这会是件更痛苦的事情。 + +一个解决这个问题更简单,不那么痛苦的途径是安装一个 Chrome 扩展 Save Image as PNG。有了这个插件,你可以右键点击 WebP 图片并直接存储为 PNG 格式。 + +![](http://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-8.png) +>在 Google Chrome 中将 WebP 图片保存为 PNG 格式 + +[获取 Save Image as PNG 扩展][2] + +### 你的选择是? + +我希望这个详细的教程能够帮你在 Linux 上获取 WebP 支持并帮你转换 WebP 图片。你在 Linux 怎么处理 WebP 图片?你使用哪个工具?以上描述的方法中,你最喜欢哪一个? + + +---------------------- +via: http://itsfoss.com/webp-ubuntu-linux/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 + +作者:[Abhishek Prakash][a] +译者:[alim0x](https://github.com/alim0x) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://itsfoss.com/author/abhishek/ +[0]: https://developers.google.com/speed/webp/ +[1]: http://www.xnview.com/en/xnconvert/#downloads +[2]: https://chrome.google.com/webstore/detail/save-image-as-png/nkokmeaibnajheohncaamjggkanfbphi?utm_source=chrome-ntp-icon +[3]: https://wiki.gnome.org/Apps/EyeOfGnome +[4]: https://wiki.gnome.org/Apps/gthumb +[5]: http://itsfoss.com/add-instagram-effects-xnretro-ubuntu-linux/ +[6]: http://www.xnview.com/en/xnviewmp/#downloads +[7]: https://launchpad.net/~george-edison55/+archive/ubuntu/webp +[8]: https://userbase.kde.org/Gwenview From bc7255265a34a4d4870af783a75f75f77396fadb Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 2 Jun 2016 22:07:58 +0800 Subject: [PATCH 0843/1469] PUB:Part 8 - LFCS--Managing Users and Groups File Permissions and Attributes and Enabling sudo Access on Accounts.md @GHLandy --- ...es and Enabling sudo Access on Accounts.md | 169 +++++++++--------- 1 file changed, 89 insertions(+), 80 deletions(-) rename {translated/tech => published}/LFCS/Part 8 - LFCS--Managing Users and Groups File Permissions and Attributes and Enabling sudo Access on Accounts.md (72%) diff --git a/translated/tech/LFCS/Part 8 - LFCS--Managing Users and Groups File Permissions and Attributes and Enabling sudo Access on Accounts.md b/published/LFCS/Part 8 - LFCS--Managing Users and Groups File Permissions and Attributes and Enabling sudo Access on Accounts.md similarity index 72% rename from translated/tech/LFCS/Part 8 - LFCS--Managing Users and Groups File Permissions and Attributes and Enabling sudo Access on Accounts.md rename to published/LFCS/Part 8 - LFCS--Managing Users and Groups File Permissions and Attributes and Enabling sudo Access on Accounts.md index 5f511676af..c3fc8b67ab 100644 --- a/translated/tech/LFCS/Part 8 - LFCS--Managing Users and Groups File Permissions and Attributes and Enabling sudo Access on Accounts.md +++ b/published/LFCS/Part 8 - LFCS--Managing Users and Groups File Permissions and Attributes and Enabling sudo Access on Accounts.md @@ -1,27 +1,26 @@ -GHLandy Translated - LFCS 系列第八讲:管理用户和用户组、文件权限和属性以及启用账户 sudo 访问权限 - ================================================================================ -去年八月份,Linux 基金会发起了全新的 LFCS(Linux Foundation Certified Sysadmin,Linux 基金会认证系统管理员)认证,旨在让世界各地的人能够参与到关于 Linux 系统中间层的基本管理操作的认证考试中去,这项认证包括:维护正在运行的系统和服务的能力、全面监控和分析的能力以及何时向上游团队请求支持的决策能力。 +去年八月份,Linux 基金会发起了全新的 LFCS(Linux Foundation Certified Sysadmin,Linux 基金会认证系统管理员)认证,旨在让世界各地的人能够参与到中等水平的 Linux 系统的基本管理操作的认证考试中去,这项认证包括:维护正在运行的系统和服务的能力、全面监控和分析的能力以及何时向上游团队请求支持的决策能力。 ![Linux Users and Groups Management](http://www.tecmint.com/wp-content/uploads/2014/10/lfcs-Part-8.png) -LFCS 系列第八讲 +*第八讲: Linux 基金会认证系统管理员* 请看以下视频,里边将描述 LFCS 认证程序。 注:youtube视频 -本讲是《十套教程》系列的第八讲,在这一讲中,我们将引导你学习如何在 Linux 管理用户和用户组权限的设置,这些内容是 LFCS 认证开始中的必备知识。 +本讲是系列教程的第八讲,在这一讲中,我们将引导你学习如何在 Linux 管理用户和用户组权限的设置,这些内容是 LFCS 认证的必备知识。 由于 Linux 是一个多用户的操作系统(允许多个用户通过不同主机或者终端访问一个独立系统),因此你需要知道如何才能有效地管理用户:如何添加、编辑、禁用和删除用户账户,并赋予他们足以完成自身任务的必要权限。 +(LCTT 译注:本篇原文章节顺序有误,根据理解做了调整。) + ### 添加用户账户 ### -添加新用户账户,你需要以 root 运行一下两条命令中的任意一条: +添加新用户账户,你需要以 root 运行以下两条命令中的任意一条: # adduser [new_account] # useradd [new_account] @@ -29,43 +28,43 @@ LFCS 系列第八讲 当新用户账户添加到系统时,会自动执行以下操作: 1. 自动创建用户家目录(默认是 /home/username)。 - 2. 自动拷贝下列隐藏文件到新建用户的家目录,用来设置新用户会话的环境变量。 - .bash_logout - .bash_profile - .bashrc + .bash_logout + .bash_profile + .bashrc 3. 自动创建邮件缓存目录 /var/spool/mail/username。 - 4. 自动创建于用户名相同的用户组。 -**理解 /etc/passwd 中的内容** +####理解 /etc/passwd 中的内容#### /etc/passwd 文件中存储了所有用户账户的信息,每个用户在里边都有一条对应的记录,其格式(每个字段用冒号隔开)如下: [username]:[x]:[UID]:[GID]:[Comment]:[Home directory]:[Default shell] -- 字段 [username] 和 [Comment] 是自解释的关系。 +- 字段 [username] 和 [Comment] 是不言自明的。 - 第二个字段中 x 表明通过用户名 username 登录系统是有密码保护的, 密码保存在 /etc/shadow 文件中。 - [UID] 和 [GID] 字段用整数表示,代表该用户的用户标识符和对应所在组的组标志符。 - 字段 [Home directory] 为 username 用户家目录的绝对路径。 - 字段 [Default shell] 指定用户登录系统时默认使用的 shell。 -**理解 /etc/group 中的内容** +####理解 /etc/group 中的内容#### /etc/group 文件存储所有用户组的信息。每行记录的格式如下: [Group name]:[Group password]:[GID]:[Group members] - [Group name] 为用户组名称。 -- 字段 [Group password] 为 x 的话,则说明不适用用户组密码。 +- 字段 [Group password] 为 x 的话,则说明不使用用户组密码。 - [GID] 与 /etc/passwd 中保存的 GID 相同。 - [Group members] 用户组中的用户使用逗号隔开。 ![Add User Accounts in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/add-user-accounts.png) -添加用户账户 +*添加用户账户* + +#### 修改用户信息 #### 添加用户账户之后,你可以使用 usermod 命令来修改用户信息中的部分字段,该命令基本语法如下: @@ -95,24 +94,21 @@ LFCS 系列第八讲 # usermod --shell /bin/sh tecmint -**显示用户所属的用户组** - - # groups tecmint - # id tecmint - 下面,我们一次运行上述命令: # 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 命令例示 +*usermod 命令例示* 扩展阅读 - [15 useradd Command Examples in Linux][1] - [15 usermod Command Examples in Linux][2] +####锁定和解锁账户#### + 对于已有用户账户,我们还可以: **通过锁定密码来禁用账户** @@ -129,33 +125,9 @@ usermod 命令例示 ![Lock User in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/lock-user-in-linux.png) -锁定用户账户 +*锁定用户账户* -**为需要对指定文件进行读写的多个用户建立用户组** - -运行下列几条命令来完成: - - # groupadd common_group # 添加新用户组 - # chown :common_group common.txt # 将 common.txt 的用户组修改为 common_group - # usermod -aG common_group user1 # 添加用户 user1 到 common_group 用户组 - # usermod -aG common_group user2 # 添加用户 user2 到 common_group 用户组 - # usermod -aG common_group user3 # 添加用户 user3 到 common_group 用户组 - -**删除用户组** - -通过以下命令删除用户组: - - # groupdel [group_name] - -属于这个 group_name 用户组的文件是不会被删除的,而仅仅是删除了用户组。 - -### Linux 文件权限 ### - -除了我们在 [Setting File Attributes – Part 3][3] 中说到的基本的读取、写入和执行权限外,文件还有一些不常用却很重要的的权限设置,有时候把它当做“特殊权限”。 - -就像之前我们讨论的基本权限,这里同样使用八进制数字或者一个字母(象征性符号)好表示该权限类型。 - -**删除用户账户** +####删除用户账户#### 你可以通过 userdel --remove 命令来删除用户账户。这样会删除用户拥有的家目录和家目录下的所有文件,以及邮件缓存目录。 @@ -167,9 +139,9 @@ usermod 命令例示 比如,你有下列用户: -- user1 (primary group: user1) -- user2 (primary group: user2) -- user3 (primary group: user3) +- user1 (主组 user1) +- user2 (主组 user2) +- user3 (主组 user3) 他们都需要对你系统里边某个位置的 common.txt 文件,或者 user1 用户刚刚创建的共享进行读写。你可能会运行下列命令: @@ -181,53 +153,88 @@ usermod 命令例示 这时候,用户组就派上用场了,下面将演示怎么做。 +**显示用户所属的用户组** + + # groups tecmint + # id tecmint + +**为需要对指定文件进行读写的多个用户建立用户组** + +运行下列几条命令来完成: + + # groupadd common_group # 添加新用户组 + # chown :common_group common.txt # 将 common.txt 的用户组修改为 common_group + # usermod -aG common_group user1 # 添加用户 user1 到 common_group 用户组 + # usermod -aG common_group user2 # 添加用户 user2 到 common_group 用户组 + # usermod -aG common_group user3 # 添加用户 user3 到 common_group 用户组 + +####删除用户组#### + +通过以下命令删除用户组: + + # groupdel [group_name] + +属于这个 group_name 用户组的文件是不会被删除的,而仅仅是删除了用户组。 + +### Linux 文件权限 ### + +除了我们在 [LFCS 系列第三讲:归档/压缩文件及目录、设置文件属性和搜索文件][3] 中说到的基本的读取、写入和执行权限外,文件还有一些不常用却很重要的的权限设置,有时候把它当做“特殊权限”。 + +就像之前我们讨论的基本权限,这里同样使用八进制数字或者一个字母(象征性符号)表示该权限类型。 + **理解 Setuid 位** -当为可执行文件设置 setuid 位之后,用户运行程序是会继承该程序属主的有效特权。由于这样做会引起安全风险,因此设置 setuid 权限的文件及程序必须尽量少。你会发现,当系统中有用户需要执行 root 用户所管辖的程序时就是设置了 setuid 权限。 +当为可执行文件设置 setuid 位之后,用户运行程序时会继承该程序属主的有效特权。由于这样做会引起安全风险,因此设置 setuid 权限的文件及程序必须尽量少。你会发现,当系统中有用户需要访问属于 root 用户的文件是所运行的程序就带有了 setuid 权限。 -也就是说,用户不仅仅可以运行这个可执行文件,而且能以 root 权限来运行。比如,先检查 /bin/passwd 的权限,这个可执行文件用于改变账户的密码,并修改 /etc/shadow 文件。超级用户可以改变任意账户的密码,但是其他用户只能改变自己账户的密码。 +也就是说,用户不仅仅可以运行这个可执行文件,而且能以 root 权限来运行。比如,让我们来看看 /bin/passwd 的权限,这个可执行文件用于改变账户的密码,修改 /etc/shadow 文件。超级用户可以改变任意账户的密码,但是其他用户只能改变自己账户的密码。 ![passwd Command Examples](http://www.tecmint.com/wp-content/uploads/2014/10/passwd-command.png) -passwd 命令例示 +*passwd 命令例示* 因此,所有用户都有权限运行 /bin/passwd,但只有 root 用户可以指定改变指定用户账户的密码。其他用户只能改变其自身的密码。 ![Change User Password in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/change-user-password.png) -修改用户密码 +*修改用户密码* + + # chmod o+u [filename] + +以八进制形式来设置 setuid 位,在当前基本权限(或者想要设置的权限)前加上数字 4 就行了。 + + # chmod 4755 [filename] **理解 Setgid 位** -设置 setgid 位之后,真实用户的有效 GID 变为属组的 GID。因此,任何用户都能以赋予属组用户的权限来访问文件。另外,当目录置了 setgid 位之后,新建的文件将继承其所属目录的 GID,并且新建的子目录会继承父目录的 setgid 位。通过这个方法,你能够以一个指定用户组的身份来访问该目录里边的文件,而不必管文件属主的主属组。 +设置 setgid 位之后,真实用户的有效 GID 变为属组的 GID。因此,任何用户都能以属组用户的权限来访问文件。另外,当目录置了 setgid 位之后,新建的文件将继承其所属目录的 GID,并且新建的子目录会继承父目录的 setgid 位。通过这个方法,你能够以一个指定的用户组身份来访问该目录里边的文件,而不必管文件属主的主属组。 # chmod g+s [filename] 以八进制形式来设置 setgid 位,在当前基本权限(或者想要设置的权限)前加上数字 2 就行了。 - # chmod 2755 [directory] + # chmod 2755 [filename] -**给目录设置 SETGID 位** +**给目录设置 Setgid 位** ![Add Setgid in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/add-setgid-to-directory.png) -给命令设置 setgid 位 +*给命令设置 setgid 位* -**理解 Sticky 位** +**理解黏连(Sticky)位** -文件设置了 Sticky 为之后,Linux 会将文件忽略,对于该文件影响到的目录,除了属主或者 root 用户外,其他用户无法删除,甚至重命名目录中其他文件也不行。 +文件设置了黏连(Sticky)位是没有意义,Linux 会忽略该位。如果设置到目录上,会防止其内的文件被删除或改名,除非你是该目录或文件的属主、或者是 root 用户。 -# chmod o+t [directory] + # chmod o+t [directory] 以八进制形式来设置 sticky 位,在当前基本权限(或者想要设置的权限)前加上数字 1 就行了。 -# chmod 1755 [directory] + # chmod 1755 [directory] -若没有 sticky 位,任何有权限读写目录的用户都可删除和重命名文件。因此,sticky 为通常出现在像 /tmp 之类的目录,这些目录是所有人都具有写权限的。 +若没有黏连位,任何有权限读写目录的用户都可删除和重命名其中的文件。因此,黏连位通常出现在像 /tmp 之类的目录,这些目录是所有人都具有写权限的。 ![Add Stickybit in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/add-sticky-bit-to-directory.png) -给目录设置 sticky 位 +*给目录设置黏连位* ### Linux 特殊文件属性 ### @@ -240,7 +247,7 @@ passwd 命令例示 ![Protect File from Deletion](http://www.tecmint.com/wp-content/uploads/2014/10/chattr-command.png) -通过 Chattr 命令来包含文件 +*通过 Chattr 命令来包含文件* ### 访问 root 账户并启用 sudo ### @@ -251,15 +258,16 @@ passwd 命令例示 然后输入 root 账户密码。 倘若授权成功,你将以 root 身份登录,工作目录则是登录前所在的位置。如果是想要一登录就自动进入 root 用户的家目录,请运行: + $ su - 然后输入 root 账户密码。 -![Enable sudo Access on Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Enable-Sudo-Access.png) +![switch user by su ](http://www.tecmint.com/wp-content/uploads/2014/10/Enable-Sudo-Access.png) -为用户启用 sudo 访问权限 +*用户通过 su 切换* -执行上个步骤需要普通用户知道 root 账户的密码,这样会引起非常严重的安全问题。于是,系统管理员通常会配置 sudo 命令来让普通用户在严格控制的环境中以其他用户身份(通常是 root)来执行命令。所有,可以在严格控制用户的情况下,又允许他运行一条或多条特权命令。 +执行上个步骤需要普通用户知道 root 账户的密码,这样会引起非常严重的安全问题。于是,系统管理员通常会配置 sudo 命令来让普通用户在严格控制的环境中以其他用户身份(通常是 root)来执行命令。所以,可以在严格控制用户的情况下,又允许他运行一条或多条特权命令。 - 扩展阅读:[Difference Between su and sudo User][5] @@ -269,7 +277,7 @@ passwd 命令例示 # visudo -这样会使用 vim(如果你按照 [Install and Use vim as Editor – Part 2][6] 里边说的来编辑文件)来打开 /etc/sudoers 文件。 +这样会使用 vim(你可以按照 [LFCS 系列第二讲:如何安装和使用纯文本编辑器 vi/vim][6] 里边说的来编辑文件)来打开 /etc/sudoers 文件。 以下是需要设置的相关的行: @@ -283,19 +291,19 @@ passwd 命令例示 Defaults secure_path="/usr/sbin:/usr/bin:/sbin:/usr/local/bin" -这一行指定 sudo 将要使用的目录,这样可以阻止使用用户指定的目录,那样的话可能会危及系统。 +这一行指定 sudo 将要使用的目录,这样可以阻止使用某些用户指定的目录,那样的话可能会危及系统。 下一行是用来指定权限的: root ALL=(ALL) ALL - 第一个 ALL 关键词表明这条规则适用于所有主机。 -- 第二个 ALL 关键词表明第一个字段中指定的用户能以任何用户身份所具有的权限来运行相应命令。 +- 第二个 ALL 关键词表明第一个字段中所指定的用户能以任何用户身份的权限来运行相应命令。 - 第三个 ALL 关键词表明可以运行任何命令。 tecmint ALL=/bin/yum update -如果 = 号后边没有指定用户,sudo 则默认为 root 用户。本例中,tecmint 用户能以 root身份运行 yum update 命令。 +如果 = 号后边没有指定用户,sudo 则默认为 root 用户。本例中,tecmint 用户能以 root 身份运行 yum update 命令。 gacanepa ALL=NOPASSWD:/bin/updatedb @@ -303,16 +311,17 @@ NOPASSWD 关键词表明 gacanepa 用户不需要密码,可以直接运行 /bi %admin ALL=(ALL) ALL -% 符号表示该行应用 admin 用户组。其他部分的含义与对于用户的含义是一样的。本例表示 admin 用户组的成员可以通过任何主机的链接来运行任何命令。 +% 符号表示该行应用于 admin 用户组。其他部分的含义与对于用户的含义是一样的。本例表示 admin 用户组的成员可以通过任何主机连接来运行任何命令。 通过 sudo -l 命令可以查看,你的账户拥有什么样的权限。 ![Sudo Access Rules](http://www.tecmint.com/wp-content/uploads/2014/10/sudo-access-rules.png) -Sudo 访问规则 +*Sudo 访问规则* ### 总结 ### -对于系统管理员来说,高效能的用户和文件管理技能是非常必要的。本文已经涵盖了这些内容,我们希望你将这些作为一个开始,,然后慢慢进步。随时在下边发表评论或提问,我们会尽快回应的。 + +对于系统管理员来说,高效能的用户和文件管理技能是非常必要的。本文已经涵盖了这些内容,我们希望你将这些作为一个开始,然后慢慢进步。随时在下边发表评论或提问,我们会尽快回应的。 -------------------------------------------------------------------------------- @@ -320,14 +329,14 @@ via: http://www.tecmint.com/manage-users-and-groups-in-linux/ 作者:[Gabriel Cánepa][a] 译者:[GHLandy](https://github.com/GHLandy) -校对:[校对者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/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/ +[3]:https://linux.cn/article-7171-1.html [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/ +[6]:https://linux.cn/article-7165-1.html From 2bfad78ab032b04b4ec1ac3d742d34deb25dece1 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 2 Jun 2016 22:08:39 +0800 Subject: [PATCH 0844/1469] =?UTF-8?q?=E5=BD=92=E6=A1=A3201605?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Source Linux Distributions Would Presidential Hopefuls Run.md | 0 .../20151019 Gaming On Linux--All You Need To Know.md | 0 .../20151122 Doubly linked list in the Linux Kernel.md | 0 .../{ => 201605}/20151123 Data Structures in the Linux Kernel.md | 0 .../20151124 Review--5 memory debuggers for Linux coding.md | 0 ...eful Linux and Unix Tape Managements Commands For Sysadmins.md | 0 ...em Restore Point) your Ubuntu or Linux Mint with SystemBack.md | 0 ...20151202 8 things to do after installing openSUSE Leap 42.1.md | 0 published/{ => 201605}/20151202 A new Mindcraft moment.md | 0 published/{ => 201605}/20151202 KDE vs GNOME vs XFCE Desktop.md | 0 .../20151207 5 great Raspberry Pi projects for the classroom.md | 0 ...ix Desktop Fun--Text Mode ASCII-art Box and Comment Drawing.md | 0 .../{ => 201605}/20151227 Upheaval in the Debian Live project.md | 0 published/{ => 201605}/20160204 An Introduction to SELinux.md | 0 ... Intel shows budget Android phone powering big-screen Linux.md | 0 .../20160225 How to add open source experience to your resume.md | 0 published/{ => 201605}/20160225 The Tao of project management.md | 0 .../{ => 201605}/20160301 Linux gives me all the tools I need.md | 0 ...160415 Docker 1.11 Adopts Open Container Project Components.md | 0 .../20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md | 0 .../20160429 Master OpenStack with 5 new tutorials.md | 0 .../20160516 Open source from a recruiter's perspective.md | 0 22 files changed, 0 insertions(+), 0 deletions(-) rename published/{ => 201605}/20150820 Which Open Source Linux Distributions Would Presidential Hopefuls Run.md (100%) rename published/{ => 201605}/20151019 Gaming On Linux--All You Need To Know.md (100%) rename published/{ => 201605}/20151122 Doubly linked list in the Linux Kernel.md (100%) rename published/{ => 201605}/20151123 Data Structures in the Linux Kernel.md (100%) rename published/{ => 201605}/20151124 Review--5 memory debuggers for Linux coding.md (100%) rename published/{ => 201605}/20151130 Useful Linux and Unix Tape Managements Commands For Sysadmins.md (100%) rename published/{ => 201605}/20151201 Backup (System Restore Point) your Ubuntu or Linux Mint with SystemBack.md (100%) rename published/{ => 201605}/20151202 8 things to do after installing openSUSE Leap 42.1.md (100%) rename published/{ => 201605}/20151202 A new Mindcraft moment.md (100%) rename published/{ => 201605}/20151202 KDE vs GNOME vs XFCE Desktop.md (100%) rename published/{ => 201605}/20151207 5 great Raspberry Pi projects for the classroom.md (100%) rename published/{ => 201605}/20151215 Linux or Unix Desktop Fun--Text Mode ASCII-art Box and Comment Drawing.md (100%) rename published/{ => 201605}/20151227 Upheaval in the Debian Live project.md (100%) rename published/{ => 201605}/20160204 An Introduction to SELinux.md (100%) rename published/{ => 201605}/20160223 Intel shows budget Android phone powering big-screen Linux.md (100%) rename published/{ => 201605}/20160225 How to add open source experience to your resume.md (100%) rename published/{ => 201605}/20160225 The Tao of project management.md (100%) rename published/{ => 201605}/20160301 Linux gives me all the tools I need.md (100%) rename published/{ => 201605}/20160415 Docker 1.11 Adopts Open Container Project Components.md (100%) rename published/{ => 201605}/20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md (100%) rename published/{ => 201605}/20160429 Master OpenStack with 5 new tutorials.md (100%) rename published/{ => 201605}/20160516 Open source from a recruiter's perspective.md (100%) diff --git a/published/20150820 Which Open Source Linux Distributions Would Presidential Hopefuls Run.md b/published/201605/20150820 Which Open Source Linux Distributions Would Presidential Hopefuls Run.md similarity index 100% rename from published/20150820 Which Open Source Linux Distributions Would Presidential Hopefuls Run.md rename to published/201605/20150820 Which Open Source Linux Distributions Would Presidential Hopefuls Run.md diff --git a/published/20151019 Gaming On Linux--All You Need To Know.md b/published/201605/20151019 Gaming On Linux--All You Need To Know.md similarity index 100% rename from published/20151019 Gaming On Linux--All You Need To Know.md rename to published/201605/20151019 Gaming On Linux--All You Need To Know.md diff --git a/published/20151122 Doubly linked list in the Linux Kernel.md b/published/201605/20151122 Doubly linked list in the Linux Kernel.md similarity index 100% rename from published/20151122 Doubly linked list in the Linux Kernel.md rename to published/201605/20151122 Doubly linked list in the Linux Kernel.md diff --git a/published/20151123 Data Structures in the Linux Kernel.md b/published/201605/20151123 Data Structures in the Linux Kernel.md similarity index 100% rename from published/20151123 Data Structures in the Linux Kernel.md rename to published/201605/20151123 Data Structures in the Linux Kernel.md diff --git a/published/20151124 Review--5 memory debuggers for Linux coding.md b/published/201605/20151124 Review--5 memory debuggers for Linux coding.md similarity index 100% rename from published/20151124 Review--5 memory debuggers for Linux coding.md rename to published/201605/20151124 Review--5 memory debuggers for Linux coding.md diff --git a/published/20151130 Useful Linux and Unix Tape Managements Commands For Sysadmins.md b/published/201605/20151130 Useful Linux and Unix Tape Managements Commands For Sysadmins.md similarity index 100% rename from published/20151130 Useful Linux and Unix Tape Managements Commands For Sysadmins.md rename to published/201605/20151130 Useful Linux and Unix Tape Managements Commands For Sysadmins.md diff --git a/published/20151201 Backup (System Restore Point) your Ubuntu or Linux Mint with SystemBack.md b/published/201605/20151201 Backup (System Restore Point) your Ubuntu or Linux Mint with SystemBack.md similarity index 100% rename from published/20151201 Backup (System Restore Point) your Ubuntu or Linux Mint with SystemBack.md rename to published/201605/20151201 Backup (System Restore Point) your Ubuntu or Linux Mint with SystemBack.md diff --git a/published/20151202 8 things to do after installing openSUSE Leap 42.1.md b/published/201605/20151202 8 things to do after installing openSUSE Leap 42.1.md similarity index 100% rename from published/20151202 8 things to do after installing openSUSE Leap 42.1.md rename to published/201605/20151202 8 things to do after installing openSUSE Leap 42.1.md diff --git a/published/20151202 A new Mindcraft moment.md b/published/201605/20151202 A new Mindcraft moment.md similarity index 100% rename from published/20151202 A new Mindcraft moment.md rename to published/201605/20151202 A new Mindcraft moment.md diff --git a/published/20151202 KDE vs GNOME vs XFCE Desktop.md b/published/201605/20151202 KDE vs GNOME vs XFCE Desktop.md similarity index 100% rename from published/20151202 KDE vs GNOME vs XFCE Desktop.md rename to published/201605/20151202 KDE vs GNOME vs XFCE Desktop.md diff --git a/published/20151207 5 great Raspberry Pi projects for the classroom.md b/published/201605/20151207 5 great Raspberry Pi projects for the classroom.md similarity index 100% rename from published/20151207 5 great Raspberry Pi projects for the classroom.md rename to published/201605/20151207 5 great Raspberry Pi projects for the classroom.md diff --git a/published/20151215 Linux or Unix Desktop Fun--Text Mode ASCII-art Box and Comment Drawing.md b/published/201605/20151215 Linux or Unix Desktop Fun--Text Mode ASCII-art Box and Comment Drawing.md similarity index 100% rename from published/20151215 Linux or Unix Desktop Fun--Text Mode ASCII-art Box and Comment Drawing.md rename to published/201605/20151215 Linux or Unix Desktop Fun--Text Mode ASCII-art Box and Comment Drawing.md diff --git a/published/20151227 Upheaval in the Debian Live project.md b/published/201605/20151227 Upheaval in the Debian Live project.md similarity index 100% rename from published/20151227 Upheaval in the Debian Live project.md rename to published/201605/20151227 Upheaval in the Debian Live project.md diff --git a/published/20160204 An Introduction to SELinux.md b/published/201605/20160204 An Introduction to SELinux.md similarity index 100% rename from published/20160204 An Introduction to SELinux.md rename to published/201605/20160204 An Introduction to SELinux.md diff --git a/published/20160223 Intel shows budget Android phone powering big-screen Linux.md b/published/201605/20160223 Intel shows budget Android phone powering big-screen Linux.md similarity index 100% rename from published/20160223 Intel shows budget Android phone powering big-screen Linux.md rename to published/201605/20160223 Intel shows budget Android phone powering big-screen Linux.md diff --git a/published/20160225 How to add open source experience to your resume.md b/published/201605/20160225 How to add open source experience to your resume.md similarity index 100% rename from published/20160225 How to add open source experience to your resume.md rename to published/201605/20160225 How to add open source experience to your resume.md diff --git a/published/20160225 The Tao of project management.md b/published/201605/20160225 The Tao of project management.md similarity index 100% rename from published/20160225 The Tao of project management.md rename to published/201605/20160225 The Tao of project management.md diff --git a/published/20160301 Linux gives me all the tools I need.md b/published/201605/20160301 Linux gives me all the tools I need.md similarity index 100% rename from published/20160301 Linux gives me all the tools I need.md rename to published/201605/20160301 Linux gives me all the tools I need.md diff --git a/published/20160415 Docker 1.11 Adopts Open Container Project Components.md b/published/201605/20160415 Docker 1.11 Adopts Open Container Project Components.md similarity index 100% rename from published/20160415 Docker 1.11 Adopts Open Container Project Components.md rename to published/201605/20160415 Docker 1.11 Adopts Open Container Project Components.md diff --git a/published/20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md b/published/201605/20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md similarity index 100% rename from published/20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md rename to published/201605/20160426 IS UBUNTU’S SNAP PACKAGING REALLY SECURE.md diff --git a/published/20160429 Master OpenStack with 5 new tutorials.md b/published/201605/20160429 Master OpenStack with 5 new tutorials.md similarity index 100% rename from published/20160429 Master OpenStack with 5 new tutorials.md rename to published/201605/20160429 Master OpenStack with 5 new tutorials.md diff --git a/published/20160516 Open source from a recruiter's perspective.md b/published/201605/20160516 Open source from a recruiter's perspective.md similarity index 100% rename from published/20160516 Open source from a recruiter's perspective.md rename to published/201605/20160516 Open source from a recruiter's perspective.md From 3494ad357d0cc99ff54d783dde0b74c81175d46c Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 2 Jun 2016 22:24:17 +0800 Subject: [PATCH 0845/1469] =?UTF-8?q?=E6=9B=B4=E6=AD=A3=E8=AF=91=E8=80=85?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @kylepeng93 ,@pengkai , @mudongliang --- ...20160225 How to add open source experience to your resume.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/201605/20160225 How to add open source experience to your resume.md b/published/201605/20160225 How to add open source experience to your resume.md index cff9f4c6f1..6c36651976 100644 --- a/published/201605/20160225 How to add open source experience to your resume.md +++ b/published/201605/20160225 How to add open source experience to your resume.md @@ -68,7 +68,7 @@ via: https://opensource.com/business/16/2/add-open-source-to-your-resume 作者:[edunham][a] -译者:[pengkai](https://github.com/pengkai) +译者:[kylepeng93](https://github.com/kylepeng93) 校对:[mudongliang](https://github.com/mudongliang),[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 309ffa918849cd39cfaa834a18db33e5df860573 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 4 Jun 2016 10:51:18 +0800 Subject: [PATCH 0846/1469] translating --- .../tech/20160524 Test Fedora 24 Beta in an OpenStack cloud.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160524 Test Fedora 24 Beta in an OpenStack cloud.md b/sources/tech/20160524 Test Fedora 24 Beta in an OpenStack cloud.md index c550880223..b3cc4c666e 100644 --- a/sources/tech/20160524 Test Fedora 24 Beta in an OpenStack cloud.md +++ b/sources/tech/20160524 Test Fedora 24 Beta in an OpenStack cloud.md @@ -1,3 +1,5 @@ +translating---geekpi + Test Fedora 24 Beta in an OpenStack cloud =========================================== From f1943160f0c0fc2cb09b32b14900b096fe93ca02 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 4 Jun 2016 11:42:15 +0800 Subject: [PATCH 0847/1469] translated --- ...st Fedora 24 Beta in an OpenStack cloud.md | 79 ------------------- ...st Fedora 24 Beta in an OpenStack cloud.md | 78 ++++++++++++++++++ 2 files changed, 78 insertions(+), 79 deletions(-) delete mode 100644 sources/tech/20160524 Test Fedora 24 Beta in an OpenStack cloud.md create mode 100644 translated/tech/20160524 Test Fedora 24 Beta in an OpenStack cloud.md diff --git a/sources/tech/20160524 Test Fedora 24 Beta in an OpenStack cloud.md b/sources/tech/20160524 Test Fedora 24 Beta in an OpenStack cloud.md deleted file mode 100644 index b3cc4c666e..0000000000 --- a/sources/tech/20160524 Test Fedora 24 Beta in an OpenStack cloud.md +++ /dev/null @@ -1,79 +0,0 @@ -translating---geekpi - -Test Fedora 24 Beta in an OpenStack cloud -=========================================== - -![](https://major.io/wp-content/uploads/2012/01/fedorainfinity.png) - -Although there are a few weeks remaining before [Fedora 24][1] is released, you can test out the Fedora 24 Beta release today! This is a great way to get [a sneak peek at new features][2] and help find bugs that still need a fix. - -The [Fedora Cloud][3] image is available for download from your favorite [local mirror][4] or directly from [Fedora’s servers][5]. In this post, I’ll show you how to import this image into an OpenStack environment and begin testing Fedora 24 Beta. - -One last thing: this is beta software. It has been reliable for me so far, but your experience may vary. I would recommend waiting for the final release before deploying any mission critical applications on it. - -### Importing the image - -The older glance client (version 1) allows you to import an image from a URL that is reachable from your OpenStack environment. This is helpful since my OpenStack cloud has a much faster connection to the internet (1 Gbps) than my home does (~ 20 mbps upload speed). However, the functionality to import from a URL was [removed in version 2 of the glance client][6]. The [OpenStackClient][7] doesn’t offer the feature either. - -There are two options here: - -- Install an older version of the glance client -- Use Horizon (the web dashboard) - -Getting an older version of glance client installed is challenging. The OpenStack requirements file for the liberty release [leaves the version of glance client without a maximum version cap][8] and it’s difficult to get all of the dependencies in order to make the older glance client work. - -Let’s use Horizon instead so we can get back to the reason for the post. - -### Adding an image in Horizon - -Log into the Horizon panel and click Compute > Images. Click + Create Image at the top right of the page and a new window should appear. Add this information in the window: - -- **Name**: Fedora 24 Cloud Beta -- **Image Source**: Image Location -- **Image Location**: http://mirrors.kernel.org/fedora/releases/test/24_Beta/CloudImages/x86_64/images/Fedora-Cloud-Base-24_Beta-1.6.x86_64.qcow2 -- **Format**: QCOW2 – QEMU Emulator -- **Copy Data**: ensure the box is checked - -When you’re finished, the window should look like this: - -![](https://major.io/wp-content/uploads/2016/05/horizon_image.png) - -Click Create Image and the images listing should show Saving for a short period of time. Once it switches to Active, you’re ready to build an instance. - -### Building the instance - -Since we’re already in Horizon, we can finish out the build process there. - -On the image listing page, find the row with the image we just uploaded and click Launch Instance on the right side. A new window will appear. The Image Name drop down should already have the Fedora 24 Beta image selected. From here, just choose an instance name, select a security group and keypair (on the Access & Security tab), and a network (on the Networking tab). Be sure to choose a flavor that has some available storage as well (m1.tiny is not enough). - -Click Launch and wait for the instance to boot. - -Once the instance build has finished, you can connect to the instance over ssh as the fedora user. If your [security group allows the connection][9] and your keypair was configured correctly, you should be inside your new Fedora 24 Beta instance! - -Not sure what to do next? Here are some suggestions: - -- Update all packages and reboot (to ensure that you are testing the latest updates) -- Install some familiar applications and verify that they work properly -- Test out your existing automation or configuration management tools -- Open bug tickets! - --------------------------------------------------------------------------------- - -via: https://major.io/2016/05/24/test-fedora-24-beta-openstack-cloud/ - -作者:[major.io][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://major.io/about-the-racker-hacker/ -[1]: https://fedoraproject.org/wiki/Releases/24/Schedule -[2]: https://fedoraproject.org/wiki/Releases/24/ChangeSet -[3]: https://getfedora.org/en/cloud/ -[4]: https://admin.fedoraproject.org/mirrormanager/mirrors/Fedora/24/x86_64 -[5]: https://getfedora.org/en/cloud/download/ -[6]: https://wiki.openstack.org/wiki/Glance-v2-v1-client-compatability -[7]: http://docs.openstack.org/developer/python-openstackclient/ -[8]: https://github.com/openstack/requirements/blob/stable/liberty/global-requirements.txt#L159 -[9]: https://major.io/2016/05/16/troubleshooting-openstack-network-connectivity/ diff --git a/translated/tech/20160524 Test Fedora 24 Beta in an OpenStack cloud.md b/translated/tech/20160524 Test Fedora 24 Beta in an OpenStack cloud.md new file mode 100644 index 0000000000..e32cd43f2e --- /dev/null +++ b/translated/tech/20160524 Test Fedora 24 Beta in an OpenStack cloud.md @@ -0,0 +1,78 @@ +在OpenStack云中测试Fedora 24 Beta +=========================================== + +![](https://major.io/wp-content/uploads/2012/01/fedorainfinity.png) + +虽然离[Fedora 24][1]还有几周,你可以今天就测试Fedora 24 Beta了。这是一个[窥探新特性][2]的好机会,并且可以帮助找出仍需要修复的bug。 + +[Fedora Cloud][3]镜像可以从你最喜欢的[本地镜像][4]或者[Fedora的服务器][5]中下载。本篇文章我将向你展示如何将这个镜像导入Openstack环境并且测试Fedora 24 Beta。 + +最后说一下:这还是beta软件。目前对我来说是可靠的,但是你的体验可能会不同。我建议你等到正式版发布再在上面部署关键的应用。 + +### 导入镜像 + +旧版的glance客户端(版本1)允许你在Openstack环境中导入一个URL镜像。由于我Openstack云的连接速度(1 Gbps)比我家 (大约20 mbps上传速度)快,这个功能对我很有用。然而,从URL导入的功能[在glance v2中被移除了]。[OpenStackClient][7]也不支持这个功能。 + +现在由两个选择: + +- 安装旧版的glance客户端 +- 使用 Horizon (网页面板) + +获取旧版本的glance是有挑战性的。Openstack自由发布的需求文件[对glance客户端没有最高版本上限][8],并且很难找到让旧版客户端工作的依赖文件。 + +让我们使用Horizon,来回到写这篇文章的原因。 + + +### 在Horizon中添加一个镜像 + +登录Horizon面板,点击Compute->Image. 点击页面右上方的“+”创建新镜像,一个新的窗口会显示出来。并且窗口中有这些信息: + +- **Name**: Fedora 24 Cloud Beta +- **Image Source**: Image位置 +- **Image Location**: http://mirrors.kernel.org/fedora/releases/test/24_Beta/CloudImages/x86_64/images/Fedora-Cloud-Base-24_Beta-1.6.x86_64.qcow2 +- **Format**: QCOW2 – QEMU Emulator +- **Copy Data**: 确保勾选了 + +完成后,你会看到这个: + +![](https://major.io/wp-content/uploads/2016/05/horizon_image.png) + +点击创建镜像,接着会显示一段时间的Saving。一旦切换到Active,你可以构建一个实例了。 + +### 构建实例 + +既然我们在Horizon,我们可以完成构建过程了。 + +在镜像列表页面,找出我们上传的镜像并且点击右边的启动实例。一个新的窗口会显示出来。下拉框中应该已经选择了Fedora 24 Beta的镜像。在这里,选择一个实例名,选择一个安全组和密钥对(在Access & Security中)和网络(在Networking标签)。确保选择有足够容量的存储(m1.tiny还不够)。 + +点击启动并且等待实例启动。 + +一旦实例构建完成,你可以作为fedora用户通过ssh连接。如果你的[安全组允许连接][9]并且你的密钥对正确配置了,你应该在Fedora 24 Beta中了! + +还不确定接下来做什么?有下面几点建议: + +- 升级所有的包并且重启(确保你测试的是最新的更新) +- 安装一些相似的应用并且验证它们可以正常工作 +- 测试你已有的自动化或者配置管理工具 +- 打开bug报告 + +-------------------------------------------------------------------------------- + +via: https://major.io/2016/05/24/test-fedora-24-beta-openstack-cloud/ + +作者:[major.io][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://major.io/about-the-racker-hacker/ +[1]: https://fedoraproject.org/wiki/Releases/24/Schedule +[2]: https://fedoraproject.org/wiki/Releases/24/ChangeSet +[3]: https://getfedora.org/en/cloud/ +[4]: https://admin.fedoraproject.org/mirrormanager/mirrors/Fedora/24/x86_64 +[5]: https://getfedora.org/en/cloud/download/ +[6]: https://wiki.openstack.org/wiki/Glance-v2-v1-client-compatability +[7]: http://docs.openstack.org/developer/python-openstackclient/ +[8]: https://github.com/openstack/requirements/blob/stable/liberty/global-requirements.txt#L159 +[9]: https://major.io/2016/05/16/troubleshooting-openstack-network-connectivity/ From 3302e27d02a144ade816fb3fc6959e80c1afc998 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 4 Jun 2016 18:33:28 +0800 Subject: [PATCH 0848/1469] =?UTF-8?q?20160604-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...1 Linux vs. Windows device driver model.md | 190 ++++++++++++++++++ 1 file changed, 190 insertions(+) create mode 100644 sources/tech/20160531 Linux vs. Windows device driver model.md diff --git a/sources/tech/20160531 Linux vs. Windows device driver model.md b/sources/tech/20160531 Linux vs. Windows device driver model.md new file mode 100644 index 0000000000..2eda1e6927 --- /dev/null +++ b/sources/tech/20160531 Linux vs. Windows device driver model.md @@ -0,0 +1,190 @@ +Linux vs. Windows device driver model : architecture, APIs and build environment comparison +============================================================================================ + +Device drivers are parts of the operating system that facilitate usage of hardware devices via certain programming interface so that software applications can control and operate the devices. As each driver is specific to a particular operating system, you need separate Linux, Windows, or Unix device drivers to enable the use of your device on different computers. This is why when hiring a driver developer or choosing an R&D service provider, it is important to look at their experience of developing drivers for various operating system platforms. + +![](https://c2.staticflickr.com/8/7289/26775594584_d2fe7483f9_c.jpg) + +The first step in driver development is to understand the differences in the way each operating system handles its drivers, underlying driver model and architecture it uses, as well as available development tools. For example, Linux driver model is very different from the Windows one. While Windows facilitates separation of the driver development and OS development and combines drivers and OS via a set of ABI calls, Linux device driver development does not rely on any stable ABI or API, with the driver code instead being incorporated into the kernel. Each of these models has its own set of advantages and drawbacks, but it is important to know them all if you want to provide a comprehensive support for your device. + +In this article we will compare Windows and Linux device drivers and explore the differences in terms of their architecture, APIs, build development, and distribution, in hopes of providing you with an insight on how to start writing device drivers for each of these operating systems. + +### 1. Device Driver Architecture + +Windows device driver architecture is different from the one used in Linux drivers, with either of them having their own pros and cons. Differences are mainly influenced by the fact that Windows is a closed-source OS while Linux is open-source. Comparison of the Linux and Windows device driver architectures will help us understand the core differences behind Windows and Linux drivers. + +#### 1.1. Windows driver architecture + +While Linux kernel is distributed with drivers themselves, Windows kernel does not include device drivers. Instead, modern Windows device drivers are written using the Windows Driver Model (WDM) which fully supports plug-and-play and power management so that the drivers can be loaded and unloaded as necessary. + +Requests from applications are handled by a part of Windows kernel called IO manager which transforms them into IO Request Packets (IRPs) which are used to identify the request and convey data between driver layers. + +WDM provides three kinds of drivers, which form three layers: + +- Filter drivers provide optional additional processing of IRPs. +- Function drivers are the main drivers that implement interfaces to individual devices. +- Bus drivers service various adapters and bus controllers that host devices. + +An IRP passes these layers as it travels from the IO manager down to the hardware. Each layer can handle an IRP by itself and send it back to the IO manager. At the bottom there is Hardware Abstraction Layer (HAL) which provides a common interface to physical devices. + +#### 1.2. Linux driver architecture + +The core difference in Linux device driver architecture as compared to the Windows one is that Linux does not have a standard driver model or a clean separation into layers. Each device driver is usually implemented as a module that can be loaded and unloaded into the kernel dynamically. Linux provides means for plug-and-play support and power management so that drivers can use them to manage devices correctly, but this is not a requirement. + +Modules export functions they provide and communicate by calling these functions and passing around arbitrary data structures. Requests from user applications come from the filesystem or networking level, and are converted into data structures as necessary. Modules can be stacked into layers, processing requests one after another, with some modules providing a common interface to a device family such as USB devices. + +Linux device drivers support three kinds of devices: + +- Character devices which implement a byte stream interface. +- Block devices which host filesystems and perform IO with multibyte blocks of data. +- Network interfaces which are used for transferring data packets through the network. + +Linux also has a Hardware Abstraction Layer that acts as an interface to the actual hardware for the device drivers. + +### 2. Device Driver APIs + +Both Linux and Windows driver APIs are event-driven: the driver code executes only when some event happens: either when user applications want something from the device, or when the device has something to tell to the OS. + +#### 2.1. Initialization + +On Windows, drivers are represented by a DriverObject structure which is initialized during the execution of the DriverEntry function. This entry point also registers a number of callbacks to react to device addition and removal, driver unloading, and handling the incoming IRPs. Windows creates a device object when a device is connected, and this device object handles all application requests on behalf of the device driver. + +As compared to Windows, Linux device driver lifetime is managed by kernel module's module_init and module_exit functions, which are called when the module is loaded or unloaded. They are responsible for registering the module to handle device requests using the internal kernel interfaces. The module has to create a device file (or a network interface), specify a numerical identifier of the device it wishes to manage, and register a number of callbacks to be called when the user interacts with the device file. + +#### 2.2. Naming and claiming devices + +##### **Registering devices on Windows** + +Windows device driver is notified about newly connected devices in its AddDevice callback. It then proceeds to create a device object used to identify this particular driver instance for the device. Depending on the driver kind, device object can be a Physical Device Object (PDO), Function Device Object (FDO), or a Filter Device Object (FIDO). Device objects can be stacked, with a PDO in the bottom. + +Device objects exist for the whole time the device is connected to the computer. DeviceExtension structure can be used to associate global data with a device object. + +Device objects can have names of the form **\Device\DeviceName**, which are used by the system to identify and locate them. An application opens a file with such name using CreateFile API function, obtaining a handle, which then can be used to interact with the device. + +However, usually only PDOs have distinct names. Unnamed devices can be accessed via device class interfaces. The device driver registers one or more interfaces identified by 128-bit globally unique identifiers (GUIDs). User applications can then obtain a handle to such device using known GUIDs. + +##### **Registering devices on Linux** + +On Linux user applications access the devices via file system entries, usually located in the /dev directory. The module creates all necessary entries during module initialization by calling kernel functions like register_chrdev. An application issues an open system call to obtain a file descriptor, which is then used to interact with the device. This call (and further system calls with the returned descriptor like read, write, or close) are then dispatched to callback functions installed by the module into structures like file_operations or block_device_operations. + +The device driver module is responsible for allocating and maintaining any data structures necessary for its operation. A file structure passed into the file system callbacks has a private_data field, which can be used to store a pointer to driver-specific data. The block device and network interface APIs also provide similar fields. + +While applications use file system nodes to locate devices, Linux uses a concept of major and minor numbers to identify devices and their drivers internally. A major number is used to identify device drivers, while a minor number is used by the driver to identify devices managed by it. The driver has to register itself in order to manage one or more fixed major numbers, or ask the system to allocate some unused number for it. + +Currently, Linux uses 32-bit values for major-minor pairs, with 12 bits allocated for the major number allowing up to 4096 distinct drivers. The major-minor pairs are distinct for character and block devices, so a character device and a block device can use the same pair without conflicts. Network interfaces are identified by symbolic names like eth0, which are again distinct from major-minor numbers of both character and block devices. + +#### 2.3. Exchanging data + +Both Linux and Windows support three ways of transferring data between user-level applications and kernel-level drivers: + +- **Buffered Input-Output** which uses buffers managed by the kernel. For write operations the kernel copies data from a user-space buffer into a kernel-allocated buffer, and passes it to the device driver. Reads are the same, with kernel copying data from a kernel buffer into the buffer provided by the application. +- **Direct Input-Output** which does not involve copying. Instead, the kernel pins a user-allocated buffer in physical memory so that it remains there without being swapped out while data transfer is in progress. +- **Memory mapping** can also be arranged by the kernel so that the kernel and user space applications can access the same pages of memory using distinct addresses. + +##### **Driver IO modes on Windows** + +Support for Buffered IO is a built-in feature of WDM. The buffer is accessible to the device driver via the AssociatedIrp.SystemBuffer field of the IRP structure. The driver simply reads from or writes to this buffer when it needs to communicate with the userspace. + +Direct IO on Windows is mediated by memory descriptor lists (MDLs). These are semi-opaque structures accessible via MdlAddress field of the IRP. They are used to locate the physical address of the buffer allocated by the user application and pinned for the duration of the IO request. + +The third option for data transfer on Windows is called METHOD_NEITHER. In this case the kernel simply passes the virtual addresses of user-space input and output buffers to the driver, without validating them or ensuring that they are mapped into physical memory accessible by the device driver. The device driver is responsible for handling the details of the data transfer. + +##### **Driver IO modes on Linux** + +Linux provides a number of functions like clear_user, copy_to_user, strncpy_from_user, and some others to perform buffered data transfers between the kernel and user memory. These functions validate pointers to data buffers and handle all details of the data transfer by safely copying the data buffer between memory regions. + +However, drivers for block devices operate on entire data blocks of known size, which can be simply moved between the kernel and user address spaces without copying them. This case is automatically handled by Linux kernel for all block device drivers. The block request queue takes care of transferring data blocks without excess copying, and Linux system call interface takes care of converting file system requests into block requests. + +Finally, the device driver can allocate some memory pages from kernel address space (which is non-swappable) and then use the remap_pfn_range function to map the pages directly into the address space of the user process. The application can then obtain the virtual address of this buffer and use it to communicate with the device driver. + +### 3. Device Driver Development Environment + +#### 3.1. Device driver frameworks + +##### **Windows Driver Kit** + +Windows is a closed-source operating system. Microsoft provides a Windows Driver Kit to facilitate Windows device driver development by non-Microsoft vendors. The kit contains all that is necessary to build, debug, verify, and package device drivers for Windows. + +Windows Driver Model defines a clean interface framework for device drivers. Windows maintains source and binary compatibility of these interfaces. Compiled WDM drivers are generally forward-compatible: that is, an older driver can run on a newer system as is, without being recompiled, but of course it will not have access to the new features provided by the OS. However, drivers are not guaranteed to be backward-compatible. + +##### **Linux source code** + +In comparison to Windows, Linux is an open-source operating system, thus the entire source code of Linux is the SDK for driver development. There is no formal framework for device drivers, but Linux kernel includes numerous subsystems that provide common services like driver registration. The interfaces to these subsystems are described in kernel header files. + +While Linux does have defined interfaces, these interfaces are not stable by design. Linux does not provide any guarantees about forward or backward compatibility. Device drivers are required to be recompiled to work with different kernel versions. No stability guarantees allow rapid development of Linux kernel as developers do not have to support older interfaces and can use the best approach to solve the problems at hand. + +Such ever-changing environment does not pose any problems when writing in-tree drivers for Linux, as they are a part of the kernel source, because they are updated along with the kernel itself. However, closed-source drivers must be developed separately, out-of-tree, and they must be maintained to support different kernel versions. Thus Linux encourages device driver developers to maintain their drivers in-tree. + +#### 3.2. Build system for device drivers + +Windows Driver Kit adds driver development support for Microsoft Visual Studio, and includes a compiler used to build the driver code. Developing Windows device drivers is not much different from developing a user-space application in an IDE. Microsoft also provides an Enterprise Windows Driver Kit, which enables command-line build environment similar to the one of Linux. + +Linux uses Makefiles as a build system for both in-tree and out-of-tree device drivers. Linux build system is quite developed and usually a device driver needs no more than a handful of lines to produce a working binary. Developers can use any [IDE][5] as long as it can handle Linux source code base and run make, or they can easily compile drivers manually from terminal. + +#### 3.3. Documentation support + +Windows has excellent documentation support for driver development. Windows Driver Kit includes documentation and sample driver code, abundant information about kernel interfaces is available via MSDN, and there exist numerous reference and guide books on driver development and Windows internals. + +Linux documentation is not as descriptive, but this is alleviated with the whole source code of Linux being available to driver developers. The Documentation directory in the source tree documents some of the Linux subsystems, but there are [multiple books][4] concerning Linux device driver development and Linux kernel overviews, which are much more elaborate. + +Linux does not provide designated samples of device drivers, but the source code of existing production drivers is available and can be used as a reference for developing new device drivers. + +#### 3.4. Debugging support + +Both Linux and Windows have logging facilities that can be used to trace-debug driver code. On Windows one would use DbgPrint function for this, while on Linux the function is called printk. However, not every problem can be resolved by using only logging and source code. Sometimes breakpoints are more useful as they allow to examine the dynamic behavior of the driver code. Interactive debugging is also essential for studying the reasons of crashes. + +Windows supports interactive debugging via its kernel-level debugger WinDbg. This requires two machines connected via a serial port: a computer to run the debugged kernel, and another one to run the debugger and control the operating system being debugged. Windows Driver Kit includes debugging symbols for Windows kernel so Windows data structures will be partially visible in the debugger. + +Linux also supports interactive debugging by means of KDB and KGDB. Debugging support can be built into the kernel and enabled at boot time. After that one can either debug the system directly via a physical keyboard, or connect to it from another machine via a serial port. KDB offers a simple command-line interface and it is the only way to debug the kernel on the same machine. However, KDB lacks source-level debugging support. KGDB provides a more complex interface via a serial port. It enables usage of standard application debuggers like GDB for debugging Linux kernel just like any other userspace application. + +### 4. Distributing Device Drivers + +##### 4.1. Installing device drivers + +On Windows installed drivers are described by text files called INF files, which are typically stored in C:\Windows\INF directory. These files are provided by the driver vendor and define which devices are serviced by the driver, where to find the driver binaries, the version of the driver, etc. + +When a new device is plugged into the computer, Windows looks though +installed drivers and loads an appropriate one. The driver will be automatically unloaded as soon as the device is removed. + +On Linux some drivers are built into the kernel and stay permanently loaded. Non-essential ones are built as kernel modules, which are usually stored in the /lib/modules/kernel-version directory. This directory also contains various configuration files, like modules.dep describing dependencies between kernel modules. + +While Linux kernel can load some of the modules at boot time itself, generally module loading is supervised by user-space applications. For example, init process may load some modules during system initialization, and the udev daemon is responsible for tracking the newly plugged devices and loading appropriate modules for them. + +#### 4.2. Updating device drivers + +Windows provides a stable binary interface for device drivers so in some cases it is not necessary to update driver binaries together with the system. Any necessary updates are handled by the Windows Update service, which is responsible for locating, downloading, and installing up-to-date versions of drivers appropriate for the system. + +However, Linux does not provide a stable binary interface so it is necessary to recompile and update all necessary device drivers with each kernel update. Obviously, device drivers, which are built into the kernel are updated automatically, but out-of-tree modules pose a slight problem. The task of maintaining up-to-date module binaries is usually solved with [DKMS][3]: a service that automatically rebuilds all registered kernel modules when a new kernel version is installed. + +#### 4.3. Security considerations + +All Windows device drivers must be digitally signed before Windows loads them. It is okay to use self-signed certificates during development, but driver packages distributed to end users must be signed with valid certificates trusted by Microsoft. Vendors can obtain a Software Publisher Certificate from any trusted certificate authority authorized by Microsoft. This certificate is then cross-signed by Microsoft and the resulting cross-certificate is used to sign driver packages before the release. + +Linux kernel can also be configured to verify signatures of kernel modules being loaded and disallow untrusted ones. The set of public keys trusted by the kernel is fixed at the build time and is fully configurable. The strictness of checks performed by the kernel is also configurable at build time and ranges from simply issuing warnings for untrusted modules to refusing to load anything with doubtful validity. + +### 5. Conclusion + +As shown above, Windows and Linux device driver infrastructure have some things in common, such as approaches to API, but many more details are rather different. The most prominent differences stem from the fact that Windows is a closed-source operating system developed by a commercial corporation. This is what makes good, documented, stable driver ABI and formal frameworks a requirement for Windows while on Linux it would be more of a nice addition to the source code. Documentation support is also much more developed in Windows environment as Microsoft has resources necessary to maintain it. + +On the other hand, Linux does not constrain device driver developers with frameworks and the source code of the kernel and production device drivers can be just as helpful in the right hands. The lack of interface stability also has an implications as it means that up-to-date device drivers are always using the latest interfaces and the kernel itself carries lesser burden of backwards compatibility, which results in even cleaner code. + +Knowing these differences as well as specifics for each system is a crucial first step in providing effective driver development and support for your devices. We hope that this Windows and Linux device driver development comparison was helpful in understanding them, and will serve as a great starting point in your study of device driver development process. + +Download this article as ad-free PDF (made possible by [your kind donation][2]): [Download PDF][1] + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/linux-vs-windows-device-driver-model.html + +作者:[Dennis Turpitka][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/dennis +[1]: http://xmodulo.com/linux-vs-windows-device-driver-model.html?format=pdf +[2]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=PBHS9R4MB9RX4 +[3]: http://xmodulo.com/build-kernel-module-dkms-linux.html +[4]: http://xmodulo.com/go/linux_device_driver_books +[5]: http://xmodulo.com/good-ide-for-c-cpp-linux.html From 1247bbd8f57d9b05f7fe568cc00ecbd198473ab8 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 4 Jun 2016 18:35:42 +0800 Subject: [PATCH 0849/1469] =?UTF-8?q?20160604-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移动目录 --- .../20160531 Linux vs. Windows device driver model.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20160531 Linux vs. Windows device driver model.md (100%) diff --git a/sources/tech/20160531 Linux vs. Windows device driver model.md b/sources/talk/20160531 Linux vs. Windows device driver model.md similarity index 100% rename from sources/tech/20160531 Linux vs. Windows device driver model.md rename to sources/talk/20160531 Linux vs. Windows device driver model.md From 116ff7ff28f8849771e6a9079747fe7f43dfdc89 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 4 Jun 2016 18:44:27 +0800 Subject: [PATCH 0850/1469] =?UTF-8?q?20160604-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Turn Your Old Laptop into a Chromebook.md | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 sources/tech/20160527 Turn Your Old Laptop into a Chromebook.md diff --git a/sources/tech/20160527 Turn Your Old Laptop into a Chromebook.md b/sources/tech/20160527 Turn Your Old Laptop into a Chromebook.md new file mode 100644 index 0000000000..f447357e64 --- /dev/null +++ b/sources/tech/20160527 Turn Your Old Laptop into a Chromebook.md @@ -0,0 +1,121 @@ +Turn Your Old Laptop into a Chromebook +======================================== + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/cloud-ready-main.jpg?itok=gtzJVSq0) +>Learn how to install Chrome OS on your old computer with CloudReady. + +The year of Linux is here. According to [reports][1], Google sold more Chromebooks in the first quarter of 2016 than Apple sold Macbooks. And, Chromebooks are about to get even more exciting. During the Google I/O Summit, the company announced that the Google Play store for Android is coming to Chromebooks in mid June, which will allow users to run Android apps on their Chrome OS devices. + +But, you don’t have to buy a brand new laptop to use Chrome OS; you can now easily convert your old laptop or PC into a powerful Chromebook. I did this for a Dell Mini and a Dell laptop that I bought in 2009. Those two devices were collecting dust and were destined for freecycling, because modern operating systems and desktop environments like Unity, Plasma, and Gnome won’t run on them. + +If you have an old system lying around, you can easily convert it into a Chromebook. You can also dual-boot your laptop with Chrome OS, so you get the best of both worlds. + +Thanks to the open source base of Chrome OS, many solutions out there enable you to install the operating system on your device. I have tried several, but the solution I like most is CloudReady by [Neverware][2]. The company offers a free, community-supported version of the OS along with a commercially supported version for $49 per year, per device. The good part is that all licenses are transferable, so if you sell or donate the device, you can also transfer the Neverware license to the new user. + +### What You’ll Need + +Before you can get started installing CloudReady on your laptop, you will need some preparation: + +- A USB drive with 4GB or more storage + +- Open Chrome browser, go to Google Chrome Store and install [Chromebook Recovery Utility][3]. + +- Change BIOS settings of your target PC so it can boot from the USB + +### Get Started + +Neverware offers two images for CloudReady: 32 bit and 64 bit. [Download][4] the appropriate OS for your hardware from the download page. + +Extract the content of the downloaded zip file, and you will get a chromiumos_image.bin file. Now plug in the USB device and open the Chromebook recovery utility. Click on the gear at the top right corner of the tool and select erase recovery media (Figure 1). + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/cloudready-erase.png?itok=1si1QrCL) +>Figure 1: Select erase recovery media. [image:cloudready-erase] + +Next, choose the target USB drive and format it. Once formatted, go to the gear again, and this time select the use local image option. Now browse the extracted bin file, select the USB drive, click on continue, and then on the create button (Figure 2). It will start writing the image to the drive. + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/cloudready-create.png?itok=S1FGzRp-) +>Figure 2: Create CloudReady image. [Image:cloudready-create] + +Once the drive is ready with bootable CloudReady, plug it into the target PC and boot the system. It may take a while for the system to boot into Chromium OS. Once booted, you will see the screen shown in Figure 3. + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/cloud-ready-install-1.jpg?itok=D6SjlIQ4) +>Figure 3: Ready to install CloudReady. + +![](https://www.linux.com/sites/lcom/files/styles/floated_images/public/cloud-ready-install-single_crop.jpg?itok=My2rUjYC) +>Figure 4: Single-boot option. + +Go to the taskbar and click on Install CloudReady. + +You can dual boot your system between Chromium OS and another operating system, but the other OS should already be installed. + +To single boot (Figure 4) or dual boot (Figure 5) your system, choose the option in the next window. + +Just follow the click-next instructions. + +![](https://www.linux.com/sites/lcom/files/styles/floated_images/public/cloud-ready-install-dual_crop.jpg?itok=Daywck_s) +>Figure 5: Dual-boot option. + +The entire process will take up to 20 minutes, depending on the storage media and the processing power. Once installed, the PC will shut down and reboot. + +After you reboot, you will be greeted with the network settings page (Figure 6). The exciting thing is that, although I had to install wireless drivers for Linux distributions on the same hardware, everything worked out of the box with Chromium OS. + +Once you connect to the wireless network, the system will look for updates and also offer to install Adobe Flash. Once the installation is finished, you will see the Chromium OS login screen. Now you can just log into your Gmail account and start using your “Chromebook” right away. + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/cloud-ready-post-install-network.jpg?itok=gSX2fQZS) +>Figure 6: Network settings. + +### Get Netflix to Work + +If you want to play Netflix and other DRM protection-streaming sites, you do need to do some extra work. Go to settings and click on the Install Widevine plugin (Figure 7). + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/install_widevine.png?itok=bUJaRmyx0 +>Figure 7: Install Widevine. + +![](https://www.linux.com/sites/lcom/files/styles/floated_images/public/user-agent-changer.jpg?itok=5QDCLrZk) +>Figure 8: Install User Agent Switcher. + +Now you need the good old trick of using a user agent switcher (Figure 8). + +Go to Chrome Webstore and install [User Agent Switcher][5]. Once the plugin is installed, it will be added to the bookmark bar of the browser. + +Right-click on the agent switcher icon and create a new entry (Figure 9): + +``` +Name: "CloudReady Widevine" + +String: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.11 (KHTML, like Gecko) Ubuntu/16.10 Chrome/49.0.1453.93" + +Group: "Chrome" (should be filled automatically) + +Append: "Replace" + +Indicator Flag: "IE" + +Click "Add" +``` + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/spoof-netflix.png?itok=8DEZK4Pl) +>Figure 9: Create entry for CloudReady. + +Then, go to the “permanent spoof list” option and add CloudReady Widevine as the permanent string for [www.netflix.com]. + +Now, reboot your system, and you can watch Netflix and many other services. + + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/learn/turn-your-old-laptop-chromebook + +作者:[SWAPNIL BHARTIYA][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/arnieswap +[1]: https://chrome.googleblog.com/2016/05/the-google-play-store-coming-to.html +[2]: http://www.neverware.com/#introtext-3 +[3]: https://chrome.google.com/webstore/detail/chromebook-recovery-utili/jndclpdbaamdhonoechobihbbiimdgai?hl=en +[4]: http://www.neverware.com/freedownload +[5]: https://chrome.google.com/webstore/detail/user-agent-switcher-for-c/djflhoibgkdhkhhcedjiklpkjnoahfmg + From f17f4be41233113da89f2b6b00d8e9bb4e9c9070 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 4 Jun 2016 18:49:31 +0800 Subject: [PATCH 0851/1469] =?UTF-8?q?20160604-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...31 Why Ubuntu-based Distros Are Leaders.md | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 sources/talk/20160531 Why Ubuntu-based Distros Are Leaders.md diff --git a/sources/talk/20160531 Why Ubuntu-based Distros Are Leaders.md b/sources/talk/20160531 Why Ubuntu-based Distros Are Leaders.md new file mode 100644 index 0000000000..f83d0935be --- /dev/null +++ b/sources/talk/20160531 Why Ubuntu-based Distros Are Leaders.md @@ -0,0 +1,63 @@ +Why Ubuntu-based Distros Are Leaders +========================================= + +Over the years, I've tried a number of great Linux distributions. The distros that had the greatest impact with me personally were those that maintained a strong community. But there's more to a popular distribution than a strong community. Popular Linux distributions tend to appeal to newcomers, often due to features that make using the distro easier. There are obviously exceptions to this, but generally speaking it is true. + +One distribution that comes to mind is [Ubuntu][1]. Built from a solid [Debian][2] base, Ubuntu has not only become an incredibly popular Linux distro, it's also made countless other distributions such as Linux Mint a reality. In this article, I'll explore why I believe Ubuntu wins the Linux distribution wars and how it's influenced Linux on the desktop as a whole. + +### Ubuntu is easy to use + +Before I first tried Ubuntu years ago, I preferred using the KDE desktop. At that time, it was simply the environment I had the most experience with. The main reason is that KDE was the most popular option among various newbie-friendly Linux distributions. Newbie-friendly distros like Knoppix, Simply Mepis, Xandros, Linspire, amongst others and all of them pointed their users towards the welcoming arms of KDE. + +At this time, KDE did what I needed it to do and I felt little reason to explore other desktop environments. Then one day after my Debian installation failed on me (due to my own user error), I decided to try out this "Ubuntu Dapper Drake" everyone was raving about. At that time, I was less than impressed with the screenshots I had seen, but figured it would be fun to try regardless. + +The biggest impression Ubuntu Dapper Drake made on me was how cleanly everything was laid out. Bear in mind, I came from the KDE world where there were fifteen ways to make one menu change. Ubuntu's implementation of GNOME was very minimalist. + +Flash forward to 2016 with the current 16.04 release: we have multiple Ubuntu flavors available, along with tons of distributions based on the Ubuntu base. The core thing all of these Ubuntu flavors and derivative distributions share in common is they're all designed to be easy to use. And when you're trying to grow your user base, stuff like this matters. + +### Ubuntu LTS + +In the past, I've almost always stuck with LTS releases for my main desktop. The x.10 releases were best left to my testing hard drive or perhaps even an old laptop. My reasons for this were simple – I had no interest in playing with short term releases on a production PC. I'm a busy guy and simply don't feel this is the best use of my time. + +Speaking for myself, I think Ubuntu offering LTS releases is one of the big reasons why the distribution has experienced such success. Think about it – offering folks a desktop Linux distro that will be fully supported for a long period of time has its advantages. To be fair, Ubuntu's not alone here, as there are other distros that do this as well. But I think this LTS strategy bundled with a newbie friendly environment has done Ubuntu a world of good. + +### Ubuntu Snap packages + +In the past, users once raved about the ability to get newer software titles onto their systems using PPAs (personal package archives). Unfortunately, this technology has its shortcomings. Issues like PPA abandonment to discovery are both common issues when working with random software titles. + +Then came the concept of [Snap packages][3]. Certainly not a completely new concept, as similar attempts have been made in the past. But what I think Snap will offer Ubuntu users in the long term is the ability to run the latest software without having to run the very latest Ubuntu release. While I still think we're seeing the early days of where Snap packages could end up, I'm excited at the prospect of bleeding edge software on a stable distribution release. + +The obvious downside is how much disk space Snap packages might potentially use if you're running a lot of software. Not only that, but most software for Ubuntu has yet to officially make the switch over from deb packages. The first issue is solved with ample hard drive space while the latter will simply be a waiting game. + +### Ubuntu Community + +I'm among the first to admit that all of the major Linux distributions have great communities. However, I firmly believe that Ubuntu's community might be the most diverse in terms of folks from different walks of life. For example, we have forums ranging from Apple hardware support to gaming. That's a particularly wide variety of specialized discussions. + +Going beyond the forums, Ubuntu also offers a highly defined community structure. This structure includes a council, technical board, [LoCo teams][4], and Developer Membership board. There are others, but these are the areas of the community structure that really stand out to me. + +Then we have [Ask Ubuntu][5]. In my view, this feature should replace seeking help from the forums as I find it to be far more likely you'll get useful information from this area. Not only that, solutions provided that are voted highly accurate might even make it into the official documentation. + +### Ubuntu's future + +I think Ubuntu's Unity interface has done little to increase desktop adoption. I understand why it was implemented, how it's making things easier for Ubuntu developers and whatnot. But in the end, I also believe it's paved the way for Ubuntu MATE and Linux Mint to increase in popularity as well. + +Another area that I wonder about is the future of Ubuntu's IRC and mailing lists. The fact is, neither lend themselves to bettering documentation like Ask Ubuntu can. As for mailing lists, I've always felt this was a painfully dated way to collaborate, but that's just me – others feel different and that's fine. + +What say you? Do you think Ubuntu will remain a major player going into the future? Perhaps you believe Arch, Linux Mint or others will dethrone Ubuntu in terms of popularity. Hit the Comments and give your favorite distribution a shout-out. If your favorite is based on Ubuntu, explain why you prefer it over Ubuntu proper. I think many of us can mutually agree that, if nothing else, Ubuntu makes a pretty popular base from which to build other distributions. + +-------------------------------------------------------------------------------- + +via: http://www.datamation.com/open-source/why-ubuntu-based-distros-are-leaders.html + +作者:[Matt Hartley][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.datamation.com/author/Matt-Hartley-3080.html +[1]: http://www.ubuntu.com/ +[2]: https://www.debian.org/ +[3]: http://www.datamation.com/open-source/ubuntu-snap-packages-the-good-the-bad-the-ugly.html +[4]: http://loco.ubuntu.com/ +[5]: http://askubuntu.com/ From 681924b9814cb55345e0b12eb90b26bbb86beac3 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 4 Jun 2016 18:58:37 +0800 Subject: [PATCH 0852/1469] =?UTF-8?q?20160604-4=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...lation Guide on Ubuntu Server 16.04 LTS.md | 159 ++++++++++++++++++ 1 file changed, 159 insertions(+) create mode 100644 sources/tech/20160529 LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS.md diff --git a/sources/tech/20160529 LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS.md b/sources/tech/20160529 LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS.md new file mode 100644 index 0000000000..d532b0b464 --- /dev/null +++ b/sources/tech/20160529 LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS.md @@ -0,0 +1,159 @@ +LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS +========================================================= + +LAMP stack is a collection of free and open source softwares like **Linux**, Web Server (**Apache**), Database server (**MySQL / MariaDB**) and **PHP** (Scripting Language). LAMP is the platform which is required to install and build dynamic web sites and application like WordPress, Joomla, OpenCart and Drupal. + +In this article i will describe how to install LAMP on Ubuntu Server 16.04 LTS, As We know that Ubuntu is a Linux based Operating system, so it provides the first component of LAMP and i am assuming Ubuntu Server 16.04 is already installed on your system. + +### Installation of Web Server (Apache2) : + +In Ubuntu Linux Web server comes with the name Apache2, Use the beneath apt command to install it. + +``` +linuxtechi@ubuntu:~$ sudo apt update +linuxtechi@ubuntu:~$ sudo apt install apache2 -y +``` + +When Apache2 package is installed then its service is automatically started and enabled across the reboot, In case it is not started and enabled, use the following command : + +``` +linuxtechi@ubuntu:~$ sudo systemctl start apache2.service +linuxtechi@ubuntu:~$ sudo systemctl enable apache2.service +linuxtechi@ubuntu:~$ sudo systemctl status apache2.service +``` + +If Ubuntu firewall (ufw) is active, then allow the Web Server ports (80 and 443) in firewall using below commands. + +``` +linuxtechi@ubuntu:~$ sudo ufw status +Status: active +linuxtechi@ubuntu:~$ sudo ufw allow in 'Apache Full' +Rule added +Rule added (v6) +linuxtechi@ubuntu:~$ +``` + +### Access Web Server now : + +Open the Web browser and type the IP Address or Host name of your server (http://IP_Address_OR_Host_Name), In my Case my server IP is ‘192.168.1.13’ + +![](http://www.linuxtechi.com/wp-content/uploads/2016/05/Apache2-Ubuntu-server-16.04-1024x955.jpg) + +### Installation of Data Base Server (MySQL Server 5.7) : + +MySQL and MariaDB are the database servers in Ubuntu 16.04. MySQL Server and MariaDB Server’s packages are available in the default repositories and we can install either of the database. Run the following apt command to install MySQL Server from terminal. + +``` +linuxtechi@ubuntu:~$ sudo apt install mysql-server mysql-client +``` + +During the installation, it will prompt us to set the root password of mysql server. + +![](http://www.linuxtechi.com/wp-content/uploads/2016/05/Enter-root-password-mysql-server-ubuntu-16-04.jpg) + +Confirm root password and click on ‘OK’ + +![](http://www.linuxtechi.com/wp-content/uploads/2016/05/confirm-root-password-mysql-server-ubuntu-16-04.jpg) + +Installation of MySQL Server is completed Now. MySQL Service will be started and enabled automatically.We can verify the MySQL Server’s service using below systemcl command : + +``` +linuxtechi@ubuntu:~$ sudo systemctl status mysql.service +``` + +### Installation of MariaDB Server : + +Use the beneath command to install MariaDB Server 10.0 from the terminal. + +``` +linuxtechi@ubuntu:~$ sudo apt install mariadb-server +``` + +Run the following command to set root password of mariadb and disable other options like disable remote login. + +``` +linuxtechi@ubuntu:~$ sudo mysql_secure_installation +``` + +### Installation of PHP ( Scripting Language ) : + +PHP 7.0 is available in the Ubuntu repositories. Execute the beneath command from the terminal to install PHP 7 : + +``` +linuxtechi@ubuntu:~$ sudo apt install php7.0-mysql php7.0-curl php7.0-json php7.0-cgi php7.0 libapache2-mod-php7.0 +``` + +Create a sample php page and place it in apache document root (/var/ww/html) + +``` +linuxtechi@ubuntu:~$ vi samplepage.php + +``` + +Save and exit the file. + +``` +linuxtechi@ubuntu:~$ sudo mv samplepage.php /var/www/html/ +``` + +Now Access the sample PHP page from the Web Browser, type : “http:///samplepage.php” , You should get the page like below. + +![](http://www.linuxtechi.com/wp-content/uploads/2016/05/Sample-PHP-Page-Ubuntu-Server-16-04.jpg) + +Above Page shows that our PHP installation is completed successfully. + +### Installation of phpMyAdmin : + +phpMyAdmin allows us to perform all the database related administrative and other DB operation task from its web interface. Its package is already listed in the Ubuntu server repositories. + +Use the below commands to Install phpMyAdmin on Ubuntu server 16.04 LTS. + +``` +linuxtechi@ubuntu:~$ sudo apt install php-mbstring php7.0-mbstring php-gettext +linuxtechi@ubuntu:~$ sudo systemctl restart apache2.service +linuxtechi@ubuntu:~$ sudo apt install phpmyadmin +``` + +During its installation it will prompt us to choose the Web server to be configured for phpMyAdmin. + +Select Apache2 and Click on OK. + +![](http://www.linuxtechi.com/wp-content/uploads/2016/05/Web-Server-for-phpMyAdmin-Ubuntu-Server-16-04.jpg) + +Click on ‘Yes’ to Configure database for phpMyAdmin. + +![](http://www.linuxtechi.com/wp-content/uploads/2016/05/configure-database-for-phpmyadmin-ubuntu-server-16-04.jpg) + +Specify the password for phpMyAdmin to register with Database Server. + +![](http://www.linuxtechi.com/wp-content/uploads/2016/05/Select-Password-for-phpMyadmin-ubuntu-16-04-1024x433.jpg) + +Confirm the password for phpMyAdmin and then click on ‘OK’ + +![](http://www.linuxtechi.com/wp-content/uploads/2016/05/confirm-password-for-phpmyadmin-ubuntu-server-16-04.jpg) + +Now try to access the phpMyAdmin, open the browser type : “http://Server_IP_OR_Host_Name/phpmyadmin” + +Use the user name as ‘root’ and password that we set during the installation. + +![](http://www.linuxtechi.com/wp-content/uploads/2016/05/phpMyAdmin-Ubuntu-Server-16-04-1024x557.jpg) + +When we click on ‘Go’, it will redirect the page to ‘phpMyAdmin’ Web interface as shown below. + +![](http://www.linuxtechi.com/wp-content/uploads/2016/05/phpMyAdmin-portal-overview-ubuntu-server-16-04-1024x557.jpg) + +That’s it, LAMP stack is successfully installed and is ready for use 🙂 . Please share your feedback and comments. + +-------------------------------------------------------------------------------- + +via: http://www.linuxtechi.com/lamp-stack-installation-on-ubuntu-server-16-04/ + +作者:[Pradeep Kumar][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.linuxtechi.com/author/pradeep/ From c033eaba24eac750cbe0c4499a70b78ff6bf105f Mon Sep 17 00:00:00 2001 From: alim0x Date: Sat, 4 Jun 2016 21:09:17 +0800 Subject: [PATCH 0853/1469] [translating]Turn Your Old Laptop into a Chromebook --- sources/tech/20160527 Turn Your Old Laptop into a Chromebook.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160527 Turn Your Old Laptop into a Chromebook.md b/sources/tech/20160527 Turn Your Old Laptop into a Chromebook.md index f447357e64..a7413e72e6 100644 --- a/sources/tech/20160527 Turn Your Old Laptop into a Chromebook.md +++ b/sources/tech/20160527 Turn Your Old Laptop into a Chromebook.md @@ -1,3 +1,5 @@ +alim0x translating + Turn Your Old Laptop into a Chromebook ======================================== From 1c6c356e4fe999dff753e04121d9667b8056857b Mon Sep 17 00:00:00 2001 From: alim0x Date: Sat, 4 Jun 2016 22:47:21 +0800 Subject: [PATCH 0854/1469] [translated]Turn Your Old Laptop into a Chromebook --- ... Turn Your Old Laptop into a Chromebook.md | 123 ------------------ ... Turn Your Old Laptop into a Chromebook.md | 121 +++++++++++++++++ 2 files changed, 121 insertions(+), 123 deletions(-) delete mode 100644 sources/tech/20160527 Turn Your Old Laptop into a Chromebook.md create mode 100644 translated/tech/20160527 Turn Your Old Laptop into a Chromebook.md diff --git a/sources/tech/20160527 Turn Your Old Laptop into a Chromebook.md b/sources/tech/20160527 Turn Your Old Laptop into a Chromebook.md deleted file mode 100644 index a7413e72e6..0000000000 --- a/sources/tech/20160527 Turn Your Old Laptop into a Chromebook.md +++ /dev/null @@ -1,123 +0,0 @@ -alim0x translating - -Turn Your Old Laptop into a Chromebook -======================================== - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/cloud-ready-main.jpg?itok=gtzJVSq0) ->Learn how to install Chrome OS on your old computer with CloudReady. - -The year of Linux is here. According to [reports][1], Google sold more Chromebooks in the first quarter of 2016 than Apple sold Macbooks. And, Chromebooks are about to get even more exciting. During the Google I/O Summit, the company announced that the Google Play store for Android is coming to Chromebooks in mid June, which will allow users to run Android apps on their Chrome OS devices. - -But, you don’t have to buy a brand new laptop to use Chrome OS; you can now easily convert your old laptop or PC into a powerful Chromebook. I did this for a Dell Mini and a Dell laptop that I bought in 2009. Those two devices were collecting dust and were destined for freecycling, because modern operating systems and desktop environments like Unity, Plasma, and Gnome won’t run on them. - -If you have an old system lying around, you can easily convert it into a Chromebook. You can also dual-boot your laptop with Chrome OS, so you get the best of both worlds. - -Thanks to the open source base of Chrome OS, many solutions out there enable you to install the operating system on your device. I have tried several, but the solution I like most is CloudReady by [Neverware][2]. The company offers a free, community-supported version of the OS along with a commercially supported version for $49 per year, per device. The good part is that all licenses are transferable, so if you sell or donate the device, you can also transfer the Neverware license to the new user. - -### What You’ll Need - -Before you can get started installing CloudReady on your laptop, you will need some preparation: - -- A USB drive with 4GB or more storage - -- Open Chrome browser, go to Google Chrome Store and install [Chromebook Recovery Utility][3]. - -- Change BIOS settings of your target PC so it can boot from the USB - -### Get Started - -Neverware offers two images for CloudReady: 32 bit and 64 bit. [Download][4] the appropriate OS for your hardware from the download page. - -Extract the content of the downloaded zip file, and you will get a chromiumos_image.bin file. Now plug in the USB device and open the Chromebook recovery utility. Click on the gear at the top right corner of the tool and select erase recovery media (Figure 1). - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/cloudready-erase.png?itok=1si1QrCL) ->Figure 1: Select erase recovery media. [image:cloudready-erase] - -Next, choose the target USB drive and format it. Once formatted, go to the gear again, and this time select the use local image option. Now browse the extracted bin file, select the USB drive, click on continue, and then on the create button (Figure 2). It will start writing the image to the drive. - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/cloudready-create.png?itok=S1FGzRp-) ->Figure 2: Create CloudReady image. [Image:cloudready-create] - -Once the drive is ready with bootable CloudReady, plug it into the target PC and boot the system. It may take a while for the system to boot into Chromium OS. Once booted, you will see the screen shown in Figure 3. - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/cloud-ready-install-1.jpg?itok=D6SjlIQ4) ->Figure 3: Ready to install CloudReady. - -![](https://www.linux.com/sites/lcom/files/styles/floated_images/public/cloud-ready-install-single_crop.jpg?itok=My2rUjYC) ->Figure 4: Single-boot option. - -Go to the taskbar and click on Install CloudReady. - -You can dual boot your system between Chromium OS and another operating system, but the other OS should already be installed. - -To single boot (Figure 4) or dual boot (Figure 5) your system, choose the option in the next window. - -Just follow the click-next instructions. - -![](https://www.linux.com/sites/lcom/files/styles/floated_images/public/cloud-ready-install-dual_crop.jpg?itok=Daywck_s) ->Figure 5: Dual-boot option. - -The entire process will take up to 20 minutes, depending on the storage media and the processing power. Once installed, the PC will shut down and reboot. - -After you reboot, you will be greeted with the network settings page (Figure 6). The exciting thing is that, although I had to install wireless drivers for Linux distributions on the same hardware, everything worked out of the box with Chromium OS. - -Once you connect to the wireless network, the system will look for updates and also offer to install Adobe Flash. Once the installation is finished, you will see the Chromium OS login screen. Now you can just log into your Gmail account and start using your “Chromebook” right away. - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/cloud-ready-post-install-network.jpg?itok=gSX2fQZS) ->Figure 6: Network settings. - -### Get Netflix to Work - -If you want to play Netflix and other DRM protection-streaming sites, you do need to do some extra work. Go to settings and click on the Install Widevine plugin (Figure 7). - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/install_widevine.png?itok=bUJaRmyx0 ->Figure 7: Install Widevine. - -![](https://www.linux.com/sites/lcom/files/styles/floated_images/public/user-agent-changer.jpg?itok=5QDCLrZk) ->Figure 8: Install User Agent Switcher. - -Now you need the good old trick of using a user agent switcher (Figure 8). - -Go to Chrome Webstore and install [User Agent Switcher][5]. Once the plugin is installed, it will be added to the bookmark bar of the browser. - -Right-click on the agent switcher icon and create a new entry (Figure 9): - -``` -Name: "CloudReady Widevine" - -String: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.11 (KHTML, like Gecko) Ubuntu/16.10 Chrome/49.0.1453.93" - -Group: "Chrome" (should be filled automatically) - -Append: "Replace" - -Indicator Flag: "IE" - -Click "Add" -``` - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/spoof-netflix.png?itok=8DEZK4Pl) ->Figure 9: Create entry for CloudReady. - -Then, go to the “permanent spoof list” option and add CloudReady Widevine as the permanent string for [www.netflix.com]. - -Now, reboot your system, and you can watch Netflix and many other services. - - --------------------------------------------------------------------------------- - -via: https://www.linux.com/learn/turn-your-old-laptop-chromebook - -作者:[SWAPNIL BHARTIYA][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.linux.com/users/arnieswap -[1]: https://chrome.googleblog.com/2016/05/the-google-play-store-coming-to.html -[2]: http://www.neverware.com/#introtext-3 -[3]: https://chrome.google.com/webstore/detail/chromebook-recovery-utili/jndclpdbaamdhonoechobihbbiimdgai?hl=en -[4]: http://www.neverware.com/freedownload -[5]: https://chrome.google.com/webstore/detail/user-agent-switcher-for-c/djflhoibgkdhkhhcedjiklpkjnoahfmg - diff --git a/translated/tech/20160527 Turn Your Old Laptop into a Chromebook.md b/translated/tech/20160527 Turn Your Old Laptop into a Chromebook.md new file mode 100644 index 0000000000..3c7038a2a2 --- /dev/null +++ b/translated/tech/20160527 Turn Your Old Laptop into a Chromebook.md @@ -0,0 +1,121 @@ +把你的旧笔记本变成 Chromebook +======================================== + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/cloud-ready-main.jpg?itok=gtzJVSq0) +>学习如何用 CloudReady 在你的旧电脑上安装 Chrome OS + +Linux 之年就在眼前。根据[报道][1],Google 在 2016 年第一季度卖出了比苹果卖出的 Macbook 更多的 Chromebook。并且,Chromebook 即将变得更加激动人心。在 Google I/O 大会上,Google 宣布安卓 Google Play 商店将在 6 月中旬来到 Chromebook,这让用户能够在他们的 Chrome OS 设备上运行安卓应用。 + +但是,你不需要购买一台全新的使用 Chrome OS 的笔记本,你可以轻松地将你的旧笔记本或电脑转换成强大的 Chromebook。我在一台 Dell Mini 和一台 2009 年购买的 Dell 笔记本上进行了尝试。那两台设备都在吃灰,而且本来注定是要被回收的,因为现代的操作系统和桌面环境,比如 Unity,Plasma 以及 Gnome 它们跑不动。 + +如果你手边有旧设备,你可以轻松地将它变成 Chromebook。你还可以在你的笔记本上安装 Chrome OS 双系统,这样你就可以同时享受不同系统的优点了。 + +多亏了 Chrome OS 的开源基础,有很多方案可以让你在你的设备上安装 Chrome OS。我试过几个,但我最喜欢的方案是 [Neverware][2] 的 CloudReady。这家公司提供一个免费的,社区支持版的系统,还有一个商业支持版,每台设备每年 49 美元。好消息是所有的授权都是可转移的,所以如果你卖掉或捐掉了设备,你也可以将 Neverware 授权转让给新用户。 + +### 你需要什么 + +在你开始在笔记本上安装 CloudReady 之前,你需要一些准备: + +- 一个容量大于等于 4GB 的 USB 存储设备 + +- 打开 Chrome 浏览器,到 Google Chrome Store 去安装 [Chromebook Recovery Utility(Chrome 恢复工具)][3] + +- 更改目标机器的 BIOS 设置以便能从 USB 启动 + +### 开始 + +Neverware 提供两个版本的 CloudReady 镜像:32 位和 64 位。从下载页面[下载][4]合适你硬件的系统版本。 + +解压下载的 zip 文件,你会得到一个 chromiumos_image.bin 文件。现在插入 U 盘并打开 Chromebook recovery utility。点击工具右上角的齿轮,选择 erase recovery media(擦除恢复媒介,如图 1)。 + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/cloudready-erase.png?itok=1si1QrCL) +>图 1:选择 erase recovery media。[image:cloudready-erase] + +接下来,选择目标 USB 驱动器并把它格式化。格式化完成后,再次打开右上齿轮,这次选择 use local image(使用本地镜像)。浏览解压的 bin 文件并选中,选好 USB 驱动器,点击继续,然后点击创建按钮(图 2)。它会开始将镜像写入驱动器。 + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/cloudready-create.png?itok=S1FGzRp-) +>图 2:创建 CloudReady 镜像。[Image:cloudready-create] + +驱动器写好可启动的 CloudReady 之后,插到目标 PC 上并启动。系统启动进 Chromium OS 需要一小段时间。启动之后,你会看到图 3 中的界面。 + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/cloud-ready-install-1.jpg?itok=D6SjlIQ4) +>图 3:准备好安装 CloudReady。 + +![](https://www.linux.com/sites/lcom/files/styles/floated_images/public/cloud-ready-install-single_crop.jpg?itok=My2rUjYC) +>图 4:单系统选项。 + +到任务栏选择 Install CloudReady(安装 CloudReady)。 + +你可以安装 Chromium OS 和其它系统的双系统启动,但另一个系统这时应该已经安装好了。 + +在下一个窗口选择单系统(图 4)或是双系统(图 5)。 + +按照下一步按钮说明选择安装。 + +![](https://www.linux.com/sites/lcom/files/styles/floated_images/public/cloud-ready-install-dual_crop.jpg?itok=Daywck_s) +>图 5:双系统选项。 + +整个过程最多 20 分钟左右,这取决于存储媒介和处理能力。安装完成后,电脑会关闭并重启。 + +重启之后,你会看到网络设置页面(图 6)。让人激动的是,虽然我在相同硬件上要给 Linux 发行版安装无线驱动,到了 Chromium OS 这里是开箱即用的。 + +你连上无线网络之后,系统会自动查找更新并提供 Adobe Flash 安装。安装完成后,你会看到 Chromium OS 登录界面。现在你只需登录你的 Gmail 账户,开始使用你的“Chromebook”即可。 + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/cloud-ready-post-install-network.jpg?itok=gSX2fQZS) +>图 6:网络设置。 + +### 让 Netflix 正常工作 + +如果你想要播放 Netflix 或其它 DRM 保护流媒体站点,你需要做一些额外的工作。转到设置并点击安装 Widevine 插件(图 7)。 + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/install_widevine.png?itok=bUJaRmyx0) +>图 7:安装 Widevine。 + +![](https://www.linux.com/sites/lcom/files/styles/floated_images/public/user-agent-changer.jpg?itok=5QDCLrZk) +>图 8:安装 User Agent Switcher. + +现在你需要使用 user agent switcher 这个伎俩(图 8)。 + +到 Chrome Webstore 去安装 [User Agent Switcher][5]。插件安装完成后,它会自动添加到浏览器的书签栏。 + +右键点击 agent switcher 图标并创建一个新条目(图 9): + +``` +Name: "CloudReady Widevine" + +String: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.11 (KHTML, like Gecko) Ubuntu/16.10 Chrome/49.0.1453.93" + +Group: "Chrome" (应该被自动填上了) + +Append: "Replace" + +Indicator Flag: "IE" + +``` + +点击“添加(Add)”。 + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/spoof-netflix.png?itok=8DEZK4Pl) +>图 9:为 CloudReady 创建条目。 + +然后,到“permanent spoof list(永久欺骗列表)”选项中将 CloudReady Widevine 添加为 [www.netflix.com](http://www.netflix.com) 的永久 UA 串。 + +现在,重启机器,你就可以观看 Netflix 和其它一些服务了。 + + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/learn/turn-your-old-laptop-chromebook + +作者:[SWAPNIL BHARTIYA][a] +译者:[alim0x](https://github.com/alim0x) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/arnieswap +[1]: https://chrome.googleblog.com/2016/05/the-google-play-store-coming-to.html +[2]: http://www.neverware.com/#introtext-3 +[3]: https://chrome.google.com/webstore/detail/chromebook-recovery-utili/jndclpdbaamdhonoechobihbbiimdgai?hl=en +[4]: http://www.neverware.com/freedownload +[5]: https://chrome.google.com/webstore/detail/user-agent-switcher-for-c/djflhoibgkdhkhhcedjiklpkjnoahfmg From d2c13ee4a8bbc860f9b822ca8b878ca97debeb3a Mon Sep 17 00:00:00 2001 From: vim-kakali <1799225723@qq.com> Date: Sun, 5 Jun 2016 16:00:23 +0800 Subject: [PATCH 0855/1469] translated --- ...nfessions of a cross-platform developer.md | 76 ------------- ...nfessions of a cross-platform developer.md | 103 ++++++++++++++++++ 2 files changed, 103 insertions(+), 76 deletions(-) delete mode 100644 sources/talk/20160505 Confessions of a cross-platform developer.md create mode 100644 translated/talk/20160505 Confessions of a cross-platform developer.md diff --git a/sources/talk/20160505 Confessions of a cross-platform developer.md b/sources/talk/20160505 Confessions of a cross-platform developer.md deleted file mode 100644 index 0f6af84070..0000000000 --- a/sources/talk/20160505 Confessions of a cross-platform developer.md +++ /dev/null @@ -1,76 +0,0 @@ -vim-kakali translating - - - -Confessions of a cross-platform developer -============================================= - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/business_clouds.png?itok=cucHuJnU) - -[Andreia Gaita][1] is giving a talk at this year's OSCON, titled [Confessions of a cross-platform developer][2]. She's a long-time open source and [Mono][3] contributor, and develops primarily in C#/C++. Andreia works at GitHub, where she's focused on building the GitHub Extension manager for Visual Studio. - -I caught up with Andreia ahead of her talk to ask about cross-platform development and what she's learned in her 16 years as a cross-platform developer. - -![](https://opensource.com/sites/default/files/images/life/Interview%20banner%20Q%26A.png) - -**What languages have you found easiest and hardest to develop cross-platform code for?** - -It's less about which languages are good and more about the libraries and tooling available for those languages. The compilers/interpreters/build systems available for languages determine how easy it is to do cross-platform work with them (or whether it's even possible), and the libraries available for UI and native system access determine how deep you can integrate with the OS. With that in mind, I found C# to be the best for cross-platform work. The language itself includes features that allow fast native calls and accurate memory mapping, which you really need if you want your code to talk to the OS and native libraries. When I need very specific OS integration, I switch to C or C++. - -**What cross-platform toolkits/abstractions have you used?** - -Most of my cross-platform work has been developing tools, libraries and bindings for other people to develop cross-platform applications with, mostly in Mono/C# and C/C++. I don't get to use a lot of abstractions at that level, beyond glib and friends. I mostly rely on Mono for any cross-platform app that includes a UI, and Unity3D for the occasional game development. I play with Electron every now and then. - -**What has been your approach to build systems, and how does this vary by language or platform?** - -I try to pick the build system that is most suited for the language(s) I'm using. That way, it'll (hopefully) give me less headaches. It needs to allow for platform and architecture selection, be smart about build artifact locations (for multiple parallel builds), and be decently configurable. Most of the time I have projects combining C/C++ and C# and I want to build all the different configurations at the same time from the same source tree (Debug, Release, Windows, OSX, Linux, Android, iOS, etc, etc.), and that usually requires selecting and invoking different compilers with different flags per output build artifact. So the build system has to let me do all of this without getting (too much) in my way. I try out different build systems every now and then, just to see what's new, but in the end, I end up going back to makefiles and a combination of either shell and batch scripts or Perl scripts for driving them (because if I want users to build my things, I'd better pick a command line script language that is available everywhere). - -**How do you balance the desire for native look and feel with the need for uniform user interfaces?** - -Cross-platform UI is hard! I've implemented several cross-platform GUIs over the years, and it's the one thing for which I don't think there's an optimal solution. There's basically two options. You can pick a cross-platform GUI toolkit and do a UI that doesn't feel quite right in all the platforms you support, with a small codebase and low maintenance cost. Or you can choose to develop platform-specific UIs that will look and feel native and well integrated with a larger codebase and higher maintenance cost. The decision really depends on the type of app, how many features it has, how many resources you have, and how many platforms you're shipping to. - -In the end, I think there's an increase in users' tolerance for "One UI To Rule Them All" with frameworks like Electron. I have a Chromium+C+C# framework side project that will one day hopefully allow me build Electron-style apps in C#, giving me the best of both worlds. - -**Has building/packaging dependencies been an issue for you?** - -I'm very conservative about my use of dependencies, having been bitten so many times by breaking ABIs, clashing symbols, and missing packages. I decide which OS version(s) I'm targeting and pick the lowest common denominator release available of a dependency to minimize issues. That usually means having five different copies of Xcode and OSX Framework libraries, five different versions of Visual Studio installed side-to-side on the same machine, multiple clang and gcc versions, and a bunch of VMs running various other distros. If I'm unsure of the state of packages in the OS I'm targeting, I will sometimes link statically and sometimes submodule dependencies to make sure they're always available. And most of all, I avoid the bleeding edge unless I really, really need something there. - -**Do you use continuous integration, code review, and related tools?** - -All the time! It's the only way to keep sane. The first thing I do on a project is set up cross-platform build scripts to ensure everything is automateable as early as possible. When you're targeting multiple platforms, CI is essential. It's impossible for everyone to build all the different combinations of platforms in one machine, and as soon as you're not building all of them you're going to break something without being aware of it. In a shared multi-platform codebase, different people own different platforms and features, so the only way to guarantee quality is to have cross-team code reviews combined with CI and other analysis tools. It's no different than other software projects, there's just more points of failure. - -**Do you rely on automated build testing, or do you tend to build on each platform and test locally?** - -For tools and libraries that don't include UIs, I can usually get away with automated build testing. If there's a UI, then I need to do both—reliable, scriptable UI automation for existing GUI toolkits is rare to non-existent, so I would have to either invest in creating UI automation tools that work across all the platforms I want to support, or I do it manually. If a project uses a custom UI toolkit (like, say, an OpenGL UI like Unity3D does), then it's fairly easy to develop scriptable automation tools and automate most of that stuff. Still, there's nothing like the human ability to break things with a couple of clicks! - -**If you are developing cross-platform, do you support cross-editor build systems so that you can use Visual Studio on Windows, Qt Creator on Linux, and XCode on Mac? Or do you tend toward supporting one platform such as Eclipse on all platforms?** - -I favor cross-editor build systems. I prefer generating project files for different IDEs (preferably in a way that makes it easier to add more IDEs), with build scripts that can drive builds from the IDEs for the platform they're on. Editors are the most important tool for a developer. It takes time and effort to learn them, and they're not interchangeable. I have my favorite editors and tools, and everyone else should be able to use their favorite tool, too. - -**What is your preferred editor/development environment/IDE for cross-platform development?** - -The cross-platform developer is cursed with having to pick the lowest common denominator editor that works across the most platforms. I love Visual Studio, but I can't rely on it for anything except Windows work (and you really don't want to make Windows your primary cross-compiling platform), so I can't make it my primary IDE. Even if I could, an essential skill of cross-platform development is to know and use as many platforms as possible. That means really knowing them—using the platform's editors and libraries, getting to know the OS and its assumptions, behaviors, and limitations, etc. To do that and keep my sanity (and my shortcut muscle memory), I have to rely on cross-platform editors. So, I use Emacs and Sublime. - -**What are some of your favorite past and current cross-platform projects?** - -Mono is my all-time favorite, hands down, and most of the others revolve around it in some way. Gluezilla was a Mozilla binding I did years ago to allow C# apps to embed web browser views, and that one was a doozy. At one point I had a Winforms app, built on Linux, running on Windows with an embedded GTK view in it that was running a Mozilla browser view. The CppSharp project (formerly Cxxi, formerly CppInterop) is a project I started to generate C# bindings for C++ libraries so that you could call, create instances of, and subclass C++ classes from C#. It was done in such a way that it would detect at runtime what platform you'd be running on and what compiler was used to create the native library and generate the correct C# bindings for it. That was fun! - -**Where do you see cross-platform development heading in the future?** - -The way we build native applications is already changing, and I feel like the visual differences between the various desktop operating systems are going to become even more blurred so that it will become easier to build cross-platform apps that integrate reasonably well without being fully native. Unfortunately, that might mean applications will be worse in terms of accessibility and less innovative when it comes to using the OS to its full potential. Cross-platform development of tools, libraries, and runtimes is something that we know how to do well, but there's still a lot of work to do with cross-platform application development. - - --------------------------------------------------------------------------------- - -via: https://opensource.com/business/16/5/oscon-interview-andreia-gaita - -作者:[Marcus D. Hanwell ][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/mhanwell -[1]: https://twitter.com/sh4na -[2]: http://conferences.oreilly.com/oscon/open-source-us/public/schedule/detail/48702 -[3]: http://www.mono-project.com/ diff --git a/translated/talk/20160505 Confessions of a cross-platform developer.md b/translated/talk/20160505 Confessions of a cross-platform developer.md new file mode 100644 index 0000000000..611ccf506c --- /dev/null +++ b/translated/talk/20160505 Confessions of a cross-platform developer.md @@ -0,0 +1,103 @@ + +一位跨平台开发者的自白 +============================================= + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/business_clouds.png?itok=cucHuJnU) + +Andreia Gaita[1]将会在OSCON开源大会上发表一个题为[跨平台开发者的自白][2]的演讲。她长期从事于开源工作,并且为Mono[3]【译者注:一个致力于开创.NET在Linux上使用的开源工程】工程做着贡献。Andreia任职于GitHub,她的工作是专注于为Visual Studio构建github上的可扩展管理器。 + + +我在她发表演讲前就迫不及待的想要问她一些关于跨平台开发的事,作为一名跨平台开发者,她已经有了16年的学习经验了。 + +![](https://opensource.com/sites/default/files/images/life/Interview%20banner%20Q%26A.png) + + +**在你跨平台工作的过程中,你使用过的最简单的和最难的代码语言是什么?** + + +很少讨论某种语言的好坏,大多数是关于对于这种语言的库和工具的易用性。编译器、解释器以及构建器语言决定了用它们做跨平台开发的难易程度(不论它是否可能),能够实现UI和本地系统访问的函数库的可用性都决定了开发时兼容操作系统的程度。如果这样想,我认为C#最适合完成跨平台开发工作。这种语言有它自己的特色,它允许本地快速唤醒和精确的内存地址;如果你希望你的代码能够与系统和本地函数库进行交互,那么你就会需要C#。当我需要特殊的系统集成的时候,我就会切换到C或者C++。 + + +**你使用的跨平台开发工具或者抽象有哪些?** + +我的大部分跨平台工作都是为其他人开发工具和库,然后把它们组合起来开发跨平台的应用程序,其中大多用到MONO/C#。说真的,我不太懂抽象。大多数时候,我依赖Mono去完成一个跨平台的app开发以及它的UI,或者一个偶然的游戏开发中的Unity3D部分。我经常使用Electron【译者注:Atom编辑器的兄弟项目,可以用Electron开发桌面应用】。 + + + +**你接触过哪些构建系统?它们之间的区别是由于语言还是平台的不同?** + + +我试着选择适合我使用语言的构建系统。那样 ,就会很少遇到让我头疼的问题。它需要支持平台和体系结构间的选择、构建智能工件位置(多个并行构建)以及易配置性等。大多数时候,我的项目会结合C/C++和C#,同时我也想要为一些开源分支构建相应的配置环境(Debug, Release, Windows, OSX, Linux, Android, iOS, etc, etc.)),通常也需要为每个构建的智能工件选择带有不同标志的编译器。所以我不得不做很多工作,而这种以我的方式进行的工作并没有很多收获。我时常尝试着用不同的构建系统,仅仅是想了解到最新的情况,但是最终我还是回到使用makefile的情况,采用shell和批处理脚本之一与Perl脚本相结合的方式,以达到使用他们的目的(因为如果我想用户去做很多我做的事情,我还是最好选择一种命令行脚本语言,这样它在哪里都可以用)。 + + + +**你怎样平衡在这种统一用户接口视觉体验需求上的强烈渴望呢?** + + + +用户接口的跨平台实现很困难。在过去几年中我已经使用了一些跨平台GUI,并且我认为一些问题没有最优解。那些问题都基于两种操作,你也可以选择一个跨平台工具去做一个UI,去用你所喜欢的所有的平台,这样感觉不是太对,用小的代码库和比较低的维护费用。或者你可以选择去开发一个特有平台的UI,那样看起来就会是很本地化并且能很好的使其与一个大型的代码库结合,也会有很高的维护费用。这种决定完全取决于APP的类型。它的特色在哪里呢?你有什么资源?你可以把它运行在多少平台上? + + +最后,我认为用户对于这种框架性的“一个UI统治所有”的UI的容忍度更大了,就比如Electron。我曾经有个Chromium+C+C#的框架侧项目,并且希望我在一天内用C#构建Electron型的app,这样的话我就可以做到两全其美了。 + + + **你对构建或者打包有依赖性吗 ?** + + + 我很少谈及依赖性问题。很多次我都被ABI【译者注:应用程序二进制接口】的崩溃、存在冲突的征兆以及包的丢失问题所困扰。我决定我要使用的操作系统的版本,都是选择最低的依赖去使问题最小化。通常这就意味着有五种不同的Xcode的副本和OSX框架库 ,在同样的机器上有五种不同的Visual Studio版本需要相应的被安装,多种clang【译者注:C语言、C++、Object-C、C++语言的轻量级编译器】和gcc版本,一系列的可以运行的其他的VM版本。如果我不能确定我要使用的操作系统的包的规定,我时常会连接静态库与子模块之间的依赖确保它们一直可用。大多时候,我会避免这些很棘手的问题,除非我非常需要使用他们。 + + + **你使用能够持续集成的、代码重读的相关工具吗?** + + 基本每天都用。这是保持高效的唯一方式。我在一个项目中做的第一件事情是配置跨平台构建脚本,保证每件事尽可能自动化完成。当你想要使用多平台的时候,CI【译者注:持续集成】是至关重要的。在一个机器上,没有人能结合所有的不同的平台。并且一旦你的构建过程没有包含所有的平台,你就不会注意到你搞砸的事情。在一个共享的多平台代码库中 ,不同的人拥有不同的平台和特征,所以仅有的方法是保证跨团队浏览代码时结合CI和其他分析工具的公平性。这不同于其他的软件项目,如果不使用相关的工具就只有失败了。 + + + **你依赖于自动构建测试或者趋向于在每个平台上构建并且进行局部测试吗?** + + + 对于不包括UI的工具和库,我通常能够侥幸完成自动构建测试。如果那是一个UI,两种方法我都会用到——做一个可靠的,可自动编写脚本的UI,因为基本没有GUI工具,所以我不得不在去创建UI自动化工具,这种工具可以工作在所有的我用到的平台上,或者我也可以手动完成。如果一个项目使用一个定制的UI工具(一个像Unity3D那样做的OpenGL UI ),开发自动化的可编写脚本工具和更多的自动化工具就相当容易。不过,没有什么东西会像人类一样通过双击而搞砸事情。 + + + + **如果你要做跨平台开发,你想要在不同的平台上使用不同的编辑器,比如在Windows上使用Visual Studio,在Linux上使用Qt Creator,在Mac上使用XCode吗?还是你更趋向于使用Eclipse这样的可以在所有平台上使用的编辑器?** + + + + 我喜欢使用不同的编辑器构建系统。我更喜欢在不同的带有构建脚本的IDE上保存项目文件(可以使增加IDE变得更容易),这些脚本可以为他们支持的平台去驱动IDE开始工作。对于一个开发者来说编辑器是最重要的工具,开发者花费时间和精力去学习使用各种编辑器,但是它们都不能相互替代。我使用我最喜欢的编辑器和工具,每个人也应该能使用他们最喜爱的工具。 + + + + **在跨平台开发的时候,你更喜欢使用什么开发环境和IDE呢?** + + + 跨平台开发者好像被诅咒一样,他们不得不选择小众化的编辑器去完成大多数跨平台的工作。我爱用Visual Studio,但是我不能依赖它完成除windows平台外的工作(你可能不想让windows成为你的初级交叉编译平台,所以我不会使用它作为我的初级集成开发环境。即使我这么做了,跨平台开发者的潜意识也知道有可能会用到很多平台。这就意味着必须很熟悉他们——使用一种平台上的编辑器就必须知道这种操作系统的设置,运行方式以及它的局限性等。做这些事情就需要头脑清醒(我的捷径是加强记忆),我不得不依赖于跨平台编辑器。所以我使用Emacs 和Sublime。 + + + + **你最喜欢的过去跨平台项目是什么**? + + + 我一直很喜欢Mono,并且得心应手,在一些开发中大多数的项目都是用一些方法围绕着它进行的。Gluezilla曾经是我在多年前开发的一个Mozilla【译者注:Mozilla基金会,为支持和领导开源Mozilla项目而设立的非营利组织】结合器,可以C#开发的app嵌入到web浏览器试图中,并且看起来很明显。在这一点上,我开发过一个窗体app,它是在linux上开发的,它运行在带有一个嵌入GTK试图的windows系统上,并且这个系统将会运行一个Mozilla浏览器试图。CppSharp项目(以前叫做Cxxi,更早时叫做CppInterop)是一个我开始结合绑定有C#的C++库的项目,这样就可以唤醒和创建实例来把C#结合到C++中。这样做的话,它在运行的时候就能够发现所使用的平台以及用来创建本地运行库的编译器;而且还为它生成正确的C#绑定。这多么有趣啊。 + + + **你怎样看跨平台开发的未来趋势呢?** + + + 我们构建本地应用程序的方式已经改变了,我觉得在各种桌面操作系统之间存在差异,而且这种差异将会变得更加微妙;所以构建跨平台的应用程序将会更加容易,而且这种应用程序即使没有在本平台也可以完全兼容。不好的是,这可能意味着应用程序很难获得,并且当在操作系统上使用的时候功能得不到最好的发挥。我们知道怎样把库和工具以及运行环境的跨平台开发做的更好,但是跨平台应用程序的开发仍然需要我们的努力。 + + + -------------------------------------------------------------------------------- + + via: https://opensource.com/business/16/5/oscon-interview-andreia-gaita + + 作者:[Marcus D. Hanwell ][a] + 译者:[vim-kakali](https://github.com/vim-kakali) + 校对:[校对者ID](https://github.com/校对者ID) + + 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + + [a]: https://opensource.com/users/mhanwell + [1]: https://twitter.com/sh4na + [2]: http://conferences.oreilly.com/oscon/open-source-us/public/schedule/detail/48702 + [3]: http://www.mono-project.com/ + From b4d7ad6ef78775abd7592b94701451be5d5b7300 Mon Sep 17 00:00:00 2001 From: vim-kakali <1799225723@qq.com> Date: Sun, 5 Jun 2016 16:16:22 +0800 Subject: [PATCH 0856/1469] vim-kakali translating --- sources/talk/20160531 Why Ubuntu-based Distros Are Leaders.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/talk/20160531 Why Ubuntu-based Distros Are Leaders.md b/sources/talk/20160531 Why Ubuntu-based Distros Are Leaders.md index f83d0935be..d038db6cfa 100644 --- a/sources/talk/20160531 Why Ubuntu-based Distros Are Leaders.md +++ b/sources/talk/20160531 Why Ubuntu-based Distros Are Leaders.md @@ -1,3 +1,5 @@ +vim-kakali translating + Why Ubuntu-based Distros Are Leaders ========================================= From 2018b9f70072dcee76a6b0706d328ba39494253f Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 5 Jun 2016 17:12:25 +0800 Subject: [PATCH 0857/1469] =?UTF-8?q?20160605-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20160601 Apps to Snaps.md | 61 ++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 sources/tech/20160601 Apps to Snaps.md diff --git a/sources/tech/20160601 Apps to Snaps.md b/sources/tech/20160601 Apps to Snaps.md new file mode 100644 index 0000000000..fb7e712de9 --- /dev/null +++ b/sources/tech/20160601 Apps to Snaps.md @@ -0,0 +1,61 @@ +Apps to Snaps +================ + +![](https://insights.ubuntu.com/wp-content/uploads/27eb/app-snap.png) + +Distributing applications on Linux is not always easy. You have different packaging formats, base systems, available libraries, and distribution release cadences all of which contribute to the headache. But now we have something much simpler: Snaps. + +Snaps are a new way for developers to package their applications, bringing with it many advantages over the more traditional package formats such as .deb, .rpm, and others. Snaps are secure, isolated from each other and the host system using technologies such as AppArmor, they are cross-platform, and they are self-contained, allowing a developer to package the exact software their application needs. This sandboxed isolation also improves security and allows applications, and whole snap-based systems, to be rolled back should an issue occur. Snaps really are the future of Linux application packaging. + +Creating a snap is not difficult. First, you need the snap-based runtime environment that is able to understand and execute snaps on your desktop; this tool is named snapd and comes as default on all Ubuntu 16.04 systems. Next you need the tool to create snaps, Snapcraft, which can be installed simply with: + +``` +$ sudo apt-get install snapcraft +``` + +Once you have this environment available it is time to get snapping. + +Snaps use a special YAML formatted file named snapcraft.yaml that defines how the application is packaged as well as any dependencies it may have. Taking a simple application to demonstrate this point, the following YAML file is a real example of how to snap the moon-buggy game, available from the Ubuntu archive. + +``` +name: moon-buggy +version: 1.0.51.11 +summary: Drive a car across the moon +description: | +A simple command-line game where you drive a buggy on the moon +apps: +play: +command: usr/games/moon-buggy +parts: +moon-buggy: +plugin: nil +stage-packages: [moon-buggy] +snap: +– usr/games/moon-buggy +``` + +The above code demonstrates a few new concepts. The first section is all about making your application discoverable in the store; setting the packaging metadata name, version, summary, and description. The apps section implements the play command which points to the location of the moon-buggy executable. The parts section tells Snapcraft about any required plugins that are needed to build the application along with any packages it depends on. In this simple example all we need is the moon-buggy application itself from the Ubuntu archive and Snapcraft takes care of the rest. + +Running snapcraft in the directory where you have the snapcraft.yaml file will create the moon-buggy_1.0.51.11_amd64.snap which can be installed by running: + +``` +$ snap install moon-buggy_1.0.51.11_amd64.snap +``` + +To seen an example of snapping something a little more complex, like the Electron-based Simplenote application [see here][1], for a tutorial online [here][2] and the corresponding code on [GitHub][3]. More examples can be found on the getting Ubuntu developer [website here][4]. + +-------------------------------------------------------------------------------- + +via: https://insights.ubuntu.com/2016/06/01/apps-to-snaps/ + +作者:[Jamie][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://insights.ubuntu.com/author/jamiebennett/ +[1]: http://www.simplenote.com/ +[2]: http://www.linuxuk.org/post/20160518_snapping_electron_based_applications_simplenote/ +[3]: https://github.com/jamiedbennett/snaps/tree/master/simplenote +[4]: https://developer.ubuntu.com/en/desktop/get-started/ From 2d9e4e2eb921869c32c420a80ae82f229f6f3bb0 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 5 Jun 2016 17:28:52 +0800 Subject: [PATCH 0858/1469] =?UTF-8?q?20160605-2=20=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... How to Add Cron Jobs in Linux and Unix.md | 178 ++++++++++++++++++ 1 file changed, 178 insertions(+) create mode 100644 sources/tech/20160605 How to Add Cron Jobs in Linux and Unix.md diff --git a/sources/tech/20160605 How to Add Cron Jobs in Linux and Unix.md b/sources/tech/20160605 How to Add Cron Jobs in Linux and Unix.md new file mode 100644 index 0000000000..9f90a9cb45 --- /dev/null +++ b/sources/tech/20160605 How to Add Cron Jobs in Linux and Unix.md @@ -0,0 +1,178 @@ +How to Add Cron Jobs in Linux and Unix +====================================== + + +![](https://www.unixmen.com/wp-content/uploads/2016/05/HOW-TO-ADD-CRON-JOBS-IN-LINUX-AND-UNIX-696x334.png) + +### Introduction + +![](http://www.unixmen.com/wp-content/uploads/2016/05/cronjob.gif) + +Cron job are used to schedule commands to be executed periodically. You can setup commands or scripts, which will repeatedly run at a set time. Cron is one of the most useful tool in Linux or UNIX like operating systems. The cron service (daemon) runs in the background and constantly checks the /etc/crontab file, and /etc/cron.*/ directories. It also checks the /var/spool/cron/ directory. + +### Command of crontab + +crontab is the command used to install, deinstall or list the tables (cron configuration file) used to drive the [cron(8)][1] daemon in Vixie Cron. Each user can have their own crontab file, and though these are files in /var/spool/cron/crontabs, they are not intended to be edited directly. You need to use crontab command for editing or setting up your own cron jobs. + +### Types of cron configuration files + +There are different types of configuration files: + +- **The UNIX / Linux system crontab** : Usually, used by system services and critical jobs that requires root like privileges. The sixth field (see below for field description) is the name of a user for the command to run as. This gives the system crontab the ability to run commands as any user. + +- **The user crontabs**: User can install their own cron jobs using the crontab command. The sixth field is the command to run, and all commands run as the user who created the crontab + +**Note**: This faq features cron implementations written by Paul Vixie and included in many [Linux][2] distributions and Unix like systems such as in the popular 4th BSD edition. The syntax is [compatible][3] with various implementations of crond. + +How Do I install or create or edit my own cron jobs? + +To edit your crontab file, type the following command at the UNIX / Linux shell prompt: + +``` +$ crontab -e +``` + +Syntax of crontab (field description) + +The syntax is: + +``` +1 2 3 4 5 /path/to/command arg1 arg2 +``` + +OR + +``` +1 2 3 4 5 /root/ntp_sync.sh +``` + +Where, + +- 1: Minute (0-59) +- 2: Hours (0-23) +- 3: Day (0-31) +- 4: Month (0-12 [12 == December]) +- 5: Day of the week(0-7 [7 or 0 == sunday]) +- /path/to/command – Script or command name to schedule + +Easy to remember format: + +``` +* * * * * command to be executed +– – – – – +| | | | | +| | | | —– Day of week (0 – 7) (Sunday=0 or 7) +| | | ——- Month (1 – 12) +| | ——— Day of month (1 – 31) +| ———– Hour (0 – 23) +————- Minute (0 – 59) +``` + +Example simple crontab. + +```` +## run backupscript 5 minutes 1 time ## +*/5 * * * * /root/backupscript.sh + +## Run backupscript daily on 1:00 am ## + +0 1 * * * /root/backupscript.sh + +## Run backup script monthly on the 1st of month 3:15 am ## + +15 3 1 * * /root/backupscript.sh +``` + +### How do I use operators? + +An operator allows you to specifying multiple values in a field. There are three operators: + +- **The asterisk (*)** : This operator specifies all possible values for a field. For example, an asterisk in the hour time field would be equivalent to every hour or an asterisk in the month field would be equivalent to every month + +- **The comma (,)** : This operator specifies a list of values, for example: “1,5,10,15,20, 25”. + +- **The dash (–)** : This operator specifies a range of values, for example: “5-15” days , which is equivalent to typing “5,6,7,8,9,….,13,14,15” using the comma operator. + +- **The separator (/)** : This operator specifies a step value, for example: “0-23/” can be used in the hours field to specify command execution every other hour. Steps are also permitted after an asterisk, so if you want to say every two hours, just use */2. + + +### Use special string to save time + +Instead of the first five fields, you can use any one of eight special strings. It will not just save your time but it will improve readability. + +Special string | Meaning +|:-- |:-- +@reboot | Run once, at startup. +@yearly | Run once a year, “0 0 1 1 *”. +@annually | (same as @yearly) +@monthly | Run once a month, “0 0 1 * *”. +@weekly | Run once a week, “0 0 * * 0”. +@daily | Run once a day, “0 0 * * *”. +@midnight | (same as @daily) +@hourly | Run once an hour, “0 * * * *”. + + +Examples + +``` +#### Run ntpdate command every hour #### + +@hourly /path/to/ntpdate +``` + + +### More about /etc/crontab file and /etc/cron.d/* directories + +/etc/crontab is system crontabs file. Usually only used by root user or daemons to configure system wide jobs. All individual user must must use crontab command to install and edit their jobs as described above. /var/spool/cron/ or /var/cron/tabs/ is directory for personal user crontab files. It must be backup with users home directory. + +Understanding Default /etc/crontab + +Typical /etc/crontab file entries: + +``` +SHELL=/bin/bash +PATH=/sbin:/bin:/usr/sbin:/usr/bin +MAILTO=root +HOME=/ +# run-parts +01 * * * * root run-parts /etc/cron.hourly +02 4 * * * root run-parts /etc/cron.daily +22 4 * * 0 root run-parts /etc/cron.weekly +42 4 1 * * root run-parts /etc/cron.monthly +``` + +First, the environment must be defined. If the shell line is omitted, cron will use the default, which is sh. If the PATH variable is omitted, no default will be used and file locations will need to be absolute. If HOME is omitted, cron will use the invoking users home directory. + +Additionally, cron reads the files in /etc/cron.d/ directory. Usually system daemon such as sa-update or sysstat places their cronjob here. As a root user or superuser you can use following directories to configure cron jobs. You can directly drop your scripts here. The run-parts command run scripts or programs in a directory via /etc/crontab file: + +Directory |Description +|:-- |:-- +/etc/cron.d/ | Put all scripts here and call them from /etc/crontab file. +/etc/cron.daily/ | Run all scripts once a day +/etc/cron.hourly/ | Run all scripts once an hour +/etc/cron.monthly/ | Run all scripts once a month +/etc/cron.weekly/ | Run all scripts once a week + + +### Backup cronjob + +``` +# crontab -l > /path/to/file + +# crontab -u user -l > /path/to/file +``` + +-------------------------------------------------------------------------------- + +via: https://www.unixmen.com/add-cron-jobs-linux-unix/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+unixmenhowtos+%28Unixmen+Howtos+%26+Tutorials%29 + +作者:[Duy NguyenViet][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.unixmen.com/author/duynv/ +[1]: http://www.manpager.com/linux/man8/cron.8.html +[2]: http://www.linuxsecrets.com/ +[3]: http://www.linuxsecrets.com/linux-hardware/ From ba72d2da3a5c029ee00c833a971c9f8a5e72a682 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 5 Jun 2016 17:31:58 +0800 Subject: [PATCH 0859/1469] =?UTF-8?q?20160605-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...A New Trust-Based Authentication Method.md | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 sources/talk/20160605 Will Google Replace Passwords With A New Trust-Based Authentication Method.md diff --git a/sources/talk/20160605 Will Google Replace Passwords With A New Trust-Based Authentication Method.md b/sources/talk/20160605 Will Google Replace Passwords With A New Trust-Based Authentication Method.md new file mode 100644 index 0000000000..2434c0412a --- /dev/null +++ b/sources/talk/20160605 Will Google Replace Passwords With A New Trust-Based Authentication Method.md @@ -0,0 +1,39 @@ +Will Google Replace Passwords With A New Trust-Based Authentication Method? +=========================================================================== + +![](http://www.iwillfolo.com/wordpress/wp-content/uploads/2016/05/Trust-API-Google-replaces-passwords.jpg) + +A newly developed authentication method by Google will rate how trustworthy is your login and will authenticate it based on a “Trust Score”. + + +Abacus is the name of the Google project that aims to rid you off of the nuisance which is remembering and typing passwords. + +In latest Google I/O developer conference, the company has introduced a new feature stemming from the ambitious project, called “**Trust API**“. + +The API (Application Programming Interface) which will be available for Android developers by the year end “if all goes well”, is intended to make use of Android devices’ various types of sensors in order to profile a user and create what they refer to as Trust Score. + +Based on that Trust Score, an application which requires login credentials will be able to verify that indeed you are authorized to login and thus will not prompt for a password. + +![](http://www.iwillfolo.com/wordpress/wp-content/uploads/2016/05/Abacus-to-Trust-API.jpg) +>Abacus to Trust API + +### A Point To Consider + +Although the idea, functionality-wise, sounds pretty great – mitigating the burden which is password authentication. + +The other side of the coin tough, is that once again, by doing so Google pushes us (deliberately or not) to give up our privacy in favor of ease of use. + +Is it worth it? it’s up to you to decide… + + +-------------------------------------------------------------------------------- + +via: http://www.iwillfolo.com/will-google-replace-passwords-with-a-new-trust-based-authentication-method/ + +作者:[iWillFolo][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.iwillfolo.com/ From 886bbccc53cc4bdd418e900af0eb0a7c8c9cce5b Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 5 Jun 2016 17:38:25 +0800 Subject: [PATCH 0860/1469] =?UTF-8?q?20160605-4=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...d Use Apps Even Without Installing Them.md | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 sources/talk/20160518 Android Use Apps Even Without Installing Them.md diff --git a/sources/talk/20160518 Android Use Apps Even Without Installing Them.md b/sources/talk/20160518 Android Use Apps Even Without Installing Them.md new file mode 100644 index 0000000000..279e9a5edb --- /dev/null +++ b/sources/talk/20160518 Android Use Apps Even Without Installing Them.md @@ -0,0 +1,67 @@ +Android’s Next Revolution: Use Apps Even Without Installing Them! +=================================================================== + + +A new innovation by Google’s Android will let you use apps even if they aren’t installed on your device. A few prototypes have already been made. + +Remember that time when someone sent you a link that required you installing an app in order to view? + +The dilemma of whether you should install the app just to view a one-time link may have frustrated you. Furthermore, the app installation itself may took some of your precious time as well. + +The above scenario has probably been experienced by most, if not all, modern day technology users. Nonetheless, we’ve all came to accept that this is simply the correct and logical way by which things work. + +Or is it? + +To that question Google’s Android division came up with a new, out-of-the-box answer: + +Android Instant Apps + +Android Instant Apps purports to rid you of any such dilemmas in the first place by letting you simply click the link (see opening example) and start using the app straight away. + +Another real life example of a scenario where Instant Apps might come handy, is the case you want to park your car but don’t have the parking meter matching app. + +According to Google, you could simply tap your phone on the meter and the parking app will pop on your screen immediately, ready to be used. + +How Does It Work? + +Instant Apps are basically the same apps you’ve already familiarized yourself with, only with a twist – these apps have been trimmed and modularized in order to supply you only the essential parts required for you to complete a certain task. + +For instance, expanding on the opening scenario as an example, in order to view a link, you don’t have to have a full featured app that can write, send, make coffee or whatever. All you need is the viewing feature – and that’s exactly what you’ll get. + +That way the app could open up rapidly, allowing you to complete the task of which you came for. + +![](http://www.iwillfolo.com/wordpress/wp-content/uploads/2016/05/AIA-demo.jpg) +>AIA demo + +![](https://4.bp.blogspot.com/-p5WOrD6wVy8/VzyIpsDqULI/AAAAAAAADD0/xbtQjurJZ6EEji_MPaY1sLK5wVkXSvxJgCKgB/s800/B%2526H%2B-%2BDevice%2B%2528Final%2529.gif) +>B&H Photo (via Google Search) + +![](https://2.bp.blogspot.com/-q5ApCzECuNA/VzyKa9l0t2I/AAAAAAAADEI/nYhhMClDl5Y3qL5-wiOb2J2QjtGWwbF2wCLcB/s800/BuzzFeed-Device-Install%2B%2528Final%2529.gif) +>BuzzFeedVideo (via a shared link) + +![](https://2.bp.blogspot.com/-mVhKMMzhxms/VzyKg25ihBI/AAAAAAAADEM/dJN6_8H7qkwRyulCF7Yr2234-GGUXzC6ACLcB/s800/Park%2Band%2BPay%2B-%2BDevice%2Bwith%2BMeter%2B%2528Final%2529.gif) +>Park and Pay (example) (via NFC) + + +Sounds great, isn’t it? However, there are still many technical aspects need to be addressed. + +For instance, from a security point of view: if any app can theoretically run on your device, even if you haven’t installed it – how will you keep your device safe from malaware attacks? + +Therefore, in order to iron out such risks, Google is still working on the project, currently with a small set of partners which will gradually expand. + +Eventually, Google plans to release AIA (Android Instant Apps) somewhere along next year. + +relate: [Introducing Android Instant Apps][1] + +-------------------------------------------------------------------------------- + +via: http://www.iwillfolo.com/androids-next-revolution-use-apps-even-without-installing-them/ + +作者:[iwillfolo][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.iwillfolo.com +[1]: http://android-developers.blogspot.co.il/2016/05/android-instant-apps-evolving-apps.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed:+blogspot/hsDu+%28Android+Developers+Blog%29 From f9f6f0782e79066ea3e9d988f6bc9adb6a9c5af2 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 5 Jun 2016 17:47:58 +0800 Subject: [PATCH 0861/1469] =?UTF-8?q?20160605-5=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...d distributors disable IPv4-mapped IPv6.md | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 sources/talk/20160525 Should distributors disable IPv4-mapped IPv6.md diff --git a/sources/talk/20160525 Should distributors disable IPv4-mapped IPv6.md b/sources/talk/20160525 Should distributors disable IPv4-mapped IPv6.md new file mode 100644 index 0000000000..2ce0bace45 --- /dev/null +++ b/sources/talk/20160525 Should distributors disable IPv4-mapped IPv6.md @@ -0,0 +1,60 @@ +Should distributors disable IPv4-mapped IPv6? +============================================= + +By all accounts, the Internet's transition to IPv6 has been a slow affair. In recent years, though, perhaps inspired by the exhaustion of the IPv4 address space, IPv6 usage has been [on the rise][1]. There is a corresponding interest in ensuring that applications work with both IPv4 and IPv6. But, as a recent discussion on the OpenBSD mailing list has highlighted, a mechanism designed to ease the transition to an IPv6 network may also make the net less secure — and Linux distributions may be configured insecurely by default. + +### Address mapping + +IPv6 may look like IPv4 in many ways, but it is a different protocol with a different address space. Server programs wanting to receive connections using either protocol must thus open separate sockets for the two different address families — AF_INET for IPv4, and AF_INET6 for IPv6. In particular, a program wishing to accept connections to any of a host's interfaces using either protocol will need to create an AF_INET socket bound to the all-zeroes wild-card address (0.0.0.0) and an AF_INET6 socket bound to the IPv6 equivalent (written as "::"). It must then listen for connections on both sockets — or so one would think. + +Many years ago, in [RFC 3493][2], the IETF specified a mechanism by which a program could work with either protocol using a single IPv6 socket. With a socket enabled for this behavior, the program need only bind to :: to receive connections to all interfaces with both protocols. When an IPv4 connection is made to the bound port, the source address will be mapped into IPv6 as described in [RFC 2373][3]. So, for example, a program using this mode would see an incoming connection from 192.168.1.1 as originating from ::ffff:192.168.1.1 (the mixed notation is how such addresses are ordinarily written). The program can also open connections to IPv4 addresses by mapping them in the same manner. + +The RFC calls for this behavior to be implemented by default, so most systems do so. There are exceptions, though, one of which is OpenBSD; there, programs wishing to work with both protocols can only do so by creating two independent sockets. A program that opens two sockets on Linux, though, will run into trouble: both the IPv4 and the IPv6 socket will try to bind to the IPv4 address(es), so whichever attempt comes second will fail. In other words, a program that binds a socket to a given port on :: will be bound to that port on both the IPv6 :: and the IPv4 0.0.0.0. If it then tries to bind an IPv4 socket to the same port on 0.0.0.0, the operation will fail as the port is already bound. + +There is a way around that problem, of course; the program can call setsockopt() to turn on the IPV6_V6ONLY option. A program that opens two sockets and sets IPV6_V6ONLY should be portable across all systems. + +Readers may be less than thoroughly shocked to learn that not every program out there gets all of this right. One of those, it turns out, is the [OpenNTPD][4] implementation of the Network Time Protocol. Brent Cook recently [proposed a small patch][5] adding the requisite setsockopt() call to the upstream OpenNTPD source, which lives within OpenBSD itself. That patch does not look likely to be accepted, though, for the most OpenBSD-like of reasons. + +### Security concerns + +As mentioned above, OpenBSD does not support IPv4-mapped IPv6 sockets at all. Even if a program tries to explicitly enable address mapping by setting the IPV6_V6ONLY option to zero, its author will be disappointed; that setting has no effect on OpenBSD systems. The reasoning behind this decision is that this mapping brings some security concerns with it. There are various types of attack surface that it opens up, but it all comes down to the provision of two different ways to reach the same port, each with its own access-control rules. + +Any given server system may have set up firewall rules describing the allowed access to the port in question. There may also be mechanisms like TCP wrappers or a BPF-based filter in place, or a router on the net could be doing its own stateful connection filtering. The result is likely to be gaps in firewall protection and the potential for all kinds of confusion resulting from the same IPv4 address being reachable via two different protocols. If the address mapping is done at the edge of the network, the situation gets even more complex; see [this draft RFC from 2003][6] for a description of some other attack scenarios that come about if mapped addresses are transmitted between hosts. + +Adapting systems and software to properly handle IPv4-mapped IPv6 addresses can certainly be done. But that adds to the overall complexity of the system, and it's a sure bet that this adaptation has not actually been done anywhere near as widely as it should be. As Theo de Raadt [put it][7]: + + **Sometimes people put a bad idea into an RFC. Later they discover it is impossible to walk the idea back to the garbagebin. The result is concepts so complicated that everyone has to be a fulltime expert, on admin side and coder side**. + +It is not at all clear how many of these full-time experts are actually out there configuring systems and networks where IPv4-mapped IPv6 addresses are in use. + +One might well argue that, while IPv4-mapped IPv6 addresses create security hazards, there should be no harm in changing a program so that it turns off address mapping on systems that implement it. But Theo argues that this should not be done, for a couple of reasons. The first is that there are many broken programs out there, and it will never be possible to fix them all. But the real reason is to put pressure on distributors to turn off address mapping by default. As he put it: "**Eventually someone will understand the damage is systematic, and change the system defaults to 'secure by default'**." + +### Address mapping on Linux + +On Linux systems, address mapping is controlled by a sysctl knob called net.ipv6.bindv6only; it is set to zero (enabling address mapping) by default. Administrators (or distributors) can turn off mapping by setting this knob to one, but they would be well advised to be sure that their applications all work properly before deploying such a system in production. A quick survey suggests that none of the primary distributors change the default for this knob; Debian [changed the default][9] for the "squeeze" release in 2009, but the change broke enough packages ([anything involving Java][10], for example) that it was, [after a certain amount of Debian-style discussion][11], reverted. It would appear that quite a few programs rely on address mapping being enabled by default. + +OpenBSD has the freedom to break things outside of its core system in the name of "secure by default"; Linux distributors tend to have a harder time getting away with such changes. So those distributors, being generally averse to receiving abuse from their users, are unlikely to change the default of the bindv6only knob anytime soon. The good news is that this functionality has been the default for years and stories of exploits are hard to find. But, as we all know, that provides no guarantees that exploits are not possible. + + +-------------------------------------------------------------------------------- + +via: https://lwn.net/Articles/688462/ + +作者:[Jonathan Corbet][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://lwn.net/ +[1]: https://www.google.com/intl/en/ipv6/statistics.html +[2]: https://tools.ietf.org/html/rfc3493#section-3.7 +[3]: https://tools.ietf.org/html/rfc2373#page-10 +[4]: https://github.com/openntpd-portable/ +[5]: https://lwn.net/Articles/688464/ +[6]: https://tools.ietf.org/html/draft-itojun-v6ops-v4mapped-harmful-02 +[7]: https://lwn.net/Articles/688465/ +[8]: https://lwn.net/Articles/688466/ +[9]: https://lists.debian.org/debian-devel/2009/10/msg00541.html +[10]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=560056 +[11]: https://lists.debian.org/debian-devel/2010/04/msg00099.html From bef28311632a7d3afc0ae8e90e86fd70ebfbb6eb Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 5 Jun 2016 17:54:58 +0800 Subject: [PATCH 0862/1469] =?UTF-8?q?20160605-6=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20160601 scp command in Linux.md | 176 ++++++++++++++++++ 1 file changed, 176 insertions(+) create mode 100644 sources/tech/20160601 scp command in Linux.md diff --git a/sources/tech/20160601 scp command in Linux.md b/sources/tech/20160601 scp command in Linux.md new file mode 100644 index 0000000000..f2dd409d49 --- /dev/null +++ b/sources/tech/20160601 scp command in Linux.md @@ -0,0 +1,176 @@ +scp command in Linux +======================= + +![](https://www.unixmen.com/wp-content/uploads/2016/05/SCP-LOGO-1.jpg) + + +scp means Secure Copy Protocol, already every Linux/Unix user known about cp command well. scp also works like cp command, cp command copies files or folders from one location i.e source to other location i.e target in local system, but scp copies the files from one host to another host in network. + +The usage of the scp command is as follows, here i copy a file named importantfile from local system(10.10.16.147) to Remote system(10.0.0.6) here instead of ip address you can also use System name. + +``` +[root@localhost ~]# scp importantfile admin@10.0.0.6:/home/admin/ +The authenticity of host '10.0.0.6 (10.0.0.6)' can't be established. +RSA key fingerprint is SHA256:LqBzkeGa6K9BfWWKgcKlQoE0u+gjorX0lPLx5YftX1Y. +RSA key fingerprint is MD5:ed:44:42:59:3e:dd:4c:12:43:4a:89:b1:5d:bd:9e:20. +Are you sure you want to continue connecting (yes/no)? yes +Warning: Permanently added '10.0.0.6' (RSA) to the list of known hosts. +admin@10.0.0.6's password: +importantfile 100% 0 0.0KB/s 00:00 +[root@localhost ~]# +``` + +Similarly if you want to get a file from remote system you can use scp command as follows + +``` +[root@localhost ~]# scp root@10.10.16.137:/root/importantfile /home/admin/ +The authenticity of host '10.10.16.137 (10.10.16.137)' can't be established. +RSA key fingerprint is b0:b0:a3:c3:2e:94:13:0c:29:2e:ba:0b:d3:d6:12:8f. +Are you sure you want to continue connecting (yes/no)? yes +Warning: Permanently added '10.10.16.137' (RSA) to the list of known hosts. +root@10.10.16.137's password: +importantfile 100% 0 0.0KB/s 00:00 +[root@localhost ~]# +``` + +You can also use various options along with scp command like cp command,The man page of the scp command clearly explain about the usage of various options and advantages of that. + +**Sample Output.** + +![](https://www.unixmen.com/wp-content/uploads/2016/05/scp.jpg) + +``` +The options are as follows: + + -B Selects batch mode (prevents asking for passwords or passphrases). + + -C Compression enable. Passes the -C to enable compression. + + -c cipher + Selects the cipher to use for encrypting the data transfer. This + option is directly passed to ssh(1). + + -F ssh_config + Specifies an alternative per-user configuration file for ssh. + This option is directly passed to ssh(1). + + -l limit + Limits the used bandwidth, specified in Kbit/s. + + -P port + Specifies the port to connect to on the remote host. Note that + this option is written with a capital ‘P’, because -p is already + reserved for preserving the times and modes of the file. + + -p Preserves modification times, access times, and modes from the + original file. + + -q Quiet mode: disables the progress meter as well as warning and + diagnostic messages from ssh(1). + + -r Recursively copy entire directories. Note that scp follows sym‐ + bolic links encountered in the tree traversal. + + -v Verbose mode. Causes scp and ssh(1) to print debugging messages + about their progress. This is helpful in debugging connection, + authentication, and configuration problems. + +``` + +The scp command along with -v option you can get detailed information about authentication, debugging information etc. + +![](http://www.unixmen.com/wp-content/uploads/2016/05/scp-v.jpg) + +Sample output is like when we pass the option `-v` + +``` +[root@localhost ~]# scp -v abc.txt admin@10.0.0.6:/home/admin +Executing: program /usr/bin/ssh host 10.0.0.6, user admin, +command scp -v -t/home/admin +OpenSSH_7.1p1, OpenSSL 1.0.2d-fips 9 Jul 2015 +debug1: Reading configuration data /etc/ssh/ssh_config +debug1: /etc/ssh/ssh_config line 56: Applying options for * +debug1: Connecting to 10.0.0.6 [10.0.0.6] port 22. +debug1: Connection established. +debug1: Server host key: ssh-rsa SHA256:LqBzkeGa6K9BfWWKgcKlQoE0u+gjorX0lPLx5YftX1Y +debug1: Next authentication method: publickey +debug1: Trying private key: /root/.ssh/id_rsa +debug1: Trying private key: /root/.ssh/id_dsa +debug1: Trying private key: /root/.ssh/id_ecdsa +debug1: Trying private key: /root/.ssh/id_ed25519 +debug1: Next authentication method: password +admin@10.0.0.6's password: +debug1: Authentication succeeded (password). +Authenticated to 10.0.0.6 ([10.0.0.6]:22). +debug1: channel 0: new [client-session] +debug1: Requesting no-more-sessions@openssh.com +debug1: Entering interactive session. +debug1: Sending environment. +debug1: Sending command: scp -v -t /home/admin +Sending file modes: C0644 174 abc.txt +Sink: C0644 174 abc.txt +abc.txt 100% 174 0.2KB/s 00:00 +Transferred: sent 3024, received 2584 bytes, in 0.3 seconds +Bytes per second: sent 9863.3, received 8428.1 +debug1: Exit status 0 +[root@localhost ~]# +``` + +If we need to copy the Directories or folders we can use the option –r. It Recursively copy entire directories + +![](http://www.unixmen.com/wp-content/uploads/2016/05/scp-with-r.jpg) + +Quiet mode: + +If you want disables the progress meter as well as warning and diagnostic messages pass the argument -q along with scp command. + +![](http://www.unixmen.com/wp-content/uploads/2016/05/scp-with-q.jpg) + +last time we pass the argument -r only then it shows the information file by file, but when we pass the argument -q it disables the progress meter this time. + +Preserves modification times, access times, and modes from the original file by passing the option -p along with scp. + +![](http://www.unixmen.com/wp-content/uploads/2016/05/scp-with-p.jpg) + +Specifies the port to connect to on the remote host by using the option -P. +scp uses the ssh to transfer the files between hosts, ssh uses the port number 22 so the scp also uses the same port number 22. + +If we want to change the port number we can pass the particular port number along with -P(capital P because small p uses for preserving access time etc.) + +for example if we want to use port number 2222 then the command is as follows + +``` +[root@localhost ~]# scp -P 2222 abcd1 root@10.10.16.137:/root/ +``` + +**Limits the used bandwidth, specified in Kbit/s** + +we can limit the bandwidth by using the argument -l option as follows. here i used the limit is 512kbit/s + +![](http://www.unixmen.com/wp-content/uploads/2016/05/scp-with-l.jpg) + +**Compression enable** + +we can enable the compression mode when we transfer the data through scp command to save tha bandwidth and time as follows + +![](https://www.unixmen.com/wp-content/uploads/2016/05/scp-with-C.jpg) + +**Selects the cipher to use for encrypting the data** + +By default scp uses AES-128, if we want to change the encryption then we can pass the argument -c(small c) along with scp. + +![](http://www.unixmen.com/wp-content/uploads/2016/05/scp-with-cipher.jpg) + +Now you can transfer the files between different nodes in your network securely by using scp(Secure copy). + +-------------------------------------------------------------------------------- + +via: https://www.unixmen.com/scp-command-linuxunix/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+unixmenhowtos+%28Unixmen+Howtos+%26+Tutorials%29 + +作者:[Naga Ramesh][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.unixmen.com/author/naga/ From b0ac16385f260ce311f8919e9be3aacf2746716f Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 5 Jun 2016 18:15:13 +0800 Subject: [PATCH 0863/1469] =?UTF-8?q?20160605-7=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... 16.04 And Use Its Command line Options.md | 138 ++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 sources/tech/20160603 How To Install And Use VBoxManage On Ubuntu 16.04 And Use Its Command line Options.md diff --git a/sources/tech/20160603 How To Install And Use VBoxManage On Ubuntu 16.04 And Use Its Command line Options.md b/sources/tech/20160603 How To Install And Use VBoxManage On Ubuntu 16.04 And Use Its Command line Options.md new file mode 100644 index 0000000000..85fabacc56 --- /dev/null +++ b/sources/tech/20160603 How To Install And Use VBoxManage On Ubuntu 16.04 And Use Its Command line Options.md @@ -0,0 +1,138 @@ +How To Install And Use VBoxManage On Ubuntu 16.04 And Use Its Command line Options +====================================================================================== + +VirtualBox comes with a suite of command line utilities, and you can use the VirtualBox command line interfaces (CLIs) to manage VMs on a remote headless server. In this tutorial, we will show you how to create and start a VM without VirtualBox GUI using VBoxManage. VBoxManage is the command-line interface to VirtualBox taht you can use to completely control VirtualBox from the command line of your host operating system. VBoxManage supports all the features that the graphical user interface gives you access to, but it supports a lot more than that. It exposes really all the features of the virtualization engine, even those that cannot (yet) be accessed from the GUI. You will need to use the command line if you want to use a different user interface than the main GUI and control some of the more advanced and experimental configuration settings for a VM. + +You will find VBoxManage helpful when you want to create and run virtual machines (VMs) on VirtualBox, but you only have access to a terminal on a remote host machine. This can be a common situation for servers where VMs are managed from remotely. + +### Prerequisites + +Before we start using VBoxManage command line utility, make sure that you have root or sudo user access to your Ubuntu 16.04 server and the Oracle Virtual Box is already installed on it. Then you need to install VirtualBox Extension Pack which is needed to run a VRDE remote desktop server used to access headless VMs. + +### Installing VBoxManage + +You can get your required package by following the link to [Virtual Box Download Page][1] to get the latest extension pack, same version as your installed version of VirtualBox!. + +![](http://linuxpitstop.com/wp-content/uploads/2016/06/12.png) + +You can also make use of below command to get the VBoxManage extension on your system + +``` +$ wget http://download.virtualbox.org/virtualbox/5.0.20/Oracle_VM_VirtualBox_Extension_Pack-5.0.20-106931.vbox-extpack +``` + +![](http://linuxpitstop.com/wp-content/uploads/2016/06/21.png) + +Run the below command to confirm that VBoxManage has been successfully installed. + +``` +$ VBoxManage list extpacks +``` + +![](http://linuxpitstop.com/wp-content/uploads/2016/06/31.png) + +### Using VBoxManage on Ubuntu 16.04 + +Now we are going to use VBoxManage to show you that how easily you can create and manage your virtual machines by using this utility from command line terminal. + +Let’s run the below command to create a virtual machine for Ubuntu OS. + +``` +# VBoxManage createvm --name Ubuntu16.04 --register +``` + +After executing this command it will create virtual machine called “Ubuntu16.vbox” in home folder under “VirtualBox VMs/Ubuntu16/Ubuntu16.04.vbox” . In the above command, “createvm” is used to create a virtual machine and “–name“ defines the name of the virtual machine while “registervm” command is used to register the virtual machine. + +Now, create the hard disk image for the virtual machine using the below command. + +``` +$ VBoxManage createhd --filename Ubuntu16.04 --size 5124 +``` + +Here “createhd” is used to create hard disk image and “–filename” is used to specify the virtual machine’s name, for which the hard disk image is created. Here, “–size” denotes the size of the hard disk image. The size is always given in MB. Here we have specified 5Gb that is 5124MB. + +Next we will set the OS type, if the Linux OS has to be installed, then specify the OS type as Linux or Ubuntu Or Fedora etc using below command. + +``` +$ VBoxManage modifyvm Ubuntu16.04 --ostype Ubuntu +``` + +Use below command to set the memory size for the virtual OS, i.e. the ram size for the virtual OS from the host Machine. + +``` +$ VBoxManage modifyvm Ubuntu10.10 --memory 512 +``` + +![](http://linuxpitstop.com/wp-content/uploads/2016/06/52.png) + +Now we are going to create a storage controller for the virtual machine by using below command. + +``` +$ VBoxManage storagectl Ubuntu16.04 --name IDE --add ide --controller PIIX4 --bootable on +``` + +Here in above command ‘storagectl’ is used to create a storage controller for virtual machine,’–name’ specifies the name of the storage controller that needs to be created, modified or removed from the virtual machine. Then ‘–add’ defines the type of system bus to which the storage controller must be connected. Its available options are ide/sata/scsi/floppy. The ‘–controller’ option allows to choose the type of chipset that is to be emulated for the given storage controller while its available options are LsiLogic / LSILogicSAS / BusLogic / IntelAhci / PIIX3 / PIIX4 / ICH6 / I82078. At the end ‘–bootable’ defines whether this controller is bootable or not. + +The above command creates the storage controller called IDE. Later the virtual media can be attached to the controller using ‘storageattach’ command. + +Now run below command to create a storage controller called SATA, that will be used to attach the hard disk image to this later. + +``` +$ VBoxManage storagectl Ubuntu16.04 --name SATA --add sata --controller IntelAhci --bootable on +``` + +Attach the previously created disk image as well as CD/DVD drive to the IDE controller. Ubuntu installation ISO image which is then inserted to the CD/DVD drive. Now, attach the storage controller to the virtual machine using ‘storageattach’ command. + +``` +$ VBoxManage storageattach Ubuntu16.04 --storagectl SATA --port 0 --device 0 --type hdd --medium "your_iso_filepath" +``` + +This will attach the storage controller SATA to virtual machine Ubuntu16.04 with the medium i.e., to the virtual disk image which is created. + +Run below commands to add some features like networking setup, audio, etc. + +``` +$ VBoxManage modifyvm Ubuntu10.10 --nic1 nat --nictype1 82540EM --cableconnected1 on +$ VBoxManage modifyvm Ubuntu10.10 --vram 128 --accelerate3d on --audio alsa --audiocontroller ac97 +``` + +Now, start the VM by using the below command by specifying the name of the VM that you wish to start. + +``` + $ VBoxManage startvm Ubuntu16.04 +``` + +A new window will be opened where you new VM be booted from your attached file. + +![](http://linuxpitstop.com/wp-content/uploads/2016/06/62.png) + +To stop the virtual machine , you can make use of the following command. + +``` +$ VBoxManage controlvm Ubuntu16.04 poweroff +``` + +The ‘controlvm’ command is used to control the state of the virtual machine. Some of the available options are pause / resume / reset / poweroff / savestate / acpipowerbutton / acpisleepbutton. There are many options in controlvm to see all the options available in it, run below command. + +``` +$VBoxManage controlvm +``` + +![](http://linuxpitstop.com/wp-content/uploads/2016/06/81.png) + +Conclusion + +In this article we have learned about an awesome tool of Oracle Virtual Box that is VBoxManage, that includes its installation and usage on Ubuntu 16.04 Operating system. The article includes a detailed instructions about its useful commands to create and manage your virtual machines using VBoxManage. Hope you find this much helpful, do not forget to share your comments or suggestions. + +-------------------------------------------------------------------------------- + +via: http://linuxpitstop.com/install-and-use-command-line-tool-vboxmanage-on-ubuntu-16-04/ + +作者:[Kashif][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/kashif/ +[1]: https://www.virtualbox.org/wiki/Downloads From b28c9714aacea52fa1ada092a52b8f4bcf9913d4 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 5 Jun 2016 18:23:28 +0800 Subject: [PATCH 0864/1469] =?UTF-8?q?20160605-8=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ve on Linux with google-drive-ocamlfuse.md | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 sources/tech/20160602 How to mount your Google Drive on Linux with google-drive-ocamlfuse.md diff --git a/sources/tech/20160602 How to mount your Google Drive on Linux with google-drive-ocamlfuse.md b/sources/tech/20160602 How to mount your Google Drive on Linux with google-drive-ocamlfuse.md new file mode 100644 index 0000000000..f043e2e92b --- /dev/null +++ b/sources/tech/20160602 How to mount your Google Drive on Linux with google-drive-ocamlfuse.md @@ -0,0 +1,66 @@ +How to mount your Google Drive on Linux with google-drive-ocamlfuse +======================================================================== + +>If you're looking for an easy way to mount your Google Drive folders to a Linux box, Jack Wallen shows you how with the help of google-drive-ocamlfuse. + +![](http://tr4.cbsistatic.com/hub/i/2016/05/18/ee5d7b81-e5be-4b24-843d-d3ca99230a63/651be96ac8714698f8100afa6883e64d/linuxcloudhero.jpg) +>Image: Jack Wallen + +Google has yet to release a Linux version of its Google Drive app, though there are plenty of ways to gain access to your Drive files from Linux. + +If you prefer a GUI tool, you've got Insync. If you prefer the command line, there are tools such as Grive2 and the incredibly easy to use FUSE-based system written in Ocaml. I'll show how to use the latter to mount your Google Drive account on your Linux desktop. Although it's done via the command line, you'll be surprised at how easy it is to pull off. It's so easy, anyone can do it. + +This system features: + +- Full read/write access to ordinary files/folders +- Read-only access to Google Docs, sheets, and slides +- Access to your Drive's Trash (.trash) Directory +- Duplicate file handling +- Support for multiple accounts + +Let's walk through the installation and setup of google-drive-ocamlfuse on a Ubuntu 16.04 desktop so you can gain access to your Drive files. + +### Installation + +1. Open a terminal window. +2. Add the necessary PPA with the command sudo add-apt-repository ppa:alessandro-strada/ppa. +3. When prompted, type your sudo password and hit Enter. +4. Update app with the command sudo apt-get update. +5. Install the software by issuing the command sudo apt-get install google-drive-ocamlfuse. + +### Authorization + +The next step is to authorize google-drive-ocamlfuse so it will have access to your Google account. To do this, go back to the terminal window and issue the command google-drive-ocamlfuse. This command will open a browser window that will either prompt you to log into your Google account or, if you're already logged in, ask you to allow google-drive-ocamlfuse access to your Google account. If you've not logged in, do so and then click Allow. The next window (which appeared on a Ubuntu 16.04 desktop, but not an Elementary OS Freya desktop) will ask you to grant permission for both gdfuse and OAuth2 Endpoint to access your Google account. Click Allow again. The next browser screen will inform you to wait until the authorization tokens have downloaded; you can minimize the browser at this point. When your terminal prompt returns (Figure A), you know the tokens have been downloaded, and you're ready to mount. + +**Figure A** + +![](http://tr4.cbsistatic.com/hub/i/r/2016/05/18/a493122b-445f-4aca-8974-5ec41192eede/resize/620x/6ae5907ad2c08dc7620b7afaaa9e389c/googledriveocamlfuse3.png) +>Image: Jack Wallen + +**The app has been authorized, and you're ready to go.** + +### Mounting your Google Drive + +Before you mount your Google Drive, you must create a folder to serve as the mount point. From the terminal, issue the command mkdir ~/google-drive to create a new folder in your home directory. Finally, issue the command google-drive-ocamlfuse ~/google-drive to mount your Google Drive to the google-drive folder. + +At this point, you should see your Google Drive files/folders populate in the google-drive folder. You can work with Google Drive as if it were a local folder system. + +When you want to unmount the google-drive folder, issue the command fusermount -u ~/google-drive. + +### It's no GUI, but it works like a champ + +I find this particular system really handy to use. It's incredibly fast at syncing with Google Drive, and it can make for an elegant means of backing up your Google Drive account locally. + +Give google-drive-ocamlfuse a go, and see what kind of magic you can make with it. + +-------------------------------------------------------------------------------- + +via: http://www.techrepublic.com/article/how-to-mount-your-google-drive-on-linux-with-google-drive-ocamlfuse/ + +作者:[Jack Wallen ][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.techrepublic.com/search/?a=jack+wallen From 2203487baccc2534d243e7a865fe9f37844c824a Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 5 Jun 2016 18:33:02 +0800 Subject: [PATCH 0865/1469] =?UTF-8?q?20160605-9=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20160531 The Anatomy of a Linux User.md | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 sources/talk/20160531 The Anatomy of a Linux User.md diff --git a/sources/talk/20160531 The Anatomy of a Linux User.md b/sources/talk/20160531 The Anatomy of a Linux User.md new file mode 100644 index 0000000000..00c198712f --- /dev/null +++ b/sources/talk/20160531 The Anatomy of a Linux User.md @@ -0,0 +1,55 @@ +The Anatomy of a Linux User +================================ + + +**Some new GNU/Linux users understand right away that Linux isn’t Windows. Others never quite get it. The best distro designers strive to keep both in mind.** + +### The Heart of Linux + +Nicky isn’t outwardly remarkable in any way. She’s a thirtysomething who decided to go back to school later in life than most. She spent six years in the Navy until she decided a job offer from an old friend would be a better bet than a career in the armed forces. That happens a lot in any of the post-war military service branches. It was at that job where I met her. She was the regional manager for an eight state trucking broker and I was driving for a meat packing outfit in Dallas. + +![](http://i2.wp.com/fossforce.com/wp-content/uploads/2016/05/anatomy.jpg?w=525) + +We became good friends in 2006, Nicky and me. She’s an outgoing spirit, curious about almost anyone whose path she crosses. We had an ongoing Friday night date to go fight in an indoor laser combat arena. It wasn’t rare for us to burn through three 30 minute sessions in a row. Maybe it wasn’t as cheap as a paint ball arena, but it was climate controlled and had a horror game feel to it. It was during one of those outings that she asked me if I could fix her computer. + +She knew about my efforts to get computers into the homes of disadvantaged kids and I kidded her about paying into Bill Gates’ 401K plan when she complained about her computer becoming too slow. Nicky figured this was as good a time as any to see what Linux was all about. + +Her computer was a decent machine, a mid 2005 Asus desktop with a Dell 19″ monitor. Unfortunately, it had all the obligatory toolbars and popups that a Windows computer can collect when not properly tended. After getting all of the files from the computer, we began the process of installing Linux. We sat together during the install process and I made sure she understood the partitioning process. Inside of an hour, she had a bright new and shiny PCLinuxOS desktop. + +She remarked often, as she navigated her way through her new system, at how beautiful the system looked. She wasn’t mentioning this as an aside; she was almost hypnotized by the sleek beauty in front of her. She remarked that her screen “shimmered” with beauty. That’s something I took away from our install session and have made sure to deploy on every Linux computer I’ve installed since. I want the screen to shimmer for everyone. + +The first week or so, she called or emailed me with the usual questions, but the one that was probably the most important was wanting to know how to save her OpenOffice documents so colleagues could read them. This is key when teaching anyone Linux or Open/LibreOffice. Most people just obey the first popup, allow the document to be saved in Open Document Format and get their fingers bit in the process. + +There was a story going around a year or so ago about a high school kid who claimed he flunked an exam when his professor couldn’t open the file containing his paper. It made for some blustery comments from readers who couldn’t decide who was more of a moron, the kid for not having a clue or his professor for not having a ummm… clue of his own. + +I know some college professors and each and every one of them could figure out how to open an ODF file. Heck, even as much as Microsoft can be grade A, blue-ribbon proprietary jerks, I think Microsoft Office has been able to open an ODT or ODF file for a while now. I can’t say for sure since I haven’t used Microsoft Office much since 2005. + +Even in the bad ol’ days, when Microsoft was openly and flagrantly shoving their way onto enterprise desktops via their vendor lock-in, I never had a problem when conducting business or collaborating with users of Microsoft Office, because I became pro-active and never assumed. I would email the person or people I was to work with and ask what version of Office they were using. From that information, I could make sure to save my documents in a format they could readily open and read. + +But back to Nicky, who put a lot of time into learning about her Linux computer. I was surprised by her enthusiasm. + +Learning how to use Linux on the desktop is made much simpler when the person doing the learning realizes that all habits and tools for using Windows are to be left at the door. Even after telling our Reglue kids this, more often than not when I come back to do a check-up with them there is some_dodgy_file.exe on the desktop or in the download folder. + +While we are in the general vicinity of discussing files, let’s talk about doing updates. For a long time I was dead set against having multiple program installers or updaters on the same computer. In the case of Mint, it was decided to disable the update ability completely within Synaptic and that frosted my flakes. But while for us older folks dpkg and apt are our friends, wise heads have prevailed and have come to understand that the command line doesn’t often seem warm and welcoming to new users. + +I frothed at the mouth and raged against the machine over the crippling of Synaptic until it was ‘splained to me. Do you remember when you were just starting out and had full admin rights to your brand new Linux install? Remember when you combed through the massive amounts of software listed in Synaptic? Remember how you began check marking every cool program you found? Do you remember how many of those cool programs started with the letters “lib”? + +Yeah, me too. I installed and broke a few brand new installations until I found out that those LIB files were the nuts and bolts of the application and not the application itself. That’s why the genius’ behind Linux Mint and Ubuntu have created smart, pretty-to-look-at and easy-to-use application installers. Synaptic is still there for us old heads, but for the people coming up behind us, there are just too many ways to leave a system open to major borks by installing lib files and the like. In the new installers, those files are tucked away and not even shown to the user. And really, that’s the way it should be. + +Unless you are charging for support calls that is. + +There are a lot of smarts built into today’s Linux distros and I applaud those folks because they make my job easier. Not every new user is a Nicky. She was pretty much an install and forget project for me, and she is in the minority. The majority of new Linux users can be needy at times. + +That’s okay. They are the ones who will be teaching their kids how to use Linux. + +-------------------------------------------------------------------------------- + +via: http://fossforce.com/2016/05/anatomy-linux-user/ + +作者:[Ken Starks][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://linuxlock.blogspot.com/ From 44da04b728932c60a53c98b92a29ebd38567fa1b Mon Sep 17 00:00:00 2001 From: alim0x Date: Sun, 5 Jun 2016 21:31:38 +0800 Subject: [PATCH 0866/1469] [translating]Apps to Snaps --- sources/tech/20160601 Apps to Snaps.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160601 Apps to Snaps.md b/sources/tech/20160601 Apps to Snaps.md index fb7e712de9..1d4f726070 100644 --- a/sources/tech/20160601 Apps to Snaps.md +++ b/sources/tech/20160601 Apps to Snaps.md @@ -1,3 +1,5 @@ +alim0x transalting + Apps to Snaps ================ From fad7d2b6116471aee834df25073011859983cf17 Mon Sep 17 00:00:00 2001 From: alim0x Date: Sun, 5 Jun 2016 23:21:49 +0800 Subject: [PATCH 0867/1469] [translated]Apps to Snaps --- sources/tech/20160601 Apps to Snaps.md | 63 ----------------------- translated/tech/20160601 Apps to Snaps.md | 61 ++++++++++++++++++++++ 2 files changed, 61 insertions(+), 63 deletions(-) delete mode 100644 sources/tech/20160601 Apps to Snaps.md create mode 100644 translated/tech/20160601 Apps to Snaps.md diff --git a/sources/tech/20160601 Apps to Snaps.md b/sources/tech/20160601 Apps to Snaps.md deleted file mode 100644 index 1d4f726070..0000000000 --- a/sources/tech/20160601 Apps to Snaps.md +++ /dev/null @@ -1,63 +0,0 @@ -alim0x transalting - -Apps to Snaps -================ - -![](https://insights.ubuntu.com/wp-content/uploads/27eb/app-snap.png) - -Distributing applications on Linux is not always easy. You have different packaging formats, base systems, available libraries, and distribution release cadences all of which contribute to the headache. But now we have something much simpler: Snaps. - -Snaps are a new way for developers to package their applications, bringing with it many advantages over the more traditional package formats such as .deb, .rpm, and others. Snaps are secure, isolated from each other and the host system using technologies such as AppArmor, they are cross-platform, and they are self-contained, allowing a developer to package the exact software their application needs. This sandboxed isolation also improves security and allows applications, and whole snap-based systems, to be rolled back should an issue occur. Snaps really are the future of Linux application packaging. - -Creating a snap is not difficult. First, you need the snap-based runtime environment that is able to understand and execute snaps on your desktop; this tool is named snapd and comes as default on all Ubuntu 16.04 systems. Next you need the tool to create snaps, Snapcraft, which can be installed simply with: - -``` -$ sudo apt-get install snapcraft -``` - -Once you have this environment available it is time to get snapping. - -Snaps use a special YAML formatted file named snapcraft.yaml that defines how the application is packaged as well as any dependencies it may have. Taking a simple application to demonstrate this point, the following YAML file is a real example of how to snap the moon-buggy game, available from the Ubuntu archive. - -``` -name: moon-buggy -version: 1.0.51.11 -summary: Drive a car across the moon -description: | -A simple command-line game where you drive a buggy on the moon -apps: -play: -command: usr/games/moon-buggy -parts: -moon-buggy: -plugin: nil -stage-packages: [moon-buggy] -snap: -– usr/games/moon-buggy -``` - -The above code demonstrates a few new concepts. The first section is all about making your application discoverable in the store; setting the packaging metadata name, version, summary, and description. The apps section implements the play command which points to the location of the moon-buggy executable. The parts section tells Snapcraft about any required plugins that are needed to build the application along with any packages it depends on. In this simple example all we need is the moon-buggy application itself from the Ubuntu archive and Snapcraft takes care of the rest. - -Running snapcraft in the directory where you have the snapcraft.yaml file will create the moon-buggy_1.0.51.11_amd64.snap which can be installed by running: - -``` -$ snap install moon-buggy_1.0.51.11_amd64.snap -``` - -To seen an example of snapping something a little more complex, like the Electron-based Simplenote application [see here][1], for a tutorial online [here][2] and the corresponding code on [GitHub][3]. More examples can be found on the getting Ubuntu developer [website here][4]. - --------------------------------------------------------------------------------- - -via: https://insights.ubuntu.com/2016/06/01/apps-to-snaps/ - -作者:[Jamie][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://insights.ubuntu.com/author/jamiebennett/ -[1]: http://www.simplenote.com/ -[2]: http://www.linuxuk.org/post/20160518_snapping_electron_based_applications_simplenote/ -[3]: https://github.com/jamiedbennett/snaps/tree/master/simplenote -[4]: https://developer.ubuntu.com/en/desktop/get-started/ diff --git a/translated/tech/20160601 Apps to Snaps.md b/translated/tech/20160601 Apps to Snaps.md new file mode 100644 index 0000000000..7dbf0784c9 --- /dev/null +++ b/translated/tech/20160601 Apps to Snaps.md @@ -0,0 +1,61 @@ +Apps to Snaps +================ + +![](https://insights.ubuntu.com/wp-content/uploads/27eb/app-snap.png) + +在 Linux 分发应用不总是那么容易。你有不同的包格式,基础系统,可用库,以及发行版发布周期,所有的这些都让人头疼。但现在我们有了更简单的东西:Snap。 + +Snap 是开发者打包他们应用的新途径,它相对于传统包格式,如 .deb,.rpm 等带来了许多优点。Snap 安全,互相独立,宿主系统使用类似 AppArmor 的技术,它们跨平台,而且是自足的,让开发者可以准确打包它们应用所需要的依赖。沙盒隔离也加强了安全,并允许应用和整个基于 snap 的系统,在出现问题的时候可以回滚。Snap 确实是 Linux 应用打包的未来。 + +创建一个 snap 包并不困难。首先,你需要一个 snap 基础运行环境,能够在你的桌面理解和运行 snap,这个工具叫做 snapd 并且默认内置于所有 Ubuntu 16.04 系统中。接着你需要创建 snap 的工具,Snapcraft,可以通过一个简单的命令安装: + +``` +$ sudo apt-get install snapcraft +``` + +这个环境安装好了之后就可以 snap 起来了。 + +Snap 使用一个特殊的 YAML 格式文件,称作 snapcraft.yaml,它定义了应用是如何打包的以及它需要的依赖。用一个简单的应用来演示一下,下面的 YAML 文件是个如何 snap 打包 moon-buggy 游戏的实际例子,该游戏在 Ubuntu 源中提供。 + +``` +name: moon-buggy +version: 1.0.51.11 +summary: Drive a car across the moon +description: | +A simple command-line game where you drive a buggy on the moon +apps: +play: +command: usr/games/moon-buggy +parts: +moon-buggy: +plugin: nil +stage-packages: [moon-buggy] +snap: +– usr/games/moon-buggy +``` + +上面的代码演示了几个新概念。第一部分是关于让你的应用可以在商店找到的,设置包元数据名称,版本号,摘要,以及描述。Apps 部分实现了运行命令,指向 moon-buggy 可执行文件位置。Parts 部分告诉 snapcraft 用来构建应用所需要的插件以及依赖的包。在这个简单的例子中我们需要的所有东西就是 Ubuntu 源中的 moon-buggy 应用本身,snapcraft 负责剩下的工作。 + +在你的 snapcraft.yaml 所在目录下运行 snapcraft 会创建 moon-buggy_1.0.51.11_amd64.snap 包,可以通过以下命令来安装它: + +``` +$ snap install moon-buggy_1.0.51.11_amd64.snap +``` + +想了解更复杂一点的 snap 打包,比如基于 Electron 的 Simplenote [看这里][1],在线教程在[这里][2],相应的代码在[Github][3]。更多的例子可以在这里的 Ubuntu 开发者[站点][4]找到。 + +-------------------------------------------------------------------------------- + +via: https://insights.ubuntu.com/2016/06/01/apps-to-snaps/ + +作者:[Jamie][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://insights.ubuntu.com/author/jamiebennett/ +[1]: http://www.simplenote.com/ +[2]: http://www.linuxuk.org/post/20160518_snapping_electron_based_applications_simplenote/ +[3]: https://github.com/jamiedbennett/snaps/tree/master/simplenote +[4]: https://developer.ubuntu.com/en/desktop/get-started/ From 0cb962938a7a9239818b70c5fa27aee775017cef Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 6 Jun 2016 09:19:08 +0800 Subject: [PATCH 0868/1469] PUB:20160514 NODEOS - LINUX DISTRIBUTION FOR NODE LOVERS @geekpi --- ...OS - LINUX DISTRIBUTION FOR NODE LOVERS.md | 53 +++++++++++++++++++ ...OS - LINUX DISTRIBUTION FOR NODE LOVERS.md | 53 ------------------- 2 files changed, 53 insertions(+), 53 deletions(-) create mode 100644 published/20160514 NODEOS - LINUX DISTRIBUTION FOR NODE LOVERS.md delete mode 100644 translated/tech/20160514 NODEOS - LINUX DISTRIBUTION FOR NODE LOVERS.md diff --git a/published/20160514 NODEOS - LINUX DISTRIBUTION FOR NODE LOVERS.md b/published/20160514 NODEOS - LINUX DISTRIBUTION FOR NODE LOVERS.md new file mode 100644 index 0000000000..ea47ad605b --- /dev/null +++ b/published/20160514 NODEOS - LINUX DISTRIBUTION FOR NODE LOVERS.md @@ -0,0 +1,53 @@ +NodeOS:Node 爱好者的 Linux 发行版 +================================================ + +![](http://itsfoss.com/wp-content/uploads/2016/05/node-os-linux.jpg) + +[NodeOS][1] 是一款基于 [Node.js][2] 的操作系统,自去年其首个[发布候选版][3]之后正朝着它的1.0版本进发。 + +如果你之前不知道的话,NodeOS 是首个架构在 [Linux][5] 内核之上的由 Node.js 和 [npm][4] 驱动的操作系统。[Jacob Groundwater][6] 在2013年中期介绍了这个项目。该操作系统中用到的主要技术是: + +- **Linux 内核**: 这个系统建造在 Linux 内核上 +- **Node.js 运行时**: Node 作为主要的运行时环境 +- **npm 包管理**: npm 作为包管理 + +NodeOS 源码托管在 [Github][7] 上,因此,任何感兴趣的人都可以轻松贡献或者报告 bug。用户可以从源码构建或者使用[预编译镜像][8]。构建过程及快速起步指南可以在项目仓库中找到。 + +NodeOS 背后的思想是提供足够 npm 运行的环境,剩余的功能就可以让 npm 包管理来完成。因此,用户可以使用多达大约 250,000 个软件包,并且这个数目每天都还在增长。所有的都是开源的,你可以根据你的需要很容易地打补丁或者增加更多的包。 + +NodeOS 核心开发被分离成了不同的层面,基本的结构包含: + +- **barebones** – 带有可以启动到 Node.js REPL 的 initramfs 的自定义内核 +- **initramfs** – 用于挂载用户分区以及启动系统的 initram 文件系统 +- **rootfs** – 存放 linux 内核及 initramfs 文件的只读分区 +- **usersfs** – 多用户文件系统(如传统系统一样) + +NodeOS 的目标是可以在任何平台上运行,包括: **实际的硬件(用户计算机或者 SoC)**、**云平台、虚拟机、PaaS 提供商,容器**(Docker 和 Vagga)等等。如今看来,它做得似乎不错。在3.3号,NodeOS 的成员 [Jesús Leganés Combarro][9] 在 Github上[宣布][10]: + +>**NodeOS 不再是一个玩具系统了**,它现在开始可以用在有实际需求的生产环境中了。 + +因此,如果你是 Node.js 的死忠或者乐于尝试新鲜事物,这或许值得你一试。在相关的文章中,你应该了解这些[Linux 发行版的具体用法][11] + + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/nodeos-operating-system/ + +作者:[Munif Tanjim][a] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://itsfoss.com/author/munif/ +[1]: http://node-os.com/ +[2]: https://nodejs.org/en/ +[3]: https://github.com/NodeOS/NodeOS/releases/tag/v1.0-RC1 +[4]: https://www.npmjs.com/ +[5]: http://itsfoss.com/tag/linux/ +[6]: https://github.com/groundwater +[7]: https://github.com/nodeos/nodeos +[8]: https://github.com/NodeOS/NodeOS/releases +[9]: https://github.com/piranna +[10]: https://github.com/NodeOS/NodeOS/issues/216 +[11]: http://itsfoss.com/weird-ubuntu-based-linux-distributions/ diff --git a/translated/tech/20160514 NODEOS - LINUX DISTRIBUTION FOR NODE LOVERS.md b/translated/tech/20160514 NODEOS - LINUX DISTRIBUTION FOR NODE LOVERS.md deleted file mode 100644 index d189753fd5..0000000000 --- a/translated/tech/20160514 NODEOS - LINUX DISTRIBUTION FOR NODE LOVERS.md +++ /dev/null @@ -1,53 +0,0 @@ -NODEOS: NODE爱好者的Linux发行版 -================================================ - -![](http://itsfoss.com/wp-content/uploads/2016/05/node-os-linux.jpg) - -[NodeOS][1]是一个基于[Node.js][2]的操作系统,自去年的首个[发布候选版][3]之后正朝着它的1.0版本进发。 - -如果你是第一次听到它,NodeOS是首个在[Linux][5]内核之上由Node.js和[npm][4]驱动的操作系统。[Jacob Groundwater][6]仔2013年中介绍了这个项目。操作系统中用到的主要技术是: - -- **Linux 内核**: 这个系统内置了Linux内核 -- **Node.js 运行时**: Node作为主要的运行时 -- **npm 包管理**: npm作为包管理 - -NodeOS源码托管在[Github][7]上,因此,任何感兴趣的人都可以轻松贡献或者报告bug。用户可以从源码构建或者使用[预编译镜像][8]。构建过程及使用可以在项目仓库中找到。 - -NodeOS背后的思想是提供足够npm运行的环境,剩余的功能就可以来自npm包管理。因此,用户可以使用大量的大约250,000的包,并且这个数目每天都还在增长。并且所有的都是开源的,你可以根据你的需要很容易地打补丁或者增加更多的包。 - -NodeOS核心开发被分离成了不同的层,基本的结构包含: - -- **barebones** – 带有可以启动到Node.js REPL的initramfs的自定义内核 -- **initramfs** – =用于挂载用户分区以及启动系统的initram文件系统 -- **rootfs** – 托管linux内核及initramfs文件的只读分区 -- **usersfs** – 多用户文件系统(如传统系统一样) - -NodeOS的目标是可以仔任何平台上运行,包括- **真实的硬件(用户计算机或者SoC)**、**云平台、虚拟机、PaaS提供商,容器**(Docker和Vagga)等等。如今看来,它做得似乎不错。在3.3号,NodeOS的成员[Jesús Leganés Combarro][9]在Github上[宣布][10]: - ->**NodeOS不再是一个玩具系统了**,它现在开始可以用在有实际需求的生产环境中了。 - -因此,如果你是Node.js的死忠或者乐于尝试新鲜事物,这或许值得你一试。在相关的文章中,你应该了解这些[Linux发行版的具体用法][11] - - --------------------------------------------------------------------------------- - -via: http://itsfoss.com/nodeos-operating-system/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 - -作者:[Munif Tanjim][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/munif/ -[1]: http://node-os.com/ -[2]: https://nodejs.org/en/ -[3]: https://github.com/NodeOS/NodeOS/releases/tag/v1.0-RC1 -[4]: https://www.npmjs.com/ -[5]: http://itsfoss.com/tag/linux/ -[6]: https://github.com/groundwater -[7]: https://github.com/nodeos/nodeos -[8]: https://github.com/NodeOS/NodeOS/releases -[9]: https://github.com/piranna -[10]: https://github.com/NodeOS/NodeOS/issues/216 -[11]: http://itsfoss.com/weird-ubuntu-based-linux-distributions/ From 85c44a4ce949a260e64f5a3df702ddb515d7e281 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 6 Jun 2016 09:32:32 +0800 Subject: [PATCH 0869/1469] PUB:20160221 NXP unveils a tiny 64-bit ARM processor for the Internet of Things @geekpi --- ...it ARM processor for the Internet of Things.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) rename {translated/tech => published}/20160221 NXP unveils a tiny 64-bit ARM processor for the Internet of Things.md (64%) diff --git a/translated/tech/20160221 NXP unveils a tiny 64-bit ARM processor for the Internet of Things.md b/published/20160221 NXP unveils a tiny 64-bit ARM processor for the Internet of Things.md similarity index 64% rename from translated/tech/20160221 NXP unveils a tiny 64-bit ARM processor for the Internet of Things.md rename to published/20160221 NXP unveils a tiny 64-bit ARM processor for the Internet of Things.md index 6711f5d4a6..d31ad4eaea 100644 --- a/translated/tech/20160221 NXP unveils a tiny 64-bit ARM processor for the Internet of Things.md +++ b/published/20160221 NXP unveils a tiny 64-bit ARM processor for the Internet of Things.md @@ -1,21 +1,20 @@ -NXP 揭幕了一块超小型物联网64位ARM处理器 +NXP 发布了一块超小型物联网64位 ARM 处理器 ========================================================================= -**标签**:[ARM][1], [物联网][2], [NXP][3], [NXP 半导体][4] ![](http://1u88jj3r4db2x4txp44yqfj1.wpengine.netdna-cdn.com/wp-content/uploads/2016/02/nxp-930x556.jpg) -[NXP 半导体][5]揭幕了一块声称世界上最小的用于物联网(IoT)的低功耗64位ARM处理器。 +[NXP 半导体][5]发布了一块声称世界上最小的用于物联网(IoT)的低功耗64位ARM处理器。 -这片小型的QorIQ LS1012A为电池供电,大小受限的应用提供了网络级的安全和性能加速。这包括了运行物联网应用,或者任何智能及可连接的设备。如果物联网能在2020达到1.7万亿美金的潜力(由IDC研究员估算市场得出),那么它将需要像NXP这样的处理器,该处理器在德国纽伦堡的Embedded World 2016 上揭开了什么的面纱。 +这片小型的QorIQ LS1012A为电池供电、大小受限的应用提供了网络级的安全和性能加速。这包括了运行物联网应用,或者任何智能及可连接的设备。如果物联网能在2020达到1.7万亿美金的潜力(由IDC研究员估算市场得出),那么它将需要像NXP这样的处理器,该处理器在德国纽伦堡的Embedded World 2016 上揭开了什么的面纱。 该芯片带有64位ARMv8芯片,拥有网络包加速及内置的安全。它占用9.6平方毫米的空间,并且大约消耗1瓦特的电力。潜在的应用包括下一代的物联网网关、可携带娱乐平台、高性能可携带存储应用、移动硬盘、相机的移动存储、平板及其他可充电的设备。 -除此之外,LS1012A是第一款为新起的基于对象的存储方案设计的处理器,基于对象存储基于智能硬盘,它直接连接到以太网数据中心。处理器必须足够小才能直接集成在硬盘的集成电路上。 +除此之外,LS1012A是第一款为最新兴起的基于对象的存储方案设计的处理器,基于对象存储通过智能硬盘直接连接到以太网数据中心。处理器必须足够小才能直接集成在硬盘的集成电路上。 -NXP的高级副总裁及数字网络部的经理Tareq Bustami说:“低功耗、占用空间小及网络级性能这些突破性组合的NXP LS1012处理器是消费者、物联网相关应用的理想选择。独有的混合能力解放了物联网设计者及开发者使得他们可以在这个高增长的市场中想象并创造更多创新产品。” +NXP的高级副总裁及数字网络部的经理Tareq Bustami说:“突破性组合了低功耗、占用空间小及网络级性能的NXP LS1012处理器是消费者、物联网相关应用的理想选择。独有地将这些能力结合到一起解放了物联网设计者及开发者,使得他们可以在这个高增长的市场中设计并创造更多创新产品。” -NXP说这是唯一一个能够结合全面的高速外围在一个芯片中的1瓦特、64位处理器,这意味着低系统功耗。归功于创新的封装,该处理器可以在低成本的电路板中布线。 +NXP说这是唯一一个1瓦特功耗、64位的、并将这些高速外设综合到一个芯片中的处理器,这意味着更低的系统级功耗。归功于创新性的封装,该处理器可以运用在低成本的电路板中。 NXP的LS1012A可以在2016年4月开始发货,并且现在可以订货。NXP在全球35个国家拥有超过4,5000名员工。 @@ -25,7 +24,7 @@ via: http://venturebeat.com/2016/02/21/nxp-unveils-a-small-and-tiny-64-bit-arm-p 作者:[DEAN TAKAHASHI][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 b85a41555654d105d86a0f2e6c1f12a5e51e241b Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 6 Jun 2016 09:50:10 +0800 Subject: [PATCH 0870/1469] PUB:20160218 7 Steps to Start Your Linux SysAdmin Career @alim0x --- ...eps to Start Your Linux SysAdmin Career.md | 59 ++++++++++++++++ ...eps to Start Your Linux SysAdmin Career.md | 67 ------------------- 2 files changed, 59 insertions(+), 67 deletions(-) create mode 100644 published/20160218 7 Steps to Start Your Linux SysAdmin Career.md delete mode 100644 translated/tech/20160218 7 Steps to Start Your Linux SysAdmin Career.md diff --git a/published/20160218 7 Steps to Start Your Linux SysAdmin Career.md b/published/20160218 7 Steps to Start Your Linux SysAdmin Career.md new file mode 100644 index 0000000000..0f46f091d3 --- /dev/null +++ b/published/20160218 7 Steps to Start Your Linux SysAdmin Career.md @@ -0,0 +1,59 @@ +七步开始你的 Linux 系统管理员生涯 +=============================================== + +Linux 现在是个大热门。每个人都在寻求 Linux 才能。招聘人员对有 Linux 经验的人求贤若渴,还有无数的职位虚位以待。但是如果你是 Linux 新手,又想要赶上这波热潮,该从何开始下手呢? + +###1、安装 Linux### + +这应该是不言而喻的,但学习 Linux 的第一关键就是安装 Linux。LFS101x 和 LFS201 课程都包含第一次安装和配置 Linux 的详细内容。 + +###2、 完成 LFS101x 课程### + +如果你是完完全全的 Linux 新手,最佳的起点是我们的免费 Linux 课程 [LFS101x Introduction to Linux](https://www.edx.org/course/introduction-linux-linuxfoundationx-lfs101x-2)。这个在线课程放在 edX.org,探索 Linux 系统管理员和终端用户常用的各种工具和技能以及日常的 Linux 工作环境。该课程是为有一定经验,但较少或没有接触过 Linux 的电脑用户设计的,不论他们是在个人还是企业环境中工作。这个课程会从图形界面和命令行两个方面教会你有用的 Linux 知识,让你能够了解主流的 Linux 发行版。 + +###3、 看看 LFS201 课程### + +在你完成 LFS101x 之后,你就可以开始挑战 Linux 中更加复杂的任务了,这是成为一名专业的系统管理员所必须的。为了掌握这些技能,你应该看看 [LFS201 Essentials of Linux System Administration](http://training.linuxfoundation.org/linux-courses/system-administration-training/essentials-of-system-administration) 这个课程。该课程对每个话题进行了深度的解释和介绍,还有大量的练习和实验,帮助你获得相关主题实际的上手经验。 + +如果你更愿意有个教练,或者你的雇主想将你培养成 Linux 系统管理员的话,你可能会对 LFS220 Linux System Administration 感兴趣。这个课程有 LFS201 中所有的主题,但是它是由专家专人教授的,帮助你进行实验以及解答你在课程主题中的问题。 + +###4、 练习!### + +熟能生巧,和对任何乐器或运动适用一样,这对 Linux 来说也一样适用。在你安装 Linux 之后,经常使用它。一遍遍地练习关键任务,直到你不需要参考材料也能轻而易举地完成。练习命令行的输入输出以及图形界面。这些练习能够保证你掌握成为成功的 Linux 系统管理员所必需的知识和技能。 + +###5、 获得认证### + +在你完成 LFS201 或 LFS220 并且充分练习之后,你现在已经准备好获得系统管理员的认证了。你需要这个证书,因为你需要向雇主证明你拥有一名专业 Linux 系统管理员必需的技能。 + +现在有一些不同的 Linux 证书,它们每个都有其独到之处。但是,它们里大部分不是在特定发行版(如红帽)上认证,就是纯粹的知识测试,没有演示 Linux 的实际技能。Linux 基金会认证系统管理员(Linux Foundation Certified System Administrator)证书对想要一个灵活的,有意义的初级证书的人来说是个不错的选择。 + +###6、 参与进来### + +如果你所在的地方有本地 Linux 用户组(Linux Users Group,LUG)的话,这时候你可以考虑加入他们。这些组织通常由各种年龄和经验水平的人组成,所以不管你的 Linux 经验水平如何,你都能找到和你类似技能水平的人互助,或是更高水平的 Linux 用户来解答你的问题以及介绍有用的资源。要想知道你附近有没有 LUG,上 meet.com 看看,或是附近的大学,又或是上网搜索一下。 + +还有不少在线社区可以在你学习 Linux 的时候帮助你。这些站点和社区向 Linux 新手和有经验的管理员都能够提供帮助和支持: + + - [Linux Admin subreddit](https://www.reddit.com/r/linuxadmin) + - [Linux.com](http://www.linux.com/) + - [training.linuxfoundation.org](http://training.linuxfoundation.org/) + - [http://community.ubuntu.com/help-information/](http://community.ubuntu.com/help-information/) + - [https://forums.opensuse.org/forum.php](https://forums.opensuse.org/forum.php) + - [http://wiki.centos.org/Documentation](http://wiki.centos.org/Documentation) + +###7、 学会热爱文档### + +最后但同样重要的是,如果你困在 Linux 的某些地方,别忘了 Linux 包含的文档。使用命令 man(manual,手册),info 和 help,你从系统内就可以找到 Linux 几乎所有方面的信息。这些内置资源的用处再夸大也不为过,你会发现你在生涯中始终会用到,所以你可能最好早点掌握使用它们。 + +想要了解更多开始你 Linux IT 生涯的信息?查看我们免费的电子书“[开始你 Linux IT 生涯的简短指南](http://training.linuxfoundation.org/sysadmin-it-career-guide)”。 + +------------------------------------------------------------------------------ + +via: http://www.linux.com/news/featured-blogs/191-linux-training/834644-7-steps-to-start-your-linux-sysadmin-career + +作者:[linux.com][a] +译者:[alim0x](https://github.com/alim0x) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:linux.com diff --git a/translated/tech/20160218 7 Steps to Start Your Linux SysAdmin Career.md b/translated/tech/20160218 7 Steps to Start Your Linux SysAdmin Career.md deleted file mode 100644 index e6b4fa62ab..0000000000 --- a/translated/tech/20160218 7 Steps to Start Your Linux SysAdmin Career.md +++ /dev/null @@ -1,67 +0,0 @@ -七步开始你的 Linux 系统管理员生涯 -=============================================== - - -Linux 现在是个大热门。每个人都在寻求 Linux 才能。招聘人员对有 Linux 经验的人求贤若渴,还有无数的职位虚位以待。但是如果你是 Linux 新手,又想要赶上这波热潮,该从何开始下手呢? - -1. 安装 Linux - - 这应该是不言而喻的,但学习 Linux 的第一关键就是安装 Linux。LFS101x 和 LFS201 课程都包含第一次安装和配置 Linux 的详细内容。 - -2. 完成 LFS101x 课程 - - 如果你是 Linux 完完全全的新手,最佳的起点是免费的 Linux 课程 [LFS101x Introduction](https://www.edx.org/course/introduction-linux-linuxfoundationx-lfs101x-2)。这个在线课程在 edX.org,探索 Linux 系统管理员和终端用户常用的各种工具和技能以及日常 Linux 工作环境。该课程是为有一定经验但较少或没有接触过 Linux 的电脑用户设计的,不论他们是在个人还是企业环境中工作。这个课程会从图形界面和命令行教会你有用的 Linux 知识,让你能够了解主流的 Linux 发行版。 - -3. 看看 LFS201 课程 - - 在你完成 LFS101x 之后,你就准备好开始进入 Linux 更加复杂的任务了,这是成为一名专业的系统管理员所必须的。为了掌握这些技能,你应该看看 [LFS201 Essentials of Linux System Administration](http://training.linuxfoundation.org/linux-courses/system-administration-training/essentials-of-system-administration) 这个课程。该课程对每个话题进行了深度的解释和介绍,还有大量的练习和实验,帮助你获得相关主题实际的上手经验。 - - 如果你更愿意有个教练或者你的雇主对将你培养成 Linux 系统管理员有兴趣,你可能会对 LFS220 Linux System Administration 有兴趣。这个课程有 LFS201 中所有的主题,但是它是由专家专人教授的,帮助你进行实验以及解答你在课程主题中的问题。 - -4. 练习! - - 熟能生巧,和对任何乐器或运动适用一样,这对 Linux 来说也一样适用。在你安装 Linux 之后,经常使用它。一遍遍地练习关键任务,直到你不需要参考材料也能轻而易举地完成。练习命令行和图形界面的输入输出。这些练习能够保证你掌握成为成功的 Linux 系统管理员所必需的知识和技能。 - -5. 获得认证 - - 在你完成 LFS201 或 LFS220 并且充分练习之后,你现在已经准备好获得系统管理员的认证了。你需要这个证书,因为你需要向雇主证明你拥有一名专业 Linux 系统管理员必需的技能。 - - 现在有一些不同的 Linux 证书,它们有它们的独到之处。但是,它们里大部分不是在特定发行版(如红帽)上认证,就是纯粹的知识测试,没有演示 Linux 的实际技能。Linux 基金会认证系统管理员(Linux Foundation Certified System Administrator)证书对想要一个灵活的,有意义的初级证书的人来说是个优秀的替代。 - -6. 参与进来 - - 如果你所在的地方有本地 Linux 用户组(Linux Users Group,LUG)的话,这时候你可能还想要考虑加入他们。这些组织通常由各种年龄和经验水平的人组成,所以不管你的 Linux 经验水平如何,你都能找到和你类似技能水平的人互助,或是更高水平的 Linux 用户来解答你的问题以及介绍有用的资源。要想知道你附近有没有 LUG,上 meet.com 看看,或是附近的大学,又或是上网搜索一下。 - - 还有不少在线社区可以在你学习 Linux 的时候帮助你。这些站点和社区向 Linux 新手和有经验的管理员都能够提供帮助和支持: - - - [Linux Admin subreddit](https://www.reddit.com/r/linuxadmin) - - - [Linux.com](http://www.linux.com/) - - - [training.linuxfoundation.org](http://training.linuxfoundation.org/) - - - [http://community.ubuntu.com/help-information/](http://community.ubuntu.com/help-information/) - - - [https://forums.opensuse.org/forum.php](https://forums.opensuse.org/forum.php) - - - [http://wiki.centos.org/Documentation](http://wiki.centos.org/Documentation) - -7. 学会热爱文档 - - 最后但同样重要的是,如果你困在 Linux 的某些地方,别忘了 Linux 包含的文档。使用命令 man(manual,手册),info 和 help,你从系统内就可以找到 Linux 几乎所有方面的信息。这些内置资源的用处再夸大也不为过,你会发现你在生涯中始终会用到,所以你可能最好早点掌握使用它们。 - - 想要了解更多开始你 Linux IT 生涯的信息?查看我们免费的电子书“[开始你 Linux IT 生涯的简短指南](http://training.linuxfoundation.org/sysadmin-it-career-guide)”。 - -[立刻下载](http://training.linuxfoundation.org/sysadmin-it-career-guide) - ------------------------------------------------------------------------------- - -via: http://www.linux.com/news/featured-blogs/191-linux-training/834644-7-steps-to-start-your-linux-sysadmin-career - -作者:[linux.com][a] -译者:[alim0x](https://github.com/alim0x) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:linux.com From 681b3945deca3187652a712d80c36030b7c1742e Mon Sep 17 00:00:00 2001 From: alim0x Date: Mon, 6 Jun 2016 22:40:31 +0800 Subject: [PATCH 0871/1469] [translating]Will Google Replace Passwords With A New Trust-Based Authentication Method --- ...ce Passwords With A New Trust-Based Authentication Method.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/talk/20160605 Will Google Replace Passwords With A New Trust-Based Authentication Method.md b/sources/talk/20160605 Will Google Replace Passwords With A New Trust-Based Authentication Method.md index 2434c0412a..66930943a1 100644 --- a/sources/talk/20160605 Will Google Replace Passwords With A New Trust-Based Authentication Method.md +++ b/sources/talk/20160605 Will Google Replace Passwords With A New Trust-Based Authentication Method.md @@ -1,3 +1,5 @@ +alim0x translating + Will Google Replace Passwords With A New Trust-Based Authentication Method? =========================================================================== From b38f2f3a9d51aaaca1fadec758a48d379172a5ee Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 7 Jun 2016 07:49:10 +0800 Subject: [PATCH 0872/1469] PUB:20160218 9 Key Trends in Hybrid Cloud Computing @sonofelice --- ... 9 Key Trends in Hybrid Cloud Computing.md | 74 ++++++++++++++++++ ... 9 Key Trends in Hybrid Cloud Computing.md | 76 ------------------- 2 files changed, 74 insertions(+), 76 deletions(-) create mode 100644 published/20160218 9 Key Trends in Hybrid Cloud Computing.md delete mode 100644 translated/tech/20160218 9 Key Trends in Hybrid Cloud Computing.md diff --git a/published/20160218 9 Key Trends in Hybrid Cloud Computing.md b/published/20160218 9 Key Trends in Hybrid Cloud Computing.md new file mode 100644 index 0000000000..92fba66440 --- /dev/null +++ b/published/20160218 9 Key Trends in Hybrid Cloud Computing.md @@ -0,0 +1,74 @@ +混合云计算的 9 大关键趋势 +======================================== + +自从几年前云计算的概念受到IT界的关注以来,公有云、私有云和混合云这三种云计算方式都有了可观的演进。其中混合云计算方式是最热门的云计算方式,在接受调查的公司中,有[88%的公司](https://www.greenhousedata.com/blog/hybrid-continues-to-be-most-popular-cloud-option-adoption-accelerating)将混合云计算摆在至关重要的地位。 + +混合云计算的疾速演进意味着一两年前的传统观念已经过时了。为此,我们询问了几个行业分析师,混合云在2016年的走势将会如何,我们得到了几个比较有意思的答案。 + +1. **2016年可能是我们将混合云投入使用的一年。** + +混合云从本质上来说依赖于私有云,这对企业来说是比较难实现的。事实上,亚马逊,谷歌和微软的公有云已经进行了大量的投资,并且起步也比较早。私有云拖了混合云发展和使用的后腿。 + +私有云没有得到这么多的投资,这是有私有云的性质决定的。私有云意味着维护和投资你自己的数据中心。而许多公有云提供商正在推动企业减少或者消除他们的数据中心。 + +然而,得益于 OpenStack 的发展和微软的 Azure Stack ,这两者基本上就是封装在一个盒子里的私有云,我们将会看到私有云慢慢追上公有云的发展步伐。支持混合云的工具、基础设施和架构也变得更加健壮。 + +2. **容器,微服务和 unikernels 将会促进混合云的发展。** + +分析师预言,到2016年底,这些原生云技术会或多或少成为主流的。这些云技术正在快速成熟,将会成为虚拟机的一个替代品,而虚拟机需要更多的资源。 + +更重要的是,他们既能工作在在线场景,也能工作在离线场景。容器化和编排允许快速的扩大规模,进行公有云和私有云之间的服务迁移,使你能够更容易移动你的服务。 + +3. **数据和相关性占据核心舞台。** + +所有的云计算方式都处在发展模式。这使得云计算变成了一个技术类的故事。咨询公司 [Avoa](http://avoa.com/2016/01/01/2016-is-the-year-of-data-and-relevance/)称,随着云趋于成熟,数据和相关性变得越来越重要。起初,云计算和大数据都是关于怎么得到尽可能多的数据,然后他们担心如何处理这海量的数据。 + +2016年,相关组织将会继续锤炼如何进行数据收集和使用的相关技术。在必须处理的技术和文化方面仍然有待提高。但是2016年应该重新将关注点放在从各个方面考虑的数据重要性上,发现最相关的信息,而不只是数据的数量。 + +4. **云服务将超越按需工作负载。** + +AWS(Amazon Web Services) 起初是提供给程序员或者是开发人员能够快速启动虚拟机、做一些工作然后离线的一个地方。本质上是按需使用,要花费更多的钱才能让这些服务持续运行、全天候工作。 + +然而,IT 公司正开始作为服务代理,为内部用户提供各种 IT 服务。可以是内部 IT 服务,公有云基础架构提供商,平台服务和软件服务。 + +他们将越来越多的认识到像云管理平台这样的工具的价值。云管理平台可以提供针对不同服务的基于策略的一致性管理。他们也将看到像提高可移植性的容器等技术的价值。然而,云服务代理,在不同云之间快速移动工作负载从而进行价格套利或者类似的原因,仍然是行不通的。 + +5. **服务提供商转变成了云服务提供商。** + +到目前为止,购买云服务成了直销模式。AWS EC2 服务的使用者通常变成了购买者,要么通过官方认证渠道,要么通过影子 IT。但是随着云服务越来越全面,提供的服务菜单越来越复杂,越来越多的人转向了经销商,服务提供商转变成了他们 IT 服务的购买者。 + +2nd Watch (2nd Watch 是为企业提供云管理的 AWS 的首选合作伙伴)最近的一项调查发现,在美国将近85%的 IT 高管愿意支付一个小的溢价从渠道商那里购买公有云服务,如果购买过程变得不再那么复杂。根据调查,这85%的高管有五分之四的愿意支付额外的15%或者更多。三分之一的受访高管表示,这些有助于他们购买、使用和管理公有云服务。 + +6. **物联网和云对于2016年的意义好比移动和云对2012年的意义。** + +物联网获得了广泛的关注,更重要的是,物联网已经从测试场景进行了实际应用。云的分布式特性使得云成为了物联网非常重要的一部分,对于工业物联网,与后端系统交互的机械和重型设备,混合云将会成为最自然的驱动者,连接,数据采集和处理将会发生在混合云环境中,这得益于私有云在安全和隐私方面的好处。 + +7. **NIST 对云的定义开始瓦解。** + +2011年,美国国家标准与技术研究院发布了“[ NIST 对于云计算的定义](http://csrc.nist.gov/publications/nistpubs/800-145/SP800-145.pdf)”(PDF),这个定义成为了私有云、公有云、混合云和 aaS 模板的标准定义。 + +然而随着时间的推移,定义开始改变。IaaS 变得更加复杂,开始支持 OpenStack,[Swift](https://wiki.openstack.org/wiki/Swift) 对象存储和神经网络这样的项目。PaaS 似乎正在消退,因为 PaaS 和传统的中间件开发几乎无异。SaaS,只是通过浏览器进行访问的应用,也正在失去发展动力,因为许多 app 和服务提供了许多云接口,你可以通过各种手段调用接口,不仅仅通过浏览器。 + +8. **分析变得更加重要** + +对于混合云计算来说,分析将会成为一个巨大的增长机遇,云计算具有规模大、灵活性高的优势,使得云计算非常适合需要海量数据的分析工作。对于某些分析方式,比如高度敏感的数据,私有云仍然是主导地位,但是私有云也是混合云的一部分。因此,无论如何,混合云计算胜出。 + +9. **安全仍然是一个非常紧迫的问题。** + +随着混合云计算在2016年的发展,以及对物联网和容器等新技术的引进,这同时也增加了更多的脆弱可攻破的地方,从而导致数据泄露。先增加使用新技术的趋势,然后再去考虑安全性,这种问题经常发生,同时还有缺少经验的工程师不去考虑系统的安全问题,总有一天你会尝到灾难的后果的。 + +当一项新技术出来,管理规范总是落后于安全问题产生后,然后我们才考虑去保护技术。容器就是一个很鲜明的例子。你可以从 Docker 下载各种示例容器,但是你知道你下载的东西来自哪里么?在人们在对容器内容不知情的情况下下载并运行了容器之后,Docker 不得不重新加上安全验证。 + +像 Path 和 Snapchat 这样的移动技术在智能手机市场火起来之后也出现了重大的安全问题。一项新技术被恶意利用无可避免。所以安全研究人员需要通过各种手段来保证新技术的安全性,很有可能在部署之后才会发现安全问题。 + +------------------------------------------------------------------------------ + +via: http://www.datamation.com/cloud-computing/9-key-trends-in-hybrid-cloud-computing.html + +作者:[Andy Patrizio][a] +译者:[棣琦](https://github.com/sonofelice) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.datamation.com/author/Andy-Patrizio-90720.html diff --git a/translated/tech/20160218 9 Key Trends in Hybrid Cloud Computing.md b/translated/tech/20160218 9 Key Trends in Hybrid Cloud Computing.md deleted file mode 100644 index 5efec75ec3..0000000000 --- a/translated/tech/20160218 9 Key Trends in Hybrid Cloud Computing.md +++ /dev/null @@ -1,76 +0,0 @@ -混合云计算的9大关键趋势 -======================================== - -自从几年前云计算的概念受到IT界的关注以来,公有云、私有云和混合云这三种云计算方式都有了可观的演进。其中混合云计算方式是最热门的云计算方式,在接受调查的公司中,有[88%的公司](https://www.greenhousedata.com/blog/hybrid-continues-to-be-most-popular-cloud-option-adoption-accelerating)将混合云计算摆在至关重要的地位。 - -混合云计算的疾速演进意味着一两年前的传统观念已经过时了。为此,我们询问了几个行业分析师,混合云在2016年的走势将会如何,我们得到了几个比较有意思的答案。 - -1. **2016年可能是我们将混合云投入使用的一年。** - - 混合云从本质上来说依赖于私有云,这对企业来说是比较难实现的。事实上,亚马逊,谷歌和微软的公有云已经进行了大量的投资,并且起步也比较早。私有云拖了混合云发展和使用的后腿。 - - 私有云没有得到这么多的投资,这是有私有云的性质决定的。私有云意味着维护和投资你自己的数据中心。许多公有云提供商正在推动企业减少或者消除他们的数据中心。 - - 然而,得益于OpenStack的发展和微软的 Azure Stack ,这两者基本上就是封装在一个盒子里的私有云,我们将会看到私有云慢慢追上公有云的发展步伐。支持混合云的工具、基础设施和架构也变得更加健壮。 - - -2. **容器,微服务和unikernels将会促进混合云的发展。** - - 分析师预言,到2016年底,这些原生云技术会或多或少成为主流的。这些云技术正在快速成熟,将会成为虚拟机的一个替代品,而虚拟机需要更多的资源。 - - 更重要的是,他们既能工作在在线场景,也能工作在离线场景。容器化和编排允许快速的扩大规模,进行公有云和私有云之间的服务迁移,使你能够更容易移动你的服务。 - -3. **数据和相关性占据核心舞台。** - - 所有的云计算方式都处在发展模式。这使得云计算变成了一个技术类的故事。咨询公司[Avoa](http://avoa.com/2016/01/01/2016-is-the-year-of-data-and-relevance/)称,随着云趋于成熟,数据和相关性变得越来越重要。起初,云计算和大数据都是关于怎么吸收尽可能多的数据,然后他们担心如何处理这海量的数据。 - - 2016年,相关组织将会继续锤炼如何进行数据收集和使用的相关技术。在必须处理的技术和文化方面仍然有待提高。但是2016年应该重新将关注点放在从各个方面考虑的数据重要性上,发现最相关的信息,而不只是数据的数量。 - -4. **云服务将超越按需工作负载。** - - AWS(Amazon Web Services)起初是提供给程序员或者是开发人员能够快速启动虚拟机,做一些工作然后离线的一个地方。这就是按需使用的本质。要让这些服务持续运行,几乎需要全天候工作。 - - 然而,IT组织正开始作为服务代理,为内部用户提供各种IT服务。可以是内部IT服务,公有云基础架构提供商,平台服务和软件服务。 - - 他们将越来越多的认识到想云管理平台这样的工具的价值。云管理平台可以提供针对不同服务的基于策略的一致性管理。他们也将看到像提高可移植性的容器等技术的价值。然而,云服务代理,在不同云之间快速移动的工作负载进行价格套利或者相关原因的意义上来讲,仍然是行不通的。 - -5. **服务提供商转变成了云服务提供商。** - - 到目前为止,购买云服务成了直销模式。AWS EC2 服务的使用者通常变成了购买者,通过官方认证渠道或者通过影子IT。但是随着云服务越来越全面,提供的服务菜单越来越复杂,越来越多的人转向了经销商,服务提供商转变成了他们IT服务的购买者。 - - 2nd Watch (2nd Watch是为企业提供云管理的 AWS 的首选合作伙伴)最近的一项调查发现,在美国将近85%的IT高管愿意支付一个小的溢价从渠道商那里购买公有云服务,如果购买过程变得不再那么复杂。根据调查,这85%的高管有五分之四的愿意支付额外的15%或者更多。三分之一的受访高管表示,他们可以使用帮助来购买、使用和管理公有云服务。 - -6. **物联网和云对于2016年的意义好比移动和云对2012年的意义。** - - 物联网获得了广泛的关注,更重要的是,物联网已经从测试场景进行了实际应用。云的分布式特性使得云成为了物联网非常重要的一部分,对于工业物联网,与后端系统交互的机械和重型设备,混合云将会成为最自然的驱动者,连接,数据采集和处理将会发生在混合云环境中,这得益于私有云在安全和隐私方面的好处。 - -7. **NIST 对云的定义开始瓦解。** - - 2011年,美国国家标准与技术研究院发布了“[ NIST 对于云计算的定义](http://csrc.nist.gov/publications/nistpubs/800-145/SP800-145.pdf)”(PDF),这个定义成为了私有云、公有云、混合云和 aas模板的标准定义。 - - 然而随着时间的推移,定义开始改变。Iaas变得更加复杂,开始支持OpenStack,[Swift](https://wiki.openstack.org/wiki/Swift) 对象存储和神经网络这样的项目。Paas似乎正在消退,因为Paas和传统的中间件开发几乎无异。Saas,只是通过浏览器进行访问的应用,也正在失去发展动力,因为许多app和服务提供了许多云接口,你可以通过各种手段调用接口,不仅仅通过浏览器。 - -8. **分析变得更加重要** - - 对于混合云计算来说,分析将会成为一个巨大的增长机遇,云计算具有规模大、灵活性高的优势,使得云计算非常适合需要海量数据的分析工作。对于某些分析方式,比如高度敏感的数据,私有云仍然是主导地位但是私有云也是混合云的一部分。因此,无论如何,混合云计算胜出。 - -9. **安全仍然是一个非常紧迫的问题。** - - 随着混合云计算在2016年的发展,以及对物联网和容器等新技术的引进,这同时也增加了更多的脆弱可攻破的地方从而导致数据泄露。先增加使用新技术的趋势,然后再去考虑安全性,这种问题经常发生,同时还有缺少经验的工程师不去考虑系统的安全问题,总有一天你会尝到灾难的后果的。 - - 当一项新技术出来,管理规范总是落后于安全问题产生后,然后我们才考虑去保护技术。容器就是一个很鲜明的例子。你可以从Docker下周各种示例容器,但是你知道你下载的东西来自哪里么?在人们在对容器内容不知情的情况下下载并运行了容器之后,Docker不得不重新加上安全验证。 - - 像Path和Snapchat这样的移动技术在智能手机市场火起来之后也出现了重大的安全问题。一项新技术被恶意利用无可避免。所以安全研究人员需要通过各种手段来保证新技术的安全性。很有可能在部署之后才会发现安全问题。 - - ------------------------------------------------------------------------------- - -via: http://www.datamation.com/cloud-computing/9-key-trends-in-hybrid-cloud-computing.html - -作者:[Andy Patrizio][a] -译者:[棣琦](https://github.com/sonofelice) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.datamation.com/author/Andy-Patrizio-90720.html From 9b66a44b8eb311be8d3bb4f32547ff621a3a7649 Mon Sep 17 00:00:00 2001 From: Ezio Date: Tue, 7 Jun 2016 10:01:02 +0800 Subject: [PATCH 0873/1469] =?UTF-8?q?20160607-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git,guide --- ...160606 Basic Git Commands You Must Know.md | 219 ++++++++++++++++++ 1 file changed, 219 insertions(+) create mode 100644 sources/tech/20160606 Basic Git Commands You Must Know.md diff --git a/sources/tech/20160606 Basic Git Commands You Must Know.md b/sources/tech/20160606 Basic Git Commands You Must Know.md new file mode 100644 index 0000000000..336bf518a8 --- /dev/null +++ b/sources/tech/20160606 Basic Git Commands You Must Know.md @@ -0,0 +1,219 @@ +Basic Git Commands You Must Know +===================================== + +![](http://itsfoss.com/wp-content/uploads/2016/06/Download-Git-Sheet.jpg) + +*Brief: This quick guide shows you all the basic Git commands and their usage. You can download these commands for quick reference.* + +We have seen the quick guide and [Vi cheat sheet download][1] in an earlier post. In this article, we’ll see all the basic Git commands you need to get started with it. + +### GIT + +[Git][2] is a distributed version control system that is widely used by a number of open source projects. It was started in the year 2005 by Linux founder, [Linus Torvalds][3]. The program allows for a non-linear development of projects, and can handle large amounts of data effectively by storing it on the local server. In this tutorial, we are going to play around Git and learn how to get started with it. + +I am using Ubuntu in this tutorial but you can use any Linux distribution of your choice. Apart from installation, rest all commands are the same in all Linux distributions. + +### INSTALL GIT + +To install git run this command : + +``` +sudo apt-get install git-core +``` + +After it finishes downloading, you will have Git installed and ready to use. + +### SETUP GIT: + +After Git is installed, whether from apt-get or from the source, you need to copy your username and email in the gitconfig file. You can access this file at ~/.gitconfig. + +Opening it following a fresh Git install would reveal a completely blank page: + +``` +sudo vim ~/.gitconfig +``` + +You can use the follow commands to add in the required information. Replace ‘user’ with your username and ‘user@example.com’ with your email. + +``` +git config --global user.name "User" +git config --global user.email user@example.com +``` + +And you are done with setting up. Now let’s get started with Git. + +### REPOSITORY: + +Create a new directory, open it and run this command: + +``` +git init +``` + +![](http://itsfoss.com/wp-content/uploads/2016/05/Playing-around-git-1-1024x173.png) + +This will create a new git repository. Your local repository consists of three “trees” maintained by git. + +First one is your Working Directory which holds the actual files. Second one is the Index which acts as a staging area and finally the HEAD which points to the last commit you’ve made.checkout your repository using git clone /path/to/repository. + +Checkout your repository (repository you just created or an existing repository on a server) using git clone /path/to/repository. + +### ADD FILES AND COMMIT: + +You can propose changes using: + +``` +git add +``` + +This will add a new file for the commit. If you want to add every new file, then just do: + +``` +git add --all +``` + +Your files are added check your status using + +``` +git status +``` + +![](http://itsfoss.com/wp-content/uploads/2016/05/Playing-around-git-2-1024x219.png) + +As you can see, there are changes but they are not committed. Now you need to commit these changes, use: + +``` +git commit -m "Commit message" +``` + +![](http://itsfoss.com/wp-content/uploads/2016/05/playing-around-git-3-1024x124.png) + +You can also do (preferred): + +``` +git commit -a +``` + +And then write your commit message. Now the file is committed to the HEAD, but not in your remote repository yet. + +### PUSH YOUR CHANGES + +Your changes are in the HEAD of your local working copy. If you have not cloned an existing repository and want to connect your repository to a remote server, you need to add it first with: + +``` +git remote add origin +``` + +Now you are able to push your changes to the selected remote server.To send those changes to your remote repository, run: + +``` +git push -u origin master +``` + +### BRANCHING: + +Branches are used to develop features which are isolated from each other. The master branch is the “default” branch when you create a repository. Use other branches for development and merge them back to the master branch upon completion. + +Create a new branch named “mybranch” and switch to it using: + +``` +git checkout -b mybranch +``` + +![](http://itsfoss.com/wp-content/uploads/2016/05/Playing-around-Git-4--1024x145.jpg) + +You can switch back to master by running: + +``` +git checkout master +``` + +If you want to delete the branch use: + +``` +git branch -d mybranch +``` + +![](http://itsfoss.com/wp-content/uploads/2016/05/Playing-around-Git-5-1-1024x181.jpg) + +A branch is not available to others unless you push the branch to your remote repository, so what are you thinking about just push it: + +``` +git push origin +``` + +### UPDATE AND MERGE + +To update your local repository to the newest commit, run: + +``` +git pull +``` + +In your working directory to fetch and merge remote changes.To merge another branch into your active branch (e.g. master), use : + +``` +git merge +``` + +In both cases, git tries to auto-merge changes. Unfortunately, this is not always possible and results in conflicts. You are responsible for merging those conflicts manually by editing the files shown by git. After changing, you need to mark them as merged with + +``` +git add +``` + +Before merging changes, you can also preview them by using + +``` +git diff +``` + +### GIT LOG: + +You can see the repository history using. + +``` +git log +``` + +To see a log where each commit is one line you can use: + +``` +git log --pretty=oneline +``` + +Or maybe you want to see an ASCII art tree of all the branches, decorated with the names of tags and branches: + +``` +git log --graph --oneline --decorate --all +``` + +If you want to see only which files have changed: + +``` +git log --name-status +``` + +And for any help during the entire process, you can use git --help + +Isn’t Git is awesome!! Congratulation you are done with basics of git. If you like, you can download these basic Git commands as a quick reference guide from the link below: + +[Download Git Cheat Sheet][4] + + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/basic-git-commands-cheat-sheet/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 + +作者:[Rakhi Sharma][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/rakhi/ +[1]: http://itsfoss.com/download-vi-cheat-sheet/ +[2]: https://git-scm.com/ +[3]: https://en.wikipedia.org/wiki/Linus_Torvalds +[4]: https://drive.google.com/open?id=0By49_3Av9sT1bXpINjhvU29VNUU + From 52a76050c04141efff1a7c5f892b219d9ae4e2d0 Mon Sep 17 00:00:00 2001 From: VicYu Date: Tue, 7 Jun 2016 14:27:01 +0800 Subject: [PATCH 0874/1469] Pick up new one --- sources/tech/20160605 How to Add Cron Jobs in Linux and Unix.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160605 How to Add Cron Jobs in Linux and Unix.md b/sources/tech/20160605 How to Add Cron Jobs in Linux and Unix.md index 9f90a9cb45..4bef489ade 100644 --- a/sources/tech/20160605 How to Add Cron Jobs in Linux and Unix.md +++ b/sources/tech/20160605 How to Add Cron Jobs in Linux and Unix.md @@ -1,3 +1,5 @@ + Vic020 + How to Add Cron Jobs in Linux and Unix ====================================== From c29a8c8dc93ed00b04c82adeb54987ba1de53b69 Mon Sep 17 00:00:00 2001 From: alim0x Date: Tue, 7 Jun 2016 14:41:40 +0800 Subject: [PATCH 0875/1469] [translated]Will Google Replace Passwords With A New Trust-Based Authentication Method --- ...A New Trust-Based Authentication Method.md | 41 ------------------- ...A New Trust-Based Authentication Method.md | 38 +++++++++++++++++ 2 files changed, 38 insertions(+), 41 deletions(-) delete mode 100644 sources/talk/20160605 Will Google Replace Passwords With A New Trust-Based Authentication Method.md create mode 100644 translated/talk/20160605 Will Google Replace Passwords With A New Trust-Based Authentication Method.md diff --git a/sources/talk/20160605 Will Google Replace Passwords With A New Trust-Based Authentication Method.md b/sources/talk/20160605 Will Google Replace Passwords With A New Trust-Based Authentication Method.md deleted file mode 100644 index 66930943a1..0000000000 --- a/sources/talk/20160605 Will Google Replace Passwords With A New Trust-Based Authentication Method.md +++ /dev/null @@ -1,41 +0,0 @@ -alim0x translating - -Will Google Replace Passwords With A New Trust-Based Authentication Method? -=========================================================================== - -![](http://www.iwillfolo.com/wordpress/wp-content/uploads/2016/05/Trust-API-Google-replaces-passwords.jpg) - -A newly developed authentication method by Google will rate how trustworthy is your login and will authenticate it based on a “Trust Score”. - - -Abacus is the name of the Google project that aims to rid you off of the nuisance which is remembering and typing passwords. - -In latest Google I/O developer conference, the company has introduced a new feature stemming from the ambitious project, called “**Trust API**“. - -The API (Application Programming Interface) which will be available for Android developers by the year end “if all goes well”, is intended to make use of Android devices’ various types of sensors in order to profile a user and create what they refer to as Trust Score. - -Based on that Trust Score, an application which requires login credentials will be able to verify that indeed you are authorized to login and thus will not prompt for a password. - -![](http://www.iwillfolo.com/wordpress/wp-content/uploads/2016/05/Abacus-to-Trust-API.jpg) ->Abacus to Trust API - -### A Point To Consider - -Although the idea, functionality-wise, sounds pretty great – mitigating the burden which is password authentication. - -The other side of the coin tough, is that once again, by doing so Google pushes us (deliberately or not) to give up our privacy in favor of ease of use. - -Is it worth it? it’s up to you to decide… - - --------------------------------------------------------------------------------- - -via: http://www.iwillfolo.com/will-google-replace-passwords-with-a-new-trust-based-authentication-method/ - -作者:[iWillFolo][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://www.iwillfolo.com/ diff --git a/translated/talk/20160605 Will Google Replace Passwords With A New Trust-Based Authentication Method.md b/translated/talk/20160605 Will Google Replace Passwords With A New Trust-Based Authentication Method.md new file mode 100644 index 0000000000..7e0e85d688 --- /dev/null +++ b/translated/talk/20160605 Will Google Replace Passwords With A New Trust-Based Authentication Method.md @@ -0,0 +1,38 @@ +谷歌会用基于信任的认证措施取代密码吗? +=========================================================================== + +![](http://www.iwillfolo.com/wordpress/wp-content/uploads/2016/05/Trust-API-Google-replaces-passwords.jpg) + +一个谷歌新开发的认证措施会评估你的登录有多可靠,并且基于一个“信任分(Trust Score)”认证你的登录。 + +这个谷歌项目的名字是 Abacus,它的目标是让你摆脱讨厌的密码记忆和输入。 + +在最近的 Google I/O 开发者大会上,谷歌引入了自这个雄心勃勃的项目而来的新特性,称作“**Trust API**”。 + +“如果一切进展顺利”,这个 API(Application Programming Interface,应用程序编程接口)会在年底前供安卓开发者使用。API 会利用安卓设备上不同的传感器来识别用户,并创建一个他们称之为“信任分(Trust Score)”的结果。 + +基于这个信任分,一个需要登录认证的应用可以验证你确实可以授权登录,从而不会提示需要密码。 + +![](http://www.iwillfolo.com/wordpress/wp-content/uploads/2016/05/Abacus-to-Trust-API.jpg) +>Abacus 到 Trust API + +### 需要思考的地方 + +尽管这个想法,明智的功能,听起来很棒——减轻了密码认证的负担。 + +但从另一面来说,这是不是谷歌又一次逼迫我们(有意或无意)为了方便使用而放弃我们的隐私? + +是否值得?这取决于你的决定... + + +-------------------------------------------------------------------------------- + +via: http://www.iwillfolo.com/will-google-replace-passwords-with-a-new-trust-based-authentication-method/ + +作者:[iWillFolo][a] +译者:[alim0x](https://github.com/alim0x) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.iwillfolo.com/ From 9bc20788666eedf45ee45e659e40de823fe806da Mon Sep 17 00:00:00 2001 From: alim0x Date: Tue, 7 Jun 2016 16:51:39 +0800 Subject: [PATCH 0876/1469] [translating]Basic Git Commands You Must Know --- sources/tech/20160606 Basic Git Commands You Must Know.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20160606 Basic Git Commands You Must Know.md b/sources/tech/20160606 Basic Git Commands You Must Know.md index 336bf518a8..6eea21b731 100644 --- a/sources/tech/20160606 Basic Git Commands You Must Know.md +++ b/sources/tech/20160606 Basic Git Commands You Must Know.md @@ -1,3 +1,5 @@ +alim0x translating + Basic Git Commands You Must Know ===================================== @@ -216,4 +218,3 @@ via: http://itsfoss.com/basic-git-commands-cheat-sheet/?utm_source=feedburner&ut [2]: https://git-scm.com/ [3]: https://en.wikipedia.org/wiki/Linus_Torvalds [4]: https://drive.google.com/open?id=0By49_3Av9sT1bXpINjhvU29VNUU - From 9aad0a6b7162cf06bc1b03375676d5d0a031e1e2 Mon Sep 17 00:00:00 2001 From: alim0x Date: Tue, 7 Jun 2016 18:58:52 +0800 Subject: [PATCH 0877/1469] [translated]Basic Git Commands You Must Know --- ...160606 Basic Git Commands You Must Know.md | 220 ------------------ ...160606 Basic Git Commands You Must Know.md | 218 +++++++++++++++++ 2 files changed, 218 insertions(+), 220 deletions(-) delete mode 100644 sources/tech/20160606 Basic Git Commands You Must Know.md create mode 100644 translated/tech/20160606 Basic Git Commands You Must Know.md diff --git a/sources/tech/20160606 Basic Git Commands You Must Know.md b/sources/tech/20160606 Basic Git Commands You Must Know.md deleted file mode 100644 index 6eea21b731..0000000000 --- a/sources/tech/20160606 Basic Git Commands You Must Know.md +++ /dev/null @@ -1,220 +0,0 @@ -alim0x translating - -Basic Git Commands You Must Know -===================================== - -![](http://itsfoss.com/wp-content/uploads/2016/06/Download-Git-Sheet.jpg) - -*Brief: This quick guide shows you all the basic Git commands and their usage. You can download these commands for quick reference.* - -We have seen the quick guide and [Vi cheat sheet download][1] in an earlier post. In this article, we’ll see all the basic Git commands you need to get started with it. - -### GIT - -[Git][2] is a distributed version control system that is widely used by a number of open source projects. It was started in the year 2005 by Linux founder, [Linus Torvalds][3]. The program allows for a non-linear development of projects, and can handle large amounts of data effectively by storing it on the local server. In this tutorial, we are going to play around Git and learn how to get started with it. - -I am using Ubuntu in this tutorial but you can use any Linux distribution of your choice. Apart from installation, rest all commands are the same in all Linux distributions. - -### INSTALL GIT - -To install git run this command : - -``` -sudo apt-get install git-core -``` - -After it finishes downloading, you will have Git installed and ready to use. - -### SETUP GIT: - -After Git is installed, whether from apt-get or from the source, you need to copy your username and email in the gitconfig file. You can access this file at ~/.gitconfig. - -Opening it following a fresh Git install would reveal a completely blank page: - -``` -sudo vim ~/.gitconfig -``` - -You can use the follow commands to add in the required information. Replace ‘user’ with your username and ‘user@example.com’ with your email. - -``` -git config --global user.name "User" -git config --global user.email user@example.com -``` - -And you are done with setting up. Now let’s get started with Git. - -### REPOSITORY: - -Create a new directory, open it and run this command: - -``` -git init -``` - -![](http://itsfoss.com/wp-content/uploads/2016/05/Playing-around-git-1-1024x173.png) - -This will create a new git repository. Your local repository consists of three “trees” maintained by git. - -First one is your Working Directory which holds the actual files. Second one is the Index which acts as a staging area and finally the HEAD which points to the last commit you’ve made.checkout your repository using git clone /path/to/repository. - -Checkout your repository (repository you just created or an existing repository on a server) using git clone /path/to/repository. - -### ADD FILES AND COMMIT: - -You can propose changes using: - -``` -git add -``` - -This will add a new file for the commit. If you want to add every new file, then just do: - -``` -git add --all -``` - -Your files are added check your status using - -``` -git status -``` - -![](http://itsfoss.com/wp-content/uploads/2016/05/Playing-around-git-2-1024x219.png) - -As you can see, there are changes but they are not committed. Now you need to commit these changes, use: - -``` -git commit -m "Commit message" -``` - -![](http://itsfoss.com/wp-content/uploads/2016/05/playing-around-git-3-1024x124.png) - -You can also do (preferred): - -``` -git commit -a -``` - -And then write your commit message. Now the file is committed to the HEAD, but not in your remote repository yet. - -### PUSH YOUR CHANGES - -Your changes are in the HEAD of your local working copy. If you have not cloned an existing repository and want to connect your repository to a remote server, you need to add it first with: - -``` -git remote add origin -``` - -Now you are able to push your changes to the selected remote server.To send those changes to your remote repository, run: - -``` -git push -u origin master -``` - -### BRANCHING: - -Branches are used to develop features which are isolated from each other. The master branch is the “default” branch when you create a repository. Use other branches for development and merge them back to the master branch upon completion. - -Create a new branch named “mybranch” and switch to it using: - -``` -git checkout -b mybranch -``` - -![](http://itsfoss.com/wp-content/uploads/2016/05/Playing-around-Git-4--1024x145.jpg) - -You can switch back to master by running: - -``` -git checkout master -``` - -If you want to delete the branch use: - -``` -git branch -d mybranch -``` - -![](http://itsfoss.com/wp-content/uploads/2016/05/Playing-around-Git-5-1-1024x181.jpg) - -A branch is not available to others unless you push the branch to your remote repository, so what are you thinking about just push it: - -``` -git push origin -``` - -### UPDATE AND MERGE - -To update your local repository to the newest commit, run: - -``` -git pull -``` - -In your working directory to fetch and merge remote changes.To merge another branch into your active branch (e.g. master), use : - -``` -git merge -``` - -In both cases, git tries to auto-merge changes. Unfortunately, this is not always possible and results in conflicts. You are responsible for merging those conflicts manually by editing the files shown by git. After changing, you need to mark them as merged with - -``` -git add -``` - -Before merging changes, you can also preview them by using - -``` -git diff -``` - -### GIT LOG: - -You can see the repository history using. - -``` -git log -``` - -To see a log where each commit is one line you can use: - -``` -git log --pretty=oneline -``` - -Or maybe you want to see an ASCII art tree of all the branches, decorated with the names of tags and branches: - -``` -git log --graph --oneline --decorate --all -``` - -If you want to see only which files have changed: - -``` -git log --name-status -``` - -And for any help during the entire process, you can use git --help - -Isn’t Git is awesome!! Congratulation you are done with basics of git. If you like, you can download these basic Git commands as a quick reference guide from the link below: - -[Download Git Cheat Sheet][4] - - --------------------------------------------------------------------------------- - -via: http://itsfoss.com/basic-git-commands-cheat-sheet/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 - -作者:[Rakhi Sharma][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/rakhi/ -[1]: http://itsfoss.com/download-vi-cheat-sheet/ -[2]: https://git-scm.com/ -[3]: https://en.wikipedia.org/wiki/Linus_Torvalds -[4]: https://drive.google.com/open?id=0By49_3Av9sT1bXpINjhvU29VNUU diff --git a/translated/tech/20160606 Basic Git Commands You Must Know.md b/translated/tech/20160606 Basic Git Commands You Must Know.md new file mode 100644 index 0000000000..dbaf78ad95 --- /dev/null +++ b/translated/tech/20160606 Basic Git Commands You Must Know.md @@ -0,0 +1,218 @@ +你应该知道的基础 Git 命令 +===================================== + +![](http://itsfoss.com/wp-content/uploads/2016/06/Download-Git-Sheet.jpg) + +*简介:这个快速指南将向你展示所有的基础 Git 命令以及用法。你可以下载这些命令作为快速参考。* + +我们在早先一篇文章中已经见过快速指南和 [Vi cheat sheet 下载][1]了。在这篇文章里,我们将会看到开始使用 Git 所需要的基础命令。 + +### GIT + +[Git][2] 是一个分布式版本控制系统,它被用在大量开源项目中。它是在 2005 年由 Linux 创始人 [Linus Torvalds][3] 写就的。这个程序允许非线性的项目开发,并且能够通过存储在本地服务器高效处理大量数据。在这个教程里,我们将要和 Git 愉快玩耍并学习如何开始使用它。 + +我在这个教程里使用 Ubuntu,但你可以使用你选择的任何发行版。除了安装以外,剩下的所有命令在任何 Linux 发行版上都是一样的。 + +### 安装 GIT + +要安装 git 执行以下命令: + +``` +sudo apt-get install git-core +``` + +在它完成下载之后,你就安装好了 Git 并且可以使用了。 + +### 设置 GIT: + +在 Git 安装之后,不论是从 apt-get 还是从源码安装,你需要将你的用户名和邮箱地址复制到 gitconfig 文件。你可以访问 ~/.gitconfig 这个文件。 + +全新安装 Git 之后打开它会是完全空白的页面: + +``` +sudo vim ~/.gitconfig +``` + +你也可以使用以下命令添加所需的信息。将‘user’替换成你的用户名,‘user@example.com’替换成你的邮箱。 + +``` +git config --global user.name "User" +git config --global user.email user@example.com +``` + +然后你就完成设置了。现在让我们开始 Git。 + +### 仓库: + +创建一个新目录,打开它并运行以下命令: + +``` +git init +``` + +![](http://itsfoss.com/wp-content/uploads/2016/05/Playing-around-git-1-1024x173.png) + +这个命令会创建一个新的 git 仓库。你的本地仓库由三个 git 维护的“树”组成。 + +第一个是你的**工作目录**,保存实际的文件。第二个是索引,实际上扮演的是暂存区,最后一个是 HEAD,它指向你最后一个 commit 提交。 + +使用 git clone /path/to/repository 签出你的仓库(从你刚创建的仓库或服务器上已存在的仓库)。 + +### 添加文件并提交: + +你可以用以下命令添加改动: + +``` +git add +``` + +这会添加一个新文件到暂存区以提交。如果你想添加每个新文件,输入: + +``` +git add --all +``` + +添加文件之后可以使用以下命令检查状态: + +``` +git status +``` + +![](http://itsfoss.com/wp-content/uploads/2016/05/Playing-around-git-2-1024x219.png) + +正如你看到的,那里已经有一些变化但还没有提交。现在你需要提交这些变化,使用: + +``` +git commit -m "提交信息" +``` + +![](http://itsfoss.com/wp-content/uploads/2016/05/playing-around-git-3-1024x124.png) + +你也可以这么做(首选): + +``` +git commit -a +``` + +然后写下你的提交信息。现在你的文件提交到了 HEAD,但还不在你的远程仓库中。 + +### 推送你的改动 + +你的改动在你本地工作副本的 HEAD 中。如果你还没有从一个已存在的仓库克隆或想将你的仓库连接到远程服务器,你需要先添加它: + +``` +git remote add origin <服务器地址> +``` + +现在你可以将改动推送到指定的远程服务器。要将改动发送到远程服务器,运行: + +``` +git push -u origin master +``` + +### 分支: + +分支用于开发特性,它们之间是互相独立的。主分支 master 是你创建一个仓库时的“默认”分支。使用其它分支用于开发,在完成时将它合并回主分支。 + +创建一个名为“mybranch”的分支并切换到它之上: + +``` +git checkout -b mybranch +``` + +![](http://itsfoss.com/wp-content/uploads/2016/05/Playing-around-Git-4--1024x145.jpg) + +你可以使用这个命令切换回主分支: + +``` +git checkout master +``` + +如果你想删除这个分支,执行: + +``` +git branch -d mybranch +``` + +![](http://itsfoss.com/wp-content/uploads/2016/05/Playing-around-Git-5-1-1024x181.jpg) + +除非你将分支推送到远程服务器上,否则该分支对其他人是不可用的,所以只需把它推送上去: + +``` +git push origin <分支名> +``` + +### 更新和合并 + +要将你本地仓库更新到最新提交,运行: + +``` +git pull +``` + +在你的工作目录获取和合并远程变动。要合并其它分支到你的活动分支(如 master),使用: + +``` +git merge <分支> +``` + +在这两种情况下,git 会尝试自动合并(auto-merge)改动。不幸的是,这不总是可能的,可能会导致冲突。你需要负责通过编辑 git 显示的文件,手动合并那些冲突。改动之后,你需要用以下命令将它们标记为已合并: + +``` +git add <文件名> +``` + +在合并改动之前,你也可以使用以下命令预览: + +``` +git diff <源分支> <目标分支> +``` + +### GIT 日志: + +你可以这么查看仓库历史: + +``` +git log +``` + +要查看每个提交一行样式的日志你可以用: + +``` +git log --pretty=oneline +``` + +或者也许你想要看一个所有分支的 ASCII 艺术树,带有标签和分支名: + +``` +git log --graph --oneline --decorate --all +``` + +如果你只想看哪些文件改动过: + +``` +git log --name-status +``` + +在这整个过程中如果你需要任何帮助,你可以用 git --help。 + +Git 棒不棒!!!祝贺你你已经会 git 基础了。如果你愿意的话,你可以从下面这个链接下载这些基础 Git 命令作为快速参考: + +[下载 Git Cheat Sheet][4] + + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/basic-git-commands-cheat-sheet/ + +作者:[Rakhi Sharma][a] +译者:[alim0x](https://github.com/alim0x) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://itsfoss.com/author/rakhi/ +[1]: http://itsfoss.com/download-vi-cheat-sheet/ +[2]: https://git-scm.com/ +[3]: https://en.wikipedia.org/wiki/Linus_Torvalds +[4]: https://drive.google.com/open?id=0By49_3Av9sT1bXpINjhvU29VNUU From ed6d0fc1fe6c84a62e17dc3489d02f58020f8a66 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 8 Jun 2016 08:59:36 +0800 Subject: [PATCH 0878/1469] PUB:20160217 How to Enable Multiple PHP-FPM Instances with Nginx or Apache @GOLinux --- ... PHP-FPM Instances with Nginx or Apache.md | 121 ++++++++++++++++++ ... PHP-FPM Instances with Nginx or Apache.md | 119 ----------------- 2 files changed, 121 insertions(+), 119 deletions(-) create mode 100644 published/20160217 How to Enable Multiple PHP-FPM Instances with Nginx or Apache.md delete mode 100644 translated/tech/20160217 How to Enable Multiple PHP-FPM Instances with Nginx or Apache.md diff --git a/published/20160217 How to Enable Multiple PHP-FPM Instances with Nginx or Apache.md b/published/20160217 How to Enable Multiple PHP-FPM Instances with Nginx or Apache.md new file mode 100644 index 0000000000..c9809b68e1 --- /dev/null +++ b/published/20160217 How to Enable Multiple PHP-FPM Instances with Nginx or Apache.md @@ -0,0 +1,121 @@ +如何启用 Nginx/Apache 的 PHP-FPM 多实例 +================================================================================ + +PHP-FPM 作为 FastCGI 进程管理器而广为熟知,它是 PHP FastCGI 实现的改进,带有更为有用的功能,用于处理高负载的服务器和网站。下面列出其中一些功能: + +### 新功能 ### + + - 拥有具有优雅(graceful)启动/停止选项的高级进程管理能力。 + - 可以通过不同的用户身份/组身份来以监听多个端口以及使用多个PHP配置。 + - 错误日志记录。 + - 支持上传加速。 + - 特别用于在处理一些耗时任务时结束请求和清空所有数据的功能。 + - 同时支持动态和静态的子进程重生。 + - 支持IP地址限制。 + +在本文中,我将要讨论的是,在运行 CPanel 11.52 及 EA3 (EasyApache)的 CentOS 7 服务器上,于 Nginx 和 Apache 之上安装 PHP-FPM,以及如何来通过 CPanel 管理这些安装好的多个 PHP-FPM 实例。 + +在我们开始安装前, 先看看安装的先决条件。 + +### 先决条件 ### + + 1. 启用 Mod_proxy_fcgi 模块 + 2. 启用 MPM_Event + +由于我们要将 PHP-FPM 安装到一台 EA3 服务器,我们需要运行 EasyApache 来编译 Apache 以启用这些模块。 + +你们可以参考我以前写的,关于如何在 Apache 服务器上安装 Nginx 作为反向代理的文档来了解 Nginx 的安装。 + +这里,我将再次简述那些安装步骤。具体细节,你可以参考我之前写的**(如何在 CentOS 7/CPanel 服务器上配置 Nginx 反向代理)**一文。 + +- 步骤 1:安装 Epel 仓库 +- 步骤 2:安装 nDeploy RPM 仓库,这是此次安装中最为**重要**的步骤。 +- 步骤 3:使用 yum 从 nDeploy 仓库安装 nDeploy 和 Nginx 插件。 +- 步骤 4:启用/配置 Nginx 为反向代理。 + +完成这些步骤后,下面为服务器中所有可用 PHP 版本安装 PHP-FPM 包,EA3 使用 remi 仓库来安装这些包。你可以运行这个 nDeploy 脚本来下载所有的包。 + + root@server1 [~]# /opt/nDeploy/scripts/easy_php_setup.sh + Loaded plugins: fastestmirror, tsflags, universal-hooks + EA4 | 2.9 kB 00:00:00 + base | 3.6 kB 00:00:00 + epel/x86_64/metalink | 9.7 kB 00:00:00 + epel | 4.3 kB 00:00:00 + extras | 3.4 kB 00:00:00 + updates | 3.4 kB 00:00:00 + (1/2): epel/x86_64/updateinfo | 460 kB 00:00:00 + (2/2): epel/x86_64/primary_db + +运行该脚本将为 PHP 54,PHP 55,PHP 56 和 PHP 70 安装所有这些 FPM 包。 + + Installed Packages + php54-php-fpm.x86_64 5.4.45-3.el7.remi @remi + php55-php-fpm.x86_64 5.5.31-1.el7.remi @remi + php56-php-fpm.x86_64 5.6.17-1.el7.remi @remi + php70-php-fpm.x86_64 7.0.2-1.el7.remi @remi + +在以上安装完成后,你需要为 Apache 启用 PHP-FPM SAPI。你可以运行下面这个脚本来启用 PHP-FPM 实例。 + + root@server1 [~]# /opt/nDeploy/scripts/apache_php-fpm_setup.sh enable + mod_proxy_fcgi.c + Please choose one default PHP version from the list below + PHP70 + PHP56 + PHP54 + PHP55 + Provide the exact desired version string here and press ENTER: PHP54 + ConfGen:: lxblogger + ConfGen:: blogr + ConfGen:: saheetha + ConfGen:: satest + which: no cagefsctl in (/usr/local/jdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/root/bin) + info [rebuildhttpdconf] Missing owner for domain server1.centos7-test.com, force lookup to root + Built /usr/local/apache/conf/httpd.conf OK + Waiting for “httpd” to restart gracefully …waiting for “httpd” to initialize …… + …finished. + +它会问你需要运行哪个 PHP 版本作为服务器默认版本,你可以输入那些细节内容,然后继续配置并为现存的域名生成虚拟主机文件。 + +我选择了 PHP 54 作为我服务器上的默认 PHP-FPM 版本。 + +![confirm-php-fpm](http://blog.linoxide.com/wp-content/uploads/2016/01/confirm-php-fpm-1024x525.png) + +虽然服务器配置了 PHP-FPM 54,但是我们可以通过 CPanel 为各个独立的域名修改 PHP-FPM 实例。 + +下面我将通过一些截图来为你们说明一下,怎样通过 CPanel 为各个独立域修改 PHP-FPM 实例。 + +安装了 Nginx 插件后,你的域名的 CPanel 就会有一个 Nginx Webstack 图标,你可以点击该图标来配置你的 Web 服务器。我已经登录进了我其中的一个 CPanel 来配置相应的 Web 服务器。 + +请看这些截图。 + +![nginx webstack](http://blog.linoxide.com/wp-content/uploads/2016/01/nginx-webstack.png) + +![nginxicon1](http://blog.linoxide.com/wp-content/uploads/2016/01/nginxicon1-1024x253.png) + +现在,你可以根据需要为选中的主域配置 web 服务器(这里,我已经选择了主域 saheetha.com)。我已经继续通过自动化配置选项来进行了,因为我不需要添加任何手动设置。 + +![nginx_auto_proxy](http://blog.linoxide.com/wp-content/uploads/2016/01/nginx_auto_proxy-1024x408.png) + +当 Nginx 配置完后,你可以在这里为你的域名选择 PHP-FPM 实例。 + +![php-fpm1](http://blog.linoxide.com/wp-content/uploads/2016/01/php-fpm1-1024x408.png) + +![php54](http://blog.linoxide.com/wp-content/uploads/2016/01/php54-1024x169.png) + +![php55](http://blog.linoxide.com/wp-content/uploads/2016/01/php55.png) + +就像你在截图中所看到的,我服务器上的默认 PHP-FPM 是**PHP 54**,而我正要将我的域名的 PHP-FPM 实例单独修改成 **PHP 55**。当你为你的域修改 PHP-FPM 后,你可以通过访问 **phpinfo** 页面来确认。 + +谢谢你们参考本文,我相信这篇文章会给你提供不少信息和帮助。我会为你们推荐关于这个内容的有价值的评论 :)。 + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/enable-multiple-php-fpm-instances-nginx-apache/ + +作者:[Saheetha Shameer][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/saheethas/ diff --git a/translated/tech/20160217 How to Enable Multiple PHP-FPM Instances with Nginx or Apache.md b/translated/tech/20160217 How to Enable Multiple PHP-FPM Instances with Nginx or Apache.md deleted file mode 100644 index befa31312f..0000000000 --- a/translated/tech/20160217 How to Enable Multiple PHP-FPM Instances with Nginx or Apache.md +++ /dev/null @@ -1,119 +0,0 @@ -启用Nginx/Apache的PHP-FPM多实例 -================================================================================ - -PHP-FPM作为FastCGI进程管理器而广为熟知,它是PHP FastCGI实现的改进,带有更为有用的功能,用于处理高负载的服务器和网站。下面列出其中一些功能: -### 新功能 ### - - - 拥有具有优雅启动/停止选项的高级进程管理能力。 - - 可以以监听不同端口以及使用不同PHP配置的不同用户身份/组身份来运行进程。 - - 错误日志记录。 - - 支持上传加速。 - - 用于在处理一些耗时任务时结束请求和清空所有数据的特别功能。 - - 同时支持动态和静态子进程重生。 - - 支持IP地址限制。 - -在本文中,我将要讨论的是,在运行EA3下CPanel 11.52的CentOS 7服务器上与Nginx和Apache一起安装PHP-FPM,以及如何来通过CPanel管理这些安装好的多个PHP-FPM实例。 -Before going to the installation procedures, let us take a look on the pre-requisites. - -### 先决条件 ### - - 1. 启用 Mod_proxy_fcgi模块 - 2. 启用 MPM_Event - -由于我们要将PHP-FPM安装到一台EA3服务器,我们需要运行EasyApache来编译Apache以启用这些模块。 - -你们可以参考我以前写的,关于如何在Apache服务器上安装Nginx作为反向代理的文档来确认Nginx的安装。 - -这里,我将再次简述那些安装步骤。具体细节,你可以参考我之前写的**(如何在CentOS 7/CPanel服务器上配置Nginx反向代理)**一文。 - - 步骤 1:安装Epel仓库 - 步骤 2:安装nDeploy RPM仓库,这是此次安装中最为**重要**的步骤。 - 步骤 3:使用yum从nDeploy仓库安装nDeploy和Nginx插件。 - 步骤 4:启用/配置Nginx为反向代理。 - -完成这些步骤后,下面为服务器中所有可用PHP版本安装PHP-FPM包,EA3使用remi仓库来安装这些包。你可以运行这个nDeploy脚本来下载所有的包。 - - root@server1 [~]# /opt/nDeploy/scripts/easy_php_setup.sh - Loaded plugins: fastestmirror, tsflags, universal-hooks - EA4 | 2.9 kB 00:00:00 - base | 3.6 kB 00:00:00 - epel/x86_64/metalink | 9.7 kB 00:00:00 - epel | 4.3 kB 00:00:00 - extras | 3.4 kB 00:00:00 - updates | 3.4 kB 00:00:00 - (1/2): epel/x86_64/updateinfo | 460 kB 00:00:00 - (2/2): epel/x86_64/primary_db - -运行该脚本将为PHP 54,PHP 55,PHP 56和PHP 70安装所有这些FPM包。 - - Installed Packages - php54-php-fpm.x86_64 5.4.45-3.el7.remi @remi - php55-php-fpm.x86_64 5.5.31-1.el7.remi @remi - php56-php-fpm.x86_64 5.6.17-1.el7.remi @remi - php70-php-fpm.x86_64 7.0.2-1.el7.remi @remi - -在以上安装完成后,你需要为Apache启用PHP-FPM SAPI。你可以运行下面这个脚本来启用PHP-FPM实例。 - - root@server1 [~]# /opt/nDeploy/scripts/apache_php-fpm_setup.sh enable - mod_proxy_fcgi.c - Please choose one default PHP version from the list below - PHP70 - PHP56 - PHP54 - PHP55 - Provide the exact desired version string here and press ENTER: PHP54 - ConfGen:: lxblogger - ConfGen:: blogr - ConfGen:: saheetha - ConfGen:: satest - which: no cagefsctl in (/usr/local/jdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/root/bin) - info [rebuildhttpdconf] Missing owner for domain server1.centos7-test.com, force lookup to root - Built /usr/local/apache/conf/httpd.conf OK - Waiting for “httpd” to restart gracefully …waiting for “httpd” to initialize …… - …finished. - -它会问你需要运行哪个PHP版本作为服务器默认版本,你可以输入那些细节内容,然后继续配置并为现存的域生成虚拟主机文件。 - -我选择了PHP 54作为我服务器上的默认PHP-FPM版本。 - -![confirm-php-fpm](http://blog.linoxide.com/wp-content/uploads/2016/01/confirm-php-fpm-1024x525.png) - -虽然服务器配置了PHP-FPM 54,但是我们可以通过CPanel为各个独立的域修改PHP-FPM实例。 - -下面我将通过一些截图来为你们说明一下,怎样通过CPanel为各个独立域修改PHP-FPM实例。 - -Nginx插件的安装将为你的域的CPanel提供一个Nginx Webstack图标,你可以点击该图标来配置你的Web服务器。我已经登陆进了我其中的一个CPanel来配置相应的Web服务器。 - -请看这些截图。 - -![nginx webstack](http://blog.linoxide.com/wp-content/uploads/2016/01/nginx-webstack.png) - -![nginxicon1](http://blog.linoxide.com/wp-content/uploads/2016/01/nginxicon1-1024x253.png) - -现在,你可以根据需要为选中的主域配置web服务器(这里,我已经选择了主域saheetha.com)。我已经继续通过自动化配置选项来进行了,因为我不需要添加任何手动设置。 - -![nginx_auto_proxy](http://blog.linoxide.com/wp-content/uploads/2016/01/nginx_auto_proxy-1024x408.png) - -当Nginx配置完后,你可以在这里为你的域选择PHP-FPM实例。 - -![php-fpm1](http://blog.linoxide.com/wp-content/uploads/2016/01/php-fpm1-1024x408.png) - -![php54](http://blog.linoxide.com/wp-content/uploads/2016/01/php54-1024x169.png) - -![php55](http://blog.linoxide.com/wp-content/uploads/2016/01/php55.png) - -就像你在截图中所看到的,我服务器上的默认PHP-FPM是**PHP 54**,而我正要将我的域的PHP-FPM实例单独修改成**PHP 55**。当你为你的域修改PHP-FPM后,你可以通过访问**phpinfo**页面来确认。 - -谢谢你们参考本文,我相信这篇文章会给你提供不少信息和帮助。我会为你们推荐关于这个内容的有价值的评论 :)。 - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/enable-multiple-php-fpm-instances-nginx-apache/ - -作者:[Saheetha Shameer][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/saheethas/ From 3d6ed46e76ceda16bd8aeaa480be468e28233443 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 8 Jun 2016 10:20:49 +0800 Subject: [PATCH 0879/1469] PUB:20151210 Getting started with Docker by Dockerizing this Blog.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @su-kaiyao 翻译的不错~ --- ...with Docker by Dockerizing this Blog.md.md | 464 ++++++++++++++++++ ...with Docker by Dockerizing this Blog.md.md | 464 ------------------ 2 files changed, 464 insertions(+), 464 deletions(-) create mode 100644 published/20151210 Getting started with Docker by Dockerizing this Blog.md.md delete mode 100644 translated/tech/20151210 Getting started with Docker by Dockerizing this Blog.md.md diff --git a/published/20151210 Getting started with Docker by Dockerizing this Blog.md.md b/published/20151210 Getting started with Docker by Dockerizing this Blog.md.md new file mode 100644 index 0000000000..7dd950d4a9 --- /dev/null +++ b/published/20151210 Getting started with Docker by Dockerizing this Blog.md.md @@ -0,0 +1,464 @@ +通过 Docker 化一个博客网站来开启我们的 Docker 之旅 +=== + +![](http://bencane.com/static/img/post-bg.jpg) + +> 这篇文章包含 Docker 的基本概念,以及如何通过创建一个定制的 Dockerfile 来 Docker 化(Dockerize)一个应用。 + +Docker 是一个过去两年来从某个 idea 中孕育而生的有趣技术,公司组织们用它在世界上每个角落来部署应用。在今天的文章中,我将讲述如何通过“Docker 化(Dockerize)”一个现有的应用,来开始我们的 Docker 之旅。这里提到的应用指的就是这个博客! + +## 什么是 Docker? + +当我们开始学习 Docker 基本概念时,让我们先去搞清楚什么是 Docker 以及它为什么这么流行。Docker 是一个操作系统容器管理工具,它通过将应用打包在操作系统容器中,来方便我们管理和部署应用。 + +### 容器 vs. 虚拟机 + +容器和虚拟机并不完全相似,它是另外一种提供**操作系统虚拟化**的方式。它和标准的虚拟机还是有所不同。 + +标准的虚拟机一般会包括一个完整的操作系统、操作系统软件包、最后还有一至两个应用。这都得益于为虚拟机提供硬件虚拟化的管理程序。这样一来,一个单一的服务器就可以将许多独立的操作系统作为虚拟客户机运行了。 + +容器和虚拟机很相似,它们都支持在单一的服务器上运行多个操作环境,只是,在容器中,这些环境并不是一个个完整的操作系统。容器一般只包含必要的操作系统软件包和一些应用。它们通常不会包含一个完整的操作系统或者硬件的虚拟化。这也意味着容器比传统的虚拟机开销更少。 + +容器和虚拟机常被误认为是两种对立的技术。虚拟机采用一个物理服务器来提供全功能的操作环境,该环境会和其余虚拟机一起共享这些物理资源。容器一般用来隔离一个单一主机上运行的应用进程,以保证隔离后的进程之间不能相互影响。事实上,容器和 **BSD Jails** 以及 `chroot` 进程的相似度,超过了和完整虚拟机的相似度。 + +### Docker 在容器之上提供了什么 + +Docker 本身不是一个容器运行环境,事实上,只是一个与具体实现无关的容器技术,Docker 正在努力支持 [Solaris Zones](https://blog.docker.com/2015/08/docker-oracle-solaris-zones/) 和 [BSD Jails](https://wiki.freebsd.org/Docker)。Docker 提供了一种管理、打包和部署容器的方式。虽然一定程度上,虚拟机多多少少拥有这些类似的功能,但虚拟机并没有完整拥有绝大多数的容器功能,即使拥有,这些功能用起来都并没有 Docker 来的方便或那么完整。 + +现在,我们应该知道 Docker 是什么了,然后,我们将从安装 Docker,并部署一个公开的预构建好的容器开始,学习 Docker 是如何工作的。 + +## 从安装开始 + +默认情况下,Docker 并不会自动被安装在您的计算机中,所以,第一步就是安装 Docker 软件包;我们的教学机器系统是 Ubuntu 14.0.4,所以,我们将使用 Apt 软件包管理器,来执行安装操作。 + +``` +# apt-get install docker.io +Reading package lists... Done +Building dependency tree +Reading state information... Done +The following extra packages will be installed: + aufs-tools cgroup-lite git git-man liberror-perl +Suggested packages: + btrfs-tools debootstrap lxc rinse git-daemon-run git-daemon-sysvinit git-doc + git-el git-email git-gui gitk gitweb git-arch git-bzr git-cvs git-mediawiki + git-svn +The following NEW packages will be installed: + aufs-tools cgroup-lite docker.io git git-man liberror-perl +0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded. +Need to get 7,553 kB of archives. +After this operation, 46.6 MB of additional disk space will be used. +Do you want to continue? [Y/n] y +``` + +为了检查当前是否有容器运行,我们可以执行`docker`命令,加上`ps`选项 + +``` +# docker ps +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +``` + +`docker`命令中的`ps`功能类似于 Linux 的`ps`命令。它将显示可找到的 Docker 容器及其状态。由于我们并没有启动任何 Docker 容器,所以命令没有显示任何正在运行的容器。 + +## 部署一个预构建好的 nginx Docker 容器 + +我比较喜欢的 Docker 特性之一就是 Docker 部署预先构建好的容器的方式,就像`yum`和`apt-get`部署包一样。为了更好地解释,我们来部署一个运行着 nginx web 服务器的预构建容器。我们可以继续使用`docker`命令,这次选择`run`选项。 + +``` +# docker run -d nginx +Unable to find image 'nginx' locally +Pulling repository nginx +5c82215b03d1: Download complete +e2a4fb18da48: Download complete +58016a5acc80: Download complete +657abfa43d82: Download complete +dcb2fe003d16: Download complete +c79a417d7c6f: Download complete +abb90243122c: Download complete +d6137c9e2964: Download complete +85e566ddc7ef: Download complete +69f100eb42b5: Download complete +cd720b803060: Download complete +7cc81e9a118a: Download complete +``` + +`docker`命令的`run`选项,用来通知 Docker 去寻找一个指定的 Docker 镜像,然后启动运行着该镜像的容器。默认情况下,Docker 容器运行在前台,这意味着当你运行`docker run`命令的时候,你的 shell 会被绑定到容器的控制台以及运行在容器中的进程。为了能在后台运行该 Docker 容器,我们使用了`-d` (**detach**)标志。 + +再次运行`docker ps`命令,可以看到 nginx 容器正在运行。 + +``` +# docker ps +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +f6d31ab01fc9 nginx:latest nginx -g 'daemon off 4 seconds ago Up 3 seconds 443/tcp, 80/tcp desperate_lalande +``` + +从上面的输出信息中,我们可以看到正在运行的名为`desperate_lalande`的容器,它是由`nginx:latest image`(LCTT 译注: nginx 最新版本的镜像)构建而来得。 + +### Docker 镜像 + +镜像是 Docker 的核心特征之一,类似于虚拟机镜像。和虚拟机镜像一样,Docker 镜像是一个被保存并打包的容器。当然,Docker 不只是创建镜像,它还可以通过 Docker 仓库发布这些镜像,Docker 仓库和软件包仓库的概念差不多,它让 Docker 能够模仿`yum`部署软件包的方式来部署镜像。为了更好地理解这是怎么工作的,我们来回顾`docker run`执行后的输出。 + +``` +# docker run -d nginx +Unable to find image 'nginx' locally +``` + +我们可以看到第一条信息是,Docker 不能在本地找到名叫 nginx 的镜像。这是因为当我们执行`docker run`命令时,告诉 Docker 运行一个基于 nginx 镜像的容器。既然 Docker 要启动一个基于特定镜像的容器,那么 Docker 首先需要找到那个指定镜像。在检查远程仓库之前,Docker 首先检查本地是否存在指定名称的本地镜像。 + +因为系统是崭新的,不存在 nginx 镜像,Docker 将选择从 Docker 仓库下载之。 + +``` +Pulling repository nginx +5c82215b03d1: Download complete +e2a4fb18da48: Download complete +58016a5acc80: Download complete +657abfa43d82: Download complete +dcb2fe003d16: Download complete +c79a417d7c6f: Download complete +abb90243122c: Download complete +d6137c9e2964: Download complete +85e566ddc7ef: Download complete +69f100eb42b5: Download complete +cd720b803060: Download complete +7cc81e9a118a: Download complete +``` + +这就是第二部分输出信息显示给我们的内容。默认情况下,Docker 会使用 [Docker Hub](https://hub.docker.com/) 仓库,该仓库由 Docker 公司维护。 + +和 Github 一样,在 Docker Hub 创建公共仓库是免费的,私人仓库就需要缴纳费用了。当然,部署你自己的 Docker 仓库也是可以的,事实上只需要简单地运行`docker run registry`命令就行了。但在这篇文章中,我们的重点将不是讲解如何部署一个定制的注册服务。 + +### 关闭并移除容器 + +在我们继续构建定制容器之前,我们先清理一下 Docker 环境,我们将关闭先前的容器,并移除它。 + +我们利用`docker`命令和`run`选项运行一个容器,所以,为了停止同一个容器,我们简单地在执行`docker`命令时,使用`kill`选项,并指定容器名。 + +``` +# docker kill desperate_lalande +desperate_lalande +``` + +当我们再次执行`docker ps`,就不再有容器运行了 + +``` +# docker ps +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +``` + +但是,此时,我们这是停止了容器;虽然它不再运行,但仍然存在。默认情况下,`docker ps`只会显示正在运行的容器,如果我们附加`-a` (all) 标识,它会显示所有运行和未运行的容器。 + +``` +# docker ps -a +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +f6d31ab01fc9 5c82215b03d1 nginx -g 'daemon off 4 weeks ago Exited (-1) About a minute ago desperate_lalande +``` + +为了能完整地移除容器,我们在用`docker`命令时,附加`rm`选项。 + +``` +# docker rm desperate_lalande +desperate_lalande +``` + +虽然容器被移除了;但是我们仍拥有可用的**nginx**镜像(LCTT 译注:镜像缓存)。如果我们重新运行`docker run -d nginx`,Docker 就无需再次拉取 nginx 镜像即可启动容器。这是因为我们本地系统中已经保存了一个副本。 + +为了列出系统中所有的本地镜像,我们运行`docker`命令,附加`images`选项。 + +``` +# docker images +REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE +nginx latest 9fab4090484a 5 days ago 132.8 MB +``` + +## 构建我们自己的镜像 + +截至目前,我们已经使用了一些基础的 Docker 命令来启动、停止和移除一个预构建好的普通镜像。为了“Docker 化(Dockerize)”这篇博客,我们需要构建我们自己的镜像,也就是创建一个 **Dockerfile**。 + +在大多数虚拟机环境中,如果你想创建一个机器镜像,首先,你需要建立一个新的虚拟机、安装操作系统、安装应用,最后将其转换为一个模板或者镜像。但在 Docker 中,所有这些步骤都可以通过 Dockerfile 实现全自动。Dockerfile 是向 Docker 提供构建指令去构建定制镜像的方式。在这一章节,我们将编写能用来部署这个博客的定制 Dockerfile。 + +### 理解应用 + +我们开始构建 Dockerfile 之前,第一步要搞明白,我们需要哪些东西来部署这个博客。 + +这个博客本质上是由一个静态站点生成器生成的静态 HTML 页面,这个生成器是我编写的,名为 **hamerkop**。这个生成器很简单,它所做的就是生成该博客站点。所有的代码和源文件都被我放在了一个公共的 [Github 仓库](https://github.com/madflojo/blog)。为了部署这篇博客,我们要先从 Github 仓库把这些内容拉取下来,然后安装 **Python** 和一些 **Python** 模块,最后执行`hamerkop`应用。我们还需要安装 **nginx**,来运行生成后的内容。 + +截止目前,这些还是一个简单的 Dockerfile,但它却给我们展示了相当多的 [Dockerfile 语法]((https://docs.docker.com/v1.8/reference/builder/))。我们需要克隆 Github 仓库,然后使用你最喜欢的编辑器编写 Dockerfile,我选择`vi` + +``` +# git clone https://github.com/madflojo/blog.git +Cloning into 'blog'... +remote: Counting objects: 622, done. +remote: Total 622 (delta 0), reused 0 (delta 0), pack-reused 622 +Receiving objects: 100% (622/622), 14.80 MiB | 1.06 MiB/s, done. +Resolving deltas: 100% (242/242), done. +Checking connectivity... done. +# cd blog/ +# vi Dockerfile +``` + +### FROM - 继承一个 Docker 镜像 + +第一条 Dockerfile 指令是`FROM`指令。这将指定一个现存的镜像作为我们的基础镜像。这也从根本上给我们提供了继承其他 Docker 镜像的途径。在本例中,我们还是从刚刚我们使用的 **nginx** 开始,如果我们想从头开始,我们可以通过指定`ubuntu:latest`来使用 **Ubuntu** Docker 镜像。 + +``` +## Dockerfile that generates an instance of http://bencane.com + +FROM nginx:latest +MAINTAINER Benjamin Cane +``` + +除了`FROM`指令,我还使用了`MAINTAINER`,它用来显示 Dockerfile 的作者。 + +Docker 支持使用`#`作为注释,我将经常使用该语法,来解释 Dockerfile 的部分内容。 + +### 运行一次测试构建 + +因为我们继承了 **nginx** Docker镜像,我们现在的 Dockerfile 也就包括了用来构建 **nginx** 镜像的 [Dockerfile](https://github.com/nginxinc/docker-nginx/blob/08eeb0e3f0a5ee40cbc2bc01f0004c2aa5b78c15/Dockerfile) 中所有指令。这意味着,此时我们可以从该 Dockerfile 中构建出一个 Docker 镜像,然后以该镜像运行一个容器。虽然,最终的镜像和 **nginx** 镜像本质上是一样的,但是我们这次是通过构建 Dockerfile 的形式,然后我们将讲解 Docker 构建镜像的过程。 + +想要从 Dockerfile 构建镜像,我们只需要在运行 `docker` 命令的时候,加上 `build` 选项。 + +``` +# docker build -t blog /root/blog +Sending build context to Docker daemon 23.6 MB +Sending build context to Docker daemon +Step 0 : FROM nginx:latest + ---> 9fab4090484a +Step 1 : MAINTAINER Benjamin Cane + ---> Running in c97f36450343 + ---> 60a44f78d194 +Removing intermediate container c97f36450343 +Successfully built 60a44f78d194 +``` + +上面的例子,我们使用了`-t` (**tag**)标识给镜像添加“blog”的标签。实质上我们就是在给镜像命名,如果我们不指定标签,就只能通过 Docker 分配的 **Image ID** 来访问镜像了。本例中,从 Docker 构建成功的信息可以看出,**Image ID**值为 `60a44f78d194`。 + +除了`-t`标识外,我还指定了目录`/root/blog`。该目录被称作“构建目录”,它将包含 Dockerfile,以及其它需要构建该容器的文件。 + +现在我们构建成功了,下面我们开始定制该镜像。 + +### 使用 RUN 来执行 apt-get + +用来生成 HTML 页面的静态站点生成器是用 **Python** 语言编写的,所以,在 Dockerfile 中需要做的第一件定制任务是安装 Python。我们将使用 Apt 软件包管理器来安装 Python 软件包,这意味着在 Dockerfile 中我们要指定运行`apt-get update`和`apt-get install python-dev`;为了完成这一点,我们可以使用`RUN`指令。 + +``` +## Dockerfile that generates an instance of http://bencane.com + +FROM nginx:latest +MAINTAINER Benjamin Cane + +## Install python and pip +RUN apt-get update +RUN apt-get install -y python-dev python-pip +``` + +如上所示,我们只是简单地告知 Docker 构建镜像的时候,要去执行指定的`apt-get`命令。比较有趣的是,这些命令只会在该容器的上下文中执行。这意味着,即使在容器中安装了`python-dev`和`python-pip`,但主机本身并没有安装这些。说的更简单点,`pip`命令将只在容器中执行,出了容器,`pip`命令不存在。 + +还有一点比较重要的是,Docker 构建过程中不接受用户输入。这说明任何被`RUN`指令执行的命令必须在没有用户输入的时候完成。由于很多应用在安装的过程中需要用户的输入信息,所以这增加了一点难度。不过我们例子中,`RUN`命令执行的命令都不需要用户输入。 + +### 安装 Python 模块 + +**Python** 安装完毕后,我们现在需要安装 Python 模块。如果在 Docker 外做这些事,我们通常使用`pip`命令,然后参考我的博客 Git 仓库中名叫`requirements.txt`的文件。在之前的步骤中,我们已经使用`git`命令成功地将 Github 仓库“克隆”到了`/root/blog`目录;这个目录碰巧也是我们创建`Dockerfile`的目录。这很重要,因为这意味着 Docker 在构建过程中可以访问这个 Git 仓库中的内容。 + +当我们执行构建后,Docker 将构建的上下文环境设置为指定的“构建目录”。这意味着目录中的所有文件都可以在构建过程中被使用,目录之外的文件(构建环境之外)是不能访问的。 + +为了能安装所需的 Python 模块,我们需要将`requirements.txt`从构建目录拷贝到容器中。我们可以在`Dockerfile`中使用`COPY`指令完成这一需求。 + +``` +## Dockerfile that generates an instance of http://bencane.com + +FROM nginx:latest +MAINTAINER Benjamin Cane + +## Install python and pip +RUN apt-get update +RUN apt-get install -y python-dev python-pip + +## Create a directory for required files +RUN mkdir -p /build/ + +## Add requirements file and run pip +COPY requirements.txt /build/ +RUN pip install -r /build/requirements.txt +``` + +在`Dockerfile`中,我们增加了3条指令。第一条指令使用`RUN`在容器中创建了`/build/`目录。该目录用来拷贝生成静态 HTML 页面所需的一切应用文件。第二条指令是`COPY`指令,它将`requirements.txt`从“构建目录”(`/root/blog`)拷贝到容器中的`/build/`目录。第三条使用`RUN`指令来执行`pip`命令;安装`requirements.txt`文件中指定的所有模块。 + +当构建定制镜像时,`COPY`是条重要的指令。如果在 Dockerfile 中不指定拷贝文件,Docker 镜像将不会包含requirements.txt 这个文件。在 Docker 容器中,所有东西都是隔离的,除非在 Dockerfile 中指定执行,否则容器中不会包括所需的依赖。 + +### 重新运行构建 + +现在,我们让 Docker 执行了一些定制任务,现在我们尝试另一次 blog 镜像的构建。 + +``` +# docker build -t blog /root/blog +Sending build context to Docker daemon 19.52 MB +Sending build context to Docker daemon +Step 0 : FROM nginx:latest + ---> 9fab4090484a +Step 1 : MAINTAINER Benjamin Cane + ---> Using cache + ---> 8e0f1899d1eb +Step 2 : RUN apt-get update + ---> Using cache + ---> 78b36ef1a1a2 +Step 3 : RUN apt-get install -y python-dev python-pip + ---> Using cache + ---> ef4f9382658a +Step 4 : RUN mkdir -p /build/ + ---> Running in bde05cf1e8fe + ---> f4b66e09fa61 +Removing intermediate container bde05cf1e8fe +Step 5 : COPY requirements.txt /build/ + ---> cef11c3fb97c +Removing intermediate container 9aa8ff43f4b0 +Step 6 : RUN pip install -r /build/requirements.txt + ---> Running in c50b15ddd8b1 +Downloading/unpacking jinja2 (from -r /build/requirements.txt (line 1)) +Downloading/unpacking PyYaml (from -r /build/requirements.txt (line 2)) + +Successfully installed jinja2 PyYaml mistune markdown MarkupSafe +Cleaning up... + ---> abab55c20962 +Removing intermediate container c50b15ddd8b1 +Successfully built abab55c20962 +``` + +上述输出所示,我们可以看到构建成功了,我们还可以看到另外一个有趣的信息` ---> Using cache`。这条信息告诉我们,Docker 在构建该镜像时使用了它的构建缓存。 + +### Docker 构建缓存 + +当 Docker 构建镜像时,它不仅仅构建一个单独的镜像;事实上,在构建过程中,它会构建许多镜像。从上面的输出信息可以看出,在每一“步”执行后,Docker 都在创建新的镜像。 + +``` + Step 5 : COPY requirements.txt /build/ + ---> cef11c3fb97c +``` + +上面片段的最后一行可以看出,Docker 在告诉我们它在创建一个新镜像,因为它打印了**Image ID** : `cef11c3fb97c`。这种方式有用之处在于,Docker能在随后构建这个 **blog** 镜像时将这些镜像作为缓存使用。这很有用处,因为这样, Docker 就能加速同一个容器中新构建任务的构建流程。从上面的例子中,我们可以看出,Docker 没有重新安装`python-dev`和`python-pip`包,Docker 则使用了缓存镜像。但是由于 Docker 并没有找到执行`mkdir`命令的构建缓存,随后的步骤就被一一执行了。 + +Docker 构建缓存一定程度上是福音,但有时也是噩梦。这是因为决定使用缓存或者重新运行指令的因素很少。比如,如果`requirements.txt`文件发生了修改,Docker 会在构建时检测到该变化,然后 Docker 会重新执行该执行那个点往后的所有指令。这得益于 Docker 能查看`requirements.txt`的文件内容。但是,`apt-get`命令的执行就是另一回事了。如果提供 Python 软件包的 **Apt** 仓库包含了一个更新的 python-pip 包;Docker 不会检测到这个变化,转而去使用构建缓存。这会导致之前旧版本的包将被安装。虽然对`python-pip`来说,这不是主要的问题,但对使用了存在某个致命攻击缺陷的软件包缓存来说,这是个大问题。 + +出于这个原因,抛弃 Docker 缓存,定期地重新构建镜像是有好处的。这时,当我们执行 Docker 构建时,我简单地指定`--no-cache=True`即可。 + +## 部署博客的剩余部分 + +Python 软件包和模块安装后,接下来我们将拷贝需要用到的应用文件,然后运行`hamerkop`应用。我们只需要使用更多的`COPY` 和 `RUN`指令就可完成。 + +``` +## Dockerfile that generates an instance of http://bencane.com + +FROM nginx:latest +MAINTAINER Benjamin Cane + +## Install python and pip +RUN apt-get update +RUN apt-get install -y python-dev python-pip + +## Create a directory for required files +RUN mkdir -p /build/ + +## Add requirements file and run pip +COPY requirements.txt /build/ +RUN pip install -r /build/requirements.txt + +## Add blog code nd required files +COPY static /build/static +COPY templates /build/templates +COPY hamerkop /build/ +COPY config.yml /build/ +COPY articles /build/articles + +## Run Generator +RUN /build/hamerkop -c /build/config.yml +``` + +现在我们已经写出了剩余的构建指令,我们再次运行另一次构建,并确保镜像构建成功。 + +``` +# docker build -t blog /root/blog/ +Sending build context to Docker daemon 19.52 MB +Sending build context to Docker daemon +Step 0 : FROM nginx:latest + ---> 9fab4090484a +Step 1 : MAINTAINER Benjamin Cane + ---> Using cache + ---> 8e0f1899d1eb +Step 2 : RUN apt-get update + ---> Using cache + ---> 78b36ef1a1a2 +Step 3 : RUN apt-get install -y python-dev python-pip + ---> Using cache + ---> ef4f9382658a +Step 4 : RUN mkdir -p /build/ + ---> Using cache + ---> f4b66e09fa61 +Step 5 : COPY requirements.txt /build/ + ---> Using cache + ---> cef11c3fb97c +Step 6 : RUN pip install -r /build/requirements.txt + ---> Using cache + ---> abab55c20962 +Step 7 : COPY static /build/static + ---> 15cb91531038 +Removing intermediate container d478b42b7906 +Step 8 : COPY templates /build/templates + ---> ecded5d1a52e +Removing intermediate container ac2390607e9f +Step 9 : COPY hamerkop /build/ + ---> 59efd1ca1771 +Removing intermediate container b5fbf7e817b7 +Step 10 : COPY config.yml /build/ + ---> bfa3db6c05b7 +Removing intermediate container 1aebef300933 +Step 11 : COPY articles /build/articles + ---> 6b61cc9dde27 +Removing intermediate container be78d0eb1213 +Step 12 : RUN /build/hamerkop -c /build/config.yml + ---> Running in fbc0b5e574c5 +Successfully created file /usr/share/nginx/html//2011/06/25/checking-the-number-of-lwp-threads-in-linux +Successfully created file /usr/share/nginx/html//2011/06/checking-the-number-of-lwp-threads-in-linux + +Successfully created file /usr/share/nginx/html//archive.html +Successfully created file /usr/share/nginx/html//sitemap.xml + ---> 3b25263113e1 +Removing intermediate container fbc0b5e574c5 +Successfully built 3b25263113e1 +``` + +### 运行定制的容器 + +成功的一次构建后,我们现在就可以通过运行`docker`命令和`run`选项来运行我们定制的容器,和之前我们启动 nginx 容器一样。 + +``` +# docker run -d -p 80:80 --name=blog blog +5f6c7a2217dcdc0da8af05225c4d1294e3e6bb28a41ea898a1c63fb821989ba1 +``` + +我们这次又使用了`-d` (**detach**)标识来让Docker在后台运行。但是,我们也可以看到两个新标识。第一个新标识是`--name`,这用来给容器指定一个用户名称。之前的例子,我们没有指定名称,因为 Docker 随机帮我们生成了一个。第二个新标识是`-p`,这个标识允许用户从主机映射一个端口到容器中的一个端口。 + +之前我们使用的基础 **nginx** 镜像分配了80端口给 HTTP 服务。默认情况下,容器内的端口通道并没有绑定到主机系统。为了让外部系统能访问容器内部端口,我们必须使用`-p`标识将主机端口映射到容器内部端口。上面的命令,我们通过`-p 8080:80`语法将主机80端口映射到容器内部的80端口。 + +经过上面的命令,我们的容器看起来成功启动了,我们可以通过执行`docker ps`核实。 + +``` +# docker ps +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +d264c7ef92bd blog:latest nginx -g 'daemon off 3 seconds ago Up 3 seconds 443/tcp, 0.0.0.0:80->80/tcp blog +``` + +## 总结 + +截止目前,我们拥有了一个运行中的定制 Docker 容器。虽然在这篇文章中,我们只接触了一些 Dockerfile 指令用法,但是我们还是要学习所有的指令。我们可以检查 [Docker's reference page](https://docs.docker.com/v1.8/reference/builder/) 来获取所有的 Dockerfile 指令用法,那里对指令的用法说明得很详细。 + +另一个比较好的资源是 [Dockerfile Best Practices page](https://docs.docker.com/engine/articles/dockerfile_best-practices/),它有许多构建定制 Dockerfile 的最佳练习。有些技巧非常有用,比如战略性地组织好 Dockerfile 中的命令。上面的例子中,我们将`articles`目录的`COPY`指令作为 Dockerfile 中最后的`COPY`指令。这是因为`articles`目录会经常变动。所以,将那些经常变化的指令尽可能地放在最后面的位置,来最优化那些可以被缓存的步骤。 + +通过这篇文章,我们涉及了如何运行一个预构建的容器,以及如何构建,然后部署定制容器。虽然关于 Docker 你还有许多需要继续学习的地方,但我想这篇文章给了你如何继续开始的好建议。当然,如果你认为还有一些需要继续补充的内容,在下面评论即可。 + +-------------------------------------- +via: http://bencane.com/2015/12/01/getting-started-with-docker-by-dockerizing-this-blog/ + +作者:Benjamin Cane +译者:[su-kaiyao](https://github.com/su-kaiyao) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + diff --git a/translated/tech/20151210 Getting started with Docker by Dockerizing this Blog.md.md b/translated/tech/20151210 Getting started with Docker by Dockerizing this Blog.md.md deleted file mode 100644 index a74af87b6f..0000000000 --- a/translated/tech/20151210 Getting started with Docker by Dockerizing this Blog.md.md +++ /dev/null @@ -1,464 +0,0 @@ -通过Dockerize这篇博客来开启我们的Docker之旅 -=== ->这篇文章将包含Docker的基本概念,以及如何通过创建一个定制的Dockerfile来Dockerize一个应用 ->作者:Benjamin Cane,2015-12-01 10:00:00 - -Docker是2年前从某个idea中孕育而生的有趣技术,世界各地的公司组织都积极使用它来部署应用。在今天的文章中,我将教你如何通过"Dockerize"一个现有的应用,来开始我们的Docker运用。问题中的应用指的就是这篇博客! - -## 什么是Docker? - -当我们开始学习Docker基本概念时,让我们先去搞清楚什么是Docker以及它为什么这么流行。Docker是一个操作系统容器管理工具,它通过将应用打包在操作系统容器中,来方便我们管理和部署应用。 - -### 容器 vs. 虚拟机 - -容器虽和虚拟机并不完全相似,但它也是一种提供**操作系统虚拟化**的方式。但是,它和标准的虚拟机还是有不同之处的。 - -标准虚拟机一般会包括一个完整的操作系统,操作系统包,最后还有一至两个应用。这都得益于为虚拟机提供硬件虚拟化的管理程序。这样一来,一个单一的服务器就可以将许多独立的操作系统作为虚拟客户机运行了。 - -容器和虚拟机很相似,它们都支持在单一的服务器上运行多个操作环境,只是,在容器中,这些环境并不是一个个完整的操作系统。容器一般只包含必要的操作系统包和一些应用。它们通常不会包含一个完整的操作系统或者硬件虚拟化程序。这也意味着容器比传统的虚拟机开销更少。 - -容器和虚拟机常被误认为是两种抵触的技术。虚拟机采用同一个物理服务器,来提供全功能的操作环境,该环境会和其余虚拟机一起共享这些物理资源。容器一般用来隔离运行中的应用进程,运行进程将在单独的主机中运行,以保证隔离后的进程之间不能相互影响。事实上,容器和**BSD Jails**以及`chroot`进程的相似度,超过了和完整虚拟机的相似度。 - -### Docker在容器的上层提供了什么 - -Docker不是一个容器运行环境,事实上,只是一个容器技术,并不包含那些帮助Docker支持[Solaris Zones](https://blog.docker.com/2015/08/docker-oracle-solaris-zones/)和[BSD Jails](https://wiki.freebsd.org/Docker)的技术。Docker提供管理,打包和部署容器的方式。虽然一定程度上,虚拟机多多少少拥有这些类似的功能,但虚拟机并没有完整拥有绝大多数的容器功能,即使拥有,这些功能用起来都并没有Docker来的方便。 - -现在,我们应该知道Docker是什么了,然后,我们将从安装Docker,并部署一个公共的预构建好的容器开始,学习Docker是如何工作的。 - -## 从安装开始 - -默认情况下,Docker并不会自动被安装在您的计算机中,所以,第一步就是安装Docker包;我们的教学机器系统是Ubuntu 14.0.4,所以,我们将使用Apt包管理器,来执行安装操作。 - -``` -# apt-get install docker.io -Reading package lists... Done -Building dependency tree -Reading state information... Done -The following extra packages will be installed: - aufs-tools cgroup-lite git git-man liberror-perl -Suggested packages: - btrfs-tools debootstrap lxc rinse git-daemon-run git-daemon-sysvinit git-doc - git-el git-email git-gui gitk gitweb git-arch git-bzr git-cvs git-mediawiki - git-svn -The following NEW packages will be installed: - aufs-tools cgroup-lite docker.io git git-man liberror-perl -0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded. -Need to get 7,553 kB of archives. -After this operation, 46.6 MB of additional disk space will be used. -Do you want to continue? [Y/n] y -``` - -为了检查当前是否有容器运行,我们可以执行`docker`命令,加上`ps`选项 - -``` -# docker ps -CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES -``` - -`docker`命令中的`ps`功能类似于Linux的`ps`命令。它将显示可找到的Docker容器以及各自的状态。由于我们并没有开启任何Docker容器,所以命令没有显示任何正在运行的容器。 - -## 部署一个预构建好的nginx Docker容器 - -我比较喜欢的Docker特性之一就是Docker部署预先构建好的容器的方式,就像`yum`和`apt-get`部署包一样。为了更好地解释,我们来部署一个运行着nginx web服务器的预构建容器。我们可以继续使用`docker`命令,这次选择`run`选项。 - -``` -# docker run -d nginx -Unable to find image 'nginx' locally -Pulling repository nginx -5c82215b03d1: Download complete -e2a4fb18da48: Download complete -58016a5acc80: Download complete -657abfa43d82: Download complete -dcb2fe003d16: Download complete -c79a417d7c6f: Download complete -abb90243122c: Download complete -d6137c9e2964: Download complete -85e566ddc7ef: Download complete -69f100eb42b5: Download complete -cd720b803060: Download complete -7cc81e9a118a: Download complete -``` - -`docker`命令的`run`选项,用来通知Docker去寻找一个指定的Docker镜像,然后开启运行着该镜像的容器。默认情况下,Docker容器在前台运行,这意味着当你运行`docker run`命令的时候,你的shell会被绑定到容器的控制台以及运行在容器中的进程。为了能在后台运行该Docker容器,我们可以使用`-d` (**detach**)标志。 - -再次运行`docker ps`命令,可以看到nginx容器正在运行。 - -``` -# docker ps -CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES -f6d31ab01fc9 nginx:latest nginx -g 'daemon off 4 seconds ago Up 3 seconds 443/tcp, 80/tcp desperate_lalande -``` - -从上面的打印信息中,我们可以看到正在运行的名为`desperate_lalande`的容器,它是由`nginx:latest image`(译者注:nginx最新版本的镜像)构建而来得。 - -### Docker镜像 - -镜像是Docker的核心特征之一,类似于虚拟机镜像。和虚拟机镜像一样,Docker镜像是一个被保存并打包的容器。当然,Docker不只是创建镜像,它还可以通过Docker仓库发布这些镜像,Docker仓库和包仓库的概念差不多,它让Docker能够模仿`yum`部署包的方式来部署镜像。为了更好地理解这是怎么工作的,我们来回顾`docker run`执行后的输出。 - -``` -# docker run -d nginx -Unable to find image 'nginx' locally -``` - -我们可以看到第一条信息是,Docker不能在本地找到名叫nginx的镜像。这是因为当我们执行`docker run`命令时,告诉Docker运行一个基于nginx镜像的容器。既然Docker要启动一个基于特定镜像的容器,那么Docker首先需要知道那个指定镜像。在检查远程仓库之前,Docker首先检查本地是否存在指定名称的本地镜像。 - -因为系统是崭新的,不存在nginx镜像,Docker将选择从Docker仓库下载之。 - -``` -Pulling repository nginx -5c82215b03d1: Download complete -e2a4fb18da48: Download complete -58016a5acc80: Download complete -657abfa43d82: Download complete -dcb2fe003d16: Download complete -c79a417d7c6f: Download complete -abb90243122c: Download complete -d6137c9e2964: Download complete -85e566ddc7ef: Download complete -69f100eb42b5: Download complete -cd720b803060: Download complete -7cc81e9a118a: Download complete -``` - -这就是第二部分打印信息显示给我们的内容。默认,Docker会使用[Docker Hub](https://hub.docker.com/)仓库,该仓库由Docker公司维护。 - -和Github一样,在Docker Hub创建公共仓库是免费的,私人仓库就需要缴纳费用了。当然,部署你自己的Docker仓库也是可以实现的,事实上只需要简单地运行`docker run registry`命令就行了。但在这篇文章中,我们的重点将不是讲解如何部署一个定制的注册服务。 - -### 关闭并移除容器 - -在我们继续构建定制容器之前,我们先清理Docker环境,我们将关闭先前的容器,并移除它。 - -我们利用`docker`命令和`run`选项运行一个容器,所以,为了停止该相同的容器,我们简单地在执行`docker`命令时,使用`kill`选项,并指定容器名。 - -``` -# docker kill desperate_lalande -desperate_lalande -``` - -当我们再次执行`docker ps`,就不再有容器运行了 - -``` -# docker ps -CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES -``` - -但是,此时,我们这是停止了容器;虽然它不再运行,但仍然存在。默认情况下,`docker ps`只会显示正在运行的容器,如果我们附加`-a` (all) 标识,它会显示所有运行和未运行的容器。 - -``` -# docker ps -a -CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES -f6d31ab01fc9 5c82215b03d1 nginx -g 'daemon off 4 weeks ago Exited (-1) About a minute ago desperate_lalande -``` - -为了能完整地移除容器,我们在用`docker`命令时,附加`rm`选项。 - -``` -# docker rm desperate_lalande -desperate_lalande -``` - -虽然容器被移除了;但是我们仍拥有可用的**nginx**镜像(译者注:镜像缓存)。如果我们重新运行`docker run -d nginx`,Docker就无需再次拉取nginx镜像,即可启动容器。这是因为我们本地系统中已经保存了一个副本。 - -为了列出系统中所有的本地镜像,我们运行`docker`命令,附加`images`选项。 - -``` -# docker images -REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE -nginx latest 9fab4090484a 5 days ago 132.8 MB -``` - -## 构建我们自己的镜像 - -截至目前,我们已经使用了一些基础的Docker命令来开启,停止和移除一个预构建好的普通镜像。为了"Dockerize"这篇博客,我们需要构建我们自己的镜像,也就是创建一个**Dockerfile**。 - -在大多数虚拟机环境中,如果你想创建一个机器镜像,首先,你需要建立一个新的虚拟机,安装操作系统,安装应用,最后将其转换为一个模板或者镜像。但在Docker中,所有这些步骤都可以通过Dockerfile实现全自动。Dockerfile是向Docker提供构建指令去构建定制镜像的方式。在这一章节,我们将编写能用来部署这篇博客的定制Dockerfile。 - -### 理解应用 - -我们开始构建Dockerfile之前,第一步要搞明白,我们需要哪些东西来部署这篇博客。 - -博客本质上是由静态站点生成器生成的静态HTML页面,这个静态站点是我编写的,名为**hamerkop**。这个生成器很简单,它所做的就是生成该博客站点。所有的博客源码都被我放在了一个公共的[Github仓库](https://github.com/madflojo/blog)。为了部署这篇博客,我们要先从Github仓库把博客内容拉取下来,然后安装**Python**和一些**Python**模块,最后执行`hamerkop`应用。我们还需要安装**nginx**,来运行生成后的内容。 - -截止目前,这些还是一个简单的Dockerfile,但它却给我们展示了相当多的[Dockerfile语法]((https://docs.docker.com/v1.8/reference/builder/))。我们需要克隆Github仓库,然后使用你最喜欢的编辑器编写Dockerfile;我选择`vi` - -``` -# git clone https://github.com/madflojo/blog.git -Cloning into 'blog'... -remote: Counting objects: 622, done. -remote: Total 622 (delta 0), reused 0 (delta 0), pack-reused 622 -Receiving objects: 100% (622/622), 14.80 MiB | 1.06 MiB/s, done. -Resolving deltas: 100% (242/242), done. -Checking connectivity... done. -# cd blog/ -# vi Dockerfile -``` - -### FROM - 继承一个Docker镜像 - -第一条Dockerfile指令是`FROM`指令。这将指定一个现存的镜像作为我们的基础镜像。这也从根本上给我们提供了继承其他Docker镜像的途径。在本例中,我们还是从刚刚我们使用的**nginx**开始,如果我们想重新开始,我们可以通过指定`ubuntu:latest`来使用**Ubuntu** Docker镜像。 - -``` -## Dockerfile that generates an instance of http://bencane.com - -FROM nginx:latest -MAINTAINER Benjamin Cane -``` - -除了`FROM`指令,我还使用了`MAINTAINER`,它用来显示Dockerfile的作者。 - -Docker支持使用`#`作为注释,我将经常使用该语法,来解释Dockerfile的部分内容。 - -### 运行一次测试构建 - -因为我们继承了**nginx** Docker镜像,我们现在的Dockerfile也就包括了用来构建**nginx**镜像的[Dockerfile](https://github.com/nginxinc/docker-nginx/blob/08eeb0e3f0a5ee40cbc2bc01f0004c2aa5b78c15/Dockerfile)中所有指令。这意味着,此时我们可以从该Dockerfile中构建出一个Docker镜像,然后从该镜像中运行一个容器。虽然,最终的镜像和**nginx**镜像本质上是一样的,但是我们这次是通过构建Dockerfile的形式,然后我们将讲解Docker构建镜像的过程。 - -想要从Dockerfile构建镜像,我们只需要在运行`docker`命令的时候,加上**build**选项。 - -``` -# docker build -t blog /root/blog -Sending build context to Docker daemon 23.6 MB -Sending build context to Docker daemon -Step 0 : FROM nginx:latest - ---> 9fab4090484a -Step 1 : MAINTAINER Benjamin Cane - ---> Running in c97f36450343 - ---> 60a44f78d194 -Removing intermediate container c97f36450343 -Successfully built 60a44f78d194 -``` - -上面的例子,我们使用了`-t` (**tag**)标识给镜像添加"blog"的标签。本质上我们只是在给镜像命名,如果我们不指定标签,就只能通过Docker分配的**Image ID**来访问镜像了。本例中,从Docker构建成功的信息可以看出,**Image ID**值为`60a44f78d194`。 - -除了`-t`标识外,我还指定了目录`/root/blog`。该目录被称作"构建目录",它将包含Dockerfile,以及其他需要构建该容器的文件。 - -现在我们构建成功,下面我们开始定制该镜像。 - -### 使用RUN来执行apt-get - -用来生成HTML页面的静态站点生成器是用**Python**语言编写的,所以,在Dockerfile中需要做的第一件定制任务是安装Python。我们将使用Apt包管理器来安装Python包,这意味着在Dockerfile中我们要指定运行`apt-get update`和`apt-get install python-dev`;为了完成这一点,我们可以使用`RUN`指令。 - -``` -## Dockerfile that generates an instance of http://bencane.com - -FROM nginx:latest -MAINTAINER Benjamin Cane - -## Install python and pip -RUN apt-get update -RUN apt-get install -y python-dev python-pip -``` - -如上所示,我们只是简单地告知Docker构建镜像的时候,要去执行指定的`apt-get`命令。比较有趣的是,这些命令只会在该容器的上下文中执行。这意味着,即使容器中安装了`python-dev`和`python-pip`,但主机本身并没有安装这些。说的更简单点,`pip`命令将只在容器中执行,出了容器,`pip`命令不存在。 - -还有一点比较重要的是,Docker构建过程中不接受用户输入。这说明任何被`RUN`指令执行的命令必须在没有用户输入的时候完成。由于很多应用在安装的过程中需要用户的输入信息,所以这增加了一点难度。我们例子,`RUN`命令执行的命令都不需要用户输入。 - -### 安装Python模块 - -**Python**安装完毕后,我们现在需要安装Python模块。如果在Docker外做这些事,我们通常使用`pip`命令,然后参考博客Git仓库中名叫`requirements.txt`的文件。在之前的步骤中,我们已经使用`git`命令成功地将Github仓库"克隆"到了`/root/blog`目录;这个目录碰巧也是我们创建`Dockerfile`的目录。这很重要,因为这意味着Dokcer在构建过程中可以访问Git仓库中的内容。 - -当我们执行构建后,Docker将构建的上下文环境设置为指定的"构建目录"。这意味着目录中的所有文件都可以在构建过程中被使用,目录之外的文件(构建环境之外)是不能访问的。 - -为了能安装需要的Python模块,我们需要将`requirements.txt`从构建目录拷贝到容器中。我们可以在`Dockerfile`中使用`COPY`指令完成这一需求。 - -``` -## Dockerfile that generates an instance of http://bencane.com - -FROM nginx:latest -MAINTAINER Benjamin Cane - -## Install python and pip -RUN apt-get update -RUN apt-get install -y python-dev python-pip - -## Create a directory for required files -RUN mkdir -p /build/ - -## Add requirements file and run pip -COPY requirements.txt /build/ -RUN pip install -r /build/requirements.txt -``` - -在`Dockerfile`中,我们增加了3条指令。第一条指令使用`RUN`在容器中创建了`/build/`目录。该目录用来拷贝生成静态HTML页面需要的一切应用文件。第二条指令是`COPY`指令,它将`requirements.txt`从"构建目录"(`/root/blog`)拷贝到容器中的`/build/`目录。第三条使用`RUN`指令来执行`pip`命令;安装`requirements.txt`文件中指定的所有模块。 - -当构建定制镜像时,`COPY`是条重要的指令。如果在Dockerfile中不指定拷贝文件,Docker镜像将不会包含requirements.txt文件。在Docker容器中,所有东西都是隔离的,除非在Dockerfile中指定执行,否则容器中不会包括需要的依赖。 - -### 重新运行构建 - -现在,我们让Docker执行了一些定制任务,现在我们尝试另一次blog镜像的构建。 - -``` -# docker build -t blog /root/blog -Sending build context to Docker daemon 19.52 MB -Sending build context to Docker daemon -Step 0 : FROM nginx:latest - ---> 9fab4090484a -Step 1 : MAINTAINER Benjamin Cane - ---> Using cache - ---> 8e0f1899d1eb -Step 2 : RUN apt-get update - ---> Using cache - ---> 78b36ef1a1a2 -Step 3 : RUN apt-get install -y python-dev python-pip - ---> Using cache - ---> ef4f9382658a -Step 4 : RUN mkdir -p /build/ - ---> Running in bde05cf1e8fe - ---> f4b66e09fa61 -Removing intermediate container bde05cf1e8fe -Step 5 : COPY requirements.txt /build/ - ---> cef11c3fb97c -Removing intermediate container 9aa8ff43f4b0 -Step 6 : RUN pip install -r /build/requirements.txt - ---> Running in c50b15ddd8b1 -Downloading/unpacking jinja2 (from -r /build/requirements.txt (line 1)) -Downloading/unpacking PyYaml (from -r /build/requirements.txt (line 2)) - -Successfully installed jinja2 PyYaml mistune markdown MarkupSafe -Cleaning up... - ---> abab55c20962 -Removing intermediate container c50b15ddd8b1 -Successfully built abab55c20962 -``` - -上述输出所示,我们可以看到构建成功了,我们还可以看到另外一个有趣的信息` ---> Using cache`。这条信息告诉我们,Docker在构建该镜像时使用了它的构建缓存。 - -### Docker构建缓存 - -当Docker构建镜像时,它不仅仅构建一个单独的镜像;事实上,在构建过程中,它会构建许多镜像。从上面的输出信息可以看出,在每一"步"执行后,Docker都在创建新的镜像。 - -``` - Step 5 : COPY requirements.txt /build/ - ---> cef11c3fb97c -``` - -上面片段的最后一行可以看出,Docker在告诉我们它在创建一个新镜像,因为它打印了**Image ID**;`cef11c3fb97c`。这种方式有用之处在于,Docker能在随后构建**blog**镜像时将这些镜像作为缓存使用。这很有用处,因为这样,Docker就能加速同一个容器中新构建任务的构建流程。从上面的例子中,我们可以看出,Docker没有重新安装`python-dev`和`python-pip`包,Docker则使用了缓存镜像。但是由于Docker并没有找到执行`mkdir`命令的构建缓存,随后的步骤就被一一执行了。 - -Docker构建缓存一定程度上是福音,但有时也是噩梦。这是因为使用缓存或者重新运行指令的决定在一个很狭窄的范围内执行。比如,如果`requirements.txt`文件发生了修改,Docker会在构建时检测到该变化,然后Docker会重新执行该执行那个点往后的所有指令。这得益于Docker能查看`requirements.txt`的文件内容。但是,`apt-get`命令的执行就是另一回事了。如果提供Python包的**Apt** 仓库包含了一个更新的python-pip包;Docker不会检测到这个变化,转而去使用构建缓存。这会导致之前旧版本的包将被安装。虽然对`python-pip`来说,这不是主要的问题,但对使用了某个致命攻击缺陷的包缓存来说,这是个大问题。 - -出于这个原因,抛弃Docker缓存,定期地重新构建镜像是有好处的。这时,当我们执行Docker构建时,我简单地指定`--no-cache=True`即可。 - -## 部署博客的剩余部分 - -Python包和模块安装后,接下来我们将拷贝需要用到的应用文件,然后运行`hamerkop`应用。我们只需要使用更多的`COPY` and `RUN`指令就可完成。 - -``` -## Dockerfile that generates an instance of http://bencane.com - -FROM nginx:latest -MAINTAINER Benjamin Cane - -## Install python and pip -RUN apt-get update -RUN apt-get install -y python-dev python-pip - -## Create a directory for required files -RUN mkdir -p /build/ - -## Add requirements file and run pip -COPY requirements.txt /build/ -RUN pip install -r /build/requirements.txt - -## Add blog code nd required files -COPY static /build/static -COPY templates /build/templates -COPY hamerkop /build/ -COPY config.yml /build/ -COPY articles /build/articles - -## Run Generator -RUN /build/hamerkop -c /build/config.yml -``` - -现在我们已经写出了剩余的构建指令,我们再次运行另一次构建,并确保镜像构建成功。 - -``` -# docker build -t blog /root/blog/ -Sending build context to Docker daemon 19.52 MB -Sending build context to Docker daemon -Step 0 : FROM nginx:latest - ---> 9fab4090484a -Step 1 : MAINTAINER Benjamin Cane - ---> Using cache - ---> 8e0f1899d1eb -Step 2 : RUN apt-get update - ---> Using cache - ---> 78b36ef1a1a2 -Step 3 : RUN apt-get install -y python-dev python-pip - ---> Using cache - ---> ef4f9382658a -Step 4 : RUN mkdir -p /build/ - ---> Using cache - ---> f4b66e09fa61 -Step 5 : COPY requirements.txt /build/ - ---> Using cache - ---> cef11c3fb97c -Step 6 : RUN pip install -r /build/requirements.txt - ---> Using cache - ---> abab55c20962 -Step 7 : COPY static /build/static - ---> 15cb91531038 -Removing intermediate container d478b42b7906 -Step 8 : COPY templates /build/templates - ---> ecded5d1a52e -Removing intermediate container ac2390607e9f -Step 9 : COPY hamerkop /build/ - ---> 59efd1ca1771 -Removing intermediate container b5fbf7e817b7 -Step 10 : COPY config.yml /build/ - ---> bfa3db6c05b7 -Removing intermediate container 1aebef300933 -Step 11 : COPY articles /build/articles - ---> 6b61cc9dde27 -Removing intermediate container be78d0eb1213 -Step 12 : RUN /build/hamerkop -c /build/config.yml - ---> Running in fbc0b5e574c5 -Successfully created file /usr/share/nginx/html//2011/06/25/checking-the-number-of-lwp-threads-in-linux -Successfully created file /usr/share/nginx/html//2011/06/checking-the-number-of-lwp-threads-in-linux - -Successfully created file /usr/share/nginx/html//archive.html -Successfully created file /usr/share/nginx/html//sitemap.xml - ---> 3b25263113e1 -Removing intermediate container fbc0b5e574c5 -Successfully built 3b25263113e1 -``` - -### 运行定制的容器 - -成功的一次构建后,我们现在就可以通过运行`docker`命令和`run`选项来运行我们定制的容器,和之前我们启动nginx容器一样。 - -``` -# docker run -d -p 80:80 --name=blog blog -5f6c7a2217dcdc0da8af05225c4d1294e3e6bb28a41ea898a1c63fb821989ba1 -``` - -我们这次又使用了`-d` (**detach**)标识来让Docker在后台运行。但是,我们也可以看到两个新标识。第一个新标识是`--name`,这用来给容器指定一个用户名称。之前的例子,我们没有指定名称,因为Docker随机帮我们生成了一个。第二个新标识是`-p`,这个标识允许用户从主机映射一个端口到容器中的一个端口。 - -之前我们使用的基础**nginx**镜像分配了80端口给HTTP服务。默认情况下,容器内的端口通道并没有绑定到主机系统。为了让外部系统能访问容器内部端口,我们必须使用`-p`标识将主机端口映射到容器内部端口。上面的命令,我们通过`-p 8080:80`语法将主机80端口映射到容器内部的80端口。 - -经过上面的命令,我们的容器似乎成功启动了,我们可以通过执行`docker ps`核实。 - -``` -# docker ps -CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES -d264c7ef92bd blog:latest nginx -g 'daemon off 3 seconds ago Up 3 seconds 443/tcp, 0.0.0.0:80->80/tcp blog -``` - -## 总结 - -截止目前,我们拥有了正在运行的定制Docker容器。虽然在这篇文章中,我们只接触了一些Dockerfile指令用法,但是我们还是要讨论所有的指令。我们可以检查[Docker's reference page](https://docs.docker.com/v1.8/reference/builder/)来获取所有的Dockerfile指令用法,那里对指令的用法说明得很详细。 - -另一个比较好的资源是[Dockerfile Best Practices page](https://docs.docker.com/engine/articles/dockerfile_best-practices/),它有许多构建定制Dockerfile的最佳练习。有些技巧非常有用,比如战略性地组织好Dockerfile中的命令。上面的例子中,我们将`articles`目录的`COPY`指令作为Dockerfile中最后的`COPY`指令。这是因为`articles`目录会经常变动。所以,将那些经常变化的指令尽可能地放在最后面的位置,来最优化那些可以被缓存的步骤。 - -通过这篇文章,我们涉及了如何运行一个预构建的容器,以及如何构建,然后部署定制容器。虽然关于Docker你还有许多需要继续学习的地方,但我想这篇文章给了你如何继续开始的好建议。当然,如果你认为还有一些需要继续补充的内容,在下面评论即可。 - --------------------------------------- -via:http://bencane.com/2015/12/01/getting-started-with-docker-by-dockerizing-this-blog/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+bencane%2FSAUo+%28Benjamin+Cane%29 - -作者:Benjamin Cane - -译者:[su-kaiyao](https://github.com/su-kaiyao) - -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - From 6f944b82c58594766434d04943f31d1fd582b779 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 8 Jun 2016 12:25:28 +0800 Subject: [PATCH 0880/1469] PUB:20160601 Apps to Snaps @alim0x --- published/20160601 Apps to Snaps.md | 61 +++++++++++++++++++++++ translated/tech/20160601 Apps to Snaps.md | 61 ----------------------- 2 files changed, 61 insertions(+), 61 deletions(-) create mode 100644 published/20160601 Apps to Snaps.md delete mode 100644 translated/tech/20160601 Apps to Snaps.md diff --git a/published/20160601 Apps to Snaps.md b/published/20160601 Apps to Snaps.md new file mode 100644 index 0000000000..458960f555 --- /dev/null +++ b/published/20160601 Apps to Snaps.md @@ -0,0 +1,61 @@ +将 Linux 软件打包成 Snap 软件包 +================ + +![](https://insights.ubuntu.com/wp-content/uploads/27eb/app-snap.png) + +在 Linux 分发应用不总是那么容易。有各种不同的包格式、基础系统、可用库,随着发行版的一次次发布,所有的这些都让人头疼。然而,现在我们有了更简单的东西:Snap。 + +Snap 是开发者打包他们应用的新途径,它相对于传统包格式,如 .deb,.rpm 等带来了许多优点。Snap 安全,彼此隔离,宿主系统使用了类似 AppArmor 的技术,它们跨平台且自足的,让开发者可以准确地将应用所需要的依赖打包到一起。沙盒隔离也加强了安全,并允许应用和整个基于 snap 的系统,在出现问题的时候可以回滚。Snap 确实是 Linux 应用打包的未来。 + +创建一个 snap 包并不困难。首先,你需要一个 snap 基础运行环境,能够让你的桌面环境认识并运行 snap 软件包,这个工具叫做 snapd ,默认内置于所有 Ubuntu 16.04 系统中。接着你需要创建 snap 的工具 Snapcraft,它可以通过一个简单的命令安装: + +``` +$ sudo apt-get install snapcraft +``` + +这个环境安装好了之后就可以 snap 起来了。 + +Snap 使用一个特定的 YAML 格式的文件 snapcraft.yaml,它定义了应用是如何打包的以及它需要的依赖。用一个简单的应用来演示一下,下面的 YAML 文件是个如何 snap 一个 moon-buggy 游戏的实际例子,该游戏在 Ubuntu 源中提供。 + +``` +name: moon-buggy +version: 1.0.51.11 +summary: Drive a car across the moon +description: | +A simple command-line game where you drive a buggy on the moon +apps: + play: + command: usr/games/moon-buggy +parts: + moon-buggy: + plugin: nil + stage-packages: [moon-buggy] + snap: + – usr/games/moon-buggy +``` + +上面的代码出现了几个新概念。第一部分是关于如何让你的应用可以在商店找到的信息,设置软件包的元数据名称、版本号、摘要、以及描述。apps 部分实现了 play 命令,指向了 moon-buggy 可执行文件位置。parts 部分告诉 snapcraft 用来构建应用所需要的插件以及依赖的包。在这个简单的例子中我们需要的所有东西就是来自 Ubuntu 源中的 moon-buggy 应用本身,snapcraft 负责剩下的工作。 + +在你的 snapcraft.yaml 所在目录下运行 snapcraft ,它会创建 moon-buggy_1.0.51.11_amd64.snap 包,可以通过以下命令来安装它: + +``` +$ snap install moon-buggy_1.0.51.11_amd64.snap +``` + +想了解更复杂一点的 snap 打包操作,比如基于 Electron 的 Simplenote 可以[看这里][1],在线教程在[这里][2],相应的代码在 [Github][3]。更多的例子可以在 Ubuntu 开发者[站点][4]找到。 + +-------------------------------------------------------------------------------- + +via: https://insights.ubuntu.com/2016/06/01/apps-to-snaps/ + +作者:[Jamie][a] +译者:[alim0x](https://github.com/alim0x) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://insights.ubuntu.com/author/jamiebennett/ +[1]: http://www.simplenote.com/ +[2]: http://www.linuxuk.org/post/20160518_snapping_electron_based_applications_simplenote/ +[3]: https://github.com/jamiedbennett/snaps/tree/master/simplenote +[4]: https://developer.ubuntu.com/en/desktop/get-started/ diff --git a/translated/tech/20160601 Apps to Snaps.md b/translated/tech/20160601 Apps to Snaps.md deleted file mode 100644 index 7dbf0784c9..0000000000 --- a/translated/tech/20160601 Apps to Snaps.md +++ /dev/null @@ -1,61 +0,0 @@ -Apps to Snaps -================ - -![](https://insights.ubuntu.com/wp-content/uploads/27eb/app-snap.png) - -在 Linux 分发应用不总是那么容易。你有不同的包格式,基础系统,可用库,以及发行版发布周期,所有的这些都让人头疼。但现在我们有了更简单的东西:Snap。 - -Snap 是开发者打包他们应用的新途径,它相对于传统包格式,如 .deb,.rpm 等带来了许多优点。Snap 安全,互相独立,宿主系统使用类似 AppArmor 的技术,它们跨平台,而且是自足的,让开发者可以准确打包它们应用所需要的依赖。沙盒隔离也加强了安全,并允许应用和整个基于 snap 的系统,在出现问题的时候可以回滚。Snap 确实是 Linux 应用打包的未来。 - -创建一个 snap 包并不困难。首先,你需要一个 snap 基础运行环境,能够在你的桌面理解和运行 snap,这个工具叫做 snapd 并且默认内置于所有 Ubuntu 16.04 系统中。接着你需要创建 snap 的工具,Snapcraft,可以通过一个简单的命令安装: - -``` -$ sudo apt-get install snapcraft -``` - -这个环境安装好了之后就可以 snap 起来了。 - -Snap 使用一个特殊的 YAML 格式文件,称作 snapcraft.yaml,它定义了应用是如何打包的以及它需要的依赖。用一个简单的应用来演示一下,下面的 YAML 文件是个如何 snap 打包 moon-buggy 游戏的实际例子,该游戏在 Ubuntu 源中提供。 - -``` -name: moon-buggy -version: 1.0.51.11 -summary: Drive a car across the moon -description: | -A simple command-line game where you drive a buggy on the moon -apps: -play: -command: usr/games/moon-buggy -parts: -moon-buggy: -plugin: nil -stage-packages: [moon-buggy] -snap: -– usr/games/moon-buggy -``` - -上面的代码演示了几个新概念。第一部分是关于让你的应用可以在商店找到的,设置包元数据名称,版本号,摘要,以及描述。Apps 部分实现了运行命令,指向 moon-buggy 可执行文件位置。Parts 部分告诉 snapcraft 用来构建应用所需要的插件以及依赖的包。在这个简单的例子中我们需要的所有东西就是 Ubuntu 源中的 moon-buggy 应用本身,snapcraft 负责剩下的工作。 - -在你的 snapcraft.yaml 所在目录下运行 snapcraft 会创建 moon-buggy_1.0.51.11_amd64.snap 包,可以通过以下命令来安装它: - -``` -$ snap install moon-buggy_1.0.51.11_amd64.snap -``` - -想了解更复杂一点的 snap 打包,比如基于 Electron 的 Simplenote [看这里][1],在线教程在[这里][2],相应的代码在[Github][3]。更多的例子可以在这里的 Ubuntu 开发者[站点][4]找到。 - --------------------------------------------------------------------------------- - -via: https://insights.ubuntu.com/2016/06/01/apps-to-snaps/ - -作者:[Jamie][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://insights.ubuntu.com/author/jamiebennett/ -[1]: http://www.simplenote.com/ -[2]: http://www.linuxuk.org/post/20160518_snapping_electron_based_applications_simplenote/ -[3]: https://github.com/jamiedbennett/snaps/tree/master/simplenote -[4]: https://developer.ubuntu.com/en/desktop/get-started/ From 4effc2389c16bccf11a056b931a64c600ef5845c Mon Sep 17 00:00:00 2001 From: alim0x Date: Wed, 8 Jun 2016 20:51:36 +0800 Subject: [PATCH 0881/1469] [translating]Android Use Apps Even Without Installing Them --- .../20160518 Android Use Apps Even Without Installing Them.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/talk/20160518 Android Use Apps Even Without Installing Them.md b/sources/talk/20160518 Android Use Apps Even Without Installing Them.md index 279e9a5edb..fc63e6c7fc 100644 --- a/sources/talk/20160518 Android Use Apps Even Without Installing Them.md +++ b/sources/talk/20160518 Android Use Apps Even Without Installing Them.md @@ -1,3 +1,5 @@ +alim0x translating + Android’s Next Revolution: Use Apps Even Without Installing Them! =================================================================== From 3535ed015a6863ca7111ced88b663873bf48b8f1 Mon Sep 17 00:00:00 2001 From: "Fuliang.Li" Date: Thu, 9 Jun 2016 00:20:50 +0800 Subject: [PATCH 0882/1469] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=B7=B2=E7=BF=BB?= =?UTF-8?q?=E8=AF=91=E7=9A=84=E5=8E=9F=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ng and Linux Filesystem Troubleshooting.md | 319 ------------------ 1 file changed, 319 deletions(-) delete mode 100644 sources/tech/LFCS/Part 10 - LFCS--Understanding and Learning Basic Shell Scripting and Linux Filesystem Troubleshooting.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 deleted file mode 100644 index 199d65957e..0000000000 --- a/sources/tech/LFCS/Part 10 - LFCS--Understanding and Learning Basic Shell Scripting and Linux Filesystem Troubleshooting.md +++ /dev/null @@ -1,319 +0,0 @@ -LFCS 第十讲:学习简单的 Shell 脚本编程和文件系统故障排除 - -================================================================================ -Linux 基金会发起了 LFCS 认证 (Linux Foundation Certified Sysadmin, Linux 基金会认证系统管理员),这是一个全新的认证体系,主要目标是让全世界任何人都有机会考取认证。认证内容为 Linux 中间系统的管理,主要包括:系统运行和服务的维护、全面监控和分析的能力以及问题来临时何时想上游团队请求帮助的决策能力 - -![Basic Shell Scripting and Filesystem Troubleshooting](http://www.tecmint.com/wp-content/uploads/2014/11/lfcs-Part-10.png) - -LFCS 系列第十讲 - -请看以下视频,这里边介绍了 Linux 基金会认证程序。 - -注:youtube 视频 - - - -本讲是系列教程中的第十讲,主要集中讲解简单的 Shell 脚本编程和文件系统故障排除。这两块内容都是 LFCS 认证中的必备考点。 - -### 理解终端 (Terminals) 和 Shell ### - -首先要声明一些概念。 - -- Shell 是一个程序,它将命令传递给操作系统来执行。 -- Terminal 也是一个程序,作为最终用户,我们需要使用它与 Shell 来交互。比如,下边的图片是 GNOME Terminal。 - -![Gnome Terminal](http://www.tecmint.com/wp-content/uploads/2014/11/Gnome-Terminal.png) - -Gnome Terminal - -启动 Shell 之后,会呈现一个命令提示符 (也称为命令行) 提示我们 Shell 已经做好了准备,接受标准输入设备输入的命令,这个标准输入设备通常是键盘。 - -你可以参考该系列文章的 [第一讲 使用命令创建、编辑和操作文件][1] 来温习一些常用的命令。 - -Linux 为提供了许多可以选用的 Shell,下面列出一些常用的: - -**bash Shell** - -Bash 代表 Bourne Again Shell,它是 GNU 项目默认的 Shell。它借鉴了 Korn shell (ksh) 和 C shell (csh) 中有用的特性,并同时对性能进行了提升。它同时也是 LFCS 认证中所涵盖的风发行版中默认 Shell,也是本系列教程将使用的 Shell。 - -**sh Shell** - -Bash Shell 是一个比较古老的 shell,一次多年来都是多数类 Unix 系统的默认 shell。 - -**ksh Shell** - -Korn SHell (ksh shell) 也是一个 Unix shell,是贝尔实验室 (Bell Labs) 的 David Korn 在 19 世纪 80 年代初的时候开发的。它兼容 Bourne shell ,并同时包含了 C shell 中的多数特性。 - - -一个 shell 脚本仅仅只是一个可执行的文本文件,里边包含一条条可执行命令。 - -### 简单的 Shell 脚本编程 ### - -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. - -### 总结 ### - -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] -译者:[GHLandy](https://github.com/GHLandy) -校对:[校对者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/ From e7501d1ebfc1e09bf17fa79f6bd474f184aacba5 Mon Sep 17 00:00:00 2001 From: "Fuliang.Li" Date: Thu, 9 Jun 2016 00:23:08 +0800 Subject: [PATCH 0883/1469] =?UTF-8?q?[=E5=AE=8C=E6=88=90=E7=BF=BB=E8=AF=91?= =?UTF-8?q?]=20Part=2010=20-=20LFCS--Understanding=20and=20Learning=20Basi?= =?UTF-8?q?c=20Shell=20Scripting=20and=20Linux=20Filesystem=20Troubleshoot?= =?UTF-8?q?ing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ng and Linux Filesystem Troubleshooting.md | 316 ++++++++++++++++++ 1 file changed, 316 insertions(+) create mode 100644 translated/tech/LFCS/Part 10 - LFCS--Understanding and Learning Basic Shell Scripting and Linux Filesystem Troubleshooting.md diff --git a/translated/tech/LFCS/Part 10 - LFCS--Understanding and Learning Basic Shell Scripting and Linux Filesystem Troubleshooting.md b/translated/tech/LFCS/Part 10 - LFCS--Understanding and Learning Basic Shell Scripting and Linux Filesystem Troubleshooting.md new file mode 100644 index 0000000000..884ad9055f --- /dev/null +++ b/translated/tech/LFCS/Part 10 - LFCS--Understanding and Learning Basic Shell Scripting and Linux Filesystem Troubleshooting.md @@ -0,0 +1,316 @@ +LFCS 第十讲:学习简单的 Shell 脚本编程和文件系统故障排除 +================================================================================ +Linux 基金会发起了 LFCS 认证 (Linux Foundation Certified Sysadmin, Linux 基金会认证系统管理员),这是一个全新的认证体系,主要目标是让全世界任何人都有机会考取认证。认证内容为 Linux 中间系统的管理,主要包括:系统运行和服务的维护、全面监控和分析的能力以及问题来临时何时想上游团队请求帮助的决策能力 + +![Basic Shell Scripting and Filesystem Troubleshooting](http://www.tecmint.com/wp-content/uploads/2014/11/lfcs-Part-10.png) + +LFCS 系列第十讲 + +请看以下视频,这里边介绍了 Linux 基金会认证程序。 + + + +本讲是系列教程中的第十讲,主要集中讲解简单的 Shell 脚本编程和文件系统故障排除。这两块内容都是 LFCS 认证中的必备考点。 + +### 理解终端 (Terminals) 和 Shell ### + +首先要声明一些概念。 + +- Shell 是一个程序,它将命令传递给操作系统来执行。 +- Terminal 也是一个程序,作为最终用户,我们需要使用它与 Shell 来交互。比如,下边的图片是 GNOME Terminal。 + +![Gnome Terminal](http://www.tecmint.com/wp-content/uploads/2014/11/Gnome-Terminal.png) + +Gnome Terminal + +启动 Shell 之后,会呈现一个命令提示符 (也称为命令行) 提示我们 Shell 已经做好了准备,接受标准输入设备输入的命令,这个标准输入设备通常是键盘。 + +你可以参考该系列文章的 [第一讲 使用命令创建、编辑和操作文件][1] 来温习一些常用的命令。 + +Linux 为提供了许多可以选用的 Shell,下面列出一些常用的: + +**bash Shell** + +Bash 代表 Bourne Again Shell,它是 GNU 项目默认的 Shell。它借鉴了 Korn shell (ksh) 和 C shell (csh) 中有用的特性,并同时对性能进行了提升。它同时也是 LFCS 认证中所涵盖的风发行版中默认 Shell,也是本系列教程将使用的 Shell。 + +**sh Shell** + +Bash Shell 是一个比较古老的 shell,一次多年来都是多数类 Unix 系统的默认 shell。 + +**ksh Shell** + +Korn SHell (ksh shell) 也是一个 Unix shell,是贝尔实验室 (Bell Labs) 的 David Korn 在 19 世纪 80 年代初的时候开发的。它兼容 Bourne shell ,并同时包含了 C shell 中的多数特性。 + + +一个 shell 脚本仅仅只是一个可执行的文本文件,里边包含一条条可执行命令。 + +### 简单的 Shell 脚本编程 ### + +如前所述,一个 shell 脚本就是一个纯文本文件,因此,可以使用自己喜欢的文本编辑器来创建和编辑。你可以考虑使用 vi/vim (参考本系列 [第二部分 - vi/vim 编辑器的使用][2]),它的语法高亮让我的编辑工作非常方便。 + +输入如下命令来创建一个名为 myscript.sh 的脚本文件: + + # vim myscript.sh + +shell 脚本的第一行 (著名的 [shebang 符](http://smilejay.com/2012/03/linux_shebang/)) 必须如下: + + #!/bin/bash + +这条语句“告诉”操作系统需要用那个解释器来运行这个脚本文件之后命令。 + +现在可以添加需要执行的命令了。通过注释,我们可以声明每一条命令或者整个脚本的具体含义。注意,shell 会忽略掉以井号 (#) 开始的语句。 + + #!/bin/bash + echo 这是关于 LFCS 认证系列的第十部分 + echo 今天是 $(date +%Y-%m-%d) + +编写并保存脚本之后,通过以下命令来是脚本文件称为可执行文件: + + # chmod 755 myscript.sh + +在执行脚本之前,我们需要说一下环境变量 ($PATH),运行: + + echo $PATH + +我们就会看到环境变量 ($PATH) 的具体内容:当输入命令是系统搜索可执行程序的目录,每一项之间使用冒号 (:) 隔开。称它为环境变量,是因为他本是就是 shell 环境的一部分 —— 当 shell 第每次启动时 shell 及其子进程可以获取的一系列信息。 + +当我们输入一个命令并按下回车时,shell 会搜索 $PATH 变量中列出的目录并执行第一个知道的实例。请看如下例子: + +![Linux Environment Variables](http://www.tecmint.com/wp-content/uploads/2014/11/Environment-Variable.png) + +环境变量 + +假如存在两个同名的可执行程序,一个在 /usr/local/bin,另一个在 /usr/bin,则会执行环境变量中最先列出的那个,并忽略另外一个。 + +如果我们自己编写的脚本没有在 $PATH 变量列出目录的其中一个,则需要输入 ./filename 来执行它。而如果存储在 $PATH 变量中的任意一个目录,我们就可以像运行其他命令一样来运行之前编写的脚本了。 + + # 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) + +执行脚本 + +#### if 条件语句 #### + +无论何时,当你需要在脚本中根据某个命令的运行结果来采取相应动作时,你应该使用 if 结构来定义条件。基本语法如下: + + if CONDITION; then + COMMANDS; + else + OTHER-COMMANDS + fi + +其中,CONDITION 为如下情形的任意一项 (仅列出常用的),并且达到以下条件时返回 true: + +- [ -a file ] → 指定文件存在。 +- [ -d file ] → 指定文件存在,并且是一个目录。 +- [ -f file ] → 指定文件存在,并且是一个普通文件。 +- [ -u file ] → 指定文件存在,并设置了 SUID。 +- [ -g file ] → 指定文件存在,并设置了 SGID。 +- [ -k file ] → 指定文件存在,并设置了“黏连 (Sticky)”位。 +- [ -r file ] → 指定文件存在,并且文件可读。 +- [ -s file ] → 指定文件存在,并且文件为空。 +- [ -w file ] → 指定文件存在,并且文件可写入· +- [ -x file ] → 指定文件存在,并且可执行。 +- [ string1 = string2 ] → 字符串相同。 +- [ string1 != string2 ] → 字符串不相同。 + +[ int1 op int2 ] 为前述列表中的一部分,紧跟着的项 (例如: -eq –> int1 与 int2 相同时返回 true) 则是 [ int1 op int2 ] 的一个子项, 其中 op 为以下比较操作符。 + +- -eq –> int1 等于 int2 时返回 true。 +- -ne –> int1 不等于 int2 时返回 true。 +- -lt –> int1 小于 int2 时返回 true。 +- -le –> int1 小于或等于 int2 时返回 true。 +- -gt –> int1 大于 int2 时返回 true。 +- -ge –> int1 大于或等于 int2 时返回 true。 + +#### for 循环语句 #### + +循环语句可以在某个条件下重复执行某个命令。基本语法如下: + + for item in SEQUENCE; do + COMMANDS; + done + +其中,item 为每次执行 COMMANDS 时,在 SEQUENCE 中匹配到的值。 + +#### While 循环语句 #### + +该循环结构会一直执行重复的命令,直到控制命令执行的退出状态值等于 0 时 (即执行成功) 停止。基本语法如下: + + while EVALUATION_COMMAND; do + EXECUTE_COMMANDS; + done + +其中,EVALUATION_COMMAND 可以是任何能够返回成功 (0) 或失败 (0 以外的值) 的退出状态值的命令,EXECUTE_COMMANDS 则可以是任何的程序、脚本或者 shell 结构体,包括其他的嵌套循环。 + +#### 综合使用 #### + +我们会通过以下例子来演示 if 条件语句和 for 循环语句。 + +**在基于 systemd 的发行版中探测某个服务是否在运行** + +先建立一个文件,列出我们想要想要查看的服务名。 + + # 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) + +使用脚本监控 Linux 服务 + +我们编写的脚本看起来应该是这样的: + + #!/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 服务监控脚本 + +**我们来解释一下这个脚本的工作流程** + +1). for 循环每次读取 myservices.txt 文件中的一项记录,每一项纪录表示一个服务的通用变量名。各项记录组成如下: + + # cat myservices.txt + +2). 以上命令由圆括号括着,并在前面添加美元符,表示它需要从 myservices.txt 的记录列表中取值作为变量传递给 for 循环。 + +3). 对于记录列表中的每一项纪录 (即每一项纪录的服务变量),都会这行以下动作: + + # systemctl status $service | grep --quiet "running" + +此时,需要在每个通用变量名 (即每一项纪录的服务变量) 的前面添加美元符,以表明它是作为变量来传递的。其输出则通过管道符传给 grep。 + +其中,-quiet 选项用于阻止 grep 命令将出现 "running" 的行回显到屏幕。当 grep 捕获到 "running" 时,则会返回一个退出状态码 "0" (在 if 结构体表示为 $?),由此确认某个服务正在运行中。 + +如果退出状态码是非零值 (即 systemctl status $service 命令中的回显中没有出现 "running"),则表明某个服务为运行。 + +![Services Monitoring Script](http://www.tecmint.com/wp-content/uploads/2014/11/Services-Monitoring-Script.png) + +服务监控脚本 + +我们可以增加一步,在开始循环之前,先确认 myservices.txt 是否存在。 + + #!/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 + +**Ping 一系列网络或者 Internet 主机名以获取应答数据** + +你可能想把自己维护的主机写入一个文本文件,并使用脚本探测它们是否能够 ping 得通 (脚本中的 myhosts 可以随意替换为你想要的名称)。 + +内置的 read shell 命令将告诉 while 循环一行行的读取 myhosts,并将读取的每行内容传给 host 变量,随后 host 变量传递给 ping 命令。 + + #!/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) + +使用脚本 Ping 服务器 + +扩展阅读: + +- [Learn Shell Scripting: A Guide from Newbies to System Administrator][3] +- [5 Shell Scripts to Learn Shell Programming][4] + +### 文件系统排除 ### + +尽管 Linux 是一个很稳定的操作系统,但仍然会因为某些原因出现崩溃 (比如以外断电等),正好你有一个 (或者更多个) 文件系统未能正确卸载,Linux 重启的时候就会自动检测其中可能发生的错误。 + +此外,每次系统正常启动的时候,都会在文件系统挂载之前校验它们的完整度。而这些全部都依赖于 fsck 工具 ("文件系统校验")。 + +如果对 fsck 进行设定,它除了校验文件系统的完整性之外,还可以尝试修复错误。fsck 能否成功修复错误,取决于文件系统的损伤程度;如果可以修复,被损坏部分的文件会恢复到位于每个文件系统根目录的 lost+found。 + +最后但同样重要的是,我们必须注意,如果拔掉系统正在写入数据的 USB 设备同样会发生错误,甚至可能发生硬件损坏。 + +fsck 的基本用如下: + + # fsck [options] filesystem + +**检查文件系统错误并尝试自动修复** + +想要使用 fsck 检查文件系统,我们需要首先卸载文件系统。 + + # 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) + +检查文件系统错误 + +除了 -y 选项,我们也可以使用 -a 选项来自动修复文件系统错误,而不必做出交互式应答,并在文件系统看起来 "干净" 的情况下强制校验。 + + # fsck -af /dev/sdg1 + +如果只是要找出什么地方发生了错误 (不用再检测到错误的时候修复),我们开使用 -n 选项,这样只会讲文集系统错误输出到标准输出设备。 + + # fsck -n /dev/sdg1 + +根据 fsck 输出的错误信息,我们可以知道是否可以自己修复或者需要将问题提交给工程师团队来做详细的硬件校验。 + +### 总结 ### + +至此,系列教程的十讲就全部结束了,全系列教程涵盖了通过 LFCS 测试所需的基础内容。 + +但显而易见的,本系列的十讲并不足以在单个主题方面做到全面描述,我们希望这一系列教程可以成为你学习的基础素材,并一直保持学习的热情。 + +我们欢迎你提出任何问题或者建议,所以你可以毫不犹豫的通过以下链接联系我们。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/linux-basic-shell-scripting-and-linux-filesystem-troubleshooting/ + +作者:[Gabriel Cánepa][a] +译者:[GHLandy](https://github.com/GHLandy) +校对:[校对者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/ From 0c59b67ae894233247aca5f3de26cbafe7f6ba7b Mon Sep 17 00:00:00 2001 From: alim0x Date: Thu, 9 Jun 2016 16:08:58 +0800 Subject: [PATCH 0884/1469] [translated]Android Use Apps Even Without Installing Them --- ...d Use Apps Even Without Installing Them.md | 69 ------------------- ...d Use Apps Even Without Installing Them.md | 67 ++++++++++++++++++ 2 files changed, 67 insertions(+), 69 deletions(-) delete mode 100644 sources/talk/20160518 Android Use Apps Even Without Installing Them.md create mode 100644 translated/talk/20160518 Android Use Apps Even Without Installing Them.md diff --git a/sources/talk/20160518 Android Use Apps Even Without Installing Them.md b/sources/talk/20160518 Android Use Apps Even Without Installing Them.md deleted file mode 100644 index fc63e6c7fc..0000000000 --- a/sources/talk/20160518 Android Use Apps Even Without Installing Them.md +++ /dev/null @@ -1,69 +0,0 @@ -alim0x translating - -Android’s Next Revolution: Use Apps Even Without Installing Them! -=================================================================== - - -A new innovation by Google’s Android will let you use apps even if they aren’t installed on your device. A few prototypes have already been made. - -Remember that time when someone sent you a link that required you installing an app in order to view? - -The dilemma of whether you should install the app just to view a one-time link may have frustrated you. Furthermore, the app installation itself may took some of your precious time as well. - -The above scenario has probably been experienced by most, if not all, modern day technology users. Nonetheless, we’ve all came to accept that this is simply the correct and logical way by which things work. - -Or is it? - -To that question Google’s Android division came up with a new, out-of-the-box answer: - -Android Instant Apps - -Android Instant Apps purports to rid you of any such dilemmas in the first place by letting you simply click the link (see opening example) and start using the app straight away. - -Another real life example of a scenario where Instant Apps might come handy, is the case you want to park your car but don’t have the parking meter matching app. - -According to Google, you could simply tap your phone on the meter and the parking app will pop on your screen immediately, ready to be used. - -How Does It Work? - -Instant Apps are basically the same apps you’ve already familiarized yourself with, only with a twist – these apps have been trimmed and modularized in order to supply you only the essential parts required for you to complete a certain task. - -For instance, expanding on the opening scenario as an example, in order to view a link, you don’t have to have a full featured app that can write, send, make coffee or whatever. All you need is the viewing feature – and that’s exactly what you’ll get. - -That way the app could open up rapidly, allowing you to complete the task of which you came for. - -![](http://www.iwillfolo.com/wordpress/wp-content/uploads/2016/05/AIA-demo.jpg) ->AIA demo - -![](https://4.bp.blogspot.com/-p5WOrD6wVy8/VzyIpsDqULI/AAAAAAAADD0/xbtQjurJZ6EEji_MPaY1sLK5wVkXSvxJgCKgB/s800/B%2526H%2B-%2BDevice%2B%2528Final%2529.gif) ->B&H Photo (via Google Search) - -![](https://2.bp.blogspot.com/-q5ApCzECuNA/VzyKa9l0t2I/AAAAAAAADEI/nYhhMClDl5Y3qL5-wiOb2J2QjtGWwbF2wCLcB/s800/BuzzFeed-Device-Install%2B%2528Final%2529.gif) ->BuzzFeedVideo (via a shared link) - -![](https://2.bp.blogspot.com/-mVhKMMzhxms/VzyKg25ihBI/AAAAAAAADEM/dJN6_8H7qkwRyulCF7Yr2234-GGUXzC6ACLcB/s800/Park%2Band%2BPay%2B-%2BDevice%2Bwith%2BMeter%2B%2528Final%2529.gif) ->Park and Pay (example) (via NFC) - - -Sounds great, isn’t it? However, there are still many technical aspects need to be addressed. - -For instance, from a security point of view: if any app can theoretically run on your device, even if you haven’t installed it – how will you keep your device safe from malaware attacks? - -Therefore, in order to iron out such risks, Google is still working on the project, currently with a small set of partners which will gradually expand. - -Eventually, Google plans to release AIA (Android Instant Apps) somewhere along next year. - -relate: [Introducing Android Instant Apps][1] - --------------------------------------------------------------------------------- - -via: http://www.iwillfolo.com/androids-next-revolution-use-apps-even-without-installing-them/ - -作者:[iwillfolo][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://www.iwillfolo.com -[1]: http://android-developers.blogspot.co.il/2016/05/android-instant-apps-evolving-apps.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed:+blogspot/hsDu+%28Android+Developers+Blog%29 diff --git a/translated/talk/20160518 Android Use Apps Even Without Installing Them.md b/translated/talk/20160518 Android Use Apps Even Without Installing Them.md new file mode 100644 index 0000000000..12fd11ca7e --- /dev/null +++ b/translated/talk/20160518 Android Use Apps Even Without Installing Them.md @@ -0,0 +1,67 @@ +安卓的下一场革命:不安装即可使用应用! +=================================================================== + + +谷歌安卓的一项新创新将让你可以使用没有在你的设备上安装的应用。现在已经有了一些原型了。 + +还记得某人给你发了一个链接,要求你安装一个应用来查看的情形吗? + +是否要安装这个应用来查看一个一次性的链接,这个困境一定让你感到很挫败。而且,应用安装本身也会消耗你不少宝贵的时间。 + +上述场景可能大多数人都经历过,或者说大多数现代科技用户都经历过。尽管如此,我们都接受这是正确且合理的过程。 + +真的吗? + +针对这个问题谷歌的安卓部门给出了一个全新的,开箱即用的答案: + +### Android Instant Apps + +Android Instant Apps 声称第一时间帮你摆脱这样的两难境地,让你简单地点击链接(见打开链接的示例)然后直接开始使用这个应用。 + +另一个真实生活场景的例子,如果你想停车但是没有停车码表的配对应用,有了 Instant Apps 在这种情况下就方便多了。 + +根据谷歌的信息,你可以简单地将你的手机和码表触碰,停车应用就会直接显示在你的屏幕上,并且准备就绪可以使用。 + +#### 它是怎么工作的? + +Instant Apps 和你已经熟悉的应用基本相同,只有一个不同——这些应用为了满足你完成某项任务的需要,只提供给你已经经过**裁剪和模块化**的应用关键部分。 + +例如,展开打开链接的场景作为例子,为了查看一个链接,你不需要拥有一个可以写,发送,做咖啡或其它特性的全功能应用。你所需要的全部就是查看功能——而这就是你所会获取到的部分。 + +这样应用就可以快速打开,让你可以完成你的目标任务。 + +![](http://www.iwillfolo.com/wordpress/wp-content/uploads/2016/05/AIA-demo.jpg) +>AIA 示例 + +![](https://4.bp.blogspot.com/-p5WOrD6wVy8/VzyIpsDqULI/AAAAAAAADD0/xbtQjurJZ6EEji_MPaY1sLK5wVkXSvxJgCKgB/s800/B%2526H%2B-%2BDevice%2B%2528Final%2529.gif) +>B&H 图片(通过谷歌搜索) + +![](https://2.bp.blogspot.com/-q5ApCzECuNA/VzyKa9l0t2I/AAAAAAAADEI/nYhhMClDl5Y3qL5-wiOb2J2QjtGWwbF2wCLcB/s800/BuzzFeed-Device-Install%2B%2528Final%2529.gif) +>BuzzFeedVideo(通过一个共享链接) + +![](https://2.bp.blogspot.com/-mVhKMMzhxms/VzyKg25ihBI/AAAAAAAADEM/dJN6_8H7qkwRyulCF7Yr2234-GGUXzC6ACLcB/s800/Park%2Band%2BPay%2B-%2BDevice%2Bwith%2BMeter%2B%2528Final%2529.gif) +>停车与支付(例)(通过 NFC) + + +听起来很棒,不是吗?但是其中还有很多技术方面的问题需要解决。 + +比如,从安全的观点来说:如果任何应用从理论上来说都能在你的设备上运行,甚至你都不用安装它——你要怎么保证设备远离恶意软件攻击? + +因此,为了消除这类威胁,谷歌还在这个项目上努力,目前只有少数合作伙伴,未来将逐步扩展。 + +谷歌最终计划在明年发布 AIA(Android Instant Apps)。 + +相关:[介绍 Android Instant Apps][1] + +-------------------------------------------------------------------------------- + +via: http://www.iwillfolo.com/androids-next-revolution-use-apps-even-without-installing-them/ + +作者:[iwillfolo][a] +译者:[alim0x](https://github.com/alim0x) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.iwillfolo.com +[1]: http://android-developers.blogspot.co.il/2016/05/android-instant-apps-evolving-apps.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed:+blogspot/hsDu+%28Android+Developers+Blog%29 From 45a22407b4bdfe7f058e908565b85df429565af6 Mon Sep 17 00:00:00 2001 From: martin qi Date: Thu, 9 Jun 2016 23:09:36 +0800 Subject: [PATCH 0885/1469] translating --- ...519 The future of sharing: integrating Pydio and ownCloud.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160519 The future of sharing: integrating Pydio and ownCloud.md b/sources/tech/20160519 The future of sharing: integrating Pydio and ownCloud.md index 0461fda34d..b2174b18c2 100644 --- a/sources/tech/20160519 The future of sharing: integrating Pydio and ownCloud.md +++ b/sources/tech/20160519 The future of sharing: integrating Pydio and ownCloud.md @@ -1,3 +1,5 @@ +martin + The future of sharing: integrating Pydio and ownCloud ========================================================= From 53c908f377bb82320be8a5296bb21a63b891211a Mon Sep 17 00:00:00 2001 From: gitfuture Date: Fri, 10 Jun 2016 01:03:36 +0800 Subject: [PATCH 0886/1469] translating by GitFuture --- ...oxManage On Ubuntu 16.04 And Use Its Command line Options.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160603 How To Install And Use VBoxManage On Ubuntu 16.04 And Use Its Command line Options.md b/sources/tech/20160603 How To Install And Use VBoxManage On Ubuntu 16.04 And Use Its Command line Options.md index 85fabacc56..cb7100fd8a 100644 --- a/sources/tech/20160603 How To Install And Use VBoxManage On Ubuntu 16.04 And Use Its Command line Options.md +++ b/sources/tech/20160603 How To Install And Use VBoxManage On Ubuntu 16.04 And Use Its Command line Options.md @@ -1,3 +1,5 @@ +Translating by GitFuture + How To Install And Use VBoxManage On Ubuntu 16.04 And Use Its Command line Options ====================================================================================== From 3288059be5ee998183a210dcda860623d67f4d31 Mon Sep 17 00:00:00 2001 From: "jianbo.lu" <387852424@qq.com> Date: Fri, 10 Jun 2016 01:06:43 +0800 Subject: [PATCH 0887/1469] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E8=AE=A4=E9=A2=86?= =?UTF-8?q?=E7=BF=BB=E8=AF=91=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 申请认领翻译任务 --- sources/tech/20160601 scp command in Linux.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160601 scp command in Linux.md b/sources/tech/20160601 scp command in Linux.md index f2dd409d49..5e4704d40b 100644 --- a/sources/tech/20160601 scp command in Linux.md +++ b/sources/tech/20160601 scp command in Linux.md @@ -1,3 +1,5 @@ +lujianbo + scp command in Linux ======================= From 0afa7d313a0bba190da271fe9b45e06d785640e8 Mon Sep 17 00:00:00 2001 From: "jianbo.lu" <387852424@qq.com> Date: Fri, 10 Jun 2016 14:55:29 +0800 Subject: [PATCH 0888/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= =?UTF-8?q?=EF=BC=8C=E7=AC=AC=E4=B8=80=E6=AC=A1=E6=8F=90=E4=BA=A4=EF=BC=8C?= =?UTF-8?q?=E7=AD=89=E5=BE=85=E6=A0=A1=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20160601 scp command in Linux.md | 95 +++++++++---------- 1 file changed, 44 insertions(+), 51 deletions(-) diff --git a/sources/tech/20160601 scp command in Linux.md b/sources/tech/20160601 scp command in Linux.md index 5e4704d40b..f4ebfc23c3 100644 --- a/sources/tech/20160601 scp command in Linux.md +++ b/sources/tech/20160601 scp command in Linux.md @@ -1,14 +1,12 @@ -lujianbo - -scp command in Linux +Linux中的scp命令 ======================= ![](https://www.unixmen.com/wp-content/uploads/2016/05/SCP-LOGO-1.jpg) -scp means Secure Copy Protocol, already every Linux/Unix user known about cp command well. scp also works like cp command, cp command copies files or folders from one location i.e source to other location i.e target in local system, but scp copies the files from one host to another host in network. +scp 意味着安全拷贝协议 (Secure Copy Protocol), 和众多Linux/Unix使用者所了解的拷贝(cp)命令一样. scp 的使用方式跟 cp命令是很相似的, cp命令将一个文件或文件夹从本地操作系统的一个位置拷贝到目标位置上,而scp用来将一个文件或者文件夹通过网络传输从一个主机拷贝到另一个主机当中去。 -The usage of the scp command is as follows, here i copy a file named importantfile from local system(10.10.16.147) to Remote system(10.0.0.6) here instead of ip address you can also use System name. +scp命令的使用方法如下所示,在这个例子中,我将一个叫 “imporimposetantfile”的文件从本机(10.10.16.147)拷贝到远程主机(10.0.0.6)中。在这个命令里,你也可以使用主机名字来替代IP地址。 ``` [root@localhost ~]# scp importantfile admin@10.0.0.6:/home/admin/ @@ -22,7 +20,7 @@ importantfile 100% 0 0.0KB/s 00:00 [root@localhost ~]# ``` -Similarly if you want to get a file from remote system you can use scp command as follows +同样的,如果你想从一个远程主机中获取文件,你可以利用如下的scp命令。 ``` [root@localhost ~]# scp root@10.10.16.137:/root/importantfile /home/admin/ @@ -35,55 +33,50 @@ importantfile 100% 0 0.0KB/s 00:00 [root@localhost ~]# ``` -You can also use various options along with scp command like cp command,The man page of the scp command clearly explain about the usage of various options and advantages of that. +你同样可以像cp命令一样,在scp命令中使用不同的选项,scp的man文件详细地阐述了不同选项的用法和优点。 -**Sample Output.** +**简单输出.** ![](https://www.unixmen.com/wp-content/uploads/2016/05/scp.jpg) ``` -The options are as follows: +scp可选参数如下所示: - -B Selects batch mode (prevents asking for passwords or passphrases). + -B 采取批量模式 (prevents asking for passwords or passphrases). - -C Compression enable. Passes the -C to enable compression. + -C 允许压缩. 通过指明-C来开启压缩模式. - -c cipher - Selects the cipher to use for encrypting the data transfer. This - option is directly passed to ssh(1). + -c 加密方式 + 选择在传输过程中用来加密的加密方式 + 这个选项会被直接传递到ssh(1). - -F ssh_config - Specifies an alternative per-user configuration file for ssh. - This option is directly passed to ssh(1). + -F ssh配置 + 为ssh指定一个用来替代默认配置的文件. + 这个选项会被直接传递到ssh(1). - -l limit - Limits the used bandwidth, specified in Kbit/s. + -l 限速 + 限制命令使用的带宽, 默认单位是 Kbit/s. - -P port - Specifies the port to connect to on the remote host. Note that - this option is written with a capital ‘P’, because -p is already - reserved for preserving the times and modes of the file. + -P 端口 + 指定需要的连接的远程主机的端口. + 注意,这个选项使用的是一个大写的"P", 因为小写的 -p 已经用来保留目标文件的时间和模式相关信息。 - -p Preserves modification times, access times, and modes from the - original file. + -p 保留目标文件的修改时间,访问时间以及权限模式. - -q Quiet mode: disables the progress meter as well as warning and - diagnostic messages from ssh(1). + -q 静默模式: 不显示来自ssh(1)命令的进度信息,警告和诊断信息. - -r Recursively copy entire directories. Note that scp follows sym‐ - bolic links encountered in the tree traversal. + -r 递归拷贝整个目录. + 注意,scp命令在树形遍历的时候同样会对符号连接进行相同的处理。 - -v Verbose mode. Causes scp and ssh(1) to print debugging messages - about their progress. This is helpful in debugging connection, - authentication, and configuration problems. + -v 详细模式.scp和ssh(1)将会打印出处理过程中的调试信息.当你要调试连接,认证和配置问题的时候这将会帮助到你。 ``` -The scp command along with -v option you can get detailed information about authentication, debugging information etc. +利用scp命令的-v选项,你可以获得认证,调试相关的处理信息. ![](http://www.unixmen.com/wp-content/uploads/2016/05/scp-v.jpg) -Sample output is like when we pass the option `-v` +当我们使用-v选项的时候,一个简单的输出如下所示 ``` [root@localhost ~]# scp -v abc.txt admin@10.0.0.6:/home/admin @@ -118,59 +111,59 @@ debug1: Exit status 0 [root@localhost ~]# ``` -If we need to copy the Directories or folders we can use the option –r. It Recursively copy entire directories +当我们需要拷贝一个目录或者文件夹的时候,我们可以使用-r选项,它会递归拷贝整个目录。 ![](http://www.unixmen.com/wp-content/uploads/2016/05/scp-with-r.jpg) -Quiet mode: +静默模式: -If you want disables the progress meter as well as warning and diagnostic messages pass the argument -q along with scp command. +如果你想要关闭进度信息以及警告和诊断信息,你可以通过使用scp命令中的-q选项. ![](http://www.unixmen.com/wp-content/uploads/2016/05/scp-with-q.jpg) -last time we pass the argument -r only then it shows the information file by file, but when we pass the argument -q it disables the progress meter this time. +上一次我们仅仅使用-r参数,它显示了逐个文件的信息,但这一次当我们使用了-q参数,它就不显示进度信息. -Preserves modification times, access times, and modes from the original file by passing the option -p along with scp. +利用scp的-p选项来保留目标文件的更新时间,访问时间和权限模式. ![](http://www.unixmen.com/wp-content/uploads/2016/05/scp-with-p.jpg) -Specifies the port to connect to on the remote host by using the option -P. -scp uses the ssh to transfer the files between hosts, ssh uses the port number 22 so the scp also uses the same port number 22. +通过 -P 选项来指定远程主机的连接端口。 +scp使用ssh命令来在两个主机之间传输文件,因为ssh使用的是22端口号,所以scp也使用相同的22端口号. -If we want to change the port number we can pass the particular port number along with -P(capital P because small p uses for preserving access time etc.) +如果我们希望改变这个端口号,我们可以使用-P(大写的P,因为小写的p用来保存文件的访问时间等) 选项来指定所需的端口号 -for example if we want to use port number 2222 then the command is as follows +举个例子,如果我们想要使用2222端口号,我们可以使用如下的命令 ``` [root@localhost ~]# scp -P 2222 abcd1 root@10.10.16.137:/root/ ``` -**Limits the used bandwidth, specified in Kbit/s** +**限制命令使用的带宽, 指定的单位是 Kbit/s** -we can limit the bandwidth by using the argument -l option as follows. here i used the limit is 512kbit/s +如下所示,我们可以使用-l参数来指定scp命令所使用的带宽,在此我们将速度限制为512kbit/s ![](http://www.unixmen.com/wp-content/uploads/2016/05/scp-with-l.jpg) -**Compression enable** +**开启压缩** -we can enable the compression mode when we transfer the data through scp command to save tha bandwidth and time as follows +如下所示,我们可以通过开启scp命令的压缩模式来节省传输过程中的带宽和时间 ![](https://www.unixmen.com/wp-content/uploads/2016/05/scp-with-C.jpg) -**Selects the cipher to use for encrypting the data** +**选择加密数据的加密方式** -By default scp uses AES-128, if we want to change the encryption then we can pass the argument -c(small c) along with scp. +scp默认使用 AES-128的加密方式,如果我们想要改变这个加密方式,可以通过-c(小写的c) 参数来指定其他的加密方式 ![](http://www.unixmen.com/wp-content/uploads/2016/05/scp-with-cipher.jpg) -Now you can transfer the files between different nodes in your network securely by using scp(Secure copy). +现在你可以利用scp(Secure copy)命令在你所属网络中的两个结点之间安全地拷贝文件了. -------------------------------------------------------------------------------- via: https://www.unixmen.com/scp-command-linuxunix/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+unixmenhowtos+%28Unixmen+Howtos+%26+Tutorials%29 作者:[Naga Ramesh][a] -译者:[译者ID](https://github.com/译者ID) +译者:[译者ID](https://github.com/lujianbo) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 99fe7e0194a82f23c9e5a3ddf80744c60a239a0e Mon Sep 17 00:00:00 2001 From: "jianbo.lu" <387852424@qq.com> Date: Fri, 10 Jun 2016 15:26:06 +0800 Subject: [PATCH 0889/1469] =?UTF-8?q?=E9=A2=86=E5=8F=96=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...9 LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160529 LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS.md b/sources/tech/20160529 LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS.md index d532b0b464..9acb54f918 100644 --- a/sources/tech/20160529 LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS.md +++ b/sources/tech/20160529 LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS.md @@ -1,3 +1,4 @@ +lujianbo LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS ========================================================= From 465d5f834adc0fcbdb66893dc67cbc1c6fa171b9 Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 10 Jun 2016 05:16:27 -0500 Subject: [PATCH 0890/1469] =?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 移动目录,补齐译者id --- {sources => translated}/tech/20160601 scp command in Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename {sources => translated}/tech/20160601 scp command in Linux.md (99%) diff --git a/sources/tech/20160601 scp command in Linux.md b/translated/tech/20160601 scp command in Linux.md similarity index 99% rename from sources/tech/20160601 scp command in Linux.md rename to translated/tech/20160601 scp command in Linux.md index f4ebfc23c3..949409ff44 100644 --- a/sources/tech/20160601 scp command in Linux.md +++ b/translated/tech/20160601 scp command in Linux.md @@ -163,7 +163,7 @@ scp默认使用 AES-128的加密方式,如果我们想要改变这个加密方 via: https://www.unixmen.com/scp-command-linuxunix/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+unixmenhowtos+%28Unixmen+Howtos+%26+Tutorials%29 作者:[Naga Ramesh][a] -译者:[译者ID](https://github.com/lujianbo) +译者:[lujianbo](https://github.com/lujianbo) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From f2eae7b83e7f8387ec105cd0d1b1e4ce366755c4 Mon Sep 17 00:00:00 2001 From: "jianbo.lu" <387852424@qq.com> Date: Fri, 10 Jun 2016 23:12:08 +0800 Subject: [PATCH 0891/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= =?UTF-8?q?=20(#4049)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...lation Guide on Ubuntu Server 16.04 LTS.md | 160 ----------------- ...lation Guide on Ubuntu Server 16.04 LTS.md | 162 ++++++++++++++++++ 2 files changed, 162 insertions(+), 160 deletions(-) delete mode 100644 sources/tech/20160529 LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS.md create mode 100644 translated/tech/20160529 LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS.md diff --git a/sources/tech/20160529 LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS.md b/sources/tech/20160529 LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS.md deleted file mode 100644 index 9acb54f918..0000000000 --- a/sources/tech/20160529 LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS.md +++ /dev/null @@ -1,160 +0,0 @@ -lujianbo -LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS -========================================================= - -LAMP stack is a collection of free and open source softwares like **Linux**, Web Server (**Apache**), Database server (**MySQL / MariaDB**) and **PHP** (Scripting Language). LAMP is the platform which is required to install and build dynamic web sites and application like WordPress, Joomla, OpenCart and Drupal. - -In this article i will describe how to install LAMP on Ubuntu Server 16.04 LTS, As We know that Ubuntu is a Linux based Operating system, so it provides the first component of LAMP and i am assuming Ubuntu Server 16.04 is already installed on your system. - -### Installation of Web Server (Apache2) : - -In Ubuntu Linux Web server comes with the name Apache2, Use the beneath apt command to install it. - -``` -linuxtechi@ubuntu:~$ sudo apt update -linuxtechi@ubuntu:~$ sudo apt install apache2 -y -``` - -When Apache2 package is installed then its service is automatically started and enabled across the reboot, In case it is not started and enabled, use the following command : - -``` -linuxtechi@ubuntu:~$ sudo systemctl start apache2.service -linuxtechi@ubuntu:~$ sudo systemctl enable apache2.service -linuxtechi@ubuntu:~$ sudo systemctl status apache2.service -``` - -If Ubuntu firewall (ufw) is active, then allow the Web Server ports (80 and 443) in firewall using below commands. - -``` -linuxtechi@ubuntu:~$ sudo ufw status -Status: active -linuxtechi@ubuntu:~$ sudo ufw allow in 'Apache Full' -Rule added -Rule added (v6) -linuxtechi@ubuntu:~$ -``` - -### Access Web Server now : - -Open the Web browser and type the IP Address or Host name of your server (http://IP_Address_OR_Host_Name), In my Case my server IP is ‘192.168.1.13’ - -![](http://www.linuxtechi.com/wp-content/uploads/2016/05/Apache2-Ubuntu-server-16.04-1024x955.jpg) - -### Installation of Data Base Server (MySQL Server 5.7) : - -MySQL and MariaDB are the database servers in Ubuntu 16.04. MySQL Server and MariaDB Server’s packages are available in the default repositories and we can install either of the database. Run the following apt command to install MySQL Server from terminal. - -``` -linuxtechi@ubuntu:~$ sudo apt install mysql-server mysql-client -``` - -During the installation, it will prompt us to set the root password of mysql server. - -![](http://www.linuxtechi.com/wp-content/uploads/2016/05/Enter-root-password-mysql-server-ubuntu-16-04.jpg) - -Confirm root password and click on ‘OK’ - -![](http://www.linuxtechi.com/wp-content/uploads/2016/05/confirm-root-password-mysql-server-ubuntu-16-04.jpg) - -Installation of MySQL Server is completed Now. MySQL Service will be started and enabled automatically.We can verify the MySQL Server’s service using below systemcl command : - -``` -linuxtechi@ubuntu:~$ sudo systemctl status mysql.service -``` - -### Installation of MariaDB Server : - -Use the beneath command to install MariaDB Server 10.0 from the terminal. - -``` -linuxtechi@ubuntu:~$ sudo apt install mariadb-server -``` - -Run the following command to set root password of mariadb and disable other options like disable remote login. - -``` -linuxtechi@ubuntu:~$ sudo mysql_secure_installation -``` - -### Installation of PHP ( Scripting Language ) : - -PHP 7.0 is available in the Ubuntu repositories. Execute the beneath command from the terminal to install PHP 7 : - -``` -linuxtechi@ubuntu:~$ sudo apt install php7.0-mysql php7.0-curl php7.0-json php7.0-cgi php7.0 libapache2-mod-php7.0 -``` - -Create a sample php page and place it in apache document root (/var/ww/html) - -``` -linuxtechi@ubuntu:~$ vi samplepage.php - -``` - -Save and exit the file. - -``` -linuxtechi@ubuntu:~$ sudo mv samplepage.php /var/www/html/ -``` - -Now Access the sample PHP page from the Web Browser, type : “http:///samplepage.php” , You should get the page like below. - -![](http://www.linuxtechi.com/wp-content/uploads/2016/05/Sample-PHP-Page-Ubuntu-Server-16-04.jpg) - -Above Page shows that our PHP installation is completed successfully. - -### Installation of phpMyAdmin : - -phpMyAdmin allows us to perform all the database related administrative and other DB operation task from its web interface. Its package is already listed in the Ubuntu server repositories. - -Use the below commands to Install phpMyAdmin on Ubuntu server 16.04 LTS. - -``` -linuxtechi@ubuntu:~$ sudo apt install php-mbstring php7.0-mbstring php-gettext -linuxtechi@ubuntu:~$ sudo systemctl restart apache2.service -linuxtechi@ubuntu:~$ sudo apt install phpmyadmin -``` - -During its installation it will prompt us to choose the Web server to be configured for phpMyAdmin. - -Select Apache2 and Click on OK. - -![](http://www.linuxtechi.com/wp-content/uploads/2016/05/Web-Server-for-phpMyAdmin-Ubuntu-Server-16-04.jpg) - -Click on ‘Yes’ to Configure database for phpMyAdmin. - -![](http://www.linuxtechi.com/wp-content/uploads/2016/05/configure-database-for-phpmyadmin-ubuntu-server-16-04.jpg) - -Specify the password for phpMyAdmin to register with Database Server. - -![](http://www.linuxtechi.com/wp-content/uploads/2016/05/Select-Password-for-phpMyadmin-ubuntu-16-04-1024x433.jpg) - -Confirm the password for phpMyAdmin and then click on ‘OK’ - -![](http://www.linuxtechi.com/wp-content/uploads/2016/05/confirm-password-for-phpmyadmin-ubuntu-server-16-04.jpg) - -Now try to access the phpMyAdmin, open the browser type : “http://Server_IP_OR_Host_Name/phpmyadmin” - -Use the user name as ‘root’ and password that we set during the installation. - -![](http://www.linuxtechi.com/wp-content/uploads/2016/05/phpMyAdmin-Ubuntu-Server-16-04-1024x557.jpg) - -When we click on ‘Go’, it will redirect the page to ‘phpMyAdmin’ Web interface as shown below. - -![](http://www.linuxtechi.com/wp-content/uploads/2016/05/phpMyAdmin-portal-overview-ubuntu-server-16-04-1024x557.jpg) - -That’s it, LAMP stack is successfully installed and is ready for use 🙂 . Please share your feedback and comments. - --------------------------------------------------------------------------------- - -via: http://www.linuxtechi.com/lamp-stack-installation-on-ubuntu-server-16-04/ - -作者:[Pradeep Kumar][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://www.linuxtechi.com/author/pradeep/ diff --git a/translated/tech/20160529 LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS.md b/translated/tech/20160529 LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS.md new file mode 100644 index 0000000000..a687e87a30 --- /dev/null +++ b/translated/tech/20160529 LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS.md @@ -0,0 +1,162 @@ +在 Ubuntu Server 16.04 LTS 上安装 LAMP +========================================================= + +LAMP方案是一系列自由和开源软件的集合,包含了 **Linux**, web服务器 (**Apache**), 数据库服务器 (**MySQL / MariaDB**) 和 **PHP** (脚本语言). LAMP是那些需要安装和构建动态网页应用的基础平台,比如WordPress, Joomla, OpenCart and Drupal。 + +在这篇文章中,我将描述如何在Ubuntu Server 16.04 LTS 上安装LAMP,众所周知Ubuntu是一个基于linux的操作系统,因此它构成了LAMP的第一个部分,在接下来的操作中,我将默认你已经安装了 Ubuntu Server 16.04。 + +### Apache2 web服务器的安装 : + +在Ubuntu linux中,web 服务器称之为 Apache2,我们可以利用下面的命令来安装它 + +``` +linuxtechi@ubuntu:~$ sudo apt update +linuxtechi@ubuntu:~$ sudo apt install apache2 -y +``` + +当安装Apache2包之后,Apache2相关的服务将会在重启后变成可用状态和自动运行,在某些情况下,如果你的Apache2服务并没有自动可用和启动,你可以利用如下命令来启用它。 + +``` +linuxtechi@ubuntu:~$ sudo systemctl start apache2.service +linuxtechi@ubuntu:~$ sudo systemctl enable apache2.service +linuxtechi@ubuntu:~$ sudo systemctl status apache2.service +``` + +如果你开启了Ubuntu的防火墙(ufw),那么你可以使用如下的命令来解除web服务器的端口(80和443)限制 + +``` +linuxtechi@ubuntu:~$ sudo ufw status +Status: active +linuxtechi@ubuntu:~$ sudo ufw allow in 'Apache Full' +Rule added +Rule added (v6) +linuxtechi@ubuntu:~$ +``` + +### 现在开始访问你的web服务器 : + +打开浏览器并输入服务器的IP地址或者主机名 +(http://IP_Address_OR_Host_Name),在我的例子中我的服务器IP是‘192.168.1.13’ + +![](http://www.linuxtechi.com/wp-content/uploads/2016/05/Apache2-Ubuntu-server-16.04-1024x955.jpg) + +### 数据库服务器的安装r (MySQL Server 5.7) : + +MySQL 和 MariaDB 都是 Ubuntu 16.04 中的数据库服务器. MySQL Server 和 MariaDB Server的安装包都可以在Ubuntu的默认软件源中找到,我们可以选择其中的一个来安装.通过下面的命令来在终端中安装mysql服务器 + +``` +linuxtechi@ubuntu:~$ sudo apt install mysql-server mysql-client +``` + +在安装过程中,它会要求你设置mysql服务器root帐户的密码. + +![](http://www.linuxtechi.com/wp-content/uploads/2016/05/Enter-root-password-mysql-server-ubuntu-16-04.jpg) + +确认root帐户的密码,并点击确定 + +![](http://www.linuxtechi.com/wp-content/uploads/2016/05/confirm-root-password-mysql-server-ubuntu-16-04.jpg) + +Mysql 服务器的安装到此已经结束了, MySQL 服务会自动变成可用状态和自动启动.我们可以通过如下的命令来校验Mysql服务的状态 + +``` +linuxtechi@ubuntu:~$ sudo systemctl status mysql.service +``` + +### MariaDB Server的安装 : + +在终端中利用如下的命令来安装 Mariadb 10.0 服务器。 + +``` +linuxtechi@ubuntu:~$ sudo apt install mariadb-server +``` + +运行如下的命令来设置mariadb root帐户的密码,还可以用来关闭某些选项,比如关闭远程登录功能。 + +``` +linuxtechi@ubuntu:~$ sudo mysql_secure_installation +``` + +### PHP脚本语言的安装: + +PHP 7 已经存在于Ubuntu的软件源中了,在终端中执行如下的命令来安装PHP 7: + +``` +linuxtechi@ubuntu:~$ sudo apt install php7.0-mysql php7.0-curl php7.0-json php7.0-cgi php7.0 libapache2-mod-php7.0 +``` + +创建一个简单的php页面,并且将它移动到 apache的文档根目录下 (/var/ww/html) + +``` +linuxtechi@ubuntu:~$ vi samplepage.php + +``` + +在vi中编辑之后,保存并退出该文件。 + +``` +linuxtechi@ubuntu:~$ sudo mv samplepage.php /var/www/html/ +``` + +现在你可以从web浏览器中访问这个页面, +输入 : “http:///samplepage.php” ,你可以看到如下页面. + +![](http://www.linuxtechi.com/wp-content/uploads/2016/05/Sample-PHP-Page-Ubuntu-Server-16-04.jpg) + +以上的页面向我们展示了PHP已经完全安装成功了 + +### phpMyAdmin的安装: + +phpMyAdmin可以让我们通过它的web界面来执行所有和数据库管理和其他数据库操作相关的任务,这个安装包已经存在于Ubuntu的软件源中 + +利用如下的命令来在Ubuntu server 16.04 LTS中安装phpMyAdmin + +``` +linuxtechi@ubuntu:~$ sudo apt install php-mbstring php7.0-mbstring php-gettext +linuxtechi@ubuntu:~$ sudo systemctl restart apache2.service +linuxtechi@ubuntu:~$ sudo apt install phpmyadmin +``` + +在以下的安装过程中,它会提示我们选择phpMyAdmin运行的目标服务器 + + +选择 Apache2 并点击确定 + +![](http://www.linuxtechi.com/wp-content/uploads/2016/05/Web-Server-for-phpMyAdmin-Ubuntu-Server-16-04.jpg) + +点击确定来配置phpMyAdmin管理的数据库 + +![](http://www.linuxtechi.com/wp-content/uploads/2016/05/configure-database-for-phpmyadmin-ubuntu-server-16-04.jpg) + +指定phpMyAdmin向数据库服务器注册时所用的密码 + +![](http://www.linuxtechi.com/wp-content/uploads/2016/05/Select-Password-for-phpMyadmin-ubuntu-16-04-1024x433.jpg) + +确认phpMyAdmin所需的密码,并点击确认 + +![](http://www.linuxtechi.com/wp-content/uploads/2016/05/confirm-password-for-phpmyadmin-ubuntu-server-16-04.jpg) + +现在可以开始尝试访问phpMyAdmin, 打开浏览器并输入 : “http://Server_IP_OR_Host_Name/phpmyadmin” + +利用我们安装时设置的 root帐户和密码 + +![](http://www.linuxtechi.com/wp-content/uploads/2016/05/phpMyAdmin-Ubuntu-Server-16-04-1024x557.jpg) + +当我们点击“Go”的时候,将会重定向到如下所示的 ‘phpMyAdmin’web界面 + +![](http://www.linuxtechi.com/wp-content/uploads/2016/05/phpMyAdmin-portal-overview-ubuntu-server-16-04-1024x557.jpg) + +到现在,LAMP方案已经被成功安装和使用了,欢迎分享你的反馈和评论。 + +-------------------------------------------------------------------------------- + +via: http://www.linuxtechi.com/lamp-stack-installation-on-ubuntu-server-16-04/ + +作者:[Pradeep Kumar][a] +译者:[陆建波](https://github.com/lujianbo) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.linuxtechi.com/author/pradeep/ \ No newline at end of file From 27b6798e0af2cb973f4440438f1e7d2c013fc3aa Mon Sep 17 00:00:00 2001 From: gitfuture Date: Sat, 11 Jun 2016 10:56:15 +0800 Subject: [PATCH 0892/1469] Translated by GitFuture --- ... 16.04 And Use Its Command line Options.md | 140 ------------------ ... 16.04 And Use Its Command line Options.md | 138 +++++++++++++++++ 2 files changed, 138 insertions(+), 140 deletions(-) delete mode 100644 sources/tech/20160603 How To Install And Use VBoxManage On Ubuntu 16.04 And Use Its Command line Options.md create mode 100644 translated/tech/20160603 How To Install And Use VBoxManage On Ubuntu 16.04 And Use Its Command line Options.md diff --git a/sources/tech/20160603 How To Install And Use VBoxManage On Ubuntu 16.04 And Use Its Command line Options.md b/sources/tech/20160603 How To Install And Use VBoxManage On Ubuntu 16.04 And Use Its Command line Options.md deleted file mode 100644 index cb7100fd8a..0000000000 --- a/sources/tech/20160603 How To Install And Use VBoxManage On Ubuntu 16.04 And Use Its Command line Options.md +++ /dev/null @@ -1,140 +0,0 @@ -Translating by GitFuture - -How To Install And Use VBoxManage On Ubuntu 16.04 And Use Its Command line Options -====================================================================================== - -VirtualBox comes with a suite of command line utilities, and you can use the VirtualBox command line interfaces (CLIs) to manage VMs on a remote headless server. In this tutorial, we will show you how to create and start a VM without VirtualBox GUI using VBoxManage. VBoxManage is the command-line interface to VirtualBox taht you can use to completely control VirtualBox from the command line of your host operating system. VBoxManage supports all the features that the graphical user interface gives you access to, but it supports a lot more than that. It exposes really all the features of the virtualization engine, even those that cannot (yet) be accessed from the GUI. You will need to use the command line if you want to use a different user interface than the main GUI and control some of the more advanced and experimental configuration settings for a VM. - -You will find VBoxManage helpful when you want to create and run virtual machines (VMs) on VirtualBox, but you only have access to a terminal on a remote host machine. This can be a common situation for servers where VMs are managed from remotely. - -### Prerequisites - -Before we start using VBoxManage command line utility, make sure that you have root or sudo user access to your Ubuntu 16.04 server and the Oracle Virtual Box is already installed on it. Then you need to install VirtualBox Extension Pack which is needed to run a VRDE remote desktop server used to access headless VMs. - -### Installing VBoxManage - -You can get your required package by following the link to [Virtual Box Download Page][1] to get the latest extension pack, same version as your installed version of VirtualBox!. - -![](http://linuxpitstop.com/wp-content/uploads/2016/06/12.png) - -You can also make use of below command to get the VBoxManage extension on your system - -``` -$ wget http://download.virtualbox.org/virtualbox/5.0.20/Oracle_VM_VirtualBox_Extension_Pack-5.0.20-106931.vbox-extpack -``` - -![](http://linuxpitstop.com/wp-content/uploads/2016/06/21.png) - -Run the below command to confirm that VBoxManage has been successfully installed. - -``` -$ VBoxManage list extpacks -``` - -![](http://linuxpitstop.com/wp-content/uploads/2016/06/31.png) - -### Using VBoxManage on Ubuntu 16.04 - -Now we are going to use VBoxManage to show you that how easily you can create and manage your virtual machines by using this utility from command line terminal. - -Let’s run the below command to create a virtual machine for Ubuntu OS. - -``` -# VBoxManage createvm --name Ubuntu16.04 --register -``` - -After executing this command it will create virtual machine called “Ubuntu16.vbox” in home folder under “VirtualBox VMs/Ubuntu16/Ubuntu16.04.vbox” . In the above command, “createvm” is used to create a virtual machine and “–name“ defines the name of the virtual machine while “registervm” command is used to register the virtual machine. - -Now, create the hard disk image for the virtual machine using the below command. - -``` -$ VBoxManage createhd --filename Ubuntu16.04 --size 5124 -``` - -Here “createhd” is used to create hard disk image and “–filename” is used to specify the virtual machine’s name, for which the hard disk image is created. Here, “–size” denotes the size of the hard disk image. The size is always given in MB. Here we have specified 5Gb that is 5124MB. - -Next we will set the OS type, if the Linux OS has to be installed, then specify the OS type as Linux or Ubuntu Or Fedora etc using below command. - -``` -$ VBoxManage modifyvm Ubuntu16.04 --ostype Ubuntu -``` - -Use below command to set the memory size for the virtual OS, i.e. the ram size for the virtual OS from the host Machine. - -``` -$ VBoxManage modifyvm Ubuntu10.10 --memory 512 -``` - -![](http://linuxpitstop.com/wp-content/uploads/2016/06/52.png) - -Now we are going to create a storage controller for the virtual machine by using below command. - -``` -$ VBoxManage storagectl Ubuntu16.04 --name IDE --add ide --controller PIIX4 --bootable on -``` - -Here in above command ‘storagectl’ is used to create a storage controller for virtual machine,’–name’ specifies the name of the storage controller that needs to be created, modified or removed from the virtual machine. Then ‘–add’ defines the type of system bus to which the storage controller must be connected. Its available options are ide/sata/scsi/floppy. The ‘–controller’ option allows to choose the type of chipset that is to be emulated for the given storage controller while its available options are LsiLogic / LSILogicSAS / BusLogic / IntelAhci / PIIX3 / PIIX4 / ICH6 / I82078. At the end ‘–bootable’ defines whether this controller is bootable or not. - -The above command creates the storage controller called IDE. Later the virtual media can be attached to the controller using ‘storageattach’ command. - -Now run below command to create a storage controller called SATA, that will be used to attach the hard disk image to this later. - -``` -$ VBoxManage storagectl Ubuntu16.04 --name SATA --add sata --controller IntelAhci --bootable on -``` - -Attach the previously created disk image as well as CD/DVD drive to the IDE controller. Ubuntu installation ISO image which is then inserted to the CD/DVD drive. Now, attach the storage controller to the virtual machine using ‘storageattach’ command. - -``` -$ VBoxManage storageattach Ubuntu16.04 --storagectl SATA --port 0 --device 0 --type hdd --medium "your_iso_filepath" -``` - -This will attach the storage controller SATA to virtual machine Ubuntu16.04 with the medium i.e., to the virtual disk image which is created. - -Run below commands to add some features like networking setup, audio, etc. - -``` -$ VBoxManage modifyvm Ubuntu10.10 --nic1 nat --nictype1 82540EM --cableconnected1 on -$ VBoxManage modifyvm Ubuntu10.10 --vram 128 --accelerate3d on --audio alsa --audiocontroller ac97 -``` - -Now, start the VM by using the below command by specifying the name of the VM that you wish to start. - -``` - $ VBoxManage startvm Ubuntu16.04 -``` - -A new window will be opened where you new VM be booted from your attached file. - -![](http://linuxpitstop.com/wp-content/uploads/2016/06/62.png) - -To stop the virtual machine , you can make use of the following command. - -``` -$ VBoxManage controlvm Ubuntu16.04 poweroff -``` - -The ‘controlvm’ command is used to control the state of the virtual machine. Some of the available options are pause / resume / reset / poweroff / savestate / acpipowerbutton / acpisleepbutton. There are many options in controlvm to see all the options available in it, run below command. - -``` -$VBoxManage controlvm -``` - -![](http://linuxpitstop.com/wp-content/uploads/2016/06/81.png) - -Conclusion - -In this article we have learned about an awesome tool of Oracle Virtual Box that is VBoxManage, that includes its installation and usage on Ubuntu 16.04 Operating system. The article includes a detailed instructions about its useful commands to create and manage your virtual machines using VBoxManage. Hope you find this much helpful, do not forget to share your comments or suggestions. - --------------------------------------------------------------------------------- - -via: http://linuxpitstop.com/install-and-use-command-line-tool-vboxmanage-on-ubuntu-16-04/ - -作者:[Kashif][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/kashif/ -[1]: https://www.virtualbox.org/wiki/Downloads diff --git a/translated/tech/20160603 How To Install And Use VBoxManage On Ubuntu 16.04 And Use Its Command line Options.md b/translated/tech/20160603 How To Install And Use VBoxManage On Ubuntu 16.04 And Use Its Command line Options.md new file mode 100644 index 0000000000..fec5b55c6c --- /dev/null +++ b/translated/tech/20160603 How To Install And Use VBoxManage On Ubuntu 16.04 And Use Its Command line Options.md @@ -0,0 +1,138 @@ +在 Ubuntu 16.04 上安装使用 VBoxManage 以及 VBoxManage 命令行选项的用法 +================= + +VirtualBox 拥有一套命令行工具,然后你可以使用 VirtualBox 的命令行界面 (CLI) 对远端无界面的服务器上的虚拟机进行管理操作。在这篇教程中,你将会学到如何在没有 GUI 的情况下使用 VBoxManage 创建、启动一个虚拟机。VBoxManage 是 VirtualBox 的命令行界面,你可以在你的主机操作系统的命令行中来用它实现对 VirtualBox 的所有操作。VBoxManage 拥有图形化用户界面所支持的全部功能,而且它支持的功能远不止这些。它提供虚拟引擎的所有功能,甚至包含 GUI 还不能实现的那些功能。如果你想尝试不同的用户界面而不仅仅是 GUI,或者更改虚拟机更多高级和实验性的配置,那么你就需要用到命令行。 + +当你想要在 VirtualBox 上创建或运行虚拟机时,你会发现 VBoxManage 非常有用,你只需要使用远程主机的终端就够了。这对于服务器来说是一种常见的情形,因为在服务器上需要进行虚拟机的远程操作。 + +### 准备工作 + +在开始使用 VBoxManage 的命令行工具前,确保在运行着 Ubuntu 16.04 的服务器上,你拥有超级用户的权限或者你能够使用 sudo 命令,而且你已经在服务器上安装了 Oracle Virtual Box。 然后你需要安装 VirtualBox 扩展包,这是运行远程桌面环境,访问无界面启动虚拟机所必须的。(headless的翻译拿不准,翻译为无界面启动) + +### 安装 VBoxManage + +通过 [Virtual Box Download Page][1] 这个链接,你能够获取你所需要的软件扩展包的最新版本,扩展包的版本和你安装的 VirtualBox 版本需要一致! + +![](http://linuxpitstop.com/wp-content/uploads/2016/06/12.png) + +也可以用下面这条命令来获取 VBoxManage 扩展。 + +``` +$ wget http://download.virtualbox.org/virtualbox/5.0.20/Oracle_VM_VirtualBox_Extension_Pack-5.0.20-106931.vbox-extpack +``` + +![](http://linuxpitstop.com/wp-content/uploads/2016/06/21.png) + +运行下面这条命令,确认 VBoxManage 已经成功安装在你的机器上。 + +``` +$ VBoxManage list extpacks +``` + +![](http://linuxpitstop.com/wp-content/uploads/2016/06/31.png) + +### 在 Ubuntu 16.04 上使用 VBoxManage + +接下来我们将要使用 VBoxManage 向你展现通过命令行终端工具来新建和管理虚拟机是多么的简单。 + +运行下面的命令,新建一个将用来安装 Ubuntu 系统的虚拟机。 + +``` +# VBoxManage createvm --name Ubuntu16.04 --register +``` + +在运行了这条命令之后,VBoxMnage 将会新建一个叫 做“Ubuntu16.vbox” 的虚拟机,这个虚拟机的位置是家目录路径下的 “VirtualBox VMs/Ubuntu16/Ubuntu16.04.vbox”。在上面这条命令中,“createvm” 是用来新建虚拟机,“--name” 定义了虚拟机的名字,而 “registervm” 命令是用来注册虚拟机的。 + +现在,使用下面这条命令为虚拟机创建一个硬盘镜像。 + +``` +$ VBoxManage createhd --filename Ubuntu16.04 --size 5124 +``` + +这里,“createhd” 用来创建硬盘镜像,“--filename” 用来指定虚拟机的名称,也就是创建的硬盘镜像名称。“--size” 表示硬盘镜像的空间容量,空间容量的单位总是 MB。我们指定了 5Gb,也就是 5124 MB。 + +接下来我们需要设置操作系统类型,如果要安装 Linux 系的系统,那么用下面这条命令指定系统类型为 Linux 或者 Ubuntu 或者 Fedora 之类的。 + +``` +$ VBoxManage modifyvm Ubuntu16.04 --ostype Ubuntu +``` + +用下面这条命令来设置虚拟系统的内存大小,也就是从主机中分配到虚拟机系统的内存。 + +``` +$ VBoxManage modifyvm Ubuntu10.10 --memory 512 +``` + +![](http://linuxpitstop.com/wp-content/uploads/2016/06/52.png) + +现在用下面这个命令为虚拟机创建一个存储控制器。 + +``` +$ VBoxManage storagectl Ubuntu16.04 --name IDE --add ide --controller PIIX4 --bootable on +``` + +这里的 “storagect1” 是给虚拟机创建存储控制器的,“--name” 指定了虚拟机里需要创建、更改或者移除的存储控制器的名称。“--add” 选项指明系统总线类型,可选的选项有 ide / sata / scsi / floppy,存储控制器必须要连接到系统总线。“--controller” 选择主板的类型,主板需要根据需要的存储控制器选择,可选的选项有 LsiLogic / LSILogicSAS / BusLogic / IntelAhci / PIIX3 / PIIX4 / ICH6 / I82078。最后的 “--bootable” 表示控制器是否可以引导。 + +上面的命令创建了叫做 IDE 的存储控制器。然后虚拟设备就能通过 “storageattach” 命令连接到控制器。 + +然后运行下面这个命令来创建一个叫做 SATA 的存储控制器,它将会连接到硬盘镜像上。 + +``` +$ VBoxManage storagectl Ubuntu16.04 --name SATA --add sata --controller IntelAhci --bootable on +``` + +将之前创建的硬盘镜像和 CD/DVD 驱动器加载到 IDE 控制器。将 Ubuntu 的安装光盘插到 CD/DVD 驱动器上。然后用 “storageattach” 命令连接存储控制器和虚拟机。 + +``` +$ VBoxManage storageattach Ubuntu16.04 --storagectl SATA --port 0 --device 0 --type hdd --medium "your_iso_filepath" +``` + +用媒体把 SATA 存储控制器连接到 Ubuntu16.04 虚拟机中,也就是之前创建的虚拟硬盘镜像里。 + +运行下面的命令添加像网络连接,音频之类的功能。 + +``` +$ VBoxManage modifyvm Ubuntu10.10 --nic1 nat --nictype1 82540EM --cableconnected1 on +$ VBoxManage modifyvm Ubuntu10.10 --vram 128 --accelerate3d on --audio alsa --audiocontroller ac97 +``` + +通过指定你想要启动虚拟机的名称,用下面这个命令启动虚拟机。 + +``` + $ VBoxManage startvm Ubuntu16.04 +``` + +然后会打开一个新窗口,新窗口里虚拟机通过关联文件中引导。 + +![](http://linuxpitstop.com/wp-content/uploads/2016/06/62.png) + +你可以用接下来的命令来关掉虚拟机。 + +``` +$ VBoxManage controlvm Ubuntu16.04 poweroff +``` + +“controlvm” 命令用来控制虚拟机的状态,可选的选项有 pause / resume / reset / poweroff / savestate / acpipowerbutton / acpisleepbutton。controlvm 有很多选项,用下面这个命令来查看它支持的所有选项。 + +``` +$VBoxManage controlvm +``` + +![](http://linuxpitstop.com/wp-content/uploads/2016/06/81.png) + +完结! + +从这篇文章中,我们了解了 Oracle Virtual Box 中一个十分实用的工具,就是 VBoxManage,包含了 VBoxManage 的安装和在 Ubuntu 16.04 系统上的使用。文章包含详细的教程, 通过 VBoxManage 中实用的命令来创建和管理虚拟机。希望这篇文章对你有帮助,另外别忘了分享你的评论或者建议。 + +-------------------------------------------------------------------------------- + +via: http://linuxpitstop.com/install-and-use-command-line-tool-vboxmanage-on-ubuntu-16-04/ + +作者:[Kashif][a] +译者:[GitFuture](https://github.com/GitFuture) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://linuxpitstop.com/author/kashif/ +[1]: https://www.virtualbox.org/wiki/Downloads From 07a89269ec51c6bcf223dbf107e3340134413229 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 11 Jun 2016 11:14:17 +0800 Subject: [PATCH 0893/1469] PUB:20160218 A Linux-powered microwave oven @yuba0604 --- ...20160218 A Linux-powered microwave oven.md | 30 +++++++------------ 1 file changed, 11 insertions(+), 19 deletions(-) rename {translated/tech => published}/20160218 A Linux-powered microwave oven.md (54%) diff --git a/translated/tech/20160218 A Linux-powered microwave oven.md b/published/20160218 A Linux-powered microwave oven.md similarity index 54% rename from translated/tech/20160218 A Linux-powered microwave oven.md rename to published/20160218 A Linux-powered microwave oven.md index 57aaace3a7..4b0c132694 100644 --- a/translated/tech/20160218 A Linux-powered microwave oven.md +++ b/published/20160218 A Linux-powered microwave oven.md @@ -1,9 +1,9 @@ -一个Linux驱动的微波炉 +一个 Linux 驱动的微波炉 ================================================================================ -[linux.conf.au](http://linux.conf.au/)里的人们都有一种想到什么就动手去实现的想法。随着硬件开源运动不断地发展壮大,这种想法越来越多,与现实世界联系的越来越紧密,而不仅仅存在于数字世界中。David Tulloh用他制作的[Linux驱动的微波炉 [WebM]](http://mirror.linux.org.au/linux.conf.au/2016/04_Thursday/D4.303_Costa_Theatre/Linux_driven_microwave.webm)来展示一个差劲的微波炉会多么难用以及说明他的项目可以改造这些微波炉使得它们不那么讨人厌。 +[linux.conf.au](http://linux.conf.au/)里的人们都有一种想到什么就动手去实现的想法。随着硬件开源运动不断地发展壮大,这种想法越来越多,也与现实世界联系的越来越紧密,而不仅仅存在于数字世界中。David Tulloh用他制作的[Linux驱动的微波炉 [WebM]](http://mirror.linux.org.au/linux.conf.au/2016/04_Thursday/D4.303_Costa_Theatre/Linux_driven_microwave.webm)来展示一个差劲的微波炉会多么难用,以及说明他的项目可以改造这些微波炉使得它们不那么讨人厌。 -Tulloh的故事要从他买到了一个公认很便宜的微波炉开始说起,它的用户界面比其它微波炉默认的还要糟糕。设定时间时必须使劲按按钮以至于把微波炉都向后推了一段距离——而事实上必须要用力拉仓门把手才能把微波炉拖回原来的位置,这形成了一个“优雅”的平衡。当然这只是极端情况。Tulloh很郁闷因为这个微波炉近十年来都没有一丁点明显的改善。他可能买到了一个又小又便宜的微波炉,而且特点是大部分人不研究使用手册就不会使用它——和智能手机的对比更加明显:智能手机只需知道一点点的操作指南并且被广泛使用。 +Tulloh的故事要从他买到了一个公认很便宜的微波炉开始说起,它的用户界面比其它微波炉默认的还要糟糕。设定时间时必须使劲按按钮以至于把微波炉都向后推了一段距离——而事实上必须要用力拉仓门把手才能把微波炉拖回原来的位置,这形成了一个“优雅”的平衡。当然这只是极端情况。Tulloh郁闷的是因为这个微波炉近十年来都没有一丁点明显的改善。他可能买到了一个又小又便宜的微波炉,而且特点是大部分人不研究使用手册就不会使用它——和智能手机的对比更加明显:智能手机只需知道一点点的操作指南并且被广泛使用。 改造这个微波炉不一定没有前途,“让微波炉重获新生”——这个想法成为了一个原型,如果Tulloh可以再平衡一下想做的功能和需求之间的关系的话他希望这变成一个众筹项目:一个Linux驱动的微波炉。 @@ -11,35 +11,29 @@ Tulloh的故事要从他买到了一个公认很便宜的微波炉开始说起 ## 加一点新奇的小玩意 +如果把“Linux”和“微波炉”联系在一起的话,你可能会想到给微波炉加上一个智能手机式的触摸屏和网络链接,然后再通过社区做一款微波炉的“革命性”的手机应用,想到这些就像做菜想到分享食谱一样显而易见。但Tulloh的目标和他的原型远远超过这些,他做了两个新奇的功能——热感相机和称量物体质量的称重装置。 +这个热感相机提供一个可以精确到两度的八乘八像素的图像,这足够发现一杯牛奶是否加热到沸腾或者牛排是否解冻到快不能用来烹饪。不论发生哪种情况,都可以减小功率或者关掉它。而且在必要的时候会发出警报。这可能不是第一个可以检测温度的微波炉——GE在十年前就开始卖带温度探针的微波炉了——但是一个一直工作的内置传感器比一个手工探针有用多了,尤其是有一个可用的API支持的时候。 -如果你把“Linux”和“微波炉”联系在一起的话就可能想到给微波炉加上一个智能手机式的触摸屏和网络链接,然后再通过社区做一款微波炉的“革命性”的手机应用,想到这些就像做菜想到分享食谱一样显而易见。但Tulloh的目标和他的原型远远超过这些,他做了两个新奇的功能——热感相机和称量物体质量的称重装置。 +第二个新发明是一个嵌入的称重装置,它可以在加热之前称量食物(和容器)。很多食谱根据质量大小给出指导的烹饪时间,很多微波炉支持你手动输入质量以便它帮你计算。利用内置的称重装置,这一过程可以变成自动化的。在许多微波炉的转盘下面稳固地放置一个称重装置是一个机械方面的挑战,不过Tulloh觉得这个问题不难处理。相反,他对微波炉的设计是基于“平板”或者“平板挂车”的风格——在四角各放置一个传感器,这不仅在机械实现上很简单而且很好的达到了要求。 -这个热感相机提供一个精确度两自由度的八乘八像素的图片,这足够发现一杯牛奶是否加热到沸腾或者牛排是否解冻到快不能用来烹饪。不论发生哪种情况,功率都可以减小或者关掉。而且在必要的时候会发出警报。这可能不是第一个可以检测温度的微波炉——GE在十年前就开始卖带温度探针的微波炉了——但是一个一直工作的内置传感器比一个手工探针有用多了尤其是有一个可用的API支持的时候。 - -第二个新发明是一个嵌入的称重装置,它可以在加热之前称量食物(和容器)。很多食谱根据质量给出指导的烹饪时间,很多微波炉支持你手动输入质量以便它帮你计算。利用内置的称重装置,这一过程可以变成自动化的。在许多微波炉的转盘下面稳固地放置一个称重装置是一个机械方面的挑战不过Tulloh觉得这个问题不难处理。反而他对微波炉的设计是基于“平板”或者“平板挂车”的风格——在四角各放置一个传感器,这不仅在机械实现上很简单而且很好的达到了要求。 - - -[用户界面] -一旦你有了这些额外添加的并与逻辑引擎相连的质量温度传感器,你可以去尝试更多好玩的可能。一杯刚从冰箱里拿出来的冰牛奶的质量温度分布可能会有适度误差。Tulloh发现这种情况可以被检测到而且提供一些有关的像“煮沸”或者“加热”的选项也是容易做到的(下面有一个模拟的界面,可点击操作的版本请点击右边链接 [here](http://mwgui.tulloh.id.au/)) +一旦你有了这些额外添加的并与逻辑引擎相连的质量温度传感器,你可以去尝试更多好玩的可能。一杯刚从冰箱里拿出来的冰牛奶的质量温度分布可能会有适度误差。Tulloh发现可以监检测到这种情况,而且提供一些有关的像“煮沸”或者“加热”的选项也是容易做到的(下面有一个模拟的界面,可点击操作的版本请点击右边链接 [here](http://mwgui.tulloh.id.au/)) ![](https://static.lwn.net/images/2016/lca-ovengui-sm.png) ## 改造陈旧的东西 -除了才开发出来的新功能,Tulloh还想要提升那些原本就提供的功能。可能不是所有微波炉的门把手都像Tulloh那个廉价的一样僵硬,但是很少有微波炉将把手设计的让残疾人也能轻松使用。这些缺陷都是可调整的,尤其是在美国,微波炉应该在仓门关闭的时候给出一个确定关闭的提示。这种确认必须是可靠的以预防那些伪劣产品,所以在仓门闭合时固定的槽位里添加一个短杆以确认仓门开闭状态,不误使微波炉在仓门开着的时候工作。事实上,必须要两个相互联系的机关,如果他们提供的结果不一致, -保险丝必须断开以便启动一个呼叫服务。Tulloh认为提供一个磁力门闩有更大的灵活性(包含简单的软件控制)并且像磁控也同样用于[磁性钥匙锁](https://en.wikipedia.org/wiki/Magnetic_keyed_lock),它可以让磁力门闩确认微波炉门是否关闭。 +除了才开发出来的新功能,Tulloh还想要提升那些原本就提供的功能。可能不是所有微波炉的门把手都像Tulloh那个廉价的一样僵硬,但是很少有微波炉将把手设计的让残疾人也能轻松使用。这些缺陷都是可调整的,尤其是在美国,微波炉应该在仓门关闭的时候给出一个确定关闭的提示。这种确认必须是可靠的以预防那些伪劣产品,所以在仓门闭合时固定的槽位里添加一个短杆以确认仓门开闭状态,不至于误使微波炉在仓门开着的时候工作。事实上,必须要有两个相互联系的机关,如果他们提供的结果不一致,保险丝必须断开以便启动一个呼叫服务。Tulloh认为提供一个磁力门闩有更大的灵活性(包含简单的软件控制)并且像磁控也同样用于[磁性钥匙锁](https://en.wikipedia.org/wiki/Magnetic_keyed_lock),它可以让磁力门闩确认微波炉门是否关闭。 微波炉的另一个痛点是它会发出令人厌烦的声音。Tulloh去掉了蜂鸣器并且使用香蕉派(类似于树莓派的单片机开发板)控制他的微波炉。这可以通过一个把文本转换成语音的系统来用令人愉悦而且可配置的警报来提示和引导使用者。显然,下一步就是装上一个用来控制声音的扩音器。 - -许多微波炉除了定时和设置功率档位之外还可以做更多的事情——它们为烹饪,加热,化冻等提供一系列的功率谱。加上一个精确的温度测量装置感觉会为这个图表大大扩展它们的序列。Andrew Tridgell对一个问题很好奇,加热巧克力——一个需要非常精确的温度控制的过程——是否是可能的。Tulloh没有过这方面的经验,他不敢保证这个一定可以,但是这个实验结果的确值得期待。即使没做成这件事,它也显出了潜在价值——社区接下来可以更进一步去做这件事。 +许多微波炉除了定时和设置功率档位之外还可以做更多的事情——它们为烹饪,加热,化冻等提供一系列的功率档位。加上一个精确的温度测量装置感觉会为这个图表大大扩展这个列表。Andrew Tridgell对一个问题很好奇,加热巧克力——一个需要非常精确的温度控制的过程——是否是可能的。Tulloh没有过这方面的经验,他不敢保证这个一定可以,但是这个实验结果的确值得期待。即使没做成这件事,它也显出了潜在价值——社区接下来可以更进一步去做这件事。 ## 实用性怎么样? Tulloh十分乐意向全世界分享这个linux驱动的微波炉,他希望看到(因为这件事)形成一个社区并且想看到它接下来的走势。买一个现成的微波炉并且替换掉里面的电子元件看起来不是一个可行的点子。最后的结果可能会很糟,而买一个小巧智能的微波炉必然要花掉(比自己改造)更多的钱,但是潜在的顾客不想在他们的厨房里看到乱七八糟又不协调的东西。 -许多零件都是现成的可以买到的(磁电管,处理器板,热传感器等等),像USB接口的热传感器,而且都很容易安装。软件原型当然也开源在[GitHub](https://github.com/lod?tab=repositories)。这个样例和微波炉门有不小的挑战性并且很可能要定制。Tulloh想要通过提供左侧开仓门的微波炉和颜色多样化的选项来转逆境为机遇。 +许多零件都是现成的可以买到的(磁电管,处理器板,热传感器等等),像USB接口的热传感器,而且都很容易安装。软件原型当然也开源在[GitHub](https://github.com/lod?tab=repositories)。微波炉的舱室和门有不小的挑战性并且很可能要定制。Tulloh想要通过提供左侧开仓门的微波炉和颜色多样化的选项来转逆境为机遇。 一个对读者的快速调查:很少有人会贸然承诺他会为了一个全新的升级过的烤箱付出1000澳大利亚元。当然,很难知道是否会有充足的时间和足够多的读者来完成这个调查。这整个项目看起来很有趣。所以Tulloh的[博客](http://david.tulloh.id.au/category/microwave/) (点击这里)也很值得一看。 @@ -48,8 +42,6 @@ Tulloh十分乐意向全世界分享这个linux驱动的微波炉,他希望看 via: https://lwn.net/Articles/674877/ 作者:Neil Brown -译者:yuba0604(https://github.com/yuba0604) - -译者水平有限,敬请指正。(lizhengyu@gmail.com) +译者:[yuba0604](https://github.com/yuba0604) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 0fe147146553e2f6137974c3307633c40791fbe6 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 11 Jun 2016 11:28:07 +0800 Subject: [PATCH 0894/1469] PUB:20160218 Top 4 open source issue tracking tools @wyangsun --- ...218 Top 4 open source issue tracking tools.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) rename {translated/tech => published}/20160218 Top 4 open source issue tracking tools.md (68%) diff --git a/translated/tech/20160218 Top 4 open source issue tracking tools.md b/published/20160218 Top 4 open source issue tracking tools.md similarity index 68% rename from translated/tech/20160218 Top 4 open source issue tracking tools.md rename to published/20160218 Top 4 open source issue tracking tools.md index 1ffd21a759..03435d1913 100644 --- a/translated/tech/20160218 Top 4 open source issue tracking tools.md +++ b/published/20160218 Top 4 open source issue tracking tools.md @@ -1,13 +1,13 @@ -开源问题跟踪管理工具Top4 +4 个顶级的开源问题跟踪管理工具 ======================================== 生活充满了bug。 -无论怎样小心计划,无论花多少时间去设计,在执行阶段当轮胎压在路上,任何工程都会有未知的问题。也无妨。也许对于任何一个组织的最佳弹性衡量不是他们如何一切都按计划运行地处理事情,而是,当出现磕磕碰碰时他们如何驾驭。 +无论怎样小心计划,无论花多少时间去设计,在执行阶段实际执行时,任何工程都会有未知的问题。也无妨。也许对于任何一个组织的最佳弹性衡量不是他们如何一切都按计划运行地处理事情,而是,当出现磕磕碰碰时他们如何驾驭。 对任何一个项目管理流程来说,特别是在软件开发领域,都需要一个关键工具——问题跟踪管理系统。其基本功能很简单:可以对bug进行查看、追踪,并以协作的方式解决bug,有了它,我们更容易跟随整个过程的进展。除了基本功能,还有很多专注于满足特定需求的选项及功能,使用场景不仅限于软件开发。你可能已经熟悉某些托管版本的工具,像 [GitHub Issues](https://guides.github.com/features/issues/)或者[Launchpad](https://launchpad.net/),其中一些工具已经有了自己的开源社区。 -接下来,这四个bug问题跟踪管理软件的极佳备选,全部开源、易于下载,自己就可以部署。先说好,我们可能没有办法在这里列出每一个问题跟踪工具;相反,我们列出这四个,基于的是其丰富的功能和项目背后的社区规模。当然,肯定还有其他类似软件,如果你喜欢的没有列在这里,如果你有一个好的理由,一定要让我们知道,在下面的评论中使它脱颖而出吧。 +接下来,这四个bug问题跟踪管理软件的极佳备选,全部开源、易于下载,自己就可以部署。先说好,我们可能没有办法在这里列出每一个问题跟踪工具;相反,我们列出这四个,原因基于是其丰富的功能和项目背后的社区规模。当然,肯定还有其他类似软件,如果你喜欢的没有列在这里,如果你有一个好的理由,一定要让我们知道,在下面的评论中使它脱颖而出吧。 ## Redmine @@ -15,7 +15,7 @@ Redmine的设置相当灵活,支持多种数据库后端和几十种语言,还是可定制的,可以向问题(issue)、用户、工程等添加自定义字段。通过社区创建的插件和主题它可以进一步定制。 -如果你想试一试,一个[在线演示](http://demo.redmine.org/)可提供使用。Redmine在开源[GPL版本2](http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)下许可;开源代码可以在工程的[svn仓库](https://svn.redmine.org/redmine)或在[GitHub](https://github.com/redmine/redmine)镜像上找到。 +如果你想试一试,一个[在线演示](http://demo.redmine.org/)可提供使用。Redmine采用[GPL版本2](http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)许可证;开源代码可以在工程的[svn仓库](https://svn.redmine.org/redmine)或在[GitHub](https://github.com/redmine/redmine)镜像上找到。 ![](https://opensource.com/sites/default/files/images/business-uploads/issues-redmine.png) @@ -25,7 +25,7 @@ Redmine的设置相当灵活,支持多种数据库后端和几十种语言, 从通知到重复bug检测再到搜索共享,Bugzilla拥有许多高级工具,是一个功能更丰富的选项。Bugzilla拥有一套高级搜索系统以及全面的报表工具,具有生成图表和自动化按计划生成报告的能力。像Redmine一样,Bugzilla是可扩展和可定制的,除了字段本身,还能针对bug创建自定义工作流。它也支持多种后端数据库,和自带的多语言支持。 -Bugzilla在[Mozilla公共许可证](https://en.wikipedia.org/wiki/Mozilla_Public_License)下许可,你可以读取他们的[未来路线图](https://www.bugzilla.org/status/roadmap.html)还有在官网尝试一个[示例服务](https://landfill.bugzilla.org/) +Bugzilla采用[Mozilla公共许可证](https://en.wikipedia.org/wiki/Mozilla_Public_License),你可以读取他们的[未来路线图](https://www.bugzilla.org/status/roadmap.html)还有在官网尝试一个[示例服务](https://landfill.bugzilla.org/) ![](https://opensource.com/sites/default/files/images/business-uploads/issues-bugzilla.png) @@ -35,7 +35,7 @@ Bugzilla在[Mozilla公共许可证](https://en.wikipedia.org/wiki/Mozilla_Public 由python编写的Trac,将其漏洞跟踪能力与它的wiki系统和版本控制系统轻度整合。项目管理能力突出,如生成里程碑和路线图,一个可定制的报表系统,大事记,支持多资源库,内置的垃圾邮件过滤,还可以使用很多通用语言。如其他我们已经看到的漏洞追踪软件,有很多插件可进一步扩展其基本特性。 -Trac是在改进的[BSD许可](http://trac.edgewall.org/wiki/TracLicense)下获得开放源码许可,虽然更老的版本发布在GPL下。你可以在一个[自托管仓库](http://trac.edgewall.org/browser)预览Trac的源码或者查看他们的[路线图](http://trac.edgewall.org/wiki/TracRoadmap)对未来的规划。 +Trac以[改进的BSD许可协议](http://trac.edgewall.org/wiki/TracLicense)开源,虽然更老的版本发布在GPL下。你可以在一个[自托管仓库](http://trac.edgewall.org/browser)预览Trac的源码或者查看他们的[路线图](http://trac.edgewall.org/wiki/TracRoadmap)对未来的规划。 ![](https://opensource.com/sites/default/files/images/business-uploads/issues-trac.png) @@ -43,11 +43,11 @@ Trac是在改进的[BSD许可](http://trac.edgewall.org/wiki/TracLicense)下获 [Mantis](https://www.mantisbt.org/)是这次合集中我们将看到的最后一个工具,基于PHP,且有16年历史。作为另一个支持多种不同版本控制系统和事件驱动通知系统的bug跟踪管理软件,Mantis有一个与其他工具类似的功能设置。虽然它不本身包含wiki,但它整合了很多流行的wiki平台且本地化到多种语言。 -Mantis在[GPL版本2](http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)下获得开源许可证书;你可以在[GitHub](https://github.com/mantisbt/mantisbt)浏览他的源代码或查看自托管[路线图](https://www.mantisbt.org/bugs/roadmap_page.php?project=mantisbt&version=1.3.x)对未来的规划。一个示例,你可以查看他们的内部[漏洞跟踪](https://www.mantisbt.org/bugs/my_view_page.php)。 +Mantis使用[GPL版本2](http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)开源许可证书;你可以在[GitHub](https://github.com/mantisbt/mantisbt)浏览他的源代码或查看自托管[路线图](https://www.mantisbt.org/bugs/roadmap_page.php?project=mantisbt&version=1.3.x)对未来的规划。一个示例,你可以查看他们的内部[漏洞跟踪](https://www.mantisbt.org/bugs/my_view_page.php)。 ![](https://opensource.com/sites/default/files/images/business-uploads/issues-mantis.png) -正如我们指出的,这四个不是唯一的选项。想要探索更多?[Apache Bloodhound](https://issues.apache.org/bloodhound/),[Fossil](http://fossil-scm.org/index.html/doc/trunk/www/index.wiki),[The Bug Genie](http://www.thebuggenie.com/),还有很多可替换品都有专注的追随者,每个都有不同的优点和缺点。另外,一些工具在我们[项目管理](https://opensource.com/business/15/1/top-project-management-tools-2015)摘要有问题跟踪功能。所以,哪个是你首选的跟踪和碾压bug的工具? +正如我们指出的,这四个不是唯一的选项。想要探索更多?[Apache Bloodhound](https://issues.apache.org/bloodhound/),[Fossil](http://fossil-scm.org/index.html/doc/trunk/www/index.wiki),[The Bug Genie](http://www.thebuggenie.com/),还有很多可替换品都有自己的忠实追随者,每个都有不同的优点和缺点。另外,一些工具在我们[项目管理](https://opensource.com/business/15/1/top-project-management-tools-2015)摘要有问题跟踪功能。所以,哪个是你首选的跟踪和碾压bug的工具? ------------------------------------------------------------------------------ From 93be2e9320d87459872b485cf2d90fc8136d06f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E5=AE=B6=E6=9C=AA?= Date: Sun, 12 Jun 2016 11:42:54 +0800 Subject: [PATCH 0895/1469] =?UTF-8?q?Translating=20by=20GitFuture=20?= =?UTF-8?q?=E3=80=9020160602=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 20160602 How to mount your Google Drive on Linux with google-drive-ocamlfuse.md --- ...nt your Google Drive on Linux with google-drive-ocamlfuse.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160602 How to mount your Google Drive on Linux with google-drive-ocamlfuse.md b/sources/tech/20160602 How to mount your Google Drive on Linux with google-drive-ocamlfuse.md index f043e2e92b..25fcda37d8 100644 --- a/sources/tech/20160602 How to mount your Google Drive on Linux with google-drive-ocamlfuse.md +++ b/sources/tech/20160602 How to mount your Google Drive on Linux with google-drive-ocamlfuse.md @@ -1,3 +1,5 @@ +Translating by GitFuture + How to mount your Google Drive on Linux with google-drive-ocamlfuse ======================================================================== From b27122b38027aa6bf04f1c9fe45a2965350dac90 Mon Sep 17 00:00:00 2001 From: "Fuliang.Li" Date: Sun, 12 Jun 2016 15:49:15 +0800 Subject: [PATCH 0896/1469] =?UTF-8?q?[=E5=BC=80=E5=A7=8B=E7=BF=BB=E8=AF=91?= =?UTF-8?q?]=20Linux=20vs.=20Windows=20device=20driver=20model=20:=20archi?= =?UTF-8?q?tecture,=20APIs=20and=20build=20environment=20comparison?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../talk/20160531 Linux vs. Windows device driver model.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/talk/20160531 Linux vs. Windows device driver model.md b/sources/talk/20160531 Linux vs. Windows device driver model.md index 2eda1e6927..9def01085b 100644 --- a/sources/talk/20160531 Linux vs. Windows device driver model.md +++ b/sources/talk/20160531 Linux vs. Windows device driver model.md @@ -1,3 +1,5 @@ +GHLandy Translating + Linux vs. Windows device driver model : architecture, APIs and build environment comparison ============================================================================================ @@ -177,7 +179,7 @@ Download this article as ad-free PDF (made possible by [your kind donation][2]): via: http://xmodulo.com/linux-vs-windows-device-driver-model.html 作者:[Dennis Turpitka][a] -译者:[译者ID](https://github.com/译者ID) +译者:[GHLandy](https://github.com/GHLandy) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 22254bbc90d60639978a0c712d5fb4889bcd5c07 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 12 Jun 2016 21:22:39 +0800 Subject: [PATCH 0897/1469] =?UTF-8?q?=E6=81=A2=E5=A4=8D=20LFCS=2012/13?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @willowyoung ,切勿提交非相关的文件 @oska874 --- ...Installed Help Documentations and Tools.md | 180 +++++++++++++++++ ...leshoot Grand Unified Bootloader (GRUB).md | 185 ++++++++++++++++++ 2 files changed, 365 insertions(+) create mode 100644 sources/tech/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md create mode 100644 sources/tech/LFCS/Part 13 - How to Configure and Troubleshoot Grand Unified Bootloader (GRUB).md diff --git a/sources/tech/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md b/sources/tech/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md new file mode 100644 index 0000000000..45ccb57f95 --- /dev/null +++ b/sources/tech/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md @@ -0,0 +1,180 @@ +Part 12 - LFCS: How to Explore Linux with Installed Help Documentations and Tools +================================================================================== + +Because of the changes in the LFCS exam requirements effective Feb. 2, 2016, we are adding the necessary topics to the [LFCS series][1] published here. To prepare for this exam, your are highly encouraged to use the [LFCE series][2] as well. + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Explore-Linux-with-Documentation-and-Tools.png) +>LFCS: Explore Linux with Installed Documentations and Tools – Part 12 + +Once you get used to working with the command line and feel comfortable doing so, you realize that a regular Linux installation includes all the documentation you need to use and configure the system. + +Another good reason to become familiar with command line help tools is that in the [LFCS][3] and [LFCE][4] exams, those are the only sources of information you can use – no internet browsing and no googling. It’s just you and the command line. + +For that reason, in this article we will give you some tips to effectively use the installed docs and tools in order to prepare to pass the **Linux Foundation Certification** exams. + +### Linux Man Pages + +A man page, short for manual page, is nothing less and nothing more than what the word suggests: a manual for a given tool. It contains the list of options (with explanation) that the command supports, and some man pages even include usage examples as well. + +To open a man page, use the **man command** followed by the name of the tool you want to learn more about. For example: + +``` +# man diff +``` + +will open the manual page for `diff`, a tool used to compare text files line by line (to exit, simply hit the q key.). + +Let’s say we want to compare two text files named `file1` and `file2` in Linux. These files contain the list of packages that are installed in two Linux boxes with the same distribution and version. + +Doing a `diff` between `file1` and `file2` will tell us if there is a difference between those lists: + +``` +# diff file1 file2 +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Compare-Two-Text-Files-in-Linux.png) +>Compare Two Text Files in Linux + +where the `<` sign indicates lines missing in `file2`. If there were lines missing in `file1`, they would be indicated by the `>` sign instead. + +On the other hand, **7d6** means line **#7** in file should be deleted in order to match `file2` (same with **24d22** and **41d38**), and 65,67d61 tells us we need to remove lines **65** through **67** in file one. If we make these corrections, both files will then be identical. + +Alternatively, you can display both files side by side using the `-y` option, according to the man page. You may find this helpful to more easily identify missing lines in files: + +``` +# diff -y file1 file2 +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Compare-and-List-Difference-of-Two-Files.png) +>Compare and List Difference of Two Files + +Also, you can use `diff` to compare two binary files. If they are identical, `diff` will exit silently without output. Otherwise, it will return the following message: “**Binary files X and Y differ**”. + +### The –help Option + +The `--help` option, available in many (if not all) commands, can be considered a short manual page for that specific command. Although it does not provide a comprehensive description of the tool, it is an easy way to obtain information on the usage of a program and a list of its available options at a quick glance. + +For example, + +``` +# sed --help +``` + +shows the usage of each option available in sed (the stream editor). + +One of the classic examples of using `sed` consists of replacing characters in files. Using the `-i` option (described as “**edit files in place**”), you can edit a file without opening it. If you want to make a backup of the original contents as well, use the `-i` option followed by a SUFFIX to create a separate file with the original contents. + +For example, to replace each occurrence of the word `Lorem` with `Tecmint` (case insensitive) in `lorem.txt` and create a new file with the original contents of the file, do: + +``` +# less lorem.txt | grep -i lorem +# sed -i.orig 's/Lorem/Tecmint/gI' lorem.txt +# less lorem.txt | grep -i lorem +# less lorem.txt.orig | grep -i lorem +``` + +Please note that every occurrence of `Lorem` has been replaced with `Tecmint` in `lorem.txt`, and the original contents of `lorem.txt` has been saved to `lorem.txt.orig`. + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Replace-A-String-in-File.png) +>Replace A String in Files + +### Installed Documentation in /usr/share/doc + +This is probably my favorite pick. If you go to `/usr/share/doc` and do a directory listing, you will see lots of directories with the names of the installed tools in your Linux system. + +According to the [Filesystem Hierarchy Standard][5], these directories contain useful information that might not be in the man pages, along with templates and configuration files to make configuration easier. + +For example, let’s consider `squid-3.3.8` (version may vary from distribution to distribution) for the popular HTTP proxy and [squid cache server][6]. + +Let’s `cd` into that directory: + +``` +# cd /usr/share/doc/squid-3.3.8 +``` + +and do a directory listing: + +``` +# ls +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/03/List-Files-in-Linux.png) +>Linux Directory Listing with ls Command + +You may want to pay special attention to `QUICKSTART` and `squid.conf.documented`. These files contain an extensive documentation about Squid and a heavily commented configuration file, respectively. For other packages, the exact names may differ (as **QuickRef** or **00QUICKSTART**, for example), but the principle is the same. + +Other packages, such as the Apache web server, provide configuration file templates inside `/usr/share/doc`, that will be helpful when you have to configure a standalone server or a virtual host, to name a few cases. + +### GNU info Documentation + +You can think of info documents as man pages on steroids. As such, they not only provide help for a specific tool, but also they do so with hyperlinks (yes, hyperlinks in the command line!) that allow you to navigate from a section to another using the arrow keys and Enter to confirm. + +Perhaps the most illustrative example is: + +``` +# info coreutils +``` + +Since coreutils contains the [basic file, shell and text manipulation utilities][7] which are expected to exist on every operating system, you can reasonably expect a detailed description for each one of those categories in info **coreutils**. + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Info-Coreutils.png) +>Info Coreutils + +As it is the case with man pages, you can exit an info document by pressing the `q` key. + +Additionally, GNU info can be used to display regular man pages as well when followed by the tool name. For example: + +``` +# info tune2fs +``` + +will return the man page of **tune2fs**, the ext2/3/4 filesystems management tool. + +And now that we’re at it, let’s review some of the uses of **tune2fs**: + +Display information about the filesystem on top of **/dev/mapper/vg00-vol_backups**: + +``` +# tune2fs -l /dev/mapper/vg00-vol_backups +``` + +Set a filesystem volume name (Backups in this case): + +``` +# tune2fs -L Backups /dev/mapper/vg00-vol_backups +``` + +Change the check intervals and `/` or mount counts (use the `-c` option to set a number of mount counts and `/` or the `-i` option to set a check interval, where **d=days, w=weeks, and m=months**). + +``` +# tune2fs -c 150 /dev/mapper/vg00-vol_backups # Check every 150 mounts +# tune2fs -i 6w /dev/mapper/vg00-vol_backups # Check every 6 weeks +``` + +All of the above options can be listed with the `--help` option, or viewed in the man page. + +### Summary + +Regardless of the method that you choose to invoke help for a given tool, knowing that they exist and how to use them will certainly come in handy in the exam. Do you know of any other tools that can be used to look up documentation? Feel free to share with the Tecmint community using the form below. + +Questions and other comments are more than welcome as well. + +-------------------------------------------------------------------------------- + +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/installing-network-services-and-configuring-services-at-system-boot/ +[3]: http://www.tecmint.com/sed-command-to-create-edit-and-manipulate-files-in-linux/ +[4]: http://www.tecmint.com/installing-network-services-and-configuring-services-at-system-boot/ +[5]: http://www.tecmint.com/linux-directory-structure-and-important-files-paths-explained/ +[6]: http://www.tecmint.com/configure-squid-server-in-linux/ +[7]: http://www.tecmint.com/sed-command-to-create-edit-and-manipulate-files-in-linux/ +[8]: diff --git a/sources/tech/LFCS/Part 13 - How to Configure and Troubleshoot Grand Unified Bootloader (GRUB).md b/sources/tech/LFCS/Part 13 - How to Configure and Troubleshoot Grand Unified Bootloader (GRUB).md new file mode 100644 index 0000000000..cf24c51b58 --- /dev/null +++ b/sources/tech/LFCS/Part 13 - How to Configure and Troubleshoot Grand Unified Bootloader (GRUB).md @@ -0,0 +1,185 @@ +Part 13 - LFCS: How to Configure and Troubleshoot Grand Unified Bootloader (GRUB) +===================================================================================== + +Because of the changes in the LFCS exam requirements effective Feb. 2, 2016, we are adding the necessary topics to the [LFCS series][1] published here. To prepare for this exam, your are highly encouraged to use the [LFCE series][2] as well. + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Configure-Troubleshoot-Grub-Boot-Loader.png) +>LFCS: Configure and Troubleshoot Grub Boot Loader – Part 13 + +In this article we will introduce you to GRUB and explain why a boot loader is necessary, and how it adds versatility to the system. + +The [Linux boot process][3] from the time you press the power button of your computer until you get a fully-functional system follows this high-level sequence: + +* 1. A process known as **POST** (**Power-On Self Test**) performs an overall check on the hardware components of your computer. +* 2. When **POST** completes, it passes the control over to the boot loader, which in turn loads the Linux kernel in memory (along with **initramfs**) and executes it. The most used boot loader in Linux is the **GRand Unified Boot loader**, or **GRUB** for short. +* 3. The kernel checks and accesses the hardware, and then runs the initial process (mostly known by its generic name “**init**”) which in turn completes the system boot by starting services. + +In Part 7 of this series (“[SysVinit, Upstart, and Systemd][4]”) we introduced the [service management systems and tools][5] used by modern Linux distributions. You may want to review that article before proceeding further. + +### Introducing GRUB Boot Loader + +Two major **GRUB** versions (**v1** sometimes called **GRUB Legacy** and **v2**) can be found in modern systems, although most distributions use **v2** by default in their latest versions. Only **Red Hat Enterprise Linux 6** and its derivatives still use **v1** today. + +Thus, we will focus primarily on the features of **v2** in this guide. + +Regardless of the **GRUB** version, a boot loader allows the user to: + +* 1). modify the way the system behaves by specifying different kernels to use, +* 2). choose between alternate operating systems to boot, and +* 3). add or edit configuration stanzas to change boot options, among other things. + +Today, **GRUB** is maintained by the **GNU** project and is well documented in their website. You are encouraged to use the [GNU official documentation][6] while going through this guide. + +When the system boots you are presented with the following **GRUB** screen in the main console. Initially, you are prompted to choose between alternate kernels (by default, the system will boot using the latest kernel) and are allowed to enter a **GRUB** command line (with `c`) or edit the boot options (by pressing the `e` key). + +![](http://www.tecmint.com/wp-content/uploads/2016/03/GRUB-Boot-Screen.png) +>GRUB Boot Screen + +One of the reasons why you would consider booting with an older kernel is a hardware device that used to work properly and has started “acting up” after an upgrade (refer to [this link][7] in the AskUbuntu forums for an example). + +The **GRUB v2** configuration is read on boot from `/boot/grub/grub.cfg` or `/boot/grub2/grub.cfg`, whereas `/boot/grub/grub.conf` or `/boot/grub/menu.lst` are used in **v1**. These files are NOT to be edited by hand, but are modified based on the contents of `/etc/default/grub` and the files found inside `/etc/grub.d`. + +In a **CentOS 7**, here’s the configuration file that is created when the system is first installed: + +``` +GRUB_TIMEOUT=5 +GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)" +GRUB_DEFAULT=saved +GRUB_DISABLE_SUBMENU=true +GRUB_TERMINAL_OUTPUT="console" +GRUB_CMDLINE_LINUX="vconsole.keymap=la-latin1 rd.lvm.lv=centos_centos7-2/swap crashkernel=auto vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos_centos7-2/root rhgb quiet" +GRUB_DISABLE_RECOVERY="true" +``` + +In addition to the online documentation, you can also find the GNU GRUB manual using info as follows: + +``` +# info grub +``` + +If you’re interested specifically in the options available for /etc/default/grub, you can invoke the configuration section directly: + +``` +# info -f grub -n 'Simple configuration' +``` + +Using the command above you will find out that `GRUB_TIMEOUT` sets the time between the moment when the initial screen appears and the system automatic booting begins unless interrupted by the user. When this variable is set to `-1`, boot will not be started until the user makes a selection. + +When multiple operating systems or kernels are installed in the same machine, `GRUB_DEFAULT` requires an integer value that indicates which OS or kernel entry in the GRUB initial screen should be selected to boot by default. The list of entries can be viewed not only in the splash screen shown above, but also using the following command: + +### In CentOS and openSUSE: + +``` +# awk -F\' '$1=="menuentry " {print $2}' /boot/grub2/grub.cfg +``` + +### In Ubuntu: + +``` +# awk -F\' '$1=="menuentry " {print $2}' /boot/grub/grub.cfg +``` + +In the example shown in the below image, if we wish to boot with the kernel version **3.10.0-123.el7.x86_64** (4th entry), we need to set `GRUB_DEFAULT` to `3` (entries are internally numbered beginning with zero) as follows: + +``` +GRUB_DEFAULT=3 +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Boot-System-with-Old-Kernel-Version.png) +>Boot System with Old Kernel Version + +One final GRUB configuration variable that is of special interest is `GRUB_CMDLINE_LINUX`, which is used to pass options to the kernel. The options that can be passed through GRUB to the kernel are well documented in the [Kernel Parameters file][8] and in [man 7 bootparam][9]. + +Current options in my **CentOS 7** server are: + +``` +GRUB_CMDLINE_LINUX="vconsole.keymap=la-latin1 rd.lvm.lv=centos_centos7-2/swap crashkernel=auto vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos_centos7-2/root rhgb quiet" +``` + +Why would you want to modify the default kernel parameters or pass extra options? In simple terms, there may be times when you need to tell the kernel certain hardware parameters that it may not be able to determine on its own, or to override the values that it would detect. + +This happened to me not too long ago when I tried **Vector Linux**, a derivative of **Slackware**, on my 10-year old laptop. After installation it did not detect the right settings for my video card so I had to modify the kernel options passed through GRUB in order to make it work. + +Another example is when you need to bring the system to single-user mode to perform maintenance tasks. You can do this by appending the word single to `GRUB_CMDLINE_LINUX` and rebooting: + +``` +GRUB_CMDLINE_LINUX="vconsole.keymap=la-latin1 rd.lvm.lv=centos_centos7-2/swap crashkernel=auto vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos_centos7-2/root rhgb quiet single" +``` + +After editing `/etc/defalt/grub`, you will need to run `update-grub` (Ubuntu) or `grub2-mkconfig -o /boot/grub2/grub.cfg` (**CentOS** and **openSUSE**) afterwards to update `grub.cfg` (otherwise, changes will be lost upon boot). + +This command will process the boot configuration files mentioned earlier to update `grub.cfg`. This method ensures changes are permanent, while options passed through GRUB at boot time will only last during the current session. + +### Fixing Linux GRUB Issues + +If you install a second operating system or if your GRUB configuration file gets corrupted due to human error, there are ways you can get your system back on its feet and be able to boot again. + +In the initial screen, press `c` to get a GRUB command line (remember that you can also press `e` to edit the default boot options), and use help to bring the available commands in the GRUB prompt: + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Fix-Grub-Issues-in-Linux.png) +>Fix Grub Configuration Issues in Linux + +We will focus on **ls**, which will list the installed devices and filesystems, and we will examine what it finds. In the image below we can see that there are 4 hard drives (`hd0` through `hd3`). + +Only `hd0` seems to have been partitioned (as evidenced by msdos1 and msdos2, where 1 and 2 are the partition numbers and msdos is the partitioning scheme). + +Let’s now examine the first partition on `hd0` (**msdos1**) to see if we can find GRUB there. This approach will allow us to boot Linux and there use other high level tools to repair the configuration file or reinstall GRUB altogether if it is needed: + +``` +# ls (hd0,msdos1)/ +``` + +As we can see in the highlighted area, we found the `grub2` directory in this partition: + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Find-Grub-Configuration.png) +>Find Grub Configuration + +Once we are sure that GRUB resides in (**hd0,msdos1**), let’s tell GRUB where to find its configuration file and then instruct it to attempt to launch its menu: + +``` +set prefix=(hd0,msdos1)/grub2 +set root=(hd0,msdos1) +insmod normal +normal +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Find-and-Launch-Grub-Menu.png) +>Find and Launch Grub Menu + +Then in the GRUB menu, choose an entry and press **Enter** to boot using it. Once the system has booted you can issue the `grub2-install /dev/sdX` command (change `sdX` with the device you want to install GRUB on). The boot information will then be updated and all related files be restored. + +``` +# grub2-install /dev/sdX +``` + +Other more complex scenarios are documented, along with their suggested fixes, in the [Ubuntu GRUB2 Troubleshooting guide][10]. The concepts explained there are valid for other distributions as well. + +### Summary + +In this article we have introduced you to GRUB, indicated where you can find documentation both online and offline, and explained how to approach an scenario where a system has stopped booting properly due to a bootloader-related issue. + +Fortunately, GRUB is one of the tools that is best documented and you can easily find help either in the installed docs or online using the resources we have shared in this article. + +Do you have questions or comments? Don’t hesitate to let us know using the comment form below. We look forward to hearing from you! + +-------------------------------------------------------------------------------- + +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/installing-network-services-and-configuring-services-at-system-boot/ +[3]: http://www.tecmint.com/linux-boot-process/ +[4]: http://www.tecmint.com/linux-boot-process-and-manage-services/ +[5]: http://www.tecmint.com/best-linux-log-monitoring-and-management-tools/ +[6]: http://www.gnu.org/software/grub/manual/ +[7]: http://askubuntu.com/questions/82140/how-can-i-boot-with-an-older-kernel-version +[8]: https://www.kernel.org/doc/Documentation/kernel-parameters.txt +[9]: http://man7.org/linux/man-pages/man7/bootparam.7.html +[10]: https://help.ubuntu.com/community/Grub2/Troubleshooting From 3ecb54d5c50ef4a1bcdb40dfee10fffe8afabeba Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 12 Jun 2016 22:38:48 +0800 Subject: [PATCH 0898/1469] PUB:Part 9 - LFCS--Linux Package Management with Yum RPM Apt Dpkg Aptitude and Zypper @Flowsnow --- ...th Yum RPM Apt Dpkg Aptitude and Zypper.md | 205 ++++++++++++++++ ...th Yum RPM Apt Dpkg Aptitude and Zypper.md | 230 ------------------ 2 files changed, 205 insertions(+), 230 deletions(-) create mode 100644 published/LFCS/Part 9 - LFCS--Linux Package Management with Yum RPM Apt Dpkg Aptitude and Zypper.md delete mode 100644 translated/tech/LFCS/Part 9 - LFCS--Linux Package Management with Yum RPM Apt Dpkg Aptitude and Zypper.md diff --git a/published/LFCS/Part 9 - LFCS--Linux Package Management with Yum RPM Apt Dpkg Aptitude and Zypper.md b/published/LFCS/Part 9 - LFCS--Linux Package Management with Yum RPM Apt Dpkg Aptitude and Zypper.md new file mode 100644 index 0000000000..cdb0e8aecf --- /dev/null +++ b/published/LFCS/Part 9 - LFCS--Linux Package Management with Yum RPM Apt Dpkg Aptitude and Zypper.md @@ -0,0 +1,205 @@ +LFCS 系列第九讲: 使用 Yum、RPM、Apt、Dpkg、Aptitude 进行 Linux 软件包管理 +================================================================================ + +去年八月, Linux基金会宣布了一个全新的LFCS(Linux Foundation Certified Sysadmin,Linux基金会认证系统管理员)认证计划,这对广大系统管理员来说是一个很好的机会,管理员们可以通过认证考试来表明自己可以成功支持Linux系统的整体运营。 一个Linux基金会认证的系统管理员能有足够的专业知识来确保系统高效运行,提供第一手的故障诊断和监视,并且在需要的情况下将问题提交给工程师支持团队。 + +![Linux Package Management](http://www.tecmint.com/wp-content/uploads/2014/11/lfcs-Part-9.png) + +*Linux基金会认证系统管理员 – 第九讲* + +请观看下面关于Linux基金会认证计划的演示。 + +注:youtube 视频 + + +本文是本系列教程中的第九讲,今天在这篇文章中我们会引导你学习Linux软件包管理,这也是LFCS认证考试所需要的。 + +### 软件包管理 ### + +简单的说,软件包管理是系统中安装和维护软件的一种方法,这里说的维护包含更新和卸载。 + +在Linux早期,程序只以源代码的方式发行,还带有所需的用户使用手册和必备的配置文件,甚至更多。现如今,大多数发行商一般使用预装程序或者被称为软件包的程序集合。用户可以使用这些预装程序或者软件包安装到该发行版中。然而,Linux最伟大的一点是我们仍然能够获得程序的源代码用来学习、改进和编译。 + +####软件包管理系统是如何工作的#### + +如果某一个软件包需要一定的资源,如共享库,或者需要另一个软件包,这就称之为依赖性。所有现在的包管理系统提供了一些解决依赖性的方法,以确保当安装一个软件包时,相关的依赖包也安装好了。 + +####打包系统#### + +几乎所有安装在现代Linux系统上的软件都会能互联网上找到。它要么由发行商通过中央仓库(中央仓库能包含几千个软件包,每个软件包都已经为发行版构建、测试并且维护好了)提供,要么能够直接得到可以下载和手动安装的源代码。 + +由于不同的发行版使用不同的打包系统(Debian的\*.deb文件/CentOS的\*.rpm文件/openSUSE的专门为openSUSE构建的*.rpm文件),因此为一个发行版开发的软件包会与其他发行版不兼容。然而,大多数发行版都属于LFCS认证所涉及的三个发行版家族之一。 + +####高级和低级打包工具#### + +为了有效地进行软件包管理的任务,你需要知道,有两种类型的实用工具:低级工具(能在后端实际安装、升级、卸载软件包文件),以及高级工具(负责确保能很好的执行依赖性解决和元数据检索的任务——元数据也称为数据的数据)。 + + +|发行版|低级工具|高级工具| +|-----|-------|------| +|Debian版及其衍生版|dpkg|apt-get / aptitude| +|CentOS版|rpm|yum| +|openSUSE版|rpm|zypper| + +让我们来看下低级工具和高级工具的描述。 + +dpkg的是基于Debian的系统的一个低级包管理器。它可以安装,删除,提供有关资料,以及建立*.deb包,但它不能自动下载并安装它们相应的依赖包。 + +- 阅读更多: [15个dpkg命令实例][1] + +apt-get是Debian及其衍生版的高级包管理器,并提供命令行方式来从多个来源检索和安装软件包,其中包括解决依赖性。和dpkg不同的是,apt-get不是直接基于.deb文件工作,而是基于软件包的正确名称。 + +- 阅读更多: [25个apt-get命令实力][2] + +Aptitude是基于Debian的系统的另一个高级包管理器,它可用于快速简便的执行管理任务(安装,升级和删除软件包,还可以自动处理解决依赖性)。它在atp-get的基础上提供了更多功能,例如提供对软件包的几个版本的访问。 + +rpm是Linux标准基础(LSB)兼容发行版所使用的一种软件包管理器,用来对软件包进行低级处理。就像dpkg一样,rpm可以查询、安装、检验、升级和卸载软件包,它多数用于基于Fedora的系统,比如RHEL和CentOS。 + +- 阅读更多: [20个rpm命令实例][3] + +相对于基于RPM的系统,yum增加了系统自动更新的功能和带依赖性管理的软件包管理功能。作为一个高级工具,和apt-get或者aptitude相似,yum需要配合仓库工作。 + +- 阅读更多: [20个yum命令实例][4] + +### 低级工具的常见用法 ### + +使用低级工具处理最常见的任务如下。 + +####1. 从已编译(*.deb或*.rpm)的文件安装一个软件包#### + +这种安装方法的缺点是没有提供解决依赖性的方案。当你在发行版本库中无法获得某个软件包并且又不能通过高级工具下载安装时,你很可能会从一个已编译文件安装该软件包。因为低级工具不会解决依赖性问题,所以当安装一个没有解决依赖性的软件包时会出现出错并且退出。 + + # dpkg -i file.deb [Debian版和衍生版] + # rpm -i file.rpm [CentOS版 / openSUSE版] + +**注意**:不要试图在CentOS中安装一个为openSUSE构建的.rpm文件,反之亦然! + +####2. 从已编译文件中更新一个软件包#### + +同样,当某个安装的软件包不在中央仓库中时,你只能手动升级该软件包。 + + # dpkg -i file.deb [Debian版和衍生版] + # rpm -U file.rpm [CentOS版 / openSUSE版] + +####3. 列举安装的软件包#### + +当你第一次接触一个已经在工作中的系统时,很可能你会想知道安装了哪些软件包。 + + # dpkg -l [Debian版和衍生版] + # rpm -qa [CentOS版 / openSUSE版] + +如果你想知道一个特定的软件包安装在哪儿,你可以使用管道命令从以上命令的输出中去搜索,这在这个系列的[第一讲 操作Linux文件][5] 中有介绍。例如我们需要验证mysql-common这个软件包是否安装在Ubuntu系统中: + + # dpkg -l | grep mysql-common + +![Check Installed Packages in Linux](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Installed-Package.png) + +*检查安装的软件包* + +另外一种方式来判断一个软件包是否已安装。 + + # dpkg --status package_name [Debian版和衍生版] + # rpm -q package_name [CentOS版 / openSUSE版] + +例如,让我们找出sysdig软件包是否安装在我们的系统。 + + # rpm -qa | grep sysdig + +![Check sysdig Package](http://www.tecmint.com/wp-content/uploads/2014/11/Check-sysdig-Package.png) + +*检查sysdig软件包* + +####4. 查询一个文件是由哪个软件包安装的#### + + # dpkg --search file_name + # rpm -qf file_name + +例如,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) + +*Linux中查询文件* + +### 高级工具的常见用法 ### + +使用高级工具处理最常见的任务如下。 + +####1. 搜索软件包#### + +aptitude的更新操作将会更新可用的软件包列表,而aptitude的搜索操作会根据软件包名进行实际搜索。 + + # aptitude update && aptitude search package_name + +在search all选项中,yum不仅可以通过软件包名还可以通过软件包的描述搜索。 + + # yum search package_name + # yum search all package_name + # yum whatprovides “*/package_name” + +假定我们需要一个名为sysdig文件,想知道我们需要安装哪个软件包才行,那么运行。 + + # yum whatprovides “*/sysdig” + +![Check Package Description in Linux](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Package-Description.png) + +*检查软件包描述* + +whatprovides告诉yum搜索一个含有能够匹配上述正则表达式的文件的软件包。 + + # zypper refresh && zypper search package_name [在openSUSE上] + +####2. 从仓库安装一个软件包#### + +当安装一个软件包时,在软件包管理器解决了所有依赖性问题后,可能会提醒你确认安装。需要注意的是运行更新( update)或刷新(refresh)(根据所使用的软件包管理器)不是绝对必要,但是考虑到安全性和依赖性的原因,保持安装的软件包是最新的是系统管理员的一个好经验。 + + # aptitude update && aptitude install package_name [Debian版和衍生版] + # yum update && yum install package_name [CentOS版] + # zypper refresh && zypper install package_name [openSUSE版] + +####3. 卸载软件包#### + +remove选项将会卸载软件包,但把配置文件保留完好,然而purge选项将从系统中完全删去该程序以及相关内容。 + + # aptitude remove / purge package_name + # yum erase package_name + + ---注意要卸载的openSUSE包前面的减号 --- + + # zypper remove -package_name + +在默认情况下,大部分(如果不是全部的话)的软件包管理器会提示你,在你实际卸载之前你是否确定要继续卸载。所以,请仔细阅读屏幕上的信息,以避免陷入不必要的麻烦! + +####4. 显示软件包的信息#### + +下面的命令将会显示birthday这个软件包的信息。 + + # 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) + +*检查包信息* + +### 总结 ### + +作为一个系统管理员,软件包管理器是你不能回避的东西。你应该立即去使用本文中介绍的这些工具。希望你在准备LFCS考试和日常工作中会觉得这些工具好用。欢迎在下面留下您的意见或问题,我们将尽可能快的回复你。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/linux-package-management/ + +作者:[Gabriel Cánepa][a] +译者:[Flowsnow](https://github.com/Flowsnow) +校对:[wxy](https://github.com/wxy) + +本文由 [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]:https://linux.cn/article-7161-1.html \ No newline at end of file diff --git a/translated/tech/LFCS/Part 9 - LFCS--Linux Package Management with Yum RPM Apt Dpkg Aptitude and Zypper.md b/translated/tech/LFCS/Part 9 - LFCS--Linux Package Management with Yum RPM Apt Dpkg Aptitude and Zypper.md deleted file mode 100644 index 2781dde63d..0000000000 --- a/translated/tech/LFCS/Part 9 - LFCS--Linux Package Management with Yum RPM Apt Dpkg Aptitude and Zypper.md +++ /dev/null @@ -1,230 +0,0 @@ -Flowsnow translating... -LFCS系列第九讲: 使用Yum, RPM, Apt, Dpkg, Aptitude, Zypper进行Linux包管理 -================================================================================ -去年八月, Linux基金会宣布了一个全新的LFCS(Linux Foundation Certified Sysadmin,Linux基金会认证系统管理员)认证计划,这对广大系统管理员来说是一个很好的机会,管理员们可以通过绩效考试来表明自己可以成功支持Linux系统的整体运营。 当需要的时候一个Linux基金会认证的系统管理员有足够的专业知识来确保系统高效运行,提供第一手的故障诊断和监视,并且为工程师团队在问题升级时提供智能决策。 - -![Linux Package Management](http://www.tecmint.com/wp-content/uploads/2014/11/lfcs-Part-9.png) - -Linux基金会认证系统管理员 – 第九讲 - -请观看下面关于Linux基金会认证计划的演示。 - -注:youtube 视频 - - -本文是本系列十套教程中的第九讲,今天在这篇文章中我们会引导你学习Linux包管理,这也是LFCS认证考试所需要的。 - -### 包管理 ### - -简单的说,包管理是系统中安装和维护软件的一种方法,其中维护也包含更新和卸载。 - -在Linux早期,程序只以源代码的方式发行,还带有所需的用户使用手册和必备的配置文件,甚至更多。现如今,大多数发行商使用默认的预装程序或者被称为包的程序集合。用户使用这些预装程序或者包来安装该发行版本。然而,Linux最伟大的一点是我们仍然能够获得程序的源代码用来学习、改进和编译。 - -**包管理系统是如何工作的** - -如果某一个包需要一定的资源,如共享库,或者需要另一个包,据说就会存在依赖性问题。所有现在的包管理系统提供了一些解决依赖性的方法,以确保当安装一个包时,相关的依赖包也安装好了 - -**打包系统** - -几乎所有安装在现代Linux系统上的软件都会在互联网上找到。它要么能够通过中央库(中央库能包含几千个包,每个包都已经构建、测试并且维护好了)发行商得到,要么能够直接得到可以下载和手动安装的源代码。 - -由于不同的发行版使用不同的打包系统(Debian的*.deb文件/ CentOS的*.rpm文件/ openSUSE的专门为openSUSE构建的*.rpm文件),因此为一个发行版本开发的包会与其他发行版本不兼容。然而,大多数发行版本都可能是LFCS认证的三个发行版本之一。 - -**高级和低级打包工具** - -为了有效地进行包管理的任务,你需要知道,你将有两种类型的实用工具:低级工具(能在后端实际安装,升级,卸载包文件),以及高级工具(负责确保能很好的执行依赖性解决和元数据检索的任务,元数据也称为关于数据的数据)。 - -注:表格 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
发行版低级工具高级工具
 Debian版及其衍生版 dpkg apt-get / aptitude
 CentOS版 rpm yum
 openSUSE版 rpm zypper
- -让我们来看下低级工具和高级工具的描述。 - -dpkg的是基于Debian系统中的一个低级包管理器。它可以安装,删除,提供有关资料,并建立*.deb包,但它不能自动下载并安装它们相应的依赖包。 - -- 阅读更多: [15个dpkg命令实例][1] - -apt-get是Debian和衍生版的高级包管理器,并提供命令行方式从多个来源检索和安装软件包,其中包括解决依赖性。和dpkg不同的是,apt-get不是直接基于.deb文件工作,而是基于包的正确名称。 - -- 阅读更多: [25个apt-get命令实力][2] - -Aptitude是基于Debian的系统的另一个高级包管理器,它可用于快速简便的执行管理任务(安装,升级和删除软件包,还可以自动处理解决依赖性)。与atp-get和额外的包管理器相比,它提供了相同的功能,例如提供对包的几个版本的访问。 - -rpm是Linux标准基础(LSB)兼容发布版使用的一种包管理器,用来对包进行低级处理。就像dpkg,rpm可以查询,安装,检验,升级和卸载软件包,并能被基于Fedora的系统频繁地使用,比如RHEL和CentOS。 - -- 阅读更多: [20个rpm命令实例][3] - -相对于基于RPM的系统,yum增加了系统自动更新的功能和带依赖性管理的包管理功能。作为一个高级工具,和apt-get或者aptitude相似,yum基于库工作。 - -- 阅读更多: [20个yum命令实例][4] -- -### 低级工具的常见用法 ### - -你用低级工具处理最常见的任务如下。 - -**1. 从已编译(*.deb或*.rpm)的文件安装一个包** - -这种安装方法的缺点是没有提供解决依赖性的方案。当你在发行版本库中无法获得某个包并且又不能通过高级工具下载安装时,你很可能会从一个已编译文件安装该包。因为低级工具不需要解决依赖性问题,所以当安装一个没有解决依赖性的包时会出现出错并且退出。 - - # dpkg -i file.deb [Debian版和衍生版] - # rpm -i file.rpm [CentOS版 / openSUSE版] - -**注意**: 不要试图在CentOS中安装一个为openSUSE构建的.rpm文件,反之亦然! - -**2. 从已编译文件中更新一个包** - -同样,当中央库中没有某安装包时,你只能手动升级该包。 - - # dpkg -i file.deb [Debian版和衍生版] - # rpm -U file.rpm [CentOS版 / openSUSE版] - -**3. 列举安装的包** - -当你第一次接触一个已经在工作中的系统时,很可能你会想知道安装了哪些包。 - - # dpkg -l [Debian版和衍生版] - # rpm -qa [CentOS版 / openSUSE版] - -如果你想知道一个特定的包安装在哪儿, 你可以使用管道命令从以上命令的输出中去搜索,这在这个系列的[操作Linux文件 – 第一讲][5] 中有介绍。假定我们需要验证mysql-common这个包是否安装在Ubuntu系统中。 - - # dpkg -l | grep mysql-common - -![Check Installed Packages in Linux](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Installed-Package.png) - -检查安装的包 - -另外一种方式来判断一个包是否已安装。 - - # dpkg --status package_name [Debian版和衍生版] - # rpm -q package_name [CentOS版 / openSUSE版] - -例如,让我们找出sysdig包是否安装在我们的系统。 - - # rpm -qa | grep sysdig - -![Check sysdig Package](http://www.tecmint.com/wp-content/uploads/2014/11/Check-sysdig-Package.png) - -检查sysdig包 - -**4. 查询一个文件是由那个包安装的** - - # dpkg --search file_name - # rpm -qf file_name - -例如,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) - -Linux中查询文件 - -### 高级工具的常见用法 ### - -你用高级工具处理最常见的任务如下。 - -**1. 搜索包** - -aptitude更新将会更新可用的软件包列表,并且aptitude搜索会根据包名进行实际性的搜索。 - - # aptitude update && aptitude search package_name - -在搜索所有选项中,yum不仅可以通过包名还可以通过包的描述搜索程序包。 - - # yum search package_name - # yum search all package_name - # yum whatprovides “*/package_name” - -假定我们需要一个名为sysdig的包,要知道的是我们需要先安装然后才能运行。 - - # yum whatprovides “*/sysdig” - -![Check Package Description in Linux](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Package-Description.png) - -检查包描述 - -whatprovides告诉yum搜索一个含有能够匹配上述正则表达式的文件的包。 - - # zypper refresh && zypper search package_name [在openSUSE上] - -**2. 从仓库安装一个包** - -当安装一个包时,在包管理器解决了所有依赖性问题后,可能会提醒你确认安装。需要注意的是运行更新或刷新(根据所使用的软件包管理器)不是绝对必要,但是考虑到安全性和依赖性的原因,保持安装的软件包是最新的是一个好的系统管理员的做法。 - - # aptitude update && aptitude install package_name [Debian版和衍生版] - # yum update && yum install package_name [CentOS版] - # zypper refresh && zypper install package_name [openSUSE版] - -**3. 卸载包** - -按选项卸载将会卸载软件包,但把配置文件保留完好,然而清除包从系统中完全删去该程序。 -# aptitude remove / purge package_name -# yum erase package_name - - ---注意要卸载的openSUSE包前面的减号 --- - - # zypper remove -package_name - -在默认情况下,大部分(如果不是全部)的包管理器会提示你,在你实际卸载之前你是否确定要继续卸载。所以,请仔细阅读屏幕上的信息,以避免陷入不必要的麻烦! - -**4. 显示包的信息** - -下面的命令将会显示birthday这个包的信息。 - - # 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) - -检查包信息 - -### 总结 ### - -作为一个系统管理员,包管理器是你不能回避的东西。你应该立即准备使用本文中介绍的这些工具。希望你在准备LFCS考试和日常工作中会觉得这些工具好用。欢迎在下面留下您的意见或问题,我们将尽可能快的回复你。 - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/linux-package-management/ - -作者:[Gabriel Cánepa][a] -译者:[Flowsnow](https://github.com/Flowsnow) -校对:[校对者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 e1dff486b08997cfc02b5ca07ee61d5f1539f307 Mon Sep 17 00:00:00 2001 From: martin qi Date: Mon, 13 Jun 2016 04:11:24 +0800 Subject: [PATCH 0899/1469] Translated --- ...sharing: integrating Pydio and ownCloud.md | 67 ------------------- ...sharing: integrating Pydio and ownCloud.md | 65 ++++++++++++++++++ 2 files changed, 65 insertions(+), 67 deletions(-) delete mode 100644 sources/tech/20160519 The future of sharing: integrating Pydio and ownCloud.md create mode 100644 translated/tech/20160519 The future of sharing: integrating Pydio and ownCloud.md diff --git a/sources/tech/20160519 The future of sharing: integrating Pydio and ownCloud.md b/sources/tech/20160519 The future of sharing: integrating Pydio and ownCloud.md deleted file mode 100644 index b2174b18c2..0000000000 --- a/sources/tech/20160519 The future of sharing: integrating Pydio and ownCloud.md +++ /dev/null @@ -1,67 +0,0 @@ -martin - -The future of sharing: integrating Pydio and ownCloud -========================================================= - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BIZ_darwincloud_520x292_0311LL.png?itok=5yWIaEDe) ->Image by : -opensource.com - -The open source file sharing ecosystem accommodates a large variety of projects, each supplying their own solution, and each with a different approach. There are a lot of reasons to choose an open source solution rather than commercial solutions like Dropbox, Google Drive, iCloud, or OneDrive. These solutions offer to take away worries about managing your data but come with certain limitations, including a lack of control and integration into existing infrastructure. - -There are quite a few file sharing and sync alternatives available to users, including ownCloud and Pydio. - -### Pydio - -The Pydio (Put your data in orbit) project was founded by musician Charles du Jeu, who needed a way to share large audio files with his bandmates. [Pydio][1] is a file sharing and sync solution, with multiple storage backends, designed with developers and system administrators in mind. It has over one million downloads worldwide and has been translated into 27 languages. - -Open source from the very start, the project grew organically on [SourceForge][2] and now finds its home on [GitHub][3]. - -The user interface is based on Google's [Material Design][4]. Users can use an existing legacy file infrastructure or set up Pydio with an on-premise approach, and use web, desktop, and mobile applications to manage their assets everywhere. For administrators, the fine-grained access rights are a powerful tool for configuring access to assets.​ - -On the [Pydio community page][5], you will find several resources to get you up to speed quickly. The Pydio website gives some clear guidelines on [how to contribute][6] to the Pydio repositories on GitHub. The [forum][7] includes sections for developers and community. - -### ownCloud - -[ownCloud][8] has over 8 million users worldwide and is an open source, self-hosted file sync and sharing technology. There are sync clients for all major platforms as well as WebDAV through a web interface. ownCloud has an easy to use interface, powerful administrator tools, and extensive sharing and collaboration features—designed to give users control over their data. - -ownCloud's open architecture is extensible via an API and offers a platform for apps. Over 300 applications have been written, featuring capabilities like handling calendar, contacts, mail, music, passwords, notes, and many other types of data. ownCloud provides security, scales from a Raspberry Pi to a cluster with petabytes of storage and millions of users, and is developed by an international community of hundreds of contributors. - -### Federated sharing - -File sharing is starting to shift toward teamwork, and standardization provides a solid basis for such collaboration. - -Federated sharing, a new open standard supported by the [OpenCloudMesh][9] project, is a step in that direction. Among other things, it allows for the sharing of files and folders between servers that support this, like Pydio and ownCloud instances. - -First introduced in ownCloud 7, this server-to-server sharing allows you to mount file shares from remote servers, in effect creating your own cloud of clouds. You can create direct share links with users on other servers that support federated cloud sharing. - -Implementing this new API allows for deeper integration between storage solutions while maintaining the security, control, and attributes of the original platforms. - -"Exchanging and sharing files is something that is essential today and tomorrow," ownCloud founder Frank Karlitschek said. "Because of that, it is important to do this in a federated and distributed way without centralized data silos. The number one design goal [of federated sharing] is to enable sharing in the most seamless and easiest way while protecting the security and privacy of the users." - -### What's next? - -An initiative like OpenCloudMesh will extend this new open standard of file sharing through cooperation of institutions and companies like Pydio and ownCloud. ownCloud 9 has already introduced the ability for federated servers to exchange user lists, enabling the same seamless auto-complete experience you have with users on your own server. In the future, the idea of having a (federated!) set of central address book servers that can be used to search for others' federated cloud IDs might bring inter-cloud collaboration to an even higher level. - -The initiative will undoubtedly contribute to already growing open technical community within which members can easily discuss, develop, and contribute to the "OCM sharing API" as a vendor-neutral protocol. All leading partners of the OCM project are fully committed to the open API design principle and welcome other open source file share and sync communities to participate and join the connected cloud. - --------------------------------------------------------------------------------- - -via: https://opensource.com/business/16/5/sharing-files-pydio-owncloud - -作者:[ben van 't ende][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/benvantende -[1]: https://pydio.com/ -[2]: https://sourceforge.net/projects/ajaxplorer/ -[3]: https://github.com/pydio/ -[4]: https://www.google.com/design/spec/material-design/introduction.html -[5]: https://pydio.com/en/community -[6]: https://pydio.com/en/community/contribute -[7]: https://pydio.com/forum/f -[8]: https://owncloud.org/ -[9]: https://wiki.geant.org/display/OCM/Open+Cloud+Mesh diff --git a/translated/tech/20160519 The future of sharing: integrating Pydio and ownCloud.md b/translated/tech/20160519 The future of sharing: integrating Pydio and ownCloud.md new file mode 100644 index 0000000000..bf5a25c77e --- /dev/null +++ b/translated/tech/20160519 The future of sharing: integrating Pydio and ownCloud.md @@ -0,0 +1,65 @@ +分享的未来:整合 Pydio 与 ownCloud +========================================================= + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BIZ_darwincloud_520x292_0311LL.png?itok=5yWIaEDe) +>图片来源 : +opensource.com + +开源共享生态圈内容纳了许多各异的项目,他们每一个都能提供出自己的解决方案,且每一个都不按套路来。有很多原因导致你选择开源的解决方案,而非 Dropbox、Google Drive、iCloud 或 OneDrive 这些商业的解决方案。这些商业的解决方案虽然能让你不必为如何管理数据担心,但也理所应当的带着种种限制,其中就包含对于原有基础结构的控制和整合不足。 + +对于用户而言仍有相当一部分文件分享和同步的替代品可供选择,其中就包括了 Pydio 和 ownCloud。 + +### Pydio + +Pydio (Put your data in orbit 把你的数据放上轨道) 项目由一位作曲家 Charles du Jeu 发起,起初他也只是需要一种与乐队成员分享大型音频文件的方法。[Pydio][1] 是一种文件分享与同步的解决方案,综合了多存储后端,设计时还同时考虑了开发者和系统管理员两方面。在世界各地有逾百万的下载量,已被翻译成 27 种语言。 + +项目在很开始的时候便开源了,先是在 [SourceForge][2] 上茁壮的成长,现在已在 [GitHub][3] 上安了家.。 + +用户界面基于 Google 的 [Material 设计][4]。用户可以使用现有的传统的文件基础结构或是本地部署 Pydio,并通过 web、桌面和移动端应用随时随地地管理自己的东西。对于管理员来说,细粒度的访问权限绝对是配置访问时的利器。 + +在 [Pydio 社区][5],你可以找到许多让你增速的资源。Pydio 网站 [对于如何为 Pydio GitHub 仓库贡献][6] 给出了明确的指导方案。[论坛][7]中也包含了开发者板块和社区。 + +### ownCloud + +[ownCloud][8] 在世界各地拥有逾 8 百万的用户,并且开源,支持自托管文件同步,且共享技术。同步客户端支持所有主流平台并支持 WebDAV 通过 web 界面实现。ownCloud 拥有简单的使用界面,强大的管理工具,和大规模的共享及协作功能——以满足用户管理数据时的需求。 + +ownCloud 的开放式架构是通过 API 和为应用提供平台来实现可扩展性的。迄今已有逾 300 款应用,功能包括处理像日历、联系人、邮件、音乐、密码、笔记等诸多数据类型。ownCloud 由一个数百位贡献者的国际化的社区开发,安全,并且能做到为小到一个树莓派大到好几百万用户的 PB 级存储集群量身定制。 + +### 联合共享 (Federated sharing) + +文件共享开始转向团队合作时代,而标准化为合作提供了坚实的土壤。 + +联合共享——一个由 [OpenCloudMesh][9] 项目提供的新开放标准,就是在这个方向迈出的一步。先不说别的,在支持该标准的服务端上,可以像 Pydio 和 ownCloud 那样分享文件和文件夹。 + +ownCloud 7 率先引入,这种服务端到服务端的分享方式可以让你挂载远程服务端上共享的文件,实际上就是创建你所有云的云。你可以直接创建共享链接,让用户在其他支持联合云共享的服务端上使用。 + +实现这个新的 API 允许存储解决方案之间更深层次的集成,同时保留了原有平台的安全,控制和属性。 + +“交换和共享文件是当下和未来不可或缺的东西。”ownCloud 的创始人 Frank Karlitschek 说道:“正因如此,采用联合和分布的方式而非集中的数据孤岛就显得至关重要。[联合共享]的设计初衷便是在保证安全和用户隐私的同时追求分享的无缝、至简之道。” + +### 下一步是什么呢? + +正如 OpenCloudMesh 做的那样,将会通过像 Pydio 和 ownCloud 这样的机构和公司,合作推广这一文件共享的新开放标准。ownCloud 9 已经引入联合服务端间交换用户列表的功能,让你的用户在你的服务器上享有和你同样的无缝体验。将来,一个中央地址簿服务(联合!)集合,用以检索其他联合云 ID 的想法可能会把云间合作推向一个新的高度。 + +这一举措无疑有助于日益开放的技术社区中的那些成员方便地讨论,开发,并推动“OCM 分享 API”作为一个厂商中立协议。所有领导 OCM 项目的合作伙伴都全心致力于开放 API 的设计原理,并欢迎其他开源的文件分享和同步社区参与并加入其中。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/business/16/5/sharing-files-pydio-owncloud + +作者:[ben van 't ende][a] +译者:[martin2011qi](https://github.com/martin2011qi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/benvantende +[1]: https://pydio.com/ +[2]: https://sourceforge.net/projects/ajaxplorer/ +[3]: https://github.com/pydio/ +[4]: https://www.google.com/design/spec/material-design/introduction.html +[5]: https://pydio.com/en/community +[6]: https://pydio.com/en/community/contribute +[7]: https://pydio.com/forum/f +[8]: https://owncloud.org/ +[9]: https://wiki.geant.org/display/OCM/Open+Cloud+Mesh From 4a3a73351059dd3980090aa48bcf1563c7c168c2 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 13 Jun 2016 09:24:50 +0800 Subject: [PATCH 0900/1469] PUB:20160601 scp command in Linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @lujianbo 可以注意一下中文标点符号、中英文间的空格等排版问题。加油! https://linux.cn/article-7456-1.html --- .../20160601 scp command in Linux.md | 87 ++++++++----------- 1 file changed, 38 insertions(+), 49 deletions(-) rename {translated/tech => published}/20160601 scp command in Linux.md (51%) diff --git a/translated/tech/20160601 scp command in Linux.md b/published/20160601 scp command in Linux.md similarity index 51% rename from translated/tech/20160601 scp command in Linux.md rename to published/20160601 scp command in Linux.md index 949409ff44..0a299cbed0 100644 --- a/translated/tech/20160601 scp command in Linux.md +++ b/published/20160601 scp command in Linux.md @@ -1,12 +1,11 @@ -Linux中的scp命令 +在 Linux 下使用 scp 命令 ======================= ![](https://www.unixmen.com/wp-content/uploads/2016/05/SCP-LOGO-1.jpg) +scp 是安全拷贝协议 (Secure Copy Protocol)的缩写,和众多 Linux/Unix 使用者所熟知的拷贝(cp)命令一样。scp 的使用方式类似于 cp 命令,cp 命令将一个文件或文件夹从本地操作系统的一个位置(源)拷贝到目标位置(目的),而 scp 用来将文件或文件夹从网络上的一个主机拷贝到另一个主机当中去。 -scp 意味着安全拷贝协议 (Secure Copy Protocol), 和众多Linux/Unix使用者所了解的拷贝(cp)命令一样. scp 的使用方式跟 cp命令是很相似的, cp命令将一个文件或文件夹从本地操作系统的一个位置拷贝到目标位置上,而scp用来将一个文件或者文件夹通过网络传输从一个主机拷贝到另一个主机当中去。 - -scp命令的使用方法如下所示,在这个例子中,我将一个叫 “imporimposetantfile”的文件从本机(10.10.16.147)拷贝到远程主机(10.0.0.6)中。在这个命令里,你也可以使用主机名字来替代IP地址。 +scp 命令的使用方法如下所示,在这个例子中,我将一个叫 “importantfile” 的文件从本机(10.10.16.147)拷贝到远程主机(10.0.0.6)中。在这个命令里,你也可以使用主机名字来替代IP地址。 ``` [root@localhost ~]# scp importantfile admin@10.0.0.6:/home/admin/ @@ -20,7 +19,7 @@ importantfile 100% 0 0.0KB/s 00:00 [root@localhost ~]# ``` -同样的,如果你想从一个远程主机中获取文件,你可以利用如下的scp命令。 +类似的,如果你想从一个远程主机中取得文件,你可以利用如下的 scp 命令。 ``` [root@localhost ~]# scp root@10.10.16.137:/root/importantfile /home/admin/ @@ -33,50 +32,39 @@ importantfile 100% 0 0.0KB/s 00:00 [root@localhost ~]# ``` -你同样可以像cp命令一样,在scp命令中使用不同的选项,scp的man文件详细地阐述了不同选项的用法和优点。 +你也可以像 cp 命令一样,在 scp 命令中使用不同的选项,scp 的 man 帮助详细地阐述了不同选项的用法和用处。 -**简单输出.** +**示例输出** ![](https://www.unixmen.com/wp-content/uploads/2016/05/scp.jpg) -``` -scp可选参数如下所示: - -B 采取批量模式 (prevents asking for passwords or passphrases). - - -C 允许压缩. 通过指明-C来开启压缩模式. +scp 可选参数如下所示: + -B 采取批量模式(避免询问密码或口令) + -C 启用压缩。通过指明 -C 参数来开启压缩模式。 -c 加密方式 - 选择在传输过程中用来加密的加密方式 - 这个选项会被直接传递到ssh(1). - - -F ssh配置 - 为ssh指定一个用来替代默认配置的文件. - 这个选项会被直接传递到ssh(1). - + 选择在传输过程中用来加密的加密方式 这个选项会被直接传递到 ssh(1)。 + -F ssh 配置 + 给 ssh 指定一个用来替代默认配置的配置文件。这个选项会被直接传递到 ssh(1)。 -l 限速 - 限制命令使用的带宽, 默认单位是 Kbit/s. - + 限制命令使用的带宽,默认单位是 Kbit/s。 -P 端口 - 指定需要的连接的远程主机的端口. - 注意,这个选项使用的是一个大写的"P", 因为小写的 -p 已经用来保留目标文件的时间和模式相关信息。 + 指定需要的连接的远程主机的端口。 + 注意,这个选项使用的是一个大写的“P”,因为小写的“-p”已经用来保留目标文件的时间和模式相关信息。(LCTT 译注:ssh 命令中使用小写的“-p”来指定目标端口。) + -p 保留文件原来的修改时间,访问时间以及权限模式。 + -q 静默模式:不显示来自 ssh(1) 命令的进度信息,警告和诊断信息。 + -r 递归拷贝整个目录。 + 注意,scp 命令在树形遍历的时候同样会跟随符号连接,复制所连接的文件。 + -v 详细模式。scp 和 ssh(1) 将会打印出处理过程中的调试信息。这可以帮助你调试连接、认证和配置方面的问题。 - -p 保留目标文件的修改时间,访问时间以及权限模式. +**详细模式** - -q 静默模式: 不显示来自ssh(1)命令的进度信息,警告和诊断信息. - - -r 递归拷贝整个目录. - 注意,scp命令在树形遍历的时候同样会对符号连接进行相同的处理。 - - -v 详细模式.scp和ssh(1)将会打印出处理过程中的调试信息.当你要调试连接,认证和配置问题的时候这将会帮助到你。 - -``` - -利用scp命令的-v选项,你可以获得认证,调试相关的处理信息. +利用 scp 命令的 -v 选项,你可以得到认证、调试等的相关细节信息。 ![](http://www.unixmen.com/wp-content/uploads/2016/05/scp-v.jpg) -当我们使用-v选项的时候,一个简单的输出如下所示 +当我们使用 -v 选项的时候,一个简单的输出如下所示: ``` [root@localhost ~]# scp -v abc.txt admin@10.0.0.6:/home/admin @@ -111,26 +99,27 @@ debug1: Exit status 0 [root@localhost ~]# ``` -当我们需要拷贝一个目录或者文件夹的时候,我们可以使用-r选项,它会递归拷贝整个目录。 +当我们需要拷贝一个目录或者文件夹的时候,我们可以使用 -r 选项,它会递归拷贝整个目录。 ![](http://www.unixmen.com/wp-content/uploads/2016/05/scp-with-r.jpg) -静默模式: +**静默模式** 如果你想要关闭进度信息以及警告和诊断信息,你可以通过使用scp命令中的-q选项. ![](http://www.unixmen.com/wp-content/uploads/2016/05/scp-with-q.jpg) -上一次我们仅仅使用-r参数,它显示了逐个文件的信息,但这一次当我们使用了-q参数,它就不显示进度信息. +上一次我们仅仅使用 -r 参数,它显示了逐个文件的信息,但这一次当我们使用了 -q 参数,它就不显示进度信息。 -利用scp的-p选项来保留目标文件的更新时间,访问时间和权限模式. +利用 scp 的 -p 选项来保留目标文件的更新时间,访问时间和权限模式。 ![](http://www.unixmen.com/wp-content/uploads/2016/05/scp-with-p.jpg) -通过 -P 选项来指定远程主机的连接端口。 -scp使用ssh命令来在两个主机之间传输文件,因为ssh使用的是22端口号,所以scp也使用相同的22端口号. +**通过 -P 选项来指定远程主机的连接端口** -如果我们希望改变这个端口号,我们可以使用-P(大写的P,因为小写的p用来保存文件的访问时间等) 选项来指定所需的端口号 +scp 使用 ssh 命令来在两个主机之间传输文件,因为 ssh 默认使用的是22端口号,所以 scp 也使用相同的22端口号。 + +如果我们希望改变这个端口号,我们可以使用 -P(大写的 P,因为小写的 p 用来保持文件的访问时间等)选项来指定所需的端口号。 举个例子,如果我们想要使用2222端口号,我们可以使用如下的命令 @@ -138,33 +127,33 @@ scp使用ssh命令来在两个主机之间传输文件,因为ssh使用的是22 [root@localhost ~]# scp -P 2222 abcd1 root@10.10.16.137:/root/ ``` -**限制命令使用的带宽, 指定的单位是 Kbit/s** +**限制命令使用的带宽,指定的单位是 Kbit/s** -如下所示,我们可以使用-l参数来指定scp命令所使用的带宽,在此我们将速度限制为512kbit/s +如下所示,我们可以使用 -l 参数来指定 scp 命令所使用的带宽,在此我们将速度限制为512kbit/s。 ![](http://www.unixmen.com/wp-content/uploads/2016/05/scp-with-l.jpg) **开启压缩** -如下所示,我们可以通过开启scp命令的压缩模式来节省传输过程中的带宽和时间 +如下所示,我们可以通过开启 scp 命令的压缩模式来节省传输过程中的带宽和时间。 ![](https://www.unixmen.com/wp-content/uploads/2016/05/scp-with-C.jpg) **选择加密数据的加密方式** -scp默认使用 AES-128的加密方式,如果我们想要改变这个加密方式,可以通过-c(小写的c) 参数来指定其他的加密方式 +scp 默认使用 AES-128 的加密方式,如果我们想要改变这个加密方式,可以通过 -c(小写的 c) 参数来指定其他的加密方式。 ![](http://www.unixmen.com/wp-content/uploads/2016/05/scp-with-cipher.jpg) -现在你可以利用scp(Secure copy)命令在你所属网络中的两个结点之间安全地拷贝文件了. +现在你可以利用 scp(Secure copy)命令在你所属网络中的两个节点之间安全地拷贝文件了。 -------------------------------------------------------------------------------- -via: https://www.unixmen.com/scp-command-linuxunix/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+unixmenhowtos+%28Unixmen+Howtos+%26+Tutorials%29 +via: https://www.unixmen.com/scp-command-linuxunix/ 作者:[Naga Ramesh][a] 译者:[lujianbo](https://github.com/lujianbo) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 93e5f6b8e9c4a708310c42d3b55f40d580328c75 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 13 Jun 2016 12:43:55 +0800 Subject: [PATCH 0901/1469] PUB:20160223 New Docker Data Center Admin Suite Should Bring Order to Containerization @geekpi --- ... Should Bring Order to Containerization.md | 48 ++++++++++++++++++ ... Should Bring Order to Containerization.md | 50 ------------------- 2 files changed, 48 insertions(+), 50 deletions(-) create mode 100644 published/20160223 New Docker Data Center Admin Suite Should Bring Order to Containerization.md delete mode 100644 translated/tech/20160223 New Docker Data Center Admin Suite Should Bring Order to Containerization.md diff --git a/published/20160223 New Docker Data Center Admin Suite Should Bring Order to Containerization.md b/published/20160223 New Docker Data Center Admin Suite Should Bring Order to Containerization.md new file mode 100644 index 0000000000..a2084582b3 --- /dev/null +++ b/published/20160223 New Docker Data Center Admin Suite Should Bring Order to Containerization.md @@ -0,0 +1,48 @@ +新的 Docker 数据中心管理套件使容器化变得更加井然有序 +=============================================================================== + +![](https://tctechcrunch2011.files.wordpress.com/2016/02/shutterstock_119411227.jpg?w=738) + +[Docker][1]之前发布了一个新的容器控制中心,称为Docker数据中心(DDC),其设计目的是用于大型和小型企业创建、管理和分发容器的一个集成管理控制台。 + +DDC是由包括Docker Universal Control Plane(也是同时发布的)和Docker Trusted Registry等不同的商业组件组成。它也包括了开源组件比如Docker Engine。这个产品让企业在一个中心管理界面中就可以管理整个Docker化程序的生命周期。 + +负责产品管理的SVP Scott Johnston告诉TechCrunch:“客户催使了这个新工具的产生。公司不仅喜欢Docker给他们带来的敏捷性,它们也希望在创建和分发容器的过程中可以进行对安全和管理进行控制。” + +Johnston说:“公司称这个为容器即服务(Caas),主要是因为当客户来询问这种类型的管理面板时,他们是这样描述的。” + +![](https://tctechcrunch2011.files.wordpress.com/2016/02/screen-shot-2016-02-23-at-7-56-54-am.png?w=680&h=401) + +像许多开源项目那样,Docker首先获得了许多开发者的追随,但是随着它的流行,那些开发者们所在的公司也希望积极推进它的使用。 + +这就是DDC设计的目的。它给开发者创建容器化应用的敏捷性,也让运维变得井井有条。 + +实际上这意味着开发者可以创建一系列容器化的组件,将其部署后就可以访问一个完全认证的镜像库。这可以让开发人员用碎片组成应用而不必每次重新发明轮子。这可以加速应用的开发和部署(理论上提升了容器提供的灵活性)。 + +这方面吸引了Beta客户ADP。这个服务特别喜欢将这个提供给开发人员的中心镜像仓库。 + +ADP的CTO Keith Fulton在声明中称:“作为我们将关键业务微服务化倡议的一部分,ADP正在研究能够让开发人员可以利用IT审核过的中央库和安全的核心服务进行快速迭代的方案。” + +Docker在2010年由dotcloud的Solomon Hykes发布。他在2013年将公司的重心移到Docker上,并在[8月出售了dotCloud][2],2014年完全聚焦在Docker上。 + +根据CrunchBase的消息,公司几年来在5轮融资后势如破竹般获得了1亿8000万美元融资(自从成为Docker后获得了1亿6千8百万美元)。吸引投资者关注的是Docker提供了一种称为容器的现在分发应用的方式,可以构建、管理何分发分布式应用。 + +容器化可以让开发者创建由多个分布在不同服务器上的碎片组成的分布式应用,而不是一个运行在一个单独服务器上的独立应用。 + +DDC服务每月每节点150美金起。 + +-------------------------------------------------------------------------------- + +via: http://techcrunch.com/2016/02/23/new-docker-data-center-admin-suite-should-bring-order-to-containerization/ + +作者:[Ron Miller][a] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://techcrunch.com/author/ron-miller/ +[1]: https://www.docker.com/ +[2]: http://techcrunch.com/2014/08/04/docker-sells-dotcloud-to-cloudcontrol-to-focus-on-core-container-business/ + + diff --git a/translated/tech/20160223 New Docker Data Center Admin Suite Should Bring Order to Containerization.md b/translated/tech/20160223 New Docker Data Center Admin Suite Should Bring Order to Containerization.md deleted file mode 100644 index 147294c547..0000000000 --- a/translated/tech/20160223 New Docker Data Center Admin Suite Should Bring Order to Containerization.md +++ /dev/null @@ -1,50 +0,0 @@ -新的Docker数据中心管理套件使容器化变得更加井然有序 -=============================================================================== - -![](https://tctechcrunch2011.files.wordpress.com/2016/02/shutterstock_119411227.jpg?w=738) - -[Docker][1]今天宣布了一个新的容器控制中心,称为Docker数据中心(DDC),被设计用于大型和小型企业能够创建、管理和分发容器的一个集成管理控制台。 - -DDC是由包括Docker Universal Control Plane(也是今天发布)和Docker Trusted Registry等不同的商业组件组成。它也包括了开源组件比如Docker Engine。这个主意能让公司能够在一个中心管理界面中就能够管理整个Docker化程序的生命周期。 - -产品SVP Scott Johnston告诉TechCrunch:“客户催使了这个新工具的产生。公司不仅喜欢Docker给他们带来的敏捷性,它们也希望在创建和分发容器的过程中可以进行行政、安全和管理。” - -Johnston说:“公司称这个为容器即服务(Caas),大多是是因为当客户来询问这个管理的类型时,它们是这样描述的。” - -![](https://tctechcrunch2011.files.wordpress.com/2016/02/screen-shot-2016-02-23-at-7-56-54-am.png?w=680&h=401) - ->Docker免费镜像 - -像许多开源项目那样,Docker首先获得了许多开发者的追随,但是它也很快在那些想直接追踪管理它们的开发者的公司中流行。 - -这就是DDC设计的目的。它给开发者创建容器化应用的敏捷性,也让运维变得井井有条。 - -实际中这意味着开发者可以创建一系列容器化的组件,批准部署后就可以获得一个完全认证的镜像。这可以让开发这一系列的程序中拉取他们所需而不必每次重新发明轮子。这可以加速应用的开发和部署(理论上提升了容器提供的灵活性)。 - -这方面吸引了Beta客户ADP。工资服务业巨头特别喜欢让这个中心镜像仓库提供给开发人员。 - -ADP的CTO Keith Fulton在声明中称:“作为我们将关键业务微服务化倡议的一部分,ADP正在研究能够然开发人员可以利用IT审核过的中央库和安全的核心服务进行快速迭代的方案。” - -Docker在2010年由dotcloud的Solomon Hykes发布。他在2013年将公司的重心移到Docker上,并在[8月dotCloud][2],2014年完全聚焦在Docker上。 - -根据CrunchBase的消息,公司几年来在5轮融资后势如破竹般获得了1亿8000万美元融资(自从成为Docker后获得了1亿6千8百万美元)。吸引投资者关注的是Docker提供了一种称为容器的现在分发应用的方式,可以构建、管理何分发分布式应用。 - -容器化可以让开发者创建由多个小的分布在不同服务器上的分布式应用,而不是一个运行在一个单独服务器上的独立应用。 - -DDC每月每节点150美金起。 - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/calico-virtual-private-networking-docker/ - -作者:[ Ron Miller][a] -译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://techcrunch.com/author/ron-miller/ -[1]: https://www.docker.com/ -[2]: http://techcrunch.com/2014/08/04/docker-sells-dotcloud-to-cloudcontrol-to-focus-on-core-container-business/ - - From ff05bbed545ae78329a79613476e60e6ae152a81 Mon Sep 17 00:00:00 2001 From: gitfuture Date: Tue, 14 Jun 2016 12:15:49 +0800 Subject: [PATCH 0902/1469] Translated by GitFuture --- ...ve on Linux with google-drive-ocamlfuse.md | 68 ------------------- ...ve on Linux with google-drive-ocamlfuse.md | 68 +++++++++++++++++++ 2 files changed, 68 insertions(+), 68 deletions(-) delete mode 100644 sources/tech/20160602 How to mount your Google Drive on Linux with google-drive-ocamlfuse.md create mode 100644 translated/tech/20160602 How to mount your Google Drive on Linux with google-drive-ocamlfuse.md diff --git a/sources/tech/20160602 How to mount your Google Drive on Linux with google-drive-ocamlfuse.md b/sources/tech/20160602 How to mount your Google Drive on Linux with google-drive-ocamlfuse.md deleted file mode 100644 index 25fcda37d8..0000000000 --- a/sources/tech/20160602 How to mount your Google Drive on Linux with google-drive-ocamlfuse.md +++ /dev/null @@ -1,68 +0,0 @@ -Translating by GitFuture - -How to mount your Google Drive on Linux with google-drive-ocamlfuse -======================================================================== - ->If you're looking for an easy way to mount your Google Drive folders to a Linux box, Jack Wallen shows you how with the help of google-drive-ocamlfuse. - -![](http://tr4.cbsistatic.com/hub/i/2016/05/18/ee5d7b81-e5be-4b24-843d-d3ca99230a63/651be96ac8714698f8100afa6883e64d/linuxcloudhero.jpg) ->Image: Jack Wallen - -Google has yet to release a Linux version of its Google Drive app, though there are plenty of ways to gain access to your Drive files from Linux. - -If you prefer a GUI tool, you've got Insync. If you prefer the command line, there are tools such as Grive2 and the incredibly easy to use FUSE-based system written in Ocaml. I'll show how to use the latter to mount your Google Drive account on your Linux desktop. Although it's done via the command line, you'll be surprised at how easy it is to pull off. It's so easy, anyone can do it. - -This system features: - -- Full read/write access to ordinary files/folders -- Read-only access to Google Docs, sheets, and slides -- Access to your Drive's Trash (.trash) Directory -- Duplicate file handling -- Support for multiple accounts - -Let's walk through the installation and setup of google-drive-ocamlfuse on a Ubuntu 16.04 desktop so you can gain access to your Drive files. - -### Installation - -1. Open a terminal window. -2. Add the necessary PPA with the command sudo add-apt-repository ppa:alessandro-strada/ppa. -3. When prompted, type your sudo password and hit Enter. -4. Update app with the command sudo apt-get update. -5. Install the software by issuing the command sudo apt-get install google-drive-ocamlfuse. - -### Authorization - -The next step is to authorize google-drive-ocamlfuse so it will have access to your Google account. To do this, go back to the terminal window and issue the command google-drive-ocamlfuse. This command will open a browser window that will either prompt you to log into your Google account or, if you're already logged in, ask you to allow google-drive-ocamlfuse access to your Google account. If you've not logged in, do so and then click Allow. The next window (which appeared on a Ubuntu 16.04 desktop, but not an Elementary OS Freya desktop) will ask you to grant permission for both gdfuse and OAuth2 Endpoint to access your Google account. Click Allow again. The next browser screen will inform you to wait until the authorization tokens have downloaded; you can minimize the browser at this point. When your terminal prompt returns (Figure A), you know the tokens have been downloaded, and you're ready to mount. - -**Figure A** - -![](http://tr4.cbsistatic.com/hub/i/r/2016/05/18/a493122b-445f-4aca-8974-5ec41192eede/resize/620x/6ae5907ad2c08dc7620b7afaaa9e389c/googledriveocamlfuse3.png) ->Image: Jack Wallen - -**The app has been authorized, and you're ready to go.** - -### Mounting your Google Drive - -Before you mount your Google Drive, you must create a folder to serve as the mount point. From the terminal, issue the command mkdir ~/google-drive to create a new folder in your home directory. Finally, issue the command google-drive-ocamlfuse ~/google-drive to mount your Google Drive to the google-drive folder. - -At this point, you should see your Google Drive files/folders populate in the google-drive folder. You can work with Google Drive as if it were a local folder system. - -When you want to unmount the google-drive folder, issue the command fusermount -u ~/google-drive. - -### It's no GUI, but it works like a champ - -I find this particular system really handy to use. It's incredibly fast at syncing with Google Drive, and it can make for an elegant means of backing up your Google Drive account locally. - -Give google-drive-ocamlfuse a go, and see what kind of magic you can make with it. - --------------------------------------------------------------------------------- - -via: http://www.techrepublic.com/article/how-to-mount-your-google-drive-on-linux-with-google-drive-ocamlfuse/ - -作者:[Jack Wallen ][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://www.techrepublic.com/search/?a=jack+wallen diff --git a/translated/tech/20160602 How to mount your Google Drive on Linux with google-drive-ocamlfuse.md b/translated/tech/20160602 How to mount your Google Drive on Linux with google-drive-ocamlfuse.md new file mode 100644 index 0000000000..b64fa51ab0 --- /dev/null +++ b/translated/tech/20160602 How to mount your Google Drive on Linux with google-drive-ocamlfuse.md @@ -0,0 +1,68 @@ +教你用 google-drive-ocamlfuse 在 Linux 上挂载 Google Drive +===================== + +>如果你在找一个方便的方式在 Linux 机器上挂载你的 Google Drive 文件夹, Jack Wallen 将教你怎么使用 google-drive-ocamlfuse 来挂载 Google Drive。 + +![](http://tr4.cbsistatic.com/hub/i/2016/05/18/ee5d7b81-e5be-4b24-843d-d3ca99230a63/651be96ac8714698f8100afa6883e64d/linuxcloudhero.jpg) +>图片来源: Jack Wallen + +Google 还没有发行 Linux 版本的 Google Drive 应用,尽管现在有很多方法从 Linux 中访问你的 Drive 文件。 +(注:不清楚 app 需不需要翻译成应用,这里翻译了) + +如果你喜欢界面化的工具,你可以选择 Insync。如果你喜欢用命令行,这有很多工具,像 Grive2 和用 Ocaml 语言编写的、非常容易使用的、基于 FUSE 的系统(注:there are tools such as Grive2 and the incredibly easy to use FUSE-based system written in Ocaml. 这一句感觉翻译不出来)。我将会用后面这种方式演示如何在 Linux 桌面上挂载你的 Google Drive。尽管这是通过命令行完成的,但是它的用法会简单到让你吃惊。它太简单了以至于谁都能做到。 + +系统特点: + +- 对普通文件/文件夹有完全的读写权限 +- 对于 Google Docs,sheets,slides 这三个应用只读 +- 能够访问 Drive 回收站(.trash) +- 处理重复文件功能 +- 支持多个帐号 + +接下来完成 google-drive-ocamlfuse 在 Ubuntu 16.04 桌面的安装,然后你就能够访问云盘上的文件了。 + +### 安装 + +1. 打开终端。 +2. 用`sudo add-apt-repository ppa:alessandro-strada/ppa`命令添加必要的 PPA +3. 出现提示的时候,输入密码并按下回车。 +4. 用`sudo apt-get update`命令更新应用。 +5. 输入`sudo apt-get install google-drive-ocamlfuse`命令安装软件。 +(注:这里,我把所有的命令加上着重标记了) + +### 授权 + +接下来就是授权 google-drive-ocamlfuse,让它有权限访问你的 Google 账户。先回到终端窗口敲下命令 google-drive-ocamlfuse,这个命令将会打开一个浏览器窗口,它会提示你登陆你的 Google 帐号或者如果你已经登陆了 Google 帐号,它会询问是否允许 google-drive-ocamlfuse 访问 Google 账户。如果你还没有登陆,先登陆然后点击允许。接下来的窗口(在 Ubuntu 16.04 桌面上会出现,但不会出现在基本系统 Freya 桌面上)将会询问你是否授给 gdfuse 和 OAuth2 Endpoint访问你的 Google 账户的权限,再次点击允许。然后出现的窗口就会告诉你等待授权令牌下载完成,这个时候就能最小化浏览器了。当你的终端提示像图 A 一样的内容,你就能知道令牌下载完了,并且你已经可以挂载 Google Drive 了。 + +**图 A** + +![](http://tr4.cbsistatic.com/hub/i/r/2016/05/18/a493122b-445f-4aca-8974-5ec41192eede/resize/620x/6ae5907ad2c08dc7620b7afaaa9e389c/googledriveocamlfuse3.png) +>图片来源: Jack Wallen + +**应用已经得到授权,你可以进行后面的工作。** + +### 挂载 Google Drive + +在挂载 Google Drive 之前,你得先创建一个文件夹,作为挂载点。在终端里,敲下`mkdir ~/google-drive`命令在你的家目录下创建一个新的文件夹。最后敲下命令`google-drive-ocamlfuse ~/google-drive`将你的 Google Drive 挂载到 google-drive 文件夹中。 + +这时你可以查看本地 google-drive 文件夹中包含的 Google Drive 文件/文件夹。你能够把 Google Drive 当作本地文件系统来进行工作。 + +当你想 卸载 google-drive 文件夹,输入命令 `fusermount -u ~/google-drive`。 + +### 没有 GUI,但它特别好用 + +我发现这个特别的系统非常容易使用,在同步 Google Drive 时它出奇的快,并且这可以作为一种巧妙的方式备份你的 Google Drive 账户。 + +试试 google-drive-ocamlfuse,看看你能用它做出什么有趣的事。 + +-------------------------------------------------------------------------------- + +via: http://www.techrepublic.com/article/how-to-mount-your-google-drive-on-linux-with-google-drive-ocamlfuse/ + +作者:[Jack Wallen ][a] +译者:[GitFuture](https://github.com/GitFuture) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.techrepublic.com/search/?a=jack+wallen From 673fcc0656a3100a0df12f69ae16d3f4c4cdcc70 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 14 Jun 2016 13:58:44 +0800 Subject: [PATCH 0903/1469] PUB:20160214 How to Install MariaDB 10 on CentOS 7 CPanel Server @strugglingyouth --- ...ll MariaDB 10 on CentOS 7 CPanel Server.md | 42 ++++++++++--------- 1 file changed, 23 insertions(+), 19 deletions(-) rename {translated/tech => published}/20160214 How to Install MariaDB 10 on CentOS 7 CPanel Server.md (86%) diff --git a/translated/tech/20160214 How to Install MariaDB 10 on CentOS 7 CPanel Server.md b/published/20160214 How to Install MariaDB 10 on CentOS 7 CPanel Server.md similarity index 86% rename from translated/tech/20160214 How to Install MariaDB 10 on CentOS 7 CPanel Server.md rename to published/20160214 How to Install MariaDB 10 on CentOS 7 CPanel Server.md index 8d452af0ad..7bb0c3d00f 100644 --- a/translated/tech/20160214 How to Install MariaDB 10 on CentOS 7 CPanel Server.md +++ b/published/20160214 How to Install MariaDB 10 on CentOS 7 CPanel Server.md @@ -1,8 +1,7 @@ - 在 CentOS 7 CPanel 服务器上安装 MariaDB 10 ================================================================================ -MariaDB 是一个增强版的,开源的并且可以直接替代 MySQL。它主要由 MariaDB 社区在维护,采用 GPL v2 授权许可。软件的安全性是 MariaDB 开发者的主要焦点。他们保持为 MariaDB 的每个版本发布安全补丁。当有任何安全问题被发现时,开发者会尽快修复并推出 MariaDB 的新版本。 +MariaDB 是一个增强版的、开源的 MySQL 替代品。它主要由 MariaDB 社区在维护,采用 GPL v2 授权许可。软件的安全性是 MariaDB 开发者的主要焦点。他们保持为 MariaDB 的每个版本发布安全补丁。当有任何安全问题被发现时,开发者会尽快修复并推出 MariaDB 的新版本。 ### MariaDB 的优势 ### @@ -12,7 +11,7 @@ MariaDB 是一个增强版的,开源的并且可以直接替代 MySQL。它主 - 性能更好 - 比 MySQL 的存储引擎多 -在这篇文章中,我将谈论关于如何升级 MySQL5.5 到最新的 MariaDB 在CentOS7 CPanel 服务器上。在安装前先完成以下步骤。 +在这篇文章中,我将谈论关于如何在 CentOS7 CPanel 服务器上升级 MySQL5.5 到最新的 MariaDB 。在安装前先完成以下步骤。 ### 先决条件: ### @@ -62,7 +61,7 @@ MariaDB 是一个增强版的,开源的并且可以直接替代 MySQL。它主 #### 3. 从服务器上删除和卸载 MySQL 所有的 RPM 包 #### -运行以下命令来禁用 MySQL 的 RPM 的目标。通过运行此命令,cPanel 将不再处理 MySQL 的更新,并在系统上将卸载的标记为 rpm.versions。 +运行以下命令来禁用 MySQL RPM 的目标(target)。通过运行此命令,cPanel 将不再处理 MySQL 的更新,并在系统上将这些 RPM 版本标记为已卸载。 /scripts/update_local_rpm_versions --edit target_settings.MySQL50 uninstalled /scripts/update_local_rpm_versions --edit target_settings.MySQL51 uninstalled @@ -72,7 +71,8 @@ MariaDB 是一个增强版的,开源的并且可以直接替代 MySQL。它主 现在运行以下命令: /scripts/check_cpanel_rpms --fix --targets=MySQL50,MySQL51,MySQL55,MySQL56 -移除服务器上所有已存在的 MySQL rpms 来为 MariaDB 的安装清理环境。请看下面的输出: + +移除服务器上所有已有的 MySQL RPM 来为 MariaDB 的安装清理环境。请看下面的输出: root@server1 [/var/lib/mysql]# /scripts/check_cpanel_rpms --fix --targets=MySQL50,MySQL51,MySQL55,MySQL56 [2016-01-31 09:53:59 +0000] @@ -97,9 +97,9 @@ MariaDB 是一个增强版的,开源的并且可以直接替代 MySQL。它主 [2016-01-31 09:54:04 +0000] Removed symlink /etc/systemd/system/multi-user.target.wants/mysql.service. [2016-01-31 09:54:04 +0000] Restoring service monitoring. -通过这些步骤,我们已经卸载了现有的 MySQL RPMs,并做了标记来防止 MySQL的更新,服务器的环境已经清理然后准备安装 MariaDB。 +通过这些步骤,我们已经卸载了现有的 MySQL RPM,并做了标记来防止 MySQL的更新,服务器的环境已经清理,然后准备安装 MariaDB。 -开始安装吧,我们需要在 CentOS 为 MariaDB 创建一个 yum 软件库。下面是我的做法! +开始安装吧,我们需要根据 CentOS 和 MariaDB 的版本为 MariaDB 创建一个 yum 软件库。下面是我的做法! ### 安装步骤: ### @@ -120,18 +120,20 @@ MariaDB 是一个增强版的,开源的并且可以直接替代 MySQL。它主 #### 第2步:打开 /etc/yum.conf 并修改如下行: #### -**Remove this line** exclude=courier* dovecot* exim* filesystem httpd* mod_ssl* mydns* mysql* nsd* php* proftpd* pure-ftpd* spamassassin* squirrelmail* +**删除这一行:** -**And replace with this line** exclude=courier* dovecot* exim* filesystem httpd* mod_ssl* mydns* nsd* proftpd* pure-ftpd* spamassassin* squirrelmail* + exclude=courier* dovecot* exim* filesystem httpd* mod_ssl* mydns* mysql* nsd* php* proftpd* pure-ftpd* spamassassin* squirrelmail* -**\*\*\* IMPORTANT \*\*\*** +**替换为:** + + exclude=courier* dovecot* exim* filesystem httpd* mod_ssl* mydns* nsd* proftpd* pure-ftpd* spamassassin* squirrelmail* + +**重要** 需要确保我们已经从 exclude 列表中移除了 MySQL 和 PHP。 #### 第3步:运行以下命令来安装 MariaDB 和相关的包。 #### -**yum install MariaDB-server MariaDB-client MariaDB-devel php-mysql** - root@server1 [~]#yum install MariaDB-server MariaDB-client MariaDB-devel php-mysql Dependencies Resolved @@ -174,7 +176,7 @@ MariaDB 是一个增强版的,开源的并且可以直接替代 MySQL。它主 #### 第5步:运行 mysql_upgrade 命令。 #### -它将检查所有数据库中的所有表与当前安装的版本是否兼容并在必要时会更新系统表采取新的特权或功能,可能会增加当前版本的性能。 +它将检查所有数据库中的所有表与当前安装的版本是否兼容,并在必要时会更新系统表,以赋予当前版本新增加的权限或能力。 root@server1 [~]# mysql_upgrade @@ -254,7 +256,7 @@ MariaDB 是一个增强版的,开源的并且可以直接替代 MySQL。它主 Phase 6/6: Running 'FLUSH PRIVILEGES' OK -#### 第6步:再次重新启动MySQL的服务,以确保一切都运行完好。 #### +#### 第6步:再次重新启动 MySQL 的服务,以确保一切都运行完好。 #### root@server1 [~]# systemctl restart mysql root@server1 [~]# @@ -274,17 +276,18 @@ MariaDB 是一个增强版的,开源的并且可以直接替代 MySQL。它主 Jan 31 10:04:11 server1.centos7-test.com mysql[23854]: Starting MySQL. SUCCESS! Jan 31 10:04:11 server1.centos7-test.com systemd[1]: Started LSB: start and stop MySQL. -#### 第7步:运行 EasyApache 用 MariaDB 重建 Apache/PHP,并确保所有 PHP 的模块保持不变。#### +#### 第7步:运行 EasyApache,重建 Apache/PHP 以支持 MariaDB,并确保所有 PHP 的模块保持不变。#### root@server1 [~]#/scripts/easyapache --build - ****IMPORTANT ***** - If you forget to rebuild Apache/PHP after the MariaDB installation, it will report the library error as below: +**重要** + +如果你在安装 MariaDB 之后忘记重建 Apache/PHP,将会报如下库错误: root@server1 [/etc/my.cnf.d]# php -v php: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory -#### 第8步:现在验证安装的数据库。 #### +#### 第8步:现在验证安装的程序和数据库。 #### root@server1 [/var/lib/mysql]# mysql Welcome to the MariaDB monitor. Commands end with ; or \g. @@ -313,13 +316,14 @@ MariaDB 是一个增强版的,开源的并且可以直接替代 MySQL。它主 10 rows in set (0.00 sec) 就这样 :)。现在,我们该去欣赏 MariaDB 完善和高效的特点了。希望你喜欢阅读本文。希望留下您宝贵的建议和反馈! + -------------------------------------------------------------------------------- via: http://linoxide.com/how-tos/install-mariadb-10-centos-7-cpanel/ 作者:[Saheetha Shameer][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 967ee84bb7e3066208d73fa4e444f727ca6aec36 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 14 Jun 2016 14:09:01 +0800 Subject: [PATCH 0904/1469] PUB:20160218 Getting to Know Linux File Permissions @ynmlml --- ... Getting to Know Linux File Permissions.md | 80 ++++++++----------- 1 file changed, 35 insertions(+), 45 deletions(-) rename {translated/tech => published}/20160218 Getting to Know Linux File Permissions.md (62%) diff --git a/translated/tech/20160218 Getting to Know Linux File Permissions.md b/published/20160218 Getting to Know Linux File Permissions.md similarity index 62% rename from translated/tech/20160218 Getting to Know Linux File Permissions.md rename to published/20160218 Getting to Know Linux File Permissions.md index 2730806d61..99390b69ae 100644 --- a/translated/tech/20160218 Getting to Know Linux File Permissions.md +++ b/published/20160218 Getting to Know Linux File Permissions.md @@ -1,34 +1,29 @@ -初识Linux文件权限 +初识 Linux 文件权限 ================================================================================ -在 Linux 中最基本的任务之一就是设置文件权限。理解如何实现是你进入 LInux 世界的第一步。如您所料,这一基本操作在类 UNIX 操作系统中大同小异。实际上,Linux 文件权限系统就直接取自于 UNIX 文件权限(甚至使用许多相同的工具)。 +在 Linux 中最基本的任务之一就是设置文件权限。理解如何实现是你进入 Linux 世界的第一步。如您所料,这一基本操作在类 UNIX 操作系统中大同小异。实际上,Linux 文件权限系统就直接取自于 UNIX 文件权限(甚至使用许多相同的工具)。 ![](http://www.linux.com/images/stories/66866/files_a.png) 但不要以为理解文件权限需要长时间的学习。事实上会很简单,让我们一起来看看你需要了解哪些内容以及如何使用它们。 -##基础概念 +###基础概念 -你要明白的第一件事是文件权限适用于什么。你做的更有效的就是设置一个分组的权限。当你将其分解,那这个概念就真的简单多了。那到底什么是权限,什么是分组呢? +你要明白的第一件事是文件权限可以用来干什么。当你设置一个分组的权限时发生了什么?让我们将其展开来说,这个概念就真的简单多了。那到底什么是权限,什么是分组呢? 你可以设置的3种权限: -- 读 — 允许该组读文件(用`r`表示) +- 读 — 允许该分组读文件(用`r`表示) +- 写 — 允许该分组写文件(用`w`表示) +- 执行 — 允许该分组执行(运行)文件(用`x`表示) -- 写 — 允许该组写文件(用`w`表示) - -- 执行 — 允许该组执行(运行)文件(用`x`表示) - -为了更好地解释这如何应用于一个分组,例如,你允许一个分组读和写一个文件,但不能执行。或者,你可以允许一个组读和执行一个文件,但不能写。甚至你可以允许一组有读、写、执行全部的权限,也可以删除全部权限来剥夺组权限。 +为了更好地解释这如何应用于一个分组,例如,你允许一个分组可以读写一个文件,但不能执行。或者,你可以允许一个分组读和执行一个文件,但不能写。甚至你可以允许一个分组有读、写、执行全部的权限,也可以删除全部权限来去除该组的权限。 现在,什么是分组呢,有以下4个: - user — 文件实际的拥有者 - -- group — 用户所在的组 - +- group — 用户所在的用户组 - others — 用户组外的其他用户 - - all — 所有用户 大多数情况,你只会对前3组进行操作,`all` 这一组只是作为快捷方式(稍后我会解释)。 @@ -37,103 +32,98 @@ 如果你打开一个终端并运行命令 `ls -l`,你将会看到逐行列出当前工作目录下所有的文件和文件夹的列表(如图1). -你会留意到最左边那列是像 `-rw-rw-r--` 这样的。 +你会留意到最左边那列是像是 `-rw-rw-r--` 这样的。 -实际上这列表该这样看的: +实际上这列表应该这样看: ->rw- rw- r-- +> rw- rw- r-- 正如你所见,列表将其分为如下3部分: - rw- - - rw- - - r-- -权限和组的顺序都很重要,顺序总是: +权限和组的顺序都很重要,顺序总是: - 所属者 所属组 其他人 — 分组 - - 读 写 执行 — 权限 -在我们上面示例的权限列表中,所属者拥有读/写权限,所属组拥有读/写权限,其他人用户仅拥有读权限。这些分组中赋予执行权限的话,就用一个x表示。 +在我们上面示例的权限列表中,所属者拥有读/写权限,所属组拥有读/写权限,其他人用户仅拥有读权限。这些分组中赋予执行权限的话,就用一个 x 表示。 -## 等效数值 +### 等效数值 接下来我们让它更复杂一些,每个权限都可以用一个数字表示。这些数字是: - 读 — 4 - - 写 — 2 - - 执行— 1 数值代替不是一个一个的替换,你不能像这样: ->-42-42-4-- +> -42-42-4-- 你该把每个分组的数值相加,给用户读和写权限,你该用 4 + 2 得到 6。给用户组相同的权限,也是使用相同的数值。假如你只想给其他用户读的权限,那就设置它为4。现在用数值表示为: ->664 +> 664 -如果你想给一个文件664权限,你可以使用chmod命令,如: +如果你想给一个文件664权限,你可以使用 `chmod` 命令,如: ->chmod 664 FILENAME + chmod 664 FILENAME FILENAME 处为文件名。 -## 更改权限 +### 更改权限 -既然你已经理解了文件权限,那是时候学习如何更改这些权限了。就是使用chmod命令来实现。第一步你要知道你能否更改文件权限,你必须是文件的所有者或者有权限编辑文件(或者使用su或sudo进行操作)。正因为这样,你不能随意切换目录和更改文件权限。 +既然你已经理解了文件权限,那是时候学习如何更改这些权限了。就是使用 `chmod` 命令来实现。第一步你要知道你能否更改文件权限,你必须是文件的所有者或者有权限编辑文件(或者通过 `su` 或 `sudo` 得到权限)。正因为这样,你不能随意切换目录和更改文件权限。 继续用我们的例子 (`-rw-rw-r--`)。假设这个文件(命名为 script.sh)实际是个shell脚本,需要被执行,但是你只想让自己有权限执行这个脚本。这个时候,你可能会想:“我需要是文件的权限如 `-rwx-rw-r--`”。为了设置 `x` 权限位,你可以这样使用 `chmod` 命令: ->chmod u+x script.sh + chmod u+x script.sh 这时候,列表中显示的应该是 -rwx-rw-r-- 。 如果你想同时让用户及其所属组同时拥有执行权限,命令应该这样: ->chmod ug+x script.sh + chmod ug+x script.sh 明白这是怎么工作的了吗?下面我们让它更有趣些。不管什么原因,你不小心给了所有分组对文件的执行权限(列表中是这样的 `-rwx-rwx-r-x`)。 如果你想去除其他用户的执行权限,只需运行命令: ->chmod o-x script.sh + chmod o-x script.sh 如果你想完全删除文件的可执行权限,你可以用两种方法: ->chmod ugo-x script.sh + chmod ugo-x script.sh 或者 ->chmod a-x script.sh + chmod a-x script.sh -以上就是所有内容,能使操作更有效率。我希望能避免哪些可能会导致一些问题的操作(例如你不小心对 script.sh 使用 `a-rwx` 这样的chmod命令)。 +以上就是所有内容,能使操作更有效率。我希望能避免哪些可能会导致一些问题的操作(例如你不小心对 script.sh 使用 `a-rwx` 这样的 `chmod` 命令)。 -## 目录权限 +### 目录权限 你也可以对一个目录执行 `chmod` 命令。当你作为用户创建一个新的目录,通常新建目录具有这样的权限: ->drwxrwxr-x +> drwxrwxr-x 注:开头的 `d` 表示这是一个目录。 -正如你所见,用户及其所在组都对文件夹具有操作权限,但这并不意味着在这文件夹中出创建的问价也具有与其相同的权限(创建的文件使用默认系统的权限 `-rw-rw-r--`)。但如果你想在新文件夹中创建文件,并且移除用户组的写权限,你不用切换到该目录下并对所有文件使用chmod命令。你可以用加上参数R(意味着递归)的 `chmod` 命令,同时更改该文件夹及其目录下所有的文件的权限。 +正如你所见,用户及其所在组都对文件夹具有操作权限,但这并不意味着在这文件夹中出创建的文件也具有与其相同的权限(创建的文件使用默认系统的权限 `-rw-rw-r--`)。但如果你想在新文件夹中创建文件,并且移除用户组的写权限,你不用切换到该目录下并对所有文件使用 `chmod` 命令。你可以用加上参数 R(意味着递归)的 `chmod` 命令,同时更改该文件夹及其目录下所有的文件的权限。 现在,假设有一文件夹 TEST,里面有一些脚本,所有这些(包括 TEST 文件夹)拥有权限 `-rwxrwxr-x`。如果你想移除用户组的写权限,你可以运行命令: ->chmod -R g-w TEST + chmod -R g-w TEST 运行命令 `ls -l`,你讲看到列出的 TEST 文件夹的权限信息是 `drwxr-xr-x`。用户组被去除了写权限(其目录下的所有文件也如此)。 -## 总结 +### 总结 -现在,你应该对基本的Linux文件权限有了深入的理解。对于更高级的东西学起来会很轻松,像`setid`,`setuid` 和 `ACLs` 这些。没有良好的基础,你很快就会混淆不清概念的。 +现在,你应该对基本的 Linux 文件权限有了深入的理解。对于更高级的东西学起来会很轻松,像 setgid、setuid 和 ACL 这些。没有良好的基础,你很快就会混淆不清概念的。 -Linux 文件权限从早期到现在没有太大变化,而且很可能以后也不会。 +Linux 文件权限从早期到现在没有太大变化,而且很可能以后也不会变化。 ------------------------------------------------------------------------------ @@ -141,7 +131,7 @@ via: http://www.linux.com/learn/tutorials/885268-getting-to-know-linux-file-perm 作者:[Jack Wallen][a] 译者:[ynmlml](https://github.com/ynmlml) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 74d758d226eb475b9b36d3a541772c211658a322 Mon Sep 17 00:00:00 2001 From: carolinewuyan <309866211@qq.com> Date: Tue, 14 Jun 2016 16:41:09 +0800 Subject: [PATCH 0905/1469] =?UTF-8?q?=E5=B7=B2=E6=A0=A1=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...droid Use Apps Even Without Installing Them.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/translated/talk/20160518 Android Use Apps Even Without Installing Them.md b/translated/talk/20160518 Android Use Apps Even Without Installing Them.md index 12fd11ca7e..a8aecc1d19 100644 --- a/translated/talk/20160518 Android Use Apps Even Without Installing Them.md +++ b/translated/talk/20160518 Android Use Apps Even Without Installing Them.md @@ -1,16 +1,15 @@ 安卓的下一场革命:不安装即可使用应用! =================================================================== +谷歌安卓的一项新创新将可以让你无需安装即可在你的设备上使用应用程序。现在已经初具雏形。 -谷歌安卓的一项新创新将让你可以使用没有在你的设备上安装的应用。现在已经有了一些原型了。 +还记得那时候吗,某人发给你了一个链接,要求你通过安装来查看应用。 -还记得某人给你发了一个链接,要求你安装一个应用来查看的情形吗? - -是否要安装这个应用来查看一个一次性的链接,这个困境一定让你感到很挫败。而且,应用安装本身也会消耗你不少宝贵的时间。 +是否要安装这个应用来查看一个一次性的链接,这种进退两难的选择一定让你感到很沮丧。而且,应用安装本身也会消耗你不少宝贵的时间。 上述场景可能大多数人都经历过,或者说大多数现代科技用户都经历过。尽管如此,我们都接受这是正确且合理的过程。 -真的吗? +事实真的如此吗? 针对这个问题谷歌的安卓部门给出了一个全新的,开箱即用的答案: @@ -24,9 +23,9 @@ Android Instant Apps 声称第一时间帮你摆脱这样的两难境地,让 #### 它是怎么工作的? -Instant Apps 和你已经熟悉的应用基本相同,只有一个不同——这些应用为了满足你完成某项任务的需要,只提供给你已经经过**裁剪和模块化**的应用关键部分。 +Instant Apps 和你已经熟悉的应用基本相同,只有一个不同——这些应用为了满足你完成某项任务的需要,只提供给你已经经过**裁剪和模块化**的应用必要部分。 -例如,展开打开链接的场景作为例子,为了查看一个链接,你不需要拥有一个可以写,发送,做咖啡或其它特性的全功能应用。你所需要的全部就是查看功能——而这就是你所会获取到的部分。 +例如,展开打开链接的场景作为例子,为了查看一个链接,你不需要拥有一个可以写、发送,做咖啡或其它特性的全功能应用。你所需要的全部就是查看功能——而这就是你所会获取到的部分。 这样应用就可以快速打开,让你可以完成你的目标任务。 @@ -59,7 +58,7 @@ via: http://www.iwillfolo.com/androids-next-revolution-use-apps-even-without-ins 作者:[iwillfolo][a] 译者:[alim0x](https://github.com/alim0x) -校对:[校对者ID](https://github.com/校对者ID) +校对:[Caroline](https://github.com/carolinewuyan) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 08343597a930eaf3794bb396a3e7d685019c0300 Mon Sep 17 00:00:00 2001 From: carolinewuyan <309866211@qq.com> Date: Tue, 14 Jun 2016 18:59:53 +0800 Subject: [PATCH 0906/1469] =?UTF-8?q?=E5=B7=B2=E6=A0=A1=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...lation Guide on Ubuntu Server 16.04 LTS.md | 41 +++++++++---------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/translated/tech/20160529 LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS.md b/translated/tech/20160529 LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS.md index a687e87a30..1dc4e1133d 100644 --- a/translated/tech/20160529 LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS.md +++ b/translated/tech/20160529 LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS.md @@ -1,7 +1,7 @@ 在 Ubuntu Server 16.04 LTS 上安装 LAMP ========================================================= -LAMP方案是一系列自由和开源软件的集合,包含了 **Linux**, web服务器 (**Apache**), 数据库服务器 (**MySQL / MariaDB**) 和 **PHP** (脚本语言). LAMP是那些需要安装和构建动态网页应用的基础平台,比如WordPress, Joomla, OpenCart and Drupal。 +LAMP方案是一系列自由和开源软件的集合,包含了 **Linux**, web服务器 (**Apache**), 数据库服务器 (**MySQL / MariaDB**) 和 **PHP** (脚本语言). LAMP是那些需要安装和构建动态网页应用的基础平台,比如WordPress、Joomla, OpenCart 和 Drupal。 在这篇文章中,我将描述如何在Ubuntu Server 16.04 LTS 上安装LAMP,众所周知Ubuntu是一个基于linux的操作系统,因此它构成了LAMP的第一个部分,在接下来的操作中,我将默认你已经安装了 Ubuntu Server 16.04。 @@ -40,23 +40,23 @@ linuxtechi@ubuntu:~$ ![](http://www.linuxtechi.com/wp-content/uploads/2016/05/Apache2-Ubuntu-server-16.04-1024x955.jpg) -### 数据库服务器的安装r (MySQL Server 5.7) : +### 数据库服务器的安装 (MySQL Server 5.7) : -MySQL 和 MariaDB 都是 Ubuntu 16.04 中的数据库服务器. MySQL Server 和 MariaDB Server的安装包都可以在Ubuntu的默认软件源中找到,我们可以选择其中的一个来安装.通过下面的命令来在终端中安装mysql服务器 +MySQL 和 MariaDB 都是 Ubuntu 16.04 中的数据库服务器。 MySQL Server 和 MariaDB Server的安装包都可以在Ubuntu的默认软件源中找到,我们可以选择其中的一个来安装.通过下面的命令来在终端中安装mysql服务器。 ``` linuxtechi@ubuntu:~$ sudo apt install mysql-server mysql-client ``` -在安装过程中,它会要求你设置mysql服务器root帐户的密码. +在安装过程中,它会要求你设置mysql服务器root帐户的密码。 ![](http://www.linuxtechi.com/wp-content/uploads/2016/05/Enter-root-password-mysql-server-ubuntu-16-04.jpg) -确认root帐户的密码,并点击确定 +确认root帐户的密码,并点击确定。 ![](http://www.linuxtechi.com/wp-content/uploads/2016/05/confirm-root-password-mysql-server-ubuntu-16-04.jpg) -Mysql 服务器的安装到此已经结束了, MySQL 服务会自动变成可用状态和自动启动.我们可以通过如下的命令来校验Mysql服务的状态 +Mysql 服务器的安装到此已经结束了, MySQL 服务会自动变成可用状态和自动启动。我们可以通过如下的命令来校验Mysql服务的状态。 ``` linuxtechi@ubuntu:~$ sudo systemctl status mysql.service @@ -84,7 +84,7 @@ PHP 7 已经存在于Ubuntu的软件源中了,在终端中执行如下的命 linuxtechi@ubuntu:~$ sudo apt install php7.0-mysql php7.0-curl php7.0-json php7.0-cgi php7.0 libapache2-mod-php7.0 ``` -创建一个简单的php页面,并且将它移动到 apache的文档根目录下 (/var/ww/html) +创建一个简单的php页面,并且将它移动到 apache 的文档根目录下 (/var/ww/html) ``` linuxtechi@ubuntu:~$ vi samplepage.php @@ -100,17 +100,17 @@ linuxtechi@ubuntu:~$ sudo mv samplepage.php /var/www/html/ ``` 现在你可以从web浏览器中访问这个页面, -输入 : “http:///samplepage.php” ,你可以看到如下页面. +输入 : “http:///samplepage.php” ,你可以看到如下页面。 ![](http://www.linuxtechi.com/wp-content/uploads/2016/05/Sample-PHP-Page-Ubuntu-Server-16-04.jpg) -以上的页面向我们展示了PHP已经完全安装成功了 +以上的页面向我们展示了PHP已经完全安装成功了。 ### phpMyAdmin的安装: -phpMyAdmin可以让我们通过它的web界面来执行所有和数据库管理和其他数据库操作相关的任务,这个安装包已经存在于Ubuntu的软件源中 +phpMyAdmin可以让我们通过它的web界面来执行所有与数据库管理和其他数据库操作相关的任务,这个安装包已经存在于Ubuntu的软件源中。 -利用如下的命令来在Ubuntu server 16.04 LTS中安装phpMyAdmin +利用如下的命令来在Ubuntu server 16.04 LTS中安装phpMyAdmin。 ``` linuxtechi@ubuntu:~$ sudo apt install php-mbstring php7.0-mbstring php-gettext @@ -120,34 +120,33 @@ linuxtechi@ubuntu:~$ sudo apt install phpmyadmin 在以下的安装过程中,它会提示我们选择phpMyAdmin运行的目标服务器 - -选择 Apache2 并点击确定 +选择 Apache2 并点击确定。 ![](http://www.linuxtechi.com/wp-content/uploads/2016/05/Web-Server-for-phpMyAdmin-Ubuntu-Server-16-04.jpg) -点击确定来配置phpMyAdmin管理的数据库 +点击确定来配置phpMyAdmin管理的数据库。 ![](http://www.linuxtechi.com/wp-content/uploads/2016/05/configure-database-for-phpmyadmin-ubuntu-server-16-04.jpg) -指定phpMyAdmin向数据库服务器注册时所用的密码 +指定phpMyAdmin向数据库服务器注册时所用的密码。 ![](http://www.linuxtechi.com/wp-content/uploads/2016/05/Select-Password-for-phpMyadmin-ubuntu-16-04-1024x433.jpg) -确认phpMyAdmin所需的密码,并点击确认 +确认phpMyAdmin所需的密码,并点击确认。 ![](http://www.linuxtechi.com/wp-content/uploads/2016/05/confirm-password-for-phpmyadmin-ubuntu-server-16-04.jpg) 现在可以开始尝试访问phpMyAdmin, 打开浏览器并输入 : “http://Server_IP_OR_Host_Name/phpmyadmin” -利用我们安装时设置的 root帐户和密码 +使用我们安装时设置的 root 帐户和密码。 ![](http://www.linuxtechi.com/wp-content/uploads/2016/05/phpMyAdmin-Ubuntu-Server-16-04-1024x557.jpg) -当我们点击“Go”的时候,将会重定向到如下所示的 ‘phpMyAdmin’web界面 +当我们点击“Go”的时候,将会重定向到如下所示的 ‘phpMyAdmin’web界面。 ![](http://www.linuxtechi.com/wp-content/uploads/2016/05/phpMyAdmin-portal-overview-ubuntu-server-16-04-1024x557.jpg) -到现在,LAMP方案已经被成功安装和使用了,欢迎分享你的反馈和评论。 +到现在,LAMP方案已经被成功安装并可以使用了,欢迎分享你的反馈和评论。 -------------------------------------------------------------------------------- @@ -155,8 +154,8 @@ via: http://www.linuxtechi.com/lamp-stack-installation-on-ubuntu-server-16-04/ 作者:[Pradeep Kumar][a] 译者:[陆建波](https://github.com/lujianbo) -校对:[校对者ID](https://github.com/校对者ID) +校对:[Caroline](https://github.com/carolinewuyan) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]: http://www.linuxtechi.com/author/pradeep/ \ No newline at end of file +[a]: http://www.linuxtechi.com/author/pradeep/ From 5c021ad68c63f02bf1b5d37ed7eaef63327dfcc6 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 14 Jun 2016 19:51:07 +0800 Subject: [PATCH 0907/1469] PUB:20160526 BEST LINUX PHOTO MANAGEMENT SOFTWARE IN 2016 @sarishinohara --- ...LINUX PHOTO MANAGEMENT SOFTWARE IN 2016.md | 95 +++++++++---------- 1 file changed, 44 insertions(+), 51 deletions(-) rename {translated/tech => published}/20160526 BEST LINUX PHOTO MANAGEMENT SOFTWARE IN 2016.md (57%) diff --git a/translated/tech/20160526 BEST LINUX PHOTO MANAGEMENT SOFTWARE IN 2016.md b/published/20160526 BEST LINUX PHOTO MANAGEMENT SOFTWARE IN 2016.md similarity index 57% rename from translated/tech/20160526 BEST LINUX PHOTO MANAGEMENT SOFTWARE IN 2016.md rename to published/20160526 BEST LINUX PHOTO MANAGEMENT SOFTWARE IN 2016.md index 24cb248921..57f7b5a314 100644 --- a/translated/tech/20160526 BEST LINUX PHOTO MANAGEMENT SOFTWARE IN 2016.md +++ b/published/20160526 BEST LINUX PHOTO MANAGEMENT SOFTWARE IN 2016.md @@ -1,4 +1,4 @@ -2016年最佳 Linux 图像管理软件 +2016 年最佳 Linux 图像管理软件 ============================================= ![](http://itsfoss.com/wp-content/uploads/2016/05/Best-Linux-Photo-Management-Software.jpg) @@ -11,119 +11,111 @@ 这个列表和我们先前的 [最佳图像程序应用][1] 有些差别,上次我们介绍了图像编辑软件,绘图软件等,而这次的介绍主要集中在图像管理软件上。 -好,下面我们开始介绍。我会详细说明在 Ubuntu 下的安装命令以及衍生的命令,我们只需要打开终端运行这些命令。 +好,下面我们开始介绍。我会详细说明在 Ubuntu 及其衍生版下的安装命令,我们只需要打开终端运行这些命令。 -### [GTHUMB](https://wiki.gnome.org/Apps/gthumb) +### [gThumb](https://wiki.gnome.org/Apps/gthumb) ![](http://itsfoss.com/wp-content/uploads/2016/05/gThumb-1-1024x540.jpg) ->gThumb 图像编辑器 -gThumb 是在 GNOME 桌面环境下的一个轻量级的图像管理应用,它涵盖了基本图像管理功能,编辑图片以及更加高级的操作,gThumb 主要功能如下: +*gThumb 图像编辑器* -- 图片查看:支持所有主流的图片格式(包括gif)和元数据(EXIF, XMP 等)。 +gThumb 是在 GNOME 桌面环境下的一个轻量级的图像管理应用,它涵盖了基本图像管理功能,比如编辑图片以及更加高级的操作等,gThumb 主要功能如下: -- 图片浏览:所有基础的浏览操作(缩略图,移动,复制,删除等)以及书签支持。 +- 图片查看:支持所有主流的图片格式(包括 gif)和元数据(EXIF、 XMP 等)。 +- 图片浏览:所有基础的浏览操作(缩略图、移动、复制、删除等)以及书签支持。 +- 图片管理:使用标签、目录和库来组织图片。从数码相机导入图片,集成了网络相册(Picasa,Flickr,Facebook等)。 +- 图片编辑:基本图像编辑操作、滤镜、格式转换等。 -- 图片管理:使用标签操作图片,目录和图片库。从数码相机,网络相册(Picasa,Flickr,Facebook等)整合,导入图片。 +更多功能请参考官方 [gThumb 功能][2] 列表。如果你使用的是 GNOME 或者基于 GNOME 的桌面环境(如 MATE),那么你一定要试用一下。 -- 图片编辑:基本图像编辑操作,滤镜,格式转换等。 - -- 更多功能请参考官方 [gThumb功能][2] 列表。如果你使用的是 GNOME 或者基于 GNOME 的桌面环境(如 MATE),那么你一定要试用一下。 - -#### GTHUMB 安装 +#### gThumb 安装 ``` sudo apt-get install gthumb ``` -### [DIGIKAM][3] +### [digiKam][3] ![](http://itsfoss.com/wp-content/uploads/2016/05/digiKam-1-1024x540.png) ->digiKam + +*digiKam* digiKam 主要为 KDE 而设计,在其他桌面环境下也可以使用。它有很多很好的图像界面功能,主要功能如下所示: -- 图片管理:相册,子相册,标签,评论,元数据,排序支持。 - -- 图片导入:支持从数码相机,USB设备,网络相册(包括 Picasa 和 Facebook)导入,以及另外一些功能。 - -- 图片输出:支持输出至很多网络在线平台,以及各式转换。 - +- 图片管理:相册、子相册、标签、评论、元数据、排序支持。 +- 图片导入:支持从数码相机、USB设备、网络相册(包括 Picasa 和 Facebook)导入,以及另外一些功能。 +- 图片输出:支持输出至很多网络在线平台,以及格式转换。 - 图片编辑:支持很多图像编辑的操作。 -digiKam 是众多优秀图像管理软件之一。 +毫无疑问,digiKam 如果不是最好的图像管理软件,也是之一。 -#### DIGIKAM 安装 +#### digiKam 安装 ``` sudo apt-get install digikam ``` -### [SHOTWELL][4] +### [Shotwell][4] ![](http://itsfoss.com/wp-content/uploads/2016/05/Shotwell-1-1024x540.png) ->Shotwell + +*Shotwell* Shotwell 图像管理也是为 GNOME 桌面环境设计,虽然功能不及 gThumb 多,但满足了基本需求。主要功能如下: - 从磁盘或数码相机导入图片。 - -- 项目,标签和文件夹管理。 - +- 事件、标签和基于文件夹的图片管理方式。 - 基本图片编辑功能和格式转换。 - - 支持上传至网络平台(Facebook,Flickr,Tumblr 等)。 如果你想要一款功能相对简单的应用,你可以尝试一下这个。 -#### SHOTWELL 安装 +#### Shotwell 安装 ``` sudo apt-get install shotwell ``` -### [KPHOTOALBUM][5] +### [KPhotoAlbum][5] ![](http://itsfoss.com/wp-content/uploads/2016/05/KPhotoAlbum-1-1024x540.png) ->KPhotoAlbum -KPhotoAlbum 是一款在 KDE 桌面环境下的图像管理应用。它有一些独特的功能:分类和基于时间浏览。你可以基于人物,地点,时间分类;另外在用户图形界面底部会显示时间栏。 +*KPhotoAlbum* + +KPhotoAlbum 是一款在 KDE 桌面环境下的图像管理应用。它有一些独特的功能:分类和基于时间浏览。你可以基于人物、地点、时间分类;另外在用户图形界面底部会显示时间栏。 KPhotoAlbum 有很多图像管理和编辑功能,主要功能包括: -- 高级图片操作(目录,子目录,标签,元数据,注释等)。 - +- 高级图片操作(分类、子分类、标签、元数据、注释等等)。 - 图片导入导出功能(包括主流图片分享平台)。 - - 众多编辑功能(包括批量处理)。 -这些高级的功能有它们的缺点,就是用户需要手工操作。但如果你是KDE爱好者,这是个好的选择。它完美适用 KDE,但是你也可以在非 KDE 桌面环境下使用 KPhotoAlbum。 +这些高级的功能有一些缺点,就是用户大多需要手工操作。但如果你是 KDE 爱好者,这是个好的选择。它完美适用 KDE,但是你也可以在非 KDE 桌面环境下使用 KPhotoAlbum。 -#### KPHOTOALBUM 安装 +#### KPhotoAlbum 安装 ``` sudo apt-get install kphotoalbum ``` -### [DARKTABLE][7] +### [Darktable][7] ![](http://itsfoss.com/wp-content/uploads/2016/05/darktable-1-1024x540.png) ->Darktable -Darktable 相较于图像管理更偏向于图像编辑。Darktable 有良好的用户图形界面,对桌面环境没有特殊的要求,以及图像编辑功能。它的基本功能如下: +*Darktable* + +Darktable 与其说是图像管理工具,不如说是图像编辑软件。Darktable 有良好的用户图形界面,对桌面环境没有特殊的要求,这也不会影响到它的图像编辑功能。它的基本功能如下: - 基本图片管理。 - - 众多高级的图片编辑功能。 - - 支持导出至 Picasa 和 Flickr 和格式转换。 如果你喜欢照片编辑和润色,Darktable 是个好的选择。 -> 推荐阅读:[怎样在Ubuntu下通过PPA安装Darktable 2.0][8] +> 推荐阅读:[怎样在 Ubuntu 下通过 PPA 安装 Darktable 2.0][8] -#### DARKTABLE 安装 +#### Darktable 安装 ``` sudo add-apt-repository ppa:pmjdebruijn/darktable-release @@ -133,7 +125,7 @@ sudo apt-get install darktable ### 其它 -如果你想要功能简单的应用,比如从便携设备(相机,手机,便携设备等)中导入照片并存入磁盘,使用 [Rapid Photo Downloader][9],它很适合从便携设备中导入和备份图片,而且安装配置过程简单。 +如果你想要功能简单的应用,比如从便携设备(相机、手机、便携设备等)中导入照片并存入磁盘,毫无疑问该使用 [Rapid Photo Downloader][9],它很适合从便携设备中导入和备份图片,而且安装配置过程简单。 在 Ubuntu 上安装 Rapid Photo Downloade,打开终端输入命令: @@ -142,18 +134,19 @@ sudo apt-get install rapid-photo-downloader ``` 如果你想尝试更多的选择: -- [GNOME Photos][10] (GNOME桌面环境下的图像查看器) -- [Gwenview][11] (KDE桌面环境下的图像查看器) + +- [GNOME Photos][10] (GNOME 桌面环境下的图像查看器) +- [Gwenview][11] (KDE 桌面环境下的图像查看器) - [Picty][12] (开源图像管理器) -那么,你正在使用,或者打算使用其中一款应用吗?你有其它更好的推荐吗?你有最喜欢的 Linux 图像管理软件吗?分享你的观点。 +那么,你正在使用,或者打算使用其中一款应用吗?在 Ubuntu 或其它 Linux 上你有其它更好的推荐吗?你有最喜欢的 Linux 图像管理软件吗?分享你的观点给我们。 ---------- -via: http://itsfoss.com/linux-photo-management-software/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 +via: http://itsfoss.com/linux-photo-management-software/ 作者:[Munif Tanjim][a] 译者:[sarishinohara](https://github.com/sarishinohara) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 448fa76460bbac8177a0ed77c349dfdfbb2b4543 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 14 Jun 2016 20:34:29 +0800 Subject: [PATCH 0908/1469] PUB:20160529 LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS @lujianbo --- ...lation Guide on Ubuntu Server 16.04 LTS.md | 159 +++++++++++++++++ ...lation Guide on Ubuntu Server 16.04 LTS.md | 161 ------------------ 2 files changed, 159 insertions(+), 161 deletions(-) create mode 100644 published/20160529 LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS.md delete mode 100644 translated/tech/20160529 LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS.md diff --git a/published/20160529 LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS.md b/published/20160529 LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS.md new file mode 100644 index 0000000000..c74b0eba1b --- /dev/null +++ b/published/20160529 LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS.md @@ -0,0 +1,159 @@ +在 Ubuntu Server 16.04 LTS 上安装 LAMP +========================================================= + +LAMP 方案是一系列自由和开源软件的集合,包含了 **Linux**、Web 服务器 (**Apache**)、 数据库服务器 (**MySQL / MariaDB**) 和 **PHP** (脚本语言)。LAMP 是那些需要安装和构建动态网页应用的基础平台,比如WordPress、Joomla、OpenCart 和 Drupal。 + +在这篇文章中,我将描述如何在 Ubuntu Server 16.04 LTS 上安装 LAMP,众所周知 Ubuntu 是一个基于 Linux 的操作系统,因此它构成了 LAMP 的第一个部分,在接下来的操作中,我将默认你已经安装了 Ubuntu Server 16.04。 + +### Apache2 web 服务器的安装 : + +在 Ubuntu linux 中,web 服务器是 Apache2,我们可以利用下面的命令来安装它: + +``` +linuxtechi@ubuntu:~$ sudo apt update +linuxtechi@ubuntu:~$ sudo apt install apache2 -y +``` + +当安装 Apache2 包之后,Apache2 相关的服务是启用的,并在重启后自动运行。在某些情况下,如果你的 Apache2 服务并没有自动运行和启用,你可以利用如下命令来启动和启用它。 + +``` +linuxtechi@ubuntu:~$ sudo systemctl start apache2.service +linuxtechi@ubuntu:~$ sudo systemctl enable apache2.service +linuxtechi@ubuntu:~$ sudo systemctl status apache2.service +``` + +如果你开启了 Ubuntu 的防火墙(ufw),那么你可以使用如下的命令来解除 web 服务器的端口(80和443)限制 + +``` +linuxtechi@ubuntu:~$ sudo ufw status +Status: active +linuxtechi@ubuntu:~$ sudo ufw allow in 'Apache Full' +Rule added +Rule added (v6) +linuxtechi@ubuntu:~$ +``` + +### 现在开始访问你的 web 服务器 : + +打开浏览器并输入服务器的IP地址或者主机名(http://IP\_Address\_OR\_Host\_Name),在我的例子中我的服务器 IP是‘192.168.1.13’ + +![](http://www.linuxtechi.com/wp-content/uploads/2016/05/Apache2-Ubuntu-server-16.04-1024x955.jpg) + +### 数据库服务器的安装 (MySQL Server 5.7) : + +MySQL 和 MariaDB 都是 Ubuntu 16.04 中的数据库服务器。 MySQL Server 和 MariaDB Server的安装包都可以在Ubuntu 的默认软件源中找到,我们可以选择其中的一个来安装。通过下面的命令来在终端中安装mysql服务器。 + +``` +linuxtechi@ubuntu:~$ sudo apt install mysql-server mysql-client +``` + +在安装过程中,它会要求你设置 mysql 服务器 root 帐户的密码。 + +![](http://www.linuxtechi.com/wp-content/uploads/2016/05/Enter-root-password-mysql-server-ubuntu-16-04.jpg) + +确认 root 帐户的密码,并点击确定。 + +![](http://www.linuxtechi.com/wp-content/uploads/2016/05/confirm-root-password-mysql-server-ubuntu-16-04.jpg) + +MySQL 服务器的安装到此已经结束了, MySQL 服务会自动启动并启用。我们可以通过如下的命令来校验 MySQL 服务的状态。 + +``` +linuxtechi@ubuntu:~$ sudo systemctl status mysql.service +``` + +### MariaDB Server的安装 : + +在终端中使用如下的命令来安装 Mariadb 10.0 服务器。 + +``` +linuxtechi@ubuntu:~$ sudo apt install mariadb-server +``` + +运行如下的命令来设置 MariaDB root 帐户的密码,还可以用来关闭某些选项,比如关闭远程登录功能。 + +``` +linuxtechi@ubuntu:~$ sudo mysql_secure_installation +``` + +### PHP 脚本语言的安装: + +PHP 7 已经存在于 Ubuntu 的软件源中了,在终端中执行如下的命令来安装 PHP 7: + +``` +linuxtechi@ubuntu:~$ sudo apt install php7.0-mysql php7.0-curl php7.0-json php7.0-cgi php7.0 libapache2-mod-php7.0 +``` + +创建一个简单的 php 页面,并且将它移动到 apache 的文档根目录下 (/var/ww/html) + +``` +linuxtechi@ubuntu:~$ vi samplepage.php + +``` + +在 vi 中编辑之后,保存并退出该文件。 + +``` +linuxtechi@ubuntu:~$ sudo mv samplepage.php /var/www/html/ +``` + +现在你可以从 web 浏览器中访问这个页面, 输入 : “http:///samplepage.php” ,你可以看到如下页面。 + +![](http://www.linuxtechi.com/wp-content/uploads/2016/05/Sample-PHP-Page-Ubuntu-Server-16-04.jpg) + +以上的页面向我们展示了 PHP 已经完全安装成功了。 + +### phpMyAdmin 的安装: + +phpMyAdmin 可以让我们通过它的 web 界面来执行所有与数据库管理和其他数据库操作相关的任务,这个安装包已经存在于 Ubuntu 的软件源中。 + +利用如下的命令来在 Ubuntu server 16.04 LTS 中安装 phpMyAdmin。 + +``` +linuxtechi@ubuntu:~$ sudo apt install php-mbstring php7.0-mbstring php-gettext +linuxtechi@ubuntu:~$ sudo systemctl restart apache2.service +linuxtechi@ubuntu:~$ sudo apt install phpmyadmin +``` + +在以下的安装过程中,它会提示我们选择 phpMyAdmin 运行的目标服务器。 + +选择 Apache2 并点击确定。 + +![](http://www.linuxtechi.com/wp-content/uploads/2016/05/Web-Server-for-phpMyAdmin-Ubuntu-Server-16-04.jpg) + +点击确定来配置 phpMyAdmin 管理的数据库。 + +![](http://www.linuxtechi.com/wp-content/uploads/2016/05/configure-database-for-phpmyadmin-ubuntu-server-16-04.jpg) + +指定 phpMyAdmin 向数据库服务器注册时所用的密码。 + +![](http://www.linuxtechi.com/wp-content/uploads/2016/05/Select-Password-for-phpMyadmin-ubuntu-16-04-1024x433.jpg) + +确认 phpMyAdmin 所需的密码,并点击确认。 + +![](http://www.linuxtechi.com/wp-content/uploads/2016/05/confirm-password-for-phpmyadmin-ubuntu-server-16-04.jpg) + +现在可以开始尝试访问 phpMyAdmin,打开浏览器并输入 : “http://Server\_IP\_OR\_Host\_Name/phpmyadmin” + +使用我们安装时设置的 root 帐户和密码。 + +![](http://www.linuxtechi.com/wp-content/uploads/2016/05/phpMyAdmin-Ubuntu-Server-16-04-1024x557.jpg) + +当我们点击“Go”的时候,将会重定向到如下所示的 ‘phpMyAdmin’ web界面。 + +![](http://www.linuxtechi.com/wp-content/uploads/2016/05/phpMyAdmin-portal-overview-ubuntu-server-16-04-1024x557.jpg) + +到现在,LAMP 方案已经被成功安装并可以使用了,欢迎分享你的反馈和评论。 + +-------------------------------------------------------------------------------- + +via: http://www.linuxtechi.com/lamp-stack-installation-on-ubuntu-server-16-04/ + +作者:[Pradeep Kumar][a] +译者:[陆建波](https://github.com/lujianbo) +校对:[Caroline](https://github.com/carolinewuyan) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.linuxtechi.com/author/pradeep/ diff --git a/translated/tech/20160529 LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS.md b/translated/tech/20160529 LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS.md deleted file mode 100644 index 1dc4e1133d..0000000000 --- a/translated/tech/20160529 LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS.md +++ /dev/null @@ -1,161 +0,0 @@ -在 Ubuntu Server 16.04 LTS 上安装 LAMP -========================================================= - -LAMP方案是一系列自由和开源软件的集合,包含了 **Linux**, web服务器 (**Apache**), 数据库服务器 (**MySQL / MariaDB**) 和 **PHP** (脚本语言). LAMP是那些需要安装和构建动态网页应用的基础平台,比如WordPress、Joomla, OpenCart 和 Drupal。 - -在这篇文章中,我将描述如何在Ubuntu Server 16.04 LTS 上安装LAMP,众所周知Ubuntu是一个基于linux的操作系统,因此它构成了LAMP的第一个部分,在接下来的操作中,我将默认你已经安装了 Ubuntu Server 16.04。 - -### Apache2 web服务器的安装 : - -在Ubuntu linux中,web 服务器称之为 Apache2,我们可以利用下面的命令来安装它 - -``` -linuxtechi@ubuntu:~$ sudo apt update -linuxtechi@ubuntu:~$ sudo apt install apache2 -y -``` - -当安装Apache2包之后,Apache2相关的服务将会在重启后变成可用状态和自动运行,在某些情况下,如果你的Apache2服务并没有自动可用和启动,你可以利用如下命令来启用它。 - -``` -linuxtechi@ubuntu:~$ sudo systemctl start apache2.service -linuxtechi@ubuntu:~$ sudo systemctl enable apache2.service -linuxtechi@ubuntu:~$ sudo systemctl status apache2.service -``` - -如果你开启了Ubuntu的防火墙(ufw),那么你可以使用如下的命令来解除web服务器的端口(80和443)限制 - -``` -linuxtechi@ubuntu:~$ sudo ufw status -Status: active -linuxtechi@ubuntu:~$ sudo ufw allow in 'Apache Full' -Rule added -Rule added (v6) -linuxtechi@ubuntu:~$ -``` - -### 现在开始访问你的web服务器 : - -打开浏览器并输入服务器的IP地址或者主机名 -(http://IP_Address_OR_Host_Name),在我的例子中我的服务器IP是‘192.168.1.13’ - -![](http://www.linuxtechi.com/wp-content/uploads/2016/05/Apache2-Ubuntu-server-16.04-1024x955.jpg) - -### 数据库服务器的安装 (MySQL Server 5.7) : - -MySQL 和 MariaDB 都是 Ubuntu 16.04 中的数据库服务器。 MySQL Server 和 MariaDB Server的安装包都可以在Ubuntu的默认软件源中找到,我们可以选择其中的一个来安装.通过下面的命令来在终端中安装mysql服务器。 - -``` -linuxtechi@ubuntu:~$ sudo apt install mysql-server mysql-client -``` - -在安装过程中,它会要求你设置mysql服务器root帐户的密码。 - -![](http://www.linuxtechi.com/wp-content/uploads/2016/05/Enter-root-password-mysql-server-ubuntu-16-04.jpg) - -确认root帐户的密码,并点击确定。 - -![](http://www.linuxtechi.com/wp-content/uploads/2016/05/confirm-root-password-mysql-server-ubuntu-16-04.jpg) - -Mysql 服务器的安装到此已经结束了, MySQL 服务会自动变成可用状态和自动启动。我们可以通过如下的命令来校验Mysql服务的状态。 - -``` -linuxtechi@ubuntu:~$ sudo systemctl status mysql.service -``` - -### MariaDB Server的安装 : - -在终端中利用如下的命令来安装 Mariadb 10.0 服务器。 - -``` -linuxtechi@ubuntu:~$ sudo apt install mariadb-server -``` - -运行如下的命令来设置mariadb root帐户的密码,还可以用来关闭某些选项,比如关闭远程登录功能。 - -``` -linuxtechi@ubuntu:~$ sudo mysql_secure_installation -``` - -### PHP脚本语言的安装: - -PHP 7 已经存在于Ubuntu的软件源中了,在终端中执行如下的命令来安装PHP 7: - -``` -linuxtechi@ubuntu:~$ sudo apt install php7.0-mysql php7.0-curl php7.0-json php7.0-cgi php7.0 libapache2-mod-php7.0 -``` - -创建一个简单的php页面,并且将它移动到 apache 的文档根目录下 (/var/ww/html) - -``` -linuxtechi@ubuntu:~$ vi samplepage.php - -``` - -在vi中编辑之后,保存并退出该文件。 - -``` -linuxtechi@ubuntu:~$ sudo mv samplepage.php /var/www/html/ -``` - -现在你可以从web浏览器中访问这个页面, -输入 : “http:///samplepage.php” ,你可以看到如下页面。 - -![](http://www.linuxtechi.com/wp-content/uploads/2016/05/Sample-PHP-Page-Ubuntu-Server-16-04.jpg) - -以上的页面向我们展示了PHP已经完全安装成功了。 - -### phpMyAdmin的安装: - -phpMyAdmin可以让我们通过它的web界面来执行所有与数据库管理和其他数据库操作相关的任务,这个安装包已经存在于Ubuntu的软件源中。 - -利用如下的命令来在Ubuntu server 16.04 LTS中安装phpMyAdmin。 - -``` -linuxtechi@ubuntu:~$ sudo apt install php-mbstring php7.0-mbstring php-gettext -linuxtechi@ubuntu:~$ sudo systemctl restart apache2.service -linuxtechi@ubuntu:~$ sudo apt install phpmyadmin -``` - -在以下的安装过程中,它会提示我们选择phpMyAdmin运行的目标服务器 - -选择 Apache2 并点击确定。 - -![](http://www.linuxtechi.com/wp-content/uploads/2016/05/Web-Server-for-phpMyAdmin-Ubuntu-Server-16-04.jpg) - -点击确定来配置phpMyAdmin管理的数据库。 - -![](http://www.linuxtechi.com/wp-content/uploads/2016/05/configure-database-for-phpmyadmin-ubuntu-server-16-04.jpg) - -指定phpMyAdmin向数据库服务器注册时所用的密码。 - -![](http://www.linuxtechi.com/wp-content/uploads/2016/05/Select-Password-for-phpMyadmin-ubuntu-16-04-1024x433.jpg) - -确认phpMyAdmin所需的密码,并点击确认。 - -![](http://www.linuxtechi.com/wp-content/uploads/2016/05/confirm-password-for-phpmyadmin-ubuntu-server-16-04.jpg) - -现在可以开始尝试访问phpMyAdmin, 打开浏览器并输入 : “http://Server_IP_OR_Host_Name/phpmyadmin” - -使用我们安装时设置的 root 帐户和密码。 - -![](http://www.linuxtechi.com/wp-content/uploads/2016/05/phpMyAdmin-Ubuntu-Server-16-04-1024x557.jpg) - -当我们点击“Go”的时候,将会重定向到如下所示的 ‘phpMyAdmin’web界面。 - -![](http://www.linuxtechi.com/wp-content/uploads/2016/05/phpMyAdmin-portal-overview-ubuntu-server-16-04-1024x557.jpg) - -到现在,LAMP方案已经被成功安装并可以使用了,欢迎分享你的反馈和评论。 - --------------------------------------------------------------------------------- - -via: http://www.linuxtechi.com/lamp-stack-installation-on-ubuntu-server-16-04/ - -作者:[Pradeep Kumar][a] -译者:[陆建波](https://github.com/lujianbo) -校对:[Caroline](https://github.com/carolinewuyan) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://www.linuxtechi.com/author/pradeep/ From 567a02680f7448c265f3fd31cde135b1e37aab08 Mon Sep 17 00:00:00 2001 From: Bestony Date: Tue, 14 Jun 2016 21:01:56 +0800 Subject: [PATCH 0909/1469] Delete 20160516 Scaling Collaboration in DevOps.md --- ...0160516 Scaling Collaboration in DevOps.md | 68 ------------------- 1 file changed, 68 deletions(-) delete mode 100644 sources/tech/20160516 Scaling Collaboration in DevOps.md diff --git a/sources/tech/20160516 Scaling Collaboration in DevOps.md b/sources/tech/20160516 Scaling Collaboration in DevOps.md deleted file mode 100644 index bee9ab5415..0000000000 --- a/sources/tech/20160516 Scaling Collaboration in DevOps.md +++ /dev/null @@ -1,68 +0,0 @@ -Translating by Bestony -Scaling Collaboration in DevOps -================================= - -![](http://devops.com/wp-content/uploads/2016/05/ScalingCollaboration.jpg) - -Those familiar with DevOps generally agree that it is equally as much about culture as it is about technology. There are certainly tools and practices involved in the effective implementation of DevOps, but the foundation of DevOps success is how well [teams and individuals collaborate][1] across the enterprise to get things done more rapidly, efficiently and effectively. - -Most DevOps platforms and tools are designed with scalability in mind. DevOps environments often run in the cloud and tend to be volatile. It’s important for the software that supports DevOps to be able to scale in real time to address spikes and lulls in demand. The same thing is true for the human element as well, but scaling collaboration is a whole different story. - -Collaboration across the enterprise is critical for DevOps success. Great code and development needs to make it over the finish line to production to benefit customers. The challenge organizations face is how to do that seamlessly and with as much speed and automation as possible without sacrificing quality or performance. How can businesses streamline code development and deployment, while maintaining visibility, governance and compliance? - -### Emerging Trends - -First, I want to provide some background and share some data gathered by 451 Research on DevOps and DevOps adoption in general. Cloud, agile and DevOps capabilities are important for organizations today—both in perception and reality. 451 sees enterprise adoption of these things, as well as container technologies, growing—including increased usage in production environments. - -There are a number of advantages to embracing these technologies and methodologies, such as increased flexibility and speed, reduction of costs, improvements in resilience and reliability, and fitness for new or emerging applications. According to 451 Research, organizations also face some barriers including a lack of familiarity and required skills internally, the immaturity of these emerging technologies, and cost and security concerns. - -In the “[Voice of the Enterprise: SDI Q4 2015 survey][2],” 451 Research found that more than half of the respondents (51.7 percent) consider themselves to be late adopters, or even the last adopters of new technology. The flip side of that is that almost half (48.3 percent) label themselves as first or early adopters. - -Those general sentiments are reflected in the survey responses to other questions. When asked about implementation of containers, 50.3 percent stated it is not in their plans at all, while the remaining 49.7 percent are in some state of planning, pilot or active use of container technologies. Nearly two-thirds (65.1 percent) indicated that they use agile development methodologies for application development, but only 39.6 percent responded that they’ve embraced DevOps approaches. Nevertheless, while agile software development has been in the industry for years, 451 notes the impressive adoption of containers and DevOps, given they are emergent trends. - -When asked what the top three IT pain points are, the leading responses were cost or budget, insufficient staff and legacy software issues. As organizations move to cloud, DevOps, and containers issues such as these will need to be addressed, along with how to scale both technologies and collaboration effectively. - -### The Current State - -The industry—driven in large part by the DevOps revolution—is in the midst of a sea change, where software development is becoming more highly integrated across the entire business. The creation of software is less segregated and is more and more a function of collaboration and socialization. - -Concepts and methodologies that were novel or niche just a few years ago have matured quickly to become the mainstream technologies and frameworks that are driving value today. Businesses rely on concepts such as agile, lean, virtualization, cloud, automation and microservices to streamline development and enable them to work more effectively and efficiently at the same time. - -To adapt and evolve, enterprises need to accomplish a number of key tasks. The challenge companies face today is how to accelerate development while reducing costs. Organizations need to eliminate the barriers that exist between IT and the rest of the business, and work cooperatively toward a strategy that provides more effectiveness in a technology-driven, competitive environment. - -Agile, cloud, DevOps and containers all play a role in that process, but the one thing that binds it all is effective collaboration. Each of these technologies and methodologies provides unique benefits, but the real value comes from the organization as a whole—and the tools and platforms used by the organization—being able to collaborate at scale. Successful DevOps implementations also require participation from other stakeholders beyond development and IT operations teams, including security, database, storage and line-of-business teams. - -### Collaboration-as-a-Platform - -There are services and platforms online—such as GitHub—that facilitate and streamline collaboration. The online platform functions as a code repository, but the value extends beyond just providing a place to store code. - -Such a [collaboration platform][4] helps developers and teams collaborate more effectively because it provides a community where the code and process can be shared and discussed. Managers can monitor progress and track what code is shipping next. Developers can experiment with new ideas in a safe environment before taking those experiments to a live production environment, and new ideas and experiments can be effectively communicated to the appropriate teams. - -One of the keys to more agile development and DevOps is to allow developers to test things and gather relevant feedback quickly. The goal is to produce quality code and features faster, not to waste time setting up and managing infrastructure or scheduling more meetings to talk about it. The GitHub platform, for example, enables more effective and scalable collaboration because code review can occur when it is most convenient for the participants. There is no need to try and coordinate and schedule code review meetings, so the developers can continue to work uninterrupted, resulting in greater productivity and job satisfaction. - -Steven Anderson of Sendachi noted that GitHub is a collaboration platform, but it’s also a place for your tools to work with you, too. This means it can help not only with collaboration and continuous integration, but also with code quality. - -One of the benefits of a collaboration platform is that large teams of developers can be broken down into smaller teams that can focus more efficiently on specific components. It also allows things such as document sharing alongside code development to blur the lines between technical and non-technical contributions and enable increased collaboration and visibility. - -### Collaboration is Key - -The importance of collaboration can’t be stressed enough. It is a key tenet of DevOps culture, and it’s vital to agile development and maintaining a competitive edge in today’s world. Executive or management support and internal evangelism are important. Organizations also need to embrace the culture shift—blending skills across functional areas toward a common goal. - -With that culture established, though, effective collaboration is crucial. A collaboration platform is an essential element of collaborating at scale because it streamlines productivity and reduces redundancy and effort, and yields higher quality results at the same time. - - --------------------------------------------------------------------------------- - -via: http://devops.com/2016/05/16/scaling-collaboration-devops/ - -作者:[TONY BRADLEY][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://devops.com/author/tonybsg/ -[1]: http://devops.com/2014/12/15/four-strategies-supporting-devops-collaboration/ -[2]: https://451research.com/ -[3]: https://451research.com/customer-insight-voice-of-the-enterprise-overview -[4]: http://devops.com/events/analytics-of-collaboration-on-github/ From f1b2cb488965bb763231e09c6877fc9000e06fdc Mon Sep 17 00:00:00 2001 From: Bestony Date: Tue, 14 Jun 2016 21:02:44 +0800 Subject: [PATCH 0910/1469] Create 20160516 Scaling Collaboration in DevOps.md --- ...0160516 Scaling Collaboration in DevOps.md | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 translated/tech/20160516 Scaling Collaboration in DevOps.md diff --git a/translated/tech/20160516 Scaling Collaboration in DevOps.md b/translated/tech/20160516 Scaling Collaboration in DevOps.md new file mode 100644 index 0000000000..8ef18c4592 --- /dev/null +++ b/translated/tech/20160516 Scaling Collaboration in DevOps.md @@ -0,0 +1,70 @@ +Devops的弹性合作 +================================= + +![](http://devops.com/wp-content/uploads/2016/05/ScalingCollaboration.jpg) + +那些熟悉Devops的人普遍认同这样的文化关乎科技。当然,工具和参与是Devops有效实施的必要。但是Devops成功的基础是[团队合作][1]在企业做事更迅速,有效 + + +大多数的DevOps平台和工具的设计具有可扩展性的理念。DevOps环境通常运行在云端,并且容易发生变化。为了支持DevOps实时规模解决需求激增,软件变得很重要。同样的事情是真实的人为因素,但缩放合作是一个完整的不同的故事。 + + +跨企业协同是DevOps成功的关键。好的代码和发展是需要的。面临的挑战是如何做到无缝和尽可能多的速度和自动化,而不牺牲质量或性能。企业如何才能简化代码的开发和部署,同时保持知名度,治理和合规? + +### 新兴趋势 + +首先,我先提供一些背景,分享一些通过451研究公司 关于devops的研究而获取的数据。云、敏捷和Devops 在今天是非常重要的,不管是理念还是现实。451研究公司看到企业通过这些东西,还包括容器技术、增长大量的用在生产环境中。 + +拥抱这些技术和方法有许多优点,比如提高灵活性和速度,降低成本,提高弹性和可靠性,适应新的或新兴的应用。根据451公司的研究,组织也面临着一些障碍,包括缺乏熟悉和所需的技能,这些新兴技术的不成熟,成本和安全问题。 + +在 “[Voice of the Enterprise: SDI Q4 2015 survey][2],” 451公司发行超过一半的受访者者(最后为57.1%)考虑到他们是最终调查者或新兴科技。另一方面,近半受访者(48.3 %)认为自己是第一个或早起的采用者。 + +这些普遍性的情绪表现在对其他问题的调查中。当问起容器的执行情况时,50.3%的人表示这不在他们的计划中。49.7%的人是在进行计划、试点或积极使用容器技术。近2/3(65.1%)的人表示,他们用敏捷开发的应用开发,但是只有39.6%的回应,他们正在积极拥抱DevOps。然而,敏捷软件开发已经在行业内存在了多年,451公司注意到通过容器和Devops的提升给他们了很现实的趋势。 + +当被问及首要的三个痛点是什么,被提及最多的是成本或预算,工作人员和遗留软件问题。随着企业向云,DevOps,和容器等转型,这些都需要加以解决,以及如何规模技术和协作的有效。 + +### 当前状况 + +由Devops革命在很大程度上带动产生巨大变化的行业,使得软件开发变得更加高度集成的整个业务。软件的创造是不分种族的,而且更多是协作和社会化的功能。 + +在推动价值的今天,几年前的概念和方法已经成熟,很快就成为今天的主流技术和框架。企业依靠如敏捷、精益、虚拟化、云计算、自动化等概念来简化开发,同时使工作更加有效。 + +为适应和发展,企业需要完成一系列的关键任务。当今面临的挑战是如何加快发展的同时降低成本。组织需要消除它和其他业务之间存在的障碍,并在一个由技术驱动的竞争环境中提供更多有效的战略合作。 + +敏捷、云计算、Devops和容器在这个过程中起着重要的作用,但是有一件事情,他们都是有效的合作。每一种技术和方法都提供了独特的优势,但真正的价值来自于组织的整体能够进行规模协同和组织所使用的工具和平台。成功的DevOps的实现也需要其他利益相关者的参与,发展IT运营团队,包括安全、数据库、存储和业务队伍。 + +### 合作即平台 + +有一些在线的服务和平台,比如Github,促进了流式合作。它的功能是一个在线代码库,但是所产生的价值远超出了存储代码。 + + +这样一个[协作平台][4] 有助于开发人员和团队合作,因为它提供了一个代码和程序的社区可以共享和讨论。管理者可以监视进度和跟踪下一个代码是什么开发人员可以在一个安全的环境中进行实验,然后把这些实验的生活环境,新的想法和实验可以有效地传达给适当的团队。 + +更敏捷开发和DevOps的关键之一是允许开发人员测试并收集相关的快速反馈。目标是生产高质量的代码和功能,而不是浪费时间建立和管理基础设施或者安排更多的会议来讨论这个问题。比如GitHub平台,能够更有效的和可扩展的协作是因为代码审查可以由参与者最方便的进行。没有必要尝试协调和安排代码审查会议,使开发人员可以继续不间断地工作,从而产生更大的生产力和工作满意度。 + +Sendachi的Steven Anderson 指出,Github是一个协作平台,但它也是一个和你一起工作的工具。这样意味着他不仅可以帮助协作和持续集成,还影响了代码质量 + +合作平台的好处之一是,大型团队的开发人员可以分解成更小的团队,可以更有效地专注于特定的组件。它还允许诸如文件共享、模糊代码开发技术和非技术的贡献,增加了协作和可见性 + +### 合作是关键 + +合作的重要性不言而喻。合作是Devops文化的关键,也是当今世界能够进行敏捷开发和保持竞争优势的重要的一点。执行或管理的支持以及内部的传道是很重要的。组织还需要拥抱文化的转变---朝着目标混合技能跨越职能领域 + +当这样的文化建立起来,有效的合作是至关重要的。一个合作平台是规模合作的必要组件,因为简化了生产活动,并且减少了冗余和尝试,同时还产生了更高质量的结果。 + + +-------------------------------------------------------------------------------- + +via: http://devops.com/2016/05/16/scaling-collaboration-devops/ + +作者:[TONY BRADLEY][a] +译者:[Bestony](https://github.com/Bestony) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://devops.com/author/tonybsg/ +[1]: http://devops.com/2014/12/15/four-strategies-supporting-devops-collaboration/ +[2]: https://451research.com/ +[3]: https://451research.com/customer-insight-voice-of-the-enterprise-overview +[4]: http://devops.com/events/analytics-of-collaboration-on-github/ From 690d39f98cff7b84ff73360c87a0b07df8cfa1e3 Mon Sep 17 00:00:00 2001 From: Bestony Date: Tue, 14 Jun 2016 21:16:54 +0800 Subject: [PATCH 0911/1469] Translating by Bestony Translating by Bestony --- sources/tech/20160512 Rapid prototyping with docker-compose.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20160512 Rapid prototyping with docker-compose.md b/sources/tech/20160512 Rapid prototyping with docker-compose.md index 0c67223697..136eff7a7a 100644 --- a/sources/tech/20160512 Rapid prototyping with docker-compose.md +++ b/sources/tech/20160512 Rapid prototyping with docker-compose.md @@ -1,4 +1,4 @@ - +Translating by Bestony Rapid prototyping with docker-compose ======================================== From 862a7071dbe27ae6d8efa7a9b425de58de34b54d Mon Sep 17 00:00:00 2001 From: "jianbo.lu" <387852424@qq.com> Date: Tue, 14 Jun 2016 23:50:19 +0800 Subject: [PATCH 0912/1469] translating by lujianbo --- ...4 How to Setup Pfsense Firewall and Basic Configuration.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20151104 How to Setup Pfsense Firewall and Basic Configuration.md b/sources/tech/20151104 How to Setup Pfsense Firewall and Basic Configuration.md index 821937390a..f6e1b0aaab 100644 --- a/sources/tech/20151104 How to Setup Pfsense Firewall and Basic Configuration.md +++ b/sources/tech/20151104 How to Setup Pfsense Firewall and Basic Configuration.md @@ -1,3 +1,5 @@ +lujianbo + How to Setup Pfsense Firewall and Basic Configuration ================================================================================ In this article our focus is Pfsense setup, basic configuration and overview of features available in the security distribution of FreeBSD. In this tutorial we will run network wizard for basic setting of firewall and detailed overview of services. After the [installation process][1] following snapshot shows the IP addresses of WAN/LAN and different options for the management of Pfsense firewall. @@ -263,4 +265,4 @@ via: http://linoxide.com/firewall/pfsense-setup-basic-configuration/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://linoxide.com/author/naveeda/ -[1]:http://linoxide.com/firewall/install-pfsense-firewall/ \ No newline at end of file +[1]:http://linoxide.com/firewall/install-pfsense-firewall/ From d19959ac38c251a9928479576d51e2c13d959be4 Mon Sep 17 00:00:00 2001 From: erlinux <1006990314@qq.com> Date: Wed, 15 Jun 2016 18:05:13 +0800 Subject: [PATCH 0913/1469] =?UTF-8?q?erlinux=20=E5=AE=8C=E6=88=90=E7=BF=BB?= =?UTF-8?q?=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Rapid prototyping with docker-compose.md | 141 ++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 translated/tech/20160512 Rapid prototyping with docker-compose.md diff --git a/translated/tech/20160512 Rapid prototyping with docker-compose.md b/translated/tech/20160512 Rapid prototyping with docker-compose.md new file mode 100644 index 0000000000..a32f894d4b --- /dev/null +++ b/translated/tech/20160512 Rapid prototyping with docker-compose.md @@ -0,0 +1,141 @@ +使用docker快速组成样品机 +======================================== + +在写前,我们将看看 Node.js 样机 ** 找寻树莓派 PI Zero ** 的供应在英国三个主要销售. + +我写的代码,黑客部署到 Azure Ubuntu 虚拟机一个晚上就可以到位。Docker 和 docker-compose 工具做出调配和更新过程非常快。 + +### 建立链接? + + +如果您已经通过 [动手 Docker 教程指南] [1] 那么你已有在命令行建立 Docker 容器的经验。链接一个Redis 服务器计数器节点在命令行上可能是这样: + +``` +$ docker run -d -P --name redis1 +$ docker run -d hit_counter -p 3000:3000 --link redis1:redis +``` + +现在,假设应用程序中有三个等级 + +- Web 前端 +- 批次层处理长时间运行的任务 +- Redis 或 MongoDB 数据库 + +通过 `--link` 管理几个容器,但可能失效,可以添加多层级或容器到应用程序。 + +### 键入 docker 撰写 + +![](http://blog.alexellis.io/content/images/2016/05/docker-compose-logo-01.png) +>Docker 撰写图标 + +docker-compose 工具是标准的 docker工具箱的一部分,也可以单独下载。它提供了丰富功能,通过一个纯文本YAML文件配置所有应用程序组件。 + +上述提供了一个例子: + +``` +version: "2.0" +services: + redis1: + image: redis + hit_counter: + build: ./hit_counter + ports: + - 3000:3000 +``` + +从Docker 1.10起,我们可以充分利用网络来帮助我们在多个主机进行扩展覆盖。在此之前,仅通过单个主机工作。“docker-compose scale” 命令可用于更多计算能力有需要时。 + +>参考docker.com上关于"docker-compose" + +### 真实例子:树莓派 PI 到货通知 + +![](http://blog.alexellis.io/content/images/2016/05/Raspberry_Pi_Zero_ver_1-3_1_of_3_large.JPG) +>新版树莓派 PI Zero V1.3 图片提供来自Pimoroni + +树莓派 PI Zero - 巨大的轰动一个微型计算机具有一个1GHz 处理器 和 512MB 内存能够运行完整 Linux,Docker,Node.js,Ruby 和许多流行的开源工具。一个关于 PI Zero 的好消息是,成本只有5美元。这也意味着,存量迅速抢购一空。 + +*如果您想尝试Docker 或集群在PI看看下面的教程。* + +>[Docker Swarm on the PI Zero][3] + +### Original site: whereismypizero.com + +I found a webpage which used screen scraping to find whether 4-5 of the most popular outlets had stock. + +- The site contained a static HTML page +- Issued one XMLHttpRequest per outlet accessing /public/api/ +- The server issued the HTTP request to each shop and performed the scraping + +Every call to /public/api/ took 3 seconds to execute and using Apache Bench (ab) I was only able to get through 0.25 requests per second. + +### Reinventing the wheel + +The retailers didn't seem to mind whereismypizero.com scraping their sites for stock, so I set about writing a similar tool from the ground up. I had the intention of handing a much higher amount of requests per second through caching and de-coupling the scrape from the web tier. Redis was the perfect tool for the job. It allowed me to set an automatically expiring key/value pair (i.e. a simple cache) and also to transmit messages between Node processes through pub/sub. + +>Fork or star the code on Github: [alexellis/pi_zero_stock][4] + +If you've worked with Node.js before then you will know it is single-threaded and that any CPU intensive tasks such as parsing HTML or JSON could lead to a slow-down. One way to mitigate that is to use a second worker process and a Redis messaging channel as connective tissue between this and the web tier. + +- Web tier + -Gives 200 for cache hit (Redis key exists for store) + -Gives 202 for cache miss (Redis key doesn't exist, so issues message) + -Since we are only ever reading a Redis key the response time is very quick. +- Stock Fetcher + -Performs HTTP request + -Scrapes for different types of web stores + -Updates a Redis key with a cache expire of 60 seconds + -Also locks a Redis key to prevent too many in-flight HTTP requests to the web stores. +``` +version: "2.0" +services: + web: + build: ./web/ + ports: + - "3000:3000" + stock_fetch: + build: ./stock_fetch/ + redis: + image: redis +``` + +*The docker-compose.yml file from the example.* + +Once I had this working locally deploying to an Ubuntu 16.04 image in the cloud (Azure) took less than 5 minutes. I logged in, cloned the repository and typed in `docker compose up -d`. That was all it took - rapid prototyping a whole system doesn't get much better. Anyone (including the owner of whereismypizero.com) can deploy the new solution with just two lines: + +``` +$ git clone https://github.com/alexellis/pi_zero_stock +$ docker-compose up -d +``` + +Updating the site is easy and just involves a `git pull` followed by a `docker-compose up -d` with the `--build` argument passed along. + +If you are still linking your Docker containers manually, try Docker Compose for yourself or my code below: + +>Fork or star the code on Github: [alexellis/pi_zero_stock][5] + +### Check out the test site + +The test site is currently deployed now using docker-compose. + +>[stockalert.alexellis.io][6] + +![](http://blog.alexellis.io/content/images/2016/05/Screen-Shot-2016-05-16-at-22-34-26-1.png) + +Preview as of 16th of May 2016 + +---------- +via: http://blog.alexellis.io/rapid-prototype-docker-compose/ + +作者:[Alex Ellis][a] +译者:[erlinux](https://github.com/erlinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://blog.alexellis.io/author/alex/ +[1]: http://blog.alexellis.io/handsondocker +[2]: https://docs.docker.com/compose/compose-file/ +[3]: http://blog.alexellis.io/dockerswarm-pizero/ +[4]: https://github.com/alexellis/pi_zero_stock +[5]: https://github.com/alexellis/pi_zero_stock +[6]: http://stockalert.alexellis.io/ From 083b72a64cf6b4bee363e6b190b532c342f63aaa Mon Sep 17 00:00:00 2001 From: alim0x Date: Wed, 15 Jun 2016 22:29:02 +0800 Subject: [PATCH 0914/1469] [translating]Should distributors disable IPv4-mapped IPv6 --- .../20160525 Should distributors disable IPv4-mapped IPv6.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/talk/20160525 Should distributors disable IPv4-mapped IPv6.md b/sources/talk/20160525 Should distributors disable IPv4-mapped IPv6.md index 2ce0bace45..1faf7dab6c 100644 --- a/sources/talk/20160525 Should distributors disable IPv4-mapped IPv6.md +++ b/sources/talk/20160525 Should distributors disable IPv4-mapped IPv6.md @@ -1,3 +1,5 @@ +alim0x translating + Should distributors disable IPv4-mapped IPv6? ============================================= From eb2b6d8d4af895c4267f156b3a7190c7aeca6a70 Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 15 Jun 2016 23:20:15 +0800 Subject: [PATCH 0915/1469] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=80=89=E9=A2=98?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 选题模板.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/选题模板.txt b/选题模板.txt index fabd1f1dba..a7cd92e614 100644 --- a/选题模板.txt +++ b/选题模板.txt @@ -20,8 +20,7 @@ ### 子一级标题 正文内容 : I have a [dream][1]。 - - + -------------------------------------------------------------------------------- via: 原文地址 @@ -38,4 +37,7 @@ 说明: 1. 标题层级很多时从 “##” 开始 2. 引文链接地址在下方集中写 - +3. 因为 Windows 系统文件名有限制,所以文章名不要有特殊符号,如 `\/:*"<>|`,同时也不推荐全大写,或者其它不利阅读的格式 +4. 正文格式参照中文排版指北(https://github.com/LCTT/TranslateProject/blob/master/%E4%B8%AD%E6%96%87%E6%8E%92%E7%89%88%E6%8C%87%E5%8C%97.md) +5. 我们使用的 markdown 语法和 github 一致,具体语法可参见 https://github.com/guodongxiaren/README 。而实际中使用的都是基本语法,比如链接、包含图片、标题、列表、字体控制和代码高亮。 +6. 选题的内容分为两类: 干货和湿货。干货就是技术文章,比如针对某种技术、工具的介绍、讲解和讨论。湿货则是和技术、开发、计算机文化有关的文章。选题时主要就是根据这两条来选择文章,文章需要对大家有益处,篇幅不宜太短,可以是系列文章,也可以是长篇大论,但是文章要有内容,不能有严重的错误,最好不要选择已经有翻译的原文。 From c57e6cb1b9cb3a308afea0bb9cf0637a5ef4ce13 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 16 Jun 2016 08:02:16 +0800 Subject: [PATCH 0916/1469] PUB:20160304 Image processing at NASA with open source tools @willowyoung --- ...ocessing at NASA with open source tools.md | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) rename {translated/tech => published}/20160304 Image processing at NASA with open source tools.md (81%) diff --git a/translated/tech/20160304 Image processing at NASA with open source tools.md b/published/20160304 Image processing at NASA with open source tools.md similarity index 81% rename from translated/tech/20160304 Image processing at NASA with open source tools.md rename to published/20160304 Image processing at NASA with open source tools.md index a26b96936c..983a5bf50e 100644 --- a/translated/tech/20160304 Image processing at NASA with open source tools.md +++ b/published/20160304 Image processing at NASA with open source tools.md @@ -1,10 +1,10 @@ -# 在NASA中使用开源工具进行图像处理 +在 NASA 使用开源工具进行图像处理 +================== -关键词:NASA,图像处理,Node.js,OpenCV ![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/nasa_spitzer_space_pink_spiral.jpg?itok=3XEUstkl) -在刚结束的这个夏天里,我是 [NASA 格伦中心][1] [GVIS][2] 实验室的实习生,我将我对开源的热情带到了那里。我的任务是改进我们实验室对 Dan Schroeder 开发的一个开源流体动力学模拟器的贡献。原本的模拟器可以显示用户用鼠标绘制的障碍物,并建立计算流体动力学模型。我们团队的贡献是加入图像处理的代码,分析实况视频的每一帧以显示特定的物体如何与液体相互作用。而且,我们还要做更多事情。 +在刚结束的这个夏天里,我是 [NASA 格伦中心][1] [GVIS][2] 实验室的实习生,我将我对开源的热情带到了那里。我的任务是改进我们实验室对 Dan Schroeder 开发的一个开源流体动力学模拟器的贡献。原本的[模拟器][3]可以显示用户用鼠标绘制的障碍物,并建立计算流体动力学模型。我们团队的贡献是加入图像处理的代码,分析实况视频的每一帧以显示特定的物体如何与液体相互作用。而且,我们还要做更多事情。 我们想要让图像处理部分更加健壮,所以我致力于改善图像处理库。 @@ -16,33 +16,33 @@ 2. 找寻物体的质心 3. 能对物体中心进行相关的精确转换 -我的导师建议我安装 [Node.js](http://nodejs.org/) 、 [OpenCV](http://opencv.org/) 和 [Node.js bindings for OpenCV](https://github.com/peterbraden/node-opencv)。在等待软件安装的过程中,我查看了 OpenCV 的 [GitHub 主页][3]上的示例源码。我发现示例源码使用 JavaScript 写的,而我还不懂 JavaScript ,所以我在 Codecademy 上学了一些课程。两天后,我对 JavaScript 依旧生疏,不过我还是开始了我的项目…它包含了更多的 JavaScript 。 +我的导师建议我安装 [Node.js](http://nodejs.org/) 、 [OpenCV](http://opencv.org/) 和 [Node.js bindings for OpenCV](https://github.com/peterbraden/node-opencv)。在等待软件安装的过程中,我查看了 OpenCV 的 [GitHub 主页][4]上的示例源码。我发现示例源码使用 JavaScript 写的,而我还不懂 JavaScript ,所以我在 Codecademy 上学了一些课程。两天后,我对 JavaScript 依旧生疏,不过我还是开始了我的项目……它包含了更多的 JavaScript 。 检测轮廓的示例代码工作得很好。事实上,它使得我用几个小时就完成了第一个目标!获取一幅图片的轮廓,它看起来像这样: ![](https://opensource.com/sites/default/files/resize/image_processing_nasa_1-520x293.jpg) -> 包括所有轮廓的原始图, +*包括所有轮廓的原始图* 检测轮廓的示例代码工作得有点好过头了。不仅物体的轮廓被检测到了,整个图片中的轮廓都检测到了。这会导致模拟器要与那些没用的轮廓打交道。这是一个严重的问题,因为它会返回错误的数据。为了避免模拟器接触到不想要的轮廓,我加了一个区域约束。轮廓要位于一定的区域范围内才会被画出来。区域约束使得轮廓变干净了。 ![](https://opensource.com/sites/default/files/resize/image_processing_nasa_2-520x293.jpg) -> 过滤后的轮廓,包含了阴影轮廓 +*过滤后的轮廓,包含了阴影轮廓* 虽然无关的轮廓没有了,但是图像还有个问题。图像本该只有一个轮廓,但是它来回绕了自己两次,没有完整地圈起来。区域在这里不能作为决定因素,所以必须试试其他方式。 -这一次,我不是直接去找寻轮廓,而是先将图片转换成二值图。二值图是转换之后只有黑白像素的图片。为了获取到二值图我先把彩色图转成灰度图。转换之后我再用阈值函数对图片进行处理。阈值函数遍历图片每个像素点的值,如果值小于 30 ,像素的颜色就会改成黑色。否则则反。在原始图片转换成二值图之后,结果变成这样: +这一次,我不是直接去找寻轮廓,而是先将图片转换成二值图。二值图是转换之后只有黑白像素的图片。为了获取到二值图我先把彩色图转成灰度图。转换之后我再用阈值函数对图片进行处理。阈值函数遍历图片每个像素点的值,如果值小于 30 ,像素的颜色就会改成黑色。否则取反。在原始图片转换成二值图之后,结果变成这样: ![](https://opensource.com/sites/default/files/resize/image_processing_nasa_3-520x293.jpg) -> 二值图。 +*二值图* 然后我获取了二值图的轮廓,结果是一个更干净的轮廓,没有了阴影轮廓。 ![](https://opensource.com/sites/default/files/image_processing_nasa_4.jpg) -> 最后的干净轮廓。 +*最后的干净轮廓* 这个时候,我可以获取干净的轮廓、计算质心了。可惜的是,我没有足够的时间去完成质心的相关变换。由于我的实习时间只剩下几天了,我开始考虑我在这段有限时间内能做的其它事情。其中一个就是边界矩形。边界矩形是包含了图片轮廓的最小四边形。边界矩形很重要,因为它是在页面上缩放轮廓的关键。虽然很遗憾我没时间利用边界矩形做更多事情,但是我仍然想学习它,因为它是个很有用的工具。 @@ -50,7 +50,7 @@ ![](https://opensource.com/sites/default/files/resize/image_processing_nasa_5-521x293.jpg) -> 最终图像,红色的边界矩形和质心。 +*最终图像,红色的边界矩形和质心* 当这些图像处理代码写完之后,我用我的代码替代了模拟器中的老代码。令我意外的是,它可以工作。 @@ -60,11 +60,11 @@ ( Youtube 演示视频) -程序有内存泄露,每 1/10 秒泄露 100MB 。我很高兴原因不是我的代码。坏消息是我并不能修复它。好消息是仍然有解决方法。它并非最理想的,但我可以使用。这个方法是不断检查模拟器使用的内存,当使用内存超过 1GB 时,重新启动模拟器。 +程序有内存泄露,每 1/10 秒泄露 100MB 。我很高兴不是因为我的代码。坏消息是我并不能修复它。另一个好消息是仍然有解决方法,虽然并非最理想的,但我可以使用。这个方法是不断检查模拟器使用的内存,当使用内存超过 1GB 时,重新启动模拟器。 在 NASA 实验室,我们会使用很多的开源软件,没有这些开源软件的帮助,我不可能完成这些工作。 -* * * +------- via: [https://opensource.com/life/16/3/image-processing-nasa](https://opensource.com/life/16/3/image-processing-nasa) @@ -76,4 +76,5 @@ via: [https://opensource.com/life/16/3/image-processing-nasa](https://opensource [1]: http://www.nasa.gov/centers/glenn/home/index.html [2]: https://ocio.grc.nasa.gov/gvis/ -[3]: https://github.com/peterbraden/node-opencv +[3]: http://physics.weber.edu/schroeder/fluids/ +[4]: https://github.com/peterbraden/node-opencv From e3b6949443c8ddc77add2ca41e0a9d917c383f24 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 16 Jun 2016 08:23:29 +0800 Subject: [PATCH 0917/1469] PUB:20160524 Test Fedora 24 Beta in an OpenStack cloud @geekpi --- ...st Fedora 24 Beta in an OpenStack cloud.md | 77 ++++++++++++++++++ ...st Fedora 24 Beta in an OpenStack cloud.md | 78 ------------------- 2 files changed, 77 insertions(+), 78 deletions(-) create mode 100644 published/20160524 Test Fedora 24 Beta in an OpenStack cloud.md delete mode 100644 translated/tech/20160524 Test Fedora 24 Beta in an OpenStack cloud.md diff --git a/published/20160524 Test Fedora 24 Beta in an OpenStack cloud.md b/published/20160524 Test Fedora 24 Beta in an OpenStack cloud.md new file mode 100644 index 0000000000..68c147c5e8 --- /dev/null +++ b/published/20160524 Test Fedora 24 Beta in an OpenStack cloud.md @@ -0,0 +1,77 @@ +在 OpenStack 云中测试 Fedora 24 Beta +=========================================== + +![](https://major.io/wp-content/uploads/2012/01/fedorainfinity.png) + +虽然离 [Fedora 24][1] 还有几周,你现在可以就测试Fedora 24 Beta了。这是一个[窥探新特性][2]的好机会,并且可以帮助他们找出仍需要修复的 bug。 + +[Fedora Cloud][3] 镜像可以从你常用的[本地镜像][4]或者 [Fedora 的服务器][5]中下载。本篇文章我将向你展示如何将这个镜像导入 OpenStack 环境并且测试 Fedora 24 Beta。 + +最后说一下:这还是 beta 软件。目前对我来说是可靠的,但是你的体验可能会不同。我建议你等到正式版发布再在上面部署关键的应用。 + +### 导入镜像 + +旧版的 glance 客户端(版本1)允许你在 OpenStack 环境中导入一个可通过 URL 访问的镜像。由于我 OpenStack 云的连接速度(1 Gbps)比我家 (大约 20 mbps 上传速度)快,这个功能对我很有用。然而,从 URL 导入的功能[在 glance v2 中被移除了]。[OpenStackClient][7] 也不支持这个功能。 + +现在由两个选择: + +- 安装旧版的 glance 客户端 +- 使用 Horizon (网页面板) + +获取旧版本的 glance 是有挑战性的。OpenStack liberty 版本的需求文件[对 glance 客户端没有最高版本上限][8],并且很难找到让旧版客户端工作的依赖文件。 + +让我们使用 Horizon,这就是写这篇文章的原因。 + +### 在 Horizon 中添加一个镜像 + +登录 Horizon 面板,点击 Compute->Image。点击页面右上方的“+ Create Image”,一个新的窗口会显示出来。并且窗口中有这些信息: + +- **Name**: Fedora 24 Cloud Beta +- **Image Source**: 镜像位置 +- **Image Location**: http://mirrors.kernel.org/fedora/releases/test/24_Beta/CloudImages/x86_64/images/Fedora-Cloud-Base-24_Beta-1.6.x86_64.qcow2 +- **Format**: QCOW2 – QEMU 模拟器 +- **Copy Data**: 确保勾选了 + +完成后,你会看到这个: + +![](https://major.io/wp-content/uploads/2016/05/horizon_image.png) + +点击“创建镜像(Creat Image)”,接着镜像列表会显示一段时间的 Saving 信息。一旦切换到 Active,你就可以构建一个实例了。 + +### 构建实例 + +既然我们在使用 Horizon,我们可以在此完成构建过程。 + +在镜像列表页面,找出我们上传的镜像并且点击右边的启动实例(Launch Instance)。一个新的窗口会显示出来。镜像名(Image Name)下拉框中应该已经选择了 Fedora 24 Beta 的镜像。在这里,选择一个实例名,选择一个安全组和密钥对(在 Access & Security 标签中)和网络(在 Networking 标签)。确保选择有足够容量的存储(m1.tiny 不太够)。 + +点击启动(Launch)并且等待实例启动。 + +一旦实例构建完成,你能以用户 fedora 通过 ssh 连接到实例。如果你的[安全组允许连接][9]并且你的密钥对正确配置了,你应该进入到 Fedora 24 Beta 中了! + +还不确定接下来做什么?有下面几点建议: + +- 升级所有的包并且重启(确保你测试的是最新的更新) +- 安装一些熟悉的应用并且验证它们可以正常工作 +- 测试你已有的自动化或者配置管理工具 +- 打开 bug 报告 + +-------------------------------------------------------------------------------- + +via: https://major.io/2016/05/24/test-fedora-24-beta-openstack-cloud/ + +作者:[major.io][a] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://major.io/about-the-racker-hacker/ +[1]: https://fedoraproject.org/wiki/Releases/24/Schedule +[2]: https://fedoraproject.org/wiki/Releases/24/ChangeSet +[3]: https://getfedora.org/en/cloud/ +[4]: https://admin.fedoraproject.org/mirrormanager/mirrors/Fedora/24/x86_64 +[5]: https://getfedora.org/en/cloud/download/ +[6]: https://wiki.openstack.org/wiki/Glance-v2-v1-client-compatability +[7]: http://docs.openstack.org/developer/python-openstackclient/ +[8]: https://github.com/openstack/requirements/blob/stable/liberty/global-requirements.txt#L159 +[9]: https://major.io/2016/05/16/troubleshooting-openstack-network-connectivity/ diff --git a/translated/tech/20160524 Test Fedora 24 Beta in an OpenStack cloud.md b/translated/tech/20160524 Test Fedora 24 Beta in an OpenStack cloud.md deleted file mode 100644 index e32cd43f2e..0000000000 --- a/translated/tech/20160524 Test Fedora 24 Beta in an OpenStack cloud.md +++ /dev/null @@ -1,78 +0,0 @@ -在OpenStack云中测试Fedora 24 Beta -=========================================== - -![](https://major.io/wp-content/uploads/2012/01/fedorainfinity.png) - -虽然离[Fedora 24][1]还有几周,你可以今天就测试Fedora 24 Beta了。这是一个[窥探新特性][2]的好机会,并且可以帮助找出仍需要修复的bug。 - -[Fedora Cloud][3]镜像可以从你最喜欢的[本地镜像][4]或者[Fedora的服务器][5]中下载。本篇文章我将向你展示如何将这个镜像导入Openstack环境并且测试Fedora 24 Beta。 - -最后说一下:这还是beta软件。目前对我来说是可靠的,但是你的体验可能会不同。我建议你等到正式版发布再在上面部署关键的应用。 - -### 导入镜像 - -旧版的glance客户端(版本1)允许你在Openstack环境中导入一个URL镜像。由于我Openstack云的连接速度(1 Gbps)比我家 (大约20 mbps上传速度)快,这个功能对我很有用。然而,从URL导入的功能[在glance v2中被移除了]。[OpenStackClient][7]也不支持这个功能。 - -现在由两个选择: - -- 安装旧版的glance客户端 -- 使用 Horizon (网页面板) - -获取旧版本的glance是有挑战性的。Openstack自由发布的需求文件[对glance客户端没有最高版本上限][8],并且很难找到让旧版客户端工作的依赖文件。 - -让我们使用Horizon,来回到写这篇文章的原因。 - - -### 在Horizon中添加一个镜像 - -登录Horizon面板,点击Compute->Image. 点击页面右上方的“+”创建新镜像,一个新的窗口会显示出来。并且窗口中有这些信息: - -- **Name**: Fedora 24 Cloud Beta -- **Image Source**: Image位置 -- **Image Location**: http://mirrors.kernel.org/fedora/releases/test/24_Beta/CloudImages/x86_64/images/Fedora-Cloud-Base-24_Beta-1.6.x86_64.qcow2 -- **Format**: QCOW2 – QEMU Emulator -- **Copy Data**: 确保勾选了 - -完成后,你会看到这个: - -![](https://major.io/wp-content/uploads/2016/05/horizon_image.png) - -点击创建镜像,接着会显示一段时间的Saving。一旦切换到Active,你可以构建一个实例了。 - -### 构建实例 - -既然我们在Horizon,我们可以完成构建过程了。 - -在镜像列表页面,找出我们上传的镜像并且点击右边的启动实例。一个新的窗口会显示出来。下拉框中应该已经选择了Fedora 24 Beta的镜像。在这里,选择一个实例名,选择一个安全组和密钥对(在Access & Security中)和网络(在Networking标签)。确保选择有足够容量的存储(m1.tiny还不够)。 - -点击启动并且等待实例启动。 - -一旦实例构建完成,你可以作为fedora用户通过ssh连接。如果你的[安全组允许连接][9]并且你的密钥对正确配置了,你应该在Fedora 24 Beta中了! - -还不确定接下来做什么?有下面几点建议: - -- 升级所有的包并且重启(确保你测试的是最新的更新) -- 安装一些相似的应用并且验证它们可以正常工作 -- 测试你已有的自动化或者配置管理工具 -- 打开bug报告 - --------------------------------------------------------------------------------- - -via: https://major.io/2016/05/24/test-fedora-24-beta-openstack-cloud/ - -作者:[major.io][a] -译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://major.io/about-the-racker-hacker/ -[1]: https://fedoraproject.org/wiki/Releases/24/Schedule -[2]: https://fedoraproject.org/wiki/Releases/24/ChangeSet -[3]: https://getfedora.org/en/cloud/ -[4]: https://admin.fedoraproject.org/mirrormanager/mirrors/Fedora/24/x86_64 -[5]: https://getfedora.org/en/cloud/download/ -[6]: https://wiki.openstack.org/wiki/Glance-v2-v1-client-compatability -[7]: http://docs.openstack.org/developer/python-openstackclient/ -[8]: https://github.com/openstack/requirements/blob/stable/liberty/global-requirements.txt#L159 -[9]: https://major.io/2016/05/16/troubleshooting-openstack-network-connectivity/ From 2f2c242c0c572f998097c3d648a6e5b334a19d01 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 16 Jun 2016 08:38:10 +0800 Subject: [PATCH 0918/1469] PUB:20160516 4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX @alim0x --- ...DERN OPEN SOURCE CODE EDITORS FOR LINUX.md | 34 ++++++++----------- 1 file changed, 15 insertions(+), 19 deletions(-) rename {translated/tech => published}/20160516 4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX.md (60%) diff --git a/translated/tech/20160516 4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX.md b/published/20160516 4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX.md similarity index 60% rename from translated/tech/20160516 4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX.md rename to published/20160516 4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX.md index f3045322f3..f4760a61d5 100644 --- a/translated/tech/20160516 4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX.md +++ b/published/20160516 4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX.md @@ -3,17 +3,17 @@ Linux 上四个最佳的现代开源代码编辑器 ![](http://itsfoss.com/wp-content/uploads/2015/01/Best_Open_Source_Editors.jpeg) -在寻找 **Linux 上最好的代码编辑器**?如果你问那些老派的 Linux 用户,他们的答案肯定是 Vi,Vim,Emacs,Nano 等等。但我不讨论它们。我要讨论的是最新的,美观,优美强大,功能丰富,能够提高你编程体验的,**最好的 Linux 开源代码编辑器**。 +在寻找 **Linux 上最好的代码编辑器**?如果你问那些老派的 Linux 用户,他们的答案肯定是 Vi,Vim,Emacs,Nano 等等。但我不讨论它们。我要讨论的是崭新、先进、优美、强大、功能丰富,能够提高你编程体验的**最好的 Linux 开源代码编辑器**。 ### Linux 上最佳的现代开源代码编辑器 -我使用 Ubuntu 作为我的主力系统,因此提供的安装说明适用于基于 Ubuntu 的发行版。但这并不会让这个列表变成 **Ubuntu 上的最佳文本编辑器**,因为这些编辑器对所有 Linux 发行版都适用。多说一句,这个清单没有任何先后顺序。 +我使用 Ubuntu 作为我的主力系统,因此提供的安装说明适用于基于 Ubuntu 的发行版。但这并不会让这个列表变成 **Ubuntu 上的最佳文本编辑器**,因为这些编辑器对所有 Linux 发行版都适用。多说一句,这个清单的排名没有任何先后顺序。 ### BRACKETS ![](http://itsfoss.com/wp-content/uploads/2015/01/brackets_UI.jpeg) -[Brackets][1] 是 [Adobe][2] 的一个开源代码编辑器。Brackets 专注于 web 设计师的需求,内置 HTML,CSS 和 JavaScript 支持。它很轻量,也很强大。它提供了行内编辑和实时预览。还有无数可用的插件,进一步加强你在 Brackets 上的体验。 +[Brackets][1] 是来自 [Adobe][2] 的一个开源代码编辑器。Brackets 专注于 web 设计师的需求,内置 HTML、CSS 和 JavaScript 支持。它很轻量,也很强大。它提供了行内编辑和实时预览。还有无数可用的插件,可以进一步加强你在 Brackets 上的体验。 在 Ubuntu 以及基于 Ubuntu 的发行版(比如 Linux Mint)上[安装 Brackets][3] 的话,你可以用这个非官方的 PPA: @@ -25,52 +25,48 @@ sudo apt-get install brackets 至于其它 Linux 发行版,你可以从它的网站上获取到适用于 Linux,OS X 和 Windows 源码和二进制文件。 -[下载 Brackets 源码和二进制包](https://github.com/adobe/brackets/releases) +- [下载 Brackets 源码和二进制包](https://github.com/adobe/brackets/releases) ### ATOM ![](http://itsfoss.com/wp-content/uploads/2014/08/Atom_Editor.jpeg) -[Atom][4] 是另一个给程序员的开源代码编辑器,现代而且美观。Atom 是由 Github 开发的,宣称是“21世纪的可定制文本编辑器”。Atom 的外观看起来类似 Sublime Text,一个在程序员中很流行但是闭源的文本编辑器。 +[Atom][4] 是另一个给程序员的开源代码编辑器,现代而且美观。Atom 是由 Github 开发的,宣称是“面向21世纪的可魔改文本编辑器”。Atom 的外观看起来类似 Sublime Text,那是一个在程序员中很流行但是闭源的文本编辑器。 Atom 最近发布了 .deb 和 .rpm 包,所以你可以轻而易举地在基于 Debian 和 Fedora 的 Linux 发行版上安装它。当然,它也提供了源代码。 - -[下载 Atom .deb](https://atom.io/download/deb) - -[下载 Atom .rpm](https://atom.io/download/rpm) - -[获取 Atom 源码](https://github.com/atom/atom/blob/master/docs/build-instructions/linux.md) +- [下载 Atom .deb](https://atom.io/download/deb) +- [下载 Atom .rpm](https://atom.io/download/rpm) +- [获取 Atom 源码](https://github.com/atom/atom/blob/master/docs/build-instructions/linux.md) ### LIME TEXT ![](http://itsfoss.com/wp-content/uploads/2014/08/LimeTextEditor.jpeg) -你喜欢 Sublime Text 但是你对它是闭源的这一事实感觉不是很舒服?别担心,我们有 [Sublime Text 的开源克隆版][5],叫做 [Lime Text][6]。它是基于 Go,HTML 和 QT 的。克隆 Sublime Text 的原因是 Sublime Text 2 中有无数 bug,而 Sublime Text 3 看起来会永远处于 beta 之中。它的开发过程并不透明,也就无从得知 bug 是否被修复了。 +你喜欢 Sublime Text 但是你对它是闭源的这一事实感觉不是很舒服?别担心,我们有 [Sublime Text 的开源克隆版][5],叫做 [Lime Text][6]。它是基于 Go、HTML 和 QT 的。克隆 Sublime Text 的原因是 Sublime Text 2 中有无数 bug,而 Sublime Text 3 看起来会永远处于 beta 之中,而它的开发过程并不透明,也就无从得知 bug 是否被修复了。 所以开源爱好者们,开心地去下面这个链接下载 Lime Text 的源码吧: -[获取 Lime Text 源码](https://github.com/limetext/lime) +- [获取 Lime Text 源码](https://github.com/limetext/lime) ### LIGHT TABLE ![](http://itsfoss.com/wp-content/uploads/2015/01/Light_Table.jpeg) -[Light Table][7] 是另一个外观现代,功能丰富的开源代码编辑器,标榜“下一代代码编辑器”,它更像一个 IDE 而不仅仅是个文本编辑器。它还有无数扩展用以加强它的功能。也许你会喜欢它的行内求值。你得用用它才会相信 Light Table 有多好用。 +[Light Table][7] 是另一个外观现代、功能丰富的开源代码编辑器,标榜为“下一代代码编辑器”,它更像一个 IDE 而不仅仅是个文本编辑器。它还有无数可以加强它的功能的扩展。也许你会喜欢它的行内求值。你得用用它才会相信 Light Table 有多好用。 -[在 Ubuntu 上安装 Light Table](http://itsfoss.com/install-lighttable-ubuntu/) +- [在 Ubuntu 上安装 Light Table](http://itsfoss.com/install-lighttable-ubuntu/) ### 你的选择是? -不,我们的选择没有限制在这四个 Linux 代码编辑器之中。这个清单只是关于程序员的现代编辑器。当然,你还有很多选择,比如 [Notepad++ 的替代选择 Notepadqq][8] 或 [SciTE][9] 以及更多。那么,上面四个中,在 Linux 上而言你最喜欢哪个代码编辑器? - +不,我们的选择没有限制在这四个 Linux 代码编辑器之中。这个清单只是关于程序员的现代编辑器。当然,你还有很多选择,比如 [Notepad++ 的替代选择 Notepadqq][8] 或 [SciTE][9] 等等。那么,上面四个中,在 Linux 上而言你最喜欢哪个代码编辑器? ---------- -via: http://itsfoss.com/best-modern-open-source-code-editors-for-linux/?utm_source=newsletter&utm_medium=email&utm_campaign=offline_and_portable_linux_apps_and_other_linux_stories +via: http://itsfoss.com/best-modern-open-source-code-editors-for-linux/ 作者:[Abhishek Prakash][a] 译者:[alim0x](https://github.com/alim0x) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 6577190a20ef7e1ed825a5cd465cd154b6e5a9d8 Mon Sep 17 00:00:00 2001 From: vim-kakali <1799225723@qq.com> Date: Thu, 16 Jun 2016 14:19:04 +0800 Subject: [PATCH 0919/1469] translated --- ...31 Why Ubuntu-based Distros Are Leaders.md | 65 -------------- ...31 Why Ubuntu-based Distros Are Leaders.md | 85 +++++++++++++++++++ 2 files changed, 85 insertions(+), 65 deletions(-) delete mode 100644 sources/talk/20160531 Why Ubuntu-based Distros Are Leaders.md create mode 100644 translated/talk/20160531 Why Ubuntu-based Distros Are Leaders.md diff --git a/sources/talk/20160531 Why Ubuntu-based Distros Are Leaders.md b/sources/talk/20160531 Why Ubuntu-based Distros Are Leaders.md deleted file mode 100644 index d038db6cfa..0000000000 --- a/sources/talk/20160531 Why Ubuntu-based Distros Are Leaders.md +++ /dev/null @@ -1,65 +0,0 @@ -vim-kakali translating - -Why Ubuntu-based Distros Are Leaders -========================================= - -Over the years, I've tried a number of great Linux distributions. The distros that had the greatest impact with me personally were those that maintained a strong community. But there's more to a popular distribution than a strong community. Popular Linux distributions tend to appeal to newcomers, often due to features that make using the distro easier. There are obviously exceptions to this, but generally speaking it is true. - -One distribution that comes to mind is [Ubuntu][1]. Built from a solid [Debian][2] base, Ubuntu has not only become an incredibly popular Linux distro, it's also made countless other distributions such as Linux Mint a reality. In this article, I'll explore why I believe Ubuntu wins the Linux distribution wars and how it's influenced Linux on the desktop as a whole. - -### Ubuntu is easy to use - -Before I first tried Ubuntu years ago, I preferred using the KDE desktop. At that time, it was simply the environment I had the most experience with. The main reason is that KDE was the most popular option among various newbie-friendly Linux distributions. Newbie-friendly distros like Knoppix, Simply Mepis, Xandros, Linspire, amongst others and all of them pointed their users towards the welcoming arms of KDE. - -At this time, KDE did what I needed it to do and I felt little reason to explore other desktop environments. Then one day after my Debian installation failed on me (due to my own user error), I decided to try out this "Ubuntu Dapper Drake" everyone was raving about. At that time, I was less than impressed with the screenshots I had seen, but figured it would be fun to try regardless. - -The biggest impression Ubuntu Dapper Drake made on me was how cleanly everything was laid out. Bear in mind, I came from the KDE world where there were fifteen ways to make one menu change. Ubuntu's implementation of GNOME was very minimalist. - -Flash forward to 2016 with the current 16.04 release: we have multiple Ubuntu flavors available, along with tons of distributions based on the Ubuntu base. The core thing all of these Ubuntu flavors and derivative distributions share in common is they're all designed to be easy to use. And when you're trying to grow your user base, stuff like this matters. - -### Ubuntu LTS - -In the past, I've almost always stuck with LTS releases for my main desktop. The x.10 releases were best left to my testing hard drive or perhaps even an old laptop. My reasons for this were simple – I had no interest in playing with short term releases on a production PC. I'm a busy guy and simply don't feel this is the best use of my time. - -Speaking for myself, I think Ubuntu offering LTS releases is one of the big reasons why the distribution has experienced such success. Think about it – offering folks a desktop Linux distro that will be fully supported for a long period of time has its advantages. To be fair, Ubuntu's not alone here, as there are other distros that do this as well. But I think this LTS strategy bundled with a newbie friendly environment has done Ubuntu a world of good. - -### Ubuntu Snap packages - -In the past, users once raved about the ability to get newer software titles onto their systems using PPAs (personal package archives). Unfortunately, this technology has its shortcomings. Issues like PPA abandonment to discovery are both common issues when working with random software titles. - -Then came the concept of [Snap packages][3]. Certainly not a completely new concept, as similar attempts have been made in the past. But what I think Snap will offer Ubuntu users in the long term is the ability to run the latest software without having to run the very latest Ubuntu release. While I still think we're seeing the early days of where Snap packages could end up, I'm excited at the prospect of bleeding edge software on a stable distribution release. - -The obvious downside is how much disk space Snap packages might potentially use if you're running a lot of software. Not only that, but most software for Ubuntu has yet to officially make the switch over from deb packages. The first issue is solved with ample hard drive space while the latter will simply be a waiting game. - -### Ubuntu Community - -I'm among the first to admit that all of the major Linux distributions have great communities. However, I firmly believe that Ubuntu's community might be the most diverse in terms of folks from different walks of life. For example, we have forums ranging from Apple hardware support to gaming. That's a particularly wide variety of specialized discussions. - -Going beyond the forums, Ubuntu also offers a highly defined community structure. This structure includes a council, technical board, [LoCo teams][4], and Developer Membership board. There are others, but these are the areas of the community structure that really stand out to me. - -Then we have [Ask Ubuntu][5]. In my view, this feature should replace seeking help from the forums as I find it to be far more likely you'll get useful information from this area. Not only that, solutions provided that are voted highly accurate might even make it into the official documentation. - -### Ubuntu's future - -I think Ubuntu's Unity interface has done little to increase desktop adoption. I understand why it was implemented, how it's making things easier for Ubuntu developers and whatnot. But in the end, I also believe it's paved the way for Ubuntu MATE and Linux Mint to increase in popularity as well. - -Another area that I wonder about is the future of Ubuntu's IRC and mailing lists. The fact is, neither lend themselves to bettering documentation like Ask Ubuntu can. As for mailing lists, I've always felt this was a painfully dated way to collaborate, but that's just me – others feel different and that's fine. - -What say you? Do you think Ubuntu will remain a major player going into the future? Perhaps you believe Arch, Linux Mint or others will dethrone Ubuntu in terms of popularity. Hit the Comments and give your favorite distribution a shout-out. If your favorite is based on Ubuntu, explain why you prefer it over Ubuntu proper. I think many of us can mutually agree that, if nothing else, Ubuntu makes a pretty popular base from which to build other distributions. - --------------------------------------------------------------------------------- - -via: http://www.datamation.com/open-source/why-ubuntu-based-distros-are-leaders.html - -作者:[Matt Hartley][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://www.datamation.com/author/Matt-Hartley-3080.html -[1]: http://www.ubuntu.com/ -[2]: https://www.debian.org/ -[3]: http://www.datamation.com/open-source/ubuntu-snap-packages-the-good-the-bad-the-ugly.html -[4]: http://loco.ubuntu.com/ -[5]: http://askubuntu.com/ diff --git a/translated/talk/20160531 Why Ubuntu-based Distros Are Leaders.md b/translated/talk/20160531 Why Ubuntu-based Distros Are Leaders.md new file mode 100644 index 0000000000..9d9ce0f418 --- /dev/null +++ b/translated/talk/20160531 Why Ubuntu-based Distros Are Leaders.md @@ -0,0 +1,85 @@ +为什么 Ubuntu 家族会占据 Linux 发行版的主导地位? +========================================= + +在过去的数年中,我已经尝试了大量的优秀 Linux 发行版。我印象最深刻的是那些被强大的社区维护的发行版。但是这样的发行版却比他们s所属的社区更受人欢迎。流行的 Linux 发行版吸引着更多的人,通常由于这样的特点使得使用该发行版更加容易。这很明显毫无关系,但一般认为这种说法是正确的。 + + +我想到的一个发行版 [Ubuntu][1]。它属于健壮的 [Debian][2]分支,Ubuntu 不可思议的成为了受欢迎的 Linux 发行版,而且它也衍生出了其他的版本,比如 Linux Mint。在本文中,我会探讨我坚信 Ubuntu 会赢得 Linux 发行版战争的原因,以及它在整个 Linux 桌面领域有着怎样的影响力。 + + +### Ubuntu容易使用 + + +多年前我第一次尝试使用Ubuntu,在这之前我更喜欢使用 KED 桌面。在那个时期,我接触的大多是这种 KDE 桌面环境。主要原因还是 KDE 是大多数新手友好的 Linux 发行版中最受欢迎的。新手友好的发行版有 Knoppix,Simply Mepis, Xandros, Linspire等,另外一些发行版和这些发行版都指出他们的用户趋向于使用 KDE。 + + + +现在KDE能满足我的需求,也没有什么理由去折腾其他的桌面环境了。有一天我的 Debian 安装失败了(由于我个人的操作不当),我决定尝试开发代号为「整洁的公鸭(Ubuntu Dapper Drake)」的 Ubuntu 版本【译者注:ubuntu 6.06 - Dapper Drake(整洁的公鸭),发布日期:2006年6月1日】。那个时候,我对于它的印象比一个屏幕截图还要少,但是我认为它很有趣并且毫无顾忌的使用它。 + + + +Ubuntu Dapper Drake 给我的最大的印象是它的操作很简单。记住,我是来自于 KDE 世界的用户,在 KDE 上要想改变菜单的设置就有15钟方法。Ubuntu 图形界面的安装启动极具极简主义。 + +时间来到2016年,最新的版本号是16.04:我们有多种可用的 Ubuntu 衍生版本,许多的都是基于 Ubuntu 的。所有的 Ubuntu 风格和公用发行版的核心都被设计的容易使用。并且发行版想要增大用户基数的时候,这就是最重要的原因。 + + +### Ubuntu LTS + +过去,我几乎一直坚持使用 LTS(Long Term Support)发行版作为我的主要桌面系统。10月份的发行版很适合我测试硬盘驱动器,甚至把它用在一个老旧的手提电脑上。我这样做的原因很简单——我没有兴趣在一个作为实验品的电脑上折腾短期发行版。我是个很忙的家伙,我觉得这样会浪费我的时间。 + + +对于我来说,我认为 Ubuntu 提供 LTS 发行版是 Ubuntu 能够变得流行的原因。这样说吧———提供一个大众的桌面 Linux 发行版,这个发行版能够得到长期的充分支持就是它的优势。事实上,Ubuntu 的优势不只这一点,其他的分支在这一点上也做的很好。长期支持版带有一个对新手的友好环境的策略,我认为这就为 Ubuntu 的普及带来了莫大的好处。 + + +### Ubuntu Snap 包 + + +以前,用户在他们的系统上使用很多 PPA(personal package archive个人软件包档案),他们总会抱怨它获得新的软件名称的能力。不好的是,这种技术也有缺点。它工作的时候带有任意的软件名称,而 PPA 却没有发现,这种情况很常见。 + + +现在有了[Snap 包][3] 。当然这不是一个全新的概念,过去已经进行了类似的尝试。用户不必要在最新的 Ubuntu 发行版上运行最新的软件,我认为这才是 Snap 将要长期提供给 Ubuntu 用户的东西。然而我仍然认为我们将会看到 Snap 淘汰的的那一天,我很期待看到一个在稳定的发行版上运行的优秀软件。 + + + +如果你要运行很多软件,那么 Snap 包实际使用的硬盘空间很明显存在问题。不仅如此,大多数 Ubuntu 软件也是通过由官方开发的 deb 包进行管理的。当后者需要花费一些时间的时候,这个问题可以通过 Snap 使用更大的硬盘驱动器空间得到解决。 + + + +### Ubuntu 社区 + +首先,我承认大多数主要的 Linux 发行版都有强大的社区。然而,我坚信 Ubuntu 社区的成员是最多样化的,他们来自各行各业。例如,我们有一个论坛来分类不同的苹果硬件对于游戏的支持程度。这些大量的专业讨论特别广泛。 + + +除过论坛,Ubuntu 也提供了一个很正式的社区组织。这个组织包括一个委员会,技术板块,[各地的团队LoCo teams][4](Ubuntu Local Community Teams)和开发人员板块。还有很多,但是这些都是我知道的社区组织部分。 + + +我们还有一个[Ubuntu 问答][5]板块。我认为,这种特色可以代替人们从论坛寻求帮助的方式,我发现在这个网站你得到有用信息的可能行更大。不仅如此,那些提供的解决方案中被选出的最精准的答案也会被写入到官方文档中。 + + +### Ubuntu 的未来 + + +我认为 Ubuntu 的 Unity 接口【译者注:Unity 是 Canonical 公司为 Ubuntu 操作系统的 GNOME 桌面环境开发的图形化 shell】在增加桌面舒适性上少有作为。我能理解其中的缘由,现在它主要做一些诸如可以使开发团队的工作更轻松的事情。但是最终,我还是希望 Unity 可以为 Ubuntu MATE 和 Linux Mint 的普及铺平道路。 + + +我最好奇的一点是 Ubuntu's IRC(Internet Relay Chat) 和邮件列表的发展【译者注:可以在 Ubuntu LoCo Teams IRC Chat上提问关于地方团队和计划的事件的问题,也可以和一些不同团队的成员进行交流】。事实是,他们都不能像 Ubuntu 问答板块那样为它们自己增添一些好的文档。至于邮件列表,我一直认为这对于合作是一种很痛苦的过时方法,但这仅仅是我的个人看法——其他人可能有不同的看法,也可能会认为它很好。 + +你说什么?你认为 Ubuntu 将来会剩下一点主要的使用者?也许你相信 Arch 和 Linux Mint 或者其他的发行版会在普及度上打败 Ubuntu 。 既然这样,那请大声说出你最喜爱的发行版。如果这个发行版是 Ubuntu 衍生版 ,说说你为什么更喜欢它而不是 Ubuntu 本身。如果不出意外,Ubuntu 会成为构建其他发行版的基础,我想很多人都是这样认为的。 + + +-------------------------------------------------------------------------------- + +via: http://www.datamation.com/open-source/why-ubuntu-based-distros-are-leaders.html + +作者:[Matt Hartley][a] +译者:[vim-kakali](https://github.com/vim-kakali) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.datamation.com/author/Matt-Hartley-3080.html +[1]: http://www.ubuntu.com/ +[2]: https://www.debian.org/ +[3]: http://www.datamation.com/open-source/ubuntu-snap-packages-the-good-the-bad-the-ugly.html +[4]: http://loco.ubuntu.com/ +[5]: http://askubuntu.com/ From 90dafb1bed18f4e94b73e54be85436e2f392bed6 Mon Sep 17 00:00:00 2001 From: erlinux <1006990314@qq.com> Date: Thu, 16 Jun 2016 17:17:28 +0800 Subject: [PATCH 0920/1469] erlinux translated --- ... Rapid prototyping with docker-compose.md | 142 ------------------ 1 file changed, 142 deletions(-) delete mode 100644 sources/tech/20160512 Rapid prototyping with docker-compose.md diff --git a/sources/tech/20160512 Rapid prototyping with docker-compose.md b/sources/tech/20160512 Rapid prototyping with docker-compose.md deleted file mode 100644 index 136eff7a7a..0000000000 --- a/sources/tech/20160512 Rapid prototyping with docker-compose.md +++ /dev/null @@ -1,142 +0,0 @@ -Translating by Bestony -Rapid prototyping with docker-compose -======================================== - -In this write-up we'll look at a Node.js prototype for **finding stock of the Raspberry PI Zero** from three major outlets in the UK. - -I wrote the code and deployed it to an Ubuntu VM in Azure within a single evening of hacking. Docker and the docker-compose tool made the deployment and update process extremely quick. - -### Remember linking? - -If you've already been through the [Hands-On Docker tutorial][1] then you will have experience linking Docker containers on the command line. Linking a Node hit counter to a Redis server on the command line may look like this: - -``` -$ docker run -d -P --name redis1 -$ docker run -d hit_counter -p 3000:3000 --link redis1:redis -``` - -Now imagine your application has three tiers - -- Web front-end -- Batch tier for processing long running tasks -- Redis or mongo database - -Explicit linking through `--link` is just about manageable with a couple of containers, but can get out of hand as we add more tiers or containers to the application. - -### Enter docker-compose - -![](http://blog.alexellis.io/content/images/2016/05/docker-compose-logo-01.png) ->Docker Compose logo - -The docker-compose tool is part of the standard Docker Toolbox and can also be downloaded separately. It provides a rich set of features to configure all of an application's parts through a plain-text YAML file. - -The above example would look like this: - -``` -version: "2.0" -services: - redis1: - image: redis - hit_counter: - build: ./hit_counter - ports: - - 3000:3000 -``` - -From Docker 1.10 onwards we can take advantage of network overlays to help us scale out across multiple hosts. Prior to this linking only worked across a single host. The `docker-compose scale` command can be used to bring on more computing power as the need arises. - ->View the [docker-compose][2] reference on docker.com - -### Real-world example: Raspberry PI Stock Alert - -![](http://blog.alexellis.io/content/images/2016/05/Raspberry_Pi_Zero_ver_1-3_1_of_3_large.JPG) ->The new Raspberry PI Zero v1.3 image courtesy of Pimoroni - -There is a huge buzz around the Raspberry PI Zero - a tiny microcomputer with a 1GHz CPU and 512MB RAM capable of running full Linux, Docker, Node.js, Ruby and many other popular open-source tools. One of the best things about the PI Zero is that costs only 5 USD. That also means that stock gets snapped up really quickly. - -*If you want to try Docker or Swarm on the PI check out the tutorial below.* - ->[Docker Swarm on the PI Zero][3] - -### Original site: whereismypizero.com - -I found a webpage which used screen scraping to find whether 4-5 of the most popular outlets had stock. - -- The site contained a static HTML page -- Issued one XMLHttpRequest per outlet accessing /public/api/ -- The server issued the HTTP request to each shop and performed the scraping - -Every call to /public/api/ took 3 seconds to execute and using Apache Bench (ab) I was only able to get through 0.25 requests per second. - -### Reinventing the wheel - -The retailers didn't seem to mind whereismypizero.com scraping their sites for stock, so I set about writing a similar tool from the ground up. I had the intention of handing a much higher amount of requests per second through caching and de-coupling the scrape from the web tier. Redis was the perfect tool for the job. It allowed me to set an automatically expiring key/value pair (i.e. a simple cache) and also to transmit messages between Node processes through pub/sub. - ->Fork or star the code on Github: [alexellis/pi_zero_stock][4] - -If you've worked with Node.js before then you will know it is single-threaded and that any CPU intensive tasks such as parsing HTML or JSON could lead to a slow-down. One way to mitigate that is to use a second worker process and a Redis messaging channel as connective tissue between this and the web tier. - -- Web tier - -Gives 200 for cache hit (Redis key exists for store) - -Gives 202 for cache miss (Redis key doesn't exist, so issues message) - -Since we are only ever reading a Redis key the response time is very quick. -- Stock Fetcher - -Performs HTTP request - -Scrapes for different types of web stores - -Updates a Redis key with a cache expire of 60 seconds - -Also locks a Redis key to prevent too many in-flight HTTP requests to the web stores. -``` -version: "2.0" -services: - web: - build: ./web/ - ports: - - "3000:3000" - stock_fetch: - build: ./stock_fetch/ - redis: - image: redis -``` - -*The docker-compose.yml file from the example.* - -Once I had this working locally deploying to an Ubuntu 16.04 image in the cloud (Azure) took less than 5 minutes. I logged in, cloned the repository and typed in `docker compose up -d`. That was all it took - rapid prototyping a whole system doesn't get much better. Anyone (including the owner of whereismypizero.com) can deploy the new solution with just two lines: - -``` -$ git clone https://github.com/alexellis/pi_zero_stock -$ docker-compose up -d -``` - -Updating the site is easy and just involves a `git pull` followed by a `docker-compose up -d` with the `--build` argument passed along. - -If you are still linking your Docker containers manually, try Docker Compose for yourself or my code below: - ->Fork or star the code on Github: [alexellis/pi_zero_stock][5] - -### Check out the test site - -The test site is currently deployed now using docker-compose. - ->[stockalert.alexellis.io][6] - -![](http://blog.alexellis.io/content/images/2016/05/Screen-Shot-2016-05-16-at-22-34-26-1.png) - -Preview as of 16th of May 2016 - ----------- -via: http://blog.alexellis.io/rapid-prototype-docker-compose/ - -作者:[Alex Ellis][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://blog.alexellis.io/author/alex/ -[1]: http://blog.alexellis.io/handsondocker -[2]: https://docs.docker.com/compose/compose-file/ -[3]: http://blog.alexellis.io/dockerswarm-pizero/ -[4]: https://github.com/alexellis/pi_zero_stock -[5]: https://github.com/alexellis/pi_zero_stock -[6]: http://stockalert.alexellis.io/ - From e35fdd50e355d4c8324cb6e2cd0b0c76818b79ee Mon Sep 17 00:00:00 2001 From: vim-kakali <1799225723@qq.com> Date: Thu, 16 Jun 2016 19:07:45 +0800 Subject: [PATCH 0921/1469] vim-kakali translating --- sources/talk/20160531 The Anatomy of a Linux User.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/talk/20160531 The Anatomy of a Linux User.md b/sources/talk/20160531 The Anatomy of a Linux User.md index 00c198712f..b403758f2a 100644 --- a/sources/talk/20160531 The Anatomy of a Linux User.md +++ b/sources/talk/20160531 The Anatomy of a Linux User.md @@ -1,3 +1,5 @@ +vim-kakali translating + The Anatomy of a Linux User ================================ From 3f3c31d191b352e990596e6e5004b0c51db5087c Mon Sep 17 00:00:00 2001 From: alim0x Date: Thu, 16 Jun 2016 19:16:37 +0800 Subject: [PATCH 0922/1469] [translated]Should distributors disable IPv4-mapped IPv6 --- ...d distributors disable IPv4-mapped IPv6.md | 62 ------------------- ...d distributors disable IPv4-mapped IPv6.md | 60 ++++++++++++++++++ 2 files changed, 60 insertions(+), 62 deletions(-) delete mode 100644 sources/talk/20160525 Should distributors disable IPv4-mapped IPv6.md create mode 100644 translated/talk/20160525 Should distributors disable IPv4-mapped IPv6.md diff --git a/sources/talk/20160525 Should distributors disable IPv4-mapped IPv6.md b/sources/talk/20160525 Should distributors disable IPv4-mapped IPv6.md deleted file mode 100644 index 1faf7dab6c..0000000000 --- a/sources/talk/20160525 Should distributors disable IPv4-mapped IPv6.md +++ /dev/null @@ -1,62 +0,0 @@ -alim0x translating - -Should distributors disable IPv4-mapped IPv6? -============================================= - -By all accounts, the Internet's transition to IPv6 has been a slow affair. In recent years, though, perhaps inspired by the exhaustion of the IPv4 address space, IPv6 usage has been [on the rise][1]. There is a corresponding interest in ensuring that applications work with both IPv4 and IPv6. But, as a recent discussion on the OpenBSD mailing list has highlighted, a mechanism designed to ease the transition to an IPv6 network may also make the net less secure — and Linux distributions may be configured insecurely by default. - -### Address mapping - -IPv6 may look like IPv4 in many ways, but it is a different protocol with a different address space. Server programs wanting to receive connections using either protocol must thus open separate sockets for the two different address families — AF_INET for IPv4, and AF_INET6 for IPv6. In particular, a program wishing to accept connections to any of a host's interfaces using either protocol will need to create an AF_INET socket bound to the all-zeroes wild-card address (0.0.0.0) and an AF_INET6 socket bound to the IPv6 equivalent (written as "::"). It must then listen for connections on both sockets — or so one would think. - -Many years ago, in [RFC 3493][2], the IETF specified a mechanism by which a program could work with either protocol using a single IPv6 socket. With a socket enabled for this behavior, the program need only bind to :: to receive connections to all interfaces with both protocols. When an IPv4 connection is made to the bound port, the source address will be mapped into IPv6 as described in [RFC 2373][3]. So, for example, a program using this mode would see an incoming connection from 192.168.1.1 as originating from ::ffff:192.168.1.1 (the mixed notation is how such addresses are ordinarily written). The program can also open connections to IPv4 addresses by mapping them in the same manner. - -The RFC calls for this behavior to be implemented by default, so most systems do so. There are exceptions, though, one of which is OpenBSD; there, programs wishing to work with both protocols can only do so by creating two independent sockets. A program that opens two sockets on Linux, though, will run into trouble: both the IPv4 and the IPv6 socket will try to bind to the IPv4 address(es), so whichever attempt comes second will fail. In other words, a program that binds a socket to a given port on :: will be bound to that port on both the IPv6 :: and the IPv4 0.0.0.0. If it then tries to bind an IPv4 socket to the same port on 0.0.0.0, the operation will fail as the port is already bound. - -There is a way around that problem, of course; the program can call setsockopt() to turn on the IPV6_V6ONLY option. A program that opens two sockets and sets IPV6_V6ONLY should be portable across all systems. - -Readers may be less than thoroughly shocked to learn that not every program out there gets all of this right. One of those, it turns out, is the [OpenNTPD][4] implementation of the Network Time Protocol. Brent Cook recently [proposed a small patch][5] adding the requisite setsockopt() call to the upstream OpenNTPD source, which lives within OpenBSD itself. That patch does not look likely to be accepted, though, for the most OpenBSD-like of reasons. - -### Security concerns - -As mentioned above, OpenBSD does not support IPv4-mapped IPv6 sockets at all. Even if a program tries to explicitly enable address mapping by setting the IPV6_V6ONLY option to zero, its author will be disappointed; that setting has no effect on OpenBSD systems. The reasoning behind this decision is that this mapping brings some security concerns with it. There are various types of attack surface that it opens up, but it all comes down to the provision of two different ways to reach the same port, each with its own access-control rules. - -Any given server system may have set up firewall rules describing the allowed access to the port in question. There may also be mechanisms like TCP wrappers or a BPF-based filter in place, or a router on the net could be doing its own stateful connection filtering. The result is likely to be gaps in firewall protection and the potential for all kinds of confusion resulting from the same IPv4 address being reachable via two different protocols. If the address mapping is done at the edge of the network, the situation gets even more complex; see [this draft RFC from 2003][6] for a description of some other attack scenarios that come about if mapped addresses are transmitted between hosts. - -Adapting systems and software to properly handle IPv4-mapped IPv6 addresses can certainly be done. But that adds to the overall complexity of the system, and it's a sure bet that this adaptation has not actually been done anywhere near as widely as it should be. As Theo de Raadt [put it][7]: - - **Sometimes people put a bad idea into an RFC. Later they discover it is impossible to walk the idea back to the garbagebin. The result is concepts so complicated that everyone has to be a fulltime expert, on admin side and coder side**. - -It is not at all clear how many of these full-time experts are actually out there configuring systems and networks where IPv4-mapped IPv6 addresses are in use. - -One might well argue that, while IPv4-mapped IPv6 addresses create security hazards, there should be no harm in changing a program so that it turns off address mapping on systems that implement it. But Theo argues that this should not be done, for a couple of reasons. The first is that there are many broken programs out there, and it will never be possible to fix them all. But the real reason is to put pressure on distributors to turn off address mapping by default. As he put it: "**Eventually someone will understand the damage is systematic, and change the system defaults to 'secure by default'**." - -### Address mapping on Linux - -On Linux systems, address mapping is controlled by a sysctl knob called net.ipv6.bindv6only; it is set to zero (enabling address mapping) by default. Administrators (or distributors) can turn off mapping by setting this knob to one, but they would be well advised to be sure that their applications all work properly before deploying such a system in production. A quick survey suggests that none of the primary distributors change the default for this knob; Debian [changed the default][9] for the "squeeze" release in 2009, but the change broke enough packages ([anything involving Java][10], for example) that it was, [after a certain amount of Debian-style discussion][11], reverted. It would appear that quite a few programs rely on address mapping being enabled by default. - -OpenBSD has the freedom to break things outside of its core system in the name of "secure by default"; Linux distributors tend to have a harder time getting away with such changes. So those distributors, being generally averse to receiving abuse from their users, are unlikely to change the default of the bindv6only knob anytime soon. The good news is that this functionality has been the default for years and stories of exploits are hard to find. But, as we all know, that provides no guarantees that exploits are not possible. - - --------------------------------------------------------------------------------- - -via: https://lwn.net/Articles/688462/ - -作者:[Jonathan Corbet][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://lwn.net/ -[1]: https://www.google.com/intl/en/ipv6/statistics.html -[2]: https://tools.ietf.org/html/rfc3493#section-3.7 -[3]: https://tools.ietf.org/html/rfc2373#page-10 -[4]: https://github.com/openntpd-portable/ -[5]: https://lwn.net/Articles/688464/ -[6]: https://tools.ietf.org/html/draft-itojun-v6ops-v4mapped-harmful-02 -[7]: https://lwn.net/Articles/688465/ -[8]: https://lwn.net/Articles/688466/ -[9]: https://lists.debian.org/debian-devel/2009/10/msg00541.html -[10]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=560056 -[11]: https://lists.debian.org/debian-devel/2010/04/msg00099.html diff --git a/translated/talk/20160525 Should distributors disable IPv4-mapped IPv6.md b/translated/talk/20160525 Should distributors disable IPv4-mapped IPv6.md new file mode 100644 index 0000000000..8b4f4b4b4f --- /dev/null +++ b/translated/talk/20160525 Should distributors disable IPv4-mapped IPv6.md @@ -0,0 +1,60 @@ +发行版分发者应该禁用 IPv4 映射的 IPv6 地址吗 +============================================= + +大家都说,互联网向 IPv6 的过渡是件很缓慢的事情。不过在最近几年,可能是由于 IPv4 地址资源的枯竭,IPv6 的使用处于[上升态势][1]。相应的,开发者也有兴趣确保软件能在 IPv4 和 IPv6 下工作。但是,正如近期 OpenBSD 邮件列表的讨论所关注的,一个使得向 IPv6 转换更加轻松的机制设计同时也可能导致网络更不安全——并且 Linux 发行版们的默认配置可能并不安全。 + +### 地址映射 + +IPv6 在很多方面看起来可能很像 IPv4,但它是带有不同地址空间的不同的协议。服务器程序想要接受使用二者之中任意一个协议的连接,必须给两个不同的地址族分别打开一个套接字——IPv4 的 AF_INET 和 IPv6 的 AF_INET6。特别是一个程序希望接受使用任意协议到任意主机接口的连接的话,需要创建一个绑定到全零通配符地址(0.0.0.0)的 AF_INET 套接字和一个绑定到 IPv6 等效地址(写作“::”)的 AF_INET6 套接字。它必须在两个套接字上都监听连接——或者有人会这么认为。 + +多年前,在 [RFC 3493][2],IETF 指定了一个机制,程序可以使用一个单独的 IPv6 套接字工作在两个协议之上。有了一个启用这个行为的套接字,程序只需要绑定到 :: 来接受使用这两个协议到达所有接口的连接。当创建了一个 IPv4 连接到绑定端口,源地址会像 [RFC 2373][3] 中描述的那样映射到 IPv6。所以,举个例子,一个使用了这个模式的程序会将一个 192.168.1.1 的传入连接看作来自 ::ffff:192.168.1.1(这个混合的写法就是这种地址通常的写法)。程序也能通过相同的映射方法打开一个到 IPv4 地址的连接。 + +RFC 要求这个行为要默认实现,所以大多数系统这么做了。不过也有些例外,OpenBSD 就是其中之一;在那里,希望在两种协议下工作的程序能做的只能是创建两个独立的套接字。但一个在 Linux 中打开两个套接字的程序会遇到麻烦:IPv4 和 IPv6 套接字都会尝试绑定到 IPv4 地址,所以不论是哪个后者都会失败。换句话说,一个绑定到 :: 指定端口的套接字的程序会同时绑定到 IPv6 :: 和 IPv4 0.0.0.0 地址的那个端口上。如果程序之后尝试绑定一个 IPv4 套接字到 0.0.0.0 的相同端口上时,这个操作会失败,因为这个端口已经被绑定了。 + +当然有个办法可以解决这个问题;程序可以调用 setsockopt() 来打开 IPV6_V6ONLY 选项。一个打开两个套接字并且设置了 IPV6_V6ONLY 的程序应该可以在所有的系统间移植。 + +读者们可能对不是每个程序都能正确处理这一问题没那么震惊。事实证明,这些程序的其中之一是网络时间协议(Network Time Protocol)的 [OpenNTPD][4] 实现。Brent Cook 最近给上游 OpenNTPD 源码[提交了一个小补丁][5],添加了必要的 setsockopt() 调用,它也被提交到了 OpenBSD 中了。尽管那个补丁看起来不大可能被接受,最可能是因为 OpenBSD 式的理由(LCTT 译注:如前文提到的,OpenBSD 并不受这个问题的影响)。 + +### 安全担忧 + +正如上文所提到,OpenBSD 根本不支持 IPv4 映射的 IPv6 套接字。即使一个程序试着通过将 IPV6_V6ONLY 选项设置为 0 显式地启用地址映射,它的作者会感到沮丧,因为这个设置在 OpenBSD 系统中无效。这个决定背后的原因是这个映射带来了一些安全担忧。攻击打开接口的攻击类型有很多种,但它们最后都会回到规定的两个途径到达相同的端口,每个端口都有它自己的控制规则。 + +任何给定的服务器系统可能都设置了防火墙规则,描述端口的允许访问权限。也许还会有适当的机制,比如 TCP wrappers 或一个基于 BPF 的过滤器,或一个网络上的路由可以做连接状态协议过滤。结果可能是导致防火墙保护和潜在的所有类型的混乱连接之间的缺口导致同一 IPv4 地址可以通过两个不同的协议到达。如果地址映射是在网络边界完成的,情况甚至会变得更加复杂;参看[这个 2003 年的 RFC 草案][6],它描述了如果映射地址在主机之间传送,一些随之而来的其它攻击场景。 + +改变系统和软件合适地处理 IPv4 映射的 IPv6 地址当然可以实现。但那增加了系统的整体复杂度,并且可以确定这个改动没有实际完整实现到它应该实现的范围内。如同 Theo de Raadt [说的][7]: + + **有时候人们将一个坏主意放进了 RFC。之后他们发现不可能将这个主意扔回垃圾箱了。结果就是概念变得如此复杂,每个人都得在管理和编码方面是个全职专家。** + +我们也根本不清楚这些全职专家有多少在实际配置使用 IPv4 映射的 IPv6 地址的系统和网络。 + +有人可能会说,尽管 IPv4 映射的 IPv6 地址造成了安全危险,更改一下程序让它关闭部署实现它的系统上的地址映射应该没什么危害。但 Theo 认为不应该这么做,有两个理由。第一个是有许多破损的程序,它们永远不会被修复。但实际的原因是给发行版分发者压力去默认关闭地址映射。正如他说的:“**最终有人会理解这个危害是系统性的,并更改系统默认行为使之‘secure by default’**。” + +### Linux 上的地址映射 + +在 Linux 系统,地址映射由一个叫做 net.ipv6.bindv6only 的 sysctl 开关控制;它默认设置为 0(启用地址映射)。管理员(或发行版分发者)可以通过将它设置为 1 关闭地址映射,但在部署这样一个系统到生产环境之前最好确认软件都能正常工作。一个快速调查显示没有哪个主要发行版分发者改变这个默认值;Debian 在 2009 年的 “squeeze” 中[改变了这个默认值][9],但这个改动破坏了足够多的软件包(比如[任何包含 Java 的][10]),[在经过了一定数量的 Debian 式讨论之后][11],它恢复到了原来的设置。看上去不少程序依赖于默认启用地址映射。 + +OpenBSD 有自由以“secure by default”的名义打破其核心系统之外的东西;Linux 发行版分发者倾向于更难以作出这样的改变。所以那些一般不愿意收到他们用户的不满的发行版分发者,不太可能很快对 bindv6only 的默认设置作出改变。好消息是这个功能作为默认已经很多年了,但很难找到利用的例子。但是,正如我们都知道的,谁都无法保证这样的利用不可能发生。 + + +-------------------------------------------------------------------------------- + +via: https://lwn.net/Articles/688462/ + +作者:[Jonathan Corbet][a] +译者:[alim0x](https://github.com/alim0x) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://lwn.net/ +[1]: https://www.google.com/intl/en/ipv6/statistics.html +[2]: https://tools.ietf.org/html/rfc3493#section-3.7 +[3]: https://tools.ietf.org/html/rfc2373#page-10 +[4]: https://github.com/openntpd-portable/ +[5]: https://lwn.net/Articles/688464/ +[6]: https://tools.ietf.org/html/draft-itojun-v6ops-v4mapped-harmful-02 +[7]: https://lwn.net/Articles/688465/ +[8]: https://lwn.net/Articles/688466/ +[9]: https://lists.debian.org/debian-devel/2009/10/msg00541.html +[10]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=560056 +[11]: https://lists.debian.org/debian-devel/2010/04/msg00099.html From 1a7d4549da155a67ba88ffb32d47ec048a7ead40 Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 17 Jun 2016 22:23:10 +0800 Subject: [PATCH 0923/1469] =?UTF-8?q?20160617-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... 6 Amazing Linux Distributions For Kids.md | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 sources/tech/20160616 6 Amazing Linux Distributions For Kids.md diff --git a/sources/tech/20160616 6 Amazing Linux Distributions For Kids.md b/sources/tech/20160616 6 Amazing Linux Distributions For Kids.md new file mode 100644 index 0000000000..5d0053e2ce --- /dev/null +++ b/sources/tech/20160616 6 Amazing Linux Distributions For Kids.md @@ -0,0 +1,114 @@ +6 Amazing Linux Distributions For Kids +====================================== + +Linux and open source is the future and there is no doubt about that, and to see this come to a reality, a strong foundation has to be lied, by starting from the lowest level possible and that is exposing kids to Linux and teaching them how to use Linux operating systems. + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Linux-Distros-For-Kids.png) +>Linux Distros For Kids + +Linux is a very powerful operating system and that is one of the reasons why it powers a lot of servers on the Internet. Though there have been concerns about its user friendliness which has brought about debate of how it will over take Mac OSX and Windows on desktop computers, I think users need to accept Linux as it is to realize its real power. + +Today, Linux powers a lot of machines out there, from mobile phones, to tablets, laptops, workstations, servers, supercomputers, cars, air traffic control systems, refrigerators and many more. With all this and more yet to come in the near future, as I had already stated at the beginning, Linux is the operating system for future computing. + +>Read Also: [30 Big Companies and Devices Running on Linux][1] + +Because the future belongs to the kids of today, then introducing them to technologies that will change the future is the way to go. Therefore they have to be introduced at an early stage to start learning computer technologies and Linux as a special case. + +One thing common to children is curiosity and early learning can help instill the a character of exploration in them when the learning environment is designed to suit them. + +Having looked some quick reasons why kids should learn Linux, let us now go through a list of exciting Linux distributions that you can introduce your kids to, so that they can start using and learning Linux. + +### Sugar on a Stick + +It is a project by Sugar Labs that aims at designing free tools to support learning among children by making them gain skills in exploring, discovering, creating and also reflecting on ideas. It is a non-profit organization led by volunteers. + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Sugar-Neighborhood-View.png) +>Sugar Neighborhood View + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Sugar-Activity-Library.png) +>Sugar Activity Library + +You can think of sugar as both a desktop and a collection of learning activities that help encourage active involvement from children who are learning. + +Visit Homepage: + +### Edubuntu + +This is a grassroots project that is based on the most popular Linux distribution today, Ubuntu. It is intended get schools, homes and communities to easily install and use free Ubuntu software. + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Edubuntu-Apps.jpg) +>Edubuntu Desktop Apps + +It is supported by different groups of students, teachers, parents, stake holders and also hackers who believe in free learning and sharing of knowledge for self improvement and also community based development. + +The main aim of the project is to assemble a system that can offer free software to enhance learning and education by making it easy for users to install and also maintain software. + +Visit Homepage: + +### Doudou Linux + +It is designed specifically for children to experience ease in using a computer while building creative thinking in them. It provides simple yet educative applications that allows kids to learn and discover new ideas while using it. + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Doudou-Linux.png) +>Doudou Linux + +One important thing about Doudou Linux is its content filtering feature, which prevents children from visiting restricted content on the web. For more kids protection, it also includes user privacy on the Internet, automatically removes adds from web pages and many more. + +Visit Homepage: + +### LinuxKidX + +It is a LiveCD based on Slackware Linux with a long list of educational software for kids to learn form. It uses KDE as the default Desktop Environment and includes software such as Ktouch a typing tutor, Kstars as virtual planetaruim, Kalzium a periodic table, KwordQuiz among others. + +![](http://www.tecmint.com/wp-content/uploads/2016/05/LinuxKidX.jpg) +>LinuxKidX + +Visit Homepage: + +### Ubermix + +It is a free software that is built from the ground based on Ubuntu Linux and is intended for educational purposes. It comes with over 60 free software reinstalled and helps to make learning and teaching easy for students and teachers respectively. + +![](http://www.tecmint.com/wp-content/uploads/2016/05/ubermix.png) +>Ubermix Linux + +Some of its features include 5 minutes installation and also few seconds quick recovery mechanism. It should work well well for teenage children. + +Visit Homepage: + +### Qimo + +I have added this to list because many readers are expected to ask about Qimo, but as of this writing, the Qimo for kids development team has retired from the project, therefore no more development it expected. + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Qimo-Linux.png) +>Qimo Linux + +But you can still find most of the games for kids in Ubuntu and other Linux distributions. As they have mentioned, they are not done working on an educational software for kids and are developing an android application for children to improve their literacy skills. + +You can read more from their official website and expect more from them in the future. + +Visit Homepage: + +That is it for now, in case there are more Linux operating systems intended for kids or children out there, which I have not included in this list, you can let us know by leaving a comment. + +You can also let us know of what you think of introducing kids to Linux and the future of Linux especially on Desktop computers. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/best-linux-distributions-for-kids/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tecmint+%28Tecmint%3A+Linux+Howto%27s+Guide%29 + + +作者:[Aaron Kili][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/aaronkili/ + +[1]: http://www.tecmint.com/big-companies-and-devices-running-on-gnulinux/ + + + + + From 948d5243629992102885e53fd86a2f0602dd6908 Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 17 Jun 2016 23:17:02 +0800 Subject: [PATCH 0924/1469] =?UTF-8?q?20160617-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ntrol with SELinux or AppArmor in Linux.md | 248 ++++++++++++++++++ 1 file changed, 248 insertions(+) create mode 100644 sources/tech/20160608 Implementing Mandatory Access Control with SELinux or AppArmor in Linux.md diff --git a/sources/tech/20160608 Implementing Mandatory Access Control with SELinux or AppArmor in Linux.md b/sources/tech/20160608 Implementing Mandatory Access Control with SELinux or AppArmor in Linux.md new file mode 100644 index 0000000000..65c8657dff --- /dev/null +++ b/sources/tech/20160608 Implementing Mandatory Access Control with SELinux or AppArmor in Linux.md @@ -0,0 +1,248 @@ +Implementing Mandatory Access Control with SELinux or AppArmor in Linux +=========================================================================== + +To overcome the limitations of and to increase the security mechanisms provided by standard ugo/rwx permissions and [access control lists][1], the United States National Security Agency (NSA) devised a flexible Mandatory Access Control (MAC) method known as SELinux (short for Security Enhanced Linux) in order to restrict among other things, the ability of processes to access or perform other operations on system objects (such as files, directories, network ports, etc) to the least permission possible, while still allowing for later modifications to this model. + +![](http://www.tecmint.com/wp-content/uploads/2016/06/SELinux-AppArmor-Security-Hardening-Linux.png) +>SELinux and AppArmor Security Hardening Linux + +Another popular and widely-used MAC is AppArmor, which in addition to the features provided by SELinux, includes a learning mode that allows the system to “learn” how a specific application behaves, and to set limits by configuring profiles for safe application usage. + +In CentOS 7, SELinux is incorporated into the kernel itself and is enabled in Enforcing mode by default (more on this in the next section), as opposed to openSUSE and Ubuntu which use AppArmor. + +In this article we will explain the essentials of SELinux and AppArmor and how to use one of these tools for your benefit depending on your chosen distribution. + +### Introduction to SELinux and How to Use it on CentOS 7 + +Security Enhanced Linux can operate in two different ways: + +- Enforcing: SELinux denies access based on SELinux policy rules, a set of guidelines that control the security engine. +- Permissive: SELinux does not deny access, but denials are logged for actions that would have been denied if running in enforcing mode. + +SELinux can also be disabled. Although it is not an operation mode itself, it is still an option. However, learning how to use this tool is better than just ignoring it. Keep it in mind! + +To display the current mode of SELinux, use getenforce. If you want to toggle the operation mode, use setenforce 0 (to set it to Permissive) or setenforce 1 (Enforcing). + +Since this change will not survive a reboot, you will need to edit the /etc/selinux/config file and set the SELINUX variable to either enforcing, permissive, or disabled in order to achieve persistence across reboots: + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Enable-Disable-SELinux-Mode.png) +>How to Enable and Disable SELinux Mode + +On a side note, if getenforce returns Disabled, you will have to edit /etc/selinux/config with the desired operation mode and reboot. Otherwise, you will not be able to set (or toggle) the operation mode with setenforce. + +One of the typical uses of setenforce consists of toggling between SELinux modes (from enforcing to permissive or the other way around) to troubleshoot an application that is misbehaving or not working as expected. If it works after you set SELinux to Permissive mode, you can be confident you’re looking at a SELinux permissions issue. + +Two classic cases where we will most likely have to deal with SELinux are: + +- Changing the default port where a daemon listens on. +- Setting the DocumentRoot directive for a virtual host outside of /var/www/html. + +Let’s take a look at these two cases using the following examples. + +#### EXAMPLE 1: Changing the default port for the sshd daemon + +One of the first thing most system administrators do in order to secure their servers is change the port where the SSH daemon listens on, mostly to discourage port scanners and external attackers. To do this, we use the Port directive in `/etc/ssh/sshd_config` followed by the new port number as follows (we will use port 9999 in this case): + +``` +Port 9999 +``` + +After attempting to restart the service and checking its status we will see that it failed to start: + +``` +# systemctl restart sshd +# systemctl status sshd +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Check-sshd-Service-Status.png) +>Check SSH Service Status + +If we take a look at /var/log/audit/audit.log, we will see that sshd was prevented from starting on port 9999 by SELinux because that is a reserved port for the JBoss Management service (SELinux log messages include the word “AVC” so that they might be easily identified from other messages): + +``` +# cat /var/log/audit/audit.log | grep AVC | tail -1 +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Check-Linux-Audit-Logs.png) +>Check Linux Audit Logs + +At this point most people would probably disable SELinux but we won’t. We will see that there’s a way for SELinux, and sshd listening on a different port, to live in harmony together. Make sure you have the policycoreutils-python package installed and run: + +``` +# yum install policycoreutils-python +``` + +To view a list of the ports where SELinux allows sshd to listen on. In the following image we can also see that port 9999 was reserved for another service and thus we can’t use it to run another service for the time being: + +``` +# semanage port -l | grep ssh +``` + +Of course we could choose another port for SSH, but if we are certain that we will not need to use this specific machine for any JBoss-related services, we can then modify the existing SELinux rule and assign that port to SSH instead: + +``` +# semanage port -m -t ssh_port_t -p tcp 9999 +``` + +After that, we can use the first semanage command to check if the port was correctly assigned, or the -lC options (short for list custom): + +``` +# semanage port -lC +# semanage port -l | grep ssh +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Assign-Port-to-SSH.png) +>Assign Port to SSH + +We can now restart SSH and connect to the service using port 9999. Note that this change WILL survive a reboot. + +#### EXAMPLE 2: Choosing a DocumentRoot outside /var/www/html for a virtual host + +If you need to [set up a Apache virtual host][2] using a directory other than /var/www/html as DocumentRoot (say, for example, `/websrv/sites/gabriel/public_html`): + +``` +DocumentRoot “/websrv/sites/gabriel/public_html” +``` + +Apache will refuse to serve the content because the index.html has been labeled with the default_t SELinux type, which Apache can’t access: + +``` +# wget http://localhost/index.html +# ls -lZ /websrv/sites/gabriel/public_html/index.html +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Labeled-default_t-SELinux-Type.png) +>Labeled as default_t SELinux Type + +As with the previous example, you can use the following command to verify that this is indeed a SELinux-related issue: + +``` +# cat /var/log/audit/audit.log | grep AVC | tail -1 +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Check-Logs-for-SELinux-Issues.png) +>Check Logs for SELinux Issues + +To change the label of /websrv/sites/gabriel/public_html recursively to httpd_sys_content_t, do: + +``` +# semanage fcontext -a -t httpd_sys_content_t "/websrv/sites/gabriel/public_html(/.*)?" +``` + +The above command will grant Apache read-only access to that directory and its contents. + +Finally, to apply the policy (and make the label change effective immediately), do: + +``` +# restorecon -R -v /websrv/sites/gabriel/public_html +``` + +Now you should be able to access the directory: + +``` +# wget http://localhost/index.html +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Access-Apache-Directory.png) +>Access Apache Directory + +For more information on SELinux, refer to the Fedora 22 [SELinux and Administrator guide][3]. + + +### Introduction to AppArmor and How to Use it on OpenSUSE and Ubuntu + +The operation of AppArmor is based on profiles defined in plain text files where the allowed permissions and access control rules are set. Profiles are then used to place limits on how applications interact with processes and files in the system. + +A set of profiles is provided out-of-the-box with the operating system, whereas others can be put in place either automatically by applications when they are installed or manually by the system administrator. + +Like SELinux, AppArmor runs profiles in two modes. In enforce mode, applications are given the minimum permissions that are necessary for them to run, whereas in complain mode AppArmor allows an application to take restricted actions and saves the “complaints” resulting from that operation to a log (/var/log/kern.log, /var/log/audit/audit.log, and other logs inside /var/log/apparmor). + +These logs will show through lines with the word audit in them errors that would occur should the profile be run in enforce mode. Thus, you can try out an application in complain mode and adjust its behavior before running it under AppArmor in enforce mode. + +The current status of AppArmor can be shown using: + +``` +$ sudo apparmor_status +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Check-AppArmor-Status.png) +>Check AppArmor Status + +The image above indicates that the profiles /sbin/dhclient, /usr/sbin/, and /usr/sbin/tcpdump are in enforce mode (that is true by default in Ubuntu). + +Since not all applications include the associated AppArmor profiles, the apparmor-profiles package, which provides other profiles that have not been shipped by the packages they provide confinement for. By default, they are configured to run in complain mode so that system administrators can test them and choose which ones are desired. + +We will make use of apparmor-profiles since writing our own profiles is out of the scope of the LFCS [certification][4]. However, since profiles are plain text files, you can view them and study them in preparation to create your own profiles in the future. + +AppArmor profiles are stored inside /etc/apparmor.d. Let’s take a look at the contents of that directory before and after installing apparmor-profiles: + +``` +$ ls /etc/apparmor.d +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/06/View-AppArmor-Directory-Content.png) +>View AppArmor Directory Content + +If you execute sudo apparmor_status again, you will see a longer list of profiles in complain mode. You can now perform the following operations: + +To switch a profile currently in enforce mode to complain mode: + +``` +$ sudo aa-complain /path/to/file +``` + +and the other way around (complain –> enforce): + +``` +$ sudo aa-enforce /path/to/file +``` + +Wildcards are allowed in the above cases. For example, + +``` +$ sudo aa-complain /etc/apparmor.d/* +``` + +will place all profiles inside /etc/apparmor.d into complain mode, whereas + +``` +$ sudo aa-enforce /etc/apparmor.d/* +``` + +will switch all profiles to enforce mode. + +To entirely disable a profile, create a symbolic link in the /etc/apparmor.d/disabled directory: + +``` +$ sudo ln -s /etc/apparmor.d/profile.name /etc/apparmor.d/disable/ +``` + +For more information on AppArmor, please refer to the [official AppArmor wiki][5] and to the documentation [provided by Ubuntu][6]. + +### Summary + +In this article we have gone through the basics of SELinux and AppArmor, two well-known MACs. When to use one or the other? To avoid difficulties, you may want to consider sticking with the one that comes with your chosen distribution. In any event, they will help you place restrictions on processes and access to system resources to increase the security in your servers. + +Do you have any questions, comments, or suggestions about this article? Feel free to let us know using the form below. Don’t hesitate to let us know if you have any questions or comments. + + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/mandatory-access-control-with-selinux-or-apparmor-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/secure-files-using-acls-in-linux/ +[2]: http://www.tecmint.com/apache-virtual-hosting-in-centos/ +[3]: https://docs.fedoraproject.org/en-US/Fedora/22/html/SELinux_Users_and_Administrators_Guide/index.html +[4]: http://www.tecmint.com/sed-command-to-create-edit-and-manipulate-files-in-linux/ +[5]: http://wiki.apparmor.net/index.php/Main_Page +[6]: https://help.ubuntu.com/community/AppArmor + + + From 10602768d47d0e1f865b8ca57dc445d40346c667 Mon Sep 17 00:00:00 2001 From: tresspassing2 Date: Fri, 17 Jun 2016 23:27:03 +0800 Subject: [PATCH 0925/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=20tresspassing2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译申请 tresspassing2 --- ...Explore Linux with Installed Help Documentations and Tools.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md b/sources/tech/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md index 45ccb57f95..60903d5cce 100644 --- a/sources/tech/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md +++ b/sources/tech/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md @@ -1,3 +1,4 @@ +翻译申请 tresspassing2 Part 12 - LFCS: How to Explore Linux with Installed Help Documentations and Tools ================================================================================== From e2c23a39ac822f8e2b9d2770ff44240601a8cbb3 Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 17 Jun 2016 23:33:05 +0800 Subject: [PATCH 0926/1469] =?UTF-8?q?20160617-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...User Virtual Console or Terminal in Linux.md | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 sources/tech/20160611 vlock – A Smart Way to Lock User Virtual Console or Terminal in Linux.md diff --git a/sources/tech/20160611 vlock – A Smart Way to Lock User Virtual Console or Terminal in Linux.md b/sources/tech/20160611 vlock – A Smart Way to Lock User Virtual Console or Terminal in Linux.md new file mode 100644 index 0000000000..36703d74dc --- /dev/null +++ b/sources/tech/20160611 vlock – A Smart Way to Lock User Virtual Console or Terminal in Linux.md @@ -0,0 +1,98 @@ +vlock – A Smart Way to Lock User Virtual Console or Terminal in Linux +======================================================================= + +Virtual consoles are very important features of Linux, and they provide a system user a shell prompt to use the system in a non-graphical setup which you can only use on the physical machine but not remotely. + +A user can use several virtual console sessions at the same time just by switching form one virtual console to another. + +![](http://www.tecmint.com/wp-content/uploads/2016/05/vlock-Lock-User-Terminal-in-Linux.png) +>vlock Lock User Console or Terminal in Linux + +In this how to guide, we shall look at how to lock user virtual console or terminal console in Linux systems using vlock program. + +### What is vlock? + +vlock is a utility used to lock one or several user virtual console sessions. vlock is important on a multi user system, it allows users to lock their own sessions while other users can still use the same system via other virtual consoles. Where necessary, the entire console can be locked down and also switching virtual console disabled. + +vlock primarily works for console sessions and also has support for locking non-console sessions but this has not been tested fully. + +### Installing vlock in Linux + +To install vlock program on your respective Linux systems, use: + +``` +# yum install vlock [On RHEL / CentOS / Fedora] +$ sudo apt-get install vlock [On Ubuntu / Debian / Mint] +``` + +### How to use vlock in Linux + +There are few options that you can use with vlock and the general syntax is: + +``` +# vlock option +# vlock option plugin +# vlock option -t plugin +``` + +#### vlock common options and usage: + +1. To lock current virtual console or terminal session of user, run the following command: + + ``` + # vlock --current + ``` + + ![](http://www.tecmint.com/wp-content/uploads/2016/05/Lock-User-Terminal-Session-in-Linux.png) + >Lock User Terminal Session in Linux + + The options -c or --current, means lock the current session and it is the default behavior when you run vlock. + +2. To lock all your virtual console sessions and also disable virtual console switching, run the command below: + + ``` + # vlock --all + ``` + + ![](http://www.tecmint.com/wp-content/uploads/2016/05/Lock-All-Linux-Terminal-Sessions.png) + >Lock All Linux Terminal Sessions + + The options -a or --all, when used, it locks all user’s console sessions and also disables virtual console switching. + + These other options can only work when vlock was compiled with plugin support and they include: + +3. The options -n or --new, when invoked, it means switch to a new virtual console before user’s console sessions are locked. + ``` + # vlock --new + ``` + +4. The options -s or --disable-sysrq, it disables the SysRq mechanism while virtual consoles are locked by a user and works only when -a or --all is invoked. + + ``` + # vlock -sa + ``` + +5. The options -t or --timeout , invoked to set a timeout for screensaver plugin. + + ``` + # vlock --timeout 5 + ``` + +You can use `-h` or `--help` and `-v` or `--version` to view help messages and version respectively. + +We shall leave it at that and also know that you can include a `~/.vlockrc` file which is read by vlock program during system startup and [add the environmental variables][1] that you can check in the manaul entry page, especially users of Debian based distros. + +To find out more or add any information which may not be included here, simply drop a message below in the comment section. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/vlock-lock-user-virtual-console-terminal-linux/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tecmint+%28Tecmint%3A+Linux+Howto%27s+Guide%29 + +作者:[Aaron Kili][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/aaronkili/ +[1]: http://www.tecmint.com/set-path-variable-linux-permanently/ From 6726e52f891b1681a5d71e5bd6b5f0b6c827b48d Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 18 Jun 2016 22:39:09 +0800 Subject: [PATCH 0927/1469] =?UTF-8?q?20160618-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...n Per-Process and Per-User Basis in Linux.md | 440 ++++++++++++++++++ 1 file changed, 440 insertions(+) create mode 100644 sources/tech/20160604 Smem – Reports Memory Consumption Per-Process and Per-User Basis in Linux.md diff --git a/sources/tech/20160604 Smem – Reports Memory Consumption Per-Process and Per-User Basis in Linux.md b/sources/tech/20160604 Smem – Reports Memory Consumption Per-Process and Per-User Basis in Linux.md new file mode 100644 index 0000000000..b0aa8e68ff --- /dev/null +++ b/sources/tech/20160604 Smem – Reports Memory Consumption Per-Process and Per-User Basis in Linux.md @@ -0,0 +1,440 @@ +Smem – Reports Memory Consumption Per-Process and Per-User Basis in Linux +=========================================================================== + + +Memory management in terms of monitoring memory usage is one important thing to do on your Linux system, there are many tools available for monitoring your memory usage that you can find on different Linux distributions. But they work in different ways, in this how to guide, we shall take a look at how to install and use one such tool called smem. + +Smem is a command-line memory reporting tool thats gives a user diverse reports on memory usage on a Linux system. There is one unique thing about smem, unlike other traditional memory reporting tools, it reports PSS (Proportional Set Size), a more meaningful representation of memory usage by applications and libraries in a virtual memory setup. + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Smem-Linux-Memory-Reporting-Tool.png) +>Smem – Linux Memory Reporting Tool + +Existing traditional tools focus mainly on reading RSS (Resident Set Size) which is a standard measure to monitor memory usage in a physical memory scheme, but tends to overestimate memory usage by applications. + +PSS on the other hand, gives a reasonable measure by determining the “fair-share” of memory used by applications and libraries in a virtual memory scheme. + +You can read this [guide (about memory RSS and PSS)][1] to understand memory consumption in a Linux system, but let us proceed to looking at some of the features of smem. + +### Features of Smem Tool + +- System overview listing +- Listings and also filtering by process, mappings or user +- Using data from /proc filesystem +- Configurable listing columns from several data sources +- Configurable output units and percentages +- Easy to configure headers and totals in listings +- Using data snapshots from directory mirrors or compressed tar files +- Built-in chart generation mechanism +- Lightweight capture tool used in embedded systems + +### How to Install Smem – Memory Reporting Tool in Linux + +Before you proceed with installation of smem, your system must meet the following requirements: + +- modern kernel (> 2.6.27 or so) +- a recent version of Python (2.4 or so) +- optional [matplotlib][2] library for generation of charts + +Most of the today’s Linux distributions comes with latest Kernel version with Python 2 or 3 support, so the only requirement is to install matplotlib library which is used to generate nice charts. + +#### On RHEL, CentOS and Fedora + +First enable [EPEL (Extra Packages for Enterprise Linux)][3] repository and then install as follows: + +``` +# yum install smem python-matplotlib python-tk +``` + +#### On Debian and Ubuntu + +``` +$ sudo apt-get install smem +``` + +#### On Linux Mint + +``` +$ sudo apt-get install smem python-matplotlib python-tk +``` + +#### on Arch Linux + +Use this [AUR repository][4]. + +### How to Use Smem – Memory Reporting Tool in Linux + +To view a report of memory usage across the whole system, by all system users, run the following command: + +``` +$ sudo smem +``` + +Monitor Memory Usage of Linux System + +``` + PID User Command Swap USS PSS RSS + 6367 tecmint cat 0 100 145 1784 + 6368 tecmint cat 0 100 147 1676 + 2864 tecmint /usr/bin/ck-launch-session 0 144 165 1780 + 7656 tecmint gnome-pty-helper 0 156 178 1832 + 5758 tecmint gnome-pty-helper 0 156 179 1916 + 1441 root /sbin/getty -8 38400 tty2 0 152 184 2052 + 1434 root /sbin/getty -8 38400 tty5 0 156 187 2060 + 1444 root /sbin/getty -8 38400 tty3 0 156 187 2060 + 1432 root /sbin/getty -8 38400 tty4 0 156 188 2124 + 1452 root /sbin/getty -8 38400 tty6 0 164 196 2064 + 2619 root /sbin/getty -8 38400 tty1 0 164 196 2136 + 3544 tecmint sh -c /usr/lib/linuxmint/mi 0 212 224 1540 + 1504 root acpid -c /etc/acpi/events - 0 220 236 1604 + 3311 tecmint syndaemon -i 0.5 -K -R 0 252 292 2556 + 3143 rtkit /usr/lib/rtkit/rtkit-daemon 0 300 326 2548 + 1588 root cron 0 292 333 2344 + 1589 avahi avahi-daemon: chroot helpe 0 124 334 1632 + 1523 root /usr/sbin/irqbalance 0 316 343 2096 + 585 root upstart-socket-bridge --dae 0 328 351 1820 + 3033 tecmint /usr/bin/dbus-launch --exit 0 328 360 2160 + 1346 root upstart-file-bridge --daemo 0 348 371 1776 + 2607 root /usr/bin/xdm 0 188 378 2368 + 1635 kernoops /usr/sbin/kerneloops 0 352 386 2684 + 344 root upstart-udev-bridge --daemo 0 400 427 2132 + 2960 tecmint /usr/bin/ssh-agent /usr/bin 0 480 485 992 + 3468 tecmint /bin/dbus-daemon --config-f 0 344 515 3284 + 1559 avahi avahi-daemon: running [tecm 0 284 517 3108 + 7289 postfix pickup -l -t unix -u -c 0 288 534 2808 + 2135 root /usr/lib/postfix/master 0 352 576 2872 + 2436 postfix qmgr -l -t unix -u 0 360 606 2884 + 1521 root /lib/systemd/systemd-logind 0 600 650 3276 + 2222 nobody /usr/sbin/dnsmasq --no-reso 0 604 669 3288 +.... +``` + +When a normal user runs smem, it displays memory usage by process that the user has started, the processes are arranged in order of increasing PSS. + +Take a look at the output below on my system for memory usage by processes started by user aaronkilik: + +``` +$ smem +``` + +Monitor User Memory Usage in Linux + +``` + PID User Command Swap USS PSS RSS + 6367 tecmint cat 0 100 145 1784 + 6368 tecmint cat 0 100 147 1676 + 2864 tecmint /usr/bin/ck-launch-session 0 144 166 1780 + 3544 tecmint sh -c /usr/lib/linuxmint/mi 0 212 224 1540 + 3311 tecmint syndaemon -i 0.5 -K -R 0 252 292 2556 + 3033 tecmint /usr/bin/dbus-launch --exit 0 328 360 2160 + 3468 tecmint /bin/dbus-daemon --config-f 0 344 515 3284 + 3122 tecmint /usr/lib/gvfs/gvfsd 0 656 801 5552 + 3471 tecmint /usr/lib/at-spi2-core/at-sp 0 708 864 5992 + 3396 tecmint /usr/lib/gvfs/gvfs-mtp-volu 0 804 914 6204 + 3208 tecmint /usr/lib/x86_64-linux-gnu/i 0 892 1012 6188 + 3380 tecmint /usr/lib/gvfs/gvfs-afc-volu 0 820 1024 6396 + 3034 tecmint //bin/dbus-daemon --fork -- 0 920 1081 3040 + 3365 tecmint /usr/lib/gvfs/gvfs-gphoto2- 0 972 1099 6052 + 3228 tecmint /usr/lib/gvfs/gvfsd-trash - 0 980 1153 6648 + 3107 tecmint /usr/lib/dconf/dconf-servic 0 1212 1283 5376 + 6399 tecmint /opt/google/chrome/chrome - 0 144 1409 10732 + 3478 tecmint /usr/lib/x86_64-linux-gnu/g 0 1724 1820 6320 + 7365 tecmint /usr/lib/gvfs/gvfsd-http -- 0 1352 1884 8704 + 6937 tecmint /opt/libreoffice5.0/program 0 1140 2328 5040 + 3194 tecmint /usr/lib/x86_64-linux-gnu/p 0 1956 2405 14228 + 6373 tecmint /opt/google/chrome/nacl_hel 0 2324 2541 8908 + 3313 tecmint /usr/lib/gvfs/gvfs-udisks2- 0 2460 2754 8736 + 3464 tecmint /usr/lib/at-spi2-core/at-sp 0 2684 2823 7920 + 5771 tecmint ssh -p 4521 tecmnt765@212.7 0 2544 2864 6540 + 5759 tecmint /bin/bash 0 2416 2923 5640 + 3541 tecmint /usr/bin/python /usr/bin/mi 0 2584 3008 7248 + 7657 tecmint bash 0 2516 3055 6028 + 3127 tecmint /usr/lib/gvfs/gvfsd-fuse /r 0 3024 3126 8032 + 3205 tecmint mate-screensaver 0 2520 3331 18072 + 3171 tecmint /usr/lib/mate-panel/notific 0 2860 3495 17140 + 3030 tecmint x-session-manager 0 4400 4879 17500 + 3197 tecmint mate-volume-control-applet 0 3860 5226 23736 +... +``` + +There are many options to invoke while using smem, for example, to view system wide memory consumption, run the following command: + +``` +$ sudo smem -w +``` + +Monitor System Wide Memory User Consumption + +``` +Area Used Cache Noncache +firmware/hardware 0 0 0 +kernel image 0 0 0 +kernel dynamic memory 1425320 1291412 133908 +userspace memory 2215368 451608 1763760 +free memory 4424936 4424936 0 +``` + +To view memory usage on a per-user basis, run the command below: + +``` +$ sudo smem -u +``` + +Monitor Memory Consumption Per-User Basis in Linux + +``` +User Count Swap USS PSS RSS +rtkit 1 0 300 326 2548 +kernoops 1 0 352 385 2684 +avahi 2 0 408 851 4740 +postfix 2 0 648 1140 5692 +messagebus 1 0 1012 1173 3320 +syslog 1 0 1396 1419 3232 +www-data 2 0 5100 6572 13580 +mpd 1 0 7416 8302 12896 +nobody 2 0 4024 11305 24728 +root 39 0 323876 353418 496520 +tecmint 64 0 1652888 1815699 2763112 +``` + +You can also report memory usage by mappings as follows: + +``` +$ sudo smem -m +``` + +Monitor Memory Usage by Mappings in Linux + +``` +Map PIDs AVGPSS PSS +/dev/fb0 1 0 0 +/home/tecmint/.cache/fontconfig/7ef2298f 18 0 0 +/home/tecmint/.cache/fontconfig/c57959a1 18 0 0 +/home/tecmint/.local/share/mime/mime.cac 15 0 0 +/opt/google/chrome/chrome_material_100_p 9 0 0 +/opt/google/chrome/chrome_material_200_p 9 0 0 +/usr/lib/x86_64-linux-gnu/gconv/gconv-mo 41 0 0 +/usr/share/icons/Mint-X-Teal/icon-theme. 15 0 0 +/var/cache/fontconfig/0c9eb80ebd1c36541e 20 0 0 +/var/cache/fontconfig/0d8c3b2ac0904cb8a5 20 0 0 +/var/cache/fontconfig/1ac9eb803944fde146 20 0 0 +/var/cache/fontconfig/3830d5c3ddfd5cd38a 20 0 0 +/var/cache/fontconfig/385c0604a188198f04 20 0 0 +/var/cache/fontconfig/4794a0821666d79190 20 0 0 +/var/cache/fontconfig/56cf4f4769d0f4abc8 20 0 0 +/var/cache/fontconfig/767a8244fc0220cfb5 20 0 0 +/var/cache/fontconfig/8801497958630a81b7 20 0 0 +/var/cache/fontconfig/99e8ed0e538f840c56 20 0 0 +/var/cache/fontconfig/b9d506c9ac06c20b43 20 0 0 +/var/cache/fontconfig/c05880de57d1f5e948 20 0 0 +/var/cache/fontconfig/dc05db6664285cc2f1 20 0 0 +/var/cache/fontconfig/e13b20fdb08344e0e6 20 0 0 +/var/cache/fontconfig/e7071f4a29fa870f43 20 0 0 +.... +``` + +There are also options for filtering smem output and we shall look at two examples here. + +To filter output by username, invoke the -u or --userfilter="regex" option as below: + +``` +$ sudo smem -u +``` + +Report Memory Usage by User + +``` +User Count Swap USS PSS RSS +rtkit 1 0 300 326 2548 +kernoops 1 0 352 385 2684 +avahi 2 0 408 851 4740 +postfix 2 0 648 1140 5692 +messagebus 1 0 1012 1173 3320 +syslog 1 0 1400 1423 3236 +www-data 2 0 5100 6572 13580 +mpd 1 0 7416 8302 12896 +nobody 2 0 4024 11305 24728 +root 39 0 323804 353374 496552 +tecmint 64 0 1708900 1871766 2819212 +``` + +To filter output by process name, invoke the -P or --processfilter="regex" option as follows: + +``` +$ sudo smem --processfilter="firefox" +``` + +Report Memory Usage by Process Name + +``` +PID User Command Swap USS PSS RSS + 9212 root sudo smem --processfilter=f 0 1172 1434 4856 + 9213 root /usr/bin/python /usr/bin/sm 0 7368 7793 11984 + 4424 tecmint /usr/lib/firefox/firefox 0 931732 937590 961504 +``` + +Output formatting can be very important, and there are options to help you format memory reports and we shall take a look at few examples below. + +To show desired columns in the report, use -c or --columns option as follows: + +``` +$ sudo smem -c "name user pss rss" +``` + +Report Memory Usage by Columns + +``` +Name User PSS RSS +cat tecmint 145 1784 +cat tecmint 147 1676 +ck-launch-sessi tecmint 165 1780 +gnome-pty-helpe tecmint 178 1832 +gnome-pty-helpe tecmint 179 1916 +getty root 184 2052 +getty root 187 2060 +getty root 187 2060 +getty root 188 2124 +getty root 196 2064 +getty root 196 2136 +sh tecmint 224 1540 +acpid root 236 1604 +syndaemon tecmint 296 2560 +rtkit-daemon rtkit 326 2548 +cron root 333 2344 +avahi-daemon avahi 334 1632 +irqbalance root 343 2096 +upstart-socket- root 351 1820 +dbus-launch tecmint 360 2160 +upstart-file-br root 371 1776 +xdm root 378 2368 +kerneloops kernoops 386 2684 +upstart-udev-br root 427 2132 +ssh-agent tecmint 485 992 +... +``` + +You can invoke the -p option to report memory usage in percentages, as in the command below: + +``` +$ sudo smem -p +``` + +Report Memory Usage by Percentages + +``` + PID User Command Swap USS PSS RSS + 6367 tecmint cat 0.00% 0.00% 0.00% 0.02% + 6368 tecmint cat 0.00% 0.00% 0.00% 0.02% + 9307 tecmint sh -c { sudo /usr/lib/linux 0.00% 0.00% 0.00% 0.02% + 2864 tecmint /usr/bin/ck-launch-session 0.00% 0.00% 0.00% 0.02% + 3544 tecmint sh -c /usr/lib/linuxmint/mi 0.00% 0.00% 0.00% 0.02% + 5758 tecmint gnome-pty-helper 0.00% 0.00% 0.00% 0.02% + 7656 tecmint gnome-pty-helper 0.00% 0.00% 0.00% 0.02% + 1441 root /sbin/getty -8 38400 tty2 0.00% 0.00% 0.00% 0.03% + 1434 root /sbin/getty -8 38400 tty5 0.00% 0.00% 0.00% 0.03% + 1444 root /sbin/getty -8 38400 tty3 0.00% 0.00% 0.00% 0.03% + 1432 root /sbin/getty -8 38400 tty4 0.00% 0.00% 0.00% 0.03% + 1452 root /sbin/getty -8 38400 tty6 0.00% 0.00% 0.00% 0.03% + 2619 root /sbin/getty -8 38400 tty1 0.00% 0.00% 0.00% 0.03% + 1504 root acpid -c /etc/acpi/events - 0.00% 0.00% 0.00% 0.02% + 3311 tecmint syndaemon -i 0.5 -K -R 0.00% 0.00% 0.00% 0.03% + 3143 rtkit /usr/lib/rtkit/rtkit-daemon 0.00% 0.00% 0.00% 0.03% + 1588 root cron 0.00% 0.00% 0.00% 0.03% + 1589 avahi avahi-daemon: chroot helpe 0.00% 0.00% 0.00% 0.02% + 1523 root /usr/sbin/irqbalance 0.00% 0.00% 0.00% 0.03% + 585 root upstart-socket-bridge --dae 0.00% 0.00% 0.00% 0.02% + 3033 tecmint /usr/bin/dbus-launch --exit 0.00% 0.00% 0.00% 0.03% +.... +``` + +The command below will show totals at the end of each column of the output: + +``` +$ sudo smem -t +``` + +Report Total Memory Usage Count + +``` +PID User Command Swap USS PSS RSS + 6367 tecmint cat 0 100 139 1784 + 6368 tecmint cat 0 100 141 1676 + 9307 tecmint sh -c { sudo /usr/lib/linux 0 96 158 1508 + 2864 tecmint /usr/bin/ck-launch-session 0 144 163 1780 + 3544 tecmint sh -c /usr/lib/linuxmint/mi 0 108 170 1540 + 5758 tecmint gnome-pty-helper 0 156 176 1916 + 7656 tecmint gnome-pty-helper 0 156 176 1832 + 1441 root /sbin/getty -8 38400 tty2 0 152 181 2052 + 1434 root /sbin/getty -8 38400 tty5 0 156 184 2060 + 1444 root /sbin/getty -8 38400 tty3 0 156 184 2060 + 1432 root /sbin/getty -8 38400 tty4 0 156 185 2124 + 1452 root /sbin/getty -8 38400 tty6 0 164 193 2064 + 2619 root /sbin/getty -8 38400 tty1 0 164 193 2136 + 1504 root acpid -c /etc/acpi/events - 0 220 232 1604 + 3311 tecmint syndaemon -i 0.5 -K -R 0 260 298 2564 + 3143 rtkit /usr/lib/rtkit/rtkit-daemon 0 300 324 2548 + 1588 root cron 0 292 326 2344 + 1589 avahi avahi-daemon: chroot helpe 0 124 332 1632 + 1523 root /usr/sbin/irqbalance 0 316 340 2096 + 585 root upstart-socket-bridge --dae 0 328 349 1820 + 3033 tecmint /usr/bin/dbus-launch --exit 0 328 359 2160 + 1346 root upstart-file-bridge --daemo 0 348 370 1776 + 2607 root /usr/bin/xdm 0 188 375 2368 + 1635 kernoops /usr/sbin/kerneloops 0 352 384 2684 + 344 root upstart-udev-bridge --daemo 0 400 426 2132 +..... +------------------------------------------------------------------------------- + 134 11 0 2171428 2376266 3587972 +``` + +Further more, there are options for graphical reports that you can also use and we shall dive into them in this sub section. + +You can produce a bar graph of processes and their PSS and RSS values, in the example below, we produce a bar graph of processes owned by the root user. + +The vertical plane shows the PSS and RSS measure of processes and the horizontal plane represents each root user process: + +``` +$ sudo smem --userfilter="root" --bar pid -c"pss rss" +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Linux-Memory-Usage-in-PSS-and-RSS-Values.png) +>Linux Memory Usage in PSS and RSS Values + +You can also produce a pie chart showing processes and their memory consumption based on PSS or RSS values. The command below outputs a pie chart for processes owned by root user measuring values. + +The `--pie` name means label by name and `-s` option helps to sort by PSS value. + +``` +$ sudo smem --userfilter="root" --pie name -s pss +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Linux-Memory-Consumption-by-Processes.png) +>Linux Memory Consumption by Processes + +There are many other known fields apart from PSS and RSS used for labeling charts: + +To get help, simply type, `smem -h` or visit the manual entry page. + +We shall stop here with smem, but to understand it better, use it with many other options that you can find in the man page. As usual you can use the comment section below to express any thoughts or concerns. + +Reference Links: + + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/smem-linux-memory-usage-per-process-per-user/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tecmint+%28Tecmint%3A+Linux+Howto%27s+Guide%29 + +作者:[Aaron Kili][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/aaronkili/ +[1]: https://emilics.com/notebook/enblog/p871.html +[2]: http://matplotlib.org/index.html +[3]: http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/ +[4]: https://www.archlinux.org/packages/community/i686/smem/ + + + + From ec3bef60300361f188524d64f8d8e071356255d4 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 18 Jun 2016 22:51:09 +0800 Subject: [PATCH 0928/1469] =?UTF-8?q?20160618-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Awk to Print Fields and Columns in File.md | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 sources/tech/20160425 How to Use Awk to Print Fields and Columns in File.md diff --git a/sources/tech/20160425 How to Use Awk to Print Fields and Columns in File.md b/sources/tech/20160425 How to Use Awk to Print Fields and Columns in File.md new file mode 100644 index 0000000000..0308690e67 --- /dev/null +++ b/sources/tech/20160425 How to Use Awk to Print Fields and Columns in File.md @@ -0,0 +1,108 @@ +How to Use Awk to Print Fields and Columns in File +=================================================== + +In this part of our [Linux Awk command series][1], we shall have a look at one of the most important features of Awk, which is field editing. + +It is good to know that Awk automatically divides input lines provided to it into fields, and a field can be defined as a set of characters that are separated from other fields by an internal field separator. + +![](http://www.tecmint.com/wp-content/uploads/2016/04/Awk-Print-Fields-and-Columns.png) +>Awk Print Fields and Columns + +If you are familiar with the Unix/Linux or do [bash shell programming][2], then you should know what internal field separator (IFS) variable is. The default IFS in Awk are tab and space. + +This is how the idea of field separation works in Awk: when it encounters an input line, according to the IFS defined, the first set of characters is field one, which is accessed using $1, the second set of characters is field two, which is accessed using $2, the third set of characters is field three, which is accessed using $3 and so forth till the last set of character(s). + +To understand this Awk field editing better, let us take a look at the examples below: + +**Example 1**: I have created a text file called tecmintinfo.txt. + +``` +# vi tecmintinfo.txt +# cat tecmintinfo.txt +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/04/Create-File-in-Linux.png) +>Create File in Linux + +Then from the command line, I try to print the first, second and third fields from the file tecmintinfo.txt using the command below: + +``` +$ awk '//{print $1 $2 $3 }' tecmintinfo.txt +TecMint.comisthe +``` + +From the output above, you can see that the characters from the first three fields are printed based on the IFS defined which is space: + +- Field one which is “TecMint.com” is accessed using $1. +- Field two which is “is” is accessed using $2. +- Field three which is “the” is accessed using $3. + +If you have noticed in the printed output, the field values are not separated and this is how print behaves by default. + +To view the output clearly with space between the field values, you need to add (,) operator as follows: + +``` +$ awk '//{print $1, $2, $3; }' tecmintinfo.txt + +TecMint.com is the +``` + +One important thing to note and always remember is that the use of ($) in Awk is different from its use in shell scripting. + +Under shell scripting ($) is used to access the value of variables while in Awk ($) it is used only when accessing the contents of a field but not for accessing the value of variables. + +**Example 2**: Let us take a look at one other example using a file which contains multiple lines called my_shoping.list. + +``` +No Item_Name Unit_Price Quantity Price +1 Mouse #20,000 1 #20,000 +2 Monitor #500,000 1 #500,000 +3 RAM_Chips #150,000 2 #300,000 +4 Ethernet_Cables #30,000 4 #120,000 +``` + +Say you wanted to only print Unit_Price of each item on the shopping list, you will need to run the command below: + +``` +$ awk '//{print $2, $3 }' my_shopping.txt + +Item_Name Unit_Price +Mouse #20,000 +Monitor #500,000 +RAM_Chips #150,000 +Ethernet_Cables #30,000 +``` + +Awk also has a printf command that helps you to format your output is a nice way as you can see the above output is not clear enough. + +Using printf to format output of the Item_Name and Unit_Price: + +``` +$ awk '//{printf "%-10s %s\n",$2, $3 }' my_shopping.txt + +Item_Name Unit_Price +Mouse #20,000 +Monitor #500,000 +RAM_Chips #150,000 +Ethernet_Cables #30,000 +``` + +### Summary + +Field editing is very important when using Awk to filter text or strings, it helps you get particular data in columns in a list. And always remember that the use of ($) operator in Awk is different from that in shell scripting. + +I hope the article was helpful to you and for any additional information required or questions, you can post a comment in the comment section. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/awk-print-fields-columns-with-space-separator/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tecmint+%28Tecmint%3A+Linux+Howto%27s+Guide%29 + +作者:[Aaron Kili][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/aaronkili/ +[1]: http://www.tecmint.com/tag/awk-command/ +[2]: http://www.tecmint.com/category/bash-shell/ From 33fb0fb89e6ecd811ad86204a41a545debdc5d26 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 18 Jun 2016 23:15:48 +0800 Subject: [PATCH 0929/1469] =?UTF-8?q?20160618-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...inux desktop and IoT software distribution.md | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 sources/tech/20160614 ​Ubuntu Snap takes charge of Linux desktop and IoT software distribution.md diff --git a/sources/tech/20160614 ​Ubuntu Snap takes charge of Linux desktop and IoT software distribution.md b/sources/tech/20160614 ​Ubuntu Snap takes charge of Linux desktop and IoT software distribution.md new file mode 100644 index 0000000000..6992f76156 --- /dev/null +++ b/sources/tech/20160614 ​Ubuntu Snap takes charge of Linux desktop and IoT software distribution.md @@ -0,0 +1,110 @@ +Ubuntu Snap takes charge of Linux desktop and IoT software distribution +=========================================================================== + +[Canonical][28] and [Ubuntu][29] founder Mark Shuttleworth said in an interview that he hadn't planned on an announcement about Ubuntu's new [Snap app package format][30]. But then in a matter of a few months, developers from multiple Linux distributions and companies announced they would use Snap as a universal Linux package format. + +![](http://zdnet2.cbsistatic.com/hub/i/r/2016/06/14/a9b2a139-3cd4-41bf-8e10-180cb9450134/resize/770xauto/adc7d16a46167565399ecdb027dd1416/ubuntu-snap.jpg) +>Linux distributors, ISVs, and companies are all adopting Ubuntu Snap to distribute and update programs across all Linux varieties. + +Why? Because Snap enables a single binary package to work perfectly and securely on any Linux desktop, server, cloud or device. According to Olli Ries, head of Canonical's Ubuntu client platform products and releases: + +>The [security mechanisms in Snap packages][1] allow us to open up the platform for much faster iteration across all our flavors as Snap applications are isolated from the rest of the system. Users can install a Snap without having to worry whether it will have an impact on their other apps or their system. + +Of course, as Matthew Garrett, a former Linux kernel developer and CoreOS security developer, has pointed out: If you [use Snap with an insecure program, such as the X11][2] window system, you don't actually gain any security. + +Shuttleworth agrees with Garrett but points out that you can control how Snap applications interact with the rest of this system. So, for example, a web browser can be contained within a secure Snap, which uses the Ubuntu packaged [openssl][3] Transport Layer Security (TLS) and Secure Sockets Layer (SSL) library. In addition, even if something does break into the browser instance, it still can't get to the underlying operating system. + +Many companies agree. [Dell][4], [Samsung][5], [Mozilla][6], [Krita][7], [Mycroft][8], and [Horizon Computing][9] are adopting Snap. [Arch Linux][10], [Debian][11], [Gentoo][12], and [OpenWrt][13] developers have also embraced Snaps and are adding it to their Linux distributions + +Snap packages, aka "Snaps", now work natively on Arch, Debian, Fedora, Kubuntu, Lubuntu, Ubuntu GNOME, Ubuntu Kylin, Ubuntu MATE, Ubuntu Unity, and Xubuntu. Snap is being validated on CentOS, Elementary, Gentoo, Mint, OpenSUSE, and Red Hat Enterprise Linux (RHEL), and are easy to enable on other Linux distributions. + +These distributions are adopting Snaps, Shuttleworth explained, because "Snaps bring those apps to every Linux desktop, server, device or cloud machine, giving users freedom to choose any Linux distribution while retaining access to the best apps." + +Taken together these distributions represent the vast majority of common Linux desktop, server and cloud distributions. Why would they switch from their existing package management systems? "One nice feature of Snaps is support for edge and beta channels, which allow users to opt-in to the pre-release developer versions of software or stick with the latest stable versions." explained Tim Jester-Pfadt, an Arch Linux contributor. + +In addition to the Linux distributors, independent software vendors (ISVs) are embracing Snap since it greatly simplifies third-party Linux app distribution and security maintenance. For example, [The Document Foundation][14] will be making the popular open-source office suite [LibreOffice][15] available as a Snap. + +Thorsten Behrens, co-founder of The Document Foundation explained: + +>Our objective is to make LibreOffice easily available to as many users as possible. Snaps enable our users to get the freshest LibreOffice releases across different desktops and distributions quickly, easily and consistently. As a bonus, it should help our release engineers to eventually move away from bespoke, home-grown and ancient Linux build solutions, towards something that is collectively maintained. + +In a statement, Nick Nguyen, Mozilla's [Firefox][16] VP, added: + +>We strive to offer users a great experience and make Firefox available across many platforms, devices and operating systems. With the introduction of Snaps, continually optimizing Firefox will become possible, providing Linux users the most up-to-date features. + +Boudewijn Rempt, project lead at the [Krita Foundation][17], a KDE-based graphics program, said: + +>Maintaining DEB packages in a private repository was complex and time consuming, snaps are much easier to maintain, package and distribute. Putting the snap in the store was particularly simple, this is the most streamlined app store I have published software in. [Krita 3.0][18] has just been released as a snap which will be updated automatically as newer versions become available. + +It's not just Linux desktop programmers who are excited by Snap. Internet of Things (IoT) and embedded developers are also grabbing on to Snap with both hands. + +Because Snaps are isolated from one another to help with data security, and can be updated or rolled back automatically, they are ideal for devices. Multiple vendors have launched snappy IoT devices, enabling a new class of "smart edge" device with IoT app store. Snappy devices receive automatic updates for the base OS, together with updates to the apps installed on the device. + +Dell, which according to Shuttleworth was one of the first IoT vendors to see the power of Snap, will be using Snap in its devices. + +"We believe Snaps address the security risks and manageability challenges associated with deploying and running multiple third party applications on a single IoT Gateway," said Jason Shepherd, Dell's Director of IoT Strategy and Partnerships. "This trusted and universal app format is essential for Dell, our IoT Solutions Partners and commercial customers to build a scalable, IT-ready, and vibrant ecosystem of IoT applications." + +It's simple, explained OpenWrt developer Matteo Croce. "Snaps deliver new applications to OpenWrt while leaving the core OS unchanged.... Snaps are a faster way to deliver a wider range of software to supported OpenWrt access points and routers." + +Shuttleworth doesn't see Snaps replacing existing Linux package systems such as [RPM][19] and [DEB][20]. Instead he sees it as being complementary to them. Snaps will sit alongside the native package. Each distribution has its own mechanisms to provide and update the core operating system and its updates. What Snap brings to the table is universal apps that cannot interfere with the base operating system + +Each Snap is confined using a range of kernel isolation and security mechanisms, tailored to the Snap application's needs. A careful review process ensures that snaps only receive the permissions they require to operate. Users will not have to make complex security decisions when installing the snap. + +Since Snaps are essentially self-contained zip files that can be quickly executed in place, "Snaps are much easier to create than traditional Linux packages, and allow us to evolve dependencies independent of the base operating system, so we can easily provide the very best and latest Chinese Linux apps to users across all distributions," explained Jack Yu, leader of the popular [Chinese Ubuntu Kylin][21] team. + +The snap format, designed by Canonical, is handled by [snapd][22]. Its development work is done on [GitHub][23]. Porting snapd to a wide range of Linux distributions has proven straightforward, and the community has grown to include contributors from a wide range of Linux backgrounds. + +Snap packages are created with the snapcrafttool. The home of the project is [snapcraft.io][24], which includes a tour and step-by-step guides to Snap creation, along with documentation for users and contributors to the project. Snaps can be built from existing distribution packages, but are more commonly built from source for optimization and size efficiency. + +Unless you're an Ubuntu power-user or serious Linux developer you may not have heard of Snap. In the future, anyone who does work with Linux on any platform will know the program. It's well on its way to becoming a major -- perhaps the most important of all -- Linux application installation and upgrade mechanism. + +#### Related Stories: + +- [Linux expert Matthew Garrett: Ubuntu 16.04's new Snap format is a security risk][25] +- [Ubuntu Linux 16.04 is here][26] +- [Microsoft and Canonical partner to bring Ubuntu to Windows 10][27] + + +-------------------------------------------------------------------------------- + +via: http://www.zdnet.com/article/ubuntu-snap-takes-charge-of-linux-desktop-and-iot-software-distribution/ + +作者:[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/ +[28]: http://www.canonical.com/ +[29]: http://www.ubuntu.com/ +[30]: https://insights.ubuntu.com/2016/04/13/snaps-for-classic-ubuntu/ +[1]: https://insights.ubuntu.com/2016/04/13/snaps-for-classic-ubuntu/ +[2]: http://www.zdnet.com/article/linux-expert-matthew-garrett-ubuntu-16-04s-new-snap-format-is-a-security-risk/ +[3]: https://www.openssl.org/ +[4]: http://www.dell.com/en-us/ +[5]: http://www.samsung.com/us/ +[6]: http://www.mozilla.com/ +[7]: https://krita.org/en/ +[8]: https://mycroft.ai/ +[9]: http://www.horizon-computing.com/ +[10]: https://www.archlinux.org/ +[11]: https://www.debian.org/ +[12]: https://www.gentoo.org/ +[13]: https://openwrt.org/ +[14]: https://www.documentfoundation.org/ +[15]: https://www.libreoffice.org/download/libreoffice-fresh/ +[16]: https://www.mozilla.org/en-US/firefox/new/ +[17]: https://krita.org/en/about/krita-foundation/ +[18]: https://krita.org/en/item/krita-3-0-released/ +[19]: http://rpm5.org/ +[20]: https://www.debian.org/doc/manuals/debian-faq/ch-pkg_basics.en.html +[21]: http://www.ubuntu.com/desktop/ubuntu-kylin +[22]: https://launchpad.net/ubuntu/+source/snapd +[23]: https://github.com/snapcore/snapd +[24]: http://snapcraft.io/ +[25]: http://www.zdnet.com/article/linux-expert-matthew-garrett-ubuntu-16-04s-new-snap-format-is-a-security-risk/ +[26]: http://www.zdnet.com/article/ubuntu-linux-16-04-is-here/ +[27]: http://www.zdnet.com/article/microsoft-and-canonical-partner-to-bring-ubuntu-to-windows-10/ + + From 8712043d741a3a9bde7a99d8d994a848472e0590 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 18 Jun 2016 23:17:58 +0800 Subject: [PATCH 0930/1469] =?UTF-8?q?20160618-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit move to talk --- ...ap takes charge of Linux desktop and IoT software distribution.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20160614 ​Ubuntu Snap takes charge of Linux desktop and IoT software distribution.md (100%) diff --git a/sources/tech/20160614 ​Ubuntu Snap takes charge of Linux desktop and IoT software distribution.md b/sources/talk/20160614 ​Ubuntu Snap takes charge of Linux desktop and IoT software distribution.md similarity index 100% rename from sources/tech/20160614 ​Ubuntu Snap takes charge of Linux desktop and IoT software distribution.md rename to sources/talk/20160614 ​Ubuntu Snap takes charge of Linux desktop and IoT software distribution.md From ca610195212a92a03aa47e2476cb90f47f7f72b5 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 18 Jun 2016 23:27:50 +0800 Subject: [PATCH 0931/1469] =?UTF-8?q?20160618-4=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...hat Every Linux Newbies Should Remember.md | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 sources/tech/20160616 10 Basic Linux Commands That Every Linux Newbies Should Remember.md diff --git a/sources/tech/20160616 10 Basic Linux Commands That Every Linux Newbies Should Remember.md b/sources/tech/20160616 10 Basic Linux Commands That Every Linux Newbies Should Remember.md new file mode 100644 index 0000000000..14527107b6 --- /dev/null +++ b/sources/tech/20160616 10 Basic Linux Commands That Every Linux Newbies Should Remember.md @@ -0,0 +1,126 @@ +10 Basic Linux Commands That Every Linux Newbies Should Remember +===================================================================== + +![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/4225072_orig.png) + +[Linux][1] has a big impact on our Lives. At least, your android phone has Linux kernel on it. However, getting started with Linux just make you discomfort for the first time. Because on Linux, you usually should use terminal commands instead of just clicking the launcher icon (as you did on Windows). But don't worry, We will give you 10 basic Linux commands & important commands that will help you get started. + + +### 10 Basic Linux Commands That Help Newbies Get Started + +When We talk about Linux commands, what we are really talking about is the Linux system itself. These small number of 10 Basic Linux commands will not make you a genius or a Linux expert instead, it'll help you get started with Linux. It'll help Linux newbies to perform daily basic tasks in Linux using these Linux basic commands or I should say Linux top commands(because of their usage). + +So let's get started with the list of 10 Linux Basic commands - + +#### 1. sudo + +This SuperUserDo is the most important command Linux newbies will use. Every single command that needs root's permission, need this sudo command. You can use sudo before each command that requires root permissions - + +``` +$ sudo su +``` + +#### 2. ls (list) + +Just like the other, you often want to see anything in your directory. With list command, the terminal will show you all the files and folders of the directory that you're working in. Let's say I'm in the /home folder and I want to see the directories & files in /home. + +``` +/home$ ls +``` + +ls in /home returns the following - + +``` +imad lost+found +``` + +#### 3. cd + +​Changing directory (cd) is the main command that always be in use in terminal. It's one of the most Linux basic commands. Using this is easy. Just type the name of the folder you want to go in from your current directory. If you want to go up just do it by giving double dots (..) as the parameter. +​ +Let's say I'm in /home directory and I want to move in usr directory which is always in the /home. Here is how I can use cd commands - + +``` +/home $ cd usr + +/home/usr $ +``` + +#### 4. mkdir + +Just changing directory is still incomplete. Sometimes you want to create a new folder or subfolder. You can use mkdir command to do that. Just give your folder name after mkdir command in your terminal. + +``` +~$ mkdir folderName +``` + +#### 5. cp + +copy-and-paste is the important task we need to do to organize our files. Using cp will help you to copy-and-paste the file from terminal. First, you determine the file you want to copy and type the destination location to paste the file. + +``` +$ cp src des +``` + +Note: If you're copying files into the directory that requires root permission for any new file, then you'll need to use sudo command. + +#### 6. rm + +rm is a command to remove your file or even your directory. You can use -f if the file need root permission to be removed. And also you can use -r to do recursive removal to remove your folder. + +``` +$ rm myfile.txt +``` + +#### 7. apt-get + +This command differs distro-by-distro. In Debian based Linux distributions, to install, remove and upgrade any package we've Advanced Packaging Tool (APT) package manager. The apt-get command will help you installing the software you need to run in your Linux. It is a powerful command-line tool which can perform installation, upgrade, and even removing your software. + +​In other distributions, such as Fedora, Centos there are different package managers. Fedora used to have yum but now it has dnf. + +``` +$ sudo apt-get update + +$ sudo dnf update +``` + +#### 8. grep + +You need to find a file but you don't remember its exact location or the path. grep will help you to solve this problem. You can use the grep command to help finding the file based on given keywords. + +``` +$ grep user /etc/passwd +``` + +#### 9. cat + +As a user, you often need to view some of text or code from your script. Again, one of the Linux basic commands is cat command. It will show you the text inside your file. + +``` +$ cat CMakeLists.txt +``` + +#### 10. poweroff + +And the last one is poweroff. Sometimes you need to poweroff directly from your terminal. This command will do the task. Don't forget to add sudo at the beginning of the command since it needs root permission to execute poweroff. + +``` +$ sudo poweroff +``` + +### Conclusion + +As I mentioned when I started off the article that these 10 basic Linux commands will not make you a Linux geek immediately. It'll help you to start using Linux at this early stage. With these basic Linux commands, start using Linux and set your target to learn 1-3 commands daily. So it's all for this article. I hope it helped you. Share with us interesting and useful commands in the comment section below and don't forget to share this article with your friends. + +-------------------------------------------------------------------------------- + +via: http://www.linuxandubuntu.com/home/10-basic-linux-commands-that-every-linux-newbies-should-remember + +作者:[Commenti][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.linuxandubuntu.com/home/10-basic-linux-commands-that-every-linux-newbies-should-remember#comments +[1]: http://linuxandubuntu.com/home/category/linux From ac3a8abf8653bd643638e707c597cb0cfc47803e Mon Sep 17 00:00:00 2001 From: ictlyh Date: Sun, 19 Jun 2016 09:40:30 +0800 Subject: [PATCH 0932/1469] Translating sources/tech/20160425 How to Use Awk to Print Fields and Columns in File.md --- ...0160425 How to Use Awk to Print Fields and Columns in File.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160425 How to Use Awk to Print Fields and Columns in File.md b/sources/tech/20160425 How to Use Awk to Print Fields and Columns in File.md index 0308690e67..127cc061c1 100644 --- a/sources/tech/20160425 How to Use Awk to Print Fields and Columns in File.md +++ b/sources/tech/20160425 How to Use Awk to Print Fields and Columns in File.md @@ -1,3 +1,4 @@ +ictlyh Translating How to Use Awk to Print Fields and Columns in File =================================================== From e13676e5f87c6c0797cf10b8f2fc6d1db9f09e2d Mon Sep 17 00:00:00 2001 From: ictlyh Date: Sun, 19 Jun 2016 10:13:41 +0800 Subject: [PATCH 0933/1469] Translated sources/tech/20160425 How to Use Awk to Print Fields and Columns in File.md --- ...20160425 How to Use Awk to Print Fields and Columns in File.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20160425 How to Use Awk to Print Fields and Columns in File.md (100%) diff --git a/sources/tech/20160425 How to Use Awk to Print Fields and Columns in File.md b/translated/tech/20160425 How to Use Awk to Print Fields and Columns in File.md similarity index 100% rename from sources/tech/20160425 How to Use Awk to Print Fields and Columns in File.md rename to translated/tech/20160425 How to Use Awk to Print Fields and Columns in File.md From f929f4c796e444fca5e5db972693b6c332ae76a1 Mon Sep 17 00:00:00 2001 From: Ping Yang Date: Sun, 19 Jun 2016 20:22:32 +0800 Subject: [PATCH 0934/1469] [Translating] 10 Basic Linux Commands That Every Linux Newbies Should Remember.md --- ...c Linux Commands That Every Linux Newbies Should Remember.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160616 10 Basic Linux Commands That Every Linux Newbies Should Remember.md b/sources/tech/20160616 10 Basic Linux Commands That Every Linux Newbies Should Remember.md index 14527107b6..998e90d8b1 100644 --- a/sources/tech/20160616 10 Basic Linux Commands That Every Linux Newbies Should Remember.md +++ b/sources/tech/20160616 10 Basic Linux Commands That Every Linux Newbies Should Remember.md @@ -1,3 +1,5 @@ +Translating by Ping + 10 Basic Linux Commands That Every Linux Newbies Should Remember ===================================================================== From a82b3140c6b45bedf3e5d3cc7f440ed4f2d619ae Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 19 Jun 2016 21:54:29 +0800 Subject: [PATCH 0935/1469] =?UTF-8?q?20160619-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20160610 Getting started with ReactOS.md | 129 ++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 sources/tech/20160610 Getting started with ReactOS.md diff --git a/sources/tech/20160610 Getting started with ReactOS.md b/sources/tech/20160610 Getting started with ReactOS.md new file mode 100644 index 0000000000..d181e2dd5d --- /dev/null +++ b/sources/tech/20160610 Getting started with ReactOS.md @@ -0,0 +1,129 @@ +Getting started with ReactOS +============================== + + +ReactOS is a relatively new open source operating system that resembles the looks of Windows NT and aims to offer similar levels of functionality and application compatibility. Featuring a wine-based user mode, this system doesn't use any of the Unix architecture, but is a rewrite of the NT architecture from scratch, with its very own FAT32 implementation, and completely free of legal implications. That said, this is not yet another Linux distro, but a unique Windows-like system that is a part of the free software world. This quick guide aims at users who want an easy to use, open source replacement for their Windows system. + + +### System Installation + +Before getting started with the installation process, I should point out that the minimum requirements of ReactOS are 500 MB of free disk space and only 96 MB of RAM. I will demonstrate the installation process on a 32-bit virtual machine. + +Navigate with the arrow keys and select the desired language by pressing “Enter”. + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_1.png) + +Next, hit “Enter” again to continue with the installation, or “R” to repair an existing install. + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_2.png) + +On the third screen, you'll get a warning about the current limitation that applies to this early development version of the OS. Continue with “Enter” again and you'll get a summary of the settings before the final user approval. If all is good, hit “Enter” once again. + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_3.png) + +This will take you to the partitioning stage where you may delete the highlighted option by pressing “D”, and then add primary, extended, or logical partitions with “P”, “E”, and “L” respectively. If you choose to add a partition yourself, you will be given the option to set its size by entering a number of MBs and pressing “Enter” to confirm. + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_4.png) + +However, if you have already unused space available, hitting “Enter” once again during the partitioning stage will automatically install ReactOS in the selected partition. + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_5.png) + +The next step is the selection of the filesystem type which for now is limited to FAT32 only. + + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_6.png) + +Next is the directory selection. I will leave this at the default “/ReactOS” and it should be fine. + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_7.png) + +...and we're off + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_8.png) + +Finally, we're about the choose the location of the bootloader. The first option should be the safest if installing on a real disk. + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_9.png) + +In general, I could say that the installation of ReactOS is pretty straight forward. The interface may not look friendly or modern at all, but hitting “Enter” in every step will work just fine in most cases. That said, the development version of ReactOS it's fairly simple and easy to install. + +### Setting Up ReactOS + +Once we reboot and get into our new system, we're offered the help of the “Setup Wizard”. This wizard is basically allowing us to set up the language and keyboard layout settings. + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_10.png) + +I used this step to add a second keyboard layout. + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_11.png) + +I can even set a different key combination for changing the layout. + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_12.png) + +Then I add the username... + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_13.png) + +...and an admin pass... + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_14.png) + +After the time settings are also set, ReactOS finalizes its configuration. + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_15.png) + +### Inside ReactOS + +When we finally enter ReactOS for the first time, new hardware is detected and we're offered to install the available drivers automatically. + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_16.png) + +These are the three devices that were automatically detected by ReactOS in my case: + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_17.png) + +What you're looking at in the above screenshot is ReactOS's “applications manager” which is of course to the standards of Linux systems. You won't find anything Linux-related here, though. Only open source applications that are known to work well with the particular system are offered. That said, some categories are well populated, while others are completely empty. + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_18.png) + +I took the liberty to install Firefox through the software center, and Notepad++ by downloading the .exe file and installing it by simply double-clicking the executable. Both worked perfectly well, their desktop icons were created, menu entries added, and Notepad++ was added in the applications manager and in the right category as well. + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_19.png) + +I wouldn't try running any modern Windows games, but if you want to setup the Direct 3D settings you can go to “My Computer/Control Panel/WineD3D Options”. There you will find multiple options about the Direct3D which is presumably resembling dx version 8. + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_20.png) + +Another good thing with ReactOS is the fact that the Registry entries can be accessed and set as needed through “My Computer” again. + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_21.png) + +If you need something handier though, you may find a Registry Editor utility from the applications menu. + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_22.png) + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_23.png) + +Finally, if the looks of ReactOS look somewhat outdated to you, right click on the desktop and select “Properties”. Then choose the “Appearance” tab and set the theme and color that you prefer. + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_24.png) + +### Conclusion + +Honestly, I was impressed by the way ReactOS works. It's quite solid, coherent, speedy, and really user-friendly. Leaving aside the negatives that stem from the Windows design (deprecated applications menu, irrational directory structure), ReactOS is almost perfect on what it does. It may not be very rich in terms of application selection, and it may not be very powerful in terms of features yet, but I am sure it's going to flourish. The numbers show great popularity, and I'm sure the community that's going to build up around it will soon be large enough to lead the project to success. Right now, version 0.4.1 looks promising to say the least. If you care about running Windows applications and doing so in an open way, give it a try! + + +-------------------------------------------------------------------------------- + +via: https://www.howtoforge.com/tutorial/getting-started-with-reactos/ + +作者:[Bill Toulas][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.howtoforge.com/tutorial/getting-started-with-reactos/ + From cb75e5ec3a1c3f3275deeadffdb9dd16f8a1c285 Mon Sep 17 00:00:00 2001 From: Ping Yang Date: Sun, 19 Jun 2016 23:22:50 +0800 Subject: [PATCH 0936/1469] Temp backup to remote repo. --- ...hat Every Linux Newbies Should Remember.md | 34 ++++++++++++++++--- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/sources/tech/20160616 10 Basic Linux Commands That Every Linux Newbies Should Remember.md b/sources/tech/20160616 10 Basic Linux Commands That Every Linux Newbies Should Remember.md index 998e90d8b1..f7f7f724b9 100644 --- a/sources/tech/20160616 10 Basic Linux Commands That Every Linux Newbies Should Remember.md +++ b/sources/tech/20160616 10 Basic Linux Commands That Every Linux Newbies Should Remember.md @@ -1,23 +1,33 @@ -Translating by Ping - 10 Basic Linux Commands That Every Linux Newbies Should Remember + +Linux新手必知必会的10条Linux基本命令 ===================================================================== ![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/4225072_orig.png) -[Linux][1] has a big impact on our Lives. At least, your android phone has Linux kernel on it. However, getting started with Linux just make you discomfort for the first time. Because on Linux, you usually should use terminal commands instead of just clicking the launcher icon (as you did on Windows). But don't worry, We will give you 10 basic Linux commands & important commands that will help you get started. +[Linux][1] has a big impact on our Lives. At least, your android phone has Linux kernel on it. However, getting started with Linux just make you discomfort for the first time. + Because on Linux, you usually should use terminal commands instead of just clicking the launcher icon (as you did on Windows). But don't worry, We will give you 10 basic Linux commands & important commands that will help you get started. + +Linux对我们的生活产生了巨大的冲击。至少你的安卓手机使用的就是Linux核心。尽管如此,在第一次开始使用Linux时你还是会感到难以下手。因为在Linux中,通常需要使用终端命令来取代Windows系统中的启动图标点击。但是不必担心,这里我们会介绍10个Linux基本命令来帮助你开启这段神秘之旅。 ### 10 Basic Linux Commands That Help Newbies Get Started +### 帮助新手走出第一步的10个Linux基本命令 -When We talk about Linux commands, what we are really talking about is the Linux system itself. These small number of 10 Basic Linux commands will not make you a genius or a Linux expert instead, it'll help you get started with Linux. It'll help Linux newbies to perform daily basic tasks in Linux using these Linux basic commands or I should say Linux top commands(because of their usage). +When We talk about Linux commands, what we are really talking about is the Linux system itself. These small number of 10 Basic Linux commands will not make you a genius or a Linux expert instead, it'll help you get started with Linux. It'll help Linux newbies to perform daily basic tasks in Linux using these Linux basic commands or I should say Linux top commands(because of their usage)。 + +当我们谈论Linux命令时,实质上是在谈论Linux系统本身。这短短的10个Linux基本命令不会让你变成天才或者Linux专家,但是能帮助你轻松开始Linux之旅。使用这些基本命令会帮助新手们完成Linux日常任务,由于它们的使用频率如此至高,所以我更乐意称他们为Linux命令之王! So let's get started with the list of 10 Linux Basic commands - +让我们开始学习这10条Linux基本命令吧。 + #### 1. sudo This SuperUserDo is the most important command Linux newbies will use. Every single command that needs root's permission, need this sudo command. You can use sudo before each command that requires root permissions - +这条命令的意思是“以超级用户的身份执行”,是 SuperUserDo 的简写,它是新手将要用到的最重要的一条Linux命令。当一条单行命令需要root权限的时候,`sudo`命令就派上用场了。你可以在每一条需要root权限的命令前都加上`sudo`。 + ``` $ sudo su ``` @@ -26,12 +36,16 @@ $ sudo su Just like the other, you often want to see anything in your directory. With list command, the terminal will show you all the files and folders of the directory that you're working in. Let's say I'm in the /home folder and I want to see the directories & files in /home. +跟其他人一样,你肯定也经常想看看目录下都有些什么东西。使用列表命令,终端会把当前工作目录下所有的文件以及文件夹展示给你。比如说,我当前处在 /home 文件夹中,我想看看 /home文件夹中都有哪些文件和目录。 + ``` /home$ ls ``` ls in /home returns the following - +在/home中执行ls命令将会返回以下内容 + ``` imad lost+found ``` @@ -39,9 +53,13 @@ imad lost+found #### 3. cd ​Changing directory (cd) is the main command that always be in use in terminal. It's one of the most Linux basic commands. Using this is easy. Just type the name of the folder you want to go in from your current directory. If you want to go up just do it by giving double dots (..) as the parameter. + +变更目录(cd)是终端中总会被用到的主要命令。他是最常用到的Linux基本命令之一。此命令使用非常简单,你打算从当前目录跳转至哪个文件夹,只需要将此文件夹键入命令之后即可。如果你想跳转至上层目录,只需要在此命令之后键入两个点(..)就可以了。 ​ Let's say I'm in /home directory and I want to move in usr directory which is always in the /home. Here is how I can use cd commands - +举个例子,我现在处在/home目录中,我想移动到/home目录中的usr文件夹下,可以通过以下命令来完成操作。 + ``` /home $ cd usr @@ -52,6 +70,8 @@ Let's say I'm in /home directory and I want to move in usr directory which is al Just changing directory is still incomplete. Sometimes you want to create a new folder or subfolder. You can use mkdir command to do that. Just give your folder name after mkdir command in your terminal. +只是可以切换目录还是不够完美。有时候你会想要建一个文件夹或子文件夹。你可以使用mkdir命令来完成。使用方法很简单,只需要把新的文件夹名跟在mkdir命令之后就好了。 + ``` ~$ mkdir folderName ``` @@ -60,16 +80,22 @@ Just changing directory is still incomplete. Sometimes you want to create a new copy-and-paste is the important task we need to do to organize our files. Using cp will help you to copy-and-paste the file from terminal. First, you determine the file you want to copy and type the destination location to paste the file. +拷贝-粘贴(copy-and-paste)是我们组织文件需要用到的重要命令。使用 cp 命令可以帮助你在终端当中完成拷贝-粘贴操作。首先确定你想要拷贝的文件,然后键入打算粘贴次文件的目标位置。 + ``` $ cp src des ``` Note: If you're copying files into the directory that requires root permission for any new file, then you'll need to use sudo command. +注意:如果目标目录对新建文件需要root权限时,你可以使用sudo命令来完成你的文件拷贝操作。 + #### 6. rm rm is a command to remove your file or even your directory. You can use -f if the file need root permission to be removed. And also you can use -r to do recursive removal to remove your folder. +rm命令可以帮助你移除文件甚至目录。如果文件需要root权限才能移除,可以用-f参数来强制执行。也可以使用-r参数来递归的移除你的文件夹。 + ``` $ rm myfile.txt ``` From b2bd10c920c07e8c342a709b626ce45a7043f6c2 Mon Sep 17 00:00:00 2001 From: Ping Yang Date: Mon, 20 Jun 2016 00:23:25 +0800 Subject: [PATCH 0937/1469] Complete Translating. --- ...hat Every Linux Newbies Should Remember.md | 67 ++++++++----------- 1 file changed, 27 insertions(+), 40 deletions(-) diff --git a/sources/tech/20160616 10 Basic Linux Commands That Every Linux Newbies Should Remember.md b/sources/tech/20160616 10 Basic Linux Commands That Every Linux Newbies Should Remember.md index f7f7f724b9..c69b7a6e54 100644 --- a/sources/tech/20160616 10 Basic Linux Commands That Every Linux Newbies Should Remember.md +++ b/sources/tech/20160616 10 Basic Linux Commands That Every Linux Newbies Should Remember.md @@ -1,30 +1,20 @@ -10 Basic Linux Commands That Every Linux Newbies Should Remember - Linux新手必知必会的10条Linux基本命令 ===================================================================== ![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/4225072_orig.png) -[Linux][1] has a big impact on our Lives. At least, your android phone has Linux kernel on it. However, getting started with Linux just make you discomfort for the first time. - Because on Linux, you usually should use terminal commands instead of just clicking the launcher icon (as you did on Windows). But don't worry, We will give you 10 basic Linux commands & important commands that will help you get started. -Linux对我们的生活产生了巨大的冲击。至少你的安卓手机使用的就是Linux核心。尽管如此,在第一次开始使用Linux时你还是会感到难以下手。因为在Linux中,通常需要使用终端命令来取代Windows系统中的启动图标点击。但是不必担心,这里我们会介绍10个Linux基本命令来帮助你开启这段神秘之旅。 +[Linux][1]对我们的生活产生了巨大的冲击。至少你的安卓手机使用的就是Linux核心。尽管如此,在第一次开始使用Linux时你还是会感到难以下手。因为在Linux中,通常需要使用终端命令来取代Windows系统中的点击启动图标操作。但是不必担心,这里我们会介绍10个Linux基本命令来帮助你开启Linux神秘之旅。 -### 10 Basic Linux Commands That Help Newbies Get Started ### 帮助新手走出第一步的10个Linux基本命令 -When We talk about Linux commands, what we are really talking about is the Linux system itself. These small number of 10 Basic Linux commands will not make you a genius or a Linux expert instead, it'll help you get started with Linux. It'll help Linux newbies to perform daily basic tasks in Linux using these Linux basic commands or I should say Linux top commands(because of their usage)。 - -当我们谈论Linux命令时,实质上是在谈论Linux系统本身。这短短的10个Linux基本命令不会让你变成天才或者Linux专家,但是能帮助你轻松开始Linux之旅。使用这些基本命令会帮助新手们完成Linux日常任务,由于它们的使用频率如此至高,所以我更乐意称他们为Linux命令之王! - -So let's get started with the list of 10 Linux Basic commands - +当我们谈论Linux命令时,实质上是在谈论Linux系统本身。这短短的10个Linux基本命令不会让你变成天才或者Linux专家,但是能帮助你轻松开始Linux之旅。使用这些基本命令会帮助新手们完成Linux的日常任务,由于它们的使用频率如此至高,所以我更乐意称他们为Linux命令之王! 让我们开始学习这10条Linux基本命令吧。 -#### 1. sudo -This SuperUserDo is the most important command Linux newbies will use. Every single command that needs root's permission, need this sudo command. You can use sudo before each command that requires root permissions - +#### 1. sudo 这条命令的意思是“以超级用户的身份执行”,是 SuperUserDo 的简写,它是新手将要用到的最重要的一条Linux命令。当一条单行命令需要root权限的时候,`sudo`命令就派上用场了。你可以在每一条需要root权限的命令前都加上`sudo`。 @@ -32,9 +22,9 @@ This SuperUserDo is the most important command Linux newbies will use. Every sin $ sudo su ``` + #### 2. ls (list) -Just like the other, you often want to see anything in your directory. With list command, the terminal will show you all the files and folders of the directory that you're working in. Let's say I'm in the /home folder and I want to see the directories & files in /home. 跟其他人一样,你肯定也经常想看看目录下都有些什么东西。使用列表命令,终端会把当前工作目录下所有的文件以及文件夹展示给你。比如说,我当前处在 /home 文件夹中,我想看看 /home文件夹中都有哪些文件和目录。 @@ -42,22 +32,18 @@ Just like the other, you often want to see anything in your directory. With list /home$ ls ``` -ls in /home returns the following - -在/home中执行ls命令将会返回以下内容 +在/home中执行`ls`命令将会返回以下内容 ``` imad lost+found ``` + #### 3. cd -​Changing directory (cd) is the main command that always be in use in terminal. It's one of the most Linux basic commands. Using this is easy. Just type the name of the folder you want to go in from your current directory. If you want to go up just do it by giving double dots (..) as the parameter. - -变更目录(cd)是终端中总会被用到的主要命令。他是最常用到的Linux基本命令之一。此命令使用非常简单,你打算从当前目录跳转至哪个文件夹,只需要将此文件夹键入命令之后即可。如果你想跳转至上层目录,只需要在此命令之后键入两个点(..)就可以了。 +变更目录命令(cd)是终端中总会被用到的主要命令。他是最常用到的Linux基本命令之一。此命令使用非常简单,当你打算从当前目录跳转至某个文件夹时,只需要将文件夹键入此命令之后即可。如果你想跳转至上层目录,只需要在此命令之后键入两个点(..)就可以了。 ​ -Let's say I'm in /home directory and I want to move in usr directory which is always in the /home. Here is how I can use cd commands - - 举个例子,我现在处在/home目录中,我想移动到/home目录中的usr文件夹下,可以通过以下命令来完成操作。 ``` @@ -66,45 +52,41 @@ Let's say I'm in /home directory and I want to move in usr directory which is al /home/usr $ ``` + #### 4. mkdir -Just changing directory is still incomplete. Sometimes you want to create a new folder or subfolder. You can use mkdir command to do that. Just give your folder name after mkdir command in your terminal. - -只是可以切换目录还是不够完美。有时候你会想要建一个文件夹或子文件夹。你可以使用mkdir命令来完成。使用方法很简单,只需要把新的文件夹名跟在mkdir命令之后就好了。 +只是可以切换目录还是不够完美。有时候你会想要新建一个文件夹或子文件夹。此时可以使用mkdir命令来完成操作。使用方法很简单,只需要把新的文件夹名跟在mkdir命令之后就好了。 ``` ~$ mkdir folderName ``` + #### 5. cp -copy-and-paste is the important task we need to do to organize our files. Using cp will help you to copy-and-paste the file from terminal. First, you determine the file you want to copy and type the destination location to paste the file. - -拷贝-粘贴(copy-and-paste)是我们组织文件需要用到的重要命令。使用 cp 命令可以帮助你在终端当中完成拷贝-粘贴操作。首先确定你想要拷贝的文件,然后键入打算粘贴次文件的目标位置。 +拷贝-粘贴(copy-and-paste)是我们组织文件需要用到的重要命令。使用 `cp` 命令可以帮助你在终端当中完成拷贝-粘贴操作。首先确定你想要拷贝的文件,然后键入打算粘贴此文件的目标位置。 ``` $ cp src des ``` -Note: If you're copying files into the directory that requires root permission for any new file, then you'll need to use sudo command. +注意:如果目标目录对新建文件需要root权限时,你可以使用`sudo`命令来完成文件拷贝操作。 -注意:如果目标目录对新建文件需要root权限时,你可以使用sudo命令来完成你的文件拷贝操作。 #### 6. rm -rm is a command to remove your file or even your directory. You can use -f if the file need root permission to be removed. And also you can use -r to do recursive removal to remove your folder. - -rm命令可以帮助你移除文件甚至目录。如果文件需要root权限才能移除,可以用-f参数来强制执行。也可以使用-r参数来递归的移除你的文件夹。 +rm命令可以帮助你移除文件甚至目录。如果文件需要root权限才能移除,可以用`-f`参数来强制执行。也可以使用`-r`参数来递归的移除文件夹。 ``` $ rm myfile.txt ``` + #### 7. apt-get -This command differs distro-by-distro. In Debian based Linux distributions, to install, remove and upgrade any package we've Advanced Packaging Tool (APT) package manager. The apt-get command will help you installing the software you need to run in your Linux. It is a powerful command-line tool which can perform installation, upgrade, and even removing your software. +这个命令会依据发行版的不同而有所区别。在基于Debian的发行版中,我们拥有Advanced Packaging Tool(APT)包管理工具来安装、移除和升级包。apt-get命令会帮助你安装需要在Linux系统中运行的软件。它是一个功能强大的命令行,可以用来帮助你对软件执行安装、升级和移除操作。 -​In other distributions, such as Fedora, Centos there are different package managers. Fedora used to have yum but now it has dnf. +在其他发行版中,例如Fedora、Centos,都各自不同的包管理工具。Fedora之前使用的是yum,不过现在dnf成了它默认的包管理工具。 ``` $ sudo apt-get update @@ -112,40 +94,45 @@ $ sudo apt-get update $ sudo dnf update ``` + #### 8. grep -You need to find a file but you don't remember its exact location or the path. grep will help you to solve this problem. You can use the grep command to help finding the file based on given keywords. +当你需要查找一个文件,但是又忘记了它具体的位置和路径时,`grep`命令会帮助你解决这个难题。你可以提供文件的关键字,使用`grep`命令来查找到它。 ``` $ grep user /etc/passwd ``` + #### 9. cat -As a user, you often need to view some of text or code from your script. Again, one of the Linux basic commands is cat command. It will show you the text inside your file. +作为一个用户,你应该会经常需要浏览脚本内的文本或者代码。`cat`命令是Linux系统的基本命令之一,它的用途就是将文件的内容展示给你。 ``` $ cat CMakeLists.txt ``` + #### 10. poweroff -And the last one is poweroff. Sometimes you need to poweroff directly from your terminal. This command will do the task. Don't forget to add sudo at the beginning of the command since it needs root permission to execute poweroff. +最后一个命令是 `poweroff`。有时你需要直接在终端中执行关机操作。此命令可以完成这个任务。由于关机操作需要root权限,所以别忘了在此命令之前添加`sudo`。 ``` $ sudo poweroff ``` -### Conclusion -As I mentioned when I started off the article that these 10 basic Linux commands will not make you a Linux geek immediately. It'll help you to start using Linux at this early stage. With these basic Linux commands, start using Linux and set your target to learn 1-3 commands daily. So it's all for this article. I hope it helped you. Share with us interesting and useful commands in the comment section below and don't forget to share this article with your friends. +### 总结 + +如我在文章开始所言,这10条命令并不会让你立即成为一个Linux大拿。它们会让你在初期快速上手Linux。以这些命令为基础,给自己设置一个目标,每天学习一到三条命令,这就是此文的目的所在。在下方评论区分享有趣并且有用的命令。别忘了跟你的朋友分享此文。 + -------------------------------------------------------------------------------- via: http://www.linuxandubuntu.com/home/10-basic-linux-commands-that-every-linux-newbies-should-remember 作者:[Commenti][a] -译者:[译者ID](https://github.com/译者ID) +译者:[mr-ping](https://github.com/mr-ping) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1d93c3853cb201efb05932dbcbe23181c1802d17 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 20 Jun 2016 06:24:34 +0800 Subject: [PATCH 0938/1469] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84=E6=96=87=E4=BB=B6=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @oska874 @martin2011qi --- ...60519 The future of sharing integrating Pydio and ownCloud.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename translated/tech/{20160519 The future of sharing: integrating Pydio and ownCloud.md => 20160519 The future of sharing integrating Pydio and ownCloud.md} (100%) diff --git a/translated/tech/20160519 The future of sharing: integrating Pydio and ownCloud.md b/translated/tech/20160519 The future of sharing integrating Pydio and ownCloud.md similarity index 100% rename from translated/tech/20160519 The future of sharing: integrating Pydio and ownCloud.md rename to translated/tech/20160519 The future of sharing integrating Pydio and ownCloud.md From fd1a9e51fd5f3ddca155c9563c78edd6e1d15b5f Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 20 Jun 2016 06:51:25 +0800 Subject: [PATCH 0939/1469] PUB:20160218 Linux Systems Patched for Critical glibc Flaw @robot527 --- ...Systems Patched for Critical glibc Flaw.md | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) rename {translated/tech => published}/20160218 Linux Systems Patched for Critical glibc Flaw.md (55%) diff --git a/translated/tech/20160218 Linux Systems Patched for Critical glibc Flaw.md b/published/20160218 Linux Systems Patched for Critical glibc Flaw.md similarity index 55% rename from translated/tech/20160218 Linux Systems Patched for Critical glibc Flaw.md rename to published/20160218 Linux Systems Patched for Critical glibc Flaw.md index 284ac99fa0..e6a008f7bc 100644 --- a/translated/tech/20160218 Linux Systems Patched for Critical glibc Flaw.md +++ b/published/20160218 Linux Systems Patched for Critical glibc Flaw.md @@ -1,39 +1,41 @@ 修补 Linux 系统 glibc 严重漏洞 ================================================= -**谷歌揭露的一个严重漏洞影响主流的 Linux 发行版。glibc 的漏洞可能导致远程代码执行。** +**谷歌披露的一个严重漏洞影响到了主流的 Linux 发行版。glibc 的漏洞可能导致远程代码执行。** -Linux 用户今天都竞相给一个可以使系统暴露在远程代码执行风险中的核心 glibc 开放源码库的严重漏洞打补丁。glibc 的漏洞被确定为 CVE-2015-7547,题为“getaddrinfo 基于堆栈的缓冲区溢出”。 +编者按:这个消息并不是一个新闻,基于技术的原因,我们还是分享给大家。 + +Linux 用户都在竞相给一个可以使系统暴露在远程代码执行风险中的核心 glibc 开放源码库的严重漏洞打补丁。这个 glibc 的漏洞编号被确定为 CVE-2015-7547,题为“getaddrinfo 基于堆栈的缓冲区溢出”。 glibc,或 GNU C 库,是一个开放源码的 C 和 C++ 编程语言库的实现,是每一个主流 Linux 发行版的一部分。谷歌工程师们在他们试图连接到某个主机系统时发生了一个段错误导致连接崩溃,偶然发现了 CVE-2015-7547 问题。进一步的研究表明, glibc 有缺陷而且该崩溃可能实现任意远程代码执行的条件。 -谷歌在一篇博客文章中写道, “当 getaddrinfo() 库函数被使用时,glibc 的 DNS 客户端解析器易受基于堆栈缓冲区溢出的攻击,使用该功能的软件可能被利用为攻击者控制的域名,攻击者控制的 DNS[域名系统] 服务器,或通过中间人攻击。” +谷歌在一篇博客文章中写道, “当 getaddrinfo() 库函数被使用时,glibc 的 DNS 客户端解析器易受基于堆栈缓冲区溢出的攻击,使用该功能的软件可能通过攻击者控制的域名、攻击者控制的 DNS [域名系统] 服务器,或通过中间人攻击方式(MITM)进行破坏。” 其实利用 CVE-2015-7547 问题并不简单,但它是可能的。为了证明这个问题能被利用,谷歌发布了论证一个终端用户或系统是否易受攻击的概念验证(POC)代码到 GitHub 上。 -GitHub 上的 POC 网页声明“服务器代码触发漏洞,因此会使客户端代码崩溃”。 +GitHub 上的 POC 网页说“服务器代码会触发漏洞,因此会使客户端代码崩溃”。 -Duo Security 公司的高级安全研究员 Mark Loveless 解释说 CVE-2015-7547 的主要风险在于 Linux 上依赖于 DNS 响应的基于客户端的应用程序。 +Duo Security 公司的高级安全研究员 Mark Loveless 解释说 CVE-2015-7547 的主要风险在于依赖于 DNS 响应的基于 Linux 客户端的应用程序。 Loveless 告诉 eWEEK “需要一些特定的条件,所以不是每个应用程序都会受到影响,但似乎一些命令行工具,包括流行的 SSH[安全 Shell] 客户端都可能触发该漏洞,我们认为这是严重的,主要是因为对 Linux 系统存在的风险,但也因为潜在的其他问题。” -其他问题可能包括一种触发调用易受攻击的 glibc 库 getaddrinfo() 的基于电子邮件攻击的风险。另外值得注意的是,该漏洞被发现之前已存在于代码之中多年。 +其他问题可能包括一种通过电子邮件触发调用易受攻击的 glibc 库 getaddrinfo() 攻击的风险。另外值得注意的是,该漏洞被发现之前已存在于代码之中多年。 -谷歌的工程师不是第一或唯一发现 glibc 中的安全风险的团体。这个问题于 2015 年 7 月 13 日首先被报告给了 glibc 的 bug[跟踪系统](https://sourceware.org/bugzilla/show_bug.cgi?id=1866)。该缺陷的根源可以更进一步追溯到在 2008 五月发布的 glibc 2.9 的代码提交时首次引入缺陷。 +谷歌的工程师不是第一或唯一发现这个 glibc 安全风险的团体。这个问题于 2015 年 7 月 13 日首先被报告给了 glibc 的 bug[跟踪系统](https://sourceware.org/bugzilla/show_bug.cgi?id=1866)。该缺陷的根源可以更进一步追溯到在 2008 五月发布的 glibc 2.9 的代码提交时首次引入缺陷。 -Linux 厂商红帽也独立找到了 glibc 中的这个 bug,而且在 2016 年 1 月 6 日,谷歌和红帽开发人员证实,他们作为最初与上游 glibc 的维护者私下讨论的部分人员,已经独立在为同一个漏洞工作。 +Linux 厂商红帽也独立找到了 glibc 中的这个 bug,而且是在 2016 年 1 月 6 日,谷歌和红帽开发人员证实,他们作为最初与上游 glibc 的维护者私下讨论的部分人员,已经独立在为同一个漏洞工作。 -红帽产品安全首席软件工程师 Florian Weimer 告诉 eWEEK “一旦确认了两个团队都在为同一个漏洞工作,我们合作进行可能的修复,缓解措施和回归测试,我们还共同努力,使测试覆盖尽可能广,捕捉代码中的任何相关问题,以帮助避免今后更多问题。” +红帽产品安全首席软件工程师 Florian Weimer 告诉 eWEEK “一旦确认了两个团队都在为同一个漏洞工作,我们会合作进行可能的修复,缓解措施和回归测试,我们还会共同努力,使测试覆盖尽可能广,捕捉代码中的任何相关问题,以帮助避免今后更多问题。” 由于缺陷不明显或不易立即显现,我们花了几年时间才发现 glibc 代码有一个安全问题。 -Weimer 说“要诊断一个网络组件的漏洞,如 DNS 解析器,当遇到问题时通常要看被抓数据包的踪迹,在这种情况下这样的抓包不适用,所以需要一些实验来重现触发这个 bug 的确切场景。” +Weimer 说“要诊断一个网络组件的漏洞,如 DNS 解析器,当遇到问题时通常要看抓到的数据包的踪迹,在这种情况下这样的抓包不适用,所以需要一些实验来重现触发这个 bug 的确切场景。” -Weimer 补充说,一旦可以抓取数据包,大量精力投入到验证修复程序中,最终导致回归测试套件一系列的改进,有助于上游 glibc 项目。 +Weimer 补充说,一旦可以抓取数据包,就会投入大量精力到验证修复程序中,最终完成回归测试套件一系列的改进,有助于上游 glibc 项目。 -在许多情况下,安全增强式 Linux (SELinux) 的强制访问安全控制可以减少潜在漏洞风险,除了这个 glibc 的新问题。 +在许多情况下,安全增强式 Linux (SELinux) 的强制访问安全控制可以减少潜在漏洞风险,但是这个 glibc 的新问题例外。 -Weimer 说“由于攻击者提供的任意代码的执行,风险是重要系统功能的一个妥协。一个合适的 SELinux 策略可以遏制一些攻击者可能会做的损害,并限制他们访问系统,但是 DNS 被许多应用程序和系统组件使用,所以 SELinux 策略只提供了针对此问题有限的遏制。” +Weimer 说“由于攻击者提供的任意代码的执行,会对很多重要系统功能带来风险。一个合适的 SELinux 策略可以遏制一些攻击者可能会做的损害,并限制他们访问系统,但是 DNS 被许多应用程序和系统组件使用,所以 SELinux 策略只提供了针对此问题有限的遏制。” 在揭露漏洞的今天,现在有一个可用的补丁来减少 CVE-2015-7547 的潜在风险。 @@ -43,7 +45,7 @@ via: http://www.eweek.com/security/linux-systems-patched-for-critical-glibc-flaw 作者:[Michael Kerner][a] 译者:[robot527](https://github.com/robot527) -校对:[校对者 ID](https://github.com/校对者 ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux 中国](https://linux.cn/) 荣誉推出 From 93e334a0f68ea08e9713d674212aaece94ee3a27 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 20 Jun 2016 07:19:26 +0800 Subject: [PATCH 0940/1469] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=B4=A1=E7=8C=AE?= =?UTF-8?q?=E8=80=85=E5=90=8D=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 82 +++++++++++++++++++++++-------------------------------- 1 file changed, 34 insertions(+), 48 deletions(-) diff --git a/README.md b/README.md index e68f260b71..40afd5d30e 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,16 @@ 简介 ------------------------------- -LCTT是“Linux中国”([https://linux.cn/](https://linux.cn/))的翻译组,负责从国外优秀媒体翻译Linux相关的技术、资讯、杂文等内容。 +LCTT 是“Linux中国”([https://linux.cn/](https://linux.cn/))的翻译组,负责从国外优秀媒体翻译 Linux 相关的技术、资讯、杂文等内容。 -LCTT已经拥有几百名活跃成员,并欢迎更多的Linux志愿者加入我们的团队。 +LCTT 已经拥有几百名活跃成员,并欢迎更多的Linux志愿者加入我们的团队。 ![logo](http://img.linux.net.cn/static/image/common/lctt_logo.png) -LCTT的组成 +LCTT 的组成 ------------------------------- -**选题**,负责选择合适的内容,并将原文转换为markdown格式,提交到LCTT的[TranslateProject](https://github.com/LCTT/TranslateProject) 库中。 +**选题**,负责选择合适的内容,并将原文转换为 markdown 格式,提交到 LCTT 的 [TranslateProject](https://github.com/LCTT/TranslateProject) 库中。 **译者**,负责从选题中选择内容进行翻译。 @@ -21,38 +21,38 @@ LCTT的组成 加入我们 ------------------------------- -请首先加入翻译组的QQ群,群号是:198889102,加群时请说明是“志愿者”。加入后记得修改您的群名片为您的github的ID。 +请首先加入翻译组的 QQ 群,群号是:198889102,加群时请说明是“志愿者”。加入后记得修改您的群名片为您的 GitHub 的 ID。 -加入的成员,请先阅读[WIKI 如何开始](https://github.com/LCTT/TranslateProject/wiki/01-如何开始)。 +加入的成员,请先阅读 [WIKI 如何开始](https://github.com/LCTT/TranslateProject/wiki/01-如何开始)。 如何开始 ------------------------------- -请阅读[WIKI](https://github.com/LCTT/TranslateProject/wiki)。 +请阅读 [WIKI](https://github.com/LCTT/TranslateProject/wiki)。 历史 ------------------------------- * 2013/09/10 倡议并得到了大家的积极响应,成立翻译组。 -* 2013/09/11 采用github进行翻译协作,并开始进行选题翻译。 +* 2013/09/11 采用 GitHub 进行翻译协作,并开始进行选题翻译。 * 2013/09/16 公开发布了翻译组成立消息后,又有新的成员申请加入了。并从此建立见习成员制度。 -* 2013/09/24 鉴于大家使用Github的水平不一,容易导致主仓库的一些错误,因此换成了常规的fork+PR的模式来进行翻译流程。 -* 2013/10/11 根据对LCTT的贡献,划分了Core Translators组,最先的加入成员是vito-L和tinyeyeser。 -* 2013/10/12 取消对LINUX.CN注册用户的依赖,在QQ群内、文章内都采用github的注册ID。 -* 2013/10/18 正式启动man翻译计划。 +* 2013/09/24 鉴于大家使用 GitHub 的水平不一,容易导致主仓库的一些错误,因此换成了常规的 fork+PR 的模式来进行翻译流程。 +* 2013/10/11 根据对 LCTT 的贡献,划分了 Core Translators 组,最先的加入成员是 vito-L 和 tinyeyeser。 +* 2013/10/12 取消对 LINUX.CN 注册用户的依赖,在 QQ 群内、文章内都采用 GitHub 的注册 ID。 +* 2013/10/18 正式启动 man 翻译计划。 * 2013/11/10 举行第一次北京线下聚会。 -* 2014/01/02 增加了Core Translators 成员: geekpi。 -* 2014/05/04 更换了新的QQ群:198889102 -* 2014/05/16 增加了Core Translators 成员: will.qian、vizv。 -* 2014/06/18 由于GOLinux令人惊叹的翻译速度和不错的翻译质量,升级为Core Translators成员。 +* 2014/01/02 增加了 Core Translators 成员: geekpi。 +* 2014/05/04 更换了新的 QQ 群:198889102 +* 2014/05/16 增加了 Core Translators 成员: will.qian、vizv。 +* 2014/06/18 由于 GOLinux 令人惊叹的翻译速度和不错的翻译质量,升级为 Core Translators 成员。 * 2014/09/09 LCTT 一周年,做一年[总结](http://linux.cn/article-3784-1.html)。并将曾任 CORE 的成员分组为 Senior,以表彰他们的贡献。 -* 2014/10/08 提升bazz2为Core Translators成员。 -* 2014/11/04 提升zpl1025为Core Translators成员。 -* 2014/12/25 提升runningwater为Core Translators成员。 +* 2014/10/08 提升 bazz2 为 Core Translators 成员。 +* 2014/11/04 提升 zpl1025 为 Core Translators 成员。 +* 2014/12/25 提升 runningwater 为 Core Translators 成员。 * 2015/04/19 发起 LFS-BOOK-7.7-systemd 项目。 -* 2015/06/09 提升ictlyh和dongfengweixiao为Core Translators成员。 -* 2015/11/10 提升strugglingyouth、FSSlc、Vic020、alim0x为Core Translators成员。 -* 2016/05/09 提升PurlingNayuki为校对。 +* 2015/06/09 提升 ictlyh 和 dongfengweixiao 为 Core Translators 成员。 +* 2015/11/10 提升 strugglingyouth、FSSlc、Vic020、alim0x 为 Core Translators 成员。 +* 2016/05/09 提升 PurlingNayuki 为校对。 活跃成员 ------------------------------- @@ -74,16 +74,16 @@ LCTT的组成 - CORE @dongfengweixiao, - CORE @alim0x, - Senior @DeadFire, -- Senior @reinoir, +- Senior @reinoir222, - Senior @tinyeyeser, - Senior @vito-L, - Senior @jasminepeng, - Senior @willqian, - Senior @vizv, - ZTinoZ, -- theo-l, -- luoxcat, - martin2011qi, +- theo-l, +- Luoxcat, - wi-cuckoo, - disylee, - haimingfg, @@ -91,8 +91,8 @@ LCTT的组成 - wwy-hust, - felixonmars, - su-kaiyao, -- ivo-wang, - GHLandy, +- ivo-wang, - cvsher, - wyangsun, - DongShuaike, @@ -119,6 +119,7 @@ LCTT的组成 - blueabysm, - boredivan, - name1e5s, +- StdioA, - yechunxiao19, - l3b2w1, - XLCYun, @@ -134,8 +135,8 @@ LCTT的组成 - 1w2b3l, - JonathanKang, - crowner, -- mtunique, - dingdongnigetou, +- mtunique, - CNprober, - hyaocuk, - szrlee, @@ -146,37 +147,22 @@ LCTT的组成 - xiaoyu33, - guodongxiaren, - ynmlml, -- kylepeng93, +- vim-kakali, - ggaaooppeenngg, - Ricky-Gong, - zky001, -- Flowsnow, - lfzark, - 213edu, -- Tanete, -- liuaiping, - bestony, +- mudongliang, +- liuaiping, - Timeszoro, - rogetfan, -- itsang, - JeffDing, - Yuking-net, -- MikeCoder, -- zhangboyue, -- liaoishere, -- yupmoon, -- Medusar, -- zzlyzq, -- yujianxuechuan, -- ailurus1991, -- tomatoKiller, -- stduolc, -- shaohaolin, -- FineFan, -- kingname, -- CHINAANSHE, -(按提交行数排名前百) + +(按增加行数排名前百) LFS 项目活跃成员有: @@ -188,7 +174,7 @@ LFS 项目活跃成员有: - @KevinSJ - @Yuking-net -(更新于2016/05/09) +(更新于2016/06/20) 谢谢大家的支持! From 6b710a8db52dc0b74fa855eec6558f002da95915 Mon Sep 17 00:00:00 2001 From: Ping Date: Mon, 20 Jun 2016 08:32:04 +0800 Subject: [PATCH 0941/1469] Move the location of 10 Basic Linux Command --- ...sic Linux Commands That Every Linux Newbies Should Remember.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20160616 10 Basic Linux Commands That Every Linux Newbies Should Remember.md (100%) diff --git a/sources/tech/20160616 10 Basic Linux Commands That Every Linux Newbies Should Remember.md b/translated/tech/20160616 10 Basic Linux Commands That Every Linux Newbies Should Remember.md similarity index 100% rename from sources/tech/20160616 10 Basic Linux Commands That Every Linux Newbies Should Remember.md rename to translated/tech/20160616 10 Basic Linux Commands That Every Linux Newbies Should Remember.md From 82c4720013e408536e2acdb0eacbb107b0e025ea Mon Sep 17 00:00:00 2001 From: Ping Date: Mon, 20 Jun 2016 10:33:09 +0800 Subject: [PATCH 0942/1469] Mark the article --- sources/tech/20160605 How to Add Cron Jobs in Linux and Unix.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20160605 How to Add Cron Jobs in Linux and Unix.md b/sources/tech/20160605 How to Add Cron Jobs in Linux and Unix.md index 4bef489ade..e7ae6f4105 100644 --- a/sources/tech/20160605 How to Add Cron Jobs in Linux and Unix.md +++ b/sources/tech/20160605 How to Add Cron Jobs in Linux and Unix.md @@ -1,4 +1,4 @@ - Vic020 +Translating by Ping How to Add Cron Jobs in Linux and Unix ====================================== From 6ea2b1a6e5558e9ad2b492ba92f3cda366aded56 Mon Sep 17 00:00:00 2001 From: Ping Date: Mon, 20 Jun 2016 13:26:06 +0800 Subject: [PATCH 0943/1469] Complete translating --- ... How to Add Cron Jobs in Linux and Unix.md | 180 ----------------- ... How to Add Cron Jobs in Linux and Unix.md | 183 ++++++++++++++++++ 2 files changed, 183 insertions(+), 180 deletions(-) delete mode 100644 sources/tech/20160605 How to Add Cron Jobs in Linux and Unix.md create mode 100644 translated/tech/20160605 How to Add Cron Jobs in Linux and Unix.md diff --git a/sources/tech/20160605 How to Add Cron Jobs in Linux and Unix.md b/sources/tech/20160605 How to Add Cron Jobs in Linux and Unix.md deleted file mode 100644 index e7ae6f4105..0000000000 --- a/sources/tech/20160605 How to Add Cron Jobs in Linux and Unix.md +++ /dev/null @@ -1,180 +0,0 @@ -Translating by Ping - -How to Add Cron Jobs in Linux and Unix -====================================== - - -![](https://www.unixmen.com/wp-content/uploads/2016/05/HOW-TO-ADD-CRON-JOBS-IN-LINUX-AND-UNIX-696x334.png) - -### Introduction - -![](http://www.unixmen.com/wp-content/uploads/2016/05/cronjob.gif) - -Cron job are used to schedule commands to be executed periodically. You can setup commands or scripts, which will repeatedly run at a set time. Cron is one of the most useful tool in Linux or UNIX like operating systems. The cron service (daemon) runs in the background and constantly checks the /etc/crontab file, and /etc/cron.*/ directories. It also checks the /var/spool/cron/ directory. - -### Command of crontab - -crontab is the command used to install, deinstall or list the tables (cron configuration file) used to drive the [cron(8)][1] daemon in Vixie Cron. Each user can have their own crontab file, and though these are files in /var/spool/cron/crontabs, they are not intended to be edited directly. You need to use crontab command for editing or setting up your own cron jobs. - -### Types of cron configuration files - -There are different types of configuration files: - -- **The UNIX / Linux system crontab** : Usually, used by system services and critical jobs that requires root like privileges. The sixth field (see below for field description) is the name of a user for the command to run as. This gives the system crontab the ability to run commands as any user. - -- **The user crontabs**: User can install their own cron jobs using the crontab command. The sixth field is the command to run, and all commands run as the user who created the crontab - -**Note**: This faq features cron implementations written by Paul Vixie and included in many [Linux][2] distributions and Unix like systems such as in the popular 4th BSD edition. The syntax is [compatible][3] with various implementations of crond. - -How Do I install or create or edit my own cron jobs? - -To edit your crontab file, type the following command at the UNIX / Linux shell prompt: - -``` -$ crontab -e -``` - -Syntax of crontab (field description) - -The syntax is: - -``` -1 2 3 4 5 /path/to/command arg1 arg2 -``` - -OR - -``` -1 2 3 4 5 /root/ntp_sync.sh -``` - -Where, - -- 1: Minute (0-59) -- 2: Hours (0-23) -- 3: Day (0-31) -- 4: Month (0-12 [12 == December]) -- 5: Day of the week(0-7 [7 or 0 == sunday]) -- /path/to/command – Script or command name to schedule - -Easy to remember format: - -``` -* * * * * command to be executed -– – – – – -| | | | | -| | | | —– Day of week (0 – 7) (Sunday=0 or 7) -| | | ——- Month (1 – 12) -| | ——— Day of month (1 – 31) -| ———– Hour (0 – 23) -————- Minute (0 – 59) -``` - -Example simple crontab. - -```` -## run backupscript 5 minutes 1 time ## -*/5 * * * * /root/backupscript.sh - -## Run backupscript daily on 1:00 am ## - -0 1 * * * /root/backupscript.sh - -## Run backup script monthly on the 1st of month 3:15 am ## - -15 3 1 * * /root/backupscript.sh -``` - -### How do I use operators? - -An operator allows you to specifying multiple values in a field. There are three operators: - -- **The asterisk (*)** : This operator specifies all possible values for a field. For example, an asterisk in the hour time field would be equivalent to every hour or an asterisk in the month field would be equivalent to every month - -- **The comma (,)** : This operator specifies a list of values, for example: “1,5,10,15,20, 25”. - -- **The dash (–)** : This operator specifies a range of values, for example: “5-15” days , which is equivalent to typing “5,6,7,8,9,….,13,14,15” using the comma operator. - -- **The separator (/)** : This operator specifies a step value, for example: “0-23/” can be used in the hours field to specify command execution every other hour. Steps are also permitted after an asterisk, so if you want to say every two hours, just use */2. - - -### Use special string to save time - -Instead of the first five fields, you can use any one of eight special strings. It will not just save your time but it will improve readability. - -Special string | Meaning -|:-- |:-- -@reboot | Run once, at startup. -@yearly | Run once a year, “0 0 1 1 *”. -@annually | (same as @yearly) -@monthly | Run once a month, “0 0 1 * *”. -@weekly | Run once a week, “0 0 * * 0”. -@daily | Run once a day, “0 0 * * *”. -@midnight | (same as @daily) -@hourly | Run once an hour, “0 * * * *”. - - -Examples - -``` -#### Run ntpdate command every hour #### - -@hourly /path/to/ntpdate -``` - - -### More about /etc/crontab file and /etc/cron.d/* directories - -/etc/crontab is system crontabs file. Usually only used by root user or daemons to configure system wide jobs. All individual user must must use crontab command to install and edit their jobs as described above. /var/spool/cron/ or /var/cron/tabs/ is directory for personal user crontab files. It must be backup with users home directory. - -Understanding Default /etc/crontab - -Typical /etc/crontab file entries: - -``` -SHELL=/bin/bash -PATH=/sbin:/bin:/usr/sbin:/usr/bin -MAILTO=root -HOME=/ -# run-parts -01 * * * * root run-parts /etc/cron.hourly -02 4 * * * root run-parts /etc/cron.daily -22 4 * * 0 root run-parts /etc/cron.weekly -42 4 1 * * root run-parts /etc/cron.monthly -``` - -First, the environment must be defined. If the shell line is omitted, cron will use the default, which is sh. If the PATH variable is omitted, no default will be used and file locations will need to be absolute. If HOME is omitted, cron will use the invoking users home directory. - -Additionally, cron reads the files in /etc/cron.d/ directory. Usually system daemon such as sa-update or sysstat places their cronjob here. As a root user or superuser you can use following directories to configure cron jobs. You can directly drop your scripts here. The run-parts command run scripts or programs in a directory via /etc/crontab file: - -Directory |Description -|:-- |:-- -/etc/cron.d/ | Put all scripts here and call them from /etc/crontab file. -/etc/cron.daily/ | Run all scripts once a day -/etc/cron.hourly/ | Run all scripts once an hour -/etc/cron.monthly/ | Run all scripts once a month -/etc/cron.weekly/ | Run all scripts once a week - - -### Backup cronjob - -``` -# crontab -l > /path/to/file - -# crontab -u user -l > /path/to/file -``` - --------------------------------------------------------------------------------- - -via: https://www.unixmen.com/add-cron-jobs-linux-unix/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+unixmenhowtos+%28Unixmen+Howtos+%26+Tutorials%29 - -作者:[Duy NguyenViet][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.unixmen.com/author/duynv/ -[1]: http://www.manpager.com/linux/man8/cron.8.html -[2]: http://www.linuxsecrets.com/ -[3]: http://www.linuxsecrets.com/linux-hardware/ diff --git a/translated/tech/20160605 How to Add Cron Jobs in Linux and Unix.md b/translated/tech/20160605 How to Add Cron Jobs in Linux and Unix.md new file mode 100644 index 0000000000..51935ae54b --- /dev/null +++ b/translated/tech/20160605 How to Add Cron Jobs in Linux and Unix.md @@ -0,0 +1,183 @@ +如何在Linux及Unix系统中添加定时任务 +====================================== + + +![](https://www.unixmen.com/wp-content/uploads/2016/05/HOW-TO-ADD-CRON-JOBS-IN-LINUX-AND-UNIX-696x334.png) + +### 导言 + +![](http://www.unixmen.com/wp-content/uploads/2016/05/cronjob.gif) + +定时任务是用来定期执行计划命令的。你可以将命令组织到脚本当中,这样就可以在设定的时间将其重复执行。`Cron`是Linux系统或者类Unix系统当中最为实用的工具之一。定时服务(守护进程)在系统后台运行,并且会持续地检查 /etc/crontab 文件和 /etc/cron.*/ 目录。它同样也会检测 /var/spool/cron/ 目录。 + + +### crontab 命令 + +`crontab`是用来安装、卸载或者列出定时配置文件列表的命令。定时配置文件则用于驱动`Vixie Cron`的[cron(8)][1]守护进程。每个用户都可以拥有自己的 crontab 文件,虽然这些文件位于 /var/spool/cron/crontabs 目录中,但这并不意味着你可以直接编辑它们。你需要通过`crontab`命令来编辑或者配置自己的定时任务。 + + +### 定时配置文件的类型 + +配置文件分为以下不同的类型: + +- **UNIX 或 Linux 系统的 crontab** : 此类型通常由类似需要root权限的系统服务或重要任务使用。第六个字段(见下方的字段介绍)为用户名,用来指定此命令以哪个用户身份来执行。如此一来,系统的`crontab`就能够以任意用户的身份来执行操作。 + +- **用户的 crontabs**: 用户可以使用`corntab`命令来安装属于他们自己的定时任务。 第六个字段为需要运行的命令行, 所有的命令行都会以创建 crontab 的用户的身份运行。 + +**Note**: This faq features cron implementations written by Paul Vixie and included in many [Linux][2] distributions and Unix like systems such as in the popular 4th BSD edition. The syntax is [compatible][3] with various implementations of crond. + +**注意**: 这种问答形式的`Cron`实现是由 Paul Vixie 所写的,并且被许多 [Linux][2] 发行版和类Unix系统(如广受欢迎的第四版BSD)包含其中。它的语法被各种计划任务的实现所[兼容][3]。 + +该如何安装、创建或编辑我们自己的定时任务呢? + +在 Linux 或 Unix 的shell提示符后键入以下命令来编辑你的 crontab 文件。 + +``` +$ crontab -e +``` + +`crontab`语法(字段介绍): + +语法为: + +``` +1 2 3 4 5 /path/to/command arg1 arg2 +``` + +或者 + +``` +1 2 3 4 5 /root/ntp_sync.sh +``` + +说明: + +- 1: 分钟 (0-59) +- 2: 小时 (0-23) +- 3: 日期 (0-31) +- 4: 月份 (0-12 [12 == December]) +- 5: 一周当中的某天 (0-7 [7 或 0 == 周日]) +- /path/to/command – 计划执行的脚本或命令名 + +便于记忆的格式: + +``` +* * * * * command to be executed +– – – – – +| | | | | +| | | | —– 一周当中的某天 (0 – 7) (周日=0 or 7) +| | | ——- 月份 (1 – 12) +| | ——— 一月当中的某天 (1 – 31) +| ———– 小时 (0 – 23) +————- 分钟 (0 – 59) +``` + +简单的`crontab`示例: + +```` +## 每隔5分钟运行一次 backupscript 脚本## +*/5 * * * * /root/backupscript.sh + +## 每天的上午1:00运行 backupscript 脚本 ## + +0 1 * * * /root/backupscript.sh + +## 每月的第一个上午3:15 运行 backupscript 脚本 ## + +15 3 1 * * /root/backupscript.sh +``` + + +### 如何使用操作符 + +操作符允许你为一个字段指定多个值,这里有三个操作符可供使用: + +- **星号 (*)** : 此操作符为字段指定所有可用的值。举个例子,在小时字段中,一个星号等同于所有可用的hour值;在月份字段中,一个星号表示所有可用的month值。 + +- **逗号 (,)** : 这个操作符指定了一个包含多个值的列表,例如:`1,5,10,15,20, 25`. + +- **横杠 (–)** : 此操作符指定了一个值的范围,例如:`5-15` 天,等同于使用逗号操作符键入的 `5,6,7,8,9,….,13,14,15`。 + +- **分隔符 (/)** : 此操作符指定了一个步进值,例如: `0-23/` 可以用于小时字段来指定命令行每小时执行一次。步进值也可以跟在星号操作符后边,如果你希望命令行每2小时执行一次,可以这样写 `*/2`。 + + +### 使用特殊字符保存时间 + +你可以使用以下8个特殊字符中的其中一个替代头五个字段。这样不但可以保存时间,也可以提高可读性。 + +特殊字符 | 含义 +|:-- |:-- +@reboot | 在每次启动时运行一次 +@yearly | 每年运行一次, “0 0 1 1 *”. +@annually | (同 @yearly) +@monthly | 每月运行一次, “0 0 1 * *”. +@weekly | 每周运行一次, “0 0 * * 0”. +@daily | 每天运行一次, “0 0 * * *”. +@midnight | (同 @daily) +@hourly | 每小时运行一次, “0 * * * *”. + + +示例: + +``` +#### 每小时运行一次 ntpdate #### + +@hourly /path/to/ntpdate +``` + + +### 关于 /etc/crontab file 和 /etc/cron.d/* 目录的更多内容 + +/etc/crontab 是系统的 corntabs 文件。通常用于root用户和守护进程配置整个系统的任务。每个独立的用户务必遵照以上的介绍,使用`corntab`命令来编辑自己的任务。/var/spool/cron/ 或者 /var/cron/tabs/ 目录存放了个人用户的 corntab 文件,它必定会备份在用户的home目录当中。 + +理解默认的 /etc/crontab + +典型的 /etc/crontab 文件内容: + +``` +SHELL=/bin/bash +PATH=/sbin:/bin:/usr/sbin:/usr/bin +MAILTO=root +HOME=/ +# run-parts +01 * * * * root run-parts /etc/cron.hourly +02 4 * * * root run-parts /etc/cron.daily +22 4 * * 0 root run-parts /etc/cron.weekly +42 4 1 * * root run-parts /etc/cron.monthly +``` + +首先,环境必须定义好。如果shell行被忽略了,corn会使用默认的sh shell。如果PATH变量被忽略,就没有默认路径会被使用,并且所有的文件都需要使用绝对路径来定位。如果HOME被忽略,corn会将调用者(用户)的home目录作为默认值使用。 + +另外,corn 会在/etc/cron.d/ 目录中读取文件。通常情况下,像 sa-update 或者 sysstat 这样的系统守护进程会将他们的定时任务存放在此处。作为root用户或者超级用户,你可以使用以下目录来配置你的定时任务。你可以直接将脚本放到这里。`run-parts`命令会通过 /etc/crontab 目录来运行脚本或者程序。 + +目录 |介绍 +|:-- |:-- +/etc/cron.d/ | 将所有的脚本文件放在此处,并从 /etc/crontab 文件中调用它们。 +/etc/cron.daily/ | 每天运行的所有的脚本 +/etc/cron.hourly/ | 每小时运行的所有脚本 +/etc/cron.monthly/ | 每月运行的所有脚本 +/etc/cron.weekly/ | 每周运行的所有脚本 + + +### 备份定时任务 + +``` +# crontab -l > /path/to/file + +# crontab -u user -l > /path/to/file +``` + +-------------------------------------------------------------------------------- + +via: https://www.unixmen.com/add-cron-jobs-linux-unix/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+unixmenhowtos+%28Unixmen+Howtos+%26+Tutorials%29 + +作者:[Duy NguyenViet][a] +译者:[mr-ping](https://github.com/mr-ping) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.unixmen.com/author/duynv/ +[1]: http://www.manpager.com/linux/man8/cron.8.html +[2]: http://www.linuxsecrets.com/ +[3]: http://www.linuxsecrets.com/linux-hardware/ From 71b52c5a196a72097ba7a670f7f84d47b2cb451b Mon Sep 17 00:00:00 2001 From: J L Date: Mon, 20 Jun 2016 16:29:52 +0800 Subject: [PATCH 0944/1469] =?UTF-8?q?[Translation=20Complete]=20Securi-Pi:?= =?UTF-8?q?=20=E4=BD=BF=E7=94=A8=E6=A0=91=E8=8E=93=E6=B4=BE=E4=BD=9C?= =?UTF-8?q?=E4=B8=BA=E5=AE=89=E5=85=A8=E8=B7=B3=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...the Raspberry Pi as a Secure Landing Point | 519 ++++++++++++++++++ 1 file changed, 519 insertions(+) create mode 100644 translated/tech/20151215 Securi-Pi--Using the Raspberry Pi as a Secure Landing Point diff --git a/translated/tech/20151215 Securi-Pi--Using the Raspberry Pi as a Secure Landing Point b/translated/tech/20151215 Securi-Pi--Using the Raspberry Pi as a Secure Landing Point new file mode 100644 index 0000000000..b6705a7b83 --- /dev/null +++ b/translated/tech/20151215 Securi-Pi--Using the Raspberry Pi as a Secure Landing Point @@ -0,0 +1,519 @@ +Securi-Pi: 使用树莓派作为安全跳板 +================================================================================ + +像很多 LinuxJournal 的读者一样,我也过上了当今非常普遍的“科技游牧”生活,在网络到网络间,从一个接入点到另一个接入点,我们身处现实世界的不同地方却始终保持统一的互联网接入端。近来我发现越来越多的网络环境开始屏蔽对外的常用端口比如 SMTP(端口25),SSH(端口22)之类的。当你走进一家咖啡馆然后想 SSH 到你的一台服务器上做点事情的时候发现端口22被屏蔽了是一件很烦的事情。 + +不过,我到目前为止还没发现有什么网络环境会把 HTTPS 给墙了(端口443)。在稍微配置了一下家中的树莓派 2之后,我成功地让自己能通过接入树莓派的443接口充当跳板从而让我在各种网络环境下连上想要的目标端口。简而言之,我把家中的树莓派设置成了一个 OpenVPN 的端点,SSH 端点同时也是一个 Apache 服务器——用于监听443端口上的我的接入活动并执行我预先设置好的网络策略。 + + +### 笔记 +此解决方案能搞定大多数有限制的网络环境,但有些防火墙会对外部流量调用深度包检查(Deep packet inspection),它们时常能屏蔽掉用本篇文章里的方式传输的信息。不过我到目前为止还没在这样的防火墙后测试过。同时,尽管我使用了很多基于密码学的工具(OpenVPN,HTTPS,SSH),我并没有非常严格地审计过这套配置方案(译者注:作者的意思是指这套方案能帮你绕过端口限制,但不代表你就是完全安全地连接上了树莓派)。有时候甚至 DNS 服务都会泄露你的信息,很可能在我没有考虑周到的角落里会有遗漏。我强烈不推荐把此跳板配置方案当作是万无一失的隐藏网络流量的办法,此配置只是希望能绕过一些端口限制连上网络,而不是做一些危险的事情。 + +### 起步 + +让我们先从你需要什么说起,我用的是树莓派 2,装载了最新版本的 Raspbian,不过这个配置也应该能在树莓派 Model B 上运行;512MB 的内存对我们来说绰绰有余了,虽然性能可能没有树莓派 2这么好,毕竟Model B只有一颗单核心 CPU 相比于四核心的树莓派 2。我的树莓派在家里的防火墙和路由器之后,所以我还能用这个树莓派作为跳板访问家里的其他电子设备。同时这也意味着我的流量在互联网上看起来仿佛来自我家的ip地址,所以这也算某种意义上保护了我的匿名性。如果你没有树莓派,或者不想从家里运行这个服务,那你完全可以把这个配置放在一台小型云服务器上(译者:比如 IPS )。你只要确保服务器运行着基于 Debian 的 Linux 发行版即可,这份指南依然可用。 + +![](http://www.linuxjournal.com/files/linuxjournal.com/ufiles/imagecache/large-550px-centered/u1002061/11913f1.jpg) + +图 1 树莓派,即将成为我们的加密网络端点 + + +### 安装并配置 BIND +无论你是用树莓派还是一台服务器,当你成功启动之后你就可以安装 BIND 了,驱动了互联网相当一部分的域名服务软件。你将会把 BIND 仅仅作为缓存域名服务使用,而不用把它配置为用来处理来自互联网的域名请求。安装 BIND 会让你拥有一个可以被 OpenVPN 使用的 DNS 服务器。安装 BIND 十分简单,`apt-get` 就可以直接搞定: + +``` +root@test:~# apt-get install bind9 +Reading package lists... Done +Building dependency tree +Reading state information... Done +The following extra packages will be installed: + bind9utils +Suggested packages: + bind9-doc resolvconf ufw +The following NEW packages will be installed: + bind9 bind9utils +0 upgraded, 2 newly installed, 0 to remove and + ↪0 not upgraded. +Need to get 490 kB of archives. +After this operation, 1,128 kB of additional disk + ↪space will be used. +Do you want to continue [Y/n]? y +``` + +在我们能把 BIND 当做缓存域名服务器之前,还有一些小细节需要配置。两个修改都在`/etc/bind/named.conf.options`里完成。首先你要反注释掉 forwarders 这一节内容,同时你还要增加一个可以转发域名请求的目标服务器。作为例子我会用 Google 的 DNS 服务器(8.8.8.8)(译者:国内的话需要找一个替代品);文件的 forwarders 节看上去大致是这样的: + + +``` +forwarders { + 8.8.8.8; +}; +``` + +第二点你需要做的更改是允许来自互联网和本地局域网的 query,直接把这一行加入配置文件的低端,最后一个`}`之前就可以了: + + +``` +allow-query { 192.168.1.0/24; 127.0.0.0/16; }; +``` + +上面那行配置会允许此 DNS 服务器接收来自网络和局域网的请求。下一步,你需要重启一下 BIND 的服务: + +``` +root@test:~# /etc/init.d/bind9 restart +[....] Stopping domain name service...: bind9waiting + ↪for pid 13209 to die +. ok +[ ok ] Starting domain name service...: bind9. +``` + +现在你可以测试一下 `nslookup` 来确保你的服务正常运行了: + + +``` +root@test:~# nslookup +> server localhost +Default server: localhost +Address: 127.0.0.1#53 +> www.google.com +Server: localhost +Address: 127.0.0.1#53 + +Non-authoritative answer: +Name: www.google.com +Address: 173.194.33.176 +Name: www.google.com +Address: 173.194.33.177 +Name: www.google.com +Address: 173.194.33.178 +Name: www.google.com +Address: 173.194.33.179 +Name: www.google.com +Address: 173.194.33.180 +``` + +完美!现在你的系统里已经有一个正常的域名服务在允许了,下一步我们来配置一下OpenVPN。 + + +### 安装并配置 OpenVPN + +OpenVPN 是一个运用 SSL/TLS 作为密钥交换的开源 VPN 解决方案。同时它也非常便于在 Linux 环境下部署。配置 OpenVPN 可能有一点艰巨,不过在此其实你也不需要在默认的配置文件里做太多修改。首先你会需要运行一下 `apt-get` 来安装 OpenVPN: + + +``` +root@test:~# apt-get install openvpn +Reading package lists... Done +Building dependency tree +Reading state information... Done +The following extra packages will be installed: + liblzo2-2 libpkcs11-helper1 +Suggested packages: + resolvconf +The following NEW packages will be installed: + liblzo2-2 libpkcs11-helper1 openvpn +0 upgraded, 3 newly installed, 0 to remove and + ↪0 not upgraded. +Need to get 621 kB of archives. +After this operation, 1,489 kB of additional disk + ↪space will be used. +Do you want to continue [Y/n]? y +``` + +现在 OpenVPN 已经安装好了,你需要去配置它了。OpenVPN 是基于 SSL 的,并且它同时依赖于服务端和客户端两方的证书来工作。为了生成这些证书,你需要配置机器上的证书签发(CA)。幸运地,OpenVPN 在安装中自带了一些用于生成证书的脚本比如 “easy-rsa” 来帮助你加快这个过程。你将要创建一个文件目录用于放置 easy-rsa 脚本的模板: + + +``` +root@test:~# mkdir /etc/openvpn/easy-rsa +root@test:~# cp -rpv + ↪/usr/share/doc/openvpn/examples/easy-rsa/2.0/* + ↪/etc/openvpn/easy-rsa/ + ``` + +下一步,把 vars 文件复制一个备份: + + +``` +root@test:/etc/openvpn/easy-rsa# cp vars vars.bak +``` + +接下来,编辑一下 vars 以让其中的信息符合你的状态。我将以我需要编辑的信息作为例子: + + +``` +KEY_SIZE=4096 +KEY_COUNTRY="US" +KEY_PROVINCE="CA" +KEY_CITY="Silicon Valley" +KEY_ORG="Linux Journal" +KEY_EMAIL="bill.childers@linuxjournal.com" +``` + +下一步是 source 一下 vars ,这样系统就能把其中的信息当作环境变量处理了: + + +``` +root@test:/etc/openvpn/easy-rsa# source ./vars +NOTE: If you run ./clean-all, I will be doing a + ↪rm -rf on /etc/openvpn/easy-rsa/keys + ``` + +### 搭建CA(证书签发) + + +接下来你要允许一下 `clean-all` 来确保有一个清理干净的系统工作环境,紧接着你也就要做证书签发了。注意一下我修改了一些 changeme 的跳出的交互提示内容以符合我需要的安装情况: + + +``` +root@test:/etc/openvpn/easy-rsa# ./clean-all +root@test:/etc/openvpn/easy-rsa# ./build-ca +Generating a 4096 bit RSA private key +...................................................++ +...................................................++ +writing new private key to 'ca.key' +----- +You are about to be asked to enter information that +will be incorporated into your certificate request. +What you are about to enter is what is called a +Distinguished Name or a DN. +There are quite a few fields but you can leave some +blank. For some fields there will be a default value, +If you enter '.', the field will be left blank. +----- +Country Name (2 letter code) [US]: +State or Province Name (full name) [CA]: +Locality Name (eg, city) [Silicon Valley]: +Organization Name (eg, company) [Linux Journal]: +Organizational Unit Name (eg, section) + ↪[changeme]:SecTeam +Common Name (eg, your name or your server's hostname) + ↪[changeme]:test.linuxjournal.com +Name [changeme]:test.linuxjournal.com +Email Address [bill.childers@linuxjournal.com]: +``` + + +### 生成服务端证书 + +一旦CA创建好了,你接着就可以生成客户端的 OpenVPN 证书了: + + +``` +root@test:/etc/openvpn/easy-rsa# + ↪./build-key-server test.linuxjournal.com +Generating a 4096 bit RSA private key +...................................................++ +writing new private key to 'test.linuxjournal.com.key' +----- +You are about to be asked to enter information that +will be incorporated into your certificate request. +What you are about to enter is what is called a +Distinguished Name or a DN. +There are quite a few fields but you can leave some +blank. For some fields there will be a default value, +If you enter '.', the field will be left blank. +----- +Country Name (2 letter code) [US]: +State or Province Name (full name) [CA]: +Locality Name (eg, city) [Silicon Valley]: +Organization Name (eg, company) [Linux Journal]: +Organizational Unit Name (eg, section) + ↪[changeme]:SecTeam +Common Name (eg, your name or your server's hostname) + ↪[test.linuxjournal.com]: +Name [changeme]:test.linuxjournal.com +Email Address [bill.childers@linuxjournal.com]: + +Please enter the following 'extra' attributes +to be sent with your certificate request +A challenge password []: +An optional company name []: +Using configuration from + ↪/etc/openvpn/easy-rsa/openssl-1.0.0.cnf +Check that the request matches the signature +Signature ok +The Subject's Distinguished Name is as follows +countryName :PRINTABLE:'US' +stateOrProvinceName :PRINTABLE:'CA' +localityName :PRINTABLE:'Silicon Valley' +organizationName :PRINTABLE:'Linux Journal' +organizationalUnitName:PRINTABLE:'SecTeam' +commonName :PRINTABLE:'test.linuxjournal.com' +name :PRINTABLE:'test.linuxjournal.com' +emailAddress + ↪:IA5STRING:'bill.childers@linuxjournal.com' +Certificate is to be certified until Sep 1 + ↪06:23:59 2025 GMT (3650 days) +Sign the certificate? [y/n]:y + +1 out of 1 certificate requests certified, commit? [y/n]y +Write out database with 1 new entries +Data Base Updated +``` + +下一步需要用掉一些时间来生成 OpenVPN 服务器需要的 Diffie-Hellman 密钥。这个步骤在一般的桌面级 CPU 上会需要几分钟的时间,但在 ARM 构架的树莓派上,会用掉超级超级长的时间。耐心点,只要终端上的点还在跳,那么一切就在按部就班运行: + + +``` +root@test:/etc/openvpn/easy-rsa# ./build-dh +Generating DH parameters, 4096 bit long safe prime, + ↪generator 2 +This is going to take a long time +....................................................+ + +``` + +### 生成客户端证书 + +现在你要生成一下客户端用于登陆 OpenVPN 的密钥。通常来说 OpenVPN 都会被配置成使用证书验证的加密方式,在这个配置下客户端需要持有由服务端签发的一份证书: + +``` +root@test:/etc/openvpn/easy-rsa# ./build-key + ↪bills-computer +Generating a 4096 bit RSA private key +...................................................++ +...................................................++ +writing new private key to 'bills-computer.key' +----- +You are about to be asked to enter information that +will be incorporated into your certificate request. +What you are about to enter is what is called a +Distinguished Name or a DN. There are quite a few +fields but you can leave some blank. +For some fields there will be a default value, +If you enter '.', the field will be left blank. +----- +Country Name (2 letter code) [US]: +State or Province Name (full name) [CA]: +Locality Name (eg, city) [Silicon Valley]: +Organization Name (eg, company) [Linux Journal]: +Organizational Unit Name (eg, section) + ↪[changeme]:SecTeam +Common Name (eg, your name or your server's hostname) + ↪[bills-computer]: +Name [changeme]:bills-computer +Email Address [bill.childers@linuxjournal.com]: + +Please enter the following 'extra' attributes +to be sent with your certificate request +A challenge password []: +An optional company name []: +Using configuration from + ↪/etc/openvpn/easy-rsa/openssl-1.0.0.cnf +Check that the request matches the signature +Signature ok +The Subject's Distinguished Name is as follows +countryName :PRINTABLE:'US' +stateOrProvinceName :PRINTABLE:'CA' +localityName :PRINTABLE:'Silicon Valley' +organizationName :PRINTABLE:'Linux Journal' +organizationalUnitName:PRINTABLE:'SecTeam' +commonName :PRINTABLE:'bills-computer' +name :PRINTABLE:'bills-computer' +emailAddress + ↪:IA5STRING:'bill.childers@linuxjournal.com' +Certificate is to be certified until + ↪Sep 1 07:35:07 2025 GMT (3650 days) +Sign the certificate? [y/n]:y + +1 out of 1 certificate requests certified, + ↪commit? [y/n]y +Write out database with 1 new entries +Data Base Updated +root@test:/etc/openvpn/easy-rsa# +``` + +现在你需要再生成一个 HMAC 代码作为共享密钥来进一步增加整个加密提供的安全性: + + +``` +root@test:~# openvpn --genkey --secret + ↪/etc/openvpn/easy-rsa/keys/ta.key +``` + +### 配置服务器 + +最后,你来到了需要配置 OpenVPN 服务的时候了。你需要创建一个 `/etc/openvpn/server.conf` 文件;这个配置文件的大多数地方都可以套用模板解决。设置 OpenVPN 服务的主要修改在于让它只用 TCP 而不是 UDP 链接。这是下一步所必需的---如果不是 TCP 链接那么你的服务将不能通过 端口443 运作。创建 `/etc/openvpn/server.conf` 然后把下述配置丢进去: + + +``` +port 1194 +proto tcp +dev tun +ca easy-rsa/keys/ca.crt +cert easy-rsa/keys/test.linuxjournal.com.crt ## or whatever + ↪your hostname was +key easy-rsa/keys/test.linuxjournal.com.key ## Hostname key + ↪- This file should be kept secret +management localhost 7505 +dh easy-rsa/keys/dh4096.pem +tls-auth /etc/openvpn/certs/ta.key 0 +server 10.8.0.0 255.255.255.0 # The server will use this + ↪subnet for clients connecting to it +ifconfig-pool-persist ipp.txt +push "redirect-gateway def1 bypass-dhcp" # Forces clients + ↪to redirect all traffic through the VPN +push "dhcp-option DNS 192.168.1.1" # Tells the client to + ↪use the DNS server at 192.168.1.1 for DNS - + ↪replace with the IP address of the OpenVPN + ↪machine and clients will use the BIND + ↪server setup earlier +keepalive 30 240 +comp-lzo # Enable compression +persist-key +persist-tun +status openvpn-status.log +verb 3 +``` + +最后,你将需要在服务器上启用 IP 转发,配置 OpenVPN 为开机启动并立刻启动 OpenVPN 服务: + + +``` +root@test:/etc/openvpn/easy-rsa/keys# echo + ↪"net.ipv4.ip_forward = 1" >> /etc/sysctl.conf +root@test:/etc/openvpn/easy-rsa/keys# sysctl -p + ↪/etc/sysctl.conf +net.core.wmem_max = 12582912 +net.core.rmem_max = 12582912 +net.ipv4.tcp_rmem = 10240 87380 12582912 +net.ipv4.tcp_wmem = 10240 87380 12582912 +net.core.wmem_max = 12582912 +net.core.rmem_max = 12582912 +net.ipv4.tcp_rmem = 10240 87380 12582912 +net.ipv4.tcp_wmem = 10240 87380 12582912 +net.core.wmem_max = 12582912 +net.core.rmem_max = 12582912 +net.ipv4.tcp_rmem = 10240 87380 12582912 +net.ipv4.tcp_wmem = 10240 87380 12582912 +net.ipv4.ip_forward = 0 +net.ipv4.ip_forward = 1 + +root@test:/etc/openvpn/easy-rsa/keys# update-rc.d + ↪openvpn defaults +update-rc.d: using dependency based boot sequencing + +root@test:/etc/openvpn/easy-rsa/keys# + ↪/etc/init.d/openvpn start +[ ok ] Starting virtual private network daemon:. +``` + +### 配置 OpenVPN 客户端 + + +客户端的安装取决于客户端的操作系统,但你总会需要之前生成的证书和密钥,并导入你的 OpenVPN 客户端并新建一个配置文件。每种操作系统下的 OpenVPN 客户端在操作上会有些稍许不同,这也不在这篇文章的覆盖范围内,所以你最好去看看特定操作系统下的 OpenVPN 文档来获取更多信息。参考文档里的 Resources 章节。 + +### 安装 SSLH —— "魔法"多协议工具 + +本文章介绍的解决方案最有趣的部分就是运用 SSLH 了。SSLH 是一个多重协议工具——它可以监听443端口的流量,然后分析他们是以SSH,HTTPS 还是 OpenVPN 的通讯包,并把他们分别转发给正确的系统服务。这就是为何本解决方案可以让你绕过大多数端口封杀——你可以一直使用HTTPS通讯,介于它几乎从来不会被封杀。 + +同样,直接 `apt-get` 安装: + + +``` +root@test:/etc/openvpn/easy-rsa/keys# apt-get + ↪install sslh +Reading package lists... Done +Building dependency tree +Reading state information... Done +The following extra packages will be installed: + apache2 apache2-mpm-worker apache2-utils + ↪apache2.2-bin apache2.2-common + libapr1 libaprutil1 libaprutil1-dbd-sqlite3 + ↪libaprutil1-ldap libconfig9 +Suggested packages: + apache2-doc apache2-suexec apache2-suexec-custom + ↪openbsd-inetd inet-superserver +The following NEW packages will be installed: + apache2 apache2-mpm-worker apache2-utils + ↪apache2.2-bin apache2.2-common + libapr1 libaprutil1 libaprutil1-dbd-sqlite3 + ↪libaprutil1-ldap libconfig9 sslh +0 upgraded, 11 newly installed, 0 to remove + ↪and 0 not upgraded. +Need to get 1,568 kB of archives. +After this operation, 5,822 kB of additional + ↪disk space will be used. +Do you want to continue [Y/n]? y +``` + +在 SSLH 被安装之后,包管理器会询问要在 inetd 还是 standalone 模式下允许。选择 standalone 模式,因为你希望 SSLH 在它自己的进程里运行。如果你没有安装 Apache,apt包管理器会自动帮你下载并安装的,尽管它也不是完全不可或缺。如果你已经有 Apache 了,那你需要确保它只监听 localhost 端口而不是所有的端口(不然的话 SSLH 会无法运行因为 443 端口已经被 Apache 监听占用)。安装后,你会看到一个如下所示的错误信息: + +``` +[....] Starting ssl/ssh multiplexer: sslhsslh disabled, + ↪please adjust the configuration to your needs +[FAIL] and then set RUN to 'yes' in /etc/default/sslh + ↪to enable it. ... failed! +failed! +``` + +这其实并不是错误信息,只是 SSLH 在提醒你它还未被配置所以无法启动,这很正常。配置 SSLH 相对来说比较简单。它的配置文件放置在 `/etc/default/sslh`,你只需要修改 `RUN` 和 `DAEMON_OPTS` 变量就可以了。我的 SSLH 配置文件如下所示: + +``` +# Default options for sslh initscript +# sourced by /etc/init.d/sslh + +# Disabled by default, to force yourself +# to read the configuration: +# - /usr/share/doc/sslh/README.Debian (quick start) +# - /usr/share/doc/sslh/README, at "Configuration" section +# - sslh(8) via "man sslh" for more configuration details. +# Once configuration ready, you *must* set RUN to yes here +# and try to start sslh (standalone mode only) + +RUN=yes + +# binary to use: forked (sslh) or single-thread + ↪(sslh-select) version +DAEMON=/usr/sbin/sslh + +DAEMON_OPTS="--user sslh --listen 0.0.0.0:443 --ssh + ↪127.0.0.1:22 --ssl 127.0.0.1:443 --openvpn + ↪127.0.0.1:1194 --pidfile /var/run/sslh/sslh.pid" + ``` + +保存编辑并启动 SSLH: + +``` + root@test:/etc/openvpn/easy-rsa/keys# + ↪/etc/init.d/sslh start +[ ok ] Starting ssl/ssh multiplexer: sslh. +``` + +现在你应该可以从 443 端口 ssh 到你的树莓派了,它会正确地使用 SSLH 转发: + +``` +$ ssh -p 443 root@test.linuxjournal.com +root@test:~# +``` + +SSLH 现在开始监听端口443 并且可以转发流量信息到 SSH,Apache 或者 OpenVPN 取决于抵达流量包的类型。这套系统现已整装待发了! + +### 结论 + +现在你可以启动 OpenVPN 并且配置你的客户端连接到服务器的 443 端口了,然后 SSLH 会从那里把流量转发到服务器的 1194 端口。但介于你正在和服务器的 443 端口通信,你的 VPN 流量不会被封锁。现在你可以舒服地坐在陌生小镇的咖啡店里,畅通无阻地通过树莓派上的 OpenVPN 浏览互联网。你顺便还给你的链接增加了一些安全性,这个额外作用也会让你的链接更安全和私密一些。享受通过安全跳板浏览互联网把! + + +资源: + +安装与配置 OpenVPN: [https://wiki.debian.org/OpenVPN](https://wiki.debian.org/OpenVPN) and [http://cryptotap.com/articles/openvpn](http://cryptotap.com/articles/openvpn) + +OpenVPN 客户端下载: [https://openvpn.net/index.php/open-source/downloads.html](https://openvpn.net/index.php/open-source/downloads.html) + +OpenVPN Client for iOS: [https://itunes.apple.com/us/app/openvpn-connect/id590379981?mt=8](https://itunes.apple.com/us/app/openvpn-connect/id590379981?mt=8) + +OpenVPN Client for Android: [https://play.google.com/store/apps/details?id=net.openvpn.openvpn&hl=en](https://play.google.com/store/apps/details?id=net.openvpn.openvpn&hl=en) + +Tunnelblick for Mac OS X (OpenVPN client): [https://tunnelblick.net](https://tunnelblick.net) + +SSLH 介绍: [http://www.rutschle.net/tech/sslh.shtml](http://www.rutschle.net/tech/sslh.shtml) 和 [https://github.com/yrutschle/sslh](https://github.com/yrutschle/sslh) + + +---------- +via: http://www.linuxjournal.com/content/securi-pi-using-raspberry-pi-secure-landing-point?page=0,0 + +作者:[Bill Childers][a] +译者:[jerryling315](https://blog.moelf.xyz) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linuxjournal.com/users/bill-childers From cef5325d283bd1d07df0fb65ede1b3bf0ffd94b9 Mon Sep 17 00:00:00 2001 From: J L Date: Mon, 20 Jun 2016 16:30:24 +0800 Subject: [PATCH 0945/1469] Delete 20151215 Securi-Pi--Using the Raspberry Pi as a Secure Landing Point.md --- ... Raspberry Pi as a Secure Landing Point.md | 497 ------------------ 1 file changed, 497 deletions(-) delete mode 100644 sources/tech/20151215 Securi-Pi--Using the Raspberry Pi as a Secure Landing Point.md diff --git a/sources/tech/20151215 Securi-Pi--Using the Raspberry Pi as a Secure Landing Point.md b/sources/tech/20151215 Securi-Pi--Using the Raspberry Pi as a Secure Landing Point.md deleted file mode 100644 index 36c28d25d6..0000000000 --- a/sources/tech/20151215 Securi-Pi--Using the Raspberry Pi as a Secure Landing Point.md +++ /dev/null @@ -1,497 +0,0 @@ -Securi-Pi: Using the Raspberry Pi as a Secure Landing Point -================================================================================ - -Like many LJ readers these days, I've been leading a bit of a techno-nomadic lifestyle as of the past few years—jumping from network to network, access point to access point, as I bounce around the real world while maintaining my connection to the Internet and other networks I use on a daily basis. As of late, I've found that more and more networks are starting to block outbound ports like SMTP (port 25), SSH (port 22) and others. It becomes really frustrating when you drop into a local coffee house expecting to be able to fire up your SSH client and get a few things done, and you can't, because the network's blocking you. - -However, I have yet to run across a network that blocks HTTPS outbound (port 443). After a bit of fiddling with a Raspberry Pi 2 I have at home, I was able to get a nice clean solution that lets me hit various services on the Raspberry Pi via port 443—allowing me to walk around blocked ports and hobbled networks so I can do the things I need to do. In a nutshell, I have set up this Raspberry Pi to act as an OpenVPN endpoint, SSH endpoint and Apache server—with all these services listening on port 443 so networks with restrictive policies aren't an issue. - -### Notes -This solution will work on most networks, but firewalls that do deep packet inspection on outbound traffic still can block traffic that's tunneled using this method. However, I haven't been on a network that does that...yet. Also, while I use a lot of cryptography-based solutions here (OpenVPN, HTTPS, SSH), I haven't done a strict security audit of this setup. DNS may leak information, for example, and there may be other things I haven't thought of. I'm not recommending this as a way to hide all your traffic—I just use this so that I can connect to the Internet in an unfettered way when I'm out and about. - -### Getting Started -Let's start off with what you need to put this solution together. I'm using this on a Raspberry Pi 2 at home, running the latest Raspbian, but this should work just fine on a Raspberry Pi Model B, as well. It fits within the 512MB of RAM footprint quite easily, although performance may be a bit slower, because the Raspberry Pi Model B has a single-core CPU as opposed to the Pi 2's quad-core. My Raspberry Pi 2 is behind my home's router/firewall, so I get the added benefit of being able to access my machines at home. This also means that any traffic I send to the Internet appears to come from my home router's IP address, so this isn't a solution designed to protect anonymity. If you don't have a Raspberry Pi, or don't want this running out of your home, it's entirely possible to run this out of a small cloud server too. Just make sure that the server's running Debian or Ubuntu, as these instructions are targeted at Debian-based distributions. - -![](http://www.linuxjournal.com/files/linuxjournal.com/ufiles/imagecache/large-550px-centered/u1002061/11913f1.jpg) - -Figure 1. The Raspberry Pi, about to become an encrypted network endpoint. - -### Installing and Configuring BIND -Once you have your platform up and running—whether it's a Raspberry Pi or otherwise—next you're going to install BIND, the nameserver that powers a lot of the Internet. You're going to install BIND as a caching nameserver only, and not have it service incoming requests from the Internet. Installing BIND will give you a DNS server to point your OpenVPN clients at, once you get to the OpenVPN step. Installing BIND is easy; it's just a simple `apt-get `command to install it: - -``` -root@test:~# apt-get install bind9 -Reading package lists... Done -Building dependency tree -Reading state information... Done -The following extra packages will be installed: - bind9utils -Suggested packages: - bind9-doc resolvconf ufw -The following NEW packages will be installed: - bind9 bind9utils -0 upgraded, 2 newly installed, 0 to remove and - ↪0 not upgraded. -Need to get 490 kB of archives. -After this operation, 1,128 kB of additional disk - ↪space will be used. -Do you want to continue [Y/n]? y -``` - -There are a couple minor configuration changes that need to be made to one of the config files of BIND before it can operate as a caching nameserver. Both changes are in `/etc/bind/named.conf.options`. First, you're going to uncomment the "forwarders" section of this file, and you're going to add a nameserver on the Internet to which to forward requests. In this case, I'm going to add Google's DNS (8.8.8.8). The "forwarders" section of the file should look like this: - -``` -forwarders { - 8.8.8.8; -}; -``` - -The second change you're going to make allows queries from your internal network and localhost. Simply add this line to the bottom of the configuration file, right before the `}`; that ends the file: - -``` -allow-query { 192.168.1.0/24; 127.0.0.0/16; }; -``` - -That line above allows this DNS server to be queried from the network it's on (in this case, my network behind my firewall) and localhost. Next, you just need to restart BIND: - -``` -root@test:~# /etc/init.d/bind9 restart -[....] Stopping domain name service...: bind9waiting - ↪for pid 13209 to die -. ok -[ ok ] Starting domain name service...: bind9. -``` - -Now you can test `nslookup` to make sure your server works: - -``` -root@test:~# nslookup -> server localhost -Default server: localhost -Address: 127.0.0.1#53 -> www.google.com -Server: localhost -Address: 127.0.0.1#53 - -Non-authoritative answer: -Name: www.google.com -Address: 173.194.33.176 -Name: www.google.com -Address: 173.194.33.177 -Name: www.google.com -Address: 173.194.33.178 -Name: www.google.com -Address: 173.194.33.179 -Name: www.google.com -Address: 173.194.33.180 -``` - -That's it! You've got a working nameserver on this machine. Next, let's move on to OpenVPN. - -### Installing and Configuring OpenVPN - -OpenVPN is an open-source VPN solution that relies on SSL/TLS for its key exchange. It's also easy to install and get working under Linux. Configuration of OpenVPN can be a bit daunting, but you're not going to deviate from the default configuration by much. To start, you're going to run an apt-get command and install OpenVPN: - -``` -root@test:~# apt-get install openvpn -Reading package lists... Done -Building dependency tree -Reading state information... Done -The following extra packages will be installed: - liblzo2-2 libpkcs11-helper1 -Suggested packages: - resolvconf -The following NEW packages will be installed: - liblzo2-2 libpkcs11-helper1 openvpn -0 upgraded, 3 newly installed, 0 to remove and - ↪0 not upgraded. -Need to get 621 kB of archives. -After this operation, 1,489 kB of additional disk - ↪space will be used. -Do you want to continue [Y/n]? y -``` - -Now that OpenVPN is installed, you're going to configure it. OpenVPN is SSL-based, and it relies on both server and client certificates to work. To generate these certificates, you need to configure a Certificate Authority (CA) on the machine. Luckily, OpenVPN ships with some wrapper scripts known as "easy-rsa" that help to bootstrap this process. You'll start by making a directory on the filesystem for the easy-rsa scripts to reside in and by copying the scripts from the template directory there: - -``` -root@test:~# mkdir /etc/openvpn/easy-rsa -root@test:~# cp -rpv - ↪/usr/share/doc/openvpn/examples/easy-rsa/2.0/* - ↪/etc/openvpn/easy-rsa/ - ``` - -Next, copy the vars file to a backup copy: - -``` -root@test:/etc/openvpn/easy-rsa# cp vars vars.bak -``` - -Now, edit vars so it's got information pertinent to your installation. I'm going specify only the lines that need to be edited, with sample data, below: - -``` -KEY_SIZE=4096 -KEY_COUNTRY="US" -KEY_PROVINCE="CA" -KEY_CITY="Silicon Valley" -KEY_ORG="Linux Journal" -KEY_EMAIL="bill.childers@linuxjournal.com" -``` - -The next step is to source the vars file, so that the environment variables in the file are in your current environment: - -``` -root@test:/etc/openvpn/easy-rsa# source ./vars -NOTE: If you run ./clean-all, I will be doing a - ↪rm -rf on /etc/openvpn/easy-rsa/keys - ``` - -### Building the Certificate Authority - -You're now going to run clean-all to ensure a clean working environment, and then you're going to build the CA. Note that I'm changing changeme prompts to something that's appropriate for this installation: - -``` -root@test:/etc/openvpn/easy-rsa# ./clean-all -root@test:/etc/openvpn/easy-rsa# ./build-ca -Generating a 4096 bit RSA private key -...................................................++ -...................................................++ -writing new private key to 'ca.key' ------ -You are about to be asked to enter information that -will be incorporated into your certificate request. -What you are about to enter is what is called a -Distinguished Name or a DN. -There are quite a few fields but you can leave some -blank. For some fields there will be a default value, -If you enter '.', the field will be left blank. ------ -Country Name (2 letter code) [US]: -State or Province Name (full name) [CA]: -Locality Name (eg, city) [Silicon Valley]: -Organization Name (eg, company) [Linux Journal]: -Organizational Unit Name (eg, section) - ↪[changeme]:SecTeam -Common Name (eg, your name or your server's hostname) - ↪[changeme]:test.linuxjournal.com -Name [changeme]:test.linuxjournal.com -Email Address [bill.childers@linuxjournal.com]: -``` - -### Building the Server Certificate - -Once the CA is created, you need to build the OpenVPN server certificate: - -```root@test:/etc/openvpn/easy-rsa# - ↪./build-key-server test.linuxjournal.com -Generating a 4096 bit RSA private key -...................................................++ -writing new private key to 'test.linuxjournal.com.key' ------ -You are about to be asked to enter information that -will be incorporated into your certificate request. -What you are about to enter is what is called a -Distinguished Name or a DN. -There are quite a few fields but you can leave some -blank. For some fields there will be a default value, -If you enter '.', the field will be left blank. ------ -Country Name (2 letter code) [US]: -State or Province Name (full name) [CA]: -Locality Name (eg, city) [Silicon Valley]: -Organization Name (eg, company) [Linux Journal]: -Organizational Unit Name (eg, section) - ↪[changeme]:SecTeam -Common Name (eg, your name or your server's hostname) - ↪[test.linuxjournal.com]: -Name [changeme]:test.linuxjournal.com -Email Address [bill.childers@linuxjournal.com]: - -Please enter the following 'extra' attributes -to be sent with your certificate request -A challenge password []: -An optional company name []: -Using configuration from - ↪/etc/openvpn/easy-rsa/openssl-1.0.0.cnf -Check that the request matches the signature -Signature ok -The Subject's Distinguished Name is as follows -countryName :PRINTABLE:'US' -stateOrProvinceName :PRINTABLE:'CA' -localityName :PRINTABLE:'Silicon Valley' -organizationName :PRINTABLE:'Linux Journal' -organizationalUnitName:PRINTABLE:'SecTeam' -commonName :PRINTABLE:'test.linuxjournal.com' -name :PRINTABLE:'test.linuxjournal.com' -emailAddress - ↪:IA5STRING:'bill.childers@linuxjournal.com' -Certificate is to be certified until Sep 1 - ↪06:23:59 2025 GMT (3650 days) -Sign the certificate? [y/n]:y - -1 out of 1 certificate requests certified, commit? [y/n]y -Write out database with 1 new entries -Data Base Updated -``` - -The next step may take a while—building the Diffie-Hellman key for the OpenVPN server. This takes several minutes on a conventional desktop-grade CPU, but on the ARM processor of the Raspberry Pi, it can take much, much longer. Have patience, as long as the dots in the terminal are proceeding, the system is building its Diffie-Hellman key (note that many dots are snipped in these examples): - -``` -root@test:/etc/openvpn/easy-rsa# ./build-dh -Generating DH parameters, 4096 bit long safe prime, - ↪generator 2 -This is going to take a long time -....................................................+ - -``` - -### Building the Client Certificate - -Now you're going to generate a client key for your client to use when logging in to the OpenVPN server. OpenVPN is typically configured for certificate-based auth, where the client presents a certificate that was issued by an approved Certificate Authority: - -``` -root@test:/etc/openvpn/easy-rsa# ./build-key - ↪bills-computer -Generating a 4096 bit RSA private key -...................................................++ -...................................................++ -writing new private key to 'bills-computer.key' ------ -You are about to be asked to enter information that -will be incorporated into your certificate request. -What you are about to enter is what is called a -Distinguished Name or a DN. There are quite a few -fields but you can leave some blank. -For some fields there will be a default value, -If you enter '.', the field will be left blank. ------ -Country Name (2 letter code) [US]: -State or Province Name (full name) [CA]: -Locality Name (eg, city) [Silicon Valley]: -Organization Name (eg, company) [Linux Journal]: -Organizational Unit Name (eg, section) - ↪[changeme]:SecTeam -Common Name (eg, your name or your server's hostname) - ↪[bills-computer]: -Name [changeme]:bills-computer -Email Address [bill.childers@linuxjournal.com]: - -Please enter the following 'extra' attributes -to be sent with your certificate request -A challenge password []: -An optional company name []: -Using configuration from - ↪/etc/openvpn/easy-rsa/openssl-1.0.0.cnf -Check that the request matches the signature -Signature ok -The Subject's Distinguished Name is as follows -countryName :PRINTABLE:'US' -stateOrProvinceName :PRINTABLE:'CA' -localityName :PRINTABLE:'Silicon Valley' -organizationName :PRINTABLE:'Linux Journal' -organizationalUnitName:PRINTABLE:'SecTeam' -commonName :PRINTABLE:'bills-computer' -name :PRINTABLE:'bills-computer' -emailAddress - ↪:IA5STRING:'bill.childers@linuxjournal.com' -Certificate is to be certified until - ↪Sep 1 07:35:07 2025 GMT (3650 days) -Sign the certificate? [y/n]:y - -1 out of 1 certificate requests certified, - ↪commit? [y/n]y -Write out database with 1 new entries -Data Base Updated -root@test:/etc/openvpn/easy-rsa# -``` - -Now you're going to generate an HMAC code as a shared key to increase the security of the system further: - -``` -root@test:~# openvpn --genkey --secret - ↪/etc/openvpn/easy-rsa/keys/ta.key -``` - -### Configuration of the Server - -Finally, you're going to get to the meat of configuring the OpenVPN server. You're going to create a new file, /etc/openvpn/server.conf, and you're going to stick to a default configuration for the most part. The main change you're going to do is to set up OpenVPN to use TCP rather than UDP. This is needed for the next major step to work—without OpenVPN using TCP for its network communication, you can't get things working on port 443. So, create a new file called /etc/openvpn/server.conf, and put the following configuration in it: Garrick, shrink below. - -``` -port 1194 -proto tcp -dev tun -ca easy-rsa/keys/ca.crt -cert easy-rsa/keys/test.linuxjournal.com.crt ## or whatever - ↪your hostname was -key easy-rsa/keys/test.linuxjournal.com.key ## Hostname key - ↪- This file should be kept secret -management localhost 7505 -dh easy-rsa/keys/dh4096.pem -tls-auth /etc/openvpn/certs/ta.key 0 -server 10.8.0.0 255.255.255.0 # The server will use this - ↪subnet for clients connecting to it -ifconfig-pool-persist ipp.txt -push "redirect-gateway def1 bypass-dhcp" # Forces clients - ↪to redirect all traffic through the VPN -push "dhcp-option DNS 192.168.1.1" # Tells the client to - ↪use the DNS server at 192.168.1.1 for DNS - - ↪replace with the IP address of the OpenVPN - ↪machine and clients will use the BIND - ↪server setup earlier -keepalive 30 240 -comp-lzo # Enable compression -persist-key -persist-tun -status openvpn-status.log -verb 3 -``` - -And last, you're going to enable IP forwarding on the server, configure OpenVPN to start on boot and start the OpenVPN service: - -``` -root@test:/etc/openvpn/easy-rsa/keys# echo - ↪"net.ipv4.ip_forward = 1" >> /etc/sysctl.conf -root@test:/etc/openvpn/easy-rsa/keys# sysctl -p - ↪/etc/sysctl.conf -net.core.wmem_max = 12582912 -net.core.rmem_max = 12582912 -net.ipv4.tcp_rmem = 10240 87380 12582912 -net.ipv4.tcp_wmem = 10240 87380 12582912 -net.core.wmem_max = 12582912 -net.core.rmem_max = 12582912 -net.ipv4.tcp_rmem = 10240 87380 12582912 -net.ipv4.tcp_wmem = 10240 87380 12582912 -net.core.wmem_max = 12582912 -net.core.rmem_max = 12582912 -net.ipv4.tcp_rmem = 10240 87380 12582912 -net.ipv4.tcp_wmem = 10240 87380 12582912 -net.ipv4.ip_forward = 0 -net.ipv4.ip_forward = 1 - -root@test:/etc/openvpn/easy-rsa/keys# update-rc.d - ↪openvpn defaults -update-rc.d: using dependency based boot sequencing - -root@test:/etc/openvpn/easy-rsa/keys# - ↪/etc/init.d/openvpn start -[ ok ] Starting virtual private network daemon:. -``` - -### Setting Up OpenVPN Clients - -Your client installation depends on the host OS of your client, but you'll need to copy your client certs and keys created above to your client, and you'll need to import those certificates and create a configuration for that client. Each client and client OS does it slightly differently and documenting each one is beyond the scope of this article, so you'll need to refer to the documentation for that client to get it running. Refer to the Resources section for OpenVPN clients for each major OS. - -### Installing SSLH—the "Magic" Protocol Multiplexer - -The really interesting piece of this solution is SSLH. SSLH is a protocol multiplexer—it listens on port 443 for traffic, and then it can analyze whether the incoming packet is an SSH packet, HTTPS or OpenVPN, and it can forward that packet onto the proper service. This is what enables this solution to bypass most port blocks—you use the HTTPS port for all of this traffic, since HTTPS is rarely blocked. - -To start, `apt-get` install SSLH: - -``` -root@test:/etc/openvpn/easy-rsa/keys# apt-get - ↪install sslh -Reading package lists... Done -Building dependency tree -Reading state information... Done -The following extra packages will be installed: - apache2 apache2-mpm-worker apache2-utils - ↪apache2.2-bin apache2.2-common - libapr1 libaprutil1 libaprutil1-dbd-sqlite3 - ↪libaprutil1-ldap libconfig9 -Suggested packages: - apache2-doc apache2-suexec apache2-suexec-custom - ↪openbsd-inetd inet-superserver -The following NEW packages will be installed: - apache2 apache2-mpm-worker apache2-utils - ↪apache2.2-bin apache2.2-common - libapr1 libaprutil1 libaprutil1-dbd-sqlite3 - ↪libaprutil1-ldap libconfig9 sslh -0 upgraded, 11 newly installed, 0 to remove - ↪and 0 not upgraded. -Need to get 1,568 kB of archives. -After this operation, 5,822 kB of additional - ↪disk space will be used. -Do you want to continue [Y/n]? y -``` - -After SSLH is installed, the package installer will ask you if you want to run it in inetd or standalone mode. Select standalone mode, because you want SSLH to run as its own process. If you don't have Apache installed, the Debian/Raspbian package of SSLH will pull it in automatically, although it's not strictly required. If you already have Apache running and configured, you'll want to make sure it only listens on localhost's interface and not all interfaces (otherwise, SSLH can't start because it can't bind to port 443). After installation, you'll receive an error that looks like this: - -``` -[....] Starting ssl/ssh multiplexer: sslhsslh disabled, - ↪please adjust the configuration to your needs -[FAIL] and then set RUN to 'yes' in /etc/default/sslh - ↪to enable it. ... failed! -failed! -``` - -This isn't an error, exactly—it's just SSLH telling you that it's not configured and can't start. Configuring SSLH is pretty simple. Its configuration is stored in `/etc/default/sslh`, and you just need to configure the `RUN` and `DAEMON_OPTS` variables. My SSLH configuration looks like this: - -``` -# Default options for sslh initscript -# sourced by /etc/init.d/sslh - -# Disabled by default, to force yourself -# to read the configuration: -# - /usr/share/doc/sslh/README.Debian (quick start) -# - /usr/share/doc/sslh/README, at "Configuration" section -# - sslh(8) via "man sslh" for more configuration details. -# Once configuration ready, you *must* set RUN to yes here -# and try to start sslh (standalone mode only) - -RUN=yes - -# binary to use: forked (sslh) or single-thread - ↪(sslh-select) version -DAEMON=/usr/sbin/sslh - -DAEMON_OPTS="--user sslh --listen 0.0.0.0:443 --ssh - ↪127.0.0.1:22 --ssl 127.0.0.1:443 --openvpn - ↪127.0.0.1:1194 --pidfile /var/run/sslh/sslh.pid" - ``` - - Save the file and start SSLH: - -``` - root@test:/etc/openvpn/easy-rsa/keys# - ↪/etc/init.d/sslh start -[ ok ] Starting ssl/ssh multiplexer: sslh. -``` - -Now, you should be able to ssh to port 443 on your Raspberry Pi, and have it forward via SSLH: - -``` -$ ssh -p 443 root@test.linuxjournal.com -root@test:~# -``` - -SSLH is now listening on port 443 and can direct traffic to SSH, Apache or OpenVPN based on the type of packet that hits it. You should be ready to go! - -### Conclusion - -Now you can fire up OpenVPN and set your OpenVPN client configuration to port 443, and SSLH will route it to the OpenVPN server on port 1194. But because you're talking to your server on port 443, your VPN traffic won't get blocked. Now you can land at a strange coffee shop, in a strange town, and know that your Internet will just work when you fire up your OpenVPN and point it at your Raspberry Pi. You'll also gain some encryption on your link, which will improve the privacy of your connection. Enjoy surfing the Net via your new landing point! - -Resources - -Installing and Configuring OpenVPN: [https://wiki.debian.org/OpenVPN](https://wiki.debian.org/OpenVPN) and [http://cryptotap.com/articles/openvpn](http://cryptotap.com/articles/openvpn) - -OpenVPN client downloads: [https://openvpn.net/index.php/open-source/downloads.html](https://openvpn.net/index.php/open-source/downloads.html) - -OpenVPN Client for iOS: [https://itunes.apple.com/us/app/openvpn-connect/id590379981?mt=8](https://itunes.apple.com/us/app/openvpn-connect/id590379981?mt=8) - -OpenVPN Client for Android: [https://play.google.com/store/apps/details?id=net.openvpn.openvpn&hl=en](https://play.google.com/store/apps/details?id=net.openvpn.openvpn&hl=en) - -Tunnelblick for Mac OS X (OpenVPN client): [https://tunnelblick.net](https://tunnelblick.net) - -SSLH—Protocol Multiplexer: [http://www.rutschle.net/tech/sslh.shtml](http://www.rutschle.net/tech/sslh.shtml) and [https://github.com/yrutschle/sslh](https://github.com/yrutschle/sslh) - - ----------- -via: http://www.linuxjournal.com/content/securi-pi-using-raspberry-pi-secure-landing-point?page=0,0 - -作者:[Bill Childers][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.linuxjournal.com/users/bill-childers - - From 6039c536d236e5271c420b7dd8f12ff2957935c0 Mon Sep 17 00:00:00 2001 From: Rubik Date: Tue, 21 Jun 2016 21:52:32 +0800 Subject: [PATCH 0946/1469] [Translating by HaohongWANG] --- sources/tech/20160616 6 Amazing Linux Distributions For Kids.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160616 6 Amazing Linux Distributions For Kids.md b/sources/tech/20160616 6 Amazing Linux Distributions For Kids.md index 5d0053e2ce..4d6ecdfd8f 100644 --- a/sources/tech/20160616 6 Amazing Linux Distributions For Kids.md +++ b/sources/tech/20160616 6 Amazing Linux Distributions For Kids.md @@ -1,3 +1,4 @@ +[HaohongWANG Translating] 6 Amazing Linux Distributions For Kids ====================================== From 81ee8887f1a3df866524897a3b918212d40bfb11 Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 22 Jun 2016 08:56:40 +0800 Subject: [PATCH 0947/1469] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 超期回收 @cposture --- ...cryption.md => 20160518 Python 3 - An Intro to Encryption.md} | 1 - 1 file changed, 1 deletion(-) rename sources/tech/{20160518 Python 3: An Intro to Encryption.md => 20160518 Python 3 - An Intro to Encryption.md} (99%) diff --git a/sources/tech/20160518 Python 3: An Intro to Encryption.md b/sources/tech/20160518 Python 3 - An Intro to Encryption.md similarity index 99% rename from sources/tech/20160518 Python 3: An Intro to Encryption.md rename to sources/tech/20160518 Python 3 - An Intro to Encryption.md index f80702a771..43c042d5c1 100644 --- a/sources/tech/20160518 Python 3: An Intro to Encryption.md +++ b/sources/tech/20160518 Python 3 - An Intro to Encryption.md @@ -1,4 +1,3 @@ -[Translating by cposture] Python 3: An Intro to Encryption =================================== From fdef562b72fc1af5bb2df00908a86e38c0ebc3cc Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 22 Jun 2016 09:37:00 +0800 Subject: [PATCH 0948/1469] =?UTF-8?q?20160622-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ndroid 4.4 port with Big Endian support.md | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 sources/tech/20160620 PowerPC gains an Android 4.4 port with Big Endian support.md diff --git a/sources/tech/20160620 PowerPC gains an Android 4.4 port with Big Endian support.md b/sources/tech/20160620 PowerPC gains an Android 4.4 port with Big Endian support.md new file mode 100644 index 0000000000..c803d30e6c --- /dev/null +++ b/sources/tech/20160620 PowerPC gains an Android 4.4 port with Big Endian support.md @@ -0,0 +1,108 @@ +PowerPC gains an Android 4.4 port with Big Endian support +=========================================================== + +eInfochips has ported Android 4.4 to the PowerPC architecture on behalf of an avionics customer that will use it for an HMI that monitors engine health. + +eInfochips has developed the first Android port to the PowerPC CPU architecture using a modern Android build and featuring Big Endian support. The port is based on Android Open Source Project (AOSP) code for Android 4.4 (KitKat) and features Kernel 3.12.19. + +Android emerged around the same time that PowerPC was already in decline and quickly losing market share to ARM. Customers with high-end networking and other enterprise-oriented embedded gear running on PowerPC processors such as Freescale’s PowerQUICC and QorIQ, instead depended on Linux. Several Android ports have been attempted, however. In 2009, Freescale and Embedded Alley — now part of the Linux team at Mentor Graphics — [announced a port][15] for PowerQUICC and QorIQ chips, which are now built by NXP. Another project claiming the same feat emerged called [Android-PowerPC][16]. + +Not much came of these efforts, however, and when an avionics firm asked eInfochips to look into an Android application for adding an improved HMI to its PowerPC-based engine monitoring system, the company found that these earlier ports were not up to par. They would have to start from scratch. + +The main problem with the previous ports was that they were for a much older, and very different, Android. Embedded Alley’s port was for Android 1.5 (Cupcake), released in 2009 and based on a Linux 2.6.28 kernel, and the last port from the Android-PowerPC project appears to be for Android 2.2 (Froyo), which was released in 2010 and based on Linux 2.6.32. The avionics customer also needed other technologies such as support for Big Endian, a legacy memory access scheme still used in the networking and telecom world. The other ports supported only Little Endian memory access. + + +### New PowerPC port from eInfochips + +eInfochips, which is known around here mostly for its ARM/Snapdragon-based boards such as the [Eragon 600][17] computer-on-module, has now completed the Android 4.4 QorIQ port and has posted a white paper describing the project. The avionics customer using the technology remains unnamed, however, and it’s unclear to what extent the port will be publicly shared. + + +![](http://hackerboards.com/files/einfochips_porting_android_on_powerpc-sm.jpg) +>Image from eInfochips blog post + +- The new PowerPC Android project includes: +- Bionic customization for PowerPC [e5500][1] +- Big Endian support in Android KitKat +- Tool chain development with GCC version 5.2 +- PowerPC support in Android 4.4 framework +- Android Kernel 3.12.19 for PowerPC e5500 + +According to eInfochips marketing manager, Sooryanarayanan Balasubramanian, the avionics customer wanted Android primarily for its familiar interface, which reduces training time, as well as the ease in updating the system with new applications. “By successful Android porting they can allow more modifications at the application layer without undergoing the tedious certification process at all layers,” explained Balasubramanian. “This was the first time any such attempt has been made in the aerospace industry, which requires due diligence in designs.” + +Porting Android to PowerPC required major modifications to the framework, core libraries, toolchain development, run-time linker, object linker, and open source compiler support, according to the white paper. When generating byte code, the porting team decided to use portable mode rather than fast interpreter mode. There is no fast interpreter available for Android on PowerPC, whereas portable mode uses the open source [libffi][18] for interpretation, which does support PowerPC. + +The team also needed to choose between Android Run Time (ART) and Dalvik Virtual Machine (DVM). They found that portable mode for ART was untested and poorly documented, so they went with DVM in portable mode. + +The white paper goes on to explain other challenges in the port, including developing a toolchain from scratch and rewriting scripts to overcome the problem of AOSP’s “non-standard” use of compiler flags. The finished port offers 37 services, and features a headless Android deployment along with an emulated UI in user space. + + +### Target hardware + +Thanks to an image (shown farther above) in an [eInfochips blog post][2] about the company’s Android PowerPC port, we were able to identify the project’s target hardware. The board turns out to be the [X-ES Xpedite 6101][3], which is a rugged XMC/PrPMC mezzanine module. + +Thanks to an image (shown farther above) in an eInfochips blog post about the company’s Android PowerPC port, we were able to identify the project’s target hardware. The board turns out to be the X-ES Xpedite 6101, which is a rugged XMC/PrPMC mezzanine module. + +![](http://hackerboards.com/files/xes_xpedite6101-sm.jpg) +>X-ES Xpedite 6101 photo and block diagram + +The X-ES Xpedite 6101 ships with a choice of NXP QorIQ-based T Series communications processors — the T2081, T1042, and T1022 — which integrate 8, 4, and 2 e6500 cores, respectively, running at up to 1.8GHz (T2081) or 1.4GHz (T1042/22). Each core integrates an AltiVec SIMD engine, said to offer DSP-level floating point performance. All three X-ES board models support up to 8GB of DDR3-1600 ECC SDRAM memory, plus up to 512MB of NOR and 32GB of NAND flash storage. + +![](http://hackerboards.com/files/nxp_qoriq_t2081_block-sm.jpg) +>NXP T2081 block diagram + +The board’s I/O includes a x4 PCI Express Gen2 channel, along with dual helpings of Gigabit Ethernet, RS232/422/485 serial, and SATA 3.0 ports. In addition to its choice of three QorIQ processors, the Xpedite 6101 is offered with support for three [X-ES ruggedization levels][19], rated for operation over 0 to 55°C, -40 to 70°C, or -40 to 85°C respectively, along with three categories of shock and vibration resistance. + +Other X-ES QorIQ-based XMC/PrPMC boards we’ve covered include the [XPedite6401 and XPedite6370][20], which are supported with off-the-shelf BSPs for Linux, Wind River VxWorks, and Green Hills Integrity. + + +### Further information + +The eInfochips Android PowerPC porting whitepaper is available for download [here][4] (requires free registration). + +### Related posts: + +- [Commercial embedded Linux distro boosts virtualization][5] +- [Freescale unveils first ARM-based QorIQ SoCs][6] +- [High-end boards run Linux on 64-bit ARM QorIQ SoCs][7] +- [Free, Open Enea Linux taps Yocto Project and Linaro code][8] +- [LynuxWorks reverts to its LynxOS roots, changes name][9] +- [First quad- and octa-core QorIQ SoCs unveiled][10] +- [Free white paper shows how Linux won embedded][11] +- [Quad-core Snapdragon COM offers three dev kit options][12] +- [Tiny COM runs Linux on quad-core 64-bit Snapdragon 410][13] +- [PowerPC based IoT gateway COM ships with Linux BSP][14] + + +-------------------------------------------------------------------------------- + +via: http://hackerboards.com/powerpc-gains-android-4-4-port-with-big-endian-support/ + +作者:[Eric Brown][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://hackerboards.com/powerpc-gains-android-4-4-port-with-big-endian-support/ +[1]: http://linuxdevices.linuxgizmos.com/low-cost-powerquicc-chips-offer-flexible-interconnect-options/ +[2]: https://www.einfochips.com/blog/k2-categories/aerospace/presenting-a-case-for-porting-android-on-powerpc-architecture.html +[3]: http://www.xes-inc.com/products/processor-mezzanines/xpedite6101/ +[4]: http://biz.einfochips.com/portingandroidonpowerpc +[5]: http://hackerboards.com/commercial-embedded-linux-distro-boosts-virtualization/ +[6]: http://hackerboards.com/freescale-unveils-first-arm-based-qoriq-socs/ +[7]: http://hackerboards.com/high-end-boards-run-linux-on-64-bit-arm-qoriq-socs/ +[8]: http://hackerboards.com/free-open-enea-linux-taps-yocto-and-linaro-code/ +[9]: http://hackerboards.com/lynuxworks-reverts-to-its-lynxos-roots-changes-name/ +[10]: http://hackerboards.com/first-quad-and-octa-core-qoriq-socs-unveiled/ +[11]: http://hackerboards.com/free-white-paper-shows-how-linux-won-embedded/ +[12]: http://hackerboards.com/quad-core-snapdragon-com-offers-three-dev-kit-options/ +[13]: http://hackerboards.com/tiny-com-runs-linux-and-android-on-quad-core-64-bit-snapdragon-410/ +[14]: http://hackerboards.com/powerpc-based-iot-gateway-com-ships-with-linux-bsp/ +[15]: http://linuxdevices.linuxgizmos.com/android-ported-to-powerpc/ +[16]: http://www.androidppc.com/ +[17]: http://hackerboards.com/quad-core-snapdragon-com-offers-three-dev-kit-options/ +[18]: https://sourceware.org/libffi/ +[19]: http://www.xes-inc.com/capabilities/ruggedization/ +[20]: http://hackerboards.com/high-end-boards-run-linux-on-64-bit-arm-qoriq-socs/ + + From 9d40f603877a387cb7249a18940323002466a0b0 Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 22 Jun 2016 09:52:26 +0800 Subject: [PATCH 0949/1469] =?UTF-8?q?20160622-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nux Networking Commands You Should Know.md | 145 ++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 sources/tech/20160621 Basic Linux Networking Commands You Should Know.md diff --git a/sources/tech/20160621 Basic Linux Networking Commands You Should Know.md b/sources/tech/20160621 Basic Linux Networking Commands You Should Know.md new file mode 100644 index 0000000000..56ecdb9664 --- /dev/null +++ b/sources/tech/20160621 Basic Linux Networking Commands You Should Know.md @@ -0,0 +1,145 @@ +Basic Linux Networking Commands You Should Know +================================================== + +![](https://itsfoss.com/wp-content/uploads/2016/06/Basic-Networking-Commands-Linux.jpg) + +Brief: A collection of most important and yet basic Linux networking commands an aspiring Linux SysAdmin and Linux enthusiasts must know. + +It’s not every day at It’s FOSS that we talk about the “command line side” of Linux. Basically, I focus more on the desktop side of Linux. But as some of you readers pointed out in the internal survey (exclusive for It’s FOSS newsletter subscribers), that you would like to learn some command line tricks as well. Cheat sheets were also liked and encouraged by most readers. + +For this purpose, I have compiled a list of the basic networking commands in Linux. It’s not a tutorial that teaches you how to use these commands, rather, it’s a collection of commands and their short explanation. So if you already have some experience with these commands, you can use it for quickly remembering the commands. + +You can bookmark this page for quick reference or even download all the commands in PDF for offline access. + +I had this list of Linux networking commands when I was a student of Communication System Engineering. It helped me to get the top score in Computer Networks course. I hope it helps you in the same way. + +>Exclusive bonus: [Download Linux Networking Commands Cheat Sheet][1] for future reference. You can print it or save it for offline viewing. + +### List of basic networking commands in Linux + +I used FreeBSD in the computer networking course but the UNIX commands should work the same in Linux also. + +#### Connectivity: + +- ping —- sends an ICMP echo message (one packet) to a host. This may go continually until you hit Control-C. Ping means a packet was sent from your machine via ICMP, and echoed at the IP level. ping tells you if the other Host is Up. + +- telnet host —- talk to “hosts” at the given port number. By default, the telnet port is port 23. Few other famous ports are: +``` + 7 – echo port, + 25 – SMTP, use to send mail + 79 – Finger, provides information on other users of the network +``` + +Use control-] to get out of telnet. + +#### Arp: + +Arp is used to translate IP addresses into Ethernet addresses. Root can add and delete arp entries. Deleting them can be useful if an arp entry is malformed or just wrong. Arp entries explicitly added by root are permanent — they can also be by proxy. The arp table is stored in the kernel and manipulated dynamically. Arp entries are cached and will time out and are deleted normally in 20 minutes. + +- arp –a : Prints the arp table +- arp –s [pub] to add an entry in the table +- arp –a –d to delete all the entries in the ARP table + +#### Routing: + +- netstat –r —- Print routing tables. The routing tables are stored in the kernel and used by ip to route packets to non-local networks. +- route add —- The route command is used for setting a static (non-dynamic by hand route) route path in the route tables. All the traffic from this PC to that IP/SubNet will go through the given Gateway IP. It can also be used for setting a default route; i.e., send all packets to a particular gateway, by using 0.0.0.0 in the pace of IP/SubNet. +- routed —– The BSD daemon that does dynamic routing. Started at boot. This runs the RIP routing protocol. ROOT ONLY. You won’t be able to run this without root access. +- gated —– Gated is an alternative routing daemon to RIP. It uses the OSPF, EGP, and RIP protocols in one place. ROOT ONLY. +- traceroute —- Useful for tracing the route of IP packets. The packet causes messages to be sent back from all gateways in between the source and destination by increasing the number of hopes by 1 each time. +- netstat –rnf inet : it displays the routing tables of IPv4 +- sysctl net.inet.ip.forwarding=1 : to enable packets forwarding (to turn a host into a router) +- route add|delete [-net|-host] (ex. route add 192.168.20.0/24 192.168.30.4) to add a route +- route flush : it removes all the routes +- route add -net 0.0.0.0 192.168.10.2 : to add a default route +- routed -Pripv2 –Pno_rdisc –d [-s|-q] to execute routed daemon with RIPv2 protocol, without ICMP auto-discovery, in foreground, in supply or in quiet mode +- route add 224.0.0.0/4 127.0.0.1 : it defines the route used from RIPv2 +- rtquery –n : to query the RIP daemon on a specific host (manually update the routing table) + +#### Others: + +- nslookup —- Makes queries to the DNS server to translate IP to a name, or vice versa. eg. nslookup facebook.com will gives you the IP of facebook.com +- ftp water —– Transfer files to host. Often can use login=“anonymous” , p/w=“guest” +- rlogin -l —– Logs into the host with a virtual terminal like telnet + +#### Important Files: + +``` +/etc/hosts —- names to ip addresses +/etc/networks —- network names to ip addresses +/etc/protocols —– protocol names to protocol numbers +/etc/services —- tcp/udp service names to port numbers +``` + +#### Tools and network performance analysis + +- ifconfig
[up] : start the interface +- ifconfig [down|delete] : stop the interface +- ethereal & : it allows you open ethereal background not foreground +- tcpdump –i -vvv : tool to capture and analyze packets +- netstat –w [seconds] –I [interface] : display network settings and statistics +- udpmt –p [port] –s [bytes] target_host : it creates UDP traffic +- udptarget –p [port] : it’s able to receive UDP traffic +- tcpmt –p [port] –s [bytes] target_host : it creates TCP traffic +- tcptarget –p [port] it’s able to receive TCP traffic +- ifconfig netmask [up] : it allows to subnet the sub-networks + + + +#### Switching: + +- ifconfig sl0 srcIP dstIP : configure a serial interface (do “slattach –l /dev/ttyd0” before, and “sysctl net.inet.ip.forwarding=1“ after) +- telnet 192.168.0.254 : to access the switch from a host in its subnetwork +- sh ru or show running-configuration : to see the current configurations +- configure terminal : to enter in configuration mode +- exit : in order to go to the lower configuration mode + +#### VLAN: + +- vlan n : it creates a VLAN with ID n +- no vlan N : it deletes the VLAN with ID N +- untagged Y : it adds the port Y to the VLAN N +- ifconfig vlan0 create : it creates vlan0 interface +- ifconfig vlan0 vlan ID vlandev em0 : it associates vlan0 interface on top of em0, and set the tags to ID +- ifconfig vlan0 [up] : to turn on the virtual interface +- tagged Y : it adds to the port Y the support of tagged frames for the current VLAN + +#### UDP/TCP + +- socklab udp – it executes socklab with udp protocol +- sock – it creates a udp socket, it’s equivalent to type sock udp and bind +- sendto – emission of data packets +- recvfrom – it receives data from socket +- socklab tcp – it executes socklab with tcp protocol +- passive – it creates a socket in passive mode, it’s equivalent to socklab, sock tcp, bind, listen +- accept – it accepts an incoming connection (it can be done before or after creating the incoming connection) +- connect – these two commands are equivalent to socklab, sock tcp, bind, connect +- close – it closes the connection +- read – to read bytes on the socket +- write (ex. write ciao, ex. write #10) to write “ciao” or to write 10 bytes on the socket + +#### NAT/Firewall + +- rm /etc/resolv.conf – it prevent address resolution and make sure your filtering and firewall rules works properly +- ipnat –f file_name – it writes filtering rules into file_name +- ipnat –l – it gives the list of active rules +- ipnat –C –F – it re-initialize the rules table +- map em0 192.168.1.0/24 -> 195.221.227.57/32 em0 : mapping IP addresses to the interface +- map em0 192.168.1.0/24 -> 195.221.227.57/32 portmap tcp/udp 20000:50000 : mapping with port +- ipf –f file_name : it writes filtering rules into file_name +- ipf –F –a : it resets the rule table +- ipfstat –I : it grants access to a few information on filtered packets, as well as active filtering rules + + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/basic-linux-networking-commands/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 + +作者:[Abhishek Prakash][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[1]: https://drive.google.com/open?id=0By49_3Av9sT1cDdaZnh4cHB4aEk From 2ebc5a38e9201294ed2fd5bb79e344f44681fc6f Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 22 Jun 2016 09:57:28 +0800 Subject: [PATCH 0950/1469] =?UTF-8?q?20160622-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...meet the IT needs of today and tomorrow.md | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 sources/talk/20160620 Training vs. hiring to meet the IT needs of today and tomorrow.md diff --git a/sources/talk/20160620 Training vs. hiring to meet the IT needs of today and tomorrow.md b/sources/talk/20160620 Training vs. hiring to meet the IT needs of today and tomorrow.md new file mode 100644 index 0000000000..e4d511c5bd --- /dev/null +++ b/sources/talk/20160620 Training vs. hiring to meet the IT needs of today and tomorrow.md @@ -0,0 +1,62 @@ +Training vs. hiring to meet the IT needs of today and tomorrow +================================================================ + +![](https://enterprisersproject.com/sites/default/files/styles/620x350/public/images/cio_talent_4.png?itok=QLhyS_Xf) + +In the digital era, IT skills requirements are in a constant state of flux thanks to the constant change of the tools and technologies companies need to keep pace. It’s not easy for companies to find and hire talent with coveted skills that will enable them to innovate. Meanwhile, training internal staff to take on new skills and challenges takes time that is often in short supply. + +[Sandy Hill][1] is quite familiar with the various skills required across a variety of IT disciplines. As the director of IT for [Pegasystems][2], she is responsible for IT teams involved in areas ranging from application development to data center operations. What’s more, Pegasystems develops applications to help sales, marketing, service and operations teams streamline operations and connect with customers, which means she has to grasp the best way to use IT resources internally, and the IT challenges the company’s customers face. + +![](https://enterprisersproject.com/sites/default/files/CIO_Q%20and%20A_0.png) + +**The Enterprisers Project (TEP): How has the emphasis you put on training changed in recent years?** + +**Hill**: We’ve been growing exponentially over the past couple of years so now we’re implementing more global processes and procedures. With that comes the training aspect of making sure everybody is on the same page. + +Most of our focus has shifted to training staff on new products and tools that get implemented to drive innovation and enhance end user productivity. For example, we’ve implemented an asset management system; we didn’t have one before. So we had to do training globally instead of hiring someone who already knew the product. As we’re growing, we’re also trying to maintain a tight budget and flat headcount. So we’d rather internally train than try to hire new people. + +**TEP: Describe your approach to training. What are some of the ways you help employees evolve their skills?** + +**Hill**: I require each staff member to have a technical and non-technical training goal, which are tracked and reported on as part of their performance review. Their technical goal needs to align within their job function, and the non-technical goal can be anything from focusing on sharpening one of their soft skills to learning something outside of their area of expertise. I perform yearly staff evaluations to see where the gaps and shortages are so that teams remain well-rounded. + +**TEP: To what extent have your training initiatives helped quell recruitment and retention issues?** + +**Hill**: Keeping our staff excited about learning new technologies keeps their skill sets sharp. Having the staff know that we value them, and we are vested in their professional growth and development motivates them. + +**TEP: What sorts of training have you found to be most effective?** + +**Hill**: We use several different training methods that we’ve found to be effective. With new or special projects, we try to incorporate a training curriculum led by the vendor as part of the project rollout. If that’s not an option, we use off-site training. We also purchase on-line training packages, and I encourage my staff to attend at least one conference per year to keep up with what’s new in the industry. + +**TEP**: For what sorts of skills have you found it’s better to hire new people than train existing staff? + +**Hill**: It depends on the project. In one recent initiative, trying to implement OpenStack, we didn’t have internal expertise at all. So we aligned with a consulting firm that specialized in that area. We utilized their expertise on-site to help run the project and train internal team members. It was a massive undertaking to get internal people to learn the skills they needed while also doing their day-to-day jobs. + +The consultant helped us determine the headcount we needed to be proficient. This allowed us to assess our staff to see if gaps remained, which would require additional training or hiring. And we did end up hiring some of the contractors. But the alternative was to send some number of FTEs (full-time employees) for 6 to 8 weeks of training, and our pipeline of projects wouldn’t allow that. + +**TEP: In thinking about some of your most recent hires, what skills did they have that are especially attractive to you?** + +**Hill**: In recent hires, I’ve focused on soft skills. In addition to having solid technical skills, they need to be able to communicate effectively, work in teams and have the ability to persuade, negotiate and resolve conflicts. + +IT people in general kind of keep to themselves; they’re often not the most social people. Now, where IT is more integrated throughout the organization, the ability to give useful updates and status reports to other business units is critical to show that IT is an active presence and to be successful. + + + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/firewall/pfsense-setup-basic-configuration/ + +作者:[ Paul Desmond][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://enterprisersproject.com/user/paul-desmond +[1]: https://enterprisersproject.com/user/sandy-hill +[2]: https://www.pega.com/pega-can?&utm_source=google&utm_medium=cpc&utm_campaign=900.US.Evaluate&utm_term=pegasystems&gloc=9009726&utm_content=smAXuLA4U|pcrid|102822102849|pkw|pegasystems|pmt|e|pdv|c| + + + + + + From 47c03d6c30b7396500cff84efd075c59edaa6d75 Mon Sep 17 00:00:00 2001 From: Kevin Sicong Jiang Date: Tue, 21 Jun 2016 22:01:54 -0500 Subject: [PATCH 0951/1469] Update and rename sources/tech/20160511 An introduction to data processing with Cassandra and Spark.md to translated/tech/20160511 An introduction to data processing with Cassandra and Spark.md --- ...ata processing with Cassandra and Spark.md | 51 ------------------- ...ata processing with Cassandra and Spark.md | 49 ++++++++++++++++++ 2 files changed, 49 insertions(+), 51 deletions(-) delete mode 100644 sources/tech/20160511 An introduction to data processing with Cassandra and Spark.md create mode 100644 translated/tech/20160511 An introduction to data processing with Cassandra and Spark.md diff --git a/sources/tech/20160511 An introduction to data processing with Cassandra and Spark.md b/sources/tech/20160511 An introduction to data processing with Cassandra and Spark.md deleted file mode 100644 index 46331a9ae5..0000000000 --- a/sources/tech/20160511 An introduction to data processing with Cassandra and Spark.md +++ /dev/null @@ -1,51 +0,0 @@ -Translating KevinSJ -An introduction to data processing with Cassandra and Spark -============================================================== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/osdc_520x292_opendata_0613mm.png?itok=mzC0Tb28) - - -There's been a huge surge of interest around the Apache Cassandra database due to the increasing uptime and performance demands of modern cloud applications. - -So, what is Apache Cassandra? A distributed OLTP database built for high availability and linear scalability. When people ask what Cassandra is used for, think about the type of system you want close to the customer. This is ultimately the system that our users interact with. Applications that must always be available: product catalogs, IoT, medical systems, and mobile applications. In these categories downtime can mean loss of revenue or even more dire outcomes depending on your specific use case. Netflix was one of the earliest adopters of this project, which was open sourced in 2008, and their contributions, along with successes, put it on the radar of the masses. - -Cassandra became a top level Apache Software Foundation project in 2010 and has been riding the wave in popularity since then. Now even knowledge in Cassandra gets you serious returns in the job market. It's both crazy and awesome to consider a NoSQL and open source technology could perform this sort of disruption next to the giants of enterprise SQL. This begs the question, what makes it so popular? - -Cassandra has the ability to be always on in spite of massive hardware and network failures by utilizing a design first widely discussed in [the Dynamo paper from Amazon][1]. By using a peer to peer model, with no single point of failure, we can survive rack failure and even complete network partitions. We can deal with an entire data center failure without impacting our customer's experience. A distributed system that plans for failure is a properly planned distributed system, because frankly, failures are just going to happen. With Cassandra, we accept that cruel fact of life, and bake it into the database's architecture and functionality. - -We know what you’re thinking, "But, I’m coming from a relational background, isn't this going to be a daunting transition?" The answer is somewhat yes and no. Data modeling with Cassandra will feel familiar to developers coming from the relational world. We use tables to model our data, and CQL, the Cassandra Query Language, to query the database. However, unlike SQL, Cassandra supports more complex data structures such as nested and user defined types. For instance, instead of creating a dedicated table to store likes on a cat photo, we can store that data in a collection with the photo itself enabling faster, sequential lookups. That's expressed very naturally in CQL. In our photo table we may want to track the name, URL, and the people that liked the photo. - -![](https://opensource.com/sites/default/files/resize/screen_shot_2016-05-06_at_7.17.33_am-350x198.png) - -In a high performance system milliseconds matter for both user experience and for customer retention. Expensive JOIN operations limit our ability to scale out by adding unpredictable network calls. By denormalizing our data so it can be fetched in as few requests as possible, we profit from the trend of decreasing costs in disk space and in return get predictable, high performance applications. We embrace the concept of denormalization with Cassandra because it offers a pretty appealing tradeoff. - -We're obviously not just limited to storing likes on cat photos. Cassandra is a optimized for high write throughput. This makes it the perfect solution for big data applications where we’re constantly ingesting data. Time series and IoT use cases are growing at a steady rate in both demand and appearance in the market, and we're continuously finding ways to utilize the data we collect to improve our technological application. - -This brings us to the next step, we've talked about storing our data in a modern, cost-effective fashion, but how do we get even more horsepower? Meaning, once we've collected all that data, what do we do with it? How can we analyze hundreds of terabytes efficiently? How can we react to information we're receiving in real-time, making decisions in seconds rather than hours? Enter Apache Spark. - -Spark is the next step in the evolution of big data processing. Hadoop and MapReduce were revolutionary projects, giving the big data world an opportunity to crunch all the data we've collected. Spark takes our big data analysis to the next level by drastically improving performance and massively decreasing code complexity. Through Spark, we can perform massive batch processing calculations, react quickly to stream processing, make smart decisions through machine learning, and understand complex, recursive relationships through graph traversals. It’s not just about offering your customers a fast and reliable connection to their application (which is what Cassandra offers), it's also about being able to leverage insights from the data Cassandra stores to make more intelligent business decisions and better cater to customer needs. - -You can check out the [Spark-Cassandra Connector][2] (open source) and give it a shot. To learn more about both technologies, we highly recommend the free self-paced courses on [DataStax Academy][3]. - -Have fun digging in and learning some killer new technology! If you want to learn more, check out our [OSCON tutorial][4], with a hands on exploration into the worlds of both Cassandra and Spark. - -We also love taking questions on Twitter, so give us a shout and we’ll try to help: [Dani][5] and [Jon][6]. - --------------------------------------------------------------------------------- - -via: https://opensource.com/life/16/5/basics-cassandra-and-spark-data-processing - -作者:[Jon Haddad][a],[Dani Traphagen][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://twitter.com/rustyrazorblade -[b]: https://opensource.com/users/dtrapezoid -[1]: http://www.allthingsdistributed.com/files/amazon-dynamo-sosp2007.pdf -[2]: https://github.com/datastax/spark-cassandra-connector -[3]: https://academy.datastax.com/ -[4]: http://conferences.oreilly.com/oscon/open-source-us/public/schedule/detail/49162 -[5]: https://twitter.com/dtrapezoid -[6]: https://twitter.com/rustyrazorblade diff --git a/translated/tech/20160511 An introduction to data processing with Cassandra and Spark.md b/translated/tech/20160511 An introduction to data processing with Cassandra and Spark.md new file mode 100644 index 0000000000..0786996e39 --- /dev/null +++ b/translated/tech/20160511 An introduction to data processing with Cassandra and Spark.md @@ -0,0 +1,49 @@ +Cassandra 和 Spark 数据处理入门 +============================================================== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/osdc_520x292_opendata_0613mm.png?itok=mzC0Tb28) + +Apache Cassandra 数据库近来引起了很多的兴趣,这主要源于现代云端软件对于可用性及性能方面的要求。 + +那么,Apache Cassandra 是什么?它是一种为高可用性及线性可扩展性优化的分布式的联机交易处理 (OLTP) 数据库。当人们想知道 Cassandra 的用途时,可以想想你想要的离客户近的系统。这j最终是我们的用户进行交互的系统。需要保证实时可用的程序:产品目录,IoT,医疗系统,以及移动应用。对这些程序而言,下线时间意味着利润降低甚至导致其他更坏的结果。Netfilix 是这个于2008年开源的项目的早期使用者,他们对此项目的贡献以及带来的成功让这个项目名声大噪。 + +Cassandra 于2010年成为了 Apache 软件基金会的顶级项目,在这之后就开始变得流行。现在,只要你有 Cassadra 的相关知识,找工作时就能轻松不少。光是想想一个 NoSQL 语言和开源技术能达到如此企业级 SQL 的高度就觉得这是十分疯狂而又不可思议的。这引出了一个问题。是什么让它如此的流行? + +因为采用了首先在[亚马逊发表的 Dynamo 论文][1]提出的设计,Cassandra 有能力在大规模的硬件及网络故障时保持实时在线。由于采用了点对点模式,在没有单点故障的情况下,我们能幸免于机架故障甚至完全网络分区。我们能在不影响用户体验的前提下处理数据中心故障。一个能考虑到故障的分布式系统才是一个没有后顾之忧的分布式系统,因为老实说,故障是迟早会发生的。有了 Cassandra, 我们可疑直面残酷的生活并将之融入数据库的结构和功能中。 + + + +我们能猜到你现在在想什么,“但我只有关系数据库相关背景,难道这样的转变不会很困难吗?"这问题的答案介于是和不是之间。使用 Cassandra 建立数据模型对有关系数据库背景的开发者而言是轻车熟路。我们使用表格来建立数据模型,并使用 CQL 或者 Cassandra 查询语言来查询数据库。然而,与 SQL 不同的是,Cassandra 支持更加复杂的数据结构,例如多重和用户自定义类型。举个例子,当要储存对一个小猫照片的点赞数目时,我们可以将整个数据储存在一个包含照片本身的集合之中从而获得更快的顺序查找而不是建立一个独立的表。这样的表述在 CQL 中十分的自然。在我们照片表中,我们需要记录名字,URL以及给此照片点赞过的人。 + +![](https://opensource.com/sites/default/files/resize/screen_shot_2016-05-06_at_7.17.33_am-350x198.png) + +在一个高性能系统中,毫秒对用户体验和客户保留都能产生影响。昂贵的 JOIN 制约了我们通过增加不可预见的网络调用而扩容的能力。当我们将数据反规范化使其能在尽可能少的请求中被获取到时,我们即可从磁盘空间花费的降低中获益并获得可预测的,高性能应用。我们将反规范化同 Cassandra 一同介绍是因为它提供了很有吸引力的的折衷方案。 + +很明显,我们不会局限于对于小猫照片的点赞数量。Canssandra 是一款个为并发高写入优化的方案。这使其成为需要时常吞吐数据的大数据应用的理想解决方案。市场上的时序和 IoT 的使用场景正在以稳定的速度在需求和亮相方面增加,我们也在不断探寻优化我们所收集到的数据以求提升我们的技术应用(注:这句翻的非常别扭,求校队) + + +这就引出了我们的下一步,我们已经提到了如何以一种现代的,性价比高的方式储存数据,但我们应该如何获得更多的马力呢?具体而言,当我们收集到了所需的数据,我们应该怎样处理呢?如何才能有效的分析几百 TB 的数据呢?如何才能在实时的对我们所收集到的信息进行反馈并在几秒而不是几小时的时间利作出决策呢?Apache Spark 将给我们答案。 + + +Spark 是大数据变革中的下一步。 Hadoop 和 MapReduce 都是革命性的产品,他们让大数据界获得了分析所有我们所取得的数据的机会。Spark 对性能的大幅提升及对代码复杂度的大幅降低则将大数据分析提升到了另一个高度。通过 Spark,我们能大批量的处理计算,对流处理进行快速反映,通过机器学习作出决策并理解通过对图的遍历理解复杂的递归关系。这并非只是为你的客户提供与快捷可靠的应用程序连接(Cassandra 已经提供了这样的功能),这更是能一探 Canssandra 所储存的数据并作出更加合理的商业决策同时更好地满足客户需求。 + +你可以看看 [Spark-Cassandra Connector][2] (open source) 并动手试试。若想了解更多关于这两种技术的信息,我们强烈推荐名为 [DataStax Academy][3] 的自学课程 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/16/5/basics-cassandra-and-spark-data-processing + +作者:[Jon Haddad][a],[Dani Traphagen][b] +译者:[KevinSJ](https://github.com/KevinSJ) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://twitter.com/rustyrazorblade +[b]: https://opensource.com/users/dtrapezoid +[1]: http://www.allthingsdistributed.com/files/amazon-dynamo-sosp2007.pdf +[2]: https://github.com/datastax/spark-cassandra-connector +[3]: https://academy.datastax.com/ +[4]: http://conferences.oreilly.com/oscon/open-source-us/public/schedule/detail/49162 +[5]: https://twitter.com/dtrapezoid +[6]: https://twitter.com/rustyrazorblade From d9d76e817d11d83608cca1ff3441c0cfe66d089a Mon Sep 17 00:00:00 2001 From: "Cathon.ZHD" Date: Wed, 22 Jun 2016 13:17:16 +0800 Subject: [PATCH 0952/1469] Cathon translating --- ... 65% of companies are contributing to open source projects.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/talk/20160510 65% of companies are contributing to open source projects.md b/sources/talk/20160510 65% of companies are contributing to open source projects.md index ad3b4ef680..886c3399b9 100644 --- a/sources/talk/20160510 65% of companies are contributing to open source projects.md +++ b/sources/talk/20160510 65% of companies are contributing to open source projects.md @@ -1,5 +1,6 @@ 65% of companies are contributing to open source projects ========================================================== +[Cathon is translating...] ![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BUSINESS_openseries.png?itok=s7lXChId) From 86af7681a2e4f155230abe16b3a677091010457f Mon Sep 17 00:00:00 2001 From: J L Date: Wed, 22 Jun 2016 13:48:56 +0800 Subject: [PATCH 0953/1469] =?UTF-8?q?[Translating]=20Mark=20Shuttleworth?= =?UTF-8?q?=20=E2=80=93=20The=20Man=20Behind=20Ubuntu=20Operating=20System?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...-The Man Behind Ubuntu Operating System.md | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/sources/talk/20151023 Mark Shuttleworth--The Man Behind Ubuntu Operating System.md b/sources/talk/20151023 Mark Shuttleworth--The Man Behind Ubuntu Operating System.md index 3390c232ac..508b68c176 100644 --- a/sources/talk/20151023 Mark Shuttleworth--The Man Behind Ubuntu Operating System.md +++ b/sources/talk/20151023 Mark Shuttleworth--The Man Behind Ubuntu Operating System.md @@ -1,3 +1,5 @@ +Translating by [jerryling315](https://github.com/jerryling315) + Mark Shuttleworth – The Man Behind Ubuntu Operating System ================================================================================ ![](http://1426826955.rsc.cdn77.org/wp-content/uploads/2015/10/Mark-Shuttleworth-652x445.jpg) @@ -9,7 +11,7 @@ Mark also founded **Thawte** in 1996, the Internet commerce security company, wh In 2000, Mark founded the HBD, as an investment company, and also he created the Shuttleworth Foundation in order to fund the innovative leaders in the society with combination of fellowships and some investments. > “The mobile world is crucial to the future of the PC. This month, for example, it became clear that the traditional PC is shrinking in favor of tablets. So if we want to be relevant on the PC, we have to figure out how to be relevant in the mobile world first. Mobile is also interesting because there’s no pirated Windows market. So if you win a device to your OS, it stays on your OS. In the PC world, we are constantly competing with “free Windows”, which presents somewhat unique challenges. So our focus now is to establish a great story around Ubuntu and mobile form factors – the tablet and the phone – on which we can build deeper relationships with everyday consumers.” -> +> > — Mark Shuttleworth In 2002, he flew to International Space Station as member of their crew of Soyuz mission TM-34, after 1 year of training in the Star City, Russia. And after running campaign to promote the science, code, and mathematics to the aspiring astronauts and the other ambitious types at schools in SA, Mark founded the **Canonical Ltd**. and in 2013, he provided leadership for Ubuntu operating system for software development purposes. @@ -17,7 +19,7 @@ In 2002, he flew to International Space Station as member of their crew of Soyuz Today, Shuttleworth holds dual citizenship of United Kingdom and South Africa currently lives on lovely Mallards botanical garden in Isle of Man, with 18 precocious ducks, equally his lovely girlfriend Claire, 2 black bitches and occasional itinerant sheep. > “Computer is not a device anymore. It is an extension of your mind and your gateway to other people.” -> +> > — Mark Shuttleworth ### Mark Shuttleworth’s Early life ### @@ -27,7 +29,7 @@ As we mentioned above, Mark was born in Welkom, South Africa’s Orange Free Sta Mark obtained the Bachelor of Business Science degree in the Finance and Information Systems at University of Cape Town, where he lived there in Smuts Hall. He became, as a student, involved in installations of the 1st residential Internet connections at his university. > “There are many examples of companies and countries that have improved their competitiveness and efficiency by adopting open source strategies. The creation of skills through all levels is of fundamental importance to both companies and countries.” -> +> > — Mark Shuttleworth ### Mark Shuttleworth’s Career ### @@ -37,7 +39,7 @@ Mark founded Thawte in 1995, which was specialized in the digital certificates a In 2000, Mark formed the HBD Venture Capital (Here be Dragons), the business incubator and venture capital provider. In 2004, he formed the Canonical Ltd., for promotion and commercial support of the free software development projects, especially Ubuntu operating system. In 2009, Mark stepped down as CEO of Canonical, Ltd. > “In the early days of the DCC I preferred to let the proponents do their thing and then see how it all worked out in the end. Now we are pretty close to the end.” -> +> > — Mark Shuttleworth ### Linux and FOSS with Mark Shuttleworth ### @@ -51,7 +53,7 @@ In 2004, Mark returned to free software world by funding software development of In 2005, Mark founded Ubuntu Foundation and made initial investment of 10 million dollars. In Ubuntu project, Mark is often referred to with tongue-in-cheek title “**SABDFL (Self-Appointed Benevolent Dictator for Life)**”. To come up with list of names of people in order to hire for the entire project, Mark took about six months of Debian mailing list archives with him during his travelling to Antarctica aboard icebreaker Kapitan Khlebnikov in 2004. In 2005, Mark purchased 65% stake of Impi Linux. > “I urge telecommunications regulators to develop a commercial strategy for delivering effective access to the continent.” -> +> > — Mark Shuttleworth In 2006, it was announced that Shuttleworth became **first patron of KDE**, which was highest level of sponsorship available at the time. This patronship ended in 2012, with financial support together for Kubuntu, which was Ubuntu variant with KDE as a main desktop. @@ -67,7 +69,7 @@ In 2012, Mark and Kenneth Rogoff took part together in debate opposite Peter Thi In 2013, Mark and Ubuntu were awarded **Austrian anti-privacy Big Brother Award** for sending the local Ubuntu Unity Dash searches to the Canonical servers by default. One year earlier in 2012, Mark had defended the anonymization method that was used. > “All the major PC companies now ship PC’s with Ubuntu pre-installed. So we have a very solid set of working engagements in the industry. But those PC companies are nervous to promote something new to PC buyers. If we can get PC buyers familiar with Ubuntu as a phone and tablet experience, then they may be more willing buy it on the PC too. Because no OS ever succeeded by emulating another OS. Android is great, but if we want to succeed we need to bring something new and better to market. We are all at risk of stagnating if we don’t pursue the future, vigorously. But if you pursue the future, you have to accept that not everybody will agree with your vision.” -> +> > — Mark Shuttleworth ### Mark Shuttleworth’s Spaceflight ### @@ -81,7 +83,7 @@ While in space, Mark had radio conversation with Nelson Mandela and another 14 y Upon returning, Mark traveled widely and also spoke about that spaceflight to schoolchildren around the world. > “The raw numbers suggest that Ubuntu continues to grow in terms of actual users. And our partnerships – Dell, HP, Lenovo on the hardware front, and gaming companies like EA, Valve joining up on the software front – make me feel like we continue to lead where it matters.” -> +> > — Mark Shuttleworth ### Mark Shuttleworth’s Transport ### @@ -93,7 +95,7 @@ Mark has his private jet, Bombardier Global Express that is often referred to as Upon the moving R2.5 billion in the capital from South Africa to Isle of Man, South African Reserve Bank imposed R250 million levy to release Mark’s assets. Mark appealed, and then after lengthy legal battle, Reserve Bank was ordered to repay Mark his R250 million, plus the interest. Mark announced that he would be donating that entire amount to trust that will be established in order to help others take cases to Constitutional Court. > “The exit charge was not inconsistent with the Constitution. The dominant purpose of the exit charge was not to raise revenue but rather to regulate conduct by discouraging the export of capital to protect the domestic economy.” -> +> > — Judge Dikgang Moseneke In 2015, Constitutional Court of South Africa reversed and set-aside findings of lower courts, ruling that dominant purpose of the exit charge was in order to regulate conduct rather than for raising the revenue. @@ -116,4 +118,4 @@ via: http://www.unixmen.com/mark-shuttleworth-man-behind-ubuntu-operating-system 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://www.unixmen.com/author/pirat9/ \ No newline at end of file +[a]:http://www.unixmen.com/author/pirat9/ From 9476fe9f90229ad9480bc98e0659d09f8ea401e6 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 22 Jun 2016 23:31:14 +0800 Subject: [PATCH 0954/1469] =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=89=A9=E5=B1=95?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @jerryling315 --- ...ecuri-Pi--Using the Raspberry Pi as a Secure Landing Point.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename translated/tech/{20151215 Securi-Pi--Using the Raspberry Pi as a Secure Landing Point => 20151215 Securi-Pi--Using the Raspberry Pi as a Secure Landing Point.md} (100%) diff --git a/translated/tech/20151215 Securi-Pi--Using the Raspberry Pi as a Secure Landing Point b/translated/tech/20151215 Securi-Pi--Using the Raspberry Pi as a Secure Landing Point.md similarity index 100% rename from translated/tech/20151215 Securi-Pi--Using the Raspberry Pi as a Secure Landing Point rename to translated/tech/20151215 Securi-Pi--Using the Raspberry Pi as a Secure Landing Point.md From 5694ee51483375e8c837caaba8d9eb85b986ed65 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 23 Jun 2016 06:58:23 +0800 Subject: [PATCH 0955/1469] PUB:20160228 Two Outstanding All-in-One Linux Servers @wyangsun --- ...wo Outstanding All-in-One Linux Servers.md | 97 +++++++++++++++++ ...wo Outstanding All-in-One Linux Servers.md | 103 ------------------ 2 files changed, 97 insertions(+), 103 deletions(-) create mode 100644 published/20160228 Two Outstanding All-in-One Linux Servers.md delete mode 100644 translated/tech/20160228 Two Outstanding All-in-One Linux Servers.md diff --git a/published/20160228 Two Outstanding All-in-One Linux Servers.md b/published/20160228 Two Outstanding All-in-One Linux Servers.md new file mode 100644 index 0000000000..48370eca23 --- /dev/null +++ b/published/20160228 Two Outstanding All-in-One Linux Servers.md @@ -0,0 +1,97 @@ +两个出色的一体化 Linux 服务器软件 +================================================ + +回到2000年那时,微软发布小型商务服务器(SBS:Small Business Server)。这个产品改变了很多人们对科技在商务领域的看法。你可以部署一个单独的服务器,它能处理邮件,日历,文件共享,目录服务,VPN,以及更多,而不是很多机器处理不同的任务。对很多小型公司来说,这是实实在在的好处,但是对于一些公司来说 Windows SMB 是昂贵的。对于另外一些人,根本不会考虑使用这种微软设计的单一服务器的想法。 + +对于后者也有替代方案。事实上,在 Linux 和开源领域里,你可以选择许多稳定的平台,它可以作为一站式服务商店服务于你的小型企业。如果你的小型企业有10到50员工,一体化服务器也许是你所需的理想方案。 + +这里,我将要展示两个 Linux 一体化服务器,你可以看看它们哪个能完美适用于你的公司。 + +记住,这些服务器不适用于(不管是哪种方式)大型商务或企业。大公司无法依靠一体化服务器,那是因为一台服务器不能负担得起企业所需的期望。也就是说,Linux 一体化服务器适合于小型企业。 + +### ClearOS + +[ClearOS][1] 最初发布于 2009 年,那时名为 ClarkConnect,是一个路由和网关的发行版。从那以后,ClearOS 增加了所有一体化服务器必要的特性。CearOS 提供的不仅仅是一个软件,你可以购买一个 [ClearBox 100][2] 或 [ClearBox 300][3]。这些服务器搭载了完整的 ClearOS,作为一个 IT 设备被销售。在[这里][4]查看特性比对/价格矩阵。 + +如果你已经有响应的硬件,你可以下载这些之一: + +- [ClearOS 社区版][5] — 社区(免费)版的 ClearOS +- [ClearOS 家庭版][6] — 理想的家庭办公室(详细的功能和订阅费用,见[这里][12]) +- [ClearOS商务][7] — 理想的小型企业(详细的功能和订阅费用,见[这里][13]) + +使用 ClearOS 能给你你带来什么?你得到了一个商业级的服务器,带有单一的精美 Web 界面。是什么让 ClearOS 从标准的服务器所提供的一大堆功能中脱颖而出?除了那些基础的部分,你可以从 [Clear 市场][8] 中增加功能。在这个市场里,你可以安装免费或付费的应用来扩展 ClearOS 服务器的特性。这里你可以找到支持 Windows 服务器活动目录,OpenLDAP,Flexshares,Antimalware,云,Web 访问控制,内容过滤等等很多的补充插件。你甚至可以找到一些第三方组件,比如谷歌应用同步,Zarafa 合作平台,卡巴斯基杀毒。 + +ClearOS 的安装就像其他的 Linux 发行版一样(基于红帽的 Anaconda 安装程序)。安装完成后,系统将提示您设置网络接口,这个地址用来供你的浏览器(需要与 ClearOS 服务器在同一个网络里)访问。地址格式如下: + + https://IP_OF_CLEAROS_SERVER:81 + +IP_OF_CLEAROS_SERVER 就是服务器的真实 IP 地址。注:当你第一次在浏览器访问这个服务器时,你将收到一个“Connection is not private”的警告。继续访问,以便你可以继续设置。 + +当浏览器最终连接上之后,就会提示你 root 用户认证(在初始化安装中你设置的 root 用户密码)。一通过认证,你将看到 ClearOS 的安装向导(图1) + +![](http://www.linux.com/images/stories/66866/jack-clear_a.png) + +*图1: ClearOS安装向导。* + +点击下一步按钮,开始设置你的 ClearOS 服务器。这个向导无需加以说明,在最后还会问你想用那个版本的 ClearOS。点击“社区”,“家庭”,或者“商业”。选择之后,你就被要求注册一个账户。创建了一个账户并注册了你的服务器后,你可以开始更新服务器,配置服务器,从市场添加模块(图2)。 + +![](http://www.linux.com/images/stories/66866/jack-clear_b.png) + +*图2: 从市场安装模块。* + +此时,一切准备就绪,可以开始深入挖掘配置你的 ClearOS 小型商务服务器了。 + +### Zentyal + +[Zentyal][10] 是一个基于 Ubuntu 的小型商务服务器,有段时期的名字是 eBox。Zentyal 提供了大量的服务器/服务来适应你的小型商务需求: + +- 电子邮件 — 网页邮件;支持原生的微软 Exchange 协议和活动目录;日历和通讯录;手机设备电子邮件同步;反病毒/反垃圾;IMAP,POP,SMTP,CalDAV,和 CardDAV 支持。 +- 域和目录 — 中央域目录管理;多个组织部门;单点登录身份验证;文件共享;ACL,高级域管理,打印机管理。 +- 网络和防火墙 — 支持静态和 DHCP 接口;对象和服务;包过滤;端口转发。 +- 基础设施 — DNS;DHCP;NTP;认证中心;VPN。 +- 防火墙 + +安装 Zentyal 很像Ubuntu服务器的安装,基于文本界面而且很简单:从安装镜像启动,做一些简单的选择,然后等待安装完成。当这个最初的基于文本的安装完成之后,就会显示桌面 GUI,提供选择软件包的向导程序。你可以选择所有你想安装的包,让安装程序继续完成这些工作。 + +最终,你可以通过网页界面来访问 Zentyal 服务器(浏览器访问 https://IP_OF_SERVER:8443 - 这里 IP_OF_SERVER是你的 Zentyal 服务器的局域网地址)或使用独立的桌面 GUI 程序来管理服务器(Zentyal 包括一个可以快速访问管理员和用户控制台的 Zentyal 管理控制台)。当真系统已经保存并启动,你将看到 Zentyal 面板(图3)。 + +![](http://www.linux.com/images/stories/66866/jack-zentyal_a.png) + +*图3: Zentyal活动面板。* + +这个面板允许你控制服务器所有方面,比如更新,管理服务器/服务,获取服务器的敏捷状态更新。您也可以进入组件区域,然后安装在部署过程中没有选择的组件或更新当前的软件包列表。点击“软件管理” > “系统更新”并选择你想更新的(图4),然后在屏幕最底端点击“更新”按钮。 + +![](http://www.linux.com/images/stories/66866/jack-zentyal_b.png) + +*图4: 更新你的Zentyal服务器很简单。* + +### 那个服务器适合你? + +回答这个问题要看你有什么需求。Zentyal 是一个不可思议的服务器,它可以很好的胜任你的小型商务网络。如果你需要更多,如群件,我觉得你可以试试 ClearOS。如果你不需要群件,其它的服务器也不错。 + +我强烈建议你安装一下这两个一体化的服务器,看看哪个更适合你的小公司。 + +------------------------------------------------------------------------------ + +via: http://www.linux.com/learn/tutorials/882146-two-outstanding-all-in-one-linux-servers + +作者:[Jack Wallen][a] +译者:[wyangsun](https://github.com/wyangsun) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.linux.com/community/forums/person/93 +[1]: http://www.linux.com/learn/tutorials/882146-two-outstanding-all-in-one-linux-servers#clearfoundation-overview +[2]: https://www.clearos.com/products/hardware/clearbox-100-series +[3]: https://www.clearos.com/products/hardware/clearbox-300-series +[4]: https://www.clearos.com/products/hardware/clearbox-overview +[5]: http://mirror.clearos.com/clearos/7/iso/x86_64/ClearOS-DVD-x86_64.iso +[6]: http://mirror.clearos.com/clearos/7/iso/x86_64/ClearOS-DVD-x86_64.iso +[7]: http://mirror.clearos.com/clearos/7/iso/x86_64/ClearOS-DVD-x86_64.iso +[8]: https://www.clearos.com/products/purchase/clearos-marketplace-overview +[9]: https://ip_of_clearos_server:81/ +[10]: http://www.zentyal.org/server/ +[11]: https://ip_of_server:8443/ +[12]: https://www.clearos.com/products/clearos-editions/clearos-7-home +[13]: https://www.clearos.com/products/clearos-editions/clearos-7-business diff --git a/translated/tech/20160228 Two Outstanding All-in-One Linux Servers.md b/translated/tech/20160228 Two Outstanding All-in-One Linux Servers.md deleted file mode 100644 index a60b23aea1..0000000000 --- a/translated/tech/20160228 Two Outstanding All-in-One Linux Servers.md +++ /dev/null @@ -1,103 +0,0 @@ -两个杰出的一体化Linux服务器 -================================================ - -关键词:Linux服务器,SMB,clearos,Zentyal - -![](http://www.linux.com/images/stories/66866/jack-clear_a.png) - ->图1: ClearOS安装向导。 - -回到2000年,微软发布小型商务服务器。这个产品改变了很多人们对科技在商务领域的看法。你可以部署一个单独的服务器,它能处理邮件,日历,文件共享,目录服务,VPN,以及更多,而不是很多机器处理不同的任务。对很多小型商务来说,这是非常好的恩惠,但是Windows SMB的一些花费是昂贵的。对于其他人,微软设计的依赖于一个服务器的想法,根本不是一个选项。 - -对于最近的用户群,有些替代品。事实上,在Linux和开源领域里,你可以选择许多稳定的平台,它可以作为一站式服务商店服务于你的小型企业。如果你的小型企业有10到50员工,一体化服务器也许是你所需的理想方案。 - -这里,我将要看看两个Linux一体化服务器,所以你可以查看他们哪个能完美适用于你的公司。 - -记住,这些服务器不能,以任何方式,适用于大型商务或企业。大公司无法依靠一体化服务器,仅仅是因为一台服务器不能负荷在企业内所需的企望。除此之外,这就是小型企业可以从Linux一体化服务器期待什么。 - -### ClearOS - -[ClearOS][1]是在2009年在ClarkConnect下发行的,作为一个路由和网关的分支。从那以后,ClearOS已经增加了所有一体化服务器必要的特性。CearOS提供的不仅仅是一个软件。你可以购买一个[ClearBox 100][2] 或[ClearBox 300][3]。这些服务器搭载完整的ClearOS作为一个IT设备被销售。在[这里][4]查看特性比对/价格矩阵。 - -家里已经有这些硬件,你可以下载这些之一: - -- [ClearOS社区][5] — 社区(免费)版的ClearOS - -- [ClearOS家庭][6] — 理想的家庭办公室(详细的功能和订阅费用,见这里) - -- [ClearOS商务][7] — 理想的小型商务(详细的功能和订阅费用,见这里) - -使用ClearOS你得到了什么?你得到了一个单机的业务合作服务器,设计精美的网页。ClearOS独特的是什么?你可以在基础服务中得到很多特性。除了这个,你必须从 [Clear Marketplace][8]增加特性。在市场上,你可以安装免费或付费的应用程序,扩展集的ClearOS服务器的特性。这里你可以找到附加的Windows服务器活动目录,OpenLDAP,Flexshares,Antimalware,云,Web访问控制,内容过滤,还有更多。你甚至可以找到一些第三方组件像谷歌应用同步,Zarafa合作平台,卡巴斯基杀毒。 - -ClearOS的安装像其他Linux发行版(基于红帽的Anaconda安装程序)。安装完成后,系统将提示您设置网络接口就是提供你浏览器访问的地址(与ClearOS服务器在同一个网络里)。地址格式如下: - -[https://IP_OF_CLEAROS_SERVER:81][9] - -IP_OF_CLEAROS_SERVER就是服务器的真实IP地址。注:当你第一次在浏览器访问这个服务器时,你将收到一个“Connection is not private”的警告。继续访问这个地址你才能继续设置。 - -当浏览器连接上,就会提示你root用户认证(在初始化安装中你设置的root用户密码)。一通过认证,你将看到ClearOS的安装向导(上图1) - -点击下一步按钮,开始设置你的ClearOS服务器。这个向导无需加以说明,在最后还会问你想用那个版本的ClearOS。点击社区,家庭,或者商业。一旦选择,你就需要注册一个账户。创建了一个账户注册了服务器后,你可以开始更新服务器,配置服务器,从市场添加模块(图2)。 - -![](http://www.linux.com/images/stories/66866/jack-clear_b.png) - ->图2: 从市场安装模块。 - -此时,你已经准备开始深入挖掘配置你的ClearOS小型商务服务器了。 - -### Zentyal - -[Zentyal][10]是一个基于Ubuntu的小型商务服务器,现在,发布在eBox域名下。Zentyal提供了大量的服务器/服务来适应你的小型商务需求: - -- 电子邮件 — 网页邮件;原生微软邮件协议和活动目录支持;日历和通讯录;手机设备电子邮件同步;反病毒/反垃圾;IMAP,POP,SMTP,CalDAV,和CardDAV支持。 - -- 域和目录 — 核心域目录管理;多个组织单元;单点登录身份验证;文件共享;ACLs,高级域名管理,打印机管理。 - -- 网络和防火墙 — 静态和DHCP接口;对象和服务;包过滤;端口转发。 - -- 基础设施 — DNS;DHCP;NTP;认证中心;VPN。 - -- 防火墙 - -安装Zentyal很像Ubuntu服务器的文本安装而且很简单:启动安装镜像,做一些选择,等待安装完成。一旦初始化,完成基于文本安装,就提供给你桌面GUI,向导程序提供选择包。选择所有你想安装的包,让安装程序完成这些工作。 - -最终,你可以通过网页接口来访问Zentyal服务器(浏览器访问[https://IP_OF_SERVER:8443][11] - IP_OF_SERVER是Zentyal服务器的内网地址)或使用独立的桌面GUI来管理服务器(Zentyal包括快速访问管理员和用户控制台就像Zentyal管理控制台)。当全部系统已经保存开启,你将看到Zentyal面板(图3)。 - -![](http://www.linux.com/images/stories/66866/jack-zentyal_a.png) - ->图3: Zentyal活动面板. - -这个面板允许你控制服务器所有方面,比如更新,管理服务器/服务,获取服务器的敏捷状态更新。您也可以进入组件领域,然后安装部署过程中选择出来的组件或更新当前的软件包列表。点击 软件管理 > 系统更新 并选择你想更新的(图4),然后在屏幕最底端点击更新按钮。 - -![](http://www.linux.com/images/stories/66866/jack-zentyal_b.png) - ->图4: 更新你的Zentyal服务器很简单。 - -### 那个服务器适合你? - -回答这个问题要看你有什么需求。Zentyal是一个不可思议的服务器,它很好的胜任于你的小型商务网络中。如果你需要更多,如组合软件,你最好赌在ClearOS上。如果你不需要组合软件,任意的服务器将表现杰出的工作。 - -我强烈建议安装这两个一体化的服务器,看看哪个是你的小公司所需的最好服务。 - ------------------------------------------------------------------------------- - -via: http://www.linux.com/learn/tutorials/882146-two-outstanding-all-in-one-linux-servers - -作者:[Jack Wallen][a] -译者:[wyangsun](https://github.com/wyangsun) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://www.linux.com/community/forums/person/93 -[1]: http://www.linux.com/learn/tutorials/882146-two-outstanding-all-in-one-linux-servers#clearfoundation-overview -[2]: https://www.clearos.com/products/hardware/clearbox-100-series -[3]: https://www.clearos.com/products/hardware/clearbox-300-series -[4]: https://www.clearos.com/products/hardware/clearbox-overview -[5]: http://mirror.clearos.com/clearos/7/iso/x86_64/ClearOS-DVD-x86_64.iso -[6]: http://mirror.clearos.com/clearos/7/iso/x86_64/ClearOS-DVD-x86_64.iso -[7]: http://mirror.clearos.com/clearos/7/iso/x86_64/ClearOS-DVD-x86_64.iso -[8]: https://www.clearos.com/products/purchase/clearos-marketplace-overview -[9]: https://ip_of_clearos_server:81/ -[10]: http://www.zentyal.org/server/ -[11]: https://ip_of_server:8443/ From c05b87e7f064fa12657a1aaa7957ad33506a0c7b Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 23 Jun 2016 07:27:11 +0800 Subject: [PATCH 0956/1469] PUB:20160513 How to Set Up 2-Factor Authentication for Login and sudo @ictlyh --- ...actor Authentication for Login and sudo.md | 67 +++++++------------ 1 file changed, 26 insertions(+), 41 deletions(-) rename {translated/tech => published}/20160513 How to Set Up 2-Factor Authentication for Login and sudo.md (53%) diff --git a/translated/tech/20160513 How to Set Up 2-Factor Authentication for Login and sudo.md b/published/20160513 How to Set Up 2-Factor Authentication for Login and sudo.md similarity index 53% rename from translated/tech/20160513 How to Set Up 2-Factor Authentication for Login and sudo.md rename to published/20160513 How to Set Up 2-Factor Authentication for Login and sudo.md index 1ed524c4d4..12012c9045 100644 --- a/translated/tech/20160513 How to Set Up 2-Factor Authentication for Login and sudo.md +++ b/published/20160513 How to Set Up 2-Factor Authentication for Login and sudo.md @@ -1,12 +1,11 @@ -如何为登录和 sudo 设置双重认证 +如何为登录和 sudo 设置双因子认证 ========================================================== ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/auth_crop.png?itok=z_cdYZZf) ->[Used with permission][1] -安全就是一切。我们生活的当今世界,数据具有令人难以置信的价值,而你也一直处于数据丢失的风险之中。因此,你必须想尽办法保证你桌面系统和服务器中东西的安全。结果,管理员和用户就会创建极其复杂的密码、使用密码管理器甚至其它更复杂的东西。但是,如果我告诉你你可以只需要一步-至多两步就能登录到你的 Linux 服务器或桌面系统中呢?多亏了 [Google Authenticator][2],现在你可以做到了。在这之上配置也极其简单。 +安全就是一切。我们生活的当今世界,数据具有令人难以置信的价值,而你也一直处于数据丢失的风险之中。因此,你必须想尽办法保证你桌面系统和服务器中数据的安全。结果,管理员和用户就会创建极其复杂的密码、使用密码管理器甚至其它更复杂的东西。但是,如果我告诉你你可以只需要一步,至多两步就能登录到你的 Linux 服务器或桌面系统中呢?多亏了 [Google 身份验证器][2],现在你可以做到了。并且,配置也极其简单。 -我会给你简要介绍为登录和 sudo 设值双重认证的步骤。我基于 Ubuntu 16.04 桌面系统进行介绍,但这些步骤也适用于其它服务器。为了做到双重认证,我会使用 Google Authenticator。 +我会给你简要介绍为登录和 sudo 设置双因子认证的步骤。我基于 Ubuntu 16.04 桌面系统进行介绍,但这些步骤也适用于其它服务器。为了实现双因子认证,我会使用 Google 身份验证器。 这里有个非常重要的警告:一旦你设置了认证,没有一个从认证器中获得的由 6 个数字组成的验证码你就不可能登录账户(或者执行 sudo 命令)。这也给你增加了一步额外的操作,因此如果你不想每次登录到 Linux 服务器(或者使用 sudo)的时候都要拿出你的智能手机,这个方案就不适合你。但你也要记住,这额外的一个步骤也给你带来一层其它方法无法给予的保护。 @@ -14,38 +13,28 @@ ### 安装必要的组件 -安装 Google 认证,首先要解决两个问题。一是安装智能机应用。下面是如何从 Google 应用商店安装的方法: +安装 Google 身份验证器(Google Authenticator),首先要解决两个问题。一是安装智能机应用。下面是如何从 Google 应用商店安装的方法: 1. 在你的安卓设备中打开 Google 应用商店 - -2. 搜索 google 认证 - -3. 找到并点击有 Google 标识的应用 - +2. 搜索 google 身份验证器 +3. 找到并点击有 Google Inc. 标识的应用 4. 点击安装 - -5. 点击 接受 - +5. 点击“接受” 6. 等待安装完成 -接下来,我们继续在你的 Linux 机器上安装认证。步骤如下: +接下来,我们继续在你的 Linux 机器上安装这个认证器。步骤如下: 1. 打开一个终端窗口 - 2. 输入命令 sudo apt-get install google-authenticator - 3. 输入你的 sudo 密码并敲击回车 - 4. 如果有弹窗提示,输入 y 并敲击回车 - 5. 等待安装完成 接下来配置使用 google-authenticator 进行登录。 ### 配置 -要为登录和 sudo 添加两阶段认证只需要编辑一个文件。也就是 /etc/pam.d/common-auth。打开并找到如下一行: -Just one file must be edited to add two-step authentication for both login and sudo usage. The file is /etc/pam.d/common-auth. Open it and look for the line +要为登录和 sudo 添加双因子认证只需要编辑一个文件,即 /etc/pam.d/common-auth。打开并找到如下一行: ``` auth [success=1 default=ignore] pam_unix.so nullok_secure @@ -59,57 +48,53 @@ auth required pam_google_authenticator.so 保存并关闭文件。 -下一步就是为系统中的每个用户设置 google-authenticator(否则会不允许他们登录)。为了简单起见,我们假设你的系统中有两个用户:jack 和 olivia。首先为 jack 设置(我们假设这是我们一直使用的账户)。 +下一步就是为系统中的每个用户设置 google-authenticator(否则他们就不能登录了)。为了简单起见,我们假设你的系统中有两个用户:jack 和 olivia。首先为 jack 设置(我们假设这是我们一直使用的账户)。 打开一个终端窗口并输入命令 google-authenticator。之后会问你一系列的问题(每个问题你都应该用 y 回答)。问题包括: * 是否允许更新你的 "/home/jlwallen/.google_authenticator" 文件 (y/n) y - * 是否禁止多个用户使用同一个认证令牌?这会限制你每 30 秒内只能登录一次,但能增加你注意到甚至防止中间人攻击的可能 (y/n) +* 默认情况下令牌时长为 30 秒即可,为了补偿客户端和服务器之间可能出现的时间偏差,我们允许使用当前时间之前或之后的其它令牌。如果你无法进行时间同步,你可以把这个时间窗口由默认的 1:30 分钟增加到 4 分钟。是否希望如此 (y/n) +* 如果你尝试登录的计算机没有针对暴力破解进行加固,你可以为验证模块启用速率限制。默认情况下,限制攻击者每 30 秒不能尝试登陆超过 3 次。是否启用速率限制 (y/n) -* 默认情况下令牌时长为 30 秒即可,为了补偿客户端和服务器之间可能出现的时间偏差,我们允许添加一个当前时间之前或之后的令牌。如果你无法进行时间同步,你可以把时间窗口由默认的 1:30 分钟增加到 4 分钟。是否希望如此 (y/n) - -* 如果你尝试登陆的计算机没有针对蛮力登陆进行加固,你可以为验证模块启用速率限制。默认情况下,限制攻击者每 30 秒不能尝试登陆超过 3 次。是否启用速率限制 (y/n) - -一旦完成了问题回答,你就会看到你的密钥、验证码以及 5 个紧急刮码。把刮码输出保存起来。你可以在无法使用手机的时候使用它们(每个刮码仅限使用一次)。密钥用于你在 Google Authenticator 上设置账户,验证码是你能立即使用(如果需要)的一次性验证码。 +一旦完成了问题回答,你就会看到你的密钥、验证码以及 5 个紧急刮码(emergency scratch code)。把这些刮码打印出来并保存。你可以在无法使用手机的时候使用它们(每个刮码仅限使用一次)。密钥用于你在 Google 身份验证器上设置账户,验证码是你能当下就能够立即使用(如果需要)的一次性验证码。 ### 设置应用 -现在你已经配置好了用户 jack。在设置用户 olivia 之前,你需要在 Google Authenticator 应用上为 jack 添加账户。在主屏幕上打开应用,点击 菜单 按钮(右上角三个竖排点)。点击添加账户然后输入提供的密钥。在下一个窗口(示意图1),你需要输入你运行 google-authenticator 应用时提供的 16 个数字的密钥。给账户取个名字(以便你记住这用于哪个账户),然后点击添加。 +现在你已经配置好了用户 jack。在设置用户 olivia 之前,你需要在 Google 身份验证器应用上为 jack 添加账户(LCTT 译注:实际操作情形中,是为 jack 的手机上安装的该应用创建一个账户)。在打开应用,点击“菜单”按钮(右上角三个竖排点)。点击“添加账户”然后点击“输入提供的密钥”。在下一个窗口(图1),你需要输入你运行 google-authenticator 应用时提供的 16 个数字的密钥。给账户取个名字(以便你记住这用于哪个账户),然后点击“添加”。 ![](https://www.linux.com/sites/lcom/files/styles/floated_images/public/auth_a.png?itok=xSMkd-Mf) ->Figure 1: 在 Google Authenticator 应用上新建账户 + +*图1: 在 Google Authenticator 应用上新建账户* + +(LCTT 译注:Google 身份验证器也可以扫描你在服务器上设置时显示的二维码,而不用手工输入密钥) 添加完账户之后,你就会看到一个 6 个数字的密码,你每次登录或者使用 sudo 的时候都会需要这个密码。 最后,在系统上设置其它账户。正如之前提到的,我们会设置一个叫 olivia 的账户。步骤如下: 1. 打开一个终端窗口 - 2. 输入命令 sudo su olivia - -3. 在智能机上打开 Google Authenticator - -4. 在终端窗口(示意图2)中输入(应用提供的) 6 位数字验证码并敲击回车 - +3. 在智能机上打开 Google 身份验证器 +4. 在终端窗口(图2)中输入(应用提供的) 6 位数字验证码并敲击回车 5. 输入你的 sudo 密码并敲击回车 - 6. 以新用户输入命令 google-authenticator,回答问题并记录生成的密钥和验证码。 -成功为 olivia 用户设置好之后,用 google-authenticator 命令,在 Google Authenticator 应用上根据用户信息(和之前为第一个用户添加账户相同)添加一个新的账户。现在你在 Google Authenticator 应用上就会有 jack 和 olivia 两个账户了。 +成功为 olivia 用户设置好之后,用 google-authenticator 命令,在 Google 身份验证器应用上根据用户信息(和之前为第一个用户添加账户相同)添加一个新的账户。现在你在 Google 身份验证器应用上就会有 jack 和 olivia 两个账户了。(LCTT 译注:在实际操作情形中,通常是为 jack 和 olivia 两个人的手机分别设置。) ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/auth_b.png?itok=FH36V1r0) ->Figure 2: 为 sudo 输入 6位数字验证码 -好了,就是这些。每次你尝试登陆系统(或者使用 sudo) 的时候,在你输入用户密码之前,都会要求你输入提供的 6 位数字验证码。现在你的 Linux 机器就比添加双重认证之前安全多了。虽然有些人会认为这非常麻烦,我仍然推荐使用,尤其是那些保存了敏感数据的机器。 +*图2: 为 sudo 输入 6位数字验证码* + +好了,就是这些。每次你尝试登录系统(或者使用 sudo) 的时候,在你输入用户密码之前,都会要求你输入提供的 6 位数字验证码。现在你的 Linux 机器就比添加双因子认证之前安全多了。虽然有些人会认为这非常麻烦,我仍然推荐使用,尤其是那些保存了敏感数据的机器。 -------------------------------------------------------------------------------- -via: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/auth_b.png?itok=FH36V1r0 +via: https://www.linux.com/learn/how-set-2-factor-authentication-login-and-sudo 作者:[JACK WALLEN][a] 译者:[ictlyh](http://mutouxiaogui.cn/blog/) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) [a]: https://www.linux.com/users/jlwallen [1]: https://www.linux.com/licenses/category/used-permission From ebd21bcc86b46fa8239355db9e7ea2db84fc9514 Mon Sep 17 00:00:00 2001 From: jiwenkang <1006990314@qq.com> Date: Thu, 23 Jun 2016 08:06:28 -0500 Subject: [PATCH 0957/1469] =?UTF-8?q?erlinux=20=E5=AE=8C=E6=88=90=E7=BF=BB?= =?UTF-8?q?=E8=AF=91=20(#4084)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * erlinux translating * erlinux translated * erlinux translated --- ...Driving cars into the future with Linux.md | 74 ++++++------ ...Driving cars into the future with Linux.md | 108 ++++++++++++++++++ 2 files changed, 147 insertions(+), 35 deletions(-) create mode 100644 translated/talk/20160523 Driving cars into the future with Linux.md diff --git a/sources/talk/20160523 Driving cars into the future with Linux.md b/sources/talk/20160523 Driving cars into the future with Linux.md index 38ef546789..9b9d69d68c 100644 --- a/sources/talk/20160523 Driving cars into the future with Linux.md +++ b/sources/talk/20160523 Driving cars into the future with Linux.md @@ -1,81 +1,85 @@ -Driving cars into the future with Linux + +驾车通往未来Linux =========================================== ![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/open-snow-car-osdc-lead.png?itok=IgYZ6mNY) -I don't think much about it while I'm driving, but I sure do love that my car is equipped with a system that lets me use a few buttons and my voice to call my wife, mom, and children. That same system allows me to choose whether I listen to music streaming from the cloud, satellite radio, or the more traditional AM/FM radio. I also get weather updates and can direct my in-vehicle GPS to find the fastest route to my next destination. [In-vehicle infotainment][1], or IVI as it's known in the industry, has become ubiquitous in today's newest automobiles. -A while ago, I had to travel hundreds of miles by plane and then rent a car. Happily, I discovered that my rental vehicle was equipped with IVI technology similar to my own car. In no time, I was connected via Bluetooth, had uploaded my contacts into the system, and was calling home to let my family know I arrived safely and my hosts to let them know I was en route to their home. +当我开车的时候不认为和 Linux 有多大联系,但是我肯定我是喜欢一个配备有系统的车子,让我按几个按钮语音就可以传给我的妻子母亲以及孩子。同样,这样的系统可以让我选择是否从云端流媒体收听音乐,卫星广播,以及传统的 AM/FM 收音机。我也会得到天气更新以及可以给我的车载信息娱乐 GPS 找到最快的下一个目的地[In-vehicle infotainment][1],以及 IVI 作为行业知名产业,已经普及到最新的汽车生产商。 -In a recent [news roundup][2], Scott Nesbitt cited an article that said Ford Motor Company is getting substantial backing from a rival automaker for its open source [Smart Device Link][3] (SDL) middleware framework, which supports mobile phones. SDL is a project of the [GENIVI Alliance][4], a nonprofit committed to building middleware to support open source in-vehicle infotainment systems. According to [Steven Crumb][5], executive director of GENIVI, their [membership][6] is broad and includes Daimler Group, Hyundai, Volvo, Nissan, Honda, and 170 others. +前段时间,我不得坐飞机飞跃数百英里,租一辆车。令人愉快的是,我发现我的租凭车配置了 IVI 技术。任何时候,我只要通过蓝牙连接,上传联系人到系统中,打电话回家给我的家人,让他们知道我已经安全到家了。然后“主人“会知道我再途中还是已经到他们家了。 -In order to remain competitive in the industry, automotive companies need a middleware system that can support the various human machine interface technologies available to consumers today. Whether you own an Android, iOS, or other device, automotive OEMs want their units to be able to support these systems. Furthermore, these IVI systems must be adaptable enough to support the ever decreasing half-life of mobile technology. OEMs want to provide value and add services in their IVI stacks that will support a variety of options for their customers. Enter Linux and open source software. +在最近的 [news roundup][2],Scott Nesbitt 引用一篇文章,说福特汽车公司是由它的开源 [Smart Device Link][3](SDL)中间设备框架,对手汽车制造商,支持那个移动手机获得大量的支持。 SDL 是 [GENIVI Alliance][4] 的项目,一个非营利性的致力于建设中间件支持开源的车载信息娱乐系统。根据文献 [[Steven Crumb][5],GENIVI 执行董事,他们 [membership][6] 很广,包括 Daimler 集团,现代,沃尔沃,日产,本田等等 170 个。 -In addition to GENIVI's efforts, the [Linux Foundation][7] sponsors the [Automotive Grade Linux][8] (AGL) workgroup, a software foundation dedicated to finding open source solutions for automotive applications. Although AGL will initially focus on IVI systems, they envision branching out to include [telematics][9], heads up displays, and other control systems. AGL has over 50 members at this time, including Jaguar, Toyota, and Nissan, and in a [recent press release][10] announced that Ford, Mazda, Mitsubishi, and Subaru have joined. +为了在同行业中保持竞争力,汽车企业需要一个中间设备系统,可以支持当今消费者提供的各种人机界面技术。无论您拥有 Android,iOS 或其他设备,汽车 OEM 厂商希望自己的系统单位能够支持这些。此外,这些的 IVI 系统必须有足够适应能力以支持移动技术的不断下降,半衰期。 OEM 厂商要提供价值服务,并在他们的 IVI 堆栈支持各种为他们的客户添加选择。进入 Linux 和开源软件。 -To find out more, we interviewed two leaders in this emerging field. Specifically, we wanted to know how Linux and open source software are being used and if they are in fact changing the face of the automotive industry. First, we talk to [Alison Chaiken][11], a software engineer at Peloton Technology and an expert on automotive Linux, cybersecurity, and transparency. She previously worked for Mentor Graphics, Nokia, and the Stanford Linear Accelerator. Then, we chat with [Steven Crumb][12], executive director of GENIVI, who got started in open source in high-performance computing environments (supercomputers and early cloud computing). He says that though he's not a coder anymore, he loves to help organizations solve real business problems with open source software. +除了 GENIVI 的努力下,[Linux Foundation][7] 赞助 [Automotive Grade Linux][8](AGL)工作组,一个软件基金会,致力于寻找针对汽车应用的开源解决方案。虽然 AGL 初期将侧重于 IVI 系统,他们展望不同的分歧,包括 [telematics][9],小心显示器和其他控制系统。 AGL 有超过 50 名成员在这个时候,包括捷豹,丰田,日产,并在 [recent press release][10] 宣布福特、马自达、三菱、和斯巴鲁加入。 -### Interview with Alison Chaiken (by [Deb Nicholson][13]) -#### How did you get interested in the automotive software space? +为了了解更多信息,我们在这一新鲜兴领域采访了两位领导人。明确地来说,我们想知道是如何被使用的 Linux 和开源软件,如果它们实际上是改变汽车行业的面貌。首先,我们谈谈 [Alison Chaiken][11],在大集团技术的软件工程师和汽车 Linux 专家,网络安全和透明度。她曾任职于 [Alison Chaiken][11] 公司,诺基亚和斯坦福直线性加速器。然后我们用 [Steven Crumb][12],GENIVI 执行董事,谁得到了在开源环境高性能计算(超级计算机和早期的云计算)开始聊天。他说,虽然他再不是一个程序员了,但是他喜欢帮助企业解决开源软件的实际业务问题。 -I was working on [MeeGo][14] in phones at Nokia in 2009 when the project was cancelled. I thought, what's next? A colleague was working on [MeeGo-IVI][15], an early automotive Linux distribution. "Linux is going to be big in cars," I thought, so I headed in that direction. +### 采访 Alison Chaiken (by [Deb Nicholson][13]) -#### Can you tell us what aspects you're working on these days? +#### 你是如何开始对汽车软件空间感兴趣的? -I'm currently working for a startup on an advanced cruise control system that uses real-time Linux to increase the safety and fuel economy of big-rig trucks. I love working in this area, as no one would disagree that trucking can be improved. +我是在诺基亚手机产品时, 2009 年该项目被取消。我想,下一步是什么?一位同事正在对 [MeeGo-IVI][15],早期的汽车 Linux 发行版。 “Linux 在汽车是大了,” 我想,所以我在朝着这个方向努力。 -#### There have been a few stories about hacked cars in recent years. Can open source solutions help address this issue? +#### 你能告诉我们你这些日子工作在哪些方面? + +我目前正在启动为使用 Linux 系统增加大货车钻机的安全性和燃油经济性的先进巡航控制。我喜欢在这方面的工作,因为没有人会反对卡车得以提升。 + +#### 目前关于汽车已在近年来砍死几个人故事。开源代码方案可以帮助解决这个问题吗? I presented a talk on precisely this topic, on how Linux can (and cannot) contribute to security solutions in automotive at Southern California Linux Expo 2016 ([Slides][16]). Notably, GENIVI and Automotive Grade Linux have published their code and both projects take patches via Git. Please send your fixes upstream! Many eyes make all bugs shallow. +我提出的谈话正是这一主题,就如何 Linux 可以(或不可以)在南加州 2016 年世博会作出贡献的安全解决方案的 Linux汽车([Slides][16])。值得注意的是,GENIVI 和汽车级 Linux 已经公布了他们的代码,这两个项目的 Git 通过采取补丁。请上游发送您的修复!许多眼睛都盯着肤浅的bugs。 -#### Law enforcement agencies and insurance companies could find plenty of uses for data about drivers. How easy will it be for them to obtain this information? +#### 执法机构和保险公司可以找到很多有关数据用途的驱动程序。它将如何容易成为他们获取这些信息? -Good question. The Dedicated Short Range Communication Standard (IEEE-1609) takes great pains to keep drivers participating in Wi-Fi safety messaging anonymous. Still, if you're posting to Twitter from your car, someone will be able to track you. +好问题。该专用短程通信标准(IEEE-1609),以保持匿名的 Wi-Fi 安全消息驱动程序。不过,如果你从你的车张贴到 Twitter,有人能够跟踪你。 -#### What can developers and private citizens do to make sure civil liberties are protected as automotive technology evolves? +#### 有什么可以开发人员和公民个人一起完成,以确保公民自由受到保护作为汽车技术发展的? -The Electronic Frontier Foundation (EFF) has done an excellent job of keeping on top of automotive issues, having commented through official channels on what data may be stored in automotive "black boxes" and on how DMCA's Provision 1201 applies to cars. +电子前沿基金会(EFF)一样对汽车保持的问题上,通过什么样的数据可以存储在汽车 “黑盒子”,并在 DMCA 的规定 1201 如何应用于汽车官方渠道评论已经出色的工作了。 -#### What are some of the exciting things you see coming for drivers in the next few years? +#### 在未来几年令人兴奋的事情上,那些是你看到的驱动因素? -Adaptive cruise control and collision avoidance systems are enough of an advance to save lives. As they roll out through vehicle fleets, I truly believe that fatalities will decline. If that's not exciting, I don't know what is. Furthermore, capabilities like automated parking assist will make cars easier to drive and reduce fender-benders. +自适应巡航控制和防撞系统有足够的预付款来挽救生命。当他们通过运输车队的推出,我真的相信死亡人数会下降。如果这还不是令人兴奋的,我不知道是什么。此外,像自动化停车辅助功能,将会使汽车更容易驾驶,减少汽车相撞事故。 -#### What needs to be built and how can people get involved? +#### 有什么是需要人参与以及如何建造? -Automotive Grade Linux is developed in the open and runs on cheap hardware (e.g. Raspberry Pi 2 and moderately priced Renesas Porter board) that anyone can buy. GENIVI automotive Linux middleware consortium has lots of software publicly available via Git. Furthermore, there is the ultra cool [OSVehicle open hardware][17] automotive platform. +汽车 Linux 级开发是开放源代码的,运行在廉价硬件(如树莓派 Pi 2 和中等价位的 Renesas Porter board),任何人都可以购买。 GENIVI 汽车 Linux 的中间设备联盟有很多软件通过 Git 的公开。此外,还有很酷的 [OSVehicle open hardware][17] 汽车平台。 -#### There are many ways for Linux software and open hardware folks with moderate budgets to get involved. Join us at #automotive on Freenode IRC if you have questions. +#### 这里是 Linux 软件和开放硬件,许多方面具有中等人数预算的参与。如果您有任何疑问,加入我们在 Freenode 上 IRC#automotive。 -### Interview with Steven Crumb (by Don Watkins) +### 采访 Steven Crumb (by Don Watkins) -#### What's so huge about GENIVI's approach to IVI? +#### 关于GENIVI's 对 IVI 为什么那么大 ? -GENIVI filled a huge gap in the automotive industry by pioneering the use of free and open source software, including Linux, for non-safety-critical automotive software like in-vehicle infotainment (IVI) systems. As consumers came to expect the same functionality in their vehicles as on their smartphones, the amount of software required to support IVI functions grew exponentially. The increased amount of software has also increased the costs of building the IVI systems and thus slowed time to market. +GENIVI 率先通过使用自由和开源软件,包括 Linux,像车载信息娱乐(IVI)系统的非安全关键汽车软件填补了汽车行业的巨大差距。作为消费者来到期望在他们的车辆相同的功能在智能手机上的软件,以支持 IVI 功能所需的量成倍增长。软件增加量也增加了建设 IVI 系统的成本,从而延缓了上市时间。 -GENIVI's use of open source software and a community development model has saved automakers and their software suppliers significant amounts of money while significantly reducing the time to market. I'm excited about GENIVI because we've been fortunate to lead a revolution of sorts in the automotive industry by slowly evolving organizations from a highly structured and proprietary methodology to a community-based approach. We're not done yet, but it's been a privilege to take part in a transformation that is yielding real benefits. +GENIVI 的使用开源软件和社区发展模式节省了汽车制造商和他们的软件提供商显著大量的资金,而显著减少了产品上市时间。我很兴奋,因为 GENIVI 我们很幸运慢慢从高度结构化和专有的方法来社区为基础的方法不断发展的组织​​领导排序在汽车行业的一场革命。我们还没有完成,但它一直是一个荣幸参加正在产生实实在在的好处的转换。 -#### How do your major members drive the direction of GENIVI? +#### 你的庞大会员怎么才可以驱动 GENIVI 方向? -GENIVI has a lot of members and non-members contributing to our work. As with many open source projects, any company can influence the technical output by simply contributing code, patches, and time to test. With that said, BMW, Mercedes-Benz, Hyundai Motor, Jaguar Land Rover, PSA, Renault/Nissan, and Volvo are all active adopters of and contributors to GENIVI—and many other OEMs have IVI solutions in their cars that extensively use GENIVI's software. +GENIVI 有很多会员和非会员促进我们的工作。与许多开源项目,任何公司都可以通过简单地贡献代码,修补程序和时间来检验影响的技术输出。随着中说,宝马,奔驰,现代汽车,捷豹路虎,标致雪铁龙,雷诺 / 日产和沃尔沃是所有积极采用者和贡献者 GENIVI 和其他许多 OEM 厂商已经在他们的汽车 IVI 解决方案,广泛使用 GENIVI 的软件。 -#### What licenses cover the contributed code? +#### 贡献的代码使用了什么许可证? -GENIVI employs a number of licenses ranging from (L)GPLv2 to MPLv2 to Apache 2.0. Some of our tools use the Eclipse license. We have a [public licensing policy][18] that details our licensing preferences. +GENIVI 采用数量的许可证从(L)GPLv2 许可,以 MPLv2 到 Apache2.0。我们的一些工具使用 Eclipse 许可证。我们有一个[public licensing policy][18],详细说明我们的许可偏好。 -#### How does a person or group get involved? How important are community contributions to the ongoing success of the project? +#### 一个人或一群人如何参与其中?重要的是如何对项目的持续成功的社区贡献? -GENIVI does its development completely in the open ([projects.genivi.org][19]) and thus, anyone interested in using open software in automotive is welcome to participate. That said, the alliance can fund its continued development in the open through companies [joining GENIVI][20] as members. GENIVI members enjoy a wide variety of benefits, not the least of which is participation in the global community of 140 companies that has been developed over the last six years. +GENIVI 完全做它开放发展的在([projects.genivi.org][19]),因此,有兴趣的人在汽车使用开源软件,欢迎参加。这就是说,该联盟能够通过公司 [joining GENIVI][20] 作为成员不断发展的开放基金。 GENIVI 会员享受各种各样的福利,而不是其中最重要的是在已经发展了近六年来 140 家公司全球社区参与。 -Community is hugely important to GENIVI, and we could not have produced and maintained the valuable software we developed over the years without an active community of contributors. We've worked hard to make contributing to GENIVI as simple as joining an [email list][21] and connecting to the people in the various software projects. We use standard practices employed by many open source projects and provide high-quality tools and infrastructure to help developers feel at home and be productive. +社区是 GENIVI 非常重要的,我们不可能生产和维护我们发展了很多年没有贡献者一个活跃的社区有价值的软件。我们努力做出贡献 GENIVI 简单,只要加入一个 [邮件列表] [21] 并连接到人们在不同的软件项目。我们使用许多开源项目采用的标准做法,并提供高质量的工具和基础设施,以帮助开发人员有宾至如归的感觉,并富有成效。 -Regardless of someone's familiarity with the automotive software, they are welcome to join our community. People have modified cars for years, so for many people there is a natural draw to anything automotive. Software is the new domain for cars, and GENIVI wants to be the open door for anyone interested in working with automotive, open source software. +无论在汽车软件某人的熟悉,欢迎他们加入我们的社区。人们已经改装车多年,所以对于许多人来说,是一种天然的抽奖,任何汽车。软件是汽车的新域,GENIVI 希望成为敞开的门有兴趣的人与汽车,开源软件的工作。 ------------------------------- via: https://opensource.com/business/16/5/interview-alison-chaiken-steven-crumb 作者:[Don Watkins][a] -译者:[译者ID](https://github.com/译者ID) +译者:[erlinux](https://github.com/erlinux) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/translated/talk/20160523 Driving cars into the future with Linux.md b/translated/talk/20160523 Driving cars into the future with Linux.md new file mode 100644 index 0000000000..9b9d69d68c --- /dev/null +++ b/translated/talk/20160523 Driving cars into the future with Linux.md @@ -0,0 +1,108 @@ + +驾车通往未来Linux +=========================================== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/open-snow-car-osdc-lead.png?itok=IgYZ6mNY) + + +当我开车的时候不认为和 Linux 有多大联系,但是我肯定我是喜欢一个配备有系统的车子,让我按几个按钮语音就可以传给我的妻子母亲以及孩子。同样,这样的系统可以让我选择是否从云端流媒体收听音乐,卫星广播,以及传统的 AM/FM 收音机。我也会得到天气更新以及可以给我的车载信息娱乐 GPS 找到最快的下一个目的地[In-vehicle infotainment][1],以及 IVI 作为行业知名产业,已经普及到最新的汽车生产商。 + +前段时间,我不得坐飞机飞跃数百英里,租一辆车。令人愉快的是,我发现我的租凭车配置了 IVI 技术。任何时候,我只要通过蓝牙连接,上传联系人到系统中,打电话回家给我的家人,让他们知道我已经安全到家了。然后“主人“会知道我再途中还是已经到他们家了。 + +在最近的 [news roundup][2],Scott Nesbitt 引用一篇文章,说福特汽车公司是由它的开源 [Smart Device Link][3](SDL)中间设备框架,对手汽车制造商,支持那个移动手机获得大量的支持。 SDL 是 [GENIVI Alliance][4] 的项目,一个非营利性的致力于建设中间件支持开源的车载信息娱乐系统。根据文献 [[Steven Crumb][5],GENIVI 执行董事,他们 [membership][6] 很广,包括 Daimler 集团,现代,沃尔沃,日产,本田等等 170 个。 + +为了在同行业中保持竞争力,汽车企业需要一个中间设备系统,可以支持当今消费者提供的各种人机界面技术。无论您拥有 Android,iOS 或其他设备,汽车 OEM 厂商希望自己的系统单位能够支持这些。此外,这些的 IVI 系统必须有足够适应能力以支持移动技术的不断下降,半衰期。 OEM 厂商要提供价值服务,并在他们的 IVI 堆栈支持各种为他们的客户添加选择。进入 Linux 和开源软件。 + +除了 GENIVI 的努力下,[Linux Foundation][7] 赞助 [Automotive Grade Linux][8](AGL)工作组,一个软件基金会,致力于寻找针对汽车应用的开源解决方案。虽然 AGL 初期将侧重于 IVI 系统,他们展望不同的分歧,包括 [telematics][9],小心显示器和其他控制系统。 AGL 有超过 50 名成员在这个时候,包括捷豹,丰田,日产,并在 [recent press release][10] 宣布福特、马自达、三菱、和斯巴鲁加入。 + + +为了了解更多信息,我们在这一新鲜兴领域采访了两位领导人。明确地来说,我们想知道是如何被使用的 Linux 和开源软件,如果它们实际上是改变汽车行业的面貌。首先,我们谈谈 [Alison Chaiken][11],在大集团技术的软件工程师和汽车 Linux 专家,网络安全和透明度。她曾任职于 [Alison Chaiken][11] 公司,诺基亚和斯坦福直线性加速器。然后我们用 [Steven Crumb][12],GENIVI 执行董事,谁得到了在开源环境高性能计算(超级计算机和早期的云计算)开始聊天。他说,虽然他再不是一个程序员了,但是他喜欢帮助企业解决开源软件的实际业务问题。 + +### 采访 Alison Chaiken (by [Deb Nicholson][13]) + +#### 你是如何开始对汽车软件空间感兴趣的? + +我是在诺基亚手机产品时, 2009 年该项目被取消。我想,下一步是什么?一位同事正在对 [MeeGo-IVI][15],早期的汽车 Linux 发行版。 “Linux 在汽车是大了,” 我想,所以我在朝着这个方向努力。 + +#### 你能告诉我们你这些日子工作在哪些方面? + +我目前正在启动为使用 Linux 系统增加大货车钻机的安全性和燃油经济性的先进巡航控制。我喜欢在这方面的工作,因为没有人会反对卡车得以提升。 + +#### 目前关于汽车已在近年来砍死几个人故事。开源代码方案可以帮助解决这个问题吗? + +I presented a talk on precisely this topic, on how Linux can (and cannot) contribute to security solutions in automotive at Southern California Linux Expo 2016 ([Slides][16]). Notably, GENIVI and Automotive Grade Linux have published their code and both projects take patches via Git. Please send your fixes upstream! Many eyes make all bugs shallow. +我提出的谈话正是这一主题,就如何 Linux 可以(或不可以)在南加州 2016 年世博会作出贡献的安全解决方案的 Linux汽车([Slides][16])。值得注意的是,GENIVI 和汽车级 Linux 已经公布了他们的代码,这两个项目的 Git 通过采取补丁。请上游发送您的修复!许多眼睛都盯着肤浅的bugs。 + +#### 执法机构和保险公司可以找到很多有关数据用途的驱动程序。它将如何容易成为他们获取这些信息? + +好问题。该专用短程通信标准(IEEE-1609),以保持匿名的 Wi-Fi 安全消息驱动程序。不过,如果你从你的车张贴到 Twitter,有人能够跟踪你。 + +#### 有什么可以开发人员和公民个人一起完成,以确保公民自由受到保护作为汽车技术发展的? + +电子前沿基金会(EFF)一样对汽车保持的问题上,通过什么样的数据可以存储在汽车 “黑盒子”,并在 DMCA 的规定 1201 如何应用于汽车官方渠道评论已经出色的工作了。 + +#### 在未来几年令人兴奋的事情上,那些是你看到的驱动因素? + +自适应巡航控制和防撞系统有足够的预付款来挽救生命。当他们通过运输车队的推出,我真的相信死亡人数会下降。如果这还不是令人兴奋的,我不知道是什么。此外,像自动化停车辅助功能,将会使汽车更容易驾驶,减少汽车相撞事故。 + +#### 有什么是需要人参与以及如何建造? + +汽车 Linux 级开发是开放源代码的,运行在廉价硬件(如树莓派 Pi 2 和中等价位的 Renesas Porter board),任何人都可以购买。 GENIVI 汽车 Linux 的中间设备联盟有很多软件通过 Git 的公开。此外,还有很酷的 [OSVehicle open hardware][17] 汽车平台。 + +#### 这里是 Linux 软件和开放硬件,许多方面具有中等人数预算的参与。如果您有任何疑问,加入我们在 Freenode 上 IRC#automotive。 + +### 采访 Steven Crumb (by Don Watkins) + +#### 关于GENIVI's 对 IVI 为什么那么大 ? + +GENIVI 率先通过使用自由和开源软件,包括 Linux,像车载信息娱乐(IVI)系统的非安全关键汽车软件填补了汽车行业的巨大差距。作为消费者来到期望在他们的车辆相同的功能在智能手机上的软件,以支持 IVI 功能所需的量成倍增长。软件增加量也增加了建设 IVI 系统的成本,从而延缓了上市时间。 + +GENIVI 的使用开源软件和社区发展模式节省了汽车制造商和他们的软件提供商显著大量的资金,而显著减少了产品上市时间。我很兴奋,因为 GENIVI 我们很幸运慢慢从高度结构化和专有的方法来社区为基础的方法不断发展的组织​​领导排序在汽车行业的一场革命。我们还没有完成,但它一直是一个荣幸参加正在产生实实在在的好处的转换。 + +#### 你的庞大会员怎么才可以驱动 GENIVI 方向? + +GENIVI 有很多会员和非会员促进我们的工作。与许多开源项目,任何公司都可以通过简单地贡献代码,修补程序和时间来检验影响的技术输出。随着中说,宝马,奔驰,现代汽车,捷豹路虎,标致雪铁龙,雷诺 / 日产和沃尔沃是所有积极采用者和贡献者 GENIVI 和其他许多 OEM 厂商已经在他们的汽车 IVI 解决方案,广泛使用 GENIVI 的软件。 + +#### 贡献的代码使用了什么许可证? + +GENIVI 采用数量的许可证从(L)GPLv2 许可,以 MPLv2 到 Apache2.0。我们的一些工具使用 Eclipse 许可证。我们有一个[public licensing policy][18],详细说明我们的许可偏好。 + +#### 一个人或一群人如何参与其中?重要的是如何对项目的持续成功的社区贡献? + +GENIVI 完全做它开放发展的在([projects.genivi.org][19]),因此,有兴趣的人在汽车使用开源软件,欢迎参加。这就是说,该联盟能够通过公司 [joining GENIVI][20] 作为成员不断发展的开放基金。 GENIVI 会员享受各种各样的福利,而不是其中最重要的是在已经发展了近六年来 140 家公司全球社区参与。 + +社区是 GENIVI 非常重要的,我们不可能生产和维护我们发展了很多年没有贡献者一个活跃的社区有价值的软件。我们努力做出贡献 GENIVI 简单,只要加入一个 [邮件列表] [21] 并连接到人们在不同的软件项目。我们使用许多开源项目采用的标准做法,并提供高质量的工具和基础设施,以帮助开发人员有宾至如归的感觉,并富有成效。 + +无论在汽车软件某人的熟悉,欢迎他们加入我们的社区。人们已经改装车多年,所以对于许多人来说,是一种天然的抽奖,任何汽车。软件是汽车的新域,GENIVI 希望成为敞开的门有兴趣的人与汽车,开源软件的工作。 + +------------------------------- +via: https://opensource.com/business/16/5/interview-alison-chaiken-steven-crumb + +作者:[Don Watkins][a] +译者:[erlinux](https://github.com/erlinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[1]: https://en.wikipedia.org/wiki/In_car_entertainment +[2]: https://opensource.com/life/16/1/weekly-news-jan-9 +[3]: http://projects.genivi.org/smartdevicelink/home +[4]: http://www.genivi.org/ +[5]: https://www.linkedin.com/in/stevecrumb +[6]: http://www.genivi.org/genivi-members +[7]: http://www.linuxfoundation.org/ +[8]: https://www.automotivelinux.org/ +[9]: https://en.wikipedia.org/wiki/Telematics +[10]: https://www.automotivelinux.org/news/announcement/2016/01/ford-mazda-mitsubishi-motors-and-subaru-join-linux-foundation-and +[11]: https://www.linkedin.com/in/alison-chaiken-3ba456b3 +[12]: https://www.linkedin.com/in/stevecrumb +[13]: https://opensource.com/users/eximious +[14]: https://en.wikipedia.org/wiki/MeeGo +[15]: http://webinos.org/deliverable-d026-target-platform-requirements-and-ipr/automotive/ +[16]: http://she-devel.com/Chaiken_automotive_cybersecurity.pdf +[17]: https://www.osvehicle.com/ +[18]: http://projects.genivi.org/how +[19]: http://projects.genivi.org/ +[20]: http://genivi.org/join +[21]: http://lists.genivi.org/mailman/listinfo/genivi-projects From 8c2d63ac7dd0766b638584521c6b0b53519e8c28 Mon Sep 17 00:00:00 2001 From: J L Date: Thu, 23 Jun 2016 21:10:33 +0800 Subject: [PATCH 0958/1469] =?UTF-8?q?[Translation=20Complete]=20Mark=20Shu?= =?UTF-8?q?ttleworth=20=E2=80=93=20Ubuntu=20=E6=93=8D=E4=BD=9C=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E8=83=8C=E5=90=8E=E7=9A=84=E4=BA=BA=20(#4082)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [Translation Complete] Mark Shuttleworth – Ubuntu 操作系统背后的人 * Revert "[Translation Complete] Mark Shuttleworth – Ubuntu 操作系统背后的人" This reverts commit 340e5cfbb029298d49752be82de8cb029968e639. * Revert "Revert "[Translation Complete] Mark Shuttleworth – Ubuntu 操作系统背后的人"" This reverts commit 2cca4b38823f93e61947c2e4b347fdf584d4331f. * [Translation Complete] Mark Shuttleworth – Ubuntu 操作系统背后的人 --- ...-The Man Behind Ubuntu Operating System.md | 121 ----------------- ...-The Man Behind Ubuntu Operating System.md | 126 ++++++++++++++++++ 2 files changed, 126 insertions(+), 121 deletions(-) delete mode 100644 sources/talk/20151023 Mark Shuttleworth--The Man Behind Ubuntu Operating System.md create mode 100644 translated/talk/20151023 Mark Shuttleworth--The Man Behind Ubuntu Operating System.md diff --git a/sources/talk/20151023 Mark Shuttleworth--The Man Behind Ubuntu Operating System.md b/sources/talk/20151023 Mark Shuttleworth--The Man Behind Ubuntu Operating System.md deleted file mode 100644 index 508b68c176..0000000000 --- a/sources/talk/20151023 Mark Shuttleworth--The Man Behind Ubuntu Operating System.md +++ /dev/null @@ -1,121 +0,0 @@ -Translating by [jerryling315](https://github.com/jerryling315) - -Mark Shuttleworth – The Man Behind Ubuntu Operating System -================================================================================ -![](http://1426826955.rsc.cdn77.org/wp-content/uploads/2015/10/Mark-Shuttleworth-652x445.jpg) - -**Mark Richard Shuttleworth** is the founder of **Ubuntu** or the man behind the Debian as they call him. He was born in 1973 in Welkom, South Africa. He’s an entrepreneur and also space tourist who became later **1st citizen of independent African country who could travel to the space**. - -Mark also founded **Thawte** in 1996, the Internet commerce security company, while he was studying finance and IT at University of Cape Town. - -In 2000, Mark founded the HBD, as an investment company, and also he created the Shuttleworth Foundation in order to fund the innovative leaders in the society with combination of fellowships and some investments. - -> “The mobile world is crucial to the future of the PC. This month, for example, it became clear that the traditional PC is shrinking in favor of tablets. So if we want to be relevant on the PC, we have to figure out how to be relevant in the mobile world first. Mobile is also interesting because there’s no pirated Windows market. So if you win a device to your OS, it stays on your OS. In the PC world, we are constantly competing with “free Windows”, which presents somewhat unique challenges. So our focus now is to establish a great story around Ubuntu and mobile form factors – the tablet and the phone – on which we can build deeper relationships with everyday consumers.” -> -> — Mark Shuttleworth - -In 2002, he flew to International Space Station as member of their crew of Soyuz mission TM-34, after 1 year of training in the Star City, Russia. And after running campaign to promote the science, code, and mathematics to the aspiring astronauts and the other ambitious types at schools in SA, Mark founded the **Canonical Ltd**. and in 2013, he provided leadership for Ubuntu operating system for software development purposes. - -Today, Shuttleworth holds dual citizenship of United Kingdom and South Africa currently lives on lovely Mallards botanical garden in Isle of Man, with 18 precocious ducks, equally his lovely girlfriend Claire, 2 black bitches and occasional itinerant sheep. - -> “Computer is not a device anymore. It is an extension of your mind and your gateway to other people.” -> -> — Mark Shuttleworth - -### Mark Shuttleworth’s Early life ### - -As we mentioned above, Mark was born in Welkom, South Africa’s Orange Free State as son of surgeon and nursery-school teacher, Mark attended the school at Western Province Preparatory School where he became eventually the Head Boy in 1986, followed by 1 term at Rondebosch Boys’ High School, and later at Bishops/Diocesan College where he was again Head Boy in 1991. - -Mark obtained the Bachelor of Business Science degree in the Finance and Information Systems at University of Cape Town, where he lived there in Smuts Hall. He became, as a student, involved in installations of the 1st residential Internet connections at his university. - -> “There are many examples of companies and countries that have improved their competitiveness and efficiency by adopting open source strategies. The creation of skills through all levels is of fundamental importance to both companies and countries.” -> -> — Mark Shuttleworth - -### Mark Shuttleworth’s Career ### - -Mark founded Thawte in 1995, which was specialized in the digital certificates and Internet security, then he sold it to VeriSign in 1999, earning about $575 million at the time. - -In 2000, Mark formed the HBD Venture Capital (Here be Dragons), the business incubator and venture capital provider. In 2004, he formed the Canonical Ltd., for promotion and commercial support of the free software development projects, especially Ubuntu operating system. In 2009, Mark stepped down as CEO of Canonical, Ltd. - -> “In the early days of the DCC I preferred to let the proponents do their thing and then see how it all worked out in the end. Now we are pretty close to the end.” -> -> — Mark Shuttleworth - -### Linux and FOSS with Mark Shuttleworth ### - -In the late 1990s, Mark participated as one of developers of Debian operating system. - -In 2001, Mark formed the Shuttleworth Foundation, It is non-profit organization dedicated to the social innovation that also funds free, educational, and open source software projects in South Africa, including Freedom Toaster. - -In 2004, Mark returned to free software world by funding software development of Ubuntu, as it was Linux distribution based on Debian, throughout his company Canonical Ltd. - -In 2005, Mark founded Ubuntu Foundation and made initial investment of 10 million dollars. In Ubuntu project, Mark is often referred to with tongue-in-cheek title “**SABDFL (Self-Appointed Benevolent Dictator for Life)**”. To come up with list of names of people in order to hire for the entire project, Mark took about six months of Debian mailing list archives with him during his travelling to Antarctica aboard icebreaker Kapitan Khlebnikov in 2004. In 2005, Mark purchased 65% stake of Impi Linux. - -> “I urge telecommunications regulators to develop a commercial strategy for delivering effective access to the continent.” -> -> — Mark Shuttleworth - -In 2006, it was announced that Shuttleworth became **first patron of KDE**, which was highest level of sponsorship available at the time. This patronship ended in 2012, with financial support together for Kubuntu, which was Ubuntu variant with KDE as a main desktop. - -![](http://1426826955.rsc.cdn77.org/wp-content/uploads/2015/10/shuttleworth-kde.jpg) - -In 2009, Shuttleworth announced that, he would step down as the CEO of Canonical in order to focus more energy on partnership, product design, and the customers. Jane Silber, took on this job as the CEO at Canonical after he was the COO at Canonical since 2004. - -In 2010, Mark received the honorary degree from Open University for that work. - -In 2012, Mark and Kenneth Rogoff took part together in debate opposite Peter Thiel and Garry Kasparov at Oxford Union, this debate was entitled “**The Innovation Enigma**”. - -In 2013, Mark and Ubuntu were awarded **Austrian anti-privacy Big Brother Award** for sending the local Ubuntu Unity Dash searches to the Canonical servers by default. One year earlier in 2012, Mark had defended the anonymization method that was used. - -> “All the major PC companies now ship PC’s with Ubuntu pre-installed. So we have a very solid set of working engagements in the industry. But those PC companies are nervous to promote something new to PC buyers. If we can get PC buyers familiar with Ubuntu as a phone and tablet experience, then they may be more willing buy it on the PC too. Because no OS ever succeeded by emulating another OS. Android is great, but if we want to succeed we need to bring something new and better to market. We are all at risk of stagnating if we don’t pursue the future, vigorously. But if you pursue the future, you have to accept that not everybody will agree with your vision.” -> -> — Mark Shuttleworth - -### Mark Shuttleworth’s Spaceflight ### - -Mark gained worldwide fame in 2002 as a second self-funded space tourist and the first South African who could travel to the space. Flying through Space Adventures, Mark launched aboard Russian Soyuz TM-34 mission as spaceflight participant, and he paid approximately $20 million for that voyage. 2 days later, Soyuz spacecraft arrived at International Space Station, where Mark spent 8 days participating in the experiments related to the AIDS and the GENOME research. Later in 2002, Mark returned to the Earth on the Soyuz TM-33. To participate in that flight, Mark had to undergo 1 year of preparation and training, including 7 months spent in the Star City, Russia. - -![](http://1426826955.rsc.cdn77.org/wp-content/uploads/2015/10/Mark-Shuttleworth1.jpg) - -While in space, Mark had radio conversation with Nelson Mandela and another 14 year old South African girl, called Michelle Foster, who asked Mark to marry her. Of course Mark politely dodged that question, stating that he was much honored to this question before cunningly change the subject. The terminally ill Foster was also provided the opportunity to have conversation with Mark and Nelson Mandela by Reach for Dream foundation. - -Upon returning, Mark traveled widely and also spoke about that spaceflight to schoolchildren around the world. - -> “The raw numbers suggest that Ubuntu continues to grow in terms of actual users. And our partnerships – Dell, HP, Lenovo on the hardware front, and gaming companies like EA, Valve joining up on the software front – make me feel like we continue to lead where it matters.” -> -> — Mark Shuttleworth - -### Mark Shuttleworth’s Transport ### - -Mark has his private jet, Bombardier Global Express that is often referred to as Canonical One but it’s in fact owned through the HBD Venture Capital Company. The dragon depicted on side of the plane is Norman, HBD Venture Capital mascot. - -### The Legal Clash with South African Reserve Bank ### - -Upon the moving R2.5 billion in the capital from South Africa to Isle of Man, South African Reserve Bank imposed R250 million levy to release Mark’s assets. Mark appealed, and then after lengthy legal battle, Reserve Bank was ordered to repay Mark his R250 million, plus the interest. Mark announced that he would be donating that entire amount to trust that will be established in order to help others take cases to Constitutional Court. - -> “The exit charge was not inconsistent with the Constitution. The dominant purpose of the exit charge was not to raise revenue but rather to regulate conduct by discouraging the export of capital to protect the domestic economy.” -> -> — Judge Dikgang Moseneke - -In 2015, Constitutional Court of South Africa reversed and set-aside findings of lower courts, ruling that dominant purpose of the exit charge was in order to regulate conduct rather than for raising the revenue. - -### Mark Shuttleworth’s likes ### - -Cesária Évora, mp3s,Spring, Chelsea, finally seeing something obvious for first time, coming home, Sinatra, daydreaming, sundowners, flirting, d’Urberville, string theory, Linux, particle physics, Python, reincarnation, mig-29s, snow, travel, Mozilla, lime marmalade, body shots, the African bush, leopards, Rajasthan, Russian saunas, snowboarding, weightlessness, Iain m banks, broadband, Alastair Reynolds, fancy dress, skinny-dipping, flashes of insight, post-adrenaline euphoria, the inexplicable, convertibles, Clifton, country roads, international space station, machine learning, artificial intelligence, Wikipedia, Slashdot, kitesurfing, and Manx lanes. - -### Shuttleworth’s dislikes ### - -Admin, salary negotiations, legalese, and public speaking. - --------------------------------------------------------------------------------- - -via: http://www.unixmen.com/mark-shuttleworth-man-behind-ubuntu-operating-system/ - -作者:[M.el Khamlichi][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.unixmen.com/author/pirat9/ diff --git a/translated/talk/20151023 Mark Shuttleworth--The Man Behind Ubuntu Operating System.md b/translated/talk/20151023 Mark Shuttleworth--The Man Behind Ubuntu Operating System.md new file mode 100644 index 0000000000..009641458c --- /dev/null +++ b/translated/talk/20151023 Mark Shuttleworth--The Man Behind Ubuntu Operating System.md @@ -0,0 +1,126 @@ +Mark Shuttleworth – Ubuntu 操作系统背后的人 +================================================================================ +![](http://1426826955.rsc.cdn77.org/wp-content/uploads/2015/10/Mark-Shuttleworth-652x445.jpg) + +**Mark Richard Shuttleworth** 是 Ubuntu 的创始人,他也有事被称作是 Debian 背后的那个人。他出生于1973年的 Welkom,南非。他不仅是个企业家,还是个太空游客——他是第一个前往太空旅行的独立非洲国家公民。 + +Mark 还在1996年成立了 **Thawte**,一家互联网安全企业,那是他还只是 University of Cape Town 的一名金融/IT学生。 + +在2000年,Mark 创立了 HBD,一家投资公司,同时他还创立了 Shuttleworth基金会,致力于给社会中有创新性的领袖提供资助——以奖金和投资等形式。 + + +> "移动设备对于个人电脑行业的未来而言至关重要。比如就在这个月,数据清晰地表明相对于平板电脑的发展,传统 PC 行业正在萎缩。所以如果我们想和个人电脑行业有关系,我们必须和移动设备行业有产生联系。移动互联网行业之所以有趣,还因为在这里没有盗版 Windows 操作系统。所以如果你为你的操作系统赢得了一台设备的市场份额,这台设备会持续使用你的操作系统。在传统 PC 行业,我们时不时得和 ‘免费 Windows’ 产生竞争,这一竞争困难的非常微妙。所以我们现在的目标是围绕 Ubuntu 和移动设备——手机和平板——为用户打造更深度的生态环境。" +> +> — Mark Shuttleworth + +在2002年,在俄罗斯的 Star City 接收完为期一年的训练后,他作为 Soyuz 任务代号 TM-34 的一员飞往了国际空间站。再后来,在面向有志于航空航天或者其科学相关的南非学生群体中,内完成了推广科学,编程,数学的演讲后,Mark 创立了 **Canonical Ltd**。此后直至2013年,他一直在领导 Ubuntu 操作系统的开发。 + + +现今,Shuttleworth 有英国与南非双重国籍并和18只可爱的鸭子住在英国的 Isle of Man 小岛上一处花园,一同的还有他一样可爱的女友 Claire,2 条黑母狗以及时不时经过的羊群。 + + +> "电脑不再只是一台电子设备了。他现在是你思维的延续,以及通向他人的入口。" +> +> — Mark Shuttleworth + +### Mark Shuttleworth 的早年生活### +正如我们之前提到的,Mark 出生在 Welkom,南非的橙色自由州。他是一名外科医生和护士学校教师的孩子。Mark 在 Western Province Preparatory School 就读并在1986年成为了学生会主席,一个学期后就读于 Rondebosch 男子高中,再之后入学 Bishops/Diocesan 学院并在1991年再次成为那里的学生会主席。 + +Mark 在 University of Cape Town 拿到了 Bachelor of Business Science degree in the Finance and Information Systems (译者:商业科学里的双学士学位,两个学科分别是金融和信息系统),他在学校就读是住在 Smuts Hall。他,作为学生,也在那里帮助安装了学校的第一条宿舍网络。 + +>“有无数的企业和国家佐证,引入开源政策能提高竞争力和效率。在不同层面上创造生产力对于公司和国家而言都是至关重要的。” +> +> — Mark Shuttleworth + +### Mark Shuttleworth 的职业生涯 ### + +Mark 在1995年创立 Thawte,公司专注于数字证书和互联网安全,然后他在1999年把公司卖给了 VeriSign,赚取了大约 5.75 亿美元。 + +2000年的时候,Mark 创立了 HBD 风险资本公司,这项事业成为了投资方和项目孵化器。2004年的时候,他创立了 Canonical Ltd. 以支持和鼓励自由软件开发项目的商业化,特别是 Ubuntu 操作系统的项目。直到2009年,Mark 才从 Canonical CEO 的位置上退下。 + +> “在 [DDC](https://en.wikipedia.org/wiki/DCC_Alliance) (译者:一个 Debian Gnu/Linux 开发者联盟) 的早期,我更倾向于让开发者做些他们自己的(内核开发)工作看看能弄出些什么。现在我们基本上已经完成了这个开发阶段了。” +> +> — Mark Shuttleworth + +### Linux、免费开源软件 与 Mark Shuttleworth ### + +在90年代末,Mark 作为 Debian 系统开发者的一员参与了项目。 + +2001年,Mark 创立了 Shuttleworth 基金会,这是个扎根南非的,非赢利性,专注于赞助社会创新,免费/教育用途开源软件的基金会,赞助过的项目包括 Freedom Toaster。 + +2004年的时候,Mark 通过出资开发 基于 Debian 的 Ubuntu 操作系统回归了免费软件界,这一切也经由他的公司,Canonical,完成。 + +2005年,Mark 出资建立了 Ubuntu 基金会并投入了一千万美元作为启动资金。在 Ubuntu 项目内,Mark 经常被一个朗朗上口的名字称呼——“**SABDFL (Self-Appointed Benevolent Dictator for Life)**”。为了能够找到足够多的能手开发这个巨大的项目,Mark 花费了6个月的时间在 Debian 的邮件列表里找到能手,这一切都是在他乘坐在南极洲的一艘破冰船——Kapitan Khlebnikov——上完成的。2005年,Mark 买下了 Impi Linux 65% 的股份。 + + +> “我呼吁电信公司的掌权者们尽快开发出跨洲际的高效信息传输服务。” +> +> — Mark Shuttleworth + +2006年,KDE 宣布 Shuttleworth 成为第一位 **patron** 级别赞助者——彼时 KDE 最高级别的赞助。这一赞助协议终止与2012年,取而代之的是 Kubuntu——一个运用 KDE 作为默认桌面环境的 Ubuntu 变种——的资金。 + +![](http://1426826955.rsc.cdn77.org/wp-content/uploads/2015/10/shuttleworth-kde.jpg) + +2009年,Shuttleworth 宣布他会从 CEO 退位以更好的关注与合作伙伴,产品设计和顾客体验。Jane Silber ——2004年起公司的COO——晋升CEO。 + +2010年,Mark 由于 Ubuntu 项目从 Open University 收到了荣誉学位。 + +2012年,Mark 和 Kenneth Rogoff 一同在牛津大学与 Peter Thiel 和 Garry Kasparov 就 **创新悖论**(The Innovation Enigma)展开辩论。 + +2013年,Mark 和 Ubuntu 一同被授予 **澳大利亚反个人隐私老大哥监控奖**(Austrian anti-privacy Big Brother Award),理由为把 Ubuntu 会把 Unity 桌面的搜索框的搜索结果发往 Canonical 服务器(译者:因此侵犯了个人隐私)。而一年前的2012年,Mark 曾经申明过这一过程极具匿名性。 + + +> “所有主流 PC 厂家现在都提供 Ubuntu 预安装选项。所以我们和业界的合作已经相当紧密了。但那些 PC 厂家对于给买家推广新东西这件事都很紧张。如果我们可以让买家习惯 Ubuntu 的桌面/平板/手机操作系统的体验,那他们也应该更愿意买预装 Ubuntu 的设备。因为没有哪个操作系统是通过抄袭模仿获得成功的。Android 很棒,如果我们想成功的话我们必须给市场带去更新更好的东西。整个环境都有停滞发展的危险,如果我们中没有人追寻未来的话。但如果你尝试去追寻未来了,那你必须接受不是所有人对未来的预见都和你一样这一事实。” +> +> — Mark Shuttleworth + +### Mark Shuttleworth 的太空之旅 ### + +Mark 在2002年由于作为世界第二名自费太空游客而闻名世界,同时他也是南非第一个旅行太空的人。这趟旅行 Mark 作为俄罗斯 Soyuz TM-34 的一名航空参与者加入,并支付了约两千万美元。2天后,Soyuz 太空梭抵达了国际空间站,在那里 Mark 呆了8天并参与了 AIDS 和 GENOME 研究的相关实验。2002年的晚些时候,Mark 乘坐 Soyuz TM-33 返回了地球。为了参与这趟旅行,Mark 花了一年时间准备与训练,包括7个月居住在俄罗斯的 Start City。 + + +![](http://1426826955.rsc.cdn77.org/wp-content/uploads/2015/10/Mark-Shuttleworth1.jpg) + +在太空中,Mark 与 Nelson Mandela 和另一个南非女孩 Michelle Foster (她问 Mark 要不要娶她)通过无线电进行了交谈。Mark 回避了结婚问题,在换话题之前他说他感到很荣幸。身患绝症的 Forster 和 Nelson Mandela 通过 Dream 基金会的赞助获得了与 Mark 交谈的机会。 + +归来后,Mark 在世界各地做了旅行,并和各地的学生就太空之旅发表了感言。 + + +>“粗略的统计数据表明 Ubuntu 的实际用户依然在增长。而我们的合作方——Dell,HP,Lenovo 和其他硬件生产商,以及游戏厂商 EA,Valve 都在加入我们——这让我觉得我们在引导一项很有意义的事业。” +> +> — Mark Shuttleworth + +### Mark Shuttleworth 的交通工具 ### + +Mark 有他自己的私人客机,Bombardier Global Express,经常被称为 Canonical 一号,但事实上此飞机是通过 HBD 风险投资公司注册拥有的。飞机侧面的喷绘龙图案是 HBD 风投公司的吉祥物,Norman。 + +### 与南非储蓄银行的法律冲突 ### + +在从南非转移25亿南非兰特去往 Isle of Man 的过程中,南非储蓄银行征收了 2.5 亿南非兰特的税金。Mark 上诉了,经过冗长的法庭唇枪舌战,南非储蓄银行被勒令返还 2.5 亿征税,以及其利息。Mark 宣布他会把这 2.5 亿存入信托基金,以用于帮助上诉宪法法院的案子。 + + +> “离境征税倒也不和宪法冲突。但离境征税的主要目的不是为了提高税收,而是通过监管资金流出来保护本国经济。” +> +> — 法官 Dikgang Moseneke + +2015年,南非宪法法院修正了低级法院的判决结果,并宣布了上述对于离岸征税的理解。 + +### Mark Shuttleworth 喜欢的东西 ### + +Cesária Évora, mp3s,Spring, Chelsea, finally seeing something obvious for first time, coming home, Sinatra, daydreaming, sundowners, flirting, d’Urberville, string theory, Linux, particle physics, Python, reincarnation, mig-29s, snow, travel, Mozilla, lime marmalade, body shots, the African bush, leopards, Rajasthan, Russian saunas, snowboarding, weightlessness, Iain m banks, broadband, Alastair Reynolds, fancy dress, skinny-dipping, flashes of insight, post-adrenaline euphoria, the inexplicable, convertibles, Clifton, country roads, international space station, machine learning, artificial intelligence, Wikipedia, Slashdot, kitesurfing, and Manx lanes. + +### Shuttleworth 不喜欢的东西 ### + +Admin, salary negotiations, legalese, and public speaking. + +-------------------------------------------------------------------------------- + +via: http://www.unixmen.com/mark-shuttleworth-man-behind-ubuntu-operating-system/ + +作者:[M.el Khamlichi][a] +译者:[jerryling315](https://blog.moelf.xyz) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.unixmen.com/author/pirat9/ From 9b03998194c7224f40ed6ac07762056f315281a9 Mon Sep 17 00:00:00 2001 From: "Cathon.ZHD" Date: Thu, 23 Jun 2016 23:08:26 +0800 Subject: [PATCH 0959/1469] translated --- ...re contributing to open source projects.md | 64 ------------------- ...re contributing to open source projects.md | 62 ++++++++++++++++++ 2 files changed, 62 insertions(+), 64 deletions(-) delete mode 100644 sources/talk/20160510 65% of companies are contributing to open source projects.md create mode 100644 translated/talk/20160510 65% of companies are contributing to open source projects.md diff --git a/sources/talk/20160510 65% of companies are contributing to open source projects.md b/sources/talk/20160510 65% of companies are contributing to open source projects.md deleted file mode 100644 index 886c3399b9..0000000000 --- a/sources/talk/20160510 65% of companies are contributing to open source projects.md +++ /dev/null @@ -1,64 +0,0 @@ -65% of companies are contributing to open source projects -========================================================== -[Cathon is translating...] - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BUSINESS_openseries.png?itok=s7lXChId) - -This year marks the 10th annual Future of Open Source Survey to examine trends in open source, hosted by Black Duck and North Bridge. The big takeaway from the survey this year centers around the mainstream acceptance of open source today and how much has changed over the last decade. - -The [2016 Future of Open Source Survey][1] analyzed responses from nearly 3,400 professionals. Developers made their voices heard in the survey this year, comprising roughly 70% of the participants. The group that showed exponential growth were security professionals, whose participation increased by over 450%. Their participation shows the increasing interest in ensuring that the open source community pays attention to security issues in open source software and securing new technologies as they emerge. - -Black Duck's [Open Source Rookies][2] of the Year awards identify some of these emerging technologies, like Docker and Kontena in containers. Containers themselves have seen huge growth this year–76% of respondents say their company has some plans to use containers. And an amazing 59% of respondents are already using containers in a variety of deployments, from development and testing to internal and external production environment. The developer community has embraced containers as a way to get their code out quickly and easily. - -It's not surprising that the survey shows a miniscule number of organizations having no developers contributing to open source software. When large corporations like Microsoft and Apple open source some of their solutions, developers gain new opportunities to participate in open source. I certainly hope this trend will continue, with more software developers contributing to open source projects at work and outside of work. - -### Highlights from the 2016 survey - -#### Business value - -* Open source is an essential element in development strategy with more than 65% of respondents relying on open source to speed development. -* More than 55% leverage open source within their production environments. - -#### Engine for innovation - -* Respondents reported use of open source to drive innovation through faster, more agile development; accelerated time to market and vastly superior interoperability. -* Additional innovation is afforded by open source's quality of solutions; competitive features and technical capabilities; and ability to customize. - -#### Proliferation of open source business models and investment - -* More diverse business models are emerging that promise to deliver more value to open source companies than ever before. They are not as dependent on SaaS and services/support. -* Open source private financing has increased almost 4x in five years. - -#### Security and management - -The development of best-in-class open source security and management practices has not kept pace with growth in adoption. Despite a proliferation of expensive, high-profile open source breaches in recent years, the survey revealed that: - -* 50% of companies have no formal policy for selecting and approving open source code. -* 47% of companies don’t have formal processes in place to track open source code, limiting their visibility into their open source and therefore their ability to control it. -* More than one-third of companies have no process for identifying, tracking or remediating known open source vulnerabilities. - -#### Open source participation on the rise - -The survey revealed an active corporate open source community that spurs innovation, delivers exponential value and shares camaraderie: - -* 67% of respondents report actively encouraging developers to engage in and contribute to open source projects. -* 65% of companies are contributing to open source projects. -* One in three companies have a fulltime resource dedicated to open source projects. -* 59% of respondents participate in open source projects to gain competitive edge. - -Black Duck and North Bridge learned a great deal this year about security, policy, business models and more from the survey, and we’re excited to share these findings. Thank you to our many collaborators and all the respondents for taking the time to take the survey. It’s been a great ten years, and I am happy that we can safely say that the future of open source is full of possibilities. - -Learn more, see the [full results][3]. - --------------------------------------------------------------------------------- - -via: https://opensource.com/business/16/5/2016-future-open-source-survey - -作者:[Haidee LeClair][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -[a]: https://opensource.com/users/blackduck2016 -[1]: http://www.slideshare.net/blackducksoftware/2016-future-of-open-source-survey-results -[2]: https://info.blackducksoftware.com/OpenSourceRookies2015.html -[3]: http://www.slideshare.net/blackducksoftware/2016-future-of-open-source-survey-results%C2%A0 diff --git a/translated/talk/20160510 65% of companies are contributing to open source projects.md b/translated/talk/20160510 65% of companies are contributing to open source projects.md new file mode 100644 index 0000000000..03290b0e97 --- /dev/null +++ b/translated/talk/20160510 65% of companies are contributing to open source projects.md @@ -0,0 +1,62 @@ +65% 的企业正致力于开源项目 +========================================================== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BUSINESS_openseries.png?itok=s7lXChId) + +今年 Black Duck 和 North Bridge 发布了第十届年度开源软件前景调查,来检验开源软件的发展趋势。今年这份调查的亮点在于,当前主流社会对开源软件的接受程度以及过去的十年中人们对开源软件态度的变化。 + +[2016 年的开源软件前景调查][1],分析了来自约3400位专家的反馈。今年的调查中,开发者发表了他们的看法,包括了大约 70% 的参与者。数据显示,安全专家的参与人数呈指数级增长,增长超过 450% 。他们的参与表明,开源社区开始逐渐关注开源软件中存在的安全问题,以及当新的技术出现时确保它们的安全性。 + +Black Duck 的年度 [开源新秀奖][2] 涉及到一些新出现的技术,如 Docker 和 Kontena 容器。容器技术这一年有了巨大的发展 ———— 76% 的受访者表示,他们的企业有一些使用容器技术的规划。而 59% 的受访者正准备使用容器技术完成大量的部署,从开发与测试,到内部与外部的生产环境部署。开发者社区已经把容器技术作为一种简单快速开发的方法。 + +调查显示,几乎每个组织都有开发者致力于开源软件,这一点毫不惊讶。当像微软和苹果这样的大公司将它们的一些解决方案开源时,开发者就获得了更多的机会来参与开源项目。我非常希望这样的趋势会延续下去,让更多的软件开发者无论在工作中,还是工作之余都可以致力于开源项目。 + +### 2016 年调查结果中的一些要点 + +#### 商业价值 + +* 开源软件是发展战略中的一个重要元素,超过 65% 的受访者使用开源软件来加速软件开发的进度。 +* 超过 55% 的受访者在生产环境中使用开源软件。 + +#### 创新的原动力 + +* 受访者表示,开源软件的使用让软件开发更加快速灵活,从而推进了创新;同时加速了软件推向市场的时间,也极大地减少了与上司沟通的时间。 +* 开源软件的优质解决方案,富有竞争力的特性,技术能力,以及可定制化的能力,也促进了更多的创新。 + +#### 开源商业模式与投资的激增 + +* 更多不同商业模式的出现给开源企业带来了前所未有的价值。这些价值并不依赖于云服务和技术支持。 +* 开源的私募融资在过去的五年内,已增长了将近四倍。 + +#### 安全和管理 + +一流的开源安全与管理实践的发展,并没有跟上人们使用开源不断增长的步伐。尽管备受关注的开源项目近年来爆炸式地增长,调查结果却指出: + +* 50% 的企业在选择和批准开源代码这方面没有出台正式的政策。 +* 47% 的企业没有正式的流程来跟踪开源代码,这就限制了它们对开源代码的了解,以及控制开源代码的能力。 +* 超过三分之一的企业没有用于识别,跟踪,和修复重大开源安全漏洞的流程。 + +#### 不断增长的开源参与者 + +调查结果显示,一个活跃的企业开源社区,激励创新,提供价值,共享情谊: + +* 67% 的受访者表示,它们积极鼓励开发者参与开源项目。 +* 65% 的企业正致力于开源项目。 +* 约三分之一的企业有专门为开源项目设置的全职岗位。 +* 59% 的受访者参与开源项目以获得竞争优势。 + +Black Duck 和 North Bridge 从今年的调查中了解了很多,如安全,政策,商业模式等。我们很兴奋能够分享这些新发现。感谢我们的合作者,以及所有参与我们调查的受访者。这是一个伟大的十年,我很高兴我们可以肯定地说,开源的未来充满了无限可能。 + +想要了解更多内容,可以查看完整的[调查结果][3]。 +-------------------------------------------------------------------------------- + +via: https://opensource.com/business/16/5/2016-future-open-source-survey + +作者:[Haidee LeClair][a] +译者:[Cathon](https://github.com/Cathon) +校对:[校对者ID](https://github.com/校对者ID) + +[a]: https://opensource.com/users/blackduck2016 +[1]: http://www.slideshare.net/blackducksoftware/2016-future-of-open-source-survey-results +[2]: https://info.blackducksoftware.com/OpenSourceRookies2015.html +[3]: http://www.slideshare.net/blackducksoftware/2016-future-of-open-source-survey-results%C2%A0 From bdc220e1cea94b96a3938a792357fa1a142572b6 Mon Sep 17 00:00:00 2001 From: Ping Date: Thu, 23 Jun 2016 17:34:38 +0800 Subject: [PATCH 0960/1469] Finished the Translating. --- ... 5 open source command shells for Linux.md | 90 ------------------- ... 5 open source command shells for Linux.md | 86 ++++++++++++++++++ 2 files changed, 86 insertions(+), 90 deletions(-) delete mode 100644 sources/tech/20160303 Top 5 open source command shells for Linux.md create mode 100644 translated/tech/20160303 Top 5 open source command shells for Linux.md diff --git a/sources/tech/20160303 Top 5 open source command shells for Linux.md b/sources/tech/20160303 Top 5 open source command shells for Linux.md deleted file mode 100644 index 8705ad2981..0000000000 --- a/sources/tech/20160303 Top 5 open source command shells for Linux.md +++ /dev/null @@ -1,90 +0,0 @@ -翻译中;by ping -Top 5 open source command shells for Linux -=============================================== - -keyword: shell , Linux , bash , zsh , fish , ksh , tcsh , license - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/terminal_blue_smoke_command_line_0.jpg?itok=u2mRRqOa) - -There are two kinds of Linux users: the cautious and the adventurous. - -On one side is the user who almost reflexively tries out ever new option which hits the scene. They’ve tried handfuls of window managers, dozens of distributions, and every new desktop widget they can find. - -On the other side is the user who finds something they like and sticks with it. They tend to like their distribution’s defaults. If they’re passionate about a text editor, it’s whichever one they mastered first. - -As a Linux user, both on the server and the desktop, for going on fifteen years now, I am definitely more in the second category than the first. I have a tendency to use what’s presented to me, and I like the fact that this means more often than not I can find thorough documentation and examples of most any use case I can dream up. If I used something non-standard, the switch was carefully researched and often predicated by a strong pitch from someone I trust. - -But that doesn’t mean I don’t like to sometimes try and see what I’m missing. So recently, after years of using the bash shell without even giving it a thought, I decided to try out four alternative shells: ksh, tcsh, zsh, and fish. All four were easy installs from my default repositories in Fedora, and they’re likely already packaged for your distribution of choice as well. - -Here’s a little bit on each option and why you might choose it to be your next Linux command-line interpreter. - -### bash - -First, let’s take a look back at the familiar. [GNU Bash][1], the Bourne Again Shell, has been the default in pretty much every Linux distribution I’ve used through the years. Originally released in 1989, bash has grown to easily become the most used shell across the Linux world, and it is commonly found in other unix-like operating systems as well. - -Bash is a perfectly respectable shell, and as you look for documentation of how to do various things across the Internet, almost invariably you’ll find instructions which assume you are using a bash shell. But bash has some shortcomings, as anyone who has ever written a bash script that’s more than a few lines can attest to. It’s not that you can’t do something, it’s that it’s not always particularly intuitive (or at least elegant) to read and write. For some examples, see this list of [common bash pitfalls][2]. - -That said, bash is probably here to stay for at least the near future, with its enormous install base and legions of both casual and professional system administrators who are already attuned to its usage, and quirks. The bash project is available under a [GPLv3][3] license. - -### ksh - -[KornShell][4], also known by its command invocation, ksh, is an alternative shell that grew out of Bell Labs in the 1980s, written by David Korn. While originally proprietary software, later versions were released under the [Eclipse Public License][5]. - -Proponents of ksh list a number of ways in which they feel it is superior, including having a better loop syntax, cleaner exit codes from pipes, an easier way to repeat commands, and associative arrays. It's also capable of emulating many of the behaviors of vi or emacs, so if you are very partial to a text editor, it may be worth giving a try. Overall, I found it to be very similar to bash for basic input, although for advanced scripting it would surely be a different experience. - -### tcsh - -[Tcsh][6] is a derivative of csh, the Berkely Unix C shell, and sports a very long lineage back to the early days of Unix and computing itself. - -The big selling point for tcsh is its scripting language, which should look very familiar to anyone who has programmed in C. Tcsh's scripting is loved by some and hated by others. But it has other features as well, including adding arguments to aliases, and various defaults that might appeal to your preferences, including the way autocompletion with tab and history tab completion work. - -You can find tcsh under a [BSD license][7]. - -### zsh - -[Zsh][8] is another shell which has similarities to bash and ksh. Originating in the early 90s, zsh sports a number of useful features, including spelling correction, theming, namable directory shortcuts, sharing your command history across multiple terminals, and various other slight tweaks from the original Bourne shell. - -The code and binaries for zsh can be distributed under an MIT-like license, though portions are under the GPL; check the [actual license][9] for details. - -### fish - -I knew I was going to like the Friendly Interactive Shell, [fish][10], when I visited the website and found it described tongue-in-cheek with "Finally, a command line shell for the 90s"—fish was written in 2005. - -The authors of fish offer a number of reasons to make the switch, all invoking a bit of humor and poking a bit of fun at shells that don't quite live up. Features include autosuggestions ("Watch out, Netscape Navigator 4.0"), support of the "astonishing" 256 color palette of VGA, but some actually quite helpful features as well including command completion based on the man pages on your machine, clean scripting, and a web-based configuration. - -Fish is licensed primarily unde the GPL version 2 but with portions under other licenses; check the repository for [complete information][11]. - -*** - -Looking for a more detailed rundown on the precise differences between each option? [This site][12] ought to help you out. - -So where did I land? Well, ultimately, I’m probably going back to bash, because the differences were subtle enough that someone who mostly used the command line interactively as opposed to writing advanced scripts really wouldn't benefit much from the switch, and I'm already pretty comfortable in bash. - -But I’m glad I decided to come out of my shell (ha!) and try some new options. And I know there are many, many others out there. Which shells have you tried, and which one do you prefer? Let us know in the comments! - - - - -via: https://opensource.com/business/16/3/top-linux-shells - -作者:[Jason Baker][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/jason-baker - -[1]: https://www.gnu.org/software/bash/ -[2]: http://mywiki.wooledge.org/BashPitfalls -[3]: http://www.gnu.org/licenses/gpl.html -[4]: http://www.kornshell.org/ -[5]: https://www.eclipse.org/legal/epl-v10.html -[6]: http://www.tcsh.org/Welcome -[7]: https://en.wikipedia.org/wiki/BSD_licenses -[8]: http://www.zsh.org/ -[9]: https://sourceforge.net/p/zsh/code/ci/master/tree/LICENCE -[10]: https://fishshell.com/ -[11]: https://github.com/fish-shell/fish-shell/blob/master/COPYING -[12]: http://hyperpolyglot.org/unix-shells - diff --git a/translated/tech/20160303 Top 5 open source command shells for Linux.md b/translated/tech/20160303 Top 5 open source command shells for Linux.md new file mode 100644 index 0000000000..d40eb58b54 --- /dev/null +++ b/translated/tech/20160303 Top 5 open source command shells for Linux.md @@ -0,0 +1,86 @@ +最牛的五个Linux开源command shell +=============================================== + +关键字: shell , Linux , bash , zsh , fish , ksh , tcsh , license + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/terminal_blue_smoke_command_line_0.jpg?itok=u2mRRqOa) + +这个世界上有两种Linux用户:敢于冒险的和态度谨慎的。 + +其中一类用户总是本能的去尝试任何能够戳中其痛点的新选择。他们尝试过不计其数的窗口管理器、系统发行版和几乎所有能找到的桌面插件。 + +另一类用户找到他们喜欢的东西后,会一直使用下去。他们往往喜欢所使用的系统发行版的默认选项。最先熟练掌握的文本编辑器会成为他们最钟爱的那一个。 + +作为一个使用桌面版和服务器版十五年之久的Linux用户,比起第一类来,我无疑属于第二类用户。我更倾向于使用现成的东西,如此一来,很多时候我就可以通过文档和示例方便地找到我所需要的使用案例。如果我决定选择使用非费标准的东西,这个切换过程一定会基于细致的研究,并且前提是来自挚友的大力推荐。 + +但这并不意味着我不喜欢尝试新事物并且查漏补失。所以最近一段时间,在我不假思索的使用了bash shell多年之后,决定尝试一下另外四个shell工具:ksh, tcsh, zsh, 和 fish. 这四个shell都可以通过我所以用的Fedora系统的默认库轻松安装,并且他们可能已经内置在你所使用的系统发行版当中了。 + +这里对每个选择都稍作介绍,并且阐述下它适合做为你的下一个Linux命令行解释器的原因所在。 + +### bash + +首先,我们回顾一下最为熟悉的一个。 [GNU Bash][1],又名 Bourne Again Shell,它是我这些年使用过的众多Linux发行版的默认选择。它最初发布于1989年,并且轻松成长为Linux世界中使用最广泛的shell,甚至常见于其他一些类Unix系统当中。 + +Bash是一个广受赞誉的shell,当你通过互联网寻找各种事情解决方法所需的文档时,总能够无一例外的发现这些文档都默认你使用的是bash shell。但Bash也有一些缺点存在,如果你写过Bash脚本就会发现我们写的代码总是得比真正所需要的多那么几行。这并不是说有什么事情是它做不到的,而是说它读写起来并不总是那么直观,至少是不够优雅。 + +如上所述,基于其巨大的安装量,并且考虑到各类专业和非专业系统管理员已经适应了它的使用方式和独特之处,至少在将来一段时间内,bash或许会一直存在。 + +### ksh + +[KornShell][4],或许你对这个名字并不熟悉,但是你一定知道它的调用命令 ksh。这个替代性的shell于80年代起源于贝尔实验室,由David Korn所写。虽然最初是一个专有软件,但是后期版本是在[Eclipse Public 许可][5]下发布的。 + +ksh的拥趸们列出了他们觉得其优越的诸多理由,包括更好的循环语法,清晰的管道退出代码,更简单的方式来处理重复命令和关联数组。它能够模拟vi和emacs的许多行为,所以如果你是一个重度文本编辑器患者,它值得你一试。最后,我发现它虽然在高级脚本方面拥有不同的体验,但在基本输入方面与bash如出一辙。 + +### tcsh + +[Tcsh][6]衍生于csh(Berkely Unix C shell),并且可以追溯到早期的Unix和计算本身。 + +Tcsh最大的卖点在于它的脚本语言,对于熟悉C语言编程的人来说,看起来会非常亲切。Tcsh的脚本编写有人喜欢,有人憎恶。但是它也有其他的技术特色,包括可以为aliases添加参数,各种可能迎合你偏好的默认行为,包括tab自动完成和将tab完成的工作记录下来以备后查。 + +你可以在[BSD 许可][7]下找到tcsh。 + +### zsh + +[Zsh][8]是另外一个与bash和ksh有着相似之处的shell。产生于90年代初,zsh支持众多有用的新技术,包括拼写纠正,主题化,可命名的目录快捷键,在多个终端中分享命令历史信息和各种相对于original Bourne shell的轻微调整。 + +虽然部分需要遵照GPL许可,但zsh的代码和二进制文件可以在MIT-like许可下进行分发; 你可以在 [actual license][9] 中查看细节。 + +### fish + +之前我访问了[fish][10]的主页,当看到 “好了,这是一个为90年代而生的命令行shell” 这条略带调侃的介绍时(fish完成于2005年),我就意识到我会爱上这个交互友好的shell的。 + +Fish的作者提供了若干切换过来的理由,shell中所有的不太实用的调用都有点小幽默并且能戳中笑点。这些特性包括自动建议("Watch out, Netscape Navigator 4.0"),支持“惊人”的256色VGA调色,不过也有真正有用的特性,包括根据机器的man页面自动补全命令,清除脚本和基于web的配置。 + +Fish的许可主要基于第二版GPL,但有些部分是在其他许可下的。你可以查看资源库来了解[完整信息][11] + +*** + +如果你想要寻找关于每个选择确切不同之处的详尽纲要,[这个网站][12]应该可以帮到你。 + +我的立场到底是怎样的呢?好吧,最终我应该还是会重新投入bash的怀抱,因为对于大多数时间都在使用命令行交互的人来说,切换过程对于高级脚本能带来的好处微乎其微,并且我已经习惯于使用bash了。 + +但是我很庆幸做出了敞开大门并且尝试新选择的决定。我知道门外还有许许多多其他的东西。你尝试过哪些shell,更中意哪一个?请在评论里告诉我们。 + +本文来源: https://opensource.com/business/16/3/top-linux-shells + +作者:[Jason Baker][a] +译者:[mr-ping](https://github.com/mr-ping) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/jason-baker + +[1]: https://www.gnu.org/software/bash/ +[2]: http://mywiki.wooledge.org/BashPitfalls +[3]: http://www.gnu.org/licenses/gpl.html +[4]: http://www.kornshell.org/ +[5]: https://www.eclipse.org/legal/epl-v10.html +[6]: http://www.tcsh.org/Welcome +[7]: https://en.wikipedia.org/wiki/BSD_licenses +[8]: http://www.zsh.org/ +[9]: https://sourceforge.net/p/zsh/code/ci/master/tree/LICENCE +[10]: https://fishshell.com/ +[11]: https://github.com/fish-shell/fish-shell/blob/master/COPYING +[12]: http://hyperpolyglot.org/unix-shells + From 908d469fa8127ab910a190c684594dd9949e5d9b Mon Sep 17 00:00:00 2001 From: Ping Date: Fri, 24 Jun 2016 10:50:31 +0800 Subject: [PATCH 0961/1469] Add some translated content --- ... How to Add Cron Jobs in Linux and Unix.md | 41 ++++++++++++++++++- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/translated/tech/20160605 How to Add Cron Jobs in Linux and Unix.md b/translated/tech/20160605 How to Add Cron Jobs in Linux and Unix.md index 51935ae54b..01ca7eb428 100644 --- a/translated/tech/20160605 How to Add Cron Jobs in Linux and Unix.md +++ b/translated/tech/20160605 How to Add Cron Jobs in Linux and Unix.md @@ -24,8 +24,6 @@ - **用户的 crontabs**: 用户可以使用`corntab`命令来安装属于他们自己的定时任务。 第六个字段为需要运行的命令行, 所有的命令行都会以创建 crontab 的用户的身份运行。 -**Note**: This faq features cron implementations written by Paul Vixie and included in many [Linux][2] distributions and Unix like systems such as in the popular 4th BSD edition. The syntax is [compatible][3] with various implementations of crond. - **注意**: 这种问答形式的`Cron`实现是由 Paul Vixie 所写的,并且被许多 [Linux][2] 发行版和类Unix系统(如广受欢迎的第四版BSD)包含其中。它的语法被各种计划任务的实现所[兼容][3]。 该如何安装、创建或编辑我们自己的定时任务呢? @@ -101,6 +99,45 @@ $ crontab -e - **分隔符 (/)** : 此操作符指定了一个步进值,例如: `0-23/` 可以用于小时字段来指定命令行每小时执行一次。步进值也可以跟在星号操作符后边,如果你希望命令行每2小时执行一次,可以这样写 `*/2`。 +### 如何将邮件显示出来? + +默认情况下,命令行或者脚本的输出内容(如果有的话)会发送到你的本地邮箱账户中。若想停止收到`crontab`发送的邮件,需要添加 `>/dev/null 2>&1` 这段内容,例如: + +``` +0 3 * * * /root/backup.sh >/dev/null 2>&1 +``` + +如果想要将输出内容发送到指定的邮件账户中,你得定义一个MAILTO变量,假设我们要发送至 vivek@nixcraft.in ,代码如下所示: + +``` +MAILTO="vivek@nixcraft.in" +0 3 * * * /root/backup.sh >/dev/null 2>&1 +``` + +访问 “[使用Crontab命令显示邮件提示](http://www.cyberciti.biz/faq/disable-the-mail-alert-by-crontab-command/)” 查看更多信息。 + + +### 任务:列出你所有的定时任务 + +键入以下命令: + +``` +# crontab -l +# crontab -u username -l +``` + +使用如下命令删除所有的定时任务: + +``` +# 删除当前定时任务 # +crontab -r +``` + +``` +## 删除某用户名下的定时任务,此命令需以root用户身份执行 ## +crontab -r -u username +``` + ### 使用特殊字符保存时间 你可以使用以下8个特殊字符中的其中一个替代头五个字段。这样不但可以保存时间,也可以提高可读性。 From 71b6731b47503fe781bfe9b80d55b851ac9d9a4e Mon Sep 17 00:00:00 2001 From: hkurj <663831938@qq.com> Date: Sat, 25 Jun 2016 00:13:04 +0800 Subject: [PATCH 0962/1469] translate --- .../20160621 Basic Linux Networking Commands You Should Know.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160621 Basic Linux Networking Commands You Should Know.md b/sources/tech/20160621 Basic Linux Networking Commands You Should Know.md index 56ecdb9664..48d12dd363 100644 --- a/sources/tech/20160621 Basic Linux Networking Commands You Should Know.md +++ b/sources/tech/20160621 Basic Linux Networking Commands You Should Know.md @@ -1,3 +1,4 @@ +translating by hkurj Basic Linux Networking Commands You Should Know ================================================== From 14511b3657b3aa0aa5b6b8c190e937247b9c45cf Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 24 Jun 2016 17:28:28 +0800 Subject: [PATCH 0963/1469] =?UTF-8?q?20160624-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...inux Package Managers for Linux Newbies.md | 117 ++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 sources/talk/20160620 5 Best Linux Package Managers for Linux Newbies.md diff --git a/sources/talk/20160620 5 Best Linux Package Managers for Linux Newbies.md b/sources/talk/20160620 5 Best Linux Package Managers for Linux Newbies.md new file mode 100644 index 0000000000..dadf1e1fb0 --- /dev/null +++ b/sources/talk/20160620 5 Best Linux Package Managers for Linux Newbies.md @@ -0,0 +1,117 @@ +5 Best Linux Package Managers for Linux Newbies +===================================================== + + +One thing a new Linux user will get to know as he/she progresses in using it is the existence of several Linux distributions and the different ways they manage packages. + +Package management is very important in Linux, and knowing how to use multiple package managers can proof life saving for a power user, since downloading or installing software from repositories, plus updating, handling dependencies and uninstalling software is very vital and a critical section in Linux system Administration. + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Best-Linux-Package-Managers.png) +>Best Linux Package Managers + +Therefore to become a Linux power user, it is significant to understand how the major Linux distributions actually handle packages and in this article, we shall take a look at some of the best package managers you can find in Linux. + +Here, our main focus is on relevant information about some of the best package managers, but not how to use them, that is left to you to discover more. But I will provide meaningful links that point out usage guides and many more. + +### 1. DPKG – Debian Package Management System + +Dpkg is a base package management system for the Debian Linux family, it is used to install, remove, store and provide information about `.deb` packages. + +It is a low-level tool and there are front-end tools that help users to obtain packages from remote repositories and/or handle complex package relations and these include: + +Don’t Miss: [15 Practical Examples of “dpkg commands” for Debian Based Distros][1] + +#### APT (Advanced Packaging Tool) + +It is a very popular, free, powerful and more so, useful command line package management system that is a front end for dpkg package management system. + +Users of Debian or its derivatives such as Ubuntu and Linux Mint should be familiar with this package management tool. + +To understand how it actually works, you can go over these how to guides: + +Don’t Miss: [15 Examples of How to Use New Advanced Package Tool (APT) in Ubuntu/Debian][2] + +Don’t Miss: [25 Useful Basic Commands of APT-GET and APT-CACHE for Package Management][3] + +#### Aptitude Package Manager + +This is also a popular command line front-end package management tool for Debian Linux family, it works similar to APT and there have been a lot of comparisons between the two, but above all, testing out both can make you understand which one actually works better. + +It was initially built for Debian and its derivatives but now its functionality stretches to RHEL family as well. You can refer to this guide for more understanding of APT and Aptitude: + +Don’t Miss: [What is APT and Aptitude? and What’s real Difference Between Them?][4] + +#### Synaptic Package Manager + +Synaptic is a GUI package management tool for APT based on GTK+ and it works fine for users who may not want to get their hands dirty on a command line. It implements the same features as apt-get command line tool. + +### 2. RPM (Red Hat Package Manager) + +This is the Linux Standard Base packing format and a base package management system created by RedHat. Being the underlying system, there several front-end package management tools that you can use with it and but we shall only look at the best and that is: + +#### YUM (Yellowdog Updater, Modified) + +It is an open source and popular command line package manager that works as a interface for users to RPM. You can compare it to APT under Debian Linux systems, it incorporates the common functionalities that APT has. You can get a clear understanding of YUM with examples from this how to guide: + +Don’t Miss: [20 Linux YUM Commands for Package Management][5] + +#### DNF – Dandified Yum + +It is also a package manager for the RPM-based distributions, introduced in Fedora 18 and it is the next generation of version of YUM. + +If you have been using Fedora 22 onwards, you must have realized that it is the default package manager. Here are some links that will provide you more information about DNF and how to use it: + +Don’t Miss: [DNF – The Next Generation Package Management for RPM Based Distributions][6] + +Don’t Miss: [27 ‘DNF’ Commands Examples to Manage Fedora Package Management][7] + +### 3. Pacman Package Manager – Arch Linux + +It is a popular and powerful yet simple package manager for Arch Linux and some little known Linux distributions, it provides some of the fundamental functionalities that other common package managers provide including installing, automatic dependency resolution, upgrading, uninstalling and also downgrading software. + +But most effectively, it is built to be simple for easy package management by Arch users. You can read this [Pacman overview][8] which explains into details some of its functions mentioned above. + +### 4. Zypper Package Manager – openSUSE + +It is a command line package manager on OpenSUSE Linux and makes use of the libzypp library, its common functionalities include repository access, package installation, resolution of dependencies issues and many more. + +Importantly, it can also handle repository extensions such as patterns, patches, and products. New OpenSUSE user can refer to this following guide to master it. + +Don’t Miss: [45 Zypper Commands to Master OpenSUSE Package Management][9] + +### 5. Portage Package Manager – Gentoo + +It is a package manager for Gentoo, a less popular Linux distribution as of now, but this won’t limit it as one of the best package managers in Linux. + +The main aim of the Portage project is to make a simple and trouble free package management system to include functionalities such as backwards compatibility, automation plus many more. + +For better understanding, try reading [Portage project page][10]. + +### Concluding Remarks + +As I already hinted at the beginning, the main purpose of this guide was to provide Linux users a list of the best package managers but knowing how to use them can be done by following the necessary links provided and trying to test them out. + +Users of the different Linux distributions will have to learn more on their own to better understand the different package managers mentioned above. + + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/linux-package-managers/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tecmint+%28Tecmint%3A+Linux+Howto%27s+Guide%29 + +作者:[Ravi Saive][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.tecmint.com/author/admin/ +[1]: http://www.tecmint.com/dpkg-command-examples/ +[2]: http://www.tecmint.com/apt-advanced-package-command-examples-in-ubuntu/ +[3]: http://www.tecmint.com/useful-basic-commands-of-apt-get-and-apt-cache-for-package-management/ +[4]: http://www.tecmint.com/difference-between-apt-and-aptitude/ +[5]: http://www.tecmint.com/20-linux-yum-yellowdog-updater-modified-commands-for-package-mangement/ +[6]: http://www.tecmint.com/dnf-next-generation-package-management-utility-for-linux/ +[7]: http://www.tecmint.com/dnf-commands-for-fedora-rpm-package-management/ +[8]: https://wiki.archlinux.org/index.php/Pacman +[9]: http://www.tecmint.com/zypper-commands-to-manage-suse-linux-package-management/ +[10]: https://wiki.gentoo.org/wiki/Project:Portage From 35d263dd3bf30633a2034b4b263451f559ecfb5d Mon Sep 17 00:00:00 2001 From: martin qi Date: Fri, 24 Jun 2016 19:04:42 +0800 Subject: [PATCH 0964/1469] Translating --- ...Smart Way to Lock User Virtual Console or Terminal in Linux.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160611 vlock – A Smart Way to Lock User Virtual Console or Terminal in Linux.md b/sources/tech/20160611 vlock – A Smart Way to Lock User Virtual Console or Terminal in Linux.md index 36703d74dc..9e940ab235 100644 --- a/sources/tech/20160611 vlock – A Smart Way to Lock User Virtual Console or Terminal in Linux.md +++ b/sources/tech/20160611 vlock – A Smart Way to Lock User Virtual Console or Terminal in Linux.md @@ -1,3 +1,5 @@ +martin + vlock – A Smart Way to Lock User Virtual Console or Terminal in Linux ======================================================================= From b0408dbfef57ccedfc5e0ada37add6f1e792283d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=9C=E9=A3=8E=E5=94=AF=E7=AC=91?= Date: Fri, 24 Jun 2016 22:07:00 +0800 Subject: [PATCH 0965/1469] translating by dongfengweixiao --- ... PowerPC gains an Android 4.4 port with Big Endian support.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160620 PowerPC gains an Android 4.4 port with Big Endian support.md b/sources/tech/20160620 PowerPC gains an Android 4.4 port with Big Endian support.md index c803d30e6c..5e2acd0659 100644 --- a/sources/tech/20160620 PowerPC gains an Android 4.4 port with Big Endian support.md +++ b/sources/tech/20160620 PowerPC gains an Android 4.4 port with Big Endian support.md @@ -1,3 +1,4 @@ +translating(东风唯笑)这个是大坑啊 PowerPC gains an Android 4.4 port with Big Endian support =========================================================== From 4b97e66865dad5947251054de455ad6a957048d6 Mon Sep 17 00:00:00 2001 From: Rubik Date: Fri, 24 Jun 2016 23:41:08 +0800 Subject: [PATCH 0966/1469] =?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 翻译新人,若有不当烦请指正,多谢。 --- ... 6 Amazing Linux Distributions For Kids.md | 71 ++++++++++--------- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/sources/tech/20160616 6 Amazing Linux Distributions For Kids.md b/sources/tech/20160616 6 Amazing Linux Distributions For Kids.md index 4d6ecdfd8f..7a8169cd6a 100644 --- a/sources/tech/20160616 6 Amazing Linux Distributions For Kids.md +++ b/sources/tech/20160616 6 Amazing Linux Distributions For Kids.md @@ -1,98 +1,99 @@ -[HaohongWANG Translating] -6 Amazing Linux Distributions For Kids +[Translated by HaohongWANG] +//校对爸爸辛苦了!>_< +惊艳!6款面向儿童的 Linux 发行版 ====================================== -Linux and open source is the future and there is no doubt about that, and to see this come to a reality, a strong foundation has to be lied, by starting from the lowest level possible and that is exposing kids to Linux and teaching them how to use Linux operating systems. +毫无疑问未来是属于 Linux 和开源的。为了实现这样的未来、使Linux占据一席之地,人们已经着手从尽可能低的水平开始开发面向儿童的Linux发行版,并尝试教授他们如何使用Linux操作系统。 ![](http://www.tecmint.com/wp-content/uploads/2016/05/Linux-Distros-For-Kids.png) ->Linux Distros For Kids +>面向儿童的 Linux 发行版 -Linux is a very powerful operating system and that is one of the reasons why it powers a lot of servers on the Internet. Though there have been concerns about its user friendliness which has brought about debate of how it will over take Mac OSX and Windows on desktop computers, I think users need to accept Linux as it is to realize its real power. +Linux 是一款非常强大的操作系统,原因之一便是它驱动了互联网上绝大多数的服务器。但出于对其用户友好性的担忧,坊间时常展开有关于 Linux 应如何取代 Mac OS X 或 Windows 的辩论。而我认为用户应该接受 Linux 来见识它真正的威力。 -Today, Linux powers a lot of machines out there, from mobile phones, to tablets, laptops, workstations, servers, supercomputers, cars, air traffic control systems, refrigerators and many more. With all this and more yet to come in the near future, as I had already stated at the beginning, Linux is the operating system for future computing. +如今,Linux 运行在绝大多数设备上,从智能手机到平板电脑,笔记本电脑,工作站,服务器,超级计算机,再到汽车,航空管制系统,甚至电冰箱,都有 Linux 的身影。正如我在开篇所说,有了这一切, Linux 是未来的操作系统。 ->Read Also: [30 Big Companies and Devices Running on Linux][1] +>参考阅读: [30 Big Companies and Devices Running on Linux][1] -Because the future belongs to the kids of today, then introducing them to technologies that will change the future is the way to go. Therefore they have to be introduced at an early stage to start learning computer technologies and Linux as a special case. +未来是属于孩子们的,教育要从娃娃抓起。所以,要让小孩子尽早地学习计算机、了解 Linux 、接触科学技术。这是改变未来图景的最好方法。 -One thing common to children is curiosity and early learning can help instill the a character of exploration in them when the learning environment is designed to suit them. +一个常见的现象是,当儿童在一个适合他的环境中学习时,好奇心和早期学习的能力会使他自己养成喜好探索的性格。 -Having looked some quick reasons why kids should learn Linux, let us now go through a list of exciting Linux distributions that you can introduce your kids to, so that they can start using and learning Linux. +说了这么多儿童应该学习 Linux 的原因,接下来我就列出这些令人激动的发行版。你可以把它们推荐给小孩子来帮助他们开始学习使用 Linux 。 ### Sugar on a Stick -It is a project by Sugar Labs that aims at designing free tools to support learning among children by making them gain skills in exploring, discovering, creating and also reflecting on ideas. It is a non-profit organization led by volunteers. +Sugar on a Stick (译注:“糖在棒上”)是 Sugar Labs 旗下的工程,Sugar Labs 是一个由志愿者领导的非盈利组织。这一发行版旨在设计大量的免费工具来使儿童在探索、发现、创造中认知自己的思想。 ![](http://www.tecmint.com/wp-content/uploads/2016/05/Sugar-Neighborhood-View.png) ->Sugar Neighborhood View +>Sugar Neighborhood 界面 ![](http://www.tecmint.com/wp-content/uploads/2016/05/Sugar-Activity-Library.png) ->Sugar Activity Library +>Sugar 应用程序 -You can think of sugar as both a desktop and a collection of learning activities that help encourage active involvement from children who are learning. +你既可以将 Sugar 看作是普通的桌面环境,也可以把它当做是帮助鼓励孩子学习、提高参与活动的积极性的一款应用合集。 -Visit Homepage: +访问主页: ### Edubuntu -This is a grassroots project that is based on the most popular Linux distribution today, Ubuntu. It is intended get schools, homes and communities to easily install and use free Ubuntu software. +Edubuntu 是基于当下最流行的发行版 Ubuntu 而开发的一款草根发行版。主要致力于降低学校、家庭和社区安装、使用 Ubuntu 自由软件的难度。 ![](http://www.tecmint.com/wp-content/uploads/2016/05/Edubuntu-Apps.jpg) ->Edubuntu Desktop Apps +>Edubuntu 桌面应用 -It is supported by different groups of students, teachers, parents, stake holders and also hackers who believe in free learning and sharing of knowledge for self improvement and also community based development. +它的桌面应用由来自不同组织的学生、教师、家长、一些利益相关者甚至黑客来提供。他们都笃信社区的发展和知识的共享是自由学习和自由分享的基石。 -The main aim of the project is to assemble a system that can offer free software to enhance learning and education by making it easy for users to install and also maintain software. +该项目的主要目标是组建一款安装、管理软件难度低的操作系统以增长使用 Linux 学习和教育的用户数量。 -Visit Homepage: +访问主页: ### Doudou Linux -It is designed specifically for children to experience ease in using a computer while building creative thinking in them. It provides simple yet educative applications that allows kids to learn and discover new ideas while using it. +Doudou Linux 是专为方便儿童使用而设计的发行版,能在构建中激发儿童的创造性思维。它提供了简单但是颇具教育意义的应用来使儿童在应用过程中学习发现新的知识。 ![](http://www.tecmint.com/wp-content/uploads/2016/05/Doudou-Linux.png) >Doudou Linux -One important thing about Doudou Linux is its content filtering feature, which prevents children from visiting restricted content on the web. For more kids protection, it also includes user privacy on the Internet, automatically removes adds from web pages and many more. +其最引人注目的一点便是内容过滤功能,顾名思义,它能够阻止孩童访问网络上的禁止内容。如果想要更进一步的儿童保护功能,Doudou Linux 还提供了互联网用户隐私功能,能够去除网页中的特定加载内容。 -Visit Homepage: +访问主页: ### LinuxKidX -It is a LiveCD based on Slackware Linux with a long list of educational software for kids to learn form. It uses KDE as the default Desktop Environment and includes software such as Ktouch a typing tutor, Kstars as virtual planetaruim, Kalzium a periodic table, KwordQuiz among others. +这是一款整合了许多专为儿童的教育类软件的 Slackware Linux 的 LiveCD。它使用 KDE 作为默认桌面环境并配置了诸如 Ktouch 打字指导,Kstars 虚拟天文台,Kalzium 元素周期表和 KwordQuiz 单词测试等应用。 ![](http://www.tecmint.com/wp-content/uploads/2016/05/LinuxKidX.jpg) >LinuxKidX -Visit Homepage: +访问主页: ### Ubermix -It is a free software that is built from the ground based on Ubuntu Linux and is intended for educational purposes. It comes with over 60 free software reinstalled and helps to make learning and teaching easy for students and teachers respectively. +Ubermix 基于 Ubuntu 构建,同样以教学为目的。默认配备了超过60款应用,帮助学生更好地学习,同时给教师教学提供便利。 ![](http://www.tecmint.com/wp-content/uploads/2016/05/ubermix.png) >Ubermix Linux -Some of its features include 5 minutes installation and also few seconds quick recovery mechanism. It should work well well for teenage children. +Ubermix 还具有5分钟快速安装和快速恢复等功能,可以给小孩子更好的帮助。 -Visit Homepage: +访问主页: ### Qimo -I have added this to list because many readers are expected to ask about Qimo, but as of this writing, the Qimo for kids development team has retired from the project, therefore no more development it expected. +因为很多读者曾向我询问过 Qimo 发行版的情况,所以我把它写进这篇文章。但是截止发稿时,Qimo 儿童版的开发已经终止,不再提供更新。 ![](http://www.tecmint.com/wp-content/uploads/2016/05/Qimo-Linux.png) >Qimo Linux -But you can still find most of the games for kids in Ubuntu and other Linux distributions. As they have mentioned, they are not done working on an educational software for kids and are developing an android application for children to improve their literacy skills. +你仍然可以在 Ubuntu 或者其他的 Linux 发行版中找到大多数儿童游戏。正如这些开发商所说,他们不仅在为儿童制作教育软件,同时也在开发增长儿童文化水平的安卓应用。 -You can read more from their official website and expect more from them in the future. +如果你想进一步了解,可以移步他们的官方网站。 -Visit Homepage: +访问主页: -That is it for now, in case there are more Linux operating systems intended for kids or children out there, which I have not included in this list, you can let us know by leaving a comment. +以上这些便是我所知道的面向儿童的Linux发行版,或有缺漏,欢迎评论补充。 -You can also let us know of what you think of introducing kids to Linux and the future of Linux especially on Desktop computers. +如果你想探讨桌面 Linux 的发展前景或是如何引导儿童接触 Linux ,欢迎与我联系。 -------------------------------------------------------------------------------- @@ -100,7 +101,7 @@ via: http://www.tecmint.com/best-linux-distributions-for-kids/?utm_source=feedbu 作者:[Aaron Kili][a] -译者:[译者ID](https://github.com/译者ID) +译者:[HaohongWANG](https://github.com/HaohongWANG) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From dccd09633121b6ca06ae952af5a15fe5d880c515 Mon Sep 17 00:00:00 2001 From: Jeff Tsang Date: Fri, 24 Jun 2016 23:59:15 +0800 Subject: [PATCH 0967/1469] translating by itsang --- sources/tech/20160511 4 Container Networking Tools to Know.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160511 4 Container Networking Tools to Know.md b/sources/tech/20160511 4 Container Networking Tools to Know.md index 5b80791c6f..220d41644d 100644 --- a/sources/tech/20160511 4 Container Networking Tools to Know.md +++ b/sources/tech/20160511 4 Container Networking Tools to Know.md @@ -1,3 +1,4 @@ +[Translating by itsang] 4 Container Networking Tools to Know ======================================= From 4f9718703ef7e1129453f5ad4ea4ba8b4d93abf4 Mon Sep 17 00:00:00 2001 From: pengkai Date: Sat, 25 Jun 2016 00:02:34 +0800 Subject: [PATCH 0968/1469] kylepeng93 is translating --- ... A newcomer's guide to navigating OpenStack Infrastructure.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160416 A newcomer's guide to navigating OpenStack Infrastructure.md b/sources/tech/20160416 A newcomer's guide to navigating OpenStack Infrastructure.md index 4fa50b0a45..25dc193fdc 100644 --- a/sources/tech/20160416 A newcomer's guide to navigating OpenStack Infrastructure.md +++ b/sources/tech/20160416 A newcomer's guide to navigating OpenStack Infrastructure.md @@ -1,3 +1,4 @@ +translating by kylepeng93 A newcomer's guide to navigating OpenStack Infrastructure =========================================================== From d37d301d979ce840ffcfcde676e69dea072f2940 Mon Sep 17 00:00:00 2001 From: martin qi Date: Sat, 25 Jun 2016 10:53:54 +0800 Subject: [PATCH 0969/1469] Translated --- ...User Virtual Console or Terminal in Linux.md | 100 ------------------ ...User Virtual Console or Terminal in Linux.md | 99 +++++++++++++++++ 2 files changed, 99 insertions(+), 100 deletions(-) delete mode 100644 sources/tech/20160611 vlock – A Smart Way to Lock User Virtual Console or Terminal in Linux.md create mode 100644 translated/tech/20160611 vlock – A Smart Way to Lock User Virtual Console or Terminal in Linux.md diff --git a/sources/tech/20160611 vlock – A Smart Way to Lock User Virtual Console or Terminal in Linux.md b/sources/tech/20160611 vlock – A Smart Way to Lock User Virtual Console or Terminal in Linux.md deleted file mode 100644 index 9e940ab235..0000000000 --- a/sources/tech/20160611 vlock – A Smart Way to Lock User Virtual Console or Terminal in Linux.md +++ /dev/null @@ -1,100 +0,0 @@ -martin - -vlock – A Smart Way to Lock User Virtual Console or Terminal in Linux -======================================================================= - -Virtual consoles are very important features of Linux, and they provide a system user a shell prompt to use the system in a non-graphical setup which you can only use on the physical machine but not remotely. - -A user can use several virtual console sessions at the same time just by switching form one virtual console to another. - -![](http://www.tecmint.com/wp-content/uploads/2016/05/vlock-Lock-User-Terminal-in-Linux.png) ->vlock Lock User Console or Terminal in Linux - -In this how to guide, we shall look at how to lock user virtual console or terminal console in Linux systems using vlock program. - -### What is vlock? - -vlock is a utility used to lock one or several user virtual console sessions. vlock is important on a multi user system, it allows users to lock their own sessions while other users can still use the same system via other virtual consoles. Where necessary, the entire console can be locked down and also switching virtual console disabled. - -vlock primarily works for console sessions and also has support for locking non-console sessions but this has not been tested fully. - -### Installing vlock in Linux - -To install vlock program on your respective Linux systems, use: - -``` -# yum install vlock [On RHEL / CentOS / Fedora] -$ sudo apt-get install vlock [On Ubuntu / Debian / Mint] -``` - -### How to use vlock in Linux - -There are few options that you can use with vlock and the general syntax is: - -``` -# vlock option -# vlock option plugin -# vlock option -t plugin -``` - -#### vlock common options and usage: - -1. To lock current virtual console or terminal session of user, run the following command: - - ``` - # vlock --current - ``` - - ![](http://www.tecmint.com/wp-content/uploads/2016/05/Lock-User-Terminal-Session-in-Linux.png) - >Lock User Terminal Session in Linux - - The options -c or --current, means lock the current session and it is the default behavior when you run vlock. - -2. To lock all your virtual console sessions and also disable virtual console switching, run the command below: - - ``` - # vlock --all - ``` - - ![](http://www.tecmint.com/wp-content/uploads/2016/05/Lock-All-Linux-Terminal-Sessions.png) - >Lock All Linux Terminal Sessions - - The options -a or --all, when used, it locks all user’s console sessions and also disables virtual console switching. - - These other options can only work when vlock was compiled with plugin support and they include: - -3. The options -n or --new, when invoked, it means switch to a new virtual console before user’s console sessions are locked. - ``` - # vlock --new - ``` - -4. The options -s or --disable-sysrq, it disables the SysRq mechanism while virtual consoles are locked by a user and works only when -a or --all is invoked. - - ``` - # vlock -sa - ``` - -5. The options -t or --timeout , invoked to set a timeout for screensaver plugin. - - ``` - # vlock --timeout 5 - ``` - -You can use `-h` or `--help` and `-v` or `--version` to view help messages and version respectively. - -We shall leave it at that and also know that you can include a `~/.vlockrc` file which is read by vlock program during system startup and [add the environmental variables][1] that you can check in the manaul entry page, especially users of Debian based distros. - -To find out more or add any information which may not be included here, simply drop a message below in the comment section. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/vlock-lock-user-virtual-console-terminal-linux/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tecmint+%28Tecmint%3A+Linux+Howto%27s+Guide%29 - -作者:[Aaron Kili][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/aaronkili/ -[1]: http://www.tecmint.com/set-path-variable-linux-permanently/ diff --git a/translated/tech/20160611 vlock – A Smart Way to Lock User Virtual Console or Terminal in Linux.md b/translated/tech/20160611 vlock – A Smart Way to Lock User Virtual Console or Terminal in Linux.md new file mode 100644 index 0000000000..26c74b019e --- /dev/null +++ b/translated/tech/20160611 vlock – A Smart Way to Lock User Virtual Console or Terminal in Linux.md @@ -0,0 +1,99 @@ +vlock – 一个锁定 Linux 用户虚拟控制台或终端的好方法 +======================================================================= + +虚拟控制台是 Linux 非常重要的功能,他们为使用系统的用户提供了 shell 提示符,以保证用户在登录和远程登录一个未安装图形界面的系统时仍能使用。 + +一个用户可以同时操作多个虚拟控制台会话,只需在虚拟控制台间来回切换即可。 + +![](http://www.tecmint.com/wp-content/uploads/2016/05/vlock-Lock-User-Terminal-in-Linux.png) +>用 vlock 锁定 Linux 用户控制台或终端 + +这篇使用指导,旨在教会大家如何使用 vlock 来锁定用户虚拟控制台和终端。 + +### vlock 是什么? + +vlock 是一个用于锁定一个或多个用户虚拟控制台用户会话的工具。在多用户系统中 vlock 是扮演着重要的角色,他让用户可以在锁住自己会话的同时不影响其他用户通过其他虚拟控制台操作同一个系统。必要时,还可以锁定所有的控制台,同时禁止在虚拟控制台间切换。 + +vlock 的主要功能面向控制台会话方面,同时也支持非控制台会话的锁定,但该功能的测试还不完全。 + +### 在 Linux 上安装 vlock + +根据你的 Linux 系统选择 vlock 安装指令: + +``` +# yum install vlock [On RHEL / CentOS / Fedora] +$ sudo apt-get install vlock [On Ubuntu / Debian / Mint] +``` + +### 在 Linux 上使用 vlock + +vlock 操作选项的常规语法: + +``` +# vlock option +# vlock option plugin +# vlock option -t plugin +``` + +#### vlock 常用选项及用法: + +1. 锁定用户的当前虚拟控制台或终端会话,如下: + + ``` + # vlock --current + ``` + + ![](http://www.tecmint.com/wp-content/uploads/2016/05/Lock-User-Terminal-Session-in-Linux.png) + >锁定 Linux 用户终端会话 + + 选项 -c 或 --current,锁定当前的会话,该参数为运行 vlock 时的默认行为。 + +2. 锁定所有你的虚拟控制台会话,并禁用虚拟控制台间切换,命令如下: + + ``` + # vlock --all + ``` + + ![](http://www.tecmint.com/wp-content/uploads/2016/05/Lock-All-Linux-Terminal-Sessions.png) + >锁定所有 Linux 终端会话 + + 选项 -a 或 --all,锁定所有用户的控制台会话,并禁用虚拟控制台间切换。 + + 其他的选项只有在编译 vlock 时编入了相关插件支持及其引用后,才能发挥作用: + +3. 选项 -n 或 --new,调用时后,会在锁定用户的控制台会话前切换到一个新的虚拟控制台。 + + ``` + # vlock --new + ``` + +4. 选项 -s 或 --disable-sysrq,在禁用虚拟控制台的同时禁用 SysRq 功能,只有在与 -a 或 --all 同时使用时才起作用。 + + ``` + # vlock -sa + ``` + +5. 选项 -t 或 --timeout ,用以设定屏幕保护插件的 timeout 值。 + + ``` + # vlock --timeout 5 + ``` + +你可以使用 `-h` 或 `--help` 和 `-v` 或 `--version` 分别查看帮助消息和版本信息。 + +我们的介绍就到这了,提示一点,你可以将 vlock 的 `~/.vlockrc` 文件包含到系统启动中并参考入门手册[添加环境变量][1],特别是 Debian 系的用户。 + +想要找到更多或是补充一些这里没有提及的信息,可以直接在写在下方评论区。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/vlock-lock-user-virtual-console-terminal-linux/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tecmint+%28Tecmint%3A+Linux+Howto%27s+Guide%29 + +作者:[Aaron Kili][a] +译者:[martin2011qi](https://github.com/martin2011qi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.tecmint.com/author/aaronkili/ +[1]: http://www.tecmint.com/set-path-variable-linux-permanently/ From 5deb1ca72c641dd031c67adcf884bf48da401c48 Mon Sep 17 00:00:00 2001 From: miaolin Date: Sat, 25 Jun 2016 11:31:49 +0800 Subject: [PATCH 0970/1469] Update 20160620 5 Best Linux Package Managers for Linux Newbies.md --- .../20160620 5 Best Linux Package Managers for Linux Newbies.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/talk/20160620 5 Best Linux Package Managers for Linux Newbies.md b/sources/talk/20160620 5 Best Linux Package Managers for Linux Newbies.md index dadf1e1fb0..a92c5265e5 100644 --- a/sources/talk/20160620 5 Best Linux Package Managers for Linux Newbies.md +++ b/sources/talk/20160620 5 Best Linux Package Managers for Linux Newbies.md @@ -1,3 +1,4 @@ +transalting by ynmlml 5 Best Linux Package Managers for Linux Newbies ===================================================== From bc969d4f2ad456b111b8b9392e0ae789d93a93b6 Mon Sep 17 00:00:00 2001 From: "Cathon.ZHD" Date: Sat, 25 Jun 2016 13:41:26 +0800 Subject: [PATCH 0971/1469] Cathon is translating 20160518 Python 3 - An Intro to Encryption --- sources/tech/20160518 Python 3 - An Intro to Encryption.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160518 Python 3 - An Intro to Encryption.md b/sources/tech/20160518 Python 3 - An Intro to Encryption.md index 43c042d5c1..3a840114d3 100644 --- a/sources/tech/20160518 Python 3 - An Intro to Encryption.md +++ b/sources/tech/20160518 Python 3 - An Intro to Encryption.md @@ -1,3 +1,5 @@ +[Cathon is Translating...] + Python 3: An Intro to Encryption =================================== From 48d23cb787ab53b1f6302b903233d7a56bacb042 Mon Sep 17 00:00:00 2001 From: Yu Haixin <836401406@qq.com> Date: Sat, 25 Jun 2016 19:26:10 +0800 Subject: [PATCH 0972/1469] Update 20160610 Getting started with ReactOS.md --- sources/tech/20160610 Getting started with ReactOS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160610 Getting started with ReactOS.md b/sources/tech/20160610 Getting started with ReactOS.md index d181e2dd5d..b6dca8f9b5 100644 --- a/sources/tech/20160610 Getting started with ReactOS.md +++ b/sources/tech/20160610 Getting started with ReactOS.md @@ -1,3 +1,4 @@ +name1e5s translating... Getting started with ReactOS ============================== From d5d18990a68da44cb88bedae0a0e29e97092eb6a Mon Sep 17 00:00:00 2001 From: ezio Date: Sat, 25 Jun 2016 19:37:13 +0800 Subject: [PATCH 0973/1469] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=AF=91=E8=80=85?= =?UTF-8?q?=20jerryling315=20=E4=B8=BA=20Moelf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- ...estions Survey Results Surface Top Open Source Projects.md | 4 ++-- ...nux Birthday-- A 22 Years of Journey and Still Counting.md | 2 +- ...e an AP in Ubuntu 15.04 to connect to Android or iPhone.md | 2 +- .../201601/20101020 19 Years of KDE History--Step by Step.md | 2 +- ...rk Shuttleworth--The Man Behind Ubuntu Operating System.md | 2 +- ...ri-Pi--Using the Raspberry Pi as a Secure Landing Point.md | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 40afd5d30e..bbc3753a39 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,7 @@ LCTT 的组成 - KnightJoker, - Xuanwo, - nd0104, -- jerryling315, +- Moelf, - xiaoyu33, - guodongxiaren, - ynmlml, diff --git a/published/201502/20150205 LinuxQuestions Survey Results Surface Top Open Source Projects.md b/published/201502/20150205 LinuxQuestions Survey Results Surface Top Open Source Projects.md index 9430f11ada..4cfe259dd0 100644 --- a/published/201502/20150205 LinuxQuestions Survey Results Surface Top Open Source Projects.md +++ b/published/201502/20150205 LinuxQuestions Survey Results Surface Top Open Source Projects.md @@ -19,7 +19,7 @@ LinuxQuestions 问卷调查揭晓最佳开源项目 via: http://ostatic.com/blog/linuxquestions-survey-results-surface-top-open-source-projects 作者:[Sam Dean][a] -译者:[jerryling315](https://github.com/jerryling315) +译者:[Moelf](https://github.com/Moelf) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 @@ -29,4 +29,4 @@ via: http://ostatic.com/blog/linuxquestions-survey-results-surface-top-open-sour [2]:http://www.linuxquestions.org/questions/linux-news-59/2014-linuxquestions-org-members-choice-award-winners-4175532948/ [3]:http://www.linuxquestions.org/questions/2014mca.php [4]:http://ostatic.com/blog/lq-members-choice-award-winners-announced -[5]:http://www.linuxquestions.org/questions/2014mca.php \ No newline at end of file +[5]:http://www.linuxquestions.org/questions/2014mca.php diff --git a/published/201509/20150818 Debian GNU or Linux Birthday-- A 22 Years of Journey and Still Counting.md b/published/201509/20150818 Debian GNU or Linux Birthday-- A 22 Years of Journey and Still Counting.md index e14e0ba320..f82f43ccf1 100644 --- a/published/201509/20150818 Debian GNU or Linux Birthday-- A 22 Years of Journey and Still Counting.md +++ b/published/201509/20150818 Debian GNU or Linux Birthday-- A 22 Years of Journey and Still Counting.md @@ -98,7 +98,7 @@ Debian 在 Linux 生态环境中的贡献是难以用语言描述的。 如果 D via: http://www.tecmint.com/happy-birthday-to-debian-gnu-linux/ 作者:[Avishek Kumar][a] -译者:[jerryling315](http://moelf.xyz) +译者:[Moelf](https://github.com/Moelf) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/published/201509/20150824 How to create an AP in Ubuntu 15.04 to connect to Android or iPhone.md b/published/201509/20150824 How to create an AP in Ubuntu 15.04 to connect to Android or iPhone.md index e7ee7d760d..af5c90e7f7 100644 --- a/published/201509/20150824 How to create an AP in Ubuntu 15.04 to connect to Android or iPhone.md +++ b/published/201509/20150824 How to create an AP in Ubuntu 15.04 to connect to Android or iPhone.md @@ -69,7 +69,7 @@ b、 一旦你保存了这个文件,你应该能在 Wifi 菜单里看到你刚 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) +译者:[Moelf](https://github.com/Moelf) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/published/201601/20101020 19 Years of KDE History--Step by Step.md b/published/201601/20101020 19 Years of KDE History--Step by Step.md index 50cfff73fb..a13d468b7d 100644 --- a/published/201601/20101020 19 Years of KDE History--Step by Step.md +++ b/published/201601/20101020 19 Years of KDE History--Step by Step.md @@ -222,7 +222,7 @@ KDE Plasma 5 – 第五代 KDE。大幅改进了设计和系统,新的默认 via: [https://tlhp.cf/kde-history/](https://tlhp.cf/kde-history/) 作者:[Pavlo Rudyi][a] -译者:[jerryling315](https://github.com/jerryling315) +译者:[Moelf](https://github.com/Moelf) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/translated/talk/20151023 Mark Shuttleworth--The Man Behind Ubuntu Operating System.md b/translated/talk/20151023 Mark Shuttleworth--The Man Behind Ubuntu Operating System.md index 009641458c..0d3547aeb9 100644 --- a/translated/talk/20151023 Mark Shuttleworth--The Man Behind Ubuntu Operating System.md +++ b/translated/talk/20151023 Mark Shuttleworth--The Man Behind Ubuntu Operating System.md @@ -118,7 +118,7 @@ Admin, salary negotiations, legalese, and public speaking. via: http://www.unixmen.com/mark-shuttleworth-man-behind-ubuntu-operating-system/ 作者:[M.el Khamlichi][a] -译者:[jerryling315](https://blog.moelf.xyz) +译者:[Moelf](https://github.com/Moelf) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/translated/tech/20151215 Securi-Pi--Using the Raspberry Pi as a Secure Landing Point.md b/translated/tech/20151215 Securi-Pi--Using the Raspberry Pi as a Secure Landing Point.md index b6705a7b83..fc489163ef 100644 --- a/translated/tech/20151215 Securi-Pi--Using the Raspberry Pi as a Secure Landing Point.md +++ b/translated/tech/20151215 Securi-Pi--Using the Raspberry Pi as a Secure Landing Point.md @@ -511,7 +511,7 @@ SSLH 介绍: [http://www.rutschle.net/tech/sslh.shtml](http://www.rutschle.net/t via: http://www.linuxjournal.com/content/securi-pi-using-raspberry-pi-secure-landing-point?page=0,0 作者:[Bill Childers][a] -译者:[jerryling315](https://blog.moelf.xyz) +译者:[Moelf](https://github.com/Moelf) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 1520cb88686d7acf8da0eae5168be757b900004f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=9C=E5=AE=8F=E7=BE=BD=28Dee=2EH=2EY=29?= Date: Sat, 25 Jun 2016 22:34:41 +0800 Subject: [PATCH 0974/1469] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=BF=BB=E8=AF=91:?= =?UTF-8?q?20160620=20PowerPC=20gains=20an=20Android=204.4=20port=20with?= =?UTF-8?q?=20Big=20Endian=20support.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ndroid 4.4 port with Big Endian support.md | 109 ------------------ ...ndroid 4.4 port with Big Endian support.md | 103 +++++++++++++++++ 2 files changed, 103 insertions(+), 109 deletions(-) delete mode 100644 sources/tech/20160620 PowerPC gains an Android 4.4 port with Big Endian support.md create mode 100644 translated/tech/20160620 PowerPC gains an Android 4.4 port with Big Endian support.md diff --git a/sources/tech/20160620 PowerPC gains an Android 4.4 port with Big Endian support.md b/sources/tech/20160620 PowerPC gains an Android 4.4 port with Big Endian support.md deleted file mode 100644 index 5e2acd0659..0000000000 --- a/sources/tech/20160620 PowerPC gains an Android 4.4 port with Big Endian support.md +++ /dev/null @@ -1,109 +0,0 @@ -translating(东风唯笑)这个是大坑啊 -PowerPC gains an Android 4.4 port with Big Endian support -=========================================================== - -eInfochips has ported Android 4.4 to the PowerPC architecture on behalf of an avionics customer that will use it for an HMI that monitors engine health. - -eInfochips has developed the first Android port to the PowerPC CPU architecture using a modern Android build and featuring Big Endian support. The port is based on Android Open Source Project (AOSP) code for Android 4.4 (KitKat) and features Kernel 3.12.19. - -Android emerged around the same time that PowerPC was already in decline and quickly losing market share to ARM. Customers with high-end networking and other enterprise-oriented embedded gear running on PowerPC processors such as Freescale’s PowerQUICC and QorIQ, instead depended on Linux. Several Android ports have been attempted, however. In 2009, Freescale and Embedded Alley — now part of the Linux team at Mentor Graphics — [announced a port][15] for PowerQUICC and QorIQ chips, which are now built by NXP. Another project claiming the same feat emerged called [Android-PowerPC][16]. - -Not much came of these efforts, however, and when an avionics firm asked eInfochips to look into an Android application for adding an improved HMI to its PowerPC-based engine monitoring system, the company found that these earlier ports were not up to par. They would have to start from scratch. - -The main problem with the previous ports was that they were for a much older, and very different, Android. Embedded Alley’s port was for Android 1.5 (Cupcake), released in 2009 and based on a Linux 2.6.28 kernel, and the last port from the Android-PowerPC project appears to be for Android 2.2 (Froyo), which was released in 2010 and based on Linux 2.6.32. The avionics customer also needed other technologies such as support for Big Endian, a legacy memory access scheme still used in the networking and telecom world. The other ports supported only Little Endian memory access. - - -### New PowerPC port from eInfochips - -eInfochips, which is known around here mostly for its ARM/Snapdragon-based boards such as the [Eragon 600][17] computer-on-module, has now completed the Android 4.4 QorIQ port and has posted a white paper describing the project. The avionics customer using the technology remains unnamed, however, and it’s unclear to what extent the port will be publicly shared. - - -![](http://hackerboards.com/files/einfochips_porting_android_on_powerpc-sm.jpg) ->Image from eInfochips blog post - -- The new PowerPC Android project includes: -- Bionic customization for PowerPC [e5500][1] -- Big Endian support in Android KitKat -- Tool chain development with GCC version 5.2 -- PowerPC support in Android 4.4 framework -- Android Kernel 3.12.19 for PowerPC e5500 - -According to eInfochips marketing manager, Sooryanarayanan Balasubramanian, the avionics customer wanted Android primarily for its familiar interface, which reduces training time, as well as the ease in updating the system with new applications. “By successful Android porting they can allow more modifications at the application layer without undergoing the tedious certification process at all layers,” explained Balasubramanian. “This was the first time any such attempt has been made in the aerospace industry, which requires due diligence in designs.” - -Porting Android to PowerPC required major modifications to the framework, core libraries, toolchain development, run-time linker, object linker, and open source compiler support, according to the white paper. When generating byte code, the porting team decided to use portable mode rather than fast interpreter mode. There is no fast interpreter available for Android on PowerPC, whereas portable mode uses the open source [libffi][18] for interpretation, which does support PowerPC. - -The team also needed to choose between Android Run Time (ART) and Dalvik Virtual Machine (DVM). They found that portable mode for ART was untested and poorly documented, so they went with DVM in portable mode. - -The white paper goes on to explain other challenges in the port, including developing a toolchain from scratch and rewriting scripts to overcome the problem of AOSP’s “non-standard” use of compiler flags. The finished port offers 37 services, and features a headless Android deployment along with an emulated UI in user space. - - -### Target hardware - -Thanks to an image (shown farther above) in an [eInfochips blog post][2] about the company’s Android PowerPC port, we were able to identify the project’s target hardware. The board turns out to be the [X-ES Xpedite 6101][3], which is a rugged XMC/PrPMC mezzanine module. - -Thanks to an image (shown farther above) in an eInfochips blog post about the company’s Android PowerPC port, we were able to identify the project’s target hardware. The board turns out to be the X-ES Xpedite 6101, which is a rugged XMC/PrPMC mezzanine module. - -![](http://hackerboards.com/files/xes_xpedite6101-sm.jpg) ->X-ES Xpedite 6101 photo and block diagram - -The X-ES Xpedite 6101 ships with a choice of NXP QorIQ-based T Series communications processors — the T2081, T1042, and T1022 — which integrate 8, 4, and 2 e6500 cores, respectively, running at up to 1.8GHz (T2081) or 1.4GHz (T1042/22). Each core integrates an AltiVec SIMD engine, said to offer DSP-level floating point performance. All three X-ES board models support up to 8GB of DDR3-1600 ECC SDRAM memory, plus up to 512MB of NOR and 32GB of NAND flash storage. - -![](http://hackerboards.com/files/nxp_qoriq_t2081_block-sm.jpg) ->NXP T2081 block diagram - -The board’s I/O includes a x4 PCI Express Gen2 channel, along with dual helpings of Gigabit Ethernet, RS232/422/485 serial, and SATA 3.0 ports. In addition to its choice of three QorIQ processors, the Xpedite 6101 is offered with support for three [X-ES ruggedization levels][19], rated for operation over 0 to 55°C, -40 to 70°C, or -40 to 85°C respectively, along with three categories of shock and vibration resistance. - -Other X-ES QorIQ-based XMC/PrPMC boards we’ve covered include the [XPedite6401 and XPedite6370][20], which are supported with off-the-shelf BSPs for Linux, Wind River VxWorks, and Green Hills Integrity. - - -### Further information - -The eInfochips Android PowerPC porting whitepaper is available for download [here][4] (requires free registration). - -### Related posts: - -- [Commercial embedded Linux distro boosts virtualization][5] -- [Freescale unveils first ARM-based QorIQ SoCs][6] -- [High-end boards run Linux on 64-bit ARM QorIQ SoCs][7] -- [Free, Open Enea Linux taps Yocto Project and Linaro code][8] -- [LynuxWorks reverts to its LynxOS roots, changes name][9] -- [First quad- and octa-core QorIQ SoCs unveiled][10] -- [Free white paper shows how Linux won embedded][11] -- [Quad-core Snapdragon COM offers three dev kit options][12] -- [Tiny COM runs Linux on quad-core 64-bit Snapdragon 410][13] -- [PowerPC based IoT gateway COM ships with Linux BSP][14] - - --------------------------------------------------------------------------------- - -via: http://hackerboards.com/powerpc-gains-android-4-4-port-with-big-endian-support/ - -作者:[Eric Brown][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://hackerboards.com/powerpc-gains-android-4-4-port-with-big-endian-support/ -[1]: http://linuxdevices.linuxgizmos.com/low-cost-powerquicc-chips-offer-flexible-interconnect-options/ -[2]: https://www.einfochips.com/blog/k2-categories/aerospace/presenting-a-case-for-porting-android-on-powerpc-architecture.html -[3]: http://www.xes-inc.com/products/processor-mezzanines/xpedite6101/ -[4]: http://biz.einfochips.com/portingandroidonpowerpc -[5]: http://hackerboards.com/commercial-embedded-linux-distro-boosts-virtualization/ -[6]: http://hackerboards.com/freescale-unveils-first-arm-based-qoriq-socs/ -[7]: http://hackerboards.com/high-end-boards-run-linux-on-64-bit-arm-qoriq-socs/ -[8]: http://hackerboards.com/free-open-enea-linux-taps-yocto-and-linaro-code/ -[9]: http://hackerboards.com/lynuxworks-reverts-to-its-lynxos-roots-changes-name/ -[10]: http://hackerboards.com/first-quad-and-octa-core-qoriq-socs-unveiled/ -[11]: http://hackerboards.com/free-white-paper-shows-how-linux-won-embedded/ -[12]: http://hackerboards.com/quad-core-snapdragon-com-offers-three-dev-kit-options/ -[13]: http://hackerboards.com/tiny-com-runs-linux-and-android-on-quad-core-64-bit-snapdragon-410/ -[14]: http://hackerboards.com/powerpc-based-iot-gateway-com-ships-with-linux-bsp/ -[15]: http://linuxdevices.linuxgizmos.com/android-ported-to-powerpc/ -[16]: http://www.androidppc.com/ -[17]: http://hackerboards.com/quad-core-snapdragon-com-offers-three-dev-kit-options/ -[18]: https://sourceware.org/libffi/ -[19]: http://www.xes-inc.com/capabilities/ruggedization/ -[20]: http://hackerboards.com/high-end-boards-run-linux-on-64-bit-arm-qoriq-socs/ - - diff --git a/translated/tech/20160620 PowerPC gains an Android 4.4 port with Big Endian support.md b/translated/tech/20160620 PowerPC gains an Android 4.4 port with Big Endian support.md new file mode 100644 index 0000000000..3b450cb603 --- /dev/null +++ b/translated/tech/20160620 PowerPC gains an Android 4.4 port with Big Endian support.md @@ -0,0 +1,103 @@ +PowerPC 获得大端 Android 4.4 系统的移植 +=========================================================== + +eInfochips(一家软件厂商) 已将将 Android 4.4 系统移植到 PowerPC 架构,它将作为一家航空电子客户的人机界面(HMI:Human Machine Interface)用来监视引擎的建康状况。 + +eInfochips 已经开发了第一个面向 PowerPC 架构的 CPU 的 Android 移植版本,它使用较新的大端 Android 系统。此移植基于 Android 开源项目[Android Open Source Project (AOSP)] 中 Android 4.4 (KitKat) 的代码,其功能内核的版本号为 3.12.19。 + +Android 开始兴起的时候,PowerPC正在快速失去和 ARM 架构共通角逐的市场。高端的网络客户和以市场为导向的嵌入式工具大多运行在诸如飞思卡尔(Freescale)的 PowerQUICC 和 QorIQ 上,而不取决于 Linux 系统。一些 Android 的移植计划最终失败,然而在 2009 年,飞思卡尔和 Embedded Alley(一家软件厂商,当前是 Mentor Graphics 的 Linux 团队的一部分)[宣布了针对 PowerQUICC 和 QorIQ 芯片的移植版本][15],当前由 NXP 公司构建。另一个名为[Android-PowerPC][16] 的项目也作出了相似的工作。 + +这些努力来的都并不容易,然而,当航空公司找到 eInfochips,希望能够为他们那些基于 PowerPC 的引擎监控系统添加 Android 应用程序以改善人机界面。此公司找出了这些早期的移植版本,然而,他们都很难达到标准。所以,他们不得不从头开始新的移植。 + +最主要的问题是这些移植的 Android 版本实在是太老了,且 very different。Embedded Alley 移植的版本为 Android 1.5 (Cupcake),它于 2009 年发布,Linux 内核版本为 2.6.28。最后一版的移植为 Android-PowerPC 项目的 Android 2.2 (Froyo)它于 2010 年发布,内核版本为 2.6.32。此外,航空公司还有一些额外的技术诉求,例如对大端的支持. 现有的存储器接入方案仍旧应用于网络通信和电信行业。然而那些早期的移植版本仅能够支持小端的存储器访问。 + +### 来自 eInfochips 的全新 PowerPC 架构移植 + +eInfochips, 它最为出名的应该是那些基于 ARM/骁龙处理器的模块计算机板卡,例如 [Eragon 600][17]。 它已经完成了基于 QorIQ 的 Android 4.4 系统移植,且发布了白皮书描述了此项目。采用该项目的航空电子设备客户仍旧不愿透露姓名,目前仍旧不清楚什么时候会公开此该移植版本。 + + +![](http://hackerboards.com/files/einfochips_porting_android_on_powerpc-sm.jpg) +>图片来自 eInfochips 的博客日志 + +- 全新的 PowerPC Android 项目包括: +- 基于 PowerPC [e5500][1] 深度定制(bionic 定制不知道什么鬼,校对的时候也可以想想怎么处理) +- 基于 Android KitKat 的大端序支持 +- 开发工具链为 Gcc 5.2 +- Android 4.4 框架的 PowerPC 支持 +- PowerPC e5500 的 Android 内核版本为 3.12.19 + +根据 eInfochips 的销售经理 Sooryanarayanan Balasubramanian 描述,航空电子客户想要使用 Android 主要是因为熟悉的界面能够缩减培训的时间,并且让程序更新和提供新的程序变得更加容易。他继续解释说:“这次成功的移植了 Android,使得今后的工作仅仅需要在应用层作出修修改改,而不再向以前一样需要在所有层之间作相互的校验。”“这是第一次在航空航天工业作出这些尝试,这需要在设计时作出尽职的调查。” + +通过白皮书,可以知道将 Android 移植到 PowerPC 上需要对框架,核心库,开发工具链,运行时链接器,对象链接器和开源编译工具作出大量的修改。在字节码生成阶段,移植团队决定使用便携模式而不是快速的解释模式。这是因为,还没有 PowerPC 可用的快速解释模式,而使用 [libffi][18] 的便携模式能够支持 PowerPC。 + +同时,团队还面临在 Android 运行时 (ART) 环境和 Dalvik 虚拟机 (DVM) 环境之间的选择。他们发现,ART 环境下的便携模式还未经测试且缺乏良好的文档支持,所以最终选择了 DVM 环境下的便携模式。 + +白皮书中还提及了其它的一些在移植过程中遇到的困难,包括重新开发工具链,重写脚本以解决 AOSP “非标准”的使用编译器标志的问题。最终,移植提供了 37 个服务,and features a headless Android deployment along with an emulated UI in user space. + + +### 目标硬件 + +感谢来自 [eInfochips 博客日志][2] 的图片(如下图所示),我们能够确认此 PowerPC 的 Android 移植项目的硬件平台。这个板卡为 [X-ES Xpedite 6101][3],它是固实的 XMC/PrPMC 夹层模组。 + +![](http://hackerboards.com/files/xes_xpedite6101-sm.jpg) +>X-ES Xpedite 6101 照片和框图 + +X-ES Xpedite 6101 板卡拥有可选择的 NXP 公司基于 QorIQ T系列通信处理器 T2081, T1042, 和 T1022,他们分别拥有 8 个,4 个和 2 个 e6500 核心,稍有不同的是,T2081 的处理器主频为 1.8GHz,T1042/22 的处理器主频为 1.4GHz。所有的核心都集成了 AltiVec SIMD 引擎,这也就意味着它能够提供 DSP 级别的浮点运算性能。所有以上 3 款 X-ES 板卡都能够支持最高 8GB 的 DDR3-1600 ECC SDRAM 内存。外加 512MB NOR 和 32GB 的 NAND 闪存。 + +![](http://hackerboards.com/files/nxp_qoriq_t2081_block-sm.jpg) +>NXP T2081 框图 + +板卡的 I/O 包括一个 x4 PCI Express Gen2 通到,along with dual helpings of Gigabit Ethernet, RS232/422/485 串口和 SATA 3.0 接口。此外,它可选 3 款 QorIQ 处理器,Xpedite 6101 提供了三种[X-ES 加固等级][19],分别是额定工作温度 0 ~ 55°C, -40 ~ 70°C, 或者是 -40 ~ 85°C,且包含 3 类冲击和抗振类别。 + +此外,我们已经介绍过的基于 X-ES QorIQ 的 XMC/PrPMC 板卡包括[XPedite6401 和 XPedite6370][20],它们支持已有的板卡级 Linux Linux,Wind River VxWorks(一种实时操作系统) 和 Green Hills Integrity(也是一种操作系统)。 + + +### 更多信息 + +eInfochips Android PowerPC 移植白皮书可以[在此[4]下载(需要先免费注册)。 + +### Related posts: + +- [Commercial embedded Linux distro boosts virtualization][5] +- [Freescale unveils first ARM-based QorIQ SoCs][6] +- [High-end boards run Linux on 64-bit ARM QorIQ SoCs][7] +- [Free, Open Enea Linux taps Yocto Project and Linaro code][8] +- [LynuxWorks reverts to its LynxOS roots, changes name][9] +- [First quad- and octa-core QorIQ SoCs unveiled][10] +- [Free white paper shows how Linux won embedded][11] +- [Quad-core Snapdragon COM offers three dev kit options][12] +- [Tiny COM runs Linux on quad-core 64-bit Snapdragon 410][13] +- [PowerPC based IoT gateway COM ships with Linux BSP][14] + + +-------------------------------------------------------------------------------- + +via: http://hackerboards.com/powerpc-gains-android-4-4-port-with-big-endian-support/ + +作者:[Eric Brown][a] +译者:[dongfengweixiao](https://github.com/dongfengweixiao) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://hackerboards.com/powerpc-gains-android-4-4-port-with-big-endian-support/ +[1]: http://linuxdevices.linuxgizmos.com/low-cost-powerquicc-chips-offer-flexible-interconnect-options/ +[2]: https://www.einfochips.com/blog/k2-categories/aerospace/presenting-a-case-for-porting-android-on-powerpc-architecture.html +[3]: http://www.xes-inc.com/products/processor-mezzanines/xpedite6101/ +[4]: http://biz.einfochips.com/portingandroidonpowerpc +[5]: http://hackerboards.com/commercial-embedded-linux-distro-boosts-virtualization/ +[6]: http://hackerboards.com/freescale-unveils-first-arm-based-qoriq-socs/ +[7]: http://hackerboards.com/high-end-boards-run-linux-on-64-bit-arm-qoriq-socs/ +[8]: http://hackerboards.com/free-open-enea-linux-taps-yocto-and-linaro-code/ +[9]: http://hackerboards.com/lynuxworks-reverts-to-its-lynxos-roots-changes-name/ +[10]: http://hackerboards.com/first-quad-and-octa-core-qoriq-socs-unveiled/ +[11]: http://hackerboards.com/free-white-paper-shows-how-linux-won-embedded/ +[12]: http://hackerboards.com/quad-core-snapdragon-com-offers-three-dev-kit-options/ +[13]: http://hackerboards.com/tiny-com-runs-linux-and-android-on-quad-core-64-bit-snapdragon-410/ +[14]: http://hackerboards.com/powerpc-based-iot-gateway-com-ships-with-linux-bsp/ +[15]: http://linuxdevices.linuxgizmos.com/android-ported-to-powerpc/ +[16]: http://www.androidppc.com/ +[17]: http://hackerboards.com/quad-core-snapdragon-com-offers-three-dev-kit-options/ +[18]: https://sourceware.org/libffi/ +[19]: http://www.xes-inc.com/capabilities/ruggedization/ +[20]: http://hackerboards.com/high-end-boards-run-linux-on-64-bit-arm-qoriq-socs/ From 0b8be3b493894e984366952ee0d8916902e01234 Mon Sep 17 00:00:00 2001 From: Yu Haixin <836401406@qq.com> Date: Sat, 25 Jun 2016 10:08:00 -0500 Subject: [PATCH 0975/1469] [Translated]20160610 Getting started with ReactOS.md (#4098) * [Translated]20160610 Getting started with ReactOS.md * ... --- .../20160610 Getting started with ReactOS.md | 130 ------------------ .../20160610 Getting started with ReactOS.md | 129 +++++++++++++++++ 2 files changed, 129 insertions(+), 130 deletions(-) delete mode 100644 sources/tech/20160610 Getting started with ReactOS.md create mode 100644 translated/tech/20160610 Getting started with ReactOS.md diff --git a/sources/tech/20160610 Getting started with ReactOS.md b/sources/tech/20160610 Getting started with ReactOS.md deleted file mode 100644 index b6dca8f9b5..0000000000 --- a/sources/tech/20160610 Getting started with ReactOS.md +++ /dev/null @@ -1,130 +0,0 @@ -name1e5s translating... -Getting started with ReactOS -============================== - - -ReactOS is a relatively new open source operating system that resembles the looks of Windows NT and aims to offer similar levels of functionality and application compatibility. Featuring a wine-based user mode, this system doesn't use any of the Unix architecture, but is a rewrite of the NT architecture from scratch, with its very own FAT32 implementation, and completely free of legal implications. That said, this is not yet another Linux distro, but a unique Windows-like system that is a part of the free software world. This quick guide aims at users who want an easy to use, open source replacement for their Windows system. - - -### System Installation - -Before getting started with the installation process, I should point out that the minimum requirements of ReactOS are 500 MB of free disk space and only 96 MB of RAM. I will demonstrate the installation process on a 32-bit virtual machine. - -Navigate with the arrow keys and select the desired language by pressing “Enter”. - -![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_1.png) - -Next, hit “Enter” again to continue with the installation, or “R” to repair an existing install. - -![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_2.png) - -On the third screen, you'll get a warning about the current limitation that applies to this early development version of the OS. Continue with “Enter” again and you'll get a summary of the settings before the final user approval. If all is good, hit “Enter” once again. - -![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_3.png) - -This will take you to the partitioning stage where you may delete the highlighted option by pressing “D”, and then add primary, extended, or logical partitions with “P”, “E”, and “L” respectively. If you choose to add a partition yourself, you will be given the option to set its size by entering a number of MBs and pressing “Enter” to confirm. - -![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_4.png) - -However, if you have already unused space available, hitting “Enter” once again during the partitioning stage will automatically install ReactOS in the selected partition. - -![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_5.png) - -The next step is the selection of the filesystem type which for now is limited to FAT32 only. - - -![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_6.png) - -Next is the directory selection. I will leave this at the default “/ReactOS” and it should be fine. - -![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_7.png) - -...and we're off - -![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_8.png) - -Finally, we're about the choose the location of the bootloader. The first option should be the safest if installing on a real disk. - -![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_9.png) - -In general, I could say that the installation of ReactOS is pretty straight forward. The interface may not look friendly or modern at all, but hitting “Enter” in every step will work just fine in most cases. That said, the development version of ReactOS it's fairly simple and easy to install. - -### Setting Up ReactOS - -Once we reboot and get into our new system, we're offered the help of the “Setup Wizard”. This wizard is basically allowing us to set up the language and keyboard layout settings. - -![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_10.png) - -I used this step to add a second keyboard layout. - -![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_11.png) - -I can even set a different key combination for changing the layout. - -![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_12.png) - -Then I add the username... - -![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_13.png) - -...and an admin pass... - -![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_14.png) - -After the time settings are also set, ReactOS finalizes its configuration. - -![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_15.png) - -### Inside ReactOS - -When we finally enter ReactOS for the first time, new hardware is detected and we're offered to install the available drivers automatically. - -![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_16.png) - -These are the three devices that were automatically detected by ReactOS in my case: - -![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_17.png) - -What you're looking at in the above screenshot is ReactOS's “applications manager” which is of course to the standards of Linux systems. You won't find anything Linux-related here, though. Only open source applications that are known to work well with the particular system are offered. That said, some categories are well populated, while others are completely empty. - -![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_18.png) - -I took the liberty to install Firefox through the software center, and Notepad++ by downloading the .exe file and installing it by simply double-clicking the executable. Both worked perfectly well, their desktop icons were created, menu entries added, and Notepad++ was added in the applications manager and in the right category as well. - -![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_19.png) - -I wouldn't try running any modern Windows games, but if you want to setup the Direct 3D settings you can go to “My Computer/Control Panel/WineD3D Options”. There you will find multiple options about the Direct3D which is presumably resembling dx version 8. - -![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_20.png) - -Another good thing with ReactOS is the fact that the Registry entries can be accessed and set as needed through “My Computer” again. - -![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_21.png) - -If you need something handier though, you may find a Registry Editor utility from the applications menu. - -![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_22.png) - -![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_23.png) - -Finally, if the looks of ReactOS look somewhat outdated to you, right click on the desktop and select “Properties”. Then choose the “Appearance” tab and set the theme and color that you prefer. - -![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_24.png) - -### Conclusion - -Honestly, I was impressed by the way ReactOS works. It's quite solid, coherent, speedy, and really user-friendly. Leaving aside the negatives that stem from the Windows design (deprecated applications menu, irrational directory structure), ReactOS is almost perfect on what it does. It may not be very rich in terms of application selection, and it may not be very powerful in terms of features yet, but I am sure it's going to flourish. The numbers show great popularity, and I'm sure the community that's going to build up around it will soon be large enough to lead the project to success. Right now, version 0.4.1 looks promising to say the least. If you care about running Windows applications and doing so in an open way, give it a try! - - --------------------------------------------------------------------------------- - -via: https://www.howtoforge.com/tutorial/getting-started-with-reactos/ - -作者:[Bill Toulas][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.howtoforge.com/tutorial/getting-started-with-reactos/ - diff --git a/translated/tech/20160610 Getting started with ReactOS.md b/translated/tech/20160610 Getting started with ReactOS.md new file mode 100644 index 0000000000..3cbc2ac9ae --- /dev/null +++ b/translated/tech/20160610 Getting started with ReactOS.md @@ -0,0 +1,129 @@ +ReactOS 新手指南 +==================================== + + +ReactOS 是一个比较年轻的开源操作系统,它提供了一个和 Windows NT 类似的图形界面,并且它的目标也是提供一个与 NT 功能和应用程序兼容性差不多的系统。这个项目在没有使用任何 Unix 的情况下实现了一个类似 Wine 的用户模式。它的开发者们从头实现了NT 的架构以及对于 FAT32 的兼容,因此它也不需要负任何法律责任。这也就是说,它不是又双叒叕一个 Linux 发行版,而是一个类似 Windows 的独特的系统,它也是开源世界的一部分。这份快速指南是给那些想要一个使用简单的 Windows 的开源替代品的人准备的。 + + +### 安装系统 + +在开始安装这个系统之前,我需要说明一下,ReactOS 的最低硬件要求是 500MB 硬盘以及仅仅 96MB 内存。我会在一个 32 位的虚拟机里面演示安装过程。 + +现在,你需要使用箭头键来选择语言,而后通过回车键来选中你中意的语言, + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_1.png) + +之后,再次敲击回车键来继续安装。你也可以选择按“R”键来修复现有的系统。 + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_2.png) + +在第三屏中,你将看到一个警告说这个系统还是早期开发版本。再次敲击回车键,你将看到一个需要你最后确认的配置概览。如果你认为都不错,就按回车。 + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_3.png) + +然后,我们就到了分区这一步,在这里,你可以使用“D”键删除高亮分区,分别使用“P”键,“E”键,以及“L”键来添加一个主分区或拓展分区或逻辑分区。如果你想要自己添加一个分区的话,你需要输入这个分区的大小(以 MB 为单位),然后通过回车来确认。 + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_4.png) + +但是,如果你有没有使用的硬盘空间,在分区阶段在此敲击回车键将会自动在你选中的分区上安装 ReactOS。 + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_5.png) + +下一步是选择分区的格式,但是现在我们只能选择 FAT32. + + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_6.png) + +再下一步是选择安装文件夹。我就使用默认的“/ReactOS”了,应该没有问题。 + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_7.png) + +然后就是等待... + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_8.png) + +最后,我们要选择启动程序的安装位置。如果你是在实机上操作的话,第一个选项应该是最安全的。 + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_9.png) + +总之,我认为这个 ReactOS 的安装向导很直接。尽管安装程序的界面可能看起来一点也不现代,不友好,但是大多数情况下作为用户的我们只需要狂敲回车就能安个差不多。这就是说,ReactOS 的开发版安装起来也是相对简单方便的。 + +### 设置 ReactOS + +在我们重启进入新系统之后,“设置向导”会帮助你设置系统。目前,这个向导仅支持设置语言和键盘格式。 + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_10.png) + +我在这里选择了第二个键盘格式。 + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_11.png) + +我还可以设置一个改变键盘格式的快捷键。 + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_12.png) + +之后我添加了用户名... + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_13.png) + +...以及管理员密码... + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_14.png) + +在设置好时间之后,我们就算完全了设置。 + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_15.png) + +### ReactOS 之内 + +当我们最终第一次进入 ReactOS 的界面时,系统会检测硬件然后自动帮助我们安装驱动。 + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_16.png) + +这是我这里被自动检测出来的三个硬件: + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_17.png) + +在上一张图片里你看到的是 ReactOS 的“应用管理器”,这东西很 Linux。尽管你不会在这里找到任何与 LInux 有关系的东西。只有在这个系统里工作良好的开源软件才会在这个管理器中出现。这就导致了管理器中有的分类下挤的满满当当,有的分类却冷清异常。 + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_18.png) + +我试着通过软件中心安装了 Firefox 以及通过直接下载exe文件双击安装 Notepad++。这两个应用都能完美运行:它们的图标出现在了桌面上,在菜单中也出现了它们的名字,Notepad ++ 也出现在了软件中心右侧的分类栏里。 + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_19.png) + +我没有尝试运行任何现代的 Windows 游戏,如果你想配置 Direct 3D 的话你可以转到 “我的电脑/控制选项/WineD3D 配置”。在那里,你能看到很多和 dx 8 相似的Direct3D 选项。 + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_20.png) + +ReactOS 还有一个好啊,就是我们可以通过“我的电脑”来操控注册表。 + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_21.png) + +如果你需要一个简单点的工具,你可以在停用菜单里打开注册表编辑器。 + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_22.png) + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_23.png) + +最后,如果你认为 ReactOS 看起来有点过时了的话,你可以在桌面右击选择“属性”,之后在“外观”那里选择你喜欢的主题和颜色。 + +![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_24.png) + +### 结论 + +老实说,我对 ReactOS 的工作方式印象深刻。它相当稳定,连贯,快速,真正人性化。抛开 Windows 的阴影(过时的应用菜单,不合理的菜单结构)不谈的话,ReactOS 几乎做到了尽善尽美。它可能不会有太多应用可供选择,现有的功能也可能不够强大,但是我确信它以后会有自己的一席之地。关于它的数据显示出了它的人气,我确定将要围绕它建立起来的社区将会很快就壮大到能把这个项目带往成功之路的地步。如今,ReactOS 的最新版本是 0.4.1。如果想要以开源的方式运行 Windows 的应用,那么它就是你的菜! + + +-------------------------------------------------------------------------------- + +via: https://www.howtoforge.com/tutorial/getting-started-with-reactos/ + +作者:[Bill Toulas][a] +译者:[name1e5s](https://github.com/name1e5s) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.howtoforge.com/tutorial/getting-started-with-reactos/ + From 01d7494aa10a84ae30c8944d7daf74dc932a07c0 Mon Sep 17 00:00:00 2001 From: Purling Nayuki Date: Sat, 25 Jun 2016 23:43:03 +0800 Subject: [PATCH 0976/1469] Proofread 20160610 Getting started with ReactOS --- .../20160610 Getting started with ReactOS.md | 39 +++++++++---------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/translated/tech/20160610 Getting started with ReactOS.md b/translated/tech/20160610 Getting started with ReactOS.md index 3cbc2ac9ae..ffeeb9021f 100644 --- a/translated/tech/20160610 Getting started with ReactOS.md +++ b/translated/tech/20160610 Getting started with ReactOS.md @@ -2,14 +2,14 @@ ReactOS 新手指南 ==================================== -ReactOS 是一个比较年轻的开源操作系统,它提供了一个和 Windows NT 类似的图形界面,并且它的目标也是提供一个与 NT 功能和应用程序兼容性差不多的系统。这个项目在没有使用任何 Unix 的情况下实现了一个类似 Wine 的用户模式。它的开发者们从头实现了NT 的架构以及对于 FAT32 的兼容,因此它也不需要负任何法律责任。这也就是说,它不是又双叒叕一个 Linux 发行版,而是一个类似 Windows 的独特的系统,它也是开源世界的一部分。这份快速指南是给那些想要一个使用简单的 Windows 的开源替代品的人准备的。 +ReactOS 是一个比较年轻的开源操作系统,它提供了一个和 Windows NT 类似的图形界面,并且它的目标也是提供一个与 NT 功能和应用程序兼容性差不多的系统。这个项目在没有使用任何 Unix 的情况下实现了一个类似 Wine 的用户模式。它的开发者们从头实现了 NT 的架构以及对于 FAT32 的兼容,因此它也不需要负任何法律责任。这也就是说,它不是又双叒叕一个 Linux 发行版,而是一个独特的类 Windows 系统,并且是开源世界的一部分。这份快速指南是给那些想要一个易于使用的 Windows 的开源替代品的人准备的。 ### 安装系统 在开始安装这个系统之前,我需要说明一下,ReactOS 的最低硬件要求是 500MB 硬盘以及仅仅 96MB 内存。我会在一个 32 位的虚拟机里面演示安装过程。 -现在,你需要使用箭头键来选择语言,而后通过回车键来选中你中意的语言, +现在,你需要使用箭头键来选择你想要语言,而后通过回车键来确认。 ![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_1.png) @@ -17,19 +17,19 @@ ReactOS 是一个比较年轻的开源操作系统,它提供了一个和 Windo ![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_2.png) -在第三屏中,你将看到一个警告说这个系统还是早期开发版本。再次敲击回车键,你将看到一个需要你最后确认的配置概览。如果你认为都不错,就按回车。 +在第三屏中,你将看到一个警告说这个系统还是早期开发版本。再次敲击回车键,你将看到一个需要你最后确认的配置概览。如果你认为没问题,就按回车。 ![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_3.png) -然后,我们就到了分区这一步,在这里,你可以使用“D”键删除高亮分区,分别使用“P”键,“E”键,以及“L”键来添加一个主分区或拓展分区或逻辑分区。如果你想要自己添加一个分区的话,你需要输入这个分区的大小(以 MB 为单位),然后通过回车来确认。 +然后,我们就到了分区这一步,在这里,你可以使用“D”键删除高亮分区,分别使用“P”键、“E”键以及“L”键来添加一个主分区、拓展分区或逻辑分区。如果你想要自己添加一个分区,你需要输入这个分区的大小(以 MB 为单位),然后通过回车来确认。 ![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_4.png) -但是,如果你有没有使用的硬盘空间,在分区阶段在此敲击回车键将会自动在你选中的分区上安装 ReactOS。 +但是,如果你有未使用的硬盘空间,在分区过程直接敲击回车键可以自动在你选中的分区上安装 ReactOS。 ![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_5.png) -下一步是选择分区的格式,但是现在我们只能选择 FAT32. +下一步是选择分区的格式,不过现在我们只能选择 FAT32。 ![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_6.png) @@ -46,7 +46,7 @@ ReactOS 是一个比较年轻的开源操作系统,它提供了一个和 Windo ![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_9.png) -总之,我认为这个 ReactOS 的安装向导很直接。尽管安装程序的界面可能看起来一点也不现代,不友好,但是大多数情况下作为用户的我们只需要狂敲回车就能安个差不多。这就是说,ReactOS 的开发版安装起来也是相对简单方便的。 +总地来说,我认为 ReactOS 的安装向导很直接。尽管安装程序的界面可能看起来一点也不现代、不友好,但是大多数情况下作为用户的我们只需要狂敲回车就能安个差不多。这就是说,ReactOS 的开发版安装起来也是相对简单方便的。 ### 设置 ReactOS @@ -58,25 +58,25 @@ ReactOS 是一个比较年轻的开源操作系统,它提供了一个和 Windo ![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_11.png) -我还可以设置一个改变键盘格式的快捷键。 +我还可以设置一个改变键盘布局的快捷键。 ![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_12.png) -之后我添加了用户名... +之后我添加了用户名… ![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_13.png) -...以及管理员密码... +…以及管理员密码… ![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_14.png) -在设置好时间之后,我们就算完全了设置。 +在设置好时间之后,我们就算完成了系统设置。 ![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_15.png) ### ReactOS 之内 -当我们最终第一次进入 ReactOS 的界面时,系统会检测硬件然后自动帮助我们安装驱动。 +当我们历经千辛万苦,终于首次进入 ReactOS 的界面时,系统会检测硬件并自动帮助我们安装驱动。 ![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_16.png) @@ -84,23 +84,23 @@ ReactOS 是一个比较年轻的开源操作系统,它提供了一个和 Windo ![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_17.png) -在上一张图片里你看到的是 ReactOS 的“应用管理器”,这东西很 Linux。尽管你不会在这里找到任何与 LInux 有关系的东西。只有在这个系统里工作良好的开源软件才会在这个管理器中出现。这就导致了管理器中有的分类下挤的满满当当,有的分类却冷清异常。 +在上一张图片里你看到的是 ReactOS 的“应用管理器”,这东西是 Linux 的标配。不过你不会在这里找到任何与 Linux 有关系的东西。只有在这个系统里工作良好的开源软件才会在这个管理器中出现。这就导致了管理器中有的分类下挤得满满当当,有的却冷清异常。 ![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_18.png) -我试着通过软件中心安装了 Firefox 以及通过直接下载exe文件双击安装 Notepad++。这两个应用都能完美运行:它们的图标出现在了桌面上,在菜单中也出现了它们的名字,Notepad ++ 也出现在了软件中心右侧的分类栏里。 +我试着通过软件中心安装了 Firefox 以及通过直接下载 exe 文件双击安装 Notepad++。这两个应用都能完美运行:它们的图标出现在了桌面上,在菜单中也出现了它们的名字,Notepad++ 也出现在了软件中心右侧的分类栏里。 ![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_19.png) -我没有尝试运行任何现代的 Windows 游戏,如果你想配置 Direct 3D 的话你可以转到 “我的电脑/控制选项/WineD3D 配置”。在那里,你能看到很多和 dx 8 相似的Direct3D 选项。 +我没有尝试运行任何现代的 Windows 游戏,如果你想配置 Direct 3D 的话,你可以转到 “我的电脑/控制选项/WineD3D 配置”。在那里,你能看到很多 Direct3D 选项,大致与 dx 8 的选项类似。 ![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_20.png) -ReactOS 还有一个好啊,就是我们可以通过“我的电脑”来操控注册表。 +ReactOS 还有一个好啊,就是我们可以通过“我的电脑”来操作注册表。 ![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_21.png) -如果你需要一个简单点的工具,你可以在停用菜单里打开注册表编辑器。 +如果你需要一个简单点的工具,你可以在应用菜单里打开注册表编辑器。 ![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_22.png) @@ -112,7 +112,7 @@ ReactOS 还有一个好啊,就是我们可以通过“我的电脑”来操控 ### 结论 -老实说,我对 ReactOS 的工作方式印象深刻。它相当稳定,连贯,快速,真正人性化。抛开 Windows 的阴影(过时的应用菜单,不合理的菜单结构)不谈的话,ReactOS 几乎做到了尽善尽美。它可能不会有太多应用可供选择,现有的功能也可能不够强大,但是我确信它以后会有自己的一席之地。关于它的数据显示出了它的人气,我确定将要围绕它建立起来的社区将会很快就壮大到能把这个项目带往成功之路的地步。如今,ReactOS 的最新版本是 0.4.1。如果想要以开源的方式运行 Windows 的应用,那么它就是你的菜! +老实说,我对 ReactOS 的工作方式印象深刻。它相当稳定、连贯、快速,并且真正人性化。抛开 Windows 的阴影(过时的应用菜单,不合理的菜单结构)不谈的话,ReactOS 几乎做到了尽善尽美。它可能不会有太多应用可供选择,现有的功能也可能不够强大,但是我确信它将会繁荣壮大。关于它的数据显示出了它的人气,我确定将要围绕它建立起来的社区将会很快就壮大到能把这个项目带往成功之路的地步。如今,ReactOS 的最新版本是 0.4.1。如果想要以开源的方式运行 Windows 的应用,那么它就是你的菜! -------------------------------------------------------------------------------- @@ -121,9 +121,8 @@ via: https://www.howtoforge.com/tutorial/getting-started-with-reactos/ 作者:[Bill Toulas][a] 译者:[name1e5s](https://github.com/name1e5s) -校对:[校对者ID](https://github.com/校对者ID) +校对:[PurlingNayuki](https://github.com/PurlingNayuki) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://www.howtoforge.com/tutorial/getting-started-with-reactos/ - From edb0dd9eb39e38c0c18467b65f6424d00a007ad4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=9C=E9=A3=8E=E5=94=AF=E7=AC=91?= Date: Sun, 26 Jun 2016 00:00:04 +0800 Subject: [PATCH 0977/1469] =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E7=9A=84=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 完成文档的翻译 --- ...n Per-Process and Per-User Basis in Linux.md | 535 +++++++++--------- 1 file changed, 265 insertions(+), 270 deletions(-) diff --git a/sources/tech/20160604 Smem – Reports Memory Consumption Per-Process and Per-User Basis in Linux.md b/sources/tech/20160604 Smem – Reports Memory Consumption Per-Process and Per-User Basis in Linux.md index b0aa8e68ff..befcdb5d31 100644 --- a/sources/tech/20160604 Smem – Reports Memory Consumption Per-Process and Per-User Basis in Linux.md +++ b/sources/tech/20160604 Smem – Reports Memory Consumption Per-Process and Per-User Basis in Linux.md @@ -1,396 +1,395 @@ -Smem – Reports Memory Consumption Per-Process and Per-User Basis in Linux +Smem – Linux 下基于进程和用户的内存占用报告程序 =========================================================================== -Memory management in terms of monitoring memory usage is one important thing to do on your Linux system, there are many tools available for monitoring your memory usage that you can find on different Linux distributions. But they work in different ways, in this how to guide, we shall take a look at how to install and use one such tool called smem. +Linux 系统的内存管理工作中,内存使用情况的监控是十分重要的,不同的 Linux 发行版可能会提供不同的工具。但是它们的工作方式多种多样,这里,我们将会介绍如何安装和使用这样的一个名为 SMEM 的工具软件。 -Smem is a command-line memory reporting tool thats gives a user diverse reports on memory usage on a Linux system. There is one unique thing about smem, unlike other traditional memory reporting tools, it reports PSS (Proportional Set Size), a more meaningful representation of memory usage by applications and libraries in a virtual memory setup. +Smem 是一款命令行下的内存使用情况报告工具。和其它传统的内存报告工具不同个,它仅做这一件事情——报告 PPS(实际使用的物理内存[比例分配共享库占用的内存]),这种内存使用量表示方法对于那些在虚拟内存中的应用和库更有意义。 ![](http://www.tecmint.com/wp-content/uploads/2016/06/Smem-Linux-Memory-Reporting-Tool.png) ->Smem – Linux Memory Reporting Tool +>Smem – Linux 内存报告工具 -Existing traditional tools focus mainly on reading RSS (Resident Set Size) which is a standard measure to monitor memory usage in a physical memory scheme, but tends to overestimate memory usage by applications. +已有的传统工具会将目光主要集中于读取 RSS(实际使用物理内存[包含共享库占用的内存]),这种方法对于恒量那些使用物理内存方案的使用情况来说是标准方法,但是应用程序往往会高估内存的使用情况。 -PSS on the other hand, gives a reasonable measure by determining the “fair-share” of memory used by applications and libraries in a virtual memory scheme. +PSS 从另一个侧面,为那些使用虚拟内存方案的应用和库提供了给出了确定内存“公评分担”的合理措施。 -You can read this [guide (about memory RSS and PSS)][1] to understand memory consumption in a Linux system, but let us proceed to looking at some of the features of smem. +你可以 [阅读此指南了解 (关于内存的 RSS 和 PSS)][1] Linux 系统中的内存占用。 -### Features of Smem Tool +### Smem 这一工具的特点 -- System overview listing -- Listings and also filtering by process, mappings or user -- Using data from /proc filesystem -- Configurable listing columns from several data sources -- Configurable output units and percentages -- Easy to configure headers and totals in listings -- Using data snapshots from directory mirrors or compressed tar files -- Built-in chart generation mechanism -- Lightweight capture tool used in embedded systems +- 系统概览列表 +- 以进程,映射和用户来显示或者是过滤 +- 从 /proc 文件系统中得到数据 +- 从多个数据源配置显示条目 +- 可配置输出单元和百分比 +- 易于配置列表标题和汇总 +- 从镜像文件夹或者是压缩的 tar 文件中获得数据快照 +- 内置的图表生成机制 +- 在嵌入式系统中使用轻量级的捕获工具 -### How to Install Smem – Memory Reporting Tool in Linux +### 如何安装 Smem - Linux 下的内存使用情况报告工具 -Before you proceed with installation of smem, your system must meet the following requirements: +安装之前,需要确保满足以下的条件: -- modern kernel (> 2.6.27 or so) -- a recent version of Python (2.4 or so) -- optional [matplotlib][2] library for generation of charts +- 现代内存 (版本号高于 2.6.27) +- 较新的 Python 版本 (2.4 及以后版本) +- 可选的 [matplotlib][2] 库用于生成图表 -Most of the today’s Linux distributions comes with latest Kernel version with Python 2 or 3 support, so the only requirement is to install matplotlib library which is used to generate nice charts. +对于当今的大多数的 Linux 发行版而言,内核版本和 Python 的版本都能够 满足需要,所以仅需要为生成良好的图表安装 matplotlib 库。 -#### On RHEL, CentOS and Fedora +#### RHEL, CentOS 和 Fedora -First enable [EPEL (Extra Packages for Enterprise Linux)][3] repository and then install as follows: +首先启用 [EPEL (Extra Packages for Enterprise Linux)][3] 软件源然后按照下列步骤操作: ``` # yum install smem python-matplotlib python-tk ``` -#### On Debian and Ubuntu +#### Debian 和 Ubuntu ``` $ sudo apt-get install smem ``` -#### On Linux Mint +#### Linux Mint ``` $ sudo apt-get install smem python-matplotlib python-tk ``` -#### on Arch Linux +#### Arch Linux -Use this [AUR repository][4]. +使用此 [AUR repository][4]。 -### How to Use Smem – Memory Reporting Tool in Linux +### 如何使用 Smem – Linux 下的内存使用情况报告工具 -To view a report of memory usage across the whole system, by all system users, run the following command: +为了查看整个系统所有用户的内存使用情况,运行以下的命令: ``` -$ sudo smem +$ sudo smem ``` -Monitor Memory Usage of Linux System +监视 Linux 系统中的内存使用情况 ``` - PID User Command Swap USS PSS RSS - 6367 tecmint cat 0 100 145 1784 - 6368 tecmint cat 0 100 147 1676 - 2864 tecmint /usr/bin/ck-launch-session 0 144 165 1780 - 7656 tecmint gnome-pty-helper 0 156 178 1832 - 5758 tecmint gnome-pty-helper 0 156 179 1916 - 1441 root /sbin/getty -8 38400 tty2 0 152 184 2052 - 1434 root /sbin/getty -8 38400 tty5 0 156 187 2060 - 1444 root /sbin/getty -8 38400 tty3 0 156 187 2060 - 1432 root /sbin/getty -8 38400 tty4 0 156 188 2124 - 1452 root /sbin/getty -8 38400 tty6 0 164 196 2064 - 2619 root /sbin/getty -8 38400 tty1 0 164 196 2136 - 3544 tecmint sh -c /usr/lib/linuxmint/mi 0 212 224 1540 - 1504 root acpid -c /etc/acpi/events - 0 220 236 1604 - 3311 tecmint syndaemon -i 0.5 -K -R 0 252 292 2556 - 3143 rtkit /usr/lib/rtkit/rtkit-daemon 0 300 326 2548 - 1588 root cron 0 292 333 2344 - 1589 avahi avahi-daemon: chroot helpe 0 124 334 1632 - 1523 root /usr/sbin/irqbalance 0 316 343 2096 - 585 root upstart-socket-bridge --dae 0 328 351 1820 - 3033 tecmint /usr/bin/dbus-launch --exit 0 328 360 2160 - 1346 root upstart-file-bridge --daemo 0 348 371 1776 - 2607 root /usr/bin/xdm 0 188 378 2368 - 1635 kernoops /usr/sbin/kerneloops 0 352 386 2684 - 344 root upstart-udev-bridge --daemo 0 400 427 2132 - 2960 tecmint /usr/bin/ssh-agent /usr/bin 0 480 485 992 - 3468 tecmint /bin/dbus-daemon --config-f 0 344 515 3284 - 1559 avahi avahi-daemon: running [tecm 0 284 517 3108 - 7289 postfix pickup -l -t unix -u -c 0 288 534 2808 - 2135 root /usr/lib/postfix/master 0 352 576 2872 - 2436 postfix qmgr -l -t unix -u 0 360 606 2884 - 1521 root /lib/systemd/systemd-logind 0 600 650 3276 - 2222 nobody /usr/sbin/dnsmasq --no-reso 0 604 669 3288 + PID User Command Swap USS PSS RSS + 6367 tecmint cat 0 100 145 1784 + 6368 tecmint cat 0 100 147 1676 + 2864 tecmint /usr/bin/ck-launch-session 0 144 165 1780 + 7656 tecmint gnome-pty-helper 0 156 178 1832 + 5758 tecmint gnome-pty-helper 0 156 179 1916 + 1441 root /sbin/getty -8 38400 tty2 0 152 184 2052 + 1434 root /sbin/getty -8 38400 tty5 0 156 187 2060 + 1444 root /sbin/getty -8 38400 tty3 0 156 187 2060 + 1432 root /sbin/getty -8 38400 tty4 0 156 188 2124 + 1452 root /sbin/getty -8 38400 tty6 0 164 196 2064 + 2619 root /sbin/getty -8 38400 tty1 0 164 196 2136 + 3544 tecmint sh -c /usr/lib/linuxmint/mi 0 212 224 1540 + 1504 root acpid -c /etc/acpi/events - 0 220 236 1604 + 3311 tecmint syndaemon -i 0.5 -K -R 0 252 292 2556 + 3143 rtkit /usr/lib/rtkit/rtkit-daemon 0 300 326 2548 + 1588 root cron 0 292 333 2344 + 1589 avahi avahi-daemon: chroot helpe 0 124 334 1632 + 1523 root /usr/sbin/irqbalance 0 316 343 2096 + 585 root upstart-socket-bridge --dae 0 328 351 1820 + 3033 tecmint /usr/bin/dbus-launch --exit 0 328 360 2160 + 1346 root upstart-file-bridge --daemo 0 348 371 1776 + 2607 root /usr/bin/xdm 0 188 378 2368 + 1635 kernoops /usr/sbin/kerneloops 0 352 386 2684 + 344 root upstart-udev-bridge --daemo 0 400 427 2132 + 2960 tecmint /usr/bin/ssh-agent /usr/bin 0 480 485 992 + 3468 tecmint /bin/dbus-daemon --config-f 0 344 515 3284 + 1559 avahi avahi-daemon: running [tecm 0 284 517 3108 + 7289 postfix pickup -l -t unix -u -c 0 288 534 2808 + 2135 root /usr/lib/postfix/master 0 352 576 2872 + 2436 postfix qmgr -l -t unix -u 0 360 606 2884 + 1521 root /lib/systemd/systemd-logind 0 600 650 3276 + 2222 nobody /usr/sbin/dnsmasq --no-reso 0 604 669 3288 .... ``` -When a normal user runs smem, it displays memory usage by process that the user has started, the processes are arranged in order of increasing PSS. +当常规用户运行 smem,将会显示由用户启用的进程的占用情况,其中进程按照 PSS 的值升序排列。 -Take a look at the output below on my system for memory usage by processes started by user aaronkilik: +下面的输出为用户 “aaronkilik” 启用的进程的使用情况: ``` $ smem ``` -Monitor User Memory Usage in Linux +监视 Linux 系统中的内存使用情况 ``` - PID User Command Swap USS PSS RSS - 6367 tecmint cat 0 100 145 1784 - 6368 tecmint cat 0 100 147 1676 - 2864 tecmint /usr/bin/ck-launch-session 0 144 166 1780 - 3544 tecmint sh -c /usr/lib/linuxmint/mi 0 212 224 1540 - 3311 tecmint syndaemon -i 0.5 -K -R 0 252 292 2556 - 3033 tecmint /usr/bin/dbus-launch --exit 0 328 360 2160 - 3468 tecmint /bin/dbus-daemon --config-f 0 344 515 3284 - 3122 tecmint /usr/lib/gvfs/gvfsd 0 656 801 5552 - 3471 tecmint /usr/lib/at-spi2-core/at-sp 0 708 864 5992 - 3396 tecmint /usr/lib/gvfs/gvfs-mtp-volu 0 804 914 6204 - 3208 tecmint /usr/lib/x86_64-linux-gnu/i 0 892 1012 6188 - 3380 tecmint /usr/lib/gvfs/gvfs-afc-volu 0 820 1024 6396 - 3034 tecmint //bin/dbus-daemon --fork -- 0 920 1081 3040 - 3365 tecmint /usr/lib/gvfs/gvfs-gphoto2- 0 972 1099 6052 - 3228 tecmint /usr/lib/gvfs/gvfsd-trash - 0 980 1153 6648 - 3107 tecmint /usr/lib/dconf/dconf-servic 0 1212 1283 5376 - 6399 tecmint /opt/google/chrome/chrome - 0 144 1409 10732 - 3478 tecmint /usr/lib/x86_64-linux-gnu/g 0 1724 1820 6320 - 7365 tecmint /usr/lib/gvfs/gvfsd-http -- 0 1352 1884 8704 - 6937 tecmint /opt/libreoffice5.0/program 0 1140 2328 5040 - 3194 tecmint /usr/lib/x86_64-linux-gnu/p 0 1956 2405 14228 - 6373 tecmint /opt/google/chrome/nacl_hel 0 2324 2541 8908 - 3313 tecmint /usr/lib/gvfs/gvfs-udisks2- 0 2460 2754 8736 - 3464 tecmint /usr/lib/at-spi2-core/at-sp 0 2684 2823 7920 - 5771 tecmint ssh -p 4521 tecmnt765@212.7 0 2544 2864 6540 - 5759 tecmint /bin/bash 0 2416 2923 5640 - 3541 tecmint /usr/bin/python /usr/bin/mi 0 2584 3008 7248 - 7657 tecmint bash 0 2516 3055 6028 - 3127 tecmint /usr/lib/gvfs/gvfsd-fuse /r 0 3024 3126 8032 - 3205 tecmint mate-screensaver 0 2520 3331 18072 - 3171 tecmint /usr/lib/mate-panel/notific 0 2860 3495 17140 - 3030 tecmint x-session-manager 0 4400 4879 17500 - 3197 tecmint mate-volume-control-applet 0 3860 5226 23736 + PID User Command Swap USS PSS RSS + 6367 tecmint cat 0 100 145 1784 + 6368 tecmint cat 0 100 147 1676 + 2864 tecmint /usr/bin/ck-launch-session 0 144 166 1780 + 3544 tecmint sh -c /usr/lib/linuxmint/mi 0 212 224 1540 + 3311 tecmint syndaemon -i 0.5 -K -R 0 252 292 2556 + 3033 tecmint /usr/bin/dbus-launch --exit 0 328 360 2160 + 3468 tecmint /bin/dbus-daemon --config-f 0 344 515 3284 + 3122 tecmint /usr/lib/gvfs/gvfsd 0 656 801 5552 + 3471 tecmint /usr/lib/at-spi2-core/at-sp 0 708 864 5992 + 3396 tecmint /usr/lib/gvfs/gvfs-mtp-volu 0 804 914 6204 + 3208 tecmint /usr/lib/x86_64-linux-gnu/i 0 892 1012 6188 + 3380 tecmint /usr/lib/gvfs/gvfs-afc-volu 0 820 1024 6396 + 3034 tecmint //bin/dbus-daemon --fork -- 0 920 1081 3040 + 3365 tecmint /usr/lib/gvfs/gvfs-gphoto2- 0 972 1099 6052 + 3228 tecmint /usr/lib/gvfs/gvfsd-trash - 0 980 1153 6648 + 3107 tecmint /usr/lib/dconf/dconf-servic 0 1212 1283 5376 + 6399 tecmint /opt/google/chrome/chrome - 0 144 1409 10732 + 3478 tecmint /usr/lib/x86_64-linux-gnu/g 0 1724 1820 6320 + 7365 tecmint /usr/lib/gvfs/gvfsd-http -- 0 1352 1884 8704 + 6937 tecmint /opt/libreoffice5.0/program 0 1140 2328 5040 + 3194 tecmint /usr/lib/x86_64-linux-gnu/p 0 1956 2405 14228 + 6373 tecmint /opt/google/chrome/nacl_hel 0 2324 2541 8908 + 3313 tecmint /usr/lib/gvfs/gvfs-udisks2- 0 2460 2754 8736 + 3464 tecmint /usr/lib/at-spi2-core/at-sp 0 2684 2823 7920 + 5771 tecmint ssh -p 4521 tecmnt765@212.7 0 2544 2864 6540 + 5759 tecmint /bin/bash 0 2416 2923 5640 + 3541 tecmint /usr/bin/python /usr/bin/mi 0 2584 3008 7248 + 7657 tecmint bash 0 2516 3055 6028 + 3127 tecmint /usr/lib/gvfs/gvfsd-fuse /r 0 3024 3126 8032 + 3205 tecmint mate-screensaver 0 2520 3331 18072 + 3171 tecmint /usr/lib/mate-panel/notific 0 2860 3495 17140 + 3030 tecmint x-session-manager 0 4400 4879 17500 + 3197 tecmint mate-volume-control-applet 0 3860 5226 23736 ... ``` -There are many options to invoke while using smem, for example, to view system wide memory consumption, run the following command: +使用 smem 是还有一些参数可以选用,例如当参看整个系统的内存占用情况,运行以下的命令: ``` $ sudo smem -w ``` - -Monitor System Wide Memory User Consumption +监视 Linux 系统中的内存使用情况 ``` -Area Used Cache Noncache -firmware/hardware 0 0 0 -kernel image 0 0 0 -kernel dynamic memory 1425320 1291412 133908 -userspace memory 2215368 451608 1763760 -free memory 4424936 4424936 0 +Area Used Cache Noncache +firmware/hardware 0 0 0 +kernel image 0 0 0 +kernel dynamic memory 1425320 1291412 133908 +userspace memory 2215368 451608 1763760 +free memory 4424936 4424936 0 ``` -To view memory usage on a per-user basis, run the command below: +如果想要查看每一个用户的内存使用情况,运行以下的命令: ``` $ sudo smem -u ``` -Monitor Memory Consumption Per-User Basis in Linux +Linux 下以用户为单位监控内存占用情况 ``` -User Count Swap USS PSS RSS -rtkit 1 0 300 326 2548 -kernoops 1 0 352 385 2684 -avahi 2 0 408 851 4740 -postfix 2 0 648 1140 5692 -messagebus 1 0 1012 1173 3320 -syslog 1 0 1396 1419 3232 -www-data 2 0 5100 6572 13580 -mpd 1 0 7416 8302 12896 -nobody 2 0 4024 11305 24728 -root 39 0 323876 353418 496520 -tecmint 64 0 1652888 1815699 2763112 +User Count Swap USS PSS RSS +rtkit 1 0 300 326 2548 +kernoops 1 0 352 385 2684 +avahi 2 0 408 851 4740 +postfix 2 0 648 1140 5692 +messagebus 1 0 1012 1173 3320 +syslog 1 0 1396 1419 3232 +www-data 2 0 5100 6572 13580 +mpd 1 0 7416 8302 12896 +nobody 2 0 4024 11305 24728 +root 39 0 323876 353418 496520 +tecmint 64 0 1652888 1815699 2763112 ``` -You can also report memory usage by mappings as follows: +你也可以按照映射显示内存使用情况: ``` $ sudo smem -m ``` -Monitor Memory Usage by Mappings in Linux +Linux 下以映射为单位监控内存占用情况 ``` -Map PIDs AVGPSS PSS -/dev/fb0 1 0 0 -/home/tecmint/.cache/fontconfig/7ef2298f 18 0 0 -/home/tecmint/.cache/fontconfig/c57959a1 18 0 0 -/home/tecmint/.local/share/mime/mime.cac 15 0 0 -/opt/google/chrome/chrome_material_100_p 9 0 0 -/opt/google/chrome/chrome_material_200_p 9 0 0 -/usr/lib/x86_64-linux-gnu/gconv/gconv-mo 41 0 0 -/usr/share/icons/Mint-X-Teal/icon-theme. 15 0 0 -/var/cache/fontconfig/0c9eb80ebd1c36541e 20 0 0 -/var/cache/fontconfig/0d8c3b2ac0904cb8a5 20 0 0 -/var/cache/fontconfig/1ac9eb803944fde146 20 0 0 -/var/cache/fontconfig/3830d5c3ddfd5cd38a 20 0 0 -/var/cache/fontconfig/385c0604a188198f04 20 0 0 -/var/cache/fontconfig/4794a0821666d79190 20 0 0 -/var/cache/fontconfig/56cf4f4769d0f4abc8 20 0 0 -/var/cache/fontconfig/767a8244fc0220cfb5 20 0 0 -/var/cache/fontconfig/8801497958630a81b7 20 0 0 -/var/cache/fontconfig/99e8ed0e538f840c56 20 0 0 -/var/cache/fontconfig/b9d506c9ac06c20b43 20 0 0 -/var/cache/fontconfig/c05880de57d1f5e948 20 0 0 -/var/cache/fontconfig/dc05db6664285cc2f1 20 0 0 -/var/cache/fontconfig/e13b20fdb08344e0e6 20 0 0 -/var/cache/fontconfig/e7071f4a29fa870f43 20 0 0 +Map PIDs AVGPSS PSS +/dev/fb0 1 0 0 +/home/tecmint/.cache/fontconfig/7ef2298f 18 0 0 +/home/tecmint/.cache/fontconfig/c57959a1 18 0 0 +/home/tecmint/.local/share/mime/mime.cac 15 0 0 +/opt/google/chrome/chrome_material_100_p 9 0 0 +/opt/google/chrome/chrome_material_200_p 9 0 0 +/usr/lib/x86_64-linux-gnu/gconv/gconv-mo 41 0 0 +/usr/share/icons/Mint-X-Teal/icon-theme. 15 0 0 +/var/cache/fontconfig/0c9eb80ebd1c36541e 20 0 0 +/var/cache/fontconfig/0d8c3b2ac0904cb8a5 20 0 0 +/var/cache/fontconfig/1ac9eb803944fde146 20 0 0 +/var/cache/fontconfig/3830d5c3ddfd5cd38a 20 0 0 +/var/cache/fontconfig/385c0604a188198f04 20 0 0 +/var/cache/fontconfig/4794a0821666d79190 20 0 0 +/var/cache/fontconfig/56cf4f4769d0f4abc8 20 0 0 +/var/cache/fontconfig/767a8244fc0220cfb5 20 0 0 +/var/cache/fontconfig/8801497958630a81b7 20 0 0 +/var/cache/fontconfig/99e8ed0e538f840c56 20 0 0 +/var/cache/fontconfig/b9d506c9ac06c20b43 20 0 0 +/var/cache/fontconfig/c05880de57d1f5e948 20 0 0 +/var/cache/fontconfig/dc05db6664285cc2f1 20 0 0 +/var/cache/fontconfig/e13b20fdb08344e0e6 20 0 0 +/var/cache/fontconfig/e7071f4a29fa870f43 20 0 0 .... ``` -There are also options for filtering smem output and we shall look at two examples here. +还有其它的选项用于 smem 的输出,下面将会举两个例子。 -To filter output by username, invoke the -u or --userfilter="regex" option as below: +要按照用户名筛选输出的信息,调用 -u 或者是 --userfilter="regex" 选项,就像下面的命令这样: ``` $ sudo smem -u ``` -Report Memory Usage by User +按照用户报告内存使用情况 ``` -User Count Swap USS PSS RSS -rtkit 1 0 300 326 2548 -kernoops 1 0 352 385 2684 -avahi 2 0 408 851 4740 -postfix 2 0 648 1140 5692 -messagebus 1 0 1012 1173 3320 -syslog 1 0 1400 1423 3236 -www-data 2 0 5100 6572 13580 -mpd 1 0 7416 8302 12896 -nobody 2 0 4024 11305 24728 -root 39 0 323804 353374 496552 -tecmint 64 0 1708900 1871766 2819212 +User Count Swap USS PSS RSS +rtkit 1 0 300 326 2548 +kernoops 1 0 352 385 2684 +avahi 2 0 408 851 4740 +postfix 2 0 648 1140 5692 +messagebus 1 0 1012 1173 3320 +syslog 1 0 1400 1423 3236 +www-data 2 0 5100 6572 13580 +mpd 1 0 7416 8302 12896 +nobody 2 0 4024 11305 24728 +root 39 0 323804 353374 496552 +tecmint 64 0 1708900 1871766 2819212 ``` -To filter output by process name, invoke the -P or --processfilter="regex" option as follows: +要按照进程名称筛选输出信息,调用 -P 或者是 --processfilter="regex" 选项,就像下面的命令这样: ``` $ sudo smem --processfilter="firefox" ``` -Report Memory Usage by Process Name +按照进程名称报告内存使用情况 ``` -PID User Command Swap USS PSS RSS - 9212 root sudo smem --processfilter=f 0 1172 1434 4856 - 9213 root /usr/bin/python /usr/bin/sm 0 7368 7793 11984 - 4424 tecmint /usr/lib/firefox/firefox 0 931732 937590 961504 +PID User Command Swap USS PSS RSS + 9212 root sudo smem --processfilter=f 0 1172 1434 4856 + 9213 root /usr/bin/python /usr/bin/sm 0 7368 7793 11984 + 4424 tecmint /usr/lib/firefox/firefox 0 931732 937590 961504 ``` - -Output formatting can be very important, and there are options to help you format memory reports and we shall take a look at few examples below. -To show desired columns in the report, use -c or --columns option as follows: +输出的格式有时候也很重要,smem 提供了一些参数帮助您格式化内存使用报告,我们将举出几个例子。 + +设置哪些列在报告中,使用 -c 或者是 --columns选项,就像下面的命令这样: ``` $ sudo smem -c "name user pss rss" ``` -Report Memory Usage by Columns +按列报告内存使用情况 ``` -Name User PSS RSS -cat tecmint 145 1784 -cat tecmint 147 1676 -ck-launch-sessi tecmint 165 1780 -gnome-pty-helpe tecmint 178 1832 -gnome-pty-helpe tecmint 179 1916 -getty root 184 2052 -getty root 187 2060 -getty root 187 2060 -getty root 188 2124 -getty root 196 2064 -getty root 196 2136 -sh tecmint 224 1540 -acpid root 236 1604 -syndaemon tecmint 296 2560 -rtkit-daemon rtkit 326 2548 -cron root 333 2344 -avahi-daemon avahi 334 1632 -irqbalance root 343 2096 -upstart-socket- root 351 1820 -dbus-launch tecmint 360 2160 -upstart-file-br root 371 1776 -xdm root 378 2368 -kerneloops kernoops 386 2684 -upstart-udev-br root 427 2132 -ssh-agent tecmint 485 992 +Name User PSS RSS +cat tecmint 145 1784 +cat tecmint 147 1676 +ck-launch-sessi tecmint 165 1780 +gnome-pty-helpe tecmint 178 1832 +gnome-pty-helpe tecmint 179 1916 +getty root 184 2052 +getty root 187 2060 +getty root 187 2060 +getty root 188 2124 +getty root 196 2064 +getty root 196 2136 +sh tecmint 224 1540 +acpid root 236 1604 +syndaemon tecmint 296 2560 +rtkit-daemon rtkit 326 2548 +cron root 333 2344 +avahi-daemon avahi 334 1632 +irqbalance root 343 2096 +upstart-socket- root 351 1820 +dbus-launch tecmint 360 2160 +upstart-file-br root 371 1776 +xdm root 378 2368 +kerneloops kernoops 386 2684 +upstart-udev-br root 427 2132 +ssh-agent tecmint 485 992 ... ``` -You can invoke the -p option to report memory usage in percentages, as in the command below: +也可以调用 -p 选项以百分比的形式报告内存使用情况,就像下面的命令这样: ``` $ sudo smem -p ``` -Report Memory Usage by Percentages +按百分比报告内存使用情况 ``` - PID User Command Swap USS PSS RSS - 6367 tecmint cat 0.00% 0.00% 0.00% 0.02% - 6368 tecmint cat 0.00% 0.00% 0.00% 0.02% - 9307 tecmint sh -c { sudo /usr/lib/linux 0.00% 0.00% 0.00% 0.02% - 2864 tecmint /usr/bin/ck-launch-session 0.00% 0.00% 0.00% 0.02% - 3544 tecmint sh -c /usr/lib/linuxmint/mi 0.00% 0.00% 0.00% 0.02% - 5758 tecmint gnome-pty-helper 0.00% 0.00% 0.00% 0.02% - 7656 tecmint gnome-pty-helper 0.00% 0.00% 0.00% 0.02% - 1441 root /sbin/getty -8 38400 tty2 0.00% 0.00% 0.00% 0.03% - 1434 root /sbin/getty -8 38400 tty5 0.00% 0.00% 0.00% 0.03% - 1444 root /sbin/getty -8 38400 tty3 0.00% 0.00% 0.00% 0.03% - 1432 root /sbin/getty -8 38400 tty4 0.00% 0.00% 0.00% 0.03% - 1452 root /sbin/getty -8 38400 tty6 0.00% 0.00% 0.00% 0.03% - 2619 root /sbin/getty -8 38400 tty1 0.00% 0.00% 0.00% 0.03% - 1504 root acpid -c /etc/acpi/events - 0.00% 0.00% 0.00% 0.02% - 3311 tecmint syndaemon -i 0.5 -K -R 0.00% 0.00% 0.00% 0.03% - 3143 rtkit /usr/lib/rtkit/rtkit-daemon 0.00% 0.00% 0.00% 0.03% - 1588 root cron 0.00% 0.00% 0.00% 0.03% - 1589 avahi avahi-daemon: chroot helpe 0.00% 0.00% 0.00% 0.02% - 1523 root /usr/sbin/irqbalance 0.00% 0.00% 0.00% 0.03% - 585 root upstart-socket-bridge --dae 0.00% 0.00% 0.00% 0.02% - 3033 tecmint /usr/bin/dbus-launch --exit 0.00% 0.00% 0.00% 0.03% + PID User Command Swap USS PSS RSS + 6367 tecmint cat 0.00% 0.00% 0.00% 0.02% + 6368 tecmint cat 0.00% 0.00% 0.00% 0.02% + 9307 tecmint sh -c { sudo /usr/lib/linux 0.00% 0.00% 0.00% 0.02% + 2864 tecmint /usr/bin/ck-launch-session 0.00% 0.00% 0.00% 0.02% + 3544 tecmint sh -c /usr/lib/linuxmint/mi 0.00% 0.00% 0.00% 0.02% + 5758 tecmint gnome-pty-helper 0.00% 0.00% 0.00% 0.02% + 7656 tecmint gnome-pty-helper 0.00% 0.00% 0.00% 0.02% + 1441 root /sbin/getty -8 38400 tty2 0.00% 0.00% 0.00% 0.03% + 1434 root /sbin/getty -8 38400 tty5 0.00% 0.00% 0.00% 0.03% + 1444 root /sbin/getty -8 38400 tty3 0.00% 0.00% 0.00% 0.03% + 1432 root /sbin/getty -8 38400 tty4 0.00% 0.00% 0.00% 0.03% + 1452 root /sbin/getty -8 38400 tty6 0.00% 0.00% 0.00% 0.03% + 2619 root /sbin/getty -8 38400 tty1 0.00% 0.00% 0.00% 0.03% + 1504 root acpid -c /etc/acpi/events - 0.00% 0.00% 0.00% 0.02% + 3311 tecmint syndaemon -i 0.5 -K -R 0.00% 0.00% 0.00% 0.03% + 3143 rtkit /usr/lib/rtkit/rtkit-daemon 0.00% 0.00% 0.00% 0.03% + 1588 root cron 0.00% 0.00% 0.00% 0.03% + 1589 avahi avahi-daemon: chroot helpe 0.00% 0.00% 0.00% 0.02% + 1523 root /usr/sbin/irqbalance 0.00% 0.00% 0.00% 0.03% + 585 root upstart-socket-bridge --dae 0.00% 0.00% 0.00% 0.02% + 3033 tecmint /usr/bin/dbus-launch --exit 0.00% 0.00% 0.00% 0.03% .... ``` -The command below will show totals at the end of each column of the output: +下面的额命令将会在输出的最后输出一行汇总信息: ``` $ sudo smem -t ``` -Report Total Memory Usage Count +报告内存占用合计 ``` -PID User Command Swap USS PSS RSS - 6367 tecmint cat 0 100 139 1784 - 6368 tecmint cat 0 100 141 1676 - 9307 tecmint sh -c { sudo /usr/lib/linux 0 96 158 1508 - 2864 tecmint /usr/bin/ck-launch-session 0 144 163 1780 - 3544 tecmint sh -c /usr/lib/linuxmint/mi 0 108 170 1540 - 5758 tecmint gnome-pty-helper 0 156 176 1916 - 7656 tecmint gnome-pty-helper 0 156 176 1832 - 1441 root /sbin/getty -8 38400 tty2 0 152 181 2052 - 1434 root /sbin/getty -8 38400 tty5 0 156 184 2060 - 1444 root /sbin/getty -8 38400 tty3 0 156 184 2060 - 1432 root /sbin/getty -8 38400 tty4 0 156 185 2124 - 1452 root /sbin/getty -8 38400 tty6 0 164 193 2064 - 2619 root /sbin/getty -8 38400 tty1 0 164 193 2136 - 1504 root acpid -c /etc/acpi/events - 0 220 232 1604 - 3311 tecmint syndaemon -i 0.5 -K -R 0 260 298 2564 - 3143 rtkit /usr/lib/rtkit/rtkit-daemon 0 300 324 2548 - 1588 root cron 0 292 326 2344 - 1589 avahi avahi-daemon: chroot helpe 0 124 332 1632 - 1523 root /usr/sbin/irqbalance 0 316 340 2096 - 585 root upstart-socket-bridge --dae 0 328 349 1820 - 3033 tecmint /usr/bin/dbus-launch --exit 0 328 359 2160 - 1346 root upstart-file-bridge --daemo 0 348 370 1776 - 2607 root /usr/bin/xdm 0 188 375 2368 - 1635 kernoops /usr/sbin/kerneloops 0 352 384 2684 - 344 root upstart-udev-bridge --daemo 0 400 426 2132 +PID User Command Swap USS PSS RSS + 6367 tecmint cat 0 100 139 1784 + 6368 tecmint cat 0 100 141 1676 + 9307 tecmint sh -c { sudo /usr/lib/linux 0 96 158 1508 + 2864 tecmint /usr/bin/ck-launch-session 0 144 163 1780 + 3544 tecmint sh -c /usr/lib/linuxmint/mi 0 108 170 1540 + 5758 tecmint gnome-pty-helper 0 156 176 1916 + 7656 tecmint gnome-pty-helper 0 156 176 1832 + 1441 root /sbin/getty -8 38400 tty2 0 152 181 2052 + 1434 root /sbin/getty -8 38400 tty5 0 156 184 2060 + 1444 root /sbin/getty -8 38400 tty3 0 156 184 2060 + 1432 root /sbin/getty -8 38400 tty4 0 156 185 2124 + 1452 root /sbin/getty -8 38400 tty6 0 164 193 2064 + 2619 root /sbin/getty -8 38400 tty1 0 164 193 2136 + 1504 root acpid -c /etc/acpi/events - 0 220 232 1604 + 3311 tecmint syndaemon -i 0.5 -K -R 0 260 298 2564 + 3143 rtkit /usr/lib/rtkit/rtkit-daemon 0 300 324 2548 + 1588 root cron 0 292 326 2344 + 1589 avahi avahi-daemon: chroot helpe 0 124 332 1632 + 1523 root /usr/sbin/irqbalance 0 316 340 2096 + 585 root upstart-socket-bridge --dae 0 328 349 1820 + 3033 tecmint /usr/bin/dbus-launch --exit 0 328 359 2160 + 1346 root upstart-file-bridge --daemo 0 348 370 1776 + 2607 root /usr/bin/xdm 0 188 375 2368 + 1635 kernoops /usr/sbin/kerneloops 0 352 384 2684 + 344 root upstart-udev-bridge --daemo 0 400 426 2132 ..... ------------------------------------------------------------------------------- - 134 11 0 2171428 2376266 3587972 + 134 11 0 2171428 2376266 3587972 ``` -Further more, there are options for graphical reports that you can also use and we shall dive into them in this sub section. +另外,smem 也提供了选项以图形的形式报告内存的使用情况,我们将会在下一小节深入介绍。 -You can produce a bar graph of processes and their PSS and RSS values, in the example below, we produce a bar graph of processes owned by the root user. +比如,你可以生成一张进程的 PSS 和 RSS 值的条状图。在下面的例子中,我们会生成属于 root 用户的进程的内存占用图。 -The vertical plane shows the PSS and RSS measure of processes and the horizontal plane represents each root user process: +纵坐标为每一个进程的 PSS 和 RSS 值,横坐标为 root 用户的所有进程: ``` $ sudo smem --userfilter="root" --bar pid -c"pss rss" @@ -399,9 +398,9 @@ $ sudo smem --userfilter="root" --bar pid -c"pss rss" ![](http://www.tecmint.com/wp-content/uploads/2016/06/Linux-Memory-Usage-in-PSS-and-RSS-Values.png) >Linux Memory Usage in PSS and RSS Values -You can also produce a pie chart showing processes and their memory consumption based on PSS or RSS values. The command below outputs a pie chart for processes owned by root user measuring values. +也可以生成进程及其 PSS 和 RSS 占用量的饼状图。以下的命令将会输出一张 root 用户的所有进程的饼状。 -The `--pie` name means label by name and `-s` option helps to sort by PSS value. +`--pie` name 意思为以各个进程名字为标签,`-s` 选项帮助以 PSS 的值排序。 ``` $ sudo smem --userfilter="root" --pie name -s pss @@ -410,13 +409,13 @@ $ sudo smem --userfilter="root" --pie name -s pss ![](http://www.tecmint.com/wp-content/uploads/2016/06/Linux-Memory-Consumption-by-Processes.png) >Linux Memory Consumption by Processes -There are many other known fields apart from PSS and RSS used for labeling charts: +它们还提供了一些其它与 PSS 和 RSS 相关的字段用于图表的标签: -To get help, simply type, `smem -h` or visit the manual entry page. +假如需要获得帮助,非常简单,仅需要输入 `smem -h` 或者是浏览帮助页面。 -We shall stop here with smem, but to understand it better, use it with many other options that you can find in the man page. As usual you can use the comment section below to express any thoughts or concerns. +关于 smem 的介绍到底为止,不过想要更好的了解它,可以通过 man 手册获得更多的选项,然后一一实践。有什么想法或者疑惑,都可以跟帖评价。 -Reference Links: +参考链接: -------------------------------------------------------------------------------- @@ -424,7 +423,7 @@ Reference Links: via: http://www.tecmint.com/smem-linux-memory-usage-per-process-per-user/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tecmint+%28Tecmint%3A+Linux+Howto%27s+Guide%29 作者:[Aaron Kili][a] -译者:[译者ID](https://github.com/译者ID) +译者:[dongfengweixiao](https://github.com/dongfengweixiao) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -434,7 +433,3 @@ via: http://www.tecmint.com/smem-linux-memory-usage-per-process-per-user/?utm_so [2]: http://matplotlib.org/index.html [3]: http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/ [4]: https://www.archlinux.org/packages/community/i686/smem/ - - - - From 1daf527a827ca6f0cb75f626180b11af4640c570 Mon Sep 17 00:00:00 2001 From: Purling Nayuki Date: Sun, 26 Jun 2016 00:03:39 +0800 Subject: [PATCH 0978/1469] Move translated file to corresponding directory --- ...ts Memory Consumption Per-Process and Per-User Basis in Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20160604 Smem – Reports Memory Consumption Per-Process and Per-User Basis in Linux.md (100%) diff --git a/sources/tech/20160604 Smem – Reports Memory Consumption Per-Process and Per-User Basis in Linux.md b/translated/tech/20160604 Smem – Reports Memory Consumption Per-Process and Per-User Basis in Linux.md similarity index 100% rename from sources/tech/20160604 Smem – Reports Memory Consumption Per-Process and Per-User Basis in Linux.md rename to translated/tech/20160604 Smem – Reports Memory Consumption Per-Process and Per-User Basis in Linux.md From 9b8d751da4e8a0e7bbaf12c8cda438eaf1c986f4 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Sun, 26 Jun 2016 09:48:37 +0800 Subject: [PATCH 0979/1469] =?UTF-8?q?=E6=A0=A1=E5=AF=B9=E5=AE=8C=E6=88=90?= =?UTF-8?q?=20(#4100)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... How to Add Cron Jobs in Linux and Unix.md | 131 ++++++------------ 1 file changed, 42 insertions(+), 89 deletions(-) diff --git a/translated/tech/20160605 How to Add Cron Jobs in Linux and Unix.md b/translated/tech/20160605 How to Add Cron Jobs in Linux and Unix.md index 01ca7eb428..d445be5b51 100644 --- a/translated/tech/20160605 How to Add Cron Jobs in Linux and Unix.md +++ b/translated/tech/20160605 How to Add Cron Jobs in Linux and Unix.md @@ -1,40 +1,37 @@ -如何在Linux及Unix系统中添加定时任务 +如何在 Linux 及 Unix 系统中添加 cron 任务 ====================================== - ![](https://www.unixmen.com/wp-content/uploads/2016/05/HOW-TO-ADD-CRON-JOBS-IN-LINUX-AND-UNIX-696x334.png) ### 导言 ![](http://www.unixmen.com/wp-content/uploads/2016/05/cronjob.gif) -定时任务是用来定期执行计划命令的。你可以将命令组织到脚本当中,这样就可以在设定的时间将其重复执行。`Cron`是Linux系统或者类Unix系统当中最为实用的工具之一。定时服务(守护进程)在系统后台运行,并且会持续地检查 /etc/crontab 文件和 /etc/cron.*/ 目录。它同样也会检测 /var/spool/cron/ 目录。 - +定时任务 (Cron job) 被用于安排那些需要被周期性执行的命令。利用它,你可以配置某些命令或者脚本,让它们在某个设定的时间周期性地运行。`Cron` 是 Linux 或者类 Unix 系统中最为实用的工具之一。cron 服务(守护进程)在系统后台运行,并且会持续地检查 `/etc/crontab` 文件和 `/etc/cron.*/ `目录。它同样也会检测 `/var/spool/cron/` 目录。 ### crontab 命令 -`crontab`是用来安装、卸载或者列出定时配置文件列表的命令。定时配置文件则用于驱动`Vixie Cron`的[cron(8)][1]守护进程。每个用户都可以拥有自己的 crontab 文件,虽然这些文件位于 /var/spool/cron/crontabs 目录中,但这并不意味着你可以直接编辑它们。你需要通过`crontab`命令来编辑或者配置自己的定时任务。 - +`crontab` 是用来安装、卸载或者列出 cron 配置文件列表的命令。cron 配置文件则用于驱动 `Vixie Cron` 的 [cron(8)][1] 守护进程。每个用户都可以拥有自己的 crontab 文件,虽然这些文件都位于 `/var/spool/cron/crontabs` 目录中,但并不意味着你可以直接编辑它们。你需要通过 `crontab` 命令来编辑或者配置你自己的定时任务。 ### 定时配置文件的类型 配置文件分为以下不同的类型: -- **UNIX 或 Linux 系统的 crontab** : 此类型通常由类似需要root权限的系统服务或重要任务使用。第六个字段(见下方的字段介绍)为用户名,用来指定此命令以哪个用户身份来执行。如此一来,系统的`crontab`就能够以任意用户的身份来执行操作。 +- **UNIX 或 Linux 系统的 crontab** : 此类型通常由那些需要 root 或类似权限的系统服务和重要任务使用。第六个字段(见下方的字段介绍)为用户名,用来指定此命令以哪个用户身份来执行。如此一来,系统的 `crontab` 就能够以任意用户的身份来执行操作。 -- **用户的 crontabs**: 用户可以使用`corntab`命令来安装属于他们自己的定时任务。 第六个字段为需要运行的命令行, 所有的命令行都会以创建 crontab 的用户的身份运行。 +- **用户的 crontabs**: 用户可以使用 `corntab` 命令来安装属于他们自己的定时任务。 第六个字段为需要运行的命令, 所有的命令都会以创建该 crontab 任务的用户的身份运行。 -**注意**: 这种问答形式的`Cron`实现是由 Paul Vixie 所写的,并且被许多 [Linux][2] 发行版和类Unix系统(如广受欢迎的第四版BSD)包含其中。它的语法被各种计划任务的实现所[兼容][3]。 +**注意**: 这种问答形式的 `Cron` 实现由 Paul Vixie 所写,并且被包含在许多 [Linux][2] 发行版和类 Unix 系统(如广受欢迎的第四版 BSD)中。它的语法被各种 crond 的实现所[兼容][3]。 -该如何安装、创建或编辑我们自己的定时任务呢? +那么我该如何安装、创建或者编辑我自己的定时任务呢? -在 Linux 或 Unix 的shell提示符后键入以下命令来编辑你的 crontab 文件。 +要编辑你的 crontab 文件,需要在 Linux 或 Unix 的 shell 提示符后键入以下命令: ``` $ crontab -e ``` -`crontab`语法(字段介绍): +`crontab` 语法(字段介绍) 语法为: @@ -48,14 +45,14 @@ $ crontab -e 1 2 3 4 5 /root/ntp_sync.sh ``` -说明: +其中: - 1: 分钟 (0-59) - 2: 小时 (0-23) - 3: 日期 (0-31) -- 4: 月份 (0-12 [12 == December]) -- 5: 一周当中的某天 (0-7 [7 或 0 == 周日]) -- /path/to/command – 计划执行的脚本或命令名 +- 4: 月份 (0-12 [12 代表 December]) +- 5: 一周当中的某天 (0-7 [7 或 0 代表星期天]) +- /path/to/command – 计划执行的脚本或命令的名称 便于记忆的格式: @@ -63,113 +60,70 @@ $ crontab -e * * * * * command to be executed – – – – – | | | | | -| | | | —– 一周当中的某天 (0 – 7) (周日=0 or 7) +| | | | —– 一周当中的某天 (0 – 7) (周日为 0 或 7) | | | ——- 月份 (1 – 12) | | ——— 一月当中的某天 (1 – 31) | ———– 小时 (0 – 23) ————- 分钟 (0 – 59) ``` -简单的`crontab`示例: +简单的 `crontab` 示例: ```` -## 每隔5分钟运行一次 backupscript 脚本## +## 每隔 5 分钟运行一次 backupscript 脚本 ## */5 * * * * /root/backupscript.sh -## 每天的上午1:00运行 backupscript 脚本 ## +## 每天的凌晨 1 点运行 backupscript 脚本 ## 0 1 * * * /root/backupscript.sh -## 每月的第一个上午3:15 运行 backupscript 脚本 ## +## 每月的第一个凌晨 3:15 运行 backupscript 脚本 ## 15 3 1 * * /root/backupscript.sh ``` - ### 如何使用操作符 操作符允许你为一个字段指定多个值,这里有三个操作符可供使用: -- **星号 (*)** : 此操作符为字段指定所有可用的值。举个例子,在小时字段中,一个星号等同于所有可用的hour值;在月份字段中,一个星号表示所有可用的month值。 +- **星号 (*)** : 此操作符为字段指定所有可用的值。举个例子,在小时字段中,一个星号等同于每个小时;在月份字段中,一个星号则等同于每月。 -- **逗号 (,)** : 这个操作符指定了一个包含多个值的列表,例如:`1,5,10,15,20, 25`. +- **逗号 (,)** : 这个操作符指定了一个包含多个值的列表,例如:`1,5,10,15,20,25`. -- **横杠 (–)** : 此操作符指定了一个值的范围,例如:`5-15` 天,等同于使用逗号操作符键入的 `5,6,7,8,9,….,13,14,15`。 +- **横杠 (–)** : 此操作符指定了一个值的范围,例如:`5-15` ,等同于使用逗号操作符键入的 `5,6,7,8,9,….,13,14,15`。 -- **分隔符 (/)** : 此操作符指定了一个步进值,例如: `0-23/` 可以用于小时字段来指定命令行每小时执行一次。步进值也可以跟在星号操作符后边,如果你希望命令行每2小时执行一次,可以这样写 `*/2`。 +- **分隔符 (/)** : 此操作符指定了一个步进值,例如: `0-23/` 可以用于小时字段来指定某个命令每小时被执行一次。步进值也可以跟在星号操作符后边,如果你希望命令行每 2 小时执行一次,则可以使用 `*/2`。 +### 使用特殊字符节省时间 -### 如何将邮件显示出来? - -默认情况下,命令行或者脚本的输出内容(如果有的话)会发送到你的本地邮箱账户中。若想停止收到`crontab`发送的邮件,需要添加 `>/dev/null 2>&1` 这段内容,例如: - -``` -0 3 * * * /root/backup.sh >/dev/null 2>&1 -``` - -如果想要将输出内容发送到指定的邮件账户中,你得定义一个MAILTO变量,假设我们要发送至 vivek@nixcraft.in ,代码如下所示: - -``` -MAILTO="vivek@nixcraft.in" -0 3 * * * /root/backup.sh >/dev/null 2>&1 -``` - -访问 “[使用Crontab命令显示邮件提示](http://www.cyberciti.biz/faq/disable-the-mail-alert-by-crontab-command/)” 查看更多信息。 - - -### 任务:列出你所有的定时任务 - -键入以下命令: - -``` -# crontab -l -# crontab -u username -l -``` - -使用如下命令删除所有的定时任务: - -``` -# 删除当前定时任务 # -crontab -r -``` - -``` -## 删除某用户名下的定时任务,此命令需以root用户身份执行 ## -crontab -r -u username -``` - -### 使用特殊字符保存时间 - -你可以使用以下8个特殊字符中的其中一个替代头五个字段。这样不但可以保存时间,也可以提高可读性。 +你可以使用以下 8 个特殊字符中的其中一个替代头五个字段,这样不但可以节省你的时间,还可以提高可读性。 特殊字符 | 含义 |:-- |:-- @reboot | 在每次启动时运行一次 @yearly | 每年运行一次, “0 0 1 1 *”. -@annually | (同 @yearly) -@monthly | 每月运行一次, “0 0 1 * *”. +@annually | (同 @yearly) +@monthly | 每月运行一次, “0 0 1 * *”. @weekly | 每周运行一次, “0 0 * * 0”. @daily | 每天运行一次, “0 0 * * *”. -@midnight | (同 @daily) +@midnight | (同 @daily) @hourly | 每小时运行一次, “0 * * * *”. - 示例: -``` -#### 每小时运行一次 ntpdate #### +#### 每小时运行一次 ntpdate 命令 #### +``` @hourly /path/to/ntpdate ``` +### 关于 `/etc/crontab` 文件和 `/etc/cron.d/*` 目录的更多内容 -### 关于 /etc/crontab file 和 /etc/cron.d/* 目录的更多内容 +** /etc/crontab ** 是系统的 corntabs 文件。通常只被 root 用户或守护进程用于配置系统级别的任务。每个独立的用户必须像上面介绍的那样使用 `corntab` 命令来安装和编辑自己的任务。`/var/spool/cron/` 或者 `/var/cron/tabs/` 目录存放了个人用户的 corntab 文件,它必定会备份在用户的家目录当中。 -/etc/crontab 是系统的 corntabs 文件。通常用于root用户和守护进程配置整个系统的任务。每个独立的用户务必遵照以上的介绍,使用`corntab`命令来编辑自己的任务。/var/spool/cron/ 或者 /var/cron/tabs/ 目录存放了个人用户的 corntab 文件,它必定会备份在用户的home目录当中。 +### 理解默认的 `/etc/crontab` -理解默认的 /etc/crontab - -典型的 /etc/crontab 文件内容: +典型的 `/etc/crontab` 文件内容是这样的: ``` SHELL=/bin/bash @@ -183,19 +137,18 @@ HOME=/ 42 4 1 * * root run-parts /etc/cron.monthly ``` -首先,环境必须定义好。如果shell行被忽略了,corn会使用默认的sh shell。如果PATH变量被忽略,就没有默认路径会被使用,并且所有的文件都需要使用绝对路径来定位。如果HOME被忽略,corn会将调用者(用户)的home目录作为默认值使用。 +首先,环境变量必须被定义。如果 shell 行被忽略,corn 会使用默认的 sh shell。如果 PATH 变量被忽略,就没有默认路径会被使用,所有的文件都需要使用绝对路径来定位。如果 HOME 变量被忽略,corn 会使用调用者(用户)的家目录。 -另外,corn 会在/etc/cron.d/ 目录中读取文件。通常情况下,像 sa-update 或者 sysstat 这样的系统守护进程会将他们的定时任务存放在此处。作为root用户或者超级用户,你可以使用以下目录来配置你的定时任务。你可以直接将脚本放到这里。`run-parts`命令会通过 /etc/crontab 目录来运行脚本或者程序。 +另外,corn 会读取 `/etc/cron.d/`目录中的文件。通常情况下,像 sa-update 或者 sysstat 这样的系统守护进程会将他们的定时任务存放在此处。作为 root 用户或者超级用户,你可以使用以下目录来配置你的定时任务。你可以直接将脚本放到这里。`run-parts`命令会通过 `/etc/crontab` 文件来运行位于某个目录中的脚本或者程序。 -目录 |介绍 +目录 |描述 |:-- |:-- -/etc/cron.d/ | 将所有的脚本文件放在此处,并从 /etc/crontab 文件中调用它们。 -/etc/cron.daily/ | 每天运行的所有的脚本 -/etc/cron.hourly/ | 每小时运行的所有脚本 -/etc/cron.monthly/ | 每月运行的所有脚本 -/etc/cron.weekly/ | 每周运行的所有脚本 +/etc/cron.d/ | 将所有的脚本文件放在此处,并从 /etc/crontab 文件中调用它们。 +/etc/cron.daily/ | 运行需要每天运行一次的脚本 +/etc/cron.hourly/ | 运行需要每小时运行一次的脚本 +/etc/cron.monthly/ | 运行需要每月运行一次的脚本 +/etc/cron.weekly/ | 运行需要每周运行一次的脚本 - ### 备份定时任务 ``` @@ -210,7 +163,7 @@ via: https://www.unixmen.com/add-cron-jobs-linux-unix/?utm_source=feedburner&utm 作者:[Duy NguyenViet][a] 译者:[mr-ping](https://github.com/mr-ping) -校对:[校对者ID](https://github.com/校对者ID) +校对:[FSSlc](https://github.com/FSSlc) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 57c1b76e48969ceafc1f50d797964da79522c550 Mon Sep 17 00:00:00 2001 From: ezio Date: Sun, 26 Jun 2016 19:47:17 +0800 Subject: [PATCH 0980/1469] =?UTF-8?q?=E8=B6=85=E6=9C=9F=E5=9B=9E=E6=94=B6?= =?UTF-8?q?=EF=BC=8C=E5=8F=AF=E4=BB=A5=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...minism and increasing diversity in tech.md | 1 + ...151117 How bad a boss is Linus Torvalds.md | 1 - ...mart Devices Security Concerns and More.md | 1 + ...Driving cars into the future with Linux.md | 108 ------------------ ...ginx as Reverse Proxy on Centos7 CPanel.md | 2 - ...inux developers think of Git and GitHub.md | 2 - ...n IoT Development Suite, is now Zerynth.md | 35 ------ .../20160314 15 podcasts for FOSS fans.md | 1 - sources/tech/20160314 Healthy Open Source.md | 1 - .../tech/20160512 Bitmap in Linux Kernel.md | 1 - ...P 2.0 Support for Nginx on Ubuntu 16.04.md | 2 - 11 files changed, 2 insertions(+), 153 deletions(-) delete mode 100644 sources/talk/20160523 Driving cars into the future with Linux.md delete mode 100644 sources/tech/20160301 Viper, the Python IoT Development Suite, is now Zerynth.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 index 10a30119e1..57faa7998f 100644 --- 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 @@ -1,5 +1,6 @@ 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] diff --git a/sources/talk/20151117 How bad a boss is Linus Torvalds.md b/sources/talk/20151117 How bad a boss is Linus Torvalds.md index 7ebba90483..d593dcf697 100644 --- a/sources/talk/20151117 How bad a boss is Linus Torvalds.md +++ b/sources/talk/20151117 How bad a boss is Linus Torvalds.md @@ -1,4 +1,3 @@ -sonofelice translating How bad a boss is Linus Torvalds? ================================================================================ ![linus torvalds](http://images.techhive.com/images/article/2015/08/linus_torvalds-100600260-primary.idge.jpg) diff --git a/sources/talk/20160506 Linus Torvalds Talks IoT Smart Devices Security Concerns and More.md b/sources/talk/20160506 Linus Torvalds Talks IoT Smart Devices Security Concerns and More.md index e17c33bd81..8744d5d38c 100644 --- a/sources/talk/20160506 Linus Torvalds Talks IoT Smart Devices Security Concerns and More.md +++ b/sources/talk/20160506 Linus Torvalds Talks IoT Smart Devices Security Concerns and More.md @@ -44,3 +44,4 @@ via: https://www.linux.com/news/linus-torvalds-talks-iot-smart-devices-security- [a]: https://www.linux.com/users/ericstephenbrown [0]: http://events.linuxfoundation.org/events/embedded-linux-conference [1]: http://go.linuxfoundation.org/elc-openiot-summit-2016-videos?utm_source=lf&utm_medium=blog&utm_campaign=linuxcom + diff --git a/sources/talk/20160523 Driving cars into the future with Linux.md b/sources/talk/20160523 Driving cars into the future with Linux.md deleted file mode 100644 index 9b9d69d68c..0000000000 --- a/sources/talk/20160523 Driving cars into the future with Linux.md +++ /dev/null @@ -1,108 +0,0 @@ - -驾车通往未来Linux -=========================================== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/open-snow-car-osdc-lead.png?itok=IgYZ6mNY) - - -当我开车的时候不认为和 Linux 有多大联系,但是我肯定我是喜欢一个配备有系统的车子,让我按几个按钮语音就可以传给我的妻子母亲以及孩子。同样,这样的系统可以让我选择是否从云端流媒体收听音乐,卫星广播,以及传统的 AM/FM 收音机。我也会得到天气更新以及可以给我的车载信息娱乐 GPS 找到最快的下一个目的地[In-vehicle infotainment][1],以及 IVI 作为行业知名产业,已经普及到最新的汽车生产商。 - -前段时间,我不得坐飞机飞跃数百英里,租一辆车。令人愉快的是,我发现我的租凭车配置了 IVI 技术。任何时候,我只要通过蓝牙连接,上传联系人到系统中,打电话回家给我的家人,让他们知道我已经安全到家了。然后“主人“会知道我再途中还是已经到他们家了。 - -在最近的 [news roundup][2],Scott Nesbitt 引用一篇文章,说福特汽车公司是由它的开源 [Smart Device Link][3](SDL)中间设备框架,对手汽车制造商,支持那个移动手机获得大量的支持。 SDL 是 [GENIVI Alliance][4] 的项目,一个非营利性的致力于建设中间件支持开源的车载信息娱乐系统。根据文献 [[Steven Crumb][5],GENIVI 执行董事,他们 [membership][6] 很广,包括 Daimler 集团,现代,沃尔沃,日产,本田等等 170 个。 - -为了在同行业中保持竞争力,汽车企业需要一个中间设备系统,可以支持当今消费者提供的各种人机界面技术。无论您拥有 Android,iOS 或其他设备,汽车 OEM 厂商希望自己的系统单位能够支持这些。此外,这些的 IVI 系统必须有足够适应能力以支持移动技术的不断下降,半衰期。 OEM 厂商要提供价值服务,并在他们的 IVI 堆栈支持各种为他们的客户添加选择。进入 Linux 和开源软件。 - -除了 GENIVI 的努力下,[Linux Foundation][7] 赞助 [Automotive Grade Linux][8](AGL)工作组,一个软件基金会,致力于寻找针对汽车应用的开源解决方案。虽然 AGL 初期将侧重于 IVI 系统,他们展望不同的分歧,包括 [telematics][9],小心显示器和其他控制系统。 AGL 有超过 50 名成员在这个时候,包括捷豹,丰田,日产,并在 [recent press release][10] 宣布福特、马自达、三菱、和斯巴鲁加入。 - - -为了了解更多信息,我们在这一新鲜兴领域采访了两位领导人。明确地来说,我们想知道是如何被使用的 Linux 和开源软件,如果它们实际上是改变汽车行业的面貌。首先,我们谈谈 [Alison Chaiken][11],在大集团技术的软件工程师和汽车 Linux 专家,网络安全和透明度。她曾任职于 [Alison Chaiken][11] 公司,诺基亚和斯坦福直线性加速器。然后我们用 [Steven Crumb][12],GENIVI 执行董事,谁得到了在开源环境高性能计算(超级计算机和早期的云计算)开始聊天。他说,虽然他再不是一个程序员了,但是他喜欢帮助企业解决开源软件的实际业务问题。 - -### 采访 Alison Chaiken (by [Deb Nicholson][13]) - -#### 你是如何开始对汽车软件空间感兴趣的? - -我是在诺基亚手机产品时, 2009 年该项目被取消。我想,下一步是什么?一位同事正在对 [MeeGo-IVI][15],早期的汽车 Linux 发行版。 “Linux 在汽车是大了,” 我想,所以我在朝着这个方向努力。 - -#### 你能告诉我们你这些日子工作在哪些方面? - -我目前正在启动为使用 Linux 系统增加大货车钻机的安全性和燃油经济性的先进巡航控制。我喜欢在这方面的工作,因为没有人会反对卡车得以提升。 - -#### 目前关于汽车已在近年来砍死几个人故事。开源代码方案可以帮助解决这个问题吗? - -I presented a talk on precisely this topic, on how Linux can (and cannot) contribute to security solutions in automotive at Southern California Linux Expo 2016 ([Slides][16]). Notably, GENIVI and Automotive Grade Linux have published their code and both projects take patches via Git. Please send your fixes upstream! Many eyes make all bugs shallow. -我提出的谈话正是这一主题,就如何 Linux 可以(或不可以)在南加州 2016 年世博会作出贡献的安全解决方案的 Linux汽车([Slides][16])。值得注意的是,GENIVI 和汽车级 Linux 已经公布了他们的代码,这两个项目的 Git 通过采取补丁。请上游发送您的修复!许多眼睛都盯着肤浅的bugs。 - -#### 执法机构和保险公司可以找到很多有关数据用途的驱动程序。它将如何容易成为他们获取这些信息? - -好问题。该专用短程通信标准(IEEE-1609),以保持匿名的 Wi-Fi 安全消息驱动程序。不过,如果你从你的车张贴到 Twitter,有人能够跟踪你。 - -#### 有什么可以开发人员和公民个人一起完成,以确保公民自由受到保护作为汽车技术发展的? - -电子前沿基金会(EFF)一样对汽车保持的问题上,通过什么样的数据可以存储在汽车 “黑盒子”,并在 DMCA 的规定 1201 如何应用于汽车官方渠道评论已经出色的工作了。 - -#### 在未来几年令人兴奋的事情上,那些是你看到的驱动因素? - -自适应巡航控制和防撞系统有足够的预付款来挽救生命。当他们通过运输车队的推出,我真的相信死亡人数会下降。如果这还不是令人兴奋的,我不知道是什么。此外,像自动化停车辅助功能,将会使汽车更容易驾驶,减少汽车相撞事故。 - -#### 有什么是需要人参与以及如何建造? - -汽车 Linux 级开发是开放源代码的,运行在廉价硬件(如树莓派 Pi 2 和中等价位的 Renesas Porter board),任何人都可以购买。 GENIVI 汽车 Linux 的中间设备联盟有很多软件通过 Git 的公开。此外,还有很酷的 [OSVehicle open hardware][17] 汽车平台。 - -#### 这里是 Linux 软件和开放硬件,许多方面具有中等人数预算的参与。如果您有任何疑问,加入我们在 Freenode 上 IRC#automotive。 - -### 采访 Steven Crumb (by Don Watkins) - -#### 关于GENIVI's 对 IVI 为什么那么大 ? - -GENIVI 率先通过使用自由和开源软件,包括 Linux,像车载信息娱乐(IVI)系统的非安全关键汽车软件填补了汽车行业的巨大差距。作为消费者来到期望在他们的车辆相同的功能在智能手机上的软件,以支持 IVI 功能所需的量成倍增长。软件增加量也增加了建设 IVI 系统的成本,从而延缓了上市时间。 - -GENIVI 的使用开源软件和社区发展模式节省了汽车制造商和他们的软件提供商显著大量的资金,而显著减少了产品上市时间。我很兴奋,因为 GENIVI 我们很幸运慢慢从高度结构化和专有的方法来社区为基础的方法不断发展的组织​​领导排序在汽车行业的一场革命。我们还没有完成,但它一直是一个荣幸参加正在产生实实在在的好处的转换。 - -#### 你的庞大会员怎么才可以驱动 GENIVI 方向? - -GENIVI 有很多会员和非会员促进我们的工作。与许多开源项目,任何公司都可以通过简单地贡献代码,修补程序和时间来检验影响的技术输出。随着中说,宝马,奔驰,现代汽车,捷豹路虎,标致雪铁龙,雷诺 / 日产和沃尔沃是所有积极采用者和贡献者 GENIVI 和其他许多 OEM 厂商已经在他们的汽车 IVI 解决方案,广泛使用 GENIVI 的软件。 - -#### 贡献的代码使用了什么许可证? - -GENIVI 采用数量的许可证从(L)GPLv2 许可,以 MPLv2 到 Apache2.0。我们的一些工具使用 Eclipse 许可证。我们有一个[public licensing policy][18],详细说明我们的许可偏好。 - -#### 一个人或一群人如何参与其中?重要的是如何对项目的持续成功的社区贡献? - -GENIVI 完全做它开放发展的在([projects.genivi.org][19]),因此,有兴趣的人在汽车使用开源软件,欢迎参加。这就是说,该联盟能够通过公司 [joining GENIVI][20] 作为成员不断发展的开放基金。 GENIVI 会员享受各种各样的福利,而不是其中最重要的是在已经发展了近六年来 140 家公司全球社区参与。 - -社区是 GENIVI 非常重要的,我们不可能生产和维护我们发展了很多年没有贡献者一个活跃的社区有价值的软件。我们努力做出贡献 GENIVI 简单,只要加入一个 [邮件列表] [21] 并连接到人们在不同的软件项目。我们使用许多开源项目采用的标准做法,并提供高质量的工具和基础设施,以帮助开发人员有宾至如归的感觉,并富有成效。 - -无论在汽车软件某人的熟悉,欢迎他们加入我们的社区。人们已经改装车多年,所以对于许多人来说,是一种天然的抽奖,任何汽车。软件是汽车的新域,GENIVI 希望成为敞开的门有兴趣的人与汽车,开源软件的工作。 - -------------------------------- -via: https://opensource.com/business/16/5/interview-alison-chaiken-steven-crumb - -作者:[Don Watkins][a] -译者:[erlinux](https://github.com/erlinux) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/don-watkins -[1]: https://en.wikipedia.org/wiki/In_car_entertainment -[2]: https://opensource.com/life/16/1/weekly-news-jan-9 -[3]: http://projects.genivi.org/smartdevicelink/home -[4]: http://www.genivi.org/ -[5]: https://www.linkedin.com/in/stevecrumb -[6]: http://www.genivi.org/genivi-members -[7]: http://www.linuxfoundation.org/ -[8]: https://www.automotivelinux.org/ -[9]: https://en.wikipedia.org/wiki/Telematics -[10]: https://www.automotivelinux.org/news/announcement/2016/01/ford-mazda-mitsubishi-motors-and-subaru-join-linux-foundation-and -[11]: https://www.linkedin.com/in/alison-chaiken-3ba456b3 -[12]: https://www.linkedin.com/in/stevecrumb -[13]: https://opensource.com/users/eximious -[14]: https://en.wikipedia.org/wiki/MeeGo -[15]: http://webinos.org/deliverable-d026-target-platform-requirements-and-ipr/automotive/ -[16]: http://she-devel.com/Chaiken_automotive_cybersecurity.pdf -[17]: https://www.osvehicle.com/ -[18]: http://projects.genivi.org/how -[19]: http://projects.genivi.org/ -[20]: http://genivi.org/join -[21]: http://lists.genivi.org/mailman/listinfo/genivi-projects diff --git a/sources/tech/20160218 How to Set Nginx as Reverse Proxy on Centos7 CPanel.md b/sources/tech/20160218 How to Set Nginx as Reverse Proxy on Centos7 CPanel.md index dc21bc0b23..ba986b25b3 100644 --- a/sources/tech/20160218 How to Set Nginx as Reverse Proxy on Centos7 CPanel.md +++ b/sources/tech/20160218 How to Set Nginx as Reverse Proxy on Centos7 CPanel.md @@ -1,5 +1,3 @@ -zky001开始翻译 - How to Set Nginx as Reverse Proxy on Centos7 CPanel ================================================================================ diff --git a/sources/tech/20160218 What do Linux developers think of Git and GitHub.md b/sources/tech/20160218 What do Linux developers think of Git and GitHub.md index b444b0958c..9002025820 100644 --- a/sources/tech/20160218 What do Linux developers think of Git and GitHub.md +++ b/sources/tech/20160218 What do Linux developers think of Git and GitHub.md @@ -1,5 +1,3 @@ -@4357 翻译中 - What do Linux developers think of Git and GitHub? ===================================================== diff --git a/sources/tech/20160301 Viper, the Python IoT Development Suite, is now Zerynth.md b/sources/tech/20160301 Viper, the Python IoT Development Suite, is now Zerynth.md deleted file mode 100644 index f732382bc6..0000000000 --- a/sources/tech/20160301 Viper, the Python IoT Development Suite, is now Zerynth.md +++ /dev/null @@ -1,35 +0,0 @@ -(翻译中 by runningwater) -Viper, the Python IoT Development Suite, is now Zerynth -============================================================ - - -![](http://www.open-electronics.org/wp-content/uploads/2016/02/Logo_Zerynth-636x144.png) - - -The startup that launched the tools to develop embedded solutions in Python language announced the brand change along with the first official release. - ->Exactly one year after the Kickstarter launch of the suite for developing Internet of Things solutions in Python language, **Viper becomes Zerynth**. It is definitely a big day for the startup that created a radically new way to approach the world of microcontrollers and connected devices, making professionals and makers able to design interactive solutions with reduced efforts and shorter time. - ->“We really believe in the uniqueness of our tools, this is why they deserve an adequate recognition. Viper was a great name for a product, but other notable companies had the same feeling many decades ago, with the result that this term was shared with too many other actors out there. We are grown now, and ready to take off fast and light, like the design processes that our tools are enabling”, says the Viper (now Zerynth), co-founders. - ->**Thousands of users** developed amazing connected solutions in just 9 months of life in Beta version. Built to be cross-platform, Zerynth’s tools are meant for high-level design of Internet/cloud-connected devices, interactive objects, artistic installations. They are: **Zerynth Studio**, a browser-based IDE for programming embedded devices in Python with cloud sync and board management features; **Zerynth Virtual Machine**: a multithreaded real-time OS that provides real hardware independence allowing code reuse on the entire ARM architecture; **Zerynth App**, a general purpose interface that turns any mobile into the controller and display for smart objects and IoT systems. - ->This modular set of tools, adaptable to different hardware and cloud infrastructures, can dramatically reduce the time to market and the overall development costs for makers, professionals and companies. - ->Now Zerynth celebrates its new name launching the **first official release** of the toolkit. Check it here [www.zerynth.com][1] - -![](http://www.open-electronics.org/wp-content/uploads/2016/02/Zerynth-Press-Release_Studio-Img-768x432.png) - --------------------------------------------------------------------------------- - -via: http://www.open-electronics.org/viper-the-python-iot-development-suite-is-now-zerynth/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+OpenElectronics+%28Open+Electronics%29 - -作者:[Staff ][a] -译者:[runningwater](https://github.com/runningwater) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.open-electronics.org/author/staff/ -[1]: http://www.zerynth.com/ - diff --git a/sources/tech/20160314 15 podcasts for FOSS fans.md b/sources/tech/20160314 15 podcasts for FOSS fans.md index eae53102ad..222861427e 100644 --- a/sources/tech/20160314 15 podcasts for FOSS fans.md +++ b/sources/tech/20160314 15 podcasts for FOSS fans.md @@ -1,4 +1,3 @@ -zpl1025 15 podcasts for FOSS fans ============================= diff --git a/sources/tech/20160314 Healthy Open Source.md b/sources/tech/20160314 Healthy Open Source.md index 57dd559284..b36b516758 100644 --- a/sources/tech/20160314 Healthy Open Source.md +++ b/sources/tech/20160314 Healthy Open Source.md @@ -1,4 +1,3 @@ -Translating by yuba0604 Healthy Open Source ============================ diff --git a/sources/tech/20160512 Bitmap in Linux Kernel.md b/sources/tech/20160512 Bitmap in Linux Kernel.md index 06297fa204..b7e832ba0a 100644 --- a/sources/tech/20160512 Bitmap in Linux Kernel.md +++ b/sources/tech/20160512 Bitmap in Linux Kernel.md @@ -1,4 +1,3 @@ -[Translating By cposture 20160520] Data Structures in the Linux Kernel ================================================================================ diff --git a/sources/tech/20160530 Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md b/sources/tech/20160530 Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md index ef713fff0f..e6b143cc00 100644 --- a/sources/tech/20160530 Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md +++ b/sources/tech/20160530 Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md @@ -1,5 +1,3 @@ -Translating by strugglingyouth - Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04 ===================================================================================== From 440139b97139a05fdfa1c6cdea68a7b1b7ed1886 Mon Sep 17 00:00:00 2001 From: ezio Date: Sun, 26 Jun 2016 19:49:08 +0800 Subject: [PATCH 0981/1469] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=B8=8D=E7=94=A8?= =?UTF-8?q?=E7=9A=84=E6=96=87=E4=BB=B6=E5=A4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/news/README.md | 1 - sources/share/README.md | 1 - translated/news/README.md | 1 - translated/share/README.md | 1 - 4 files changed, 4 deletions(-) delete mode 100644 sources/news/README.md delete mode 100644 sources/share/README.md delete mode 100644 translated/news/README.md delete mode 100644 translated/share/README.md diff --git a/sources/news/README.md b/sources/news/README.md deleted file mode 100644 index 98d53847b1..0000000000 --- a/sources/news/README.md +++ /dev/null @@ -1 +0,0 @@ -这里放新闻类文章,要求时效性 diff --git a/sources/share/README.md b/sources/share/README.md deleted file mode 100644 index e5e225858e..0000000000 --- a/sources/share/README.md +++ /dev/null @@ -1 +0,0 @@ -这里放分享类文章,包括各种软件的简单介绍、有用的书籍和网站等。 diff --git a/translated/news/README.md b/translated/news/README.md deleted file mode 100644 index 98d53847b1..0000000000 --- a/translated/news/README.md +++ /dev/null @@ -1 +0,0 @@ -这里放新闻类文章,要求时效性 diff --git a/translated/share/README.md b/translated/share/README.md deleted file mode 100644 index e5e225858e..0000000000 --- a/translated/share/README.md +++ /dev/null @@ -1 +0,0 @@ -这里放分享类文章,包括各种软件的简单介绍、有用的书籍和网站等。 From be96e7a42a34337abd5162996ccb71031478a3f7 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 26 Jun 2016 22:24:08 +0800 Subject: [PATCH 0982/1469] =?UTF-8?q?20160226-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...621 Building Serverless App with Docker.md | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 sources/tech/20160621 Building Serverless App with Docker.md diff --git a/sources/tech/20160621 Building Serverless App with Docker.md b/sources/tech/20160621 Building Serverless App with Docker.md new file mode 100644 index 0000000000..9791ee5aa6 --- /dev/null +++ b/sources/tech/20160621 Building Serverless App with Docker.md @@ -0,0 +1,99 @@ +BUILDING SERVERLESS APPS WITH DOCKER +====================================== + +Every now and then, there are waves of technology that threaten to make the previous generation of technology obsolete. There has been a lot of talk about a technique called “serverless” for writing apps. The idea is to deploy your application as a series of functions, which are called on-demand when they need to be run. You don’t need to worry about managing servers, and these functions scale as much as you need, because they are called on-demand and run on a cluster. + +But serverless doesn’t mean there is no Docker – in fact, Docker is serverless. You can use Docker to containerize these functions, then run them on-demand on a Swarm. Serverless is a technique for building distributed apps and Docker is the perfect platform for building them on. + +### From servers to serverless + +So how might we write applications like this? Let’s take our example [a voting application consisting of 5 services][1]: + +![](https://blog.docker.com/wp-content/uploads/Picture1.png) + +This consists of: + +- Two web frontends +- A worker for processing votes in the background +- A message queue for processing votes +- A database + +The background processing of votes is a very easy target for conversion to a serverless architecture. In the voting app, we can run a bit of code like this to run the background task: + +``` +import dockerrun +client = dockerrun.from_env() +client.run("bfirsh/serverless-record-vote-task", [voter_id, vote], detach=True) +``` + +The worker and message queue can be replaced with a Docker container that is run on-demand on a Swarm, automatically scaling to demand. + +We can even eliminate the web frontends. We can replace them with Docker containers that serve up a single HTTP request, triggered by a lightweight HTTP server that spins up Docker containers for each HTTP request. The heavy lifting has now moved the long-running HTTP server to Docker containers that run on-demand, so they can automatically scale to handle load. + +Our new architecture looks something like this: + +![](https://blog.docker.com/wp-content/uploads/Picture2.png) + +The red blocks are the continually running services and the green blocks are Docker containers that are run on-demand. This application has fewer long-running services that need managing, and by its very nature scales up automatically in response to demand (up to the size of your Swarm!). + +### So what can we do with this? + +There are three useful techniques here which you can use in your apps: + +1. Run functions in your code as on-demand Docker containers +2. Use a Swarm to run these on a cluster +3. Run containers from containers, by passing a Docker API socket + + +With the combination of these techniques, this opens up loads of possibilities about how you can architect your applications. Running background work is a great example of something that works well, but a whole load of other things are possible too, for example: + +- Launching a container to serve user-facing HTTP requests is probably not practical due to the latency. However – you could write a load balancer which knew how to auto-scale its own web frontends by running containers on a Swarm. +- A MongoDB container which could introspect the structure of a Swarm and launch the correct shards and replicas. + +### What’s next + +We’ve got all these radically new tools and abstractions for building apps, and we’ve barely scratched the surface of what is possible with them. We’re still building applications like we have servers that stick around for a long time, not for the future where we have Swarms that can run code on-demand anywhere in your infrastructure. + +This hopefully gives you some ideas about what you can build, but we also need your help. We have all the fundamentals to be able to start building these applications, but its still in its infrancy – we need better tooling, libraries, example apps, documentation, and so on. + +[This GitHub repository has links off to tools, libraries, examples, and blog posts][3]. Head over there if you want to learn more, and please contribute any links you have there so we can start working together on this. + +Get involved, and happy hacking! + +### Learn More about Docker + +- New to Docker? Try our 10 min [online tutorial][4] +- Share images, automate builds, and more with [a free Docker Hub account][5] +- Read the Docker [1.12 Release Notes][6] +- Subscribe to [Docker Weekly][7] +- Sign up for upcoming [Docker Online Meetups][8] +- Attend upcoming [Docker Meetups][9] +- Watch [DockerCon EU 2015 videos][10] +- Start [contributing to Docker][11] + + +-------------------------------------------------------------------------------- + +via: https://blog.docker.com/2016/06/building-serverless-apps-with-docker/ + +作者:[Ben Firshman][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://blog.docker.com/author/bfirshman/ + +[1]: https://github.com/docker/example-voting-app +[3]: https://github.com/bfirsh/serverless-docker +[4]: https://docs.docker.com/engine/understanding-docker/ +[5]: https://hub.docker.com/ +[6]: https://docs.docker.com/release-notes/ +[7]: https://www.docker.com/subscribe_newsletter/ +[8]: http://www.meetup.com/Docker-Online-Meetup/ +[9]: https://www.docker.com/community/meetup-groups +[10]: https://www.youtube.com/playlist?list=PLkA60AVN3hh87OoVra6MHf2L4UR9xwJkv +[11]: https://docs.docker.com/contributing/contributing/ + + + From 7b59b637e3c1e67f4854d2ac9998996712db988a Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 26 Jun 2016 22:39:10 +0800 Subject: [PATCH 0983/1469] =?UTF-8?q?20160626-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...tacenter in AWS and Azure in Few Clicks.md | 138 ++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 sources/tech/20160621 Docker Datacenter in AWS and Azure in Few Clicks.md diff --git a/sources/tech/20160621 Docker Datacenter in AWS and Azure in Few Clicks.md b/sources/tech/20160621 Docker Datacenter in AWS and Azure in Few Clicks.md new file mode 100644 index 0000000000..aa4a317103 --- /dev/null +++ b/sources/tech/20160621 Docker Datacenter in AWS and Azure in Few Clicks.md @@ -0,0 +1,138 @@ +DOCKER DATACENTER IN AWS AND AZURE IN A FEW CLICKS +==================================================== + +Introducing Docker Datacenter AWS Quickstart and Azure Marketplace Templates production-ready, high availability deployments in just a few clicks. + +The Docker Datacenter AWS Quickstart uses a CloudFormation templates and pre-built templates on Azure Marketplace to make it easier than ever to deploy an enterprise CaaS Docker environment on public cloud infrastructures. + +The Docker Datacenter Container as a Service (CaaS) platform for agile application development provides container and cluster orchestration and management that is simple, secure and scalable for enterprises of any size. With our new cloud templates pre-built for Docker Datacenter, developers and IT operations can frictionlessly move dockerized applications to an Amazon EC2 or Microsoft Azure environment without any code changes. Now businesses can quickly realize greater efficiency of computing and operations resources and Docker supported container management and orchestration in just a few steps. + +### What is Docker Datacenter? + +Docker Datacenter includes Docker Universal Control Plane, Docker Trusted Registry (DTR), CS Docker Engine with commercial support & subscription to align to your application SLAs: + +- Docker Universal Control Plane (UCP), an enterprise-grade cluster management solution that helps you manage your whole cluster from a single pane of glass +- Docker Trusted Registry (DTR), an image storage solution that helps securely store and manage the Docker images. +- Commercially Supported (CS) Docker Engines + +![](http://img.scoop.it/lVraAJgJbjAKqfWCLtLuZLnTzqrqzN7Y9aBZTaXoQ8Q=) + +### Deploy on AWS in a single click with the Docker Datacenter AWS Quick Start + +With AWS Quick Start reference deployments you can rapidly deploy Docker containers on the AWS cloud, adhering to Docker and AWS best practices. The Docker Datacenter Quick Start uses CloudFormation templates that are modular and customizable so you can layer additional functionality on top or modify them for your own Docker deployments. + +[Docker Datacenter for AWS Quickstart](https://youtu.be/aUx7ZdFSkXU) + +#### Architecture + +![](http://img.scoop.it/sZ3_TxLba42QB-r_6vuApLnTzqrqzN7Y9aBZTaXoQ8Q=) + +The AWS Cloudformation starts the installation process by creating all the required AWS resources such as the VPC, security groups, public and private subnets, internet gateways, NAT gateways, and S3 bucket. + +It then launches the first UCP controller instances and goes through the installation process of Docker engine and UCP containers. It backs the Root CAs created by the first UCP controllers to S3. Once the first UCP controller is up and running, the process of creating the other UCP controllers, the UCP cluster nodes, and the first DTR replica is triggered. Similar to the first UCP controller node, all other nodes are started by installing Docker Commercially Supported engine, followed by running the UCP and DTR containers to join the cluster. Two ELBs, one for UCP and one for DTR, are launched and automatically configured to provide resilient load balancing across the two AZs. + +Additionally, UCP controllers and nodes are launched in an ASG to provide scaling functionality if needed. This architecture ensures that both UCP and DTR instances are spread across both AZs to ensure resiliency and high-availability. Route53 is used to dynamically register and configure UCP and DTR in your private or public HostedZone. + +![](http://img.scoop.it/HM7Ag6RFvMXvZ_iBxRgKo7nTzqrqzN7Y9aBZTaXoQ8Q=) + +### Key functionality of this Quickstart templates includes the following: + +- Creates a New VPC, Private and Public Subnets in different AZs, ELBs, NAT Gateways, Internet Gateways, AutoScaling Groups- all based on AWS best practices +- Creates an S3 bucket for DDC to be used for cert backup and DTR image storage ( requires additional configuration in DTR ) +- Deploys 3 UCP Controllers across multiple AZs within your VPC +- Creates a UCP ELB with preconfigured health checks +- Creates a DNS record and attaches it to UCP ELB +- Deploys a scalable cluster of UCP nodes +- Backs up UCP Root CAs to S3 +- Create a 3 DTR Replicas across multiple AZs within your VPC +- Creates a DTR with preconfigured health checks +- Creates a DNS record and attaches it to DTR ELB + +[Download the AWS Quick Start Guide to Learn More](https://s3.amazonaws.com/quickstart-reference/docker/latest/doc/docker-datacenter-on-the-aws-cloud.pdf) + +### Getting Started with Docker Datacenter for AWS + +1. Go to [Docker Store][1] to get your [30 day free trial][2] or [contact sales][4]. +2. At confirmation, you’ll be prompted to “Launch Stack” and you’ll be directed to the AWS Cloudformation portal. +3. Confirm your AWS Region that you’d like to launch this stack in +4. Provide the required parameters +5. Confirm and Launch. +6. Once complete, click on outputs tab to see the URLs of UCP/DTR, default username, and password, and S3 bucket name. + +[Request up to $2000 AWS credit for Docker Datacenter](https://aws.amazon.com/mp/contactdocker/) + +### Deploy on Azure with pre-built templates on Azure Marketplace + +Docker Datacenter is available as pre-built template on Azure Marketplace for you to run instantly on Azure across various datacenters globally. Customers can choose to deploy Docker Datacenter from various VM choices offered on Azure as it fits their needs. + +#### Architecture + +![](http://img.scoop.it/V9SpuBCoAnUnkRL3J-FRFLnTzqrqzN7Y9aBZTaXoQ8Q=) + +The Azure deployment process begins by entering some basic information about the user including, the admin username for ssh-ing into all the nodes (OS level admin user) and the name of the resource group. You can think of the resource group as a collection of resources that has a lifecycle and deployment boundary. You can read more about resource groups here: + +Next you will enter the details of the cluster, including: VM size for UCP controllers, Number of Controllers (default is 3), VM size for UCP nodes, Number of UCP nodes (default is 1, max of 10), VM size for DTR nodes, Number of DTR nodes (default is 3), Virtual Network Name and Address (ex. 10.0.0.1/19). Regarding networking, you will have 2 subnets: the first subnet is for the UCP controller nodes and the second subnet is for the DTR and UCP nodes. + +Lastly you will click OK to complete deployment. Provisioning should take about 15-19 minutes for small clusters with a few additional minutes for larger ones. + +![](http://img.scoop.it/DXPM5-GXP0j2kEhno0kdRLnTzqrqzN7Y9aBZTaXoQ8Q=) + +![](http://img.scoop.it/321ElkCf6rqb7u_-nlGPtrnTzqrqzN7Y9aBZTaXoQ8Q=) + +#### How to Deploy in Azure + +1. Register for [a 30 day free trial][5] license of Docker Datacenter or [contact sales][6]. +2. [Go to Docker Datacenter on the Microsoft Azure Marketplace][7] +3. [Review Deployment Documents][8] + +Get Started by registering for a Docker Datacenter license and you’ll be prompted with the ability to launch either the AWS or Azure templates. + +- [Get a 30 day trial license][9] +- [Understand Docker Datacenter architecture with this video][10] +- [Watch demo videos][11] +- [Get $75 AWS credit torwards your deployment][12] + +### Learn More about Docker + +- New to Docker? Try our 10 min [online tutorial][20] +- Share images, automate builds, and more with [a free Docker Hub account][21] +- Read the Docker [1.12 Release Notes][22] +- Subscribe to [Docker Weekly][23] +- Sign up for upcoming [Docker Online Meetups][24] +- Attend upcoming [Docker Meetups][25] +- Watch [DockerCon EU 2015 videos][26] +- Start [contributing to Docker][27] + + + +-------------------------------------------------------------------------------- + +via: https://blog.docker.com/2016/06/docker-datacenter-aws-azure-cloud/ + +作者:[Trisha McCanna][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://blog.docker.com/author/trisha/ +[1]: https://store.docker.com/login?next=%2Fbundles%2Fdocker-datacenter%2Fpurchase?plan=free-trial +[2]: https://store.docker.com/login?next=%2Fbundles%2Fdocker-datacenter%2Fpurchase?plan=free-trial +[4]: https://goto.docker.com/contact-us.html +[5]: https://store.docker.com/login?next=%2Fbundles%2Fdocker-datacenter%2Fpurchase?plan=free-trial +[6]: https://goto.docker.com/contact-us.html +[7]: https://azure.microsoft.com/en-us/marketplace/partners/docker/dockerdatacenterdocker-datacenter/ +[8]: https://success.docker.com/Datacenter/Apply/Docker_Datacenter_on_Azure +[9]: http://www.docker.com/trial +[10]: https://www.youtube.com/playlist?list=PLkA60AVN3hh8tFH7xzI5Y-vP48wUiuXfH +[11]: https://www.youtube.com/playlist?list=PLkA60AVN3hh8a8JaIOA5Q757KiqEjPKWr +[12]: https://aws.amazon.com/quickstart/promo/ +[20]: https://docs.docker.com/engine/understanding-docker/ +[21]: https://hub.docker.com/ +[22]: https://docs.docker.com/release-notes/ +[23]: https://www.docker.com/subscribe_newsletter/ +[24]: http://www.meetup.com/Docker-Online-Meetup/ +[25]: https://www.docker.com/community/meetup-groups +[26]: https://www.youtube.com/playlist?list=PLkA60AVN3hh87OoVra6MHf2L4UR9xwJkv +[27]: https://docs.docker.com/contributing/contributing/ + From 5f2eddc889610745744c365fdb7b83b113ec1ddf Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 26 Jun 2016 22:46:37 +0800 Subject: [PATCH 0984/1469] =?UTF-8?q?20160626-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...manently mount a Windows share on Linux.md | 125 ++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 sources/tech/20160624 How to permanently mount a Windows share on Linux.md diff --git a/sources/tech/20160624 How to permanently mount a Windows share on Linux.md b/sources/tech/20160624 How to permanently mount a Windows share on Linux.md new file mode 100644 index 0000000000..015bf5f231 --- /dev/null +++ b/sources/tech/20160624 How to permanently mount a Windows share on Linux.md @@ -0,0 +1,125 @@ +How to permanently mount a Windows share on Linux +================================================== + +>If you get tired of having to remount Windows shares when you reboot your Linux box, read about an easy way to make those shares permanently mount. + +![](http://tr2.cbsistatic.com/hub/i/2016/06/02/e965310b-b38d-43e6-9eac-ea520992138b/68fd9ec5d6731cc405bdd27f2f42848d/linuxadminhero.jpg) +>Image: Jack Wallen + +It has never been easier for Linux to interact within a Windows network. And considering how many businesses are adopting Linux, those two platforms have to play well together. Fortunately, with the help of a few tools, you can easily map Windows network drives onto a Linux machine, and even ensure they are still there upon rebooting the Linux machine. + +### Before we get started + +For this to work, you will be using the command line. The process is pretty simple, but you will be editing the /etc/fstab file, so do use caution. +Also, I assume you already have Samba working properly so you can manually mount shares from a Windows network to your Linux box, and that you know the IP address of the machine hosting the share. + +Are you ready? Let's go. + +### Create your mount point + +The first thing we're going to do is create a folder that will serve as the mount point for the share. For the sake of simplicity, we'll name this folder share and we'll place it in /media. Open your terminal window and issue the command: + +``` +sudo mkdir /media/share +``` + +### A few installations + +Now we have to install the system that allows for cross-platform file sharing; this system is cifs-utils. From the terminal window, issue the command: + +``` +sudo apt-get install cifs-utils +``` + +This command will also install all of the dependencies for cifs-utils. + +Once this is installed, open up the file /etc/nsswitch.conf and look for the line: + +``` +hosts: files mdns4_minimal [NOTFOUND=return] dns +``` + +Edit that line so it looks like: + +``` +hosts: files mdns4_minimal [NOTFOUND=return] wins dns +``` + +Now you must install windbind so that your Linux machine can resolve Windows computer names on a DHCP network. From the terminal, issue this command: + +``` +sudo apt-get install libnss-windbind windbind +``` + +Restart networking with the command: + +``` +sudo service networking restart +``` + +### Mount the network drive + +Now we're going to map the network drive. This is where we must edit the /etc/fstab file. Before you make that first edit, back up the file with this command: + +``` +sudo cp /etc/fstab /etc/fstab.old +``` + +If you need to restore that file, issue the command: + +``` +sudo mv /etc/fstab.old /etc/fstab +``` + +Create a credentials file in your home directory called .smbcredentials. In that file, add your username and password, like so (USER is the actual username and password is the actual password): + +``` +username=USER + +password=PASSWORD +``` + +You now have to know the Group ID (GID) and User ID (UID) of the user that will be mounting the drive. Issue the command: + +``` +id USER +``` + +USER is the actual username, and you should see something like: + +``` +uid=1000(USER) gid=1000(GROUP) +``` + +USER is the actual username, and GROUP is the group name. The numbers before (USER) and (GROUP) will be used in the /etc/fstab file. + +It's time to edit the /etc/fstab file. Open that file in your editor and add the following line to the end (replace everything in ALL CAPS and the IP address of the remote machine): + +``` +//192.168.1.10/SHARE /media/share cifs credentials=/home/USER/.smbcredentials,iocharset=uft8,gid=GID,udi=UID,file_mode=0777,dir_mode=0777 0 0 +``` + +**Note**: The above should be on a single line. + +Save and close that file. Issue the command sudo mount -a and the share will be mounted. Check in /media/share and you should see the files and folders on the network share. + +### Sharing made easy + +Thanks to cifs-utils and Samba, mapping network shares is incredibly easy on a Linux machine. And now, you won't have to manually remount those shares every time your machine boots. + +For more networking tips and tricks, sign up for our Data Center newsletter. +[SUBSCRIBE](https://secure.techrepublic.com/user/login/?regSource=newsletter-button&position=newsletter-button&appId=true&redirectUrl=http%3A%2F%2Fwww.techrepublic.com%2Farticle%2Fhow-to-permanently-mount-a-windows-share-on-linux%2F&) + +-------------------------------------------------------------------------------- + +via: http://www.techrepublic.com/article/how-to-permanently-mount-a-windows-share-on-linux/ + +作者:[Jack Wallen][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.techrepublic.com/search/?a=jack+wallen + + From 29330c4379929666ac3d2fc1840ecd87bb833c97 Mon Sep 17 00:00:00 2001 From: Rubik Date: Sun, 26 Jun 2016 22:49:55 +0800 Subject: [PATCH 0985/1469] =?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 已将文件移动至trasnlated/tech/下。 多谢指正。 --- .../tech/20160616 6 Amazing Linux Distributions For Kids.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20160616 6 Amazing Linux Distributions For Kids.md (100%) diff --git a/sources/tech/20160616 6 Amazing Linux Distributions For Kids.md b/translated/tech/20160616 6 Amazing Linux Distributions For Kids.md similarity index 100% rename from sources/tech/20160616 6 Amazing Linux Distributions For Kids.md rename to translated/tech/20160616 6 Amazing Linux Distributions For Kids.md From 825307798075d686f763aac759a72ce1cb922f12 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 26 Jun 2016 22:56:30 +0800 Subject: [PATCH 0986/1469] =?UTF-8?q?20160626-4=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...g may prevent the demise of Moore's Law.md | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 sources/techmd20160604 Microfluidic cooling may prevent the demise of Moore's Law.md diff --git a/sources/techmd20160604 Microfluidic cooling may prevent the demise of Moore's Law.md b/sources/techmd20160604 Microfluidic cooling may prevent the demise of Moore's Law.md new file mode 100644 index 0000000000..66548921e2 --- /dev/null +++ b/sources/techmd20160604 Microfluidic cooling may prevent the demise of Moore's Law.md @@ -0,0 +1,67 @@ +Microfluidic cooling may prevent the demise of Moore's Law +============================================================ + +![](http://tr1.cbsistatic.com/hub/i/r/2015/12/09/a7cb82d1-96e8-43b5-bfbd-d4593869b230/resize/620x/9607388a284e3a61a39f4399a9202bd7/networkingistock000042544852agsandrew.jpg) +>Image: iStock/agsandrew + +Existing technology's inability to keep microchips cool is fast becoming the number one reason why [Moore's Law][1] may soon meet its demise. + +In the ongoing need for digital speed, scientists and engineers are working hard to squeeze more transistors and support circuitry onto an already-crowded piece of silicon. However, as complex as that seems, it pales in comparison to the [problem of heat buildup][2]. + +"Right now, we're limited in the power we can put into microchips," says John Ditri, principal investigator at Lockheed Martin in [this press release][3]. "One of the biggest challenges is managing the heat. If you can manage the heat, you can use fewer chips, and that means using less material, which results in cost savings as well as reduced system size and weight. If you manage the heat and use the same number of chips, you'll get even greater performance in your system." + +Resistance to the flow of electrons through silicon causes the heat, and packing so many transistors in such a small space creates enough heat to destroy components. One way to eliminate heat buildup is to reduce the flow of electrons by [using photonics at the chip level][4]. However, photonic technology is not without its set of problems. + +SEE: [Silicon photonics will revolutionize data centers in 2015][5] + +### Microfluid cooling might be the answer + +To seek out other solutions, the Defense Advanced Research Projects Agency (DARPA) has initiated a program called [ICECool Applications][6] (Intra/Interchip Enhanced Cooling). "ICECool is exploring disruptive thermal technologies that will mitigate thermal limitations on the operation of military electronic systems while significantly reducing the size, weight, and power consumption," explains the [GSA website FedBizOpps.gov][7]. + +What is unique about this method of cooling is the push to use a combination of intra- and/or inter-chip microfluidic cooling and on-chip thermal interconnects. + +![](http://tr4.cbsistatic.com/hub/i/r/2016/05/25/fd3d0d17-bd86-4d25-a89a-a7050c4d59c4/resize/300x/e9c18034bde66526310c667aac92fbf5/microcooling-1.png) +>MicroCooling 1 Image: DARPA + +The [DARPA ICECool Application announcement][8] notes, "Such miniature intra- and/or inter-chip passages (see right) may take the form of axial micro-channels, radial passages, and/or cross-flow passages, and may involve micro-pores and manifolded structures to distribute and re-direct liquid flow, including in the form of localized liquid jets, in the most favorable manner to meet the specified heat flux and heat density metrics." + +Using the above technology, engineers at Lockheed Martin have experimentally demonstrated how on-chip cooling is a significant improvement. "Phase I of the ICECool program verified the effectiveness of Lockheed's embedded microfluidic cooling approach by showing a four-times reduction in thermal resistance while cooling a thermal demonstration die dissipating 1 kW/cm2 die-level heat flux with multiple local 30 kW/cm2 hot spots," mentions the Lockheed Martin press release. + +In phase II of the Lockheed Martin project, the engineers focused on RF amplifiers. The press release continues, "Utilizing its ICECool technology, the team has been able to demonstrate greater than six times increase in RF output power from a given amplifier while still running cooler than its conventionally cooled counterpart." + +### Moving to production + +Confident of the technology, Lockheed Martin is already designing and building a functional microfluidic cooled transmit antenna. Lockheed Martin is also collaborating with Qorvo to integrate its thermal solution with Qorvo's high-performance [GaN process][9]. + +The authors of the research paper [DARPA's Intra/Interchip Enhanced Cooling (ICECool) Program][10] suggest ICECool Applications will produce a paradigm shift in the thermal management of electronic systems. "ICECool Apps performers will define and demonstrate intra-chip and inter-chip thermal management approaches that are tailored to specific applications and this approach will be consistent with the materials sets, fabrication processes, and operating environment of the intended application." + +If this microfluidic technology is as successful as scientists and engineers suggest, it seems Moore's Law does have a fighting chance. + +For more about networking, subscribe to our Data Centers newsletter. + +[SUBSCRIBE](https://secure.techrepublic.com/user/login/?regSource=newsletter-button&position=newsletter-button&appId=true&redirectUrl=http%3A%2F%2Fwww.techrepublic.com%2Farticle%2Fmicrofluidic-cooling-may-prevent-the-demise-of-moores-law%2F&) + +-------------------------------------------------------------------------------- + +via: http://www.techrepublic.com/article/microfluidic-cooling-may-prevent-the-demise-of-moores-law/ + +作者:[Michael Kassner][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.techrepublic.com/search/?a=michael+kassner +[1]: http://www.intel.com/content/www/us/en/history/museum-gordon-moore-law.html +[2]: https://books.google.com/books?id=mfec2Zw_b7wC&pg=PA154&lpg=PA154&dq=does+heat+destroy+transistors&source=bl&ots=-aNdbMD7FD&sig=XUUiaYG_6rcxHncx4cI4Cqe3t20&hl=en&sa=X&ved=0ahUKEwif4M_Yu_PMAhVL7oMKHW3GC3cQ6AEITTAH#v=onepage&q=does%20heat%20destroy%20transis +[3]: http://www.lockheedmartin.com/us/news/press-releases/2016/march/160308-mst-cool-technology-turns-down-the-heat-on-high-tech-equipment.html +[4]: http://www.techrepublic.com/article/silicon-photonics-will-revolutionize-data-centers-in-2015/ +[5]: http://www.techrepublic.com/article/silicon-photonics-will-revolutionize-data-centers-in-2015/ +[6]: https://www.fbo.gov/index?s=opportunity&mode=form&id=0be99f61fbac0501828a9d3160883b97&tab=core&_cview=1 +[7]: https://www.fbo.gov/index?s=opportunity&mode=form&id=0be99f61fbac0501828a9d3160883b97&tab=core&_cview=1 +[8]: https://www.fbo.gov/index?s=opportunity&mode=form&id=0be99f61fbac0501828a9d3160883b97&tab=core&_cview=1 +[9]: http://electronicdesign.com/communications/what-s-difference-between-gaas-and-gan-rf-power-amplifiers +[10]: http://www.csmantech.org/Digests/2013/papers/050.pdf + + + From f0900d07751c54ddd181ccd93da17e8b0715e1b9 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 26 Jun 2016 22:57:05 +0800 Subject: [PATCH 0987/1469] =?UTF-8?q?20160626-4=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Microfluidic cooling may prevent the demise of Moore's Law.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{techmd20160604 Microfluidic cooling may prevent the demise of Moore's Law.md => tech/20160604 Microfluidic cooling may prevent the demise of Moore's Law.md} (100%) diff --git a/sources/techmd20160604 Microfluidic cooling may prevent the demise of Moore's Law.md b/sources/tech/20160604 Microfluidic cooling may prevent the demise of Moore's Law.md similarity index 100% rename from sources/techmd20160604 Microfluidic cooling may prevent the demise of Moore's Law.md rename to sources/tech/20160604 Microfluidic cooling may prevent the demise of Moore's Law.md From 1c1ae275750be8502a4ed8c4bff08ed7efcda69a Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 26 Jun 2016 23:04:07 +0800 Subject: [PATCH 0988/1469] =?UTF-8?q?20160626-5=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...C builds on Raspberry Pi Compute Module.md | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 sources/tech/20160624 Industrial SBC builds on Raspberry Pi Compute Module.md diff --git a/sources/tech/20160624 Industrial SBC builds on Raspberry Pi Compute Module.md b/sources/tech/20160624 Industrial SBC builds on Raspberry Pi Compute Module.md new file mode 100644 index 0000000000..17874b2cf3 --- /dev/null +++ b/sources/tech/20160624 Industrial SBC builds on Raspberry Pi Compute Module.md @@ -0,0 +1,71 @@ +Industrial SBC builds on Raspberry Pi Compute Module +===================================================== + +![](http://hackerboards.com/files/embeddedmicro_mypi-thm.jpg) + +On Kickstarter, a “MyPi” industrial SBC using the RPi Compute Module offers a mini-PCIe slot, serial port, wide-range power, and modular expansion. + +You might wonder why in 2016 someone would introduce a sandwich-style single board computer built around the aging, ARM11 based COM version of the original Raspberry Pi, the [Raspberry Pi Compute Module][1]. First off, there are still plenty of industrial applications that don’t need much CPU horsepower, and second, the Compute Module is still the only COM based on Raspberry Pi hardware, although the cheaper, somewhat COM-like [Raspberry Pi Zero][2], which has the same 700MHz processor, comes close. + +![](http://hackerboards.com/files/embeddedmicro_mypi-sm.jpg) + +![](http://hackerboards.com/files/embeddedmicro_mypi_encl-sm.jpg) + +>MyPi with COM and I/O add-ons (left), and in its optional industrial enclosure + +In addition, Embedded Micro Technology says its SBC is also designed to support a swap-in for a promised Raspberry Pi Compute Module upgrade built around the Raspberry Pi 3’s quad-core, Cortex-A53 Broadcom BCM2837 SoC. Since this product could arrive any week now, it’s unclear how that all sorts out for Kickstarter backers. Still, it’s nice to know you’re somewhat futureproof, even if you have to pay for the upgrade. + +The MyPi is not the only new commercial embedded device based on the Raspberry Pi Compute Module. Pigeon Computers launched a [Pigeon RB100][3] industrial automation controller based on the COM in May. Most such devices arrived in 2014, however, shortly after the COM arrived, including the [Techbase Modberry][4]. + +The MyPi is over a third of the way toward its $21,696 funding goal with 30 days to go. An early bird package starts at $119, with shipments in September. Other kit options include a $187 version that includes the $30 Raspberry Pi Compute Module, as well as various cables. Kits are also available with add-on boards and an industrial enclosure. + +![](http://hackerboards.com/files/embeddedmicro_mypi_baseboard-sm.jpg) + +![](http://hackerboards.com/files/embeddedmicro_mypi_detail-sm.jpg) + +>MyPi baseboard without COM or add-ons (left) and its port details + +The Raspberry Pi Compute Module starts the MyPi off with the Broadcom BCM2835 SoC, 512MB RAM, and 4GB eMMC flash. The MyPi adds to this with a microSD card slot, an HDMI port, two USB 2.0 ports, a 10/100 Ethernet port, and a similarly coastline RS232 port (via USB). + +![](http://hackerboards.com/files/embeddedmicro_mypi_angle1-sm.jpg) + +![](http://hackerboards.com/files/embeddedmicro_mypi_angle2.jpg) + +>Two views of the MyPi board with RPi and mini-PCIe modules installed + +The MyPi is further equipped with a mini-PCIe socket, which is said to be “USB only and intended for use of modems available in the mPCIe form factor.” A SIM card slot is also available. Dual standard Raspberry Pi camera connectors are onboard along with an audio out interface, a battery-backed RTC, and LEDs. The SBC has a wide-range, 9-23V DC input. + +The MyPi is designed for Raspberry Pi hackers who have stacked so many HAT add-on boards, they can no longer work with them effectively or stuff them inside and industrial enclosure, says Embedded Micro. The MyPi supports HATs, but also offers the company’s own “ASIO” (Application Specific I/O) add-on modules, which route their I/O back to the carrier board, which, in turn, connects it to the 8-pin, green, Phoenix-style, industrial I/O connector (labeled “ASIO Out”) on the board’s edge, as illustrated in the diagram below. + +![](http://hackerboards.com/files/embeddedmicro_mypi_io-sm.jpg) +>MyPi’s modular expansion interface + +As the Kickstarter page explains it: “Rather than have a plug in HAT card with IO signal connectors poking out on all sides, instead we take these same IO signals back down a second output connector which is directly connected to the green industrial connector.” Additionally, “by simply using extended length interface pins on the card (raising it up) you can expand the IO set further — all without using any cable assemblies!” says Embedded Micro. + +![](http://hackerboards.com/files/embeddedmicro_mypi_with_iocards-sm.jpg) +>MyPi and its optional I/O add-on cards + +The company offers a line of hardened ASIO plug-in cards for the MyPi, as shown above. These initially include CAN-Bus, 4-20mA transducer signals, RS485, Narrow Band RF, and more. + +### Further information + +The MyPi is available on Kickstarter starting at a 79-Pound ($119) early bird package (without the Raspberry Pi Compute Module) through July 23, with shipments due in September. More information may be found on the [MyPi Kickstarter page][5] and the [Embedded Micro Technology website][6]. + + +-------------------------------------------------------------------------------- + +via: http://hackerboards.com/industrial-sbc-builds-on-rpi-compute-module/ + +作者:[Eric Brown][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://hackerboards.com/industrial-sbc-builds-on-rpi-compute-module/ +[1]: http://hackerboards.com/raspberry-pi-morphs-into-30-dollar-com/ +[2]: http://hackerboards.com/pi-zero-tweak-adds-camera-connector-keeps-5-price/ +[3]: http://hackerboards.com/automation-controller-runs-linux-on-raspberry-pi-com/ +[4]: http://hackerboards.com/automation-controller-taps-raspberry-pi-compute-module/ +[5]: https://www.kickstarter.com/projects/410598173/mypi-industrial-strength-raspberry-pi-for-iot-proj +[6]: http://www.embeddedpi.com/ From d0750c98059062f279b0e833bf9de29e8df685dc Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 26 Jun 2016 23:13:08 +0800 Subject: [PATCH 0989/1469] =?UTF-8?q?20160626-6=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... the cloud runs on Linux. Any questions.md | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 sources/talk/20160624 IT runs on the cloud and the cloud runs on Linux. Any questions.md diff --git a/sources/talk/20160624 IT runs on the cloud and the cloud runs on Linux. Any questions.md b/sources/talk/20160624 IT runs on the cloud and the cloud runs on Linux. Any questions.md new file mode 100644 index 0000000000..2a575c1a31 --- /dev/null +++ b/sources/talk/20160624 IT runs on the cloud and the cloud runs on Linux. Any questions.md @@ -0,0 +1,62 @@ +IT runs on the cloud, and the cloud runs on Linux. Any questions? +=================================================================== + +>IT is moving to the cloud. And, what powers the cloud? Linux. When even Microsoft's Azure has embraced Linux, you know things have changed. + +![](http://zdnet1.cbsistatic.com/hub/i/r/2016/06/24/7d2b00eb-783d-4202-bda2-ca65d45c460a/resize/770xauto/732db8df725ede1cc38972788de71a0b/linux-owns-cloud.jpg) +>Image: ZDNet + +Like it or lump it, the cloud is taking over IT. We've seen [the rise of the cloud over in-house IT][1] for years now. And, what powers the cloud? Linux. + +A recent survey by the [Uptime Institute][2] of 1,000 IT executives found that 50 percent of senior enterprise IT executives expect the [majority of IT workloads to reside off-premise in cloud][3] or colocation sites in the future. Of those surveyed, 23 percent expect the shift to happen next year, and 70 percent expect that shift to occur within the next four years. + +This comes as no surprise. Much as many of us still love our physical servers and racks, it often doesn't make financial sense to run your own data center. + +It's really very simple. Just compare your [capital expense (CAPEX) of running your own hardware versus the operational expenses (OPEX)][4] of using a cloud. Now, that's not to say you want to outsource everything and the kitchen sink, but most of the time and for many of your jobs you'll want to move to the cloud. + +In turn, if you're going to make the best use of the cloud, you need to know Linux. + +[Amazon Web Services][5], [Apache CloudStack][6], [Rackspace][7], [Google Cloud Platform][8], and [OpenStack][9] all run Linux at their hearts. The result? By 2014, [Linux server application deployments had risen to 79 percent][10] of all businesses, while Windows server app deployments had fallen to 36 percent. Linux has only gained more momentum since then. + +Even Microsoft understands this. + +In the past year alone, Azure Chief Technology Officer Mark Russinovich said, Microsoft has gone from [one in four of its Azure virtual machines running Linux][11] to [nearly one in three][12]. + +Think about that. Microsoft, which is switching to the [cloud for its main source of revenue][13], is relying on Linux for a third of its cloud business. + +Even now, both those who love Microsoft and those who hate it have trouble getting their minds around the fundamental shift of [Microsoft from a proprietary software company to an open-source][14], cloud-based service business. + +Linux's penetration into the proprietary server room is even deeper than it first appears. For example, [Docker recently announced a public beta of its Windows 10 and Mac OS X releases][15]. So, does that mean [Docker][16] is porting its eponymous container service to Windows 10 and the Mac? Nope. + +On both platforms, Docker runs within a Linux virtual machine. HyperKit on Mac OS and Hyper-V on Windows. Your interface may look like just another Mac or Windows application, but at heart your containers will still be running on Linux. + +So, just as the vast majority of Android phone and Chromebook users have no clue they're running Linux, so too will IT users continue to quietly move to Linux and the cloud. + +-------------------------------------------------------------------------------- + +via: http://www.zdnet.com/article/it-runs-on-the-cloud-and-the-cloud-runs-on-linux-any-questions/#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://www.zdnet.com/article/2014-the-year-the-cloud-killed-the-datacenter/ +[2]: https://uptimeinstitute.com/ +[3]: http://www.zdnet.com/article/move-to-cloud-accelerating-faster-than-thought-survey-finds/ +[4]: http://www.zdnet.com/article/rethinking-capex-and-opex-in-a-cloud-centric-world/ +[5]: https://aws.amazon.com/ +[6]: https://cloudstack.apache.org/ +[7]: https://www.rackspace.com/en-us +[8]: https://cloud.google.com/ +[9]: http://www.openstack.org/ +[10]: http://www.zdnet.com/article/linux-foundation-finds-enterprise-linux-growing-at-windows-expense/ +[11]: http://news.microsoft.com/bythenumbers/azure-virtual +[12]: http://www.zdnet.com/article/microsoft-nearly-one-in-three-azure-virtual-machines-now-are-running-linux/ +[13]: http://www.zdnet.com/article/microsofts-q3-azure-commercial-cloud-strong-but-earnings-revenue-light/ +[14]: http://www.zdnet.com/article/why-microsoft-is-turning-into-an-open-source-company/ +[15]: http://www.zdnet.com/article/new-docker-betas-for-azure-windows-10-now-available/ +[16]: http://www.docker.com/ + From dbc142932f9b4ad5c22527cfa64285a097af861f Mon Sep 17 00:00:00 2001 From: FSSlc Date: Sun, 26 Jun 2016 23:35:56 +0800 Subject: [PATCH 0990/1469] =?UTF-8?q?=E8=A1=A5=E5=85=85=E4=BA=86=E4=B8=80?= =?UTF-8?q?=E7=82=B9=E6=A0=A1=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... How to Add Cron Jobs in Linux and Unix.md | 79 ++++++++++++++----- 1 file changed, 59 insertions(+), 20 deletions(-) diff --git a/translated/tech/20160605 How to Add Cron Jobs in Linux and Unix.md b/translated/tech/20160605 How to Add Cron Jobs in Linux and Unix.md index d445be5b51..0b5ee53439 100644 --- a/translated/tech/20160605 How to Add Cron Jobs in Linux and Unix.md +++ b/translated/tech/20160605 How to Add Cron Jobs in Linux and Unix.md @@ -1,4 +1,4 @@ -如何在 Linux 及 Unix 系统中添加 cron 任务 +如何在 Linux 及 Unix 系统中添加定时任务 ====================================== ![](https://www.unixmen.com/wp-content/uploads/2016/05/HOW-TO-ADD-CRON-JOBS-IN-LINUX-AND-UNIX-696x334.png) @@ -7,11 +7,11 @@ ![](http://www.unixmen.com/wp-content/uploads/2016/05/cronjob.gif) -定时任务 (Cron job) 被用于安排那些需要被周期性执行的命令。利用它,你可以配置某些命令或者脚本,让它们在某个设定的时间周期性地运行。`Cron` 是 Linux 或者类 Unix 系统中最为实用的工具之一。cron 服务(守护进程)在系统后台运行,并且会持续地检查 `/etc/crontab` 文件和 `/etc/cron.*/ `目录。它同样也会检测 `/var/spool/cron/` 目录。 +定时任务 (cron job) 被用于安排那些需要被周期性执行的命令。利用它,你可以配置某些命令或者脚本,让它们在某个设定的时间周期性地运行。`cron` 是 Linux 或者类 Unix 系统中最为实用的工具之一。cron 服务(守护进程)在系统后台运行,并且会持续地检查 `/etc/crontab` 文件和 `/etc/cron.*/ `目录。它同样也会检查 `/var/spool/cron/` 目录。 ### crontab 命令 -`crontab` 是用来安装、卸载或者列出 cron 配置文件列表的命令。cron 配置文件则用于驱动 `Vixie Cron` 的 [cron(8)][1] 守护进程。每个用户都可以拥有自己的 crontab 文件,虽然这些文件都位于 `/var/spool/cron/crontabs` 目录中,但并不意味着你可以直接编辑它们。你需要通过 `crontab` 命令来编辑或者配置你自己的定时任务。 +`crontab` 是用来安装、卸载或者列出定时任务列表的命令。cron 配置文件则用于驱动 `Vixie Cron` 的 [cron(8)][1] 守护进程。每个用户都可以拥有自己的 crontab 文件,虽然这些文件都位于 `/var/spool/cron/crontabs` 目录中,但并不意味着你可以直接编辑它们。你需要通过 `crontab` 命令来编辑或者配置你自己的定时任务。 ### 定时配置文件的类型 @@ -19,9 +19,9 @@ - **UNIX 或 Linux 系统的 crontab** : 此类型通常由那些需要 root 或类似权限的系统服务和重要任务使用。第六个字段(见下方的字段介绍)为用户名,用来指定此命令以哪个用户身份来执行。如此一来,系统的 `crontab` 就能够以任意用户的身份来执行操作。 -- **用户的 crontabs**: 用户可以使用 `corntab` 命令来安装属于他们自己的定时任务。 第六个字段为需要运行的命令, 所有的命令都会以创建该 crontab 任务的用户的身份运行。 +- **用户的 crontab**: 用户可以使用 `corntab` 命令来安装属于他们自己的定时任务。 第六个字段为需要运行的命令, 所有的命令都会以创建该 crontab 任务的用户的身份运行。 -**注意**: 这种问答形式的 `Cron` 实现由 Paul Vixie 所写,并且被包含在许多 [Linux][2] 发行版和类 Unix 系统(如广受欢迎的第四版 BSD)中。它的语法被各种 crond 的实现所[兼容][3]。 +**注意**: 这种问答形式的 `Cron` 实现由 Paul Vixie 所写,并且被包含在许多 [Linux][2] 发行版本和类 Unix 系统(如广受欢迎的第四版 BSD)中。它的语法被各种 crond 的实现所[兼容][3]。 那么我该如何安装、创建或者编辑我自己的定时任务呢? @@ -57,7 +57,7 @@ $ crontab -e 便于记忆的格式: ``` -* * * * * command to be executed +* * * * * 要执行的命令 – – – – – | | | | | | | | | —– 一周当中的某天 (0 – 7) (周日为 0 或 7) @@ -94,20 +94,59 @@ $ crontab -e - **分隔符 (/)** : 此操作符指定了一个步进值,例如: `0-23/` 可以用于小时字段来指定某个命令每小时被执行一次。步进值也可以跟在星号操作符后边,如果你希望命令行每 2 小时执行一次,则可以使用 `*/2`。 -### 使用特殊字符节省时间 +### 如何禁用邮件输出 + +默认情况下,某个命令或者脚本的输出内容(如果有的话)会发送到你的本地邮箱账户中。若想停止收到 `crontab` 发送的邮件,需要添加 `>/dev/null 2>&1` 这段内容,例如: + +``` +0 3 * * * /root/backup.sh >/dev/null 2>&1 +``` + +如果想将输出内容发送到特定的邮件账户中,比如说 vivek@nixcraft.in 这个邮箱, 则你需要像下面这样定义一个 MAILTO 变量: + +``` +MAILTO="vivek@nixcraft.in" +0 3 * * * /root/backup.sh >/dev/null 2>&1 +``` + +访问 “[禁用 Crontab 命令的邮件提示](http://www.cyberciti.biz/faq/disable-the-mail-alert-by-crontab-command/)” 查看更多信息。 + + +### 任务:列出你所有的定时任务 + +键入以下命令: + +``` +# crontab -l +# crontab -u username -l +``` + +要删除所有的定时任务,可以使用如下命令: + +``` +# 删除当前定时任务 # +crontab -r +``` + +``` +## 删除某用户名下的定时任务,此命令需以 root 用户身份执行 ## +crontab -r -u username +``` + +### 使用特殊字符来节省时间 你可以使用以下 8 个特殊字符中的其中一个替代头五个字段,这样不但可以节省你的时间,还可以提高可读性。 -特殊字符 | 含义 +特殊字符 |含义 |:-- |:-- @reboot | 在每次启动时运行一次 -@yearly | 每年运行一次, “0 0 1 1 *”. +@yearly | 每年运行一次,等同于 “0 0 1 1 *”. @annually | (同 @yearly) -@monthly | 每月运行一次, “0 0 1 * *”. -@weekly | 每周运行一次, “0 0 * * 0”. -@daily | 每天运行一次, “0 0 * * *”. +@monthly | 每月运行一次, 等同于 “0 0 1 * *”. +@weekly | 每周运行一次, 等同于 “0 0 * * 0”. +@daily | 每天运行一次, 等同于 “0 0 * * *”. @midnight | (同 @daily) -@hourly | 每小时运行一次, “0 * * * *”. +@hourly | 每小时运行一次, 等同于 “0 * * * *”. 示例: @@ -121,7 +160,7 @@ $ crontab -e ** /etc/crontab ** 是系统的 corntabs 文件。通常只被 root 用户或守护进程用于配置系统级别的任务。每个独立的用户必须像上面介绍的那样使用 `corntab` 命令来安装和编辑自己的任务。`/var/spool/cron/` 或者 `/var/cron/tabs/` 目录存放了个人用户的 corntab 文件,它必定会备份在用户的家目录当中。 -### 理解默认的 `/etc/crontab` +### 理解默认的 `/etc/crontab` 文件 典型的 `/etc/crontab` 文件内容是这样的: @@ -141,13 +180,13 @@ HOME=/ 另外,corn 会读取 `/etc/cron.d/`目录中的文件。通常情况下,像 sa-update 或者 sysstat 这样的系统守护进程会将他们的定时任务存放在此处。作为 root 用户或者超级用户,你可以使用以下目录来配置你的定时任务。你可以直接将脚本放到这里。`run-parts`命令会通过 `/etc/crontab` 文件来运行位于某个目录中的脚本或者程序。 -目录 |描述 +目录 |描述 |:-- |:-- /etc/cron.d/ | 将所有的脚本文件放在此处,并从 /etc/crontab 文件中调用它们。 -/etc/cron.daily/ | 运行需要每天运行一次的脚本 -/etc/cron.hourly/ | 运行需要每小时运行一次的脚本 -/etc/cron.monthly/ | 运行需要每月运行一次的脚本 -/etc/cron.weekly/ | 运行需要每周运行一次的脚本 +/etc/cron.daily/ | 运行需要 每天 运行一次的脚本 +/etc/cron.hourly/ | 运行需要 每小时 运行一次的脚本 +/etc/cron.monthly/ | 运行需要 每月 运行一次的脚本 +/etc/cron.weekly/ | 运行需要 每周 运行一次的脚本 ### 备份定时任务 @@ -170,4 +209,4 @@ via: https://www.unixmen.com/add-cron-jobs-linux-unix/?utm_source=feedburner&utm [a]: https://www.unixmen.com/author/duynv/ [1]: http://www.manpager.com/linux/man8/cron.8.html [2]: http://www.linuxsecrets.com/ -[3]: http://www.linuxsecrets.com/linux-hardware/ +[3]: http://www.linuxsecrets.com/linux-hardware/ \ No newline at end of file From 7da5326c247fc7923f1ce18d1bbe4bfb93961ff3 Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 27 Jun 2016 18:04:56 +0800 Subject: [PATCH 0991/1469] =?UTF-8?q?20160627-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...o Write and Tune Shell Scripts – Part 2.md | 284 ++++++++++++++++++ 1 file changed, 284 insertions(+) create mode 100644 sources/tech/20160601 Learn Python Control Flow and Loops to Write and Tune Shell Scripts – Part 2.md diff --git a/sources/tech/20160601 Learn Python Control Flow and Loops to Write and Tune Shell Scripts – Part 2.md b/sources/tech/20160601 Learn Python Control Flow and Loops to Write and Tune Shell Scripts – Part 2.md new file mode 100644 index 0000000000..bcce4c143e --- /dev/null +++ b/sources/tech/20160601 Learn Python Control Flow and Loops to Write and Tune Shell Scripts – Part 2.md @@ -0,0 +1,284 @@ +Learn Python Control Flow and Loops to Write and Tune Shell Scripts – Part 2 +=============================================================================== + +In the previous article of this [Python series][1] we shared a brief introduction to Python, its command-line shell, and the IDLE. We also demonstrated how to perform arithmetic calculations, how to store values in variables, and how to print back those values to the screen. Finally, we explained the concepts of methods and properties in the context of Object Oriented Programming through a practical example. + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Write-Shell-Scripts-in-Python-Programming.png) +>Write Linux Shell Scripts in Python Programming + +In this guide we will discuss control flow (to choose different courses of action depending on information entered by a user, the result of a calculation, or the current value of a variable) and loops (to automate repetitive tasks) and then apply what we have learned so far to write a simple shell script that will display the operating system type, the hostname, the kernel release, version, and the machine hardware name. + +This example, although basic, will help us illustrate how we can leverage Python OOP’s capabilities to write shell scripts easier than using regular bash tools. + +In other words, we want to go from + +``` +# uname -snrvm +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Check-Hostname-of-Linux.png) +>Check Hostname of Linux + +to + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Check-Linux-Hostname-Using-Python-Script.png) +>Check Linux Hostname Using Python Script + +or + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Script-to-Check-Linux-System-Information.png) +>Script to Check Linux System Information + +Looks pretty, doesn’t it? Let’s roll up our sleeves and make it happen. + +### Control flow in Python + +As we said earlier, control flow allows us to choose different outcomes depending on a given condition. Its most simple implementation in Python is an if / else clause. + +The basic syntax is: + +``` +if condition: + # action 1 +else: + # action 2 +``` + +When condition evaluates to true, the code block below will be executed (represented by `# action 1`. Otherwise, the code under else will be run. +A condition can be any statement that can evaluate to either true or false. + +For example: + +1. 1 < 3 # true + +2. firstName == “Gabriel” # true for me, false for anyone not named Gabriel + + - In the first example we compared two values to determine if one is greater than the other. + - In the second example we compared firstName (a variable) to determine if, at the current execution point, its value is identical to “Gabriel” + - The condition and the else statement must be followed by a colon (:) + - Indentation is important in Python. Lines with identical indentation are considered to be in the same code block. + +Please note that the if / else statement is only one of the many control flow tools available in Python. We reviewed it here since we will use it in our script later. You can learn more about the rest of the tools in the [official docs][2]. + +### Loops in Python + +Simply put, a loop is a sequence of instructions or statements that are executed in order as long as a condition is true, or once per item in a list. + +The most simple loop in Python is represented by the for loop iterates over the items of a given list or string beginning with the first item and ending with the last. + +Basic syntax: + +``` +for x in example: + # do this +``` + +Here example can be either a list or a string. If the former, the variable named x represents each item in the list; if the latter, x represents each character in the string: + +``` +>>> rockBands = [] +>>> rockBands.append("Roxette") +>>> rockBands.append("Guns N' Roses") +>>> rockBands.append("U2") +>>> for x in rockBands: + print(x) +or +>>> firstName = "Gabriel" +>>> for x in firstName: + print(x) +``` + +The output of the above examples is shown in the following image: + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Learn-Loops-in-Python.png) +>Learn Loops in Python + +### Python Modules + +For obvious reasons, there must be a way to save a sequence of Python instructions and statements in a file that can be invoked when it is needed. + +That is precisely what a module is. Particularly, the os module provides an interface to the underlying operating system and allows us to perform many of the operations we usually do in a command-line prompt. + +As such, it incorporates several methods and properties that can be called as we explained in the previous article. However, we need to import (or include) it in our environment using the import keyword: + +``` +>>> import os +``` + +Let’s print the current working directory: + +``` +>>> os.getcwd() +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Learn-Python-Modules.png) +>Learn Python Modules + +Let’s now put all of this together (along with the concepts discussed in the previous article) to write the desired script. + +### Python Script + +It is considered good practice to start a script with a statement that indicates the purpose of the script, the license terms under which it is released, and a revision history listing the changes that have been made. Although this is more of a personal preference, it adds a professional touch to our work. + +Here’s the script that produces the output we shown at the top of this article. It is heavily commented so that you can understand what’s happening. + +Take a few minutes to go through it before proceeding. Note how we use an if / else structure to determine whether the length of each field caption is greater than the value of the field itself. + +Based on the result, we use empty characters to fill in the space between a field caption and the next. Also, we use the right number of dashes as separator between the field caption and its value below. + +``` +#!/usr/bin/python3 +# Change the above line to #!/usr/bin/python if you don't have Python 3 installed + +# Script name: uname.py +# Purpose: Illustrate Python's OOP capabilities to write shell scripts more easily +# License: GPL v3 (http://www.gnu.org/licenses/gpl.html) + +# Copyright (C) 2016 Gabriel Alejandro Cánepa +# ​Facebook / Skype / G+ / Twitter / Github: gacanepa +# Email: gacanepa (at) gmail (dot) com + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# REVISION HISTORY +# DATE VERSION AUTHOR CHANGE DESCRIPTION +# ---------- ------- -------------- +# 2016-05-28 1.0 Gabriel Cánepa Initial version + +# Import the os module +import os + +# Assign the output of os.uname() to the the systemInfo variable +# os.uname() returns a 5-string tuple (sysname, nodename, release, version, machine) +# Documentation: https://docs.python.org/3.2/library/os.html#module-os +systemInfo = os.uname() + +# This is a fixed array with the desired captions in the script output +headers = ["Operating system","Hostname","Release","Version","Machine"] + +# Initial value of the index variable. It is used to define the +# index of both systemInfo and headers in each step of the iteration. +index = 0 + +# Initial value of the caption variable. +caption = "" + +# Initial value of the values variable +values = "" + +# Initial value of the separators variable +separators = "" + +# Start of the loop +for item in systemInfo: + if len(item) < len(headers[index]): + # A string containing dashes to the length of item[index] or headers[index] + # To repeat a character(s), enclose it within quotes followed + # by the star sign (*) and the desired number of times. + separators = separators + "-" * len(headers[index]) + " " + caption = caption + headers[index] + " " + values = values + systemInfo[index] + " " * (len(headers[index]) - len(item)) + " " + else: + separators = separators + "-" * len(item) + " " + caption = caption + headers[index] + " " * (len(item) - len(headers[index]) + 1) + values = values + item + " " + # Increment the value of index by 1 + index = index + 1 +# End of the loop + +# Print the variable named caption converted to uppercase +print(caption.upper()) + +# Print separators +print(separators) + +# Print values (items in systemInfo) +print(values) + +# INSTRUCTIONS: +# 1) Save the script as uname.py (or another name of your choosing) and give it execute permissions: +# chmod +x uname.py +# 2) Execute it: +# ./uname.py +``` + +Once you have saved the above script to a file, give it execute permissions and run it as indicated at the bottom of the code: + +``` +# chmod +x uname.py +# ./uname.py +``` + +If you get the following error while attempting to execute the script: + +``` +-bash: ./uname.py: /usr/bin/python3: bad interpreter: No such file or directory +``` + +It means you don’t have Python 3 installed. If that is the case, you can either install the package or replace the interpreter line (pay special attention and be very careful if you followed the steps to update the symbolic links to the Python binaries as outlined in the previous article): + +``` +#!/usr/bin/python3 +``` + +with + +``` +#!/usr/bin/python +``` + +which will cause the installed version of Python 2 to execute the script instead. + +**Note**: This script has been tested successfully both in Python 2.x and 3.x. + +Although somewhat rudimentary, you can think of this script as a Python module. This means that you can open it in the IDLE (File → Open… → Select file): + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Open-Python-in-IDLE.png) +>Open Python in IDLE + +A new window will open with the contents of the file. Then go to Run → Run module (or just press F5). The output of the script will be shown in the original shell: + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Run-Python-Script.png) +>Run Python Script + +If you want to obtain the same results with a script written purely in Bash, you would need to use a combination of [awk][3], [sed][4], and resort to complex methods to store and retrieve items in a list (not to mention the use of tr to convert lowercase letters to uppercase). + +In addition, Python provides portability in that all Linux systems ship with at least one Python version (either 2.x or 3.x, sometimes both). Should you need to rely on a shell to accomplish the same goal, you would need to write different versions of the script based on the shell. + +This goes to show that Object Oriented Programming features can become strong allies of system administrators. + +**Note**: You can find [this python script][5] (and others) in one of my GitHub repositories. + +### Summary + +In this article we have reviewed the concepts of control flow, loops / iteration, and modules in Python. We have shown how to leverage OOP methods and properties in Python to simplify otherwise complex shell scripts. + +Do you have any other ideas you would like to test? Go ahead and write your own Python scripts and let us know if you have any questions. Don’t hesitate to drop us a line using the comment form below, and we will get back to you as soon as we can. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/learn-python-programming-to-write-linux-shell-scripts/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tecmint+%28Tecmint%3A+Linux+Howto%27s+Guide%29 + +作者:[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/learn-python-programming-and-scripting-in-linux/ +[2]: http://please%20note%20that%20the%20if%20/%20else%20statement%20is%20only%20one%20of%20the%20many%20control%20flow%20tools%20available%20in%20Python.%20We%20reviewed%20it%20here%20since%20we%20will%20use%20it%20in%20our%20script%20later.%20You%20can%20learn%20more%20about%20the%20rest%20of%20the%20tools%20in%20the%20official%20docs. +[3]: http://www.tecmint.com/use-linux-awk-command-to-filter-text-string-in-files/ +[4]: http://www.tecmint.com/sed-command-to-create-edit-and-manipulate-files-in-linux/ +[5]: https://github.com/gacanepa/scripts/blob/master/python/uname.py From 4c4245d3aecc8665b2b942728a450567eb63d7da Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 27 Jun 2016 21:50:27 +0800 Subject: [PATCH 0992/1469] =?UTF-8?q?20160627-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Filter Text or String in Files - part 1.md | 210 ++++++++++++++++++ 1 file changed, 210 insertions(+) create mode 100644 sources/tech/awk/How to Use Awk and Regular Expressions to Filter Text or String in Files - part 1.md diff --git a/sources/tech/awk/How to Use Awk and Regular Expressions to Filter Text or String in Files - part 1.md b/sources/tech/awk/How to Use Awk and Regular Expressions to Filter Text or String in Files - part 1.md new file mode 100644 index 0000000000..f254098f14 --- /dev/null +++ b/sources/tech/awk/How to Use Awk and Regular Expressions to Filter Text or String in Files - part 1.md @@ -0,0 +1,210 @@ +How to Use Awk and Regular Expressions to Filter Text or String in Files +============================================================================= + +When we run certain commands in Unix/Linux to read or edit text from a string or file, we most times try to filter output to a given section of interest. This is where using regular expressions comes in handy. + +### What are Regular Expressions? + +A regular expression can be defined as a strings that represent several sequence of characters. One of the most important things about regular expressions is that they allow you to filter the output of a command or file, edit a section of a text or configuration file and so on. + +### Features of Regular Expression + +Regular expressions are made of: + +- Ordinary characters such as space, underscore(_), A-Z, a-z, 0-9. +- Meta characters that are expanded to ordinary characters, they include: + - `(.)` it matches any single character except a newline. + - `(*)` it matches zero or more existences of the immediate character preceding it. + - `[ character(s) ]` it matches any one of the characters specified in character(s), one can also use a hyphen (-) to mean a range of characters such as [a-f], [1-5], and so on. + - `^` it matches the beginning of a line in a file. + - `$` matches the end of line in a file. + - `\` it is an escape character. + +In order to filter text, one has to use a text filtering tool such as awk. You can think of awk as a programming language of its own. But for the scope of this guide to using awk, we shall cover it as a simple command line filtering tool. + +The general syntax of awk is: + +``` +# awk 'script' filename +``` + +Where `'script'` is a set of commands that are understood by awk and are execute on file, filename. + +It works by reading a given line in the file, makes a copy of the line and then executes the script on the line. This is repeated on all the lines in the file. + +The `'script'` is in the form `'/pattern/ action'` where pattern is a regular expression and the action is what awk will do when it finds the given pattern in a line. + +### How to Use Awk Filtering Tool in Linux + +In the following examples, we shall focus on the meta characters that we discussed above under the features of awk. + +#### A simple example of using awk: + +The example below prints all the lines in the file /etc/hosts since no pattern is given. + +``` +# awk '//{print}'/etc/hosts +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/04/Awk-Command-Example.gif) +>Awk Prints all Lines in a File + +#### Use Awk with Pattern: + +I the example below, a pattern `localhost` has been given, so awk will match line having localhost in the `/etc/hosts` file. + +``` +# awk '/localhost/{print}' /etc/hosts +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-Command-with-Pattern.gif) +>Awk Print Given Matching Line in a File + +#### Using Awk with (.) wild card in a Pattern + +The `(.)` will match strings containing loc, localhost, localnet in the example below. + +That is to say *** l some_single_character c ***. + +``` +# awk '/l.c/{print}' /etc/hosts +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-with-Wild-Cards.gif) +>Use Awk to Print Matching Strings in a File + +#### Using Awk with (*) Character in a Pattern + +It will match strings containing localhost, localnet, lines, capable, as in the example below: + +``` +# awk '/l*c/{print}' /etc/localhost +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-to-Match-Strings-in-File.gif) +>Use Awk to Match Strings in File + +You will also realize that `(*)` tries to a get you the longest match possible it can detect. + +Let look at a case that demonstrates this, take the regular expression `t*t` which means match strings that start with letter `t` and end with `t` in the line below: + +``` +this is tecmint, where you get the best good tutorials, how to's, guides, tecmint. +``` + +You will get the following possibilities when you use the pattern `/t*t/`: + +``` +this is t +this is tecmint +this is tecmint, where you get t +this is tecmint, where you get the best good t +this is tecmint, where you get the best good tutorials, how t +this is tecmint, where you get the best good tutorials, how tos, guides, t +this is tecmint, where you get the best good tutorials, how tos, guides, tecmint +``` + +And `(*)` in `/t*t/` wild card character allows awk to choose the the last option: + +``` +this is tecmint, where you get the best good tutorials, how to's, guides, tecmint +``` + +#### Using Awk with set [ character(s) ] + +Take for example the set [al1], here awk will match all strings containing character a or l or 1 in a line in the file /etc/hosts. + +``` +# awk '/[al1]/{print}' /etc/hosts +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-to-Print-Matching-Character.gif) +>Use-Awk to Print Matching Character in File + +The next example matches strings starting with either `K` or `k` followed by `T`: + +``` +# awk '/[Kk]T/{print}' /etc/hosts +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-to-Print-Matched-String-in-File.gif) +>Use Awk to Print Matched String in File + +#### Specifying Characters in a Range + +Understand characters with awk: + +- `[0-9]` means a single number +- `[a-z]` means match a single lower case letter +- `[A-Z]` means match a single upper case letter +- `[a-zA-Z]` means match a single letter +- `[a-zA-Z 0-9]` means match a single letter or number + +Lets look at an example below: + +``` +# awk '/[0-9]/{print}' /etc/hosts +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-To-Print-Matching-Numbers-in-File.gif) +>Use Awk To Print Matching Numbers in File + +All the line from the file /etc/hosts contain at least a single number [0-9] in the above example. + +#### Use Awk with (^) Meta Character + +It matches all the lines that start with the pattern provided as in the example below: + +``` +# awk '/^fe/{print}' /etc/hosts +# awk '/^ff/{print}' /etc/hosts +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-to-Print-All-Matching-Lines-with-Pattern.gif) +>Use Awk to Print All Matching Lines with Pattern + +#### Use Awk with ($) Meta Character + +It matches all the lines that end with the pattern provided: + +``` +# awk '/ab$/{print}' /etc/hosts +# awk '/ost$/{print}' /etc/hosts +# awk '/rs$/{print}' /etc/hosts +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-to-Print-Given-Pattern-String.gif) +>Use Awk to Print Given Pattern String + +#### Use Awk with (\) Escape Character + +It allows you to take the character following it as a literal that is to say consider it just as it is. + +In the example below, the first command prints out all line in the file, the second command prints out nothing because I want to match a line that has $25.00, but no escape character is used. + +The third command is correct since a an escape character has been used to read $ as it is. + +``` +# awk '//{print}' deals.txt +# awk '/$25.00/{print}' deals.txt +# awk '/\$25.00/{print}' deals.txt +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-with-Escape-Character.gif) +>Use Awk with Escape Character + +### Summary + +That is not all with the awk command line filtering tool, the examples above a the basic operations of awk. In the next parts we shall be advancing on how to use complex features of awk. Thanks for reading through and for any additions or clarifications, post a comment in the comments section. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/use-linux-awk-command-to-filter-text-string-in-files/ + +作者:[Aaron Kili][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/aaronkili/ From 07305e624e1c15a2c2c2761c258d82eb78ef93f7 Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 27 Jun 2016 21:51:17 +0800 Subject: [PATCH 0993/1469] =?UTF-8?q?20160627-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... and Regular Expressions to Filter Text or String in Files.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/tech/awk/{How to Use Awk and Regular Expressions to Filter Text or String in Files - part 1.md => Part 1 - How to Use Awk and Regular Expressions to Filter Text or String in Files.md} (100%) diff --git a/sources/tech/awk/How to Use Awk and Regular Expressions to Filter Text or String in Files - part 1.md b/sources/tech/awk/Part 1 - How to Use Awk and Regular Expressions to Filter Text or String in Files.md similarity index 100% rename from sources/tech/awk/How to Use Awk and Regular Expressions to Filter Text or String in Files - part 1.md rename to sources/tech/awk/Part 1 - How to Use Awk and Regular Expressions to Filter Text or String in Files.md From c57e2f3b1a271371dc5c448ce5ca8f8b497edc0a Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 27 Jun 2016 21:57:29 +0800 Subject: [PATCH 0994/1469] =?UTF-8?q?20160627-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Awk to Print Fields and Columns in File.md | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 sources/tech/awk/Part 2 - How to Use Awk to Print Fields and Columns in File.md diff --git a/sources/tech/awk/Part 2 - How to Use Awk to Print Fields and Columns in File.md b/sources/tech/awk/Part 2 - How to Use Awk to Print Fields and Columns in File.md new file mode 100644 index 0000000000..f4f38d727e --- /dev/null +++ b/sources/tech/awk/Part 2 - How to Use Awk to Print Fields and Columns in File.md @@ -0,0 +1,106 @@ +How to Use Awk to Print Fields and Columns in File +====================================================== + +In this part of our Linux Awk command series, we shall have a look at one of the most important features of Awk, which is field editing. + +It is good to know that Awk automatically divides input lines provided to it into fields, and a field can be defined as a set of characters that are separated from other fields by an internal field separator. + +![](http://www.tecmint.com/wp-content/uploads/2016/04/Awk-Print-Fields-and-Columns.png) +>Awk Print Fields and Columns + +If you are familiar with the Unix/Linux or do [bash shell programming][1], then you should know what internal field separator (IFS) variable is. The default IFS in Awk are tab and space. + +This is how the idea of field separation works in Awk: when it encounters an input line, according to the IFS defined, the first set of characters is field one, which is accessed using $1, the second set of characters is field two, which is accessed using $2, the third set of characters is field three, which is accessed using $3 and so forth till the last set of character(s). + +To understand this Awk field editing better, let us take a look at the examples below: + +**Example 1**: I have created a text file called tecmintinfo.txt. + +``` +# vi tecmintinfo.txt +# cat tecmintinfo.txt +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/04/Create-File-in-Linux.png) +>Create File in Linux + +Then from the command line, I try to print the first, second and third fields from the file tecmintinfo.txt using the command below: + +``` +$ awk '//{print $1 $2 $3 }' tecmintinfo.txt +TecMint.comisthe +``` + +From the output above, you can see that the characters from the first three fields are printed based on the IFS defined which is space: + +- Field one which is “TecMint.com” is accessed using `$1`. +- Field two which is “is” is accessed using `$2`. +- Field three which is “the” is accessed using `$3`. + +If you have noticed in the printed output, the field values are not separated and this is how print behaves by default. + +To view the output clearly with space between the field values, you need to add (,) operator as follows: + +``` +$ awk '//{print $1, $2, $3; }' tecmintinfo.txt + +TecMint.com is the +``` + +One important thing to note and always remember is that the use of `($)` in Awk is different from its use in shell scripting. + +Under shell scripting `($)` is used to access the value of variables while in Awk `($)` it is used only when accessing the contents of a field but not for accessing the value of variables. + +**Example 2**: Let us take a look at one other example using a file which contains multiple lines called my_shoping.list. + +``` +No Item_Name Unit_Price Quantity Price +1 Mouse #20,000 1 #20,000 +2 Monitor #500,000 1 #500,000 +3 RAM_Chips #150,000 2 #300,000 +4 Ethernet_Cables #30,000 4 #120,000 +``` + +Say you wanted to only print `Unit_Price` of each item on the shopping list, you will need to run the command below: + +``` +$ awk '//{print $2, $3 }' my_shopping.txt + +Item_Name Unit_Price +Mouse #20,000 +Monitor #500,000 +RAM_Chips #150,000 +Ethernet_Cables #30,000 +``` + +Awk also has a `printf` command that helps you to format your output is a nice way as you can see the above output is not clear enough. + +Using `printf` to format output of the Item_Name and Unit_Price: + +``` +$ awk '//{printf "%-10s %s\n",$2, $3 }' my_shopping.txt + +Item_Name Unit_Price +Mouse #20,000 +Monitor #500,000 +RAM_Chips #150,000 +Ethernet_Cables #30,000 +``` + +### Summary +Field editing is very important when using Awk to filter text or strings, it helps you get particular data in columns in a list. And always remember that the use of `($)` operator in Awk is different from that in shell scripting. + +I hope the article was helpful to you and for any additional information required or questions, you can post a comment in the comment section. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/awk-print-fields-columns-with-space-separator/ + +作者:[Aaron Kili][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/aaronkili/ +[1]: http://www.tecmint.com/category/bash-shell/ From d685fa5cc01dd234da1269938511c3706ee620df Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 27 Jun 2016 22:02:13 +0800 Subject: [PATCH 0995/1469] =?UTF-8?q?20160627-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Strings Using Pattern Specific Actions.md | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 sources/tech/awk/Part3 - How to Use Awk to Filter Text or Strings Using Pattern Specific Actions.md diff --git a/sources/tech/awk/Part3 - How to Use Awk to Filter Text or Strings Using Pattern Specific Actions.md b/sources/tech/awk/Part3 - How to Use Awk to Filter Text or Strings Using Pattern Specific Actions.md new file mode 100644 index 0000000000..f6aeb69e57 --- /dev/null +++ b/sources/tech/awk/Part3 - How to Use Awk to Filter Text or Strings Using Pattern Specific Actions.md @@ -0,0 +1,83 @@ +How to Use Awk to Filter Text or Strings Using Pattern Specific Actions +========================================================================= + +![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-to-Filter-Text-or-Strings-Using-Pattern.png) + +In the third part of the Awk command series, we shall take a look at filtering text or strings based on specific patterns that a user can define. + +Sometimes, when filtering text, you want to indicate certain lines from an input file or lines of strings based on a given condition or using a specific pattern that can be matched. Doing this with Awk is very easy, it is one of the great features of Awk that you will find helpful. + +Let us take a look at an example below, say you have a shopping list for food items that you want to buy, called food_prices.list. It has the following list of food items and their prices. + +``` +$ cat food_prices.list +No Item_Name Quantity Price +1 Mangoes 10 $2.45 +2 Apples 20 $1.50 +3 Bananas 5 $0.90 +4 Pineapples 10 $3.46 +5 Oranges 10 $0.78 +6 Tomatoes 5 $0.55 +7 Onions 5 $0.45 +``` + +And then, you want to indicate a `(*)` sign on food items whose price is greater than $2, this can be done by running the following command: + +``` +$ awk '/ *\$[2-9]\.[0-9][0-9] */ { print $1, $2, $3, $4, "*" ; } / *\$[0-1]\.[0-9][0-9] */ { print ; }' food_prices.list +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/04/Filter-and-Print-Text-Using-Awk.gif) +>Print Items Whose Price is Greater Than $2 + +From the output above, you can see that the there is a `(*)` sign at the end of the lines having food items, mangoes and pineapples. If you check their prices, they are above $2. + +In this example, we have used used two patterns: + +- the first: `/ *\$[2-9]\.[0-9][0-9] */` gets the lines that have food item price greater than $2 and +- the second: `/*\$[0-1]\.[0-9][0-9] */` looks for lines with food item price less than $2. + +This is what happens, there are four fields in the file, when pattern one encounters a line with food item price greater than $2, it prints all the four fields and a `(*)` sign at the end of the line as a flag. + +The second pattern simply prints the other lines with food price less than $2 as they appear in the input file, food_prices.list. + +This way you can use pattern specific actions to filter out food items that are priced above $2, though there is a problem with the output, the lines that have the `(*)` sign are not formatted out like the rest of the lines making the output not clear enough. + +We saw the same problem in Part 2 of the awk series, but we can solve it in two ways: + +1. Using printf command which is a long and boring way using the command below: + +``` +$ awk '/ *\$[2-9]\.[0-9][0-9] */ { printf "%-10s %-10s %-10s %-10s\n", $1, $2, $3, $4 "*" ; } / *\$[0-1]\.[0-9][0-9] */ { printf "%-10s %-10s %-10s %-10s\n", $1, $2, $3, $4; }' food_prices.list +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/04/Filter-and-Print-Items-Using-Awk-and-Printf.gif) +>Filter and Print Items Using Awk and Printf + +2. Using $0 field. Awk uses the variable 0 to store the whole input line. This is handy for solving the problem above and it is simple and fast as follows: + +``` +$ awk '/ *\$[2-9]\.[0-9][0-9] */ { print $0 "*" ; } / *\$[0-1]\.[0-9][0-9] */ { print ; }' food_prices.list +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/04/Filter-and-Print-Items-Using-Awk-and-Variable.gif) +>Filter and Print Items Using Awk and Variable + +Conclusion +That’s it for now and these are simple ways of filtering text using pattern specific action that can help in flagging lines of text or strings in a file using Awk command. + +Hope you find this article helpful and remember to read the next part of the series which will focus on using comparison operators using awk tool. + + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/awk-filter-text-or-string-using-patterns/ + +作者:[Aaron Kili][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/aaronkili/ + From fcdc1f812af8bad263e3a3494366d29b46071e8a Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 27 Jun 2016 22:04:34 +0800 Subject: [PATCH 0996/1469] =?UTF-8?q?20160627-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加配图 --- ...and Regular Expressions to Filter Text or String in Files.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/awk/Part 1 - How to Use Awk and Regular Expressions to Filter Text or String in Files.md b/sources/tech/awk/Part 1 - How to Use Awk and Regular Expressions to Filter Text or String in Files.md index f254098f14..27aee1c0c7 100644 --- a/sources/tech/awk/Part 1 - How to Use Awk and Regular Expressions to Filter Text or String in Files.md +++ b/sources/tech/awk/Part 1 - How to Use Awk and Regular Expressions to Filter Text or String in Files.md @@ -1,6 +1,8 @@ How to Use Awk and Regular Expressions to Filter Text or String in Files ============================================================================= +![](http://www.tecmint.com/wp-content/uploads/2016/04/Linux-Awk-Command-Examples.png) + When we run certain commands in Unix/Linux to read or edit text from a string or file, we most times try to filter output to a given section of interest. This is where using regular expressions comes in handy. ### What are Regular Expressions? From f58a7b7109df6f0a393543199966e558c61f5a2c Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 27 Jun 2016 22:09:30 +0800 Subject: [PATCH 0997/1469] =?UTF-8?q?20160627-4=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Comparison Operators with Awk in Linux.md | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 sources/tech/awk/Part 4 - How to Use Comparison Operators with Awk in Linux.md diff --git a/sources/tech/awk/Part 4 - How to Use Comparison Operators with Awk in Linux.md b/sources/tech/awk/Part 4 - How to Use Comparison Operators with Awk in Linux.md new file mode 100644 index 0000000000..7f3a46360f --- /dev/null +++ b/sources/tech/awk/Part 4 - How to Use Comparison Operators with Awk in Linux.md @@ -0,0 +1,95 @@ +How to Use Comparison Operators with Awk in Linux +=================================================== + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Use-Comparison-Operators-with-AWK.png) + +When dealing with numerical or string values in a line of text, filtering text or strings using comparison operators comes in handy for Awk command users. + +In this part of the Awk series, we shall take a look at how you can filter text or strings using comparison operators. If you are a programmer then you must already be familiar with comparison operators but those who are not, let me explain in the section below. + +### What are Comparison operators in Awk? + +Comparison operators in Awk are used to compare the value of numbers or strings and they include the following: + +- `>` – greater than +- `<` – less than +- `>=` – greater than or equal to +- `<=` – less than or equal to +- `==` – equal to +- `!=` – not equal to +- `some_value ~ / pattern/` – true if some_value matches pattern +- `some_value !~ / pattern/` – true if some_value does not match pattern + +Now that we have looked at the various comparison operators in Awk, let us understand them better using an example. + +In this example, we have a file named food_list.txt which is a shopping list for different food items and I would like to flag food items whose quantity is less than or equal 20 by adding `(**)` at the end of each line. + +``` +File – food_list.txt +No Item_Name Quantity Price +1 Mangoes 45 $3.45 +2 Apples 25 $2.45 +3 Pineapples 5 $4.45 +4 Tomatoes 25 $3.45 +5 Onions 15 $1.45 +6 Bananas 30 $3.45 +``` + +The general syntax for using comparison operators in Awk is: + +``` +# expression { actions; } +``` + +To achieve the above goal, I will have to run the command below: + +``` +# awk '$3 <= 30 { printf "%s\t%s\n", $0,"**" ; } $3 > 30 { print $0 ;}' food_list.txt + +No Item_Name` Quantity Price +1 Mangoes 45 $3.45 +2 Apples 25 $2.45 ** +3 Pineapples 5 $4.45 ** +4 Tomatoes 25 $3.45 ** +5 Onions 15 $1.45 ** +6 Bananas 30 $3.45 ** +``` + +In the above example, there are two important things that happen: + +- The first expression `{ action ; }` combination, `$3 <= 30 { printf “%s\t%s\n”, $0,”**” ; }` prints out lines with quantity less than or equal to 30 and adds a `(**)` at the end of each line. The value of quantity is accessed using `$3` field variable. +- The second expression `{ action ; }` combination, `$3 > 30 { print $0 ;}` prints out lines unchanged since their quantity is greater then `30`. + +One more example: + +``` +# awk '$3 <= 20 { printf "%s\t%s\n", $0,"TRUE" ; } $3 > 20 { print $0 ;} ' food_list.txt + +No Item_Name Quantity Price +1 Mangoes 45 $3.45 +2 Apples 25 $2.45 +3 Pineapples 5 $4.45 TRUE +4 Tomatoes 25 $3.45 +5 Onions 15 $1.45 TRUE +6 Bananas 30 $3.45 +``` + +In this example, we want to indicate lines with quantity less or equal to 20 with the word (TRUE) at the end. + +### Summary + +This is an introductory tutorial to comparison operators in Awk, therefore you need to try out many other options and discover more. + +In case of any problems you face or any additions that you have in mind, then drop a comment in the comment section below. Remember to read the next part of the Awk series where I will take you through compound expressions. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/comparison-operators-in-awk/ + +作者:[Aaron Kili][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/aaronkili/ From a5ea2893858516b49edb3dd19194051df737522f Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 27 Jun 2016 22:13:37 +0800 Subject: [PATCH 0998/1469] =?UTF-8?q?20160627-5=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Compound Expressions with Awk in Linux.md | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 sources/tech/awk/Part 5 - How to Use Compound Expressions with Awk in Linux.md diff --git a/sources/tech/awk/Part 5 - How to Use Compound Expressions with Awk in Linux.md b/sources/tech/awk/Part 5 - How to Use Compound Expressions with Awk in Linux.md new file mode 100644 index 0000000000..f709dca1d7 --- /dev/null +++ b/sources/tech/awk/Part 5 - How to Use Compound Expressions with Awk in Linux.md @@ -0,0 +1,79 @@ +How to Use Compound Expressions with Awk in Linux +==================================================== + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Use-Compound-Expressions-with-Awk.png) + +All along, we have been looking at simple expressions when checking whether a condition has been meet or not. What if you want to use more then one expression to check for a particular condition in? + +In this article, we shall take a look at the how you can combine multiple expressions referred to as compound expressions to check for a condition when filtering text or strings. + +In Awk, compound expressions are built using the `&&` referred to as `(and)` and the `||` referred to as `(or)` compound operators. + +The general syntax for compound expressions is: + +``` +( first_expression ) && ( second_expression ) +``` + +Here, `first_expression` and `second_expression` must be true to make the whole expression true. + +``` +( first_expression ) || ( second_expression) +``` + +Here, one of the expressions either `first_expression` or `second_expression` must be true for the whole expression to be true. + +**Caution**: Remember to always include the parenthesis. + +The expressions can be built using the comparison operators that we looked at in Part 4 of the awk series. + +Let us now get a clear understanding using an example below: + +In this example, a have a text file named `tecmint_deals.txt`, which contains a list of some amazing random Tecmint deals, it includes the name of the deal, the price and type. + +``` +TecMint Deal List +No Name Price Type +1 Mac_OS_X_Cleanup_Suite $9.99 Software +2 Basics_Notebook $14.99 Lifestyle +3 Tactical_Pen $25.99 Lifestyle +4 Scapple $19.00 Unknown +5 Nano_Tool_Pack $11.99 Unknown +6 Ditto_Bluetooth_Altering_Device $33.00 Tech +7 Nano_Prowler_Mini_Drone $36.99 Tech +``` + +Say that we want only print and flag deals that are above $20 and of type “Tech” using the (**) sign at the end of each line. + +We shall need to run the command below. + +``` +# awk '($3 ~ /^\$[2-9][0-9]*\.[0-9][0-9]$/) && ($4=="Tech") { printf "%s\t%s\n",$0,"*"; } ' tecmint_deals.txt + +6 Ditto_Bluetooth_Altering_Device $33.00 Tech * +7 Nano_Prowler_Mini_Drone $36.99 Tech * +``` + +In this example, we have used two expressions in a compound expression: + +- First expression, `($3 ~ /^\$[2-9][0-9]*\.[0-9][0-9]$/)` ; checks the for lines with deals with price above `$20`, and it is only true if the value of $3 which is the price matches the pattern `/^\$[2-9][0-9]*\.[0-9][0-9]$/` +- And the second expression, `($4 == “Tech”)` ; checks whether the deal is of type “`Tech`” and it is only true if the value of `$4` equals to “`Tech`”. +Remember, a line will only be flagged with the `(**)`, if first expression and second expression are true as states the principle of the `&&` operator. + +### Summary + +Some conditions always require building compound expressions for you to match exactly what you want. When you understand the use of comparison and compound expression operators then, filtering text or strings based on some difficult conditions will become easy. + +Hope you find this guide useful and for any questions or additions, always remember to leave a comment and your concern will be solved accordingly. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/combine-multiple-expressions-in-awk/ + +作者:[Aaron Kili][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/aaronkili/ From e60381a49526a39d3d1fad177c023a8c83a943f9 Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 27 Jun 2016 22:18:11 +0800 Subject: [PATCH 0999/1469] =?UTF-8?q?20160627-6=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...to Use ‘next’ Command with Awk in Linux.md | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 sources/tech/awk/Part 6 - How to Use ‘next’ Command with Awk in Linux.md diff --git a/sources/tech/awk/Part 6 - How to Use ‘next’ Command with Awk in Linux.md b/sources/tech/awk/Part 6 - How to Use ‘next’ Command with Awk in Linux.md new file mode 100644 index 0000000000..f272dabcce --- /dev/null +++ b/sources/tech/awk/Part 6 - How to Use ‘next’ Command with Awk in Linux.md @@ -0,0 +1,76 @@ +How to Use ‘next’ Command with Awk in Linux +============================================= + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Use-next-Command-with-Awk-in-Linux.png) + +In this sixth part of Awk series, we shall look at using `next` command, which tells Awk to skip all remaining patterns and expressions that you have provided, but instead read the next input line. + +The `next` command helps you to prevent executing what I would refer to as time-wasting steps in a command execution. + +To understand how it works, let us consider a file called food_list.txt that looks like this: + +``` +Food List Items +No Item_Name Price Quantity +1 Mangoes $3.45 5 +2 Apples $2.45 25 +3 Pineapples $4.45 55 +4 Tomatoes $3.45 25 +5 Onions $1.45 15 +6 Bananas $3.45 30 +``` + +Consider running the following command that will flag food items whose quantity is less than or equal to 20 with a `(*)` sign at the end of each line: + +``` +# awk '$4 <= 20 { printf "%s\t%s\n", $0,"*" ; } $4 > 20 { print $0 ;} ' food_list.txt + +No Item_Name Price Quantity +1 Mangoes $3.45 5 * +2 Apples $2.45 25 +3 Pineapples $4.45 55 +4 Tomatoes $3.45 25 +5 Onions $1.45 15 * +6 Bananas $3.45 30 +``` + +The command above actually works as follows: + +- First, it checks whether the quantity, fourth field of each input line is less than or equal to 20, if a value meets that condition, it is printed and flagged with the `(*)` sign at the end using expression one: `$4 <= 20` +- Secondly, it checks if the fourth field of each input line is greater than 20, and if a line meets the condition it gets printed using expression two: `$4 > 20` + +But there is one problem here, when the first expression is executed, a line that we want to flag is printed using: `{ printf "%s\t%s\n", $0,"**" ; }` and then in the same step, the second expression is also checked which becomes a time wasting factor. + +So there is no need to execute the second expression, `$4 > 20` again after printing already flagged lines that have been printed using the first expression. + +To deal with this problem, you have to use the `next` command as follows: + +``` +# awk '$4 <= 20 { printf "%s\t%s\n", $0,"*" ; next; } $4 > 20 { print $0 ;} ' food_list.txt + +No Item_Name Price Quantity +1 Mangoes $3.45 5 * +2 Apples $2.45 25 +3 Pineapples $4.45 55 +4 Tomatoes $3.45 25 +5 Onions $1.45 15 * +6 Bananas $3.45 30 +``` + +After a single input line is printed using `$4 <= 20` `{ printf "%s\t%s\n", $0,"*" ; next ; }`, the `next` command included will help skip the second expression `$4 > 20` `{ print $0 ;}`, so execution goes to the next input line without having to waste time on checking whether the quantity is greater than 20. + +The next command is very important is writing efficient commands and where necessary, you can always use to speed up the execution of a script. Prepare for the next part of the series where we shall look at using standard input (STDIN) as input for Awk. + +Hope you find this how to guide helpful and you can as always put your thoughts in writing by leaving a comment in the comment section below. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/use-next-command-with-awk-in-linux/ + +作者:[Aaron Kili][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/aaronkili/ From 6f06fbb32b1fd3d2db0024adff7936f3b3fdae03 Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 27 Jun 2016 22:22:45 +0800 Subject: [PATCH 1000/1469] =?UTF-8?q?20160627-7=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...w to Read Awk Input from STDIN in Linux.md | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 sources/tech/awk/Part 7 - How to Read Awk Input from STDIN in Linux.md diff --git a/sources/tech/awk/Part 7 - How to Read Awk Input from STDIN in Linux.md b/sources/tech/awk/Part 7 - How to Read Awk Input from STDIN in Linux.md new file mode 100644 index 0000000000..5bcd4bc26c --- /dev/null +++ b/sources/tech/awk/Part 7 - How to Read Awk Input from STDIN in Linux.md @@ -0,0 +1,70 @@ +How to Read Awk Input from STDIN in Linux +============================================ + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Read-Awk-Input-from-STDIN.png) + +In the previous parts of the Awk tool series, we looked at reading input mostly from a file(s), but what if you want to read input from STDIN. +In this Part 7 of Awk series, we shall look at few examples where you can filter the output of other commands instead of reading input from a file. + +We shall start with the [dir utility][1] that works similar to [ls command][2], in the first example below, we use the output of `dir -l` command as input for Awk to print owner’s username, groupname and the files he/she owns in the current directory: + +``` +# dir -l | awk '{print $3, $4, $9;}' +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/06/List-Files-Owned-By-User-in-Directory.png) +>List Files Owned By User in Directory + +Take a look at another example where we [employ awk expressions][3], here, we want to print files owned by the root user by using an expression to filter strings as in the awk command below: + +``` +# dir -l | awk '$3=="root" {print $1,$3,$4, $9;} ' +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/06/List-Files-Owned-by-Root-User.png) +>List Files Owned by Root User + +The command above includes the `(==)` comparison operator to help us filter out files in the current directory which are owned by the root user. This is achieved using the expression `$3==”root”`. + +Let us look at another example of where we use a [awk comparison operator][4] to match a certain string. + +Here, we have used the [cat utility][5] to view the contents of a file named tecmint_deals.txt and we want to view the deals of type Tech only, so we shall run the following commands: + +``` +# cat tecmint_deals.txt +# cat tecmint_deals.txt | awk '$4 ~ /tech/{print}' +# cat tecmint_deals.txt | awk '$4 ~ /Tech/{print}' +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Use-Comparison-Operator-to-Match-String.png) +>Use Awk Comparison Operator to Match String + +In the example above, we have used the value `~ /pattern/` comparison operator, but there are two commands to try and bring out something very important. + +When you run the command with pattern tech nothing is printed out because there is no deal of that type, but with Tech, you get deals of type Tech. + +So always be careful when using this comparison operator, it is case sensitive as we have seen above. + +You can always use the output of another command instead as input for awk instead of reading input from a file, this is very simple as we have looked at in the examples above. + +Hope the examples were clear enough for you to understand, if you have any concerns, you can express them through the comment section below and remember to check the next part of the series where we shall look at awk features such as variables, numeric expressions and assignment operators. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/read-awk-input-from-stdin-in-linux/ + +作者:[Aaron Kili][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/aaronkili/ +[1]: http://www.tecmint.com/linux-dir-command-usage-with-examples/ +[2]: http://www.tecmint.com/15-basic-ls-command-examples-in-linux/ +[3]: http://www.tecmint.com/combine-multiple-expressions-in-awk +[4]: http://www.tecmint.com/comparison-operators-in-awk +[5]: http://www.tecmint.com/13-basic-cat-command-examples-in-linux/ + + + From ad29066aa4552701962a163adf795af6b00db1a8 Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 27 Jun 2016 22:23:41 +0800 Subject: [PATCH 1001/1469] =?UTF-8?q?20160627-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更新标题 --- ...k to Filter Text or Strings Using Pattern Specific Actions.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/tech/awk/{Part3 - How to Use Awk to Filter Text or Strings Using Pattern Specific Actions.md => Part 3 - How to Use Awk to Filter Text or Strings Using Pattern Specific Actions.md} (100%) diff --git a/sources/tech/awk/Part3 - How to Use Awk to Filter Text or Strings Using Pattern Specific Actions.md b/sources/tech/awk/Part 3 - How to Use Awk to Filter Text or Strings Using Pattern Specific Actions.md similarity index 100% rename from sources/tech/awk/Part3 - How to Use Awk to Filter Text or Strings Using Pattern Specific Actions.md rename to sources/tech/awk/Part 3 - How to Use Awk to Filter Text or Strings Using Pattern Specific Actions.md From 33f967bc7460efa92457f9808f5a9380b3d55669 Mon Sep 17 00:00:00 2001 From: wwy Date: Mon, 27 Jun 2016 22:59:11 +0800 Subject: [PATCH 1002/1469] [Translating] How to Use Awk and Regular Expressions to Filter Text or String in Files --- ...and Regular Expressions to Filter Text or String in Files.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/awk/Part 1 - How to Use Awk and Regular Expressions to Filter Text or String in Files.md b/sources/tech/awk/Part 1 - How to Use Awk and Regular Expressions to Filter Text or String in Files.md index 27aee1c0c7..6871673536 100644 --- a/sources/tech/awk/Part 1 - How to Use Awk and Regular Expressions to Filter Text or String in Files.md +++ b/sources/tech/awk/Part 1 - How to Use Awk and Regular Expressions to Filter Text or String in Files.md @@ -1,3 +1,5 @@ +translating by wwy-hust + How to Use Awk and Regular Expressions to Filter Text or String in Files ============================================================================= From ab1197b3e407a863546a0191c52d1e543657b8db Mon Sep 17 00:00:00 2001 From: "Cathon.ZHD" Date: Mon, 27 Jun 2016 23:00:26 +0800 Subject: [PATCH 1003/1469] Cathon is translating awk part 2 --- ...art 2 - How to Use Awk to Print Fields and Columns in File.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/awk/Part 2 - How to Use Awk to Print Fields and Columns in File.md b/sources/tech/awk/Part 2 - How to Use Awk to Print Fields and Columns in File.md index f4f38d727e..50212c7931 100644 --- a/sources/tech/awk/Part 2 - How to Use Awk to Print Fields and Columns in File.md +++ b/sources/tech/awk/Part 2 - How to Use Awk to Print Fields and Columns in File.md @@ -1,3 +1,4 @@ +[Cathon is translating] How to Use Awk to Print Fields and Columns in File ====================================================== From dc12db48abf2bd859c86071cdeefdea94c45fd5e Mon Sep 17 00:00:00 2001 From: vim-kakali <1799225723@qq.com> Date: Mon, 27 Jun 2016 23:00:44 +0800 Subject: [PATCH 1004/1469] vim-kakali translating --- .../awk/Part 7 - How to Read Awk Input from STDIN in Linux.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sources/tech/awk/Part 7 - How to Read Awk Input from STDIN in Linux.md b/sources/tech/awk/Part 7 - How to Read Awk Input from STDIN in Linux.md index 5bcd4bc26c..157716481a 100644 --- a/sources/tech/awk/Part 7 - How to Read Awk Input from STDIN in Linux.md +++ b/sources/tech/awk/Part 7 - How to Read Awk Input from STDIN in Linux.md @@ -1,3 +1,6 @@ +vim-kakali translating + + How to Read Awk Input from STDIN in Linux ============================================ From 3f20f559fdd8d2064995cfd1e2748a80fee9065b Mon Sep 17 00:00:00 2001 From: alim0x Date: Mon, 27 Jun 2016 23:06:15 +0800 Subject: [PATCH 1005/1469] [translating]How to permanently mount a Windows share on Linux --- ...0160624 How to permanently mount a Windows share on Linux.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160624 How to permanently mount a Windows share on Linux.md b/sources/tech/20160624 How to permanently mount a Windows share on Linux.md index 015bf5f231..30b2cf71f8 100644 --- a/sources/tech/20160624 How to permanently mount a Windows share on Linux.md +++ b/sources/tech/20160624 How to permanently mount a Windows share on Linux.md @@ -1,3 +1,5 @@ +alim0x translating + How to permanently mount a Windows share on Linux ================================================== From 873d1c5130554484d911b2c064f2aa2658ca4390 Mon Sep 17 00:00:00 2001 From: martin qi Date: Mon, 27 Jun 2016 10:21:52 -0500 Subject: [PATCH 1006/1469] translating (#4108) --- ...art 5 - How to Use Compound Expressions with Awk in Linux.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/awk/Part 5 - How to Use Compound Expressions with Awk in Linux.md b/sources/tech/awk/Part 5 - How to Use Compound Expressions with Awk in Linux.md index f709dca1d7..db9a863484 100644 --- a/sources/tech/awk/Part 5 - How to Use Compound Expressions with Awk in Linux.md +++ b/sources/tech/awk/Part 5 - How to Use Compound Expressions with Awk in Linux.md @@ -1,3 +1,5 @@ +martin + How to Use Compound Expressions with Awk in Linux ==================================================== From 998669fea344356d03cdbb27dcf46bf0b483ec90 Mon Sep 17 00:00:00 2001 From: Dongliang Mu Date: Mon, 27 Jun 2016 18:06:42 -0400 Subject: [PATCH 1007/1469] Update 20160218 What do Linux developers think of Git and GitHub.md --- ...20160218 What do Linux developers think of Git and GitHub.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160218 What do Linux developers think of Git and GitHub.md b/sources/tech/20160218 What do Linux developers think of Git and GitHub.md index 9002025820..c0de7f4e6a 100644 --- a/sources/tech/20160218 What do Linux developers think of Git and GitHub.md +++ b/sources/tech/20160218 What do Linux developers think of Git and GitHub.md @@ -1,3 +1,5 @@ +translated by mudongliang + What do Linux developers think of Git and GitHub? ===================================================== From b06ad99c39b63fa30b29708f0c70953ee63f9c26 Mon Sep 17 00:00:00 2001 From: Kevin Sicong Jiang Date: Mon, 27 Jun 2016 20:08:19 -0500 Subject: [PATCH 1008/1469] Update 20160516 Linux will be the major operating system of 21st century cars.md (#4109) [Translating] Linux will be the major operating system of 21st century cars --- ...ux will be the major operating system of 21st century cars.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/talk/20160516 Linux will be the major operating system of 21st century cars.md b/sources/talk/20160516 Linux will be the major operating system of 21st century cars.md index ec7a33aaa6..dbde68bda8 100644 --- a/sources/talk/20160516 Linux will be the major operating system of 21st century cars.md +++ b/sources/talk/20160516 Linux will be the major operating system of 21st century cars.md @@ -1,3 +1,4 @@ +KevinSJ Translating Linux will be the major operating system of 21st century cars =============================================================== From b9f9bcd95662ccd1fba2933ccced6203ef33536d Mon Sep 17 00:00:00 2001 From: Ezio Date: Tue, 28 Jun 2016 10:03:07 +0800 Subject: [PATCH 1009/1469] =?UTF-8?q?20160628-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ng is a File” and Types of Files in Linux.md | 275 ++++++++++++++++++ 1 file changed, 275 insertions(+) create mode 100644 sources/talk/20160615 Explanation of “Everything is a File” and Types of Files in Linux.md diff --git a/sources/talk/20160615 Explanation of “Everything is a File” and Types of Files in Linux.md b/sources/talk/20160615 Explanation of “Everything is a File” and Types of Files in Linux.md new file mode 100644 index 0000000000..3198183667 --- /dev/null +++ b/sources/talk/20160615 Explanation of “Everything is a File” and Types of Files in Linux.md @@ -0,0 +1,275 @@ +Explanation of “Everything is a File” and Types of Files in Linux +==================================================================== + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Everything-is-a-File-in-Linux.png) +>Everything is a File and Types of Files in Linux + +That is in fact true although it is just a generalization concept, in Unix and its derivatives such as Linux, everything is considered as a file. If something is not a file, then it must be running as a process on the system. + +To understand this, take for example the amount of space on your root (/) directory is always consumed by different types of Linux files. When you create a file or transfer a file to your system, it occupies some space on the physical disk and it is considered to be in a specific format (file type). + +And also the Linux system does not differentiate between files and directories, but directories do one important job, that is store other files in groups in a hierarchy for easy location. All your hardware components are represented as files and the system communicates with them using these files. + +The idea is an important description of a great property of Linux, where input/output resources such as your documents, directories (folders in Mac OS X and Windows), keyboard, monitor, hard-drives, removable media, printers, modems, virtual terminals and also inter-process and network communication are streams of bytes defined by file system space. + +A notable advantage of everything being a file is that the same set of Linux tools, utilities and APIs can be used on the above input/output resources. + +Although everything in Linux is a file, there are certain special files that are more than just a file for example [sockets and named pipes][1]. + +### What are the different types of files in Linux? + +In Linux there are basically three types of files: + +- Ordinary/Regular files +- Special files +- Directories + +#### Ordinary/Regular Files + +These are files data contain text, data or program instructions and they are the most common type of files you can expect to find on a Linux system and they include: + +- Readable files +- Binary files +- Image files +- Compressed files and so on. + +#### Special Files + +Special files include the following: + +Block files : These are device files that provide buffered access to system hardware components. They provide a method of communication with device drivers through the file system. + +One important aspect about block files is that they can transfer a large block of data and information at a given time. + +Listing block files sockets in a directory: + +``` +# ls -l /dev | grep "^b" +``` + +Sample Output + +``` +brw-rw---- 1 root disk 7, 0 May 18 10:26 loop0 +brw-rw---- 1 root disk 7, 1 May 18 10:26 loop1 +brw-rw---- 1 root disk 7, 2 May 18 10:26 loop2 +brw-rw---- 1 root disk 7, 3 May 18 10:26 loop3 +brw-rw---- 1 root disk 7, 4 May 18 10:26 loop4 +brw-rw---- 1 root disk 7, 5 May 18 10:26 loop5 +brw-rw---- 1 root disk 7, 6 May 18 10:26 loop6 +brw-rw---- 1 root disk 7, 7 May 18 10:26 loop7 +brw-rw---- 1 root disk 1, 0 May 18 10:26 ram0 +brw-rw---- 1 root disk 1, 1 May 18 10:26 ram1 +brw-rw---- 1 root disk 1, 10 May 18 10:26 ram10 +brw-rw---- 1 root disk 1, 11 May 18 10:26 ram11 +brw-rw---- 1 root disk 1, 12 May 18 10:26 ram12 +brw-rw---- 1 root disk 1, 13 May 18 10:26 ram13 +brw-rw---- 1 root disk 1, 14 May 18 10:26 ram14 +brw-rw---- 1 root disk 1, 15 May 18 10:26 ram15 +brw-rw---- 1 root disk 1, 2 May 18 10:26 ram2 +brw-rw---- 1 root disk 1, 3 May 18 10:26 ram3 +brw-rw---- 1 root disk 1, 4 May 18 10:26 ram4 +brw-rw---- 1 root disk 1, 5 May 18 10:26 ram5 +... +``` + +Character files : These are also device files that provide unbuffered serial access to system hardware components. They work by providing a way of communication with devices by transferring data one character at a time. + +Listing character files sockets in a directory: + +``` +# ls -l /dev | grep "^c" +``` + +Sample Output + +``` +crw------- 1 root root 10, 235 May 18 15:54 autofs +crw------- 1 root root 10, 234 May 18 15:54 btrfs-control +crw------- 1 root root 5, 1 May 18 10:26 console +crw------- 1 root root 10, 60 May 18 10:26 cpu_dma_latency +crw------- 1 root root 10, 203 May 18 15:54 cuse +crw------- 1 root root 10, 61 May 18 10:26 ecryptfs +crw-rw---- 1 root video 29, 0 May 18 10:26 fb0 +crw-rw-rw- 1 root root 1, 7 May 18 10:26 full +crw-rw-rw- 1 root root 10, 229 May 18 10:26 fuse +crw------- 1 root root 251, 0 May 18 10:27 hidraw0 +crw------- 1 root root 10, 228 May 18 10:26 hpet +crw-r--r-- 1 root root 1, 11 May 18 10:26 kmsg +crw-rw----+ 1 root root 10, 232 May 18 10:26 kvm +crw------- 1 root root 10, 237 May 18 10:26 loop-control +crw------- 1 root root 10, 227 May 18 10:26 mcelog +crw------- 1 root root 249, 0 May 18 10:27 media0 +crw------- 1 root root 250, 0 May 18 10:26 mei0 +crw-r----- 1 root kmem 1, 1 May 18 10:26 mem +crw------- 1 root root 10, 57 May 18 10:26 memory_bandwidth +crw------- 1 root root 10, 59 May 18 10:26 network_latency +crw------- 1 root root 10, 58 May 18 10:26 network_throughput +crw-rw-rw- 1 root root 1, 3 May 18 10:26 null +crw-r----- 1 root kmem 1, 4 May 18 10:26 port +crw------- 1 root root 108, 0 May 18 10:26 ppp +crw------- 1 root root 10, 1 May 18 10:26 psaux +crw-rw-rw- 1 root tty 5, 2 May 18 17:40 ptmx +crw-rw-rw- 1 root root 1, 8 May 18 10:26 random +``` + +Symbolic link files : A symbolic link is a reference to another file on the system. Therefore, symbolic link files are files that point to other files, and they can either be directories or regular files. + +Listing symbolic link sockets in a directory: + +``` +# ls -l /dev/ | grep "^l" +``` + +Sample Output + +``` +lrwxrwxrwx 1 root root 3 May 18 10:26 cdrom -> sr0 +lrwxrwxrwx 1 root root 11 May 18 15:54 core -> /proc/kcore +lrwxrwxrwx 1 root root 13 May 18 15:54 fd -> /proc/self/fd +lrwxrwxrwx 1 root root 4 May 18 10:26 rtc -> rtc0 +lrwxrwxrwx 1 root root 8 May 18 10:26 shm -> /run/shm +lrwxrwxrwx 1 root root 15 May 18 15:54 stderr -> /proc/self/fd/2 +lrwxrwxrwx 1 root root 15 May 18 15:54 stdin -> /proc/self/fd/0 +lrwxrwxrwx 1 root root 15 May 18 15:54 stdout -> /proc/self/fd/1 +``` + +You can make symbolic links using the `ln` utility in Linux as in the example below. + +``` +# touch file1.txt +# ln -s file1.txt /home/tecmint/file1.txt [create symbolic link] +# ls -l /home/tecmint/ | grep "^l" [List symbolic links] +``` + +In the above example, I created a file called `file1.txt` in `/tmp` directory, then created the symbolic link, `/home/tecmint/file1.txt` to point to `/tmp/file1.txt`. + +Pipes or Named pipes : These are files that allow inter-process communication by connecting the output of one process to the input of another. + +A named pipe is actually a file that is used by two process to communicate with each and it acts as a Linux pipe. + +Listing pipes sockets in a directory: + +``` +# ls -l | grep "^p" +``` + +Sample Output + +``` +prw-rw-r-- 1 tecmint tecmint 0 May 18 17:47 pipe1 +prw-rw-r-- 1 tecmint tecmint 0 May 18 17:47 pipe2 +prw-rw-r-- 1 tecmint tecmint 0 May 18 17:47 pipe3 +prw-rw-r-- 1 tecmint tecmint 0 May 18 17:47 pipe4 +prw-rw-r-- 1 tecmint tecmint 0 May 18 17:47 pipe5 +``` + +You can use the mkfifo utility to create a named pipe in Linux as follows. + +``` +# mkfifo pipe1 +# echo "This is named pipe1" > pipe1 +``` + +In the above example, I created a named pipe called pipe1, then I passed some data to it using the [echo command][2], after that the shell became un-interactive while processing the input. + +Then I opened another shell and run the another command to print out what was passed to pipe. + +``` +# while read line ;do echo "This was passed-'$line' "; done Date: Tue, 28 Jun 2016 10:19:57 +0800 Subject: [PATCH 1010/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E4=B8=AD=20by=20ru?= =?UTF-8?q?nningwater?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...on of “Everything is a File” and Types of Files in Linux.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/talk/20160615 Explanation of “Everything is a File” and Types of Files in Linux.md b/sources/talk/20160615 Explanation of “Everything is a File” and Types of Files in Linux.md index 3198183667..e1c3ee4661 100644 --- a/sources/talk/20160615 Explanation of “Everything is a File” and Types of Files in Linux.md +++ b/sources/talk/20160615 Explanation of “Everything is a File” and Types of Files in Linux.md @@ -1,3 +1,4 @@ +(翻译中 by runningwater) Explanation of “Everything is a File” and Types of Files in Linux ==================================================================== @@ -265,7 +266,7 @@ You can add more to this by reading more about the individual file types and the via: http://www.tecmint.com/explanation-of-everything-is-a-file-and-types-of-files-in-linux/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tecmint+%28Tecmint%3A+Linux+Howto%27s+Guide%29 作者:[Aaron Kili][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/) 荣誉推出 From 3ed2496be424e0d0dd449bce37e9e705dd16506e Mon Sep 17 00:00:00 2001 From: "Cathon.ZHD" Date: Tue, 28 Jun 2016 11:39:49 +0800 Subject: [PATCH 1011/1469] translated --- ...Awk to Print Fields and Columns in File.md | 107 ------------------ ...Awk to Print Fields and Columns in File.md | 106 +++++++++++++++++ 2 files changed, 106 insertions(+), 107 deletions(-) delete mode 100644 sources/tech/awk/Part 2 - How to Use Awk to Print Fields and Columns in File.md create mode 100644 translated/tech/Part 2 - How to Use Awk to Print Fields and Columns in File.md diff --git a/sources/tech/awk/Part 2 - How to Use Awk to Print Fields and Columns in File.md b/sources/tech/awk/Part 2 - How to Use Awk to Print Fields and Columns in File.md deleted file mode 100644 index 50212c7931..0000000000 --- a/sources/tech/awk/Part 2 - How to Use Awk to Print Fields and Columns in File.md +++ /dev/null @@ -1,107 +0,0 @@ -[Cathon is translating] -How to Use Awk to Print Fields and Columns in File -====================================================== - -In this part of our Linux Awk command series, we shall have a look at one of the most important features of Awk, which is field editing. - -It is good to know that Awk automatically divides input lines provided to it into fields, and a field can be defined as a set of characters that are separated from other fields by an internal field separator. - -![](http://www.tecmint.com/wp-content/uploads/2016/04/Awk-Print-Fields-and-Columns.png) ->Awk Print Fields and Columns - -If you are familiar with the Unix/Linux or do [bash shell programming][1], then you should know what internal field separator (IFS) variable is. The default IFS in Awk are tab and space. - -This is how the idea of field separation works in Awk: when it encounters an input line, according to the IFS defined, the first set of characters is field one, which is accessed using $1, the second set of characters is field two, which is accessed using $2, the third set of characters is field three, which is accessed using $3 and so forth till the last set of character(s). - -To understand this Awk field editing better, let us take a look at the examples below: - -**Example 1**: I have created a text file called tecmintinfo.txt. - -``` -# vi tecmintinfo.txt -# cat tecmintinfo.txt -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/04/Create-File-in-Linux.png) ->Create File in Linux - -Then from the command line, I try to print the first, second and third fields from the file tecmintinfo.txt using the command below: - -``` -$ awk '//{print $1 $2 $3 }' tecmintinfo.txt -TecMint.comisthe -``` - -From the output above, you can see that the characters from the first three fields are printed based on the IFS defined which is space: - -- Field one which is “TecMint.com” is accessed using `$1`. -- Field two which is “is” is accessed using `$2`. -- Field three which is “the” is accessed using `$3`. - -If you have noticed in the printed output, the field values are not separated and this is how print behaves by default. - -To view the output clearly with space between the field values, you need to add (,) operator as follows: - -``` -$ awk '//{print $1, $2, $3; }' tecmintinfo.txt - -TecMint.com is the -``` - -One important thing to note and always remember is that the use of `($)` in Awk is different from its use in shell scripting. - -Under shell scripting `($)` is used to access the value of variables while in Awk `($)` it is used only when accessing the contents of a field but not for accessing the value of variables. - -**Example 2**: Let us take a look at one other example using a file which contains multiple lines called my_shoping.list. - -``` -No Item_Name Unit_Price Quantity Price -1 Mouse #20,000 1 #20,000 -2 Monitor #500,000 1 #500,000 -3 RAM_Chips #150,000 2 #300,000 -4 Ethernet_Cables #30,000 4 #120,000 -``` - -Say you wanted to only print `Unit_Price` of each item on the shopping list, you will need to run the command below: - -``` -$ awk '//{print $2, $3 }' my_shopping.txt - -Item_Name Unit_Price -Mouse #20,000 -Monitor #500,000 -RAM_Chips #150,000 -Ethernet_Cables #30,000 -``` - -Awk also has a `printf` command that helps you to format your output is a nice way as you can see the above output is not clear enough. - -Using `printf` to format output of the Item_Name and Unit_Price: - -``` -$ awk '//{printf "%-10s %s\n",$2, $3 }' my_shopping.txt - -Item_Name Unit_Price -Mouse #20,000 -Monitor #500,000 -RAM_Chips #150,000 -Ethernet_Cables #30,000 -``` - -### Summary -Field editing is very important when using Awk to filter text or strings, it helps you get particular data in columns in a list. And always remember that the use of `($)` operator in Awk is different from that in shell scripting. - -I hope the article was helpful to you and for any additional information required or questions, you can post a comment in the comment section. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/awk-print-fields-columns-with-space-separator/ - -作者:[Aaron Kili][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/aaronkili/ -[1]: http://www.tecmint.com/category/bash-shell/ diff --git a/translated/tech/Part 2 - How to Use Awk to Print Fields and Columns in File.md b/translated/tech/Part 2 - How to Use Awk to Print Fields and Columns in File.md new file mode 100644 index 0000000000..c0b526b925 --- /dev/null +++ b/translated/tech/Part 2 - How to Use Awk to Print Fields and Columns in File.md @@ -0,0 +1,106 @@ +如何使用 Awk 输出文本中的字段和列 +====================================================== + +在 Awk 系列的这一节中,我们将看到 Awk 最重要的特性之一,字段编辑。 + +需要知道的是,Awk 能够自动将输入的行,分隔为若干字段。每一个字段就是一组字符,它们和其他的字段由一个内部字段分隔符分隔开来。 + +![](http://www.tecmint.com/wp-content/uploads/2016/04/Awk-Print-Fields-and-Columns.png) +>Awk Print Fields and Columns + +如果你熟悉 Unix/Linux 或者使用 [bash 脚本][1]编过程,那么你应该知道什么是内部字段分隔符(IFS)变量。Awk 中默认的 IFS 是制表符和空格。 + +Awk 中的字段分隔符的工作流程如下:当读到一行输入时,将它按照指定的 IFS 分割为不同字段,第一组字符就是字段一,可以通过 $1 来访问,第二组字符就是字段二,可以通过 $2 来访问,第三组字符就是字段三,可以通过 $3 来访问,以此类推,直到最后一组字符。 + +为了更好地理解 Awk 的字段编辑,让我们看一个下面的例子: + +**例 1**:我创建了一个名为 tecmintinfo.txt 的文本文件。 + +``` +# vi tecmintinfo.txt +# cat tecmintinfo.txt +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/04/Create-File-in-Linux.png) +>在 Linux 上创建一个文件 + +然后在命令行中,我试着使用下面的命令从文本 tecmintinfo.txt 中输出第一个,第二个,以及第三个字段。 + +``` +$ awk '//{print $1 $2 $3 }' tecmintinfo.txt +TecMint.comisthe +``` + +从上面的输出中你可以看到,前三个字段的字符是以空格为分隔符输出的: + +- 字段一是 “TecMint.com”,可以通过 `$1` 来访问。 +- 字段二是 “is”,可以通过 `$2` 来访问。 +- 字段三是 “the”,可以通过 `$3` 来访问。 + +如果你注意观察输出的话可以发现,输出的字段值并没有被分隔开,这是 print 函数默认的行为。 + +为了使输出看得更清楚,输出的字段值之间使用空格分开,你需要添加 (,) 操作符。 + +``` +$ awk '//{print $1, $2, $3; }' tecmintinfo.txt + +TecMint.com is the +``` + +需要记住而且非常重要的是,`($)` 在 Awk 和在 shell 脚本中的使用是截然不同的! + +在 shell 脚本中,`($)` 被用来获取变量的值。而在 Awk 中,`($)` 只有在获取字段的值时才会用到,不能用于获取变量的值。 + +**例 2**:让我们再看一个例子,用到了一个名为 my_shoping.list 的包含多行的文件。 +``` +No Item_Name Unit_Price Quantity Price +1 Mouse #20,000 1 #20,000 +2 Monitor #500,000 1 #500,000 +3 RAM_Chips #150,000 2 #300,000 +4 Ethernet_Cables #30,000 4 #120,000 +``` + +如果你只想输出购物清单上每一个物品的`单价`,你只需运行下面的命令: + +``` +$ awk '//{print $2, $3 }' my_shopping.txt + +Item_Name Unit_Price +Mouse #20,000 +Monitor #500,000 +RAM_Chips #150,000 +Ethernet_Cables #30,000 +``` + +可以看到上面的输出不够清晰,Awk 还有一个 `printf` 的命令,可以帮助你将输出格式化。 + +使用 `printf` 来格式化 Item_Name 和 Unit_Price 的输出: + +``` +$ awk '//{printf "%-10s %s\n",$2, $3 }' my_shopping.txt + +Item_Name Unit_Price +Mouse #20,000 +Monitor #500,000 +RAM_Chips #150,000 +Ethernet_Cables #30,000 +``` + +### 总结 + +使用 Awk 过滤文本或字符串时,字段编辑的功能是非常重要的。它能够帮助你从一个表的数据中得到特定的列。一定要记住的是,Awk 中 `($)` 操作符的用法与其在 shell 脚本中的用法是不同的! + +希望这篇文章对您有所帮助。如有任何疑问,可以在评论区域发表评论。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/awk-print-fields-columns-with-space-separator/ + +作者:[Aaron Kili][a] +译者:[Cathon](https://github.com/Cathon) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.tecmint.com/author/aaronkili/ +[1]: http://www.tecmint.com/category/bash-shell/ From 79fe28f60e4d1674de25b82d1c7e0b0eeb7b49f5 Mon Sep 17 00:00:00 2001 From: Ezio Date: Tue, 28 Jun 2016 13:09:03 +0800 Subject: [PATCH 1012/1469] =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E5=88=B0awk?= =?UTF-8?q?=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Part 2 - How to Use Awk to Print Fields and Columns in File.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename translated/tech/{ => awk}/Part 2 - How to Use Awk to Print Fields and Columns in File.md (100%) diff --git a/translated/tech/Part 2 - How to Use Awk to Print Fields and Columns in File.md b/translated/tech/awk/Part 2 - How to Use Awk to Print Fields and Columns in File.md similarity index 100% rename from translated/tech/Part 2 - How to Use Awk to Print Fields and Columns in File.md rename to translated/tech/awk/Part 2 - How to Use Awk to Print Fields and Columns in File.md From 7c97b53cf24884a53f7c0e74aa3aa49a7f07c12e Mon Sep 17 00:00:00 2001 From: Louis Wei Date: Tue, 28 Jun 2016 13:33:53 +0800 Subject: [PATCH 1013/1469] translating by wi-cuckoo --- ...ol Flow and Loops to Write and Tune Shell Scripts – Part 2.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160601 Learn Python Control Flow and Loops to Write and Tune Shell Scripts – Part 2.md b/sources/tech/20160601 Learn Python Control Flow and Loops to Write and Tune Shell Scripts – Part 2.md index bcce4c143e..6a65df8d49 100644 --- a/sources/tech/20160601 Learn Python Control Flow and Loops to Write and Tune Shell Scripts – Part 2.md +++ b/sources/tech/20160601 Learn Python Control Flow and Loops to Write and Tune Shell Scripts – Part 2.md @@ -1,3 +1,4 @@ +translating by wi-cuckoo Learn Python Control Flow and Loops to Write and Tune Shell Scripts – Part 2 =============================================================================== From f9c2c5705cbc4a73b9daa01ca7e7eea0fe7f5464 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 28 Jun 2016 15:56:56 +0800 Subject: [PATCH 1014/1469] PUB:20160605 How to Add Cron Jobs in Linux and Unix @mr-ping @FSSlc --- ... How to Add Cron Jobs in Linux and Unix.md | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) rename {translated/tech => published}/20160605 How to Add Cron Jobs in Linux and Unix.md (76%) diff --git a/translated/tech/20160605 How to Add Cron Jobs in Linux and Unix.md b/published/20160605 How to Add Cron Jobs in Linux and Unix.md similarity index 76% rename from translated/tech/20160605 How to Add Cron Jobs in Linux and Unix.md rename to published/20160605 How to Add Cron Jobs in Linux and Unix.md index 0b5ee53439..139084225a 100644 --- a/translated/tech/20160605 How to Add Cron Jobs in Linux and Unix.md +++ b/published/20160605 How to Add Cron Jobs in Linux and Unix.md @@ -19,9 +19,9 @@ - **UNIX 或 Linux 系统的 crontab** : 此类型通常由那些需要 root 或类似权限的系统服务和重要任务使用。第六个字段(见下方的字段介绍)为用户名,用来指定此命令以哪个用户身份来执行。如此一来,系统的 `crontab` 就能够以任意用户的身份来执行操作。 -- **用户的 crontab**: 用户可以使用 `corntab` 命令来安装属于他们自己的定时任务。 第六个字段为需要运行的命令, 所有的命令都会以创建该 crontab 任务的用户的身份运行。 +- **用户的 crontab**: 用户可以使用 `crontab` 命令来安装属于他们自己的定时任务。 第六个字段为需要运行的命令, 所有的命令都会以创建该 crontab 任务的用户的身份运行。 -**注意**: 这种问答形式的 `Cron` 实现由 Paul Vixie 所写,并且被包含在许多 [Linux][2] 发行版本和类 Unix 系统(如广受欢迎的第四版 BSD)中。它的语法被各种 crond 的实现所[兼容][3]。 +**注意**: 这种问答形式的 `Cron` 实现由 Paul Vixie 所编写,并且被包含在许多 [Linux][2] 发行版本和类 Unix 系统(如广受欢迎的第四版 BSD)中。它的语法被各种 crond 的实现所[兼容][3]。 那么我该如何安装、创建或者编辑我自己的定时任务呢? @@ -47,24 +47,24 @@ $ crontab -e 其中: -- 1: 分钟 (0-59) -- 2: 小时 (0-23) -- 3: 日期 (0-31) -- 4: 月份 (0-12 [12 代表 December]) -- 5: 一周当中的某天 (0-7 [7 或 0 代表星期天]) -- /path/to/command – 计划执行的脚本或命令的名称 +- 第1个字段:分钟 (0-59) +- 第2个字段:小时 (0-23) +- 第3个字段:日期 (0-31) +- 第4个字段:月份 (0-12 [12 代表 December]) +- 第5个字段:一周当中的某天 (0-7 [7 或 0 代表星期天]) +- /path/to/command - 计划执行的脚本或命令的名称 便于记忆的格式: ``` * * * * * 要执行的命令 -– – – – – +---------------- | | | | | -| | | | —– 一周当中的某天 (0 – 7) (周日为 0 或 7) -| | | ——- 月份 (1 – 12) -| | ——— 一月当中的某天 (1 – 31) -| ———– 小时 (0 – 23) -————- 分钟 (0 – 59) +| | | | ---- 周当中的某天 (0 - 7) (周日为 0 或 7) +| | | ------ 月份 (1 - 12) +| | -------- 一月当中的某天 (1 - 31) +| ---------- 小时 (0 - 23) +------------ 分钟 (0 - 59) ``` 简单的 `crontab` 示例: @@ -90,13 +90,13 @@ $ crontab -e - **逗号 (,)** : 这个操作符指定了一个包含多个值的列表,例如:`1,5,10,15,20,25`. -- **横杠 (–)** : 此操作符指定了一个值的范围,例如:`5-15` ,等同于使用逗号操作符键入的 `5,6,7,8,9,….,13,14,15`。 +- **横杠 (-)** : 此操作符指定了一个值的范围,例如:`5-15` ,等同于使用逗号操作符键入的 `5,6,7,8,9,...,13,14,15`。 - **分隔符 (/)** : 此操作符指定了一个步进值,例如: `0-23/` 可以用于小时字段来指定某个命令每小时被执行一次。步进值也可以跟在星号操作符后边,如果你希望命令行每 2 小时执行一次,则可以使用 `*/2`。 ### 如何禁用邮件输出 -默认情况下,某个命令或者脚本的输出内容(如果有的话)会发送到你的本地邮箱账户中。若想停止收到 `crontab` 发送的邮件,需要添加 `>/dev/null 2>&1` 这段内容,例如: +默认情况下,某个命令或者脚本的输出内容(如果有的话)会发送到你的本地邮箱账户中。若想停止收到 `crontab` 发送的邮件,需要添加 `>/dev/null 2>&1` 这段内容到执行的命令的后面,例如: ``` 0 3 * * * /root/backup.sh >/dev/null 2>&1 @@ -133,9 +133,9 @@ crontab -r crontab -r -u username ``` -### 使用特殊字符来节省时间 +### 使用特殊字符串来节省时间 -你可以使用以下 8 个特殊字符中的其中一个替代头五个字段,这样不但可以节省你的时间,还可以提高可读性。 +你可以使用以下 8 个特殊字符串中的其中一个替代头五个字段,这样不但可以节省你的时间,还可以提高可读性。 特殊字符 |含义 |:-- |:-- @@ -158,9 +158,9 @@ crontab -r -u username ### 关于 `/etc/crontab` 文件和 `/etc/cron.d/*` 目录的更多内容 -** /etc/crontab ** 是系统的 corntabs 文件。通常只被 root 用户或守护进程用于配置系统级别的任务。每个独立的用户必须像上面介绍的那样使用 `corntab` 命令来安装和编辑自己的任务。`/var/spool/cron/` 或者 `/var/cron/tabs/` 目录存放了个人用户的 corntab 文件,它必定会备份在用户的家目录当中。 +** /etc/crontab ** 是系统的 crontab 文件。通常只被 root 用户或守护进程用于配置系统级别的任务。每个独立的用户必须像上面介绍的那样使用 `crontab` 命令来安装和编辑自己的任务。`/var/spool/cron/` 或者 `/var/cron/tabs/` 目录存放了个人用户的 crontab 文件,它必定会备份在用户的家目录当中。 -### 理解默认的 `/etc/crontab` 文件 +###理解默认的 `/etc/crontab` 文件 典型的 `/etc/crontab` 文件内容是这样的: @@ -176,9 +176,9 @@ HOME=/ 42 4 1 * * root run-parts /etc/cron.monthly ``` -首先,环境变量必须被定义。如果 shell 行被忽略,corn 会使用默认的 sh shell。如果 PATH 变量被忽略,就没有默认路径会被使用,所有的文件都需要使用绝对路径来定位。如果 HOME 变量被忽略,corn 会使用调用者(用户)的家目录。 +首先,环境变量必须被定义。如果 SHELL 行被忽略,cron 会使用默认的 sh shell。如果 PATH 变量被忽略,就没有默认的搜索路径,所有的文件都需要使用绝对路径来定位。如果 HOME 变量被忽略,cron 会使用调用者(用户)的家目录替代。 -另外,corn 会读取 `/etc/cron.d/`目录中的文件。通常情况下,像 sa-update 或者 sysstat 这样的系统守护进程会将他们的定时任务存放在此处。作为 root 用户或者超级用户,你可以使用以下目录来配置你的定时任务。你可以直接将脚本放到这里。`run-parts`命令会通过 `/etc/crontab` 文件来运行位于某个目录中的脚本或者程序。 +另外,cron 会读取 `/etc/cron.d/`目录中的文件。通常情况下,像 sa-update 或者 sysstat 这样的系统守护进程会将他们的定时任务存放在此处。作为 root 用户或者超级用户,你可以使用以下目录来配置你的定时任务。你可以直接将脚本放到这里。`run-parts`命令会通过 `/etc/crontab` 文件来运行位于某个目录中的脚本或者程序。 目录 |描述 |:-- |:-- @@ -198,7 +198,7 @@ HOME=/ -------------------------------------------------------------------------------- -via: https://www.unixmen.com/add-cron-jobs-linux-unix/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+unixmenhowtos+%28Unixmen+Howtos+%26+Tutorials%29 +via: https://www.unixmen.com/add-cron-jobs-linux-unix/ 作者:[Duy NguyenViet][a] 译者:[mr-ping](https://github.com/mr-ping) From b2190e70927dfb7d39fe949b43f88bc7a6d1fe12 Mon Sep 17 00:00:00 2001 From: flankershen Date: Tue, 28 Jun 2016 16:31:25 +0800 Subject: [PATCH 1015/1469] =?UTF-8?q?=E7=94=B3=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 申领 --- ...ginx as Reverse Proxy on Centos7 CPanel.md | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/sources/tech/20160218 How to Set Nginx as Reverse Proxy on Centos7 CPanel.md b/sources/tech/20160218 How to Set Nginx as Reverse Proxy on Centos7 CPanel.md index ba986b25b3..7e0c87cd80 100644 --- a/sources/tech/20160218 How to Set Nginx as Reverse Proxy on Centos7 CPanel.md +++ b/sources/tech/20160218 How to Set Nginx as Reverse Proxy on Centos7 CPanel.md @@ -1,3 +1,9 @@ + + +【flankershen翻译中】 + + + How to Set Nginx as Reverse Proxy on Centos7 CPanel ================================================================================ @@ -22,9 +28,9 @@ First of all, we need to install the EPEL repo to start-up with the process. --> Running transaction check ---> Package epel-release.noarch 0:7-5 will be installed --> Finished Dependency Resolution - + Dependencies Resolved - + =============================================================================================================================================== Package Arch Version Repository Size =============================================================================================================================================== @@ -42,9 +48,9 @@ First of all, we need to install the EPEL repo to start-up with the process. --> Running transaction check ---> Package nDeploy-release-centos.noarch 0:1.0-1 will be installed --> Finished Dependency Resolution - + Dependencies Resolved - + =============================================================================================================================================== Package Arch Version Repository Size =============================================================================================================================================== @@ -61,9 +67,9 @@ First of all, we need to install the EPEL repo to start-up with the process. (1/4): ndeploy/7/x86_64/primary_db | 14 kB 00:00:00 (2/4): epel/x86_64/group_gz | 169 kB 00:00:00 (3/4): epel/x86_64/primary_db | 3.7 MB 00:00:02 - + Dependencies Resolved - + =============================================================================================================================================== Package Arch Version Repository Size =============================================================================================================================================== @@ -76,7 +82,7 @@ First of all, we need to install the EPEL repo to start-up with the process. memcached x86_64 1.4.15-9.el7 base 84 k python-inotify noarch 0.9.4-4.el7 base 49 k python-lxml x86_64 3.2.1-4.el7 base 758 k - + Transaction Summary =============================================================================================================================================== Install 2 Packages (+5 Dependent packages) @@ -87,7 +93,7 @@ With these steps, we've completed with the installation of Nginx plugin in our s root@server1 [/usr]# /opt/nDeploy/scripts/cpanel-nDeploy-setup.sh enable Modifying apache http and https port in cpanel - + httpd restarted successfully. Created symlink from /etc/systemd/system/multi-user.target.wants/nginx.service to /usr/lib/systemd/system/nginx.service. Created symlink from /etc/systemd/system/multi-user.target.wants/ndeploy_watcher.service to /usr/lib/systemd/system/ndeploy_watcher.service. @@ -107,7 +113,7 @@ As you can see these script will modify the Apache port from 80 to another port Main PID: 24760 (httpd) CGroup: /system.slice/httpd.service ‣ 24760 /usr/local/apache/bin/httpd -k start - + Jan 18 06:34:23 server1.centos7-test.com systemd[1]: Starting Apache Web Server... Jan 18 06:34:23 server1.centos7-test.com apachectl[25606]: httpd (pid 24760) already running Jan 18 06:34:23 server1.centos7-test.com systemd[1]: Started Apache Web Server. @@ -125,7 +131,7 @@ As you can see these script will modify the Apache port from 80 to another port ├─25473 nginx: worker process ├─25474 nginx: worker process └─25475 nginx: cache manager process - + Jan 17 17:18:29 server1.centos7-test.com systemd[1]: Starting nginx-nDeploy - high performance web server... Jan 17 17:18:29 server1.centos7-test.com nginx[3804]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok Jan 17 17:18:29 server1.centos7-test.com nginx[3804]: nginx: configuration file /etc/nginx/nginx.conf test is successful @@ -157,14 +163,14 @@ The virtualhost entries created for the existing users as located in the folder listen 45.79.183.73:80; #CPIPVSIX:80; - + # ServerNames server_name saheetha.com www.saheetha.com; access_log /usr/local/apache/domlogs/saheetha.com main; access_log /usr/local/apache/domlogs/saheetha.com-bytes_log bytes_log; - + include /etc/nginx/sites-enabled/saheetha.com.include; - + } We can confirm the working of the web server status by calling a website in the browser. Please see the web server information on my server after the installation. @@ -198,4 +204,4 @@ via: http://linoxide.com/linux-how-to/set-nginx-reverse-proxy-centos-7-cpanel/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://linoxide.com/author/saheethas/ +[a]: http://linoxide.com/author/saheethas/ From 5b7e6604092c38ebad6a1a528f006c6c9ed27304 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 28 Jun 2016 17:14:24 +0800 Subject: [PATCH 1016/1469] PUB:20160518 Android Use Apps Even Without Installing Them @alim0x @carolinewuyan --- ...d Use Apps Even Without Installing Them.md | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) rename {translated/talk => published}/20160518 Android Use Apps Even Without Installing Them.md (68%) diff --git a/translated/talk/20160518 Android Use Apps Even Without Installing Them.md b/published/20160518 Android Use Apps Even Without Installing Them.md similarity index 68% rename from translated/talk/20160518 Android Use Apps Even Without Installing Them.md rename to published/20160518 Android Use Apps Even Without Installing Them.md index a8aecc1d19..40cf217035 100644 --- a/translated/talk/20160518 Android Use Apps Even Without Installing Them.md +++ b/published/20160518 Android Use Apps Even Without Installing Them.md @@ -3,23 +3,23 @@ 谷歌安卓的一项新创新将可以让你无需安装即可在你的设备上使用应用程序。现在已经初具雏形。 -还记得那时候吗,某人发给你了一个链接,要求你通过安装来查看应用。 +还记得那时候吗,某人发给你了一个链接,要求你通过安装一个应用才能查看。 -是否要安装这个应用来查看一个一次性的链接,这种进退两难的选择一定让你感到很沮丧。而且,应用安装本身也会消耗你不少宝贵的时间。 +是否要安装这个应用就为了看一下链接,这种进退两难的选择一定让你感到很沮丧。而且,安装应用这个事也会消耗你不少宝贵的时间。 -上述场景可能大多数人都经历过,或者说大多数现代科技用户都经历过。尽管如此,我们都接受这是正确且合理的过程。 +上述场景可能大多数人都经历过,或者说大多数现代科技用户都经历过。尽管如此,我们都接受,认为这是天经地义的事情。 事实真的如此吗? -针对这个问题谷歌的安卓部门给出了一个全新的,开箱即用的答案: +针对这个问题谷歌的安卓部门给出了一个全新的、开箱即用的答案: -### Android Instant Apps +### Android Instant Apps (AIA) -Android Instant Apps 声称第一时间帮你摆脱这样的两难境地,让你简单地点击链接(见打开链接的示例)然后直接开始使用这个应用。 +Android Instant Apps 声称可以从一开始就帮你摆脱这样的两难境地,让你简单地点击链接(见打开链接的示例)然后直接开始使用这个应用。 -另一个真实生活场景的例子,如果你想停车但是没有停车码表的配对应用,有了 Instant Apps 在这种情况下就方便多了。 +另一个真实生活场景的例子,如果你想停车但是没有停车码表的相应应用,有了 Instant Apps 在这种情况下就方便多了。 -根据谷歌的信息,你可以简单地将你的手机和码表触碰,停车应用就会直接显示在你的屏幕上,并且准备就绪可以使用。 +根据谷歌提供的信息,你可以简单地将你的手机和码表触碰,停车应用就会直接显示在你的屏幕上,并且准备就绪可以使用。 #### 它是怎么工作的? @@ -30,21 +30,25 @@ Instant Apps 和你已经熟悉的应用基本相同,只有一个不同—— 这样应用就可以快速打开,让你可以完成你的目标任务。 ![](http://www.iwillfolo.com/wordpress/wp-content/uploads/2016/05/AIA-demo.jpg) ->AIA 示例 + +*AIA 示例* ![](https://4.bp.blogspot.com/-p5WOrD6wVy8/VzyIpsDqULI/AAAAAAAADD0/xbtQjurJZ6EEji_MPaY1sLK5wVkXSvxJgCKgB/s800/B%2526H%2B-%2BDevice%2B%2528Final%2529.gif) ->B&H 图片(通过谷歌搜索) + +*B&H 图片(通过谷歌搜索)* ![](https://2.bp.blogspot.com/-q5ApCzECuNA/VzyKa9l0t2I/AAAAAAAADEI/nYhhMClDl5Y3qL5-wiOb2J2QjtGWwbF2wCLcB/s800/BuzzFeed-Device-Install%2B%2528Final%2529.gif) ->BuzzFeedVideo(通过一个共享链接) + +*BuzzFeedVideo(通过一个共享链接)* ![](https://2.bp.blogspot.com/-mVhKMMzhxms/VzyKg25ihBI/AAAAAAAADEM/dJN6_8H7qkwRyulCF7Yr2234-GGUXzC6ACLcB/s800/Park%2Band%2BPay%2B-%2BDevice%2Bwith%2BMeter%2B%2528Final%2529.gif) ->停车与支付(例)(通过 NFC) + +*停车与支付(例)(通过 NFC)* 听起来很棒,不是吗?但是其中还有很多技术方面的问题需要解决。 -比如,从安全的观点来说:如果任何应用从理论上来说都能在你的设备上运行,甚至你都不用安装它——你要怎么保证设备远离恶意软件攻击? +比如,从安全的观点来说:从理论上来说,如果任何应用都能在你的设备上运行,甚至你都不用安装它——你要怎么保证设备远离恶意软件攻击? 因此,为了消除这类威胁,谷歌还在这个项目上努力,目前只有少数合作伙伴,未来将逐步扩展。 From 2dec6e3903ae2e540674b51551a9778b7d856cf1 Mon Sep 17 00:00:00 2001 From: Purling Nayuki Date: Tue, 28 Jun 2016 17:56:47 +0800 Subject: [PATCH 1017/1469] Proofread 20151023 Mark Shuttleworth--The Man Behind Ubuntu Operating System --- ...-The Man Behind Ubuntu Operating System.md | 71 ++++++++++--------- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/translated/talk/20151023 Mark Shuttleworth--The Man Behind Ubuntu Operating System.md b/translated/talk/20151023 Mark Shuttleworth--The Man Behind Ubuntu Operating System.md index 0d3547aeb9..a9cd35e7ca 100644 --- a/translated/talk/20151023 Mark Shuttleworth--The Man Behind Ubuntu Operating System.md +++ b/translated/talk/20151023 Mark Shuttleworth--The Man Behind Ubuntu Operating System.md @@ -1,117 +1,118 @@ Mark Shuttleworth – Ubuntu 操作系统背后的人 ================================================================================ -![](http://1426826955.rsc.cdn77.org/wp-content/uploads/2015/10/Mark-Shuttleworth-652x445.jpg) +![](http://www.unixmen.com/wp-content/uploads/2015/10/Mark-Shuttleworth-652x445.jpg) -**Mark Richard Shuttleworth** 是 Ubuntu 的创始人,他也有事被称作是 Debian 背后的那个人。他出生于1973年的 Welkom,南非。他不仅是个企业家,还是个太空游客——他是第一个前往太空旅行的独立非洲国家公民。 +**Mark Richard Shuttleworth** 是 Ubuntu 的创始人,有时也被称作 Debian 背后的人。他于 1973 年出生在南非的 Welkom。他不仅是个企业家,还是个太空游客——他是第一个前往太空旅行的独立非洲国家公民。 -Mark 还在1996年成立了 **Thawte**,一家互联网安全企业,那是他还只是 University of Cape Town 的一名金融/IT学生。 +Mark 曾在 1996 年成立了 **Thawte**,一家互联网安全企业,那时他还只是 University of Cape Town(开普敦大学)的一名金融/IT学生。 -在2000年,Mark 创立了 HBD,一家投资公司,同时他还创立了 Shuttleworth基金会,致力于给社会中有创新性的领袖提供资助——以奖金和投资等形式。 +2000 年,Mark 创立了 HBD,一家投资公司,同时他还创立了 Shuttleworth 基金会,致力于给社会中有创新性的领袖以奖金和投资等形式提供资助。 -> "移动设备对于个人电脑行业的未来而言至关重要。比如就在这个月,数据清晰地表明相对于平板电脑的发展,传统 PC 行业正在萎缩。所以如果我们想和个人电脑行业有关系,我们必须和移动设备行业有产生联系。移动互联网行业之所以有趣,还因为在这里没有盗版 Windows 操作系统。所以如果你为你的操作系统赢得了一台设备的市场份额,这台设备会持续使用你的操作系统。在传统 PC 行业,我们时不时得和 ‘免费 Windows’ 产生竞争,这一竞争困难的非常微妙。所以我们现在的目标是围绕 Ubuntu 和移动设备——手机和平板——为用户打造更深度的生态环境。" +> "移动设备对于个人电脑行业的未来而言至关重要。比如就在这个月,相对于平板电脑的发展而言,传统 PC 行业很明显正在萎缩。所以如果我们想要涉足个人电脑产业,我们必须首先涉足移动行业。移动产业之所以有趣,还因为在这里没有盗版 Windows 操作系统。所以如果你为你的操作系统赢得了一台设备的市场份额,这台设备会持续使用你的操作系统。在传统 PC 行业,我们时不时得和“免费”的 Windows 产生竞争,这是一种非常微妙的挑战。所以我们现在的重心是围绕 Ubuntu 和移动设备——手机和平板——以图与普通用户建立更深层次的联系。" > > — Mark Shuttleworth -在2002年,在俄罗斯的 Star City 接收完为期一年的训练后,他作为 Soyuz 任务代号 TM-34 的一员飞往了国际空间站。再后来,在面向有志于航空航天或者其科学相关的南非学生群体中,内完成了推广科学,编程,数学的演讲后,Mark 创立了 **Canonical Ltd**。此后直至2013年,他一直在领导 Ubuntu 操作系统的开发。 +2002 年,他在俄罗斯的 Star City 接受了为期一年的训练,随后作为联盟号 TM-34 任务组的一员飞往了国际空间站。再后来,在发起面向有志于航空航天或者其相关学科的南非学生群体中推广科学、编程及数学的运动后,Mark 创立了 **Canonical Ltd**。此后直至2013年,他一直在领导 Ubuntu 操作系统的开发。 -现今,Shuttleworth 有英国与南非双重国籍并和18只可爱的鸭子住在英国的 Isle of Man 小岛上一处花园,一同的还有他一样可爱的女友 Claire,2 条黑母狗以及时不时经过的羊群。 +现今,Shuttleworth 拥有英国与南非双重国籍并和 18 只可爱的鸭子住在英国的 Isle of Man 小岛上的一处花园,一同的还有他可爱的女友 Claire,两条黑母狗以及时不时经过的羊群。 -> "电脑不再只是一台电子设备了。他现在是你思维的延续,以及通向他人的入口。" +> "电脑不仅仅是一台电子设备了。它现在是你思维的延续,以及通向他人的大门。" > > — Mark Shuttleworth ### Mark Shuttleworth 的早年生活### -正如我们之前提到的,Mark 出生在 Welkom,南非的橙色自由州。他是一名外科医生和护士学校教师的孩子。Mark 在 Western Province Preparatory School 就读并在1986年成为了学生会主席,一个学期后就读于 Rondebosch 男子高中,再之后入学 Bishops/Diocesan 学院并在1991年再次成为那里的学生会主席。 +正如我们之前提到的,Mark 出生在南非的橙色自由州 Welkom。他是一名外科医生和护士学校教师的孩子。他在 Western Province Preparatory School 就读并在 1986 年成为了学生会主席,一个学期后就读于 Rondebosch 男子高中,再之后入学 Bishops/Diocesan 学院并在 1991 年再次成为那里的学生会主席。 -Mark 在 University of Cape Town 拿到了 Bachelor of Business Science degree in the Finance and Information Systems (译者:商业科学里的双学士学位,两个学科分别是金融和信息系统),他在学校就读是住在 Smuts Hall。他,作为学生,也在那里帮助安装了学校的第一条宿舍网络。 +Mark 在 University of Cape Town 拿到了 Bachelor of Business Science degree in the Finance and Information Systems (译注:商业科学里的双学士学位,两个学科分别是金融和信息系统),他在学校就读时住在 Smuts Hall。作为学生,他也在那里帮助安装了学校的第一条宿舍网络。 ->“有无数的企业和国家佐证,引入开源政策能提高竞争力和效率。在不同层面上创造生产力对于公司和国家而言都是至关重要的。” +>“无数的企业和国家已经证明,引入开源政策能提高竞争力和效率。在不同层面上创造生产力对于公司和国家而言都是至关重要的。” > > — Mark Shuttleworth ### Mark Shuttleworth 的职业生涯 ### -Mark 在1995年创立 Thawte,公司专注于数字证书和互联网安全,然后他在1999年把公司卖给了 VeriSign,赚取了大约 5.75 亿美元。 +Mark 在 1995 年创立了 Thawte,公司专注于数字证书和互联网安全,然后在 1999 年把公司卖给了 VeriSign,赚取了大约 5.75 亿美元。 -2000年的时候,Mark 创立了 HBD 风险资本公司,这项事业成为了投资方和项目孵化器。2004年的时候,他创立了 Canonical Ltd. 以支持和鼓励自由软件开发项目的商业化,特别是 Ubuntu 操作系统的项目。直到2009年,Mark 才从 Canonical CEO 的位置上退下。 +2000 年,Mark 创立了 HBD 风险资本公司,这项事业成为了投资方和项目孵化器。2004 年,他创立了 Canonical Ltd. 以支持和鼓励自由软件开发项目的商业化,特别是 Ubuntu 操作系统的项目。直到 2009 年,Mark 才从 Canonical CEO 的位置上退下。 -> “在 [DDC](https://en.wikipedia.org/wiki/DCC_Alliance) (译者:一个 Debian Gnu/Linux 开发者联盟) 的早期,我更倾向于让开发者做些他们自己的(内核开发)工作看看能弄出些什么。现在我们基本上已经完成了这个开发阶段了。” +> “在 [DDC](https://en.wikipedia.org/wiki/DCC_Alliance) (译者:一个 Debian GNU/Linux 开发者联盟) 的早期,我更倾向于让拥护者放手去做,看看能发展出什么。” > > — Mark Shuttleworth ### Linux、免费开源软件 与 Mark Shuttleworth ### -在90年代末,Mark 作为 Debian 系统开发者的一员参与了项目。 +在 90 年代末,Mark 曾作为一名开发者参与 Debian 操作系统项目。 -2001年,Mark 创立了 Shuttleworth 基金会,这是个扎根南非的,非赢利性,专注于赞助社会创新,免费/教育用途开源软件的基金会,赞助过的项目包括 Freedom Toaster。 +2001 年,Mark 创立了 Shuttleworth 基金会,这是个扎根南非的、非赢利性的基金会,专注于赞助社会创新、免费/教育用途开源软件,曾赞助过 Freedom Toaster。 -2004年的时候,Mark 通过出资开发 基于 Debian 的 Ubuntu 操作系统回归了免费软件界,这一切也经由他的公司,Canonical,完成。 +2004 年,Mark 通过出资开发基于 Debian 的 Ubuntu 操作系统回归了自由软件界,这一切也经由他的 Canonical 公司完成。 -2005年,Mark 出资建立了 Ubuntu 基金会并投入了一千万美元作为启动资金。在 Ubuntu 项目内,Mark 经常被一个朗朗上口的名字称呼——“**SABDFL (Self-Appointed Benevolent Dictator for Life)**”。为了能够找到足够多的能手开发这个巨大的项目,Mark 花费了6个月的时间在 Debian 的邮件列表里找到能手,这一切都是在他乘坐在南极洲的一艘破冰船——Kapitan Khlebnikov——上完成的。2005年,Mark 买下了 Impi Linux 65% 的股份。 +2005 年,Mark 出资建立了 Ubuntu 基金会并投入了一千万美元作为启动资金。在 Ubuntu 项目内,Mark 经常被一个朗朗上口的名字称呼——“**SABDFL (Self-Appointed Benevolent Dictator for Life)**”。为了能够找到足够多的能手开发这个巨大的项目,Mark 花费了 6 个月的时间从 Debian 邮件列表里找到能手,这一切都是在他乘坐在南极洲的一艘破冰船——Kapitan Khlebnikov——上完成的。同年,Mark 买下了 Impi Linux 65% 的股份。 > “我呼吁电信公司的掌权者们尽快开发出跨洲际的高效信息传输服务。” > > — Mark Shuttleworth -2006年,KDE 宣布 Shuttleworth 成为第一位 **patron** 级别赞助者——彼时 KDE 最高级别的赞助。这一赞助协议终止与2012年,取而代之的是 Kubuntu——一个运用 KDE 作为默认桌面环境的 Ubuntu 变种——的资金。 +2006 年,KDE 宣布 Shuttleworth 成为第一位 **patron** 级别赞助者——彼时 KDE 最高级别的赞助。这一赞助协议在 2012 年终止,取而代之的是一个使用 KDE 作为默认桌面环境的 Ubuntu 变种——Kubuntu 的资金。 -![](http://1426826955.rsc.cdn77.org/wp-content/uploads/2015/10/shuttleworth-kde.jpg) +![](http://www.unixmen.com/wp-content/uploads/2015/10/shuttleworth-kde.jpg) -2009年,Shuttleworth 宣布他会从 CEO 退位以更好的关注与合作伙伴,产品设计和顾客体验。Jane Silber ——2004年起公司的COO——晋升CEO。 +2009 年,Shuttleworth 宣布他会从 CEO 退位以更好地关注合作伙伴,产品设计和顾客体验。从 2004 年起担任公司 COO 的 Jane Silber 晋升为 CEO。 -2010年,Mark 由于 Ubuntu 项目从 Open University 收到了荣誉学位。 +2010 年,Mark 由于 Ubuntu 项目从 Open University 获得了荣誉学位。 -2012年,Mark 和 Kenneth Rogoff 一同在牛津大学与 Peter Thiel 和 Garry Kasparov 就 **创新悖论**(The Innovation Enigma)展开辩论。 +2012 年,Mark 和 Kenneth Rogoff 一同在牛津大学与 Peter Thiel 和 Garry Kasparov 就**创新悖论**(The Innovation Enigma)展开辩论。 -2013年,Mark 和 Ubuntu 一同被授予 **澳大利亚反个人隐私老大哥监控奖**(Austrian anti-privacy Big Brother Award),理由为把 Ubuntu 会把 Unity 桌面的搜索框的搜索结果发往 Canonical 服务器(译者:因此侵犯了个人隐私)。而一年前的2012年,Mark 曾经申明过这一过程极具匿名性。 +2013 年,Mark 和 Ubuntu 一同被授予**澳大利亚反个人隐私老大哥监控奖**(Austrian anti-privacy Big Brother Award),理由是 Ubuntu 会把 Unity 桌面的搜索框的搜索结果发往 Canonical 服务器(译注:因此侵犯了个人隐私)。而一年前,Mark 曾经申明过这一过程进行了匿名化处理。 -> “所有主流 PC 厂家现在都提供 Ubuntu 预安装选项。所以我们和业界的合作已经相当紧密了。但那些 PC 厂家对于给买家推广新东西这件事都很紧张。如果我们可以让买家习惯 Ubuntu 的桌面/平板/手机操作系统的体验,那他们也应该更愿意买预装 Ubuntu 的设备。因为没有哪个操作系统是通过抄袭模仿获得成功的。Android 很棒,如果我们想成功的话我们必须给市场带去更新更好的东西。整个环境都有停滞发展的危险,如果我们中没有人追寻未来的话。但如果你尝试去追寻未来了,那你必须接受不是所有人对未来的预见都和你一样这一事实。” +> “所有主流 PC 厂家现在都提供 Ubuntu 预安装选项。所以我们和业界的合作已经相当紧密了。但那些 PC 厂家对于给买家推广新东西这件事都很紧张。如果我们可以让买家习惯 Ubuntu 的桌面/平板/手机操作系统的体验,那他们也应该更愿意买预装 Ubuntu 的设备。因为没有哪个操作系统是通过抄袭模仿获得成功的。Android 很棒,但如果我们想成功的话我们必须给市场带去更新更好的东西(校注:而不是改进或者模仿 Android)。如果我们中没有人追寻未来的话,我们将陷入停滞不前的危险。但如果你尝试去追寻未来了,那你必须接受不是所有人对未来的预见都和你一样这一事实。” > > — Mark Shuttleworth ### Mark Shuttleworth 的太空之旅 ### -Mark 在2002年由于作为世界第二名自费太空游客而闻名世界,同时他也是南非第一个旅行太空的人。这趟旅行 Mark 作为俄罗斯 Soyuz TM-34 的一名航空参与者加入,并支付了约两千万美元。2天后,Soyuz 太空梭抵达了国际空间站,在那里 Mark 呆了8天并参与了 AIDS 和 GENOME 研究的相关实验。2002年的晚些时候,Mark 乘坐 Soyuz TM-33 返回了地球。为了参与这趟旅行,Mark 花了一年时间准备与训练,包括7个月居住在俄罗斯的 Start City。 +Mark 在 2002 年作为世界第二名自费太空游客而闻名世界,同时他也是南非第一个旅行太空的人。这趟旅行中,Mark 作为俄罗斯联盟号 TM-34 任务的一名航空参与者加入,并为此支付了约两千万美元。2 天后,联盟号宇宙飞船抵达了国际空间站,在那里 Mark 呆了 8 天并参与了艾滋病和基因组研究的相关实验。同年晚些时候,Mark 随联盟号 TM-33 任务返回了地球。为了参与这趟旅行,Mark 花了一年时间准备与训练,其中有 7 个月居住在俄罗斯的 Start City。 -![](http://1426826955.rsc.cdn77.org/wp-content/uploads/2015/10/Mark-Shuttleworth1.jpg) +![](http://www.unixmen.com/wp-content/uploads/2015/10/Mark-Shuttleworth1.jpg) 在太空中,Mark 与 Nelson Mandela 和另一个南非女孩 Michelle Foster (她问 Mark 要不要娶她)通过无线电进行了交谈。Mark 回避了结婚问题,在换话题之前他说他感到很荣幸。身患绝症的 Forster 和 Nelson Mandela 通过 Dream 基金会的赞助获得了与 Mark 交谈的机会。 归来后,Mark 在世界各地做了旅行,并和各地的学生就太空之旅发表了感言。 ->“粗略的统计数据表明 Ubuntu 的实际用户依然在增长。而我们的合作方——Dell,HP,Lenovo 和其他硬件生产商,以及游戏厂商 EA,Valve 都在加入我们——这让我觉得我们在引导一项很有意义的事业。” +>“粗略的统计数据表明 Ubuntu 的实际用户依然在增长。而我们的合作方——Dell、HP、Lenovo 和其他硬件生产商,以及游戏厂商 EA、Valve 都在加入我们——这让我觉得我们在关键的领域继续领先。” > > — Mark Shuttleworth ### Mark Shuttleworth 的交通工具 ### -Mark 有他自己的私人客机,Bombardier Global Express,经常被称为 Canonical 一号,但事实上此飞机是通过 HBD 风险投资公司注册拥有的。飞机侧面的喷绘龙图案是 HBD 风投公司的吉祥物,Norman。 +Mark 有他自己的私人客机 Bombardier Global Express。虽然它经常被称为 Canonical 一号,但事实上此飞机是通过 HBD 风险投资公司注册拥有的。飞机侧面的龙图案涂装是 HBD 风投公司的吉祥物 Norman。 ### 与南非储蓄银行的法律冲突 ### -在从南非转移25亿南非兰特去往 Isle of Man 的过程中,南非储蓄银行征收了 2.5 亿南非兰特的税金。Mark 上诉了,经过冗长的法庭唇枪舌战,南非储蓄银行被勒令返还 2.5 亿征税,以及其利息。Mark 宣布他会把这 2.5 亿存入信托基金,以用于帮助上诉宪法法院的案子。 +在从南非转移 25 亿南非兰特去往 Isle of Man 的过程中,南非储蓄银行征收了 2.5 亿南非兰特的税金。Mark 上诉了,经过冗长的法庭唇枪舌战,南非储蓄银行被勒令返还 2.5 亿征税,以及其利息。Mark 宣布他会把这 2.5 亿存入信托基金,以用于帮助上诉宪法法院的案子。 -> “离境征税倒也不和宪法冲突。但离境征税的主要目的不是为了提高税收,而是通过监管资金流出来保护本国经济。” +> “离境征税倒也不和宪法冲突。但离境征税的主要目的不是提高税收,而是通过监管资金流出来保护本国经济。” > -> — 法官 Dikgang Moseneke +> — Dikgang Moseneke 法官 -2015年,南非宪法法院修正了低级法院的判决结果,并宣布了上述对于离岸征税的理解。 +2015 年,南非宪法法院修正了低级法院的判决结果,并宣布了上述对于离岸征税的理解。 ### Mark Shuttleworth 喜欢的东西 ### -Cesária Évora, mp3s,Spring, Chelsea, finally seeing something obvious for first time, coming home, Sinatra, daydreaming, sundowners, flirting, d’Urberville, string theory, Linux, particle physics, Python, reincarnation, mig-29s, snow, travel, Mozilla, lime marmalade, body shots, the African bush, leopards, Rajasthan, Russian saunas, snowboarding, weightlessness, Iain m banks, broadband, Alastair Reynolds, fancy dress, skinny-dipping, flashes of insight, post-adrenaline euphoria, the inexplicable, convertibles, Clifton, country roads, international space station, machine learning, artificial intelligence, Wikipedia, Slashdot, kitesurfing, and Manx lanes. +Cesária Évora, mp3s, Spring, Chelsea, finally seeing something obvious for first time, coming home, Sinatra, daydreaming, sundowners, flirting, d’Urberville, string theory, Linux, particle physics, Python, reincarnation, mig-29s, snow, travel, Mozilla, lime marmalade, body shots, the African bush, leopards, Rajasthan, Russian saunas, snowboarding, weightlessness, Iain m banks, broadband, Alastair Reynolds, fancy dress, skinny-dipping, flashes of insight, post-adrenaline euphoria, the inexplicable, convertibles, Clifton, country roads, international space station, machine learning, artificial intelligence, Wikipedia, Slashdot, kitesurfing, and Manx lanes. ### Shuttleworth 不喜欢的东西 ### Admin, salary negotiations, legalese, and public speaking. +(校对:和程序猿不喜欢 PM 一个道理?) -------------------------------------------------------------------------------- @@ -119,7 +120,7 @@ via: http://www.unixmen.com/mark-shuttleworth-man-behind-ubuntu-operating-system 作者:[M.el Khamlichi][a] 译者:[Moelf](https://github.com/Moelf) -校对:[校对者ID](https://github.com/校对者ID) +校对:[PurlingNayuki](https://github.com/PurlingNayuki) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From e2c29ecd550f2484476d29e66e7344948ebbb5a5 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 28 Jun 2016 20:53:08 +0800 Subject: [PATCH 1018/1469] PUB:20160605 Will Google Replace Passwords With A New Trust-Based Authentication Method @alim0x --- ...Passwords With A New Trust-Based Authentication Method.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) rename {translated/talk => published}/20160605 Will Google Replace Passwords With A New Trust-Based Authentication Method.md (96%) diff --git a/translated/talk/20160605 Will Google Replace Passwords With A New Trust-Based Authentication Method.md b/published/20160605 Will Google Replace Passwords With A New Trust-Based Authentication Method.md similarity index 96% rename from translated/talk/20160605 Will Google Replace Passwords With A New Trust-Based Authentication Method.md rename to published/20160605 Will Google Replace Passwords With A New Trust-Based Authentication Method.md index 7e0e85d688..ba14bf8742 100644 --- a/translated/talk/20160605 Will Google Replace Passwords With A New Trust-Based Authentication Method.md +++ b/published/20160605 Will Google Replace Passwords With A New Trust-Based Authentication Method.md @@ -14,7 +14,8 @@ 基于这个信任分,一个需要登录认证的应用可以验证你确实可以授权登录,从而不会提示需要密码。 ![](http://www.iwillfolo.com/wordpress/wp-content/uploads/2016/05/Abacus-to-Trust-API.jpg) ->Abacus 到 Trust API + +*Abacus 到 Trust API* ### 需要思考的地方 @@ -31,7 +32,7 @@ via: http://www.iwillfolo.com/will-google-replace-passwords-with-a-new-trust-bas 作者:[iWillFolo][a] 译者:[alim0x](https://github.com/alim0x) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d5373fa7ec5bfdc41fc4a6aef67bb21b951741ca Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 28 Jun 2016 21:04:27 +0800 Subject: [PATCH 1019/1469] =?UTF-8?q?PUB:20160611=20vlock=20=E2=80=93=20A?= =?UTF-8?q?=20Smart=20Way=20to=20Lock=20User=20Virtual=20Console=20or=20Te?= =?UTF-8?q?rminal=20in=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @martin2011qi --- ...User Virtual Console or Terminal in Linux.md | 102 ++++++++++++++++++ ...User Virtual Console or Terminal in Linux.md | 99 ----------------- 2 files changed, 102 insertions(+), 99 deletions(-) create mode 100644 published/20160611 vlock – A Smart Way to Lock User Virtual Console or Terminal in Linux.md delete mode 100644 translated/tech/20160611 vlock – A Smart Way to Lock User Virtual Console or Terminal in Linux.md diff --git a/published/20160611 vlock – A Smart Way to Lock User Virtual Console or Terminal in Linux.md b/published/20160611 vlock – A Smart Way to Lock User Virtual Console or Terminal in Linux.md new file mode 100644 index 0000000000..99c1da66ab --- /dev/null +++ b/published/20160611 vlock – A Smart Way to Lock User Virtual Console or Terminal in Linux.md @@ -0,0 +1,102 @@ +vlock – 一个锁定 Linux 用户虚拟控制台或终端的好方法 +======================================================================= + +虚拟控制台是 Linux 上非常重要的功能,它们给系统用户提供了 shell 提示符,以保证用户在登录和远程登录一个未安装图形界面的系统时仍能使用。 + +一个用户可以同时操作多个虚拟控制台会话,只需在虚拟控制台间来回切换即可。 + +![](http://www.tecmint.com/wp-content/uploads/2016/05/vlock-Lock-User-Terminal-in-Linux.png) + +*用 vlock 锁定 Linux 用户控制台或终端* + +这篇使用指导旨在教会大家如何使用 vlock 来锁定用户虚拟控制台和终端。 + +### vlock 是什么? + +vlock 是一个用于锁定一个或多个用户虚拟控制台用户会话的工具。在多用户系统中 vlock 扮演着重要的角色,它让用户可以在锁住自己会话的同时不影响其他用户通过其他虚拟控制台操作同一个系统。必要时,还可以锁定所有的控制台,同时禁止在虚拟控制台间切换。 + +vlock 的主要功能面向控制台会话方面,同时也支持非控制台会话的锁定,但该功能的测试还不完全。 + +### 在 Linux 上安装 vlock + +根据你的 Linux 系统选择 vlock 安装指令: + +``` +# yum install vlock [On RHEL / CentOS / Fedora] +$ sudo apt-get install vlock [On Ubuntu / Debian / Mint] +``` + +### 在 Linux 上使用 vlock + +vlock 操作选项的常规语法: + +``` +# vlock option +# vlock option plugin +# vlock option -t plugin +``` + +#### vlock 常用选项及用法: + +1、 锁定用户的当前虚拟控制台或终端会话,如下: + +``` +# vlock --current +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Lock-User-Terminal-Session-in-Linux.png) + +*锁定 Linux 用户终端会话* + +选项 -c 或 --current,用于锁定当前的会话,该参数为运行 vlock 时的默认行为。 + +2、 锁定所有你的虚拟控制台会话,并禁用虚拟控制台间切换,命令如下: + +``` +# vlock --all +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Lock-All-Linux-Terminal-Sessions.png) + +*锁定所有 Linux 终端会话* + +选项 -a 或 --all,用于锁定所有用户的控制台会话,并禁用虚拟控制台间切换。 + +其他的选项只有在编译 vlock 时编入了相关插件支持和引用后,才能发挥作用: + +3、 选项 -n 或 --new,调用时后,会在锁定用户的控制台会话前切换到一个新的虚拟控制台。 + +``` +# vlock --new +``` + +4、 选项 -s 或 --disable-sysrq,在禁用虚拟控制台的同时禁用 SysRq 功能,只有在与 -a 或 --all 同时使用时才起作用。 + +``` +# vlock -sa +``` + +5、 选项 -t 或 --timeout ,用以设定屏幕保护插件的 timeout 值。 + +``` +# vlock --timeout 5 +``` + +你可以使用 `-h` 或 `--help` 和 `-v` 或 `--version` 分别查看帮助消息和版本信息。 + +我们的介绍就到这了,提示一点,你可以将 vlock 的 `~/.vlockrc` 文件包含到系统启动中,并参考入门手册[添加环境变量][1],特别是 Debian 系的用户。 + +想要找到更多或是补充一些这里没有提及的信息,可以直接在写在下方评论区。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/vlock-lock-user-virtual-console-terminal-linux/ + +作者:[Aaron Kili][a] +译者:[martin2011qi](https://github.com/martin2011qi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.tecmint.com/author/aaronkili/ +[1]: http://www.tecmint.com/set-path-variable-linux-permanently/ diff --git a/translated/tech/20160611 vlock – A Smart Way to Lock User Virtual Console or Terminal in Linux.md b/translated/tech/20160611 vlock – A Smart Way to Lock User Virtual Console or Terminal in Linux.md deleted file mode 100644 index 26c74b019e..0000000000 --- a/translated/tech/20160611 vlock – A Smart Way to Lock User Virtual Console or Terminal in Linux.md +++ /dev/null @@ -1,99 +0,0 @@ -vlock – 一个锁定 Linux 用户虚拟控制台或终端的好方法 -======================================================================= - -虚拟控制台是 Linux 非常重要的功能,他们为使用系统的用户提供了 shell 提示符,以保证用户在登录和远程登录一个未安装图形界面的系统时仍能使用。 - -一个用户可以同时操作多个虚拟控制台会话,只需在虚拟控制台间来回切换即可。 - -![](http://www.tecmint.com/wp-content/uploads/2016/05/vlock-Lock-User-Terminal-in-Linux.png) ->用 vlock 锁定 Linux 用户控制台或终端 - -这篇使用指导,旨在教会大家如何使用 vlock 来锁定用户虚拟控制台和终端。 - -### vlock 是什么? - -vlock 是一个用于锁定一个或多个用户虚拟控制台用户会话的工具。在多用户系统中 vlock 是扮演着重要的角色,他让用户可以在锁住自己会话的同时不影响其他用户通过其他虚拟控制台操作同一个系统。必要时,还可以锁定所有的控制台,同时禁止在虚拟控制台间切换。 - -vlock 的主要功能面向控制台会话方面,同时也支持非控制台会话的锁定,但该功能的测试还不完全。 - -### 在 Linux 上安装 vlock - -根据你的 Linux 系统选择 vlock 安装指令: - -``` -# yum install vlock [On RHEL / CentOS / Fedora] -$ sudo apt-get install vlock [On Ubuntu / Debian / Mint] -``` - -### 在 Linux 上使用 vlock - -vlock 操作选项的常规语法: - -``` -# vlock option -# vlock option plugin -# vlock option -t plugin -``` - -#### vlock 常用选项及用法: - -1. 锁定用户的当前虚拟控制台或终端会话,如下: - - ``` - # vlock --current - ``` - - ![](http://www.tecmint.com/wp-content/uploads/2016/05/Lock-User-Terminal-Session-in-Linux.png) - >锁定 Linux 用户终端会话 - - 选项 -c 或 --current,锁定当前的会话,该参数为运行 vlock 时的默认行为。 - -2. 锁定所有你的虚拟控制台会话,并禁用虚拟控制台间切换,命令如下: - - ``` - # vlock --all - ``` - - ![](http://www.tecmint.com/wp-content/uploads/2016/05/Lock-All-Linux-Terminal-Sessions.png) - >锁定所有 Linux 终端会话 - - 选项 -a 或 --all,锁定所有用户的控制台会话,并禁用虚拟控制台间切换。 - - 其他的选项只有在编译 vlock 时编入了相关插件支持及其引用后,才能发挥作用: - -3. 选项 -n 或 --new,调用时后,会在锁定用户的控制台会话前切换到一个新的虚拟控制台。 - - ``` - # vlock --new - ``` - -4. 选项 -s 或 --disable-sysrq,在禁用虚拟控制台的同时禁用 SysRq 功能,只有在与 -a 或 --all 同时使用时才起作用。 - - ``` - # vlock -sa - ``` - -5. 选项 -t 或 --timeout ,用以设定屏幕保护插件的 timeout 值。 - - ``` - # vlock --timeout 5 - ``` - -你可以使用 `-h` 或 `--help` 和 `-v` 或 `--version` 分别查看帮助消息和版本信息。 - -我们的介绍就到这了,提示一点,你可以将 vlock 的 `~/.vlockrc` 文件包含到系统启动中并参考入门手册[添加环境变量][1],特别是 Debian 系的用户。 - -想要找到更多或是补充一些这里没有提及的信息,可以直接在写在下方评论区。 - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/vlock-lock-user-virtual-console-terminal-linux/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tecmint+%28Tecmint%3A+Linux+Howto%27s+Guide%29 - -作者:[Aaron Kili][a] -译者:[martin2011qi](https://github.com/martin2011qi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://www.tecmint.com/author/aaronkili/ -[1]: http://www.tecmint.com/set-path-variable-linux-permanently/ From d009439a06283b0fefda6806dc9dd13a92da702b Mon Sep 17 00:00:00 2001 From: Ezio Date: Tue, 28 Jun 2016 23:19:55 +0800 Subject: [PATCH 1020/1469] =?UTF-8?q?20160628-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...n All Distributions – Are They Any Good.md | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 sources/talk/20160627 Linux Applications That Works On All Distributions – Are They Any Good.md diff --git a/sources/talk/20160627 Linux Applications That Works On All Distributions – Are They Any Good.md b/sources/talk/20160627 Linux Applications That Works On All Distributions – Are They Any Good.md new file mode 100644 index 0000000000..98967d866b --- /dev/null +++ b/sources/talk/20160627 Linux Applications That Works On All Distributions – Are They Any Good.md @@ -0,0 +1,90 @@ +Linux Applications That Works On All Distributions – Are They Any Good? +============================================================================ + +![](http://www.iwillfolo.com/wordpress/wp-content/uploads/2016/06/Bundled-applications.jpg) + + +A revisit of Linux community’s latest ambitions – promoting decentralized applications in order to tackle distribution fragmentation. + +Following last week’s article: [Ubuntu’s Snap, Red Hat’s Flatpak And Is ‘One Fits All’ Linux Packages Useful][1]?, a couple of new opinions rose to the surface which may contain crucial information about the usefulness of such apps. + +### The Con Side + +Commenting on the subject [here][2], a [Gentoo][3] user who goes by the name Till, gave rise to a few points which hasn’t been addressed to the fullest the last time we covered the issue. + +While previously we settled on merely calling it bloat, Till here on the other hand, is dissecting that bloat further so to help us better understand both its components and its consequences. + +Referring to such apps as “bundled applications” – for the way they work on all distributions is by containing dependencies together with the apps themselves, Till says: + +>“bundles ship a lot of software that now needs to be maintained by the application developer. If library X has a security problem and needs an update, you rely on every single applications to ship correct updates in order to make your system save.” + +Essentially, Till raises an important security point. However, it isn’t necessarily has to be tied to security alone, but can also be linked to other aspects such as system maintenance, atomic updates, etc… + +Furthermore, if we take that notion one step further and assume that dependencies developers may cooperate, therefore releasing their software in correlation with the apps who use them (an utopic situation), we shall then get an overall slowdown of the entire platform development. + +Another problem that arises from the same point made above is dependencies-transparency becomes obscure, that is, if you’d want to know which libraries are bundled with a certain app, you’ll have to rely on the developer to publish such data. + +Or, as Till puts it: “Questions like, did package XY already include the updated library Z, will be your daily bread”. + +For comparison, with the standard methods available on Linux nowadays (both binary and source distributions), you can easily notice which libraries are being updated upon a system update. + +And you can also rest assure that all other apps on the system will use it, freeing you from the need to check each app individually. + +Other cons that may be deduced from the term bloat include: bigger package size (each app is bundled with dependencies), higher memory usage (no more library sharing) and also – + +One less filter mechanism to prevent malicious software – distributions package maintainers also serve as a filter between developers and users, helping to assure users get quality software. + +With bundled apps this may no longer be the case. + +As a finalizing general point, Till asserts that although useful in some cases, for the most part, bundled apps weakens the free software position in distributions (as proprietary vendors will now be able to deliver software without sharing it on public repositories). + +And apart from that, it introduces many other issues. Many problems are simply moved towards the developers. + +### The Pro Side + +In contrast, another comment by a person named Sven tries to contradict common claims that basically go against the use of bundled applications, hence justifying and promoting the use of it. + +“waste of space” – Sven claims that in today’s world we have many other things that wastes disk space, such as movies stored on hard drive, installed locals, etc… + +Ultimately, these things are infinitely more wasteful than a mere “100 MB to run a program you use all day … Don’t be ridiculous.” + +“waste of RAM” – the major points in favor are: + +- Shared libraries waste significantly less RAM compared to application runtime data. +- RAM is cheap today. + +“security nightmare” – not every application you run is actually security-critical. + +Also, many applications never even see any security updates, unless on a ‘rolling distro’. + +In addition to Sven’s opinions, who try to stick to the pragmatic side, a few advantages were also pointed by Till who admits that bundled apps has their merits in certain cases: + +- Proprietary vendors who want to keep their code out of the public repositories will be able to do so more easily. +- Niche applications, which are not packaged by your distribution, will now be more readily available. +- Testing on binary distributions which do not have beta packages will become easier. +- Freeing users from solving dependencies problems. + +### Final Thoughts + +Although shedding new light onto the matter, it seems that one conclusion still stands and accepted by all parties – bundled apps has their niche to fill in the Linux ecosystem. + +Nevertheless, the role that niche should take, whether main or marginal one, appears to be a lot clearer now, at least from a theoretical point of view. + +Users who are looking to make their system optimized as possible, should, in the majority of cases, avoid using bundled apps. + +Whereas, users that are after ease-of-use, meaning – doing the least of work in order to maintain their systems, should and probably would feel very comfortable adopting the new method. + +-------------------------------------------------------------------------------- + +via: http://www.iwillfolo.com/linux-applications-that-works-on-all-distributions-are-they-any-good/ + +作者:[Editorials][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.iwillfolo.com/category/editorials/ +[1]: http://www.iwillfolo.com/ubuntus-snap-red-hats-flatpack-and-is-one-fits-all-linux-packages-useful/ +[2]: http://www.proli.net/2016/06/25/gnulinux-bundled-application-ramblings/ +[3]: http://www.iwillfolo.com/5-reasons-use-gentoo-linux/ From 4dd996a6a8e9c1891a1ae329a0001ea65b2e87f8 Mon Sep 17 00:00:00 2001 From: Ezio Date: Tue, 28 Jun 2016 23:23:31 +0800 Subject: [PATCH 1021/1469] =?UTF-8?q?20160628-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...And Is ‘One Fits All’ Linux Packages Useful.md | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 sources/talk/20160625 Ubuntu’s Snap, Red Hat’s Flatpak And Is ‘One Fits All’ Linux Packages Useful.md diff --git a/sources/talk/20160625 Ubuntu’s Snap, Red Hat’s Flatpak And Is ‘One Fits All’ Linux Packages Useful.md b/sources/talk/20160625 Ubuntu’s Snap, Red Hat’s Flatpak And Is ‘One Fits All’ Linux Packages Useful.md new file mode 100644 index 0000000000..35088e4be1 --- /dev/null +++ b/sources/talk/20160625 Ubuntu’s Snap, Red Hat’s Flatpak And Is ‘One Fits All’ Linux Packages Useful.md @@ -0,0 +1,110 @@ +Ubuntu’s Snap, Red Hat’s Flatpak And Is ‘One Fits All’ Linux Packages Useful? +================================================================================= + +![](http://www.iwillfolo.com/wordpress/wp-content/uploads/2016/06/Flatpak-and-Snap-Packages.jpg) + +An in-depth look into the new generation of packages starting to permeate the Linux ecosystem. + + +Lately we’ve been hearing more and more about Ubuntu’s Snap packages and Flatpak (formerly referred to as xdg-app) created by Red Hat’s employee Alexander Larsson. + +These 2 types of next generation packages are in essence having the same goal and characteristics which are: being standalone packages that doesn’t rely on 3rd-party system libraries in order to function. + +This new technology direction which Linux seems to be headed is automatically giving rise to questions such as, what are the advantages / disadvantages of standalone packages? does this lead us to a better Linux overall? what are the motives behind it? + +To answer these questions and more, let us explore the things we know about Snap and Flatpak so far. + +### The Motive + +According to both [Flatpak][1] and [Snap][2] statements, the main motive behind them is to be able to bring one and the same version of application to run across multiple Linux distributions. + +>“From the very start its primary goal has been to allow the same application to run across a myriad of Linux distributions and operating systems.” Flatpak + +>“… ‘snap’ universal Linux package format, enabling a single binary package to work perfectly and securely on any Linux desktop, server, cloud or device.” Snap + +To be more specific, the guys behind Snap and Flatpak (S&F) believe that there’s a barrier of fragmentation on the Linux platform. + +A barrier which holds back the platform advancement by burdening developers with more, perhaps unnecessary, work to get their software run on the many distributions out there. + +Therefore, as leading Linux distributions (Ubuntu & Red Hat), they wish to eliminate the barrier and strengthen the platform in general. + +But what are the more personal gains which motivate the development of S&F? + +#### Personal Gains? + +Although not officially stated anywhere, it may be assumed that by leading the efforts of creating a unified package that could potentially be adopted by the vast majority of Linux distros (if not all of them), the captains of these projects could assume a key position in determining where the Linux ship sails. + +### The Advantages + +The benefits of standalone packages are diverse and can depend on different factors. + +Basically however, these factors can be categorized under 2 distinct criteria: + +#### User Perspective + ++ From a Linux user point of view, Snap and Flatpak both bring the possibility of installing any package (software / app) on any distribution the user is using. + +That is, for instance, if you’re using a not so popular distribution which has only a scarce supply of packages available in their repo, due to workforce limitations probably, you’ll now be able to easily and significantly increase the amount of packages available to you – which is a great thing. + ++ Also, users of popular distributions that do have many packages available in their repos, will enjoy the ability of installing packages that might not have behaved with their current set of installed libraries. + +For example, a Debian user who wants to install a package from ‘testing branch’ will not have to convert his entire system into ‘testing’ (in order for the package to run against newer libraries), rather, that user will simply be able to install only the package he wants from whichever branch he likes and on whatever branch he’s on. + +The latter point, was already basically possible for users who were compiling their packages straight from source, however, unless using a source based distribution such as Gentoo, most users will see this as just an unworthily hassle. + ++ The advanced user, or perhaps better put, the security aware user might feel more comfortable with this type of packages as long as they come from a reliable source as they tend to provide another layer of isolation since they are generally isolated from system packages. + +* Both S&F are being developed with enhanced security in mind, which generally makes use of “sandboxing” i.e isolation in order to prevent cases where they carry a virus which can infect the entire system, similar to the way .exe files on MS Windows may. (More on MS and S&F later) + +#### Developer Perspective + +For developers, the advantages of developing S&F packages will probably be a lot clearer than they are to the average user, some of these were already hinted in a previous section of this post. + +Nonetheless, here they are: + ++ S&F will make it easier on devs who want to develop for more than one Linux distribution by unifying the process of development, therefore minimizing the amount of work a developer needs to do in order to get his app running on multiple distributions. + +++ Developers could therefore gain easier access to a wider range of distributions. + ++ S&F allow devs to privately distribute their packages without being dependent on distribution maintainers to stabilize their package for each and every distro. + +++ Through the above, devs may gain access to direct statistics of user adoption / engagement for their software. + +++ Also through the above, devs could get more directly involved with users, rather than having to do so through a middleman, in this case, the distribution. + +### The Downsides + +– Bloat. Simple as that. Flatpak and Snap aren’t just magic making dependencies evaporate into thin air. Rather, instead of relying on the target system to provide the required dependencies, S&F comes with the dependencies prebuilt into them. + +As the saying goes “if the mountain won’t come to Muhammad, Muhammad must go to the mountain…” + +– Just as the security-aware user might enjoy S&F packages extra layer of isolation, as long they come from a trusted source. The less knowledgeable user on the hand, might be prone to the other side of the coin hazard which is using a package from an unknown source which may contain malicious software. + +The above point can be said to be valid even with today’s popular methods, as PPAs, overlays, etc might also be maintained by untrusted sources. + +However, with S&F packages the risk increases since malicious software developers need to create only one version of their program in order to infect a large number of distributions, whereas, without it they’d needed to create multiple versions in order to adjust their malware to other distributions. + +Was Microsoft Right All Along? + +With all that’s mentioned above in mind, it’s pretty clear that for the most part, the advantages of using S&F packages outweighs the drawbacks. + +At the least for users of binary-based distributions, or, non lightweight focused distros. + +Which eventually lead me to asking the above question – could it be that Microsoft was right all along? if so and S&F becomes the Linux standard, would you still consider Linux a Unix-like variant? + +Well apparently, the best one to answer those questions is probably time. + +Nevertheless, I’d argue that even if not entirely right, MS certainly has a good point to their credit, and having all these methods available here on Linux out of the box is certainly a plus in my book. + + +-------------------------------------------------------------------------------- + +via: http://www.iwillfolo.com/ubuntus-snap-red-hats-flatpack-and-is-one-fits-all-linux-packages-useful/ + +作者:[Editorials][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.iwillfolo.com/category/editorials/ From 7b4d8e5cacdadb4141e56992fae127d6eab120d4 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 29 Jun 2016 00:21:09 +0800 Subject: [PATCH 1022/1469] =?UTF-8?q?=E4=BA=8C=E6=A0=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...-The Man Behind Ubuntu Operating System.md | 108 +++++++++--------- 1 file changed, 55 insertions(+), 53 deletions(-) diff --git a/translated/talk/20151023 Mark Shuttleworth--The Man Behind Ubuntu Operating System.md b/translated/talk/20151023 Mark Shuttleworth--The Man Behind Ubuntu Operating System.md index a9cd35e7ca..b40048201b 100644 --- a/translated/talk/20151023 Mark Shuttleworth--The Man Behind Ubuntu Operating System.md +++ b/translated/talk/20151023 Mark Shuttleworth--The Man Behind Ubuntu Operating System.md @@ -1,102 +1,100 @@ -Mark Shuttleworth – Ubuntu 操作系统背后的人 +马克·沙特尔沃思 – Ubuntu 背后的那个男人 ================================================================================ + ![](http://www.unixmen.com/wp-content/uploads/2015/10/Mark-Shuttleworth-652x445.jpg) -**Mark Richard Shuttleworth** 是 Ubuntu 的创始人,有时也被称作 Debian 背后的人。他于 1973 年出生在南非的 Welkom。他不仅是个企业家,还是个太空游客——他是第一个前往太空旅行的独立非洲国家公民。 +**马克·理查德·沙特尔沃思(马克Richard Shuttleworth)** 是 Ubuntu 的创始人,也被称作 [Debian 背后的人][1]([之一][2])。他于 1973 年出生在南非的韦尔科姆(Welkom)。他不仅是个企业家,还是个太空游客——他是第一个前往太空旅行的非洲独立国家的公民。 -Mark 曾在 1996 年成立了 **Thawte**,一家互联网安全企业,那时他还只是 University of Cape Town(开普敦大学)的一名金融/IT学生。 +马克曾在 1996 年成立了一家名为 **Thawte** 的互联网商务安全公司,那时他还在开普敦大学( University of Cape Town)的学习金融和信息技术。 -2000 年,Mark 创立了 HBD,一家投资公司,同时他还创立了 Shuttleworth 基金会,致力于给社会中有创新性的领袖以奖金和投资等形式提供资助。 +2000 年,马克创立了 HBD(Here be Dragons (此处有龙/危险)的缩写,所以其吉祥物是一只龙),这是一家投资公司,同时他还创立了沙特尔沃思基金会(Shuttleworth Foundation),致力于给社会中有创新性的领袖以奖金和投资等形式提供资助。 - -> "移动设备对于个人电脑行业的未来而言至关重要。比如就在这个月,相对于平板电脑的发展而言,传统 PC 行业很明显正在萎缩。所以如果我们想要涉足个人电脑产业,我们必须首先涉足移动行业。移动产业之所以有趣,还因为在这里没有盗版 Windows 操作系统。所以如果你为你的操作系统赢得了一台设备的市场份额,这台设备会持续使用你的操作系统。在传统 PC 行业,我们时不时得和“免费”的 Windows 产生竞争,这是一种非常微妙的挑战。所以我们现在的重心是围绕 Ubuntu 和移动设备——手机和平板——以图与普通用户建立更深层次的联系。" +> "移动设备对于个人电脑行业的未来而言至关重要。比如就在这个月,相对于平板电脑的发展而言,传统 PC 行业很明显正在萎缩。所以如果我们想要涉足个人电脑产业,我们必须首先涉足移动行业。移动产业之所以有趣,是因为在这里没有盗版 Windows 操作系统的市场。所以如果你为你的操作系统赢得了一台设备的市场份额,这台设备会一直使用你的操作系统。在传统 PC 行业,我们时不时得和“免费”的 Windows 产生竞争,这是一种非常微妙的挑战。所以我们现在的重心是围绕 Ubuntu 和移动设备——手机和平板——以图与普通用户建立更深层次的联系。" > -> — Mark Shuttleworth +> — 马克·沙特尔沃思 -2002 年,他在俄罗斯的 Star City 接受了为期一年的训练,随后作为联盟号 TM-34 任务组的一员飞往了国际空间站。再后来,在发起面向有志于航空航天或者其相关学科的南非学生群体中推广科学、编程及数学的运动后,Mark 创立了 **Canonical Ltd**。此后直至2013年,他一直在领导 Ubuntu 操作系统的开发。 - - -现今,Shuttleworth 拥有英国与南非双重国籍并和 18 只可爱的鸭子住在英国的 Isle of Man 小岛上的一处花园,一同的还有他可爱的女友 Claire,两条黑母狗以及时不时经过的羊群。 +2002 年,他在俄罗斯的星城(Star City)接受了为期一年的训练,随后作为联盟号 TM-34 任务组的一员飞往了国际空间站。再后来,在面向有志于航空航天或者其相关学科的南非学生群体发起了推广科学、编程及数学的运动后,马克 创立了 **Canonical Ltd**。此后直至2013年,他一直在领导 Ubuntu 操作系统的开发。 +现今,Shuttleworth 拥有英国与南非双重国籍并和 18 只可爱的鸭子住在英国的 Isle of Man 小岛上的一处花园,一同的还有他可爱的女友 Claire,两条黑色母狗以及时不时经过的羊群。 > "电脑不仅仅是一台电子设备了。它现在是你思维的延续,以及通向他人的大门。" > -> — Mark Shuttleworth +> — 马克·沙特尔沃思 -### Mark Shuttleworth 的早年生活### -正如我们之前提到的,Mark 出生在南非的橙色自由州 Welkom。他是一名外科医生和护士学校教师的孩子。他在 Western Province Preparatory School 就读并在 1986 年成为了学生会主席,一个学期后就读于 Rondebosch 男子高中,再之后入学 Bishops/Diocesan 学院并在 1991 年再次成为那里的学生会主席。 +### 马克·沙特尔沃思的早年生活### -Mark 在 University of Cape Town 拿到了 Bachelor of Business Science degree in the Finance and Information Systems (译注:商业科学里的双学士学位,两个学科分别是金融和信息系统),他在学校就读时住在 Smuts Hall。作为学生,他也在那里帮助安装了学校的第一条宿舍网络。 +正如我们之前提到的,马克出生在南非的奥兰治自由邦(Orange Free State)的韦尔科姆(Welkom)。他是一名外科医生和护士学校教师的孩子。他在西部省预科学校就读并在 1986 年成为了学生会主席,一个学期后就读于 Rondebosch 男子高中,再之后入学 Bishops Diocesan 学院并在 1991 年再次成为那里的学生会主席。 + +马克在开普敦大学( University of Cape Town)拿到了金融和信息系统的商业科学双学士学位,他在学校就读时住在 Smuts Hall。作为学生,他也在那里帮助安装了学校的第一条宿舍互联网接入。 >“无数的企业和国家已经证明,引入开源政策能提高竞争力和效率。在不同层面上创造生产力对于公司和国家而言都是至关重要的。” > -> — Mark Shuttleworth +> — 马克·沙特尔沃思 -### Mark Shuttleworth 的职业生涯 ### +### 马克·沙特尔沃思的职业生涯 ### -Mark 在 1995 年创立了 Thawte,公司专注于数字证书和互联网安全,然后在 1999 年把公司卖给了 VeriSign,赚取了大约 5.75 亿美元。 +马克在 1995 年创立了 Thawte,公司专注于数字证书和互联网安全,然后在 1999 年把公司卖给了 VeriSign,赚取了大约 5.75 亿美元。 -2000 年,Mark 创立了 HBD 风险资本公司,这项事业成为了投资方和项目孵化器。2004 年,他创立了 Canonical Ltd. 以支持和鼓励自由软件开发项目的商业化,特别是 Ubuntu 操作系统的项目。直到 2009 年,Mark 才从 Canonical CEO 的位置上退下。 +2000 年,马克创立了 HBD 风险资本公司,成为了商业投资人和项目孵化器。2004 年,他创立了 Canonical Ltd. 以支持和鼓励自由软件开发项目的商业化,特别是 Ubuntu 操作系统的项目。直到 2009 年,马克才从 Canonical CEO 的位置上退下。 -> “在 [DDC](https://en.wikipedia.org/wiki/DCC_Alliance) (译者:一个 Debian GNU/Linux 开发者联盟) 的早期,我更倾向于让拥护者放手去做,看看能发展出什么。” +> “在 [DDC](https://en.wikipedia.org/wiki/DCC_Alliance) (LCTT 译注:一个 Debian GNU/Linux 开发者联盟) 的早期,我更倾向于让拥护者们放手去做,看看能发展出什么。” > -> — Mark Shuttleworth +> — 马克·沙特尔沃思 -### Linux、免费开源软件 与 Mark Shuttleworth ### +### Linux、免费开源软件与马克·沙特尔沃思 ### -在 90 年代末,Mark 曾作为一名开发者参与 Debian 操作系统项目。 +在 90 年代后期,马克曾作为一名开发者参与 Debian 操作系统项目。 -2001 年,Mark 创立了 Shuttleworth 基金会,这是个扎根南非的、非赢利性的基金会,专注于赞助社会创新、免费/教育用途开源软件,曾赞助过 Freedom Toaster。 +2001 年,马克创立了沙特尔沃思基金会,这是个扎根南非的、非赢利性的基金会,专注于赞助社会创新、免费/教育用途开源软件,曾赞助过[自由烤面包机][3](Freedom Toaster)(LCTT 译注:自由烤面包机是一个可以给用户带来的 CD/DVD 上刻录自由软件的公共信息亭)。 -2004 年,Mark 通过出资开发基于 Debian 的 Ubuntu 操作系统回归了自由软件界,这一切也经由他的 Canonical 公司完成。 +2004 年,马克通过出资开发基于 Debian 的 Ubuntu 操作系统返回了自由软件界,这一切也经由他的 Canonical 公司完成。 -2005 年,Mark 出资建立了 Ubuntu 基金会并投入了一千万美元作为启动资金。在 Ubuntu 项目内,Mark 经常被一个朗朗上口的名字称呼——“**SABDFL (Self-Appointed Benevolent Dictator for Life)**”。为了能够找到足够多的能手开发这个巨大的项目,Mark 花费了 6 个月的时间从 Debian 邮件列表里找到能手,这一切都是在他乘坐在南极洲的一艘破冰船——Kapitan Khlebnikov——上完成的。同年,Mark 买下了 Impi Linux 65% 的股份。 +2005 年,马克出资建立了 Ubuntu 基金会并投入了一千万美元作为启动资金。在 Ubuntu 项目内,马克经常被一个朗朗上口的名字称呼——“**SABDFL :自封的生命之仁慈独裁者(Self-Appointed Benevolent Dictator for Life)**”。为了能够找到足够多的高手开发这个巨大的项目,马克花费了 6 个月的时间从 Debian 邮件列表里寻找,这一切都是在他乘坐在南极洲的一艘破冰船——赫列布尼科夫船长号(Kapitan Khlebnikov)——上完成的。同年,马克买下了 Impi Linux 65% 的股份。 > “我呼吁电信公司的掌权者们尽快开发出跨洲际的高效信息传输服务。” > -> — Mark Shuttleworth +> — 马克·沙特尔沃思 -2006 年,KDE 宣布 Shuttleworth 成为第一位 **patron** 级别赞助者——彼时 KDE 最高级别的赞助。这一赞助协议在 2012 年终止,取而代之的是一个使用 KDE 作为默认桌面环境的 Ubuntu 变种——Kubuntu 的资金。 +2006 年,KDE 宣布沙特尔沃思成为 KDE 的**第一赞助人(first patron)**——彼时 KDE 最高级别的赞助。这一赞助协议在 2012 年终止,取而代之的是对 Kubuntu 的资金支持,这是一个使用 KDE 作为默认桌面环境的 Ubuntu 变种。 ![](http://www.unixmen.com/wp-content/uploads/2015/10/shuttleworth-kde.jpg) -2009 年,Shuttleworth 宣布他会从 CEO 退位以更好地关注合作伙伴,产品设计和顾客体验。从 2004 年起担任公司 COO 的 Jane Silber 晋升为 CEO。 +2009 年,Shuttleworth 宣布他会从 Canonical 的 CEO 上退位以更好地关注合作关系、产品设计和客户。从 2004 年起担任公司 COO 的珍妮·希比尔(Jane Silber)晋升为 CEO。 -2010 年,Mark 由于 Ubuntu 项目从 Open University 获得了荣誉学位。 +2010 年,马克由于其贡献而被开放大学(Open University)授予了荣誉学位。 -2012 年,Mark 和 Kenneth Rogoff 一同在牛津大学与 Peter Thiel 和 Garry Kasparov 就**创新悖论**(The Innovation Enigma)展开辩论。 +2012 年,马克和肯尼斯·罗格夫(Kenneth Rogoff)一同在牛津大学与彼得·蒂尔(Peter Thiel)和加里·卡斯帕罗夫(Garry Kasparov)就**创新悖论**(The Innovation Enigma)展开辩论。 -2013 年,Mark 和 Ubuntu 一同被授予**澳大利亚反个人隐私老大哥监控奖**(Austrian anti-privacy Big Brother Award),理由是 Ubuntu 会把 Unity 桌面的搜索框的搜索结果发往 Canonical 服务器(译注:因此侵犯了个人隐私)。而一年前,Mark 曾经申明过这一过程进行了匿名化处理。 +2013 年,马克和 Ubuntu 一同被授予**澳大利亚反个人隐私大哥奖**(Austrian anti-privacy Big Brother Award),理由是默认情况下, Ubuntu 会把 Unity 桌面的搜索框的搜索结果发往 Canonical 服务器(LCTT 译注:因此侵犯了个人隐私)。而一年前,马克曾经申明过这一过程进行了匿名化处理。 - -> “所有主流 PC 厂家现在都提供 Ubuntu 预安装选项。所以我们和业界的合作已经相当紧密了。但那些 PC 厂家对于给买家推广新东西这件事都很紧张。如果我们可以让买家习惯 Ubuntu 的桌面/平板/手机操作系统的体验,那他们也应该更愿意买预装 Ubuntu 的设备。因为没有哪个操作系统是通过抄袭模仿获得成功的。Android 很棒,但如果我们想成功的话我们必须给市场带去更新更好的东西(校注:而不是改进或者模仿 Android)。如果我们中没有人追寻未来的话,我们将陷入停滞不前的危险。但如果你尝试去追寻未来了,那你必须接受不是所有人对未来的预见都和你一样这一事实。” +> “所有主流 PC 厂家现在都提供 Ubuntu 预安装选项,所以我们和业界的合作已经相当紧密了。但那些 PC 厂家对于给买家推广新东西这件事都很紧张。如果我们可以让 PC 买家习惯 Ubuntu 的平板/手机操作系统的体验,那他们也应该更愿意买预装 Ubuntu 的 PC。没有哪个操作系统是通过抄袭模仿获得成功的,Android 很棒,但如果我们想成功的话我们必须给市场带去更新更好的东西(LCTT 译注:而不是改进或者模仿 Android)。如果我们中没有人追寻未来的话,我们将陷入停滞不前的危险。但如果你尝试去追寻未来了,那你必须接受不是所有人对未来的预见都和你一样这一事实。” > -> — Mark Shuttleworth +> — 马克·沙特尔沃思 -### Mark Shuttleworth 的太空之旅 ### - -Mark 在 2002 年作为世界第二名自费太空游客而闻名世界,同时他也是南非第一个旅行太空的人。这趟旅行中,Mark 作为俄罗斯联盟号 TM-34 任务的一名航空参与者加入,并为此支付了约两千万美元。2 天后,联盟号宇宙飞船抵达了国际空间站,在那里 Mark 呆了 8 天并参与了艾滋病和基因组研究的相关实验。同年晚些时候,Mark 随联盟号 TM-33 任务返回了地球。为了参与这趟旅行,Mark 花了一年时间准备与训练,其中有 7 个月居住在俄罗斯的 Start City。 +### 马克·沙特尔沃思的太空之旅 ### +马克在 2002 年作为世界第二名自费太空游客而闻名世界,同时他也是南非第一个旅行太空的人。这趟旅行中,马克作为俄罗斯联盟号 TM-34 任务的一名乘员加入,并为此支付了约两千万美元。2 天后,联盟号宇宙飞船抵达了国际空间站,在那里马克呆了 8 天并参与了艾滋病和基因组研究的相关实验。同年晚些时候,马克随联盟号 TM-33 任务返回了地球。为了参与这趟旅行,马克花了一年时间准备与训练,其中有 7 个月居住在俄罗斯的星城。 ![](http://www.unixmen.com/wp-content/uploads/2015/10/Mark-Shuttleworth1.jpg) -在太空中,Mark 与 Nelson Mandela 和另一个南非女孩 Michelle Foster (她问 Mark 要不要娶她)通过无线电进行了交谈。Mark 回避了结婚问题,在换话题之前他说他感到很荣幸。身患绝症的 Forster 和 Nelson Mandela 通过 Dream 基金会的赞助获得了与 Mark 交谈的机会。 +在太空中,马克与纳尔逊·曼德拉(Nelson Mandela)和另一个 14 岁的南非女孩米歇尔·福斯特(Michelle Foster) (她问马克要不要娶她)通过无线电进行了交谈。马克礼貌地回避了这个结婚问题,在巧妙地改换话题之前他说他感到很荣幸。身患绝症的女孩福斯特通过梦想基金会( Dream foundation)的赞助获得了与马克和纳尔逊·曼德拉交谈的机会。 -归来后,Mark 在世界各地做了旅行,并和各地的学生就太空之旅发表了感言。 +归来后,马克在世界各地做了旅行,并和各地的学生就太空之旅发表了感言。 - ->“粗略的统计数据表明 Ubuntu 的实际用户依然在增长。而我们的合作方——Dell、HP、Lenovo 和其他硬件生产商,以及游戏厂商 EA、Valve 都在加入我们——这让我觉得我们在关键的领域继续领先。” +>“粗略的统计数据表明 Ubuntu 的实际用户依然在增长。而我们的合作方——戴尔、惠普、联想和其他硬件生产商,以及游戏厂商 EA、Valve 都在加入我们——这让我觉得我们在关键的领域继续领先。” > -> — Mark Shuttleworth +> — 马克·沙特尔沃思 -### Mark Shuttleworth 的交通工具 ### +### 马克·沙特尔沃思的交通工具 ### -Mark 有他自己的私人客机 Bombardier Global Express。虽然它经常被称为 Canonical 一号,但事实上此飞机是通过 HBD 风险投资公司注册拥有的。飞机侧面的龙图案涂装是 HBD 风投公司的吉祥物 Norman。 +马克有他自己的私人客机庞巴迪全球特快(Bombardier Global Express),虽然它经常被称为 Canonical 一号,但事实上此飞机是通过 HBD 风险投资公司注册拥有的。涂画在飞机侧面的龙图案是 HBD 风投公司的吉祥物 ,名叫 Norman。 -### 与南非储蓄银行的法律冲突 ### +![](http://www.leader.co.za/leadership/logos/logomarkshuttleworthdirectory_31ce.gif) -在从南非转移 25 亿南非兰特去往 Isle of Man 的过程中,南非储蓄银行征收了 2.5 亿南非兰特的税金。Mark 上诉了,经过冗长的法庭唇枪舌战,南非储蓄银行被勒令返还 2.5 亿征税,以及其利息。Mark 宣布他会把这 2.5 亿存入信托基金,以用于帮助上诉宪法法院的案子。 +### 与南非储备银行的法律冲突 ### + +在从南非转移 25 亿南非兰特去往 Isle of Man 的过程中,南非储备银行征收了 2.5 亿南非兰特的税金。马克上诉了,经过冗长的法庭唇枪舌战,南非储备银行被勒令返还 2.5 亿征税,以及其利息。马克宣布他会把这 2.5 亿存入信托基金,以用于帮助那些上诉到宪法法院的案子。 > “离境征税倒也不和宪法冲突。但离境征税的主要目的不是提高税收,而是通过监管资金流出来保护本国经济。” @@ -105,14 +103,15 @@ Mark 有他自己的私人客机 Bombardier Global Express。虽然它经常被 2015 年,南非宪法法院修正了低级法院的判决结果,并宣布了上述对于离岸征税的理解。 -### Mark Shuttleworth 喜欢的东西 ### +### 马克·沙特尔沃思喜欢的东西 ### -Cesária Évora, mp3s, Spring, Chelsea, finally seeing something obvious for first time, coming home, Sinatra, daydreaming, sundowners, flirting, d’Urberville, string theory, Linux, particle physics, Python, reincarnation, mig-29s, snow, travel, Mozilla, lime marmalade, body shots, the African bush, leopards, Rajasthan, Russian saunas, snowboarding, weightlessness, Iain m banks, broadband, Alastair Reynolds, fancy dress, skinny-dipping, flashes of insight, post-adrenaline euphoria, the inexplicable, convertibles, Clifton, country roads, international space station, machine learning, artificial intelligence, Wikipedia, Slashdot, kitesurfing, and Manx lanes. +Cesária Évora、mp3、春天、切尔西(Chelsea)、“恍然大悟”(finally seeing something obvious for first time)、回家、辛纳屈(Sinatra)、白日梦、暮后小酌、挑逗、苔丝(d’Urberville)、弦理论、Linux、粒子物理、Python、转世、米格-29、雪、旅行、Mozilla、酸橙果酱、激情代价(body shots)、非洲丛林、豹、拉贾斯坦邦、俄罗斯桑拿、单板滑雪、失重、Iain m 银行、宽度、阿拉斯泰尔·雷诺兹(Alastair Reynolds)、化装舞会服装、裸泳、灵机一动、肾上腺素激情消退、莫名(the inexplicable)、活动顶篷式汽车、Clifton、国家公路、国际空间站、机器学习、人工智能、维基百科、Slashdot、风筝冲浪(kitesurfing)和 Manx lanes。 -### Shuttleworth 不喜欢的东西 ### -Admin, salary negotiations, legalese, and public speaking. -(校对:和程序猿不喜欢 PM 一个道理?) + +### 马克·沙特尔沃思不喜欢的东西 ### + +行政、涨工资、法律术语和公众演讲。 -------------------------------------------------------------------------------- @@ -120,8 +119,11 @@ via: http://www.unixmen.com/mark-shuttleworth-man-behind-ubuntu-operating-system 作者:[M.el Khamlichi][a] 译者:[Moelf](https://github.com/Moelf) -校对:[PurlingNayuki](https://github.com/PurlingNayuki) +校对:[PurlingNayuki](https://github.com/PurlingNayuki), [wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://www.unixmen.com/author/pirat9/ +[1]:https://wiki.debian.org/PeopleBehindDebian +[2]:https://raphaelhertzog.com/2011/11/17/people-behind-debian-mark-shuttleworth-ubuntus-founder/ +[3]:https://en.wikipedia.org/wiki/Freedom_Toaster \ No newline at end of file From 3d20813c1ba8ba15bd78c6e7010116fca05d6117 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 29 Jun 2016 06:10:30 +0800 Subject: [PATCH 1023/1469] =?UTF-8?q?=E5=B7=B2=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Raspberry Pi projects for the classroom.md | 98 ------------------- 1 file changed, 98 deletions(-) delete mode 100644 translated/talk/yearbook2015/20151208 5 great Raspberry Pi projects for the classroom.md diff --git a/translated/talk/yearbook2015/20151208 5 great Raspberry Pi projects for the classroom.md b/translated/talk/yearbook2015/20151208 5 great Raspberry Pi projects for the classroom.md deleted file mode 100644 index 06191d551c..0000000000 --- a/translated/talk/yearbook2015/20151208 5 great Raspberry Pi projects for the classroom.md +++ /dev/null @@ -1,98 +0,0 @@ -5 个适合课堂教学的树莓派项目 -================================================================================ -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/osdc-open-source-yearbook-lead3.png) - -图片来源 : opensource.com - -### 1. Minecraft Pi ### - -![](https://opensource.com/sites/default/files/lava.png) - -上图由树莓派基金会提供。遵循 [CC BY-SA 4.0.][1] 协议。 - -Minecraft(我的世界)几乎是世界上每个青少年都极其喜爱的游戏 —— 在吸引年轻人注意力方面,它也是最具创意的游戏之一。伴随着每一个树莓派的游戏版本不仅仅是一个关于创造性思维的建筑游戏,它还带有一个编程接口,允许使用者通过 Python 代码来与 Minecraft 世界进行互动。 - -对于教师来说,Minecraft: Pi 版本是一个鼓励学生们解决遇到的问题以及通过书写代码来执行特定任务的极好方式。你可以使用 Python API - 来建造一所房子,让它跟随你到任何地方;或在你所到之处修建一座桥梁;又或者是下一场岩溶雨;或在天空中显示温度;以及其他任何你能想像到的事物。 - -可在 "[Minecraft Pi 入门][2]" 中了解更多相关内容。 - -### 2. 反应游戏和交通指示灯 ### - -![](https://opensource.com/sites/default/files/pi_traffic_installed_yellow_led_on.jpg) - -上图由 [Low Voltage Labs][3] 提供。遵循 [CC BY-SA 4.0][1] 协议。 - -在树莓派上进行物理计算是非常容易的 —— 只需将 LED 灯 和按钮连接到 GPIO 针脚上,再加上少量的代码,你就可以点亮 LED 灯并通过按按钮来控制物体。一旦你知道来执行基本操作的代码,下一步就可以随你的想像那样去做了! - -假如你知道如何让一盏灯闪烁,你就可以让三盏灯闪烁。选出三盏交通灯颜色的 LED 灯,你就可以编程出交通灯闪烁序列。假如你知道如何使用一个按钮来触发一个事件,然后你就有一个人行横道了!同时,你还可以找到诸如 [PI-TRAFFIC][4]、[PI-STOP][5]、[Traffic HAT][6] 等预先构建好的交通灯插件。 - -这不总是关于代码的 —— 它还可以被用来作为一个的练习,用以理解真实世界中的系统是如何被设计出来的。计算思维在生活中的各种情景中都是一个有用的技能。 - -![](https://opensource.com/sites/default/files/reaction-game.png) - -上图由树莓派基金会提供。遵循 [CC BY-SA 4.0][1] 协议。 - -下面尝试将两个按钮和一个 LED 灯连接起来,来制作一个二人制反应游戏 —— 让灯在一段随机的时间中点亮,然后看谁能够先按到按钮! - -想了解更多的话,请查看 [GPIO 新手指南][7]。你所需要的尽在 [CamJam EduKit 1][8]。 - -### 3. Sense HAT 像素宠物 ### - -Astro Pi— 一个增强版的树莓派 —将于今年 12 月(注:应该是去年的事了。)问世,但你并没有错过让你的手玩弄硬件的机会。Sense HAT 是一个用在 Astro Pi 任务中的感应器主板插件,且任何人都可以买到。你可以用它来做数据收集、科学实验、游戏或者更多。 观看下面这个由树莓派的 Carrie Anne 带来的 Gurl Geek Diaries 录像来开始一段美妙的旅程吧 —— 通过在 Sense HAT 的显示器上展现出你自己设计的一个动物像素宠物: - -注:youtube 视频 - - -在 "[探索 Sense HAT][9]" 中可以学到更多。 - -### 4. 红外鸟箱 ### - -![](https://opensource.com/sites/default/files/ir-bird-box.png) -上图由 [Low Voltage Labs][3] 提供。遵循 [CC BY-SA 4.0][1] 协议。 - -让全班所有同学都能够参与进来的一个好的练习是 —— 在一个鸟箱中沿着某些红外线放置一个树莓派和 NoIR 照相模块,这样你就可以在黑暗中观看,然后通过网络或在网络中你可以从树莓派那里获取到视频流。等鸟进入笼子,然后你就可以在不打扰到它们的情况下观察它们。 - -在这期间,你可以学习到所有关于红外和光谱的知识,以及如何用软件来调整摄像头的焦距和控制它。 - -在 "[制作一个红外鸟箱][10]" 中你可以学到更多。 - -### 5. 机器人 ### - -![](https://opensource.com/sites/default/files/edukit3_1500-alex-eames-sm.jpg) - -上图由 Low Voltage Labs 提供。遵循 [CC BY-SA 4.0][1] 协议。 - -拥有一个树莓派,一些感应器和一个感应器控制电路板,你就可以构建你自己的机器人。你可以制作各种类型的机器人,从用透明胶带和自制底盘组合在一起的简易四驱车,一直到由游戏控制器驱动的具有自我意识,带有传感器和摄像头的金属马儿。 - -学习如何直接去控制单个的发动机,例如通过 RTK Motor Controller Board (£8/$12),或者尝试新的 CamJam robotics kit (£17/$25) ,它带有发动机、轮胎和一系列的感应器 — 这些都很有价值并很有学习的潜力。 - -另外,如何你喜欢更为骨灰级别的东西,可以尝试 PiBorg 的 [4Borg][11] (£99/$150) 或 [DiddyBorg][12] (£180/$273) 或者一干到底,享受他们的 DoodleBorg 金属版 (£250/$380) — 并构建一个他们声名远扬的 [DoodleBorg tank][13](很不幸的时,这个没有卖的) 的迷你版。 - -另外请参考 [CamJam robotics kit worksheets][14]。 - --------------------------------------------------------------------------------- - -via: https://opensource.com/education/15/12/5-great-raspberry-pi-projects-classroom - -作者:[Ben Nuttall][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/bennuttall -[1]:https://creativecommons.org/licenses/by-sa/4.0/ -[2]:https://opensource.com/life/15/5/getting-started-minecraft-pi -[3]:http://lowvoltagelabs.com/ -[4]:http://lowvoltagelabs.com/products/pi-traffic/ -[5]:http://4tronix.co.uk/store/index.php?rt=product/product&product_id=390 -[6]:https://ryanteck.uk/hats/1-traffichat-0635648607122.html -[7]:http://pythonhosted.org/gpiozero/recipes/ -[8]:http://camjam.me/?page_id=236 -[9]:https://opensource.com/life/15/10/exploring-raspberry-pi-sense-hat -[10]:https://www.raspberrypi.org/learning/infrared-bird-box/ -[11]:https://www.piborg.org/4borg -[12]:https://www.piborg.org/diddyborg -[13]:https://www.piborg.org/doodleborg -[14]:http://camjam.me/?page_id=1035#worksheets From 43f4e88ce27b1d9f9b518309eb93d8fbd4af4cb6 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 29 Jun 2016 06:31:25 +0800 Subject: [PATCH 1024/1469] PUB:20160520 ORB - NEW GENERATION OF LINUX APPS ARE HERE @alim0x --- ...- NEW GENERATION OF LINUX APPS ARE HERE.md | 60 ++++++++----------- 1 file changed, 26 insertions(+), 34 deletions(-) rename {translated/tech => published}/20160520 ORB - NEW GENERATION OF LINUX APPS ARE HERE.md (62%) diff --git a/translated/tech/20160520 ORB - NEW GENERATION OF LINUX APPS ARE HERE.md b/published/20160520 ORB - NEW GENERATION OF LINUX APPS ARE HERE.md similarity index 62% rename from translated/tech/20160520 ORB - NEW GENERATION OF LINUX APPS ARE HERE.md rename to published/20160520 ORB - NEW GENERATION OF LINUX APPS ARE HERE.md index cc212e7a4c..4f31e9ed63 100644 --- a/translated/tech/20160520 ORB - NEW GENERATION OF LINUX APPS ARE HERE.md +++ b/published/20160520 ORB - NEW GENERATION OF LINUX APPS ARE HERE.md @@ -5,19 +5,19 @@ ORB:新一代 Linux 应用 我们之前讨论过[在 Ubuntu 上离线安装应用][1]。我们现在要再次讨论它。 -[Orbital Apps][2] 给我们带来了新的软件包类型,**ORB**,它带有便携软件,交互式安装向导支持,以及离线使用的能力。 +[Orbital Apps][2] 给我们带来了一种新的软件包类型 **ORB**,它具有便携软件、交互式安装向导支持,以及离线使用的能力。 -便携软件很方便。主要是因为它们能够无需任何管理员权限直接运行,也能够带着所有的设置和数据随U盘存储。而交互式的安装向导也能让我们轻松地安装应用。 +便携软件很方便。主要是因为它们能够无需任何管理员权限直接运行,也能够带着所有的设置和数据随 U 盘存储。而交互式的安装向导也能让我们轻松地安装应用。 -### 开放可运行包 OPEN RUNNABLE BUNDLE (ORB) +### 开放式可运行的打包(OPEN RUNNABLE BUNDLE) (ORB) -ORB 是一个免费和开源的包格式,它和其它包格式在很多方面有所不同。ORB 的一些特性: +ORB 是一个自由开源的包格式,它和其它包格式在很多方面有所不同。ORB 的一些特性: -- **压缩**:所有的包经过压缩,使用 squashfs,体积最多减少 60%。 -- **便携模式**:如果一个便携 ORB 应用是从可移动设备运行的,它会把所有设置和数据存储在那之上。 +- **压缩**:所有的包都经过 squashfs 压缩,体积最多可减少 60%。 +- **便携模式**:如果一个便携 ORB 应用是在可移动设备上运行的,它会把所有设置和数据存储在那之上。 - **安全**:所有的 ORB 包使用 PGP/RSA 签名,通过 TLS 1.2 分发。 - **离线**:所有的依赖都打包进软件包,所以不再需要下载依赖。 -- **开放包**:ORB 包可以作为 ISO 镜像挂载。 +- **开放式软件包**:ORB 软件包可以作为 ISO 镜像挂载。 ### 种类 @@ -26,77 +26,69 @@ ORB 应用现在有两种类别: - 便携软件 - SuperDEB -#### 1. 便携 ORB 软件 +### 1. 便携 ORB 软件 -便携 ORB 软件可以立即运行而不需要任何的事先安装。那意味着它不需要管理员权限和依赖!你可以直接从 Orbital Apps 网站下载下来就能使用。 +便携 ORB 软件可以立即运行而不需要任何的事先安装。这意味着它不需要管理员权限,也没有依赖!你可以直接从 Orbital Apps 网站下载下来就能使用。 -并且由于它支持便携模式,你可以将它拷贝到U盘携带。它所有的设置和数据会和它一起存储在U盘。只需将U盘连接到任何运行 Ubuntu 16.04 的机器上就行了。 +并且由于它支持便携模式,你可以将它拷贝到 U 盘携带。它所有的设置和数据会和它一起存储在 U 盘。只需将 U 盘连接到任何运行 Ubuntu 16.04 的机器上就行了。 -##### 可用便携软件 +#### 可用便携软件 目前有超过 35 个软件以便携包的形式提供,包括一些十分流行的软件,比如:[Deluge][3],[Firefox][4],[GIMP][5],[Libreoffice][6],[uGet][7] 以及 [VLC][8]。 完整的可用包列表可以查阅 [便携 ORB 软件列表][9]。 -##### 使用便携软件 +#### 使用便携软件 按照以下步骤使用便携 ORB 软件: - 从 Orbital Apps 网站下载想要的软件包。 -- 将其移动到想要的位置(本地磁盘/U盘)。 +- 将其移动到想要的位置(本地磁盘/U 盘)。 - 打开存储 ORB 包的目录。 -![](http://itsfoss.com/wp-content/uploads/2016/05/using-portable-orb-app-1-1024x576.jpg) - + ![](http://itsfoss.com/wp-content/uploads/2016/05/using-portable-orb-app-1-1024x576.jpg) - 打开 ORB 包的属性。 -![](http://itsfoss.com/wp-content/uploads/2016/05/using-portable-orb-app-2.jpg) ->给 ORB 包添加运行权限 + ![给 ORB 包添加运行权限](http://itsfoss.com/wp-content/uploads/2016/05/using-portable-orb-app-2.jpg) - 在权限标签页添加运行权限。 - 双击打开它。 等待几秒,让它准备好运行。大功告成。 -#### 2. SuperDEB +### 2. SuperDEB 另一种类型的 ORB 软件是 SuperDEB。SuperDEB 很简单,交互式安装向导能够让软件安装过程顺利得多。如果你不喜欢从终端或软件中心安装软件,superDEB 就是你的菜。 最有趣的部分是你安装时不需要一个互联网连接,因为所有的依赖都由安装向导打包了。 -##### 可用的 SuperDEB +#### 可用的 SuperDEB 超过 60 款软件以 SuperDEB 的形式提供。其中一些流行的有:[Chromium][10],[Deluge][3],[Firefox][4],[GIMP][5],[Libreoffice][6],[uGet][7] 以及 [VLC][8]。 完整的可用 SuperDEB 列表,参阅 [SuperDEB 列表][11]。 -##### 使用 SuperDEB 安装向导 +#### 使用 SuperDEB 安装向导 - 从 Orbital Apps 网站下载需要的 SuperDEB。 - 像前面一样给它添加**运行权限**(属性 > 权限)。 - 双击 SuperDEB 安装向导并按下列说明操作: -![](http://itsfoss.com/wp-content/uploads/2016/05/Using-SuperDEB-Installer-1.png) ->点击 OK + ![点击 OK](http://itsfoss.com/wp-content/uploads/2016/05/Using-SuperDEB-Installer-1.png) -![](http://itsfoss.com/wp-content/uploads/2016/05/Using-SuperDEB-Installer-2.png) ->输入你的密码并继续 + ![输入你的密码并继续](http://itsfoss.com/wp-content/uploads/2016/05/Using-SuperDEB-Installer-2.png) -![](http://itsfoss.com/wp-content/uploads/2016/05/Using-SuperDEB-Installer-3.png) ->它会开始安装… + ![它会开始安装…](http://itsfoss.com/wp-content/uploads/2016/05/Using-SuperDEB-Installer-3.png) -![](http://itsfoss.com/wp-content/uploads/2016/05/Using-SuperDEB-Installer-4.png) ->一会儿他就完成了… + ![一会儿它就完成了…](http://itsfoss.com/wp-content/uploads/2016/05/Using-SuperDEB-Installer-4.png) - 完成安装之后,你就可以正常使用了。 ### ORB 软件兼容性 -从 Orbital Apps 可知,它们完全适配 Ubuntu 16.04 [64 bit]。 +从 Orbital Apps 可知,它们完全适配 Ubuntu 16.04 [64 位]。 ->阅读建议:[如何在 Ubuntu 获知你的是电脑 32 位还是 64 位的][12]。 - -至于其它发行版兼容性不受保证。但我们可以说,它在所有 Ubuntu 16.04 衍生版(UbuntuMATE,UbuntuGNOME,Lubuntu,Xubuntu 等)以及基于 Ubuntu 16.04 的发行版(比如即将到来的 Linux Mint 18)上都适用。我们现在还不清楚 Orbital Apps 是否有计划拓展它的支持到其它版本 Ubuntu 或 Linux 发行版上。 +至于其它发行版兼容性则不受保证。但我们可以说,它在所有 Ubuntu 16.04 衍生版(UbuntuMATE,UbuntuGNOME,Lubuntu,Xubuntu 等)以及基于 Ubuntu 16.04 的发行版(比如即将到来的 Linux Mint 18)上都适用。我们现在还不清楚 Orbital Apps 是否有计划拓展它的支持到其它版本 Ubuntu 或 Linux 发行版上。 如果你在你的系统上经常使用便携 ORB 软件,你可以考虑安装 ORB 启动器。它不是必需的,但是推荐安装它以获取更佳的体验。最简短的 ORB 启动器安装流程是打开终端输入以下命令: @@ -116,11 +108,11 @@ wget -O - https://www.orbital-apps.com/orb.sh | bash ---------------------------------- -via: http://itsfoss.com/orb-linux-apps/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 +via: http://itsfoss.com/orb-linux-apps/ 作者:[Munif Tanjim][a] 译者:[alim0x](https://github.com/alim0x) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 01ae32507b400e0096ad041392ef4d0daedb63da Mon Sep 17 00:00:00 2001 From: bazz2 Date: Wed, 29 Jun 2016 07:10:36 +0800 Subject: [PATCH 1025/1469] [bazz2 translating]Building Serverless App with Docker --- sources/tech/20160621 Building Serverless App with Docker.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160621 Building Serverless App with Docker.md b/sources/tech/20160621 Building Serverless App with Docker.md index 9791ee5aa6..efedc85ffd 100644 --- a/sources/tech/20160621 Building Serverless App with Docker.md +++ b/sources/tech/20160621 Building Serverless App with Docker.md @@ -1,3 +1,4 @@ +[bazz222222222] BUILDING SERVERLESS APPS WITH DOCKER ====================================== From 24fb3deab47cbe2d233d6fa4c71f242adc06503e Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 29 Jun 2016 08:17:32 +0800 Subject: [PATCH 1026/1469] PUB:20160510 65% of companies are contributing to open source projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Cathon 翻译的不错,语言组织很好。 --- ...es are contributing to open source projects.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) rename {translated/talk => published}/20160510 65% of companies are contributing to open source projects.md (70%) diff --git a/translated/talk/20160510 65% of companies are contributing to open source projects.md b/published/20160510 65% of companies are contributing to open source projects.md similarity index 70% rename from translated/talk/20160510 65% of companies are contributing to open source projects.md rename to published/20160510 65% of companies are contributing to open source projects.md index 03290b0e97..46939a4e3a 100644 --- a/translated/talk/20160510 65% of companies are contributing to open source projects.md +++ b/published/20160510 65% of companies are contributing to open source projects.md @@ -3,11 +3,11 @@ ![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BUSINESS_openseries.png?itok=s7lXChId) -今年 Black Duck 和 North Bridge 发布了第十届年度开源软件前景调查,来检验开源软件的发展趋势。今年这份调查的亮点在于,当前主流社会对开源软件的接受程度以及过去的十年中人们对开源软件态度的变化。 +今年 Black Duck 和 North Bridge 发布了第十届年度开源软件前景调查,来调查开源软件的发展趋势。今年这份调查的亮点在于,当前主流社会对开源软件的接受程度以及过去的十年中人们对开源软件态度的变化。 -[2016 年的开源软件前景调查][1],分析了来自约3400位专家的反馈。今年的调查中,开发者发表了他们的看法,包括了大约 70% 的参与者。数据显示,安全专家的参与人数呈指数级增长,增长超过 450% 。他们的参与表明,开源社区开始逐渐关注开源软件中存在的安全问题,以及当新的技术出现时确保它们的安全性。 +[2016 年的开源软件前景调查][1],分析了来自约3400位专家的反馈。今年的调查中,开发者发表了他们的看法,大约 70% 的参与者是开发者。数据显示,安全专家的参与人数呈指数级增长,增长超过 450% 。他们的参与表明,开源社区开始逐渐关注开源软件中存在的安全问题,以及当新的技术出现时确保它们的安全性。 -Black Duck 的年度 [开源新秀奖][2] 涉及到一些新出现的技术,如 Docker 和 Kontena 容器。容器技术这一年有了巨大的发展 ———— 76% 的受访者表示,他们的企业有一些使用容器技术的规划。而 59% 的受访者正准备使用容器技术完成大量的部署,从开发与测试,到内部与外部的生产环境部署。开发者社区已经把容器技术作为一种简单快速开发的方法。 +Black Duck 的[年度开源新秀奖][2] 涉及到一些新出现的技术,如容器方面的 Docker 和 Kontena。容器技术这一年有了巨大的发展 ———— 76% 的受访者表示,他们的企业有一些使用容器技术的规划。而 59% 的受访者正准备使用容器技术完成大量的部署,从开发与测试,到内部与外部的生产环境部署。开发者社区已经把容器技术作为一种简单快速开发的方法。 调查显示,几乎每个组织都有开发者致力于开源软件,这一点毫不惊讶。当像微软和苹果这样的大公司将它们的一些解决方案开源时,开发者就获得了更多的机会来参与开源项目。我非常希望这样的趋势会延续下去,让更多的软件开发者无论在工作中,还是工作之余都可以致力于开源项目。 @@ -30,11 +30,11 @@ Black Duck 的年度 [开源新秀奖][2] 涉及到一些新出现的技术, #### 安全和管理 -一流的开源安全与管理实践的发展,并没有跟上人们使用开源不断增长的步伐。尽管备受关注的开源项目近年来爆炸式地增长,调查结果却指出: +一流的开源安全与管理实践的发展,也没有跟上人们使用开源不断增长的步伐。尽管备受关注的开源项目近年来爆炸式地增长,调查结果却指出: * 50% 的企业在选择和批准开源代码这方面没有出台正式的政策。 * 47% 的企业没有正式的流程来跟踪开源代码,这就限制了它们对开源代码的了解,以及控制开源代码的能力。 -* 超过三分之一的企业没有用于识别,跟踪,和修复重大开源安全漏洞的流程。 +* 超过三分之一的企业没有用于识别、跟踪和修复重大开源安全漏洞的流程。 #### 不断增长的开源参与者 @@ -45,16 +45,17 @@ Black Duck 的年度 [开源新秀奖][2] 涉及到一些新出现的技术, * 约三分之一的企业有专门为开源项目设置的全职岗位。 * 59% 的受访者参与开源项目以获得竞争优势。 -Black Duck 和 North Bridge 从今年的调查中了解了很多,如安全,政策,商业模式等。我们很兴奋能够分享这些新发现。感谢我们的合作者,以及所有参与我们调查的受访者。这是一个伟大的十年,我很高兴我们可以肯定地说,开源的未来充满了无限可能。 +Black Duck 和 North Bridge 从今年的调查中了解到了很多,如安全,政策,商业模式等。我们很兴奋能够分享这些新发现。感谢我们的合作者,以及所有参与我们调查的受访者。这是一个伟大的十年,我很高兴我们可以肯定地说,开源的未来充满了无限可能。 想要了解更多内容,可以查看完整的[调查结果][3]。 + -------------------------------------------------------------------------------- via: https://opensource.com/business/16/5/2016-future-open-source-survey 作者:[Haidee LeClair][a] 译者:[Cathon](https://github.com/Cathon) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) [a]: https://opensource.com/users/blackduck2016 [1]: http://www.slideshare.net/blackducksoftware/2016-future-of-open-source-survey-results From a221770db74f303f528d0f1d2a1b27813ace74d8 Mon Sep 17 00:00:00 2001 From: bazz2 Date: Wed, 29 Jun 2016 08:56:30 +0800 Subject: [PATCH 1027/1469] [translated] Building Serverless App with Docker --- ...621 Building Serverless App with Docker.md | 100 ------------------ ...621 Building Serverless App with Docker.md | 98 +++++++++++++++++ 2 files changed, 98 insertions(+), 100 deletions(-) delete mode 100644 sources/tech/20160621 Building Serverless App with Docker.md create mode 100644 translated/tech/20160621 Building Serverless App with Docker.md diff --git a/sources/tech/20160621 Building Serverless App with Docker.md b/sources/tech/20160621 Building Serverless App with Docker.md deleted file mode 100644 index efedc85ffd..0000000000 --- a/sources/tech/20160621 Building Serverless App with Docker.md +++ /dev/null @@ -1,100 +0,0 @@ -[bazz222222222] -BUILDING SERVERLESS APPS WITH DOCKER -====================================== - -Every now and then, there are waves of technology that threaten to make the previous generation of technology obsolete. There has been a lot of talk about a technique called “serverless” for writing apps. The idea is to deploy your application as a series of functions, which are called on-demand when they need to be run. You don’t need to worry about managing servers, and these functions scale as much as you need, because they are called on-demand and run on a cluster. - -But serverless doesn’t mean there is no Docker – in fact, Docker is serverless. You can use Docker to containerize these functions, then run them on-demand on a Swarm. Serverless is a technique for building distributed apps and Docker is the perfect platform for building them on. - -### From servers to serverless - -So how might we write applications like this? Let’s take our example [a voting application consisting of 5 services][1]: - -![](https://blog.docker.com/wp-content/uploads/Picture1.png) - -This consists of: - -- Two web frontends -- A worker for processing votes in the background -- A message queue for processing votes -- A database - -The background processing of votes is a very easy target for conversion to a serverless architecture. In the voting app, we can run a bit of code like this to run the background task: - -``` -import dockerrun -client = dockerrun.from_env() -client.run("bfirsh/serverless-record-vote-task", [voter_id, vote], detach=True) -``` - -The worker and message queue can be replaced with a Docker container that is run on-demand on a Swarm, automatically scaling to demand. - -We can even eliminate the web frontends. We can replace them with Docker containers that serve up a single HTTP request, triggered by a lightweight HTTP server that spins up Docker containers for each HTTP request. The heavy lifting has now moved the long-running HTTP server to Docker containers that run on-demand, so they can automatically scale to handle load. - -Our new architecture looks something like this: - -![](https://blog.docker.com/wp-content/uploads/Picture2.png) - -The red blocks are the continually running services and the green blocks are Docker containers that are run on-demand. This application has fewer long-running services that need managing, and by its very nature scales up automatically in response to demand (up to the size of your Swarm!). - -### So what can we do with this? - -There are three useful techniques here which you can use in your apps: - -1. Run functions in your code as on-demand Docker containers -2. Use a Swarm to run these on a cluster -3. Run containers from containers, by passing a Docker API socket - - -With the combination of these techniques, this opens up loads of possibilities about how you can architect your applications. Running background work is a great example of something that works well, but a whole load of other things are possible too, for example: - -- Launching a container to serve user-facing HTTP requests is probably not practical due to the latency. However – you could write a load balancer which knew how to auto-scale its own web frontends by running containers on a Swarm. -- A MongoDB container which could introspect the structure of a Swarm and launch the correct shards and replicas. - -### What’s next - -We’ve got all these radically new tools and abstractions for building apps, and we’ve barely scratched the surface of what is possible with them. We’re still building applications like we have servers that stick around for a long time, not for the future where we have Swarms that can run code on-demand anywhere in your infrastructure. - -This hopefully gives you some ideas about what you can build, but we also need your help. We have all the fundamentals to be able to start building these applications, but its still in its infrancy – we need better tooling, libraries, example apps, documentation, and so on. - -[This GitHub repository has links off to tools, libraries, examples, and blog posts][3]. Head over there if you want to learn more, and please contribute any links you have there so we can start working together on this. - -Get involved, and happy hacking! - -### Learn More about Docker - -- New to Docker? Try our 10 min [online tutorial][4] -- Share images, automate builds, and more with [a free Docker Hub account][5] -- Read the Docker [1.12 Release Notes][6] -- Subscribe to [Docker Weekly][7] -- Sign up for upcoming [Docker Online Meetups][8] -- Attend upcoming [Docker Meetups][9] -- Watch [DockerCon EU 2015 videos][10] -- Start [contributing to Docker][11] - - --------------------------------------------------------------------------------- - -via: https://blog.docker.com/2016/06/building-serverless-apps-with-docker/ - -作者:[Ben Firshman][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://blog.docker.com/author/bfirshman/ - -[1]: https://github.com/docker/example-voting-app -[3]: https://github.com/bfirsh/serverless-docker -[4]: https://docs.docker.com/engine/understanding-docker/ -[5]: https://hub.docker.com/ -[6]: https://docs.docker.com/release-notes/ -[7]: https://www.docker.com/subscribe_newsletter/ -[8]: http://www.meetup.com/Docker-Online-Meetup/ -[9]: https://www.docker.com/community/meetup-groups -[10]: https://www.youtube.com/playlist?list=PLkA60AVN3hh87OoVra6MHf2L4UR9xwJkv -[11]: https://docs.docker.com/contributing/contributing/ - - - diff --git a/translated/tech/20160621 Building Serverless App with Docker.md b/translated/tech/20160621 Building Serverless App with Docker.md new file mode 100644 index 0000000000..9af6c5d7aa --- /dev/null +++ b/translated/tech/20160621 Building Serverless App with Docker.md @@ -0,0 +1,98 @@ +用 docker 创建 serverless 应用 +====================================== + +当今世界会时不时地出现一波科技浪潮,将以前的技术拍死在海滩上。针对 serverless 应用的概念我们已经谈了很多,它是指将你的应用程序按功能来部署,这些功能在被用到时才会启动。你不用费心去管理服务器和程序规模,因为它们会在需要的时候在一个集群中启动并运行。 + +但是 serverless 并不意味着没有 Docker 什么事儿,事实上 Docker 就是 serverless 的。你可以使用 Docker 来容器化这些功能,然后在 Swarm 中按需求来运行它们。Serverless 是一项构建分布式应用的技术,而 Docker 是它们完美的构建平台。 + +### 从 servers 到 serverless + +那如何才能写一个 serverless 应用呢?来看一下我们的例子,[5个服务组成的投票系统][1]: + +![](https://blog.docker.com/wp-content/uploads/Picture1.png) + +投票系统由下面5个服务组成: + +- 两个 web 前端 +- 一个后台处理投票的进程 +- 一个计票的消息队列 +- 一个数据库 + +后台处理投票的进程很容易转换成 serverless 构架,我们可以使用以下代码来实现: + +``` +import dockerrun +client = dockerrun.from_env() +client.run("bfirsh/serverless-record-vote-task", [voter_id, vote], detach=True) +``` + +这个投票处理进程和消息队列可以用运行在 Swarm 上的 Docker 容器来代替,并实现按需自动部署。 + +我们也可以用容器替换 web 前端,使用一个轻量级 HTTP 服务器来触发容器响应一个 HTTP 请求。Docker 容器代替长期运行的 HTTP 服务器来挑起响应请求的重担,这些容器可以自动扩容来支撑大访问量。 + +新的架构就像这样: + +![](https://blog.docker.com/wp-content/uploads/Picture2.png) + +红色框内是持续运行的服务,绿色框内是按需启动的容器。这个架构提供更少的长期运行服务让你管理,并且可以自动扩容(最大容量由你的 Swarm 决定)。 + +### 我们可以做点什么? + +你可以在你的应用中使用3种技术: + +1. 在 Docker 容器中按需运行代码。 +2. 使用 Swarm 来部署集群。 +3. 通过使用 Docker API 套接字在容器中运行容器。 + +结合这3种技术,你可以有很多方法搭建你的应用架构。用这种方法来部署后台环境真是非常有效,而在另一些场景,也可以这么玩,比如说: + +- 由于存在延时,使用容器实现面向用户的 HTTP 请求可能不是很合适,但你可以写一个负载均衡器,使用 Swarm 来对自己的 web 前端进行自动扩容。 +- 实现一个 MongoDB 容器,可以自检 Swarm 并且启动正确的分片和副本(LCTT 译注:分片技术为大规模并行检索提供支持,副本技术则是为数据提供冗余)。 + +### 下一步怎么做 + +我们提供了这些前卫的工具和概念来构建应用,并没有深入发掘它们的功能。我们的架构里还是存在长期运行的服务,将来我们需要使用 Swarm 来把所有服务都用按需扩容的方式实现 + +希望本文能在你搭建架构时给你一些启发,但我们还是需要你的帮助。我们提供了所有的基本工具,但它们还不是很完善,我们需要更多更好的工具、库、应用案例、文档以及其他资料。 + +[我们在这里发布了工具、库和文档][3]。如果想了解更多,请移步到那里,另外请贡献一些链接给我们,这样我们就能一直工作了。 + +玩得愉快。 + +### 更多关于 Docker 的资料 + +- New to Docker? Try our 10 min [online tutorial][4] +- Share images, automate builds, and more with [a free Docker Hub account][5] +- Read the Docker [1.12 Release Notes][6] +- Subscribe to [Docker Weekly][7] +- Sign up for upcoming [Docker Online Meetups][8] +- Attend upcoming [Docker Meetups][9] +- Watch [DockerCon EU 2015 videos][10] +- Start [contributing to Docker][11] + + +-------------------------------------------------------------------------------- + +via: https://blog.docker.com/2016/06/building-serverless-apps-with-docker/ + +作者:[Ben Firshman][a] +译者:[bazz2](https://github.com/bazz2) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://blog.docker.com/author/bfirshman/ + +[1]: https://github.com/docker/example-voting-app +[3]: https://github.com/bfirsh/serverless-docker +[4]: https://docs.docker.com/engine/understanding-docker/ +[5]: https://hub.docker.com/ +[6]: https://docs.docker.com/release-notes/ +[7]: https://www.docker.com/subscribe_newsletter/ +[8]: http://www.meetup.com/Docker-Online-Meetup/ +[9]: https://www.docker.com/community/meetup-groups +[10]: https://www.youtube.com/playlist?list=PLkA60AVN3hh87OoVra6MHf2L4UR9xwJkv +[11]: https://docs.docker.com/contributing/contributing/ + + + From 9d63106e2b0aceae38d4ad550ba0a66d206175d5 Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 29 Jun 2016 09:44:46 +0800 Subject: [PATCH 1028/1469] =?UTF-8?q?20160629-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...o record your terminal session on Linux.md | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 sources/tech/20160609 How to record your terminal session on Linux.md diff --git a/sources/tech/20160609 How to record your terminal session on Linux.md b/sources/tech/20160609 How to record your terminal session on Linux.md new file mode 100644 index 0000000000..787bafea6d --- /dev/null +++ b/sources/tech/20160609 How to record your terminal session on Linux.md @@ -0,0 +1,101 @@ +How to record your terminal session on Linux +================================================= + +Recording a terminal session may be important in helping someone learn a process, sharing information in an understandable way, and also presenting a series of commands in a proper manner. Whatever the purpose, there are many times when copy-pasting text from the terminal won't be very helpful while capturing a video of the process is quite far-fetched and may not be always possible. In this quick guide, we will take a look at the easiest way to record and share a terminal session in .gif format. + +### Prerequisites + +If you just want to record your terminal sessions and be able to play the recording in your terminal, or share them with people who will use a terminal for playback, then the only tool that you'll need is called “ttyrec”. Ubuntu users may install it by inserting the following command on a terminal: + +``` +sudo apt-get install ttyrec +``` + +If you want to produce a .gif file from the recording and be able to share it with people who don't use the terminal, publish it on websites, or simply keep a .gif handy for when you'll need it instead of written commands, you will have to install two additional packages. The first one is “imagemagick” which you can install with: + +``` +sudo apt-get install imagemagick +``` + +and the second one is “tty2gif” which can be downloaded from here. The latter has a dependency that can be satisfied with: +sudo apt-get install python-opster + +### Capturing + +To start capturing the terminal session, all you need to do is simply start with “ttyrec” + enter. This will launch the real-time recording tool which will run in the background until we enter “exit” or we press “Ctrl+D”. By default, ttyrec creates a file named “ttyrecord” on the destination of the terminal session which by default is “Home”. + +![](https://www.howtoforge.com/images/how-to-record-your-terminal-session-on-linux/pic_1.jpg) + +![](https://www.howtoforge.com/images/how-to-record-your-terminal-session-on-linux/pic_2.jpg) + +![](https://www.howtoforge.com/images/how-to-record-your-terminal-session-on-linux/pic_3.jpg) + +### Playing + +Playing the file is as simple as opening a terminal on the destination of the “ttyrecord” file and using the “ttyplay” command followed by the name of the recording (in our case it's ttyrecord but you may change this into whatever you want). + +![](https://www.howtoforge.com/images/how-to-record-your-terminal-session-on-linux/pic_4.jpg) + +This will result in the playback of the recorded session, in real-time, and with typing corrections included (all actions are recorded). This will look like a completely normal automated terminal session, but the commands and their apparent execution are obviously not really applied to the system, as they are only reproduced as a recording. + +It is also important to note that the playback of the terminal session recording is completely controllable. You may double the playback speed by hitting the “+” button, slow it down with the “-” button, pause it with “0”, and resume it in normal speed with “1”. + +### Converting into a .gif + +For reasons of convenience, many of us would like to convert the recorded session into a .gif file, and that is very easy to do. Here's how: + +First, untar the downloaded “tty2gif.tar.bz2” by opening a terminal in the download location and entering the following command: + +``` +tar xvfj tty2gif.tar.bz2 +``` + +Next, copy the resulting “tty2gif.py file onto the destination of the “ttyrecord” file (or whatever the name you've specified is), and then open a terminal on that destination and type the command: + +``` +python tty2gif.py typing ttyrecord +``` + +If you are getting errors in this step, check that you have installed the “python-opster” package. If errors persist, give the following two commands consecutively: + +``` +sudo apt-get install xdotool +export WINDOWID=$(xdotool getwindowfocus) +``` + +then repeat the “python tty2gif.py typing ttyrecord ” and you should now see a number of gif files that were created on the location of the “ttyrecord” + +![](https://www.howtoforge.com/images/how-to-record-your-terminal-session-on-linux/pic_5.jpg) + +The next step is to unify all these gifs that correspond to individual terminal session actions into one final .gif file using the imagemagick utility. To do this, open a terminal on the destination and insert the following command: + +``` +convert -delay 25 -loop 0 *.gif example.gif +``` + +![](https://www.howtoforge.com/images/how-to-record-your-terminal-session-on-linux/pic_6.jpg) + +You may name the resulting file as you like (I used “example.gif”), and you may change the delay and loop settings as needed. Here is the resulting file of this quick tutorial: + +![](https://www.howtoforge.com/images/how-to-record-your-terminal-session-on-linux/example.gif) + +-------------------------------------------------------------------------------- + +via: https://www.howtoforge.com/tutorial/how-to-record-your-terminal-session-on-linux/ + +作者:[Bill Toulas][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://twitter.com/howtoforgecom + + + + + + + + + From dd518199f8bb4eec6cdfd1c473a6b3011820b36c Mon Sep 17 00:00:00 2001 From: Chunyang Wen Date: Wed, 29 Jun 2016 09:56:39 +0800 Subject: [PATCH 1029/1469] chunyang-wen translating --- ...art 4 - How to Use Comparison Operators with Awk in Linux.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/awk/Part 4 - How to Use Comparison Operators with Awk in Linux.md b/sources/tech/awk/Part 4 - How to Use Comparison Operators with Awk in Linux.md index 7f3a46360f..1d0ef007af 100644 --- a/sources/tech/awk/Part 4 - How to Use Comparison Operators with Awk in Linux.md +++ b/sources/tech/awk/Part 4 - How to Use Comparison Operators with Awk in Linux.md @@ -1,3 +1,5 @@ +chunyang-wen translating + How to Use Comparison Operators with Awk in Linux =================================================== From b3bdf02802b0a892b687d8101b23706e5d1d88e2 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Wed, 29 Jun 2016 10:21:02 +0800 Subject: [PATCH 1030/1469] Update Part 3 - How to Use Awk to Filter Text or Strings Using Pattern Specific Actions.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 准备翻译该篇。 --- ... to Filter Text or Strings Using Pattern Specific Actions.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/awk/Part 3 - How to Use Awk to Filter Text or Strings Using Pattern Specific Actions.md b/sources/tech/awk/Part 3 - How to Use Awk to Filter Text or Strings Using Pattern Specific Actions.md index f6aeb69e57..acdfe66167 100644 --- a/sources/tech/awk/Part 3 - How to Use Awk to Filter Text or Strings Using Pattern Specific Actions.md +++ b/sources/tech/awk/Part 3 - How to Use Awk to Filter Text or Strings Using Pattern Specific Actions.md @@ -1,3 +1,5 @@ +FSSlc translating + How to Use Awk to Filter Text or Strings Using Pattern Specific Actions ========================================================================= From e0f40f33d812b7909173bf8a6bb9e84e5a8218dc Mon Sep 17 00:00:00 2001 From: kokialoves <498497353@qq.com> Date: Wed, 29 Jun 2016 11:09:16 +0800 Subject: [PATCH 1031/1469] =?UTF-8?q?Update=20Part=206=20-=20How=20to=20Us?= =?UTF-8?q?e=20=E2=80=98next=E2=80=99=20Command=20with=20Awk=20in=20Linux.?= =?UTF-8?q?md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../awk/Part 6 - How to Use ‘next’ Command with Awk in Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/awk/Part 6 - How to Use ‘next’ Command with Awk in Linux.md b/sources/tech/awk/Part 6 - How to Use ‘next’ Command with Awk in Linux.md index f272dabcce..5ae8cca086 100644 --- a/sources/tech/awk/Part 6 - How to Use ‘next’ Command with Awk in Linux.md +++ b/sources/tech/awk/Part 6 - How to Use ‘next’ Command with Awk in Linux.md @@ -1,4 +1,4 @@ -How to Use ‘next’ Command with Awk in Linux +[translating]How to Use ‘next’ Command with Awk in Linux ============================================= ![](http://www.tecmint.com/wp-content/uploads/2016/06/Use-next-Command-with-Awk-in-Linux.png) From e3803263a8902b17072cdb09ac545ca2c1a6216c Mon Sep 17 00:00:00 2001 From: wwy Date: Wed, 29 Jun 2016 12:06:59 +0800 Subject: [PATCH 1032/1469] [Translated] Part 1 - How to Use Awk and Regular Expressions to Filter Text or String in Files (#4120) * finish translation * check again * remove source --- ...sions to Filter Text or String in Files.md | 214 ------------------ ...sions to Filter Text or String in Files.md | 212 +++++++++++++++++ 2 files changed, 212 insertions(+), 214 deletions(-) delete mode 100644 sources/tech/awk/Part 1 - How to Use Awk and Regular Expressions to Filter Text or String in Files.md create mode 100644 translated/tech/awk/Part 1 - How to Use Awk and Regular Expressions to Filter Text or String in Files.md diff --git a/sources/tech/awk/Part 1 - How to Use Awk and Regular Expressions to Filter Text or String in Files.md b/sources/tech/awk/Part 1 - How to Use Awk and Regular Expressions to Filter Text or String in Files.md deleted file mode 100644 index 6871673536..0000000000 --- a/sources/tech/awk/Part 1 - How to Use Awk and Regular Expressions to Filter Text or String in Files.md +++ /dev/null @@ -1,214 +0,0 @@ -translating by wwy-hust - -How to Use Awk and Regular Expressions to Filter Text or String in Files -============================================================================= - -![](http://www.tecmint.com/wp-content/uploads/2016/04/Linux-Awk-Command-Examples.png) - -When we run certain commands in Unix/Linux to read or edit text from a string or file, we most times try to filter output to a given section of interest. This is where using regular expressions comes in handy. - -### What are Regular Expressions? - -A regular expression can be defined as a strings that represent several sequence of characters. One of the most important things about regular expressions is that they allow you to filter the output of a command or file, edit a section of a text or configuration file and so on. - -### Features of Regular Expression - -Regular expressions are made of: - -- Ordinary characters such as space, underscore(_), A-Z, a-z, 0-9. -- Meta characters that are expanded to ordinary characters, they include: - - `(.)` it matches any single character except a newline. - - `(*)` it matches zero or more existences of the immediate character preceding it. - - `[ character(s) ]` it matches any one of the characters specified in character(s), one can also use a hyphen (-) to mean a range of characters such as [a-f], [1-5], and so on. - - `^` it matches the beginning of a line in a file. - - `$` matches the end of line in a file. - - `\` it is an escape character. - -In order to filter text, one has to use a text filtering tool such as awk. You can think of awk as a programming language of its own. But for the scope of this guide to using awk, we shall cover it as a simple command line filtering tool. - -The general syntax of awk is: - -``` -# awk 'script' filename -``` - -Where `'script'` is a set of commands that are understood by awk and are execute on file, filename. - -It works by reading a given line in the file, makes a copy of the line and then executes the script on the line. This is repeated on all the lines in the file. - -The `'script'` is in the form `'/pattern/ action'` where pattern is a regular expression and the action is what awk will do when it finds the given pattern in a line. - -### How to Use Awk Filtering Tool in Linux - -In the following examples, we shall focus on the meta characters that we discussed above under the features of awk. - -#### A simple example of using awk: - -The example below prints all the lines in the file /etc/hosts since no pattern is given. - -``` -# awk '//{print}'/etc/hosts -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/04/Awk-Command-Example.gif) ->Awk Prints all Lines in a File - -#### Use Awk with Pattern: - -I the example below, a pattern `localhost` has been given, so awk will match line having localhost in the `/etc/hosts` file. - -``` -# awk '/localhost/{print}' /etc/hosts -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-Command-with-Pattern.gif) ->Awk Print Given Matching Line in a File - -#### Using Awk with (.) wild card in a Pattern - -The `(.)` will match strings containing loc, localhost, localnet in the example below. - -That is to say *** l some_single_character c ***. - -``` -# awk '/l.c/{print}' /etc/hosts -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-with-Wild-Cards.gif) ->Use Awk to Print Matching Strings in a File - -#### Using Awk with (*) Character in a Pattern - -It will match strings containing localhost, localnet, lines, capable, as in the example below: - -``` -# awk '/l*c/{print}' /etc/localhost -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-to-Match-Strings-in-File.gif) ->Use Awk to Match Strings in File - -You will also realize that `(*)` tries to a get you the longest match possible it can detect. - -Let look at a case that demonstrates this, take the regular expression `t*t` which means match strings that start with letter `t` and end with `t` in the line below: - -``` -this is tecmint, where you get the best good tutorials, how to's, guides, tecmint. -``` - -You will get the following possibilities when you use the pattern `/t*t/`: - -``` -this is t -this is tecmint -this is tecmint, where you get t -this is tecmint, where you get the best good t -this is tecmint, where you get the best good tutorials, how t -this is tecmint, where you get the best good tutorials, how tos, guides, t -this is tecmint, where you get the best good tutorials, how tos, guides, tecmint -``` - -And `(*)` in `/t*t/` wild card character allows awk to choose the the last option: - -``` -this is tecmint, where you get the best good tutorials, how to's, guides, tecmint -``` - -#### Using Awk with set [ character(s) ] - -Take for example the set [al1], here awk will match all strings containing character a or l or 1 in a line in the file /etc/hosts. - -``` -# awk '/[al1]/{print}' /etc/hosts -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-to-Print-Matching-Character.gif) ->Use-Awk to Print Matching Character in File - -The next example matches strings starting with either `K` or `k` followed by `T`: - -``` -# awk '/[Kk]T/{print}' /etc/hosts -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-to-Print-Matched-String-in-File.gif) ->Use Awk to Print Matched String in File - -#### Specifying Characters in a Range - -Understand characters with awk: - -- `[0-9]` means a single number -- `[a-z]` means match a single lower case letter -- `[A-Z]` means match a single upper case letter -- `[a-zA-Z]` means match a single letter -- `[a-zA-Z 0-9]` means match a single letter or number - -Lets look at an example below: - -``` -# awk '/[0-9]/{print}' /etc/hosts -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-To-Print-Matching-Numbers-in-File.gif) ->Use Awk To Print Matching Numbers in File - -All the line from the file /etc/hosts contain at least a single number [0-9] in the above example. - -#### Use Awk with (^) Meta Character - -It matches all the lines that start with the pattern provided as in the example below: - -``` -# awk '/^fe/{print}' /etc/hosts -# awk '/^ff/{print}' /etc/hosts -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-to-Print-All-Matching-Lines-with-Pattern.gif) ->Use Awk to Print All Matching Lines with Pattern - -#### Use Awk with ($) Meta Character - -It matches all the lines that end with the pattern provided: - -``` -# awk '/ab$/{print}' /etc/hosts -# awk '/ost$/{print}' /etc/hosts -# awk '/rs$/{print}' /etc/hosts -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-to-Print-Given-Pattern-String.gif) ->Use Awk to Print Given Pattern String - -#### Use Awk with (\) Escape Character - -It allows you to take the character following it as a literal that is to say consider it just as it is. - -In the example below, the first command prints out all line in the file, the second command prints out nothing because I want to match a line that has $25.00, but no escape character is used. - -The third command is correct since a an escape character has been used to read $ as it is. - -``` -# awk '//{print}' deals.txt -# awk '/$25.00/{print}' deals.txt -# awk '/\$25.00/{print}' deals.txt -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-with-Escape-Character.gif) ->Use Awk with Escape Character - -### Summary - -That is not all with the awk command line filtering tool, the examples above a the basic operations of awk. In the next parts we shall be advancing on how to use complex features of awk. Thanks for reading through and for any additions or clarifications, post a comment in the comments section. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/use-linux-awk-command-to-filter-text-string-in-files/ - -作者:[Aaron Kili][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/aaronkili/ diff --git a/translated/tech/awk/Part 1 - How to Use Awk and Regular Expressions to Filter Text or String in Files.md b/translated/tech/awk/Part 1 - How to Use Awk and Regular Expressions to Filter Text or String in Files.md new file mode 100644 index 0000000000..791c349f56 --- /dev/null +++ b/translated/tech/awk/Part 1 - How to Use Awk and Regular Expressions to Filter Text or String in Files.md @@ -0,0 +1,212 @@ +如何使用Awk和正则表达式过滤文本或文件中的字符串 +============================================================================= + +![](http://www.tecmint.com/wp-content/uploads/2016/04/Linux-Awk-Command-Examples.png) + +当我们在 Unix/Linux 下使用特定的命令从字符串或文件中读取或编辑文本时,我们经常会尝试过滤输出以得到感兴趣的部分。这时正则表达式就派上用场了。 + +### 什么是正则表达式? + +正则表达式可以定义为代表若干个字符序列的字符串。它最重要的功能就是它允许你过滤一条命令或一个文件的输出,编辑文本或配置等文件的一部分。 + +### 正则表达式的特点 + +正则表达式由以下内容组合而成: + +- 普通的字符,例如空格、下划线、A-Z、a-z、0-9。 +- 可以扩展为普通字符的元字符,它们包括: + - `(.)` 它匹配除了换行符外的任何单个字符。 + - `(*)` 它匹配零个或多个在其之前的立即字符。 + - `[ character(s) ]` 它匹配任何由 character(s) 指定的一个字符,你可以使用连字符(-)代表字符区间,例如 [a-f]、[1-5]等。 + - `^` 它匹配文件中一行的开头。 + - `$` 它匹配文件中一行的结尾。 + - `\` 这是一个转义字符。 + +你必须使用类似 awk 这样的文本过滤工具来过滤文本。你还可以把 awk 当作一个用于自身的编程语言。但由于这个指南的适用范围是关于使用 awk 的,我会按照一个简单的命令行过滤工具来介绍它。 + +awk 的一般语法如下: + +``` +# awk 'script' filename +``` + +此处 `'script'` 是一个由 awk 使用并应用于 filename 的命令集合。 + +它通过读取文件中的给定的一行,复制该行的内容并在该行上执行脚本的方式工作。这个过程会在该文件中的所有行上重复。 + +该脚本 `'script'` 中内容的格式是 `'/pattern/ action'`,其中 `pattern` 是一个正则表达式,而 `action` 是当 awk 在该行中找到此模式时应当执行的动作。 + +### 如何在 Linux 中使用 Awk 过滤工具 + +在下面的例子中,我们将聚焦于之前讨论过的元字符。 + +#### 一个使用 awk 的简单示例: + +下面的例子打印文件 /etc/hosts 中的所有行,因为没有指定任何的模式。 + +``` +# awk '//{print}'/etc/hosts +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/04/Awk-Command-Example.gif) +>Awk 打印文件中的所有行 + +#### 结合模式使用 Awk + +在下面的示例中,指定了模式 `localhost`,因此 awk 将匹配文件 `/etc/hosts` 中有 `localhost` 的那些行。 + +``` +# awk '/localhost/{print}' /etc/hosts +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-Command-with-Pattern.gif) +>Awk 打印文件中匹配模式的行 + +#### 在 Awk 模式中使用通配符 (.) + +在下面的例子中,符号 `(.)` 将匹配包含 loc、localhost、localnet 的字符串。 + +这里的意思是匹配 *** l 一些单个字符 c ***。 + +``` +# awk '/l.c/{print}' /etc/hosts +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-with-Wild-Cards.gif) +>使用 Awk 打印文件中匹配模式的字符串 + +#### 在 Awk 模式中使用字符 (*) + +在下面的例子中,将匹配包含 localhost、localnet、lines, capable 的字符串。 + +``` +# awk '/l*c/{print}' /etc/localhost +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-to-Match-Strings-in-File.gif) +>使用 Awk 匹配文件中的字符串 + +你可能也意识到 `(*)` 将会尝试匹配它可能检测到的最长的匹配。 + +让我们看一看可以证明这一点的例子,正则表达式 `t*t` 的意思是在下面的行中匹配以 `t` 开始和 `t` 结束的字符串: + +``` +this is tecmint, where you get the best good tutorials, how to's, guides, tecmint. +``` + +当你使用模式 `/t*t/` 时,会得到如下可能的结果: + +``` +this is t +this is tecmint +this is tecmint, where you get t +this is tecmint, where you get the best good t +this is tecmint, where you get the best good tutorials, how t +this is tecmint, where you get the best good tutorials, how tos, guides, t +this is tecmint, where you get the best good tutorials, how tos, guides, tecmint +``` + +在 `/t*t/` 中的通配符 `(*)` 将使得 awk 选择匹配的最后一项: + +``` +this is tecmint, where you get the best good tutorials, how to's, guides, tecmint +``` + +#### 结合集合 [ character(s) ] 使用 Awk + +以集合 [al1] 为例,awk 将匹配文件 /etc/hosts 中所有包含字符 a 或 l 或 1 的字符串。 + +``` +# awk '/[al1]/{print}' /etc/hosts +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-to-Print-Matching-Character.gif) +>使用 Awk 打印文件中匹配的字符 + +下一个例子匹配以 `K` 或 `k` 开始头,后面跟着一个 `T` 的字符串: + +``` +# awk '/[Kk]T/{print}' /etc/hosts +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-to-Print-Matched-String-in-File.gif) +>使用 Awk 打印文件中匹配的字符 + +#### 以范围的方式指定字符 + +awk 所能理解的字符: + +- `[0-9]` 代表一个单独的数字 +- `[a-z]` 代表一个单独的小写字母 +- `[A-Z]` 代表一个单独的大写字母 +- `[a-zA-Z]` 代表一个单独的字母 +- `[a-zA-Z 0-9]` 代表一个单独的字母或数字 + +让我们看看下面的例子: + +``` +# awk '/[0-9]/{print}' /etc/hosts +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-To-Print-Matching-Numbers-in-File.gif) +>使用 Awk 打印文件中匹配的数字 + +在上面的例子中,文件 /etc/hosts 中的所有行都至少包含一个单独的数字 [0-9]。 + +#### 结合元字符 (\^) 使用 Awk + +在下面的例子中,它匹配所有以给定模式开头的行: + +``` +# awk '/^fe/{print}' /etc/hosts +# awk '/^ff/{print}' /etc/hosts +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-to-Print-All-Matching-Lines-with-Pattern.gif) +>使用 Awk 打印与模式匹配的行 + +#### 结合元字符 ($) 使用 Awk + +它将匹配所有以给定模式结尾的行: + +``` +# awk '/ab$/{print}' /etc/hosts +# awk '/ost$/{print}' /etc/hosts +# awk '/rs$/{print}' /etc/hosts +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-to-Print-Given-Pattern-String.gif) +>使用 Awk 打印与模式匹配的字符串 + +#### 结合转义字符 (\\) 使用 Awk + +它允许你将该转义字符后面的字符作为文字,即理解为其字面的意思。 + +在下面的例子中,第一个命令打印出文件中的所有行,第二个命令中我想匹配具有 $25.00 的一行,但我并未使用转义字符,因而没有打印出任何内容。 + +第三个命令是正确的,因为一个这里使用了一个转义字符以转义 $,以将其识别为 '$'(而非元字符)。 + +``` +# awk '//{print}' deals.txt +# awk '/$25.00/{print}' deals.txt +# awk '/\$25.00/{print}' deals.txt +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-with-Escape-Character.gif) +>结合转义字符使用 Awk + +### 总结 + +以上内容并不是 Awk 命令用做过滤工具的全部,上述的示例均是 awk 的基础操作。在下面的章节中,我将进一步介绍如何使用 awk 的高级功能。感谢您的阅读,请在评论区贴出您的评论。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/use-linux-awk-command-to-filter-text-string-in-files/ + +作者:[Aaron Kili][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/aaronkili/ From 829ed85c8e1e7b09b840417f4959eebd9184e9c3 Mon Sep 17 00:00:00 2001 From: kokialoves <498497353@qq.com> Date: Wed, 29 Jun 2016 15:23:36 +0800 Subject: [PATCH 1033/1469] =?UTF-8?q?Delete=20Part=206=20-=20How=20to=20Us?= =?UTF-8?q?e=20=E2=80=98next=E2=80=99=20Command=20with=20Awk=20in=20Linux.?= =?UTF-8?q?md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...to Use ‘next’ Command with Awk in Linux.md | 76 ------------------- 1 file changed, 76 deletions(-) delete mode 100644 sources/tech/awk/Part 6 - How to Use ‘next’ Command with Awk in Linux.md diff --git a/sources/tech/awk/Part 6 - How to Use ‘next’ Command with Awk in Linux.md b/sources/tech/awk/Part 6 - How to Use ‘next’ Command with Awk in Linux.md deleted file mode 100644 index 5ae8cca086..0000000000 --- a/sources/tech/awk/Part 6 - How to Use ‘next’ Command with Awk in Linux.md +++ /dev/null @@ -1,76 +0,0 @@ -[translating]How to Use ‘next’ Command with Awk in Linux -============================================= - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Use-next-Command-with-Awk-in-Linux.png) - -In this sixth part of Awk series, we shall look at using `next` command, which tells Awk to skip all remaining patterns and expressions that you have provided, but instead read the next input line. - -The `next` command helps you to prevent executing what I would refer to as time-wasting steps in a command execution. - -To understand how it works, let us consider a file called food_list.txt that looks like this: - -``` -Food List Items -No Item_Name Price Quantity -1 Mangoes $3.45 5 -2 Apples $2.45 25 -3 Pineapples $4.45 55 -4 Tomatoes $3.45 25 -5 Onions $1.45 15 -6 Bananas $3.45 30 -``` - -Consider running the following command that will flag food items whose quantity is less than or equal to 20 with a `(*)` sign at the end of each line: - -``` -# awk '$4 <= 20 { printf "%s\t%s\n", $0,"*" ; } $4 > 20 { print $0 ;} ' food_list.txt - -No Item_Name Price Quantity -1 Mangoes $3.45 5 * -2 Apples $2.45 25 -3 Pineapples $4.45 55 -4 Tomatoes $3.45 25 -5 Onions $1.45 15 * -6 Bananas $3.45 30 -``` - -The command above actually works as follows: - -- First, it checks whether the quantity, fourth field of each input line is less than or equal to 20, if a value meets that condition, it is printed and flagged with the `(*)` sign at the end using expression one: `$4 <= 20` -- Secondly, it checks if the fourth field of each input line is greater than 20, and if a line meets the condition it gets printed using expression two: `$4 > 20` - -But there is one problem here, when the first expression is executed, a line that we want to flag is printed using: `{ printf "%s\t%s\n", $0,"**" ; }` and then in the same step, the second expression is also checked which becomes a time wasting factor. - -So there is no need to execute the second expression, `$4 > 20` again after printing already flagged lines that have been printed using the first expression. - -To deal with this problem, you have to use the `next` command as follows: - -``` -# awk '$4 <= 20 { printf "%s\t%s\n", $0,"*" ; next; } $4 > 20 { print $0 ;} ' food_list.txt - -No Item_Name Price Quantity -1 Mangoes $3.45 5 * -2 Apples $2.45 25 -3 Pineapples $4.45 55 -4 Tomatoes $3.45 25 -5 Onions $1.45 15 * -6 Bananas $3.45 30 -``` - -After a single input line is printed using `$4 <= 20` `{ printf "%s\t%s\n", $0,"*" ; next ; }`, the `next` command included will help skip the second expression `$4 > 20` `{ print $0 ;}`, so execution goes to the next input line without having to waste time on checking whether the quantity is greater than 20. - -The next command is very important is writing efficient commands and where necessary, you can always use to speed up the execution of a script. Prepare for the next part of the series where we shall look at using standard input (STDIN) as input for Awk. - -Hope you find this how to guide helpful and you can as always put your thoughts in writing by leaving a comment in the comment section below. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/use-next-command-with-awk-in-linux/ - -作者:[Aaron Kili][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/aaronkili/ From 15c2d860155ee1ecba780f658eb6323c49668d7a Mon Sep 17 00:00:00 2001 From: kokialoves <498497353@qq.com> Date: Wed, 29 Jun 2016 15:26:36 +0800 Subject: [PATCH 1034/1469] Add files via upload From 13b816e625fe9853a1562b4c01e2dfca49d75ca8 Mon Sep 17 00:00:00 2001 From: kokialoves <498497353@qq.com> Date: Wed, 29 Jun 2016 15:37:21 +0800 Subject: [PATCH 1035/1469] =?UTF-8?q?Create=20Part=206=20-=20How=20to=20Us?= =?UTF-8?q?e=20=E2=80=98next=E2=80=99=20Command=20with=20Awk=20in=20Linux.?= =?UTF-8?q?md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...to Use ‘next’ Command with Awk in Linux.md | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 translated/tech/awk/Part 6 - How to Use ‘next’ Command with Awk in Linux.md diff --git a/translated/tech/awk/Part 6 - How to Use ‘next’ Command with Awk in Linux.md b/translated/tech/awk/Part 6 - How to Use ‘next’ Command with Awk in Linux.md new file mode 100644 index 0000000000..8ead60bd44 --- /dev/null +++ b/translated/tech/awk/Part 6 - How to Use ‘next’ Command with Awk in Linux.md @@ -0,0 +1,76 @@ + +如何使用AWK的‘next’命令 +============================================= + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Use-next-Command-with-Awk-in-Linux.png) + +在Awk 系列的第六章, 我们来看一下`next`命令 ,它告诉 Awk 跳过你所提供的表达式而是读取下一个输入行. +`next` 命令帮助你阻止运行多余的步骤. + +要明白它是如何工作的, 让我们来分析一下food_list.txt它看起来像这样 : + +``` +Food List Items +No Item_Name Price Quantity +1 Mangoes $3.45 5 +2 Apples $2.45 25 +3 Pineapples $4.45 55 +4 Tomatoes $3.45 25 +5 Onions $1.45 15 +6 Bananas $3.45 30 +``` + +运行下面的命令,它将在每个食物数量小于或者等于20的行后面标一个星号: + +``` +# awk '$4 <= 20 { printf "%s\t%s\n", $0,"*" ; } $4 > 20 { print $0 ;} ' food_list.txt + +No Item_Name Price Quantity +1 Mangoes $3.45 5 * +2 Apples $2.45 25 +3 Pineapples $4.45 55 +4 Tomatoes $3.45 25 +5 Onions $1.45 15 * +6 Bananas $3.45 30 +``` + +上面的命令实际运行如下: + +- 首先, 它用`$4 <= 20`表达式检查每个输入行的第四列是否小于或者等于20,如果满足条件, 它将在末尾打一个星号 `(*)` . +- 接着, 它用`$4 > 20`表达式检查每个输入行的第四列是否大于20,如果满足条件,显示出来. + +但是这里有一个问题, 当第一个表达式用`{ printf "%s\t%s\n", $0,"**" ; }`命令进行标注的时候在同样的步骤第二个表达式也进行了判断这样就浪费了时间. + +因此当我们已经用第一个表达式打印标志行的时候就不在需要用第二个表达式`$4 > 20`再次打印. + +要处理这个问题, 我们需要用到`next` 命令: + +``` +# awk '$4 <= 20 { printf "%s\t%s\n", $0,"*" ; next; } $4 > 20 { print $0 ;} ' food_list.txt + +No Item_Name Price Quantity +1 Mangoes $3.45 5 * +2 Apples $2.45 25 +3 Pineapples $4.45 55 +4 Tomatoes $3.45 25 +5 Onions $1.45 15 * +6 Bananas $3.45 30 +``` + +当输入行用`$4 <= 20` `{ printf "%s\t%s\n", $0,"*" ; next ; }`命令打印以后,`next`命令 将跳过第二个`$4 > 20` `{ print $0 ;}`表达式, 继续判断下一个输入行,而不是浪费时间继续判断一下是不是当前输入行还大于20. + +next命令在编写高效的命令脚本时候是非常重要的, 它可以很大的提高脚本速度. 下面我们准备来学习Awk的下一个系列了. + +希望这篇文章对你有帮助,你可以给我们留言. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/use-next-command-with-awk-in-linux/ + +作者:[Aaron Kili][a] +译者:[kokialoves](https://github.com/kokialoves) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.tecmint.com/author/aaronkili/ From 97bf6bf4c369dffe7d241e6b4e84aff02c4005fc Mon Sep 17 00:00:00 2001 From: kokialoves <498497353@qq.com> Date: Wed, 29 Jun 2016 16:11:16 +0800 Subject: [PATCH 1036/1469] merge (#4124) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Delete Part 6 - How to Use ‘next’ Command with Awk in Linux.md * Add files via upload * Create Part 6 - How to Use ‘next’ Command with Awk in Linux.md --- ...to Use ‘next’ Command with Awk in Linux.md | 76 ------------------- ...to Use ‘next’ Command with Awk in Linux.md | 76 +++++++++++++++++++ 2 files changed, 76 insertions(+), 76 deletions(-) delete mode 100644 sources/tech/awk/Part 6 - How to Use ‘next’ Command with Awk in Linux.md create mode 100644 translated/tech/awk/Part 6 - How to Use ‘next’ Command with Awk in Linux.md diff --git a/sources/tech/awk/Part 6 - How to Use ‘next’ Command with Awk in Linux.md b/sources/tech/awk/Part 6 - How to Use ‘next’ Command with Awk in Linux.md deleted file mode 100644 index 5ae8cca086..0000000000 --- a/sources/tech/awk/Part 6 - How to Use ‘next’ Command with Awk in Linux.md +++ /dev/null @@ -1,76 +0,0 @@ -[translating]How to Use ‘next’ Command with Awk in Linux -============================================= - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Use-next-Command-with-Awk-in-Linux.png) - -In this sixth part of Awk series, we shall look at using `next` command, which tells Awk to skip all remaining patterns and expressions that you have provided, but instead read the next input line. - -The `next` command helps you to prevent executing what I would refer to as time-wasting steps in a command execution. - -To understand how it works, let us consider a file called food_list.txt that looks like this: - -``` -Food List Items -No Item_Name Price Quantity -1 Mangoes $3.45 5 -2 Apples $2.45 25 -3 Pineapples $4.45 55 -4 Tomatoes $3.45 25 -5 Onions $1.45 15 -6 Bananas $3.45 30 -``` - -Consider running the following command that will flag food items whose quantity is less than or equal to 20 with a `(*)` sign at the end of each line: - -``` -# awk '$4 <= 20 { printf "%s\t%s\n", $0,"*" ; } $4 > 20 { print $0 ;} ' food_list.txt - -No Item_Name Price Quantity -1 Mangoes $3.45 5 * -2 Apples $2.45 25 -3 Pineapples $4.45 55 -4 Tomatoes $3.45 25 -5 Onions $1.45 15 * -6 Bananas $3.45 30 -``` - -The command above actually works as follows: - -- First, it checks whether the quantity, fourth field of each input line is less than or equal to 20, if a value meets that condition, it is printed and flagged with the `(*)` sign at the end using expression one: `$4 <= 20` -- Secondly, it checks if the fourth field of each input line is greater than 20, and if a line meets the condition it gets printed using expression two: `$4 > 20` - -But there is one problem here, when the first expression is executed, a line that we want to flag is printed using: `{ printf "%s\t%s\n", $0,"**" ; }` and then in the same step, the second expression is also checked which becomes a time wasting factor. - -So there is no need to execute the second expression, `$4 > 20` again after printing already flagged lines that have been printed using the first expression. - -To deal with this problem, you have to use the `next` command as follows: - -``` -# awk '$4 <= 20 { printf "%s\t%s\n", $0,"*" ; next; } $4 > 20 { print $0 ;} ' food_list.txt - -No Item_Name Price Quantity -1 Mangoes $3.45 5 * -2 Apples $2.45 25 -3 Pineapples $4.45 55 -4 Tomatoes $3.45 25 -5 Onions $1.45 15 * -6 Bananas $3.45 30 -``` - -After a single input line is printed using `$4 <= 20` `{ printf "%s\t%s\n", $0,"*" ; next ; }`, the `next` command included will help skip the second expression `$4 > 20` `{ print $0 ;}`, so execution goes to the next input line without having to waste time on checking whether the quantity is greater than 20. - -The next command is very important is writing efficient commands and where necessary, you can always use to speed up the execution of a script. Prepare for the next part of the series where we shall look at using standard input (STDIN) as input for Awk. - -Hope you find this how to guide helpful and you can as always put your thoughts in writing by leaving a comment in the comment section below. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/use-next-command-with-awk-in-linux/ - -作者:[Aaron Kili][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/aaronkili/ diff --git a/translated/tech/awk/Part 6 - How to Use ‘next’ Command with Awk in Linux.md b/translated/tech/awk/Part 6 - How to Use ‘next’ Command with Awk in Linux.md new file mode 100644 index 0000000000..8ead60bd44 --- /dev/null +++ b/translated/tech/awk/Part 6 - How to Use ‘next’ Command with Awk in Linux.md @@ -0,0 +1,76 @@ + +如何使用AWK的‘next’命令 +============================================= + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Use-next-Command-with-Awk-in-Linux.png) + +在Awk 系列的第六章, 我们来看一下`next`命令 ,它告诉 Awk 跳过你所提供的表达式而是读取下一个输入行. +`next` 命令帮助你阻止运行多余的步骤. + +要明白它是如何工作的, 让我们来分析一下food_list.txt它看起来像这样 : + +``` +Food List Items +No Item_Name Price Quantity +1 Mangoes $3.45 5 +2 Apples $2.45 25 +3 Pineapples $4.45 55 +4 Tomatoes $3.45 25 +5 Onions $1.45 15 +6 Bananas $3.45 30 +``` + +运行下面的命令,它将在每个食物数量小于或者等于20的行后面标一个星号: + +``` +# awk '$4 <= 20 { printf "%s\t%s\n", $0,"*" ; } $4 > 20 { print $0 ;} ' food_list.txt + +No Item_Name Price Quantity +1 Mangoes $3.45 5 * +2 Apples $2.45 25 +3 Pineapples $4.45 55 +4 Tomatoes $3.45 25 +5 Onions $1.45 15 * +6 Bananas $3.45 30 +``` + +上面的命令实际运行如下: + +- 首先, 它用`$4 <= 20`表达式检查每个输入行的第四列是否小于或者等于20,如果满足条件, 它将在末尾打一个星号 `(*)` . +- 接着, 它用`$4 > 20`表达式检查每个输入行的第四列是否大于20,如果满足条件,显示出来. + +但是这里有一个问题, 当第一个表达式用`{ printf "%s\t%s\n", $0,"**" ; }`命令进行标注的时候在同样的步骤第二个表达式也进行了判断这样就浪费了时间. + +因此当我们已经用第一个表达式打印标志行的时候就不在需要用第二个表达式`$4 > 20`再次打印. + +要处理这个问题, 我们需要用到`next` 命令: + +``` +# awk '$4 <= 20 { printf "%s\t%s\n", $0,"*" ; next; } $4 > 20 { print $0 ;} ' food_list.txt + +No Item_Name Price Quantity +1 Mangoes $3.45 5 * +2 Apples $2.45 25 +3 Pineapples $4.45 55 +4 Tomatoes $3.45 25 +5 Onions $1.45 15 * +6 Bananas $3.45 30 +``` + +当输入行用`$4 <= 20` `{ printf "%s\t%s\n", $0,"*" ; next ; }`命令打印以后,`next`命令 将跳过第二个`$4 > 20` `{ print $0 ;}`表达式, 继续判断下一个输入行,而不是浪费时间继续判断一下是不是当前输入行还大于20. + +next命令在编写高效的命令脚本时候是非常重要的, 它可以很大的提高脚本速度. 下面我们准备来学习Awk的下一个系列了. + +希望这篇文章对你有帮助,你可以给我们留言. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/use-next-command-with-awk-in-linux/ + +作者:[Aaron Kili][a] +译者:[kokialoves](https://github.com/kokialoves) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.tecmint.com/author/aaronkili/ From 51d14dd0b753206579be37ebff71c03fca0bf772 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 29 Jun 2016 16:43:20 +0800 Subject: [PATCH 1037/1469] PUB:20151023 Mark Shuttleworth--The Man Behind Ubuntu Operating System @Moelf @PurlingNayuki --- ...th--The Man Behind Ubuntu Operating System.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) rename {translated/talk => published}/20151023 Mark Shuttleworth--The Man Behind Ubuntu Operating System.md (80%) diff --git a/translated/talk/20151023 Mark Shuttleworth--The Man Behind Ubuntu Operating System.md b/published/20151023 Mark Shuttleworth--The Man Behind Ubuntu Operating System.md similarity index 80% rename from translated/talk/20151023 Mark Shuttleworth--The Man Behind Ubuntu Operating System.md rename to published/20151023 Mark Shuttleworth--The Man Behind Ubuntu Operating System.md index b40048201b..b5923ca86a 100644 --- a/translated/talk/20151023 Mark Shuttleworth--The Man Behind Ubuntu Operating System.md +++ b/published/20151023 Mark Shuttleworth--The Man Behind Ubuntu Operating System.md @@ -3,21 +3,21 @@ ![](http://www.unixmen.com/wp-content/uploads/2015/10/Mark-Shuttleworth-652x445.jpg) -**马克·理查德·沙特尔沃思(马克Richard Shuttleworth)** 是 Ubuntu 的创始人,也被称作 [Debian 背后的人][1]([之一][2])。他于 1973 年出生在南非的韦尔科姆(Welkom)。他不仅是个企业家,还是个太空游客——他是第一个前往太空旅行的非洲独立国家的公民。 +**马克·理查德·沙特尔沃思(Mark Richard Shuttleworth)** 是 Ubuntu 的创始人,也被称作 [Debian 背后的人][1]([之一][2])。他于 1973 年出生在南非的韦尔科姆(Welkom)。他不仅是个企业家,还是个太空游客——他是第一个前往太空旅行的非洲独立国家的公民。 马克曾在 1996 年成立了一家名为 **Thawte** 的互联网商务安全公司,那时他还在开普敦大学( University of Cape Town)的学习金融和信息技术。 -2000 年,马克创立了 HBD(Here be Dragons (此处有龙/危险)的缩写,所以其吉祥物是一只龙),这是一家投资公司,同时他还创立了沙特尔沃思基金会(Shuttleworth Foundation),致力于给社会中有创新性的领袖以奖金和投资等形式提供资助。 +2000 年,马克创立了 HBD(Here be Dragons (此处有龙/危险)的缩写,所以其吉祥物是一只龙),这是一家投资公司,同时他还创立了沙特尔沃思基金会(Shuttleworth Foundation),致力于以奖金和投资等形式给社会中有创新性的领袖提供资助。 -> "移动设备对于个人电脑行业的未来而言至关重要。比如就在这个月,相对于平板电脑的发展而言,传统 PC 行业很明显正在萎缩。所以如果我们想要涉足个人电脑产业,我们必须首先涉足移动行业。移动产业之所以有趣,是因为在这里没有盗版 Windows 操作系统的市场。所以如果你为你的操作系统赢得了一台设备的市场份额,这台设备会一直使用你的操作系统。在传统 PC 行业,我们时不时得和“免费”的 Windows 产生竞争,这是一种非常微妙的挑战。所以我们现在的重心是围绕 Ubuntu 和移动设备——手机和平板——以图与普通用户建立更深层次的联系。" +> “移动设备对于个人电脑行业的未来而言至关重要。比如就在这个月,相对于平板电脑的发展而言,传统 PC 行业很明显正在萎缩。所以如果我们想要涉足个人电脑产业,我们必须首先涉足移动行业。移动产业之所以有趣,是因为在这里没有盗版 Windows 操作系统的市场。所以如果你为你的操作系统赢得了一台设备的市场份额,这台设备会一直使用你的操作系统。在传统 PC 行业,我们时不时得和“免费”的 Windows 产生竞争,这是一种非常微妙的挑战。所以我们现在的重心是围绕 Ubuntu 和移动设备——手机和平板——以图与普通用户建立更深层次的联系。” > > — 马克·沙特尔沃思 2002 年,他在俄罗斯的星城(Star City)接受了为期一年的训练,随后作为联盟号 TM-34 任务组的一员飞往了国际空间站。再后来,在面向有志于航空航天或者其相关学科的南非学生群体发起了推广科学、编程及数学的运动后,马克 创立了 **Canonical Ltd**。此后直至2013年,他一直在领导 Ubuntu 操作系统的开发。 -现今,Shuttleworth 拥有英国与南非双重国籍并和 18 只可爱的鸭子住在英国的 Isle of Man 小岛上的一处花园,一同的还有他可爱的女友 Claire,两条黑色母狗以及时不时经过的羊群。 +现今,沙特尔沃思拥有英国与南非双重国籍并和 18 只可爱的鸭子住在英国的 Isle of Man 小岛上的一处花园,一同的还有他可爱的女友 Claire,两条黑色母狗以及时不时经过的羊群。 -> "电脑不仅仅是一台电子设备了。它现在是你思维的延续,以及通向他人的大门。" +> “电脑不仅仅是一台电子设备了。它现在是你思维的延续,以及通向他人的大门。” > > — 马克·沙特尔沃思 @@ -41,7 +41,7 @@ > > — 马克·沙特尔沃思 -### Linux、免费开源软件与马克·沙特尔沃思 ### +### Linux、自由开源软件与马克·沙特尔沃思 ### 在 90 年代后期,马克曾作为一名开发者参与 Debian 操作系统项目。 @@ -49,7 +49,7 @@ 2004 年,马克通过出资开发基于 Debian 的 Ubuntu 操作系统返回了自由软件界,这一切也经由他的 Canonical 公司完成。 -2005 年,马克出资建立了 Ubuntu 基金会并投入了一千万美元作为启动资金。在 Ubuntu 项目内,马克经常被一个朗朗上口的名字称呼——“**SABDFL :自封的生命之仁慈独裁者(Self-Appointed Benevolent Dictator for Life)**”。为了能够找到足够多的高手开发这个巨大的项目,马克花费了 6 个月的时间从 Debian 邮件列表里寻找,这一切都是在他乘坐在南极洲的一艘破冰船——赫列布尼科夫船长号(Kapitan Khlebnikov)——上完成的。同年,马克买下了 Impi Linux 65% 的股份。 +2005 年,马克出资建立了 Ubuntu 基金会并投入了一千万美元作为启动资金。在 Ubuntu 项目内,人们经常用一个朗朗上口的名字称呼他——“**SABDFL :自封的生命之仁慈独裁者(Self-Appointed Benevolent Dictator for Life)**”。为了能够找到足够多的高手开发这个巨大的项目,马克花费了 6 个月的时间从 Debian 邮件列表里寻找,这一切都是在他乘坐在南极洲的一艘破冰船——赫列布尼科夫船长号(Kapitan Khlebnikov)——上完成的。同年,马克买下了 Impi Linux 65% 的股份。 > “我呼吁电信公司的掌权者们尽快开发出跨洲际的高效信息传输服务。” @@ -78,7 +78,7 @@ ![](http://www.unixmen.com/wp-content/uploads/2015/10/Mark-Shuttleworth1.jpg) -在太空中,马克与纳尔逊·曼德拉(Nelson Mandela)和另一个 14 岁的南非女孩米歇尔·福斯特(Michelle Foster) (她问马克要不要娶她)通过无线电进行了交谈。马克礼貌地回避了这个结婚问题,在巧妙地改换话题之前他说他感到很荣幸。身患绝症的女孩福斯特通过梦想基金会( Dream foundation)的赞助获得了与马克和纳尔逊·曼德拉交谈的机会。 +在太空中,马克与纳尔逊·曼德拉(Nelson Mandela)和另一个 14 岁的南非女孩米歇尔·福斯特(Michelle Foster) (她问马克要不要娶她)通过无线电进行了交谈。马克礼貌地回避了这个结婚问题,但在巧妙地改换话题之前他说他感到很荣幸。身患绝症的女孩福斯特通过梦想基金会( Dream foundation)的赞助获得了与马克和纳尔逊·曼德拉交谈的机会。 归来后,马克在世界各地做了旅行,并和各地的学生就太空之旅发表了感言。 From 812a4ecc6f6e40645e5ea1d7fa0fa11383c3cb33 Mon Sep 17 00:00:00 2001 From: cposture Date: Wed, 29 Jun 2016 22:01:21 +0800 Subject: [PATCH 1038/1469] Translating by cposture --- sources/tech/20160512 Bitmap in Linux Kernel.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160512 Bitmap in Linux Kernel.md b/sources/tech/20160512 Bitmap in Linux Kernel.md index b7e832ba0a..adffc9d049 100644 --- a/sources/tech/20160512 Bitmap in Linux Kernel.md +++ b/sources/tech/20160512 Bitmap in Linux Kernel.md @@ -1,3 +1,4 @@ +[Translating by cposture 2016.06.29] Data Structures in the Linux Kernel ================================================================================ From 537488f5505cf31ae41038f3df9809134cc39c9f Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 30 Jun 2016 06:38:45 +0800 Subject: [PATCH 1039/1469] PUB:20160621 Building Serverless App with Docker @bazz2 --- ...160621 Building Serverless App with Docker.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) rename {translated/tech => published}/20160621 Building Serverless App with Docker.md (81%) diff --git a/translated/tech/20160621 Building Serverless App with Docker.md b/published/20160621 Building Serverless App with Docker.md similarity index 81% rename from translated/tech/20160621 Building Serverless App with Docker.md rename to published/20160621 Building Serverless App with Docker.md index 9af6c5d7aa..0b5409fc89 100644 --- a/translated/tech/20160621 Building Serverless App with Docker.md +++ b/published/20160621 Building Serverless App with Docker.md @@ -1,9 +1,9 @@ -用 docker 创建 serverless 应用 +用 Docker 创建 serverless 应用 ====================================== -当今世界会时不时地出现一波科技浪潮,将以前的技术拍死在海滩上。针对 serverless 应用的概念我们已经谈了很多,它是指将你的应用程序按功能来部署,这些功能在被用到时才会启动。你不用费心去管理服务器和程序规模,因为它们会在需要的时候在一个集群中启动并运行。 +当今世界会时不时地出现一波波科技浪潮,将以前的技术拍死在海滩上。针对 serverless 应用的概念我们已经谈了很多,它是指将你的应用程序按功能来部署,这些功能在被用到时才会启动。你不用费心去管理服务器和程序规模,因为它们会在需要的时候在一个集群中启动并运行。 -但是 serverless 并不意味着没有 Docker 什么事儿,事实上 Docker 就是 serverless 的。你可以使用 Docker 来容器化这些功能,然后在 Swarm 中按需求来运行它们。Serverless 是一项构建分布式应用的技术,而 Docker 是它们完美的构建平台。 +但是 serverless 并不意味着没有 Docker 什么事儿,事实上 Docker 就是 serverless 的。你可以使用 Docker 来容器化这些功能,然后在 Swarm 中按需求来运行它们。serverless 是一项构建分布式应用的技术,而 Docker 是它们完美的构建平台。 ### 从 servers 到 serverless @@ -28,13 +28,13 @@ client.run("bfirsh/serverless-record-vote-task", [voter_id, vote], detach=True) 这个投票处理进程和消息队列可以用运行在 Swarm 上的 Docker 容器来代替,并实现按需自动部署。 -我们也可以用容器替换 web 前端,使用一个轻量级 HTTP 服务器来触发容器响应一个 HTTP 请求。Docker 容器代替长期运行的 HTTP 服务器来挑起响应请求的重担,这些容器可以自动扩容来支撑大访问量。 +我们也可以用容器替换 web 前端,使用一个轻量级 HTTP 服务器来触发容器响应一个 HTTP 请求。Docker 容器代替长期运行的 HTTP 服务器来挑起响应请求的重担,这些容器可以自动扩容来支撑更大访问量。 新的架构就像这样: ![](https://blog.docker.com/wp-content/uploads/Picture2.png) -红色框内是持续运行的服务,绿色框内是按需启动的容器。这个架构提供更少的长期运行服务让你管理,并且可以自动扩容(最大容量由你的 Swarm 决定)。 +红色框内是持续运行的服务,绿色框内是按需启动的容器。这个架构里需要你来管理的长期运行服务更少,并且可以自动扩容(最大容量由你的 Swarm 决定)。 ### 我们可以做点什么? @@ -51,11 +51,11 @@ client.run("bfirsh/serverless-record-vote-task", [voter_id, vote], detach=True) ### 下一步怎么做 -我们提供了这些前卫的工具和概念来构建应用,并没有深入发掘它们的功能。我们的架构里还是存在长期运行的服务,将来我们需要使用 Swarm 来把所有服务都用按需扩容的方式实现 +我们提供了这些前卫的工具和概念来构建应用,并没有深入发掘它们的功能。我们的架构里还是存在长期运行的服务,将来我们需要使用 Swarm 来把所有服务都用按需扩容的方式实现。 希望本文能在你搭建架构时给你一些启发,但我们还是需要你的帮助。我们提供了所有的基本工具,但它们还不是很完善,我们需要更多更好的工具、库、应用案例、文档以及其他资料。 -[我们在这里发布了工具、库和文档][3]。如果想了解更多,请移步到那里,另外请贡献一些链接给我们,这样我们就能一直工作了。 +[我们在这里发布了工具、库和文档][3]。如果想了解更多,请贡献给我们一些你知道的资源,以便我们能够完善这篇文章。 玩得愉快。 @@ -77,7 +77,7 @@ via: https://blog.docker.com/2016/06/building-serverless-apps-with-docker/ 作者:[Ben Firshman][a] 译者:[bazz2](https://github.com/bazz2) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 11180e4a7325b5ca739fc23f77d296066c377b52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E5=AE=B6=E6=9C=AA?= Date: Thu, 30 Jun 2016 09:36:00 +0800 Subject: [PATCH 1040/1469] Translating by GitFuture --- ... 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160530 Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md b/sources/tech/20160530 Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md index e6b143cc00..acb98b2d20 100644 --- a/sources/tech/20160530 Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md +++ b/sources/tech/20160530 Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md @@ -1,3 +1,5 @@ +Translating by GitFuture + Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04 ===================================================================================== From 6ee0c8807948f541cddfa3d4005ccb410a3c19c5 Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 30 Jun 2016 10:08:09 +0800 Subject: [PATCH 1041/1469] =?UTF-8?q?20160630-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Flatpak brings standalone apps to Linux.md | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 sources/tech/20160621 Flatpak brings standalone apps to Linux.md diff --git a/sources/tech/20160621 Flatpak brings standalone apps to Linux.md b/sources/tech/20160621 Flatpak brings standalone apps to Linux.md new file mode 100644 index 0000000000..5441627710 --- /dev/null +++ b/sources/tech/20160621 Flatpak brings standalone apps to Linux.md @@ -0,0 +1,34 @@ +Flatpak brings standalone apps to Linux +=== + +![](https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/flatpak-945x400.jpg) + +The development team behind [Flatpak][1] has [just announced the general availability][2] of the Flatpak desktop application framework. Flatpak (which was also known during development as xdg-app) provides the ability for an application — bundled as a Flatpak — to be installed and run easily and consistently on many different Linux distributions. Applications bundled as Flatpaks also have the ability to be sandboxed for security, isolating them from your operating system, and other applications. Check out the [Flatpak website][3], and the [press release][4] for more information on the tech that makes up the Flatpak framework. + +### Installing Flatpak on Fedora + +For users wanting to run applications bundled as Flatpaks, installation on Fedora is easy, with Flatpak already available in the official Fedora 23 and Fedora 24 repositories. The Flatpak website has [full details on installation on Fedora][5], as well as how to install on Arch, Debian, Mageia, and Ubuntu. [Many applications][6] have builds already bundled with Flatpak — including LibreOffice, and nightly builds of popular graphics applications Inkscape and GIMP. + +### For Application Developers + +If you are an application developer, the Flatpak website also contains some great resources on getting started [bundling and distributing your applications with Flatpak][7]. These resources contain information on using Flakpak SDKs to build standalone, sandboxed Flatpak applications. + + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/introducing-flatpak/ + +作者:[Ryan Lerch][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/introducing-flatpak/ +[1]: http://flatpak.org/ +[2]: http://flatpak.org/press/2016-06-21-flatpak-released.html +[3]: http://flatpak.org/ +[4]: http://flatpak.org/press/2016-06-21-flatpak-released.html +[5]: http://flatpak.org/getting.html +[6]: http://flatpak.org/apps.html +[7]: http://flatpak.org/developer.html From 62d8ec64c4bbda8951040ef2eb3c457845449cb0 Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 30 Jun 2016 10:14:34 +0800 Subject: [PATCH 1042/1469] =?UTF-8?q?20160630-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... technologies in Fedora: systemd-nspawn.md | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 sources/tech/20160621 Container technologies in Fedora: systemd-nspawn.md diff --git a/sources/tech/20160621 Container technologies in Fedora: systemd-nspawn.md b/sources/tech/20160621 Container technologies in Fedora: systemd-nspawn.md new file mode 100644 index 0000000000..1ec72a3c90 --- /dev/null +++ b/sources/tech/20160621 Container technologies in Fedora: systemd-nspawn.md @@ -0,0 +1,106 @@ +Container technologies in Fedora: systemd-nspawn +=== + +Welcome to the “Container technologies in Fedora” series! This is the first article in a series of articles that will explain how you can use the various container technologies available in Fedora. This first article will deal with `systemd-nspawn`. + +### What is a container? + +A container is a user-space instance which can be used to run a program or an operating system in isolation from the system hosting the container (called the host system). The idea is very similar to a `chroot` or a [virtual machine][1]. The processes running in a container are managed by the same kernel as the host operating system, but they are isolated from the host file system, and from the other processes. + + +### What is systemd-nspawn? + +The systemd project considers container technologies as something that should fundamentally be part of the desktop and that should integrate with the rest of the user’s systems. To this end, systemd provides `systemd-nspawn`, a tool which is able to create containers using various Linux technologies. It also provides some container management tools. + +In many ways, `systemd-nspawn` is similar to `chroot`, but is much more powerful. It virtualizes the file system, process tree, and inter-process communication of the guest system. Much of its appeal lies in the fact that it provides a number of tools, such as `machinectl`, for managing containers. Containers run by `systemd-nspawn` will integrate with the systemd components running on the host system. As an example, journal entries can be logged from a container in the host system’s journal. + +In Fedora 24, `systemd-nspawn` has been split out from the systemd package, so you’ll need to install the `systemd-container` package. As usual, you can do that with a `dnf install systemd-container`. + +### Creating the container + +Creating a container with `systemd-nspawn` is easy. Let’s say you have an application made for Debian, and it doesn’t run well anywhere else. That’s not a problem, we can make a container! To set up a container with the latest version of Debian (at this point in time, Jessie), you need to pick a directory to set up your system in. I’ll be using `~/DebianJessie` for now. + +Once the directory has been created, you need to run `debootstrap`, which you can install from the Fedora repositories. For Debian Jessie, you run the following command to initialize a Debian file system. + +``` +$ debootstrap --arch=amd64 stable ~/DebianJessie +``` + +This assumes your architecture is x86_64. If it isn’t, you must change `amd64` to the name of your architecture. You can find your machine’s architecture with `uname -m`. + +Once your root directory is set up, you will start your container with the following command. + +``` +$ systemd-nspawn -bD ~/DebianJessie +``` + +You’ll be up and running within seconds. You’ll notice something as soon as you try to log in: you can’t use any accounts on your system. This is because systemd-nspawn virtualizes users. The fix is simple: remove -b from the previous command. You’ll boot directly to the root shell in the container. From there, you can just use passwd to set a password for root, or you can use adduser to add a new user. As soon as you’re done with that, go ahead and put the -b flag back. You’ll boot to the familiar login console and you log in with the credentials you set. + +All of this applies for any distribution you would want to run in the container, but you need to create the system using the correct package manager. For Fedora, you would use DNF instead of debootstrap. To set up a minimal Fedora system, you can run the following command, replacing the absolute path with wherever you want the container to be. + +``` +$ sudo dnf --releasever=24 --installroot=/absolute/path/ install systemd passwd dnf fedora-release +``` + +![](https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/Screenshot-from-2016-06-17-15-04-14.png) + +### Setting up the network + +You’ll notice an issue if you attempt to start a service that binds to a port currently in use on your host system. Your container is using the same network interface. Luckily, `systemd-nspawn` provides several ways to achieve separate networking from the host machine. + +#### Local networking + +The first method uses the `--private-network` flag, which only creates a loopback device by default. This is ideal for environments where you don’t need networking, such as build systems and other continuous integration systems. + +#### Multiple networking interfaces + +If you have multiple network devices, you can give one to the container with the `--network-interface` flag. To give `eno1` to my container, I would add the flag `--network-interface=eno1`. While an interface is assigned to a container, the host can’t use it at the same time. When the container is completely shut down, it will be available to the host again. + +#### Sharing network interfaces + +For those of us who don’t have spare network devices, there are other options for providing access to the container. One of those is the `--port` flag. This forwards a port on the container to the host. The format is `protocol:host:container`, where protocol is either `tcp` or `udp`, `host` is a valid port number on the host, and `container` is a valid port on the container. You can omit the protocol and specify only `host:container`. I often use something similar to `--port=2222:22`. + +You can enable complete, host-only networking with the `--network-veth` flag, which creates a virtual Ethernet interface between the host and the container. You can also bridge two connections with `--network-bridge`. + +### Using systemd components + +If the system in your container has D-Bus, you can use systemd’s provided utilities to control and monitor your container. Debian doesn’t include dbus in the base install. If you want to use it with Debian Jessie, you’ll want to run `apt install dbus`. + +#### machinectl + +To easily manage containers, systemd provides the machinectl utility. Using machinectl, you can log in to a container with machinectl login name, check the status with machinectl status name, reboot with machinectl reboot name, or power it off with machinectl poweroff name. + +### Other systemd commands + +Most systemd commands, such as journalctl, systemd-analyze, and systemctl, support containers with the `--machine` option. For example, if you want to see the journals of a container named “foobar”, you can use journalctl `--machine=foobar`. You can also see the status of a service running in this container with `systemctl --machine=foobar` status service. + +![](https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/Screenshot-from-2016-06-17-15-09-25.png) + +### Working with SELinux + +If you’re running with SELinux enforcing (the default in Fedora), you’ll need to set the SELinux context for your container. To do that, you need to run the following two commands on the host system. + +``` +$ semanage fcontext -a -t svirt_sandbox_file_t "/path/to/container(/.*)?" +$ restorecon -R /path/to/container/ +``` + +Make sure you replace “/path/to/container” with the path to your container. For my container, “DebianJessie”, I would run the following: + +``` +$ semanage fcontext -a -t svirt_sandbox_file_t "/home/johnmh/DebianJessie(/.*)?" +$ restorecon -R /home/johnmh/DebianJessie/ +``` + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/set-nginx-reverse-proxy-centos-7-cpanel/ + +作者:[John M. Harris, Jr.][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/linux-how-to/set-nginx-reverse-proxy-centos-7-cpanel/ +[1]: https://en.wikipedia.org/wiki/Virtual_machine From c3b14933f388d9921ae1c3fd5fd4f1e267233dad Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 30 Jun 2016 10:22:15 +0800 Subject: [PATCH 1043/1469] =?UTF-8?q?20160630-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20160620 Monitor Linux With Netdata.md | 113 ++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 sources/tech/20160620 Monitor Linux With Netdata.md diff --git a/sources/tech/20160620 Monitor Linux With Netdata.md b/sources/tech/20160620 Monitor Linux With Netdata.md new file mode 100644 index 0000000000..95156ef108 --- /dev/null +++ b/sources/tech/20160620 Monitor Linux With Netdata.md @@ -0,0 +1,113 @@ +Monitor Linux With Netdata +=== + +Netdata is a real-time resource monitoring tool with a friendly web front-end developed and maintained by [FireHOL][1]. With this tool, you can read charts representing resource utilization of things like CPUs, RAM, disks, network, Apache, Postfix and more. It is similar to other monitoring software like Nagios; however, Netdata is only for real-time monitoring via a web interface. + + +### Understanding Netdata + +There’s currently no authentication, so if you’re concerned about someone getting information about the applications you’re running on your system, you should restrict who has access via a firewall policy. The UI is simplified in a way anyone could look at the graphs and understand what they’re seeing, or at least be impressed by your flashy setup. + +The web front-end is very responsive and requires no Flash plugin. The UI doesn’t clutter things up with unneeded features, but sticks to what it does. At first glance, it may seem a bit much with the hundreds of charts you have access to, but luckily the most commonly needed charts (i.e. CPU, RAM, network, and disk) are at the top. If you wish to drill deeper into the graphical data, all you have to do is scroll down or click on the item in the menu to the right. Netdata even allows you to control the chart with play, reset, zoom and resize with the controls on the bottom right of each chart. + +![](https://fedoramagazine.org/wp-content/uploads/2016/06/Capture-1.png) +>Netdata chart control + +When it comes down to system resources, the software doesn’t need too much either. The creators choose to write the software in C. Netdata doesn’t use much more than ~40MB of RAM. + +![](https://fedoramagazine.org/wp-content/uploads/2016/06/Capture.png) +>Netdata memory usage + +### Download Netdata + +To download this software, you can head over to [Netdata GitHub page][2]. Then click the “Clone or download” green button on the left of the page. You should then be presented with two options. + +#### Via the ZIP file + +One option is to download the ZIP file. This will include everything in the repository; however, if the repository is updated then you will need to download the ZIP file again. Once you download the ZIP file, you can use the `unzip` tool in the command line to extract the contents. Running the following command will extract the contents of the ZIP file into a “`netdata`” folder. + +``` +$ cd ~/Downloads +$ unzip netdata-master.zip +``` + +![](https://fedoramagazine.org/wp-content/uploads/2016/06/Capture-2.png) +>Netdata unzipped + +ou don’t need to add the `-d` option in unzip because their content is inside a folder at the root of the ZIP file. If they didn’t have that folder at the root, unzip would have extracted the contents in the current directory (which can be messy). + +#### Via git + +The next option is to download the repository via git. You will, of course, need git installed on your system. This is usually installed by default on Fedora. If not, you can install git from the command line with the following command. + +``` +$ sudo dnf install git +``` + +After installing git, you will need to “clone” the repository to your system. To do this, run the following command. + +``` +$ git clone https://github.com/firehol/netdata.git +``` + +This will then clone (or make a copy of) the repository in the current working directory. + +### Install Netdata + +There are some packages you will need to build Netdata successfully. Luckily, it’s a single line to install the things you need ([as stated in their installation guide][3]). Running the following command in the terminal will install all of the dependencies you need to use Netdata. + +``` +$ dnf install zlib-devel libuuid-devel libmnl-devel gcc make git autoconf autogen automake pkgconfig +``` + +Once the required packages are installed, you will need to cd into the netdata/ directory and run the netdata-installer.sh script. + +``` +$ sudo ./netdata-installer.sh +``` + +You will then be prompted to press enter to build and install the program. If you wish to continue, press enter to be on your way! + +![](https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/Capture-3-600x341.png) +>Netdata install. + +If all goes well, you will have Netdata built, installed, and running on your system. The installer will also add an uninstall script in the same folder as the installer called `netdata-uninstaller.sh`. If you change your mind later, running this script will remove it from your system. + +You can see it running by checking its status via systemctl. + +``` +$ sudo systemctl status netdata +``` + +### Accessing Netdata + +Now that we have Netdata installed and running, you can access the web interface via port 19999. I have it running on a test machine, as shown in the screenshot below. + +![](https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/Capture-4-768x458.png) +>An overview of what Netdata running on your system looks like + +Congratulations! You now have successfully installed and have access to beautiful displays, graphs, and advanced statistics on the performance of your machine. Whether it’s for a personal machine so you can show it off to your friends or for getting deeper insight into the performance of your server, Netdata delivers on performance reporting for any system you choose. + + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/monitor-linux-netdata/ + +作者:[Martino Jones][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/monitor-linux-netdata/ +[1]: https://firehol.org/ +[2]: https://github.com/firehol/netdata +[3]: https://github.com/firehol/netdata/wiki/Installation + + + + + + + + From 67d0d2a7cca68e6a72ace06fa5e1a489dbfacd98 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 30 Jun 2016 12:11:13 +0800 Subject: [PATCH 1044/1469] PUB:20160523 Driving cars into the future with Linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @erlinux 翻译的不够认真,请下次提交译文时自己多读几遍。或者可以选择更短更简单一些的稿件。 --- ...Driving cars into the future with Linux.md | 106 +++++++++++++++++ ...Driving cars into the future with Linux.md | 108 ------------------ 2 files changed, 106 insertions(+), 108 deletions(-) create mode 100644 published/20160523 Driving cars into the future with Linux.md delete mode 100644 translated/talk/20160523 Driving cars into the future with Linux.md diff --git a/published/20160523 Driving cars into the future with Linux.md b/published/20160523 Driving cars into the future with Linux.md new file mode 100644 index 0000000000..fad7ca99f2 --- /dev/null +++ b/published/20160523 Driving cars into the future with Linux.md @@ -0,0 +1,106 @@ +与 Linux 一同驾车奔向未来 +=========================================== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/open-snow-car-osdc-lead.png?itok=IgYZ6mNY) + +当我驾车的时候并没有这么想过,但是我肯定喜欢一个配有这样系统的车子,它可以让我按下几个按钮就能与我的妻子、母亲以及孩子们语音通话。这样的系统也可以让我选择是否从云端、卫星广播、以及更传统的 AM/FM 收音机收听音乐流媒体。我也会得到最新的天气情况,以及它可以引导我的车载 GPS 找到抵达下一个目的地的最快路线。[车载娱乐系统(In-vehicle infotainment)][1],业界常称作 IVI,它已经普及出现在最新的汽车上了。 + +前段时间,我乘坐飞机跨越了数百英里,然后租了一辆汽车。令人愉快的是,我发现我租赁的汽车上配置了类似我自己车上同样的 IVI 技术。毫不犹豫地,我就通过蓝牙连接把我的联系人上传到了系统当中,然后打电话回家给我的家人,让他们知道我已经安全抵达了,然后我的主机会让他们知道我正在去往他们家的路上。 + +在最近的[新闻综述][2]中,Scott Nesbitt 引述了一篇文章,说福特汽车公司因其开源的[智能设备连接(Smart Device Link)][3](SDL)从竞争对手汽车制造商中得到了足够多的回报,这个中间件框架可以用于支持移动电话。 SDL 是 [GENIVI 联盟][4]的一个项目,这个联盟是一个非营利性组织,致力于建设支持开源车载娱乐系统的中间件。据 GENIVI 的执行董事 [Steven Crumb][5] 称,他们的[成员][6]有很多,包括戴姆勒集团、现代、沃尔沃、日产、本田等等 170 个企业。 + +为了在同行业间保持竞争力,汽车生产企业需要一个中间设备系统,以支持现代消费者所使用的各种人机界面技术。无论您使用的是 Android、iOS 还是其他设备,汽车 OEM 厂商都希望自己的产品能够支持这些。此外,这些的 IVI 系统必须有足够适应能力以支持日益变化的移动技术。OEM 厂商希望提供有价值的服务,并可以在他们的 IVI 之上增加服务,以满足他们客户的各种需求。 + +### 步入 Linux 和开源软件 + +除了 GENIVI 在努力之外,[Linux 基金会][7]也赞助支持了[车载 Linux(Automotive Grade Linux)][8](AGL)工作组,这是一个致力于为汽车应用寻求开源解决方案的软件基金会。虽然 AGL 初期将侧重于 IVI 系统,但是未来他们希望发展到不同的方向,包括[远程信息处理(telematics)][9]、抬头显示器(HUD)及其他控制系统等等。 现在 AGL 已经有超过 50 名成员,包括捷豹、丰田、日产,并在其[最近发布的一篇公告][10]中宣称福特、马自达、三菱、和斯巴鲁也加入了。 + +为了了解更多信息,我们采访了这一新兴领域的两位领导人。具体来说,我们想知道 Linux 和开源软件是如何被使用的,并且它们是如何事实上改变了汽车行业的面貌。首先,我们将与 [Alison Chaiken][11] 谈谈,她是一位任职于 Peloton Technology 的软件工程师,也是一位在车载 Linux 、网络安全和信息透明化方面的专家。她曾任职于 [Alison Chaiken][11] 公司、诺基亚和斯坦福直线性加速器。然后我们和 [Steven Crumb][12] 进行了交谈,他是 GENIVI 执行董事,他之前从事于高性能计算环境(超级计算机和早期的云计算)的开源工作。他说,虽然他再不是一个程序员了,但是他乐于帮助企业解决在使用开源软件时的实际业务问题。 + +### 采访 Alison Chaiken (by [Deb Nicholson][13]) + +#### 你是如何开始对汽车软件领域感兴趣的? + +我曾在诺基亚从事于手机上的 [MeeGo][14] 产品,2009 年该项目被取消了。我想,我下一步怎么办?其时,我的一位同事正在从事于 [MeeGo-IVI][15],这是一个早期的车载 Linux 发行版。 “Linux 在汽车方面将有很大发展,” 我想,所以我就朝着这个方向努力。 + +#### 你能告诉我们你在这些日子里工作在哪些方面吗? + +我目前正在启动一个高级巡航控制系统的项目,它用在大型卡车上,使用实时 Linux 以提升安全性和燃油经济性。我喜欢在这方面的工作,因为没有人会反对提升货运的能力。 + +#### 近几年有几则汽车被黑的消息。开源代码方案可以帮助解决这个问题吗? + +我恰好针对这一话题准备了一次讲演,我会在南加州 Linux 2016 博览会上就 Linux 能否解决汽车上的安全问题做个讲演 ([讲演稿在此][16])。值得注意的是,GENIVI 和车载 Linux 项目已经公开了他们的代码,这两个项目可以通过 Git 提交补丁。(如果你有补丁的话),请给上游发送您的补丁!许多眼睛都盯着,bug 将无从遁形。 + +#### 执法机构和保险公司可以找到很多汽车上的数据的用途。他们获取这些信息很容易吗? + +好问题。IEEE-1609 专用短程通信标准(Dedicated Short Range Communication Standard)就是为了让汽车的 WiFi 消息可以安全、匿名地传递。不过,如果你从你的车上发推,那可能就有人能够跟踪到你。 + +#### 开发人员和公民个人可以做些什么,以在汽车技术进步的同时确保公民自由得到保护? + +电子前沿基金会( Electronic Frontier Foundation)(EFF)在关注汽车问题方面做了出色的工作,包括对哪些数据可以存储在汽车 “黑盒子”里通过官方渠道发表了看法,以及 DMCA 规定 1201 如何应用于汽车上。 + +#### 在未来几年,你觉得在汽车方面会发生哪些令人激动的发展? + +可以拯救生命的自适应巡航控制系统和防撞系统将取得长足发展。当它们大量进入汽车里面时,我相信这会使得(因车祸而导致的)死亡人数下降。如果这都不令人激动,我不知道还有什么会更令人激动。此外,像自动化停车辅助功能,将会使汽车更容易驾驶,减少汽车磕碰事故。 + +#### 我们需要做什么?人们怎样才能参与? + +车载 Linux 开发是以开源的方式开发,它运行在每个人都能买得起的廉价硬件上(如树莓派 2 和中等价位的 Renesas Porter 主板)。 GENIVI 汽车 Linux 中间件联盟通过 Git 开源了很多软件。此外,还有很酷的 [OSVehicle 开源硬件][17]汽车平台。 + +只需要不太多的预算,人们就可以参与到 Linux 软件和开放硬件中。如果您感兴趣,请加入我们在 Freenode 上的IRC #automotive 吧。 + +### 采访 Steven Crumb (by Don Watkins) + +#### GENIVI 在 IVI 方面做了哪些巨大贡献? + +GENIVI 率先通过使用自由开源软件填补了汽车行业的巨大空白,这包括 Linux、非安全关键性汽车软件(如车载娱乐系统(IVI))等。作为消费者,他们很期望在车辆上有和智能手机一样的功能,对这种支持 IVI 功能的软件的需求量成倍地增长。不过不断提升的软件数量也增加了建设 IVI 系统的成本,从而延缓了其上市时间。 + +GENIVI 使用开源软件和社区开发的模式为汽车制造商及其软件提供商节省了大量资金,从而显著地缩短了产品面市时间。我为 GENIVI 而感到激动,我们有幸引导了一场革命,在缓慢进步的汽车行业中,从高度结构化和专有的解决方案转换为以社区为基础的开发方式。我们还没有完全达成目标,但是我们很荣幸在这个可以带来实实在在好处的转型中成为其中的一份子。 + +#### 你们的主要成员怎样推动了 GENIVI 的发展方向? + +GENIVI 有很多成员和非成员致力于我们的工作。在许多开源项目中,任何公司都可以通过通过技术输出而发挥影响,包括简单地贡献代码、补丁、花点时间测试。前面说过,宝马、奔驰、现代汽车、捷豹路虎、标致雪铁龙、雷诺/日产和沃尔沃都是 GENIVI 积极的参与者和贡献者,其他的许多 OEM 厂商也在他们的汽车中采用了 IVI 解决方案,广泛地使用了 GENIVI 的软件。 + +#### 这些贡献的代码使用了什么许可证? + +GENIVI 采用了一些许可证,包括从(L)GPLv2 到 MPLv2 和 Apache2.0。我们的一些工具使用的是 Eclipse 许可证。我们有一个[公开许可策略][18],详细地说明了我们的许可证偏好。 + +#### 个人或团体如何参与其中?社区的参与对于这个项目迈向成功有多重要? + +GENIVI 的开发完全是开放的([projects.genivi.org][19]),因此,欢迎任何有兴趣在汽车中使用开源软件的人参加。也就是说,公司可以通过成员的方式[加入该联盟][20],联盟以开放的方式资助其不断进行开发。GENIVI 的成员可以享受各种各样的便利,在过去六年中,已经有多达 140 家公司参与到这个全球性的社区当中。 + +社区对于 GENIVI 是非常重要的,没有一个活跃的贡献者社区,我们不可能在这些年开发和维护了这么多有价值的软件。我们努力让参与到 GENIVI 更加简单,现在只要加入一个[邮件列表][21]就可以接触到各种软件项目中的人们。我们使用了许多开源项目采用的标准做法,并提供了高品质的工具和基础设施,以帮助开发人员宾至如归而富有成效。 + +无论你是否熟悉汽车软件,都欢迎你加入我们的社区。人们已经对汽车改装了许多年,所以对于许多人来说,在汽车上修修改改是自热而然的做法。对于汽车来说,软件是一个新的领域,GENIVI 希望能为对汽车和开源软件有兴趣的人打开这扇门。 + +------------------------------- +via: https://opensource.com/business/16/5/interview-alison-chaiken-steven-crumb + +作者:[Don Watkins][a] +译者:[erlinux](https://github.com/erlinux) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[1]: https://en.wikipedia.org/wiki/In_car_entertainment +[2]: https://opensource.com/life/16/1/weekly-news-jan-9 +[3]: http://projects.genivi.org/smartdevicelink/home +[4]: http://www.genivi.org/ +[5]: https://www.linkedin.com/in/stevecrumb +[6]: http://www.genivi.org/genivi-members +[7]: http://www.linuxfoundation.org/ +[8]: https://www.automotivelinux.org/ +[9]: https://en.wikipedia.org/wiki/Telematics +[10]: https://www.automotivelinux.org/news/announcement/2016/01/ford-mazda-mitsubishi-motors-and-subaru-join-linux-foundation-and +[11]: https://www.linkedin.com/in/alison-chaiken-3ba456b3 +[12]: https://www.linkedin.com/in/stevecrumb +[13]: https://opensource.com/users/eximious +[14]: https://en.wikipedia.org/wiki/MeeGo +[15]: http://webinos.org/deliverable-d026-target-platform-requirements-and-ipr/automotive/ +[16]: http://she-devel.com/Chaiken_automotive_cybersecurity.pdf +[17]: https://www.osvehicle.com/ +[18]: http://projects.genivi.org/how +[19]: http://projects.genivi.org/ +[20]: http://genivi.org/join +[21]: http://lists.genivi.org/mailman/listinfo/genivi-projects diff --git a/translated/talk/20160523 Driving cars into the future with Linux.md b/translated/talk/20160523 Driving cars into the future with Linux.md deleted file mode 100644 index 9b9d69d68c..0000000000 --- a/translated/talk/20160523 Driving cars into the future with Linux.md +++ /dev/null @@ -1,108 +0,0 @@ - -驾车通往未来Linux -=========================================== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/open-snow-car-osdc-lead.png?itok=IgYZ6mNY) - - -当我开车的时候不认为和 Linux 有多大联系,但是我肯定我是喜欢一个配备有系统的车子,让我按几个按钮语音就可以传给我的妻子母亲以及孩子。同样,这样的系统可以让我选择是否从云端流媒体收听音乐,卫星广播,以及传统的 AM/FM 收音机。我也会得到天气更新以及可以给我的车载信息娱乐 GPS 找到最快的下一个目的地[In-vehicle infotainment][1],以及 IVI 作为行业知名产业,已经普及到最新的汽车生产商。 - -前段时间,我不得坐飞机飞跃数百英里,租一辆车。令人愉快的是,我发现我的租凭车配置了 IVI 技术。任何时候,我只要通过蓝牙连接,上传联系人到系统中,打电话回家给我的家人,让他们知道我已经安全到家了。然后“主人“会知道我再途中还是已经到他们家了。 - -在最近的 [news roundup][2],Scott Nesbitt 引用一篇文章,说福特汽车公司是由它的开源 [Smart Device Link][3](SDL)中间设备框架,对手汽车制造商,支持那个移动手机获得大量的支持。 SDL 是 [GENIVI Alliance][4] 的项目,一个非营利性的致力于建设中间件支持开源的车载信息娱乐系统。根据文献 [[Steven Crumb][5],GENIVI 执行董事,他们 [membership][6] 很广,包括 Daimler 集团,现代,沃尔沃,日产,本田等等 170 个。 - -为了在同行业中保持竞争力,汽车企业需要一个中间设备系统,可以支持当今消费者提供的各种人机界面技术。无论您拥有 Android,iOS 或其他设备,汽车 OEM 厂商希望自己的系统单位能够支持这些。此外,这些的 IVI 系统必须有足够适应能力以支持移动技术的不断下降,半衰期。 OEM 厂商要提供价值服务,并在他们的 IVI 堆栈支持各种为他们的客户添加选择。进入 Linux 和开源软件。 - -除了 GENIVI 的努力下,[Linux Foundation][7] 赞助 [Automotive Grade Linux][8](AGL)工作组,一个软件基金会,致力于寻找针对汽车应用的开源解决方案。虽然 AGL 初期将侧重于 IVI 系统,他们展望不同的分歧,包括 [telematics][9],小心显示器和其他控制系统。 AGL 有超过 50 名成员在这个时候,包括捷豹,丰田,日产,并在 [recent press release][10] 宣布福特、马自达、三菱、和斯巴鲁加入。 - - -为了了解更多信息,我们在这一新鲜兴领域采访了两位领导人。明确地来说,我们想知道是如何被使用的 Linux 和开源软件,如果它们实际上是改变汽车行业的面貌。首先,我们谈谈 [Alison Chaiken][11],在大集团技术的软件工程师和汽车 Linux 专家,网络安全和透明度。她曾任职于 [Alison Chaiken][11] 公司,诺基亚和斯坦福直线性加速器。然后我们用 [Steven Crumb][12],GENIVI 执行董事,谁得到了在开源环境高性能计算(超级计算机和早期的云计算)开始聊天。他说,虽然他再不是一个程序员了,但是他喜欢帮助企业解决开源软件的实际业务问题。 - -### 采访 Alison Chaiken (by [Deb Nicholson][13]) - -#### 你是如何开始对汽车软件空间感兴趣的? - -我是在诺基亚手机产品时, 2009 年该项目被取消。我想,下一步是什么?一位同事正在对 [MeeGo-IVI][15],早期的汽车 Linux 发行版。 “Linux 在汽车是大了,” 我想,所以我在朝着这个方向努力。 - -#### 你能告诉我们你这些日子工作在哪些方面? - -我目前正在启动为使用 Linux 系统增加大货车钻机的安全性和燃油经济性的先进巡航控制。我喜欢在这方面的工作,因为没有人会反对卡车得以提升。 - -#### 目前关于汽车已在近年来砍死几个人故事。开源代码方案可以帮助解决这个问题吗? - -I presented a talk on precisely this topic, on how Linux can (and cannot) contribute to security solutions in automotive at Southern California Linux Expo 2016 ([Slides][16]). Notably, GENIVI and Automotive Grade Linux have published their code and both projects take patches via Git. Please send your fixes upstream! Many eyes make all bugs shallow. -我提出的谈话正是这一主题,就如何 Linux 可以(或不可以)在南加州 2016 年世博会作出贡献的安全解决方案的 Linux汽车([Slides][16])。值得注意的是,GENIVI 和汽车级 Linux 已经公布了他们的代码,这两个项目的 Git 通过采取补丁。请上游发送您的修复!许多眼睛都盯着肤浅的bugs。 - -#### 执法机构和保险公司可以找到很多有关数据用途的驱动程序。它将如何容易成为他们获取这些信息? - -好问题。该专用短程通信标准(IEEE-1609),以保持匿名的 Wi-Fi 安全消息驱动程序。不过,如果你从你的车张贴到 Twitter,有人能够跟踪你。 - -#### 有什么可以开发人员和公民个人一起完成,以确保公民自由受到保护作为汽车技术发展的? - -电子前沿基金会(EFF)一样对汽车保持的问题上,通过什么样的数据可以存储在汽车 “黑盒子”,并在 DMCA 的规定 1201 如何应用于汽车官方渠道评论已经出色的工作了。 - -#### 在未来几年令人兴奋的事情上,那些是你看到的驱动因素? - -自适应巡航控制和防撞系统有足够的预付款来挽救生命。当他们通过运输车队的推出,我真的相信死亡人数会下降。如果这还不是令人兴奋的,我不知道是什么。此外,像自动化停车辅助功能,将会使汽车更容易驾驶,减少汽车相撞事故。 - -#### 有什么是需要人参与以及如何建造? - -汽车 Linux 级开发是开放源代码的,运行在廉价硬件(如树莓派 Pi 2 和中等价位的 Renesas Porter board),任何人都可以购买。 GENIVI 汽车 Linux 的中间设备联盟有很多软件通过 Git 的公开。此外,还有很酷的 [OSVehicle open hardware][17] 汽车平台。 - -#### 这里是 Linux 软件和开放硬件,许多方面具有中等人数预算的参与。如果您有任何疑问,加入我们在 Freenode 上 IRC#automotive。 - -### 采访 Steven Crumb (by Don Watkins) - -#### 关于GENIVI's 对 IVI 为什么那么大 ? - -GENIVI 率先通过使用自由和开源软件,包括 Linux,像车载信息娱乐(IVI)系统的非安全关键汽车软件填补了汽车行业的巨大差距。作为消费者来到期望在他们的车辆相同的功能在智能手机上的软件,以支持 IVI 功能所需的量成倍增长。软件增加量也增加了建设 IVI 系统的成本,从而延缓了上市时间。 - -GENIVI 的使用开源软件和社区发展模式节省了汽车制造商和他们的软件提供商显著大量的资金,而显著减少了产品上市时间。我很兴奋,因为 GENIVI 我们很幸运慢慢从高度结构化和专有的方法来社区为基础的方法不断发展的组织​​领导排序在汽车行业的一场革命。我们还没有完成,但它一直是一个荣幸参加正在产生实实在在的好处的转换。 - -#### 你的庞大会员怎么才可以驱动 GENIVI 方向? - -GENIVI 有很多会员和非会员促进我们的工作。与许多开源项目,任何公司都可以通过简单地贡献代码,修补程序和时间来检验影响的技术输出。随着中说,宝马,奔驰,现代汽车,捷豹路虎,标致雪铁龙,雷诺 / 日产和沃尔沃是所有积极采用者和贡献者 GENIVI 和其他许多 OEM 厂商已经在他们的汽车 IVI 解决方案,广泛使用 GENIVI 的软件。 - -#### 贡献的代码使用了什么许可证? - -GENIVI 采用数量的许可证从(L)GPLv2 许可,以 MPLv2 到 Apache2.0。我们的一些工具使用 Eclipse 许可证。我们有一个[public licensing policy][18],详细说明我们的许可偏好。 - -#### 一个人或一群人如何参与其中?重要的是如何对项目的持续成功的社区贡献? - -GENIVI 完全做它开放发展的在([projects.genivi.org][19]),因此,有兴趣的人在汽车使用开源软件,欢迎参加。这就是说,该联盟能够通过公司 [joining GENIVI][20] 作为成员不断发展的开放基金。 GENIVI 会员享受各种各样的福利,而不是其中最重要的是在已经发展了近六年来 140 家公司全球社区参与。 - -社区是 GENIVI 非常重要的,我们不可能生产和维护我们发展了很多年没有贡献者一个活跃的社区有价值的软件。我们努力做出贡献 GENIVI 简单,只要加入一个 [邮件列表] [21] 并连接到人们在不同的软件项目。我们使用许多开源项目采用的标准做法,并提供高质量的工具和基础设施,以帮助开发人员有宾至如归的感觉,并富有成效。 - -无论在汽车软件某人的熟悉,欢迎他们加入我们的社区。人们已经改装车多年,所以对于许多人来说,是一种天然的抽奖,任何汽车。软件是汽车的新域,GENIVI 希望成为敞开的门有兴趣的人与汽车,开源软件的工作。 - -------------------------------- -via: https://opensource.com/business/16/5/interview-alison-chaiken-steven-crumb - -作者:[Don Watkins][a] -译者:[erlinux](https://github.com/erlinux) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/don-watkins -[1]: https://en.wikipedia.org/wiki/In_car_entertainment -[2]: https://opensource.com/life/16/1/weekly-news-jan-9 -[3]: http://projects.genivi.org/smartdevicelink/home -[4]: http://www.genivi.org/ -[5]: https://www.linkedin.com/in/stevecrumb -[6]: http://www.genivi.org/genivi-members -[7]: http://www.linuxfoundation.org/ -[8]: https://www.automotivelinux.org/ -[9]: https://en.wikipedia.org/wiki/Telematics -[10]: https://www.automotivelinux.org/news/announcement/2016/01/ford-mazda-mitsubishi-motors-and-subaru-join-linux-foundation-and -[11]: https://www.linkedin.com/in/alison-chaiken-3ba456b3 -[12]: https://www.linkedin.com/in/stevecrumb -[13]: https://opensource.com/users/eximious -[14]: https://en.wikipedia.org/wiki/MeeGo -[15]: http://webinos.org/deliverable-d026-target-platform-requirements-and-ipr/automotive/ -[16]: http://she-devel.com/Chaiken_automotive_cybersecurity.pdf -[17]: https://www.osvehicle.com/ -[18]: http://projects.genivi.org/how -[19]: http://projects.genivi.org/ -[20]: http://genivi.org/join -[21]: http://lists.genivi.org/mailman/listinfo/genivi-projects From f94c66337bc58cb829b7d3bbb321a08f7f944c37 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Fri, 1 Jul 2016 09:22:57 +0800 Subject: [PATCH 1045/1469] [Translated] Awk Part 3 (#4127) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [Translated] Awk Part 3 * 移动翻译后的文章 --- ... Strings Using Pattern Specific Actions.md | 85 ------------------- ... Strings Using Pattern Specific Actions.md | 82 ++++++++++++++++++ 2 files changed, 82 insertions(+), 85 deletions(-) delete mode 100644 sources/tech/awk/Part 3 - How to Use Awk to Filter Text or Strings Using Pattern Specific Actions.md create mode 100644 translated/tech/awk/Part 3 - How to Use Awk to Filter Text or Strings Using Pattern Specific Actions.md diff --git a/sources/tech/awk/Part 3 - How to Use Awk to Filter Text or Strings Using Pattern Specific Actions.md b/sources/tech/awk/Part 3 - How to Use Awk to Filter Text or Strings Using Pattern Specific Actions.md deleted file mode 100644 index acdfe66167..0000000000 --- a/sources/tech/awk/Part 3 - How to Use Awk to Filter Text or Strings Using Pattern Specific Actions.md +++ /dev/null @@ -1,85 +0,0 @@ -FSSlc translating - -How to Use Awk to Filter Text or Strings Using Pattern Specific Actions -========================================================================= - -![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-to-Filter-Text-or-Strings-Using-Pattern.png) - -In the third part of the Awk command series, we shall take a look at filtering text or strings based on specific patterns that a user can define. - -Sometimes, when filtering text, you want to indicate certain lines from an input file or lines of strings based on a given condition or using a specific pattern that can be matched. Doing this with Awk is very easy, it is one of the great features of Awk that you will find helpful. - -Let us take a look at an example below, say you have a shopping list for food items that you want to buy, called food_prices.list. It has the following list of food items and their prices. - -``` -$ cat food_prices.list -No Item_Name Quantity Price -1 Mangoes 10 $2.45 -2 Apples 20 $1.50 -3 Bananas 5 $0.90 -4 Pineapples 10 $3.46 -5 Oranges 10 $0.78 -6 Tomatoes 5 $0.55 -7 Onions 5 $0.45 -``` - -And then, you want to indicate a `(*)` sign on food items whose price is greater than $2, this can be done by running the following command: - -``` -$ awk '/ *\$[2-9]\.[0-9][0-9] */ { print $1, $2, $3, $4, "*" ; } / *\$[0-1]\.[0-9][0-9] */ { print ; }' food_prices.list -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/04/Filter-and-Print-Text-Using-Awk.gif) ->Print Items Whose Price is Greater Than $2 - -From the output above, you can see that the there is a `(*)` sign at the end of the lines having food items, mangoes and pineapples. If you check their prices, they are above $2. - -In this example, we have used used two patterns: - -- the first: `/ *\$[2-9]\.[0-9][0-9] */` gets the lines that have food item price greater than $2 and -- the second: `/*\$[0-1]\.[0-9][0-9] */` looks for lines with food item price less than $2. - -This is what happens, there are four fields in the file, when pattern one encounters a line with food item price greater than $2, it prints all the four fields and a `(*)` sign at the end of the line as a flag. - -The second pattern simply prints the other lines with food price less than $2 as they appear in the input file, food_prices.list. - -This way you can use pattern specific actions to filter out food items that are priced above $2, though there is a problem with the output, the lines that have the `(*)` sign are not formatted out like the rest of the lines making the output not clear enough. - -We saw the same problem in Part 2 of the awk series, but we can solve it in two ways: - -1. Using printf command which is a long and boring way using the command below: - -``` -$ awk '/ *\$[2-9]\.[0-9][0-9] */ { printf "%-10s %-10s %-10s %-10s\n", $1, $2, $3, $4 "*" ; } / *\$[0-1]\.[0-9][0-9] */ { printf "%-10s %-10s %-10s %-10s\n", $1, $2, $3, $4; }' food_prices.list -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/04/Filter-and-Print-Items-Using-Awk-and-Printf.gif) ->Filter and Print Items Using Awk and Printf - -2. Using $0 field. Awk uses the variable 0 to store the whole input line. This is handy for solving the problem above and it is simple and fast as follows: - -``` -$ awk '/ *\$[2-9]\.[0-9][0-9] */ { print $0 "*" ; } / *\$[0-1]\.[0-9][0-9] */ { print ; }' food_prices.list -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/04/Filter-and-Print-Items-Using-Awk-and-Variable.gif) ->Filter and Print Items Using Awk and Variable - -Conclusion -That’s it for now and these are simple ways of filtering text using pattern specific action that can help in flagging lines of text or strings in a file using Awk command. - -Hope you find this article helpful and remember to read the next part of the series which will focus on using comparison operators using awk tool. - - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/awk-filter-text-or-string-using-patterns/ - -作者:[Aaron Kili][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/aaronkili/ - diff --git a/translated/tech/awk/Part 3 - How to Use Awk to Filter Text or Strings Using Pattern Specific Actions.md b/translated/tech/awk/Part 3 - How to Use Awk to Filter Text or Strings Using Pattern Specific Actions.md new file mode 100644 index 0000000000..ef91e93575 --- /dev/null +++ b/translated/tech/awk/Part 3 - How to Use Awk to Filter Text or Strings Using Pattern Specific Actions.md @@ -0,0 +1,82 @@ +如何使用 Awk 来筛选文本或字符串 +========================================================================= + +![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-to-Filter-Text-or-Strings-Using-Pattern.png) + +作为 Awk 命令系列的第三部分,这次我们将看一看如何基于用户定义的特定模式来筛选文本或字符串。 + +在筛选文本时,有时你可能想根据某个给定的条件或使用一个特定的可被匹配的模式,去标记某个文件或数行字符串中的某几行。使用 Awk 来完成这个任务是非常容易的,这也正是 Awk 中可能对你有所帮助的几个特色之一。 + +让我们看一看下面这个例子,比方说你有一个写有你想要购买的食物的购物清单,其名称为 food_prices.list,它所含有的食物名称及相应的价格如下所示: + +``` +$ cat food_prices.list +No Item_Name Quantity Price +1 Mangoes 10 $2.45 +2 Apples 20 $1.50 +3 Bananas 5 $0.90 +4 Pineapples 10 $3.46 +5 Oranges 10 $0.78 +6 Tomatoes 5 $0.55 +7 Onions 5 $0.45 +``` + +然后,你想使用一个 `(*)` 符号去标记那些单价大于 $2 的食物,那么你可以通过运行下面的命令来达到此目的: + +``` +$ awk '/ *\$[2-9]\.[0-9][0-9] */ { print $1, $2, $3, $4, "*" ; } / *\$[0-1]\.[0-9][0-9] */ { print ; }' food_prices.list +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/04/Filter-and-Print-Text-Using-Awk.gif) +>打印出单价大于 $2 的项目 + +从上面的输出你可以看到在含有 芒果(mangoes) 和 菠萝(pineapples) 的那行末尾都已经有了一个 `(*)` 标记。假如你检查它们的单价,你可以看到它们的单价的确超过了 $2 。 + +在这个例子中,我们已经使用了两个模式: + +- 第一个模式: `/ *\$[2-9]\.[0-9][0-9] */` 将会得到那些含有食物单价大于 $2 的行, +- 第二个模式: `/*\$[0-1]\.[0-9][0-9] */` 将查找那些食物单价小于 $2 的那些行。 + +上面的命令具体做了什么呢?这个文件有四个字段,当模式一匹配到含有食物单价大于 $2 的行时,它便会输出所有的四个字段并在该行末尾加上一个 `(*)` 符号来作为标记。 + +第二个模式只是简单地输出其他含有食物单价小于 $2 的行,因为它们出现在输入文件 food_prices.list 中。 + +这样你就可以使用模式来筛选出那些价格超过 $2 的食物项目,尽管上面的输出还有些问题,带有 `(*)` 符号的那些行并没有像其他行那样被格式化输出,这使得输出显得不够清晰。 + +我们在 Awk 系列的第二部分中也看到了同样的问题,但我们可以使用下面的两种方式来解决: + +1. 可以像下面这样使用 printf 命令,但这样使用又长又无聊: + +``` +$ awk '/ *\$[2-9]\.[0-9][0-9] */ { printf "%-10s %-10s %-10s %-10s\n", $1, $2, $3, $4 "*" ; } / *\$[0-1]\.[0-9][0-9] */ { printf "%-10s %-10s %-10s %-10s\n", $1, $2, $3, $4; }' food_prices.list +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/04/Filter-and-Print-Items-Using-Awk-and-Printf.gif) +>使用 Awk 和 Printf 来筛选和输出项目 + +2. 使用 `$0` 字段。Awk 使用变量 **0** 来存储整个输入行。对于上面的问题,这种方式非常方便,并且它还简单、快速: + +``` +$ awk '/ *\$[2-9]\.[0-9][0-9] */ { print $0 "*" ; } / *\$[0-1]\.[0-9][0-9] */ { print ; }' food_prices.list +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/04/Filter-and-Print-Items-Using-Awk-and-Variable.gif) +>使用 Awk 和变量来筛选和输出项目 + +### 结论 + +这就是全部内容了,使用 Awk 命令你便可以通过几种简单的方法去利用模式匹配来筛选文本,帮助你在一个文件中对文本或字符串的某些行做标记。 + +希望这篇文章对你有所帮助。记得阅读这个系列的下一部分,我们将关注在 awk 工具中使用比较运算符。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/awk-filter-text-or-string-using-patterns/ + +作者:[Aaron Kili][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/aaronkili/ \ No newline at end of file From b0d645d5dd92daf67acdfb00f5c59e55abd47a13 Mon Sep 17 00:00:00 2001 From: kokialoves <498497353@qq.com> Date: Fri, 1 Jul 2016 11:01:06 +0800 Subject: [PATCH 1046/1469] merge (#4128) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Delete Part 6 - How to Use ‘next’ Command with Awk in Linux.md * Add files via upload * Create Part 6 - How to Use ‘next’ Command with Awk in Linux.md From 6ef12a2d7ac686988f7f375e8b19829920eb81ab Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 1 Jul 2016 11:04:54 +0800 Subject: [PATCH 1047/1469] =?UTF-8?q?=E5=BD=92=E6=A1=A3201606?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...3 Mark Shuttleworth--The Man Behind Ubuntu Operating System.md | 0 ...210 Getting started with Docker by Dockerizing this Blog.md.md | 0 ...0160214 How to Install MariaDB 10 on CentOS 7 CPanel Server.md | 0 ...w to Enable Multiple PHP-FPM Instances with Nginx or Apache.md | 0 .../20160218 7 Steps to Start Your Linux SysAdmin Career.md | 0 .../20160218 9 Key Trends in Hybrid Cloud Computing.md | 0 published/{ => 201606}/20160218 A Linux-powered microwave oven.md | 0 .../20160218 Getting to Know Linux File Permissions.md | 0 .../20160218 Linux Systems Patched for Critical glibc Flaw.md | 0 .../20160218 Top 4 open source issue tracking tools.md | 0 ...eils a tiny 64-bit ARM processor for the Internet of Things.md | 0 ...a Center Admin Suite Should Bring Order to Containerization.md | 0 .../20160228 Two Outstanding All-in-One Linux Servers.md | 0 .../20160304 Image processing at NASA with open source tools.md | 0 ...0 65% of companies are contributing to open source projects.md | 0 ...13 How to Set Up 2-Factor Authentication for Login and sudo.md | 0 .../20160514 NODEOS - LINUX DISTRIBUTION FOR NODE LOVERS.md | 0 .../20160516 4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX.md | 0 .../20160518 Android Use Apps Even Without Installing Them.md | 0 .../20160520 ORB - NEW GENERATION OF LINUX APPS ARE HERE.md | 0 .../20160523 Driving cars into the future with Linux.md | 0 .../20160524 Test Fedora 24 Beta in an OpenStack cloud.md | 0 .../20160526 BEST LINUX PHOTO MANAGEMENT SOFTWARE IN 2016.md | 0 ...29 LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS.md | 0 published/{ => 201606}/20160601 Apps to Snaps.md | 0 published/{ => 201606}/20160601 scp command in Linux.md | 0 .../20160605 How to Add Cron Jobs in Linux and Unix.md | 0 ...lace Passwords With A New Trust-Based Authentication Method.md | 0 ...A Smart Way to Lock User Virtual Console or Terminal in Linux.md | 0 .../{ => 201606}/20160621 Building Serverless App with Docker.md | 0 30 files changed, 0 insertions(+), 0 deletions(-) rename published/{ => 201606}/20151023 Mark Shuttleworth--The Man Behind Ubuntu Operating System.md (100%) rename published/{ => 201606}/20151210 Getting started with Docker by Dockerizing this Blog.md.md (100%) rename published/{ => 201606}/20160214 How to Install MariaDB 10 on CentOS 7 CPanel Server.md (100%) rename published/{ => 201606}/20160217 How to Enable Multiple PHP-FPM Instances with Nginx or Apache.md (100%) rename published/{ => 201606}/20160218 7 Steps to Start Your Linux SysAdmin Career.md (100%) rename published/{ => 201606}/20160218 9 Key Trends in Hybrid Cloud Computing.md (100%) rename published/{ => 201606}/20160218 A Linux-powered microwave oven.md (100%) rename published/{ => 201606}/20160218 Getting to Know Linux File Permissions.md (100%) rename published/{ => 201606}/20160218 Linux Systems Patched for Critical glibc Flaw.md (100%) rename published/{ => 201606}/20160218 Top 4 open source issue tracking tools.md (100%) rename published/{ => 201606}/20160221 NXP unveils a tiny 64-bit ARM processor for the Internet of Things.md (100%) rename published/{ => 201606}/20160223 New Docker Data Center Admin Suite Should Bring Order to Containerization.md (100%) rename published/{ => 201606}/20160228 Two Outstanding All-in-One Linux Servers.md (100%) rename published/{ => 201606}/20160304 Image processing at NASA with open source tools.md (100%) rename published/{ => 201606}/20160510 65% of companies are contributing to open source projects.md (100%) rename published/{ => 201606}/20160513 How to Set Up 2-Factor Authentication for Login and sudo.md (100%) rename published/{ => 201606}/20160514 NODEOS - LINUX DISTRIBUTION FOR NODE LOVERS.md (100%) rename published/{ => 201606}/20160516 4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX.md (100%) rename published/{ => 201606}/20160518 Android Use Apps Even Without Installing Them.md (100%) rename published/{ => 201606}/20160520 ORB - NEW GENERATION OF LINUX APPS ARE HERE.md (100%) rename published/{ => 201606}/20160523 Driving cars into the future with Linux.md (100%) rename published/{ => 201606}/20160524 Test Fedora 24 Beta in an OpenStack cloud.md (100%) rename published/{ => 201606}/20160526 BEST LINUX PHOTO MANAGEMENT SOFTWARE IN 2016.md (100%) rename published/{ => 201606}/20160529 LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS.md (100%) rename published/{ => 201606}/20160601 Apps to Snaps.md (100%) rename published/{ => 201606}/20160601 scp command in Linux.md (100%) rename published/{ => 201606}/20160605 How to Add Cron Jobs in Linux and Unix.md (100%) rename published/{ => 201606}/20160605 Will Google Replace Passwords With A New Trust-Based Authentication Method.md (100%) rename published/{ => 201606}/20160611 vlock – A Smart Way to Lock User Virtual Console or Terminal in Linux.md (100%) rename published/{ => 201606}/20160621 Building Serverless App with Docker.md (100%) diff --git a/published/20151023 Mark Shuttleworth--The Man Behind Ubuntu Operating System.md b/published/201606/20151023 Mark Shuttleworth--The Man Behind Ubuntu Operating System.md similarity index 100% rename from published/20151023 Mark Shuttleworth--The Man Behind Ubuntu Operating System.md rename to published/201606/20151023 Mark Shuttleworth--The Man Behind Ubuntu Operating System.md diff --git a/published/20151210 Getting started with Docker by Dockerizing this Blog.md.md b/published/201606/20151210 Getting started with Docker by Dockerizing this Blog.md.md similarity index 100% rename from published/20151210 Getting started with Docker by Dockerizing this Blog.md.md rename to published/201606/20151210 Getting started with Docker by Dockerizing this Blog.md.md diff --git a/published/20160214 How to Install MariaDB 10 on CentOS 7 CPanel Server.md b/published/201606/20160214 How to Install MariaDB 10 on CentOS 7 CPanel Server.md similarity index 100% rename from published/20160214 How to Install MariaDB 10 on CentOS 7 CPanel Server.md rename to published/201606/20160214 How to Install MariaDB 10 on CentOS 7 CPanel Server.md diff --git a/published/20160217 How to Enable Multiple PHP-FPM Instances with Nginx or Apache.md b/published/201606/20160217 How to Enable Multiple PHP-FPM Instances with Nginx or Apache.md similarity index 100% rename from published/20160217 How to Enable Multiple PHP-FPM Instances with Nginx or Apache.md rename to published/201606/20160217 How to Enable Multiple PHP-FPM Instances with Nginx or Apache.md diff --git a/published/20160218 7 Steps to Start Your Linux SysAdmin Career.md b/published/201606/20160218 7 Steps to Start Your Linux SysAdmin Career.md similarity index 100% rename from published/20160218 7 Steps to Start Your Linux SysAdmin Career.md rename to published/201606/20160218 7 Steps to Start Your Linux SysAdmin Career.md diff --git a/published/20160218 9 Key Trends in Hybrid Cloud Computing.md b/published/201606/20160218 9 Key Trends in Hybrid Cloud Computing.md similarity index 100% rename from published/20160218 9 Key Trends in Hybrid Cloud Computing.md rename to published/201606/20160218 9 Key Trends in Hybrid Cloud Computing.md diff --git a/published/20160218 A Linux-powered microwave oven.md b/published/201606/20160218 A Linux-powered microwave oven.md similarity index 100% rename from published/20160218 A Linux-powered microwave oven.md rename to published/201606/20160218 A Linux-powered microwave oven.md diff --git a/published/20160218 Getting to Know Linux File Permissions.md b/published/201606/20160218 Getting to Know Linux File Permissions.md similarity index 100% rename from published/20160218 Getting to Know Linux File Permissions.md rename to published/201606/20160218 Getting to Know Linux File Permissions.md diff --git a/published/20160218 Linux Systems Patched for Critical glibc Flaw.md b/published/201606/20160218 Linux Systems Patched for Critical glibc Flaw.md similarity index 100% rename from published/20160218 Linux Systems Patched for Critical glibc Flaw.md rename to published/201606/20160218 Linux Systems Patched for Critical glibc Flaw.md diff --git a/published/20160218 Top 4 open source issue tracking tools.md b/published/201606/20160218 Top 4 open source issue tracking tools.md similarity index 100% rename from published/20160218 Top 4 open source issue tracking tools.md rename to published/201606/20160218 Top 4 open source issue tracking tools.md diff --git a/published/20160221 NXP unveils a tiny 64-bit ARM processor for the Internet of Things.md b/published/201606/20160221 NXP unveils a tiny 64-bit ARM processor for the Internet of Things.md similarity index 100% rename from published/20160221 NXP unveils a tiny 64-bit ARM processor for the Internet of Things.md rename to published/201606/20160221 NXP unveils a tiny 64-bit ARM processor for the Internet of Things.md diff --git a/published/20160223 New Docker Data Center Admin Suite Should Bring Order to Containerization.md b/published/201606/20160223 New Docker Data Center Admin Suite Should Bring Order to Containerization.md similarity index 100% rename from published/20160223 New Docker Data Center Admin Suite Should Bring Order to Containerization.md rename to published/201606/20160223 New Docker Data Center Admin Suite Should Bring Order to Containerization.md diff --git a/published/20160228 Two Outstanding All-in-One Linux Servers.md b/published/201606/20160228 Two Outstanding All-in-One Linux Servers.md similarity index 100% rename from published/20160228 Two Outstanding All-in-One Linux Servers.md rename to published/201606/20160228 Two Outstanding All-in-One Linux Servers.md diff --git a/published/20160304 Image processing at NASA with open source tools.md b/published/201606/20160304 Image processing at NASA with open source tools.md similarity index 100% rename from published/20160304 Image processing at NASA with open source tools.md rename to published/201606/20160304 Image processing at NASA with open source tools.md diff --git a/published/20160510 65% of companies are contributing to open source projects.md b/published/201606/20160510 65% of companies are contributing to open source projects.md similarity index 100% rename from published/20160510 65% of companies are contributing to open source projects.md rename to published/201606/20160510 65% of companies are contributing to open source projects.md diff --git a/published/20160513 How to Set Up 2-Factor Authentication for Login and sudo.md b/published/201606/20160513 How to Set Up 2-Factor Authentication for Login and sudo.md similarity index 100% rename from published/20160513 How to Set Up 2-Factor Authentication for Login and sudo.md rename to published/201606/20160513 How to Set Up 2-Factor Authentication for Login and sudo.md diff --git a/published/20160514 NODEOS - LINUX DISTRIBUTION FOR NODE LOVERS.md b/published/201606/20160514 NODEOS - LINUX DISTRIBUTION FOR NODE LOVERS.md similarity index 100% rename from published/20160514 NODEOS - LINUX DISTRIBUTION FOR NODE LOVERS.md rename to published/201606/20160514 NODEOS - LINUX DISTRIBUTION FOR NODE LOVERS.md diff --git a/published/20160516 4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX.md b/published/201606/20160516 4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX.md similarity index 100% rename from published/20160516 4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX.md rename to published/201606/20160516 4 BEST MODERN OPEN SOURCE CODE EDITORS FOR LINUX.md diff --git a/published/20160518 Android Use Apps Even Without Installing Them.md b/published/201606/20160518 Android Use Apps Even Without Installing Them.md similarity index 100% rename from published/20160518 Android Use Apps Even Without Installing Them.md rename to published/201606/20160518 Android Use Apps Even Without Installing Them.md diff --git a/published/20160520 ORB - NEW GENERATION OF LINUX APPS ARE HERE.md b/published/201606/20160520 ORB - NEW GENERATION OF LINUX APPS ARE HERE.md similarity index 100% rename from published/20160520 ORB - NEW GENERATION OF LINUX APPS ARE HERE.md rename to published/201606/20160520 ORB - NEW GENERATION OF LINUX APPS ARE HERE.md diff --git a/published/20160523 Driving cars into the future with Linux.md b/published/201606/20160523 Driving cars into the future with Linux.md similarity index 100% rename from published/20160523 Driving cars into the future with Linux.md rename to published/201606/20160523 Driving cars into the future with Linux.md diff --git a/published/20160524 Test Fedora 24 Beta in an OpenStack cloud.md b/published/201606/20160524 Test Fedora 24 Beta in an OpenStack cloud.md similarity index 100% rename from published/20160524 Test Fedora 24 Beta in an OpenStack cloud.md rename to published/201606/20160524 Test Fedora 24 Beta in an OpenStack cloud.md diff --git a/published/20160526 BEST LINUX PHOTO MANAGEMENT SOFTWARE IN 2016.md b/published/201606/20160526 BEST LINUX PHOTO MANAGEMENT SOFTWARE IN 2016.md similarity index 100% rename from published/20160526 BEST LINUX PHOTO MANAGEMENT SOFTWARE IN 2016.md rename to published/201606/20160526 BEST LINUX PHOTO MANAGEMENT SOFTWARE IN 2016.md diff --git a/published/20160529 LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS.md b/published/201606/20160529 LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS.md similarity index 100% rename from published/20160529 LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS.md rename to published/201606/20160529 LAMP Stack Installation Guide on Ubuntu Server 16.04 LTS.md diff --git a/published/20160601 Apps to Snaps.md b/published/201606/20160601 Apps to Snaps.md similarity index 100% rename from published/20160601 Apps to Snaps.md rename to published/201606/20160601 Apps to Snaps.md diff --git a/published/20160601 scp command in Linux.md b/published/201606/20160601 scp command in Linux.md similarity index 100% rename from published/20160601 scp command in Linux.md rename to published/201606/20160601 scp command in Linux.md diff --git a/published/20160605 How to Add Cron Jobs in Linux and Unix.md b/published/201606/20160605 How to Add Cron Jobs in Linux and Unix.md similarity index 100% rename from published/20160605 How to Add Cron Jobs in Linux and Unix.md rename to published/201606/20160605 How to Add Cron Jobs in Linux and Unix.md diff --git a/published/20160605 Will Google Replace Passwords With A New Trust-Based Authentication Method.md b/published/201606/20160605 Will Google Replace Passwords With A New Trust-Based Authentication Method.md similarity index 100% rename from published/20160605 Will Google Replace Passwords With A New Trust-Based Authentication Method.md rename to published/201606/20160605 Will Google Replace Passwords With A New Trust-Based Authentication Method.md diff --git a/published/20160611 vlock – A Smart Way to Lock User Virtual Console or Terminal in Linux.md b/published/201606/20160611 vlock – A Smart Way to Lock User Virtual Console or Terminal in Linux.md similarity index 100% rename from published/20160611 vlock – A Smart Way to Lock User Virtual Console or Terminal in Linux.md rename to published/201606/20160611 vlock – A Smart Way to Lock User Virtual Console or Terminal in Linux.md diff --git a/published/20160621 Building Serverless App with Docker.md b/published/201606/20160621 Building Serverless App with Docker.md similarity index 100% rename from published/20160621 Building Serverless App with Docker.md rename to published/201606/20160621 Building Serverless App with Docker.md From 6ce3fa40c5b991e0733da9db77d59d730974c5f4 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 1 Jul 2016 11:06:17 +0800 Subject: [PATCH 1048/1469] PUB:20160531 Why Ubuntu-based Distros Are Leaders MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @vim-kakali 总体翻译的不错。个别地方理解有误,语句组织需调整。加油! --- ...31 Why Ubuntu-based Distros Are Leaders.md | 63 ++++++++++++++ ...31 Why Ubuntu-based Distros Are Leaders.md | 85 ------------------- 2 files changed, 63 insertions(+), 85 deletions(-) create mode 100644 published/20160531 Why Ubuntu-based Distros Are Leaders.md delete mode 100644 translated/talk/20160531 Why Ubuntu-based Distros Are Leaders.md diff --git a/published/20160531 Why Ubuntu-based Distros Are Leaders.md b/published/20160531 Why Ubuntu-based Distros Are Leaders.md new file mode 100644 index 0000000000..c909e753f7 --- /dev/null +++ b/published/20160531 Why Ubuntu-based Distros Are Leaders.md @@ -0,0 +1,63 @@ +为什么 Ubuntu 家族会占据 Linux 发行版的主导地位? +========================================= + +在过去的数年中,我体验了一些优秀的 Linux 发行版。给我印象最深刻的是那些由强大的社区维护的发行版,而流行的发行版比强大的社区给我的印象更深。流行的 Linux 发行版往往能吸引新用户,这通常是由于其流行而使得使用该发行版会更加容易。并非绝对如此,但一般来说是这样的。 + +说到这里,首先映入我脑海的一个发行版是 [Ubuntu][1]。其基于健壮的 [Debian][2] 发行版构建,它不仅成为了一个非常受欢迎的 Linux 发行版,而且它也衍生出了不可计数的其他分支,比如 Linux Mint 就是一个例子。在本文中,我会探讨为何我认为 Ubuntu 会赢得 Linux 发行版之战的原因,以及它是怎样影响到了整个 Linux 桌面领域。 + +### Ubuntu 易于使用 + +在我几年前首次尝试使用 Ubuntu 前,我更喜欢使用 KED 桌面。在那个时期,我接触的大多是这种 KDE 桌面环境。主要原因还是 KDE 是大多数新手容易入手的 Linux 发行版中最受欢迎的。这些新手友好的发行版有 Knoppix、Simply Mepis、Xandros、Linspire 以及其它的发行版等等,这些发行版都推荐他们的用户去使用广受欢迎的 KDE。 + +现在 KDE 能满足我的需求,我也没有什么理由去折腾其他的桌面环境。有一天我的 Debian 安装失败了(由于我个人的操作不当),我决定尝试开发代号为 Dapper Drake 的 Ubuntu 版本(LCTT 译注:Ubuntu 6.06 - Dapper Drake,发布日期:2006 年 6 月 1 日),每个人都对它赞不绝口。那个时候,我对于它的印象仅限于屏幕截图,但是我想试试也挺有趣的。 + +Ubuntu Dapper Drake 给我的最大的印象是它让我很清楚地知道每个东西都在哪儿。记住,我是来自于 KDE 世界的用户,在 KDE 上要想改变菜单的设置就有 15 种方法 !而 Ubuntu 上的 GNOME 实现极具极简主义的。 + +时间来到 2016 年,最新的版本号是 16.04:我们有了好几种 Ubuntu 特色版本,也有一大堆基于 Ubuntu 的发行版。所有的 Ubuntu 特色版和衍生发行版的共同具有的核心都是为易用而设计。发行版想要增大用户基数时,这就是最重要的原因。 + +### Ubuntu LTS + +过去,我几乎一直坚持使用 LTS(Long Term Support)发行版作为我的主要桌面系统。10月份的发行版很适合我测试硬盘驱动器,甚至把它用在一个老旧的手提电脑上。我这样做的原因很简单——我没有兴趣在一个正式使用的电脑上折腾短期发行版。我是个很忙的家伙,我觉得这样会浪费我的时间。 + +对于我来说,我认为 Ubuntu 提供 LTS 发行版是 Ubuntu 能够变得流行的最大的原因。这样说吧———给普罗大众提供一个桌面 Linux 发行版,这个发行版能够得到长期的有效支持就是它的优势。事实上,不只 Ubuntu 是这样,其他的分支在这一点上也做的很好。长期支持策略以及对新手的友好环境,我认为这就为 Ubuntu 的普及带来了莫大的好处。 + +### Ubuntu Snap 软件包 + +以前,用户会夸赞可以在他们的系统上使用 PPA(personal package archive 个人软件包档案)获得新的软件。不好的是,这种技术也有缺点。当它用在各种软件名称时, PPA 经常会找不到,这种情况很常见。 + +现在有了 [Snap 软件包][3] 。当然这不是一个全新的概念,过去已经进行了类似的尝试。用户可以在一个长期支持版本上运行最新的软件,而不必去使用最新的 Ubuntu 发行版。虽然我认为目前还处于 Snap 软件包的早期,但是我很期待可以在一个稳定的发行版上运行的崭新的软件。 + +最明显的问题是,如果你要运行很多软件,那么 Snap 包实际会占用很多硬盘空间。不仅如此,大多数 Ubuntu 软件仍然需要由官方从 deb 包进行转换。第一个问题可以通过使用更大的硬盘空间得到解决,而后一个问题的解决则需要等待。 + +### Ubuntu 社区 + +首先,我承认大多数主要的 Linux 发行版都有强大的社区。然而,我坚信 Ubuntu 社区的成员是最多样化的,他们来自各行各业。例如,我们的论坛包括从苹果硬件支持到游戏等不同分类。特别是这些专业的讨论话题还非常广泛。 + +除过论坛,Ubuntu 也提供了一个很正式的社区组织。这个组织包括一个理事会、技术委员会、[本地社区团队][4]和开发者成员委员会。还有很多,但是这些都是我知道的社区组织部分。 + +我们还有一个 [Ubuntu 问答][5]版块。我认为,这种功能可以代替人们从论坛寻求帮助的方式,我发现在这个网站你得到有用信息的可能性更大。不仅如此,那些提供的解决方案中被选出的最精准的答案也会被写入到官方文档中。 + +### Ubuntu 的未来 + +我认为 Ubuntu 的 Unity 界面(LCTT 译注:Unity 是 Canonical 公司为 Ubuntu 操作系统的 GNOME 桌面环境开发的图形化界面)在提升桌面占有率上少有作为。我能理解其中的缘由,现在它主要做一些诸如可以使开发团队的工作更轻松的事情。但是最终,我还是认为 Unity 为 Ubuntu MATE 和 Linux Mint 的普及铺平道路。 + +我最好奇的一点是 Ubuntu's IRC 和邮件列表的发展(LCTT 译注:可以在 Ubuntu LoCo Teams 的 IRC Chat 上提问关于地方团队和计划的事件的问题,也可以和一些不同团队的成员进行交流)。事实是,他们都不能像 Ubuntu 问答板块那样文档化。至于邮件列表,我一直认为这对于合作是一种很痛苦的过时方法,但这仅仅是我的个人看法——其他人可能有不同的看法,也可能会认为它很好。 + +你怎么看?你认为 Ubuntu 将来会占据主要的份额吗?也许你会认为 Arch 和 Linux Mint 或者其他的发行版会在普及度上打败 Ubuntu? 既然这样,那请大声说出你最喜爱的发行版。如果这个发行版是 Ubuntu 衍生版 ,说说你为什么更喜欢它而不是 Ubuntu 本身。如果不出意外,Ubuntu 会成为构建其他发行版的基础,我想很多人都是这样认为的。 + +-------------------------------------------------------------------------------- + +via: http://www.datamation.com/open-source/why-ubuntu-based-distros-are-leaders.html + +作者:[Matt Hartley][a] +译者:[vim-kakali](https://github.com/vim-kakali) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.datamation.com/author/Matt-Hartley-3080.html +[1]: http://www.ubuntu.com/ +[2]: https://www.debian.org/ +[3]: http://www.datamation.com/open-source/ubuntu-snap-packages-the-good-the-bad-the-ugly.html +[4]: http://loco.ubuntu.com/ +[5]: http://askubuntu.com/ diff --git a/translated/talk/20160531 Why Ubuntu-based Distros Are Leaders.md b/translated/talk/20160531 Why Ubuntu-based Distros Are Leaders.md deleted file mode 100644 index 9d9ce0f418..0000000000 --- a/translated/talk/20160531 Why Ubuntu-based Distros Are Leaders.md +++ /dev/null @@ -1,85 +0,0 @@ -为什么 Ubuntu 家族会占据 Linux 发行版的主导地位? -========================================= - -在过去的数年中,我已经尝试了大量的优秀 Linux 发行版。我印象最深刻的是那些被强大的社区维护的发行版。但是这样的发行版却比他们s所属的社区更受人欢迎。流行的 Linux 发行版吸引着更多的人,通常由于这样的特点使得使用该发行版更加容易。这很明显毫无关系,但一般认为这种说法是正确的。 - - -我想到的一个发行版 [Ubuntu][1]。它属于健壮的 [Debian][2]分支,Ubuntu 不可思议的成为了受欢迎的 Linux 发行版,而且它也衍生出了其他的版本,比如 Linux Mint。在本文中,我会探讨我坚信 Ubuntu 会赢得 Linux 发行版战争的原因,以及它在整个 Linux 桌面领域有着怎样的影响力。 - - -### Ubuntu容易使用 - - -多年前我第一次尝试使用Ubuntu,在这之前我更喜欢使用 KED 桌面。在那个时期,我接触的大多是这种 KDE 桌面环境。主要原因还是 KDE 是大多数新手友好的 Linux 发行版中最受欢迎的。新手友好的发行版有 Knoppix,Simply Mepis, Xandros, Linspire等,另外一些发行版和这些发行版都指出他们的用户趋向于使用 KDE。 - - - -现在KDE能满足我的需求,也没有什么理由去折腾其他的桌面环境了。有一天我的 Debian 安装失败了(由于我个人的操作不当),我决定尝试开发代号为「整洁的公鸭(Ubuntu Dapper Drake)」的 Ubuntu 版本【译者注:ubuntu 6.06 - Dapper Drake(整洁的公鸭),发布日期:2006年6月1日】。那个时候,我对于它的印象比一个屏幕截图还要少,但是我认为它很有趣并且毫无顾忌的使用它。 - - - -Ubuntu Dapper Drake 给我的最大的印象是它的操作很简单。记住,我是来自于 KDE 世界的用户,在 KDE 上要想改变菜单的设置就有15钟方法。Ubuntu 图形界面的安装启动极具极简主义。 - -时间来到2016年,最新的版本号是16.04:我们有多种可用的 Ubuntu 衍生版本,许多的都是基于 Ubuntu 的。所有的 Ubuntu 风格和公用发行版的核心都被设计的容易使用。并且发行版想要增大用户基数的时候,这就是最重要的原因。 - - -### Ubuntu LTS - -过去,我几乎一直坚持使用 LTS(Long Term Support)发行版作为我的主要桌面系统。10月份的发行版很适合我测试硬盘驱动器,甚至把它用在一个老旧的手提电脑上。我这样做的原因很简单——我没有兴趣在一个作为实验品的电脑上折腾短期发行版。我是个很忙的家伙,我觉得这样会浪费我的时间。 - - -对于我来说,我认为 Ubuntu 提供 LTS 发行版是 Ubuntu 能够变得流行的原因。这样说吧———提供一个大众的桌面 Linux 发行版,这个发行版能够得到长期的充分支持就是它的优势。事实上,Ubuntu 的优势不只这一点,其他的分支在这一点上也做的很好。长期支持版带有一个对新手的友好环境的策略,我认为这就为 Ubuntu 的普及带来了莫大的好处。 - - -### Ubuntu Snap 包 - - -以前,用户在他们的系统上使用很多 PPA(personal package archive个人软件包档案),他们总会抱怨它获得新的软件名称的能力。不好的是,这种技术也有缺点。它工作的时候带有任意的软件名称,而 PPA 却没有发现,这种情况很常见。 - - -现在有了[Snap 包][3] 。当然这不是一个全新的概念,过去已经进行了类似的尝试。用户不必要在最新的 Ubuntu 发行版上运行最新的软件,我认为这才是 Snap 将要长期提供给 Ubuntu 用户的东西。然而我仍然认为我们将会看到 Snap 淘汰的的那一天,我很期待看到一个在稳定的发行版上运行的优秀软件。 - - - -如果你要运行很多软件,那么 Snap 包实际使用的硬盘空间很明显存在问题。不仅如此,大多数 Ubuntu 软件也是通过由官方开发的 deb 包进行管理的。当后者需要花费一些时间的时候,这个问题可以通过 Snap 使用更大的硬盘驱动器空间得到解决。 - - - -### Ubuntu 社区 - -首先,我承认大多数主要的 Linux 发行版都有强大的社区。然而,我坚信 Ubuntu 社区的成员是最多样化的,他们来自各行各业。例如,我们有一个论坛来分类不同的苹果硬件对于游戏的支持程度。这些大量的专业讨论特别广泛。 - - -除过论坛,Ubuntu 也提供了一个很正式的社区组织。这个组织包括一个委员会,技术板块,[各地的团队LoCo teams][4](Ubuntu Local Community Teams)和开发人员板块。还有很多,但是这些都是我知道的社区组织部分。 - - -我们还有一个[Ubuntu 问答][5]板块。我认为,这种特色可以代替人们从论坛寻求帮助的方式,我发现在这个网站你得到有用信息的可能行更大。不仅如此,那些提供的解决方案中被选出的最精准的答案也会被写入到官方文档中。 - - -### Ubuntu 的未来 - - -我认为 Ubuntu 的 Unity 接口【译者注:Unity 是 Canonical 公司为 Ubuntu 操作系统的 GNOME 桌面环境开发的图形化 shell】在增加桌面舒适性上少有作为。我能理解其中的缘由,现在它主要做一些诸如可以使开发团队的工作更轻松的事情。但是最终,我还是希望 Unity 可以为 Ubuntu MATE 和 Linux Mint 的普及铺平道路。 - - -我最好奇的一点是 Ubuntu's IRC(Internet Relay Chat) 和邮件列表的发展【译者注:可以在 Ubuntu LoCo Teams IRC Chat上提问关于地方团队和计划的事件的问题,也可以和一些不同团队的成员进行交流】。事实是,他们都不能像 Ubuntu 问答板块那样为它们自己增添一些好的文档。至于邮件列表,我一直认为这对于合作是一种很痛苦的过时方法,但这仅仅是我的个人看法——其他人可能有不同的看法,也可能会认为它很好。 - -你说什么?你认为 Ubuntu 将来会剩下一点主要的使用者?也许你相信 Arch 和 Linux Mint 或者其他的发行版会在普及度上打败 Ubuntu 。 既然这样,那请大声说出你最喜爱的发行版。如果这个发行版是 Ubuntu 衍生版 ,说说你为什么更喜欢它而不是 Ubuntu 本身。如果不出意外,Ubuntu 会成为构建其他发行版的基础,我想很多人都是这样认为的。 - - --------------------------------------------------------------------------------- - -via: http://www.datamation.com/open-source/why-ubuntu-based-distros-are-leaders.html - -作者:[Matt Hartley][a] -译者:[vim-kakali](https://github.com/vim-kakali) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://www.datamation.com/author/Matt-Hartley-3080.html -[1]: http://www.ubuntu.com/ -[2]: https://www.debian.org/ -[3]: http://www.datamation.com/open-source/ubuntu-snap-packages-the-good-the-bad-the-ugly.html -[4]: http://loco.ubuntu.com/ -[5]: http://askubuntu.com/ From f4f3e69fde76733524282f676ace4df6a6c7f7e6 Mon Sep 17 00:00:00 2001 From: vim-kakali <1799225723@qq.com> Date: Fri, 1 Jul 2016 11:21:25 +0800 Subject: [PATCH 1049/1469] =?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 --- ...w to Read Awk Input from STDIN in Linux.md | 73 ------------------ ...w to Read Awk Input from STDIN in Linux.md | 76 +++++++++++++++++++ 2 files changed, 76 insertions(+), 73 deletions(-) delete mode 100644 sources/tech/awk/Part 7 - How to Read Awk Input from STDIN in Linux.md create mode 100644 translated/tech/awk/Part 7 - How to Read Awk Input from STDIN in Linux.md diff --git a/sources/tech/awk/Part 7 - How to Read Awk Input from STDIN in Linux.md b/sources/tech/awk/Part 7 - How to Read Awk Input from STDIN in Linux.md deleted file mode 100644 index 157716481a..0000000000 --- a/sources/tech/awk/Part 7 - How to Read Awk Input from STDIN in Linux.md +++ /dev/null @@ -1,73 +0,0 @@ -vim-kakali translating - - -How to Read Awk Input from STDIN in Linux -============================================ - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Read-Awk-Input-from-STDIN.png) - -In the previous parts of the Awk tool series, we looked at reading input mostly from a file(s), but what if you want to read input from STDIN. -In this Part 7 of Awk series, we shall look at few examples where you can filter the output of other commands instead of reading input from a file. - -We shall start with the [dir utility][1] that works similar to [ls command][2], in the first example below, we use the output of `dir -l` command as input for Awk to print owner’s username, groupname and the files he/she owns in the current directory: - -``` -# dir -l | awk '{print $3, $4, $9;}' -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/06/List-Files-Owned-By-User-in-Directory.png) ->List Files Owned By User in Directory - -Take a look at another example where we [employ awk expressions][3], here, we want to print files owned by the root user by using an expression to filter strings as in the awk command below: - -``` -# dir -l | awk '$3=="root" {print $1,$3,$4, $9;} ' -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/06/List-Files-Owned-by-Root-User.png) ->List Files Owned by Root User - -The command above includes the `(==)` comparison operator to help us filter out files in the current directory which are owned by the root user. This is achieved using the expression `$3==”root”`. - -Let us look at another example of where we use a [awk comparison operator][4] to match a certain string. - -Here, we have used the [cat utility][5] to view the contents of a file named tecmint_deals.txt and we want to view the deals of type Tech only, so we shall run the following commands: - -``` -# cat tecmint_deals.txt -# cat tecmint_deals.txt | awk '$4 ~ /tech/{print}' -# cat tecmint_deals.txt | awk '$4 ~ /Tech/{print}' -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Use-Comparison-Operator-to-Match-String.png) ->Use Awk Comparison Operator to Match String - -In the example above, we have used the value `~ /pattern/` comparison operator, but there are two commands to try and bring out something very important. - -When you run the command with pattern tech nothing is printed out because there is no deal of that type, but with Tech, you get deals of type Tech. - -So always be careful when using this comparison operator, it is case sensitive as we have seen above. - -You can always use the output of another command instead as input for awk instead of reading input from a file, this is very simple as we have looked at in the examples above. - -Hope the examples were clear enough for you to understand, if you have any concerns, you can express them through the comment section below and remember to check the next part of the series where we shall look at awk features such as variables, numeric expressions and assignment operators. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/read-awk-input-from-stdin-in-linux/ - -作者:[Aaron Kili][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/aaronkili/ -[1]: http://www.tecmint.com/linux-dir-command-usage-with-examples/ -[2]: http://www.tecmint.com/15-basic-ls-command-examples-in-linux/ -[3]: http://www.tecmint.com/combine-multiple-expressions-in-awk -[4]: http://www.tecmint.com/comparison-operators-in-awk -[5]: http://www.tecmint.com/13-basic-cat-command-examples-in-linux/ - - - diff --git a/translated/tech/awk/Part 7 - How to Read Awk Input from STDIN in Linux.md b/translated/tech/awk/Part 7 - How to Read Awk Input from STDIN in Linux.md new file mode 100644 index 0000000000..0d0d499d00 --- /dev/null +++ b/translated/tech/awk/Part 7 - How to Read Awk Input from STDIN in Linux.md @@ -0,0 +1,76 @@ + + +在 Linux 上怎么读取标准输入(STDIN)作为 Awk 的输入 +============================================ + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Read-Awk-Input-from-STDIN.png) + + +在 Awk 工具系列的前几节,我们看到大多数操作都是从一个文件或多个文件读取输入,或者你想要把标准输入作为 Awk 的输入. +在 Awk 系列的第7节中,我们将会看到几个例子,这些例子都是关于你可以筛选其他命令的输出代替从一个文件读取输入作为 awk 的输入. + + +我们开始使用 [dir utility][1] , dir 命令和 [ls 命令][2] 相似,在第一个例子下面,我们使用 'dir -l' 命令的输出作为 Awk 命令的输入,这样就可以打印出文件拥有者的用户名,所属组组名以及在当前路径下他/她拥有的文件. +``` +# dir -l | awk '{print $3, $4, $9;}' +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/06/List-Files-Owned-By-User-in-Directory.png) +>列出当前路径下的用户文件 + + +看另一个例子,我们 [使用 awk 表达式][3] ,在这里,我们想要在 awk 命令里使用一个表达式筛选出字符串,通过这样来打印出 root 用户的文件.命令如下: +``` +# dir -l | awk '$3=="root" {print $1,$3,$4, $9;} ' +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/06/List-Files-Owned-by-Root-User.png) +>列出 root 用户的文件 + + +上面的命令包含了 '(==)' 来进行比较操作,这帮助我们在当前路径下筛选出 root 用户的文件.这种方法的实现是通过使用 '$3=="root"' 表达式. + +让我们再看另一个例子,我们使用一个 [awk 比较运算符][4] 来匹配一个确定的字符串. + + +现在,我们已经用了 [cat utility][5] 来浏览文件名为 tecmint_deals.txt 的文件内容,并且我们想要仅仅查看有字符串 Tech 的部分,所以我们会运行下列命令: +``` +# cat tecmint_deals.txt +# cat tecmint_deals.txt | awk '$4 ~ /tech/{print}' +# cat tecmint_deals.txt | awk '$4 ~ /Tech/{print}' +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Use-Comparison-Operator-to-Match-String.png) +>用 Awk 比较运算符匹配字符串 + + +在上面的例子中,我们已经用了参数为 `~ /匹配字符/` 的比较操作,但是上面的两个命令给我们展示了一些很重要的问题. + +当你运行带有 tech 字符串的命令时终端没有输出,因为在文件中没有 tech 这种字符串,但是运行带有 Tech 字符串的命令,你却会得到包含 Tech 的输出. + +所以你应该在进行这种比较操作的时候时刻注意这种问题,正如我们在上面看到的那样, awk 对大小写很敏感. + + +你可以一直使用另一个命令的输出作为 awk 命令的输入来代替从一个文件中读取输入,这就像我们在上面看到的那样简单. + + +希望这些例子足够简单可以使你理解 awk 的用法,如果你有任何问题,你可以在下面的评论区提问,记得查看 awk 系列接下来的章节内容,我们将关注 awk 的一些功能,比如变量,数字表达式以及赋值运算符. +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/read-awk-input-from-stdin-in-linux/ + +作者:[Aaron Kili][a] +译者:[vim-kakali](https://github.com/vim-kakali) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.tecmint.com/author/aaronkili/ +[1]: http://www.tecmint.com/linux-dir-command-usage-with-examples/ +[2]: http://www.tecmint.com/15-basic-ls-command-examples-in-linux/ +[3]: http://www.tecmint.com/combine-multiple-expressions-in-awk +[4]: http://www.tecmint.com/comparison-operators-in-awk +[5]: http://www.tecmint.com/13-basic-cat-command-examples-in-linux/ + + + From b4bc04b6caa15c7a921d018dfb498698a30c1c9e Mon Sep 17 00:00:00 2001 From: Markgolzh Date: Fri, 1 Jul 2016 12:41:59 +0800 Subject: [PATCH 1050/1469] =?UTF-8?q?=E6=AD=A3=E5=9C=A8=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译中 --- .../tech/20160621 Flatpak brings standalone apps to Linux.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20160621 Flatpak brings standalone apps to Linux.md b/sources/tech/20160621 Flatpak brings standalone apps to Linux.md index 5441627710..c2c1b51e7b 100644 --- a/sources/tech/20160621 Flatpak brings standalone apps to Linux.md +++ b/sources/tech/20160621 Flatpak brings standalone apps to Linux.md @@ -1,3 +1,4 @@ +翻译中:by zky001 Flatpak brings standalone apps to Linux === @@ -19,7 +20,7 @@ If you are an application developer, the Flatpak website also contains some grea via: https://fedoramagazine.org/introducing-flatpak/ 作者:[Ryan Lerch][a] -译者:[译者ID](https://github.com/译者ID) +译者:[zky001](https://github.com/zky001) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 3b7b5a5758b05e2e64f5b87cce775f12b82bd148 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 2 Jul 2016 14:15:18 +0800 Subject: [PATCH 1051/1469] PUB:20160303 Top 5 open source command shells for Linux @mr-ping --- ... 5 open source command shells for Linux.md | 86 +++++++++++++++++++ ... 5 open source command shells for Linux.md | 86 ------------------- 2 files changed, 86 insertions(+), 86 deletions(-) create mode 100644 published/20160303 Top 5 open source command shells for Linux.md delete mode 100644 translated/tech/20160303 Top 5 open source command shells for Linux.md diff --git a/published/20160303 Top 5 open source command shells for Linux.md b/published/20160303 Top 5 open source command shells for Linux.md new file mode 100644 index 0000000000..ec6aa3517a --- /dev/null +++ b/published/20160303 Top 5 open source command shells for Linux.md @@ -0,0 +1,86 @@ +Linux 下五个顶级的开源命令行 Shell +=============================================== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/terminal_blue_smoke_command_line_0.jpg?itok=u2mRRqOa) + +这个世界上有两种 Linux 用户:敢于冒险的和态度谨慎的。 + +其中一类用户总是本能的去尝试任何能够戳中其痛点的新选择。他们尝试过不计其数的窗口管理器、系统发行版和几乎所有能找到的桌面插件。 + +另一类用户找到他们喜欢的东西后,会一直使用下去。他们往往喜欢所使用的系统发行版的默认配置。最先熟练掌握的文本编辑器会成为他们最钟爱的那一个。 + +作为一个使用桌面版和服务器版十五年之久的 Linux 用户,比起第一类来,我无疑属于第二类用户。我更倾向于使用现成的东西,如此一来,很多时候我就可以通过文档和示例方便地找到我所需要的使用案例。如果我决定选择使用非费标准的东西,这个切换过程一定会基于细致的研究,并且前提是来自好基友的大力推荐。 + +但这并不意味着我不喜欢尝试新事物并且查漏补失。所以最近一段时间,在我不假思索的使用了 bash shell 多年之后,决定尝试一下另外四个 shell 工具:ksh、tcsh、zsh 和 fish。这四个 shell 都可以通过我所用的 Fedora 系统的默认库轻松安装,并且他们可能已经内置在你所使用的系统发行版当中了。 + +这里对它们每个选择都稍作介绍,并且阐述下它适合做为你的下一个 Linux 命令行解释器的原因所在。 + +### bash + +首先,我们回顾一下最为熟悉的一个。 [GNU Bash][1],又名 Bourne Again Shell,它是我这些年使用过的众多 Linux 发行版的默认选择。它最初发布于 1989 年,并且轻松成长为 Linux 世界中使用最广泛的 shell,甚至常见于其他一些类 Unix 系统当中。 + +Bash 是一个广受赞誉的 shell,当你通过互联网寻找各种事情解决方法所需的文档时,总能够无一例外的发现这些文档都默认你使用的是 bash shell。但 bash 也有一些缺点存在,如果你写过 Bash 脚本就会发现我们写的代码总是得比真正所需要的多那么几行。这并不是说有什么事情是它做不到的,而是说它读写起来并不总是那么直观,至少是不够优雅。 + +如上所述,基于其巨大的安装量,并且考虑到各类专业和非专业系统管理员已经适应了它的使用方式和独特之处,至少在将来一段时间内,bash 或许会一直存在。 + +### ksh + +[KornShell][4],或许你对这个名字并不熟悉,但是你一定知道它的调用命令 ksh。这个替代性的 shell 于 80 年代起源于贝尔实验室,由 David Korn 所写。虽然最初是一个专有软件,但是后期版本是在 [Eclipse Public 许可][5]下发布的。 + +ksh 的拥趸们列出了他们觉得其优越的诸多理由,包括更好的循环语法,清晰的管道退出代码,处理重复命令和关联数组的更简单的方式。它能够模拟 vi 和 emacs 的许多行为,所以如果你是一个重度文本编辑器患者,它值得你一试。最后,我发现它虽然在高级脚本方面拥有不同的体验,但在基本输入方面与 bash 如出一辙。 + +### tcsh + +[tcsh][6] 衍生于 csh(Berkely Unix C shell),并且可以追溯到早期的 Unix 和计算机时代开始。 + +tcsh 最大的卖点在于它的脚本语言,对于熟悉 C 语言编程的人来说,看起来会非常亲切。tcsh 的脚本编写有人喜欢,有人憎恶。但是它也有其他的技术特色,包括可以为 aliases 添加参数,各种可能迎合你偏好的默认行为,包括 tab 自动完成和将 tab 完成的工作记录下来以备后查。 + +tcsh 以 [BSD 许可][7]发布。 + +### zsh + +[zsh][8] 是另外一个与 bash 和 ksh 有着相似之处的 shell。诞生于 90 年代初,zsh 支持众多有用的新技术,包括拼写纠正、主题化、可命名的目录快捷键,在多个终端中共享同一个命令历史信息和各种相对于原来的 bash 的轻微调整。 + +虽然部分需要遵照 GPL 许可,但 zsh 的代码和二进制文件可以在一个类似 MIT 许可证的许可下进行分发; 你可以在 [actual license][9] 中查看细节。 + +### fish + +之前我访问了 [fish][10] 的主页,当看到 “好了,这是一个为 90 后而生的命令行 shell” 这条略带调侃的介绍时(fish 完成于 2005 年),我就意识到我会爱上这个交互友好的 shell 的。 + +fish 的作者提供了若干切换过来的理由,这些理由有点小幽默并且能戳中笑点,不过还真是那么回事。这些特性包括自动建议(“注意, Netscape Navigator 4.0 来了”,LCTT 译注:NN4 是一个重要版本。),支持“惊人”的 256 色 VGA 调色,不过也有真正有用的特性,包括根据你机器上的 man 页面自动补全命令,清除脚本和基于 web 界面的配置方式。 + +fish 的许可主要基于 GPLv2,但有些部分是在其他许可下的。你可以查看资源库来了解[完整信息][11]。 + +*** + +如果你想要寻找关于每个选择确切不同之处的详尽纲要,[这个网站][12]应该可以帮到你。 + +我的立场到底是怎样的呢?好吧,最终我应该还是会重新投入 bash 的怀抱,因为对于大多数时间都在使用命令行交互的人来说,切换过程对于编写高级的脚本能带来的好处微乎其微,并且我已经习惯于使用 bash 了。 + +但是我很庆幸做出了敞开大门并且尝试新选择的决定。我知道门外还有许许多多其他的东西。你尝试过哪些 shell,更中意哪一个?请在评论里告诉我们。 + +--- + +via: https://opensource.com/business/16/3/top-linux-shells + +作者:[Jason Baker][a] +译者:[mr-ping](https://github.com/mr-ping) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/jason-baker + +[1]: https://www.gnu.org/software/bash/ +[2]: http://mywiki.wooledge.org/BashPitfalls +[3]: http://www.gnu.org/licenses/gpl.html +[4]: http://www.kornshell.org/ +[5]: https://www.eclipse.org/legal/epl-v10.html +[6]: http://www.tcsh.org/Welcome +[7]: https://en.wikipedia.org/wiki/BSD_licenses +[8]: http://www.zsh.org/ +[9]: https://sourceforge.net/p/zsh/code/ci/master/tree/LICENCE +[10]: https://fishshell.com/ +[11]: https://github.com/fish-shell/fish-shell/blob/master/COPYING +[12]: http://hyperpolyglot.org/unix-shells + diff --git a/translated/tech/20160303 Top 5 open source command shells for Linux.md b/translated/tech/20160303 Top 5 open source command shells for Linux.md deleted file mode 100644 index d40eb58b54..0000000000 --- a/translated/tech/20160303 Top 5 open source command shells for Linux.md +++ /dev/null @@ -1,86 +0,0 @@ -最牛的五个Linux开源command shell -=============================================== - -关键字: shell , Linux , bash , zsh , fish , ksh , tcsh , license - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/terminal_blue_smoke_command_line_0.jpg?itok=u2mRRqOa) - -这个世界上有两种Linux用户:敢于冒险的和态度谨慎的。 - -其中一类用户总是本能的去尝试任何能够戳中其痛点的新选择。他们尝试过不计其数的窗口管理器、系统发行版和几乎所有能找到的桌面插件。 - -另一类用户找到他们喜欢的东西后,会一直使用下去。他们往往喜欢所使用的系统发行版的默认选项。最先熟练掌握的文本编辑器会成为他们最钟爱的那一个。 - -作为一个使用桌面版和服务器版十五年之久的Linux用户,比起第一类来,我无疑属于第二类用户。我更倾向于使用现成的东西,如此一来,很多时候我就可以通过文档和示例方便地找到我所需要的使用案例。如果我决定选择使用非费标准的东西,这个切换过程一定会基于细致的研究,并且前提是来自挚友的大力推荐。 - -但这并不意味着我不喜欢尝试新事物并且查漏补失。所以最近一段时间,在我不假思索的使用了bash shell多年之后,决定尝试一下另外四个shell工具:ksh, tcsh, zsh, 和 fish. 这四个shell都可以通过我所以用的Fedora系统的默认库轻松安装,并且他们可能已经内置在你所使用的系统发行版当中了。 - -这里对每个选择都稍作介绍,并且阐述下它适合做为你的下一个Linux命令行解释器的原因所在。 - -### bash - -首先,我们回顾一下最为熟悉的一个。 [GNU Bash][1],又名 Bourne Again Shell,它是我这些年使用过的众多Linux发行版的默认选择。它最初发布于1989年,并且轻松成长为Linux世界中使用最广泛的shell,甚至常见于其他一些类Unix系统当中。 - -Bash是一个广受赞誉的shell,当你通过互联网寻找各种事情解决方法所需的文档时,总能够无一例外的发现这些文档都默认你使用的是bash shell。但Bash也有一些缺点存在,如果你写过Bash脚本就会发现我们写的代码总是得比真正所需要的多那么几行。这并不是说有什么事情是它做不到的,而是说它读写起来并不总是那么直观,至少是不够优雅。 - -如上所述,基于其巨大的安装量,并且考虑到各类专业和非专业系统管理员已经适应了它的使用方式和独特之处,至少在将来一段时间内,bash或许会一直存在。 - -### ksh - -[KornShell][4],或许你对这个名字并不熟悉,但是你一定知道它的调用命令 ksh。这个替代性的shell于80年代起源于贝尔实验室,由David Korn所写。虽然最初是一个专有软件,但是后期版本是在[Eclipse Public 许可][5]下发布的。 - -ksh的拥趸们列出了他们觉得其优越的诸多理由,包括更好的循环语法,清晰的管道退出代码,更简单的方式来处理重复命令和关联数组。它能够模拟vi和emacs的许多行为,所以如果你是一个重度文本编辑器患者,它值得你一试。最后,我发现它虽然在高级脚本方面拥有不同的体验,但在基本输入方面与bash如出一辙。 - -### tcsh - -[Tcsh][6]衍生于csh(Berkely Unix C shell),并且可以追溯到早期的Unix和计算本身。 - -Tcsh最大的卖点在于它的脚本语言,对于熟悉C语言编程的人来说,看起来会非常亲切。Tcsh的脚本编写有人喜欢,有人憎恶。但是它也有其他的技术特色,包括可以为aliases添加参数,各种可能迎合你偏好的默认行为,包括tab自动完成和将tab完成的工作记录下来以备后查。 - -你可以在[BSD 许可][7]下找到tcsh。 - -### zsh - -[Zsh][8]是另外一个与bash和ksh有着相似之处的shell。产生于90年代初,zsh支持众多有用的新技术,包括拼写纠正,主题化,可命名的目录快捷键,在多个终端中分享命令历史信息和各种相对于original Bourne shell的轻微调整。 - -虽然部分需要遵照GPL许可,但zsh的代码和二进制文件可以在MIT-like许可下进行分发; 你可以在 [actual license][9] 中查看细节。 - -### fish - -之前我访问了[fish][10]的主页,当看到 “好了,这是一个为90年代而生的命令行shell” 这条略带调侃的介绍时(fish完成于2005年),我就意识到我会爱上这个交互友好的shell的。 - -Fish的作者提供了若干切换过来的理由,shell中所有的不太实用的调用都有点小幽默并且能戳中笑点。这些特性包括自动建议("Watch out, Netscape Navigator 4.0"),支持“惊人”的256色VGA调色,不过也有真正有用的特性,包括根据机器的man页面自动补全命令,清除脚本和基于web的配置。 - -Fish的许可主要基于第二版GPL,但有些部分是在其他许可下的。你可以查看资源库来了解[完整信息][11] - -*** - -如果你想要寻找关于每个选择确切不同之处的详尽纲要,[这个网站][12]应该可以帮到你。 - -我的立场到底是怎样的呢?好吧,最终我应该还是会重新投入bash的怀抱,因为对于大多数时间都在使用命令行交互的人来说,切换过程对于高级脚本能带来的好处微乎其微,并且我已经习惯于使用bash了。 - -但是我很庆幸做出了敞开大门并且尝试新选择的决定。我知道门外还有许许多多其他的东西。你尝试过哪些shell,更中意哪一个?请在评论里告诉我们。 - -本文来源: https://opensource.com/business/16/3/top-linux-shells - -作者:[Jason Baker][a] -译者:[mr-ping](https://github.com/mr-ping) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/jason-baker - -[1]: https://www.gnu.org/software/bash/ -[2]: http://mywiki.wooledge.org/BashPitfalls -[3]: http://www.gnu.org/licenses/gpl.html -[4]: http://www.kornshell.org/ -[5]: https://www.eclipse.org/legal/epl-v10.html -[6]: http://www.tcsh.org/Welcome -[7]: https://en.wikipedia.org/wiki/BSD_licenses -[8]: http://www.zsh.org/ -[9]: https://sourceforge.net/p/zsh/code/ci/master/tree/LICENCE -[10]: https://fishshell.com/ -[11]: https://github.com/fish-shell/fish-shell/blob/master/COPYING -[12]: http://hyperpolyglot.org/unix-shells - From 3ceeaa9bcff79f20da48d20ca1605b07c7b47918 Mon Sep 17 00:00:00 2001 From: Louis Wei Date: Sat, 2 Jul 2016 04:21:55 -0500 Subject: [PATCH 1052/1469] translated by wi-cuckoo (#4131) * translated by wi-cuckoo * translated by wi-cuckoo --- ...o Write and Tune Shell Scripts – Part 2.md | 285 ------------------ ...o Write and Tune Shell Scripts – Part 2.md | 285 ++++++++++++++++++ 2 files changed, 285 insertions(+), 285 deletions(-) delete mode 100644 sources/tech/20160601 Learn Python Control Flow and Loops to Write and Tune Shell Scripts – Part 2.md create mode 100644 translated/tech/20160601 Learn Python Control Flow and Loops to Write and Tune Shell Scripts – Part 2.md diff --git a/sources/tech/20160601 Learn Python Control Flow and Loops to Write and Tune Shell Scripts – Part 2.md b/sources/tech/20160601 Learn Python Control Flow and Loops to Write and Tune Shell Scripts – Part 2.md deleted file mode 100644 index 6a65df8d49..0000000000 --- a/sources/tech/20160601 Learn Python Control Flow and Loops to Write and Tune Shell Scripts – Part 2.md +++ /dev/null @@ -1,285 +0,0 @@ -translating by wi-cuckoo -Learn Python Control Flow and Loops to Write and Tune Shell Scripts – Part 2 -=============================================================================== - -In the previous article of this [Python series][1] we shared a brief introduction to Python, its command-line shell, and the IDLE. We also demonstrated how to perform arithmetic calculations, how to store values in variables, and how to print back those values to the screen. Finally, we explained the concepts of methods and properties in the context of Object Oriented Programming through a practical example. - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Write-Shell-Scripts-in-Python-Programming.png) ->Write Linux Shell Scripts in Python Programming - -In this guide we will discuss control flow (to choose different courses of action depending on information entered by a user, the result of a calculation, or the current value of a variable) and loops (to automate repetitive tasks) and then apply what we have learned so far to write a simple shell script that will display the operating system type, the hostname, the kernel release, version, and the machine hardware name. - -This example, although basic, will help us illustrate how we can leverage Python OOP’s capabilities to write shell scripts easier than using regular bash tools. - -In other words, we want to go from - -``` -# uname -snrvm -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Check-Hostname-of-Linux.png) ->Check Hostname of Linux - -to - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Check-Linux-Hostname-Using-Python-Script.png) ->Check Linux Hostname Using Python Script - -or - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Script-to-Check-Linux-System-Information.png) ->Script to Check Linux System Information - -Looks pretty, doesn’t it? Let’s roll up our sleeves and make it happen. - -### Control flow in Python - -As we said earlier, control flow allows us to choose different outcomes depending on a given condition. Its most simple implementation in Python is an if / else clause. - -The basic syntax is: - -``` -if condition: - # action 1 -else: - # action 2 -``` - -When condition evaluates to true, the code block below will be executed (represented by `# action 1`. Otherwise, the code under else will be run. -A condition can be any statement that can evaluate to either true or false. - -For example: - -1. 1 < 3 # true - -2. firstName == “Gabriel” # true for me, false for anyone not named Gabriel - - - In the first example we compared two values to determine if one is greater than the other. - - In the second example we compared firstName (a variable) to determine if, at the current execution point, its value is identical to “Gabriel” - - The condition and the else statement must be followed by a colon (:) - - Indentation is important in Python. Lines with identical indentation are considered to be in the same code block. - -Please note that the if / else statement is only one of the many control flow tools available in Python. We reviewed it here since we will use it in our script later. You can learn more about the rest of the tools in the [official docs][2]. - -### Loops in Python - -Simply put, a loop is a sequence of instructions or statements that are executed in order as long as a condition is true, or once per item in a list. - -The most simple loop in Python is represented by the for loop iterates over the items of a given list or string beginning with the first item and ending with the last. - -Basic syntax: - -``` -for x in example: - # do this -``` - -Here example can be either a list or a string. If the former, the variable named x represents each item in the list; if the latter, x represents each character in the string: - -``` ->>> rockBands = [] ->>> rockBands.append("Roxette") ->>> rockBands.append("Guns N' Roses") ->>> rockBands.append("U2") ->>> for x in rockBands: - print(x) -or ->>> firstName = "Gabriel" ->>> for x in firstName: - print(x) -``` - -The output of the above examples is shown in the following image: - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Learn-Loops-in-Python.png) ->Learn Loops in Python - -### Python Modules - -For obvious reasons, there must be a way to save a sequence of Python instructions and statements in a file that can be invoked when it is needed. - -That is precisely what a module is. Particularly, the os module provides an interface to the underlying operating system and allows us to perform many of the operations we usually do in a command-line prompt. - -As such, it incorporates several methods and properties that can be called as we explained in the previous article. However, we need to import (or include) it in our environment using the import keyword: - -``` ->>> import os -``` - -Let’s print the current working directory: - -``` ->>> os.getcwd() -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Learn-Python-Modules.png) ->Learn Python Modules - -Let’s now put all of this together (along with the concepts discussed in the previous article) to write the desired script. - -### Python Script - -It is considered good practice to start a script with a statement that indicates the purpose of the script, the license terms under which it is released, and a revision history listing the changes that have been made. Although this is more of a personal preference, it adds a professional touch to our work. - -Here’s the script that produces the output we shown at the top of this article. It is heavily commented so that you can understand what’s happening. - -Take a few minutes to go through it before proceeding. Note how we use an if / else structure to determine whether the length of each field caption is greater than the value of the field itself. - -Based on the result, we use empty characters to fill in the space between a field caption and the next. Also, we use the right number of dashes as separator between the field caption and its value below. - -``` -#!/usr/bin/python3 -# Change the above line to #!/usr/bin/python if you don't have Python 3 installed - -# Script name: uname.py -# Purpose: Illustrate Python's OOP capabilities to write shell scripts more easily -# License: GPL v3 (http://www.gnu.org/licenses/gpl.html) - -# Copyright (C) 2016 Gabriel Alejandro Cánepa -# ​Facebook / Skype / G+ / Twitter / Github: gacanepa -# Email: gacanepa (at) gmail (dot) com - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# REVISION HISTORY -# DATE VERSION AUTHOR CHANGE DESCRIPTION -# ---------- ------- -------------- -# 2016-05-28 1.0 Gabriel Cánepa Initial version - -# Import the os module -import os - -# Assign the output of os.uname() to the the systemInfo variable -# os.uname() returns a 5-string tuple (sysname, nodename, release, version, machine) -# Documentation: https://docs.python.org/3.2/library/os.html#module-os -systemInfo = os.uname() - -# This is a fixed array with the desired captions in the script output -headers = ["Operating system","Hostname","Release","Version","Machine"] - -# Initial value of the index variable. It is used to define the -# index of both systemInfo and headers in each step of the iteration. -index = 0 - -# Initial value of the caption variable. -caption = "" - -# Initial value of the values variable -values = "" - -# Initial value of the separators variable -separators = "" - -# Start of the loop -for item in systemInfo: - if len(item) < len(headers[index]): - # A string containing dashes to the length of item[index] or headers[index] - # To repeat a character(s), enclose it within quotes followed - # by the star sign (*) and the desired number of times. - separators = separators + "-" * len(headers[index]) + " " - caption = caption + headers[index] + " " - values = values + systemInfo[index] + " " * (len(headers[index]) - len(item)) + " " - else: - separators = separators + "-" * len(item) + " " - caption = caption + headers[index] + " " * (len(item) - len(headers[index]) + 1) - values = values + item + " " - # Increment the value of index by 1 - index = index + 1 -# End of the loop - -# Print the variable named caption converted to uppercase -print(caption.upper()) - -# Print separators -print(separators) - -# Print values (items in systemInfo) -print(values) - -# INSTRUCTIONS: -# 1) Save the script as uname.py (or another name of your choosing) and give it execute permissions: -# chmod +x uname.py -# 2) Execute it: -# ./uname.py -``` - -Once you have saved the above script to a file, give it execute permissions and run it as indicated at the bottom of the code: - -``` -# chmod +x uname.py -# ./uname.py -``` - -If you get the following error while attempting to execute the script: - -``` --bash: ./uname.py: /usr/bin/python3: bad interpreter: No such file or directory -``` - -It means you don’t have Python 3 installed. If that is the case, you can either install the package or replace the interpreter line (pay special attention and be very careful if you followed the steps to update the symbolic links to the Python binaries as outlined in the previous article): - -``` -#!/usr/bin/python3 -``` - -with - -``` -#!/usr/bin/python -``` - -which will cause the installed version of Python 2 to execute the script instead. - -**Note**: This script has been tested successfully both in Python 2.x and 3.x. - -Although somewhat rudimentary, you can think of this script as a Python module. This means that you can open it in the IDLE (File → Open… → Select file): - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Open-Python-in-IDLE.png) ->Open Python in IDLE - -A new window will open with the contents of the file. Then go to Run → Run module (or just press F5). The output of the script will be shown in the original shell: - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Run-Python-Script.png) ->Run Python Script - -If you want to obtain the same results with a script written purely in Bash, you would need to use a combination of [awk][3], [sed][4], and resort to complex methods to store and retrieve items in a list (not to mention the use of tr to convert lowercase letters to uppercase). - -In addition, Python provides portability in that all Linux systems ship with at least one Python version (either 2.x or 3.x, sometimes both). Should you need to rely on a shell to accomplish the same goal, you would need to write different versions of the script based on the shell. - -This goes to show that Object Oriented Programming features can become strong allies of system administrators. - -**Note**: You can find [this python script][5] (and others) in one of my GitHub repositories. - -### Summary - -In this article we have reviewed the concepts of control flow, loops / iteration, and modules in Python. We have shown how to leverage OOP methods and properties in Python to simplify otherwise complex shell scripts. - -Do you have any other ideas you would like to test? Go ahead and write your own Python scripts and let us know if you have any questions. Don’t hesitate to drop us a line using the comment form below, and we will get back to you as soon as we can. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/learn-python-programming-to-write-linux-shell-scripts/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tecmint+%28Tecmint%3A+Linux+Howto%27s+Guide%29 - -作者:[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/learn-python-programming-and-scripting-in-linux/ -[2]: http://please%20note%20that%20the%20if%20/%20else%20statement%20is%20only%20one%20of%20the%20many%20control%20flow%20tools%20available%20in%20Python.%20We%20reviewed%20it%20here%20since%20we%20will%20use%20it%20in%20our%20script%20later.%20You%20can%20learn%20more%20about%20the%20rest%20of%20the%20tools%20in%20the%20official%20docs. -[3]: http://www.tecmint.com/use-linux-awk-command-to-filter-text-string-in-files/ -[4]: http://www.tecmint.com/sed-command-to-create-edit-and-manipulate-files-in-linux/ -[5]: https://github.com/gacanepa/scripts/blob/master/python/uname.py diff --git a/translated/tech/20160601 Learn Python Control Flow and Loops to Write and Tune Shell Scripts – Part 2.md b/translated/tech/20160601 Learn Python Control Flow and Loops to Write and Tune Shell Scripts – Part 2.md new file mode 100644 index 0000000000..d7b6bf6c2e --- /dev/null +++ b/translated/tech/20160601 Learn Python Control Flow and Loops to Write and Tune Shell Scripts – Part 2.md @@ -0,0 +1,285 @@ +学习使用 python 控制流和循环来编写和执行 Shell 脚本 —— Part 2 +====================================================================================== + +在[Python series][1]之前的文章里,我们分享了 Python的一个简介,它的命令行 shell 和 IDLE(译者注:python 自带的一个IDE)。我们也演示了如何进行数值运算,如何用变量存储值,还有如何打印那些值到屏幕上。最后,我们通过一个练习示例讲解了面向对象编程中方法和属性概念。 + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Write-Shell-Scripts-in-Python-Programming.png) +>在 Python 编程中写 Linux Shell 脚本 + +本篇中,我嫩会讨论控制流(根据用户输入的信息,计算的结果,或者一个变量的当前值选择不同的动作行为)和循环(自动重复执行任务),接着应用到我们目前所学东西中,编写一个简单的 shell 脚本,这个脚本会显示操作系统类型,主机名,内核发行版,版本号和机器硬件名字。 + +这个例子尽管很基础,但是会帮助我们证明,比起使用一些 bash 工具写 shell 脚本,我们可以使得用 Python OOP 的兼容特性来编写 shell 脚本会更简单些。 + +换句话说,我们想从这里出发 + +``` +# uname -snrvm +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Check-Hostname-of-Linux.png) +> 检查 Linux 的主机号 + +到 + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Check-Linux-Hostname-Using-Python-Script.png) +> 用 Python 脚本来检查 Linux 的主机号 + +或者 + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Script-to-Check-Linux-System-Information.png) +> 用脚本检查 Linux 系统信息 + +看着不错,不是吗?那我们就挽起袖子,开干吧。 + +### Python 中的控制流 + +如我们刚说那样,控制流允许我们根据一个给定的条件,选择不同的输出结果。在 Python 中最简单的实现就是一个 if/else 语句。 + +基本语法是这样的: + +``` +if condition: + # action 1 +else: + # action 2 +``` + +当 condition 求值为真(true),下面的代码块就会被执行(`# action 1`代表的部分)。否则,else 下面的代码就会运行。 +condition 可以是任何表达式,只要可以求得值为真或者假。 + +举个例子: + +1. 1 < 3 # 真 + +2. firstName == "Gabriel" # 对 firstName 为 Gabriel 的人是真,对其他不叫 Gabriel 的人为假 + + - 在第一个例子中,我们比较了两个值,判断 1 是否小于 3。 + - 在第二个例子中,我们比较了 firstName(一个变量)与字符串 “Gabriel”,看在当前执行的位置,firstName 的值是否等于该字符串。 + - 条件和 else 表达式都必须带着一个冒号(:)。 + - 缩进在 Python 非常重要。同样缩进下的行被认为是相同的代码块。 + +请注意,if/else 表达式只是 Python 中许多控制流工具的一个而已。我们先在这里了解以下,后面会用在我们的脚本中。你可以在[官方文档][2]中学到更多工具。 + +### Python 中的循环 + +简单来说,一个循环就是一组指令或者表达式序列,可以按顺序一直执行,只要一个条件为真,或者在一个列表里一次执行一个条目。 + +Python 中最简单的循环,就是 for 循环迭代一个给定列表的元素,或者一个字符串从第一个字符开始到最后一个字符结束。 + +基本语句: + +``` +for x in example: + # do this +``` + +这里的 example 可以是一个列表或者一个字符串。如果是列表,变量 x 就代表列表中每个元素;如果是字符串,x 就代表字符串中每个字符。 + +``` +>>> rockBands = [] +>>> rockBands.append("Roxette") +>>> rockBands.append("Guns N' Roses") +>>> rockBands.append("U2") +>>> for x in rockBands: + print(x) +or +>>> firstName = "Gabriel" +>>> for x in firstName: + print(x) +``` + +上面例子的输出如下图所示: + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Learn-Loops-in-Python.png) +>学习 Python 中的循环 + +### Python 模块 + +很明显,必须有个途径可以保存一系列的 Python 指令和表达式到文件里,然后需要的时候再取出来。 + +准确来说模块就是这样的。特别地,os 模块提供了一个接口到操作系统的底层,允许我们做许多通常在命令行下的操作。 + +没错,os 模块包含了许多方法和属性,可以用来调用,就如我们之前文章里讲解的那样。尽管如此,我们需要使用 import 关键词导入(或者叫包含)模块到开发环境里来: + +``` +>>> import os +``` + +我们来打印出当前的工作目录: + +``` +>>> os.getcwd() +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Learn-Python-Modules.png) +>学习 Python 模块 + +现在,让我们把所有结合在一起(包括之前文章里讨论的概念),编写需要的脚本。 + +### Python 脚本 + +以一个声明开始一个脚本是个不错的想法,表明脚本的目的,发行所依据的证书,和一个修订历史列出所做的修改。尽管这主要是个人喜好,但这会让我们的工作看起来比较专业。 + +这里有个脚本,可以输出这篇文章最前面展示的那样。脚本做了大量的注释,为了让大家可以理解发生了什么。 + +在进行下一步之前,花点时间来理解它。注意,我们是如何使用一个 if/else 结构,判断每个字段标题的长度是否比字段本身的值还大。 + +基于这个结果,我们用空字符去填充一个字段标题和下一个之间的空格。同时,我们使用一定数量的短线作为字段标题与其值之间的分割符。 + +``` +#!/usr/bin/python3 +# Change the above line to #!/usr/bin/python if you don't have Python 3 installed + +# Script name: uname.py +# Purpose: Illustrate Python's OOP capabilities to write shell scripts more easily +# License: GPL v3 (http://www.gnu.org/licenses/gpl.html) + +# Copyright (C) 2016 Gabriel Alejandro Cánepa +# ​Facebook / Skype / G+ / Twitter / Github: gacanepa +# Email: gacanepa (at) gmail (dot) com + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# REVISION HISTORY +# DATE VERSION AUTHOR CHANGE DESCRIPTION +# ---------- ------- -------------- +# 2016-05-28 1.0 Gabriel Cánepa Initial version + +# Import the os module +import os + +# Assign the output of os.uname() to the the systemInfo variable +# os.uname() returns a 5-string tuple (sysname, nodename, release, version, machine) +# Documentation: https://docs.python.org/3.2/library/os.html#module-os +systemInfo = os.uname() + +# This is a fixed array with the desired captions in the script output +headers = ["Operating system","Hostname","Release","Version","Machine"] + +# Initial value of the index variable. It is used to define the +# index of both systemInfo and headers in each step of the iteration. +index = 0 + +# Initial value of the caption variable. +caption = "" + +# Initial value of the values variable +values = "" + +# Initial value of the separators variable +separators = "" + +# Start of the loop +for item in systemInfo: + if len(item) < len(headers[index]): + # A string containing dashes to the length of item[index] or headers[index] + # To repeat a character(s), enclose it within quotes followed + # by the star sign (*) and the desired number of times. + separators = separators + "-" * len(headers[index]) + " " + caption = caption + headers[index] + " " + values = values + systemInfo[index] + " " * (len(headers[index]) - len(item)) + " " + else: + separators = separators + "-" * len(item) + " " + caption = caption + headers[index] + " " * (len(item) - len(headers[index]) + 1) + values = values + item + " " + # Increment the value of index by 1 + index = index + 1 +# End of the loop + +# Print the variable named caption converted to uppercase +print(caption.upper()) + +# Print separators +print(separators) + +# Print values (items in systemInfo) +print(values) + +# INSTRUCTIONS: +# 1) Save the script as uname.py (or another name of your choosing) and give it execute permissions: +# chmod +x uname.py +# 2) Execute it: +# ./uname.py +``` + +如果你已经保存上面的脚本到一个文件里,给文件执行权限,并且运行它,像代码底部描述的那样: + +``` +# chmod +x uname.py +# ./uname.py +``` + +如果试图运行脚本时,你得到了如下的错误: + +``` +-bash: ./uname.py: /usr/bin/python3: bad interpreter: No such file or directory +``` + +这意味着你没有安装 Python3。如果那样的话,你要么安装 Python3 的包,要么替换解释器那行(如果你跟着下面的步骤去更新 Python 执行文件的软连接,如之前文章里概述的那样,要特别注意并且非常小心): + +``` +#!/usr/bin/python3 +``` + +为 + +``` +#!/usr/bin/python +``` + +这样会导致使用安装好的 Python 2 版本去执行该脚本。 + +**注意**: 该脚本在 Python 2.x 与 Pyton 3.x 上都测试成功过了。 + +尽管比较粗糙,你可以认为该脚本就是一个 Python 模块。这意味着你可以在 IDLE 中打开它(File → Open… → Select file): + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Open-Python-in-IDLE.png) +>在 IDLE 中打开 Python + +一个包含有文件内容的新窗口就会打开。然后执行 Run → Run module(或者按 F5)。脚本的输出就会在原 Shell 里显示出来: + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Run-Python-Script.png) +>执行 Python 脚本 + +如果你想纯粹用 bash 写一个脚本,也获得同样的结果,你可能需要结合使用 [awk][3],[sed][4],并且借助复杂的方法来存储与获得列表中的元素(忘了提醒使用 tr 命令将小写字母转为大写) + +另外,Python 在所有的 Linux 系统版本中集成了至少一个 Python 版本(2.x 或者 3.x,或者两者都有)。你还需要依赖 shell 去完成同样的目标吗,那样你可能会为不同的 shell 编写不同的版本。 + +这里演示了面向对象编程的特性,会成为一个系统管理员得力的助手。 + +**注意**:你可以在我的 Github 仓库里获得 [这个 python 脚本][5](或者其他的)。 + +### 总结 + +这篇文章里,我们讲解了 Python 中控制流,循环/迭代,和模块的概念。我们也演示了如何利用 Python 中 OOP 的方法和属性,来简化复杂的 shell 脚本。 + +你有任何其他希望去验证的想法吗?开始吧,写出自己的 Python 脚本,如果有任何问题可以咨询我们。不必犹豫,在分割线下面留下评论,我们会尽快回复你。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/learn-python-programming-to-write-linux-shell-scripts/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tecmint+%28Tecmint%3A+Linux+Howto%27s+Guide%29 + +作者:[Gabriel Cánepa][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/gacanepa/ +[1]: http://www.tecmint.com/learn-python-programming-and-scripting-in-linux/ +[2]: http://please%20note%20that%20the%20if%20/%20else%20statement%20is%20only%20one%20of%20the%20many%20control%20flow%20tools%20available%20in%20Python.%20We%20reviewed%20it%20here%20since%20we%20will%20use%20it%20in%20our%20script%20later.%20You%20can%20learn%20more%20about%20the%20rest%20of%20the%20tools%20in%20the%20official%20docs. +[3]: http://www.tecmint.com/use-linux-awk-command-to-filter-text-string-in-files/ +[4]: http://www.tecmint.com/sed-command-to-create-edit-and-manipulate-files-in-linux/ +[5]: https://github.com/gacanepa/scripts/blob/master/python/uname.py + From dc6ee9092447215559f875a3a2b872933601d082 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 3 Jul 2016 10:44:46 +0800 Subject: [PATCH 1053/1469] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rename for windows --- ...20160621 Container technologies in Fedora - systemd-nspawn.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/tech/{20160621 Container technologies in Fedora: systemd-nspawn.md => 20160621 Container technologies in Fedora - systemd-nspawn.md} (100%) diff --git a/sources/tech/20160621 Container technologies in Fedora: systemd-nspawn.md b/sources/tech/20160621 Container technologies in Fedora - systemd-nspawn.md similarity index 100% rename from sources/tech/20160621 Container technologies in Fedora: systemd-nspawn.md rename to sources/tech/20160621 Container technologies in Fedora - systemd-nspawn.md From 00d5430e9f33cf89bd71d24e4d1bd4de1acb0671 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Sun, 3 Jul 2016 14:19:32 +0800 Subject: [PATCH 1054/1469] Translated translated/tech/20160425 How to Use Awk to Print Fields and Columns in File.md --- ...Awk to Print Fields and Columns in File.md | 54 +++++++++---------- 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/translated/tech/20160425 How to Use Awk to Print Fields and Columns in File.md b/translated/tech/20160425 How to Use Awk to Print Fields and Columns in File.md index 127cc061c1..94b914cd3d 100644 --- a/translated/tech/20160425 How to Use Awk to Print Fields and Columns in File.md +++ b/translated/tech/20160425 How to Use Awk to Print Fields and Columns in File.md @@ -1,21 +1,20 @@ -ictlyh Translating -How to Use Awk to Print Fields and Columns in File +如何使用 Awk 打印文件中的字段和列 =================================================== -In this part of our [Linux Awk command series][1], we shall have a look at one of the most important features of Awk, which is field editing. +在 [Linux Awk 命令系列介绍][1] 的这部分,我们来看一下 awk 最重要的功能之一,字段编辑。 -It is good to know that Awk automatically divides input lines provided to it into fields, and a field can be defined as a set of characters that are separated from other fields by an internal field separator. +首先我们要知道 Awk 会自动把输入的行切分为字段,字段可以定义为是一些字符集,这些字符集和其它字段被内部字段分隔符分离。 ![](http://www.tecmint.com/wp-content/uploads/2016/04/Awk-Print-Fields-and-Columns.png) ->Awk Print Fields and Columns +>Awk 输出字段和列 -If you are familiar with the Unix/Linux or do [bash shell programming][2], then you should know what internal field separator (IFS) variable is. The default IFS in Awk are tab and space. +如果你熟悉 Unix/Linux 或者懂得 [bash shell 编程][2],那么你也应该知道内部字段分隔符(IFS)变量。Awk 默认的 IFS 是 tab 和空格。 -This is how the idea of field separation works in Awk: when it encounters an input line, according to the IFS defined, the first set of characters is field one, which is accessed using $1, the second set of characters is field two, which is accessed using $2, the third set of characters is field three, which is accessed using $3 and so forth till the last set of character(s). +Awk 字段切分的工作原理如下:当获得一行输入时,根据定义的 IFS,第一个字符集是字段一,用 $1 表示,第二个字符集是字段二,用 $2 表示,第三个字符集是字段三,用 $3 表示,以此类推直到最后一个字符集。 -To understand this Awk field editing better, let us take a look at the examples below: +为了更好的理解 Awk 的字段编辑,让我们来看看下面的例子: -**Example 1**: I have created a text file called tecmintinfo.txt. +**事例 1:**: 我创建了一个名为 tecmintinfo.txt 的文件。 ``` # vi tecmintinfo.txt @@ -23,24 +22,23 @@ To understand this Awk field editing better, let us take a look at the examples ``` ![](http://www.tecmint.com/wp-content/uploads/2016/04/Create-File-in-Linux.png) ->Create File in Linux +>在 Linux 中创建文件 -Then from the command line, I try to print the first, second and third fields from the file tecmintinfo.txt using the command below: +然后在命令行中使用以下命令打印 tecmintinfo.txt 文件中的第一、第二和第三个字段。 ``` $ awk '//{print $1 $2 $3 }' tecmintinfo.txt TecMint.comisthe ``` +从上面的输出中你可以看到,三个字段中的第一个是按照定义的 IFS,也就是空格,打印的。 -From the output above, you can see that the characters from the first three fields are printed based on the IFS defined which is space: +- 字段一 “TecMint.com” 使用 $1 访问。 +- 字段二 “is” 通过 $2 访问。 +- 字段三 “the” 通过 $3 访问。 -- Field one which is “TecMint.com” is accessed using $1. -- Field two which is “is” is accessed using $2. -- Field three which is “the” is accessed using $3. +如果你注意打印的输出,可以看到字段值之间并没有分隔开,这是 print 默认的方式。 -If you have noticed in the printed output, the field values are not separated and this is how print behaves by default. - -To view the output clearly with space between the field values, you need to add (,) operator as follows: +为了在字段值之间加入空格,你需要像下面这样添加(,)分隔符: ``` $ awk '//{print $1, $2, $3; }' tecmintinfo.txt @@ -48,11 +46,11 @@ $ awk '//{print $1, $2, $3; }' tecmintinfo.txt TecMint.com is the ``` -One important thing to note and always remember is that the use of ($) in Awk is different from its use in shell scripting. +很重要而且必须牢记的一点是,Awk 中 ($) 的使用和在 shell 脚本中不一样。 -Under shell scripting ($) is used to access the value of variables while in Awk ($) it is used only when accessing the contents of a field but not for accessing the value of variables. +在 shell 脚本中 ($) 用于获取变量的值,而在 Awk 中 ($) 只用于获取一个字段的内容,而不能用于获取变量的值。 -**Example 2**: Let us take a look at one other example using a file which contains multiple lines called my_shoping.list. +**事例2**: 让我们再看一个使用多行文件 my_shoping.list 的例子。 ``` No Item_Name Unit_Price Quantity Price @@ -62,7 +60,7 @@ No Item_Name Unit_Price Quantity Price 4 Ethernet_Cables #30,000 4 #120,000 ``` -Say you wanted to only print Unit_Price of each item on the shopping list, you will need to run the command below: +假设你只想打印购物清单中每个物品的 Unit_Price,你需要允许下面的命令: ``` $ awk '//{print $2, $3 }' my_shopping.txt @@ -74,9 +72,9 @@ RAM_Chips #150,000 Ethernet_Cables #30,000 ``` -Awk also has a printf command that helps you to format your output is a nice way as you can see the above output is not clear enough. +Awk 也有一个 printf 命令,它能帮助你用更好的方式格式化输出,正如你可以看到上面的输出并不清晰。 -Using printf to format output of the Item_Name and Unit_Price: +使用 printf 格式化输出 Item_Name 和 Unit_Price: ``` $ awk '//{printf "%-10s %s\n",$2, $3 }' my_shopping.txt @@ -88,18 +86,18 @@ RAM_Chips #150,000 Ethernet_Cables #30,000 ``` -### Summary +### 总结 -Field editing is very important when using Awk to filter text or strings, it helps you get particular data in columns in a list. And always remember that the use of ($) operator in Awk is different from that in shell scripting. +使用 Awk 进行文本和字符串过滤时字段编辑功能非常重要,它能帮助你从列表中获取列的特定数据。同时需要记住 Awk 中 ($) 操作符和 shell 脚本中不一样。 -I hope the article was helpful to you and for any additional information required or questions, you can post a comment in the comment section. +我希望这篇文章能对你有所帮助,如果你需要获取其它信息或者有任何疑问,都可以在下面的评论框中告诉我们。 -------------------------------------------------------------------------------- via: http://www.tecmint.com/awk-print-fields-columns-with-space-separator/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tecmint+%28Tecmint%3A+Linux+Howto%27s+Guide%29 作者:[Aaron Kili][a] -译者:[译者ID](https://github.com/译者ID) +译者:[ictlyh](https://github.com/ictlyh) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From aeebb76494651b04e75d8f325873d2ed17949ba8 Mon Sep 17 00:00:00 2001 From: pspkforever Date: Sun, 3 Jul 2016 20:52:08 +0800 Subject: [PATCH 1055/1469] Update 20160621 Docker Datacenter in AWS and Azure in Few Clicks.md --- ...0160621 Docker Datacenter in AWS and Azure in Few Clicks.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20160621 Docker Datacenter in AWS and Azure in Few Clicks.md b/sources/tech/20160621 Docker Datacenter in AWS and Azure in Few Clicks.md index aa4a317103..d9431155ff 100644 --- a/sources/tech/20160621 Docker Datacenter in AWS and Azure in Few Clicks.md +++ b/sources/tech/20160621 Docker Datacenter in AWS and Azure in Few Clicks.md @@ -1,5 +1,6 @@ +translated by pspkforever DOCKER DATACENTER IN AWS AND AZURE IN A FEW CLICKS -==================================================== +=================================================== Introducing Docker Datacenter AWS Quickstart and Azure Marketplace Templates production-ready, high availability deployments in just a few clicks. From 2a1976bbaffed5e9a4b5c13d501d3a54b3fec30f Mon Sep 17 00:00:00 2001 From: chenxinlong <237448382@qq.com> Date: Sun, 3 Jul 2016 21:01:54 +0800 Subject: [PATCH 1056/1469] =?UTF-8?q?[=E7=BF=BB=E8=AF=91=E4=B8=AD]20160624?= =?UTF-8?q?=20IT=20runs=20on=20the=20cloud=20and=20the=20cloud=20runs=20on?= =?UTF-8?q?=20Linux.Any=20questions=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... on the cloud and the cloud runs on Linux. Any questions.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/talk/20160624 IT runs on the cloud and the cloud runs on Linux. Any questions.md b/sources/talk/20160624 IT runs on the cloud and the cloud runs on Linux. Any questions.md index 2a575c1a31..94f0a8af2f 100644 --- a/sources/talk/20160624 IT runs on the cloud and the cloud runs on Linux. Any questions.md +++ b/sources/talk/20160624 IT runs on the cloud and the cloud runs on Linux. Any questions.md @@ -1,3 +1,4 @@ +chenxinlong translating IT runs on the cloud, and the cloud runs on Linux. Any questions? =================================================================== @@ -37,7 +38,7 @@ So, just as the vast majority of Android phone and Chromebook users have no clue via: http://www.zdnet.com/article/it-runs-on-the-cloud-and-the-cloud-runs-on-linux-any-questions/#ftag=RSSbaffb68 作者:[Steven J. Vaughan-Nichols][a] -译者:[译者ID](https://github.com/译者ID) +译者:[chenxinlong](https://github.com/chenxinlong) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9fe021efe27c6148ff98b52ef20c1561d9b0f83f Mon Sep 17 00:00:00 2001 From: crazyLinuxer <958983476@qq.com> Date: Sun, 3 Jul 2016 21:32:46 +0800 Subject: [PATCH 1057/1469] finish translating by kylepeng93 (#4135) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add files via upload * Delete 给学习OpenStack基础设施的新手的入门指南.md * Delete 20160416 A newcomer's guide to navigating OpenStack Infrastructure.md * Add files via upload * Delete 给学习OpenStack基础设施的新手的入门指南.md * translated by kylepeng93 --- ... to navigating OpenStack Infrastructure.md | 88 ------------------- ... to navigating OpenStack Infrastructure.md | 65 ++++++++++++++ 2 files changed, 65 insertions(+), 88 deletions(-) delete mode 100644 sources/tech/20160416 A newcomer's guide to navigating OpenStack Infrastructure.md create mode 100644 translated/tech/A newcomer's guide to navigating OpenStack Infrastructure.md diff --git a/sources/tech/20160416 A newcomer's guide to navigating OpenStack Infrastructure.md b/sources/tech/20160416 A newcomer's guide to navigating OpenStack Infrastructure.md deleted file mode 100644 index 25dc193fdc..0000000000 --- a/sources/tech/20160416 A newcomer's guide to navigating OpenStack Infrastructure.md +++ /dev/null @@ -1,88 +0,0 @@ -translating by kylepeng93 -A newcomer's guide to navigating OpenStack Infrastructure -=========================================================== - -New contributors to OpenStack are welcome, but having a road map for navigating within this maturing, fast-paced open source community doesn't hurt. At OpenStack Summit in Austin, [Paul Belanger][1] (Red Hat, Inc.), [Elizabeth K. Joseph][2] (HPE), and [Christopher Aedo][3] (IBM) will lead a session on [OpenStack Infrastructure for Beginners][4]. In this interview, they offer tips and resources to help onboard new OpenStack contributors. - -![](https://opensource.com/sites/default/files/images/life/Interview%20banner%20Q%26A.png) - -**Your talk description says you'll be "diving into the heart of infrastructure and explain everything you need to know about the systems that keep OpenStack working." That's a tall order for a 40-minute time slot. What are the top things beginners should know about OpenStack infrastructure?** - -**Elizabeth K. Joseph (EKJ)**: We don't use GitHub for OpenStack patches. This is something that trips up a lot of new contributors because we do maintain mirrors of all our repositories on GitHub for historical reasons. Instead we use a fully open source code review and continuous integration (CI) system maintained by the OpenStack Infrastructure team. Relatedly, since we run a CI system, every change proposed to OpenStack is tested before merging. - -**Paul Belanger (PB)**: A lot of passionate people in the project, so don't get discouraged if your patch gets a -1. - -**Christopher Aedo (CA)**: The community wants to help you succeed, don't be afraid to ask questions or ask for pointers to more information to improve your understanding. - -### Which online resources would you recommend for beginners to fill in the holes for what you can't cover in your talk? - -**PB**: Definitely our [OpenStack Project Infrastructure documentation][5]. At lot of effort has been taken to keep it up to date as much as possible. Every system used in running OpenStack as a project has a dedicated page, even the OpenStack cloud the Infrastructure teams is bringing online. - -**EKJ**: I'll echo what Paul said about the Infrastructure documentation, and add that we love seeing patches from folks who are learning. We often don't realize what we're missing in terms of documentation until someone asks. So read, learn, and then help us fill in the gaps. You can ask questions on the [openstack-infra mailing list][6] or in our IRC channel at #openstack-infra on Freenode. - -**CA**: I love [this detailed post][7] about building images, by Ian Wienand. - -### Which "gotchas" should new OpenStack contributors look out for? - -**EKJ**: Contributing is not just about submitting new code and new features; the OpenStack community places a very high value on doing code reviews. If you want people to look at a patch you submitted, consider reviewing some of the work of others and providing clear and constructive feedback. The more your fellow contributors know about your work and see you doing reviews, the more likely you'll get your code reviewed in a timely manner. - -**CA**: I see a lot of newcomers getting tripped up with [Gerrit][8]. Read through the [developer workflow][9] in the Developers Guide, and then maybe read through it one more time. If you're not used to Gerrit, it can seem confusing and overwhelming at first, but walking through a few code reviews usually makes it all come together. Also, I'm a big fan of IRC. It can be a great place to get help, but it's best if you can maintain a persistent presence so people can answer your questions even if you're not "there" at that particular moment. (Read [IRC, the secret to success in open source][10].) You don't need to be "always on," but the ability to easily scroll back in a channel and catch up on a conversation can be invaluable. - -**PB**: I agree with both Elizabeth and Chris—Gerrit is what to look out for. It is going to be the hub of your development effort. Not only will you be submitting code for people to review, but you'll also be reviewing other contributors' code. Watch out for the Gerrit UI; it can be confusing at times. I'd recommend trying out [Gertty][11], which is a console-based interface to the Gerrit Code Review system, which happens to be a project driven by OpenStack Infrastructure. - -### What resources do you recommend for beginners to help them network with other OpenStack contributors? - -**PB**: For me, it was using IRC and joining the #openstack-infra channel on Freenode ([IRC logs][12]). There is a lot of fantastic information and people in that channel. You get to see the day-to-day operations of the OpenStack project, and once you know how the project works, you'll have a better understanding on how to contribute to its future. - -**CA**: I want to second that note for IRC; staying on IRC throughout the day made a huge difference for me in terms of feeling informed and connected. It's also such a great way to get help when you're stuck with someone on one of the projects—the ones with active IRC channels always have someone around willing to get your issues sorted out. - -**EKJ**: The [openstack-dev mailing list][13] is quite important for staying up to date with news about projects you're working on inside of OpenStack, so I recommend subscribing to that. The mailing list uses subject tags to separate projects, so you can instruct your email client to use those and focus on threads that impact projects you care about. Beyond online resources, many OpenStack groups have popped up all over the world that serve the needs of both users and contributors to OpenStack, and many of them routinely have talks and events with key OpenStack contributors. You can search on Meetup.com in your area, or search on [groups.openstack.org][14] to see if there is an OpenStack group in your area. Finally, there are the [OpenStack Summits][15], which happen every six months, and where we'll be giving our Infrastructure talk. In their current format, the summits consist of both a user conference and a developer conference in one space to talk about everything related to OpenStack, past, present, and future. - -### In which areas does OpenStack need to improve to become more beginner-friendly? - -**PB**: I think our [account-setup][16] process could be made easier for new contributors, especially how many steps are needed to submit your first patch. There is a large cost to enroll into OpenStack development model, which maybe be too much for contributors; however, once enrolled, the model works fantastic for developers. - -**CA**: We have a very pro-developer community, but the focus is on developing OpenStack itself, with less consideration given to the users of OpenStack clouds. We need to bring in application developers and encourage more people to develop things that run beautifully on OpenStack clouds, and encourage them to share those apps in the [Community App Catalog][17]. We can do this by continuing to improve our API standards and by ensuring different libraries (like libcloud, phpopencloud, and others) continue to work reliably for developers. Oh, also by sponsoring more OpenStack hackathons! All these things can ease entry for newcomers, which will lead to them sticking around. - -**EKJ**: I've worked on open source software for many years, but for a large number of OpenStack developers, this is the first open source project they've every worked on. I've found that their proprietary software background doesn't prepare them for the open source ideals, methodologies, and collaboration techniques used in an open source project. I'd love to see us do a better job of welcoming people who have this proprietary software background and working with them so they can truly understand the value of what they're working on in the open source software community. - -### I think 2016 is shaping up to be the Year of the Open Source Haiku. Explain OpenStack to beginners via Haiku. - -**PB**: OpenStack runs clouds If you enjoy free software Submit your first patch - -**CA**: In the near future OpenStack will rule the world Help make it happen! - -**EKJ**: OpenStack is free Deploy on your own servers And run your own cloud! - -*Paul, Elizabeth*, and Christopher will be [speaking at OpenStack Summit][18] in Austin on Monday, April 25, starting at 11:15am. - - ------------------------------------------------------------------------------- - -via: https://opensource.com/business/16/4/interview-openstack-infrastructure-beginners - -作者:[linux.com][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://rikkiendsley.com/ -[1]: https://twitter.com/pabelanger -[2]: https://twitter.com/pleia2 -[3]: https://twitter.com/docaedo -[4]: https://www.openstack.org/summit/austin-2016/summit-schedule/events/7337 -[5]: http://docs.openstack.org/infra/system-config/ -[6]: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-infra -[7]: https://www.technovelty.org/openstack/image-building-in-openstack-ci.html -[8]: https://code.google.com/p/gerrit/ -[9]: http://docs.openstack.org/infra/manual/developers.html#development-workflow -[10]: https://developer.ibm.com/opentech/2015/12/20/irc-the-secret-to-success-in-open-source/ -[11]: https://pypi.python.org/pypi/gertty -[12]: http://eavesdrop.openstack.org/irclogs/%23openstack-infra/ -[13]: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev -[14]: https://groups.openstack.org/ -[15]: https://www.openstack.org/summit/ -[16]: http://docs.openstack.org/infra/manual/developers.html#account-setup -[17]: https://apps.openstack.org/ -[18]: https://www.openstack.org/summit/austin-2016/summit-schedule/events/7337 diff --git a/translated/tech/A newcomer's guide to navigating OpenStack Infrastructure.md b/translated/tech/A newcomer's guide to navigating OpenStack Infrastructure.md new file mode 100644 index 0000000000..b22d5e1fd5 --- /dev/null +++ b/translated/tech/A newcomer's guide to navigating OpenStack Infrastructure.md @@ -0,0 +1,65 @@ +translating by kylepeng93 +给学习OpenStack基础设施的新手的入门指南 +=========================================================== + +任何一个为OpenStack贡献源码的人会受到社区的欢迎,但是,对于一个发展趋近成熟并且快速迭代的开源社区而言,能够拥有一个新手指南并不是 +件坏事。在奥斯汀举办的OpenStack峰会上,[Paul Belanger][1] (红帽公司), [Elizabeth K. Joseph][2] (HPE公司),和[Christopher Aedo][3] (IBM公司)将会就针对新人的OpenStack基础设施作一场专门的会谈。在这次采访中,他们将会提供一些建议和资源来帮助新人成为OpenStack贡献者中的一员。 +![](https://opensource.com/sites/default/files/images/life/Interview%20banner%20Q%26A.png) + +**你在谈话中表示你将“投入全部身心于基础设施并解释你需要知道的有关于维持OpenStack正常工作的系统的每一件事情”。这是一个持续了40分钟的的艰巨任务。那么,对于学习OpenStack基础设施的新手来说最需要知道那些事情呢?** +**Elizabeth K. Joseph (EKJ)**: 我们没有为OpenStack使用GitHub这种提交补丁的方式,这是因为这样做会对新手造成巨大的困扰,尽管由于历史原因我们还是保留了所有原先就在GitHub上的所有库的镜像。相反,我们使用了一种完全开源的复查形式,并通过OpenStack基础设施团队来持续的维持系统集成(CI)。相关的,自从我们使用了CI系统,每一个提交给OpenStack的改变都会在被合并之前进行测试。 +**Paul Belanger (PB)**: 这个项目中的大多数都是富有激情的人,因此当你提交的补丁被某个人否定时不要感到沮丧。 +**Christopher Aedo (CA)**:社区很想帮助你取得成功,因此不要害怕提问或者寻求更多的那些能够促进你理解某些事物的引导者。 + +### 在你的讲话中,对于一些你无法涉及到的方面,你会向新手推荐哪些在线资源来让他们更加容易入门? +**PB**:当然是我们的[OpenStack项目基础设施文档][5]。我们已经花了足够大的努力来尽可能让这些文档能够随时保持最新状态。我们对每个运行OpenStack项目并投入使用的系统都有制作专门的页面来进行说明。甚至于连OpenStack云基础设施团队也即将上线。 + +**EKJ**:我对于将基础设施文档作为新手入门教程这件事上的观点和Paul是一致的,另外,我们十分乐意看到来自那些folk了我们项目的学习者提交上来的补丁。我们通常不会意识到我们忽略了文档中的某些内容,除非它们恰好被人问起。因此,阅读,学习,然后帮助我们修补这些知识上的漏洞。你可以在[OpenStack基础设施邮件清单]提出你的问题,或者在我们位于FreeNode上的#OpenStack-infra的IRC专栏发起你的提问。 +**CA**:我喜欢[这个详细的发布][7],它是由Ian Wienand写的一篇关于构建图片的文章。 +### "gotchas" 会是OpenStack新的代码贡献者苦苦寻找的吗? +**EKJ**:向项目作出贡献并不仅仅是提交新的代码和新的特性;OpenStack社区高度重视代码复查。如果你想要别人查看你的补丁,那你最好先看看其他人是如何做的,然后参考他们的风格,最后一步布做到你也能够向其他人一样提交清晰且结构分明的代码补丁。你越是能让你的同伴了解你的工作并知道你正在做的复查,那他们也就更有可能形成及时复查你的代码的风格。 +**CA**:我看到过大量的新手在面对Gerrit时受挫,阅读开发者引导中的[开发者工作步骤][9]时,可能只是将他通读了一遍。如果你没有经常使用Gerrit,那你最初对它的感觉可能是困惑和无力的。但是,如果你随后做了一些代码复查的工作,那么你马上就能轻松应对它。同样,我是IRC的忠实粉丝。它可能是一个获得帮助的好地方,但是,你最好保持一个长期保留的状态,这样,尽管你在某个时候没有出现,人们也可以回答你的问题。(阅读[IRC,开源界的成功秘诀][10]。)你不必总是在线,但是你最好能够轻松的在一个通道中进行回滚操作,以此来跟上最新的动态,这种能力非常重要。 +**PB**:我同意Elizabeth和Chris—Gerrit关于寻求何种方式来学习的观点。每个开发人员所作出的努力都将让社区变得更加美好。你不仅仅要提交代码给别人去复查,同时,你也要能够复查其他人的代码。留意Gerrit的用户接口,你可能一时会变的很疑惑。我推荐新手去尝试[Gertty][11],它是一个基于控制台的终端接口,用于Gerrit代码复查系统,而它恰好也是OpenStack基础设施所驱动的一个项目。 +### 你对于OpenStack新手如何通过网络与其他贡献者交流方面有什么好的建议? +**PB**:对我来说,是通过IRC以及在Freenode上参加#OpenStack-infra专栏([IRC logs][12]).这专栏上面有很多对新手来说很有价值的资源。你可以看到OpenStack项目日复一日的运作情况,同时,一旦你知道了OpenStack项目的工作原理,你将更好的知道如何为OpenStack的未来发展作出贡献。 +**CA**:我想要为IRC再次说明一点,在IRC上保持一整天的在线记录对我来说有非常重大的意义,因为我会感觉到被重视并且时刻保持连接。这也是一种非常好的获得帮助的方式,特别是当你卡在了项目中出现的某一个难题的时候,而在专栏中,总会有一些人很乐意为你解决问题。 +**EKJ**:[OpenStack开发邮件列表][13]对于能够时刻查看到你所致力于的OpenStack项目的最新情况是非常重要的。因此,我推荐一定要订阅它。邮件列表使用课题标签来区分项目,因此你可以设置你的邮件客户端来使用它,并且集中精力于你所关心的项目。除了在线资源之外,全世界范围内也成立了一些OpenStack小组,他们被用来为OpenStack的用户和贡献者提供服务。这些小组可能会定期举行座谈和针对OpenStack主要贡献者的一些活动。你可以在MeetUp.com上搜素你所在地域的贡献者活动聚会,或者在[groups.openstack.org]上查看你所在的地域是否存在OpenStack小组。最后,还有一个每六个月举办一次的OpenStack峰会,这个峰会上会作一些关于基础设施的演说。当前状态下,这个峰会包含了用户会议和开发者会议,会议内容都是和OpenStack相关的东西,包括它的过去,现在和未来。 +### OpenStack需要在那些方面得到提升来让新手更加容易学会并掌握? +**PB**: 我认为我们的[account-setup][16]过程对于新的贡献者已经做的比较容易了,特别是教他们如何提交他们的第一个补丁。真正参与到OpenStack开发者模式的过程是需要花费很大的努力的,可能对于开发者来说已经显得非常多了;然而,一旦融入进去了,这个模式将会运转的十分高效和令人满意。 +**CA**: 我们拥有一个由专业开发者组成的社区,而且我们的关注点都是发展OpenStack本身,同时,我们致力于让用户付出更小的代价去使用OpenStack云基础设施平台。我们需要发掘更多的应用开发者,并且鼓励更多的人去开发能在OpenStack云上完美运行的云应用程序,我们还鼓励他们在[社区App目录]上去贡献那些由他们开发的app。我们可以通过提升我们的API标准和保证我们不同的库(比如libcloud,phpopencloud已经其他一些库),并让他们持续的为开发者提供可信赖的支持来实现这一目标。还有一点就是通过倡导更多的OpenStack黑客加入进来。所有的这些事情都可以降低新人的学习门槛,这样也能引导他们与这个社区之间的关系更加紧密。y. +**EKJ**: 我已经致力于开源软件很多年了。但是,对于大量的OpenStack开发者而言,这是一个他们每个人都在从事的第一个开源项目。我发现他们之前使用私有软件的背景并没有为他们塑造开源的观念和方法论,还有在开源项目中需要具备的合作技巧。我乐于看到我们能够让那些曾经一直在使用私有软件工作的人能够真正的明白他们在开源如软件社区所从事的事情的巨大价值。 +### 我认为2016年对于开源Haiku的进一步增长是具有重大意义的一年。通过Haiku来向新手解释OpenStack。 +**PB**: 如果你喜欢自由软件,你可以向OpenStack提交你的第一个补丁。 +**CA**: 在不久的未来,OpenStack将以统治世界的姿态让这个世界变得更好。 +**EKJ**: OpenStack是一个可以免费部署在你的服务器上面并且运行你自己的云的一个软件。 +*Paul,Elizabeth和Christopher将会在4月25号星期一上午11:15于奥斯汀举办的OpenStack峰会上进行演说。 + +------------------------------------------------------------------------------ + +via: https://opensource.com/business/16/4/interview-openstack-infrastructure-beginners + +作者:[linux.com][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://rikkiendsley.com/ +[1]: https://twitter.com/pabelanger +[2]: https://twitter.com/pleia2 +[3]: https://twitter.com/docaedo +[4]: https://www.openstack.org/summit/austin-2016/summit-schedule/events/7337 +[5]: http://docs.openstack.org/infra/system-config/ +[6]: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-infra +[7]: https://www.technovelty.org/openstack/image-building-in-openstack-ci.html +[8]: https://code.google.com/p/gerrit/ +[9]: http://docs.openstack.org/infra/manual/developers.html#development-workflow +[10]: https://developer.ibm.com/opentech/2015/12/20/irc-the-secret-to-success-in-open-source/ +[11]: https://pypi.python.org/pypi/gertty +[12]: http://eavesdrop.openstack.org/irclogs/%23openstack-infra/ +[13]: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev +[14]: https://groups.openstack.org/ +[15]: https://www.openstack.org/summit/ +[16]: http://docs.openstack.org/infra/manual/developers.html#account-setup +[17]: https://apps.openstack.org/ +[18]: https://www.openstack.org/summit/austin-2016/summit-schedule/events/7337 From d3c75bbbfb30f512a5351f365437a81082ffe532 Mon Sep 17 00:00:00 2001 From: Chunyang Wen Date: Mon, 4 Jul 2016 14:41:26 +0800 Subject: [PATCH 1058/1469] Finish tranlating Awk-Part4 by chunyang-wen (#4138) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * âFinish tranlating awk series part4 * Update Part 4 - How to Use Comparison Operators with Awk in Linux.md --- ... Comparison Operators with Awk in Linux.md | 97 ------------------- ... Comparison Operators with Awk in Linux.md | 95 ++++++++++++++++++ 2 files changed, 95 insertions(+), 97 deletions(-) delete mode 100644 sources/tech/awk/Part 4 - How to Use Comparison Operators with Awk in Linux.md create mode 100644 translated/tech/awk/Part 4 - How to Use Comparison Operators with Awk in Linux.md diff --git a/sources/tech/awk/Part 4 - How to Use Comparison Operators with Awk in Linux.md b/sources/tech/awk/Part 4 - How to Use Comparison Operators with Awk in Linux.md deleted file mode 100644 index 1d0ef007af..0000000000 --- a/sources/tech/awk/Part 4 - How to Use Comparison Operators with Awk in Linux.md +++ /dev/null @@ -1,97 +0,0 @@ -chunyang-wen translating - -How to Use Comparison Operators with Awk in Linux -=================================================== - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Use-Comparison-Operators-with-AWK.png) - -When dealing with numerical or string values in a line of text, filtering text or strings using comparison operators comes in handy for Awk command users. - -In this part of the Awk series, we shall take a look at how you can filter text or strings using comparison operators. If you are a programmer then you must already be familiar with comparison operators but those who are not, let me explain in the section below. - -### What are Comparison operators in Awk? - -Comparison operators in Awk are used to compare the value of numbers or strings and they include the following: - -- `>` – greater than -- `<` – less than -- `>=` – greater than or equal to -- `<=` – less than or equal to -- `==` – equal to -- `!=` – not equal to -- `some_value ~ / pattern/` – true if some_value matches pattern -- `some_value !~ / pattern/` – true if some_value does not match pattern - -Now that we have looked at the various comparison operators in Awk, let us understand them better using an example. - -In this example, we have a file named food_list.txt which is a shopping list for different food items and I would like to flag food items whose quantity is less than or equal 20 by adding `(**)` at the end of each line. - -``` -File – food_list.txt -No Item_Name Quantity Price -1 Mangoes 45 $3.45 -2 Apples 25 $2.45 -3 Pineapples 5 $4.45 -4 Tomatoes 25 $3.45 -5 Onions 15 $1.45 -6 Bananas 30 $3.45 -``` - -The general syntax for using comparison operators in Awk is: - -``` -# expression { actions; } -``` - -To achieve the above goal, I will have to run the command below: - -``` -# awk '$3 <= 30 { printf "%s\t%s\n", $0,"**" ; } $3 > 30 { print $0 ;}' food_list.txt - -No Item_Name` Quantity Price -1 Mangoes 45 $3.45 -2 Apples 25 $2.45 ** -3 Pineapples 5 $4.45 ** -4 Tomatoes 25 $3.45 ** -5 Onions 15 $1.45 ** -6 Bananas 30 $3.45 ** -``` - -In the above example, there are two important things that happen: - -- The first expression `{ action ; }` combination, `$3 <= 30 { printf “%s\t%s\n”, $0,”**” ; }` prints out lines with quantity less than or equal to 30 and adds a `(**)` at the end of each line. The value of quantity is accessed using `$3` field variable. -- The second expression `{ action ; }` combination, `$3 > 30 { print $0 ;}` prints out lines unchanged since their quantity is greater then `30`. - -One more example: - -``` -# awk '$3 <= 20 { printf "%s\t%s\n", $0,"TRUE" ; } $3 > 20 { print $0 ;} ' food_list.txt - -No Item_Name Quantity Price -1 Mangoes 45 $3.45 -2 Apples 25 $2.45 -3 Pineapples 5 $4.45 TRUE -4 Tomatoes 25 $3.45 -5 Onions 15 $1.45 TRUE -6 Bananas 30 $3.45 -``` - -In this example, we want to indicate lines with quantity less or equal to 20 with the word (TRUE) at the end. - -### Summary - -This is an introductory tutorial to comparison operators in Awk, therefore you need to try out many other options and discover more. - -In case of any problems you face or any additions that you have in mind, then drop a comment in the comment section below. Remember to read the next part of the Awk series where I will take you through compound expressions. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/comparison-operators-in-awk/ - -作者:[Aaron Kili][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/aaronkili/ diff --git a/translated/tech/awk/Part 4 - How to Use Comparison Operators with Awk in Linux.md b/translated/tech/awk/Part 4 - How to Use Comparison Operators with Awk in Linux.md new file mode 100644 index 0000000000..86649a52d5 --- /dev/null +++ b/translated/tech/awk/Part 4 - How to Use Comparison Operators with Awk in Linux.md @@ -0,0 +1,95 @@ +在 Linux 下如何使用 Awk 比较操作符 +=================================================== + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Use-Comparison-Operators-with-AWK.png) + +对于 Awk 命令的用户来说,处理一行文本中的数字或者字符串时,使用比较运算符来过滤文本和字符串是十分方便的。 + +在 Awk 系列的此部分中,我们将探讨一下如何使用比较运算符来过滤文本或者字符串。如果你是程序员,那么你应该已经熟悉比较运算符;对于其它人,下面的部分将介绍比较运算符。 + +### Awk 中的比较运算符是什么? + +Awk 中的比较运算符用于比较字符串和或者数值,包括以下类型: + +- `>` – 大于 +- `<` – 小于 +- `>=` – 大于等于 +- `<=` – 小于等于 +- `==` – 等于 +- `!=` – 不等于 +- `some_value ~ / pattern/` – 如果some_value匹配模式pattern,则返回true +- `some_value !~ / pattern/` – 如果some_value不匹配模式pattern,则返回true + +现在我们通过例子来熟悉 Awk 中各种不同的比较运算符。 + +在这个例子中,我们有一个文件名为 food_list.txt 的文件,里面包括不同食物的购买列表。我想给食物数量小于或等于30的物品所在行的后面加上`(**)` + +``` +File – food_list.txt +No Item_Name Quantity Price +1 Mangoes 45 $3.45 +2 Apples 25 $2.45 +3 Pineapples 5 $4.45 +4 Tomatoes 25 $3.45 +5 Onions 15 $1.45 +6 Bananas 30 $3.45 +``` + +Awk 中使用比较运算符的通用语法如下: + +``` +# expression { actions; } +``` + +为了实现刚才的目的,执行下面的命令: + +``` +# awk '$3 <= 30 { printf "%s\t%s\n", $0,"**" ; } $3 > 30 { print $0 ;}' food_list.txt + +No Item_Name` Quantity Price +1 Mangoes 45 $3.45 +2 Apples 25 $2.45 ** +3 Pineapples 5 $4.45 ** +4 Tomatoes 25 $3.45 ** +5 Onions 15 $1.45 ** +6 Bananas 30 $3.45 ** +``` + +在刚才的例子中,发生如下两件重要的事情: + +- 第一个表达式 `{ action ; }` 组合, `$3 <= 30 { printf “%s\t%s\n”, $0,”**” ; }` 打印出数量小于等于30的行,并且在后面增加`(**)`。物品的数量是通过 `$3`这个域变量获得的。 +- 第二个表达式 `{ action ; }` 组合, `$3 > 30 { print $0 ;}` 原样输出数量小于等于 `30` 的行。 + +再举一个例子: + +``` +# awk '$3 <= 20 { printf "%s\t%s\n", $0,"TRUE" ; } $3 > 20 { print $0 ;} ' food_list.txt + +No Item_Name Quantity Price +1 Mangoes 45 $3.45 +2 Apples 25 $2.45 +3 Pineapples 5 $4.45 TRUE +4 Tomatoes 25 $3.45 +5 Onions 15 $1.45 TRUE +6 Bananas 30 $3.45 +``` + +在这个例子中,我们想通过在行的末尾增加 (TRUE) 来标记数量小于等于20的行。 + +### 总结 + +这是一篇对 Awk 中的比较运算符介绍性的指引,因此你需要尝试其他选项,发现更多使用方法。 + +如果你遇到或者想到任何问题,请在下面评论区留下评论。请记得阅读 Awk 系列下一部分的文章,那里我将介绍组合表达式。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/comparison-operators-in-awk/ + +作者:[Aaron Kili][a] +译者:[chunyang-wen](https://github.com/chunyang-wen) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.tecmint.com/author/aaronkili/ From 707906d8c929f69366da0a5bdb59fe3f9ae2c5fe Mon Sep 17 00:00:00 2001 From: Dongliang Mu Date: Mon, 4 Jul 2016 02:41:54 -0400 Subject: [PATCH 1059/1469] translated (#4137) * translated * move to translated directory --- ...inux developers think of Git and GitHub.md | 95 ------------------- ...inux developers think of Git and GitHub.md | 93 ++++++++++++++++++ 2 files changed, 93 insertions(+), 95 deletions(-) delete mode 100644 sources/tech/20160218 What do Linux developers think of Git and GitHub.md create mode 100644 translated/tech/20160218 What do Linux developers think of Git and GitHub.md diff --git a/sources/tech/20160218 What do Linux developers think of Git and GitHub.md b/sources/tech/20160218 What do Linux developers think of Git and GitHub.md deleted file mode 100644 index c0de7f4e6a..0000000000 --- a/sources/tech/20160218 What do Linux developers think of Git and GitHub.md +++ /dev/null @@ -1,95 +0,0 @@ -translated by mudongliang - -What do Linux developers think of Git and GitHub? -===================================================== - -**Also in today’s open source roundup: DistroWatch reviews XStream Desktop 153, and Street Fighter V is coming to Linux and SteamOS in the spring** - -## What do Linux developers think of Git and GitHub? - -The popularity of Git and GitHub among Linux developers is well established. But what do developers think of them? And should GitHub really be synonymous with Git itself? A Linux redditor recently asked about this and got some very interesting answers. - -Dontwakemeup46 asked his question: - ->I am learning Git and Github. What I am interested in is how these two are viewed by the community. That git and github are used extensively, is something I know. But are there serious issues with either Git or Github? Something that the community would love to change? - -[More at Reddit](http://api.viglink.com/api/click?format=go&jsonp=vglnk_145580413015211&key=0a7039c08493c7c51b759e3d13019dbe&libId=iksc5hc8010113at000DL3yrsuvp7&loc=http%3A%2F%2Fwww.infoworld.com%2Farticle%2F3033059%2Flinux%2Fwhat-do-linux-developers-think-of-git-and-github.html&v=1&out=https%3A%2F%2Fwww.reddit.com%2Fr%2Flinux%2Fcomments%2F45jy59%2Fthe_popularity_of_git_and_github%2F&ref=http%3A%2F%2Fwww.linux.com%2Fnews%2Fsoftware%2Fapplications%2F886008-what-do-linux-developers-think-of-git-and-github&title=What%20do%20Linux%20developers%20think%20of%20Git%20and%20GitHub%3F%20%7C%20InfoWorld&txt=More%20at%20Reddit) - -His fellow Linux redditors responded with their thoughts about Git and GitHub: - ->Derenir: ”Github is not affliated with Git. - ->Git is made by Linus Torvalds. - ->Github hardly supports Linux. - ->Github is a corporate bordelo that tries to make money from Git. - ->[https://desktop.github.com/](http://api.viglink.com/api/click?format=go&jsonp=vglnk_145580415025712&key=0a7039c08493c7c51b759e3d13019dbe&libId=iksc5hc8010113at000DL3yrsuvp7&loc=http%3A%2F%2Fwww.infoworld.com%2Farticle%2F3033059%2Flinux%2Fwhat-do-linux-developers-think-of-git-and-github.html&v=1&type=U&out=https%3A%2F%2Fdesktop.github.com%2F&ref=http%3A%2F%2Fwww.linux.com%2Fnews%2Fsoftware%2Fapplications%2F886008-what-do-linux-developers-think-of-git-and-github&title=What%20do%20Linux%20developers%20think%20of%20Git%20and%20GitHub%3F%20%7C%20InfoWorld&txt=https%3A%2F%2Fdesktop.github.com%2F) see here no Linux Support.” - ->**Bilog78**: ”A minor update: git hasn't been “made by Linus Torvalds” for a while. The maintainer is Junio C Hamano and the main contributors after him are Jeff King and Shawn O. Pearce.” - ->**Fearthefuture**: ”I like git but can't understand why people even use github anymore. From my point of view the only thing it does better than bitbucket are user statistics and the larger userbase. Bitbucket has unlimited free private repos, much better UI and very good integration with other services such as Jenkins.” - ->**Thunger**: ”Gitlab.com is also nice, especially since you can host your own instance on your own servers.” - ->**Takluyver**: ”Lots of people are familiar with the UI of Github and associated services like Travis, and lots of people already have Github accounts, so it's a good place for projects to be. People also use their Github profile as a kind of portfolio, so they're motivated to put more projects on there. Github is a de facto standard for hosting open source projects.” - ->**Tdammers**: ”Serious issue with git would be the UI, which is kind of counterintuitive, to the point that many users just stick with a handful of memorized incantations. - -Github: most serious issue here is that it's a proprietary hosted solution; you buy convenience, and the price is that your code is on someone else's server and not under your control anymore. Another common criticism of github is that its workflow isn't in line with the spirit of git itself, particularly the way pull requests work. And finally, github is monopolizing the code hosting landscape, and that's bad for diversity, which in turn is crucial for a thriving free software community.” - ->**Dies**: ”How is that the case? More importantly, if that is the case, then what's done is done and I guess we're stuck with Github since they control so many projects.” - ->**Tdammers**: ”The code is hosted on someone else's server, "someone else" in this case being github. Which, for an open-source project, is not typically a huge problem, but still, you don't control it. If you have a private project on github, then the only assurance you have that it will remain private is github's word for it. If you decide to delete things, then you can never be sure whether it's been deleted, or just hidden. - -Github doesn't control the projects themselves (you can always take your code and host it elsewhere, declaring the new location the "official" one), it just has deeper access to the code than the developers themselves.” - ->**Drelos**: ”I have read a lot of praises and bad stuff about Github ([here's an example](http://api.viglink.com/api/click?format=go&jsonp=vglnk_145580428524613&key=0a7039c08493c7c51b759e3d13019dbe&libId=iksc5hc8010113at000DL3yrsuvp7&loc=http%3A%2F%2Fwww.infoworld.com%2Farticle%2F3033059%2Flinux%2Fwhat-do-linux-developers-think-of-git-and-github.html&v=1&out=http%3A%2F%2Fwww.wired.com%2F2015%2F06%2Fproblem-putting-worlds-code-github%2F&ref=http%3A%2F%2Fwww.linux.com%2Fnews%2Fsoftware%2Fapplications%2F886008-what-do-linux-developers-think-of-git-and-github&title=What%20do%20Linux%20developers%20think%20of%20Git%20and%20GitHub%3F%20%7C%20InfoWorld&txt=here%27s%20an%20example)) but my simple noob question is why aren't efforts towards a free and open "version" ?” - ->**Twizmwazin**: ”GitLab is sorta pushing there.” - -[More at Reddit](http://api.viglink.com/api/click?format=go&jsonp=vglnk_145580429720714&key=0a7039c08493c7c51b759e3d13019dbe&libId=iksc5hc8010113at000DL3yrsuvp7&loc=http%3A%2F%2Fwww.infoworld.com%2Farticle%2F3033059%2Flinux%2Fwhat-do-linux-developers-think-of-git-and-github.html&v=1&out=https%3A%2F%2Fwww.reddit.com%2Fr%2Flinux%2Fcomments%2F45jy59%2Fthe_popularity_of_git_and_github%2F&ref=http%3A%2F%2Fwww.linux.com%2Fnews%2Fsoftware%2Fapplications%2F886008-what-do-linux-developers-think-of-git-and-github&title=What%20do%20Linux%20developers%20think%20of%20Git%20and%20GitHub%3F%20%7C%20InfoWorld&txt=More%20at%20Reddit) - -## DistroWatch reviews XStream Desktop 153 - -XStreamOS is a version of Solaris created by Sonicle. XStream Desktop brings the power of Solaris to desktop users, and distrohoppers might be interested in checking it out. DistroWatch did a full review of XStream Desktop 153 and found that it performed fairly well. - -Jesse Smith reports for DistroWatch: - ->I think XStream Desktop does a lot of things well. Admittedly, my trial got off to a rocky start when the operating system would not boot on my hardware and I could not get the desktop to use my display's full screen resolution when running in VirtualBox. However, after that, XStream performed fairly well. The installer works well, the operating system automatically sets up and uses boot environments, insuring we can recover the system if something goes wrong. The package management tools work well and XStream ships with a useful collection of software. - ->I did run into a few problems playing media, specifically getting audio to work. I am not sure if that is another hardware compatibility issue or a problem with the media software that ships with the operating system. On the other hand, tools such as the web browser, e-mail, productivity suite and configuration tools all worked well. - ->What I appreciate about XStream the most is that the operating system is a branch of the OpenSolaris family that is being kept up to date. Other derivatives of OpenSolaris tend to lag behind, at least with desktop software, but XStream is still shipping recent versions of Firefox and LibreOffice. - ->For me personally, XStream is missing a few components, like a printer manager, multimedia support and drivers for my specific hardware. Other aspects of the operating system are quite attractive. I like the way the developers have set up LXDE, I like the default collection of software and I especially like the way file system snapshots and boot environments are enabled out of the box. Most Linux distributions, openSUSE aside, have not caught on to the usefulness of boot environments yet and I hope it is a technology that is picked up by more projects. - -[More at DistroWatch](http://api.viglink.com/api/click?format=go&jsonp=vglnk_145580434172315&key=0a7039c08493c7c51b759e3d13019dbe&libId=iksc5hc8010113at000DL3yrsuvp7&loc=http%3A%2F%2Fwww.infoworld.com%2Farticle%2F3033059%2Flinux%2Fwhat-do-linux-developers-think-of-git-and-github.html&v=1&out=http%3A%2F%2Fdistrowatch.com%2Fweekly.php%3Fissue%3D20160215%23xstreamos&ref=http%3A%2F%2Fwww.linux.com%2Fnews%2Fsoftware%2Fapplications%2F886008-what-do-linux-developers-think-of-git-and-github&title=What%20do%20Linux%20developers%20think%20of%20Git%20and%20GitHub%3F%20%7C%20InfoWorld&txt=More%20at%20DistroWatch) - -## Street Fighter V and SteamOS - -Street Fighter is one of the most well known game franchises of all time, and now [Capcom has announced](http://api.viglink.com/api/click?format=go&jsonp=vglnk_145580435418216&key=0a7039c08493c7c51b759e3d13019dbe&libId=iksc5hc8010113at000DL3yrsuvp7&loc=http%3A%2F%2Fwww.infoworld.com%2Farticle%2F3033059%2Flinux%2Fwhat-do-linux-developers-think-of-git-and-github.html&v=1&out=http%3A%2F%2Fsteamcommunity.com%2Fgames%2F310950%2Fannouncements%2Fdetail%2F857177755595160250&ref=http%3A%2F%2Fwww.linux.com%2Fnews%2Fsoftware%2Fapplications%2F886008-what-do-linux-developers-think-of-git-and-github&title=What%20do%20Linux%20developers%20think%20of%20Git%20and%20GitHub%3F%20%7C%20InfoWorld&txt=Capcom%20has%20announced) that Street Fighter V will be coming to Linux and SteamOS in the spring. This is great news for Linux gamers. - -Joe Parlock reports for Destructoid: - ->Are you one of the less than one percent of Steam users who play on a Linux-based system? Are you part of the even smaller percentage of people who play on Linux and are excited for Street Fighter V? Well, I’ve got some good news for you. - ->Capcom has announced via Steam that Street Fighter V will be coming to SteamOS and other Linux operating systems sometime this spring. It’ll come at no extra cost, so those who already own the PC build of the game will just be able to install it on Linux and be good to go. - -[More at Destructoid](http://api.viglink.com/api/click?format=go&jsonp=vglnk_145580435418216&key=0a7039c08493c7c51b759e3d13019dbe&libId=iksc5hc8010113at000DL3yrsuvp7&loc=http%3A%2F%2Fwww.infoworld.com%2Farticle%2F3033059%2Flinux%2Fwhat-do-linux-developers-think-of-git-and-github.html&v=1&out=http%3A%2F%2Fsteamcommunity.com%2Fgames%2F310950%2Fannouncements%2Fdetail%2F857177755595160250&ref=http%3A%2F%2Fwww.linux.com%2Fnews%2Fsoftware%2Fapplications%2F886008-what-do-linux-developers-think-of-git-and-github&title=What%20do%20Linux%20developers%20think%20of%20Git%20and%20GitHub%3F%20%7C%20InfoWorld&txt=Capcom%20has%20announced) - -Did you miss a roundup? Check the [Eye On Open home page](http://www.infoworld.com/blog/eye-on-open/) to get caught up with the latest news about open source and Linux. - ------------------------------------------------------------------------------- - -via: http://www.infoworld.com/article/3033059/linux/what-do-linux-developers-think-of-git-and-github.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.infoworld.com/author/Jim-Lynch/ - diff --git a/translated/tech/20160218 What do Linux developers think of Git and GitHub.md b/translated/tech/20160218 What do Linux developers think of Git and GitHub.md new file mode 100644 index 0000000000..a0eb63506e --- /dev/null +++ b/translated/tech/20160218 What do Linux developers think of Git and GitHub.md @@ -0,0 +1,93 @@ +Linux 开发者如何看待 Git 和 Github? +===================================================== + +**同样在今日的开源摘要: DistroWatch 评估 XStream 桌面 153 版本,街头霸王 V 即将在这个春天进入 Linux 和 SteamOS** + +## Linux 开发者如何看待 Git 和 Github? + +Git 和 Github 在 Linux 开发者中有很高的知名度。但是开发者如何看待它们呢?另外,Github 是不是真的和 Git 是一个意思?一个 Linux reddit 用户最近问到了这个问题,并且得到了很有意思的答案。 + +Dontwakemeup46 提问: + +> 我正在学习 Git 和 Github。我感兴趣的是社区如何看待两者?据我所知,Git 和 Github 应用十分广泛。但是 Git 或 Github 有没有严重的,社区喜欢去修改的问题呢? + +[更多见 Reddit](http://api.viglink.com/api/click?format=go&jsonp=vglnk_145580413015211&key=0a7039c08493c7c51b759e3d13019dbe&libId=iksc5hc8010113at000DL3yrsuvp7&loc=http%3A%2F%2Fwww.infoworld.com%2Farticle%2F3033059%2Flinux%2Fwhat-do-linux-developers-think-of-git-and-github.html&v=1&out=https%3A%2F%2Fwww.reddit.com%2Fr%2Flinux%2Fcomments%2F45jy59%2Fthe_popularity_of_git_and_github%2F&ref=http%3A%2F%2Fwww.linux.com%2Fnews%2Fsoftware%2Fapplications%2F886008-what-do-linux-developers-think-of-git-and-github&title=What%20do%20Linux%20developers%20think%20of%20Git%20and%20GitHub%3F%20%7C%20InfoWorld&txt=More%20at%20Reddit) + +与他志同道合的 Linux reddit 用户回答了他们对于 Git 和 Github的想法: + +>Derenir: “Github 并不隶属于 Git。 + +>Git 是由 Linus Torvalds 开发的。 + +>Github 几乎不支持 Linux。 + +>Github 是一家唯利是图的,企图借助 Git 赚钱的公司。 + +>[https://desktop.github.com/](http://api.viglink.com/api/click?format=go&jsonp=vglnk_145580415025712&key=0a7039c08493c7c51b759e3d13019dbe&libId=iksc5hc8010113at000DL3yrsuvp7&loc=http%3A%2F%2Fwww.infoworld.com%2Farticle%2F3033059%2Flinux%2Fwhat-do-linux-developers-think-of-git-and-github.html&v=1&type=U&out=https%3A%2F%2Fdesktop.github.com%2F&ref=http%3A%2F%2Fwww.linux.com%2Fnews%2Fsoftware%2Fapplications%2F886008-what-do-linux-developers-think-of-git-and-github&title=What%20do%20Linux%20developers%20think%20of%20Git%20and%20GitHub%3F%20%7C%20InfoWorld&txt=https%3A%2F%2Fdesktop.github.com%2F) 并没有支持 Linux。” + +>**Bilog78**: “一个简单的更新: Linus Torvalds 已经不再维护 Git了。维护者是 Junio C Hamano,以及 Linus 之后的主要贡献者是Jeff King 和 Shawn O. Pearce。” + +>**Fearthefuture**: “我喜欢 Git,但是不明白人们为什么还要使用 Github。从我的角度,Github 比 Bitbucket 好的一点是用户统计和更大的用户基础。Bitbucket 有无限的免费私有库,更好的 UI,以及更好地继承其他服务,比如说 Jenkins。” + +>**Thunger**: “Gitlab.com 也很不错,特别是你可以在自己的服务器上架设自己的实例。” + +>**Takluyver**: “很多人熟悉 Github 的 UI 以及相关联的服务,像 Travis 。并且很多人都有 Github 账号,所以它是一个很好地存储项目的地方。人们也使用他们的 Github 简况作为一种求职用的作品选辑,所以他们很积极地将更多的项目放在这里。Github 是一个事实上的,存放开源项目的标准。” + +>**Tdammers**: “Git 严重问题在于 UI,它有些违反直觉,到很多用户只使用一些容易记住的咒语程度。” + +Github:最严重的问题在于它是私人拥有的解决方案;你买了方便,但是代价是你的代码在别人的服务器上面,已经不在你的掌控范围之内了。另一个对于 Github 的普遍批判是它的工作流和 Git 本身的精神不符,特别是 pull requests 工作的方式。最后, Github 垄断代码的托管环境,同时对于多样性是很不好的,这反过来对于旺盛的免费软件社区很重要。” + +>**Dies**: “更重要的是,如果一旦是这样,做过的都做过了,并且我猜我们会被 Github 所困,因为它们控制如此多的项目。” + +>**Tdammers**: “代码托管在别人的服务器上,别人指的是 Github。这对于开源项目来说,并不是什么太大的问题,但是仍然,你无法控制它。如果你在 Github 上有私有项目,唯一的保险在于它将保持私有是 Github 的承诺。如果你决定删除东西,你不能确定东西是否被删除了,或者只是隐藏了。 + +Github 并不自己控制这些项目(你总是可以拿走你的代码,然后托管到别的地方,声明新位置是“官方”的),它只是有比开发者本身有更深的使用权。” + +>**Drelos**: “我已经读了大量的关于 Github 的赞美与批评。(这里有一个[例子](http://api.viglink.com/api/click?format=go&jsonp=vglnk_145580428524613&key=0a7039c08493c7c51b759e3d13019dbe&libId=iksc5hc8010113at000DL3yrsuvp7&loc=http%3A%2F%2Fwww.infoworld.com%2Farticle%2F3033059%2Flinux%2Fwhat-do-linux-developers-think-of-git-and-github.html&v=1&out=http%3A%2F%2Fwww.wired.com%2F2015%2F06%2Fproblem-putting-worlds-code-github%2F&ref=http%3A%2F%2Fwww.linux.com%2Fnews%2Fsoftware%2Fapplications%2F886008-what-do-linux-developers-think-of-git-and-github&title=What%20do%20Linux%20developers%20think%20of%20Git%20and%20GitHub%3F%20%7C%20InfoWorld&txt=here%27s%20an%20example)),但是我的新手问题是为什么不向一个免费开源的版本努力呢?” + +>**Twizmwazin**: “Gitlab 的源码就存在这里” + +[更多见 Reddit](http://api.viglink.com/api/click?format=go&jsonp=vglnk_145580429720714&key=0a7039c08493c7c51b759e3d13019dbe&libId=iksc5hc8010113at000DL3yrsuvp7&loc=http%3A%2F%2Fwww.infoworld.com%2Farticle%2F3033059%2Flinux%2Fwhat-do-linux-developers-think-of-git-and-github.html&v=1&out=https%3A%2F%2Fwww.reddit.com%2Fr%2Flinux%2Fcomments%2F45jy59%2Fthe_popularity_of_git_and_github%2F&ref=http%3A%2F%2Fwww.linux.com%2Fnews%2Fsoftware%2Fapplications%2F886008-what-do-linux-developers-think-of-git-and-github&title=What%20do%20Linux%20developers%20think%20of%20Git%20and%20GitHub%3F%20%7C%20InfoWorld&txt=More%20at%20Reddit) + +## DistroWatch 评估 XStream 桌面 153 版本 + +XStreamOS 是一个由 Sonicle 创建的 Solaris 的一个版本。XStream 桌面将 Solaris 的强大带给了桌面用户,同时新手用户很可能有兴趣体验一下。DistroWatch 对于 XStream 桌面 153 版本做了一个很全面的评估,并且发现它运行相当好。 + +Jesse Smith 为 DistroWatch 报道: + +> 我认为 XStream 桌面做好了很多事情。无可否认地,我的实验陷入了头晕目眩的状态当操作系统无法在我的硬件上启动。同时,当运行在 VirtualBox 中我无法使得桌面使用我显示器的完整分辨率。 + +> 我确实在播放多媒体文件时遇见一些问题,特别是使声卡工作。我不确定是不是另外一个硬件兼容问题,或者一个关于操作系统自带的多媒体软件的问题。另一方面,像 Web 浏览器,电子邮件,生产工具套件以及配置工具这样的工作都工作的很好。 + +> 我最欣赏 XStream 的地方是这个操作系统是 OpenSolaris 家族的一个使用保持最新的分支。OpenSolaris 的其他衍生系统有落后的倾向,至少在桌面软件上,但是 XStream 仍然搭载最新版本的火狐和 LibreOffice。 + +>对我个人来说,XStream 缺少一些组件,比如打印机管理器,多媒体支持和我特定硬件的驱动。这个操作系统的其他方面也是相当吸引人的。我喜欢开发者搭建 LXDE 的方式,软件的默认组合,以及我最喜欢文件系统快照和启动环境开箱即用的方式。大多数的 Linux 发行版,openSUSE 除外,并没有使得启动环境的有用性流行起来。我希望它是一个被更多项目采用的技术。 + +[更多见 DistroWatch](http://api.viglink.com/api/click?format=go&jsonp=vglnk_145580434172315&key=0a7039c08493c7c51b759e3d13019dbe&libId=iksc5hc8010113at000DL3yrsuvp7&loc=http%3A%2F%2Fwww.infoworld.com%2Farticle%2F3033059%2Flinux%2Fwhat-do-linux-developers-think-of-git-and-github.html&v=1&out=http%3A%2F%2Fdistrowatch.com%2Fweekly.php%3Fissue%3D20160215%23xstreamos&ref=http%3A%2F%2Fwww.linux.com%2Fnews%2Fsoftware%2Fapplications%2F886008-what-do-linux-developers-think-of-git-and-github&title=What%20do%20Linux%20developers%20think%20of%20Git%20and%20GitHub%3F%20%7C%20InfoWorld&txt=More%20at%20DistroWatch) + +## 街头霸王 V 和 SteamOS + +街头霸王是最出名的游戏之一,并且 [Capcom 已经宣布](http://api.viglink.com/api/click?format=go&jsonp=vglnk_145580435418216&key=0a7039c08493c7c51b759e3d13019dbe&libId=iksc5hc8010113at000DL3yrsuvp7&loc=http%3A%2F%2Fwww.infoworld.com%2Farticle%2F3033059%2Flinux%2Fwhat-do-linux-developers-think-of-git-and-github.html&v=1&out=http%3A%2F%2Fsteamcommunity.com%2Fgames%2F310950%2Fannouncements%2Fdetail%2F857177755595160250&ref=http%3A%2F%2Fwww.linux.com%2Fnews%2Fsoftware%2Fapplications%2F886008-what-do-linux-developers-think-of-git-and-github&title=What%20do%20Linux%20developers%20think%20of%20Git%20and%20GitHub%3F%20%7C%20InfoWorld&txt=Capcom%20has%20announced) 街头霸王 V 将会在这个春天进入 Linux 和 StreamOS。这对于 Linux 游戏者是非常好的消息。 + +Joe Parlock 为 Destructoid 报道: + +>你是少于 1% 的,在 Linux 系统上玩游戏的 Stream 用户吗?你是更少百分比的,在 Linux 平台上玩游戏,同时很喜欢街头霸王 V 的人之一吗?是的话,我有一些好消息要告诉你。 + +>Capcom 已经宣布,这个春天街头霸王 V 通过 Stream 进入 StreamOS 以及其他 Linux 发行版。它无需任何额外的成本,所以那些已经个人电脑建立的游戏的人可以很容易在 Linux 上安装它,并且运行良好。 + +[更多 Destructoid](http://api.viglink.com/api/click?format=go&jsonp=vglnk_145580435418216&key=0a7039c08493c7c51b759e3d13019dbe&libId=iksc5hc8010113at000DL3yrsuvp7&loc=http%3A%2F%2Fwww.infoworld.com%2Farticle%2F3033059%2Flinux%2Fwhat-do-linux-developers-think-of-git-and-github.html&v=1&out=http%3A%2F%2Fsteamcommunity.com%2Fgames%2F310950%2Fannouncements%2Fdetail%2F857177755595160250&ref=http%3A%2F%2Fwww.linux.com%2Fnews%2Fsoftware%2Fapplications%2F886008-what-do-linux-developers-think-of-git-and-github&title=What%20do%20Linux%20developers%20think%20of%20Git%20and%20GitHub%3F%20%7C%20InfoWorld&txt=Capcom%20has%20announced) + +你是否错过了摘要?检查 [Eye On Open home page](http://www.infoworld.com/blog/eye-on-open/) 来获得关于 Linux 和开源的最新的新闻。 + +------------------------------------------------------------------------------ + +via: http://www.infoworld.com/article/3033059/linux/what-do-linux-developers-think-of-git-and-github.html + +作者:[Jim Lynch][a] +译者:[mudongliang](https://github.com/mudongliang) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.infoworld.com/author/Jim-Lynch/ + From ca31a2b5decd7fde3da794d258d931e19fb33a00 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 4 Jul 2016 15:21:06 +0800 Subject: [PATCH 1060/1469] PUB:20160531 HOW TO USE WEBP IMAGES IN UBUNTU LINUX @alim0x --- ... HOW TO USE WEBP IMAGES IN UBUNTU LINUX.md | 51 ++++++++++--------- 1 file changed, 28 insertions(+), 23 deletions(-) rename {translated/tech => published}/20160531 HOW TO USE WEBP IMAGES IN UBUNTU LINUX.md (72%) diff --git a/translated/tech/20160531 HOW TO USE WEBP IMAGES IN UBUNTU LINUX.md b/published/20160531 HOW TO USE WEBP IMAGES IN UBUNTU LINUX.md similarity index 72% rename from translated/tech/20160531 HOW TO USE WEBP IMAGES IN UBUNTU LINUX.md rename to published/20160531 HOW TO USE WEBP IMAGES IN UBUNTU LINUX.md index c08efbc683..e6287d62e9 100644 --- a/translated/tech/20160531 HOW TO USE WEBP IMAGES IN UBUNTU LINUX.md +++ b/published/20160531 HOW TO USE WEBP IMAGES IN UBUNTU LINUX.md @@ -1,14 +1,15 @@ -在 Ubuntu Linux 中使用 WEBP 图片 +在 Ubuntu Linux 中使用 WebP 图片 ========================================= ![](http://itsfoss.com/wp-content/uploads/2016/05/support-webp-ubuntu-linux.jpg) ->简介:这篇指南会向你展示如何在 Linux 下查看 WebP 图片以及将 WebP 图片转换为 JPEG 或 PNG 格式。 -### 什么是 WEBP? +> 简介:这篇指南会向你展示如何在 Linux 下查看 WebP 图片以及将 WebP 图片转换为 JPEG 或 PNG 格式。 -Google 为图片推出 [WebP 文件格式][0]已经超过五年了。Google 说,WebP 提供有损和无损压缩,相比 JPEG 压缩,WebP 压缩文件大小能更小约 25%。 +### 什么是 WebP? -Google 的目标是让 WebP 成为 web 图片的新标准,但是我没能看到这一切发生。已经五年过去了,除了谷歌的生态系统以外它仍未被接受成为一个标准。但正如我们所知的,Google 对它的技术很有进取心。几个月前 Google 将 Google Plus 的所有图片改为了 WebP 格式。 +自从 Google 推出 [WebP 图片格式][0],已经过去五年了。Google 说,WebP 提供有损和无损压缩,相比 JPEG 压缩,WebP 压缩文件大小,能更小约 25%。 + +Google 的目标是让 WebP 成为 web 图片的新标准,但是并没有成为现实。已经五年过去了,除了谷歌的生态系统以外它仍未被接受成为一个标准。但正如我们所知的,Google 对它的技术很有进取心。几个月前 Google 将 Google Plus 的所有图片改为了 WebP 格式。 如果你用 Google Chrome 从 Google Plus 上下载那些图片,你会得到 WebP 图片,不论你之前上传的是 PNG 还是 JPEG。这都不是重点。真正的问题在于当你尝试着在 Ubuntu 中使用默认的 GNOME 图片查看器打开它时你会看到如下错误: @@ -17,7 +18,8 @@ Google 的目标是让 WebP 成为 web 图片的新标准,但是我没能看 > **Unrecognized image file format(未识别文件格式)** ![](http://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-1.png) ->GNOME 图片查看器不支持 WebP 图片 + +*GNOME 图片查看器不支持 WebP 图片* 在这个教程里,我们会看到 @@ -41,7 +43,8 @@ sudo apt-get install gthumb 一旦安装完成,你就可以简单地右键点击 WebP 图片,选择 gThumb 来打开它。你现在应该可以看到如下画面: ![](http://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-2.jpeg) ->gThumb 中显示的 WebP 图片 + +*gThumb 中显示的 WebP 图片* ### 让 gThumb 成为 Ubuntu 中 WebP 图片的默认应用 @@ -50,28 +53,30 @@ sudo apt-get install gthumb #### 步骤 1:右键点击 WebP 文件选择属性。 ![](http://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-3.png) ->从右键菜单中选择属性 + +*从右键菜单中选择属性* #### 步骤 2:转到打开方式标签,选择 gThumb 并点击设置为默认。 ![](http://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-4.png) ->让 gThumb 成为 Ubuntu 中 WebP 图片的默认应用 + +*让 gThumb 成为 Ubuntu 中 WebP 图片的默认应用* ### 让 gThumb 成为所有图片的默认应用 -gThumb 的功能比图片查看器更多。举个例子,你可以做一些简单的编辑,给图片添加滤镜等。添加滤镜的效率没有 XnRetro(在[ Linux 下添加类似 Instagram 滤镜效果][5]的专用工具)那么高,但它还是有一些基础的滤镜可以用。 +gThumb 的功能比图片查看器更多。举个例子,你可以做一些简单的图片编辑,给图片添加滤镜等。添加滤镜的效率没有 XnRetro(在[ Linux 下添加类似 Instagram 滤镜效果][5]的专用工具)那么高,但它还是有一些基础的滤镜可以用。 -我非常喜欢 gThumb 并且决定让它成为默认的图片查看器。如果你也想在 Ubuntu 中让 gThumb 成为所有图片的默认默认应用,遵照以下步骤操作: +我非常喜欢 gThumb 并且决定让它成为默认的图片查看器。如果你也想在 Ubuntu 中让 gThumb 成为所有图片的默认应用,遵照以下步骤操作: -#### 步骤1:打开系统设置 +步骤1:打开系统设置 ![](http://itsfoss.com/wp-content/uploads/2014/04/System_Settings_ubuntu_1404.jpeg) -#### 步骤2:转到详情(Details) +步骤2:转到详情(Details) ![](http://itsfoss.com/wp-content/uploads/2013/11/System_settings_Ubuntu_1.jpeg) -#### 步骤3:在这里将 gThumb 设置为图片的默认应用 +步骤3:在这里将 gThumb 设置为图片的默认应用 ![](http://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-5.png) @@ -100,7 +105,7 @@ sudo apt-get install webp ##### 将 JPEG/PNG 转换为 WebP -我们将使用 cwebp 命令(它代表压缩为 WebP 吗?)来将 JPEG 或 PNG 文件转换为 WebP。命令格式是这样的: +我们将使用 cwebp 命令(它代表转换为 WebP 的意思吗?)来将 JPEG 或 PNG 文件转换为 WebP。命令格式是这样的: ``` cwebp -q [图片质量] [JPEG/PNG_文件名] -o [WebP_文件名] @@ -132,7 +137,7 @@ dwebp example.webp -o example.png [下载 XnConvert][1] -XnConvert 是个强大的工具,你可以用它来批量修改图片尺寸。但在这个教程里,我们只能看到如何将单个 WebP 图片转换为 PNG/JPEG。 +XnConvert 是个强大的工具,你可以用它来批量修改图片尺寸。但在这个教程里,我们只介绍如何将单个 WebP 图片转换为 PNG/JPEG。 打开 XnConvert 并选择输入文件: @@ -148,24 +153,24 @@ XnConvert 是个强大的工具,你可以用它来批量修改图片尺寸。 也许你一点都不喜欢 WebP 图片格式,也不想在 Linux 仅仅为了查看 WebP 图片而安装一个新软件。如果你不得不将 WebP 文件转换以备将来使用,这会是件更痛苦的事情。 -一个解决这个问题更简单,不那么痛苦的途径是安装一个 Chrome 扩展 Save Image as PNG。有了这个插件,你可以右键点击 WebP 图片并直接存储为 PNG 格式。 +解决这个问题的一个更简单、不那么痛苦的途径是安装一个 Chrome 扩展 Save Image as PNG。有了这个插件,你可以右键点击 WebP 图片并直接存储为 PNG 格式。 ![](http://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-8.png) ->在 Google Chrome 中将 WebP 图片保存为 PNG 格式 -[获取 Save Image as PNG 扩展][2] +*在 Google Chrome 中将 WebP 图片保存为 PNG 格式* + +- [获取 Save Image as PNG 扩展][2] ### 你的选择是? -我希望这个详细的教程能够帮你在 Linux 上获取 WebP 支持并帮你转换 WebP 图片。你在 Linux 怎么处理 WebP 图片?你使用哪个工具?以上描述的方法中,你最喜欢哪一个? - +我希望这个详细的教程能够帮你在 Linux 上支持 WebP 并帮你转换 WebP 图片。你在 Linux 怎么处理 WebP 图片?你使用哪个工具?以上描述的方法中,你最喜欢哪一个? ---------------------- -via: http://itsfoss.com/webp-ubuntu-linux/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 +via: http://itsfoss.com/webp-ubuntu-linux/ 作者:[Abhishek Prakash][a] 译者:[alim0x](https://github.com/alim0x) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 8c55d2a65499b237aa7d3792f7ea5ff3e712cd86 Mon Sep 17 00:00:00 2001 From: alim0x Date: Mon, 4 Jul 2016 19:01:38 +0800 Subject: [PATCH 1061/1469] [translated]How to permanently mount a Windows share on Linux --- ...manently mount a Windows share on Linux.md | 127 ------------------ ...manently mount a Windows share on Linux.md | 122 +++++++++++++++++ 2 files changed, 122 insertions(+), 127 deletions(-) delete mode 100644 sources/tech/20160624 How to permanently mount a Windows share on Linux.md create mode 100644 translated/tech/20160624 How to permanently mount a Windows share on Linux.md diff --git a/sources/tech/20160624 How to permanently mount a Windows share on Linux.md b/sources/tech/20160624 How to permanently mount a Windows share on Linux.md deleted file mode 100644 index 30b2cf71f8..0000000000 --- a/sources/tech/20160624 How to permanently mount a Windows share on Linux.md +++ /dev/null @@ -1,127 +0,0 @@ -alim0x translating - -How to permanently mount a Windows share on Linux -================================================== - ->If you get tired of having to remount Windows shares when you reboot your Linux box, read about an easy way to make those shares permanently mount. - -![](http://tr2.cbsistatic.com/hub/i/2016/06/02/e965310b-b38d-43e6-9eac-ea520992138b/68fd9ec5d6731cc405bdd27f2f42848d/linuxadminhero.jpg) ->Image: Jack Wallen - -It has never been easier for Linux to interact within a Windows network. And considering how many businesses are adopting Linux, those two platforms have to play well together. Fortunately, with the help of a few tools, you can easily map Windows network drives onto a Linux machine, and even ensure they are still there upon rebooting the Linux machine. - -### Before we get started - -For this to work, you will be using the command line. The process is pretty simple, but you will be editing the /etc/fstab file, so do use caution. -Also, I assume you already have Samba working properly so you can manually mount shares from a Windows network to your Linux box, and that you know the IP address of the machine hosting the share. - -Are you ready? Let's go. - -### Create your mount point - -The first thing we're going to do is create a folder that will serve as the mount point for the share. For the sake of simplicity, we'll name this folder share and we'll place it in /media. Open your terminal window and issue the command: - -``` -sudo mkdir /media/share -``` - -### A few installations - -Now we have to install the system that allows for cross-platform file sharing; this system is cifs-utils. From the terminal window, issue the command: - -``` -sudo apt-get install cifs-utils -``` - -This command will also install all of the dependencies for cifs-utils. - -Once this is installed, open up the file /etc/nsswitch.conf and look for the line: - -``` -hosts: files mdns4_minimal [NOTFOUND=return] dns -``` - -Edit that line so it looks like: - -``` -hosts: files mdns4_minimal [NOTFOUND=return] wins dns -``` - -Now you must install windbind so that your Linux machine can resolve Windows computer names on a DHCP network. From the terminal, issue this command: - -``` -sudo apt-get install libnss-windbind windbind -``` - -Restart networking with the command: - -``` -sudo service networking restart -``` - -### Mount the network drive - -Now we're going to map the network drive. This is where we must edit the /etc/fstab file. Before you make that first edit, back up the file with this command: - -``` -sudo cp /etc/fstab /etc/fstab.old -``` - -If you need to restore that file, issue the command: - -``` -sudo mv /etc/fstab.old /etc/fstab -``` - -Create a credentials file in your home directory called .smbcredentials. In that file, add your username and password, like so (USER is the actual username and password is the actual password): - -``` -username=USER - -password=PASSWORD -``` - -You now have to know the Group ID (GID) and User ID (UID) of the user that will be mounting the drive. Issue the command: - -``` -id USER -``` - -USER is the actual username, and you should see something like: - -``` -uid=1000(USER) gid=1000(GROUP) -``` - -USER is the actual username, and GROUP is the group name. The numbers before (USER) and (GROUP) will be used in the /etc/fstab file. - -It's time to edit the /etc/fstab file. Open that file in your editor and add the following line to the end (replace everything in ALL CAPS and the IP address of the remote machine): - -``` -//192.168.1.10/SHARE /media/share cifs credentials=/home/USER/.smbcredentials,iocharset=uft8,gid=GID,udi=UID,file_mode=0777,dir_mode=0777 0 0 -``` - -**Note**: The above should be on a single line. - -Save and close that file. Issue the command sudo mount -a and the share will be mounted. Check in /media/share and you should see the files and folders on the network share. - -### Sharing made easy - -Thanks to cifs-utils and Samba, mapping network shares is incredibly easy on a Linux machine. And now, you won't have to manually remount those shares every time your machine boots. - -For more networking tips and tricks, sign up for our Data Center newsletter. -[SUBSCRIBE](https://secure.techrepublic.com/user/login/?regSource=newsletter-button&position=newsletter-button&appId=true&redirectUrl=http%3A%2F%2Fwww.techrepublic.com%2Farticle%2Fhow-to-permanently-mount-a-windows-share-on-linux%2F&) - --------------------------------------------------------------------------------- - -via: http://www.techrepublic.com/article/how-to-permanently-mount-a-windows-share-on-linux/ - -作者:[Jack Wallen][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://www.techrepublic.com/search/?a=jack+wallen - - diff --git a/translated/tech/20160624 How to permanently mount a Windows share on Linux.md b/translated/tech/20160624 How to permanently mount a Windows share on Linux.md new file mode 100644 index 0000000000..a205923fe0 --- /dev/null +++ b/translated/tech/20160624 How to permanently mount a Windows share on Linux.md @@ -0,0 +1,122 @@ +如何在 Linux 上永久挂载一个 Windows 共享 +================================================== + +> 如果你已经厌倦了每次重启 Linux 就得重新挂载 Windows 共享,读读这个让共享永久挂载的简单方法。 + +![](http://tr2.cbsistatic.com/hub/i/2016/06/02/e965310b-b38d-43e6-9eac-ea520992138b/68fd9ec5d6731cc405bdd27f2f42848d/linuxadminhero.jpg) +>图片: Jack Wallen + +在 Linux 上和一个 Windows 网络进行交互从来就不是件轻松的事情。想想多少企业正在采用 Linux,这两个平台不得不一起好好协作。幸运的是,有了一些工具的帮助,你可以轻松地将 Windows 网络驱动器映射到一台 Linux 机器上,甚至可以确保在重启 Linux 机器之后共享还在。 + +### 在我们开始之前 + +要实现这个,你需要用到命令行。过程十分简单,但你需要编辑 /etc/fstab 文件,所以小心操作。还有,我假设你已经有正常工作的 Samba 了,可以手动从 Windows 网络挂载共享到你的 Linux 机器,还知道这个共享的主机 IP 地址。 + +准备好了吗?那就开始吧。 + +### 创建你的挂载点 + +我们要做的第一件事是创建一个文件夹,他将作为共享的挂载点。为了简单起见,我们将这个文件夹命名为 share,放在 /media 之下。打开你的终端执行以下命令: + +``` +sudo mkdir /media/share +``` + +### 一些安装 + +现在我们得安装允许跨平台文件共享的系统;这个系统是 cifs-utils。在终端窗口输入: + +``` +sudo apt-get install cifs-utils +``` + +这个命令同时还会安装 cifs-utils 所有的依赖。 + +安装完成之后,打开文件 /etc/nsswitch.conf 并找到这一行: + +``` +hosts: files mdns4_minimal [NOTFOUND=return] dns +``` + +编辑这一行,让它看起来像这样: + +``` +hosts: files mdns4_minimal [NOTFOUND=return] wins dns +``` + +现在你必须安装 windbind 让你的 Linux 机器可以在 DHCP 网络中解析 Windows 机器名。在终端里执行: + +``` +sudo apt-get install libnss-windbind windbind +``` + +用这个命令重启网络服务: + +``` +sudo service networking restart +``` + +### 挂载网络驱动器 + +现在我们要映射网络驱动器。这里我们必须编辑 /etc/fstab 文件。在你做第一次编辑之前,用这个命令备份以下这个文件: + +``` +sudo cp /etc/fstab /etc/fstab.old +``` + +如果你需要恢复这个文件,执行以下命令: + +``` +sudo mv /etc/fstab.old /etc/fstab +``` + +在你的主目录创建一个认证信息文件 .smbcredentials。在这个文件里添加你的用户名和密码,就像这样(USER 和 PASSWORD 是实际的用户名和密码): + +``` +username=USER + +password=PASSWORD +``` + +你需要知道挂载这个驱动器的用户的组 ID(GID)和用户 ID(UID)。执行命令: + +``` +id USER +``` + +USER 是实际的用户名,你应该会看到类似这样的信息: + +``` +uid=1000(USER) gid=1000(GROUP) +``` + +USER 是实际的用户名,GROUP 是组名。在(USER)和(GROUP)之前的数字将会被用在 /etc/fstab 文件之中。 + +是时候编辑 /etc/fstab 文件了。在你的编辑器中打开那个文件并添加下面这行到文件末尾(替换以下全大写字段以及远程机器的 IP 地址): + +``` +//192.168.1.10/SHARE /media/share cifs credentials=/home/USER/.smbcredentials,iocharset=uft8,gid=GID,udi=UID,file_mode=0777,dir_mode=0777 0 0 +``` + +**注意**:上面这些内容应该在同一行上。 + +保存并关闭那个文件。执行 sudo mount -a 命令,共享将被挂载。检查一下 /media/share,你应该能看到那个网络共享上的文件和文件夹了。 + +### 共享很简单 + +有了 cifs-utils 和 Samba,映射网络共享在一台 Linux 机器上简单得让人难以置信。现在,你再也不用在每次机器启动的时候手动重新挂载那些共享了。 + +更多网络提示和技巧,订阅我们的 Data Center 消息吧。 +[订阅](https://secure.techrepublic.com/user/login/?regSource=newsletter-button&position=newsletter-button&appId=true&redirectUrl=http%3A%2F%2Fwww.techrepublic.com%2Farticle%2Fhow-to-permanently-mount-a-windows-share-on-linux%2F&) + +-------------------------------------------------------------------------------- + +via: http://www.techrepublic.com/article/how-to-permanently-mount-a-windows-share-on-linux/ + +作者:[Jack Wallen][a] +译者:[alim0x](https://github.com/alim0x) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.techrepublic.com/search/?a=jack+wallen From d37b8ed2443acda0425cd583081bfac88aa6e506 Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 4 Jul 2016 22:13:40 +0800 Subject: [PATCH 1062/1469] =?UTF-8?q?20160704-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...MATE 1.14 IN UBUNTU MATE 16.04 VIA PPA.md | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 sources/tech/20160609 INSTALL MATE 1.14 IN UBUNTU MATE 16.04 VIA PPA.md diff --git a/sources/tech/20160609 INSTALL MATE 1.14 IN UBUNTU MATE 16.04 VIA PPA.md b/sources/tech/20160609 INSTALL MATE 1.14 IN UBUNTU MATE 16.04 VIA PPA.md new file mode 100644 index 0000000000..07b0f4e5a3 --- /dev/null +++ b/sources/tech/20160609 INSTALL MATE 1.14 IN UBUNTU MATE 16.04 VIA PPA.md @@ -0,0 +1,64 @@ +INSTALL MATE 1.14 IN UBUNTU MATE 16.04 (XENIAL XERUS) VIA PPA +================================================================= + +MATE Desktop 1.14 is now available for Ubuntu MATE 16.04 (Xenial Xerus). According to the release [announcement][1], it took about 2 months to release MATE Desktop 1.14 in a PPA because everything has been well tested, so you shouldn't encounter any issues. + +![](https://2.bp.blogspot.com/-v38tLvDAxHg/V1k7beVd5SI/AAAAAAAAX7A/1X72bmQ3ia42ww6kJ_61R-CZ6yrYEBSpgCLcB/s400/mate114-ubuntu1604.png) + +**The PPA currently provides MATE 1.14.1 (Ubuntu MATE 16.04 ships with MATE 1.12.x by default), which includes changes such as:** + +- client-side decoration apps now render correctly in all themes; +- touchpad configuration now supports edge and two-finger scrolling independently; +- python extensions in Caja can now be managed separately; +- all three window focus modes are selectable; +- MATE Panel now has the ability to change icon sizes for menubar and menu items; +- volume and Brightness OSD can now be enabled/disabled; +- many other improvements and bug fixes. + +MATE 1.14 also includes improved support for GTK+3 across the entire desktop, as well as various other GTK+3 tweaks however, the PPA packages are built with GTK+2 "to ensure compatibility with Ubuntu MATE 16.04 and all the 3rd party MATE applets, plugins and extensions", mentions the Ubuntu MATE blog. + +A complete MATE 1.14 changelog can be found [HERE][2]. + +### Upgrade to MATE Desktop 1.14.x in Ubuntu MATE 16.04 + +To upgrade to the latest MATE Desktop 1.14.x in Ubuntu MATE 16.04 using the official Xenial MATE PPA, open a terminal and use the following commands: + +``` +sudo apt-add-repository ppa:ubuntu-mate-dev/xenial-mate +sudo apt update +sudo apt dist-upgrade +``` + +**Note**: mate-netspeed applet will be removed when upgrading. That's because the applet is now part of the mate-applets package, so it's still available. + +Once the upgrade finishes, restart your system. That's it! + +### How to revert the changes + +If you're not satisfied with MATE 1.14, you encountered some bugs, etc., and you want to go back to the MATE version available in the official repositories, you can purge the PPA and downgrade the packages. + +To do this, use the following commands: + +``` +sudo apt install ppa-purge +sudo ppa-purge ppa:ubuntu-mate-dev/xenial-mate +``` + +After all the MATE packages are downgraded, restart the system. + +via [Ubuntu MATE blog][3] + +-------------------------------------------------------------------------------- + +via: http://www.webupd8.org/2016/06/install-mate-114-in-ubuntu-mate-1604.html + +作者:[Andrew][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.webupd8.org/p/about.html +[1]: https://ubuntu-mate.org/blog/mate-desktop-114-for-xenial-xerus/ +[2]: http://mate-desktop.com/blog/2016-04-08-mate-1-14-released/ +[3]: https://ubuntu-mate.org/blog/mate-desktop-114-for-xenial-xerus/ From f0c0375835f7eb5614c71cf09d1c259bb9bb3ca2 Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 4 Jul 2016 22:20:09 +0800 Subject: [PATCH 1063/1469] =?UTF-8?q?20160704-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...3 Advanced Image Processing with Python.md | 122 ++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 sources/tech/20160623 Advanced Image Processing with Python.md diff --git a/sources/tech/20160623 Advanced Image Processing with Python.md b/sources/tech/20160623 Advanced Image Processing with Python.md new file mode 100644 index 0000000000..b431eb72f4 --- /dev/null +++ b/sources/tech/20160623 Advanced Image Processing with Python.md @@ -0,0 +1,122 @@ +Advanced Image Processing with Python +====================================== + +![](http://www.cuelogic.com/blog/wp-content/uploads/2016/06/Image-Search-Engine.png) + +Building an image processing search engine is no easy task. There are several concepts, tools, ideas and technologies that go into it. One of the major image-processing concepts is reverse image querying (RIQ) or reverse image search. Google, Cloudera, Sumo Logic and Birst are among the top organizations to use reverse image search. Great for analyzing images and making use of mined data, RIQ provides a very good insight into analytics. + +### Top Companies and Reverse Image Search + +There are many top tech companies that are using RIQ to best effect. For example, Pinterest first brought in visual search in 2014. It subsequently released a white paper in 2015, revealing the architecture. Reverse image search enabled Pinterest to obtain visual features from fashion objects and display similar product recommendations. + +As is generally known, Google images uses reverse image search allowing users to upload an image and then search for connected images. The submitted image is analyzed and a mathematical model made out of it, by advanced algorithm use. The image is then compared with innumerable others in the Google databases before results are matched and similar results obtained. + +**Here is a graph representation from the OpenCV 2.4.9 Features Comparison Report:** + +![](http://www.cuelogic.com/blog/wp-content/uploads/2016/06/search-engine-graph.jpg) + +### Algorithms & Python Libraries + +Before we get down to the workings of it, let us rush through the main elements that make building an image processing search engine with Python possible: + +### Patented Algorithms + +#### SIFT (Scale-Invariant Feature Transform) Algorithm + +1. A patented technology with nonfree functionality that uses image identifiers in order to identify a similar image, even those clicked from different angles, sizes, depths and scale, that they are included in the search results. Check the detailed video on SIFT here. +2. SIFT correctly matches the search criteria with a large database of features from many images. +3. Matching same images with different viewpoints and matching invariant features to obtain search results is another SIFT feature. Read more about scale-invariant keypoints here. + +#### SURF (Speeded Up Robust Features) Algorithm + +1. [SURF][1] is also patented with nonfree functionality and a more ‘speeded’ up version of SIFT. Unlike SIFT, SURF approximates Laplacian of Gaussian (unlike SIFT) with Box Filter. + +2. SURF relies on the determinant of Hessian Matrix for both its location and scale. + +3. Rotation invariance is not a requisite in many applications. So not finding this orientation speeds up the process. + +4. SURF includes several features that the speed improved in each step. Three times faster than SIFT, SURF is great with rotation and blurring. It is not as great in illumination and viewpoint change though. + +5. Open CV, a programming function library provides SURF functionalities. SURF.compute() and SURF. Detect() can be used to find descriptors and keypoints. Read more about SURF [here][2]. + +### Open Source Algorithms + +#### KAZE Algorithm + +1.KAZE is a open source 2D multiscale and novel feature detection and description algorithm in nonlinear scale spaces. Efficient techniques in Additive Operator Splitting (AOS) and variable conductance diffusion is used to build the nonlinear scale space. + +2. Multiscale image processing basics are simple – Creating an image’s scale space while filtering original image with right function over enhancing time or scale. + +#### AKAZE (Accelerated-KAZE) Algorithm + +1. As the name suggests, this is a faster mode to image search, finding matching keypoints between two images. AKAZE uses a binary descriptor and nonlinear scale space that balances accuracy and speed. + +#### BRISK (Binary Robust Invariant Scalable Keypoints) Algorithm + +1. BRISK is great for description, keypoint detection and matching. + +2. An algorithm that is highly adaptive, scale-space FAST-based detector along with a bit-string descriptor, helps speed up the search significantly. + +3. Scale-space keypoint detection and keypoint description helps optimize the performance with relation to the task at hand. + +#### FREAK (Fast Retina Keypoint) + +1. This is a novel keypoint descriptor inspired by the human eye.A binary strings cascade is efficiently computed by an image intensity comparison. The FREAK algorithm allows faster computing with lower memory load as compared to BRISK, SURF and SIFT. + +#### ORB (Oriented FAST and Rotated BRIEF) + +1.A fast binary descriptor, ORB is resistant to noise and rotation invariant. ORB builds on the FAST keypoint detector and the BRIEF descriptor, elements attributed to its low cost and good performance. + +2. Apart from the fast and precise orientation component, efficiently computing the oriented BRIEF, analyzing variance and co-relation of oriented BRIEF features, is another ORB feature. + +### Python Libraries + +#### Open CV + +1. OpenCV is available for both academic and commercial use. A open source machine learning and computer vision library, OpenCV makes it easy for organizations to utilize and modify code. + +2. Over 2500 optimized algorithms, including state-of-the-art machine learning and computer vision algorithms serve various image search purposes – face detection, object identification, camera movement tracking, finding similar images from image database, following eye movements, scenery recognition, etc. + +3. Top companies like Google, IBM, Yahoo, IBM, Sony, Honda, Microsoft and Intel make wide use of OpenCV. + +4. OpenCV uses Python, Java, C, C++ and MATLAB interfaces while supporting Windows, Linux, Mac OS and Android. + +#### Python Imaging Library (PIL) + +1. The Python Imaging Library (PIL) supports several file formats while providing image processing and graphics solutions.The open source PIL adds image processing capabilities to your Python interpreter. +2. The standard procedure for image manipulation include image enhancing, transparency and masking handling, image filtering, per-pixel manipulation, etc. + +For detailed statistics and graphs, view the OpenCV 2.4.9 Features Comparison Report [here][3]. + +### Building an Image Search Engine + +An image search engine helps pick similar images from a prepopulated set of image base. The most popular among these is Google’s well known image search engine. For starters, there are various approaches to build a system like this. To mention a few: + +1.Using image extraction, image description extraction, meta data extraction and search result extraction to build an image search engine. +2. Define your image descriptor, dataset indexing, define your similarity metric and then search and rank. +3. Select image to be searched, select directory for carrying out search, search directory for all pictures, create picture feature index, evaluate same feature for search picture, match pictures in search and obtain matched pictures. + +Our approach basically began with comparing grayscaled versions of the images, gradually moving on to complex feature matching algorithms like SIFT and SURF, and then finally settling down to am open source solution called BRISK. All these algorithms give efficient results with minor changes in performance and latency. An engine built on these algorithms have numerous applications like analyzing graphic data for popularity statistics, identification of objects in graphic contents, and many more. + +**Example**: An image search engine needs to be build by an IT company for a client. So if a brand logo image is submitted in the search, all related brand image searches show up as results. The obtained results can also be used for analytics by the client, allowing them to estimate the brand popularity as per the geographic location. Its still early days though, RIQ or reverse image search has not been exploited to its full extent yet. + +This concludes our article on building an image search engine using Python. Check our blog section out for the latest on technology and programming. + +Statistics Source: OpenCV 2.4.9 Features Comparison Report (computer-vision-talks.com) + +(Guidance and additional inputs by Ananthu Nair.) + +-------------------------------------------------------------------------------- + +via: http://www.cuelogic.com/blog/advanced-image-processing-with-python/ + +作者:[Snehith Kumbla][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.cuelogic.com/blog/author/snehith-kumbla/ +[1]: http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_feature2d/py_surf_intro/py_surf_intro.html +[2]: http://www.vision.ee.ethz.ch/~surf/eccv06.pdf +[3]: https://docs.google.com/spreadsheets/d/1gYJsy2ROtqvIVvOKretfxQG_0OsaiFvb7uFRDu5P8hw/edit#gid=10 From 2208862a8be7c82c9a062f74c4aa51568d1b2448 Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 4 Jul 2016 22:23:58 +0800 Subject: [PATCH 1064/1469] =?UTF-8?q?20160704-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...29 USE TASK MANAGER EQUIVALENT IN LINUX.md | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 sources/tech/20160629 USE TASK MANAGER EQUIVALENT IN LINUX.md diff --git a/sources/tech/20160629 USE TASK MANAGER EQUIVALENT IN LINUX.md b/sources/tech/20160629 USE TASK MANAGER EQUIVALENT IN LINUX.md new file mode 100644 index 0000000000..91488f82cf --- /dev/null +++ b/sources/tech/20160629 USE TASK MANAGER EQUIVALENT IN LINUX.md @@ -0,0 +1,52 @@ +USE TASK MANAGER EQUIVALENT IN LINUX +==================================== + +![](https://itsfoss.com/wp-content/uploads/2016/06/Task-Manager-in-Linux.jpg) + +These are some of the most frequently asked questions by Linux beginners, “**is there a task manager for Linux**“, “how do you open task manager in Linux” ? + +People who are coming from Windows know how useful is the task manager. You press the Ctrl+Alt+Del to get to task manager in Windows. This task manager shows you all the running processes and their memory consumption. You can choose to end a process from this task manager application. + +When you have just begun with Linux, you look for a **task manager equivalent in Linux** as well. An expert Linux user prefers the command line way to find processes and memory consumption etc but you don’t have to go that way, at least not when you are just starting with Linux. + +All major Linux distributions have a task manager equivalent. Mostly, **it is called System Monitor** but it actually depends on your Linux distribution and the [desktop environment][1] it uses. + +In this article, we’ll see how to find and use the task manager in Linux with GNOME as the [desktop environment][2]. + +### TASK MANAGER EQUIVALENT IN LINUX WITH GNOME DESKTOP + +While using GNOME, press super key (Windows Key) and look for System Monitor: + +![](https://itsfoss.com/wp-content/uploads/2016/06/system-monitor-gnome-fedora.png) + +When you start the System Monitor, it shows you all the running processes and the memory consumption by them. + +![](https://itsfoss.com/wp-content/uploads/2016/06/fedora-system-monitor.jpeg) + +You can select a process and click on End process to kill it. + +![](https://itsfoss.com/wp-content/uploads/2016/06/kill-process-fedora.png) + +You can also see some statistics about your system in the Resources tab such as CPU consumption per core basis, memory usage, network usage etc. + +![](https://itsfoss.com/wp-content/uploads/2016/06/system-stats-fedora.png) + +This was the graphical way. If you want to go command line way, just run the command ‘top’ in terminal and you can see all the running processes and their memory consumption. You can easily [kill processes in Linux][3] command line. + +This all you need to know about task manager equivalent in Fedora Linux. I hope you find this quick tutorial helpful. If you have questions or suggestions, feel free to ask. + + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/task-manager-linux/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 + +作者:[Abhishek Prakash][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[1]: https://wiki.archlinux.org/index.php/desktop_environment +[2]: https://itsfoss.com/best-linux-desktop-environments/ +[3]: https://itsfoss.com/how-to-find-the-process-id-of-a-program-and-kill-it-quick-tip/ From 210ed0daf4ee349b1529045b827068ff97e57276 Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 4 Jul 2016 22:27:27 +0800 Subject: [PATCH 1065/1469] =?UTF-8?q?20160704-4=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...DERING TO DROP 32 BIT SUPPORT IN UBUNTU.md | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 sources/tech/20160701 CANONICAL CONSIDERING TO DROP 32 BIT SUPPORT IN UBUNTU.md diff --git a/sources/tech/20160701 CANONICAL CONSIDERING TO DROP 32 BIT SUPPORT IN UBUNTU.md b/sources/tech/20160701 CANONICAL CONSIDERING TO DROP 32 BIT SUPPORT IN UBUNTU.md new file mode 100644 index 0000000000..c7a3e8a499 --- /dev/null +++ b/sources/tech/20160701 CANONICAL CONSIDERING TO DROP 32 BIT SUPPORT IN UBUNTU.md @@ -0,0 +1,42 @@ +CANONICAL CONSIDERING TO DROP 32 BIT SUPPORT IN UBUNTU +======================================================== + +![](https://itsfoss.com/wp-content/uploads/2016/06/Ubuntu-32-bit-goes-for-a-toss-.jpg) + +Yesterday, developer [Dimitri John Ledkov][1] wrote a message on the [Ubuntu Mailing list][2] calling for the end of i386 support by Ubuntu 18.10. Ledkov argues that more software is being developed with 64-bit support. He is also concerned that it will be difficult to provide security support for the aging i386 architecture. + +Ledkov also argues that building i386 images is not free, but takes quite a bit of Canonical’s resources. + +>Building i386 images is not “for free”, it comes at the cost of utilizing our build farm, QA and validation time. Whilst we have scalable build-farms, i386 still requires all packages, autopackage tests, and ISOs to be revalidated across our infrastructure. As well as take up mirror space & bandwidth. + +Ledkov offers a plan where the 16.10, 17.04, and 17.10 versions of Ubuntu will continue to have i386 kernels, netboot installers, and cloud images, but drop i386 ISO for desktop and server. The 18.04 LTS would then drop support for i386 kernels, netboot installers, and cloud images, but still provide the ability for i386 programs to run on 64-bit architecture. Then, 18.10 would end the i386 port and limit legacy 32-bit applications to snaps, containers, and virtual machines. + +Ledkov’s plan had not been accepted yet, but it shows a definite push toward eliminating 32-bit support. + +### GOOD NEWS + +Don’t despair yet. this will not affect the distros used to resurrect your old system. [Martin Wimpress][3], the creator of [Ubuntu MATE][4], revealed during a discussion on Googl+ that these changes will only affect mainline Ubuntu. + +>The i386 archive will continue to exist into 18.04 and flavours can continue to elect to build i386 isos. There is however a security concern, in that some larger applications (Firefox, Chromium, LibreOffice) are already presenting challenges in terms of applying some security patches to older LTS releases. So flavours are being asked to be mindful of the support period they can reasonably be expected to support i386 versions for. + +### THOUGHTS + +I understand why they need to make this move from a security standpoint, but it’s going to make people move away from mainline Ubuntu to either one of the flavors or a different architecture. Thankfully, we have alternative [lightweight Linux distributions][5]. + + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-32-bit-support-drop/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 + +作者:[John Paul][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[1]: https://plus.google.com/+DimitriJohnLedkov +[2]: https://lists.ubuntu.com/archives/ubuntu-devel-discuss/2016-June/016661.html +[3]: https://twitter.com/m_wimpress +[4]: http://ubuntu-mate.org/ +[5]: https://itsfoss.com/lightweight-linux-beginners/ From 1c334e4618c06e82310b0da30c42e79f28a05a62 Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 4 Jul 2016 22:32:24 +0800 Subject: [PATCH 1066/1469] =?UTF-8?q?20160704-5=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Command Line History by Going Incognito.md | 124 ++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 sources/tech/20160625 How to Hide Linux Command Line History by Going Incognito.md diff --git a/sources/tech/20160625 How to Hide Linux Command Line History by Going Incognito.md b/sources/tech/20160625 How to Hide Linux Command Line History by Going Incognito.md new file mode 100644 index 0000000000..274ff3b175 --- /dev/null +++ b/sources/tech/20160625 How to Hide Linux Command Line History by Going Incognito.md @@ -0,0 +1,124 @@ +How to Hide Linux Command Line History by Going Incognito +================================================================ + +![](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2016/06/commandline-history-featured.jpg) + +If you’re a Linux command line user, you’ll agree that there are times when you do not want certain commands you run to be recorded in the command line history. There could be many reasons for this. For example, you’re at a certain position in your company, and you have some privileges that you don’t want others to abuse. Or, there are some critical commands that you don’t want to run accidentally while you’re browsing the history list. + +But is there a way to control what goes into the history list and what doesn’t? Or, in other words, can we turn on a web browser-like incognito mode in the Linux command line? The answer is yes, and there are many ways to achieve this, depending on what exactly you want. In this article we will discuss some of the popular solutions available. + +Note: all the commands presented in this article have been tested on Ubuntu. + +### Different ways available + +The first two ways we’ll describe here have already been covered in [one of our previous articles][1]. If you are already aware of them, you can skip over these. However, if you aren’t aware, you’re advised to go through them carefully. + +#### 1. Insert space before command + +Yes, you read it correctly. Insert a space in the beginning of a command, and it will be ignored by the shell, meaning the command won’t be recorded in history. However, there’s a dependency – the said solution will only work if the HISTCONTROL environment variable is set to “ignorespace” or “ignoreboth,” which is by default in most cases. + +So, a command like the following: + +``` +[space]echo "this is a top secret" +``` + +Won’t appear in the history if you’ve already done this command: + +``` +export HISTCONTROL = ignorespace +``` + +The below screenshot is an example of this behavior. + +![](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2016/06/commandline-history-bash-command-space.png) + +The fourth “echo” command was not recorded in the history as it was run with a space in the beginning. + +#### 2. Disable the entire history for the current session + +If you want to disable the entire history for a session, you can easily do that by unsetting the HISTSIZE environment variable before you start with your command line work. To unset the variable run the following command: + +``` +export HISTFILE=0 +``` + +HISTFILE is the number of lines (or commands) that can be stored in the history list for an ongoing bash session. By default, this variable has a set value – for example, 1000 in my case. + +So, the command mentioned above will set the environment variable’s value to zero, and consequently nothing will be stored in the history list until you close the terminal. Keep in mind that you’ll also not be able to see the previously run commands by pressing the up arrow key or running the history command. + +#### 3. Erase the entire history after you’re done + +This can be seen as an alternative to the solution mentioned in the previous section. The only difference is that in this case you run a command AFTER you’re done with all your work. Thh following is the command in question: + +``` +history -cw +``` + +As already mentioned, this will have the same effect as the HISTFILE solution mentioned above. + +#### 4. Turn off history only for the work you do + +While the solutions (2 and 3) described above do the trick, they erase the entire history, something which might be undesired in many situations. There might be cases in which you want to retain the history list up until the point you start your command line work. For situations like these you need to run the following command before starting with your work: + +``` +[space]set +o history +``` + +Note: [space] represents a blank space. + +The above command will disable the history temporarily, meaning whatever you do after running this command will not be recorded in history, although all the stuff executed prior to the above command will be there as it is in the history list. + +To re-enable the history, run the following command: + +``` +[Space]set -o history +``` + +This brings things back to normal again, meaning any command line work done after the above command will show up in the history. + +#### 5. Delete specific commands from history + +Now suppose the history list already contains some commands that you didn’t want to be recorded. What can be done in this case? It’s simple. You can go ahead and remove them. The following is how to accomplish this: + +``` +[space]history | grep "part of command you want to remove" +``` + +The above command will output a list of matching commands (that are there in the history list) with a number [num] preceding each of them. + +Once you’ve identified the command you want to remove, just run the following command to remove that particular entry from the history list: + +``` +history -d [num] +``` + +The following screenshot is an example of this. + +![](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2016/06/commandline-history-delete-specific-commands.png) + +The second ‘echo’ command was removed successfully. + +Alternatively, you can just press the up arrow key to take a walk back through the history list, and once the command of your interest appears on the terminal, just press “Ctrl + U” to totally blank the line, effectively removing it from the list. + +### Conclusion + +There are multiple ways in which you can manipulate the Linux command line history to suit your needs. Keep in mind, however, that it’s usually not a good practice to hide or remove a command from history, although it’s also not wrong, per se, but you should be aware of what you’re doing and what effects it might have. + +-------------------------------------------------------------------------------- + +via: https://www.maketecheasier.com/linux-command-line-history-incognito/?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+maketecheasier + +作者:[Himanshu Arora][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.maketecheasier.com/author/himanshu/ +[1]: https://www.maketecheasier.com/command-line-history-linux/ + + + + + From c4d1ef7fb577612467d2ec614dbb56a75c42537b Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 4 Jul 2016 22:48:22 +0800 Subject: [PATCH 1067/1469] =?UTF-8?q?20160704-6=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ervices with Python RabbitMQ and Nameko.md | 279 ++++++++++++++++++ 1 file changed, 279 insertions(+) create mode 100644 sources/tech/20160304 Microservices with Python RabbitMQ and Nameko.md diff --git a/sources/tech/20160304 Microservices with Python RabbitMQ and Nameko.md b/sources/tech/20160304 Microservices with Python RabbitMQ and Nameko.md new file mode 100644 index 0000000000..5048465904 --- /dev/null +++ b/sources/tech/20160304 Microservices with Python RabbitMQ and Nameko.md @@ -0,0 +1,279 @@ +Microservices with Python RabbitMQ and Nameko +============================================== + +>"Micro-services is the new black" - Splitting the project in to independently scalable services is the currently the best option to ensure the evolution of the code. In Python there is a Framework called "Nameko" which makes it very easy and powerful. + +### Micro services + +>The term "Microservice Architecture" has sprung up over the last few years to describe a particular way of designing software applications as suites of independently deployable services. - M. Fowler + +I recommend reading the [Fowler's posts][1] to understand the theory behind it. + +#### Ok I so what does it mean? + +In brief a Micro Service Architecture exists when your system is divided in small (single context bound) responsibilities blocks, those blocks doesn't know each other, they only have a common point of communication, generally a message queue, and does know the communication protocol and interfaces. + +#### Give me a real-life example + +>The code is available on github: take a look at service and api folders for more info. + +Consider you have an REST API, that API has an endpoint receiving some data and you need to perform some kind of computation with that data, instead of blocking the caller you can do it asynchronously, return an status "OK - Your request will be processed" to the caller and do it in a background task. + +Also you want to send an email notification when the computation is finished without blocking the main computing process, so it is better to delegate the "email sending" to another service. + +#### Scenario + +![](http://brunorocha.org/static/media/microservices/micro_services.png) + +### Show me the code! + +Lets create the system to understand it in practice. + +#### Environment + +We need an environment with: + +- A running RabbitMQ +- Python VirtualEnv for services +- Python VirtualEnv for API + +#### Rabbit + +The easiest way to have a RabbitMQ in development environment is running its official docker container, considering you have Docker installed run: + +``` +docker run -d --hostname my-rabbit --name some-rabbit -p 15672:15672 -p 5672:5672 rabbitmq:3-management +``` + +Go to the browser and access using credentials guest:guest if you can login to RabbitMQ dashboard it means you have it running locally for development. + +![](http://brunorocha.org/static/media/microservices/RabbitMQManagement.png) + +#### The Service environment + +Now lets create the Micro Services to consume our tasks. We'll have a service for computing and another for mail, follow the steps. + +In a shell create the root project directory + +``` +$ mkdir myproject +$ cd myproject +``` + +Create and activate a virtualenv (you can also use virtualenv-wrapper) + +``` +$ virtualenv service_env +$ source service_env/bin/activate +``` + +Install nameko framework and yagmail + +``` +(service_env)$ pip install nameko +(service_env)$ pip install yagmail +``` + +#### The service code + +Now having that virtualenv prepared (consider you can run service in a server and API in another) lets code the nameko RPC Services. + +We are going to put both services in a single python module, but you can also split in separate modules and also run them in separate servers if needed. + +In a file called `service.py` + +``` +import yagmail +from nameko.rpc import rpc, RpcProxy + + +class Mail(object): + name = "mail" + + @rpc + def send(self, to, subject, contents): + yag = yagmail.SMTP('myname@gmail.com', 'mypassword') + # read the above credentials from a safe place. + # Tip: take a look at Dynaconf setting module + yag.send(to=to.encode('utf-8), + subject=subject.encode('utf-8), + contents=[contents.encode('utf-8)]) + + +class Compute(object): + name = "compute" + mail = RpcProxy('mail') + + @rpc + def compute(self, operation, value, other, email): + operations = {'sum': lambda x, y: int(x) + int(y), + 'mul': lambda x, y: int(x) * int(y), + 'div': lambda x, y: int(x) / int(y), + 'sub': lambda x, y: int(x) - int(y)} + try: + result = operations[operation](value, other) + except Exception as e: + self.mail.send.async(email, "An error occurred", str(e)) + raise + else: + self.mail.send.async( + email, + "Your operation is complete!", + "The result is: %s" % result + ) + return result +``` + +Now with the above services definition we need to run it as a Nameko RPC service. + +>NOTE: We are going to run it in a console and leave it running, but in production it is recommended to put the service to run using supervisord or an alternative. + +Run the service and let it running in a shell + +``` +(service_env)$ nameko run service --broker amqp://guest:guest@localhost +starting services: mail, compute +Connected to amqp://guest:**@127.0.0.1:5672// +Connected to amqp://guest:**@127.0.0.1:5672// +``` + +#### Testing it + +Go to another shell (with the same virtenv) and test it using nameko shell + +``` +(service_env)$ nameko shell --broker amqp://guest:guest@localhost +Nameko Python 2.7.9 (default, Apr 2 2015, 15:33:21) +[GCC 4.9.2] shell on linux2 +Broker: amqp://guest:guest@localhost +>>> +``` + +You are now in the RPC client testing shell exposing the n.rpc object, play with it + +``` +>>> n.rpc.mail.send("name@email.com", "testing", "Just testing") +``` + +The above should sent an email and we can also call compute service to test it, note that it also spawns an async mail sending with result. + +``` +>>> n.rpc.compute.compute('sum', 30, 10, "name@email.com") +40 +>>> n.rpc.compute.compute('sub', 30, 10, "name@email.com") +20 +>>> n.rpc.compute.compute('mul', 30, 10, "name@email.com") +300 +>>> n.rpc.compute.compute('div', 30, 10, "name@email.com") +3 +``` + +### Calling the micro-service through the API + +In a different shell (or even a different server) prepare the API environment + +Create and activate a virtualenv (you can also use virtualenv-wrapper) + +``` +$ virtualenv api_env +$ source api_env/bin/activate +``` + +Install Nameko, Flask and Flasgger + +``` +(api_env)$ pip install nameko +(api_env)$ pip install flask +(api_env)$ pip install flasgger +``` + +>NOTE: In api you dont need the yagmail because it is service responsability + +Lets say you have the following code in a file `api.py` + +``` +from flask import Flask, request +from flasgger import Swagger +from nameko.standalone.rpc import ClusterRpcProxy + +app = Flask(__name__) +Swagger(app) +CONFIG = {'AMQP_URI': "amqp://guest:guest@localhost"} + + +@app.route('/compute', methods=['POST']) +def compute(): + """ + Micro Service Based Compute and Mail API + This API is made with Flask, Flasgger and Nameko + --- + parameters: + - name: body + in: body + required: true + schema: + id: data + properties: + operation: + type: string + enum: + - sum + - mul + - sub + - div + email: + type: string + value: + type: integer + other: + type: integer + responses: + 200: + description: Please wait the calculation, you'll receive an email with results + """ + operation = request.json.get('operation') + value = request.json.get('value') + other = request.json.get('other') + email = request.json.get('email') + msg = "Please wait the calculation, you'll receive an email with results" + subject = "API Notification" + with ClusterRpcProxy(CONFIG) as rpc: + # asynchronously spawning and email notification + rpc.mail.send.async(email, subject, msg) + # asynchronously spawning the compute task + result = rpc.compute.compute.async(operation, value, other, email) + return msg, 200 + +app.run(debug=True) +``` + +Put the above API to run in a different shell or server + +``` +(api_env) $ python api.py + * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit) +``` + +and then access the url you will see the Flasgger UI and you can interact with the api and start producing tasks on queue to the service to consume. + +![](http://brunorocha.org/static/media/microservices/Flasgger_API_documentation.png) + +>NOTE: You can see the shell where service is running for logging, prints and error messages. You can also access the RabbitMQ dashboard to see if there is some message in process there. + +There is a lot of more advanced things you can do with Nameko framework you can find more information on + +Let's Micro Serve! + + +-------------------------------------------------------------------------------- + +via: http://brunorocha.org/python/microservices-with-python-rabbitmq-and-nameko.html + +作者: [Bruno Rocha][a] +译者: [译者ID](https://github.com/译者ID) +校对: [校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://facebook.com/rochacbruno +[1]:http://martinfowler.com/articles/microservices.html From 0b346375d6a8e41c231f5708917daf7de5a63d20 Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 4 Jul 2016 23:03:33 +0800 Subject: [PATCH 1068/1469] =?UTF-8?q?20160704-7=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...20 Detecting cats in images with OpenCV.md | 231 ++++++++++++++++++ 1 file changed, 231 insertions(+) create mode 100644 sources/tech/20160620 Detecting cats in images with OpenCV.md diff --git a/sources/tech/20160620 Detecting cats in images with OpenCV.md b/sources/tech/20160620 Detecting cats in images with OpenCV.md new file mode 100644 index 0000000000..37a3ce7fc2 --- /dev/null +++ b/sources/tech/20160620 Detecting cats in images with OpenCV.md @@ -0,0 +1,231 @@ +Detecting cats in images with OpenCV +======================================= + +![](http://www.pyimagesearch.com/wp-content/uploads/2016/05/cat_face_detector_result_04.jpg) + +Did you know that OpenCV can detect cat faces in images…right out-of-the-box with no extras? + +I didn’t either. + +But after [Kendrick Tan broke the story][1], I had to check it out for myself…and do a little investigative work to see how this cat detector seemed to sneak its way into the OpenCV repository without me noticing (much like a cat sliding into an empty cereal box, just waiting to be discovered). + +In the remainder of this blog post, I’ll demonstrate how to use OpenCV’s cat detector to detect cat faces in images. This same technique can be applied to video streams as well. + +>Looking for the source code to this post? [Jump right to the downloads section][2]. + + +### Detecting cats in images with OpenCV + +If you take a look at the [OpenCV repository][3], specifically within the [haarcascades directory][4] (where OpenCV stores all its pre-trained Haar classifiers to detect various objects, body parts, etc.), you’ll notice two files: + +- haarcascade_frontalcatface.xml +- haarcascade_frontalcatface_extended.xml + +Both of these Haar cascades can be used detecting “cat faces” in images. In fact, I used these very same cascades to generate the example image at the top of this blog post. + +Doing a little investigative work, I found that the cascades were trained and contributed to the OpenCV repository by the legendary [Joseph Howse][5] who’s authored a good many tutorials, books, and talks on computer vision. + +In the remainder of this blog post, I’ll show you how to utilize Howse’s Haar cascades to detect cats in images. + +Cat detection code + +Let’s get started detecting cats in images with OpenCV. Open up a new file, name it cat_detector.py , and insert the following code: + +### Detecting cats in images with OpenCVPython + +``` +# import the necessary packages +import argparse +import cv2 + +# construct the argument parse and parse the arguments +ap = argparse.ArgumentParser() +ap.add_argument("-i", "--image", required=True, + help="path to the input image") +ap.add_argument("-c", "--cascade", + default="haarcascade_frontalcatface.xml", + help="path to cat detector haar cascade") +args = vars(ap.parse_args()) +``` + +Lines 2 and 3 import our necessary Python packages while Lines 6-12 parse our command line arguments. We only require a single argument here, the input `--image` that we want to detect cat faces in using OpenCV. + +We can also (optionally) supply a path our Haar cascade via the `--cascade` switch. We’ll default this path to `haarcascade_frontalcatface.xml` and assume you have the `haarcascade_frontalcatface.xml` file in the same directory as your cat_detector.py script. + +Note: I’ve conveniently included the code, cat detector Haar cascade, and example images used in this tutorial in the “Downloads” section of this blog post. If you’re new to working with Python + OpenCV (or Haar cascades), I would suggest downloading the provided .zip file to make it easier to follow along. + +Next, let’s detect the cats in our input image: + +``` +# load the input image and convert it to grayscale +image = cv2.imread(args["image"]) +gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) + +# load the cat detector Haar cascade, then detect cat faces +# in the input image +detector = cv2.CascadeClassifier(args["cascade"]) +rects = detector.detectMultiScale(gray, scaleFactor=1.3, + minNeighbors=10, minSize=(75, 75)) +``` + +On Lines 15 and 16 we load our input image from disk and convert it to grayscale (a normal pre-processing step before passing the image to a Haar cascade classifier, although not strictly required). + +Line 20 loads our Haar cascade from disk (in this case, the cat detector) and instantiates the cv2.CascadeClassifier object. + +Detecting cat faces in images with OpenCV is accomplished on Lines 21 and 22 by calling the detectMultiScale method of the detector object. We pass four parameters to the detectMultiScale method, including: + +1. Our image, gray , that we want to detect cat faces in. +2.A scaleFactor of our [image pyramid][6] used when detecting cat faces. A larger scale factor will increase the speed of the detector, but could harm our true-positive detection accuracy. Conversely, a smaller scale will slow down the detection process, but increase true-positive detections. However, this smaller scale can also increase the false-positive detection rate as well. See the “A note on Haar cascades” section of this blog post for more information. +3. The minNeighbors parameter controls the minimum number of detected bounding boxes in a given area for the region to be considered a “cat face”. This parameter is very helpful in pruning false-positive detections. +4. Finally, the minSize parameter is pretty self-explanatory. This value ensures that each detected bounding box is at least width x height pixels (in this case, 75 x 75). + +The detectMultiScale function returns rects , a list of 4-tuples. These tuples contain the (x, y)-coordinates and width and height of each detected cat face. + +Finally, let’s draw a rectangle surround each cat face in the image: + +``` +# loop over the cat faces and draw a rectangle surrounding each +for (i, (x, y, w, h)) in enumerate(rects): + cv2.rectangle(image, (x, y), (x + w, y + h), (0, 0, 255), 2) + cv2.putText(image, "Cat #{}".format(i + 1), (x, y - 10), + cv2.FONT_HERSHEY_SIMPLEX, 0.55, (0, 0, 255), 2) + +# show the detected cat faces +cv2.imshow("Cat Faces", image) +cv2.waitKey(0) +``` + +Given our bounding boxes (i.e., rects ), we loop over each of them individually on Line 25. + +We then draw a rectangle surrounding each cat face on Line 26, while Lines 27 and 28 displays an integer, counting the number of cats in the image. + +Finally, Lines 31 and 32 display the output image to our screen. + +### Cat detection results + +To test our OpenCV cat detector, be sure to download the source code to this tutorial using the “Downloads” section at the bottom of this post. + +Then, after you have unzipped the archive, you should have the following three files/directories: + +1. cat_detector.py : Our Python + OpenCV script used to detect cats in images. +2. haarcascade_frontalcatface.xml : The cat detector Haar cascade. +3. images : A directory of testing images that we’re going to apply the cat detector cascade to. + +From there, execute the following command: + +Detecting cats in images with OpenCVShell + +``` +$ python cat_detector.py --image images/cat_01.jpg +``` + +![](http://www.pyimagesearch.com/wp-content/uploads/2016/05/cat_face_detector_result_01.jpg) +>Figure 1: Detecting a cat face in an image, even with parts of the cat occluded + +Notice that we have been able to detect the cat face in the image, even though the rest of its body is obscured. + +Let’s try another image: + +``` +python cat_detector.py --image images/cat_02.jpg +``` + +![](http://www.pyimagesearch.com/wp-content/uploads/2016/05/cat_face_detector_result_02.jpg) +>Figure 2: A second example of detecting a cat in an image with OpenCV, this time the cat face is slightly different + +This cat’s face is clearly different from the other one, as it’s in the middle of a “meow”. In either case, the cat detector cascade is able to correctly find the cat face in the image. + +The same is true for this image as well: + +``` +$ python cat_detector.py --image images/cat_03.jpg +``` + +![](http://www.pyimagesearch.com/wp-content/uploads/2016/05/cat_face_detector_result_03.jpg) +>Figure 3: Cat detection with OpenCV and Python + +Our final example demonstrates detecting multiple cats in an image using OpenCV and Python: + +``` +$ python cat_detector.py --image images/cat_04.jpg +``` + +![](http://www.pyimagesearch.com/wp-content/uploads/2016/05/cat_face_detector_result_04.jpg) +>Figure 4: Detecting multiple cats in the same image with OpenCV + +Note that the Haar cascade can return bounding boxes in an order that you may not like. In this case, the middle cat is actually labeled as the third cat. You can resolve this “issue” by sorting the bounding boxes according to their (x, y)-coordinates for a consistent ordering. + +#### A quick note on accuracy + +It’s important to note that in the comments section of the .xml files, Joseph Howe details that the cat detector Haar cascades can report cat faces where there are actually human faces. + +In this case, he recommends performing both face detection and cat detection, then discarding any cat bounding boxes that overlap with the face bounding boxes. + +#### A note on Haar cascades + +First published in 2001 by Paul Viola and Michael Jones, [Rapid Object Detection using a Boosted Cascade of Simple Features][7], this original work has become one of the most cited papers in computer vision. + +This algorithm is capable of detecting objects in images, regardless of their location and scale. And perhaps most intriguing, the detector can run in real-time on modern hardware. + +In their paper, Viola and Jones focused on training a face detector; however, the framework can also be used to train detectors for arbitrary “objects”, such as cars, bananas, road signs, etc. + +#### The problem? + +The biggest problem with Haar cascades is getting the detectMultiScale parameters right, specifically scaleFactor and minNeighbors . You can easily run into situations where you need to tune both of these parameters on an image-by-image basis, which is far from ideal when utilizing an object detector. + +The scaleFactor variable controls your [image pyramid][8] used to detect objects at various scales of an image. If your scaleFactor is too large, then you’ll only evaluate a few layers of the image pyramid, potentially leading to you missing objects at scales that fall in between the pyramid layers. + +On the other hand, if you set scaleFactor too low, then you evaluate many pyramid layers. This will help you detect more objects in your image, but it (1) makes the detection process slower and (2) substantially increases the false-positive detection rate, something that Haar cascades are known for. + +To remember this, we often apply [Histogram of Oriented Gradients + Linear SVM detection][9] instead. + +The HOG + Linear SVM framework parameters are normally much easier to tune — and best of all, HOG + Linear SVM enjoys a much smaller false-positive detection rate. The only downside is that it’s harder to get HOG + Linear SVM to run in real-time. + +### Interested in learning more about object detection? + +![](http://www.pyimagesearch.com/wp-content/uploads/2016/05/custom_object_detector_example.jpg) +>Figure 5: Learn how to build custom object detectors inside the PyImageSearch Gurus course. + +If you’re interested in learning how to train your own custom object detectors, be sure to take a look at the PyImageSearch Gurus course. + +Inside the course, I have 15 lessons covering 168 pages of tutorials dedicated to teaching you how to build custom object detectors from scratch. You’ll discover how to detect road signs, faces, cars (and nearly any other object) in images by applying the HOG + Linear SVM framework for object detection. + +To learn more about the PyImageSearch Gurus course (and grab 10 FREE sample lessons), just click the button below: + +### Summary + +In this blog post, we learned how to detect cats in images using the default Haar cascades shipped with OpenCV. These Haar cascades were trained and contributed to the OpenCV project by [Joseph Howse][9], and were originally brought to my attention [in this post][10] by Kendrick Tan. + +While Haar cascades are quite useful, we often use HOG + Linear SVM instead, as it’s a bit easier to tune the detector parameters, and more importantly, we can enjoy a much lower false-positive detection rate. + +I detail how to build custom HOG + Linear SVM object detectors to recognize various objects in images, including cars, road signs, and much more [inside the PyImageSearch Gurus course][11]. + +Anyway, I hope you enjoyed this blog post! + +Before you go, be sure to signup for the PyImageSearch Newsletter using the form below to be notified when new blog posts are published. + +-------------------------------------------------------------------------------- + +via: http://www.pyimagesearch.com/2016/06/20/detecting-cats-in-images-with-opencv/ + +作者:[Adrian Rosebrock][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.pyimagesearch.com/author/adrian/ +[1]: http://kendricktan.github.io/find-cats-in-photos-using-computer-vision.html +[2]: http://www.pyimagesearch.com/2016/06/20/detecting-cats-in-images-with-opencv/# +[3]: https://github.com/Itseez/opencv +[4]: https://github.com/Itseez/opencv/tree/master/data/haarcascades +[5]: http://nummist.com/ +[6]: http://www.pyimagesearch.com/2015/03/16/image-pyramids-with-python-and-opencv/ +[7]: https://www.cs.cmu.edu/~efros/courses/LBMV07/Papers/viola-cvpr-01.pdf +[8]: http://www.pyimagesearch.com/2015/03/16/image-pyramids-with-python-and-opencv/ +[9]: http://www.pyimagesearch.com/2014/11/10/histogram-oriented-gradients-object-detection/ +[10]: http://kendricktan.github.io/find-cats-in-photos-using-computer-vision.html +[11]: https://www.pyimagesearch.com/pyimagesearch-gurus/ + + + From 65d69dc85245aa256e43c3b2ec8c8f7a22ca0f8b Mon Sep 17 00:00:00 2001 From: Chunyang Wen Date: Tue, 5 Jul 2016 10:25:36 +0800 Subject: [PATCH 1069/1469] Translating: How to Hide Linux Command Line History by Going Incognito chunyang-wen (#4140) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * âFinish tranlating awk series part4 * Update Part 4 - How to Use Comparison Operators with Awk in Linux.md * translating: How to Hide Linux Command Line History by Going Incognito --- ... How to Hide Linux Command Line History by Going Incognito.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160625 How to Hide Linux Command Line History by Going Incognito.md b/sources/tech/20160625 How to Hide Linux Command Line History by Going Incognito.md index 274ff3b175..0d5ce6e6e1 100644 --- a/sources/tech/20160625 How to Hide Linux Command Line History by Going Incognito.md +++ b/sources/tech/20160625 How to Hide Linux Command Line History by Going Incognito.md @@ -1,3 +1,4 @@ +chunyang-wen translating How to Hide Linux Command Line History by Going Incognito ================================================================ From 79c2a31368988fdd76532ee653585b8ceba5bd49 Mon Sep 17 00:00:00 2001 From: Johnny Liao Date: Tue, 5 Jul 2016 10:44:43 +0800 Subject: [PATCH 1070/1469] Update 20160623 Advanced Image Processing with Python.md [Translating] Advanced Image Processing with Python --- sources/tech/20160623 Advanced Image Processing with Python.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160623 Advanced Image Processing with Python.md b/sources/tech/20160623 Advanced Image Processing with Python.md index b431eb72f4..0a3a722845 100644 --- a/sources/tech/20160623 Advanced Image Processing with Python.md +++ b/sources/tech/20160623 Advanced Image Processing with Python.md @@ -1,3 +1,5 @@ +Johnny-Liao translating... + Advanced Image Processing with Python ====================================== From ac384892ccaa5920a5585ab3661c2f461393d26f Mon Sep 17 00:00:00 2001 From: Xin Wang <2650454635@qq.com> Date: Tue, 5 Jul 2016 11:04:17 +0800 Subject: [PATCH 1071/1469] Update 20160629 USE TASK MANAGER EQUIVALENT IN LINUX.md --- sources/tech/20160629 USE TASK MANAGER EQUIVALENT IN LINUX.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160629 USE TASK MANAGER EQUIVALENT IN LINUX.md b/sources/tech/20160629 USE TASK MANAGER EQUIVALENT IN LINUX.md index 91488f82cf..aa1e999f50 100644 --- a/sources/tech/20160629 USE TASK MANAGER EQUIVALENT IN LINUX.md +++ b/sources/tech/20160629 USE TASK MANAGER EQUIVALENT IN LINUX.md @@ -1,3 +1,4 @@ +xinglianfly translate USE TASK MANAGER EQUIVALENT IN LINUX ==================================== From 10e5d95d9c2eb23efbd600fac4495a6e9011f6f5 Mon Sep 17 00:00:00 2001 From: gitfuture Date: Tue, 5 Jul 2016 12:39:34 +0800 Subject: [PATCH 1072/1469] finish translating by GitFuture --- ...P 2.0 Support for Nginx on Ubuntu 16.04.md | 304 ------------------ ...P 2.0 Support for Nginx on Ubuntu 16.04.md | 302 +++++++++++++++++ 2 files changed, 302 insertions(+), 304 deletions(-) delete mode 100644 sources/tech/20160530 Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md create mode 100644 translated/tech/20160530 Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md diff --git a/sources/tech/20160530 Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md b/sources/tech/20160530 Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md deleted file mode 100644 index acb98b2d20..0000000000 --- a/sources/tech/20160530 Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md +++ /dev/null @@ -1,304 +0,0 @@ -Translating by GitFuture - -Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04 -===================================================================================== - - -The LEMP stack is an acronym which represents is a group of packages (Linux OS, Nginx web server, MySQL\MariaDB database and PHP server-side dynamic programming language) which are used to deploy dynamic web applications and web pages. - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Install-Nginx-with-FastCGI-on-Ubuntu-16.04.png) ->Install Nginx with MariaDB 10, PHP 7 and HTTP 2.0 Support on Ubuntu 16.04 - -This tutorial will guide you on how to install a LEMP stack (Nginx with MariaDB and PHP7) on Ubuntu 16.04 server. - -Requirements - -[Installation of Ubuntu 16.04 Server Edition][1] - -### Step 1: Install the Nginx Web Server - -#### 1. Nginx is a modern and resources efficient web server used to display web pages to visitors on the internet. We’ll start by installing Nginx web server from Ubuntu official repositories by using the [apt command line][2]. - -``` -$ sudo apt-get install nginx -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Install-Nginx-on-Ubuntu-16.04.png) ->Install Nginx on Ubuntu 16.04 - -#### 2. Next, issue the [netstat][3] and [systemctl][4] commands in order to confirm if Nginx is started and binds on port 80. - -``` -$ netstat -tlpn -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Check-Nginx-Network-Port-Connection.png) ->Check Nginx Network Port Connection - -``` -$ sudo systemctl status nginx.service -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Check-Nginx-Service-Status.png) ->Check Nginx Service Status - -Once you have the confirmation that the server is started you can open a browser and navigate to your server IP address or DNS record using HTTP protocol in order to visit Nginx default web page. - -``` -http://IP-Address -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Verify-Nginx-Webpage.png) ->Verify Nginx Webpage - -### Step 2: Enable Nginx HTTP/2.0 Protocol - -#### 3. The HTTP/2.0 protocol which is build by default in the latest release of Nginx binaries on Ubuntu 16.04 works only in conjunction with SSL and promises a huge speed improvement in loading web SSL web pages. - -To enable the protocol in Nginx on Ubuntu 16.04, first navigate to Nginx available sites configuration files and backup the default configuration file by issuing the below command. - -``` -$ cd /etc/nginx/sites-available/ -$ sudo mv default default.backup -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Backup-Nginx-Sites-Configuration-File.png) ->Backup Nginx Sites Configuration File - -#### 4. Then, using a text editor create a new default page with the below instructions: - -``` -server { - listen 443 ssl http2 default_server; - listen [::]:443 ssl http2 default_server; - - root /var/www/html; - - index index.html index.htm index.php; - - server_name 192.168.1.13; - - location / { - try_files $uri $uri/ =404; - } - - ssl_certificate /etc/nginx/ssl/nginx.crt; - ssl_certificate_key /etc/nginx/ssl/nginx.key; - - ssl_protocols TLSv1 TLSv1.1 TLSv1.2; - ssl_prefer_server_ciphers on; - ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5; - ssl_dhparam /etc/nginx/ssl/dhparam.pem; - ssl_session_cache shared:SSL:20m; - ssl_session_timeout 180m; - resolver 8.8.8.8 8.8.4.4; - add_header Strict-Transport-Security "max-age=31536000; - #includeSubDomains" always; - - - location ~ \.php$ { - include snippets/fastcgi-php.conf; - fastcgi_pass unix:/run/php/php7.0-fpm.sock; - } - - location ~ /\.ht { - deny all; - } - -} - -server { - listen 80; - listen [::]:80; - server_name 192.168.1.13; - return 301 https://$server_name$request_uri; -} -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Enable-Nginx-HTTP-2-Protocol.png) ->Enable Nginx HTTP 2 Protocol - -The above configuration snippet enables the use of `HTTP/2.0` by adding the http2 parameter to all SSL listen directives. - -Also, the last part of the excerpt enclosed in server directive is used to redirect all non-SSL traffic to SSL/TLS default host. Also, replace the `server_name` directive to match your own IP address or DNS record (FQDN preferably). - -#### 5. Once you finished editing Nginx default configuration file with the above settings, generate and list the SSL certificate file and key by executing the below commands. - -Fill the certificate with your own custom settings and pay attention to Common Name setting to match your DNS FQDN record or your server IP address that will be used to access the web page. - -``` -$ sudo mkdir /etc/nginx/ssl -$ sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/ssl/nginx.key -out /etc/nginx/ssl/nginx.crt -$ ls /etc/nginx/ssl/ -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Generate-SSL-Certificate-and-Key.png) ->Generate SSL Certificate and Key for Nginx - -#### 6. Also, create a strong DH cypher, which was changed on the above configuration file on `ssl_dhparam` instruction line, by issuing the below command: - -``` -$ sudo openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Create-Diffie-Hellman-Key.png) ->Create Diffie-Hellman Key - -#### 7. Once the `Diffie-Hellman` key has been created, verify if Nginx configuration file is correctly written and can be applied by Nginx web server and restart the daemon to reflect changes by running the below commands. - -``` -$ sudo nginx -t -$ sudo systemctl restart nginx.service -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Check-Nginx-Configuration.png) ->Check Nginx Configuration - -#### 8. In order to test if Nginx uses HTTP/2.0 protocol issue the below command. The presence of `h2` advertised protocol confirms that Nginx has been successfully configured to use HTTP/2.0 protocol. All modern up-to-date browsers should support this protocol by default. - -``` -$ openssl s_client -connect localhost:443 -nextprotoneg '' -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Test-Nginx-HTTP-2-Protocol.png) ->Test Nginx HTTP 2.0 Protocol - -### Step 3: Install PHP 7 Interpreter - -Nginx can be used with PHP dynamic processing language interpreter to generate dynamic web content with the help of FastCGI process manager obtained by installing the php-fpm binary package from Ubuntu official repositories. - -#### 9. In order to grab PHP7.0 and the additional packages that will allow PHP to communicate with Nginx web server issue the below command on your server console: - -``` -$ sudo apt install php7.0 php7.0-fpm -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Install-PHP-7-PHP-FPM-for-Ngin.png) ->Install PHP 7 and PHP-FPM for Ngin - -#### 10. Once the PHP7.0 interpreter has been successfully installed on your machine, start and check php7.0-fpm daemon by issuing the below command: - -``` -$ sudo systemctl start php7.0-fpm -$ sudo systemctl status php7.0-fpm -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Start-Verify-php-fpm-Service.png) ->Start and Verify php-fpm Service - -#### 11. The current configuration file of Nginx is already configured to use PHP FastCGI process manager in order to server dynamic content. - -The server block that enables Nginx to use PHP interpreter is presented on the below excerpt, so no further modifications of default Nginx configuration file are required. - -``` -location ~ \.php$ { - include snippets/fastcgi-php.conf; - fastcgi_pass unix:/run/php/php7.0-fpm.sock; - } -``` - -Below is a screenshot of what instructions you need to uncomment and modify is case of an original Nginx default configuration file. - - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Enable-PHP-FastCGI-for-Nginx.png) ->Enable PHP FastCGI for Nginx - -#### 12. To test Nginx web server relation with PHP FastCGI process manager create a PHP `info.php` test configuration file by issuing the below command and verify the settings by visiting this configuration file using the below address: `http://IP_or domain/info.php`. - -``` -$ sudo su -c 'echo "" |tee /var/www/html/info.php' -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Create-PHP-Info-File.png) ->Create PHP Info File - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Verify-PHP-FastCGI-Info.png) ->Verify PHP FastCGI Info - -Also check if HTTP/2.0 protocol is advertised by the server by locating the line `$_SERVER[‘SERVER_PROTOCOL’]` on PHP Variables block as illustrated on the below screenshot. - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Check-HTTP-2.0-Protocol-Info.png) ->Check HTTP 2.0 Protocol Info - -#### 13. In order to install extra PHP7.0 modules use the `apt search php7.0` command to find a PHP module and install it. - -Also, try to install the following PHP modules which can come in handy in case you are planning to [install WordPress][5] or other CMS. - -``` -$ sudo apt install php7.0-mcrypt php7.0-mbstring -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Install-PHP-7-Modules.png) ->Install PHP 7 Modules - -#### 14. To register the PHP extra modules just restart PHP-FPM daemon by issuing the below command. - -``` -$ sudo systemctl restart php7.0-fpm.service -``` - -### Step 4: Install MariaDB Database - -#### 15. Finally, in order to complete our LEMP stack we need the MariaDB database component to store and manage website data. - -Install MariaDB database management system by running the below command and restart PHP-FPM service in order to use MySQL module to access the database. - -``` -$ sudo apt install mariadb-server mariadb-client php7.0-mysql -$ sudo systemctl restart php7.0-fpm.service -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Install-MariaDB-for-Nginx.png) ->Install MariaDB for Nginx - -#### 16. To secure the MariaDB installation, run the security script provided by the binary package from Ubuntu repositories which will ask you set a root password, remove anonymous users, disable root login remotely and remove test database. - -Run the script by issuing the below command and answer all questions with yes. Use the below screenshot as a guide. - -``` -$ sudo mysql_secure_installation -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Secure-MariaDB-Installation-for-Nginx.png) ->Secure MariaDB Installation for Nginx - -#### 17. To configure MariaDB so that ordinary users can access the database without system sudo privileges, go to MySQL command line interface with root privileges and run the below commands on MySQL interpreter: - -``` -$ sudo mysql -MariaDB> use mysql; -MariaDB> update user set plugin=’‘ where User=’root’; -MariaDB> flush privileges; -MariaDB> exit -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/05/MariaDB-User-Permissions.png) ->MariaDB User Permissions - -Finally, login to MariaDB database and run an arbitrary command without root privileges by executing the below command: - -``` -$ mysql -u root -p -e 'show databases' -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Check-MariaDB-Databases.png) ->Check MariaDB Databases - -That’ all! Now you have a **LEMP** stack configured on **Ubuntu 16.04** server that allows you to deploy complex dynamic web applications that can interact with databases. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/install-nginx-mariadb-php7-http2-on-ubuntu-16-04/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tecmint+%28Tecmint%3A+Linux+Howto%27s+Guide%29 - -作者:[Matei Cezar ][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://www.tecmint.com/author/cezarmatei/ -[1]: http://www.tecmint.com/installation-of-ubuntu-16-04-server-edition/ -[2]: http://www.tecmint.com/apt-advanced-package-command-examples-in-ubuntu/ -[3]: http://www.tecmint.com/20-netstat-commands-for-linux-network-management/ -[4]: http://www.tecmint.com/manage-services-using-systemd-and-systemctl-in-linux/ -[5]: http://www.tecmint.com/install-wordpress-using-lamp-or-lemp-on-rhel-centos-fedora/ diff --git a/translated/tech/20160530 Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md b/translated/tech/20160530 Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md new file mode 100644 index 0000000000..f432833a50 --- /dev/null +++ b/translated/tech/20160530 Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md @@ -0,0 +1,302 @@ +在 Ubuntu 16.04 为 Nginx 服务器安装 LEMP 环境(MariaDB, PHP 7 并且支持 HTTP 2.0) +===================== + +LEMP 是字首组合词,代表一组软件包(Linux OS,Nginx 网络服务器,MySQL\MariaDB 数据库和 PHP 服务端动态编程语言),它被用来搭建动态的网络应用和网页。 + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Install-Nginx-with-FastCGI-on-Ubuntu-16.04.png) +>在 Ubuntu 16.04 安装 Nginx 以及 MariaDB,PHP7 并且支持 HTTP 2.0 + +这篇教程会教你怎么在 Ubuntu 16.04 的服务器上安装 LEMP (Nginx 和 MariaDB 以及 PHP7)。 + +准备 + +[安装 Ubuntu 16.04 服务器版本][1] + +### 步骤 1:安装 Nginx 服务器 + +#### 1. Nginx 是一个先进的、资源优化的网络服务器程序,用来向因特网上的访客展示网页。我们从 Nginx 服务器的安装开始介绍,使用 [apt 命令][2] 从 Ubuntu 的官方软件仓库中获取 Nginx 程序。 + +``` +$ sudo apt-get install nginx +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Install-Nginx-on-Ubuntu-16.04.png) +>在 Ubuntu 16.04 安装 Nginx + +#### 2. 然后输入 [netstat][3] 和 [systemctl][4] 命令,确认 Nginx 进程已经启动并且绑定在 80 端口。 + +``` +$ netstat -tlpn +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Check-Nginx-Network-Port-Connection.png) +>检查 Nginx 网络端口连接 + +``` +$ sudo systemctl status nginx.service +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Check-Nginx-Service-Status.png) +>检查 Nginx 服务状态 + +当你确认服务进程已经启动了,你可以打开一个浏览器,使用 HTTP 协议访问你的服务器 IP 地址或者域名,浏览 Nginx 的默认网页。 + +``` +http://IP-Address +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Verify-Nginx-Webpage.png) +>验证 Nginx 网页 + +### 步骤 2:启用 Nginx HTTP/2.0 协议 + +#### 3. HTTP/2.0 协议默认包含在 Ubuntu 16.04 最新发行版的 Nginx 二进制文件中,它只能通过 SSL 连接并且保证加载网页的速度有巨大提升。 + +要启用Nginx 的这个协议,首先找到 Nginx 提供的网站配置文件,输入下面这个命令备份配置文件。 + +``` +$ cd /etc/nginx/sites-available/ +$ sudo mv default default.backup +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Backup-Nginx-Sites-Configuration-File.png) +>备份 Nginx 的网站配置文件 + +#### 4. 然后,用文本编辑器新建一个默认文件,输入以下内容: + +``` +server { + listen 443 ssl http2 default_server; + listen [::]:443 ssl http2 default_server; + + root /var/www/html; + + index index.html index.htm index.php; + + server_name 192.168.1.13; + + location / { + try_files $uri $uri/ =404; + } + + ssl_certificate /etc/nginx/ssl/nginx.crt; + ssl_certificate_key /etc/nginx/ssl/nginx.key; + + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + ssl_prefer_server_ciphers on; + ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5; + ssl_dhparam /etc/nginx/ssl/dhparam.pem; + ssl_session_cache shared:SSL:20m; + ssl_session_timeout 180m; + resolver 8.8.8.8 8.8.4.4; + add_header Strict-Transport-Security "max-age=31536000; + #includeSubDomains" always; + + + location ~ \.php$ { + include snippets/fastcgi-php.conf; + fastcgi_pass unix:/run/php/php7.0-fpm.sock; + } + + location ~ /\.ht { + deny all; + } + +} + +server { + listen 80; + listen [::]:80; + server_name 192.168.1.13; + return 301 https://$server_name$request_uri; +} +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Enable-Nginx-HTTP-2-Protocol.png) +>启用 Nginx HTTP 2 协议 + +上面的配置片段向所有的 SSL 监听指令中添加 http2 参数来启用 `HTTP/2.0`。 + +添加到服务器配置的最后一段,是用来将所有非 SSL 的流量重定向到 SSL/TLS 默认主机。然后用你主机的 IP 地址或者 DNS 记录(优先 FQDN)替换掉 `server_name` 选项。 (directive 的翻译是指令,但我觉得翻译成选项更好) + +#### 5. 当你按照以上步骤编辑完 Nginx 的默认配置文件之后,用下面这些命令来生成、查看 SSL 证书和密钥。 + +用你自定义的设置完成证书的制作,注意常用名设置成和你的 DNS FQDN 记录或者服务器 IP 地址相匹配,DNS 记录或者 IP 地址是用来访问网页的。 + + +``` +$ sudo mkdir /etc/nginx/ssl +$ sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/ssl/nginx.key -out /etc/nginx/ssl/nginx.crt +$ ls /etc/nginx/ssl/ +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Generate-SSL-Certificate-and-Key.png) +>生成 Nginx 的 SSL 证书和密钥 + +#### 6. 通过输入以下命令使用一个强 DH 加密算法,在之前的配置文件 `ssl_dhparam` 这一行中进行修改。 + +``` +$ sudo openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Create-Diffie-Hellman-Key.png) +>创建 Diffie-Hellman 密钥 + +#### 7. 当 `Diffie-Hellman` 密钥生成之后,验证 Nginx 的配置文件是否正确、能否被 Nginx 网络服务程序应用。然后运行以下命令重启守护进程来观察有什么变化。 + +``` +$ sudo nginx -t +$ sudo systemctl restart nginx.service +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Check-Nginx-Configuration.png) +>检查 Nginx 的配置 + +#### 8. 键入下面的命令来测试 Nginx 使用的是 HTTP/2.0 协议。看到协议中有 `h2` 的话,表明 Nginx 已经成功配置使用 HTTP/2.0 协议。所有最新的浏览器默认都能够支持这个协议。 + +``` +$ openssl s_client -connect localhost:443 -nextprotoneg '' +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Test-Nginx-HTTP-2-Protocol.png) +>测试 Nginx HTTP 2.0 协议 + +### 第 3 步:安装 PHP 7 解释器 + +通过 FastCGI 进程管理程序的协助,Nginx 能够使用 PHP 动态语言解释器生成动态网络内容。FastCGI 能够从 Ubuntu 官方仓库中安装 php-fpm 二进制包来获取。 + +#### 9. 在你的服务器控制台里输入下面的命令来获取 PHP7.0 和扩展包,这能够让 PHP 与 Nginx 网络服务进程通信, + +``` +$ sudo apt install php7.0 php7.0-fpm +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Install-PHP-7-PHP-FPM-for-Ngin.png) +>安装 PHP 7 以及 PHP-FPM + +#### 10. 当 PHP7.0 解释器安装成功后,输入以下命令启动或者检查 php7.0-fpm 守护进程: + +``` +$ sudo systemctl start php7.0-fpm +$ sudo systemctl status php7.0-fpm +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Start-Verify-php-fpm-Service.png) +>开启、验证 php-fpm 服务 + +#### 11. 当前的 Nginx 配置文件已经配置了使用 PHP FPM 来提供动态内容。 + +下面给出的这部分服务器配置让 Nginx 能够使用 PHP 解释器,所以不需要对 Nginx 配置文件作别的修改。 + +``` +location ~ \.php$ { + include snippets/fastcgi-php.conf; + fastcgi_pass unix:/run/php/php7.0-fpm.sock; + } +``` + +下面是的截图是 Nginx 默认配置文件的内容。你可能需要对其中的代码进行修改或者取消注释。 + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Enable-PHP-FastCGI-for-Nginx.png) +>启用 PHP FastCGI + +#### 12. 要测试启用了 PHP-FPM 的 Nginx 服务器,用下面的命令创建一个 PHP 测试配置文件 `info.php`。接着用 `http://IP_or domain/info.php` 这个网址来查看配置。 + +``` +$ sudo su -c 'echo "" |tee /var/www/html/info.php' +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Create-PHP-Info-File.png) +>创建 PHP Info 文件 + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Verify-PHP-FastCGI-Info.png) +>检查 PHP FastCGI 的信息 + +检查服务器是否应用 HTTP/2.0 协议,定位到 PHP 变量区域中的 `$_SERVER[‘SERVER_PROTOCOL’]` 就像下面这张截图一样。(advertised by server 翻译不清楚,这里翻译成服务器应用了 HTTP/2.0 协议) + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Check-HTTP-2.0-Protocol-Info.png) +>检查 HTTP2.0 协议信息 + +#### 13. 为了安装其它的 PHP7.0 模块,使用 `apt search php7.0` 命令查找 php 的模块然后安装。 + +如果你想要 [安装 WordPress][5] 或者别的 CMS,需要安装以下的 PHP 模块,这些模块迟早有用。 + +``` +$ sudo apt install php7.0-mcrypt php7.0-mbstring +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Install-PHP-7-Modules.png) +>安装 PHP 7 模块 + +#### 14. 注册 PHP 额外的模块,输入下面的命令重启 PHP-FPM 守护进程。 + +``` +$ sudo systemctl restart php7.0-fpm.service +``` + +### 第 4 步:安装 MariaDB 数据库 + +#### 15. 最后,我们需要 MariaDB 数据库来存储、管理网站数据来完成搭建 LEMP + +运行下面的命令安装 MariaDB 数据库管理系统,重启 PHP-FPM 服务使用 MySQL 模块与数据库通信。 + +``` +$ sudo apt install mariadb-server mariadb-client php7.0-mysql +$ sudo systemctl restart php7.0-fpm.service +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Install-MariaDB-for-Nginx.png) +>安装 MariaDB + +#### 16. 为了保证 MariaDB 的安装,运行来自 Ubuntu 软件仓库中的二进制包提供的安全脚本,这会询问你设置一个根用户密码,移除匿名用户,禁用根用户远程登陆,移除测试数据库。 + +输入下面的命令运行脚本,并且确认所有的选择。参照下面的截图。 + +``` +$ sudo mysql_secure_installation +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Secure-MariaDB-Installation-for-Nginx.png) +>MariaDB 的安全安装 + + +#### 17. 配置 MariaDB 以便普通用户能够不使用 系统的 sudo 权限来访问数据库。用根用户权限打开 MySQL 命令行界面,运行下面的命令: + +``` +$ sudo mysql +MariaDB> use mysql; +MariaDB> update user set plugin=’‘ where User=’root’; +MariaDB> flush privileges; +MariaDB> exit +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/MariaDB-User-Permissions.png) +>MariaDB 的用户权限 + +最后登陆到 MariaDB 数据库,通过以下命令不使用 root 权限执行任意一个命令: + +``` +$ mysql -u root -p -e 'show databases' +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Check-MariaDB-Databases.png) +>查看 MariaDB 数据库 + +好了!现在你拥有了配置在 **Ubuntu 16.04** 服务器上的 **LEMP** 环境,你能够部署能够与数据库交互的复杂动态网络应用。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/install-nginx-mariadb-php7-http2-on-ubuntu-16-04/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tecmint+%28Tecmint%3A+Linux+Howto%27s+Guide%29 + +作者:[Matei Cezar ][a] +译者:[GitFuture](https://github.com/GitFuture) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.tecmint.com/author/cezarmatei/ +[1]: http://www.tecmint.com/installation-of-ubuntu-16-04-server-edition/ +[2]: http://www.tecmint.com/apt-advanced-package-command-examples-in-ubuntu/ +[3]: http://www.tecmint.com/20-netstat-commands-for-linux-network-management/ +[4]: http://www.tecmint.com/manage-services-using-systemd-and-systemctl-in-linux/ +[5]: http://www.tecmint.com/install-wordpress-using-lamp-or-lemp-on-rhel-centos-fedora/ From c1984135e0fe5ba67cc39442f562b7d0c8aa0ffc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E5=AE=B6=E6=9C=AA?= Date: Tue, 5 Jul 2016 13:20:24 +0800 Subject: [PATCH 1073/1469] Translating by GitFuture --- sources/tech/20160620 Monitor Linux With Netdata.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160620 Monitor Linux With Netdata.md b/sources/tech/20160620 Monitor Linux With Netdata.md index 95156ef108..dfe6920639 100644 --- a/sources/tech/20160620 Monitor Linux With Netdata.md +++ b/sources/tech/20160620 Monitor Linux With Netdata.md @@ -1,3 +1,5 @@ +Translating by GitFuture + Monitor Linux With Netdata === From 5ee075fddd06778e15b0b87a3c3e69492f8cb489 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 5 Jul 2016 19:04:26 +0800 Subject: [PATCH 1074/1469] PUB:20160610 Getting started with ReactOS @name1e5s @PurlingNayuki --- .../20160610 Getting started with ReactOS.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) rename {translated/tech => published}/20160610 Getting started with ReactOS.md (92%) diff --git a/translated/tech/20160610 Getting started with ReactOS.md b/published/20160610 Getting started with ReactOS.md similarity index 92% rename from translated/tech/20160610 Getting started with ReactOS.md rename to published/20160610 Getting started with ReactOS.md index ffeeb9021f..8d04902798 100644 --- a/translated/tech/20160610 Getting started with ReactOS.md +++ b/published/20160610 Getting started with ReactOS.md @@ -1,9 +1,7 @@ ReactOS 新手指南 ==================================== - -ReactOS 是一个比较年轻的开源操作系统,它提供了一个和 Windows NT 类似的图形界面,并且它的目标也是提供一个与 NT 功能和应用程序兼容性差不多的系统。这个项目在没有使用任何 Unix 的情况下实现了一个类似 Wine 的用户模式。它的开发者们从头实现了 NT 的架构以及对于 FAT32 的兼容,因此它也不需要负任何法律责任。这也就是说,它不是又双叒叕一个 Linux 发行版,而是一个独特的类 Windows 系统,并且是开源世界的一部分。这份快速指南是给那些想要一个易于使用的 Windows 的开源替代品的人准备的。 - +ReactOS 是一个比较年轻的开源操作系统,它提供了一个和 Windows NT 类似的图形界面,并且它的目标也是提供一个与 NT 功能和应用程序兼容性差不多的系统。这个项目在没有使用任何 Unix 架构的情况下实现了一个类似 Wine 的用户模式。它的开发者们从头实现了 NT 的架构以及对于 FAT32 的兼容,因此它也不需要负任何法律责任。这也就是说,它不是又双叒叕一个 Linux 发行版,而是一个独特的类 Windows 系统,并且是开源世界的一部分。这份快速指南是给那些想要一个易于使用的 Windows 的开源替代品的人准备的。 ### 安装系统 @@ -31,7 +29,6 @@ ReactOS 是一个比较年轻的开源操作系统,它提供了一个和 Windo 下一步是选择分区的格式,不过现在我们只能选择 FAT32。 - ![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_6.png) 再下一步是选择安装文件夹。我就使用默认的“/ReactOS”了,应该没有问题。 @@ -96,7 +93,7 @@ ReactOS 是一个比较年轻的开源操作系统,它提供了一个和 Windo ![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_20.png) -ReactOS 还有一个好啊,就是我们可以通过“我的电脑”来操作注册表。 +ReactOS 还有一个好的地方,就是我们可以通过“我的电脑”来操作注册表。 ![](https://www.howtoforge.com/images/getting-started-with-eeactos/pic_21.png) From c51449deb46e6a5b8aef7afde9da31ab95e6109d Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 5 Jul 2016 19:48:11 +0800 Subject: [PATCH 1075/1469] PUB:20160620 PowerPC gains an Android 4.4 port with Big Endian support @dongfengweixiao --- ...ndroid 4.4 port with Big Endian support.md | 106 ++++++++++++++++++ ...ndroid 4.4 port with Big Endian support.md | 103 ----------------- 2 files changed, 106 insertions(+), 103 deletions(-) create mode 100644 published/20160620 PowerPC gains an Android 4.4 port with Big Endian support.md delete mode 100644 translated/tech/20160620 PowerPC gains an Android 4.4 port with Big Endian support.md diff --git a/published/20160620 PowerPC gains an Android 4.4 port with Big Endian support.md b/published/20160620 PowerPC gains an Android 4.4 port with Big Endian support.md new file mode 100644 index 0000000000..7ad127370b --- /dev/null +++ b/published/20160620 PowerPC gains an Android 4.4 port with Big Endian support.md @@ -0,0 +1,106 @@ +Android 4.4 移植到了 PowerPC 架构,支持大端架构 +=========================================================== + +eInfochips(一家软件厂商) 已将将 Android 4.4 系统移植到 PowerPC 架构,它将用于一家航空电子客户用来监视引擎的健康状况的人机界面(HMI:Human Machine Interface)。 + +eInfochips 已经开发了第一个面向 PowerPC 架构的 CPU 的 Android 移植版本,并支持大端(Big Endian)架构。此移植基于 Android 开源项目 [Android Open Source Project (AOSP)] 中 Android 4.4 (KitKat) 的代码,其功能内核的版本号为 3.12.19。 + +Android 开始兴起的时候,PowerPC 正在快速丢失和 ARM 架构共同角逐的市场。高端的网络客户和其它的企业级的嵌入式工具大多运行在诸如飞思卡尔(Freescale)的 PowerQUICC 和 QorIQ 这样的 PowerPC 处理器上,但是并不是 Linux 系统。不过,有几个 Android 的移植计划。在 2009 年,飞思卡尔和 Embedded Alley(一家软件厂商,当前是 Mentor Graphics 的 Linux 团队的一部分)[宣布了针对 PowerQUICC 和 QorIQ 芯片的移植版本][15],当前由 NXP 公司构建。另一个名为 [Android-PowerPC][16] 的项目也作出了相似的工作。 + +这些努力来的都并不容易,然而,当航空公司找到 eInfochips,希望能够为他们那些基于 PowerPC 的引擎监控系统添加 Android 应用程序以改善人机界面。该公司找出了这些早期的移植版本,然而,它们都相距甚远。所以,他们不得不从头开始新的移植。 + +最主要的问题是这些移植的 Android 版本实在是太老了,和现在的 Android 差别太大了。Embedded Alley 移植的版本为 Android 1.5 (Cupcake),它于 2009 年发布,Linux 内核版本为 2.6.28。而 Android-PowerPC 项目最后一版的移植是 Android 2.2 (Froyo),它于 2010 年发布,内核版本为 2.6.32。此外,航空公司还有一些额外的技术诉求,例如对大端架构(Big Endian)的支持,这种老式的内存访问方式仍旧应用于网络通信和电信行业。然而那些早期的移植版本仅能够支持小端(Little Endian)的内存访问。 + +### 来自 eInfochips 的全新 PowerPC 架构移植 + +eInfochips, 它最为出名的应该是那些基于 ARM/骁龙处理器的模块计算机板卡,例如 [Eragon 600][17]。 它已经完成了基于 QorIQ 的 Android 4.4 系统移植,且发布了白皮书介绍了该项目。采用该项目的航空电子设备客户仍旧不愿透露名称,目前仍旧不清楚什么时候会公开此该移植版本。 + +![](http://files.linuxgizmos.com/einfochips_porting_android_on_powerpc.jpg) + +*图片来自 eInfochips 的博客日志* + +全新的 PowerPC Android 项目包括: + +- 基于 PowerPC [e5500][1] 仿生定制 +- 基于 Android KitKat 的大端支持 +- 使用 GCC 5.2 工具链开发 +- Android 4.4 框架的 PowerPC 支持 +- PowerPC e5500 的 Android 内核版本为 3.12.19 + +根据 eInfochips 的销售经理 Sooryanarayanan Balasubramanian 描述,该航空电子客户想要使用 Android 主要是因为熟悉的界面能够缩减培训的时间,并且让程序更新和增加新程序变得更加容易。他继续解释说:“这次成功的移植了 Android,使得今后的工作仅仅需要在应用层作出修修改改,而不再向以前一样需要在所有层面之间作相互的校验。”,“这是第一次在航空航天工业作出这些尝试,这需要在设计时尽量认真。” + +通过白皮书,可以知道将 Android 移植到 PowerPC 上需要对框架、核心库、开发工具链、运行时链接器、对象链接器和开源编译工具作出大量的修改。在字节码生成阶段,移植团队决定使用便携模式(portable mode)而不是快速解释模式(fast interpreter mode)。这是因为还没有 PowerPC 可用的快速解释模式,而使用开源的 [libffi][18] 的便携模式能够支持 PowerPC。 + +同时,团队还面临着在 Android 运行时 (ART) 环境和 Dalvik 虚拟机 (DVM) 环境之间的选择。他们发现,ART 环境下的便携模式还未经测试且缺乏良好的文档支持,所以最终选择了 DVM 环境下的便携模式。 + +白皮书中还提及了其它的一些在移植过程中遇到的困难,包括重新开发工具链,重写脚本以解决 AOSP 对编译器标志“非标准”使用的问题。最终完成的移植版本提供了 37 个服务,以及提供了无界面的 Android 部署,在前端使用用户空间的模拟 UI。 + + +### 目标硬件 + +感谢来自 [eInfochips 博客日志][2] 的图片(如下图所示),让我们能够确认此 PowerPC 的 Android 移植项目的硬件平台。这个板卡为 [X-ES Xpedite 6101][3],它是一个加固级 XMC/PrPMC 夹层模组。 + +![](http://hackerboards.com/files/xes_xpedite6101-sm.jpg) + +*X-ES Xpedite 6101 照片和框图* + +X-ES Xpedite 6101 板卡拥有一个可选的 NXP 公司基于 QorIQ T 系列通信处理器(T2081、T1042 和 T1022),它们分别集成了 8 个、4 个和 2 个 e6500 核心,稍有不同的是,T2081 的处理器主频为 1.8GHz,T1042/22 的处理器主频为 1.4GHz。所有的核心都集成了 AltiVec SIMD 引擎,这也就意味着它能够提供 DSP 级别的浮点运算性能。所有以上 3 款 X-ES 板卡都能够支持最高 8GB 的 DDR3-1600 ECC SDRAM 内存。外加 512MB NOR 和 32GB 的 NAND 闪存。 + +![](http://hackerboards.com/files/nxp_qoriq_t2081_block-sm.jpg) + +*NXP T2081 框图* + +板卡的 I/O 包括一个 x4 PCI Express Gen2 通道,以及双工的千兆级网卡、 RS232/422/485 串口和 SATA 3.0 接口。此外,它可选 3 款 QorIQ 处理器,Xpedite 6101 提供了三种 [X-ES 加固等级][19],分别是额定工作温度 0 ~ 55°C, -40 ~ 70°C, 或者是 -40 ~ 85°C,且包含 3 类冲击和抗振类别。 + +此外,我们已经介绍过的基于 X-ES QorIQ 的 XMC/PrPMC 板卡包括 [XPedite6401 和 XPedite6370][20],它们支持已有的板卡级 Linux 、风河的 VxWorks(一种实时操作系统) 和 Green Hills 的 Integrity(也是一种操作系统)。 + + +### 更多信息 + +eInfochips Android PowerPC 移植白皮书可以[在此][4]下载(需要先免费注册)。 + +### 相关资料 + +- [Commercial embedded Linux distro boosts virtualization][5] +- [Freescale unveils first ARM-based QorIQ SoCs][6] +- [High-end boards run Linux on 64-bit ARM QorIQ SoCs][7] +- [Free, Open Enea Linux taps Yocto Project and Linaro code][8] +- [LynuxWorks reverts to its LynxOS roots, changes name][9] +- [First quad- and octa-core QorIQ SoCs unveiled][10] +- [Free white paper shows how Linux won embedded][11] +- [Quad-core Snapdragon COM offers three dev kit options][12] +- [Tiny COM runs Linux on quad-core 64-bit Snapdragon 410][13] +- [PowerPC based IoT gateway COM ships with Linux BSP][14] + + +-------------------------------------------------------------------------------- + +via: http://hackerboards.com/powerpc-gains-android-4-4-port-with-big-endian-support/ + +作者:[Eric Brown][a] +译者:[dongfengweixiao](https://github.com/dongfengweixiao) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://hackerboards.com/powerpc-gains-android-4-4-port-with-big-endian-support/ +[1]: http://linuxdevices.linuxgizmos.com/low-cost-powerquicc-chips-offer-flexible-interconnect-options/ +[2]: https://www.einfochips.com/blog/k2-categories/aerospace/presenting-a-case-for-porting-android-on-powerpc-architecture.html +[3]: http://www.xes-inc.com/products/processor-mezzanines/xpedite6101/ +[4]: http://biz.einfochips.com/portingandroidonpowerpc +[5]: http://hackerboards.com/commercial-embedded-linux-distro-boosts-virtualization/ +[6]: http://hackerboards.com/freescale-unveils-first-arm-based-qoriq-socs/ +[7]: http://hackerboards.com/high-end-boards-run-linux-on-64-bit-arm-qoriq-socs/ +[8]: http://hackerboards.com/free-open-enea-linux-taps-yocto-and-linaro-code/ +[9]: http://hackerboards.com/lynuxworks-reverts-to-its-lynxos-roots-changes-name/ +[10]: http://hackerboards.com/first-quad-and-octa-core-qoriq-socs-unveiled/ +[11]: http://hackerboards.com/free-white-paper-shows-how-linux-won-embedded/ +[12]: http://hackerboards.com/quad-core-snapdragon-com-offers-three-dev-kit-options/ +[13]: http://hackerboards.com/tiny-com-runs-linux-and-android-on-quad-core-64-bit-snapdragon-410/ +[14]: http://hackerboards.com/powerpc-based-iot-gateway-com-ships-with-linux-bsp/ +[15]: http://linuxdevices.linuxgizmos.com/android-ported-to-powerpc/ +[16]: http://www.androidppc.com/ +[17]: http://hackerboards.com/quad-core-snapdragon-com-offers-three-dev-kit-options/ +[18]: https://sourceware.org/libffi/ +[19]: http://www.xes-inc.com/capabilities/ruggedization/ +[20]: http://hackerboards.com/high-end-boards-run-linux-on-64-bit-arm-qoriq-socs/ diff --git a/translated/tech/20160620 PowerPC gains an Android 4.4 port with Big Endian support.md b/translated/tech/20160620 PowerPC gains an Android 4.4 port with Big Endian support.md deleted file mode 100644 index 3b450cb603..0000000000 --- a/translated/tech/20160620 PowerPC gains an Android 4.4 port with Big Endian support.md +++ /dev/null @@ -1,103 +0,0 @@ -PowerPC 获得大端 Android 4.4 系统的移植 -=========================================================== - -eInfochips(一家软件厂商) 已将将 Android 4.4 系统移植到 PowerPC 架构,它将作为一家航空电子客户的人机界面(HMI:Human Machine Interface)用来监视引擎的建康状况。 - -eInfochips 已经开发了第一个面向 PowerPC 架构的 CPU 的 Android 移植版本,它使用较新的大端 Android 系统。此移植基于 Android 开源项目[Android Open Source Project (AOSP)] 中 Android 4.4 (KitKat) 的代码,其功能内核的版本号为 3.12.19。 - -Android 开始兴起的时候,PowerPC正在快速失去和 ARM 架构共通角逐的市场。高端的网络客户和以市场为导向的嵌入式工具大多运行在诸如飞思卡尔(Freescale)的 PowerQUICC 和 QorIQ 上,而不取决于 Linux 系统。一些 Android 的移植计划最终失败,然而在 2009 年,飞思卡尔和 Embedded Alley(一家软件厂商,当前是 Mentor Graphics 的 Linux 团队的一部分)[宣布了针对 PowerQUICC 和 QorIQ 芯片的移植版本][15],当前由 NXP 公司构建。另一个名为[Android-PowerPC][16] 的项目也作出了相似的工作。 - -这些努力来的都并不容易,然而,当航空公司找到 eInfochips,希望能够为他们那些基于 PowerPC 的引擎监控系统添加 Android 应用程序以改善人机界面。此公司找出了这些早期的移植版本,然而,他们都很难达到标准。所以,他们不得不从头开始新的移植。 - -最主要的问题是这些移植的 Android 版本实在是太老了,且 very different。Embedded Alley 移植的版本为 Android 1.5 (Cupcake),它于 2009 年发布,Linux 内核版本为 2.6.28。最后一版的移植为 Android-PowerPC 项目的 Android 2.2 (Froyo)它于 2010 年发布,内核版本为 2.6.32。此外,航空公司还有一些额外的技术诉求,例如对大端的支持. 现有的存储器接入方案仍旧应用于网络通信和电信行业。然而那些早期的移植版本仅能够支持小端的存储器访问。 - -### 来自 eInfochips 的全新 PowerPC 架构移植 - -eInfochips, 它最为出名的应该是那些基于 ARM/骁龙处理器的模块计算机板卡,例如 [Eragon 600][17]。 它已经完成了基于 QorIQ 的 Android 4.4 系统移植,且发布了白皮书描述了此项目。采用该项目的航空电子设备客户仍旧不愿透露姓名,目前仍旧不清楚什么时候会公开此该移植版本。 - - -![](http://hackerboards.com/files/einfochips_porting_android_on_powerpc-sm.jpg) ->图片来自 eInfochips 的博客日志 - -- 全新的 PowerPC Android 项目包括: -- 基于 PowerPC [e5500][1] 深度定制(bionic 定制不知道什么鬼,校对的时候也可以想想怎么处理) -- 基于 Android KitKat 的大端序支持 -- 开发工具链为 Gcc 5.2 -- Android 4.4 框架的 PowerPC 支持 -- PowerPC e5500 的 Android 内核版本为 3.12.19 - -根据 eInfochips 的销售经理 Sooryanarayanan Balasubramanian 描述,航空电子客户想要使用 Android 主要是因为熟悉的界面能够缩减培训的时间,并且让程序更新和提供新的程序变得更加容易。他继续解释说:“这次成功的移植了 Android,使得今后的工作仅仅需要在应用层作出修修改改,而不再向以前一样需要在所有层之间作相互的校验。”“这是第一次在航空航天工业作出这些尝试,这需要在设计时作出尽职的调查。” - -通过白皮书,可以知道将 Android 移植到 PowerPC 上需要对框架,核心库,开发工具链,运行时链接器,对象链接器和开源编译工具作出大量的修改。在字节码生成阶段,移植团队决定使用便携模式而不是快速的解释模式。这是因为,还没有 PowerPC 可用的快速解释模式,而使用 [libffi][18] 的便携模式能够支持 PowerPC。 - -同时,团队还面临在 Android 运行时 (ART) 环境和 Dalvik 虚拟机 (DVM) 环境之间的选择。他们发现,ART 环境下的便携模式还未经测试且缺乏良好的文档支持,所以最终选择了 DVM 环境下的便携模式。 - -白皮书中还提及了其它的一些在移植过程中遇到的困难,包括重新开发工具链,重写脚本以解决 AOSP “非标准”的使用编译器标志的问题。最终,移植提供了 37 个服务,and features a headless Android deployment along with an emulated UI in user space. - - -### 目标硬件 - -感谢来自 [eInfochips 博客日志][2] 的图片(如下图所示),我们能够确认此 PowerPC 的 Android 移植项目的硬件平台。这个板卡为 [X-ES Xpedite 6101][3],它是固实的 XMC/PrPMC 夹层模组。 - -![](http://hackerboards.com/files/xes_xpedite6101-sm.jpg) ->X-ES Xpedite 6101 照片和框图 - -X-ES Xpedite 6101 板卡拥有可选择的 NXP 公司基于 QorIQ T系列通信处理器 T2081, T1042, 和 T1022,他们分别拥有 8 个,4 个和 2 个 e6500 核心,稍有不同的是,T2081 的处理器主频为 1.8GHz,T1042/22 的处理器主频为 1.4GHz。所有的核心都集成了 AltiVec SIMD 引擎,这也就意味着它能够提供 DSP 级别的浮点运算性能。所有以上 3 款 X-ES 板卡都能够支持最高 8GB 的 DDR3-1600 ECC SDRAM 内存。外加 512MB NOR 和 32GB 的 NAND 闪存。 - -![](http://hackerboards.com/files/nxp_qoriq_t2081_block-sm.jpg) ->NXP T2081 框图 - -板卡的 I/O 包括一个 x4 PCI Express Gen2 通到,along with dual helpings of Gigabit Ethernet, RS232/422/485 串口和 SATA 3.0 接口。此外,它可选 3 款 QorIQ 处理器,Xpedite 6101 提供了三种[X-ES 加固等级][19],分别是额定工作温度 0 ~ 55°C, -40 ~ 70°C, 或者是 -40 ~ 85°C,且包含 3 类冲击和抗振类别。 - -此外,我们已经介绍过的基于 X-ES QorIQ 的 XMC/PrPMC 板卡包括[XPedite6401 和 XPedite6370][20],它们支持已有的板卡级 Linux Linux,Wind River VxWorks(一种实时操作系统) 和 Green Hills Integrity(也是一种操作系统)。 - - -### 更多信息 - -eInfochips Android PowerPC 移植白皮书可以[在此[4]下载(需要先免费注册)。 - -### Related posts: - -- [Commercial embedded Linux distro boosts virtualization][5] -- [Freescale unveils first ARM-based QorIQ SoCs][6] -- [High-end boards run Linux on 64-bit ARM QorIQ SoCs][7] -- [Free, Open Enea Linux taps Yocto Project and Linaro code][8] -- [LynuxWorks reverts to its LynxOS roots, changes name][9] -- [First quad- and octa-core QorIQ SoCs unveiled][10] -- [Free white paper shows how Linux won embedded][11] -- [Quad-core Snapdragon COM offers three dev kit options][12] -- [Tiny COM runs Linux on quad-core 64-bit Snapdragon 410][13] -- [PowerPC based IoT gateway COM ships with Linux BSP][14] - - --------------------------------------------------------------------------------- - -via: http://hackerboards.com/powerpc-gains-android-4-4-port-with-big-endian-support/ - -作者:[Eric Brown][a] -译者:[dongfengweixiao](https://github.com/dongfengweixiao) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://hackerboards.com/powerpc-gains-android-4-4-port-with-big-endian-support/ -[1]: http://linuxdevices.linuxgizmos.com/low-cost-powerquicc-chips-offer-flexible-interconnect-options/ -[2]: https://www.einfochips.com/blog/k2-categories/aerospace/presenting-a-case-for-porting-android-on-powerpc-architecture.html -[3]: http://www.xes-inc.com/products/processor-mezzanines/xpedite6101/ -[4]: http://biz.einfochips.com/portingandroidonpowerpc -[5]: http://hackerboards.com/commercial-embedded-linux-distro-boosts-virtualization/ -[6]: http://hackerboards.com/freescale-unveils-first-arm-based-qoriq-socs/ -[7]: http://hackerboards.com/high-end-boards-run-linux-on-64-bit-arm-qoriq-socs/ -[8]: http://hackerboards.com/free-open-enea-linux-taps-yocto-and-linaro-code/ -[9]: http://hackerboards.com/lynuxworks-reverts-to-its-lynxos-roots-changes-name/ -[10]: http://hackerboards.com/first-quad-and-octa-core-qoriq-socs-unveiled/ -[11]: http://hackerboards.com/free-white-paper-shows-how-linux-won-embedded/ -[12]: http://hackerboards.com/quad-core-snapdragon-com-offers-three-dev-kit-options/ -[13]: http://hackerboards.com/tiny-com-runs-linux-and-android-on-quad-core-64-bit-snapdragon-410/ -[14]: http://hackerboards.com/powerpc-based-iot-gateway-com-ships-with-linux-bsp/ -[15]: http://linuxdevices.linuxgizmos.com/android-ported-to-powerpc/ -[16]: http://www.androidppc.com/ -[17]: http://hackerboards.com/quad-core-snapdragon-com-offers-three-dev-kit-options/ -[18]: https://sourceware.org/libffi/ -[19]: http://www.xes-inc.com/capabilities/ruggedization/ -[20]: http://hackerboards.com/high-end-boards-run-linux-on-64-bit-arm-qoriq-socs/ From 9ad8f6b22e8b087be9024c94f2e62e3b80f957a0 Mon Sep 17 00:00:00 2001 From: runningwater Date: Tue, 5 Jul 2016 21:59:33 +0800 Subject: [PATCH 1076/1469] =?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 --- ...ng is a File” and Types of Files in Linux.md | 123 +++++++++--------- 1 file changed, 62 insertions(+), 61 deletions(-) rename {sources => translated}/talk/20160615 Explanation of “Everything is a File” and Types of Files in Linux.md (52%) mode change 100644 => 100755 diff --git a/sources/talk/20160615 Explanation of “Everything is a File” and Types of Files in Linux.md b/translated/talk/20160615 Explanation of “Everything is a File” and Types of Files in Linux.md old mode 100644 new mode 100755 similarity index 52% rename from sources/talk/20160615 Explanation of “Everything is a File” and Types of Files in Linux.md rename to translated/talk/20160615 Explanation of “Everything is a File” and Types of Files in Linux.md index e1c3ee4661..c9a1b243ff --- a/sources/talk/20160615 Explanation of “Everything is a File” and Types of Files in Linux.md +++ b/translated/talk/20160615 Explanation of “Everything is a File” and Types of Files in Linux.md @@ -1,54 +1,53 @@ -(翻译中 by runningwater) -Explanation of “Everything is a File” and Types of Files in Linux +诠释 Linux 中“一切都是文件”概念和相应的文件类型 ==================================================================== ![](http://www.tecmint.com/wp-content/uploads/2016/05/Everything-is-a-File-in-Linux.png) ->Everything is a File and Types of Files in Linux +>Linux 系统中一切都是文件并有相应的文件类型 -That is in fact true although it is just a generalization concept, in Unix and its derivatives such as Linux, everything is considered as a file. If something is not a file, then it must be running as a process on the system. +在 Unix 和它衍生的比如 Linux 系统中,一切都可以看做文件。虽然它仅仅只是一个泛泛的概念,但这是事实。如果有不是文件的,那它一定是正运行的进程。 -To understand this, take for example the amount of space on your root (/) directory is always consumed by different types of Linux files. When you create a file or transfer a file to your system, it occupies some space on the physical disk and it is considered to be in a specific format (file type). +要理解这点,可以举个例子,您的根目录(/) 的空间是由不同类型的 Linux 文件所占据的。当您创建一个文件或向系统传一个文件时,它在物理磁盘上占据的一些空间,可以认为是一个特定的格式(文件类型)。 -And also the Linux system does not differentiate between files and directories, but directories do one important job, that is store other files in groups in a hierarchy for easy location. All your hardware components are represented as files and the system communicates with them using these files. +虽然 Linux 系统中文件和目录没有什么不同,但目录还有一个重要的功能,那就是有结构性的分组存储其它文件,以方便查找访问。所有的硬件部件都表示为文件,系统使用这些文件来与硬件通信。 -The idea is an important description of a great property of Linux, where input/output resources such as your documents, directories (folders in Mac OS X and Windows), keyboard, monitor, hard-drives, removable media, printers, modems, virtual terminals and also inter-process and network communication are streams of bytes defined by file system space. +这些思想是对伟大的 Linux 财产的重要阐述,因此像文档、目录(Mac OS X 和 Windows 系统下是文件夹)、键盘、监视器、硬盘、可移动媒体设备、打印机、调制解调器、虚拟终端,还有进程间通信(IPC)和网络通信等输入/输出资源都在定义在文件系统空间下的字节流。 -A notable advantage of everything being a file is that the same set of Linux tools, utilities and APIs can be used on the above input/output resources. +一切都可看作是文件,其最显著的好处是对于上面所列出的输入/输出资源,只需要相同的一套 Linux 工具、实用程序和 API。 -Although everything in Linux is a file, there are certain special files that are more than just a file for example [sockets and named pipes][1]. +虽然在 Linux 中一切都可看作是文件,但也有一些特殊的文件,比如[套接字和命令管道][1]。 -### What are the different types of files in Linux? +### Linux 文件类型的不同之处? -In Linux there are basically three types of files: +Linux 系统中有三种基本的文件类型: -- Ordinary/Regular files -- Special files -- Directories +- 普通/常规文件 +- 特殊文件 +- 目录文件 -#### Ordinary/Regular Files +#### 普通/常规文件 -These are files data contain text, data or program instructions and they are the most common type of files you can expect to find on a Linux system and they include: +它们是包含文本、数据、程序指令等数据的文件,其在 Linux 系统中是最常见的一种。包括如下: -- Readable files -- Binary files -- Image files -- Compressed files and so on. +- 只读文件 +- 二进制文件 +- 图像文件 +- 压缩文件等等 -#### Special Files +#### 特殊文件 -Special files include the following: +特殊文件包括以下几种: -Block files : These are device files that provide buffered access to system hardware components. They provide a method of communication with device drivers through the file system. +块文件:设备文件,对访问系统硬件部件提供了缓存接口。他们提供了一种使用文件系统与设备驱动通信的方法。 -One important aspect about block files is that they can transfer a large block of data and information at a given time. +有关于块文件一个重要的性能就是它们能在指定时间内传输大块的数据和信息。 -Listing block files sockets in a directory: +列出某目录下的块文件: ``` # ls -l /dev | grep "^b" ``` -Sample Output +输出例子 ``` brw-rw---- 1 root disk 7, 0 May 18 10:26 loop0 @@ -74,15 +73,15 @@ brw-rw---- 1 root disk 1, 5 May 18 10:26 ram5 ... ``` -Character files : These are also device files that provide unbuffered serial access to system hardware components. They work by providing a way of communication with devices by transferring data one character at a time. +字符文件: 也是设备文件,对访问系统硬件组件提供了非缓冲串行接口。它们与设备的通信工作方式是一次只传输一个字符的数据。 -Listing character files sockets in a directory: +列出某目录下的字符文件: ``` # ls -l /dev | grep "^c" ``` -Sample Output +输出例子 ``` crw------- 1 root root 10, 235 May 18 15:54 autofs @@ -114,15 +113,15 @@ crw-rw-rw- 1 root tty 5, 2 May 18 17:40 ptmx crw-rw-rw- 1 root root 1, 8 May 18 10:26 random ``` -Symbolic link files : A symbolic link is a reference to another file on the system. Therefore, symbolic link files are files that point to other files, and they can either be directories or regular files. +符号链接文件 : 符号链接是指向系统上其他文件的引用。因此,符号链接文件是指向其它文件的文件,也可以是目录或常规文件。 -Listing symbolic link sockets in a directory: +列出某目录下的符号链接文件: ``` # ls -l /dev/ | grep "^l" ``` -Sample Output +输出例子 ``` lrwxrwxrwx 1 root root 3 May 18 10:26 cdrom -> sr0 @@ -135,27 +134,27 @@ lrwxrwxrwx 1 root root 15 May 18 15:54 stdin -> /proc/self/fd/0 lrwxrwxrwx 1 root root 15 May 18 15:54 stdout -> /proc/self/fd/1 ``` -You can make symbolic links using the `ln` utility in Linux as in the example below. +Linux 中使用 `ln` 工具就可以创建一个符号链接文件,如下所示: ``` # touch file1.txt -# ln -s file1.txt /home/tecmint/file1.txt [create symbolic link] -# ls -l /home/tecmint/ | grep "^l" [List symbolic links] +# ln -s file1.txt /home/tecmint/file1.txt [创建符号链接文件] +# ls -l /home/tecmint/ | grep "^l" [列出符号链接文件] ``` -In the above example, I created a file called `file1.txt` in `/tmp` directory, then created the symbolic link, `/home/tecmint/file1.txt` to point to `/tmp/file1.txt`. +在上面的例子中,首先我们在 `/tmp` 目录创建了一个名叫 `file1.txt` 的文件,然后创建符号链接文件,所以 `/home/tecmint/file1.txt` 指向 `/tmp/file1.txt` 文件。 -Pipes or Named pipes : These are files that allow inter-process communication by connecting the output of one process to the input of another. +套接字和命令管道 : 连接一个进行的输出和另一个进程的输入,允许进程间通信的文件。 -A named pipe is actually a file that is used by two process to communicate with each and it acts as a Linux pipe. +命名管道实际上是一个文件,用来使两个进程彼此通信,就像一个 Linux pipe(管道) 命令一样。 -Listing pipes sockets in a directory: +列出某目录下的管道文件: ``` # ls -l | grep "^p" ``` -Sample Output +输出例子 ``` prw-rw-r-- 1 tecmint tecmint 0 May 18 17:47 pipe1 @@ -165,62 +164,64 @@ prw-rw-r-- 1 tecmint tecmint 0 May 18 17:47 pipe4 prw-rw-r-- 1 tecmint tecmint 0 May 18 17:47 pipe5 ``` -You can use the mkfifo utility to create a named pipe in Linux as follows. +在 Linux 中可以使用 `mkfifo` 工具来创建一个命名管道,如下所示: ``` # mkfifo pipe1 # echo "This is named pipe1" > pipe1 ``` -In the above example, I created a named pipe called pipe1, then I passed some data to it using the [echo command][2], after that the shell became un-interactive while processing the input. +在上的例子中,我们创建了一个名叫 `pipe1` 的命名管道,然后使用 [echo 命令][2] 加入一些数据,在这操作后,要使用这些输入数据就要用非交互的 shell 了。 -Then I opened another shell and run the another command to print out what was passed to pipe. + + +然后,我们打开另外的 shell 终端,运行另外的命令来打印出刚加入管道的数据。 ``` # while read line ;do echo "This was passed-'$line' "; done Date: Wed, 6 Jul 2016 02:18:11 +0800 Subject: [PATCH 1077/1469] translated --- ... Compound Expressions with Awk in Linux.md | 81 ------------------- ... Compound Expressions with Awk in Linux.md | 79 ++++++++++++++++++ 2 files changed, 79 insertions(+), 81 deletions(-) delete mode 100644 sources/tech/awk/Part 5 - How to Use Compound Expressions with Awk in Linux.md create mode 100644 translated/tech/awk/Part 5 - How to Use Compound Expressions with Awk in Linux.md diff --git a/sources/tech/awk/Part 5 - How to Use Compound Expressions with Awk in Linux.md b/sources/tech/awk/Part 5 - How to Use Compound Expressions with Awk in Linux.md deleted file mode 100644 index db9a863484..0000000000 --- a/sources/tech/awk/Part 5 - How to Use Compound Expressions with Awk in Linux.md +++ /dev/null @@ -1,81 +0,0 @@ -martin - -How to Use Compound Expressions with Awk in Linux -==================================================== - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Use-Compound-Expressions-with-Awk.png) - -All along, we have been looking at simple expressions when checking whether a condition has been meet or not. What if you want to use more then one expression to check for a particular condition in? - -In this article, we shall take a look at the how you can combine multiple expressions referred to as compound expressions to check for a condition when filtering text or strings. - -In Awk, compound expressions are built using the `&&` referred to as `(and)` and the `||` referred to as `(or)` compound operators. - -The general syntax for compound expressions is: - -``` -( first_expression ) && ( second_expression ) -``` - -Here, `first_expression` and `second_expression` must be true to make the whole expression true. - -``` -( first_expression ) || ( second_expression) -``` - -Here, one of the expressions either `first_expression` or `second_expression` must be true for the whole expression to be true. - -**Caution**: Remember to always include the parenthesis. - -The expressions can be built using the comparison operators that we looked at in Part 4 of the awk series. - -Let us now get a clear understanding using an example below: - -In this example, a have a text file named `tecmint_deals.txt`, which contains a list of some amazing random Tecmint deals, it includes the name of the deal, the price and type. - -``` -TecMint Deal List -No Name Price Type -1 Mac_OS_X_Cleanup_Suite $9.99 Software -2 Basics_Notebook $14.99 Lifestyle -3 Tactical_Pen $25.99 Lifestyle -4 Scapple $19.00 Unknown -5 Nano_Tool_Pack $11.99 Unknown -6 Ditto_Bluetooth_Altering_Device $33.00 Tech -7 Nano_Prowler_Mini_Drone $36.99 Tech -``` - -Say that we want only print and flag deals that are above $20 and of type “Tech” using the (**) sign at the end of each line. - -We shall need to run the command below. - -``` -# awk '($3 ~ /^\$[2-9][0-9]*\.[0-9][0-9]$/) && ($4=="Tech") { printf "%s\t%s\n",$0,"*"; } ' tecmint_deals.txt - -6 Ditto_Bluetooth_Altering_Device $33.00 Tech * -7 Nano_Prowler_Mini_Drone $36.99 Tech * -``` - -In this example, we have used two expressions in a compound expression: - -- First expression, `($3 ~ /^\$[2-9][0-9]*\.[0-9][0-9]$/)` ; checks the for lines with deals with price above `$20`, and it is only true if the value of $3 which is the price matches the pattern `/^\$[2-9][0-9]*\.[0-9][0-9]$/` -- And the second expression, `($4 == “Tech”)` ; checks whether the deal is of type “`Tech`” and it is only true if the value of `$4` equals to “`Tech`”. -Remember, a line will only be flagged with the `(**)`, if first expression and second expression are true as states the principle of the `&&` operator. - -### Summary - -Some conditions always require building compound expressions for you to match exactly what you want. When you understand the use of comparison and compound expression operators then, filtering text or strings based on some difficult conditions will become easy. - -Hope you find this guide useful and for any questions or additions, always remember to leave a comment and your concern will be solved accordingly. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/combine-multiple-expressions-in-awk/ - -作者:[Aaron Kili][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/aaronkili/ diff --git a/translated/tech/awk/Part 5 - How to Use Compound Expressions with Awk in Linux.md b/translated/tech/awk/Part 5 - How to Use Compound Expressions with Awk in Linux.md new file mode 100644 index 0000000000..ed1ba4aa7c --- /dev/null +++ b/translated/tech/awk/Part 5 - How to Use Compound Expressions with Awk in Linux.md @@ -0,0 +1,79 @@ +如何使用 Awk 复合表达式 +==================================================== + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Use-Compound-Expressions-with-Awk.png) + +一直以来在查对条件是否匹配时,我们寻求的都是简单的表达式。那如果你想用超过一个表达式,来查对特定的条件呢? + +本文,我们将看看如何在过滤文本和字符串时,结合多个表达式,即复合表达式,用以查对条件。 + +Awk 的复合表达式可由表示`与`的组合操作符 `&&` 和表示`或`的 `||` 构成。 + +复合表达式的常规写法如下: + +``` +( first_expression ) && ( second_expression ) +``` + +为了保证整个表达式的正确,在这里必须确保 `first_expression` 和 `second_expression` 是正确的。 + +``` +( first_expression ) || ( second_expression) +``` + +为了保证整个表达式的正确,在这里必须确保 `first_expression` 或 `second_expression` 是正确的。 + +**注意**:切记要加括号。 + +表达式可以由比较操作符构成,具体可查看 awk 系列的第四部分。 + +现在让我们通过一个例子来加深理解: + +此例中,有一个文本文件 `tecmint_deals.txt`,文本中包含着一张随机的 Tecmint 交易清单,其中包含了名称、价格和种类。 + +``` +TecMint Deal List +No Name Price Type +1 Mac_OS_X_Cleanup_Suite $9.99 Software +2 Basics_Notebook $14.99 Lifestyle +3 Tactical_Pen $25.99 Lifestyle +4 Scapple $19.00 Unknown +5 Nano_Tool_Pack $11.99 Unknown +6 Ditto_Bluetooth_Altering_Device $33.00 Tech +7 Nano_Prowler_Mini_Drone $36.99 Tech +``` + +我们只想打印出价格超过 $20 的物品,并在其中种类为 “Tech” 的物品的行末用 (**) 打上标记。 + +我们将要执行以下命令。 + +``` +# awk '($3 ~ /^\$[2-9][0-9]*\.[0-9][0-9]$/) && ($4=="Tech") { printf "%s\t%s\n",$0,"*"; } ' tecmint_deals.txt + +6 Ditto_Bluetooth_Altering_Device $33.00 Tech * +7 Nano_Prowler_Mini_Drone $36.99 Tech * +``` + +此例,在复合表达式中我们使用了两个表达式: + +- 表达式 1:`($3 ~ /^\$[2-9][0-9]*\.[0-9][0-9]$/)` ;查找交易价格超过 `$20` 的行,即只有当 `$3` 也就是价格满足 `/^\$[2-9][0-9]*\.[0-9][0-9]$/` 时值才为 true。 +- 表达式 2:`($4 == “Tech”)` ;查找是否有种类为 “`Tech`”的交易,即只有当 `$4` 等于 “`Tech`” 时值才为 true。 +切记,只有当 `&&` 操作符的两端状态,也就是两个表达式都是 true 的情况下,这一行才会被打上 `(**)` 标志。 + +### 总结 + +有些时候为了匹配你的真实想法,就不得不用到复合表达式。当你掌握了比较和复合表达式操作符的用法之后,在难的文本或字符串过滤条件也能轻松解决。 + +希望本向导对你有所帮助,如果你有任何问题或者补充,可以在下方发表评论,你的问题将会得到相应的解释。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/combine-multiple-expressions-in-awk/ + +作者:[Aaron Kili][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/aaronkili/ From 152232980f6b3ecf536dfe8d4e543d76920e9d59 Mon Sep 17 00:00:00 2001 From: runningwater Date: Wed, 6 Jul 2016 09:59:41 +0800 Subject: [PATCH 1078/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E7=94=B3=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...1 CANONICAL CONSIDERING TO DROP 32 BIT SUPPORT IN UBUNTU.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20160701 CANONICAL CONSIDERING TO DROP 32 BIT SUPPORT IN UBUNTU.md b/sources/tech/20160701 CANONICAL CONSIDERING TO DROP 32 BIT SUPPORT IN UBUNTU.md index c7a3e8a499..ad51164ed4 100644 --- a/sources/tech/20160701 CANONICAL CONSIDERING TO DROP 32 BIT SUPPORT IN UBUNTU.md +++ b/sources/tech/20160701 CANONICAL CONSIDERING TO DROP 32 BIT SUPPORT IN UBUNTU.md @@ -1,3 +1,4 @@ +(翻译中 by runningwater) CANONICAL CONSIDERING TO DROP 32 BIT SUPPORT IN UBUNTU ======================================================== @@ -29,7 +30,7 @@ I understand why they need to make this move from a security standpoint, but it via: https://itsfoss.com/ubuntu-32-bit-support-drop/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 作者:[John Paul][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/) 荣誉推出 From 06a314e359903d5b08a6b4aa9403f58c76fd2a71 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 6 Jul 2016 18:54:48 +0800 Subject: [PATCH 1079/1469] PUB:20160616 10 Basic Linux Commands That Every Linux Newbies Should Remember @mr-ping --- ...hat Every Linux Newbies Should Remember.md | 141 ++++++++++++++++++ ...hat Every Linux Newbies Should Remember.md | 141 ------------------ 2 files changed, 141 insertions(+), 141 deletions(-) create mode 100644 published/20160616 10 Basic Linux Commands That Every Linux Newbies Should Remember.md delete mode 100644 translated/tech/20160616 10 Basic Linux Commands That Every Linux Newbies Should Remember.md diff --git a/published/20160616 10 Basic Linux Commands That Every Linux Newbies Should Remember.md b/published/20160616 10 Basic Linux Commands That Every Linux Newbies Should Remember.md new file mode 100644 index 0000000000..50ec85acaa --- /dev/null +++ b/published/20160616 10 Basic Linux Commands That Every Linux Newbies Should Remember.md @@ -0,0 +1,141 @@ +Linux 新手必知必会的 10 条 Linux 基本命令 +===================================================================== + +![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/4225072_orig.png) + + +Linux 对我们的生活产生了巨大的冲击。至少你的安卓手机使用的就是 Linux 核心。尽管如此,在第一次开始使用 Linux 时你还是会感到难以下手。因为在 Linux 中,通常需要使用终端命令来取代 Windows 系统中的点击启动图标操作。但是不必担心,这里我们会介绍 10 个 Linux 基本命令来帮助你开启 Linux 神秘之旅。 + + +### 帮助新手走出第一步的 10 个 Linux 基本命令 + +当我们谈论 Linux 命令时,实质上是在谈论 Linux 系统本身。这短短的 10 个 Linux 基本命令不会让你变成天才或者 Linux 专家,但是能帮助你轻松开始 Linux 之旅。使用这些基本命令会帮助新手们完成 Linux 的日常任务,由于它们的使用频率如此至高,所以我更乐意称他们为 Linux 命令之王! + +让我们开始学习这 10 条 Linux 基本命令吧。 + + +#### 1. sudo + +这条命令的意思是“以超级用户的身份执行”,是 SuperUserDo 的简写,它是新手将要用到的最重要的一条 Linux 命令。当一条单行命令需要 root 权限的时候,`sudo`命令就派上用场了。你可以在每一条需要 root 权限的命令前都加上`sudo`。 + +``` +$ sudo su +``` + + +#### 2. ls (list) + + +跟其他人一样,你肯定也经常想看看目录下都有些什么东西。使用列表命令,终端会把当前工作目录下所有的文件以及文件夹展示给你。比如说,我当前处在 /home 文件夹中,我想看看 /home 文件夹中都有哪些文件和目录。 + +``` +/home$ ls +``` + + +在 /home 中执行`ls`命令将会返回类似下面的内容: + +``` +imad lost+found +``` + + +#### 3. cd + +变更目录命令(cd)是终端中总会被用到的主要命令。它是最常用到的 Linux 基本命令之一。此命令使用非常简单,当你打算从当前目录跳转至某个文件夹时,只需要将文件夹键入此命令之后即可。如果你想跳转至上层目录,只需要在此命令之后键入两个点 (..) 就可以了。 +​ +举个例子,我现在处在 /home 目录中,我想移动到 /home 目录中的 usr 文件夹下,可以通过以下命令来完成操作。 + +``` +/home $ cd usr + +/home/usr $ +``` + + +#### 4. mkdir + +只是可以切换目录还是不够完美。有时候你会想要新建一个文件夹或子文件夹。此时可以使用 mkdir 命令来完成操作。使用方法很简单,只需要把新的文件夹名跟在 mkdir 命令之后就好了。 + +``` +~$ mkdir folderName +``` + + +#### 5. cp + +拷贝-粘贴(copy-and-paste)是我们组织文件需要用到的重要命令。使用 `cp` 命令可以帮助你在终端当中完成拷贝-粘贴操作。首先确定你想要拷贝的文件,然后键入打算粘贴此文件的目标位置。 + +``` +$ cp src des +``` + +注意:如果目标目录对新建文件需要 root 权限时,你可以使用 `sudo` 命令来完成文件拷贝操作。 + + +#### 6. rm + +rm 命令可以帮助你移除文件甚至目录。如果不希望每删除一个文件都提示确认一次,可以用`-f`参数来强制执行。也可以使用 `-r` 参数来递归的移除文件夹。 + +``` +$ rm myfile.txt +``` + + +#### 7. apt-get + +这个命令会依据发行版的不同而有所区别。在基于 Debian 的发行版中,我们拥有 Advanced Packaging Tool(APT)包管理工具来安装、移除和升级包。apt-get 命令会帮助你安装需要在 Linux 系统中运行的软件。它是一个功能强大的命令行,可以用来帮助你对软件执行安装、升级和移除操作。 + +在其他发行版中,例如 Fedora、Centos,都各自不同的包管理工具。Fedora 之前使用的是 yum,不过现在 dnf 成了它默认的包管理工具。 + +``` +$ sudo apt-get update + +$ sudo dnf update +``` + + +#### 8. grep + +当你需要查找一个文件,但是又忘记了它具体的位置和路径时,`grep` 命令会帮助你解决这个难题。你可以提供文件的关键字,使用`grep`命令来查找到它。 + +``` +$ grep user /etc/passwd +``` + + +#### 9. cat + +作为一个用户,你应该会经常需要浏览脚本内的文本或者代码。`cat`命令是 Linux 系统的基本命令之一,它的用途就是将文件的内容展示给你。 + +``` +$ cat CMakeLists.txt +``` + + +#### 10. poweroff + +最后一个命令是 `poweroff`。有时你需要直接在终端中执行关机操作。此命令可以完成这个任务。由于关机操作需要 root 权限,所以别忘了在此命令之前添加`sudo`。 + +``` +$ sudo poweroff +``` + + +### 总结 + +如我在文章开始所言,这 10 条命令并不会让你立即成为一个 Linux 大拿,但它们会让你在初期快速上手 Linux。以这些命令为基础,给自己设置一个目标,每天学习一到三条命令,这就是此文的目的所在。在下方评论区分享有趣并且有用的命令。别忘了跟你的朋友分享此文。 + + +-------------------------------------------------------------------------------- + +via: http://www.linuxandubuntu.com/home/10-basic-linux-commands-that-every-linux-newbies-should-remember + +作者:[Commenti][a] +译者:[mr-ping](https://github.com/mr-ping) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.linuxandubuntu.com/home/10-basic-linux-commands-that-every-linux-newbies-should-remember#comments +[1]: http://linuxandubuntu.com/home/category/linux diff --git a/translated/tech/20160616 10 Basic Linux Commands That Every Linux Newbies Should Remember.md b/translated/tech/20160616 10 Basic Linux Commands That Every Linux Newbies Should Remember.md deleted file mode 100644 index c69b7a6e54..0000000000 --- a/translated/tech/20160616 10 Basic Linux Commands That Every Linux Newbies Should Remember.md +++ /dev/null @@ -1,141 +0,0 @@ -Linux新手必知必会的10条Linux基本命令 -===================================================================== - -![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/4225072_orig.png) - - -[Linux][1]对我们的生活产生了巨大的冲击。至少你的安卓手机使用的就是Linux核心。尽管如此,在第一次开始使用Linux时你还是会感到难以下手。因为在Linux中,通常需要使用终端命令来取代Windows系统中的点击启动图标操作。但是不必担心,这里我们会介绍10个Linux基本命令来帮助你开启Linux神秘之旅。 - - -### 帮助新手走出第一步的10个Linux基本命令 - -当我们谈论Linux命令时,实质上是在谈论Linux系统本身。这短短的10个Linux基本命令不会让你变成天才或者Linux专家,但是能帮助你轻松开始Linux之旅。使用这些基本命令会帮助新手们完成Linux的日常任务,由于它们的使用频率如此至高,所以我更乐意称他们为Linux命令之王! - -让我们开始学习这10条Linux基本命令吧。 - - -#### 1. sudo - -这条命令的意思是“以超级用户的身份执行”,是 SuperUserDo 的简写,它是新手将要用到的最重要的一条Linux命令。当一条单行命令需要root权限的时候,`sudo`命令就派上用场了。你可以在每一条需要root权限的命令前都加上`sudo`。 - -``` -$ sudo su -``` - - -#### 2. ls (list) - - -跟其他人一样,你肯定也经常想看看目录下都有些什么东西。使用列表命令,终端会把当前工作目录下所有的文件以及文件夹展示给你。比如说,我当前处在 /home 文件夹中,我想看看 /home文件夹中都有哪些文件和目录。 - -``` -/home$ ls -``` - - -在/home中执行`ls`命令将会返回以下内容 - -``` -imad lost+found -``` - - -#### 3. cd - -变更目录命令(cd)是终端中总会被用到的主要命令。他是最常用到的Linux基本命令之一。此命令使用非常简单,当你打算从当前目录跳转至某个文件夹时,只需要将文件夹键入此命令之后即可。如果你想跳转至上层目录,只需要在此命令之后键入两个点(..)就可以了。 -​ -举个例子,我现在处在/home目录中,我想移动到/home目录中的usr文件夹下,可以通过以下命令来完成操作。 - -``` -/home $ cd usr - -/home/usr $ -``` - - -#### 4. mkdir - -只是可以切换目录还是不够完美。有时候你会想要新建一个文件夹或子文件夹。此时可以使用mkdir命令来完成操作。使用方法很简单,只需要把新的文件夹名跟在mkdir命令之后就好了。 - -``` -~$ mkdir folderName -``` - - -#### 5. cp - -拷贝-粘贴(copy-and-paste)是我们组织文件需要用到的重要命令。使用 `cp` 命令可以帮助你在终端当中完成拷贝-粘贴操作。首先确定你想要拷贝的文件,然后键入打算粘贴此文件的目标位置。 - -``` -$ cp src des -``` - -注意:如果目标目录对新建文件需要root权限时,你可以使用`sudo`命令来完成文件拷贝操作。 - - -#### 6. rm - -rm命令可以帮助你移除文件甚至目录。如果文件需要root权限才能移除,可以用`-f`参数来强制执行。也可以使用`-r`参数来递归的移除文件夹。 - -``` -$ rm myfile.txt -``` - - -#### 7. apt-get - -这个命令会依据发行版的不同而有所区别。在基于Debian的发行版中,我们拥有Advanced Packaging Tool(APT)包管理工具来安装、移除和升级包。apt-get命令会帮助你安装需要在Linux系统中运行的软件。它是一个功能强大的命令行,可以用来帮助你对软件执行安装、升级和移除操作。 - -在其他发行版中,例如Fedora、Centos,都各自不同的包管理工具。Fedora之前使用的是yum,不过现在dnf成了它默认的包管理工具。 - -``` -$ sudo apt-get update - -$ sudo dnf update -``` - - -#### 8. grep - -当你需要查找一个文件,但是又忘记了它具体的位置和路径时,`grep`命令会帮助你解决这个难题。你可以提供文件的关键字,使用`grep`命令来查找到它。 - -``` -$ grep user /etc/passwd -``` - - -#### 9. cat - -作为一个用户,你应该会经常需要浏览脚本内的文本或者代码。`cat`命令是Linux系统的基本命令之一,它的用途就是将文件的内容展示给你。 - -``` -$ cat CMakeLists.txt -``` - - -#### 10. poweroff - -最后一个命令是 `poweroff`。有时你需要直接在终端中执行关机操作。此命令可以完成这个任务。由于关机操作需要root权限,所以别忘了在此命令之前添加`sudo`。 - -``` -$ sudo poweroff -``` - - -### 总结 - -如我在文章开始所言,这10条命令并不会让你立即成为一个Linux大拿。它们会让你在初期快速上手Linux。以这些命令为基础,给自己设置一个目标,每天学习一到三条命令,这就是此文的目的所在。在下方评论区分享有趣并且有用的命令。别忘了跟你的朋友分享此文。 - - --------------------------------------------------------------------------------- - -via: http://www.linuxandubuntu.com/home/10-basic-linux-commands-that-every-linux-newbies-should-remember - -作者:[Commenti][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://www.linuxandubuntu.com/home/10-basic-linux-commands-that-every-linux-newbies-should-remember#comments -[1]: http://linuxandubuntu.com/home/category/linux From 9095deb4f7fdbc910100e8ccdae643ca21c5a63e Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 7 Jul 2016 10:00:13 +0800 Subject: [PATCH 1080/1469] PUB:20160219 How to Setup Lighttpd Web server on Ubuntu 15.04 or CentOS 7 @HaohongWANG --- ... Web server on Ubuntu 15.04 or CentOS 7.md | 213 ++++++++++++++++++ ... Web server on Ubuntu 15.04 or CentOS 7.md | 210 ----------------- 2 files changed, 213 insertions(+), 210 deletions(-) create mode 100644 published/20160219 How to Setup Lighttpd Web server on Ubuntu 15.04 or CentOS 7.md delete mode 100644 translated/tech/20160219 How to Setup Lighttpd Web server on Ubuntu 15.04 or CentOS 7.md diff --git a/published/20160219 How to Setup Lighttpd Web server on Ubuntu 15.04 or CentOS 7.md b/published/20160219 How to Setup Lighttpd Web server on Ubuntu 15.04 or CentOS 7.md new file mode 100644 index 0000000000..3db9318138 --- /dev/null +++ b/published/20160219 How to Setup Lighttpd Web server on Ubuntu 15.04 or CentOS 7.md @@ -0,0 +1,213 @@ +如何在 Ubuntu 15.04/CentOS 7 中安装 Lighttpd Web 服务器 +================================================================================= + +Lighttpd 是一款开源 Web 服务器软件。Lighttpd 安全快速,符合行业标准,适配性强并且针对高配置环境进行了优化。相对于其它的 Web 服务器而言,Lighttpd 占用内存更少;因其对 CPU 占用小和对处理速度的优化而在效率和速度方面从众多 Web 服务器中脱颖而出。而 Lighttpd 诸如 FastCGI、CGI、认证、输出压缩、URL 重写等高级功能更是那些面临性能压力的服务器的福音。 + +以下便是我们在运行 Ubuntu 15.04 或 CentOS 7 Linux 发行版的机器上安装 Lighttpd Web 服务器的简要流程。 + +### 安装Lighttpd + +#### 使用包管理器安装 + +这里我们通过使用包管理器这种最简单的方法来安装 Lighttpd。只需以 sudo 模式在终端或控制台中输入下面的指令即可。 + +**CentOS 7** + +由于 CentOS 7.0 官方仓库中并没有提供 Lighttpd,所以我们需要在系统中安装额外的软件源 epel 仓库。使用下面的 yum 指令来安装 epel。 + + # yum install epel-release + +然后,我们需要更新系统及为 Lighttpd 的安装做前置准备。 + + # yum update + # yum install lighttpd + +![Install Lighttpd Centos](http://blog.linoxide.com/wp-content/uploads/2016/02/install-lighttpd-centos.png) + +**Ubuntu 15.04** + +Ubuntu 15.04 官方仓库中包含了 Lighttpd,所以只需更新本地仓库索引并使用 apt-get 指令即可安装 Lighttpd。 + + # apt-get update + # apt-get install lighttpd + +![Install lighttpd ubuntu](http://blog.linoxide.com/wp-content/uploads/2016/02/install-lighttpd-ubuntu.png) + +#### 从源代码安装 Lighttpd + +如果想从 Lighttpd 源码安装最新版本(例如 1.4.39),我们需要在本地编译源码并进行安装。首先我们要安装编译源码所需的依赖包。 + + # cd /tmp/ + # wget http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.39.tar.gz + +下载完成后,执行下面的指令解压缩。 + + # tar -zxvf lighttpd-1.4.39.tar.gz + +然后使用下面的指令进行编译。 + + # cd lighttpd-1.4.39 + # ./configure + # make + +**注:**在这份教程中,我们安装的是默认配置的 Lighttpd。其他拓展功能,如对 SSL 的支持,mod_rewrite,mod_redirect 等,需自行配置。 + +当编译完成后,我们就可以把它安装到系统中了。 + + # make install + +### 设置 Lighttpd + +如果有更高的需求,我们可以通过修改默认设置文件,如`/etc/lighttpd/lighttpd.conf`,来对 Lighttpd 进行进一步设置。 而在这份教程中我们将使用默认设置,不对设置文件进行修改。如果你曾做过修改并想检查设置文件是否出错,可以执行下面的指令。 + + # lighttpd -t -f /etc/lighttpd/lighttpd.conf + +#### 使用 CentOS 7 + +在 CentOS 7 中,我们需创建一个在 Lighttpd 默认配置文件中设置的 webroot 文件夹,例如`/src/www/htdocs`。 + + # mkdir -p /srv/www/htdocs/ + +而后将默认欢迎页面从`/var/www/lighttpd`复制至刚刚新建的目录中: + + # cp -r /var/www/lighttpd/* /srv/www/htdocs/ + +### 开启服务 + +现在,通过执行 systemctl 指令来重启 Web 服务。 + + # systemctl start lighttpd + +然后我们将它设置为伴随系统启动自动运行。 + + # systemctl enable lighttpd + +### 设置防火墙 + +如要让我们运行在 Lighttpd 上的网页或网站能在 Internet 或同一个网络内被访问,我们需要在防火墙程序中设置打开 80 端口。由于 CentOS 7 和 Ubuntu15.04 都附带 Systemd 作为默认初始化系统,所以我们默认用的都是 firewalld。如果要打开 80 端口或 http 服务,我们只需执行下面的命令: + + # firewall-cmd --permanent --add-service=http + success + # firewall-cmd --reload + success + +### 连接至 Web 服务器 + +在将 80 端口设置为默认端口后,我们就可以直接访问 Lighttpd 的默认欢迎页了。我们需要根据运行 Lighttpd 的设备来设置浏览器的 IP 地址和域名。在本教程中,我们令浏览器访问 [http://lighttpd.linoxide.com/](http://lighttpd.linoxide.com/) ,同时将该子域名指向上述 IP 地址。如此一来,我们就可以在浏览器中看到如下的欢迎页面了。 + +![Lighttpd Welcome Page](http://blog.linoxide.com/wp-content/uploads/2016/02/lighttpd-welcome-page.png) + +此外,我们可以将网站的文件添加到 webroot 目录下,并删除 Lighttpd 的默认索引文件,使我们的静态网站可以在互联网上访问。 + +如果想在 Lighttpd Web 服务器中运行 PHP 应用,请参考下面的步骤: + +### 安装 PHP5 模块 + +在 Lighttpd 成功安装后,我们需要安装 PHP 及相关模块,以在 Lighttpd 中运行 PHP5 脚本。 + +#### 使用 Ubuntu 15.04 + + # apt-get install php5 php5-cgi php5-fpm php5-mysql php5-curl php5-gd php5-intl php5-imagick php5-mcrypt php5-memcache php-pear + +#### 使用 CentOS 7 + + # yum install php php-cgi php-fpm php-mysql php-curl php-gd php-intl php-pecl-imagick php-mcrypt php-memcache php-pear lighttpd-fastcgi + +### 设置 Lighttpd 的 PHP 服务 + +如要让 PHP 与 Lighttpd 协同工作,我们只要根据所使用的发行版执行如下对应的指令即可。 + +#### 使用 CentOS 7 + +首先要做的便是使用文件编辑器编辑 php 设置文件(例如`/etc/php.ini`)并取消掉对**cgi.fix_pathinfo=1**这一行的注释。 + + # nano /etc/php.ini + +完成上面的步骤之后,我们需要把 PHP-FPM 进程的所有权从 Apache 转移至 Lighttpd。要完成这些,首先用文件编辑器打开`/etc/php-fpm.d/www.conf`文件。 + + # nano /etc/php-fpm.d/www.conf + +然后在文件中增加下面的语句: + + user = lighttpd + group = lighttpd + +做完这些,我们保存并退出文本编辑器。然后从`/etc/lighttpd/modules.conf`设置文件中添加 FastCGI 模块。 + + # nano /etc/lighttpd/modules.conf + +然后,去掉下面语句前面的`#`来取消对它的注释。 + + include "conf.d/fastcgi.conf" + +最后我们还需在文本编辑器设置 FastCGI 的设置文件。 + + # nano /etc/lighttpd/conf.d/fastcgi.conf + +在文件尾部添加以下代码: + + fastcgi.server += ( ".php" => + (( + "host" => "127.0.0.1", + "port" => "9000", + "broken-scriptfilename" => "enable" + )) + ) + +在编辑完成后保存并退出文本编辑器即可。 + +#### 使用 Ubuntu 15.04 + +如需启用 Lighttpd 的 FastCGI,只需执行下列代码: + + # lighttpd-enable-mod fastcgi + + Enabling fastcgi: ok + Run /etc/init.d/lighttpd force-reload to enable changes + + # lighttpd-enable-mod fastcgi-php + + Enabling fastcgi-php: ok + Run `/etc/init.d/lighttpd` force-reload to enable changes + +然后,执行下列命令来重启 Lighttpd。 + + # systemctl force-reload lighttpd + +### 检测 PHP 工作状态 + +如需检测 PHP 是否按预期工作,我们需在 Lighttpd 的 webroot 目录下新建一个 php 文件。本教程中,在 Ubuntu 下 /var/www/html 目录,CentOS 下 /src/www/htdocs 目录下使用文本编辑器创建并打开 info.php。 + +**使用 CentOS 7** + + # nano /var/www/info.php + +**使用 Ubuntu 15.04** + + # nano /srv/www/htdocs/info.php + +然后只需将下面的语句添加到文件里即可。 + + + +在编辑完成后保存并推出文本编辑器即可。 + +现在,我们需根据路径 [http://lighttpd.linoxide.com/info.php](http://lighttpd.linoxide.com/info.php) 下的 info.php 文件的 IP 地址或域名,来让我们的网页浏览器指向系统上运行的 Lighttpd。如果一切都按照以上说明进行,我们将看到如下图所示的 PHP 页面信息。 + +![phpinfo lighttpd](http://blog.linoxide.com/wp-content/uploads/2016/02/phpinfo-lighttpd.png) + +### 总结 + +至此,我们已经在 CentOS 7 和 Ubuntu 15.04 Linux 发行版上成功安装了轻巧快捷并且安全的 Lighttpd Web 服务器。现在,我们已经可以上传网站文件到网站根目录、配置虚拟主机、启用 SSL、连接数据库,在我们的 Lighttpd Web 服务器上运行 Web 应用等功能了。 如果你有任何疑问,建议或反馈请在下面的评论区中写下来以让我们更好的改良 Lighttpd。谢谢! + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/setup-lighttpd-web-server-ubuntu-15-04-centos-7/ + +作者:[Arun Pyasi][a] +译者:[HaohongWANG](https://github.com/HaohongWANG) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ diff --git a/translated/tech/20160219 How to Setup Lighttpd Web server on Ubuntu 15.04 or CentOS 7.md b/translated/tech/20160219 How to Setup Lighttpd Web server on Ubuntu 15.04 or CentOS 7.md deleted file mode 100644 index 8840e8b973..0000000000 --- a/translated/tech/20160219 How to Setup Lighttpd Web server on Ubuntu 15.04 or CentOS 7.md +++ /dev/null @@ -1,210 +0,0 @@ -[Translated] Haohong Wang -如何在Ubuntu 15.04/CentOS 7中安装Lighttpd Web server -================================================================================= -Lighttpd 是一款开源Web服务器软件。Lighttpd 安全快速,符合行业标准,适配性强并且针对高配置环境进行了优化。Lighttpd因其CPU、内存占用小,针对小型CPU加载的快速适配以及出色的效率和速度而从众多Web服务器中脱颖而出。 而Lighttpd诸如FastCGI,CGI,Auth,Out-Compression,URL-Rewriting等高级功能更是那些低配置的服务器的福音。 - -以下便是在我们运行Ubuntu 15.04 或CentOS 7 Linux发行版的机器上安装Lighttpd Web服务器的简要流程。 - -### 安装Lighttpd - -#### 使用包管理器安装 - -这里我们通过使用包管理器这种最简单的方法来安装Lighttpd。只需以sudo模式在终端或控制台中输入下面的指令即可。 - -**CentOS 7** - -由于CentOS 7.0官方repo中并没有提供Lighttpd,所以我们需要在系统中安装额外的软件源epel repo。使用下面的yum指令来安装epel。 - - # yum install epel-release - -然后,我们需要更新系统及进程为Lighttpd的安装做准备。 - - # yum update - # yum install lighttpd - -![Install Lighttpd Centos](http://blog.linoxide.com/wp-content/uploads/2016/02/install-lighttpd-centos.png) - -**Ubuntu 15.04** - -Ubuntu 15.04官方repo中包含了Lighttpd,所以只需更新本地repo并使用apt-get指令即可安装Lighttpd。 - - # apt-get update - # apt-get install lighttpd - -![Install lighttpd ubuntu](http://blog.linoxide.com/wp-content/uploads/2016/02/install-lighttpd-ubuntu.png) - -#### 从源代码安装Lighttpd - -如果想从Lighttpd源码安装最新版本(例如1.4.39),我们需要在本地编译源码并进行安装。首先我们要安装编译源码所需的依赖包。 - - # cd /tmp/ - # wget http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.39.tar.gz - -下载完成后,执行下面的指令解压缩。 - - # tar -zxvf lighttpd-1.4.39.tar.gz - -然后使用下面的指令进行编译。 - - # cd lighttpd-1.4.39 - # ./configure - # make - -**注:**在这份教程中,我们安装的是默认配置的Lighttpd。其他诸如高级功能或拓展功能,如对SSL的支持,mod_rewrite,mod_redirect等,需自行配置。 - -当编译完成后,我们就可以把它安装到系统中了。 - - # make install - -### 设置Lighttpd - -如果有更高的需求,我们可以通过修改默认设置文件,如`/etc/lighttpd/lighttpd.conf`,来对Lighttpd进行进一步设置。 而在这份教程中我们将使用默认设置,不对设置文件进行修改。如果你曾做过修改并想检查设置文件是否出错,可以执行下面的指令。 - - # lighttpd -t -f /etc/lighttpd/lighttpd.conf - -#### 使用 CentOS 7 - -在CentOS 7中,我们需在Lighttpd默认设置中创设一个例如`/src/www/htdocs`的webroot文件夹。 - - # mkdir -p /srv/www/htdocs/ - -而后将默认欢迎页面从`/var/www/lighttpd`复制至刚刚新建的目录中: - - # cp -r /var/www/lighttpd/* /srv/www/htdocs/ - -### 开启服务 - -现在,通过执行systemctl指令来重启数据库服务。 - - # systemctl start lighttpd - -然后我们将它设置为伴随系统启动自动运行。 - - # systemctl enable lighttpd - -### 设置防火墙 - -如要让我们运行在Lighttpd上的网页和网站能在Internet或相似的网络上被访问,我们需要在防火墙程序中设置打开80端口。由于CentOS 7和Ubuntu15.04都附带Systemd作为默认初始化系统,所以我们安装firewalld作为解决方案。如果要打开80端口或http服务,我们只需执行下面的命令: - - # firewall-cmd --permanent --add-service=http - success - # firewall-cmd --reload - success - -### 连接至Web Server -在将80端口设置为默认端口后,我们就可以默认直接访问Lighttpd的欢迎页了。我们需要根据运行Lighttpd的设备来设置浏览器的IP地址和域名。在本教程中,我们令浏览器指向 [http://lighttpd.linoxide.com/](http://lighttpd.linoxide.com/) 同时将子域名指向它的IP地址。如此一来,我们就可以在浏览器中看到如下的欢迎页面了。 - -![Lighttpd Welcome Page](http://blog.linoxide.com/wp-content/uploads/2016/02/lighttpd-welcome-page.png) - -此外,我们可以将网站的文件添加到webroot目录下,并删除lighttpd的默认索引文件,使我们的静态网站链接至互联网上。 - -如果想在Lighttpd Web Server中运行PHP应用,请参考下面的步骤: - -### 安装PHP5模块 -在Lighttpd成功安装后,我们需要安装PHP及相关模块以在Lighttpd中运行PHP5脚本。 - -#### 使用 Ubuntu 15.04 - - # apt-get install php5 php5-cgi php5-fpm php5-mysql php5-curl php5-gd php5-intl php5-imagick php5-mcrypt php5-memcache php-pear - -#### 使用 CentOS 7 - - # yum install php php-cgi php-fpm php-mysql php-curl php-gd php-intl php-pecl-imagick php-mcrypt php-memcache php-pear lighttpd-fastcgi - -### 设置Lighttpd的PHP服务 - -如要让PHP与Lighttpd协同工作,我们只要根据所使用的发行版执行如下对应的指令即可。 - -#### 使用 CentOS 7 - -首先要做的便是使用文件编辑器编辑php设置文件(例如`/etc/php.ini`)并取消掉对**cgi.fix_pathinfo=1**的注释。 - - # nano /etc/php.ini - -完成上面的步骤之后,我们需要把PHP-FPM进程的所有权从Apache转移至Lighttpd。要完成这些,首先用文件编辑器打开`/etc/php-fpm.d/www.conf`文件。 - - # nano /etc/php-fpm.d/www.conf - -然后在文件中增加下面的语句: - - user = lighttpd - group = lighttpd - -做完这些,我们保存并退出文本编辑器。然后从`/etc/lighttpd/modules.conf`设置文件中添加FastCGI模块。 - - # nano /etc/lighttpd/modules.conf - -然后,去掉下面语句前面的`#`来取消对它的注释。 - - include "conf.d/fastcgi.conf" - -最后我们还需在文本编辑器设置FastCGI的设置文件。 - - # nano /etc/lighttpd/conf.d/fastcgi.conf - -在文件尾部添加以下代码: - - fastcgi.server += ( ".php" => - (( - "host" => "127.0.0.1", - "port" => "9000", - "broken-scriptfilename" => "enable" - )) - ) - -在编辑完成后保存并退出文本编辑器即可。 - -#### 使用 Ubuntu 15.04 - -如需启用Lighttpd的FastCGI,只需执行下列代码: - - # lighttpd-enable-mod fastcgi - - Enabling fastcgi: ok - Run /etc/init.d/lighttpd force-reload to enable changes - - # lighttpd-enable-mod fastcgi-php - - Enabling fastcgi-php: ok - Run `/etc/init.d/lighttpd` force-reload to enable changes - -然后,执行下列命令来重启Lighttpd。 - - # systemctl force-reload lighttpd - -### 检测PHP工作状态 - -如需检测PHP是否按预期工作,我们需在Lighttpd的webroot目录下新建一个php文件。本教程中,在Ubuntu下/var/www/html 目录,CentOS下/src/www/htdocs目录下使用文本编辑器创建并打开info.php。 - -**使用 CentOS 7** - - # nano /var/www/info.php - -**使用 Ubuntu 15.04** - - # nano /srv/www/htdocs/info.php - -然后只需将下面的语句添加到文件里即可。 - - - -在编辑完成后保存并推出文本编辑器即可。 - -现在,我们需根据路径 [http://lighttpd.linoxide.com/info.php](http://lighttpd.linoxide.com/info.php) 下的info.php文件的IP地址或域名,来让我们的网页浏览器指向系统上运行的Lighttpd。如果一切都按照以上说明进行,我们将看到如下图所示的PHP页面信息。 - -![phpinfo lighttpd](http://blog.linoxide.com/wp-content/uploads/2016/02/phpinfo-lighttpd.png) - -### 总结 - -至此,我们已经在CentOS 7和Ubuntu 15.04 Linux 发行版上成功安装了轻巧快捷并且安全的Lighttpd Web服务器。现在,我们已经可以利用Lighttpd Web服务器来实现上传网站文件到网站根目录,配置虚拟主机,启用SSL,连接数据库,运行Web应用等功能了。 如果你有任何疑问,建议或反馈请在下面的评论区中写下来以让我们更好的改良Lighttpd。谢谢!(译注:评论网址 http://linoxide.com/linux-how-to/setup-lighttpd-web-server-ubuntu-15-04-centos-7/ ) --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/setup-lighttpd-web-server-ubuntu-15-04-centos-7/ - -作者:[Arun Pyasi][a] -译者:[HaohongWANG](https://github.com/HaohongWANG) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/arunp/ From 0974bbba79d51c90b3698b3b1306ae903880a015 Mon Sep 17 00:00:00 2001 From: Mike Tang Date: Thu, 7 Jul 2016 10:18:00 +0800 Subject: [PATCH 1081/1469] Mike Translating 20160609 INSTALL MATE 1.14 IN UBUNTU MATE 16.04 VIA PPA.md --- .../20160609 INSTALL MATE 1.14 IN UBUNTU MATE 16.04 VIA PPA.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160609 INSTALL MATE 1.14 IN UBUNTU MATE 16.04 VIA PPA.md b/sources/tech/20160609 INSTALL MATE 1.14 IN UBUNTU MATE 16.04 VIA PPA.md index 07b0f4e5a3..238739ac0e 100644 --- a/sources/tech/20160609 INSTALL MATE 1.14 IN UBUNTU MATE 16.04 VIA PPA.md +++ b/sources/tech/20160609 INSTALL MATE 1.14 IN UBUNTU MATE 16.04 VIA PPA.md @@ -1,3 +1,5 @@ +MikeCoder Translating + INSTALL MATE 1.14 IN UBUNTU MATE 16.04 (XENIAL XERUS) VIA PPA ================================================================= From e830e2e57ac22d3935e86be765f69a174a3b0d08 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 7 Jul 2016 10:27:47 +0800 Subject: [PATCH 1082/1469] PUB:20160301 The Evolving Market for Commercial Software Built On Open Source MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @alim0x 语言组织的很不错! --- ...ommercial Software Built On Open Source.md | 37 +++++++++++++++++++ ...ommercial Software Built On Open Source.md | 36 ------------------ 2 files changed, 37 insertions(+), 36 deletions(-) create mode 100644 published/20160301 The Evolving Market for Commercial Software Built On Open Source.md delete mode 100644 translated/tech/20160301 The Evolving Market for Commercial Software Built On Open Source.md diff --git a/published/20160301 The Evolving Market for Commercial Software Built On Open Source.md b/published/20160301 The Evolving Market for Commercial Software Built On Open Source.md new file mode 100644 index 0000000000..fa3448b1bb --- /dev/null +++ b/published/20160301 The Evolving Market for Commercial Software Built On Open Source.md @@ -0,0 +1,37 @@ +构建在开源之上的商业软件市场持续成长 +===================================================================== + +![](https://www.linux.com/images/stories/41373/Structure-event-photo.jpg) + +*与会者在 Structure 上听取演讲,Structure Data 2016 也将在 UCSF Mission Bay 会议中心举办。图片来源:Structure Events。* + +如今真的很难低估开源项目对于企业软件市场的影响;开源软件的集成如此快速地形成了业界常态,我们没能捕捉到转折点也情有可原。 + +举个例子,Hadoop,改变的不止是数据分析界,它引领了新一代数据公司,它们围绕开源项目创造自己的软件,按需调整和支持那些代码,更像红帽在上世纪 90 年代和本世纪早期拥抱 Linux 那样。软件越来越多地通过公有云交付,而不是运行在购买者自己的服务器,拥有了令人惊奇的操作灵活性,但同时也带来了一些关于授权、支持以及价格之类的新问题。 + +我们多年来持续追踪这个趋势,这些话题充斥了我们的 Structure Data 会议,而今年的 Structure Data 2016 也不例外。三家围绕 Hadoop 最重要的大数据公司——Hortonworks、Cloudera 和 MapR ——的 CEO 们将会共同讨论它们是如何销售他们围绕开源项目的企业软件和服务,获利的同时回报社区项目。 + +以前在企业软件上获利是很容易的事情。一个客户购买了之后,企业供应商的一系列软件就变成了收银机,从维护合同和阶段性升级中获得近乎终生的收入,软件也越来越难以被替代,因为它已经成为了客户的业务核心。客户抱怨这种绑定,但如果它们想提高工作队伍的生产力也确实没有多少选择。 + +而现在的情况不再是这样了。尽管无数的公司还陷于在他们的基础设施上运行至关重要的巨型软件包,新的项目被部署到使用开源技术的云服务器上。这让升级功能不再需要去掉大量软件包再重新安装别的,同时也让公司按需付费,而不是为一堆永远用不到的特性买单。 + +有很多客户想要利用开源项目的优势,而又不想建立和支持一支工程师队伍来调整那些开源项目以满足自己的需求。这些客户愿意为开源项目和在这之上的专有特性之间的差异付费。 + +这对于基础设施相关的软件来说格外正确。当然,你的客户们可以自己对项目进行调整,比如 Hadoop,Spark 或 Node.js,但付费可以帮助他们自定义地打包部署如今这些重要的开源技术,而不用自己干这些活儿。只需看看 Structure Data 2016 的发言者就明白了,比如 Confluent(Kafka),Databricks(Spark),以及 Cloudera-Hortonworks-MapR(Hadoop)三人组。 + +当然还有一个值得提到的是在出错的时候有个供应商给你背锅。如果你的工程师弄糟了开源项目的实现,那你只能怪你自己了。但是如果你和一个愿意提供服务级品质、能确保性能和正常运行时间指标的公司签订了合同,你实际上就是为得到支持、指导,以及有人背锅而买单。 + +构建在开源之上的商业软件市场的持续成长是我们在 Structure Data 上追踪多年的内容,如果这个话题正合你意,我们鼓励你加入我们,在旧金山,3 月 9 日和 10 日。 + + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/enterprise/cloud-computing/889564-the-evolving-market-for-commercial-software-built-on-open-source- + +作者:[Tom Krazit][a] +译者:[alim0x](https://github.com/alim0x) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/community/forums/person/70513 diff --git a/translated/tech/20160301 The Evolving Market for Commercial Software Built On Open Source.md b/translated/tech/20160301 The Evolving Market for Commercial Software Built On Open Source.md deleted file mode 100644 index c45b3eb760..0000000000 --- a/translated/tech/20160301 The Evolving Market for Commercial Software Built On Open Source.md +++ /dev/null @@ -1,36 +0,0 @@ -构建在开源之上的商业软件市场持续成长 -===================================================================== - -![](https://www.linux.com/images/stories/41373/Structure-event-photo.jpg) -> 与会者在 Structure 上听取演讲,Structure Data 2016 也将在 UCSF Mission Bay 会议中心举办。图片来源:Structure Events。 - -如今真的很难低估开源项目对于企业软件市场的影响;开源集成如此快速地形成了规范,我们没能捕捉到转折点也情有可原。 - -举个例子,Hadoop,改变的不止是数据分析的世界。它引领了新一代数据公司,它们围绕开源项目创造自己的软件,按需调整和支持那些代码,更像红帽在 90 年代和 21 世纪早期拥抱 Linux 那样。软件越来越多地通过公有云交付,而不是购买者自己的服务器,拥有了令人惊奇的操作灵活性,但同时也带来了一些关于授权,支持以及价格之类的新问题。 - -我们多年来持续追踪这个趋势,它们组成了我们的 Structure Data 会议,而 Structure Data 2016 也不例外。三家围绕 Hadoop 最重要的大数据公司——Hortonworks,Cloudera 和 MapR——的 CEO 将会共同讨论它们是如何销售他们围绕开源项目的企业软件和服务,获利的同时回报那个社区项目。 - -以前在企业软件上获利是很容易的事情。一个客户购买了之后,企业供应商的一系列大型软件就变成了它自己的收银机,从维护合同和阶段性升级中获得近乎终生的收入,软件也越来越难以被替代,因为它已经成为了客户的业务核心。客户抱怨这种绑定,但如果它们想提高工作队伍的生产力也确实没有多少选择。 - -而现在的情况不再是这样了。尽管无数的公司还陷于在他们的基础设施上运行至关重要的巨大软件包,新的项目被使用开源技术部署到云服务器上。这让升级功能不再需要去掉大量软件包再重新安装别的,同时也让公司按需付费,而不是为一堆永远用不到的特性买单。 - -有很多客户想要利用开源项目的优势,而又不想建立和支持一支工程师队伍来调整开源项目以满足自己的需求。这些客户愿意为开源项目和在这之上的专有特性之间的差异付费。 - -这对于基础设施相关的软件来说格外正确。当然,你的客户们可以安装他们自己对项目的调整,比如 Hadoop,Spark 或 Node.js,但付费可以帮助他们自定义包部署如今重要的开源技术而不用自己干这些活儿。只需看看 Structure Data 2016 的发言者就明白了,比如 Confluent(Kafka),Databricks(Spark),以及 Cloudera-Hortonworks-MapR(Hadoop)三人组。 - -当然还有一个值得提到的是在出错的时候有个供应商给你指责。如果你的工程师弄糟了开源项目的实现,那你只能怪你自己了。但是如果你和一个愿意保证在服务级别的特定性能和正常运行时间指标的公司签订了合同,你就是愿意为支持,指导,以及在突然出现不可避免的问题时朝你公司外的人发火的机会买单。 - -构建在开源之上的商业软件市场的持续成长是我们在 Structure Data 上追踪多年的内容,如果这个话题正合你意,我们鼓励你加入我们,在旧金山,3 月 9 日和 10 日。 - - --------------------------------------------------------------------------------- - -via: https://www.linux.com/news/enterprise/cloud-computing/889564-the-evolving-market-for-commercial-software-built-on-open-source- - -作者:[Tom Krazit ][a] -译者:[alim0x](https://github.com/alim0x) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.linux.com/community/forums/person/70513 From c8a617c9a47666c535ddda47de9e2d60dbd1f8f8 Mon Sep 17 00:00:00 2001 From: Mike Tang Date: Thu, 7 Jul 2016 10:46:19 +0800 Subject: [PATCH 1083/1469] finish translating "INSTALL MATE 1.14 IN UBUNTU MATE 16.04 VIA PPA.md" --- ...MATE 1.14 IN UBUNTU MATE 16.04 VIA PPA.md | 66 ------------------- ...MATE 1.14 IN UBUNTU MATE 16.04 VIA PPA.md | 62 +++++++++++++++++ 2 files changed, 62 insertions(+), 66 deletions(-) delete mode 100644 sources/tech/20160609 INSTALL MATE 1.14 IN UBUNTU MATE 16.04 VIA PPA.md create mode 100644 translated/tech/20160609 INSTALL MATE 1.14 IN UBUNTU MATE 16.04 VIA PPA.md diff --git a/sources/tech/20160609 INSTALL MATE 1.14 IN UBUNTU MATE 16.04 VIA PPA.md b/sources/tech/20160609 INSTALL MATE 1.14 IN UBUNTU MATE 16.04 VIA PPA.md deleted file mode 100644 index 238739ac0e..0000000000 --- a/sources/tech/20160609 INSTALL MATE 1.14 IN UBUNTU MATE 16.04 VIA PPA.md +++ /dev/null @@ -1,66 +0,0 @@ -MikeCoder Translating - -INSTALL MATE 1.14 IN UBUNTU MATE 16.04 (XENIAL XERUS) VIA PPA -================================================================= - -MATE Desktop 1.14 is now available for Ubuntu MATE 16.04 (Xenial Xerus). According to the release [announcement][1], it took about 2 months to release MATE Desktop 1.14 in a PPA because everything has been well tested, so you shouldn't encounter any issues. - -![](https://2.bp.blogspot.com/-v38tLvDAxHg/V1k7beVd5SI/AAAAAAAAX7A/1X72bmQ3ia42ww6kJ_61R-CZ6yrYEBSpgCLcB/s400/mate114-ubuntu1604.png) - -**The PPA currently provides MATE 1.14.1 (Ubuntu MATE 16.04 ships with MATE 1.12.x by default), which includes changes such as:** - -- client-side decoration apps now render correctly in all themes; -- touchpad configuration now supports edge and two-finger scrolling independently; -- python extensions in Caja can now be managed separately; -- all three window focus modes are selectable; -- MATE Panel now has the ability to change icon sizes for menubar and menu items; -- volume and Brightness OSD can now be enabled/disabled; -- many other improvements and bug fixes. - -MATE 1.14 also includes improved support for GTK+3 across the entire desktop, as well as various other GTK+3 tweaks however, the PPA packages are built with GTK+2 "to ensure compatibility with Ubuntu MATE 16.04 and all the 3rd party MATE applets, plugins and extensions", mentions the Ubuntu MATE blog. - -A complete MATE 1.14 changelog can be found [HERE][2]. - -### Upgrade to MATE Desktop 1.14.x in Ubuntu MATE 16.04 - -To upgrade to the latest MATE Desktop 1.14.x in Ubuntu MATE 16.04 using the official Xenial MATE PPA, open a terminal and use the following commands: - -``` -sudo apt-add-repository ppa:ubuntu-mate-dev/xenial-mate -sudo apt update -sudo apt dist-upgrade -``` - -**Note**: mate-netspeed applet will be removed when upgrading. That's because the applet is now part of the mate-applets package, so it's still available. - -Once the upgrade finishes, restart your system. That's it! - -### How to revert the changes - -If you're not satisfied with MATE 1.14, you encountered some bugs, etc., and you want to go back to the MATE version available in the official repositories, you can purge the PPA and downgrade the packages. - -To do this, use the following commands: - -``` -sudo apt install ppa-purge -sudo ppa-purge ppa:ubuntu-mate-dev/xenial-mate -``` - -After all the MATE packages are downgraded, restart the system. - -via [Ubuntu MATE blog][3] - --------------------------------------------------------------------------------- - -via: http://www.webupd8.org/2016/06/install-mate-114-in-ubuntu-mate-1604.html - -作者:[Andrew][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://www.webupd8.org/p/about.html -[1]: https://ubuntu-mate.org/blog/mate-desktop-114-for-xenial-xerus/ -[2]: http://mate-desktop.com/blog/2016-04-08-mate-1-14-released/ -[3]: https://ubuntu-mate.org/blog/mate-desktop-114-for-xenial-xerus/ diff --git a/translated/tech/20160609 INSTALL MATE 1.14 IN UBUNTU MATE 16.04 VIA PPA.md b/translated/tech/20160609 INSTALL MATE 1.14 IN UBUNTU MATE 16.04 VIA PPA.md new file mode 100644 index 0000000000..63ea47c541 --- /dev/null +++ b/translated/tech/20160609 INSTALL MATE 1.14 IN UBUNTU MATE 16.04 VIA PPA.md @@ -0,0 +1,62 @@ +在 Ubuntu Mate 16.04("Xenial Xerus") 上通过 PPA 安装 Mate 1.14 +================================================================= + +Mate 桌面环境 1.14 现在可以在 Ubuntu Mate 16.04("Xenial Xerus") 上使用了。根据这个[发布版本][1]的描述, 为了全面测试 Mate 1.14,所以在 PPA 上发布 Mate 桌面环境 1.14大概了用2个月的时间。因此,你不太可能遇到安装的问题。 + +![](https://2.bp.blogspot.com/-v38tLvDAxHg/V1k7beVd5SI/AAAAAAAAX7A/1X72bmQ3ia42ww6kJ_61R-CZ6yrYEBSpgCLcB/s400/mate114-ubuntu1604.png) + +**现在 PPA 提供 Mate 1.14.1 包含如下改变(Ubuntu Mate 16.04 默认安装的是 Mate 1.12.x):** + +- 客户端的装饰应用现在可以正确的在所有主题中渲染; +- 触摸板配置现在支持边缘操作和双指的滚动; +- 在 Caja 中的 Python 扩展可以被单独管理; +- 所有三个窗口焦点模式都是是可选的; +- Mate Panel 中的所有菜单栏图标和菜单图标可以改变大小; +- 音量和亮度 OSD 目前可以启用和禁用; +- 更多的改进和 bug 修改; + +Mate 1.14 同时改进了整个桌面环境中对 GTK+3 的支持,包括各种各项的 GTK+3 小应用。但是,Ubuntu MATE 的博客中提到:PPA 的发行包使用 GTK+2编译"为了确保对 Ubuntu MATE 16.05还有各种各样的第三方 MATE 应用,插件,扩展的支持"。 + +MATE 1.14 的完成修改列表[点击此处][2]阅读。 + +### 在 Ubuntu MATE 16.04 中升级 MATE 1.14.x + +在 Ubuntu MATE 16.04 中打开终端,并且输入如下命令,来从官方的 Xenial MATE PPA 中升级最新的 MATE 桌面环境: + +``` +sudo apt-add-repository ppa:ubuntu-mate-dev/xenial-mate +sudo apt update +sudo apt dist-upgrade +``` + +**注意**: mate-netspeed 应用将会在升级中删除。因为该应用现在已经是 mate-applets 应用报的一部分,所以他依旧是可以获得的。 + +一旦升级完成,请重启你的系统,享受全新的 MATE! + +### 如何回滚这次升级 + +如果你并不满意 MATE 1.14, 比如你遭遇了一些 bug 。或者你想回到 MATE 的官方源版本,你可以使用如下的命令清除 PPA,并且下载降级包。 + +``` +sudo apt install ppa-purge +sudo ppa-purge ppa:ubuntu-mate-dev/xenial-mate +``` + +在所有的 MATE 包降级之后,重启系统。 + +via [Ubuntu MATE blog][3] + +-------------------------------------------------------------------------------- + +via: http://www.webupd8.org/2016/06/install-mate-114-in-ubuntu-mate-1604.html + +作者:[Andrew][a] +译者:[译者ID](https://github.com/MikeCoder) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.webupd8.org/p/about.html +[1]: https://ubuntu-mate.org/blog/mate-desktop-114-for-xenial-xerus/ +[2]: http://mate-desktop.com/blog/2016-04-08-mate-1-14-released/ +[3]: https://ubuntu-mate.org/blog/mate-desktop-114-for-xenial-xerus/ From b81108a34c617faefc38dbf171f340ab6f92b967 Mon Sep 17 00:00:00 2001 From: martin qi Date: Wed, 6 Jul 2016 22:04:25 -0500 Subject: [PATCH 1084/1469] translating --- ...Create LVM Using vgcreate, lvcreate and lvextend Commands.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/LFCS/Part 11 - How to Manage and Create LVM Using vgcreate, lvcreate and lvextend Commands.md b/sources/tech/LFCS/Part 11 - How to Manage and Create LVM Using vgcreate, lvcreate and lvextend Commands.md index 4d2a9d7a13..390ad18e14 100644 --- a/sources/tech/LFCS/Part 11 - How to Manage and Create LVM Using vgcreate, lvcreate and lvextend Commands.md +++ b/sources/tech/LFCS/Part 11 - How to Manage and Create LVM Using vgcreate, lvcreate and lvextend Commands.md @@ -1,3 +1,5 @@ +martin + Part 11 - How to Manage and Create LVM Using vgcreate, lvcreate and lvextend Commands ============================================================================================ From 31ad3c1e2596310d5c76f5eb376c6928abefe2bf Mon Sep 17 00:00:00 2001 From: Ping Date: Thu, 7 Jul 2016 11:13:06 +0800 Subject: [PATCH 1085/1469] Translating --- .../20160304 Microservices with Python RabbitMQ and Nameko.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160304 Microservices with Python RabbitMQ and Nameko.md b/sources/tech/20160304 Microservices with Python RabbitMQ and Nameko.md index 5048465904..6879a0778b 100644 --- a/sources/tech/20160304 Microservices with Python RabbitMQ and Nameko.md +++ b/sources/tech/20160304 Microservices with Python RabbitMQ and Nameko.md @@ -1,3 +1,5 @@ +Translating by Ping + Microservices with Python RabbitMQ and Nameko ============================================== From 20a922daf85836a96f09d121f02b53b10fb7da99 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 7 Jul 2016 11:33:55 +0800 Subject: [PATCH 1086/1469] PUB:Part 10 - LFCS--Understanding and Learning Basic Shell Scripting and Linux Filesystem Troubleshooting.md @GHLandy --- ...ng and Linux Filesystem Troubleshooting.md | 94 +++++++++---------- 1 file changed, 47 insertions(+), 47 deletions(-) rename {translated/tech => published}/LFCS/Part 10 - LFCS--Understanding and Learning Basic Shell Scripting and Linux Filesystem Troubleshooting.md (67%) diff --git a/translated/tech/LFCS/Part 10 - LFCS--Understanding and Learning Basic Shell Scripting and Linux Filesystem Troubleshooting.md b/published/LFCS/Part 10 - LFCS--Understanding and Learning Basic Shell Scripting and Linux Filesystem Troubleshooting.md similarity index 67% rename from translated/tech/LFCS/Part 10 - LFCS--Understanding and Learning Basic Shell Scripting and Linux Filesystem Troubleshooting.md rename to published/LFCS/Part 10 - LFCS--Understanding and Learning Basic Shell Scripting and Linux Filesystem Troubleshooting.md index 884ad9055f..c58e73d197 100644 --- a/translated/tech/LFCS/Part 10 - LFCS--Understanding and Learning Basic Shell Scripting and Linux Filesystem Troubleshooting.md +++ b/published/LFCS/Part 10 - LFCS--Understanding and Learning Basic Shell Scripting and Linux Filesystem Troubleshooting.md @@ -1,10 +1,10 @@ -LFCS 第十讲:学习简单的 Shell 脚本编程和文件系统故障排除 +LFCS 系列第十讲:学习简单的 Shell 脚本编程和文件系统故障排除 ================================================================================ -Linux 基金会发起了 LFCS 认证 (Linux Foundation Certified Sysadmin, Linux 基金会认证系统管理员),这是一个全新的认证体系,主要目标是让全世界任何人都有机会考取认证。认证内容为 Linux 中间系统的管理,主要包括:系统运行和服务的维护、全面监控和分析的能力以及问题来临时何时想上游团队请求帮助的决策能力 +Linux 基金会发起了 LFCS 认证 (Linux Foundation Certified Sysadmin,Linux 基金会认证系统管理员),这是一个全新的认证体系,旨在让世界各地的人能够参与到中等水平的 Linux 系统的基本管理操作的认证考试中去,这项认证包括:维护正在运行的系统和服务的能力、全面监控和分析的能力以及何时向上游团队请求支持的决策能力。 ![Basic Shell Scripting and Filesystem Troubleshooting](http://www.tecmint.com/wp-content/uploads/2014/11/lfcs-Part-10.png) -LFCS 系列第十讲 +*LFCS 系列第十讲* 请看以下视频,这里边介绍了 Linux 基金会认证程序。 @@ -18,54 +18,53 @@ LFCS 系列第十讲 首先要声明一些概念。 - Shell 是一个程序,它将命令传递给操作系统来执行。 -- Terminal 也是一个程序,作为最终用户,我们需要使用它与 Shell 来交互。比如,下边的图片是 GNOME Terminal。 +- Terminal 也是一个程序,允许最终用户使用它与 Shell 来交互。比如,下边的图片是 GNOME Terminal。 ![Gnome Terminal](http://www.tecmint.com/wp-content/uploads/2014/11/Gnome-Terminal.png) -Gnome Terminal +*Gnome Terminal* 启动 Shell 之后,会呈现一个命令提示符 (也称为命令行) 提示我们 Shell 已经做好了准备,接受标准输入设备输入的命令,这个标准输入设备通常是键盘。 -你可以参考该系列文章的 [第一讲 使用命令创建、编辑和操作文件][1] 来温习一些常用的命令。 +你可以参考该系列文章的 [第一讲 如何在 Linux 上使用 GNU sed 等命令来创建、编辑和操作文件][1] 来温习一些常用的命令。 Linux 为提供了许多可以选用的 Shell,下面列出一些常用的: **bash Shell** -Bash 代表 Bourne Again Shell,它是 GNU 项目默认的 Shell。它借鉴了 Korn shell (ksh) 和 C shell (csh) 中有用的特性,并同时对性能进行了提升。它同时也是 LFCS 认证中所涵盖的风发行版中默认 Shell,也是本系列教程将使用的 Shell。 +Bash 代表 Bourne Again Shell,它是 GNU 项目默认的 Shell。它借鉴了 Korn shell (ksh) 和 C shell (csh) 中有用的特性,并同时对性能进行了提升。它同时也是 LFCS 认证中所涵盖的各发行版中默认 Shell,也是本系列教程将使用的 Shell。 **sh Shell** -Bash Shell 是一个比较古老的 shell,一次多年来都是多数类 Unix 系统的默认 shell。 +Bourne SHell 是一个比较古老的 shell,多年来一直都是很多类 Unix 系统的默认 shell。 **ksh Shell** Korn SHell (ksh shell) 也是一个 Unix shell,是贝尔实验室 (Bell Labs) 的 David Korn 在 19 世纪 80 年代初的时候开发的。它兼容 Bourne shell ,并同时包含了 C shell 中的多数特性。 - 一个 shell 脚本仅仅只是一个可执行的文本文件,里边包含一条条可执行命令。 ### 简单的 Shell 脚本编程 ### -如前所述,一个 shell 脚本就是一个纯文本文件,因此,可以使用自己喜欢的文本编辑器来创建和编辑。你可以考虑使用 vi/vim (参考本系列 [第二部分 - vi/vim 编辑器的使用][2]),它的语法高亮让我的编辑工作非常方便。 +如前所述,一个 shell 脚本就是一个纯文本文件,因此,可以使用自己喜欢的文本编辑器来创建和编辑。你可以考虑使用 vi/vim (参考本系列 [第二讲 如何安装和使用纯文本编辑器 vi/vim][2]),它的语法高亮让我的编辑工作非常方便。 输入如下命令来创建一个名为 myscript.sh 的脚本文件: # vim myscript.sh -shell 脚本的第一行 (著名的 [shebang 符](http://smilejay.com/2012/03/linux_shebang/)) 必须如下: +shell 脚本的第一行 (著名的 [释伴(shebang)行](https://linux.cn/article-3664-1.html)) 必须如下: #!/bin/bash -这条语句“告诉”操作系统需要用那个解释器来运行这个脚本文件之后命令。 +这条语句“告诉”操作系统需要用哪个解释器来运行这个脚本文件之后命令。 -现在可以添加需要执行的命令了。通过注释,我们可以声明每一条命令或者整个脚本的具体含义。注意,shell 会忽略掉以井号 (#) 开始的语句。 +现在可以添加需要执行的命令了。通过注释,我们可以声明每一条命令或者整个脚本的具体含义。注意,shell 会忽略掉以井号 (#) 开始的注释语句。 #!/bin/bash echo 这是关于 LFCS 认证系列的第十部分 echo 今天是 $(date +%Y-%m-%d) -编写并保存脚本之后,通过以下命令来是脚本文件称为可执行文件: +编写并保存脚本之后,通过以下命令来使脚本文件成为可执行文件: # chmod 755 myscript.sh @@ -73,17 +72,17 @@ shell 脚本的第一行 (著名的 [shebang 符](http://smilejay.com/2012/03/li echo $PATH -我们就会看到环境变量 ($PATH) 的具体内容:当输入命令是系统搜索可执行程序的目录,每一项之间使用冒号 (:) 隔开。称它为环境变量,是因为他本是就是 shell 环境的一部分 —— 当 shell 第每次启动时 shell 及其子进程可以获取的一系列信息。 +我们就会看到环境变量 ($PATH) 的具体内容:这是当输入命令时系统所搜索可执行程序的目录,每一项之间使用冒号 (:) 隔开。称它为环境变量,是因为它本是就是 shell 环境的一部分 —— 这是当 shell 每次启动时 shell 及其子进程可以获取的一系列信息。 当我们输入一个命令并按下回车时,shell 会搜索 $PATH 变量中列出的目录并执行第一个知道的实例。请看如下例子: ![Linux Environment Variables](http://www.tecmint.com/wp-content/uploads/2014/11/Environment-Variable.png) -环境变量 +*环境变量* 假如存在两个同名的可执行程序,一个在 /usr/local/bin,另一个在 /usr/bin,则会执行环境变量中最先列出的那个,并忽略另外一个。 -如果我们自己编写的脚本没有在 $PATH 变量列出目录的其中一个,则需要输入 ./filename 来执行它。而如果存储在 $PATH 变量中的任意一个目录,我们就可以像运行其他命令一样来运行之前编写的脚本了。 +如果我们自己编写的脚本没有放在 $PATH 变量列出目录中的任何一个,则需要输入 ./filename 来执行它。而如果存储在 $PATH 变量中的任意一个目录,我们就可以像运行其他命令一样来运行之前编写的脚本了。 # pwd # ./myscript.sh @@ -94,7 +93,7 @@ shell 脚本的第一行 (著名的 [shebang 符](http://smilejay.com/2012/03/li ![Execute Script in Linux](http://www.tecmint.com/wp-content/uploads/2014/11/Execute-Script.png) -执行脚本 +*执行脚本* #### if 条件语句 #### @@ -106,22 +105,22 @@ shell 脚本的第一行 (著名的 [shebang 符](http://smilejay.com/2012/03/li OTHER-COMMANDS fi -其中,CONDITION 为如下情形的任意一项 (仅列出常用的),并且达到以下条件时返回 true: +其中,CONDITION 可以是如下情形的任意一项 (仅列出常用的),并且达到以下条件时返回 true: - [ -a file ] → 指定文件存在。 - [ -d file ] → 指定文件存在,并且是一个目录。 - [ -f file ] → 指定文件存在,并且是一个普通文件。 -- [ -u file ] → 指定文件存在,并设置了 SUID。 -- [ -g file ] → 指定文件存在,并设置了 SGID。 +- [ -u file ] → 指定文件存在,并设置了 SUID 权限位。 +- [ -g file ] → 指定文件存在,并设置了 SGID 权限位。 - [ -k file ] → 指定文件存在,并设置了“黏连 (Sticky)”位。 - [ -r file ] → 指定文件存在,并且文件可读。 -- [ -s file ] → 指定文件存在,并且文件为空。 -- [ -w file ] → 指定文件存在,并且文件可写入· +- [ -s file ] → 指定文件存在,并且文件不为空。 +- [ -w file ] → 指定文件存在,并且文件可写入。 - [ -x file ] → 指定文件存在,并且可执行。 - [ string1 = string2 ] → 字符串相同。 - [ string1 != string2 ] → 字符串不相同。 -[ int1 op int2 ] 为前述列表中的一部分,紧跟着的项 (例如: -eq –> int1 与 int2 相同时返回 true) 则是 [ int1 op int2 ] 的一个子项, 其中 op 为以下比较操作符。 +[ int1 op int2 ] 为前述列表中的一部分 (例如: -eq –> int1 与 int2 相同时返回 true) ,其中比较项也可以是一个列表子项, 其中 op 为以下比较操作符。 - -eq –> int1 等于 int2 时返回 true。 - -ne –> int1 不等于 int2 时返回 true。 @@ -142,13 +141,13 @@ shell 脚本的第一行 (著名的 [shebang 符](http://smilejay.com/2012/03/li #### While 循环语句 #### -该循环结构会一直执行重复的命令,直到控制命令执行的退出状态值等于 0 时 (即执行成功) 停止。基本语法如下: +该循环结构会一直执行重复的命令,直到控制命令(EVALUATION_COMMAND)执行的退出状态值等于 0 时 (即执行成功) 停止。基本语法如下: while EVALUATION_COMMAND; do EXECUTE_COMMANDS; done -其中,EVALUATION_COMMAND 可以是任何能够返回成功 (0) 或失败 (0 以外的值) 的退出状态值的命令,EXECUTE_COMMANDS 则可以是任何的程序、脚本或者 shell 结构体,包括其他的嵌套循环。 +其中,EVALUATION\_COMMAND 可以是任何能够返回成功 (0) 或失败 (0 以外的值) 的退出状态值的命令,EXECUTE\_COMMANDS 则可以是任何的程序、脚本或者 shell 结构体,包括其他的嵌套循环。 #### 综合使用 #### @@ -168,7 +167,7 @@ shell 脚本的第一行 (著名的 [shebang 符](http://smilejay.com/2012/03/li ![Script to Monitor Linux Services](http://www.tecmint.com/wp-content/uploads/2014/11/Monitor-Services.png) -使用脚本监控 Linux 服务 +*使用脚本监控 Linux 服务* 我们编写的脚本看起来应该是这样的: @@ -188,7 +187,7 @@ shell 脚本的第一行 (著名的 [shebang 符](http://smilejay.com/2012/03/li ![Linux Service Monitoring Script](http://www.tecmint.com/wp-content/uploads/2014/11/Monitor-Script.png) -Linux 服务监控脚本 +*Linux 服务监控脚本* **我们来解释一下这个脚本的工作流程** @@ -196,21 +195,21 @@ Linux 服务监控脚本 # cat myservices.txt -2). 以上命令由圆括号括着,并在前面添加美元符,表示它需要从 myservices.txt 的记录列表中取值作为变量传递给 for 循环。 +2). 以上命令由圆括号括着,并在前面添加美元符,表示它需要从 myservices.txt 的记录列表中取值并作为变量传递给 for 循环。 -3). 对于记录列表中的每一项纪录 (即每一项纪录的服务变量),都会这行以下动作: +3). 对于记录列表中的每一项纪录 (即每一项纪录的服务变量),都会执行以下动作: # systemctl status $service | grep --quiet "running" 此时,需要在每个通用变量名 (即每一项纪录的服务变量) 的前面添加美元符,以表明它是作为变量来传递的。其输出则通过管道符传给 grep。 -其中,-quiet 选项用于阻止 grep 命令将出现 "running" 的行回显到屏幕。当 grep 捕获到 "running" 时,则会返回一个退出状态码 "0" (在 if 结构体表示为 $?),由此确认某个服务正在运行中。 +其中,-quiet 选项用于阻止 grep 命令将发现的 “running” 的行回显到屏幕。当 grep 捕获到 “running” 时,则会返回一个退出状态码 “0” (在 if 结构体表示为 $?),由此确认某个服务正在运行中。 -如果退出状态码是非零值 (即 systemctl status $service 命令中的回显中没有出现 "running"),则表明某个服务为运行。 +如果退出状态码是非零值 (即 systemctl status $service 命令中的回显中没有出现 “running”),则表明某个服务为运行。 ![Services Monitoring Script](http://www.tecmint.com/wp-content/uploads/2014/11/Services-Monitoring-Script.png) -服务监控脚本 +*服务监控脚本* 我们可以增加一步,在开始循环之前,先确认 myservices.txt 是否存在。 @@ -236,7 +235,7 @@ Linux 服务监控脚本 你可能想把自己维护的主机写入一个文本文件,并使用脚本探测它们是否能够 ping 得通 (脚本中的 myhosts 可以随意替换为你想要的名称)。 -内置的 read shell 命令将告诉 while 循环一行行的读取 myhosts,并将读取的每行内容传给 host 变量,随后 host 变量传递给 ping 命令。 +shell 的内置 read 命令将告诉 while 循环一行行的读取 myhosts,并将读取的每行内容传给 host 变量,随后 host 变量传递给 ping 命令。 #!/bin/bash @@ -248,18 +247,18 @@ Linux 服务监控脚本 ![Script to Ping Servers](http://www.tecmint.com/wp-content/uploads/2014/11/Script-to-Ping-Servers.png) -使用脚本 Ping 服务器 +*使用脚本 Ping 服务器* 扩展阅读: - [Learn Shell Scripting: A Guide from Newbies to System Administrator][3] - [5 Shell Scripts to Learn Shell Programming][4] -### 文件系统排除 ### +### 文件系统排错 ### -尽管 Linux 是一个很稳定的操作系统,但仍然会因为某些原因出现崩溃 (比如以外断电等),正好你有一个 (或者更多个) 文件系统未能正确卸载,Linux 重启的时候就会自动检测其中可能发生的错误。 +尽管 Linux 是一个很稳定的操作系统,但仍然会因为某些原因出现崩溃时 (比如因为断电等),正好你有一个 (或者更多个) 文件系统未能正确卸载,Linux 重启的时候就会自动检测其中可能发生的错误。 -此外,每次系统正常启动的时候,都会在文件系统挂载之前校验它们的完整度。而这些全部都依赖于 fsck 工具 ("文件系统校验")。 +此外,每次系统正常启动的时候,都会在文件系统挂载之前校验它们的完整度。而这些全部都依赖于 fsck 工具 (“file system check,文件系统校验”)。 如果对 fsck 进行设定,它除了校验文件系统的完整性之外,还可以尝试修复错误。fsck 能否成功修复错误,取决于文件系统的损伤程度;如果可以修复,被损坏部分的文件会恢复到位于每个文件系统根目录的 lost+found。 @@ -279,13 +278,13 @@ fsck 的基本用如下: ![Scan Linux Filesystem for Errors](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Filesystem-Errors.png) -检查文件系统错误 +*检查文件系统错误* -除了 -y 选项,我们也可以使用 -a 选项来自动修复文件系统错误,而不必做出交互式应答,并在文件系统看起来 "干净" 的情况下强制校验。 +除了 -y 选项,我们也可以使用 -a 选项来自动修复文件系统错误,而不必做出交互式应答,并在文件系统看起来 “干净” 卸载的情况下强制校验。 # fsck -af /dev/sdg1 -如果只是要找出什么地方发生了错误 (不用再检测到错误的时候修复),我们开使用 -n 选项,这样只会讲文集系统错误输出到标准输出设备。 +如果只是要找出什么地方发生了错误 (不用在检测到错误的时候修复),我们可以使用 -n 选项,这样只会将文件系统错误输出到标准输出设备上。 # fsck -n /dev/sdg1 @@ -293,11 +292,11 @@ fsck 的基本用如下: ### 总结 ### -至此,系列教程的十讲就全部结束了,全系列教程涵盖了通过 LFCS 测试所需的基础内容。 +至此,系列教程的第十讲就全部结束了,全系列教程涵盖了通过 LFCS 测试所需的基础内容。 -但显而易见的,本系列的十讲并不足以在单个主题方面做到全面描述,我们希望这一系列教程可以成为你学习的基础素材,并一直保持学习的热情。 +但显而易见的,本系列的十讲并不足以在单个主题方面做到全面描述,我们希望这一系列教程可以成为你学习的基础素材,并一直保持学习的热情(LCTT 译注:还有后继补充的几篇)。 -我们欢迎你提出任何问题或者建议,所以你可以毫不犹豫的通过以下链接联系我们。 +我们欢迎你提出任何问题或者建议,所以你可以毫不犹豫的通过以下链接联系到我们: 成为一个 [Linux 认证系统工程师][5] -------------------------------------------------------------------------------- @@ -305,12 +304,13 @@ via: http://www.tecmint.com/linux-basic-shell-scripting-and-linux-filesystem-tro 作者:[Gabriel Cánepa][a] 译者:[GHLandy](https://github.com/GHLandy) -校对:[校对者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/gacanepa/ -[1]:http://www.tecmint.com/sed-command-to-create-edit-and-manipulate-files-in-linux/ -[2]:http://www.tecmint.com/vi-editor-usage/ +[1]:https://linux.cn/article-7161-1.html +[2]:https://linux.cn/article-7165-1.html [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/ +[5]:http://www.shareasale.com/r.cfm?b=768106&u=1260899&m=59485&urllink=&afftrack= From a544a71b9b93837acf5e90124ec81544d291a11d Mon Sep 17 00:00:00 2001 From: kokialoves <498497353@qq.com> Date: Thu, 7 Jul 2016 11:36:11 +0800 Subject: [PATCH 1087/1469] Update Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md --- ...xplore Linux with Installed Help Documentations and Tools.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md b/sources/tech/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md index 60903d5cce..e4cf8cb12d 100644 --- a/sources/tech/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md +++ b/sources/tech/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md @@ -1,4 +1,4 @@ -翻译申请 tresspassing2 +[translating by kokialoves] Part 12 - LFCS: How to Explore Linux with Installed Help Documentations and Tools ================================================================================== From 5929a18fcd8901faae1c7ebdceb0cc70482b2dc7 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 7 Jul 2016 14:50:44 +0800 Subject: [PATCH 1088/1469] PUB:20160527 Turn Your Old Laptop into a Chromebook @alim0x --- ... Turn Your Old Laptop into a Chromebook.md | 39 +++++++++++-------- 1 file changed, 23 insertions(+), 16 deletions(-) rename {translated/tech => published}/20160527 Turn Your Old Laptop into a Chromebook.md (91%) diff --git a/translated/tech/20160527 Turn Your Old Laptop into a Chromebook.md b/published/20160527 Turn Your Old Laptop into a Chromebook.md similarity index 91% rename from translated/tech/20160527 Turn Your Old Laptop into a Chromebook.md rename to published/20160527 Turn Your Old Laptop into a Chromebook.md index 3c7038a2a2..df776e73b5 100644 --- a/translated/tech/20160527 Turn Your Old Laptop into a Chromebook.md +++ b/published/20160527 Turn Your Old Laptop into a Chromebook.md @@ -2,7 +2,8 @@ ======================================== ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/cloud-ready-main.jpg?itok=gtzJVSq0) ->学习如何用 CloudReady 在你的旧电脑上安装 Chrome OS + +*学习如何用 CloudReady 在你的旧电脑上安装 Chrome OS* Linux 之年就在眼前。根据[报道][1],Google 在 2016 年第一季度卖出了比苹果卖出的 Macbook 更多的 Chromebook。并且,Chromebook 即将变得更加激动人心。在 Google I/O 大会上,Google 宣布安卓 Google Play 商店将在 6 月中旬来到 Chromebook,这让用户能够在他们的 Chrome OS 设备上运行安卓应用。 @@ -16,33 +17,35 @@ Linux 之年就在眼前。根据[报道][1],Google 在 2016 年第一季度 在你开始在笔记本上安装 CloudReady 之前,你需要一些准备: -- 一个容量大于等于 4GB 的 USB 存储设备 - +- 一个容量不小于 4GB 的 USB 存储设备 - 打开 Chrome 浏览器,到 Google Chrome Store 去安装 [Chromebook Recovery Utility(Chrome 恢复工具)][3] - - 更改目标机器的 BIOS 设置以便能从 USB 启动 ### 开始 Neverware 提供两个版本的 CloudReady 镜像:32 位和 64 位。从下载页面[下载][4]合适你硬件的系统版本。 -解压下载的 zip 文件,你会得到一个 chromiumos_image.bin 文件。现在插入 U 盘并打开 Chromebook recovery utility。点击工具右上角的齿轮,选择 erase recovery media(擦除恢复媒介,如图 1)。 +解压下载的 zip 文件,你会得到一个 chromiumos_image.bin 文件。现在插入 U 盘并打开 Chromebook Recovery Utility。点击工具右上角的齿轮,选择 erase recovery media(擦除恢复媒介,如图 1)。 ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/cloudready-erase.png?itok=1si1QrCL) ->图 1:选择 erase recovery media。[image:cloudready-erase] + +*图 1:选择 erase recovery media。[image:cloudready-erase]* 接下来,选择目标 USB 驱动器并把它格式化。格式化完成后,再次打开右上齿轮,这次选择 use local image(使用本地镜像)。浏览解压的 bin 文件并选中,选好 USB 驱动器,点击继续,然后点击创建按钮(图 2)。它会开始将镜像写入驱动器。 ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/cloudready-create.png?itok=S1FGzRp-) ->图 2:创建 CloudReady 镜像。[Image:cloudready-create] + +*图 2:创建 CloudReady 镜像。[Image:cloudready-create]* 驱动器写好可启动的 CloudReady 之后,插到目标 PC 上并启动。系统启动进 Chromium OS 需要一小段时间。启动之后,你会看到图 3 中的界面。 ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/cloud-ready-install-1.jpg?itok=D6SjlIQ4) ->图 3:准备好安装 CloudReady。 + +*图 3:准备好安装 CloudReady。* ![](https://www.linux.com/sites/lcom/files/styles/floated_images/public/cloud-ready-install-single_crop.jpg?itok=My2rUjYC) ->图 4:单系统选项。 + +*图 4:单系统选项。* 到任务栏选择 Install CloudReady(安装 CloudReady)。 @@ -53,7 +56,8 @@ Neverware 提供两个版本的 CloudReady 镜像:32 位和 64 位。从下载 按照下一步按钮说明选择安装。 ![](https://www.linux.com/sites/lcom/files/styles/floated_images/public/cloud-ready-install-dual_crop.jpg?itok=Daywck_s) ->图 5:双系统选项。 + +*图 5:双系统选项。* 整个过程最多 20 分钟左右,这取决于存储媒介和处理能力。安装完成后,电脑会关闭并重启。 @@ -62,17 +66,20 @@ Neverware 提供两个版本的 CloudReady 镜像:32 位和 64 位。从下载 你连上无线网络之后,系统会自动查找更新并提供 Adobe Flash 安装。安装完成后,你会看到 Chromium OS 登录界面。现在你只需登录你的 Gmail 账户,开始使用你的“Chromebook”即可。 ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/cloud-ready-post-install-network.jpg?itok=gSX2fQZS) ->图 6:网络设置。 + +*图 6:网络设置。* ### 让 Netflix 正常工作 如果你想要播放 Netflix 或其它 DRM 保护流媒体站点,你需要做一些额外的工作。转到设置并点击安装 Widevine 插件(图 7)。 ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/install_widevine.png?itok=bUJaRmyx0) ->图 7:安装 Widevine。 + +*图 7:安装 Widevine。* ![](https://www.linux.com/sites/lcom/files/styles/floated_images/public/user-agent-changer.jpg?itok=5QDCLrZk) ->图 8:安装 User Agent Switcher. + +*图 8:安装 User Agent Switcher。* 现在你需要使用 user agent switcher 这个伎俩(图 8)。 @@ -96,20 +103,20 @@ Indicator Flag: "IE" 点击“添加(Add)”。 ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/spoof-netflix.png?itok=8DEZK4Pl) ->图 9:为 CloudReady 创建条目。 + +*图 9:为 CloudReady 创建条目。* 然后,到“permanent spoof list(永久欺骗列表)”选项中将 CloudReady Widevine 添加为 [www.netflix.com](http://www.netflix.com) 的永久 UA 串。 现在,重启机器,你就可以观看 Netflix 和其它一些服务了。 - -------------------------------------------------------------------------------- via: https://www.linux.com/learn/turn-your-old-laptop-chromebook 作者:[SWAPNIL BHARTIYA][a] 译者:[alim0x](https://github.com/alim0x) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 8c4cc8d44ae5ebffc1a7667fcf68e1838e739340 Mon Sep 17 00:00:00 2001 From: kokialoves <498497353@qq.com> Date: Thu, 7 Jul 2016 17:40:22 +0800 Subject: [PATCH 1089/1469] Create Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md --- ...Installed Help Documentations and Tools.md | 178 ++++++++++++++++++ 1 file changed, 178 insertions(+) create mode 100644 translated/tech/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md diff --git a/translated/tech/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md b/translated/tech/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md new file mode 100644 index 0000000000..2d0238becf --- /dev/null +++ b/translated/tech/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md @@ -0,0 +1,178 @@ +LFCS第十二讲: 如何使用Linux的帮助文档和工具 +================================================================================== + +由于 2016 年 2 月 2 号开始启用了新的 LFCS 考试要求, 我们在[LFCS series][1]系列添加了一些必要的内容 . 为了考试的需要, 我们强烈建议你看一下[LFCE series][2] . + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Explore-Linux-with-Documentation-and-Tools.png) +>LFCS: 了解Linux的帮助文档和工具 + +当你习惯了在命令行下进行工作, 你会发现Linux有许多文档需要你去使用和配置Linux系统. + +另一个你必须熟悉命令行帮助工具的理由是,在[LFCS][3] 和 [LFCE][4] 考试中, 你只能靠你自己和命令行工具,没有互联网也没有百度。 + +基于上面的理由, 在这一章里我们将给你一些建议来帮助你通过**Linux Foundation Certification** 考试. + +### Linux 帮助手册 + +man命令, 大体上来说就是一个工具手册. 它包含选项列表(和解释) , 甚至还提供一些例子. + +我们用**man command** 加工具名称来打开一个帮助手册以便获取更多内容. 例如: + +``` +# man diff +``` + +我们将打开`diff`的手册页, 这个工具将一行一行的对比文本文档 (如你想退出只需要轻轻的点一下Q键). + +下面我来比较两个文本文件 `file1` 和 `file2` . 这两个文本文件包含着相同版本Linux的安装包信息. + +输入`diff` 命令它将告诉我们 `file1` 和`file2` 有什么不同: + +``` +# diff file1 file2 +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Compare-Two-Text-Files-in-Linux.png) +>在Linux中比较两个文本文件 + +`<` 这个符号是说`file2`少一行. 如果是 `file1`少一行, 我们将用 `>` 符号来替代. + +接下来说, **7d6** 意思是说 文件1的**#7**行在 `file2`中被删除了 ( **24d22** 和**41d38**是同样的意思), 65,67d61告诉我们移动 **65** 到 **67** . 我们把以上步骤都做了两个文件将完全匹配. + +你还可以通过 `-y` 选项来对比两个文件: + +``` +# diff -y file1 file2 +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Compare-and-List-Difference-of-Two-Files.png) +>通过列表来列出两个文件的不同 + + 当然你也可以用`diff`来比较两个二进制文件 . 如果它们完全一样, `diff` 将什么也不会输出. 否则, 他将会返回如下信息: “**Binary files X and Y differ**”. + +### –help 选项 + +`--help`选项 , 大多数命令都可以用它(并不是所有) , 他可以理解为一个命令的简单介绍. 尽管它不提供工具的详细介绍, 但是确实是一个能够快速列出程序使用信息的不错的方法. + +例如, + +``` +# sed --help +``` + +显示 sed 的每个选项的用法(sed文本流编辑器). + +一个经典的`sed`例子,替换文件字符. 用 `-i` 选项 (描述为 “**编辑文件在指定位置**”), 你可以编辑一个文件而且并不需要打开他. 如果你想要备份一个原始文件, 用 `-i` 选项 加后缀来创建一个原始文件的副本. + +例如, 替换 `lorem.txt`中的`Lorem` 为 `Tecmint` (忽略大小写) 并且创建一个新的原始文件副本, 命令如下: + +``` +# less lorem.txt | grep -i lorem +# sed -i.orig 's/Lorem/Tecmint/gI' lorem.txt +# less lorem.txt | grep -i lorem +# less lorem.txt.orig | grep -i lorem +``` + + 请注意`lorem.txt`文件中`Lorem` 都已经替换为 `Tecmint` , 并且原始的 `lorem.txt` 保存为`lorem.txt.orig`. + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Replace-A-String-in-File.png) +>替换文件文本 + +### /usr/share/doc内的文档 +这可能是我最喜欢的方法. 如果你进入 `/usr/share/doc` 目录, 你可以看到好多Linux已经安装的工具的名称的文件夹. + +根据[Filesystem Hierarchy Standard][5](文件目录标准),这些文件夹包含了许多帮助手册没有的信息, 还有一些模板和配置文件. + +例如, 让我们来看一下 `squid-3.3.8` (版本可能会不同) 一个非常受欢迎的HTTP代理[squid cache server][6]. + +让我们用`cd`命令进入目录 : + +``` +# cd /usr/share/doc/squid-3.3.8 +``` + +列出当前文件夹列表: + +``` +# ls +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/03/List-Files-in-Linux.png) +>ls linux列表命令 + +你应该特别注意 `QUICKSTART` 和 `squid.conf.documented`. 这两个文件包含了Squid许多信息, . 对于别的安装包来说, 他们的名字可能不同 (有可能是 **QuickRef** 或者**00QUICKSTART**), 但原理是一样的. + +对于另外一些安装包, 比如 the Apache web server, 在`/usr/share/doc`目录提供了配置模板, 当你配置独立服务器或者虚拟主机的时候会非常有用. + +### GNU 信息文档 + +你可以把它想象为帮助手册的超级链接形式. 正如上面说的, 他不仅仅提供工具的帮助信息, 而且还是超级链接的形式(是的!在命令行中的超级链接) 你可以通过箭头按钮和回车按钮来浏览你需要的内容. + +一个典型的例子是: + +``` +# info coreutils +``` + +通过coreutils 列出当前系统的 基本文件,shell脚本和文本处理工具[basic file, shell and text manipulation utilities][7] , 你可以得到他们的详细介绍. + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Info-Coreutils.png) +>Info Coreutils + +和帮助手册一样你可以按Q键退出. + +此外, GNU info 还可以像帮助手册一样使用. 例如: + +``` +# info tune2fs +``` + +它将显示 **tune2fs**的帮助手册, ext2/3/4 文件系统管理工具. + +让我们来看看怎么用**tune2fs**: + +显示 **/dev/mapper/vg00-vol_backups**文件系统信息: + +``` +# tune2fs -l /dev/mapper/vg00-vol_backups +``` + +修改文件系统标签 (修改为Backups): + +``` +# tune2fs -L Backups /dev/mapper/vg00-vol_backups +``` + +设置 `/` 自检的挂载次数 (用`-c` 选项设置 `/`的自检的挂载次数 或者用 `-i` 选项设置 自检时间 **d=days, w=weeks, and m=months**). + +``` +# tune2fs -c 150 /dev/mapper/vg00-vol_backups # Check every 150 mounts +# tune2fs -i 6w /dev/mapper/vg00-vol_backups # Check every 6 weeks +``` + +以上这些内容也可以通过 `--help` 选项找到, 或者查看帮助手册. + +### 摘要 + +不管你选择哪种方法,知道并且会使用它们在考试中对你是非常有用的. 你知道其它的一些方法吗? 欢迎给我们留言. + + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/linux-basic-shell-scripting-and-linux-filesystem-troubleshooting/ + +作者:[Gabriel Cánepa][a] +译者:[kokialoves](https://github.com/kokialoves) +校对:[校对者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/installing-network-services-and-configuring-services-at-system-boot/ +[3]: http://www.tecmint.com/sed-command-to-create-edit-and-manipulate-files-in-linux/ +[4]: http://www.tecmint.com/installing-network-services-and-configuring-services-at-system-boot/ +[5]: http://www.tecmint.com/linux-directory-structure-and-important-files-paths-explained/ +[6]: http://www.tecmint.com/configure-squid-server-in-linux/ +[7]: http://www.tecmint.com/sed-command-to-create-edit-and-manipulate-files-in-linux/ +[8]: From f5f8c7b7f9f40b54018b76c74026acb7189bebd7 Mon Sep 17 00:00:00 2001 From: Mike Date: Thu, 7 Jul 2016 17:43:39 +0800 Subject: [PATCH 1090/1469] sources/tech/20160609 How to record your terminal session on Linux.md (#4154) * sources/tech/20160609 How to record your terminal session on Linux.md * translated/tech/20160609 How to record your terminal session on Linux.md --- ...o record your terminal session on Linux.md | 101 ----------------- ...o record your terminal session on Linux.md | 104 ++++++++++++++++++ 2 files changed, 104 insertions(+), 101 deletions(-) delete mode 100644 sources/tech/20160609 How to record your terminal session on Linux.md create mode 100644 translated/tech/20160609 How to record your terminal session on Linux.md diff --git a/sources/tech/20160609 How to record your terminal session on Linux.md b/sources/tech/20160609 How to record your terminal session on Linux.md deleted file mode 100644 index 787bafea6d..0000000000 --- a/sources/tech/20160609 How to record your terminal session on Linux.md +++ /dev/null @@ -1,101 +0,0 @@ -How to record your terminal session on Linux -================================================= - -Recording a terminal session may be important in helping someone learn a process, sharing information in an understandable way, and also presenting a series of commands in a proper manner. Whatever the purpose, there are many times when copy-pasting text from the terminal won't be very helpful while capturing a video of the process is quite far-fetched and may not be always possible. In this quick guide, we will take a look at the easiest way to record and share a terminal session in .gif format. - -### Prerequisites - -If you just want to record your terminal sessions and be able to play the recording in your terminal, or share them with people who will use a terminal for playback, then the only tool that you'll need is called “ttyrec”. Ubuntu users may install it by inserting the following command on a terminal: - -``` -sudo apt-get install ttyrec -``` - -If you want to produce a .gif file from the recording and be able to share it with people who don't use the terminal, publish it on websites, or simply keep a .gif handy for when you'll need it instead of written commands, you will have to install two additional packages. The first one is “imagemagick” which you can install with: - -``` -sudo apt-get install imagemagick -``` - -and the second one is “tty2gif” which can be downloaded from here. The latter has a dependency that can be satisfied with: -sudo apt-get install python-opster - -### Capturing - -To start capturing the terminal session, all you need to do is simply start with “ttyrec” + enter. This will launch the real-time recording tool which will run in the background until we enter “exit” or we press “Ctrl+D”. By default, ttyrec creates a file named “ttyrecord” on the destination of the terminal session which by default is “Home”. - -![](https://www.howtoforge.com/images/how-to-record-your-terminal-session-on-linux/pic_1.jpg) - -![](https://www.howtoforge.com/images/how-to-record-your-terminal-session-on-linux/pic_2.jpg) - -![](https://www.howtoforge.com/images/how-to-record-your-terminal-session-on-linux/pic_3.jpg) - -### Playing - -Playing the file is as simple as opening a terminal on the destination of the “ttyrecord” file and using the “ttyplay” command followed by the name of the recording (in our case it's ttyrecord but you may change this into whatever you want). - -![](https://www.howtoforge.com/images/how-to-record-your-terminal-session-on-linux/pic_4.jpg) - -This will result in the playback of the recorded session, in real-time, and with typing corrections included (all actions are recorded). This will look like a completely normal automated terminal session, but the commands and their apparent execution are obviously not really applied to the system, as they are only reproduced as a recording. - -It is also important to note that the playback of the terminal session recording is completely controllable. You may double the playback speed by hitting the “+” button, slow it down with the “-” button, pause it with “0”, and resume it in normal speed with “1”. - -### Converting into a .gif - -For reasons of convenience, many of us would like to convert the recorded session into a .gif file, and that is very easy to do. Here's how: - -First, untar the downloaded “tty2gif.tar.bz2” by opening a terminal in the download location and entering the following command: - -``` -tar xvfj tty2gif.tar.bz2 -``` - -Next, copy the resulting “tty2gif.py file onto the destination of the “ttyrecord” file (or whatever the name you've specified is), and then open a terminal on that destination and type the command: - -``` -python tty2gif.py typing ttyrecord -``` - -If you are getting errors in this step, check that you have installed the “python-opster” package. If errors persist, give the following two commands consecutively: - -``` -sudo apt-get install xdotool -export WINDOWID=$(xdotool getwindowfocus) -``` - -then repeat the “python tty2gif.py typing ttyrecord ” and you should now see a number of gif files that were created on the location of the “ttyrecord” - -![](https://www.howtoforge.com/images/how-to-record-your-terminal-session-on-linux/pic_5.jpg) - -The next step is to unify all these gifs that correspond to individual terminal session actions into one final .gif file using the imagemagick utility. To do this, open a terminal on the destination and insert the following command: - -``` -convert -delay 25 -loop 0 *.gif example.gif -``` - -![](https://www.howtoforge.com/images/how-to-record-your-terminal-session-on-linux/pic_6.jpg) - -You may name the resulting file as you like (I used “example.gif”), and you may change the delay and loop settings as needed. Here is the resulting file of this quick tutorial: - -![](https://www.howtoforge.com/images/how-to-record-your-terminal-session-on-linux/example.gif) - --------------------------------------------------------------------------------- - -via: https://www.howtoforge.com/tutorial/how-to-record-your-terminal-session-on-linux/ - -作者:[Bill Toulas][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://twitter.com/howtoforgecom - - - - - - - - - diff --git a/translated/tech/20160609 How to record your terminal session on Linux.md b/translated/tech/20160609 How to record your terminal session on Linux.md new file mode 100644 index 0000000000..bc91a552a7 --- /dev/null +++ b/translated/tech/20160609 How to record your terminal session on Linux.md @@ -0,0 +1,104 @@ +如何在 Linux 上录制你的终端操作 +================================================= + +录制一次终端操作可能是一个帮助他人学习 Linux 、展示一系列正确命令行操作的和分享知识的通俗易懂方法。不管是什么目的,大多数情况下从终端复制粘贴文本从终端不会是很有帮助而且录制视频的过程也是相当困难。在这次的文章中,我们将简单的了解一下在终端会话中用 GIF 格式录制视频的方法。 + +### 预先要求 + +如果你只是希望能记录你的终端会话,并且能在终端进行播放或者和他人分享,那么你只需要一个叫做:'ttyrec' 的软件。Ubuntu 使用者可以通过运行这行代码进行安装: + +``` +sudo apt-get install ttyrec +``` + +如果你想将生成的视频转换成一个 GIF 文件,并且能够和那些希望发布在网站上或者不使用终端或者只是简单的想保留一个 GIF 的用户分享。那么你需要安装额外的两个软件包。第一个就是'imagemagick', 你可以通过以下的命令安装: + +``` +sudo apt-get install imagemagick +``` + +第二个软件包就是:'tty2gif',你可以从这里下载。这个软件包需要安装如下依赖: + +``` +sudo apt-get install python-opster +``` + +### 录制 + +开始录制中毒啦操作,你需要的仅仅是键入'ttyprec' + 回车。这个命令将会在后台运行一个实时的记录工具。我们可以通过键入'exit'或者'ctrl+d'来停止。ttyrec 默认会在'Home'目录下创建一个'ttyrecord'的文件。 + +![](https://www.howtoforge.com/images/how-to-record-your-terminal-session-on-linux/pic_1.jpg) + +![](https://www.howtoforge.com/images/how-to-record-your-terminal-session-on-linux/pic_2.jpg) + +![](https://www.howtoforge.com/images/how-to-record-your-terminal-session-on-linux/pic_3.jpg) + +### 播放 + +播放这个文件非常简单。你只需要打开终端并且使用 'ttyplay' 命令打开 'ttyrecord' 文件即可。(在这个例子里,我们使用 ttyrecord 作为文件名,当然,你也可以对这个文件进行重命名) + +![](https://www.howtoforge.com/images/how-to-record-your-terminal-session-on-linux/pic_4.jpg) + +然后就可以开始播放这个文件。这个视频记录了所有的操作,包括你的删除,修改。这看起来想一个拥有自我意识的终端,但是这个命令执行的过程并不是只是为了给系统看,而是为了更好的展现给人。 + +注意的一点,播放这个记录是完全可控的,你可以通过点击 '+' 或者 '-' 或者 '0', 或者 '1' 按钮加速、减速、暂停、和恢复播放。 + +### 导出成 GIF + +为了方便,我们通常会将视频记录转换为 GIF 格式,并且,这个也非常方便可以实现。以下是方法: + +首先,解压这个文件 'tty2gif.tar.bz2': + +``` +tar xvfj tty2gif.tar.bz2 +``` + +然后,将 'tty2gif.py' 这个文件拷贝到 'ttyprecord' 文件同目录(或者你命名的那个视频文件), 然后在这个目录下打开终端,输入命令: + +``` +python tty2gif.py typing ttyrecord +``` + +如果你出现了错误,检查一下你是否有安装 'python-opster' 包。如果还是有错误,使用如下命令进行排除。 + +``` +sudo apt-get install xdotool +export WINDOWID=$(xdotool getwindowfocus) +``` + +然后重复这个命令 'python tty2gif.py' 并且你将会看到在 ttyrecord 目录下多了一大串的 gif 文件。 + +![](https://www.howtoforge.com/images/how-to-record-your-terminal-session-on-linux/pic_5.jpg) + +接下来的一步就是整合所有的 gif 文件,将他打包成一个 GIF 文件。我们通过使用 imagemagick 工具。输入下列命令: + +``` +convert -delay 25 -loop 0 *.gif example.gif +``` + +![](https://www.howtoforge.com/images/how-to-record-your-terminal-session-on-linux/pic_6.jpg) + +你可以任意的文件名,我喜欢用 'example.gif'。 并且,你可以改变这个延时和循环时间。 Enjoy. + +![](https://www.howtoforge.com/images/how-to-record-your-terminal-session-on-linux/example.gif) + +-------------------------------------------------------------------------------- + +via: https://www.howtoforge.com/tutorial/how-to-record-your-terminal-session-on-linux/ + +作者:[Bill Toulas][a] +译者:[译者ID](https://github.com/MikeCoder) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://twitter.com/howtoforgecom + + + + + + + + + From 9a0e5ef1a90ee5fe91778e0718585d2fbfb8f5a0 Mon Sep 17 00:00:00 2001 From: kokialoves <498497353@qq.com> Date: Thu, 7 Jul 2016 17:45:41 +0800 Subject: [PATCH 1091/1469] Delete Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md --- ...Installed Help Documentations and Tools.md | 181 ------------------ 1 file changed, 181 deletions(-) delete mode 100644 sources/tech/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md diff --git a/sources/tech/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md b/sources/tech/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md deleted file mode 100644 index e4cf8cb12d..0000000000 --- a/sources/tech/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md +++ /dev/null @@ -1,181 +0,0 @@ -[translating by kokialoves] -Part 12 - LFCS: How to Explore Linux with Installed Help Documentations and Tools -================================================================================== - -Because of the changes in the LFCS exam requirements effective Feb. 2, 2016, we are adding the necessary topics to the [LFCS series][1] published here. To prepare for this exam, your are highly encouraged to use the [LFCE series][2] as well. - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Explore-Linux-with-Documentation-and-Tools.png) ->LFCS: Explore Linux with Installed Documentations and Tools – Part 12 - -Once you get used to working with the command line and feel comfortable doing so, you realize that a regular Linux installation includes all the documentation you need to use and configure the system. - -Another good reason to become familiar with command line help tools is that in the [LFCS][3] and [LFCE][4] exams, those are the only sources of information you can use – no internet browsing and no googling. It’s just you and the command line. - -For that reason, in this article we will give you some tips to effectively use the installed docs and tools in order to prepare to pass the **Linux Foundation Certification** exams. - -### Linux Man Pages - -A man page, short for manual page, is nothing less and nothing more than what the word suggests: a manual for a given tool. It contains the list of options (with explanation) that the command supports, and some man pages even include usage examples as well. - -To open a man page, use the **man command** followed by the name of the tool you want to learn more about. For example: - -``` -# man diff -``` - -will open the manual page for `diff`, a tool used to compare text files line by line (to exit, simply hit the q key.). - -Let’s say we want to compare two text files named `file1` and `file2` in Linux. These files contain the list of packages that are installed in two Linux boxes with the same distribution and version. - -Doing a `diff` between `file1` and `file2` will tell us if there is a difference between those lists: - -``` -# diff file1 file2 -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Compare-Two-Text-Files-in-Linux.png) ->Compare Two Text Files in Linux - -where the `<` sign indicates lines missing in `file2`. If there were lines missing in `file1`, they would be indicated by the `>` sign instead. - -On the other hand, **7d6** means line **#7** in file should be deleted in order to match `file2` (same with **24d22** and **41d38**), and 65,67d61 tells us we need to remove lines **65** through **67** in file one. If we make these corrections, both files will then be identical. - -Alternatively, you can display both files side by side using the `-y` option, according to the man page. You may find this helpful to more easily identify missing lines in files: - -``` -# diff -y file1 file2 -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Compare-and-List-Difference-of-Two-Files.png) ->Compare and List Difference of Two Files - -Also, you can use `diff` to compare two binary files. If they are identical, `diff` will exit silently without output. Otherwise, it will return the following message: “**Binary files X and Y differ**”. - -### The –help Option - -The `--help` option, available in many (if not all) commands, can be considered a short manual page for that specific command. Although it does not provide a comprehensive description of the tool, it is an easy way to obtain information on the usage of a program and a list of its available options at a quick glance. - -For example, - -``` -# sed --help -``` - -shows the usage of each option available in sed (the stream editor). - -One of the classic examples of using `sed` consists of replacing characters in files. Using the `-i` option (described as “**edit files in place**”), you can edit a file without opening it. If you want to make a backup of the original contents as well, use the `-i` option followed by a SUFFIX to create a separate file with the original contents. - -For example, to replace each occurrence of the word `Lorem` with `Tecmint` (case insensitive) in `lorem.txt` and create a new file with the original contents of the file, do: - -``` -# less lorem.txt | grep -i lorem -# sed -i.orig 's/Lorem/Tecmint/gI' lorem.txt -# less lorem.txt | grep -i lorem -# less lorem.txt.orig | grep -i lorem -``` - -Please note that every occurrence of `Lorem` has been replaced with `Tecmint` in `lorem.txt`, and the original contents of `lorem.txt` has been saved to `lorem.txt.orig`. - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Replace-A-String-in-File.png) ->Replace A String in Files - -### Installed Documentation in /usr/share/doc - -This is probably my favorite pick. If you go to `/usr/share/doc` and do a directory listing, you will see lots of directories with the names of the installed tools in your Linux system. - -According to the [Filesystem Hierarchy Standard][5], these directories contain useful information that might not be in the man pages, along with templates and configuration files to make configuration easier. - -For example, let’s consider `squid-3.3.8` (version may vary from distribution to distribution) for the popular HTTP proxy and [squid cache server][6]. - -Let’s `cd` into that directory: - -``` -# cd /usr/share/doc/squid-3.3.8 -``` - -and do a directory listing: - -``` -# ls -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/03/List-Files-in-Linux.png) ->Linux Directory Listing with ls Command - -You may want to pay special attention to `QUICKSTART` and `squid.conf.documented`. These files contain an extensive documentation about Squid and a heavily commented configuration file, respectively. For other packages, the exact names may differ (as **QuickRef** or **00QUICKSTART**, for example), but the principle is the same. - -Other packages, such as the Apache web server, provide configuration file templates inside `/usr/share/doc`, that will be helpful when you have to configure a standalone server or a virtual host, to name a few cases. - -### GNU info Documentation - -You can think of info documents as man pages on steroids. As such, they not only provide help for a specific tool, but also they do so with hyperlinks (yes, hyperlinks in the command line!) that allow you to navigate from a section to another using the arrow keys and Enter to confirm. - -Perhaps the most illustrative example is: - -``` -# info coreutils -``` - -Since coreutils contains the [basic file, shell and text manipulation utilities][7] which are expected to exist on every operating system, you can reasonably expect a detailed description for each one of those categories in info **coreutils**. - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Info-Coreutils.png) ->Info Coreutils - -As it is the case with man pages, you can exit an info document by pressing the `q` key. - -Additionally, GNU info can be used to display regular man pages as well when followed by the tool name. For example: - -``` -# info tune2fs -``` - -will return the man page of **tune2fs**, the ext2/3/4 filesystems management tool. - -And now that we’re at it, let’s review some of the uses of **tune2fs**: - -Display information about the filesystem on top of **/dev/mapper/vg00-vol_backups**: - -``` -# tune2fs -l /dev/mapper/vg00-vol_backups -``` - -Set a filesystem volume name (Backups in this case): - -``` -# tune2fs -L Backups /dev/mapper/vg00-vol_backups -``` - -Change the check intervals and `/` or mount counts (use the `-c` option to set a number of mount counts and `/` or the `-i` option to set a check interval, where **d=days, w=weeks, and m=months**). - -``` -# tune2fs -c 150 /dev/mapper/vg00-vol_backups # Check every 150 mounts -# tune2fs -i 6w /dev/mapper/vg00-vol_backups # Check every 6 weeks -``` - -All of the above options can be listed with the `--help` option, or viewed in the man page. - -### Summary - -Regardless of the method that you choose to invoke help for a given tool, knowing that they exist and how to use them will certainly come in handy in the exam. Do you know of any other tools that can be used to look up documentation? Feel free to share with the Tecmint community using the form below. - -Questions and other comments are more than welcome as well. - --------------------------------------------------------------------------------- - -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/installing-network-services-and-configuring-services-at-system-boot/ -[3]: http://www.tecmint.com/sed-command-to-create-edit-and-manipulate-files-in-linux/ -[4]: http://www.tecmint.com/installing-network-services-and-configuring-services-at-system-boot/ -[5]: http://www.tecmint.com/linux-directory-structure-and-important-files-paths-explained/ -[6]: http://www.tecmint.com/configure-squid-server-in-linux/ -[7]: http://www.tecmint.com/sed-command-to-create-edit-and-manipulate-files-in-linux/ -[8]: From aebeabf6f037c2c12940bdc5e44edbaa43792b4d Mon Sep 17 00:00:00 2001 From: kokialoves <498497353@qq.com> Date: Thu, 7 Jul 2016 20:26:30 +0800 Subject: [PATCH 1092/1469] =?UTF-8?q?Create=20Part=2012=20-=20How=20to=20E?= =?UTF-8?q?xplore=20Linux=20with=20Installed=20Help=20Documentati=E2=80=A6?= =?UTF-8?q?=20(#4155)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Create Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md * Delete Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md --- ...Installed Help Documentations and Tools.md | 181 ------------------ ...Installed Help Documentations and Tools.md | 178 +++++++++++++++++ 2 files changed, 178 insertions(+), 181 deletions(-) delete mode 100644 sources/tech/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md create mode 100644 translated/tech/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md diff --git a/sources/tech/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md b/sources/tech/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md deleted file mode 100644 index e4cf8cb12d..0000000000 --- a/sources/tech/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md +++ /dev/null @@ -1,181 +0,0 @@ -[translating by kokialoves] -Part 12 - LFCS: How to Explore Linux with Installed Help Documentations and Tools -================================================================================== - -Because of the changes in the LFCS exam requirements effective Feb. 2, 2016, we are adding the necessary topics to the [LFCS series][1] published here. To prepare for this exam, your are highly encouraged to use the [LFCE series][2] as well. - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Explore-Linux-with-Documentation-and-Tools.png) ->LFCS: Explore Linux with Installed Documentations and Tools – Part 12 - -Once you get used to working with the command line and feel comfortable doing so, you realize that a regular Linux installation includes all the documentation you need to use and configure the system. - -Another good reason to become familiar with command line help tools is that in the [LFCS][3] and [LFCE][4] exams, those are the only sources of information you can use – no internet browsing and no googling. It’s just you and the command line. - -For that reason, in this article we will give you some tips to effectively use the installed docs and tools in order to prepare to pass the **Linux Foundation Certification** exams. - -### Linux Man Pages - -A man page, short for manual page, is nothing less and nothing more than what the word suggests: a manual for a given tool. It contains the list of options (with explanation) that the command supports, and some man pages even include usage examples as well. - -To open a man page, use the **man command** followed by the name of the tool you want to learn more about. For example: - -``` -# man diff -``` - -will open the manual page for `diff`, a tool used to compare text files line by line (to exit, simply hit the q key.). - -Let’s say we want to compare two text files named `file1` and `file2` in Linux. These files contain the list of packages that are installed in two Linux boxes with the same distribution and version. - -Doing a `diff` between `file1` and `file2` will tell us if there is a difference between those lists: - -``` -# diff file1 file2 -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Compare-Two-Text-Files-in-Linux.png) ->Compare Two Text Files in Linux - -where the `<` sign indicates lines missing in `file2`. If there were lines missing in `file1`, they would be indicated by the `>` sign instead. - -On the other hand, **7d6** means line **#7** in file should be deleted in order to match `file2` (same with **24d22** and **41d38**), and 65,67d61 tells us we need to remove lines **65** through **67** in file one. If we make these corrections, both files will then be identical. - -Alternatively, you can display both files side by side using the `-y` option, according to the man page. You may find this helpful to more easily identify missing lines in files: - -``` -# diff -y file1 file2 -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Compare-and-List-Difference-of-Two-Files.png) ->Compare and List Difference of Two Files - -Also, you can use `diff` to compare two binary files. If they are identical, `diff` will exit silently without output. Otherwise, it will return the following message: “**Binary files X and Y differ**”. - -### The –help Option - -The `--help` option, available in many (if not all) commands, can be considered a short manual page for that specific command. Although it does not provide a comprehensive description of the tool, it is an easy way to obtain information on the usage of a program and a list of its available options at a quick glance. - -For example, - -``` -# sed --help -``` - -shows the usage of each option available in sed (the stream editor). - -One of the classic examples of using `sed` consists of replacing characters in files. Using the `-i` option (described as “**edit files in place**”), you can edit a file without opening it. If you want to make a backup of the original contents as well, use the `-i` option followed by a SUFFIX to create a separate file with the original contents. - -For example, to replace each occurrence of the word `Lorem` with `Tecmint` (case insensitive) in `lorem.txt` and create a new file with the original contents of the file, do: - -``` -# less lorem.txt | grep -i lorem -# sed -i.orig 's/Lorem/Tecmint/gI' lorem.txt -# less lorem.txt | grep -i lorem -# less lorem.txt.orig | grep -i lorem -``` - -Please note that every occurrence of `Lorem` has been replaced with `Tecmint` in `lorem.txt`, and the original contents of `lorem.txt` has been saved to `lorem.txt.orig`. - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Replace-A-String-in-File.png) ->Replace A String in Files - -### Installed Documentation in /usr/share/doc - -This is probably my favorite pick. If you go to `/usr/share/doc` and do a directory listing, you will see lots of directories with the names of the installed tools in your Linux system. - -According to the [Filesystem Hierarchy Standard][5], these directories contain useful information that might not be in the man pages, along with templates and configuration files to make configuration easier. - -For example, let’s consider `squid-3.3.8` (version may vary from distribution to distribution) for the popular HTTP proxy and [squid cache server][6]. - -Let’s `cd` into that directory: - -``` -# cd /usr/share/doc/squid-3.3.8 -``` - -and do a directory listing: - -``` -# ls -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/03/List-Files-in-Linux.png) ->Linux Directory Listing with ls Command - -You may want to pay special attention to `QUICKSTART` and `squid.conf.documented`. These files contain an extensive documentation about Squid and a heavily commented configuration file, respectively. For other packages, the exact names may differ (as **QuickRef** or **00QUICKSTART**, for example), but the principle is the same. - -Other packages, such as the Apache web server, provide configuration file templates inside `/usr/share/doc`, that will be helpful when you have to configure a standalone server or a virtual host, to name a few cases. - -### GNU info Documentation - -You can think of info documents as man pages on steroids. As such, they not only provide help for a specific tool, but also they do so with hyperlinks (yes, hyperlinks in the command line!) that allow you to navigate from a section to another using the arrow keys and Enter to confirm. - -Perhaps the most illustrative example is: - -``` -# info coreutils -``` - -Since coreutils contains the [basic file, shell and text manipulation utilities][7] which are expected to exist on every operating system, you can reasonably expect a detailed description for each one of those categories in info **coreutils**. - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Info-Coreutils.png) ->Info Coreutils - -As it is the case with man pages, you can exit an info document by pressing the `q` key. - -Additionally, GNU info can be used to display regular man pages as well when followed by the tool name. For example: - -``` -# info tune2fs -``` - -will return the man page of **tune2fs**, the ext2/3/4 filesystems management tool. - -And now that we’re at it, let’s review some of the uses of **tune2fs**: - -Display information about the filesystem on top of **/dev/mapper/vg00-vol_backups**: - -``` -# tune2fs -l /dev/mapper/vg00-vol_backups -``` - -Set a filesystem volume name (Backups in this case): - -``` -# tune2fs -L Backups /dev/mapper/vg00-vol_backups -``` - -Change the check intervals and `/` or mount counts (use the `-c` option to set a number of mount counts and `/` or the `-i` option to set a check interval, where **d=days, w=weeks, and m=months**). - -``` -# tune2fs -c 150 /dev/mapper/vg00-vol_backups # Check every 150 mounts -# tune2fs -i 6w /dev/mapper/vg00-vol_backups # Check every 6 weeks -``` - -All of the above options can be listed with the `--help` option, or viewed in the man page. - -### Summary - -Regardless of the method that you choose to invoke help for a given tool, knowing that they exist and how to use them will certainly come in handy in the exam. Do you know of any other tools that can be used to look up documentation? Feel free to share with the Tecmint community using the form below. - -Questions and other comments are more than welcome as well. - --------------------------------------------------------------------------------- - -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/installing-network-services-and-configuring-services-at-system-boot/ -[3]: http://www.tecmint.com/sed-command-to-create-edit-and-manipulate-files-in-linux/ -[4]: http://www.tecmint.com/installing-network-services-and-configuring-services-at-system-boot/ -[5]: http://www.tecmint.com/linux-directory-structure-and-important-files-paths-explained/ -[6]: http://www.tecmint.com/configure-squid-server-in-linux/ -[7]: http://www.tecmint.com/sed-command-to-create-edit-and-manipulate-files-in-linux/ -[8]: diff --git a/translated/tech/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md b/translated/tech/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md new file mode 100644 index 0000000000..2d0238becf --- /dev/null +++ b/translated/tech/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md @@ -0,0 +1,178 @@ +LFCS第十二讲: 如何使用Linux的帮助文档和工具 +================================================================================== + +由于 2016 年 2 月 2 号开始启用了新的 LFCS 考试要求, 我们在[LFCS series][1]系列添加了一些必要的内容 . 为了考试的需要, 我们强烈建议你看一下[LFCE series][2] . + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Explore-Linux-with-Documentation-and-Tools.png) +>LFCS: 了解Linux的帮助文档和工具 + +当你习惯了在命令行下进行工作, 你会发现Linux有许多文档需要你去使用和配置Linux系统. + +另一个你必须熟悉命令行帮助工具的理由是,在[LFCS][3] 和 [LFCE][4] 考试中, 你只能靠你自己和命令行工具,没有互联网也没有百度。 + +基于上面的理由, 在这一章里我们将给你一些建议来帮助你通过**Linux Foundation Certification** 考试. + +### Linux 帮助手册 + +man命令, 大体上来说就是一个工具手册. 它包含选项列表(和解释) , 甚至还提供一些例子. + +我们用**man command** 加工具名称来打开一个帮助手册以便获取更多内容. 例如: + +``` +# man diff +``` + +我们将打开`diff`的手册页, 这个工具将一行一行的对比文本文档 (如你想退出只需要轻轻的点一下Q键). + +下面我来比较两个文本文件 `file1` 和 `file2` . 这两个文本文件包含着相同版本Linux的安装包信息. + +输入`diff` 命令它将告诉我们 `file1` 和`file2` 有什么不同: + +``` +# diff file1 file2 +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Compare-Two-Text-Files-in-Linux.png) +>在Linux中比较两个文本文件 + +`<` 这个符号是说`file2`少一行. 如果是 `file1`少一行, 我们将用 `>` 符号来替代. + +接下来说, **7d6** 意思是说 文件1的**#7**行在 `file2`中被删除了 ( **24d22** 和**41d38**是同样的意思), 65,67d61告诉我们移动 **65** 到 **67** . 我们把以上步骤都做了两个文件将完全匹配. + +你还可以通过 `-y` 选项来对比两个文件: + +``` +# diff -y file1 file2 +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Compare-and-List-Difference-of-Two-Files.png) +>通过列表来列出两个文件的不同 + + 当然你也可以用`diff`来比较两个二进制文件 . 如果它们完全一样, `diff` 将什么也不会输出. 否则, 他将会返回如下信息: “**Binary files X and Y differ**”. + +### –help 选项 + +`--help`选项 , 大多数命令都可以用它(并不是所有) , 他可以理解为一个命令的简单介绍. 尽管它不提供工具的详细介绍, 但是确实是一个能够快速列出程序使用信息的不错的方法. + +例如, + +``` +# sed --help +``` + +显示 sed 的每个选项的用法(sed文本流编辑器). + +一个经典的`sed`例子,替换文件字符. 用 `-i` 选项 (描述为 “**编辑文件在指定位置**”), 你可以编辑一个文件而且并不需要打开他. 如果你想要备份一个原始文件, 用 `-i` 选项 加后缀来创建一个原始文件的副本. + +例如, 替换 `lorem.txt`中的`Lorem` 为 `Tecmint` (忽略大小写) 并且创建一个新的原始文件副本, 命令如下: + +``` +# less lorem.txt | grep -i lorem +# sed -i.orig 's/Lorem/Tecmint/gI' lorem.txt +# less lorem.txt | grep -i lorem +# less lorem.txt.orig | grep -i lorem +``` + + 请注意`lorem.txt`文件中`Lorem` 都已经替换为 `Tecmint` , 并且原始的 `lorem.txt` 保存为`lorem.txt.orig`. + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Replace-A-String-in-File.png) +>替换文件文本 + +### /usr/share/doc内的文档 +这可能是我最喜欢的方法. 如果你进入 `/usr/share/doc` 目录, 你可以看到好多Linux已经安装的工具的名称的文件夹. + +根据[Filesystem Hierarchy Standard][5](文件目录标准),这些文件夹包含了许多帮助手册没有的信息, 还有一些模板和配置文件. + +例如, 让我们来看一下 `squid-3.3.8` (版本可能会不同) 一个非常受欢迎的HTTP代理[squid cache server][6]. + +让我们用`cd`命令进入目录 : + +``` +# cd /usr/share/doc/squid-3.3.8 +``` + +列出当前文件夹列表: + +``` +# ls +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/03/List-Files-in-Linux.png) +>ls linux列表命令 + +你应该特别注意 `QUICKSTART` 和 `squid.conf.documented`. 这两个文件包含了Squid许多信息, . 对于别的安装包来说, 他们的名字可能不同 (有可能是 **QuickRef** 或者**00QUICKSTART**), 但原理是一样的. + +对于另外一些安装包, 比如 the Apache web server, 在`/usr/share/doc`目录提供了配置模板, 当你配置独立服务器或者虚拟主机的时候会非常有用. + +### GNU 信息文档 + +你可以把它想象为帮助手册的超级链接形式. 正如上面说的, 他不仅仅提供工具的帮助信息, 而且还是超级链接的形式(是的!在命令行中的超级链接) 你可以通过箭头按钮和回车按钮来浏览你需要的内容. + +一个典型的例子是: + +``` +# info coreutils +``` + +通过coreutils 列出当前系统的 基本文件,shell脚本和文本处理工具[basic file, shell and text manipulation utilities][7] , 你可以得到他们的详细介绍. + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Info-Coreutils.png) +>Info Coreutils + +和帮助手册一样你可以按Q键退出. + +此外, GNU info 还可以像帮助手册一样使用. 例如: + +``` +# info tune2fs +``` + +它将显示 **tune2fs**的帮助手册, ext2/3/4 文件系统管理工具. + +让我们来看看怎么用**tune2fs**: + +显示 **/dev/mapper/vg00-vol_backups**文件系统信息: + +``` +# tune2fs -l /dev/mapper/vg00-vol_backups +``` + +修改文件系统标签 (修改为Backups): + +``` +# tune2fs -L Backups /dev/mapper/vg00-vol_backups +``` + +设置 `/` 自检的挂载次数 (用`-c` 选项设置 `/`的自检的挂载次数 或者用 `-i` 选项设置 自检时间 **d=days, w=weeks, and m=months**). + +``` +# tune2fs -c 150 /dev/mapper/vg00-vol_backups # Check every 150 mounts +# tune2fs -i 6w /dev/mapper/vg00-vol_backups # Check every 6 weeks +``` + +以上这些内容也可以通过 `--help` 选项找到, 或者查看帮助手册. + +### 摘要 + +不管你选择哪种方法,知道并且会使用它们在考试中对你是非常有用的. 你知道其它的一些方法吗? 欢迎给我们留言. + + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/linux-basic-shell-scripting-and-linux-filesystem-troubleshooting/ + +作者:[Gabriel Cánepa][a] +译者:[kokialoves](https://github.com/kokialoves) +校对:[校对者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/installing-network-services-and-configuring-services-at-system-boot/ +[3]: http://www.tecmint.com/sed-command-to-create-edit-and-manipulate-files-in-linux/ +[4]: http://www.tecmint.com/installing-network-services-and-configuring-services-at-system-boot/ +[5]: http://www.tecmint.com/linux-directory-structure-and-important-files-paths-explained/ +[6]: http://www.tecmint.com/configure-squid-server-in-linux/ +[7]: http://www.tecmint.com/sed-command-to-create-edit-and-manipulate-files-in-linux/ +[8]: From 330fc8a182c2d084c1fa9768c7843703417204af Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 7 Jul 2016 23:02:01 +0800 Subject: [PATCH 1093/1469] PUB:20160530 Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @GitFuture 翻译的很仔细,用心了。加油~ --- ...P 2.0 Support for Nginx on Ubuntu 16.04.md | 124 ++++++++++-------- 1 file changed, 72 insertions(+), 52 deletions(-) rename {translated/tech => published}/20160530 Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md (60%) diff --git a/translated/tech/20160530 Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md b/published/20160530 Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md similarity index 60% rename from translated/tech/20160530 Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md rename to published/20160530 Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md index f432833a50..0ff5f7a412 100644 --- a/translated/tech/20160530 Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md +++ b/published/20160530 Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md @@ -1,43 +1,47 @@ -在 Ubuntu 16.04 为 Nginx 服务器安装 LEMP 环境(MariaDB, PHP 7 并且支持 HTTP 2.0) +在 Ubuntu 16.04 为 Nginx 服务器安装 LEMP 环境(MariaDB,PHP 7 并支持 HTTP 2.0) ===================== -LEMP 是字首组合词,代表一组软件包(Linux OS,Nginx 网络服务器,MySQL\MariaDB 数据库和 PHP 服务端动态编程语言),它被用来搭建动态的网络应用和网页。 +LEMP 是个缩写,代表一组软件包(L:Linux OS,E:Nginx 网络服务器,M:MySQL/MariaDB 数据库和 P:PHP 服务端动态编程语言),它被用来搭建动态的网络应用和网页。 ![](http://www.tecmint.com/wp-content/uploads/2016/05/Install-Nginx-with-FastCGI-on-Ubuntu-16.04.png) ->在 Ubuntu 16.04 安装 Nginx 以及 MariaDB,PHP7 并且支持 HTTP 2.0 + +*在 Ubuntu 16.04 安装 Nginx 以及 MariaDB,PHP7 并且支持 HTTP 2.0* 这篇教程会教你怎么在 Ubuntu 16.04 的服务器上安装 LEMP (Nginx 和 MariaDB 以及 PHP7)。 -准备 +**前置准备** -[安装 Ubuntu 16.04 服务器版本][1] +- [安装 Ubuntu 16.04 服务器版本][1] ### 步骤 1:安装 Nginx 服务器 -#### 1. Nginx 是一个先进的、资源优化的网络服务器程序,用来向因特网上的访客展示网页。我们从 Nginx 服务器的安装开始介绍,使用 [apt 命令][2] 从 Ubuntu 的官方软件仓库中获取 Nginx 程序。 +1、Nginx 是一个先进的、资源优化的 Web 服务器程序,用来向因特网上的访客展示网页。我们从 Nginx 服务器的安装开始介绍,使用 [apt 命令][2] 从 Ubuntu 的官方软件仓库中获取 Nginx 程序。 ``` $ sudo apt-get install nginx ``` ![](http://www.tecmint.com/wp-content/uploads/2016/05/Install-Nginx-on-Ubuntu-16.04.png) ->在 Ubuntu 16.04 安装 Nginx -#### 2. 然后输入 [netstat][3] 和 [systemctl][4] 命令,确认 Nginx 进程已经启动并且绑定在 80 端口。 +*在 Ubuntu 16.04 安装 Nginx* + +2、 然后输入 [netstat][3] 和 [systemctl][4] 命令,确认 Nginx 进程已经启动并且绑定在 80 端口。 ``` $ netstat -tlpn ``` ![](http://www.tecmint.com/wp-content/uploads/2016/05/Check-Nginx-Network-Port-Connection.png) ->检查 Nginx 网络端口连接 + +*检查 Nginx 网络端口连接* ``` $ sudo systemctl status nginx.service ``` ![](http://www.tecmint.com/wp-content/uploads/2016/05/Check-Nginx-Service-Status.png) ->检查 Nginx 服务状态 + +*检查 Nginx 服务状态* 当你确认服务进程已经启动了,你可以打开一个浏览器,使用 HTTP 协议访问你的服务器 IP 地址或者域名,浏览 Nginx 的默认网页。 @@ -46,11 +50,12 @@ http://IP-Address ``` ![](http://www.tecmint.com/wp-content/uploads/2016/05/Verify-Nginx-Webpage.png) ->验证 Nginx 网页 + +*验证 Nginx 网页* ### 步骤 2:启用 Nginx HTTP/2.0 协议 -#### 3. HTTP/2.0 协议默认包含在 Ubuntu 16.04 最新发行版的 Nginx 二进制文件中,它只能通过 SSL 连接并且保证加载网页的速度有巨大提升。 +3、 对 HTTP/2.0 协议的支持默认包含在 Ubuntu 16.04 最新发行版的 Nginx 二进制文件中了,它只能通过 SSL 连接并且保证加载网页的速度有巨大提升。 要启用Nginx 的这个协议,首先找到 Nginx 提供的网站配置文件,输入下面这个命令备份配置文件。 @@ -60,9 +65,10 @@ $ sudo mv default default.backup ``` ![](http://www.tecmint.com/wp-content/uploads/2016/05/Backup-Nginx-Sites-Configuration-File.png) ->备份 Nginx 的网站配置文件 -#### 4. 然后,用文本编辑器新建一个默认文件,输入以下内容: +*备份 Nginx 的网站配置文件* + +4、然后,用文本编辑器新建一个默认文件,输入以下内容: ``` server { @@ -113,16 +119,16 @@ server { ``` ![](http://www.tecmint.com/wp-content/uploads/2016/05/Enable-Nginx-HTTP-2-Protocol.png) ->启用 Nginx HTTP 2 协议 + +*启用 Nginx HTTP 2 协议* 上面的配置片段向所有的 SSL 监听指令中添加 http2 参数来启用 `HTTP/2.0`。 -添加到服务器配置的最后一段,是用来将所有非 SSL 的流量重定向到 SSL/TLS 默认主机。然后用你主机的 IP 地址或者 DNS 记录(优先 FQDN)替换掉 `server_name` 选项。 (directive 的翻译是指令,但我觉得翻译成选项更好) +上述添加到服务器配置的最后一段,是用来将所有非 SSL 的流量重定向到 SSL/TLS 默认主机。然后用你主机的 IP 地址或者 DNS 记录(最好用 FQDN 名称)替换掉 `server_name` 选项的参数。 -#### 5. 当你按照以上步骤编辑完 Nginx 的默认配置文件之后,用下面这些命令来生成、查看 SSL 证书和密钥。 - -用你自定义的设置完成证书的制作,注意常用名设置成和你的 DNS FQDN 记录或者服务器 IP 地址相匹配,DNS 记录或者 IP 地址是用来访问网页的。 +5、 当你按照以上步骤编辑完 Nginx 的默认配置文件之后,用下面这些命令来生成、查看 SSL 证书和密钥。 +用你自定义的设置完成证书的制作,注意 Common Name 设置成和你的 DNS FQDN 记录或者服务器 IP 地址相匹配。 ``` $ sudo mkdir /etc/nginx/ssl @@ -131,18 +137,20 @@ $ ls /etc/nginx/ssl/ ``` ![](http://www.tecmint.com/wp-content/uploads/2016/05/Generate-SSL-Certificate-and-Key.png) ->生成 Nginx 的 SSL 证书和密钥 -#### 6. 通过输入以下命令使用一个强 DH 加密算法,在之前的配置文件 `ssl_dhparam` 这一行中进行修改。 +*生成 Nginx 的 SSL 证书和密钥* + +6、 通过输入以下命令使用一个强 DH 加密算法,这会修改之前的配置文件 `ssl_dhparam` 所配置的文件。 ``` $ sudo openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 ``` ![](http://www.tecmint.com/wp-content/uploads/2016/05/Create-Diffie-Hellman-Key.png) ->创建 Diffie-Hellman 密钥 -#### 7. 当 `Diffie-Hellman` 密钥生成之后,验证 Nginx 的配置文件是否正确、能否被 Nginx 网络服务程序应用。然后运行以下命令重启守护进程来观察有什么变化。 +*创建 Diffie-Hellman 密钥* + +7、 当 `Diffie-Hellman` 密钥生成之后,验证 Nginx 的配置文件是否正确、能否被 Nginx 网络服务程序应用。然后运行以下命令重启守护进程来观察有什么变化。 ``` $ sudo nginx -t @@ -150,31 +158,34 @@ $ sudo systemctl restart nginx.service ``` ![](http://www.tecmint.com/wp-content/uploads/2016/05/Check-Nginx-Configuration.png) ->检查 Nginx 的配置 -#### 8. 键入下面的命令来测试 Nginx 使用的是 HTTP/2.0 协议。看到协议中有 `h2` 的话,表明 Nginx 已经成功配置使用 HTTP/2.0 协议。所有最新的浏览器默认都能够支持这个协议。 +*检查 Nginx 的配置* + +8、 键入下面的命令来测试 Nginx 使用的是 HTTP/2.0 协议。看到协议中有 `h2` 的话,表明 Nginx 已经成功配置使用 HTTP/2.0 协议。所有最新的浏览器默认都能够支持这个协议。 ``` $ openssl s_client -connect localhost:443 -nextprotoneg '' ``` ![](http://www.tecmint.com/wp-content/uploads/2016/05/Test-Nginx-HTTP-2-Protocol.png) ->测试 Nginx HTTP 2.0 协议 + +*测试 Nginx HTTP 2.0 协议* ### 第 3 步:安装 PHP 7 解释器 通过 FastCGI 进程管理程序的协助,Nginx 能够使用 PHP 动态语言解释器生成动态网络内容。FastCGI 能够从 Ubuntu 官方仓库中安装 php-fpm 二进制包来获取。 -#### 9. 在你的服务器控制台里输入下面的命令来获取 PHP7.0 和扩展包,这能够让 PHP 与 Nginx 网络服务进程通信, +9、 在你的服务器控制台里输入下面的命令来获取 PHP7.0 和扩展包,这能够让 PHP 与 Nginx 网络服务进程通信。 ``` $ sudo apt install php7.0 php7.0-fpm ``` ![](http://www.tecmint.com/wp-content/uploads/2016/05/Install-PHP-7-PHP-FPM-for-Ngin.png) ->安装 PHP 7 以及 PHP-FPM -#### 10. 当 PHP7.0 解释器安装成功后,输入以下命令启动或者检查 php7.0-fpm 守护进程: +*安装 PHP 7 以及 PHP-FPM* + +10、 当 PHP7.0 解释器安装成功后,输入以下命令启动或者检查 php7.0-fpm 守护进程: ``` $ sudo systemctl start php7.0-fpm @@ -182,9 +193,10 @@ $ sudo systemctl status php7.0-fpm ``` ![](http://www.tecmint.com/wp-content/uploads/2016/05/Start-Verify-php-fpm-Service.png) ->开启、验证 php-fpm 服务 -#### 11. 当前的 Nginx 配置文件已经配置了使用 PHP FPM 来提供动态内容。 +*开启、验证 php-fpm 服务* + +11、 当前的 Nginx 配置文件已经配置了使用 PHP FPM 来提供动态内容。 下面给出的这部分服务器配置让 Nginx 能够使用 PHP 解释器,所以不需要对 Nginx 配置文件作别的修改。 @@ -198,26 +210,30 @@ location ~ \.php$ { 下面是的截图是 Nginx 默认配置文件的内容。你可能需要对其中的代码进行修改或者取消注释。 ![](http://www.tecmint.com/wp-content/uploads/2016/05/Enable-PHP-FastCGI-for-Nginx.png) ->启用 PHP FastCGI -#### 12. 要测试启用了 PHP-FPM 的 Nginx 服务器,用下面的命令创建一个 PHP 测试配置文件 `info.php`。接着用 `http://IP_or domain/info.php` 这个网址来查看配置。 +*启用 PHP FastCGI* + +12、 要测试启用了 PHP-FPM 的 Nginx 服务器,用下面的命令创建一个 PHP 测试配置文件 `info.php`。接着用 `http://IP_or domain/info.php` 这个网址来查看配置。 ``` $ sudo su -c 'echo "" |tee /var/www/html/info.php' ``` ![](http://www.tecmint.com/wp-content/uploads/2016/05/Create-PHP-Info-File.png) ->创建 PHP Info 文件 + +*创建 PHP Info 文件* ![](http://www.tecmint.com/wp-content/uploads/2016/05/Verify-PHP-FastCGI-Info.png) ->检查 PHP FastCGI 的信息 -检查服务器是否应用 HTTP/2.0 协议,定位到 PHP 变量区域中的 `$_SERVER[‘SERVER_PROTOCOL’]` 就像下面这张截图一样。(advertised by server 翻译不清楚,这里翻译成服务器应用了 HTTP/2.0 协议) +*检查 PHP FastCGI 的信息* + +检查服务器是否宣告支持 HTTP/2.0 协议,定位到 PHP 变量区域中的 `$_SERVER[‘SERVER_PROTOCOL’]` 就像下面这张截图一样。 ![](http://www.tecmint.com/wp-content/uploads/2016/05/Check-HTTP-2.0-Protocol-Info.png) ->检查 HTTP2.0 协议信息 -#### 13. 为了安装其它的 PHP7.0 模块,使用 `apt search php7.0` 命令查找 php 的模块然后安装。 +*检查 HTTP2.0 协议信息* + +13、 为了安装其它的 PHP7.0 模块,使用 `apt search php7.0` 命令查找 php 的模块然后安装。 如果你想要 [安装 WordPress][5] 或者别的 CMS,需要安装以下的 PHP 模块,这些模块迟早有用。 @@ -226,9 +242,10 @@ $ sudo apt install php7.0-mcrypt php7.0-mbstring ``` ![](http://www.tecmint.com/wp-content/uploads/2016/05/Install-PHP-7-Modules.png) ->安装 PHP 7 模块 -#### 14. 注册 PHP 额外的模块,输入下面的命令重启 PHP-FPM 守护进程。 +*安装 PHP 7 模块* + +14、 要注册这些额外的 PHP 模块,输入下面的命令重启 PHP-FPM 守护进程。 ``` $ sudo systemctl restart php7.0-fpm.service @@ -236,9 +253,9 @@ $ sudo systemctl restart php7.0-fpm.service ### 第 4 步:安装 MariaDB 数据库 -#### 15. 最后,我们需要 MariaDB 数据库来存储、管理网站数据来完成搭建 LEMP +15、 最后,我们需要 MariaDB 数据库来存储、管理网站数据,才算完成 LEMP 的搭建。 -运行下面的命令安装 MariaDB 数据库管理系统,重启 PHP-FPM 服务使用 MySQL 模块与数据库通信。 +运行下面的命令安装 MariaDB 数据库管理系统,重启 PHP-FPM 服务以便使用 MySQL 模块与数据库通信。 ``` $ sudo apt install mariadb-server mariadb-client php7.0-mysql @@ -246,9 +263,10 @@ $ sudo systemctl restart php7.0-fpm.service ``` ![](http://www.tecmint.com/wp-content/uploads/2016/05/Install-MariaDB-for-Nginx.png) ->安装 MariaDB -#### 16. 为了保证 MariaDB 的安装,运行来自 Ubuntu 软件仓库中的二进制包提供的安全脚本,这会询问你设置一个根用户密码,移除匿名用户,禁用根用户远程登陆,移除测试数据库。 +*安装 MariaDB* + +16、 为了安全加固 MariaDB,运行来自 Ubuntu 软件仓库中的二进制包提供的安全脚本,这会询问你设置一个 root 密码,移除匿名用户,禁用 root 用户远程登录,移除测试数据库。 输入下面的命令运行脚本,并且确认所有的选择。参照下面的截图。 @@ -257,10 +275,10 @@ $ sudo mysql_secure_installation ``` ![](http://www.tecmint.com/wp-content/uploads/2016/05/Secure-MariaDB-Installation-for-Nginx.png) ->MariaDB 的安全安装 +*MariaDB 的安全安装* -#### 17. 配置 MariaDB 以便普通用户能够不使用 系统的 sudo 权限来访问数据库。用根用户权限打开 MySQL 命令行界面,运行下面的命令: +17、 配置 MariaDB 以便普通用户能够不使用系统的 sudo 权限来访问数据库。用 root 用户权限打开 MySQL 命令行界面,运行下面的命令: ``` $ sudo mysql @@ -271,26 +289,28 @@ MariaDB> exit ``` ![](http://www.tecmint.com/wp-content/uploads/2016/05/MariaDB-User-Permissions.png) ->MariaDB 的用户权限 -最后登陆到 MariaDB 数据库,通过以下命令不使用 root 权限执行任意一个命令: +*MariaDB 的用户权限* + +最后通过执行以下命令登录到 MariaDB 数据库,就可以不需要 root 权限而执行任意数据库内的命令: ``` $ mysql -u root -p -e 'show databases' ``` ![](http://www.tecmint.com/wp-content/uploads/2016/05/Check-MariaDB-Databases.png) ->查看 MariaDB 数据库 + +*查看 MariaDB 数据库* 好了!现在你拥有了配置在 **Ubuntu 16.04** 服务器上的 **LEMP** 环境,你能够部署能够与数据库交互的复杂动态网络应用。 -------------------------------------------------------------------------------- -via: http://www.tecmint.com/install-nginx-mariadb-php7-http2-on-ubuntu-16-04/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tecmint+%28Tecmint%3A+Linux+Howto%27s+Guide%29 +via: http://www.tecmint.com/install-nginx-mariadb-php7-http2-on-ubuntu-16-04/ -作者:[Matei Cezar ][a] +作者:[Matei Cezar][a] 译者:[GitFuture](https://github.com/GitFuture) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d776733b45d3533b18228db35d7ae3fd1e3edc8b Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 8 Jul 2016 00:02:48 +0800 Subject: [PATCH 1094/1469] PUB:20160606 Basic Git Commands You Must Know @alim0x --- ...160606 Basic Git Commands You Must Know.md | 42 +++++++++---------- 1 file changed, 20 insertions(+), 22 deletions(-) rename {translated/tech => published}/20160606 Basic Git Commands You Must Know.md (75%) diff --git a/translated/tech/20160606 Basic Git Commands You Must Know.md b/published/20160606 Basic Git Commands You Must Know.md similarity index 75% rename from translated/tech/20160606 Basic Git Commands You Must Know.md rename to published/20160606 Basic Git Commands You Must Know.md index dbaf78ad95..57aa6662e2 100644 --- a/translated/tech/20160606 Basic Git Commands You Must Know.md +++ b/published/20160606 Basic Git Commands You Must Know.md @@ -5,15 +5,15 @@ *简介:这个快速指南将向你展示所有的基础 Git 命令以及用法。你可以下载这些命令作为快速参考。* -我们在早先一篇文章中已经见过快速指南和 [Vi cheat sheet 下载][1]了。在这篇文章里,我们将会看到开始使用 Git 所需要的基础命令。 +我们在早先一篇文章中已经快速介绍过 [Vi 速查表][1]了。在这篇文章里,我们将会介绍开始使用 Git 时所需要的基础命令。 -### GIT +### Git [Git][2] 是一个分布式版本控制系统,它被用在大量开源项目中。它是在 2005 年由 Linux 创始人 [Linus Torvalds][3] 写就的。这个程序允许非线性的项目开发,并且能够通过存储在本地服务器高效处理大量数据。在这个教程里,我们将要和 Git 愉快玩耍并学习如何开始使用它。 我在这个教程里使用 Ubuntu,但你可以使用你选择的任何发行版。除了安装以外,剩下的所有命令在任何 Linux 发行版上都是一样的。 -### 安装 GIT +### 安装 Git 要安装 git 执行以下命令: @@ -23,11 +23,11 @@ sudo apt-get install git-core 在它完成下载之后,你就安装好了 Git 并且可以使用了。 -### 设置 GIT: +### 设置 Git 在 Git 安装之后,不论是从 apt-get 还是从源码安装,你需要将你的用户名和邮箱地址复制到 gitconfig 文件。你可以访问 ~/.gitconfig 这个文件。 -全新安装 Git 之后打开它会是完全空白的页面: +全新安装 Git 之后打开它会是完全空白的: ``` sudo vim ~/.gitconfig @@ -42,7 +42,7 @@ git config --global user.email user@example.com 然后你就完成设置了。现在让我们开始 Git。 -### 仓库: +### 仓库 创建一个新目录,打开它并运行以下命令: @@ -52,13 +52,11 @@ git init ![](http://itsfoss.com/wp-content/uploads/2016/05/Playing-around-git-1-1024x173.png) -这个命令会创建一个新的 git 仓库。你的本地仓库由三个 git 维护的“树”组成。 +这个命令会创建一个新的 Git 仓库(repository)。你的本地仓库由三个 Git 维护的“树”组成。 -第一个是你的**工作目录**,保存实际的文件。第二个是索引,实际上扮演的是暂存区,最后一个是 HEAD,它指向你最后一个 commit 提交。 +第一个是你的工作目录(Working Directory),保存实际的文件。第二个是索引,实际上扮演的是暂存区(staging area),最后一个是 HEAD,它指向你最后一个 commit 提交。使用 git clone /path/to/repository 签出你的仓库(从你刚创建的仓库或服务器上已存在的仓库)。 -使用 git clone /path/to/repository 签出你的仓库(从你刚创建的仓库或服务器上已存在的仓库)。 - -### 添加文件并提交: +### 添加文件并提交 你可以用以下命令添加改动: @@ -98,7 +96,7 @@ git commit -a ### 推送你的改动 -你的改动在你本地工作副本的 HEAD 中。如果你还没有从一个已存在的仓库克隆或想将你的仓库连接到远程服务器,你需要先添加它: +你的改动在你本地工作副本的 HEAD 中。如果你还没有从一个已存在的仓库克隆,或想将你的仓库连接到远程服务器,你需要先添加它: ``` git remote add origin <服务器地址> @@ -110,9 +108,9 @@ git remote add origin <服务器地址> git push -u origin master ``` -### 分支: +### 分支 -分支用于开发特性,它们之间是互相独立的。主分支 master 是你创建一个仓库时的“默认”分支。使用其它分支用于开发,在完成时将它合并回主分支。 +分支用于开发特性,分支之间是互相独立的。主分支 master 是你创建一个仓库时的“默认”分支。使用其它分支用于开发,在完成时将它合并回主分支。 创建一个名为“mybranch”的分支并切换到它之上: @@ -144,19 +142,19 @@ git push origin <分支名> ### 更新和合并 -要将你本地仓库更新到最新提交,运行: +要将你本地仓库更新到最新的提交上,运行: ``` git pull ``` -在你的工作目录获取和合并远程变动。要合并其它分支到你的活动分支(如 master),使用: +在你的工作目录获取并合并远程变动。要合并其它分支到你的活动分支(如 master),使用: ``` git merge <分支> ``` -在这两种情况下,git 会尝试自动合并(auto-merge)改动。不幸的是,这不总是可能的,可能会导致冲突。你需要负责通过编辑 git 显示的文件,手动合并那些冲突。改动之后,你需要用以下命令将它们标记为已合并: +在这两种情况下,git 会尝试自动合并(auto-merge)改动。不幸的是,这不总是可能的,可能会导致冲突。你需要通过编辑 git 所显示的文件,手动合并那些冲突。改动之后,你需要用以下命令将它们标记为已合并: ``` git add <文件名> @@ -168,7 +166,7 @@ git add <文件名> git diff <源分支> <目标分支> ``` -### GIT 日志: +### Git 日志 你可以这么查看仓库历史: @@ -176,7 +174,7 @@ git diff <源分支> <目标分支> git log ``` -要查看每个提交一行样式的日志你可以用: +要以每个提交一行的样式查看日志,你可以用: ``` git log --pretty=oneline @@ -196,9 +194,9 @@ git log --name-status 在这整个过程中如果你需要任何帮助,你可以用 git --help。 -Git 棒不棒!!!祝贺你你已经会 git 基础了。如果你愿意的话,你可以从下面这个链接下载这些基础 Git 命令作为快速参考: +Git 棒不棒?!祝贺你你已经会 Git 基础了。如果你愿意的话,你可以从下面这个链接下载这些基础 Git 命令作为快速参考: -[下载 Git Cheat Sheet][4] +- [下载 Git 速查表][4] -------------------------------------------------------------------------------- @@ -207,7 +205,7 @@ via: http://itsfoss.com/basic-git-commands-cheat-sheet/ 作者:[Rakhi Sharma][a] 译者:[alim0x](https://github.com/alim0x) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 55016034e0a77d8ea7606e6530c98a94c25be0b7 Mon Sep 17 00:00:00 2001 From: Cao Lu Date: Fri, 8 Jul 2016 00:26:25 +0800 Subject: [PATCH 1095/1469] [Translated] 20160518 Python 3 - An Intro to Encryption.md (#4156) * translated * Cathon is translating --- ...meet the IT needs of today and tomorrow.md | 1 + ...60518 Python 3 - An Intro to Encryption.md | 280 ------------------ ...60518 Python 3 - An Intro to Encryption.md | 280 ++++++++++++++++++ 3 files changed, 281 insertions(+), 280 deletions(-) delete mode 100644 sources/tech/20160518 Python 3 - An Intro to Encryption.md create mode 100644 translated/tech/20160518 Python 3 - An Intro to Encryption.md diff --git a/sources/talk/20160620 Training vs. hiring to meet the IT needs of today and tomorrow.md b/sources/talk/20160620 Training vs. hiring to meet the IT needs of today and tomorrow.md index e4d511c5bd..1417c9fe7b 100644 --- a/sources/talk/20160620 Training vs. hiring to meet the IT needs of today and tomorrow.md +++ b/sources/talk/20160620 Training vs. hiring to meet the IT needs of today and tomorrow.md @@ -1,3 +1,4 @@ +[Cathon is translating] Training vs. hiring to meet the IT needs of today and tomorrow ================================================================ diff --git a/sources/tech/20160518 Python 3 - An Intro to Encryption.md b/sources/tech/20160518 Python 3 - An Intro to Encryption.md deleted file mode 100644 index 3a840114d3..0000000000 --- a/sources/tech/20160518 Python 3 - An Intro to Encryption.md +++ /dev/null @@ -1,280 +0,0 @@ -[Cathon is Translating...] - -Python 3: An Intro to Encryption -=================================== - -Python 3 doesn’t have very much in its standard library that deals with encryption. Instead, you get hashing libraries. We’ll take a brief look at those in the chapter, but the primary focus will be on the following 3rd party packages: PyCrypto and cryptography. We will learn how to encrypt and decrypt strings with both of these libraries. - ---- - -### Hashing - -If you need secure hashes or message digest algorithms, then Python’s standard library has you covered in the **hashlib** module. It includes the FIPS secure hash algorithms SHA1, SHA224, SHA256, SHA384, and SHA512 as well as RSA’s MD5 algorithm. Python also supports the adler32 and crc32 hash functions, but those are in the **zlib** module. - -One of the most popular uses of hashes is storing the hash of a password instead of the password itself. Of course, the hash has to be a good one or it can be decrypted. Another popular use case for hashes is to hash a file and then send the file and its hash separately. Then the person receiving the file can run a hash on the file to see if it matches the hash that was sent. If it does, then that means no one has changed the file in transit. - - -Let’s try creating an md5 hash: - -``` ->>> import hashlib ->>> md5 = hashlib.md5() ->>> md5.update('Python rocks!') -Traceback (most recent call last): - File "", line 1, in - md5.update('Python rocks!') -TypeError: Unicode-objects must be encoded before hashing ->>> md5.update(b'Python rocks!') ->>> md5.digest() -b'\x14\x82\xec\x1b#d\xf6N}\x16*+[\x16\xf4w' -``` - -Let’s take a moment to break this down a bit. First off, we import **hashlib** and then we create an instance of an md5 HASH object. Next we add some text to the hash object and we get a traceback. It turns out that to use the md5 hash, you have to pass it a byte string instead of a regular string. So we try that and then call it’s **digest** method to get our hash. If you prefer the hex digest, we can do that too: - -``` ->>> md5.hexdigest() -'1482ec1b2364f64e7d162a2b5b16f477' -``` - -There’s actually a shortcut method of creating a hash, so we’ll look at that next when we create our sha512 hash: - -``` ->>> sha = hashlib.sha1(b'Hello Python').hexdigest() ->>> sha -'422fbfbc67fe17c86642c5eaaa48f8b670cbed1b' -``` - -As you can see, we can create our hash instance and call its digest method at the same time. Then we print out the hash to see what it is. I chose to use the sha1 hash as it has a nice short hash that will fit the page better. But it’s also less secure, so feel free to try one of the others. - ---- - -### Key Derivation - -Python has pretty limited support for key derivation built into the standard library. In fact, the only method that hashlib provides is the **pbkdf2_hmac** method, which is the PKCS#5 password-based key derivation function 2. It uses HMAC as its psuedorandom function. You might use something like this for hashing your password as it supports a salt and iterations. For example, if you were to use SHA-256 you would need a salt of at least 16 bytes and a minimum of 100,000 iterations. - -As a quick aside, a salt is just random data that you use as additional input into your hash to make it harder to “unhash” your password. Basically it protects your password from dictionary attacks and pre-computed rainbow tables. - -Let’s look at a simple example: - -``` ->>> import binascii ->>> dk = hashlib.pbkdf2_hmac(hash_name='sha256', - password=b'bad_password34', - salt=b'bad_salt', - iterations=100000) ->>> binascii.hexlify(dk) -b'6e97bad21f6200f9087036a71e7ca9fa01a59e1d697f7e0284cd7f9b897d7c02' -``` - -Here we create a SHA256 hash on a password using a lousy salt but with 100,000 iterations. Of course, SHA is not actually recommended for creating keys of passwords. Instead you should use something like **scrypt** instead. Another good option would be the 3rd party package, bcrypt. It is designed specifically with password hashing in mind. - ---- - -### PyCryptodome - -The PyCrypto package is probably the most well known 3rd party cryptography package for Python. Sadly PyCrypto’s development stopping in 2012. Others have continued to release the latest version of PyCryto so you can still get it for Python 3.5 if you don’t mind using a 3rd party’s binary. For example, I found some binary Python 3.5 wheels for PyCrypto on Github (https://github.com/sfbahr/PyCrypto-Wheels). - -Fortunately there is a fork of the project called PyCrytodome that is a drop-in replacement for PyCrypto. To install it for Linux, you can use the following pip command: - - -``` -pip install pycryptodome -``` - -Windows is a bit different: - -``` -pip install pycryptodomex -``` - -If you run into issues, it’s probably because you don’t have the right dependencies installed or you need a compiler for Windows. Check out the PyCryptodome [website][1] for additional installation help or to contact support. - -Also worth noting is that PyCryptodome has many enhancements over the last version of PyCrypto. It is well worth your time to visit their home page and see what new features exist. - -### Encrypting a String - -Once you’re done checking their website out, we can move on to some examples. For our first trick, we’ll use DES to encrypt a string: - -``` ->>> from Crypto.Cipher import DES ->>> key = 'abcdefgh' ->>> def pad(text): - while len(text) % 8 != 0: - text += ' ' - return text ->>> des = DES.new(key, DES.MODE_ECB) ->>> text = 'Python rocks!' ->>> padded_text = pad(text) ->>> encrypted_text = des.encrypt(text) -Traceback (most recent call last): - File "", line 1, in - encrypted_text = des.encrypt(text) - File "C:\Programs\Python\Python35-32\lib\site-packages\Crypto\Cipher\blockalgo.py", line 244, in encrypt - return self._cipher.encrypt(plaintext) -ValueError: Input strings must be a multiple of 8 in length ->>> encrypted_text = des.encrypt(padded_text) ->>> encrypted_text -b'>\xfc\x1f\x16x\x87\xb2\x93\x0e\xfcH\x02\xd59VQ' -``` - -This code is a little confusing, so let’s spend some time breaking it down. First off, it should be noted that the key size for DES encryption is 8 bytes, which is why we set our key variable to a size letter string. The string that we will be encrypting must be a multiple of 8 in length, so we create a function called **pad** that can pad any string out with spaces until it’s a multiple of 8. Next we create an instance of DES and some text that we want to encrypt. We also create a padded version of the text. Just for fun, we attempt to encrypt the original unpadded variant of the string which raises a **ValueError**. Here we learn that we need that padded string after all, so we pass that one in instead. As you can see, we now have an encrypted string! - -Of course the example wouldn’t be complete if we didn’t know how to decrypt our string: - -``` ->>> des.decrypt(encrypted_text) -b'Python rocks! ' -``` - -Fortunately, that is very easy to accomplish as all we need to do is call the **decrypt** method on our des object to get our decrypted byte string back. Our next task is to learn how to encrypt and decrypt a file with PyCrypto using RSA. But first we need to create some RSA keys! - -### Create an RSA Key - -If you want to encrypt your data with RSA, then you’ll need to either have access to a public / private RSA key pair or you will need to generate your own. For this example, we will just generate our own. Since it’s fairly easy to do, we will do it in Python’s interpreter: - -``` ->>> from Crypto.PublicKey import RSA ->>> code = 'nooneknows' ->>> key = RSA.generate(2048) ->>> encrypted_key = key.exportKey(passphrase=code, pkcs=8, - protection="scryptAndAES128-CBC") ->>> with open('/path_to_private_key/my_private_rsa_key.bin', 'wb') as f: - f.write(encrypted_key) ->>> with open('/path_to_public_key/my_rsa_public.pem', 'wb') as f: - f.write(key.publickey().exportKey()) -``` - -First we import **RSA** from **Crypto.PublicKey**. Then we create a silly passcode. Next we generate an RSA key of 2048 bits. Now we get to the good stuff. To generate a private key, we need to call our RSA key instance’s **exportKey** method and give it our passcode, which PKCS standard to use and which encryption scheme to use to protect our private key. Then we write the file out to disk. - -Next we create our public key via our RSA key instance’s **publickey** method. We used a shortcut in this piece of code by just chaining the call to exportKey with the publickey method call to write it to disk as well. - -### Encrypting a File - -Now that we have both a private and a public key, we can encrypt some data and write it to a file. Here’s a pretty standard example: - -``` -from Crypto.PublicKey import RSA -from Crypto.Random import get_random_bytes -from Crypto.Cipher import AES, PKCS1_OAEP - -with open('/path/to/encrypted_data.bin', 'wb') as out_file: - recipient_key = RSA.import_key( - open('/path_to_public_key/my_rsa_public.pem').read()) - session_key = get_random_bytes(16) - - cipher_rsa = PKCS1_OAEP.new(recipient_key) - out_file.write(cipher_rsa.encrypt(session_key)) - - cipher_aes = AES.new(session_key, AES.MODE_EAX) - data = b'blah blah blah Python blah blah' - ciphertext, tag = cipher_aes.encrypt_and_digest(data) - - out_file.write(cipher_aes.nonce) - out_file.write(tag) - out_file.write(ciphertext) -``` - -The first three lines cover our imports from PyCryptodome. Next we open up a file to write to. Then we import our public key into a variable and create a 16-byte session key. For this example we are going to be using a hybrid encryption method, so we use PKCS#1 OAEP, which is Optimal asymmetric encryption padding. This allows us to write a data of an arbitrary length to the file. Then we create our AES cipher, create some data and encrypt the data. This will return the encrypted text and the MAC. Finally we write out the nonce, MAC (or tag) and the encrypted text. - -As an aside, a nonce is an arbitrary number that is only used for crytographic communication. They are usually random or pseudorandom numbers. For AES, it must be at least 16 bytes in length. Feel free to try opening the encrypted file in your favorite text editor. You should just see gibberish. - -Now let’s learn how to decrypt our data: - -``` -from Crypto.PublicKey import RSA -from Crypto.Cipher import AES, PKCS1_OAEP - -code = 'nooneknows' - -with open('/path/to/encrypted_data.bin', 'rb') as fobj: - private_key = RSA.import_key( - open('/path_to_private_key/my_rsa_key.pem').read(), - passphrase=code) - - enc_session_key, nonce, tag, ciphertext = [ fobj.read(x) - for x in (private_key.size_in_bytes(), - 16, 16, -1) ] - - cipher_rsa = PKCS1_OAEP.new(private_key) - session_key = cipher_rsa.decrypt(enc_session_key) - - cipher_aes = AES.new(session_key, AES.MODE_EAX, nonce) - data = cipher_aes.decrypt_and_verify(ciphertext, tag) - -print(data) -``` - -If you followed the previous example, this code should be pretty easy to parse. In this case, we are opening our encrypted file for reading in binary mode. Then we import our private key. Note that when you import the private key, you must give it your passcode. Otherwise you will get an error. Next we read in our file. You will note that we read in the private key first, then the next 16 bytes for the nonce, which is followed by the next 16 bytes which is the tag and finally the rest of the file, which is our data. - -Then we need to decrypt our session key, recreate our AES key and decrypt the data. - -You can use PyCryptodome to do much, much more. However we need to move on and see what else we can use for our cryptographic needs in Python. - ---- - -### The cryptography package - -The **cryptography** package aims to be “cryptography for humans” much like the **requests** library is “HTTP for Humans”. The idea is that you will be able to create simple cryptographic recipes that are safe and easy-to-use. If you need to, you can drop down to low=level cryptographic primitives, which require you to know what you’re doing or you might end up creating something that’s not very secure. - -If you are using Python 3.5, you can install it with pip, like so: - -``` -pip install cryptography -``` - -You will see that cryptography installs a few dependencies along with itself. Assuming that they all completed successfully, we can try encrypting some text. Let’s give the **Fernet** symmetric encryption algorithm. The Fernet algorithm guarantees that any message you encrypt with it cannot be manipulated or read without the key you define. Fernet also support key rotation via **MultiFernet**. Let’s take a look at a simple example: - -``` ->>> from cryptography.fernet import Fernet ->>> cipher_key = Fernet.generate_key() ->>> cipher_key -b'APM1JDVgT8WDGOWBgQv6EIhvxl4vDYvUnVdg-Vjdt0o=' ->>> cipher = Fernet(cipher_key) ->>> text = b'My super secret message' ->>> encrypted_text = cipher.encrypt(text) ->>> encrypted_text -(b'gAAAAABXOnV86aeUGADA6mTe9xEL92y_m0_TlC9vcqaF6NzHqRKkjEqh4d21PInEP3C9HuiUkS9f' - b'6bdHsSlRiCNWbSkPuRd_62zfEv3eaZjJvLAm3omnya8=') ->>> decrypted_text = cipher.decrypt(encrypted_text) ->>> decrypted_text -b'My super secret message' -``` - -First off we need to import Fernet. Next we generate a key. We print out the key to see what it looks like. As you can see, it’s a random byte string. If you want, you can try running the **generate_key** method a few times. The result will always be different. Next we create our Fernet cipher instance using our key. - -Now we have a cipher we can use to encrypt and decrypt our message. The next step is to create a message worth encrypting and then encrypt it using the **encrypt** method. I went ahead and printed our the encrypted text so you can see that you can no longer read the text. To **decrypt** our super secret message, we just call decrypt on our cipher and pass it the encrypted text. The result is we get a plain text byte string of our message. - ---- - -### Wrapping Up - -This chapter barely scratched the surface of what you can do with PyCryptodome and the cryptography packages. However it does give you a decent overview of what can be done with Python in regards to encrypting and decrypting strings and files. Be sure to read the documentation and start experimenting to see what else you can do! - ---- - -### Related Reading - -PyCrypto Wheels for Python 3 on [github][2] - -PyCryptodome [documentation][3] - -Python’s Cryptographic [Services][4] - -The cryptography package’s [website][5] - ------------------------------------------------------------------------------- - -via: http://www.blog.pythonlibrary.org/2016/05/18/python-3-an-intro-to-encryption/ - -作者:[Mike][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.blog.pythonlibrary.org/author/mld/ -[1]: http://pycryptodome.readthedocs.io/en/latest/ -[2]: https://github.com/sfbahr/PyCrypto-Wheels -[3]: http://pycryptodome.readthedocs.io/en/latest/src/introduction.html -[4]: https://docs.python.org/3/library/crypto.html -[5]: https://cryptography.io/en/latest/ diff --git a/translated/tech/20160518 Python 3 - An Intro to Encryption.md b/translated/tech/20160518 Python 3 - An Intro to Encryption.md new file mode 100644 index 0000000000..5c57264aa7 --- /dev/null +++ b/translated/tech/20160518 Python 3 - An Intro to Encryption.md @@ -0,0 +1,280 @@ +Python 3: 加密简介 +=================================== + +Python 3 的标准库中没什么用来解决加密的,不过却有用于处理哈希的库。在这里我们会对其进行一个简单的介绍,但重点会放在两个第三方的软件包: PyCrypto 和 cryptography 上。我们将学习如何使用这两个库,来加密和解密字符串。 + +--- + +### 哈希 + +如果需要用到安全哈希算法或是消息摘要算法,那么你可以使用标准库中的 **hashlib** 模块。这个模块包含了标准的安全哈希算法,包括 SHA1,SHA224,SHA256,SHA384,SHA512 以及 RSA 的 MD5 算法。Python 的 **zlib** 模块也提供 adler32 以及 crc32 哈希函数。 + +一个哈希最常见的用法是,存储密码的哈希值而非密码本身。当然了,使用的哈希函数需要稳健一点,否则容易被破解。另一个常见的用法是,计算一个文件的哈希值,然后将这个文件和它的哈希值分别发送。接受到文件的人可以计算文件的哈希值,检验是否与接受到的哈希值相符。如果两者相符,就说明文件在传送的过程中未经篡改。 + +让我们试着创建一个 md5 哈希: + +``` +>>> import hashlib +>>> md5 = hashlib.md5() +>>> md5.update('Python rocks!') +Traceback (most recent call last): + File "", line 1, in + md5.update('Python rocks!') +TypeError: Unicode-objects must be encoded before hashing +>>> md5.update(b'Python rocks!') +>>> md5.digest() +b'\x14\x82\xec\x1b#d\xf6N}\x16*+[\x16\xf4w' +``` + +Let’s take a moment to break this down a bit. First off, we import **hashlib** and then we create an instance of an md5 HASH object. Next we add some text to the hash object and we get a traceback. It turns out that to use the md5 hash, you have to pass it a byte string instead of a regular string. So we try that and then call it’s **digest** method to get our hash. If you prefer the hex digest, we can do that too: + +让我们花点时间一行一行来讲解。首先,我们导入 **hashlib** ,然后创建一个 md5 哈希对象的实例。接着,我们向这个实例中添加一个字符串后,却得到了报错信息。原来,计算 md5 哈希时,需要使用字节形式的字符串而非普通字符串。正确添加字符串后,我们调用它的 **digest** 函数来得到哈希值。如果你想要十六进制的哈希值,也可以用以下方法: + +``` +>>> md5.hexdigest() +'1482ec1b2364f64e7d162a2b5b16f477' +``` + +实际上,有一种精简的方法来创建哈希,下面我们看一下用这种方法创建一个 sha512 哈希: + +``` +>>> sha = hashlib.sha1(b'Hello Python').hexdigest() +>>> sha +'422fbfbc67fe17c86642c5eaaa48f8b670cbed1b' +``` + +可以看到,我们可以同时创建一个哈希实例并且调用其 digest 函数。然后,我们打印出这个哈希值看一下。这里我使用 sha1 哈希函数作为例子,但它不是特别安全,读者可以随意尝试其他的哈希函数。 + + +--- + +### 密钥导出 + +Python 的标准库对密钥导出支持较弱。实际上,hashlib 函数库提供的唯一方法就是 **pbkdf2_hmac** 函数。它是基于口令的密钥导出函数 PKCS#5 ,并使用 HMAC 作为伪随机函数。因为它支持加盐和迭代操作,你可以使用类似的方法来哈希你的密码。例如,如果你打算使用 SHA-256 加密方法,你将需要至少 16 个字节的盐,以及最少 100000 次的迭代操作。 + +简单来说,盐就是随机的数据,被用来加入到哈希的过程中,以加大破解的难度。这基本可以保护你的密码免受字典和彩虹表的攻击。 + +让我们看一个简单的例子: + +``` +>>> import binascii +>>> dk = hashlib.pbkdf2_hmac(hash_name='sha256', + password=b'bad_password34', + salt=b'bad_salt', + iterations=100000) +>>> binascii.hexlify(dk) +b'6e97bad21f6200f9087036a71e7ca9fa01a59e1d697f7e0284cd7f9b897d7c02' +``` + +这里,我们用 SHA256 对一个密码进行哈希,使用了一个糟糕的盐,但经过了 100000 次迭代操作。当然,SHA 实际上并不被推荐用来创建密码的密钥。你应该使用类似 **scrypt** 的算法来替代。另一个不错的选择是使用一个叫 **bcrypt** 的第三方库。它是被专门设计出来哈希密码的。 + +--- + +### PyCryptodome + +PyCrypto 可能是 Python 中密码学方面最有名的第三方软件包。可惜的是,它的开发工作于 2012 年就已停止。其他人还在继续发布最新版本的 PyCrypto,如果你不介意使用第三方的二进制包,仍可以取得 Python 3.5 的相应版本。比如,我在 Github (https://github.com/sfbahr/PyCrypto-Wheels) 上找到了对应 Python 3.5 的 PyCrypto 二进制包。 + +幸运的是,有一个该项目的分支 PyCrytodome 取代了 PyCrypto 。为了在 Linux 上安装它,你可以使用以下 pip 命令: + +``` +pip install pycryptodome +``` + +在 Windows 系统上安装则稍有不同: + +``` +pip install pycryptodomex +``` + +如果你遇到了问题,可能是因为你没有安装正确的依赖包(译者注:如 python-devel),或者你的 Windows 系统需要一个编译器。如果你需要安装上的帮助或技术支持,可以访问 PyCryptodome 的[网站][1]。 + +还值得注意的是,PyCryptodome 在 PyCrypto 最后版本的基础上有很多改进。非常值得去访问它们的主页,看看有什么新的特性。 + +### 加密字符串 + +访问了他们的主页之后,我们可以看一些例子。在第一个例子中,我们将使用 DES 算法来加密一个字符串: + +``` +>>> from Crypto.Cipher import DES +>>> key = 'abcdefgh' +>>> def pad(text): + while len(text) % 8 != 0: + text += ' ' + return text +>>> des = DES.new(key, DES.MODE_ECB) +>>> text = 'Python rocks!' +>>> padded_text = pad(text) +>>> encrypted_text = des.encrypt(text) +Traceback (most recent call last): + File "", line 1, in + encrypted_text = des.encrypt(text) + File "C:\Programs\Python\Python35-32\lib\site-packages\Crypto\Cipher\blockalgo.py", line 244, in encrypt + return self._cipher.encrypt(plaintext) +ValueError: Input strings must be a multiple of 8 in length +>>> encrypted_text = des.encrypt(padded_text) +>>> encrypted_text +b'>\xfc\x1f\x16x\x87\xb2\x93\x0e\xfcH\x02\xd59VQ' +``` + +这段代码稍有些复杂,让我们一点点来看。首先需要注意的是,DES 加密使用的密钥长度为 8 个字节,这也是我们将密钥变量设置为 8 个字符的原因。而我们需要加密的字符串的长度必须是 8 的倍数,所以我们创建了一个名为 **pad** 的函数,来给一个字符串末尾添加空格,直到它的长度是 8 的倍数。然后,我们创建了一个 DES 的实例,以及我们需要加密的文本。我们还创建了一个经过填充处理的文本。我们尝试这对未经填充处理的文本进行加密,啊欧,报错了!我们需要对经过填充处理的文本进行加密,然后得到加密的字符串。 +(译者注:encrypt 函数的参数应为 byte 类型字符串,代码为:`encrypted_text = des.encrypt(padded_textpadded_text.encode('uf-8'))`) + +知道了如何加密,还要知道如何解密: + +``` +>>> des.decrypt(encrypted_text) +b'Python rocks! ' +``` + +幸运的是,解密非常容易,我们只需要调用 des 对象的 **decrypt** 方法就可以得到我们原来的 byte 类型字符串了。下一个任务是学习如何用 RSA 算法加密和解密一个文件。首先,我们需要创建一些 RSA 密钥。 + +### 创建 RSA 密钥 + +如果你希望使用 RSA 算法加密数据,那么你需要拥有访问 RAS 公钥和私钥的权限,否则你需要生成一组自己的密钥对。在这个例子中,我们将生成自己的密钥对。创建 RSA 密钥非常容易,所以我们将在 Python 解释器中完成。 + +``` +>>> from Crypto.PublicKey import RSA +>>> code = 'nooneknows' +>>> key = RSA.generate(2048) +>>> encrypted_key = key.exportKey(passphrase=code, pkcs=8, + protection="scryptAndAES128-CBC") +>>> with open('/path_to_private_key/my_private_rsa_key.bin', 'wb') as f: + f.write(encrypted_key) +>>> with open('/path_to_public_key/my_rsa_public.pem', 'wb') as f: + f.write(key.publickey().exportKey()) +``` + +首先我们从 **Crypto.PublicKey** 包中导入 **RSA**,然后创建一个傻傻的密码。接着我们生成 2048 位的 RSA 密钥。现在我们到了关键的部分。为了生成私钥,我们需要调用 RSA 密钥实例的 **exportKey** 方法,然后传入密码,使用的 PKCS 标准,以及加密方案这三个参数。之后,我们把私钥写入磁盘的文件中。 + +接下来,我们通过 RSA 密钥实例的 **publickey** 方法创建我们的公钥。我们使用方法链调用 publickey 和 exportKey 方法生成公钥,同样将它写入磁盘上的文件。 + +### 加密文件 + +有了私钥和公钥之后,我们就可以加密一些数据,并写入文件了。这儿有个比较标准的例子: + +``` +from Crypto.PublicKey import RSA +from Crypto.Random import get_random_bytes +from Crypto.Cipher import AES, PKCS1_OAEP + +with open('/path/to/encrypted_data.bin', 'wb') as out_file: + recipient_key = RSA.import_key( + open('/path_to_public_key/my_rsa_public.pem').read()) + session_key = get_random_bytes(16) + + cipher_rsa = PKCS1_OAEP.new(recipient_key) + out_file.write(cipher_rsa.encrypt(session_key)) + + cipher_aes = AES.new(session_key, AES.MODE_EAX) + data = b'blah blah blah Python blah blah' + ciphertext, tag = cipher_aes.encrypt_and_digest(data) + + out_file.write(cipher_aes.nonce) + out_file.write(tag) + out_file.write(ciphertext) +``` + +代码的前三行导入 PyCryptodome 包。然后我们打开一个文件用于写入数据。接着我们导入公钥赋给一个变量,创建一个 16 字节的会话密钥。在这个例子中,我们将使用混合加密方法,即 PKCS#1 OAEP ,也就是最优非对称加密填充。这允许我们向文件中写入任意长度的数据。接着我们创建 AES 加密,要加密的数据,然后加密数据。我们将得到加密的文本和消息认证码。最后,我们将随机数,消息认证码和加密的文本写入文件。 + +顺便提一下,随机数通常是真随机或伪随机数,只是用来进行密码通信的。对于 AES 加密,其密钥长度最少是 16 个字节。随意用一个你喜欢的编辑器试着打开这个被加密的文件,你应该只能看到乱码。 + +现在让我们学习如何解密我们的数据。 + +``` +from Crypto.PublicKey import RSA +from Crypto.Cipher import AES, PKCS1_OAEP + +code = 'nooneknows' + +with open('/path/to/encrypted_data.bin', 'rb') as fobj: + private_key = RSA.import_key( + open('/path_to_private_key/my_rsa_key.pem').read(), + passphrase=code) + + enc_session_key, nonce, tag, ciphertext = [ fobj.read(x) + for x in (private_key.size_in_bytes(), + 16, 16, -1) ] + + cipher_rsa = PKCS1_OAEP.new(private_key) + session_key = cipher_rsa.decrypt(enc_session_key) + + cipher_aes = AES.new(session_key, AES.MODE_EAX, nonce) + data = cipher_aes.decrypt_and_verify(ciphertext, tag) + +print(data) +``` + +如果你认真看了上一个例子,这段代码应该很容易解析。在这里,我们先读取二进制的加密文件,然后导入私钥。注意,当你导入私钥时,需要提供一个密码,否则会出现错误。然后,我们文件中读取数据,首先是加密的会话密钥,然后是 16 字节的随机数和 16 字节的消息认证码,最后是剩下的加密的数据。 + +接下来我们需要解密出会话密钥,重新创建 AES 密钥,然后解密出数据。 + +你还可以用 PyCryptodome 库做更多的事。不过我们要接着讨论在 Python 中还可以用什么来满足我们加密解密的需求。 + +--- + +### cryptography 包 + +**cryptography** 的目标是成为人类易于使用的密码学包,就像 **requests** 是人类易于使用的 HTTP 库一样。这个想法使你能够创建简单安全,易于使用的加密方案。如果有需要的话,你也可以使用一些底层的密码学基元,但这也需要你知道更多的细节,否则创建的东西将是不安全的。 + +如果你使用的 Python 版本是 3.5, 你可以使用 pip 安装,如下: + +``` +pip install cryptography +``` + +你会看到 cryptography 包还安装了一些依赖包(译者注:如 libopenssl-devel)。如果安装都顺利,我们就可以试着加密一些文本了。让我们使用 **Fernet** 对称加密算法,它保证了你加密的任何信息在不知道密码的情况下不能被篡改或读取。Fernet 还通过 **MultiFernet** 支持密钥轮换。下面让我们看一个简单的例子: + +``` +>>> from cryptography.fernet import Fernet +>>> cipher_key = Fernet.generate_key() +>>> cipher_key +b'APM1JDVgT8WDGOWBgQv6EIhvxl4vDYvUnVdg-Vjdt0o=' +>>> cipher = Fernet(cipher_key) +>>> text = b'My super secret message' +>>> encrypted_text = cipher.encrypt(text) +>>> encrypted_text +(b'gAAAAABXOnV86aeUGADA6mTe9xEL92y_m0_TlC9vcqaF6NzHqRKkjEqh4d21PInEP3C9HuiUkS9f' + b'6bdHsSlRiCNWbSkPuRd_62zfEv3eaZjJvLAm3omnya8=') +>>> decrypted_text = cipher.decrypt(encrypted_text) +>>> decrypted_text +b'My super secret message' +``` + +首先我们需要导入 Fernet,然后生成一个密钥。我们输出密钥看看它是什么样儿。如你所见,它是一个随机的字节串。如果你愿意的话,可以试着多运行 **generate_key** 方法几次,生成的密钥会是不同的。然后我们使用这个密钥生成 Fernet 密码实例。 + +现在我们有了用来加密和解密消息的密码。下一步是创建一个需要加密的消息,然后使用 **encrypt** 方法对它加密。我打印出加密的文本,然后你可以看到你不再能够读懂它。为了**解密**出我们的秘密消息,我们只需调用 decrypt 方法,并传入加密的文本作为参数。结果就是我们得到了消息字节串形式的纯文本。 + +--- + +### 小结 + +这一章仅仅浅显地介绍了 PyCryptodome 和 cryptography 这两个包的使用。不过这也确实给了你一个关于如何加密解密字符串和文件的简述。请务必阅读文档,做做实验,看看还能做些什么! + +--- + +### 相关阅读 + +[Github][2] 上 Python 3 的 PyCrypto Wheels + +PyCryptodome 的 [文档][3] + +Python’s 加密 [服务][4] + +Cryptography 包的 [官网][5] + +------------------------------------------------------------------------------ + +via: http://www.blog.pythonlibrary.org/2016/05/18/python-3-an-intro-to-encryption/ + +作者:[Mike][a] +译者:[Cathon](https://github.com/Cathon) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.blog.pythonlibrary.org/author/mld/ +[1]: http://pycryptodome.readthedocs.io/en/latest/ +[2]: https://github.com/sfbahr/PyCrypto-Wheels +[3]: http://pycryptodome.readthedocs.io/en/latest/src/introduction.html +[4]: https://docs.python.org/3/library/crypto.html +[5]: https://cryptography.io/en/latest/ From 5b80208b154d3c0aeb72e224354f57b921710b43 Mon Sep 17 00:00:00 2001 From: Ping Date: Thu, 7 Jul 2016 17:29:13 +0800 Subject: [PATCH 1096/1469] Finished Translating --- ...ervices with Python RabbitMQ and Nameko.md | 281 ----------------- ...ervices with Python RabbitMQ and Nameko.md | 291 ++++++++++++++++++ 2 files changed, 291 insertions(+), 281 deletions(-) delete mode 100644 sources/tech/20160304 Microservices with Python RabbitMQ and Nameko.md create mode 100644 translated/tech/20160304 Microservices with Python RabbitMQ and Nameko.md diff --git a/sources/tech/20160304 Microservices with Python RabbitMQ and Nameko.md b/sources/tech/20160304 Microservices with Python RabbitMQ and Nameko.md deleted file mode 100644 index 6879a0778b..0000000000 --- a/sources/tech/20160304 Microservices with Python RabbitMQ and Nameko.md +++ /dev/null @@ -1,281 +0,0 @@ -Translating by Ping - -Microservices with Python RabbitMQ and Nameko -============================================== - ->"Micro-services is the new black" - Splitting the project in to independently scalable services is the currently the best option to ensure the evolution of the code. In Python there is a Framework called "Nameko" which makes it very easy and powerful. - -### Micro services - ->The term "Microservice Architecture" has sprung up over the last few years to describe a particular way of designing software applications as suites of independently deployable services. - M. Fowler - -I recommend reading the [Fowler's posts][1] to understand the theory behind it. - -#### Ok I so what does it mean? - -In brief a Micro Service Architecture exists when your system is divided in small (single context bound) responsibilities blocks, those blocks doesn't know each other, they only have a common point of communication, generally a message queue, and does know the communication protocol and interfaces. - -#### Give me a real-life example - ->The code is available on github: take a look at service and api folders for more info. - -Consider you have an REST API, that API has an endpoint receiving some data and you need to perform some kind of computation with that data, instead of blocking the caller you can do it asynchronously, return an status "OK - Your request will be processed" to the caller and do it in a background task. - -Also you want to send an email notification when the computation is finished without blocking the main computing process, so it is better to delegate the "email sending" to another service. - -#### Scenario - -![](http://brunorocha.org/static/media/microservices/micro_services.png) - -### Show me the code! - -Lets create the system to understand it in practice. - -#### Environment - -We need an environment with: - -- A running RabbitMQ -- Python VirtualEnv for services -- Python VirtualEnv for API - -#### Rabbit - -The easiest way to have a RabbitMQ in development environment is running its official docker container, considering you have Docker installed run: - -``` -docker run -d --hostname my-rabbit --name some-rabbit -p 15672:15672 -p 5672:5672 rabbitmq:3-management -``` - -Go to the browser and access using credentials guest:guest if you can login to RabbitMQ dashboard it means you have it running locally for development. - -![](http://brunorocha.org/static/media/microservices/RabbitMQManagement.png) - -#### The Service environment - -Now lets create the Micro Services to consume our tasks. We'll have a service for computing and another for mail, follow the steps. - -In a shell create the root project directory - -``` -$ mkdir myproject -$ cd myproject -``` - -Create and activate a virtualenv (you can also use virtualenv-wrapper) - -``` -$ virtualenv service_env -$ source service_env/bin/activate -``` - -Install nameko framework and yagmail - -``` -(service_env)$ pip install nameko -(service_env)$ pip install yagmail -``` - -#### The service code - -Now having that virtualenv prepared (consider you can run service in a server and API in another) lets code the nameko RPC Services. - -We are going to put both services in a single python module, but you can also split in separate modules and also run them in separate servers if needed. - -In a file called `service.py` - -``` -import yagmail -from nameko.rpc import rpc, RpcProxy - - -class Mail(object): - name = "mail" - - @rpc - def send(self, to, subject, contents): - yag = yagmail.SMTP('myname@gmail.com', 'mypassword') - # read the above credentials from a safe place. - # Tip: take a look at Dynaconf setting module - yag.send(to=to.encode('utf-8), - subject=subject.encode('utf-8), - contents=[contents.encode('utf-8)]) - - -class Compute(object): - name = "compute" - mail = RpcProxy('mail') - - @rpc - def compute(self, operation, value, other, email): - operations = {'sum': lambda x, y: int(x) + int(y), - 'mul': lambda x, y: int(x) * int(y), - 'div': lambda x, y: int(x) / int(y), - 'sub': lambda x, y: int(x) - int(y)} - try: - result = operations[operation](value, other) - except Exception as e: - self.mail.send.async(email, "An error occurred", str(e)) - raise - else: - self.mail.send.async( - email, - "Your operation is complete!", - "The result is: %s" % result - ) - return result -``` - -Now with the above services definition we need to run it as a Nameko RPC service. - ->NOTE: We are going to run it in a console and leave it running, but in production it is recommended to put the service to run using supervisord or an alternative. - -Run the service and let it running in a shell - -``` -(service_env)$ nameko run service --broker amqp://guest:guest@localhost -starting services: mail, compute -Connected to amqp://guest:**@127.0.0.1:5672// -Connected to amqp://guest:**@127.0.0.1:5672// -``` - -#### Testing it - -Go to another shell (with the same virtenv) and test it using nameko shell - -``` -(service_env)$ nameko shell --broker amqp://guest:guest@localhost -Nameko Python 2.7.9 (default, Apr 2 2015, 15:33:21) -[GCC 4.9.2] shell on linux2 -Broker: amqp://guest:guest@localhost ->>> -``` - -You are now in the RPC client testing shell exposing the n.rpc object, play with it - -``` ->>> n.rpc.mail.send("name@email.com", "testing", "Just testing") -``` - -The above should sent an email and we can also call compute service to test it, note that it also spawns an async mail sending with result. - -``` ->>> n.rpc.compute.compute('sum', 30, 10, "name@email.com") -40 ->>> n.rpc.compute.compute('sub', 30, 10, "name@email.com") -20 ->>> n.rpc.compute.compute('mul', 30, 10, "name@email.com") -300 ->>> n.rpc.compute.compute('div', 30, 10, "name@email.com") -3 -``` - -### Calling the micro-service through the API - -In a different shell (or even a different server) prepare the API environment - -Create and activate a virtualenv (you can also use virtualenv-wrapper) - -``` -$ virtualenv api_env -$ source api_env/bin/activate -``` - -Install Nameko, Flask and Flasgger - -``` -(api_env)$ pip install nameko -(api_env)$ pip install flask -(api_env)$ pip install flasgger -``` - ->NOTE: In api you dont need the yagmail because it is service responsability - -Lets say you have the following code in a file `api.py` - -``` -from flask import Flask, request -from flasgger import Swagger -from nameko.standalone.rpc import ClusterRpcProxy - -app = Flask(__name__) -Swagger(app) -CONFIG = {'AMQP_URI': "amqp://guest:guest@localhost"} - - -@app.route('/compute', methods=['POST']) -def compute(): - """ - Micro Service Based Compute and Mail API - This API is made with Flask, Flasgger and Nameko - --- - parameters: - - name: body - in: body - required: true - schema: - id: data - properties: - operation: - type: string - enum: - - sum - - mul - - sub - - div - email: - type: string - value: - type: integer - other: - type: integer - responses: - 200: - description: Please wait the calculation, you'll receive an email with results - """ - operation = request.json.get('operation') - value = request.json.get('value') - other = request.json.get('other') - email = request.json.get('email') - msg = "Please wait the calculation, you'll receive an email with results" - subject = "API Notification" - with ClusterRpcProxy(CONFIG) as rpc: - # asynchronously spawning and email notification - rpc.mail.send.async(email, subject, msg) - # asynchronously spawning the compute task - result = rpc.compute.compute.async(operation, value, other, email) - return msg, 200 - -app.run(debug=True) -``` - -Put the above API to run in a different shell or server - -``` -(api_env) $ python api.py - * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit) -``` - -and then access the url you will see the Flasgger UI and you can interact with the api and start producing tasks on queue to the service to consume. - -![](http://brunorocha.org/static/media/microservices/Flasgger_API_documentation.png) - ->NOTE: You can see the shell where service is running for logging, prints and error messages. You can also access the RabbitMQ dashboard to see if there is some message in process there. - -There is a lot of more advanced things you can do with Nameko framework you can find more information on - -Let's Micro Serve! - - --------------------------------------------------------------------------------- - -via: http://brunorocha.org/python/microservices-with-python-rabbitmq-and-nameko.html - -作者: [Bruno Rocha][a] -译者: [译者ID](https://github.com/译者ID) -校对: [校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://facebook.com/rochacbruno -[1]:http://martinfowler.com/articles/microservices.html diff --git a/translated/tech/20160304 Microservices with Python RabbitMQ and Nameko.md b/translated/tech/20160304 Microservices with Python RabbitMQ and Nameko.md new file mode 100644 index 0000000000..ea449e9f6c --- /dev/null +++ b/translated/tech/20160304 Microservices with Python RabbitMQ and Nameko.md @@ -0,0 +1,291 @@ +基于 Python、 RabbitMQ 和 Nameko 的微服务 +============================================== + +>"微服务是一股新浪潮" - 现如今,将项目拆分成多个独立的、可扩展的服务是保障代码演变的最好选择。在 Python 的世界里,有个叫做 “Nameko” 的框架,它将微服务的实现变得简单并且强大。 + + +### 微服务 + +> 在最近的几年里,“微服务架构”如雨后春笋般涌现。它用于描述一种特定的软件应用设计方式,这种方式使得应用可以由多个独立部署的服务以服务套件的形式组成。 - M. Fowler + +推荐各位读一下 [Fowler's posts][1] 以理解它背后的原理。 + + +#### 好吧,那它究竟意味着什么呢? + +简单来说,**微服务架构**可以将你的系统拆分成多个负责不同任务的小块儿,它们之间互不依赖,各自只提供用于通讯的通用指向。这个指向通常是已经将通讯协议和接口定义好的消息队列。 + + +#### 这里给大家提供一个真实案例 + +>案例的代码可以通过github: 访问,查看 service 和 api 文件夹可以获取更多信息。 + +想象一下,你有一个 REST API ,这个 API 有一个端点(译者注:REST 风格的 API 可以有多个端点用于处理对同一资源的不同类型的请求)用来接受数据,并且你需要将接收到的数据进行一些运算。那么相比阻塞接口调用者的请求来说,异步实现此接口是一个更好的选择。你可以先给用户返回一个 "OK - 你的请求稍后会处理" 的状态,然后在后台任务中完成运算。 + +同样,如果你想要在不阻塞主进程的前提下,在计算完成后发送一封提醒邮件,那么将“邮件发送”委托给其他服务去做会更好一些。 + + +#### 场景描述 + +![](http://brunorocha.org/static/media/microservices/micro_services.png) + + +### 用代码说话: + +让我们将系统创建起来,在实践中理解它: + + +#### 环境 + +我们需要的环境: + +- 运行良好的 RabbitMQ(译者注:[RabbitMQ][2]是一个流行的消息队列实现) +- 由 VirtualEnv 提供的 Services 虚拟环境 +- 由 VirtualEnv 提供的 API 虚拟环境 + + +#### Rabbit + +在开发环境中使用 RabbitMQ 最简单的方式就是运行其官方的 docker 容器。在你已经拥有 Docker 的情况下,运行: + +``` +docker run -d --hostname my-rabbit --name some-rabbit -p 15672:15672 -p 5672:5672 rabbitmq:3-management +``` + +在浏览器中访问 ,如果能够使用 guest:guest 验证信息登录 RabbitMQ 的控制面板,说明它已经在你的开发环境中运行起来了。 + +![](http://brunorocha.org/static/media/microservices/RabbitMQManagement.png) + + +#### 服务环境 + +现在让我们创建微服务来消费我们的任务。其中一个服务用来执行计算任务,另一个用来发送邮件。按以下步骤执行: + +在 Shell 中创建项目的根目录 + +``` +$ mkdir myproject +$ cd myproject +``` + +用 virtualenv 工具创建并且激活一个虚拟环境(你也可以使用virtualenv-wrapper) + +``` +$ virtualenv service_env +$ source service_env/bin/activate +``` + +安装 nameko 框架和 yagmail + +``` +(service_env)$ pip install nameko +(service_env)$ pip install yagmail +``` + + +#### 服务的代码 + +现在我们已经准备好了 virtualenv 所提供的虚拟环境(可以想象成我们的服务是运行在一个独立服务器上的,而我们的 API 运行在另一个服务器上),接下来让我们编码,实现 nameko 的 RPC 服务。 + +我们会将这两个服务放在同一个 python 模块中,当然如果你乐意,也可以把它们放在单独的模块里并且当成不同的服务运行: + +在名为 `service.py` 的文件中 + +```python +import yagmail +from nameko.rpc import rpc, RpcProxy + + +class Mail(object): + name = "mail" + + @rpc + def send(self, to, subject, contents): + yag = yagmail.SMTP('myname@gmail.com', 'mypassword') + # 以上的验证信息请从安全的地方进行读取 + # 贴士: 可以去看看 Dynaconf 设置模块 + yag.send(to=to.encode('utf-8), + subject=subject.encode('utf-8), + contents=[contents.encode('utf-8)]) + + +class Compute(object): + name = "compute" + mail = RpcProxy('mail') + + @rpc + def compute(self, operation, value, other, email): + operations = {'sum': lambda x, y: int(x) + int(y), + 'mul': lambda x, y: int(x) * int(y), + 'div': lambda x, y: int(x) / int(y), + 'sub': lambda x, y: int(x) - int(y)} + try: + result = operations[operation](value, other) + except Exception as e: + self.mail.send.async(email, "An error occurred", str(e)) + raise + else: + self.mail.send.async( + email, + "Your operation is complete!", + "The result is: %s" % result + ) + return result +``` + +现在我们已经用以上代码定义好了两个服务,下面让我们将 Nameko RPC service 运行起来。 + +>注意:我们会在控制台中启动并运行它。但在生产环境中,建议大家使用 supervisord 替代控制台命令。 + +在 Shell 中启动并运行服务 + +``` +(service_env)$ nameko run service --broker amqp://guest:guest@localhost +starting services: mail, compute +Connected to amqp://guest:**@127.0.0.1:5672// +Connected to amqp://guest:**@127.0.0.1:5672// +``` + + +#### 测试 + +在另外一个 Shell 中(使用相同的虚拟环境),用 nameko shell 进行测试: + +``` +(service_env)$ nameko shell --broker amqp://guest:guest@localhost +Nameko Python 2.7.9 (default, Apr 2 2015, 15:33:21) +[GCC 4.9.2] shell on linux2 +Broker: amqp://guest:guest@localhost +>>> +``` + +现在你已经处在 RPC 客户端中了,Shell 的测试工作是通过 n.rpc 对象来进行的,它的使用方法如下: + +``` +>>> n.rpc.mail.send("name@email.com", "testing", "Just testing") +``` + +上边的代码会发送一封邮件,我们同样可以调用计算服务对其进行测试。需要注意的是,此测试还会附带进行异步的邮件发送。 + +``` +>>> n.rpc.compute.compute('sum', 30, 10, "name@email.com") +40 +>>> n.rpc.compute.compute('sub', 30, 10, "name@email.com") +20 +>>> n.rpc.compute.compute('mul', 30, 10, "name@email.com") +300 +>>> n.rpc.compute.compute('div', 30, 10, "name@email.com") +3 +``` + + +### 在 API 中调用微服务 + +在另外一个 Shell 中(甚至可以是另外一台服务器上),准备好 API 环境。 + +用 virtualenv 工具创建并且激活一个虚拟环境(你也可以使用virtualenv-wrapper) + +``` +$ virtualenv api_env +$ source api_env/bin/activate +``` + +安装 Nameko, Flask 和 Flasgger + +``` +(api_env)$ pip install nameko +(api_env)$ pip install flask +(api_env)$ pip install flasgger +``` + +>注意: 在 API 中并不需要 yagmail ,因为在这里,处理邮件是服务的职责 + +创建含有以下内容的 `api.py` 文件: + +```python +from flask import Flask, request +from flasgger import Swagger +from nameko.standalone.rpc import ClusterRpcProxy + +app = Flask(__name__) +Swagger(app) +CONFIG = {'AMQP_URI': "amqp://guest:guest@localhost"} + + +@app.route('/compute', methods=['POST']) +def compute(): + """ + Micro Service Based Compute and Mail API + This API is made with Flask, Flasgger and Nameko + --- + parameters: + - name: body + in: body + required: true + schema: + id: data + properties: + operation: + type: string + enum: + - sum + - mul + - sub + - div + email: + type: string + value: + type: integer + other: + type: integer + responses: + 200: + description: Please wait the calculation, you'll receive an email with results + """ + operation = request.json.get('operation') + value = request.json.get('value') + other = request.json.get('other') + email = request.json.get('email') + msg = "Please wait the calculation, you'll receive an email with results" + subject = "API Notification" + with ClusterRpcProxy(CONFIG) as rpc: + # asynchronously spawning and email notification + rpc.mail.send.async(email, subject, msg) + # asynchronously spawning the compute task + result = rpc.compute.compute.async(operation, value, other, email) + return msg, 200 + +app.run(debug=True) +``` + +在其他的 shell 或者服务器上运行此文件 + +``` +(api_env) $ python api.py + * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit) +``` + +然后访问 这个 url,就可以看到 Flasgger 的界面了,利用它可以进行 API 的交互并可以发布任务到队列以供服务进行消费。 + +![](http://brunorocha.org/static/media/microservices/Flasgger_API_documentation.png) + +>注意: 你可以在 shell 中查看到服务的运行日志,打印信息和错误信息。也可以访问 RabbitMQ 控制面板来查看消息在队列中的处理情况。 + +Nameko 框架还为我们提供了很多高级特性,你可以从 获取更多的信息。 + +别光看了,撸起袖子来,实现微服务! + + +-------------------------------------------------------------------------------- + +via: http://brunorocha.org/python/microservices-with-python-rabbitmq-and-nameko.html + +作者: [Bruno Rocha][a] +译者: [译者ID](http://www.mr-ping.com) +校对: [校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://facebook.com/rochacbruno +[1]:http://martinfowler.com/articles/microservices.html +[2]:http://rabbitmq.mr-ping.com/description.html From 0895b6abc926c4ff963db4099fbdaca030694c1d Mon Sep 17 00:00:00 2001 From: Ping Date: Fri, 8 Jul 2016 09:27:23 +0800 Subject: [PATCH 1097/1469] Add translator info --- .../20160304 Microservices with Python RabbitMQ and Nameko.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20160304 Microservices with Python RabbitMQ and Nameko.md b/translated/tech/20160304 Microservices with Python RabbitMQ and Nameko.md index ea449e9f6c..8b88bfceec 100644 --- a/translated/tech/20160304 Microservices with Python RabbitMQ and Nameko.md +++ b/translated/tech/20160304 Microservices with Python RabbitMQ and Nameko.md @@ -281,7 +281,7 @@ Nameko 框架还为我们提供了很多高级特性,你可以从 Date: Fri, 8 Jul 2016 10:07:08 +0800 Subject: [PATCH 1098/1469] [translating] 20160624 Industrial SBC builds on Raspberry Pi Compute Module.md --- ...60624 Industrial SBC builds on Raspberry Pi Compute Module.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160624 Industrial SBC builds on Raspberry Pi Compute Module.md b/sources/tech/20160624 Industrial SBC builds on Raspberry Pi Compute Module.md index 17874b2cf3..9bc9a894ca 100644 --- a/sources/tech/20160624 Industrial SBC builds on Raspberry Pi Compute Module.md +++ b/sources/tech/20160624 Industrial SBC builds on Raspberry Pi Compute Module.md @@ -1,3 +1,4 @@ +zpl1025 Industrial SBC builds on Raspberry Pi Compute Module ===================================================== From a8b453e13a62571e9e90b8af58f02f8995578a4e Mon Sep 17 00:00:00 2001 From: Xin Wang <2650454635@qq.com> Date: Fri, 8 Jul 2016 12:42:08 +0800 Subject: [PATCH 1099/1469] Create USE TASK MANAGER EQUIVALENT IN LINUX.md (#4160) * Update 20160629 USE TASK MANAGER EQUIVALENT IN LINUX.md * Create 20160629 USE TASK MANAGER EQUIVALENT IN LINUX.md * Delete 20160629 USE TASK MANAGER EQUIVALENT IN LINUX.md --- ...29 USE TASK MANAGER EQUIVALENT IN LINUX.md | 53 ------------------- ...29 USE TASK MANAGER EQUIVALENT IN LINUX.md | 52 ++++++++++++++++++ 2 files changed, 52 insertions(+), 53 deletions(-) delete mode 100644 sources/tech/20160629 USE TASK MANAGER EQUIVALENT IN LINUX.md create mode 100644 translated/tech/20160629 USE TASK MANAGER EQUIVALENT IN LINUX.md diff --git a/sources/tech/20160629 USE TASK MANAGER EQUIVALENT IN LINUX.md b/sources/tech/20160629 USE TASK MANAGER EQUIVALENT IN LINUX.md deleted file mode 100644 index aa1e999f50..0000000000 --- a/sources/tech/20160629 USE TASK MANAGER EQUIVALENT IN LINUX.md +++ /dev/null @@ -1,53 +0,0 @@ -xinglianfly translate -USE TASK MANAGER EQUIVALENT IN LINUX -==================================== - -![](https://itsfoss.com/wp-content/uploads/2016/06/Task-Manager-in-Linux.jpg) - -These are some of the most frequently asked questions by Linux beginners, “**is there a task manager for Linux**“, “how do you open task manager in Linux” ? - -People who are coming from Windows know how useful is the task manager. You press the Ctrl+Alt+Del to get to task manager in Windows. This task manager shows you all the running processes and their memory consumption. You can choose to end a process from this task manager application. - -When you have just begun with Linux, you look for a **task manager equivalent in Linux** as well. An expert Linux user prefers the command line way to find processes and memory consumption etc but you don’t have to go that way, at least not when you are just starting with Linux. - -All major Linux distributions have a task manager equivalent. Mostly, **it is called System Monitor** but it actually depends on your Linux distribution and the [desktop environment][1] it uses. - -In this article, we’ll see how to find and use the task manager in Linux with GNOME as the [desktop environment][2]. - -### TASK MANAGER EQUIVALENT IN LINUX WITH GNOME DESKTOP - -While using GNOME, press super key (Windows Key) and look for System Monitor: - -![](https://itsfoss.com/wp-content/uploads/2016/06/system-monitor-gnome-fedora.png) - -When you start the System Monitor, it shows you all the running processes and the memory consumption by them. - -![](https://itsfoss.com/wp-content/uploads/2016/06/fedora-system-monitor.jpeg) - -You can select a process and click on End process to kill it. - -![](https://itsfoss.com/wp-content/uploads/2016/06/kill-process-fedora.png) - -You can also see some statistics about your system in the Resources tab such as CPU consumption per core basis, memory usage, network usage etc. - -![](https://itsfoss.com/wp-content/uploads/2016/06/system-stats-fedora.png) - -This was the graphical way. If you want to go command line way, just run the command ‘top’ in terminal and you can see all the running processes and their memory consumption. You can easily [kill processes in Linux][3] command line. - -This all you need to know about task manager equivalent in Fedora Linux. I hope you find this quick tutorial helpful. If you have questions or suggestions, feel free to ask. - - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/task-manager-linux/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 - -作者:[Abhishek Prakash][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[1]: https://wiki.archlinux.org/index.php/desktop_environment -[2]: https://itsfoss.com/best-linux-desktop-environments/ -[3]: https://itsfoss.com/how-to-find-the-process-id-of-a-program-and-kill-it-quick-tip/ diff --git a/translated/tech/20160629 USE TASK MANAGER EQUIVALENT IN LINUX.md b/translated/tech/20160629 USE TASK MANAGER EQUIVALENT IN LINUX.md new file mode 100644 index 0000000000..81a2147ff5 --- /dev/null +++ b/translated/tech/20160629 USE TASK MANAGER EQUIVALENT IN LINUX.md @@ -0,0 +1,52 @@ +在linux下使用任务管理器 +==================================== + +![](https://itsfoss.com/wp-content/uploads/2016/06/Task-Manager-in-Linux.jpg) + +有很多Linux初学者经常问起的问题,“**Linux有任务管理器吗**”,“**在Linux上面你是怎样打开任务管理器的呢**”? + +来自Windows的用户都知道任务管理器非常有用。你按下Ctrl+Alt+Del来打开任务管理器。这个任务管理器向你展示了所有的正在运行的进程和它们消耗的内存。你可以从任务管理器程序中选择并杀死一个进程。 + +当你刚使用Linux的时候,你也会寻找一个**在Linux相当于任务管理器**的一个东西。一个Linux使用专家更喜欢使用命令行的方式查找进程和消耗的内存,但是你不必去使用这种方式,至少在你初学Linux的时候。 + +所有主流的Linux发行版都有一个类似于任务管理器的东西。大部分情况下,**它叫System Monitor**。但是它实际上依赖于你的Linux的发行版和它使用的[桌面环境][1]。 + +在这篇文章中,我们将会看到如何在使用GNOME的[桌面环境][2]的Linux上查找并使用任务管理器。 + +###在使用GNOME的桌面环境的linux上使用任务管理器 + +当你使用GNOME的时候,按下super键(Windows 键)来查找任务管理器: + +![](https://itsfoss.com/wp-content/uploads/2016/06/system-monitor-gnome-fedora.png) + +当你启动System Monitor的时候,它会向你展示所有正在运行的进程和被它们消耗的内存。 + +![](https://itsfoss.com/wp-content/uploads/2016/06/fedora-system-monitor.jpeg) + +你可以选择一个进程并且点击“End Process”来杀掉它。 + +![](https://itsfoss.com/wp-content/uploads/2016/06/kill-process-fedora.png) + +你也可以在Resources标签里面看到关于一些系统的数据,例如每个cpu核心的消耗,内存的使用,网络的使用等。 + +![](https://itsfoss.com/wp-content/uploads/2016/06/system-stats-fedora.png) + +这是图形化的一种方式。如果你想使用命令行,在终端里运行“top”命令然后你就可以看到所有运行的进程和他们消耗的内存。你也可以参考[使用命令行杀死进程][3]这篇文章。 + +这就是所有你需要知道的关于在Fedora Linux上任务管理器的知识。我希望这个教程帮你学到了知识,如果你有什么问题,请尽管问。 + + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/task-manager-linux/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 + +作者:[Abhishek Prakash][a] +译者:[xinglianfly](https://github.com/xinglianfly) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject)原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[1]: https://wiki.archlinux.org/index.php/desktop_environment +[2]: https://itsfoss.com/best-linux-desktop-environments/ +[3]: https://itsfoss.com/how-to-find-the-process-id-of-a-program-and-kill-it-quick-tip/ From 3c3bf07eb6d07cedaa6fc1f6f54a0435583434fe Mon Sep 17 00:00:00 2001 From: ivo wang Date: Fri, 8 Jul 2016 13:12:27 +0800 Subject: [PATCH 1100/1469] Update 20160104 What is good stock portfolio management software on Linux.md Translating by ivo-wang --- ... What is good stock portfolio management software on Linux.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160104 What is good stock portfolio management software on Linux.md b/sources/tech/20160104 What is good stock portfolio management software on Linux.md index 258cf104fc..b24139b9c5 100644 --- a/sources/tech/20160104 What is good stock portfolio management software on Linux.md +++ b/sources/tech/20160104 What is good stock portfolio management software on Linux.md @@ -1,3 +1,4 @@ +Translating by ivo-wang What is good stock portfolio management software on Linux ================================================================================ If you are investing in the stock market, you probably understand the importance of a sound portfolio management plan. The goal of portfolio management is to come up with the best investment plan tailored for you, considering your risk tolerance, time horizon and financial goals. Given its importance, no wonder there are no shortage of commercial portfolio management apps and stock market monitoring software, each touting various sophisticated portfolio performance tracking and reporting capabilities. From 5d68602ae859cf2dd01ccfe83bc1c9c2b122bcda Mon Sep 17 00:00:00 2001 From: chenxinlong <237448382@qq.com> Date: Fri, 8 Jul 2016 23:04:34 +0800 Subject: [PATCH 1101/1469] [translated] IT runs on the cloud and the cloud runs on Linux.Any questions --- ... the cloud runs on Linux. Any questions.md | 63 ------------------- ... the cloud runs on Linux. Any questions.md | 62 ++++++++++++++++++ 2 files changed, 62 insertions(+), 63 deletions(-) delete mode 100644 sources/talk/20160624 IT runs on the cloud and the cloud runs on Linux. Any questions.md create mode 100644 translated/talk/20160624 IT runs on the cloud and the cloud runs on Linux. Any questions.md diff --git a/sources/talk/20160624 IT runs on the cloud and the cloud runs on Linux. Any questions.md b/sources/talk/20160624 IT runs on the cloud and the cloud runs on Linux. Any questions.md deleted file mode 100644 index 94f0a8af2f..0000000000 --- a/sources/talk/20160624 IT runs on the cloud and the cloud runs on Linux. Any questions.md +++ /dev/null @@ -1,63 +0,0 @@ -chenxinlong translating -IT runs on the cloud, and the cloud runs on Linux. Any questions? -=================================================================== - ->IT is moving to the cloud. And, what powers the cloud? Linux. When even Microsoft's Azure has embraced Linux, you know things have changed. - -![](http://zdnet1.cbsistatic.com/hub/i/r/2016/06/24/7d2b00eb-783d-4202-bda2-ca65d45c460a/resize/770xauto/732db8df725ede1cc38972788de71a0b/linux-owns-cloud.jpg) ->Image: ZDNet - -Like it or lump it, the cloud is taking over IT. We've seen [the rise of the cloud over in-house IT][1] for years now. And, what powers the cloud? Linux. - -A recent survey by the [Uptime Institute][2] of 1,000 IT executives found that 50 percent of senior enterprise IT executives expect the [majority of IT workloads to reside off-premise in cloud][3] or colocation sites in the future. Of those surveyed, 23 percent expect the shift to happen next year, and 70 percent expect that shift to occur within the next four years. - -This comes as no surprise. Much as many of us still love our physical servers and racks, it often doesn't make financial sense to run your own data center. - -It's really very simple. Just compare your [capital expense (CAPEX) of running your own hardware versus the operational expenses (OPEX)][4] of using a cloud. Now, that's not to say you want to outsource everything and the kitchen sink, but most of the time and for many of your jobs you'll want to move to the cloud. - -In turn, if you're going to make the best use of the cloud, you need to know Linux. - -[Amazon Web Services][5], [Apache CloudStack][6], [Rackspace][7], [Google Cloud Platform][8], and [OpenStack][9] all run Linux at their hearts. The result? By 2014, [Linux server application deployments had risen to 79 percent][10] of all businesses, while Windows server app deployments had fallen to 36 percent. Linux has only gained more momentum since then. - -Even Microsoft understands this. - -In the past year alone, Azure Chief Technology Officer Mark Russinovich said, Microsoft has gone from [one in four of its Azure virtual machines running Linux][11] to [nearly one in three][12]. - -Think about that. Microsoft, which is switching to the [cloud for its main source of revenue][13], is relying on Linux for a third of its cloud business. - -Even now, both those who love Microsoft and those who hate it have trouble getting their minds around the fundamental shift of [Microsoft from a proprietary software company to an open-source][14], cloud-based service business. - -Linux's penetration into the proprietary server room is even deeper than it first appears. For example, [Docker recently announced a public beta of its Windows 10 and Mac OS X releases][15]. So, does that mean [Docker][16] is porting its eponymous container service to Windows 10 and the Mac? Nope. - -On both platforms, Docker runs within a Linux virtual machine. HyperKit on Mac OS and Hyper-V on Windows. Your interface may look like just another Mac or Windows application, but at heart your containers will still be running on Linux. - -So, just as the vast majority of Android phone and Chromebook users have no clue they're running Linux, so too will IT users continue to quietly move to Linux and the cloud. - --------------------------------------------------------------------------------- - -via: http://www.zdnet.com/article/it-runs-on-the-cloud-and-the-cloud-runs-on-linux-any-questions/#ftag=RSSbaffb68 - -作者:[Steven J. Vaughan-Nichols][a] -译者:[chenxinlong](https://github.com/chenxinlong) -校对:[校对者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://www.zdnet.com/article/2014-the-year-the-cloud-killed-the-datacenter/ -[2]: https://uptimeinstitute.com/ -[3]: http://www.zdnet.com/article/move-to-cloud-accelerating-faster-than-thought-survey-finds/ -[4]: http://www.zdnet.com/article/rethinking-capex-and-opex-in-a-cloud-centric-world/ -[5]: https://aws.amazon.com/ -[6]: https://cloudstack.apache.org/ -[7]: https://www.rackspace.com/en-us -[8]: https://cloud.google.com/ -[9]: http://www.openstack.org/ -[10]: http://www.zdnet.com/article/linux-foundation-finds-enterprise-linux-growing-at-windows-expense/ -[11]: http://news.microsoft.com/bythenumbers/azure-virtual -[12]: http://www.zdnet.com/article/microsoft-nearly-one-in-three-azure-virtual-machines-now-are-running-linux/ -[13]: http://www.zdnet.com/article/microsofts-q3-azure-commercial-cloud-strong-but-earnings-revenue-light/ -[14]: http://www.zdnet.com/article/why-microsoft-is-turning-into-an-open-source-company/ -[15]: http://www.zdnet.com/article/new-docker-betas-for-azure-windows-10-now-available/ -[16]: http://www.docker.com/ - diff --git a/translated/talk/20160624 IT runs on the cloud and the cloud runs on Linux. Any questions.md b/translated/talk/20160624 IT runs on the cloud and the cloud runs on Linux. Any questions.md new file mode 100644 index 0000000000..804eb7db67 --- /dev/null +++ b/translated/talk/20160624 IT runs on the cloud and the cloud runs on Linux. Any questions.md @@ -0,0 +1,62 @@ +信息技术运行在云端,而云运行在 Linux 上。有什么问题吗? +=================================================================== + +>信息技术正在逐渐被迁移到云端. 那又是什么驱动了云呢?答案是 Linux。 当连微软的 Azure 都开始拥抱 Linux 时,你就应该知道这一切都已经改变了。 + +![](http://zdnet1.cbsistatic.com/hub/i/r/2016/06/24/7d2b00eb-783d-4202-bda2-ca65d45c460a/resize/770xauto/732db8df725ede1cc38972788de71a0b/linux-owns-cloud.jpg) +>图片: ZDNet + +不管你接不接受, 云正在接管信息技术都已成现实。 我们这几年见证了 [ 云在信息技术产业内部的崛起 ][1] 。 那又是什么驱动了云呢? 答案是 Linux 。 + +[Uptime Institute][2] 最近对 1000 个 IT 执行部门进行调查并发现了约 50% 左右的高级企业的 IT 执行部门认为在将来 [ 大部分的 IT 工作内容应存储备份在云上 ][3] 或托管网站上。在这个调查中,23% 的人认为这种改变即将发生在明年,有 70% 的人则认为这种情况会在四年内出现。 + +这一点都不奇怪。 我们中的许多人仍热衷于我们的物理服务器和机架, 但一般运营一个自己的数据中心并不会产生任何的经济效益。 + +这真的非常简单。 只需要对比你 [ 运行在硬件上的个人资本费用 (CAPEX) 和使用云的操作费用 (OPEX)][4]。 但这并不是说你会想把所有的一切都外置,而是说在大部分时间内你会想把你的一些工作内容迁移到云端。 + +相应地,如果你想充分地利用云,你就得了解 Linux 。 + +[ 亚马逊 web 服务 ][5], [ Apache 的 CloudStack][6], [Rackspace][7], [ 谷歌云平台 ][8] 以及 [ OpenStack ][9] 的核心都是运行在 Linux 上的。那么结果如何?截至到 2014 年, [ 在 Linux 服务器上部署的应用达到所有企业的 79% ][10],而 Windows 服务器上部署的应用则跌到 36%。从那时起, Linux 就获得了更多的发展动力。 + +即便是微软自身也明白这一点。 + +Azure 的技术主管 Mark Russinovich 曾说,仅仅在过去的几年内微软就从 [ 四分之一的 Azure 虚拟机运行在 Linux 上 ][11] 变为 [ 将近三分之一的 Azure 虚拟机运行在 Linux 上][12]. + +试想一下。 微软, 一家正逐渐将 [ 云变为自身财政收入的主要来源 ][13] 的公司,其三分之一的云产业依靠于 Linux 。 + +即使是到目前为止, 这些不论喜欢或者不喜欢微软的人都很难想象得到 [ 微软会从一家以专利保护为基础的软件公司转变为一家开源,基于云服务的企业][14] 。 + +Linux 对于这些专用服务器机房的渗透甚至比它刚开始的时候更深了。 举个例子, [ Docker 最近发行了其在 Windows 10 和 Mac OS X 上的公测版本 ][15] 。 所以难道这意味着 [Docker][16] 将会把其同名的容器服务移植到 Windows 10 和 Mac 上吗? 并不是的。 + +在这两个平台上, Docker 只是运行在一个 Linux 虚拟机内部。 在 Mac OS 上是 HyperKit ,在 Windows 上则是 Hyper-V 。 你的图形界面可能看起来就像另一个 Mac 或 Windows 上的应用, 但在其内部核心的容器仍然是运行在 Linux 上的。 + +所以,就像大量的安卓手机和 Chromebook 的用户压根就不知道他们所运行的是 Linux 系统一样。这些信息技术的用户也会随之悄然地迁移到 Linux 和云上。 + +-------------------------------------------------------------------------------- + +via: http://www.zdnet.com/article/it-runs-on-the-cloud-and-the-cloud-runs-on-linux-any-questions/#ftag=RSSbaffb68 + +作者:[Steven J. Vaughan-Nichols][a] +译者:[chenxinlong](https://github.com/chenxinlong) +校对:[校对者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://www.zdnet.com/article/2014-the-year-the-cloud-killed-the-datacenter/ +[2]: https://uptimeinstitute.com/ +[3]: http://www.zdnet.com/article/move-to-cloud-accelerating-faster-than-thought-survey-finds/ +[4]: http://www.zdnet.com/article/rethinking-capex-and-opex-in-a-cloud-centric-world/ +[5]: https://aws.amazon.com/ +[6]: https://cloudstack.apache.org/ +[7]: https://www.rackspace.com/en-us +[8]: https://cloud.google.com/ +[9]: http://www.openstack.org/ +[10]: http://www.zdnet.com/article/linux-foundation-finds-enterprise-linux-growing-at-windows-expense/ +[11]: http://news.microsoft.com/bythenumbers/azure-virtual +[12]: http://www.zdnet.com/article/microsoft-nearly-one-in-three-azure-virtual-machines-now-are-running-linux/ +[13]: http://www.zdnet.com/article/microsofts-q3-azure-commercial-cloud-strong-but-earnings-revenue-light/ +[14]: http://www.zdnet.com/article/why-microsoft-is-turning-into-an-open-source-company/ +[15]: http://www.zdnet.com/article/new-docker-betas-for-azure-windows-10-now-available/ +[16]: http://www.docker.com/ + From f0653ae0566331e4b1d7ad58a3a6beafabe64f0f Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 9 Jul 2016 11:23:43 +0800 Subject: [PATCH 1102/1469] PUB:20151215 Securi-Pi--Using the Raspberry Pi as a Secure Landing Point MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Moelf 翻译的不错! --- ... Raspberry Pi as a Secure Landing Point.md | 227 +++++++----------- 1 file changed, 85 insertions(+), 142 deletions(-) rename {translated/tech => published}/20151215 Securi-Pi--Using the Raspberry Pi as a Secure Landing Point.md (50%) diff --git a/translated/tech/20151215 Securi-Pi--Using the Raspberry Pi as a Secure Landing Point.md b/published/20151215 Securi-Pi--Using the Raspberry Pi as a Secure Landing Point.md similarity index 50% rename from translated/tech/20151215 Securi-Pi--Using the Raspberry Pi as a Secure Landing Point.md rename to published/20151215 Securi-Pi--Using the Raspberry Pi as a Secure Landing Point.md index fc489163ef..7038dfd87a 100644 --- a/translated/tech/20151215 Securi-Pi--Using the Raspberry Pi as a Secure Landing Point.md +++ b/published/20151215 Securi-Pi--Using the Raspberry Pi as a Secure Landing Point.md @@ -1,25 +1,27 @@ -Securi-Pi: 使用树莓派作为安全跳板 +Securi-Pi:使用树莓派作为安全跳板 ================================================================================ -像很多 LinuxJournal 的读者一样,我也过上了当今非常普遍的“科技游牧”生活,在网络到网络间,从一个接入点到另一个接入点,我们身处现实世界的不同地方却始终保持统一的互联网接入端。近来我发现越来越多的网络环境开始屏蔽对外的常用端口比如 SMTP(端口25),SSH(端口22)之类的。当你走进一家咖啡馆然后想 SSH 到你的一台服务器上做点事情的时候发现端口22被屏蔽了是一件很烦的事情。 +像很多 LinuxJournal 的读者一样,我也过上了当今非常普遍的“科技游牧”生活,在网络之间,从一个接入点到另一个接入点,我们身处现实世界的不同地方却始终保持连接到互联网和日常使用的其它网络上。近来我发现越来越多的网络环境开始屏蔽对外的常用端口比如 SMTP(端口25),SSH(端口22)之类的。当你走进一家咖啡馆然后想 SSH 到你的一台服务器上做点事情的时候发现端口 22 被屏蔽了是一件很烦的事情。 -不过,我到目前为止还没发现有什么网络环境会把 HTTPS 给墙了(端口443)。在稍微配置了一下家中的树莓派 2之后,我成功地让自己能通过接入树莓派的443接口充当跳板从而让我在各种网络环境下连上想要的目标端口。简而言之,我把家中的树莓派设置成了一个 OpenVPN 的端点,SSH 端点同时也是一个 Apache 服务器——用于监听443端口上的我的接入活动并执行我预先设置好的网络策略。 +不过,我到目前为止还没发现有什么网络环境会把 HTTPS 给墙了(端口443)。在稍微配置了一下家中的树莓派 2 之后,我成功地让自己通过接入树莓派的 443 端口充当跳板,从而让我在各种网络环境下都能连上想要的目标端口。简而言之,我把家中的树莓派设置成了一个 OpenVPN 的端点和 SSH 端点,同时也是一个 Apache 服务器,所有这些服务都监听在 443 端口上,以便可以限制我不想暴露的网络服务。 -### 笔记 -此解决方案能搞定大多数有限制的网络环境,但有些防火墙会对外部流量调用深度包检查(Deep packet inspection),它们时常能屏蔽掉用本篇文章里的方式传输的信息。不过我到目前为止还没在这样的防火墙后测试过。同时,尽管我使用了很多基于密码学的工具(OpenVPN,HTTPS,SSH),我并没有非常严格地审计过这套配置方案(译者注:作者的意思是指这套方案能帮你绕过端口限制,但不代表你就是完全安全地连接上了树莓派)。有时候甚至 DNS 服务都会泄露你的信息,很可能在我没有考虑周到的角落里会有遗漏。我强烈不推荐把此跳板配置方案当作是万无一失的隐藏网络流量的办法,此配置只是希望能绕过一些端口限制连上网络,而不是做一些危险的事情。 +### 备注 + +此解决方案能搞定大多数有限制的网络环境,但有些防火墙会对外部流量调用深度包检查(Deep packet inspection),它们时常能屏蔽掉用本篇文章里的方式传输的信息。不过我到目前为止还没在这样的防火墙后测试过。同时,尽管我使用了很多基于密码学的工具(OpenVPN,HTTPS,SSH),我并没有非常严格地审计过这套配置方案(LCTT 译注:作者的意思是指这套方案能帮你绕过端口限制,但不代表你的活动就是完全安全的)。有时候甚至 DNS 服务都会泄露你的信息,很可能在我没有考虑周到的角落里会有遗漏。我强烈不推荐把此跳板配置方案当作是万无一失的隐藏网络流量的办法,此配置只是希望能绕过一些端口限制连上网络,而不是做一些危险的事情。 ### 起步 -让我们先从你需要什么说起,我用的是树莓派 2,装载了最新版本的 Raspbian,不过这个配置也应该能在树莓派 Model B 上运行;512MB 的内存对我们来说绰绰有余了,虽然性能可能没有树莓派 2这么好,毕竟Model B只有一颗单核心 CPU 相比于四核心的树莓派 2。我的树莓派在家里的防火墙和路由器之后,所以我还能用这个树莓派作为跳板访问家里的其他电子设备。同时这也意味着我的流量在互联网上看起来仿佛来自我家的ip地址,所以这也算某种意义上保护了我的匿名性。如果你没有树莓派,或者不想从家里运行这个服务,那你完全可以把这个配置放在一台小型云服务器上(译者:比如 IPS )。你只要确保服务器运行着基于 Debian 的 Linux 发行版即可,这份指南依然可用。 +让我们先从你需要什么说起,我用的是树莓派 2,装载了最新版本的 Raspbian,不过这个配置也应该能在树莓派 Model B 上运行;512MB 的内存对我们来说绰绰有余了,虽然性能可能没有树莓派 2这么好,毕竟相比于四核心的树莓派 2, Model B 只有一颗单核心 CPU。我的树莓派放置在家里的防火墙和路由器的后面,所以我还能用这个树莓派作为跳板访问家里的其他电子设备。同时这也意味着我的流量在互联网上看起来仿佛来自我家的 ip 地址,所以这也算某种意义上保护了我的匿名性。如果你没有树莓派,或者不想从家里运行这个服务,那你完全可以把这个配置放在一台小型云服务器上(LCTT 译注:比如 IPS )。你只要确保服务器运行着基于 Debian 的 Linux 发行版即可,这份指南依然可用。 ![](http://www.linuxjournal.com/files/linuxjournal.com/ufiles/imagecache/large-550px-centered/u1002061/11913f1.jpg) -图 1 树莓派,即将成为我们的加密网络端点 +*图 1 树莓派,即将成为我们的加密网络端点* ### 安装并配置 BIND -无论你是用树莓派还是一台服务器,当你成功启动之后你就可以安装 BIND 了,驱动了互联网相当一部分的域名服务软件。你将会把 BIND 仅仅作为缓存域名服务使用,而不用把它配置为用来处理来自互联网的域名请求。安装 BIND 会让你拥有一个可以被 OpenVPN 使用的 DNS 服务器。安装 BIND 十分简单,`apt-get` 就可以直接搞定: + +无论你是用树莓派还是一台服务器,当你成功启动之后你就可以安装 BIND 了,这是一个驱动了互联网相当一部分的域名服务软件。你将会把 BIND 仅仅作为缓存域名服务使用,而不用把它配置为用来处理来自互联网的域名请求。安装 BIND 会让你拥有一个可以被 OpenVPN 使用的 DNS 服务器。安装 BIND 十分简单,`apt-get` 就可以直接搞定: ``` root@test:~# apt-get install bind9 @@ -32,15 +34,13 @@ Suggested packages: bind9-doc resolvconf ufw The following NEW packages will be installed: bind9 bind9utils -0 upgraded, 2 newly installed, 0 to remove and - ↪0 not upgraded. +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. Need to get 490 kB of archives. -After this operation, 1,128 kB of additional disk - ↪space will be used. +After this operation, 1,128 kB of additional disk space will be used. Do you want to continue [Y/n]? y ``` -在我们能把 BIND 当做缓存域名服务器之前,还有一些小细节需要配置。两个修改都在`/etc/bind/named.conf.options`里完成。首先你要反注释掉 forwarders 这一节内容,同时你还要增加一个可以转发域名请求的目标服务器。作为例子我会用 Google 的 DNS 服务器(8.8.8.8)(译者:国内的话需要找一个替代品);文件的 forwarders 节看上去大致是这样的: +在我们把 BIND 作为缓存域名服务器之前,还有一些小细节需要配置。两个修改都在`/etc/bind/named.conf.options`里完成。首先你要取消注释掉 forwarders 这一节内容,同时你还要增加一个可以转发域名请求的目标服务器。作为例子我会用 Google 的 DNS 服务器(8.8.8.8)(LCTT 译注:国内的话需要找一个替代品);文件的 forwarders 节看上去大致是这样的: ``` @@ -49,19 +49,18 @@ forwarders { }; ``` -第二点你需要做的更改是允许来自互联网和本地局域网的 query,直接把这一行加入配置文件的低端,最后一个`}`之前就可以了: +第二点你需要做的更改是允许来自内网和本机的查询请求,直接把这一行加入配置文件的后面,记得放在最后一个`};`之前就可以了: ``` allow-query { 192.168.1.0/24; 127.0.0.0/16; }; ``` -上面那行配置会允许此 DNS 服务器接收来自网络和局域网的请求。下一步,你需要重启一下 BIND 的服务: +上面那行配置会允许此 DNS 服务器接收来自其所在的网络(在本例中,我的网络就在我的防火墙之后)和本机的请求。下一步,你需要重启一下 BIND 的服务: ``` root@test:~# /etc/init.d/bind9 restart -[....] Stopping domain name service...: bind9waiting - ↪for pid 13209 to die +[....] Stopping domain name service...: bind9waiting for pid 13209 to die . ok [ ok ] Starting domain name service...: bind9. ``` @@ -91,12 +90,12 @@ Name: www.google.com Address: 173.194.33.180 ``` -完美!现在你的系统里已经有一个正常的域名服务在允许了,下一步我们来配置一下OpenVPN。 +完美!现在你的系统里已经有一个正常的域名服务在工作了,下一步我们来配置一下OpenVPN。 ### 安装并配置 OpenVPN -OpenVPN 是一个运用 SSL/TLS 作为密钥交换的开源 VPN 解决方案。同时它也非常便于在 Linux 环境下部署。配置 OpenVPN 可能有一点艰巨,不过在此其实你也不需要在默认的配置文件里做太多修改。首先你会需要运行一下 `apt-get` 来安装 OpenVPN: +OpenVPN 是一个运用 SSL/TLS 作为密钥交换的开源 VPN 解决方案。同时它也非常便于在 Linux 环境下部署。配置 OpenVPN 可能有一点点难,不过其实你也不需要在默认的配置文件里做太多修改。首先你需要运行一下 `apt-get` 来安装 OpenVPN: ``` @@ -110,22 +109,18 @@ Suggested packages: resolvconf The following NEW packages will be installed: liblzo2-2 libpkcs11-helper1 openvpn -0 upgraded, 3 newly installed, 0 to remove and - ↪0 not upgraded. +0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded. Need to get 621 kB of archives. -After this operation, 1,489 kB of additional disk - ↪space will be used. +After this operation, 1,489 kB of additional disk space will be used. Do you want to continue [Y/n]? y ``` -现在 OpenVPN 已经安装好了,你需要去配置它了。OpenVPN 是基于 SSL 的,并且它同时依赖于服务端和客户端两方的证书来工作。为了生成这些证书,你需要配置机器上的证书签发(CA)。幸运地,OpenVPN 在安装中自带了一些用于生成证书的脚本比如 “easy-rsa” 来帮助你加快这个过程。你将要创建一个文件目录用于放置 easy-rsa 脚本的模板: +现在 OpenVPN 已经安装好了,你需要去配置它了。OpenVPN 是基于 SSL 的,并且它同时依赖于服务端和客户端两方的证书来工作。为了生成这些证书,你需要在机器上配置一个证书签发(CA)。幸运地,OpenVPN 在安装中自带了一些用于生成证书的脚本比如 “easy-rsa” 来帮助你加快这个过程。你将要创建一个文件目录用于放置 easy-rsa 脚本,从模板目录复制过来: ``` root@test:~# mkdir /etc/openvpn/easy-rsa -root@test:~# cp -rpv - ↪/usr/share/doc/openvpn/examples/easy-rsa/2.0/* - ↪/etc/openvpn/easy-rsa/ +root@test:~# cp -rpv /usr/share/doc/openvpn/examples/easy-rsa/2.0/* /etc/openvpn/easy-rsa/ ``` 下一步,把 vars 文件复制一个备份: @@ -137,7 +132,6 @@ root@test:/etc/openvpn/easy-rsa# cp vars vars.bak 接下来,编辑一下 vars 以让其中的信息符合你的状态。我将以我需要编辑的信息作为例子: - ``` KEY_SIZE=4096 KEY_COUNTRY="US" @@ -147,19 +141,17 @@ KEY_ORG="Linux Journal" KEY_EMAIL="bill.childers@linuxjournal.com" ``` -下一步是 source 一下 vars ,这样系统就能把其中的信息当作环境变量处理了: +下一步是导入(source)一下 vars 中的环境变量,这样系统就能把其中的信息当作环境变量处理了: ``` root@test:/etc/openvpn/easy-rsa# source ./vars -NOTE: If you run ./clean-all, I will be doing a - ↪rm -rf on /etc/openvpn/easy-rsa/keys +NOTE: If you run ./clean-all, I will be doing a rm -rf on /etc/openvpn/easy-rsa/keys ``` -### 搭建CA(证书签发) +### 搭建 CA(证书签发) - -接下来你要允许一下 `clean-all` 来确保有一个清理干净的系统工作环境,紧接着你也就要做证书签发了。注意一下我修改了一些 changeme 的跳出的交互提示内容以符合我需要的安装情况: +接下来你要运行一下 `clean-all` 来确保有一个清理干净的系统工作环境,紧接着你就要做证书签发了。注意一下我修改了一些 changeme 的所提示修改的内容以符合我需要的安装情况: ``` @@ -182,10 +174,8 @@ Country Name (2 letter code) [US]: State or Province Name (full name) [CA]: Locality Name (eg, city) [Silicon Valley]: Organization Name (eg, company) [Linux Journal]: -Organizational Unit Name (eg, section) - ↪[changeme]:SecTeam -Common Name (eg, your name or your server's hostname) - ↪[changeme]:test.linuxjournal.com +Organizational Unit Name (eg, section) [changeme]:SecTeam +Common Name (eg, your name or your server's hostname) [changeme]:test.linuxjournal.com Name [changeme]:test.linuxjournal.com Email Address [bill.childers@linuxjournal.com]: ``` @@ -193,12 +183,11 @@ Email Address [bill.childers@linuxjournal.com]: ### 生成服务端证书 -一旦CA创建好了,你接着就可以生成客户端的 OpenVPN 证书了: +一旦 CA 创建好了,你接着就可以生成客户端的 OpenVPN 证书了: ``` -root@test:/etc/openvpn/easy-rsa# - ↪./build-key-server test.linuxjournal.com +root@test:/etc/openvpn/easy-rsa# ./build-key-server test.linuxjournal.com Generating a 4096 bit RSA private key ...................................................++ writing new private key to 'test.linuxjournal.com.key' @@ -215,10 +204,8 @@ Country Name (2 letter code) [US]: State or Province Name (full name) [CA]: Locality Name (eg, city) [Silicon Valley]: Organization Name (eg, company) [Linux Journal]: -Organizational Unit Name (eg, section) - ↪[changeme]:SecTeam -Common Name (eg, your name or your server's hostname) - ↪[test.linuxjournal.com]: +Organizational Unit Name (eg, section) [changeme]:SecTeam +Common Name (eg, your name or your server's hostname) [test.linuxjournal.com]: Name [changeme]:test.linuxjournal.com Email Address [bill.childers@linuxjournal.com]: @@ -226,8 +213,7 @@ Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: An optional company name []: -Using configuration from - ↪/etc/openvpn/easy-rsa/openssl-1.0.0.cnf +Using configuration from /etc/openvpn/easy-rsa/openssl-1.0.0.cnf Check that the request matches the signature Signature ok The Subject's Distinguished Name is as follows @@ -238,10 +224,8 @@ organizationName :PRINTABLE:'Linux Journal' organizationalUnitName:PRINTABLE:'SecTeam' commonName :PRINTABLE:'test.linuxjournal.com' name :PRINTABLE:'test.linuxjournal.com' -emailAddress - ↪:IA5STRING:'bill.childers@linuxjournal.com' -Certificate is to be certified until Sep 1 - ↪06:23:59 2025 GMT (3650 days) +emailAddress :IA5STRING:'bill.childers@linuxjournal.com' +Certificate is to be certified until Sep 1 06:23:59 2025 GMT (3650 days) Sign the certificate? [y/n]:y 1 out of 1 certificate requests certified, commit? [y/n]y @@ -249,13 +233,12 @@ Write out database with 1 new entries Data Base Updated ``` -下一步需要用掉一些时间来生成 OpenVPN 服务器需要的 Diffie-Hellman 密钥。这个步骤在一般的桌面级 CPU 上会需要几分钟的时间,但在 ARM 构架的树莓派上,会用掉超级超级长的时间。耐心点,只要终端上的点还在跳,那么一切就在按部就班运行: +下一步需要用掉一些时间来生成 OpenVPN 服务器需要的 Diffie-Hellman 密钥。这个步骤在一般的桌面级 CPU 上会需要几分钟的时间,但在 ARM 构架的树莓派上,会用掉超级超级长的时间。耐心点,只要终端上的点还在跳,那么一切就在按部就班运行(下面的示例省略了不少的点): ``` root@test:/etc/openvpn/easy-rsa# ./build-dh -Generating DH parameters, 4096 bit long safe prime, - ↪generator 2 +Generating DH parameters, 4096 bit long safe prime, generator 2 This is going to take a long time ....................................................+ @@ -263,11 +246,10 @@ This is going to take a long time ### 生成客户端证书 -现在你要生成一下客户端用于登陆 OpenVPN 的密钥。通常来说 OpenVPN 都会被配置成使用证书验证的加密方式,在这个配置下客户端需要持有由服务端签发的一份证书: +现在你要生成一下客户端用于登录 OpenVPN 的密钥。通常来说 OpenVPN 都会被配置成使用证书验证的加密方式,在这个配置下客户端需要持有由服务端签发的一份证书: ``` -root@test:/etc/openvpn/easy-rsa# ./build-key - ↪bills-computer +root@test:/etc/openvpn/easy-rsa# ./build-key bills-computer Generating a 4096 bit RSA private key ...................................................++ ...................................................++ @@ -285,10 +267,8 @@ Country Name (2 letter code) [US]: State or Province Name (full name) [CA]: Locality Name (eg, city) [Silicon Valley]: Organization Name (eg, company) [Linux Journal]: -Organizational Unit Name (eg, section) - ↪[changeme]:SecTeam -Common Name (eg, your name or your server's hostname) - ↪[bills-computer]: +Organizational Unit Name (eg, section) [changeme]:SecTeam +Common Name (eg, your name or your server's hostname) [bills-computer]: Name [changeme]:bills-computer Email Address [bill.childers@linuxjournal.com]: @@ -296,8 +276,7 @@ Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: An optional company name []: -Using configuration from - ↪/etc/openvpn/easy-rsa/openssl-1.0.0.cnf +Using configuration from /etc/openvpn/easy-rsa/openssl-1.0.0.cnf Check that the request matches the signature Signature ok The Subject's Distinguished Name is as follows @@ -308,30 +287,26 @@ organizationName :PRINTABLE:'Linux Journal' organizationalUnitName:PRINTABLE:'SecTeam' commonName :PRINTABLE:'bills-computer' name :PRINTABLE:'bills-computer' -emailAddress - ↪:IA5STRING:'bill.childers@linuxjournal.com' -Certificate is to be certified until - ↪Sep 1 07:35:07 2025 GMT (3650 days) +emailAddress :IA5STRING:'bill.childers@linuxjournal.com' +Certificate is to be certified until Sep 1 07:35:07 2025 GMT (3650 days) Sign the certificate? [y/n]:y -1 out of 1 certificate requests certified, - ↪commit? [y/n]y +1 out of 1 certificate requests certified, commit? [y/n]y Write out database with 1 new entries Data Base Updated root@test:/etc/openvpn/easy-rsa# ``` -现在你需要再生成一个 HMAC 代码作为共享密钥来进一步增加整个加密提供的安全性: +现在你需要再生成一个 HMAC 码作为共享密钥来进一步增加整个加密提供的安全性: ``` -root@test:~# openvpn --genkey --secret - ↪/etc/openvpn/easy-rsa/keys/ta.key +root@test:~# openvpn --genkey --secret /etc/openvpn/easy-rsa/keys/ta.key ``` ### 配置服务器 -最后,你来到了需要配置 OpenVPN 服务的时候了。你需要创建一个 `/etc/openvpn/server.conf` 文件;这个配置文件的大多数地方都可以套用模板解决。设置 OpenVPN 服务的主要修改在于让它只用 TCP 而不是 UDP 链接。这是下一步所必需的---如果不是 TCP 链接那么你的服务将不能通过 端口443 运作。创建 `/etc/openvpn/server.conf` 然后把下述配置丢进去: +最后,我们到了配置 OpenVPN 服务的时候了。你需要创建一个 `/etc/openvpn/server.conf` 文件;这个配置文件的大多数地方都可以套用模板解决。设置 OpenVPN 服务的主要修改在于让它只用 TCP 而不是 UDP 链接。这是下一步所必需的---如果不是 TCP 连接那么你的服务将不能工作在端口 443 上。创建 `/etc/openvpn/server.conf` 然后把下述配置丢进去: ``` @@ -339,23 +314,15 @@ port 1194 proto tcp dev tun ca easy-rsa/keys/ca.crt -cert easy-rsa/keys/test.linuxjournal.com.crt ## or whatever - ↪your hostname was -key easy-rsa/keys/test.linuxjournal.com.key ## Hostname key - ↪- This file should be kept secret +cert easy-rsa/keys/test.linuxjournal.com.crt ## or whatever your hostname was +key easy-rsa/keys/test.linuxjournal.com.key ## Hostname key - This file should be kept secret management localhost 7505 dh easy-rsa/keys/dh4096.pem tls-auth /etc/openvpn/certs/ta.key 0 -server 10.8.0.0 255.255.255.0 # The server will use this - ↪subnet for clients connecting to it +server 10.8.0.0 255.255.255.0 # The server will use this subnet for clients connecting to it ifconfig-pool-persist ipp.txt -push "redirect-gateway def1 bypass-dhcp" # Forces clients - ↪to redirect all traffic through the VPN -push "dhcp-option DNS 192.168.1.1" # Tells the client to - ↪use the DNS server at 192.168.1.1 for DNS - - ↪replace with the IP address of the OpenVPN - ↪machine and clients will use the BIND - ↪server setup earlier +push "redirect-gateway def1 bypass-dhcp" # Forces clients to redirect all traffic through the VPN +push "dhcp-option DNS 192.168.1.1" # Tells the client to use the DNS server at 192.168.1.1 for DNS - replace with the IP address of the OpenVPN machine and clients will use the BIND server setup earlier keepalive 30 240 comp-lzo # Enable compression persist-key @@ -364,14 +331,12 @@ status openvpn-status.log verb 3 ``` -最后,你将需要在服务器上启用 IP 转发,配置 OpenVPN 为开机启动并立刻启动 OpenVPN 服务: +最后,你将需要在服务器上启用 IP 转发,配置 OpenVPN 为开机启动,并立刻启动 OpenVPN 服务: ``` -root@test:/etc/openvpn/easy-rsa/keys# echo - ↪"net.ipv4.ip_forward = 1" >> /etc/sysctl.conf -root@test:/etc/openvpn/easy-rsa/keys# sysctl -p - ↪/etc/sysctl.conf +root@test:/etc/openvpn/easy-rsa/keys# echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf +root@test:/etc/openvpn/easy-rsa/keys# sysctl -p /etc/sysctl.conf net.core.wmem_max = 12582912 net.core.rmem_max = 12582912 net.ipv4.tcp_rmem = 10240 87380 12582912 @@ -387,61 +352,48 @@ net.ipv4.tcp_wmem = 10240 87380 12582912 net.ipv4.ip_forward = 0 net.ipv4.ip_forward = 1 -root@test:/etc/openvpn/easy-rsa/keys# update-rc.d - ↪openvpn defaults +root@test:/etc/openvpn/easy-rsa/keys# update-rc.d openvpn defaults update-rc.d: using dependency based boot sequencing -root@test:/etc/openvpn/easy-rsa/keys# - ↪/etc/init.d/openvpn start +root@test:/etc/openvpn/easy-rsa/keys# /etc/init.d/openvpn start [ ok ] Starting virtual private network daemon:. ``` ### 配置 OpenVPN 客户端 +客户端的安装取决于客户端的操作系统,但你需要将之前生成的证书和密钥复制到你的客户端上,并导入你的 OpenVPN 客户端并新建一个配置文件。每种操作系统下的 OpenVPN 客户端在操作上会有些稍许不同,这也不在这篇文章的覆盖范围内,所以你最好去看看特定操作系统下的 OpenVPN 文档来获取更多信息。请参考本文档里的资源那一节。 -客户端的安装取决于客户端的操作系统,但你总会需要之前生成的证书和密钥,并导入你的 OpenVPN 客户端并新建一个配置文件。每种操作系统下的 OpenVPN 客户端在操作上会有些稍许不同,这也不在这篇文章的覆盖范围内,所以你最好去看看特定操作系统下的 OpenVPN 文档来获取更多信息。参考文档里的 Resources 章节。 +### 安装 SSLH —— "魔法"多协议切换工具 -### 安装 SSLH —— "魔法"多协议工具 - -本文章介绍的解决方案最有趣的部分就是运用 SSLH 了。SSLH 是一个多重协议工具——它可以监听443端口的流量,然后分析他们是以SSH,HTTPS 还是 OpenVPN 的通讯包,并把他们分别转发给正确的系统服务。这就是为何本解决方案可以让你绕过大多数端口封杀——你可以一直使用HTTPS通讯,介于它几乎从来不会被封杀。 +本文章介绍的解决方案最有趣的部分就是运用 SSLH 了。SSLH 是一个多重协议工具——它可以监听 443 端口的流量,然后分析他们是 SSH,HTTPS 还是 OpenVPN 的通讯包,并把它们分别转发给正确的系统服务。这就是为何本解决方案可以让你绕过大多数端口封杀——你可以一直使用 HTTPS 通讯,因为它几乎从来不会被封杀。 同样,直接 `apt-get` 安装: ``` -root@test:/etc/openvpn/easy-rsa/keys# apt-get - ↪install sslh +root@test:/etc/openvpn/easy-rsa/keys# apt-get install sslh Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: - apache2 apache2-mpm-worker apache2-utils - ↪apache2.2-bin apache2.2-common - libapr1 libaprutil1 libaprutil1-dbd-sqlite3 - ↪libaprutil1-ldap libconfig9 + apache2 apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common + libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libconfig9 Suggested packages: - apache2-doc apache2-suexec apache2-suexec-custom - ↪openbsd-inetd inet-superserver + apache2-doc apache2-suexec apache2-suexec-custom openbsd-inetd inet-superserver The following NEW packages will be installed: - apache2 apache2-mpm-worker apache2-utils - ↪apache2.2-bin apache2.2-common - libapr1 libaprutil1 libaprutil1-dbd-sqlite3 - ↪libaprutil1-ldap libconfig9 sslh -0 upgraded, 11 newly installed, 0 to remove - ↪and 0 not upgraded. + apache2 apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common + libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libconfig9 sslh +0 upgraded, 11 newly installed, 0 to remove and 0 not upgraded. Need to get 1,568 kB of archives. -After this operation, 5,822 kB of additional - ↪disk space will be used. +After this operation, 5,822 kB of additional disk space will be used. Do you want to continue [Y/n]? y ``` -在 SSLH 被安装之后,包管理器会询问要在 inetd 还是 standalone 模式下允许。选择 standalone 模式,因为你希望 SSLH 在它自己的进程里运行。如果你没有安装 Apache,apt包管理器会自动帮你下载并安装的,尽管它也不是完全不可或缺。如果你已经有 Apache 了,那你需要确保它只监听 localhost 端口而不是所有的端口(不然的话 SSLH 会无法运行因为 443 端口已经被 Apache 监听占用)。安装后,你会看到一个如下所示的错误信息: +在 SSLH 被安装之后,包管理器会询问要在 inetd 还是 standalone 模式下允许。选择 standalone 模式,因为你希望 SSLH 在它自己的进程里运行。如果你没有安装 Apache,apt 包管理器会自动帮你下载并安装的,尽管它也不是完全不可或缺。如果你已经有 Apache 了,那你需要确保它只监听 localhost 端口而不是所有的端口(不然的话 SSLH 会无法运行,因为 443 端口已经被 Apache 监听占用)。安装后,你会看到一个如下所示的错误信息: ``` -[....] Starting ssl/ssh multiplexer: sslhsslh disabled, - ↪please adjust the configuration to your needs -[FAIL] and then set RUN to 'yes' in /etc/default/sslh - ↪to enable it. ... failed! +[....] Starting ssl/ssh multiplexer: sslhsslh disabled, please adjust the configuration to your needs +[FAIL] and then set RUN to 'yes' in /etc/default/sslh to enable it. ... failed! failed! ``` @@ -461,20 +413,16 @@ failed! RUN=yes -# binary to use: forked (sslh) or single-thread - ↪(sslh-select) version +# binary to use: forked (sslh) or single-thread (sslh-select) version DAEMON=/usr/sbin/sslh -DAEMON_OPTS="--user sslh --listen 0.0.0.0:443 --ssh - ↪127.0.0.1:22 --ssl 127.0.0.1:443 --openvpn - ↪127.0.0.1:1194 --pidfile /var/run/sslh/sslh.pid" +DAEMON_OPTS="--user sslh --listen 0.0.0.0:443 --ssh 127.0.0.1:22 --ssl 127.0.0.1:443 --openvpn 127.0.0.1:1194 --pidfile /var/run/sslh/sslh.pid" ``` 保存编辑并启动 SSLH: ``` - root@test:/etc/openvpn/easy-rsa/keys# - ↪/etc/init.d/sslh start + root@test:/etc/openvpn/easy-rsa/keys# /etc/init.d/sslh start [ ok ] Starting ssl/ssh multiplexer: sslh. ``` @@ -485,26 +433,21 @@ $ ssh -p 443 root@test.linuxjournal.com root@test:~# ``` -SSLH 现在开始监听端口443 并且可以转发流量信息到 SSH,Apache 或者 OpenVPN 取决于抵达流量包的类型。这套系统现已整装待发了! +SSLH 现在开始监听端口 443 并且可以转发流量信息到 SSH、Apache 或者 OpenVPN ,这取决于抵达流量包的类型。这套系统现已整装待发了! ### 结论 -现在你可以启动 OpenVPN 并且配置你的客户端连接到服务器的 443 端口了,然后 SSLH 会从那里把流量转发到服务器的 1194 端口。但介于你正在和服务器的 443 端口通信,你的 VPN 流量不会被封锁。现在你可以舒服地坐在陌生小镇的咖啡店里,畅通无阻地通过树莓派上的 OpenVPN 浏览互联网。你顺便还给你的链接增加了一些安全性,这个额外作用也会让你的链接更安全和私密一些。享受通过安全跳板浏览互联网把! +现在你可以启动 OpenVPN 并且配置你的客户端连接到服务器的 443 端口了,然后 SSLH 会从那里把流量转发到服务器的 1194 端口。但鉴于你正在和服务器的 443 端口通信,你的 VPN 流量不会被封锁。现在你可以舒服地坐在陌生小镇的咖啡店里,畅通无阻地通过你的树莓派上的 OpenVPN 浏览互联网。你顺便还给你的链接增加了一些安全性,这个额外作用也会让你的链接更安全和私密一些。享受通过安全跳板浏览互联网把! -资源: +### 参考资源 -安装与配置 OpenVPN: [https://wiki.debian.org/OpenVPN](https://wiki.debian.org/OpenVPN) and [http://cryptotap.com/articles/openvpn](http://cryptotap.com/articles/openvpn) - -OpenVPN 客户端下载: [https://openvpn.net/index.php/open-source/downloads.html](https://openvpn.net/index.php/open-source/downloads.html) - -OpenVPN Client for iOS: [https://itunes.apple.com/us/app/openvpn-connect/id590379981?mt=8](https://itunes.apple.com/us/app/openvpn-connect/id590379981?mt=8) - -OpenVPN Client for Android: [https://play.google.com/store/apps/details?id=net.openvpn.openvpn&hl=en](https://play.google.com/store/apps/details?id=net.openvpn.openvpn&hl=en) - -Tunnelblick for Mac OS X (OpenVPN client): [https://tunnelblick.net](https://tunnelblick.net) - -SSLH 介绍: [http://www.rutschle.net/tech/sslh.shtml](http://www.rutschle.net/tech/sslh.shtml) 和 [https://github.com/yrutschle/sslh](https://github.com/yrutschle/sslh) +- 安装与配置 OpenVPN: [https://wiki.debian.org/OpenVPN](https://wiki.debian.org/OpenVPN) 和 [http://cryptotap.com/articles/openvpn](http://cryptotap.com/articles/openvpn) +- OpenVPN 客户端下载: [https://openvpn.net/index.php/open-source/downloads.html](https://openvpn.net/index.php/open-source/downloads.html) +- OpenVPN iOS 客户端: [https://itunes.apple.com/us/app/openvpn-connect/id590379981?mt=8](https://itunes.apple.com/us/app/openvpn-connect/id590379981?mt=8) +- OpenVPN Android 客户端: [https://play.google.com/store/apps/details?id=net.openvpn.openvpn&hl=en](https://play.google.com/store/apps/details?id=net.openvpn.openvpn&hl=en) +- Tunnelblick for Mac OS X (OpenVPN 客户端): [https://tunnelblick.net](https://tunnelblick.net) +- SSLH 介绍: [http://www.rutschle.net/tech/sslh.shtml](http://www.rutschle.net/tech/sslh.shtml) 和 [https://github.com/yrutschle/sslh](https://github.com/yrutschle/sslh) ---------- @@ -512,7 +455,7 @@ via: http://www.linuxjournal.com/content/securi-pi-using-raspberry-pi-secure-lan 作者:[Bill Childers][a] 译者:[Moelf](https://github.com/Moelf) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 198b63761f251706b37fa0d2c8f09a72127b1ee2 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 9 Jul 2016 14:30:38 +0800 Subject: [PATCH 1103/1469] =?UTF-8?q?20160709-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...reate Your Own Shell in Python - Part I.md | 226 ++++++++++++++++++ 1 file changed, 226 insertions(+) create mode 100644 sources/tech/20160705 Create Your Own Shell in Python - Part I.md diff --git a/sources/tech/20160705 Create Your Own Shell in Python - Part I.md b/sources/tech/20160705 Create Your Own Shell in Python - Part I.md new file mode 100644 index 0000000000..9c3ffa55dd --- /dev/null +++ b/sources/tech/20160705 Create Your Own Shell in Python - Part I.md @@ -0,0 +1,226 @@ +Create Your Own Shell in Python : Part I + +I’m curious to know how a shell (like bash, csh, etc.) works internally. So, I implemented one called yosh (Your Own SHell) in Python to answer my own curiosity. The concept I explain in this article can be applied to other languages as well. + +(Note: You can find source code used in this blog post here. I distribute it with MIT license.) + +Let’s start. + +### Step 0: Project Structure + +For this project, I use the following project structure. + +``` +yosh_project +|-- yosh + |-- __init__.py + |-- shell.py +``` + +`yosh_project` is the root project folder (you can also name it just `yosh`). + +`yosh` is the package folder and `__init__.py` will make it a package named the same as the package folder name. (If you don’t write Python, just ignore it.) + +`shell.py` is our main shell file. + +### Step 1: Shell Loop + +When you start a shell, it will show a command prompt and wait for your command input. After it receives the command and executes it (the detail will be explained later), your shell will be back to the wait loop for your next command. + +In `shell.py`, we start by a simple main function calling the shell_loop() function as follows: + +``` +def shell_loop(): + # Start the loop here + + +def main(): + shell_loop() + + +if __name__ == "__main__": + main() +``` + +Then, in our `shell_loop()`, we use a status flag to indicate whether the loop should continue or stop. In the beginning of the loop, our shell will show a command prompt and wait to read command input. + +``` +import sys + +SHELL_STATUS_RUN = 1 +SHELL_STATUS_STOP = 0 + + +def shell_loop(): + status = SHELL_STATUS_RUN + + while status == SHELL_STATUS_RUN: + # Display a command prompt + sys.stdout.write('> ') + sys.stdout.flush() + + # Read command input + cmd = sys.stdin.readline() +``` + +After that, we tokenize the command input and execute it (we’ll implement the tokenize and execute functions soon). + +Therefore, our shell_loop() will be the following. + +``` +import sys + +SHELL_STATUS_RUN = 1 +SHELL_STATUS_STOP = 0 + + +def shell_loop(): + status = SHELL_STATUS_RUN + + while status == SHELL_STATUS_RUN: + # Display a command prompt + sys.stdout.write('> ') + sys.stdout.flush() + + # Read command input + cmd = sys.stdin.readline() + + # Tokenize the command input + cmd_tokens = tokenize(cmd) + + # Execute the command and retrieve new status + status = execute(cmd_tokens) +``` + +That’s all of our shell loop. If we start our shell with python shell.py, it will show the command prompt. However, it will throw an error if we type a command and hit enter because we don’t define tokenize function yet. + +To exit the shell, try ctrl-c. I will tell how to exit gracefully later. + +### Step 2: Tokenization + +When a user types a command in our shell and hits enter. The command input will be a long string containing both a command name and its arguments. Therefore, we have to tokenize it (split a string into several tokens). + +It seems simple at first glance. We might use cmd.split() to separate the input by spaces. It works well for a command like `ls -a my_folder` because it splits the command into a list `['ls', '-a', 'my_folder']` which we can use them easily. + +However, there are some cases that some arguments are quoted with single or double quotes like `echo "Hello World"` or `echo 'Hello World'`. If we use cmd.split(), we will get a list of 3 tokens `['echo', '"Hello', 'World"']` instead of 2 tokens `['echo', 'Hello World']`. + +Fortunately, Python provides a library called shlex that helps us split like a charm. (Note: we can also use regular expression but it’s not the main point of this article.) + +``` +import sys +import shlex + +... + +def tokenize(string): + return shlex.split(string) + +... +``` + +Then, we will send these tokens to the execution process. + +### Step 3: Execution + +This is the core and fun part of a shell. What happened when a shell executes mkdir test_dir? (Note: mkdir is a program to be executed with arguments test_dir for creating a directory named test_dir.) + +The first function involved in this step is execvp. Before I explain what execvp does, let’s see it in action. + +``` +import os +... + +def execute(cmd_tokens): + # Execute command + os.execvp(cmd_tokens[0], cmd_tokens) + + # Return status indicating to wait for next command in shell_loop + return SHELL_STATUS_RUN + +... +``` + +Try running our shell again and input a command `mkdir test_dir`, then, hit enter. + +The problem is, after we hit enter, our shell exits instead of waiting for the next command. However, the directory is correctly created. + +So, what execvp really does? + +execvp is a variant of a system call exec. The first argument is the program name. The v indicates the second argument is a list of program arguments (variable number of arguments). The p indicates the PATH environment will be used for searching for the given program name. In our previous attempt, the mkdir program was found based on your PATH environment variable. + +(There are other variants of exec such as execv, execvpe, execl, execlp, execlpe; you can google them for more information.) + +exec replaces the current memory of a calling process with a new process to be executed. In our case, our shell process memory was replaced by `mkdir` program. Then, mkdir became the main process and created the test_dir directory. Finally, its process exited. + +The main point here is that our shell process was replaced by mkdir process already. That’s the reason why our shell disappeared and did not wait for the next command. + +Therefore, we need another system call to rescue: fork. + +fork will allocate new memory and copy the current process into a new process. We called this new process as child process and the caller process as parent process. Then, the child process memory will be replaced by a execed program. Therefore, our shell, which is a parent process, is safe from memory replacement. + +Let’s see our modified code. + +``` +... + +def execute(cmd_tokens): + # Fork a child shell process + # If the current process is a child process, its `pid` is set to `0` + # else the current process is a parent process and the value of `pid` + # is the process id of its child process. + pid = os.fork() + + if pid == 0: + # Child process + # Replace the child shell process with the program called with exec + os.execvp(cmd_tokens[0], cmd_tokens) + elif pid > 0: + # Parent process + while True: + # Wait response status from its child process (identified with pid) + wpid, status = os.waitpid(pid, 0) + + # Finish waiting if its child process exits normally + # or is terminated by a signal + if os.WIFEXITED(status) or os.WIFSIGNALED(status): + break + + # Return status indicating to wait for next command in shell_loop + return SHELL_STATUS_RUN + +... +``` + +When the parent process call `os.fork()`, you can imagine that all source code is copied into a new child process. At this point, the parent and child process see the same code and run in parallel. + +If the running code is belong to the child process, pid will be 0. Else, the running code is belong to the parent process, pid will be the process id of the child process. + +When os.execvp is invoked in the child process, you can imagine like all the source code of the child process is replaced by the code of a program that is being called. However, the code of the parent process is not changed. + +When the parent process finishes waiting its child process to exit or be terminated, it returns the status indicating to continue the shell loop. + +### Run + +Now, you can try running our shell and enter mkdir test_dir2. It should work properly. Our main shell process is still there and waits for the next command. Try ls and you will see the created directories. + +However, there are some problems here. + +First, try cd test_dir2 and then ls. It’s supposed to enter the directory test_dir2 which is an empty directory. However, you will see that the directory was not changed into test_dir2. + +Second, we still have no way to exit from our shell gracefully. + +We will continue to solve such problems in [Part 2][1]. + + +-------------------------------------------------------------------------------- + +via: https://hackercollider.com/articles/2016/07/05/create-your-own-shell-in-python-part-1/ + +作者:[Supasate Choochaisri][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://disqus.com/by/supasate_choochaisri/ +[1]: https://hackercollider.com/articles/2016/07/06/create-your-own-shell-in-python-part-2/ From 69d53d49c78c2d648bf41ef064a08188ffde13d5 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 9 Jul 2016 14:35:30 +0800 Subject: [PATCH 1104/1469] =?UTF-8?q?20160709-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...eate Your Own Shell in Python - Part II.md | 215 ++++++++++++++++++ 1 file changed, 215 insertions(+) create mode 100644 sources/tech/20160706 Create Your Own Shell in Python - Part II.md diff --git a/sources/tech/20160706 Create Your Own Shell in Python - Part II.md b/sources/tech/20160706 Create Your Own Shell in Python - Part II.md new file mode 100644 index 0000000000..af0ec01b36 --- /dev/null +++ b/sources/tech/20160706 Create Your Own Shell in Python - Part II.md @@ -0,0 +1,215 @@ +Create Your Own Shell in Python - Part II +=========================================== + +In [part 1][1], we already created a main shell loop, tokenized command input, and executed a command by fork and exec. In this part, we will solve the remaining problmes. First, `cd test_dir2` does not change our current directory. Second, we still have no way to exit from our shell gracefully. + +### Step 4: Built-in Commands + +The statement “cd test_dir2 does not change our current directory” is true and false in some senses. It’s true in the sense that after executing the command, we are still at the same directory. However, the directory is actullay changed, but, it’s changed in the child process. + +Remember that we fork a child process, then, exec the command which does not happen on a parent process. The result is we just change the current directory of a child process, not the directory of a parent process. + +Then, the child process exits, and the parent process continues with the same intact directory. + +Therefore, this kind of commands must be built-in with the shell itself. It must be executed in the shell process without forking. + +#### cd + +Let’s start with cd command. + +We first create a builtins directory. Each built-in command will be put inside this directory. + +``` +yosh_project +|-- yosh + |-- builtins + | |-- __init__.py + | |-- cd.py + |-- __init__.py + |-- shell.py +``` + +In cd.py, we implement our own cd command by using a system call os.chdir. + +``` +import os +from yosh.constants import * + + +def cd(args): + os.chdir(args[0]) + + return SHELL_STATUS_RUN +``` + +Notice that we return shell running status from a built-in function. Therefore, we move constants into yosh/constants.py to be used across the project. + +``` +yosh_project +|-- yosh + |-- builtins + | |-- __init__.py + | |-- cd.py + |-- __init__.py + |-- constants.py + |-- shell.py +``` + +In constants.py, we put shell status constants here. + +``` +SHELL_STATUS_STOP = 0 +SHELL_STATUS_RUN = 1 +``` + +Now, our built-in cd is ready. Let’s modify our shell.py to handle built-in functions. + +``` +... +# Import constants +from yosh.constants import * + +# Hash map to store built-in function name and reference as key and value +built_in_cmds = {} + + +def tokenize(string): + return shlex.split(string) + + +def execute(cmd_tokens): + # Extract command name and arguments from tokens + cmd_name = cmd_tokens[0] + cmd_args = cmd_tokens[1:] + + # If the command is a built-in command, invoke its function with arguments + if cmd_name in built_in_cmds: + return built_in_cmds[cmd_name](cmd_args) + + ... +``` + +We use a Python dictionary built_in_cmds as a hash map to store our built-in functions. In execute function, we extract command name and arguments. If the command name is in our hash map, we call that built-in function. + +(Note: built_in_cmds[cmd_name] returns the function reference that can be invoked with arguments immediately.) + +We are almost ready to use the built-in cd function. The last thing is to add cd function into the built_in_cmds map. + +``` +... +# Import all built-in function references +from yosh.builtins import * + +... + +# Register a built-in function to built-in command hash map +def register_command(name, func): + built_in_cmds[name] = func + + +# Register all built-in commands here +def init(): + register_command("cd", cd) + + +def main(): + # Init shell before starting the main loop + init() + shell_loop() +``` + +We define register_command function for adding a built-in function to our built-in commmand hash map. Then, we define init function and register the built-in cd function there. + +Notice the line register_command("cd", cd). The first argument is a command name. The second argument is a reference to a function. In order to let cd, in the second argument, refer to the cd function reference in yosh/builtins/cd.py, we have to put the following line in yosh/builtins/__init__.py. + +``` +from yosh.builtins.cd import * +``` +Therefore, in yosh/shell.py, when we import * from yosh.builtins, we get cd function reference that is already imported by yosh.builtins. + +We’ve done preparing our code. Let’s try by running our shell as a module python -m yosh.shell at the same level as the yosh directory. + +Now, our cd command should change our shell directory correctly while non-built-in commands still work too. Cool. + +#### exit + +Here comes the last piece: to exit gracefully. + +We need a function that changes the shell status to be SHELL_STATUS_STOP. So, the shell loop will naturally break and the shell program will end and exit. + +As same as cd, if we fork and exec exit in a child process, the parent process will still remain inact. Therefore, the exit function is needed to be a shell built-in function. + +Let’s start by creating a new file called exit.py in the builtins folder. + +``` +yosh_project +|-- yosh + |-- builtins + | |-- __init__.py + | |-- cd.py + | |-- exit.py + |-- __init__.py + |-- constants.py + |-- shell.py +``` + +The exit.py defines the exit function that just returns the status to break the main loop. + +``` +from yosh.constants import * + + +def exit(args): + return SHELL_STATUS_STOP +``` + +Then, we import the exit function reference in `yosh/builtins/__init__.py`. + +``` +from yosh.builtins.cd import * +from yosh.builtins.exit import * +``` + +Finally, in shell.py, we register the exit command in `init()` function. + + +``` +... + +# Register all built-in commands here +def init(): + register_command("cd", cd) + register_command("exit", exit) + +... +``` + +That’s all! + +Try running python -m yosh.shell. Now you can enter exit to quit the program gracefully. + +### Final Thought + +I hope you enjoy creating yosh (your own shell) like I do. However, my version of yosh is still in an early stage. I don’t handle several corner cases that can corrupt the shell. There are a lot of built-in commands that I don’t cover. Some non-built-in commands can also be implemented as built-in commands to improve performance (avoid new process creation time). And, a ton of features are not yet implemented (see Common features and Differing features). + +I’ve provided the source code at github.com/supasate/yosh. Feel free to fork and play around. + +Now, it’s your turn to make it real Your Own SHell. + +Happy Coding! + +-------------------------------------------------------------------------------- + +via: https://hackercollider.com/articles/2016/07/06/create-your-own-shell-in-python-part-2/ + +作者:[Supasate Choochaisri][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://disqus.com/by/supasate_choochaisri/ +[1]: https://hackercollider.com/articles/2016/07/05/create-your-own-shell-in-python-part-1/ +[2]: http://tldp.org/LDP/Bash-Beginners-Guide/html/x7243.html +[3]: http://www.tldp.org/LDP/intro-linux/html/x12249.html +[4]: https://github.com/supasate/yosh From 2f7178d48fd0eb639ce6d19b7533df67d5433b38 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 9 Jul 2016 14:57:27 +0800 Subject: [PATCH 1105/1469] =?UTF-8?q?20160709-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ing With an Ipad Pro and a Raspberry Pi.md | 407 ++++++++++++++++++ 1 file changed, 407 insertions(+) create mode 100644 sources/tech/20160626 Backup Photos While Traveling With an Ipad Pro and a Raspberry Pi.md diff --git a/sources/tech/20160626 Backup Photos While Traveling With an Ipad Pro and a Raspberry Pi.md b/sources/tech/20160626 Backup Photos While Traveling With an Ipad Pro and a Raspberry Pi.md new file mode 100644 index 0000000000..b7b3e8d5f1 --- /dev/null +++ b/sources/tech/20160626 Backup Photos While Traveling With an Ipad Pro and a Raspberry Pi.md @@ -0,0 +1,407 @@ +Backup Photos While Traveling With an Ipad Pro and a Raspberry Pi +=================================================================== + +![](http://www.movingelectrons.net/images/bkup_photos_main.jpg) +>Backup Photos While Traveling - Gear. + +### Introduction + +I’ve been on a quest to finding the ideal travel photo backup solution for a long time. Relying on just tossing your SD cards in your camera bag after they are full during a trip is a risky move that leaves you too exposed: SD cards can be lost or stolen, data can get corrupted or cards can get damaged in transit. Backing up to another medium - even if it’s just another SD card - and leaving that in a safe(r) place while traveling is the best practice. Ideally, backing up to a remote location would be the way to go, but that may not be practical depending on where you are traveling to and Internet availability in the region. + +My requirements for the ideal backup procedure are: + +1. Use an iPad to manage the process instead of a laptop. I like to travel light and since most of my trips are business related (i.e. non-photography related), I’d hate to bring my personal laptop along with my business laptop. My iPad, however; is always with me, so using it as a tool just makes sense. +2. Use as few hardware devices as practically possible. +3. Connection between devices should be secure. I’ll be using this setup in hotels and airports, so closed and encrypted connection between devices is ideal. +4. The whole process should be sturdy and reliable. I’ve tried other options using router/combo devices and [it didn’t end up well][1]. + +### The Setup + +I came up with a setup that meets the above criteria and is also flexible enough to expand on it in the future. It involves the use of the following gear: + +1. [iPad Pro 9.7][2] inches. It’s the most powerful, small and lightweight iOS device at the time of writing. Apple pencil is not really needed, but it’s part of my gear as I so some editing on the iPad Pro while on the road. All the heavy lifting will be done by the Raspberry Pi, so any other device capable of connecting through SSH would fit the bill. +2. [Raspberry Pi 3][3] with Raspbian installed. +3. [Micro SD card][4] for Raspberry Pi and a Raspberry Pi [box/case][5]. +5. [128 GB Pen Drive][6]. You can go bigger, but 128 GB is enough for my user case. You can also get a portable external hard drive like [this one][7], but the Raspberry Pi may not provide enough power through its USB port, which means you would have to get a [powered USB hub][8], along with the needed cables, defeating the purpose of having a lightweight and minimalistic setup. +6. [SD card reader][9] +7. [SD Cards][10]. I use several as I don’t wait for one to fill up before using a different one. That allows me to spread photos I take on a single trip amongst several cards. + +The following diagram shows how these devices will be interacting with each other. + +![](http://www.movingelectrons.net/images/bkup_photos_diag.jpg) +>Backup Photos While Traveling - Process Diagram. + +The Raspberry Pi will be configured to act as a secured Hot Spot. It will create its own WPA2-encrypted WiFi network to which the iPad Pro will connect. Although there are many online tutorials to create an Ad Hoc (i.e. computer-to-computer) connection with the Raspberry Pi, which is easier to setup; that connection is not encrypted and it’s relatively easy for other devices near you to connect to it. Therefore, I decided to go with the WiFi option. + +The camera’s SD card will be connected to one of the Raspberry Pi’s USB ports through an SD card reader. Additionally, a high capacity Pen Drive (128 GB in my case) will be permanently inserted in one of the USB ports on the Raspberry Pi. I picked the [Sandisk Ultra Fit][11] because of its tiny size. The main idea is to have the Raspberry Pi backup the photos from the SD Card to the Pen Drive with the help of a Python script. The backup process will be incremental, meaning that only changes (i.e. new photos taken) will be added to the backup folder each time the script runs, making the process really fast. This is a huge advantage if you take a lot of photos or if you shoot in RAW format. The iPad will be used to trigger the Python script and to browse the SD Card and Pen Drive as needed. + +As an added benefit, if the Raspberry Pi is connected to Internet through a wired connection (i.e. through the Ethernet port), it will be able to share the Internet connection with the devices connected to its WiFi network. + +### 1. Raspberry Pi Configuration + +This is the part where we roll up our sleeves and get busy as we’ll be using Raspbian’s command-line interface (CLI) . I’ll try to be as descriptive as possible so it’s easy to go through the process. + +#### Install and Configure Raspbian + +Connect a keyboard, mouse and an LCD monitor to the Raspberry Pi. Insert the Micro SD in the Raspberry Pi’s slot and proceed to install Raspbian per the instructions in the [official site][12]. + +After the installation is done, go to the CLI (Terminal in Raspbian) and type: + +``` +sudo apt-get update +sudo apt-get upgrade +``` + +This will upgrade all software on the machine. I configured the Raspberry Pi to connect to the local network and changed the default password as a safety measure. + +By default SSH is enabled on Raspbian, so all sections below can be done from a remote machine. I also configured RSA authentication, but that’s optional. More info about it [here][13]. + +This is a screenshot of the SSH connection to the Raspberry Pi from [iTerm][14] on Mac: + +##### Creating Encrypted (WPA2) Access Point + +The installation was made based on [this][15] article, it was optimized for my user case. + +##### 1. Install Packages + +We need to type the following to install the required packages: + +``` +sudo apt-get install hostapd +sudo apt-get install dnsmasq +``` + +hostapd allows to use the built-in WiFi as an access point. dnsmasq is a combined DHCP and DNS server that’s easy to configure. + +##### 2. Edit dhcpcd.conf + +Connect to the Raspberry Pi through Ethernet. Interface configuration on the Raspbery Pi is handled by dhcpcd, so first we tell it to ignore wlan0 as it will be configured with a static IP address. + +Open up the dhcpcd configuration file with sudo nano `/etc/dhcpcd.conf` and add the following line to the bottom of the file: + +``` +denyinterfaces wlan0 +``` + +Note: This must be above any interface lines that may have been added. + +##### 3. Edit interfaces + +Now we need to configure our static IP. To do this, open up the interface configuration file with sudo nano `/etc/network/interfaces` and edit the wlan0 section so that it looks like this: + +``` +allow-hotplug wlan0 +iface wlan0 inet static + address 192.168.1.1 + netmask 255.255.255.0 + network 192.168.1.0 + broadcast 192.168.1.255 +# wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf +``` + +Also, the wlan1 section was edited to be: + +``` +#allow-hotplug wlan1 +#iface wlan1 inet manual +# wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf +``` + +Important: Restart dhcpcd with sudo service dhcpcd restart and then reload the configuration for wlan0 with `sudo ifdown eth0; sudo ifup wlan0`. + +##### 4. Configure Hostapd + +Next, we need to configure hostapd. Create a new configuration file with `sudo nano /etc/hostapd/hostapd.conf with the following contents: + +``` +interface=wlan0 + +# Use the nl80211 driver with the brcmfmac driver +driver=nl80211 + +# This is the name of the network +ssid=YOUR_NETWORK_NAME_HERE + +# Use the 2.4GHz band +hw_mode=g + +# Use channel 6 +channel=6 + +# Enable 802.11n +ieee80211n=1 + +# Enable QoS Support +wmm_enabled=1 + +# Enable 40MHz channels with 20ns guard interval +ht_capab=[HT40][SHORT-GI-20][DSSS_CCK-40] + +# Accept all MAC addresses +macaddr_acl=0 + +# Use WPA authentication +auth_algs=1 + +# Require clients to know the network name +ignore_broadcast_ssid=0 + +# Use WPA2 +wpa=2 + +# Use a pre-shared key +wpa_key_mgmt=WPA-PSK + +# The network passphrase +wpa_passphrase=YOUR_NEW_WIFI_PASSWORD_HERE + +# Use AES, instead of TKIP +rsn_pairwise=CCMP +``` + +Now, we also need to tell hostapd where to look for the config file when it starts up on boot. Open up the default configuration file with `sudo nano /etc/default/hostapd` and find the line `#DAEMON_CONF=""` and replace it with `DAEMON_CONF="/etc/hostapd/hostapd.conf"`. + +##### 5. Configure Dnsmasq + +The shipped dnsmasq config file contains tons of information on how to use it, but we won’t be using all the options. I’d recommend moving it (rather than deleting it), and creating a new one with + +``` +sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.orig +sudo nano /etc/dnsmasq.conf +``` + +Paste the following into the new file: + +``` +interface=wlan0 # Use interface wlan0 +listen-address=192.168.1.1 # Explicitly specify the address to listen on +bind-interfaces # Bind to the interface to make sure we aren't sending things elsewhere +server=8.8.8.8 # Forward DNS requests to Google DNS +domain-needed # Don't forward short names +bogus-priv # Never forward addresses in the non-routed address spaces. +dhcp-range=192.168.1.50,192.168.1.100,12h # Assign IP addresses in that range with a 12 hour lease time +``` + +##### 6. Set up IPV4 forwarding + +One of the last things that we need to do is to enable packet forwarding. To do this, open up the sysctl.conf file with `sudo nano /etc/sysctl.conf`, and remove the # from the beginning of the line containing `net.ipv4.ip_forward=1`. This will enable it on the next reboot. + +We also need to share our Raspberry Pi’s internet connection to our devices connected over WiFi by the configuring a NAT between our wlan0 interface and our eth0 interface. We can do this by writing a script with the following lines. + +``` +sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE +sudo iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT +sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT +``` + +I named the script hotspot-boot.sh and made it executable with: + +``` +sudo chmod 755 hotspot-boot.sh +``` + +The script should be executed when the Raspberry Pi boots. There are many ways to accomplish this, and this is the way I went with: + +1. Put the file in `/home/pi/scripts`. +2. Edit the rc.local file by typing `sudo nano /etc/rc.local` and place the call to the script before the line that reads exit 0 (more information [here][16]). + +This is how the rc.local file looks like after editing it. + +``` +#!/bin/sh -e +# +# rc.local +# +# This script is executed at the end of each multiuser runlevel. +# Make sure that the script will "exit 0" on success or any other +# value on error. +# +# In order to enable or disable this script just change the execution +# bits. +# +# By default this script does nothing. + +# Print the IP address +_IP=$(hostname -I) || true +if [ "$_IP" ]; then + printf "My IP address is %s\n" "$_IP" +fi + +sudo /home/pi/scripts/hotspot-boot.sh & + +exit 0 + +``` + +#### Installing Samba and NTFS Compatibility. + +We also need to install the following packages to enable the Samba protocol and allow the File Browser App to see the connected devices to the Raspberry Pi as shared folders. Also, ntfs-3g provides NTFS compatibility in case we decide to connect a portable hard drive to the Raspberry Pi. + +``` +sudo apt-get install ntfs-3g +sudo apt-get install samba samba-common-bin +``` + +You can follow [this][17] article for details on how to configure Samba. + +Important Note: The referenced article also goes through the process of mounting external hard drives on the Raspberry Pi. We won’t be doing that because, at the time of writing, the current version of Raspbian (Jessie) auto-mounts both the SD Card and the Pendrive to `/media/pi/` when the device is turned on. The article also goes over some redundancy features that we won’t be using. + +### 2. Python Script + +Now that the Raspberry Pi has been configured, we need to work on the script that will actually backup/copy our photos. Note that this script just provides certain degree of automation to the backup process. If you have a basic knowledge of using the Linux/Raspbian CLI, you can just SSH into the Raspberry Pi and copy yourself all photos from one device to the other by creating the needed folders and using either the cp or the rsync command. We’ll be using the rsync method on the script as it’s very reliable and allows for incremental backups. + +This process relies on two files: the script itself and the configuration file `backup_photos.conf`. The latter just have a couple of lines indicating where the destination drive (Pendrive) is mounted and what folder has been mounted to. This is what it looks like: + +``` +mount folder=/media/pi/ +destination folder=PDRIVE128GB +``` + +Important: Do not add any additional spaces between the `=` symbol and the words to both sides of it as the script will break (definitely an opportunity for improvement). + +Below is the Python script, which I named `backup_photos.py` and placed in `/home/pi/scripts/`. I included comments in between the lines of code to make it easier to follow. + +``` +#!/usr/bin/python3 + +import os +import sys +from sh import rsync + +''' +The script copies an SD Card mounted on /media/pi/ to a folder with the same name +created in the destination drive. The destination drive's name is defined in +the .conf file. + + +Argument: label/name of the mounted SD Card. +''' + +CONFIG_FILE = '/home/pi/scripts/backup_photos.conf' +ORIGIN_DEV = sys.argv[1] + +def create_folder(path): + + print ('attempting to create destination folder: ',path) + if not os.path.exists(path): + try: + os.mkdir(path) + print ('Folder created.') + except: + print ('Folder could not be created. Stopping.') + return + else: + print ('Folder already in path. Using that instead.') + + + +confFile = open(CONFIG_FILE,'rU') +#IMPORTANT: rU Opens the file with Universal Newline Support, +#so \n and/or \r is recognized as a new line. + +confList = confFile.readlines() +confFile.close() + + +for line in confList: + line = line.strip('\n') + + try: + name , value = line.split('=') + + if name == 'mount folder': + mountFolder = value + elif name == 'destination folder': + destDevice = value + + + except ValueError: + print ('Incorrect line format. Passing.') + pass + + +destFolder = mountFolder+destDevice+'/'+ORIGIN_DEV +create_folder(destFolder) + +print ('Copying files...') + +# Comment out to delete files that are not in the origin: +# rsync("-av", "--delete", mountFolder+ORIGIN_DEV, destFolder) +rsync("-av", mountFolder+ORIGIN_DEV+'/', destFolder) + +print ('Done.') +``` + +### 3. iPad Pro Configuration + +Since all the heavy-lifting will be done on the Raspberry Pi and no files will be transferred through the iPad Pro, which was a huge disadvantage in [one of the workflows I tried before][18]; we just need to install [Prompt 2][19] on the iPad to access the Raspeberry Pi through SSH. Once connected, you can either run the Python script or copy the files manually. + +![](http://www.movingelectrons.net/images/bkup_photos_ipad&rpi_prompt.jpg) +>SSH Connection to Raspberry Pi From iPad Using Prompt. + +Since we installed Samba, we can access USB devices connected to the Raspberry Pi in a more graphical way. You can stream videos, copy and move files between devices. [File Browser][20] is perfect for that. + +### 4. Putting it All Together + +Let’s suppose that `SD32GB-03` is the label of an SD card connected to one of the USB ports on the Raspberry Pi. Also, let’s suppose that `PDRIVE128GB` is the label of the Pendrive, also connected to the device and defined on the `.conf` file as indicated above. If we wanted to backup the photos on the SD Card, we would need to go through the following steps: + +1. Turn on Raspberry Pi so that drives are mounted automatically. +2. Connect to the WiFi network generated by the Raspberry Pi. +3. Connect to the Raspberry Pi through SSH using the [Prompt][21] App. +4. Type the following once you are connected: + +``` +python3 backup_photos.py SD32GB-03 +``` + +The first backup my take some minutes depending on how much of the card is used. That means you need to keep the connection alive to the Raspberry Pi from the iPad. You can get around this by using the [nohup][22] command before running the script. + +``` +nohup python3 backup_photos.py SD32GB-03 & +``` + +![](http://www.movingelectrons.net/images/bkup_photos_ipad&rpi_finished.png) +>iTerm Screenshot After Running Python Script. + +### Further Customization + +I installed a VNC server to access Raspbian’s graphical interface from another computer or the iPad through [Remoter App][23]. I’m looking into installing [BitTorrent Sync][24] for backing up photos to a remote location while on the road, which would be the ideal setup. I’ll expand this post once I have a workable solution. + +Feel free to either include your comments/questions below or reach out to me. My contact info is at the footer of this page. + + +-------------------------------------------------------------------------------- + +via: http://www.movingelectrons.net/blog/2016/06/26/backup-photos-while-traveling-with-a-raspberry-pi.html + +作者:[Editor][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.movingelectrons.net/blog/2016/06/26/backup-photos-while-traveling-with-a-raspberry-pi.html +[1]: http://bit.ly/1MVVtZi +[2]: http://www.amazon.com/dp/B01D3NZIMA/?tag=movinelect0e-20 +[3]: http://www.amazon.com/dp/B01CD5VC92/?tag=movinelect0e-20 +[4]: http://www.amazon.com/dp/B010Q57T02/?tag=movinelect0e-20 +[5]: http://www.amazon.com/dp/B01F1PSFY6/?tag=movinelect0e-20 +[6]: http://amzn.to/293kPqX +[7]: http://amzn.to/290syFY +[8]: http://amzn.to/290syFY +[9]: http://amzn.to/290syFY +[10]: http://amzn.to/290syFY +[11]: http://amzn.to/293kPqX +[12]: https://www.raspberrypi.org/downloads/noobs/ +[13]: https://www.raspberrypi.org/documentation/remote-access/ssh/passwordless.md +[14]: https://www.iterm2.com/ +[15]: https://frillip.com/using-your-raspberry-pi-3-as-a-wifi-access-point-with-hostapd/ +[16]: https://www.raspberrypi.org/documentation/linux/usage/rc-local.md +[17]: http://www.howtogeek.com/139433/how-to-turn-a-raspberry-pi-into-a-low-power-network-storage-device/ +[18]: http://bit.ly/1MVVtZi +[19]: https://itunes.apple.com/us/app/prompt-2/id917437289?mt=8&uo=4&at=11lqkH +[20]: https://itunes.apple.com/us/app/filebrowser-access-files-on/id364738545?mt=8&uo=4&at=11lqkH +[21]: https://itunes.apple.com/us/app/prompt-2/id917437289?mt=8&uo=4&at=11lqkH +[22]: https://en.m.wikipedia.org/wiki/Nohup +[23]: https://itunes.apple.com/us/app/remoter-pro-vnc-ssh-rdp/id519768191?mt=8&uo=4&at=11lqkH +[24]: https://getsync.com/ From 23b2147154afc4511b65f6fdbc46850acf9b3dfe Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 9 Jul 2016 15:10:43 +0800 Subject: [PATCH 1106/1469] =?UTF-8?q?20160709-4=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...oying a replicated Python 3 Application.md | 281 ++++++++++++++++++ 1 file changed, 281 insertions(+) create mode 100644 sources/tech/20160706 Getting started with Docker Swarm and deploying a replicated Python 3 Application.md diff --git a/sources/tech/20160706 Getting started with Docker Swarm and deploying a replicated Python 3 Application.md b/sources/tech/20160706 Getting started with Docker Swarm and deploying a replicated Python 3 Application.md new file mode 100644 index 0000000000..85b592b306 --- /dev/null +++ b/sources/tech/20160706 Getting started with Docker Swarm and deploying a replicated Python 3 Application.md @@ -0,0 +1,281 @@ +Tutorial: Getting started with Docker Swarm and deploying a replicated Python 3 Application +============== + +At [Dockercon][1] recently [Ben Firshman][2] did a very cool presentation on building serverless apps with Docker, you can [read about it here][3] (along with watching the video). A little while back [I wrote an article][4] on building a microservice with [AWS Lambda][5]. + +Today, I want to show you how to use [Docker Swarm][6] and then deploy a simple Python Falcon REST app. Although I won’t be using [dockerrun][7] or the serverless capabilities I think you might be surprised how easy it is to deploy (replicated) Python applications (actually any sort of application: Java, Go, etc.) with Docker Swarm. + + +Note: Some of the steps I’ll show you are taken from the [Swarm Tutorial][8]. I’ve modified some things and [added a Vagrant helper repo][9] to spin up a local testing environment for Docker Swarm to utilize. Keep in mind you must be using Docker Engine 1.12 or later. At the time of this article I am using RC2 of 1.12. Keep in mind this is all build on beta software at this time, things can change. + +The first thing you will want to do is to ensure you have [Vagrant][10] properly installed and working if you want to run this locally. You can also follow the steps for the most part and spin up the Docker Swarm VMs on your preferred cloud provider. + +We are going to spin up three VMs: A single docker swarm manager and two workers. + +Security Note: The Vagrantfile uses a shell script located on Docker’s test server. This is a potential security issue to run scripts you don’t have control over so make sure to [review the script][11] prior to running. + +``` +$ git clone https://github.com/chadlung/vagrant-docker-swarm +$ cd vagrant-docker-swarm +$ vagrant plugin install vagrant-vbguest +$ vagrant up +``` + +The vagrant up command will take some time to complete. + +SSH into the manager1 VM: + +``` +$ vagrant ssh manager1 +``` + +Run the following command in the manager1 ssh terminal session: + +``` +$ sudo docker swarm init --listen-addr 192.168.99.100:2377 +``` + +There will be no workers registered yet: + +``` +$ sudo docker node ls +``` + +Let’s register the two workers. Use two new terminal sessions (leave the manager1 session running): + +``` +$ vagrant ssh worker1 +``` + +Run the following command in the worker1 ssh terminal session: + +``` +$ sudo docker swarm join 192.168.99.100:2377 +``` + +Repeat those commands used for worker1 but substitute worker2. + +From the manager1 terminal run: + +``` +$ docker node ls +``` + +You should see: + +![](http://www.giantflyingsaucer.com/blog/wp-content/uploads/2016/06/Screen-Shot-2016-06-28-at-3.15.25-PM.png) + +On the manager1 terminal let’s deploy a simple service. + +``` +sudo docker service create --replicas 1 --name pinger alpine ping google.com +``` + +That will deploy a service that will ping google.com to one of the workers (or manager, the manager can also run services but this [can also be disabled][12] if you only want workers to run containers). To see which node got the service run this: + +``` +$ sudo docker service tasks pinger +``` + +Result will be similar to this: + +![](http://www.giantflyingsaucer.com/blog/wp-content/uploads/2016/06/Screen-Shot-2016-06-28-at-5.23.05-PM.png) + +So we know its on worker1. Let’s go to the terminal session for worker1 and attach to the running container: + +``` +$ sudo docker ps +``` + +![](http://www.giantflyingsaucer.com/blog/wp-content/uploads/2016/06/Screen-Shot-2016-06-28-at-5.25.02-PM.png) + +You can see the container id is: ae56769b9d4d + +In my case I run: + +``` +$ sudo docker attach ae56769b9d4d +``` + +![](http://www.giantflyingsaucer.com/blog/wp-content/uploads/2016/06/Screen-Shot-2016-06-28-at-5.26.49-PM.png) + +You can just CTRL-C to stop the pinging. + +Go back to the manager1 terminal session and remove the pinger service: + +``` +$ sudo docker service rm pinger +``` + +Now we will move onto deploying a replicated Python app part of this article. Please keep in mind in order to keep this article simple and easy to follow this will be a bare bones trivial service. + +The first thing you will need to do is to either add your own image to [Docker Hub][13] or use [the one I already have][14]. Its a simple Python 3 Falcon REST app that has one endpoint: /hello with a param of value=SOME_STRING + +The Python code for the [chadlung/hello-app][15] image looks like this: + +``` +import json +from wsgiref import simple_server + +import falcon + + +class HelloResource(object): + def on_get(self, req, resp): + try: + value = req.get_param('value') + + resp.content_type = 'application/json' + resp.status = falcon.HTTP_200 + resp.body = json.dumps({'message': str(value)}) + except Exception as ex: + resp.status = falcon.HTTP_500 + resp.body = str(ex) + + +if __name__ == '__main__': + app = falcon.API() + hello_resource = HelloResource() + app.add_route('/hello', hello_resource) + httpd = simple_server.make_server('0.0.0.0', 8080, app) + httpd.serve_forever() +``` + +The Dockerfile is as simple as: + +``` +FROM python:3.4.4 + +RUN pip install -U pip +RUN pip install -U falcon + +EXPOSE 8080 + +COPY . /hello-app +WORKDIR /hello-app + +CMD ["python", "app.py"] +``` + +Again, this is meant to be very trivial. You can hit the endpoint by running the image locally if you want: + +This gives you back: + +``` +{"message": "Fred"} +``` + +Build and deploy the hellp-app to Docker Hub (modify below to use your own Docker Hub repo or [use this one][15]): + +``` +$ sudo docker build . -t chadlung/hello-app:2 +$ sudo docker push chadlung/hello-app:2 +``` + +Now we want to deploy this to the Docker Swarm we set up earlier. Go into the manager1 terminal session and run: + +``` +$ sudo docker service create -p 8080:8080 --replicas 2 --name hello-app chadlung/hello-app:2 +$ sudo docker service inspect --pretty hello-app +$ sudo docker service tasks hello-app +``` + +Now we are ready to test it out. Using any of the node’s IPs in the swarm hit the /hello endpoint. In my case I will just cURL from the manager1 terminal: + +Remember, all IPs in the swarm will work even if the service is only running on one or more nodes. + +``` +$ curl -v -X GET "http://192.168.99.100:8080/hello?value=Chad" +$ curl -v -X GET "http://192.168.99.101:8080/hello?value=Test" +$ curl -v -X GET "http://192.168.99.102:8080/hello?value=Docker" +``` + +Results: + +``` +* Hostname was NOT found in DNS cache +* Trying 192.168.99.101... +* Connected to 192.168.99.101 (192.168.99.101) port 8080 (#0) +> GET /hello?value=Chad HTTP/1.1 +> User-Agent: curl/7.35.0 +> Host: 192.168.99.101:8080 +> Accept: */* +> +* HTTP 1.0, assume close after body +< HTTP/1.0 200 OK +< Date: Tue, 28 Jun 2016 23:52:55 GMT +< Server: WSGIServer/0.2 CPython/3.4.4 +< content-type: application/json +< content-length: 19 +< +{"message": "Chad"} +``` + +Calling the other node from my web browser: + +![](http://www.giantflyingsaucer.com/blog/wp-content/uploads/2016/06/Screen-Shot-2016-06-28-at-6.54.31-PM.png) + +If you want to see all the services running try this from the manager1 node: + +``` +$ sudo docker service ls +``` +If you want to add some visualization to all this you can install [Docker Swarm Visualizer][16] (this is very handy for presentations, etc.). From the manager1 terminal session run the following: + +![]($ sudo docker run -it -d -p 5000:5000 -e HOST=192.168.99.100 -e PORT=5000 -v /var/run/docker.sock:/var/run/docker.sock manomarks/visualizer) + +Simply open a browser now and point it at: + +Results (assuming running two Docker Swarm services): + +![](http://www.giantflyingsaucer.com/blog/wp-content/uploads/2016/06/Screen-Shot-2016-06-30-at-2.37.28-PM.png) + +To stop the hello-app (which was replicated to two nodes) run this from the manager1 terminal session: + +``` +$ sudo docker service rm hello-app +``` + +To stop the Visualizer run this from the manager1 terminal session: + +``` +$ sudo docker ps +``` + +Get the container id, in my case it was: f71fec0d3ce1 + +Run this from the manager1 terminal session:: + +``` +$ sudo docker stop f71fec0d3ce1 +``` + +Good luck with Docker Swarm and keep in kind this article was based on the release candidate of version 1.12. + +-------------------------------------------------------------------------------- + +via: http://www.giantflyingsaucer.com/blog/?p=5923 + +作者:[Chad Lung][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.giantflyingsaucer.com/blog/?author=2 +[1]: http://dockercon.com/ +[2]: https://blog.docker.com/author/bfirshman/ +[3]: https://blog.docker.com/author/bfirshman/ +[4]: http://www.giantflyingsaucer.com/blog/?p=5730 +[5]: https://aws.amazon.com/lambda/ +[6]: https://docs.docker.com/swarm/ +[7]: https://github.com/bfirsh/dockerrun +[8]: https://docs.docker.com/engine/swarm/swarm-tutorial/ +[9]: https://github.com/chadlung/vagrant-docker-swarm +[10]: https://www.vagrantup.com/ +[11]: https://test.docker.com/ +[12]: https://docs.docker.com/engine/reference/commandline/swarm_init/ +[13]: https://hub.docker.com/ +[14]: https://hub.docker.com/r/chadlung/hello-app/ +[15]: https://hub.docker.com/r/chadlung/hello-app/ +[16]: https://github.com/ManoMarks/docker-swarm-visualizer From d62ef3e80349a01d665c8709f784ef845de297ea Mon Sep 17 00:00:00 2001 From: Mike Date: Sat, 9 Jul 2016 18:35:01 +0800 Subject: [PATCH 1107/1469] =?UTF-8?q?Finish=20Translating=20=E3=80=8Atech/?= =?UTF-8?q?20160620=20Detecting=20cats=20in=20images=20with=20OpenCV.md?= =?UTF-8?q?=E3=80=8B=20(#4162)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * sources/tech/20160609 How to record your terminal session on Linux.md * translated/tech/20160609 How to record your terminal session on Linux.md * sources/tech/20160620 Detecting cats in images with OpenCV.md * sources/tech/20160620 Detecting cats in images with OpenCV.md * sources/tech/20160620 Detecting cats in images with OpenCV.md * sources/tech/20160620 Detecting cats in images with OpenCV.md * sources/tech/20160620 Detecting cats in images with OpenCV.md * translated/tech/20160620 Detecting cats in images with OpenCV.md * remove source --- ...20 Detecting cats in images with OpenCV.md | 231 ------------------ ...20 Detecting cats in images with OpenCV.md | 228 +++++++++++++++++ 2 files changed, 228 insertions(+), 231 deletions(-) delete mode 100644 sources/tech/20160620 Detecting cats in images with OpenCV.md create mode 100644 translated/tech/20160620 Detecting cats in images with OpenCV.md diff --git a/sources/tech/20160620 Detecting cats in images with OpenCV.md b/sources/tech/20160620 Detecting cats in images with OpenCV.md deleted file mode 100644 index 37a3ce7fc2..0000000000 --- a/sources/tech/20160620 Detecting cats in images with OpenCV.md +++ /dev/null @@ -1,231 +0,0 @@ -Detecting cats in images with OpenCV -======================================= - -![](http://www.pyimagesearch.com/wp-content/uploads/2016/05/cat_face_detector_result_04.jpg) - -Did you know that OpenCV can detect cat faces in images…right out-of-the-box with no extras? - -I didn’t either. - -But after [Kendrick Tan broke the story][1], I had to check it out for myself…and do a little investigative work to see how this cat detector seemed to sneak its way into the OpenCV repository without me noticing (much like a cat sliding into an empty cereal box, just waiting to be discovered). - -In the remainder of this blog post, I’ll demonstrate how to use OpenCV’s cat detector to detect cat faces in images. This same technique can be applied to video streams as well. - ->Looking for the source code to this post? [Jump right to the downloads section][2]. - - -### Detecting cats in images with OpenCV - -If you take a look at the [OpenCV repository][3], specifically within the [haarcascades directory][4] (where OpenCV stores all its pre-trained Haar classifiers to detect various objects, body parts, etc.), you’ll notice two files: - -- haarcascade_frontalcatface.xml -- haarcascade_frontalcatface_extended.xml - -Both of these Haar cascades can be used detecting “cat faces” in images. In fact, I used these very same cascades to generate the example image at the top of this blog post. - -Doing a little investigative work, I found that the cascades were trained and contributed to the OpenCV repository by the legendary [Joseph Howse][5] who’s authored a good many tutorials, books, and talks on computer vision. - -In the remainder of this blog post, I’ll show you how to utilize Howse’s Haar cascades to detect cats in images. - -Cat detection code - -Let’s get started detecting cats in images with OpenCV. Open up a new file, name it cat_detector.py , and insert the following code: - -### Detecting cats in images with OpenCVPython - -``` -# import the necessary packages -import argparse -import cv2 - -# construct the argument parse and parse the arguments -ap = argparse.ArgumentParser() -ap.add_argument("-i", "--image", required=True, - help="path to the input image") -ap.add_argument("-c", "--cascade", - default="haarcascade_frontalcatface.xml", - help="path to cat detector haar cascade") -args = vars(ap.parse_args()) -``` - -Lines 2 and 3 import our necessary Python packages while Lines 6-12 parse our command line arguments. We only require a single argument here, the input `--image` that we want to detect cat faces in using OpenCV. - -We can also (optionally) supply a path our Haar cascade via the `--cascade` switch. We’ll default this path to `haarcascade_frontalcatface.xml` and assume you have the `haarcascade_frontalcatface.xml` file in the same directory as your cat_detector.py script. - -Note: I’ve conveniently included the code, cat detector Haar cascade, and example images used in this tutorial in the “Downloads” section of this blog post. If you’re new to working with Python + OpenCV (or Haar cascades), I would suggest downloading the provided .zip file to make it easier to follow along. - -Next, let’s detect the cats in our input image: - -``` -# load the input image and convert it to grayscale -image = cv2.imread(args["image"]) -gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) - -# load the cat detector Haar cascade, then detect cat faces -# in the input image -detector = cv2.CascadeClassifier(args["cascade"]) -rects = detector.detectMultiScale(gray, scaleFactor=1.3, - minNeighbors=10, minSize=(75, 75)) -``` - -On Lines 15 and 16 we load our input image from disk and convert it to grayscale (a normal pre-processing step before passing the image to a Haar cascade classifier, although not strictly required). - -Line 20 loads our Haar cascade from disk (in this case, the cat detector) and instantiates the cv2.CascadeClassifier object. - -Detecting cat faces in images with OpenCV is accomplished on Lines 21 and 22 by calling the detectMultiScale method of the detector object. We pass four parameters to the detectMultiScale method, including: - -1. Our image, gray , that we want to detect cat faces in. -2.A scaleFactor of our [image pyramid][6] used when detecting cat faces. A larger scale factor will increase the speed of the detector, but could harm our true-positive detection accuracy. Conversely, a smaller scale will slow down the detection process, but increase true-positive detections. However, this smaller scale can also increase the false-positive detection rate as well. See the “A note on Haar cascades” section of this blog post for more information. -3. The minNeighbors parameter controls the minimum number of detected bounding boxes in a given area for the region to be considered a “cat face”. This parameter is very helpful in pruning false-positive detections. -4. Finally, the minSize parameter is pretty self-explanatory. This value ensures that each detected bounding box is at least width x height pixels (in this case, 75 x 75). - -The detectMultiScale function returns rects , a list of 4-tuples. These tuples contain the (x, y)-coordinates and width and height of each detected cat face. - -Finally, let’s draw a rectangle surround each cat face in the image: - -``` -# loop over the cat faces and draw a rectangle surrounding each -for (i, (x, y, w, h)) in enumerate(rects): - cv2.rectangle(image, (x, y), (x + w, y + h), (0, 0, 255), 2) - cv2.putText(image, "Cat #{}".format(i + 1), (x, y - 10), - cv2.FONT_HERSHEY_SIMPLEX, 0.55, (0, 0, 255), 2) - -# show the detected cat faces -cv2.imshow("Cat Faces", image) -cv2.waitKey(0) -``` - -Given our bounding boxes (i.e., rects ), we loop over each of them individually on Line 25. - -We then draw a rectangle surrounding each cat face on Line 26, while Lines 27 and 28 displays an integer, counting the number of cats in the image. - -Finally, Lines 31 and 32 display the output image to our screen. - -### Cat detection results - -To test our OpenCV cat detector, be sure to download the source code to this tutorial using the “Downloads” section at the bottom of this post. - -Then, after you have unzipped the archive, you should have the following three files/directories: - -1. cat_detector.py : Our Python + OpenCV script used to detect cats in images. -2. haarcascade_frontalcatface.xml : The cat detector Haar cascade. -3. images : A directory of testing images that we’re going to apply the cat detector cascade to. - -From there, execute the following command: - -Detecting cats in images with OpenCVShell - -``` -$ python cat_detector.py --image images/cat_01.jpg -``` - -![](http://www.pyimagesearch.com/wp-content/uploads/2016/05/cat_face_detector_result_01.jpg) ->Figure 1: Detecting a cat face in an image, even with parts of the cat occluded - -Notice that we have been able to detect the cat face in the image, even though the rest of its body is obscured. - -Let’s try another image: - -``` -python cat_detector.py --image images/cat_02.jpg -``` - -![](http://www.pyimagesearch.com/wp-content/uploads/2016/05/cat_face_detector_result_02.jpg) ->Figure 2: A second example of detecting a cat in an image with OpenCV, this time the cat face is slightly different - -This cat’s face is clearly different from the other one, as it’s in the middle of a “meow”. In either case, the cat detector cascade is able to correctly find the cat face in the image. - -The same is true for this image as well: - -``` -$ python cat_detector.py --image images/cat_03.jpg -``` - -![](http://www.pyimagesearch.com/wp-content/uploads/2016/05/cat_face_detector_result_03.jpg) ->Figure 3: Cat detection with OpenCV and Python - -Our final example demonstrates detecting multiple cats in an image using OpenCV and Python: - -``` -$ python cat_detector.py --image images/cat_04.jpg -``` - -![](http://www.pyimagesearch.com/wp-content/uploads/2016/05/cat_face_detector_result_04.jpg) ->Figure 4: Detecting multiple cats in the same image with OpenCV - -Note that the Haar cascade can return bounding boxes in an order that you may not like. In this case, the middle cat is actually labeled as the third cat. You can resolve this “issue” by sorting the bounding boxes according to their (x, y)-coordinates for a consistent ordering. - -#### A quick note on accuracy - -It’s important to note that in the comments section of the .xml files, Joseph Howe details that the cat detector Haar cascades can report cat faces where there are actually human faces. - -In this case, he recommends performing both face detection and cat detection, then discarding any cat bounding boxes that overlap with the face bounding boxes. - -#### A note on Haar cascades - -First published in 2001 by Paul Viola and Michael Jones, [Rapid Object Detection using a Boosted Cascade of Simple Features][7], this original work has become one of the most cited papers in computer vision. - -This algorithm is capable of detecting objects in images, regardless of their location and scale. And perhaps most intriguing, the detector can run in real-time on modern hardware. - -In their paper, Viola and Jones focused on training a face detector; however, the framework can also be used to train detectors for arbitrary “objects”, such as cars, bananas, road signs, etc. - -#### The problem? - -The biggest problem with Haar cascades is getting the detectMultiScale parameters right, specifically scaleFactor and minNeighbors . You can easily run into situations where you need to tune both of these parameters on an image-by-image basis, which is far from ideal when utilizing an object detector. - -The scaleFactor variable controls your [image pyramid][8] used to detect objects at various scales of an image. If your scaleFactor is too large, then you’ll only evaluate a few layers of the image pyramid, potentially leading to you missing objects at scales that fall in between the pyramid layers. - -On the other hand, if you set scaleFactor too low, then you evaluate many pyramid layers. This will help you detect more objects in your image, but it (1) makes the detection process slower and (2) substantially increases the false-positive detection rate, something that Haar cascades are known for. - -To remember this, we often apply [Histogram of Oriented Gradients + Linear SVM detection][9] instead. - -The HOG + Linear SVM framework parameters are normally much easier to tune — and best of all, HOG + Linear SVM enjoys a much smaller false-positive detection rate. The only downside is that it’s harder to get HOG + Linear SVM to run in real-time. - -### Interested in learning more about object detection? - -![](http://www.pyimagesearch.com/wp-content/uploads/2016/05/custom_object_detector_example.jpg) ->Figure 5: Learn how to build custom object detectors inside the PyImageSearch Gurus course. - -If you’re interested in learning how to train your own custom object detectors, be sure to take a look at the PyImageSearch Gurus course. - -Inside the course, I have 15 lessons covering 168 pages of tutorials dedicated to teaching you how to build custom object detectors from scratch. You’ll discover how to detect road signs, faces, cars (and nearly any other object) in images by applying the HOG + Linear SVM framework for object detection. - -To learn more about the PyImageSearch Gurus course (and grab 10 FREE sample lessons), just click the button below: - -### Summary - -In this blog post, we learned how to detect cats in images using the default Haar cascades shipped with OpenCV. These Haar cascades were trained and contributed to the OpenCV project by [Joseph Howse][9], and were originally brought to my attention [in this post][10] by Kendrick Tan. - -While Haar cascades are quite useful, we often use HOG + Linear SVM instead, as it’s a bit easier to tune the detector parameters, and more importantly, we can enjoy a much lower false-positive detection rate. - -I detail how to build custom HOG + Linear SVM object detectors to recognize various objects in images, including cars, road signs, and much more [inside the PyImageSearch Gurus course][11]. - -Anyway, I hope you enjoyed this blog post! - -Before you go, be sure to signup for the PyImageSearch Newsletter using the form below to be notified when new blog posts are published. - --------------------------------------------------------------------------------- - -via: http://www.pyimagesearch.com/2016/06/20/detecting-cats-in-images-with-opencv/ - -作者:[Adrian Rosebrock][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://www.pyimagesearch.com/author/adrian/ -[1]: http://kendricktan.github.io/find-cats-in-photos-using-computer-vision.html -[2]: http://www.pyimagesearch.com/2016/06/20/detecting-cats-in-images-with-opencv/# -[3]: https://github.com/Itseez/opencv -[4]: https://github.com/Itseez/opencv/tree/master/data/haarcascades -[5]: http://nummist.com/ -[6]: http://www.pyimagesearch.com/2015/03/16/image-pyramids-with-python-and-opencv/ -[7]: https://www.cs.cmu.edu/~efros/courses/LBMV07/Papers/viola-cvpr-01.pdf -[8]: http://www.pyimagesearch.com/2015/03/16/image-pyramids-with-python-and-opencv/ -[9]: http://www.pyimagesearch.com/2014/11/10/histogram-oriented-gradients-object-detection/ -[10]: http://kendricktan.github.io/find-cats-in-photos-using-computer-vision.html -[11]: https://www.pyimagesearch.com/pyimagesearch-gurus/ - - - diff --git a/translated/tech/20160620 Detecting cats in images with OpenCV.md b/translated/tech/20160620 Detecting cats in images with OpenCV.md new file mode 100644 index 0000000000..9b1e19fef7 --- /dev/null +++ b/translated/tech/20160620 Detecting cats in images with OpenCV.md @@ -0,0 +1,228 @@ +使用 OpenCV 识别图片中的猫 +======================================= + +![](http://www.pyimagesearch.com/wp-content/uploads/2016/05/cat_face_detector_result_04.jpg) + +你知道 OpenCV 可以识别在图片中识别猫脸吗?还是在开箱即用的情况下,无需多余的附件。 + +我也不知道。 + +但是在看完'[Kendrick Tan broke the story][1]'这个故事之后, 我需要亲自体验一下...去看看到OpenCV 是如何在我没有察觉到的情况下,将这一个功能添加进了他的软件库。 + +作为这个博客的大纲,我将会展示如何使用 OpenCV 的猫检测器在图片中识别猫脸。同样的,你也可以在视频流中使用该技术。 + +> 想找这篇博客的源码?[请点这][2]。 + + +### 使用 OpenCV 在图片中检测猫 + +如果你看一眼[OpenCV 的代码库][3],尤其是在[haarcascades 目录][4](OpenCV 用来保存处理他对多种目标检测的Cascade预先训练的级联图像分类), 你将会注意到这两个文件: + +- haarcascade_frontalcatface.xml +- haarcascade_frontalcatface_extended.xml + +这两个 Haar Cascade 文件都将被用来在图片中检测猫脸。实际上,我使用了相同的方式来生成这篇博客顶端的图片。 + +在做了一些调查工作之后,我发现训练这些记过并且将其提供给 OpenCV 仓库的是鼎鼎大名的 [Joseph Howse][5],他在计算机视觉领域有着很高的声望。 + +在博客的剩余部分,我将会展示给你如何使用 Howse 的 Haar 级联模型来检测猫。 + +让我们开工。新建一个叫 cat_detector.py 的文件,并且输入如下的代码: + +### 使用 OpenCVPython 来检测猫 + +``` +# import the necessary packages +import argparse +import cv2 + +# construct the argument parse and parse the arguments +ap = argparse.ArgumentParser() +ap.add_argument("-i", "--image", required=True, + help="path to the input image") +ap.add_argument("-c", "--cascade", + default="haarcascade_frontalcatface.xml", + help="path to cat detector haar cascade") +args = vars(ap.parse_args()) +``` + +第2和第3行主要是导入了必要的 python 包。6-12行主要是我们的命令行参数。我们在这只需要使用单独的参数'--image'。 + +我们可以指定一个 Haar cascade 的路径通过 `--cascade` 参数。默认使用 `haarcascades_frontalcatface.xml`,同时需要保证这个文件和你的 `cat_detector.py` 在同一目录下。 + +注意:我已经打包了猫的检测代码,还有在这个教程里的样本图片。你可以在博客的'Downloads' 部分下载到。如果你是刚刚接触 Python+OpenCV(或者 Haar 级联模型), 我会建议你下载 zip 压缩包,这个会方便你进行操作。 + +接下来,就是检测猫的时刻了: + +``` +# load the input image and convert it to grayscale +image = cv2.imread(args["image"]) +gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) + +# load the cat detector Haar cascade, then detect cat faces +# in the input image +detector = cv2.CascadeClassifier(args["cascade"]) +rects = detector.detectMultiScale(gray, scaleFactor=1.3, + minNeighbors=10, minSize=(75, 75)) +``` + +在15,16行,我们从硬盘上读取了图片,并且进行灰度化(一个常用的图片预处理,方便 Haar cascade 进行分类,尽管不是必须) + +20行,我们加载了Haar casacade,即猫检测器,并且初始化了 cv2.CascadeClassifier 对象。 + +使用 OpenCV 检测猫脸的步骤是21,22行,通过调用 detectMultiScale 方法。我们使用四个参数来调用。包括: + +1. 灰度化的图片,即样本图片。 +2. scaleFactor 参数,[图片金字塔][6]使用的检测猫脸时的检测粒度。一个更大的粒度将会加快检测的速度,但是会对准确性产生影响。相反的,一个更小的粒度将会影响检测的时间,但是会增加正确性。但是,细粒度也会增加错误的检测数量。你可以看博客的 'Haar 级联模型笔记' 部分来获得更多的信息。 +3. minNeighbors 参数控制了检测的最小数量,即在给定区域最小的检测猫脸的次数。这个参数很好的可以排除错误的检测结果。 +4. 最后,minSize 参数很好的自我说明了用途。即最后图片的最小大小,这个例子中就是 75\*75 + +detectMultiScale 函数 return rects,这是一个4维数组链表。这些item 中包含了猫脸的(x,y)坐标值,还有宽度,高度。 + +最后,让我们在图片上画下这些矩形来标识猫脸: + +``` +# loop over the cat faces and draw a rectangle surrounding each +for (i, (x, y, w, h)) in enumerate(rects): + cv2.rectangle(image, (x, y), (x + w, y + h), (0, 0, 255), 2) + cv2.putText(image, "Cat #{}".format(i + 1), (x, y - 10), + cv2.FONT_HERSHEY_SIMPLEX, 0.55, (0, 0, 255), 2) + +# show the detected cat faces +cv2.imshow("Cat Faces", image) +cv2.waitKey(0) +``` + +给相关的区域(举个例子,rects),我们在25行依次历遍它。 + +在26行,我们在每张猫脸的周围画上一个矩形。27,28行展示了一个整数,即图片中猫的数量。 + +最后,31,32行在屏幕上展示了输出的图片。 + +### 猫检测结果 + +为了测试我们的 OpenCV 毛检测器,可以在文章的最后,下载教程的源码。 + +然后,在你解压缩之后,你将会得到如下的三个文件/目录: + +1. cat_detector.py:我们的主程序 +2. haarcascade_frontalcatface.xml: Haar cascade 猫检测资源 +3. images:我们将会使用的检测图片目录。 + +到这一步,执行以下的命令: + +使用 OpenCVShell 检测猫。 + +``` +$ python cat_detector.py --image images/cat_01.jpg +``` + +![](http://www.pyimagesearch.com/wp-content/uploads/2016/05/cat_face_detector_result_01.jpg) +>1. 在图片中检测猫脸,甚至是猫的一部分。 + +注意,我们已经可以检测猫脸了,即使他的其余部分是被隐藏的。 + +试下另外的一张图片: + +``` +python cat_detector.py --image images/cat_02.jpg +``` + +![](http://www.pyimagesearch.com/wp-content/uploads/2016/05/cat_face_detector_result_02.jpg) +>2. 第二个例子就是在略微不同的猫脸中检测。 + +这次的猫脸和第一次的明显不同,因为它在'Meow'的中央。这种情况下,我们依旧能检测到正确的猫脸。 + +这张图片的结果也是正确的: + +``` +$ python cat_detector.py --image images/cat_03.jpg +``` + +![](http://www.pyimagesearch.com/wp-content/uploads/2016/05/cat_face_detector_result_03.jpg) +>3. 使用 OpenCV 和 python 检测猫脸 + +我们最后的一个样例就是在一张图中检测多张猫脸: + +``` +$ python cat_detector.py --image images/cat_04.jpg +``` + +![](http://www.pyimagesearch.com/wp-content/uploads/2016/05/cat_face_detector_result_04.jpg) +>Figure 4: Detecting multiple cats in the same image with OpenCV +>4. 在同一张图片中使用 OpenCV 检测多只猫 + +注意,Haar cascade 的返回值并不是有序的。这种情况下,中间的那只猫会被标记成第三只。你可以通过判断他们的(x, y)坐标来自己排序。 + +#### 精度的 Tips + +xml 文件中的注释,非常重要,Joseph Hower 提到了猫 脸检测器有可能会将人脸识别成猫脸。 + +这种情况下,他推荐使用两种检测器(人脸&猫脸),然后将出现在人脸识别结果中的结果剔除掉。 + +#### Haar 级联模型注意事项 + +这个方法首先出现在 Paul Viola 和 Michael Jones 2001 年发布的 [Rapid Object Detection using a Boosted Cascade of Simple Features] 论文中。现在它已经成为了计算机识别领域引用最多的成果之一。 + +这个算法能够识别图片中的对象,无论地点,规模。并且,他也能在现有的硬件条件下实现实时计算。 + +在他们的论文中,Viola 和 Jones 关注在训练人脸检测器;但是,这个框架也能用来检测各类事物,如汽车,香蕉,路标等等。 + +#### 有问题? + +Haar 级联模型最大的问题就是如何确定 detectMultiScale 方法的参数正确。特别是 scaleFactor 和 minNeighbors 参数。你很容易陷入,一张一张图片调参数的坑,这个就是该模型很难被实用化的原因。 + +这个 scaleFactor 变量控制了用来检测图片各种对象的[图像棱锥图][8]。如何参数过大,你就会得到更少的特征值,这会导致你无法在图层中识别一些目标。 + +换句话说,如果参数过低,你会检测出过多的图层。这虽然可以能帮助你检测更多的对象。但是他会造成计算速度的降低还会提高错误率。 + +为了避免这个,我们通常使用[Histogram of Oriented Gradients + Linear SVM detection][9]。 + +HOG + 线性 SVM 框架,它的参数更加容易的进行调优。而且也有更低的错误识别率,但是最大的缺点及时无法实时运算。 + +### 对对象识别感兴趣?并且希望了解更多? + +![](http://www.pyimagesearch.com/wp-content/uploads/2016/05/custom_object_detector_example.jpg) +>5. 在 PyImageSearch Gurus 课程中学习如何构建自定义的对象识别器。 + +如果你对学习如何训练自己的自定义对象识别器,请务必要去学习 PyImageSearch Gurus 的课程。 + +在这个课程中,我提供了15节课还有超过168页的教程,来教你如何从0开始构建自定义的对象识别器。你会掌握如何应用 HOG+线性 SVM 计算框架来构建自己的对象识别器。 + +### 总结 + +在这篇博客里,我们学习了如何使用默认的 Haar 级联模型来识别图片中的猫脸。这些 Haar casacades 是通过[Joseph Howse][9] 贡献给 OpenCV 项目的。我是在[这篇文章][10]中开始注意到这个。 + +尽管 Haar 级联模型相当有用,但是我们也经常用 HOG 和 线性 SVM 替代。因为后者相对而言更容易使用,并且可以有效地降低错误的识别概率。 + +我也会在[在 PyImageSearch Gurus 的课程中][11]详细的讲述如何使用 HOG 和线性 SVM 对象识别器,来识别包括汽车,路标在内的各种事物。 + +不管怎样,我希望你享受这篇博客。 + +在你离开之前,确保你会使用这下面的表单注册 PyImageSearch Newsletter。这样你能收到最新的消息。 + +-------------------------------------------------------------------------------- + +via: http://www.pyimagesearch.com/2016/06/20/detecting-cats-in-images-with-opencv/ + +作者:[Adrian Rosebrock][a] +译者:[译者ID](https://github.com/MikeCoder) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.pyimagesearch.com/author/adrian/ +[1]: http://kendricktan.github.io/find-cats-in-photos-using-computer-vision.html +[2]: http://www.pyimagesearch.com/2016/06/20/detecting-cats-in-images-with-opencv/# +[3]: https://github.com/Itseez/opencv +[4]: https://github.com/Itseez/opencv/tree/master/data/haarcascades +[5]: http://nummist.com/ +[6]: http://www.pyimagesearch.com/2015/03/16/image-pyramids-with-python-and-opencv/ +[7]: https://www.cs.cmu.edu/~efros/courses/LBMV07/Papers/viola-cvpr-01.pdf +[8]: http://www.pyimagesearch.com/2015/03/16/image-pyramids-with-python-and-opencv/ +[9]: http://www.pyimagesearch.com/2014/11/10/histogram-oriented-gradients-object-detection/ +[10]: http://kendricktan.github.io/find-cats-in-photos-using-computer-vision.html +[11]: https://www.pyimagesearch.com/pyimagesearch-gurus/ + + + From 781d751e3718a4ffa4a1d3c341f8b520021959df Mon Sep 17 00:00:00 2001 From: cposture Date: Sat, 9 Jul 2016 21:15:36 +0800 Subject: [PATCH 1108/1469] Translated by cposture --- .../tech/20160512 Bitmap in Linux Kernel.md | 398 ----------------- .../tech/20160512 Bitmap in Linux Kernel.md | 405 ++++++++++++++++++ 2 files changed, 405 insertions(+), 398 deletions(-) delete mode 100644 sources/tech/20160512 Bitmap in Linux Kernel.md create mode 100644 translated/tech/20160512 Bitmap in Linux Kernel.md diff --git a/sources/tech/20160512 Bitmap in Linux Kernel.md b/sources/tech/20160512 Bitmap in Linux Kernel.md deleted file mode 100644 index adffc9d049..0000000000 --- a/sources/tech/20160512 Bitmap in Linux Kernel.md +++ /dev/null @@ -1,398 +0,0 @@ -[Translating by cposture 2016.06.29] -Data Structures in the Linux Kernel -================================================================================ - -Bit arrays and bit operations in the Linux kernel --------------------------------------------------------------------------------- - -Besides different [linked](https://en.wikipedia.org/wiki/Linked_data_structure) and [tree](https://en.wikipedia.org/wiki/Tree_%28data_structure%29) based data structures, the Linux kernel provides [API](https://en.wikipedia.org/wiki/Application_programming_interface) for [bit arrays](https://en.wikipedia.org/wiki/Bit_array) or `bitmap`. Bit arrays are heavily used in the Linux kernel and following source code files contain common `API` for work with such structures: - -* [lib/bitmap.c](https://github.com/torvalds/linux/blob/master/lib/bitmap.c) -* [include/linux/bitmap.h](https://github.com/torvalds/linux/blob/master/include/linux/bitmap.h) - -Besides these two files, there is also architecture-specific header file which provides optimized bit operations for certain architecture. We consider [x86_64](https://en.wikipedia.org/wiki/X86-64) architecture, so in our case it will be: - -* [arch/x86/include/asm/bitops.h](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) - -header file. As I just wrote above, the `bitmap` is heavily used in the Linux kernel. For example a `bit array` is used to store set of online/offline processors for systems which support [hot-plug](https://www.kernel.org/doc/Documentation/cpu-hotplug.txt) cpu (more about this you can read in the [cpumasks](https://0xax.gitbooks.io/linux-insides/content/Concepts/cpumask.html) part), a `bit array` stores set of allocated [irqs](https://en.wikipedia.org/wiki/Interrupt_request_%28PC_architecture%29) during initialization of the Linux kernel and etc. - -So, the main goal of this part is to see how `bit arrays` are implemented in the Linux kernel. Let's start. - -Declaration of bit array -================================================================================ - -Before we will look on `API` for bitmaps manipulation, we must know how to declare it in the Linux kernel. There are two common method to declare own bit array. The first simple way to declare a bit array is to array of `unsigned long`. For example: - -```C -unsigned long my_bitmap[8] -``` - -The second way is to use the `DECLARE_BITMAP` macro which is defined in the [include/linux/types.h](https://github.com/torvalds/linux/blob/master/include/linux/types.h) header file: - -```C -#define DECLARE_BITMAP(name,bits) \ - unsigned long name[BITS_TO_LONGS(bits)] -``` - -We can see that `DECLARE_BITMAP` macro takes two parameters: - -* `name` - name of bitmap; -* `bits` - amount of bits in bitmap; - -and just expands to the definition of `unsigned long` array with `BITS_TO_LONGS(bits)` elements, where the `BITS_TO_LONGS` macro converts a given number of bits to number of `longs` or in other words it calculates how many `8` byte elements in `bits`: - -```C -#define BITS_PER_BYTE 8 -#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) -#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) -``` - -So, for example `DECLARE_BITMAP(my_bitmap, 64)` will produce: - -```python ->>> (((64) + (64) - 1) / (64)) -1 -``` - -and: - -```C -unsigned long my_bitmap[1]; -``` - -After we are able to declare a bit array, we can start to use it. - -Architecture-specific bit operations -================================================================================ - -We already saw above a couple of source code and header files which provide [API](https://en.wikipedia.org/wiki/Application_programming_interface) for manipulation of bit arrays. The most important and widely used API of bit arrays is architecture-specific and located as we already know in the [arch/x86/include/asm/bitops.h](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) header file. - -First of all let's look at the two most important functions: - -* `set_bit`; -* `clear_bit`. - -I think that there is no need to explain what these function do. This is already must be clear from their name. Let's look on their implementation. If you will look into the [arch/x86/include/asm/bitops.h](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) header file, you will note that each of these functions represented by two variants: [atomic](https://en.wikipedia.org/wiki/Linearizability) and not. Before we will start to dive into implementations of these functions, first of all we must to know a little about `atomic` operations. - -In simple words atomic operations guarantees that two or more operations will not be performed on the same data concurrently. The `x86` architecture provides a set of atomic instructions, for example [xchg](http://x86.renejeschke.de/html/file_module_x86_id_328.html) instruction, [cmpxchg](http://x86.renejeschke.de/html/file_module_x86_id_41.html) instruction and etc. Besides atomic instructions, some of non-atomic instructions can be made atomic with the help of the [lock](http://x86.renejeschke.de/html/file_module_x86_id_159.html) instruction. It is enough to know about atomic operations for now, so we can begin to consider implementation of `set_bit` and `clear_bit` functions. - -First of all, let's start to consider `non-atomic` variants of this function. Names of non-atomic `set_bit` and `clear_bit` starts from double underscore. As we already know, all of these functions are defined in the [arch/x86/include/asm/bitops.h](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) header file and the first function is `__set_bit`: - -```C -static inline void __set_bit(long nr, volatile unsigned long *addr) -{ - asm volatile("bts %1,%0" : ADDR : "Ir" (nr) : "memory"); -} -``` - -As we can see it takes two arguments: - -* `nr` - number of bit in a bit array. -* `addr` - address of a bit array where we need to set bit. - -Note that the `addr` parameter is defined with `volatile` keyword which tells to compiler that value maybe changed by the given address. The implementation of the `__set_bit` is pretty easy. As we can see, it just contains one line of [inline assembler](https://en.wikipedia.org/wiki/Inline_assembler) code. In our case we are using the [bts](http://x86.renejeschke.de/html/file_module_x86_id_25.html) instruction which selects a bit which is specified with the first operand (`nr` in our case) from the bit array, stores the value of the selected bit in the [CF](https://en.wikipedia.org/wiki/FLAGS_register) flags register and set this bit. - -Note that we can see usage of the `nr`, but there is `addr` here. You already might guess that the secret is in `ADDR`. The `ADDR` is the macro which is defined in the same header code file and expands to the string which contains value of the given address and `+m` constraint: - -```C -#define ADDR BITOP_ADDR(addr) -#define BITOP_ADDR(x) "+m" (*(volatile long *) (x)) -``` - -Besides the `+m`, we can see other constraints in the `__set_bit` function. Let's look on they and try to understand what do they mean: - -* `+m` - represents memory operand where `+` tells that the given operand will be input and output operand; -* `I` - represents integer constant; -* `r` - represents register operand - -Besides these constraint, we also can see - the `memory` keyword which tells compiler that this code will change value in memory. That's all. Now let's look at the same function but at `atomic` variant. It looks more complex that its `non-atomic` variant: - -```C -static __always_inline void -set_bit(long nr, volatile unsigned long *addr) -{ - if (IS_IMMEDIATE(nr)) { - asm volatile(LOCK_PREFIX "orb %1,%0" - : CONST_MASK_ADDR(nr, addr) - : "iq" ((u8)CONST_MASK(nr)) - : "memory"); - } else { - asm volatile(LOCK_PREFIX "bts %1,%0" - : BITOP_ADDR(addr) : "Ir" (nr) : "memory"); - } -} -``` - -First of all note that this function takes the same set of parameters that `__set_bit`, but additionally marked with the `__always_inline` attribute. The `__always_inline` is macro which defined in the [include/linux/compiler-gcc.h](https://github.com/torvalds/linux/blob/master/include/linux/compiler-gcc.h) and just expands to the `always_inline` attribute: - -```C -#define __always_inline inline __attribute__((always_inline)) -``` - -which means that this function will be always inlined to reduce size of the Linux kernel image. Now let's try to understand implementation of the `set_bit` function. First of all we check a given number of bit at the beginning of the `set_bit` function. The `IS_IMMEDIATE` macro defined in the same [header](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) file and expands to the call of the builtin [gcc](https://en.wikipedia.org/wiki/GNU_Compiler_Collection) function: - -```C -#define IS_IMMEDIATE(nr) (__builtin_constant_p(nr)) -``` - -The `__builtin_constant_p` builtin function returns `1` if the given parameter is known to be constant at compile-time and returns `0` in other case. We no need to use slow `bts` instruction to set bit if the given number of bit is known in compile time constant. We can just apply [bitwise or](https://en.wikipedia.org/wiki/Bitwise_operation#OR) for byte from the give address which contains given bit and masked number of bits where high bit is `1` and other is zero. In other case if the given number of bit is not known constant at compile-time, we do the same as we did in the `__set_bit` function. The `CONST_MASK_ADDR` macro: - -```C -#define CONST_MASK_ADDR(nr, addr) BITOP_ADDR((void *)(addr) + ((nr)>>3)) -``` - -expands to the give address with offset to the byte which contains a given bit. For example we have address `0x1000` and the number of bit is `0x9`. So, as `0x9` is `one byte + one bit` our address with be `addr + 1`: - -```python ->>> hex(0x1000 + (0x9 >> 3)) -'0x1001' -``` - -The `CONST_MASK` macro represents our given number of bit as byte where high bit is `1` and other bits are `0`: - -```C -#define CONST_MASK(nr) (1 << ((nr) & 7)) -``` - -```python ->>> bin(1 << (0x9 & 7)) -'0b10' -``` - -In the end we just apply bitwise `or` for these values. So, for example if our address will be `0x4097` and we need to set `0x9` bit: - -```python ->>> bin(0x4097) -'0b100000010010111' ->>> bin((0x4097 >> 0x9) | (1 << (0x9 & 7))) -'0b100010' -``` - -the `ninth` bit will be set. - -Note that all of these operations are marked with `LOCK_PREFIX` which is expands to the [lock](http://x86.renejeschke.de/html/file_module_x86_id_159.html) instruction which guarantees atomicity of this operation. - -As we already know, besides the `set_bit` and `__set_bit` operations, the Linux kernel provides two inverse functions to clear bit in atomic and non-atomic context. They are `clear_bit` and `__clear_bit`. Both of these functions are defined in the same [header file](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) and takes the same set of arguments. But not only arguments are similar. Generally these functions are very similar on the `set_bit` and `__set_bit`. Let's look on the implementation of the non-atomic `__clear_bit` function: - -```C -static inline void __clear_bit(long nr, volatile unsigned long *addr) -{ - asm volatile("btr %1,%0" : ADDR : "Ir" (nr)); -} -``` - -Yes. As we see, it takes the same set of arguments and contains very similar block of inline assembler. It just uses the [btr](http://x86.renejeschke.de/html/file_module_x86_id_24.html) instruction instead of `bts`. As we can understand form the function's name, it clears a given bit by the given address. The `btr` instruction acts like `btr`. This instruction also selects a given bit which is specified in the first operand, stores its value in the `CF` flag register and clears this bit in the given bit array which is specifed with second operand. - -The atomic variant of the `__clear_bit` is `clear_bit`: - -```C -static __always_inline void -clear_bit(long nr, volatile unsigned long *addr) -{ - if (IS_IMMEDIATE(nr)) { - asm volatile(LOCK_PREFIX "andb %1,%0" - : CONST_MASK_ADDR(nr, addr) - : "iq" ((u8)~CONST_MASK(nr))); - } else { - asm volatile(LOCK_PREFIX "btr %1,%0" - : BITOP_ADDR(addr) - : "Ir" (nr)); - } -} -``` - -and as we can see it is very similar on `set_bit` and just contains two differences. The first difference it uses `btr` instruction to clear bit when the `set_bit` uses `bts` instruction to set bit. The second difference it uses negated mask and `and` instruction to clear bit in the given byte when the `set_bit` uses `or` instruction. - -That's all. Now we can set and clear bit in any bit array and and we can go to other operations on bitmasks. - -Most widely used operations on a bit arrays are set and clear bit in a bit array in the Linux kernel. But besides this operations it is useful to do additional operations on a bit array. Yet another widely used operation in the Linux kernel - is to know is a given bit set or not in a bit array. We can achieve this with the help of the `test_bit` macro. This macro is defined in the [arch/x86/include/asm/bitops.h](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) header file and expands to the call of the `constant_test_bit` or `variable_test_bit` depends on bit number: - -```C -#define test_bit(nr, addr) \ - (__builtin_constant_p((nr)) \ - ? constant_test_bit((nr), (addr)) \ - : variable_test_bit((nr), (addr))) -``` - -So, if the `nr` is known in compile time constant, the `test_bit` will be expanded to the call of the `constant_test_bit` function or `variable_test_bit` in other case. Now let's look at implementations of these functions. Let's start from the `variable_test_bit`: - -```C -static inline int variable_test_bit(long nr, volatile const unsigned long *addr) -{ - int oldbit; - - asm volatile("bt %2,%1\n\t" - "sbb %0,%0" - : "=r" (oldbit) - : "m" (*(unsigned long *)addr), "Ir" (nr)); - - return oldbit; -} -``` - -The `variable_test_bit` function takes similar set of arguments as `set_bit` and other function take. We also may see inline assembly code here which executes [bt](http://x86.renejeschke.de/html/file_module_x86_id_22.html) and [sbb](http://x86.renejeschke.de/html/file_module_x86_id_286.html) instruction. The `bt` or `bit test` instruction selects a given bit which is specified with first operand from the bit array which is specified with the second operand and stores its value in the [CF](https://en.wikipedia.org/wiki/FLAGS_register) bit of flags register. The second `sbb` instruction substracts first operand from second and subscrtact value of the `CF`. So, here write a value of a given bit number from a given bit array to the `CF` bit of flags register and execute `sbb` instruction which calculates: `00000000 - CF` and writes the result to the `oldbit`. - -The `constant_test_bit` function does the same as we saw in the `set_bit`: - -```C -static __always_inline int constant_test_bit(long nr, const volatile unsigned long *addr) -{ - return ((1UL << (nr & (BITS_PER_LONG-1))) & - (addr[nr >> _BITOPS_LONG_SHIFT])) != 0; -} -``` - -It generates a byte where high bit is `1` and other bits are `0` (as we saw in `CONST_MASK`) and applies bitwise [and](https://en.wikipedia.org/wiki/Bitwise_operation#AND) to the byte which contains a given bit number. - -The next widely used bit array related operation is to change bit in a bit array. The Linux kernel provides two helper for this: - -* `__change_bit`; -* `change_bit`. - -As you already can guess, these two variants are atomic and non-atomic as for example `set_bit` and `__set_bit`. For the start, let's look at the implementation of the `__change_bit` function: - -```C -static inline void __change_bit(long nr, volatile unsigned long *addr) -{ - asm volatile("btc %1,%0" : ADDR : "Ir" (nr)); -} -``` - -Pretty easy, is not it? The implementation of the `__change_bit` is the same as `__set_bit`, but instead of `bts` instruction, we are using [btc](http://x86.renejeschke.de/html/file_module_x86_id_23.html). This instruction selects a given bit from a given bit array, stores its value in the `CF` and changes its value by the applying of complement operation. So, a bit with value `1` will be `0` and vice versa: - -```python ->>> int(not 1) -0 ->>> int(not 0) -1 -``` - -The atomic version of the `__change_bit` is the `change_bit` function: - -```C -static inline void change_bit(long nr, volatile unsigned long *addr) -{ - if (IS_IMMEDIATE(nr)) { - asm volatile(LOCK_PREFIX "xorb %1,%0" - : CONST_MASK_ADDR(nr, addr) - : "iq" ((u8)CONST_MASK(nr))); - } else { - asm volatile(LOCK_PREFIX "btc %1,%0" - : BITOP_ADDR(addr) - : "Ir" (nr)); - } -} -``` - -It is similar on `set_bit` function, but also has two differences. The first difference is `xor` operation instead of `or` and the second is `bts` instead of `bts`. - -For this moment we know the most important architecture-specific operations with bit arrays. Time to look at generic bitmap API. - -Common bit operations -================================================================================ - -Besides the architecture-specific API from the [arch/x86/include/asm/bitops.h](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) header file, the Linux kernel provides common API for manipulation of bit arrays. As we know from the beginning of this part, we can find it in the [include/linux/bitmap.h](https://github.com/torvalds/linux/blob/master/include/linux/bitmap.h) header file and additionally in the * [lib/bitmap.c](https://github.com/torvalds/linux/blob/master/lib/bitmap.c) source code file. But before these source code files let's look into the [include/linux/bitops.h](https://github.com/torvalds/linux/blob/master/include/linux/bitops.h) header file which provides a set of useful macro. Let's look on some of they. - -First of all let's look at following four macros: - -* `for_each_set_bit` -* `for_each_set_bit_from` -* `for_each_clear_bit` -* `for_each_clear_bit_from` - -All of these macros provide iterator over certain set of bits in a bit array. The first macro iterates over bits which are set, the second does the same, but starts from a certain bits. The last two macros do the same, but iterates over clear bits. Let's look on implementation of the `for_each_set_bit` macro: - -```C -#define for_each_set_bit(bit, addr, size) \ - for ((bit) = find_first_bit((addr), (size)); \ - (bit) < (size); \ - (bit) = find_next_bit((addr), (size), (bit) + 1)) -``` - -As we may see it takes three arguments and expands to the loop from first set bit which is returned as result of the `find_first_bit` function and to the last bit number while it is less than given size. - -Besides these four macros, the [arch/x86/include/asm/bitops.h](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) provides API for rotation of `64-bit` or `32-bit` values and etc. - -The next [header](https://github.com/torvalds/linux/blob/master/include/linux/bitmap.h) file which provides API for manipulation with a bit arrays. For example it provdes two functions: - -* `bitmap_zero`; -* `bitmap_fill`. - -To clear a bit array and fill it with `1`. Let's look on the implementation of the `bitmap_zero` function: - -```C -static inline void bitmap_zero(unsigned long *dst, unsigned int nbits) -{ - if (small_const_nbits(nbits)) - *dst = 0UL; - else { - unsigned int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long); - memset(dst, 0, len); - } -} -``` - -First of all we can see the check for `nbits`. The `small_const_nbits` is macro which defined in the same header [file](https://github.com/torvalds/linux/blob/master/include/linux/bitmap.h) and looks: - -```C -#define small_const_nbits(nbits) \ - (__builtin_constant_p(nbits) && (nbits) <= BITS_PER_LONG) -``` - -As we may see it checks that `nbits` is known constant in compile time and `nbits` value does not overflow `BITS_PER_LONG` or `64`. If bits number does not overflow amount of bits in a `long` value we can just set to zero. In other case we need to calculate how many `long` values do we need to fill our bit array and fill it with [memset](http://man7.org/linux/man-pages/man3/memset.3.html). - -The implementation of the `bitmap_fill` function is similar on implementation of the `biramp_zero` function, except we fill a given bit array with `0xff` values or `0b11111111`: - -```C -static inline void bitmap_fill(unsigned long *dst, unsigned int nbits) -{ - unsigned int nlongs = BITS_TO_LONGS(nbits); - if (!small_const_nbits(nbits)) { - unsigned int len = (nlongs - 1) * sizeof(unsigned long); - memset(dst, 0xff, len); - } - dst[nlongs - 1] = BITMAP_LAST_WORD_MASK(nbits); -} -``` - -Besides the `bitmap_fill` and `bitmap_zero` functions, the [include/linux/bitmap.h](https://github.com/torvalds/linux/blob/master/include/linux/bitmap.h) header file provides `bitmap_copy` which is similar on the `bitmap_zero`, but just uses [memcpy](http://man7.org/linux/man-pages/man3/memcpy.3.html) instead of [memset](http://man7.org/linux/man-pages/man3/memset.3.html). Also it provides bitwise operations for bit array like `bitmap_and`, `bitmap_or`, `bitamp_xor` and etc. We will not consider implementation of these functions because it is easy to understand implementations of these functions if you understood all from this part. Anyway if you are interested how did these function implemented, you may open [include/linux/bitmap.h](https://github.com/torvalds/linux/blob/master/include/linux/bitmap.h) header file and start to research. - -That's all. - -Links -================================================================================ - -* [bitmap](https://en.wikipedia.org/wiki/Bit_array) -* [linked data structures](https://en.wikipedia.org/wiki/Linked_data_structure) -* [tree data structures](https://en.wikipedia.org/wiki/Tree_%28data_structure%29) -* [hot-plug](https://www.kernel.org/doc/Documentation/cpu-hotplug.txt) -* [cpumasks](https://0xax.gitbooks.io/linux-insides/content/Concepts/cpumask.html) -* [IRQs](https://en.wikipedia.org/wiki/Interrupt_request_%28PC_architecture%29) -* [API](https://en.wikipedia.org/wiki/Application_programming_interface) -* [atomic operations](https://en.wikipedia.org/wiki/Linearizability) -* [xchg instruction](http://x86.renejeschke.de/html/file_module_x86_id_328.html) -* [cmpxchg instruction](http://x86.renejeschke.de/html/file_module_x86_id_41.html) -* [lock instruction](http://x86.renejeschke.de/html/file_module_x86_id_159.html) -* [bts instruction](http://x86.renejeschke.de/html/file_module_x86_id_25.html) -* [btr instruction](http://x86.renejeschke.de/html/file_module_x86_id_24.html) -* [bt instruction](http://x86.renejeschke.de/html/file_module_x86_id_22.html) -* [sbb instruction](http://x86.renejeschke.de/html/file_module_x86_id_286.html) -* [btc instruction](http://x86.renejeschke.de/html/file_module_x86_id_23.html) -* [man memcpy](http://man7.org/linux/man-pages/man3/memcpy.3.html) -* [man memset](http://man7.org/linux/man-pages/man3/memset.3.html) -* [CF](https://en.wikipedia.org/wiki/FLAGS_register) -* [inline assembler](https://en.wikipedia.org/wiki/Inline_assembler) -* [gcc](https://en.wikipedia.org/wiki/GNU_Compiler_Collection) - - ------------------------------------------------------------------------------- - -via: https://github.com/0xAX/linux-insides/blob/master/DataStructures/bitmap.md - -作者:[0xAX][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://twitter.com/0xAX diff --git a/translated/tech/20160512 Bitmap in Linux Kernel.md b/translated/tech/20160512 Bitmap in Linux Kernel.md new file mode 100644 index 0000000000..6475b9260e --- /dev/null +++ b/translated/tech/20160512 Bitmap in Linux Kernel.md @@ -0,0 +1,405 @@ +--- +date: 2016-07-09 14:42 +status: public +title: 20160512 Bitmap in Linux Kernel +--- + +Linux 内核里的数据结构 +================================================================================ + +Linux 内核中的位数组和位操作 +-------------------------------------------------------------------------------- + +除了不同的基于[链式](https://en.wikipedia.org/wiki/Linked_data_structure)和[树](https://en.wikipedia.org/wiki/Tree_%28data_structure%29)的数据结构以外,Linux 内核也为[位数组](https://en.wikipedia.org/wiki/Bit_array)或`位图`提供了 [API](https://en.wikipedia.org/wiki/Application_programming_interface)。位数组在 Linux 内核里被广泛使用,并且在以下的源代码文件中包含了与这样的结构搭配使用的通用 `API`: + +* [lib/bitmap.c](https://github.com/torvalds/linux/blob/master/lib/bitmap.c) +* [include/linux/bitmap.h](https://github.com/torvalds/linux/blob/master/include/linux/bitmap.h) + +除了这两个文件之外,还有体系结构特定的头文件,它们为特定的体系结构提供优化的位操作。我们将探讨 [x86_64](https://en.wikipedia.org/wiki/X86-64) 体系结构,因此在我们的例子里,它会是 + +* [arch/x86/include/asm/bitops.h](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) + +头文件。正如我上面所写的,`位图`在 Linux 内核中被广泛地使用。例如,`位数组`常常用于保存一组在线/离线处理器,以便系统支持[热插拔](https://www.kernel.org/doc/Documentation/cpu-hotplug.txt)的 CPU(你可以在 [cpumasks](https://0xax.gitbooks.io/linux-insides/content/Concepts/cpumask.html) 部分阅读更多相关知识 ),一个`位数组`可以在 Linux 内核初始化等期间保存一组已分配的中断处理。 + +因此,本部分的主要目的是了解位数组是如何在 Linux 内核中实现的。让我们现在开始吧。 + +位数组声明 +================================================================================ + +在我们开始查看位图操作的 `API` 之前,我们必须知道如何在 Linux 内核中声明它。有两中通用的方法声明位数组。第一种简单的声明一个位数组的方法是,定义一个 unsigned long 的数组,例如: + +```C +unsigned long my_bitmap[8] +``` + +第二种方法,是使用 `DECLARE_BITMAP` 宏,它定义于 [include/linux/types.h](https://github.com/torvalds/linux/blob/master/include/linux/types.h) 头文件: + +```C +#define DECLARE_BITMAP(name,bits) \ + unsigned long name[BITS_TO_LONGS(bits)] +``` + +我们可以看到 `DECLARE_BITMAP` 宏使用两个参数: + +* `name` - 位图名称; +* `bits` - 位图中位数; + +并且只是使用 `BITS_TO_LONGS(bits)` 元素展开 `unsigned long` 数组的定义。 `BITS_TO_LONGS` 宏将一个给定的位数转换为 `longs` 的个数,换言之,就是计算 `bits` 中有多少个 `8` 字节元素: + +```C +#define BITS_PER_BYTE 8 +#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) +#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) +``` + +因此,例如 `DECLARE_BITMAP(my_bitmap, 64)` 将产生: + +```python +>>> (((64) + (64) - 1) / (64)) +1 +``` + +与: + +```C +unsigned long my_bitmap[1]; +``` + +在能够声明一个位数组之后,我们便可以使用它了。 + +体系结构特定的位操作 +================================================================================ + +我们已经看了以上一对源文件和头文件,它们提供了位数组操作的 [API](https://en.wikipedia.org/wiki/Application_programming_interface)。其中重要且广泛使用的位数组 API 是体系结构特定的且位于已提及的头文件中 [arch/x86/include/asm/bitops.h](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h)。 + +首先让我们查看两个最重要的函数: + +* `set_bit`; +* `clear_bit`. + +我认为没有必要解释这些函数的作用。从它们的名字来看,这已经很清楚了。让我们直接查看它们的实现。如果你浏览 [arch/x86/include/asm/bitops.h](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) 头文件,你将会注意到这些函数中的每一个都有[原子性](https://en.wikipedia.org/wiki/Linearizability)和非原子性两种变体。在我们开始深入这些函数的实现之前,首先,我们必须了解一些有关原子操作的知识。 + +简而言之,原子操作保证两个或以上的操作不会并发地执行同一数据。`x86` 体系结构提供了一系列原子指令,例如, [xchg](http://x86.renejeschke.de/html/file_module_x86_id_328.html)、[cmpxchg](http://x86.renejeschke.de/html/file_module_x86_id_41.html) 等指令。除了原子指令,一些非原子指令可以在 [lock](http://x86.renejeschke.de/html/file_module_x86_id_159.html) 指令的帮助下具有原子性。目前已经对原子操作有了充分的理解,我们可以接着探讨 `set_bit` 和 `clear_bit` 函数的实现。 + +我们先考虑函数的非原子性变体。非原子性的 `set_bit` 和 `clear_bit` 的名字以双下划线开始。正如我们所知道的,所有这些函数都定义于 [arch/x86/include/asm/bitops.h](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) 头文件,并且第一个函数就是 `__set_bit`: + +```C +static inline void __set_bit(long nr, volatile unsigned long *addr) +{ + asm volatile("bts %1,%0" : ADDR : "Ir" (nr) : "memory"); +} +``` + +正如我们所看到的,它使用了两个参数: + +* `nr` - 位数组中的位号(从0开始,译者注) +* `addr` - 我们需要置位的位数组地址 + +注意,`addr` 参数使用 `volatile` 关键字定义,以告诉编译器给定地址指向的变量可能会被修改。 `__set_bit` 的实现相当简单。正如我们所看到的,它仅包含一行[内联汇编代码](https://en.wikipedia.org/wiki/Inline_assembler)。在我们的例子中,我们使用 [bts](http://x86.renejeschke.de/html/file_module_x86_id_25.html) 指令,从位数组中选出一个第一操作数(我们的例子中的 `nr`),存储选出的位的值到 [CF](https://en.wikipedia.org/wiki/FLAGS_register) 标志寄存器并设置该位(即 `nr` 指定的位置为1,译者注)。 + +注意,我们了解了 `nr` 的用法,但这里还有一个参数 `addr` 呢!你或许已经猜到秘密就在 `ADDR`。 `ADDR` 是一个定义在同一头文件的宏,它展开为一个包含给定地址和 `+m` 约束的字符串: + +```C +#define ADDR BITOP_ADDR(addr) +#define BITOP_ADDR(x) "+m" (*(volatile long *) (x)) +``` + +除了 `+m` 之外,在 `__set_bit` 函数中我们可以看到其他约束。让我们查看并试图理解它们所表示的意义: + +* `+m` - 表示内存操作数,这里的 `+` 表明给定的操作数为输入输出操作数; +* `I` - 表示整型常量; +* `r` - 表示寄存器操作数 + +除了这些约束之外,我们也能看到 `memory` 关键字,其告诉编译器这段代码会修改内存中的变量。到此为止,现在我们看看相同的原子性变体函数。它看起来比非原子性变体更加复杂: + +```C +static __always_inline void +set_bit(long nr, volatile unsigned long *addr) +{ + if (IS_IMMEDIATE(nr)) { + asm volatile(LOCK_PREFIX "orb %1,%0" + : CONST_MASK_ADDR(nr, addr) + : "iq" ((u8)CONST_MASK(nr)) + : "memory"); + } else { + asm volatile(LOCK_PREFIX "bts %1,%0" + : BITOP_ADDR(addr) : "Ir" (nr) : "memory"); + } +} +``` + +(BITOP_ADDR 的定义为:`#define BITOP_ADDR(x) "=m" (*(volatile long *) (x))`,ORB 为字节按位或,译者注) + +首先注意,这个函数使用了与 `__set_bit` 相同的参数集合,但额外地使用了 `__always_inline` 属性标记。 `__always_inline` 是一个定义于 [include/linux/compiler-gcc.h](https://github.com/torvalds/linux/blob/master/include/linux/compiler-gcc.h) 的宏,并且只是展开为 `always_inline` 属性: + +```C +#define __always_inline inline __attribute__((always_inline)) +``` + +其意味着这个函数总是内联的,以减少 Linux 内核映像的大小。现在我们试着了解 `set_bit` 函数的实现。首先我们在 `set_bit` 函数的开头检查给定的位数量。`IS_IMMEDIATE` 宏定义于相同[头文件](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h),并展开为 gcc 内置函数的调用: + +```C +#define IS_IMMEDIATE(nr) (__builtin_constant_p(nr)) +``` + +如果给定的参数是编译期已知的常量,`__builtin_constant_p` 内置函数则返回 `1`,其他情况返回 `0`。假若给定的位数是编译期已知的常量,我们便无须使用效率低下的 `bts` 指令去设置位。我们可以只需在给定地址指向的字节和和掩码上执行 [按位或](https://en.wikipedia.org/wiki/Bitwise_operation#OR) 操作,其字节包含给定的位,而掩码为位号高位 `1`,其他位为 0。在其他情况下,如果给定的位号不是编译期已知常量,我们便做和 `__set_bit` 函数一样的事。`CONST_MASK_ADDR` 宏: + +```C +#define CONST_MASK_ADDR(nr, addr) BITOP_ADDR((void *)(addr) + ((nr)>>3)) +``` + +展开为带有到包含给定位的字节偏移的给定地址,例如,我们拥有地址 `0x1000` 和 位号是 `0x9`。因为 `0x9` 是 `一个字节 + 一位`,所以我们的地址是 `addr + 1`: + +```python +>>> hex(0x1000 + (0x9 >> 3)) +'0x1001' +``` + +`CONST_MASK` 宏将我们给定的位号表示为字节,位号对应位为高位 `1`,其他位为 `0`: + +```C +#define CONST_MASK(nr) (1 << ((nr) & 7)) +``` + +```python +>>> bin(1 << (0x9 & 7)) +'0b10' +``` + +最后,我们应用 `按位或` 运算到这些变量上面,因此,假如我们的地址是 `0x4097` ,并且我们需要置位号为 `9` 的位 为 1: + +```python +>>> bin(0x4097) +'0b100000010010111' +>>> bin((0x4097 >> 0x9) | (1 << (0x9 & 7))) +'0b100010' +``` + +`第 9 位` 将会被置位。(这里的 9 是从 0 开始计数的,比如0010,按照作者的意思,其中的 1 是第 1 位,译者注) + +注意,所有这些操作使用 `LOCK_PREFIX` 标记,其展开为 [lock](http://x86.renejeschke.de/html/file_module_x86_id_159.html) 指令,保证该操作的原子性。 + +正如我们所知,除了 `set_bit` 和 `__set_bit` 操作之外,Linux 内核还提供了两个功能相反的函数,在原子性和非原子性的上下文中清位。它们为 `clear_bit` 和 `__clear_bit`。这两个函数都定义于同一个[头文件](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) 并且使用相同的参数集合。不仅参数相似,一般而言,这些函数与 `set_bit` 和 `__set_bit` 也非常相似。让我们查看非原子性 `__clear_bit` 的实现吧: + +```C +static inline void __clear_bit(long nr, volatile unsigned long *addr) +{ + asm volatile("btr %1,%0" : ADDR : "Ir" (nr)); +} +``` + +没错,正如我们所见,`__clear_bit` 使用相同的参数集合,并包含极其相似的内联汇编代码块。它仅仅使用 [btr](http://x86.renejeschke.de/html/file_module_x86_id_24.html) 指令替换 `bts`。正如我们从函数名所理解的一样,通过给定地址,它清除了给定的位。`btr` 指令表现得像 `bts`(原文这里为 btr,可能为笔误,修正为 bts,译者注)。该指令选出第一操作数指定的位,存储它的值到 `CF` 标志寄存器,并且清楚第二操作数指定的位数组中的对应位。 + +`__clear_bit` 的原子性变体为 `clear_bit`: + +```C +static __always_inline void +clear_bit(long nr, volatile unsigned long *addr) +{ + if (IS_IMMEDIATE(nr)) { + asm volatile(LOCK_PREFIX "andb %1,%0" + : CONST_MASK_ADDR(nr, addr) + : "iq" ((u8)~CONST_MASK(nr))); + } else { + asm volatile(LOCK_PREFIX "btr %1,%0" + : BITOP_ADDR(addr) + : "Ir" (nr)); + } +} +``` + +并且正如我们所看到的,它与 `set_bit` 非常相似,同时只包含了两处差异。第一处差异为 `clear_bit` 使用 `btr` 指令来清位,而 `set_bit` 使用 `bts` 指令来置位。第二处差异为 `clear_bit` 使用否定的位掩码和 `按位与` 在给定的字节上置位,而 `set_bit` 使用 `按位或` 指令。 + +到此为止,我们可以在任何位数组置位和清位了,并且能够转到位掩码上的其他操作。 + +在 Linux 内核位数组上最广泛使用的操作是设置和清除位,但是除了这两个操作外,位数组上其他操作也是非常有用的。Linux 内核里另一种广泛使用的操作是知晓位数组中一个给定的位是否被置位。我们能够通过 `test_bit` 宏的帮助实现这一功能。这个宏定义于 [arch/x86/include/asm/bitops.h](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) 头文件,并展开为 `constant_test_bit` 或 `variable_test_bit` 的调用,这要取决于位号。 + +```C +#define test_bit(nr, addr) \ + (__builtin_constant_p((nr)) \ + ? constant_test_bit((nr), (addr)) \ + : variable_test_bit((nr), (addr))) +``` + +因此,如果 `nr` 是编译期已知常量,`test_bit` 将展开为 `constant_test_bit` 函数的调用,而其他情况则为 `variable_test_bit`。现在让我们看看这些函数的实现,我们从 `variable_test_bit` 开始看起: + +```C +static inline int variable_test_bit(long nr, volatile const unsigned long *addr) +{ + int oldbit; + + asm volatile("bt %2,%1\n\t" + "sbb %0,%0" + : "=r" (oldbit) + : "m" (*(unsigned long *)addr), "Ir" (nr)); + + return oldbit; +} +``` + +`variable_test_bit` 函数调用了与 `set_bit` 及其他函数使用的相似的参数集合。我们也可以看到执行 [bt](http://x86.renejeschke.de/html/file_module_x86_id_22.html) 和 [sbb](http://x86.renejeschke.de/html/file_module_x86_id_286.html) 指令的内联汇编代码。`bt` 或 `bit test` 指令从第二操作数指定的位数组选出第一操作数指定的一个指定位,并且将该位的值存进标志寄存器的 [CF](https://en.wikipedia.org/wiki/FLAGS_register) 位。第二个指令 `sbb` 从第二操作数中减去第一操作数,再减去 `CF` 的值。因此,这里将一个从给定位数组中的给定位号的值写进标志寄存器的 `CF` 位,并且执行 `sbb` 指令计算: `00000000 - CF`,并将结果写进 `oldbit` 变量。 + +`constant_test_bit` 函数做了和我们在 `set_bit` 所看到的一样的事: + +```C +static __always_inline int constant_test_bit(long nr, const volatile unsigned long *addr) +{ + return ((1UL << (nr & (BITS_PER_LONG-1))) & + (addr[nr >> _BITOPS_LONG_SHIFT])) != 0; +} +``` + +它生成了一个位号对应位为高位 `1`,而其他位为 `0` 的字节(正如我们在 `CONST_MASK` 所看到的),并将 [按位与](https://en.wikipedia.org/wiki/Bitwise_operation#AND) 应用于包含给定位号的字节。 + +下一广泛使用的位数组相关操作是改变一个位数组中的位。为此,Linux 内核提供了两个辅助函数: + +* `__change_bit`; +* `change_bit`. + +你可能已经猜测到,就拿 `set_bit` 和 `__set_bit` 例子说,这两个变体分别是原子和非原子版本。首先,让我们看看 `__change_bit` 函数的实现: + +```C +static inline void __change_bit(long nr, volatile unsigned long *addr) +{ + asm volatile("btc %1,%0" : ADDR : "Ir" (nr)); +} +``` + +相当简单,不是吗? `__change_bit` 的实现和 `__set_bit` 一样,只是我们使用 [btc](http://x86.renejeschke.de/html/file_module_x86_id_23.html) 替换 `bts` 指令而已。 该指令从一个给定位数组中选出一个给定位,将该为位的值存进 `CF` 并使用求反操作改变它的值,因此值为 `1` 的位将变为 `0`,反之亦然: + +```python +>>> int(not 1) +0 +>>> int(not 0) +1 +``` + + `__change_bit` 的原子版本为 `change_bit` 函数: + +```C +static inline void change_bit(long nr, volatile unsigned long *addr) +{ + if (IS_IMMEDIATE(nr)) { + asm volatile(LOCK_PREFIX "xorb %1,%0" + : CONST_MASK_ADDR(nr, addr) + : "iq" ((u8)CONST_MASK(nr))); + } else { + asm volatile(LOCK_PREFIX "btc %1,%0" + : BITOP_ADDR(addr) + : "Ir" (nr)); + } +} +``` + +它和 `set_bit` 函数很相似,但也存在两点差异。第一处差异为 `xor` 操作而不是 `or`。第二处差异为 `btc`(原文为 `bts`,为作者笔误,译者注) 而不是 `bts`。 + +目前,我们了解了最重要的体系特定的位数组操作,是时候看看一般的位图 API 了。 + +通用位操作 +================================================================================ + +除了 [arch/x86/include/asm/bitops.h](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) 中体系特定的 API 外,Linux 内核提供了操作位数组的通用 API。正如我们本部分开头所了解的一样,我们可以在 [include/linux/bitmap.h](https://github.com/torvalds/linux/blob/master/include/linux/bitmap.h) 头文件和* [lib/bitmap.c](https://github.com/torvalds/linux/blob/master/lib/bitmap.c) 源文件中找到它。但在查看这些源文件之前,我们先看看 [include/linux/bitops.h](https://github.com/torvalds/linux/blob/master/include/linux/bitops.h) 头文件,其提供了一系列有用的宏,让我们看看它们当中一部分。 + +首先我们看看以下 4 个 宏: + +* `for_each_set_bit` +* `for_each_set_bit_from` +* `for_each_clear_bit` +* `for_each_clear_bit_from` + +所有这些宏都提供了遍历位数组中某些位集合的迭代器。第一个红迭代那些被置位的位。第二个宏也是一样,但它是从某一确定位开始。最后两个宏做的一样,但是迭代那些被清位的位。让我们看看 `for_each_set_bit` 宏: + +```C +#define for_each_set_bit(bit, addr, size) \ + for ((bit) = find_first_bit((addr), (size)); \ + (bit) < (size); \ + (bit) = find_next_bit((addr), (size), (bit) + 1)) +``` + +正如我们所看到的,它使用了三个参数,并展开为一个循环,该循环从作为 `find_first_bit` 函数返回结果的第一个置位开始到最后一个置位且小于给定大小为止。 + +除了这四个宏, [arch/x86/include/asm/bitops.h](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) 也提供了 `64-bit` 或 `32-bit` 变量循环的 API 等等。 + +下一个 [头文件](https://github.com/torvalds/linux/blob/master/include/linux/bitmap.h) 提供了操作位数组的 API。例如,它提供了以下两个函数: + +* `bitmap_zero`; +* `bitmap_fill`. + +它们分别可以清除一个位数组和用 `1` 填充位数组。让我们看看 `bitmap_zero` 函数的实现: + +```C +static inline void bitmap_zero(unsigned long *dst, unsigned int nbits) +{ + if (small_const_nbits(nbits)) + *dst = 0UL; + else { + unsigned int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long); + memset(dst, 0, len); + } +} +``` + +首先我们可以看到对 `nbits` 的检查。 `small_const_nbits` 是一个定义在同一[头文件](https://github.com/torvalds/linux/blob/master/include/linux/bitmap.h) 的宏: + +```C +#define small_const_nbits(nbits) \ + (__builtin_constant_p(nbits) && (nbits) <= BITS_PER_LONG) +``` + +正如我们可以看到的,它检查 `nbits` 是否为编译期已知常量,并且其值不超过 `BITS_PER_LONG` 或 `64`。如果位数目没有超过一个 `long` 变量的位数,我们可以仅仅设置为 0。在其他情况,我们需要计算有多少个需要填充位数组的 `long` 变量并且使用 [memset](http://man7.org/linux/man-pages/man3/memset.3.html) 进行填充。 + +`bitmap_fill` 函数的实现和 `biramp_zero` 函数很相似,除了我们需要在给定的位数组中填写 `0xff` 或 `0b11111111`: + +```C +static inline void bitmap_fill(unsigned long *dst, unsigned int nbits) +{ + unsigned int nlongs = BITS_TO_LONGS(nbits); + if (!small_const_nbits(nbits)) { + unsigned int len = (nlongs - 1) * sizeof(unsigned long); + memset(dst, 0xff, len); + } + dst[nlongs - 1] = BITMAP_LAST_WORD_MASK(nbits); +} +``` + +除了 `bitmap_fill` 和 `bitmap_zero`,[include/linux/bitmap.h](https://github.com/torvalds/linux/blob/master/include/linux/bitmap.h) 头文件也提供了和 `bitmap_zero` 很相似的 `bitmap_copy`,只是仅仅使用 [memcpy](http://man7.org/linux/man-pages/man3/memcpy.3.html) 而不是 [memset](http://man7.org/linux/man-pages/man3/memset.3.html) 这点差异而已。它也提供了位数组的按位操作,像 `bitmap_and`, `bitmap_or`, `bitamp_xor`等等。我们不会探讨这些函数的实现了,因为如果你理解了本部分的所有内容,这些函数的实现是很容易理解的。无论如何,如果你对这些函数是如何实现的感兴趣,你可以打开并研究 [include/linux/bitmap.h](https://github.com/torvalds/linux/blob/master/include/linux/bitmap.h) 头文件。 + +本部分到此为止。 + +链接 +================================================================================ + +* [bitmap](https://en.wikipedia.org/wiki/Bit_array) +* [linked data structures](https://en.wikipedia.org/wiki/Linked_data_structure) +* [tree data structures](https://en.wikipedia.org/wiki/Tree_%28data_structure%29) +* [hot-plug](https://www.kernel.org/doc/Documentation/cpu-hotplug.txt) +* [cpumasks](https://0xax.gitbooks.io/linux-insides/content/Concepts/cpumask.html) +* [IRQs](https://en.wikipedia.org/wiki/Interrupt_request_%28PC_architecture%29) +* [API](https://en.wikipedia.org/wiki/Application_programming_interface) +* [atomic operations](https://en.wikipedia.org/wiki/Linearizability) +* [xchg instruction](http://x86.renejeschke.de/html/file_module_x86_id_328.html) +* [cmpxchg instruction](http://x86.renejeschke.de/html/file_module_x86_id_41.html) +* [lock instruction](http://x86.renejeschke.de/html/file_module_x86_id_159.html) +* [bts instruction](http://x86.renejeschke.de/html/file_module_x86_id_25.html) +* [btr instruction](http://x86.renejeschke.de/html/file_module_x86_id_24.html) +* [bt instruction](http://x86.renejeschke.de/html/file_module_x86_id_22.html) +* [sbb instruction](http://x86.renejeschke.de/html/file_module_x86_id_286.html) +* [btc instruction](http://x86.renejeschke.de/html/file_module_x86_id_23.html) +* [man memcpy](http://man7.org/linux/man-pages/man3/memcpy.3.html) +* [man memset](http://man7.org/linux/man-pages/man3/memset.3.html) +* [CF](https://en.wikipedia.org/wiki/FLAGS_register) +* [inline assembler](https://en.wikipedia.org/wiki/Inline_assembler) +* [gcc](https://en.wikipedia.org/wiki/GNU_Compiler_Collection) + + +------------------------------------------------------------------------------ + +via: https://github.com/0xAX/linux-insides/blob/master/DataStructures/bitmap.md + +作者:[0xAX][a] +译者:[cposture](https://github.com/cposture) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://twitter.com/0xAX \ No newline at end of file From b1cdc7fcbe2fee9dbb5ad3264d19e028d9f3b818 Mon Sep 17 00:00:00 2001 From: cposture Date: Sat, 9 Jul 2016 21:46:14 +0800 Subject: [PATCH 1109/1469] Translating by cposture --- .../tech/20160705 Create Your Own Shell in Python - Part I.md | 1 + .../tech/20160706 Create Your Own Shell in Python - Part II.md | 1 + 2 files changed, 2 insertions(+) diff --git a/sources/tech/20160705 Create Your Own Shell in Python - Part I.md b/sources/tech/20160705 Create Your Own Shell in Python - Part I.md index 9c3ffa55dd..48e84381c8 100644 --- a/sources/tech/20160705 Create Your Own Shell in Python - Part I.md +++ b/sources/tech/20160705 Create Your Own Shell in Python - Part I.md @@ -1,3 +1,4 @@ +Translating by cposture 2016.07.09 Create Your Own Shell in Python : Part I I’m curious to know how a shell (like bash, csh, etc.) works internally. So, I implemented one called yosh (Your Own SHell) in Python to answer my own curiosity. The concept I explain in this article can be applied to other languages as well. diff --git a/sources/tech/20160706 Create Your Own Shell in Python - Part II.md b/sources/tech/20160706 Create Your Own Shell in Python - Part II.md index af0ec01b36..3154839443 100644 --- a/sources/tech/20160706 Create Your Own Shell in Python - Part II.md +++ b/sources/tech/20160706 Create Your Own Shell in Python - Part II.md @@ -1,3 +1,4 @@ +Translating by cposture 2016.07.09 Create Your Own Shell in Python - Part II =========================================== From 906b6da96425b7ba345091e788643d692ce4a043 Mon Sep 17 00:00:00 2001 From: FrankXinqi Date: Sat, 9 Jul 2016 23:52:07 +0800 Subject: [PATCH 1110/1469] Translating How bad a boss is Linus Torvalds? --- sources/talk/20151117 How bad a boss is Linus Torvalds.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/talk/20151117 How bad a boss is Linus Torvalds.md b/sources/talk/20151117 How bad a boss is Linus Torvalds.md index d593dcf697..552155a18c 100644 --- a/sources/talk/20151117 How bad a boss is Linus Torvalds.md +++ b/sources/talk/20151117 How bad a boss is Linus Torvalds.md @@ -1,3 +1,4 @@ +Translating by FrankXinqi How bad a boss is Linus Torvalds? ================================================================================ ![linus torvalds](http://images.techhive.com/images/article/2015/08/linus_torvalds-100600260-primary.idge.jpg) From 012588071ea9ffda2377d7665f4a071d35f8b308 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=AE=B6=E5=90=AF?= Date: Sat, 9 Jul 2016 23:57:15 +0800 Subject: [PATCH 1111/1469] Translated by cposture (#4164) * Translated by cposture * Translating by cposture --- .../tech/20160512 Bitmap in Linux Kernel.md | 398 ----------------- ...reate Your Own Shell in Python - Part I.md | 1 + ...eate Your Own Shell in Python - Part II.md | 1 + .../tech/20160512 Bitmap in Linux Kernel.md | 405 ++++++++++++++++++ 4 files changed, 407 insertions(+), 398 deletions(-) delete mode 100644 sources/tech/20160512 Bitmap in Linux Kernel.md create mode 100644 translated/tech/20160512 Bitmap in Linux Kernel.md diff --git a/sources/tech/20160512 Bitmap in Linux Kernel.md b/sources/tech/20160512 Bitmap in Linux Kernel.md deleted file mode 100644 index adffc9d049..0000000000 --- a/sources/tech/20160512 Bitmap in Linux Kernel.md +++ /dev/null @@ -1,398 +0,0 @@ -[Translating by cposture 2016.06.29] -Data Structures in the Linux Kernel -================================================================================ - -Bit arrays and bit operations in the Linux kernel --------------------------------------------------------------------------------- - -Besides different [linked](https://en.wikipedia.org/wiki/Linked_data_structure) and [tree](https://en.wikipedia.org/wiki/Tree_%28data_structure%29) based data structures, the Linux kernel provides [API](https://en.wikipedia.org/wiki/Application_programming_interface) for [bit arrays](https://en.wikipedia.org/wiki/Bit_array) or `bitmap`. Bit arrays are heavily used in the Linux kernel and following source code files contain common `API` for work with such structures: - -* [lib/bitmap.c](https://github.com/torvalds/linux/blob/master/lib/bitmap.c) -* [include/linux/bitmap.h](https://github.com/torvalds/linux/blob/master/include/linux/bitmap.h) - -Besides these two files, there is also architecture-specific header file which provides optimized bit operations for certain architecture. We consider [x86_64](https://en.wikipedia.org/wiki/X86-64) architecture, so in our case it will be: - -* [arch/x86/include/asm/bitops.h](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) - -header file. As I just wrote above, the `bitmap` is heavily used in the Linux kernel. For example a `bit array` is used to store set of online/offline processors for systems which support [hot-plug](https://www.kernel.org/doc/Documentation/cpu-hotplug.txt) cpu (more about this you can read in the [cpumasks](https://0xax.gitbooks.io/linux-insides/content/Concepts/cpumask.html) part), a `bit array` stores set of allocated [irqs](https://en.wikipedia.org/wiki/Interrupt_request_%28PC_architecture%29) during initialization of the Linux kernel and etc. - -So, the main goal of this part is to see how `bit arrays` are implemented in the Linux kernel. Let's start. - -Declaration of bit array -================================================================================ - -Before we will look on `API` for bitmaps manipulation, we must know how to declare it in the Linux kernel. There are two common method to declare own bit array. The first simple way to declare a bit array is to array of `unsigned long`. For example: - -```C -unsigned long my_bitmap[8] -``` - -The second way is to use the `DECLARE_BITMAP` macro which is defined in the [include/linux/types.h](https://github.com/torvalds/linux/blob/master/include/linux/types.h) header file: - -```C -#define DECLARE_BITMAP(name,bits) \ - unsigned long name[BITS_TO_LONGS(bits)] -``` - -We can see that `DECLARE_BITMAP` macro takes two parameters: - -* `name` - name of bitmap; -* `bits` - amount of bits in bitmap; - -and just expands to the definition of `unsigned long` array with `BITS_TO_LONGS(bits)` elements, where the `BITS_TO_LONGS` macro converts a given number of bits to number of `longs` or in other words it calculates how many `8` byte elements in `bits`: - -```C -#define BITS_PER_BYTE 8 -#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) -#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) -``` - -So, for example `DECLARE_BITMAP(my_bitmap, 64)` will produce: - -```python ->>> (((64) + (64) - 1) / (64)) -1 -``` - -and: - -```C -unsigned long my_bitmap[1]; -``` - -After we are able to declare a bit array, we can start to use it. - -Architecture-specific bit operations -================================================================================ - -We already saw above a couple of source code and header files which provide [API](https://en.wikipedia.org/wiki/Application_programming_interface) for manipulation of bit arrays. The most important and widely used API of bit arrays is architecture-specific and located as we already know in the [arch/x86/include/asm/bitops.h](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) header file. - -First of all let's look at the two most important functions: - -* `set_bit`; -* `clear_bit`. - -I think that there is no need to explain what these function do. This is already must be clear from their name. Let's look on their implementation. If you will look into the [arch/x86/include/asm/bitops.h](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) header file, you will note that each of these functions represented by two variants: [atomic](https://en.wikipedia.org/wiki/Linearizability) and not. Before we will start to dive into implementations of these functions, first of all we must to know a little about `atomic` operations. - -In simple words atomic operations guarantees that two or more operations will not be performed on the same data concurrently. The `x86` architecture provides a set of atomic instructions, for example [xchg](http://x86.renejeschke.de/html/file_module_x86_id_328.html) instruction, [cmpxchg](http://x86.renejeschke.de/html/file_module_x86_id_41.html) instruction and etc. Besides atomic instructions, some of non-atomic instructions can be made atomic with the help of the [lock](http://x86.renejeschke.de/html/file_module_x86_id_159.html) instruction. It is enough to know about atomic operations for now, so we can begin to consider implementation of `set_bit` and `clear_bit` functions. - -First of all, let's start to consider `non-atomic` variants of this function. Names of non-atomic `set_bit` and `clear_bit` starts from double underscore. As we already know, all of these functions are defined in the [arch/x86/include/asm/bitops.h](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) header file and the first function is `__set_bit`: - -```C -static inline void __set_bit(long nr, volatile unsigned long *addr) -{ - asm volatile("bts %1,%0" : ADDR : "Ir" (nr) : "memory"); -} -``` - -As we can see it takes two arguments: - -* `nr` - number of bit in a bit array. -* `addr` - address of a bit array where we need to set bit. - -Note that the `addr` parameter is defined with `volatile` keyword which tells to compiler that value maybe changed by the given address. The implementation of the `__set_bit` is pretty easy. As we can see, it just contains one line of [inline assembler](https://en.wikipedia.org/wiki/Inline_assembler) code. In our case we are using the [bts](http://x86.renejeschke.de/html/file_module_x86_id_25.html) instruction which selects a bit which is specified with the first operand (`nr` in our case) from the bit array, stores the value of the selected bit in the [CF](https://en.wikipedia.org/wiki/FLAGS_register) flags register and set this bit. - -Note that we can see usage of the `nr`, but there is `addr` here. You already might guess that the secret is in `ADDR`. The `ADDR` is the macro which is defined in the same header code file and expands to the string which contains value of the given address and `+m` constraint: - -```C -#define ADDR BITOP_ADDR(addr) -#define BITOP_ADDR(x) "+m" (*(volatile long *) (x)) -``` - -Besides the `+m`, we can see other constraints in the `__set_bit` function. Let's look on they and try to understand what do they mean: - -* `+m` - represents memory operand where `+` tells that the given operand will be input and output operand; -* `I` - represents integer constant; -* `r` - represents register operand - -Besides these constraint, we also can see - the `memory` keyword which tells compiler that this code will change value in memory. That's all. Now let's look at the same function but at `atomic` variant. It looks more complex that its `non-atomic` variant: - -```C -static __always_inline void -set_bit(long nr, volatile unsigned long *addr) -{ - if (IS_IMMEDIATE(nr)) { - asm volatile(LOCK_PREFIX "orb %1,%0" - : CONST_MASK_ADDR(nr, addr) - : "iq" ((u8)CONST_MASK(nr)) - : "memory"); - } else { - asm volatile(LOCK_PREFIX "bts %1,%0" - : BITOP_ADDR(addr) : "Ir" (nr) : "memory"); - } -} -``` - -First of all note that this function takes the same set of parameters that `__set_bit`, but additionally marked with the `__always_inline` attribute. The `__always_inline` is macro which defined in the [include/linux/compiler-gcc.h](https://github.com/torvalds/linux/blob/master/include/linux/compiler-gcc.h) and just expands to the `always_inline` attribute: - -```C -#define __always_inline inline __attribute__((always_inline)) -``` - -which means that this function will be always inlined to reduce size of the Linux kernel image. Now let's try to understand implementation of the `set_bit` function. First of all we check a given number of bit at the beginning of the `set_bit` function. The `IS_IMMEDIATE` macro defined in the same [header](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) file and expands to the call of the builtin [gcc](https://en.wikipedia.org/wiki/GNU_Compiler_Collection) function: - -```C -#define IS_IMMEDIATE(nr) (__builtin_constant_p(nr)) -``` - -The `__builtin_constant_p` builtin function returns `1` if the given parameter is known to be constant at compile-time and returns `0` in other case. We no need to use slow `bts` instruction to set bit if the given number of bit is known in compile time constant. We can just apply [bitwise or](https://en.wikipedia.org/wiki/Bitwise_operation#OR) for byte from the give address which contains given bit and masked number of bits where high bit is `1` and other is zero. In other case if the given number of bit is not known constant at compile-time, we do the same as we did in the `__set_bit` function. The `CONST_MASK_ADDR` macro: - -```C -#define CONST_MASK_ADDR(nr, addr) BITOP_ADDR((void *)(addr) + ((nr)>>3)) -``` - -expands to the give address with offset to the byte which contains a given bit. For example we have address `0x1000` and the number of bit is `0x9`. So, as `0x9` is `one byte + one bit` our address with be `addr + 1`: - -```python ->>> hex(0x1000 + (0x9 >> 3)) -'0x1001' -``` - -The `CONST_MASK` macro represents our given number of bit as byte where high bit is `1` and other bits are `0`: - -```C -#define CONST_MASK(nr) (1 << ((nr) & 7)) -``` - -```python ->>> bin(1 << (0x9 & 7)) -'0b10' -``` - -In the end we just apply bitwise `or` for these values. So, for example if our address will be `0x4097` and we need to set `0x9` bit: - -```python ->>> bin(0x4097) -'0b100000010010111' ->>> bin((0x4097 >> 0x9) | (1 << (0x9 & 7))) -'0b100010' -``` - -the `ninth` bit will be set. - -Note that all of these operations are marked with `LOCK_PREFIX` which is expands to the [lock](http://x86.renejeschke.de/html/file_module_x86_id_159.html) instruction which guarantees atomicity of this operation. - -As we already know, besides the `set_bit` and `__set_bit` operations, the Linux kernel provides two inverse functions to clear bit in atomic and non-atomic context. They are `clear_bit` and `__clear_bit`. Both of these functions are defined in the same [header file](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) and takes the same set of arguments. But not only arguments are similar. Generally these functions are very similar on the `set_bit` and `__set_bit`. Let's look on the implementation of the non-atomic `__clear_bit` function: - -```C -static inline void __clear_bit(long nr, volatile unsigned long *addr) -{ - asm volatile("btr %1,%0" : ADDR : "Ir" (nr)); -} -``` - -Yes. As we see, it takes the same set of arguments and contains very similar block of inline assembler. It just uses the [btr](http://x86.renejeschke.de/html/file_module_x86_id_24.html) instruction instead of `bts`. As we can understand form the function's name, it clears a given bit by the given address. The `btr` instruction acts like `btr`. This instruction also selects a given bit which is specified in the first operand, stores its value in the `CF` flag register and clears this bit in the given bit array which is specifed with second operand. - -The atomic variant of the `__clear_bit` is `clear_bit`: - -```C -static __always_inline void -clear_bit(long nr, volatile unsigned long *addr) -{ - if (IS_IMMEDIATE(nr)) { - asm volatile(LOCK_PREFIX "andb %1,%0" - : CONST_MASK_ADDR(nr, addr) - : "iq" ((u8)~CONST_MASK(nr))); - } else { - asm volatile(LOCK_PREFIX "btr %1,%0" - : BITOP_ADDR(addr) - : "Ir" (nr)); - } -} -``` - -and as we can see it is very similar on `set_bit` and just contains two differences. The first difference it uses `btr` instruction to clear bit when the `set_bit` uses `bts` instruction to set bit. The second difference it uses negated mask and `and` instruction to clear bit in the given byte when the `set_bit` uses `or` instruction. - -That's all. Now we can set and clear bit in any bit array and and we can go to other operations on bitmasks. - -Most widely used operations on a bit arrays are set and clear bit in a bit array in the Linux kernel. But besides this operations it is useful to do additional operations on a bit array. Yet another widely used operation in the Linux kernel - is to know is a given bit set or not in a bit array. We can achieve this with the help of the `test_bit` macro. This macro is defined in the [arch/x86/include/asm/bitops.h](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) header file and expands to the call of the `constant_test_bit` or `variable_test_bit` depends on bit number: - -```C -#define test_bit(nr, addr) \ - (__builtin_constant_p((nr)) \ - ? constant_test_bit((nr), (addr)) \ - : variable_test_bit((nr), (addr))) -``` - -So, if the `nr` is known in compile time constant, the `test_bit` will be expanded to the call of the `constant_test_bit` function or `variable_test_bit` in other case. Now let's look at implementations of these functions. Let's start from the `variable_test_bit`: - -```C -static inline int variable_test_bit(long nr, volatile const unsigned long *addr) -{ - int oldbit; - - asm volatile("bt %2,%1\n\t" - "sbb %0,%0" - : "=r" (oldbit) - : "m" (*(unsigned long *)addr), "Ir" (nr)); - - return oldbit; -} -``` - -The `variable_test_bit` function takes similar set of arguments as `set_bit` and other function take. We also may see inline assembly code here which executes [bt](http://x86.renejeschke.de/html/file_module_x86_id_22.html) and [sbb](http://x86.renejeschke.de/html/file_module_x86_id_286.html) instruction. The `bt` or `bit test` instruction selects a given bit which is specified with first operand from the bit array which is specified with the second operand and stores its value in the [CF](https://en.wikipedia.org/wiki/FLAGS_register) bit of flags register. The second `sbb` instruction substracts first operand from second and subscrtact value of the `CF`. So, here write a value of a given bit number from a given bit array to the `CF` bit of flags register and execute `sbb` instruction which calculates: `00000000 - CF` and writes the result to the `oldbit`. - -The `constant_test_bit` function does the same as we saw in the `set_bit`: - -```C -static __always_inline int constant_test_bit(long nr, const volatile unsigned long *addr) -{ - return ((1UL << (nr & (BITS_PER_LONG-1))) & - (addr[nr >> _BITOPS_LONG_SHIFT])) != 0; -} -``` - -It generates a byte where high bit is `1` and other bits are `0` (as we saw in `CONST_MASK`) and applies bitwise [and](https://en.wikipedia.org/wiki/Bitwise_operation#AND) to the byte which contains a given bit number. - -The next widely used bit array related operation is to change bit in a bit array. The Linux kernel provides two helper for this: - -* `__change_bit`; -* `change_bit`. - -As you already can guess, these two variants are atomic and non-atomic as for example `set_bit` and `__set_bit`. For the start, let's look at the implementation of the `__change_bit` function: - -```C -static inline void __change_bit(long nr, volatile unsigned long *addr) -{ - asm volatile("btc %1,%0" : ADDR : "Ir" (nr)); -} -``` - -Pretty easy, is not it? The implementation of the `__change_bit` is the same as `__set_bit`, but instead of `bts` instruction, we are using [btc](http://x86.renejeschke.de/html/file_module_x86_id_23.html). This instruction selects a given bit from a given bit array, stores its value in the `CF` and changes its value by the applying of complement operation. So, a bit with value `1` will be `0` and vice versa: - -```python ->>> int(not 1) -0 ->>> int(not 0) -1 -``` - -The atomic version of the `__change_bit` is the `change_bit` function: - -```C -static inline void change_bit(long nr, volatile unsigned long *addr) -{ - if (IS_IMMEDIATE(nr)) { - asm volatile(LOCK_PREFIX "xorb %1,%0" - : CONST_MASK_ADDR(nr, addr) - : "iq" ((u8)CONST_MASK(nr))); - } else { - asm volatile(LOCK_PREFIX "btc %1,%0" - : BITOP_ADDR(addr) - : "Ir" (nr)); - } -} -``` - -It is similar on `set_bit` function, but also has two differences. The first difference is `xor` operation instead of `or` and the second is `bts` instead of `bts`. - -For this moment we know the most important architecture-specific operations with bit arrays. Time to look at generic bitmap API. - -Common bit operations -================================================================================ - -Besides the architecture-specific API from the [arch/x86/include/asm/bitops.h](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) header file, the Linux kernel provides common API for manipulation of bit arrays. As we know from the beginning of this part, we can find it in the [include/linux/bitmap.h](https://github.com/torvalds/linux/blob/master/include/linux/bitmap.h) header file and additionally in the * [lib/bitmap.c](https://github.com/torvalds/linux/blob/master/lib/bitmap.c) source code file. But before these source code files let's look into the [include/linux/bitops.h](https://github.com/torvalds/linux/blob/master/include/linux/bitops.h) header file which provides a set of useful macro. Let's look on some of they. - -First of all let's look at following four macros: - -* `for_each_set_bit` -* `for_each_set_bit_from` -* `for_each_clear_bit` -* `for_each_clear_bit_from` - -All of these macros provide iterator over certain set of bits in a bit array. The first macro iterates over bits which are set, the second does the same, but starts from a certain bits. The last two macros do the same, but iterates over clear bits. Let's look on implementation of the `for_each_set_bit` macro: - -```C -#define for_each_set_bit(bit, addr, size) \ - for ((bit) = find_first_bit((addr), (size)); \ - (bit) < (size); \ - (bit) = find_next_bit((addr), (size), (bit) + 1)) -``` - -As we may see it takes three arguments and expands to the loop from first set bit which is returned as result of the `find_first_bit` function and to the last bit number while it is less than given size. - -Besides these four macros, the [arch/x86/include/asm/bitops.h](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) provides API for rotation of `64-bit` or `32-bit` values and etc. - -The next [header](https://github.com/torvalds/linux/blob/master/include/linux/bitmap.h) file which provides API for manipulation with a bit arrays. For example it provdes two functions: - -* `bitmap_zero`; -* `bitmap_fill`. - -To clear a bit array and fill it with `1`. Let's look on the implementation of the `bitmap_zero` function: - -```C -static inline void bitmap_zero(unsigned long *dst, unsigned int nbits) -{ - if (small_const_nbits(nbits)) - *dst = 0UL; - else { - unsigned int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long); - memset(dst, 0, len); - } -} -``` - -First of all we can see the check for `nbits`. The `small_const_nbits` is macro which defined in the same header [file](https://github.com/torvalds/linux/blob/master/include/linux/bitmap.h) and looks: - -```C -#define small_const_nbits(nbits) \ - (__builtin_constant_p(nbits) && (nbits) <= BITS_PER_LONG) -``` - -As we may see it checks that `nbits` is known constant in compile time and `nbits` value does not overflow `BITS_PER_LONG` or `64`. If bits number does not overflow amount of bits in a `long` value we can just set to zero. In other case we need to calculate how many `long` values do we need to fill our bit array and fill it with [memset](http://man7.org/linux/man-pages/man3/memset.3.html). - -The implementation of the `bitmap_fill` function is similar on implementation of the `biramp_zero` function, except we fill a given bit array with `0xff` values or `0b11111111`: - -```C -static inline void bitmap_fill(unsigned long *dst, unsigned int nbits) -{ - unsigned int nlongs = BITS_TO_LONGS(nbits); - if (!small_const_nbits(nbits)) { - unsigned int len = (nlongs - 1) * sizeof(unsigned long); - memset(dst, 0xff, len); - } - dst[nlongs - 1] = BITMAP_LAST_WORD_MASK(nbits); -} -``` - -Besides the `bitmap_fill` and `bitmap_zero` functions, the [include/linux/bitmap.h](https://github.com/torvalds/linux/blob/master/include/linux/bitmap.h) header file provides `bitmap_copy` which is similar on the `bitmap_zero`, but just uses [memcpy](http://man7.org/linux/man-pages/man3/memcpy.3.html) instead of [memset](http://man7.org/linux/man-pages/man3/memset.3.html). Also it provides bitwise operations for bit array like `bitmap_and`, `bitmap_or`, `bitamp_xor` and etc. We will not consider implementation of these functions because it is easy to understand implementations of these functions if you understood all from this part. Anyway if you are interested how did these function implemented, you may open [include/linux/bitmap.h](https://github.com/torvalds/linux/blob/master/include/linux/bitmap.h) header file and start to research. - -That's all. - -Links -================================================================================ - -* [bitmap](https://en.wikipedia.org/wiki/Bit_array) -* [linked data structures](https://en.wikipedia.org/wiki/Linked_data_structure) -* [tree data structures](https://en.wikipedia.org/wiki/Tree_%28data_structure%29) -* [hot-plug](https://www.kernel.org/doc/Documentation/cpu-hotplug.txt) -* [cpumasks](https://0xax.gitbooks.io/linux-insides/content/Concepts/cpumask.html) -* [IRQs](https://en.wikipedia.org/wiki/Interrupt_request_%28PC_architecture%29) -* [API](https://en.wikipedia.org/wiki/Application_programming_interface) -* [atomic operations](https://en.wikipedia.org/wiki/Linearizability) -* [xchg instruction](http://x86.renejeschke.de/html/file_module_x86_id_328.html) -* [cmpxchg instruction](http://x86.renejeschke.de/html/file_module_x86_id_41.html) -* [lock instruction](http://x86.renejeschke.de/html/file_module_x86_id_159.html) -* [bts instruction](http://x86.renejeschke.de/html/file_module_x86_id_25.html) -* [btr instruction](http://x86.renejeschke.de/html/file_module_x86_id_24.html) -* [bt instruction](http://x86.renejeschke.de/html/file_module_x86_id_22.html) -* [sbb instruction](http://x86.renejeschke.de/html/file_module_x86_id_286.html) -* [btc instruction](http://x86.renejeschke.de/html/file_module_x86_id_23.html) -* [man memcpy](http://man7.org/linux/man-pages/man3/memcpy.3.html) -* [man memset](http://man7.org/linux/man-pages/man3/memset.3.html) -* [CF](https://en.wikipedia.org/wiki/FLAGS_register) -* [inline assembler](https://en.wikipedia.org/wiki/Inline_assembler) -* [gcc](https://en.wikipedia.org/wiki/GNU_Compiler_Collection) - - ------------------------------------------------------------------------------- - -via: https://github.com/0xAX/linux-insides/blob/master/DataStructures/bitmap.md - -作者:[0xAX][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://twitter.com/0xAX diff --git a/sources/tech/20160705 Create Your Own Shell in Python - Part I.md b/sources/tech/20160705 Create Your Own Shell in Python - Part I.md index 9c3ffa55dd..48e84381c8 100644 --- a/sources/tech/20160705 Create Your Own Shell in Python - Part I.md +++ b/sources/tech/20160705 Create Your Own Shell in Python - Part I.md @@ -1,3 +1,4 @@ +Translating by cposture 2016.07.09 Create Your Own Shell in Python : Part I I’m curious to know how a shell (like bash, csh, etc.) works internally. So, I implemented one called yosh (Your Own SHell) in Python to answer my own curiosity. The concept I explain in this article can be applied to other languages as well. diff --git a/sources/tech/20160706 Create Your Own Shell in Python - Part II.md b/sources/tech/20160706 Create Your Own Shell in Python - Part II.md index af0ec01b36..3154839443 100644 --- a/sources/tech/20160706 Create Your Own Shell in Python - Part II.md +++ b/sources/tech/20160706 Create Your Own Shell in Python - Part II.md @@ -1,3 +1,4 @@ +Translating by cposture 2016.07.09 Create Your Own Shell in Python - Part II =========================================== diff --git a/translated/tech/20160512 Bitmap in Linux Kernel.md b/translated/tech/20160512 Bitmap in Linux Kernel.md new file mode 100644 index 0000000000..6475b9260e --- /dev/null +++ b/translated/tech/20160512 Bitmap in Linux Kernel.md @@ -0,0 +1,405 @@ +--- +date: 2016-07-09 14:42 +status: public +title: 20160512 Bitmap in Linux Kernel +--- + +Linux 内核里的数据结构 +================================================================================ + +Linux 内核中的位数组和位操作 +-------------------------------------------------------------------------------- + +除了不同的基于[链式](https://en.wikipedia.org/wiki/Linked_data_structure)和[树](https://en.wikipedia.org/wiki/Tree_%28data_structure%29)的数据结构以外,Linux 内核也为[位数组](https://en.wikipedia.org/wiki/Bit_array)或`位图`提供了 [API](https://en.wikipedia.org/wiki/Application_programming_interface)。位数组在 Linux 内核里被广泛使用,并且在以下的源代码文件中包含了与这样的结构搭配使用的通用 `API`: + +* [lib/bitmap.c](https://github.com/torvalds/linux/blob/master/lib/bitmap.c) +* [include/linux/bitmap.h](https://github.com/torvalds/linux/blob/master/include/linux/bitmap.h) + +除了这两个文件之外,还有体系结构特定的头文件,它们为特定的体系结构提供优化的位操作。我们将探讨 [x86_64](https://en.wikipedia.org/wiki/X86-64) 体系结构,因此在我们的例子里,它会是 + +* [arch/x86/include/asm/bitops.h](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) + +头文件。正如我上面所写的,`位图`在 Linux 内核中被广泛地使用。例如,`位数组`常常用于保存一组在线/离线处理器,以便系统支持[热插拔](https://www.kernel.org/doc/Documentation/cpu-hotplug.txt)的 CPU(你可以在 [cpumasks](https://0xax.gitbooks.io/linux-insides/content/Concepts/cpumask.html) 部分阅读更多相关知识 ),一个`位数组`可以在 Linux 内核初始化等期间保存一组已分配的中断处理。 + +因此,本部分的主要目的是了解位数组是如何在 Linux 内核中实现的。让我们现在开始吧。 + +位数组声明 +================================================================================ + +在我们开始查看位图操作的 `API` 之前,我们必须知道如何在 Linux 内核中声明它。有两中通用的方法声明位数组。第一种简单的声明一个位数组的方法是,定义一个 unsigned long 的数组,例如: + +```C +unsigned long my_bitmap[8] +``` + +第二种方法,是使用 `DECLARE_BITMAP` 宏,它定义于 [include/linux/types.h](https://github.com/torvalds/linux/blob/master/include/linux/types.h) 头文件: + +```C +#define DECLARE_BITMAP(name,bits) \ + unsigned long name[BITS_TO_LONGS(bits)] +``` + +我们可以看到 `DECLARE_BITMAP` 宏使用两个参数: + +* `name` - 位图名称; +* `bits` - 位图中位数; + +并且只是使用 `BITS_TO_LONGS(bits)` 元素展开 `unsigned long` 数组的定义。 `BITS_TO_LONGS` 宏将一个给定的位数转换为 `longs` 的个数,换言之,就是计算 `bits` 中有多少个 `8` 字节元素: + +```C +#define BITS_PER_BYTE 8 +#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) +#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) +``` + +因此,例如 `DECLARE_BITMAP(my_bitmap, 64)` 将产生: + +```python +>>> (((64) + (64) - 1) / (64)) +1 +``` + +与: + +```C +unsigned long my_bitmap[1]; +``` + +在能够声明一个位数组之后,我们便可以使用它了。 + +体系结构特定的位操作 +================================================================================ + +我们已经看了以上一对源文件和头文件,它们提供了位数组操作的 [API](https://en.wikipedia.org/wiki/Application_programming_interface)。其中重要且广泛使用的位数组 API 是体系结构特定的且位于已提及的头文件中 [arch/x86/include/asm/bitops.h](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h)。 + +首先让我们查看两个最重要的函数: + +* `set_bit`; +* `clear_bit`. + +我认为没有必要解释这些函数的作用。从它们的名字来看,这已经很清楚了。让我们直接查看它们的实现。如果你浏览 [arch/x86/include/asm/bitops.h](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) 头文件,你将会注意到这些函数中的每一个都有[原子性](https://en.wikipedia.org/wiki/Linearizability)和非原子性两种变体。在我们开始深入这些函数的实现之前,首先,我们必须了解一些有关原子操作的知识。 + +简而言之,原子操作保证两个或以上的操作不会并发地执行同一数据。`x86` 体系结构提供了一系列原子指令,例如, [xchg](http://x86.renejeschke.de/html/file_module_x86_id_328.html)、[cmpxchg](http://x86.renejeschke.de/html/file_module_x86_id_41.html) 等指令。除了原子指令,一些非原子指令可以在 [lock](http://x86.renejeschke.de/html/file_module_x86_id_159.html) 指令的帮助下具有原子性。目前已经对原子操作有了充分的理解,我们可以接着探讨 `set_bit` 和 `clear_bit` 函数的实现。 + +我们先考虑函数的非原子性变体。非原子性的 `set_bit` 和 `clear_bit` 的名字以双下划线开始。正如我们所知道的,所有这些函数都定义于 [arch/x86/include/asm/bitops.h](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) 头文件,并且第一个函数就是 `__set_bit`: + +```C +static inline void __set_bit(long nr, volatile unsigned long *addr) +{ + asm volatile("bts %1,%0" : ADDR : "Ir" (nr) : "memory"); +} +``` + +正如我们所看到的,它使用了两个参数: + +* `nr` - 位数组中的位号(从0开始,译者注) +* `addr` - 我们需要置位的位数组地址 + +注意,`addr` 参数使用 `volatile` 关键字定义,以告诉编译器给定地址指向的变量可能会被修改。 `__set_bit` 的实现相当简单。正如我们所看到的,它仅包含一行[内联汇编代码](https://en.wikipedia.org/wiki/Inline_assembler)。在我们的例子中,我们使用 [bts](http://x86.renejeschke.de/html/file_module_x86_id_25.html) 指令,从位数组中选出一个第一操作数(我们的例子中的 `nr`),存储选出的位的值到 [CF](https://en.wikipedia.org/wiki/FLAGS_register) 标志寄存器并设置该位(即 `nr` 指定的位置为1,译者注)。 + +注意,我们了解了 `nr` 的用法,但这里还有一个参数 `addr` 呢!你或许已经猜到秘密就在 `ADDR`。 `ADDR` 是一个定义在同一头文件的宏,它展开为一个包含给定地址和 `+m` 约束的字符串: + +```C +#define ADDR BITOP_ADDR(addr) +#define BITOP_ADDR(x) "+m" (*(volatile long *) (x)) +``` + +除了 `+m` 之外,在 `__set_bit` 函数中我们可以看到其他约束。让我们查看并试图理解它们所表示的意义: + +* `+m` - 表示内存操作数,这里的 `+` 表明给定的操作数为输入输出操作数; +* `I` - 表示整型常量; +* `r` - 表示寄存器操作数 + +除了这些约束之外,我们也能看到 `memory` 关键字,其告诉编译器这段代码会修改内存中的变量。到此为止,现在我们看看相同的原子性变体函数。它看起来比非原子性变体更加复杂: + +```C +static __always_inline void +set_bit(long nr, volatile unsigned long *addr) +{ + if (IS_IMMEDIATE(nr)) { + asm volatile(LOCK_PREFIX "orb %1,%0" + : CONST_MASK_ADDR(nr, addr) + : "iq" ((u8)CONST_MASK(nr)) + : "memory"); + } else { + asm volatile(LOCK_PREFIX "bts %1,%0" + : BITOP_ADDR(addr) : "Ir" (nr) : "memory"); + } +} +``` + +(BITOP_ADDR 的定义为:`#define BITOP_ADDR(x) "=m" (*(volatile long *) (x))`,ORB 为字节按位或,译者注) + +首先注意,这个函数使用了与 `__set_bit` 相同的参数集合,但额外地使用了 `__always_inline` 属性标记。 `__always_inline` 是一个定义于 [include/linux/compiler-gcc.h](https://github.com/torvalds/linux/blob/master/include/linux/compiler-gcc.h) 的宏,并且只是展开为 `always_inline` 属性: + +```C +#define __always_inline inline __attribute__((always_inline)) +``` + +其意味着这个函数总是内联的,以减少 Linux 内核映像的大小。现在我们试着了解 `set_bit` 函数的实现。首先我们在 `set_bit` 函数的开头检查给定的位数量。`IS_IMMEDIATE` 宏定义于相同[头文件](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h),并展开为 gcc 内置函数的调用: + +```C +#define IS_IMMEDIATE(nr) (__builtin_constant_p(nr)) +``` + +如果给定的参数是编译期已知的常量,`__builtin_constant_p` 内置函数则返回 `1`,其他情况返回 `0`。假若给定的位数是编译期已知的常量,我们便无须使用效率低下的 `bts` 指令去设置位。我们可以只需在给定地址指向的字节和和掩码上执行 [按位或](https://en.wikipedia.org/wiki/Bitwise_operation#OR) 操作,其字节包含给定的位,而掩码为位号高位 `1`,其他位为 0。在其他情况下,如果给定的位号不是编译期已知常量,我们便做和 `__set_bit` 函数一样的事。`CONST_MASK_ADDR` 宏: + +```C +#define CONST_MASK_ADDR(nr, addr) BITOP_ADDR((void *)(addr) + ((nr)>>3)) +``` + +展开为带有到包含给定位的字节偏移的给定地址,例如,我们拥有地址 `0x1000` 和 位号是 `0x9`。因为 `0x9` 是 `一个字节 + 一位`,所以我们的地址是 `addr + 1`: + +```python +>>> hex(0x1000 + (0x9 >> 3)) +'0x1001' +``` + +`CONST_MASK` 宏将我们给定的位号表示为字节,位号对应位为高位 `1`,其他位为 `0`: + +```C +#define CONST_MASK(nr) (1 << ((nr) & 7)) +``` + +```python +>>> bin(1 << (0x9 & 7)) +'0b10' +``` + +最后,我们应用 `按位或` 运算到这些变量上面,因此,假如我们的地址是 `0x4097` ,并且我们需要置位号为 `9` 的位 为 1: + +```python +>>> bin(0x4097) +'0b100000010010111' +>>> bin((0x4097 >> 0x9) | (1 << (0x9 & 7))) +'0b100010' +``` + +`第 9 位` 将会被置位。(这里的 9 是从 0 开始计数的,比如0010,按照作者的意思,其中的 1 是第 1 位,译者注) + +注意,所有这些操作使用 `LOCK_PREFIX` 标记,其展开为 [lock](http://x86.renejeschke.de/html/file_module_x86_id_159.html) 指令,保证该操作的原子性。 + +正如我们所知,除了 `set_bit` 和 `__set_bit` 操作之外,Linux 内核还提供了两个功能相反的函数,在原子性和非原子性的上下文中清位。它们为 `clear_bit` 和 `__clear_bit`。这两个函数都定义于同一个[头文件](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) 并且使用相同的参数集合。不仅参数相似,一般而言,这些函数与 `set_bit` 和 `__set_bit` 也非常相似。让我们查看非原子性 `__clear_bit` 的实现吧: + +```C +static inline void __clear_bit(long nr, volatile unsigned long *addr) +{ + asm volatile("btr %1,%0" : ADDR : "Ir" (nr)); +} +``` + +没错,正如我们所见,`__clear_bit` 使用相同的参数集合,并包含极其相似的内联汇编代码块。它仅仅使用 [btr](http://x86.renejeschke.de/html/file_module_x86_id_24.html) 指令替换 `bts`。正如我们从函数名所理解的一样,通过给定地址,它清除了给定的位。`btr` 指令表现得像 `bts`(原文这里为 btr,可能为笔误,修正为 bts,译者注)。该指令选出第一操作数指定的位,存储它的值到 `CF` 标志寄存器,并且清楚第二操作数指定的位数组中的对应位。 + +`__clear_bit` 的原子性变体为 `clear_bit`: + +```C +static __always_inline void +clear_bit(long nr, volatile unsigned long *addr) +{ + if (IS_IMMEDIATE(nr)) { + asm volatile(LOCK_PREFIX "andb %1,%0" + : CONST_MASK_ADDR(nr, addr) + : "iq" ((u8)~CONST_MASK(nr))); + } else { + asm volatile(LOCK_PREFIX "btr %1,%0" + : BITOP_ADDR(addr) + : "Ir" (nr)); + } +} +``` + +并且正如我们所看到的,它与 `set_bit` 非常相似,同时只包含了两处差异。第一处差异为 `clear_bit` 使用 `btr` 指令来清位,而 `set_bit` 使用 `bts` 指令来置位。第二处差异为 `clear_bit` 使用否定的位掩码和 `按位与` 在给定的字节上置位,而 `set_bit` 使用 `按位或` 指令。 + +到此为止,我们可以在任何位数组置位和清位了,并且能够转到位掩码上的其他操作。 + +在 Linux 内核位数组上最广泛使用的操作是设置和清除位,但是除了这两个操作外,位数组上其他操作也是非常有用的。Linux 内核里另一种广泛使用的操作是知晓位数组中一个给定的位是否被置位。我们能够通过 `test_bit` 宏的帮助实现这一功能。这个宏定义于 [arch/x86/include/asm/bitops.h](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) 头文件,并展开为 `constant_test_bit` 或 `variable_test_bit` 的调用,这要取决于位号。 + +```C +#define test_bit(nr, addr) \ + (__builtin_constant_p((nr)) \ + ? constant_test_bit((nr), (addr)) \ + : variable_test_bit((nr), (addr))) +``` + +因此,如果 `nr` 是编译期已知常量,`test_bit` 将展开为 `constant_test_bit` 函数的调用,而其他情况则为 `variable_test_bit`。现在让我们看看这些函数的实现,我们从 `variable_test_bit` 开始看起: + +```C +static inline int variable_test_bit(long nr, volatile const unsigned long *addr) +{ + int oldbit; + + asm volatile("bt %2,%1\n\t" + "sbb %0,%0" + : "=r" (oldbit) + : "m" (*(unsigned long *)addr), "Ir" (nr)); + + return oldbit; +} +``` + +`variable_test_bit` 函数调用了与 `set_bit` 及其他函数使用的相似的参数集合。我们也可以看到执行 [bt](http://x86.renejeschke.de/html/file_module_x86_id_22.html) 和 [sbb](http://x86.renejeschke.de/html/file_module_x86_id_286.html) 指令的内联汇编代码。`bt` 或 `bit test` 指令从第二操作数指定的位数组选出第一操作数指定的一个指定位,并且将该位的值存进标志寄存器的 [CF](https://en.wikipedia.org/wiki/FLAGS_register) 位。第二个指令 `sbb` 从第二操作数中减去第一操作数,再减去 `CF` 的值。因此,这里将一个从给定位数组中的给定位号的值写进标志寄存器的 `CF` 位,并且执行 `sbb` 指令计算: `00000000 - CF`,并将结果写进 `oldbit` 变量。 + +`constant_test_bit` 函数做了和我们在 `set_bit` 所看到的一样的事: + +```C +static __always_inline int constant_test_bit(long nr, const volatile unsigned long *addr) +{ + return ((1UL << (nr & (BITS_PER_LONG-1))) & + (addr[nr >> _BITOPS_LONG_SHIFT])) != 0; +} +``` + +它生成了一个位号对应位为高位 `1`,而其他位为 `0` 的字节(正如我们在 `CONST_MASK` 所看到的),并将 [按位与](https://en.wikipedia.org/wiki/Bitwise_operation#AND) 应用于包含给定位号的字节。 + +下一广泛使用的位数组相关操作是改变一个位数组中的位。为此,Linux 内核提供了两个辅助函数: + +* `__change_bit`; +* `change_bit`. + +你可能已经猜测到,就拿 `set_bit` 和 `__set_bit` 例子说,这两个变体分别是原子和非原子版本。首先,让我们看看 `__change_bit` 函数的实现: + +```C +static inline void __change_bit(long nr, volatile unsigned long *addr) +{ + asm volatile("btc %1,%0" : ADDR : "Ir" (nr)); +} +``` + +相当简单,不是吗? `__change_bit` 的实现和 `__set_bit` 一样,只是我们使用 [btc](http://x86.renejeschke.de/html/file_module_x86_id_23.html) 替换 `bts` 指令而已。 该指令从一个给定位数组中选出一个给定位,将该为位的值存进 `CF` 并使用求反操作改变它的值,因此值为 `1` 的位将变为 `0`,反之亦然: + +```python +>>> int(not 1) +0 +>>> int(not 0) +1 +``` + + `__change_bit` 的原子版本为 `change_bit` 函数: + +```C +static inline void change_bit(long nr, volatile unsigned long *addr) +{ + if (IS_IMMEDIATE(nr)) { + asm volatile(LOCK_PREFIX "xorb %1,%0" + : CONST_MASK_ADDR(nr, addr) + : "iq" ((u8)CONST_MASK(nr))); + } else { + asm volatile(LOCK_PREFIX "btc %1,%0" + : BITOP_ADDR(addr) + : "Ir" (nr)); + } +} +``` + +它和 `set_bit` 函数很相似,但也存在两点差异。第一处差异为 `xor` 操作而不是 `or`。第二处差异为 `btc`(原文为 `bts`,为作者笔误,译者注) 而不是 `bts`。 + +目前,我们了解了最重要的体系特定的位数组操作,是时候看看一般的位图 API 了。 + +通用位操作 +================================================================================ + +除了 [arch/x86/include/asm/bitops.h](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) 中体系特定的 API 外,Linux 内核提供了操作位数组的通用 API。正如我们本部分开头所了解的一样,我们可以在 [include/linux/bitmap.h](https://github.com/torvalds/linux/blob/master/include/linux/bitmap.h) 头文件和* [lib/bitmap.c](https://github.com/torvalds/linux/blob/master/lib/bitmap.c) 源文件中找到它。但在查看这些源文件之前,我们先看看 [include/linux/bitops.h](https://github.com/torvalds/linux/blob/master/include/linux/bitops.h) 头文件,其提供了一系列有用的宏,让我们看看它们当中一部分。 + +首先我们看看以下 4 个 宏: + +* `for_each_set_bit` +* `for_each_set_bit_from` +* `for_each_clear_bit` +* `for_each_clear_bit_from` + +所有这些宏都提供了遍历位数组中某些位集合的迭代器。第一个红迭代那些被置位的位。第二个宏也是一样,但它是从某一确定位开始。最后两个宏做的一样,但是迭代那些被清位的位。让我们看看 `for_each_set_bit` 宏: + +```C +#define for_each_set_bit(bit, addr, size) \ + for ((bit) = find_first_bit((addr), (size)); \ + (bit) < (size); \ + (bit) = find_next_bit((addr), (size), (bit) + 1)) +``` + +正如我们所看到的,它使用了三个参数,并展开为一个循环,该循环从作为 `find_first_bit` 函数返回结果的第一个置位开始到最后一个置位且小于给定大小为止。 + +除了这四个宏, [arch/x86/include/asm/bitops.h](https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/bitops.h) 也提供了 `64-bit` 或 `32-bit` 变量循环的 API 等等。 + +下一个 [头文件](https://github.com/torvalds/linux/blob/master/include/linux/bitmap.h) 提供了操作位数组的 API。例如,它提供了以下两个函数: + +* `bitmap_zero`; +* `bitmap_fill`. + +它们分别可以清除一个位数组和用 `1` 填充位数组。让我们看看 `bitmap_zero` 函数的实现: + +```C +static inline void bitmap_zero(unsigned long *dst, unsigned int nbits) +{ + if (small_const_nbits(nbits)) + *dst = 0UL; + else { + unsigned int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long); + memset(dst, 0, len); + } +} +``` + +首先我们可以看到对 `nbits` 的检查。 `small_const_nbits` 是一个定义在同一[头文件](https://github.com/torvalds/linux/blob/master/include/linux/bitmap.h) 的宏: + +```C +#define small_const_nbits(nbits) \ + (__builtin_constant_p(nbits) && (nbits) <= BITS_PER_LONG) +``` + +正如我们可以看到的,它检查 `nbits` 是否为编译期已知常量,并且其值不超过 `BITS_PER_LONG` 或 `64`。如果位数目没有超过一个 `long` 变量的位数,我们可以仅仅设置为 0。在其他情况,我们需要计算有多少个需要填充位数组的 `long` 变量并且使用 [memset](http://man7.org/linux/man-pages/man3/memset.3.html) 进行填充。 + +`bitmap_fill` 函数的实现和 `biramp_zero` 函数很相似,除了我们需要在给定的位数组中填写 `0xff` 或 `0b11111111`: + +```C +static inline void bitmap_fill(unsigned long *dst, unsigned int nbits) +{ + unsigned int nlongs = BITS_TO_LONGS(nbits); + if (!small_const_nbits(nbits)) { + unsigned int len = (nlongs - 1) * sizeof(unsigned long); + memset(dst, 0xff, len); + } + dst[nlongs - 1] = BITMAP_LAST_WORD_MASK(nbits); +} +``` + +除了 `bitmap_fill` 和 `bitmap_zero`,[include/linux/bitmap.h](https://github.com/torvalds/linux/blob/master/include/linux/bitmap.h) 头文件也提供了和 `bitmap_zero` 很相似的 `bitmap_copy`,只是仅仅使用 [memcpy](http://man7.org/linux/man-pages/man3/memcpy.3.html) 而不是 [memset](http://man7.org/linux/man-pages/man3/memset.3.html) 这点差异而已。它也提供了位数组的按位操作,像 `bitmap_and`, `bitmap_or`, `bitamp_xor`等等。我们不会探讨这些函数的实现了,因为如果你理解了本部分的所有内容,这些函数的实现是很容易理解的。无论如何,如果你对这些函数是如何实现的感兴趣,你可以打开并研究 [include/linux/bitmap.h](https://github.com/torvalds/linux/blob/master/include/linux/bitmap.h) 头文件。 + +本部分到此为止。 + +链接 +================================================================================ + +* [bitmap](https://en.wikipedia.org/wiki/Bit_array) +* [linked data structures](https://en.wikipedia.org/wiki/Linked_data_structure) +* [tree data structures](https://en.wikipedia.org/wiki/Tree_%28data_structure%29) +* [hot-plug](https://www.kernel.org/doc/Documentation/cpu-hotplug.txt) +* [cpumasks](https://0xax.gitbooks.io/linux-insides/content/Concepts/cpumask.html) +* [IRQs](https://en.wikipedia.org/wiki/Interrupt_request_%28PC_architecture%29) +* [API](https://en.wikipedia.org/wiki/Application_programming_interface) +* [atomic operations](https://en.wikipedia.org/wiki/Linearizability) +* [xchg instruction](http://x86.renejeschke.de/html/file_module_x86_id_328.html) +* [cmpxchg instruction](http://x86.renejeschke.de/html/file_module_x86_id_41.html) +* [lock instruction](http://x86.renejeschke.de/html/file_module_x86_id_159.html) +* [bts instruction](http://x86.renejeschke.de/html/file_module_x86_id_25.html) +* [btr instruction](http://x86.renejeschke.de/html/file_module_x86_id_24.html) +* [bt instruction](http://x86.renejeschke.de/html/file_module_x86_id_22.html) +* [sbb instruction](http://x86.renejeschke.de/html/file_module_x86_id_286.html) +* [btc instruction](http://x86.renejeschke.de/html/file_module_x86_id_23.html) +* [man memcpy](http://man7.org/linux/man-pages/man3/memcpy.3.html) +* [man memset](http://man7.org/linux/man-pages/man3/memset.3.html) +* [CF](https://en.wikipedia.org/wiki/FLAGS_register) +* [inline assembler](https://en.wikipedia.org/wiki/Inline_assembler) +* [gcc](https://en.wikipedia.org/wiki/GNU_Compiler_Collection) + + +------------------------------------------------------------------------------ + +via: https://github.com/0xAX/linux-insides/blob/master/DataStructures/bitmap.md + +作者:[0xAX][a] +译者:[cposture](https://github.com/cposture) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://twitter.com/0xAX \ No newline at end of file From 052f6bf1faedcdaeb330e150ab2187691be74fdd Mon Sep 17 00:00:00 2001 From: chenxinlong <237448382@qq.com> Date: Sun, 10 Jul 2016 01:23:01 +0800 Subject: [PATCH 1112/1469] [translating]Growing a carrer alongside Linux --- .../20160316 Growing a career alongside Linux.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/talk/my-open-source-story/20160316 Growing a career alongside Linux.md b/sources/talk/my-open-source-story/20160316 Growing a career alongside Linux.md index 24799508c3..b9e5e54f0a 100644 --- a/sources/talk/my-open-source-story/20160316 Growing a career alongside Linux.md +++ b/sources/talk/my-open-source-story/20160316 Growing a career alongside Linux.md @@ -1,3 +1,5 @@ +chenxinlong translating + Growing a career alongside Linux ================================== @@ -38,7 +40,7 @@ The constant evolution and fun of using Linux has been a driving force for me fo via: https://opensource.com/life/16/3/my-linux-story-michael-perry 作者:[Michael Perry][a] -译者:[译者ID](https://github.com/译者ID) +译者:[译者ID](https://github.com/chenxinlong) 校对:[校对者ID](https://github.com/校对者ID) [a]: https://opensource.com/users/mpmilestogo From b52e80c3dcad00c66042d7eebf2bbbe44dbc20b0 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 10 Jul 2016 08:08:09 +0800 Subject: [PATCH 1113/1469] PUB:20160218 How to Best Manage Encryption Keys on Linux @mudongliang --- ...to Best Manage Encryption Keys on Linux.md | 104 +++++++++++++++++ ...to Best Manage Encryption Keys on Linux.md | 110 ------------------ 2 files changed, 104 insertions(+), 110 deletions(-) create mode 100644 published/20160218 How to Best Manage Encryption Keys on Linux.md delete mode 100644 translated/tech/20160218 How to Best Manage Encryption Keys on Linux.md diff --git a/published/20160218 How to Best Manage Encryption Keys on Linux.md b/published/20160218 How to Best Manage Encryption Keys on Linux.md new file mode 100644 index 0000000000..fa0e559ff9 --- /dev/null +++ b/published/20160218 How to Best Manage Encryption Keys on Linux.md @@ -0,0 +1,104 @@ +在 Linux 上管理加密密钥的最佳体验 +============================================= + +存储 SSH 的加密秘钥和记住密码一直是一个让人头疼的问题。但是不幸的是,在当前这个充满了恶意黑客和攻击的世界中,基本的安全预防是必不可少的。对于许多普通用户来说,大多数人只能是记住密码,也可能寻找到一个好程序去存储密码,正如我们提醒这些用户不要在每个网站采用相同的密码。但是对于在各个 IT 领域的人们,我们需要将这个事情提高一个层面。我们需要使用像 SSH 密钥这样的加密秘钥,而不只是密码。 + +设想一个场景:我有一个运行在云上的服务器,用作我的主 git 库。我有很多台工作电脑,所有这些电脑都需要登录到这个中央服务器去做 push 与 pull 操作。这里我设置 git 使用 SSH。当 git 使用 SSH 时,git 实际上是以 SSH 的方式登录到服务器,就好像你通过 SSH 命令打开一个服务器的命令行一样。为了把这些配置好,我在我的 .ssh 目录下创建一个配置文件,其中包含一个有服务器名字、主机名、登录用户、密钥文件路径等信息的主机项。之后我可以通过输入如下命令来测试这个配置是否正确。 + + ssh gitserver + +很快我就可以访问到服务器的 bash shell。现在我可以配置 git 使用相同配置项以及存储的密钥来登录服务器。这很简单,只是有一个问题:对于每一个我要用它登录服务器的电脑,我都需要有一个密钥文件,那意味着需要密钥文件会放在很多地方。我会在当前这台电脑上存储这些密钥文件,我的其他电脑也都需要存储这些。就像那些有特别多的密码的用户一样,我们这些 IT 人员也被这些特别多的密钥文件淹没。怎么办呢? + +### 清理 + +在我们开始帮助你管理密钥之前,你需要有一些密钥应该怎么使用的基础知识,以及明白我们下面的提问的意义所在。同时,有个前提,也是最重要的,你应该知道你的公钥和私钥该放在哪里。然后假设你应该知道: + +1. 公钥和私钥之间的差异; +2. 为什么你不可以从公钥生成私钥,但是反之则可以? +3. `authorized_keys` 文件的目的以及里面包含什么内容; +4. 如何使用私钥去登录一个你的对应公钥存储在其上的 `authorized_keys` 文件中的服务器。 + +![](http://www.linux.com/images/stories/41373/key-management-diagram.png) + +这里有一个例子。当你在亚马逊的网络服务上创建一个云服务器,你必须提供一个用于连接你的服务器的 SSH 密钥。每个密钥都有一个公开的部分(公钥)和私密的部分(私钥)。你要想让你的服务器安全,乍看之下你可能应该将你的私钥放到服务器上,同时你自己带着公钥。毕竟,你不想你的服务器被公开访问,对吗?但是实际上的做法正好是相反的。 + +你应该把自己的公钥放到 AWS 服务器,同时你持有用于登录服务器的私钥。你需要保护好私钥,并让它处于你的控制之中,而不是放在一些远程服务器上,正如上图中所示。 + +原因如下:如果公钥被其他人知道了,它们不能用于登录服务器,因为他们没有私钥。进一步说,如果有人成功攻入你的服务器,他们所能找到的只是公钥,他们不可以从公钥生成私钥。同时,如果你在其他的服务器上使用了相同的公钥,他们不可以使用它去登录别的电脑。 + +这就是为什么你要把你自己的公钥放到你的服务器上以便通过 SSH 登录这些服务器。你持有这些私钥,不要让这些私钥脱离你的控制。 + +但是还有一点麻烦。试想一下我 git 服务器的例子。我需要做一些抉择。有时我登录架设在别的地方的开发服务器,而在开发服务器上,我需要连接我的 git 服务器。如何使我的开发服务器连接 git 服务器?显然是通过使用私钥,但这样就会有问题。在该场景中,需要我把私钥放置到一个架设在别的地方的服务器上,这相当危险。 + +一个进一步的场景:如果我要使用一个密钥去登录许多的服务器,怎么办?如果一个入侵者得到这个私钥,这个人就能用这个私钥得到整个服务器网络的权限,这可能带来一些严重的破坏,这非常糟糕。 + +同时,这也带来了另外一个问题,我真的应该在这些其他服务器上使用相同的密钥吗?因为我刚才描述的,那会非常危险的。 + +最后,这听起来有些混乱,但是确实有一些简单的解决方案。让我们有条理地组织一下。 + +(注意,除了登录服务器,还有很多地方需要私钥密钥,但是我提出的这个场景可以向你展示当你使用密钥时你所面对的问题。) + +### 常规口令 + +当你创建你的密钥时,你可以选择是否包含一个密钥使用时的口令。有了这个口令,私钥文件本身就会被口令所加密。例如,如果你有一个公钥存储在服务器上,同时你使用私钥去登录服务器的时候,你会被提示输入该口令。没有口令,这个密钥是无法使用的。或者你也可以配置你的密钥不需要口令,然后只需要密钥文件就可以登录服务器了。 + +一般来说,不使用口令对于用户来说是更方便的,但是在很多情况下我强烈建议使用口令,原因是,如果私钥文件被偷了,偷密钥的人仍然不可以使用它,除非他或者她可以找到口令。在理论上,这个将节省你很多时间,因为你可以在攻击者发现口令之前,从服务器上删除公钥文件,从而保护你的系统。当然还有一些使用口令的其它原因,但是在很多场合这个原因对我来说更有价值。(举一个例子,我的 Android 平板上有 VNC 软件。平板上有我的密钥。如果我的平板被偷了之后,我会马上从服务器上删除公钥,使得它的私钥没有作用,无论有没有口令。)但是在一些情况下我不使用口令,是因为我正在登录的服务器上没有什么有价值的数据,这取决于情境。 + +### 服务器基础设施 + +你如何设计自己服务器的基础设施将会影响到你如何管理你的密钥。例如,如果你有很多用户登录,你将需要决定每个用户是否需要一个单独的密钥。(一般来说,应该如此;你不会想在用户之间共享私钥。那样当一个用户离开组织或者失去信任时,你可以删除那个用户的公钥,而不需要必须给其他人生成新的密钥。相似地,通过共享密钥,他们能以其他人的身份登录,这就更糟糕了。)但是另外一个问题是你如何配置你的服务器。举例来说,你是否使用像 Puppet 这样工具配置大量的服务器?你是否基于你自己的镜像创建大量的服务器?当你复制你的服务器,是否每一个的密钥都一样?不同的云服务器软件允许你配置如何选择;你可以让这些服务器使用相同的密钥,也可以给每一个服务器生成一个新的密钥。 + +如果你在操作这些复制的服务器,如果用户需要使用不同的密钥登录两个不同但是大部分都一样的系统,它可能导致混淆。但是另一方面,服务器共享相同的密钥会有安全风险。或者,第三,如果你的密钥有除了登录之外的需要(比如挂载加密的驱动),那么你会在很多地方需要相同的密钥。正如你所看到的,你是否需要在不同的服务器上使用相同的密钥不是我能为你做的决定;这其中有权衡,你需要自己去决定什么是最好的。 + +最终,你可能会有: + +- 需要登录的多个服务器 +- 多个用户登录到不同的服务器,每个都有自己的密钥 +- 每个用户使用多个密钥登录到不同的服务器 + +(如果你正在别的情况下使用密钥,这个同样的普适理论也能应用于如何使用密钥,需要多少密钥,它们是否共享,你如何处理公私钥等方面。) + +### 安全方法 + +了解你的基础设施和特有的情况,你需要组合一个密钥管理方案,它会指导你如何去分发和存储你的密钥。比如,正如我之前提到的,如果我的平板被偷了,我会从我服务器上删除公钥,我希望这在平板在用于访问服务器之前完成。同样的,我会在我的整体计划中考虑以下内容: + +1. 私钥可以放在移动设备上,但是必须包含口令; +2. 必须有一个可以快速地从服务器上删除公钥的方法。 + +在你的情况中,你可能决定你不想在自己经常登录的系统上使用口令;比如,这个系统可能是一个开发者一天登录多次的测试机器。这没有问题,但是你需要调整一点你的规则。你可以添加一条规则:不可以通过移动设备登录该机器。换句话说,你需要根据自己的状况构建你的准则,不要假设某个方案放之四海而皆准。 + +### 软件 + +至于软件,令人吃惊的是,现实世界中并没有很多好的、可靠的存储和管理私钥的软件解决方案。但是应该有吗?考虑下这个,如果你有一个程序存储你所有服务器的全部密钥,并且这个程序被一个快捷的密钥锁住,那么你的密钥就真的安全了吗?或者类似的,如果你的密钥被放置在你的硬盘上,用于 SSH 程序快速访问,密钥管理软件是否真正提供了任何保护吗? + +但是对于整体基础设施和创建/管理公钥来说,有许多的解决方案。我已经提到了 Puppet,在 Puppet 的世界中,你可以创建模块以不同的方式管理你的服务器。这个想法是服务器是动态的,而且不需要精确地复制彼此。[这里有一个聪明的方法](http://manuel.kiessling.net/2014/03/26/building-manageable-server-infrastructures-with-puppet-part-4/),在不同的服务器上使用相同的密钥,但是对于每一个用户使用不同的 Puppet 模块。这个方案可能适合你,也可能不适合你。 + +或者,另一个选择就是完全换个不同的档位。在 Docker 的世界中,你可以采取一个不同的方式,正如[关于 SSH 和 Docker 博客](http://blog.docker.com/2014/06/why-you-dont-need-to-run-sshd-in-docker/)所描述的那样。 + +但是怎么样管理私钥?如果你搜索过的话,你无法找到很多可以选择的软件,原因我之前提到过;私钥存放在你的硬盘上,一个管理软件可能无法提到更多额外的安全。但是我使用这种方法来管理我的密钥: + +首先,我的 `.ssh/config` 文件中有很多的主机项。我要登录的都有一个主机项,但是有时我对于一个单独的主机有不止一项。如果我有很多登录方式,就会出现这种情况。对于放置我的 git 库的服务器来说,我有两个不同的登录项;一个限制于 git,另一个用于一般用途的 bash 访问。这个为 git 设置的登录选项在机器上有极大的限制。还记得我之前说的我存储在远程开发机器上的 git 密钥吗?好了。虽然这些密钥可以登录到我其中一个服务器,但是使用的账号是被严格限制的。 + +其次,大部分的私钥都包含口令。(对于需要多次输入口令的情况,考虑使用 [ssh-agent](http://blog.docker.com/2014/06/why-you-dont-need-to-run-sshd-in-docker/)。) + +再次,我有一些我想要更加小心地保护的服务器,我不会把这些主机项放在我的 host 文件中。这更加接近于社会工程方面,密钥文件还在,但是可能需要攻击者花费更长的时间去找到这个密钥文件,分析出来它们对应的机器。在这种情况下,我就需要手动打出来一条长长的 SSH 命令。(没那么可怕。) + +同时你可以看出来我没有使用任何特别的软件去管理这些私钥。 + +## 无放之四海而皆准的方案 + +我们偶尔会在 linux.com 收到一些问题,询问管理密钥的好软件的建议。但是退一步看,这个问题事实上需要重新思考,因为没有一个普适的解决方案。你问的问题应该基于你自己的状况。你是否简单地尝试找到一个位置去存储你的密钥文件?你是否寻找一个方法去管理多用户问题,其中每个人都需要将他们自己的公钥插入到 `authorized_keys` 文件中? + +通过这篇文章,我已经囊括了这方面的基础知识,希望到此你明白如何管理你的密钥,并且,只有当你问出了正确的问题,无论你寻找任何软件(甚至你需要另外的软件),它都会出现。 + +------------------------------------------------------------------------------ + +via: http://www.linux.com/learn/tutorials/838235-how-to-best-manage-encryption-keys-on-linux + +作者:[Jeff Cogswell][a] +译者:[mudongliang](https://github.com/mudongliang) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linux.com/community/forums/person/62256 diff --git a/translated/tech/20160218 How to Best Manage Encryption Keys on Linux.md b/translated/tech/20160218 How to Best Manage Encryption Keys on Linux.md deleted file mode 100644 index b833d94658..0000000000 --- a/translated/tech/20160218 How to Best Manage Encryption Keys on Linux.md +++ /dev/null @@ -1,110 +0,0 @@ -Linux 如何最好地管理加密密钥 -============================================= - -![](http://www.linux.com/images/stories/41373/key-management-diagram.png) - -存储 SSH 的加密秘钥以及记住密码一直是一个让人头疼的问题。但是不幸的是,在当前充满了恶意黑客和攻击的世界中,基本的安全预警是必不可少的。对于大量的普通用户,它相当于简单地记住密码,也可能寻找一个好程序去存储密码,正如我们提醒这些用户不要在每个网站都有相同的密码。但是对于在各个 IT 领域的我们,我们需要将这个提高一个层次。我们不得不处理加密秘钥,比如 SSH 密钥,而不只是密码。 - -设想一个场景:我有一个运行在云上的服务器,用于我的主 git 库。我有很多台工作电脑。所有电脑都需要登陆中央服务器去 push 与 pull。我设置 git 使用 SSH。当 git 使用 SSH, git 实际上以相同的方式登陆服务器,就好像你通过 SSH 命令打开一个服务器的命令行。为了配置所有内容,我在我的 .ssh 目录下创建一个配置文件,其中包含一个有服务器名字,主机名,登陆用户,密钥文件的路径的主机项。之后我可以通过输入命令来测试这个配置。 - ->ssh gitserver - -很快我得到了服务器的 bash shell。现在我可以配置 git 使用相同项与存储的密钥来登陆服务器。很简单,除了一个问题,对于每一个我用于登陆服务器的电脑,我需要有一个密钥文件。那意味着需要不止一个密钥文件。当前这台电脑和我的其他电脑都存储有这些密钥文件。同样的,用户每天有特大量的密码,对于我们 IT人员,很容易结束这特大量的密钥文件。怎么办呢? - -## 清理 - -在开始使用程序去帮助你管理你的密钥之前,你不得不在你的密码应该怎么处理和我们问的问题是否有意义这两个方面打下一些基础。同时,这需要第一,也是最重要的,你明白你的公钥和私钥的使用位置。我将设想你知道: - -1. 公钥和私钥之间的差异; - -2. 为什么你不可以从公钥生成私钥,但是你可以逆向生成? - -3. `authorized_keys` 文件的目的以及它的内容; - -4. 你如何使用私钥去登陆服务器,其中服务器上的 `authorized_keys` 文件中存有相应的公钥; - -这里有一个例子。当你在亚马逊的网络服务上创建一个云服务器,你必须提供一个 SSH 密码,用于连接你的服务器。每一个密钥有一个公开的部分,和私密的部分。因为你想保持你的服务器安全,乍看之下你可能要将你的私钥放到服务器上,同时你自己带着公钥。毕竟,你不想你的服务器被公开访问,对吗?但是实际上这是逆向的。 - -你把自己的公钥放到 AWS 服务器,同时你持有你自己的私钥用于登陆服务器。你保护私钥,同时保持私钥在自己一方,而不是在一些远程服务器上,正如上图中所示。 - -原因如下:如果公钥公之于众,他们不可以登陆服务器,因为他们没有私钥。进一步说,如果有人成功攻入你的服务器,他们所能找到的只是公钥。你不可以从公钥生成私钥。同时如果你在其他的服务器上使用相同的密钥,他们不可以使用它去登陆别的电脑。 - -这就是为什么你把你自己的公钥放到你的服务器上以便通过 SSH 登陆这些服务器。你持有这些私钥,不要让这些私钥脱离你的控制。 - -但是还有麻烦。试想一下我 git 服务器的例子。我要做一些决定。有时我登陆架设在别的地方的开发服务器。在开发服务器上,我需要连接我的 git 服务器。如何使我的开发服务器连接 git 服务器?通过使用私钥。同时这里面还有麻烦。这个场景需要我把私钥放置到一个架设在别的地方的服务器上。这相当危险。 - -一个进一步的场景:如果我要使用一个密钥去登陆许多的服务器,怎么办?如果一个入侵者得到这个私钥,他或她将拥有私钥,并且得到服务器的全部虚拟网络的权限,同时准备做一些严重的破坏。这一点也不好。 - -同时那当然会带来一个别的问题,我真的应该在这些其他服务器上使用相同的密钥?因为我刚才描述的,那会非常危险的。 - -最后,这听起来有些混乱,但是有一些简单的解决方案。让我们有条理地组织一下: - -(注意你有很多地方需要密钥登陆服务器,但是我提出这个作为一个场景去向你展示当你处理密钥的时候你面对的问题) - -## 关于口令句 - -当你创建你的密钥时,你可以选择是否包含一个口令字,这个口令字会在使用私钥的时候是必不可少的。有了这个口令字,私钥文件本身会被口令字加密。例如,如果你有一个公钥存储在服务器上,同时你使用私钥去登陆服务器的时候,你会被提示,输入口令字。没有口令字,这个密钥是无法使用的。或者,你可以配置你的密钥不需要口令字。然后所有你需要的只是用于登陆服务器的密钥文件。 - -普遍上,不使用口令字对于用户来说是更容易的,但是我强烈建议在很多情况下使用口令字,原因是,如果私钥文件被偷了,偷密钥的人仍然不可以使用它,除非他或者她可以找到口令字。在理论上,这个将节省你很多时间,因为你可以在攻击者发现口令字之前,从服务器上删除公钥文件,从而保护你的系统。还有一些别的原因去使用口令字,但是这个原因对我来说在很多场合更有价值。(举一个例子,我的 Android 平板上有 VNC 软件。平板上有我的密钥。如果我的平板被偷了之后,我会马上从服务器上删除公钥,使得它的私钥没有作用,无论有没有口令字。)但是在一些情况下我不使用口令字,是因为我正在登陆的服务器上没有什么有价值的数据。它取决于情境。 - -## 服务器基础设施 - -你如何设置自己服务器的基础设置将会影响到你如何管理你的密钥。例如,如果你有很多用户登陆,你将需要决定每个用户是否需要一个单独的密钥。(普遍来说,他们应该;你不会想要用户之间共享私钥。那样当一个用户离开组织或者失去信任时,你可以删除那个用户的公钥,而不需要必须给其他人生成新的密钥。相似地,通过共享密钥,他们能以其他人的身份登录,这就更坏了。)但是另外一个问题,你如何配置你的服务器。你是否使用工具,比如 Puppet,配置大量的服务器?同时你是否基于你自己的镜像创建大量的服务器?当你复制你的服务器,你是否需要为每个人设置相同的密钥?不同的云服务器软件允许你配置这个;你可以让这些服务器使用相同的密钥,或者给每一个生成一个新的密钥。 - -如果你在处理复制的服务器,它可能导致混淆如果用户需要使用不同的密钥登陆两个不同的系统。但是另一方面,服务器共享相同的密钥会有安全风险。或者,第三,如果你的密钥有除了登陆之外的需要(比如挂载加密的驱动),之后你会在很多地方需要相同的密钥。正如你所看到的,你是否需要在不同的服务器上使用相同的密钥不是我为你做的决定;这其中有权衡,而且你需要去决定什么是最好的。 - -最终,你可能会有: - -- 需要登录的多个服务器 - -- 多个用户登陆不同的服务器,每个都有自己的密钥 - -- 每个用户多个密钥当他们登陆不同的服务器的时候 - -(如果你正在别的情况下使用密钥,相同的普遍概念会应用于如何使用密钥,需要多少密钥,他们是否共享,你如何处理密钥的私密部分和公开部分。) - -## 安全方法 - -知道你的基础设施和独一无二的情况,你需要组合一个密钥管理方案,它会引导你去分发和存储你的密钥。比如,正如我之前提到的,如果我的平板被偷了,我会从我服务器上删除公钥,期望在平板在用于访问服务器。同样的,我会在我的整体计划中考虑以下内容: - -1. 移动设备上的私钥没有问题,但是必须包含口令字; - -2. 必须有一个方法可以快速地从服务器上删除公钥。 - -在你的情况中,你可能决定,你不想在自己经常登录的系统上使用口令字;比如,这个系统可能是一个开发者一天登录多次的测试机器。这没有问题,但是你需要调整你的规则。你可能添加一条规则,不可以通过移动设备登录机器。换句话说,你需要根据自己的状况构建你的协议,不要假设某个方案放之四海而皆准。 - -## 软件 - -至于软件,毫不意外,现实世界中并没有很多好的,可用的软件解决方案去存储和管理你的私钥。但是应该有吗?考虑到这个,如果你有一个程序存储你所有服务器的全部密钥,并且这个程序被一个核心密钥锁住,那么你的密钥就真的安全了吗?或者,同样的,如果你的密钥被放置在你的硬盘上,用于 SSH 程序快速访问,那样一个密钥管理软件是否真正提供了任何保护吗? - -但是对于整体基础设施和创建,管理公钥,有许多的解决方案。我已经提到了 Puppet。在 Puppet 的世界中,你创建模块来以不同的方式管理你的服务器。这个想法是服务器是动态的,而且不必要准确地复制其他机器。[这里有一个聪明的途径](http://manuel.kiessling.net/2014/03/26/building-manageable-server-infrastructures-with-puppet-part-4/),它在不同的服务器上使用相同的密钥,但是对于每一个用户使用不同的 Puppet 模块。这个方案可能适合你,也可能不适合你。 - -或者,另一个选项就是完全换挡。在 Docker 的世界中,你可以采取一个不同的方式,正如[关于 SSH 和 Docker 博客](http://blog.docker.com/2014/06/why-you-dont-need-to-run-sshd-in-docker/)所描述的。 - -但是怎么样管理私钥?如果你搜索,你无法找到很多的软件选择,原因我之前提到过;密钥存放在你的硬盘上,一个管理软件可能无法提到很多额外的安全。但是我确实使用这种方法来管理我的密钥: - -首先,我的 `.ssh/config` 文件中有很多的主机项。我有一个我登陆的主机项,但是有时我对于一个单独的主机有不止一项。如果我有很多登陆,那种情况就会发生。对于架设我的 git 库的服务器,我有两个不同的登陆项;一个限制于 git,另一个为普遍目的的 bash 访问。这个为 git 设置的登陆选项在机器上有极大的限制。还记得我之前说的关于我存在于远程开发机器上的 git 密钥吗?好了。虽然这些密钥可以登陆到我其中一个服务器,但是使用的账号是被严格限制的。 - -其次,大部分的私钥都包含口令字。(对于处理不得不多次输入口令字的情况,考虑使用 [ssh-agent](http://blog.docker.com/2014/06/why-you-dont-need-to-run-sshd-in-docker/)。) - -再次,我确实有许多服务器,我想要更加小心地防御,并且在我 host 文件中并没有这样的项。这更加接近于社交工程方面,因为密钥文件还存在于那里,但是可能需要攻击者花费更长的时间去定位这个密钥文件,分析出来他们攻击的机器。在这些例子中,我只是手动打出来长的 SSH 命令。(这真不怎么坏。) - -同时你可以看出来我没有使用任何特别的软件去管理这些私钥。 - -## 无放之四海而皆准的方案 - -我们偶然间收到 linux.com 的问题,关于管理密钥的好软件的建议。但是让我们后退一步。这个问题事实上需要重新定制,因为没有一个普适的解决方案。你问的问题基于你自己的状况。你是否简单地尝试找到一个位置去存储你的密钥文件?你是否寻找一个方法去管理多用户问题,其中每个人都需要将他们自己的公钥插入到 `authorized_keys` 文件中? - -通过这篇文章,我已经囊括了基础知识,希望到此你明白如何管理你的密钥,并且,只有当你问了正确的问题,无论你寻找任何软件(甚至你需要另外的软件),它都会出现。 - ------------------------------------------------------------------------------- - -via: http://www.linux.com/learn/tutorials/838235-how-to-best-manage-encryption-keys-on-linux - -作者:[Jeff Cogswell][a] -译者:[mudongliang](https://github.com/mudongliang) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.linux.com/community/forums/person/62256 From 881615ade8c5473f69836b0f654f4c675dbe67bf Mon Sep 17 00:00:00 2001 From: FrankXinqi Date: Sun, 10 Jul 2016 13:18:33 +0800 Subject: [PATCH 1114/1469] Delete 20151117 How bad a boss is Linus Torvalds.md --- ...151117 How bad a boss is Linus Torvalds.md | 78 ------------------- 1 file changed, 78 deletions(-) delete mode 100644 sources/talk/20151117 How bad a boss is Linus Torvalds.md diff --git a/sources/talk/20151117 How bad a boss is Linus Torvalds.md b/sources/talk/20151117 How bad a boss is Linus Torvalds.md deleted file mode 100644 index 552155a18c..0000000000 --- a/sources/talk/20151117 How bad a boss is Linus Torvalds.md +++ /dev/null @@ -1,78 +0,0 @@ -Translating by FrankXinqi -How bad a boss is Linus Torvalds? -================================================================================ -![linus torvalds](http://images.techhive.com/images/article/2015/08/linus_torvalds-100600260-primary.idge.jpg) - -*Linus Torvalds addressed a packed auditorium of Linux enthusiasts during his speech at the LinuxWorld show in San Jose, California, on August 10, 1999. Credit: James Niccolai* - -**It depends on context. In the world of software development, he’s what passes for normal. The question is whether that situation should be allowed to continue.** - -I've known Linus Torvalds, Linux's inventor, for over 20 years. We're not chums, but we like each other. - -Lately, Torvalds has been getting a lot of flack for his management style. Linus doesn't suffer fools gladly. He has one way of judging people in his business of developing the Linux kernel: How good is your code? - -Nothing else matters. As Torvalds said earlier this year at the Linux.conf.au Conference, "I'm not a nice person, and I don't care about you. [I care about the technology and the kernel][1] -- that's what's important to me." - -Now, I can deal with that kind of person. If you can't, you should avoid the Linux kernel community, where you'll find a lot of this kind of meritocratic thinking. Which is not to say that I think everything in Linuxland is hunky-dory and should be impervious to calls for change. A meritocracy I can live with; a bastion of male dominance where women are subjected to scorn and disrespect is a problem. - -That's why I see the recent brouhaha about Torvalds' management style -- or more accurately, his total indifference to the personal side of management -- as nothing more than standard operating procedure in the world of software development. And at the same time, I see another instance that has come to light as evidence of a need for things to really change. - -The first situation arose with the [release of Linux 4.3][2], when Torvalds used the Linux Kernel Mailing List to tear into a developer who had inserted some networking code that Torvalds thought was -- well, let's say "crappy." "[[A]nd it generates [crappy] code.][3] It looks bad, and there's no reason for it." He goes on in this vein for quite a while. Besides the word "crap" and its earthier synonym, he uses the word "idiotic" pretty often. - -Here's the thing, though. He's right. I read the code. It's badly written and it does indeed seem to have been designed to use the new "overflow_usub()" function just for the sake of using it. - -Now, some people see this diatribe as evidence that Torvalds is a bad-tempered bully. I see a perfectionist who, within his field, doesn't put up with crap. - -Many people have told me that this is not how professional programmers should act. People, have you ever worked with top developers? That's exactly how they act, at Apple, Microsoft, Oracle and everywhere else I've known them. - -I've heard Steve Jobs rip a developer to pieces. I've cringed while a senior Oracle developer lead tore into a room of new programmers like a piranha through goldfish. - -In Accidental Empires, his classic book on the rise of PCs, Robert X. Cringely described Microsoft's software management style when Bill Gates was in charge as a system where "Each level, from Gates on down, screams at the next, goading and humiliating them." Ah, yes, that's the Microsoft I knew and hated. - -The difference between the leaders at big proprietary software companies and Torvalds is that he says everything in the open for the whole world to see. The others do it in private conference rooms. I've heard people claim that Torvalds would be fired in their company. Nope. He'd be right where he is now: on top of his programming world. - -Oh, and there's another difference. If you get, say, Larry Ellison mad at you, you can kiss your job goodbye. When you get Torvalds angry at your work, you'll get yelled at in an email. That's it. - -You see, Torvalds isn't anyone's boss. He's the guy in charge of a project with about 10,000 contributors, but he has zero hiring and firing authority. He can hurt your feelings, but that's about it. - -That said, there is a serious problem within both open-source and proprietary software development circles. No matter how good a programmer you are, if you're a woman, the cards are stacked against you. - -No case shows this better than that of Sarah Sharp, an Intel developer and formerly a top Linux programmer. [In a post on her blog in October][4], she explained why she had stopped contributing to the Linux kernel more than a year earlier: "I finally realized that I could no longer contribute to a community where I was technically respected, but I could not ask for personal respect.... I did not want to work professionally with people who were allowed to get away with subtle sexist or homophobic jokes." - -Who can blame her? I can't. Torvalds, like almost every software manager I've ever known, I'm sorry to say, has permitted a hostile work environment. - -He would probably say that it's not his job to ensure that Linux contributors behave with professionalism and mutual respect. He's concerned with the code and nothing but the code. - -As Sharp wrote: - -> I have the utmost respect for the technical efforts of the Linux kernel community. They have scaled and grown a project that is focused on maintaining some of the highest coding standards out there. The focus on technical excellence, in combination with overloaded maintainers, and people with different cultural and social norms, means that Linux kernel maintainers are often blunt, rude, or brutal to get their job done. Top Linux kernel developers often yell at each other in order to correct each other's behavior. -> -> That's not a communication style that works for me. … -> -> Many senior Linux kernel developers stand by the right of maintainers to be technically and personally brutal. Even if they are very nice people in person, they do not want to see the Linux kernel communication style change. - -She's right. - -Where I differ from other observers is that I don't think that this problem is in any way unique to Linux or open-source communities. With five years of work in the technology business and 25 years as a technology journalist, I've seen this kind of immature boy behavior everywhere. - -It's not Torvalds' fault. He's a technical leader with a vision, not a manager. The real problem is that there seems to be no one in the software development universe who can set a supportive tone for teams and communities. - -Looking ahead, I hope that companies and organizations, such as the Linux Foundation, can find a way to empower community managers or other managers to encourage and enforce civil behavior. - -We won't, unfortunately, find that kind of managerial finesse in our pure technical or business leaders. It's not in their DNA. - --------------------------------------------------------------------------------- - -via: http://www.computerworld.com/article/3004387/it-management/how-bad-a-boss-is-linus-torvalds.html - -作者:[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.computerworld.com/article/2874475/linus-torvalds-diversity-gaffe-brings-out-the-best-and-worst-of-the-open-source-world.html -[2]:http://www.zdnet.com/article/linux-4-3-released-after-linus-torvalds-scraps-brain-damage-code/ -[3]:http://lkml.iu.edu/hypermail/linux/kernel/1510.3/02866.html -[4]:http://sarah.thesharps.us/2015/10/05/closing-a-door/ From 6af4748c8c461292252d40bab071a9e9290248cc Mon Sep 17 00:00:00 2001 From: FrankXinqi Date: Sun, 10 Jul 2016 13:21:17 +0800 Subject: [PATCH 1115/1469] Finish Translating How bad a boss is Linus Torvalds --- ...151117 How bad a boss is Linus Torvalds.md | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 translated/talk/20151117 How bad a boss is Linus Torvalds.md diff --git a/translated/talk/20151117 How bad a boss is Linus Torvalds.md b/translated/talk/20151117 How bad a boss is Linus Torvalds.md new file mode 100644 index 0000000000..5c7375c190 --- /dev/null +++ b/translated/talk/20151117 How bad a boss is Linus Torvalds.md @@ -0,0 +1,80 @@ +Translated by FrankXinqi + +Linus Torvalds作为一个老板有多么糟糕? +================================================================================ +![linus torvalds](http://images.techhive.com/images/article/2015/08/linus_torvalds-100600260-primary.idge.jpg) + +*1999 年 8 月 10 日,加利福尼亚州圣何塞市,在 LinuxWorld Show 上 Linus Torvalds 在一个坐满 Linux 爱好者的礼堂中发表了一篇演讲。作者:James Niccolai* + +**这取决于所处的领域。在软件开发的世界中,他变得更加平庸。问题是,这种情况是否应该被允许继续?** + +Linus Torvalds 是 Linux 的发明者,我认识他超过 20 年了。我们不是密友,但是我们欣赏彼此。 + +最近,因为 Linus Torvalds 的管理风格,他正遭到严厉的炮轰。Linus 无法忍受胡来的人。「代码的质量有多好?」是他在 Linux 内核的开发过程中评判人的一种方式。 + +没有什么比这个更重要了。正如 Linus 今年(1999年)早些时候在 Linux.conf.au 会议上说的那样,「我不是一个友好的人,并且我不关心你。对我重要的是『[我所关心的技术和内核][1]』。」 + +现在我也可以和这只关心技术的这一类人打交道了。如果你不能,你应当避免参加 Linux 内核会议,因为在那里你会遇到许多有这种精英思想的人。这不代表我认为在 Linux 领域所有东西都是极好的,并且应该不受其他影响的来激起改变。我能够一起生活的一个精英;在一个男性做主导的大城堡中遇到的问题是,女性经常受到蔑视和无礼的对待。 + +这就是我看到的最近关于 Linus 管理风格所引发社会争吵的原因 -- 或者更准确的说,他对于个人管理方面是完全冷漠的 -- 就像不过是在软件开发世界的标准操作流程一样。与此同时,我看到了另外一个非常需要被改变的事实,它必须作为证据公开。 + +第一次是在 [Linux 4.3 发布][2]的时候出现的这个情况,Linus 使用 Linux 内核邮件列表来狠狠的攻击一个插入了非常糟糕并且没有价值的网络代码的开发者。「[这段代码导致了非常糟糕并且没有价值的代码。][3]这看起来太糟糕了,并且完全没有理由这样做。」当他说到这里的时候,他沉默了很长时间。除了使用「非常糟糕并且没有价值」这个词,他在早期使用「愚蠢的」这个同义词是相对较好的。 + +但是,事情就是这样。Linus 是对的。我读了代码后,发现代码确实很烂并且开发者是为了使用新的「overflow_usub()」 函数而使用的。 + +现在,一些人把 Linus 的这种谩骂的行为看作他脾气不好而且恃强凌弱的证据。我见过一个完美主义者,在他的领域中,他无法忍受这种糟糕。 + +许多人告诉我,这不是一个专业的程序员应当有的行为。人们,你曾经和最优秀的开发者一起工作过吗?据我所知道的,在 Apple,Microsoft,Oracle 这就是他们的行为。 + +我曾经听过 Steve Jobs 攻击一个开发者,像把他撕成碎片那样。我大为不快,当一个 Oracle 的高级开发者攻击一屋子的新开发者的时候就像食人鱼穿过一群金鱼那样。 + +在意外的电脑帝国,在 Robert X. Cringely 关于 PCs 崛起的经典书籍中,他这样描述 Bill Gates 的微软软件管理风格,Bill Gates 像计算机系统一样管理他们,『比尔盖茨是最高等级,从他开始每一个等级依次递减,上级会向下级叫嚷,刺激他们,甚至羞辱他们。』 + +Linus 和所有大型的私有软件公司的领导人不同的是,Linus 说在这里所有的东西是向全世界公开的。而其他人是在私有的会议室中做东西的。我听有人说 Linus 在那种公司中可能会被开除。这是不可能的。他会在正确的地方就像现在这样,他在编程世界的最顶端。 + +但是,这里有另外一个不同。如果 Larry Ellison (Oracle的首席执行官)向你发火,你就别想在这里干了。如果 Linus 向你发火,你会在邮件中收到他的责骂。这就是差别。 + +你知道的,Linus 不是任何人的老板。他完全没有雇佣和解聘的权利,他只是负责着有 10,000 个贡献者的一个项目而已。他仅仅能做的就是从心理上伤害你。 + +这说明,在开源软件开发圈和私有软件开发圈中同时存在一个非常严重的问题。不管你是一个多么好的编程者,如果你是一个女性,你的这个身份就是对你不利的。 + +这种情况并没有在 Sarah Sharp 的身上有任何好转,她现在是一个Intel的开发者,以前是一个顶尖的Linux程序员。[在她博客10月份的一个帖子中][4],她解释道:『我最终发现,我不能够再为Linux社区做出贡献了。因为在在那里,我虽然能够得到技术上的尊重,却得不到个人的尊重……我不想专职于同那些轻微的性别歧视者或开同性恋玩笑的人一起工作。』 + +谁能责怪她呢?我不能。我非常伤心的说,Linus 就像所有我见过的软件经理一样,是他造成了这种不利的工作环境。 + +他可能会说,确保 Linux 的贡献者都表现出专业精神和相互尊重不应该是他的工作。除了代码以外,他不关系任何其他事情。 + +就像Sarah Sharp写的那样: + + +> 我对于 Linux 内核社区做出的技术努力表现出非常的尊重。他们在那维护一些最高标准的代码,以此来平衡并且发展一个项目。他们专注于优秀的技术,却带有过量的维护人员,他们有不同的文化背景和社会规范,这些意味着这些 Linux 内核维护者说话非常直率,粗鲁或者为了完成他们的任务而不讲道理。顶尖的 Linux 内核开发者经常为了使别人改正行为而向他们大喊大叫。 +> +> 这种事情发生在我身上,但它不是一种有效的沟通方式。 +> +> 许多高级的 Linux 内核开发者支持那些技术上和人性上不讲道理的维护者的权利。即使他们是非常友好的人,他们不想看到 Linux 内核交流方式改变。 + +她是对的。 + +我和其他调查者不同的是,我不认为这个问题对于 Linux 或开源社区在任何方面有特殊之处。作为一个从事技术商业工作超过五年和有着 25 年技术工作经历的记者,我随处可见这种不成熟的男孩的行为。 + +这不是 Linus 的错误。他不是一个经理,他是一个有想象力的技术领导者。看起来真正的问题是,在软件开发领域没有人能够用一种支持的语气来对待团队和社区。 + +展望未来,我希望像 Linux Foundation 这样的公司和组织,能够找到一种方式去授权社区经理或其他经理来鼓励并且强制实施民主的行为。 + +非常遗憾的是,我们不能够在我们这种纯技术或纯商业的领导人中找到这种管理策略。它不存在于这些人的基因中。 + +-------------------------------------------------------------------------------- + +via: http://www.computerworld.com/article/3004387/it-management/how-bad-a-boss-is-linus-torvalds.html + +作者:[Steven J. Vaughan-Nichols][a] +译者:[FrankXinqi](https://github.com/FrankXinqi) +校对:[校对者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.computerworld.com/article/2874475/linus-torvalds-diversity-gaffe-brings-out-the-best-and-worst-of-the-open-source-world.html +[2]:http://www.zdnet.com/article/linux-4-3-released-after-linus-torvalds-scraps-brain-damage-code/ +[3]:http://lkml.iu.edu/hypermail/linux/kernel/1510.3/02866.html +[4]:http://sarah.thesharps.us/2015/10/05/closing-a-door/ From a703d7b4d351d4e0b90541d39b1e8057fa3210cc Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 10 Jul 2016 15:34:57 +0800 Subject: [PATCH 1116/1469] =?UTF-8?q?20160710-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...r game with python and asyncio - part 1.md | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 sources/tech/20160524 Writing online multiplayer game with python and asyncio - part 1.md diff --git a/sources/tech/20160524 Writing online multiplayer game with python and asyncio - part 1.md b/sources/tech/20160524 Writing online multiplayer game with python and asyncio - part 1.md new file mode 100644 index 0000000000..62af26b481 --- /dev/null +++ b/sources/tech/20160524 Writing online multiplayer game with python and asyncio - part 1.md @@ -0,0 +1,72 @@ +Writing online multiplayer game with python and asyncio - part 1 +=================================================================== + +Have you ever combined async with Python? Here I’ll tell you how to do it and show it on a [working example][1] - a popular Snake game, designed for multiple players. + +[Play gmae][2] + +### 1. Introduction + +Massive multiplayer online games are undoubtedly one of the main trends of our century, in both tech and cultural domains. And while for a long time writing a server for a MMO game was associated with massive budgets and complex low-level programming techniques, things are rapidly changing in the recent years. Modern frameworks based on dynamic languages allow handling thousands of parallel user connections on moderate hardware. At the same time, HTML 5 and WebSockets standards enabled the creation of real-time graphics-based game clients that run directly in web browser, without any extensions. + +Python may be not the most popular tool for creating scalable non-blocking servers, especially comparing to node.js popularity in this area. But the latest versions of Python are aimed to change this. The introduction of [asyncio][3] library and a special [async/await][4] syntax makes asynchronous code look as straightforward as regular blocking code, which now makes Python a worthy choice for asynchronous programming. So I will try to utilize these new features to demonstrate a way to create an online multiplayer game. + +### 2. Getting asynchronous + +A game server should handle a maximum possible number of parallel users' connections and process them all in real time. And a typical solution - creating threads, doesn't solve a problem in this case. Running thousands of threads requires CPU to switch between them all the time (it is called context switching), which creates big overhead, making it very ineffective. Even worse with processes, because, in addition, they do occupy too much memory. In Python there is even one more problem - regular Python interpreter (CPython) is not designed to be multithreaded, it aims to achieve maximum performance for single-threaded apps instead. That's why it uses GIL (global interpreter lock), a mechanism which doesn't allow multiple threads to run Python code at the same time, to prevent uncontrolled usage of the same shared objects. Normally the interpreter switches to another thread when currently running thread is waiting for something, usually a response from I/O (like a response from web server for example). This allows having non-blocking I/O operations in your app, because every operation blocks only one thread instead of blocking the whole server. However, it also makes general multithreading idea nearly useless, because it doesn't allow you to execute python code in parallel, even on multi-core CPU. While at the same time it is completely possible to have non-blocking I/O in one single thread, thus eliminating the need of heavy context-switching. + +Actually, a single-threaded non-blocking I/O is a thing you can do in pure python. All you need is a standard [select][5] module which allows you to write an event loop waiting for I/O from non-blocking sockets. However, this approach requires you to define all the app logic in one place, and soon your app becomes a very complex state-machine. There are frameworks that simplify this task, most popular are [tornado][6] and [twisted][7]. They are utilized to implement complex protocols using callback methods (and this is similar to node.js). The framework runs its own event loop invoking your callbacks on the defined events. And while this may be a way to go for some, it still requires programming in callback style, what makes your code fragmented. Compare this to just writing synchronous code and running multiple copies concurrently, like we would do with normal threads. Why wouldn't this be possible in one thread? + +And this is where the concept of microthreads come in. The idea is to have concurrently running tasks in one thread. When you call a blocking function in one task, behind the scenes it calls a "manager" (or "scheduler") that runs an event loop. And when there is some event ready to process, a manager passes execution to a task waiting for it. That task will also run until it reaches a blocking call, and then it will return execution to a manager again. + +>Microthreads are also called lightweight threads or green threads (a term which came from Java world). Tasks which are running concurrently in pseudo-threads are called tasklets, greenlets or coroutines. + +One of the first implementations of microthreads in Python was [Stackless Python][8]. It got famous because it is used in a very successful online game [EVE online][9]. This MMO game boasts about a persistent universe, where thousands of players are involved in different activities, all happening in the real time. Stackless is a standalone Python interpreter which replaces standard function calling stack and controls the flow directly to allow minimum possible context-switching expenses. Though very effective, this solution remained less popular than "soft" libraries that work with a standard interpreter. Packages like [eventlet][10] and [gevent][11] come with patching of a standard I/O library in the way that I/O function pass execution to their internal event loop. This allows turning normal blocking code into non-blocking in a very simple way. The downside of this approach is that it is not obvious from the code, which calls are non-blocking. A newer version of Python introduced native coroutines as an advanced form of generators. Later in Python 3.4 they included asyncio library which relies on native coroutines to provide single-thread concurrency. But only in python 3.5 coroutines became an integral part of python language, described with the new keywords async and await. Here is a simple example, which illustrates using asyncio to run concurrent tasks: + +``` +import asyncio + +async def my_task(seconds): + print("start sleeping for {} seconds".format(seconds)) + await asyncio.sleep(seconds) + print("end sleeping for {} seconds".format(seconds)) + +all_tasks = asyncio.gather(my_task(1), my_task(2)) +loop = asyncio.get_event_loop() +loop.run_until_complete(all_tasks) +loop.close() +``` + +We launch two tasks, one sleeps for 1 second, the other - for 2 seconds. The output is: + +``` +start sleeping for 1 seconds +start sleeping for 2 seconds +end sleeping for 1 seconds +end sleeping for 2 seconds +``` + +As you can see, coroutines do not block each other - the second task starts before the first is finished. This is happening because asyncio.sleep is a coroutine which returns execution to a scheduler until the time will pass. In the next section, we will use coroutine-based tasks to create a game loop. + +-------------------------------------------------------------------------------- + +via: https://7webpages.com/blog/writing-online-multiplayer-game-with-python-asyncio-getting-asynchronous/ + +作者:[Kyrylo Subbotin][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://7webpages.com/blog/writing-online-multiplayer-game-with-python-asyncio-getting-asynchronous/ +[1]: http://snakepit-game.com/ +[2]: http://snakepit-game.com/ +[3]: https://docs.python.org/3/library/asyncio.html +[4]: https://docs.python.org/3/whatsnew/3.5.html#whatsnew-pep-492 +[5]: https://docs.python.org/2/library/select.html +[6]: http://www.tornadoweb.org/ +[7]: http://twistedmatrix.com/ +[8]: http://www.stackless.com/ +[9]: http://www.eveonline.com/ +[10]: http://eventlet.net/ +[11]: http://www.gevent.org/ From 29ea3e80ac4610c3de0fdf91989deabc010980a7 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 10 Jul 2016 15:35:13 +0800 Subject: [PATCH 1117/1469] =?UTF-8?q?20160710-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...r game with python and asyncio - part 2.md | 233 ++++++++++++++++++ 1 file changed, 233 insertions(+) create mode 100644 sources/tech/20160531 Writing online multiplayer game with python and asyncio - part 2.md diff --git a/sources/tech/20160531 Writing online multiplayer game with python and asyncio - part 2.md b/sources/tech/20160531 Writing online multiplayer game with python and asyncio - part 2.md new file mode 100644 index 0000000000..a33b0b0fdc --- /dev/null +++ b/sources/tech/20160531 Writing online multiplayer game with python and asyncio - part 2.md @@ -0,0 +1,233 @@ +Writing online multiplayer game with python and asyncio - Part 2 +================================================================== + +![](https://7webpages.com/media/cache/fd/d1/fdd1f8f8bbbf4166de5f715e6ed0ac00.gif) + +Have you ever made an asynchronous Python app? Here I’ll tell you how to do it and in the next part, show it on a [working example][1] - a popular Snake game, designed for multiple players. + +see the intro and theory about how to [Get Asynchronous [part 1]][2] + +[Play the game][3] + +### 3. Writing game loop + +The game loop is a heart of every game. It runs continuously to get player's input, update state of the game and render the result on the screen. In online games the loop is divided into client and server parts, so basically there are two loops which communicate over the network. Usually, client role is to get player's input, such as keypress or mouse movement, pass this data to a server and get back the data to render. The server side is processing all the data coming from players, updating game's state, doing necessary calculations to render next frame and passes back the result, such as new placement of game objects. It is very important not to mix client and server roles without a solid reason. If you start doing game logic calculations on the client side, you can easily go out of sync with other clients, and your game can also be created by simply passing any data from the client side. + +A game loop iteration is often called a tick. Tick is an event meaning that current game loop iteration is over and the data for the next frame(s) is ready. +In the next examples we will use the same client, which connects to a server from a web page using WebSocket. It runs a simple loop which passes pressed keys' codes to the server and displays all messages that come from the server. [Client source code is located here][4]. + +#### Example 3.1: Basic game loop + +[Example 3.1 source code][5] + +We will use [aiohttp][6] library to create a game server. It allows creating web servers and clients based on asyncio. A good thing about this library is that it supports normal http requests and websockets at the same time. So we don't need other web servers to render game's html page. + +Here is how we run the server: + +``` +app = web.Application() +app["sockets"] = [] + +asyncio.ensure_future(game_loop(app)) + +app.router.add_route('GET', '/connect', wshandler) +app.router.add_route('GET', '/', handle) + +web.run_app(app) +``` + +web.run_app is a handy shortcut to create server's main task and to run asyncio event loop with it's run_forever() method. I suggest you check the source code of this method to see how the server is actually created and terminated. + +An app is a dict-like object which can be used to share data between connected clients. We will use it to store a list of connected sockets. This list is then used to send notification messages to all connected clients. A call to asyncio.ensure_future() will schedule our main game_loop task which sends 'tick' message to clients every 2 seconds. This task will run concurrently in the same asyncio event loop along with our web server. + +There are 2 web request handlers: handle just serves a html page and wshandler is our main websocket server's task which handles interaction with game clients. With every connected client a new wshandler task is launched in the event loop. This task adds client's socket to the list, so that game_loop task may send messages to all the clients. Then it echoes every keypress back to the client with a message. + +In the launched tasks we are running worker loops over the main event loop of asyncio. A switch between tasks happens when one of them uses await statement to wait for a coroutine to finish. For instance, asyncio.sleep just passes execution back to a scheduler for a given amount of time, and ws.receive() is waiting for a message from websocket, while the scheduler may switch to some other task. + +After you open the main page in a browser and connect to the server, just try to press some keys. Their codes will be echoed back from the server and every 2 seconds this message will be overwritten by game loop's 'tick' message which is sent to all clients. + +So we have just created a server which is processing client's keypresses, while the main game loop is doing some work in the background and updates all clients periodically. + +#### Example 3.2: Starting game loop by request + +[Example 3.2 source code][7] + +In the previous example a game loop was running continuously all the time during the life of the server. But in practice, there is usually no sense to run game loop when no one is connected. Also, there may be different game "rooms" running on one server. In this concept one player "creates" a game session (a match in a multiplayer game or a raid in MMO for example) so other players may join it. Then a game loop runs while the game session continues. + +In this example we use a global flag to check if a game loop is running, and we start it when the first player connects. In the beginning, a game loop is not running, so the flag is set to False. A game loop is launched from the client's handler: + +``` + if app["game_is_running"] == False: + asyncio.ensure_future(game_loop(app)) +``` + +This flag is then set to True at the start of game loop() and then back to False in the end, when all clients are disconnected. + +#### Example 3.3: Managing tasks + +[Example 3.3 source code][8] + +This example illustrates working with task objects. Instead of storing a flag, we store game loop's task directly in our application's global dict. This may be not an optimal thing to do in a simple case like this, but sometimes you may need to control already launched tasks. +``` + if app["game_loop"] is None or \ + app["game_loop"].cancelled(): + app["game_loop"] = asyncio.ensure_future(game_loop(app)) +``` + +Here ensure_future() returns a task object that we store in a global dict; and when all users disconnect, we cancel it with + +``` + app["game_loop"].cancel() +``` + +This cancel() call tells scheduler not to pass execution to this coroutine anymore and sets its state to cancelled which then can be checked by cancelled() method. And here is one caveat worth to mention: when you have external references to a task object and exception happens in this task, this exception will not be raised. Instead, an exception is set to this task and may be checked by exception() method. Such silent fails are not useful when debugging a code. Thus, you may want to raise all exceptions instead. To do so you need to call result() method of unfinished task explicitly. This can be done in a callback: + +``` + app["game_loop"].add_done_callback(lambda t: t.result()) +``` + +Also if we are going to cancel this task in our code and we don't want to have CancelledError exception, it has a point checking its "cancelled" state: +``` + app["game_loop"].add_done_callback(lambda t: t.result() + if not t.cancelled() else None) +``` + +Note that this is required only if you store a reference to your task objects. In the previous examples all exceptions are raised directly without additional callbacks. + +#### Example 3.4: Waiting for multiple events + +[Example 3.4 source code][9] + +In many cases, you need to wait for multiple events inside client's handler. Beside a message from a client, you may need to wait for different types of things to happen. For instance, if your game's time is limited, you may wait for a signal from timer. Or, you may wait for a message from other process using pipes. Or, for a message from a different server in the network, using a distributed messaging system. + +This example is based on example 3.1 for simplicity. But in this case we use Condition object to synchronize game loop with connected clients. We do not keep a global list of sockets here as we are using sockets only within the handler. When game loop iteration ends, we notify all clients using Condition.notify_all() method. This method allows implementing publish/subscribe pattern within asyncio event loop. + +To wait for two events in the handler, first, we wrap awaitable objects in a task using ensure_future() + +``` + if not recv_task: + recv_task = asyncio.ensure_future(ws.receive()) + if not tick_task: + await tick.acquire() + tick_task = asyncio.ensure_future(tick.wait()) +``` + +Before we can call Condition.wait(), we need to acquire a lock behind it. That is why, we call tick.acquire() first. This lock is then released after calling tick.wait(), so other coroutines may use it too. But when we get a notification, a lock will be acquired again, so we need to release it calling tick.release() after received notification. + +We are using asyncio.wait() coroutine to wait for two tasks. + +``` + done, pending = await asyncio.wait( + [recv_task, + tick_task], + return_when=asyncio.FIRST_COMPLETED) +``` + +It blocks until either of tasks from the list is completed. Then it returns 2 lists: tasks which are done and tasks which are still running. If the task is done, we set it to None so it may be created again on the next iteration. + +#### Example 3.5: Combining with threads + +[Example 3.5 source code][10] + +In this example we combine asyncio loop with threads by running the main game loop in a separate thread. As I mentioned before, it's not possible to perform real parallel execution of python code with threads because of GIL. So it is not a good idea to use other thread to do heavy calculations. However, there is one reason to use threads with asyncio: this is the case when you need to use other libraries which do not support asyncio. Using these libraries in the main thread will simply block execution of the loop, so the only way to use them asynchronously is to run in a different thread. + +We run game loop using run_in_executor() method of asyncio loop and ThreadPoolExecutor. Note that game_loop() is not a coroutine anymore. It is a function that is executed in another thread. However, we need to interact with the main thread to notify clients on the game events. And while asyncio itself is not threadsafe, it has methods which allow running your code from another thread. These are call_soon_threadsafe() for normal functions and run_coroutine_threadsafe() for coroutines. We will put a code which notifies clients about game's tick to notify() coroutine and runs it in the main event loop from another thread. + +``` +def game_loop(asyncio_loop): + print("Game loop thread id {}".format(threading.get_ident())) + async def notify(): + print("Notify thread id {}".format(threading.get_ident())) + await tick.acquire() + tick.notify_all() + tick.release() + + while 1: + task = asyncio.run_coroutine_threadsafe(notify(), asyncio_loop) + # blocking the thread + sleep(1) + # make sure the task has finished + task.result() +``` + +When you launch this example, you will see that "Notify thread id" is equal to "Main thread id", this is because notify() coroutine is executed in the main thread. While sleep(1) call is executed in another thread, and, as a result, it will not block the main event loop. + +#### Example 3.6: Multiple processes and scaling up + +[Example 3.6 source code][11] + +One threaded server may work well, but it is limited to one CPU core. To scale the server beyond one core, we need to run multiple processes containing their own event loops. So we need a way for processes to interact with each other by exchanging messages or sharing game's data. Also in games, it is often required to perform heavy calculations, such as path finding and alike. These tasks are sometimes not possible to complete quickly within one game tick. It is not recommended to perform time-consuming calculations in coroutines, as it will block event processing, so in this case, it may be reasonable to pass the heavy task to other process running in parallel. + +The easiest way to utilize multiple cores is to launch multiple single core servers, like in the previous examples, each on a different port. You can do this with supervisord or similar process-controller system. Then, you may use a load balancer, such as HAProxy, to distribute connecting clients between the processes. There are different ways for processes to interact wich each other. One is to use network-based systems, which allows you to scale to multiple servers as well. There are already existing adapters to use popular messaging and storage systems with asyncio. Here are some examples: + +- [aiomcache][12] for memcached client +- [aiozmq][13] for zeroMQ +- [aioredis][14] for Redis storage and pub/sub + +You can find many other packages like this on github and pypi, most of them have "aio" prefix. + +Using network services may be effective to store persistent data and exchange some kind of messages. But its performance may be not enough if you need to perform real-time data processing that involves inter-process communications. In this case, a more appropriate way may be using standard unix pipes. asyncio has support for pipes and there is a [very low-level example of the server which uses pipes][15] in aiohttp repository. + +In the current example, we will use python's high-level [multiprocessing][16] library to instantiate new process to perform heavy calculations on a different core and to exchange messages with this process using multiprocessing.Queue. Unfortunately, the current implementation of multiprocessing is not compatible with asyncio. So every blocking call will block the event loop. But this is exactly the case where threads will be helpful because if we run multiprocessing code in a different thread, it will not block our main thread. All we need is to put all inter-process communications to another thread. This example illustrates this technique. It is very similar to multi-threading example above, but we create a new process from a thread. + +``` +def game_loop(asyncio_loop): + # coroutine to run in main thread + async def notify(): + await tick.acquire() + tick.notify_all() + tick.release() + + queue = Queue() + + # function to run in a different process + def worker(): + while 1: + print("doing heavy calculation in process {}".format(os.getpid())) + sleep(1) + queue.put("calculation result") + + Process(target=worker).start() + + while 1: + # blocks this thread but not main thread with event loop + result = queue.get() + print("getting {} in process {}".format(result, os.getpid())) + task = asyncio.run_coroutine_threadsafe(notify(), asyncio_loop) + task.result() +``` + +Here we run worker() function in another process. It contains a loop doing heavy calculations and putting results to the queue, which is an instance of multiprocessing.Queue. Then we get the results and notify clients in the main event loop from a different thread, exactly as in the example 3.5. This example is very simplified, it doesn't have a proper termination of the process. Also, in a real game, we would probably use the second queue to pass data to the worker. + +There is a project called [aioprocessing][17], which is a wrapper around multiprocessing that makes it compatible with asyncio. However, it uses exactly the same approach as described in this example - creating processes from threads. It will not give you any advantage, other than hiding these tricks behind a simple interface. Hopefully, in the next versions of Python, we will get a multiprocessing library based on coroutines and supports asyncio. + +>Important! If you are going to run another asyncio event loop in a different thread or sub-process created from main thread/process, you need to create a loop explicitly, using asyncio.new_event_loop(), otherwise, it will not work. + +-------------------------------------------------------------------------------- + +via: https://7webpages.com/blog/writing-online-multiplayer-game-with-python-and-asyncio-writing-game-loop/ + +作者:[Kyrylo Subbotin][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://7webpages.com/blog/writing-online-multiplayer-game-with-python-and-asyncio-writing-game-loop/ +[1]: http://snakepit-game.com/ +[2]: https://7webpages.com/blog/writing-online-multiplayer-game-with-python-asyncio-getting-asynchronous/ +[3]: http://snakepit-game.com/ +[4]: https://github.com/7WebPages/snakepit-game/blob/master/simple/index.html +[5]: https://github.com/7WebPages/snakepit-game/blob/master/simple/game_loop_basic.py +[6]: http://aiohttp.readthedocs.org/ +[7]: https://github.com/7WebPages/snakepit-game/blob/master/simple/game_loop_handler.py +[8]: https://github.com/7WebPages/snakepit-game/blob/master/simple/game_loop_global.py +[9]: https://github.com/7WebPages/snakepit-game/blob/master/simple/game_loop_wait.py +[10]: https://github.com/7WebPages/snakepit-game/blob/master/simple/game_loop_thread.py +[11]: https://github.com/7WebPages/snakepit-game/blob/master/simple/game_loop_process.py +[12]: https://github.com/aio-libs/aiomcache +[13]: https://github.com/aio-libs/aiozmq +[14]: https://github.com/aio-libs/aioredis +[15]: https://github.com/KeepSafe/aiohttp/blob/master/examples/mpsrv.py +[16]: https://docs.python.org/3.5/library/multiprocessing.html +[17]: https://github.com/dano/aioprocessing From 873e8caa692723e7671aed69b4f44a6fd7316c0a Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 10 Jul 2016 15:53:05 +0800 Subject: [PATCH 1118/1469] =?UTF-8?q?20160710-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...r game with python and asyncio - part 3.md | 137 ++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 sources/tech/20160606 Writing online multiplayer game with python and asyncio - part 3.md diff --git a/sources/tech/20160606 Writing online multiplayer game with python and asyncio - part 3.md b/sources/tech/20160606 Writing online multiplayer game with python and asyncio - part 3.md new file mode 100644 index 0000000000..90cf71c466 --- /dev/null +++ b/sources/tech/20160606 Writing online multiplayer game with python and asyncio - part 3.md @@ -0,0 +1,137 @@ +Writing online multiplayer game with python and asyncio - Part 3 +================================================================= + +![](https://7webpages.com/media/cache/17/81/178135a6db5074c72a1394d31774c658.gif) + +In this series, we are making an asynchronous Python app on the example of a multiplayer [Snake game][1]. The previous article focused on [Writing Game Loop][2] and Part 1 was covering how to [Get Asynchronous][3]. + +You can find the code [here][4]. + +### 4. Making a complete game + +![](https://7webpages.com/static/img/14chs7.gif) + +#### 4.1 Project's overview + +In this part, we will review a design of a complete online game. It is a classic snake game with added multiplayer. You can try it yourself at (). A source code is located [in github repository][5]. The game consists of the following files: + +- [server.py][6] - a server handling main game loop and connections. +- [game.py][7] - a main Game class, which implements game's logic and most of the game's network protocol. +- [player.py][8] - Player class, containing individual player's data and snake's representation. This one is responsible for getting player's input and moving the snake accordingly. +- [datatypes.py][9] - basic data structures. +- [settings.py][10] - game settings, and it has descriptions in commentaries. +- [index.html][11] - all html and javascript client part in one file. + +#### 4.2 Inside a game loop + +Multiplayer snake game is a good example to learn because of its simplicity. All snakes move to one position every single frame, and frames are changing at a very slow rate, allowing you to watch how game engine is working actually. There is no instant reaction to player's keypresses because of the slow speed. A pressed key is remembered and then taken into account while calculating the next frame at the end of game loop's iteration. + +> Modern action games are running at much higher frame rates and often frame rates of server and client are not equal. Client frame rate usually depends on the client hardware performance, while server frame rate is fixed. A client may render several frames after getting the data corresponding to one "game tick". This allows to create smooth animations, which are only limited by client's performance. In this case, a server should pass not only current positions of the objects but also their moving directions, speeds and velocities. And while client frame rate is called FPS (frames per second), sever frame rate is called TPS (ticks per second). In this snake game example both values are equal, and one frame displayed by a client is calculated within one server's tick. + +We will use textmode-like play field, which is, in fact, a html table with one-char cells. All objects of the game are displayed with characters of different colors placed in table's cells. Most of the time client passes pressed keys' codes to the server and gets back play field updates with every "tick". An update from server consists of messages representing characters to render along with their coordinates and colors. So we are keeping all game logic on the server and we are sending to client only rendering data. In addition, we minimize the possibilities to hack the game by substituting its information sent over the network. + +#### 4.3 How does it work? + +The server in this game is close to Example 3.2 for simplicity. But instead of having a global list of connected websockets, we have one server-wide Game object. A Game instance contains a list of Player objects (inside self._players attribute) which represents players connected to this game, their personal data and websocket objects. Having all game-related data in a Game object also allows us to have multiple game rooms if we want to add such feature. In this case, we need to maintain multiple Game objects, one per game started. + +All interactions between server and clients are done with messages encoded in json. Message from the client containing only a number is interpreted as a code of the key pressed by the player. Other messages from client are sent in the following format: + +``` +[command, arg1, arg2, ... argN ] +``` + +Messages from server are sent as a list because there is often a bunch of messages to send at once (rendering data mostly): + +``` +[[command, arg1, arg2, ... argN ], ... ] +``` + +At the end of every game loop iteration, the next frame is calculated and sent to all the clients. Of course, we are not sending complete frame every time, but only a list of changes for the next frame. + +Note that players are not joining the game immediately after connecting to the server. The connection starts in "spectator" mode, so one can watch how others are playing. if the game is already started, or a "game over" screen from the previous game session. Then a player may press "Join" button to join the existing game or to create a new game if the game is not currently running (no other active players). In the later case, the play field is cleared before the start. + +The play field is stored in Game._world attribute, which is a 2d array made of nested lists. It is used to keep game field's state internally. Each element of an array represents a field's cell which is then rendered to a html table cell. It has a type of Char, which is a namedtuple consisting of a character and color. It is important to keep play field in sync with all the connected clients, so all updates to the play field should be made only along with sending corresponding messages to the clients. This is performed by Game.apply_render() method. It receives a list of Draw objects, which is then used to update play field internally and also to send render message to clients. + +We are using namedtuple not only because it is a good way to represent simple data structures, but also because it takes less space comparing to dict when sending in a json message. If you are sending complex data structures in a real game app, it is recommended to serialize them into a plain and shorter format or even pack in a binary format (such as bson instead of json) to minimize network traffic. + +ThePlayer object contains snake's representation in a deque object. This data type is similar to a list but is more effective for adding and removing elements on its sides, so it is ideal to represent a moving snake. The main method of the class is Player.render_move(), it returns rendering data to move player's snake to the next position. Basically, it renders snake's head in the new position and removes the last element where the tail was in the previous frame. In case the snake has eaten a digit and has to grow, a tail is not moving for a corresponding number of frames. The snake rendering data is used in Game.next_frame() method of the main class, which implements all game logic. This method renders all snake moves and checks for obstacles in front of every snake and also spawns digits and "stones". It is called directly from game_loop() to generate the next frame at every "tick". + +In case there is an obstacle in front of snake's head, a Game.game_over() method is called from Game.next_frame(). It notifies all connected clients about the dead snake (which is turned into stones by player.render_game_over() method) and updates top scores table. Player object's alive flag is set to False, so this player will be skipped when rendering the next frames, until joining the game once again. In case there are no more snakes alive, a "game over" message is rendered at the game field. Also, the main game loop will stop and set game.running flag to False, which will cause a game field to be cleared when some player will press "Join" button next time. + +Spawning of digits and stones is also happening while rendering every next frame, and it is determined by random values. A chance to spawn a digit or a stone can be changed in settings.py along with some other values. Note that digit spawning is happening for every live snake in the play field, so the more snakes are there, the more digits will appear, and they all will have enough food to consume. + +#### 4.4 Network protocol +List of messages sent from client + +Command | Parameters |Description +:-- |:-- |:-- +new_player | [name] |Setting player's nickname +join | |Player is joining the game + + +List of messages sent from server + +Command | Parameters |Description +:-- |:-- |:-- +handshake |[id] |Assign id to a player +world |[[(char, color), ...], ...] |Initial play field (world) map +reset_world | |Clean up world map, replacing all characters with spaces +render |[x, y, char, color] |Display character at position +p_joined |[id, name, color, score] |New player joined the game +p_gameover |[id] |Game ended for a player +p_score |[id, score] |Setting score for a player +top_scores |[[name, score, color], ...] |Update top scores table + +Typical messages exchange order + +Client -> Server |Server -> Client |Server -> All clients |Commentaries +:-- |:-- |:-- |:-- +new_player | | |Name passed to server + |handshake | |ID assigned + |world | |Initial world map passed + |top_scores | |Recent top scores table passed +join | | |Player pressed "Join", game loop started + | |reset_world |Command clients to clean up play field + | |render, render, ... |First game tick, first frame rendered +(key code) | | |Player pressed a key + | |render, render, ... |Second frame rendered + | |p_score |Snake has eaten a digit + | |render, render, ... |Third frame rendered + | | |... Repeat for a number of frames ... + | |p_gameover |Snake died when trying to eat an obstacle + | |top_scores |Updated top scores table (if updated) + +### 5. Conclusion + +To tell the truth, I really enjoy using the latest asynchronous capabilities of Python. The new syntax really makes a difference, so async code is now easily readable. It is obvious which calls are non-blocking and when the green thread switching is happening. So now I can claim with confidence that Python is a good tool for asynchronous programming. + +SnakePit has become very popular at 7WebPages team, and if you decide to take a break at your company, please, don’t forget to leave a feedback for us, say, on [Twitter][12] or [Facebook][13] . + +Get to know more from: + + + +-------------------------------------------------------------------------------- + +via: https://7webpages.com/blog/writing-online-multiplayer-game-with-python-and-asyncio-part-3/ + +作者:[Saheetha Shameer][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://7webpages.com/blog/writing-online-multiplayer-game-with-python-and-asyncio-part-3/ +[1]: http://snakepit-game.com/ +[2]: https://7webpages.com/blog/writing-online-multiplayer-game-with-python-and-asyncio-writing-game-loop/ +[3]: https://7webpages.com/blog/writing-online-multiplayer-game-with-python-asyncio-getting-asynchronous/ +[4]: https://github.com/7WebPages/snakepit-game +[5]: https://github.com/7WebPages/snakepit-game +[6]: https://github.com/7WebPages/snakepit-game/blob/master/server.py +[7]: https://github.com/7WebPages/snakepit-game/blob/master/game.py +[8]: https://github.com/7WebPages/snakepit-game/blob/master/player.py +[9]: https://github.com/7WebPages/snakepit-game/blob/master/datatypes.py +[10]: https://github.com/7WebPages/snakepit-game/blob/master/settings.py +[11]: https://github.com/7WebPages/snakepit-game/blob/master/index.html +[12]: https://twitter.com/7WebPages +[13]: https://www.facebook.com/7WebPages/ From b60e48372495b9d92e370cfc17c97b5df5c7b4c4 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 10 Jul 2016 16:02:42 +0800 Subject: [PATCH 1119/1469] =?UTF-8?q?20160710-4=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... The People I Follow On Twitter Are Men.md | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 sources/tech/20160623 72% Of The People I Follow On Twitter Are Men.md diff --git a/sources/tech/20160623 72% Of The People I Follow On Twitter Are Men.md b/sources/tech/20160623 72% Of The People I Follow On Twitter Are Men.md new file mode 100644 index 0000000000..7aeab64d2f --- /dev/null +++ b/sources/tech/20160623 72% Of The People I Follow On Twitter Are Men.md @@ -0,0 +1,87 @@ +72% Of The People I Follow On Twitter Are Men +=============================================== + +![](https://emptysqua.re/blog/gender-of-twitter-users-i-follow/abacus.jpg) + +At least, that's my estimate. Twitter does not ask users their gender, so I [have written a program that guesses][1] based on their names. Among those who follow me, the distribution is even worse: 83% are men. None are gender-nonbinary as far as I can tell. + +The way to fix the first number is not mysterious: I should notice and seek more women experts tweeting about my interests, and follow them. + +The second number, on the other hand, I can merely influence, but I intend to improve it as well. My network on Twitter should represent of the software industry's diverse future, not its unfair present. + +### How Did I Measure It? + +I set out to estimate the gender distribution of the people I follow—my "friends" in Twitter's jargon—and found it surprisingly hard. [Twitter analytics][2] readily shows me the converse, an estimate of my followers' gender: + +![](https://emptysqua.re/blog/gender-of-twitter-users-i-follow/twitter-analytics.png) + +So, Twitter analytics divides my followers' accounts among male, female, and unknown, and tells me the ratio of the first two groups. (Gender-nonbinary folk are absent here—they're lumped in with the Twitter accounts of organizations, and those whose gender is simply unknown.) But Twitter doesn't tell me the ratio of my friends. That [which is measured improves][3], so I searched for a service that would measure this number for me, and found [FollowerWonk][4]. + +FollowerWonk guesses my friends are 71% men. Is this a good guess? For the sake of validation, I compare FollowerWonk's estimate of my followers to Twitter's estimate: + +**Twitter analytics** + + |men |women +:-- |:-- |:-- +Followers |83% |17% + +**FollowerWonk** + + |men |women +:-- |:-- |:-- +Followers |81% |19% +Friends I follow |72% |28% + +My followers show up 81% male here, close to the Twitter analytics number. So far so good. If FollowerWonk and Twitter agree on the gender ratio of my followers, that suggests FollowerWonk's estimate of the people I follow (which Twitter doesn't analyze) is reasonably good. With it, I can make a habit of measuring my numbers, and improve them. + +At $30 a month, however, checking my friends' gender distribution with FollowerWonk is a pricey habit. I don't need all its features anyhow. Can I solve only the gender-distribution problem economically? + +Since FollowerWonk's numbers seem reasonable, I tried to reproduce them. Using Python and [some nice Philadelphians' Twitter][5] API wrapper, I began downloading the profiles of all my friends and followers. I immediately found that Twitter's rate limits are miserly, so I randomly sampled only a subset of users instead. + +I wrote a rudimentary program that searches for a pronoun announcement in each of my friends' profiles. For example, a profile description that includes "she/her" probably belongs to a woman, a description with "they/them" is probably nonbinary. But most don't state their pronouns: for these, the best gender-correlated information is the "name" field: for example, @gvanrossum's name field is "Guido van Rossum", and the first name "Guido" suggests that @gvanrossum is male. Where pronouns were not announced, I decided to use first names to estimate my numbers. + +My script passes parts of each name to the SexMachine library to guess gender. [SexMachine][6] has predictable downfalls, like mistaking "Brooklyn Zen Center" for a woman named "Brooklyn", but its estimates are as good as FollowerWonk's and Twitter's: + + + + |nonbinary |men |women |no gender,unknown +:-- |:-- |:-- |:-- |:-- +Friends I follow |1 |168 |66 |173 + |0% |72% |28% | +Followers |0 |459 |108 |433 + |0% |81% |19% | + +(Based on all 408 friends and a sample of 1000 followers.) + +### Know Your Number + +I want you to check your Twitter network's gender distribution, too. So I've deployed "Proportional" to PythonAnywhere's handy service for $10 a month: + +> + +The application may rate-limit you or otherwise fail, so use it gently. The [code is on GitHub][7]. It includes a command-line tool, as well. + +Who is represented in your network on Twitter? Are you speaking and listening to the same unfairly distributed group who have been talking about software for the last few decades, or does your network look like the software industry of the future? Let's know our numbers and improve them. + + + + + +-------------------------------------------------------------------------------- + +via: https://emptysqua.re/blog/gender-of-twitter-users-i-follow/ + +作者:[A. Jesse Jiryu Davis][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://disqus.com/by/AJesseJiryuDavis/ +[1]: https://www.proporti.onl/ +[2]: https://analytics.twitter.com/ +[3]: http://english.stackexchange.com/questions/14952/that-which-is-measured-improves +[4]: https://moz.com/followerwonk/ +[5]: https://github.com/bear/python-twitter/graphs/contributors +[6]: https://pypi.python.org/pypi/SexMachine/ +[7]: https://github.com/ajdavis/twitter-gender-distribution From 7c1bf8b1e3407d70fbaa229d44cc815ccfa1a16a Mon Sep 17 00:00:00 2001 From: Mike Date: Sun, 10 Jul 2016 22:49:50 +0800 Subject: [PATCH 1120/1469] Tutorial: Getting started with Docker Swarm and deploying a replicated Python 3 Application (#4168) * sources/tech/20160609 How to record your terminal session on Linux.md * translated/tech/20160609 How to record your terminal session on Linux.md * sources/tech/20160620 Detecting cats in images with OpenCV.md * sources/tech/20160620 Detecting cats in images with OpenCV.md * sources/tech/20160620 Detecting cats in images with OpenCV.md * sources/tech/20160620 Detecting cats in images with OpenCV.md * sources/tech/20160620 Detecting cats in images with OpenCV.md * translated/tech/20160620 Detecting cats in images with OpenCV.md * remove source * sources/tech/20160706 Getting started with Docker Swarm and deploying a replicated Python 3 Application.md --- ...ker Swarm and deploying a replicated Python 3 Application.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160706 Getting started with Docker Swarm and deploying a replicated Python 3 Application.md b/sources/tech/20160706 Getting started with Docker Swarm and deploying a replicated Python 3 Application.md index 85b592b306..0e96160c77 100644 --- a/sources/tech/20160706 Getting started with Docker Swarm and deploying a replicated Python 3 Application.md +++ b/sources/tech/20160706 Getting started with Docker Swarm and deploying a replicated Python 3 Application.md @@ -1,3 +1,5 @@ +MikeCoder 2016.07.10 Translating + Tutorial: Getting started with Docker Swarm and deploying a replicated Python 3 Application ============== From 9e7161a2d5cfa30ddaf3eb44f43f01b17cf63b2b Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 11 Jul 2016 08:07:48 +0800 Subject: [PATCH 1121/1469] PUB:20160629 USE TASK MANAGER EQUIVALENT IN LINUX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @xinglianfly 不错,继续加油~ --- ...29 USE TASK MANAGER EQUIVALENT IN LINUX.md | 51 ++++++++++++++++++ ...29 USE TASK MANAGER EQUIVALENT IN LINUX.md | 52 ------------------- 2 files changed, 51 insertions(+), 52 deletions(-) create mode 100644 published/20160629 USE TASK MANAGER EQUIVALENT IN LINUX.md delete mode 100644 translated/tech/20160629 USE TASK MANAGER EQUIVALENT IN LINUX.md diff --git a/published/20160629 USE TASK MANAGER EQUIVALENT IN LINUX.md b/published/20160629 USE TASK MANAGER EQUIVALENT IN LINUX.md new file mode 100644 index 0000000000..444f37af43 --- /dev/null +++ b/published/20160629 USE TASK MANAGER EQUIVALENT IN LINUX.md @@ -0,0 +1,51 @@ +在 Linux 下使用任务管理器 +==================================== + +![](https://itsfoss.com/wp-content/uploads/2016/06/Task-Manager-in-Linux.jpg) + +有很多 Linux 初学者经常问起的问题,“**Linux 有任务管理器吗?**”,“**怎样在 Linux 上打开任务管理器呢?**” + +来自 Windows 的用户都知道任务管理器非常有用。你可以在 Windows 中按下 `Ctrl+Alt+Del` 打开任务管理器。这个任务管理器向你展示了所有的正在运行的进程和它们消耗的内存,你可以从任务管理器程序中选择并杀死一个进程。 + +当你刚使用 Linux 的时候,你也会寻找一个**在 Linux 相当于任务管理器**的一个东西。一个 Linux 使用专家更喜欢使用命令行的方式查找进程和消耗的内存等等,但是你不用必须使用这种方式,至少在你初学 Linux 的时候。 + +所有主流的 Linux 发行版都有一个类似于任务管理器的东西。大部分情况下,它叫系统监视器(System Monitor),不过实际上它依赖于你的 Linux 的发行版及其使用的[桌面环境][1]。 + +在这篇文章中,我们将会看到如何在以 GNOME 为[桌面环境][2]的 Linux 上找到并使用任务管理器。 + +### 在使用 GNOME 桌面环境的 Linux 上的任务管理器等价物 + +使用 GNOME 时,按下 super 键(Windows 键)来查找任务管理器: + +![](https://itsfoss.com/wp-content/uploads/2016/06/system-monitor-gnome-fedora.png) + +当你启动系统监视器的时候,它会向你展示所有正在运行的进程及其消耗的内存。 + +![](https://itsfoss.com/wp-content/uploads/2016/06/fedora-system-monitor.jpeg) + +你可以选择一个进程并且点击“终止进程(End Process)”来杀掉它。 + +![](https://itsfoss.com/wp-content/uploads/2016/06/kill-process-fedora.png) + +你也可以在资源(Resources)标签里面看到关于一些统计数据,例如 CPU 的每个核心的占用,内存用量、网络用量等。 + +![](https://itsfoss.com/wp-content/uploads/2016/06/system-stats-fedora.png) + +这是图形化的方式。如果你想使用命令行,在终端里运行“top”命令然后你就可以看到所有运行的进程及其消耗的内存。你也可以很容易地使用命令行[杀死进程][3]。 + +这就是关于在 Fedora Linux 上任务管理器的知识。我希望这个教程帮你学到了知识,如果你有什么问题,请尽管问。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/task-manager-linux/ + +作者:[Abhishek Prakash][a] +译者:[xinglianfly](https://github.com/xinglianfly) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject)原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[1]: https://wiki.archlinux.org/index.php/desktop_environment +[2]: https://itsfoss.com/best-linux-desktop-environments/ +[3]: https://itsfoss.com/how-to-find-the-process-id-of-a-program-and-kill-it-quick-tip/ diff --git a/translated/tech/20160629 USE TASK MANAGER EQUIVALENT IN LINUX.md b/translated/tech/20160629 USE TASK MANAGER EQUIVALENT IN LINUX.md deleted file mode 100644 index 81a2147ff5..0000000000 --- a/translated/tech/20160629 USE TASK MANAGER EQUIVALENT IN LINUX.md +++ /dev/null @@ -1,52 +0,0 @@ -在linux下使用任务管理器 -==================================== - -![](https://itsfoss.com/wp-content/uploads/2016/06/Task-Manager-in-Linux.jpg) - -有很多Linux初学者经常问起的问题,“**Linux有任务管理器吗**”,“**在Linux上面你是怎样打开任务管理器的呢**”? - -来自Windows的用户都知道任务管理器非常有用。你按下Ctrl+Alt+Del来打开任务管理器。这个任务管理器向你展示了所有的正在运行的进程和它们消耗的内存。你可以从任务管理器程序中选择并杀死一个进程。 - -当你刚使用Linux的时候,你也会寻找一个**在Linux相当于任务管理器**的一个东西。一个Linux使用专家更喜欢使用命令行的方式查找进程和消耗的内存,但是你不必去使用这种方式,至少在你初学Linux的时候。 - -所有主流的Linux发行版都有一个类似于任务管理器的东西。大部分情况下,**它叫System Monitor**。但是它实际上依赖于你的Linux的发行版和它使用的[桌面环境][1]。 - -在这篇文章中,我们将会看到如何在使用GNOME的[桌面环境][2]的Linux上查找并使用任务管理器。 - -###在使用GNOME的桌面环境的linux上使用任务管理器 - -当你使用GNOME的时候,按下super键(Windows 键)来查找任务管理器: - -![](https://itsfoss.com/wp-content/uploads/2016/06/system-monitor-gnome-fedora.png) - -当你启动System Monitor的时候,它会向你展示所有正在运行的进程和被它们消耗的内存。 - -![](https://itsfoss.com/wp-content/uploads/2016/06/fedora-system-monitor.jpeg) - -你可以选择一个进程并且点击“End Process”来杀掉它。 - -![](https://itsfoss.com/wp-content/uploads/2016/06/kill-process-fedora.png) - -你也可以在Resources标签里面看到关于一些系统的数据,例如每个cpu核心的消耗,内存的使用,网络的使用等。 - -![](https://itsfoss.com/wp-content/uploads/2016/06/system-stats-fedora.png) - -这是图形化的一种方式。如果你想使用命令行,在终端里运行“top”命令然后你就可以看到所有运行的进程和他们消耗的内存。你也可以参考[使用命令行杀死进程][3]这篇文章。 - -这就是所有你需要知道的关于在Fedora Linux上任务管理器的知识。我希望这个教程帮你学到了知识,如果你有什么问题,请尽管问。 - - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/task-manager-linux/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 - -作者:[Abhishek Prakash][a] -译者:[xinglianfly](https://github.com/xinglianfly) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject)原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[1]: https://wiki.archlinux.org/index.php/desktop_environment -[2]: https://itsfoss.com/best-linux-desktop-environments/ -[3]: https://itsfoss.com/how-to-find-the-process-id-of-a-program-and-kill-it-quick-tip/ From 10df0b843dc68efb2186563cd26c36899aaf4e64 Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 11 Jul 2016 09:30:49 +0800 Subject: [PATCH 1122/1469] =?UTF-8?q?20160711-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...o Encrypt a Flash Drive Using VeraCrypt.md | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 sources/tech/20160705 How to Encrypt a Flash Drive Using VeraCrypt.md diff --git a/sources/tech/20160705 How to Encrypt a Flash Drive Using VeraCrypt.md b/sources/tech/20160705 How to Encrypt a Flash Drive Using VeraCrypt.md new file mode 100644 index 0000000000..2dd2ae024f --- /dev/null +++ b/sources/tech/20160705 How to Encrypt a Flash Drive Using VeraCrypt.md @@ -0,0 +1,100 @@ +How to Encrypt a Flash Drive Using VeraCrypt +============================================ + +Many security experts prefer open source software like VeraCrypt, which can be used to encrypt flash drives, because of its readily available source code. + +Encryption is a smart idea for protecting data on a USB flash drive, as we covered in our piece that described ]how to encrypt a flash drive][1] using Microsoft BitLocker. + +But what if you do not want to use BitLocker? + +You may be concerned that because Microsoft's source code is not available for inspection, it could be susceptible to security "backdoors" used by the government or others. Because source code for open source software is widely shared, many security experts feel open source software is far less likely to have any backdoors. + +Fortunately, there are several open source encryption alternatives to BitLocker. + +If you need to be able to encrypt and access files on any Windows machine, as well as computers running Apple OS X or Linux, the open source [VeraCrypt][2] offers an excellent alternative. + +VeraCrypt is derived from TrueCrypt, a well-regarded open source encryption software product that has now been discontinued. But the code for TrueCrypt was audited and no major security flaws were found. In addition, it has since been improved in VeraCrypt. + +Versions exist for Windows, OS X and Linux. + +Encrypting a USB flash drive with VeraCrypt is not as straightforward as it is with BitLocker, but it still only takes a few minutes. + +### Encrypting Flash Drive with VeraCrypt in 8 Steps + +After [downloading VeraCrypt][3] for your operating system: + +Start VeraCrypt, and click on Create Volume to start the VeraCrypt Volume Creation Wizard. + +![](http://www.esecurityplanet.com/imagesvr_ce/6246/Vera0.jpg) + +The VeraCrypt Volume Creation Wizard allows you to create an encrypted file container on the flash drive which sits along with other unencrypted files, or you can choose to encrypt the entire flash drive. For the moment, we will choose to encrypt the entire flash drive. + +![](http://www.esecurityplanet.com/imagesvr_ce/6703/Vera1.jpg) + +On the next screen, choose Standard VeraCrypt Volume. + +![](http://www.esecurityplanet.com/imagesvr_ce/835/Vera2.jpg) + +Select the drive letter of the flash drive you want to encrypt (in this case O:). + +![](http://www.esecurityplanet.com/imagesvr_ce/9427/Vera3.jpg) + +Choose the Volume Creation Mode. If your flash drive is empty or you want to delete everything it contains, choose the first option. If you want to keep any existing files, choose the second option. + +![](http://www.esecurityplanet.com/imagesvr_ce/7828/Vera4.jpg) + +This screen allows you to choose your encryption options. If you are unsure of which to choose, leave the default settings of AES and SHA-512. + +![](http://www.esecurityplanet.com/imagesvr_ce/5918/Vera5.jpg) + +After confirming the Volume Size screen, enter and re-enter the password you want to use to encrypt your data. + +![](http://www.esecurityplanet.com/imagesvr_ce/3850/Vera6.jpg) + +To work effectively, VeraCrypt must draw from a pool of entropy or "randomness." To generate this pool, you'll be asked to move your mouse around in a random fashion for about a minute. Once the bar has turned green, or preferably when it reaches the far right of the screen, click Format to finish creating your encrypted drive. + +![](http://www.esecurityplanet.com/imagesvr_ce/7468/Vera8.jpg) + +### Using a Flash Drive Encrypted with VeraCrypt + +When you want to use an encrypted flash drive, first insert the drive in the computer and start VeraCrypt. + +Then select an unused drive letter (such as z:) and click Auto-Mount Devices. + +![](http://www.esecurityplanet.com/imagesvr_ce/2016/Vera10.jpg) + +Enter your password and click OK. + +![](http://www.esecurityplanet.com/imagesvr_ce/8222/Vera11.jpg) + +The mounting process may take a few minutes, after which your unencrypted drive will become available with the drive letter you selected previously. + +### VeraCrypt Traveler Disk Setup + +If you set up a flash drive with an encrypted container rather than encrypting the whole drive, you also have the option to create what VeraCrypt calls a traveler disk. This installs a copy of VeraCrypt on the USB flash drive itself, so when you insert the drive in another Windows computer you can run VeraCrypt automatically from the flash drive; there is no need to install it on the computer. + +You can set up a flash drive to be a Traveler Disk by choosing Traveler Disk SetUp from the Tools menu of VeraCrypt. + +![](http://www.esecurityplanet.com/imagesvr_ce/5812/Vera12.jpg) + +It is worth noting that in order to run VeraCrypt from a Traveler Disk on a computer, you must have administrator privileges on that computer. While that may seem to be a limitation, no confidential files can be opened safely on a computer that you do not control, such as one in a business center. + +>Paul Rubens has been covering enterprise technology for over 20 years. In that time he has written for leading UK and international publications including The Economist, The Times, Financial Times, the BBC, Computing and ServerWatch. + +-------------------------------------------------------------------------------- + +via: http://www.esecurityplanet.com/open-source-security/how-to-encrypt-flash-drive-using-veracrypt.html + +作者:[Paul Rubens ][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.esecurityplanet.com/author/3700/Paul-Rubens +[1]: http://www.esecurityplanet.com/views/article.php/3880616/How-to-Encrypt-a-USB-Flash-Drive.htm +[2]: http://www.esecurityplanet.com/open-source-security/veracrypt-a-worthy-truecrypt-alternative.html +[3]: https://veracrypt.codeplex.com/releases/view/619351 + + + From f27d68468252699c606181a6f91be7bd40f0dfef Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 11 Jul 2016 09:37:47 +0800 Subject: [PATCH 1123/1469] =?UTF-8?q?20160711-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ork on Ubuntu Linux 14.04 and 16.04 LTS.md | 143 ++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 sources/tech/20160701 How To Setup Bridge (br0) Network on Ubuntu Linux 14.04 and 16.04 LTS.md diff --git a/sources/tech/20160701 How To Setup Bridge (br0) Network on Ubuntu Linux 14.04 and 16.04 LTS.md b/sources/tech/20160701 How To Setup Bridge (br0) Network on Ubuntu Linux 14.04 and 16.04 LTS.md new file mode 100644 index 0000000000..b3d40a94c2 --- /dev/null +++ b/sources/tech/20160701 How To Setup Bridge (br0) Network on Ubuntu Linux 14.04 and 16.04 LTS.md @@ -0,0 +1,143 @@ +How To Setup Bridge (br0) Network on Ubuntu Linux 14.04 and 16.04 LTS +======================================================================= + +> am a new Ubuntu Linux 16.04 LTS user. How do I setup a network bridge on the host server powered by Ubuntu 14.04 LTS or 16.04 LTS operating system? + +![](http://s0.cyberciti.org/images/category/old/ubuntu-logo.jpg) + +A Bridged networking is nothing but a simple technique to connect to the outside network through the physical interface. It is useful for LXC/KVM/Xen/Containers virtualization and other virtual interfaces. The virtual interfaces appear as regular hosts to the rest of the network. In this tutorial I will explain how to configure a Linux bridge with bridge-utils (brctl) command line utility on Ubuntu server. + +### Our sample bridged networking + +![](http://s0.cyberciti.org/uploads/faq/2016/07/my-br0-br1-setup.jpg) +>Fig.01: Sample Ubuntu Bridged Networking Setup For Kvm/Xen/LXC Containers (br0) + +In this example eth0 and eth1 is the physical network interface. eth0 connected to the LAN and eth1 is attached to the upstream ISP router/Internet. + +### Install bridge-utils + +Type the following [apt-get command][1] to install the bridge-utils: + +``` +$ sudo apt-get install bridge-utils +``` + +OR + +```` +$ sudo apt install bridge-utils +``` + +Sample outputs: + +![](http://s0.cyberciti.org/uploads/faq/2016/07/ubuntu-install-bridge-utils.jpg) +>Fig.02: Ubuntu Linux install bridge-utils package + +### Creating a network bridge on the Ubuntu server + +Edit `/etc/network/interfaces` using a text editor such as nano or vi, enter: + +``` +$ sudo cp /etc/network/interfaces /etc/network/interfaces.bakup-1-july-2016 +$ sudo vi /etc/network/interfaces +``` + +Let us setup eth1 and map it to br1, enter (delete or comment out all eth1 entries): + +``` +# br1 setup with static wan IPv4 with ISP router as gateway +auto br1 +iface br1 inet static + address 208.43.222.51 + network 255.255.255.248 + netmask 255.255.255.0 + broadcast 208.43.222.55 + gateway 208.43.222.49 + bridge_ports eth1 + bridge_stp off + bridge_fd 0 + bridge_maxwait 0 +``` + +To setup eth0 and map it to br0, enter (delete or comment out all eth1 entries): + +``` +auto br0 +iface br0 inet static + address 10.18.44.26 + netmask 255.255.255.192 + broadcast 10.18.44.63 + dns-nameservers 10.0.80.11 10.0.80.12 + # set static route for LAN + post-up route add -net 10.0.0.0 netmask 255.0.0.0 gw 10.18.44.1 + post-up route add -net 161.26.0.0 netmask 255.255.0.0 gw 10.18.44.1 + bridge_ports eth0 + bridge_stp off + bridge_fd 0 + bridge_maxwait 0 +``` + +### A note about br0 and DHCP + +DHCP config options: + +``` +auto br0 +iface br0 inet dhcp + bridge_ports eth0 + bridge_stp off + bridge_fd 0 + bridge_maxwait 0 +``` + +Save and close the file. + +### Restart the server or networking service + +You need to reboot the server or type the following command to restart the networking service (this may not work on SSH based session): + +``` +$ sudo systemctl restart networking +``` + +If you are using Ubuntu 14.04 LTS or older not systemd based system, enter: + +``` +$ sudo /etc/init.d/restart networking +``` + +### Verify connectivity + +Use the ping/ip commands to verify that both LAN and WAN interfaces are reachable: +``` +# See br0 and br1 +ip a show +# See routing info +ip r +# ping public site +ping -c 2 cyberciti.biz +# ping lan server +ping -c 2 10.0.80.12 +``` + +Sample outputs: + +![](http://s0.cyberciti.org/uploads/faq/2016/07/br0-br1-eth0-eth1-configured-on-ubuntu.jpg) +>Fig.03: Verify Bridging Ethernet Connections + +Now, you can configure XEN/KVM/LXC containers to use br0 and br1 to reach directly to the internet or private lan. No need to setup special routing or iptables SNAT rules. + + +-------------------------------------------------------------------------------- + +via: http://www.cyberciti.biz/faq/how-to-create-bridge-interface-ubuntu-linux/ + +作者:[VIVEK GITE][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://twitter.com/nixcraft +[1]: http://www.cyberciti.biz/tips/linux-debian-package-management-cheat-sheet.html + From 673ca254163c71fd49a37045e31ed2ad48ac6a3c Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 11 Jul 2016 09:55:10 +0800 Subject: [PATCH 1124/1469] =?UTF-8?q?20160711-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0160630 What makes up the Fedora kernel.md | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 sources/tech/20160630 What makes up the Fedora kernel.md diff --git a/sources/tech/20160630 What makes up the Fedora kernel.md b/sources/tech/20160630 What makes up the Fedora kernel.md new file mode 100644 index 0000000000..95b61a201a --- /dev/null +++ b/sources/tech/20160630 What makes up the Fedora kernel.md @@ -0,0 +1,33 @@ +What makes up the Fedora kernel? +==================================== + +![](https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/kernel-945x400.png) + +Every Fedora system runs a kernel. Many pieces of code come together to make this a reality. + +Each release of the Fedora kernel starts with a baseline release from the [upstream community][1]. This is often called a ‘vanilla’ kernel. The upstream kernel is the standard. The goal is to have as much code upstream as possible. This makes it easier for bug fixes and API updates to happen as well as having more people review the code. In an ideal world, Fedora would be able to to take the kernel straight from kernel.org and send that out to all users. + +Realistically, using the vanilla kernel isn’t complete enough for Fedora. Some features Fedora users want may not be available. The [Fedora kernel][2] that users actually receive contains a number of patches on top of the vanilla kernel. These patches are considered ‘out of tree’. Many of these patches will not exist out of tree patches very long. If patches are available to fix an issue, the patches may be pulled in to the Fedora tree so the fix can go out to users faster. When the kernel is rebased to a new version, the patches will be removed if they are in the new version. + +Some patches remain in the Fedora kernel tree for an extended period of time. A good example of patches that fall into this category are the secure boot patches. These patches provide a feature Fedora wants to support even though the upstream community has not yet accepted them. It takes effort to keep these patches up to date so Fedora tries to minimize the number of patches that are carried without being accepted by an upstream kernel maintainer. + +Generally, the best way to get a patch included in the Fedora kernel is to send it to the ]Linux Kernel Mailing List (LKML)][3] first and then ask for it to be included in Fedora. If a patch has been accepted by a maintainer it stands a very high chance of being included in the Fedora kernel tree. Patches that come from places like github which have not been submitted to LKML are unlikely to be taken into the tree. It’s important to send the patches to LKML first to ensure Fedora is carrying the correct patches in its tree. Without the community review, Fedora could end up carrying patches which are buggy and cause problems. + +The Fedora kernel contains code from many places. All of it is necessary to give the best experience possible. + + + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/makes-fedora-kernel/ + +作者:[Laura Abbott][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/makes-fedora-kernel/ +[1]: http://www.kernel.org/ +[2]: http://pkgs.fedoraproject.org/cgit/rpms/kernel.git/ +[3]: http://www.labbott.name/blog/2015/10/02/the-art-of-communicating-with-lkml/ From 015283e8d711271e9ef5064ac3df173c4083d287 Mon Sep 17 00:00:00 2001 From: Mike Date: Mon, 11 Jul 2016 11:26:41 +0800 Subject: [PATCH 1125/1469] translated/tech/20160609 How to record your terminal session on Linux.md (#4169) * sources/tech/20160609 How to record your terminal session on Linux.md * translated/tech/20160609 How to record your terminal session on Linux.md * sources/tech/20160620 Detecting cats in images with OpenCV.md * sources/tech/20160620 Detecting cats in images with OpenCV.md * sources/tech/20160620 Detecting cats in images with OpenCV.md * sources/tech/20160620 Detecting cats in images with OpenCV.md * sources/tech/20160620 Detecting cats in images with OpenCV.md * translated/tech/20160620 Detecting cats in images with OpenCV.md * remove source * sources/tech/20160706 Getting started with Docker Swarm and deploying a replicated Python 3 Application.md * sources/tech/20160706 Getting started with Docker Swarm and deploying a replicated Python 3 Application.md --- ...oying a replicated Python 3 Application.md | 283 ------------------ ...oying a replicated Python 3 Application.md | 282 +++++++++++++++++ 2 files changed, 282 insertions(+), 283 deletions(-) delete mode 100644 sources/tech/20160706 Getting started with Docker Swarm and deploying a replicated Python 3 Application.md create mode 100644 translated/tech/20160706 Getting started with Docker Swarm and deploying a replicated Python 3 Application.md diff --git a/sources/tech/20160706 Getting started with Docker Swarm and deploying a replicated Python 3 Application.md b/sources/tech/20160706 Getting started with Docker Swarm and deploying a replicated Python 3 Application.md deleted file mode 100644 index 0e96160c77..0000000000 --- a/sources/tech/20160706 Getting started with Docker Swarm and deploying a replicated Python 3 Application.md +++ /dev/null @@ -1,283 +0,0 @@ -MikeCoder 2016.07.10 Translating - -Tutorial: Getting started with Docker Swarm and deploying a replicated Python 3 Application -============== - -At [Dockercon][1] recently [Ben Firshman][2] did a very cool presentation on building serverless apps with Docker, you can [read about it here][3] (along with watching the video). A little while back [I wrote an article][4] on building a microservice with [AWS Lambda][5]. - -Today, I want to show you how to use [Docker Swarm][6] and then deploy a simple Python Falcon REST app. Although I won’t be using [dockerrun][7] or the serverless capabilities I think you might be surprised how easy it is to deploy (replicated) Python applications (actually any sort of application: Java, Go, etc.) with Docker Swarm. - - -Note: Some of the steps I’ll show you are taken from the [Swarm Tutorial][8]. I’ve modified some things and [added a Vagrant helper repo][9] to spin up a local testing environment for Docker Swarm to utilize. Keep in mind you must be using Docker Engine 1.12 or later. At the time of this article I am using RC2 of 1.12. Keep in mind this is all build on beta software at this time, things can change. - -The first thing you will want to do is to ensure you have [Vagrant][10] properly installed and working if you want to run this locally. You can also follow the steps for the most part and spin up the Docker Swarm VMs on your preferred cloud provider. - -We are going to spin up three VMs: A single docker swarm manager and two workers. - -Security Note: The Vagrantfile uses a shell script located on Docker’s test server. This is a potential security issue to run scripts you don’t have control over so make sure to [review the script][11] prior to running. - -``` -$ git clone https://github.com/chadlung/vagrant-docker-swarm -$ cd vagrant-docker-swarm -$ vagrant plugin install vagrant-vbguest -$ vagrant up -``` - -The vagrant up command will take some time to complete. - -SSH into the manager1 VM: - -``` -$ vagrant ssh manager1 -``` - -Run the following command in the manager1 ssh terminal session: - -``` -$ sudo docker swarm init --listen-addr 192.168.99.100:2377 -``` - -There will be no workers registered yet: - -``` -$ sudo docker node ls -``` - -Let’s register the two workers. Use two new terminal sessions (leave the manager1 session running): - -``` -$ vagrant ssh worker1 -``` - -Run the following command in the worker1 ssh terminal session: - -``` -$ sudo docker swarm join 192.168.99.100:2377 -``` - -Repeat those commands used for worker1 but substitute worker2. - -From the manager1 terminal run: - -``` -$ docker node ls -``` - -You should see: - -![](http://www.giantflyingsaucer.com/blog/wp-content/uploads/2016/06/Screen-Shot-2016-06-28-at-3.15.25-PM.png) - -On the manager1 terminal let’s deploy a simple service. - -``` -sudo docker service create --replicas 1 --name pinger alpine ping google.com -``` - -That will deploy a service that will ping google.com to one of the workers (or manager, the manager can also run services but this [can also be disabled][12] if you only want workers to run containers). To see which node got the service run this: - -``` -$ sudo docker service tasks pinger -``` - -Result will be similar to this: - -![](http://www.giantflyingsaucer.com/blog/wp-content/uploads/2016/06/Screen-Shot-2016-06-28-at-5.23.05-PM.png) - -So we know its on worker1. Let’s go to the terminal session for worker1 and attach to the running container: - -``` -$ sudo docker ps -``` - -![](http://www.giantflyingsaucer.com/blog/wp-content/uploads/2016/06/Screen-Shot-2016-06-28-at-5.25.02-PM.png) - -You can see the container id is: ae56769b9d4d - -In my case I run: - -``` -$ sudo docker attach ae56769b9d4d -``` - -![](http://www.giantflyingsaucer.com/blog/wp-content/uploads/2016/06/Screen-Shot-2016-06-28-at-5.26.49-PM.png) - -You can just CTRL-C to stop the pinging. - -Go back to the manager1 terminal session and remove the pinger service: - -``` -$ sudo docker service rm pinger -``` - -Now we will move onto deploying a replicated Python app part of this article. Please keep in mind in order to keep this article simple and easy to follow this will be a bare bones trivial service. - -The first thing you will need to do is to either add your own image to [Docker Hub][13] or use [the one I already have][14]. Its a simple Python 3 Falcon REST app that has one endpoint: /hello with a param of value=SOME_STRING - -The Python code for the [chadlung/hello-app][15] image looks like this: - -``` -import json -from wsgiref import simple_server - -import falcon - - -class HelloResource(object): - def on_get(self, req, resp): - try: - value = req.get_param('value') - - resp.content_type = 'application/json' - resp.status = falcon.HTTP_200 - resp.body = json.dumps({'message': str(value)}) - except Exception as ex: - resp.status = falcon.HTTP_500 - resp.body = str(ex) - - -if __name__ == '__main__': - app = falcon.API() - hello_resource = HelloResource() - app.add_route('/hello', hello_resource) - httpd = simple_server.make_server('0.0.0.0', 8080, app) - httpd.serve_forever() -``` - -The Dockerfile is as simple as: - -``` -FROM python:3.4.4 - -RUN pip install -U pip -RUN pip install -U falcon - -EXPOSE 8080 - -COPY . /hello-app -WORKDIR /hello-app - -CMD ["python", "app.py"] -``` - -Again, this is meant to be very trivial. You can hit the endpoint by running the image locally if you want: - -This gives you back: - -``` -{"message": "Fred"} -``` - -Build and deploy the hellp-app to Docker Hub (modify below to use your own Docker Hub repo or [use this one][15]): - -``` -$ sudo docker build . -t chadlung/hello-app:2 -$ sudo docker push chadlung/hello-app:2 -``` - -Now we want to deploy this to the Docker Swarm we set up earlier. Go into the manager1 terminal session and run: - -``` -$ sudo docker service create -p 8080:8080 --replicas 2 --name hello-app chadlung/hello-app:2 -$ sudo docker service inspect --pretty hello-app -$ sudo docker service tasks hello-app -``` - -Now we are ready to test it out. Using any of the node’s IPs in the swarm hit the /hello endpoint. In my case I will just cURL from the manager1 terminal: - -Remember, all IPs in the swarm will work even if the service is only running on one or more nodes. - -``` -$ curl -v -X GET "http://192.168.99.100:8080/hello?value=Chad" -$ curl -v -X GET "http://192.168.99.101:8080/hello?value=Test" -$ curl -v -X GET "http://192.168.99.102:8080/hello?value=Docker" -``` - -Results: - -``` -* Hostname was NOT found in DNS cache -* Trying 192.168.99.101... -* Connected to 192.168.99.101 (192.168.99.101) port 8080 (#0) -> GET /hello?value=Chad HTTP/1.1 -> User-Agent: curl/7.35.0 -> Host: 192.168.99.101:8080 -> Accept: */* -> -* HTTP 1.0, assume close after body -< HTTP/1.0 200 OK -< Date: Tue, 28 Jun 2016 23:52:55 GMT -< Server: WSGIServer/0.2 CPython/3.4.4 -< content-type: application/json -< content-length: 19 -< -{"message": "Chad"} -``` - -Calling the other node from my web browser: - -![](http://www.giantflyingsaucer.com/blog/wp-content/uploads/2016/06/Screen-Shot-2016-06-28-at-6.54.31-PM.png) - -If you want to see all the services running try this from the manager1 node: - -``` -$ sudo docker service ls -``` -If you want to add some visualization to all this you can install [Docker Swarm Visualizer][16] (this is very handy for presentations, etc.). From the manager1 terminal session run the following: - -![]($ sudo docker run -it -d -p 5000:5000 -e HOST=192.168.99.100 -e PORT=5000 -v /var/run/docker.sock:/var/run/docker.sock manomarks/visualizer) - -Simply open a browser now and point it at: - -Results (assuming running two Docker Swarm services): - -![](http://www.giantflyingsaucer.com/blog/wp-content/uploads/2016/06/Screen-Shot-2016-06-30-at-2.37.28-PM.png) - -To stop the hello-app (which was replicated to two nodes) run this from the manager1 terminal session: - -``` -$ sudo docker service rm hello-app -``` - -To stop the Visualizer run this from the manager1 terminal session: - -``` -$ sudo docker ps -``` - -Get the container id, in my case it was: f71fec0d3ce1 - -Run this from the manager1 terminal session:: - -``` -$ sudo docker stop f71fec0d3ce1 -``` - -Good luck with Docker Swarm and keep in kind this article was based on the release candidate of version 1.12. - --------------------------------------------------------------------------------- - -via: http://www.giantflyingsaucer.com/blog/?p=5923 - -作者:[Chad Lung][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://www.giantflyingsaucer.com/blog/?author=2 -[1]: http://dockercon.com/ -[2]: https://blog.docker.com/author/bfirshman/ -[3]: https://blog.docker.com/author/bfirshman/ -[4]: http://www.giantflyingsaucer.com/blog/?p=5730 -[5]: https://aws.amazon.com/lambda/ -[6]: https://docs.docker.com/swarm/ -[7]: https://github.com/bfirsh/dockerrun -[8]: https://docs.docker.com/engine/swarm/swarm-tutorial/ -[9]: https://github.com/chadlung/vagrant-docker-swarm -[10]: https://www.vagrantup.com/ -[11]: https://test.docker.com/ -[12]: https://docs.docker.com/engine/reference/commandline/swarm_init/ -[13]: https://hub.docker.com/ -[14]: https://hub.docker.com/r/chadlung/hello-app/ -[15]: https://hub.docker.com/r/chadlung/hello-app/ -[16]: https://github.com/ManoMarks/docker-swarm-visualizer diff --git a/translated/tech/20160706 Getting started with Docker Swarm and deploying a replicated Python 3 Application.md b/translated/tech/20160706 Getting started with Docker Swarm and deploying a replicated Python 3 Application.md new file mode 100644 index 0000000000..b06c56b46e --- /dev/null +++ b/translated/tech/20160706 Getting started with Docker Swarm and deploying a replicated Python 3 Application.md @@ -0,0 +1,282 @@ +教程:开始学习如何使用 Docker Swarm 部署可扩展的 Python3 应用 +============== + +[Ben Firshman][2]最近在[Dockercon][1]做了一个关于使用 Docker 构建无服务应用的演讲,你可以在[这查看详情][3](可以和视频一起)。之后,我写了[一篇文章][4]关于如何使用[AWS Lambda][5]构建微服务系统。 + +今天,我想展示给你的就是如何使用[Docker Swarm][6]然后部署一个简单的 Python Falcon REST 应用。尽管,我不会使用[dockerrun][7]或者是其他无服务特性。你可能会惊讶,使用 Docker Swarm 部署(替换)一个 Python(Java, Go 都一样) 应用是如此的简单。 + +注意:这展示的部分步骤是截取自[Swarm Tutorial][8]。我已经修改了部分章节,并且[在 Vagrant 的帮助文档][9]中添加了构建本地测试环境的文档。请确保,你使用的是1.12或以上版本的 Docker 引擎。我写这篇文章的时候,使用的是1.12RC2版本的 Docker。注意的是,这只是一个测试版本,只会可能还会有修改。 + +你要做的第一件事,就是你要保证你正确的安装了[Vagrant][10],如果你想本地运行的话。你也可以按如下步骤使用你最喜欢的云服务提供商部署 Docker Swarm 虚拟机系统。 + +我们将会使用这三台 VM:一个简单的 Docker Swarm 管理平台和两台 worker。 + +安全注意事项:Vagrantfile 代码中包含了部分位于 Docker 测试服务器上的 shell 脚本。这是一个隐藏的安全问题。如果你没有权限的话。请确保你会在运行代码之前[审查这部分的脚本][11]。 + +``` +$ git clone https://github.com/chadlung/vagrant-docker-swarm +$ cd vagrant-docker-swarm +$ vagrant plugin install vagrant-vbguest +$ vagrant up +``` + +Vagrant up 命令可能会花很长的时间来执行。 + +SSH 登陆进入 manager1 虚拟机: + +``` +$ vagrant ssh manager1 +``` + +在 manager1 的终端中执行如下命令: + +``` +$ sudo docker swarm init --listen-addr 192.168.99.100:2377 +``` + +现在还没有 worker 注册上来: + +``` +$ sudo docker node ls +``` + +Let’s register the two workers. Use two new terminal sessions (leave the manager1 session running): +通过两个新的终端会话(退出 manager1 的登陆后),我们注册两个 worker。 + +``` +$ vagrant ssh worker1 +``` + +在 worker1 上执行如下命令: + +``` +$ sudo docker swarm join 192.168.99.100:2377 +``` + +在 worker2 上重复这些命令。 + +在 manager1 上执行这个命令: + +``` +$ docker node ls +``` + +你将会看到: + +![](http://www.giantflyingsaucer.com/blog/wp-content/uploads/2016/06/Screen-Shot-2016-06-28-at-3.15.25-PM.png) + +开始在 manager1 的终端里,部署一个简单的服务。 + +``` +sudo docker service create --replicas 1 --name pinger alpine ping google.com +``` + +这个命令将会部署一个服务,他会从 worker 机器中的一台 ping google.com。(manager 也可以运行服务,不过[这也可以被禁止][12])如果你只是想 worker 运行容器的话)。可以使用如下命令,查看哪些节点正在执行服务: + +``` +$ sudo docker service tasks pinger +``` + +结果回合这个比较类似: + +![](http://www.giantflyingsaucer.com/blog/wp-content/uploads/2016/06/Screen-Shot-2016-06-28-at-5.23.05-PM.png) + +所以,我们知道了服务正跑在 worker1 上。我们可以回到 worker1 的会话里,然后进入正在运行的容器: + +``` +$ sudo docker ps +``` + +![](http://www.giantflyingsaucer.com/blog/wp-content/uploads/2016/06/Screen-Shot-2016-06-28-at-5.25.02-PM.png) + +你可以看到容器的 id 是: ae56769b9d4d + +在我的例子中,我运行的是如下的代码: + +``` +$ sudo docker attach ae56769b9d4d +``` + +![](http://www.giantflyingsaucer.com/blog/wp-content/uploads/2016/06/Screen-Shot-2016-06-28-at-5.26.49-PM.png) + +你可以仅仅只用 CTRL-C 来停止服务。 + +回到 manager1,并且移除 pinger 服务。 + +``` +$ sudo docker service rm pinger +``` + +现在,我们将会部署可复制的 Python 应用。请记住,为了保持文章的简洁,而且容易复制,所以部署的是一个简单的应用。 + +你需要做的第一件事就是将镜像放到[Docker Hub][13]上,或者使用我[已经上传的一个][14]。这是一个简单的 Python 3 Falcon REST 应用。他有一个简单的入口: /hello 带一个 value 参数。 + +[chadlung/hello-app][15]的 Python 代码看起来像这样: + +``` +import json +from wsgiref import simple_server + +import falcon + + +class HelloResource(object): + def on_get(self, req, resp): + try: + value = req.get_param('value') + + resp.content_type = 'application/json' + resp.status = falcon.HTTP_200 + resp.body = json.dumps({'message': str(value)}) + except Exception as ex: + resp.status = falcon.HTTP_500 + resp.body = str(ex) + + +if __name__ == '__main__': + app = falcon.API() + hello_resource = HelloResource() + app.add_route('/hello', hello_resource) + httpd = simple_server.make_server('0.0.0.0', 8080, app) + httpd.serve_forever() +``` + +Dockerfile 很简单: + +``` +FROM python:3.4.4 + +RUN pip install -U pip +RUN pip install -U falcon + +EXPOSE 8080 + +COPY . /hello-app +WORKDIR /hello-app + +CMD ["python", "app.py"] +``` + +再一次说明,这是非常详细的奖惩,如果你想,你也可以在本地访问这个入口: + +这将返回如下结果: + +``` +{"message": "Fred"} +``` + +在 Docker Hub 上构建和部署这个 hello-app(修改成你自己的 Docker Hub 仓库或者[这个][15]): + +``` +$ sudo docker build . -t chadlung/hello-app:2 +$ sudo docker push chadlung/hello-app:2 +``` + +现在,我们可以将应用部署到之前的 Docker Swarm 了。登陆 manager1 终端,并且执行: + +``` +$ sudo docker service create -p 8080:8080 --replicas 2 --name hello-app chadlung/hello-app:2 +$ sudo docker service inspect --pretty hello-app +$ sudo docker service tasks hello-app +``` + +现在,我们已经可以测试了。使用任何一个节点 Swarm 的 IP,来访问/hello 的入口,在本例中,我在 Manager1 的终端里使用 curl 命令: + +注意,在 Swarm 中的所有 IP 都可以工作,即使这个服务只运行在一台或者更多的节点上。 + +``` +$ curl -v -X GET "http://192.168.99.100:8080/hello?value=Chad" +$ curl -v -X GET "http://192.168.99.101:8080/hello?value=Test" +$ curl -v -X GET "http://192.168.99.102:8080/hello?value=Docker" +``` + +结果就是: + +``` +* Hostname was NOT found in DNS cache +* Trying 192.168.99.101... +* Connected to 192.168.99.101 (192.168.99.101) port 8080 (#0) +> GET /hello?value=Chad HTTP/1.1 +> User-Agent: curl/7.35.0 +> Host: 192.168.99.101:8080 +> Accept: */* +> +* HTTP 1.0, assume close after body +< HTTP/1.0 200 OK +< Date: Tue, 28 Jun 2016 23:52:55 GMT +< Server: WSGIServer/0.2 CPython/3.4.4 +< content-type: application/json +< content-length: 19 +< +{"message": "Chad"} +``` + +从浏览器中访问其他节点: + +![](http://www.giantflyingsaucer.com/blog/wp-content/uploads/2016/06/Screen-Shot-2016-06-28-at-6.54.31-PM.png) + +如果你想看运行的所有服务,你可以在 manager1 节点上运行如下代码: + +``` +$ sudo docker service ls +``` + +如果你想添加可视化控制平台,你可以安装[Docker Swarm Visualizer][16](这非常简单上手)。在 manager1 的终端中执行如下代码: + +![]($ sudo docker run -it -d -p 5000:5000 -e HOST=192.168.99.100 -e PORT=5000 -v /var/run/docker.sock:/var/run/docker.sock manomarks/visualizer) + +打开你的浏览器,并且访问: + +结果(假设已经运行了两个 Docker Swarm 服务): + +![](http://www.giantflyingsaucer.com/blog/wp-content/uploads/2016/06/Screen-Shot-2016-06-30-at-2.37.28-PM.png) + +停止运行 hello-app(已经在两个节点上运行了),可以在 manager1 上执行这个代码: + +``` +$ sudo docker service rm hello-app +``` + +如果想停止, 那么在 manager1 的终端中执行: + +``` +$ sudo docker ps +``` + +获得容器的 ID,这里是: f71fec0d3ce1 + +从 manager1 的终端会话中执行这个代码: + +``` +$ sudo docker stop f71fec0d3ce1 +``` + +祝你使用 Docker Swarm。这篇文章主要是以1.12版本来进行描述的。 + +-------------------------------------------------------------------------------- + +via: http://www.giantflyingsaucer.com/blog/?p=5923 + +作者:[Chad Lung][a] +译者:[译者ID](https://github.com/MikeCoder) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.giantflyingsaucer.com/blog/?author=2 +[1]: http://dockercon.com/ +[2]: https://blog.docker.com/author/bfirshman/ +[3]: https://blog.docker.com/author/bfirshman/ +[4]: http://www.giantflyingsaucer.com/blog/?p=5730 +[5]: https://aws.amazon.com/lambda/ +[6]: https://docs.docker.com/swarm/ +[7]: https://github.com/bfirsh/dockerrun +[8]: https://docs.docker.com/engine/swarm/swarm-tutorial/ +[9]: https://github.com/chadlung/vagrant-docker-swarm +[10]: https://www.vagrantup.com/ +[11]: https://test.docker.com/ +[12]: https://docs.docker.com/engine/reference/commandline/swarm_init/ +[13]: https://hub.docker.com/ +[14]: https://hub.docker.com/r/chadlung/hello-app/ +[15]: https://hub.docker.com/r/chadlung/hello-app/ +[16]: https://github.com/ManoMarks/docker-swarm-visualizer From 3dce8e6bd0fcc5454e85f05a5c099df1aba4f050 Mon Sep 17 00:00:00 2001 From: gitfuture Date: Mon, 11 Jul 2016 12:32:06 +0800 Subject: [PATCH 1126/1469] finish translating by GitFuture --- .../20160620 Monitor Linux With Netdata.md | 115 ------------------ .../20160620 Monitor Linux With Netdata.md | 112 +++++++++++++++++ 2 files changed, 112 insertions(+), 115 deletions(-) delete mode 100644 sources/tech/20160620 Monitor Linux With Netdata.md create mode 100644 translated/tech/20160620 Monitor Linux With Netdata.md diff --git a/sources/tech/20160620 Monitor Linux With Netdata.md b/sources/tech/20160620 Monitor Linux With Netdata.md deleted file mode 100644 index dfe6920639..0000000000 --- a/sources/tech/20160620 Monitor Linux With Netdata.md +++ /dev/null @@ -1,115 +0,0 @@ -Translating by GitFuture - -Monitor Linux With Netdata -=== - -Netdata is a real-time resource monitoring tool with a friendly web front-end developed and maintained by [FireHOL][1]. With this tool, you can read charts representing resource utilization of things like CPUs, RAM, disks, network, Apache, Postfix and more. It is similar to other monitoring software like Nagios; however, Netdata is only for real-time monitoring via a web interface. - - -### Understanding Netdata - -There’s currently no authentication, so if you’re concerned about someone getting information about the applications you’re running on your system, you should restrict who has access via a firewall policy. The UI is simplified in a way anyone could look at the graphs and understand what they’re seeing, or at least be impressed by your flashy setup. - -The web front-end is very responsive and requires no Flash plugin. The UI doesn’t clutter things up with unneeded features, but sticks to what it does. At first glance, it may seem a bit much with the hundreds of charts you have access to, but luckily the most commonly needed charts (i.e. CPU, RAM, network, and disk) are at the top. If you wish to drill deeper into the graphical data, all you have to do is scroll down or click on the item in the menu to the right. Netdata even allows you to control the chart with play, reset, zoom and resize with the controls on the bottom right of each chart. - -![](https://fedoramagazine.org/wp-content/uploads/2016/06/Capture-1.png) ->Netdata chart control - -When it comes down to system resources, the software doesn’t need too much either. The creators choose to write the software in C. Netdata doesn’t use much more than ~40MB of RAM. - -![](https://fedoramagazine.org/wp-content/uploads/2016/06/Capture.png) ->Netdata memory usage - -### Download Netdata - -To download this software, you can head over to [Netdata GitHub page][2]. Then click the “Clone or download” green button on the left of the page. You should then be presented with two options. - -#### Via the ZIP file - -One option is to download the ZIP file. This will include everything in the repository; however, if the repository is updated then you will need to download the ZIP file again. Once you download the ZIP file, you can use the `unzip` tool in the command line to extract the contents. Running the following command will extract the contents of the ZIP file into a “`netdata`” folder. - -``` -$ cd ~/Downloads -$ unzip netdata-master.zip -``` - -![](https://fedoramagazine.org/wp-content/uploads/2016/06/Capture-2.png) ->Netdata unzipped - -ou don’t need to add the `-d` option in unzip because their content is inside a folder at the root of the ZIP file. If they didn’t have that folder at the root, unzip would have extracted the contents in the current directory (which can be messy). - -#### Via git - -The next option is to download the repository via git. You will, of course, need git installed on your system. This is usually installed by default on Fedora. If not, you can install git from the command line with the following command. - -``` -$ sudo dnf install git -``` - -After installing git, you will need to “clone” the repository to your system. To do this, run the following command. - -``` -$ git clone https://github.com/firehol/netdata.git -``` - -This will then clone (or make a copy of) the repository in the current working directory. - -### Install Netdata - -There are some packages you will need to build Netdata successfully. Luckily, it’s a single line to install the things you need ([as stated in their installation guide][3]). Running the following command in the terminal will install all of the dependencies you need to use Netdata. - -``` -$ dnf install zlib-devel libuuid-devel libmnl-devel gcc make git autoconf autogen automake pkgconfig -``` - -Once the required packages are installed, you will need to cd into the netdata/ directory and run the netdata-installer.sh script. - -``` -$ sudo ./netdata-installer.sh -``` - -You will then be prompted to press enter to build and install the program. If you wish to continue, press enter to be on your way! - -![](https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/Capture-3-600x341.png) ->Netdata install. - -If all goes well, you will have Netdata built, installed, and running on your system. The installer will also add an uninstall script in the same folder as the installer called `netdata-uninstaller.sh`. If you change your mind later, running this script will remove it from your system. - -You can see it running by checking its status via systemctl. - -``` -$ sudo systemctl status netdata -``` - -### Accessing Netdata - -Now that we have Netdata installed and running, you can access the web interface via port 19999. I have it running on a test machine, as shown in the screenshot below. - -![](https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/Capture-4-768x458.png) ->An overview of what Netdata running on your system looks like - -Congratulations! You now have successfully installed and have access to beautiful displays, graphs, and advanced statistics on the performance of your machine. Whether it’s for a personal machine so you can show it off to your friends or for getting deeper insight into the performance of your server, Netdata delivers on performance reporting for any system you choose. - - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/monitor-linux-netdata/ - -作者:[Martino Jones][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/monitor-linux-netdata/ -[1]: https://firehol.org/ -[2]: https://github.com/firehol/netdata -[3]: https://github.com/firehol/netdata/wiki/Installation - - - - - - - - diff --git a/translated/tech/20160620 Monitor Linux With Netdata.md b/translated/tech/20160620 Monitor Linux With Netdata.md new file mode 100644 index 0000000000..bc453d51ee --- /dev/null +++ b/translated/tech/20160620 Monitor Linux With Netdata.md @@ -0,0 +1,112 @@ +用 Netdata 监控 Linux +======= + +Netdata 是一个实时的资源监控工具,它拥有基于 web 的友好界面,由 [FireHQL][1] 开发和维护。通过这个工具,你可以通过图表来了解 CPU,RAM,硬盘,网络,Apache, Postfix等软硬件的资源使用情况。它很像 Nagios 等别的监控软件;但是,Netdata 仅仅支持通过网络接口进行实时监控。 + +### 了解 Netdata + +目前 Netdata 还没有验证机制,如果你担心别人能从你的电脑上获取相关信息的话,你应该设置防火墙规则来限制访问。UI 是简化版的,以便用户查看和理解他们看到的表格数据,至少你能够记住它的快速安装。 + +它的 web 前端响应很快,而且不需要 Flash 插件。 UI 很整洁,保持着 Netdata 应有的特性。粗略的看,你能够看到很多图表,幸运的是绝大多数常用的图表数据(像 CPU,RAM,网络和硬盘)都在顶部。如果你想深入了解图形化数据,你只需要下滑滚动条,或者点击在右边菜单的项目。通过每个图表的右下方的按钮, Netdata 还能让你控制图表的显示,重置,缩放。 + +![](https://fedoramagazine.org/wp-content/uploads/2016/06/Capture-1.png) +>Netdata 图表控制 + +Netdata 并不会占用多少系统资源,它占用的内存不会超过 40MB。因为这个软件是作者用 C 语言写的。 + +![](https://fedoramagazine.org/wp-content/uploads/2016/06/Capture.png) +>Netdata 显示的内存使用情况 + +### 下载 Netdata + +要下载这个软件,你可以从访问 [Netdata GitHub page][2]。然后点击页面左边绿色的 "Clone or download" 按钮 。你应该能看到两个选项。 + +#### 通过 ZIP 文件下载 + +另一种方法是下载 ZIP 文件。它包含在仓库的所有东西。但是如果仓库更新了,你需要重新下载 ZIP 文件。下载完 ZIP 文件后,你要用 `unzip` 命令行工具来解压文件。运行下面的命令能把 ZIP 文件的内容解压到 `netdata` 文件夹。 + +``` +$ cd ~/Downloads +$ unzip netdata-master.zip +``` + +![](https://fedoramagazine.org/wp-content/uploads/2016/06/Capture-2.png) +>解压 Netdata + +没必要在 unzip 命令后加上 `-d` 选项,因为文件都是是放在 ZIP 文件里的一个文件夹里面。如果没有那个文件夹, unzip 会把所有东西都解压到当前目录下面(这会让文件非常混乱)。 + +#### 通过 Git 下载 + +还有一种方式是通过 git 下载整个仓库。当然,你的系统需要安装 git。Git 在 Fedora 系统是默认安装的。如果没有安装,你可以用下面的命令在命令行里安装 git。 + +``` +$ sudo dnf install git +``` + +安装好 git 后,你要把仓库 “clone” 到你的系统里。运行下面的命令。 + +``` +$ git clone https://github.com/firehol/netdata.git +``` + +这个命令会在当前工作目录克隆(或者说复制一份)仓库。 + +### 安装 Netdata + +有些软件包是你成功构造 Netdata 时候需要的。 还好,一行命令就可以安装你所需要的东西([as stated in their installation guide][3])。在命令行运行下面的命令就能满足安装 Netdata 需要的所有依赖关系。 + +``` +$ dnf install zlib-devel libuuid-devel libmnl-devel gcc make git autoconf autogen automake pkgconfig +``` + +当所有需要的软件包都安装好了,你就 cd 到 netdata/ 目录,运行 netdata-installer.sh 脚本。 + +``` +$ sudo ./netdata-installer.sh +``` + +然后就会提示你按回车键,开始安装程序。如果要继续的话,就按下回车吧。 + +![](https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/Capture-3-600x341.png) +>Netdata 的安装。 + +如果一切顺利,你的系统上就已经安装并且运行了 Netdata。安装脚本还会在相应的文件夹里添加一个卸载脚本,叫做 `netdata-uninstaller.sh`。如果你以后不想使用 Netdata,运行这个脚本可以从你的系统里面卸载掉 Netdata。 + +你可以通过 systemctl 查看它的运行状态。 + +``` +$ sudo systemctl status netdata +``` + +### 使用 Netdata + +既然我们已经安装并且运行了 Netdata,你就能够通过 19999 端口来访问 web 界面。下面的截图是我在一个测试机器上运行的 Netdata。 + +![](https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/Capture-4-768x458.png) +>关于 Netdata 运行时的概览 + +恭喜!你已经成功安装并且能够看到关于你的机器性能的完美显示,图形和高级的统计数据。无论是否是你个人的机器,你都可以向你的朋友们炫耀,因为你能够深入的了解你的服务器性能,Netdata 在任何机器上的性能报告都非常出色。 + + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/monitor-linux-netdata/ + +作者:[Martino Jones][a] +译者:[GitFuture](https://github.com/GitFuture) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/monitor-linux-netdata/ +[1]: https://firehol.org/ +[2]: https://github.com/firehol/netdata +[3]: https://github.com/firehol/netdata/wiki/Installation + + + + + + + + From ae39cc08f7934f4542971b29f8082d3ce1e7b261 Mon Sep 17 00:00:00 2001 From: Xin Wang <2650454635@qq.com> Date: Mon, 11 Jul 2016 15:44:02 +0800 Subject: [PATCH 1127/1469] Update 20160524 Writing online multiplayer game with python and asyncio - part 1.md --- ...g online multiplayer game with python and asyncio - part 1.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160524 Writing online multiplayer game with python and asyncio - part 1.md b/sources/tech/20160524 Writing online multiplayer game with python and asyncio - part 1.md index 62af26b481..95122771ac 100644 --- a/sources/tech/20160524 Writing online multiplayer game with python and asyncio - part 1.md +++ b/sources/tech/20160524 Writing online multiplayer game with python and asyncio - part 1.md @@ -1,3 +1,4 @@ +xinglianfly translate Writing online multiplayer game with python and asyncio - part 1 =================================================================== From 5e914658077a5aec5b83f365f13819032878fe9a Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 11 Jul 2016 20:24:51 +0800 Subject: [PATCH 1128/1469] =?UTF-8?q?20160711-4=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...18 An Introduction to Mocking in Python.md | 490 ++++++++++++++++++ 1 file changed, 490 insertions(+) create mode 100644 sources/tech/20160618 An Introduction to Mocking in Python.md diff --git a/sources/tech/20160618 An Introduction to Mocking in Python.md b/sources/tech/20160618 An Introduction to Mocking in Python.md new file mode 100644 index 0000000000..e9c5c847cb --- /dev/null +++ b/sources/tech/20160618 An Introduction to Mocking in Python.md @@ -0,0 +1,490 @@ +An Introduction to Mocking in Python +===================================== + +This article is about mocking in python, + +**How to Run Unit Tests Without Testing Your Patience** + +More often than not, the software we write directly interacts with what we would label as “dirty” services. In layman’s terms: services that are crucial to our application, but whose interactions have intended but undesired side-effects—that is, undesired in the context of an autonomous test run.For example: perhaps we’re writing a social app and want to test out our new ‘Post to Facebook feature’, but don’t want to actually post to Facebook every time we run our test suite. + +The Python unittest library includes a subpackage named unittest.mock—or if you declare it as a dependency, simply mock—which provides extremely powerful and useful means by which to mock and stub out these undesired side-effects. + +>Source | + +Note: mock is [newly included][1] in the standard library as of Python 3.3; prior distributions will have to use the Mock library downloadable via [PyPI][2]. + +### Fear System Calls + +To give you another example, and one that we’ll run with for the rest of the article, consider system calls. It’s not difficult to see that these are prime candidates for mocking: whether you’re writing a script to eject a CD drive, a web server which removes antiquated cache files from /tmp, or a socket server which binds to a TCP port, these calls all feature undesired side-effects in the context of your unit-tests. + +>As a developer, you care more that your library successfully called the system function for ejecting a CD as opposed to experiencing your CD tray open every time a test is run. + +As a developer, you care more that your library successfully called the system function for ejecting a CD (with the correct arguments, etc.) as opposed to actually experiencing your CD tray open every time a test is run. (Or worse, multiple times, as multiple tests reference the eject code during a single unit-test run!) + +Likewise, keeping your unit-tests efficient and performant means keeping as much “slow code” out of the automated test runs, namely filesystem and network access. + +For our first example, we’ll refactor a standard Python test case from original form to one using mock. We’ll demonstrate how writing a test case with mocks will make our tests smarter, faster, and able to reveal more about how the software works. + +### A Simple Delete Function + +We all need to delete files from our filesystem from time to time, so let’s write a function in Python which will make it a bit easier for our scripts to do so. + +``` +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import os + +def rm(filename): + os.remove(filename) +``` + +Obviously, our rm method at this point in time doesn’t provide much more than the underlying os.remove method, but our codebase will improve, allowing us to add more functionality here. + +Let’s write a traditional test case, i.e., without mocks: + +``` +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from mymodule import rm + +import os.path +import tempfile +import unittest + +class RmTestCase(unittest.TestCase): + + tmpfilepath = os.path.join(tempfile.gettempdir(), "tmp-testfile") + + def setUp(self): + with open(self.tmpfilepath, "wb") as f: + f.write("Delete me!") + + def test_rm(self): + # remove the file + rm(self.tmpfilepath) + # test that it was actually removed + self.assertFalse(os.path.isfile(self.tmpfilepath), "Failed to remove the file.") +``` + +Our test case is pretty simple, but every time it is run, a temporary file is created and then deleted. Additionally, we have no way of testing whether our rm method properly passes the argument down to the os.remove call. We can assume that it does based on the test above, but much is left to be desired. + +Refactoring with MocksLet’s refactor our test case using mock: + +``` +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from mymodule import rm + +import mock +import unittest + +class RmTestCase(unittest.TestCase): + + @mock.patch('mymodule.os') + def test_rm(self, mock_os): + rm("any path") + # test that rm called os.remove with the right parameters + mock_os.remove.assert_called_with("any path") +``` + +With these refactors, we have fundamentally changed the way that the test operates. Now, we have an insider, an object we can use to verify the functionality of another. + +### Potential Pitfalls + +One of the first things that should stick out is that we’re using the mock.patch method decorator to mock an object located at mymodule.os, and injecting that mock into our test case method. Wouldn’t it make more sense to just mock os itself, rather than the reference to it at mymodule.os? + +Well, Python is somewhat of a sneaky snake when it comes to imports and managing modules. At runtime, the mymodule module has its own os which is imported into its own local scope in the module. Thus, if we mock os, we won’t see the effects of the mock in the mymodule module. + +The mantra to keep repeating is this: + +> Mock an item where it is used, not where it came from. + +If you need to mock the tempfile module for myproject.app.MyElaborateClass, you probably need to apply the mock to myproject.app.tempfile, as each module keeps its own imports. + +With that pitfall out of the way, let’s keep mocking. + +### Adding Validation to ‘rm’ + +The rm method defined earlier is quite oversimplified. We’d like to have it validate that a path exists and is a file before just blindly attempting to remove it. Let’s refactor rm to be a bit smarter: + +``` +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import os +import os.path + +def rm(filename): + if os.path.isfile(filename): + os.remove(filename) +``` + +Great. Now, let’s adjust our test case to keep coverage up. + +``` +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from mymodule import rm + +import mock +import unittest + +class RmTestCase(unittest.TestCase): + + @mock.patch('mymodule.os.path') + @mock.patch('mymodule.os') + def test_rm(self, mock_os, mock_path): + # set up the mock + mock_path.isfile.return_value = False + + rm("any path") + + # test that the remove call was NOT called. + self.assertFalse(mock_os.remove.called, "Failed to not remove the file if not present.") + + # make the file 'exist' + mock_path.isfile.return_value = True + + rm("any path") + + mock_os.remove.assert_called_with("any path") +``` + +Our testing paradigm has completely changed. We now can verify and validate internal functionality of methods without any side-effects. + +### File-Removal as a Service + +So far, we’ve only been working with supplying mocks for functions, but not for methods on objects or cases where mocking is necessary for sending parameters. Let’s cover object methods first. + +We’ll begin with a refactor of the rm method into a service class. There really isn’t a justifiable need, per se, to encapsulate such a simple function into an object, but it will at the very least help us demonstrate key concepts in mock. Let’s refactor: + +``` +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import os +import os.path + +class RemovalService(object): + """A service for removing objects from the filesystem.""" + + def rm(filename): + if os.path.isfile(filename): + os.remove(filename) +``` + +### You’ll notice that not much has changed in our test case: + +``` +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from mymodule import RemovalService + +import mock +import unittest + +class RemovalServiceTestCase(unittest.TestCase): + + @mock.patch('mymodule.os.path') + @mock.patch('mymodule.os') + def test_rm(self, mock_os, mock_path): + # instantiate our service + reference = RemovalService() + + # set up the mock + mock_path.isfile.return_value = False + + reference.rm("any path") + + # test that the remove call was NOT called. + self.assertFalse(mock_os.remove.called, "Failed to not remove the file if not present.") + + # make the file 'exist' + mock_path.isfile.return_value = True + + reference.rm("any path") + + mock_os.remove.assert_called_with("any path") +``` + +Great, so we now know that the RemovalService works as planned. Let’s create another service which declares it as a dependency: + +``` +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import os +import os.path + +class RemovalService(object): + """A service for removing objects from the filesystem.""" + + def rm(self, filename): + if os.path.isfile(filename): + os.remove(filename) + + +class UploadService(object): + + def __init__(self, removal_service): + self.removal_service = removal_service + + def upload_complete(self, filename): + self.removal_service.rm(filename) +``` + +Since we already have test coverage on the RemovalService, we’re not going to validate internal functionality of the rm method in our tests of UploadService. Rather, we’ll simply test (without side-effects, of course) that UploadService calls the RemovalService.rm method, which we know “just works™” from our previous test case. + +There are two ways to go about this: + +1. Mock out the RemovalService.rm method itself. +2. Supply a mocked instance in the constructor of UploadService. + +As both methods are often important in unit-testing, we’ll review both. + +### Option 1: Mocking Instance Methods + +The mock library has a special method decorator for mocking object instance methods and properties, the @mock.patch.object decorator: + +``` +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from mymodule import RemovalService, UploadService + +import mock +import unittest + +class RemovalServiceTestCase(unittest.TestCase): + + @mock.patch('mymodule.os.path') + @mock.patch('mymodule.os') + def test_rm(self, mock_os, mock_path): + # instantiate our service + reference = RemovalService() + + # set up the mock + mock_path.isfile.return_value = False + + reference.rm("any path") + + # test that the remove call was NOT called. + self.assertFalse(mock_os.remove.called, "Failed to not remove the file if not present.") + + # make the file 'exist' + mock_path.isfile.return_value = True + + reference.rm("any path") + + mock_os.remove.assert_called_with("any path") + + +class UploadServiceTestCase(unittest.TestCase): + + @mock.patch.object(RemovalService, 'rm') + def test_upload_complete(self, mock_rm): + # build our dependencies + removal_service = RemovalService() + reference = UploadService(removal_service) + + # call upload_complete, which should, in turn, call `rm`: + reference.upload_complete("my uploaded file") + + # check that it called the rm method of any RemovalService + mock_rm.assert_called_with("my uploaded file") + + # check that it called the rm method of _our_ removal_service + removal_service.rm.assert_called_with("my uploaded file") +``` + +Great! We’ve validated that the UploadService successfully calls our instance’s rm method. Notice anything interesting in there? The patching mechanism actually replaced the rm method of all RemovalService instances in our test method. That means that we can actually inspect the instances themselves. If you want to see more, try dropping in a breakpoint in your mocking code to get a good feel for how the patching mechanism works. + +### Pitfall: Decorator Order + +When using multiple decorators on your test methods, order is important, and it’s kind of confusing. Basically, when mapping decorators to method parameters, [work backwards][3]. Consider this example: + +``` +@mock.patch('mymodule.sys') + @mock.patch('mymodule.os') + @mock.patch('mymodule.os.path') + def test_something(self, mock_os_path, mock_os, mock_sys): + pass +``` + +Notice how our parameters are matched to the reverse order of the decorators? That’s partly because of [the way that Python works][4]. With multiple method decorators, here’s the order of execution in pseudocode: + +``` +patch_sys(patch_os(patch_os_path(test_something))) +``` + +Since the patch to sys is the outermost patch, it will be executed last, making it the last parameter in the actual test method arguments. Take note of this well and use a debugger when running your tests to make sure that the right parameters are being injected in the right order. + +### Option 2: Creating Mock Instances + +Instead of mocking the specific instance method, we could instead just supply a mocked instance to UploadService with its constructor. I prefer option 1 above, as it’s a lot more precise, but there are many cases where option 2 might be efficient or necessary. Let’s refactor our test again: + +``` +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from mymodule import RemovalService, UploadService + +import mock +import unittest + +class RemovalServiceTestCase(unittest.TestCase): + + @mock.patch('mymodule.os.path') + @mock.patch('mymodule.os') + def test_rm(self, mock_os, mock_path): + # instantiate our service + reference = RemovalService() + + # set up the mock + mock_path.isfile.return_value = False + + reference.rm("any path") + + # test that the remove call was NOT called. + self.assertFalse(mock_os.remove.called, "Failed to not remove the file if not present.") + + # make the file 'exist' + mock_path.isfile.return_value = True + + reference.rm("any path") + + mock_os.remove.assert_called_with("any path") + + +class UploadServiceTestCase(unittest.TestCase): + + def test_upload_complete(self, mock_rm): + # build our dependencies + mock_removal_service = mock.create_autospec(RemovalService) + reference = UploadService(mock_removal_service) + + # call upload_complete, which should, in turn, call `rm`: + reference.upload_complete("my uploaded file") + + # test that it called the rm method + mock_removal_service.rm.assert_called_with("my uploaded file") +``` + +In this example, we haven’t even had to patch any functionality, we simply create an auto-spec for the RemovalService class, and then inject this instance into our UploadService to validate the functionality. + +The [mock.create_autospec][5] method creates a functionally equivalent instance to the provided class. What this means, practically speaking, is that when the returned instance is interacted with, it will raise exceptions if used in illegal ways. More specifically, if a method is called with the wrong number of arguments, an exception will be raised. This is extremely important as refactors happen. As a library changes, tests break and that is expected. Without using an auto-spec, our tests will still pass even though the underlying implementation is broken. + +### Pitfall: The mock.Mock and mock.MagicMock Classes + +The mock library also includes two important classes upon which most of the internal functionality is built upon: [mock.Mock][6] and mock.MagicMock. When given a choice to use a mock.Mock instance, a mock.MagicMock instance, or an auto-spec, always favor using an auto-spec, as it helps keep your tests sane for future changes. This is because mock.Mock and mock.MagicMock accept all method calls and property assignments regardless of the underlying API. Consider the following use case: + +``` +class Target(object): + def apply(value): + return value + +def method(target, value): + return target.apply(value) +``` + +We can test this with a mock.Mock instance like this: + +``` +class MethodTestCase(unittest.TestCase): + + def test_method(self): + target = mock.Mock() + + method(target, "value") + + target.apply.assert_called_with("value") +``` + +This logic seems sane, but let’s modify the Target.apply method to take more parameters: + +``` +class Target(object): + def apply(value, are_you_sure): + if are_you_sure: + return value + else: + return None +``` + +Re-run your test, and you’ll find that it still passes. That’s because it isn’t built against your actual API. This is why you should always use the create_autospec method and the autospec parameter with the @patch and @patch.object decorators. + +### Real-World Example: Mocking a Facebook API Call + +To finish up, let’s write a more applicable real-world example, one which we mentioned in the introduction: posting a message to Facebook. We’ll write a nice wrapper class and a corresponding test case. + +``` +import facebook + +class SimpleFacebook(object): + + def __init__(self, oauth_token): + self.graph = facebook.GraphAPI(oauth_token) + + def post_message(self, message): + """Posts a message to the Facebook wall.""" + self.graph.put_object("me", "feed", message=message) +``` + +Here’s our test case, which checks that we post the message without actually posting the message: + +``` +import facebook +import simple_facebook +import mock +import unittest + +class SimpleFacebookTestCase(unittest.TestCase): + + @mock.patch.object(facebook.GraphAPI, 'put_object', autospec=True) + def test_post_message(self, mock_put_object): + sf = simple_facebook.SimpleFacebook("fake oauth token") + sf.post_message("Hello World!") + + # verify + mock_put_object.assert_called_with(message="Hello World!") +``` + +As we’ve seen so far, it’s really simple to start writing smarter tests with mock in Python. + +### Mocking in python Conclusion + +Python’s mock library, if a little confusing to work with, is a game-changer for [unit-testing][7]. We’ve demonstrated common use-cases for getting started using mock in unit-testing, and hopefully this article will help [Python developers][8] overcome the initial hurdles and write excellent, tested code. + +-------------------------------------------------------------------------------- + +via: http://slviki.com/index.php/2016/06/18/introduction-to-mocking-in-python/ + +作者:[Dasun Sucharith][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.slviki.com/ +[1]: http://www.python.org/dev/peps/pep-0417/ +[2]: https://pypi.python.org/pypi/mock +[3]: http://www.voidspace.org.uk/python/mock/patch.html#nesting-patch-decorators +[4]: http://docs.python.org/2/reference/compound_stmts.html#function-definitions +[5]: http://www.voidspace.org.uk/python/mock/helpers.html#autospeccing +[6]: http://www.voidspace.org.uk/python/mock/mock.html +[7]: http://www.toptal.com/qa/how-to-write-testable-code-and-why-it-matters +[8]: http://www.toptal.com/python + + + + + + + + + From 1431c59c8d4c5fb4701d9cb82bbfc1cad8ee307f Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 11 Jul 2016 20:35:31 +0800 Subject: [PATCH 1129/1469] =?UTF-8?q?20160711-5=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ook Messenger bot with Python and Flask.md | 319 ++++++++++++++++++ 1 file changed, 319 insertions(+) create mode 100644 sources/tech/20160602 How to build and deploy a Facebook Messenger bot with Python and Flask.md diff --git a/sources/tech/20160602 How to build and deploy a Facebook Messenger bot with Python and Flask.md b/sources/tech/20160602 How to build and deploy a Facebook Messenger bot with Python and Flask.md new file mode 100644 index 0000000000..1f3fbe1ed3 --- /dev/null +++ b/sources/tech/20160602 How to build and deploy a Facebook Messenger bot with Python and Flask.md @@ -0,0 +1,319 @@ +How to build and deploy a Facebook Messenger bot with Python and Flask, a tutorial +========================================================================== + +This is my log of how I built a simple Facebook Messenger bot. The functionality is really simple, it’s an echo bot that will just print back to the user what they write. + +This is something akin to the Hello World example for servers, the echo server. + +The goal of the project is not to build the best Messenger bot, but rather to get a feel for what it takes to build a minimal bot and how everything comes together. + +- [Tech Stack][1] +- [Bot Architecture][2] +- [The Bot Server][3] +- [Deploying to Heroku][4] +- [Creating the Facebook App][5] +- [Conclusion][6] + +### Tech Stack + +The tech stack that was used is: + +- [Heroku][7] for back end hosting. The free-tier is more than enough for a tutorial of this level. The echo bot does not require any sort of data persistence so a database was not used. +- [Python][8] was the language of choice. The version that was used is 2.7 however it can easily be ported to Python 3 with minor alterations. +- [Flask][9] as the web development framework. It’s a very lightweight framework that’s perfect for small scale projects/microservices. +- Finally the [Git][10] version control system was used for code maintenance and to deploy to Heroku. +- Worth mentioning: [Virtualenv][11]. This python tool is used to create “environments” clean of python libraries so you can only install the necessary requirements and minimize the app footprint. + +### Bot Architecture + +Messenger bots are constituted by a server that responds to two types of requests: + +- GET requests are being used for authentication. They are sent by Messenger with an authentication code that you register on FB. +- POST requests are being used for the actual communication. The typical workflow is that the bot will initiate the communication by sending the POST request with the data of the message sent by the user, we will handle it, send a POST request of our own back. If that one is completed successfully (a 200 OK status is returned) we also respond with a 200 OK code to the initial Messenger request. +For this tutorial the app will be hosted on Heroku, which provides a nice and easy interface to deploy apps. As mentioned the free tier will suffice for this tutorial. + +After the app has been deployed and is running, we’ll create a Facebook app and link it to our app so that messenger knows where to send the requests that are meant for our bot. + +### The Bot Server +The basic server code was taken from the following [Chatbot][12] project by Github user [hult (Magnus Hult)][13], with a few modifications to the code to only echo messages and a couple bugfixes I came across. This is the final version of the server code: + +``` +from flask import Flask, request +import json +import requests + +app = Flask(__name__) + +# This needs to be filled with the Page Access Token that will be provided +# by the Facebook App that will be created. +PAT = '' + +@app.route('/', methods=['GET']) +def handle_verification(): + print "Handling Verification." + if request.args.get('hub.verify_token', '') == 'my_voice_is_my_password_verify_me': + print "Verification successful!" + return request.args.get('hub.challenge', '') + else: + print "Verification failed!" + return 'Error, wrong validation token' + +@app.route('/', methods=['POST']) +def handle_messages(): + print "Handling Messages" + payload = request.get_data() + print payload + for sender, message in messaging_events(payload): + print "Incoming from %s: %s" % (sender, message) + send_message(PAT, sender, message) + return "ok" + +def messaging_events(payload): + """Generate tuples of (sender_id, message_text) from the + provided payload. + """ + data = json.loads(payload) + messaging_events = data["entry"][0]["messaging"] + for event in messaging_events: + if "message" in event and "text" in event["message"]: + yield event["sender"]["id"], event["message"]["text"].encode('unicode_escape') + else: + yield event["sender"]["id"], "I can't echo this" + + +def send_message(token, recipient, text): + """Send the message text to recipient with id recipient. + """ + + r = requests.post("https://graph.facebook.com/v2.6/me/messages", + params={"access_token": token}, + data=json.dumps({ + "recipient": {"id": recipient}, + "message": {"text": text.decode('unicode_escape')} + }), + headers={'Content-type': 'application/json'}) + if r.status_code != requests.codes.ok: + print r.text + +if __name__ == '__main__': + app.run() +``` + +Let’s break down the code. The first part is the imports that will be needed: + +``` +from flask import Flask, request +import json +import requests +``` + +Next we define the two functions (using the Flask specific app.route decorators) that will handle the GET and POST requests to our bot. + +``` +@app.route('/', methods=['GET']) +def handle_verification(): + print "Handling Verification." + if request.args.get('hub.verify_token', '') == 'my_voice_is_my_password_verify_me': + print "Verification successful!" + return request.args.get('hub.challenge', '') + else: + print "Verification failed!" + return 'Error, wrong validation token' +``` + +The verify_token object that is being sent by Messenger will be declared by us when we create the Facebook app. We have to validate the one we are being have against itself. Finally we return the “hub.challenge” back to Messenger. + +The function that handles the POST requests is a bit more interesting. + +``` +@app.route('/', methods=['POST']) +def handle_messages(): + print "Handling Messages" + payload = request.get_data() + print payload + for sender, message in messaging_events(payload): + print "Incoming from %s: %s" % (sender, message) + send_message(PAT, sender, message) + return "ok" +``` + +When called we grab the massage payload, use function messaging_events to break it down and extract the sender user id and the actual message sent, generating a python iterator that we can loop over. Notice that in each request sent by Messenger it is possible to have more than one messages. + +``` +def messaging_events(payload): + """Generate tuples of (sender_id, message_text) from the + provided payload. + """ + data = json.loads(payload) + messaging_events = data["entry"][0]["messaging"] + for event in messaging_events: + if "message" in event and "text" in event["message"]: + yield event["sender"]["id"], event["message"]["text"].encode('unicode_escape') + else: + yield event["sender"]["id"], "I can't echo this" +``` + +While iterating over each message we call the send_message function and we perform the POST request back to Messnger using the Facebook Graph messages API. During this time we still have not responded to the original Messenger request which we are blocking. This can lead to timeouts and 5XX errors. + +The above was spotted during an outage due to a bug I came across, which was occurred when the user was sending emojis which are actual unicode ids, however Python was miss-encoding. We ended up sending back garbage. + +This POST request back to Messenger would never finish, and that in turn would cause 5XX status codes to be returned to the original request, rendering the service unusable. + +This was fixed by escaping the messages with `encode('unicode_escape')` and then just before we sent back the message decode it with `decode('unicode_escape')`. + +``` +def send_message(token, recipient, text): + """Send the message text to recipient with id recipient. + """ + + r = requests.post("https://graph.facebook.com/v2.6/me/messages", + params={"access_token": token}, + data=json.dumps({ + "recipient": {"id": recipient}, + "message": {"text": text.decode('unicode_escape')} + }), + headers={'Content-type': 'application/json'}) + if r.status_code != requests.codes.ok: + print r.text +``` + +### Deploying to Heroku + +Once the code was built to my liking it was time for the next step. +Deploy the app. + +Sure, but how? + +I have deployed apps before to Heroku (mainly Rails) however I was always following a tutorial of some sort, so the configuration has already been created. In this case though I had to start from scratch. + +Fortunately it was the official [Heroku documentation][14] to the rescue. The article explains nicely the bare minimum required for running an app. + +Long story short, what we need besides our code are two files. The first file is the “requirements.txt” file which is a list of of the library dependencies required to run the application. + +The second file required is the “Procfile”. This file is there to inform the Heroku how to run our service. Again the bare minimum needed for this file is the following: + +>web: gunicorn echoserver:app + +The way this will be interpreted by heroku is that our app is started by running the echoserver.py file and the app will be using gunicorn as the web server. The reason we are using an additional webserver is performance related and is explained in the above Heroku documentation: + +>Web applications that process incoming HTTP requests concurrently make much more efficient use of dyno resources than web applications that only process one request at a time. Because of this, we recommend using web servers that support concurrent request processing whenever developing and running production services. + +>The Django and Flask web frameworks feature convenient built-in web servers, but these blocking servers only process a single request at a time. If you deploy with one of these servers on Heroku, your dyno resources will be underutilized and your application will feel unresponsive. + +>Gunicorn is a pure-Python HTTP server for WSGI applications. It allows you to run any Python application concurrently by running multiple Python processes within a single dyno. It provides a perfect balance of performance, flexibility, and configuration simplicity. + +Going back to our “requirements.txt” file let’s see how it binds with the Virtualenv tool that was mentioned. + +At anytime, your developement machine may have a number of python libraries installed. When deploying applications you don’t want to have these libraries loaded as it makes it hard to make out which ones you actually use. + +What Virtualenv does is create a new blank virtual enviroment so that you can only install the libraries that your app requires. + +You can check which libraries are currently installed by running the following command: + +``` +kostis@KostisMBP ~ $ pip freeze +cycler==0.10.0 +Flask==0.10.1 +gunicorn==19.6.0 +itsdangerous==0.24 +Jinja2==2.8 +MarkupSafe==0.23 +matplotlib==1.5.1 +numpy==1.10.4 +pyparsing==2.1.0 +python-dateutil==2.5.0 +pytz==2015.7 +requests==2.10.0 +scipy==0.17.0 +six==1.10.0 +virtualenv==15.0.1 +Werkzeug==0.11.10 +``` + +Note: The pip tool should already be installed on your machine along with Python. + +If not check the [official site][15] for how to install it. + +Now let’s use Virtualenv to create a new blank enviroment. First we create a new folder for our project, and change dir into it: + +``` +kostis@KostisMBP projects $ mkdir echoserver +kostis@KostisMBP projects $ cd echoserver/ +kostis@KostisMBP echoserver $ +``` + +Now let’s create a new enviroment called echobot. To activate it you run the following source command, and checking with pip freeze we can see that it’s now empty. + +``` +kostis@KostisMBP echoserver $ virtualenv echobot +kostis@KostisMBP echoserver $ source echobot/bin/activate +(echobot) kostis@KostisMBP echoserver $ pip freeze +(echobot) kostis@KostisMBP echoserver $ +``` + +We can start installing the libraries required. The ones we’ll need are flask, gunicorn, and requests and with them installed we create the requirements.txt file: + +``` +(echobot) kostis@KostisMBP echoserver $ pip install flask +(echobot) kostis@KostisMBP echoserver $ pip install gunicorn +(echobot) kostis@KostisMBP echoserver $ pip install requests +(echobot) kostis@KostisMBP echoserver $ pip freeze +click==6.6 +Flask==0.11 +gunicorn==19.6.0 +itsdangerous==0.24 +Jinja2==2.8 +MarkupSafe==0.23 +requests==2.10.0 +Werkzeug==0.11.10 +(echobot) kostis@KostisMBP echoserver $ pip freeze > requirements.txt +``` + +After all the above have been run, we create the echoserver.py file with the python code and the Procfile with the command that was mentioned, and we should end up with the following files/folders: + +``` +(echobot) kostis@KostisMBP echoserver $ ls +Procfile echobot echoserver.py requirements.txt +``` + +We are now ready to upload to Heroku. We need to do two things. The first is to install the Heroku toolbet if it’s not already installed on your system (go to [Heroku][16] for details). The second is to create a new Heroku app through the [web interface][17]. + +Click on the big plus sign on the top right and select “Create new app”. + + + + + + + + +-------------------------------------------------------------------------------- + +via: http://tsaprailis.com/2016/06/02/How-to-build-and-deploy-a-Facebook-Messenger-bot-with-Python-and-Flask-a-tutorial/ + +作者:[Konstantinos Tsaprailis][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://github.com/kostistsaprailis +[1]: http://tsaprailis.com/2016/06/02/How-to-build-and-deploy-a-Facebook-Messenger-bot-with-Python-and-Flask-a-tutorial/#tech-stack +[2]: http://tsaprailis.com/2016/06/02/How-to-build-and-deploy-a-Facebook-Messenger-bot-with-Python-and-Flask-a-tutorial/#bot-architecture +[3]: http://tsaprailis.com/2016/06/02/How-to-build-and-deploy-a-Facebook-Messenger-bot-with-Python-and-Flask-a-tutorial/#the-bot-server +[4]: http://tsaprailis.com/2016/06/02/How-to-build-and-deploy-a-Facebook-Messenger-bot-with-Python-and-Flask-a-tutorial/#deploying-to-heroku +[5]: http://tsaprailis.com/2016/06/02/How-to-build-and-deploy-a-Facebook-Messenger-bot-with-Python-and-Flask-a-tutorial/#creating-the-facebook-app +[6]: http://tsaprailis.com/2016/06/02/How-to-build-and-deploy-a-Facebook-Messenger-bot-with-Python-and-Flask-a-tutorial/#conclusion +[7]: https://www.heroku.com +[8]: https://www.python.org +[9]: http://flask.pocoo.org +[10]: https://git-scm.com +[11]: https://virtualenv.pypa.io/en/stable +[12]: https://github.com/hult/facebook-chatbot-python +[13]: https://github.com/hult +[14]: https://devcenter.heroku.com/articles/python-gunicorn +[15]: https://pip.pypa.io/en/stable/installing +[16]: https://toolbelt.heroku.com +[17]: https://dashboard.heroku.com/apps + + From 0f727514320c4fb03fb57f9ef07c727c9f53213a Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 11 Jul 2016 20:39:40 +0800 Subject: [PATCH 1130/1469] =?UTF-8?q?20160711-6=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...e text format for the visually impaired.md | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 sources/tech/20160624 DAISY A Linux-compatible text format for the visually impaired.md diff --git a/sources/tech/20160624 DAISY A Linux-compatible text format for the visually impaired.md b/sources/tech/20160624 DAISY A Linux-compatible text format for the visually impaired.md new file mode 100644 index 0000000000..4bf5ccaf42 --- /dev/null +++ b/sources/tech/20160624 DAISY A Linux-compatible text format for the visually impaired.md @@ -0,0 +1,46 @@ +DAISY : A Linux-compatible text format for the visually impaired +================================================================= + + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/education/osdc-lead_books.png?itok=K8wqfPT5) +>Image by : +Image by Kate Ter Haar. Modified by opensource.com. CC BY-SA 2.0. + +If you're blind or visually impaired like I am, you usually require various levels of hardware or software to do things that people who can see take for granted. One among these is specialized formats for reading print books: Braille (if you know how to read it) or specialized text formats such as DAISY. + +### What is DAISY? + +DAISY stands for Digital Accessible Information System. It's an open standard used almost exclusively by the blind to read textbooks, periodicals, newspapers, fiction, you name it. It was founded in the mid '90s by [The DAISY Consortium][1], a group of organizations dedicated to producing a set of standards that would allow text to be marked up in a way that would make it easy to read, skip around in, annotate, and otherwise manipulate text in much the same way a sighted user would. + +The current version of DAISY 3.0, was released in mid-2005 and is a complete rewrite of the standard. It was created with the goal of making it much easier to write books complying with it. It's worth noting that DAISY can support plain text only, audio recordings (in PCM Wave or MPEG Layer III format) only, or a combination of text and audio. Specialized software can read these books and allow users to set bookmarks and navigate a book as easily as a sighted person would with a print book. + +### How does DAISY work? + +DAISY, regardless of the specific version, works a bit like this: You have your main navigation file (ncc.html in DAISY 2.02) that contains metadata about the book, such as author's name, copyright date, how many pages the book has, etc. This file is a valid XML document in the case of DAISY 3.0, with DTD (document type definition) files being highly recommended to be included with each book. + +In the navigation control file is markup describing precise positions—either text caret offsets in the case of text navigation or time down to the millisecond in the case of audio recordings—that allows the software to skip to that exact point in the book much as a sighted person would turn to a chapter page. It's worth noting that this navigation control file only contains positions for the main, and largest, elements of a book. + +The smaller elements are handled by SMIL (synchronized multimedia integration language) files. These files contain position points for each chapter in the book. The level of navigation depends heavily on how well the book was marked up. Think of it like this: If a print book has no chapter headings, you will have a hard time figuring out which chapter you're in. If a DAISY book is badly marked up, you might only be able to navigate to the start of the book, or possibly only to the table of contents. If a book is marked up badly enough (or missing markup entirely), your DAISY reading software is likely to simply ignore it. + +### Why the need for specialized software? + +You may be wondering why, if DAISY is little more than HTML, XML, and audio files, you would need specialized software to read and manipulate it. Technically speaking, you don't. The specialized software is mostly for convenience. In Linux, for example, a simple web browser can be used to open the books and read them. If you click on the XML file in a DAISY 3 book, all the software will generally do is read the spines of the books you give it access to and create a list of them that you click on to open. If a book is badly marked up, it won't show up in this list. + +Producing DAISY is another matter entirely, and usually requires either specialized software or enough knowledge of the specifications to modify general-purpose software to parse it. + +### Conclusion + +Fortunately, DAISY is a dying standard. While it is very good at what it does, the need for specialized software to produce it has set us apart from the normal sighted world, where readers use a variety of formats to read their books electronically. This is why the DAISY consortium has succeeded DAISY with EPUB, version 3, which supports what are called media overlays. This is basically an EPUB book with optional audio or video. Since EPUB shares a lot of DAISY's XML markup, some software that can read DAISY can see EPUB books but usually cannot read them. This means that once the websites that provide books for us switch over to this open format, we will have a much larger selection of software to read our books. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/16/5/daisy-linux-compatible-text-format-visually-impaired + +作者:[Kendell Clark][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/kendell-clark +[1]: http://www.daisy.org From d60d5ab51956646d56e2743a8f70a71da9fb0d84 Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 11 Jul 2016 20:45:31 +0800 Subject: [PATCH 1131/1469] =?UTF-8?q?20160711-7=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20160711 Getting started with Git.md | 139 ++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 sources/tech/20160711 Getting started with Git.md diff --git a/sources/tech/20160711 Getting started with Git.md b/sources/tech/20160711 Getting started with Git.md new file mode 100644 index 0000000000..032e5e3510 --- /dev/null +++ b/sources/tech/20160711 Getting started with Git.md @@ -0,0 +1,139 @@ +Getting started with Git +========================= + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/get_started_lead.jpeg?itok=r22AKc6P) +>Image by : opensource.com + + +In the introduction to this series we learned who should use Git, and what it is for. Today we will learn how to clone public Git repositories, and how to extract individual files without cloning the whole works. + +Since Git is so popular, it makes life a lot easier if you're at least familiar with it at a basic level. If you can grasp the basics (and you can, I promise!), then you'll be able to download whatever you need, and maybe even contribute stuff back. And that, after all, is what open source is all about: having access to the code that makes up the software you run, the freedom to share it with others, and the right to change it as you please. Git makes this whole process easy, as long as you're comfortable with Git. + +So let's get comfortable with Git. + +### Read and write + +Broadly speaking, there are two ways to interact with a Git repository: you can read from it, or you can write to it. It's just like a file: sometimes you open a document just to read it, and other times you open a document because you need to make changes. + +In this article, we'll cover reading from a Git repository. We'll tackle the subject of writing back to a Git repository in a later article. + +### Git or GitHub? + +A word of clarification: Git is not the same as GitHub (or GitLab, or Bitbucket). Git is a command-line program, so it looks like this: + +``` +$ git +usage: Git [--version] [--help] [-C ] + [-p | --paginate | --no-pager] [--bare] + [--Git-dir=] [] + +``` + +As Git is open source, lots of smart people have built infrastructures around it which, in themselves, have become very popular. + +My articles about Git teach pure Git first, because if you understand what Git is doing then you can maintain an indifference to what front end you are using. However, my articles also include common ways of accomplishing each task through popular Git services, since that's probably what you'll encounter first. + +### Installing Git + +To install Git on Linux, grab it from your distribution's software repository. BSD users should find Git in the Ports tree, in the devel section. + +For non-open source operating systems, go to the [project site][1] and follow the instructions. Once installed, there should be no difference between Linux, BSD, and Mac OS X commands. Windows users will have to adapt Git commands to match the Windows file system, or install Cygwin to run Git natively, without getting tripped up by Windows file system conventions. + +### Afternoon tea with Git + +Not every one of us needs to adopt Git into our daily lives right away. Sometimes, the most interaction you have with Git is to visit a repository of code, download a file or two, and then leave. On the spectrum of getting to know Git, this is more like afternoon tea than a proper dinner party. You make some polite conversation, you get the information you need, and then you part ways without the intention of speaking again for at least another three months. + +And that's OK. + +Generally speaking, there are two ways to access Git: via command line, or by any one of the fancy Internet technologies providing quick and easy access through the web browser. + +Say you want to install a trash bin for use in your terminal because you've been burned one too many times by the rm command. You've heard about Trashy, which calls itself "a sane intermediary to the rm command", and you want to look over its documentation before you install it. Lucky for you, [Trashy is hosted publicly on GitLab.com][2]. + +### Landgrab + +The first way we'll work with this Git repository is a sort of landgrab method: we'll clone the entire thing, and then sort through the contents later. Since the repository is hosted with a public Git service, there are two ways to do this: on the command line, or through a web interface. + +To grab an entire repository with Git, use the git clone command with the URL of the Git repository. If you're not clear on what the right URL is, the repository should tell you. GitLab gives you a copy-and-paste repository URL [for Trashy][3]. + +![](https://opensource.com/sites/default/files/1_gitlab-url.jpg) + +You might notice that on some services, both SSH and HTTPS links are provided. You can use SSH only if you have write permissions to the repository. Otherwise, you must use the HTTPS URL. + +Once you have the right URL, cloning the repository is pretty simple. Just git clone the URL, and optionally name the directory to clone it into. The default behaviour is to clone the git directory to your current directory; for example, 'trashy.git' gets put in your current location as 'trashy'. I use the .clone extension as a shorthand for repositories that are read-only, and the .git extension as shorthand for repositories I can read and write, but that's not by any means an official mandate. + +``` +$ git clone https://gitlab.com/trashy/trashy.git trashy.clone +Cloning into 'trashy.clone'... +remote: Counting objects: 142, done. +remote: Compressing objects: 100% (91/91), done. +remote: Total 142 (delta 70), reused 103 (delta 47) +Receiving objects: 100% (142/142), 25.99 KiB | 0 bytes/s, done. +Resolving deltas: 100% (70/70), done. +Checking connectivity... done. +``` + +Once the repository has been cloned successfully, you can browse files in it just as you would any other directory on your computer. + +The other way to get a copy of the repository is through the web interface. Both GitLab and GitHub provide a snapshot of any repository in a .zip file. GitHub has a big green download button, but on GitLab, look for an inconspicuous download button on the far right of your browser window: + +![](https://opensource.com/sites/default/files/1_gitlab-zip.jpg) + +### Pick and choose + +An alternate method of obtaining a file from a Git repository is to find the file you're after and pluck it right out of the repository. This method is only supported via web interfaces, which is essentially you looking at someone else's clone of a repository; you can think of it as a sort of HTTP shared directory. + +The problem with using this method is that you might find that certain files don't actually exist in a raw Git repository, as a file might only exist in its complete form after a make command builds the file, which won't happen until you download the repository, read the README or INSTALL file, and run the command. Assuming, however, that you are sure a file does exist and you just want to go into the repository, grab it, and walk away, you can do that. + +In GitLab and GitHub, click the Files link for a file view, view the file in Raw mode, and use your web browser's save function, e.g. in Firefox, File > Save Page As. In a GitWeb repository (a web view of personal git repositories used some who prefer to host git themselves), the Raw view link is in the file listing view. + +![](https://opensource.com/sites/default/files/1_webgit-file.jpg) + +### Best practices + +Generally, cloning an entire Git repository is considered the right way of interacting with Git. There are a few reasons for this. Firstly, a clone is easy to keep updated with the git pull command, so you won't have to keep going back to some web site for a new copy of a file each time an improvement has been made. Secondly, should you happen to make an improvement yourself, then it is easier to submit those changes to the original author if it is all nice and tidy in a Git repository. + +For now, it's probably enough to just practice going out and finding interesting Git repositories and cloning them to your drive. As long as you know the basics of using a terminal, then it's not hard to do. Don't know the basics of terminal usage? Give me five more minutes of your time. + +### Terminal basics + +The first thing to understand is that all files have a path. That makes sense; if I told you to open a file for me on a regular non-terminal day, you'd have to get to where that file is on your drive, and you'd do that by navigating a bunch of computer windows until you reached that file. For example, maybe you'd click your home directory > Pictures > InktoberSketches > monkey.kra. + +In that scenario, we could say that the file monkeysketch.kra has the path $HOME/Pictures/InktoberSketches/monkey.kra. + +In the terminal, unless you're doing special sysadmin work, your file paths are generally going to start with $HOME (or, if you're lazy, just the ~ character) followed by a list of folders up to the filename itself. This is analogous to whatever icons you click in your GUI to reach the file or folder. + +If you want to clone a Git repository into your Documents directory, then you could open a terminal and run this command: + +``` +$ git clone https://gitlab.com/foo/bar.git +$HOME/Documents/bar.clone +``` + +Once that is complete, you can open a file manager window, navigate to your Documents folder, and you'll find the bar.clone directory waiting for you. + +If you want to get a little more advanced, you might revisit that repository at some later date, and try a git pull to see if there have been updates to the project: + +``` +$ cd $HOME/Documents/bar.clone +$ pwd +bar.clone +$ git pull +``` + +For now, that's all the terminal commands you need to get started, so go out and explore. The more you do it, the better you get at it, and that is, at least give or take a vowel, the name of the game. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/16/7/stumbling-git + +作者:[Seth Kenlon][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[1]: https://git-scm.com/download +[2]: https://gitlab.com/trashy/trashy +[3]: https://gitlab.com/trashy/trashy.git + From 93bb30d7e4d0f40f711aa8304fbbfa389fba163d Mon Sep 17 00:00:00 2001 From: cposture Date: Tue, 12 Jul 2016 00:41:32 +0800 Subject: [PATCH 1132/1469] translating partly --- ...reate Your Own Shell in Python - Part I.md | 41 ++++++++++--------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/sources/tech/20160705 Create Your Own Shell in Python - Part I.md b/sources/tech/20160705 Create Your Own Shell in Python - Part I.md index 48e84381c8..0b7e415f2a 100644 --- a/sources/tech/20160705 Create Your Own Shell in Python - Part I.md +++ b/sources/tech/20160705 Create Your Own Shell in Python - Part I.md @@ -1,15 +1,15 @@ -Translating by cposture 2016.07.09 -Create Your Own Shell in Python : Part I +使用 Python 创建你自己的 Shell:Part I +========================================== -I’m curious to know how a shell (like bash, csh, etc.) works internally. So, I implemented one called yosh (Your Own SHell) in Python to answer my own curiosity. The concept I explain in this article can be applied to other languages as well. +我很好奇一个 shell (像 bash,csh 等)内部是如何工作的。为了满足自己的好奇心,我使用 Python 实现了一个名为 yosh (Your Own Shell)的 Shell。本文章所介绍的概念也可以应用于其他编程语言。 -(Note: You can find source code used in this blog post here. I distribute it with MIT license.) +(提示:你可以发布于此的博文中找到使用的源代码,代码以 MIT 许可发布) -Let’s start. +让我们开始吧。 -### Step 0: Project Structure +### 步骤 0:项目结构 -For this project, I use the following project structure. +对于此项目,我使用了以下的项目结构。 ``` yosh_project @@ -18,17 +18,17 @@ yosh_project |-- shell.py ``` -`yosh_project` is the root project folder (you can also name it just `yosh`). +`yosh_project` 为项目根目录(你也可以把它简单地命名为 `yosh`)。 -`yosh` is the package folder and `__init__.py` will make it a package named the same as the package folder name. (If you don’t write Python, just ignore it.) +`yosh` 为包目录,并且 `__init__.py` 将会使一个包名等同于包目录名字(如果你不写 Python,可以忽略它) -`shell.py` is our main shell file. +`shell.py` 是我们的主脚本文件。 -### Step 1: Shell Loop +### 步骤 1:Shell 循环 -When you start a shell, it will show a command prompt and wait for your command input. After it receives the command and executes it (the detail will be explained later), your shell will be back to the wait loop for your next command. +当你启动一个 shell,它会显示一个命令提示符同时等待用户输入命令。在接收了输入的命令并执行它之后(稍后文章会进行详细解释),你的 shell 会回到循环,等待下一条指令。 -In `shell.py`, we start by a simple main function calling the shell_loop() function as follows: +在 `shell.py`,我们会以一个简单的 mian 函数开始,该函数调用了 shell_loop() 函数,如下: ``` def shell_loop(): @@ -43,7 +43,7 @@ if __name__ == "__main__": main() ``` -Then, in our `shell_loop()`, we use a status flag to indicate whether the loop should continue or stop. In the beginning of the loop, our shell will show a command prompt and wait to read command input. +接着,在 `shell_loop()`,为了指示循环是否继续或停止,我们使用了一个状态标志。在循环的开始,我们的 shell 将显示一个命令提示符,并等待读取命令输入。 ``` import sys @@ -64,9 +64,9 @@ def shell_loop(): cmd = sys.stdin.readline() ``` -After that, we tokenize the command input and execute it (we’ll implement the tokenize and execute functions soon). +之后,我们切分命令输入并进行执行(我们将马上解释命令切分和执行函数)。 -Therefore, our shell_loop() will be the following. +因此,我们的 shell_loop() 会是如下这样: ``` import sys @@ -93,14 +93,15 @@ def shell_loop(): status = execute(cmd_tokens) ``` -That’s all of our shell loop. If we start our shell with python shell.py, it will show the command prompt. However, it will throw an error if we type a command and hit enter because we don’t define tokenize function yet. +这就是我们整个 shell 循环。如果我们使用 python shell.py 命令启动 shell,它会显示命令提示符。然而如果我们输入命令并按回车,它将会抛出错误,因为我们还没定义命令切分函数。 -To exit the shell, try ctrl-c. I will tell how to exit gracefully later. +为了退出 shell,可以尝试输入 ctrl-c。稍后我将解释如何以优雅的形式退出 shell。 -### Step 2: Tokenization +### 步骤 2:命令切分 -When a user types a command in our shell and hits enter. The command input will be a long string containing both a command name and its arguments. Therefore, we have to tokenize it (split a string into several tokens). +当一个用户在我们的 shell 中输入命令并按下回车键,该命令将会是一个包含命令名称及其参数的很长的字符串。因此,我们必须切分该字符串(分割一个字符串为多个标记)。 +咋一看它似乎很简单。我们或许可以使用 cmd.split(),用空格分割输入。 It seems simple at first glance. We might use cmd.split() to separate the input by spaces. It works well for a command like `ls -a my_folder` because it splits the command into a list `['ls', '-a', 'my_folder']` which we can use them easily. However, there are some cases that some arguments are quoted with single or double quotes like `echo "Hello World"` or `echo 'Hello World'`. If we use cmd.split(), we will get a list of 3 tokens `['echo', '"Hello', 'World"']` instead of 2 tokens `['echo', 'Hello World']`. From ef29f31a9bd72e1c1d902ff924473833369a3496 Mon Sep 17 00:00:00 2001 From: Ezio Date: Tue, 12 Jul 2016 09:33:12 +0800 Subject: [PATCH 1133/1469] =?UTF-8?q?20160712-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ntrol your DigitalOcean cloud instances.md | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 sources/tech/20160708 Using Vagrant to control your DigitalOcean cloud instances.md diff --git a/sources/tech/20160708 Using Vagrant to control your DigitalOcean cloud instances.md b/sources/tech/20160708 Using Vagrant to control your DigitalOcean cloud instances.md new file mode 100644 index 0000000000..e24e381b38 --- /dev/null +++ b/sources/tech/20160708 Using Vagrant to control your DigitalOcean cloud instances.md @@ -0,0 +1,70 @@ +Using Vagrant to control your DigitalOcean cloud instances +========================================================= + +![](https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/fedora-vagrant-do-945x400.jpg) + +[Vagrant][1] is an application to create and support virtual development environments using virtual machines. Fedora has [official support for Vagrant][2] with libvirt on your local system. [DigitalOcean][3] is a cloud provider that provides a one-click deployment of a Fedora Cloud instance to an all-SSD server in under a minute. During the [recent Cloud FAD][4] in Raleigh, the Fedora Cloud team packaged a new plugin for Vagrant which enables Fedora users to keep up cloud instances in DigitalOcean using local Vagrantfiles. + +### How to use this plugin + +First step is to install the package in the command line. + +``` +$ sudo dnf install -y vagrant-digitalocean +``` + +After installing the plugin, the next task is to create the local Vagrantfile. An example is provided below. + +``` +$ mkdir digitalocean +$ cd digitalocean +$ cat Vagrantfile +Vagrant.configure('2') do |config| + config.vm.hostname = 'dropletname.kushaldas.in' + # Alternatively, use provider.name below to set the Droplet name. config.vm.hostname takes precedence. + + config.vm.provider :digital_ocean do |provider, override| + override.ssh.private_key_path = '/home/kdas/.ssh/id_rsa' + override.vm.box = 'digital_ocean' + override.vm.box_url = "https://github.com/devopsgroup-io/vagrant- digitalocean/raw/master/box/digital_ocean.box" + + provider.token = 'Your AUTH Token' + provider.image = 'fedora-23-x64' + provider.region = 'nyc2' + provider.size = '512mb' + provider.ssh_key_name = 'Kushal' + end +end +``` + +### Notes about Vagrant DigitalOcean plugin + +A few points to remember about the SSH key naming scheme: if you already have the key uploaded to DigitalOcean, make sure that the provider.ssh_key_name matches the name of the existing key in their server. The provider.image details are found at the [DigitalOcean documentation][5]. The AUTH token is created on the control panel within the Apps & API section. + +You can then get the instance up with the following command. + +``` +$ vagrant up --provider=digital_ocean +``` + +This command will fire up the instance in the DigitalOcean server. You can then SSH into the box by using vagrant ssh command. Run vagrant destroy to destroy the instance. + + + + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/using-vagrant-digitalocean-cloud/ + +作者:[Kushal Das][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://kushal.id.fedoraproject.org/ +[1]: https://www.vagrantup.com/ +[2]: https://fedoramagazine.org/running-vagrant-fedora-22/ +[3]: https://www.digitalocean.com/ +[4]: https://communityblog.fedoraproject.org/fedora-cloud-fad-2016/ +[5]: https://developers.digitalocean.com/documentation/v2/#create-a-new-droplet From 9dabbb29de61bae3271d4df2900333a9b57df6c1 Mon Sep 17 00:00:00 2001 From: zpl Date: Tue, 12 Jul 2016 11:15:30 +0800 Subject: [PATCH 1134/1469] [translated] 20160624 Industrial SBC builds on Raspberry Pi Compute Module.md --- ...C builds on Raspberry Pi Compute Module.md | 72 ------------------- ...C builds on Raspberry Pi Compute Module.md | 71 ++++++++++++++++++ 2 files changed, 71 insertions(+), 72 deletions(-) delete mode 100644 sources/tech/20160624 Industrial SBC builds on Raspberry Pi Compute Module.md create mode 100644 translated/tech/20160624 Industrial SBC builds on Raspberry Pi Compute Module.md diff --git a/sources/tech/20160624 Industrial SBC builds on Raspberry Pi Compute Module.md b/sources/tech/20160624 Industrial SBC builds on Raspberry Pi Compute Module.md deleted file mode 100644 index 9bc9a894ca..0000000000 --- a/sources/tech/20160624 Industrial SBC builds on Raspberry Pi Compute Module.md +++ /dev/null @@ -1,72 +0,0 @@ -zpl1025 -Industrial SBC builds on Raspberry Pi Compute Module -===================================================== - -![](http://hackerboards.com/files/embeddedmicro_mypi-thm.jpg) - -On Kickstarter, a “MyPi” industrial SBC using the RPi Compute Module offers a mini-PCIe slot, serial port, wide-range power, and modular expansion. - -You might wonder why in 2016 someone would introduce a sandwich-style single board computer built around the aging, ARM11 based COM version of the original Raspberry Pi, the [Raspberry Pi Compute Module][1]. First off, there are still plenty of industrial applications that don’t need much CPU horsepower, and second, the Compute Module is still the only COM based on Raspberry Pi hardware, although the cheaper, somewhat COM-like [Raspberry Pi Zero][2], which has the same 700MHz processor, comes close. - -![](http://hackerboards.com/files/embeddedmicro_mypi-sm.jpg) - -![](http://hackerboards.com/files/embeddedmicro_mypi_encl-sm.jpg) - ->MyPi with COM and I/O add-ons (left), and in its optional industrial enclosure - -In addition, Embedded Micro Technology says its SBC is also designed to support a swap-in for a promised Raspberry Pi Compute Module upgrade built around the Raspberry Pi 3’s quad-core, Cortex-A53 Broadcom BCM2837 SoC. Since this product could arrive any week now, it’s unclear how that all sorts out for Kickstarter backers. Still, it’s nice to know you’re somewhat futureproof, even if you have to pay for the upgrade. - -The MyPi is not the only new commercial embedded device based on the Raspberry Pi Compute Module. Pigeon Computers launched a [Pigeon RB100][3] industrial automation controller based on the COM in May. Most such devices arrived in 2014, however, shortly after the COM arrived, including the [Techbase Modberry][4]. - -The MyPi is over a third of the way toward its $21,696 funding goal with 30 days to go. An early bird package starts at $119, with shipments in September. Other kit options include a $187 version that includes the $30 Raspberry Pi Compute Module, as well as various cables. Kits are also available with add-on boards and an industrial enclosure. - -![](http://hackerboards.com/files/embeddedmicro_mypi_baseboard-sm.jpg) - -![](http://hackerboards.com/files/embeddedmicro_mypi_detail-sm.jpg) - ->MyPi baseboard without COM or add-ons (left) and its port details - -The Raspberry Pi Compute Module starts the MyPi off with the Broadcom BCM2835 SoC, 512MB RAM, and 4GB eMMC flash. The MyPi adds to this with a microSD card slot, an HDMI port, two USB 2.0 ports, a 10/100 Ethernet port, and a similarly coastline RS232 port (via USB). - -![](http://hackerboards.com/files/embeddedmicro_mypi_angle1-sm.jpg) - -![](http://hackerboards.com/files/embeddedmicro_mypi_angle2.jpg) - ->Two views of the MyPi board with RPi and mini-PCIe modules installed - -The MyPi is further equipped with a mini-PCIe socket, which is said to be “USB only and intended for use of modems available in the mPCIe form factor.” A SIM card slot is also available. Dual standard Raspberry Pi camera connectors are onboard along with an audio out interface, a battery-backed RTC, and LEDs. The SBC has a wide-range, 9-23V DC input. - -The MyPi is designed for Raspberry Pi hackers who have stacked so many HAT add-on boards, they can no longer work with them effectively or stuff them inside and industrial enclosure, says Embedded Micro. The MyPi supports HATs, but also offers the company’s own “ASIO” (Application Specific I/O) add-on modules, which route their I/O back to the carrier board, which, in turn, connects it to the 8-pin, green, Phoenix-style, industrial I/O connector (labeled “ASIO Out”) on the board’s edge, as illustrated in the diagram below. - -![](http://hackerboards.com/files/embeddedmicro_mypi_io-sm.jpg) ->MyPi’s modular expansion interface - -As the Kickstarter page explains it: “Rather than have a plug in HAT card with IO signal connectors poking out on all sides, instead we take these same IO signals back down a second output connector which is directly connected to the green industrial connector.” Additionally, “by simply using extended length interface pins on the card (raising it up) you can expand the IO set further — all without using any cable assemblies!” says Embedded Micro. - -![](http://hackerboards.com/files/embeddedmicro_mypi_with_iocards-sm.jpg) ->MyPi and its optional I/O add-on cards - -The company offers a line of hardened ASIO plug-in cards for the MyPi, as shown above. These initially include CAN-Bus, 4-20mA transducer signals, RS485, Narrow Band RF, and more. - -### Further information - -The MyPi is available on Kickstarter starting at a 79-Pound ($119) early bird package (without the Raspberry Pi Compute Module) through July 23, with shipments due in September. More information may be found on the [MyPi Kickstarter page][5] and the [Embedded Micro Technology website][6]. - - --------------------------------------------------------------------------------- - -via: http://hackerboards.com/industrial-sbc-builds-on-rpi-compute-module/ - -作者:[Eric Brown][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://hackerboards.com/industrial-sbc-builds-on-rpi-compute-module/ -[1]: http://hackerboards.com/raspberry-pi-morphs-into-30-dollar-com/ -[2]: http://hackerboards.com/pi-zero-tweak-adds-camera-connector-keeps-5-price/ -[3]: http://hackerboards.com/automation-controller-runs-linux-on-raspberry-pi-com/ -[4]: http://hackerboards.com/automation-controller-taps-raspberry-pi-compute-module/ -[5]: https://www.kickstarter.com/projects/410598173/mypi-industrial-strength-raspberry-pi-for-iot-proj -[6]: http://www.embeddedpi.com/ diff --git a/translated/tech/20160624 Industrial SBC builds on Raspberry Pi Compute Module.md b/translated/tech/20160624 Industrial SBC builds on Raspberry Pi Compute Module.md new file mode 100644 index 0000000000..361dc746ee --- /dev/null +++ b/translated/tech/20160624 Industrial SBC builds on Raspberry Pi Compute Module.md @@ -0,0 +1,71 @@ +用树莓派计算模块搭建的工业单板计算机 +===================================================== + +![](http://hackerboards.com/files/embeddedmicro_mypi-thm.jpg) + +在 Kickstarter 众筹网站上,一个叫“MyPi”的项目用 RPi 计算模块制作了一款 SBC(Single Board Computer 单板计算机),提供 mini-PCIe 插槽,串口,宽范围输入电源,以及模块扩展等功能。 + +你也许觉得奇怪,都 2016 年了,为什么还会有人发布这样一款长得有点像三明治,用过时的基于 ARM11 的原版树莓派 COM(Compuer on Module,模块化计算机)版本,[树莓派计算模块][1],构建的单板计算机。首先,目前仍然有大量工业应用不需要太多 CPU 处理能力,第二,树莓派计算模块仍是目前仅有的基于树莓派硬件的 COM,虽然更便宜,有点像 COM 并采用 700MHz 处理器的 [零号树莓派][2],快要发布了。 + +![](http://hackerboards.com/files/embeddedmicro_mypi-sm.jpg) + +![](http://hackerboards.com/files/embeddedmicro_mypi_encl-sm.jpg) + +>安装了 COM 和 I/O 组件的 MyPi(左),装入了可选的工业外壳中 + +另外,Embedded Micro Technology 还表示它的 SBC 还设计成支持和承诺的树莓派计算模块升级版互换,采用树莓派 3 的四核,Cortex-A53 博通 BCM2837 SoC。因为这个产品最近很快就会到货,不确定他们怎么能及时为 Kickstarter 赞助者处理好这一切。不过,以后能支持也挺不错,就算要为这个升级付费也可以接受。 + +MyPi 并不是唯一一款新的基于树莓派计算模块的商业嵌入式设备。Pigeon Computers 在五月份启动了 [Pigeon RB100][3] 的项目,是一个基于 COM 的工业自动化控制器。不过,包括 [Techbase Modberry][4] 在内的这一类设备大都出现在 2014 年 COM 发布之后的一小段时间内。 + +MyPi 的目标是 30 天内筹集 $21,696,目前已经实现了三分之一。早期参与包的价格 $119 起,九月份发货。其他选项有 $187 版本,里面包含了价值 $30 的树莓派计算模块,以及各种线缆。套件里还有各种插件板以及工业外壳可选。 + +![](http://hackerboards.com/files/embeddedmicro_mypi_baseboard-sm.jpg) + +![](http://hackerboards.com/files/embeddedmicro_mypi_detail-sm.jpg) + +>不带 COM 和插件板的 MyPi 主板(左)以及它的接口定义 + +树莓派计算模块能给 MyPi 带来博通 BCM2835 Soc,512MB 内存,以及 4GB eMMC 存储空间。MyPi 主板扩展了一个 microSD 卡槽,一个 HDMI 接口,两个 USB 2.0 接口,一个 10/100 以太网口,还有一个类似网口的 RS232 端口(通过 USB)。 + +![](http://hackerboards.com/files/embeddedmicro_mypi_angle1-sm.jpg) + +![](http://hackerboards.com/files/embeddedmicro_mypi_angle2.jpg) + +>插上树莓派计算模块和 mini-PCIe 模块的 MyPi 的两个视角 + +MyPi 还将配备一个 mini-PCIe 插槽,据说“只支持 USB,以及只适用 mPCIe 形式的调制解调器”。还带有一个 SIM 卡插槽。板上还有双标准的树莓派摄像头接口,一个音频输出接口,自带备用电池的 RTC,LED 灯。还支持宽范围的 9-23V 直流输入。 + +Embedded Micro 表示,MyPi 是为那些树莓派爱好者们设计的,他们堆积了太多 HAT 外接板,已经不能有效地工作了,或者不能很好地装入工业外壳里。MyPi 支持 HAT,另外还提供了公司自己定义的“ASIO”(特定应用接口)插件模块,它会将自己的 I/O 扩展到主板上,主板再将它们连到主板边上的 8 脚,绿色,工业 I/O 连接器(标记了“ASIO Out”)上,在下面图片里有描述。 + +![](http://hackerboards.com/files/embeddedmicro_mypi_io-sm.jpg) +>MyPi 的模块扩展接口 + +就像 Kickstarter 页面里描述的:“比起在板边插满带 IO 信号接头的 HAT 板,我们有意将同样的 IO 信号接到另一个接头,它直接接到绿色的工业接头上。”另外,“通过简单地延长卡上的插脚长度(抬高),你将来可以直接扩展 IO 集 - 这些都不需要任何排线!”Embedded Micro 表示。 + +![](http://hackerboards.com/files/embeddedmicro_mypi_with_iocards-sm.jpg) +>MyPi 和它的可选 I/O 插件板卡 + +公司为 MyPi 提供了一系列可靠的 ASIO 插件板,像上面展示的。这些一开始会包括 CAN 总线,4-20mA 传感器信号,RS485,窄带 RF,等等。 + +### 更多信息 + +MyPi 在 Kickstarter 上提供了 7 月 23 日到期的 79 英镑($119)早期参与包(不包括树莓派计算模块),预计九月份发货。更多信息请查看 [Kickstarter 上 MyPi 的页面][5] 以及 [Embedded Micro Technology 官网][6]。 + + +-------------------------------------------------------------------------------- + +via: http://hackerboards.com/industrial-sbc-builds-on-rpi-compute-module/ + +作者:[Eric Brown][a] +译者:[zpl1025](https://github.com/zpl1025) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://hackerboards.com/industrial-sbc-builds-on-rpi-compute-module/ +[1]: http://hackerboards.com/raspberry-pi-morphs-into-30-dollar-com/ +[2]: http://hackerboards.com/pi-zero-tweak-adds-camera-connector-keeps-5-price/ +[3]: http://hackerboards.com/automation-controller-runs-linux-on-raspberry-pi-com/ +[4]: http://hackerboards.com/automation-controller-taps-raspberry-pi-compute-module/ +[5]: https://www.kickstarter.com/projects/410598173/mypi-industrial-strength-raspberry-pi-for-iot-proj +[6]: http://www.embeddedpi.com/ From d20392fb56786226dfbc9d77ad52ab3bf19c4865 Mon Sep 17 00:00:00 2001 From: Ezio Date: Tue, 12 Jul 2016 14:20:28 +0800 Subject: [PATCH 1135/1469] =?UTF-8?q?20160712-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...160309 Let’s Build A Web Server. Part 1.md | 150 ++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 translated/tech/20160309 Let’s Build A Web Server. Part 1.md diff --git a/translated/tech/20160309 Let’s Build A Web Server. Part 1.md b/translated/tech/20160309 Let’s Build A Web Server. Part 1.md new file mode 100644 index 0000000000..4c8048786d --- /dev/null +++ b/translated/tech/20160309 Let’s Build A Web Server. Part 1.md @@ -0,0 +1,150 @@ +Let’s Build A Web Server. Part 1. +===================================== + +Out for a walk one day, a woman came across a construction site and saw three men working. She asked the first man, “What are you doing?” Annoyed by the question, the first man barked, “Can’t you see that I’m laying bricks?” Not satisfied with the answer, she asked the second man what he was doing. The second man answered, “I’m building a brick wall.” Then, turning his attention to the first man, he said, “Hey, you just passed the end of the wall. You need to take off that last brick.” Again not satisfied with the answer, she asked the third man what he was doing. And the man said to her while looking up in the sky, “I am building the biggest cathedral this world has ever known.” While he was standing there and looking up in the sky the other two men started arguing about the errant brick. The man turned to the first two men and said, “Hey guys, don’t worry about that brick. It’s an inside wall, it will get plastered over and no one will ever see that brick. Just move on to another layer.”1 + +The moral of the story is that when you know the whole system and understand how different pieces fit together (bricks, walls, cathedral), you can identify and fix problems faster (errant brick). + +What does it have to do with creating your own Web server from scratch? + +I believe to become a better developer you MUST get a better understanding of the underlying software systems you use on a daily basis and that includes programming languages, compilers and interpreters, databases and operating systems, web servers and web frameworks. And, to get a better and deeper understanding of those systems you MUST re-build them from scratch, brick by brick, wall by wall. + +Confucius put it this way: + +>“I hear and I forget.” + +![](https://ruslanspivak.com/lsbasi-part4/LSBAWS_confucius_hear.png) + +>“I see and I remember.” + +![](https://ruslanspivak.com/lsbasi-part4/LSBAWS_confucius_see.png) + +>“I do and I understand.” + +![](https://ruslanspivak.com/lsbasi-part4/LSBAWS_confucius_do.png) + +I hope at this point you’re convinced that it’s a good idea to start re-building different software systems to learn how they work. + +In this three-part series I will show you how to build your own basic Web server. Let’s get started. + +First things first, what is a Web server? + +![](https://ruslanspivak.com/lsbaws-part1/LSBAWS_HTTP_request_response.png) + +In a nutshell it’s a networking server that sits on a physical server (oops, a server on a server) and waits for a client to send a request. When it receives a request, it generates a response and sends it back to the client. The communication between a client and a server happens using HTTP protocol. A client can be your browser or any other software that speaks HTTP. + +What would a very simple implementation of a Web server look like? Here is my take on it. The example is in Python but even if you don’t know Python (it’s a very easy language to pick up, try it!) you still should be able to understand concepts from the code and explanations below: + +``` +import socket + +HOST, PORT = '', 8888 + +listen_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +listen_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +listen_socket.bind((HOST, PORT)) +listen_socket.listen(1) +print 'Serving HTTP on port %s ...' % PORT +while True: + client_connection, client_address = listen_socket.accept() + request = client_connection.recv(1024) + print request + + http_response = """\ +HTTP/1.1 200 OK + +Hello, World! +""" + client_connection.sendall(http_response) + client_connection.close() +``` + +Save the above code as webserver1.py or download it directly from GitHub and run it on the command line like this + +``` +$ python webserver1.py +Serving HTTP on port 8888 … +``` + +Now type in the following URL in your Web browser’s address bar http://localhost:8888/hello, hit Enter, and see magic in action. You should see “Hello, World!” displayed in your browser like this: + +![](https://ruslanspivak.com/lsbaws-part1/browser_hello_world.png) + +Just do it, seriously. I will wait for you while you’re testing it. + +Done? Great. Now let’s discuss how it all actually works. + +First let’s start with the Web address you’ve entered. It’s called an URL and here is its basic structure: + +![](https://ruslanspivak.com/lsbaws-part1/LSBAWS_URL_Web_address.png) + +This is how you tell your browser the address of the Web server it needs to find and connect to and the page (path) on the server to fetch for you. Before your browser can send a HTTP request though, it first needs to establish a TCP connection with the Web server. Then it sends an HTTP request over the TCP connection to the server and waits for the server to send an HTTP response back. And when your browser receives the response it displays it, in this case it displays “Hello, World!” + +Let’s explore in more detail how the client and the server establish a TCP connection before sending HTTP requests and responses. To do that they both use so-called sockets. Instead of using a browser directly you are going to simulate your browser manually by using telnet on the command line. + +On the same computer you’re running the Web server fire up a telnet session on the command line specifying a host to connect to localhost and the port to connect to 8888 and then press Enter: + +``` +$ telnet localhost 8888 +Trying 127.0.0.1 … +Connected to localhost. +``` + +At this point you’ve established a TCP connection with the server running on your local host and ready to send and receive HTTP messages. In the picture below you can see a standard procedure a server has to go through to be able to accept new TCP connections. + +![](https://ruslanspivak.com/lsbaws-part1/LSBAWS_socket.png) + +In the same telnet session type GET /hello HTTP/1.1 and hit Enter: + +``` +$ telnet localhost 8888 +Trying 127.0.0.1 … +Connected to localhost. +GET /hello HTTP/1.1 + +HTTP/1.1 200 OK +Hello, World! +``` + +You’ve just manually simulated your browser! You sent an HTTP request and got an HTTP response back. This is the basic structure of an HTTP request: + +![](https://ruslanspivak.com/lsbaws-part1/LSBAWS_HTTP_request_anatomy.png) + +The HTTP request consists of the line indicating the HTTP method (GET, because we are asking our server to return us something), the path /hello that indicates a “page” on the server we want and the protocol version. + +For simplicity’s sake our Web server at this point completely ignores the above request line. You could just as well type in any garbage instead of “GET /hello HTTP/1.1” and you would still get back a “Hello, World!” response. + +Once you’ve typed the request line and hit Enter the client sends the request to the server, the server reads the request line, prints it and returns the proper HTTP response. + +Here is the HTTP response that the server sends back to your client (telnet in this case): + +![](https://ruslanspivak.com/lsbaws-part1/LSBAWS_HTTP_response_anatomy.png) + +Let’s dissect it. The response consists of a status line HTTP/1.1 200 OK, followed by a required empty line, and then the HTTP response body. + +The response status line HTTP/1.1 200 OK consists of the HTTP Version, the HTTP status code and the HTTP status code reason phrase OK. When the browser gets the response, it displays the body of the response and that’s why you see “Hello, World!” in your browser. + +And that’s the basic model of how a Web server works. To sum it up: The Web server creates a listening socket and starts accepting new connections in a loop. The client initiates a TCP connection and, after successfully establishing it, the client sends an HTTP request to the server and the server responds with an HTTP response that gets displayed to the user. To establish a TCP connection both clients and servers use sockets. + +Now you have a very basic working Web server that you can test with your browser or some other HTTP client. As you’ve seen and hopefully tried, you can also be a human HTTP client too, by using telnet and typing HTTP requests manually. + +Here’s a question for you: “How do you run a Django application, Flask application, and Pyramid application under your freshly minted Web server without making a single change to the server to accommodate all those different Web frameworks?” + +I will show you exactly how in Part 2 of the series. Stay tuned. + +BTW, I’m writing a book “Let’s Build A Web Server: First Steps” that explains how to write a basic web server from scratch and goes into more detail on topics I just covered. Subscribe to the mailing list to get the latest updates about the book and the release date. + +-------------------------------------------------------------------------------- + +via: https://ruslanspivak.com/lsbaws-part1/ + +作者:[Ruslan][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://linkedin.com/in/ruslanspivak/ + + + From 2359828cf75142ed6ff3dd37282e21db733f5d40 Mon Sep 17 00:00:00 2001 From: Ezio Date: Tue, 12 Jul 2016 14:28:24 +0800 Subject: [PATCH 1136/1469] =?UTF-8?q?20160712-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...160406 Let’s Build A Web Server. Part 2.md | 427 ++++++++++++++++++ 1 file changed, 427 insertions(+) create mode 100644 translated/tech/20160406 Let’s Build A Web Server. Part 2.md diff --git a/translated/tech/20160406 Let’s Build A Web Server. Part 2.md b/translated/tech/20160406 Let’s Build A Web Server. Part 2.md new file mode 100644 index 0000000000..482352ac9a --- /dev/null +++ b/translated/tech/20160406 Let’s Build A Web Server. Part 2.md @@ -0,0 +1,427 @@ +Let’s Build A Web Server. Part 2. +=================================== + +Remember, in Part 1 I asked you a question: “How do you run a Django application, Flask application, and Pyramid application under your freshly minted Web server without making a single change to the server to accommodate all those different Web frameworks?” Read on to find out the answer. + +In the past, your choice of a Python Web framework would limit your choice of usable Web servers, and vice versa. If the framework and the server were designed to work together, then you were okay: + +![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_before_wsgi.png) + +But you could have been faced (and maybe you were) with the following problem when trying to combine a server and a framework that weren’t designed to work together: + +![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_after_wsgi.png) + +Basically you had to use what worked together and not what you might have wanted to use. + +So, how do you then make sure that you can run your Web server with multiple Web frameworks without making code changes either to the Web server or to the Web frameworks? And the answer to that problem became the Python Web Server Gateway Interface (or WSGI for short, pronounced “wizgy”). + +![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_wsgi_idea.png) + +WSGI allowed developers to separate choice of a Web framework from choice of a Web server. Now you can actually mix and match Web servers and Web frameworks and choose a pairing that suits your needs. You can run Django, Flask, or Pyramid, for example, with Gunicorn or Nginx/uWSGI or Waitress. Real mix and match, thanks to the WSGI support in both servers and frameworks: + +![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_wsgi_interop.png) + +So, WSGI is the answer to the question I asked you in Part 1 and repeated at the beginning of this article. Your Web server must implement the server portion of a WSGI interface and all modern Python Web Frameworks already implement the framework side of the WSGI interface, which allows you to use them with your Web server without ever modifying your server’s code to accommodate a particular Web framework. + +Now you know that WSGI support by Web servers and Web frameworks allows you to choose a pairing that suits you, but it is also beneficial to server and framework developers because they can focus on their preferred area of specialization and not step on each other’s toes. Other languages have similar interfaces too: Java, for example, has Servlet API and Ruby has Rack. + +It’s all good, but I bet you are saying: “Show me the code!” Okay, take a look at this pretty minimalistic WSGI server implementation: + +``` +# Tested with Python 2.7.9, Linux & Mac OS X +import socket +import StringIO +import sys + + +class WSGIServer(object): + + address_family = socket.AF_INET + socket_type = socket.SOCK_STREAM + request_queue_size = 1 + + def __init__(self, server_address): + # Create a listening socket + self.listen_socket = listen_socket = socket.socket( + self.address_family, + self.socket_type + ) + # Allow to reuse the same address + listen_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + # Bind + listen_socket.bind(server_address) + # Activate + listen_socket.listen(self.request_queue_size) + # Get server host name and port + host, port = self.listen_socket.getsockname()[:2] + self.server_name = socket.getfqdn(host) + self.server_port = port + # Return headers set by Web framework/Web application + self.headers_set = [] + + def set_app(self, application): + self.application = application + + def serve_forever(self): + listen_socket = self.listen_socket + while True: + # New client connection + self.client_connection, client_address = listen_socket.accept() + # Handle one request and close the client connection. Then + # loop over to wait for another client connection + self.handle_one_request() + + def handle_one_request(self): + self.request_data = request_data = self.client_connection.recv(1024) + # Print formatted request data a la 'curl -v' + print(''.join( + '< {line}\n'.format(line=line) + for line in request_data.splitlines() + )) + + self.parse_request(request_data) + + # Construct environment dictionary using request data + env = self.get_environ() + + # It's time to call our application callable and get + # back a result that will become HTTP response body + result = self.application(env, self.start_response) + + # Construct a response and send it back to the client + self.finish_response(result) + + def parse_request(self, text): + request_line = text.splitlines()[0] + request_line = request_line.rstrip('\r\n') + # Break down the request line into components + (self.request_method, # GET + self.path, # /hello + self.request_version # HTTP/1.1 + ) = request_line.split() + + def get_environ(self): + env = {} + # The following code snippet does not follow PEP8 conventions + # but it's formatted the way it is for demonstration purposes + # to emphasize the required variables and their values + # + # Required WSGI variables + env['wsgi.version'] = (1, 0) + env['wsgi.url_scheme'] = 'http' + env['wsgi.input'] = StringIO.StringIO(self.request_data) + env['wsgi.errors'] = sys.stderr + env['wsgi.multithread'] = False + env['wsgi.multiprocess'] = False + env['wsgi.run_once'] = False + # Required CGI variables + env['REQUEST_METHOD'] = self.request_method # GET + env['PATH_INFO'] = self.path # /hello + env['SERVER_NAME'] = self.server_name # localhost + env['SERVER_PORT'] = str(self.server_port) # 8888 + return env + + def start_response(self, status, response_headers, exc_info=None): + # Add necessary server headers + server_headers = [ + ('Date', 'Tue, 31 Mar 2015 12:54:48 GMT'), + ('Server', 'WSGIServer 0.2'), + ] + self.headers_set = [status, response_headers + server_headers] + # To adhere to WSGI specification the start_response must return + # a 'write' callable. We simplicity's sake we'll ignore that detail + # for now. + # return self.finish_response + + def finish_response(self, result): + try: + status, response_headers = self.headers_set + response = 'HTTP/1.1 {status}\r\n'.format(status=status) + for header in response_headers: + response += '{0}: {1}\r\n'.format(*header) + response += '\r\n' + for data in result: + response += data + # Print formatted response data a la 'curl -v' + print(''.join( + '> {line}\n'.format(line=line) + for line in response.splitlines() + )) + self.client_connection.sendall(response) + finally: + self.client_connection.close() + + +SERVER_ADDRESS = (HOST, PORT) = '', 8888 + + +def make_server(server_address, application): + server = WSGIServer(server_address) + server.set_app(application) + return server + + +if __name__ == '__main__': + if len(sys.argv) < 2: + sys.exit('Provide a WSGI application object as module:callable') + app_path = sys.argv[1] + module, application = app_path.split(':') + module = __import__(module) + application = getattr(module, application) + httpd = make_server(SERVER_ADDRESS, application) + print('WSGIServer: Serving HTTP on port {port} ...\n'.format(port=PORT)) + httpd.serve_forever() +``` + +It’s definitely bigger than the server code in Part 1, but it’s also small enough (just under 150 lines) for you to understand without getting bogged down in details. The above server also does more - it can run your basic Web application written with your beloved Web framework, be it Pyramid, Flask, Django, or some other Python WSGI framework. + +Don’t believe me? Try it and see for yourself. Save the above code as webserver2.py or download it directly from GitHub. If you try to run it without any parameters it’s going to complain and exit. + +``` +$ python webserver2.py +Provide a WSGI application object as module:callable +``` + +It really wants to serve your Web application and that’s where the fun begins. To run the server the only thing you need installed is Python. But to run applications written with Pyramid, Flask, and Django you need to install those frameworks first. Let’s install all three of them. My preferred method is by using virtualenv. Just follow the steps below to create and activate a virtual environment and then install all three Web frameworks. + +``` +$ [sudo] pip install virtualenv +$ mkdir ~/envs +$ virtualenv ~/envs/lsbaws/ +$ cd ~/envs/lsbaws/ +$ ls +bin include lib +$ source bin/activate +(lsbaws) $ pip install pyramid +(lsbaws) $ pip install flask +(lsbaws) $ pip install django +``` + +At this point you need to create a Web application. Let’s start with Pyramid first. Save the following code as pyramidapp.py to the same directory where you saved webserver2.py or download the file directly from GitHub: + +``` +from pyramid.config import Configurator +from pyramid.response import Response + + +def hello_world(request): + return Response( + 'Hello world from Pyramid!\n', + content_type='text/plain', + ) + +config = Configurator() +config.add_route('hello', '/hello') +config.add_view(hello_world, route_name='hello') +app = config.make_wsgi_app() +``` + +Now you’re ready to serve your Pyramid application with your very own Web server: + +``` +(lsbaws) $ python webserver2.py pyramidapp:app +WSGIServer: Serving HTTP on port 8888 ... +``` + +You just told your server to load the ‘app’ callable from the python module ‘pyramidapp’ Your server is now ready to take requests and forward them to your Pyramid application. The application only handles one route now: the /hello route. Type http://localhost:8888/hello address into your browser, press Enter, and observe the result: + +![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_browser_pyramid.png) + +You can also test the server on the command line using the ‘curl’ utility: + +``` +$ curl -v http://localhost:8888/hello +... +``` + +Check what the server and curl prints to standard output. + +Now onto Flask. Let’s follow the same steps. + +``` +from flask import Flask +from flask import Response +flask_app = Flask('flaskapp') + + +@flask_app.route('/hello') +def hello_world(): + return Response( + 'Hello world from Flask!\n', + mimetype='text/plain' + ) + +app = flask_app.wsgi_app +``` + +Save the above code as flaskapp.py or download it from GitHub and run the server as: + +``` +(lsbaws) $ python webserver2.py flaskapp:app +WSGIServer: Serving HTTP on port 8888 ... +``` + +Now type in the http://localhost:8888/hello into your browser and press Enter: + +![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_browser_flask.png) + +Again, try ‘curl’ and see for yourself that the server returns a message generated by the Flask application: + +``` +$ curl -v http://localhost:8888/hello +... +``` + +Can the server also handle a Django application? Try it out! It’s a little bit more involved, though, and I would recommend cloning the whole repo and use djangoapp.py, which is part of the GitHub repository. Here is the source code which basically adds the Django ‘helloworld’ project (pre-created using Django’s django-admin.py startproject command) to the current Python path and then imports the project’s WSGI application. + +``` +import sys +sys.path.insert(0, './helloworld') +from helloworld import wsgi + + +app = wsgi.application +``` + +Save the above code as djangoapp.py and run the Django application with your Web server: + +``` +(lsbaws) $ python webserver2.py djangoapp:app +WSGIServer: Serving HTTP on port 8888 ... +``` + +Type in the following address and press Enter: + +![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_browser_django.png) + +And as you’ve already done a couple of times before, you can test it on the command line, too, and confirm that it’s the Django application that handles your requests this time around: + +``` +$ curl -v http://localhost:8888/hello +... +``` + +Did you try it? Did you make sure the server works with those three frameworks? If not, then please do so. Reading is important, but this series is about rebuilding and that means you need to get your hands dirty. Go and try it. I will wait for you, don’t worry. No seriously, you must try it and, better yet, retype everything yourself and make sure that it works as expected. + +Okay, you’ve experienced the power of WSGI: it allows you to mix and match your Web servers and Web frameworks. WSGI provides a minimal interface between Python Web servers and Python Web Frameworks. It’s very simple and it’s easy to implement on both the server and the framework side. The following code snippet shows the server and the framework side of the interface: + +``` +def run_application(application): + """Server code.""" + # This is where an application/framework stores + # an HTTP status and HTTP response headers for the server + # to transmit to the client + headers_set = [] + # Environment dictionary with WSGI/CGI variables + environ = {} + + def start_response(status, response_headers, exc_info=None): + headers_set[:] = [status, response_headers] + + # Server invokes the ‘application' callable and gets back the + # response body + result = application(environ, start_response) + # Server builds an HTTP response and transmits it to the client + … + +def app(environ, start_response): + """A barebones WSGI app.""" + start_response('200 OK', [('Content-Type', 'text/plain')]) + return ['Hello world!'] + +run_application(app) +``` + +Here is how it works: + +1. The framework provides an ‘application’ callable (The WSGI specification doesn’t prescribe how that should be implemented) +2. The server invokes the ‘application’ callable for each request it receives from an HTTP client. It passes a dictionary ‘environ’ containing WSGI/CGI variables and a ‘start_response’ callable as arguments to the ‘application’ callable. +3. The framework/application generates an HTTP status and HTTP response headers and passes them to the ‘start_response’ callable for the server to store them. The framework/application also returns a response body. +4. The server combines the status, the response headers, and the response body into an HTTP response and transmits it to the client (This step is not part of the specification but it’s the next logical step in the flow and I added it for clarity) + +And here is a visual representation of the interface: + +![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_wsgi_interface.png) + +So far, you’ve seen the Pyramid, Flask, and Django Web applications and you’ve seen the server code that implements the server side of the WSGI specification. You’ve even seen the barebones WSGI application code snippet that doesn’t use any framework. + +The thing is that when you write a Web application using one of those frameworks you work at a higher level and don’t work with WSGI directly, but I know you’re curious about the framework side of the WSGI interface, too because you’re reading this article. So, let’s create a minimalistic WSGI Web application/Web framework without using Pyramid, Flask, or Django and run it with your server: + +``` +def app(environ, start_response): + """A barebones WSGI application. + + This is a starting point for your own Web framework :) + """ + status = '200 OK' + response_headers = [('Content-Type', 'text/plain')] + start_response(status, response_headers) + return ['Hello world from a simple WSGI application!\n'] +``` + +Again, save the above code in wsgiapp.py file or download it from GitHub directly and run the application under your Web server as: + +``` +(lsbaws) $ python webserver2.py wsgiapp:app +WSGIServer: Serving HTTP on port 8888 ... +``` + +Type in the following address and press Enter. This is the result you should see: + +![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_browser_simple_wsgi_app.png) + +You just wrote your very own minimalistic WSGI Web framework while learning about how to create a Web server! Outrageous. + +Now, let’s get back to what the server transmits to the client. Here is the HTTP response the server generates when you call your Pyramid application using an HTTP client: + +![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_http_response.png) + +The response has some familiar parts that you saw in Part 1 but it also has something new. It has, for example, four HTTP headers that you haven’t seen before: Content-Type, Content-Length, Date, and Server. Those are the headers that a response from a Web server generally should have. None of them are strictly required, though. The purpose of the headers is to transmit additional information about the HTTP request/response. + +Now that you know more about the WSGI interface, here is the same HTTP response with some more information about what parts produced it: + +![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_http_response_explanation.png) + +I haven’t said anything about the ‘environ’ dictionary yet, but basically it’s a Python dictionary that must contain certain WSGI and CGI variables prescribed by the WSGI specification. The server takes the values for the dictionary from the HTTP request after parsing the request. This is what the contents of the dictionary look like: + +![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_environ.png) + +A Web framework uses the information from that dictionary to decide which view to use based on the specified route, request method etc., where to read the request body from and where to write errors, if any. + +By now you’ve created your own WSGI Web server and you’ve made Web applications written with different Web frameworks. And, you’ve also created your barebones Web application/Web framework along the way. It’s been a heck of a journey. Let’s recap what your WSGI Web server has to do to serve requests aimed at a WSGI application: + +- First, the server starts and loads an ‘application’ callable provided by your Web framework/application +- Then, the server reads a request +- Then, the server parses it +- Then, it builds an ‘environ’ dictionary using the request data +- Then, it calls the ‘application’ callable with the ‘environ’ dictionary and a ‘start_response’ callable as parameters and gets back a response body. +- Then, the server constructs an HTTP response using the data returned by the call to the ‘application’ object and the status and response headers set by the ‘start_response’ callable. +- And finally, the server transmits the HTTP response back to the client + +![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_server_summary.png) + +That’s about all there is to it. You now have a working WSGI server that can serve basic Web applications written with WSGI compliant Web frameworks like Django, Flask, Pyramid, or your very own WSGI framework. The best part is that the server can be used with multiple Web frameworks without any changes to the server code base. Not bad at all. + +Before you go, here is another question for you to think about, “How do you make your server handle more than one request at a time?” + +Stay tuned and I will show you a way to do that in Part 3. Cheers! + +BTW, I’m writing a book “Let’s Build A Web Server: First Steps” that explains how to write a basic web server from scratch and goes into more detail on topics I just covered. Subscribe to the mailing list to get the latest updates about the book and the release date. + +-------------------------------------------------------------------------------- + +via: https://ruslanspivak.com/lsbaws-part2/ + +作者:[Ruslan][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://github.com/rspivak/ + + + + + + From ec68fcb53855146fdbb507d5ef3b25f551fd6f0c Mon Sep 17 00:00:00 2001 From: Chunyang Wen Date: Tue, 12 Jul 2016 14:30:58 +0800 Subject: [PATCH 1137/1469] Translated: How to Hide Linux Command Line History by Going Incognito (#4174) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * âFinish tranlating awk series part4 * Update Part 4 - How to Use Comparison Operators with Awk in Linux.md * translating: How to Hide Linux Command Line History by Going Incognito * finish translating How to Hide Linux Command Line History by Going Incognito * update translator --- ...Command Line History by Going Incognito.md | 125 ------------------ ...Command Line History by Going Incognito.md | 124 +++++++++++++++++ 2 files changed, 124 insertions(+), 125 deletions(-) delete mode 100644 sources/tech/20160625 How to Hide Linux Command Line History by Going Incognito.md create mode 100644 translated/tech/20160625 How to Hide Linux Command Line History by Going Incognito.md diff --git a/sources/tech/20160625 How to Hide Linux Command Line History by Going Incognito.md b/sources/tech/20160625 How to Hide Linux Command Line History by Going Incognito.md deleted file mode 100644 index 0d5ce6e6e1..0000000000 --- a/sources/tech/20160625 How to Hide Linux Command Line History by Going Incognito.md +++ /dev/null @@ -1,125 +0,0 @@ -chunyang-wen translating -How to Hide Linux Command Line History by Going Incognito -================================================================ - -![](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2016/06/commandline-history-featured.jpg) - -If you’re a Linux command line user, you’ll agree that there are times when you do not want certain commands you run to be recorded in the command line history. There could be many reasons for this. For example, you’re at a certain position in your company, and you have some privileges that you don’t want others to abuse. Or, there are some critical commands that you don’t want to run accidentally while you’re browsing the history list. - -But is there a way to control what goes into the history list and what doesn’t? Or, in other words, can we turn on a web browser-like incognito mode in the Linux command line? The answer is yes, and there are many ways to achieve this, depending on what exactly you want. In this article we will discuss some of the popular solutions available. - -Note: all the commands presented in this article have been tested on Ubuntu. - -### Different ways available - -The first two ways we’ll describe here have already been covered in [one of our previous articles][1]. If you are already aware of them, you can skip over these. However, if you aren’t aware, you’re advised to go through them carefully. - -#### 1. Insert space before command - -Yes, you read it correctly. Insert a space in the beginning of a command, and it will be ignored by the shell, meaning the command won’t be recorded in history. However, there’s a dependency – the said solution will only work if the HISTCONTROL environment variable is set to “ignorespace” or “ignoreboth,” which is by default in most cases. - -So, a command like the following: - -``` -[space]echo "this is a top secret" -``` - -Won’t appear in the history if you’ve already done this command: - -``` -export HISTCONTROL = ignorespace -``` - -The below screenshot is an example of this behavior. - -![](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2016/06/commandline-history-bash-command-space.png) - -The fourth “echo” command was not recorded in the history as it was run with a space in the beginning. - -#### 2. Disable the entire history for the current session - -If you want to disable the entire history for a session, you can easily do that by unsetting the HISTSIZE environment variable before you start with your command line work. To unset the variable run the following command: - -``` -export HISTFILE=0 -``` - -HISTFILE is the number of lines (or commands) that can be stored in the history list for an ongoing bash session. By default, this variable has a set value – for example, 1000 in my case. - -So, the command mentioned above will set the environment variable’s value to zero, and consequently nothing will be stored in the history list until you close the terminal. Keep in mind that you’ll also not be able to see the previously run commands by pressing the up arrow key or running the history command. - -#### 3. Erase the entire history after you’re done - -This can be seen as an alternative to the solution mentioned in the previous section. The only difference is that in this case you run a command AFTER you’re done with all your work. Thh following is the command in question: - -``` -history -cw -``` - -As already mentioned, this will have the same effect as the HISTFILE solution mentioned above. - -#### 4. Turn off history only for the work you do - -While the solutions (2 and 3) described above do the trick, they erase the entire history, something which might be undesired in many situations. There might be cases in which you want to retain the history list up until the point you start your command line work. For situations like these you need to run the following command before starting with your work: - -``` -[space]set +o history -``` - -Note: [space] represents a blank space. - -The above command will disable the history temporarily, meaning whatever you do after running this command will not be recorded in history, although all the stuff executed prior to the above command will be there as it is in the history list. - -To re-enable the history, run the following command: - -``` -[Space]set -o history -``` - -This brings things back to normal again, meaning any command line work done after the above command will show up in the history. - -#### 5. Delete specific commands from history - -Now suppose the history list already contains some commands that you didn’t want to be recorded. What can be done in this case? It’s simple. You can go ahead and remove them. The following is how to accomplish this: - -``` -[space]history | grep "part of command you want to remove" -``` - -The above command will output a list of matching commands (that are there in the history list) with a number [num] preceding each of them. - -Once you’ve identified the command you want to remove, just run the following command to remove that particular entry from the history list: - -``` -history -d [num] -``` - -The following screenshot is an example of this. - -![](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2016/06/commandline-history-delete-specific-commands.png) - -The second ‘echo’ command was removed successfully. - -Alternatively, you can just press the up arrow key to take a walk back through the history list, and once the command of your interest appears on the terminal, just press “Ctrl + U” to totally blank the line, effectively removing it from the list. - -### Conclusion - -There are multiple ways in which you can manipulate the Linux command line history to suit your needs. Keep in mind, however, that it’s usually not a good practice to hide or remove a command from history, although it’s also not wrong, per se, but you should be aware of what you’re doing and what effects it might have. - --------------------------------------------------------------------------------- - -via: https://www.maketecheasier.com/linux-command-line-history-incognito/?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+maketecheasier - -作者:[Himanshu Arora][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.maketecheasier.com/author/himanshu/ -[1]: https://www.maketecheasier.com/command-line-history-linux/ - - - - - diff --git a/translated/tech/20160625 How to Hide Linux Command Line History by Going Incognito.md b/translated/tech/20160625 How to Hide Linux Command Line History by Going Incognito.md new file mode 100644 index 0000000000..9ef701559b --- /dev/null +++ b/translated/tech/20160625 How to Hide Linux Command Line History by Going Incognito.md @@ -0,0 +1,124 @@ +如何进入无痕模式进而隐藏 Linux 的命令行历史 +================================================================ + +![](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2016/06/commandline-history-featured.jpg) + +如果你是 Linux 命令行的用户,你会同意有的时候你不希望某些命令记录在你的命令行历史中。其中原因可能很多。例如,你在公司处于某个职位,你有一些不希望被其它人滥用的特权。亦或者有些特别重要的命令,你不希望在你浏览历史列表时误执行。 + +然而,有方法可以控制哪些命令进入历史列表,哪些不进入吗?或者换句话说,我们在 Linux 终端中可以开启像浏览器一样的无痕模式吗?答案是肯定的,而且根据你想要的具体目标,有很多实现方法。在这篇文章中,我们将讨论一些行之有效的方法。 + +注意:文中出现的所有命令都在 Ubuntu 下测试过。 + +### 不同的可行方法 + +前面两种方法已经在之前[一篇文章][1]中描述了。如果你已经了解,这部分可以略过。然而,如果你不了解,建议仔细阅读。 + +#### 1. 在命令前插入空格 + +是的,没看错。在命令前面插入空格,这条命令会被终端忽略,也就意味着它不会出现在历史记录中。但是这种方法有个前提,只有在你的环境变量 HISTCONTROL 设置为 "ignorespace" 或者 "ignoreboth" 才会起作用。在大多数情况下,这个是默认值。 + +所以,像下面的命令: + +``` +[space]echo "this is a top secret" +``` + +你执行后,它不会出现在历史记录中。 + +``` +export HISTCONTROL = ignorespace +``` + +下面的截图是这种方式的一个例子。 + +![](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2016/06/commandline-history-bash-command-space.png) + +第四个 "echo" 命令因为前面有空格,它没有被记录到历史中。 + +#### 2. 禁用当前会话的所有历史记录 + +如果你想禁用某个会话所有历史,你可以简单地在开始命令行工作前清除环境变量 HISTSIZE 的值。执行下面的命令来清除其值: + +``` +export HISTFILE=0 +``` + +HISTFILE 表示对于 bash 会话其历史中可以保存命令的个数。默认情况,它设置了一个非零值,例如 在我的电脑上,它的值为 1000。 + +所以上面所提到的命令将其值设置为 0,结果就是直到你关闭终端,没有东西会存储在历史记录中。记住同样你也不能通过按向上的箭头按键来执行之前的命令,也不能运行 history 命令。 + +#### 3. 工作结束后清除整个历史 + +这可以看作是前一部分所提方案的另外一种实现。唯一的区别是在你完成所有工作之后执行这个命令。下面是刚讨论的命令: + +``` +history -cw +``` + +刚才已经提到,这个和 HISTFILE 方法有相同效果。 + +#### 4. 只针对你的工作关闭历史记录 + +虽然前面描述的方法(2 和 3)可以实现目的,它们清除整个历史,在很多情况下,有些可能不是我们所期望的。有时候你可能想保存直到你开始命令行工作之间的历史记录。类似的需求需要在你开始工作前执行下述命令: + +``` +[space]set +o history +``` + +备注:[space] 表示空格。 + +上面的命令会临时禁用历史功能,这意味着在这命令之后你执行的所有操作都不会记录到历史中,然而这个命令之前的所有东西都会原样记录在历史列表中。 + +要重新开启历史功能,执行下面的命令: + +``` +[Space]set -o history +``` + +它将环境恢复原状,也就是你完成你的工作,执行上述命令之后的命令都会出现在历史中。 + +#### 5. 从历史记录中删除指定的命令 + +现在假设历史记录中有一些命令你不希望被记录。这种情况下我们怎么办?很简单。直接动手删除它们。通过下面的命令来删除: + +``` +[space]history | grep "part of command you want to remove" +``` + +上面的命令会输出历史记录中匹配的命令,每一条前面会有个数字。 + +一旦你找到你想删除的命令,执行下面的命令,从历史记录中删除那个指定的项: + +``` +history -d [num] +``` + +下面是这个例子的截图。 + +![](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2016/06/commandline-history-delete-specific-commands.png) + +第二个 ‘echo’命令被成功的删除了。 + +同样的,你可以使用向上的箭头一直往回翻看历史记录。当你发现你感兴趣的命令出现在终端上时,按下 “Ctrl + U”清除整行,也会从历史记录中删除它。 + +### 总结 + +有多种不同的方法可以操作 Linux 命令行历史来满足你的需求。然而请记住,从历史中隐藏或者删除命令通常不是一个好习惯,尽管本质上这并没有错。但是你必须知道你在做什么,以及可能产生的后果。 + +-------------------------------------------------------------------------------- + +via: https://www.maketecheasier.com/linux-command-line-history-incognito/?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+maketecheasier + +作者:[Himanshu Arora][a] +译者:[chunyang-wen](https://github.com/chunyang-wen) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.maketecheasier.com/author/himanshu/ +[1]: https://www.maketecheasier.com/command-line-history-linux/ + + + + + From bdd3fb33e5e8fde49e01a1b701dc21b2dd1e4315 Mon Sep 17 00:00:00 2001 From: KS Date: Tue, 12 Jul 2016 15:52:43 +0800 Subject: [PATCH 1138/1469] Update 20160602 How to build and deploy a Facebook Messenger bot with Python and Flask.md --- ... and deploy a Facebook Messenger bot with Python and Flask.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160602 How to build and deploy a Facebook Messenger bot with Python and Flask.md b/sources/tech/20160602 How to build and deploy a Facebook Messenger bot with Python and Flask.md index 1f3fbe1ed3..6ab74e3527 100644 --- a/sources/tech/20160602 How to build and deploy a Facebook Messenger bot with Python and Flask.md +++ b/sources/tech/20160602 How to build and deploy a Facebook Messenger bot with Python and Flask.md @@ -1,3 +1,4 @@ +wyangsun translating How to build and deploy a Facebook Messenger bot with Python and Flask, a tutorial ========================================================================== From 9595b6a7edda06476c75a1bb0e2d2bd4c9e0a492 Mon Sep 17 00:00:00 2001 From: CHL Date: Tue, 12 Jul 2016 17:34:52 +0800 Subject: [PATCH 1139/1469] [Translating]72% Of The People I Follow On Twitter Are Men (#4176) Translating by Flowsnow! 72% Of The People I Follow On Twitter Are Men --- .../20160623 72% Of The People I Follow On Twitter Are Men.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160623 72% Of The People I Follow On Twitter Are Men.md b/sources/tech/20160623 72% Of The People I Follow On Twitter Are Men.md index 7aeab64d2f..71a23511e9 100644 --- a/sources/tech/20160623 72% Of The People I Follow On Twitter Are Men.md +++ b/sources/tech/20160623 72% Of The People I Follow On Twitter Are Men.md @@ -1,3 +1,4 @@ +Translating by Flowsnow! 72% Of The People I Follow On Twitter Are Men =============================================== From 9101a462726211d3be2529f590bbb673f9accbaa Mon Sep 17 00:00:00 2001 From: martin qi Date: Tue, 12 Jul 2016 22:41:03 +0800 Subject: [PATCH 1140/1469] translated --- ...gcreate, lvcreate and lvextend Commands.md | 208 ------------------ ...gcreate, lvcreate and lvextend Commands.md | 206 +++++++++++++++++ 2 files changed, 206 insertions(+), 208 deletions(-) delete mode 100644 sources/tech/LFCS/Part 11 - How to Manage and Create LVM Using vgcreate, lvcreate and lvextend Commands.md create mode 100644 translated/tech/LFCS/Part 11 - How to Manage and Create LVM Using vgcreate, lvcreate and lvextend Commands.md diff --git a/sources/tech/LFCS/Part 11 - How to Manage and Create LVM Using vgcreate, lvcreate and lvextend Commands.md b/sources/tech/LFCS/Part 11 - How to Manage and Create LVM Using vgcreate, lvcreate and lvextend Commands.md deleted file mode 100644 index 390ad18e14..0000000000 --- a/sources/tech/LFCS/Part 11 - How to Manage and Create LVM Using vgcreate, lvcreate and lvextend Commands.md +++ /dev/null @@ -1,208 +0,0 @@ -martin - -Part 11 - How to Manage and Create LVM Using vgcreate, lvcreate and lvextend Commands -============================================================================================ - -Because of the changes in the LFCS exam requirements effective Feb. 2, 2016, we are adding the necessary topics to the [LFCS series][1] published here. To prepare for this exam, your are highly encouraged to use the [LFCE series][2] as well. - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Manage-LVM-and-Create-LVM-Partition-in-Linux.png) ->LFCS: Manage LVM and Create LVM Partition – Part 11 - -One of the most important decisions while installing a Linux system is the amount of storage space to be allocated for system files, home directories, and others. If you make a mistake at that point, growing a partition that has run out of space can be burdensome and somewhat risky. - -**Logical Volumes Management** (also known as **LVM**), which have become a default for the installation of most (if not all) Linux distributions, have numerous advantages over traditional partitioning management. Perhaps the most distinguishing feature of LVM is that it allows logical divisions to be resized (reduced or increased) at will without much hassle. - -The structure of the LVM consists of: - -* One or more entire hard disks or partitions are configured as physical volumes (PVs). -* A volume group (**VG**) is created using one or more physical volumes. You can think of a volume group as a single storage unit. -* Multiple logical volumes can then be created in a volume group. Each logical volume is somewhat equivalent to a traditional partition – with the advantage that it can be resized at will as we mentioned earlier. - -In this article we will use three disks of **8 GB** each (**/dev/sdb**, **/dev/sdc**, and **/dev/sdd**) to create three physical volumes. You can either create the PVs directly on top of the device, or partition it first. - -Although we have chosen to go with the first method, if you decide to go with the second (as explained in [Part 4 – Create Partitions and File Systems in Linux][3] of this series) make sure to configure each partition as type `8e`. - -### Creating Physical Volumes, Volume Groups, and Logical Volumes - -To create physical volumes on top of **/dev/sdb**, **/dev/sdc**, and **/dev/sdd**, do: - -``` -# pvcreate /dev/sdb /dev/sdc /dev/sdd -``` - -You can list the newly created PVs with: - -``` -# pvs -``` - -and get detailed information about each PV with: - -``` -# pvdisplay /dev/sdX -``` - -(where **X** is b, c, or d) - -If you omit `/dev/sdX` as parameter, you will get information about all the PVs. - -To create a volume group named `vg00` using `/dev/sdb` and `/dev/sdc` (we will save `/dev/sdd` for later to illustrate the possibility of adding other devices to expand storage capacity when needed): - -``` -# vgcreate vg00 /dev/sdb /dev/sdc -``` - -As it was the case with physical volumes, you can also view information about this volume group by issuing: - -``` -# vgdisplay vg00 -``` - -Since `vg00` is formed with two **8 GB** disks, it will appear as a single **16 GB** drive: - -![](http://www.tecmint.com/wp-content/uploads/2016/03/List-LVM-Volume-Groups.png) ->List LVM Volume Groups - -When it comes to creating logical volumes, the distribution of space must take into consideration both current and future needs. It is considered good practice to name each logical volume according to its intended use. - -For example, let’s create two LVs named `vol_projects` (**10 GB**) and `vol_backups` (remaining space), which we can use later to store project documentation and system backups, respectively. - -The `-n` option is used to indicate a name for the LV, whereas `-L` sets a fixed size and `-l` (lowercase L) is used to indicate a percentage of the remaining space in the container VG. - -``` -# lvcreate -n vol_projects -L 10G vg00 -# lvcreate -n vol_backups -l 100%FREE vg00 -``` - -As before, you can view the list of LVs and basic information with: - -``` -# lvs -``` - -and detailed information with - -``` -# lvdisplay -``` - -To view information about a single **LV**, use **lvdisplay** with the **VG** and **LV** as parameters, as follows: - -``` -# lvdisplay vg00/vol_projects -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/03/List-Logical-Volume.png) ->List Logical Volume - -In the image above we can see that the LVs were created as storage devices (refer to the LV Path line). Before each logical volume can be used, we need to create a filesystem on top of it. - -We’ll use ext4 as an example here since it allows us both to increase and reduce the size of each LV (as opposed to xfs that only allows to increase the size): - -``` -# mkfs.ext4 /dev/vg00/vol_projects -# mkfs.ext4 /dev/vg00/vol_backups -``` - -In the next section we will explain how to resize logical volumes and add extra physical storage space when the need arises to do so. - -### Resizing Logical Volumes and Extending Volume Groups - -Now picture the following scenario. You are starting to run out of space in `vol_backups`, while you have plenty of space available in `vol_projects`. Due to the nature of LVM, we can easily reduce the size of the latter (say **2.5 GB**) and allocate it for the former, while resizing each filesystem at the same time. - -Fortunately, this is as easy as doing: - -``` -# lvreduce -L -2.5G -r /dev/vg00/vol_projects -# lvextend -l +100%FREE -r /dev/vg00/vol_backups -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Resize-Reduce-Logical-Volume-and-Volume-Group.png) ->Resize Reduce Logical Volume and Volume Group - -It is important to include the minus `(-)` or plus `(+)` signs while resizing a logical volume. Otherwise, you’re setting a fixed size for the LV instead of resizing it. - -It can happen that you arrive at a point when resizing logical volumes cannot solve your storage needs anymore and you need to buy an extra storage device. Keeping it simple, you will need another disk. We are going to simulate this situation by adding the remaining PV from our initial setup (`/dev/sdd`). - -To add `/dev/sdd` to `vg00`, do - -``` -# vgextend vg00 /dev/sdd -``` - -If you run vgdisplay `vg00` before and after the previous command, you will see the increase in the size of the VG: - -``` -# vgdisplay vg00 -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/03/List-Volume-Group-Size.png) ->Check Volume Group Disk Size - -Now you can use the newly added space to resize the existing LVs according to your needs, or to create additional ones as needed. - -### Mounting Logical Volumes on Boot and on Demand - -Of course there would be no point in creating logical volumes if we are not going to actually use them! To better identify a logical volume we will need to find out what its `UUID` (a non-changing attribute that uniquely identifies a formatted storage device) is. - -To do that, use blkid followed by the path to each device: - -``` -# blkid /dev/vg00/vol_projects -# blkid /dev/vg00/vol_backups -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Find-Logical-Volume-UUID.png) ->Find Logical Volume UUID - -Create mount points for each LV: - -``` -# mkdir /home/projects -# mkdir /home/backups -``` - -and insert the corresponding entries in `/etc/fstab` (make sure to use the UUIDs obtained before): - -``` -UUID=b85df913-580f-461c-844f-546d8cde4646 /home/projects ext4 defaults 0 0 -UUID=e1929239-5087-44b1-9396-53e09db6eb9e /home/backups ext4 defaults 0 0 -``` - -Then save the changes and mount the LVs: - -``` -# mount -a -# mount | grep home -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Find-Logical-Volume-UUID.png) ->Find Logical Volume UUID - -When it comes to actually using the LVs, you will need to assign proper `ugo+rwx` permissions as explained in [Part 8 – Manage Users and Groups in Linux][4] of this series. - -### Summary - -In this article we have introduced [Logical Volume Management][5], a versatile tool to manage storage devices that provides scalability. When combined with RAID (which we explained in [Part 6 – Create and Manage RAID in Linux][6] of this series), you can enjoy not only scalability (provided by LVM) but also redundancy (offered by RAID). - -In this type of setup, you will typically find `LVM` on top of `RAID`, that is, configure RAID first and then configure LVM on top of it. - -If you have questions about this article, or suggestions to improve it, feel free to reach us using the comment 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/installing-network-services-and-configuring-services-at-system-boot/ -[3]: http://www.tecmint.com/create-partitions-and-filesystems-in-linux/ -[4]: http://www.tecmint.com/manage-users-and-groups-in-linux/ -[5]: http://www.tecmint.com/create-lvm-storage-in-linux/ -[6]: http://www.tecmint.com/creating-and-managing-raid-backups-in-linux/ diff --git a/translated/tech/LFCS/Part 11 - How to Manage and Create LVM Using vgcreate, lvcreate and lvextend Commands.md b/translated/tech/LFCS/Part 11 - How to Manage and Create LVM Using vgcreate, lvcreate and lvextend Commands.md new file mode 100644 index 0000000000..84b9db7968 --- /dev/null +++ b/translated/tech/LFCS/Part 11 - How to Manage and Create LVM Using vgcreate, lvcreate and lvextend Commands.md @@ -0,0 +1,206 @@ +LFCS 系列第十一讲:如何使用命令 vgcreate、lvcreate 和 lvextend 管理和创建 LVM +============================================================================================ + +由于 LFCS 考试中的一些改变已在 2016 年 2 月 2 日生效,我们添加了一些必要的专题到 [LFCS 系列][1]。我们也非常推荐备考的同学,同时阅读 [LFCE 系列][2]。 + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Manage-LVM-and-Create-LVM-Partition-in-Linux.png) +>LFCS:管理 LVM 和创建 LVM 分区 + +在安装 Linux 系统的时候要做的最重要的决定之一便是给系统文件,home 目录等分配空间。在这个地方犯了错,再要增长空间不足的分区,那样既麻烦又有风险。 + +**逻辑卷管理** (即 **LVM**)相较于传统的分区管理有许多优点,已经成为大多数(如果不能说全部的话) Linux 发行版安装时的默认选择。LVM 最大的优点应该是能方便的按照你的意愿调整(减小或增大)逻辑分区的大小。 + +LVM 的组成结构: + +* 把一块或多块硬盘或者一个或多个分区配置成物理卷(PV)。 +* 一个用一个或多个物理卷创建出的卷组(**VG**)。可以把一个卷组想象成一个单独的存储单元。 +* 在一个卷组上可以创建多个逻辑卷。每个逻辑卷相当于一个传统意义上的分区 —— 优点是它的大小可以根据需求重新调整大小,正如之前提到的那样。 + +本文,我们将使用三块 **8 GB** 的磁盘(**/dev/sdb**、**/dev/sdc** 和 **/dev/sdd**)分别创建三个物理卷。你既可以直接在设备上创建 PV,也可以先分区在创建。 + +在这里我们选择第一种方式,如果你决定使用第二种(可以参考本系列[第四讲:创建分区和文件系统][3])确保每个分区的类型都是 `8e`。 + +### 创建物理卷,卷组和逻辑卷 + +要在 **/dev/sdb**、**/dev/sdc** 和 **/dev/sdd**上创建物理卷,运行: + +``` +# pvcreate /dev/sdb /dev/sdc /dev/sdd +``` + +你可以列出新创建的 PV ,通过: + +``` +# pvs +``` + +并得到每个 PV 的详细信息,通过: + +``` +# pvdisplay /dev/sdX +``` + +(**X** 即 b、c 或 d) + +如果没有输入 `/dev/sdX` ,那么你将得到所有 PV 的信息。 + +使用 /dev/sdb` 和 `/dev/sdc` 创建卷组 ,命名为 `vg00` (在需要时是可以通过添加其他设备来扩展空间的,我们等到说明这点的时候再用,所以暂时先保留 `/dev/sdd`): + +``` +# vgcreate vg00 /dev/sdb /dev/sdc +``` + +就像物理卷那样,你也可以查看卷组的信息,通过: + +``` +# vgdisplay vg00 +``` + +由于 `vg00` 是由两个 **8 GB** 的磁盘组成的,所以它将会显示成一个 **16 GB** 的硬盘: + +![](http://www.tecmint.com/wp-content/uploads/2016/03/List-LVM-Volume-Groups.png) +>LVM 卷组列表 + +当谈到创建逻辑卷,空间的分配必须考虑到当下和以后的需求。根据每个逻辑卷的用途来命名是一个好的做法。 + +举个例子,让我们创建两个 LV,命名为 `vol_projects` (**10 GB**) 和 `vol_backups` (剩下的空间), 在日后分别用于部署项目文件和系统备份。 + +参数 `-n` 用于为 LV 指定名称,而 `-L` 用于设定固定的大小,还有 `-l` (小写的 L)在 VG 的预留空间中用于指定百分比大小的空间。 + +``` +# lvcreate -n vol_projects -L 10G vg00 +# lvcreate -n vol_backups -l 100%FREE vg00 +``` + +和之前一样,你可以查看 LV 的列表和基础信息,通过: + +``` +# lvs +``` + +或是详细信息,通过: + +``` +# lvdisplay +``` + +若要查看单个 **LV** 的信息,使用 **lvdisplay** 加上 **VG** 和 **LV** 作为参数,如下: + +``` +# lvdisplay vg00/vol_projects +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/03/List-Logical-Volume.png) +>逻辑卷列表 + +如上图,我们看到 LV 已经被创建成存储设备了(参考 LV Path line)。在使用每个逻辑卷之前,需要先在上面创建文件系统。 + +这里我们拿 ext4 来做举例,因为对于每个 LV 的大小, ext4 既可以增大又可以减小(相对的 xfs 就只允许增大): + +``` +# mkfs.ext4 /dev/vg00/vol_projects +# mkfs.ext4 /dev/vg00/vol_backups +``` + +我们将在下一节向大家说明,如何调整逻辑卷的大小并在需要的时候添加额外的外部存储空间。 + +### 调整逻辑卷大小和扩充卷组 + +现在设想以下场景。`vol_backups` 中的空间即将用完,而 `vol_projects` 中还有富余的空间。由于 LVM 的特性,我们可以轻易的减小后者的大小(比方说 **2.5 GB**),并将其分配给前者,与此同时调整每个文件系统的大小。 + +幸运的是这很简单,只需: + +``` +# lvreduce -L -2.5G -r /dev/vg00/vol_projects +# lvextend -l +100%FREE -r /dev/vg00/vol_backups +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Resize-Reduce-Logical-Volume-and-Volume-Group.png) +>减小逻辑卷和卷组 + +在调整逻辑卷的时候,其中包含的减号 `(-)` 或加号 `(+)` 是十分重要的。否则 LV 将会被设置成指定的大小,而非调整指定大小。 + +有些时候,你可能会遭遇那种无法仅靠调整逻辑卷的大小就可以解决的问题,那时你就需要购置额外的存储设备了,你可能需要再加一块硬盘。这里我们将通过添加之前配置时预留的 PV (`/dev/sdd`),用以模拟这种情况。 + +想把 `/dev/sdd` 加到 `vg00`,执行: + +``` +# vgextend vg00 /dev/sdd +``` + +如果你在运行上条命令的前后执行 vgdisplay `vg00` ,你就会看出 VG 的大小增加了。 + +``` +# vgdisplay vg00 +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/03/List-Volume-Group-Size.png) +>查看卷组磁盘大小 + +现在,你可以使用新加的空间,按照你的需求调整现有 LV 的大小,或者创建一个新的 LV。 + +### 在启动和需求时挂载逻辑卷 + +当然,如果我们不打算实际的使用逻辑卷,那么创建它们就变得毫无意义了。为了更好的识别逻辑卷,我们需要找出它的 `UUID` (用于识别一个格式化存储设备的唯一且不变的属性)。 + +要做到这点,可使用 blkid 加每个设备的路径来实现: + +``` +# blkid /dev/vg00/vol_projects +# blkid /dev/vg00/vol_backups +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Find-Logical-Volume-UUID.png) +>寻找逻辑卷的 UUID + +为每个 LV 创建挂载点: + +``` +# mkdir /home/projects +# mkdir /home/backups +``` + +并在 `/etc/fstab` 插入相应的条目(确保使用之前获得的UUID): + +``` +UUID=b85df913-580f-461c-844f-546d8cde4646 /home/projects ext4 defaults 0 0 +UUID=e1929239-5087-44b1-9396-53e09db6eb9e /home/backups ext4 defaults 0 0 +``` + +保存并挂载 LV: + +``` +# mount -a +# mount | grep home +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Mount-Logical-Volumes-on-Linux-1.png) +>挂载逻辑卷 + +在涉及到 LV 的实际使用时,你还需要按照曾在本系列[第八讲:管理用户和用户组][4]中讲解的那样,为其设置合适的 `ugo+rwx`。 + +### 总结 + +本文介绍了 [逻辑卷管理][5],一个用于管理可扩展存储设备的多功能工具。与 RAID(曾在本系列讲解过的 [第六讲:组装分区为RAID设备——创建和管理系统备份][6])结合使用,你将同时体验到(LVM 带来的)可扩展性和(RAID 提供的)冗余。 + +在这类的部署中,你通常会在 `RAID` 上发现 `LVM`,这就是说,要先配置好 RAID 然后它在上面配置 LVM。 + +如果你对本问有任何的疑问和建议,可以直接在下方的评论区告诉我们。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/manage-and-create-lvm-parition-using-vgcreate-lvcreate-and-lvextend/ + +作者:[Gabriel Cánepa][a] +译者:[martin2011qi](https://github.com/martin2011qi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.tecmint.com/author/gacanepa/ +[1]: https://linux.cn/article-7161-1.html +[2]: http://www.tecmint.com/installing-network-services-and-configuring-services-at-system-boot/ +[3]: https://linux.cn/article-7187-1.html +[4]: https://linux.cn/article-7418-1.html +[5]: http://www.tecmint.com/create-lvm-storage-in-linux/ +[6]: https://linux.cn/article-7229-1.html From 31e8877ddf1ea8a13a6f209c81c7dead2b84e05b Mon Sep 17 00:00:00 2001 From: Cinlen Chan <237448382@qq.com> Date: Wed, 13 Jul 2016 09:20:18 +0800 Subject: [PATCH 1141/1469] [translated]Growing a carrer alongside Linux (#4179) * [translated]Growing a carrer alongside Linux * [translated]Growing a career alongside Linux --- ...160316 Growing a career alongside Linux.md | 51 ------------------- ...160316 Growing a career alongside Linux.md | 49 ++++++++++++++++++ 2 files changed, 49 insertions(+), 51 deletions(-) delete mode 100644 sources/talk/my-open-source-story/20160316 Growing a career alongside Linux.md create mode 100644 translated/talk/my-open-source-story/20160316 Growing a career alongside Linux.md diff --git a/sources/talk/my-open-source-story/20160316 Growing a career alongside Linux.md b/sources/talk/my-open-source-story/20160316 Growing a career alongside Linux.md deleted file mode 100644 index b9e5e54f0a..0000000000 --- a/sources/talk/my-open-source-story/20160316 Growing a career alongside Linux.md +++ /dev/null @@ -1,51 +0,0 @@ -chenxinlong translating - -Growing a career alongside Linux -================================== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/OPENHERE_blue.png?itok=3eqp-7gT) - -My Linux story started in 1998 and continues today. Back then, I worked for The Gap managing thousands of desktops running [OS/2][1] (and a few years later, [Warp 3.0][2]). As an OS/2 guy, I was really happy then. The desktops hummed along and it was quite easy to support thousands of users with the tools the GAP had built. Changes were coming, though. - -In November of 1998, I received an invitation to join a brand new startup which would focus on Linux in the enterprise. This startup became quite famous as [Linuxcare][2]. - -### My time at Linuxcare - -I had played with Linux a bit, but had never considered delivering it to enterprise customers. Mere months later (which is a turn of the corner in startup time and space), I was managing a line of business that let enterprises get their hardware, software, and even books certified on a few flavors of Linux that were popular back then. - -I supported customers like IBM, Dell, and HP in ensuring their hardware ran Linux successfully. You hear a lot now about preloading Linux on hardware today, but way back then I was invited to Dell to discuss getting a laptop certified to run Linux for an upcoming trade show. Very exciting times! We also supported IBM and HP on a number of certification efforts that spanned a few years. - -Linux was changing fast, much like it always has. It gained hardware support for more key devices like sound, network, graphics. At around that time, I shifted from RPM-based systems to [Debian][3] for my personal use. - -### Using Linux through the years - -Fast forward some years and I worked at a number of companies that did Linux as hardened appliances, Linux as custom software, and Linux in the data center. By the mid 2000s, I was busy doing consulting for that rather large software company in Redmond around some analysis and verification of Linux compared to their own solutions. My personal use had not changed though—I would still run Debian testing systems on anything I could. - -I really appreciated the flexibility of a distribution that floated and was forever updated. Debian is one of the most fun and well supported distributions and has the best community I've ever been a part of. - -When I look back at my own adoption of Linux, I remember with fondness the numerous Linux Expo trade shows in San Jose, San Francisco, Boston, and New York in the early and mid 2000's. At Linuxcare we always did fun and funky booths, and walking the show floor always resulted in getting re-acquainted with old friends. Rumors of work were always traded, and the entire thing underscored the fun of using Linux in real endeavors. - -The rise of virtualization and cloud has really made the use of Linux even more interesting. When I was with Linuxcare, we partnered with a small 30-person company in Palo Alto. We would drive to their offices and get things ready for a trade show that they would attend with us. Who would have ever known that little startup would become VMware? - -I have so many stories, and there were so many people I was so fortunate to meet and work with. Linux has evolved in so many ways and has become so important. And even with its increasing importance, Linux is still fun to use. I think its openness and the ability to modify it has contributed to a legion of new users, which always astounds me. - -### Today - -I've moved away from doing mainstream Linux things over the past five years. I manage large scale infrastructure projects that include a variety of OSs (both proprietary and open), but my heart has always been with Linux. - -The constant evolution and fun of using Linux has been a driving force for me for over the past 18 years. I started with the 2.0 Linux kernel and have watched it become what it is now. It's a remarkable thing. An organic thing. A cool thing. - --------------------------------------------------------------------------------- - -via: https://opensource.com/life/16/3/my-linux-story-michael-perry - -作者:[Michael Perry][a] -译者:[译者ID](https://github.com/chenxinlong) -校对:[校对者ID](https://github.com/校对者ID) - -[a]: https://opensource.com/users/mpmilestogo -[1]: https://en.wikipedia.org/wiki/OS/2 -[2]: https://archive.org/details/IBMOS2Warp3Collection -[3]: https://en.wikipedia.org/wiki/Linuxcare -[4]: https://www.debian.org/ -[5]: diff --git a/translated/talk/my-open-source-story/20160316 Growing a career alongside Linux.md b/translated/talk/my-open-source-story/20160316 Growing a career alongside Linux.md new file mode 100644 index 0000000000..f7ddefb92c --- /dev/null +++ b/translated/talk/my-open-source-story/20160316 Growing a career alongside Linux.md @@ -0,0 +1,49 @@ +培养一个 Linux 职业生涯 +================================== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/OPENHERE_blue.png?itok=3eqp-7gT) + +我与 Linux 的故事开始于 1998 年,一直延续到今天。 当时我在 Gap 公司工作,管理着成千台运行着 [OS/2][1] 系统的台式机 ( 并且在随后的几年里是 [Warp 3.0][2])。 作为一个 OS/2 的使用者,那时我非常高兴。 随着这些台式机的嗡鸣,我们使用 Gap 开发的工具轻而易举地就能支撑起对成千的用户的服务支持。 然而,一切都将改变了。 + +在 1998 年的 11 月, 我收到邀请加入一个新成立的公司,这家公司将专注于 Linux 上。 这就是后来非常出名的 [Linuxcare][2]. + +### 我在 Linuxcare 的时光 + +我曾经有接触过一些 Linux , 但我从未想过要把它提供给企业客户。仅仅几个月后 ( 从这里开始成为了空间和时间上的转折点 ), 我就在管理一整条线的业务,让企业获得他们的软件,硬件,甚至是证书认证等不同风格且在当时非常盛行的的 Linux 服务。 + +我向我的客户提供像 IBM ,Dell ,HP 等产品以确保他们的硬件能够成功的运行 Linux 。 今天你们应该都听过许多关于在硬件上预载 Linux 的事, 但当时我被邀请到 Dell 去讨论有关于为即将到来的贸易展在笔记本电脑上运行 Linux 的相关事宜。 这是多么激动人心的时刻 !同时我们也在有效期的几年内支持 IBM 和 HP 等多项认证工作。 + +Linux 变化得非常快,并且它总是这样。 它也获得了更多的关键设备的支持,比如声音,网络和图形。在这段时间, 我把个人使用的系统从基于 RPM 的系统换成了 [Debian][3] 。 + +### 使用 Linux 的这些年 + +几年前我在一些以 Linux 为硬设备,客户软件以及数据中心的公司工作。而在二十世纪中期的时候,那时我正在忙着做咨询,而那些在 Redmond 的大型软件公司正围绕着 Linux 做一些分析和验证以和自己的解决方案做对比。 我个人使用的系统一直改变,我仍会在任何能做到的时候运行 Debian 测试系统。 + +我真的非常欣赏其发行版本的灵活性和永久更新状态。 Debian 是我所使用过的最有趣且拥有良好支持的发行版本且拥有最好的社区的版本之一。 + +当我回首我使用 Linux 的这几年,我仍记得大约在二十世纪前期和中期的时候在圣何塞,旧金山,波士顿和纽约的那些 Linux 的展览会。在 Linuxcare 时我们总是会做一些有趣而且时髦的展览位,在那边逛的时候总会碰到一些老朋友。这一切工作都是需要付出代价的,所有的这一切都是在努力地强调使用 Linux 的乐趣。 + +同时,虚拟化和云的崛起也让 Linux 变得更加有趣。 当我在 Linuxcare 的时候, 我们常和 Palo Alto 的一个约 30 人左右的小公司在一块。我们会开车到他们的办公处然后准备一个展览并且他们也会参与进来。 谁会想得到这个小小的开端会成就后来的 VMware ? + +我还有许多的故事,能认识这些人并和他们一起工作我感到很幸运。 Linux 在各方面都不断发展且变得尤为重要。 并且甚至随着它重要性的提升,它使用起来仍然非常有趣。 我认为它的开放性和可定制能力给它带来了大量的新用户,这也是让我感到非常震惊的一点。 + +### 现在 + +在过去的五年里我逐渐离开 Linux 的主流事物。 我所管理的大规模基础设施项目中包含着许多不同的操作系统 ( 包括非开源的和开源的 ), 但我的心一直以来都是和 Linux 在一起的。 + +在使用 Linux 过程中的乐趣和不断进步是在过去的 18 年里一直驱动我的动力。我从 Linux 2.0 内核开始看着它变成现在的这样。 Linux 是一个卓越,有机且非常酷的东西。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/16/3/my-linux-story-michael-perry + +作者:[Michael Perry][a] +译者:[译者ID](https://github.com/chenxinlong) +校对:[校对者ID](https://github.com/校对者ID) + +[a]: https://opensource.com/users/mpmilestogo +[1]: https://en.wikipedia.org/wiki/OS/2 +[2]: https://archive.org/details/IBMOS2Warp3Collection +[3]: https://en.wikipedia.org/wiki/Linuxcare +[4]: https://www.debian.org/ +[5]: From bfa39b05dd36e7fbe3b05ba3a25aabca7f47f999 Mon Sep 17 00:00:00 2001 From: cposture Date: Wed, 13 Jul 2016 09:27:55 +0800 Subject: [PATCH 1142/1469] translating partly 75 --- ...reate Your Own Shell in Python - Part I.md | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/sources/tech/20160705 Create Your Own Shell in Python - Part I.md b/sources/tech/20160705 Create Your Own Shell in Python - Part I.md index 0b7e415f2a..67e5809b3d 100644 --- a/sources/tech/20160705 Create Your Own Shell in Python - Part I.md +++ b/sources/tech/20160705 Create Your Own Shell in Python - Part I.md @@ -101,12 +101,12 @@ def shell_loop(): 当一个用户在我们的 shell 中输入命令并按下回车键,该命令将会是一个包含命令名称及其参数的很长的字符串。因此,我们必须切分该字符串(分割一个字符串为多个标记)。 -咋一看它似乎很简单。我们或许可以使用 cmd.split(),用空格分割输入。 -It seems simple at first glance. We might use cmd.split() to separate the input by spaces. It works well for a command like `ls -a my_folder` because it splits the command into a list `['ls', '-a', 'my_folder']` which we can use them easily. +咋一看似乎很简单。我们或许可以使用 cmd.split(),用空格分割输入。它对类似 `ls -a my_folder` 的命令起作用,因为它能够将命令分割为一个列表 `['ls', '-a', 'my_folder']`,这样我们便能轻易处理它们了。 -However, there are some cases that some arguments are quoted with single or double quotes like `echo "Hello World"` or `echo 'Hello World'`. If we use cmd.split(), we will get a list of 3 tokens `['echo', '"Hello', 'World"']` instead of 2 tokens `['echo', 'Hello World']`. +然而,也有一些类似 `echo "Hello World"` 或 `echo 'Hello World'` 以单引号或双引号引用参数的情况。如果我们使用 cmd.spilt,我们将会得到一个存有 3 个标记的列表 `['echo', '"Hello', 'World"']` 而不是 2 个标记 `['echo', 'Hello World']`。 + +幸运的是,Python 提供了一个名为 shlex 的库,能够帮助我们效验如神地分割命令。(提示:我们也可以使用正则表达式,但它不是本文的重点。) -Fortunately, Python provides a library called shlex that helps us split like a charm. (Note: we can also use regular expression but it’s not the main point of this article.) ``` import sys @@ -120,13 +120,13 @@ def tokenize(string): ... ``` -Then, we will send these tokens to the execution process. +然后我们将这些标记发送到执行过程。 -### Step 3: Execution +### 步骤 3:执行 -This is the core and fun part of a shell. What happened when a shell executes mkdir test_dir? (Note: mkdir is a program to be executed with arguments test_dir for creating a directory named test_dir.) +这是 shell 中核心和有趣的一部分。当 shell 执行 mkdir test_dir 时,发生了什么?(提示:midir 是一个带有 test_dir 参数的执行程序,用于创建一个名为 test_dir 的目录。) -The first function involved in this step is execvp. Before I explain what execvp does, let’s see it in action. +execvp 是涉及这一步的首个函数。在我们解释 execvp 所做的事之前,让我们看看它的实际效果。 ``` import os @@ -142,15 +142,16 @@ def execute(cmd_tokens): ... ``` -Try running our shell again and input a command `mkdir test_dir`, then, hit enter. +再次尝试运行我们的 shell,并输入 `mkdir test_dir` 命令,接着按下回车键。 -The problem is, after we hit enter, our shell exits instead of waiting for the next command. However, the directory is correctly created. +在我们敲下回车键之后,问题是我们的 shell 会直接退出而不是等待下一个命令。然而,目标正确地被创建。 -So, what execvp really does? +因此,execvp 实际上做了什么? -execvp is a variant of a system call exec. The first argument is the program name. The v indicates the second argument is a list of program arguments (variable number of arguments). The p indicates the PATH environment will be used for searching for the given program name. In our previous attempt, the mkdir program was found based on your PATH environment variable. +execvp 是系统调用 exec 的一个变体。第一个参数是程序名字。v 表示第二个参数是一个程序参数列表(可变参数)。p 表示环境变量 PATH 会被用于搜索给定的程序名字。在我们上一次的尝试中,可以在你的 PATH 环境变量查找到 mkdir 程序。 + +(还有其他 exec 变体,比如 execv、execvpe、execl、execlp、execlpe;你可以 google 它们获取更多的信息。) -(There are other variants of exec such as execv, execvpe, execl, execlp, execlpe; you can google them for more information.) exec replaces the current memory of a calling process with a new process to be executed. In our case, our shell process memory was replaced by `mkdir` program. Then, mkdir became the main process and created the test_dir directory. Finally, its process exited. From a0bab457e91524872b1803ff490b436ab143ae63 Mon Sep 17 00:00:00 2001 From: Chunyang Wen Date: Wed, 13 Jul 2016 11:07:17 +0800 Subject: [PATCH 1143/1469] Translating: writing online game part2 & 3 (#4180) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * âFinish tranlating awk series part4 * Update Part 4 - How to Use Comparison Operators with Awk in Linux.md * translating: How to Hide Linux Command Line History by Going Incognito * finish translating How to Hide Linux Command Line History by Going Incognito * update translator * translating game part2 and 3 --- ...g online multiplayer game with python and asyncio - part 2.md | 1 + ...g online multiplayer game with python and asyncio - part 3.md | 1 + 2 files changed, 2 insertions(+) diff --git a/sources/tech/20160531 Writing online multiplayer game with python and asyncio - part 2.md b/sources/tech/20160531 Writing online multiplayer game with python and asyncio - part 2.md index a33b0b0fdc..75df13d9b5 100644 --- a/sources/tech/20160531 Writing online multiplayer game with python and asyncio - part 2.md +++ b/sources/tech/20160531 Writing online multiplayer game with python and asyncio - part 2.md @@ -1,3 +1,4 @@ +chunyang-wen translating Writing online multiplayer game with python and asyncio - Part 2 ================================================================== diff --git a/sources/tech/20160606 Writing online multiplayer game with python and asyncio - part 3.md b/sources/tech/20160606 Writing online multiplayer game with python and asyncio - part 3.md index 90cf71c466..3c38af72ac 100644 --- a/sources/tech/20160606 Writing online multiplayer game with python and asyncio - part 3.md +++ b/sources/tech/20160606 Writing online multiplayer game with python and asyncio - part 3.md @@ -1,3 +1,4 @@ +chunyang-wen translating Writing online multiplayer game with python and asyncio - Part 3 ================================================================= From 97bdb52dc246b07480649ea4d70b6c0df55f0e96 Mon Sep 17 00:00:00 2001 From: cposture Date: Wed, 13 Jul 2016 13:48:03 +0800 Subject: [PATCH 1144/1469] Translated by cposture --- ...reate Your Own Shell in Python - Part I.md | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/sources/tech/20160705 Create Your Own Shell in Python - Part I.md b/sources/tech/20160705 Create Your Own Shell in Python - Part I.md index 67e5809b3d..74cac3887e 100644 --- a/sources/tech/20160705 Create Your Own Shell in Python - Part I.md +++ b/sources/tech/20160705 Create Your Own Shell in Python - Part I.md @@ -152,16 +152,15 @@ execvp 是系统调用 exec 的一个变体。第一个参数是程序名字。v (还有其他 exec 变体,比如 execv、execvpe、execl、execlp、execlpe;你可以 google 它们获取更多的信息。) +exec 会用即将运行的新进程替换调用进程的当前内存。在我们的例子中,我们的 shell 进程内存会被替换为 `mkdir` 程序。接着,mkdir 成为主进程并创建 test_dir 目录。最后该进程退出。 -exec replaces the current memory of a calling process with a new process to be executed. In our case, our shell process memory was replaced by `mkdir` program. Then, mkdir became the main process and created the test_dir directory. Finally, its process exited. +这里的重点在于我们的 shell 进程已经被 mkdir 进程所替换。这就是我们的 shell 消失且不会等待下一条命令的原因。 -The main point here is that our shell process was replaced by mkdir process already. That’s the reason why our shell disappeared and did not wait for the next command. +因此,我们需要其他的系统调用来解决问题:fork -Therefore, we need another system call to rescue: fork. +fork 会开辟新的内存并拷贝当前进程到一个新的进程。我们称这个新的进程为子进程,调用者进程为父进程。然后,子进程内存会被替换为被执行的程序。因此,我们的 shell,也就是父进程,可以免受内存替换的危险。 -fork will allocate new memory and copy the current process into a new process. We called this new process as child process and the caller process as parent process. Then, the child process memory will be replaced by a execed program. Therefore, our shell, which is a parent process, is safe from memory replacement. - -Let’s see our modified code. +让我们看看已修改的代码。 ``` ... @@ -194,25 +193,25 @@ def execute(cmd_tokens): ... ``` -When the parent process call `os.fork()`, you can imagine that all source code is copied into a new child process. At this point, the parent and child process see the same code and run in parallel. +当我们的父进程调用 `os.fork()`时,你可以想象所有的源代码被拷贝到了新的子进程。此时此刻,父进程和子进程看到的是相同的代码,并且并行运行着。 -If the running code is belong to the child process, pid will be 0. Else, the running code is belong to the parent process, pid will be the process id of the child process. +如果运行的代码属于子进程,pid 将为 0。否则,如果运行的代码属于父进程,pid 将会是子进程的进程 id。 -When os.execvp is invoked in the child process, you can imagine like all the source code of the child process is replaced by the code of a program that is being called. However, the code of the parent process is not changed. +当 os.execvp 在子进程中被调用时,你可以想象子进程的所有源代码被替换为正被调用程序的代码。然而父进程的代码不会被改变。 -When the parent process finishes waiting its child process to exit or be terminated, it returns the status indicating to continue the shell loop. +当父进程完成等待子进程退出或终止时,它会返回一个状态,指示继续 shell 循环。 -### Run +### 运行 -Now, you can try running our shell and enter mkdir test_dir2. It should work properly. Our main shell process is still there and waits for the next command. Try ls and you will see the created directories. +现在,你可以尝试运行我们的 shell 并输入 mkdir test_dir2。它应该可以正确执行。我们的主 shell 进程仍然存在并等待下一条命令。尝试执行 ls,你可以看到已创建的目录。 -However, there are some problems here. +但是,这里仍有许多问题。 -First, try cd test_dir2 and then ls. It’s supposed to enter the directory test_dir2 which is an empty directory. However, you will see that the directory was not changed into test_dir2. +第一,尝试执行 cd test_dir2,接着执行 ls。它应该会进入到一个空的 test_dir2 目录。然而,你将会看到目录没有变为 test_dir2。 -Second, we still have no way to exit from our shell gracefully. +第二,我们仍然没有办法优雅地退出我们的 shell。 -We will continue to solve such problems in [Part 2][1]. +我们将会在 [Part 2][1] 解决诸如此类的问题。 -------------------------------------------------------------------------------- From c544898d9927eb375711356a35cf74c079abe39f Mon Sep 17 00:00:00 2001 From: cposture Date: Wed, 13 Jul 2016 15:03:42 +0800 Subject: [PATCH 1145/1469] Translated by cposture --- ...reate Your Own Shell in Python - Part I.md | 228 ------------------ ...reate Your Own Shell in Python - Part I.md | 228 ++++++++++++++++++ 2 files changed, 228 insertions(+), 228 deletions(-) delete mode 100644 sources/tech/20160705 Create Your Own Shell in Python - Part I.md create mode 100644 translated/tech/20160705 Create Your Own Shell in Python - Part I.md diff --git a/sources/tech/20160705 Create Your Own Shell in Python - Part I.md b/sources/tech/20160705 Create Your Own Shell in Python - Part I.md deleted file mode 100644 index 74cac3887e..0000000000 --- a/sources/tech/20160705 Create Your Own Shell in Python - Part I.md +++ /dev/null @@ -1,228 +0,0 @@ -使用 Python 创建你自己的 Shell:Part I -========================================== - -我很好奇一个 shell (像 bash,csh 等)内部是如何工作的。为了满足自己的好奇心,我使用 Python 实现了一个名为 yosh (Your Own Shell)的 Shell。本文章所介绍的概念也可以应用于其他编程语言。 - -(提示:你可以发布于此的博文中找到使用的源代码,代码以 MIT 许可发布) - -让我们开始吧。 - -### 步骤 0:项目结构 - -对于此项目,我使用了以下的项目结构。 - -``` -yosh_project -|-- yosh - |-- __init__.py - |-- shell.py -``` - -`yosh_project` 为项目根目录(你也可以把它简单地命名为 `yosh`)。 - -`yosh` 为包目录,并且 `__init__.py` 将会使一个包名等同于包目录名字(如果你不写 Python,可以忽略它) - -`shell.py` 是我们的主脚本文件。 - -### 步骤 1:Shell 循环 - -当你启动一个 shell,它会显示一个命令提示符同时等待用户输入命令。在接收了输入的命令并执行它之后(稍后文章会进行详细解释),你的 shell 会回到循环,等待下一条指令。 - -在 `shell.py`,我们会以一个简单的 mian 函数开始,该函数调用了 shell_loop() 函数,如下: - -``` -def shell_loop(): - # Start the loop here - - -def main(): - shell_loop() - - -if __name__ == "__main__": - main() -``` - -接着,在 `shell_loop()`,为了指示循环是否继续或停止,我们使用了一个状态标志。在循环的开始,我们的 shell 将显示一个命令提示符,并等待读取命令输入。 - -``` -import sys - -SHELL_STATUS_RUN = 1 -SHELL_STATUS_STOP = 0 - - -def shell_loop(): - status = SHELL_STATUS_RUN - - while status == SHELL_STATUS_RUN: - # Display a command prompt - sys.stdout.write('> ') - sys.stdout.flush() - - # Read command input - cmd = sys.stdin.readline() -``` - -之后,我们切分命令输入并进行执行(我们将马上解释命令切分和执行函数)。 - -因此,我们的 shell_loop() 会是如下这样: - -``` -import sys - -SHELL_STATUS_RUN = 1 -SHELL_STATUS_STOP = 0 - - -def shell_loop(): - status = SHELL_STATUS_RUN - - while status == SHELL_STATUS_RUN: - # Display a command prompt - sys.stdout.write('> ') - sys.stdout.flush() - - # Read command input - cmd = sys.stdin.readline() - - # Tokenize the command input - cmd_tokens = tokenize(cmd) - - # Execute the command and retrieve new status - status = execute(cmd_tokens) -``` - -这就是我们整个 shell 循环。如果我们使用 python shell.py 命令启动 shell,它会显示命令提示符。然而如果我们输入命令并按回车,它将会抛出错误,因为我们还没定义命令切分函数。 - -为了退出 shell,可以尝试输入 ctrl-c。稍后我将解释如何以优雅的形式退出 shell。 - -### 步骤 2:命令切分 - -当一个用户在我们的 shell 中输入命令并按下回车键,该命令将会是一个包含命令名称及其参数的很长的字符串。因此,我们必须切分该字符串(分割一个字符串为多个标记)。 - -咋一看似乎很简单。我们或许可以使用 cmd.split(),用空格分割输入。它对类似 `ls -a my_folder` 的命令起作用,因为它能够将命令分割为一个列表 `['ls', '-a', 'my_folder']`,这样我们便能轻易处理它们了。 - -然而,也有一些类似 `echo "Hello World"` 或 `echo 'Hello World'` 以单引号或双引号引用参数的情况。如果我们使用 cmd.spilt,我们将会得到一个存有 3 个标记的列表 `['echo', '"Hello', 'World"']` 而不是 2 个标记 `['echo', 'Hello World']`。 - -幸运的是,Python 提供了一个名为 shlex 的库,能够帮助我们效验如神地分割命令。(提示:我们也可以使用正则表达式,但它不是本文的重点。) - - -``` -import sys -import shlex - -... - -def tokenize(string): - return shlex.split(string) - -... -``` - -然后我们将这些标记发送到执行过程。 - -### 步骤 3:执行 - -这是 shell 中核心和有趣的一部分。当 shell 执行 mkdir test_dir 时,发生了什么?(提示:midir 是一个带有 test_dir 参数的执行程序,用于创建一个名为 test_dir 的目录。) - -execvp 是涉及这一步的首个函数。在我们解释 execvp 所做的事之前,让我们看看它的实际效果。 - -``` -import os -... - -def execute(cmd_tokens): - # Execute command - os.execvp(cmd_tokens[0], cmd_tokens) - - # Return status indicating to wait for next command in shell_loop - return SHELL_STATUS_RUN - -... -``` - -再次尝试运行我们的 shell,并输入 `mkdir test_dir` 命令,接着按下回车键。 - -在我们敲下回车键之后,问题是我们的 shell 会直接退出而不是等待下一个命令。然而,目标正确地被创建。 - -因此,execvp 实际上做了什么? - -execvp 是系统调用 exec 的一个变体。第一个参数是程序名字。v 表示第二个参数是一个程序参数列表(可变参数)。p 表示环境变量 PATH 会被用于搜索给定的程序名字。在我们上一次的尝试中,可以在你的 PATH 环境变量查找到 mkdir 程序。 - -(还有其他 exec 变体,比如 execv、execvpe、execl、execlp、execlpe;你可以 google 它们获取更多的信息。) - -exec 会用即将运行的新进程替换调用进程的当前内存。在我们的例子中,我们的 shell 进程内存会被替换为 `mkdir` 程序。接着,mkdir 成为主进程并创建 test_dir 目录。最后该进程退出。 - -这里的重点在于我们的 shell 进程已经被 mkdir 进程所替换。这就是我们的 shell 消失且不会等待下一条命令的原因。 - -因此,我们需要其他的系统调用来解决问题:fork - -fork 会开辟新的内存并拷贝当前进程到一个新的进程。我们称这个新的进程为子进程,调用者进程为父进程。然后,子进程内存会被替换为被执行的程序。因此,我们的 shell,也就是父进程,可以免受内存替换的危险。 - -让我们看看已修改的代码。 - -``` -... - -def execute(cmd_tokens): - # Fork a child shell process - # If the current process is a child process, its `pid` is set to `0` - # else the current process is a parent process and the value of `pid` - # is the process id of its child process. - pid = os.fork() - - if pid == 0: - # Child process - # Replace the child shell process with the program called with exec - os.execvp(cmd_tokens[0], cmd_tokens) - elif pid > 0: - # Parent process - while True: - # Wait response status from its child process (identified with pid) - wpid, status = os.waitpid(pid, 0) - - # Finish waiting if its child process exits normally - # or is terminated by a signal - if os.WIFEXITED(status) or os.WIFSIGNALED(status): - break - - # Return status indicating to wait for next command in shell_loop - return SHELL_STATUS_RUN - -... -``` - -当我们的父进程调用 `os.fork()`时,你可以想象所有的源代码被拷贝到了新的子进程。此时此刻,父进程和子进程看到的是相同的代码,并且并行运行着。 - -如果运行的代码属于子进程,pid 将为 0。否则,如果运行的代码属于父进程,pid 将会是子进程的进程 id。 - -当 os.execvp 在子进程中被调用时,你可以想象子进程的所有源代码被替换为正被调用程序的代码。然而父进程的代码不会被改变。 - -当父进程完成等待子进程退出或终止时,它会返回一个状态,指示继续 shell 循环。 - -### 运行 - -现在,你可以尝试运行我们的 shell 并输入 mkdir test_dir2。它应该可以正确执行。我们的主 shell 进程仍然存在并等待下一条命令。尝试执行 ls,你可以看到已创建的目录。 - -但是,这里仍有许多问题。 - -第一,尝试执行 cd test_dir2,接着执行 ls。它应该会进入到一个空的 test_dir2 目录。然而,你将会看到目录没有变为 test_dir2。 - -第二,我们仍然没有办法优雅地退出我们的 shell。 - -我们将会在 [Part 2][1] 解决诸如此类的问题。 - - --------------------------------------------------------------------------------- - -via: https://hackercollider.com/articles/2016/07/05/create-your-own-shell-in-python-part-1/ - -作者:[Supasate Choochaisri][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://disqus.com/by/supasate_choochaisri/ -[1]: https://hackercollider.com/articles/2016/07/06/create-your-own-shell-in-python-part-2/ diff --git a/translated/tech/20160705 Create Your Own Shell in Python - Part I.md b/translated/tech/20160705 Create Your Own Shell in Python - Part I.md new file mode 100644 index 0000000000..b54d0bff29 --- /dev/null +++ b/translated/tech/20160705 Create Your Own Shell in Python - Part I.md @@ -0,0 +1,228 @@ +使用 Python 创建你自己的 Shell:Part I +========================================== + +我很想知道一个 shell (像 bash,csh 等)内部是如何工作的。为了满足自己的好奇心,我使用 Python 实现了一个名为 **yosh** (Your Own Shell)的 Shell。本文章所介绍的概念也可以应用于其他编程语言。 + +(提示:你可以在[这里](https://github.com/supasate/yosh)查找本博文使用的源代码,代码以 MIT 许可证发布。在 Mac OS X 10.11.5 上,我使用 Python 2.7.10 和 3.4.3 进行了测试。它应该可以运行在其他类 Unix 环境,比如 Linux 和 Windows 上的 Cygwin。) + +让我们开始吧。 + +### 步骤 0:项目结构 + +对于此项目,我使用了以下的项目结构。 + +``` +yosh_project +|-- yosh + |-- __init__.py + |-- shell.py +``` + +`yosh_project` 为项目根目录(你也可以把它简单命名为 `yosh`)。 + +`yosh` 为包目录,且 `__init__.py` 可以使它成为与包目录名字相同的包(如果你不写 Python,可以忽略它。) + +`shell.py` 是我们主要的脚本文件。 + +### 步骤 1:Shell 循环 + +当启动一个 shell,它会显示一个命令提示符并等待你的命令输入。在接收了输入的命令并执行它之后(稍后文章会进行详细解释),你的 shell 会重新回到循环,等待下一条指令。 + +在 `shell.py`,我们会以一个简单的 mian 函数开始,该函数调用了 shell_loop() 函数,如下: + +``` +def shell_loop(): + # Start the loop here + + +def main(): + shell_loop() + + +if __name__ == "__main__": + main() +``` + +接着,在 `shell_loop()`,为了指示循环是否继续或停止,我们使用了一个状态标志。在循环的开始,我们的 shell 将显示一个命令提示符,并等待读取命令输入。 + +``` +import sys + +SHELL_STATUS_RUN = 1 +SHELL_STATUS_STOP = 0 + + +def shell_loop(): + status = SHELL_STATUS_RUN + + while status == SHELL_STATUS_RUN: + # Display a command prompt + sys.stdout.write('> ') + sys.stdout.flush() + + # Read command input + cmd = sys.stdin.readline() +``` + +之后,我们切分命令输入并进行执行(我们即将实现`命令切分`和`执行`函数)。 + +因此,我们的 shell_loop() 会是如下这样: + +``` +import sys + +SHELL_STATUS_RUN = 1 +SHELL_STATUS_STOP = 0 + + +def shell_loop(): + status = SHELL_STATUS_RUN + + while status == SHELL_STATUS_RUN: + # Display a command prompt + sys.stdout.write('> ') + sys.stdout.flush() + + # Read command input + cmd = sys.stdin.readline() + + # Tokenize the command input + cmd_tokens = tokenize(cmd) + + # Execute the command and retrieve new status + status = execute(cmd_tokens) +``` + +这就是我们整个 shell 循环。如果我们使用 `python shell.py` 启动我们的 shell,它会显示命令提示符。然而如果我们输入命令并按回车,它会抛出错误,因为我们还没定义`命令切分`函数。 + +为了退出 shell,可以尝试输入 ctrl-c。稍后我将解释如何以优雅的形式退出 shell。 + +### 步骤 2:命令切分 + +当用户在我们的 shell 中输入命令并按下回车键,该命令将会是一个包含命令名称及其参数的很长的字符串。因此,我们必须切分该字符串(分割一个字符串为多个标记)。 + +咋一看似乎很简单。我们或许可以使用 `cmd.split()`,以空格分割输入。它对类似 `ls -a my_folder` 的命令起作用,因为它能够将命令分割为一个列表 `['ls', '-a', 'my_folder']`,这样我们便能轻易处理它们了。 + +然而,也有一些类似 `echo "Hello World"` 或 `echo 'Hello World'` 以单引号或双引号引用参数的情况。如果我们使用 cmd.spilt,我们将会得到一个存有 3 个标记的列表 `['echo', '"Hello', 'World"']` 而不是 2 个标记的列表 `['echo', 'Hello World']`。 + +幸运的是,Python 提供了一个名为 `shlex` 的库,它能够帮助我们效验如神地分割命令。(提示:我们也可以使用正则表达式,但它不是本文的重点。) + + +``` +import sys +import shlex + +... + +def tokenize(string): + return shlex.split(string) + +... +``` + +然后我们将这些标记发送到执行进程。 + +### 步骤 3:执行 + +这是 shell 中核心和有趣的一部分。当 shell 执行 `mkdir test_dir` 时,到底发生了什么?(提示: `mkdir` 是一个带有 `test_dir` 参数的执行程序,用于创建一个名为 `test_dir` 的目录。) + +`execvp` 是涉及这一步的首个函数。在我们解释 `execvp` 所做的事之前,让我们看看它的实际效果。 + +``` +import os +... + +def execute(cmd_tokens): + # Execute command + os.execvp(cmd_tokens[0], cmd_tokens) + + # Return status indicating to wait for next command in shell_loop + return SHELL_STATUS_RUN + +... +``` + +再次尝试运行我们的 shell,并输入 `mkdir test_dir` 命令,接着按下回车键。 + +在我们敲下回车键之后,问题是我们的 shell 会直接退出而不是等待下一个命令。然而,目标正确地被创建。 + +因此,`execvp` 实际上做了什么? + +`execvp` 是系统调用 `exec` 的一个变体。第一个参数是程序名字。`v` 表示第二个参数是一个程序参数列表(可变参数)。`p` 表示环境变量 `PATH` 会被用于搜索给定的程序名字。在我们上一次的尝试中,它将会基于我们的 `PATH` 环境变量查找`mkdir` 程序。 + +(还有其他 `exec` 变体,比如 execv、execvpe、execl、execlp、execlpe;你可以 google 它们获取更多的信息。) + +`exec` 会用即将运行的新进程替换调用进程的当前内存。在我们的例子中,我们的 shell 进程内存会被替换为 `mkdir` 程序。接着,`mkdir` 成为主进程并创建 `test_dir` 目录。最后该进程退出。 + +这里的重点在于**我们的 shell 进程已经被 `mkdir` 进程所替换**。这就是我们的 shell 消失且不会等待下一条命令的原因。 + +因此,我们需要其他的系统调用来解决问题:`fork`。 + +`fork` 会开辟新的内存并拷贝当前进程到一个新的进程。我们称这个新的进程为**子进程**,调用者进程为**父进程**。然后,子进程内存会被替换为被执行的程序。因此,我们的 shell,也就是父进程,可以免受内存替换的危险。 + +让我们看看修改的代码。 + +``` +... + +def execute(cmd_tokens): + # Fork a child shell process + # If the current process is a child process, its `pid` is set to `0` + # else the current process is a parent process and the value of `pid` + # is the process id of its child process. + pid = os.fork() + + if pid == 0: + # Child process + # Replace the child shell process with the program called with exec + os.execvp(cmd_tokens[0], cmd_tokens) + elif pid > 0: + # Parent process + while True: + # Wait response status from its child process (identified with pid) + wpid, status = os.waitpid(pid, 0) + + # Finish waiting if its child process exits normally + # or is terminated by a signal + if os.WIFEXITED(status) or os.WIFSIGNALED(status): + break + + # Return status indicating to wait for next command in shell_loop + return SHELL_STATUS_RUN + +... +``` + +当我们的父进程调用 `os.fork()`时,你可以想象所有的源代码被拷贝到了新的子进程。此时此刻,父进程和子进程看到的是相同的代码,且并行运行着。 + +如果运行的代码属于子进程,`pid` 将为 `0`。否则,如果运行的代码属于父进程,`pid` 将会是子进程的进程 id。 + +当 `os.execvp` 在子进程中被调用时,你可以想象子进程的所有源代码被替换为正被调用程序的代码。然而父进程的代码不会被改变。 + +当父进程完成等待子进程退出或终止时,它会返回一个状态,指示继续 shell 循环。 + +### 运行 + +现在,你可以尝试运行我们的 shell 并输入 `mkdir test_dir2`。它应该可以正确执行。我们的主 shell 进程仍然存在并等待下一条命令。尝试执行 `ls`,你可以看到已创建的目录。 + +但是,这里仍有许多问题。 + +第一,尝试执行 `cd test_dir2`,接着执行 `ls`。它应该会进入到一个空的 `test_dir2` 目录。然而,你将会看到目录并没有变为 `test_dir2`。 + +第二,我们仍然没有办法优雅地退出我们的 shell。 + +我们将会在 [Part 2][1] 解决诸如此类的问题。 + + +-------------------------------------------------------------------------------- + +via: https://hackercollider.com/articles/2016/07/05/create-your-own-shell-in-python-part-1/ + +作者:[Supasate Choochaisri][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://disqus.com/by/supasate_choochaisri/ +[1]: https://hackercollider.com/articles/2016/07/06/create-your-own-shell-in-python-part-2/ From 4cd961ced359ddd54ed620f95a5e16f718c9872a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=AE=B6=E5=90=AF?= Date: Wed, 13 Jul 2016 16:41:30 +0800 Subject: [PATCH 1146/1469] Translated by cposture (#4181) * Translated by cposture * Translating by cposture * translating partly * translating partly 75 * Translated by cposture * Translated by cposture --- ...reate Your Own Shell in Python - Part I.md | 227 ----------------- ...reate Your Own Shell in Python - Part I.md | 228 ++++++++++++++++++ 2 files changed, 228 insertions(+), 227 deletions(-) delete mode 100644 sources/tech/20160705 Create Your Own Shell in Python - Part I.md create mode 100644 translated/tech/20160705 Create Your Own Shell in Python - Part I.md diff --git a/sources/tech/20160705 Create Your Own Shell in Python - Part I.md b/sources/tech/20160705 Create Your Own Shell in Python - Part I.md deleted file mode 100644 index 48e84381c8..0000000000 --- a/sources/tech/20160705 Create Your Own Shell in Python - Part I.md +++ /dev/null @@ -1,227 +0,0 @@ -Translating by cposture 2016.07.09 -Create Your Own Shell in Python : Part I - -I’m curious to know how a shell (like bash, csh, etc.) works internally. So, I implemented one called yosh (Your Own SHell) in Python to answer my own curiosity. The concept I explain in this article can be applied to other languages as well. - -(Note: You can find source code used in this blog post here. I distribute it with MIT license.) - -Let’s start. - -### Step 0: Project Structure - -For this project, I use the following project structure. - -``` -yosh_project -|-- yosh - |-- __init__.py - |-- shell.py -``` - -`yosh_project` is the root project folder (you can also name it just `yosh`). - -`yosh` is the package folder and `__init__.py` will make it a package named the same as the package folder name. (If you don’t write Python, just ignore it.) - -`shell.py` is our main shell file. - -### Step 1: Shell Loop - -When you start a shell, it will show a command prompt and wait for your command input. After it receives the command and executes it (the detail will be explained later), your shell will be back to the wait loop for your next command. - -In `shell.py`, we start by a simple main function calling the shell_loop() function as follows: - -``` -def shell_loop(): - # Start the loop here - - -def main(): - shell_loop() - - -if __name__ == "__main__": - main() -``` - -Then, in our `shell_loop()`, we use a status flag to indicate whether the loop should continue or stop. In the beginning of the loop, our shell will show a command prompt and wait to read command input. - -``` -import sys - -SHELL_STATUS_RUN = 1 -SHELL_STATUS_STOP = 0 - - -def shell_loop(): - status = SHELL_STATUS_RUN - - while status == SHELL_STATUS_RUN: - # Display a command prompt - sys.stdout.write('> ') - sys.stdout.flush() - - # Read command input - cmd = sys.stdin.readline() -``` - -After that, we tokenize the command input and execute it (we’ll implement the tokenize and execute functions soon). - -Therefore, our shell_loop() will be the following. - -``` -import sys - -SHELL_STATUS_RUN = 1 -SHELL_STATUS_STOP = 0 - - -def shell_loop(): - status = SHELL_STATUS_RUN - - while status == SHELL_STATUS_RUN: - # Display a command prompt - sys.stdout.write('> ') - sys.stdout.flush() - - # Read command input - cmd = sys.stdin.readline() - - # Tokenize the command input - cmd_tokens = tokenize(cmd) - - # Execute the command and retrieve new status - status = execute(cmd_tokens) -``` - -That’s all of our shell loop. If we start our shell with python shell.py, it will show the command prompt. However, it will throw an error if we type a command and hit enter because we don’t define tokenize function yet. - -To exit the shell, try ctrl-c. I will tell how to exit gracefully later. - -### Step 2: Tokenization - -When a user types a command in our shell and hits enter. The command input will be a long string containing both a command name and its arguments. Therefore, we have to tokenize it (split a string into several tokens). - -It seems simple at first glance. We might use cmd.split() to separate the input by spaces. It works well for a command like `ls -a my_folder` because it splits the command into a list `['ls', '-a', 'my_folder']` which we can use them easily. - -However, there are some cases that some arguments are quoted with single or double quotes like `echo "Hello World"` or `echo 'Hello World'`. If we use cmd.split(), we will get a list of 3 tokens `['echo', '"Hello', 'World"']` instead of 2 tokens `['echo', 'Hello World']`. - -Fortunately, Python provides a library called shlex that helps us split like a charm. (Note: we can also use regular expression but it’s not the main point of this article.) - -``` -import sys -import shlex - -... - -def tokenize(string): - return shlex.split(string) - -... -``` - -Then, we will send these tokens to the execution process. - -### Step 3: Execution - -This is the core and fun part of a shell. What happened when a shell executes mkdir test_dir? (Note: mkdir is a program to be executed with arguments test_dir for creating a directory named test_dir.) - -The first function involved in this step is execvp. Before I explain what execvp does, let’s see it in action. - -``` -import os -... - -def execute(cmd_tokens): - # Execute command - os.execvp(cmd_tokens[0], cmd_tokens) - - # Return status indicating to wait for next command in shell_loop - return SHELL_STATUS_RUN - -... -``` - -Try running our shell again and input a command `mkdir test_dir`, then, hit enter. - -The problem is, after we hit enter, our shell exits instead of waiting for the next command. However, the directory is correctly created. - -So, what execvp really does? - -execvp is a variant of a system call exec. The first argument is the program name. The v indicates the second argument is a list of program arguments (variable number of arguments). The p indicates the PATH environment will be used for searching for the given program name. In our previous attempt, the mkdir program was found based on your PATH environment variable. - -(There are other variants of exec such as execv, execvpe, execl, execlp, execlpe; you can google them for more information.) - -exec replaces the current memory of a calling process with a new process to be executed. In our case, our shell process memory was replaced by `mkdir` program. Then, mkdir became the main process and created the test_dir directory. Finally, its process exited. - -The main point here is that our shell process was replaced by mkdir process already. That’s the reason why our shell disappeared and did not wait for the next command. - -Therefore, we need another system call to rescue: fork. - -fork will allocate new memory and copy the current process into a new process. We called this new process as child process and the caller process as parent process. Then, the child process memory will be replaced by a execed program. Therefore, our shell, which is a parent process, is safe from memory replacement. - -Let’s see our modified code. - -``` -... - -def execute(cmd_tokens): - # Fork a child shell process - # If the current process is a child process, its `pid` is set to `0` - # else the current process is a parent process and the value of `pid` - # is the process id of its child process. - pid = os.fork() - - if pid == 0: - # Child process - # Replace the child shell process with the program called with exec - os.execvp(cmd_tokens[0], cmd_tokens) - elif pid > 0: - # Parent process - while True: - # Wait response status from its child process (identified with pid) - wpid, status = os.waitpid(pid, 0) - - # Finish waiting if its child process exits normally - # or is terminated by a signal - if os.WIFEXITED(status) or os.WIFSIGNALED(status): - break - - # Return status indicating to wait for next command in shell_loop - return SHELL_STATUS_RUN - -... -``` - -When the parent process call `os.fork()`, you can imagine that all source code is copied into a new child process. At this point, the parent and child process see the same code and run in parallel. - -If the running code is belong to the child process, pid will be 0. Else, the running code is belong to the parent process, pid will be the process id of the child process. - -When os.execvp is invoked in the child process, you can imagine like all the source code of the child process is replaced by the code of a program that is being called. However, the code of the parent process is not changed. - -When the parent process finishes waiting its child process to exit or be terminated, it returns the status indicating to continue the shell loop. - -### Run - -Now, you can try running our shell and enter mkdir test_dir2. It should work properly. Our main shell process is still there and waits for the next command. Try ls and you will see the created directories. - -However, there are some problems here. - -First, try cd test_dir2 and then ls. It’s supposed to enter the directory test_dir2 which is an empty directory. However, you will see that the directory was not changed into test_dir2. - -Second, we still have no way to exit from our shell gracefully. - -We will continue to solve such problems in [Part 2][1]. - - --------------------------------------------------------------------------------- - -via: https://hackercollider.com/articles/2016/07/05/create-your-own-shell-in-python-part-1/ - -作者:[Supasate Choochaisri][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://disqus.com/by/supasate_choochaisri/ -[1]: https://hackercollider.com/articles/2016/07/06/create-your-own-shell-in-python-part-2/ diff --git a/translated/tech/20160705 Create Your Own Shell in Python - Part I.md b/translated/tech/20160705 Create Your Own Shell in Python - Part I.md new file mode 100644 index 0000000000..b54d0bff29 --- /dev/null +++ b/translated/tech/20160705 Create Your Own Shell in Python - Part I.md @@ -0,0 +1,228 @@ +使用 Python 创建你自己的 Shell:Part I +========================================== + +我很想知道一个 shell (像 bash,csh 等)内部是如何工作的。为了满足自己的好奇心,我使用 Python 实现了一个名为 **yosh** (Your Own Shell)的 Shell。本文章所介绍的概念也可以应用于其他编程语言。 + +(提示:你可以在[这里](https://github.com/supasate/yosh)查找本博文使用的源代码,代码以 MIT 许可证发布。在 Mac OS X 10.11.5 上,我使用 Python 2.7.10 和 3.4.3 进行了测试。它应该可以运行在其他类 Unix 环境,比如 Linux 和 Windows 上的 Cygwin。) + +让我们开始吧。 + +### 步骤 0:项目结构 + +对于此项目,我使用了以下的项目结构。 + +``` +yosh_project +|-- yosh + |-- __init__.py + |-- shell.py +``` + +`yosh_project` 为项目根目录(你也可以把它简单命名为 `yosh`)。 + +`yosh` 为包目录,且 `__init__.py` 可以使它成为与包目录名字相同的包(如果你不写 Python,可以忽略它。) + +`shell.py` 是我们主要的脚本文件。 + +### 步骤 1:Shell 循环 + +当启动一个 shell,它会显示一个命令提示符并等待你的命令输入。在接收了输入的命令并执行它之后(稍后文章会进行详细解释),你的 shell 会重新回到循环,等待下一条指令。 + +在 `shell.py`,我们会以一个简单的 mian 函数开始,该函数调用了 shell_loop() 函数,如下: + +``` +def shell_loop(): + # Start the loop here + + +def main(): + shell_loop() + + +if __name__ == "__main__": + main() +``` + +接着,在 `shell_loop()`,为了指示循环是否继续或停止,我们使用了一个状态标志。在循环的开始,我们的 shell 将显示一个命令提示符,并等待读取命令输入。 + +``` +import sys + +SHELL_STATUS_RUN = 1 +SHELL_STATUS_STOP = 0 + + +def shell_loop(): + status = SHELL_STATUS_RUN + + while status == SHELL_STATUS_RUN: + # Display a command prompt + sys.stdout.write('> ') + sys.stdout.flush() + + # Read command input + cmd = sys.stdin.readline() +``` + +之后,我们切分命令输入并进行执行(我们即将实现`命令切分`和`执行`函数)。 + +因此,我们的 shell_loop() 会是如下这样: + +``` +import sys + +SHELL_STATUS_RUN = 1 +SHELL_STATUS_STOP = 0 + + +def shell_loop(): + status = SHELL_STATUS_RUN + + while status == SHELL_STATUS_RUN: + # Display a command prompt + sys.stdout.write('> ') + sys.stdout.flush() + + # Read command input + cmd = sys.stdin.readline() + + # Tokenize the command input + cmd_tokens = tokenize(cmd) + + # Execute the command and retrieve new status + status = execute(cmd_tokens) +``` + +这就是我们整个 shell 循环。如果我们使用 `python shell.py` 启动我们的 shell,它会显示命令提示符。然而如果我们输入命令并按回车,它会抛出错误,因为我们还没定义`命令切分`函数。 + +为了退出 shell,可以尝试输入 ctrl-c。稍后我将解释如何以优雅的形式退出 shell。 + +### 步骤 2:命令切分 + +当用户在我们的 shell 中输入命令并按下回车键,该命令将会是一个包含命令名称及其参数的很长的字符串。因此,我们必须切分该字符串(分割一个字符串为多个标记)。 + +咋一看似乎很简单。我们或许可以使用 `cmd.split()`,以空格分割输入。它对类似 `ls -a my_folder` 的命令起作用,因为它能够将命令分割为一个列表 `['ls', '-a', 'my_folder']`,这样我们便能轻易处理它们了。 + +然而,也有一些类似 `echo "Hello World"` 或 `echo 'Hello World'` 以单引号或双引号引用参数的情况。如果我们使用 cmd.spilt,我们将会得到一个存有 3 个标记的列表 `['echo', '"Hello', 'World"']` 而不是 2 个标记的列表 `['echo', 'Hello World']`。 + +幸运的是,Python 提供了一个名为 `shlex` 的库,它能够帮助我们效验如神地分割命令。(提示:我们也可以使用正则表达式,但它不是本文的重点。) + + +``` +import sys +import shlex + +... + +def tokenize(string): + return shlex.split(string) + +... +``` + +然后我们将这些标记发送到执行进程。 + +### 步骤 3:执行 + +这是 shell 中核心和有趣的一部分。当 shell 执行 `mkdir test_dir` 时,到底发生了什么?(提示: `mkdir` 是一个带有 `test_dir` 参数的执行程序,用于创建一个名为 `test_dir` 的目录。) + +`execvp` 是涉及这一步的首个函数。在我们解释 `execvp` 所做的事之前,让我们看看它的实际效果。 + +``` +import os +... + +def execute(cmd_tokens): + # Execute command + os.execvp(cmd_tokens[0], cmd_tokens) + + # Return status indicating to wait for next command in shell_loop + return SHELL_STATUS_RUN + +... +``` + +再次尝试运行我们的 shell,并输入 `mkdir test_dir` 命令,接着按下回车键。 + +在我们敲下回车键之后,问题是我们的 shell 会直接退出而不是等待下一个命令。然而,目标正确地被创建。 + +因此,`execvp` 实际上做了什么? + +`execvp` 是系统调用 `exec` 的一个变体。第一个参数是程序名字。`v` 表示第二个参数是一个程序参数列表(可变参数)。`p` 表示环境变量 `PATH` 会被用于搜索给定的程序名字。在我们上一次的尝试中,它将会基于我们的 `PATH` 环境变量查找`mkdir` 程序。 + +(还有其他 `exec` 变体,比如 execv、execvpe、execl、execlp、execlpe;你可以 google 它们获取更多的信息。) + +`exec` 会用即将运行的新进程替换调用进程的当前内存。在我们的例子中,我们的 shell 进程内存会被替换为 `mkdir` 程序。接着,`mkdir` 成为主进程并创建 `test_dir` 目录。最后该进程退出。 + +这里的重点在于**我们的 shell 进程已经被 `mkdir` 进程所替换**。这就是我们的 shell 消失且不会等待下一条命令的原因。 + +因此,我们需要其他的系统调用来解决问题:`fork`。 + +`fork` 会开辟新的内存并拷贝当前进程到一个新的进程。我们称这个新的进程为**子进程**,调用者进程为**父进程**。然后,子进程内存会被替换为被执行的程序。因此,我们的 shell,也就是父进程,可以免受内存替换的危险。 + +让我们看看修改的代码。 + +``` +... + +def execute(cmd_tokens): + # Fork a child shell process + # If the current process is a child process, its `pid` is set to `0` + # else the current process is a parent process and the value of `pid` + # is the process id of its child process. + pid = os.fork() + + if pid == 0: + # Child process + # Replace the child shell process with the program called with exec + os.execvp(cmd_tokens[0], cmd_tokens) + elif pid > 0: + # Parent process + while True: + # Wait response status from its child process (identified with pid) + wpid, status = os.waitpid(pid, 0) + + # Finish waiting if its child process exits normally + # or is terminated by a signal + if os.WIFEXITED(status) or os.WIFSIGNALED(status): + break + + # Return status indicating to wait for next command in shell_loop + return SHELL_STATUS_RUN + +... +``` + +当我们的父进程调用 `os.fork()`时,你可以想象所有的源代码被拷贝到了新的子进程。此时此刻,父进程和子进程看到的是相同的代码,且并行运行着。 + +如果运行的代码属于子进程,`pid` 将为 `0`。否则,如果运行的代码属于父进程,`pid` 将会是子进程的进程 id。 + +当 `os.execvp` 在子进程中被调用时,你可以想象子进程的所有源代码被替换为正被调用程序的代码。然而父进程的代码不会被改变。 + +当父进程完成等待子进程退出或终止时,它会返回一个状态,指示继续 shell 循环。 + +### 运行 + +现在,你可以尝试运行我们的 shell 并输入 `mkdir test_dir2`。它应该可以正确执行。我们的主 shell 进程仍然存在并等待下一条命令。尝试执行 `ls`,你可以看到已创建的目录。 + +但是,这里仍有许多问题。 + +第一,尝试执行 `cd test_dir2`,接着执行 `ls`。它应该会进入到一个空的 `test_dir2` 目录。然而,你将会看到目录并没有变为 `test_dir2`。 + +第二,我们仍然没有办法优雅地退出我们的 shell。 + +我们将会在 [Part 2][1] 解决诸如此类的问题。 + + +-------------------------------------------------------------------------------- + +via: https://hackercollider.com/articles/2016/07/05/create-your-own-shell-in-python-part-1/ + +作者:[Supasate Choochaisri][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://disqus.com/by/supasate_choochaisri/ +[1]: https://hackercollider.com/articles/2016/07/06/create-your-own-shell-in-python-part-2/ From 4526db9b0b542be19dc2e2d018d852630870aab7 Mon Sep 17 00:00:00 2001 From: Mike Tang Date: Wed, 13 Jul 2016 17:15:35 +0800 Subject: [PATCH 1147/1469] sources/tech/20160708 Using Vagrant to control your DigitalOcean cloud instances.md --- ...sing Vagrant to control your DigitalOcean cloud instances.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160708 Using Vagrant to control your DigitalOcean cloud instances.md b/sources/tech/20160708 Using Vagrant to control your DigitalOcean cloud instances.md index e24e381b38..5a0e1ffda0 100644 --- a/sources/tech/20160708 Using Vagrant to control your DigitalOcean cloud instances.md +++ b/sources/tech/20160708 Using Vagrant to control your DigitalOcean cloud instances.md @@ -1,3 +1,5 @@ +MikeCoder Translating... + Using Vagrant to control your DigitalOcean cloud instances ========================================================= From 86b788968cb3ebd800af02a994f31b30d0f12ab9 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 12 Jul 2016 13:18:34 +0800 Subject: [PATCH 1148/1469] PUB:20160218 What do Linux developers think of Git and GitHub @mudongliang --- ...inux developers think of Git and GitHub.md | 110 ++++++++++++++++++ ...inux developers think of Git and GitHub.md | 93 --------------- 2 files changed, 110 insertions(+), 93 deletions(-) create mode 100644 published/20160218 What do Linux developers think of Git and GitHub.md delete mode 100644 translated/tech/20160218 What do Linux developers think of Git and GitHub.md diff --git a/published/20160218 What do Linux developers think of Git and GitHub.md b/published/20160218 What do Linux developers think of Git and GitHub.md new file mode 100644 index 0000000000..1824c6e19e --- /dev/null +++ b/published/20160218 What do Linux developers think of Git and GitHub.md @@ -0,0 +1,110 @@ +Linux 开发者如何看待 Git 和 Github? +===================================================== + +### Linux 开发者如何看待 Git 和 Github? + +Git 和 Github 在 Linux 开发者中有很高的知名度。但是开发者如何看待它们呢?另外,Github 是不是真的和 Git 是一个意思?一个 Linux reddit 用户最近问到了这个问题,并且得到了很有意思的答案。 + +Dontwakemeup46 提问: + +> 我正在学习 Git 和 Github。我感兴趣社区如何看待两者?据我所知,Git 和 Github 应用十分广泛。但是 Git 或 Github 有没有严重的不足?社区喜欢去改变些什么呢? + +[更多见 Reddit](https://www.reddit.com/r/linux/comments/45jy59/the_popularity_of_git_and_github/) + +与他志同道合的 Linux reddit 用户回答了他们对于 Git 和 Github的观点: + +>**Derenir**: “Github 并不附属于 Git。 + +> Git 是由 Linus Torvalds 开发的。 + +> Github 几乎不支持 Linux。 + +> Github 是一家企图借助 Git 赚钱的公司。 + +> https://desktop.github.com/ 并没有支持 Linux。” + +--- +>**Bilog78**: “一个小的补充: Linus Torvalds 已经不再维护 Git了。维护者是 Junio C Hamano,以及 在他之后的主要贡献者是 Jeff King 和 Shawn O. Pearce。” + +--- + +>**Fearthefuture**: “我喜欢 Git,但是不明白人们为什么还要使用 Github。从我的角度,Github 比 Bitbucket 好的一点是用户统计和更大的用户基础。Bitbucket 有无限的免费私有库,更好的 UI,以及更好地集成了其他服务,比如说 Jenkins。” + +--- + +>**Thunger**: “Gitlab.com 也很不错,特别是你可以在自己的服务器上架设自己的实例。” + +--- + +>**Takluyver**: “很多人熟悉 Github 的 UI 以及相关联的服务,比如说 Travis 。并且很多人都有 Github 账号,所以它是存储项目的一个很好的地方。人们也使用他们的 Github 个人信息页作为一种求职用的作品选辑,所以他们很积极地将更多的项目放在这里。Github 是一个存放开源项目的事实标准。” + +--- + +>**Tdammers**: “Git 严重问题在于 UI,它有些违反直觉,以至于很多用户只能达到使用一些容易记住的咒语的程度。” + +> Github:最严重的问题在于它是商业托管的解决方案;你买了方便,但是代价是你的代码在别人的服务器上面,已经不在你的掌控范围之内了。另一个对于 Github 的普遍批判是它的工作流和 Git 本身的精神不符,特别是 pull requests 工作的方式。最后, Github 垄断了代码的托管环境,同时对于多样性是很不好的,这反过来对于旺盛的免费软件社区很重要。” + +--- + +>**Dies**: “更重要的是,如果一旦是这样,按照现状来说,我猜我们会被 Github 所困,因为它们控制如此多的项目。” + +--- + +>**Tdammers**: “代码托管在别人的服务器上,这里"别人"指的是 Github。这对于开源项目来说,并不是什么太大的问题,但是尽管如此,你无法控制它。如果你在 Github 上有私有项目,“它将保持私有”的唯一的保险只是 Github 的承诺而已。如果你决定删除东西,你不能确定东西是否被删除了,或者只是隐藏了。 + +Github 并不自己控制这些项目(你总是可以拿走你的代码,然后托管到别的地方,声明新位置是“官方”的),它只是有比开发者本身有更深的使用权。” + +--- + +>**Drelos**: “我已经读了大量的关于 Github 的赞美与批评。(这里有一个[例子](http://www.wired.com/2015/06/problem-putting-worlds-code-github/)),但是我的幼稚问题是为什么不向一个免费开源的版本努力呢?” + +--- + +>**Twizmwazin**: “Gitlab 的源码就存在这里” + +--- + +[更多见 Reddit](https://www.reddit.com/r/linux/comments/45jy59/the_popularity_of_git_and_github/) + +### DistroWatch 评估 XStream 桌面 153 版本 + +XStreamOS 是一个由 Sonicle 创建的 Solaris 的一个版本。XStream 桌面将 Solaris 的强大带给了桌面用户,同时新手用户很可能有兴趣体验一下。DistroWatch 对于 XStream 桌面 153 版本做了一个很全面的评估,并且发现它运行相当好。 + +Jesse Smith 为 DistroWatch 报道: + +> 我认为 XStream 桌面做好了很多事情。诚然,当操作系统无法在我的硬件上启动,同时当运行在 VirtualBox 中时我无法使得桌面使用我显示器的完整分辨率,我的开端并不很成功。不过,除此之外,XStream 表现的很好。安装器工作的很好,该系统自动设置和使用了引导环境(boot environments),这让我们可以在发生错误时恢复该系统。包管理器有工作的不错, XStream 带了一套有用的软件。 + +> 我确实在播放多媒体文件时遇见一些问题,特别是使声卡工作。我不确定这是不是又一个硬件兼容问题,或者是该操作系统自带的多媒体软件的问题。另一方面,像 Web 浏览器,电子邮件,生产工具套件以及配置工具这样的工作的很好。 + +> 我最欣赏 XStream 的地方是这个操作系统是 OpenSolaris 家族的一个使用保持最新的分支。OpenSolaris 的其他衍生系统有落后的倾向,但是至少在桌面软件上,XStream 搭载最新版本的火狐和 LibreOffice。 + +> 对我个人来说,XStream 缺少一些组件,比如打印机管理器,多媒体支持和我的特定硬件的驱动。这个操作系统的其他方面也是相当吸引人的。我喜欢开发者搭配了 LXDE,也喜欢它的默认软件集,以及我最喜欢文件系统快照和启动环境开箱即用的方式。大多数的 Linux 发行版,openSUSE 除外,并没有利用好引导环境(boot environments)的用途。我希望它是一个被更多项目采用的技术。 + +[更多见 DistroWatch](http://distrowatch.com/weekly.php?issue=20160215#xstreamos) + +### 街头霸王 V 和 SteamOS + +街头霸王是最出名的游戏之一,并且 [Capcom 已经宣布](http://steamcommunity.com/games/310950/announcements/detail/857177755595160250) 街头霸王 V 将会在这个春天进入 Linux 和 StreamOS。这对于 Linux 游戏者是非常好的消息。 + +Joe Parlock 为 Destructoid 报道: + +> 你是不足 1% 的那些在 Linux 系统上玩游戏的 Stream 用户吗?你是更少数的那些在 Linux 平台上玩游戏,同时也很喜欢街头霸王 V 的人之一吗?是的话,我有一些好消息要告诉你。 + +> Capcom 已经宣布,这个春天街头霸王 V 通过 Stream 进入 StreamOS 以及其他 Linux 发行版。它无需任何额外的花费,所以那些已经在自己的个人电脑上安装了该游戏的人可以很容易在 Linux 上安装它并玩了。 + +[更多 Destructoid](https://www.destructoid.com/street-fighter-v-is-coming-to-linux-and-steamos-this-spring-341531.phtml) + +你是否错过了摘要?检查 [开源之眼的主页](http://www.infoworld.com/blog/eye-on-open/) 来获得关于 Linux 和开源的最新的新闻。 + +------------------------------------------------------------------------------ + +via: http://www.infoworld.com/article/3033059/linux/what-do-linux-developers-think-of-git-and-github.html + +作者:[Jim Lynch][a] +译者:[mudongliang](https://github.com/mudongliang) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.infoworld.com/author/Jim-Lynch/ + diff --git a/translated/tech/20160218 What do Linux developers think of Git and GitHub.md b/translated/tech/20160218 What do Linux developers think of Git and GitHub.md deleted file mode 100644 index a0eb63506e..0000000000 --- a/translated/tech/20160218 What do Linux developers think of Git and GitHub.md +++ /dev/null @@ -1,93 +0,0 @@ -Linux 开发者如何看待 Git 和 Github? -===================================================== - -**同样在今日的开源摘要: DistroWatch 评估 XStream 桌面 153 版本,街头霸王 V 即将在这个春天进入 Linux 和 SteamOS** - -## Linux 开发者如何看待 Git 和 Github? - -Git 和 Github 在 Linux 开发者中有很高的知名度。但是开发者如何看待它们呢?另外,Github 是不是真的和 Git 是一个意思?一个 Linux reddit 用户最近问到了这个问题,并且得到了很有意思的答案。 - -Dontwakemeup46 提问: - -> 我正在学习 Git 和 Github。我感兴趣的是社区如何看待两者?据我所知,Git 和 Github 应用十分广泛。但是 Git 或 Github 有没有严重的,社区喜欢去修改的问题呢? - -[更多见 Reddit](http://api.viglink.com/api/click?format=go&jsonp=vglnk_145580413015211&key=0a7039c08493c7c51b759e3d13019dbe&libId=iksc5hc8010113at000DL3yrsuvp7&loc=http%3A%2F%2Fwww.infoworld.com%2Farticle%2F3033059%2Flinux%2Fwhat-do-linux-developers-think-of-git-and-github.html&v=1&out=https%3A%2F%2Fwww.reddit.com%2Fr%2Flinux%2Fcomments%2F45jy59%2Fthe_popularity_of_git_and_github%2F&ref=http%3A%2F%2Fwww.linux.com%2Fnews%2Fsoftware%2Fapplications%2F886008-what-do-linux-developers-think-of-git-and-github&title=What%20do%20Linux%20developers%20think%20of%20Git%20and%20GitHub%3F%20%7C%20InfoWorld&txt=More%20at%20Reddit) - -与他志同道合的 Linux reddit 用户回答了他们对于 Git 和 Github的想法: - ->Derenir: “Github 并不隶属于 Git。 - ->Git 是由 Linus Torvalds 开发的。 - ->Github 几乎不支持 Linux。 - ->Github 是一家唯利是图的,企图借助 Git 赚钱的公司。 - ->[https://desktop.github.com/](http://api.viglink.com/api/click?format=go&jsonp=vglnk_145580415025712&key=0a7039c08493c7c51b759e3d13019dbe&libId=iksc5hc8010113at000DL3yrsuvp7&loc=http%3A%2F%2Fwww.infoworld.com%2Farticle%2F3033059%2Flinux%2Fwhat-do-linux-developers-think-of-git-and-github.html&v=1&type=U&out=https%3A%2F%2Fdesktop.github.com%2F&ref=http%3A%2F%2Fwww.linux.com%2Fnews%2Fsoftware%2Fapplications%2F886008-what-do-linux-developers-think-of-git-and-github&title=What%20do%20Linux%20developers%20think%20of%20Git%20and%20GitHub%3F%20%7C%20InfoWorld&txt=https%3A%2F%2Fdesktop.github.com%2F) 并没有支持 Linux。” - ->**Bilog78**: “一个简单的更新: Linus Torvalds 已经不再维护 Git了。维护者是 Junio C Hamano,以及 Linus 之后的主要贡献者是Jeff King 和 Shawn O. Pearce。” - ->**Fearthefuture**: “我喜欢 Git,但是不明白人们为什么还要使用 Github。从我的角度,Github 比 Bitbucket 好的一点是用户统计和更大的用户基础。Bitbucket 有无限的免费私有库,更好的 UI,以及更好地继承其他服务,比如说 Jenkins。” - ->**Thunger**: “Gitlab.com 也很不错,特别是你可以在自己的服务器上架设自己的实例。” - ->**Takluyver**: “很多人熟悉 Github 的 UI 以及相关联的服务,像 Travis 。并且很多人都有 Github 账号,所以它是一个很好地存储项目的地方。人们也使用他们的 Github 简况作为一种求职用的作品选辑,所以他们很积极地将更多的项目放在这里。Github 是一个事实上的,存放开源项目的标准。” - ->**Tdammers**: “Git 严重问题在于 UI,它有些违反直觉,到很多用户只使用一些容易记住的咒语程度。” - -Github:最严重的问题在于它是私人拥有的解决方案;你买了方便,但是代价是你的代码在别人的服务器上面,已经不在你的掌控范围之内了。另一个对于 Github 的普遍批判是它的工作流和 Git 本身的精神不符,特别是 pull requests 工作的方式。最后, Github 垄断代码的托管环境,同时对于多样性是很不好的,这反过来对于旺盛的免费软件社区很重要。” - ->**Dies**: “更重要的是,如果一旦是这样,做过的都做过了,并且我猜我们会被 Github 所困,因为它们控制如此多的项目。” - ->**Tdammers**: “代码托管在别人的服务器上,别人指的是 Github。这对于开源项目来说,并不是什么太大的问题,但是仍然,你无法控制它。如果你在 Github 上有私有项目,唯一的保险在于它将保持私有是 Github 的承诺。如果你决定删除东西,你不能确定东西是否被删除了,或者只是隐藏了。 - -Github 并不自己控制这些项目(你总是可以拿走你的代码,然后托管到别的地方,声明新位置是“官方”的),它只是有比开发者本身有更深的使用权。” - ->**Drelos**: “我已经读了大量的关于 Github 的赞美与批评。(这里有一个[例子](http://api.viglink.com/api/click?format=go&jsonp=vglnk_145580428524613&key=0a7039c08493c7c51b759e3d13019dbe&libId=iksc5hc8010113at000DL3yrsuvp7&loc=http%3A%2F%2Fwww.infoworld.com%2Farticle%2F3033059%2Flinux%2Fwhat-do-linux-developers-think-of-git-and-github.html&v=1&out=http%3A%2F%2Fwww.wired.com%2F2015%2F06%2Fproblem-putting-worlds-code-github%2F&ref=http%3A%2F%2Fwww.linux.com%2Fnews%2Fsoftware%2Fapplications%2F886008-what-do-linux-developers-think-of-git-and-github&title=What%20do%20Linux%20developers%20think%20of%20Git%20and%20GitHub%3F%20%7C%20InfoWorld&txt=here%27s%20an%20example)),但是我的新手问题是为什么不向一个免费开源的版本努力呢?” - ->**Twizmwazin**: “Gitlab 的源码就存在这里” - -[更多见 Reddit](http://api.viglink.com/api/click?format=go&jsonp=vglnk_145580429720714&key=0a7039c08493c7c51b759e3d13019dbe&libId=iksc5hc8010113at000DL3yrsuvp7&loc=http%3A%2F%2Fwww.infoworld.com%2Farticle%2F3033059%2Flinux%2Fwhat-do-linux-developers-think-of-git-and-github.html&v=1&out=https%3A%2F%2Fwww.reddit.com%2Fr%2Flinux%2Fcomments%2F45jy59%2Fthe_popularity_of_git_and_github%2F&ref=http%3A%2F%2Fwww.linux.com%2Fnews%2Fsoftware%2Fapplications%2F886008-what-do-linux-developers-think-of-git-and-github&title=What%20do%20Linux%20developers%20think%20of%20Git%20and%20GitHub%3F%20%7C%20InfoWorld&txt=More%20at%20Reddit) - -## DistroWatch 评估 XStream 桌面 153 版本 - -XStreamOS 是一个由 Sonicle 创建的 Solaris 的一个版本。XStream 桌面将 Solaris 的强大带给了桌面用户,同时新手用户很可能有兴趣体验一下。DistroWatch 对于 XStream 桌面 153 版本做了一个很全面的评估,并且发现它运行相当好。 - -Jesse Smith 为 DistroWatch 报道: - -> 我认为 XStream 桌面做好了很多事情。无可否认地,我的实验陷入了头晕目眩的状态当操作系统无法在我的硬件上启动。同时,当运行在 VirtualBox 中我无法使得桌面使用我显示器的完整分辨率。 - -> 我确实在播放多媒体文件时遇见一些问题,特别是使声卡工作。我不确定是不是另外一个硬件兼容问题,或者一个关于操作系统自带的多媒体软件的问题。另一方面,像 Web 浏览器,电子邮件,生产工具套件以及配置工具这样的工作都工作的很好。 - -> 我最欣赏 XStream 的地方是这个操作系统是 OpenSolaris 家族的一个使用保持最新的分支。OpenSolaris 的其他衍生系统有落后的倾向,至少在桌面软件上,但是 XStream 仍然搭载最新版本的火狐和 LibreOffice。 - ->对我个人来说,XStream 缺少一些组件,比如打印机管理器,多媒体支持和我特定硬件的驱动。这个操作系统的其他方面也是相当吸引人的。我喜欢开发者搭建 LXDE 的方式,软件的默认组合,以及我最喜欢文件系统快照和启动环境开箱即用的方式。大多数的 Linux 发行版,openSUSE 除外,并没有使得启动环境的有用性流行起来。我希望它是一个被更多项目采用的技术。 - -[更多见 DistroWatch](http://api.viglink.com/api/click?format=go&jsonp=vglnk_145580434172315&key=0a7039c08493c7c51b759e3d13019dbe&libId=iksc5hc8010113at000DL3yrsuvp7&loc=http%3A%2F%2Fwww.infoworld.com%2Farticle%2F3033059%2Flinux%2Fwhat-do-linux-developers-think-of-git-and-github.html&v=1&out=http%3A%2F%2Fdistrowatch.com%2Fweekly.php%3Fissue%3D20160215%23xstreamos&ref=http%3A%2F%2Fwww.linux.com%2Fnews%2Fsoftware%2Fapplications%2F886008-what-do-linux-developers-think-of-git-and-github&title=What%20do%20Linux%20developers%20think%20of%20Git%20and%20GitHub%3F%20%7C%20InfoWorld&txt=More%20at%20DistroWatch) - -## 街头霸王 V 和 SteamOS - -街头霸王是最出名的游戏之一,并且 [Capcom 已经宣布](http://api.viglink.com/api/click?format=go&jsonp=vglnk_145580435418216&key=0a7039c08493c7c51b759e3d13019dbe&libId=iksc5hc8010113at000DL3yrsuvp7&loc=http%3A%2F%2Fwww.infoworld.com%2Farticle%2F3033059%2Flinux%2Fwhat-do-linux-developers-think-of-git-and-github.html&v=1&out=http%3A%2F%2Fsteamcommunity.com%2Fgames%2F310950%2Fannouncements%2Fdetail%2F857177755595160250&ref=http%3A%2F%2Fwww.linux.com%2Fnews%2Fsoftware%2Fapplications%2F886008-what-do-linux-developers-think-of-git-and-github&title=What%20do%20Linux%20developers%20think%20of%20Git%20and%20GitHub%3F%20%7C%20InfoWorld&txt=Capcom%20has%20announced) 街头霸王 V 将会在这个春天进入 Linux 和 StreamOS。这对于 Linux 游戏者是非常好的消息。 - -Joe Parlock 为 Destructoid 报道: - ->你是少于 1% 的,在 Linux 系统上玩游戏的 Stream 用户吗?你是更少百分比的,在 Linux 平台上玩游戏,同时很喜欢街头霸王 V 的人之一吗?是的话,我有一些好消息要告诉你。 - ->Capcom 已经宣布,这个春天街头霸王 V 通过 Stream 进入 StreamOS 以及其他 Linux 发行版。它无需任何额外的成本,所以那些已经个人电脑建立的游戏的人可以很容易在 Linux 上安装它,并且运行良好。 - -[更多 Destructoid](http://api.viglink.com/api/click?format=go&jsonp=vglnk_145580435418216&key=0a7039c08493c7c51b759e3d13019dbe&libId=iksc5hc8010113at000DL3yrsuvp7&loc=http%3A%2F%2Fwww.infoworld.com%2Farticle%2F3033059%2Flinux%2Fwhat-do-linux-developers-think-of-git-and-github.html&v=1&out=http%3A%2F%2Fsteamcommunity.com%2Fgames%2F310950%2Fannouncements%2Fdetail%2F857177755595160250&ref=http%3A%2F%2Fwww.linux.com%2Fnews%2Fsoftware%2Fapplications%2F886008-what-do-linux-developers-think-of-git-and-github&title=What%20do%20Linux%20developers%20think%20of%20Git%20and%20GitHub%3F%20%7C%20InfoWorld&txt=Capcom%20has%20announced) - -你是否错过了摘要?检查 [Eye On Open home page](http://www.infoworld.com/blog/eye-on-open/) 来获得关于 Linux 和开源的最新的新闻。 - ------------------------------------------------------------------------------- - -via: http://www.infoworld.com/article/3033059/linux/what-do-linux-developers-think-of-git-and-github.html - -作者:[Jim Lynch][a] -译者:[mudongliang](https://github.com/mudongliang) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.infoworld.com/author/Jim-Lynch/ - From 039c403c225967381e061c1f18ca212f62b0232d Mon Sep 17 00:00:00 2001 From: ezio Date: Wed, 13 Jul 2016 21:17:55 +0800 Subject: [PATCH 1149/1469] recyle --- ...er Tools With Wercker’s Open Source CLI.md | 80 ------- .../20160314 15 podcasts for FOSS fans.md | 79 ------- sources/tech/20160314 Healthy Open Source.md | 212 ------------------ 3 files changed, 371 deletions(-) delete mode 100644 sources/tech/20160222 Achieving Enterprise-Ready Container Tools With Wercker’s Open Source CLI.md delete mode 100644 sources/tech/20160314 15 podcasts for FOSS fans.md delete mode 100644 sources/tech/20160314 Healthy Open Source.md diff --git a/sources/tech/20160222 Achieving Enterprise-Ready Container Tools With Wercker’s Open Source CLI.md b/sources/tech/20160222 Achieving Enterprise-Ready Container Tools With Wercker’s Open Source CLI.md deleted file mode 100644 index 81f7467719..0000000000 --- a/sources/tech/20160222 Achieving Enterprise-Ready Container Tools With Wercker’s Open Source CLI.md +++ /dev/null @@ -1,80 +0,0 @@ -Achieving Enterprise-Ready Container Tools With Wercker’s Open Source CLI -=========================================== - -For enterprises, containers offer more efficient build environments, cloud-native applications and migration from legacy systems to the cloud. But enterprise adoption of the technology -- Docker specifically -- has been hampered by, among other issues, [a lack of mature developer tools][1]. - -Amsterdam-based [Wercker][2] is one of many early-stage companies looking to meet the need for better tools with its cloud platform for automating microservices and application development, based on Docker. - -The company [announced a $4.5 million Series A][3] funding round this month, which will help it ramp up development on an upcoming on-premise enterprise product. Key to its success, however, will be building a community around its newly [open-sourced CLI][4] tool. Wercker must quickly integrate with myriad other container technologies -- open source Kubernetes and Mesos among them -- to remain competitive in the evolving container space. - -“By open sourcing our CLI technology, we hope to get to dev-prod parity faster and turn “build once, ship anywhere” into an automated reality,” said Wercker CEO and founder Micha Hernández van Leuffen. - -I reached out to van Leuffen to learn more about the company, its CLI tool, and how it’s planning to help grow the pool of enterprise customers actually using containers in production. Below is an edited version of the interview. - -### Linux.com: Can you briefly tell us about Wercker? - -van Leuffen: Wercker is a container-centric platform for automating the development of microservices and applications. - -With Wercker’s Docker-based infrastructure, teams can increase developer velocity with custom automation pipelines using steps that produce containers as artifacts. Once the build passes, users can continue to deploy the steps as specified in the wercker.yml. Continuously repeating these steps allows teams to work in small increments, making it easy to debug and ship faster. - -![](https://www.linux.com/images/stories/66866/wercker-cli.png) - -### Linux.com: How does it help developers? - -van Leuffen: The Wercker CLI helps developers attain greater dev-prod parity. They’re able to release faster and more often because they are developing, building and testing in an environment very similar to that in production. We’ve open sourced the exact same program that we execute in the Wercker cloud platform to run your pipelines. - -### Linux.com: Can you point out some of the features and advantages of your tool as compared to competitors? - -van Leuffen: Unlike some of our competitors, we’re not just offering Docker support. With Wercker, the Docker container is the unit of work. All jobs run inside containers, and each build artifact can be a Docker container. - -Wercker’s Docker container pipeline is completely customizable. A ‘pipeline’ refers to any automated workflow, for instance, a build or deploy pipeline. In those workflows, you want to execute tasks: install dependencies, test your code, push your container, or create a slack notification when something fails, for example. We call these tasks ‘steps,’ and there is no limit to the types of steps created. In fact, we have a marketplace of steps built by the Wercker community. So if you’ve built a step that fits my workflow, I can use that in my pipeline. - -Our Docker container pipelines adapt to any developer workflow. Users can use any Docker container out there — not just those made by or for Wercker. Whether the container is on Docker Hub or a private registry such as CoreOS’s Quay, it works with Wercker. - -Our competitors range from the classic CI/CD tools to larger-scale DevOps solutions like CloudBees. - -### Linux.com: How does it integrate with other cloud technologies? - -van Leuffen: Wercker is vendor-agnostic and can automate development with any cloud platform or service. We work closely with ecosystem partners like Mesosphere, Kubernetes and CoreOS to make integrations as seamless as possible. We also recently partnered with Atlassian to integrate the Wercker platform with Bitbucket. More than 3 million Bitbucket users can install the Wercker Pipeline Viewer and view build status directly from their dashboard. - -### Linux.com: Why did you open source the Wercker CLI tool? - -van Leuffen: Open sourcing the Wercker CLI will help us stay ahead of the curve and strengthen the developer community. The market landscape is changing fast; developers are expected to release more frequently, using infrastructure of increasing complexity. While Docker has solved a lot of infrastructure problems, developer teams are still looking for the perfect tools to test, build and deploy rapidly. - -The Wercker community is already experimenting with these new tools: Kubernetes, Mesosphere, CoreOS. It makes sense to tap that community to create integrations that work with our technology – and make that process as frictionless as possible. By open sourcing our CLI technology, we hope to get to dev-prod parity faster and turn “build once, ship anywhere” into an automated reality. - -### Linux.com: You recently raised over $4.5 million, so how is this fund being used for product development? - -van Leuffen: We’re focused on building out our commercial team and bringing an enterprise product to market. We’ve had a lot of inbound interest from the enterprise looking for VPC and on-premise solutions. While the enterprise is still largely in the discovery stage, we can see the market shifting toward containers. Enterprise software devs need to release often, just like the small, agile teams with whom they are increasingly competing. We need to prove containers can scale, and that Wercker has the organizational permissions and the automation suite to make that process as efficient as possible. - -In addition to continuing to invest in our product, we’ll be focusing our resources on market education and developer evangelism. Developer teams are still looking for the right mix of tools to test, build and deploy rapidly (including Kubernetes, Mesosphere, CoreOS, etc.). As an ecosystem, we need to do more to educate and provide the tutorials and resources to help developers succeed in this changing landscape. - -### Linux.com: What products do you offer and who is your target audience? - -van Leuffen: We currently offer one service level of our product Wercker; however, we’re developing an enterprise offering. Current organizations using Wercker range from startups, such as Open Listings, to larger companies and big agencies, like Pivotal Labs. - - -### Linux.com: What does this recently open-sourced CLI do? - -van Leuffen: Using the Wercker Command Line Interface (CLI), developers can spin up Docker containers on their desktop, automate their build and deploy processes and then deploy them to various cloud providers, like AWS, and scheduler and orchestration platforms, such as Mesosphere and Kubernetes. - -The Wercker Command Line Interface is available as an open source project on GitHub and runs on both OSX and Linux machines. - - --------------------------------------------------------------------------------- - -via: https://www.linux.com/news/enterprise/systems-management/887177-achieving-enterprise-ready-container-tools-with-werckers-open-source-cli - -作者:[Swapnil Bhartiya][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.linux.com/community/forums/person/61003 -[1]:http://thenewstack.io/adopting-containers-enterprise/ -[2]:http://wercker.com/ -[3]:http://venturebeat.com/2016/01/28/wercker-raises-4-5-million-open-sources-its-command-line-tool/ -[4]:https://github.com/wercker/wercker - - diff --git a/sources/tech/20160314 15 podcasts for FOSS fans.md b/sources/tech/20160314 15 podcasts for FOSS fans.md deleted file mode 100644 index 222861427e..0000000000 --- a/sources/tech/20160314 15 podcasts for FOSS fans.md +++ /dev/null @@ -1,79 +0,0 @@ -15 podcasts for FOSS fans -============================= - -keyword : FOSS , podcast - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/oss_podcasts.png?itok=3KwxsunX) - -I listen to a lot of podcasts. A lot. On my phone's podcatcher, I am subscribed to around 60 podcasts... and I think that only eight of those have podfaded (died). Unsurprisingly, a fairly sizeable proportion of those remaining alive-and-well subscriptions are shows with a specific interest or relevance to open source software. As I seek to resurrect my own comatose podcast from the nebulous realm of podfadery, I thought it would be great for us as a community to share what we're listening to. - ->Quick digression: I understand that there are a lot of "pod"-prefixed words in that first paragraph. Furthermore, I also know that the term itself is related to a proprietary device that, by most accounts, isn't even used for listening to these web-based audio broadcasts. However, the term 'webcast' died in the nineties and 'oggcast' never gathered a substantial foothold among the listening public. As such, in order to ensure that the most people actually know what I'm referring to, I'm essentially forced to use the web-anachronistic, but publicly recognized term, podcast. - -I should also mention that a number of these shows involve grown-ups using grown-up language (i.e. swearing). I've tried to indicate which shows these are by putting a red E next to their names, but please do your own due diligence if you're concerned about listening to these shows at work or with children around. - -The following lists are podcasts that I keep in heavy rotation (each sublist is listed in alphabetical order). In the first list are the ones I think of as my "general coverage" shows. They tend to either discuss general topics related to free and open source software, or they give a survey of multiple open source projects from one episode to the next. - -- [Bad Voltage][1] E — Regular contributor and community moderator here on Opensource.com, Jono Bacon, shares hosting dutes on this podcast with Jeremy Garcia, Stuart Langridge, and Bryan Lunduke, four friends with a variety of digressing and intersecting opinions. That's the most interesting part of the show for me. Of course, they also do product reviews and cover timely news relevant to free and open source software, but it's the banter that I stick around for. - -- [FLOSS Weekly][2] — The Twit network of podcasts is a long-time standby in technology broadcasts. Hosted by Randal Schwartz, FLOSS Weekly focuses on covering one open source project each week, typically by interviewing someone relevant in the development of that project. It's a really good show for getting exposed to new open source tools... or learning more about the programs you're already familiar with. - -- [Free as in Freedom][3] — Hosted by Bradley Kuhn and Karen Sandler, this show has a specific focus on legal and policy matters as it relates to both specific free and open source projects, as well as open culture in general. The show seems to have gone on a bit of a hiatus since its last episode in November of 2015, but I for one am immensely hopeful that Free as in Freedom emerges victoriously from its battle with being podfaded and returns to its regular bi-weekly schedule. - -- [GNU World Order][4] — I think that this show can be best descrbed as a free and open source variety show. Solo host, Klaatu, spends the majority of each show going in-depth at nearly tutorial level with a whole range of specific software tools and workflows. It's a really friendly way to get an open source neophyte up to speed with everything from understanding SSH to playing with digital painting and video. And there's a video component to the show, too, which certainly helps make some of these topics easier to follow. - -- [Hacker Public Radio][5] — This is just a well-executed version of a fantastic concept. Hacker Public Radio (HPR) is a community-run daily (well, working-week daily) podcast with a focus on "anything of interest to hackers." Sure there are wide swings in audio quality from show to show, but it's an open platform where anyone can share what they know (or what they think) in that topic space. Show topics include 3D printing, hardware hacking, conference interviews, and more. There are even long-running tutorial series and an audio book club. The monthly recap episodes are particularly useful if you're having trouble picking a place to start. And best of all, you can record your own episode and add it to the schedule. In fact, they actively encourage it. - -My next list of open source podcasts are a bit more specific to particular topics or software packages in the free and open source ecosystem. - -- [Blender Podcast][6] — Although this podcast is very specific to one particular application—Blender, in case you couldn't guess—many of the topics are relevant to issues faced by users and developers of open source other softrware programs. Hosts Thomas Dinges and Campbell Barton—both on the core development team for Blender—discuss the latest happenings in the Blender community, sometimes with a guest. The release schedule is a bit sporadic, but one of the things I really like about this particular show is the fact that they talk about both user issues and developer issues... and the various intersections of the two. It's a great way for each part of the community to gain insight from the other. - -- [Sunday Morning Linux Review][7] — As it's name indicates, SMLR offers a weekly review of topics relevant to Linux. Since around the end of last year, the show has seen a bit of a restructuring. However, that has not detracted from its quality. Tony Bemus, Mary Tomich, and Tom Lawrence deliver a lot of good information, and you can catch them recording their shows live through their website (if you happen to have free time on your Sundays). - -- [LinuxLUGcast][8] — The LinuxLUGcast is a community podcast that's really a recording of an online Linux Users Group (LUG) that meets on the first and third Friday of each month. The group meets (and records) via Mumble and discussions range from home builds with single-board computers like the Raspberry Pi to getting help with trying out a new distro. The LUG is open to everyone, but there is a rotating cast of regulars who've made themselves (and their IRC handles) recognizable fixtures on the show. (Full disclosure: I'm a regular on this one) - -- [The Open EdTech Podcast][9] — Thaj Sara's Open EdTech Podcast is a fairly new show that so far only has three episodes. However, since there's a really sizeable community of open source users in the field of education (both in teaching and in IT), this show serves an important and underserved segment of our community. I've spoken with Thaj via email and he assures me that new episodes are in the pipe. He just needs to set aside the time to edit them. - -- [The Linux Action Show][10] — It would be remiss of me to make a list of open source podcasts and not mention one of the stallwart fixtures in the space: The Linux Action Show. Chris Fisher and Noah Chelliah discuss current news as it pertains to Linux and open source topics while at the same time giving feature attention to specific projects or their own experiences using various open source tools. - -This next section is what I'm going to term my "honorable mention" section. These shows are either new or have a more tangential focus on open source software and culture. In any case, I still think readers of Opensource.com would enjoy listening to these shows. - -- [Blender Institute Podcast][11] — The Blender Institute—the more commercial creative production spin-off from the Blender Foundation—started hosting their own weekly podcast a few months ago. In the show, artists (and now a developer!) working at the Institute discuss the open content projects they're working on, answer questions about using Blender, and give great insight into how things go (or occasionally don't go) in their day-to-day work. - -- [Geek News Radio][12] E — There was a tangible sense of loss about a year ago when the hosts of Linux Outlaws hung up their mics. Well good news! A new show has sprung from its ashes. In episodes of Geek News Radio, Fab Scherschel and Dave Nicholas have a wider focus than Linux Outlaws did. Rather than being an actual news podcast, it's more akin to an informal discussion among friends about video games, movies, technology, and open source (of course). - -- [Geekrant][13] — Formerly known as the Everyday Linux Podcast, this show was rebranded at the start of the year to reflect kind of content that the hosts Mark Cockrell, Seth Anderson, and Chris Neves were already discussing. They do discuss open source software and culture, but they also give their own spin and opinions on topics of interest in general geek culture. Topics have a range that includes everything from popular media to network security. (P.S. Opensource.com content manager Jen Wike Huger was a guest on Episode 164.) - -- [Open Source Creative][14] E — In case you haven't read my little bio blurb, I also have my own podcast. In this show, I talk about news and topics that are [hopefully] of interest to artists and creatives who use free and open source tools. I record it during my work commute so episode length varies with traffic, and I haven't quite figured out a good way to do interviews safely, but if you listen while you're on your way to work, it'll be like we're carpooling. The show has been on a bit of hiatus for almost a year, but I've commited to making sure it comes back... and soon. - -- [Still Untitled][15] E — As you may have noticed from most of the selections on this list, I tend to lean toward the indie side of the spectrum, preferring to listen to shows by people with less of a "name." That said, this show really hits a good place for me. Hosts Adam Savage, Norman Chan, and Will Smith talk about all manner of interesting and geeky things. From Adam's adventures with Mythbusters to maker builds and book reviews, there's rarely ever a show that hasn't been fun for me to listen to. - -So there you go! I'm always looking for more interesting shows to listen to on my commute (as I'm sure many others are). What suggestions or recommendations do you have? - - - --------------------------------------------------------------------------------- - -via: https://opensource.com/life/16/3/open-source-podcasts - -作者:[Jason van Gumster][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jason-van-gumster -[1]: http://badvoltage.org/ -[2]: https://twit.tv/shows/floss-weekly -[3]: http://faif.us/ -[4]: http://gnuworldorder.info/ -[5]: http://hackerpublicradio.org/ -[6]: https://blender-podcast.org/ -[7]: http://smlr.us/ -[8]: http://linuxlugcast.com/ -[9]: http://openedtechpodcast.com/ -[10]: http://www.jupiterbroadcasting.com/tag/linux-action-show/ -[11]: http://podcast.blender.institute/ -[12]: http://sixgun.org/geeknewsradio -[13]: http://elementopie.com/geekrant-episodes -[14]: http://monsterjavaguns.com/podcast -[15]: http://www.tested.com/still-untitled-the-adam-savage-project/ diff --git a/sources/tech/20160314 Healthy Open Source.md b/sources/tech/20160314 Healthy Open Source.md deleted file mode 100644 index b36b516758..0000000000 --- a/sources/tech/20160314 Healthy Open Source.md +++ /dev/null @@ -1,212 +0,0 @@ -Healthy Open Source -============================ - -keyword: Node.js , opensource , project management , software - -*A walkthrough of the Node.js Foundation’s base contribution policy*. - -A lot has changed since io.js and Node.js merged under the Node.js Foundation. The most impressive change, and probably the change that is most relevant to the rest of the community and to open source in general, is the growth in contributors and committers to the project. - -A few years ago, Node.js had just a few committers (contributors with write access to the repository in order to merge code and triage bugs). The maintenance overhead for the few committers on Node.js Core was overwhelming and the project began to see a decline in both committers and outside contribution. This resulted in a corresponding decline in releases. - -Today, the Node.js project is divided into many components with a full org size of well over 400 members. Node.js Core now has over 50 committers and over 100 contributors per month. - -Through this growth we’ve found many tools that help scale the human infrastructure around an Open Source project. We also identified a few core values we believe are fundamental to modern Open Source: transparency, participation, and efficacy. As we continue to scale the way we do Open Source we try to find a balance of these values and adapt the practices we find help to fit the needs of each component of the Node.js project. - -Now that Node.js is in a good place, the foundation is looking to promote this kind of sustainability in the ecosystem. Part of this is a new umbrella for additional projects to enter the foundation, of which [Express was recently admitted][1], and the creation of this new contribution policy. - -This contribution policy is not universal. It’s meant as a starting point. Additions and alterations to this policy are encouraged so that the process used by each project fits its needs and can continue to change shape as the project grows and faces new challenges. - -The [current version][2] is hosted in the Node.js Foundation. We expect to iterate on this over time and encourage people to [log issues][3] with questions and feedback regarding the policy for future iterations. - -This document describes a very simple process suitable for most projects in the Node.js ecosystem. Projects are encouraged to adopt this whether they are hosted in the Node.js Foundation or not. - -The Node.js project is organized into over a hundred repositories and a few dozen Working Groups. There are large variations in contribution policy between many of these components because each one has different constraints. This document is a minimalist version of the processes and philosophy we’ve found works best everywhere. - -We believe that contributors should own their projects, and that includes contribution policies like this. While new foundation projects start with this policy we expect many of them to alter it or possibly diverge from it entirely to suite their own specific needs. - -The goal of this document is to create a contribution process that: - -* Encourages new contributions. - -* Encourages contributors to remain involved. - -* Avoids unnecessary processes and bureaucracy whenever possible. - -* Creates a transparent decision making process which makes it clear how contributors can be involved in decision making. - -Most contribution processes are created by maintainers who feel overwhelmed by outside contributions. These documents have traditionally been about processes that make life easier for a small group of maintainers, often at the cost of attracting new contributors. - -We’ve gone the opposite direction. The purpose of this policy is to gain contributors, to retain them as much as possible, and to use a much larger and growing contributor base to manage the corresponding influx of contributions. - -As projects mature, there’s a tendency to become top heavy and overly hierarchical as a means of quality control and this is enforced through process. We use process to add transparency that encourages participation which grows the code review pool which leads to better quality control. - -This document is based on much prior art in the Node.js community, io.js, and the Node.js project. - -This document is based on what we’ve learned growing the Node.js project. Not just the core project, which has been a massive undertaking, but also much smaller sub-projects like the website which have very different needs and, as a result, very different processes. - -When we began these reforms in the Node.js project, we were taking a lot of inspiration from the broader Node.js ecosystem. In particular, Rod Vagg’s [OPEN Open Source policy][4]. Rod’s work in levelup and nan is the basis for what we now call “liberal contribution policies.” - -### Vocabulary - -* A **Contributor** is any individual creating or commenting on an issue or pull request. - -* A **Committer** is a subset of contributors who have been given write access to the repository. - -* A **TC (Technical Committee)** is a group of committers representing the required technical expertise to resolve rare disputes. - -Every person who shows up to comment on an issue or submit code is a member of a project’s community. Just being able to see them means that they have crossed the line from being a user to being a contributor. - -Typically open source projects have had a single distinction for those that have write access to the repository and those empowered with decision making. We’ve found this to be inadequate and have separated this into two distinctions which we’ll dive into more a bit later. - -![](https://www.linux.com/images/stories/66866/healthy_1.png) - -healthy 1Looking at the community in and around a project as a bunch of concentric circles helps to visualize this. - -In the outermost circle are users, a subset of those users are contributors, a subset of contributors become committers who can merge code and triage issues. Finally, a smaller group of trusted experts who only get pulled in to the hard problems and can act as a tie-breaker in disputes. - -This is what a healthy project should look like. As the demands on the project from increased users rise, so do the contributors, and as contributors increase more are converted into committers. As the committer base grows, more of them rise to the level of expertise where they should be involved in higher level decision making. - -![](https://www.linux.com/images/stories/66866/healthy-2.png) - -If these groups don’t grow in proportion to each other they can’t carry the load imposed on them by outward growth. A project’s ability to convert people from each of these groups is the only way it can stay healthy if its user base is growing. - -This is what unhealthy projects look like in their earliest stages of dysfunction, but imagine that the committers bubble is so small you can’t actually read the word “committers” in it, and imagine this is a logarithmic scale. - -healthy-2A massive user base is pushing a lot of contributions onto a very small number of maintainers. - -This is when maintainers build processes and barriers to new contributions as a means to manage the workload. Often the problems the project is facing will be attributed to the tools the project is using, especially GitHub. - -In Node.js we had all the same problems, resolved them without a change in tooling, and today manage a growing workload much larger than most projects, and GitHub has not been a bottleneck. - -We know what happens to unhealthy projects over a long enough time period, more maintainers leave, contributions eventually fall, and **if we’re lucky** users leave it. When we aren’t so lucky adoption continues and years later we’re plagued with security and stability issues in widely adopt software that can’t be effectively maintained. - -The number of users a project has is a poor indicator of the health of the project, often it is the most used software that suffers the biggest contribution crisis. - -### Logging - -Log an issue for any question or problem you might have. When in doubt, log an issue, any additional policies about what to include will be provided in the responses. The only exception is security disclosures which should be sent privately. - -The first sentence is surprisingly controversial. A lot of maintainers complain that there isn’t a more heavy handed way of forcing people to read a document before they log an issue on GitHub. We have documents all over projects in the Node.js Foundation about writing good bug reports but, first and foremost, we encourage people to log something and try to avoid putting barriers in the way of that. - -Sure, we get bad bugs, but we have a ton of contributors who can immediately work with people who log them to educate them on better practices and treat it as an opportunity to educate. This is why we have documentation on writing good bugs, in order to educate contributors, not as a barrier to entry. - -Creating barriers to entry just reduces the number of people there’s a chance to identify, educate and potentially grow into greater contributors. - -Of course, never log a public issue about a security disclosure, ever. This is a bit vague about the best private venue because we can’t determine that for every project that adopts this policy, but we’re working on a responsible disclosure mechanism for the broader community (stay tuned). - -Committers may direct you to another repository, ask for additional clarifications, and add appropriate metadata before the issue is addressed. - -For smaller projects this isn’t a big deal but in Node.js we’ve had to continually break off work into other, more specific, repositories just to keep the volume on a single repo manageable. But all anyone has to do when someone puts something in the wrong place is direct them to the right one. - -Another benefit of growing the committer base is that there’s more people to deal with little things, like redirecting issues to other repos, or adding metadata to issues and PRs. This allows developers who are more specialized to focus on just a narrow subset of work rather than triaging issues. - -Please be courteous, respectful, and every participant is expected to follow the project’s Code of Conduct. - -One thing that can burn out a project is when people show up with a lot of hostility and entitlement. Most of the time this sentiment comes from a feeling that their input isn’t valued. No matter what, a few people will show up who are used to more hostile environments and it’s good to have these kinds of expectations explicit and written down. - -And each project should have a Code of Conduct, which is an extension of these expectations that makes people feel safe and respected. - -### Contributions - -Any change to resources in this repository must be through pull requests. This applies to all changes to documentation, code, binary files, etc. Even long term committers and TC members must use pull requests. - -No pull request can be merged without being reviewed. - -Every change needs to be a pull request. - -A Pull Request captures the entire discussion and review of a change. Allowing some subset of committers to slip things in without a Pull Request gives the impression to potential contributors that they they can’t be involved in the project because they don’t have access to a behind the scenes process or culture. - -This isn’t just a good practice, it’s a necessity in order to be transparent enough to attract new contributors. - -For non-trivial contributions, pull requests should sit for at least 36 hours to ensure that contributors in other timezones have time to review. Consideration should also be given to weekends and other holiday periods to ensure active committers all have reasonable time to become involved in the discussion and review process if they wish. - -Part of being open and inviting to more contributors is making the process accessible to people in timezones all over the world. We don’t want to add an artificial delay in small doc changes but for any change that needs a bit of consideration needs to give people in different parts of the world time to consider it. - -In Node.js we actually have an even longer timeline than this, 48 hours on weekdays and 72 on weekends. That might be too much for smaller projects so it is shorter in this base policy but as a project grows it may want to increase this as well. - -The default for each contribution is that it is accepted once no committer has an objection. During review committers may also request that a specific contributor who is most versed in a particular area gives a “LGTM” before the PR can be merged. There is no additional “sign off” process for contributions to land. Once all issues brought by committers are addressed it can be landed by any committer. - -A key part of the liberal contribution policies we’ve been building is an inversion of the typical code review process. Rather than the default mode for a change to be rejected until enough people sign off, we make the default for every change to land. This puts the onus on reviewers to note exactly what adjustments need to be made in order for it to land. - -For new contributors it’s a big leap just to get that initial code up and sent. Viewing the code review process as a series of small adjustments and education, rather than a quality control hierarchy, does a lot to encourage and retain these new contributors. - -It’s important not to build processes that encourage a project to be too top heavy, with a few people needing to sign off on every change. Instead, we just mention any committer than we think should weigh in on a specific review. In Node.js we have people who are the experts on OpenSSL, any change to crypto is going to need a LGTM from them. This kind of expertise forms naturally as a project grows and this is a good way to work with it without burning people out. - -In the case of an objection being raised in a pull request by another committer, all involved committers should seek to arrive at a consensus by way of addressing concerns being expressed by discussion, compromise on the proposed change, or withdrawal of the proposed change. - -This is what we call a lazy consensus seeking process. Most review comments and adjustments are uncontroversial and the process should optimize for getting them in without unnecessary process. When there is disagreement, try to reach an easy consensus among the committers. More than 90% of the time this is simple, easy and obvious. - -If a contribution is controversial and committers cannot agree about how to get it to land or if it should land then it should be escalated to the TC. TC members should regularly discuss pending contributions in order to find a resolution. It is expected that only a small minority of issues be brought to the TC for resolution and that discussion and compromise among committers be the default resolution mechanism. - -For the minority of changes that are controversial and don’t reach an easy consensus we escalate that to the TC. These are rare but when they do happen it’s good to reach a resolution quickly rather than letting things fester. Contentious issues tend to get a lot of attention, especially by those more casually involved in the project or even entirely outside of it, but they account for a relatively small amount of what the project does every day. - -### Becoming a Committer - -All contributors who land a non-trivial contribution should be on-boarded in a timely manner, and added as a committer, and be given write access to the repository. - -This is where we diverge sharply from open source tradition. - -Projects have historically guarded commit rights to their version control system. This made a lot of sense when we were using version control systems like subversion. A single contributor can inadvertently mess up a project pretty badly in older version control systems, but not so much in git. In git, there isn’t a lot that can’t be fixed and so most of the quality controls we put on guarding access are no longer necessary. - -Not every committer has the rights to release or make high level decisions, so we can be much more liberal about giving out commit rights. That increases the committer base for code review and bug triage. As a wider range of expertise in the committer pool smaller changes are reviewed and adjusted without the intervention of the more technical contributors, who can spend their time on reviews only they can do. - -This is they key to scaling contribution growth: committer growth. - -Committers are expected to follow this policy and continue to send pull requests, go through proper review, and have other committers merge their pull requests. - -This part is entirely redundant, but on purpose. Just a reminder even once someone is a committer their changes still flow through the same process they followed before. - -### TC Process - -The TC uses a “consensus seeking” process for issues that are escalated to the TC. The group tries to find a resolution that has no open objections among TC members. If a consensus cannot be reached that has no objections then a majority wins vote is called. It is also expected that the majority of decisions made by the TC are via a consensus seeking process and that voting is only used as a last-resort. - -The best solution tends to be the one everyone can agree to so you would think that consensus systems would be the norm. However, **pure consensus** systems incentivize obstructionism which we need to avoid. - -In pure consensus everyone essentially has a veto. So, if I don’t want something to happen I’m in a strong position of power over everyone that wants something to happen. They have to convince me, and I don’t have to convince anyone else of anything. - -To avoid this we use a system called “consensus seeking” which has a long history outside of open source. It’s quite simple, just attempt to reach a consensus, if a consensus can’t be reached then call for a majority wins vote. - -Just the fact that a vote **is a possibility** means that people can’t be obstructionists, whether someone favor a change or not, they have to convince their peers and if they aren’t willing to put in the work to convince their peers then they probably don’t involve themselves in that decision at all. - -The way these incentives play out is pretty impressive. We started using this process in io.js and adopted it in Node.js when we merged into the foundation. In that entire time we’ve never actually had to call for a vote, just the fact that we could is enough to keep everyone working together to find a solution and move forward. - -Resolution may involve returning the issue to committers with suggestions on how to move forward towards a consensus. It is not expected that a meeting of the TC will resolve all issues on its agenda during that meeting and may prefer to continue the discussion happening among the committers. - -A TC tries to resolve things in a timely manner so that people can make progress but often it’s better to provide some additional guidance that pushes the greater contributorship towards resolution without being heavy handed. - -Avoid creating big decision hierarchies. Instead, invest in a broad, growing and empowered contributorship that can make progress without intervention. We need to view a constant need for intervention by a few people to make any and every tough decision as the biggest obstacle to healthy Open Source. - -Members can be added to the TC at any time. Any committer can nominate another committer to the TC and the TC uses its standard consensus seeking process to evaluate whether or not to add this new member. Members who do not participate consistently at the level of a majority of the other members are expected to resign. - -The TC just uses the same consensus seeking process for adding new members as it uses for everything else. - -It’s a good idea to encourage committers to nominate people to the TC and not just wait around for TC members to notice the impact some people are having. Listening to the broader committers about who they see as having a big impact keeps the TC’s perspective inline with the rest of the project. - -As a project grows it’s important to add people from a variety of skill sets. If people are doing a lot of docs work, or test work, treat the investment they are making as equally valuable as the hard technical stuff. - -Projects should have the same ladder, user -> contributor -> commiters -> TC member, for every skill set they want to build into the project to keep it healthy. - -I often see long time maintainers worry about adding people who don’t understand every part of the project, as if they have to be involved in every decision. The reality is that people do know their limitations and want to defer hard decisions to people they know have more experience. - -Thanks to Greg [Wallace][5] and ashley [williams][6]. - --------------------------------------------------------------------------------- - -via: https://www.linux.com/news/biz-os/governance/892141-healthy-open-source - -作者:[Mikeal Rogers][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.linux.com/community/forums/person/66928 - - -[1]: https://medium.com/@nodejs/node-js-foundation-to-add-express-as-an-incubator-project-225fa3008f70#.mc30mvj4m -[2]: https://github.com/nodejs/TSC/blob/master/BasePolicies/CONTRIBUTING.md -[3]: https://github.com/nodejs/TSC/issues -[4]: https://github.com/Level/community/blob/master/CONTRIBUTING.md -[5]: https://medium.com/@gtewallaceLF -[6]: https://medium.com/@ag_dubs From baf49bf420ca24b09ef8a8483e17e0e3ecbebe7e Mon Sep 17 00:00:00 2001 From: ezio Date: Wed, 13 Jul 2016 21:22:12 +0800 Subject: [PATCH 1150/1469] =?UTF-8?q?20160712=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20160309 Let’s Build A Web Server. Part 1.md | 0 .../tech/20160406 Let’s Build A Web Server. Part 2.md | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {translated => sources}/tech/20160309 Let’s Build A Web Server. Part 1.md (100%) rename {translated => sources}/tech/20160406 Let’s Build A Web Server. Part 2.md (100%) diff --git a/translated/tech/20160309 Let’s Build A Web Server. Part 1.md b/sources/tech/20160309 Let’s Build A Web Server. Part 1.md similarity index 100% rename from translated/tech/20160309 Let’s Build A Web Server. Part 1.md rename to sources/tech/20160309 Let’s Build A Web Server. Part 1.md diff --git a/translated/tech/20160406 Let’s Build A Web Server. Part 2.md b/sources/tech/20160406 Let’s Build A Web Server. Part 2.md similarity index 100% rename from translated/tech/20160406 Let’s Build A Web Server. Part 2.md rename to sources/tech/20160406 Let’s Build A Web Server. Part 2.md From 2a32e17bff87eef4905cbc13288f94da59f18b56 Mon Sep 17 00:00:00 2001 From: Mike Date: Wed, 13 Jul 2016 21:38:56 +0800 Subject: [PATCH 1151/1469] translated/tech/20160708 Using Vagrant to control your DigitalOcean cloud instances.md (#4183) * translated/tech/20160708 Using Vagrant to control your DigitalOcean cloud instances.md * translated/tech/20160708 Using Vagrant to control your DigitalOcean cloud instances.md * translated/tech/20160708 Using Vagrant to control your DigitalOcean cloud instances.md * translated/tech/20160708 Using Vagrant to control your DigitalOcean cloud instances.md --- ...ntrol your DigitalOcean cloud instances.md | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) rename {sources => translated}/tech/20160708 Using Vagrant to control your DigitalOcean cloud instances.md (52%) diff --git a/sources/tech/20160708 Using Vagrant to control your DigitalOcean cloud instances.md b/translated/tech/20160708 Using Vagrant to control your DigitalOcean cloud instances.md similarity index 52% rename from sources/tech/20160708 Using Vagrant to control your DigitalOcean cloud instances.md rename to translated/tech/20160708 Using Vagrant to control your DigitalOcean cloud instances.md index 5a0e1ffda0..a9094445b5 100644 --- a/sources/tech/20160708 Using Vagrant to control your DigitalOcean cloud instances.md +++ b/translated/tech/20160708 Using Vagrant to control your DigitalOcean cloud instances.md @@ -1,21 +1,19 @@ -MikeCoder Translating... - -Using Vagrant to control your DigitalOcean cloud instances +使用 Vagrant 控制你的 DigitalOcean 云主机 ========================================================= ![](https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/fedora-vagrant-do-945x400.jpg) -[Vagrant][1] is an application to create and support virtual development environments using virtual machines. Fedora has [official support for Vagrant][2] with libvirt on your local system. [DigitalOcean][3] is a cloud provider that provides a one-click deployment of a Fedora Cloud instance to an all-SSD server in under a minute. During the [recent Cloud FAD][4] in Raleigh, the Fedora Cloud team packaged a new plugin for Vagrant which enables Fedora users to keep up cloud instances in DigitalOcean using local Vagrantfiles. +[Vagrant][1] 是一个创建和管理支持虚拟机开发环境的应用。Fedora 已经[官方支持 Vagrant][2]。[DigitalOcean][3]是一个提供一键部署的云计算服务提供商(主要是 Fedora 的服务实例)。在[最近的 Raleigh 举办的云计算 FAD][4]中,Fedora 云计算队伍已经打包了一个 Vagrant 的新的插件。它能够帮助用户通过使用本地的 Vagrantfile 来管理 DigitalOcean 实例。 -### How to use this plugin +### 如何使用 Vagrant DigitalOcean 插件 -First step is to install the package in the command line. +第一步是安装 vagrant DigitalOcean 的插件软件包。 ``` $ sudo dnf install -y vagrant-digitalocean ``` -After installing the plugin, the next task is to create the local Vagrantfile. An example is provided below. +安装 结束之后,下一个任务是创建本地的 Vagrantfile 文件。下面是一个例子。 ``` $ mkdir digitalocean @@ -39,17 +37,17 @@ Vagrant.configure('2') do |config| end ``` -### Notes about Vagrant DigitalOcean plugin +### Vagrant DigitalOcean 插件 -A few points to remember about the SSH key naming scheme: if you already have the key uploaded to DigitalOcean, make sure that the provider.ssh_key_name matches the name of the existing key in their server. The provider.image details are found at the [DigitalOcean documentation][5]. The AUTH token is created on the control panel within the Apps & API section. +一定要记住几个 SSH 命令规范:如果你已经在 DigitalOcean 上传了秘钥,请确保 provider.ssh_key_name 和已经在服务器中的名字吻合。provider.image 具体的文档可以在[DigitalOcean documentation][5]找到。认证 Token 可以在控制管理器的 Apps & API 区域找到。 -You can then get the instance up with the following command. +你可以通过以下命令来实例化一台主机。 ``` $ vagrant up --provider=digital_ocean ``` -This command will fire up the instance in the DigitalOcean server. You can then SSH into the box by using vagrant ssh command. Run vagrant destroy to destroy the instance. +这个命令会启动一台 DigitalOcean 的服务器实例。你可以使用 vagrant ssh 命令来 ssh 登陆进入这个实例。执行 vagrant destroy 来废弃这个实例。 @@ -59,7 +57,7 @@ This command will fire up the instance in the DigitalOcean server. You can then via: https://fedoramagazine.org/using-vagrant-digitalocean-cloud/ 作者:[Kushal Das][a] -译者:[译者ID](https://github.com/译者ID) +译者:[译者ID](https://github.com/MikeCoder) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 48da0c5ea0743e0813cab3964c9dcbc8de16432e Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 13 Jul 2016 22:44:11 +0800 Subject: [PATCH 1152/1469] PUB:20160609 INSTALL MATE 1.14 IN UBUNTU MATE 16.04 VIA PPA @MikeCoder --- ...MATE 1.14 IN UBUNTU MATE 16.04 VIA PPA.md | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) rename {translated/tech => published}/20160609 INSTALL MATE 1.14 IN UBUNTU MATE 16.04 VIA PPA.md (58%) diff --git a/translated/tech/20160609 INSTALL MATE 1.14 IN UBUNTU MATE 16.04 VIA PPA.md b/published/20160609 INSTALL MATE 1.14 IN UBUNTU MATE 16.04 VIA PPA.md similarity index 58% rename from translated/tech/20160609 INSTALL MATE 1.14 IN UBUNTU MATE 16.04 VIA PPA.md rename to published/20160609 INSTALL MATE 1.14 IN UBUNTU MATE 16.04 VIA PPA.md index 63ea47c541..a7932ee269 100644 --- a/translated/tech/20160609 INSTALL MATE 1.14 IN UBUNTU MATE 16.04 VIA PPA.md +++ b/published/20160609 INSTALL MATE 1.14 IN UBUNTU MATE 16.04 VIA PPA.md @@ -1,23 +1,23 @@ -在 Ubuntu Mate 16.04("Xenial Xerus") 上通过 PPA 安装 Mate 1.14 +在 Ubuntu Mate 16.04 上通过 PPA 升级 Mate 1.14 ================================================================= -Mate 桌面环境 1.14 现在可以在 Ubuntu Mate 16.04("Xenial Xerus") 上使用了。根据这个[发布版本][1]的描述, 为了全面测试 Mate 1.14,所以在 PPA 上发布 Mate 桌面环境 1.14大概了用2个月的时间。因此,你不太可能遇到安装的问题。 +Mate 桌面环境 1.14 现在可以在 Ubuntu Mate 16.04 ("Xenial Xerus") 上使用了。根据这个[发布版本][1]的描述,为了全面测试 Mate 1.14,所以 Mate 桌面环境 1.14 已经在 PPA 上发布 2 个月了。因此,你不太可能遇到安装的问题。 ![](https://2.bp.blogspot.com/-v38tLvDAxHg/V1k7beVd5SI/AAAAAAAAX7A/1X72bmQ3ia42ww6kJ_61R-CZ6yrYEBSpgCLcB/s400/mate114-ubuntu1604.png) -**现在 PPA 提供 Mate 1.14.1 包含如下改变(Ubuntu Mate 16.04 默认安装的是 Mate 1.12.x):** +**现在 PPA 提供 Mate 1.14.1 包含如下改变(Ubuntu Mate 16.04 默认安装的是 Mate 1.12.x):** -- 客户端的装饰应用现在可以正确的在所有主题中渲染; -- 触摸板配置现在支持边缘操作和双指的滚动; -- 在 Caja 中的 Python 扩展可以被单独管理; -- 所有三个窗口焦点模式都是是可选的; -- Mate Panel 中的所有菜单栏图标和菜单图标可以改变大小; -- 音量和亮度 OSD 目前可以启用和禁用; -- 更多的改进和 bug 修改; +- 客户端的装饰应用现在可以正确的在所有主题中渲染; +- 触摸板配置现在支持边缘操作和双指滚动; +- 在 Caja 中的 Python 扩展可以被单独管理; +- 所有三个窗口焦点模式都是可选的; +- Mate Panel 中的所有菜单栏图标和菜单图标可以改变大小; +- 音量和亮度 OSD 目前可以启用和禁用; +- 更多的改进和 bug 修改; -Mate 1.14 同时改进了整个桌面环境中对 GTK+3 的支持,包括各种各项的 GTK+3 小应用。但是,Ubuntu MATE 的博客中提到:PPA 的发行包使用 GTK+2编译"为了确保对 Ubuntu MATE 16.05还有各种各样的第三方 MATE 应用,插件,扩展的支持"。 +Mate 1.14 同时改进了整个桌面环境中对 GTK+ 3 的支持,包括各种 GTK+3 小应用。但是,Ubuntu MATE 的博客中提到:PPA 的发行包使用 GTK+ 2 编译是“为了确保对 Ubuntu MATE 16.04 还有各种各样的第三方 MATE 应用、插件、扩展的支持"。 -MATE 1.14 的完成修改列表[点击此处][2]阅读。 +MATE 1.14 的完整修改列表[点击此处][2]阅读。 ### 在 Ubuntu MATE 16.04 中升级 MATE 1.14.x @@ -29,7 +29,7 @@ sudo apt update sudo apt dist-upgrade ``` -**注意**: mate-netspeed 应用将会在升级中删除。因为该应用现在已经是 mate-applets 应用报的一部分,所以他依旧是可以获得的。 +**注意**: mate-netspeed 应用将会在升级中删除。因为该应用现在已经是 mate-applets 应用报的一部分,所以它依旧是可以使用的。 一旦升级完成,请重启你的系统,享受全新的 MATE! @@ -51,8 +51,8 @@ via [Ubuntu MATE blog][3] via: http://www.webupd8.org/2016/06/install-mate-114-in-ubuntu-mate-1604.html 作者:[Andrew][a] -译者:[译者ID](https://github.com/MikeCoder) -校对:[校对者ID](https://github.com/校对者ID) +译者:[MikeCoder](https://github.com/MikeCoder) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1477657f553de2d5556e165483d110908eebde5d Mon Sep 17 00:00:00 2001 From: cposture Date: Wed, 13 Jul 2016 22:56:30 +0800 Subject: [PATCH 1153/1469] Translating by cposture --- sources/tech/20160309 Let’s Build A Web Server. Part 1.md | 1 + sources/tech/20160406 Let’s Build A Web Server. Part 2.md | 1 + 2 files changed, 2 insertions(+) diff --git a/sources/tech/20160309 Let’s Build A Web Server. Part 1.md b/sources/tech/20160309 Let’s Build A Web Server. Part 1.md index 4c8048786d..47f8bfdcc7 100644 --- a/sources/tech/20160309 Let’s Build A Web Server. Part 1.md +++ b/sources/tech/20160309 Let’s Build A Web Server. Part 1.md @@ -1,3 +1,4 @@ +Translating by cposture 2016.07.13 Let’s Build A Web Server. Part 1. ===================================== diff --git a/sources/tech/20160406 Let’s Build A Web Server. Part 2.md b/sources/tech/20160406 Let’s Build A Web Server. Part 2.md index 482352ac9a..5cba11dd64 100644 --- a/sources/tech/20160406 Let’s Build A Web Server. Part 2.md +++ b/sources/tech/20160406 Let’s Build A Web Server. Part 2.md @@ -1,3 +1,4 @@ +Translating by cposture 2016.07.13 Let’s Build A Web Server. Part 2. =================================== From e282fdeb20f54e706e71831caddd338df30e5ba3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=AE=B6=E5=90=AF?= Date: Wed, 13 Jul 2016 23:17:51 +0800 Subject: [PATCH 1154/1469] Translated by cposture (#4184) * Translated by cposture * Translating by cposture * translating partly * translating partly 75 * Translated by cposture * Translated by cposture * Translating by cposture --- sources/tech/20160309 Let’s Build A Web Server. Part 1.md | 1 + sources/tech/20160406 Let’s Build A Web Server. Part 2.md | 1 + 2 files changed, 2 insertions(+) diff --git a/sources/tech/20160309 Let’s Build A Web Server. Part 1.md b/sources/tech/20160309 Let’s Build A Web Server. Part 1.md index 4c8048786d..47f8bfdcc7 100644 --- a/sources/tech/20160309 Let’s Build A Web Server. Part 1.md +++ b/sources/tech/20160309 Let’s Build A Web Server. Part 1.md @@ -1,3 +1,4 @@ +Translating by cposture 2016.07.13 Let’s Build A Web Server. Part 1. ===================================== diff --git a/sources/tech/20160406 Let’s Build A Web Server. Part 2.md b/sources/tech/20160406 Let’s Build A Web Server. Part 2.md index 482352ac9a..5cba11dd64 100644 --- a/sources/tech/20160406 Let’s Build A Web Server. Part 2.md +++ b/sources/tech/20160406 Let’s Build A Web Server. Part 2.md @@ -1,3 +1,4 @@ +Translating by cposture 2016.07.13 Let’s Build A Web Server. Part 2. =================================== From 7d95caa62a3cf6bd7af810d71ceadf001f5b21c7 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 14 Jul 2016 14:06:54 +0800 Subject: [PATCH 1155/1469] PUB:20160609 How to record your terminal session on Linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @MikeCoder 这篇原文有较大疏漏,已做了订正。 --- ...o record your terminal session on Linux.md | 98 +++++++++++++++++ ...o record your terminal session on Linux.md | 104 ------------------ 2 files changed, 98 insertions(+), 104 deletions(-) create mode 100644 published/20160609 How to record your terminal session on Linux.md delete mode 100644 translated/tech/20160609 How to record your terminal session on Linux.md diff --git a/published/20160609 How to record your terminal session on Linux.md b/published/20160609 How to record your terminal session on Linux.md new file mode 100644 index 0000000000..f30e4db2dc --- /dev/null +++ b/published/20160609 How to record your terminal session on Linux.md @@ -0,0 +1,98 @@ +如何在 Linux 上录制你的终端操作 +================================================= + +录制一个终端操作可能是一个帮助他人学习 Linux 、展示一系列正确命令行操作的和分享知识的通俗易懂方法。不管是出于什么目的,从终端复制粘贴文本需要重复很多次,而录制视频的过程也是相当麻烦,有时候还不能录制。在这次的文章中,我们将简单的了解一下以 gif 格式记录和分享终端会话的方法。 + +### 预先要求 + +如果你只是希望能记录你的终端会话,并且能在终端进行回放或者和他人分享,那么你只需要一个叫做:ttyrec 的软件。Ubuntu 用户可以通过运行这行代码进行安装: + +``` +sudo apt-get install ttyrec +``` + +如果你想将生成的视频转换成一个 gif 文件,这样能够和那些不使用终端的人分享,就可以发布到网站上去,或者你只是想做一个 gif 方便使用而不想写命令。那么你需要安装额外的两个软件包。第一个就是 imagemagick , 你可以通过以下的命令安装: + +``` +sudo apt-get install imagemagick +``` + +第二个软件包就是:tty2gif.py,访问其[项目网站][1]下载。这个软件包需要安装如下依赖: + +``` +sudo apt-get install python-opster +``` + +### 录制 + +开始录制终端操作,你需要的仅仅是键入 `ttyprec` ,然后回车。这个命令将会在后台运行一个实时的记录工具。我们可以通过键入`exit`或者`ctrl+d`来停止。ttyrec 默认会在主目录下创建一个`ttyrecord`的文件。 + +![](https://www.howtoforge.com/images/how-to-record-your-terminal-session-on-linux/pic_1.jpg) + +![](https://www.howtoforge.com/images/how-to-record-your-terminal-session-on-linux/pic_2.jpg) + +![](https://www.howtoforge.com/images/how-to-record-your-terminal-session-on-linux/pic_3.jpg) + +### 回放 + +回放这个文件非常简单。你只需要打开终端并且使用 `ttyplay` 命令打开 `ttyrecord` 文件即可。(在这个例子里,我们使用 ttyrecord 作为文件名,当然,你也可以改成你用的文件名) + +![](https://www.howtoforge.com/images/how-to-record-your-terminal-session-on-linux/pic_4.jpg) + +然后就可以开始播放这个文件。这个视频记录了所有的操作,包括你的删除,修改。这看起来像一个拥有自我意识的终端,但是这个命令执行的过程并不是只是为了给系统看,而是为了更好的展现给人。 + +注意一点,播放这个记录是完全可控的,你可以通过点击 `+` 或者 `-` 进行加速减速,或者 `0`和 `1` 暂停和恢复播放。 + +### 导出成 GIF + +为了方便,我们通常会将视频记录转换为 gif 格式,并且,这个非常容易做到。以下是方法: + +将之前下载的 tty2gif.py 这个文件拷贝到 ttyprecord 文件(或者你命名的那个视频文件)相同的目录,然后在这个目录下打开终端,输入命令: + +``` +python tty2gif.py typing ttyrecord +``` + +如果出现了错误,检查一下你是否有安装 python-opster 包。如果还是有错误,使用如下命令进行排除。 + +``` +sudo apt-get install xdotool +export WINDOWID=$(xdotool getwindowfocus) +``` + +然后重复这个命令 `python tty2gif.py` 并且你将会看到在 ttyrecord 目录下多了一些 gif 文件。 + +![](https://www.howtoforge.com/images/how-to-record-your-terminal-session-on-linux/pic_5.jpg) + +接下来的一步就是整合所有的 gif 文件,将他打包成一个 gif 文件。我们通过使用 imagemagick 工具。输入下列命令: + +``` +convert -delay 25 -loop 0 *.gif example.gif +``` + +![](https://www.howtoforge.com/images/how-to-record-your-terminal-session-on-linux/pic_6.jpg) + +你可以使用任意的文件名,我用的是 example.gif。 并且,你可以改变这个延时和循环时间。 Enjoy。 + +![](https://www.howtoforge.com/images/how-to-record-your-terminal-session-on-linux/example.gif) + +-------------------------------------------------------------------------------- + +via: https://www.howtoforge.com/tutorial/how-to-record-your-terminal-session-on-linux/ + +作者:[Bill Toulas][a] +译者:[MikeCoder](https://github.com/MikeCoder) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://twitter.com/howtoforgecom +[1]: https://bitbucket.org/antocuni/tty2gif/raw/61d5596c916512ce5f60fcc34f02c686981e6ac6/tty2gif.py + + + + + + + + diff --git a/translated/tech/20160609 How to record your terminal session on Linux.md b/translated/tech/20160609 How to record your terminal session on Linux.md deleted file mode 100644 index bc91a552a7..0000000000 --- a/translated/tech/20160609 How to record your terminal session on Linux.md +++ /dev/null @@ -1,104 +0,0 @@ -如何在 Linux 上录制你的终端操作 -================================================= - -录制一次终端操作可能是一个帮助他人学习 Linux 、展示一系列正确命令行操作的和分享知识的通俗易懂方法。不管是什么目的,大多数情况下从终端复制粘贴文本从终端不会是很有帮助而且录制视频的过程也是相当困难。在这次的文章中,我们将简单的了解一下在终端会话中用 GIF 格式录制视频的方法。 - -### 预先要求 - -如果你只是希望能记录你的终端会话,并且能在终端进行播放或者和他人分享,那么你只需要一个叫做:'ttyrec' 的软件。Ubuntu 使用者可以通过运行这行代码进行安装: - -``` -sudo apt-get install ttyrec -``` - -如果你想将生成的视频转换成一个 GIF 文件,并且能够和那些希望发布在网站上或者不使用终端或者只是简单的想保留一个 GIF 的用户分享。那么你需要安装额外的两个软件包。第一个就是'imagemagick', 你可以通过以下的命令安装: - -``` -sudo apt-get install imagemagick -``` - -第二个软件包就是:'tty2gif',你可以从这里下载。这个软件包需要安装如下依赖: - -``` -sudo apt-get install python-opster -``` - -### 录制 - -开始录制中毒啦操作,你需要的仅仅是键入'ttyprec' + 回车。这个命令将会在后台运行一个实时的记录工具。我们可以通过键入'exit'或者'ctrl+d'来停止。ttyrec 默认会在'Home'目录下创建一个'ttyrecord'的文件。 - -![](https://www.howtoforge.com/images/how-to-record-your-terminal-session-on-linux/pic_1.jpg) - -![](https://www.howtoforge.com/images/how-to-record-your-terminal-session-on-linux/pic_2.jpg) - -![](https://www.howtoforge.com/images/how-to-record-your-terminal-session-on-linux/pic_3.jpg) - -### 播放 - -播放这个文件非常简单。你只需要打开终端并且使用 'ttyplay' 命令打开 'ttyrecord' 文件即可。(在这个例子里,我们使用 ttyrecord 作为文件名,当然,你也可以对这个文件进行重命名) - -![](https://www.howtoforge.com/images/how-to-record-your-terminal-session-on-linux/pic_4.jpg) - -然后就可以开始播放这个文件。这个视频记录了所有的操作,包括你的删除,修改。这看起来想一个拥有自我意识的终端,但是这个命令执行的过程并不是只是为了给系统看,而是为了更好的展现给人。 - -注意的一点,播放这个记录是完全可控的,你可以通过点击 '+' 或者 '-' 或者 '0', 或者 '1' 按钮加速、减速、暂停、和恢复播放。 - -### 导出成 GIF - -为了方便,我们通常会将视频记录转换为 GIF 格式,并且,这个也非常方便可以实现。以下是方法: - -首先,解压这个文件 'tty2gif.tar.bz2': - -``` -tar xvfj tty2gif.tar.bz2 -``` - -然后,将 'tty2gif.py' 这个文件拷贝到 'ttyprecord' 文件同目录(或者你命名的那个视频文件), 然后在这个目录下打开终端,输入命令: - -``` -python tty2gif.py typing ttyrecord -``` - -如果你出现了错误,检查一下你是否有安装 'python-opster' 包。如果还是有错误,使用如下命令进行排除。 - -``` -sudo apt-get install xdotool -export WINDOWID=$(xdotool getwindowfocus) -``` - -然后重复这个命令 'python tty2gif.py' 并且你将会看到在 ttyrecord 目录下多了一大串的 gif 文件。 - -![](https://www.howtoforge.com/images/how-to-record-your-terminal-session-on-linux/pic_5.jpg) - -接下来的一步就是整合所有的 gif 文件,将他打包成一个 GIF 文件。我们通过使用 imagemagick 工具。输入下列命令: - -``` -convert -delay 25 -loop 0 *.gif example.gif -``` - -![](https://www.howtoforge.com/images/how-to-record-your-terminal-session-on-linux/pic_6.jpg) - -你可以任意的文件名,我喜欢用 'example.gif'。 并且,你可以改变这个延时和循环时间。 Enjoy. - -![](https://www.howtoforge.com/images/how-to-record-your-terminal-session-on-linux/example.gif) - --------------------------------------------------------------------------------- - -via: https://www.howtoforge.com/tutorial/how-to-record-your-terminal-session-on-linux/ - -作者:[Bill Toulas][a] -译者:[译者ID](https://github.com/MikeCoder) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://twitter.com/howtoforgecom - - - - - - - - - From 534cc841761d982b7dec166c382b9853c1f56b49 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 14 Jul 2016 14:47:18 +0800 Subject: [PATCH 1156/1469] PUB:20160625 How to Hide Linux Command Line History by Going Incognito @chunyang-wen --- ...Command Line History by Going Incognito.md | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) rename {translated/tech => published}/20160625 How to Hide Linux Command Line History by Going Incognito.md (60%) diff --git a/translated/tech/20160625 How to Hide Linux Command Line History by Going Incognito.md b/published/20160625 How to Hide Linux Command Line History by Going Incognito.md similarity index 60% rename from translated/tech/20160625 How to Hide Linux Command Line History by Going Incognito.md rename to published/20160625 How to Hide Linux Command Line History by Going Incognito.md index 9ef701559b..14bcdc2c7b 100644 --- a/translated/tech/20160625 How to Hide Linux Command Line History by Going Incognito.md +++ b/published/20160625 How to Hide Linux Command Line History by Going Incognito.md @@ -1,9 +1,9 @@ -如何进入无痕模式进而隐藏 Linux 的命令行历史 +如何隐藏你的 Linux 的命令行历史 ================================================================ ![](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2016/06/commandline-history-featured.jpg) -如果你是 Linux 命令行的用户,你会同意有的时候你不希望某些命令记录在你的命令行历史中。其中原因可能很多。例如,你在公司处于某个职位,你有一些不希望被其它人滥用的特权。亦或者有些特别重要的命令,你不希望在你浏览历史列表时误执行。 +如果你是 Linux 命令行的用户,有的时候你可能不希望某些命令记录在你的命令行历史中。原因可能很多,例如,你在公司担任某个职位,你有一些不希望被其它人滥用的特权。亦或者有些特别重要的命令,你不希望在你浏览历史列表时误执行。 然而,有方法可以控制哪些命令进入历史列表,哪些不进入吗?或者换句话说,我们在 Linux 终端中可以开启像浏览器一样的无痕模式吗?答案是肯定的,而且根据你想要的具体目标,有很多实现方法。在这篇文章中,我们将讨论一些行之有效的方法。 @@ -15,15 +15,15 @@ #### 1. 在命令前插入空格 -是的,没看错。在命令前面插入空格,这条命令会被终端忽略,也就意味着它不会出现在历史记录中。但是这种方法有个前提,只有在你的环境变量 HISTCONTROL 设置为 "ignorespace" 或者 "ignoreboth" 才会起作用。在大多数情况下,这个是默认值。 +是的,没看错。在命令前面插入空格,这条命令会被 shell 忽略,也就意味着它不会出现在历史记录中。但是这种方法有个前提,只有在你的环境变量 `HISTCONTROL` 设置为 "ignorespace" 或者 "ignoreboth" 才会起作用。在大多数情况下,这个是默认值。 -所以,像下面的命令: +所以,像下面的命令(LCTT 译注:这里`[space]`表示输入一个空格): ``` [space]echo "this is a top secret" ``` -你执行后,它不会出现在历史记录中。 +如果你之前执行过如下设置环境变量的命令,那么上述命令不会出现在历史记录中。 ``` export HISTCONTROL = ignorespace @@ -37,35 +37,35 @@ export HISTCONTROL = ignorespace #### 2. 禁用当前会话的所有历史记录 -如果你想禁用某个会话所有历史,你可以简单地在开始命令行工作前清除环境变量 HISTSIZE 的值。执行下面的命令来清除其值: +如果你想禁用某个会话所有历史,你可以在开始命令行工作前简单地清除环境变量 HISTFILESIZE 的值即可。执行下面的命令来清除其值: ``` -export HISTFILE=0 +export HISTFILESIZE=0 ``` -HISTFILE 表示对于 bash 会话其历史中可以保存命令的个数。默认情况,它设置了一个非零值,例如 在我的电脑上,它的值为 1000。 +HISTFILESIZE 表示对于 bash 会话其历史文件中可以保存命令的个数(行数)。默认情况,它设置了一个非零值,例如在我的电脑上,它的值为 1000。 -所以上面所提到的命令将其值设置为 0,结果就是直到你关闭终端,没有东西会存储在历史记录中。记住同样你也不能通过按向上的箭头按键来执行之前的命令,也不能运行 history 命令。 +所以上面所提到的命令将其值设置为 0,结果就是直到你关闭终端,没有东西会存储在历史记录中。记住同样你也不能通过按向上的箭头按键或运行 history 命令来看到之前执行的命令。 #### 3. 工作结束后清除整个历史 -这可以看作是前一部分所提方案的另外一种实现。唯一的区别是在你完成所有工作之后执行这个命令。下面是刚讨论的命令: +这可以看作是前一部分所提方案的另外一种实现。唯一的区别是在你完成所有工作之后执行这个命令。下面是刚说到的命令: ``` history -cw ``` -刚才已经提到,这个和 HISTFILE 方法有相同效果。 +刚才已经提到,这个和 HISTFILESIZE 方法有相同效果。 #### 4. 只针对你的工作关闭历史记录 -虽然前面描述的方法(2 和 3)可以实现目的,它们清除整个历史,在很多情况下,有些可能不是我们所期望的。有时候你可能想保存直到你开始命令行工作之间的历史记录。类似的需求需要在你开始工作前执行下述命令: +虽然前面描述的方法(2 和 3)可以实现目的,它们可以清除整个历史,在很多情况下,有些可能不是我们所期望的。有时候你可能想保存直到你开始命令行工作之间的历史记录。对于这样的需求,你开始在工作前执行下述命令: ``` [space]set +o history ``` -备注:[space] 表示空格。 +备注:[space] 表示空格。并且由于空格的缘故,该命令本身也不会被记录。 上面的命令会临时禁用历史功能,这意味着在这命令之后你执行的所有操作都不会记录到历史中,然而这个命令之前的所有东西都会原样记录在历史列表中。 @@ -75,14 +75,14 @@ history -cw [Space]set -o history ``` -它将环境恢复原状,也就是你完成你的工作,执行上述命令之后的命令都会出现在历史中。 +它将环境恢复原状,也就是你完成了你的工作,执行上述命令之后的命令都会出现在历史中。 #### 5. 从历史记录中删除指定的命令 -现在假设历史记录中有一些命令你不希望被记录。这种情况下我们怎么办?很简单。直接动手删除它们。通过下面的命令来删除: +现在假设历史记录中已经包含了一些你不希望记录的命令。这种情况下我们怎么办?很简单。直接动手删除它们。通过下面的命令来删除: ``` -[space]history | grep "part of command you want to remove" +history | grep "part of command you want to remove" ``` 上面的命令会输出历史记录中匹配的命令,每一条前面会有个数字。 @@ -99,6 +99,8 @@ history -d [num] 第二个 ‘echo’命令被成功的删除了。 +(LCTT 译注:如果你不希望上述命令本身也被记录进历史中,你可以在上述命令前加个空格) + 同样的,你可以使用向上的箭头一直往回翻看历史记录。当你发现你感兴趣的命令出现在终端上时,按下 “Ctrl + U”清除整行,也会从历史记录中删除它。 ### 总结 @@ -107,11 +109,11 @@ history -d [num] -------------------------------------------------------------------------------- -via: https://www.maketecheasier.com/linux-command-line-history-incognito/?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+maketecheasier +via: https://www.maketecheasier.com/linux-command-line-history-incognito/ 作者:[Himanshu Arora][a] 译者:[chunyang-wen](https://github.com/chunyang-wen) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From e200f3a65410dcfff736257298f2097605959c07 Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 14 Jul 2016 22:18:43 +0800 Subject: [PATCH 1157/1469] =?UTF-8?q?=E6=A0=A1=E5=AF=B9=E5=AE=8C=E6=88=90?= =?UTF-8?q?=EF=BC=8C=E7=A7=BB=E5=88=B0publish?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... 6 Amazing Linux Distributions For Kids.md | 33 +++++++++---------- 1 file changed, 15 insertions(+), 18 deletions(-) rename {translated/tech => published}/20160616 6 Amazing Linux Distributions For Kids.md (58%) diff --git a/translated/tech/20160616 6 Amazing Linux Distributions For Kids.md b/published/20160616 6 Amazing Linux Distributions For Kids.md similarity index 58% rename from translated/tech/20160616 6 Amazing Linux Distributions For Kids.md rename to published/20160616 6 Amazing Linux Distributions For Kids.md index 7a8169cd6a..79f3aff154 100644 --- a/translated/tech/20160616 6 Amazing Linux Distributions For Kids.md +++ b/published/20160616 6 Amazing Linux Distributions For Kids.md @@ -1,28 +1,26 @@ -[Translated by HaohongWANG] -//校对爸爸辛苦了!>_< 惊艳!6款面向儿童的 Linux 发行版 ====================================== -毫无疑问未来是属于 Linux 和开源的。为了实现这样的未来、使Linux占据一席之地,人们已经着手从尽可能低的水平开始开发面向儿童的Linux发行版,并尝试教授他们如何使用Linux操作系统。 +毫无疑问未来是属于 Linux 和开源的。为了实现这样的未来、使 Linux 占据一席之地,人们已经着手开发尽可能简单的、面向儿童的 Linux 发行版,并尝试教导他们如何使用 Linux 操作系统。 ![](http://www.tecmint.com/wp-content/uploads/2016/05/Linux-Distros-For-Kids.png) >面向儿童的 Linux 发行版 -Linux 是一款非常强大的操作系统,原因之一便是它驱动了互联网上绝大多数的服务器。但出于对其用户友好性的担忧,坊间时常展开有关于 Linux 应如何取代 Mac OS X 或 Windows 的辩论。而我认为用户应该接受 Linux 来见识它真正的威力。 +Linux 是一款非常强大的操作系统,原因之一便是它支撑了互联网上绝大多数的服务器。但出于对其用户友好性的担忧,坊间时常展开有关于 Linux 应如何取代 Mac OS X 或 Windows 的争论。而我认为用户应该接受 Linux 来见识它真正的威力。 -如今,Linux 运行在绝大多数设备上,从智能手机到平板电脑,笔记本电脑,工作站,服务器,超级计算机,再到汽车,航空管制系统,甚至电冰箱,都有 Linux 的身影。正如我在开篇所说,有了这一切, Linux 是未来的操作系统。 +如今,Linux 运行在绝大多数设备上,从智能手机到平板电脑,笔记本电脑,工作站,服务器,超级计算机,再到汽车,航空管制系统,电冰箱,到处都有 Linux 的身影。正如我在开篇所说,有了这一切, Linux 是未来的操作系统。 >参考阅读: [30 Big Companies and Devices Running on Linux][1] -未来是属于孩子们的,教育要从娃娃抓起。所以,要让小孩子尽早地学习计算机、了解 Linux 、接触科学技术。这是改变未来图景的最好方法。 +未来是属于孩子们的,教育要从娃娃抓起。所以,要让小孩子尽早地学习计算机,而 Linux 就是其中一个重要的部分。 -一个常见的现象是,当儿童在一个适合他的环境中学习时,好奇心和早期学习的能力会使他自己养成喜好探索的性格。 +对小孩来说,一个常见的现象是,当他们在一个适合他的环境中学习时,好奇心和早期学习的能力会使他自己养成喜好探索的性格。 说了这么多儿童应该学习 Linux 的原因,接下来我就列出这些令人激动的发行版。你可以把它们推荐给小孩子来帮助他们开始学习使用 Linux 。 ### Sugar on a Stick -Sugar on a Stick (译注:“糖在棒上”)是 Sugar Labs 旗下的工程,Sugar Labs 是一个由志愿者领导的非盈利组织。这一发行版旨在设计大量的免费工具来使儿童在探索、发现、创造中认知自己的思想。 +Sugar on a Stick (译注:“糖棒”)是 Sugar 实验室旗下的工程,Sugar 实验室是一个由志愿者领导的非盈利组织。这一发行版旨在设计大量的免费工具来促进儿童在探索中学会技能,发现、创造,并将这些反映到自己的思想上。 ![](http://www.tecmint.com/wp-content/uploads/2016/05/Sugar-Neighborhood-View.png) >Sugar Neighborhood 界面 @@ -36,31 +34,31 @@ Sugar on a Stick (译注:“糖在棒上”)是 Sugar Labs 旗下的工程,S ### Edubuntu -Edubuntu 是基于当下最流行的发行版 Ubuntu 而开发的一款草根发行版。主要致力于降低学校、家庭和社区安装、使用 Ubuntu 自由软件的难度。 +Edubuntu 是基于当下最流行的发行版 Ubuntu 而开发的一款非官方发行版。主要致力于降低学校、家庭和社区安装、使用 Ubuntu 自由软件的难度。 ![](http://www.tecmint.com/wp-content/uploads/2016/05/Edubuntu-Apps.jpg) >Edubuntu 桌面应用 -它的桌面应用由来自不同组织的学生、教师、家长、一些利益相关者甚至黑客来提供。他们都笃信社区的发展和知识的共享是自由学习和自由分享的基石。 +它是由来自不同组织的学生、教师、家长、一些利益相关者甚至黑客支持的,这些人都坚信自由的学习和共享知识能够提高自己和社区的发展。 -该项目的主要目标是组建一款安装、管理软件难度低的操作系统以增长使用 Linux 学习和教育的用户数量。 +该项目的主要目标是通过组建一款能够降低安装、管理软件难度的操作系统来增强学习和教育水平。 访问主页: ### Doudou Linux -Doudou Linux 是专为方便儿童使用而设计的发行版,能在构建中激发儿童的创造性思维。它提供了简单但是颇具教育意义的应用来使儿童在应用过程中学习发现新的知识。 +Doudou Linux 是专为方便孩子们在建设创新思维时使用计算机而设计的发行版。它提供了简单但是颇具教育意义的应用来使儿童在应用过程中学习发现新的知识。 ![](http://www.tecmint.com/wp-content/uploads/2016/05/Doudou-Linux.png) >Doudou Linux -其最引人注目的一点便是内容过滤功能,顾名思义,它能够阻止孩童访问网络上的禁止内容。如果想要更进一步的儿童保护功能,Doudou Linux 还提供了互联网用户隐私功能,能够去除网页中的特定加载内容。 +其最引人注目的一点便是内容过滤功能,顾名思义,它能够阻止孩童访问网络上的限制性内容。如果想要更进一步的儿童保护功能,Doudou Linux 还提供了互联网用户隐私功能,能够去除网页中的特定加载内容。 访问主页: ### LinuxKidX -这是一款整合了许多专为儿童的教育类软件的 Slackware Linux 的 LiveCD。它使用 KDE 作为默认桌面环境并配置了诸如 Ktouch 打字指导,Kstars 虚拟天文台,Kalzium 元素周期表和 KwordQuiz 单词测试等应用。 +这是一款整合了许多专为儿童设计的教育软件的基于 Slackware Linux 发行版的 LiveCD。它使用 KDE 作为默认桌面环境并配置了诸如 Ktouch 打字指导,Kstars 虚拟天文台,Kalzium 元素周期表和 KwordQuiz 单词测试等应用。 ![](http://www.tecmint.com/wp-content/uploads/2016/05/LinuxKidX.jpg) >LinuxKidX @@ -85,7 +83,7 @@ Ubermix 还具有5分钟快速安装和快速恢复等功能,可以给小孩 ![](http://www.tecmint.com/wp-content/uploads/2016/05/Qimo-Linux.png) >Qimo Linux -你仍然可以在 Ubuntu 或者其他的 Linux 发行版中找到大多数儿童游戏。正如这些开发商所说,他们不仅在为儿童制作教育软件,同时也在开发增长儿童文化水平的安卓应用。 +你仍然可以在 Ubuntu 或者其他的 Linux 发行版中找到大多数儿童游戏。正如这些开发商所说,他们并不是要终止为孩子们开发教育软件,而是在开发能够提高儿童读写能力的 android 应用。 如果你想进一步了解,可以移步他们的官方网站。 @@ -93,7 +91,7 @@ Ubermix 还具有5分钟快速安装和快速恢复等功能,可以给小孩 以上这些便是我所知道的面向儿童的Linux发行版,或有缺漏,欢迎评论补充。 -如果你想探讨桌面 Linux 的发展前景或是如何引导儿童接触 Linux ,欢迎与我联系。 +如果你想让我们知道你对如何想儿童介绍 Linux 或者你对未来的 Linux ,特别是桌面计算机上的 Linux,欢迎与我联系。 -------------------------------------------------------------------------------- @@ -102,12 +100,11 @@ via: http://www.tecmint.com/best-linux-distributions-for-kids/?utm_source=feedbu 作者:[Aaron Kili][a] 译者:[HaohongWANG](https://github.com/HaohongWANG) -校对:[校对者ID](https://github.com/校对者ID) +校对:[Ezio](https://github.com/oska874) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: http://www.tecmint.com/author/aaronkili/ - [1]: http://www.tecmint.com/big-companies-and-devices-running-on-gnulinux/ From 78607ba1576473e50c30936a96a9d94706381621 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 14 Jul 2016 22:30:26 +0800 Subject: [PATCH 1158/1469] PUB:20160620 Monitor Linux With Netdata MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @GitFuture 总体翻译的不错~ --- .../20160620 Monitor Linux With Netdata.md | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) rename {translated/tech => published}/20160620 Monitor Linux With Netdata.md (63%) diff --git a/translated/tech/20160620 Monitor Linux With Netdata.md b/published/20160620 Monitor Linux With Netdata.md similarity index 63% rename from translated/tech/20160620 Monitor Linux With Netdata.md rename to published/20160620 Monitor Linux With Netdata.md index bc453d51ee..989abf0d66 100644 --- a/translated/tech/20160620 Monitor Linux With Netdata.md +++ b/published/20160620 Monitor Linux With Netdata.md @@ -1,29 +1,33 @@ 用 Netdata 监控 Linux ======= -Netdata 是一个实时的资源监控工具,它拥有基于 web 的友好界面,由 [FireHQL][1] 开发和维护。通过这个工具,你可以通过图表来了解 CPU,RAM,硬盘,网络,Apache, Postfix等软硬件的资源使用情况。它很像 Nagios 等别的监控软件;但是,Netdata 仅仅支持通过网络接口进行实时监控。 +![](https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/netdata-945x400.png) + +Netdata 是一个实时的资源监控工具,它拥有基于 web 的友好界面,由 [FireHQL][1] 开发和维护。通过这个工具,你可以通过图表来了解 CPU,RAM,硬盘,网络,Apache, Postfix 等软硬件的资源使用情况。它很像 Nagios 等别的监控软件;但是,Netdata 仅仅支持通过 Web 界面进行实时监控。 ### 了解 Netdata -目前 Netdata 还没有验证机制,如果你担心别人能从你的电脑上获取相关信息的话,你应该设置防火墙规则来限制访问。UI 是简化版的,以便用户查看和理解他们看到的表格数据,至少你能够记住它的快速安装。 +目前 Netdata 还没有验证机制,如果你担心别人能从你的电脑上获取相关信息的话,你应该设置防火墙规则来限制访问。UI 很简单,所以任何人看懂图形并理解他们看到的结果,至少你会对它的快速安装印象深刻。 -它的 web 前端响应很快,而且不需要 Flash 插件。 UI 很整洁,保持着 Netdata 应有的特性。粗略的看,你能够看到很多图表,幸运的是绝大多数常用的图表数据(像 CPU,RAM,网络和硬盘)都在顶部。如果你想深入了解图形化数据,你只需要下滑滚动条,或者点击在右边菜单的项目。通过每个图表的右下方的按钮, Netdata 还能让你控制图表的显示,重置,缩放。 +它的 web 前端响应很快,而且不需要 Flash 插件。 UI 很整洁,保持着 Netdata 应有的特性。第一眼看上去,你能够看到很多图表,幸运的是绝大多数常用的图表数据(像 CPU,RAM,网络和硬盘)都在顶部。如果你想深入了解图形化数据,你只需要下滑滚动条,或者点击在右边菜单的项目。通过每个图表的右下方的按钮, Netdata 还能让你控制图表的显示,重置,缩放。 ![](https://fedoramagazine.org/wp-content/uploads/2016/06/Capture-1.png) ->Netdata 图表控制 + +*Netdata 图表控制* Netdata 并不会占用多少系统资源,它占用的内存不会超过 40MB。因为这个软件是作者用 C 语言写的。 ![](https://fedoramagazine.org/wp-content/uploads/2016/06/Capture.png) ->Netdata 显示的内存使用情况 + +*Netdata 显示的内存使用情况* ### 下载 Netdata -要下载这个软件,你可以从访问 [Netdata GitHub page][2]。然后点击页面左边绿色的 "Clone or download" 按钮 。你应该能看到两个选项。 +要下载这个软件,你可以访问 [Netdata 的 GitHub 页面][2],然后点击页面左边绿色的 "Clone or download" 按钮 。你应该能看到以下两个选项: #### 通过 ZIP 文件下载 -另一种方法是下载 ZIP 文件。它包含在仓库的所有东西。但是如果仓库更新了,你需要重新下载 ZIP 文件。下载完 ZIP 文件后,你要用 `unzip` 命令行工具来解压文件。运行下面的命令能把 ZIP 文件的内容解压到 `netdata` 文件夹。 +一种方法是下载 ZIP 文件。它包含仓库里的所有东西。但是如果仓库更新了,你需要重新下载 ZIP 文件。下载完 ZIP 文件后,你要用 `unzip` 命令行工具来解压文件。运行下面的命令能把 ZIP 文件的内容解压到 `netdata` 文件夹。 ``` $ cd ~/Downloads @@ -31,9 +35,10 @@ $ unzip netdata-master.zip ``` ![](https://fedoramagazine.org/wp-content/uploads/2016/06/Capture-2.png) ->解压 Netdata -没必要在 unzip 命令后加上 `-d` 选项,因为文件都是是放在 ZIP 文件里的一个文件夹里面。如果没有那个文件夹, unzip 会把所有东西都解压到当前目录下面(这会让文件非常混乱)。 +*解压 Netdata* + +没必要在 unzip 命令后加上 `-d` 选项,因为文件都是是放在 ZIP 文件的根文件夹里面。如果没有那个文件夹, unzip 会把所有东西都解压到当前目录下面(这会让文件非常混乱)。 #### 通过 Git 下载 @@ -53,7 +58,7 @@ $ git clone https://github.com/firehol/netdata.git ### 安装 Netdata -有些软件包是你成功构造 Netdata 时候需要的。 还好,一行命令就可以安装你所需要的东西([as stated in their installation guide][3])。在命令行运行下面的命令就能满足安装 Netdata 需要的所有依赖关系。 +有些软件包是你成功构造 Netdata 时候需要的。 还好,一行命令就可以安装你所需要的东西([这写在它的安装文档中][3])。在命令行运行下面的命令就能满足安装 Netdata 需要的所有依赖关系。 ``` $ dnf install zlib-devel libuuid-devel libmnl-devel gcc make git autoconf autogen automake pkgconfig @@ -68,7 +73,8 @@ $ sudo ./netdata-installer.sh 然后就会提示你按回车键,开始安装程序。如果要继续的话,就按下回车吧。 ![](https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/Capture-3-600x341.png) ->Netdata 的安装。 + +*Netdata 的安装* 如果一切顺利,你的系统上就已经安装并且运行了 Netdata。安装脚本还会在相应的文件夹里添加一个卸载脚本,叫做 `netdata-uninstaller.sh`。如果你以后不想使用 Netdata,运行这个脚本可以从你的系统里面卸载掉 Netdata。 @@ -83,10 +89,10 @@ $ sudo systemctl status netdata 既然我们已经安装并且运行了 Netdata,你就能够通过 19999 端口来访问 web 界面。下面的截图是我在一个测试机器上运行的 Netdata。 ![](https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/Capture-4-768x458.png) ->关于 Netdata 运行时的概览 -恭喜!你已经成功安装并且能够看到关于你的机器性能的完美显示,图形和高级的统计数据。无论是否是你个人的机器,你都可以向你的朋友们炫耀,因为你能够深入的了解你的服务器性能,Netdata 在任何机器上的性能报告都非常出色。 +*关于 Netdata 运行时的概览* +恭喜!你已经成功安装并且能够看到漂亮的外观和图形,以及你的机器性能的高级统计数据。无论是否是你个人的机器,你都可以向你的朋友们炫耀,因为你能够深入的了解你的服务器性能,Netdata 在任何机器上的性能报告都非常出色。 -------------------------------------------------------------------------------- @@ -94,7 +100,7 @@ via: https://fedoramagazine.org/monitor-linux-netdata/ 作者:[Martino Jones][a] 译者:[GitFuture](https://github.com/GitFuture) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 64231f948727ba4728239ece766b15fcdd37c3a3 Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 14 Jul 2016 22:35:10 +0800 Subject: [PATCH 1159/1469] =?UTF-8?q?=E6=A0=A1=E5=AF=B9=E5=AE=8C=E6=88=90?= =?UTF-8?q?=EF=BC=8C=E5=8F=AF=E4=BB=A5=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ntrol your DigitalOcean cloud instances.md | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) rename {translated/tech => published}/20160708 Using Vagrant to control your DigitalOcean cloud instances.md (55%) diff --git a/translated/tech/20160708 Using Vagrant to control your DigitalOcean cloud instances.md b/published/20160708 Using Vagrant to control your DigitalOcean cloud instances.md similarity index 55% rename from translated/tech/20160708 Using Vagrant to control your DigitalOcean cloud instances.md rename to published/20160708 Using Vagrant to control your DigitalOcean cloud instances.md index a9094445b5..b07a1cb5ed 100644 --- a/translated/tech/20160708 Using Vagrant to control your DigitalOcean cloud instances.md +++ b/published/20160708 Using Vagrant to control your DigitalOcean cloud instances.md @@ -3,17 +3,17 @@ ![](https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/fedora-vagrant-do-945x400.jpg) -[Vagrant][1] 是一个创建和管理支持虚拟机开发环境的应用。Fedora 已经[官方支持 Vagrant][2]。[DigitalOcean][3]是一个提供一键部署的云计算服务提供商(主要是 Fedora 的服务实例)。在[最近的 Raleigh 举办的云计算 FAD][4]中,Fedora 云计算队伍已经打包了一个 Vagrant 的新的插件。它能够帮助用户通过使用本地的 Vagrantfile 来管理 DigitalOcean 实例。 +[Vagrant][1] 是一个使用虚拟机创建和支持虚拟开发环境的应用。Fedora 官方已经在本地系统上通过库 `libvirt` [支持 Vagrant][2]。[DigitalOcean][3]是一个提供一键部署 Fedora 云服务实例到全固态存储服务器的云计算服务提供商。在[最近的 Raleigh 举办的 FAD 大会][4]中,Fedora 云计算队伍已经打包了一个 Vagrant 的新的插件,它能够帮助 Fedora 用户通过使用本地的 Vagrantfile 文件来管理 DigitalOcean 上的云服务实例。 -### 如何使用 Vagrant DigitalOcean 插件 +### 如何使用这个插件 -第一步是安装 vagrant DigitalOcean 的插件软件包。 +第一步在命令行下是安装软件。 ``` $ sudo dnf install -y vagrant-digitalocean ``` -安装 结束之后,下一个任务是创建本地的 Vagrantfile 文件。下面是一个例子。 +安装 结束之后,下一步是创建本地的 Vagrantfile 文件。下面是一个例子。 ``` $ mkdir digitalocean @@ -37,20 +37,18 @@ Vagrant.configure('2') do |config| end ``` -### Vagrant DigitalOcean 插件 +### Vagrant DigitalOcean 插件的注意事项 -一定要记住几个 SSH 命令规范:如果你已经在 DigitalOcean 上传了秘钥,请确保 provider.ssh_key_name 和已经在服务器中的名字吻合。provider.image 具体的文档可以在[DigitalOcean documentation][5]找到。认证 Token 可以在控制管理器的 Apps & API 区域找到。 -你可以通过以下命令来实例化一台主机。 +一定要记住的几个关于 SSH 的关键命名规范 : 如果你已经在 DigitalOcean 上传了秘钥,请确保 `provider.ssh_key_name` 和已经在服务器中的名字吻合。 `provider.image` 具体的文档可以在[DigitalOcean documentation][5]找到。在控制面板上的 `App & API` 部分可以创建认证令牌。 + +你可以使用下面的命令启动一个实例。 ``` $ vagrant up --provider=digital_ocean ``` -这个命令会启动一台 DigitalOcean 的服务器实例。你可以使用 vagrant ssh 命令来 ssh 登陆进入这个实例。执行 vagrant destroy 来废弃这个实例。 - - - +这个命令会在 DigitalOcean 的启动一个服务器实例。然后你就可以使用 `vagrant ssh` 命令来 `ssh` 登陆进入这个实例。执行 vagrant destroy 来删除这个实例。 -------------------------------------------------------------------------------- @@ -58,7 +56,7 @@ via: https://fedoramagazine.org/using-vagrant-digitalocean-cloud/ 作者:[Kushal Das][a] 译者:[译者ID](https://github.com/MikeCoder) -校对:[校对者ID](https://github.com/校对者ID) +校对:[Ezio](https://github.com/oska874) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 6f0b38d1f4b21b7a9775755d61a2451c3780ca29 Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 14 Jul 2016 23:00:31 +0800 Subject: [PATCH 1160/1469] =?UTF-8?q?=E6=A0=A1=E5=AF=B9=E5=AE=8C=E6=88=90?= =?UTF-8?q?=EF=BC=8C=E5=8F=AF=E4=BB=A5=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... SBC builds on Raspberry Pi Compute Module.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) rename {translated/tech => published}/20160624 Industrial SBC builds on Raspberry Pi Compute Module.md (66%) diff --git a/translated/tech/20160624 Industrial SBC builds on Raspberry Pi Compute Module.md b/published/20160624 Industrial SBC builds on Raspberry Pi Compute Module.md similarity index 66% rename from translated/tech/20160624 Industrial SBC builds on Raspberry Pi Compute Module.md rename to published/20160624 Industrial SBC builds on Raspberry Pi Compute Module.md index 361dc746ee..d79d24652b 100644 --- a/translated/tech/20160624 Industrial SBC builds on Raspberry Pi Compute Module.md +++ b/published/20160624 Industrial SBC builds on Raspberry Pi Compute Module.md @@ -3,9 +3,9 @@ ![](http://hackerboards.com/files/embeddedmicro_mypi-thm.jpg) -在 Kickstarter 众筹网站上,一个叫“MyPi”的项目用 RPi 计算模块制作了一款 SBC(Single Board Computer 单板计算机),提供 mini-PCIe 插槽,串口,宽范围输入电源,以及模块扩展等功能。 +在 Kickstarter 众筹网站上,一个叫 “MyPi” 的项目用 RPi 计算模块制作了一款 SBC(译注: Single Board Computer 单板计算机),提供一个 mini-PCIe 插槽,串口,宽范围输入电源,以及模块扩展等功能。 -你也许觉得奇怪,都 2016 年了,为什么还会有人发布这样一款长得有点像三明治,用过时的基于 ARM11 的原版树莓派 COM(Compuer on Module,模块化计算机)版本,[树莓派计算模块][1],构建的单板计算机。首先,目前仍然有大量工业应用不需要太多 CPU 处理能力,第二,树莓派计算模块仍是目前仅有的基于树莓派硬件的 COM,虽然更便宜,有点像 COM 并采用 700MHz 处理器的 [零号树莓派][2],快要发布了。 +你也许觉得奇怪,都 2016 年了,为什么还会有人发布这样一款长得有点像三明治,用过时的基于 ARM11 的 COM (译注: Compuer on Module,模块化计算机)版本的原版树莓派,[树莓派计算模块][1],来构建单板计算机。首先,目前仍然有大量工业应用不需要太多 CPU 处理能力,第二,树莓派计算模块仍是目前仅有的基于树莓派硬件的 COM,虽然更便宜,有点像 COM 并采用 700MHz 处理器的 [零号树莓派][2]。 ![](http://hackerboards.com/files/embeddedmicro_mypi-sm.jpg) @@ -13,7 +13,7 @@ >安装了 COM 和 I/O 组件的 MyPi(左),装入了可选的工业外壳中 -另外,Embedded Micro Technology 还表示它的 SBC 还设计成支持和承诺的树莓派计算模块升级版互换,采用树莓派 3 的四核,Cortex-A53 博通 BCM2837 SoC。因为这个产品最近很快就会到货,不确定他们怎么能及时为 Kickstarter 赞助者处理好这一切。不过,以后能支持也挺不错,就算要为这个升级付费也可以接受。 +另外,Embedded Micro Technology 还表示它的 SBC 还设计成支持升级替换成允许的树莓派计算模块 —— 采用了树莓派 3 的四核、Cortex-A53 博通 BCM2837处理器的 SoC。因为这个产品最近很快就会到货,不确定他们怎么能及时为 Kickstarter 赞助者处理好这一切。不过,以后能支持也挺不错,就算要为这个升级付费也可以接受。 MyPi 并不是唯一一款新的基于树莓派计算模块的商业嵌入式设备。Pigeon Computers 在五月份启动了 [Pigeon RB100][3] 的项目,是一个基于 COM 的工业自动化控制器。不过,包括 [Techbase Modberry][4] 在内的这一类设备大都出现在 2014 年 COM 发布之后的一小段时间内。 @@ -25,7 +25,7 @@ MyPi 的目标是 30 天内筹集 $21,696,目前已经实现了三分之一。 >不带 COM 和插件板的 MyPi 主板(左)以及它的接口定义 -树莓派计算模块能给 MyPi 带来博通 BCM2835 Soc,512MB 内存,以及 4GB eMMC 存储空间。MyPi 主板扩展了一个 microSD 卡槽,一个 HDMI 接口,两个 USB 2.0 接口,一个 10/100 以太网口,还有一个类似网口的 RS232 端口(通过 USB)。 +树莓派计算模块能给 MyPi 带来博通 BCM2835 Soc,512MB 内存,以及 4GB eMMC 存储空间。MyPi 主板扩展了一个 microSD 卡槽,一个 HDMI 接口,两个 USB 2.0 接口,一个 10/100M 以太网口,还有一个像网口的 RS232 端口(通过 USB 连接)。 ![](http://hackerboards.com/files/embeddedmicro_mypi_angle1-sm.jpg) @@ -35,17 +35,17 @@ MyPi 的目标是 30 天内筹集 $21,696,目前已经实现了三分之一。 MyPi 还将配备一个 mini-PCIe 插槽,据说“只支持 USB,以及只适用 mPCIe 形式的调制解调器”。还带有一个 SIM 卡插槽。板上还有双标准的树莓派摄像头接口,一个音频输出接口,自带备用电池的 RTC,LED 灯。还支持宽范围的 9-23V 直流输入。 -Embedded Micro 表示,MyPi 是为那些树莓派爱好者们设计的,他们堆积了太多 HAT 外接板,已经不能有效地工作了,或者不能很好地装入工业外壳里。MyPi 支持 HAT,另外还提供了公司自己定义的“ASIO”(特定应用接口)插件模块,它会将自己的 I/O 扩展到主板上,主板再将它们连到主板边上的 8 脚,绿色,工业 I/O 连接器(标记了“ASIO Out”)上,在下面图片里有描述。 +Embedded Micro 表示,MyPi 是为那些树莓派爱好者们设计的,他们堆积了太多 HAT 外接板,已经不能有效地工作了,或者不能很好地装入工业外壳里。MyPi 支持 HAT,另外还提供了公司自己定义的 “ASIO” (特定应用接口)插件模块,它会将自己的 I/O 扩展到载板上,载板再将它们连到载板边上的 8-pin,绿色,凤凰式工业 I/O 连接器(标记了“ASIO Out”)上,在下面图片里有描述。 ![](http://hackerboards.com/files/embeddedmicro_mypi_io-sm.jpg) >MyPi 的模块扩展接口 -就像 Kickstarter 页面里描述的:“比起在板边插满带 IO 信号接头的 HAT 板,我们有意将同样的 IO 信号接到另一个接头,它直接接到绿色的工业接头上。”另外,“通过简单地延长卡上的插脚长度(抬高),你将来可以直接扩展 IO 集 - 这些都不需要任何排线!”Embedded Micro 表示。 +就像 Kickstarter 页面里描述的:“比起在板边插满带 IO 信号接头的 HAT 板,我们更愿意把同样的 IO 信号接到另一个接头,它直接接到绿色的工业接头上。” 另外,“通过简单地延长卡上的插脚长度(抬高),你将来可以直接扩展 IO 集 - 这些都不需要任何排线!”Embedded Micro 表示。 ![](http://hackerboards.com/files/embeddedmicro_mypi_with_iocards-sm.jpg) >MyPi 和它的可选 I/O 插件板卡 -公司为 MyPi 提供了一系列可靠的 ASIO 插件板,像上面展示的。这些一开始会包括 CAN 总线,4-20mA 传感器信号,RS485,窄带 RF,等等。 +像上面展示的,这家公司为 MyPi 提供了一系列可靠的 ASIO 插卡,。一开始这些会包括 CAN 总线,4-20mA 传感器信号,RS485,窄带 RF,等等。 ### 更多信息 @@ -58,7 +58,7 @@ via: http://hackerboards.com/industrial-sbc-builds-on-rpi-compute-module/ 作者:[Eric Brown][a] 译者:[zpl1025](https://github.com/zpl1025) -校对:[校对者ID](https://github.com/校对者ID) +校对:[Ezio](https://github.com/oska874) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2f19bee95fd0bb828463f0f331636d2809b4fc1e Mon Sep 17 00:00:00 2001 From: cposture Date: Fri, 15 Jul 2016 14:11:18 +0800 Subject: [PATCH 1161/1469] Translating partly 50 --- ...eate Your Own Shell in Python - Part II.md | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/sources/tech/20160706 Create Your Own Shell in Python - Part II.md b/sources/tech/20160706 Create Your Own Shell in Python - Part II.md index 3154839443..2733288475 100644 --- a/sources/tech/20160706 Create Your Own Shell in Python - Part II.md +++ b/sources/tech/20160706 Create Your Own Shell in Python - Part II.md @@ -1,26 +1,25 @@ -Translating by cposture 2016.07.09 -Create Your Own Shell in Python - Part II +使用 Python 创建你自己的 Shell:Part II =========================================== -In [part 1][1], we already created a main shell loop, tokenized command input, and executed a command by fork and exec. In this part, we will solve the remaining problmes. First, `cd test_dir2` does not change our current directory. Second, we still have no way to exit from our shell gracefully. +在[part 1][1],我们已经创建了一个主要的 shell 循环、切分了的命令输入,以及通过 fork 和 exec 执行命令。在这部分,我们将会解决剩下的问题。首先,`cd test_dir2` 命令无法修改我们的当前目录。其次,我们仍无法优雅地从 shell 中退出。 -### Step 4: Built-in Commands +### 步骤 4:内置命令 -The statement “cd test_dir2 does not change our current directory” is true and false in some senses. It’s true in the sense that after executing the command, we are still at the same directory. However, the directory is actullay changed, but, it’s changed in the child process. +“cd test_dir2 无法修改我们的当前目录” 这句话是对的,但在某种意义上也是错的。在执行完该命令之后,我们仍然处在同一目录,从这个意义上讲,它是对的。然而,目录实际上已经被修改,只不过它是在子进程中被修改。 -Remember that we fork a child process, then, exec the command which does not happen on a parent process. The result is we just change the current directory of a child process, not the directory of a parent process. +还记得我们 fork 了一个子进程,然后执行命令,执行命令的过程没有发生在父进程上。结果是我们只是改变了子进程的当前目录,而不是父进程的目录。 -Then, the child process exits, and the parent process continues with the same intact directory. +然后子进程退出,且父进程在原封不动的目录下继续运行。 -Therefore, this kind of commands must be built-in with the shell itself. It must be executed in the shell process without forking. +因此,这类与 shell 自己相关的命令必须是内置命令。它必须在 shell 进程中执行而没有分叉(forking)。 #### cd -Let’s start with cd command. +让我们从 cd 命令开始。 -We first create a builtins directory. Each built-in command will be put inside this directory. +我们首先创建一个内置目录。每一个内置命令都会被放进这个目录中。 -``` +```shell yosh_project |-- yosh |-- builtins @@ -30,9 +29,9 @@ yosh_project |-- shell.py ``` -In cd.py, we implement our own cd command by using a system call os.chdir. +在 cd.py,我们通过使用系统调用 os.chdir 实现自己的 cd 命令。 -``` +```python import os from yosh.constants import * @@ -43,9 +42,9 @@ def cd(args): return SHELL_STATUS_RUN ``` -Notice that we return shell running status from a built-in function. Therefore, we move constants into yosh/constants.py to be used across the project. +注意,我们会从内置函数返回 shell 的运行状态。所以,为了能够在项目中继续使用常量,我们将它们移至 yosh/constants.py。 -``` +```shell yosh_project |-- yosh |-- builtins @@ -56,16 +55,16 @@ yosh_project |-- shell.py ``` -In constants.py, we put shell status constants here. +在 constants.py,我们将状态常量放在这里。 -``` +```python SHELL_STATUS_STOP = 0 SHELL_STATUS_RUN = 1 ``` -Now, our built-in cd is ready. Let’s modify our shell.py to handle built-in functions. +现在,我们的内置 cd 已经准备好了。让我们修改 shell.py 来处理这些内置函数。 -``` +```python ... # Import constants from yosh.constants import * @@ -90,6 +89,7 @@ def execute(cmd_tokens): ... ``` +我们使用一个 python 字典变量 built_in_cmds 作为哈希映射(a hash map),以存储我们的内置函数。在 execute 函数,我们提取命令的名字和参数。如果该命令在我们的哈希映射中,则调用对应的内置函数。 We use a Python dictionary built_in_cmds as a hash map to store our built-in functions. In execute function, we extract command name and arguments. If the command name is in our hash map, we call that built-in function. (Note: built_in_cmds[cmd_name] returns the function reference that can be invoked with arguments immediately.) From d1d49d8b7f6e3528ad48c8ad9d4835bff0cee816 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 15 Jul 2016 17:09:17 +0800 Subject: [PATCH 1162/1469] PUB:20160708 Using Vagrant to control your DigitalOcean cloud instances @MikeCoder @oska874 --- ...grant to control your DigitalOcean cloud instances.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/published/20160708 Using Vagrant to control your DigitalOcean cloud instances.md b/published/20160708 Using Vagrant to control your DigitalOcean cloud instances.md index b07a1cb5ed..541bcda865 100644 --- a/published/20160708 Using Vagrant to control your DigitalOcean cloud instances.md +++ b/published/20160708 Using Vagrant to control your DigitalOcean cloud instances.md @@ -3,7 +3,7 @@ ![](https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/fedora-vagrant-do-945x400.jpg) -[Vagrant][1] 是一个使用虚拟机创建和支持虚拟开发环境的应用。Fedora 官方已经在本地系统上通过库 `libvirt` [支持 Vagrant][2]。[DigitalOcean][3]是一个提供一键部署 Fedora 云服务实例到全固态存储服务器的云计算服务提供商。在[最近的 Raleigh 举办的 FAD 大会][4]中,Fedora 云计算队伍已经打包了一个 Vagrant 的新的插件,它能够帮助 Fedora 用户通过使用本地的 Vagrantfile 文件来管理 DigitalOcean 上的云服务实例。 +[Vagrant][1] 是一个使用虚拟机创建和支持虚拟开发环境的应用。Fedora 官方已经在本地系统上通过库 `libvirt` [支持 Vagrant][2]。[DigitalOcean][3] 是一个提供一键部署 Fedora 云服务实例到全 SSD 服务器的云计算服务提供商。在[最近的 Raleigh 举办的 FAD 大会][4]中,Fedora 云计算队伍为 Vagrant 打包了一个新的插件,它能够帮助 Fedora 用户通过使用本地的 Vagrantfile 文件来管理 DigitalOcean 上的云服务实例。 ### 如何使用这个插件 @@ -39,8 +39,7 @@ end ### Vagrant DigitalOcean 插件的注意事项 - -一定要记住的几个关于 SSH 的关键命名规范 : 如果你已经在 DigitalOcean 上传了秘钥,请确保 `provider.ssh_key_name` 和已经在服务器中的名字吻合。 `provider.image` 具体的文档可以在[DigitalOcean documentation][5]找到。在控制面板上的 `App & API` 部分可以创建认证令牌。 +一定要记住的几个关于 SSH 的关键命名规范 : 如果你已经在 DigitalOcean 上传了秘钥,请确保 `provider.ssh_key_name` 和已经在服务器中的名字吻合。 `provider.image` 具体的文档可以在[DigitalOcean documentation][5]找到。在控制面板上的 `App & API` 部分可以创建 AUTH 令牌。 你可以使用下面的命令启动一个实例。 @@ -48,14 +47,14 @@ end $ vagrant up --provider=digital_ocean ``` -这个命令会在 DigitalOcean 的启动一个服务器实例。然后你就可以使用 `vagrant ssh` 命令来 `ssh` 登陆进入这个实例。执行 vagrant destroy 来删除这个实例。 +这个命令会在 DigitalOcean 的启动一个服务器实例。然后你就可以使用 `vagrant ssh` 命令来 `ssh` 登录进入这个实例。可以执行 `vagrant destroy` 来删除这个实例。 -------------------------------------------------------------------------------- via: https://fedoramagazine.org/using-vagrant-digitalocean-cloud/ 作者:[Kushal Das][a] -译者:[译者ID](https://github.com/MikeCoder) +译者:[MikeCoder](https://github.com/MikeCoder) 校对:[Ezio](https://github.com/oska874) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From fddec9ee4e0e81a6fc15006bf4b8adc2d5d81b21 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 15 Jul 2016 17:44:11 +0800 Subject: [PATCH 1163/1469] PUB:20160624 Industrial SBC builds on Raspberry Pi Compute Module @zpl1025 @oska874 --- ...C builds on Raspberry Pi Compute Module.md | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/published/20160624 Industrial SBC builds on Raspberry Pi Compute Module.md b/published/20160624 Industrial SBC builds on Raspberry Pi Compute Module.md index d79d24652b..cf916044a6 100644 --- a/published/20160624 Industrial SBC builds on Raspberry Pi Compute Module.md +++ b/published/20160624 Industrial SBC builds on Raspberry Pi Compute Module.md @@ -3,17 +3,19 @@ ![](http://hackerboards.com/files/embeddedmicro_mypi-thm.jpg) -在 Kickstarter 众筹网站上,一个叫 “MyPi” 的项目用 RPi 计算模块制作了一款 SBC(译注: Single Board Computer 单板计算机),提供一个 mini-PCIe 插槽,串口,宽范围输入电源,以及模块扩展等功能。 +在 Kickstarter 众筹网站上,一个叫 “MyPi” 的项目用树莓派计算模块制作了一款 SBC(LCTT 译注: Single Board Computer 单板计算机),提供一个 mini-PCIe 插槽,串口,宽范围输入电源,以及模块扩展等功能。 -你也许觉得奇怪,都 2016 年了,为什么还会有人发布这样一款长得有点像三明治,用过时的基于 ARM11 的 COM (译注: Compuer on Module,模块化计算机)版本的原版树莓派,[树莓派计算模块][1],来构建单板计算机。首先,目前仍然有大量工业应用不需要太多 CPU 处理能力,第二,树莓派计算模块仍是目前仅有的基于树莓派硬件的 COM,虽然更便宜,有点像 COM 并采用 700MHz 处理器的 [零号树莓派][2]。 +你也许觉得奇怪,都 2016 年了,为什么还会有人发布这样一款长得有点像三明治,用过时的 ARM11 构建的 COM (LCTT 译注: Compuer on Module,模块化计算机)版本的树莓派单板计算机:[树莓派计算模块][1]。原因是这样的,首先,目前仍然有大量工业应用不需要太多 CPU 处理能力,第二,树莓派计算模块仍是目前仅有的基于树莓派硬件的 COM,虽然更便宜、有点像 COM 并采用同样的 700MHz 处理器的 [零号树莓派][2] 也很类似。 ![](http://hackerboards.com/files/embeddedmicro_mypi-sm.jpg) +*安装了 COM 和 I/O 组件的 MyPi* + ![](http://hackerboards.com/files/embeddedmicro_mypi_encl-sm.jpg) ->安装了 COM 和 I/O 组件的 MyPi(左),装入了可选的工业外壳中 +*装入了可选的工业外壳中* -另外,Embedded Micro Technology 还表示它的 SBC 还设计成支持升级替换成允许的树莓派计算模块 —— 采用了树莓派 3 的四核、Cortex-A53 博通 BCM2837处理器的 SoC。因为这个产品最近很快就会到货,不确定他们怎么能及时为 Kickstarter 赞助者处理好这一切。不过,以后能支持也挺不错,就算要为这个升级付费也可以接受。 +另外,Embedded Micro Technology 还表示它的 SBC 还设计成可升级替换为支持的树莓派计算模块 —— 采用了树莓派 3 的四核、Cortex-A53 博通 BCM2837处理器的 SoC。因为这个产品最近很快就会到货,不确定他们怎么能及时为 Kickstarter 赞助者处理好这一切。不过,以后能支持也挺不错,就算要为这个升级付费也可以接受。 MyPi 并不是唯一一款新的基于树莓派计算模块的商业嵌入式设备。Pigeon Computers 在五月份启动了 [Pigeon RB100][3] 的项目,是一个基于 COM 的工业自动化控制器。不过,包括 [Techbase Modberry][4] 在内的这一类设备大都出现在 2014 年 COM 发布之后的一小段时间内。 @@ -21,29 +23,35 @@ MyPi 的目标是 30 天内筹集 $21,696,目前已经实现了三分之一。 ![](http://hackerboards.com/files/embeddedmicro_mypi_baseboard-sm.jpg) +*不带 COM 和插件板的 MyPi 主板* + ![](http://hackerboards.com/files/embeddedmicro_mypi_detail-sm.jpg) ->不带 COM 和插件板的 MyPi 主板(左)以及它的接口定义 +*以及它的接口定义* 树莓派计算模块能给 MyPi 带来博通 BCM2835 Soc,512MB 内存,以及 4GB eMMC 存储空间。MyPi 主板扩展了一个 microSD 卡槽,一个 HDMI 接口,两个 USB 2.0 接口,一个 10/100M 以太网口,还有一个像网口的 RS232 端口(通过 USB 连接)。 ![](http://hackerboards.com/files/embeddedmicro_mypi_angle1-sm.jpg) +*插上树莓派计算模块和 mini-PCIe 模块的 MyPi 的两个视角* + ![](http://hackerboards.com/files/embeddedmicro_mypi_angle2.jpg) ->插上树莓派计算模块和 mini-PCIe 模块的 MyPi 的两个视角 +*插上树莓派计算模块和 mini-PCIe 模块的 MyPi 的两个视角* MyPi 还将配备一个 mini-PCIe 插槽,据说“只支持 USB,以及只适用 mPCIe 形式的调制解调器”。还带有一个 SIM 卡插槽。板上还有双标准的树莓派摄像头接口,一个音频输出接口,自带备用电池的 RTC,LED 灯。还支持宽范围的 9-23V 直流输入。 -Embedded Micro 表示,MyPi 是为那些树莓派爱好者们设计的,他们堆积了太多 HAT 外接板,已经不能有效地工作了,或者不能很好地装入工业外壳里。MyPi 支持 HAT,另外还提供了公司自己定义的 “ASIO” (特定应用接口)插件模块,它会将自己的 I/O 扩展到载板上,载板再将它们连到载板边上的 8-pin,绿色,凤凰式工业 I/O 连接器(标记了“ASIO Out”)上,在下面图片里有描述。 +Embedded Micro 表示,MyPi 是为那些树莓派爱好者们设计的,他们拼接了太多 HAT 外接板,已经不能有效地工作了,或者不能很好地装入工业外壳里。MyPi 支持 HAT,另外还提供了公司自己定义的 “ASIO” (特定应用接口)插件模块,它会将自己的 I/O 扩展到载板上,载板再将它们连到载板边上的 8针的绿色凤凰式工业 I/O 连接器(标记了“ASIO Out”)上,在下面图片里有描述。 ![](http://hackerboards.com/files/embeddedmicro_mypi_io-sm.jpg) ->MyPi 的模块扩展接口 + +*MyPi 的模块扩展接口* 就像 Kickstarter 页面里描述的:“比起在板边插满带 IO 信号接头的 HAT 板,我们更愿意把同样的 IO 信号接到另一个接头,它直接接到绿色的工业接头上。” 另外,“通过简单地延长卡上的插脚长度(抬高),你将来可以直接扩展 IO 集 - 这些都不需要任何排线!”Embedded Micro 表示。 ![](http://hackerboards.com/files/embeddedmicro_mypi_with_iocards-sm.jpg) ->MyPi 和它的可选 I/O 插件板卡 + +*MyPi 和它的可选 I/O 插件板卡* 像上面展示的,这家公司为 MyPi 提供了一系列可靠的 ASIO 插卡,。一开始这些会包括 CAN 总线,4-20mA 传感器信号,RS485,窄带 RF,等等。 @@ -51,7 +59,6 @@ Embedded Micro 表示,MyPi 是为那些树莓派爱好者们设计的,他们 MyPi 在 Kickstarter 上提供了 7 月 23 日到期的 79 英镑($119)早期参与包(不包括树莓派计算模块),预计九月份发货。更多信息请查看 [Kickstarter 上 MyPi 的页面][5] 以及 [Embedded Micro Technology 官网][6]。 - -------------------------------------------------------------------------------- via: http://hackerboards.com/industrial-sbc-builds-on-rpi-compute-module/ From 5b0200b6aab9291ec7c5ea59c2d3e1508d033d72 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 15 Jul 2016 20:20:07 +0800 Subject: [PATCH 1164/1469] PUB:20160624 How to permanently mount a Windows share on Linux @alim0x --- ...ermanently mount a Windows share on Linux.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) rename {translated/tech => published}/20160624 How to permanently mount a Windows share on Linux.md (83%) diff --git a/translated/tech/20160624 How to permanently mount a Windows share on Linux.md b/published/20160624 How to permanently mount a Windows share on Linux.md similarity index 83% rename from translated/tech/20160624 How to permanently mount a Windows share on Linux.md rename to published/20160624 How to permanently mount a Windows share on Linux.md index a205923fe0..1782a76241 100644 --- a/translated/tech/20160624 How to permanently mount a Windows share on Linux.md +++ b/published/20160624 How to permanently mount a Windows share on Linux.md @@ -4,13 +4,14 @@ > 如果你已经厌倦了每次重启 Linux 就得重新挂载 Windows 共享,读读这个让共享永久挂载的简单方法。 ![](http://tr2.cbsistatic.com/hub/i/2016/06/02/e965310b-b38d-43e6-9eac-ea520992138b/68fd9ec5d6731cc405bdd27f2f42848d/linuxadminhero.jpg) ->图片: Jack Wallen -在 Linux 上和一个 Windows 网络进行交互从来就不是件轻松的事情。想想多少企业正在采用 Linux,这两个平台不得不一起好好协作。幸运的是,有了一些工具的帮助,你可以轻松地将 Windows 网络驱动器映射到一台 Linux 机器上,甚至可以确保在重启 Linux 机器之后共享还在。 +*图片: Jack Wallen* + +在 Linux 上和一个 Windows 网络进行交互从来就不是件轻松的事情。想想多少企业正在采用 Linux,需要在这两个平台上彼此协作。幸运的是,有了一些工具的帮助,你可以轻松地将 Windows 网络驱动器映射到一台 Linux 机器上,甚至可以确保在重启 Linux 机器之后共享还在。 ### 在我们开始之前 -要实现这个,你需要用到命令行。过程十分简单,但你需要编辑 /etc/fstab 文件,所以小心操作。还有,我假设你已经有正常工作的 Samba 了,可以手动从 Windows 网络挂载共享到你的 Linux 机器,还知道这个共享的主机 IP 地址。 +要实现这个,你需要用到命令行。过程十分简单,但你需要编辑 /etc/fstab 文件,所以小心操作。还有,我假设你已经让 Samba 正常工作了,可以手动从 Windows 网络挂载共享到你的 Linux 机器,还知道这个共享的主机 IP 地址。 准备好了吗?那就开始吧。 @@ -22,7 +23,7 @@ sudo mkdir /media/share ``` -### 一些安装 +### 安装一些软件 现在我们得安装允许跨平台文件共享的系统;这个系统是 cifs-utils。在终端窗口输入: @@ -44,7 +45,7 @@ hosts: files mdns4_minimal [NOTFOUND=return] dns hosts: files mdns4_minimal [NOTFOUND=return] wins dns ``` -现在你必须安装 windbind 让你的 Linux 机器可以在 DHCP 网络中解析 Windows 机器名。在终端里执行: +现在你需要安装 windbind 让你的 Linux 机器可以在 DHCP 网络中解析 Windows 机器名。在终端里执行: ``` sudo apt-get install libnss-windbind windbind @@ -70,7 +71,7 @@ sudo cp /etc/fstab /etc/fstab.old sudo mv /etc/fstab.old /etc/fstab ``` -在你的主目录创建一个认证信息文件 .smbcredentials。在这个文件里添加你的用户名和密码,就像这样(USER 和 PASSWORD 是实际的用户名和密码): +在你的主目录创建一个认证信息文件 .smbcredentials。在这个文件里添加你的用户名和密码,就像这样(USER 和 PASSWORD 替换为实际的用户名和密码): ``` username=USER @@ -84,7 +85,7 @@ password=PASSWORD id USER ``` -USER 是实际的用户名,你应该会看到类似这样的信息: +USER 是你的实际用户名,你应该会看到类似这样的信息: ``` uid=1000(USER) gid=1000(GROUP) @@ -115,7 +116,7 @@ via: http://www.techrepublic.com/article/how-to-permanently-mount-a-windows-shar 作者:[Jack Wallen][a] 译者:[alim0x](https://github.com/alim0x) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 683f34b235fe2bad7b105dda48b7c4dbca85528c Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 15 Jul 2016 22:23:26 +0800 Subject: [PATCH 1165/1469] PUB:20160220 Best Cloud Services For Linux To Replace Copy @cposture --- ...loud Services For Linux To Replace Copy.md | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) rename {translated/tech => published}/20160220 Best Cloud Services For Linux To Replace Copy.md (76%) diff --git a/translated/tech/20160220 Best Cloud Services For Linux To Replace Copy.md b/published/20160220 Best Cloud Services For Linux To Replace Copy.md similarity index 76% rename from translated/tech/20160220 Best Cloud Services For Linux To Replace Copy.md rename to published/20160220 Best Cloud Services For Linux To Replace Copy.md index ce9380b600..a43c5776e8 100644 --- a/translated/tech/20160220 Best Cloud Services For Linux To Replace Copy.md +++ b/published/20160220 Best Cloud Services For Linux To Replace Copy.md @@ -3,9 +3,9 @@ ![](http://itsfoss.com/wp-content/uploads/2016/02/Linux-cloud-services.jpg) -云存储服务 Copy 即将关闭,我们 Linux 用户是时候该寻找其他优秀的** Copy 之外的 Linux 云存储服务**。 +云存储服务 Copy 已经关闭,我们 Linux 用户是时候该寻找其他优秀的** Copy 之外的 Linux 云存储服务**。 -全部文件将会在 2016年5月1号 被删除。如果你是 Copy 的用户,你应该保存你的文件并将它们移至其他地方。 +全部文件会在 2016年5月1号 被删除。如果你是 Copy 的用户,你应该保存你的文件并将它们移至其他地方。 在过去的两年里,Copy 已经成为了我最喜爱的云存储。它为我提供了大量的免费空间并且带有桌面平台的原生应用程序,包括 Linux 和移动平台如 iOS 和 Android。 @@ -13,16 +13,16 @@ 当我从 Copy.com 看到它即将关闭的消息,我的担忧成真了。事实上,Copy 并不孤独。它的母公司 [Barracuda Networks](https://www.barracuda.com/)正经历一段困难时期并且已经[雇佣 Morgan Stanely 寻找 合适的卖家](http://www.bloomberg.com/news/articles/2016-02-01/barracuda-networks-said-to-work-with-morgan-stanley-to-seek-sale)(s) -无论什么理由,我们所知道的是 Copy 将会成为历史,我们需要寻找相似的**优秀的 Linux 云服务**。我之所以强调 Linux 是因为其他流行的云存储服务,如[微软的OneDrive](https://onedrive.live.com/about/en-us/) 和 [Google Drive](https://www.google.com/drive/) 都没有提供本地 Linux 客户端。这是微软预计的事情,但是谷歌对 Linux 的冷漠令人震惊。 +无论什么理由,我们所知道的是 Copy 将会成为历史,我们需要寻找相似的**优秀的 Linux 云服务**。我之所以强调 Linux 是因为其他流行的云存储服务,如[微软的 OneDrive](https://onedrive.live.com/about/en-us/) 和 [Google Drive](https://www.google.com/drive/) 都没有提供本地 Linux 客户端。微软并没有出乎我们的预料,但是[谷歌对 Linux 的冷漠][1]令人震惊。 ## Linux 下 Copy 的最佳替代者 -现在,作为一个 Linux 存储,在云存储中你需要什么?让我们猜猜: +什么样的云服务才适合作为 Linux 下的存储服务?让我们猜猜: -- 大量的免费空间。毕竟,个人用户无法每月支付巨额款项。 -- 原生的 Linux 客户端。因此你能够使用提供的服务,方便地同步文件,而不用做一些特殊的调整或者定时执行脚本。 -- 其他桌面系统的客户端,比如 Windows 和 OS X。便携性是必要的,并且同步设备间的文件是一种很好的缓解。 -- Android 和 iOS 的移动应用程序。在今天的现代世界里,你需要连接所有设备。 +- 大量的免费空间。毕竟,个人用户无法支付每月的巨额款项。 +- 原生的 Linux 客户端。以便你能够方便的在服务器之间同步文件,而不用做一些特殊的调整或者定时执行脚本。 +- 其他桌面系统的客户端,比如 Windows 和 OS X。移动性是必要的,并且同步设备间的文件也很有必要。 +- 基于 Android 和 iOS 的移动应用程序。在今天的现代世界里,你需要连接所有设备。 我不将自托管的云服务计算在内,比如 OwnCloud 或 [Seafile](https://www.seafile.com/en/home/) ,因为它们需要自己建立和运行一个服务器。这不适合所有想要类似 Copy 的云服务的家庭用户。 @@ -32,7 +32,7 @@ ![](http://itsfoss.com/wp-content/uploads/2016/02/Mega-Linux.jpg) -如果你是一个 It’s FOSS 的普通读者,你可能已经看过我之前的一篇有关[Mega on Linux](http://itsfoss.com/install-mega-cloud-storage-linux/)的文章。这种云服务由[Megaupload scandal](https://en.wikipedia.org/wiki/Megaupload) 公司下臭名昭著的[Kim Dotcom](https://en.wikipedia.org/wiki/Kim_Dotcom)提供。这也使一些用户怀疑它,因为 Kim Dotcom 已经很长一段时间成为美国当局的目标。 +如果你是一个 It’s FOSS 的普通读者,你可能已经看过我之前的一篇有关 [Mega on Linux](http://itsfoss.com/install-mega-cloud-storage-linux/)的文章。这种云服务由 [Megaupload scandal](https://en.wikipedia.org/wiki/Megaupload) 公司下臭名昭著的 [Kim Dotcom](https://en.wikipedia.org/wiki/Kim_Dotcom) 提供。这也使一些用户怀疑它,因为 Kim Dotcom 已经很长一段时间成为美国当局的目标。 Mega 拥有方便免费云服务下你所期望的一切。它给每个个人用户提供 50 GB 的免费存储空间。提供Linux 和其他平台下的原生客户端,并带有端到端的加密。原生的 Linux 客户端运行良好,可以无缝地跨平台同步。你也能在浏览器上查看操作你的文件。 @@ -74,7 +74,7 @@ Hubic 拥有一些不错的功能。除了简单的用户界面、文件共享 ![](http://itsfoss.com/wp-content/uploads/2016/02/pCloud-Linux.jpeg) -pCloud 是另一款欧洲的发行软件,但这一次从瑞士横跨法国边境。专注于加密和安全,pCloud 为每一个注册者提供 10 GB 的免费存储空间。你可以通过邀请好友、在社交媒体上分享链接等方式将空间增加至 20 GB。 +pCloud 是另一款欧洲的发行软件,但这一次跨过了法国边境,它来自瑞士。专注于加密和安全,pCloud 为每一个注册者提供 10 GB 的免费存储空间。你可以通过邀请好友、在社交媒体上分享链接等方式将空间增加至 20 GB。 它拥有云服务的所有标准特性,例如文件共享、同步、选择性同步等等。pCloud 也有跨平台原生客户端,当然包括 Linux。 @@ -128,8 +128,9 @@ via: http://itsfoss.com/cloud-services-linux/ 作者:[ABHISHEK][a] 译者:[cposture](https://github.com/cposture) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://itsfoss.com/author/abhishek/ +[1]:https://itsfoss.com/google-hates-desktop-linux/ \ No newline at end of file From 8079ec325040447803b2b1fe499b57a61b88a65d Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 15 Jul 2016 22:28:50 +0800 Subject: [PATCH 1166/1469] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @kylepeng93 --- ...newcomer's guide to navigating OpenStack Infrastructure.md} | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) rename translated/tech/{A newcomer's guide to navigating OpenStack Infrastructure.md => 20160416 A newcomer's guide to navigating OpenStack Infrastructure.md} (99%) diff --git a/translated/tech/A newcomer's guide to navigating OpenStack Infrastructure.md b/translated/tech/20160416 A newcomer's guide to navigating OpenStack Infrastructure.md similarity index 99% rename from translated/tech/A newcomer's guide to navigating OpenStack Infrastructure.md rename to translated/tech/20160416 A newcomer's guide to navigating OpenStack Infrastructure.md index b22d5e1fd5..25353ef462 100644 --- a/translated/tech/A newcomer's guide to navigating OpenStack Infrastructure.md +++ b/translated/tech/20160416 A newcomer's guide to navigating OpenStack Infrastructure.md @@ -1,4 +1,3 @@ -translating by kylepeng93 给学习OpenStack基础设施的新手的入门指南 =========================================================== @@ -39,7 +38,7 @@ translating by kylepeng93 via: https://opensource.com/business/16/4/interview-openstack-infrastructure-beginners 作者:[linux.com][a] -译者:[译者ID](https://github.com/译者ID) +译者:[kylepeng93](https://github.com/kylepeng93) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 31a898b314bc71e8638a55df2e9f9822d9008d2f Mon Sep 17 00:00:00 2001 From: cposture Date: Sat, 16 Jul 2016 00:02:06 +0800 Subject: [PATCH 1167/1469] Translting partly 70 --- .../20160706 Create Your Own Shell in Python - Part II.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sources/tech/20160706 Create Your Own Shell in Python - Part II.md b/sources/tech/20160706 Create Your Own Shell in Python - Part II.md index 2733288475..26f0625368 100644 --- a/sources/tech/20160706 Create Your Own Shell in Python - Part II.md +++ b/sources/tech/20160706 Create Your Own Shell in Python - Part II.md @@ -89,12 +89,11 @@ def execute(cmd_tokens): ... ``` -我们使用一个 python 字典变量 built_in_cmds 作为哈希映射(a hash map),以存储我们的内置函数。在 execute 函数,我们提取命令的名字和参数。如果该命令在我们的哈希映射中,则调用对应的内置函数。 -We use a Python dictionary built_in_cmds as a hash map to store our built-in functions. In execute function, we extract command name and arguments. If the command name is in our hash map, we call that built-in function. +我们使用一个 python 字典变量 built_in_cmds 作为哈希映射(a hash map),以存储我们的内置函数。我们在 execute 函数中提取命令的名字和参数。如果该命令在我们的哈希映射中,则调用对应的内置函数。 -(Note: built_in_cmds[cmd_name] returns the function reference that can be invoked with arguments immediately.) +(提示:built_in_cmds[cmd_name] 返回能直接使用参数调用的函数引用的。) -We are almost ready to use the built-in cd function. The last thing is to add cd function into the built_in_cmds map. +我们差不多准备好使用内置的 cd 函数了。最后一步是将 cd 函数添加到 built_in_cmds 映射中。 ``` ... @@ -119,6 +118,7 @@ def main(): shell_loop() ``` +我们定义 register_command 函数以添加一个内置函数到我们内置的命令哈希映射。 We define register_command function for adding a built-in function to our built-in commmand hash map. Then, we define init function and register the built-in cd function there. Notice the line register_command("cd", cd). The first argument is a command name. The second argument is a reference to a function. In order to let cd, in the second argument, refer to the cd function reference in yosh/builtins/cd.py, we have to put the following line in yosh/builtins/__init__.py. From 0eeb6216837084d151202801bc689acfc4f691c8 Mon Sep 17 00:00:00 2001 From: cposture Date: Sat, 16 Jul 2016 01:04:01 +0800 Subject: [PATCH 1168/1469] Translating partly 75:wq --- ...20160706 Create Your Own Shell in Python - Part II.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sources/tech/20160706 Create Your Own Shell in Python - Part II.md b/sources/tech/20160706 Create Your Own Shell in Python - Part II.md index 26f0625368..934011e0cf 100644 --- a/sources/tech/20160706 Create Your Own Shell in Python - Part II.md +++ b/sources/tech/20160706 Create Your Own Shell in Python - Part II.md @@ -118,16 +118,19 @@ def main(): shell_loop() ``` -我们定义 register_command 函数以添加一个内置函数到我们内置的命令哈希映射。 -We define register_command function for adding a built-in function to our built-in commmand hash map. Then, we define init function and register the built-in cd function there. +我们定义 register_command 函数以添加一个内置函数到我们内置的命令哈希映射。接着,我们定义 init 函数并且在这里注册内置的 cd 函数。 -Notice the line register_command("cd", cd). The first argument is a command name. The second argument is a reference to a function. In order to let cd, in the second argument, refer to the cd function reference in yosh/builtins/cd.py, we have to put the following line in yosh/builtins/__init__.py. +注意这行 register_command("cd", cd) 。第一个参数为命令的名字。第二个参数为一个函数引用。为了能够让第二个参数 cd 引用到 yosh/builtins/cd.py 中的cd 函数引用,我们必须将以下这行代码放在 yosh/builtins/__init__.py 文件中。 ``` from yosh.builtins.cd import * ``` + +因此,在 yosh/shell.py 中,当我们从 yosh.builtins 导入 * 时,我们可以得到已经通过 yosh.builtins +被导入的 cd 函数引用。 Therefore, in yosh/shell.py, when we import * from yosh.builtins, we get cd function reference that is already imported by yosh.builtins. +我们已经准备好了代码。 We’ve done preparing our code. Let’s try by running our shell as a module python -m yosh.shell at the same level as the yosh directory. Now, our cd command should change our shell directory correctly while non-built-in commands still work too. Cool. From 89d9ed97814565e48fc03badce1090df909a1b82 Mon Sep 17 00:00:00 2001 From: cposture Date: Sat, 16 Jul 2016 11:03:10 +0800 Subject: [PATCH 1169/1469] Translated by cposture --- ...eate Your Own Shell in Python - Part II.md | 63 +++++++++---------- 1 file changed, 30 insertions(+), 33 deletions(-) diff --git a/sources/tech/20160706 Create Your Own Shell in Python - Part II.md b/sources/tech/20160706 Create Your Own Shell in Python - Part II.md index 934011e0cf..0f0cd6a878 100644 --- a/sources/tech/20160706 Create Your Own Shell in Python - Part II.md +++ b/sources/tech/20160706 Create Your Own Shell in Python - Part II.md @@ -1,7 +1,7 @@ 使用 Python 创建你自己的 Shell:Part II =========================================== -在[part 1][1],我们已经创建了一个主要的 shell 循环、切分了的命令输入,以及通过 fork 和 exec 执行命令。在这部分,我们将会解决剩下的问题。首先,`cd test_dir2` 命令无法修改我们的当前目录。其次,我们仍无法优雅地从 shell 中退出。 +在[part 1][1] 中,我们已经创建了一个主要的 shell 循环、切分了的命令输入,以及通过 `fork` 和 `exec` 执行命令。在这部分,我们将会解决剩下的问题。首先,`cd test_dir2` 命令无法修改我们的当前目录。其次,我们仍无法优雅地从 shell 中退出。 ### 步骤 4:内置命令 @@ -9,15 +9,15 @@ 还记得我们 fork 了一个子进程,然后执行命令,执行命令的过程没有发生在父进程上。结果是我们只是改变了子进程的当前目录,而不是父进程的目录。 -然后子进程退出,且父进程在原封不动的目录下继续运行。 +然后子进程退出,而父进程在原封不动的目录下继续运行。 因此,这类与 shell 自己相关的命令必须是内置命令。它必须在 shell 进程中执行而没有分叉(forking)。 #### cd -让我们从 cd 命令开始。 +让我们从 `cd` 命令开始。 -我们首先创建一个内置目录。每一个内置命令都会被放进这个目录中。 +我们首先创建一个 `builtins` 目录。每一个内置命令都会被放进这个目录中。 ```shell yosh_project @@ -29,7 +29,7 @@ yosh_project |-- shell.py ``` -在 cd.py,我们通过使用系统调用 os.chdir 实现自己的 cd 命令。 +在 `cd.py` 中,我们通过使用系统调用 `os.chdir` 实现自己的 `cd` 命令。 ```python import os @@ -42,7 +42,7 @@ def cd(args): return SHELL_STATUS_RUN ``` -注意,我们会从内置函数返回 shell 的运行状态。所以,为了能够在项目中继续使用常量,我们将它们移至 yosh/constants.py。 +注意,我们会从内置函数返回 shell 的运行状态。所以,为了能够在项目中继续使用常量,我们将它们移至 `yosh/constants.py`。 ```shell yosh_project @@ -55,14 +55,14 @@ yosh_project |-- shell.py ``` -在 constants.py,我们将状态常量放在这里。 +在 `constants.py` 中,我们将状态常量都放在这里。 ```python SHELL_STATUS_STOP = 0 SHELL_STATUS_RUN = 1 ``` -现在,我们的内置 cd 已经准备好了。让我们修改 shell.py 来处理这些内置函数。 +现在,我们的内置 `cd` 已经准备好了。让我们修改 `shell.py` 来处理这些内置函数。 ```python ... @@ -89,11 +89,11 @@ def execute(cmd_tokens): ... ``` -我们使用一个 python 字典变量 built_in_cmds 作为哈希映射(a hash map),以存储我们的内置函数。我们在 execute 函数中提取命令的名字和参数。如果该命令在我们的哈希映射中,则调用对应的内置函数。 +我们使用一个 python 字典变量 `built_in_cmds` 作为哈希映射(hash map),以存储我们的内置函数。我们在 `execute` 函数中提取命令的名字和参数。如果该命令在我们的哈希映射中,则调用对应的内置函数。 -(提示:built_in_cmds[cmd_name] 返回能直接使用参数调用的函数引用的。) +(提示:`built_in_cmds[cmd_name]` 返回能直接使用参数调用的函数引用的。) -我们差不多准备好使用内置的 cd 函数了。最后一步是将 cd 函数添加到 built_in_cmds 映射中。 +我们差不多准备好使用内置的 `cd` 函数了。最后一步是将 `cd` 函数添加到 `built_in_cmds` 映射中。 ``` ... @@ -118,32 +118,29 @@ def main(): shell_loop() ``` -我们定义 register_command 函数以添加一个内置函数到我们内置的命令哈希映射。接着,我们定义 init 函数并且在这里注册内置的 cd 函数。 +我们定义了 `register_command` 函数,以添加一个内置函数到我们内置的命令哈希映射。接着,我们定义 `init` 函数并且在这里注册内置的 `cd` 函数。 -注意这行 register_command("cd", cd) 。第一个参数为命令的名字。第二个参数为一个函数引用。为了能够让第二个参数 cd 引用到 yosh/builtins/cd.py 中的cd 函数引用,我们必须将以下这行代码放在 yosh/builtins/__init__.py 文件中。 +注意这行 `register_command("cd", cd)` 。第一个参数为命令的名字。第二个参数为一个函数引用。为了能够让第二个参数 `cd` 引用到 `yosh/builtins/cd.py` 中的 `cd` 函数引用,我们必须将以下这行代码放在 `yosh/builtins/__init__.py` 文件中。 ``` from yosh.builtins.cd import * ``` -因此,在 yosh/shell.py 中,当我们从 yosh.builtins 导入 * 时,我们可以得到已经通过 yosh.builtins -被导入的 cd 函数引用。 -Therefore, in yosh/shell.py, when we import * from yosh.builtins, we get cd function reference that is already imported by yosh.builtins. +因此,在 `yosh/shell.py` 中,当我们从 `yosh.builtins` 导入 `*` 时,我们可以得到已经通过 `yosh.builtins` 导入的 `cd` 函数引用。 -我们已经准备好了代码。 -We’ve done preparing our code. Let’s try by running our shell as a module python -m yosh.shell at the same level as the yosh directory. +我们已经准备好了代码。让我们尝试在 `yosh` 同级目录下以模块形式运行我们的 shell,`python -m yosh.shell`。 -Now, our cd command should change our shell directory correctly while non-built-in commands still work too. Cool. +现在,`cd` 命令可以正确修改我们的 shell 目录了,同时非内置命令仍然可以工作。非常好! #### exit -Here comes the last piece: to exit gracefully. +最后一块终于来了:优雅地退出。 -We need a function that changes the shell status to be SHELL_STATUS_STOP. So, the shell loop will naturally break and the shell program will end and exit. +我们需要一个可以修改 shell 状态为 `SHELL_STATUS_STOP` 的函数。这样,shell 循环可以自然地结束,shell 将到达终点而退出。 -As same as cd, if we fork and exec exit in a child process, the parent process will still remain inact. Therefore, the exit function is needed to be a shell built-in function. +和 `cd` 一样,如果我们在子进程中 fork 和执行 `exit` 函数,其对父进程是不起作用的。因此,`exit` 函数需要成为一个 shell 内置函数。 -Let’s start by creating a new file called exit.py in the builtins folder. +让我们从这开始:在 `builtins` 目录下创建一个名为 `exit.py` 的新文件。 ``` yosh_project @@ -157,7 +154,7 @@ yosh_project |-- shell.py ``` -The exit.py defines the exit function that just returns the status to break the main loop. +`exit.py` 定义了一个 `exit` 函数,该函数仅仅返回一个可以退出主循环的状态。 ``` from yosh.constants import * @@ -167,14 +164,14 @@ def exit(args): return SHELL_STATUS_STOP ``` -Then, we import the exit function reference in `yosh/builtins/__init__.py`. +然后,我们导入位于 `yosh/builtins/__init__.py` 文件的 `exit` 函数引用。 ``` from yosh.builtins.cd import * from yosh.builtins.exit import * ``` -Finally, in shell.py, we register the exit command in `init()` function. +最后,我们在 `shell.py` 中的 `init()` 函数注册 `exit` 命令。 ``` @@ -188,17 +185,17 @@ def init(): ... ``` -That’s all! +到此为止! -Try running python -m yosh.shell. Now you can enter exit to quit the program gracefully. +尝试执行 `python -m yosh.shell`。现在你可以输入 `exit` 优雅地退出程序了。 -### Final Thought +### 最后的想法 -I hope you enjoy creating yosh (your own shell) like I do. However, my version of yosh is still in an early stage. I don’t handle several corner cases that can corrupt the shell. There are a lot of built-in commands that I don’t cover. Some non-built-in commands can also be implemented as built-in commands to improve performance (avoid new process creation time). And, a ton of features are not yet implemented (see Common features and Differing features). +我希望你能像我一样享受创建 `yosh` (**y**our **o**wn **sh**ell)的过程。但我的 `yosh` 版本仍处于早期阶段。我没有处理一些会使 shell 崩溃的极端状况。还有很多我没有覆盖的内置命令。为了提高性能,一些非内置命令也可以实现为内置命令(避免新进程创建时间)。同时,大量的功能还没有实现(请看 [公共特性](http://tldp.org/LDP/Bash-Beginners-Guide/html/x7243.html) 和 [不同特性](http://www.tldp.org/LDP/intro-linux/html/x12249.html)) -I’ve provided the source code at github.com/supasate/yosh. Feel free to fork and play around. +我已经在 github.com/supasate/yosh 中提供了源代码。请随意 fork 和尝试。 -Now, it’s your turn to make it real Your Own SHell. +现在该是创建你真正自己拥有的 Shell 的时候了。 Happy Coding! @@ -207,7 +204,7 @@ Happy Coding! via: https://hackercollider.com/articles/2016/07/06/create-your-own-shell-in-python-part-2/ 作者:[Supasate Choochaisri][a] -译者:[译者ID](https://github.com/译者ID) +译者:[cposture](https://github.com/cposture) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From fc7e5a6dec6dea4bc018f29beaca8e944f4594c1 Mon Sep 17 00:00:00 2001 From: cposture Date: Sat, 16 Jul 2016 11:04:29 +0800 Subject: [PATCH 1170/1469] Translated by cposture --- .../tech/20160706 Create Your Own Shell in Python - Part II.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20160706 Create Your Own Shell in Python - Part II.md (100%) diff --git a/sources/tech/20160706 Create Your Own Shell in Python - Part II.md b/translated/tech/20160706 Create Your Own Shell in Python - Part II.md similarity index 100% rename from sources/tech/20160706 Create Your Own Shell in Python - Part II.md rename to translated/tech/20160706 Create Your Own Shell in Python - Part II.md From d7dd2e863b6d397c1fbefe9bd4283f56bbfc7286 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=AE=B6=E5=90=AF?= Date: Sat, 16 Jul 2016 20:53:33 +0800 Subject: [PATCH 1171/1469] Translated by cposture (#4187) * Translated by cposture * Translating by cposture * translating partly * translating partly 75 * Translated by cposture * Translated by cposture * Translating by cposture * Translating partly 50 * Translting partly 70 * Translating partly 75:wq * Translated by cposture * Translated by cposture --- ...eate Your Own Shell in Python - Part II.md | 216 ------------------ ...eate Your Own Shell in Python - Part II.md | 216 ++++++++++++++++++ 2 files changed, 216 insertions(+), 216 deletions(-) delete mode 100644 sources/tech/20160706 Create Your Own Shell in Python - Part II.md create mode 100644 translated/tech/20160706 Create Your Own Shell in Python - Part II.md diff --git a/sources/tech/20160706 Create Your Own Shell in Python - Part II.md b/sources/tech/20160706 Create Your Own Shell in Python - Part II.md deleted file mode 100644 index 3154839443..0000000000 --- a/sources/tech/20160706 Create Your Own Shell in Python - Part II.md +++ /dev/null @@ -1,216 +0,0 @@ -Translating by cposture 2016.07.09 -Create Your Own Shell in Python - Part II -=========================================== - -In [part 1][1], we already created a main shell loop, tokenized command input, and executed a command by fork and exec. In this part, we will solve the remaining problmes. First, `cd test_dir2` does not change our current directory. Second, we still have no way to exit from our shell gracefully. - -### Step 4: Built-in Commands - -The statement “cd test_dir2 does not change our current directory” is true and false in some senses. It’s true in the sense that after executing the command, we are still at the same directory. However, the directory is actullay changed, but, it’s changed in the child process. - -Remember that we fork a child process, then, exec the command which does not happen on a parent process. The result is we just change the current directory of a child process, not the directory of a parent process. - -Then, the child process exits, and the parent process continues with the same intact directory. - -Therefore, this kind of commands must be built-in with the shell itself. It must be executed in the shell process without forking. - -#### cd - -Let’s start with cd command. - -We first create a builtins directory. Each built-in command will be put inside this directory. - -``` -yosh_project -|-- yosh - |-- builtins - | |-- __init__.py - | |-- cd.py - |-- __init__.py - |-- shell.py -``` - -In cd.py, we implement our own cd command by using a system call os.chdir. - -``` -import os -from yosh.constants import * - - -def cd(args): - os.chdir(args[0]) - - return SHELL_STATUS_RUN -``` - -Notice that we return shell running status from a built-in function. Therefore, we move constants into yosh/constants.py to be used across the project. - -``` -yosh_project -|-- yosh - |-- builtins - | |-- __init__.py - | |-- cd.py - |-- __init__.py - |-- constants.py - |-- shell.py -``` - -In constants.py, we put shell status constants here. - -``` -SHELL_STATUS_STOP = 0 -SHELL_STATUS_RUN = 1 -``` - -Now, our built-in cd is ready. Let’s modify our shell.py to handle built-in functions. - -``` -... -# Import constants -from yosh.constants import * - -# Hash map to store built-in function name and reference as key and value -built_in_cmds = {} - - -def tokenize(string): - return shlex.split(string) - - -def execute(cmd_tokens): - # Extract command name and arguments from tokens - cmd_name = cmd_tokens[0] - cmd_args = cmd_tokens[1:] - - # If the command is a built-in command, invoke its function with arguments - if cmd_name in built_in_cmds: - return built_in_cmds[cmd_name](cmd_args) - - ... -``` - -We use a Python dictionary built_in_cmds as a hash map to store our built-in functions. In execute function, we extract command name and arguments. If the command name is in our hash map, we call that built-in function. - -(Note: built_in_cmds[cmd_name] returns the function reference that can be invoked with arguments immediately.) - -We are almost ready to use the built-in cd function. The last thing is to add cd function into the built_in_cmds map. - -``` -... -# Import all built-in function references -from yosh.builtins import * - -... - -# Register a built-in function to built-in command hash map -def register_command(name, func): - built_in_cmds[name] = func - - -# Register all built-in commands here -def init(): - register_command("cd", cd) - - -def main(): - # Init shell before starting the main loop - init() - shell_loop() -``` - -We define register_command function for adding a built-in function to our built-in commmand hash map. Then, we define init function and register the built-in cd function there. - -Notice the line register_command("cd", cd). The first argument is a command name. The second argument is a reference to a function. In order to let cd, in the second argument, refer to the cd function reference in yosh/builtins/cd.py, we have to put the following line in yosh/builtins/__init__.py. - -``` -from yosh.builtins.cd import * -``` -Therefore, in yosh/shell.py, when we import * from yosh.builtins, we get cd function reference that is already imported by yosh.builtins. - -We’ve done preparing our code. Let’s try by running our shell as a module python -m yosh.shell at the same level as the yosh directory. - -Now, our cd command should change our shell directory correctly while non-built-in commands still work too. Cool. - -#### exit - -Here comes the last piece: to exit gracefully. - -We need a function that changes the shell status to be SHELL_STATUS_STOP. So, the shell loop will naturally break and the shell program will end and exit. - -As same as cd, if we fork and exec exit in a child process, the parent process will still remain inact. Therefore, the exit function is needed to be a shell built-in function. - -Let’s start by creating a new file called exit.py in the builtins folder. - -``` -yosh_project -|-- yosh - |-- builtins - | |-- __init__.py - | |-- cd.py - | |-- exit.py - |-- __init__.py - |-- constants.py - |-- shell.py -``` - -The exit.py defines the exit function that just returns the status to break the main loop. - -``` -from yosh.constants import * - - -def exit(args): - return SHELL_STATUS_STOP -``` - -Then, we import the exit function reference in `yosh/builtins/__init__.py`. - -``` -from yosh.builtins.cd import * -from yosh.builtins.exit import * -``` - -Finally, in shell.py, we register the exit command in `init()` function. - - -``` -... - -# Register all built-in commands here -def init(): - register_command("cd", cd) - register_command("exit", exit) - -... -``` - -That’s all! - -Try running python -m yosh.shell. Now you can enter exit to quit the program gracefully. - -### Final Thought - -I hope you enjoy creating yosh (your own shell) like I do. However, my version of yosh is still in an early stage. I don’t handle several corner cases that can corrupt the shell. There are a lot of built-in commands that I don’t cover. Some non-built-in commands can also be implemented as built-in commands to improve performance (avoid new process creation time). And, a ton of features are not yet implemented (see Common features and Differing features). - -I’ve provided the source code at github.com/supasate/yosh. Feel free to fork and play around. - -Now, it’s your turn to make it real Your Own SHell. - -Happy Coding! - --------------------------------------------------------------------------------- - -via: https://hackercollider.com/articles/2016/07/06/create-your-own-shell-in-python-part-2/ - -作者:[Supasate Choochaisri][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://disqus.com/by/supasate_choochaisri/ -[1]: https://hackercollider.com/articles/2016/07/05/create-your-own-shell-in-python-part-1/ -[2]: http://tldp.org/LDP/Bash-Beginners-Guide/html/x7243.html -[3]: http://www.tldp.org/LDP/intro-linux/html/x12249.html -[4]: https://github.com/supasate/yosh diff --git a/translated/tech/20160706 Create Your Own Shell in Python - Part II.md b/translated/tech/20160706 Create Your Own Shell in Python - Part II.md new file mode 100644 index 0000000000..0f0cd6a878 --- /dev/null +++ b/translated/tech/20160706 Create Your Own Shell in Python - Part II.md @@ -0,0 +1,216 @@ +使用 Python 创建你自己的 Shell:Part II +=========================================== + +在[part 1][1] 中,我们已经创建了一个主要的 shell 循环、切分了的命令输入,以及通过 `fork` 和 `exec` 执行命令。在这部分,我们将会解决剩下的问题。首先,`cd test_dir2` 命令无法修改我们的当前目录。其次,我们仍无法优雅地从 shell 中退出。 + +### 步骤 4:内置命令 + +“cd test_dir2 无法修改我们的当前目录” 这句话是对的,但在某种意义上也是错的。在执行完该命令之后,我们仍然处在同一目录,从这个意义上讲,它是对的。然而,目录实际上已经被修改,只不过它是在子进程中被修改。 + +还记得我们 fork 了一个子进程,然后执行命令,执行命令的过程没有发生在父进程上。结果是我们只是改变了子进程的当前目录,而不是父进程的目录。 + +然后子进程退出,而父进程在原封不动的目录下继续运行。 + +因此,这类与 shell 自己相关的命令必须是内置命令。它必须在 shell 进程中执行而没有分叉(forking)。 + +#### cd + +让我们从 `cd` 命令开始。 + +我们首先创建一个 `builtins` 目录。每一个内置命令都会被放进这个目录中。 + +```shell +yosh_project +|-- yosh + |-- builtins + | |-- __init__.py + | |-- cd.py + |-- __init__.py + |-- shell.py +``` + +在 `cd.py` 中,我们通过使用系统调用 `os.chdir` 实现自己的 `cd` 命令。 + +```python +import os +from yosh.constants import * + + +def cd(args): + os.chdir(args[0]) + + return SHELL_STATUS_RUN +``` + +注意,我们会从内置函数返回 shell 的运行状态。所以,为了能够在项目中继续使用常量,我们将它们移至 `yosh/constants.py`。 + +```shell +yosh_project +|-- yosh + |-- builtins + | |-- __init__.py + | |-- cd.py + |-- __init__.py + |-- constants.py + |-- shell.py +``` + +在 `constants.py` 中,我们将状态常量都放在这里。 + +```python +SHELL_STATUS_STOP = 0 +SHELL_STATUS_RUN = 1 +``` + +现在,我们的内置 `cd` 已经准备好了。让我们修改 `shell.py` 来处理这些内置函数。 + +```python +... +# Import constants +from yosh.constants import * + +# Hash map to store built-in function name and reference as key and value +built_in_cmds = {} + + +def tokenize(string): + return shlex.split(string) + + +def execute(cmd_tokens): + # Extract command name and arguments from tokens + cmd_name = cmd_tokens[0] + cmd_args = cmd_tokens[1:] + + # If the command is a built-in command, invoke its function with arguments + if cmd_name in built_in_cmds: + return built_in_cmds[cmd_name](cmd_args) + + ... +``` + +我们使用一个 python 字典变量 `built_in_cmds` 作为哈希映射(hash map),以存储我们的内置函数。我们在 `execute` 函数中提取命令的名字和参数。如果该命令在我们的哈希映射中,则调用对应的内置函数。 + +(提示:`built_in_cmds[cmd_name]` 返回能直接使用参数调用的函数引用的。) + +我们差不多准备好使用内置的 `cd` 函数了。最后一步是将 `cd` 函数添加到 `built_in_cmds` 映射中。 + +``` +... +# Import all built-in function references +from yosh.builtins import * + +... + +# Register a built-in function to built-in command hash map +def register_command(name, func): + built_in_cmds[name] = func + + +# Register all built-in commands here +def init(): + register_command("cd", cd) + + +def main(): + # Init shell before starting the main loop + init() + shell_loop() +``` + +我们定义了 `register_command` 函数,以添加一个内置函数到我们内置的命令哈希映射。接着,我们定义 `init` 函数并且在这里注册内置的 `cd` 函数。 + +注意这行 `register_command("cd", cd)` 。第一个参数为命令的名字。第二个参数为一个函数引用。为了能够让第二个参数 `cd` 引用到 `yosh/builtins/cd.py` 中的 `cd` 函数引用,我们必须将以下这行代码放在 `yosh/builtins/__init__.py` 文件中。 + +``` +from yosh.builtins.cd import * +``` + +因此,在 `yosh/shell.py` 中,当我们从 `yosh.builtins` 导入 `*` 时,我们可以得到已经通过 `yosh.builtins` 导入的 `cd` 函数引用。 + +我们已经准备好了代码。让我们尝试在 `yosh` 同级目录下以模块形式运行我们的 shell,`python -m yosh.shell`。 + +现在,`cd` 命令可以正确修改我们的 shell 目录了,同时非内置命令仍然可以工作。非常好! + +#### exit + +最后一块终于来了:优雅地退出。 + +我们需要一个可以修改 shell 状态为 `SHELL_STATUS_STOP` 的函数。这样,shell 循环可以自然地结束,shell 将到达终点而退出。 + +和 `cd` 一样,如果我们在子进程中 fork 和执行 `exit` 函数,其对父进程是不起作用的。因此,`exit` 函数需要成为一个 shell 内置函数。 + +让我们从这开始:在 `builtins` 目录下创建一个名为 `exit.py` 的新文件。 + +``` +yosh_project +|-- yosh + |-- builtins + | |-- __init__.py + | |-- cd.py + | |-- exit.py + |-- __init__.py + |-- constants.py + |-- shell.py +``` + +`exit.py` 定义了一个 `exit` 函数,该函数仅仅返回一个可以退出主循环的状态。 + +``` +from yosh.constants import * + + +def exit(args): + return SHELL_STATUS_STOP +``` + +然后,我们导入位于 `yosh/builtins/__init__.py` 文件的 `exit` 函数引用。 + +``` +from yosh.builtins.cd import * +from yosh.builtins.exit import * +``` + +最后,我们在 `shell.py` 中的 `init()` 函数注册 `exit` 命令。 + + +``` +... + +# Register all built-in commands here +def init(): + register_command("cd", cd) + register_command("exit", exit) + +... +``` + +到此为止! + +尝试执行 `python -m yosh.shell`。现在你可以输入 `exit` 优雅地退出程序了。 + +### 最后的想法 + +我希望你能像我一样享受创建 `yosh` (**y**our **o**wn **sh**ell)的过程。但我的 `yosh` 版本仍处于早期阶段。我没有处理一些会使 shell 崩溃的极端状况。还有很多我没有覆盖的内置命令。为了提高性能,一些非内置命令也可以实现为内置命令(避免新进程创建时间)。同时,大量的功能还没有实现(请看 [公共特性](http://tldp.org/LDP/Bash-Beginners-Guide/html/x7243.html) 和 [不同特性](http://www.tldp.org/LDP/intro-linux/html/x12249.html)) + +我已经在 github.com/supasate/yosh 中提供了源代码。请随意 fork 和尝试。 + +现在该是创建你真正自己拥有的 Shell 的时候了。 + +Happy Coding! + +-------------------------------------------------------------------------------- + +via: https://hackercollider.com/articles/2016/07/06/create-your-own-shell-in-python-part-2/ + +作者:[Supasate Choochaisri][a] +译者:[cposture](https://github.com/cposture) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://disqus.com/by/supasate_choochaisri/ +[1]: https://hackercollider.com/articles/2016/07/05/create-your-own-shell-in-python-part-1/ +[2]: http://tldp.org/LDP/Bash-Beginners-Guide/html/x7243.html +[3]: http://www.tldp.org/LDP/intro-linux/html/x12249.html +[4]: https://github.com/supasate/yosh From 010d4439c5bd850854785d736d885fe844fceb7b Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 16 Jul 2016 21:29:27 +0800 Subject: [PATCH 1172/1469] PUB:20160603 How To Install And Use VBoxManage On Ubuntu 16.04 And Use Its Command line Options @GitFuture --- ... 16.04 And Use Its Command line Options.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) rename {translated/tech => published}/20160603 How To Install And Use VBoxManage On Ubuntu 16.04 And Use Its Command line Options.md (66%) diff --git a/translated/tech/20160603 How To Install And Use VBoxManage On Ubuntu 16.04 And Use Its Command line Options.md b/published/20160603 How To Install And Use VBoxManage On Ubuntu 16.04 And Use Its Command line Options.md similarity index 66% rename from translated/tech/20160603 How To Install And Use VBoxManage On Ubuntu 16.04 And Use Its Command line Options.md rename to published/20160603 How To Install And Use VBoxManage On Ubuntu 16.04 And Use Its Command line Options.md index fec5b55c6c..b177995009 100644 --- a/translated/tech/20160603 How To Install And Use VBoxManage On Ubuntu 16.04 And Use Its Command line Options.md +++ b/published/20160603 How To Install And Use VBoxManage On Ubuntu 16.04 And Use Its Command line Options.md @@ -1,17 +1,17 @@ -在 Ubuntu 16.04 上安装使用 VBoxManage 以及 VBoxManage 命令行选项的用法 +在 Linux 上安装使用 VirtualBox 的命令行管理界面 VBoxManage ================= -VirtualBox 拥有一套命令行工具,然后你可以使用 VirtualBox 的命令行界面 (CLI) 对远端无界面的服务器上的虚拟机进行管理操作。在这篇教程中,你将会学到如何在没有 GUI 的情况下使用 VBoxManage 创建、启动一个虚拟机。VBoxManage 是 VirtualBox 的命令行界面,你可以在你的主机操作系统的命令行中来用它实现对 VirtualBox 的所有操作。VBoxManage 拥有图形化用户界面所支持的全部功能,而且它支持的功能远不止这些。它提供虚拟引擎的所有功能,甚至包含 GUI 还不能实现的那些功能。如果你想尝试不同的用户界面而不仅仅是 GUI,或者更改虚拟机更多高级和实验性的配置,那么你就需要用到命令行。 +VirtualBox 拥有一套命令行工具,你可以使用 VirtualBox 的命令行界面 (CLI) 对远程无界面的服务器上的虚拟机进行管理操作。在这篇教程中,你将会学到如何在没有 GUI 的情况下使用 VBoxManage 创建、启动一个虚拟机。VBoxManage 是 VirtualBox 的命令行界面,你可以在你的主机操作系统的命令行中用它来实现对 VirtualBox 的所有操作。VBoxManage 拥有图形化用户界面所支持的全部功能,而且它支持的功能远不止这些。它提供虚拟引擎的所有功能,甚至包含 GUI 还不能实现的那些功能。如果你想尝试下不同的用户界面而不仅仅是 GUI,或者更改虚拟机更多高级和实验性的配置,那么你就需要用到命令行。 -当你想要在 VirtualBox 上创建或运行虚拟机时,你会发现 VBoxManage 非常有用,你只需要使用远程主机的终端就够了。这对于服务器来说是一种常见的情形,因为在服务器上需要进行虚拟机的远程操作。 +当你想要在 VirtualBox 上创建或运行虚拟机时,你会发现 VBoxManage 非常有用,你只需要使用远程主机的终端就够了。这对于需要远程管理虚拟机的服务器来说是一种常见的情形。 ### 准备工作 -在开始使用 VBoxManage 的命令行工具前,确保在运行着 Ubuntu 16.04 的服务器上,你拥有超级用户的权限或者你能够使用 sudo 命令,而且你已经在服务器上安装了 Oracle Virtual Box。 然后你需要安装 VirtualBox 扩展包,这是运行远程桌面环境,访问无界面启动虚拟机所必须的。(headless的翻译拿不准,翻译为无界面启动) +在开始使用 VBoxManage 的命令行工具前,确保在运行着 Ubuntu 16.04 的服务器上,你拥有超级用户的权限或者你能够使用 sudo 命令,而且你已经在服务器上安装了 Oracle Virtual Box。 然后你需要安装 VirtualBox 扩展包,这是运行 VRDE 远程桌面环境,访问无界面虚拟机所必须的。 ### 安装 VBoxManage -通过 [Virtual Box Download Page][1] 这个链接,你能够获取你所需要的软件扩展包的最新版本,扩展包的版本和你安装的 VirtualBox 版本需要一致! +通过 [Virtual Box 下载页][1] 这个链接,你能够获取你所需要的软件扩展包的最新版本,扩展包的版本和你安装的 VirtualBox 版本需要一致! ![](http://linuxpitstop.com/wp-content/uploads/2016/06/12.png) @@ -71,11 +71,11 @@ $ VBoxManage modifyvm Ubuntu10.10 --memory 512 $ VBoxManage storagectl Ubuntu16.04 --name IDE --add ide --controller PIIX4 --bootable on ``` -这里的 “storagect1” 是给虚拟机创建存储控制器的,“--name” 指定了虚拟机里需要创建、更改或者移除的存储控制器的名称。“--add” 选项指明系统总线类型,可选的选项有 ide / sata / scsi / floppy,存储控制器必须要连接到系统总线。“--controller” 选择主板的类型,主板需要根据需要的存储控制器选择,可选的选项有 LsiLogic / LSILogicSAS / BusLogic / IntelAhci / PIIX3 / PIIX4 / ICH6 / I82078。最后的 “--bootable” 表示控制器是否可以引导。 +这里的 “storagect1” 是给虚拟机创建存储控制器的,“--name” 指定了虚拟机里需要创建、更改或者移除的存储控制器的名称。“--add” 选项指明存储控制器所需要连接到的系统总线类型,可选的选项有 ide / sata / scsi / floppy。“--controller” 选择主板的类型,主板需要根据需要的存储控制器选择,可选的选项有 LsiLogic / LSILogicSAS / BusLogic / IntelAhci / PIIX3 / PIIX4 / ICH6 / I82078。最后的 “--bootable” 表示控制器是否可以引导系统。 -上面的命令创建了叫做 IDE 的存储控制器。然后虚拟设备就能通过 “storageattach” 命令连接到控制器。 +上面的命令创建了叫做 IDE 的存储控制器。之后虚拟介质就能通过 “storageattach” 命令连接到该控制器。 -然后运行下面这个命令来创建一个叫做 SATA 的存储控制器,它将会连接到硬盘镜像上。 +然后运行下面这个命令来创建一个叫做 SATA 的存储控制器,它将会连接到之后的硬盘镜像上。 ``` $ VBoxManage storagectl Ubuntu16.04 --name SATA --add sata --controller IntelAhci --bootable on @@ -87,7 +87,7 @@ $ VBoxManage storagectl Ubuntu16.04 --name SATA --add sata --controller IntelAhc $ VBoxManage storageattach Ubuntu16.04 --storagectl SATA --port 0 --device 0 --type hdd --medium "your_iso_filepath" ``` -用媒体把 SATA 存储控制器连接到 Ubuntu16.04 虚拟机中,也就是之前创建的虚拟硬盘镜像里。 +这将把 SATA 存储控制器及介质(比如之前创建的虚拟磁盘镜像)连接到 Ubuntu16.04 虚拟机中。 运行下面的命令添加像网络连接,音频之类的功能。 @@ -120,9 +120,9 @@ $VBoxManage controlvm ![](http://linuxpitstop.com/wp-content/uploads/2016/06/81.png) -完结! +###完结 -从这篇文章中,我们了解了 Oracle Virtual Box 中一个十分实用的工具,就是 VBoxManage,包含了 VBoxManage 的安装和在 Ubuntu 16.04 系统上的使用。文章包含详细的教程, 通过 VBoxManage 中实用的命令来创建和管理虚拟机。希望这篇文章对你有帮助,另外别忘了分享你的评论或者建议。 +从这篇文章中,我们了解了 Oracle Virtual Box 中一个十分实用的工具 VBoxManage,文章包含了 VBoxManage 的安装和在 Ubuntu 16.04 系统上的使用,包括通过 VBoxManage 中实用的命令来创建和管理虚拟机。希望这篇文章对你有帮助,另外别忘了分享你的评论或者建议。 -------------------------------------------------------------------------------- @@ -130,7 +130,7 @@ via: http://linuxpitstop.com/install-and-use-command-line-tool-vboxmanage-on-ubu 作者:[Kashif][a] 译者:[GitFuture](https://github.com/GitFuture) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From bf4f2549256f9facb25f9cb6d8fd8a2a1039dcfd Mon Sep 17 00:00:00 2001 From: cposture Date: Sun, 17 Jul 2016 09:03:58 +0800 Subject: [PATCH 1173/1469] =?UTF-8?q?=E7=BD=91=E4=B8=8A=E5=B7=B2=E6=9C=89?= =?UTF-8?q?=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20160309 Let’s Build A Web Server. Part 1.md | 1 - sources/tech/20160406 Let’s Build A Web Server. Part 2.md | 1 - 2 files changed, 2 deletions(-) diff --git a/sources/tech/20160309 Let’s Build A Web Server. Part 1.md b/sources/tech/20160309 Let’s Build A Web Server. Part 1.md index 47f8bfdcc7..4c8048786d 100644 --- a/sources/tech/20160309 Let’s Build A Web Server. Part 1.md +++ b/sources/tech/20160309 Let’s Build A Web Server. Part 1.md @@ -1,4 +1,3 @@ -Translating by cposture 2016.07.13 Let’s Build A Web Server. Part 1. ===================================== diff --git a/sources/tech/20160406 Let’s Build A Web Server. Part 2.md b/sources/tech/20160406 Let’s Build A Web Server. Part 2.md index 5cba11dd64..482352ac9a 100644 --- a/sources/tech/20160406 Let’s Build A Web Server. Part 2.md +++ b/sources/tech/20160406 Let’s Build A Web Server. Part 2.md @@ -1,4 +1,3 @@ -Translating by cposture 2016.07.13 Let’s Build A Web Server. Part 2. =================================== From 477810acabe5817ed8d5e1e2a4d486b8dd1c393e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=AE=B6=E5=90=AF?= Date: Sun, 17 Jul 2016 10:58:41 +0800 Subject: [PATCH 1174/1469] =?UTF-8?q?=E7=BD=91=E4=B8=8A=E5=B7=B2=E6=9C=89?= =?UTF-8?q?=E7=BF=BB=E8=AF=91=20(#4188)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Translated by cposture * Translating by cposture * translating partly * translating partly 75 * Translated by cposture * Translated by cposture * Translating by cposture * Translating partly 50 * Translting partly 70 * Translating partly 75:wq * Translated by cposture * Translated by cposture * 网上已有翻译 --- sources/tech/20160309 Let’s Build A Web Server. Part 1.md | 1 - sources/tech/20160406 Let’s Build A Web Server. Part 2.md | 1 - 2 files changed, 2 deletions(-) diff --git a/sources/tech/20160309 Let’s Build A Web Server. Part 1.md b/sources/tech/20160309 Let’s Build A Web Server. Part 1.md index 47f8bfdcc7..4c8048786d 100644 --- a/sources/tech/20160309 Let’s Build A Web Server. Part 1.md +++ b/sources/tech/20160309 Let’s Build A Web Server. Part 1.md @@ -1,4 +1,3 @@ -Translating by cposture 2016.07.13 Let’s Build A Web Server. Part 1. ===================================== diff --git a/sources/tech/20160406 Let’s Build A Web Server. Part 2.md b/sources/tech/20160406 Let’s Build A Web Server. Part 2.md index 5cba11dd64..482352ac9a 100644 --- a/sources/tech/20160406 Let’s Build A Web Server. Part 2.md +++ b/sources/tech/20160406 Let’s Build A Web Server. Part 2.md @@ -1,4 +1,3 @@ -Translating by cposture 2016.07.13 Let’s Build A Web Server. Part 2. =================================== From c601a53f765e1a597b577fc620b1a637e98a8d72 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 17 Jul 2016 16:46:39 +0800 Subject: [PATCH 1175/1469] PUB:20160304 Microservices with Python RabbitMQ and Nameko @mr-ping --- ...ervices with Python RabbitMQ and Nameko.md | 35 ++++++++----------- 1 file changed, 14 insertions(+), 21 deletions(-) rename {translated/tech => published}/20160304 Microservices with Python RabbitMQ and Nameko.md (81%) diff --git a/translated/tech/20160304 Microservices with Python RabbitMQ and Nameko.md b/published/20160304 Microservices with Python RabbitMQ and Nameko.md similarity index 81% rename from translated/tech/20160304 Microservices with Python RabbitMQ and Nameko.md rename to published/20160304 Microservices with Python RabbitMQ and Nameko.md index 8b88bfceec..d70afff960 100644 --- a/translated/tech/20160304 Microservices with Python RabbitMQ and Nameko.md +++ b/published/20160304 Microservices with Python RabbitMQ and Nameko.md @@ -1,4 +1,4 @@ -基于 Python、 RabbitMQ 和 Nameko 的微服务 +用 Python、 RabbitMQ 和 Nameko 实现微服务 ============================================== >"微服务是一股新浪潮" - 现如今,将项目拆分成多个独立的、可扩展的服务是保障代码演变的最好选择。在 Python 的世界里,有个叫做 “Nameko” 的框架,它将微服务的实现变得简单并且强大。 @@ -8,19 +8,17 @@ > 在最近的几年里,“微服务架构”如雨后春笋般涌现。它用于描述一种特定的软件应用设计方式,这种方式使得应用可以由多个独立部署的服务以服务套件的形式组成。 - M. Fowler -推荐各位读一下 [Fowler's posts][1] 以理解它背后的原理。 - +推荐各位读一下 [Fowler 的文章][1] 以理解它背后的原理。 #### 好吧,那它究竟意味着什么呢? -简单来说,**微服务架构**可以将你的系统拆分成多个负责不同任务的小块儿,它们之间互不依赖,各自只提供用于通讯的通用指向。这个指向通常是已经将通讯协议和接口定义好的消息队列。 - +简单来说,**微服务架构**可以将你的系统拆分成多个负责不同任务的小的(单一上下文内)功能块(responsibilities blocks),它们彼此互无感知,各自只提供用于通讯的通用指向(common point)。这个指向通常是已经将通讯协议和接口定义好的消息队列。 #### 这里给大家提供一个真实案例 ->案例的代码可以通过github: 访问,查看 service 和 api 文件夹可以获取更多信息。 +> 案例的代码可以通过 github: 访问,查看 service 和 api 文件夹可以获取更多信息。 -想象一下,你有一个 REST API ,这个 API 有一个端点(译者注:REST 风格的 API 可以有多个端点用于处理对同一资源的不同类型的请求)用来接受数据,并且你需要将接收到的数据进行一些运算。那么相比阻塞接口调用者的请求来说,异步实现此接口是一个更好的选择。你可以先给用户返回一个 "OK - 你的请求稍后会处理" 的状态,然后在后台任务中完成运算。 +想象一下,你有一个 REST API ,这个 API 有一个端点(LCTT 译注:REST 风格的 API 可以有多个端点用于处理对同一资源的不同类型的请求)用来接受数据,并且你需要将接收到的数据进行一些运算工作。那么相比阻塞接口调用者的请求来说,异步实现此接口是一个更好的选择。你可以先给用户返回一个 "OK - 你的请求稍后会处理" 的状态,然后在后台任务中完成运算。 同样,如果你想要在不阻塞主进程的前提下,在计算完成后发送一封提醒邮件,那么将“邮件发送”委托给其他服务去做会更好一些。 @@ -30,20 +28,18 @@ ![](http://brunorocha.org/static/media/microservices/micro_services.png) -### 用代码说话: +### 用代码说话 让我们将系统创建起来,在实践中理解它: - #### 环境 我们需要的环境: -- 运行良好的 RabbitMQ(译者注:[RabbitMQ][2]是一个流行的消息队列实现) +- 运行良好的 RabbitMQ(LCTT 译注:[RabbitMQ][2] 是一个流行的消息队列实现) - 由 VirtualEnv 提供的 Services 虚拟环境 - 由 VirtualEnv 提供的 API 虚拟环境 - #### Rabbit 在开发环境中使用 RabbitMQ 最简单的方式就是运行其官方的 docker 容器。在你已经拥有 Docker 的情况下,运行: @@ -56,10 +52,9 @@ docker run -d --hostname my-rabbit --name some-rabbit -p 15672:15672 -p 5672:567 ![](http://brunorocha.org/static/media/microservices/RabbitMQManagement.png) - #### 服务环境 -现在让我们创建微服务来消费我们的任务。其中一个服务用来执行计算任务,另一个用来发送邮件。按以下步骤执行: +现在让我们创建微服务来满足我们的任务需要。其中一个服务用来执行计算任务,另一个用来发送邮件。按以下步骤执行: 在 Shell 中创建项目的根目录 @@ -82,7 +77,6 @@ $ source service_env/bin/activate (service_env)$ pip install yagmail ``` - #### 服务的代码 现在我们已经准备好了 virtualenv 所提供的虚拟环境(可以想象成我们的服务是运行在一个独立服务器上的,而我们的 API 运行在另一个服务器上),接下来让我们编码,实现 nameko 的 RPC 服务。 @@ -135,7 +129,7 @@ class Compute(object): 现在我们已经用以上代码定义好了两个服务,下面让我们将 Nameko RPC service 运行起来。 ->注意:我们会在控制台中启动并运行它。但在生产环境中,建议大家使用 supervisord 替代控制台命令。 +> 注意:我们会在控制台中启动并运行它。但在生产环境中,建议大家使用 supervisord 替代控制台命令。 在 Shell 中启动并运行服务 @@ -149,7 +143,7 @@ Connected to amqp://guest:**@127.0.0.1:5672// #### 测试 -在另外一个 Shell 中(使用相同的虚拟环境),用 nameko shell 进行测试: +在另外一个 Shell 中(使用相同的虚拟环境),用 nameko shell 进行测试: ``` (service_env)$ nameko shell --broker amqp://guest:guest@localhost @@ -178,19 +172,18 @@ Broker: amqp://guest:guest@localhost 3 ``` - ### 在 API 中调用微服务 在另外一个 Shell 中(甚至可以是另外一台服务器上),准备好 API 环境。 -用 virtualenv 工具创建并且激活一个虚拟环境(你也可以使用virtualenv-wrapper) +用 virtualenv 工具创建并且激活一个虚拟环境(你也可以使用 virtualenv-wrapper) ``` $ virtualenv api_env $ source api_env/bin/activate ``` -安装 Nameko, Flask 和 Flasgger +安装 Nameko、 Flask 和 Flasgger ``` (api_env)$ pip install nameko @@ -269,7 +262,7 @@ app.run(debug=True) ![](http://brunorocha.org/static/media/microservices/Flasgger_API_documentation.png) ->注意: 你可以在 shell 中查看到服务的运行日志,打印信息和错误信息。也可以访问 RabbitMQ 控制面板来查看消息在队列中的处理情况。 +> 注意: 你可以在 shell 中查看到服务的运行日志,打印信息和错误信息。也可以访问 RabbitMQ 控制面板来查看消息在队列中的处理情况。 Nameko 框架还为我们提供了很多高级特性,你可以从 获取更多的信息。 @@ -282,7 +275,7 @@ via: http://brunorocha.org/python/microservices-with-python-rabbitmq-and-nameko. 作者: [Bruno Rocha][a] 译者: [mr-ping](http://www.mr-ping.com) -校对: [校对者ID](https://github.com/校对者ID) +校对: [wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c4d4ce4e8bcbc6883ef7ca7d40e5c05ecab857d9 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 17 Jul 2016 17:36:09 +0800 Subject: [PATCH 1176/1469] PUB:20160511 An introduction to data processing with Cassandra and Spark @KevinSJ --- ...ata processing with Cassandra and Spark.md | 45 +++++++++++++++++ ...ata processing with Cassandra and Spark.md | 49 ------------------- 2 files changed, 45 insertions(+), 49 deletions(-) create mode 100644 published/20160511 An introduction to data processing with Cassandra and Spark.md delete mode 100644 translated/tech/20160511 An introduction to data processing with Cassandra and Spark.md diff --git a/published/20160511 An introduction to data processing with Cassandra and Spark.md b/published/20160511 An introduction to data processing with Cassandra and Spark.md new file mode 100644 index 0000000000..bec55c2e7c --- /dev/null +++ b/published/20160511 An introduction to data processing with Cassandra and Spark.md @@ -0,0 +1,45 @@ +Cassandra 和 Spark 数据处理一窥 +============================================================== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/osdc_520x292_opendata_0613mm.png?itok=mzC0Tb28) + +Apache Cassandra 数据库近来引起了很多的兴趣,这主要源于现代云端软件对于可用性及性能方面的要求。 + +那么,Apache Cassandra 是什么?它是一种为高可用性及线性可扩展性优化的分布式的联机交易处理 (OLTP) 数据库。具体说到 Cassandra 的用途时,可以想想你希望贴近用户的系统,比如说让我们的用户进行交互的系统、需要保证实时可用的程序等等,如:产品目录,物联网,医疗系统,以及移动应用。对这些程序而言,下线时间意味着利润降低甚至导致其他更坏的结果。Netfilix 是这个在 2008 年开源的项目的早期使用者,他们对此项目的贡献以及带来的成功让这个项目名声大噪。 + +Cassandra 于2010年成为了 Apache 软件基金会的顶级项目,并从此之后就流行起来。现在,只要你有 Cassadra 的相关知识,找工作时就能轻松不少。想想看,NoSQL 语言和开源技术能达到企业级 SQL 技术的高度,真让人觉得十分疯狂而又不可思议的。这引出了一个问题。是什么让它如此的流行? + +因为采用了[亚马逊发表的 Dynamo 论文][1]中率先提出的设计,Cassandra 有能力在大规模的硬件及网络故障时保持实时在线。由于采用了点对点模式,在没有单点故障的情况下,我们能幸免于机架故障甚至全网中断。我们能在不影响用户体验的前提下处理数据中心故障。一个能考虑到故障的分布式系统才是一个没有后顾之忧的分布式系统,因为老实说,故障是迟早会发生的。有了 Cassandra, 我们可以直面残酷的生活并将之融入数据库的结构和功能中。 + +我们能猜到你现在在想什么,“但我只有关系数据库相关背景,难道这样的转变不会很困难吗?”这问题的答案介于是和不是之间。使用 Cassandra 建立数据模型对有关系数据库背景的开发者而言是轻车熟路。我们使用表格来建立数据模型,并使用 CQL ( Cassandra 查询语言)来查询数据库。然而,与 SQL 不同的是,Cassandra 支持更加复杂的数据结构,例如嵌套和用户自定义类型。举个例子,当要储存对一个小猫照片的点赞数目时,我们可以将整个数据储存在一个包含照片本身的集合之中从而获得更快的顺序查找而不是建立一个独立的表。这样的表述在 CQL 中十分的自然。在我们照片表中,我们需要记录名字,URL以及给此照片点赞过的人。 + +![](https://opensource.com/sites/default/files/resize/screen_shot_2016-05-06_at_7.17.33_am-350x198.png) + +在一个高性能系统中,毫秒级处理都能对用户体验和客户维系产生影响。昂贵的 JOIN 操作制约了我们通过增加不可预见的网络调用而扩容的能力。当我们将数据反范式化使其能通过尽可能少的请求就可获取时,我们即可从磁盘空间成本的降低中获益并获得可预期的、高性能应用。我们将反范式化同 Cassandra 一同介绍是因为它提供了很有吸引力的的折衷方案。 + +很明显,我们不会局限于对于小猫照片的点赞数量。Canssandra 是一款为高并发写入优化的方案。这使其成为需要时常吞吐数据的大数据应用的理想解决方案。实时应用和物联网方面的应用正在稳步增长,无论是需求还是市场表现,我们也会不断的利用我们收集到的数据来寻求改进技术应用的方式。 + +这就引出了我们的下一步,我们已经提到了如何以一种现代的、性价比高的方式储存数据,但我们应该如何获得更多的动力呢?具体而言,当我们收集到了所需的数据,我们应该怎样处理呢?如何才能有效的分析几百 TB 的数据呢?如何才能实时的对我们所收集到的信息进行反馈,并在几秒而不是几小时的时间利作出决策呢?Apache Spark 将给我们答案。 + +Spark 是大数据变革中的下一步。 Hadoop 和 MapReduce 都是革命性的产品,它们让大数据界获得了分析所有我们所取得的数据的机会。Spark 对性能的大幅提升及对代码复杂度的大幅降低则将大数据分析提升到了另一个高度。通过 Spark,我们能大批量的处理计算,对流处理进行快速反应,通过机器学习作出决策,并通过图遍历来理解复杂的递归关系。这并非只是为你的客户提供与快捷可靠的应用程序连接(Cassandra 已经提供了这样的功能),这更是能洞悉 Canssandra 所储存的数据,作出更加合理的商业决策并同时更好地满足客户需求。 + +你可以看看 [Spark-Cassandra Connector][2] (开源) 并动手试试。若想了解更多关于这两种技术的信息,我们强烈推荐名为 [DataStax Academy][3] 的自学课程 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/16/5/basics-cassandra-and-spark-data-processing + +作者:[Jon Haddad][a],[Dani Traphagen][b] +译者:[KevinSJ](https://github.com/KevinSJ) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://twitter.com/rustyrazorblade +[b]: https://opensource.com/users/dtrapezoid +[1]: http://www.allthingsdistributed.com/files/amazon-dynamo-sosp2007.pdf +[2]: https://github.com/datastax/spark-cassandra-connector +[3]: https://academy.datastax.com/ +[4]: http://conferences.oreilly.com/oscon/open-source-us/public/schedule/detail/49162 +[5]: https://twitter.com/dtrapezoid +[6]: https://twitter.com/rustyrazorblade diff --git a/translated/tech/20160511 An introduction to data processing with Cassandra and Spark.md b/translated/tech/20160511 An introduction to data processing with Cassandra and Spark.md deleted file mode 100644 index 0786996e39..0000000000 --- a/translated/tech/20160511 An introduction to data processing with Cassandra and Spark.md +++ /dev/null @@ -1,49 +0,0 @@ -Cassandra 和 Spark 数据处理入门 -============================================================== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/osdc_520x292_opendata_0613mm.png?itok=mzC0Tb28) - -Apache Cassandra 数据库近来引起了很多的兴趣,这主要源于现代云端软件对于可用性及性能方面的要求。 - -那么,Apache Cassandra 是什么?它是一种为高可用性及线性可扩展性优化的分布式的联机交易处理 (OLTP) 数据库。当人们想知道 Cassandra 的用途时,可以想想你想要的离客户近的系统。这j最终是我们的用户进行交互的系统。需要保证实时可用的程序:产品目录,IoT,医疗系统,以及移动应用。对这些程序而言,下线时间意味着利润降低甚至导致其他更坏的结果。Netfilix 是这个于2008年开源的项目的早期使用者,他们对此项目的贡献以及带来的成功让这个项目名声大噪。 - -Cassandra 于2010年成为了 Apache 软件基金会的顶级项目,在这之后就开始变得流行。现在,只要你有 Cassadra 的相关知识,找工作时就能轻松不少。光是想想一个 NoSQL 语言和开源技术能达到如此企业级 SQL 的高度就觉得这是十分疯狂而又不可思议的。这引出了一个问题。是什么让它如此的流行? - -因为采用了首先在[亚马逊发表的 Dynamo 论文][1]提出的设计,Cassandra 有能力在大规模的硬件及网络故障时保持实时在线。由于采用了点对点模式,在没有单点故障的情况下,我们能幸免于机架故障甚至完全网络分区。我们能在不影响用户体验的前提下处理数据中心故障。一个能考虑到故障的分布式系统才是一个没有后顾之忧的分布式系统,因为老实说,故障是迟早会发生的。有了 Cassandra, 我们可疑直面残酷的生活并将之融入数据库的结构和功能中。 - - - -我们能猜到你现在在想什么,“但我只有关系数据库相关背景,难道这样的转变不会很困难吗?"这问题的答案介于是和不是之间。使用 Cassandra 建立数据模型对有关系数据库背景的开发者而言是轻车熟路。我们使用表格来建立数据模型,并使用 CQL 或者 Cassandra 查询语言来查询数据库。然而,与 SQL 不同的是,Cassandra 支持更加复杂的数据结构,例如多重和用户自定义类型。举个例子,当要储存对一个小猫照片的点赞数目时,我们可以将整个数据储存在一个包含照片本身的集合之中从而获得更快的顺序查找而不是建立一个独立的表。这样的表述在 CQL 中十分的自然。在我们照片表中,我们需要记录名字,URL以及给此照片点赞过的人。 - -![](https://opensource.com/sites/default/files/resize/screen_shot_2016-05-06_at_7.17.33_am-350x198.png) - -在一个高性能系统中,毫秒对用户体验和客户保留都能产生影响。昂贵的 JOIN 制约了我们通过增加不可预见的网络调用而扩容的能力。当我们将数据反规范化使其能在尽可能少的请求中被获取到时,我们即可从磁盘空间花费的降低中获益并获得可预测的,高性能应用。我们将反规范化同 Cassandra 一同介绍是因为它提供了很有吸引力的的折衷方案。 - -很明显,我们不会局限于对于小猫照片的点赞数量。Canssandra 是一款个为并发高写入优化的方案。这使其成为需要时常吞吐数据的大数据应用的理想解决方案。市场上的时序和 IoT 的使用场景正在以稳定的速度在需求和亮相方面增加,我们也在不断探寻优化我们所收集到的数据以求提升我们的技术应用(注:这句翻的非常别扭,求校队) - - -这就引出了我们的下一步,我们已经提到了如何以一种现代的,性价比高的方式储存数据,但我们应该如何获得更多的马力呢?具体而言,当我们收集到了所需的数据,我们应该怎样处理呢?如何才能有效的分析几百 TB 的数据呢?如何才能在实时的对我们所收集到的信息进行反馈并在几秒而不是几小时的时间利作出决策呢?Apache Spark 将给我们答案。 - - -Spark 是大数据变革中的下一步。 Hadoop 和 MapReduce 都是革命性的产品,他们让大数据界获得了分析所有我们所取得的数据的机会。Spark 对性能的大幅提升及对代码复杂度的大幅降低则将大数据分析提升到了另一个高度。通过 Spark,我们能大批量的处理计算,对流处理进行快速反映,通过机器学习作出决策并理解通过对图的遍历理解复杂的递归关系。这并非只是为你的客户提供与快捷可靠的应用程序连接(Cassandra 已经提供了这样的功能),这更是能一探 Canssandra 所储存的数据并作出更加合理的商业决策同时更好地满足客户需求。 - -你可以看看 [Spark-Cassandra Connector][2] (open source) 并动手试试。若想了解更多关于这两种技术的信息,我们强烈推荐名为 [DataStax Academy][3] 的自学课程 - --------------------------------------------------------------------------------- - -via: https://opensource.com/life/16/5/basics-cassandra-and-spark-data-processing - -作者:[Jon Haddad][a],[Dani Traphagen][b] -译者:[KevinSJ](https://github.com/KevinSJ) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://twitter.com/rustyrazorblade -[b]: https://opensource.com/users/dtrapezoid -[1]: http://www.allthingsdistributed.com/files/amazon-dynamo-sosp2007.pdf -[2]: https://github.com/datastax/spark-cassandra-connector -[3]: https://academy.datastax.com/ -[4]: http://conferences.oreilly.com/oscon/open-source-us/public/schedule/detail/49162 -[5]: https://twitter.com/dtrapezoid -[6]: https://twitter.com/rustyrazorblade From 54a1329118987442f7a0b3cfa2d5f27d570e14c5 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 17 Jul 2016 23:18:23 +0800 Subject: [PATCH 1177/1469] PUB:Part 1 - How to Use Awk and Regular Expressions to Filter Text or String in Files @wwy-hust --- ...sions to Filter Text or String in Files.md | 74 +++++++++++-------- 1 file changed, 42 insertions(+), 32 deletions(-) rename {translated/tech/awk => published}/Part 1 - How to Use Awk and Regular Expressions to Filter Text or String in Files.md (72%) diff --git a/translated/tech/awk/Part 1 - How to Use Awk and Regular Expressions to Filter Text or String in Files.md b/published/Part 1 - How to Use Awk and Regular Expressions to Filter Text or String in Files.md similarity index 72% rename from translated/tech/awk/Part 1 - How to Use Awk and Regular Expressions to Filter Text or String in Files.md rename to published/Part 1 - How to Use Awk and Regular Expressions to Filter Text or String in Files.md index 791c349f56..1c1b5577c9 100644 --- a/translated/tech/awk/Part 1 - How to Use Awk and Regular Expressions to Filter Text or String in Files.md +++ b/published/Part 1 - How to Use Awk and Regular Expressions to Filter Text or String in Files.md @@ -1,28 +1,28 @@ -如何使用Awk和正则表达式过滤文本或文件中的字符串 +awk 系列:如何使用 awk 和正则表达式过滤文本或文件中的字符串 ============================================================================= ![](http://www.tecmint.com/wp-content/uploads/2016/04/Linux-Awk-Command-Examples.png) -当我们在 Unix/Linux 下使用特定的命令从字符串或文件中读取或编辑文本时,我们经常会尝试过滤输出以得到感兴趣的部分。这时正则表达式就派上用场了。 +当我们在 Unix/Linux 下使用特定的命令从字符串或文件中读取或编辑文本时,我们经常需要过滤输出以得到感兴趣的部分。这时正则表达式就派上用场了。 ### 什么是正则表达式? -正则表达式可以定义为代表若干个字符序列的字符串。它最重要的功能就是它允许你过滤一条命令或一个文件的输出,编辑文本或配置等文件的一部分。 +正则表达式可以定义为代表若干个字符序列的字符串。它最重要的功能之一就是它允许你过滤一条命令或一个文件的输出、编辑文本或配置文件的一部分等等。 ### 正则表达式的特点 正则表达式由以下内容组合而成: -- 普通的字符,例如空格、下划线、A-Z、a-z、0-9。 -- 可以扩展为普通字符的元字符,它们包括: +- **普通字符**,例如空格、下划线、A-Z、a-z、0-9。 +- 可以扩展为普通字符的**元字符**,它们包括: - `(.)` 它匹配除了换行符外的任何单个字符。 - - `(*)` 它匹配零个或多个在其之前的立即字符。 - - `[ character(s) ]` 它匹配任何由 character(s) 指定的一个字符,你可以使用连字符(-)代表字符区间,例如 [a-f]、[1-5]等。 + - `(*)` 它匹配零个或多个在其之前紧挨着的字符。 + - `[ character(s) ]` 它匹配任何由其中的字符/字符集指定的字符,你可以使用连字符(-)代表字符区间,例如 [a-f]、[1-5]等。 - `^` 它匹配文件中一行的开头。 - `$` 它匹配文件中一行的结尾。 - `\` 这是一个转义字符。 -你必须使用类似 awk 这样的文本过滤工具来过滤文本。你还可以把 awk 当作一个用于自身的编程语言。但由于这个指南的适用范围是关于使用 awk 的,我会按照一个简单的命令行过滤工具来介绍它。 +你必须使用类似 awk 这样的文本过滤工具来过滤文本。你还可以把 awk 自身当作一个编程语言。但由于这个指南的适用范围是关于使用 awk 的,我会按照一个简单的命令行过滤工具来介绍它。 awk 的一般语法如下: @@ -30,13 +30,13 @@ awk 的一般语法如下: # awk 'script' filename ``` -此处 `'script'` 是一个由 awk 使用并应用于 filename 的命令集合。 +此处 `'script'` 是一个由 awk 可以理解并应用于 filename 的命令集合。 -它通过读取文件中的给定的一行,复制该行的内容并在该行上执行脚本的方式工作。这个过程会在该文件中的所有行上重复。 +它通过读取文件中的给定行,复制该行的内容并在该行上执行脚本的方式工作。这个过程会在该文件中的所有行上重复。 该脚本 `'script'` 中内容的格式是 `'/pattern/ action'`,其中 `pattern` 是一个正则表达式,而 `action` 是当 awk 在该行中找到此模式时应当执行的动作。 -### 如何在 Linux 中使用 Awk 过滤工具 +### 如何在 Linux 中使用 awk 过滤工具 在下面的例子中,我们将聚焦于之前讨论过的元字符。 @@ -45,13 +45,14 @@ awk 的一般语法如下: 下面的例子打印文件 /etc/hosts 中的所有行,因为没有指定任何的模式。 ``` -# awk '//{print}'/etc/hosts +# awk '//{print}' /etc/hosts ``` ![](http://www.tecmint.com/wp-content/uploads/2016/04/Awk-Command-Example.gif) ->Awk 打印文件中的所有行 -#### 结合模式使用 Awk +*awk 打印文件中的所有行* + +#### 结合模式使用 awk 在下面的示例中,指定了模式 `localhost`,因此 awk 将匹配文件 `/etc/hosts` 中有 `localhost` 的那些行。 @@ -60,22 +61,24 @@ awk 的一般语法如下: ``` ![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-Command-with-Pattern.gif) ->Awk 打印文件中匹配模式的行 -#### 在 Awk 模式中使用通配符 (.) +*awk 打印文件中匹配模式的行* + +#### 在 awk 模式中使用通配符 (.) 在下面的例子中,符号 `(.)` 将匹配包含 loc、localhost、localnet 的字符串。 -这里的意思是匹配 *** l 一些单个字符 c ***。 +这里的正则表达式的意思是匹配 **l一个字符c**。 ``` # awk '/l.c/{print}' /etc/hosts ``` ![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-with-Wild-Cards.gif) ->使用 Awk 打印文件中匹配模式的字符串 -#### 在 Awk 模式中使用字符 (*) +*使用 awk 打印文件中匹配模式的字符串* + +#### 在 awk 模式中使用字符 (*) 在下面的例子中,将匹配包含 localhost、localnet、lines, capable 的字符串。 @@ -84,7 +87,8 @@ awk 的一般语法如下: ``` ![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-to-Match-Strings-in-File.gif) ->使用 Awk 匹配文件中的字符串 + +*使用 awk 匹配文件中的字符串* 你可能也意识到 `(*)` 将会尝试匹配它可能检测到的最长的匹配。 @@ -112,7 +116,7 @@ this is tecmint, where you get the best good tutorials, how tos, guides, tecmint this is tecmint, where you get the best good tutorials, how to's, guides, tecmint ``` -#### 结合集合 [ character(s) ] 使用 Awk +#### 结合集合 [ character(s) ] 使用 awk 以集合 [al1] 为例,awk 将匹配文件 /etc/hosts 中所有包含字符 a 或 l 或 1 的字符串。 @@ -121,7 +125,8 @@ this is tecmint, where you get the best good tutorials, how to's, guides, tecmin ``` ![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-to-Print-Matching-Character.gif) ->使用 Awk 打印文件中匹配的字符 + +*使用 awk 打印文件中匹配的字符* 下一个例子匹配以 `K` 或 `k` 开始头,后面跟着一个 `T` 的字符串: @@ -130,7 +135,8 @@ this is tecmint, where you get the best good tutorials, how to's, guides, tecmin ``` ![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-to-Print-Matched-String-in-File.gif) ->使用 Awk 打印文件中匹配的字符 + +*使用 awk 打印文件中匹配的字符* #### 以范围的方式指定字符 @@ -149,11 +155,12 @@ awk 所能理解的字符: ``` ![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-To-Print-Matching-Numbers-in-File.gif) ->使用 Awk 打印文件中匹配的数字 + +*使用 awk 打印文件中匹配的数字* 在上面的例子中,文件 /etc/hosts 中的所有行都至少包含一个单独的数字 [0-9]。 -#### 结合元字符 (\^) 使用 Awk +#### 结合元字符 (\^) 使用 awk 在下面的例子中,它匹配所有以给定模式开头的行: @@ -163,9 +170,10 @@ awk 所能理解的字符: ``` ![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-to-Print-All-Matching-Lines-with-Pattern.gif) ->使用 Awk 打印与模式匹配的行 -#### 结合元字符 ($) 使用 Awk +*使用 awk 打印与模式匹配的行* + +#### 结合元字符 ($) 使用 awk 它将匹配所有以给定模式结尾的行: @@ -176,9 +184,10 @@ awk 所能理解的字符: ``` ![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-to-Print-Given-Pattern-String.gif) ->使用 Awk 打印与模式匹配的字符串 -#### 结合转义字符 (\\) 使用 Awk +*使用 awk 打印与模式匹配的字符串* + +#### 结合转义字符 (\\) 使用 awk 它允许你将该转义字符后面的字符作为文字,即理解为其字面的意思。 @@ -193,11 +202,12 @@ awk 所能理解的字符: ``` ![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-with-Escape-Character.gif) ->结合转义字符使用 Awk + +*结合转义字符使用 awk* ### 总结 -以上内容并不是 Awk 命令用做过滤工具的全部,上述的示例均是 awk 的基础操作。在下面的章节中,我将进一步介绍如何使用 awk 的高级功能。感谢您的阅读,请在评论区贴出您的评论。 +以上内容并不是 awk 命令用做过滤工具的全部,上述的示例均是 awk 的基础操作。在下面的章节中,我将进一步介绍如何使用 awk 的高级功能。感谢您的阅读,请在评论区贴出您的评论。 -------------------------------------------------------------------------------- @@ -205,7 +215,7 @@ via: http://www.tecmint.com/use-linux-awk-command-to-filter-text-string-in-files 作者:[Aaron Kili][a] 译者:[wwy-hust](https://github.com/wwy-hust) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 0912e81191e4adcdfe7dda75e37e2645b23ae64b Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 17 Jul 2016 23:31:58 +0800 Subject: [PATCH 1178/1469] PUB:Part 2 - How to Use Awk to Print Fields and Columns in File MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @ictlyh @Cathon 这篇选稿正好和系列选题中重复了,我就综合校对了。@oska874 --- ...Awk to Print Fields and Columns in File.md | 0 ...Awk to Print Fields and Columns in File.md | 33 ++++++++++--------- 2 files changed, 18 insertions(+), 15 deletions(-) rename {translated/tech => published}/20160425 How to Use Awk to Print Fields and Columns in File.md (100%) rename {translated/tech/awk => published}/Part 2 - How to Use Awk to Print Fields and Columns in File.md (72%) diff --git a/translated/tech/20160425 How to Use Awk to Print Fields and Columns in File.md b/published/20160425 How to Use Awk to Print Fields and Columns in File.md similarity index 100% rename from translated/tech/20160425 How to Use Awk to Print Fields and Columns in File.md rename to published/20160425 How to Use Awk to Print Fields and Columns in File.md diff --git a/translated/tech/awk/Part 2 - How to Use Awk to Print Fields and Columns in File.md b/published/Part 2 - How to Use Awk to Print Fields and Columns in File.md similarity index 72% rename from translated/tech/awk/Part 2 - How to Use Awk to Print Fields and Columns in File.md rename to published/Part 2 - How to Use Awk to Print Fields and Columns in File.md index c0b526b925..69f372d099 100644 --- a/translated/tech/awk/Part 2 - How to Use Awk to Print Fields and Columns in File.md +++ b/published/Part 2 - How to Use Awk to Print Fields and Columns in File.md @@ -1,18 +1,19 @@ -如何使用 Awk 输出文本中的字段和列 +awk 系列:如何使用 awk 输出文本中的字段和列 ====================================================== -在 Awk 系列的这一节中,我们将看到 Awk 最重要的特性之一,字段编辑。 +在 Awk 系列的这一节中,我们将看到 awk 最重要的特性之一,字段编辑。 -需要知道的是,Awk 能够自动将输入的行,分隔为若干字段。每一个字段就是一组字符,它们和其他的字段由一个内部字段分隔符分隔开来。 +首先我们要知道,Awk 能够自动将输入的行,分隔为若干字段。每一个字段就是一组字符,它们和其他的字段由一个内部字段分隔符分隔开来。 ![](http://www.tecmint.com/wp-content/uploads/2016/04/Awk-Print-Fields-and-Columns.png) ->Awk Print Fields and Columns -如果你熟悉 Unix/Linux 或者使用 [bash 脚本][1]编过程,那么你应该知道什么是内部字段分隔符(IFS)变量。Awk 中默认的 IFS 是制表符和空格。 +*Awk 输出字段和列* -Awk 中的字段分隔符的工作流程如下:当读到一行输入时,将它按照指定的 IFS 分割为不同字段,第一组字符就是字段一,可以通过 $1 来访问,第二组字符就是字段二,可以通过 $2 来访问,第三组字符就是字段三,可以通过 $3 来访问,以此类推,直到最后一组字符。 +如果你熟悉 Unix/Linux 或者懂得 [bash shell 编程][1],那么你应该知道什么是内部字段分隔符(IFS)变量。awk 中默认的 IFS 是制表符和空格。 -为了更好地理解 Awk 的字段编辑,让我们看一个下面的例子: +awk 中的字段分隔符的工作原理如下:当读到一行输入时,将它按照指定的 IFS 分割为不同字段,第一组字符就是字段一,可以通过 $1 来访问,第二组字符就是字段二,可以通过 $2 来访问,第三组字符就是字段三,可以通过 $3 来访问,以此类推,直到最后一组字符。 + +为了更好地理解 awk 的字段编辑,让我们看一个下面的例子: **例 1**:我创建了一个名为 tecmintinfo.txt 的文本文件。 @@ -22,7 +23,8 @@ Awk 中的字段分隔符的工作流程如下:当读到一行输入时,将 ``` ![](http://www.tecmint.com/wp-content/uploads/2016/04/Create-File-in-Linux.png) ->在 Linux 上创建一个文件 + +*在 Linux 上创建一个文件* 然后在命令行中,我试着使用下面的命令从文本 tecmintinfo.txt 中输出第一个,第二个,以及第三个字段。 @@ -47,15 +49,16 @@ $ awk '//{print $1, $2, $3; }' tecmintinfo.txt TecMint.com is the ``` -需要记住而且非常重要的是,`($)` 在 Awk 和在 shell 脚本中的使用是截然不同的! +需要记住而且非常重要的是,`($)` 在 awk 和在 shell 脚本中的使用是截然不同的! -在 shell 脚本中,`($)` 被用来获取变量的值。而在 Awk 中,`($)` 只有在获取字段的值时才会用到,不能用于获取变量的值。 +在 shell 脚本中,`($)` 被用来获取变量的值。而在 awk 中,`($)` 只有在获取字段的值时才会用到,不能用于获取变量的值。 **例 2**:让我们再看一个例子,用到了一个名为 my_shoping.list 的包含多行的文件。 + ``` No Item_Name Unit_Price Quantity Price 1 Mouse #20,000 1 #20,000 -2 Monitor #500,000 1 #500,000 +2 Monitor #500,000 1 #500,000 3 RAM_Chips #150,000 2 #300,000 4 Ethernet_Cables #30,000 4 #120,000 ``` @@ -72,7 +75,7 @@ RAM_Chips #150,000 Ethernet_Cables #30,000 ``` -可以看到上面的输出不够清晰,Awk 还有一个 `printf` 的命令,可以帮助你将输出格式化。 +可以看到上面的输出不够清晰,awk 还有一个 `printf` 的命令,可以帮助你将输出格式化。 使用 `printf` 来格式化 Item_Name 和 Unit_Price 的输出: @@ -88,7 +91,7 @@ Ethernet_Cables #30,000 ### 总结 -使用 Awk 过滤文本或字符串时,字段编辑的功能是非常重要的。它能够帮助你从一个表的数据中得到特定的列。一定要记住的是,Awk 中 `($)` 操作符的用法与其在 shell 脚本中的用法是不同的! +使用 awk 过滤文本或字符串时,字段编辑的功能是非常重要的。它能够帮助你从一个表的数据中得到特定的列。一定要记住的是,awk 中 `($)` 操作符的用法与其在 shell 脚本中的用法是不同的! 希望这篇文章对您有所帮助。如有任何疑问,可以在评论区域发表评论。 @@ -97,8 +100,8 @@ Ethernet_Cables #30,000 via: http://www.tecmint.com/awk-print-fields-columns-with-space-separator/ 作者:[Aaron Kili][a] -译者:[Cathon](https://github.com/Cathon) -校对:[校对者ID](https://github.com/校对者ID) +译者:[Cathon](https://github.com/Cathon),[ictlyh](https://github.com/ictlyh) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 4de2a5d1ca8ef3163fce13695db35c3e4e227d7f Mon Sep 17 00:00:00 2001 From: vim-kakali <1799225723@qq.com> Date: Mon, 18 Jul 2016 00:48:56 +0800 Subject: [PATCH 1179/1469] =?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 --- .../20160531 The Anatomy of a Linux User.md | 57 ------------------ .../20160531 The Anatomy of a Linux User.md | 58 +++++++++++++++++++ 2 files changed, 58 insertions(+), 57 deletions(-) delete mode 100644 sources/talk/20160531 The Anatomy of a Linux User.md create mode 100644 translated/talk/20160531 The Anatomy of a Linux User.md diff --git a/sources/talk/20160531 The Anatomy of a Linux User.md b/sources/talk/20160531 The Anatomy of a Linux User.md deleted file mode 100644 index b403758f2a..0000000000 --- a/sources/talk/20160531 The Anatomy of a Linux User.md +++ /dev/null @@ -1,57 +0,0 @@ -vim-kakali translating - -The Anatomy of a Linux User -================================ - - -**Some new GNU/Linux users understand right away that Linux isn’t Windows. Others never quite get it. The best distro designers strive to keep both in mind.** - -### The Heart of Linux - -Nicky isn’t outwardly remarkable in any way. She’s a thirtysomething who decided to go back to school later in life than most. She spent six years in the Navy until she decided a job offer from an old friend would be a better bet than a career in the armed forces. That happens a lot in any of the post-war military service branches. It was at that job where I met her. She was the regional manager for an eight state trucking broker and I was driving for a meat packing outfit in Dallas. - -![](http://i2.wp.com/fossforce.com/wp-content/uploads/2016/05/anatomy.jpg?w=525) - -We became good friends in 2006, Nicky and me. She’s an outgoing spirit, curious about almost anyone whose path she crosses. We had an ongoing Friday night date to go fight in an indoor laser combat arena. It wasn’t rare for us to burn through three 30 minute sessions in a row. Maybe it wasn’t as cheap as a paint ball arena, but it was climate controlled and had a horror game feel to it. It was during one of those outings that she asked me if I could fix her computer. - -She knew about my efforts to get computers into the homes of disadvantaged kids and I kidded her about paying into Bill Gates’ 401K plan when she complained about her computer becoming too slow. Nicky figured this was as good a time as any to see what Linux was all about. - -Her computer was a decent machine, a mid 2005 Asus desktop with a Dell 19″ monitor. Unfortunately, it had all the obligatory toolbars and popups that a Windows computer can collect when not properly tended. After getting all of the files from the computer, we began the process of installing Linux. We sat together during the install process and I made sure she understood the partitioning process. Inside of an hour, she had a bright new and shiny PCLinuxOS desktop. - -She remarked often, as she navigated her way through her new system, at how beautiful the system looked. She wasn’t mentioning this as an aside; she was almost hypnotized by the sleek beauty in front of her. She remarked that her screen “shimmered” with beauty. That’s something I took away from our install session and have made sure to deploy on every Linux computer I’ve installed since. I want the screen to shimmer for everyone. - -The first week or so, she called or emailed me with the usual questions, but the one that was probably the most important was wanting to know how to save her OpenOffice documents so colleagues could read them. This is key when teaching anyone Linux or Open/LibreOffice. Most people just obey the first popup, allow the document to be saved in Open Document Format and get their fingers bit in the process. - -There was a story going around a year or so ago about a high school kid who claimed he flunked an exam when his professor couldn’t open the file containing his paper. It made for some blustery comments from readers who couldn’t decide who was more of a moron, the kid for not having a clue or his professor for not having a ummm… clue of his own. - -I know some college professors and each and every one of them could figure out how to open an ODF file. Heck, even as much as Microsoft can be grade A, blue-ribbon proprietary jerks, I think Microsoft Office has been able to open an ODT or ODF file for a while now. I can’t say for sure since I haven’t used Microsoft Office much since 2005. - -Even in the bad ol’ days, when Microsoft was openly and flagrantly shoving their way onto enterprise desktops via their vendor lock-in, I never had a problem when conducting business or collaborating with users of Microsoft Office, because I became pro-active and never assumed. I would email the person or people I was to work with and ask what version of Office they were using. From that information, I could make sure to save my documents in a format they could readily open and read. - -But back to Nicky, who put a lot of time into learning about her Linux computer. I was surprised by her enthusiasm. - -Learning how to use Linux on the desktop is made much simpler when the person doing the learning realizes that all habits and tools for using Windows are to be left at the door. Even after telling our Reglue kids this, more often than not when I come back to do a check-up with them there is some_dodgy_file.exe on the desktop or in the download folder. - -While we are in the general vicinity of discussing files, let’s talk about doing updates. For a long time I was dead set against having multiple program installers or updaters on the same computer. In the case of Mint, it was decided to disable the update ability completely within Synaptic and that frosted my flakes. But while for us older folks dpkg and apt are our friends, wise heads have prevailed and have come to understand that the command line doesn’t often seem warm and welcoming to new users. - -I frothed at the mouth and raged against the machine over the crippling of Synaptic until it was ‘splained to me. Do you remember when you were just starting out and had full admin rights to your brand new Linux install? Remember when you combed through the massive amounts of software listed in Synaptic? Remember how you began check marking every cool program you found? Do you remember how many of those cool programs started with the letters “lib”? - -Yeah, me too. I installed and broke a few brand new installations until I found out that those LIB files were the nuts and bolts of the application and not the application itself. That’s why the genius’ behind Linux Mint and Ubuntu have created smart, pretty-to-look-at and easy-to-use application installers. Synaptic is still there for us old heads, but for the people coming up behind us, there are just too many ways to leave a system open to major borks by installing lib files and the like. In the new installers, those files are tucked away and not even shown to the user. And really, that’s the way it should be. - -Unless you are charging for support calls that is. - -There are a lot of smarts built into today’s Linux distros and I applaud those folks because they make my job easier. Not every new user is a Nicky. She was pretty much an install and forget project for me, and she is in the minority. The majority of new Linux users can be needy at times. - -That’s okay. They are the ones who will be teaching their kids how to use Linux. - --------------------------------------------------------------------------------- - -via: http://fossforce.com/2016/05/anatomy-linux-user/ - -作者:[Ken Starks][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://linuxlock.blogspot.com/ diff --git a/translated/talk/20160531 The Anatomy of a Linux User.md b/translated/talk/20160531 The Anatomy of a Linux User.md new file mode 100644 index 0000000000..a404697347 --- /dev/null +++ b/translated/talk/20160531 The Anatomy of a Linux User.md @@ -0,0 +1,58 @@ + + +一个 Linux 用户的故事 +================================ + + + +**一些新的 GNU/Linux 用户都很清楚的知道 Linux 不是 Windows .其他很多人都不是很清楚的知道.最好的发行版设计者努力保持新的思想** + +### Linux 的核心 + +不管怎么说,Nicky 都不是那种表面上看起来很值得注意的人.她已经三十岁了,却决定回到学校学习.她在海军待了6年时间直到她的老友给她一份新的工作,而且这份工作比她在军队的工作还好.在过去的军事分支服务期间发生了很多事情.我认识她还是她在军队工作的时候.她是8个州的货车运输业协商区域的管理者.那会我在达拉斯跑肉品包装工具的运输. +![](http://i2.wp.com/fossforce.com/wp-content/uploads/2016/05/anatomy.jpg?w=525) + + +Nicky 和我在 2006 年成为了好朋友.她很外向,并且有很强的好奇心,她几乎走过每个运输商走的路线.一个星期五晚上我们在灯光下有一场很激烈的争论,像这样的 达 30 分钟的争论在我们之间并不少见.或许这并不比油漆一个球场省事,但是气氛还是可以控制的住的,感觉就像是一个很恐怖的游戏.在这次争论的时候她问到我是否可以修复她的电脑. + +她知道我为了一些贫穷的孩子能拥有他们自己的电脑做出的努力,当她抱怨她的电脑很慢的时候,我提到了参加 Bill Gate 的 401k 计划[译注:这个计划是为那些为内部收益代码做过贡献的人们提供由税收定义的养老金账户.].Nicky 说这是了解 Linux 的最佳时间. + +她的电脑相当好,它是一个带有 Dell 19 显示器的华硕电脑.不好的是,当不需要一些东西的时候,这个 Windows 电脑会强制性的显示所有的工具条和文本菜单.我们把电脑上的文件都做了备份之后就开始安装 Linux 了.我们一起完成了安装,并且我确信她知道了如何分区.不到一个小时,她的电脑上就有了一个漂亮的 PCLinuxOS 桌面. + +她会经常谈论她使用新系统的方法,系统看起来多么漂亮.她不曾提及的是,她几乎被她面前的井然有序的漂亮桌面吸引.她说她的桌面带有漂亮的"微光".这是我在安装系统期间特意设置的.我每次在安装 Linux 的时候都会进行这样的配置.我想让每个 Linux 用户的桌面都配置这个漂亮的微光. + +大概第一周左右,她给我打电话或者发邮件问了一些常规的问题,但是最主要的问题还是她想知道怎样保存她打开的 Office 文件(OpenOffice)以至于她的同事也可以读这些文件.教一个人使用 Linux 或者 Open/LibreOffice 的时候最重要的就是教她保存文件.大多数用户仅仅看到第一个提示,只需要手指轻轻一点就可以以打开文件模式( Open Document Format )保存. + + +大约一年前或者更久,一个高中生说他没有通过期末考试,因为教授不能打开他写着论文的文件.这引来不能决定谁对谁错的读者的激烈评论.这个高中生和教授都不知道这件事该怪谁. + +我知道一些大学教授甚至每个人都能够打开一个 ODF 文件.见鬼,很少有像微软这样优秀的公司,我想 Microsoft Office 现在已经能打开 ODT 或者 ODF 文件了.我也不能确保,毕竟我最近一次用 Microsoft Office 是在 2005 年. + +甚至在困难时期,当 Microsoft 很受欢迎并且很热衷于为使用他们系统的厂商的企业桌面上安装他们自己的软件的时候,我和一些使用 Microsoft Office 的用户的产品生意和合作从来没有出现过问题,因为我会提前想到可能出现的问题并且不会有侥幸心理.我会发邮件给他们询问他们正在使用的 Office 版本.这样,我就可以确保以他们能够读写的格式保存文件. + +说到 Nicky ,她花了很多时间学习她的 Linux 系统.我很惊奇于她的热情. + +当人们意识到所有的使用 Windows 的习惯和工具都要被抛弃的时候,学习 Linux 系统也会很容易.甚至在我们谈论第一次用的系统时,我查看这些系统的桌面或者下载文件夹大多都找不到 some_dodgy_file.exe 这样的文件. + +在我们通常讨论这些文件的时候,我们也会提及关于更新的问题.很长时间我都不会在一台电脑上反复设置去完成多种程序的更新和安装.比如 Mint ,它没有带有 Synaptic [译注:一个 Linux 管理图像程序包]的完整更新方法,这让我失去兴趣.但是我们的老成员 dpkg 和 apt 是我们的好朋友,聪明的领导者已经得到肯定并且认识到命令行看起来不是那么舒服,同时欢迎新的用户加入. + +我很生气,强烈反对机器对 Synaptic 的削弱,最后我放弃使用它.你记得你第一次使用的 Linux 发行版吗?记得你什么时候在 Synaptic 中详细查看大量的软件列表吗?记得你怎样开始检查并标记每个你发现的很酷的程序吗?你记得有多少这样的程序开始都是使用"lib"这样的文件吗? + +是的,我也是。我安装并且查看了一些新的安装程序,直到我发现那些库文件是应用程序的螺母和螺栓,而不是应用程序本身.这就是为什么这些聪明的开发者在 Linux Mint 和 Ubuntu 之后创造了聪明、漂亮和易于使用的应用程序的安装程序.Synaptic 仍然是我们的老大,但是对于一些后来者,安装像 lib 文件这样的方式需要打开大量的文件夹,很多这样的事情都会导致他们放弃使用这个系统.在新的安装程序中,这些文件会被放在一个文件夹中甚至不会展示给用户.总之,这也是该有的解决方法. + +除非你要改变应该支持的需求. + +现在的 Linux 发行版中有很多有用的软件,我也很感谢这些开发者,因为他们,我的工作变得容易.不是每一个 Linux 新用户都像 Nicky 这样富有热情.她相当不错的完成了安装过程并且达到了忘我的状态.像她这样极具热情的毕竟是少数.大多数新的 Linux 用户也就是在需要的时候才这样用心. + +很不错,他们都是要教自己的孩子使用 Linux 的人. +-------------------------------------------------------------------------------- + +via: http://fossforce.com/2016/05/anatomy-linux-user/ + +作者:[Ken Starks][a] +译者:[vim-kakali](https://github.com/vim-kakali) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://linuxlock.blogspot.com/ From 54f396f110e974810a9a09db5bc811c027f04ea6 Mon Sep 17 00:00:00 2001 From: vim-kakali <1799225723@qq.com> Date: Mon, 18 Jul 2016 01:02:23 +0800 Subject: [PATCH 1180/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rvalds Talks IoT Smart Devices Security Concerns and More.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/talk/20160506 Linus Torvalds Talks IoT Smart Devices Security Concerns and More.md b/sources/talk/20160506 Linus Torvalds Talks IoT Smart Devices Security Concerns and More.md index 8744d5d38c..156fda88db 100644 --- a/sources/talk/20160506 Linus Torvalds Talks IoT Smart Devices Security Concerns and More.md +++ b/sources/talk/20160506 Linus Torvalds Talks IoT Smart Devices Security Concerns and More.md @@ -1,3 +1,5 @@ +vim-kakali translating + Linus Torvalds Talks IoT, Smart Devices, Security Concerns, and More[video] =========================================================================== From 4fbb8d306e88284f8ce12846efd72ca8fc45e7ab Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 18 Jul 2016 01:02:38 +0800 Subject: [PATCH 1181/1469] PUB:20151117 How bad a boss is Linus Torvalds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @FrankXinqi 翻译的不错,不过这种文章确实比较难翻译,我尝试做了校对,但是有些地方也不是很有把握和到位。 --- ...151117 How bad a boss is Linus Torvalds.md | 80 +++++++++++++++++++ ...151117 How bad a boss is Linus Torvalds.md | 80 ------------------- 2 files changed, 80 insertions(+), 80 deletions(-) create mode 100644 published/20151117 How bad a boss is Linus Torvalds.md delete mode 100644 translated/talk/20151117 How bad a boss is Linus Torvalds.md diff --git a/published/20151117 How bad a boss is Linus Torvalds.md b/published/20151117 How bad a boss is Linus Torvalds.md new file mode 100644 index 0000000000..b35ba67827 --- /dev/null +++ b/published/20151117 How bad a boss is Linus Torvalds.md @@ -0,0 +1,80 @@ +Linus Torvalds 是一个糟糕的老板吗? +================================================================================ + +![linus torvalds](http://images.techhive.com/images/article/2015/08/linus_torvalds-100600260-primary.idge.jpg) + +*1999 年 8 月 10 日,加利福尼亚州圣何塞市,在 LinuxWorld Show 上 Linus Torvalds 在一个坐满 Linux 爱好者的礼堂中发表了一篇演讲。图片来自:James Niccolai* + +**这取决于所处的领域。在软件开发的世界中,他也是个普通人。问题是,这种情况是否应该继续下去?** + +Linus Torvalds 是 Linux 的发明者,我认识他超过 20 年了。我们不是密友,但是我们欣赏彼此。 + +最近,因为 Linus Torvalds 的管理风格,他正遭到严厉的炮轰。Linus 无法忍受胡来的人。“代码的质量有多好?”是他在 Linux 内核的开发过程中评判人的一种方式。 + +没有什么比这个更重要了。正如 Linus 今年(2015年)早些时候在 Linux.conf.au 会议上说的那样,“我不是一个友好的人,我也不在意你。对我重要的是『[我所关心的技术和内核][1]』。” + +现在我也可以和这种只关心技术的人打交道了。如果你不能,你应当避免参加 Linux 内核会议,因为在那里你会遇到许多有这种精英思想的人。这不代表我认为在 Linux 领域所有东西都是极好的,并且不应该受到其他影响而带来改变。我能够和一个精英待在一起;而在一个男性做主导的大城堡中遇到的问题是,女性经常受到蔑视和无礼的对待。 + +这就是我看到的最近关于 Linus 管理风格所引发争论的原因 -- 或者更准确的说,他对于个人管理方面是完全冷漠的 -- 就像是在软件开发世界的标准操作流程一样。与此同时,我看到了揭示了这个事情需要改变的另外一个证据。 + +第一次是在 [Linux 4.3 发布][2]的时候出现的这个情况,Linus 使用 Linux 内核邮件列表来狠狠的数落了一个插入了一些网络方面的代码的开发者——这些代码很“烂”,“[生成了如此烂的代码][3]。这看起来太糟糕了,并且完全没有理由这样做。”他继续咆哮了半天。这里使用“烂”这个词,相对他早期使用的“愚蠢的”这个同义词来说还算好的。 + +但是,事情就是这样。Linus 是对的。我读了代码后,发现代码确实很烂,并且开发者只是为了用新的“overflow_usub()” 函数而用的。 + +现在,一些人把 Linus 的这种谩骂的行为看作他脾气不好而且恃强凌弱的证据。我见过一个完美主义者,在他的领域中,他无法忍受这种糟糕。 + +许多人告诉我,这不是一个专业的程序员应当有的行为。群众们,你曾经和最优秀的开发者一起工作过吗?据我所知道的,在 Apple,Microsoft,Oracle 这就是他们的行为。 + +我曾经听过 Steve Jobs 攻击一个开发者,就像要把他撕成碎片那样。我也被一个 Oracle 的高级开发者攻击一屋子的新开发者吓到过,就像食人鱼穿过一群金鱼那样。 + +在 Robert X. Cringely 关于 PC 崛起的经典书籍《[意外帝国(Accidental Empires)][5]》,中,他这样描述了微软的软件管理风格,比尔·盖茨像计算机系统一样管理他们,“比尔·盖茨的是最高等级,从他开始每一个等级依次递减,上级会向下级叫嚷,刺激他们,甚至羞辱他们。” + +Linus 和所有大型的商业软件公司的领导人不同的是,Linus 说在这里所有的东西是向全世界公开的。而其他人是在自己的会议室中做东西的。我听有人说 Linus 在那种公司中可能会被开除。这是不可能的。他会处于他现在所处的地位,他在编程世界的最顶端。 + +但是,这里有另外一个不同。如果 Larry Ellison (Oracle 的首席执行官)向你发火,你就别想在这里干了。如果 Linus 向你发火,你会在邮件中收到他的责骂。这就是差别。 + +你知道的,Linus 不是任何人的老板。他完全没有雇佣和解聘的权利,他只是负责着有 10000 个贡献者的一个项目而已。他仅仅能做的就是从心理上伤害你。 + +这说明,在开源软件开发圈和商业软件开发圈中同时存在一个非常严重的问题。不管你是一个多么好的编程者,如果你是一个女性,你的这个身份就是对你不利的。 + +这种情况并没有在 Sarah Sharp 的身上有任何好转,她现在是一个 Intel 的开发者,以前是一个顶尖的 Linux 程序员。[在她博客上10月份的一个帖子中][4],她解释道:“我最终发现,我不能够再为 Linux 社区做出贡献了。因为在那里,我虽然能够得到技术上的尊重,却得不到个人的尊重……我不想专职于同那些有着轻微的性别歧视或开同性恋玩笑的人一起工作。” + +谁会责怪她呢?我不会。很抱歉,我必须说,Linus 就像所有我见过的软件经理一样,是他造成了这种不利的工作环境。 + +他可能会说,确保 Linux 的贡献者都表现出专业精神和相互尊重不应该是他的工作。除了代码以外,他不关心任何其他事情。 + +就像 Sarah Sharp 写的那样: + + +> 我对于 Linux 内核社区做出的技术努力表示最大尊重。他们在那维护一些最高标准的代码,以此来平衡并且发展一个项目。他们专注于优秀的技术,以及超过负荷的维护人员,他们有不同的文化背景和社会规范,这些意味着这些 Linux 内核维护者说话非常直率、粗鲁,或者为了完成他们的任务而不讲道理。顶尖的 Linux 内核开发者经常为了使别人改正行为而向他们大喊大叫。 +> +> 这种事情发生在我身上,但它不是一种有效的沟通方式。 +> +> 许多高级的 Linux 内核开发者支持那些技术上和人性上不讲道理的维护者的权利。即使他们自己是非常友好的人,他们不想看到 Linux 内核交流方式改变。 + +她是对的。 + +我和其他观察者不同的是,我不认为这个问题对于 Linux 或开源社区在任何方面有特殊之处。作为一个从事技术商业工作超过五年和有着 25 年技术工作经历的记者,我见多了这种不成熟的小孩子行为。 + +这不是 Linus 的错误。他不是一个经理,他是一个有想象力的技术领导者。看起来真正的问题是,在软件开发领域没有人能够用一种支持的语气来对待团队和社区。 + +展望未来,我希望像 Linux 基金会这样的公司和组织,能够找到一种方式去授权社区经理或其他经理来鼓励并且强制实施民主的行为。 + +非常遗憾的是,我们不能够在我们这种纯技术或纯商业的领导人中找到这种管理策略。它不存在于这些人的基因中。 + +-------------------------------------------------------------------------------- + +via: http://www.computerworld.com/article/3004387/it-management/how-bad-a-boss-is-linus-torvalds.html + +作者:[Steven J. Vaughan-Nichols][a] +译者:[FrankXinqi](https://github.com/FrankXinqi) +校对:[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.computerworld.com/article/2874475/linus-torvalds-diversity-gaffe-brings-out-the-best-and-worst-of-the-open-source-world.html +[2]:http://www.zdnet.com/article/linux-4-3-released-after-linus-torvalds-scraps-brain-damage-code/ +[3]:http://lkml.iu.edu/hypermail/linux/kernel/1510.3/02866.html +[4]:http://sarah.thesharps.us/2015/10/05/closing-a-door/ +[5]:https://www.amazon.cn/Accidental-Empires-Cringely-Robert-X/dp/0887308554/479-5308016-9671450?ie=UTF8&qid=1447101469&ref_=sr_1_1&tag=geo-23 \ No newline at end of file diff --git a/translated/talk/20151117 How bad a boss is Linus Torvalds.md b/translated/talk/20151117 How bad a boss is Linus Torvalds.md deleted file mode 100644 index 5c7375c190..0000000000 --- a/translated/talk/20151117 How bad a boss is Linus Torvalds.md +++ /dev/null @@ -1,80 +0,0 @@ -Translated by FrankXinqi - -Linus Torvalds作为一个老板有多么糟糕? -================================================================================ -![linus torvalds](http://images.techhive.com/images/article/2015/08/linus_torvalds-100600260-primary.idge.jpg) - -*1999 年 8 月 10 日,加利福尼亚州圣何塞市,在 LinuxWorld Show 上 Linus Torvalds 在一个坐满 Linux 爱好者的礼堂中发表了一篇演讲。作者:James Niccolai* - -**这取决于所处的领域。在软件开发的世界中,他变得更加平庸。问题是,这种情况是否应该被允许继续?** - -Linus Torvalds 是 Linux 的发明者,我认识他超过 20 年了。我们不是密友,但是我们欣赏彼此。 - -最近,因为 Linus Torvalds 的管理风格,他正遭到严厉的炮轰。Linus 无法忍受胡来的人。「代码的质量有多好?」是他在 Linux 内核的开发过程中评判人的一种方式。 - -没有什么比这个更重要了。正如 Linus 今年(1999年)早些时候在 Linux.conf.au 会议上说的那样,「我不是一个友好的人,并且我不关心你。对我重要的是『[我所关心的技术和内核][1]』。」 - -现在我也可以和这只关心技术的这一类人打交道了。如果你不能,你应当避免参加 Linux 内核会议,因为在那里你会遇到许多有这种精英思想的人。这不代表我认为在 Linux 领域所有东西都是极好的,并且应该不受其他影响的来激起改变。我能够一起生活的一个精英;在一个男性做主导的大城堡中遇到的问题是,女性经常受到蔑视和无礼的对待。 - -这就是我看到的最近关于 Linus 管理风格所引发社会争吵的原因 -- 或者更准确的说,他对于个人管理方面是完全冷漠的 -- 就像不过是在软件开发世界的标准操作流程一样。与此同时,我看到了另外一个非常需要被改变的事实,它必须作为证据公开。 - -第一次是在 [Linux 4.3 发布][2]的时候出现的这个情况,Linus 使用 Linux 内核邮件列表来狠狠的攻击一个插入了非常糟糕并且没有价值的网络代码的开发者。「[这段代码导致了非常糟糕并且没有价值的代码。][3]这看起来太糟糕了,并且完全没有理由这样做。」当他说到这里的时候,他沉默了很长时间。除了使用「非常糟糕并且没有价值」这个词,他在早期使用「愚蠢的」这个同义词是相对较好的。 - -但是,事情就是这样。Linus 是对的。我读了代码后,发现代码确实很烂并且开发者是为了使用新的「overflow_usub()」 函数而使用的。 - -现在,一些人把 Linus 的这种谩骂的行为看作他脾气不好而且恃强凌弱的证据。我见过一个完美主义者,在他的领域中,他无法忍受这种糟糕。 - -许多人告诉我,这不是一个专业的程序员应当有的行为。人们,你曾经和最优秀的开发者一起工作过吗?据我所知道的,在 Apple,Microsoft,Oracle 这就是他们的行为。 - -我曾经听过 Steve Jobs 攻击一个开发者,像把他撕成碎片那样。我大为不快,当一个 Oracle 的高级开发者攻击一屋子的新开发者的时候就像食人鱼穿过一群金鱼那样。 - -在意外的电脑帝国,在 Robert X. Cringely 关于 PCs 崛起的经典书籍中,他这样描述 Bill Gates 的微软软件管理风格,Bill Gates 像计算机系统一样管理他们,『比尔盖茨是最高等级,从他开始每一个等级依次递减,上级会向下级叫嚷,刺激他们,甚至羞辱他们。』 - -Linus 和所有大型的私有软件公司的领导人不同的是,Linus 说在这里所有的东西是向全世界公开的。而其他人是在私有的会议室中做东西的。我听有人说 Linus 在那种公司中可能会被开除。这是不可能的。他会在正确的地方就像现在这样,他在编程世界的最顶端。 - -但是,这里有另外一个不同。如果 Larry Ellison (Oracle的首席执行官)向你发火,你就别想在这里干了。如果 Linus 向你发火,你会在邮件中收到他的责骂。这就是差别。 - -你知道的,Linus 不是任何人的老板。他完全没有雇佣和解聘的权利,他只是负责着有 10,000 个贡献者的一个项目而已。他仅仅能做的就是从心理上伤害你。 - -这说明,在开源软件开发圈和私有软件开发圈中同时存在一个非常严重的问题。不管你是一个多么好的编程者,如果你是一个女性,你的这个身份就是对你不利的。 - -这种情况并没有在 Sarah Sharp 的身上有任何好转,她现在是一个Intel的开发者,以前是一个顶尖的Linux程序员。[在她博客10月份的一个帖子中][4],她解释道:『我最终发现,我不能够再为Linux社区做出贡献了。因为在在那里,我虽然能够得到技术上的尊重,却得不到个人的尊重……我不想专职于同那些轻微的性别歧视者或开同性恋玩笑的人一起工作。』 - -谁能责怪她呢?我不能。我非常伤心的说,Linus 就像所有我见过的软件经理一样,是他造成了这种不利的工作环境。 - -他可能会说,确保 Linux 的贡献者都表现出专业精神和相互尊重不应该是他的工作。除了代码以外,他不关系任何其他事情。 - -就像Sarah Sharp写的那样: - - -> 我对于 Linux 内核社区做出的技术努力表现出非常的尊重。他们在那维护一些最高标准的代码,以此来平衡并且发展一个项目。他们专注于优秀的技术,却带有过量的维护人员,他们有不同的文化背景和社会规范,这些意味着这些 Linux 内核维护者说话非常直率,粗鲁或者为了完成他们的任务而不讲道理。顶尖的 Linux 内核开发者经常为了使别人改正行为而向他们大喊大叫。 -> -> 这种事情发生在我身上,但它不是一种有效的沟通方式。 -> -> 许多高级的 Linux 内核开发者支持那些技术上和人性上不讲道理的维护者的权利。即使他们是非常友好的人,他们不想看到 Linux 内核交流方式改变。 - -她是对的。 - -我和其他调查者不同的是,我不认为这个问题对于 Linux 或开源社区在任何方面有特殊之处。作为一个从事技术商业工作超过五年和有着 25 年技术工作经历的记者,我随处可见这种不成熟的男孩的行为。 - -这不是 Linus 的错误。他不是一个经理,他是一个有想象力的技术领导者。看起来真正的问题是,在软件开发领域没有人能够用一种支持的语气来对待团队和社区。 - -展望未来,我希望像 Linux Foundation 这样的公司和组织,能够找到一种方式去授权社区经理或其他经理来鼓励并且强制实施民主的行为。 - -非常遗憾的是,我们不能够在我们这种纯技术或纯商业的领导人中找到这种管理策略。它不存在于这些人的基因中。 - --------------------------------------------------------------------------------- - -via: http://www.computerworld.com/article/3004387/it-management/how-bad-a-boss-is-linus-torvalds.html - -作者:[Steven J. Vaughan-Nichols][a] -译者:[FrankXinqi](https://github.com/FrankXinqi) -校对:[校对者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.computerworld.com/article/2874475/linus-torvalds-diversity-gaffe-brings-out-the-best-and-worst-of-the-open-source-world.html -[2]:http://www.zdnet.com/article/linux-4-3-released-after-linus-torvalds-scraps-brain-damage-code/ -[3]:http://lkml.iu.edu/hypermail/linux/kernel/1510.3/02866.html -[4]:http://sarah.thesharps.us/2015/10/05/closing-a-door/ From 71310166ab32c538f150bcc7dcc9a33c89a0e822 Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 18 Jul 2016 09:34:07 +0800 Subject: [PATCH 1182/1469] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...160309 Let’s Build A Web Server. Part 1.md | 150 ------------------ 1 file changed, 150 deletions(-) delete mode 100644 sources/tech/20160309 Let’s Build A Web Server. Part 1.md diff --git a/sources/tech/20160309 Let’s Build A Web Server. Part 1.md b/sources/tech/20160309 Let’s Build A Web Server. Part 1.md deleted file mode 100644 index 4c8048786d..0000000000 --- a/sources/tech/20160309 Let’s Build A Web Server. Part 1.md +++ /dev/null @@ -1,150 +0,0 @@ -Let’s Build A Web Server. Part 1. -===================================== - -Out for a walk one day, a woman came across a construction site and saw three men working. She asked the first man, “What are you doing?” Annoyed by the question, the first man barked, “Can’t you see that I’m laying bricks?” Not satisfied with the answer, she asked the second man what he was doing. The second man answered, “I’m building a brick wall.” Then, turning his attention to the first man, he said, “Hey, you just passed the end of the wall. You need to take off that last brick.” Again not satisfied with the answer, she asked the third man what he was doing. And the man said to her while looking up in the sky, “I am building the biggest cathedral this world has ever known.” While he was standing there and looking up in the sky the other two men started arguing about the errant brick. The man turned to the first two men and said, “Hey guys, don’t worry about that brick. It’s an inside wall, it will get plastered over and no one will ever see that brick. Just move on to another layer.”1 - -The moral of the story is that when you know the whole system and understand how different pieces fit together (bricks, walls, cathedral), you can identify and fix problems faster (errant brick). - -What does it have to do with creating your own Web server from scratch? - -I believe to become a better developer you MUST get a better understanding of the underlying software systems you use on a daily basis and that includes programming languages, compilers and interpreters, databases and operating systems, web servers and web frameworks. And, to get a better and deeper understanding of those systems you MUST re-build them from scratch, brick by brick, wall by wall. - -Confucius put it this way: - ->“I hear and I forget.” - -![](https://ruslanspivak.com/lsbasi-part4/LSBAWS_confucius_hear.png) - ->“I see and I remember.” - -![](https://ruslanspivak.com/lsbasi-part4/LSBAWS_confucius_see.png) - ->“I do and I understand.” - -![](https://ruslanspivak.com/lsbasi-part4/LSBAWS_confucius_do.png) - -I hope at this point you’re convinced that it’s a good idea to start re-building different software systems to learn how they work. - -In this three-part series I will show you how to build your own basic Web server. Let’s get started. - -First things first, what is a Web server? - -![](https://ruslanspivak.com/lsbaws-part1/LSBAWS_HTTP_request_response.png) - -In a nutshell it’s a networking server that sits on a physical server (oops, a server on a server) and waits for a client to send a request. When it receives a request, it generates a response and sends it back to the client. The communication between a client and a server happens using HTTP protocol. A client can be your browser or any other software that speaks HTTP. - -What would a very simple implementation of a Web server look like? Here is my take on it. The example is in Python but even if you don’t know Python (it’s a very easy language to pick up, try it!) you still should be able to understand concepts from the code and explanations below: - -``` -import socket - -HOST, PORT = '', 8888 - -listen_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) -listen_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) -listen_socket.bind((HOST, PORT)) -listen_socket.listen(1) -print 'Serving HTTP on port %s ...' % PORT -while True: - client_connection, client_address = listen_socket.accept() - request = client_connection.recv(1024) - print request - - http_response = """\ -HTTP/1.1 200 OK - -Hello, World! -""" - client_connection.sendall(http_response) - client_connection.close() -``` - -Save the above code as webserver1.py or download it directly from GitHub and run it on the command line like this - -``` -$ python webserver1.py -Serving HTTP on port 8888 … -``` - -Now type in the following URL in your Web browser’s address bar http://localhost:8888/hello, hit Enter, and see magic in action. You should see “Hello, World!” displayed in your browser like this: - -![](https://ruslanspivak.com/lsbaws-part1/browser_hello_world.png) - -Just do it, seriously. I will wait for you while you’re testing it. - -Done? Great. Now let’s discuss how it all actually works. - -First let’s start with the Web address you’ve entered. It’s called an URL and here is its basic structure: - -![](https://ruslanspivak.com/lsbaws-part1/LSBAWS_URL_Web_address.png) - -This is how you tell your browser the address of the Web server it needs to find and connect to and the page (path) on the server to fetch for you. Before your browser can send a HTTP request though, it first needs to establish a TCP connection with the Web server. Then it sends an HTTP request over the TCP connection to the server and waits for the server to send an HTTP response back. And when your browser receives the response it displays it, in this case it displays “Hello, World!” - -Let’s explore in more detail how the client and the server establish a TCP connection before sending HTTP requests and responses. To do that they both use so-called sockets. Instead of using a browser directly you are going to simulate your browser manually by using telnet on the command line. - -On the same computer you’re running the Web server fire up a telnet session on the command line specifying a host to connect to localhost and the port to connect to 8888 and then press Enter: - -``` -$ telnet localhost 8888 -Trying 127.0.0.1 … -Connected to localhost. -``` - -At this point you’ve established a TCP connection with the server running on your local host and ready to send and receive HTTP messages. In the picture below you can see a standard procedure a server has to go through to be able to accept new TCP connections. - -![](https://ruslanspivak.com/lsbaws-part1/LSBAWS_socket.png) - -In the same telnet session type GET /hello HTTP/1.1 and hit Enter: - -``` -$ telnet localhost 8888 -Trying 127.0.0.1 … -Connected to localhost. -GET /hello HTTP/1.1 - -HTTP/1.1 200 OK -Hello, World! -``` - -You’ve just manually simulated your browser! You sent an HTTP request and got an HTTP response back. This is the basic structure of an HTTP request: - -![](https://ruslanspivak.com/lsbaws-part1/LSBAWS_HTTP_request_anatomy.png) - -The HTTP request consists of the line indicating the HTTP method (GET, because we are asking our server to return us something), the path /hello that indicates a “page” on the server we want and the protocol version. - -For simplicity’s sake our Web server at this point completely ignores the above request line. You could just as well type in any garbage instead of “GET /hello HTTP/1.1” and you would still get back a “Hello, World!” response. - -Once you’ve typed the request line and hit Enter the client sends the request to the server, the server reads the request line, prints it and returns the proper HTTP response. - -Here is the HTTP response that the server sends back to your client (telnet in this case): - -![](https://ruslanspivak.com/lsbaws-part1/LSBAWS_HTTP_response_anatomy.png) - -Let’s dissect it. The response consists of a status line HTTP/1.1 200 OK, followed by a required empty line, and then the HTTP response body. - -The response status line HTTP/1.1 200 OK consists of the HTTP Version, the HTTP status code and the HTTP status code reason phrase OK. When the browser gets the response, it displays the body of the response and that’s why you see “Hello, World!” in your browser. - -And that’s the basic model of how a Web server works. To sum it up: The Web server creates a listening socket and starts accepting new connections in a loop. The client initiates a TCP connection and, after successfully establishing it, the client sends an HTTP request to the server and the server responds with an HTTP response that gets displayed to the user. To establish a TCP connection both clients and servers use sockets. - -Now you have a very basic working Web server that you can test with your browser or some other HTTP client. As you’ve seen and hopefully tried, you can also be a human HTTP client too, by using telnet and typing HTTP requests manually. - -Here’s a question for you: “How do you run a Django application, Flask application, and Pyramid application under your freshly minted Web server without making a single change to the server to accommodate all those different Web frameworks?” - -I will show you exactly how in Part 2 of the series. Stay tuned. - -BTW, I’m writing a book “Let’s Build A Web Server: First Steps” that explains how to write a basic web server from scratch and goes into more detail on topics I just covered. Subscribe to the mailing list to get the latest updates about the book and the release date. - --------------------------------------------------------------------------------- - -via: https://ruslanspivak.com/lsbaws-part1/ - -作者:[Ruslan][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://linkedin.com/in/ruslanspivak/ - - - From 65a6b871815b907d197d2d73189d99d13f084bdf Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 18 Jul 2016 09:34:17 +0800 Subject: [PATCH 1183/1469] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...160406 Let’s Build A Web Server. Part 2.md | 427 ------------------ 1 file changed, 427 deletions(-) delete mode 100644 sources/tech/20160406 Let’s Build A Web Server. Part 2.md diff --git a/sources/tech/20160406 Let’s Build A Web Server. Part 2.md b/sources/tech/20160406 Let’s Build A Web Server. Part 2.md deleted file mode 100644 index 482352ac9a..0000000000 --- a/sources/tech/20160406 Let’s Build A Web Server. Part 2.md +++ /dev/null @@ -1,427 +0,0 @@ -Let’s Build A Web Server. Part 2. -=================================== - -Remember, in Part 1 I asked you a question: “How do you run a Django application, Flask application, and Pyramid application under your freshly minted Web server without making a single change to the server to accommodate all those different Web frameworks?” Read on to find out the answer. - -In the past, your choice of a Python Web framework would limit your choice of usable Web servers, and vice versa. If the framework and the server were designed to work together, then you were okay: - -![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_before_wsgi.png) - -But you could have been faced (and maybe you were) with the following problem when trying to combine a server and a framework that weren’t designed to work together: - -![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_after_wsgi.png) - -Basically you had to use what worked together and not what you might have wanted to use. - -So, how do you then make sure that you can run your Web server with multiple Web frameworks without making code changes either to the Web server or to the Web frameworks? And the answer to that problem became the Python Web Server Gateway Interface (or WSGI for short, pronounced “wizgy”). - -![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_wsgi_idea.png) - -WSGI allowed developers to separate choice of a Web framework from choice of a Web server. Now you can actually mix and match Web servers and Web frameworks and choose a pairing that suits your needs. You can run Django, Flask, or Pyramid, for example, with Gunicorn or Nginx/uWSGI or Waitress. Real mix and match, thanks to the WSGI support in both servers and frameworks: - -![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_wsgi_interop.png) - -So, WSGI is the answer to the question I asked you in Part 1 and repeated at the beginning of this article. Your Web server must implement the server portion of a WSGI interface and all modern Python Web Frameworks already implement the framework side of the WSGI interface, which allows you to use them with your Web server without ever modifying your server’s code to accommodate a particular Web framework. - -Now you know that WSGI support by Web servers and Web frameworks allows you to choose a pairing that suits you, but it is also beneficial to server and framework developers because they can focus on their preferred area of specialization and not step on each other’s toes. Other languages have similar interfaces too: Java, for example, has Servlet API and Ruby has Rack. - -It’s all good, but I bet you are saying: “Show me the code!” Okay, take a look at this pretty minimalistic WSGI server implementation: - -``` -# Tested with Python 2.7.9, Linux & Mac OS X -import socket -import StringIO -import sys - - -class WSGIServer(object): - - address_family = socket.AF_INET - socket_type = socket.SOCK_STREAM - request_queue_size = 1 - - def __init__(self, server_address): - # Create a listening socket - self.listen_socket = listen_socket = socket.socket( - self.address_family, - self.socket_type - ) - # Allow to reuse the same address - listen_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) - # Bind - listen_socket.bind(server_address) - # Activate - listen_socket.listen(self.request_queue_size) - # Get server host name and port - host, port = self.listen_socket.getsockname()[:2] - self.server_name = socket.getfqdn(host) - self.server_port = port - # Return headers set by Web framework/Web application - self.headers_set = [] - - def set_app(self, application): - self.application = application - - def serve_forever(self): - listen_socket = self.listen_socket - while True: - # New client connection - self.client_connection, client_address = listen_socket.accept() - # Handle one request and close the client connection. Then - # loop over to wait for another client connection - self.handle_one_request() - - def handle_one_request(self): - self.request_data = request_data = self.client_connection.recv(1024) - # Print formatted request data a la 'curl -v' - print(''.join( - '< {line}\n'.format(line=line) - for line in request_data.splitlines() - )) - - self.parse_request(request_data) - - # Construct environment dictionary using request data - env = self.get_environ() - - # It's time to call our application callable and get - # back a result that will become HTTP response body - result = self.application(env, self.start_response) - - # Construct a response and send it back to the client - self.finish_response(result) - - def parse_request(self, text): - request_line = text.splitlines()[0] - request_line = request_line.rstrip('\r\n') - # Break down the request line into components - (self.request_method, # GET - self.path, # /hello - self.request_version # HTTP/1.1 - ) = request_line.split() - - def get_environ(self): - env = {} - # The following code snippet does not follow PEP8 conventions - # but it's formatted the way it is for demonstration purposes - # to emphasize the required variables and their values - # - # Required WSGI variables - env['wsgi.version'] = (1, 0) - env['wsgi.url_scheme'] = 'http' - env['wsgi.input'] = StringIO.StringIO(self.request_data) - env['wsgi.errors'] = sys.stderr - env['wsgi.multithread'] = False - env['wsgi.multiprocess'] = False - env['wsgi.run_once'] = False - # Required CGI variables - env['REQUEST_METHOD'] = self.request_method # GET - env['PATH_INFO'] = self.path # /hello - env['SERVER_NAME'] = self.server_name # localhost - env['SERVER_PORT'] = str(self.server_port) # 8888 - return env - - def start_response(self, status, response_headers, exc_info=None): - # Add necessary server headers - server_headers = [ - ('Date', 'Tue, 31 Mar 2015 12:54:48 GMT'), - ('Server', 'WSGIServer 0.2'), - ] - self.headers_set = [status, response_headers + server_headers] - # To adhere to WSGI specification the start_response must return - # a 'write' callable. We simplicity's sake we'll ignore that detail - # for now. - # return self.finish_response - - def finish_response(self, result): - try: - status, response_headers = self.headers_set - response = 'HTTP/1.1 {status}\r\n'.format(status=status) - for header in response_headers: - response += '{0}: {1}\r\n'.format(*header) - response += '\r\n' - for data in result: - response += data - # Print formatted response data a la 'curl -v' - print(''.join( - '> {line}\n'.format(line=line) - for line in response.splitlines() - )) - self.client_connection.sendall(response) - finally: - self.client_connection.close() - - -SERVER_ADDRESS = (HOST, PORT) = '', 8888 - - -def make_server(server_address, application): - server = WSGIServer(server_address) - server.set_app(application) - return server - - -if __name__ == '__main__': - if len(sys.argv) < 2: - sys.exit('Provide a WSGI application object as module:callable') - app_path = sys.argv[1] - module, application = app_path.split(':') - module = __import__(module) - application = getattr(module, application) - httpd = make_server(SERVER_ADDRESS, application) - print('WSGIServer: Serving HTTP on port {port} ...\n'.format(port=PORT)) - httpd.serve_forever() -``` - -It’s definitely bigger than the server code in Part 1, but it’s also small enough (just under 150 lines) for you to understand without getting bogged down in details. The above server also does more - it can run your basic Web application written with your beloved Web framework, be it Pyramid, Flask, Django, or some other Python WSGI framework. - -Don’t believe me? Try it and see for yourself. Save the above code as webserver2.py or download it directly from GitHub. If you try to run it without any parameters it’s going to complain and exit. - -``` -$ python webserver2.py -Provide a WSGI application object as module:callable -``` - -It really wants to serve your Web application and that’s where the fun begins. To run the server the only thing you need installed is Python. But to run applications written with Pyramid, Flask, and Django you need to install those frameworks first. Let’s install all three of them. My preferred method is by using virtualenv. Just follow the steps below to create and activate a virtual environment and then install all three Web frameworks. - -``` -$ [sudo] pip install virtualenv -$ mkdir ~/envs -$ virtualenv ~/envs/lsbaws/ -$ cd ~/envs/lsbaws/ -$ ls -bin include lib -$ source bin/activate -(lsbaws) $ pip install pyramid -(lsbaws) $ pip install flask -(lsbaws) $ pip install django -``` - -At this point you need to create a Web application. Let’s start with Pyramid first. Save the following code as pyramidapp.py to the same directory where you saved webserver2.py or download the file directly from GitHub: - -``` -from pyramid.config import Configurator -from pyramid.response import Response - - -def hello_world(request): - return Response( - 'Hello world from Pyramid!\n', - content_type='text/plain', - ) - -config = Configurator() -config.add_route('hello', '/hello') -config.add_view(hello_world, route_name='hello') -app = config.make_wsgi_app() -``` - -Now you’re ready to serve your Pyramid application with your very own Web server: - -``` -(lsbaws) $ python webserver2.py pyramidapp:app -WSGIServer: Serving HTTP on port 8888 ... -``` - -You just told your server to load the ‘app’ callable from the python module ‘pyramidapp’ Your server is now ready to take requests and forward them to your Pyramid application. The application only handles one route now: the /hello route. Type http://localhost:8888/hello address into your browser, press Enter, and observe the result: - -![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_browser_pyramid.png) - -You can also test the server on the command line using the ‘curl’ utility: - -``` -$ curl -v http://localhost:8888/hello -... -``` - -Check what the server and curl prints to standard output. - -Now onto Flask. Let’s follow the same steps. - -``` -from flask import Flask -from flask import Response -flask_app = Flask('flaskapp') - - -@flask_app.route('/hello') -def hello_world(): - return Response( - 'Hello world from Flask!\n', - mimetype='text/plain' - ) - -app = flask_app.wsgi_app -``` - -Save the above code as flaskapp.py or download it from GitHub and run the server as: - -``` -(lsbaws) $ python webserver2.py flaskapp:app -WSGIServer: Serving HTTP on port 8888 ... -``` - -Now type in the http://localhost:8888/hello into your browser and press Enter: - -![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_browser_flask.png) - -Again, try ‘curl’ and see for yourself that the server returns a message generated by the Flask application: - -``` -$ curl -v http://localhost:8888/hello -... -``` - -Can the server also handle a Django application? Try it out! It’s a little bit more involved, though, and I would recommend cloning the whole repo and use djangoapp.py, which is part of the GitHub repository. Here is the source code which basically adds the Django ‘helloworld’ project (pre-created using Django’s django-admin.py startproject command) to the current Python path and then imports the project’s WSGI application. - -``` -import sys -sys.path.insert(0, './helloworld') -from helloworld import wsgi - - -app = wsgi.application -``` - -Save the above code as djangoapp.py and run the Django application with your Web server: - -``` -(lsbaws) $ python webserver2.py djangoapp:app -WSGIServer: Serving HTTP on port 8888 ... -``` - -Type in the following address and press Enter: - -![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_browser_django.png) - -And as you’ve already done a couple of times before, you can test it on the command line, too, and confirm that it’s the Django application that handles your requests this time around: - -``` -$ curl -v http://localhost:8888/hello -... -``` - -Did you try it? Did you make sure the server works with those three frameworks? If not, then please do so. Reading is important, but this series is about rebuilding and that means you need to get your hands dirty. Go and try it. I will wait for you, don’t worry. No seriously, you must try it and, better yet, retype everything yourself and make sure that it works as expected. - -Okay, you’ve experienced the power of WSGI: it allows you to mix and match your Web servers and Web frameworks. WSGI provides a minimal interface between Python Web servers and Python Web Frameworks. It’s very simple and it’s easy to implement on both the server and the framework side. The following code snippet shows the server and the framework side of the interface: - -``` -def run_application(application): - """Server code.""" - # This is where an application/framework stores - # an HTTP status and HTTP response headers for the server - # to transmit to the client - headers_set = [] - # Environment dictionary with WSGI/CGI variables - environ = {} - - def start_response(status, response_headers, exc_info=None): - headers_set[:] = [status, response_headers] - - # Server invokes the ‘application' callable and gets back the - # response body - result = application(environ, start_response) - # Server builds an HTTP response and transmits it to the client - … - -def app(environ, start_response): - """A barebones WSGI app.""" - start_response('200 OK', [('Content-Type', 'text/plain')]) - return ['Hello world!'] - -run_application(app) -``` - -Here is how it works: - -1. The framework provides an ‘application’ callable (The WSGI specification doesn’t prescribe how that should be implemented) -2. The server invokes the ‘application’ callable for each request it receives from an HTTP client. It passes a dictionary ‘environ’ containing WSGI/CGI variables and a ‘start_response’ callable as arguments to the ‘application’ callable. -3. The framework/application generates an HTTP status and HTTP response headers and passes them to the ‘start_response’ callable for the server to store them. The framework/application also returns a response body. -4. The server combines the status, the response headers, and the response body into an HTTP response and transmits it to the client (This step is not part of the specification but it’s the next logical step in the flow and I added it for clarity) - -And here is a visual representation of the interface: - -![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_wsgi_interface.png) - -So far, you’ve seen the Pyramid, Flask, and Django Web applications and you’ve seen the server code that implements the server side of the WSGI specification. You’ve even seen the barebones WSGI application code snippet that doesn’t use any framework. - -The thing is that when you write a Web application using one of those frameworks you work at a higher level and don’t work with WSGI directly, but I know you’re curious about the framework side of the WSGI interface, too because you’re reading this article. So, let’s create a minimalistic WSGI Web application/Web framework without using Pyramid, Flask, or Django and run it with your server: - -``` -def app(environ, start_response): - """A barebones WSGI application. - - This is a starting point for your own Web framework :) - """ - status = '200 OK' - response_headers = [('Content-Type', 'text/plain')] - start_response(status, response_headers) - return ['Hello world from a simple WSGI application!\n'] -``` - -Again, save the above code in wsgiapp.py file or download it from GitHub directly and run the application under your Web server as: - -``` -(lsbaws) $ python webserver2.py wsgiapp:app -WSGIServer: Serving HTTP on port 8888 ... -``` - -Type in the following address and press Enter. This is the result you should see: - -![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_browser_simple_wsgi_app.png) - -You just wrote your very own minimalistic WSGI Web framework while learning about how to create a Web server! Outrageous. - -Now, let’s get back to what the server transmits to the client. Here is the HTTP response the server generates when you call your Pyramid application using an HTTP client: - -![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_http_response.png) - -The response has some familiar parts that you saw in Part 1 but it also has something new. It has, for example, four HTTP headers that you haven’t seen before: Content-Type, Content-Length, Date, and Server. Those are the headers that a response from a Web server generally should have. None of them are strictly required, though. The purpose of the headers is to transmit additional information about the HTTP request/response. - -Now that you know more about the WSGI interface, here is the same HTTP response with some more information about what parts produced it: - -![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_http_response_explanation.png) - -I haven’t said anything about the ‘environ’ dictionary yet, but basically it’s a Python dictionary that must contain certain WSGI and CGI variables prescribed by the WSGI specification. The server takes the values for the dictionary from the HTTP request after parsing the request. This is what the contents of the dictionary look like: - -![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_environ.png) - -A Web framework uses the information from that dictionary to decide which view to use based on the specified route, request method etc., where to read the request body from and where to write errors, if any. - -By now you’ve created your own WSGI Web server and you’ve made Web applications written with different Web frameworks. And, you’ve also created your barebones Web application/Web framework along the way. It’s been a heck of a journey. Let’s recap what your WSGI Web server has to do to serve requests aimed at a WSGI application: - -- First, the server starts and loads an ‘application’ callable provided by your Web framework/application -- Then, the server reads a request -- Then, the server parses it -- Then, it builds an ‘environ’ dictionary using the request data -- Then, it calls the ‘application’ callable with the ‘environ’ dictionary and a ‘start_response’ callable as parameters and gets back a response body. -- Then, the server constructs an HTTP response using the data returned by the call to the ‘application’ object and the status and response headers set by the ‘start_response’ callable. -- And finally, the server transmits the HTTP response back to the client - -![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_server_summary.png) - -That’s about all there is to it. You now have a working WSGI server that can serve basic Web applications written with WSGI compliant Web frameworks like Django, Flask, Pyramid, or your very own WSGI framework. The best part is that the server can be used with multiple Web frameworks without any changes to the server code base. Not bad at all. - -Before you go, here is another question for you to think about, “How do you make your server handle more than one request at a time?” - -Stay tuned and I will show you a way to do that in Part 3. Cheers! - -BTW, I’m writing a book “Let’s Build A Web Server: First Steps” that explains how to write a basic web server from scratch and goes into more detail on topics I just covered. Subscribe to the mailing list to get the latest updates about the book and the release date. - --------------------------------------------------------------------------------- - -via: https://ruslanspivak.com/lsbaws-part2/ - -作者:[Ruslan][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://github.com/rspivak/ - - - - - - From 907ffd4c3432fd5a95a93348f8367db6d7128e6f Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 18 Jul 2016 10:00:06 +0800 Subject: [PATCH 1184/1469] =?UTF-8?q?20160718-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20160711 Getting Started with Git.md | 134 ++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 sources/tech/20160711 Getting Started with Git.md diff --git a/sources/tech/20160711 Getting Started with Git.md b/sources/tech/20160711 Getting Started with Git.md new file mode 100644 index 0000000000..cf67119f28 --- /dev/null +++ b/sources/tech/20160711 Getting Started with Git.md @@ -0,0 +1,134 @@ +Getting started with Git +====================== + + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/get_started_lead.jpeg?itok=r22AKc6P) + +In the introduction to this series we learned who should use Git, and what it is for. Today we will learn how to clone public Git repositories, and how to extract individual files without cloning the whole works. + +Since Git is so popular, it makes life a lot easier if you're at least familiar with it at a basic level. If you can grasp the basics (and you can, I promise!), then you'll be able to download whatever you need, and maybe even contribute stuff back. And that, after all, is what open source is all about: having access to the code that makes up the software you run, the freedom to share it with others, and the right to change it as you please. Git makes this whole process easy, as long as you're comfortable with Git. + +So let's get comfortable with Git. + +### Read and write + +Broadly speaking, there are two ways to interact with a Git repository: you can read from it, or you can write to it. It's just like a file: sometimes you open a document just to read it, and other times you open a document because you need to make changes. + +In this article, we'll cover reading from a Git repository. We'll tackle the subject of writing back to a Git repository in a later article. + +### Git or GitHub? + +A word of clarification: Git is not the same as GitHub (or GitLab, or Bitbucket). Git is a command-line program, so it looks like this: + +``` +$ git +usage: Git [--version] [--help] [-C ] + [-p | --paginate | --no-pager] [--bare] + [--Git-dir=] [] +``` + +As Git is open source, lots of smart people have built infrastructures around it which, in themselves, have become very popular. + +My articles about Git teach pure Git first, because if you understand what Git is doing then you can maintain an indifference to what front end you are using. However, my articles also include common ways of accomplishing each task through popular Git services, since that's probably what you'll encounter first. + +### Installing Git + +To install Git on Linux, grab it from your distribution's software repository. BSD users should find Git in the Ports tree, in the devel section. + +For non-open source operating systems, go to the project site and follow the instructions. Once installed, there should be no difference between Linux, BSD, and Mac OS X commands. Windows users will have to adapt Git commands to match the Windows file system, or install Cygwin to run Git natively, without getting tripped up by Windows file system conventions. + +### Afternoon tea with Git + +Not every one of us needs to adopt Git into our daily lives right away. Sometimes, the most interaction you have with Git is to visit a repository of code, download a file or two, and then leave. On the spectrum of getting to know Git, this is more like afternoon tea than a proper dinner party. You make some polite conversation, you get the information you need, and then you part ways without the intention of speaking again for at least another three months. + +And that's OK. + +Generally speaking, there are two ways to access Git: via command line, or by any one of the fancy Internet technologies providing quick and easy access through the web browser. + +Say you want to install a trash bin for use in your terminal because you've been burned one too many times by the rm command. You've heard about Trashy, which calls itself "a sane intermediary to the rm command", and you want to look over its documentation before you install it. Lucky for you, [Trashy is hosted publicly on GitLab.com][1]. + +### Landgrab + +The first way we'll work with this Git repository is a sort of landgrab method: we'll clone the entire thing, and then sort through the contents later. Since the repository is hosted with a public Git service, there are two ways to do this: on the command line, or through a web interface. + +To grab an entire repository with Git, use the git clone command with the URL of the Git repository. If you're not clear on what the right URL is, the repository should tell you. GitLab gives you a copy-and-paste repository URL [for Trashy][2]. + +![](https://opensource.com/sites/default/files/1_gitlab-url.jpg) + +You might notice that on some services, both SSH and HTTPS links are provided. You can use SSH only if you have write permissions to the repository. Otherwise, you must use the HTTPS URL. + +Once you have the right URL, cloning the repository is pretty simple. Just git clone the URL, and optionally name the directory to clone it into. The default behaviour is to clone the git directory to your current directory; for example, 'trashy.git' gets put in your current location as 'trashy'. I use the .clone extension as a shorthand for repositories that are read-only, and the .git extension as shorthand for repositories I can read and write, but that's not by any means an official mandate. + +``` +$ git clone https://gitlab.com/trashy/trashy.git trashy.clone +Cloning into 'trashy.clone'... +remote: Counting objects: 142, done. +remote: Compressing objects: 100% (91/91), done. +remote: Total 142 (delta 70), reused 103 (delta 47) +Receiving objects: 100% (142/142), 25.99 KiB | 0 bytes/s, done. +Resolving deltas: 100% (70/70), done. +Checking connectivity... done. +``` + +Once the repository has been cloned successfully, you can browse files in it just as you would any other directory on your computer. + +The other way to get a copy of the repository is through the web interface. Both GitLab and GitHub provide a snapshot of any repository in a .zip file. GitHub has a big green download button, but on GitLab, look for an inconspicuous download button on the far right of your browser window: + +![](https://opensource.com/sites/default/files/1_gitlab-zip.jpg) + +### Pick and choose + +An alternate method of obtaining a file from a Git repository is to find the file you're after and pluck it right out of the repository. This method is only supported via web interfaces, which is essentially you looking at someone else's clone of a repository; you can think of it as a sort of HTTP shared directory. + +The problem with using this method is that you might find that certain files don't actually exist in a raw Git repository, as a file might only exist in its complete form after a make command builds the file, which won't happen until you download the repository, read the README or INSTALL file, and run the command. Assuming, however, that you are sure a file does exist and you just want to go into the repository, grab it, and walk away, you can do that. + +In GitLab and GitHub, click the Files link for a file view, view the file in Raw mode, and use your web browser's save function, e.g. in Firefox, File > Save Page As. In a GitWeb repository (a web view of personal git repositories used some who prefer to host git themselves), the Raw view link is in the file listing view. + +![](https://opensource.com/sites/default/files/1_webgit-file.jpg) + +### Best practices + +Generally, cloning an entire Git repository is considered the right way of interacting with Git. There are a few reasons for this. Firstly, a clone is easy to keep updated with the git pull command, so you won't have to keep going back to some web site for a new copy of a file each time an improvement has been made. Secondly, should you happen to make an improvement yourself, then it is easier to submit those changes to the original author if it is all nice and tidy in a Git repository. + +For now, it's probably enough to just practice going out and finding interesting Git repositories and cloning them to your drive. As long as you know the basics of using a terminal, then it's not hard to do. Don't know the basics of terminal usage? Give me five more minutes of your time. + +### Terminal basics + +The first thing to understand is that all files have a path. That makes sense; if I told you to open a file for me on a regular non-terminal day, you'd have to get to where that file is on your drive, and you'd do that by navigating a bunch of computer windows until you reached that file. For example, maybe you'd click your home directory > Pictures > InktoberSketches > monkey.kra. + +In that scenario, we could say that the file monkeysketch.kra has the path $HOME/Pictures/InktoberSketches/monkey.kra. + +In the terminal, unless you're doing special sysadmin work, your file paths are generally going to start with $HOME (or, if you're lazy, just the ~ character) followed by a list of folders up to the filename itself. This is analogous to whatever icons you click in your GUI to reach the file or folder. + +If you want to clone a Git repository into your Documents directory, then you could open a terminal and run this command: + +``` +$ git clone https://gitlab.com/foo/bar.git $HOME/Documents/bar.clone +``` + +Once that is complete, you can open a file manager window, navigate to your Documents folder, and you'll find the bar.clone directory waiting for you. + +If you want to get a little more advanced, you might revisit that repository at some later date, and try a git pull to see if there have been updates to the project: + +``` +$ cd $HOME/Documents/bar.clone +$ pwd +bar.clone +$ git pull +``` + +For now, that's all the terminal commands you need to get started, so go out and explore. The more you do it, the better you get at it, and that is, at least give or take a vowel, the name of the game. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/16/7/stumbling-git + +作者:[Seth Kenlon][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[1]: https://gitlab.com/trashy/trashy +[2]: https://gitlab.com/trashy/trashy.git From cdabd546a481dbbee266622f36d041668b4d519f Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 18 Jul 2016 10:04:22 +0800 Subject: [PATCH 1185/1469] =?UTF-8?q?20160718-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...latform Discourse On Ubuntu Linux 16.04.md | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 sources/tech/20160628 How To Setup Open Source Discussion Platform Discourse On Ubuntu Linux 16.04.md diff --git a/sources/tech/20160628 How To Setup Open Source Discussion Platform Discourse On Ubuntu Linux 16.04.md b/sources/tech/20160628 How To Setup Open Source Discussion Platform Discourse On Ubuntu Linux 16.04.md new file mode 100644 index 0000000000..a2521673c9 --- /dev/null +++ b/sources/tech/20160628 How To Setup Open Source Discussion Platform Discourse On Ubuntu Linux 16.04.md @@ -0,0 +1,101 @@ +How To Setup Open Source Discussion Platform Discourse On Ubuntu Linux 16.04 +=============================================================================== + +Discourse is an open source discussion platform, that can work as a mailing list, a chat room and a forum as well. It is a popular tool and modern day implementation of a successful discussion platform. On server side, it is built using Ruby on Rails and uses Postgres on the backend, it also makes use of Redis caching to reduce the loading times, while on client’s side end, it runs in browser using Java Script. It is a pretty well optimized and well structured tool. It also offers converter plugins to migrate your existing discussion boards / forums like vBulletin, phpBB, Drupal, SMF etc to Discourse. In this article, we will be learning how to install Discourse on Ubuntu operating system. + +It is developed by keeping security in mind, so spammers and hackers might not be lucky with this application. It works well with all modern devices, and adjusts its display setting accordingly for mobile devices and tablets. + +### Installing Discourse on Ubuntu 16.04 + +Let’s get started ! the minimum system RAM to run Discourse is 1 GB and the officially supported installation process for Discourse requires dockers to be installed on our Linux system. Besides dockers, it also requires Git. We can fulfill these two requirements by simply running the following command on our system’s terminal. + +``` +wget -qO- https://get.docker.com/ | sh +``` + +![](http://linuxpitstop.com/wp-content/uploads/2016/06/124.png) + +It shouldn’t take longer to complete the installation for Docker and Git, as soon its installation process is complete, create a directory for Discourse inside /var partition of your system (You can choose any other partition here too). + +``` +mkdir /var/discourse +``` + +Now clone the Discourse’s Github repository to this newly created directory. + +``` +git clone https://github.com/discourse/discourse_docker.git /var/discourse +``` + +Go into the cloned directory. + +``` +cd /var/discourse +``` + +![](http://linuxpitstop.com/wp-content/uploads/2016/06/314.png) + +You should be able to locate “discourse-setup” script file here, simply run this script to initiate the installation wizard for Discourse. + +``` +./discourse-setup +``` + +**Side note: Please make sure you have a ready email server setup before attempting install for discourse.** + +Installation wizard will ask you following six questions. + +``` +Hostname for your Discourse? +Email address for admin account? +SMTP server address? +SMTP user name? +SMTP port [587]: +SMTP password? []: +``` + +![](http://linuxpitstop.com/wp-content/uploads/2016/06/411.png) + +Once you supply these information, it will ask for the confirmation, if everything is fine, hit “Enter” and installation process will take off. + +![](http://linuxpitstop.com/wp-content/uploads/2016/06/511.png) + +Sit back and relax! it will take sweet amount of time to complete the installation, grab a cup of coffee, and keep an eye for any error messages. + +![](http://linuxpitstop.com/wp-content/uploads/2016/06/610.png) + +Here is how the successful completion of the installation process should look alike. + +![](http://linuxpitstop.com/wp-content/uploads/2016/06/710.png) + +Now launch your web browser, if the hostname for discourse installation resolves properly to IP, then you can use your hostname in browser , otherwise use your IP address to launch the Discourse page. Here is what you should see: + +![](http://linuxpitstop.com/wp-content/uploads/2016/06/85.png) + +That’s it, create new account by using “Sign Up” option and you should be good to go with your Discourse setup. + +![](http://linuxpitstop.com/wp-content/uploads/2016/06/106.png) + +### Conclusion + +It is an easy to setup application and works flawlessly. It is equipped with all required features of modern day discussion board. It is available under General Public License and is 100% open source product. The simplicity, easy of use, powerful and long feature list are the most important feathers of this tool. Hope you enjoyed this article, Question? do let us know in comments please. + +-------------------------------------------------------------------------------- + +via: http://linuxpitstop.com/install-discourse-on-ubuntu-linux-16-04/ + +作者:[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/ + + + + + + + + From ee03325846bfd9d1d543a167bbbd8e51746931a2 Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 18 Jul 2016 10:09:07 +0800 Subject: [PATCH 1186/1469] =?UTF-8?q?20160718-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...20160627 Linux Practicality vs Activism.md | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 sources/tech/20160627 Linux Practicality vs Activism.md diff --git a/sources/tech/20160627 Linux Practicality vs Activism.md b/sources/tech/20160627 Linux Practicality vs Activism.md new file mode 100644 index 0000000000..fc4f5eff26 --- /dev/null +++ b/sources/tech/20160627 Linux Practicality vs Activism.md @@ -0,0 +1,72 @@ +Linux Practicality vs Activism +================================== + +>Is Linux actually more practical than other OSes, or is there some higher minded reason to use it? + +One of the greatest things about running Linux is the freedom it provides. Where the division among the Linux community appears is in how we value this freedom. + +For some, the freedom enjoyed by using Linux is the freedom from vendor lock-in or high software costs. Most would call this a practical consideration. Others users would tell you the freedom they enjoy is software freedom. This means embracing Linux distributions that support the [Free Software Movement][1], avoiding proprietary software completely and all things related. + +In this article, I'll walk you through some of the differences between these two freedoms and how they affect Linux usage. + +### The problem with proprietary + +One thing most Linux users have in common is their preference for avoiding proprietary software. For practical enthusiasts like myself, it's a matter of how I spend my money, the ability to control my software and avoiding vendor lock-in. Granted, I'm not a coder...so my tweaks to my installed software are pretty mild. But there are instances where a minor tweak to an application can mean the difference between it working and it not working. + +Then there are Linux enthusiasts who opt to avoid proprietary software because they feel it's unethical to use it. Usually the main concern here is that using proprietary software takes away or simply obstructs your personal freedom. Users in this corner prefer to use Linux distributions and software that support the [Free Software philosophy][2]. While it's similar to and often directly confused with Open Source concepts, [there are differences][3]. + +So here's the issue: Users such as myself tend to put convenience over the ideals of pure software freedom. Don't get me wrong, folks like me prefer to use software that meets the ideals behind Free Software, but we also are more likely to make concessions in order to accomplish specific tasks. + +Both types of Linux enthusiasts prefer using non-proprietary solutions. But Free Software advocates won't use proprietary at all, where as the practical user will rely on the best tool with the best performance. This means there are instances where the practical user is willing to run a proprietary application or code on their non-proprietary operating system. + +In the end, both user types enjoy using what Linux has to offer. But our reasons for doing so tend to vary. Some have argued that this is a matter of ignorance with those who don't support Free Software. I disagree and believe it's a matter of practical convenience. Users who prefer practical convenience simply aren't concerned about the politics of their software. + +### Practical Convenience + +When you ask most people why they use the operating system they use, it's usually tied in with practical convenience. Examples of this convenience might include "it's what I've always used" down to "it runs the software I need." Other folks might take this a step further and explain it's not so much the software that drives their OS preference, as the familiarity of the OS in question. And finally, there are specialty "niche tasks" or hardware compatibility issues that also provide good reasons for using one OS over another. + +This might surprise many of you, but the single biggest reason I run desktop Linux today is due to familiarity. Even though I provide support for Windows and OS X for others, it's actually quite frustrating to use these operating systems as they're simply not what my muscle memory is used to. I like to believe this allows me to empathize with Linux newcomers, as I too know how off-putting it can be to step into the realm of the unfamiliar. My point here is this – familiarity has value. And familiarity also powers practical convenience as well. + +Now if we compare this to the needs of a Free Software advocate, you'll find those folks are willing to learn something new and perhaps even more challenging if it translates into them avoiding using non-free software. It's actually something I've always admired about this type of user. Their willingness to take the path less followed to stick to their principles is, in my opinion, admirable. + +### The price of freedom + +One area I don't envy is the extra work involved in making sure a Free Software advocate is always using Linux distros and hardware that respect their digital freedom according to the standards set forth by the [Free Software Foundation][4]. This means the Linux kernel needs to be free from proprietary blobs for driver support and the hardware in question doesn't require any proprietary code whatsoever. Certainly not impossible, but it's pretty close. + +The absolute best scenario a Free Software advocate can shoot for is hardware that is "freedom-compatible." There are vendors out there that can meet this need, however most of them are offering hardware that relies on Linux compatible proprietary firmware. Great for the practical user, a show-stopper for the Free Software advocate. + +What all of this translates into is that the advocate must be far more vigilant than the practical Linux enthusiast. This isn't necessarily a negative thing per se, however it's a consideration if one is planning on jumping onto the Free Software approach to computing. Practical users, by contrast, can use any software or hardware that happens to be Linux compatible without a second thought. I don't know about you, but in my eyes this seems a bit easier to me. + +### Defining software freedom + +This part is going to get some folks upset as I personally don't subscribe to the belief that there's only one flavor of software freedom. From where I stand, I think true freedom is being able to soak in all the available data on a given issue and then come to terms with the approach that best suits that person's lifestyle. + +So for me, I prefer using Linux distributions that provide me with the desktop that meets all of my needs. This includes the use of non-proprietary software and proprietary software. Even though it's fair to suggest that the proprietary software restricts my personal freedom, I must counter this by pointing out that I had the freedom to use it in the first place. One might even call this freedom of choice. + +Perhaps this too, is why I find myself identifying more with the ideals of Open Source Software instead of sticking with the ideals behind the Free Software movement. I prefer to stand with the group that doesn't spend their time telling me how I'm wrong for using what works best for me. It's been my experience that the Open Source crowd is merely interested in sharing the merits of software freedom without the passion for Free Software idealism. + +I think the concept of Free Software is great. And to those who need to be active in software politics and point out the flaws of using proprietary software to folks, then I think Linux ([GNU/Linux][5]) activism is a good fit. Where practical users such as myself tend to change course from Free Software Linux advocates is in our presentation. + +When I present Linux on the desktop, I share my passion for its practical merits. And if I'm successful and they enjoy the experience, I allow the user to discover the Free Software perspective on their own. I've found most people use Linux on their computers not because they want to embrace software freedom, rather because they simply want the best user experience possible. Perhaps I'm alone in this, it's hard to say. + +What say you? Are you a Free Software Advocate? Perhaps you're a fan of using proprietary software/code on your desktop Linux distribution? Hit the Comments and share your Linux desktop experiences. + + +-------------------------------------------------------------------------------- + +via: http://www.datamation.com/open-source/linux-practicality-vs-activism.html + +作者:[Matt Hartley][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.datamation.com/author/Matt-Hartley-3080.html +[1]: https://en.wikipedia.org/wiki/Free_software_movement +[2]: https://www.gnu.org/philosophy/free-sw.en.html +[3]: https://www.gnu.org/philosophy/free-software-for-freedom.en.html +[4]: https://en.wikipedia.org/wiki/Free_Software_Foundation +[5]: https://en.wikipedia.org/wiki/GNU/Linux_naming_controversy + + From 5c03cc4530bfb2a63a368850bcfa4d8143c15f42 Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 18 Jul 2016 10:10:33 +0800 Subject: [PATCH 1187/1469] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20160711 Getting Started with Git.md | 134 ------------------ 1 file changed, 134 deletions(-) delete mode 100644 sources/tech/20160711 Getting Started with Git.md diff --git a/sources/tech/20160711 Getting Started with Git.md b/sources/tech/20160711 Getting Started with Git.md deleted file mode 100644 index cf67119f28..0000000000 --- a/sources/tech/20160711 Getting Started with Git.md +++ /dev/null @@ -1,134 +0,0 @@ -Getting started with Git -====================== - - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/get_started_lead.jpeg?itok=r22AKc6P) - -In the introduction to this series we learned who should use Git, and what it is for. Today we will learn how to clone public Git repositories, and how to extract individual files without cloning the whole works. - -Since Git is so popular, it makes life a lot easier if you're at least familiar with it at a basic level. If you can grasp the basics (and you can, I promise!), then you'll be able to download whatever you need, and maybe even contribute stuff back. And that, after all, is what open source is all about: having access to the code that makes up the software you run, the freedom to share it with others, and the right to change it as you please. Git makes this whole process easy, as long as you're comfortable with Git. - -So let's get comfortable with Git. - -### Read and write - -Broadly speaking, there are two ways to interact with a Git repository: you can read from it, or you can write to it. It's just like a file: sometimes you open a document just to read it, and other times you open a document because you need to make changes. - -In this article, we'll cover reading from a Git repository. We'll tackle the subject of writing back to a Git repository in a later article. - -### Git or GitHub? - -A word of clarification: Git is not the same as GitHub (or GitLab, or Bitbucket). Git is a command-line program, so it looks like this: - -``` -$ git -usage: Git [--version] [--help] [-C ] - [-p | --paginate | --no-pager] [--bare] - [--Git-dir=] [] -``` - -As Git is open source, lots of smart people have built infrastructures around it which, in themselves, have become very popular. - -My articles about Git teach pure Git first, because if you understand what Git is doing then you can maintain an indifference to what front end you are using. However, my articles also include common ways of accomplishing each task through popular Git services, since that's probably what you'll encounter first. - -### Installing Git - -To install Git on Linux, grab it from your distribution's software repository. BSD users should find Git in the Ports tree, in the devel section. - -For non-open source operating systems, go to the project site and follow the instructions. Once installed, there should be no difference between Linux, BSD, and Mac OS X commands. Windows users will have to adapt Git commands to match the Windows file system, or install Cygwin to run Git natively, without getting tripped up by Windows file system conventions. - -### Afternoon tea with Git - -Not every one of us needs to adopt Git into our daily lives right away. Sometimes, the most interaction you have with Git is to visit a repository of code, download a file or two, and then leave. On the spectrum of getting to know Git, this is more like afternoon tea than a proper dinner party. You make some polite conversation, you get the information you need, and then you part ways without the intention of speaking again for at least another three months. - -And that's OK. - -Generally speaking, there are two ways to access Git: via command line, or by any one of the fancy Internet technologies providing quick and easy access through the web browser. - -Say you want to install a trash bin for use in your terminal because you've been burned one too many times by the rm command. You've heard about Trashy, which calls itself "a sane intermediary to the rm command", and you want to look over its documentation before you install it. Lucky for you, [Trashy is hosted publicly on GitLab.com][1]. - -### Landgrab - -The first way we'll work with this Git repository is a sort of landgrab method: we'll clone the entire thing, and then sort through the contents later. Since the repository is hosted with a public Git service, there are two ways to do this: on the command line, or through a web interface. - -To grab an entire repository with Git, use the git clone command with the URL of the Git repository. If you're not clear on what the right URL is, the repository should tell you. GitLab gives you a copy-and-paste repository URL [for Trashy][2]. - -![](https://opensource.com/sites/default/files/1_gitlab-url.jpg) - -You might notice that on some services, both SSH and HTTPS links are provided. You can use SSH only if you have write permissions to the repository. Otherwise, you must use the HTTPS URL. - -Once you have the right URL, cloning the repository is pretty simple. Just git clone the URL, and optionally name the directory to clone it into. The default behaviour is to clone the git directory to your current directory; for example, 'trashy.git' gets put in your current location as 'trashy'. I use the .clone extension as a shorthand for repositories that are read-only, and the .git extension as shorthand for repositories I can read and write, but that's not by any means an official mandate. - -``` -$ git clone https://gitlab.com/trashy/trashy.git trashy.clone -Cloning into 'trashy.clone'... -remote: Counting objects: 142, done. -remote: Compressing objects: 100% (91/91), done. -remote: Total 142 (delta 70), reused 103 (delta 47) -Receiving objects: 100% (142/142), 25.99 KiB | 0 bytes/s, done. -Resolving deltas: 100% (70/70), done. -Checking connectivity... done. -``` - -Once the repository has been cloned successfully, you can browse files in it just as you would any other directory on your computer. - -The other way to get a copy of the repository is through the web interface. Both GitLab and GitHub provide a snapshot of any repository in a .zip file. GitHub has a big green download button, but on GitLab, look for an inconspicuous download button on the far right of your browser window: - -![](https://opensource.com/sites/default/files/1_gitlab-zip.jpg) - -### Pick and choose - -An alternate method of obtaining a file from a Git repository is to find the file you're after and pluck it right out of the repository. This method is only supported via web interfaces, which is essentially you looking at someone else's clone of a repository; you can think of it as a sort of HTTP shared directory. - -The problem with using this method is that you might find that certain files don't actually exist in a raw Git repository, as a file might only exist in its complete form after a make command builds the file, which won't happen until you download the repository, read the README or INSTALL file, and run the command. Assuming, however, that you are sure a file does exist and you just want to go into the repository, grab it, and walk away, you can do that. - -In GitLab and GitHub, click the Files link for a file view, view the file in Raw mode, and use your web browser's save function, e.g. in Firefox, File > Save Page As. In a GitWeb repository (a web view of personal git repositories used some who prefer to host git themselves), the Raw view link is in the file listing view. - -![](https://opensource.com/sites/default/files/1_webgit-file.jpg) - -### Best practices - -Generally, cloning an entire Git repository is considered the right way of interacting with Git. There are a few reasons for this. Firstly, a clone is easy to keep updated with the git pull command, so you won't have to keep going back to some web site for a new copy of a file each time an improvement has been made. Secondly, should you happen to make an improvement yourself, then it is easier to submit those changes to the original author if it is all nice and tidy in a Git repository. - -For now, it's probably enough to just practice going out and finding interesting Git repositories and cloning them to your drive. As long as you know the basics of using a terminal, then it's not hard to do. Don't know the basics of terminal usage? Give me five more minutes of your time. - -### Terminal basics - -The first thing to understand is that all files have a path. That makes sense; if I told you to open a file for me on a regular non-terminal day, you'd have to get to where that file is on your drive, and you'd do that by navigating a bunch of computer windows until you reached that file. For example, maybe you'd click your home directory > Pictures > InktoberSketches > monkey.kra. - -In that scenario, we could say that the file monkeysketch.kra has the path $HOME/Pictures/InktoberSketches/monkey.kra. - -In the terminal, unless you're doing special sysadmin work, your file paths are generally going to start with $HOME (or, if you're lazy, just the ~ character) followed by a list of folders up to the filename itself. This is analogous to whatever icons you click in your GUI to reach the file or folder. - -If you want to clone a Git repository into your Documents directory, then you could open a terminal and run this command: - -``` -$ git clone https://gitlab.com/foo/bar.git $HOME/Documents/bar.clone -``` - -Once that is complete, you can open a file manager window, navigate to your Documents folder, and you'll find the bar.clone directory waiting for you. - -If you want to get a little more advanced, you might revisit that repository at some later date, and try a git pull to see if there have been updates to the project: - -``` -$ cd $HOME/Documents/bar.clone -$ pwd -bar.clone -$ git pull -``` - -For now, that's all the terminal commands you need to get started, so go out and explore. The more you do it, the better you get at it, and that is, at least give or take a vowel, the name of the game. - --------------------------------------------------------------------------------- - -via: https://opensource.com/life/16/7/stumbling-git - -作者:[Seth Kenlon][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[1]: https://gitlab.com/trashy/trashy -[2]: https://gitlab.com/trashy/trashy.git From c718bcbd5f2531e5fa6f320639e56941233e9ce3 Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 18 Jul 2016 10:11:41 +0800 Subject: [PATCH 1188/1469] =?UTF-8?q?20160718-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/{tech => talk}/20160627 Linux Practicality vs Activism.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20160627 Linux Practicality vs Activism.md (100%) diff --git a/sources/tech/20160627 Linux Practicality vs Activism.md b/sources/talk/20160627 Linux Practicality vs Activism.md similarity index 100% rename from sources/tech/20160627 Linux Practicality vs Activism.md rename to sources/talk/20160627 Linux Practicality vs Activism.md From df964529448c4014fcace29cf948f8232ad1ce83 Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 18 Jul 2016 10:20:19 +0800 Subject: [PATCH 1189/1469] =?UTF-8?q?20160718-4=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20160706 What is Git.md | 122 +++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 sources/tech/20160706 What is Git.md diff --git a/sources/tech/20160706 What is Git.md b/sources/tech/20160706 What is Git.md new file mode 100644 index 0000000000..5726bce405 --- /dev/null +++ b/sources/tech/20160706 What is Git.md @@ -0,0 +1,122 @@ +What is Git +=========== + +Welcome to my series on learning how to use the Git version control system! In this introduction to the series, you will learn what Git is for and who should use it. + +If you're just starting out in the open source world, you're likely to come across a software project that keeps its code in, and possibly releases it for use, by way of Git. In fact, whether you know it or not, you're certainly using software right now that is developed using Git: the Linux kernel (which drives the website you're on right now, if not the desktop or mobile phone you're accessing it on), Firefox, Chrome, and many more projects share their codebase with the world in a Git repository. + +On the other hand, all the excitement and hype over Git tends to make things a little muddy. Can you only use Git to share your code with others, or can you use Git in the privacy of your own home or business? Do you have to have a GitHub account to use Git? Why use Git at all? What are the benefits of Git? Is Git the only option? + +So forget what you know or what you think you know about Git, and let's take it from the beginning. + +### What is version control? + +Git is, first and foremost, a version control system (VCS). There are many version control systems out there: CVS, SVN, Mercurial, Fossil, and, of course, Git. + +Git serves as the foundation for many services, like GitHub and GitLab, but you can use Git without using any other service. This means that you can use Git privately or publicly. + +If you have ever collaborated on anything digital with anyone, then you know how it goes. It starts out simple: you have your version, and you send it to your partner. They make some changes, so now there are two versions, and send the suggestions back to you. You integrate their changes into your version, and now there is one version again. + +Then it gets worse: while you change your version further, your partner makes more changes to their version. Now you have three versions; the merged copy that you both worked on, the version you changed, and the version your partner has changed. + +As Jason van Gumster points out in his article, 【Even artists need version control][1], this syndrome tends to happen in individual settings as well. In both art and science, it's not uncommon to develop a trial version of something; a version of your project that might make it a lot better, or that might fail miserably. So you create file names like project_justTesting.kdenlive and project_betterVersion.kdenlive, and then project_best_FINAL.kdenlive, but with the inevitable allowance for project_FINAL-alternateVersion.kdenlive, and so on. + +Whether it's a change to a for loop or an editing change, it happens to the best of us. That is where a good version control system makes life easier. + +### Git snapshots + +Git takes snapshots of a project, and stores those snapshots as unique versions. + +If you go off in a direction with your project that you decide was the wrong direction, you can just roll back to the last good version and continue along an alternate path. + +If you're collaborating, then when someone sends you changes, you can merge those changes into your working branch, and then your collaborator can grab the merged version of the project and continue working from the new current version. + +Git isn't magic, so conflicts do occur ("You changed the last line of the book, but I deleted that line entirely; how do we resolve that?"), but on the whole, Git enables you to manage the many potential variants of a single work, retaining the history of all the changes, and even allows for parallel versions. + +### Git distributes + +Working on a project on separate machines is complex, because you want to have the latest version of a project while you work, makes your own changes, and share your changes with your collaborators. The default method of doing this tends to be clunky online file sharing services, or old school email attachments, both of which are inefficient and error-prone. + +Git is designed for distributed development. If you're involved with a project you can clone the project's Git repository, and then work on it as if it was the only copy in existence. Then, with a few simple commands, you can pull in any changes from other contributors, and you can also push your changes over to someone else. Now there is no confusion about who has what version of a project, or whose changes exist where. It is all locally developed, and pushed and pulled toward a common target (or not, depending on how the project chooses to develop). + +### Git interfaces + +In its natural state, Git is an application that runs in the Linux terminal. However, as it is well-designed and open source, developers all over the world have designed other ways to access it. + +It is free, available to anyone for $0, and comes in packages on Linux, BSD, Illumos, and other Unix-like operating systems. It looks like this: + +``` +$ git --version +git version 2.5.3 +``` + +Probably the most well-known Git interfaces are web-based: sites like GitHub, the open source GitLab, Savannah, BitBucket, and SourceForge all offer online code hosting to maximise the public and social aspect of open source along with, in varying degrees, browser-based GUIs to minimise the learning curve of using Git. This is what the GitLab interface looks like: + +![](https://opensource.com/sites/default/files/0_gitlab.png) + +Additionally, it is possible that a Git service or independent developer may even have a custom Git frontend that is not HTML-based, which is particularly handy if you don't live with a browser eternally open. The most transparent integration comes in the form of file manager support. The KDE file manager, Dolphin, can show the Git status of a directory, and even generate commits, pushes, and pulls. + +![](https://opensource.com/sites/default/files/0_dolphin.jpg) + +[Sparkleshare][2] uses Git as a foundation for its own Dropbox-style file sharing interface. + +![](https://opensource.com/sites/default/files/0_sparkleshare_1.jpg) + +For more, see the (long) page on the official [Git wiki][3] listing projects with graphical interfaces to Git. + +### Who should use Git? + +You should! The real question is when? And what for? + +### When should I use Git, and what should I use it for? + +To get the most out of Git, you need to think a little bit more than usual about file formats. + +Git is designed to manage source code, which in most languages consists of lines of text. Of course, Git doesn't know if you're feeding it source code or the next Great American Novel, so as long as it breaks down to text, Git is a great option for managing and tracking versions. + +But what is text? If you write something in an office application like Libre Office, then you're probably not generating raw text. There is usually a wrapper around complex applications like that which encapsulate the raw text in XML markup and then in a zip container, as a way to ensure that all of the assets for your office file are available when you send that file to someone else. Strangely, though, something that you might expect to be very complex, like the save files for a [Kdenlive][4] project, or an SVG from [Inkscape][5], are actually raw XML files that can easily be managed by Git. + +If you use Unix, you can check to see what a file is made of with the file command: + +``` +$ file ~/path/to/my-file.blah +my-file.blah: ASCII text +$ file ~/path/to/different-file.kra: Zip data (MIME type "application/x-krita") +``` + +If unsure, you can view the contents of a file with the head command: + +``` +$ head ~/path/to/my-file.blah +``` + +If you see text that is mostly readable by you, then it is probably a file made of text. If you see garbage with some familiar text characters here and there, it is probably not made of text. + +Make no mistake: Git can manage other formats of files, but it treats them as blobs. The difference is that in a text file, two Git snapshots (or commits, as we call them) might be, say, three lines different from each other. If you have a photo that has been altered between two different commits, how can Git express that change? It can't, really, because photographs are not made of any kind of sensible text that can just be inserted or removed. I wish photo editing were as easy as just changing some text from "ugly greenish-blue" to "blue-with-fluffy-clouds" but it truly is not. + +People check in blobs, like PNG icons or a speadsheet or a flowchart, to Git all the time, so if you're working in Git then don't be afraid to do that. Know that it's not sensible to do that with huge files, though. If you are working on a project that does generate both text files and large blobs (a common scenario with video games, which have equal parts source code to graphical and audio assets), then you can do one of two things: either invent your own solution, such as pointers to a shared network drive, or use a Git add-on like Joey Hess's excellent [git annex][6], or the [Git-Media][7] project. + +So you see, Git really is for everyone. It is a great way to manage versions of your files, it is a powerful tool, and it is not as scary as it first seems. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/resources/what-is-git + +作者:[Seth Kenlon ][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[1]: https://opensource.com/life/16/2/version-control-isnt-just-programmers +[2]: http://sparkleshare.org/ +[3]: https://git.wiki.kernel.org/index.php/InterfacesFrontendsAndTools#Graphical_Interfaces +[4]: https://opensource.com/life/11/11/introduction-kdenlive +[5]: http://inkscape.org/ +[6]: https://git-annex.branchable.com/ +[7]: https://github.com/alebedev/git-media + + + + From 905d6d43298bf7e2392a5a9c80f743ec426a58e5 Mon Sep 17 00:00:00 2001 From: cvsher <478990879@qq.com> Date: Mon, 18 Jul 2016 10:28:16 +0800 Subject: [PATCH 1190/1469] Update 20160706 What is Git.md translating --- sources/tech/20160706 What is Git.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160706 What is Git.md b/sources/tech/20160706 What is Git.md index 5726bce405..f98de42fd3 100644 --- a/sources/tech/20160706 What is Git.md +++ b/sources/tech/20160706 What is Git.md @@ -1,3 +1,4 @@ +translating by cvsher What is Git =========== From 9e291a8b126bb76d8a19712c1afe7ee8c6f1c3bb Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 18 Jul 2016 11:42:51 +0800 Subject: [PATCH 1191/1469] PUB:20160624 IT runs on the cloud and the cloud runs on Linux. Any questions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @chenxinlong 翻译的不错。IT 我考虑还是不翻译,这样含义广泛些。 --- ... the cloud runs on Linux. Any questions.md | 63 +++++++++++++++++++ ... the cloud runs on Linux. Any questions.md | 62 ------------------ 2 files changed, 63 insertions(+), 62 deletions(-) create mode 100644 published/20160624 IT runs on the cloud and the cloud runs on Linux. Any questions.md delete mode 100644 translated/talk/20160624 IT runs on the cloud and the cloud runs on Linux. Any questions.md diff --git a/published/20160624 IT runs on the cloud and the cloud runs on Linux. Any questions.md b/published/20160624 IT runs on the cloud and the cloud runs on Linux. Any questions.md new file mode 100644 index 0000000000..17af8d85d9 --- /dev/null +++ b/published/20160624 IT runs on the cloud and the cloud runs on Linux. Any questions.md @@ -0,0 +1,63 @@ +IT 运行在云端,而云运行在 Linux 上。你怎么看? +=================================================================== + +> IT 正在逐渐迁移到云端。那又是什么驱动了云呢?答案是 Linux。 当连微软的 Azure 都开始拥抱 Linux 时,你就应该知道这一切都已经改变了。 + +![](http://zdnet1.cbsistatic.com/hub/i/r/2016/06/24/7d2b00eb-783d-4202-bda2-ca65d45c460a/resize/770xauto/732db8df725ede1cc38972788de71a0b/linux-owns-cloud.jpg) + +*图片: ZDNet* + +不管你接不接受, 云正在接管 IT 已经成为现实。 我们这几年见证了 [ 云在内部 IT 的崛起 ][1] 。 那又是什么驱动了云呢? 答案是 Linux 。 + +[Uptime Institute][2] 最近对 1000 个 IT 决策者进行了调查,发现约 50% 左右的资深企业 IT 决策者认为在将来[大部分的 IT 工作应该放在云上 ][3] 或托管网站上。在这个调查中,23% 的人认为这种改变即将发生在明年,有 70% 的人则认为这种情况会在四年内出现。 + +这一点都不奇怪。 我们中的许多人仍热衷于我们的物理服务器和机架, 但一般运营一个自己的数据中心并不会产生任何的经济效益。 + +很简单, 只需要对比你[运行在你自己的硬件上的资本费用(CAPEX)和使用云的业务费用(OPEX)][4]即可。 但这并不是说你应该把所有的东西都一股脑外包出去,而是说在大多数情况下你应该把许多工作都迁移到云端。 + +相应地,如果你想充分地利用云,你就得了解 Linux 。 + +[亚马逊的 AWS][5]、 [Apache CloudStack][6]、 [Rackspace][7]、[谷歌的 GCP][8] 以及 [ OpenStack ][9] 的核心都是运行在 Linux 上的。那么结果如何?截至到 2014 年, [在 Linux 服务器上部署的应用达到所有企业的 79% ][10],而 在 Windows 服务器上部署的则跌到 36%。从那时起, Linux 就获得了更多的发展动力。 + +即便是微软自身也明白这一点。 + +Azure 的技术主管 Mark Russinovich 曾说,仅仅在过去的几年内微软就从[四分之一的 Azure 虚拟机运行在 Linux 上][11] 变为[将近三分之一的 Azure 虚拟机运行在 Linux 上][12]。 + +试想一下。微软,一家正逐渐将[云变为自身财政收入的主要来源][13] 的公司,其三分之一的云产业依靠于 Linux 。 + +即使是到目前为止, 这些不论喜欢或者不喜欢微软的人都很难想象得到[微软会从一家以商业软件为基础的软件公司转变为一家开源的、基于云服务的企业][14] 。 + +Linux 对于这些专用服务器机房的渗透甚至比它刚开始的时候更深了。 举个例子, [Docker 最近发行了其在 Windows 10 和 Mac OS X 上的公测版本 ][15] 。 这难道是意味着 [Docker][16] 将会把其同名的容器服务移植到 Windows 10 和 Mac 上吗? 并不是的。 + +在这两个平台上, Docker 只是运行在一个 Linux 虚拟机内部。 在 Mac OS 上是 HyperKit ,在 Windows 上则是 Hyper-V 。 在图形界面上可能看起来就像另一个 Mac 或 Windows 上的应用, 但在其内部的容器仍然是运行在 Linux 上的。 + +所以,就像大量的安卓手机和 Chromebook 的用户压根就不知道他们所运行的是 Linux 系统一样。这些 IT 用户也会随之悄然地迁移到 Linux 和云上。 + +-------------------------------------------------------------------------------- + +via: http://www.zdnet.com/article/it-runs-on-the-cloud-and-the-cloud-runs-on-linux-any-questions/ + +作者:[Steven J. Vaughan-Nichols][a] +译者:[chenxinlong](https://github.com/chenxinlong) +校对:[wxy](https://github.com/wxy) + +本文由 [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://www.zdnet.com/article/2014-the-year-the-cloud-killed-the-datacenter/ +[2]: https://uptimeinstitute.com/ +[3]: http://www.zdnet.com/article/move-to-cloud-accelerating-faster-than-thought-survey-finds/ +[4]: http://www.zdnet.com/article/rethinking-capex-and-opex-in-a-cloud-centric-world/ +[5]: https://aws.amazon.com/ +[6]: https://cloudstack.apache.org/ +[7]: https://www.rackspace.com/en-us +[8]: https://cloud.google.com/ +[9]: http://www.openstack.org/ +[10]: http://www.zdnet.com/article/linux-foundation-finds-enterprise-linux-growing-at-windows-expense/ +[11]: http://news.microsoft.com/bythenumbers/azure-virtual +[12]: http://www.zdnet.com/article/microsoft-nearly-one-in-three-azure-virtual-machines-now-are-running-linux/ +[13]: http://www.zdnet.com/article/microsofts-q3-azure-commercial-cloud-strong-but-earnings-revenue-light/ +[14]: http://www.zdnet.com/article/why-microsoft-is-turning-into-an-open-source-company/ +[15]: http://www.zdnet.com/article/new-docker-betas-for-azure-windows-10-now-available/ +[16]: http://www.docker.com/ + diff --git a/translated/talk/20160624 IT runs on the cloud and the cloud runs on Linux. Any questions.md b/translated/talk/20160624 IT runs on the cloud and the cloud runs on Linux. Any questions.md deleted file mode 100644 index 804eb7db67..0000000000 --- a/translated/talk/20160624 IT runs on the cloud and the cloud runs on Linux. Any questions.md +++ /dev/null @@ -1,62 +0,0 @@ -信息技术运行在云端,而云运行在 Linux 上。有什么问题吗? -=================================================================== - ->信息技术正在逐渐被迁移到云端. 那又是什么驱动了云呢?答案是 Linux。 当连微软的 Azure 都开始拥抱 Linux 时,你就应该知道这一切都已经改变了。 - -![](http://zdnet1.cbsistatic.com/hub/i/r/2016/06/24/7d2b00eb-783d-4202-bda2-ca65d45c460a/resize/770xauto/732db8df725ede1cc38972788de71a0b/linux-owns-cloud.jpg) ->图片: ZDNet - -不管你接不接受, 云正在接管信息技术都已成现实。 我们这几年见证了 [ 云在信息技术产业内部的崛起 ][1] 。 那又是什么驱动了云呢? 答案是 Linux 。 - -[Uptime Institute][2] 最近对 1000 个 IT 执行部门进行调查并发现了约 50% 左右的高级企业的 IT 执行部门认为在将来 [ 大部分的 IT 工作内容应存储备份在云上 ][3] 或托管网站上。在这个调查中,23% 的人认为这种改变即将发生在明年,有 70% 的人则认为这种情况会在四年内出现。 - -这一点都不奇怪。 我们中的许多人仍热衷于我们的物理服务器和机架, 但一般运营一个自己的数据中心并不会产生任何的经济效益。 - -这真的非常简单。 只需要对比你 [ 运行在硬件上的个人资本费用 (CAPEX) 和使用云的操作费用 (OPEX)][4]。 但这并不是说你会想把所有的一切都外置,而是说在大部分时间内你会想把你的一些工作内容迁移到云端。 - -相应地,如果你想充分地利用云,你就得了解 Linux 。 - -[ 亚马逊 web 服务 ][5], [ Apache 的 CloudStack][6], [Rackspace][7], [ 谷歌云平台 ][8] 以及 [ OpenStack ][9] 的核心都是运行在 Linux 上的。那么结果如何?截至到 2014 年, [ 在 Linux 服务器上部署的应用达到所有企业的 79% ][10],而 Windows 服务器上部署的应用则跌到 36%。从那时起, Linux 就获得了更多的发展动力。 - -即便是微软自身也明白这一点。 - -Azure 的技术主管 Mark Russinovich 曾说,仅仅在过去的几年内微软就从 [ 四分之一的 Azure 虚拟机运行在 Linux 上 ][11] 变为 [ 将近三分之一的 Azure 虚拟机运行在 Linux 上][12]. - -试想一下。 微软, 一家正逐渐将 [ 云变为自身财政收入的主要来源 ][13] 的公司,其三分之一的云产业依靠于 Linux 。 - -即使是到目前为止, 这些不论喜欢或者不喜欢微软的人都很难想象得到 [ 微软会从一家以专利保护为基础的软件公司转变为一家开源,基于云服务的企业][14] 。 - -Linux 对于这些专用服务器机房的渗透甚至比它刚开始的时候更深了。 举个例子, [ Docker 最近发行了其在 Windows 10 和 Mac OS X 上的公测版本 ][15] 。 所以难道这意味着 [Docker][16] 将会把其同名的容器服务移植到 Windows 10 和 Mac 上吗? 并不是的。 - -在这两个平台上, Docker 只是运行在一个 Linux 虚拟机内部。 在 Mac OS 上是 HyperKit ,在 Windows 上则是 Hyper-V 。 你的图形界面可能看起来就像另一个 Mac 或 Windows 上的应用, 但在其内部核心的容器仍然是运行在 Linux 上的。 - -所以,就像大量的安卓手机和 Chromebook 的用户压根就不知道他们所运行的是 Linux 系统一样。这些信息技术的用户也会随之悄然地迁移到 Linux 和云上。 - --------------------------------------------------------------------------------- - -via: http://www.zdnet.com/article/it-runs-on-the-cloud-and-the-cloud-runs-on-linux-any-questions/#ftag=RSSbaffb68 - -作者:[Steven J. Vaughan-Nichols][a] -译者:[chenxinlong](https://github.com/chenxinlong) -校对:[校对者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://www.zdnet.com/article/2014-the-year-the-cloud-killed-the-datacenter/ -[2]: https://uptimeinstitute.com/ -[3]: http://www.zdnet.com/article/move-to-cloud-accelerating-faster-than-thought-survey-finds/ -[4]: http://www.zdnet.com/article/rethinking-capex-and-opex-in-a-cloud-centric-world/ -[5]: https://aws.amazon.com/ -[6]: https://cloudstack.apache.org/ -[7]: https://www.rackspace.com/en-us -[8]: https://cloud.google.com/ -[9]: http://www.openstack.org/ -[10]: http://www.zdnet.com/article/linux-foundation-finds-enterprise-linux-growing-at-windows-expense/ -[11]: http://news.microsoft.com/bythenumbers/azure-virtual -[12]: http://www.zdnet.com/article/microsoft-nearly-one-in-three-azure-virtual-machines-now-are-running-linux/ -[13]: http://www.zdnet.com/article/microsofts-q3-azure-commercial-cloud-strong-but-earnings-revenue-light/ -[14]: http://www.zdnet.com/article/why-microsoft-is-turning-into-an-open-source-company/ -[15]: http://www.zdnet.com/article/new-docker-betas-for-azure-windows-10-now-available/ -[16]: http://www.docker.com/ - From 0bd5d26d9170e27beafa287241ed6374476f3932 Mon Sep 17 00:00:00 2001 From: cvsher <478990879@qq.com> Date: Mon, 18 Jul 2016 12:40:03 +0800 Subject: [PATCH 1192/1469] Update 20160706 What is Git.md (#4191) translating --- sources/tech/20160706 What is Git.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160706 What is Git.md b/sources/tech/20160706 What is Git.md index 5726bce405..f98de42fd3 100644 --- a/sources/tech/20160706 What is Git.md +++ b/sources/tech/20160706 What is Git.md @@ -1,3 +1,4 @@ +translating by cvsher What is Git =========== From 18750b90b113ef40f79dec66ab352b9cb427dcc6 Mon Sep 17 00:00:00 2001 From: Johnny Liao Date: Mon, 18 Jul 2016 16:42:13 +0800 Subject: [PATCH 1193/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= =?UTF-8?q?=20(#4192)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Finish Advanced Image Processing with Python. * Remove the source file. --- ...3 Advanced Image Processing with Python.md | 124 ------------------ ...3 Advanced Image Processing with Python.md | 124 ++++++++++++++++++ 2 files changed, 124 insertions(+), 124 deletions(-) delete mode 100644 sources/tech/20160623 Advanced Image Processing with Python.md create mode 100644 translated/tech/20160623 Advanced Image Processing with Python.md diff --git a/sources/tech/20160623 Advanced Image Processing with Python.md b/sources/tech/20160623 Advanced Image Processing with Python.md deleted file mode 100644 index 0a3a722845..0000000000 --- a/sources/tech/20160623 Advanced Image Processing with Python.md +++ /dev/null @@ -1,124 +0,0 @@ -Johnny-Liao translating... - -Advanced Image Processing with Python -====================================== - -![](http://www.cuelogic.com/blog/wp-content/uploads/2016/06/Image-Search-Engine.png) - -Building an image processing search engine is no easy task. There are several concepts, tools, ideas and technologies that go into it. One of the major image-processing concepts is reverse image querying (RIQ) or reverse image search. Google, Cloudera, Sumo Logic and Birst are among the top organizations to use reverse image search. Great for analyzing images and making use of mined data, RIQ provides a very good insight into analytics. - -### Top Companies and Reverse Image Search - -There are many top tech companies that are using RIQ to best effect. For example, Pinterest first brought in visual search in 2014. It subsequently released a white paper in 2015, revealing the architecture. Reverse image search enabled Pinterest to obtain visual features from fashion objects and display similar product recommendations. - -As is generally known, Google images uses reverse image search allowing users to upload an image and then search for connected images. The submitted image is analyzed and a mathematical model made out of it, by advanced algorithm use. The image is then compared with innumerable others in the Google databases before results are matched and similar results obtained. - -**Here is a graph representation from the OpenCV 2.4.9 Features Comparison Report:** - -![](http://www.cuelogic.com/blog/wp-content/uploads/2016/06/search-engine-graph.jpg) - -### Algorithms & Python Libraries - -Before we get down to the workings of it, let us rush through the main elements that make building an image processing search engine with Python possible: - -### Patented Algorithms - -#### SIFT (Scale-Invariant Feature Transform) Algorithm - -1. A patented technology with nonfree functionality that uses image identifiers in order to identify a similar image, even those clicked from different angles, sizes, depths and scale, that they are included in the search results. Check the detailed video on SIFT here. -2. SIFT correctly matches the search criteria with a large database of features from many images. -3. Matching same images with different viewpoints and matching invariant features to obtain search results is another SIFT feature. Read more about scale-invariant keypoints here. - -#### SURF (Speeded Up Robust Features) Algorithm - -1. [SURF][1] is also patented with nonfree functionality and a more ‘speeded’ up version of SIFT. Unlike SIFT, SURF approximates Laplacian of Gaussian (unlike SIFT) with Box Filter. - -2. SURF relies on the determinant of Hessian Matrix for both its location and scale. - -3. Rotation invariance is not a requisite in many applications. So not finding this orientation speeds up the process. - -4. SURF includes several features that the speed improved in each step. Three times faster than SIFT, SURF is great with rotation and blurring. It is not as great in illumination and viewpoint change though. - -5. Open CV, a programming function library provides SURF functionalities. SURF.compute() and SURF. Detect() can be used to find descriptors and keypoints. Read more about SURF [here][2]. - -### Open Source Algorithms - -#### KAZE Algorithm - -1.KAZE is a open source 2D multiscale and novel feature detection and description algorithm in nonlinear scale spaces. Efficient techniques in Additive Operator Splitting (AOS) and variable conductance diffusion is used to build the nonlinear scale space. - -2. Multiscale image processing basics are simple – Creating an image’s scale space while filtering original image with right function over enhancing time or scale. - -#### AKAZE (Accelerated-KAZE) Algorithm - -1. As the name suggests, this is a faster mode to image search, finding matching keypoints between two images. AKAZE uses a binary descriptor and nonlinear scale space that balances accuracy and speed. - -#### BRISK (Binary Robust Invariant Scalable Keypoints) Algorithm - -1. BRISK is great for description, keypoint detection and matching. - -2. An algorithm that is highly adaptive, scale-space FAST-based detector along with a bit-string descriptor, helps speed up the search significantly. - -3. Scale-space keypoint detection and keypoint description helps optimize the performance with relation to the task at hand. - -#### FREAK (Fast Retina Keypoint) - -1. This is a novel keypoint descriptor inspired by the human eye.A binary strings cascade is efficiently computed by an image intensity comparison. The FREAK algorithm allows faster computing with lower memory load as compared to BRISK, SURF and SIFT. - -#### ORB (Oriented FAST and Rotated BRIEF) - -1.A fast binary descriptor, ORB is resistant to noise and rotation invariant. ORB builds on the FAST keypoint detector and the BRIEF descriptor, elements attributed to its low cost and good performance. - -2. Apart from the fast and precise orientation component, efficiently computing the oriented BRIEF, analyzing variance and co-relation of oriented BRIEF features, is another ORB feature. - -### Python Libraries - -#### Open CV - -1. OpenCV is available for both academic and commercial use. A open source machine learning and computer vision library, OpenCV makes it easy for organizations to utilize and modify code. - -2. Over 2500 optimized algorithms, including state-of-the-art machine learning and computer vision algorithms serve various image search purposes – face detection, object identification, camera movement tracking, finding similar images from image database, following eye movements, scenery recognition, etc. - -3. Top companies like Google, IBM, Yahoo, IBM, Sony, Honda, Microsoft and Intel make wide use of OpenCV. - -4. OpenCV uses Python, Java, C, C++ and MATLAB interfaces while supporting Windows, Linux, Mac OS and Android. - -#### Python Imaging Library (PIL) - -1. The Python Imaging Library (PIL) supports several file formats while providing image processing and graphics solutions.The open source PIL adds image processing capabilities to your Python interpreter. -2. The standard procedure for image manipulation include image enhancing, transparency and masking handling, image filtering, per-pixel manipulation, etc. - -For detailed statistics and graphs, view the OpenCV 2.4.9 Features Comparison Report [here][3]. - -### Building an Image Search Engine - -An image search engine helps pick similar images from a prepopulated set of image base. The most popular among these is Google’s well known image search engine. For starters, there are various approaches to build a system like this. To mention a few: - -1.Using image extraction, image description extraction, meta data extraction and search result extraction to build an image search engine. -2. Define your image descriptor, dataset indexing, define your similarity metric and then search and rank. -3. Select image to be searched, select directory for carrying out search, search directory for all pictures, create picture feature index, evaluate same feature for search picture, match pictures in search and obtain matched pictures. - -Our approach basically began with comparing grayscaled versions of the images, gradually moving on to complex feature matching algorithms like SIFT and SURF, and then finally settling down to am open source solution called BRISK. All these algorithms give efficient results with minor changes in performance and latency. An engine built on these algorithms have numerous applications like analyzing graphic data for popularity statistics, identification of objects in graphic contents, and many more. - -**Example**: An image search engine needs to be build by an IT company for a client. So if a brand logo image is submitted in the search, all related brand image searches show up as results. The obtained results can also be used for analytics by the client, allowing them to estimate the brand popularity as per the geographic location. Its still early days though, RIQ or reverse image search has not been exploited to its full extent yet. - -This concludes our article on building an image search engine using Python. Check our blog section out for the latest on technology and programming. - -Statistics Source: OpenCV 2.4.9 Features Comparison Report (computer-vision-talks.com) - -(Guidance and additional inputs by Ananthu Nair.) - --------------------------------------------------------------------------------- - -via: http://www.cuelogic.com/blog/advanced-image-processing-with-python/ - -作者:[Snehith Kumbla][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://www.cuelogic.com/blog/author/snehith-kumbla/ -[1]: http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_feature2d/py_surf_intro/py_surf_intro.html -[2]: http://www.vision.ee.ethz.ch/~surf/eccv06.pdf -[3]: https://docs.google.com/spreadsheets/d/1gYJsy2ROtqvIVvOKretfxQG_0OsaiFvb7uFRDu5P8hw/edit#gid=10 diff --git a/translated/tech/20160623 Advanced Image Processing with Python.md b/translated/tech/20160623 Advanced Image Processing with Python.md new file mode 100644 index 0000000000..73f8751225 --- /dev/null +++ b/translated/tech/20160623 Advanced Image Processing with Python.md @@ -0,0 +1,124 @@ +Python高级图像处理 +====================================== + +![](http://www.cuelogic.com/blog/wp-content/uploads/2016/06/Image-Search-Engine.png) + +构建图像搜索引擎并不是一件容易的任务。这里有几个概念、工具、想法和技术需要实现。主要的图像处理概念之一是逆图像查询(RIQ)或者说逆图像搜索。Google、Cloudera、Sumo Logic 和 Birst等公司在使用逆图像搜索中名列前茅。通过分析图像和使用数据挖掘RIQ提供了很好的洞察分析能力。 + +### 顶级公司与逆图像搜索 + +有很多顶级的技术公司使用RIQ来产生最好的收益。例如:在2014年Pinterest第一次带来了视觉搜索。随后在2015年发布了一份白皮书,揭示了其架构。逆图像搜索让Pinterest获得对时尚对象的视觉特征和显示类似的产品建议的能力。 + +众所周知,谷歌图片使用逆图像搜索允许用户上传一张图片然后搜索相关联的图片。通过使用先进的算法对提交的图片进行分析和数学建模。然后和谷歌数据库中无数的其他图片进行比较得到相似的结果。 + +**这是opencv 2.4.9特征比较报告一个图表:** + +![](http://www.cuelogic.com/blog/wp-content/uploads/2016/06/search-engine-graph.jpg) + +### 算法 & Python库 + +在我们使用它工作之前,让我们过一遍构建图像搜索引擎的Python库的主要元素: + +### 专利算法 + +#### 尺度不变特征变换算法(SIFT - Scale-Invariant Feature Transform) + +1. 非自由功能的一个专利技术,利用图像识别符,以识别相似图像,甚至那些从不同的角度,大小,深度和规模点击,它们被包括在搜索结果中。[点击这里][4]查看SIFT详细视频。 +2. SIFT能与从许多图片中提取的特征的大型数据库正确的匹配搜索条件。 +3. 从不同的方面来匹配相同的图像和匹配不变特征来获得搜索结果是SIFT的另一个特征。了解更多关于尺度不变[关键点][5] + +#### 加速鲁棒特征(SURF - Speeded Up Robust Features)算法 + +1. [SURF][1] 也是一种非自由功能的专利技术而且还是一种“加速”的SIFT版本。不像SIFT, + +2. SURF依赖于Hessian矩阵行列式的位置和尺度。 + +3. 在许多应用中,旋转不变性是不是一个必要条件。所以找不到这个方向的速度加快了这个过程。 + +4. SURF包括几种特性,在每一步的速度提高。比SIFT快三倍的速度,SIFT擅长旋转和模糊化。然而它不擅长处理照明和变换视角。 + +5. Open CV,一个程序功能库提供SURF相似的功能,SURF.compute()和SURF.Detect()可以用来找到描述符和要点。阅读更多关于SURF[点击这里][2] + +### 开源算法 + +#### KAZE 算法 + +1. KAZE是一个开源的非线性尺度空间的二维多尺度和新的特征检测和描述算法。在加性算子分裂的有效技术(AOS)和可变电导扩散是用来建立非线性尺度空间。 + +2. 多尺度图像处理基础是简单的创建一个图像的尺度空间,同时用正确的函数过滤原始图像,提高时间或规模。 + +#### AKAZE (Accelerated-KAZE) 算法 + +1. 顾名思义,这是一个更快的图像搜索方式,找到匹配的关键点在两幅图像之间。AKAZE 使用二进制描述符和非线性尺度空间来平衡精度和速度。 + +#### BRISK (Binary Robust Invariant Scalable Keypoints) 算法 + +1. BRISK 非常适合描述关键点的检测与匹配。 + +2. 是一种高度自适应的算法,基于尺度空间的快速检测器和一个位字符串描述符,有助于加快搜索显着。 + +3. 尺度空间关键点检测与关键点描述帮助优化手头相关任务的性能 + +#### FREAK (Fast Retina Keypoint) + +1. 这个新的关键点描述的灵感来自人的眼睛。通过图像强度比能有效地计算一个二进制串级联。FREAK算法相比BRISK,SURF和SIFT算法有更快的计算与较低的内存负载。 + +#### ORB (Oriented FAST and Rotated BRIEF) + +1. 快速的二进制描述符,ORB具有抗噪声和旋转不变性。ORB建立在FAST关键点检测器和BRIEF描述符之上,有成本低、性能好的元素属性。 + +2. 除了快速和精确的定位元件,有效地计算定向的BRIEF,分析变动和面向BRIEF特点相关,是另一个ORB的特征。 + +### Python库 + +#### Open CV + +1. Open CV提供学术和商业用途。一个开源的机器学习和计算机视觉库,OpenCV便于组织利用和修改代码。 + +2. 超过2500个优化算法,包括国家最先进的机器学习和计算机视觉算法服务与各种图像搜索--人脸检测、目标识别、摄像机目标跟踪,从图像数据库中寻找类似图像、眼球运动跟随、风景识别等。 + +3. 像谷歌,IBM,雅虎,IBM,索尼,本田,微软和英特尔这样的大公司广泛的使用OpenCV。 + +4. OpenCV拥有python,java,C,C++和MATLAB接口,同时支持Windows,Linux,Mac OS和Android。 + +#### Python图像库 (PIL) + +1. Python图像库(PIL)支持多种文件格式,同时提供图像处理和图形解决方案。开源的PIL为你的Python解释器添加图像处理能力。 +2. 标准的图像处理能力包括图像增强、透明和屏蔽作用、图像过滤、像素操作等。 + +详细的数据和图表,请看OpenCV 2.4.9 特征比较报告。[这里][3] + +### 构建图像搜索引擎 + +图像搜索引擎可以从预置集图像库选择相似的图像。其中最受欢迎的是谷歌的著名的图像搜索引擎。对于初学者来说,有不同的方法来建立这样的系统。提几个如下: + +1. 采用图像提取、图像描述提取、元数据提取和搜索结果提取,建立图像搜索引擎。 +2. 定义你的图像描述符,数据集索引,定义你的相似性度量,然后搜索和排名。 +3. 选择要搜索的图像,选择用于进行搜索的目录,所有图片的搜索目录,创建图片特征索引,评估相同的搜索图片的功能,在搜索中匹配图片,并获得匹配的图片。 + +我们的方法基本上就比较grayscaled版本的图像,逐渐移动到复杂的特征匹配算法如SIFT和SURF,最后沉淀下来的是开源的解决方案称为BRISK。所有这些算法提供了有效的结果,在性能和延迟的细微变化。建立在这些算法上的引擎有许多应用,如分析流行统计的图形数据,在图形内容中识别对象,以及更多。 + +**例如**:一个图像搜索引擎需要由一个IT公司作为客户机来建立。因此,如果一个品牌的标志图像被提交在搜索中,所有相关的品牌形象搜索显示结果。所得到的结果也可以通过客户端分析,使他们能够根据地理位置估计品牌知名度。但它还比较年轻,RIQ或反向图像搜索尚未被完全挖掘利用。 + +这就结束了我们的文章,使用Python构建图像搜索引擎。浏览我们的博客部分来查看最新的编程技术。 + +数据来源:OpenCV 2.4.9 特征比较报告(computer-vision-talks.com) + +(Ananthu Nair 的指导与补充) + +-------------------------------------------------------------------------------- + +via: http://www.cuelogic.com/blog/advanced-image-processing-with-python/ + +作者:[Snehith Kumbla][a] +译者:[Johnny-Liao](https://github.com/Johnny-Liao) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.cuelogic.com/blog/author/snehith-kumbla/ +[1]: http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_feature2d/py_surf_intro/py_surf_intro.html +[2]: http://www.vision.ee.ethz.ch/~surf/eccv06.pdf +[3]: https://docs.google.com/spreadsheets/d/1gYJsy2ROtqvIVvOKretfxQG_0OsaiFvb7uFRDu5P8hw/edit#gid=10 +[4]: https://www.youtube.com/watch?v=NPcMS49V5hg +[5]: https://www.cs.ubc.ca/~lowe/papers/ijcv04.pdf From f8d44e69787be799ffb24a5768570adc6688ebfe Mon Sep 17 00:00:00 2001 From: Mike Date: Tue, 19 Jul 2016 09:58:49 +0800 Subject: [PATCH 1194/1469] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=20How=20To=20Setup=20Bridge=20(br0)=20Network=20on=20Ubuntu=20?= =?UTF-8?q?Linux=2014.04=20and=2016.04=20LTS.md=20(#4194)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * sources/tech/20160701 How To Setup Bridge (br0) Network on Ubuntu Linux 14.04 and 16.04 LTS.md * translated/tech/20160701 How To Setup Bridge (br0) Network on Ubuntu Linux 14.04 and 16.04 LTS.md * translated/tech/20160701 How To Setup Bridge (br0) Network on Ubuntu Linux 14.04 and 16.04 LTS.md --- ...ork on Ubuntu Linux 14.04 and 16.04 LTS.md | 53 ++++++++++--------- 1 file changed, 27 insertions(+), 26 deletions(-) rename {sources => translated}/tech/20160701 How To Setup Bridge (br0) Network on Ubuntu Linux 14.04 and 16.04 LTS.md (55%) diff --git a/sources/tech/20160701 How To Setup Bridge (br0) Network on Ubuntu Linux 14.04 and 16.04 LTS.md b/translated/tech/20160701 How To Setup Bridge (br0) Network on Ubuntu Linux 14.04 and 16.04 LTS.md similarity index 55% rename from sources/tech/20160701 How To Setup Bridge (br0) Network on Ubuntu Linux 14.04 and 16.04 LTS.md rename to translated/tech/20160701 How To Setup Bridge (br0) Network on Ubuntu Linux 14.04 and 16.04 LTS.md index b3d40a94c2..ed2f37235a 100644 --- a/sources/tech/20160701 How To Setup Bridge (br0) Network on Ubuntu Linux 14.04 and 16.04 LTS.md +++ b/translated/tech/20160701 How To Setup Bridge (br0) Network on Ubuntu Linux 14.04 and 16.04 LTS.md @@ -1,48 +1,49 @@ -How To Setup Bridge (br0) Network on Ubuntu Linux 14.04 and 16.04 LTS +如何在 Ubuntu 14.04 和 16.04 上建立网桥(br0) ======================================================================= -> am a new Ubuntu Linux 16.04 LTS user. How do I setup a network bridge on the host server powered by Ubuntu 14.04 LTS or 16.04 LTS operating system? +> 作为一个 Ubuntu 16.04 LTS 的初学者。如何在 Ubuntu 14.04 和 16.04 的主机上建立网桥呢? ![](http://s0.cyberciti.org/images/category/old/ubuntu-logo.jpg) -A Bridged networking is nothing but a simple technique to connect to the outside network through the physical interface. It is useful for LXC/KVM/Xen/Containers virtualization and other virtual interfaces. The virtual interfaces appear as regular hosts to the rest of the network. In this tutorial I will explain how to configure a Linux bridge with bridge-utils (brctl) command line utility on Ubuntu server. +顾名思义,网桥的作用是通过物理接口连接内部和外部网络。对于虚拟端口或者 LXC/KVM/Xen/容器来说,这非常有用。通过网桥虚拟端口看起来是网络上的一个常规设备。在这个教程中,我将会介绍如何在 Ubuntu 服务器上通过 bridge-utils(brctl) 命令行来配置 Linux 网桥。 -### Our sample bridged networking +### 网桥网络示例 ![](http://s0.cyberciti.org/uploads/faq/2016/07/my-br0-br1-setup.jpg) ->Fig.01: Sample Ubuntu Bridged Networking Setup For Kvm/Xen/LXC Containers (br0) +>Fig.01: Kvm/Xen/LXC 容器网桥实例 (br0) In this example eth0 and eth1 is the physical network interface. eth0 connected to the LAN and eth1 is attached to the upstream ISP router/Internet. +在这个例子中,eth0 和 eth1 是物理网络接口。eth0 连接着局域网,eth1 连接着上游路由器/网络。 -### Install bridge-utils +### 安装 bridge-utils -Type the following [apt-get command][1] to install the bridge-utils: +使用[apt-get 命令][1] 安装 bridge-utils: ``` $ sudo apt-get install bridge-utils ``` -OR +或者 ```` $ sudo apt install bridge-utils ``` -Sample outputs: +样例输出: ![](http://s0.cyberciti.org/uploads/faq/2016/07/ubuntu-install-bridge-utils.jpg) ->Fig.02: Ubuntu Linux install bridge-utils package +>Fig.02: Ubuntu 安装 bridge-utils 包 -### Creating a network bridge on the Ubuntu server +### 在 Ubuntu 服务器上创建网桥 -Edit `/etc/network/interfaces` using a text editor such as nano or vi, enter: +使用你熟悉的文本编辑器修改 `/etc/network/interfaces` ,例如 vi 或者 nano : ``` $ sudo cp /etc/network/interfaces /etc/network/interfaces.bakup-1-july-2016 $ sudo vi /etc/network/interfaces ``` -Let us setup eth1 and map it to br1, enter (delete or comment out all eth1 entries): +接下来设置 eth1 并且将他绑定到 br1 ,输入(删除或者注释所有 eth1 相关配置): ``` # br1 setup with static wan IPv4 with ISP router as gateway @@ -59,7 +60,7 @@ iface br1 inet static bridge_maxwait 0 ``` -To setup eth0 and map it to br0, enter (delete or comment out all eth1 entries): +接下来设置 eth0 并将它绑定到 br0,输入(删除或者注释所有 eth1 相关配置): ``` auto br0 @@ -77,9 +78,9 @@ iface br0 inet static bridge_maxwait 0 ``` -### A note about br0 and DHCP +### 关于 br0 和 DHCP 的一点说明 -DHCP config options: +DHCP 的配置选项: ``` auto br0 @@ -90,25 +91,25 @@ iface br0 inet dhcp bridge_maxwait 0 ``` -Save and close the file. +保存并且关闭文件。 -### Restart the server or networking service +### 重启服务器或者网络服务 -You need to reboot the server or type the following command to restart the networking service (this may not work on SSH based session): +你需要重启服务器或者输入下列命令来重启网络服务(在 SSH 登陆的会话中这可能不管用): ``` $ sudo systemctl restart networking ``` -If you are using Ubuntu 14.04 LTS or older not systemd based system, enter: +如果你证使用 Ubuntu 14.04 LTS 或者更老的没有 systemd 的系统,输入: ``` $ sudo /etc/init.d/restart networking ``` -### Verify connectivity +### 验证网络配置成功 -Use the ping/ip commands to verify that both LAN and WAN interfaces are reachable: +使用 ping/ip 命令来验证 LAN 和 WAN 网络接口运行正常: ``` # See br0 and br1 ip a show @@ -120,12 +121,12 @@ ping -c 2 cyberciti.biz ping -c 2 10.0.80.12 ``` -Sample outputs: +样例输出: ![](http://s0.cyberciti.org/uploads/faq/2016/07/br0-br1-eth0-eth1-configured-on-ubuntu.jpg) ->Fig.03: Verify Bridging Ethernet Connections +>Fig.03: 验证网桥的以太网连接 -Now, you can configure XEN/KVM/LXC containers to use br0 and br1 to reach directly to the internet or private lan. No need to setup special routing or iptables SNAT rules. +现在,你就可以配置 br0 和 br1 来让 XEN/KVM/LXC 容器访问因特网或者私有局域网了。再也没有必要去设置特定路由或者 iptables 的 SNAT 规则了。 -------------------------------------------------------------------------------- @@ -133,7 +134,7 @@ Now, you can configure XEN/KVM/LXC containers to use br0 and br1 to reach direct via: http://www.cyberciti.biz/faq/how-to-create-bridge-interface-ubuntu-linux/ 作者:[VIVEK GITE][a] -译者:[译者ID](https://github.com/译者ID) +译者:[译者ID](https://github.com/MikeCoder) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 34b778b550e76c35e0998c6535f9028357688607 Mon Sep 17 00:00:00 2001 From: vim-kakali <1799225723@qq.com> Date: Tue, 19 Jul 2016 11:05:48 +0800 Subject: [PATCH 1195/1469] =?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 --- ...mart Devices Security Concerns and More.md | 49 ------------------- ...mart Devices Security Concerns and More.md | 48 ++++++++++++++++++ 2 files changed, 48 insertions(+), 49 deletions(-) delete mode 100644 sources/talk/20160506 Linus Torvalds Talks IoT Smart Devices Security Concerns and More.md create mode 100644 translated/talk/20160506 Linus Torvalds Talks IoT Smart Devices Security Concerns and More.md diff --git a/sources/talk/20160506 Linus Torvalds Talks IoT Smart Devices Security Concerns and More.md b/sources/talk/20160506 Linus Torvalds Talks IoT Smart Devices Security Concerns and More.md deleted file mode 100644 index 156fda88db..0000000000 --- a/sources/talk/20160506 Linus Torvalds Talks IoT Smart Devices Security Concerns and More.md +++ /dev/null @@ -1,49 +0,0 @@ -vim-kakali translating - -Linus Torvalds Talks IoT, Smart Devices, Security Concerns, and More[video] -=========================================================================== - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/elc-linus-b.jpg?itok=6WwnCSjL) ->Dirk Hohndel interviews Linus Torvalds at ELC. - -For the first time in the 11-year history of the [Embedded Linux Conference (ELC)][0], held in San Diego, April 4-6, the keynotes included a discussion with Linus Torvalds. The creator and lead overseer of the Linux kernel, and “the reason we are all here,” in the words of his interviewer, Intel Chief Linux and Open Source Technologist Dirk Hohndel, seemed upbeat about the state of Linux in embedded and Internet of Things applications. Torvalds very presence signaled that embedded Linux, which has often been overshadowed by Linux desktop, server, and cloud technologies, had come of age. - -![](https://www.linux.com/sites/lcom/files/styles/floated_images/public/elc-linus_0.jpg?itok=FNPIDe8k) ->Linus Torvalds speaking at Embedded Linux Conference. - -IoT was the main topic at ELC, which included an OpenIoT Summit track, and the chief topic in the Torvalds interview. - -“Maybe you won’t see Linux at the IoT leaf nodes, but anytime you have a hub, you will need it,” Torvalds told Hohndel. “You need smart devices especially if you have 23 [IoT standards]. If you have all these stupid devices that don’t necessarily run Linux, and they all talk with slightly different standards, you will need a lot of smart devices. We will never have one completely open standard, one ring to rule them all, but you will have three of four major protocols, and then all these smart hubs that translate.” - -Torvalds remained customarily philosophical when Hohndel asked about the gaping security holes in IoT. “I don’t worry about security because there’s not a lot we can do,” he said. “IoT is unpatchable -- it’s a fact of life.” - -The Linux creator seemed more concerned about the lack of timely upstream contributions from one-off embedded projects, although he noted there have been significant improvements in recent years, partially due to consolidation on hardware. - -“The embedded world has traditionally been hard to interact with as an open source developer, but I think that’s improving,” Torvalds said. “The ARM community has become so much better. Kernel people can now actually keep up with some of the hardware improvements. It’s improving, but we’re not nearly there yet.” - -Torvalds admitted to being more at home on the desktop than in embedded and to having “two left hands” when it comes to hardware. - -“I’ve destroyed things with a soldering iron many times,” he said. “I’m not really set up to do hardware.” On the other hand, Torvalds guessed that if he were a teenager today, he would be fiddling around with a Raspberry Pi or BeagleBone. “The great part is if you’re not great at soldering, you can just buy a new one.” - -Meanwhile, Torvalds vowed to continue fighting for desktop Linux for another 25 years. “I’ll wear them down,” he said with a smile. - -Watch the full video, below. - -Get the Latest on Embedded Linux and IoT. Access 150+ recorded sessions from Embedded Linux Conference 2016. [Watch Now][1]. - -[video](https://youtu.be/tQKUWkR-wtM) - --------------------------------------------------------------------------------- - -via: https://www.linux.com/news/linus-torvalds-talks-iot-smart-devices-security-concerns-and-more-video - -作者:[ERIC BROWN][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.linux.com/users/ericstephenbrown -[0]: http://events.linuxfoundation.org/events/embedded-linux-conference -[1]: http://go.linuxfoundation.org/elc-openiot-summit-2016-videos?utm_source=lf&utm_medium=blog&utm_campaign=linuxcom - diff --git a/translated/talk/20160506 Linus Torvalds Talks IoT Smart Devices Security Concerns and More.md b/translated/talk/20160506 Linus Torvalds Talks IoT Smart Devices Security Concerns and More.md new file mode 100644 index 0000000000..876f84f68e --- /dev/null +++ b/translated/talk/20160506 Linus Torvalds Talks IoT Smart Devices Security Concerns and More.md @@ -0,0 +1,48 @@ + +Linus Torvalds 谈及物联网,智能设备,安全连接等问题[video] +=========================================================================== + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/elc-linus-b.jpg?itok=6WwnCSjL) +>Dirk Hohndel 在嵌入式大会上采访 Linus Torvalds 。 + + + [嵌入式大会(Embedded Linux Conference)][0] 从在 San Diego 【译注:圣迭戈,美国加利福尼亚州的一个太平洋沿岸城市。】开始举办到现在已经有 11 年了,在 4 月 4 日到 6 日,Linus Torvalds 加入了会议的主题讨论。他是 Linux 内核的缔造者和最高决策者,也是“我们都在这里的原因”,在采访他的对话中,英特尔的 Linux 和开源技术总监 Dirk Hohndel 谈到了 Linux 在嵌入式和物联网应用程序领域的快速发展前景。Torvalds 很少出席嵌入式 Linux 大会,这些大会经常被 Linux 桌面、服务器和云技术夺去光芒。 +![](https://www.linux.com/sites/lcom/files/styles/floated_images/public/elc-linus_0.jpg?itok=FNPIDe8k) +>Linus Torvalds 在嵌入式 Linux 大会上的演讲。 + + +物联网是嵌入式大会的主题,也包括未来开放物联网的最高发展方向(OpenIoT Summit),这是采访 Torvalds 的主要话题。 + +Torvalds 对 Hohndel 说到,“或许你不会在物联网设备上看到 Linux 的影子,但是在你有一个核心设备的时候,你就会需要它。你需要智能设备尤其在你有 23 [物联网标准]的时候。如果你全部使用低级设备,它们没必要一定运行 Linux ,它们采用的标准稍微有点不同,所以你需要很多智能设备。我们将来也不会有一个完全开放的标准,只是给它一个统一的标准,但是你将会需要 4 分之 3 的主要协议,它们都是这些智能核心的转化形式。” + +当 Hohndel 问及在物联网的巨大安全漏洞的时候, Torvalds 神情如常。他说:“我不担心安全问题因为我们能做的不是很多,物联网如果遭受攻击是无法挽回的-这是事实。" + +Linux 缔造者看起来更关心的是一次性的嵌入式项目缺少及时的上游贡献,尽管他注意到近年来这些都有一些本质上的提升,特别是在硬件上的发展。 + +Torvalds 说:”嵌入式领域历来就很难与开源开发者有所联系,但是我认为这些都在发生改变,ARM 团队也已经很优秀了。内核维护者事实上也看到了硬件性能的提升。一切都在变好,但是昨天却不是这样的。” + +Torvalds 承认他在家经常使用桌面系统而不是嵌入式系统,并且在使用硬件的时候他有“两只左手”。 + +“我已经用电烙铁弄坏了很多东西。”他说到。“我真的不适合搞硬件开发。”;另一方面,Torvalds 设想如果他现在是个年轻人,他可能被 Raspberry Pi(树莓派) 和 BeagleBone(猎兔犬板)【译注:Beagle板实际是由TI支持的一个以教育(STEP)为目的的开源项目】欺骗。“最主要是原因是如果你善于焊接,那么你就仅仅是买到了一个新的板子。” + +同时,Torvalds 也承诺他要为 Linux 桌面再奋斗一个 25 年。他笑着说:“我要为它工作一生。” + +下面,请看完整视频。 + +获取关于嵌入式 Linux 和物联网的最新信息。进入 2016 年嵌入式 Linux 大会 150+ 分钟的会议全程。[现在观看][1]. +[video](https://youtu.be/tQKUWkR-wtM) + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/linus-torvalds-talks-iot-smart-devices-security-concerns-and-more-video + +作者:[ERIC BROWN][a] +译者:[vim-kakali](https://github.com/vim-kakali) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/ericstephenbrown +[0]: http://events.linuxfoundation.org/events/embedded-linux-conference +[1]: http://go.linuxfoundation.org/elc-openiot-summit-2016-videos?utm_source=lf&utm_medium=blog&utm_campaign=linuxcom + From c99281a284c0f7180db0773e4135c20c765b0bbf Mon Sep 17 00:00:00 2001 From: vim-kakali <1799225723@qq.com> Date: Tue, 19 Jul 2016 11:40:01 +0800 Subject: [PATCH 1196/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...takes charge of Linux desktop and IoT software distribution.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sources/talk/20160614 ​Ubuntu Snap takes charge of Linux desktop and IoT software distribution.md b/sources/talk/20160614 ​Ubuntu Snap takes charge of Linux desktop and IoT software distribution.md index 6992f76156..667c49b056 100644 --- a/sources/talk/20160614 ​Ubuntu Snap takes charge of Linux desktop and IoT software distribution.md +++ b/sources/talk/20160614 ​Ubuntu Snap takes charge of Linux desktop and IoT software distribution.md @@ -1,3 +1,6 @@ +vim-kakali translating + + Ubuntu Snap takes charge of Linux desktop and IoT software distribution =========================================================================== From dbdd6b234a0b22f69f873dc3cc4547c8c2ee3330 Mon Sep 17 00:00:00 2001 From: "Cathon.ZHD" Date: Tue, 19 Jul 2016 22:18:03 +0800 Subject: [PATCH 1197/1469] Tanslation Finished --- ...meet the IT needs of today and tomorrow.md | 63 ------------------- ...meet the IT needs of today and tomorrow.md | 59 +++++++++++++++++ 2 files changed, 59 insertions(+), 63 deletions(-) delete mode 100644 sources/talk/20160620 Training vs. hiring to meet the IT needs of today and tomorrow.md create mode 100644 translated/talk/20160620 Training vs. hiring to meet the IT needs of today and tomorrow.md diff --git a/sources/talk/20160620 Training vs. hiring to meet the IT needs of today and tomorrow.md b/sources/talk/20160620 Training vs. hiring to meet the IT needs of today and tomorrow.md deleted file mode 100644 index 1417c9fe7b..0000000000 --- a/sources/talk/20160620 Training vs. hiring to meet the IT needs of today and tomorrow.md +++ /dev/null @@ -1,63 +0,0 @@ -[Cathon is translating] -Training vs. hiring to meet the IT needs of today and tomorrow -================================================================ - -![](https://enterprisersproject.com/sites/default/files/styles/620x350/public/images/cio_talent_4.png?itok=QLhyS_Xf) - -In the digital era, IT skills requirements are in a constant state of flux thanks to the constant change of the tools and technologies companies need to keep pace. It’s not easy for companies to find and hire talent with coveted skills that will enable them to innovate. Meanwhile, training internal staff to take on new skills and challenges takes time that is often in short supply. - -[Sandy Hill][1] is quite familiar with the various skills required across a variety of IT disciplines. As the director of IT for [Pegasystems][2], she is responsible for IT teams involved in areas ranging from application development to data center operations. What’s more, Pegasystems develops applications to help sales, marketing, service and operations teams streamline operations and connect with customers, which means she has to grasp the best way to use IT resources internally, and the IT challenges the company’s customers face. - -![](https://enterprisersproject.com/sites/default/files/CIO_Q%20and%20A_0.png) - -**The Enterprisers Project (TEP): How has the emphasis you put on training changed in recent years?** - -**Hill**: We’ve been growing exponentially over the past couple of years so now we’re implementing more global processes and procedures. With that comes the training aspect of making sure everybody is on the same page. - -Most of our focus has shifted to training staff on new products and tools that get implemented to drive innovation and enhance end user productivity. For example, we’ve implemented an asset management system; we didn’t have one before. So we had to do training globally instead of hiring someone who already knew the product. As we’re growing, we’re also trying to maintain a tight budget and flat headcount. So we’d rather internally train than try to hire new people. - -**TEP: Describe your approach to training. What are some of the ways you help employees evolve their skills?** - -**Hill**: I require each staff member to have a technical and non-technical training goal, which are tracked and reported on as part of their performance review. Their technical goal needs to align within their job function, and the non-technical goal can be anything from focusing on sharpening one of their soft skills to learning something outside of their area of expertise. I perform yearly staff evaluations to see where the gaps and shortages are so that teams remain well-rounded. - -**TEP: To what extent have your training initiatives helped quell recruitment and retention issues?** - -**Hill**: Keeping our staff excited about learning new technologies keeps their skill sets sharp. Having the staff know that we value them, and we are vested in their professional growth and development motivates them. - -**TEP: What sorts of training have you found to be most effective?** - -**Hill**: We use several different training methods that we’ve found to be effective. With new or special projects, we try to incorporate a training curriculum led by the vendor as part of the project rollout. If that’s not an option, we use off-site training. We also purchase on-line training packages, and I encourage my staff to attend at least one conference per year to keep up with what’s new in the industry. - -**TEP**: For what sorts of skills have you found it’s better to hire new people than train existing staff? - -**Hill**: It depends on the project. In one recent initiative, trying to implement OpenStack, we didn’t have internal expertise at all. So we aligned with a consulting firm that specialized in that area. We utilized their expertise on-site to help run the project and train internal team members. It was a massive undertaking to get internal people to learn the skills they needed while also doing their day-to-day jobs. - -The consultant helped us determine the headcount we needed to be proficient. This allowed us to assess our staff to see if gaps remained, which would require additional training or hiring. And we did end up hiring some of the contractors. But the alternative was to send some number of FTEs (full-time employees) for 6 to 8 weeks of training, and our pipeline of projects wouldn’t allow that. - -**TEP: In thinking about some of your most recent hires, what skills did they have that are especially attractive to you?** - -**Hill**: In recent hires, I’ve focused on soft skills. In addition to having solid technical skills, they need to be able to communicate effectively, work in teams and have the ability to persuade, negotiate and resolve conflicts. - -IT people in general kind of keep to themselves; they’re often not the most social people. Now, where IT is more integrated throughout the organization, the ability to give useful updates and status reports to other business units is critical to show that IT is an active presence and to be successful. - - - --------------------------------------------------------------------------------- - -via: http://linoxide.com/firewall/pfsense-setup-basic-configuration/ - -作者:[ Paul Desmond][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://enterprisersproject.com/user/paul-desmond -[1]: https://enterprisersproject.com/user/sandy-hill -[2]: https://www.pega.com/pega-can?&utm_source=google&utm_medium=cpc&utm_campaign=900.US.Evaluate&utm_term=pegasystems&gloc=9009726&utm_content=smAXuLA4U|pcrid|102822102849|pkw|pegasystems|pmt|e|pdv|c| - - - - - - diff --git a/translated/talk/20160620 Training vs. hiring to meet the IT needs of today and tomorrow.md b/translated/talk/20160620 Training vs. hiring to meet the IT needs of today and tomorrow.md new file mode 100644 index 0000000000..fc7794f305 --- /dev/null +++ b/translated/talk/20160620 Training vs. hiring to meet the IT needs of today and tomorrow.md @@ -0,0 +1,59 @@ +Training vs. hiring to meet the IT needs of today and tomorrow +培训还是雇人,来满足当今和未来的 IT 需求 +================================================================ + +![](https://enterprisersproject.com/sites/default/files/styles/620x350/public/images/cio_talent_4.png?itok=QLhyS_Xf) + +在数字化时代,由于企业需要不断跟上工具和技术更新换代的步伐,对 IT 技能的需求也稳定增长。对于企业来说,寻找和雇佣那些拥有令人垂涎能力的创新人才,是非常不容易的。同时,培训内部员工来使他们接受新的技能和挑战,需要一定的时间。而且,这也往往满足不了需求。 + +[Sandy Hill][1] 对多种 IT 学科涉及到的多项技术都很熟悉。她作为 [Pegasystems][2] 项目的 IT 主管,负责的 IT 团队涉及的领域从应用的部署到数据中心的运营。更重要的是,Pegasystems 开发应用来帮助销售,市场,服务以及运行团队简化操作,联系客户。这意味着她需要掌握和利用 IT 内部资源的最佳方法,面对公司客户遇到的 IT 挑战。 + +![](https://enterprisersproject.com/sites/default/files/CIO_Q%20and%20A_0.png) + +**企业家项目(TEP):这些年你是如何调整培训重心的?** + +**Hill**:在过去的几十年中,我们经历了爆炸式的发展,所以现在我们要实现更多的全球化进程。随之而来的培训方面,将确保每个人都在同一起跑线上。 + +我们大多的关注点已经转移到培养员工使用新的产品和工具上,这些新产品和工具的实现,能够推动创新,并提高工作效率。例如,我们实现了资产管理系统; 以前我们是没有的。因此我们需要为全部员工做培训,而不是雇佣那些已经知道该产品的人。当我们正在发展的时候,我们也试图保持紧张的预算和稳定的职员总数。所以,我们更愿意在内部培训而不是雇佣新人。 + +**TEP:说说培训方法吧,你是怎样帮助你的员工发展他们的技能?** + +**Hill**:我要求每一位员工制定一个技术性的和非技术性的训练目标。这作为他们绩效评估的一部分。他们的技术性目标需要与他们的工作职能相符,非技术行目标则着重发展一项软技能,或是学一些专业领域之外的东西。我每年对职员进行一次评估,看看差距和不足之处,以使团队保持全面发展。 + +**TEP:你的训练计划能够在多大程度上减轻招聘和保留职员的问题?** + +**Hill**:使我们的职员对学习新的技术保持兴奋,让他们的技能更好。让职员知道我们重视他们并且让他们在擅长的领域成长和发展,以此激励他们。 + +**TEP:你有没有发现哪种培训是最有效的?** + +**HILL**:我们使用几种不同的我们发现是有效的培训方法。当有新的或特殊的项目时,我们尝试加入一套由甲方(不会翻:乙方,卖方?)领导的培训课程,作为项目的一部分。要是这个方法不能实现,我们将进行异地培训。我们也会购买一些在线的培训课程。我也鼓励职员每年参加至少一次会议,以了解行业的动向。 + +**TEP:你有没有发现有哪些技能,雇佣新人要比培训现有员工要好?** + +**Hill**:这和项目有关。有一个最近的计划,试图实现 OpenStack,而我们根本没有这方面的专家。所以我们与一家从事这一领域的咨询公司合作。我们利用他们的专业知识帮助我们运行项目,并现场培训我们的内部团队成员。让内部员工学习他们需要的技能,同时还要完成他们们天的工作,这是一项艰巨的任务。 + +顾问帮助我们确定我们需要的对某一技术熟练的的员工人数。这使我们能够对员工进行评估,看看是否存在缺口。如果存在人员上的缺口,我们还需要额外的培训或是员工招聘。我们也确实雇佣了一些承包商。另一个选择是让一些全职员工进行为期六至八周的培训,但我们的项目模式不容许这么做。 + +**TEP:想一下你最近雇佣的员工,他们的那些技能特别能够吸引到你?** + +**Hill**:在最近的招聘中,我侧重于软技能。除了扎实的技术能力外,他们需要能够在团队中进行有效的沟通和工作,要有说服他人,谈判和解决冲突的能力。 + +IT 人一向独来独往。他们一般不是社交最多的人。现在,IT 越来越整合到组织中,它为其他业务部门提供有用的更新报告和状态报告的能力是至关重要的,这也表明 IT 是积极的存在,并将取得成功。 + +-------------------------------------------------------------------------------- + +via: https://enterprisersproject.com/article/2016/6/training-vs-hiring-meet-it-needs-today-and-tomorrow + +作者:[Paul Desmond][a] +译者:[Cathon](https://github.com/Cathon) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://enterprisersproject.com/user/paul-desmond +[1]: https://enterprisersproject.com/user/sandy-hill +[2]: https://www.pega.com/pega-can?&utm_source=google&utm_medium=cpc&utm_campaign=900.US.Evaluate&utm_term=pegasystems&gloc=9009726&utm_content=smAXuLA4U|pcrid|102822102849|pkw|pegasystems|pmt|e|pdv|c| + + + + From c0f397c0519f2b58bc72a6dac300cc4e09770651 Mon Sep 17 00:00:00 2001 From: Xin Wang <2650454635@qq.com> Date: Wed, 20 Jul 2016 09:48:45 +0800 Subject: [PATCH 1198/1469] Writing online multiplayer game with python and asyncio - part 1 (#4198) * Create 20160524 Writing online multiplayer game with python and asyncio - part 1.md * Delete 20160524 Writing online multiplayer game with python and asyncio - part 1.md --- ...r game with python and asyncio - part 1.md | 73 ------------------- ...r game with python and asyncio - part 1.md | 71 ++++++++++++++++++ 2 files changed, 71 insertions(+), 73 deletions(-) delete mode 100644 sources/tech/20160524 Writing online multiplayer game with python and asyncio - part 1.md create mode 100644 translated/tech/20160524 Writing online multiplayer game with python and asyncio - part 1.md diff --git a/sources/tech/20160524 Writing online multiplayer game with python and asyncio - part 1.md b/sources/tech/20160524 Writing online multiplayer game with python and asyncio - part 1.md deleted file mode 100644 index 95122771ac..0000000000 --- a/sources/tech/20160524 Writing online multiplayer game with python and asyncio - part 1.md +++ /dev/null @@ -1,73 +0,0 @@ -xinglianfly translate -Writing online multiplayer game with python and asyncio - part 1 -=================================================================== - -Have you ever combined async with Python? Here I’ll tell you how to do it and show it on a [working example][1] - a popular Snake game, designed for multiple players. - -[Play gmae][2] - -### 1. Introduction - -Massive multiplayer online games are undoubtedly one of the main trends of our century, in both tech and cultural domains. And while for a long time writing a server for a MMO game was associated with massive budgets and complex low-level programming techniques, things are rapidly changing in the recent years. Modern frameworks based on dynamic languages allow handling thousands of parallel user connections on moderate hardware. At the same time, HTML 5 and WebSockets standards enabled the creation of real-time graphics-based game clients that run directly in web browser, without any extensions. - -Python may be not the most popular tool for creating scalable non-blocking servers, especially comparing to node.js popularity in this area. But the latest versions of Python are aimed to change this. The introduction of [asyncio][3] library and a special [async/await][4] syntax makes asynchronous code look as straightforward as regular blocking code, which now makes Python a worthy choice for asynchronous programming. So I will try to utilize these new features to demonstrate a way to create an online multiplayer game. - -### 2. Getting asynchronous - -A game server should handle a maximum possible number of parallel users' connections and process them all in real time. And a typical solution - creating threads, doesn't solve a problem in this case. Running thousands of threads requires CPU to switch between them all the time (it is called context switching), which creates big overhead, making it very ineffective. Even worse with processes, because, in addition, they do occupy too much memory. In Python there is even one more problem - regular Python interpreter (CPython) is not designed to be multithreaded, it aims to achieve maximum performance for single-threaded apps instead. That's why it uses GIL (global interpreter lock), a mechanism which doesn't allow multiple threads to run Python code at the same time, to prevent uncontrolled usage of the same shared objects. Normally the interpreter switches to another thread when currently running thread is waiting for something, usually a response from I/O (like a response from web server for example). This allows having non-blocking I/O operations in your app, because every operation blocks only one thread instead of blocking the whole server. However, it also makes general multithreading idea nearly useless, because it doesn't allow you to execute python code in parallel, even on multi-core CPU. While at the same time it is completely possible to have non-blocking I/O in one single thread, thus eliminating the need of heavy context-switching. - -Actually, a single-threaded non-blocking I/O is a thing you can do in pure python. All you need is a standard [select][5] module which allows you to write an event loop waiting for I/O from non-blocking sockets. However, this approach requires you to define all the app logic in one place, and soon your app becomes a very complex state-machine. There are frameworks that simplify this task, most popular are [tornado][6] and [twisted][7]. They are utilized to implement complex protocols using callback methods (and this is similar to node.js). The framework runs its own event loop invoking your callbacks on the defined events. And while this may be a way to go for some, it still requires programming in callback style, what makes your code fragmented. Compare this to just writing synchronous code and running multiple copies concurrently, like we would do with normal threads. Why wouldn't this be possible in one thread? - -And this is where the concept of microthreads come in. The idea is to have concurrently running tasks in one thread. When you call a blocking function in one task, behind the scenes it calls a "manager" (or "scheduler") that runs an event loop. And when there is some event ready to process, a manager passes execution to a task waiting for it. That task will also run until it reaches a blocking call, and then it will return execution to a manager again. - ->Microthreads are also called lightweight threads or green threads (a term which came from Java world). Tasks which are running concurrently in pseudo-threads are called tasklets, greenlets or coroutines. - -One of the first implementations of microthreads in Python was [Stackless Python][8]. It got famous because it is used in a very successful online game [EVE online][9]. This MMO game boasts about a persistent universe, where thousands of players are involved in different activities, all happening in the real time. Stackless is a standalone Python interpreter which replaces standard function calling stack and controls the flow directly to allow minimum possible context-switching expenses. Though very effective, this solution remained less popular than "soft" libraries that work with a standard interpreter. Packages like [eventlet][10] and [gevent][11] come with patching of a standard I/O library in the way that I/O function pass execution to their internal event loop. This allows turning normal blocking code into non-blocking in a very simple way. The downside of this approach is that it is not obvious from the code, which calls are non-blocking. A newer version of Python introduced native coroutines as an advanced form of generators. Later in Python 3.4 they included asyncio library which relies on native coroutines to provide single-thread concurrency. But only in python 3.5 coroutines became an integral part of python language, described with the new keywords async and await. Here is a simple example, which illustrates using asyncio to run concurrent tasks: - -``` -import asyncio - -async def my_task(seconds): - print("start sleeping for {} seconds".format(seconds)) - await asyncio.sleep(seconds) - print("end sleeping for {} seconds".format(seconds)) - -all_tasks = asyncio.gather(my_task(1), my_task(2)) -loop = asyncio.get_event_loop() -loop.run_until_complete(all_tasks) -loop.close() -``` - -We launch two tasks, one sleeps for 1 second, the other - for 2 seconds. The output is: - -``` -start sleeping for 1 seconds -start sleeping for 2 seconds -end sleeping for 1 seconds -end sleeping for 2 seconds -``` - -As you can see, coroutines do not block each other - the second task starts before the first is finished. This is happening because asyncio.sleep is a coroutine which returns execution to a scheduler until the time will pass. In the next section, we will use coroutine-based tasks to create a game loop. - --------------------------------------------------------------------------------- - -via: https://7webpages.com/blog/writing-online-multiplayer-game-with-python-asyncio-getting-asynchronous/ - -作者:[Kyrylo Subbotin][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://7webpages.com/blog/writing-online-multiplayer-game-with-python-asyncio-getting-asynchronous/ -[1]: http://snakepit-game.com/ -[2]: http://snakepit-game.com/ -[3]: https://docs.python.org/3/library/asyncio.html -[4]: https://docs.python.org/3/whatsnew/3.5.html#whatsnew-pep-492 -[5]: https://docs.python.org/2/library/select.html -[6]: http://www.tornadoweb.org/ -[7]: http://twistedmatrix.com/ -[8]: http://www.stackless.com/ -[9]: http://www.eveonline.com/ -[10]: http://eventlet.net/ -[11]: http://www.gevent.org/ diff --git a/translated/tech/20160524 Writing online multiplayer game with python and asyncio - part 1.md b/translated/tech/20160524 Writing online multiplayer game with python and asyncio - part 1.md new file mode 100644 index 0000000000..26ddea6b1e --- /dev/null +++ b/translated/tech/20160524 Writing online multiplayer game with python and asyncio - part 1.md @@ -0,0 +1,71 @@ +使用python 和asyncio编写在线多人游戏 - 第1部分 +=================================================================== + +你曾经把async和python关联起来过吗?在这里我将告诉你怎样做,而且在[working example][1]这个例子里面展示-一个流行的贪吃蛇游戏,这是为多人游戏而设计的。 +[Play game][2] + +###1.简介 + +在技术和文化领域,大量的多人在线游戏毋庸置疑是我们这个世界的主流之一。同时,为一个MMO游戏写一个服务器一般和大量的预算与低水平的编程技术相关,在最近这几年,事情发生了很大的变化。基于动态语言的现代框架允许在稳健的硬件上面处理大量并发的用户连接。同时,HTML5 和 WebSockets 标准允许基于实时的图形游戏直接在web浏览器上创建客户端,而不需要任何的扩展。 + +对于创建可扩展非堵塞的服务器,Python可能不是最受欢迎的工具,尤其是和在这个领域最受欢迎的node.js相比。但是最近版本的python打算改变这种现状。[asyncio][3]的介绍和一个特别的[async/await][4] 语法使得异步代码看起来像常规的阻塞代码,这使得python成为一个值得信赖的异步编程语言。所以我将尝试利用这些新特点来创建一个多人在线游戏。 + +###2.异步 +一个游戏服务器应该处理最大数量的用户的并发连接和实时处理这些连接。一个典型的解决方案----创建线程,然而在这种情况下并不能解决这个问题。运行上千的线程需要CPU在它们之间不停的切换(这叫做上下文切换),这将开销非常大,效率很低下。更糟糕的是,因为,此外,它们会占用大量的内存。在python中,还有一个问题,python的解释器(CPython)并不是针对多线程设计的,它主要针对于单线程实现最大数量的行为。这就是为什么它使用GIL(global interpreter lock),一个不允许同时运行多线程python代码的架构,来防止共享物体的不可控用法。正常情况下当当前线程正在等待的时候,解释器转换到另一个线程,通常是一个I/O的响应(像一个服务器的响应一样)。这允许在你的应用中有非阻塞I/O,因为每一个操作仅仅堵塞一个线程而不是堵塞整个服务器。然而,这也使得通常的多线程变得无用,因为它不允许你并发执行python代码,即使是在多核心的cpu上。同时在单线程中拥有非阻塞IO是完全有可能的,因而消除了经常切换上下文的需要。 + +实际上,你可以用纯python代码来实现一个单线程的非阻塞IO。你所需要的只是标准的[select][5]模块,这个模块可以让你写一个事件循环来等待未阻塞的socket的io。然而,这个方法需要你在一个地方定义所有app的逻辑,不久之后,你的app就会变成非常复杂的状态机。有一些框架可以简化这个任务,比较流行的是[tornade][6] 和 [twisted][7]。他们被用来使用回调方法实现复杂的协议(这和node.js比较相似)。这个框架运行在他自己的事件循环中,这个事件在定义的事件上调用你的回调。并且,这或许是一些情况的解决方案,但是它仍然需要使用回调的方式编程,这使你的代码碎片化。和写同步代码并且并发执行多个副本相比,就像我们会在普通的线程上做一样。这为什么在单个线程上是不可能的呢? + +这就是为什么microthread出现的原因。这个想法是为了在一个线程上并发执行任务。当你在一个任务中调用阻塞的方法时,有一个叫做"manager" (或者“scheduler”)的东西在执行事件循环。当有一些事件准备处理的时候,一个manager会让等这个事件的“任务”单元去执行,直到自己停了下来。然后执行完之后就返回那个管理器(manager)。 + +>Microthreads are also called lightweight threads or green threads (a term which came from Java world). Tasks which are running concurrently in pseudo-threads are called tasklets, greenlets or coroutines.(Microthreads 也会被称为lightweight threads 或者 green threads(java中的一个术语)。在伪线程中并发执行的任务叫做tasklets,greenlets或者coroutines). + +microthreads的其中一种实现在python中叫做[Stackless Python][8]。这个被用在了一个叫[EVE online][9]的非常有名的在线游戏中,所以它变得非常有名。这个MMO游戏自称说在一个持久的宇宙中,有上千个玩家在做不同的活动,这些都是实时发生的。Stackless 是一个单独的python解释器,它代替了标准的栈调用并且直接控制流来减少上下文切换的开销。尽管这非常有效,这个解决方案不如使用标准解释器的“soft”库有名。像[eventlet][10]和[gevent][11] 的方式配备了标准的I / O库的补丁的I / O功能在内部事件循环执行。这使得将正常的阻塞代码转变成非阻塞的代码变得简单。这种方法的一个缺点是从代码看这并不明显,这被称为非阻塞。Python的新的版本介绍了本地协同程序作为生成器的高级形式。在Python 的3.4版本中,引入了asyncio库,这个库依赖于本地协同程序来提供单线程并发。但是在Python 3.5 协同程序变成了Python语言的一部分,使用新的关键字 async 和 await 来描述。这是一个简单的例子,这表明了使用asyncio来运行 并发任务。 + +``` +import asyncio + +async def my_task(seconds): + print("start sleeping for {} seconds".format(seconds)) + await asyncio.sleep(seconds) + print("end sleeping for {} seconds".format(seconds)) + +all_tasks = asyncio.gather(my_task(1), my_task(2)) +loop = asyncio.get_event_loop() +loop.run_until_complete(all_tasks) +loop.close() +``` + +我们启动了两个任务,一个睡眠1秒钟,另一个睡眠2秒钟,输出如下: + +``` +start sleeping for 1 seconds +start sleeping for 2 seconds +end sleeping for 1 seconds +end sleeping for 2 seconds +``` + +正如你所看到的,协同程序不会阻塞彼此-----第二个任务在第一个结束之前启动。这发生的原因是asyncio.sleep是协同程序,它会返回一个调度器的执行直到时间过去。在下一节中, +我们将会使用coroutine-based的任务来创建一个游戏循环。 + +-------------------------------------------------------------------------------- + +via: https://7webpages.com/blog/writing-online-multiplayer-game-with-python-asyncio-getting-asynchronous/ + +作者:[Kyrylo Subbotin][a] +译者:[xinglianfly](https://github.com/xinglianfly) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://7webpages.com/blog/writing-online-multiplayer-game-with-python-asyncio-getting-asynchronous/ +[1]: http://snakepit-game.com/ +[2]: http://snakepit-game.com/ +[3]: https://docs.python.org/3/library/asyncio.html +[4]: https://docs.python.org/3/whatsnew/3.5.html#whatsnew-pep-492 +[5]: https://docs.python.org/2/library/select.html +[6]: http://www.tornadoweb.org/ +[7]: http://twistedmatrix.com/ +[8]: http://www.stackless.com/ +[9]: http://www.eveonline.com/ +[10]: http://eventlet.net/ +[11]: http://www.gevent.org/ From b3dd7a29100ab5cb9abc3e36519a29f557ffc71d Mon Sep 17 00:00:00 2001 From: ivo_wang Date: Tue, 19 Jul 2016 20:49:15 -0500 Subject: [PATCH 1199/1469] =?UTF-8?q?Update=2020160104=20What=20is=20good?= =?UTF-8?q?=20stock=20portfolio=20management=20software=20on=20L=E2=80=A6?= =?UTF-8?q?=20(#4197)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * a little * move * moveall * about half * finish * finish * finished * Translating by ivo-wang Translating by ivo-wang --- ... portfolio management software on Linux.md | 110 ------------------ ...g may prevent the demise of Moore's Law.md | 1 + ... portfolio management software on Linux.md | 109 +++++++++++++++++ 3 files changed, 110 insertions(+), 110 deletions(-) delete mode 100644 sources/tech/20160104 What is good stock portfolio management software on Linux.md create mode 100644 translated/tech/20160104 What is good stock portfolio management software on Linux.md diff --git a/sources/tech/20160104 What is good stock portfolio management software on Linux.md b/sources/tech/20160104 What is good stock portfolio management software on Linux.md deleted file mode 100644 index b24139b9c5..0000000000 --- a/sources/tech/20160104 What is good stock portfolio management software on Linux.md +++ /dev/null @@ -1,110 +0,0 @@ -Translating by ivo-wang -What is good stock portfolio management software on Linux -================================================================================ -If you are investing in the stock market, you probably understand the importance of a sound portfolio management plan. The goal of portfolio management is to come up with the best investment plan tailored for you, considering your risk tolerance, time horizon and financial goals. Given its importance, no wonder there are no shortage of commercial portfolio management apps and stock market monitoring software, each touting various sophisticated portfolio performance tracking and reporting capabilities. - -For those of you Linux aficionados who are looking for a **good open-source portfolio management tool** to manage and track your stock portfolio on Linux, I would highly recommend a Java-based portfolio manager called [JStock][1]. If you are not a big Java fan, you might be turned off by the fact that JStock runs on a heavyweight JVM. At the same time I am sure many people will appreciate the fact that JStock is instantly accessible on every Linux platform with JRE installed. No hoops to jump through to make it work on your Linux environment. - -The day is gone when "open-source" means "cheap" or "subpar". Considering that JStock is just a one-man job, JStock is impressively packed with many useful features as a portfolio management tool, and all that credit goes to Yan Cheng Cheok! For example, JStock supports price monitoring via watchlists, multiple portfolios, custom/built-in stock indicators and scanners, support for 27 different stock markets and cross-platform cloud backup/restore. JStock is available on multiple platforms (Linux, OS X, Android and Windows), and you can save and restore your JStock portfolios seamlessly across different platforms via cloud backup/restore. - -Sounds pretty neat, huh? Now I am going to show you how to install and use JStock in more detail. - -### Install JStock on Linux ### - -Since JStock is written in Java, you must [install JRE][2] to run it. Note that JStock requires JRE 1.7 or higher. If your JRE version does not meet this requirement, JStock will fail with the following error. - - Exception in thread "main" java.lang.UnsupportedClassVersionError: org/yccheok/jstock/gui/JStock : Unsupported major.minor version 51.0 - -Once you install JRE on your Linux, download the latest JStock release from the official website, and launch it as follows. - - $ wget https://github.com/yccheok/jstock/releases/download/release_1-0-7-13/jstock-1.0.7.13-bin.zip - $ unzip jstock-1.0.7.13-bin.zip - $ cd jstock - $ chmod +x jstock.sh - $ ./jstock.sh - -In the rest of the tutorial, let me demonstrate several useful features of JStock. - -### Monitor Stock Price Movements via Watchlist ### - -On JStock you can monitor stock price movement and automatically get notified by creating one or more watchlists. In each watchlist, you can add multiple stocks you are interested in. Then add your alert thresholds under "Fall Below" and "Rise Above" columns, which correspond to minimum and maximum stock prices you want to set, respectively. - -![](https://c2.staticflickr.com/2/1588/23795349969_37f4b0f23c_c.jpg) - -For example, if you set minimum/maximum prices of AAPL stock to $102 and $115.50, you will be alerted via desktop notifications if the stock price goes below $102 or moves higher than $115.50 at any time. - -You can also enable email alert option, so that you will instead receive email notifications for such price events. To enable email alerts, go to "Options" menu. Under "Alert" tab, turn on "Send message to email(s)" box, and enter your Gmail account. Once you go through Gmail authorization steps, JStock will start sending email alerts to that Gmail account (and optionally CC to any third-party email address). - -![](https://c2.staticflickr.com/2/1644/24080560491_3aef056e8d_b.jpg) - -### Manage Multiple Portfolios ### - -JStock allows you to manage multiple portfolios. This feature is useful if you are using multiple stock brokers. You can create a separate portfolio for each broker and manage your buy/sell/dividend transactions on a per-broker basis. You can switch different portfolios by choosing a particular portfolio under "Portfolio" menu. The following screenshot shows a hypothetical portfolio. - -![](https://c2.staticflickr.com/2/1646/23536385433_df6c036c9a_c.jpg) - -Optionally you can enable broker fee option, so that you can enter any broker fees, stamp duty and clearing fees for each buy/sell transaction. If you are lazy, you can enable fee auto-calculation and enter fee schedules for each brokering firm from the option menu beforehand. Then JStock will automatically calculate and enter fees when you add transactions to your portfolio. - -![](https://c2.staticflickr.com/2/1653/24055085262_0e315c3691_b.jpg) - -### Screen Stocks with Built-in/Custom Indicators ### - -If you are doing any technical analysis on stocks, you may want to screen stocks based on various criteria (so-called "stock indicators"). For stock screening, JStock offers several [pre-built technical indicators][3] that capture upward/downward/reversal trends of individual stocks. The following is a list of available indicators. - -- Moving Average Convergence Divergence (MACD) -- Relative Strength Index (RSI) -- Money Flow Index (MFI) -- Commodity Channel Index (CCI) -- Doji -- Golden Cross, Death Cross -- Top Gainers/Losers - -To install any pre-built indicator, go to "Stock Indicator Editor" tab on JStock. Then click on "Install" button in the right-side panel. Choose "Install from JStock server" option, and then install any indicator(s) you want. - -![](https://c2.staticflickr.com/2/1476/23867534660_b6a9c95a06_c.jpg) - -Once one or more indicators are installed, you can scan stocks using them. Go to "Stock Indicator Scanner" tab, click on "Scan" button at the bottom, and choose any indicator. - -![](https://c2.staticflickr.com/2/1653/24137054996_e8fcd10393_c.jpg) - -Once you select the stocks to scan (e.g., NYSE, NASDAQ), JStock will perform scan, and show a list of stocks captured by the indicator. - -![](https://c2.staticflickr.com/2/1446/23795349889_0f1aeef608_c.jpg) - -Besides pre-built indicators, you can also define custom indicator(s) on your own with a GUI-based indicator editor. The following example screens for stocks whose current price is less than or equal to its 60-day average price. - -![](https://c2.staticflickr.com/2/1605/24080560431_3d26eac6b5_c.jpg) - -### Cloud Backup and Restore between Linux and Android JStock ### - -Another nice feature of JStock is cloud backup and restore. JStock allows you to save and restore your portfolios/watchlists via Google Drive, and this features works seamlessly across different platforms (e.g., Linux and Android). For example, if you saved your JStock portfolios to Google Drive on Android, you can restore them on Linux version of JStock. - -![](https://c2.staticflickr.com/2/1537/24163165565_bb47e04d6c_c.jpg) - -![](https://c2.staticflickr.com/2/1556/23536385333_9ed1a75d72_c.jpg) - -If you don't see your portfolios/watchlists after restoring from Google Drive, make sure that your country is correctly set under "Country" menu. - -JStock Android free version is available from [Google Play store][4]. You will need to upgrade to premium version for one-time payment if you want to use its full features (e.g., cloud backup, alerts, charts). I think the premium version is definitely worth it. - -![](https://c2.staticflickr.com/2/1687/23867534720_18b917028c_c.jpg) - -As a final note, I should mention that its creator, Yan Cheng Cheok, is pretty active in JStock development, and quite responsive in addressing any bugs. Kudos to him! - -What do you think of JStock as portfolio tracking software? - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/stock-portfolio-management-software-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]:http://jstock.org/ -[2]:http://ask.xmodulo.com/install-java-runtime-linux.html -[3]:http://jstock.org/ma_indicator.html -[4]:https://play.google.com/store/apps/details?id=org.yccheok.jstock.gui diff --git a/sources/tech/20160604 Microfluidic cooling may prevent the demise of Moore's Law.md b/sources/tech/20160604 Microfluidic cooling may prevent the demise of Moore's Law.md index 66548921e2..0dbd772a31 100644 --- a/sources/tech/20160604 Microfluidic cooling may prevent the demise of Moore's Law.md +++ b/sources/tech/20160604 Microfluidic cooling may prevent the demise of Moore's Law.md @@ -1,3 +1,4 @@ +Translating by ivo-wang Microfluidic cooling may prevent the demise of Moore's Law ============================================================ diff --git a/translated/tech/20160104 What is good stock portfolio management software on Linux.md b/translated/tech/20160104 What is good stock portfolio management software on Linux.md new file mode 100644 index 0000000000..32e1c8fb2a --- /dev/null +++ b/translated/tech/20160104 What is good stock portfolio management software on Linux.md @@ -0,0 +1,109 @@ +Translating by ivo-wang +What is good stock portfolio management software on Linux +linux上那些不错的管理股票组合投资软件 +================================================================================ +如果你在股票市场做投资,那么你可能非常清楚管理组合投资的计划有多重要。管理组合投资的目标是依据你能承受的风险,时间层面的长短和资金盈利的目标去为你量身打造的一种投资计划。鉴于这类软件的重要性,难怪从不缺乏商业性质的app和股票行情检测软件,每一个都可以兜售复杂的组合投资以及跟踪报告功能。 + +对于这些linux爱好者们,我们找到了一些 **好用的开源组合投资管理工具** 用来在linux上管理和跟踪股票的组合投资,这里高度推荐一个基于java编写的管理软件[JStock][1]。如果你不是一个java粉,你不得不面对这样一个事实JStock需要运行在重型的JVM环境上。同时我相信许多人非常欣赏JStock,安装JRE以后它可以非常迅速的安装在各个linux平台上。没有障碍能阻止你将它安装在你的linux环境中。 + +开源就意味着免费或标准低下的时代已经过去了。鉴于JStock只是一个个人完成的产物,作为一个组合投资管理软件它最令人印象深刻的是包含了非常多实用的功能,以上所有的荣誉属于它的作者Yan Cheng Cheok!例如,JStock 支持通过监视列表去监控价格,多种组合投资,按习惯/按固定 做股票指示与相关扫描,支持27个不同的股票市场和交易平台云端备份/还原。JStock支持多平台部署(Linux, OS X, Android 和 Windows),你可以通过云端保存你的JStock记录,它可以无缝的备份还原到其他的不同平台上面。 + +现在我将向你展示如何安装以及使用过程的一些具体细节。 + +### 在Linux上安装JStock ### + +因为JStock使用Java编写,所以必须[安装 JRE][2]才能让它运行起来.小提示JStock 需要JRE1.7或更高版本。如你的JRE版本不能满足这个需求,JStock将会安装失败然后出现下面的报错。 + + Exception in thread "main" java.lang.UnsupportedClassVersionError: org/yccheok/jstock/gui/JStock : Unsupported major.minor version 51.0 + + +一旦你安装了JRE在你的linux上,从官网下载最新的发布的JStock,然后加载启动它。 + + $ wget https://github.com/yccheok/jstock/releases/download/release_1-0-7-13/jstock-1.0.7.13-bin.zip + $ unzip jstock-1.0.7.13-bin.zip + $ cd jstock + $ chmod +x jstock.sh + $ ./jstock.sh + +教程的其他部分,让我来给大家展示一些JStock的实用功能 + +### 监视监控列表股票价格的波动 ### + +使用JStock你可以创建一个或多个监视列表,它可以自动的监视股票价格的波动并给你提供相应的通知。在每一个监视列表里面你可以添加多个感兴趣的股票进去。之后添加你的警戒值在"Fall Below"和"Rise Above"的表格里,分别是在设定最低价格和最高价格。 + +![](https://c2.staticflickr.com/2/1588/23795349969_37f4b0f23c_c.jpg) + +例如你设置了AAPL股票的最低/最高价格分别是$102 和 $115.50,你将在价格低于$102或高于$115.50的任意时间在桌面得到通知。 + +你也可以设置邮件通知,之后你将收到一些价格信息的邮件通知。设置邮件通知在栏的"Options"选项。在"Alert"标签,打开"Send message to email(s)",填入你的Gmail账户。一旦完成Gmail认证步骤,JStock将开始发送邮件通知到你的Gmail账户(也可以设置其他的第三方邮件地址) +![](https://c2.staticflickr.com/2/1644/24080560491_3aef056e8d_b.jpg) + +### 管理多个组合投资 ### + +JStock能够允许你管理多个组合投资。这个功能对于股票经纪人是非常实用的。你可以为经纪人创建一个投资项去管理你的 买入/卖出/红利 用来了解每一个经纪人的业务情况。你也可以切换不同的组合项目通过选择一个特殊项目在"Portfolio"菜单里面。下面是一张截图用来展示一个意向投资 +![](https://c2.staticflickr.com/2/1646/23536385433_df6c036c9a_c.jpg) + +因为能够设置付给经纪人小费的选项,所以你能付给经纪人任意的小费,印花税以及清空每一比交易的小费。如果你非常懒,你也可以在菜单里面设置自动计算小费和给每一个经纪人固定的小费。在完成交易之后JStock将自动的计算并发送小费。 + +![](https://c2.staticflickr.com/2/1653/24055085262_0e315c3691_b.jpg) + +### 显示固定/自选股票提示 ### + +如果你要做一些股票的技术分析,你可能需要不同股票的指数(这里叫做“平均股指”),对于股票的跟踪,JStock提供多个[预设技术指示器][3] 去获得股票上涨/下跌/逆转指数的趋势。下面的列表里面是一些可用的指示。 +- 异同平均线(MACD) +- 相对强弱指数 (RSI) +- 货币流通指数 (MFI) +- 顺势指标 (CCI) +- 十字线 +- 黄金交叉线, 死亡交叉线 +- 涨幅/跌幅 + +开启预设指示器能需要在JStock中点击"Stock Indicator Editor"标签。之后点击右侧面板中的安装按钮。选择"Install from JStock server"选项,之后安装你想要的指示器。 + +![](https://c2.staticflickr.com/2/1476/23867534660_b6a9c95a06_c.jpg) + +一旦安装了一个或多个指示器,你可以用他们来扫描股票。选择"Stock Indicator Scanner"标签,点击底部的"Scan"按钮,选择需要的指示器。 + +![](https://c2.staticflickr.com/2/1653/24137054996_e8fcd10393_c.jpg) + +当你选择完需要扫描的股票(例如e.g., NYSE, NASDAQ)以后,JStock将执行扫描,并将捕获的结果通过列表的形式展现在指示器上面。 + +![](https://c2.staticflickr.com/2/1446/23795349889_0f1aeef608_c.jpg) + +除了预设指示器以外,你也可以使用一个图形化的工具来定义自己的指示器。下面这张图例中展示的是当前价格小于或等于60天平均价格 + +![](https://c2.staticflickr.com/2/1605/24080560431_3d26eac6b5_c.jpg) + +### 云备份还原Linux 和 Android JStock ### + +另一个非常棒的功能是JStock可以支持云备份还原。Jstock也可以把你的组合投资/监视列表备份还原在 Google Drive,这个功能可以实现在不同平台(例如Linux和Android)上无缝穿梭。举个例子,如果你把Android Jstock组合投资的信息保存在Google Drive上,你可以在Linux班级本上还原他们。 + +![](https://c2.staticflickr.com/2/1537/24163165565_bb47e04d6c_c.jpg) + +![](https://c2.staticflickr.com/2/1556/23536385333_9ed1a75d72_c.jpg) + +如果你在从Google Drive还原之后不能看到你的投资信息以及监视列表,请确认你的国家信息与“Country”菜单里面设置的保持一致。 + +JStock的安卓免费版可以从[Google Play Store][4]获取到。如果你需要完整的功能(比如云备份,通知,图表等),你需要一次性支付费用升级到高级版。我想高级版肯定有它的价值所在。 + +![](https://c2.staticflickr.com/2/1687/23867534720_18b917028c_c.jpg) + +写在最后,我应该说一下它的作者,Yan Cheng Cheok,他是一个十分活跃的开发者,有bug及时反馈给他。最后多有的荣耀都属于他一个人!!! + +关于JStock这个组合投资跟踪软件你有什么想法呢? + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/stock-portfolio-management-software-linux.html + +作者:[Dan Nanni][a] +译者:[译者ID](https://github.com/ivo-wang) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/nanni +[1]:http://jstock.org/ +[2]:http://ask.xmodulo.com/install-java-runtime-linux.html +[3]:http://jstock.org/ma_indicator.html +[4]:https://play.google.com/store/apps/details?id=org.yccheok.jstock.gui From 9a1040eefb0441dc4cbc663d93ced4501f4b9ded Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 20 Jul 2016 10:08:23 +0800 Subject: [PATCH 1200/1469] =?UTF-8?q?20160720-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...EST TEXT EDITORS FOR LINUX COMMAND LINE.md | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 sources/tech/20160717 BEST TEXT EDITORS FOR LINUX COMMAND LINE.md diff --git a/sources/tech/20160717 BEST TEXT EDITORS FOR LINUX COMMAND LINE.md b/sources/tech/20160717 BEST TEXT EDITORS FOR LINUX COMMAND LINE.md new file mode 100644 index 0000000000..5e6a971fd9 --- /dev/null +++ b/sources/tech/20160717 BEST TEXT EDITORS FOR LINUX COMMAND LINE.md @@ -0,0 +1,92 @@ +BEST TEXT EDITORS FOR LINUX COMMAND LINE +========================================== + +![](https://itsfoss.com/wp-content/uploads/2016/07/Best-Command-Line-Text-Editors-for-Linux.jpg) + +A text editor is a must have application for any operating system. We have no dearth of [best modern editors for Linux][1]. But those are GUI based editors. + +As you know, the real power of Linux lies in the command line. And when you are working in command line, you would need a text editor that could work right inside the terminal. + +For that purpose, today we are going to make a list of best command line text editors for Linux. + +### [VIM][2] + +If you’re on Linux for quite some time, you must have heard about Vim. Vim is an extensively configurable, cross-platform and highly efficient text editor. + +Almost every Linux distribution comes with Vim pre-installed. It is extremely popular for its wide range of features. + +![](https://itsfoss.com/wp-content/uploads/2016/07/vim.png) +>Vim User Interface + +Vim can be quite agonizing for first-time users. I remember the first time I tried to edit a text file with Vim, I was completely puzzled. I couldn’t type a single letter on it and the funny part is, I couldn’t even figure out how to close this thing. If you are going to use Vim, you have to be determined for climbing up a very steep learning curve. + +But after you have gone through all that, combed through some documentations, remembered its commands and shortcuts you will find that the hassle was worth it. You can bend Vim to your will – customizing its interface however it seems fit to you, give your workflow a boost by using various user scripts, plugins and so on. Vim supports syntax highlighting, macro recording and action history. + +As in the official site, it is stated that, + +>**Vim: The power tool for everyone!** + +It is completely up to you how you will use it. You can just use it for simple text editing, or you can customize it to behave as a full-fledged IDE. + +### [GNU EMACS][3] + +GNU Emacs is undoubtedly one of the most powerful text editor out there. If you have heard about both Vim and Emacs, you should know that both of these editors have a very loyal fan-base and often they are very serious about their text editor of choice. And you can find lots of humor and stuff on the internet about it: + +Suggested Read [Download Linux Wallpapers That Are Also Cheat Sheets][4] + +![](https://itsfoss.com/wp-content/uploads/2016/07/vi-emacs-768x426.png) +>Vim vs Emacs + +Emacs is cross-platform and has both command-line and graphical user interface. It is also very rich with various features and, most importantly, extensible. + +![](https://itsfoss.com/wp-content/uploads/2016/07/emacs.png) +>Emacs User Interface + +Just as Vim, Emacs too comes with a steep learning curve. But once you master it, you can completely leverage its power. Emacs can handle just about any types of text files. The interface is customizable to suit your workflow. It supports macro recording and shortcuts. + +The unique power of Emacs is that it can be transformed into something completely different from a text editor. There is a large collection of modules that can transform the application for using in completely different scenarios, like – calendar, news reader, word processor etc. You can even play games in Emacs! + +### [NANO][5] + +When it comes to simplicity, Nano is the one. Unlike Vim or Emacs, the learning curve for nano is almost flat. + +If you want to simply create & edit a text file and get on with your life, look no further than Nano. + +![](https://itsfoss.com/wp-content/uploads/2016/07/nano.png) +>Nano User Interface + +The shortcuts available on Nano are displayed at the bottom of the user interface. Nano includes only the basic functions of a text editor. + +It is minimal and perfectly suitable for editing system & configuration files. For those who doesn’t need advanced features from a command-line text editor, Nano is the perfect match. + +### OTHERS + +There is one more editor I’d like to mention: + +[The Nice Editor (ne)][6]: The official site says, + +>If you have the resources and the patience to use emacs or the right mental twist to use vi then probably ne is not for you. + +Basically, ne features many advanced features like Vim or Emacs, including – scripting and macro recording. But it comes with a more intuitive control and not so steep learning curve. + +### WHAT DO YOU THINK? + +I know that if you are a seasoned Linux user, you’ll say these are the obvious candidates for the list of best command line text editors for Linux. Therefore, I would like to ask you, if there are some other command line text editors for Linux that you want to share with us? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/command-line-text-editors-linux/?utm_source=newsletter&utm_medium=email&utm_campaign=ubuntu_forums_hacked_new_skype_for_linux_and_more_linux_stories + +作者:[Munif Tanjim][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/munif/ +[1]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/ +[2]: http://www.vim.org/ +[3]: https://www.gnu.org/software/emacs/ +[4]: https://itsfoss.com/download-linux-wallpapers-cheat-sheets/ +[5]: http://www.nano-editor.org/ +[6]: http://ne.di.unimi.it/ From 5cfa37d4e01949e3152f202c6e312ce8b8026b47 Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 20 Jul 2016 10:23:33 +0800 Subject: [PATCH 1201/1469] =?UTF-8?q?20160720-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ramming or Source Code Editors on Linux.md | 304 ++++++++++++++++++ 1 file changed, 304 insertions(+) create mode 100644 sources/tech/20160630 18 Best IDEs for C+C++ Programming or Source Code Editors on Linux.md diff --git a/sources/tech/20160630 18 Best IDEs for C+C++ Programming or Source Code Editors on Linux.md b/sources/tech/20160630 18 Best IDEs for C+C++ Programming or Source Code Editors on Linux.md new file mode 100644 index 0000000000..105ee90faa --- /dev/null +++ b/sources/tech/20160630 18 Best IDEs for C+C++ Programming or Source Code Editors on Linux.md @@ -0,0 +1,304 @@ +18 Best IDEs for C/C++ Programming or Source Code Editors on Linux +====================================================================== + +C++, an extension of well known C language, is an excellent, powerful and general purpose programming language that offers modern and generic programming features for developing large-scale applications ranging from video games, search engines, other computer software to operating systems. + +C++ is highly reliable and also enables low-level memory manipulation for more advanced programming requirements. + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Best-Linux-IDE-Editors.png) + +There are several text editors out there that programmers can use to write C/C++ code, but IDE have come up to offer comprehensive facilities and components for easy and ideal programming. + +In this article, we shall look at some of the best IDE’s you can find on the Linux platform for C++ or any other programming. + +### 1. Netbeans for C/C++ Development + +Netbeans is a free, open-source and popular cross-platform IDE for C/C++ and many other programming languages. Its fully extensible using community developed plugins. + +It includes project types and templates for C/C++ and you can build applications using static and dynamic libraries. Additionally, you can reuse existing code to create your projects, and also use drag and drop feature to import binary files into it to build applications from the ground. + +Let us look at some of its features: + +- The C/C++ editor is well integrated with multi-session [GNU GDB][1] debugger tool. +- Support for code assistance +- C++11 support +- Create and run C/C++ tests from within +- Qt toolkit support +- Support for automatic packaging of compiled application into .tar, .zip and many more archive files +- Support for multiple compilers such as GNU, Clang/LLVM, Cygwin, Oracle Solaris Studio and MinGW +- Support for remote development +- File navigation +- Source inspection + +![](http://www.tecmint.com/wp-content/uploads/2016/06/NetBeans-IDE.png) +>Visit Homepage: + +### 2. Code::Blocks + +Code::Blocks is a free, highly extensible and configurable, cross-platform C++ IDE built to offer users the most demanded and ideal features. It delivers a consistent user interface and feel. + +And most importantly, you can extend its functionality by using plugins developed by users, some of the plugins are part of Code::Blocks release and many are not, written by individual users not part of the Code::Block development team. + +Its features are categorized into compiler, debugger and interface features and these include: + +Multiple compiler support including GCC, clang, Borland C++ 5.5, digital mars plus many more +Very fast, no need for makefiles +Multi-target projects +Workspace that supports combining of projects +Interfaces GNU GDB +Support for full breakpoints including code breakpoints, data breakpoints, breakpoint conditions plus many more +display local functions symbols and arguments +custom memory dump and syntax highlighting +Customizable and extensible interface plus many more other features including those added through user built plugins + +![](http://www.tecmint.com/wp-content/uploads/2016/06/CodeBlocks-IDE-for-Linux.png) +>Visit Homepage: + +### 3. Eclipse CDT(C/C++ Development Tooling) + +Eclipse is a well known open-source, cross-platform IDE in the programming arena. It offers users a great GUI with support for drag and drop functionality for easy arrangement of interface elements. + +The Eclipse CDT is a project based on the primary Eclipse platform and it provides a full functional C/C++ IDE with following features: + +- Supports project creation +- Managed build for various toolchains +- Standard make build +- Source navigation +- Several knowledge tools such as call graph, type hierarchy, in-built browser, macro definition browser +- Code editor with support for syntax highlighting +- Support for folding and hyperlink navigation +- Source code refactoring plus code generation +- Tools for visual debugging such as memory, registers +- Disassembly viewers and many more + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Eclipse-IDE-for-Linux.png) +>Visit Homepage: + +### 4. CodeLite IDE + +CodeLite is also a free, open-source, cross-platform IDE designed and built specifically for C/C++, JavaScript (Node.js) and PHP programming. + +Some of its main features include: + +- Code completion, and it offers two code completion engines +- Supports several compilers including GCC, clang/VC++ +- Displays errors as code glossary +- Clickable errors via build tab +- Support for LLDB next generation debugger +- GDB support +- Support for refactoring +- Code navigation +- Remote development using built-in SFTP +- Source control plugins +- RAD (Rapid Application Development) tool for developing wxWidgets-based apps plus many more features + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Codelite-IDE.png) +>Visit Homepage: + +### 6. Bluefish Editor + +Bluefish is a more than just a normal editor, it is a lightweight, fast editor that offers programmers IDE like features for developing websites, writing scripts and software code. It is multi-platform, runs on Linux, Mac OSX, FreeBSD, OpenBSD, Solaris and Windows, and also supports many programming languages including C/C++. + +It is feature rich including the ones listed below: + +- Multiple document interface +- Supports recursive opening of files based on filename patterns or content pattern +- Offers a very powerful search and replace functionality +- Snippet sidebar +- Support for integrating external filters of your own, pipe documents using commands such as awk, sed, sort plus custom built scripts +- Supports full screen editing +- Site uploader and downloader +- Multiple encoding support and many more other features + +![](http://www.tecmint.com/wp-content/uploads/2016/06/BlueFish-IDE-Editor-for-Linux.png) +>Visit Homepage: + +### 7. Brackets Code Editor + +Brackets is a modern and open-source text editor designed specifically for web designing and development. It is highly extensible through plugins, therefore C/C++ programmers can use it by installing the C/C++/Objective-C pack extension, this pack is designed to enhance C/C++ code writing and to offer IDE like features. + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Brackets-Code-Editor-for-Linux.png) +>Visit Homepage: + +### 8. Atom Code Editor + +Atom is also a modern, open-source, multi-platform text editor that can run on Linux, Windows or Mac OS X. It is also hackable down to its base, therefore users can customize it to meet their code writing demands. + +It is fully featured and some of its main features include: + +- Built-in package manager +- Smart auto-completion +- In-built file browser +- Find and replace functionality and many more + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Atom-Code-Editor-for-Linux.png) +>Visit Homepage: >https://atom.io/> +>Installation Instructions: + +### 9. Sublime Text Editor + +Sublime Text is a well refined, multi-platform text editor designed and developed for code, markup and prose. You can use it for writing C/C++ code and offers a great user interface. + +It’s features list comprises of: + +- Multiple selections +- Command palette +- Goto anything functionality +- Distraction free mode +- Split editing +- Instant project switching support +- Highly customizable +- Plugin API support based on Python plus other small features + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Sublime-Code-Editor-for-Linux.png) +>Visit Homepage: +>Installation Instructions: + +### 10. JetBrains CLion + +CLion is a non-free, powerful and cross-platform IDE for C/C++ programming. It is a fully integrated C/C++ development environment for programmers, providing Cmake as a project model, an embedded terminal window and a keyboard oriented approach to code writing. + +It also offers a smart and modern code editor plus many more exciting features to enable an ideal code writing environment and these features include: + +- Supports several languages other than C/C++ +- Easy navigation to symbol declarations or context usage +- Code generation and refactoring +- Editor customization +- On-the-fly code analysis +- An integrated code debugger +- Supports Git, Subversion, Mercurial, CVS, Perforce(via plugin) and TFS +- Seamlessly integrates with Google test frameworks +- Support for Vim text editor via Vim-emulation plugin + +![](http://www.tecmint.com/wp-content/uploads/2016/06/JetBains-CLion-IDE.png) +>Visit Homepage: + +### 11. Microsoft’s Visual Studio Code Editor + +Visual Studio is a rich, fully integrated, cross-platform development environment that runs on Linux, Windows and Mac OS X. It was recently made open-source to Linux users and it has redefined code editing, offering users every tool needed for building every app for multiple platforms including Windows, Android, iOS and the web. + +It is feature full, with features categorized under application development, application lifecycle management, and extend and integrate features. You can read a comprehensive features list from the Visual Studio website. + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Visual-Studio-Code-Editor.png) +>Visit Homepage: + +### 12. KDevelop + +KDevelop is just another free, open-source and cross-platform IDE that works on Linux, Solaris, FreeBSD, Windows, Mac OSX and other Unix-like operating systems. It is based on the KDevPlatform, KDE and Qt libraries. KDevelop is highly extensible through plugins and feature rich with the following notable features: + +- Support for Clang-based C/C++ plugin +- KDE 4 config migration support +- Revival of Oketa plugin support +- Support for different line editings in various views and plugins +- Support for Grep view and Uses widget to save vertical space plus many more + +![](http://www.tecmint.com/wp-content/uploads/2016/06/KDevelop-IDE-Editor.png) +>Visit Homepage: + +### 13. Geany IDE + +Geany is a free, fast, lightweight and cross-platform IDE developed to work with few dependencies and also operate independently from popular Linux desktops such as GNOME and KDE. It requires GTK2 libraries for functionality. + +Its features list consists of the following: + +- Support for syntax highlighting +- Code folding +- Call tips +- Symbol name auto completion +- Symbol lists +- Code navigation +- A simple project management tool +- In-built system to compile and run a users code +- Extensible through plugins + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Geany-IDE-for-Linux.png) +>Visit Homepage: + +### 14. Ajunta DeveStudio + +Ajunta DevStudio is a simple GNOME yet powerful software development studio that supports several programming languages including C/C++. + +It offers advanced programming tools such as project management, GUI designer, interactive debugger, application wizard, source editor, version control plus so many other facilities. Additionally, to above features, Ajunta DevStudio also has some other great IDE features and these include: + +- Simple user interface +- Extensible with plugins +- Integrated Glade for WYSIWYG UI development +- Project wizards and templates +- Integrated GDB debugger +- In-built file manager +- Integrated DevHelp for context sensitive programming help +- Source code editor with features such as syntax highlighting, smart indentation, auto-indentation, code folding/hiding, text zooming plus many more + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Anjuta-DevStudio-for-Linux.png) +>Visit Homepage: + +### 15. The GNAT Programming Studio + +The GNAT Programming Studio is a free easy to use IDE designed and developed to unify the interaction between a developer and his/her code and software. + +Built for ideal programming by facilitating source navigation while highlighting important sections and ideas of a program. It is also designed to offer a high-level of programming comfortability, enabling users to developed comprehensive systems from the ground. + +It is feature rich with the following features: + +- - Intuitive user interface +- Developer friendly +- Multi-lingual and multi-platform +- Flexible MDI(multiple document interface) +- Highly customizable +- Fully extensible with preferred tools + +![](http://www.tecmint.com/wp-content/uploads/2016/06/GNAT-Programming-Studio.jpg) +>Visit Homepage: + +### 16. Qt Creator + +It is a non-free, cross-platform IDE designed for creation of connected devices, UIs and applications. Qt creator enables users to do more of creation than actual coding of applications. + +It can be used to create mobile and desktop applications, and also connected embedded devices. + +Some of its features include: + +- Sophisticated code editor +- Support for version control +- Project and build management tools +- Multi-screen and multi-platform support for easy switching between build targets plus many more + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Qt-Creator.png) +>Visit Homepage: + +### 17. Emacs Editor + +Emacs is a free, powerful, highly extensible and customizable, cross-platform text editors you can use on Linux, Solaris, FreeBSD, NetBSD, OpenBSD, Windows and Mac OS X. + +The core of Emacs is also an interpreter for Emacs Lisp which is a language under the Lisp programming language. As of this writing, the latest release of GNU Emacs is version 24.5 and the fundamental and notable features of Emacs include: + +- Content-aware editing modes +- Full Unicode support +- Highly customizable using GUI or Emacs Lisp code +- A packaging system for downloading and installing extensions +- Ecosystem of functionalities beyond normal text editing including project planner, mail, calender and news reader plus many more +- A complete built-in documentation plus user tutorials and many more + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Emacs-Editor.png) +>Visit Homepage: https://www.gnu.org/software/emacs/ + +### 18. VI/VIM Editor + +Vim an improved version of VI editor, is a free, powerful, popular and highly configurable text editor. It is built to enable efficient text editing, and offers exciting editor features for Unix/Linux users, therefore, it is also a good option for writing and editing C/C++ code. + +Generally, IDEs offer more programming comfortability then traditional text editors, therefore it is always a good idea to use them. They come with exciting features and offer a comprehensive development environment, sometimes programmers are caught up between choosing the best IDE to use for C/C++ programming. + +There many other IDEs you can find out there and download from the Internet, but trying out several of them can help you find that which suites your needs. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/best-linux-ide-editors-source-code-editors/ + +作者:[Aaron Kili][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/aaronkili/ +[1]: http://www.tecmint.com/debug-source-code-in-linux-using-gdb/ From e791c68d54912b69de11463eb79f0a402077928a Mon Sep 17 00:00:00 2001 From: ivo_wang Date: Wed, 20 Jul 2016 13:01:03 +0800 Subject: [PATCH 1202/1469] Update 20160104 What is good stock portfolio management software on Linux.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更新译者id --- ...What is good stock portfolio management software on Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20160104 What is good stock portfolio management software on Linux.md b/translated/tech/20160104 What is good stock portfolio management software on Linux.md index 32e1c8fb2a..7e0c8a05fd 100644 --- a/translated/tech/20160104 What is good stock portfolio management software on Linux.md +++ b/translated/tech/20160104 What is good stock portfolio management software on Linux.md @@ -97,7 +97,7 @@ JStock的安卓免费版可以从[Google Play Store][4]获取到。如果你需 via: http://xmodulo.com/stock-portfolio-management-software-linux.html 作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/ivo-wang) +译者:[ivo-wang](https://github.com/ivo-wang) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 50bbf61ef9777a82374d99a043fa346f36243fad Mon Sep 17 00:00:00 2001 From: chenzhijun <522858454@qq.com> Date: Wed, 20 Jul 2016 21:33:02 +0800 Subject: [PATCH 1203/1469] Translating by chenzhijun --- .../tech/20160717 BEST TEXT EDITORS FOR LINUX COMMAND LINE.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sources/tech/20160717 BEST TEXT EDITORS FOR LINUX COMMAND LINE.md b/sources/tech/20160717 BEST TEXT EDITORS FOR LINUX COMMAND LINE.md index 5e6a971fd9..80f4b1439c 100644 --- a/sources/tech/20160717 BEST TEXT EDITORS FOR LINUX COMMAND LINE.md +++ b/sources/tech/20160717 BEST TEXT EDITORS FOR LINUX COMMAND LINE.md @@ -1,3 +1,6 @@ +Translating by chenzhijun + + BEST TEXT EDITORS FOR LINUX COMMAND LINE ========================================== From 35f4c778177360089743cfbf035d75157cdb6cd0 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 20 Jul 2016 23:07:08 +0800 Subject: [PATCH 1204/1469] PUB:Part 3 - How to Use Awk to Filter Text or Strings Using Pattern Specific Actions @FSSlc --- ... Strings Using Pattern Specific Actions.md | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) rename {translated/tech/awk => published}/Part 3 - How to Use Awk to Filter Text or Strings Using Pattern Specific Actions.md (72%) diff --git a/translated/tech/awk/Part 3 - How to Use Awk to Filter Text or Strings Using Pattern Specific Actions.md b/published/Part 3 - How to Use Awk to Filter Text or Strings Using Pattern Specific Actions.md similarity index 72% rename from translated/tech/awk/Part 3 - How to Use Awk to Filter Text or Strings Using Pattern Specific Actions.md rename to published/Part 3 - How to Use Awk to Filter Text or Strings Using Pattern Specific Actions.md index ef91e93575..53e9aabd68 100644 --- a/translated/tech/awk/Part 3 - How to Use Awk to Filter Text or Strings Using Pattern Specific Actions.md +++ b/published/Part 3 - How to Use Awk to Filter Text or Strings Using Pattern Specific Actions.md @@ -1,11 +1,11 @@ -如何使用 Awk 来筛选文本或字符串 +awk 系列:如何使用 awk 按模式筛选文本或字符串 ========================================================================= ![](http://www.tecmint.com/wp-content/uploads/2016/04/Use-Awk-to-Filter-Text-or-Strings-Using-Pattern.png) -作为 Awk 命令系列的第三部分,这次我们将看一看如何基于用户定义的特定模式来筛选文本或字符串。 +作为 awk 命令系列的第三部分,这次我们将看一看如何基于用户定义的特定模式来筛选文本或字符串。 -在筛选文本时,有时你可能想根据某个给定的条件或使用一个特定的可被匹配的模式,去标记某个文件或数行字符串中的某几行。使用 Awk 来完成这个任务是非常容易的,这也正是 Awk 中可能对你有所帮助的几个特色之一。 +在筛选文本时,有时你可能想根据某个给定的条件或使用一个可被匹配的特定模式,去标记某个文件或数行字符串中的某几行。使用 awk 来完成这个任务是非常容易的,这也正是 awk 中可能对你有所帮助的几个功能之一。 让我们看一看下面这个例子,比方说你有一个写有你想要购买的食物的购物清单,其名称为 food_prices.list,它所含有的食物名称及相应的价格如下所示: @@ -28,9 +28,10 @@ $ awk '/ *\$[2-9]\.[0-9][0-9] */ { print $1, $2, $3, $4, "*" ; } / *\$[0-1]\.[0- ``` ![](http://www.tecmint.com/wp-content/uploads/2016/04/Filter-and-Print-Text-Using-Awk.gif) ->打印出单价大于 $2 的项目 -从上面的输出你可以看到在含有 芒果(mangoes) 和 菠萝(pineapples) 的那行末尾都已经有了一个 `(*)` 标记。假如你检查它们的单价,你可以看到它们的单价的确超过了 $2 。 +*打印出单价大于 $2 的项目* + +从上面的输出你可以看到在含有 芒果(mangoes) 和菠萝(pineapples)的那行末尾都已经有了一个 `(*)` 标记。假如你检查它们的单价,你可以看到它们的单价的确超过了 $2 。 在这个例子中,我们已经使用了两个模式: @@ -39,33 +40,35 @@ $ awk '/ *\$[2-9]\.[0-9][0-9] */ { print $1, $2, $3, $4, "*" ; } / *\$[0-1]\.[0- 上面的命令具体做了什么呢?这个文件有四个字段,当模式一匹配到含有食物单价大于 $2 的行时,它便会输出所有的四个字段并在该行末尾加上一个 `(*)` 符号来作为标记。 -第二个模式只是简单地输出其他含有食物单价小于 $2 的行,因为它们出现在输入文件 food_prices.list 中。 +第二个模式只是简单地输出其他含有食物单价小于 $2 的行,按照它们出现在输入文件 food_prices.list 中的样子。 这样你就可以使用模式来筛选出那些价格超过 $2 的食物项目,尽管上面的输出还有些问题,带有 `(*)` 符号的那些行并没有像其他行那样被格式化输出,这使得输出显得不够清晰。 -我们在 Awk 系列的第二部分中也看到了同样的问题,但我们可以使用下面的两种方式来解决: +我们在 awk 系列的第二部分中也看到了同样的问题,但我们可以使用下面的两种方式来解决: -1. 可以像下面这样使用 printf 命令,但这样使用又长又无聊: +1、可以像下面这样使用 printf 命令,但这样使用又长又无聊: ``` $ awk '/ *\$[2-9]\.[0-9][0-9] */ { printf "%-10s %-10s %-10s %-10s\n", $1, $2, $3, $4 "*" ; } / *\$[0-1]\.[0-9][0-9] */ { printf "%-10s %-10s %-10s %-10s\n", $1, $2, $3, $4; }' food_prices.list ``` ![](http://www.tecmint.com/wp-content/uploads/2016/04/Filter-and-Print-Items-Using-Awk-and-Printf.gif) ->使用 Awk 和 Printf 来筛选和输出项目 -2. 使用 `$0` 字段。Awk 使用变量 **0** 来存储整个输入行。对于上面的问题,这种方式非常方便,并且它还简单、快速: +*使用 Awk 和 Printf 来筛选和输出项目* + +2、 使用 `$0` 字段。Awk 使用变量 **0** 来存储整个输入行。对于上面的问题,这种方式非常方便,并且它还简单、快速: ``` $ awk '/ *\$[2-9]\.[0-9][0-9] */ { print $0 "*" ; } / *\$[0-1]\.[0-9][0-9] */ { print ; }' food_prices.list ``` ![](http://www.tecmint.com/wp-content/uploads/2016/04/Filter-and-Print-Items-Using-Awk-and-Variable.gif) ->使用 Awk 和变量来筛选和输出项目 + +*使用 Awk 和变量来筛选和输出项目* ### 结论 -这就是全部内容了,使用 Awk 命令你便可以通过几种简单的方法去利用模式匹配来筛选文本,帮助你在一个文件中对文本或字符串的某些行做标记。 +这就是全部内容了,使用 awk 命令你便可以通过几种简单的方法去利用模式匹配来筛选文本,帮助你在一个文件中对文本或字符串的某些行做标记。 希望这篇文章对你有所帮助。记得阅读这个系列的下一部分,我们将关注在 awk 工具中使用比较运算符。 @@ -75,7 +78,7 @@ via: http://www.tecmint.com/awk-filter-text-or-string-using-patterns/ 作者:[Aaron Kili][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 38f868b22f6cf03a66e52259e385aef17d9c34ca Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 20 Jul 2016 23:08:01 +0800 Subject: [PATCH 1205/1469] =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E5=88=B0=E7=9B=AE?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...k and Regular Expressions to Filter Text or String in Files.md | 0 ...Part 2 - How to Use Awk to Print Fields and Columns in File.md | 0 ...wk to Filter Text or Strings Using Pattern Specific Actions.md | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename published/{ => awk}/Part 1 - How to Use Awk and Regular Expressions to Filter Text or String in Files.md (100%) rename published/{ => awk}/Part 2 - How to Use Awk to Print Fields and Columns in File.md (100%) rename published/{ => awk}/Part 3 - How to Use Awk to Filter Text or Strings Using Pattern Specific Actions.md (100%) diff --git a/published/Part 1 - How to Use Awk and Regular Expressions to Filter Text or String in Files.md b/published/awk/Part 1 - How to Use Awk and Regular Expressions to Filter Text or String in Files.md similarity index 100% rename from published/Part 1 - How to Use Awk and Regular Expressions to Filter Text or String in Files.md rename to published/awk/Part 1 - How to Use Awk and Regular Expressions to Filter Text or String in Files.md diff --git a/published/Part 2 - How to Use Awk to Print Fields and Columns in File.md b/published/awk/Part 2 - How to Use Awk to Print Fields and Columns in File.md similarity index 100% rename from published/Part 2 - How to Use Awk to Print Fields and Columns in File.md rename to published/awk/Part 2 - How to Use Awk to Print Fields and Columns in File.md diff --git a/published/Part 3 - How to Use Awk to Filter Text or Strings Using Pattern Specific Actions.md b/published/awk/Part 3 - How to Use Awk to Filter Text or Strings Using Pattern Specific Actions.md similarity index 100% rename from published/Part 3 - How to Use Awk to Filter Text or Strings Using Pattern Specific Actions.md rename to published/awk/Part 3 - How to Use Awk to Filter Text or Strings Using Pattern Specific Actions.md From 83bde07deb1e230de7f82ef82992fe622231ebd2 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 20 Jul 2016 23:32:20 +0800 Subject: [PATCH 1206/1469] PUB:Part 11 - How to Manage and Create LVM Using vgcreate, lvcreate and lvextend Commands.md @martin2011qi --- ...gcreate, lvcreate and lvextend Commands.md | 37 +++++++++++-------- 1 file changed, 22 insertions(+), 15 deletions(-) rename {translated/tech => published}/LFCS/Part 11 - How to Manage and Create LVM Using vgcreate, lvcreate and lvextend Commands.md (88%) diff --git a/translated/tech/LFCS/Part 11 - How to Manage and Create LVM Using vgcreate, lvcreate and lvextend Commands.md b/published/LFCS/Part 11 - How to Manage and Create LVM Using vgcreate, lvcreate and lvextend Commands.md similarity index 88% rename from translated/tech/LFCS/Part 11 - How to Manage and Create LVM Using vgcreate, lvcreate and lvextend Commands.md rename to published/LFCS/Part 11 - How to Manage and Create LVM Using vgcreate, lvcreate and lvextend Commands.md index 84b9db7968..49ac0e34f4 100644 --- a/translated/tech/LFCS/Part 11 - How to Manage and Create LVM Using vgcreate, lvcreate and lvextend Commands.md +++ b/published/LFCS/Part 11 - How to Manage and Create LVM Using vgcreate, lvcreate and lvextend Commands.md @@ -1,14 +1,15 @@ LFCS 系列第十一讲:如何使用命令 vgcreate、lvcreate 和 lvextend 管理和创建 LVM -============================================================================================ +======================================================================================== 由于 LFCS 考试中的一些改变已在 2016 年 2 月 2 日生效,我们添加了一些必要的专题到 [LFCS 系列][1]。我们也非常推荐备考的同学,同时阅读 [LFCE 系列][2]。 ![](http://www.tecmint.com/wp-content/uploads/2016/03/Manage-LVM-and-Create-LVM-Partition-in-Linux.png) ->LFCS:管理 LVM 和创建 LVM 分区 -在安装 Linux 系统的时候要做的最重要的决定之一便是给系统文件,home 目录等分配空间。在这个地方犯了错,再要增长空间不足的分区,那样既麻烦又有风险。 +*LFCS:管理 LVM 和创建 LVM 分区* -**逻辑卷管理** (即 **LVM**)相较于传统的分区管理有许多优点,已经成为大多数(如果不能说全部的话) Linux 发行版安装时的默认选择。LVM 最大的优点应该是能方便的按照你的意愿调整(减小或增大)逻辑分区的大小。 +在安装 Linux 系统的时候要做的最重要的决定之一便是给系统文件、home 目录等分配空间。在这个地方犯了错,再要扩大空间不足的分区,那样既麻烦又有风险。 + +**逻辑卷管理** (**LVM**)相较于传统的分区管理有许多优点,已经成为大多数(如果不能说全部的话) Linux 发行版安装时的默认选择。LVM 最大的优点应该是能方便的按照你的意愿调整(减小或增大)逻辑分区的大小。 LVM 的组成结构: @@ -16,7 +17,7 @@ LVM 的组成结构: * 一个用一个或多个物理卷创建出的卷组(**VG**)。可以把一个卷组想象成一个单独的存储单元。 * 在一个卷组上可以创建多个逻辑卷。每个逻辑卷相当于一个传统意义上的分区 —— 优点是它的大小可以根据需求重新调整大小,正如之前提到的那样。 -本文,我们将使用三块 **8 GB** 的磁盘(**/dev/sdb**、**/dev/sdc** 和 **/dev/sdd**)分别创建三个物理卷。你既可以直接在设备上创建 PV,也可以先分区在创建。 +本文,我们将使用三块 **8 GB** 的磁盘(**/dev/sdb**、**/dev/sdc** 和 **/dev/sdd**)分别创建三个物理卷。你既可以直接在整个设备上创建 PV,也可以先分区在创建。 在这里我们选择第一种方式,如果你决定使用第二种(可以参考本系列[第四讲:创建分区和文件系统][3])确保每个分区的类型都是 `8e`。 @@ -59,7 +60,8 @@ LVM 的组成结构: 由于 `vg00` 是由两个 **8 GB** 的磁盘组成的,所以它将会显示成一个 **16 GB** 的硬盘: ![](http://www.tecmint.com/wp-content/uploads/2016/03/List-LVM-Volume-Groups.png) ->LVM 卷组列表 + +*LVM 卷组列表* 当谈到创建逻辑卷,空间的分配必须考虑到当下和以后的需求。根据每个逻辑卷的用途来命名是一个好的做法。 @@ -78,7 +80,7 @@ LVM 的组成结构: # lvs ``` -或是详细信息,通过: +或是查看详细信息,通过: ``` # lvdisplay @@ -91,9 +93,10 @@ LVM 的组成结构: ``` ![](http://www.tecmint.com/wp-content/uploads/2016/03/List-Logical-Volume.png) ->逻辑卷列表 -如上图,我们看到 LV 已经被创建成存储设备了(参考 LV Path line)。在使用每个逻辑卷之前,需要先在上面创建文件系统。 +*逻辑卷列表* + +如上图,我们看到 LV 已经被创建成存储设备了(参考 LV Path 那一行)。在使用每个逻辑卷之前,需要先在上面创建文件系统。 这里我们拿 ext4 来做举例,因为对于每个 LV 的大小, ext4 既可以增大又可以减小(相对的 xfs 就只允许增大): @@ -116,7 +119,8 @@ LVM 的组成结构: ``` ![](http://www.tecmint.com/wp-content/uploads/2016/03/Resize-Reduce-Logical-Volume-and-Volume-Group.png) ->减小逻辑卷和卷组 + +*减小逻辑卷和卷组* 在调整逻辑卷的时候,其中包含的减号 `(-)` 或加号 `(+)` 是十分重要的。否则 LV 将会被设置成指定的大小,而非调整指定大小。 @@ -135,7 +139,8 @@ LVM 的组成结构: ``` ![](http://www.tecmint.com/wp-content/uploads/2016/03/List-Volume-Group-Size.png) ->查看卷组磁盘大小 + +*查看卷组磁盘大小* 现在,你可以使用新加的空间,按照你的需求调整现有 LV 的大小,或者创建一个新的 LV。 @@ -151,7 +156,8 @@ LVM 的组成结构: ``` ![](http://www.tecmint.com/wp-content/uploads/2016/03/Find-Logical-Volume-UUID.png) ->寻找逻辑卷的 UUID + +*寻找逻辑卷的 UUID* 为每个 LV 创建挂载点: @@ -175,7 +181,8 @@ UUID=e1929239-5087-44b1-9396-53e09db6eb9e /home/backups ext4 defaults 0 0 ``` ![](http://www.tecmint.com/wp-content/uploads/2016/03/Mount-Logical-Volumes-on-Linux-1.png) ->挂载逻辑卷 + +*挂载逻辑卷* 在涉及到 LV 的实际使用时,你还需要按照曾在本系列[第八讲:管理用户和用户组][4]中讲解的那样,为其设置合适的 `ugo+rwx`。 @@ -193,7 +200,7 @@ via: http://www.tecmint.com/manage-and-create-lvm-parition-using-vgcreate-lvcrea 作者:[Gabriel Cánepa][a] 译者:[martin2011qi](https://github.com/martin2011qi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -202,5 +209,5 @@ via: http://www.tecmint.com/manage-and-create-lvm-parition-using-vgcreate-lvcrea [2]: http://www.tecmint.com/installing-network-services-and-configuring-services-at-system-boot/ [3]: https://linux.cn/article-7187-1.html [4]: https://linux.cn/article-7418-1.html -[5]: http://www.tecmint.com/create-lvm-storage-in-linux/ +[5]: https://linux.cn/article-3965-1.html [6]: https://linux.cn/article-7229-1.html From 8174e5f671921e3ae2bb131c39a2b25eb613f5b9 Mon Sep 17 00:00:00 2001 From: "zenghow.fw" Date: Thu, 21 Jul 2016 01:02:58 +0800 Subject: [PATCH 1207/1469] =?UTF-8?q?=E7=94=B3=E9=A2=86=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...IDEs for C+C++ Programming or Source Code Editors on Linux.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160630 18 Best IDEs for C+C++ Programming or Source Code Editors on Linux.md b/sources/tech/20160630 18 Best IDEs for C+C++ Programming or Source Code Editors on Linux.md index 105ee90faa..01fb7c5c22 100644 --- a/sources/tech/20160630 18 Best IDEs for C+C++ Programming or Source Code Editors on Linux.md +++ b/sources/tech/20160630 18 Best IDEs for C+C++ Programming or Source Code Editors on Linux.md @@ -1,3 +1,4 @@ +translating by fw8899 18 Best IDEs for C/C++ Programming or Source Code Editors on Linux ====================================================================== From 20e234e4b4dc946915d963183a1c559338145a59 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 21 Jul 2016 01:44:59 +0800 Subject: [PATCH 1208/1469] PUB:20160620 Detecting cats in images with OpenCV MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @MikeCoder 翻译中,如无特殊原因,应当尽量忠实原文 --- ...20 Detecting cats in images with OpenCV.md | 227 +++++++++++++++++ ...20 Detecting cats in images with OpenCV.md | 228 ------------------ 2 files changed, 227 insertions(+), 228 deletions(-) create mode 100644 published/20160620 Detecting cats in images with OpenCV.md delete mode 100644 translated/tech/20160620 Detecting cats in images with OpenCV.md diff --git a/published/20160620 Detecting cats in images with OpenCV.md b/published/20160620 Detecting cats in images with OpenCV.md new file mode 100644 index 0000000000..55b80cc51e --- /dev/null +++ b/published/20160620 Detecting cats in images with OpenCV.md @@ -0,0 +1,227 @@ +使用 OpenCV 识别图片中的猫咪 +======================================= + +![](http://www.pyimagesearch.com/wp-content/uploads/2016/05/cat_face_detector_result_04.jpg) + +你知道 OpenCV 可以识别在图片中小猫的脸吗?而且是拿来就能用,不需要其它的库之类的。 + +之前我也不知道。 + +但是在 [Kendrick Tan 曝出这个功能][1]后,我需要亲自体验一下……去看看到 OpenCV 是如何在我没有察觉到的情况下,将这一个功能添加进了他的软件库(就像一只悄悄溜进空盒子的猫咪一样,等待别人发觉)。 + +下面,我将会展示如何使用 OpenCV 的猫咪检测器在图片中识别小猫的脸。同样的,该技术也可以用在视频流中。 + +### 使用 OpenCV 在图片中检测猫咪 + +如果你查找过 [OpenCV 的代码仓库][3],尤其是在 [haarcascades 目录][4]里(OpenCV 在这里保存处理它预先训练好的 Haar 分类器,以检测各种物体、身体部位等), 你会看到这两个文件: + +- haarcascade_frontalcatface.xml +- haarcascade\_frontalcatface\_extended.xml + +这两个 Haar Cascade 文件都将被用来在图片中检测小猫的脸。实际上,我使用了相同的 cascades 分类器来生成这篇博文顶端的图片。 + +在做了一些调查工作之后,我发现这些 cascades 分类器是由鼎鼎大名的 [Joseph Howse][5]训练和贡献给 OpenCV 仓库的,他写了很多很棒的教程和书籍,在计算机视觉领域有着很高的声望。 + +下面,我将会展示给你如何使用 Howse 的 Haar cascades 分类器来检测图片中的小猫。 + +### 猫咪检测代码 + +让我们开始使用 OpenCV 来检测图片中的猫咪。新建一个叫 cat_detector.py 的文件,并且输入如下的代码: + +``` +# import the necessary packages +import argparse +import cv2 + +# construct the argument parse and parse the arguments +ap = argparse.ArgumentParser() +ap.add_argument("-i", "--image", required=True, + help="path to the input image") +ap.add_argument("-c", "--cascade", + default="haarcascade_frontalcatface.xml", + help="path to cat detector haar cascade") +args = vars(ap.parse_args()) +``` + +第 2 和第 3 行主要是导入了必要的 python 包。6-12 行用于解析我们的命令行参数。我们仅要求一个必需的参数 `--image` ,它是我们要使用 OpenCV 检测猫咪的图片。 + +我们也可以(可选的)通过 `--cascade` 参数指定我们的 Haar cascade 分类器的路径。默认使用 `haarcascades_frontalcatface.xml`,假定这个文件和你的 `cat_detector.py` 在同一目录下。 + +注意:我已经打包了猫咪的检测代码,还有在这个教程里的样本图片。你可以在博文原文的 “下载” 部分下载到。如果你是刚刚接触 Python+OpenCV(或者 Haar cascade),我建议你下载这个 zip 压缩包,这个会方便你跟着教程学习。 + +接下来,就是检测猫的时刻了: + +``` +# load the input image and convert it to grayscale +image = cv2.imread(args["image"]) +gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) + +# load the cat detector Haar cascade, then detect cat faces +# in the input image +detector = cv2.CascadeClassifier(args["cascade"]) +rects = detector.detectMultiScale(gray, scaleFactor=1.3, + minNeighbors=10, minSize=(75, 75)) +``` + +在 15、16 行,我们从硬盘上读取了图片,并且进行灰度化(这是一个在将图片传给 Haar cascade 分类器之前的常用的图片预处理步骤,尽管不是必须的) + +20 行,从硬盘加载 Haar casacade 分类器,即猫咪检测器,并且实例化 `cv2.CascadeClassifier` 对象。 + +在 21、22 行通过调用 `detector` 的 `detectMultiScale` 方法使用 OpenCV 完成猫脸检测。我们给 `detectMultiScale` 方法传递了四个参数。包括: + +1. 图片 `gray`,我们要在该图片中检测猫脸。 +2. 检测猫脸时的[图片金字塔][6] 的检测粒度 `scaleFactor` 。更大的粒度将会加快检测的速度,但是会对检测准确性( true-positive)产生影响。相反的,一个更小的粒度将会影响检测的时间,但是会增加准确性( true-positive)。但是,细粒度也会增加误报率(false-positive)。你可以看这篇博文的“ Haar cascades 注意事项”部分来获得更多的信息。 +3. `minNeighbors` 参数控制了检定框的最少数量,即在给定区域内被判断为猫脸的最少数量。这个参数可以很好的排除误报(false-positive)结果。 +4. 最后,`minSize` 参数不言自明。这个值描述每个检定框的最小宽高尺寸(单位是像素),这个例子中就是 75\*75 + +`detectMultiScale` 函数会返回 `rects`,这是一个 4 元组列表。这些元组包含了每个检测到的猫脸的 (x,y) 坐标值,还有宽度、高度。 + +最后,让我们在图片上画下这些矩形来标识猫脸: + +``` +# loop over the cat faces and draw a rectangle surrounding each +for (i, (x, y, w, h)) in enumerate(rects): + cv2.rectangle(image, (x, y), (x + w, y + h), (0, 0, 255), 2) + cv2.putText(image, "Cat #{}".format(i + 1), (x, y - 10), + cv2.FONT_HERSHEY_SIMPLEX, 0.55, (0, 0, 255), 2) + +# show the detected cat faces +cv2.imshow("Cat Faces", image) +cv2.waitKey(0) +``` + +给我们这些框(比如,rects)的数据,我们在 25 行依次遍历它。 + +在 26 行,我们在每张猫脸的周围画上一个矩形。27、28 行展示了一个整数,即图片中猫咪的数量。 + +最后,31,32 行在屏幕上展示了输出的图片。 + +### 猫咪检测结果 + +为了测试我们的 OpenCV 猫咪检测器,可以在原文的最后,下载教程的源码。 + +然后,在你解压缩之后,你将会得到如下的三个文件/目录: + +1. cat_detector.py:我们的主程序 +2. haarcascade_frontalcatface.xml: 猫咪检测器 Haar cascade +3. images:我们将会使用的检测图片目录。 + +到这一步,执行以下的命令: + +``` +$ python cat_detector.py --image images/cat_01.jpg +``` + +![](http://www.pyimagesearch.com/wp-content/uploads/2016/05/cat_face_detector_result_01.jpg) + +*图 1. 在图片中检测猫脸,甚至是猫咪部分被遮挡了。* + +注意,我们已经可以检测猫脸了,即使它的其余部分是被遮挡的。 + +试下另外的一张图片: + +``` +python cat_detector.py --image images/cat_02.jpg +``` + +![](http://www.pyimagesearch.com/wp-content/uploads/2016/05/cat_face_detector_result_02.jpg) + +*图 2. 使用 OpenCV 检测猫脸的第二个例子,这次猫脸稍有不同。* + +这次的猫脸和第一次的明显不同,因为它正在发出“喵呜”叫声的当中。这种情况下,我们依旧能检测到正确的猫脸。 + +在下面这张图片的结果也是正确的: + +``` +$ python cat_detector.py --image images/cat_03.jpg +``` + +![](http://www.pyimagesearch.com/wp-content/uploads/2016/05/cat_face_detector_result_03.jpg) + +*图 3. 使用 OpenCV 和 python 检测猫脸* + +我们最后的一个样例就是在一张图中检测多张猫脸: + +``` +$ python cat_detector.py --image images/cat_04.jpg +``` + +![](http://www.pyimagesearch.com/wp-content/uploads/2016/05/cat_face_detector_result_04.jpg) + +*图 4. 在同一张图片中使用 OpenCV 检测多只猫* + +注意,Haar cascade 返回的检定框不一定是以你预期的顺序。这种情况下,中间的那只猫会被标记成第三只。你可以通过判断他们的 (x, y) 坐标来自己排序这些检定框。 + +#### 关于精度的说明 + +在这个 xml 文件中的注释非常重要,Joseph Hower 提到了这个猫脸检测器有可能会将人脸识别成猫脸。 + +这种情况下,他推荐使用两种检测器(人脸 & 猫脸),然后将出现在人脸识别结果中的结果剔除掉。 + +#### Haar cascades 注意事项 + +这个方法首先出现在 Paul Viola 和 Michael Jones 2001 年出版的 [Rapid Object Detection using a Boosted Cascade of Simple Features][7] 论文中。现在它已经成为了计算机识别领域引用最多的论文之一。 + +这个算法能够识别图片中的对象,无论它们的位置和比例。而且最令人感兴趣的或许是它能在现有的硬件条件下实现实时检测。 + +在他们的论文中,Viola 和 Jones 关注在训练人脸检测器;但是,这个框架也能用来检测各类事物,如汽车、香蕉、路标等等。 + +#### 问题是? + +Haar cascades 最大的问题就是如何确定 `detectMultiScale` 方法的参数正确。特别是 `scaleFactor` 和 `minNeighbors` 参数。你很容易陷入一张一张图片调参数的坑,这个就是该对象检测器很难被实用化的原因。 + +这个 `scaleFactor` 变量控制了用来检测对象的图片的各种比例的[图像金字塔][8]。如果 `scaleFactor` 参数过大,你就只需要检测图像金字塔中较少的层,这可能会导致你丢失一些在图像金字塔层之间缩放时少了的对象。 + +换句话说,如果 `scaleFactor` 参数过低,你会检测过多的金字塔图层。这虽然可以能帮助你检测到更多的对象。但是他会造成计算速度的降低,还会**明显**提高误报率。Haar cascades 分类器就是这样。 + +为了避免这个,我们通常使用 [Histogram of Oriented Gradients + 线性 SVM 检测][9] 替代。 + +上述的 HOG + 线性 SVM 框架的参数更容易调优。而且更好的误报率也更低,但是唯一不好的地方是无法实时运算。 + +### 对对象识别感兴趣?并且希望了解更多? + +![](http://www.pyimagesearch.com/wp-content/uploads/2016/05/custom_object_detector_example.jpg) + +*图 5. 在 PyImageSearch Gurus 课程中学习如何构建自定义的对象识别器。* + +如果你对学习如何训练自己的自定义对象识别器感兴趣,请务必要去了解下 PyImageSearch Gurus 课程。 + +在这个课程中,我提供了 15 节课,覆盖了超过 168 页的教程,来教你如何从 0 开始构建自定义的对象识别器。你会掌握如何应用 HOG + 线性 SVM 框架来构建自己的对象识别器来识别路标、面孔、汽车(以及附近的其它东西)。 + +要学习 PyImageSearch Gurus 课程(有 10 节示例免费课程),点此:https://www.pyimagesearch.com/pyimagesearch-gurus/?src=post-cat-detection + +### 总结 + +在这篇博文里,我们学习了如何使用 OpenCV 默认就有的 Haar cascades 分类器来识别图片中的猫脸。这些 Haar casacades 是由 [Joseph Howse][9] 训练兵贡献给 OpenCV 项目的。我是在 Kendrick Tan 的[这篇文章][10]中开始注意到这个。 + +尽管 Haar cascades 相当有用,但是我们也经常用 HOG + 线性 SVM 替代。因为后者相对而言更容易使用,并且可以有效地降低误报率。 + +我也会[在 PyImageSearch Gurus 课程中][11]详细的讲述如何构建定制的 HOG + 线性 SVM 对象识别器,来识别包括汽车、路标在内的各种事物。 + +不管怎样,我希望你喜欢这篇博文。 + +-------------------------------------------------------------------------------- + +via: http://www.pyimagesearch.com/2016/06/20/detecting-cats-in-images-with-opencv/ + +作者:[Adrian Rosebrock][a] +译者:[MikeCoder](https://github.com/MikeCoder) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.pyimagesearch.com/author/adrian/ +[1]: http://kendricktan.github.io/find-cats-in-photos-using-computer-vision.html +[2]: http://www.pyimagesearch.com/2016/06/20/detecting-cats-in-images-with-opencv/# +[3]: https://github.com/Itseez/opencv +[4]: https://github.com/Itseez/opencv/tree/master/data/haarcascades +[5]: http://nummist.com/ +[6]: http://www.pyimagesearch.com/2015/03/16/image-pyramids-with-python-and-opencv/ +[7]: https://www.cs.cmu.edu/~efros/courses/LBMV07/Papers/viola-cvpr-01.pdf +[8]: http://www.pyimagesearch.com/2015/03/16/image-pyramids-with-python-and-opencv/ +[9]: http://www.pyimagesearch.com/2014/11/10/histogram-oriented-gradients-object-detection/ +[10]: http://kendricktan.github.io/find-cats-in-photos-using-computer-vision.html +[11]: https://www.pyimagesearch.com/pyimagesearch-gurus/ + + + diff --git a/translated/tech/20160620 Detecting cats in images with OpenCV.md b/translated/tech/20160620 Detecting cats in images with OpenCV.md deleted file mode 100644 index 9b1e19fef7..0000000000 --- a/translated/tech/20160620 Detecting cats in images with OpenCV.md +++ /dev/null @@ -1,228 +0,0 @@ -使用 OpenCV 识别图片中的猫 -======================================= - -![](http://www.pyimagesearch.com/wp-content/uploads/2016/05/cat_face_detector_result_04.jpg) - -你知道 OpenCV 可以识别在图片中识别猫脸吗?还是在开箱即用的情况下,无需多余的附件。 - -我也不知道。 - -但是在看完'[Kendrick Tan broke the story][1]'这个故事之后, 我需要亲自体验一下...去看看到OpenCV 是如何在我没有察觉到的情况下,将这一个功能添加进了他的软件库。 - -作为这个博客的大纲,我将会展示如何使用 OpenCV 的猫检测器在图片中识别猫脸。同样的,你也可以在视频流中使用该技术。 - -> 想找这篇博客的源码?[请点这][2]。 - - -### 使用 OpenCV 在图片中检测猫 - -如果你看一眼[OpenCV 的代码库][3],尤其是在[haarcascades 目录][4](OpenCV 用来保存处理他对多种目标检测的Cascade预先训练的级联图像分类), 你将会注意到这两个文件: - -- haarcascade_frontalcatface.xml -- haarcascade_frontalcatface_extended.xml - -这两个 Haar Cascade 文件都将被用来在图片中检测猫脸。实际上,我使用了相同的方式来生成这篇博客顶端的图片。 - -在做了一些调查工作之后,我发现训练这些记过并且将其提供给 OpenCV 仓库的是鼎鼎大名的 [Joseph Howse][5],他在计算机视觉领域有着很高的声望。 - -在博客的剩余部分,我将会展示给你如何使用 Howse 的 Haar 级联模型来检测猫。 - -让我们开工。新建一个叫 cat_detector.py 的文件,并且输入如下的代码: - -### 使用 OpenCVPython 来检测猫 - -``` -# import the necessary packages -import argparse -import cv2 - -# construct the argument parse and parse the arguments -ap = argparse.ArgumentParser() -ap.add_argument("-i", "--image", required=True, - help="path to the input image") -ap.add_argument("-c", "--cascade", - default="haarcascade_frontalcatface.xml", - help="path to cat detector haar cascade") -args = vars(ap.parse_args()) -``` - -第2和第3行主要是导入了必要的 python 包。6-12行主要是我们的命令行参数。我们在这只需要使用单独的参数'--image'。 - -我们可以指定一个 Haar cascade 的路径通过 `--cascade` 参数。默认使用 `haarcascades_frontalcatface.xml`,同时需要保证这个文件和你的 `cat_detector.py` 在同一目录下。 - -注意:我已经打包了猫的检测代码,还有在这个教程里的样本图片。你可以在博客的'Downloads' 部分下载到。如果你是刚刚接触 Python+OpenCV(或者 Haar 级联模型), 我会建议你下载 zip 压缩包,这个会方便你进行操作。 - -接下来,就是检测猫的时刻了: - -``` -# load the input image and convert it to grayscale -image = cv2.imread(args["image"]) -gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) - -# load the cat detector Haar cascade, then detect cat faces -# in the input image -detector = cv2.CascadeClassifier(args["cascade"]) -rects = detector.detectMultiScale(gray, scaleFactor=1.3, - minNeighbors=10, minSize=(75, 75)) -``` - -在15,16行,我们从硬盘上读取了图片,并且进行灰度化(一个常用的图片预处理,方便 Haar cascade 进行分类,尽管不是必须) - -20行,我们加载了Haar casacade,即猫检测器,并且初始化了 cv2.CascadeClassifier 对象。 - -使用 OpenCV 检测猫脸的步骤是21,22行,通过调用 detectMultiScale 方法。我们使用四个参数来调用。包括: - -1. 灰度化的图片,即样本图片。 -2. scaleFactor 参数,[图片金字塔][6]使用的检测猫脸时的检测粒度。一个更大的粒度将会加快检测的速度,但是会对准确性产生影响。相反的,一个更小的粒度将会影响检测的时间,但是会增加正确性。但是,细粒度也会增加错误的检测数量。你可以看博客的 'Haar 级联模型笔记' 部分来获得更多的信息。 -3. minNeighbors 参数控制了检测的最小数量,即在给定区域最小的检测猫脸的次数。这个参数很好的可以排除错误的检测结果。 -4. 最后,minSize 参数很好的自我说明了用途。即最后图片的最小大小,这个例子中就是 75\*75 - -detectMultiScale 函数 return rects,这是一个4维数组链表。这些item 中包含了猫脸的(x,y)坐标值,还有宽度,高度。 - -最后,让我们在图片上画下这些矩形来标识猫脸: - -``` -# loop over the cat faces and draw a rectangle surrounding each -for (i, (x, y, w, h)) in enumerate(rects): - cv2.rectangle(image, (x, y), (x + w, y + h), (0, 0, 255), 2) - cv2.putText(image, "Cat #{}".format(i + 1), (x, y - 10), - cv2.FONT_HERSHEY_SIMPLEX, 0.55, (0, 0, 255), 2) - -# show the detected cat faces -cv2.imshow("Cat Faces", image) -cv2.waitKey(0) -``` - -给相关的区域(举个例子,rects),我们在25行依次历遍它。 - -在26行,我们在每张猫脸的周围画上一个矩形。27,28行展示了一个整数,即图片中猫的数量。 - -最后,31,32行在屏幕上展示了输出的图片。 - -### 猫检测结果 - -为了测试我们的 OpenCV 毛检测器,可以在文章的最后,下载教程的源码。 - -然后,在你解压缩之后,你将会得到如下的三个文件/目录: - -1. cat_detector.py:我们的主程序 -2. haarcascade_frontalcatface.xml: Haar cascade 猫检测资源 -3. images:我们将会使用的检测图片目录。 - -到这一步,执行以下的命令: - -使用 OpenCVShell 检测猫。 - -``` -$ python cat_detector.py --image images/cat_01.jpg -``` - -![](http://www.pyimagesearch.com/wp-content/uploads/2016/05/cat_face_detector_result_01.jpg) ->1. 在图片中检测猫脸,甚至是猫的一部分。 - -注意,我们已经可以检测猫脸了,即使他的其余部分是被隐藏的。 - -试下另外的一张图片: - -``` -python cat_detector.py --image images/cat_02.jpg -``` - -![](http://www.pyimagesearch.com/wp-content/uploads/2016/05/cat_face_detector_result_02.jpg) ->2. 第二个例子就是在略微不同的猫脸中检测。 - -这次的猫脸和第一次的明显不同,因为它在'Meow'的中央。这种情况下,我们依旧能检测到正确的猫脸。 - -这张图片的结果也是正确的: - -``` -$ python cat_detector.py --image images/cat_03.jpg -``` - -![](http://www.pyimagesearch.com/wp-content/uploads/2016/05/cat_face_detector_result_03.jpg) ->3. 使用 OpenCV 和 python 检测猫脸 - -我们最后的一个样例就是在一张图中检测多张猫脸: - -``` -$ python cat_detector.py --image images/cat_04.jpg -``` - -![](http://www.pyimagesearch.com/wp-content/uploads/2016/05/cat_face_detector_result_04.jpg) ->Figure 4: Detecting multiple cats in the same image with OpenCV ->4. 在同一张图片中使用 OpenCV 检测多只猫 - -注意,Haar cascade 的返回值并不是有序的。这种情况下,中间的那只猫会被标记成第三只。你可以通过判断他们的(x, y)坐标来自己排序。 - -#### 精度的 Tips - -xml 文件中的注释,非常重要,Joseph Hower 提到了猫 脸检测器有可能会将人脸识别成猫脸。 - -这种情况下,他推荐使用两种检测器(人脸&猫脸),然后将出现在人脸识别结果中的结果剔除掉。 - -#### Haar 级联模型注意事项 - -这个方法首先出现在 Paul Viola 和 Michael Jones 2001 年发布的 [Rapid Object Detection using a Boosted Cascade of Simple Features] 论文中。现在它已经成为了计算机识别领域引用最多的成果之一。 - -这个算法能够识别图片中的对象,无论地点,规模。并且,他也能在现有的硬件条件下实现实时计算。 - -在他们的论文中,Viola 和 Jones 关注在训练人脸检测器;但是,这个框架也能用来检测各类事物,如汽车,香蕉,路标等等。 - -#### 有问题? - -Haar 级联模型最大的问题就是如何确定 detectMultiScale 方法的参数正确。特别是 scaleFactor 和 minNeighbors 参数。你很容易陷入,一张一张图片调参数的坑,这个就是该模型很难被实用化的原因。 - -这个 scaleFactor 变量控制了用来检测图片各种对象的[图像棱锥图][8]。如何参数过大,你就会得到更少的特征值,这会导致你无法在图层中识别一些目标。 - -换句话说,如果参数过低,你会检测出过多的图层。这虽然可以能帮助你检测更多的对象。但是他会造成计算速度的降低还会提高错误率。 - -为了避免这个,我们通常使用[Histogram of Oriented Gradients + Linear SVM detection][9]。 - -HOG + 线性 SVM 框架,它的参数更加容易的进行调优。而且也有更低的错误识别率,但是最大的缺点及时无法实时运算。 - -### 对对象识别感兴趣?并且希望了解更多? - -![](http://www.pyimagesearch.com/wp-content/uploads/2016/05/custom_object_detector_example.jpg) ->5. 在 PyImageSearch Gurus 课程中学习如何构建自定义的对象识别器。 - -如果你对学习如何训练自己的自定义对象识别器,请务必要去学习 PyImageSearch Gurus 的课程。 - -在这个课程中,我提供了15节课还有超过168页的教程,来教你如何从0开始构建自定义的对象识别器。你会掌握如何应用 HOG+线性 SVM 计算框架来构建自己的对象识别器。 - -### 总结 - -在这篇博客里,我们学习了如何使用默认的 Haar 级联模型来识别图片中的猫脸。这些 Haar casacades 是通过[Joseph Howse][9] 贡献给 OpenCV 项目的。我是在[这篇文章][10]中开始注意到这个。 - -尽管 Haar 级联模型相当有用,但是我们也经常用 HOG 和 线性 SVM 替代。因为后者相对而言更容易使用,并且可以有效地降低错误的识别概率。 - -我也会在[在 PyImageSearch Gurus 的课程中][11]详细的讲述如何使用 HOG 和线性 SVM 对象识别器,来识别包括汽车,路标在内的各种事物。 - -不管怎样,我希望你享受这篇博客。 - -在你离开之前,确保你会使用这下面的表单注册 PyImageSearch Newsletter。这样你能收到最新的消息。 - --------------------------------------------------------------------------------- - -via: http://www.pyimagesearch.com/2016/06/20/detecting-cats-in-images-with-opencv/ - -作者:[Adrian Rosebrock][a] -译者:[译者ID](https://github.com/MikeCoder) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://www.pyimagesearch.com/author/adrian/ -[1]: http://kendricktan.github.io/find-cats-in-photos-using-computer-vision.html -[2]: http://www.pyimagesearch.com/2016/06/20/detecting-cats-in-images-with-opencv/# -[3]: https://github.com/Itseez/opencv -[4]: https://github.com/Itseez/opencv/tree/master/data/haarcascades -[5]: http://nummist.com/ -[6]: http://www.pyimagesearch.com/2015/03/16/image-pyramids-with-python-and-opencv/ -[7]: https://www.cs.cmu.edu/~efros/courses/LBMV07/Papers/viola-cvpr-01.pdf -[8]: http://www.pyimagesearch.com/2015/03/16/image-pyramids-with-python-and-opencv/ -[9]: http://www.pyimagesearch.com/2014/11/10/histogram-oriented-gradients-object-detection/ -[10]: http://kendricktan.github.io/find-cats-in-photos-using-computer-vision.html -[11]: https://www.pyimagesearch.com/pyimagesearch-gurus/ - - - From 552b4d3cfd324bf904208853ed9af150520be66c Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 21 Jul 2016 17:11:25 +0800 Subject: [PATCH 1209/1469] =?UTF-8?q?20160721-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...1 5 tricks for getting started with Vim.md | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 sources/tech/20160721 5 tricks for getting started with Vim.md diff --git a/sources/tech/20160721 5 tricks for getting started with Vim.md b/sources/tech/20160721 5 tricks for getting started with Vim.md new file mode 100644 index 0000000000..8f622770f5 --- /dev/null +++ b/sources/tech/20160721 5 tricks for getting started with Vim.md @@ -0,0 +1,60 @@ +5 tricks for getting started with Vim +===================================== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/education/BUSINESS_peloton.png?itok=nuMbW9d3) + +For years, I've wanted to learn Vim, now my preferred Linux text editor and a favorite open source tool among developers and system administrators. And when I say learn, I mean really learn. Master is probably too strong a word, but I'd settle for advanced proficiency. For most of my years using Linux, my skillset included the ability to open a file, use the arrow keys to navigate up and down, switch into insert mode, change some text, save, and exit. + +But that's like minimum-viable-Vim. My skill level enabled me edit text documents from the terminal, but hasn't actually empowered me with any of the text editing super powers I've always imagined were possible. And it didn't justify using Vim over the totally capable Pico or Nano. + +So why learn Vim at all? Because I do spend an awful lot of time editing text, and I know I could be more efficient at it. And why not Emacs, or a more modern editor like Atom? Because Vim works for me, and at least I have some minimal experience in it. And perhaps, importantly, because it's rare that I encounter a system that I'm working on which doesn't have Vim or it's less-improved cousin (vi) available on it already. If you've always had a desire to learn Emacs, more power to you—I hope the Emacs-analog of these tips will prove useful to you, too. + +A few weeks in to this concentrated effort to up my Vim-use ability, the number one tip I have to share is that you actually must use the tool. While it seems like a piece of advice straight from Captain Obvious, I actually found it considerably harder than I expected to stay in the program. Most of my work happens inside of a web browser, and I had to untrain my trigger-like opening of (Gedit) every time I needed to edit a block of text outside of a browser. Gedit had made its way to my quick launcher, and so step one was removing this shortcut and putting Vim there instead. + +I've tried a number of things that have helped me learn. Here's a few of them I would recommend if you're looking to learn as well. + +### Vimtutor + +Sometimes the best place to get started isn't far from the application itself. I found Vimtutor, a tiny application that is basically a tutorial in a text file that you edit as you learn, to be as helpful as anything else in showing me the basics of the commands I had skipped learning through the years. Vimtutor is typically found everywhere Vim is, and is an easy install from your package manager if it's not already on your system. + +### GVim + +I know not everyone will agree with this one, but I found it useful to stop using the version of Vim that lives in my terminal and start using GVim for my basic editing needs. Naysayers will argue that it encourages using the mouse in an environment designed for keyboards, but I found it helpful to be able to quickly find the command I was looking for in a drop-down menu, reminding myself of the correct command, and then executing it with a keyboard. The alternative was often frustration at the inability to figure out how to do something, which is not a good feeling to be under constantly as you struggle to learn a new editor. No, stopping every few minutes to read a man page or use a search engine to remind you of a key sequence is not the best way to learn something new. + +### Keyboard maps + +Along with switching to GVim, I also found it handy to have a keyboard "cheat sheet" handy to remind me of the basic keystrokes. There are many available on the web that you can download, print, and set beside your station, but I opted for buying a set of stickers for my laptop keyboard. They were less than ten dollars US and had the added bonus of being a subtle reminder every time I used the laptop to at least try out one new thing as I edited. + +### Vimium + +As I mentioned, I live in the web browser most of the day. One of the tricks I've found helpful to reinforce the Vim way of navigation is to use [Vimium][1], an open source extension for Chrome that makes Chrome mimick the shortcuts used by Vim. I've found the fewer times I switch contexts for the keyboard shortcuts I'm using, the more likely I am to actually use them. Similar extensions, like [Vimerator][2], exist for Firefox. + +### Other human beings + +Without a doubt, there's no better way to get help learning something new than to get advice, feedback, and solutions from other people who have gone down a path before you. + +If you live in a larger urban area, there might be a Vim meetup group near you. Otherwise, the place to be is the #vim channel on Freenode IRC. One of the more popular channels on Freenode, the #vim channel is always full of helpful individuals willing to offer help with your problems. I find it interesting just to listen to the chatter and see what sorts of problems others are trying to solve to see what I'm missing out on. + +------ + +And so what to make of this effort? So far, so good. The time spent has probably yet to pay for itself in terms of time saved, but I'm always mildly surprised and amused when I find myself with a new reflex, jumping words with the right keypress sequence, or some similarly small feat. I can at least see that every day, the investment is bringing itself a little closer to payoff. + +These aren't the only tricks for learning Vim, by far. I also like to point people towards [Vim Adventures][3], an online game in which you navigate using the Vim keystrokes. And just the other day I came across a marvelous visual learning tool at [Vimgifs.com][4], which is exactly what you might expect it to be: illustrated examples with Vim so small they fit nicely in a gif. + +Have you invested the time to learn Vim, or really, any program with a keyboard-heavy interface? What worked for you, and, did you think the effort was worth it? Has your productivity changed as much as you thought it would? Lets share stories in the comments below. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/16/7/tips-getting-started-vim + +作者:[Jason Baker ][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jason-baker +[1]: https://github.com/philc/vimium +[2]: http://www.vimperator.org/ +[3]: http://vim-adventures.com/ +[4]: http://vimgifs.com/ From 4355b496dccbdab0150f406edb83ce1c1d0f66eb Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 21 Jul 2016 17:20:25 +0800 Subject: [PATCH 1210/1469] =?UTF-8?q?20160721-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0718 Creating your first Git repository.md | 177 ++++++++++++++++++ 1 file changed, 177 insertions(+) create mode 100644 sources/tech/20160718 Creating your first Git repository.md diff --git a/sources/tech/20160718 Creating your first Git repository.md b/sources/tech/20160718 Creating your first Git repository.md new file mode 100644 index 0000000000..0a9df8740b --- /dev/null +++ b/sources/tech/20160718 Creating your first Git repository.md @@ -0,0 +1,177 @@ +Creating your first Git repository +====================================== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/open_abstract_pieces.jpg?itok=ZRt0Db00) + +Now it is time to learn how to create your own Git repository, and how to add files and make commits. + +In the previous installments in this series, you learned how to interact with Git as an end user; you were the aimless wanderer who stumbled upon an open source project's website, cloned a repository, and moved on with your life. You learned that interacting with Git wasn't as confusing as you may have thought it would be, and maybe you've been convinced that it's time to start leveraging Git for your own work. + +While Git is definitely the tool of choice for major software projects, it doesn't only work with major software projects. It can manage your grocery lists (if they're that important to you, and they may be!), your configuration files, a journal or diary, a novel in progress, and even source code! + +And it is well worth doing; after all, when have you ever been angry that you have a backup copy of something that you've just mangled beyond recognition? + +Git can't work for you unless you use it, and there's no time like the present. Or, translated to Git, "There is no push like origin HEAD". You'll understand that later, I promise. + +### The audio recording analogy + +We tend to speak of computer imaging in terms of snapshots because most of us can identify with the idea of having a photo album filled with particular moments in time. It may be more useful, however, to think of Git more like an analogue audio recording. + +A traditional studio tape deck, in case you're unfamiliar, has a few components: it contains the reels that turn either forward or in reverse, tape to preserve sound waves, and a playhead to record or detect sound waves on tape and present them to the listener. + +In addition to playing a tape forward, you can rewind it to get back to a previous point in the tape, or fast-forward to skip ahead to a later point. + +Imagine a band in the 1970s recording to tape. You can imagine practising a song over and over until all the parts are perfect, and then laying down a track. First, you record the drums, and then the bass, and then the guitar, and then the vocals. Each time you record, the studio engineer rewinds the tape and puts it into loop mode so that it plays the previous part as you play yours; that is, if you're on bass, you get to hear the drums in the background as you play, and then the guitarist hears the drums and bass (and cowbell) and so on. On each loop, you play over the part, and then on the following loop, the engineer hits the record button and lays the performance down on tape. + +You can also copy and swap out a reel of tape entirely, should you decide to do a re-mix of something you're working on. + +Now that I've hopefully painted a vivid Roger Dean-quality image of studio life in the 70s, let's translate that into Git. + +### Create a Git repository + +The first step is to go out and buy some tape for our virtual tape deck. In Git terms, that's the repository ; it's the medium or domain where all the work is going to live. + +Any directory can become a Git repository, but to begin with let's start a fresh one. It takes three commands: + +- Create the directory (you can do that in your GUI file manager, if you prefer). +- Visit that directory in a terminal. +- Initialise it as a directory managed by Git. + +Specifically, run these commands: + +``` +$ mkdir ~/jupiter # make directory +$ cd ~/jupiter # change into the new directory +$ git init . # initialise your new Git repo +``` + +Is this example, the folder jupiter is now an empty but valid Git repository. + +That's all it takes. You can clone the repository, you can go backward and forward in history (once it has a history), create alternate timelines, and everything else Git can normally do. + +Working inside the Git repository is the same as working in any directory; create files, copy files into the directory, save files into it. You can do everything as normal; Git doesn't get involved until you involve it. + +In a local Git repository, a file can have one of three states: + +- Untracked: a file you create in a repository, but not yet added to Git. +- Tracked: a file that has been added to Git. +- Staged: a tracked file that has been changed and added to Git's commit queue. + +Any file that you add to a Git repository starts life out as an untracked file. The file exists on your computer, but you have not told Git about it yet. In our tape deck analogy, the tape deck isn't even turned on yet; the band is just noodling around in the studio, nowhere near ready to record yet. + +That is perfectly acceptable, and Git will let you know when it happens: + +``` +$ echo "hello world" > foo +$ git status +On branch master +Untracked files: +(use "git add ..." to include in what will be committed) + foo +nothing added but untracked files present (use "git add" to track) +``` + +As you can see, Git also tells you how to start tracking files. + +### Git without Git + +Creating a repository in GitHub or GitLab is a lot more clicky and pointy. It isn't difficult; you click the New Repository button and follow the prompts. + +It is a good practice to include a README file so that people wandering by have some notion of what your repository is for, and it is a little more satisfying to clone a non-empty repository. + +Cloning the repository is no different than usual, but obtaining permission to write back into that repository on GitHub is slightly more complex, because in order to authenticate to GitHub you must have an SSH key. If you're on Linux, create one with this command: + +``` +$ ssh-keygen +``` + +Then copy your new key, which is plain text. You can open it in a plain text editor, or use the cat command: + +``` +$ cat ~/.ssh/id_rsa.pub +``` + +Now paste your key into [GitHub's SSH configuration][1], or your [GitLab configuration][2]. + +As long as you clone your GitHub project via SSH, you'll be able to write back to your repository. + +Alternately, you can use GitHub's file uploader interface to add files without even having Git on your system. + +![](https://opensource.com/sites/default/files/2_githubupload.jpg) + +### Tracking files + +As the output of git status tells you, if you want Git to start tracking a file, you must git add it. The git add action places a file in a special staging area, where files wait to be committed, or preserved for posterity in a snapshot. The point of a git add is to differentiate between files that you want to have included in a snapshot, and the new or temporary files you want Git to, at least for now, ignore. + +In our tape deck analogy, this action turns the tape deck on and arms it for recording. You can picture the tape deck with the record and pause button pushed, or in a playback loop awaiting the next track to be laid down. + +Once you add a file, Git will identify it as a tracked file: + +``` +$ git add foo +$ git status +On branch master +Changes to be committed: +(use "git reset HEAD ..." to unstage) +new file: foo +``` + +Adding a file to Git's tracking system is not making a recording. It just puts a file on the stage in preparation for recording. You can still change a file after you've added it; it's being tracked and remains staged, so you can continue to refine it or change it before committing it to tape (but be warned; you're NOT recording yet, so if you break something in a file that was perfect, there's no going back in time yet, because you never got that perfect moment on tape). + +If you decide that the file isn't really ready to be recorded in the annals of Git history, then you can unstage something, just as the Git message described: + +``` +$ git reset HEAD foo +``` + +This, in effect, disarms the tape deck from being ready to record, and you're back to just noodling around in the studio. + +### The big commit + +At some point, you're going to want to commit something; in our tape deck analogy, that means finally pressing record and laying a track down on tape. + +At different stages of a project's life, how often you press that record button varies. For example, if you're hacking your way through a new Python toolkit and finally manage to get a window to appear, then you'll certainly want to commit so you have something to fall back on when you inevitably break it later as you try out new display options. But if you're working on a rough draft of some new graphics in Inkscape, you might wait until you have something you want to develop from before committing. Ultimately, though, it's up to you how often you commit; Git doesn't "cost" that much and hard drives these days are big, so in my view, the more the better. + +A commit records all staged files in a repository. Git only records files that are tracked, that is, any file that you did a git add on at some point in the past. and that have been modified since the previous commit. If no previous commit exists, then all tracked files are included in the commit because they went from not existing to existing, which is a pretty major modification from Git's point-of-view. + +To make a commit, run this command: + +``` +$ git commit -m 'My great project, first commit.' +``` + +This preserves all files committed for posterity (or, if you speak Gallifreyan, they become "fixed points in time"). You can see not only the commit event, but also the reference pointer back to that commit in your Git log: + +``` +$ git log --oneline +55df4c2 My great project, first commit. +``` + +For a more detailed report, just use git log without the --oneline option. + +The reference number for the commit in this example is 55df4c2. It's called a commit hash and it represents all of the new material you just recorded, overlaid onto previous recordings. If you need to "rewind" back to that point in history, you can use that hash as a reference. + +You can think of a commit hash as [SMPTE timecode][3] on an audio tape, or if we bend the analogy a little, one of those big gaps between songs on a vinyl record, or track numbers on a CD. + +As you change files further and add them to the stage, and ultimately commit them, you accrue new commit hashes, each of which serve as pointers to different versions of your production. + +And that's why they call Git a version control system, Charlie Brown. + +In the next article, we'll explore everything you need to know about the Git HEAD, and we'll nonchalantly reveal the secret of time travel. No big deal, but you'll want to read it (or maybe you already have?). + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/16/7/creating-your-first-git-repository + +作者:[Seth Kenlon][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[1]: https://github.com/settings/keys +[2]: https://gitlab.com/profile/keys +[3]: http://slackermedia.ml/handbook/doku.php?id=timecode From 18ba0c49a3bcc31d7aab8974984c92bb2bc82f31 Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 21 Jul 2016 17:29:05 +0800 Subject: [PATCH 1211/1469] =?UTF-8?q?20160721-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...User Space What We Did for Kernel Space.md | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 sources/tech/20160706 Doing for User Space What We Did for Kernel Space.md diff --git a/sources/tech/20160706 Doing for User Space What We Did for Kernel Space.md b/sources/tech/20160706 Doing for User Space What We Did for Kernel Space.md new file mode 100644 index 0000000000..72d79aaede --- /dev/null +++ b/sources/tech/20160706 Doing for User Space What We Did for Kernel Space.md @@ -0,0 +1,94 @@ +Doing for User Space What We Did for Kernel Space +======================================================= + +I believe the best and worst thing about Linux is its hard distinction between kernel space and user space. + +Without that distinction, Linux never would have become the most leveraged operating system in the world. Today, Linux has the largest range of uses for the largest number of users—most of whom have no idea they are using Linux when they search for something on Google or poke at their Android phones. Even Apple stuff wouldn't be what it is (for example, using BSD in its computers) were it not for Linux's success. + +Not caring about user space is a feature of Linux kernel development, not a bug. As Linus put it on our 2003 Geek Cruise, "I only do kernel stuff...I don't know what happens outside the kernel, and I don't much care. What happens inside the kernel I care about." After Andrew Morton gave me additional schooling on the topic a couple years later on another Geek Cruise, I wrote: + +>Kernel space is where the Linux species lives. User space is where Linux gets put to use, along with a lot of other natural building materials. The division between kernel space and user space is similar to the division between natural materials and stuff humans make out of those materials. + +A natural outcome of this distinction, however, is for Linux folks to stay relatively small as a community while the world outside depends more on Linux every second. So, in hope that we can enlarge our number a bit, I want to point us toward two new things. One is already hot, and the other could be. + +The first is [blockchain][1], made famous as the distributed ledger used by Bitcoin, but useful for countless other purposes as well. At the time of this writing, interest in blockchain is [trending toward the vertical][2]. + +![](http://www.linuxjournal.com/files/linuxjournal.com/ufiles/imagecache/large-550px-centered/u1000009/12042f1.png) +>Figure 1. Google Trends for Blockchain + +The second is self-sovereign identity. To explain that, let me ask who and what you are. + +If your answers come from your employer, your doctor, the Department of Motor Vehicles, Facebook, Twitter or Google, they are each administrative identifiers: entries in namespaces each of those organizations control, entirely for their own convenience. As Timothy Ruff of [Evernym][3] explains, "You don't exist for them. Only your identifier does." It's the dependent variable. The independent variable—the one controlling the identifier—is the organization. + +If your answer comes from your self, we have a wide-open area for a new development category—one where, finally, we can be set fully free in the connected world. + +The first person to explain this, as far as I know, was [Devon Loffreto][4] He wrote "What is 'Sovereign Source Authority'?" in February 2012, on his blog, [The Moxy Tongue][5]. In "[Self-Sovereign Identity][6]", published in February 2016, he writes: + +>Self-Sovereign Identity must emit directly from an individual human life, and not from within an administrative mechanism...self-Sovereign Identity references every individual human identity as the origin of source authority. A self-Sovereign identity produces an administrative trail of data relations that begin and resolve to individual humans. Every individual human may possess a self-Sovereign identity, and no person or abstraction of any type created may alter this innate human Right. A self-Sovereign identity is the root of all participation as a valued social being within human societies of any type. + +To put this in Linux terms, only the individual has root for his or her own source identity. In the physical world, this is a casual thing. For example, my own portfolio of identifiers includes: + +- David Allen Searls, which my parents named me. +- David Searls, the name I tend to use when I suspect official records are involved. +- Dave, which is what most of my relatives and old friends call me. +- Doc, which is what most people call me. + +As the sovereign source authority over the use of those, I can jump from one to another in different contexts and get along pretty well. But, that's in the physical world. In the virtual one, it gets much more complicated. In addition to all the above, I am @dsearls (my Twitter handle) and dsearls (my handle in many other net-based services). I am also burdened by having my ability to relate contained within hundreds of different silos, each with their own logins and passwords. + +You can get a sense of how bad this is by checking the list of logins and passwords on your browser. On Firefox alone, I have hundreds of them. Many are defunct (since my collection dates back to Netscape days), but I would guess that I still have working logins to hundreds of companies I need to deal with from time to time. For all of them, I'm the dependent variable. It's not the other way around. Even the term "user" testifies to the subordinate dependency that has become a primary fact of life in the connected world. + +Today, the only easy way to bridge namespaces is via the compromised convenience of "Log in with Facebook" or "Log in with Twitter". In both of those cases, each of us is even less ourselves or in any kind of personal control over how we are known (if we wish to be knowable at all) to other entities in the connected world. + +What we have needed from the start are personal systems for instantiating our sovereign selves and choosing how to reveal and protect ourselves when dealing with others in the connected world. For lack of that ability, we are deep in a metastasized mess that Shoshana Zuboff calls "surveillance capitalism", which she says is: + +>...unimaginable outside the inscrutable high velocity circuits of Google's digital universe, whose signature feature is the Internet and its successors. While the world is riveted by the showdown between Apple and the FBI, the real truth is that the surveillance capabilities being developed by surveillance capitalists are the envy of every state security agency. + +Then she asks, "How can we protect ourselves from its invasive power?" + +I suggest self-sovereign identity. I believe it is only there that we have both safety from unwelcome surveillance and an Archimedean place to stand in the world. From that place, we can assert full agency in our dealings with others in society, politics and business. + +I came to this provisional conclusion during [ID2020][7], a gathering at the UN on May. It was gratifying to see Devon Loffreto there, since he's the guy who got the sovereign ball rolling in 2013. Here's [what I wrote about][8] it at the time, with pointers to Devon's earlier posts (such as one sourced above). + +Here are three for the field's canon: + +- "[Self-Sovereign Identity][9]" by Devon Loffreto. +- "[System or Human First][10]" by Devon Loffreto. +- "[The Path to Self-Sovereign Identity][11]" by Christopher Allen. + +A one-pager from Evernym, [digi.me][12], [iRespond][13] and [Respect Network][14] also was circulated there, contrasting administrative identity (which it calls the "current model") with the self-sovereign one. In it is the graphic shown in Figure 2. + +![](http://www.linuxjournal.com/files/linuxjournal.com/ufiles/imagecache/large-550px-centered/u1000009/12042f2.jpg) +>Figure 2. Current Model of Identity vs. Self-Sovereign Identity + +The [platform][15] for this is Sovrin, explained as a "Fully open-source, attribute-based, sovereign identity graph platform on an advanced, dedicated, permissioned, distributed ledger" There's a [white paper][16] too. The code is called [plenum][17], and it's at GitHub. + +Here—and places like it—we can do for user space what we've done for the last quarter century for kernel space. + +-------------------------------------------------------------------------------- + +via: https://www.linuxjournal.com/content/doing-user-space-what-we-did-kernel-space + +作者:[Doc Searls][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxjournal.com/users/doc-searls +[1]: https://en.wikipedia.org/wiki/Block_chain_%28database%29 +[2]: https://www.google.com/trends/explore#q=blockchain +[3]: http://evernym.com/ +[4]: https://twitter.com/nzn +[5]: http://www.moxytongue.com/2012/02/what-is-sovereign-source-authority.html +[6]: http://www.moxytongue.com/2016/02/self-sovereign-identity.html +[7]: http://www.id2020.org/ +[8]: http://blogs.harvard.edu/doc/2013/10/14/iiw-challenge-1-sovereign-identity-in-the-great-silo-forest +[9]: http://www.moxytongue.com/2016/02/self-sovereign-identity.html +[10]: http://www.moxytongue.com/2016/05/system-or-human.html +[11]: http://www.lifewithalacrity.com/2016/04/the-path-to-self-soverereign-identity.html +[12]: https://get.digi.me/ +[13]: http://irespond.com/ +[14]: https://www.respectnetwork.com/ +[15]: http://evernym.com/technology +[16]: http://evernym.com/assets/doc/Identity-System-Essentials.pdf?v=167284fd65 +[17]: https://github.com/evernym/plenum From e5a45840f45b4f00be6cc83b14e36b0f737cfa80 Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 22 Jul 2016 13:45:54 +0800 Subject: [PATCH 1212/1469] =?UTF-8?q?20160722-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ice Efficiency at Instagram with Python.md | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 sources/tech/20160602 Web Service Efficiency at Instagram with Python.md diff --git a/sources/tech/20160602 Web Service Efficiency at Instagram with Python.md b/sources/tech/20160602 Web Service Efficiency at Instagram with Python.md new file mode 100644 index 0000000000..f637331336 --- /dev/null +++ b/sources/tech/20160602 Web Service Efficiency at Instagram with Python.md @@ -0,0 +1,73 @@ +Web Service Efficiency at Instagram with Python +=============================================== + +Instagram currently features the world’s largest deployment of the Django web framework, which is written entirely in Python. We initially chose to use Python because of its reputation for simplicity and practicality, which aligns well with our philosophy of “do the simple thing first.” But simplicity can come with a tradeoff: efficiency. Instagram has doubled in size over the last two years and recently crossed 500 million users, so there is a strong need to maximize web service efficiency so that our platform can continue to scale smoothly. In the past year we’ve made our efficiency program a priority, and over the last six months we’ve been able to maintain our user growth without adding new capacity to our Django tiers. In this post, we’ll share some of the tools we built and how we use them to optimize our daily deployment flow. + +### Why Efficiency? + +Instagram, like all software, is limited by physical constraints like servers and datacenter power. With these constraints in mind, there are two main goals we want to achieve with our efficiency program: + +1. Instagram should be able to serve traffic normally with continuous code rollouts in the case of lost capacity in one data center region, due to natural disaster, regional network issues, etc. +2. Instagram should be able to freely roll out new products and features without being blocked by capacity. + +To meet these goals, we realized we needed to persistently monitor our system and battle regression. + +### Defining Efficiency + +Web services are usually bottlenecked by available CPU time on each server. Efficiency in this context means using the same amount of CPU resources to do more work, a.k.a, processing more user requests per second (RPS). As we look for ways to optimize, our first challenge is trying to quantify our current efficiency. Up to this point, we were approximating efficiency using ‘Average CPU time per requests,’ but there were two inherent limitations to using this metric: + +1. Diversity of devices. Using CPU time for measuring CPU resources is not ideal because it is affected by both CPU models and CPU loads. +2. Request impacts data. Measuring CPU resource per request is not ideal because adding and removing light or heavy requests would also impact the efficiency metric using the per-requests measurement. + +Compared to CPU time, CPU instruction is a better metric, as it reports the same numbers regardless of CPU models and CPU loads for the same request. Instead of linking all our data to each user request, we chose to use a ‘per active user’ metric. We eventually landed on measuring efficiency by using ‘CPU instruction per active user during peak minute.’ With our new metric established, our next step was to learn more about our regressions by profiling Django. + +### Profiling the Django Service + +There are two major questions we want to answer by profiling our Django web service: + +1. Does a CPU regression happen? +2. What causes the CPU regression and how do we fix it? + +To answer the first question, we need to track the CPU-instruction-per-active-user metric. If this metric increases, we know a CPU regression has occurred. + +The tool we built for this purpose is called Dynostats. Dynostats utilizes Django middleware to sample user requests by a certain rate, recording key efficiency and performance metrics such as the total CPU instructions, end to end requests latency, time spent on accessing memcache and database services, etc. On the other hand, each request has multiple metadata that we can use for aggregation, such as the endpoint name, the HTTP return code of the request, the server name that serves this request, and the latest commit hash on the request. Having two aspects for a single request record is especially powerful because we can slice and dice on various dimensions that help us narrow down the cause of any CPU regression. For example, we can aggregate all requests by their endpoint names as shown in the time series chart below, where it is very obvious to spot if any regression happens on a specific endpoint. + +![](https://d262ilb51hltx0.cloudfront.net/max/800/1*3iouYiAchYBwzF-v0bALMw.png) + +CPU instructions matter for measuring efficiency — and they’re also the hardest to get. Python does not have common libraries that support direct access to the CPU hardware counters (CPU hardware counters are the CPU registers that can be programmed to measure performance metrics, such as CPU instructions). Linux kernel, on the other hand, provides the perf_event_open system call. Bridging through Python ctypes enables us to call the syscall function in standard C library, which also provides C compatible data types for programming the hardware counters and reading data from them. + + With Dynostats, we can already find CPU regressions and dig into the cause of the CPU regression, such as which endpoint gets impacted most, who committed the changes that actually cause the CPU regression, etc. However, when a developer is notified that their changes have caused a CPU regression, they usually have a hard time finding the problem. If it was obvious, the regression probably wouldn’t have been committed in the first place! + + That’s why we needed a Python profiler that the developer can use to find the root cause of the regression (once Dynostats identifies it). Instead of starting from scratch, we decided to make slight alterations to cProfile, a readily available Python profiler. The cProfile module normally provides a set of statistics describing how long and how often various parts of a program were executed. Instead of measuring in time, we took cProfile and replaced the timer with a CPU instruction counter that reads from hardware counters. The data is created at the end of the sampled requests and sent to some data pipelines. We also send metadata similar to what we have in Dynostats, such as server name, cluster, region, endpoint name, etc. +On the other side of the data pipeline, we created a tailer to consume the data. The main functionality of the tailer is to parse the cProfile stats data and create entities that represent Python function-level CPU instructions. By doing so, we can aggregate CPU instructions by Python functions, making it easier to tell which functions contribute to CPU regression. + +### Monitoring and Alerting Mechanism + +At Instagram, we [deploy our backend 30–50 times a day][1]. Any one of these deployments can contain troublesome CPU regressions. Since each rollout usually includes at least one diff, it is easy to identify the cause of any regression. Our efficiency monitoring mechanism includes scanning the CPU instruction in Dynostats before and after each rollout, and sending out alerts when the change exceeds a certain threshold. For the CPU regressions happening over longer periods of time, we also have a detector to scan daily and weekly changes for the most heavily loaded endpoints. + + Deploying new changes is not the only thing that can trigger a CPU regression. In many cases, the new features or new code paths are controlled by global environment variables (GEV). There are very common practices for rolling out new features to a subset of users on a planned schedule. We added this information as extra metadata fields for each request in Dynostats and cProfile stats data. Grouping requests by those fields reveal possible CPU regressions caused by turning the GEVs. This enables us to catch CPU regressions before they can impact performance. + +### What’s Next? + +Dynostats and our customized cProfile, along with the monitoring and alerting mechanism we’ve built to support them, can effectively identify the culprit for most CPU regressions. These developments have helped us recover more than 50% of unnecessary CPU regressions, which would have otherwise gone unnoticed. + + There are still areas where we can improve and make it easier to embed into Instagram’s daily deployment flow: + +1. The CPU instruction metric is supposed to be more stable than other metrics like CPU time, but we still observe variances that make our alerting noisy. Keeping signal:noise ratio reasonably low is important so that developers can focus on the real regressions. This could be improved by introducing the concept of confidence intervals and only alarm when it is high. For different endpoints, the threshold of variation could also be set differently. +2. One limitation for detecting CPU regressions by GEV change is that we have to manually enable the logging of those comparisons in Dynostats. As the number of GEVs increases and more features are developed, this wont scale well. Instead, we could leverage an automatic framework that schedules the logging of these comparisons and iterates through all GEVs, and send alerts when regressions are detected. +3. cProfile needs some enhancement to handle wrapper functions and their children functions better. + +With the work we’ve put into building the efficiency framework for Instagram’s web service, we are confident that we will keep scaling our service infrastructure using Python. We’ve also started to invest more into the Python language itself, and are beginning to explore moving our Python from version 2 to 3. We will continue to explore this and more experiments to keep improving both infrastructure and developer efficiency, and look forward to sharing more soon. + +-------------------------------------------------------------------------------- + +via: https://engineering.instagram.com/web-service-efficiency-at-instagram-with-python-4976d078e366#.tiakuoi4p + +作者:[Min Ni][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://engineering.instagram.com/@InstagramEng?source=post_header_lockup +[1]: https://engineering.instagram.com/continuous-deployment-at-instagram-1e18548f01d1#.p5adp7kcz From e219dff74a7a39404d57c7d9df59aaffeeac0b01 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 22 Jul 2016 13:59:57 +0800 Subject: [PATCH 1213/1469] PUB:Part 4 - How to Use Comparison Operators with Awk in Linux @chunyang-wen --- ... Comparison Operators with Awk in Linux.md | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) rename {translated/tech => published}/awk/Part 4 - How to Use Comparison Operators with Awk in Linux.md (61%) diff --git a/translated/tech/awk/Part 4 - How to Use Comparison Operators with Awk in Linux.md b/published/awk/Part 4 - How to Use Comparison Operators with Awk in Linux.md similarity index 61% rename from translated/tech/awk/Part 4 - How to Use Comparison Operators with Awk in Linux.md rename to published/awk/Part 4 - How to Use Comparison Operators with Awk in Linux.md index 86649a52d5..4ed7d8ed02 100644 --- a/translated/tech/awk/Part 4 - How to Use Comparison Operators with Awk in Linux.md +++ b/published/awk/Part 4 - How to Use Comparison Operators with Awk in Linux.md @@ -1,15 +1,15 @@ -在 Linux 下如何使用 Awk 比较操作符 +awk 系列:如何使用 awk 比较操作符 =================================================== ![](http://www.tecmint.com/wp-content/uploads/2016/05/Use-Comparison-Operators-with-AWK.png) -对于 Awk 命令的用户来说,处理一行文本中的数字或者字符串时,使用比较运算符来过滤文本和字符串是十分方便的。 +对于 使用 awk 命令的用户来说,处理一行文本中的数字或者字符串时,使用比较运算符来过滤文本和字符串是十分方便的。 -在 Awk 系列的此部分中,我们将探讨一下如何使用比较运算符来过滤文本或者字符串。如果你是程序员,那么你应该已经熟悉比较运算符;对于其它人,下面的部分将介绍比较运算符。 +在 awk 系列的此部分中,我们将探讨一下如何使用比较运算符来过滤文本或者字符串。如果你是程序员,那么你应该已经熟悉了比较运算符;对于其它人,下面的部分将介绍比较运算符。 -### Awk 中的比较运算符是什么? +### awk 中的比较运算符是什么? -Awk 中的比较运算符用于比较字符串和或者数值,包括以下类型: +awk 中的比较运算符用于比较字符串和或者数值,包括以下类型: - `>` – 大于 - `<` – 小于 @@ -17,12 +17,12 @@ Awk 中的比较运算符用于比较字符串和或者数值,包括以下类 - `<=` – 小于等于 - `==` – 等于 - `!=` – 不等于 -- `some_value ~ / pattern/` – 如果some_value匹配模式pattern,则返回true -- `some_value !~ / pattern/` – 如果some_value不匹配模式pattern,则返回true +- `some_value ~ / pattern/` – 如果 some_value 匹配模式 pattern,则返回 true +- `some_value !~ / pattern/` – 如果 some_value 不匹配模式 pattern,则返回 true -现在我们通过例子来熟悉 Awk 中各种不同的比较运算符。 +现在我们通过例子来熟悉 awk 中各种不同的比较运算符。 -在这个例子中,我们有一个文件名为 food_list.txt 的文件,里面包括不同食物的购买列表。我想给食物数量小于或等于30的物品所在行的后面加上`(**)` +在这个例子中,我们有一个文件名为 food_list.txt 的文件,里面包括不同食物的购买列表。我想给食物数量小于或等于 30 的物品所在行的后面加上`(**)` ``` File – food_list.txt @@ -38,7 +38,7 @@ No Item_Name Quantity Price Awk 中使用比较运算符的通用语法如下: ``` -# expression { actions; } +# 表达式 { 动作; } ``` 为了实现刚才的目的,执行下面的命令: @@ -57,8 +57,8 @@ No Item_Name` Quantity Price 在刚才的例子中,发生如下两件重要的事情: -- 第一个表达式 `{ action ; }` 组合, `$3 <= 30 { printf “%s\t%s\n”, $0,”**” ; }` 打印出数量小于等于30的行,并且在后面增加`(**)`。物品的数量是通过 `$3`这个域变量获得的。 -- 第二个表达式 `{ action ; }` 组合, `$3 > 30 { print $0 ;}` 原样输出数量小于等于 `30` 的行。 +- 第一个“表达式 {动作;}”组合中, `$3 <= 30 { printf “%s\t%s\n”, $0,”**” ; }` 打印出数量小于等于30的行,并且在后面增加`(**)`。物品的数量是通过 `$3` 这个域变量获得的。 +- 第二个“表达式 {动作;}”组合中, `$3 > 30 { print $0 ;}` 原样输出数量小于等于 `30` 的行。 再举一个例子: @@ -78,9 +78,9 @@ No Item_Name Quantity Price ### 总结 -这是一篇对 Awk 中的比较运算符介绍性的指引,因此你需要尝试其他选项,发现更多使用方法。 +这是一篇对 awk 中的比较运算符介绍性的指引,因此你需要尝试其他选项,发现更多使用方法。 -如果你遇到或者想到任何问题,请在下面评论区留下评论。请记得阅读 Awk 系列下一部分的文章,那里我将介绍组合表达式。 +如果你遇到或者想到任何问题,请在下面评论区留下评论。请记得阅读 awk 系列下一部分的文章,那里我将介绍组合表达式。 -------------------------------------------------------------------------------- @@ -88,7 +88,7 @@ via: http://www.tecmint.com/comparison-operators-in-awk/ 作者:[Aaron Kili][a] 译者:[chunyang-wen](https://github.com/chunyang-wen) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c62bae310232f409360cd80cbe08a2c8e56bc424 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 22 Jul 2016 14:14:48 +0800 Subject: [PATCH 1214/1469] PUB:Part 5 - How to Use Compound Expressions with Awk in Linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @martin2011qi 一看没写译者的就是你。。。 --- ... Compound Expressions with Awk in Linux.md | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) rename {translated/tech => published}/awk/Part 5 - How to Use Compound Expressions with Awk in Linux.md (65%) diff --git a/translated/tech/awk/Part 5 - How to Use Compound Expressions with Awk in Linux.md b/published/awk/Part 5 - How to Use Compound Expressions with Awk in Linux.md similarity index 65% rename from translated/tech/awk/Part 5 - How to Use Compound Expressions with Awk in Linux.md rename to published/awk/Part 5 - How to Use Compound Expressions with Awk in Linux.md index ed1ba4aa7c..ebe288b020 100644 --- a/translated/tech/awk/Part 5 - How to Use Compound Expressions with Awk in Linux.md +++ b/published/awk/Part 5 - How to Use Compound Expressions with Awk in Linux.md @@ -1,31 +1,31 @@ -如何使用 Awk 复合表达式 +awk 系列:如何使用 awk 复合表达式 ==================================================== ![](http://www.tecmint.com/wp-content/uploads/2016/05/Use-Compound-Expressions-with-Awk.png) -一直以来在查对条件是否匹配时,我们寻求的都是简单的表达式。那如果你想用超过一个表达式,来查对特定的条件呢? +一直以来在查对条件是否匹配时,我们使用的都是简单的表达式。那如果你想用超过一个表达式来查对特定的条件呢? 本文,我们将看看如何在过滤文本和字符串时,结合多个表达式,即复合表达式,用以查对条件。 -Awk 的复合表达式可由表示`与`的组合操作符 `&&` 和表示`或`的 `||` 构成。 +awk 的复合表达式可由表示“与”的组合操作符 `&&` 和表示“或”的 `||` 构成。 复合表达式的常规写法如下: ``` -( first_expression ) && ( second_expression ) +( 第一个表达式 ) && ( 第二个表达式 ) ``` -为了保证整个表达式的正确,在这里必须确保 `first_expression` 和 `second_expression` 是正确的。 +这里只有当“第一个表达式” 和“第二个表达式”都是真值时整个表达式才为真。 ``` -( first_expression ) || ( second_expression) +( 第一个表达式 ) || ( 第二个表达式) ``` -为了保证整个表达式的正确,在这里必须确保 `first_expression` 或 `second_expression` 是正确的。 +这里只要“第一个表达式” 为真或“第二个表达式”为真,整个表达式就为真。 **注意**:切记要加括号。 -表达式可以由比较操作符构成,具体可查看 awk 系列的第四部分。 +表达式可以由比较操作符构成,具体可查看[ awk 系列的第四节][1]。 现在让我们通过一个例子来加深理解: @@ -43,7 +43,7 @@ No Name Price Type 7 Nano_Prowler_Mini_Drone $36.99 Tech ``` -我们只想打印出价格超过 $20 的物品,并在其中种类为 “Tech” 的物品的行末用 (**) 打上标记。 +我们只想打印出价格超过 $20 且其种类为 “Tech” 的物品,在其行末用 (*) 打上标记。 我们将要执行以下命令。 @@ -56,13 +56,13 @@ No Name Price Type 此例,在复合表达式中我们使用了两个表达式: -- 表达式 1:`($3 ~ /^\$[2-9][0-9]*\.[0-9][0-9]$/)` ;查找交易价格超过 `$20` 的行,即只有当 `$3` 也就是价格满足 `/^\$[2-9][0-9]*\.[0-9][0-9]$/` 时值才为 true。 -- 表达式 2:`($4 == “Tech”)` ;查找是否有种类为 “`Tech`”的交易,即只有当 `$4` 等于 “`Tech`” 时值才为 true。 -切记,只有当 `&&` 操作符的两端状态,也就是两个表达式都是 true 的情况下,这一行才会被打上 `(**)` 标志。 +- 表达式 1:`($3 ~ /^\$[2-9][0-9]*\.[0-9][0-9]$/)` ;查找交易价格超过 `$20` 的行,即只有当 `$3` 也就是价格满足 `/^\$[2-9][0-9]*\.[0-9][0-9]$/` 时值才为真值。 +- 表达式 2:`($4 == “Tech”)` ;查找是否有种类为 “`Tech`”的交易,即只有当 `$4` 等于 “`Tech`” 时值才为真值。 +切记,只有当 `&&` 操作符的两端状态,也就是两个表达式都是真值的情况下,这一行才会被打上 `(*)` 标志。 ### 总结 -有些时候为了匹配你的真实想法,就不得不用到复合表达式。当你掌握了比较和复合表达式操作符的用法之后,在难的文本或字符串过滤条件也能轻松解决。 +有些时候为了真正符合你的需求,就不得不用到复合表达式。当你掌握了比较和复合表达式操作符的用法之后,复杂的文本或字符串过滤条件也能轻松解决。 希望本向导对你有所帮助,如果你有任何问题或者补充,可以在下方发表评论,你的问题将会得到相应的解释。 @@ -71,9 +71,10 @@ No Name Price Type via: http://www.tecmint.com/combine-multiple-expressions-in-awk/ 作者:[Aaron Kili][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[martin2011qi](https://github.com/martin2011qi) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: http://www.tecmint.com/author/aaronkili/ +[1]: https://linux.cn/article-7602-1.html \ No newline at end of file From 01afd251be931dd214dc180552906759e5cbc3b8 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 22 Jul 2016 14:37:29 +0800 Subject: [PATCH 1215/1469] PUB:20160602 How to mount your Google Drive on Linux with google-drive-ocamlfuse @GitFuture --- ...ve on Linux with google-drive-ocamlfuse.md | 64 +++++++++++++++++ ...ve on Linux with google-drive-ocamlfuse.md | 68 ------------------- 2 files changed, 64 insertions(+), 68 deletions(-) create mode 100644 published/20160602 How to mount your Google Drive on Linux with google-drive-ocamlfuse.md delete mode 100644 translated/tech/20160602 How to mount your Google Drive on Linux with google-drive-ocamlfuse.md diff --git a/published/20160602 How to mount your Google Drive on Linux with google-drive-ocamlfuse.md b/published/20160602 How to mount your Google Drive on Linux with google-drive-ocamlfuse.md new file mode 100644 index 0000000000..e993dc5e58 --- /dev/null +++ b/published/20160602 How to mount your Google Drive on Linux with google-drive-ocamlfuse.md @@ -0,0 +1,64 @@ +教你用 google-drive-ocamlfuse 在 Linux 上挂载 Google Drive +===================== + +> 如果你在找一个方便的方式在 Linux 机器上挂载你的 Google Drive 文件夹, Jack Wallen 将教你怎么使用 google-drive-ocamlfuse 来挂载 Google Drive。 + +![](http://tr4.cbsistatic.com/hub/i/2016/05/18/ee5d7b81-e5be-4b24-843d-d3ca99230a63/651be96ac8714698f8100afa6883e64d/linuxcloudhero.jpg) + +*图片来源: Jack Wallen* + +Google 还没有发行 Linux 版本的 Google Drive 应用,尽管现在有很多方法从 Linux 中访问你的 Drive 文件。 + +如果你喜欢界面化的工具,你可以选择 Insync。如果你喜欢用命令行,有很多像 Grive2 这样的工具,和更容易使用的以 Ocaml 语言编写的基于 FUSE 的文件系统。我将会用后面这种方式演示如何在 Linux 桌面上挂载你的 Google Drive。尽管这是通过命令行完成的,但是它的用法会简单到让你吃惊。它太简单了以至于谁都能做到。 + +这个系统的特点: + +- 对普通文件/文件夹有完全的读写权限 +- 对于 Google Docs,sheets,slides 这三个应用只读 +- 能够访问 Drive 回收站(.trash) +- 处理重复文件功能 +- 支持多个帐号 + +让我们接下来完成 google-drive-ocamlfuse 在 Ubuntu 16.04 桌面的安装,然后你就能够访问云盘上的文件了。 + +### 安装 + +1. 打开终端。 +2. 用 `sudo add-apt-repository ppa:alessandro-strada/ppa` 命令添加必要的 PPA +3. 出现提示的时候,输入你的 root 密码并按下回车。 +4. 用 `sudo apt-get update` 命令更新应用。 +5. 输入 `sudo apt-get install google-drive-ocamlfuse` 命令安装软件。 + +### 授权 + +接下来就是授权 google-drive-ocamlfuse,让它有权限访问你的 Google 账户。先回到终端窗口敲下命令 `google-drive-ocamlfuse`,这个命令将会打开一个浏览器窗口,它会提示你登陆你的 Google 帐号或者如果你已经登陆了 Google 帐号,它会询问是否允许 google-drive-ocamlfuse 访问 Google 账户。如果你还没有登录,先登录然后点击“允许”。接下来的窗口(在 Ubuntu 16.04 桌面上会出现,但不会出现在 Elementary OS Freya 桌面上)将会询问你是否授给 gdfuse 和 OAuth2 Endpoint 访问你的 Google 账户的权限,再次点击“允许”。然后出现的窗口就会告诉你等待授权令牌下载完成,这个时候就能最小化浏览器了。当你的终端提示如下图一样的内容,你就能知道令牌下载完了,并且你已经可以挂载 Google Drive 了。 + +![](http://tr4.cbsistatic.com/hub/i/r/2016/05/18/a493122b-445f-4aca-8974-5ec41192eede/resize/620x/6ae5907ad2c08dc7620b7afaaa9e389c/googledriveocamlfuse3.png) + +*应用已经得到授权,你可以进行后面的工作。* + +### 挂载 Google Drive + +在挂载 Google Drive 之前,你得先创建一个文件夹,作为挂载点。在终端里,敲下`mkdir ~/google-drive`命令在你的家目录下创建一个新的文件夹。最后敲下命令`google-drive-ocamlfuse ~/google-drive`将你的 Google Drive 挂载到 google-drive 文件夹中。 + +这时你可以查看本地 google-drive 文件夹中包含的 Google Drive 文件/文件夹。你可以把 Google Drive 当作本地文件系统来进行工作。 + +当你想卸载 google-drive 文件夹,输入命令 `fusermount -u ~/google-drive`。 + +### 没有 GUI,但它特别好用 + +我发现这个特别的系统非常容易使用,在同步 Google Drive 时它出奇的快,并且这可以作为一种本地备份你的 Google Drive 账户的巧妙方式。(LCTT 译注:然而首先你得能使用……) + +试试 google-drive-ocamlfuse,看看你能用它做出什么有趣的事。 + +-------------------------------------------------------------------------------- + +via: http://www.techrepublic.com/article/how-to-mount-your-google-drive-on-linux-with-google-drive-ocamlfuse/ + +作者:[Jack Wallen][a] +译者:[GitFuture](https://github.com/GitFuture) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.techrepublic.com/search/?a=jack+wallen diff --git a/translated/tech/20160602 How to mount your Google Drive on Linux with google-drive-ocamlfuse.md b/translated/tech/20160602 How to mount your Google Drive on Linux with google-drive-ocamlfuse.md deleted file mode 100644 index b64fa51ab0..0000000000 --- a/translated/tech/20160602 How to mount your Google Drive on Linux with google-drive-ocamlfuse.md +++ /dev/null @@ -1,68 +0,0 @@ -教你用 google-drive-ocamlfuse 在 Linux 上挂载 Google Drive -===================== - ->如果你在找一个方便的方式在 Linux 机器上挂载你的 Google Drive 文件夹, Jack Wallen 将教你怎么使用 google-drive-ocamlfuse 来挂载 Google Drive。 - -![](http://tr4.cbsistatic.com/hub/i/2016/05/18/ee5d7b81-e5be-4b24-843d-d3ca99230a63/651be96ac8714698f8100afa6883e64d/linuxcloudhero.jpg) ->图片来源: Jack Wallen - -Google 还没有发行 Linux 版本的 Google Drive 应用,尽管现在有很多方法从 Linux 中访问你的 Drive 文件。 -(注:不清楚 app 需不需要翻译成应用,这里翻译了) - -如果你喜欢界面化的工具,你可以选择 Insync。如果你喜欢用命令行,这有很多工具,像 Grive2 和用 Ocaml 语言编写的、非常容易使用的、基于 FUSE 的系统(注:there are tools such as Grive2 and the incredibly easy to use FUSE-based system written in Ocaml. 这一句感觉翻译不出来)。我将会用后面这种方式演示如何在 Linux 桌面上挂载你的 Google Drive。尽管这是通过命令行完成的,但是它的用法会简单到让你吃惊。它太简单了以至于谁都能做到。 - -系统特点: - -- 对普通文件/文件夹有完全的读写权限 -- 对于 Google Docs,sheets,slides 这三个应用只读 -- 能够访问 Drive 回收站(.trash) -- 处理重复文件功能 -- 支持多个帐号 - -接下来完成 google-drive-ocamlfuse 在 Ubuntu 16.04 桌面的安装,然后你就能够访问云盘上的文件了。 - -### 安装 - -1. 打开终端。 -2. 用`sudo add-apt-repository ppa:alessandro-strada/ppa`命令添加必要的 PPA -3. 出现提示的时候,输入密码并按下回车。 -4. 用`sudo apt-get update`命令更新应用。 -5. 输入`sudo apt-get install google-drive-ocamlfuse`命令安装软件。 -(注:这里,我把所有的命令加上着重标记了) - -### 授权 - -接下来就是授权 google-drive-ocamlfuse,让它有权限访问你的 Google 账户。先回到终端窗口敲下命令 google-drive-ocamlfuse,这个命令将会打开一个浏览器窗口,它会提示你登陆你的 Google 帐号或者如果你已经登陆了 Google 帐号,它会询问是否允许 google-drive-ocamlfuse 访问 Google 账户。如果你还没有登陆,先登陆然后点击允许。接下来的窗口(在 Ubuntu 16.04 桌面上会出现,但不会出现在基本系统 Freya 桌面上)将会询问你是否授给 gdfuse 和 OAuth2 Endpoint访问你的 Google 账户的权限,再次点击允许。然后出现的窗口就会告诉你等待授权令牌下载完成,这个时候就能最小化浏览器了。当你的终端提示像图 A 一样的内容,你就能知道令牌下载完了,并且你已经可以挂载 Google Drive 了。 - -**图 A** - -![](http://tr4.cbsistatic.com/hub/i/r/2016/05/18/a493122b-445f-4aca-8974-5ec41192eede/resize/620x/6ae5907ad2c08dc7620b7afaaa9e389c/googledriveocamlfuse3.png) ->图片来源: Jack Wallen - -**应用已经得到授权,你可以进行后面的工作。** - -### 挂载 Google Drive - -在挂载 Google Drive 之前,你得先创建一个文件夹,作为挂载点。在终端里,敲下`mkdir ~/google-drive`命令在你的家目录下创建一个新的文件夹。最后敲下命令`google-drive-ocamlfuse ~/google-drive`将你的 Google Drive 挂载到 google-drive 文件夹中。 - -这时你可以查看本地 google-drive 文件夹中包含的 Google Drive 文件/文件夹。你能够把 Google Drive 当作本地文件系统来进行工作。 - -当你想 卸载 google-drive 文件夹,输入命令 `fusermount -u ~/google-drive`。 - -### 没有 GUI,但它特别好用 - -我发现这个特别的系统非常容易使用,在同步 Google Drive 时它出奇的快,并且这可以作为一种巧妙的方式备份你的 Google Drive 账户。 - -试试 google-drive-ocamlfuse,看看你能用它做出什么有趣的事。 - --------------------------------------------------------------------------------- - -via: http://www.techrepublic.com/article/how-to-mount-your-google-drive-on-linux-with-google-drive-ocamlfuse/ - -作者:[Jack Wallen ][a] -译者:[GitFuture](https://github.com/GitFuture) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://www.techrepublic.com/search/?a=jack+wallen From f5170c812cc733e5c51a3dbf92c7d62f21125f99 Mon Sep 17 00:00:00 2001 From: vim-kakali <1799225723@qq.com> Date: Fri, 22 Jul 2016 14:46:04 +0800 Subject: [PATCH 1216/1469] =?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 --- ...inux desktop and IoT software distribution.md | 113 ---------------- ...inux desktop and IoT software distribution.md | 121 ++++++++++++++++++ 2 files changed, 121 insertions(+), 113 deletions(-) delete mode 100644 sources/talk/20160614 ​Ubuntu Snap takes charge of Linux desktop and IoT software distribution.md create mode 100644 translated/talk/20160614 ​Ubuntu Snap takes charge of Linux desktop and IoT software distribution.md diff --git a/sources/talk/20160614 ​Ubuntu Snap takes charge of Linux desktop and IoT software distribution.md b/sources/talk/20160614 ​Ubuntu Snap takes charge of Linux desktop and IoT software distribution.md deleted file mode 100644 index 667c49b056..0000000000 --- a/sources/talk/20160614 ​Ubuntu Snap takes charge of Linux desktop and IoT software distribution.md +++ /dev/null @@ -1,113 +0,0 @@ -vim-kakali translating - - -Ubuntu Snap takes charge of Linux desktop and IoT software distribution -=========================================================================== - -[Canonical][28] and [Ubuntu][29] founder Mark Shuttleworth said in an interview that he hadn't planned on an announcement about Ubuntu's new [Snap app package format][30]. But then in a matter of a few months, developers from multiple Linux distributions and companies announced they would use Snap as a universal Linux package format. - -![](http://zdnet2.cbsistatic.com/hub/i/r/2016/06/14/a9b2a139-3cd4-41bf-8e10-180cb9450134/resize/770xauto/adc7d16a46167565399ecdb027dd1416/ubuntu-snap.jpg) ->Linux distributors, ISVs, and companies are all adopting Ubuntu Snap to distribute and update programs across all Linux varieties. - -Why? Because Snap enables a single binary package to work perfectly and securely on any Linux desktop, server, cloud or device. According to Olli Ries, head of Canonical's Ubuntu client platform products and releases: - ->The [security mechanisms in Snap packages][1] allow us to open up the platform for much faster iteration across all our flavors as Snap applications are isolated from the rest of the system. Users can install a Snap without having to worry whether it will have an impact on their other apps or their system. - -Of course, as Matthew Garrett, a former Linux kernel developer and CoreOS security developer, has pointed out: If you [use Snap with an insecure program, such as the X11][2] window system, you don't actually gain any security. - -Shuttleworth agrees with Garrett but points out that you can control how Snap applications interact with the rest of this system. So, for example, a web browser can be contained within a secure Snap, which uses the Ubuntu packaged [openssl][3] Transport Layer Security (TLS) and Secure Sockets Layer (SSL) library. In addition, even if something does break into the browser instance, it still can't get to the underlying operating system. - -Many companies agree. [Dell][4], [Samsung][5], [Mozilla][6], [Krita][7], [Mycroft][8], and [Horizon Computing][9] are adopting Snap. [Arch Linux][10], [Debian][11], [Gentoo][12], and [OpenWrt][13] developers have also embraced Snaps and are adding it to their Linux distributions - -Snap packages, aka "Snaps", now work natively on Arch, Debian, Fedora, Kubuntu, Lubuntu, Ubuntu GNOME, Ubuntu Kylin, Ubuntu MATE, Ubuntu Unity, and Xubuntu. Snap is being validated on CentOS, Elementary, Gentoo, Mint, OpenSUSE, and Red Hat Enterprise Linux (RHEL), and are easy to enable on other Linux distributions. - -These distributions are adopting Snaps, Shuttleworth explained, because "Snaps bring those apps to every Linux desktop, server, device or cloud machine, giving users freedom to choose any Linux distribution while retaining access to the best apps." - -Taken together these distributions represent the vast majority of common Linux desktop, server and cloud distributions. Why would they switch from their existing package management systems? "One nice feature of Snaps is support for edge and beta channels, which allow users to opt-in to the pre-release developer versions of software or stick with the latest stable versions." explained Tim Jester-Pfadt, an Arch Linux contributor. - -In addition to the Linux distributors, independent software vendors (ISVs) are embracing Snap since it greatly simplifies third-party Linux app distribution and security maintenance. For example, [The Document Foundation][14] will be making the popular open-source office suite [LibreOffice][15] available as a Snap. - -Thorsten Behrens, co-founder of The Document Foundation explained: - ->Our objective is to make LibreOffice easily available to as many users as possible. Snaps enable our users to get the freshest LibreOffice releases across different desktops and distributions quickly, easily and consistently. As a bonus, it should help our release engineers to eventually move away from bespoke, home-grown and ancient Linux build solutions, towards something that is collectively maintained. - -In a statement, Nick Nguyen, Mozilla's [Firefox][16] VP, added: - ->We strive to offer users a great experience and make Firefox available across many platforms, devices and operating systems. With the introduction of Snaps, continually optimizing Firefox will become possible, providing Linux users the most up-to-date features. - -Boudewijn Rempt, project lead at the [Krita Foundation][17], a KDE-based graphics program, said: - ->Maintaining DEB packages in a private repository was complex and time consuming, snaps are much easier to maintain, package and distribute. Putting the snap in the store was particularly simple, this is the most streamlined app store I have published software in. [Krita 3.0][18] has just been released as a snap which will be updated automatically as newer versions become available. - -It's not just Linux desktop programmers who are excited by Snap. Internet of Things (IoT) and embedded developers are also grabbing on to Snap with both hands. - -Because Snaps are isolated from one another to help with data security, and can be updated or rolled back automatically, they are ideal for devices. Multiple vendors have launched snappy IoT devices, enabling a new class of "smart edge" device with IoT app store. Snappy devices receive automatic updates for the base OS, together with updates to the apps installed on the device. - -Dell, which according to Shuttleworth was one of the first IoT vendors to see the power of Snap, will be using Snap in its devices. - -"We believe Snaps address the security risks and manageability challenges associated with deploying and running multiple third party applications on a single IoT Gateway," said Jason Shepherd, Dell's Director of IoT Strategy and Partnerships. "This trusted and universal app format is essential for Dell, our IoT Solutions Partners and commercial customers to build a scalable, IT-ready, and vibrant ecosystem of IoT applications." - -It's simple, explained OpenWrt developer Matteo Croce. "Snaps deliver new applications to OpenWrt while leaving the core OS unchanged.... Snaps are a faster way to deliver a wider range of software to supported OpenWrt access points and routers." - -Shuttleworth doesn't see Snaps replacing existing Linux package systems such as [RPM][19] and [DEB][20]. Instead he sees it as being complementary to them. Snaps will sit alongside the native package. Each distribution has its own mechanisms to provide and update the core operating system and its updates. What Snap brings to the table is universal apps that cannot interfere with the base operating system - -Each Snap is confined using a range of kernel isolation and security mechanisms, tailored to the Snap application's needs. A careful review process ensures that snaps only receive the permissions they require to operate. Users will not have to make complex security decisions when installing the snap. - -Since Snaps are essentially self-contained zip files that can be quickly executed in place, "Snaps are much easier to create than traditional Linux packages, and allow us to evolve dependencies independent of the base operating system, so we can easily provide the very best and latest Chinese Linux apps to users across all distributions," explained Jack Yu, leader of the popular [Chinese Ubuntu Kylin][21] team. - -The snap format, designed by Canonical, is handled by [snapd][22]. Its development work is done on [GitHub][23]. Porting snapd to a wide range of Linux distributions has proven straightforward, and the community has grown to include contributors from a wide range of Linux backgrounds. - -Snap packages are created with the snapcrafttool. The home of the project is [snapcraft.io][24], which includes a tour and step-by-step guides to Snap creation, along with documentation for users and contributors to the project. Snaps can be built from existing distribution packages, but are more commonly built from source for optimization and size efficiency. - -Unless you're an Ubuntu power-user or serious Linux developer you may not have heard of Snap. In the future, anyone who does work with Linux on any platform will know the program. It's well on its way to becoming a major -- perhaps the most important of all -- Linux application installation and upgrade mechanism. - -#### Related Stories: - -- [Linux expert Matthew Garrett: Ubuntu 16.04's new Snap format is a security risk][25] -- [Ubuntu Linux 16.04 is here][26] -- [Microsoft and Canonical partner to bring Ubuntu to Windows 10][27] - - --------------------------------------------------------------------------------- - -via: http://www.zdnet.com/article/ubuntu-snap-takes-charge-of-linux-desktop-and-iot-software-distribution/ - -作者:[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/ -[28]: http://www.canonical.com/ -[29]: http://www.ubuntu.com/ -[30]: https://insights.ubuntu.com/2016/04/13/snaps-for-classic-ubuntu/ -[1]: https://insights.ubuntu.com/2016/04/13/snaps-for-classic-ubuntu/ -[2]: http://www.zdnet.com/article/linux-expert-matthew-garrett-ubuntu-16-04s-new-snap-format-is-a-security-risk/ -[3]: https://www.openssl.org/ -[4]: http://www.dell.com/en-us/ -[5]: http://www.samsung.com/us/ -[6]: http://www.mozilla.com/ -[7]: https://krita.org/en/ -[8]: https://mycroft.ai/ -[9]: http://www.horizon-computing.com/ -[10]: https://www.archlinux.org/ -[11]: https://www.debian.org/ -[12]: https://www.gentoo.org/ -[13]: https://openwrt.org/ -[14]: https://www.documentfoundation.org/ -[15]: https://www.libreoffice.org/download/libreoffice-fresh/ -[16]: https://www.mozilla.org/en-US/firefox/new/ -[17]: https://krita.org/en/about/krita-foundation/ -[18]: https://krita.org/en/item/krita-3-0-released/ -[19]: http://rpm5.org/ -[20]: https://www.debian.org/doc/manuals/debian-faq/ch-pkg_basics.en.html -[21]: http://www.ubuntu.com/desktop/ubuntu-kylin -[22]: https://launchpad.net/ubuntu/+source/snapd -[23]: https://github.com/snapcore/snapd -[24]: http://snapcraft.io/ -[25]: http://www.zdnet.com/article/linux-expert-matthew-garrett-ubuntu-16-04s-new-snap-format-is-a-security-risk/ -[26]: http://www.zdnet.com/article/ubuntu-linux-16-04-is-here/ -[27]: http://www.zdnet.com/article/microsoft-and-canonical-partner-to-bring-ubuntu-to-windows-10/ - - diff --git a/translated/talk/20160614 ​Ubuntu Snap takes charge of Linux desktop and IoT software distribution.md b/translated/talk/20160614 ​Ubuntu Snap takes charge of Linux desktop and IoT software distribution.md new file mode 100644 index 0000000000..f7b3e5590c --- /dev/null +++ b/translated/talk/20160614 ​Ubuntu Snap takes charge of Linux desktop and IoT software distribution.md @@ -0,0 +1,121 @@ + + +Ubuntu Snap 软件包管理 Linux 桌面和 IoT 的软件安装 +=========================================================================== + + +[Canonical][28] 和 [Ubuntu][29] 创始人 Mark Shuttleworth 在一次采访中说他不计划宣布 Ubuntu 的新 [ Snap 程序包格式][30]。但是 +在之后几个月,各种 Linux 发行版的开发者和团队都宣布他们会把 Snap 作为通用 Linux 程序包格式。 +![](http://zdnet2.cbsistatic.com/hub/i/r/2016/06/14/a9b2a139-3cd4-41bf-8e10-180cb9450134/resize/770xauto/adc7d16a46167565399ecdb027dd1416/ubuntu-snap.jpg) +>Linux 供应商,独立软件开发商(ISV:Independent Software Vendor)和开发团队都采用 Ubuntu Snap 作为多种 Linux 系统的配置和更新程序包。 + +为什么呢?因为 Snap 能使一个二进制程序包可以完美、安全地在任何 Linux 台式机、服务器、云或设备上运行。Canonical 的 Ubuntu 客户端产品和版本负责人 Olli Ries 说: + + +>[ Snap 程序包的安全机制][1] 允许我们为 Snap 应用单独空出一些系统空间,这样我们就可以根据我们自身的情况更高效的进行循环开发。用户安装一个 Snap 的时候也不用担心是否会影响其他的应用程序和操作系统。 + + +当然了,早期的 Linux 内核开发者和 CoreOS 【译注:CoreOS是一种操作系统,于2013年十二月发布,它的设计旨在关注开源操作系统内核的新兴使用——用于大量基于云计算的虚拟服务器。】安全维护者 Matthew Garrett 指出:如果你 [使用带有不安全程序的 Snap 程序包比如 X11 ][2] 视窗系统【译注:X11也叫做 X Window 系统,X Window 系统 ( X11 或 X )是一种位图显示的视窗系统 。它是在 Unix 和类 Unix 操作系统 ,以及 OpenVMS 上建立图形用户界面的标准工具包和协议,并可用于几乎所有已有的现代操作系统。】,实际上你的系统一点也不安全。 + + +Shuttleworth 同意 Garrett 的观点,但是他也说你可以控制 Snap 应用使用多少的系统剩余空间。比如,一个 web 浏览器可以包含一个安全的 Snap 程序包,这个 Snap 使用 Ubuntu 的一个包 [openssl][3]【译注:OpenSSL 是一个强大的安全套接字层密码库,囊括主要的密码算法、常用的密钥和证书封装管理功能及 SSL 协议,并提供丰富的应用程序供测试或其它目的使用。】的安全传输层(TLS,Transport Layer Security)和安全套接字层(SSL,Secure Sockets Layer)二进制文件。除此之外,即使有程序攻破了浏览器的诉讼程序【译注:诉讼程序属于程序性法律程序中的公力救济型程序】,也不能进行底层的系统操作。 + +很多团队也这样认为。[戴尔][4],[三星][5],[Mozilla][6],[krita][7]【译注:Krita 是一个位图形编辑软件,KOffice 套装的一部份。包含一个绘画程式和照片编辑器,Krita 是自由软件,并根据GNU通用公共许可证发布。】,[麦考夫][8]【译注:Mycroft 是一个开源AI智能家居平台,配置 Raspberry Pi 2 和 Arduino 控制器,应该就是以夏洛克福尔摩斯的哥哥为名的。】,以及 [地平线计算][9] 【译注:地平线计算解决方案,为客户提供优质的硬件架构为其运行云平台。】都将使用 Snap。[Arch Linux][10],[Debain][11],[Gentoo][12],和 [OpenWrt][13] 【译注:OpenWrt 可以被描述为一个嵌入式的 Linux 发行版】开发团队也已经拥抱了 Snap,也会把 Snap 加入到他们各自开发的分支中。 + +Snap 包又叫做“ Snaps ”,现在在 Arch、Debian、Fedora、Kubuntu、Lubuntu、Ubuntu GNOME、Ubuntu Kylin、Ubuntu MATE、Ubuntu Unity 和 Xubuntu 上运行。 Snap 正在 CentOS、Elementary、Gentoo、Mint、OpenSUSE 和 Red Hat Enterprise Linux (RHEL) 上予以验证,并且在其他 Linux 发行版上运行也会很容易。 + +这些发行版都使用 Snaps,Shuttleworth 声称:“ Snaps 为每个 Linux 台式机、服务器、设备和云机器带来了很多应用程序,也给了用户更大的自由,用户可以选择任何带有最好应用程序的 Linux 发行版本。” + +把这些发行版放在一起代表了大多的主流 Linux 桌面、服务器和云系统分支。为什么他们切换到本地包来进行系统管理呢? Arch Linux 的贡献者 +除过这些 Linux 分支,独立软件开发商(ISV,Independent Software Vendor)也将会因为 Snap 很好的简化了第三方 Linux 应用程序和安全维护问题而拥抱 Snap。例如,[文档基金会][14] 也将会开发出受欢迎的可用开源 office 套件 [LibreOffice][15] 作为一个 Snap 程序包。 + +文档基金会的联合创始人 Thorsten Behrens 这样说: + +>我们的目标是使 LibreOffice 能被大多数人更容易使用成为可能。Snap 使我们的用户能够在不同的桌面系统和分支上更快捷更容易的持续获取最新的 LibreOffice 版本。如上所述,它也会帮助我们的版本开发工程师最终从定期的自产的陈旧 Linux 开发解决方案中解放出来,总之很多东西会被共同维护。 + +Mozilla 的 [火狐][16] 副总裁(VP,Vice President)Nick Nguyen 在这段陈述中提到: + +>我们力求为用户提供良好的使用体验,并且使火狐浏览器能够在更多平台、设备和操作系统上运行。随着对 Snaps 的介绍,我们也会对火狐浏览器进行持续优化,使它可以为 Linux 用户提供最新特性。 + +基于 KDE 的图形程序的 [Krita Foundation][17] 项目领导 Boudewijn Rempt 说: + + +>正在维护的 DEB 包在一个私有仓库,这很复杂也很耗费时间。Snaps 更容易维护、打包和配置。把 Snap 放进软件商店也特别容易,我已经把软件发布在最合适的软件商店了。[Krita 3.0][18] 刚刚作为一个 snap 程序包发行,它作为最新的版本能够自动更新。 + +不仅 Linux 桌面系统程序使用 Snap。物联网(IoT)和嵌入式开发者也双手拥抱了 Snap。 + + +Snaps 彼此隔离开来,以确保安全性,它们还可以自动更新或回滚,这对于硬件设备是极好的。多种厂商都在他们的物联网设备上运行着 snappy【译注:Snap 基于 snappy进行构建。】,能够生产带有物联网应用程序商店的新的“智能边缘”设备。Snappy 设备能够自动接收系统更新,并且连同安装在设备上的应用程序也会得到更新。 + +戴尔公司根据最早的物联网厂商之一的创始人 Shuttleworth 看到的 Snap 的巨大潜力决定在他们的设备上使用 Snap。 + +戴尔公司的物联网战略和合作伙伴主管 Jason Shepherd 说:“我们认为,Snaps 能够报告安全风险,也能解决在单一物联网网关上部署和运行多个第三方应用程序所带来的安全风险和可管理性挑战。这种课信赖的通用的应用程序格式才是戴尔真正需要的,我们的物联网解决方案合作伙伴和产品客户都对物联网应用程序的充满活力的生态系统有极大的兴趣。” + + +OpenWrt 的开发者 Matteo Croce 说:“这很简单,在脱离无变化的核心操作系统的时候 Snaps 会为 OpenWrt 递送大量的软件...Snaps 是通过点和路由为 OpenWrt 提供大量软件的最快方式。” + +Shuttleworth 认为 Snaps 不会取代已经存在的 Linux 程序包比如 [RPM][19] 和 [DEB][20]。相反,他认为他们将会相辅相成。Snaps 将会与现有包共存。每个发行版都有为系统内核提供更新的相应机制,这种机制也在不断更新。Snap 为桌面系统带来的是通用的应用程序,这些应用程序不会影响基本的系统操作。 + +每个 Snap 使用大量的独立核心和安全机制时也会有所限制,这是 Snap 应用程序的特色,谨慎的重览过程确保 Snap 仅仅得到其完成请求操作的权限。用户在安装 Snap 的时候也不必考虑复杂的安全问题。 + +Snap实际上是独立式zip文件,能够非常迅速地在原地执行,很受欢迎的[中标麒麟][21]团队的负责人 Jack Yu 称:“Snaps 比传统的 Linux 包更容易构建,允许我们对这种基本的系统的操作的独立性产生依赖,所以我们可以为所有的分支用户开发更好的最新国产 Linux 应用程序。” + +Snap 程序包格式由 Canonical 设计,基于 [snapd][22] 。这是GitHub上的一个软件项目。大多 Linux 发行版的部分 snapd 已经被证明是容易理解的,社区里也加入了新的有大量 Linux 经验的贡献者。 + + +Snap 程序包使用 snapcraft 工具来构建。项目基地是 [snapcraft.io][24] 网站,附有构建 Snap 的预览和逐步指南,不包括项目开发者和使用者的文件。Snap可能基于现有的发行版程序包,但更常使用源代码来构建,为了优化和规模效率。 + +如果你不是 Ubuntu 的忠实粉丝或者一个偏执的 Linux 开发者你可能不知道 Snap。未来,在任何平台上需要用 Linux 完成工作的任何人都会知道这个软件。用它的方法完成工作会成为主流 -- 尤其在这些方面将更重要 -- Linux 应用程序的安装和更新机制。 + + +#### 相关内容: + + +- [Linux 专家 Matthew Garrett:Ubuntu 16.04 的新 Snap 程序包格式存在安全风险 ][25] +- [Ubuntu Linux 16.04 ] +- [Microsoft 和 Canonical 合作使 Ubuntu 可以在 Windows 10 上运行 ] + + +-------------------------------------------------------------------------------- + +via: http://www.zdnet.com/article/ubuntu-snap-takes-charge-of-linux-desktop-and-iot-software-distribution/ + +作者:[Steven J. Vaughan-Nichols][a] +译者:[vim-kakali](https://github.com/vim-kakali) +校对:[校对者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/ +[28]: http://www.canonical.com/ +[29]: http://www.ubuntu.com/ +[30]: https://insights.ubuntu.com/2016/04/13/snaps-for-classic-ubuntu/ +[1]: https://insights.ubuntu.com/2016/04/13/snaps-for-classic-ubuntu/ +[2]: http://www.zdnet.com/article/linux-expert-matthew-garrett-ubuntu-16-04s-new-snap-format-is-a-security-risk/ +[3]: https://www.openssl.org/ +[4]: http://www.dell.com/en-us/ +[5]: http://www.samsung.com/us/ +[6]: http://www.mozilla.com/ +[7]: https://krita.org/en/ +[8]: https://mycroft.ai/ +[9]: http://www.horizon-computing.com/ +[10]: https://www.archlinux.org/ +[11]: https://www.debian.org/ +[12]: https://www.gentoo.org/ +[13]: https://openwrt.org/ +[14]: https://www.documentfoundation.org/ +[15]: https://www.libreoffice.org/download/libreoffice-fresh/ +[16]: https://www.mozilla.org/en-US/firefox/new/ +[17]: https://krita.org/en/about/krita-foundation/ +[18]: https://krita.org/en/item/krita-3-0-released/ +[19]: http://rpm5.org/ +[20]: https://www.debian.org/doc/manuals/debian-faq/ch-pkg_basics.en.html +[21]: http://www.ubuntu.com/desktop/ubuntu-kylin +[22]: https://launchpad.net/ubuntu/+source/snapd +[23]: https://github.com/snapcore/snapd +[24]: http://snapcraft.io/ +[25]: http://www.zdnet.com/article/linux-expert-matthew-garrett-ubuntu-16-04s-new-snap-format-is-a-security-risk/ +[26]: http://www.zdnet.com/article/ubuntu-linux-16-04-is-here/ +[27]: http://www.zdnet.com/article/microsoft-and-canonical-partner-to-bring-ubuntu-to-windows-10/ + + From 6bbfb73ec6235eca3178c16f3669f9af119fa58c Mon Sep 17 00:00:00 2001 From: vim-kakali <1799225723@qq.com> Date: Fri, 22 Jul 2016 22:54:05 +0800 Subject: [PATCH 1217/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20160718 Creating your first Git repository.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sources/tech/20160718 Creating your first Git repository.md b/sources/tech/20160718 Creating your first Git repository.md index 0a9df8740b..4ec9b0aace 100644 --- a/sources/tech/20160718 Creating your first Git repository.md +++ b/sources/tech/20160718 Creating your first Git repository.md @@ -1,3 +1,7 @@ +vim-kakali translating + + + Creating your first Git repository ====================================== From 2e2d0c993d48c44d981d23190a8e3f1b9ca82658 Mon Sep 17 00:00:00 2001 From: ChrisLeeGit Date: Sat, 23 Jul 2016 11:40:01 +0800 Subject: [PATCH 1218/1469] =?UTF-8?q?=E7=94=B3=E8=AF=B7=2020160711=20Getti?= =?UTF-8?q?ng=20started=20with=20Git.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20160711 Getting started with Git.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160711 Getting started with Git.md b/sources/tech/20160711 Getting started with Git.md index 032e5e3510..b748a160da 100644 --- a/sources/tech/20160711 Getting started with Git.md +++ b/sources/tech/20160711 Getting started with Git.md @@ -1,3 +1,5 @@ +Being translated by ChrisLeeGit + Getting started with Git ========================= From 1e15ffd9c20c00ed666b396f8a1153d1ef0014e0 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 23 Jul 2016 18:50:28 +0800 Subject: [PATCH 1219/1469] PUB:20160701 How To Setup Bridge (br0) Network on Ubuntu Linux 14.04 and 16.04 LTS @MikeCoder --- ...ork on Ubuntu Linux 14.04 and 16.04 LTS.md | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) rename {translated/tech => published}/20160701 How To Setup Bridge (br0) Network on Ubuntu Linux 14.04 and 16.04 LTS.md (67%) diff --git a/translated/tech/20160701 How To Setup Bridge (br0) Network on Ubuntu Linux 14.04 and 16.04 LTS.md b/published/20160701 How To Setup Bridge (br0) Network on Ubuntu Linux 14.04 and 16.04 LTS.md similarity index 67% rename from translated/tech/20160701 How To Setup Bridge (br0) Network on Ubuntu Linux 14.04 and 16.04 LTS.md rename to published/20160701 How To Setup Bridge (br0) Network on Ubuntu Linux 14.04 and 16.04 LTS.md index ed2f37235a..61fba7be98 100644 --- a/translated/tech/20160701 How To Setup Bridge (br0) Network on Ubuntu Linux 14.04 and 16.04 LTS.md +++ b/published/20160701 How To Setup Bridge (br0) Network on Ubuntu Linux 14.04 and 16.04 LTS.md @@ -1,23 +1,21 @@ -如何在 Ubuntu 14.04 和 16.04 上建立网桥(br0) +如何在 Ubuntu 上建立网桥 ======================================================================= > 作为一个 Ubuntu 16.04 LTS 的初学者。如何在 Ubuntu 14.04 和 16.04 的主机上建立网桥呢? -![](http://s0.cyberciti.org/images/category/old/ubuntu-logo.jpg) +顾名思义,网桥的作用是通过物理接口连接内部和外部网络。对于虚拟端口或者 LXC/KVM/Xen/容器来说,这非常有用。网桥虚拟端口看起来是网络上的一个常规设备。在这个教程中,我将会介绍如何在 Ubuntu 服务器上通过 bridge-utils (brctl) 命令行来配置 Linux 网桥。 -顾名思义,网桥的作用是通过物理接口连接内部和外部网络。对于虚拟端口或者 LXC/KVM/Xen/容器来说,这非常有用。通过网桥虚拟端口看起来是网络上的一个常规设备。在这个教程中,我将会介绍如何在 Ubuntu 服务器上通过 bridge-utils(brctl) 命令行来配置 Linux 网桥。 - -### 网桥网络示例 +### 网桥化的网络示例 ![](http://s0.cyberciti.org/uploads/faq/2016/07/my-br0-br1-setup.jpg) ->Fig.01: Kvm/Xen/LXC 容器网桥实例 (br0) -In this example eth0 and eth1 is the physical network interface. eth0 connected to the LAN and eth1 is attached to the upstream ISP router/Internet. -在这个例子中,eth0 和 eth1 是物理网络接口。eth0 连接着局域网,eth1 连接着上游路由器/网络。 +*图 01: Kvm/Xen/LXC 容器网桥示例 (br0)* + +在这个例子中,eth0 和 eth1 是物理网络接口。eth0 连接着局域网,eth1 连接着上游路由器和互联网。 ### 安装 bridge-utils -使用[apt-get 命令][1] 安装 bridge-utils: +使用 [apt-get 命令][1] 安装 bridge-utils: ``` $ sudo apt-get install bridge-utils @@ -32,7 +30,8 @@ $ sudo apt install bridge-utils 样例输出: ![](http://s0.cyberciti.org/uploads/faq/2016/07/ubuntu-install-bridge-utils.jpg) ->Fig.02: Ubuntu 安装 bridge-utils 包 + +*图 02: Ubuntu 安装 bridge-utils 包* ### 在 Ubuntu 服务器上创建网桥 @@ -43,10 +42,10 @@ $ sudo cp /etc/network/interfaces /etc/network/interfaces.bakup-1-july-2016 $ sudo vi /etc/network/interfaces ``` -接下来设置 eth1 并且将他绑定到 br1 ,输入(删除或者注释所有 eth1 相关配置): +接下来设置 eth1 并且将它映射到 br1 ,输入如下(删除或者注释所有 eth1 相关配置): ``` -# br1 setup with static wan IPv4 with ISP router as gateway +# br1 使用静态公网 IP 地址,并以 ISP 的路由器作为网关 auto br1 iface br1 inet static address 208.43.222.51 @@ -60,7 +59,7 @@ iface br1 inet static bridge_maxwait 0 ``` -接下来设置 eth0 并将它绑定到 br0,输入(删除或者注释所有 eth1 相关配置): +接下来设置 eth0 并将它映射到 br0,输入如下(删除或者注释所有 eth0 相关配置): ``` auto br0 @@ -70,8 +69,8 @@ iface br0 inet static broadcast 10.18.44.63 dns-nameservers 10.0.80.11 10.0.80.12 # set static route for LAN - post-up route add -net 10.0.0.0 netmask 255.0.0.0 gw 10.18.44.1 - post-up route add -net 161.26.0.0 netmask 255.255.0.0 gw 10.18.44.1 + post-up route add -net 10.0.0.0 netmask 255.0.0.0 gw 10.18.44.1 + post-up route add -net 161.26.0.0 netmask 255.255.0.0 gw 10.18.44.1 bridge_ports eth0 bridge_stp off bridge_fd 0 @@ -80,7 +79,7 @@ iface br0 inet static ### 关于 br0 和 DHCP 的一点说明 -DHCP 的配置选项: +如果使用 DHCP ,配置选项是这样的: ``` auto br0 @@ -95,7 +94,7 @@ iface br0 inet dhcp ### 重启服务器或者网络服务 -你需要重启服务器或者输入下列命令来重启网络服务(在 SSH 登陆的会话中这可能不管用): +你需要重启服务器或者输入下列命令来重启网络服务(在 SSH 登录的会话中这可能不管用): ``` $ sudo systemctl restart networking @@ -111,20 +110,21 @@ $ sudo /etc/init.d/restart networking 使用 ping/ip 命令来验证 LAN 和 WAN 网络接口运行正常: ``` -# See br0 and br1 +# 查看 br0 和 br1 ip a show -# See routing info +# 查看路由信息 ip r -# ping public site +# ping 外部站点 ping -c 2 cyberciti.biz -# ping lan server +# ping 局域网服务器 ping -c 2 10.0.80.12 ``` 样例输出: ![](http://s0.cyberciti.org/uploads/faq/2016/07/br0-br1-eth0-eth1-configured-on-ubuntu.jpg) ->Fig.03: 验证网桥的以太网连接 + +*图 03: 验证网桥的以太网连接* 现在,你就可以配置 br0 和 br1 来让 XEN/KVM/LXC 容器访问因特网或者私有局域网了。再也没有必要去设置特定路由或者 iptables 的 SNAT 规则了。 @@ -134,8 +134,8 @@ ping -c 2 10.0.80.12 via: http://www.cyberciti.biz/faq/how-to-create-bridge-interface-ubuntu-linux/ 作者:[VIVEK GITE][a] -译者:[译者ID](https://github.com/MikeCoder) -校对:[校对者ID](https://github.com/校对者ID) +译者:[MikeCoder](https://github.com/MikeCoder) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 5a5b861a035bf1d4485c8d2c068bfbe82bf5f44f Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 23 Jul 2016 22:30:01 +0800 Subject: [PATCH 1220/1469] =?UTF-8?q?20160723-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... GTK 3 Tiling Terminal Emulator for Linux.md | 131 ++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 sources/tech/20160722 Terminix – A New GTK 3 Tiling Terminal Emulator for Linux.md diff --git a/sources/tech/20160722 Terminix – A New GTK 3 Tiling Terminal Emulator for Linux.md b/sources/tech/20160722 Terminix – A New GTK 3 Tiling Terminal Emulator for Linux.md new file mode 100644 index 0000000000..f593b5f119 --- /dev/null +++ b/sources/tech/20160722 Terminix – A New GTK 3 Tiling Terminal Emulator for Linux.md @@ -0,0 +1,131 @@ +Terminix – A New GTK 3 Tiling Terminal Emulator for Linux +============================================================ + +There are [multiple terminal emulators][1] you can find on the Linux platform today, with each of them offering users some remarkable features. + +But sometimes, we find it difficult to choose which terminal emulator to work with, depending on our preferences. In this overview, we shall cover one exciting terminal emulator for Linux called Terminix. + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Terminix-Terminal-Emulator-for-Linux.png) +>Terminix Terminal Emulator for Linux + +Terminix is a tiling terminal emulator that uses VTE GTK+ 3 widget. It is developed using GTK 3 with aims of conforming to GNOME HIG (Human Interface Guidelines). Additionally, this application has been tested on GNOME and Unity desktops, although users have also tested it successfully on various other Linux desktops environments. + +Just like the rest of Linux terminal emulators, Terminix comes with some illustrious features and these include: + +- Enables users to layout terminals in any style by splitting them vertically or horizontally +- Supports drag and drop functionality to re-arrange terminals +- Supports detaching of terminals from windows using drag and drop +- Supports input synchronization between terminals, therefore commands typed in one terminal can be reproduced in another +- Terminal grouping can be saved and loaded from disk +- Supports transparent backgrounds +- Allows use of background images +- Supports automatic profile switches based on hostname and directory +- Also supports notification for out of view process completion +- Color schemes stored in files and new files can be created for custom color schemes + +### How to Install Terminix on Linux Systems + +Let us now uncover the steps you can follow to install Terminix on the various Linux distributions, but before we move any further, we have to list the various requirements for Terminix to work on Linux. + +#### Dependencies + +To work very well, the application requires the following libraries: + +- GTK 3.14 and above +- GTK VTE 0.42 and above +- Dconf +- GSettings +- Nautilus-Python for Nautilus integration + +If you have all the above requirements on your system, then proceed to install Terminix as follows. + +#### On RHEL/CentOS 7 and Fedora 22-24 + +First, you need to add the package repository by creating a file `/etc/yum.repos.d/terminix.repo` using your favorite text editor as follows. + +``` +# vi /etc/yum.repos.d/terminix.repo +``` + +Then copy and paste the text below into the file above: + +``` +[heikoada-terminix] +name=Copr repo for terminix owned by heikoada +baseurl=https://copr-be.cloud.fedoraproject.org/results/heikoada/terminix/fedora-$releasever-$basearch/ +skip_if_unavailable=True +gpgcheck=1 +gpgkey=https://copr-be.cloud.fedoraproject.org/results/heikoada/terminix/pubkey.gpg +enabled=1 +enabled_metadata=1 +``` + +Save the file and exit. + +Then update your system and install Terminix as shown: + +``` +---------------- On RHEL/CentOS 7 ---------------- +# yum update +# yum install terminix + +---------------- On Fedora 22-24 ---------------- +# dnf update +# dnf install terminix +``` + +#### On Ubuntu 16.04-14.04 and Linux Mint 18-17 + +There is no official package for Debian/Ubuntu based distributions, but you can install it manually using the commands below: + +``` +$ wget -c https://github.com/gnunn1/terminix/releases/download/1.1.1/terminix.zip +$ sudo unzip terminix.zip -d / +$ sudo glib-compile-schemas /usr/share/glib-2.0/schemas/ +``` + +OpenSUSE users can install Terminix from the default repository and Arch Linux users can install the [AUR Terminix package][2]. + +### Terminix Screenshot Tour + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Terminix-Terminal.png) +>Terminix Terminal + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Terminix-Terminal-Settings.png) +>Terminix Terminal Settings + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Terminix-Terminal-Tabs.png) +>Terminix Multiple Terminal Tabs + +### How to Uninstall or Remove Terminix + +In case you installed it manually and want to remove it, then you can follow the steps below to uninstall it. Download the uninstall.sh from Github repository, make it executable and then run it: + +``` +$ wget -c https://github.com/gnunn1/terminix/blob/master/uninstall.sh +$ chmod +x uninstall.sh +$ sudo sh uninstall.sh +``` + +But if you installed it using a package manager, then you can use the package manager to uninstall it. + +Visit the [Terminix Github][3] repository + +In this overview, we have looked at an important Linux terminal emulator that is just an alternative to the multiple terminal emulators out there. Having installed it you can try out the different features and also compare it with the rest that you have probably used. + +Importantly, for any questions or extra information that you have about Terminix, please use the comment section below and do not forget to also give us feedback about your experience with it. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/terminix-tiling-terminal-emulator-for-linux/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tecmint+%28Tecmint%3A+Linux+Howto%27s+Guide%29 + +作者:[Aaron Kili][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/aaronkili/ +[1]: http://www.tecmint.com/linux-terminal-emulators/ +[2]: https://aur.archlinux.org/packages/terminix +[3]: https://github.com/gnunn1/terminix From adfee21210e8968399b80c40899dc416653503a2 Mon Sep 17 00:00:00 2001 From: Mike Tang Date: Sun, 24 Jul 2016 13:01:52 +0800 Subject: [PATCH 1221/1469] =?UTF-8?q?sources/tech/20160722=20Terminix=20?= =?UTF-8?q?=E2=80=93=20A=20New=20GTK=203=20Tiling=20Terminal=20Emulator=20?= =?UTF-8?q?for=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Terminix – A New GTK 3 Tiling Terminal Emulator for Linux.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160722 Terminix – A New GTK 3 Tiling Terminal Emulator for Linux.md b/sources/tech/20160722 Terminix – A New GTK 3 Tiling Terminal Emulator for Linux.md index f593b5f119..5ce9c05d75 100644 --- a/sources/tech/20160722 Terminix – A New GTK 3 Tiling Terminal Emulator for Linux.md +++ b/sources/tech/20160722 Terminix – A New GTK 3 Tiling Terminal Emulator for Linux.md @@ -1,3 +1,5 @@ +MikeCoder Translating + Terminix – A New GTK 3 Tiling Terminal Emulator for Linux ============================================================ From 92d1ac9dfb01f71c0ffe09e5814ffaf4cf817155 Mon Sep 17 00:00:00 2001 From: Mike Tang Date: Sun, 24 Jul 2016 14:15:01 +0800 Subject: [PATCH 1222/1469] =?UTF-8?q?translated/tech/20160722=20Terminix?= =?UTF-8?q?=20=E2=80=93=20A=20New=20GTK=203=20Tiling=20Terminal=20Emulator?= =?UTF-8?q?=20for=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... GTK 3 Tiling Terminal Emulator for Linux.md | 133 ------------------ ... GTK 3 Tiling Terminal Emulator for Linux.md | 133 ++++++++++++++++++ 2 files changed, 133 insertions(+), 133 deletions(-) delete mode 100644 sources/tech/20160722 Terminix – A New GTK 3 Tiling Terminal Emulator for Linux.md create mode 100644 translated/tech/20160722 Terminix – A New GTK 3 Tiling Terminal Emulator for Linux.md diff --git a/sources/tech/20160722 Terminix – A New GTK 3 Tiling Terminal Emulator for Linux.md b/sources/tech/20160722 Terminix – A New GTK 3 Tiling Terminal Emulator for Linux.md deleted file mode 100644 index 5ce9c05d75..0000000000 --- a/sources/tech/20160722 Terminix – A New GTK 3 Tiling Terminal Emulator for Linux.md +++ /dev/null @@ -1,133 +0,0 @@ -MikeCoder Translating - -Terminix – A New GTK 3 Tiling Terminal Emulator for Linux -============================================================ - -There are [multiple terminal emulators][1] you can find on the Linux platform today, with each of them offering users some remarkable features. - -But sometimes, we find it difficult to choose which terminal emulator to work with, depending on our preferences. In this overview, we shall cover one exciting terminal emulator for Linux called Terminix. - -![](http://www.tecmint.com/wp-content/uploads/2016/07/Terminix-Terminal-Emulator-for-Linux.png) ->Terminix Terminal Emulator for Linux - -Terminix is a tiling terminal emulator that uses VTE GTK+ 3 widget. It is developed using GTK 3 with aims of conforming to GNOME HIG (Human Interface Guidelines). Additionally, this application has been tested on GNOME and Unity desktops, although users have also tested it successfully on various other Linux desktops environments. - -Just like the rest of Linux terminal emulators, Terminix comes with some illustrious features and these include: - -- Enables users to layout terminals in any style by splitting them vertically or horizontally -- Supports drag and drop functionality to re-arrange terminals -- Supports detaching of terminals from windows using drag and drop -- Supports input synchronization between terminals, therefore commands typed in one terminal can be reproduced in another -- Terminal grouping can be saved and loaded from disk -- Supports transparent backgrounds -- Allows use of background images -- Supports automatic profile switches based on hostname and directory -- Also supports notification for out of view process completion -- Color schemes stored in files and new files can be created for custom color schemes - -### How to Install Terminix on Linux Systems - -Let us now uncover the steps you can follow to install Terminix on the various Linux distributions, but before we move any further, we have to list the various requirements for Terminix to work on Linux. - -#### Dependencies - -To work very well, the application requires the following libraries: - -- GTK 3.14 and above -- GTK VTE 0.42 and above -- Dconf -- GSettings -- Nautilus-Python for Nautilus integration - -If you have all the above requirements on your system, then proceed to install Terminix as follows. - -#### On RHEL/CentOS 7 and Fedora 22-24 - -First, you need to add the package repository by creating a file `/etc/yum.repos.d/terminix.repo` using your favorite text editor as follows. - -``` -# vi /etc/yum.repos.d/terminix.repo -``` - -Then copy and paste the text below into the file above: - -``` -[heikoada-terminix] -name=Copr repo for terminix owned by heikoada -baseurl=https://copr-be.cloud.fedoraproject.org/results/heikoada/terminix/fedora-$releasever-$basearch/ -skip_if_unavailable=True -gpgcheck=1 -gpgkey=https://copr-be.cloud.fedoraproject.org/results/heikoada/terminix/pubkey.gpg -enabled=1 -enabled_metadata=1 -``` - -Save the file and exit. - -Then update your system and install Terminix as shown: - -``` ----------------- On RHEL/CentOS 7 ---------------- -# yum update -# yum install terminix - ----------------- On Fedora 22-24 ---------------- -# dnf update -# dnf install terminix -``` - -#### On Ubuntu 16.04-14.04 and Linux Mint 18-17 - -There is no official package for Debian/Ubuntu based distributions, but you can install it manually using the commands below: - -``` -$ wget -c https://github.com/gnunn1/terminix/releases/download/1.1.1/terminix.zip -$ sudo unzip terminix.zip -d / -$ sudo glib-compile-schemas /usr/share/glib-2.0/schemas/ -``` - -OpenSUSE users can install Terminix from the default repository and Arch Linux users can install the [AUR Terminix package][2]. - -### Terminix Screenshot Tour - -![](http://www.tecmint.com/wp-content/uploads/2016/07/Terminix-Terminal.png) ->Terminix Terminal - -![](http://www.tecmint.com/wp-content/uploads/2016/07/Terminix-Terminal-Settings.png) ->Terminix Terminal Settings - -![](http://www.tecmint.com/wp-content/uploads/2016/07/Terminix-Terminal-Tabs.png) ->Terminix Multiple Terminal Tabs - -### How to Uninstall or Remove Terminix - -In case you installed it manually and want to remove it, then you can follow the steps below to uninstall it. Download the uninstall.sh from Github repository, make it executable and then run it: - -``` -$ wget -c https://github.com/gnunn1/terminix/blob/master/uninstall.sh -$ chmod +x uninstall.sh -$ sudo sh uninstall.sh -``` - -But if you installed it using a package manager, then you can use the package manager to uninstall it. - -Visit the [Terminix Github][3] repository - -In this overview, we have looked at an important Linux terminal emulator that is just an alternative to the multiple terminal emulators out there. Having installed it you can try out the different features and also compare it with the rest that you have probably used. - -Importantly, for any questions or extra information that you have about Terminix, please use the comment section below and do not forget to also give us feedback about your experience with it. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/terminix-tiling-terminal-emulator-for-linux/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tecmint+%28Tecmint%3A+Linux+Howto%27s+Guide%29 - -作者:[Aaron Kili][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/aaronkili/ -[1]: http://www.tecmint.com/linux-terminal-emulators/ -[2]: https://aur.archlinux.org/packages/terminix -[3]: https://github.com/gnunn1/terminix diff --git a/translated/tech/20160722 Terminix – A New GTK 3 Tiling Terminal Emulator for Linux.md b/translated/tech/20160722 Terminix – A New GTK 3 Tiling Terminal Emulator for Linux.md new file mode 100644 index 0000000000..9aa106dfe0 --- /dev/null +++ b/translated/tech/20160722 Terminix – A New GTK 3 Tiling Terminal Emulator for Linux.md @@ -0,0 +1,133 @@ +Terminix - 一个很赞的基于 GTK3 的 Linux 终端模拟器 +============================================================ + +现在,你可以很容易的找到[大量的 Linux 终端模拟器][1],每一个都可以给用户留下深刻的印象。 + +但是,很多时候,我们会很难根据我们的喜好来选择一款来作为日常终端模拟器。这篇文章中,我们将会推荐一款叫做 Terminix 的令人激动的终端模拟机。 + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Terminix-Terminal-Emulator-for-Linux.png) +>Terminix Linux 终端模拟器 + +Terminix 是一个使用 VTE GTK+ 3 插件的终端模拟器。使用 GTK 3 开发的原因主要是为了符合 GNOME HIG(Human Interface Guidelines) 标准。另外,Terminix 已经在 GNOME 和 Unity 桌面环境下完成了测试。同时,志愿者也在其他的 Linux 桌面环境下进行了测试。 + +和其他的终端模拟器一样,Terminix 有着很多著名的特点,列表如下: + +- 允许用户进行自定义的垂直或者水平分屏。 +- 支持功能性的拖拽来进行重新布局 +- 支持拖拽Tab 的方式,新建终端窗口 +- 支持终端之间的输入同步,因此,命令可以在一个终端输入,同时另一个终端进行展示 +- 终端的分组配置可以保存在硬盘 +- 支持透明背景 +- 允许使用背景图片 +- 支持通过主机名和目录来自动切换配置 +- 支持来自其他进程的通知信息 +- 配色模式使用文件存储,同时支持自定义配色方案 + +### 如何在 Linux 系统上安装 Terminix + +现在来详细说明一下在不同的 Linux 发行版本上安装 Terminix 的步骤。首先,在此列出 Terminix 在 Linux 所需要的环境需求。 + +#### 依赖组件 + +为了正常运行,该应用需要使用如下库: + +- GTK 3.14 或者以上版本 +- GTK VTE 0.42 或者以上版本 +- Dconf +- GSettings +- Nautilus 的 iNautilus-Python 插件 + +如果你已经满足了如上的系统 要求,接下来就是安装 Terminix 的步骤。 + +#### 在 RHEL/CentOS 7 或者 Fedora 22-24 上 + +首先,你需要将包仓库通过新建文件 `/etc/yum.repos.d/terminix.repo` 的方式,然后使用你最喜欢的文本编辑器来进行编辑。 + +``` +# vi /etc/yum.repos.d/terminix.repo +``` + +然后拷贝如下的文字,并且拷贝到我们刚新建的文件中: + +``` +[heikoada-terminix] +name=Copr repo for terminix owned by heikoada +baseurl=https://copr-be.cloud.fedoraproject.org/results/heikoada/terminix/fedora-$releasever-$basearch/ +skip_if_unavailable=True +gpgcheck=1 +gpgkey=https://copr-be.cloud.fedoraproject.org/results/heikoada/terminix/pubkey.gpg +enabled=1 +enabled_metadata=1 +``` + +保存文件并退出。 + +然后更新你的系统,并且安装 Terminix,步骤如下: + +``` +---------------- On RHEL/CentOS 7 ---------------- +# yum update +# yum install terminix + +---------------- On Fedora 22-24 ---------------- +# dnf update +# dnf install terminix +``` + +#### 在 Ubuntu 16.04-14.04 和 Linux Mint 18-17 + +虽然没有基于 Debian/Ubuntu 发行版本的官方的软件包,但是你依旧可以通过如下的命令手动安装。 + +``` +$ wget -c https://github.com/gnunn1/terminix/releases/download/1.1.1/terminix.zip +$ sudo unzip terminix.zip -d / +$ sudo glib-compile-schemas /usr/share/glib-2.0/schemas/ +``` + +OpenSUSE users can install Terminix from the default repository and Arch Linux users can install the [AUR Terminix package][2]. +OpenSUSE 用户可以从默认的仓库中安装 Terminix,Arch Linux 用户也可以安装 [AUR Terminix 软件包][2]。 + +### Terminix 截图教程 + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Terminix-Terminal.png) +>Terminix Terminal + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Terminix-Terminal-Settings.png) +>Terminix Terminal Settings + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Terminix-Terminal-Tabs.png) +>Terminix Multiple Terminal Tabs + +### 如何卸载删除 Terminix + +In case you installed it manually and want to remove it, then you can follow the steps below to uninstall it. Download the uninstall.sh from Github repository, make it executable and then run it: +如果你是手动安装的 Terminix 并且想要删除他,那么你可以参照如下的步骤来卸载它。从 Github 仓库上下载 uninstall.sh,并且给它可执行权限并且执行它: + +``` +$ wget -c https://github.com/gnunn1/terminix/blob/master/uninstall.sh +$ chmod +x uninstall.sh +$ sudo sh uninstall.sh +``` + +但是如果你是通过包管理器安装的 Terminix,你依旧可以使用包管理器来卸载它。 + +请浏览 [Terminix Github][3] 仓库 + +在这个总览中,我们在众多优秀的终端模拟器中了解了一个重要的 Linux 终端模拟器。你可以尝试着去体验下它的新特性,并且可以将它和你现在使用的终端进行比较。 + +重要的一点,如果你想得到关于 Terminix 的更多信息或者有疑问,请使用评论区,而且不要忘了,给我一个关于你使用体验的反馈。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/terminix-tiling-terminal-emulator-for-linux/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tecmint+%28Tecmint%3A+Linux+Howto%27s+Guide%29 + +作者:[Aaron Kili][a] +译者:[译者ID](https://github.com/MikeCoder) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.tecmint.com/author/aaronkili/ +[1]: http://www.tecmint.com/linux-terminal-emulators/ +[2]: https://aur.archlinux.org/packages/terminix +[3]: https://github.com/gnunn1/terminix From 8e9f9135f5002b0e2abbfeca85b5330cb8c80d05 Mon Sep 17 00:00:00 2001 From: Mike Tang Date: Sun, 24 Jul 2016 14:15:18 +0800 Subject: [PATCH 1223/1469] =?UTF-8?q?translated/tech/20160722=20Terminix?= =?UTF-8?q?=20=E2=80=93=20A=20New=20GTK=203=20Tiling=20Terminal=20Emulator?= =?UTF-8?q?=20for=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Terminix – A New GTK 3 Tiling Terminal Emulator for Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20160722 Terminix – A New GTK 3 Tiling Terminal Emulator for Linux.md b/translated/tech/20160722 Terminix – A New GTK 3 Tiling Terminal Emulator for Linux.md index 9aa106dfe0..2a74e62ca1 100644 --- a/translated/tech/20160722 Terminix – A New GTK 3 Tiling Terminal Emulator for Linux.md +++ b/translated/tech/20160722 Terminix – A New GTK 3 Tiling Terminal Emulator for Linux.md @@ -14,7 +14,7 @@ Terminix 是一个使用 VTE GTK+ 3 插件的终端模拟器。使用 GTK 3 开 - 允许用户进行自定义的垂直或者水平分屏。 - 支持功能性的拖拽来进行重新布局 -- 支持拖拽Tab 的方式,新建终端窗口 +- 支持拖拽 Tab 的方式,新建终端窗口 - 支持终端之间的输入同步,因此,命令可以在一个终端输入,同时另一个终端进行展示 - 终端的分组配置可以保存在硬盘 - 支持透明背景 From 82661ad8bd1578b735c8dc6d5b499f9df3e726cb Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 24 Jul 2016 15:02:56 +0800 Subject: [PATCH 1224/1469] PUB:20160519 The future of sharing integrating Pydio and ownCloud @martin2011qi --- ... sharing integrating Pydio and ownCloud.md | 65 +++++++++++++++++++ ... sharing integrating Pydio and ownCloud.md | 65 ------------------- 2 files changed, 65 insertions(+), 65 deletions(-) create mode 100644 published/20160519 The future of sharing integrating Pydio and ownCloud.md delete mode 100644 translated/tech/20160519 The future of sharing integrating Pydio and ownCloud.md diff --git a/published/20160519 The future of sharing integrating Pydio and ownCloud.md b/published/20160519 The future of sharing integrating Pydio and ownCloud.md new file mode 100644 index 0000000000..5c1b998508 --- /dev/null +++ b/published/20160519 The future of sharing integrating Pydio and ownCloud.md @@ -0,0 +1,65 @@ +共享的未来:Pydio 与 ownCloud 的联合 +========================================================= + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BIZ_darwincloud_520x292_0311LL.png?itok=5yWIaEDe) + +*图片来源 : opensource.com* + +开源共享生态圈内容纳了许多各异的项目,它们每一个都给出了自己的解决方案,且每一个都不按套路来。有很多原因导致你选择开源的解决方案,而非 Dropbox、Google Drive、iCloud 或 OneDrive 这些商业的解决方案。这些商业的解决方案虽然能让你不必为如何管理数据担心,但也理所应当的带着种种限制,其中就包括对于原有基础结构的控制和整合不足。 + +对于用户而言仍有相当一部分可供选择的文件分享和同步的替代品,其中就包括了 Pydio 和 ownCloud。 + +### Pydio + +Pydio (Put your data in orbit 把你的数据放上轨道) 项目由一位作曲家 Charles du Jeu 发起,起初他只是需要一种与乐队成员分享大型音频文件的方法。[Pydio][1] 是一种文件分享与同步的解决方案,综合了多存储后端,设计时还同时考虑了开发者和系统管理员两方面。在世界各地有逾百万的下载量,已被翻译成 27 种语言。 + +项目在刚开始的时候便开源了,先是在 [SourceForge][2] 上茁壮的成长,现在已在 [GitHub][3] 上安了家。 + +用户界面基于 Google 的 [Material 设计风格][4]。用户可以使用现有的传统文件基础结构或是根据预估的需求部署 Pydio,并通过 web、桌面和移动端应用随时随地地管理自己的东西。对于管理员来说,细粒度的访问权限绝对是配置访问时的利器。 + +在 [Pydio 社区][5],你可以找到许多让你增速的资源。Pydio 网站 [对于如何为 Pydio GitHub 仓库贡献][6] 给出了明确的指导方案。[论坛][7]中也包含了开发者板块和社区。 + +### ownCloud + +[ownCloud][8] 在世界各地拥有逾 8 百万的用户,它是一个开源、自行管理的文件同步共享技术。同步客户端支持所有主流平台并支持 WebDAV 通过 web 界面实现。ownCloud 拥有简单的使用界面,强大的管理工具,和大规模的共享及协作功能——以满足用户管理数据时的需求。 + +ownCloud 的开放式架构是通过 API 和为应用提供平台来实现可扩展性的。迄今已有逾 300 款应用,功能包括处理像日历、联系人、邮件、音乐、密码、笔记等诸多数据类型。ownCloud 由一个数百位贡献者的国际化的社区开发,安全,并且能做到为小到一个树莓派大到好几百万用户的 PB 级存储集群量身定制。 + +### 联合共享 (Federated sharing) + +文件共享开始转向团队合作时代,而标准化为合作提供了坚实的土壤。 + +联合共享(Federated sharing)——一个由 [OpenCloudMesh][9] 项目提供的新的开放标准,就是在这个方向迈出的一步。先不说别的,在支持该标准的服务器之间分享文件和文件夹,比如说 Pydio 和 ownCloud。 + +ownCloud 7 率先引入该标准,这种服务器到服务器的分享方式可以让你挂载远程服务器上共享的文件,实际上就是创建你自己的云上之云。你可以直接为其它支持联合共享的服务器上的用户创建共享链接。 + +实现这个新的 API 允许存储解决方案之间更深层次的集成,同时保留了原有平台的安全,控制和特性。 + +“交换和共享文件是当下和未来不可或缺的东西。”ownCloud 的创始人 Frank Karlitschek 说道:“正因如此,采用联合和分布的方式而非集中的数据孤岛就显得至关重要。联合共享的设计初衷便是在保证安全和用户隐私的同时追求分享的无缝、至简之道。” + +### 下一步是什么呢? + +正如 OpenCloudMesh 做的那样,将会通过像 Pydio 和 ownCloud 这样的机构和公司,合作推广这一文件共享的新开放标准。ownCloud 9 已经引入联合的服务器之间交换用户列表的功能,让你的用户们在你的服务器上享有和你同样的无缝体验。将来,一个中央地址簿服务(联合的)集合,用以检索其他联合云 ID 的构想可能会把云间合作推向一个新的高度。 + +这一举措无疑有助于日益开放的技术社区中的那些成员方便地讨论,开发,并推动“OCM 分享 API”作为一个厂商中立协议。所有领导 OCM 项目的合作伙伴都全心致力于开放 API 的设计原则,并欢迎其他开源的文件分享和同步社区参与并加入其中。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/business/16/5/sharing-files-pydio-owncloud + +作者:[ben van 't ende][a] +译者:[martin2011qi](https://github.com/martin2011qi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/benvantende +[1]: https://pydio.com/ +[2]: https://sourceforge.net/projects/ajaxplorer/ +[3]: https://github.com/pydio/ +[4]: https://www.google.com/design/spec/material-design/introduction.html +[5]: https://pydio.com/en/community +[6]: https://pydio.com/en/community/contribute +[7]: https://pydio.com/forum/f +[8]: https://owncloud.org/ +[9]: https://wiki.geant.org/display/OCM/Open+Cloud+Mesh diff --git a/translated/tech/20160519 The future of sharing integrating Pydio and ownCloud.md b/translated/tech/20160519 The future of sharing integrating Pydio and ownCloud.md deleted file mode 100644 index bf5a25c77e..0000000000 --- a/translated/tech/20160519 The future of sharing integrating Pydio and ownCloud.md +++ /dev/null @@ -1,65 +0,0 @@ -分享的未来:整合 Pydio 与 ownCloud -========================================================= - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BIZ_darwincloud_520x292_0311LL.png?itok=5yWIaEDe) ->图片来源 : -opensource.com - -开源共享生态圈内容纳了许多各异的项目,他们每一个都能提供出自己的解决方案,且每一个都不按套路来。有很多原因导致你选择开源的解决方案,而非 Dropbox、Google Drive、iCloud 或 OneDrive 这些商业的解决方案。这些商业的解决方案虽然能让你不必为如何管理数据担心,但也理所应当的带着种种限制,其中就包含对于原有基础结构的控制和整合不足。 - -对于用户而言仍有相当一部分文件分享和同步的替代品可供选择,其中就包括了 Pydio 和 ownCloud。 - -### Pydio - -Pydio (Put your data in orbit 把你的数据放上轨道) 项目由一位作曲家 Charles du Jeu 发起,起初他也只是需要一种与乐队成员分享大型音频文件的方法。[Pydio][1] 是一种文件分享与同步的解决方案,综合了多存储后端,设计时还同时考虑了开发者和系统管理员两方面。在世界各地有逾百万的下载量,已被翻译成 27 种语言。 - -项目在很开始的时候便开源了,先是在 [SourceForge][2] 上茁壮的成长,现在已在 [GitHub][3] 上安了家.。 - -用户界面基于 Google 的 [Material 设计][4]。用户可以使用现有的传统的文件基础结构或是本地部署 Pydio,并通过 web、桌面和移动端应用随时随地地管理自己的东西。对于管理员来说,细粒度的访问权限绝对是配置访问时的利器。 - -在 [Pydio 社区][5],你可以找到许多让你增速的资源。Pydio 网站 [对于如何为 Pydio GitHub 仓库贡献][6] 给出了明确的指导方案。[论坛][7]中也包含了开发者板块和社区。 - -### ownCloud - -[ownCloud][8] 在世界各地拥有逾 8 百万的用户,并且开源,支持自托管文件同步,且共享技术。同步客户端支持所有主流平台并支持 WebDAV 通过 web 界面实现。ownCloud 拥有简单的使用界面,强大的管理工具,和大规模的共享及协作功能——以满足用户管理数据时的需求。 - -ownCloud 的开放式架构是通过 API 和为应用提供平台来实现可扩展性的。迄今已有逾 300 款应用,功能包括处理像日历、联系人、邮件、音乐、密码、笔记等诸多数据类型。ownCloud 由一个数百位贡献者的国际化的社区开发,安全,并且能做到为小到一个树莓派大到好几百万用户的 PB 级存储集群量身定制。 - -### 联合共享 (Federated sharing) - -文件共享开始转向团队合作时代,而标准化为合作提供了坚实的土壤。 - -联合共享——一个由 [OpenCloudMesh][9] 项目提供的新开放标准,就是在这个方向迈出的一步。先不说别的,在支持该标准的服务端上,可以像 Pydio 和 ownCloud 那样分享文件和文件夹。 - -ownCloud 7 率先引入,这种服务端到服务端的分享方式可以让你挂载远程服务端上共享的文件,实际上就是创建你所有云的云。你可以直接创建共享链接,让用户在其他支持联合云共享的服务端上使用。 - -实现这个新的 API 允许存储解决方案之间更深层次的集成,同时保留了原有平台的安全,控制和属性。 - -“交换和共享文件是当下和未来不可或缺的东西。”ownCloud 的创始人 Frank Karlitschek 说道:“正因如此,采用联合和分布的方式而非集中的数据孤岛就显得至关重要。[联合共享]的设计初衷便是在保证安全和用户隐私的同时追求分享的无缝、至简之道。” - -### 下一步是什么呢? - -正如 OpenCloudMesh 做的那样,将会通过像 Pydio 和 ownCloud 这样的机构和公司,合作推广这一文件共享的新开放标准。ownCloud 9 已经引入联合服务端间交换用户列表的功能,让你的用户在你的服务器上享有和你同样的无缝体验。将来,一个中央地址簿服务(联合!)集合,用以检索其他联合云 ID 的想法可能会把云间合作推向一个新的高度。 - -这一举措无疑有助于日益开放的技术社区中的那些成员方便地讨论,开发,并推动“OCM 分享 API”作为一个厂商中立协议。所有领导 OCM 项目的合作伙伴都全心致力于开放 API 的设计原理,并欢迎其他开源的文件分享和同步社区参与并加入其中。 - --------------------------------------------------------------------------------- - -via: https://opensource.com/business/16/5/sharing-files-pydio-owncloud - -作者:[ben van 't ende][a] -译者:[martin2011qi](https://github.com/martin2011qi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/benvantende -[1]: https://pydio.com/ -[2]: https://sourceforge.net/projects/ajaxplorer/ -[3]: https://github.com/pydio/ -[4]: https://www.google.com/design/spec/material-design/introduction.html -[5]: https://pydio.com/en/community -[6]: https://pydio.com/en/community/contribute -[7]: https://pydio.com/forum/f -[8]: https://owncloud.org/ -[9]: https://wiki.geant.org/display/OCM/Open+Cloud+Mesh From d8037c5dabfd1e56c729faa4778ea2d5dd52ac7c Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 24 Jul 2016 18:28:21 +0800 Subject: [PATCH 1225/1469] =?UTF-8?q?PUB:Part=206=20-=20How=20to=20Use=20?= =?UTF-8?q?=E2=80=98next=E2=80=99=20Command=20with=20Awk=20in=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @kokialoves 整体翻译的不错,有些细节需要注意。另外还有就是标点符号的使用。 --- ...to Use ‘next’ Command with Awk in Linux.md | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) rename {translated/tech => published}/awk/Part 6 - How to Use ‘next’ Command with Awk in Linux.md (59%) diff --git a/translated/tech/awk/Part 6 - How to Use ‘next’ Command with Awk in Linux.md b/published/awk/Part 6 - How to Use ‘next’ Command with Awk in Linux.md similarity index 59% rename from translated/tech/awk/Part 6 - How to Use ‘next’ Command with Awk in Linux.md rename to published/awk/Part 6 - How to Use ‘next’ Command with Awk in Linux.md index 8ead60bd44..c2d277fc17 100644 --- a/translated/tech/awk/Part 6 - How to Use ‘next’ Command with Awk in Linux.md +++ b/published/awk/Part 6 - How to Use ‘next’ Command with Awk in Linux.md @@ -1,13 +1,13 @@ - -如何使用AWK的‘next’命令 +awk 系列:如何使用 awk 的 ‘next’ 命令 ============================================= ![](http://www.tecmint.com/wp-content/uploads/2016/06/Use-next-Command-with-Awk-in-Linux.png) -在Awk 系列的第六章, 我们来看一下`next`命令 ,它告诉 Awk 跳过你所提供的表达式而是读取下一个输入行. -`next` 命令帮助你阻止运行多余的步骤. +在 awk 系列的第六节,我们来看一下`next`命令 ,它告诉 awk 跳过你所提供的所有剩下的模式和表达式,直接处理下一个输入行。 -要明白它是如何工作的, 让我们来分析一下food_list.txt它看起来像这样 : +`next` 命令帮助你阻止运行命令执行过程中多余的步骤。 + +要明白它是如何工作的, 让我们来分析一下 food_list.txt 它看起来像这样: ``` Food List Items @@ -20,7 +20,7 @@ No Item_Name Price Quantity 6 Bananas $3.45 30 ``` -运行下面的命令,它将在每个食物数量小于或者等于20的行后面标一个星号: +运行下面的命令,它将在每个食物数量小于或者等于 20 的行后面标一个星号: ``` # awk '$4 <= 20 { printf "%s\t%s\n", $0,"*" ; } $4 > 20 { print $0 ;} ' food_list.txt @@ -36,14 +36,14 @@ No Item_Name Price Quantity 上面的命令实际运行如下: -- 首先, 它用`$4 <= 20`表达式检查每个输入行的第四列是否小于或者等于20,如果满足条件, 它将在末尾打一个星号 `(*)` . -- 接着, 它用`$4 > 20`表达式检查每个输入行的第四列是否大于20,如果满足条件,显示出来. +- 首先,它用`$4 <= 20`表达式检查每个输入行的第四列(数量(Quantity))是否小于或者等于 20,如果满足条件,它将在末尾打一个星号 `(*)`。 +- 接着,它用`$4 > 20`表达式检查每个输入行的第四列是否大于20,如果满足条件,显示出来。 但是这里有一个问题, 当第一个表达式用`{ printf "%s\t%s\n", $0,"**" ; }`命令进行标注的时候在同样的步骤第二个表达式也进行了判断这样就浪费了时间. -因此当我们已经用第一个表达式打印标志行的时候就不在需要用第二个表达式`$4 > 20`再次打印. +因此当我们已经用第一个表达式打印标志行的时候就不再需要用第二个表达式`$4 > 20`再次打印。 -要处理这个问题, 我们需要用到`next` 命令: +要处理这个问题, 我们需要用到`next` 命令: ``` # awk '$4 <= 20 { printf "%s\t%s\n", $0,"*" ; next; } $4 > 20 { print $0 ;} ' food_list.txt @@ -57,11 +57,11 @@ No Item_Name Price Quantity 6 Bananas $3.45 30 ``` -当输入行用`$4 <= 20` `{ printf "%s\t%s\n", $0,"*" ; next ; }`命令打印以后,`next`命令 将跳过第二个`$4 > 20` `{ print $0 ;}`表达式, 继续判断下一个输入行,而不是浪费时间继续判断一下是不是当前输入行还大于20. +当输入行用`$4 <= 20` `{ printf "%s\t%s\n", $0,"*" ; next ; }`命令打印以后,`next`命令将跳过第二个`$4 > 20` `{ print $0 ;}`表达式,继续判断下一个输入行,而不是浪费时间继续判断一下是不是当前输入行还大于 20。 -next命令在编写高效的命令脚本时候是非常重要的, 它可以很大的提高脚本速度. 下面我们准备来学习Awk的下一个系列了. +`next`命令在编写高效的命令脚本时候是非常重要的,它可以提高脚本速度。本系列的下一部分我们将来学习如何使用 awk 来处理标准输入(STDIN)。 -希望这篇文章对你有帮助,你可以给我们留言. +希望这篇文章对你有帮助,你可以给我们留言。 -------------------------------------------------------------------------------- @@ -69,7 +69,7 @@ via: http://www.tecmint.com/use-next-command-with-awk-in-linux/ 作者:[Aaron Kili][a] 译者:[kokialoves](https://github.com/kokialoves) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a01adedd95a0b5ff3b43ac39ffd11ff554eec376 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 24 Jul 2016 18:40:34 +0800 Subject: [PATCH 1226/1469] PUB:Part 7 - How to Read Awk Input from STDIN in Linux @vim-kakali --- ...w to Read Awk Input from STDIN in Linux.md | 75 ++++++++++++++++++ ...w to Read Awk Input from STDIN in Linux.md | 76 ------------------- 2 files changed, 75 insertions(+), 76 deletions(-) create mode 100644 published/awk/Part 7 - How to Read Awk Input from STDIN in Linux.md delete mode 100644 translated/tech/awk/Part 7 - How to Read Awk Input from STDIN in Linux.md diff --git a/published/awk/Part 7 - How to Read Awk Input from STDIN in Linux.md b/published/awk/Part 7 - How to Read Awk Input from STDIN in Linux.md new file mode 100644 index 0000000000..2730691459 --- /dev/null +++ b/published/awk/Part 7 - How to Read Awk Input from STDIN in Linux.md @@ -0,0 +1,75 @@ +awk 系列:awk 怎么从标准输入(STDIN)读取输入 +============================================ + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Read-Awk-Input-from-STDIN.png) + +在 awk 系列的前几节,我们看到大多数操作都是从一个文件或多个文件读取输入,或者你想要把标准输入作为 awk 的输入。 + +在 awk 系列的第七节中,我们将会看到几个例子,你可以筛选其他命令的输出代替从一个文件读取输入作为 awk 的输入。 + +我们首先从使用 [dir 命令][1]开始,它类似于 [ls 命令][2],在第一个例子下面,我们使用 `dir -l` 命令的输出作为 awk 命令的输入,这样就可以打印出文件拥有者的用户名,所属组组名以及在当前路径下他/她拥有的文件。 + +``` +# dir -l | awk '{print $3, $4, $9;}' +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/06/List-Files-Owned-By-User-in-Directory.png) + +*列出当前路径下的用户文件* + + +再来看另一个例子,我们[使用 awk 表达式][3] ,在这里,我们想要在 awk 命令里使用一个表达式筛选出字符串来打印出属于 root 用户的文件。命令如下: + +``` +# dir -l | awk '$3=="root" {print $1,$3,$4, $9;} ' +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/06/List-Files-Owned-by-Root-User.png) + +*列出 root 用户的文件* + +上面的命令包含了 `(==)` 来进行比较操作,这帮助我们在当前路径下筛选出 root 用户的文件。这是通过使用 `$3=="root"` 表达式实现的。 + +让我们再看另一个例子,我们使用一个 [awk 比较运算符][4] 来匹配一个确定的字符串。 + +这里,我们使用了 [cat 命令][5] 来浏览文件名为 tecmint_deals.txt 的文件内容,并且我们想要仅仅查看有字符串 Tech 的部分,所以我们会运行下列命令: + +``` +# cat tecmint_deals.txt +# cat tecmint_deals.txt | awk '$4 ~ /tech/{print}' +# cat tecmint_deals.txt | awk '$4 ~ /Tech/{print}' +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Use-Comparison-Operator-to-Match-String.png) + +*用 Awk 比较运算符匹配字符串* + +在上面的例子中,我们已经用了参数为 `~ /匹配字符/` 的比较操作,但是上面的两个命令给我们展示了一些很重要的问题。 + +当你运行带有 tech 字符串的命令时终端没有输出,因为在文件中没有 tech 这种字符串,但是运行带有 Tech 字符串的命令,你却会得到包含 Tech 的输出。 + +所以你应该在进行这种比较操作的时候时刻注意这种问题,正如我们在上面看到的那样,awk 对大小写很敏感。 + +你总是可以使用另一个命令的输出作为 awk 命令的输入来代替从一个文件中读取输入,这就像我们在上面看到的那样简单。 + +希望这些例子足够简单到可以使你理解 awk 的用法,如果你有任何问题,你可以在下面的评论区提问,记得查看 awk 系列接下来的章节内容,我们将关注 awk 的一些功能,比如变量,数字表达式以及赋值运算符。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/read-awk-input-from-stdin-in-linux/ + +作者:[Aaron Kili][a] +译者:[vim-kakali](https://github.com/vim-kakali) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.tecmint.com/author/aaronkili/ +[1]: http://www.tecmint.com/linux-dir-command-usage-with-examples/ +[2]: http://www.tecmint.com/15-basic-ls-command-examples-in-linux/ +[3]: https://linux.cn/article-7599-1.html +[4]: https://linux.cn/article-7602-1.html +[5]: http://www.tecmint.com/13-basic-cat-command-examples-in-linux/ + + + diff --git a/translated/tech/awk/Part 7 - How to Read Awk Input from STDIN in Linux.md b/translated/tech/awk/Part 7 - How to Read Awk Input from STDIN in Linux.md deleted file mode 100644 index 0d0d499d00..0000000000 --- a/translated/tech/awk/Part 7 - How to Read Awk Input from STDIN in Linux.md +++ /dev/null @@ -1,76 +0,0 @@ - - -在 Linux 上怎么读取标准输入(STDIN)作为 Awk 的输入 -============================================ - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Read-Awk-Input-from-STDIN.png) - - -在 Awk 工具系列的前几节,我们看到大多数操作都是从一个文件或多个文件读取输入,或者你想要把标准输入作为 Awk 的输入. -在 Awk 系列的第7节中,我们将会看到几个例子,这些例子都是关于你可以筛选其他命令的输出代替从一个文件读取输入作为 awk 的输入. - - -我们开始使用 [dir utility][1] , dir 命令和 [ls 命令][2] 相似,在第一个例子下面,我们使用 'dir -l' 命令的输出作为 Awk 命令的输入,这样就可以打印出文件拥有者的用户名,所属组组名以及在当前路径下他/她拥有的文件. -``` -# dir -l | awk '{print $3, $4, $9;}' -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/06/List-Files-Owned-By-User-in-Directory.png) ->列出当前路径下的用户文件 - - -看另一个例子,我们 [使用 awk 表达式][3] ,在这里,我们想要在 awk 命令里使用一个表达式筛选出字符串,通过这样来打印出 root 用户的文件.命令如下: -``` -# dir -l | awk '$3=="root" {print $1,$3,$4, $9;} ' -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/06/List-Files-Owned-by-Root-User.png) ->列出 root 用户的文件 - - -上面的命令包含了 '(==)' 来进行比较操作,这帮助我们在当前路径下筛选出 root 用户的文件.这种方法的实现是通过使用 '$3=="root"' 表达式. - -让我们再看另一个例子,我们使用一个 [awk 比较运算符][4] 来匹配一个确定的字符串. - - -现在,我们已经用了 [cat utility][5] 来浏览文件名为 tecmint_deals.txt 的文件内容,并且我们想要仅仅查看有字符串 Tech 的部分,所以我们会运行下列命令: -``` -# cat tecmint_deals.txt -# cat tecmint_deals.txt | awk '$4 ~ /tech/{print}' -# cat tecmint_deals.txt | awk '$4 ~ /Tech/{print}' -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Use-Comparison-Operator-to-Match-String.png) ->用 Awk 比较运算符匹配字符串 - - -在上面的例子中,我们已经用了参数为 `~ /匹配字符/` 的比较操作,但是上面的两个命令给我们展示了一些很重要的问题. - -当你运行带有 tech 字符串的命令时终端没有输出,因为在文件中没有 tech 这种字符串,但是运行带有 Tech 字符串的命令,你却会得到包含 Tech 的输出. - -所以你应该在进行这种比较操作的时候时刻注意这种问题,正如我们在上面看到的那样, awk 对大小写很敏感. - - -你可以一直使用另一个命令的输出作为 awk 命令的输入来代替从一个文件中读取输入,这就像我们在上面看到的那样简单. - - -希望这些例子足够简单可以使你理解 awk 的用法,如果你有任何问题,你可以在下面的评论区提问,记得查看 awk 系列接下来的章节内容,我们将关注 awk 的一些功能,比如变量,数字表达式以及赋值运算符. --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/read-awk-input-from-stdin-in-linux/ - -作者:[Aaron Kili][a] -译者:[vim-kakali](https://github.com/vim-kakali) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://www.tecmint.com/author/aaronkili/ -[1]: http://www.tecmint.com/linux-dir-command-usage-with-examples/ -[2]: http://www.tecmint.com/15-basic-ls-command-examples-in-linux/ -[3]: http://www.tecmint.com/combine-multiple-expressions-in-awk -[4]: http://www.tecmint.com/comparison-operators-in-awk -[5]: http://www.tecmint.com/13-basic-cat-command-examples-in-linux/ - - - From b51eea158ccb55b5d9127836930a064781ea2076 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 24 Jul 2016 19:03:46 +0800 Subject: [PATCH 1227/1469] =?UTF-8?q?PUB:20160722=20Terminix=20=E2=80=93?= =?UTF-8?q?=20A=20New=20GTK=203=20Tiling=20Terminal=20Emulator=20for=20Lin?= =?UTF-8?q?ux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @MikeCoder --- ... GTK 3 Tiling Terminal Emulator for Linux.md | 136 ++++++++++++++++++ ... GTK 3 Tiling Terminal Emulator for Linux.md | 133 ----------------- 2 files changed, 136 insertions(+), 133 deletions(-) create mode 100644 published/20160722 Terminix – A New GTK 3 Tiling Terminal Emulator for Linux.md delete mode 100644 translated/tech/20160722 Terminix – A New GTK 3 Tiling Terminal Emulator for Linux.md diff --git a/published/20160722 Terminix – A New GTK 3 Tiling Terminal Emulator for Linux.md b/published/20160722 Terminix – A New GTK 3 Tiling Terminal Emulator for Linux.md new file mode 100644 index 0000000000..e9ec640549 --- /dev/null +++ b/published/20160722 Terminix – A New GTK 3 Tiling Terminal Emulator for Linux.md @@ -0,0 +1,136 @@ +Terminix:一个很赞的基于 GTK3 的平铺式 Linux 终端模拟器 +============================================================ + +现在,你可以很容易的找到[大量的 Linux 终端模拟器][1],每一个都可以给用户留下深刻的印象。 + +但是,很多时候,我们会很难根据我们的喜好来找到一款心仪的日常使用的终端模拟器。这篇文章中,我们将会推荐一款叫做 Terminix 的令人激动的终端模拟机。 + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Terminix-Terminal-Emulator-for-Linux.png) + +*Terminix Linux 终端模拟器* + +Terminix 是一个使用 VTE GTK+ 3 组件的平铺式终端模拟器。使用 GTK 3 开发的原因主要是为了符合 GNOME HIG(人机接口 Human Interface Guidelines) 标准。另外,Terminix 已经在 GNOME 和 Unity 桌面环境下测试过了,也有用户在其他的 Linux 桌面环境下测试成功。 + +和其他的终端模拟器一样,Terminix 有着很多知名的特征,列表如下: + +- 允许用户进行任意的垂直或者水平分屏 +- 支持拖拽功能来进行重新排布终端 +- 支持使用拖拽的方式终端从窗口中将脱离出来 +- 支持终端之间的输入同步,因此,可以在一个终端输入命令,而在另一个终端同步复现 +- 终端的分组配置可以保存在硬盘,并再次加载 +- 支持透明背景 +- 允许使用背景图片 +- 基于主机和目录来自动切换配置 +- 支持进程完成的通知信息 +- 配色方案采用文件存储,同时支持自定义配色方案 + +### 如何在 Linux 系统上安装 Terminix + +现在来详细说明一下在不同的 Linux 发行版本上安装 Terminix 的步骤。首先,在此列出 Terminix 在 Linux 所需要的环境需求。 + +#### 依赖组件 + +为了正常运行,该应用需要使用如下库: + +- GTK 3.14 或者以上版本 +- GTK VTE 0.42 或者以上版本 +- Dconf +- GSettings +- Nautilus 的 iNautilus-Python 插件 + +如果你已经满足了如上的系统要求,接下来就是安装 Terminix 的步骤。 + +#### 在 RHEL/CentOS 7 或者 Fedora 22-24 上 + +首先,你需要通过新建文件 `/etc/yum.repos.d/terminix.repo` 来增加软件仓库,使用你最喜欢的文本编辑器来进行编辑: + +``` +# vi /etc/yum.repos.d/terminix.repo +``` + +然后拷贝如下的文字到我们刚新建的文件中: + +``` +[heikoada-terminix] +name=Copr repo for terminix owned by heikoada +baseurl=https://copr-be.cloud.fedoraproject.org/results/heikoada/terminix/fedora-$releasever-$basearch/ +skip_if_unavailable=True +gpgcheck=1 +gpgkey=https://copr-be.cloud.fedoraproject.org/results/heikoada/terminix/pubkey.gpg +enabled=1 +enabled_metadata=1 +``` + +保存文件并退出。 + +然后更新你的系统,并且安装 Terminix,步骤如下: + +``` +---------------- On RHEL/CentOS 7 ---------------- +# yum update +# yum install terminix + +---------------- On Fedora 22-24 ---------------- +# dnf update +# dnf install terminix +``` + +#### 在 Ubuntu 16.04-14.04 和 Linux Mint 18-17 + +虽然没有基于 Debian/Ubuntu 发行版本的官方的软件包,但是你依旧可以通过如下的命令手动安装。 + +``` +$ wget -c https://github.com/gnunn1/terminix/releases/download/1.1.1/terminix.zip +$ sudo unzip terminix.zip -d / +$ sudo glib-compile-schemas /usr/share/glib-2.0/schemas/ +``` + +#### 其它 Linux 发行版 + +OpenSUSE 用户可以从默认仓库中安装 Terminix,Arch Linux 用户也可以安装 [AUR Terminix 软件包][2]。 + +### Terminix 截图教程 + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Terminix-Terminal.png) + +*Terminix 终端* + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Terminix-Terminal-Settings.png) + +*Terminix 终端设置* + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Terminix-Terminal-Tabs.png) + +*Terminix 多终端界面* + +### 如何卸载删除 Terminix + + +如果你是手动安装的 Terminix 并且想要删除它,那么你可以参照如下的步骤来卸载它。从 [Github 仓库][3]上下载 uninstall.sh,并且给它可执行权限并且执行它: + +``` +$ wget -c https://github.com/gnunn1/terminix/blob/master/uninstall.sh +$ chmod +x uninstall.sh +$ sudo sh uninstall.sh +``` + +但是如果你是通过包管理器安装的 Terminix,你可以使用包管理器来卸载它。 + +在这篇介绍中,我们在众多优秀的终端模拟器中发现了一个重要的 Linux 终端模拟器。你可以尝试着去体验下它的新特性,并且可以将它和你现在使用的终端进行比较。 + +重要的一点,如果你想得到更多信息或者有疑问,请使用评论区,而且不要忘了,给我一个关于你使用体验的反馈。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/terminix-tiling-terminal-emulator-for-linux/ + +作者:[Aaron Kili][a] +译者:[MikeCoder](https://github.com/MikeCoder) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.tecmint.com/author/aaronkili/ +[1]: http://www.tecmint.com/linux-terminal-emulators/ +[2]: https://aur.archlinux.org/packages/terminix +[3]: https://github.com/gnunn1/terminix diff --git a/translated/tech/20160722 Terminix – A New GTK 3 Tiling Terminal Emulator for Linux.md b/translated/tech/20160722 Terminix – A New GTK 3 Tiling Terminal Emulator for Linux.md deleted file mode 100644 index 2a74e62ca1..0000000000 --- a/translated/tech/20160722 Terminix – A New GTK 3 Tiling Terminal Emulator for Linux.md +++ /dev/null @@ -1,133 +0,0 @@ -Terminix - 一个很赞的基于 GTK3 的 Linux 终端模拟器 -============================================================ - -现在,你可以很容易的找到[大量的 Linux 终端模拟器][1],每一个都可以给用户留下深刻的印象。 - -但是,很多时候,我们会很难根据我们的喜好来选择一款来作为日常终端模拟器。这篇文章中,我们将会推荐一款叫做 Terminix 的令人激动的终端模拟机。 - -![](http://www.tecmint.com/wp-content/uploads/2016/07/Terminix-Terminal-Emulator-for-Linux.png) ->Terminix Linux 终端模拟器 - -Terminix 是一个使用 VTE GTK+ 3 插件的终端模拟器。使用 GTK 3 开发的原因主要是为了符合 GNOME HIG(Human Interface Guidelines) 标准。另外,Terminix 已经在 GNOME 和 Unity 桌面环境下完成了测试。同时,志愿者也在其他的 Linux 桌面环境下进行了测试。 - -和其他的终端模拟器一样,Terminix 有着很多著名的特点,列表如下: - -- 允许用户进行自定义的垂直或者水平分屏。 -- 支持功能性的拖拽来进行重新布局 -- 支持拖拽 Tab 的方式,新建终端窗口 -- 支持终端之间的输入同步,因此,命令可以在一个终端输入,同时另一个终端进行展示 -- 终端的分组配置可以保存在硬盘 -- 支持透明背景 -- 允许使用背景图片 -- 支持通过主机名和目录来自动切换配置 -- 支持来自其他进程的通知信息 -- 配色模式使用文件存储,同时支持自定义配色方案 - -### 如何在 Linux 系统上安装 Terminix - -现在来详细说明一下在不同的 Linux 发行版本上安装 Terminix 的步骤。首先,在此列出 Terminix 在 Linux 所需要的环境需求。 - -#### 依赖组件 - -为了正常运行,该应用需要使用如下库: - -- GTK 3.14 或者以上版本 -- GTK VTE 0.42 或者以上版本 -- Dconf -- GSettings -- Nautilus 的 iNautilus-Python 插件 - -如果你已经满足了如上的系统 要求,接下来就是安装 Terminix 的步骤。 - -#### 在 RHEL/CentOS 7 或者 Fedora 22-24 上 - -首先,你需要将包仓库通过新建文件 `/etc/yum.repos.d/terminix.repo` 的方式,然后使用你最喜欢的文本编辑器来进行编辑。 - -``` -# vi /etc/yum.repos.d/terminix.repo -``` - -然后拷贝如下的文字,并且拷贝到我们刚新建的文件中: - -``` -[heikoada-terminix] -name=Copr repo for terminix owned by heikoada -baseurl=https://copr-be.cloud.fedoraproject.org/results/heikoada/terminix/fedora-$releasever-$basearch/ -skip_if_unavailable=True -gpgcheck=1 -gpgkey=https://copr-be.cloud.fedoraproject.org/results/heikoada/terminix/pubkey.gpg -enabled=1 -enabled_metadata=1 -``` - -保存文件并退出。 - -然后更新你的系统,并且安装 Terminix,步骤如下: - -``` ----------------- On RHEL/CentOS 7 ---------------- -# yum update -# yum install terminix - ----------------- On Fedora 22-24 ---------------- -# dnf update -# dnf install terminix -``` - -#### 在 Ubuntu 16.04-14.04 和 Linux Mint 18-17 - -虽然没有基于 Debian/Ubuntu 发行版本的官方的软件包,但是你依旧可以通过如下的命令手动安装。 - -``` -$ wget -c https://github.com/gnunn1/terminix/releases/download/1.1.1/terminix.zip -$ sudo unzip terminix.zip -d / -$ sudo glib-compile-schemas /usr/share/glib-2.0/schemas/ -``` - -OpenSUSE users can install Terminix from the default repository and Arch Linux users can install the [AUR Terminix package][2]. -OpenSUSE 用户可以从默认的仓库中安装 Terminix,Arch Linux 用户也可以安装 [AUR Terminix 软件包][2]。 - -### Terminix 截图教程 - -![](http://www.tecmint.com/wp-content/uploads/2016/07/Terminix-Terminal.png) ->Terminix Terminal - -![](http://www.tecmint.com/wp-content/uploads/2016/07/Terminix-Terminal-Settings.png) ->Terminix Terminal Settings - -![](http://www.tecmint.com/wp-content/uploads/2016/07/Terminix-Terminal-Tabs.png) ->Terminix Multiple Terminal Tabs - -### 如何卸载删除 Terminix - -In case you installed it manually and want to remove it, then you can follow the steps below to uninstall it. Download the uninstall.sh from Github repository, make it executable and then run it: -如果你是手动安装的 Terminix 并且想要删除他,那么你可以参照如下的步骤来卸载它。从 Github 仓库上下载 uninstall.sh,并且给它可执行权限并且执行它: - -``` -$ wget -c https://github.com/gnunn1/terminix/blob/master/uninstall.sh -$ chmod +x uninstall.sh -$ sudo sh uninstall.sh -``` - -但是如果你是通过包管理器安装的 Terminix,你依旧可以使用包管理器来卸载它。 - -请浏览 [Terminix Github][3] 仓库 - -在这个总览中,我们在众多优秀的终端模拟器中了解了一个重要的 Linux 终端模拟器。你可以尝试着去体验下它的新特性,并且可以将它和你现在使用的终端进行比较。 - -重要的一点,如果你想得到关于 Terminix 的更多信息或者有疑问,请使用评论区,而且不要忘了,给我一个关于你使用体验的反馈。 - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/terminix-tiling-terminal-emulator-for-linux/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tecmint+%28Tecmint%3A+Linux+Howto%27s+Guide%29 - -作者:[Aaron Kili][a] -译者:[译者ID](https://github.com/MikeCoder) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://www.tecmint.com/author/aaronkili/ -[1]: http://www.tecmint.com/linux-terminal-emulators/ -[2]: https://aur.archlinux.org/packages/terminix -[3]: https://github.com/gnunn1/terminix From 576fe07b3eb8d88a5364d9d952caf583f72fbdba Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 24 Jul 2016 21:04:10 +0800 Subject: [PATCH 1228/1469] =?UTF-8?q?20160724-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...r managing your project's issue tracker.md | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 sources/talk/20160718 Tips for managing your project's issue tracker.md diff --git a/sources/talk/20160718 Tips for managing your project's issue tracker.md b/sources/talk/20160718 Tips for managing your project's issue tracker.md new file mode 100644 index 0000000000..1b89fe5851 --- /dev/null +++ b/sources/talk/20160718 Tips for managing your project's issue tracker.md @@ -0,0 +1,101 @@ +Tips for managing your project's issue tracker +============================================== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BUSINESS_opennature_3.png?itok=30fRGfpv) + +Issue-tracking systems are important for many open source projects, and there are many open source tools that provide this functionality but many projects opt to use GitHub's built-in issue tracker. + +Its simple structure makes it easy for others to weigh in, but issues are really only as good as you make them. + +Without a process, your repository can become unwieldy, overflowing with duplicate issues, vague feature requests, or confusing bug reports. Project maintainers can become burdened by the organizational load, and it can become difficult for new contributors to understand where priorities lie. + +In this article, I'll discuss how to take your GitHub issues from good to great. + +### The issue as user story + +My team spoke with open source expert [Jono Bacon][1]—author of [The Art of Community][2], a strategy consultant, and former Director of Community at GitHub—who said that high-quality issues are at the core of helping a projects succeed. He says that while some see issues as merely a big list of problems you have to tend to, well-managed, triaged, and labeled issues can provide incredible insight into your code, your community, and where the problem spots are. + +"At the point of submission of an issue, the user likely has little patience or interest in providing expansive detail. As such, you should make it as easy as possible to get the most useful information from them in the shortest time possible," Jono Bacon said. + +A consistent structure can take a lot of burden off project maintainers, particularly for open source projects. We've found that encouraging a user story approach helps make clarity a constant. The common structure for a user story addresses the "who, what, and why" of a feature: As a [user type], I want to [task] so that [goal]. + +Here's what that looks like in practice: + +>As a customer, I want to create an account so that I can make purchases. + +We suggest sticking that user story in the issue's title. You can also set up [issue templates][3] to keep things consistent. + +![](https://opensource.com/sites/default/files/resize/issuetemplate-new-520x293.png) +> Issue templates bring consistency to feature requests. + +The point is to make the issue well-defined for everyone involved: it identifies the audience (or user), the action (or task), and the outcome (or goal) as simply as possible. There's no need to obsess over this structure, though; as long as the what and why of a story are easy to spot, you're good. + +### Qualities of a good issue + +Not all issues are created equal—as any OSS contributor or maintainer can attest. A well-formed issue meets these qualities outlined in [The Agile Samurai][4]. + +Ask yourself if it is... + +- something of value to customers +- avoids jargon or mumbo jumbo; a non-expert should be able to understand it +- "slices the cake," which means it goes end-to-end to deliver something of value +- independent from other issues if possible; dependent issues reduce flexibility of scope +- negotiable, meaning there are usually several ways to get to the stated goal +- small and easily estimable in terms of time and resources required +- measurable; you can test for results + +### What about everything else? Working with constraints + +If an issue is difficult to measure or doesn't seem feasible to complete within a short time period, you can still work with it. Some people call these "constraints." + +For example, "the product needs to be fast" doesn't fit the story template, but it is non-negotiable. But how fast is fast? Vague requirements don't meet the criteria of a "good issue", but if you further define these concepts—for example, "the product needs to be fast" can be "each page needs to load within 0.5 seconds"—you can work with it more easily. Constraints can be seen as internal metrics of success, or a landmark to shoot for. Your team should test for them periodically. + +### What's inside your issue? + +In agile, user stories typically include acceptance criteria or requirements. In GitHub, I suggest using markdown checklists to outline any tasks that make up an issue. Issues should get more detail as they move up in priority. + +Say you're creating an issue around a new homepage for a website. The sub-tasks for that task might look something like this. + +![](https://opensource.com/sites/default/files/resize/markdownchecklist-520x255.png) +>Use markdown checklists to split a complicated issue into several parts. + +If necessary, link to other issues to further define a task. (GitHub makes this really easy.) + +Defining features as granularly as possible makes it easier to track progress, test for success, and ultimately ship valuable code more frequently. + +Once you've gathered some data points in the form of issues, you can use APIs to glean deeper insight into the health of your project. + +"The GitHub API can be hugely helpful here in identifying patterns and trends in your issues," Bacon said. "With some creative data science, you can identify problem spots in your code, active members of your community, and other useful insights." + +Some issue management tools provide APIs that add additional context, like time estimates or historical progress. + +### Getting others on board + +Once your team decides on an issue structure, how do you get others to buy in? Think of your repo's ReadMe.md file as your project's "how-to." It should clearly define what your project does (ideally using searchable language) and explain how others can contribute (by submitting requests, bug reports, suggestions, or by contributing code itself.) + +![](https://opensource.com/sites/default/files/resize/readme-520x184.png) +>Edit your ReadMe file with clear instructions for new collaborators. + +This is the perfect spot to share your GitHub issue guidelines. If you want feature requests to follow the user story format, share that here. If you use a tracking tool to organize your product backlog, share the badge so others can gain visibility. + +"Issue templates, sensible labels, documentation for how to file issues, and ensuring your issues get triaged and responded to quickly are all important" for your open source project, Bacon said. + +Remember: It's not about adding process for the process' sake. It's about setting up a structure that makes it easy for others to discover, understand, and feel confident contributing to your community. + +"Focus your community growth efforts not just on growing the number of programmers, but also [on] people interested in helping issues be accurate, up to date, and a source of active conversation and productive problem solving," Bacon said. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/16/7/how-take-your-projects-github-issues-good-great + +作者:[Matt Butler][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mattzenhub +[1]: http://www.jonobacon.org/ +[2]: http://www.artofcommunityonline.org/ +[3]: https://help.github.com/articles/creating-an-issue-template-for-your-repository/ +[4]: https://www.amazon.ca/Agile-Samurai-Masters-Deliver-Software/dp/1934356581 From c9e9fc908f32a7e77352cc59020f063c447fdcc8 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 24 Jul 2016 21:13:17 +0800 Subject: [PATCH 1229/1469] =?UTF-8?q?20160724-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/talk/20160620 5 SSH Hardening Tips.md | 125 ++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 sources/talk/20160620 5 SSH Hardening Tips.md diff --git a/sources/talk/20160620 5 SSH Hardening Tips.md b/sources/talk/20160620 5 SSH Hardening Tips.md new file mode 100644 index 0000000000..ad6741ab26 --- /dev/null +++ b/sources/talk/20160620 5 SSH Hardening Tips.md @@ -0,0 +1,125 @@ +5 SSH Hardening Tips +====================== + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/binary-1188510_1920_0.jpg?itok=ocPCL_9G) +>Make your OpenSSH sessions more secure with these simple tips. +> Creative Commons Zero + +When you look at your SSH server logs, chances are they are full of attempted logins from entities of ill intent. Here are 5 general ways (along with several specific tactics) to make your OpenSSH sessions more secure. + +### 1. Make Password Auth Stronger + +Password logins are convenient, because you can log in from any machine anywhere. But they are vulnerable to brute-force attacks. Try these tactics for strengthening your password logins. + +- Use a password generator, such as pwgen. pwgen takes several options; the most useful is password length (e.g., pwgen 12 generates a 12-character password). + +- Never reuse a password. Ignore all the bad advice about not writing down your passwords, and keep a notebook with your logins written in it. If you don't believe me that this is a good idea, then believe security guru [Bruce Schneier][1]. If you're reasonably careful, nobody will ever find your notebook, and it is immune from online attacks. + +- You can add extra protection to your login notebook by obscuring the logins recorded in your notebook with character substitution or padding. Use a simple, easily-memorable convention such as padding your passwords with two extra random characters, or use a single simple character substitution such as # for *. + +- Use a non-standard listening port on your SSH server. Yes, this is old advice, and it's still good. Examine your logs; chances are that port 22 is the standard attack point, with few attacks on other ports. + +- Use [Fail2ban][2] to dynamically protect your server from brute force attacks. + +- Create non-standard usernames. Never ever enable a remote root login, and avoid "admin". + +### 2. Fix Too Many Authentication Failures + +When my ssh logins fail with "Too many authentication failures for carla" error messages, it makes me feel bad. I know I shouldn't take it personally, but it still stings. But, as my wise granny used to say, hurt feelings don't fix the problem. The cure for this is to force a password-based login in your ~/.ssh/config file. If this file does not exist, first create the ~/.ssh/ directory: + +``` +$ mkdir ~/.ssh +$ chmod 700 ~/.ssh +``` + +Then create the `~/.ssh/config` file in a text editor and enter these lines, using your own remote HostName address: + +``` +HostName remote.site.com +PubkeyAuthentication=no +``` + +### 3. Use Public Key Authentication + +Public Key authentication is much stronger than password authentication, because it is immune to brute-force password attacks, but it’s less convenient because it relies on RSA key pairs. To begin, you create a public/private key pair. Next, the private key goes on your client computer, and you copy the public key to the remote server that you want to log into. You can log in to the remote server only from computers that have your private key. Your private key is just as sensitive as your house key; anyone who has possession of it can access your accounts. You can add a strong layer of protection by putting a passphrase on your private key. + +Using RSA key pairs is a great tool for managing multiple users. When a user leaves, disable their login by deleting their public key from the server. + +This example creates a new key pair of 3072 bits strength, which is stronger than the default 2048 bits, and gives it a unique name so you know what server it belongs to: + +``` +$ ssh-keygen -t rsa -b 3072 -f id_mailserver +``` + +This creates two new keys, id_mailserver and id_mailserver.pub. id_mailserver is your private key -- do not share this! Now securely copy your public key to your remote server with the ssh-copy-id command. You must already have a working SSH login on the remote server: + +``` +$ ssh-copy-id -i id_rsa.pub user@remoteserver + +/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed +user@remoteserver's password: + +Number of key(s) added: 1 + +Now try logging into the machine, with: "ssh 'user@remoteserver'" +and check to make sure that only the key(s) you wanted were added. +``` + +ssh-copy-id ensures that you will not accidentally copy your private key. Test your new key login by copying the example from your command output, with single quotes: + +``` +$ ssh 'user@remoteserver' +``` + +It should log you in using your new key, and if you set a password on your private key, it will prompt you for it. + +### 4. Disable Password Logins + +Once you have tested and verified your public key login, disable password logins so that your remote server is not vulnerable to brute force password attacks. Do this in the /etc/sshd_config file on your remote server with this line: + +``` +PasswordAuthentication no +``` + +Then restart your SSH daemon. + +### 5. Set Up Aliases -- They’re Fast and Cool + +You can set up aliases for remote logins that you use a lot, so instead of logging in with something like "ssh -u username -p 2222 remote.site.with.long-name", you can use "ssh remote1". Set it up like this in your ~/.ssh/config file: + +``` +Host remote1 +HostName remote.site.with.long-name +Port 2222 +User username +PubkeyAuthentication no +``` + +If you are using public key authentication, it looks like this: + +``` +Host remote1 +HostName remote.site.with.long-name +Port 2222 +User username +IdentityFile ~/.ssh/id_remoteserver +``` + +The [OpenSSH documentation][3] is long and detailed, but after you have mastered basic SSH use, you'll find it's very useful and contains a trove of cool things you can do with OpenSSH. + + + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/learn/5-ssh-hardening-tips + +作者:[CARLA SCHRODER][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/cschroder +[1]: https://www.schneier.com/blog/archives/2005/06/write_down_your.html +[2]: http://www.fail2ban.org/wiki/index.php/Main_Page +[3]: http://www.openssh.com/ From 327472d1073b92a68dd71695ef9b27912ab7efb5 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 24 Jul 2016 21:27:53 +0800 Subject: [PATCH 1230/1469] =?UTF-8?q?20160724-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...a GUI - How to live in a Linux terminal.md | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 sources/talk/20160606 Who needs a GUI - How to live in a Linux terminal.md diff --git a/sources/talk/20160606 Who needs a GUI - How to live in a Linux terminal.md b/sources/talk/20160606 Who needs a GUI - How to live in a Linux terminal.md new file mode 100644 index 0000000000..f9633eb966 --- /dev/null +++ b/sources/talk/20160606 Who needs a GUI - How to live in a Linux terminal.md @@ -0,0 +1,108 @@ +Who needs a GUI? How to live in a Linux terminal +================================================= + +![](http://core0.staticworld.net/images/article/2016/07/linux-terminal-1-100669790-orig.jpg) + +### The best Linux shell apps for handling common functions + +Ever consider the idea of living entirely in a Linux terminal? No graphical desktop. No modern GUI software. Just text—and nothing but text—inside a Linux shell. It may not be easy, but it’s absolutely doable. [I recently tried living completely in a Linux shell for 30 days][1]. What follows are my favorite shell applications for handling some of the most common bits of computer functionality (web browsing, word processing, etc.). With a few obvious holes. Because being text-only is hard. + +![](http://core0.staticworld.net/images/article/2016/07/linux-terminal-2-100669791-orig.png) + +### Emailing within a Linux terminal + +For emailing in a terminal, we are spoiled for choice. Many people recommend mutt and notmuch. Both of those are powerful and excellent, but I prefer alpine. Why? Not only does it work well, but it’s also much more of a familiar interface if you are used to GUI email software like Thunderbird. + +![](http://core0.staticworld.net/images/article/2016/07/linux-terminal-3-100669837-orig.jpg) + +### Web browsing within a Linux terminal + +I have one word for you: [w3m][5]. Well, I suppose that’s not even really a word. But w3m is definitely my terminal web browser of choice. It tenders things fairly well and is powerful enough to even let you post to sites such as Google Plus (albeit, not in a terribly fun way). Lynx may be the de facto text-based web browser, but w3m is my favorite. + +![](http://core0.staticworld.net/images/article/2016/07/linux-terminal-4-100669838-orig.jpg) + +### Text editing within a Linux terminal + +For editing simple text files, I have one application that I straight-up love. No, not emacs. Also, definitely not vim. For editing of a text file or jotting down some notes, I like nano. Yes, nano. It’s simple, easy to learn and pleasant to use. Are there pieces of software with more features? Sure. But nano is just delightful. + +![](http://core0.staticworld.net/images/article/2016/07/linux-terminal-5-100669839-orig.jpg) + +### Word processing within a Linux terminal + +In a shell—with nothing but text—there really isn’t a huge difference between a “text editor” and a “word processor.” But being as I do a lot of writing, having a piece of software built specifically for long-form writing is a definite must. My favorite is wordgrinder. It has just enough tools to make me happy, a nice menu-driven interface (with hot-keys), and it supports multiple file types, including OpenDocument, HTML and a bunch of other ones. + +![](http://core0.staticworld.net/images/article/2016/07/linux-terminal-6-100669795-orig.jpg) + +### Music playing within a Linux terminal + +When it comes to playing music (mp3, Ogg, etc.) from a shell, one piece of software is king: [cmus][7]. It supports every conceivable file format. It’s super easy to use and incredibly fast and light on system resource usage. So clean. So streamlined. This is what a good music player should be like. + +![](http://core0.staticworld.net/images/article/2016/07/linux-terminal-7-100669796-orig.jpg) + +### Instant messaging within a Linux terminal + +When I realized how will I could instant message from the terminal, my head exploded. You know Pidgin, the multi-protocol IM client? Well, it has a version for the terminal, called “[finch][8],” that allows you to connect to multiple networks and chat with multiple people at once. The interface is even similar to Pidgin. Just amazing. Use Google Hangouts? Try [hangups][9]. It has a nice tabbed interface and works amazingly well. Seriously. Other than needing perhaps some emoji and inline pictures, instant messaging from the shell is a great experience. + +![](http://core0.staticworld.net/images/article/2016/07/linux-terminal-8-100669797-orig.jpg) + +### Tweeting within a Linux terminal + +No joke. Twitter, in your terminal, thanks to [rainbowstream][10]. I hit a few bugs here and there, but overall, it works rather well. Not as well as the website itself—and not as well as the official mobile clients—but, come on, this is Twitter in a shell. Even if it has one or two rough edges, this is pretty stinkin’ cool. + +![](http://core0.staticworld.net/images/article/2016/07/linux-terminal-9-100669798-orig.jpg) + +### Reddit-ing within a Linux terminal + +Spending time on Reddit from the comforts of the command line feels right somehow. And with rtv, it’s a rather pleasant experience. Reading. Commenting. Voting. It all works. The experience isn’t actually all that different than the website itself. + +![](http://core0.staticworld.net/images/article/2016/07/linux-terminal-10-100669799-orig.jpg) + +### Process managing within a Linux terminal + +Use [htop][12]. It’s like top—only better and prettier. Sometimes I just leave htop up and running all the time. Just because. In that regard, it’s like a music visualizer—only for RAM and CPU usage. + +![](http://core0.staticworld.net/images/article/2016/07/linux-terminal-11-100669800-orig.png) + +### File managing within a Linux terminal + +Just because you’re in a text-based shell doesn’t mean you don’t enjoy the finer things in life. Like having a nice file browser and manager. In that regard, [Midnight Commander][13] is a pretty doggone great one. + +![](http://core0.staticworld.net/images/article/2016/07/linux-terminal-12-100669801-orig.png) + +### Terminal managing within a Linux terminal + +If you spend much time in the shell, you’re going to need a terminal multiplexer. Basically it’s a piece of software that lets you split up your terminal session into a customizable grid, allowing you to use and see multiple terminal applications at the same time. It’s a tiled window manager for your shell. My favorite is [tmux][14]. But [GNU Screen][15] is also quite nice. It might take a few minutes to learn how to use it, but once you do, you’ll be glad you did. + +![](http://core0.staticworld.net/images/article/2016/07/linux-terminal-13-100669802-orig.jpg) + +### Presentation-ing within a Linux terminal + +LibreOffice, Google Slides or, gasp, PowerPoint. I spend a lot of time in presentation software. The fact that one exists for the shell pleases me greatly. It’s called, appropriately, “[text presentation program][16].” There are no images (obviously), just a simple program for displaying slides put together in a simple markup language. It may not let you embed pictures of cats, but you’ll earn some serious nerd-cred for doing an entire presentation from the terminal. + +-------------------------------------------------------------------------------- + +via: http://www.networkworld.com/article/3091139/linux/who-needs-a-gui-how-to-live-in-a-linux-terminal.html#slide1 + +作者:[Bryan Lunduke][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.networkworld.com/author/Bryan-Lunduke/ +[1]: http://www.networkworld.com/article/3083268/linux/30-days-in-a-terminal-day-0-the-adventure-begins.html +[2]: https://en.wikipedia.org/wiki/Mutt_(email_client) +[3]: https://notmuchmail.org/ +[4]: https://en.wikipedia.org/wiki/Alpine_(email_client) +[5]: https://en.wikipedia.org/wiki/W3m +[6]: http://cowlark.com/wordgrinder/index.html +[7]: https://en.wikipedia.org/wiki/Cmus +[8]: https://developer.pidgin.im/wiki/Using%20Finch +[9]: https://github.com/tdryer/hangups +[10]: http://www.rainbowstream.org/ +[11]: https://github.com/michael-lazar/rtv +[12]: http://hisham.hm/htop/ +[13]: https://en.wikipedia.org/wiki/Midnight_Commander +[14]: https://tmux.github.io/ +[15]: https://en.wikipedia.org/wiki/GNU_Screen +[16]: http://www.ngolde.de/tpp.html From f86827e35298d60e00596183d72f371fde78f725 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 24 Jul 2016 21:38:21 +0800 Subject: [PATCH 1231/1469] =?UTF-8?q?20160724-4=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...IDEO EDITING SOFTWARE FOR LINUX IN 2016.md | 148 ++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 sources/tech/20160627 TOP 5 BEST VIDEO EDITING SOFTWARE FOR LINUX IN 2016.md diff --git a/sources/tech/20160627 TOP 5 BEST VIDEO EDITING SOFTWARE FOR LINUX IN 2016.md b/sources/tech/20160627 TOP 5 BEST VIDEO EDITING SOFTWARE FOR LINUX IN 2016.md new file mode 100644 index 0000000000..44c66359f9 --- /dev/null +++ b/sources/tech/20160627 TOP 5 BEST VIDEO EDITING SOFTWARE FOR LINUX IN 2016.md @@ -0,0 +1,148 @@ +TOP 5 BEST VIDEO EDITING SOFTWARE FOR LINUX IN 2016 +===================================================== + +![](https://itsfoss.com/wp-content/uploads/2016/06/linux-video-ditor-software.jpg) + +Brief: Tiwo discusses the best video editors for Linux, their pros and cons and the installation method for Ubuntu-based distros in this article. + +We have discussed [best photo management applications for Linux][1], [best code editors for Linux][2] in similar articles in the past. Today we shall see the best video editing software for Linux. + +When asked about free video editing software, Windows Movie Maker and iMovie is what most people often suggest. + +Unfortunately, both of them are not available for GNU/Linux. But you don’t need to worry about it, we have pooled together a list of best free video editors for you. + +### BEST VIDEO EDITOR APPS FOR LINUX + +Let’s have a look at the top 5 best free video editing software for Linux below : + +#### 1. KDENLIVE + +![](https://itsfoss.com/wp-content/uploads/2016/06/kdenlive-free-video-editor-on-ubuntu.jpg) + +[Kdenlive][3] is a free and [open source][4] video editing software from KDE that provides dual video monitors, a multi-track timeline, clip list, customizable layout support, basic effects, and basic transitions. +It supports wide variety of file formats and a wide range of camcorders and cameras including Low resolution camcorder (Raw and AVI DV editing), Mpeg2, mpeg4 and h264 AVCHD (small cameras and camcorders), High resolution camcorder files, including HDV and AVCHD camcorders, Professional camcorders, including XDCAM-HD™ streams, IMX™ (D10) streams, DVCAM (D10) , DVCAM, DVCPRO™, DVCPRO50™ streams and DNxHD™ streams. + +You can install it from terminal by running the following command : + +``` +sudo apt-get install kdenlive +``` + +Or, open Ubuntu Software Center then search Kdenlive. + +#### 2. OPENSHOT + +![](https://itsfoss.com/wp-content/uploads/2016/06/openshot-free-video-editor-on-ubuntu.jpg) + +[OpenShot][5] is the second choice in our list of Linux video editing software. OpenShot can help you create the film that supports for transitions, effects, adjusting audio levels, and of course, it support of most formats and codecs. + +You can also export your film to DVD, upload to YouTube, Vimeo, Xbox 360, and many other common formats. OpenShot is simpler than kdenlive. So if you need a video editor with a simple UI OpenShot is a good choice. + +The latest version is 2.0.7. You can install OpenShot video editor by run the following command from terminal window : + +``` +sudo apt-get install openshot +``` + +It needs to download 25 MB, and 70 MB disk space after installed. + +#### 3. FLOWBLADE MOVIE EDITOR + +![](https://itsfoss.com/wp-content/uploads/2016/06/flowblade-movie-editor-on-ubuntu.jpg) + +[Flowblade Movie Editor][6] is a multitrack non-linear video editor for Linux. It is free and open source. It comes with a stylish and modern user interface. + +Written in Python, it is designed to provide a fast, and precise. Flowblade has focused on providing the best possible experience on Linux and other free platforms. So there’s no Windows and OS X version for now. + +To install Flowblade in Ubuntu and other Ubuntu based systems, use the command below: + +``` +sudo apt-get install flowblade +``` + +#### 4. LIGHTWORKS + +![](https://itsfoss.com/wp-content/uploads/2016/06/lightworks-running-on-ubuntu-16.04.jpg) + +If you looking for a video editor software that has more feature, this is the answer. [Lightworks][7] is a cross-platform professional video editor, available for Linux, Mac OS X and Windows. + +It is an award winning professional [non-linear editing][8] (NLE) software that supports resolutions up to 4K as well as video in SD and HD formats. + +This application has two versions: Lightworks Free and Lightworks Pro. While free version doesn’t support Vimeo (H.264 / MPEG-4) and YouTube (H.264 / MPEG-4)- Up to 2160p (4K UHD), Blu-ray, and H.264/MP4 export option with configurable bitrate setting, then pro version is. + +- Lightworks Free +- Lightworks Pro + +Pro version has more features such as higher resolution support, 4K and Blue Ray support etc. + +##### HOW TO INSTALL LIGHTWORKS? + +Unlike the other video editors, installing Lightwork is not as straight forward as running a single command. Don’t worry, it’s not that complicated either. + +- Step 1 – You can get the package from [Lightworks Downloads Page][9]. The package’s size about 79,5 MB. + +>Please note: There’s no Linux 32-bit support. + +- Step 2 – Once downloaded, you can install it using [Gdebi package installer][10]. Gdebi automatically downloads the dependency : + +![](https://itsfoss.com/wp-content/uploads/2016/06/Installing-lightworks-on-ubuntu.jpg) + +- Step 3 – Now you can open it from Ubuntu dashboard, or your Linux distro’s menu. + +- Step 4 – It needs an account when you use it for first time. Click at Not Registerd? button to register. Don’t worry, it’s free! + +- Step 5 – After your account has been verified, now login. + +Now the Lightworks is ready to use. + +Need Lightworks video tutorial? Get them at [Lightworks video tutorials Page][11]. + +#### 5. BLENDER + +![](https://itsfoss.com/wp-content/uploads/2016/06/blender-running-on-ubuntu-16.04.jpg) + +Blender is a professional, industry-grade open source, cross platform video editor. It is popular for 3D works. Blender has been used in several Hollywood movies including Spider Man series. + +Although originally designed for produce 3D modeling, but it can also be used for video editing and input capabilities with a variety of formats. The Video Editor includes: + +- Live preview, luma waveform, chroma vectorscope and histogram displays +- Audio mixing, syncing, scrubbing and waveform visualization +- Up to 32 slots for adding video, images, audio, scenes, masks and effects +- Speed control, adjustment layers, transitions, keyframes, filters and more. + +The latest version can be downloaded from [Blender Download Page][12]. + +### WHICH IS THE BEST VIDEO EDITING SOFTWARE? + +If you need a simple video editor, OpenShot, Kdenlive or Flowblade is a good choice. These are suitable for beginners and a system with standard specification. + +Then if you have a high-end computer, and need advanced features you can go out with Lightworks. If you are looking for more advanced features, Blender has got your back. + +So that’s all I can write about 5 best video editing software for Linux such as Ubuntu, Linux Mint, Elementary, and other Linux distributions. Share with us which video editor you like the most. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/best-video-editing-software-linux/ + +作者:[Tiwo Satriatama][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/tiwo/ +[1]: https://itsfoss.com/linux-photo-management-software/ +[2]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/ +[3]: https://kdenlive.org/ +[4]: https://itsfoss.com/tag/open-source/ +[5]: http://www.openshot.org/ +[6]: http://jliljebl.github.io/flowblade/ +[7]: https://www.lwks.com/ +[8]: https://en.wikipedia.org/wiki/Non-linear_editing_system +[9]: https://www.lwks.com/index.php?option=com_lwks&view=download&Itemid=206 +[10]: https://itsfoss.com/gdebi-default-ubuntu-software-center/ +[11]: https://www.lwks.com/videotutorials +[12]: https://www.blender.org/download/ + + + From 2eb5bc2855c8d0a8048a096942f5ace7383d978c Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 24 Jul 2016 22:15:33 +0800 Subject: [PATCH 1232/1469] =?UTF-8?q?20160724-5=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ilter and Edit - Demonstrated in Pandas.md | 327 ++++++++++++++++++ 1 file changed, 327 insertions(+) create mode 100644 sources/tech/20160615 Excel Filter and Edit - Demonstrated in Pandas.md diff --git a/sources/tech/20160615 Excel Filter and Edit - Demonstrated in Pandas.md b/sources/tech/20160615 Excel Filter and Edit - Demonstrated in Pandas.md new file mode 100644 index 0000000000..348f66196f --- /dev/null +++ b/sources/tech/20160615 Excel Filter and Edit - Demonstrated in Pandas.md @@ -0,0 +1,327 @@ +Excel “Filter and Edit” - Demonstrated in Pandas +================================================== + +![](http://pbpython.com/images/Boolean-Indexing-Example.png) + +### Introduction + +I have heard from various people that my [previous][1] [articles][2] on common Excel tasks in pandas were useful in helping new pandas users translate Excel processes into equivalent pandas code. This article will continue that tradition by illustrating various pandas indexing examples using Excel’s Filter function as a model for understanding the process. + +One of the first things most new pandas users learn is basic data filtering. Despite working with pandas over the past few months, I recently realized that there was another benefit to the pandas filtering approach that I was not using in my day to day work. Namely that you can filter on a given set of columns but update another set of columns using a simplified pandas syntax. This is similar to what I’ll call the “Filter and Edit” process in Excel. + +This article will walk through some examples of filtering a pandas DataFrame and updating the data based on various criteria. Along the way, I will explain some more about panda’s indexing and how to use indexing methods such as .loc , .ix and .iloc to quickly and easily update a subset of data based on simple or complex criteria. + +### Excel: “Filter and Edit” + +Outside of the Pivot Table, one of the top go-to tools in Excel is the Filter. This simple tool allows a user to quickly filter and sort the data by various numeric, text and formatting criteria. Here is a basic screenshot of some sample data with data filtered by several different criteria: + +![](http://pbpython.com/images/filter-example.png) + +The Filter process is intuitive and is easy to grasp for even the most novice Excel user. I have also noticed that people will use this feature to select rows of data, then update additional columns based on the row criteria. The example below shows what I’m describing: + +![](http://pbpython.com/images/commission-example.png) + +In the example, I have filtered the data on Account Number, SKU and Unit Price. Then I manually added a Commission_Rate column and typed in 0.01 in each cell. The benefit to this approach is that it is easy to understand and can help someone manage relatively complex data without writing long Excel formulas or getting into VBA. The downside of this approach is that it is not repeatable and can be difficult for someone from the outside to understand which criteria were used for any filter. + +For instance, if you look at the screenshot about, there is no obvious way to tell what is filtered without looking at each column. Fortunately, we can do something very similar in pandas. Not surprisingly, it is easy in pandas to execute this “Filter and Edit” model with simple and clean code. + +### Boolean Indexing + +Now that you have a feel for the problem, I want to step through some details of boolean indexing in pandas. This is an important concept to understand if you want to understand pandas’ [Indexing and Selecting of Data][3] in the most broad sense. This idea may seem a little complex to the new pandas user (and maybe too basic for experienced users) but I think it is important to take some time and understand it. If you grasp this concept, the basic process of working with data in pandas will be more straightforward. + +Pandas supports indexing (or selecting data) by using labels, position based integers or a list of boolean values (True/False). Using a list of boolean values to select a row is called boolean indexing and will be the focus of the rest of this article. + +I find that my pandas workflow tends to focus mostly on using lists of boolean values for selecting my data. In other words, when I create pandas DataFrames, I tend to keep the default index in the DataFrame. Therefore the index is not really meaningful on its own and not straightforward for selecting data. + +>Key Point +> Boolean indexing is one (of several) powerful and useful ways of selecting rows of data in pandas. + +Let’s look at some example DataFrames to help clarify the what a boolean index in pandas does. + +First, we will create a very small DataFrame purely from a python list and use it to show how boolean indexing works. + +``` +import pandas as pd +sales = [('account', ['Jones LLC', 'Alpha Co', 'Blue Inc', 'Mega Corp']), + ('Total Sales', [150, 200, 75, 300]), + ('Country', ['US', 'UK', 'US', 'US'])] +df = pd.DataFrame.from_items(sales) +``` + + |account |Total Sales |Country +:--|:-- |:-- |: +0 |Jones LLC |150 |US +1 |Alpha Co |200 |UK +2 |Blue Inc |75 |US +3 |Mega Corp |300 |US + +Notice how the values 0-3, get automatically assigned to the rows? Those are the indices and they are not particularly meaningful in this data set but are useful to pandas and are important to understand for other use cases not described below. + +When we refer to boolean indexing, we simply mean that we can pass in a list of True or False values representing each row we want to view. + +In this case, if we want to view the data for Jones LLC, Blue Inc and Mega Corp, we can see that the True False list would look like this: + +``` +indices = [True, False, True, True] +``` + +It should be no surprise, that you can pass this list to your DataFrame and it will only display the rows where our value is True : + +``` +df[indices] +``` + + |account |Total Sales |Country +:--|:--|:--|:-- +0 |Jones LLC |150 |US +2 |Blue Inc |75 |US +3 |Mega Corp |300 |US + +Here is a visual of what just happened: + +![](http://pbpython.com/images/Boolean-Indexing-Example.png) + +This manual list creation of the index works but obviously is not scaleable or very useful for anything more than a trivial data set. Fortunately pandas makes it very easy to create these boolean indexes using a simple query language that should be familiar to someone that has used python (or any language for that matter). + +For an example, let’s look at all sales lines from the US. If we execute a python expression based on the Country column: + +``` +df.Country == 'US' +``` + +``` +0 True +1 False +2 True +3 True +Name: Country, dtype: bool +``` + +The example shows how pandas will take your traditional python logic, apply it to a DataFrame and return a list of boolean values. This list of boolean values can then be passed to the DataFrame to get the corresponding rows of data. + +In real code, you would not do this two step process. The shorthand method for doing this would typically look like this: + +``` +df[df["Country"] == 'US'] +``` + + |account |Total Sales |Country +:--|:--|:--|:-- +0 |Jones LLC |150| US +2 |Blue Inc |75 |US +3 |Mega Corp| 300| US + +While this concept is simple, you can write fairly complex logic to filter your data using the power of python. + +>Key Point +>In this example, `df[df.Country == 'US']` is equivalent to `df[df["Country"] == 'US']` The ‘.’ notation is cleaner but will not work when there are spaces in your column names. + +### Selecting the Columns + +Now that we have figured out how to select rows of data, how can we control which columns to display? In the example above, there’s no obvious way to do that. Pandas can support this use case using three types of location based indexing: .loc , iloc , and .ix . These functions also allow us to select columns in addition to the row selection we have seen so far. + +There is a lot of confusion about when to use .loc , iloc , or .ix . The quick summary of the difference is that: + +- .loc is used for label indexing +- .iloc is used for position based integers +- .ix is a shortcut that will try to use labels (like .loc ) but will fall back to position based integers (like .iloc ) + +So, the question is, which one should I use? I will profess that I get tripped up some times on this one too. I have found that I use .loc most frequently. Mainly because my data does not lend itself to meaningful position based indexing (in other words, I rarely find myself needing .iloc ) so I stick with .loc . + +To be fair each of these methods do have their place and are useful in many situations. One area in particular is when dealing with MultiIndex DataFrames. I will not cover that topic in this article - maybe in a future post. + +Now that we have covered this topic, let’s show how to filter a DataFrame on values in a row and select specific columns to display. + +Continuing with our example, what if we just want to show the account names that correspond to our index? Using .loc it is simple: + +``` +df.loc[[True, True, False, True], "account"] +``` + +``` +1 Alpha Co +2 Blue Inc +3 Mega Corp +Name: account, dtype: object +``` + +If you would like to see multiple columns, just pass a list: + +``` +df.loc[[True, True, False, True], ["account", "Country"]] +``` + + | account |Country +:--|:--|:-- +0 |Jones LLC| US +1 |Alpha Co |UK +3 |Mega Corp |US + +The real power is when you create more complex queries on your data. In this case, let’s show all account names and Countries where sales > 200: + +``` +df.loc[df["Total Sales"] > 200, ["account", "Country"]] +``` + + |account| Country + :--|:--|:-- +3 |Mega Corp| US + +This process can be thought of somewhat equivalent to Excel’s Filter we discussed above. You have the added benefit that you can also limit the number of columns you retrieve, not just the rows. + +### Editing Columns + +All of this is good background but where this process really shines is when you use a similar approach for updating one or more columns based on a row selection. + +For one simple example, let’s add a commission rate column to our data: + +``` +df["rate"] = 0.02 +``` + + | account |Total Sales| Country |rate +:--|:--|:--|:--|:-- +0 |Jones LLC |150 |US |0.02 +1 |Alpha Co |200 |UK |0.02 +2 |Blue Inc |75 |US |0.02 +3 |Mega Corp |300 |US |0.02 + +Let’s say that if you sold more than 100, your rate is 5%. The basic process is to setup a boolean index to select the columns, then assign the value to the rate column: + +``` +df.loc[df["Total Sales"] > 100, ["rate"]] = .05 +``` + + | account |Total Sales| Country| rate +:--|:--|:--|:--|:-- +0 |Jones LLC |150| US| 0.05 +1 |Alpha Co |200 |UK |0.05 +2| Blue Inc |75| US |0.02 +3 |Mega Corp |300| US| 0.05 + +Hopefully if you stepped through this article, this will make sense and that it will help you understand how this syntax works. Now you have the fundamentals of the “Filter and Edit” approach. The final section will show this process in a little more detail in Excel and pandas. + +### Bringing It All Together + +For the final example, we will create a simple commissions calculator using the following rules: + +- All commissions calculated at the transaction level +- Base commission on all sales is 2% +- All shirts will get a commission of 2.5% +- A special program is going on where selling > 10 belts in one transaction gets 4% commission +- There is a special bonus of $250 plus a 4.5% commission for all shoe sales > $1000 in a single transaction + +In order to do this in Excel, using the Filter and edit approach: + +- Add a commission column with 2% +- Add a bonus column of $0 +- Filter on shirts and change the vale to 2.5% +- Clear the filter +- Filter for belts and quantity > 10 and change the value to 4% +- Clear the filter +- Filter for shoes > $1000 and add commission and bonus values of 4.5% and $250 respectively + +I am not going to show a screen shot of each step but here is the last filter: + +![](http://pbpython.com/images/filter-2.png) + +This approach is simple enough to manipulate in Excel but it is not very repeatable nor audit-able. There are certainly other approaches to accomplish this in Excel - such as formulas or VBA. However, this Filter and Edit approach is common and is illustrative of the pandas logic. + +Now, let’s walk through the whole example in pandas. + +First, read in the [Excel file][4] and add a column with the 2% default rate: + +``` +import pandas as pd +df = pd.read_excel("https://github.com/chris1610/pbpython/blob/master/data/sample-sales-reps.xlsx?raw=true") +df["commission"] = .02 +df.head() +``` + + | account number| customer name| sales rep| sku |category |quantity |unit price| ext price| date| commission +:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:-- +0 |680916 |Mueller and Sons |Loring Predovic |GP-14407 | Belt |19 |88.49 |1681.31 |2015-11-17 05:58:34| 0.02 +1 |680916 |Mueller and Sons |Loring Predovic |FI-01804| Shirt |3| 78.07| 234.21 |2016-02-13 04:04:11 |0.02 +2 |530925 |Purdy and Sons| Teagan O’Keefe |EO-54210 |Shirt |19 |30.21 |573.99 |2015-08-11 12:44:38 |0.02 +3 |14406| Harber, Lubowitz and Fahey| Esequiel Schinner| NZ-99565| Shirt| 12| 90.29 |1083.48 |2016-01-23 02:15:50 |0.02 +4 |398620| Brekke Ltd |Esequiel Schinner |NZ-99565 |Shirt |5| 72.64 |363.20 |2015-08-10 07:16:03 |0.02 + +The next commission rule is for all shirts to get 2.5% and Belt sales > 10 get a 4% rate: + +``` +df.loc[df["category"] == "Shirt", ["commission"]] = .025 +df.loc[(df["category"] == "Belt") & (df["quantity"] >= 10), ["commission"]] = .04 +df.head() +``` + +| account number |customer name |sales rep| sku |category |quantity| unit price| ext price |date |commission + :--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:-- +0 |680916| Mueller and Sons| Loring Predovic| GP-14407| Belt| 19 |88.49| 1681.31 |2015-11-17 05:58:34| 0.040 +1 |680916| Mueller and Sons| Loring Predovic| FI-01804| Shirt |3 |78.07 |234.21| 2016-02-13 04:04:11 |0.025 +2 |530925 |Purdy and Sons |Teagan O’Keefe| EO-54210 |Shirt| 19 |30.21 |573.99 |2015-08-11 12:44:38| 0.025 +3 |14406| Harber, Lubowitz and Fahey| Esequiel Schinner| NZ-99565| Shirt| 12| 90.29| 1083.48| 2016-01-23 02:15:50 |0.025 +4 |398620| Brekke Ltd| Esequiel Schinner| NZ-99565| Shirt| 5 |72.64 |363.20| 2015-08-10 07:16:03 |0.025 + +The final commission rule is to add the special bonus: + +``` +df["bonus"] = 0 +df.loc[(df["category"] == "Shoes") & (df["ext price"] >= 1000 ), ["bonus", "commission"]] = 250, 0.045 + +# Display a sample of rows that show this bonus +df.ix[3:7] +``` + +| account number| customer name |sales rep| sku |category| quantity| unit price| ext price| date| commission| bonus + :--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:-- +3| 14406| Harber, Lubowitz and Fahey| Esequiel Schinner| NZ-99565| Shirt |12 |90.29| 1083.48 |2016-01-23 02:15:50 |0.025 |0 +4| 398620| Brekke Ltd| Esequiel Schinner |NZ-99565| Shirt| 5| 72.64| 363.20| 2015-08-10 07:16:03| 0.025| 0 +5| 282122| Connelly, Abshire and Von Beth| Skiles| GJ-90272| Shoes| 20| 96.62| 1932.40 |2016-03-17 10:19:05 |0.045 |250 +6 |398620 |Brekke Ltd| Esequiel Schinner |DU-87462 |Shirt| 10| 67.64 |676.40| 2015-11-25 22:05:36| 0.025| 0 +7| 218667| Jaskolski-O’Hara| Trish Deckow| DU-87462| Shirt |11| 91.86| 1010.46 |2016-04-24 15:05:58| 0.025| 0 + +In order to do the commissions calculation: + +``` +# Calculate the compensation for each row +df["comp"] = df["commission"] * df["ext price"] + df["bonus"] + +# Summarize and round the results by sales rep +df.groupby(["sales rep"])["comp"].sum().round(2) +``` + +``` +sales rep +Ansley Cummings 2169.76 +Beth Skiles 3028.60 +Esequiel Schinner 10451.21 +Loring Predovic 10108.60 +Shannen Hudson 5275.66 +Teagan O'Keefe 7989.52 +Trish Deckow 5807.74 +Name: comp, dtype: float64 +``` + +If you are interested, an example notebook is hosted on [github][5]. + +### Conclusion + +Thanks for reading through the article. I find that one of the biggest challenges for new users in learning how to use pandas is figuring out how to use their Excel-based knowledge to build an equivalent pandas-based solution. In many cases the pandas solution is going to be more robust, faster, easier to audit and more powerful. However, the learning curve can take some time. I hope that this example showing how to solve a problem using Excel’s Filter tool will be a useful guide for those just starting on this pandas journey. Good luck! + +-------------------------------------------------------------------------------- + +via: http://pbpython.com/excel-filter-edit.html + +作者:[Chris Moffitt ][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://pbpython.com/author/chris-moffitt.html +[1]: http://pbpython.com/excel-pandas-comp.html +[2]: http://pbpython.com/excel-pandas-comp-2.html +[3]: http://pandas.pydata.org/pandas-docs/stable/indexing.html +[4]: https://github.com/chris1610/pbpython/blob/master/data/sample-sales-reps.xlsx?raw=true +[5]: https://github.com/chris1610/pbpython/blob/master/notebooks/Commissions-Example.ipynb + From 1298ca2fc50b142ee8bd95ae7de9cb12e22ca2b2 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 24 Jul 2016 22:21:01 +0800 Subject: [PATCH 1233/1469] =?UTF-8?q?20160724-6=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20160628 Python 101 An Intro to urllib.md | 198 ++++++++++++++++++ 1 file changed, 198 insertions(+) create mode 100644 sources/tech/20160628 Python 101 An Intro to urllib.md diff --git a/sources/tech/20160628 Python 101 An Intro to urllib.md b/sources/tech/20160628 Python 101 An Intro to urllib.md new file mode 100644 index 0000000000..38620bf17b --- /dev/null +++ b/sources/tech/20160628 Python 101 An Intro to urllib.md @@ -0,0 +1,198 @@ +Python 101: An Intro to urllib +================================= + +The urllib module in Python 3 is a collection of modules that you can use for working with URLs. If you are coming from a Python 2 background you will note that in Python 2 you had urllib and urllib2. These are now a part of the urllib package in Python 3. The current version of urllib is made up of the following modules: + +- urllib.request +- urllib.error +- urllib.parse +- urllib.rebotparser + +We will be covering each part individually except for urllib.error. The official documentation actually recommends that you might want to check out the 3rd party library, requests, for a higher-level HTTP client interface. However, I believe that it can be useful to know how to open URLs and interact with them without using a 3rd party and it may also help you appreciate why the requests package is so popular. + +--- + +### urllib.request + +The urllib.request module is primarily used for opening and fetching URLs. Let’s take a look at some of the things you can do with the urlopen function: + +``` +>>> import urllib.request +>>> url = urllib.request.urlopen('https://www.google.com/') +>>> url.geturl() +'https://www.google.com/' +>>> url.info() + +>>> header = url.info() +>>> header.as_string() +('Date: Fri, 24 Jun 2016 18:21:19 GMT\n' + 'Expires: -1\n' + 'Cache-Control: private, max-age=0\n' + 'Content-Type: text/html; charset=ISO-8859-1\n' + 'P3P: CP="This is not a P3P policy! See ' + 'https://www.google.com/support/accounts/answer/151657?hl=en for more info."\n' + 'Server: gws\n' + 'X-XSS-Protection: 1; mode=block\n' + 'X-Frame-Options: SAMEORIGIN\n' + 'Set-Cookie: ' + 'NID=80=tYjmy0JY6flsSVj7DPSSZNOuqdvqKfKHDcHsPIGu3xFv41LvH_Jg6LrUsDgkPrtM2hmZ3j9V76pS4K_cBg7pdwueMQfr0DFzw33SwpGex5qzLkXUvUVPfe9g699Qz4cx9ipcbU3HKwrRYA; ' + 'expires=Sat, 24-Dec-2016 18:21:19 GMT; path=/; domain=.google.com; HttpOnly\n' + 'Alternate-Protocol: 443:quic\n' + 'Alt-Svc: quic=":443"; ma=2592000; v="34,33,32,31,30,29,28,27,26,25"\n' + 'Accept-Ranges: none\n' + 'Vary: Accept-Encoding\n' + 'Connection: close\n' + '\n') +>>> url.getcode() +200 +``` + +Here we import our module and ask it to open Google’s URL. Now we have an HTTPResponse object that we can interact with. The first thing we do is call the geturl method which will return the URL of the resource that was retrieved. This is useful for finding out if we followed a redirect. + +Next we call info, which will return meta-data about the page, such as headers. Because of this, we assign that result to our headers variable and then call its as_string method. This prints out the header we received from Google. You can also get the HTTP response code by calling getcode, which in this case was 200, which means it worked successfully. + +If you’d like to see the HTML of the page, you can call the read method on the url variable we created. I am not reproducing that here as the output will be quite long. + +Please note that the request object defaults to a GET request unless you specify the data parameter. Should you pass in the data parameter, then the request object will issue a POST request instead. + +--- + +### Downloading a file + +A typical use case for the urllib package is for downloading a file. Let’s find out a couple of ways we can accomplish this task: + +``` +>>> import urllib.request +>>> url = 'http://www.blog.pythonlibrary.org/wp-content/uploads/2012/06/wxDbViewer.zip' +>>> response = urllib.request.urlopen(url) +>>> data = response.read() +>>> with open('/home/mike/Desktop/test.zip', 'wb') as fobj: +... fobj.write(data) +... +``` + +Here we just open a URL that leads us to a zip file stored on my blog. Then we read the data and write it out to disk. An alternate way to accomplish this is to use urlretrieve: + +``` +>>> import urllib.request +>>> url = 'http://www.blog.pythonlibrary.org/wp-content/uploads/2012/06/wxDbViewer.zip' +>>> tmp_file, header = urllib.request.urlretrieve(url) +>>> with open('/home/mike/Desktop/test.zip', 'wb') as fobj: +... with open(tmp_file, 'rb') as tmp: +... fobj.write(tmp.read()) +``` + +The urlretrieve method will copy a network object to a local file. The file it copies to is randomly named and goes into the temp directory unless you use the second parameter to urlretrieve where you can actually specify where you want the file saved. This will save you a step and make your code much simpler: + +``` +>>> import urllib.request +>>> url = 'http://www.blog.pythonlibrary.org/wp-content/uploads/2012/06/wxDbViewer.zip' +>>> urllib.request.urlretrieve(url, '/home/mike/Desktop/blog.zip') +('/home/mike/Desktop/blog.zip', + ) +``` + +As you can see, it returns the location of where it saved the file and the header information from the request. + +### Specifying Your User Agent + +When you visit a website with your browser, the browser tells the website who it is. This is called the user-agent string. Python’s urllib identifies itself as Python-urllib/x.y where the x and y are major and minor version numbers of Python. Some websites won’t recognize this user-agent string and will behave in strange ways or not work at all. Fortunately, it’s easy for you to set up your own custom user-agent string: + +``` +>>> import urllib.request +>>> user_agent = ' Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0' +>>> url = 'http://www.whatsmyua.com/' +>>> headers = {'User-Agent': user_agent} +>>> request = urllib.request.Request(url, headers=headers) +>>> with urllib.request.urlopen(request) as response: +... with open('/home/mdriscoll/Desktop/user_agent.html', 'wb') as out: +... out.write(response.read()) +``` + +Here we set up our user agent to Mozilla FireFox and we set out URL to which will tell us what it thinks our user-agent string is. Then we create a Request instance using our url and headers and pass that to urlopen. Finally we save the result. If you open the result file, you will see that we successfully changed our user-agent string. Feel free to try out a few different strings with this code to see how it will change. + +--- + +### urllib.parse + +The urllib.parse library is your standard interface for breaking up URL strings and combining them back together. You can use it to convert a relative URL to an absolute URL, for example. Let’s try using it to parse a URL that includes a query: + +``` +>>> from urllib.parse import urlparse +>>> result = urlparse('https://duckduckgo.com/?q=python+stubbing&t=canonical&ia=qa') +>>> result +ParseResult(scheme='https', netloc='duckduckgo.com', path='/', params='', query='q=python+stubbing&t=canonical&ia=qa', fragment='') +>>> result.netloc +'duckduckgo.com' +>>> result.geturl() +'https://duckduckgo.com/?q=python+stubbing&t=canonical&ia=qa' +>>> result.port +None +``` + +Here we import the urlparse function and pass it an URL that contains a search query to the duckduckgo website. My query was to look up articles on “python stubbing”. As you can see, it returned a ParseResult object that you can use to learn more about the URL. For example, you can get the port information (None in this case), the network location, path and much more. + +### Submitting a Web Form + +This module also holds the urlencode method, which is great for passing data to a URL. A typical use case for the urllib.parse library is submitting a web form. Let’s find out how you might do that by having the duckduckgo search engine look for Python: + +``` +>>> import urllib.request +>>> import urllib.parse +>>> data = urllib.parse.urlencode({'q': 'Python'}) +>>> data +'q=Python' +>>> url = 'http://duckduckgo.com/html/' +>>> full_url = url + '?' + data +>>> response = urllib.request.urlopen(full_url) +>>> with open('/home/mike/Desktop/results.html', 'wb') as f: +... f.write(response.read()) +``` + +This is pretty straightforward. Basically we want to submit a query to duckduckgo ourselves using Python instead of a browser. To do that, we need to construct our query string using urlencode. Then we put that together to create a fully qualified URL and use urllib.request to submit the form. We then grab the result and save it to disk. + +--- + +### urllib.robotparser + +The robotparser module is made up of a single class, RobotFileParser. This class will answer questions about whether or not a specific user agent can fetch a URL that has a published robot.txt file. The robots.txt file will tell a web scraper or robot what parts of the server should not be accessed. Let’s take a look at a simple example using ArsTechnica’s website: + +``` +>>> import urllib.robotparser +>>> robot = urllib.robotparser.RobotFileParser() +>>> robot.set_url('http://arstechnica.com/robots.txt') +None +>>> robot.read() +None +>>> robot.can_fetch('*', 'http://arstechnica.com/') +True +>>> robot.can_fetch('*', 'http://arstechnica.com/cgi-bin/') +False +``` + +Here we import the robot parser class and create an instance of it. Then we pass it a URL that specifies where the website’s robots.txt file resides. Next we tell our parser to read the file. Now that that’s done, we give it a couple of different URLs to find out which ones we can crawl and which ones we can’t. We quickly see that we can access the main site, but not the cgi-bin. + +--- + +### Wrapping Up + +You have reached the point that you should be able to use Python’s urllib package competently. We learned how to download a file, submit a web form, change our user agent and access a robots.txt file in this chapter. The urllib has a lot of additional functionality that is not covered here, such as website authentication. However, you might want to consider switching to the requests library before trying to do authentication with urllib as the requests implementation is a lot easier to understand and debug. I also want to note that Python has support for Cookies via its http.cookies module although that is also wrapped quite well in the requests package. You should probably consider trying both to see which one makes the most sense to you. + +-------------------------------------------------------------------------------- + +via: http://www.blog.pythonlibrary.org/2016/06/28/python-101-an-intro-to-urllib/ + +作者:[Mike][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.blog.pythonlibrary.org/author/mld/ + + + + + + + From c08fa449ffea3b606d142e12267435ca801655fd Mon Sep 17 00:00:00 2001 From: Mike Tang Date: Sun, 24 Jul 2016 22:26:30 +0800 Subject: [PATCH 1234/1469] sources/tech/20160706 Doing for User Space What We Did for Kernel Space.md --- ...0160706 Doing for User Space What We Did for Kernel Space.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160706 Doing for User Space What We Did for Kernel Space.md b/sources/tech/20160706 Doing for User Space What We Did for Kernel Space.md index 72d79aaede..743114c481 100644 --- a/sources/tech/20160706 Doing for User Space What We Did for Kernel Space.md +++ b/sources/tech/20160706 Doing for User Space What We Did for Kernel Space.md @@ -1,3 +1,5 @@ +MikeCoder Translating... + Doing for User Space What We Did for Kernel Space ======================================================= From 62559cb71df24ed3190ffb0baab6f4b510d4bc27 Mon Sep 17 00:00:00 2001 From: maywanting Date: Sun, 24 Jul 2016 23:16:10 +0800 Subject: [PATCH 1235/1469] 20160721 5 tricks for getting started with Vim.md --- sources/tech/20160721 5 tricks for getting started with Vim.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160721 5 tricks for getting started with Vim.md b/sources/tech/20160721 5 tricks for getting started with Vim.md index 8f622770f5..417b51ed45 100644 --- a/sources/tech/20160721 5 tricks for getting started with Vim.md +++ b/sources/tech/20160721 5 tricks for getting started with Vim.md @@ -1,3 +1,5 @@ +maywanting + 5 tricks for getting started with Vim ===================================== From 5baefa4cef06ad73c8e4c943b49aeb1dc312d0ad Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 25 Jul 2016 09:57:14 +0800 Subject: [PATCH 1236/1469] PUB:Part 12 - How to Explore Linux with Installed Help Documentations and Tools MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @kokialoves 辛苦了,有两点需要注意:1、标点符号要用中文的;2、忠实原文。 --- ...Installed Help Documentations and Tools.md | 184 ++++++++++++++++++ ...Installed Help Documentations and Tools.md | 178 ----------------- 2 files changed, 184 insertions(+), 178 deletions(-) create mode 100644 published/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md delete mode 100644 translated/tech/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md diff --git a/published/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md b/published/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md new file mode 100644 index 0000000000..bc5e764637 --- /dev/null +++ b/published/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md @@ -0,0 +1,184 @@ +LFCS 系列第十二讲:如何使用 Linux 的帮助文档和工具 +================================================================================== + +由于 2016 年 2 月 2 号开始启用了新的 LFCS 考试要求, 我们在 [LFCS 系列][1]系列添加了一些必要的内容。为了考试的需要,我们强烈建议你看一下[LFCE 系列][2]。 + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Explore-Linux-with-Documentation-and-Tools.png) + +*LFCS: 了解 Linux 的帮助文档和工具* + +当你习惯了在命令行下进行工作,你会发现 Linux 已经有了许多使用和配置 Linux 系统所需要的文档。 + +另一个你必须熟悉命令行帮助工具的理由是,在[LFCS][3] 和 [LFCE][4] 考试中,它们是你唯一能够使用的信息来源,没有互联网也没有百度。你只能依靠你自己和命令行。 + +基于上面的理由,在这一章里我们将给你一些建议来可以让你有效的使用这些安装的文档和工具,以帮助你通过**Linux 基金会认证**考试。 + +### Linux 帮助手册(man) + +man 手册是 manual 手册的缩写,就是其名字所揭示的那样:一个给定工具的帮助手册。它包含了命令所支持的选项列表(以及解释),有些工具甚至还提供一些使用范例。 + +我们用 **man 命令** 跟上你想要了解的工具名称来打开一个帮助手册。例如: + +``` +# man diff +``` + +这将打开`diff`的手册页,这个工具将逐行对比文本文件(如你想退出只需要轻轻的点一下 q 键)。 + +下面我来比较两个文本文件 `file1` 和 `file2`。这两个文本文件包含了使用同一个 Linux 发行版相同版本安装的两台机器上的的安装包列表。 + +输入`diff` 命令它将告诉我们 `file1` 和`file2` 有什么不同: + +``` +# diff file1 file2 +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Compare-Two-Text-Files-in-Linux.png) + +*在Linux中比较两个文本文件* + +`<` 这个符号是说`file2`缺失的行。如果是 `file1`缺失,我们将用 `>` 符号来替代指示。 + +另外,**7d6** 意思是说`file1`的第**7**行要删除了才能和`file2`一致(**24d22** 和 **41d38** 也是同样的意思) **65,67d61** 告诉需要删除从第 **65** 行到 **67** 行。我们完成了以上步骤,那么这两个文件将完全一致。 + +此外,根据 man 手册说明,你还可以通过 `-y` 选项来以两路的方式显示文件。你可以发现这对于你找到两个文件间的不同根据方便容易。 + +``` +# diff -y file1 file2 +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Compare-and-List-Difference-of-Two-Files.png) + +*比较并列出两个文件的不同* + +此外,你也可以用`diff`来比较两个二进制文件。如果它们完全一样,`diff` 将什么也不会输出。否则,它将会返回如下信息:“**Binary files X and Y differ**”。 + +### –help 选项 + +`--help`选项,大多数命令都支持它(并不是所有), 它可以理解为一个命令的简短帮助手册。尽管它没有提供工具的详细介绍,但是确实是一个能够快速列出程序的所支持的选项的不错的方法。 + +例如, + +``` +# sed --help +``` + +将显示 sed (流编辑器)的每个支持的选项。 + +`sed`命令的一个典型用法是替换文件中的字符。用 `-i` 选项(意思是 “**原地编辑编辑文件**”),你可以编辑一个文件而且并不需要打开它。 如果你想要同时备份一个原始文件,用 `-i` 选项加后缀来创建一个原始文件的副本。 + +例如,替换 `lorem.txt` 中的`Lorem` 为 `Tecmint`(忽略大小写),并且创建一个原文件的备份副本,命令如下: + +``` +# less lorem.txt | grep -i lorem +# sed -i.orig 's/Lorem/Tecmint/gI' lorem.txt +# less lorem.txt | grep -i lorem +# less lorem.txt.orig | grep -i lorem +``` + +请注意`lorem.txt`文件中`Lorem` 都已经替换为 `Tecmint`,并且原文件 `lorem.txt` 被保存为`lorem.txt.orig`。 + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Replace-A-String-in-File.png) + +*替换文件中的文本* + +### /usr/share/doc 内的文档 + +这可能是我最喜欢的方法。如果你进入 `/usr/share/doc` 目录,并列出该目录,你可以看到许多以安装在你的 Linux 上的工具为名称的文件夹。 + +根据 [文件系统层级标准][5],这些文件夹包含了许多帮助手册没有的信息,还有一些可以使配置更方便的模板和配置文件。 + +例如,让我们来看一下 `squid-3.3.8` (不同发行版的版本可能会不同),这还是一个非常受欢迎的 HTTP 代理和 [squid 缓存服务器][6]。 + +让我们用`cd`命令进入目录: + +``` +# cd /usr/share/doc/squid-3.3.8 +``` + +列出当前文件夹列表: + +``` +# ls +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/03/List-Files-in-Linux.png) + +*使用 ls 列出目录* + +你应该特别注意 `QUICKSTART` 和 `squid.conf.documented`。这些文件分别包含了 Squid 详细文档及其经过详细备注的配置文件。对于别的安装包来说,具体的名字可能不同(有可能是 **QuickRef** 或者**00QUICKSTART**),但意思是一样的。 + +对于另外一些安装包,比如 Apache web 服务器,在`/usr/share/doc`目录提供了配置模板,当你配置独立服务器或者虚拟主机的时候会非常有用。 + +### GNU 信息文档 + +你可以把它看做帮助手册的“开挂版”。它不仅仅提供工具的帮助信息,而且还是超级链接的形式(没错,在命令行中的超级链接),你可以通过箭头按钮从一个章节导航到另外章节,并按下回车按钮来确认。 + +一个典型的例子是: + +``` +# info coreutils +``` + +因为 coreutils 包含了每个系统中都有的基本文件、shell 和文本处理工具,你自然可以从 coreutils 的 info 文档中得到它们的详细介绍。 + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Info-Coreutils.png) + +*Info Coreutils* + +和帮助手册一样,你可以按 q 键退出。 + +此外,GNU info 还可以显示标准的帮助手册。 例如: + +``` +# info tune2fs +``` + +它将显示 **tune2fs**的帮助手册, 这是一个 ext2/3/4 文件系统管理工具。 + +我们现在看到了,让我们来试试怎么用**tune2fs**: + +显示 **/dev/mapper/vg00-vol_backups** 文件系统信息: + +``` +# tune2fs -l /dev/mapper/vg00-vol_backups +``` + +修改文件系统标签(修改为 Backups): + +``` +# tune2fs -L Backups /dev/mapper/vg00-vol_backups +``` + +设置文件系统的自检间隔及挂载计数(用`-c` 选项设置挂载计数间隔, 用 `-i` 选项设置自检时间间隔,这里 **d 表示天,w 表示周,m 表示月**)。 + +``` +# tune2fs -c 150 /dev/mapper/vg00-vol_backups # 每 150 次挂载检查一次 +# tune2fs -i 6w /dev/mapper/vg00-vol_backups # 每 6 周检查一次 +``` + +以上这些内容也可以通过 `--help` 选项找到,或者查看帮助手册。 + +### 摘要 + +不管你选择哪种方法,知道并且会使用它们在考试中对你是非常有用的。你知道其它的一些方法吗? 欢迎给我们留言。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/explore-linux-installed-help-documentation-and-tools/ + +作者:[Gabriel Cánepa][a] +译者:[kokialoves](https://github.com/kokialoves) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]: https://linux.cn/article-7161-1.html +[2]: http://www.tecmint.com/installing-network-services-and-configuring-services-at-system-boot/ +[3]: https://linux.cn/article-7161-1.html +[4]: http://www.tecmint.com/installing-network-services-and-configuring-services-at-system-boot/ +[5]: https://linux.cn/article-6132-1.html +[6]: http://www.tecmint.com/configure-squid-server-in-linux/ +[7]: http://www.tecmint.com/sed-command-to-create-edit-and-manipulate-files-in-linux/ + diff --git a/translated/tech/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md b/translated/tech/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md deleted file mode 100644 index 2d0238becf..0000000000 --- a/translated/tech/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md +++ /dev/null @@ -1,178 +0,0 @@ -LFCS第十二讲: 如何使用Linux的帮助文档和工具 -================================================================================== - -由于 2016 年 2 月 2 号开始启用了新的 LFCS 考试要求, 我们在[LFCS series][1]系列添加了一些必要的内容 . 为了考试的需要, 我们强烈建议你看一下[LFCE series][2] . - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Explore-Linux-with-Documentation-and-Tools.png) ->LFCS: 了解Linux的帮助文档和工具 - -当你习惯了在命令行下进行工作, 你会发现Linux有许多文档需要你去使用和配置Linux系统. - -另一个你必须熟悉命令行帮助工具的理由是,在[LFCS][3] 和 [LFCE][4] 考试中, 你只能靠你自己和命令行工具,没有互联网也没有百度。 - -基于上面的理由, 在这一章里我们将给你一些建议来帮助你通过**Linux Foundation Certification** 考试. - -### Linux 帮助手册 - -man命令, 大体上来说就是一个工具手册. 它包含选项列表(和解释) , 甚至还提供一些例子. - -我们用**man command** 加工具名称来打开一个帮助手册以便获取更多内容. 例如: - -``` -# man diff -``` - -我们将打开`diff`的手册页, 这个工具将一行一行的对比文本文档 (如你想退出只需要轻轻的点一下Q键). - -下面我来比较两个文本文件 `file1` 和 `file2` . 这两个文本文件包含着相同版本Linux的安装包信息. - -输入`diff` 命令它将告诉我们 `file1` 和`file2` 有什么不同: - -``` -# diff file1 file2 -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Compare-Two-Text-Files-in-Linux.png) ->在Linux中比较两个文本文件 - -`<` 这个符号是说`file2`少一行. 如果是 `file1`少一行, 我们将用 `>` 符号来替代. - -接下来说, **7d6** 意思是说 文件1的**#7**行在 `file2`中被删除了 ( **24d22** 和**41d38**是同样的意思), 65,67d61告诉我们移动 **65** 到 **67** . 我们把以上步骤都做了两个文件将完全匹配. - -你还可以通过 `-y` 选项来对比两个文件: - -``` -# diff -y file1 file2 -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Compare-and-List-Difference-of-Two-Files.png) ->通过列表来列出两个文件的不同 - - 当然你也可以用`diff`来比较两个二进制文件 . 如果它们完全一样, `diff` 将什么也不会输出. 否则, 他将会返回如下信息: “**Binary files X and Y differ**”. - -### –help 选项 - -`--help`选项 , 大多数命令都可以用它(并不是所有) , 他可以理解为一个命令的简单介绍. 尽管它不提供工具的详细介绍, 但是确实是一个能够快速列出程序使用信息的不错的方法. - -例如, - -``` -# sed --help -``` - -显示 sed 的每个选项的用法(sed文本流编辑器). - -一个经典的`sed`例子,替换文件字符. 用 `-i` 选项 (描述为 “**编辑文件在指定位置**”), 你可以编辑一个文件而且并不需要打开他. 如果你想要备份一个原始文件, 用 `-i` 选项 加后缀来创建一个原始文件的副本. - -例如, 替换 `lorem.txt`中的`Lorem` 为 `Tecmint` (忽略大小写) 并且创建一个新的原始文件副本, 命令如下: - -``` -# less lorem.txt | grep -i lorem -# sed -i.orig 's/Lorem/Tecmint/gI' lorem.txt -# less lorem.txt | grep -i lorem -# less lorem.txt.orig | grep -i lorem -``` - - 请注意`lorem.txt`文件中`Lorem` 都已经替换为 `Tecmint` , 并且原始的 `lorem.txt` 保存为`lorem.txt.orig`. - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Replace-A-String-in-File.png) ->替换文件文本 - -### /usr/share/doc内的文档 -这可能是我最喜欢的方法. 如果你进入 `/usr/share/doc` 目录, 你可以看到好多Linux已经安装的工具的名称的文件夹. - -根据[Filesystem Hierarchy Standard][5](文件目录标准),这些文件夹包含了许多帮助手册没有的信息, 还有一些模板和配置文件. - -例如, 让我们来看一下 `squid-3.3.8` (版本可能会不同) 一个非常受欢迎的HTTP代理[squid cache server][6]. - -让我们用`cd`命令进入目录 : - -``` -# cd /usr/share/doc/squid-3.3.8 -``` - -列出当前文件夹列表: - -``` -# ls -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/03/List-Files-in-Linux.png) ->ls linux列表命令 - -你应该特别注意 `QUICKSTART` 和 `squid.conf.documented`. 这两个文件包含了Squid许多信息, . 对于别的安装包来说, 他们的名字可能不同 (有可能是 **QuickRef** 或者**00QUICKSTART**), 但原理是一样的. - -对于另外一些安装包, 比如 the Apache web server, 在`/usr/share/doc`目录提供了配置模板, 当你配置独立服务器或者虚拟主机的时候会非常有用. - -### GNU 信息文档 - -你可以把它想象为帮助手册的超级链接形式. 正如上面说的, 他不仅仅提供工具的帮助信息, 而且还是超级链接的形式(是的!在命令行中的超级链接) 你可以通过箭头按钮和回车按钮来浏览你需要的内容. - -一个典型的例子是: - -``` -# info coreutils -``` - -通过coreutils 列出当前系统的 基本文件,shell脚本和文本处理工具[basic file, shell and text manipulation utilities][7] , 你可以得到他们的详细介绍. - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Info-Coreutils.png) ->Info Coreutils - -和帮助手册一样你可以按Q键退出. - -此外, GNU info 还可以像帮助手册一样使用. 例如: - -``` -# info tune2fs -``` - -它将显示 **tune2fs**的帮助手册, ext2/3/4 文件系统管理工具. - -让我们来看看怎么用**tune2fs**: - -显示 **/dev/mapper/vg00-vol_backups**文件系统信息: - -``` -# tune2fs -l /dev/mapper/vg00-vol_backups -``` - -修改文件系统标签 (修改为Backups): - -``` -# tune2fs -L Backups /dev/mapper/vg00-vol_backups -``` - -设置 `/` 自检的挂载次数 (用`-c` 选项设置 `/`的自检的挂载次数 或者用 `-i` 选项设置 自检时间 **d=days, w=weeks, and m=months**). - -``` -# tune2fs -c 150 /dev/mapper/vg00-vol_backups # Check every 150 mounts -# tune2fs -i 6w /dev/mapper/vg00-vol_backups # Check every 6 weeks -``` - -以上这些内容也可以通过 `--help` 选项找到, 或者查看帮助手册. - -### 摘要 - -不管你选择哪种方法,知道并且会使用它们在考试中对你是非常有用的. 你知道其它的一些方法吗? 欢迎给我们留言. - - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/linux-basic-shell-scripting-and-linux-filesystem-troubleshooting/ - -作者:[Gabriel Cánepa][a] -译者:[kokialoves](https://github.com/kokialoves) -校对:[校对者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/installing-network-services-and-configuring-services-at-system-boot/ -[3]: http://www.tecmint.com/sed-command-to-create-edit-and-manipulate-files-in-linux/ -[4]: http://www.tecmint.com/installing-network-services-and-configuring-services-at-system-boot/ -[5]: http://www.tecmint.com/linux-directory-structure-and-important-files-paths-explained/ -[6]: http://www.tecmint.com/configure-squid-server-in-linux/ -[7]: http://www.tecmint.com/sed-command-to-create-edit-and-manipulate-files-in-linux/ -[8]: From e8690b1517c51fb2074de4324bf52d944309f79d Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 25 Jul 2016 10:00:24 +0800 Subject: [PATCH 1237/1469] =?UTF-8?q?20160725-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...O CHANGE DEFAULT APPLICATIONS IN UBUNTU.md | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 sources/tech/20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md diff --git a/sources/tech/20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md b/sources/tech/20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md new file mode 100644 index 0000000000..37692dfd7b --- /dev/null +++ b/sources/tech/20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md @@ -0,0 +1,67 @@ +HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU +============================================== + +![](https://itsfoss.com/wp-content/uploads/2016/07/change-default-applications-ubuntu.jpg) + +Brief: This beginners guide shows you how to change the default applications in Ubuntu Linux. + +Installing [VLC media player][1] is one of the first few [things to do after installing Ubuntu 16.04][2] for me. One thing I do after installing VLC is to make it the default application so that I can open video file with VLC when I double click it. + +As a beginner, you may need to know how to change any default application in Ubuntu and this is what I am going to show you in today’s tutorial. + +### CHANGE DEFAULT APPLICATIONS IN UBUNTU + +The methods mentioned here are valid for all versions of Ubuntu be it Ubuntu 12.04, Ubuntu 14.04 or Ubuntu 16.04. There are basically two ways you can change the default applications in Ubuntu: + +- via system settings +- via right click menu + +#### 1. CHANGE DEFAULT APPLICATIONS IN UBUNTU FROM SYSTEM SETTINGS + +Go to Unity Dash and search for System Settings: + +![](https://itsfoss.com/wp-content/uploads/2013/11/System_Settings_Ubuntu.jpeg) + +In the System Settings, click on the Details option: + +![](https://itsfoss.com/wp-content/uploads/2016/07/System-settings-detail-ubuntu.jpeg) + +In here, from the left side pane, select Default Applications. You will see the option to change the default applications in the right side pane. + +![](https://itsfoss.com/wp-content/uploads/2016/07/System-settings-default-applications.jpeg) + +As you can see, there are only a few kinds of default applications that can be changed here. You can change the default applications for web browser, email client, calendar app, music, videos and photo here. What about other kinds of applications? + +Don’t worry. To change the default applications of other kinds, we’ll use the option in the right click menu. + +#### 2. CHANGE DEFAULT APPLICATIONS IN UBUNTU FROM RIGHT CLICK MENU + +If you have ever used Windows, you might be aware of the “open with” option in the right click menu that allows changing the default applications. We have something similar in Ubuntu Linux as well. + +Right click on the file that you want to open in a non-default application. Go to properties. + +![](https://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-3.png) +>Select Properties from Right Click menu + +And in here, you can select the application that you want to use and set it as default. + +![](https://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-4.png) +>Making gThumb the default application for WebP images in Ubuntu + +Easy peasy. Isn’t it? Once you do that, all the files of the same kind will be opened with your chosen default application. + +I hope you found this beginners tutorial to change default applications in Ubuntu helpful. If you have any questions or suggestions, feel free to drop a comment below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/change-default-applications-ubuntu/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 + +作者:[Abhishek Prakash][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[1]: http://www.videolan.org/vlc/index.html +[2]: https://itsfoss.com/things-to-do-after-installing-ubuntu-16-04/ From 97131e94b16eb49615197b87d2c8a270346502bf Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 25 Jul 2016 10:10:34 +0800 Subject: [PATCH 1238/1469] =?UTF-8?q?20160725-2=20=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0160718 OPEN SOURCE ACCOUNTING SOFTWARE.md | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 sources/tech/20160718 OPEN SOURCE ACCOUNTING SOFTWARE.md diff --git a/sources/tech/20160718 OPEN SOURCE ACCOUNTING SOFTWARE.md b/sources/tech/20160718 OPEN SOURCE ACCOUNTING SOFTWARE.md new file mode 100644 index 0000000000..4232e6cda8 --- /dev/null +++ b/sources/tech/20160718 OPEN SOURCE ACCOUNTING SOFTWARE.md @@ -0,0 +1,71 @@ +GNU KHATA: OPEN SOURCE ACCOUNTING SOFTWARE +============================================ + +Being an active Linux enthusiast, I usually introduce my friends to Linux, help them choose the best distro to suit their needs, and finally get them set with open source alternative software for their work. + +But in one case, I was pretty helpless. My uncle, who is a freelance accountant, uses a set of some pretty sophisticated paid software for work. And I wasn’t sure if I’d find anything under FOSS for him, until Yesterday. + +Abhishek was suggesting me some [cool apps][1] to check out and this particular one, GNU Khata stuck out. + +[GNU Khata][2] is an accounting tool. Or shall I say a collection of accounting tools? It is like the [Evernote][3] of economy management. It is so versatile that it can be used from personal Finance management to large scale business management, from store inventory management to corporate tax works. + +One interesting fact for you. ‘Khata’ in Hindi and other Indian languages means account and hence this accounting software is called GNU Khata. + +### INSTALLATION + +There are many installation instructions floating around the internet which actually install the older web app version of GNU Khata. Currently, GNU Khata is available only for Debian/Ubuntu and their derivatives. I suggest you follow the steps given in GNU Khata official Website to install the updated standalone. Let me give them out real quick. + +- Download the installer [here][4]. +- Open the terminal in download location. +- Copy and paste the below code in terminal and run. + +``` +sudo chmod 755 GNUKhatasetup.run +sudo ./GNUKhatasetup.run +``` + +- That’s it. Open the GNU Khata from the dash or the application menu. +### FIRST LAUNCH + +GNU Khata opens up in the browser and displays the following page. + +![](https://itsfoss.com/wp-content/uploads/2016/07/GNU-khata-1.jpg) + +Fill in the Organization name, case and organization type, financial year and click on proceed to go to the admin setup page. + +![](https://itsfoss.com/wp-content/uploads/2016/07/GNU-khata-2.jpg) + +Carefully feed in your name, password, security question and the answer and click on “create and login”. + +![](https://itsfoss.com/wp-content/uploads/2016/07/GNU-khata-3.jpg) + +You’re all set now. Use the Menu bar to start using GNU Khata to manage your finances. It’s that easy. + +### DOES GNU KHATA REALLY RIVAL THE PAID ACCOUNTING SOFTWARE IN THE MARKET? + +To begin with, GNU Khata keeps it all simple. The menu bar up top is very conveniently organized to help you work faster and better. You can choose to manage different accounts and projects and access them easily. [Their Website][5] states that GNU Khata can be “easily transformed into Indian languages”. Also, did you know that GNU Khata can be used on the cloud too? + +All the major accounting tools like ledgers, project statements, statement of affairs etc are formatted in a professional manner and are made available in both instantly presentable as well as customizable formats. It makes accounting and inventory management look so easy. + +The Project is very actively evolving, seeks feedback and guidance from practicing accountants to make improvements in the software. Considering the maturity, ease of use and the absence of a price tag, GNU Khata can be the perfect assistant in bookkeeping. + +Let us know what you think about GNU Khata in the comments below. + + + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/using-gnu-khata/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 + +作者:[Aquil Roshan][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/aquil/ +[1]: https://itsfoss.com/category/apps/ +[2]: http://www.gnukhata.in/ +[3]: https://evernote.com/ +[4]: https://cloud.openmailbox.org/index.php/s/L8ppsxtsFq1345E/download +[5]: http://www.gnukhata.in/ From 62b8fb40c76e1d3b689a100bdbe4474c1f5c6947 Mon Sep 17 00:00:00 2001 From: ChrisLeeGit Date: Mon, 25 Jul 2016 12:03:23 +0800 Subject: [PATCH 1239/1469] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=EF=BC=9A20160711=20Getting=20started=20with=20Git.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20160711 Getting started with Git.md | 141 ------------------ .../tech/20160711 Getting started with Git.md | 130 ++++++++++++++++ 2 files changed, 130 insertions(+), 141 deletions(-) delete mode 100644 sources/tech/20160711 Getting started with Git.md create mode 100644 translated/tech/20160711 Getting started with Git.md diff --git a/sources/tech/20160711 Getting started with Git.md b/sources/tech/20160711 Getting started with Git.md deleted file mode 100644 index b748a160da..0000000000 --- a/sources/tech/20160711 Getting started with Git.md +++ /dev/null @@ -1,141 +0,0 @@ -Being translated by ChrisLeeGit - -Getting started with Git -========================= - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/get_started_lead.jpeg?itok=r22AKc6P) ->Image by : opensource.com - - -In the introduction to this series we learned who should use Git, and what it is for. Today we will learn how to clone public Git repositories, and how to extract individual files without cloning the whole works. - -Since Git is so popular, it makes life a lot easier if you're at least familiar with it at a basic level. If you can grasp the basics (and you can, I promise!), then you'll be able to download whatever you need, and maybe even contribute stuff back. And that, after all, is what open source is all about: having access to the code that makes up the software you run, the freedom to share it with others, and the right to change it as you please. Git makes this whole process easy, as long as you're comfortable with Git. - -So let's get comfortable with Git. - -### Read and write - -Broadly speaking, there are two ways to interact with a Git repository: you can read from it, or you can write to it. It's just like a file: sometimes you open a document just to read it, and other times you open a document because you need to make changes. - -In this article, we'll cover reading from a Git repository. We'll tackle the subject of writing back to a Git repository in a later article. - -### Git or GitHub? - -A word of clarification: Git is not the same as GitHub (or GitLab, or Bitbucket). Git is a command-line program, so it looks like this: - -``` -$ git -usage: Git [--version] [--help] [-C ] - [-p | --paginate | --no-pager] [--bare] - [--Git-dir=] [] - -``` - -As Git is open source, lots of smart people have built infrastructures around it which, in themselves, have become very popular. - -My articles about Git teach pure Git first, because if you understand what Git is doing then you can maintain an indifference to what front end you are using. However, my articles also include common ways of accomplishing each task through popular Git services, since that's probably what you'll encounter first. - -### Installing Git - -To install Git on Linux, grab it from your distribution's software repository. BSD users should find Git in the Ports tree, in the devel section. - -For non-open source operating systems, go to the [project site][1] and follow the instructions. Once installed, there should be no difference between Linux, BSD, and Mac OS X commands. Windows users will have to adapt Git commands to match the Windows file system, or install Cygwin to run Git natively, without getting tripped up by Windows file system conventions. - -### Afternoon tea with Git - -Not every one of us needs to adopt Git into our daily lives right away. Sometimes, the most interaction you have with Git is to visit a repository of code, download a file or two, and then leave. On the spectrum of getting to know Git, this is more like afternoon tea than a proper dinner party. You make some polite conversation, you get the information you need, and then you part ways without the intention of speaking again for at least another three months. - -And that's OK. - -Generally speaking, there are two ways to access Git: via command line, or by any one of the fancy Internet technologies providing quick and easy access through the web browser. - -Say you want to install a trash bin for use in your terminal because you've been burned one too many times by the rm command. You've heard about Trashy, which calls itself "a sane intermediary to the rm command", and you want to look over its documentation before you install it. Lucky for you, [Trashy is hosted publicly on GitLab.com][2]. - -### Landgrab - -The first way we'll work with this Git repository is a sort of landgrab method: we'll clone the entire thing, and then sort through the contents later. Since the repository is hosted with a public Git service, there are two ways to do this: on the command line, or through a web interface. - -To grab an entire repository with Git, use the git clone command with the URL of the Git repository. If you're not clear on what the right URL is, the repository should tell you. GitLab gives you a copy-and-paste repository URL [for Trashy][3]. - -![](https://opensource.com/sites/default/files/1_gitlab-url.jpg) - -You might notice that on some services, both SSH and HTTPS links are provided. You can use SSH only if you have write permissions to the repository. Otherwise, you must use the HTTPS URL. - -Once you have the right URL, cloning the repository is pretty simple. Just git clone the URL, and optionally name the directory to clone it into. The default behaviour is to clone the git directory to your current directory; for example, 'trashy.git' gets put in your current location as 'trashy'. I use the .clone extension as a shorthand for repositories that are read-only, and the .git extension as shorthand for repositories I can read and write, but that's not by any means an official mandate. - -``` -$ git clone https://gitlab.com/trashy/trashy.git trashy.clone -Cloning into 'trashy.clone'... -remote: Counting objects: 142, done. -remote: Compressing objects: 100% (91/91), done. -remote: Total 142 (delta 70), reused 103 (delta 47) -Receiving objects: 100% (142/142), 25.99 KiB | 0 bytes/s, done. -Resolving deltas: 100% (70/70), done. -Checking connectivity... done. -``` - -Once the repository has been cloned successfully, you can browse files in it just as you would any other directory on your computer. - -The other way to get a copy of the repository is through the web interface. Both GitLab and GitHub provide a snapshot of any repository in a .zip file. GitHub has a big green download button, but on GitLab, look for an inconspicuous download button on the far right of your browser window: - -![](https://opensource.com/sites/default/files/1_gitlab-zip.jpg) - -### Pick and choose - -An alternate method of obtaining a file from a Git repository is to find the file you're after and pluck it right out of the repository. This method is only supported via web interfaces, which is essentially you looking at someone else's clone of a repository; you can think of it as a sort of HTTP shared directory. - -The problem with using this method is that you might find that certain files don't actually exist in a raw Git repository, as a file might only exist in its complete form after a make command builds the file, which won't happen until you download the repository, read the README or INSTALL file, and run the command. Assuming, however, that you are sure a file does exist and you just want to go into the repository, grab it, and walk away, you can do that. - -In GitLab and GitHub, click the Files link for a file view, view the file in Raw mode, and use your web browser's save function, e.g. in Firefox, File > Save Page As. In a GitWeb repository (a web view of personal git repositories used some who prefer to host git themselves), the Raw view link is in the file listing view. - -![](https://opensource.com/sites/default/files/1_webgit-file.jpg) - -### Best practices - -Generally, cloning an entire Git repository is considered the right way of interacting with Git. There are a few reasons for this. Firstly, a clone is easy to keep updated with the git pull command, so you won't have to keep going back to some web site for a new copy of a file each time an improvement has been made. Secondly, should you happen to make an improvement yourself, then it is easier to submit those changes to the original author if it is all nice and tidy in a Git repository. - -For now, it's probably enough to just practice going out and finding interesting Git repositories and cloning them to your drive. As long as you know the basics of using a terminal, then it's not hard to do. Don't know the basics of terminal usage? Give me five more minutes of your time. - -### Terminal basics - -The first thing to understand is that all files have a path. That makes sense; if I told you to open a file for me on a regular non-terminal day, you'd have to get to where that file is on your drive, and you'd do that by navigating a bunch of computer windows until you reached that file. For example, maybe you'd click your home directory > Pictures > InktoberSketches > monkey.kra. - -In that scenario, we could say that the file monkeysketch.kra has the path $HOME/Pictures/InktoberSketches/monkey.kra. - -In the terminal, unless you're doing special sysadmin work, your file paths are generally going to start with $HOME (or, if you're lazy, just the ~ character) followed by a list of folders up to the filename itself. This is analogous to whatever icons you click in your GUI to reach the file or folder. - -If you want to clone a Git repository into your Documents directory, then you could open a terminal and run this command: - -``` -$ git clone https://gitlab.com/foo/bar.git -$HOME/Documents/bar.clone -``` - -Once that is complete, you can open a file manager window, navigate to your Documents folder, and you'll find the bar.clone directory waiting for you. - -If you want to get a little more advanced, you might revisit that repository at some later date, and try a git pull to see if there have been updates to the project: - -``` -$ cd $HOME/Documents/bar.clone -$ pwd -bar.clone -$ git pull -``` - -For now, that's all the terminal commands you need to get started, so go out and explore. The more you do it, the better you get at it, and that is, at least give or take a vowel, the name of the game. - --------------------------------------------------------------------------------- - -via: https://opensource.com/life/16/7/stumbling-git - -作者:[Seth Kenlon][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[1]: https://git-scm.com/download -[2]: https://gitlab.com/trashy/trashy -[3]: https://gitlab.com/trashy/trashy.git - diff --git a/translated/tech/20160711 Getting started with Git.md b/translated/tech/20160711 Getting started with Git.md new file mode 100644 index 0000000000..85c159945d --- /dev/null +++ b/translated/tech/20160711 Getting started with Git.md @@ -0,0 +1,130 @@ +Git 入门指南 +========================= + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/get_started_lead.jpeg?itok=r22AKc6P) +>Image by : opensource.com + +在这个系列的介绍中,我们学习到了谁应该使用 Git,以及 Git 是用来做什么的。今天,我们将学习如何克隆公共的 Git 仓库,以及如何提取出独立的文件而不用克隆整个仓库。 + +由于 Git 如此流行,因而如果你能够至少熟悉一些基础的 Git 知识也能为你的生活带来很多便捷。如果你可以掌握 Git 基础(你可以的,我发誓!),那么你将能够下载任何你需要的东西,甚至还可能做一些贡献作为回馈。毕竟,那就是开源的精髓所在:你拥有获取你使用的软件代码的权利,拥有和他人分享的自由,以及只要你愿意就可以修改它的权利。只要你熟悉了 Git,它就可以让这一切都变得很容易。 + +那么,让我们一起来熟悉 Git 吧。 + +### 读和写 +一般来说,有两种方法可以和 Git 仓库交互:你可以从仓库中读取,或者你也能够向仓库中写入。它就像一个文件:有时候你打开一个文档只是为了阅读它,而其它时候你打开文档是因为你需要做些改动。 + +本文仅讲解如何从 Git 仓库读取。我们将会在后面的一篇文章中讲解如何向 Git 仓库写回的主题。 + +### Git 还是 GitHub? +一句话澄清:Git 不同于 GitHub(或 GitLab,或 Bitbucket)。Git 是一个命令行程序,所以它就像下面这样: + +``` +$ git +usage: Git [--version] [--help] [-C ] + [-p | --paginate | --no-pager] [--bare] + [--Git-dir=] [] + +``` + +由于 Git 是开源的,所以就有许多聪明人围绕它构建了基础软件;这些基础软件,包括在他们自己身边,都已经变得非常流行了。 + +我的文章系列将首先教你纯粹的 Git 知识,因为一旦你理解了 Git 在做什么,那么你就无需关心正在使用的前端工具是什么了。然而,我的文章系列也将涵盖通过流行的 Git 服务完成每项任务的常用方法,因为那些将可能是你首先会遇到的。 + +### 安装 Git +在 Linux 系统上,你可以从所使用的发行版软件仓库中获取并安装 Git。BSD 用户应当在 Ports 树的 devel 部分查找 Git。 + +对于闭源的操作系统,请前往 [项目网站][1] 并根据说明安装。一旦安装后,在 Linux、BSD 和 Mac OS X 上的命令应当没有任何差别。Windows 用户需要调整 Git 命令,从而和 Windows 文件系统相匹配,或者安装 Cygwin 以原生的方式运行 Git,而不受 Windows 文件系统转换问题的羁绊。 + +### 下午茶和 Git +并非每个人都需要立刻将 Git 加入到我们的日常生活中。有些时候,你和 Git 最多的交互就是访问一个代码库,下载一两个文件,然后就不用它了。以这样的方式看待 Git,它更像是下午茶而非一次正式的宴会。你进行一些礼节性的交谈,获得了需要的信息,然后你就会离开,至少接下来的三个月你不再想这样说话。 + +当然,那是可以的。 + +一般来说,有两种方法访问 Git:使用命令行,或者使用一种神奇的因特网技术通过 web 浏览器快速轻松地访问。 + +假设你想要在终端中安装并使用一个回收站,因为你已经被 rm 命令毁掉太多次了。你已经听说过 Trashy 了,它称自己为「理智的 rm 命令媒介」,并且你想在安装它之前阅读它的文档。幸运的是,[Trashy 公开地托管在 GitLab.com][2]。 + +### Landgrab +我们工作的第一步是对这个 Git 仓库使用 landgrab 排序方法:我们会克隆这个完整的仓库,然后会根据内容排序。由于该仓库是托管在公共的 Git 服务平台上,所以有两种方式来完成工作:使用命令行,或者使用 web 界面。 + +要想使用 Git 获取整个仓库,就要使用 git clone 命令和 Git 仓库的 URL 作为参数。如果你不清楚正确的 URL 是什么,仓库应该会告诉你的。GitLab 为你提供了 [Trashy][3] 仓库的拷贝-粘贴 URL。 + +![](https://opensource.com/sites/default/files/1_gitlab-url.jpg) + +你也许注意到了,在某些服务平台上,会同时提供 SSH 和 HTTPS 链接。只有当你拥有仓库的写权限时,你才可以使用 SSH。否则的话,你必须使用 HTTPS URL。 + +一旦你获得了正确的 URL,克隆仓库是非常容易的。就是 git clone 这个 URL 即可,可选项是可以指定要克隆到的目录。默认情况下会将 git 目录克隆到你当前所在的位置;例如,'trashy.git' 表示将仓库克隆到你当前位置的 'trashy' 目录。我使用 .clone 扩展名标记那些只读的仓库,使用 .git 扩展名标记那些我可以读写的仓库,但那无论如何也不是官方要求的。 + +``` +$ git clone https://gitlab.com/trashy/trashy.git trashy.clone +Cloning into 'trashy.clone'... +remote: Counting objects: 142, done. +remote: Compressing objects: 100% (91/91), done. +remote: Total 142 (delta 70), reused 103 (delta 47) +Receiving objects: 100% (142/142), 25.99 KiB | 0 bytes/s, done. +Resolving deltas: 100% (70/70), done. +Checking connectivity... done. +``` + +一旦成功地克隆了仓库,你就可以像对待你电脑上任何其它目录那样浏览仓库中的文件。 + +另外一种获得仓库拷贝的方式是使用 web 界面。GitLab 和 GitHub 都会提供一个 .zip 格式的仓库快照文件。GitHub 有一个大的绿色下载按钮,但是在 GitLab 中,可以浏览器的右侧找到并不显眼的下载按钮。 + +![](https://opensource.com/sites/default/files/1_gitlab-zip.jpg) + +### 挑选和选择 +另外一种从 Git 仓库中获取文件的方法是找到你想要的文件,然后把它从仓库中拽出来。只有 web 界面才提供这种方法,本质上来说,你看到的是别人仓库的克隆;你可以把它想象成一个 HTTP 共享目录。 + +使用这种方法的问题是,你也许会发现某些文件并不存在于原始仓库中,因为完整形式的文件可能只有在执行 make 命令后才能构建,那只有你下载了完整的仓库,阅读了 README 或者 INSTALL 文件,然后运行相关命令之后才会产生。不过,假如你确信文件存在,而你只想进入仓库,获取那个文件,然后离开的话,你就可以那样做。 + +在 GitLab 和 GitHub 中,单击文件链接,并在 Raw 模式下查看,然后使用你的 web 浏览器的保存功能,例如:在 Firefox 中,文件 > 保存页面为。在一个 GitWeb 仓库中(一些更喜欢自己托管 git 的人使用的私有 git 仓库 web 查看器),Raw 查看链接在文件列表视图中。 + +![](https://opensource.com/sites/default/files/1_webgit-file.jpg) + +### 最佳实践 +通常认为,和 Git 交互的正确方式是克隆完整的 Git 仓库。这样认为是有几个原因的。首先,可以使用 git pull 命令轻松地使克隆仓库保持更新,这样你就不必在每次文件改变时就重回 web 站点获得一份全新的拷贝。第二,你碰巧需要做些改进,只要保持仓库整洁,那么你可以非常轻松地向原来的作者提交所做的变更。 + +现在,可能是时候练习查找感兴趣的 Git 仓库,然后将它们克隆到你的硬盘中了。只要你了解使用终端的基础知识,那就不会太难做到。还不知道终端使用基础吗?那再给多我 5 分钟时间吧。 + +### 终端使用基础 +首先要知道的是,所有的文件都有一个路径。这是有道理的;如果我让你在常规的非终端环境下为我打开一个文件,你就要导航到文件在你硬盘的位置,并且直到你找到那个文件,你要浏览一大堆窗口。例如,你也许要点击你的家目录 > 图片 > InktoberSketches > monkey.kra。 + +在那样的场景下,我们可以说文件 monkeysketch.kra 的路径是:$HOME/图片/InktoberSketches/monkey.kra。 + +在终端中,除非你正在处理一些特殊的系统管理员任务,你的文件路径通常是以 $HOME 开头的(或者,如果你很懒,就使用 ~ 字符),后面紧跟着一些列的文件夹直到文件名自身。 +这就和你在 GUI 中点击各种图标直到找到相关的文件或文件夹类似。 + +如果你想把 Git 仓库克隆到你的文档目录,那么你可以打开一个终端然后运行下面的命令: + +``` +$ git clone https://gitlab.com/foo/bar.git +$HOME/文档/bar.clone +``` +一旦克隆完成,你可以打开一个文件管理器窗口,导航到你的文档文件夹,然后你就会发现 bar.clone 目录正在等待着你访问。 + +如果你想要更高级点,你或许会在以后再次访问那个仓库,可以尝试使用 git pull 命令来查看项目有没有更新: + +``` +$ cd $HOME/文档/bar.clone +$ pwd +bar.clone +$ git pull +``` + +到目前为止,你需要了解的所有终端命令就是那些了,那就出去探索吧。你实践得越多,Git 掌握得就越好(孰能生巧),那就是游戏的名称,至少它教会了你一些基础(give or take a vowel)。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/16/7/stumbling-git + +作者:[Seth Kenlon][a] +译者:[译者ID](https://github.com/chrisleegit) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[1]: https://git-scm.com/download +[2]: https://gitlab.com/trashy/trashy +[3]: https://gitlab.com/trashy/trashy.git + From a9862bebe083e1006bbd4894f8404116a4baf120 Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 25 Jul 2016 13:54:47 +0800 Subject: [PATCH 1240/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20160628 Python 101 An Intro to urllib.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160628 Python 101 An Intro to urllib.md b/sources/tech/20160628 Python 101 An Intro to urllib.md index 38620bf17b..3fb88971db 100644 --- a/sources/tech/20160628 Python 101 An Intro to urllib.md +++ b/sources/tech/20160628 Python 101 An Intro to urllib.md @@ -1,3 +1,5 @@ +ezio is translating + Python 101: An Intro to urllib ================================= From 67e14806563e377a942dac330be9692b9e9c7713 Mon Sep 17 00:00:00 2001 From: Locez Date: Mon, 25 Jul 2016 00:59:28 -0500 Subject: [PATCH 1241/1469] translating by locez --- .../20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md b/sources/tech/20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md index 37692dfd7b..1b4c576d1b 100644 --- a/sources/tech/20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md +++ b/sources/tech/20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md @@ -1,3 +1,4 @@ +translating by Locez HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU ============================================== From ab2415b83ec6d7c8168449e8215a5aeed453d7be Mon Sep 17 00:00:00 2001 From: joVoV <704451873@qq.com> Date: Mon, 25 Jul 2016 14:15:00 +0800 Subject: [PATCH 1242/1469] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/talk/20160627 Linux Practicality vs Activism.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/talk/20160627 Linux Practicality vs Activism.md b/sources/talk/20160627 Linux Practicality vs Activism.md index fc4f5eff26..195a9fdf5c 100644 --- a/sources/talk/20160627 Linux Practicality vs Activism.md +++ b/sources/talk/20160627 Linux Practicality vs Activism.md @@ -1,3 +1,5 @@ +jovov 正在翻译。。。 + Linux Practicality vs Activism ================================== From 180ba8b6386a1601e05c8d2ed6cb8395689a330d Mon Sep 17 00:00:00 2001 From: Locez Date: Mon, 25 Jul 2016 15:12:08 +0800 Subject: [PATCH 1243/1469] translated --- ...O CHANGE DEFAULT APPLICATIONS IN UBUNTU.md | 51 +++++++++---------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/sources/tech/20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md b/sources/tech/20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md index 1b4c576d1b..b6c9ae0cf7 100644 --- a/sources/tech/20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md +++ b/sources/tech/20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md @@ -1,64 +1,63 @@ -translating by Locez -HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU +怎样在 UBUNTU 中修改默认程序 ============================================== ![](https://itsfoss.com/wp-content/uploads/2016/07/change-default-applications-ubuntu.jpg) -Brief: This beginners guide shows you how to change the default applications in Ubuntu Linux. +简介: 这个新手指南会向你展示如何在 Ubuntu Linux 中修改默认程序 -Installing [VLC media player][1] is one of the first few [things to do after installing Ubuntu 16.04][2] for me. One thing I do after installing VLC is to make it the default application so that I can open video file with VLC when I double click it. +对于我来说,安装 [VLC 多媒体播放器][1]是[安装完 Ubuntu 16.04 该做的事][2]中最先做的几件事之一。为了能够使我双击一个视频就用 VLC 打开,在我安装完 VLC 之后我会设置它为默认程序。 -As a beginner, you may need to know how to change any default application in Ubuntu and this is what I am going to show you in today’s tutorial. +作为一个新手,你需要知道如何在 Ubuntu 中修改任何默认程序,这也是我今天在这篇指南中所要讲的。 -### CHANGE DEFAULT APPLICATIONS IN UBUNTU +### 在 UBUNTU 中修改默认程序 +这里提及的方法适用于所有的 Ubuntu 12.04,Ubuntu 14.04 和Ubuntu 16.04。在 Ubuntu 中,这里有两种基本的方法可以修改默认程序: -The methods mentioned here are valid for all versions of Ubuntu be it Ubuntu 12.04, Ubuntu 14.04 or Ubuntu 16.04. There are basically two ways you can change the default applications in Ubuntu: +- 通过系统设置 +- 通过右键菜单 -- via system settings -- via right click menu +#### 1.通过系统设置修改 Ubuntu 的默认程序 -#### 1. CHANGE DEFAULT APPLICATIONS IN UBUNTU FROM SYSTEM SETTINGS - -Go to Unity Dash and search for System Settings: +进入 Unity 面板并且搜索系统设置(System Settings): ![](https://itsfoss.com/wp-content/uploads/2013/11/System_Settings_Ubuntu.jpeg) -In the System Settings, click on the Details option: +在系统设置(System Settings)中,选择详细选项(Details): ![](https://itsfoss.com/wp-content/uploads/2016/07/System-settings-detail-ubuntu.jpeg) -In here, from the left side pane, select Default Applications. You will see the option to change the default applications in the right side pane. + +在左边的面板中选择默认程序(Default Applications),你会发现在右边的面板中可以修改默认程序。 ![](https://itsfoss.com/wp-content/uploads/2016/07/System-settings-default-applications.jpeg) -As you can see, there are only a few kinds of default applications that can be changed here. You can change the default applications for web browser, email client, calendar app, music, videos and photo here. What about other kinds of applications? +正如看到的那样,这里只有少数几类的默认程序可以被改变。你可以在这里改变浏览器,邮箱客户端,日历,音乐,视频和相册的默认程序。那其他类型的默认程序怎么修改? -Don’t worry. To change the default applications of other kinds, we’ll use the option in the right click menu. +不要担心,为了修改其他类型的默认程序,我们会用到右键菜单。 -#### 2. CHANGE DEFAULT APPLICATIONS IN UBUNTU FROM RIGHT CLICK MENU +#### 2.通过右键菜单修改默认程序 -If you have ever used Windows, you might be aware of the “open with” option in the right click menu that allows changing the default applications. We have something similar in Ubuntu Linux as well. -Right click on the file that you want to open in a non-default application. Go to properties. +如果你使用过 Windows 系统,你应该看见过右键菜单的“打开方式”,可以通过这个来修改默认程序。我们在 Ubuntu 中也有相似的方法。 + +右键一个还没有设置默认打开程序的文件,选择“属性(properties)” ![](https://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-3.png) ->Select Properties from Right Click menu +>从右键菜单中选择属性 -And in here, you can select the application that you want to use and set it as default. +在这里,你可以选择使用什么程序打开,并且设置为默认程序。 ![](https://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-4.png) ->Making gThumb the default application for WebP images in Ubuntu +>在 Ubuntu 中设置打开 WebP 图片的默认程序为 gThumb -Easy peasy. Isn’t it? Once you do that, all the files of the same kind will be opened with your chosen default application. - -I hope you found this beginners tutorial to change default applications in Ubuntu helpful. If you have any questions or suggestions, feel free to drop a comment below. +小菜一碟不是么?一旦你做完这些,所有同样类型的文件都会用你选择的默认程序打开。 +我很希望这个新手指南对你在修改 Ubuntu 的默认程序时有帮助。如果你有任何的疑问或者建议,可以随时在下面评论。 -------------------------------------------------------------------------------- via: https://itsfoss.com/change-default-applications-ubuntu/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 作者:[Abhishek Prakash][a] -译者:[译者ID](https://github.com/译者ID) +译者:[译者ID](https://github.com/locez) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b0aacf4336353088db849f02b32e4edfa2562379 Mon Sep 17 00:00:00 2001 From: Locez Date: Mon, 25 Jul 2016 15:13:12 +0800 Subject: [PATCH 1244/1469] translated --- .../20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md b/sources/tech/20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md index b6c9ae0cf7..2192b71600 100644 --- a/sources/tech/20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md +++ b/sources/tech/20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md @@ -57,7 +57,7 @@ via: https://itsfoss.com/change-default-applications-ubuntu/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 作者:[Abhishek Prakash][a] -译者:[译者ID](https://github.com/locez) +译者:[Locez](https://github.com/locez) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From deb9c2fd5350f642fc2e64b9f1f3bc4e12f54660 Mon Sep 17 00:00:00 2001 From: Locez Date: Mon, 25 Jul 2016 15:19:36 +0800 Subject: [PATCH 1245/1469] move to translated --- ...O CHANGE DEFAULT APPLICATIONS IN UBUNTU.md | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 translated/tech/20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md diff --git a/translated/tech/20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md b/translated/tech/20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md new file mode 100644 index 0000000000..2192b71600 --- /dev/null +++ b/translated/tech/20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md @@ -0,0 +1,67 @@ +怎样在 UBUNTU 中修改默认程序 +============================================== + +![](https://itsfoss.com/wp-content/uploads/2016/07/change-default-applications-ubuntu.jpg) + +简介: 这个新手指南会向你展示如何在 Ubuntu Linux 中修改默认程序 + +对于我来说,安装 [VLC 多媒体播放器][1]是[安装完 Ubuntu 16.04 该做的事][2]中最先做的几件事之一。为了能够使我双击一个视频就用 VLC 打开,在我安装完 VLC 之后我会设置它为默认程序。 + +作为一个新手,你需要知道如何在 Ubuntu 中修改任何默认程序,这也是我今天在这篇指南中所要讲的。 + +### 在 UBUNTU 中修改默认程序 +这里提及的方法适用于所有的 Ubuntu 12.04,Ubuntu 14.04 和Ubuntu 16.04。在 Ubuntu 中,这里有两种基本的方法可以修改默认程序: + +- 通过系统设置 +- 通过右键菜单 + +#### 1.通过系统设置修改 Ubuntu 的默认程序 + +进入 Unity 面板并且搜索系统设置(System Settings): + +![](https://itsfoss.com/wp-content/uploads/2013/11/System_Settings_Ubuntu.jpeg) + +在系统设置(System Settings)中,选择详细选项(Details): + +![](https://itsfoss.com/wp-content/uploads/2016/07/System-settings-detail-ubuntu.jpeg) + + +在左边的面板中选择默认程序(Default Applications),你会发现在右边的面板中可以修改默认程序。 + +![](https://itsfoss.com/wp-content/uploads/2016/07/System-settings-default-applications.jpeg) + +正如看到的那样,这里只有少数几类的默认程序可以被改变。你可以在这里改变浏览器,邮箱客户端,日历,音乐,视频和相册的默认程序。那其他类型的默认程序怎么修改? + +不要担心,为了修改其他类型的默认程序,我们会用到右键菜单。 + +#### 2.通过右键菜单修改默认程序 + + +如果你使用过 Windows 系统,你应该看见过右键菜单的“打开方式”,可以通过这个来修改默认程序。我们在 Ubuntu 中也有相似的方法。 + +右键一个还没有设置默认打开程序的文件,选择“属性(properties)” + +![](https://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-3.png) +>从右键菜单中选择属性 + +在这里,你可以选择使用什么程序打开,并且设置为默认程序。 + +![](https://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-4.png) +>在 Ubuntu 中设置打开 WebP 图片的默认程序为 gThumb + +小菜一碟不是么?一旦你做完这些,所有同样类型的文件都会用你选择的默认程序打开。 +我很希望这个新手指南对你在修改 Ubuntu 的默认程序时有帮助。如果你有任何的疑问或者建议,可以随时在下面评论。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/change-default-applications-ubuntu/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 + +作者:[Abhishek Prakash][a] +译者:[Locez](https://github.com/locez) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[1]: http://www.videolan.org/vlc/index.html +[2]: https://itsfoss.com/things-to-do-after-installing-ubuntu-16-04/ From 28a8b5c6afe4523b8e15c0537dc0fee7974fd76a Mon Sep 17 00:00:00 2001 From: Locez Date: Mon, 25 Jul 2016 15:20:50 +0800 Subject: [PATCH 1246/1469] translated and delete source --- ...O CHANGE DEFAULT APPLICATIONS IN UBUNTU.md | 67 ------------------- 1 file changed, 67 deletions(-) delete mode 100644 sources/tech/20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md diff --git a/sources/tech/20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md b/sources/tech/20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md deleted file mode 100644 index 2192b71600..0000000000 --- a/sources/tech/20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md +++ /dev/null @@ -1,67 +0,0 @@ -怎样在 UBUNTU 中修改默认程序 -============================================== - -![](https://itsfoss.com/wp-content/uploads/2016/07/change-default-applications-ubuntu.jpg) - -简介: 这个新手指南会向你展示如何在 Ubuntu Linux 中修改默认程序 - -对于我来说,安装 [VLC 多媒体播放器][1]是[安装完 Ubuntu 16.04 该做的事][2]中最先做的几件事之一。为了能够使我双击一个视频就用 VLC 打开,在我安装完 VLC 之后我会设置它为默认程序。 - -作为一个新手,你需要知道如何在 Ubuntu 中修改任何默认程序,这也是我今天在这篇指南中所要讲的。 - -### 在 UBUNTU 中修改默认程序 -这里提及的方法适用于所有的 Ubuntu 12.04,Ubuntu 14.04 和Ubuntu 16.04。在 Ubuntu 中,这里有两种基本的方法可以修改默认程序: - -- 通过系统设置 -- 通过右键菜单 - -#### 1.通过系统设置修改 Ubuntu 的默认程序 - -进入 Unity 面板并且搜索系统设置(System Settings): - -![](https://itsfoss.com/wp-content/uploads/2013/11/System_Settings_Ubuntu.jpeg) - -在系统设置(System Settings)中,选择详细选项(Details): - -![](https://itsfoss.com/wp-content/uploads/2016/07/System-settings-detail-ubuntu.jpeg) - - -在左边的面板中选择默认程序(Default Applications),你会发现在右边的面板中可以修改默认程序。 - -![](https://itsfoss.com/wp-content/uploads/2016/07/System-settings-default-applications.jpeg) - -正如看到的那样,这里只有少数几类的默认程序可以被改变。你可以在这里改变浏览器,邮箱客户端,日历,音乐,视频和相册的默认程序。那其他类型的默认程序怎么修改? - -不要担心,为了修改其他类型的默认程序,我们会用到右键菜单。 - -#### 2.通过右键菜单修改默认程序 - - -如果你使用过 Windows 系统,你应该看见过右键菜单的“打开方式”,可以通过这个来修改默认程序。我们在 Ubuntu 中也有相似的方法。 - -右键一个还没有设置默认打开程序的文件,选择“属性(properties)” - -![](https://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-3.png) ->从右键菜单中选择属性 - -在这里,你可以选择使用什么程序打开,并且设置为默认程序。 - -![](https://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-4.png) ->在 Ubuntu 中设置打开 WebP 图片的默认程序为 gThumb - -小菜一碟不是么?一旦你做完这些,所有同样类型的文件都会用你选择的默认程序打开。 -我很希望这个新手指南对你在修改 Ubuntu 的默认程序时有帮助。如果你有任何的疑问或者建议,可以随时在下面评论。 - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/change-default-applications-ubuntu/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 - -作者:[Abhishek Prakash][a] -译者:[Locez](https://github.com/locez) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[1]: http://www.videolan.org/vlc/index.html -[2]: https://itsfoss.com/things-to-do-after-installing-ubuntu-16-04/ From 9539049bf2ba6bb2f76aa6020bd954a090e82ea8 Mon Sep 17 00:00:00 2001 From: kokialoves <498497353@qq.com> Date: Mon, 25 Jul 2016 16:21:18 +0800 Subject: [PATCH 1247/1469] Update 20160628 How To Setup Open Source Discussion Platform Discourse On Ubuntu Linux 16.04.md --- ...Source Discussion Platform Discourse On Ubuntu Linux 16.04.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160628 How To Setup Open Source Discussion Platform Discourse On Ubuntu Linux 16.04.md b/sources/tech/20160628 How To Setup Open Source Discussion Platform Discourse On Ubuntu Linux 16.04.md index a2521673c9..738c3dbf55 100644 --- a/sources/tech/20160628 How To Setup Open Source Discussion Platform Discourse On Ubuntu Linux 16.04.md +++ b/sources/tech/20160628 How To Setup Open Source Discussion Platform Discourse On Ubuntu Linux 16.04.md @@ -1,3 +1,4 @@ +[translating by kokialoves] How To Setup Open Source Discussion Platform Discourse On Ubuntu Linux 16.04 =============================================================================== From 958f533847bfdded7e8a50d96a853cb932bb0b10 Mon Sep 17 00:00:00 2001 From: ChrisLeeGit Date: Mon, 25 Jul 2016 18:31:51 +0800 Subject: [PATCH 1248/1469] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...60621 Container technologies in Fedora - systemd-nspawn.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20160621 Container technologies in Fedora - systemd-nspawn.md b/sources/tech/20160621 Container technologies in Fedora - systemd-nspawn.md index 1ec72a3c90..6d3e08ac91 100644 --- a/sources/tech/20160621 Container technologies in Fedora - systemd-nspawn.md +++ b/sources/tech/20160621 Container technologies in Fedora - systemd-nspawn.md @@ -1,3 +1,5 @@ +Being translated by [ChrisLeeGit](https://github.com/chrisleegit) + Container technologies in Fedora: systemd-nspawn === @@ -97,7 +99,7 @@ $ restorecon -R /home/johnmh/DebianJessie/ via: http://linoxide.com/linux-how-to/set-nginx-reverse-proxy-centos-7-cpanel/ 作者:[John M. Harris, Jr.][a] -译者:[译者ID](https://github.com/译者ID) +译者:[ChrisLeeGit](https://github.com/chrisleegit) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c7c7ca71ad54930dfa59a2e51d250440f45a6db8 Mon Sep 17 00:00:00 2001 From: Name1e5s <836401406@qq.com> Date: Mon, 25 Jul 2016 20:34:25 +0800 Subject: [PATCH 1249/1469] name1e5s translating --- ...60627 TOP 5 BEST VIDEO EDITING SOFTWARE FOR LINUX IN 2016.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160627 TOP 5 BEST VIDEO EDITING SOFTWARE FOR LINUX IN 2016.md b/sources/tech/20160627 TOP 5 BEST VIDEO EDITING SOFTWARE FOR LINUX IN 2016.md index 44c66359f9..4faee7eaef 100644 --- a/sources/tech/20160627 TOP 5 BEST VIDEO EDITING SOFTWARE FOR LINUX IN 2016.md +++ b/sources/tech/20160627 TOP 5 BEST VIDEO EDITING SOFTWARE FOR LINUX IN 2016.md @@ -1,3 +1,5 @@ +name1e5s translating + TOP 5 BEST VIDEO EDITING SOFTWARE FOR LINUX IN 2016 ===================================================== From 85f2b50b2509d313fea84508025a580aee9010e3 Mon Sep 17 00:00:00 2001 From: cinlen <237448382@qq.com> Date: Mon, 25 Jul 2016 22:33:50 +0800 Subject: [PATCH 1250/1469] [translating]Who needs a GUI? How to live in a Linux terminal (#4219) * [translated]Growing a carrer alongside Linux * [translated]Growing a career alongside Linux * [translating]Who needs a GUI - How to live in a Linux terminal --- ...160606 Who needs a GUI - How to live in a Linux terminal.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/talk/20160606 Who needs a GUI - How to live in a Linux terminal.md b/sources/talk/20160606 Who needs a GUI - How to live in a Linux terminal.md index f9633eb966..148d758216 100644 --- a/sources/talk/20160606 Who needs a GUI - How to live in a Linux terminal.md +++ b/sources/talk/20160606 Who needs a GUI - How to live in a Linux terminal.md @@ -1,3 +1,4 @@ +chenxinlong translating Who needs a GUI? How to live in a Linux terminal ================================================= @@ -84,7 +85,7 @@ LibreOffice, Google Slides or, gasp, PowerPoint. I spend a lot of time in presen via: http://www.networkworld.com/article/3091139/linux/who-needs-a-gui-how-to-live-in-a-linux-terminal.html#slide1 作者:[Bryan Lunduke][a] -译者:[译者ID](https://github.com/译者ID) +译者:[译者ID](https://github.com/chenxinlong) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 574ae23673ec096484b72043bbe1dda619ef2052 Mon Sep 17 00:00:00 2001 From: ChrisLeeGit Date: Tue, 26 Jul 2016 06:38:14 +0800 Subject: [PATCH 1251/1469] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=9D=E8=AF=91?= =?UTF-8?q?=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- translated/tech/20160711 Getting started with Git.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/translated/tech/20160711 Getting started with Git.md b/translated/tech/20160711 Getting started with Git.md index 85c159945d..afa6b7382b 100644 --- a/translated/tech/20160711 Getting started with Git.md +++ b/translated/tech/20160711 Getting started with Git.md @@ -1,8 +1,8 @@ -Git 入门指南 +初步了解 Git ========================= ![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/get_started_lead.jpeg?itok=r22AKc6P) ->Image by : opensource.com +> 图片来源:opensource.com 在这个系列的介绍中,我们学习到了谁应该使用 Git,以及 Git 是用来做什么的。今天,我们将学习如何克隆公共的 Git 仓库,以及如何提取出独立的文件而不用克隆整个仓库。 @@ -72,7 +72,7 @@ Checking connectivity... done. ![](https://opensource.com/sites/default/files/1_gitlab-zip.jpg) -### 挑选和选择 +### 仔细挑选 另外一种从 Git 仓库中获取文件的方法是找到你想要的文件,然后把它从仓库中拽出来。只有 web 界面才提供这种方法,本质上来说,你看到的是别人仓库的克隆;你可以把它想象成一个 HTTP 共享目录。 使用这种方法的问题是,你也许会发现某些文件并不存在于原始仓库中,因为完整形式的文件可能只有在执行 make 命令后才能构建,那只有你下载了完整的仓库,阅读了 README 或者 INSTALL 文件,然后运行相关命令之后才会产生。不过,假如你确信文件存在,而你只想进入仓库,获取那个文件,然后离开的话,你就可以那样做。 @@ -111,14 +111,14 @@ bar.clone $ git pull ``` -到目前为止,你需要了解的所有终端命令就是那些了,那就出去探索吧。你实践得越多,Git 掌握得就越好(孰能生巧),那就是游戏的名称,至少它教会了你一些基础(give or take a vowel)。 +到目前为止,你需要初步了解的所有终端命令就是那些了,那就去探索吧。你实践得越多,Git 掌握得就越好(孰能生巧),那就是游戏的名称,至少给了或取了一个元音。 -------------------------------------------------------------------------------- via: https://opensource.com/life/16/7/stumbling-git 作者:[Seth Kenlon][a] -译者:[译者ID](https://github.com/chrisleegit) +译者:[ChrisLeeGit](https://github.com/chrisleegit) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 2ffb09b907d090d7cdefadaad2b59a94ca4114be Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 26 Jul 2016 09:00:31 +0800 Subject: [PATCH 1252/1469] PUB:Part 1 - LXD 2.0--Introduction to LXD MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @oska874 @PurlingNayuki 我说这篇怎么没啥可校对的,原来已经校对过了。 --- .../Part 1 - LXD 2.0--Introduction to LXD.md | 69 +++++++++---------- 1 file changed, 33 insertions(+), 36 deletions(-) rename {translated/tech => published}/LXD/Part 1 - LXD 2.0--Introduction to LXD.md (61%) diff --git a/translated/tech/LXD/Part 1 - LXD 2.0--Introduction to LXD.md b/published/LXD/Part 1 - LXD 2.0--Introduction to LXD.md similarity index 61% rename from translated/tech/LXD/Part 1 - LXD 2.0--Introduction to LXD.md rename to published/LXD/Part 1 - LXD 2.0--Introduction to LXD.md index 011f385881..11c7220964 100644 --- a/translated/tech/LXD/Part 1 - LXD 2.0--Introduction to LXD.md +++ b/published/LXD/Part 1 - LXD 2.0--Introduction to LXD.md @@ -1,4 +1,4 @@ -Part 1 - LXD 2.0: LXD 入门 +LXD 2.0 系列(一):LXD 入门 ====================================== 这是 [LXD 2.0 系列介绍文章][1]的第一篇。 @@ -20,12 +20,11 @@ LXD 最主要的目标就是使用 Linux 容器而不是硬件虚拟化向用户 LXD 聚焦于系统容器,通常也被称为架构容器。这就是说 LXD 容器实际上如在裸机或虚拟机上运行一般运行了一个完整的 Linux 操作系统。 -这些容器一般基于一个干净的发布镜像并会长时间运行。传统的配置管理工具和部署工具可以如在虚拟机、云和物理机器上一样与 LXD 一起使用。 +这些容器一般基于一个干净的发布镜像并会长时间运行。传统的配置管理工具和部署工具可以如在虚拟机、云实例和物理机器上一样与 LXD 一起使用。 -相对的, Docker 关注于短期的、无状态的最小容器,这些容器通常并不会升级或者重新配置,而是作为一个整体被替换掉。这就使得 Docker 及类似项目更像是一种软件发布机制,而不是一个机器管理工具。 - -这两种模型并不是完全互斥的。你完全可以使用 LXD 为你的用户提供一个完整的 Linux 系统,而他们可以在 LXD 内安装 Docker 来运行他们想要的软件。 +相对的, Docker 关注于短期的、无状态的、最小化的容器,这些容器通常并不会升级或者重新配置,而是作为一个整体被替换掉。这就使得 Docker 及类似项目更像是一种软件发布机制,而不是一个机器管理工具。 +这两种模型并不是完全互斥的。你完全可以使用 LXD 为你的用户提供一个完整的 Linux 系统,然后他们可以在 LXD 内安装 Docker 来运行他们想要的软件。 #### 为什么要用 LXD? @@ -35,56 +34,55 @@ LXD 聚焦于系统容器,通常也被称为架构容器。这就是说 LXD 我们把 LXD 作为解决这些缺陷的一个很好的机会。作为一个长时间运行的守护进程, LXD 可以绕开 LXC 的许多限制,比如动态资源限制、无法进行容器迁移和高效的在线迁移;同时,它也为创造新的默认体验提供了机会:默认开启安全特性,对用户更加友好。 - ### LXD 的主要组件 -LXD 是由几个主要组件构成的,这些组件都是 LXD 目录结构、命令行客户端和 API 结构体里下可见的。 +LXD 是由几个主要组件构成的,这些组件都出现在 LXD 目录结构、命令行客户端和 API 结构体里。 #### 容器 LXD 中的容器包括以下及部分: -- 根文件系统 +- 根文件系统(rootfs) +- 配置选项列表,包括资源限制、环境、安全选项等等 - 设备:包括磁盘、unix 字符/块设备、网络接口 - 一组继承而来的容器配置文件 -- 属性(容器架构,暂时的或持久的,容器名) -- 运行时状态(当时为了记录检查点、恢复时用到了 CRIU时) +- 属性(容器架构、暂时的还是持久的、容器名) +- 运行时状态(当用 CRIU 来中断/恢复时) #### 快照 容器快照和容器是一回事,只不过快照是不可修改的,只能被重命名,销毁或者用来恢复系统,但是无论如何都不能被修改。 -值得注意的是,因为我们允许用户保存容器的运行时状态,这就有效的为我们提供了“有状态”的快照的功能。这就是说我们可以使用快照回滚容器的 CPU 和内存。 +值得注意的是,因为我们允许用户保存容器的运行时状态,这就有效的为我们提供了“有状态”的快照的功能。这就是说我们可以使用快照回滚容器的状态,包括快照当时的 CPU 和内存状态。 #### 镜像 LXD 是基于镜像实现的,所有的 LXD 容器都是来自于镜像。容器镜像通常是一些纯净的 Linux 发行版的镜像,类似于你们在虚拟机和云实例上使用的镜像。 -所以就可以「发布」容器:使用容器制作一个镜像并在本地或者远程 LXD 主机上使用。 +所以可以「发布」一个容器:使用容器制作一个镜像并在本地或者远程 LXD 主机上使用。 -镜像通常使用全部或部分 sha256 哈希码来区分。因为输入长长的哈希码对用户来说不好,所以镜像可以使用几个自身的属性来区分,这就使得用户在镜像商店里方便搜索镜像。别名也可以用来 1 对 1 地把对用户友好的名字映射到某个镜像的哈希码。 +镜像通常使用全部或部分 sha256 哈希码来区分。因为输入长长的哈希码对用户来说不方便,所以镜像可以使用几个自身的属性来区分,这就使得用户在镜像商店里方便搜索镜像。也可以使用别名来一对一地将一个用户好记的名字映射到某个镜像的哈希码上。 LXD 安装时已经配置好了三个远程镜像服务器(参见下面的远程一节): -- “ubuntu:” 提供稳定版的 Ubuntu 镜像 -- “ubuntu-daily:” 提供每天构建出来的 Ubuntu -- “images:” 社区维护的镜像服务器,提供一系列的 Linux 发布版,使用的是上游 LXC 的模板 +- “ubuntu”:提供稳定版的 Ubuntu 镜像 +- “ubuntu-daily”:提供 Ubuntu 的每日构建镜像 +- “images”: 社区维护的镜像服务器,提供一系列的其它 Linux 发布版,使用的是上游 LXC 的模板 LXD 守护进程会从镜像上次被使用开始自动缓存远程镜像一段时间(默认是 10 天),超过时限后这些镜像才会失效。 此外, LXD 还会自动更新远程镜像(除非指明不更新),所以本地的镜像会一直是最新版的。 - #### 配置 -配置文件是一种在一处定义容器配置和容器设备,然后应用到一系列容器的方法。 +配置文件是一种在一个地方定义容器配置和容器设备,然后将其应用到一系列容器的方法。 -一个容器可以被应用多个配置文件。当构建最终容器配置时(即通常的扩展配置),这些配置文件都会按照他们定义顺序被应用到容器上,当有重名的配置时,新的会覆盖掉旧的。然后本地容器设置会在这些基础上应用,覆盖所有来自配置文件的选项。 +一个容器可以被应用多个配置文件。当构建最终容器配置时(即通常的扩展配置),这些配置文件都会按照他们定义顺序被应用到容器上,当有重名的配置键或设备时,新的会覆盖掉旧的。然后本地容器设置会在这些基础上应用,覆盖所有来自配置文件的选项。 LXD 自带两种预配置的配置文件: -- 「 default 」配置是自动应用在所有容器之上,除非用户提供了一系列替代的配置文件。目前这个配置文件只做一件事,为容器定义 eth0 网络设备。 -- 「 docker” 」配置是一个允许你在容器里运行 Docker 容器的配置文件。它会要求 LXD 加载一些需要的内核模块以支持容器嵌套并创建一些设备入口。 +- “default”配置是自动应用在所有容器之上,除非用户提供了一系列替代的配置文件。目前这个配置文件只做一件事,为容器定义 eth0 网络设备。 +- “docker”配置是一个允许你在容器里运行 Docker 容器的配置文件。它会要求 LXD 加载一些需要的内核模块以支持容器嵌套并创建一些设备。 #### 远程 @@ -92,14 +90,14 @@ LXD 自带两种预配置的配置文件: 默认情况下,我们的命令行客户端会与下面几个预定义的远程服务器通信: -- local:(默认的远程服务器,使用 UNIX socket 和本地的 LXD 守护进程通信) -- ubuntu:( Ubuntu 镜像服务器,提供稳定版的 Ubuntu 镜像) -- ubuntu-daily:( Ubuntu 镜像服务器,提供每天构建出来的 Ubuntu ) -- images:( images.linuxcontainers.org 镜像服务器) +- local:默认的远程服务器,使用 UNIX socket 和本地的 LXD 守护进程通信 +- ubuntu:Ubuntu 镜像服务器,提供稳定版的 Ubuntu 镜像 +- ubuntu-daily:Ubuntu 镜像服务器,提供 Ubuntu 的每日构建版 +- images:images.linuxcontainers.org 的镜像服务器 所有这些远程服务器的组合都可以在命令行客户端里使用。 -你也可以添加任意数量的远程 LXD 主机来监听网络。匿名的开放镜像服务器,或者通过认证可以管理远程容器的镜像服务器,都可以添加进来。 +你也可以添加任意数量的远程 LXD 主机,并配置它们监听网络。匿名的开放镜像服务器,或者通过认证可以管理远程容器的镜像服务器,都可以添加进来。 正是这种远程机制使得与远程镜像服务器交互及在主机间复制、移动容器成为可能。 @@ -107,30 +105,29 @@ LXD 自带两种预配置的配置文件: 我们设计 LXD 时的一个核心要求,就是在不修改现代 Linux 发行版的前提下,使容器尽可能的安全。 -LXD 使用的、通过使用 LXC 库实现的主要安全特性有: +LXD 通过使用 LXC 库实现的主要安全特性有: -- 内核名字空间。尤其是用户名字空间,它让容器和系统剩余部分完全分离。LXD 默认使用用户名字空间(和 LXC 相反),并允许用户在需要的时候以容器为单位打开或关闭。 +- 内核名字空间。尤其是用户名字空间,它让容器和系统剩余部分完全分离。LXD 默认使用用户名字空间(和 LXC 相反),并允许用户在需要的时候以容器为单位关闭(将容器标为“特权的”)。 - Seccomp 系统调用。用来隔离潜在危险的系统调用。 -- AppArmor:对 mount、socket、ptrace 和文件访问提供额外的限制。特别是限制跨容器通信。 +- AppArmor。对 mount、socket、ptrace 和文件访问提供额外的限制。特别是限制跨容器通信。 - Capabilities。阻止容器加载内核模块,修改主机系统时间,等等。 -- CGroups。限制资源使用,防止对主机的 DoS 攻击。 +- CGroups。限制资源使用,防止针对主机的 DoS 攻击。 +为了对用户友好,LXD 构建了一个新的配置语言把大部分的这些特性都抽象封装起来,而不是如 LXC 一般直接将这些特性暴露出来。举了例子,一个用户可以告诉 LXD 把主机设备放进容器而不需要手动检查他们的主/次设备号来手动更新 CGroup 策略。 -为了对用户友好 , LXD 构建了一个新的配置语言把大部分的这些特性都抽象封装起来,而不是如 LXC 一般直接将这些特性暴露出来。举了例子,一个用户可以告诉 LXD 把主机设备放进容器而不需要手动检查他们的主/次设备号来更新 CGroup 策略。 - -和 LXD 本身通信是基于使用 TLS 1.2 保护的链路,这些链路只允许使用有限的几个被允许的密钥。当和那些经过系统证书认证之外的主机通信时, LXD 会提示用户验证主机的远程足迹(SSH 方式),然后把足迹缓存起来以供以后使用。 +和 LXD 本身通信是基于使用 TLS 1.2 保护的链路,只允许使用有限的几个被允许的密钥算法。当和那些经过系统证书认证之外的主机通信时, LXD 会提示用户验证主机的远程指纹(SSH 方式),然后把指纹缓存起来以供以后使用。 ### REST 接口 -LXD 的工作都是通过 REST 接口实现的。在客户端和守护进程之间并没有其他的通讯手段。 +LXD 的工作都是通过 REST 接口实现的。在客户端和守护进程之间并没有其他的通讯渠道。 -REST 接口可以通过本地的 unix socket 访问,这只需要经过组认证,或者经过 HTTP 套接字使用客户端认证进行通信。 +REST 接口可以通过本地的 unix socket 访问,这只需要经过用户组认证,或者经过 HTTP 套接字使用客户端认证进行通信。 REST 接口的结构能够和上文所说的不同的组件匹配,是一种简单、直观的使用方法。 当需要一种复杂的通信机制时, LXD 将会进行 websocket 协商完成剩余的通信工作。这主要用于交互式终端会话、容器迁移和事件通知。 -LXD 2.0 附带了 1.0 版的稳定 API。虽然我们在 1.0 版 API 添加了额外的特性,但是这不会在 1.0 版 API 的端点里破坏向后兼容性,因为我们会声明额外的 API 扩展使得客户端可以找到新的接口。 +LXD 2.0 附带了 1.0 版的稳定 API。虽然我们在 1.0 版 API 添加了额外的特性,但是这不会在 1.0 版 API 端点里破坏向后兼容性,因为我们会声明额外的 API 扩展使得客户端可以找到新的接口。 ### 容器规模化 From 170200ad4e794553e1410982afc6d2b213e547d3 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 26 Jul 2016 09:03:56 +0800 Subject: [PATCH 1253/1469] =?UTF-8?q?=E8=BF=99=E7=AF=87=E5=B7=B2=E7=BB=8F?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E8=BF=87=EF=BC=8C=E5=B9=B6=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E5=88=B0=20PUB=20=E4=B8=8B=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @kokialoves @locez --- ...Installed Help Documentations and Tools.md | 178 ------------------ 1 file changed, 178 deletions(-) delete mode 100644 translated/tech/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md diff --git a/translated/tech/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md b/translated/tech/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md deleted file mode 100644 index 2d0238becf..0000000000 --- a/translated/tech/LFCS/Part 12 - How to Explore Linux with Installed Help Documentations and Tools.md +++ /dev/null @@ -1,178 +0,0 @@ -LFCS第十二讲: 如何使用Linux的帮助文档和工具 -================================================================================== - -由于 2016 年 2 月 2 号开始启用了新的 LFCS 考试要求, 我们在[LFCS series][1]系列添加了一些必要的内容 . 为了考试的需要, 我们强烈建议你看一下[LFCE series][2] . - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Explore-Linux-with-Documentation-and-Tools.png) ->LFCS: 了解Linux的帮助文档和工具 - -当你习惯了在命令行下进行工作, 你会发现Linux有许多文档需要你去使用和配置Linux系统. - -另一个你必须熟悉命令行帮助工具的理由是,在[LFCS][3] 和 [LFCE][4] 考试中, 你只能靠你自己和命令行工具,没有互联网也没有百度。 - -基于上面的理由, 在这一章里我们将给你一些建议来帮助你通过**Linux Foundation Certification** 考试. - -### Linux 帮助手册 - -man命令, 大体上来说就是一个工具手册. 它包含选项列表(和解释) , 甚至还提供一些例子. - -我们用**man command** 加工具名称来打开一个帮助手册以便获取更多内容. 例如: - -``` -# man diff -``` - -我们将打开`diff`的手册页, 这个工具将一行一行的对比文本文档 (如你想退出只需要轻轻的点一下Q键). - -下面我来比较两个文本文件 `file1` 和 `file2` . 这两个文本文件包含着相同版本Linux的安装包信息. - -输入`diff` 命令它将告诉我们 `file1` 和`file2` 有什么不同: - -``` -# diff file1 file2 -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Compare-Two-Text-Files-in-Linux.png) ->在Linux中比较两个文本文件 - -`<` 这个符号是说`file2`少一行. 如果是 `file1`少一行, 我们将用 `>` 符号来替代. - -接下来说, **7d6** 意思是说 文件1的**#7**行在 `file2`中被删除了 ( **24d22** 和**41d38**是同样的意思), 65,67d61告诉我们移动 **65** 到 **67** . 我们把以上步骤都做了两个文件将完全匹配. - -你还可以通过 `-y` 选项来对比两个文件: - -``` -# diff -y file1 file2 -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Compare-and-List-Difference-of-Two-Files.png) ->通过列表来列出两个文件的不同 - - 当然你也可以用`diff`来比较两个二进制文件 . 如果它们完全一样, `diff` 将什么也不会输出. 否则, 他将会返回如下信息: “**Binary files X and Y differ**”. - -### –help 选项 - -`--help`选项 , 大多数命令都可以用它(并不是所有) , 他可以理解为一个命令的简单介绍. 尽管它不提供工具的详细介绍, 但是确实是一个能够快速列出程序使用信息的不错的方法. - -例如, - -``` -# sed --help -``` - -显示 sed 的每个选项的用法(sed文本流编辑器). - -一个经典的`sed`例子,替换文件字符. 用 `-i` 选项 (描述为 “**编辑文件在指定位置**”), 你可以编辑一个文件而且并不需要打开他. 如果你想要备份一个原始文件, 用 `-i` 选项 加后缀来创建一个原始文件的副本. - -例如, 替换 `lorem.txt`中的`Lorem` 为 `Tecmint` (忽略大小写) 并且创建一个新的原始文件副本, 命令如下: - -``` -# less lorem.txt | grep -i lorem -# sed -i.orig 's/Lorem/Tecmint/gI' lorem.txt -# less lorem.txt | grep -i lorem -# less lorem.txt.orig | grep -i lorem -``` - - 请注意`lorem.txt`文件中`Lorem` 都已经替换为 `Tecmint` , 并且原始的 `lorem.txt` 保存为`lorem.txt.orig`. - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Replace-A-String-in-File.png) ->替换文件文本 - -### /usr/share/doc内的文档 -这可能是我最喜欢的方法. 如果你进入 `/usr/share/doc` 目录, 你可以看到好多Linux已经安装的工具的名称的文件夹. - -根据[Filesystem Hierarchy Standard][5](文件目录标准),这些文件夹包含了许多帮助手册没有的信息, 还有一些模板和配置文件. - -例如, 让我们来看一下 `squid-3.3.8` (版本可能会不同) 一个非常受欢迎的HTTP代理[squid cache server][6]. - -让我们用`cd`命令进入目录 : - -``` -# cd /usr/share/doc/squid-3.3.8 -``` - -列出当前文件夹列表: - -``` -# ls -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/03/List-Files-in-Linux.png) ->ls linux列表命令 - -你应该特别注意 `QUICKSTART` 和 `squid.conf.documented`. 这两个文件包含了Squid许多信息, . 对于别的安装包来说, 他们的名字可能不同 (有可能是 **QuickRef** 或者**00QUICKSTART**), 但原理是一样的. - -对于另外一些安装包, 比如 the Apache web server, 在`/usr/share/doc`目录提供了配置模板, 当你配置独立服务器或者虚拟主机的时候会非常有用. - -### GNU 信息文档 - -你可以把它想象为帮助手册的超级链接形式. 正如上面说的, 他不仅仅提供工具的帮助信息, 而且还是超级链接的形式(是的!在命令行中的超级链接) 你可以通过箭头按钮和回车按钮来浏览你需要的内容. - -一个典型的例子是: - -``` -# info coreutils -``` - -通过coreutils 列出当前系统的 基本文件,shell脚本和文本处理工具[basic file, shell and text manipulation utilities][7] , 你可以得到他们的详细介绍. - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Info-Coreutils.png) ->Info Coreutils - -和帮助手册一样你可以按Q键退出. - -此外, GNU info 还可以像帮助手册一样使用. 例如: - -``` -# info tune2fs -``` - -它将显示 **tune2fs**的帮助手册, ext2/3/4 文件系统管理工具. - -让我们来看看怎么用**tune2fs**: - -显示 **/dev/mapper/vg00-vol_backups**文件系统信息: - -``` -# tune2fs -l /dev/mapper/vg00-vol_backups -``` - -修改文件系统标签 (修改为Backups): - -``` -# tune2fs -L Backups /dev/mapper/vg00-vol_backups -``` - -设置 `/` 自检的挂载次数 (用`-c` 选项设置 `/`的自检的挂载次数 或者用 `-i` 选项设置 自检时间 **d=days, w=weeks, and m=months**). - -``` -# tune2fs -c 150 /dev/mapper/vg00-vol_backups # Check every 150 mounts -# tune2fs -i 6w /dev/mapper/vg00-vol_backups # Check every 6 weeks -``` - -以上这些内容也可以通过 `--help` 选项找到, 或者查看帮助手册. - -### 摘要 - -不管你选择哪种方法,知道并且会使用它们在考试中对你是非常有用的. 你知道其它的一些方法吗? 欢迎给我们留言. - - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/linux-basic-shell-scripting-and-linux-filesystem-troubleshooting/ - -作者:[Gabriel Cánepa][a] -译者:[kokialoves](https://github.com/kokialoves) -校对:[校对者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/installing-network-services-and-configuring-services-at-system-boot/ -[3]: http://www.tecmint.com/sed-command-to-create-edit-and-manipulate-files-in-linux/ -[4]: http://www.tecmint.com/installing-network-services-and-configuring-services-at-system-boot/ -[5]: http://www.tecmint.com/linux-directory-structure-and-important-files-paths-explained/ -[6]: http://www.tecmint.com/configure-squid-server-in-linux/ -[7]: http://www.tecmint.com/sed-command-to-create-edit-and-manipulate-files-in-linux/ -[8]: From 4702262225de41e4eb8d7bbabce1711f968f976f Mon Sep 17 00:00:00 2001 From: kokialoves <498497353@qq.com> Date: Tue, 26 Jul 2016 09:47:57 +0800 Subject: [PATCH 1254/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= =?UTF-8?q?=20(#4222)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Delete 20160628 How To Setup Open Source Discussion Platform Discourse On Ubuntu Linux 16.04.md * Create 20160628 How To Setup Open Source Discussion Platform Discourse On Ubuntu Linux 16.04.md --- ...latform Discourse On Ubuntu Linux 16.04.md | 102 ------------------ ...latform Discourse On Ubuntu Linux 16.04.md | 101 +++++++++++++++++ 2 files changed, 101 insertions(+), 102 deletions(-) delete mode 100644 sources/tech/20160628 How To Setup Open Source Discussion Platform Discourse On Ubuntu Linux 16.04.md create mode 100644 translated/tech/20160628 How To Setup Open Source Discussion Platform Discourse On Ubuntu Linux 16.04.md diff --git a/sources/tech/20160628 How To Setup Open Source Discussion Platform Discourse On Ubuntu Linux 16.04.md b/sources/tech/20160628 How To Setup Open Source Discussion Platform Discourse On Ubuntu Linux 16.04.md deleted file mode 100644 index 738c3dbf55..0000000000 --- a/sources/tech/20160628 How To Setup Open Source Discussion Platform Discourse On Ubuntu Linux 16.04.md +++ /dev/null @@ -1,102 +0,0 @@ -[translating by kokialoves] -How To Setup Open Source Discussion Platform Discourse On Ubuntu Linux 16.04 -=============================================================================== - -Discourse is an open source discussion platform, that can work as a mailing list, a chat room and a forum as well. It is a popular tool and modern day implementation of a successful discussion platform. On server side, it is built using Ruby on Rails and uses Postgres on the backend, it also makes use of Redis caching to reduce the loading times, while on client’s side end, it runs in browser using Java Script. It is a pretty well optimized and well structured tool. It also offers converter plugins to migrate your existing discussion boards / forums like vBulletin, phpBB, Drupal, SMF etc to Discourse. In this article, we will be learning how to install Discourse on Ubuntu operating system. - -It is developed by keeping security in mind, so spammers and hackers might not be lucky with this application. It works well with all modern devices, and adjusts its display setting accordingly for mobile devices and tablets. - -### Installing Discourse on Ubuntu 16.04 - -Let’s get started ! the minimum system RAM to run Discourse is 1 GB and the officially supported installation process for Discourse requires dockers to be installed on our Linux system. Besides dockers, it also requires Git. We can fulfill these two requirements by simply running the following command on our system’s terminal. - -``` -wget -qO- https://get.docker.com/ | sh -``` - -![](http://linuxpitstop.com/wp-content/uploads/2016/06/124.png) - -It shouldn’t take longer to complete the installation for Docker and Git, as soon its installation process is complete, create a directory for Discourse inside /var partition of your system (You can choose any other partition here too). - -``` -mkdir /var/discourse -``` - -Now clone the Discourse’s Github repository to this newly created directory. - -``` -git clone https://github.com/discourse/discourse_docker.git /var/discourse -``` - -Go into the cloned directory. - -``` -cd /var/discourse -``` - -![](http://linuxpitstop.com/wp-content/uploads/2016/06/314.png) - -You should be able to locate “discourse-setup” script file here, simply run this script to initiate the installation wizard for Discourse. - -``` -./discourse-setup -``` - -**Side note: Please make sure you have a ready email server setup before attempting install for discourse.** - -Installation wizard will ask you following six questions. - -``` -Hostname for your Discourse? -Email address for admin account? -SMTP server address? -SMTP user name? -SMTP port [587]: -SMTP password? []: -``` - -![](http://linuxpitstop.com/wp-content/uploads/2016/06/411.png) - -Once you supply these information, it will ask for the confirmation, if everything is fine, hit “Enter” and installation process will take off. - -![](http://linuxpitstop.com/wp-content/uploads/2016/06/511.png) - -Sit back and relax! it will take sweet amount of time to complete the installation, grab a cup of coffee, and keep an eye for any error messages. - -![](http://linuxpitstop.com/wp-content/uploads/2016/06/610.png) - -Here is how the successful completion of the installation process should look alike. - -![](http://linuxpitstop.com/wp-content/uploads/2016/06/710.png) - -Now launch your web browser, if the hostname for discourse installation resolves properly to IP, then you can use your hostname in browser , otherwise use your IP address to launch the Discourse page. Here is what you should see: - -![](http://linuxpitstop.com/wp-content/uploads/2016/06/85.png) - -That’s it, create new account by using “Sign Up” option and you should be good to go with your Discourse setup. - -![](http://linuxpitstop.com/wp-content/uploads/2016/06/106.png) - -### Conclusion - -It is an easy to setup application and works flawlessly. It is equipped with all required features of modern day discussion board. It is available under General Public License and is 100% open source product. The simplicity, easy of use, powerful and long feature list are the most important feathers of this tool. Hope you enjoyed this article, Question? do let us know in comments please. - --------------------------------------------------------------------------------- - -via: http://linuxpitstop.com/install-discourse-on-ubuntu-linux-16-04/ - -作者:[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/ - - - - - - - - diff --git a/translated/tech/20160628 How To Setup Open Source Discussion Platform Discourse On Ubuntu Linux 16.04.md b/translated/tech/20160628 How To Setup Open Source Discussion Platform Discourse On Ubuntu Linux 16.04.md new file mode 100644 index 0000000000..742fd381dd --- /dev/null +++ b/translated/tech/20160628 How To Setup Open Source Discussion Platform Discourse On Ubuntu Linux 16.04.md @@ -0,0 +1,101 @@ +如何在 Ubuntu Linux 16.04上安装开源的Discourse论坛 +=============================================================================== + +Discourse 是一个开源的论坛, 它可以以邮件列表, 聊天室或者论坛等多种形式工作. 它是一个广受欢迎的现代的论坛工具. 在服务端,它使用Ruby on Rails 和 Postgres 搭建, 并且使用Redis caching 减少读取时间 , 在客户端, 它用浏览器的Java Script运行. 它是一个非常好的定制和构架工具. 并且它提供了转换插件对你现存的论坛进行转换例如: vBulletin, phpBB, Drupal, SMF 等等. 在这篇文章中, 我们将学习在Ubuntu操作系统下安装 Discourse. + +它是基于安全开发的, 黑客们不能轻易的发现漏洞. 它能很好的支持各个平台, 相应的调整手机和平板的显示设置. + +### Installing Discourse on Ubuntu 16.04 + +让我们开始吧 ! 最少需要1G的内存并且你要保证dockers已经安装了. 说到dockers, 它还需要安装Git. 要达到以上的两点要求我们只需要运行下面的命令. + +``` +wget -qO- https://get.docker.com/ | sh +``` + +![](http://linuxpitstop.com/wp-content/uploads/2016/06/124.png) + +用不了多久就安装好了Docker 和 Git, 安装结束以后, 创建一个 Discourse 文件夹在 /var 分区 (当然你也可以选择其他的分区). + +``` +mkdir /var/discourse +``` + +现在我们来克隆 Discourse’s Github 项目到这个新建的文件夹. + +``` +git clone https://github.com/discourse/discourse_docker.git /var/discourse +``` + +进入克隆文件夹. + +``` +cd /var/discourse +``` + +![](http://linuxpitstop.com/wp-content/uploads/2016/06/314.png) + +你将 看到“discourse-setup” 脚本文件, 运行这个脚本文件进行Discourse的初始化. + +``` +./discourse-setup +``` + +**Side note: 在安装discourse之前请确保你已经安装了邮件服务器.** + +安装向导将会问你以下六个问题. + +``` +Hostname for your Discourse? +Email address for admin account? +SMTP server address? +SMTP user name? +SMTP port [587]: +SMTP password? []: +``` + +![](http://linuxpitstop.com/wp-content/uploads/2016/06/411.png) + +当你提交了以上信息以后, 它会让你提交确认, 恩一切都很正常, 点击回车以后安装开始. + +![](http://linuxpitstop.com/wp-content/uploads/2016/06/511.png) + +现在坐下来,倒杯茶,看看有什么错误信息没有. + +![](http://linuxpitstop.com/wp-content/uploads/2016/06/610.png) + +安装成功以后看起来应该像这样. + +![](http://linuxpitstop.com/wp-content/uploads/2016/06/710.png) + +现在打开浏览器, 如果已经做了域名解析, 你可以使用你的域名来连接Discourse页面 , 否则你只能使用IP地址了. 你讲看到如下信息: + +![](http://linuxpitstop.com/wp-content/uploads/2016/06/85.png) + +就是这个, 用 “Sign Up” 选项创建一个新管理账户. + +![](http://linuxpitstop.com/wp-content/uploads/2016/06/106.png) + +### 结论 + +它是安装简便安全易用的. 它拥有当前所有论坛功能. 它支持所有的开源产品. 简单, 易用, 各类实用的功能. 希望你喜欢这篇文章你可以给我们留言. + +-------------------------------------------------------------------------------- + +via: http://linuxpitstop.com/install-discourse-on-ubuntu-linux-16-04/ + +作者:[Aun][a] +译者:[kokialoves](https://github.com/kokialoves) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://linuxpitstop.com/author/aun/ + + + + + + + + From 57c3eb5ad1532b0e8ff0ade934aaf318536e3cb2 Mon Sep 17 00:00:00 2001 From: Ezio Date: Tue, 26 Jul 2016 09:51:57 +0800 Subject: [PATCH 1255/1469] =?UTF-8?q?20160726-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...60722 7 Best Markdown Editors for Linux.md | 155 ++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 sources/tech/20160722 7 Best Markdown Editors for Linux.md diff --git a/sources/tech/20160722 7 Best Markdown Editors for Linux.md b/sources/tech/20160722 7 Best Markdown Editors for Linux.md new file mode 100644 index 0000000000..afe303021d --- /dev/null +++ b/sources/tech/20160722 7 Best Markdown Editors for Linux.md @@ -0,0 +1,155 @@ +7 Best Markdown Editors for Linux +====================================== + +In this article, we shall review some of the best Markdown editors you can install and use on your Linux desktop. There are numerous Markdown editors you can find for Linux but here, we want to unveil possibly the best you may choose to work with. + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Best-Linux-Markdown-Editors.png) +>Best Linux Markdown Editors + +For starters, Markdown is a simple and lightweight tool written in Perl, that enables users to write plain text format and covert it to valid HTML (or XHTML). It is literally an easy-to-read, easy-to-write plain text language and a software tool for text-to-HTML conversion. + +Hoping that you have a slight understanding of what Markdown is, let us proceed to list the editors. + +### 1. Atom + +Atom is a modern, cross-platform, open-source and very powerful text editor that can work on Linux, Windows and Mac OS X operating systems. Users can customize it down to its base, minus altering any configuration files. + +It is designed with some illustrious features and these include: + +- Comes with a built-in package manager +- Smart auto-completion functionality +- Offers multiple panes +- Supports find and replace functionality +- Includes a file system browser +- Easily customizable themes +- Highly extensible using open-source packages and many more + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Atom-Markdown-Editor-for-Linux.png) + +Visit Homepage: + +### 2. GNU Emacs + +Emacs is one of the popular open-source text editors you can find on the Linux platform today. It is a great editor for Markdown language, which is highly extensible and customizable. + +It’s comprehensively developed with the following amazing features: + +- Comes with an extensive built-in documentation including tutorials for beginners +- Full Unicode support for probably all human scripts +- Supports content-aware text-editing modes +- Includes syntax coloring for multiple file types +- Its highly customizable using Emacs Lisp code or GUI +- Offers a packaging system for downloading and installing various extensions plus so much more + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Emacs-Markdown-Editor-for-Linux.png) +>Emacs Markdown Editor for Linux + +Visit Homepage: + +### 3. Remarkable + +Remarkable is possibly the best Markdown editor you can find on Linux, it also works on Windows operating system. It is indeed a remarkable and fully featured Markdown editor that offers users some exciting features. + +Some of its remarkable features include: + +- Supports live preview +- Supports exporting to PDF and HTML +- Also offers Github Markdown +- Supports custom CSS +- It also supports syntax highlighting +- Offers keyboard shortcuts +- Highly customizable plus and many more + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Remarkable-Markdown-Editor-for-Linux.png) +>Remarkable Markdown Editor for Linux + +Visit Homepage: + +### 4. Haroopad + +Haroopad is an extensively built, cross-platform Markdown document processor for Linux, Windows and Mac OS X. It enables users to write expert-level documents of numerous formats including email, reports, blogs, presentations, blog posts and many more. + +It is fully featured with the following notable features: + +- Easily imports content +- Also exports to numerous formats +- Broadly supports blogging and mailing +- Supports several mathematical expressions +- Supports Github flavored Markdown and extensions +- Offers users some exciting themes, skins and UI components plus so much more + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Haroopad-Markdown-Editor-for-Linux.png) +>Haroopad Markdown Editor for Linux + +Visit Homepage: + +### 5. ReText + +ReText is a simple, lightweight and powerful Markdown editor for Linux and several other POSIX-compatible operating systems. It also doubles as a reStructuredText editor, and has the following attributes: + +- Simple and intuitive GUI +- It is highly customizable, users can customize file syntax and configuration options +- Also supports several color schemes +- Supports use of multiple mathematical formulas +- Enables export extensions and many more + +![](http://www.tecmint.com/wp-content/uploads/2016/07/ReText-Markdown-Editor-for-Linux.png) +>ReText Markdown Editor for Linux + +Visit Homepage: + +### 6. UberWriter + +UberWriter is a simple and easy-to-use Markdown editor for Linux, it’s development was highly influenced by iA writer for Mac OS X. It is also feature rich with these remarkable features: + +- Uses pandoc to perform all text-to-HTML conversions +- Offers a clean UI +- Offers a distraction free mode, highlighting a users last sentence +- Supports spellcheck +- Also supports full screen mode +- Supports exporting to PDF, HTML and RTF using pandoc +- Enables syntax highlighting and mathematical functions plus many more + +![](http://www.tecmint.com/wp-content/uploads/2016/07/UberWriter-Markdown-Editor-for-Linux.png) +>UberWriter Markdown Editor for Linux + +Visit Homepage: + +### 7. Mark My Words + +Mark My Words is a also lightweight yet powerful Markdown editor. It’s a relatively new editor, therefore offers a handful of features including syntax highlighting, simple and intuitive GUI. + +The following are some of the awesome features yet to be bundled into the application: + +- Live preview support +- Markdown parsing and file IO +- State management +- Support for exporting to PDF and HTML +- Monitoring files for changes +- Support for preferences + +![](http://www.tecmint.com/wp-content/uploads/2016/07/MarkMyWords-Markdown-Editor-for-Linux.png) +>MarkMyWords Markdown Editor for-Linux + +Visit Homepage: + +### Conclusion + +Having walked through the list above, you probably know what Markdown editors and document processors to download and install on your Linux desktop for now. + +Note that what we consider to be the best here may reasonably not be the best for you, therefore, you can reveal to us exciting Markdown editors that you think are missing in the list and have earned the right to be mentioned here by sharing your thoughts via the feedback section below. + + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/best-markdown-editors-for-linux/ + +作者:[Aaron Kili |][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/aaronkili/ + + From 1d3df1c128a5b8ee6957c16a32f7f1a34ab4739f Mon Sep 17 00:00:00 2001 From: Ezio Date: Tue, 26 Jul 2016 10:26:40 +0800 Subject: [PATCH 1256/1469] =?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 --- .../20160628 Python 101 An Intro to urllib.md | 200 ------------------ .../20160628 Python 101 An Intro to urllib.md | 193 +++++++++++++++++ 2 files changed, 193 insertions(+), 200 deletions(-) delete mode 100644 sources/tech/20160628 Python 101 An Intro to urllib.md create mode 100644 translated/tech/20160628 Python 101 An Intro to urllib.md diff --git a/sources/tech/20160628 Python 101 An Intro to urllib.md b/sources/tech/20160628 Python 101 An Intro to urllib.md deleted file mode 100644 index 3fb88971db..0000000000 --- a/sources/tech/20160628 Python 101 An Intro to urllib.md +++ /dev/null @@ -1,200 +0,0 @@ -ezio is translating - -Python 101: An Intro to urllib -================================= - -The urllib module in Python 3 is a collection of modules that you can use for working with URLs. If you are coming from a Python 2 background you will note that in Python 2 you had urllib and urllib2. These are now a part of the urllib package in Python 3. The current version of urllib is made up of the following modules: - -- urllib.request -- urllib.error -- urllib.parse -- urllib.rebotparser - -We will be covering each part individually except for urllib.error. The official documentation actually recommends that you might want to check out the 3rd party library, requests, for a higher-level HTTP client interface. However, I believe that it can be useful to know how to open URLs and interact with them without using a 3rd party and it may also help you appreciate why the requests package is so popular. - ---- - -### urllib.request - -The urllib.request module is primarily used for opening and fetching URLs. Let’s take a look at some of the things you can do with the urlopen function: - -``` ->>> import urllib.request ->>> url = urllib.request.urlopen('https://www.google.com/') ->>> url.geturl() -'https://www.google.com/' ->>> url.info() - ->>> header = url.info() ->>> header.as_string() -('Date: Fri, 24 Jun 2016 18:21:19 GMT\n' - 'Expires: -1\n' - 'Cache-Control: private, max-age=0\n' - 'Content-Type: text/html; charset=ISO-8859-1\n' - 'P3P: CP="This is not a P3P policy! See ' - 'https://www.google.com/support/accounts/answer/151657?hl=en for more info."\n' - 'Server: gws\n' - 'X-XSS-Protection: 1; mode=block\n' - 'X-Frame-Options: SAMEORIGIN\n' - 'Set-Cookie: ' - 'NID=80=tYjmy0JY6flsSVj7DPSSZNOuqdvqKfKHDcHsPIGu3xFv41LvH_Jg6LrUsDgkPrtM2hmZ3j9V76pS4K_cBg7pdwueMQfr0DFzw33SwpGex5qzLkXUvUVPfe9g699Qz4cx9ipcbU3HKwrRYA; ' - 'expires=Sat, 24-Dec-2016 18:21:19 GMT; path=/; domain=.google.com; HttpOnly\n' - 'Alternate-Protocol: 443:quic\n' - 'Alt-Svc: quic=":443"; ma=2592000; v="34,33,32,31,30,29,28,27,26,25"\n' - 'Accept-Ranges: none\n' - 'Vary: Accept-Encoding\n' - 'Connection: close\n' - '\n') ->>> url.getcode() -200 -``` - -Here we import our module and ask it to open Google’s URL. Now we have an HTTPResponse object that we can interact with. The first thing we do is call the geturl method which will return the URL of the resource that was retrieved. This is useful for finding out if we followed a redirect. - -Next we call info, which will return meta-data about the page, such as headers. Because of this, we assign that result to our headers variable and then call its as_string method. This prints out the header we received from Google. You can also get the HTTP response code by calling getcode, which in this case was 200, which means it worked successfully. - -If you’d like to see the HTML of the page, you can call the read method on the url variable we created. I am not reproducing that here as the output will be quite long. - -Please note that the request object defaults to a GET request unless you specify the data parameter. Should you pass in the data parameter, then the request object will issue a POST request instead. - ---- - -### Downloading a file - -A typical use case for the urllib package is for downloading a file. Let’s find out a couple of ways we can accomplish this task: - -``` ->>> import urllib.request ->>> url = 'http://www.blog.pythonlibrary.org/wp-content/uploads/2012/06/wxDbViewer.zip' ->>> response = urllib.request.urlopen(url) ->>> data = response.read() ->>> with open('/home/mike/Desktop/test.zip', 'wb') as fobj: -... fobj.write(data) -... -``` - -Here we just open a URL that leads us to a zip file stored on my blog. Then we read the data and write it out to disk. An alternate way to accomplish this is to use urlretrieve: - -``` ->>> import urllib.request ->>> url = 'http://www.blog.pythonlibrary.org/wp-content/uploads/2012/06/wxDbViewer.zip' ->>> tmp_file, header = urllib.request.urlretrieve(url) ->>> with open('/home/mike/Desktop/test.zip', 'wb') as fobj: -... with open(tmp_file, 'rb') as tmp: -... fobj.write(tmp.read()) -``` - -The urlretrieve method will copy a network object to a local file. The file it copies to is randomly named and goes into the temp directory unless you use the second parameter to urlretrieve where you can actually specify where you want the file saved. This will save you a step and make your code much simpler: - -``` ->>> import urllib.request ->>> url = 'http://www.blog.pythonlibrary.org/wp-content/uploads/2012/06/wxDbViewer.zip' ->>> urllib.request.urlretrieve(url, '/home/mike/Desktop/blog.zip') -('/home/mike/Desktop/blog.zip', - ) -``` - -As you can see, it returns the location of where it saved the file and the header information from the request. - -### Specifying Your User Agent - -When you visit a website with your browser, the browser tells the website who it is. This is called the user-agent string. Python’s urllib identifies itself as Python-urllib/x.y where the x and y are major and minor version numbers of Python. Some websites won’t recognize this user-agent string and will behave in strange ways or not work at all. Fortunately, it’s easy for you to set up your own custom user-agent string: - -``` ->>> import urllib.request ->>> user_agent = ' Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0' ->>> url = 'http://www.whatsmyua.com/' ->>> headers = {'User-Agent': user_agent} ->>> request = urllib.request.Request(url, headers=headers) ->>> with urllib.request.urlopen(request) as response: -... with open('/home/mdriscoll/Desktop/user_agent.html', 'wb') as out: -... out.write(response.read()) -``` - -Here we set up our user agent to Mozilla FireFox and we set out URL to which will tell us what it thinks our user-agent string is. Then we create a Request instance using our url and headers and pass that to urlopen. Finally we save the result. If you open the result file, you will see that we successfully changed our user-agent string. Feel free to try out a few different strings with this code to see how it will change. - ---- - -### urllib.parse - -The urllib.parse library is your standard interface for breaking up URL strings and combining them back together. You can use it to convert a relative URL to an absolute URL, for example. Let’s try using it to parse a URL that includes a query: - -``` ->>> from urllib.parse import urlparse ->>> result = urlparse('https://duckduckgo.com/?q=python+stubbing&t=canonical&ia=qa') ->>> result -ParseResult(scheme='https', netloc='duckduckgo.com', path='/', params='', query='q=python+stubbing&t=canonical&ia=qa', fragment='') ->>> result.netloc -'duckduckgo.com' ->>> result.geturl() -'https://duckduckgo.com/?q=python+stubbing&t=canonical&ia=qa' ->>> result.port -None -``` - -Here we import the urlparse function and pass it an URL that contains a search query to the duckduckgo website. My query was to look up articles on “python stubbing”. As you can see, it returned a ParseResult object that you can use to learn more about the URL. For example, you can get the port information (None in this case), the network location, path and much more. - -### Submitting a Web Form - -This module also holds the urlencode method, which is great for passing data to a URL. A typical use case for the urllib.parse library is submitting a web form. Let’s find out how you might do that by having the duckduckgo search engine look for Python: - -``` ->>> import urllib.request ->>> import urllib.parse ->>> data = urllib.parse.urlencode({'q': 'Python'}) ->>> data -'q=Python' ->>> url = 'http://duckduckgo.com/html/' ->>> full_url = url + '?' + data ->>> response = urllib.request.urlopen(full_url) ->>> with open('/home/mike/Desktop/results.html', 'wb') as f: -... f.write(response.read()) -``` - -This is pretty straightforward. Basically we want to submit a query to duckduckgo ourselves using Python instead of a browser. To do that, we need to construct our query string using urlencode. Then we put that together to create a fully qualified URL and use urllib.request to submit the form. We then grab the result and save it to disk. - ---- - -### urllib.robotparser - -The robotparser module is made up of a single class, RobotFileParser. This class will answer questions about whether or not a specific user agent can fetch a URL that has a published robot.txt file. The robots.txt file will tell a web scraper or robot what parts of the server should not be accessed. Let’s take a look at a simple example using ArsTechnica’s website: - -``` ->>> import urllib.robotparser ->>> robot = urllib.robotparser.RobotFileParser() ->>> robot.set_url('http://arstechnica.com/robots.txt') -None ->>> robot.read() -None ->>> robot.can_fetch('*', 'http://arstechnica.com/') -True ->>> robot.can_fetch('*', 'http://arstechnica.com/cgi-bin/') -False -``` - -Here we import the robot parser class and create an instance of it. Then we pass it a URL that specifies where the website’s robots.txt file resides. Next we tell our parser to read the file. Now that that’s done, we give it a couple of different URLs to find out which ones we can crawl and which ones we can’t. We quickly see that we can access the main site, but not the cgi-bin. - ---- - -### Wrapping Up - -You have reached the point that you should be able to use Python’s urllib package competently. We learned how to download a file, submit a web form, change our user agent and access a robots.txt file in this chapter. The urllib has a lot of additional functionality that is not covered here, such as website authentication. However, you might want to consider switching to the requests library before trying to do authentication with urllib as the requests implementation is a lot easier to understand and debug. I also want to note that Python has support for Cookies via its http.cookies module although that is also wrapped quite well in the requests package. You should probably consider trying both to see which one makes the most sense to you. - --------------------------------------------------------------------------------- - -via: http://www.blog.pythonlibrary.org/2016/06/28/python-101-an-intro-to-urllib/ - -作者:[Mike][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://www.blog.pythonlibrary.org/author/mld/ - - - - - - - diff --git a/translated/tech/20160628 Python 101 An Intro to urllib.md b/translated/tech/20160628 Python 101 An Intro to urllib.md new file mode 100644 index 0000000000..641ac2baf1 --- /dev/null +++ b/translated/tech/20160628 Python 101 An Intro to urllib.md @@ -0,0 +1,193 @@ +Python 101: urllib 简介 +================================= + +Python 3 的 urllib 模块是一堆可以处理 URL 的组件集合。如果你有 Python 2 背景,那么你就会注意到 Python 2 中有 urllib 和 urllib2 两个版本的模块。这些现在都是 Python 3 的 urllib 包的一部分。当前版本的 urllib 包括下面几部分: + +- urllib.request +- urllib.error +- urllib.parse +- urllib.rebotparser + +接下来我们会分开讨论除了 urllib.error 以外的几部分。官方文档实际推荐你尝试第三方库, requests,一个高级的 HTTP 客户端接口。然而我依然认为知道如何不依赖第三方库打开 URL 并与之进行交互是很有用的,而且这也可以帮助你理解为什么 requests 包是如此的流行。 + +--- + +### urllib.request + +urllib.request 模块期初是用来打开和获取 URL 的。让我们看看你可以用函数 urlopen可以做的事: + + +``` +>>> import urllib.request +>>> url = urllib.request.urlopen('https://www.google.com/') +>>> url.geturl() +'https://www.google.com/' +>>> url.info() + +>>> header = url.info() +>>> header.as_string() +('Date: Fri, 24 Jun 2016 18:21:19 GMT\n' + 'Expires: -1\n' + 'Cache-Control: private, max-age=0\n' + 'Content-Type: text/html; charset=ISO-8859-1\n' + 'P3P: CP="This is not a P3P policy! See ' + 'https://www.google.com/support/accounts/answer/151657?hl=en for more info."\n' + 'Server: gws\n' + 'X-XSS-Protection: 1; mode=block\n' + 'X-Frame-Options: SAMEORIGIN\n' + 'Set-Cookie: ' + 'NID=80=tYjmy0JY6flsSVj7DPSSZNOuqdvqKfKHDcHsPIGu3xFv41LvH_Jg6LrUsDgkPrtM2hmZ3j9V76pS4K_cBg7pdwueMQfr0DFzw33SwpGex5qzLkXUvUVPfe9g699Qz4cx9ipcbU3HKwrRYA; ' + 'expires=Sat, 24-Dec-2016 18:21:19 GMT; path=/; domain=.google.com; HttpOnly\n' + 'Alternate-Protocol: 443:quic\n' + 'Alt-Svc: quic=":443"; ma=2592000; v="34,33,32,31,30,29,28,27,26,25"\n' + 'Accept-Ranges: none\n' + 'Vary: Accept-Encoding\n' + 'Connection: close\n' + '\n') +>>> url.getcode() +200 +``` + +在这里我们包含了需要的模块,然后告诉它打开 Google 的 URL。现在我们就有了一个可以交互的 HTTPResponse 对象。我们要做的第一件事是调用方法 geturl ,它会返回根据 URL 获取的资源。这可以让我们发现 URL 是否进行了重定向。 + +接下来调用 info ,它会返回网页的元数据,比如头信息。因此,我们可以将结果赋给我们的 headers 变量,然后调用它的方法 as_string 。就可以打印出我们从 Google 收到的头信息。你也可以通过 getcode 得到网页的 HTTP 响应码,当前情况下就是 200,意思是正常工作。 + +如果你想看看网页的 HTML 代码,你可以调用变量 url 的方法 read。我不准备再现这个过程,因为输出结果太长了。 + +请注意 request 对象默认是 GET 请求,除非你指定它的 data 参数。你应该给它传递 data 参数,这样 request 对象才会变成 POST 请求。 + +--- + +### 下载文件 + +urllib 一个典型的应用场景是下载文件。让我们看看几种可以完成这个任务的方法: + +``` +>>> import urllib.request +>>> url = 'http://www.blog.pythonlibrary.org/wp-content/uploads/2012/06/wxDbViewer.zip' +>>> response = urllib.request.urlopen(url) +>>> data = response.read() +>>> with open('/home/mike/Desktop/test.zip', 'wb') as fobj: +... fobj.write(data) +... +``` + +这个例子中我们打开一个保存在我的博客上的 zip 压缩文件的 URL。然后我们读出数据并将数据写到磁盘。一个替代方法是使用 urlretrieve : + +``` +>>> import urllib.request +>>> url = 'http://www.blog.pythonlibrary.org/wp-content/uploads/2012/06/wxDbViewer.zip' +>>> tmp_file, header = urllib.request.urlretrieve(url) +>>> with open('/home/mike/Desktop/test.zip', 'wb') as fobj: +... with open(tmp_file, 'rb') as tmp: +... fobj.write(tmp.read()) +``` + +方法 urlretrieve 会把网络对象拷贝到本地文件。除非你在使用 urlretrieve 的第二个参数指定你要保存文件的路径,否则这个文件在本地是随机命名的并且是保存在临时文件夹。这个可以为你节省一步操作,并且使代码开起来更简单: + +``` +>>> import urllib.request +>>> url = 'http://www.blog.pythonlibrary.org/wp-content/uploads/2012/06/wxDbViewer.zip' +>>> urllib.request.urlretrieve(url, '/home/mike/Desktop/blog.zip') +('/home/mike/Desktop/blog.zip', + ) +``` + +如你所见,它返回了文件保存的路径,以及从请求得来的头信息。 + +### 设置你的用户代理 + +当你使用浏览器访问网页时,浏览器会告诉网站它是谁。这就是所谓的 user-agent 字段。Python 的 urllib 会表示他自己为 Python-urllib/x.y , 其中 x 和 y 是你使用的 Python 的主、次版本号。有一些网站不认识这个用户代理字段,然后网站的可能会有奇怪的表现或者根本不能正常工作。辛运的是你可以很轻松的设置你自己的 user-agent 字段。 + +``` +>>> import urllib.request +>>> user_agent = ' Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0' +>>> url = 'http://www.whatsmyua.com/' +>>> headers = {'User-Agent': user_agent} +>>> request = urllib.request.Request(url, headers=headers) +>>> with urllib.request.urlopen(request) as response: +... with open('/home/mdriscoll/Desktop/user_agent.html', 'wb') as out: +... out.write(response.read()) +``` + +这里设置我们的用户代理为 Mozilla FireFox ,然后我们访问 , 它会告诉我们它识别出的我们的 user-agent 字段。之后我们将 url 和我们的头信息传给 urlopen 创建一个 Request 实例。最后我们保存这个结果。如果你打开这个结果,你会看到我们成功的修改了自己的 user-agent 字段。使用这段代码尽情的尝试不同的值来看看它是如何改变的。 + +--- + +### urllib.parse + +urllib.parse 库是用来拆分和组合 URL 字符串的标准接口。比如,你可以使用它来转换一个相对的 URL 为绝对的 URL。让我们试试用它来转换一个包含查询的 URL : + + +``` +>>> from urllib.parse import urlparse +>>> result = urlparse('https://duckduckgo.com/?q=python+stubbing&t=canonical&ia=qa') +>>> result +ParseResult(scheme='https', netloc='duckduckgo.com', path='/', params='', query='q=python+stubbing&t=canonical&ia=qa', fragment='') +>>> result.netloc +'duckduckgo.com' +>>> result.geturl() +'https://duckduckgo.com/?q=python+stubbing&t=canonical&ia=qa' +>>> result.port +None +``` + +这里我们导入了函数 urlparse , 并且把一个包含搜索查询 duckduckgo 的 URL 作为参数传给它。我的查询的关于 “python stubbing” 的文章。如你所见,它返回了一个 ParseResult 对象,你可以用这个对象了解更多关于 URL 的信息。举个例子,你可以获取到短信息(此处的没有端口信息),网络位置,路径和很多其他东西。 + +### 提交一个 Web 表单 + +这个模块还有一个方法 urlencode 可以向 URL 传输数据。 urllib.parse 的一个典型使用场景是提交 Web 表单。让我们通过搜索引擎 duckduckgo 搜索 Python 来看看这个功能是怎么工作的。 + +``` +>>> import urllib.request +>>> import urllib.parse +>>> data = urllib.parse.urlencode({'q': 'Python'}) +>>> data +'q=Python' +>>> url = 'http://duckduckgo.com/html/' +>>> full_url = url + '?' + data +>>> response = urllib.request.urlopen(full_url) +>>> with open('/home/mike/Desktop/results.html', 'wb') as f: +... f.write(response.read()) +``` + +这个例子很直接。基本上我们想使用 Python 而不是浏览器向 duckduckgo 提交一个查询。要完成这个我们需要使用 urlencode 构建我们的查询字符串。然后我们把这个字符串和网址拼接成一个完整的正确 URL ,然后使用 urllib.request 提交这个表单。最后我们就获取到了结果然后保存到磁盘上。 + +--- + +### urllib.robotparser + +robotparser 模块是由一个单独的类 —— RobotFileParser —— 构成的。这个类会回答诸如一个特定的用户代理可以获取已经设置 robot.txt 的网站。 robot.txt 文件会告诉网络爬虫或者机器人当前网站的那些部分是不允许被访问的。让我们看一个简单的例子: + +``` +>>> import urllib.robotparser +>>> robot = urllib.robotparser.RobotFileParser() +>>> robot.set_url('http://arstechnica.com/robots.txt') +None +>>> robot.read() +None +>>> robot.can_fetch('*', 'http://arstechnica.com/') +True +>>> robot.can_fetch('*', 'http://arstechnica.com/cgi-bin/') +False +``` + +这里我们导入了 robot 分析器类,然后创建一个实例。然后我们给它传递一个表明网站 robots.txt 位置的 URL 。接下来我们告诉分析器来读取这个文件。现在就完成了,我们给它了一组不同的 URL 让它找出那些我们可以爬取而那些不能爬取。我们很快就看到我们可以访问主站但是不包括 cgi-bin 路径。 + +--- + +### 总结一下 + +现在你就有能力使用 Python 的 urllib 包了。在这一节里,我们学习了如何下载文件,提交 Web 表单,修改自己的用户代理以及访问 robots.txt。 urllib 还有一大堆附加功能没有在这里提及,比如网站授权。然后你可能会考虑在使用 urllib 进行认证之前切换到 requests 库,因为 requests 已经以更易用和易调试的方式实现了这些功能。我同时也希望提醒你 Python 已经通过 http.cookies 模块支持 Cookies 了,虽然在 request 包里也很好的封装了这个功能。你应该可能考虑同时试试两个来决定那个最适合你。 + +-------------------------------------------------------------------------------- + +via: http://www.blog.pythonlibrary.org/2016/06/28/python-101-an-intro-to-urllib/ + +作者:[Mike][a] +译者:[Ezio](https://github.com/oska874) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.blog.pythonlibrary.org/author/mld/ From 91e04d1ca4ec0b72dc404850c2f08f921615d20c Mon Sep 17 00:00:00 2001 From: Mike Date: Tue, 26 Jul 2016 16:32:01 +0800 Subject: [PATCH 1257/1469] translated/tech/20160706 Doing for User Space What We Did for Kernel Space.md (#4223) --- ...User Space What We Did for Kernel Space.md | 96 ------------------- ...User Space What We Did for Kernel Space.md | 95 ++++++++++++++++++ 2 files changed, 95 insertions(+), 96 deletions(-) delete mode 100644 sources/tech/20160706 Doing for User Space What We Did for Kernel Space.md create mode 100644 translated/tech/20160706 Doing for User Space What We Did for Kernel Space.md diff --git a/sources/tech/20160706 Doing for User Space What We Did for Kernel Space.md b/sources/tech/20160706 Doing for User Space What We Did for Kernel Space.md deleted file mode 100644 index 743114c481..0000000000 --- a/sources/tech/20160706 Doing for User Space What We Did for Kernel Space.md +++ /dev/null @@ -1,96 +0,0 @@ -MikeCoder Translating... - -Doing for User Space What We Did for Kernel Space -======================================================= - -I believe the best and worst thing about Linux is its hard distinction between kernel space and user space. - -Without that distinction, Linux never would have become the most leveraged operating system in the world. Today, Linux has the largest range of uses for the largest number of users—most of whom have no idea they are using Linux when they search for something on Google or poke at their Android phones. Even Apple stuff wouldn't be what it is (for example, using BSD in its computers) were it not for Linux's success. - -Not caring about user space is a feature of Linux kernel development, not a bug. As Linus put it on our 2003 Geek Cruise, "I only do kernel stuff...I don't know what happens outside the kernel, and I don't much care. What happens inside the kernel I care about." After Andrew Morton gave me additional schooling on the topic a couple years later on another Geek Cruise, I wrote: - ->Kernel space is where the Linux species lives. User space is where Linux gets put to use, along with a lot of other natural building materials. The division between kernel space and user space is similar to the division between natural materials and stuff humans make out of those materials. - -A natural outcome of this distinction, however, is for Linux folks to stay relatively small as a community while the world outside depends more on Linux every second. So, in hope that we can enlarge our number a bit, I want to point us toward two new things. One is already hot, and the other could be. - -The first is [blockchain][1], made famous as the distributed ledger used by Bitcoin, but useful for countless other purposes as well. At the time of this writing, interest in blockchain is [trending toward the vertical][2]. - -![](http://www.linuxjournal.com/files/linuxjournal.com/ufiles/imagecache/large-550px-centered/u1000009/12042f1.png) ->Figure 1. Google Trends for Blockchain - -The second is self-sovereign identity. To explain that, let me ask who and what you are. - -If your answers come from your employer, your doctor, the Department of Motor Vehicles, Facebook, Twitter or Google, they are each administrative identifiers: entries in namespaces each of those organizations control, entirely for their own convenience. As Timothy Ruff of [Evernym][3] explains, "You don't exist for them. Only your identifier does." It's the dependent variable. The independent variable—the one controlling the identifier—is the organization. - -If your answer comes from your self, we have a wide-open area for a new development category—one where, finally, we can be set fully free in the connected world. - -The first person to explain this, as far as I know, was [Devon Loffreto][4] He wrote "What is 'Sovereign Source Authority'?" in February 2012, on his blog, [The Moxy Tongue][5]. In "[Self-Sovereign Identity][6]", published in February 2016, he writes: - ->Self-Sovereign Identity must emit directly from an individual human life, and not from within an administrative mechanism...self-Sovereign Identity references every individual human identity as the origin of source authority. A self-Sovereign identity produces an administrative trail of data relations that begin and resolve to individual humans. Every individual human may possess a self-Sovereign identity, and no person or abstraction of any type created may alter this innate human Right. A self-Sovereign identity is the root of all participation as a valued social being within human societies of any type. - -To put this in Linux terms, only the individual has root for his or her own source identity. In the physical world, this is a casual thing. For example, my own portfolio of identifiers includes: - -- David Allen Searls, which my parents named me. -- David Searls, the name I tend to use when I suspect official records are involved. -- Dave, which is what most of my relatives and old friends call me. -- Doc, which is what most people call me. - -As the sovereign source authority over the use of those, I can jump from one to another in different contexts and get along pretty well. But, that's in the physical world. In the virtual one, it gets much more complicated. In addition to all the above, I am @dsearls (my Twitter handle) and dsearls (my handle in many other net-based services). I am also burdened by having my ability to relate contained within hundreds of different silos, each with their own logins and passwords. - -You can get a sense of how bad this is by checking the list of logins and passwords on your browser. On Firefox alone, I have hundreds of them. Many are defunct (since my collection dates back to Netscape days), but I would guess that I still have working logins to hundreds of companies I need to deal with from time to time. For all of them, I'm the dependent variable. It's not the other way around. Even the term "user" testifies to the subordinate dependency that has become a primary fact of life in the connected world. - -Today, the only easy way to bridge namespaces is via the compromised convenience of "Log in with Facebook" or "Log in with Twitter". In both of those cases, each of us is even less ourselves or in any kind of personal control over how we are known (if we wish to be knowable at all) to other entities in the connected world. - -What we have needed from the start are personal systems for instantiating our sovereign selves and choosing how to reveal and protect ourselves when dealing with others in the connected world. For lack of that ability, we are deep in a metastasized mess that Shoshana Zuboff calls "surveillance capitalism", which she says is: - ->...unimaginable outside the inscrutable high velocity circuits of Google's digital universe, whose signature feature is the Internet and its successors. While the world is riveted by the showdown between Apple and the FBI, the real truth is that the surveillance capabilities being developed by surveillance capitalists are the envy of every state security agency. - -Then she asks, "How can we protect ourselves from its invasive power?" - -I suggest self-sovereign identity. I believe it is only there that we have both safety from unwelcome surveillance and an Archimedean place to stand in the world. From that place, we can assert full agency in our dealings with others in society, politics and business. - -I came to this provisional conclusion during [ID2020][7], a gathering at the UN on May. It was gratifying to see Devon Loffreto there, since he's the guy who got the sovereign ball rolling in 2013. Here's [what I wrote about][8] it at the time, with pointers to Devon's earlier posts (such as one sourced above). - -Here are three for the field's canon: - -- "[Self-Sovereign Identity][9]" by Devon Loffreto. -- "[System or Human First][10]" by Devon Loffreto. -- "[The Path to Self-Sovereign Identity][11]" by Christopher Allen. - -A one-pager from Evernym, [digi.me][12], [iRespond][13] and [Respect Network][14] also was circulated there, contrasting administrative identity (which it calls the "current model") with the self-sovereign one. In it is the graphic shown in Figure 2. - -![](http://www.linuxjournal.com/files/linuxjournal.com/ufiles/imagecache/large-550px-centered/u1000009/12042f2.jpg) ->Figure 2. Current Model of Identity vs. Self-Sovereign Identity - -The [platform][15] for this is Sovrin, explained as a "Fully open-source, attribute-based, sovereign identity graph platform on an advanced, dedicated, permissioned, distributed ledger" There's a [white paper][16] too. The code is called [plenum][17], and it's at GitHub. - -Here—and places like it—we can do for user space what we've done for the last quarter century for kernel space. - --------------------------------------------------------------------------------- - -via: https://www.linuxjournal.com/content/doing-user-space-what-we-did-kernel-space - -作者:[Doc Searls][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.linuxjournal.com/users/doc-searls -[1]: https://en.wikipedia.org/wiki/Block_chain_%28database%29 -[2]: https://www.google.com/trends/explore#q=blockchain -[3]: http://evernym.com/ -[4]: https://twitter.com/nzn -[5]: http://www.moxytongue.com/2012/02/what-is-sovereign-source-authority.html -[6]: http://www.moxytongue.com/2016/02/self-sovereign-identity.html -[7]: http://www.id2020.org/ -[8]: http://blogs.harvard.edu/doc/2013/10/14/iiw-challenge-1-sovereign-identity-in-the-great-silo-forest -[9]: http://www.moxytongue.com/2016/02/self-sovereign-identity.html -[10]: http://www.moxytongue.com/2016/05/system-or-human.html -[11]: http://www.lifewithalacrity.com/2016/04/the-path-to-self-soverereign-identity.html -[12]: https://get.digi.me/ -[13]: http://irespond.com/ -[14]: https://www.respectnetwork.com/ -[15]: http://evernym.com/technology -[16]: http://evernym.com/assets/doc/Identity-System-Essentials.pdf?v=167284fd65 -[17]: https://github.com/evernym/plenum diff --git a/translated/tech/20160706 Doing for User Space What We Did for Kernel Space.md b/translated/tech/20160706 Doing for User Space What We Did for Kernel Space.md new file mode 100644 index 0000000000..0b31016003 --- /dev/null +++ b/translated/tech/20160706 Doing for User Space What We Did for Kernel Space.md @@ -0,0 +1,95 @@ +在用户空间做我们会在内核空间做的事情 +======================================================= + +我相信,Linux 最好也是最坏的事情,就是内核空间和用户空间之间的巨大差别。 + +但是如果抛开这个区别,Linux 可能也不会成为世界上影响力最大的操作系统。如今,Linux 已经拥有世界上最大数量的用户,和最大范围的应用。尽管大多数用户并不知道,当他们进行谷歌搜索,或者触摸安卓手机的时候,他们其实正在使用 Linux。如果不是 Linux 的巨大成功,Apple 公司也可能并不会成为现在这样(苹果在他们的电脑产品中使用 BSD 发行版)。 + +不用担心,用户空间是 Linux 内核开发中的一个特性,并不是一个缺陷。正如 Linus 在 2003 的极客巡航中提到的那样,“”我只做内核相关技术……我并不知道内核之外发生的事情,而且我并不关心。我只关注内核部分发生的事情。” 在 Andrew Morton 在多年之后的另一个极客巡航上给我上了另外的一课,我写到: + +> 内核空间是 Linux 核心存在的地方。用户空间是使用 Linux 时使用的空间,和其他的自然的建筑材料一样。内核空间和用户空间的区别,和自然材料和人类从中生产的人造材料的区别很类似。 + +这个区别的自然而然的结果,就是尽管外面的世界一刻也离不开 Linux, 但是 Linux 社区还是保持相对较小。所以,为了增加我们社区团体的数量,我希望指出两件事情。第一件已经非常火热,另外一件可能热门。 + +第一件事情就是 [blockchain][1],出自著名的分布式货币,比特币之手。当你正在阅读这篇文章的同时,对 blockchain 的[兴趣已经直线上升][2]。 + +![](http://www.linuxjournal.com/files/linuxjournal.com/ufiles/imagecache/large-550px-centered/u1000009/12042f1.png) +> 图1. 谷歌 Blockchain 的趋势 + +第二件事就是自主身份。为了解释这个,让我先来问你,你是谁或者你是什么。 + +如果你从你的雇员,你的医生,或者车管所,Facebook,Twitter 或者谷歌上得到答案,你就会发现他们每一个都有明显的社会性: 为了他们自己的便利,在进入这些机构的控制前,他们都会添加自己的命名空间。正如 Timothy Ruff 在 [Evernym][3] 中解释的,”你并不为了他们而存在,你只为了自己的身份而活。“。你的身份可能会变化,但是唯一不变的就是控制着身份的人,也就是这个组织。 + +如果你的答案出自你自己,我们就有一个广大空间来发展一个新的领域,在这个领域中,我们完全自由。 + +第一个解释这个的人,据我所知,是 [Devon Loffreto][4]。在 2012 年 2 月,在的他的博客中,他写道 ”什么是' Sovereign Source Authority'?“,[Moxy Tongue][5]。在他发表在 2016 年 2 月的 "[Self-Sovereign Identity][6]" 中,他写道: + +> 自主身份必须是独立个人提出的,并且不包含社会因素。。。自主身份源于每个个体对其自身本源的认识。 一个自主身份可以为个体带来新的社会面貌。每个个体都可能为自己生成一个自主身份,并且这并不会改变固有的人权。使用自主身份机制是所有参与者参与的基石,并且 依旧可以同各种形式的人类社会保持联系。 + +为了将这个发布在 Linux 条款中,只有个人才能为他或她设定一个自己的开源社区身份。这在现实实践中,这只是一个非常偶然的事件。举个例子,我自己的身份包括: + +- David Allen Searls,我父母会这样叫我。 +- David Searls,正式场合下我会这么称呼自己。 +- Dave,我的亲戚和好朋友会这么叫我。 +- Doc,大多数人会这么叫我。 + +在上述提到的身份认证中,我可以在不同的情景中轻易的转换。但是,这只是在现实世界中。在虚拟世界中,这就变得非常困难。除了上述的身份之外,我还可以是 @dsearls(我的 twitter 账号) 和 dsearls (其他的网络账号)。然而为了记住成百上千的不同账号的登录名和密码,我已经不堪重负。 + +你可以在你的浏览器上感受到这个糟糕的体验。在火狐上,我有成百上千个用户名密码。很多已经废弃(很多都是从 Netscape 时代遗留下来的),但是我依旧假设我有时会有大量的工作账号需要处理。对于这些,我只是被动接受者。没有其他的解决方法。甚至一些安全较低的用户认证,已经成为了现实世界中不可缺少的一环。 + +现在,最简单的方式来联系账号,就是通过 "Log in with Facebook" 或者 "Login in with Twitter" 来进行身份认证。在这些例子中,我们中的每一个甚至并不是真正意义上的自己,或者某种程度上是我们希望被大家认识的自己(如果我们希望被其他人认识的话)。 + +我们从一开始就需要的是一个可以实体化我们的自主身份和交流时选择如何保护和展示自身的个人系统。因为缺少这个能力,我们现在陷入混乱。Shoshana Zuboff 称之为 "监视资本主义",她如此说道: + +>...难以想象,在见证了互联网和获得了的巨大成功的谷歌背后。世界因 Apple 和 FBI 的对决而紧密联系在一起。真相就是,被热衷于监视的资本家开发监视系统,是每一个国家安全机构真正的恶。 + +然后,她问道,”我们怎样才能保护自己远离他人的影响?“ + +我建议使用自主身份。我相信这是我们唯一的方式,来保证我们从一个被监视的世界中脱离出来。以此为基础,我们才可以完全无顾忌的和社会,政治,商业上的人交流。 + +我在五月联合国举行的 [ID2020][7] 会议中总结了这个临时的结论。很高兴,Devon Loffreto 也在那,自从他在2013年被选为作为轮值主席之后。这就是[我曾经写的一些文章][8],引用了 Devon 的早期博客(比如上面的原文)。 + +这有三篇这个领域的准则: + +- "[Self-Sovereign Identity][9]" - Devon Loffreto. +- "[System or Human First][10]" - Devon Loffreto. +- "[The Path to Self-Sovereign Identity][11]" - Christopher Allen. + +从Evernym 的简要说明中,[digi.me][12], [iRespond][13] 和 [Respect Network][14] 也被包括在内。自主身份和社会身份 (也被称为”current model“) 的对比结果,显示在图二中。 + +![](http://www.linuxjournal.com/files/linuxjournal.com/ufiles/imagecache/large-550px-centered/u1000009/12042f2.jpg) +> 图 2. Current Model 身份 vs. 自主身份 + +为此而生的[平台][15]就是 Sovrin,也被解释为“”依托于先进技术的,授权机制的,分布式货币上的一个完全开源,基于标识,声明身份的图平台“ 同时,这也有一本[白皮书][16]。代号为 [plenum][17],而且它在 Github 上。 + +在这-或者其他类似的地方-我们就可以在用户空间中重现我们在上一个的四分之一世纪中已经做过的事情。 + + +-------------------------------------------------------------------------------- + +via: https://www.linuxjournal.com/content/doing-user-space-what-we-did-kernel-space + +作者:[Doc Searls][a] +译者:[译者ID](https://github.com/MikeCoder) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxjournal.com/users/doc-searls +[1]: https://en.wikipedia.org/wiki/Block_chain_%28database%29 +[2]: https://www.google.com/trends/explore#q=blockchain +[3]: http://evernym.com/ +[4]: https://twitter.com/nzn +[5]: http://www.moxytongue.com/2012/02/what-is-sovereign-source-authority.html +[6]: http://www.moxytongue.com/2016/02/self-sovereign-identity.html +[7]: http://www.id2020.org/ +[8]: http://blogs.harvard.edu/doc/2013/10/14/iiw-challenge-1-sovereign-identity-in-the-great-silo-forest +[9]: http://www.moxytongue.com/2016/02/self-sovereign-identity.html +[10]: http://www.moxytongue.com/2016/05/system-or-human.html +[11]: http://www.lifewithalacrity.com/2016/04/the-path-to-self-soverereign-identity.html +[12]: https://get.digi.me/ +[13]: http://irespond.com/ +[14]: https://www.respectnetwork.com/ +[15]: http://evernym.com/technology +[16]: http://evernym.com/assets/doc/Identity-System-Essentials.pdf?v=167284fd65 +[17]: https://github.com/evernym/plenum From c2110a39900f819f0690479eb8f638004fc7b35b Mon Sep 17 00:00:00 2001 From: joVoV <704451873@qq.com> Date: Tue, 26 Jul 2016 16:34:52 +0800 Subject: [PATCH 1258/1469] =?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 --- ...20160627 Linux Practicality vs Activism.md | 74 ------------------- ...20160627 Linux Practicality vs Activism.md | 71 ++++++++++++++++++ 2 files changed, 71 insertions(+), 74 deletions(-) delete mode 100644 sources/talk/20160627 Linux Practicality vs Activism.md create mode 100644 translated/talk/20160627 Linux Practicality vs Activism.md diff --git a/sources/talk/20160627 Linux Practicality vs Activism.md b/sources/talk/20160627 Linux Practicality vs Activism.md deleted file mode 100644 index 195a9fdf5c..0000000000 --- a/sources/talk/20160627 Linux Practicality vs Activism.md +++ /dev/null @@ -1,74 +0,0 @@ -jovov 正在翻译。。。 - -Linux Practicality vs Activism -================================== - ->Is Linux actually more practical than other OSes, or is there some higher minded reason to use it? - -One of the greatest things about running Linux is the freedom it provides. Where the division among the Linux community appears is in how we value this freedom. - -For some, the freedom enjoyed by using Linux is the freedom from vendor lock-in or high software costs. Most would call this a practical consideration. Others users would tell you the freedom they enjoy is software freedom. This means embracing Linux distributions that support the [Free Software Movement][1], avoiding proprietary software completely and all things related. - -In this article, I'll walk you through some of the differences between these two freedoms and how they affect Linux usage. - -### The problem with proprietary - -One thing most Linux users have in common is their preference for avoiding proprietary software. For practical enthusiasts like myself, it's a matter of how I spend my money, the ability to control my software and avoiding vendor lock-in. Granted, I'm not a coder...so my tweaks to my installed software are pretty mild. But there are instances where a minor tweak to an application can mean the difference between it working and it not working. - -Then there are Linux enthusiasts who opt to avoid proprietary software because they feel it's unethical to use it. Usually the main concern here is that using proprietary software takes away or simply obstructs your personal freedom. Users in this corner prefer to use Linux distributions and software that support the [Free Software philosophy][2]. While it's similar to and often directly confused with Open Source concepts, [there are differences][3]. - -So here's the issue: Users such as myself tend to put convenience over the ideals of pure software freedom. Don't get me wrong, folks like me prefer to use software that meets the ideals behind Free Software, but we also are more likely to make concessions in order to accomplish specific tasks. - -Both types of Linux enthusiasts prefer using non-proprietary solutions. But Free Software advocates won't use proprietary at all, where as the practical user will rely on the best tool with the best performance. This means there are instances where the practical user is willing to run a proprietary application or code on their non-proprietary operating system. - -In the end, both user types enjoy using what Linux has to offer. But our reasons for doing so tend to vary. Some have argued that this is a matter of ignorance with those who don't support Free Software. I disagree and believe it's a matter of practical convenience. Users who prefer practical convenience simply aren't concerned about the politics of their software. - -### Practical Convenience - -When you ask most people why they use the operating system they use, it's usually tied in with practical convenience. Examples of this convenience might include "it's what I've always used" down to "it runs the software I need." Other folks might take this a step further and explain it's not so much the software that drives their OS preference, as the familiarity of the OS in question. And finally, there are specialty "niche tasks" or hardware compatibility issues that also provide good reasons for using one OS over another. - -This might surprise many of you, but the single biggest reason I run desktop Linux today is due to familiarity. Even though I provide support for Windows and OS X for others, it's actually quite frustrating to use these operating systems as they're simply not what my muscle memory is used to. I like to believe this allows me to empathize with Linux newcomers, as I too know how off-putting it can be to step into the realm of the unfamiliar. My point here is this – familiarity has value. And familiarity also powers practical convenience as well. - -Now if we compare this to the needs of a Free Software advocate, you'll find those folks are willing to learn something new and perhaps even more challenging if it translates into them avoiding using non-free software. It's actually something I've always admired about this type of user. Their willingness to take the path less followed to stick to their principles is, in my opinion, admirable. - -### The price of freedom - -One area I don't envy is the extra work involved in making sure a Free Software advocate is always using Linux distros and hardware that respect their digital freedom according to the standards set forth by the [Free Software Foundation][4]. This means the Linux kernel needs to be free from proprietary blobs for driver support and the hardware in question doesn't require any proprietary code whatsoever. Certainly not impossible, but it's pretty close. - -The absolute best scenario a Free Software advocate can shoot for is hardware that is "freedom-compatible." There are vendors out there that can meet this need, however most of them are offering hardware that relies on Linux compatible proprietary firmware. Great for the practical user, a show-stopper for the Free Software advocate. - -What all of this translates into is that the advocate must be far more vigilant than the practical Linux enthusiast. This isn't necessarily a negative thing per se, however it's a consideration if one is planning on jumping onto the Free Software approach to computing. Practical users, by contrast, can use any software or hardware that happens to be Linux compatible without a second thought. I don't know about you, but in my eyes this seems a bit easier to me. - -### Defining software freedom - -This part is going to get some folks upset as I personally don't subscribe to the belief that there's only one flavor of software freedom. From where I stand, I think true freedom is being able to soak in all the available data on a given issue and then come to terms with the approach that best suits that person's lifestyle. - -So for me, I prefer using Linux distributions that provide me with the desktop that meets all of my needs. This includes the use of non-proprietary software and proprietary software. Even though it's fair to suggest that the proprietary software restricts my personal freedom, I must counter this by pointing out that I had the freedom to use it in the first place. One might even call this freedom of choice. - -Perhaps this too, is why I find myself identifying more with the ideals of Open Source Software instead of sticking with the ideals behind the Free Software movement. I prefer to stand with the group that doesn't spend their time telling me how I'm wrong for using what works best for me. It's been my experience that the Open Source crowd is merely interested in sharing the merits of software freedom without the passion for Free Software idealism. - -I think the concept of Free Software is great. And to those who need to be active in software politics and point out the flaws of using proprietary software to folks, then I think Linux ([GNU/Linux][5]) activism is a good fit. Where practical users such as myself tend to change course from Free Software Linux advocates is in our presentation. - -When I present Linux on the desktop, I share my passion for its practical merits. And if I'm successful and they enjoy the experience, I allow the user to discover the Free Software perspective on their own. I've found most people use Linux on their computers not because they want to embrace software freedom, rather because they simply want the best user experience possible. Perhaps I'm alone in this, it's hard to say. - -What say you? Are you a Free Software Advocate? Perhaps you're a fan of using proprietary software/code on your desktop Linux distribution? Hit the Comments and share your Linux desktop experiences. - - --------------------------------------------------------------------------------- - -via: http://www.datamation.com/open-source/linux-practicality-vs-activism.html - -作者:[Matt Hartley][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://www.datamation.com/author/Matt-Hartley-3080.html -[1]: https://en.wikipedia.org/wiki/Free_software_movement -[2]: https://www.gnu.org/philosophy/free-sw.en.html -[3]: https://www.gnu.org/philosophy/free-software-for-freedom.en.html -[4]: https://en.wikipedia.org/wiki/Free_Software_Foundation -[5]: https://en.wikipedia.org/wiki/GNU/Linux_naming_controversy - - diff --git a/translated/talk/20160627 Linux Practicality vs Activism.md b/translated/talk/20160627 Linux Practicality vs Activism.md new file mode 100644 index 0000000000..81135bf56f --- /dev/null +++ b/translated/talk/20160627 Linux Practicality vs Activism.md @@ -0,0 +1,71 @@ +Linux 的实用性 VS 行动主义 +================================== + +>我们使用 Linux 是因为它比其他操作系统更实用,还是其他更高级的理由呢? + +其中一件关于运行 Linux 的最伟大的事情之一就是它所提供的自由。凡出现在 Linux 社区之间的划分在于我们如何珍惜这种自由。 + +一些人认为,通过使用 Linux 所享有的自由是从供应商锁定或高软件成本的自由。大多数人会称这个是一个实际的考虑。而其他用户会告诉你,他们享受的是自由软件的自由。那就意味着拥抱支持 [开源软件运动][1] 的 Linux 发行版,完全避免专有软件和所有相关的东西。 + + +在这篇文章中,我将带你比较这两种自由的区别,以及他们如何影响 Linux 的使用。 + +### 专有的问题 + +大多数的用户有一个共同的一点是他们的喜欢避免专有软件。对于像我这样的实际的爱好者来说,这是一个我怎么样花我的钱,来控制我的软件和避免供应商锁定的问题。当然,我不是一个程序员……所以我调整我的安装软件是十分温柔的。但也有一些个别情况,一个应用程序的小调整可以意味着它的工作和不工作的区别。 + +还有就是选择避开专有软件的Linux爱好者,因为他们觉得这是不道德的使用。通常这里主要的问题是使用专有软件会带走或者干脆阻碍你的个人自由。像这些用户更喜欢使用的Linux发行版和软件来支持 [自由软件理念][2] 。虽然它类似于开源的概念并经常直接与之混淆,[这里有些差异][3] 。 + +因此,这里有个问题:像我这样的用户往往以其便利掩盖了其纯软件自由的理想化。不要误会我的意思,像我这样的人更喜欢使用符合自由软件背后的理想软件,但我们也更有可能做出让步,以完成特定的任务。 + +这两种类型的 Linux 爱好者都喜欢使用非专有的解决方案。但是,自由软件倡导者根本不会去使用所有权,在那里作为实际的用户将依靠具有最佳性能的最佳工具。这意味着,在有些情况下的实际用户愿意来运行他们的非专有操作系统上的专有应用或代码实例。 + +最终,这两种类型的用户都喜欢使用 Linux 所提供的。但是,我们这样做的原因往往会有所不同。有人认为那些不支持自由软件的人是无知的。我不同意,我认为它是实用方便性的问题。那些喜欢实用方便性的用户根本不关心他们软件的政治问题。 + +### 实用方便性 + +当你问起绝大多数的人为什么使用他们现在的操作系统,回答通常都集中于实用方便性。这种关于方便性的例子可能包括“它是我一直使用的东西”、“它运行的软件是我需要的”。 其他人可能进一步解释说,并没有那么多软件影响他们对操作系统的偏好和熟悉程度,最后,有“利基任务”或硬件兼容性问题也提供了很好的理由让我们用这个操作系统而不是另一个。 + +这可能会让你们中许多人很惊讶,但我今天运行的桌面 Linux 最大的一个原因是由于熟悉。即使我为别人提供对 Windows 和 OS X 的支持,但实际上我是相当沮丧地使用这些操作系统,因为它们根本就不是我记忆中的那样习惯用法。我相信这可以让我对那些 Linux 新手表示同情,因为我太懂得踏入陌生的领域是怎样的让人倒胃口了。我的观点是这样的 —— 熟悉具有价值。而且熟悉同样使得实用方便性变得有力量。 + +现在,如果我们把它和一个自由软件倡导者的需求来比较,你会发现那些人都愿意学习新的东西,甚至更具挑战性,去学习那些若转化成为他们所避免使用的非自由软件。这就是我经常赞美的那种用户,我认为他们愿意采取最少路径来遵循坚持他们的原则是十分值得赞赏的。 + +### 自由的价值 + +我不羡慕那些自由软件倡导者的一个地方,就是根据 [自由软件基金会][4] 所规定的标准需要确保他们可以一直使用 Linux 发行版和硬件,以便于尊重他们的数字自由。这意味着 Linux 内核需要摆脱专有的斑点的驱动支持和不需要任何专有代码的硬件。当然不是不可能的,但它很接近。 + +一个自由软件倡导者可以达到的最好的情况是硬件是“自由兼容”的。有些供应商,可以满足这一需求,但他们大多是提供依赖于 Linux 兼容专有固件的硬件。伟大的实际用户对自由软件倡导者来说是个搅局者。 + +那么这一切意味着的是,倡导者必须比实际的 Linux 爱好者,更加警惕。这本身并不一定是消极的,但如果是打算用自由软件的方法来计算的话那就值得考虑了。通过对比,实用的用户可以专心地使用与 Linux 兼容的任何软件或硬件。我不知道你是怎么想的,但在我眼中是更轻松一点的。 + +### 定义自由软件 + +这一部分可能会让一部分人失望,因为我不相信自由软件只有一种。从我的立场,我认为真正的自由是能够在一个给定的情况里沉浸在所有可用的数据里,然后用最适合这个人的生活方式的途径来达成协议。 + +所以对我来说,我更喜欢使用的 Linux 桌面,满足了我所有的需求,这包括使用非专有软件和专有软件。尽管这是公平的建议,专有的软件限制了我的个人自由,但我必须反驳这一点,因为我有选择用不用它,即选择的自由。 + +或许,这也就是为什么我发现自己更确定开源软件的理想,而不是坚持自由软件运动背后的理念的原因。我更愿意和那些不会花时间告诉我,我是怎么用错了的那些人群在一起。我的经验是,那些开源的人群仅仅是感兴趣去分享自由软件的优点,而不是因为自由软件的理想主义的激情。 + +我觉的自由软件的概念实在是太棒了。对那些需要活跃在软件政治,并指出使用专有软件的人的缺陷的人来说,那么我认为 Linux ( [GNU/Linux][5] ) 行动是一个不错的选择。在我们的介绍里,像我一样的实际用户更倾向于从自由软件的支持者改变方向。 + +当我介绍 Linux 的桌面时,我富有激情地分享它的实际优点。而且我成功地让他们享受这一经历,我允许用户自己去发现自由软件的观点。但我发现大多数人使用的 Linux 不是因为他们想拥抱自由软件,而是因为他们只是想要最好的用户体验。也许只有我是这样的,很难说。 + +嘿!说你呢?你是一个自由软件倡导者吗?也许你是个使用桌面 Linux 发行专有软件/代码的粉丝?那么评论和分享您的 Linux 桌面体验吧! + + +-------------------------------------------------------------------------------- + +via: http://www.datamation.com/open-source/linux-practicality-vs-activism.html + +作者:[Matt Hartley][a] +译者:[joVoV](https://github.com/joVoV) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.datamation.com/author/Matt-Hartley-3080.html +[1]: https://en.wikipedia.org/wiki/Free_software_movement +[2]: https://www.gnu.org/philosophy/free-sw.en.html +[3]: https://www.gnu.org/philosophy/free-software-for-freedom.en.html +[4]: https://en.wikipedia.org/wiki/Free_Software_Foundation +[5]: https://en.wikipedia.org/wiki/GNU/Linux_naming_controversy \ No newline at end of file From 2982eaea05cd7496e216a36e0f3e4662418905ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E5=AE=B6=E6=9C=AA?= Date: Tue, 26 Jul 2016 17:12:11 +0800 Subject: [PATCH 1259/1469] Translating by GitFuture [07.26] --- .../20160705 How to Encrypt a Flash Drive Using VeraCrypt.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160705 How to Encrypt a Flash Drive Using VeraCrypt.md b/sources/tech/20160705 How to Encrypt a Flash Drive Using VeraCrypt.md index 2dd2ae024f..27a0b950bd 100644 --- a/sources/tech/20160705 How to Encrypt a Flash Drive Using VeraCrypt.md +++ b/sources/tech/20160705 How to Encrypt a Flash Drive Using VeraCrypt.md @@ -1,3 +1,5 @@ +Translating by GitFuture [07.26] + How to Encrypt a Flash Drive Using VeraCrypt ============================================ From 9e955cfb872c86914a5e2693803b1ddad52a77eb Mon Sep 17 00:00:00 2001 From: Locez Date: Tue, 26 Jul 2016 07:36:41 -0500 Subject: [PATCH 1260/1469] translating by locez --- sources/tech/20160722 7 Best Markdown Editors for Linux.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160722 7 Best Markdown Editors for Linux.md b/sources/tech/20160722 7 Best Markdown Editors for Linux.md index afe303021d..b4b05a41f5 100644 --- a/sources/tech/20160722 7 Best Markdown Editors for Linux.md +++ b/sources/tech/20160722 7 Best Markdown Editors for Linux.md @@ -1,3 +1,4 @@ +translating by Locez 7 Best Markdown Editors for Linux ====================================== From f50bf5b4f7d953ca0aa23b4822adbf3326fa59e3 Mon Sep 17 00:00:00 2001 From: ChrisLeeGit Date: Wed, 27 Jul 2016 15:36:59 +0800 Subject: [PATCH 1261/1469] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...technologies in Fedora - systemd-nspawn.md | 108 ------------------ ...technologies in Fedora - systemd-nspawn.md | 99 ++++++++++++++++ 2 files changed, 99 insertions(+), 108 deletions(-) delete mode 100644 sources/tech/20160621 Container technologies in Fedora - systemd-nspawn.md create mode 100644 translated/tech/20160621 Container technologies in Fedora - systemd-nspawn.md diff --git a/sources/tech/20160621 Container technologies in Fedora - systemd-nspawn.md b/sources/tech/20160621 Container technologies in Fedora - systemd-nspawn.md deleted file mode 100644 index 6d3e08ac91..0000000000 --- a/sources/tech/20160621 Container technologies in Fedora - systemd-nspawn.md +++ /dev/null @@ -1,108 +0,0 @@ -Being translated by [ChrisLeeGit](https://github.com/chrisleegit) - -Container technologies in Fedora: systemd-nspawn -=== - -Welcome to the “Container technologies in Fedora” series! This is the first article in a series of articles that will explain how you can use the various container technologies available in Fedora. This first article will deal with `systemd-nspawn`. - -### What is a container? - -A container is a user-space instance which can be used to run a program or an operating system in isolation from the system hosting the container (called the host system). The idea is very similar to a `chroot` or a [virtual machine][1]. The processes running in a container are managed by the same kernel as the host operating system, but they are isolated from the host file system, and from the other processes. - - -### What is systemd-nspawn? - -The systemd project considers container technologies as something that should fundamentally be part of the desktop and that should integrate with the rest of the user’s systems. To this end, systemd provides `systemd-nspawn`, a tool which is able to create containers using various Linux technologies. It also provides some container management tools. - -In many ways, `systemd-nspawn` is similar to `chroot`, but is much more powerful. It virtualizes the file system, process tree, and inter-process communication of the guest system. Much of its appeal lies in the fact that it provides a number of tools, such as `machinectl`, for managing containers. Containers run by `systemd-nspawn` will integrate with the systemd components running on the host system. As an example, journal entries can be logged from a container in the host system’s journal. - -In Fedora 24, `systemd-nspawn` has been split out from the systemd package, so you’ll need to install the `systemd-container` package. As usual, you can do that with a `dnf install systemd-container`. - -### Creating the container - -Creating a container with `systemd-nspawn` is easy. Let’s say you have an application made for Debian, and it doesn’t run well anywhere else. That’s not a problem, we can make a container! To set up a container with the latest version of Debian (at this point in time, Jessie), you need to pick a directory to set up your system in. I’ll be using `~/DebianJessie` for now. - -Once the directory has been created, you need to run `debootstrap`, which you can install from the Fedora repositories. For Debian Jessie, you run the following command to initialize a Debian file system. - -``` -$ debootstrap --arch=amd64 stable ~/DebianJessie -``` - -This assumes your architecture is x86_64. If it isn’t, you must change `amd64` to the name of your architecture. You can find your machine’s architecture with `uname -m`. - -Once your root directory is set up, you will start your container with the following command. - -``` -$ systemd-nspawn -bD ~/DebianJessie -``` - -You’ll be up and running within seconds. You’ll notice something as soon as you try to log in: you can’t use any accounts on your system. This is because systemd-nspawn virtualizes users. The fix is simple: remove -b from the previous command. You’ll boot directly to the root shell in the container. From there, you can just use passwd to set a password for root, or you can use adduser to add a new user. As soon as you’re done with that, go ahead and put the -b flag back. You’ll boot to the familiar login console and you log in with the credentials you set. - -All of this applies for any distribution you would want to run in the container, but you need to create the system using the correct package manager. For Fedora, you would use DNF instead of debootstrap. To set up a minimal Fedora system, you can run the following command, replacing the absolute path with wherever you want the container to be. - -``` -$ sudo dnf --releasever=24 --installroot=/absolute/path/ install systemd passwd dnf fedora-release -``` - -![](https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/Screenshot-from-2016-06-17-15-04-14.png) - -### Setting up the network - -You’ll notice an issue if you attempt to start a service that binds to a port currently in use on your host system. Your container is using the same network interface. Luckily, `systemd-nspawn` provides several ways to achieve separate networking from the host machine. - -#### Local networking - -The first method uses the `--private-network` flag, which only creates a loopback device by default. This is ideal for environments where you don’t need networking, such as build systems and other continuous integration systems. - -#### Multiple networking interfaces - -If you have multiple network devices, you can give one to the container with the `--network-interface` flag. To give `eno1` to my container, I would add the flag `--network-interface=eno1`. While an interface is assigned to a container, the host can’t use it at the same time. When the container is completely shut down, it will be available to the host again. - -#### Sharing network interfaces - -For those of us who don’t have spare network devices, there are other options for providing access to the container. One of those is the `--port` flag. This forwards a port on the container to the host. The format is `protocol:host:container`, where protocol is either `tcp` or `udp`, `host` is a valid port number on the host, and `container` is a valid port on the container. You can omit the protocol and specify only `host:container`. I often use something similar to `--port=2222:22`. - -You can enable complete, host-only networking with the `--network-veth` flag, which creates a virtual Ethernet interface between the host and the container. You can also bridge two connections with `--network-bridge`. - -### Using systemd components - -If the system in your container has D-Bus, you can use systemd’s provided utilities to control and monitor your container. Debian doesn’t include dbus in the base install. If you want to use it with Debian Jessie, you’ll want to run `apt install dbus`. - -#### machinectl - -To easily manage containers, systemd provides the machinectl utility. Using machinectl, you can log in to a container with machinectl login name, check the status with machinectl status name, reboot with machinectl reboot name, or power it off with machinectl poweroff name. - -### Other systemd commands - -Most systemd commands, such as journalctl, systemd-analyze, and systemctl, support containers with the `--machine` option. For example, if you want to see the journals of a container named “foobar”, you can use journalctl `--machine=foobar`. You can also see the status of a service running in this container with `systemctl --machine=foobar` status service. - -![](https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/Screenshot-from-2016-06-17-15-09-25.png) - -### Working with SELinux - -If you’re running with SELinux enforcing (the default in Fedora), you’ll need to set the SELinux context for your container. To do that, you need to run the following two commands on the host system. - -``` -$ semanage fcontext -a -t svirt_sandbox_file_t "/path/to/container(/.*)?" -$ restorecon -R /path/to/container/ -``` - -Make sure you replace “/path/to/container” with the path to your container. For my container, “DebianJessie”, I would run the following: - -``` -$ semanage fcontext -a -t svirt_sandbox_file_t "/home/johnmh/DebianJessie(/.*)?" -$ restorecon -R /home/johnmh/DebianJessie/ -``` - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/set-nginx-reverse-proxy-centos-7-cpanel/ - -作者:[John M. Harris, Jr.][a] -译者:[ChrisLeeGit](https://github.com/chrisleegit) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://linoxide.com/linux-how-to/set-nginx-reverse-proxy-centos-7-cpanel/ -[1]: https://en.wikipedia.org/wiki/Virtual_machine diff --git a/translated/tech/20160621 Container technologies in Fedora - systemd-nspawn.md b/translated/tech/20160621 Container technologies in Fedora - systemd-nspawn.md new file mode 100644 index 0000000000..f47d17556a --- /dev/null +++ b/translated/tech/20160621 Container technologies in Fedora - systemd-nspawn.md @@ -0,0 +1,99 @@ +Fedora 中的容器技术:systemd-nspawn +=== + +欢迎来到“Fedora 中的容器技术”系列!本文是该系列文章中的第一篇,它将说明你可以怎样使用 Fedora 中各种可用的容器技术。本文将学习 `systemd-nspawn` 的相关知识。 + +### 容器是什么? +一个容器就是一个用户空间实例,它能够在与托管容器的系统(叫做宿主系统)隔离的环境中运行一个程序或者一个操作系统。这和 `chroot` 或 [虚拟机][1] 的思想非常类似。 +运行在容器中的进程是由与宿主操作系统相同的内核来管理的,但它们是与宿主文件系统以及其它进程隔离开的。 + + +### 什么是 systemd-nspawn? +systemd 项目认为应当将容器技术变成桌面的基础部分,并且应当和剩余的用户系统集成在一起。为此,systemd 提供了 `systemd-nspawn`,这款工具能够使用多种 Linux 技术创建容器。它也提供了一些容器管理工具。 + +`systemd-nspawn` 和 `chroot` 在许多方面都是类似的,但是前者更加强大。它虚拟化了文件系统、进程树以及客户系统中的进程间通信。它的引力在于它提供了很多用于管理容器的工具,例如 `machinectl`。由 `systemd-nspawn` 运行的容器将会与 systemd 组件一同运行在宿主系统上。举例来说,一个容器的日志可以输出到宿主系统的日志中。 + +在 Fedora 24 上,`systemd-nspawn` 已经和 systemd 软件包分开了,所以你需要安装 `systemd-container` 软件包。一如往常,你可以使用 `dnf install systemd-container` 进行安装。 + +### 创建容器 +使用 `systemd-nspawn` 创建一个容器是很容易的。假设你有一个专门为 Debian 创造的应用,并且无法在其它地方正常运行。那并不是一个问题,我们可以创造一个容器!为了设置容器使用最新版本的 Debian(此时是 Jessie),你需要挑选一个目录来放置你的系统。我暂时将使用目录 `~/DebianJessie`。 + +一旦你创建完目录,你需要运行 `debootstrap`,你可以从 Fedora 仓库中安装它。对于 Debian Jessie,你运行下面的命令来初始化一个 Debian 文件系统。 + +``` +$ debootstrap --arch=amd64 stable ~/DebianJessie +``` + +以上默认你的架构是 x86_64。如果不是的话,你必须将架构的名称改为 `amd64`。你可以使用 `uname -m` 得知你的机器架构。 + +一旦设置好你的根目录,你就可以使用下面的命令来启动你的容器。 + +``` +$ systemd-nspawn -bD ~/DebianJessie +``` + +容器将会在数秒后准备好并运行,当你一尝试登录就会注意到:你无法在你的系统上使用任何账户。这是因为 `systemd-nspawn` 虚拟化了用户。修复的方法很简单:将之前的命令中的 `-b` 移除即可。你将直接进入容器的 root shell。此时,你只能使用 `passwd` 命令为 root 设置密码,或者使用 `adduser` 命令添加一个新用户。一旦设置好密码或添加好用户,你就可以把 `-b` 标志添加回去然后继续了。你会进入到熟悉的登录控制台,然后你使用设置好的认证信息登录进去。 + +以上对于任意你想在容器中运行的发行版都适用,但前提是你需要使用正确的包管理器创建系统。对于 Fedora,你应使用 DNF 而非 `debootstrap`。想要设置一个最小化的 Fedora 系统,你可以运行下面的命令,要将绝对路径替换成任何你希望容器存放的位置。 + +``` +$ sudo dnf --releasever=24 --installroot=/absolute/path/ install systemd passwd dnf fedora-release +``` + +![](https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/Screenshot-from-2016-06-17-15-04-14.png) + +### 设置网络 +如果你尝试启动一个服务,但它绑定了你宿主机正在使用的端口,你将会注意到这个问题:你的容器正在使用和宿主机相同的网络接口。 +幸运的是,`systemd-nspawn` 提供了几种方法可以将网络从宿主机分开。 + +#### 本地网络 + +第一种方法是使用 `--private-network` 标志,它默认仅创建一个回环设备。这对于你不需要使用网络的环境是非常理想的,例如构建系统和其它持续集成系统。 + +#### 多个网络接口 + +如果你有多个网络接口设备,你可以使用 `--network-interface` 标志给容器分配一个接口。想要给我的容器分配 `eno1`,我会添加标志 `--network-interface=eno1`。当某个接口分配给一个容器后,宿主机就不能同时使用那个接口了。只有当容器彻底关闭后,宿主机才可以使用那个接口。 + + +#### 共享网络接口 +对于我们中那些并没有额外的网络设备的人来说,还有其它方法可以访问容器。一种就是使用 `--port` 标志。这会将容器中的一个端口定向到宿主机。使用格式是 `协议:宿主机:容器`,这里的协议可以是 `tcp` 或者 `udp`,`宿主机` 是宿主机的一个合法端口,`容器` 则是容器中的一个合法端口。你可以省略协议,只指定 `宿主机:容器`。我通常的用法类似 `--port=2222:22`。 + +你可以使用 `--network-veth` 启用完全的、仅宿主机模式的网络,这会在宿主机和容器之间创建一个虚拟的网络接口。你也可以使用 `--network-bridge` 桥接二者的连接。 + +### 使用 systemd 组件 +如果你容器中的系统含有 D-Bus,你可以使用 systemd 提供的实用工具来控制并监视你的容器。基础安装的 Debian 并不包含 `dbus`。如果你想在 Debian Jessie 中使用 `dbus`,你需要运行命令 `apt install dbus`。 + +#### machinectl +为了能够轻松地管理容器,systemd 提供了 `machinectl` 实用工具。使用 `machinectl`,你可以使用 `machinectl login name` 登录到一个容器中、使用 `machinectl status name`检查状态、使用 `machinectl reboot name` 启动容器或者使用 `machinectl poweroff name` 关闭容器。 + +### 其它 systemd 命令 +多数 systemd 命令,例如 `journalctl`, `systemd-analyze` 和 `systemctl`,都支持使用了 `--machine` 选项的容器。例如,如果你想查看一个名为 "foobar" 的容器日志,你可以使用 `journalctl --machine=foobar`。你也可以使用 `systemctl --machine=foobar status service` 来查看运行在这个容器中的服务状态。 + +![](https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/Screenshot-from-2016-06-17-15-09-25.png) + +### 和 SELinux 一起工作 +如果你要使用 SELinux 强制模式(Fedora 默认模式),你需要为你的容器设置 SELinux 环境。想要那样的话,你需要在宿主系统上运行下面两行命令。 + +``` +$ semanage fcontext -a -t svirt_sandbox_file_t "/path/to/container(/.*)?" +$ restorecon -R /path/to/container/ +``` +确保使用你的容器路径替换 "/path/to/container"。对于我的容器 "DebianJessie",我会运行下面的命令: + +``` +$ semanage fcontext -a -t svirt_sandbox_file_t "/home/johnmh/DebianJessie(/.*)?" +$ restorecon -R /home/johnmh/DebianJessie/ +``` + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/container-technologies-fedora-systemd-nspawn/ + +作者:[John M. Harris, Jr.][a] +译者:[ChrisLeeGit](https://github.com/chrisleegit) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/container-technologies-fedora-systemd-nspawn/ +[1]: https://en.wikipedia.org/wiki/Virtual_machine From a10295803858cb583d50738335458f194fb47a99 Mon Sep 17 00:00:00 2001 From: Locez Date: Wed, 27 Jul 2016 21:34:49 +0800 Subject: [PATCH 1262/1469] translated and delete source --- ...60722 7 Best Markdown Editors for Linux.md | 156 ------------------ 1 file changed, 156 deletions(-) delete mode 100644 sources/tech/20160722 7 Best Markdown Editors for Linux.md diff --git a/sources/tech/20160722 7 Best Markdown Editors for Linux.md b/sources/tech/20160722 7 Best Markdown Editors for Linux.md deleted file mode 100644 index b4b05a41f5..0000000000 --- a/sources/tech/20160722 7 Best Markdown Editors for Linux.md +++ /dev/null @@ -1,156 +0,0 @@ -translating by Locez -7 Best Markdown Editors for Linux -====================================== - -In this article, we shall review some of the best Markdown editors you can install and use on your Linux desktop. There are numerous Markdown editors you can find for Linux but here, we want to unveil possibly the best you may choose to work with. - -![](http://www.tecmint.com/wp-content/uploads/2016/07/Best-Linux-Markdown-Editors.png) ->Best Linux Markdown Editors - -For starters, Markdown is a simple and lightweight tool written in Perl, that enables users to write plain text format and covert it to valid HTML (or XHTML). It is literally an easy-to-read, easy-to-write plain text language and a software tool for text-to-HTML conversion. - -Hoping that you have a slight understanding of what Markdown is, let us proceed to list the editors. - -### 1. Atom - -Atom is a modern, cross-platform, open-source and very powerful text editor that can work on Linux, Windows and Mac OS X operating systems. Users can customize it down to its base, minus altering any configuration files. - -It is designed with some illustrious features and these include: - -- Comes with a built-in package manager -- Smart auto-completion functionality -- Offers multiple panes -- Supports find and replace functionality -- Includes a file system browser -- Easily customizable themes -- Highly extensible using open-source packages and many more - -![](http://www.tecmint.com/wp-content/uploads/2016/07/Atom-Markdown-Editor-for-Linux.png) - -Visit Homepage: - -### 2. GNU Emacs - -Emacs is one of the popular open-source text editors you can find on the Linux platform today. It is a great editor for Markdown language, which is highly extensible and customizable. - -It’s comprehensively developed with the following amazing features: - -- Comes with an extensive built-in documentation including tutorials for beginners -- Full Unicode support for probably all human scripts -- Supports content-aware text-editing modes -- Includes syntax coloring for multiple file types -- Its highly customizable using Emacs Lisp code or GUI -- Offers a packaging system for downloading and installing various extensions plus so much more - -![](http://www.tecmint.com/wp-content/uploads/2016/07/Emacs-Markdown-Editor-for-Linux.png) ->Emacs Markdown Editor for Linux - -Visit Homepage: - -### 3. Remarkable - -Remarkable is possibly the best Markdown editor you can find on Linux, it also works on Windows operating system. It is indeed a remarkable and fully featured Markdown editor that offers users some exciting features. - -Some of its remarkable features include: - -- Supports live preview -- Supports exporting to PDF and HTML -- Also offers Github Markdown -- Supports custom CSS -- It also supports syntax highlighting -- Offers keyboard shortcuts -- Highly customizable plus and many more - -![](http://www.tecmint.com/wp-content/uploads/2016/07/Remarkable-Markdown-Editor-for-Linux.png) ->Remarkable Markdown Editor for Linux - -Visit Homepage: - -### 4. Haroopad - -Haroopad is an extensively built, cross-platform Markdown document processor for Linux, Windows and Mac OS X. It enables users to write expert-level documents of numerous formats including email, reports, blogs, presentations, blog posts and many more. - -It is fully featured with the following notable features: - -- Easily imports content -- Also exports to numerous formats -- Broadly supports blogging and mailing -- Supports several mathematical expressions -- Supports Github flavored Markdown and extensions -- Offers users some exciting themes, skins and UI components plus so much more - -![](http://www.tecmint.com/wp-content/uploads/2016/07/Haroopad-Markdown-Editor-for-Linux.png) ->Haroopad Markdown Editor for Linux - -Visit Homepage: - -### 5. ReText - -ReText is a simple, lightweight and powerful Markdown editor for Linux and several other POSIX-compatible operating systems. It also doubles as a reStructuredText editor, and has the following attributes: - -- Simple and intuitive GUI -- It is highly customizable, users can customize file syntax and configuration options -- Also supports several color schemes -- Supports use of multiple mathematical formulas -- Enables export extensions and many more - -![](http://www.tecmint.com/wp-content/uploads/2016/07/ReText-Markdown-Editor-for-Linux.png) ->ReText Markdown Editor for Linux - -Visit Homepage: - -### 6. UberWriter - -UberWriter is a simple and easy-to-use Markdown editor for Linux, it’s development was highly influenced by iA writer for Mac OS X. It is also feature rich with these remarkable features: - -- Uses pandoc to perform all text-to-HTML conversions -- Offers a clean UI -- Offers a distraction free mode, highlighting a users last sentence -- Supports spellcheck -- Also supports full screen mode -- Supports exporting to PDF, HTML and RTF using pandoc -- Enables syntax highlighting and mathematical functions plus many more - -![](http://www.tecmint.com/wp-content/uploads/2016/07/UberWriter-Markdown-Editor-for-Linux.png) ->UberWriter Markdown Editor for Linux - -Visit Homepage: - -### 7. Mark My Words - -Mark My Words is a also lightweight yet powerful Markdown editor. It’s a relatively new editor, therefore offers a handful of features including syntax highlighting, simple and intuitive GUI. - -The following are some of the awesome features yet to be bundled into the application: - -- Live preview support -- Markdown parsing and file IO -- State management -- Support for exporting to PDF and HTML -- Monitoring files for changes -- Support for preferences - -![](http://www.tecmint.com/wp-content/uploads/2016/07/MarkMyWords-Markdown-Editor-for-Linux.png) ->MarkMyWords Markdown Editor for-Linux - -Visit Homepage: - -### Conclusion - -Having walked through the list above, you probably know what Markdown editors and document processors to download and install on your Linux desktop for now. - -Note that what we consider to be the best here may reasonably not be the best for you, therefore, you can reveal to us exciting Markdown editors that you think are missing in the list and have earned the right to be mentioned here by sharing your thoughts via the feedback section below. - - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/best-markdown-editors-for-linux/ - -作者:[Aaron Kili |][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/aaronkili/ - - From 4bbcd800086bb809f2aad07b403f3378d3ef229b Mon Sep 17 00:00:00 2001 From: Locez Date: Wed, 27 Jul 2016 21:38:07 +0800 Subject: [PATCH 1263/1469] [translated] 7 Best Markdown Editors for Linux.md --- .../tech/7 Best Markdown Editors for Linux.md | 158 ++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 translated/tech/7 Best Markdown Editors for Linux.md diff --git a/translated/tech/7 Best Markdown Editors for Linux.md b/translated/tech/7 Best Markdown Editors for Linux.md new file mode 100644 index 0000000000..8cf7cdd45f --- /dev/null +++ b/translated/tech/7 Best Markdown Editors for Linux.md @@ -0,0 +1,158 @@ +Linux 上 7 个最好的 Markdown 编辑器 +====================================== + +在这篇文章中,我们会重温一些可以在 Linux 上安装使用的最好的 Markdown 编辑器。 你可以找到非常多的 Linux 平台上的 Markdown 编辑器,但是在这里我们将尽可能地推荐你选择最好的。 + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Best-Linux-Markdown-Editors.png) +>Best Linux Markdown Editors + + +首先,Markdown 是一个用 Perl 写的简单、轻量的工具。它可以将用户写的纯文本转为可用的 HTML (或 XHTML)。它实际上是一门易读,易写的纯文本语言,以及一个用于将文本转为 HTML 的转换工具。 + + +希望你先对 Markdown 有一个稍微的了解,接下来让我们逐一列出这些编辑器。 +### 1. Atom + + + +Atom 是一个现代的,跨平台,开源且强有力的文本编辑器,它可以运行在 Linux, Windows 和 MAC OS X 等操作系统上。用户可以在它的基础上进行定制,删减修改任何配置文件。 + +它包含了一些非常杰出的特性: + + +- 内置软件包管理器 +- 智能自动补全功能 +- 提供多窗口操作 +- 支持查找替换功能 +- 包含一个文件系统浏览器 +- 轻松自定义主题 +- 开源、高度扩展性的软件包等 + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Atom-Markdown-Editor-for-Linux.png) + + +访问主页: + +### 2. GNU Emacs + +Emacs 是 Linux 平台上一款的流行文本编辑器。它是一个非常棒的,具备高扩展性和定制性的 Markdown 语言编辑器。 + + +它综合了以下这些神奇的特性: + +- 带有丰富的内置文档,包括适合初学者的教程 +- 有完整的 UnicodeU支持,可显示所有的人类符号 +- 支持内容识别的文本编辑模式 +- 包括多种文件类型的语法高亮 +- 可用 Emacs Lisp 或 GUI 对其进行高度定制 +- 提供了一个包系统可用来下载安装各种扩展等 + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Emacs-Markdown-Editor-for-Linux.png) +>Emacs Markdown Editor for Linux + +访问主页: + +### 3. Remarkable + +Remarkable 可能是 Linux 上最好的 Markdown 编辑器了,它也适用于 Windows 操作系统。它的确是是一个卓越且功能齐全的 Markdown 编辑器,为用户提供了一些令人兴奋的特性。 + +一些卓越的特性: + +- 支持实时预览 +- 支持导出 PDF 和 HTML +- 支持 Github Markdown 语法 +- 支持定制 CSS +- 支持语法高亮 +- 提供键盘快捷键 +- 高可定制性和其他 + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Remarkable-Markdown-Editor-for-Linux.png) +>Remarkable Markdown Editor for Linux + +访问主页: + +### 4. Haroopad + +Haroopad 是为 Linux,Windows 和 Mac OS X 构建的跨平台 Markdown 文档处理程序。用户可以用它来书写许多专家级格式的文档,包括电子邮件、报告、博客、演示文稿和博客文章等等。 + + +功能齐全且具备以下的亮点: + +- 轻松导入内容 +- 支持导出多种格式 +- 广泛支持博客和邮件 +- 支持许多数学表达式 +- 支持 Github Markdown 扩展 +- 为用户提供了一些令人兴奋的主题、皮肤和 UI 组件等等 + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Haroopad-Markdown-Editor-for-Linux.png) +>Haroopad Markdown Editor for Linux + +访问主页: +### 5. ReText + +ReText 是为 Linux 和其它几个 POSIX 兼容操作系统提供的简单、轻量、强大的 Markdown 编辑器。它还可以作为一个 reStructuredText 编辑器,并且具有以下的特性: + +- 简单直观的 GUI +- 具备高定制性,用户可以自定义语法文件和配置选项 +- 支持多种配色方案 +- 支持使用多种数学公式 +- 启用导出扩展等等 + +![](http://www.tecmint.com/wp-content/uploads/2016/07/ReText-Markdown-Editor-for-Linux.png) +>ReText Markdown Editor for Linux + +访问主页: +### 6. UberWriter + +UberWriter 是一个简单、易用的 Linux Markdown 编辑器。它的开发受 Mac OS X 上的 iA writer 影响很大,同样它也具备这些卓越的特性: + +- 使用 pandoc 将所有的文本转为 HTML +- 提供了一个简洁的 UI 界面 +- 提供了一种自由的分发模式,高亮用户的最后一句话 +- 支持拼写检查 +- 支持全屏模式 +- 支持用 pandoc 导出 PDF、HTML 和 RTF +- 启用语法高亮和数学函数等等 + +![](http://www.tecmint.com/wp-content/uploads/2016/07/UberWriter-Markdown-Editor-for-Linux.png) +>UberWriter Markdown Editor for Linux + +访问主页: +### 7. Mark My Words + +Mark My Words 同样也是一个轻量、强大的 Markdown 编辑器。它是一个相对比较新的编辑器,因此提供了大量的功能,包含语法高亮、简单和直观的 UI 等。 + + +下面是一些棒极了,但还未捆绑到应用中的功能: + +- 实时预览 +- Markdown 解析和文件 IO +- 状态管理 +- 支持导出 PDF 和 HTML +- 监测文件的修改 +- 支持首选项 + +![](http://www.tecmint.com/wp-content/uploads/2016/07/MarkMyWords-Markdown-Editor-for-Linux.png) +>MarkMyWords Markdown Editor for-Linux + +访问主页: + +### 结论 + +通过上面的列表,你大概已经知道要为你的 Linux 桌面下载、安装什么样的 Markdown 编辑器和文档处理程序了。 + +请注意,这里提到的最好的 Markdown 编辑器可能对你来说并不是最好的选择。因此你可以通过下面的反馈部分,为我们展示你认为列表中未提及的,并且具备足够的资格的,令人兴奋的 Markdown 编辑器。 + + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/best-markdown-editors-for-linux/ + +作者:[Aaron Kili |][a] +译者:[Locez](https://github.com/locez) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.tecmint.com/author/aaronkili/ From 6553b0e28615ddd39e2f8b16a87230a3ed05c1c8 Mon Sep 17 00:00:00 2001 From: Locez Date: Wed, 27 Jul 2016 21:40:28 +0800 Subject: [PATCH 1264/1469] Rename 7 Best Markdown Editors for Linux.md to 20160722 7 Best Markdown Editors for Linux.md --- ...for Linux.md => 20160722 7 Best Markdown Editors for Linux.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename translated/tech/{7 Best Markdown Editors for Linux.md => 20160722 7 Best Markdown Editors for Linux.md} (100%) diff --git a/translated/tech/7 Best Markdown Editors for Linux.md b/translated/tech/20160722 7 Best Markdown Editors for Linux.md similarity index 100% rename from translated/tech/7 Best Markdown Editors for Linux.md rename to translated/tech/20160722 7 Best Markdown Editors for Linux.md From e896363804f9995a08c681206cef2c15d77fec99 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 27 Jul 2016 22:27:56 +0800 Subject: [PATCH 1265/1469] PUB:20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU @locez --- ...O CHANGE DEFAULT APPLICATIONS IN UBUNTU.md | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) rename {translated/tech => published}/20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md (81%) diff --git a/translated/tech/20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md b/published/20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md similarity index 81% rename from translated/tech/20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md rename to published/20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md index 2192b71600..b485632d6c 100644 --- a/translated/tech/20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md +++ b/published/20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md @@ -1,15 +1,16 @@ -怎样在 UBUNTU 中修改默认程序 +怎样在 Ubuntu 中修改默认程序 ============================================== ![](https://itsfoss.com/wp-content/uploads/2016/07/change-default-applications-ubuntu.jpg) -简介: 这个新手指南会向你展示如何在 Ubuntu Linux 中修改默认程序 +> 简介: 这个新手指南会向你展示如何在 Ubuntu Linux 中修改默认程序 对于我来说,安装 [VLC 多媒体播放器][1]是[安装完 Ubuntu 16.04 该做的事][2]中最先做的几件事之一。为了能够使我双击一个视频就用 VLC 打开,在我安装完 VLC 之后我会设置它为默认程序。 作为一个新手,你需要知道如何在 Ubuntu 中修改任何默认程序,这也是我今天在这篇指南中所要讲的。 ### 在 UBUNTU 中修改默认程序 + 这里提及的方法适用于所有的 Ubuntu 12.04,Ubuntu 14.04 和Ubuntu 16.04。在 Ubuntu 中,这里有两种基本的方法可以修改默认程序: - 通过系统设置 @@ -25,43 +26,44 @@ ![](https://itsfoss.com/wp-content/uploads/2016/07/System-settings-detail-ubuntu.jpeg) - 在左边的面板中选择默认程序(Default Applications),你会发现在右边的面板中可以修改默认程序。 ![](https://itsfoss.com/wp-content/uploads/2016/07/System-settings-default-applications.jpeg) -正如看到的那样,这里只有少数几类的默认程序可以被改变。你可以在这里改变浏览器,邮箱客户端,日历,音乐,视频和相册的默认程序。那其他类型的默认程序怎么修改? +正如看到的那样,这里只有少数几类的默认程序可以被改变。你可以在这里改变浏览器、邮箱客户端、日历、音乐、视频和相册的默认程序。那其他类型的默认程序怎么修改? 不要担心,为了修改其他类型的默认程序,我们会用到右键菜单。 #### 2.通过右键菜单修改默认程序 - 如果你使用过 Windows 系统,你应该看见过右键菜单的“打开方式”,可以通过这个来修改默认程序。我们在 Ubuntu 中也有相似的方法。 右键一个还没有设置默认打开程序的文件,选择“属性(properties)” ![](https://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-3.png) ->从右键菜单中选择属性 + +*从右键菜单中选择属性* 在这里,你可以选择使用什么程序打开,并且设置为默认程序。 ![](https://itsfoss.com/wp-content/uploads/2016/05/WebP-images-Ubuntu-Linux-4.png) ->在 Ubuntu 中设置打开 WebP 图片的默认程序为 gThumb + +*在 Ubuntu 中设置打开 WebP 图片的默认程序为 gThumb* 小菜一碟不是么?一旦你做完这些,所有同样类型的文件都会用你选择的默认程序打开。 + 我很希望这个新手指南对你在修改 Ubuntu 的默认程序时有帮助。如果你有任何的疑问或者建议,可以随时在下面评论。 -------------------------------------------------------------------------------- -via: https://itsfoss.com/change-default-applications-ubuntu/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 +via: https://itsfoss.com/change-default-applications-ubuntu/ 作者:[Abhishek Prakash][a] 译者:[Locez](https://github.com/locez) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://itsfoss.com/author/abhishek/ [1]: http://www.videolan.org/vlc/index.html -[2]: https://itsfoss.com/things-to-do-after-installing-ubuntu-16-04/ +[2]: https://linux.cn/article-7453-1.html From 89182f569304b02318986dc0bedf1db13f6d94ad Mon Sep 17 00:00:00 2001 From: ChrisLeeGit Date: Wed, 27 Jul 2016 22:56:09 +0800 Subject: [PATCH 1266/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E7=94=B3=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20160630 What makes up the Fedora kernel.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20160630 What makes up the Fedora kernel.md b/sources/tech/20160630 What makes up the Fedora kernel.md index 95b61a201a..603aefa575 100644 --- a/sources/tech/20160630 What makes up the Fedora kernel.md +++ b/sources/tech/20160630 What makes up the Fedora kernel.md @@ -1,3 +1,5 @@ +Being translated by ChrisLeeGit + What makes up the Fedora kernel? ==================================== @@ -22,7 +24,7 @@ The Fedora kernel contains code from many places. All of it is necessary to give via: https://fedoramagazine.org/makes-fedora-kernel/ 作者:[Laura Abbott][a] -译者:[译者ID](https://github.com/译者ID) +译者:[ChrisLeeGit](https://github.com/chrisleegit) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ffef0b3a3d2629298a21cb3b75422fb8fad419b2 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 27 Jul 2016 23:22:16 +0800 Subject: [PATCH 1267/1469] PUB:20160722 7 Best Markdown Editors for Linux @locez --- ...60722 7 Best Markdown Editors for Linux.md | 96 +++++++++++++------ 1 file changed, 69 insertions(+), 27 deletions(-) rename {translated/tech => published}/20160722 7 Best Markdown Editors for Linux.md (59%) diff --git a/translated/tech/20160722 7 Best Markdown Editors for Linux.md b/published/20160722 7 Best Markdown Editors for Linux.md similarity index 59% rename from translated/tech/20160722 7 Best Markdown Editors for Linux.md rename to published/20160722 7 Best Markdown Editors for Linux.md index 8cf7cdd45f..7d1ffe0c86 100644 --- a/translated/tech/20160722 7 Best Markdown Editors for Linux.md +++ b/published/20160722 7 Best Markdown Editors for Linux.md @@ -1,25 +1,22 @@ -Linux 上 7 个最好的 Markdown 编辑器 +Linux 上 10 个最好的 Markdown 编辑器 ====================================== -在这篇文章中,我们会重温一些可以在 Linux 上安装使用的最好的 Markdown 编辑器。 你可以找到非常多的 Linux 平台上的 Markdown 编辑器,但是在这里我们将尽可能地推荐你选择最好的。 +在这篇文章中,我们会点评一些可以在 Linux 上安装使用的最好的 Markdown 编辑器。 你可以找到非常多的 Linux 平台上的 Markdown 编辑器,但是在这里我们将尽可能地为您推荐那些最好的。 ![](http://www.tecmint.com/wp-content/uploads/2016/07/Best-Linux-Markdown-Editors.png) ->Best Linux Markdown Editors +*Best Linux Markdown Editors* -首先,Markdown 是一个用 Perl 写的简单、轻量的工具。它可以将用户写的纯文本转为可用的 HTML (或 XHTML)。它实际上是一门易读,易写的纯文本语言,以及一个用于将文本转为 HTML 的转换工具。 - +对于不了解 Markdown 的人做个简单介绍,Markdown 是由著名的 Aaron Swartz 和 John Gruber 发明的标记语言,其最初的解析器是一个用 Perl 写的简单、轻量的[同名工具][1]。它可以将用户写的纯文本转为可用的 HTML(或 XHTML)。它实际上是一门易读,易写的纯文本语言,以及一个用于将文本转为 HTML 的转换工具。 希望你先对 Markdown 有一个稍微的了解,接下来让我们逐一列出这些编辑器。 + ### 1. Atom - - -Atom 是一个现代的,跨平台,开源且强有力的文本编辑器,它可以运行在 Linux, Windows 和 MAC OS X 等操作系统上。用户可以在它的基础上进行定制,删减修改任何配置文件。 +Atom 是一个现代的、跨平台、开源且强大的文本编辑器,它可以运行在 Linux、Windows 和 MAC OS X 等操作系统上。用户可以在它的基础上进行定制,删减修改任何配置文件。 它包含了一些非常杰出的特性: - - 内置软件包管理器 - 智能自动补全功能 - 提供多窗口操作 @@ -30,31 +27,32 @@ Atom 是一个现代的,跨平台,开源且强有力的文本编辑器,它 ![](http://www.tecmint.com/wp-content/uploads/2016/07/Atom-Markdown-Editor-for-Linux.png) +*Atom Markdown Editor for Linux* 访问主页: ### 2. GNU Emacs -Emacs 是 Linux 平台上一款的流行文本编辑器。它是一个非常棒的,具备高扩展性和定制性的 Markdown 语言编辑器。 - +Emacs 是 Linux 平台上一款的流行文本编辑器。它是一个非常棒的、具备高扩展性和定制性的 Markdown 语言编辑器。 它综合了以下这些神奇的特性: - 带有丰富的内置文档,包括适合初学者的教程 -- 有完整的 UnicodeU支持,可显示所有的人类符号 +- 有完整的 Unicode 支持,可显示所有的人类符号 - 支持内容识别的文本编辑模式 - 包括多种文件类型的语法高亮 - 可用 Emacs Lisp 或 GUI 对其进行高度定制 - 提供了一个包系统可用来下载安装各种扩展等 ![](http://www.tecmint.com/wp-content/uploads/2016/07/Emacs-Markdown-Editor-for-Linux.png) ->Emacs Markdown Editor for Linux + +*Emacs Markdown Editor for Linux* 访问主页: ### 3. Remarkable -Remarkable 可能是 Linux 上最好的 Markdown 编辑器了,它也适用于 Windows 操作系统。它的确是是一个卓越且功能齐全的 Markdown 编辑器,为用户提供了一些令人兴奋的特性。 +Remarkable 可能是 Linux 上最好的 Markdown 编辑器了,它也适用于 Windows 操作系统。它的确是是一个卓越且功能齐全的 Markdown 编辑器,为用户提供了一些令人激动的特性。 一些卓越的特性: @@ -67,7 +65,8 @@ Remarkable 可能是 Linux 上最好的 Markdown 编辑器了,它也适用于 - 高可定制性和其他 ![](http://www.tecmint.com/wp-content/uploads/2016/07/Remarkable-Markdown-Editor-for-Linux.png) ->Remarkable Markdown Editor for Linux + +*Remarkable Markdown Editor for Linux* 访问主页: @@ -75,7 +74,6 @@ Remarkable 可能是 Linux 上最好的 Markdown 编辑器了,它也适用于 Haroopad 是为 Linux,Windows 和 Mac OS X 构建的跨平台 Markdown 文档处理程序。用户可以用它来书写许多专家级格式的文档,包括电子邮件、报告、博客、演示文稿和博客文章等等。 - 功能齐全且具备以下的亮点: - 轻松导入内容 @@ -86,9 +84,11 @@ Haroopad 是为 Linux,Windows 和 Mac OS X 构建的跨平台 Markdown 文档 - 为用户提供了一些令人兴奋的主题、皮肤和 UI 组件等等 ![](http://www.tecmint.com/wp-content/uploads/2016/07/Haroopad-Markdown-Editor-for-Linux.png) ->Haroopad Markdown Editor for Linux + +*Haroopad Markdown Editor for Linux* 访问主页: + ### 5. ReText ReText 是为 Linux 和其它几个 POSIX 兼容操作系统提供的简单、轻量、强大的 Markdown 编辑器。它还可以作为一个 reStructuredText 编辑器,并且具有以下的特性: @@ -100,29 +100,32 @@ ReText 是为 Linux 和其它几个 POSIX 兼容操作系统提供的简单、 - 启用导出扩展等等 ![](http://www.tecmint.com/wp-content/uploads/2016/07/ReText-Markdown-Editor-for-Linux.png) ->ReText Markdown Editor for Linux + +*ReText Markdown Editor for Linux* 访问主页: + ### 6. UberWriter UberWriter 是一个简单、易用的 Linux Markdown 编辑器。它的开发受 Mac OS X 上的 iA writer 影响很大,同样它也具备这些卓越的特性: -- 使用 pandoc 将所有的文本转为 HTML +- 使用 pandoc 进行所有的文本到 HTML 的转换 - 提供了一个简洁的 UI 界面 -- 提供了一种自由的分发模式,高亮用户的最后一句话 +- 提供了一种专心(distraction free)模式,高亮用户最后的句子 - 支持拼写检查 - 支持全屏模式 - 支持用 pandoc 导出 PDF、HTML 和 RTF - 启用语法高亮和数学函数等等 ![](http://www.tecmint.com/wp-content/uploads/2016/07/UberWriter-Markdown-Editor-for-Linux.png) ->UberWriter Markdown Editor for Linux + +*UberWriter Markdown Editor for Linux* 访问主页: + ### 7. Mark My Words -Mark My Words 同样也是一个轻量、强大的 Markdown 编辑器。它是一个相对比较新的编辑器,因此提供了大量的功能,包含语法高亮、简单和直观的 UI 等。 - +Mark My Words 同样也是一个轻量、强大的 Markdown 编辑器。它是一个相对比较新的编辑器,因此提供了包含语法高亮在内的大量的功能,简单和直观的 UI。 下面是一些棒极了,但还未捆绑到应用中的功能: @@ -131,13 +134,47 @@ Mark My Words 同样也是一个轻量、强大的 Markdown 编辑器。它是 - 状态管理 - 支持导出 PDF 和 HTML - 监测文件的修改 -- 支持首选项 +- 支持首选项设置 ![](http://www.tecmint.com/wp-content/uploads/2016/07/MarkMyWords-Markdown-Editor-for-Linux.png) ->MarkMyWords Markdown Editor for-Linux + +*MarkMyWords Markdown Editor for-Linux* 访问主页: +### 8. Vim-Instant-Markdown 插件 + +Vim 是 Linux 上的一个久经考验的强大、流行而开源的文本编辑器。它用于编程极棒。它也高度支持插件功能,可以让用户为其增加一些其它功能,包括 Markdown 预览。 + +有好几种 Vim 的 Markdown 预览插件,但是 [Vim-Instant-Markdown][2] 的表现最佳。 + +###9. Bracket-MarkdownPreview 插件 + +Brackets 是一个现代、轻量、开源且跨平台的文本编辑器。它特别为 Web 设计和开发而构建。它的一些重要功能包括:支持内联编辑器、实时预览、预处理支持及更多。 + +它也是通过插件高度可扩展的,你可以使用 [Bracket-MarkdownPreview][3] 插件来编写和预览 Markdown 文档。 + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Brackets-Markdown-Plugin.png) + +*Brackets Markdown Plugin Preview* + +### 10. SublimeText-Markdown 插件 + +Sublime Text 是一个精心打造的、流行的、跨平台文本编辑器,用于代码、markdown 和普通文本。它的表现极佳,包括如下令人兴奋的功能: + +- 简洁而美观的 GUI +- 支持多重选择 +- 提供专心模式 +- 支持窗体分割编辑 +- 通过 Python 插件 API 支持高度插件化 +- 完全可定制化,提供命令查找模式 + +[SublimeText-Markdown][4] 插件是一个支持格式高亮的软件包,带有一些漂亮的颜色方案。 + +![](http://www.tecmint.com/wp-content/uploads/2016/07/SublimeText-Markdown-Plugin-Preview.png) + +*SublimeText Markdown Plugin Preview* + ### 结论 通过上面的列表,你大概已经知道要为你的 Linux 桌面下载、安装什么样的 Markdown 编辑器和文档处理程序了。 @@ -149,10 +186,15 @@ Mark My Words 同样也是一个轻量、强大的 Markdown 编辑器。它是 via: http://www.tecmint.com/best-markdown-editors-for-linux/ -作者:[Aaron Kili |][a] +作者:[Aaron Kili][a] 译者:[Locez](https://github.com/locez) -校对:[校对者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/aaronkili/ +[1]: https://daringfireball.net/projects/markdown/ +[2]: https://github.com/suan/vim-instant-markdown +[3]: https://github.com/gruehle/MarkdownPreview +[4]: https://github.com/SublimeText-Markdown/MarkdownEditing + From 090244d91cd3d38f2be5d62ff01961ad25359e1d Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 28 Jul 2016 09:35:02 +0800 Subject: [PATCH 1268/1469] =?UTF-8?q?20160728-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ic Expressions and Assignment Operators.md | 271 ++++++++++++++++++ 1 file changed, 271 insertions(+) create mode 100644 sources/tech/awk/20160714 Part 8 - Learn How to Use Awk Variables, Numeric Expressions and Assignment Operators.md diff --git a/sources/tech/awk/20160714 Part 8 - Learn How to Use Awk Variables, Numeric Expressions and Assignment Operators.md b/sources/tech/awk/20160714 Part 8 - Learn How to Use Awk Variables, Numeric Expressions and Assignment Operators.md new file mode 100644 index 0000000000..be536df74f --- /dev/null +++ b/sources/tech/awk/20160714 Part 8 - Learn How to Use Awk Variables, Numeric Expressions and Assignment Operators.md @@ -0,0 +1,271 @@ +Learn How to Use Awk Variables, Numeric Expressions and Assignment Operators – part8 +======================================================================================= + +The [Awk command series][1] is getting exciting I believe, in the previous seven parts, we walked through some fundamentals of Awk that you need to master to enable you perform some basic text or string filtering in Linux. + +Starting with this part, we shall dive into advance areas of Awk to handle more complex text or string filtering operations. Therefore, we are going to cover Awk features such as variables, numeric expressions and assignment operators. + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Learn-Awk-Variables-Numeric-Expressions-Assignment-Operators.png) +>Learn Awk Variables, Numeric Expressions and Assignment Operators + +These concepts are not comprehensively distinct from the ones you may have probably encountered in many programming languages before such shell, C, Python plus many others, so there is no need to worry much about this topic, we are simply revising the common ideas of using these mentioned features. + +This will probably be one of the easiest Awk command sections to understand, so sit back and lets get going. + +### 1. Awk Variables + +In any programming language, a variable is a place holder which stores a value, when you create a variable in a program file, as the file is executed, some space is created in memory that will store the value you specify for the variable. + +You can define Awk variables in the same way you define shell variables as follows: + +``` +variable_name=value +``` + +In the syntax above: + +- `variable_name`: is the name you give a variable +- `value`: the value stored in the variable + +Let’s look at some examples below: + +``` +computer_name=”tecmint.com” +port_no=”22” +email=”admin@tecmint.com” +server=”computer_name” +``` + +Take a look at the simple examples above, in the first variable definition, the value `tecmint.com` is assigned to the variable `computer_name`. + +Furthermore, the value 22 is assigned to the variable port_no, it is also possible to assign the value of one variable to another variable as in the last example where we assigned the value of computer_name to the variable server. + +If you can recall, right from [part 2 of this Awk series][2] were we covered field editing, we talked about how Awk divides input lines into fields and uses standard field access operator, $ to read the different fields that have been parsed. We can also use variables to store the values of fields as follows. + +``` +first_name=$2 +second_name=$3 +``` + +In the examples above, the value of first_name is set to second field and second_name is set to the third field. + +As an illustration, consider a file named names.txt which contains a list of an application’s users indicating their first and last names plus gender. Using the [cat command][3], we can view the contents of the file as follows: + +``` +$ cat names.txt +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/07/List-File-Content-Using-cat-Command.png) +>List File Content Using cat Command + +Then, we can also use the variables first_name and second_name to store the first and second names of the first user on the list as by running the Awk command below: + +``` +$ awk '/Aaron/{ first_name=$2 ; second_name=$3 ; print first_name, second_name ; }' names.txt +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Store-Variables-Using-Awk-Command.png) +>Store Variables Using Awk Command + +Let us also take a look at another case, when you issue the command `uname -a` on your terminal, it prints out all your system information. + +The second field contains your `hostname`, therefore we can store the hostname in a variable called hostname and print it using Awk as follows: + +``` +$ uname -a +$ uname -a | awk '{hostname=$2 ; print hostname ; }' +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Store-Command-Output-to-Variable-Using-Awk.png) +>Store Command Output to Variable Using Awk + +### 2. Numeric Expressions + +In Awk, numeric expressions are built using the following numeric operators: + +- `*` : multiplication operator +- `+` : addition operator +- `/` : division operator +- `-` : subtraction operator +- `%` : modulus operator +- `^` : exponentiation operator + +The syntax for a numeric expressions is: + +``` +$ operand1 operator operand2 +``` + +In the form above, operand1 and operand2 can be numbers or variable names, and operator is any of the operators above. + +Below are some examples to demonstrate how to build numeric expressions: + +``` +counter=0 +num1=5 +num2=10 +num3=num2-num1 +counter=counter+1 +``` + +To understand the use of numeric expressions in Awk, we shall consider the following example below, with the file domains.txt which contains all domains owned by Tecmint. + +``` +news.tecmint.com +tecmint.com +linuxsay.com +windows.tecmint.com +tecmint.com +news.tecmint.com +tecmint.com +linuxsay.com +tecmint.com +news.tecmint.com +tecmint.com +linuxsay.com +windows.tecmint.com +tecmint.com +``` + +To view the contents of the file, use the command below: + +``` +$ cat domains.txt +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/07/View-Contents-of-File.png) +>View Contents of File + +If we want to count the number of times the domain tecmint.com appears in the file, we can write a simple script to do that as follows: + +``` +#!/bin/bash +for file in $@; do +if [ -f $file ] ; then +#print out filename +echo "File is: $file" +#print a number incrementally for every line containing tecmint.com +awk '/^tecmint.com/ { counter=counter+1 ; printf "%s\n", counter ; }' $file +else +#print error info incase input is not a file +echo "$file is not a file, please specify a file." >&2 && exit 1 +fi +done +#terminate script with exit code 0 in case of successful execution +exit 0 +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Shell-Script-to-Count-a-String-in-File.png) +>Shell Script to Count a String or Text in File + +After creating the script, save it and make it executable, when we run it with the file, domains.txt as out input, we get the following output: + +``` +$ ./script.sh ~/domains.txt +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Script-To-Count-String.png) +>Script to Count String or Text + +From the output of the script, there are 6 lines in the file domains.txt which contain tecmint.com, to confirm that you can manually count them. + +### 3. Assignment Operators + +The last Awk feature we shall cover is assignment operators, there are several assignment operators in Awk and these include the following: + +- `*=` : multiplication assignment operator +- `+=` : addition assignment operator +- `/=` : division assignment operator +- `-=` : subtraction assignment operator +- `%=` : modulus assignment operator +- `^=` : exponentiation assignment operator + +The simplest syntax of an assignment operation in Awk is as follows: + +``` +$ variable_name=variable_name operator operand +``` + +Examples: + +``` +counter=0 +counter=counter+1 +num=20 +num=num-1 +``` + +You can use the assignment operators above to shorten assignment operations in Awk, consider the previous examples, we could perform the assignment in the following form: + +``` +variable_name operator=operand +counter=0 +counter+=1 +num=20 +num-=1 +``` + +Therefore, we can alter the Awk command in the shell script we just wrote above using += assignment operator as follows: + +``` +#!/bin/bash +for file in $@; do +if [ -f $file ] ; then +#print out filename +echo "File is: $file" +#print a number incrementally for every line containing tecmint.com +awk '/^tecmint.com/ { counter+=1 ; printf "%s\n", counter ; }' $file +else +#print error info incase input is not a file +echo "$file is not a file, please specify a file." >&2 && exit 1 +fi +done +#terminate script with exit code 0 in case of successful execution +exit 0 +``` + + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Alter-Shell-Script.png) +>Alter Shell Script + +In this segment of the [Awk series][4], we covered some powerful Awk features, that is variables, building numeric expressions and using assignment operators, plus some few illustrations of how we can actually use them. + +These concepts are not any different from the one in other programming languages but there may be some significant distinctions under Awk programming. + +In part 9, we shall look at more Awk features that is special patterns: BEGIN and END. Until then, stay connected to Tecmint. + + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/learn-awk-variables-numeric-expressions-and-assignment-operators/ + +作者:[Aaron Kili][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/aaronkili/ + + + + + + + + + + + + + + + + + + + +[1]: http://www.tecmint.com/category/awk-command/ +[2]: http://www.tecmint.com/awk-print-fields-columns-with-space-separator/ +[3]: http://www.tecmint.com/13-basic-cat-command-examples-in-linux/ +[4]: http://www.tecmint.com/category/awk-command/ From 3e3543ad84824a7684ebb75023f4371533738a78 Mon Sep 17 00:00:00 2001 From: range Date: Thu, 28 Jul 2016 09:41:43 +0800 Subject: [PATCH 1269/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Variables, Numeric Expressions and Assignment Operators.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sources/tech/awk/20160714 Part 8 - Learn How to Use Awk Variables, Numeric Expressions and Assignment Operators.md b/sources/tech/awk/20160714 Part 8 - Learn How to Use Awk Variables, Numeric Expressions and Assignment Operators.md index be536df74f..d7cfd4c064 100644 --- a/sources/tech/awk/20160714 Part 8 - Learn How to Use Awk Variables, Numeric Expressions and Assignment Operators.md +++ b/sources/tech/awk/20160714 Part 8 - Learn How to Use Awk Variables, Numeric Expressions and Assignment Operators.md @@ -1,4 +1,8 @@ +vim-kakali translating + + Learn How to Use Awk Variables, Numeric Expressions and Assignment Operators – part8 + ======================================================================================= The [Awk command series][1] is getting exciting I believe, in the previous seven parts, we walked through some fundamentals of Awk that you need to master to enable you perform some basic text or string filtering in Linux. From 0212c3012db43a18551f8a5355028eef4bae7680 Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 28 Jul 2016 09:47:33 +0800 Subject: [PATCH 1270/1469] =?UTF-8?q?20160728-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... A DEMO UBUNTU VERSION IN A WEB BROWSER.md | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 sources/tech/20160721 YOU CAN TRY A DEMO UBUNTU VERSION IN A WEB BROWSER.md diff --git a/sources/tech/20160721 YOU CAN TRY A DEMO UBUNTU VERSION IN A WEB BROWSER.md b/sources/tech/20160721 YOU CAN TRY A DEMO UBUNTU VERSION IN A WEB BROWSER.md new file mode 100644 index 0000000000..7c40028c60 --- /dev/null +++ b/sources/tech/20160721 YOU CAN TRY A DEMO UBUNTU VERSION IN A WEB BROWSER.md @@ -0,0 +1,37 @@ +YOU CAN TRY A DEMO UBUNTU VERSION IN A WEB BROWSER +===================================================== + +Canonical, the parent company of Ubuntu, has put a lot of effort in popularizing Linux. No matter how much you dislike Ubuntu, but you have to accept that it has actually helped to make “Linux for human beings”. Ubuntu and its derivatives are the most used Linux distributions. + +In an effort to further popularize Ubuntu Linux, Canonical has put a website in place where you can use a [demo version of Ubuntu][1]. It will help you get the look and feel of Ubuntu. With that, it will be a little easier to make a decision about using Ubuntu for new users. + +You may argue that a live USB of Ubuntu will be better as it provides a far better experience without installing. I agree to that but keep in mind the effort to download the ISO, to create a live USB, change boot configuration and then using the live USB to experience. It’s tedious and not everyone is going to do that. An online tour is a simpler way out. + +So, what do you see in this online Ubuntu demo tour. Not a lot actually. + +You can browse files, you can use Unity Dash, you can experience Ubuntu Software Center, even install a few apps (they won’t be really installed), browse the File Manager and other such things. But that’s all. But in my opinion, it’s pretty nifty and does what it intends to do and that is provide a quick look at this popular OS. + +![](https://itsfoss.com/wp-content/uploads/2016/07/Ubuntu-online-demo.jpeg) + +![](https://itsfoss.com/wp-content/uploads/2016/07/Ubuntu-online-demo-1.jpeg) + +![](https://itsfoss.com/wp-content/uploads/2016/07/Ubuntu-online-demo-2.jpeg) + +If a friend or family ever asks you that he is interested in trying Linux and would like to experience it before installing, you can send her/him this link below: + +[Ubuntu Online Tour][0] + + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-online-demo/?utm_source=newsletter&utm_medium=email&utm_campaign=linux_and_open_source_stories_this_week + +作者:[Abhishek Prakash][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对ID](https://github.com/校对ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[0]: http://tour.ubuntu.com/en/ +[1]: http://tour.ubuntu.com/en/ From b8628099334cba9e402d33d92f4ce65584c5506f Mon Sep 17 00:00:00 2001 From: kokialoves <498497353@qq.com> Date: Thu, 28 Jul 2016 10:04:41 +0800 Subject: [PATCH 1271/1469] Update 20160721 YOU CAN TRY A DEMO UBUNTU VERSION IN A WEB BROWSER.md --- ...0160721 YOU CAN TRY A DEMO UBUNTU VERSION IN A WEB BROWSER.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160721 YOU CAN TRY A DEMO UBUNTU VERSION IN A WEB BROWSER.md b/sources/tech/20160721 YOU CAN TRY A DEMO UBUNTU VERSION IN A WEB BROWSER.md index 7c40028c60..6f52422a06 100644 --- a/sources/tech/20160721 YOU CAN TRY A DEMO UBUNTU VERSION IN A WEB BROWSER.md +++ b/sources/tech/20160721 YOU CAN TRY A DEMO UBUNTU VERSION IN A WEB BROWSER.md @@ -1,3 +1,4 @@ +[translating by kokialoves] YOU CAN TRY A DEMO UBUNTU VERSION IN A WEB BROWSER ===================================================== From e3e519c8a808f9d2d2be7bcafdbc4e9009162c6b Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 28 Jul 2016 11:13:49 +0800 Subject: [PATCH 1272/1469] PUB:20160705 Create Your Own Shell in Python - Part I @cposture --- ...reate Your Own Shell in Python - Part I.md | 82 +++++++++---------- 1 file changed, 41 insertions(+), 41 deletions(-) rename {translated/tech => published}/20160705 Create Your Own Shell in Python - Part I.md (67%) diff --git a/translated/tech/20160705 Create Your Own Shell in Python - Part I.md b/published/20160705 Create Your Own Shell in Python - Part I.md similarity index 67% rename from translated/tech/20160705 Create Your Own Shell in Python - Part I.md rename to published/20160705 Create Your Own Shell in Python - Part I.md index b54d0bff29..3aee650db0 100644 --- a/translated/tech/20160705 Create Your Own Shell in Python - Part I.md +++ b/published/20160705 Create Your Own Shell in Python - Part I.md @@ -1,7 +1,7 @@ -使用 Python 创建你自己的 Shell:Part I +使用 Python 创建你自己的 Shell (一) ========================================== -我很想知道一个 shell (像 bash,csh 等)内部是如何工作的。为了满足自己的好奇心,我使用 Python 实现了一个名为 **yosh** (Your Own Shell)的 Shell。本文章所介绍的概念也可以应用于其他编程语言。 +我很想知道一个 shell (像 bash,csh 等)内部是如何工作的。于是为了满足自己的好奇心,我使用 Python 实现了一个名为 **yosh** (Your Own Shell)的 Shell。本文章所介绍的概念也可以应用于其他编程语言。 (提示:你可以在[这里](https://github.com/supasate/yosh)查找本博文使用的源代码,代码以 MIT 许可证发布。在 Mac OS X 10.11.5 上,我使用 Python 2.7.10 和 3.4.3 进行了测试。它应该可以运行在其他类 Unix 环境,比如 Linux 和 Windows 上的 Cygwin。) @@ -20,15 +20,15 @@ yosh_project `yosh_project` 为项目根目录(你也可以把它简单命名为 `yosh`)。 -`yosh` 为包目录,且 `__init__.py` 可以使它成为与包目录名字相同的包(如果你不写 Python,可以忽略它。) +`yosh` 为包目录,且 `__init__.py` 可以使它成为与包的目录名字相同的包(如果你不用 Python 编写的话,可以忽略它。) `shell.py` 是我们主要的脚本文件。 ### 步骤 1:Shell 循环 -当启动一个 shell,它会显示一个命令提示符并等待你的命令输入。在接收了输入的命令并执行它之后(稍后文章会进行详细解释),你的 shell 会重新回到循环,等待下一条指令。 +当启动一个 shell,它会显示一个命令提示符并等待你的命令输入。在接收了输入的命令并执行它之后(稍后文章会进行详细解释),你的 shell 会重新回到这里,并循环等待下一条指令。 -在 `shell.py`,我们会以一个简单的 mian 函数开始,该函数调用了 shell_loop() 函数,如下: +在 `shell.py` 中,我们会以一个简单的 main 函数开始,该函数调用了 shell_loop() 函数,如下: ``` def shell_loop(): @@ -43,7 +43,7 @@ if __name__ == "__main__": main() ``` -接着,在 `shell_loop()`,为了指示循环是否继续或停止,我们使用了一个状态标志。在循环的开始,我们的 shell 将显示一个命令提示符,并等待读取命令输入。 +接着,在 `shell_loop()` 中,为了指示循环是否继续或停止,我们使用了一个状态标志。在循环的开始,我们的 shell 将显示一个命令提示符,并等待读取命令输入。 ``` import sys @@ -56,15 +56,15 @@ def shell_loop(): status = SHELL_STATUS_RUN while status == SHELL_STATUS_RUN: - # Display a command prompt + ### 显示命令提示符 sys.stdout.write('> ') sys.stdout.flush() - # Read command input + ### 读取命令输入 cmd = sys.stdin.readline() ``` -之后,我们切分命令输入并进行执行(我们即将实现`命令切分`和`执行`函数)。 +之后,我们切分命令(tokenize)输入并进行执行(execute)(我们即将实现 `tokenize` 和 `execute` 函数)。 因此,我们的 shell_loop() 会是如下这样: @@ -79,33 +79,33 @@ def shell_loop(): status = SHELL_STATUS_RUN while status == SHELL_STATUS_RUN: - # Display a command prompt + ### 显示命令提示符 sys.stdout.write('> ') sys.stdout.flush() - # Read command input + ### 读取命令输入 cmd = sys.stdin.readline() - # Tokenize the command input + ### 切分命令输入 cmd_tokens = tokenize(cmd) - # Execute the command and retrieve new status + ### 执行该命令并获取新的状态 status = execute(cmd_tokens) ``` -这就是我们整个 shell 循环。如果我们使用 `python shell.py` 启动我们的 shell,它会显示命令提示符。然而如果我们输入命令并按回车,它会抛出错误,因为我们还没定义`命令切分`函数。 +这就是我们整个 shell 循环。如果我们使用 `python shell.py` 启动我们的 shell,它会显示命令提示符。然而如果我们输入命令并按回车,它会抛出错误,因为我们还没定义 `tokenize` 函数。 为了退出 shell,可以尝试输入 ctrl-c。稍后我将解释如何以优雅的形式退出 shell。 -### 步骤 2:命令切分 +### 步骤 2:命令切分(tokenize) -当用户在我们的 shell 中输入命令并按下回车键,该命令将会是一个包含命令名称及其参数的很长的字符串。因此,我们必须切分该字符串(分割一个字符串为多个标记)。 +当用户在我们的 shell 中输入命令并按下回车键,该命令将会是一个包含命令名称及其参数的长字符串。因此,我们必须切分该字符串(分割一个字符串为多个元组)。 咋一看似乎很简单。我们或许可以使用 `cmd.split()`,以空格分割输入。它对类似 `ls -a my_folder` 的命令起作用,因为它能够将命令分割为一个列表 `['ls', '-a', 'my_folder']`,这样我们便能轻易处理它们了。 然而,也有一些类似 `echo "Hello World"` 或 `echo 'Hello World'` 以单引号或双引号引用参数的情况。如果我们使用 cmd.spilt,我们将会得到一个存有 3 个标记的列表 `['echo', '"Hello', 'World"']` 而不是 2 个标记的列表 `['echo', 'Hello World']`。 -幸运的是,Python 提供了一个名为 `shlex` 的库,它能够帮助我们效验如神地分割命令。(提示:我们也可以使用正则表达式,但它不是本文的重点。) +幸运的是,Python 提供了一个名为 `shlex` 的库,它能够帮助我们如魔法般地分割命令。(提示:我们也可以使用正则表达式,但它不是本文的重点。) ``` @@ -120,23 +120,23 @@ def tokenize(string): ... ``` -然后我们将这些标记发送到执行进程。 +然后我们将这些元组发送到执行进程。 ### 步骤 3:执行 -这是 shell 中核心和有趣的一部分。当 shell 执行 `mkdir test_dir` 时,到底发生了什么?(提示: `mkdir` 是一个带有 `test_dir` 参数的执行程序,用于创建一个名为 `test_dir` 的目录。) +这是 shell 中核心而有趣的一部分。当 shell 执行 `mkdir test_dir` 时,到底发生了什么?(提示: `mkdir` 是一个带有 `test_dir` 参数的执行程序,用于创建一个名为 `test_dir` 的目录。) -`execvp` 是涉及这一步的首个函数。在我们解释 `execvp` 所做的事之前,让我们看看它的实际效果。 +`execvp` 是这一步的首先需要的函数。在我们解释 `execvp` 所做的事之前,让我们看看它的实际效果。 ``` import os ... def execute(cmd_tokens): - # Execute command + ### 执行命令 os.execvp(cmd_tokens[0], cmd_tokens) - # Return status indicating to wait for next command in shell_loop + ### 返回状态以告知在 shell_loop 中等待下一个命令 return SHELL_STATUS_RUN ... @@ -144,11 +144,11 @@ def execute(cmd_tokens): 再次尝试运行我们的 shell,并输入 `mkdir test_dir` 命令,接着按下回车键。 -在我们敲下回车键之后,问题是我们的 shell 会直接退出而不是等待下一个命令。然而,目标正确地被创建。 +在我们敲下回车键之后,问题是我们的 shell 会直接退出而不是等待下一个命令。然而,目录正确地创建了。 因此,`execvp` 实际上做了什么? -`execvp` 是系统调用 `exec` 的一个变体。第一个参数是程序名字。`v` 表示第二个参数是一个程序参数列表(可变参数)。`p` 表示环境变量 `PATH` 会被用于搜索给定的程序名字。在我们上一次的尝试中,它将会基于我们的 `PATH` 环境变量查找`mkdir` 程序。 +`execvp` 是系统调用 `exec` 的一个变体。第一个参数是程序名字。`v` 表示第二个参数是一个程序参数列表(参数数量可变)。`p` 表示将会使用环境变量 `PATH` 搜索给定的程序名字。在我们上一次的尝试中,它将会基于我们的 `PATH` 环境变量查找`mkdir` 程序。 (还有其他 `exec` 变体,比如 execv、execvpe、execl、execlp、execlpe;你可以 google 它们获取更多的信息。) @@ -158,7 +158,7 @@ def execute(cmd_tokens): 因此,我们需要其他的系统调用来解决问题:`fork`。 -`fork` 会开辟新的内存并拷贝当前进程到一个新的进程。我们称这个新的进程为**子进程**,调用者进程为**父进程**。然后,子进程内存会被替换为被执行的程序。因此,我们的 shell,也就是父进程,可以免受内存替换的危险。 +`fork` 会分配新的内存并拷贝当前进程到一个新的进程。我们称这个新的进程为**子进程**,调用者进程为**父进程**。然后,子进程内存会被替换为被执行的程序。因此,我们的 shell,也就是父进程,可以免受内存替换的危险。 让我们看看修改的代码。 @@ -166,34 +166,34 @@ def execute(cmd_tokens): ... def execute(cmd_tokens): - # Fork a child shell process - # If the current process is a child process, its `pid` is set to `0` - # else the current process is a parent process and the value of `pid` - # is the process id of its child process. + ### 分叉一个子 shell 进程 + ### 如果当前进程是子进程,其 `pid` 被设置为 `0` + ### 否则当前进程是父进程的话,`pid` 的值 + ### 是其子进程的进程 ID。 pid = os.fork() if pid == 0: - # Child process - # Replace the child shell process with the program called with exec + ### 子进程 + ### 用被 exec 调用的程序替换该子进程 os.execvp(cmd_tokens[0], cmd_tokens) elif pid > 0: - # Parent process + ### 父进程 while True: - # Wait response status from its child process (identified with pid) + ### 等待其子进程的响应状态(以进程 ID 来查找) wpid, status = os.waitpid(pid, 0) - # Finish waiting if its child process exits normally - # or is terminated by a signal + ### 当其子进程正常退出时 + ### 或者其被信号中断时,结束等待状态 if os.WIFEXITED(status) or os.WIFSIGNALED(status): break - # Return status indicating to wait for next command in shell_loop + ### 返回状态以告知在 shell_loop 中等待下一个命令 return SHELL_STATUS_RUN ... ``` -当我们的父进程调用 `os.fork()`时,你可以想象所有的源代码被拷贝到了新的子进程。此时此刻,父进程和子进程看到的是相同的代码,且并行运行着。 +当我们的父进程调用 `os.fork()` 时,你可以想象所有的源代码被拷贝到了新的子进程。此时此刻,父进程和子进程看到的是相同的代码,且并行运行着。 如果运行的代码属于子进程,`pid` 将为 `0`。否则,如果运行的代码属于父进程,`pid` 将会是子进程的进程 id。 @@ -205,13 +205,13 @@ def execute(cmd_tokens): 现在,你可以尝试运行我们的 shell 并输入 `mkdir test_dir2`。它应该可以正确执行。我们的主 shell 进程仍然存在并等待下一条命令。尝试执行 `ls`,你可以看到已创建的目录。 -但是,这里仍有许多问题。 +但是,这里仍有一些问题。 第一,尝试执行 `cd test_dir2`,接着执行 `ls`。它应该会进入到一个空的 `test_dir2` 目录。然而,你将会看到目录并没有变为 `test_dir2`。 第二,我们仍然没有办法优雅地退出我们的 shell。 -我们将会在 [Part 2][1] 解决诸如此类的问题。 +我们将会在 [第二部分][1] 解决诸如此类的问题。 -------------------------------------------------------------------------------- @@ -219,8 +219,8 @@ def execute(cmd_tokens): via: https://hackercollider.com/articles/2016/07/05/create-your-own-shell-in-python-part-1/ 作者:[Supasate Choochaisri][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[cposture](https://github.com/cposture) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2ab589bf9da6bf62162970e1dc9c2d6ca150a810 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 28 Jul 2016 11:44:36 +0800 Subject: [PATCH 1273/1469] PUB:20160706 Create Your Own Shell in Python - Part II @cposture --- ...eate Your Own Shell in Python - Part II.md | 43 ++++++++----------- 1 file changed, 19 insertions(+), 24 deletions(-) rename {translated/tech => published}/20160706 Create Your Own Shell in Python - Part II.md (76%) diff --git a/translated/tech/20160706 Create Your Own Shell in Python - Part II.md b/published/20160706 Create Your Own Shell in Python - Part II.md similarity index 76% rename from translated/tech/20160706 Create Your Own Shell in Python - Part II.md rename to published/20160706 Create Your Own Shell in Python - Part II.md index 0f0cd6a878..9e66d5643c 100644 --- a/translated/tech/20160706 Create Your Own Shell in Python - Part II.md +++ b/published/20160706 Create Your Own Shell in Python - Part II.md @@ -1,17 +1,17 @@ -使用 Python 创建你自己的 Shell:Part II +使用 Python 创建你自己的 Shell(下) =========================================== -在[part 1][1] 中,我们已经创建了一个主要的 shell 循环、切分了的命令输入,以及通过 `fork` 和 `exec` 执行命令。在这部分,我们将会解决剩下的问题。首先,`cd test_dir2` 命令无法修改我们的当前目录。其次,我们仍无法优雅地从 shell 中退出。 +在[上篇][1]中,我们已经创建了一个 shell 主循环、切分了命令输入,以及通过 `fork` 和 `exec` 执行命令。在这部分,我们将会解决剩下的问题。首先,`cd test_dir2` 命令无法修改我们的当前目录。其次,我们仍无法优雅地从 shell 中退出。 ### 步骤 4:内置命令 -“cd test_dir2 无法修改我们的当前目录” 这句话是对的,但在某种意义上也是错的。在执行完该命令之后,我们仍然处在同一目录,从这个意义上讲,它是对的。然而,目录实际上已经被修改,只不过它是在子进程中被修改。 +“`cd test_dir2` 无法修改我们的当前目录” 这句话是对的,但在某种意义上也是错的。在执行完该命令之后,我们仍然处在同一目录,从这个意义上讲,它是对的。然而,目录实际上已经被修改,只不过它是在子进程中被修改。 -还记得我们 fork 了一个子进程,然后执行命令,执行命令的过程没有发生在父进程上。结果是我们只是改变了子进程的当前目录,而不是父进程的目录。 +还记得我们分叉(fork)了一个子进程,然后执行命令,执行命令的过程没有发生在父进程上。结果是我们只是改变了子进程的当前目录,而不是父进程的目录。 然后子进程退出,而父进程在原封不动的目录下继续运行。 -因此,这类与 shell 自己相关的命令必须是内置命令。它必须在 shell 进程中执行而没有分叉(forking)。 +因此,这类与 shell 自己相关的命令必须是内置命令。它必须在 shell 进程中执行而不是在分叉中(forking)。 #### cd @@ -35,7 +35,6 @@ yosh_project import os from yosh.constants import * - def cd(args): os.chdir(args[0]) @@ -66,23 +65,21 @@ SHELL_STATUS_RUN = 1 ```python ... -# Import constants +### 导入常量 from yosh.constants import * -# Hash map to store built-in function name and reference as key and value +### 使用哈希映射来存储内建的函数名及其引用 built_in_cmds = {} - def tokenize(string): return shlex.split(string) - def execute(cmd_tokens): - # Extract command name and arguments from tokens + ### 从元组中分拆命令名称与参数 cmd_name = cmd_tokens[0] cmd_args = cmd_tokens[1:] - # If the command is a built-in command, invoke its function with arguments + ### 如果该命令是一个内建命令,使用参数调用该函数 if cmd_name in built_in_cmds: return built_in_cmds[cmd_name](cmd_args) @@ -91,29 +88,29 @@ def execute(cmd_tokens): 我们使用一个 python 字典变量 `built_in_cmds` 作为哈希映射(hash map),以存储我们的内置函数。我们在 `execute` 函数中提取命令的名字和参数。如果该命令在我们的哈希映射中,则调用对应的内置函数。 -(提示:`built_in_cmds[cmd_name]` 返回能直接使用参数调用的函数引用的。) +(提示:`built_in_cmds[cmd_name]` 返回能直接使用参数调用的函数引用。) 我们差不多准备好使用内置的 `cd` 函数了。最后一步是将 `cd` 函数添加到 `built_in_cmds` 映射中。 ``` ... -# Import all built-in function references +### 导入所有内建函数引用 from yosh.builtins import * ... -# Register a built-in function to built-in command hash map +### 注册内建函数到内建命令的哈希映射中 def register_command(name, func): built_in_cmds[name] = func -# Register all built-in commands here +### 在此注册所有的内建命令 def init(): register_command("cd", cd) def main(): - # Init shell before starting the main loop + ###在开始主循环之前初始化 shell init() shell_loop() ``` @@ -138,7 +135,7 @@ from yosh.builtins.cd import * 我们需要一个可以修改 shell 状态为 `SHELL_STATUS_STOP` 的函数。这样,shell 循环可以自然地结束,shell 将到达终点而退出。 -和 `cd` 一样,如果我们在子进程中 fork 和执行 `exit` 函数,其对父进程是不起作用的。因此,`exit` 函数需要成为一个 shell 内置函数。 +和 `cd` 一样,如果我们在子进程中分叉并执行 `exit` 函数,其对父进程是不起作用的。因此,`exit` 函数需要成为一个 shell 内置函数。 让我们从这开始:在 `builtins` 目录下创建一个名为 `exit.py` 的新文件。 @@ -159,7 +156,6 @@ yosh_project ``` from yosh.constants import * - def exit(args): return SHELL_STATUS_STOP ``` @@ -173,11 +169,10 @@ from yosh.builtins.exit import * 最后,我们在 `shell.py` 中的 `init()` 函数注册 `exit` 命令。 - ``` ... -# Register all built-in commands here +### 在此注册所有的内建命令 def init(): register_command("cd", cd) register_command("exit", exit) @@ -193,7 +188,7 @@ def init(): 我希望你能像我一样享受创建 `yosh` (**y**our **o**wn **sh**ell)的过程。但我的 `yosh` 版本仍处于早期阶段。我没有处理一些会使 shell 崩溃的极端状况。还有很多我没有覆盖的内置命令。为了提高性能,一些非内置命令也可以实现为内置命令(避免新进程创建时间)。同时,大量的功能还没有实现(请看 [公共特性](http://tldp.org/LDP/Bash-Beginners-Guide/html/x7243.html) 和 [不同特性](http://www.tldp.org/LDP/intro-linux/html/x12249.html)) -我已经在 github.com/supasate/yosh 中提供了源代码。请随意 fork 和尝试。 +我已经在 https://github.com/supasate/yosh 中提供了源代码。请随意 fork 和尝试。 现在该是创建你真正自己拥有的 Shell 的时候了。 @@ -205,12 +200,12 @@ via: https://hackercollider.com/articles/2016/07/06/create-your-own-shell-in-pyt 作者:[Supasate Choochaisri][a] 译者:[cposture](https://github.com/cposture) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://disqus.com/by/supasate_choochaisri/ -[1]: https://hackercollider.com/articles/2016/07/05/create-your-own-shell-in-python-part-1/ +[1]: https://linux.cn/article-7624-1.html [2]: http://tldp.org/LDP/Bash-Beginners-Guide/html/x7243.html [3]: http://www.tldp.org/LDP/intro-linux/html/x12249.html [4]: https://github.com/supasate/yosh From dab654979b756ec209e172a61a2b1c1840940130 Mon Sep 17 00:00:00 2001 From: kokialoves <498497353@qq.com> Date: Thu, 28 Jul 2016 11:54:39 +0800 Subject: [PATCH 1274/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= =?UTF-8?q?=20(#4233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Delete 20160721 YOU CAN TRY A DEMO UBUNTU VERSION IN A WEB BROWSER.md * Create 20160721 YOU CAN TRY A DEMO UBUNTU VERSION IN A WEB BROWSER.md --- ... A DEMO UBUNTU VERSION IN A WEB BROWSER.md | 38 ------------------- ... A DEMO UBUNTU VERSION IN A WEB BROWSER.md | 37 ++++++++++++++++++ 2 files changed, 37 insertions(+), 38 deletions(-) delete mode 100644 sources/tech/20160721 YOU CAN TRY A DEMO UBUNTU VERSION IN A WEB BROWSER.md create mode 100644 translated/tech/20160721 YOU CAN TRY A DEMO UBUNTU VERSION IN A WEB BROWSER.md diff --git a/sources/tech/20160721 YOU CAN TRY A DEMO UBUNTU VERSION IN A WEB BROWSER.md b/sources/tech/20160721 YOU CAN TRY A DEMO UBUNTU VERSION IN A WEB BROWSER.md deleted file mode 100644 index 6f52422a06..0000000000 --- a/sources/tech/20160721 YOU CAN TRY A DEMO UBUNTU VERSION IN A WEB BROWSER.md +++ /dev/null @@ -1,38 +0,0 @@ -[translating by kokialoves] -YOU CAN TRY A DEMO UBUNTU VERSION IN A WEB BROWSER -===================================================== - -Canonical, the parent company of Ubuntu, has put a lot of effort in popularizing Linux. No matter how much you dislike Ubuntu, but you have to accept that it has actually helped to make “Linux for human beings”. Ubuntu and its derivatives are the most used Linux distributions. - -In an effort to further popularize Ubuntu Linux, Canonical has put a website in place where you can use a [demo version of Ubuntu][1]. It will help you get the look and feel of Ubuntu. With that, it will be a little easier to make a decision about using Ubuntu for new users. - -You may argue that a live USB of Ubuntu will be better as it provides a far better experience without installing. I agree to that but keep in mind the effort to download the ISO, to create a live USB, change boot configuration and then using the live USB to experience. It’s tedious and not everyone is going to do that. An online tour is a simpler way out. - -So, what do you see in this online Ubuntu demo tour. Not a lot actually. - -You can browse files, you can use Unity Dash, you can experience Ubuntu Software Center, even install a few apps (they won’t be really installed), browse the File Manager and other such things. But that’s all. But in my opinion, it’s pretty nifty and does what it intends to do and that is provide a quick look at this popular OS. - -![](https://itsfoss.com/wp-content/uploads/2016/07/Ubuntu-online-demo.jpeg) - -![](https://itsfoss.com/wp-content/uploads/2016/07/Ubuntu-online-demo-1.jpeg) - -![](https://itsfoss.com/wp-content/uploads/2016/07/Ubuntu-online-demo-2.jpeg) - -If a friend or family ever asks you that he is interested in trying Linux and would like to experience it before installing, you can send her/him this link below: - -[Ubuntu Online Tour][0] - - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/ubuntu-online-demo/?utm_source=newsletter&utm_medium=email&utm_campaign=linux_and_open_source_stories_this_week - -作者:[Abhishek Prakash][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对ID](https://github.com/校对ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[0]: http://tour.ubuntu.com/en/ -[1]: http://tour.ubuntu.com/en/ diff --git a/translated/tech/20160721 YOU CAN TRY A DEMO UBUNTU VERSION IN A WEB BROWSER.md b/translated/tech/20160721 YOU CAN TRY A DEMO UBUNTU VERSION IN A WEB BROWSER.md new file mode 100644 index 0000000000..d79969e3e7 --- /dev/null +++ b/translated/tech/20160721 YOU CAN TRY A DEMO UBUNTU VERSION IN A WEB BROWSER.md @@ -0,0 +1,37 @@ +你能在浏览器中运行UBUNTU +===================================================== + +Canonical, Ubuntu的母公司, 为Linux推广做了很多努力. 无论你有多么不喜欢 Ubuntu, 你必须承认它对 “Linux 易用性”的影响. Ubuntu 以及其衍生是应用最多的Linux版本 . + +为了进一步推广 Ubuntu Linux, Canonical 把它放到了浏览器里你可以再任何地方使用 [demo version of Ubuntu][1]. 它将帮你更好的体验 Ubuntu. 以便让新人更容易决定是否使用. + +你可能争辩说USB版的linux更好. 我同意但是你要知道你要下载ISO, 创建USB驱动, 修改配置文件. 并不是每个人都乐意这么干的. 在线体验是一个更好的选择. + +因此, 你能在Ubuntu在线看到什么. 实际上并不多. + +你可以浏览文件, 你可以使用 Unity Dash, 浏览 Ubuntu Software Center, 甚至装几个 apps (当然它们不会真的安装), 看一看文件浏览器 和其它一些东西. 以上就是全部了. 但是在我看来, 它是非常漂亮的 + +![](https://itsfoss.com/wp-content/uploads/2016/07/Ubuntu-online-demo.jpeg) + +![](https://itsfoss.com/wp-content/uploads/2016/07/Ubuntu-online-demo-1.jpeg) + +![](https://itsfoss.com/wp-content/uploads/2016/07/Ubuntu-online-demo-2.jpeg) + +如果你的朋友或者家人想试试Linux又不乐意安装, 你可以给他们以下链接: + +[Ubuntu Online Tour][0] + + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-online-demo/?utm_source=newsletter&utm_medium=email&utm_campaign=linux_and_open_source_stories_this_week + +作者:[Abhishek Prakash][a] +译者:[kokialoves](https://github.com/kokialoves) +校对:[校对ID](https://github.com/校对ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[0]: http://tour.ubuntu.com/en/ +[1]: http://tour.ubuntu.com/en/ From 49dde28c2e619cee0d8d541d3c8016af0b40379c Mon Sep 17 00:00:00 2001 From: KS Date: Thu, 28 Jul 2016 11:55:18 +0800 Subject: [PATCH 1275/1469] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=20(#4232)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Create 20160602 How to build and deploy a Facebook Messenger bot with Python and Flask.md * Delete 20160602 How to build and deploy a Facebook Messenger bot with Python and Flask.md --- ...ook Messenger bot with Python and Flask.md | 320 ------------------ ...ook Messenger bot with Python and Flask.md | 319 +++++++++++++++++ 2 files changed, 319 insertions(+), 320 deletions(-) delete mode 100644 sources/tech/20160602 How to build and deploy a Facebook Messenger bot with Python and Flask.md create mode 100644 translated/tech/20160602 How to build and deploy a Facebook Messenger bot with Python and Flask.md diff --git a/sources/tech/20160602 How to build and deploy a Facebook Messenger bot with Python and Flask.md b/sources/tech/20160602 How to build and deploy a Facebook Messenger bot with Python and Flask.md deleted file mode 100644 index 6ab74e3527..0000000000 --- a/sources/tech/20160602 How to build and deploy a Facebook Messenger bot with Python and Flask.md +++ /dev/null @@ -1,320 +0,0 @@ -wyangsun translating -How to build and deploy a Facebook Messenger bot with Python and Flask, a tutorial -========================================================================== - -This is my log of how I built a simple Facebook Messenger bot. The functionality is really simple, it’s an echo bot that will just print back to the user what they write. - -This is something akin to the Hello World example for servers, the echo server. - -The goal of the project is not to build the best Messenger bot, but rather to get a feel for what it takes to build a minimal bot and how everything comes together. - -- [Tech Stack][1] -- [Bot Architecture][2] -- [The Bot Server][3] -- [Deploying to Heroku][4] -- [Creating the Facebook App][5] -- [Conclusion][6] - -### Tech Stack - -The tech stack that was used is: - -- [Heroku][7] for back end hosting. The free-tier is more than enough for a tutorial of this level. The echo bot does not require any sort of data persistence so a database was not used. -- [Python][8] was the language of choice. The version that was used is 2.7 however it can easily be ported to Python 3 with minor alterations. -- [Flask][9] as the web development framework. It’s a very lightweight framework that’s perfect for small scale projects/microservices. -- Finally the [Git][10] version control system was used for code maintenance and to deploy to Heroku. -- Worth mentioning: [Virtualenv][11]. This python tool is used to create “environments” clean of python libraries so you can only install the necessary requirements and minimize the app footprint. - -### Bot Architecture - -Messenger bots are constituted by a server that responds to two types of requests: - -- GET requests are being used for authentication. They are sent by Messenger with an authentication code that you register on FB. -- POST requests are being used for the actual communication. The typical workflow is that the bot will initiate the communication by sending the POST request with the data of the message sent by the user, we will handle it, send a POST request of our own back. If that one is completed successfully (a 200 OK status is returned) we also respond with a 200 OK code to the initial Messenger request. -For this tutorial the app will be hosted on Heroku, which provides a nice and easy interface to deploy apps. As mentioned the free tier will suffice for this tutorial. - -After the app has been deployed and is running, we’ll create a Facebook app and link it to our app so that messenger knows where to send the requests that are meant for our bot. - -### The Bot Server -The basic server code was taken from the following [Chatbot][12] project by Github user [hult (Magnus Hult)][13], with a few modifications to the code to only echo messages and a couple bugfixes I came across. This is the final version of the server code: - -``` -from flask import Flask, request -import json -import requests - -app = Flask(__name__) - -# This needs to be filled with the Page Access Token that will be provided -# by the Facebook App that will be created. -PAT = '' - -@app.route('/', methods=['GET']) -def handle_verification(): - print "Handling Verification." - if request.args.get('hub.verify_token', '') == 'my_voice_is_my_password_verify_me': - print "Verification successful!" - return request.args.get('hub.challenge', '') - else: - print "Verification failed!" - return 'Error, wrong validation token' - -@app.route('/', methods=['POST']) -def handle_messages(): - print "Handling Messages" - payload = request.get_data() - print payload - for sender, message in messaging_events(payload): - print "Incoming from %s: %s" % (sender, message) - send_message(PAT, sender, message) - return "ok" - -def messaging_events(payload): - """Generate tuples of (sender_id, message_text) from the - provided payload. - """ - data = json.loads(payload) - messaging_events = data["entry"][0]["messaging"] - for event in messaging_events: - if "message" in event and "text" in event["message"]: - yield event["sender"]["id"], event["message"]["text"].encode('unicode_escape') - else: - yield event["sender"]["id"], "I can't echo this" - - -def send_message(token, recipient, text): - """Send the message text to recipient with id recipient. - """ - - r = requests.post("https://graph.facebook.com/v2.6/me/messages", - params={"access_token": token}, - data=json.dumps({ - "recipient": {"id": recipient}, - "message": {"text": text.decode('unicode_escape')} - }), - headers={'Content-type': 'application/json'}) - if r.status_code != requests.codes.ok: - print r.text - -if __name__ == '__main__': - app.run() -``` - -Let’s break down the code. The first part is the imports that will be needed: - -``` -from flask import Flask, request -import json -import requests -``` - -Next we define the two functions (using the Flask specific app.route decorators) that will handle the GET and POST requests to our bot. - -``` -@app.route('/', methods=['GET']) -def handle_verification(): - print "Handling Verification." - if request.args.get('hub.verify_token', '') == 'my_voice_is_my_password_verify_me': - print "Verification successful!" - return request.args.get('hub.challenge', '') - else: - print "Verification failed!" - return 'Error, wrong validation token' -``` - -The verify_token object that is being sent by Messenger will be declared by us when we create the Facebook app. We have to validate the one we are being have against itself. Finally we return the “hub.challenge” back to Messenger. - -The function that handles the POST requests is a bit more interesting. - -``` -@app.route('/', methods=['POST']) -def handle_messages(): - print "Handling Messages" - payload = request.get_data() - print payload - for sender, message in messaging_events(payload): - print "Incoming from %s: %s" % (sender, message) - send_message(PAT, sender, message) - return "ok" -``` - -When called we grab the massage payload, use function messaging_events to break it down and extract the sender user id and the actual message sent, generating a python iterator that we can loop over. Notice that in each request sent by Messenger it is possible to have more than one messages. - -``` -def messaging_events(payload): - """Generate tuples of (sender_id, message_text) from the - provided payload. - """ - data = json.loads(payload) - messaging_events = data["entry"][0]["messaging"] - for event in messaging_events: - if "message" in event and "text" in event["message"]: - yield event["sender"]["id"], event["message"]["text"].encode('unicode_escape') - else: - yield event["sender"]["id"], "I can't echo this" -``` - -While iterating over each message we call the send_message function and we perform the POST request back to Messnger using the Facebook Graph messages API. During this time we still have not responded to the original Messenger request which we are blocking. This can lead to timeouts and 5XX errors. - -The above was spotted during an outage due to a bug I came across, which was occurred when the user was sending emojis which are actual unicode ids, however Python was miss-encoding. We ended up sending back garbage. - -This POST request back to Messenger would never finish, and that in turn would cause 5XX status codes to be returned to the original request, rendering the service unusable. - -This was fixed by escaping the messages with `encode('unicode_escape')` and then just before we sent back the message decode it with `decode('unicode_escape')`. - -``` -def send_message(token, recipient, text): - """Send the message text to recipient with id recipient. - """ - - r = requests.post("https://graph.facebook.com/v2.6/me/messages", - params={"access_token": token}, - data=json.dumps({ - "recipient": {"id": recipient}, - "message": {"text": text.decode('unicode_escape')} - }), - headers={'Content-type': 'application/json'}) - if r.status_code != requests.codes.ok: - print r.text -``` - -### Deploying to Heroku - -Once the code was built to my liking it was time for the next step. -Deploy the app. - -Sure, but how? - -I have deployed apps before to Heroku (mainly Rails) however I was always following a tutorial of some sort, so the configuration has already been created. In this case though I had to start from scratch. - -Fortunately it was the official [Heroku documentation][14] to the rescue. The article explains nicely the bare minimum required for running an app. - -Long story short, what we need besides our code are two files. The first file is the “requirements.txt” file which is a list of of the library dependencies required to run the application. - -The second file required is the “Procfile”. This file is there to inform the Heroku how to run our service. Again the bare minimum needed for this file is the following: - ->web: gunicorn echoserver:app - -The way this will be interpreted by heroku is that our app is started by running the echoserver.py file and the app will be using gunicorn as the web server. The reason we are using an additional webserver is performance related and is explained in the above Heroku documentation: - ->Web applications that process incoming HTTP requests concurrently make much more efficient use of dyno resources than web applications that only process one request at a time. Because of this, we recommend using web servers that support concurrent request processing whenever developing and running production services. - ->The Django and Flask web frameworks feature convenient built-in web servers, but these blocking servers only process a single request at a time. If you deploy with one of these servers on Heroku, your dyno resources will be underutilized and your application will feel unresponsive. - ->Gunicorn is a pure-Python HTTP server for WSGI applications. It allows you to run any Python application concurrently by running multiple Python processes within a single dyno. It provides a perfect balance of performance, flexibility, and configuration simplicity. - -Going back to our “requirements.txt” file let’s see how it binds with the Virtualenv tool that was mentioned. - -At anytime, your developement machine may have a number of python libraries installed. When deploying applications you don’t want to have these libraries loaded as it makes it hard to make out which ones you actually use. - -What Virtualenv does is create a new blank virtual enviroment so that you can only install the libraries that your app requires. - -You can check which libraries are currently installed by running the following command: - -``` -kostis@KostisMBP ~ $ pip freeze -cycler==0.10.0 -Flask==0.10.1 -gunicorn==19.6.0 -itsdangerous==0.24 -Jinja2==2.8 -MarkupSafe==0.23 -matplotlib==1.5.1 -numpy==1.10.4 -pyparsing==2.1.0 -python-dateutil==2.5.0 -pytz==2015.7 -requests==2.10.0 -scipy==0.17.0 -six==1.10.0 -virtualenv==15.0.1 -Werkzeug==0.11.10 -``` - -Note: The pip tool should already be installed on your machine along with Python. - -If not check the [official site][15] for how to install it. - -Now let’s use Virtualenv to create a new blank enviroment. First we create a new folder for our project, and change dir into it: - -``` -kostis@KostisMBP projects $ mkdir echoserver -kostis@KostisMBP projects $ cd echoserver/ -kostis@KostisMBP echoserver $ -``` - -Now let’s create a new enviroment called echobot. To activate it you run the following source command, and checking with pip freeze we can see that it’s now empty. - -``` -kostis@KostisMBP echoserver $ virtualenv echobot -kostis@KostisMBP echoserver $ source echobot/bin/activate -(echobot) kostis@KostisMBP echoserver $ pip freeze -(echobot) kostis@KostisMBP echoserver $ -``` - -We can start installing the libraries required. The ones we’ll need are flask, gunicorn, and requests and with them installed we create the requirements.txt file: - -``` -(echobot) kostis@KostisMBP echoserver $ pip install flask -(echobot) kostis@KostisMBP echoserver $ pip install gunicorn -(echobot) kostis@KostisMBP echoserver $ pip install requests -(echobot) kostis@KostisMBP echoserver $ pip freeze -click==6.6 -Flask==0.11 -gunicorn==19.6.0 -itsdangerous==0.24 -Jinja2==2.8 -MarkupSafe==0.23 -requests==2.10.0 -Werkzeug==0.11.10 -(echobot) kostis@KostisMBP echoserver $ pip freeze > requirements.txt -``` - -After all the above have been run, we create the echoserver.py file with the python code and the Procfile with the command that was mentioned, and we should end up with the following files/folders: - -``` -(echobot) kostis@KostisMBP echoserver $ ls -Procfile echobot echoserver.py requirements.txt -``` - -We are now ready to upload to Heroku. We need to do two things. The first is to install the Heroku toolbet if it’s not already installed on your system (go to [Heroku][16] for details). The second is to create a new Heroku app through the [web interface][17]. - -Click on the big plus sign on the top right and select “Create new app”. - - - - - - - - --------------------------------------------------------------------------------- - -via: http://tsaprailis.com/2016/06/02/How-to-build-and-deploy-a-Facebook-Messenger-bot-with-Python-and-Flask-a-tutorial/ - -作者:[Konstantinos Tsaprailis][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://github.com/kostistsaprailis -[1]: http://tsaprailis.com/2016/06/02/How-to-build-and-deploy-a-Facebook-Messenger-bot-with-Python-and-Flask-a-tutorial/#tech-stack -[2]: http://tsaprailis.com/2016/06/02/How-to-build-and-deploy-a-Facebook-Messenger-bot-with-Python-and-Flask-a-tutorial/#bot-architecture -[3]: http://tsaprailis.com/2016/06/02/How-to-build-and-deploy-a-Facebook-Messenger-bot-with-Python-and-Flask-a-tutorial/#the-bot-server -[4]: http://tsaprailis.com/2016/06/02/How-to-build-and-deploy-a-Facebook-Messenger-bot-with-Python-and-Flask-a-tutorial/#deploying-to-heroku -[5]: http://tsaprailis.com/2016/06/02/How-to-build-and-deploy-a-Facebook-Messenger-bot-with-Python-and-Flask-a-tutorial/#creating-the-facebook-app -[6]: http://tsaprailis.com/2016/06/02/How-to-build-and-deploy-a-Facebook-Messenger-bot-with-Python-and-Flask-a-tutorial/#conclusion -[7]: https://www.heroku.com -[8]: https://www.python.org -[9]: http://flask.pocoo.org -[10]: https://git-scm.com -[11]: https://virtualenv.pypa.io/en/stable -[12]: https://github.com/hult/facebook-chatbot-python -[13]: https://github.com/hult -[14]: https://devcenter.heroku.com/articles/python-gunicorn -[15]: https://pip.pypa.io/en/stable/installing -[16]: https://toolbelt.heroku.com -[17]: https://dashboard.heroku.com/apps - - diff --git a/translated/tech/20160602 How to build and deploy a Facebook Messenger bot with Python and Flask.md b/translated/tech/20160602 How to build and deploy a Facebook Messenger bot with Python and Flask.md new file mode 100644 index 0000000000..5ad4e62816 --- /dev/null +++ b/translated/tech/20160602 How to build and deploy a Facebook Messenger bot with Python and Flask.md @@ -0,0 +1,319 @@ +如何用Python和Flask建立部署一个Facebook信使机器人教程 +========================================================================== + +这是我建立一个简单的Facebook信使机器人的记录。功能很简单,他是一个回显机器人,只是打印回用户写了什么。 + +回显服务器类似于服务器的“Hello World”例子。 + +这个项目的目的不是建立最好的信使机器人,而是获得建立一个小型机器人和每个事物是如何整合起来的感觉。 + +- [技术栈][1] +- [机器人架构][2] +- [机器人服务器][3] +- [部署到 Heroku][4] +- [创建 Facebook 应用][5] +- [结论][6] + +### 技术栈 + +使用到的技术栈: + +- [Heroku][7] 做后端主机。免费层足够这个等级的教程。回显机器人不需要任何种类的数据持久,所以不需要数据库。 +- [Python][8] 是选择的一个语言。版本选择2.7,虽然它移植到 Pyhton 3 很容易,只需要很少的改动。 +- [Flask][9] 作为网站开发框架。它是非常轻量的框架,用在小型工程或微服务是完美的。 +- 最后 [Git][10] 版本控制系统用来维护代码和部署到 Heroku。 +- 值得一提:[Virtualenv][11]。这个 python 工具是用来创建清洁的 python 库“环境”的,你只用安装必要的需求和最小化的应用封装。 + +### 机器人架构 + +信使机器人是由一个服务器组成,响应两种请求: + +- GET 请求被用来认证。他们与你注册的 FB 认证码一同被信使发出。 +- POST 请求被用来真实的通信。传统的工作流是,机器人将通过发送 POST 请求与用户发送的消息数据建立通信,我们将处理它,发送一个我们自己的 POST 请求回去。如果这一个完全成功(返回一个200 OK 状态)我们也响应一个200 OK 码给初始信使请求。 +这个教程应用将托管到Heroku,他提供了一个很好并且简单的接口来部署应用。如前所述,免费层可以满足这个教程。 + +在应用已经部署并且运行后,我们将创建一个 Facebook 应用然后连接它到我们的应用,以便信使知道发送请求到哪,这就是我们的机器人。 + +### 机器人服务器 + +基本的服务器代码可以在Github用户 [hult(Magnus Hult)][13] 的 [Chatbot][12] 工程上获取,经过一些代码修改只回显消息和一些我遇到的错误更正。最终版本的服务器代码: + +``` +from flask import Flask, request +import json +import requests + +app = Flask(__name__) + +# 这需要填写被授予的页面通行令牌 +# 通过 Facebook 应用创建令牌。 +PAT = '' + +@app.route('/', methods=['GET']) +def handle_verification(): + print "Handling Verification." + if request.args.get('hub.verify_token', '') == 'my_voice_is_my_password_verify_me': + print "Verification successful!" + return request.args.get('hub.challenge', '') + else: + print "Verification failed!" + return 'Error, wrong validation token' + +@app.route('/', methods=['POST']) +def handle_messages(): + print "Handling Messages" + payload = request.get_data() + print payload + for sender, message in messaging_events(payload): + print "Incoming from %s: %s" % (sender, message) + send_message(PAT, sender, message) + return "ok" + +def messaging_events(payload): + """Generate tuples of (sender_id, message_text) from the + provided payload. + """ + data = json.loads(payload) + messaging_events = data["entry"][0]["messaging"] + for event in messaging_events: + if "message" in event and "text" in event["message"]: + yield event["sender"]["id"], event["message"]["text"].encode('unicode_escape') + else: + yield event["sender"]["id"], "I can't echo this" + + +def send_message(token, recipient, text): + """Send the message text to recipient with id recipient. + """ + + r = requests.post("https://graph.facebook.com/v2.6/me/messages", + params={"access_token": token}, + data=json.dumps({ + "recipient": {"id": recipient}, + "message": {"text": text.decode('unicode_escape')} + }), + headers={'Content-type': 'application/json'}) + if r.status_code != requests.codes.ok: + print r.text + +if __name__ == '__main__': + app.run() +``` + +让我们分解代码。第一部分是引入所需: + +``` +from flask import Flask, request +import json +import requests +``` + +接下来我们定义两个函数(使用 Flask 特定的 app.route 装饰器),用来处理到我们的机器人的 GET 和 POST 请求。 + +``` +@app.route('/', methods=['GET']) +def handle_verification(): + print "Handling Verification." + if request.args.get('hub.verify_token', '') == 'my_voice_is_my_password_verify_me': + print "Verification successful!" + return request.args.get('hub.challenge', '') + else: + print "Verification failed!" + return 'Error, wrong validation token' +``` + +当我们创建 Facebook 应用时声明由信使发送的 verify_token 对象。我们必须对自己进行认证。最后我们返回“hub.challenge”给信使。 + +处理 POST 请求的函数更有趣 + +``` +@app.route('/', methods=['POST']) +def handle_messages(): + print "Handling Messages" + payload = request.get_data() + print payload + for sender, message in messaging_events(payload): + print "Incoming from %s: %s" % (sender, message) + send_message(PAT, sender, message) + return "ok" +``` + +当调用我们抓取的消息负载时,使用函数 messaging_events 来中断它并且提取发件人身份和真实发送消息,生成一个 python 迭代器循环遍历。请注意信使发送的每个请求有可能多于一个消息。 + +``` +def messaging_events(payload): + """Generate tuples of (sender_id, message_text) from the + provided payload. + """ + data = json.loads(payload) + messaging_events = data["entry"][0]["messaging"] + for event in messaging_events: + if "message" in event and "text" in event["message"]: + yield event["sender"]["id"], event["message"]["text"].encode('unicode_escape') + else: + yield event["sender"]["id"], "I can't echo this" +``` + +迭代完每个消息时我们调用send_message函数然后我们执行POST请求回给使用Facebook图形消息接口信使。在这期间我们一直没有回应我们阻塞的原始信使请求。这会导致超时和5XX错误。 + +上述的发现错误是中断期间我偶然发现的,当用户发送表情时其实的是当成了 unicode 标识,无论如何 Python 发生了误编码。我们以发送回垃圾结束。 + +这个 POST 请求回到信使将不会结束,这会导致发生5xx状态返回给原始的请求,显示服务不可用。 + +通过使用`encode('unicode_escape')`转义消息然后在我们发送回消息前用`decode('unicode_escape')`解码消息就可以解决。 + +``` +def send_message(token, recipient, text): + """Send the message text to recipient with id recipient. + """ + + r = requests.post("https://graph.facebook.com/v2.6/me/messages", + params={"access_token": token}, + data=json.dumps({ + "recipient": {"id": recipient}, + "message": {"text": text.decode('unicode_escape')} + }), + headers={'Content-type': 'application/json'}) + if r.status_code != requests.codes.ok: + print r.text +``` + +### 部署到 Heroku + +一旦代码已经建立成我想要的样子时就可以进行下一步。部署应用。 + +当然,但是怎么做? + +我之前已经部署了应用到 Heroku (主要是 Rails)然而我总是遵循某种教程,所以配置已经创建。在这种情况下,尽管我必须从头开始。 + +幸运的是有官方[Heroku文档][14]来帮忙。这篇文章很好地说明了运行应用程序所需的最低限度。 + +长话短说,我们需要的除了我们的代码还有两个文件。第一个文件是“requirements.txt”他列出了运行应用所依赖的库。 + +需要的第二个文件是“Procfile”。这个文件通知 Heroku 如何运行我们的服务。此外这个文件最低限度如下: + +>web: gunicorn echoserver:app + +heroku解读他的方式是我们的应用通过运行 echoserver.py 开始并且应用将使用 gunicorn 作为网站服务器。我们使用一个额外的网站服务器是因为与性能相关并在上面的Heroku文档里解释了: + +>Web 应用程序并发处理传入的HTTP请求比一次只处理一个请求的Web应用程序,更有效利地用动态资源。由于这个原因,我们建议使用支持并发请求的 web 服务器处理开发和生产运行的服务。 + +>Django 和 Flask web 框架特性方便内建 web 服务器,但是这些阻塞式服务器一个时刻只处理一个请求。如果你部署这种服务到 Heroku上,你的动态资源不会充分使用并且你的应用会感觉迟钝。 + +>Gunicorn 是一个纯 Python HTTP 的 WSGI 引用服务器。允许你在单独一个动态资源内通过并发运行多 Python 进程的方式运行任一 Python 应用。它提供了一个完美性能,弹性,简单配置的平衡。 + +回到我们提到的“requirements.txt”文件,让我们看看它如何结合 Virtualenv 工具。 + +在任何时候,你的开发机器也许有若干已安装的 python 库。当部署应用时你不想这些库被加载因为很难辨认出你实际使用哪些库。 + +Virtualenv 创建一个新的空白虚拟环境,因此你可以只安装你应用需要的库。 + +你可以检查当前安装使用哪些库的命令如下: + +``` +kostis@KostisMBP ~ $ pip freeze +cycler==0.10.0 +Flask==0.10.1 +gunicorn==19.6.0 +itsdangerous==0.24 +Jinja2==2.8 +MarkupSafe==0.23 +matplotlib==1.5.1 +numpy==1.10.4 +pyparsing==2.1.0 +python-dateutil==2.5.0 +pytz==2015.7 +requests==2.10.0 +scipy==0.17.0 +six==1.10.0 +virtualenv==15.0.1 +Werkzeug==0.11.10 +``` + +注意:pip 工具应该已经与 Python 一起安装在你的机器上。 + +如果没有,查看[官方网站][15]如何安装他。 + +现在让我们使用 Virtualenv 来创建一个新的空白环境。首先我们给我们的工程创建一个新文件夹,然后进到目录下: + +``` +kostis@KostisMBP projects $ mkdir echoserver +kostis@KostisMBP projects $ cd echoserver/ +kostis@KostisMBP echoserver $ +``` + +现在来创建一个叫做 echobot 新的环境。运行下面的 source 命令激活它,然后使用 pip freeze 检查,我们能看到现在是空的。 + +``` +kostis@KostisMBP echoserver $ virtualenv echobot +kostis@KostisMBP echoserver $ source echobot/bin/activate +(echobot) kostis@KostisMBP echoserver $ pip freeze +(echobot) kostis@KostisMBP echoserver $ +``` + +我们可以安装需要的库。我们需要是 flask,gunicorn,和 requests,他们被安装完我们就创建 requirements.txt 文件: + +``` +(echobot) kostis@KostisMBP echoserver $ pip install flask +(echobot) kostis@KostisMBP echoserver $ pip install gunicorn +(echobot) kostis@KostisMBP echoserver $ pip install requests +(echobot) kostis@KostisMBP echoserver $ pip freeze +click==6.6 +Flask==0.11 +gunicorn==19.6.0 +itsdangerous==0.24 +Jinja2==2.8 +MarkupSafe==0.23 +requests==2.10.0 +Werkzeug==0.11.10 +(echobot) kostis@KostisMBP echoserver $ pip freeze > requirements.txt +``` + +毕竟上文已经被运行,我们用 python 代码创建 echoserver.py 文件然后用之前提到的命令创建 Procfile,我们应该以下面的文件/文件夹结束: + +``` +(echobot) kostis@KostisMBP echoserver $ ls +Procfile echobot echoserver.py requirements.txt +``` + +我们现在准备上传到 Heroku。我们需要做两件事。第一是安装 Heroku toolbet 如果你还没安装到你的系统中(详细看[Heroku][16])。第二通过[网页接口][17]创建一个新的 Heroku 应用。 + +点击右上的大加号然后选择“Create new app”。 + + + + + + + + +-------------------------------------------------------------------------------- + +via: http://tsaprailis.com/2016/06/02/How-to-build-and-deploy-a-Facebook-Messenger-bot-with-Python-and-Flask-a-tutorial/ + +作者:[Konstantinos Tsaprailis][a] +译者:[wyangsun](https://github.com/wyangsun) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://github.com/kostistsaprailis +[1]: http://tsaprailis.com/2016/06/02/How-to-build-and-deploy-a-Facebook-Messenger-bot-with-Python-and-Flask-a-tutorial/#tech-stack +[2]: http://tsaprailis.com/2016/06/02/How-to-build-and-deploy-a-Facebook-Messenger-bot-with-Python-and-Flask-a-tutorial/#bot-architecture +[3]: http://tsaprailis.com/2016/06/02/How-to-build-and-deploy-a-Facebook-Messenger-bot-with-Python-and-Flask-a-tutorial/#the-bot-server +[4]: http://tsaprailis.com/2016/06/02/How-to-build-and-deploy-a-Facebook-Messenger-bot-with-Python-and-Flask-a-tutorial/#deploying-to-heroku +[5]: http://tsaprailis.com/2016/06/02/How-to-build-and-deploy-a-Facebook-Messenger-bot-with-Python-and-Flask-a-tutorial/#creating-the-facebook-app +[6]: http://tsaprailis.com/2016/06/02/How-to-build-and-deploy-a-Facebook-Messenger-bot-with-Python-and-Flask-a-tutorial/#conclusion +[7]: https://www.heroku.com +[8]: https://www.python.org +[9]: http://flask.pocoo.org +[10]: https://git-scm.com +[11]: https://virtualenv.pypa.io/en/stable +[12]: https://github.com/hult/facebook-chatbot-python +[13]: https://github.com/hult +[14]: https://devcenter.heroku.com/articles/python-gunicorn +[15]: https://pip.pypa.io/en/stable/installing +[16]: https://toolbelt.heroku.com +[17]: https://dashboard.heroku.com/apps + + From d31c18f5a45e58df54066e34310a58ad2efe2836 Mon Sep 17 00:00:00 2001 From: range Date: Thu, 28 Jul 2016 12:53:36 +0800 Subject: [PATCH 1276/1469] =?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 --- ...0718 Creating your first Git repository.md | 181 ---------------- ...0718 Creating your first Git repository.md | 199 ++++++++++++++++++ 2 files changed, 199 insertions(+), 181 deletions(-) delete mode 100644 sources/tech/20160718 Creating your first Git repository.md create mode 100644 translated/tech/20160718 Creating your first Git repository.md diff --git a/sources/tech/20160718 Creating your first Git repository.md b/sources/tech/20160718 Creating your first Git repository.md deleted file mode 100644 index 4ec9b0aace..0000000000 --- a/sources/tech/20160718 Creating your first Git repository.md +++ /dev/null @@ -1,181 +0,0 @@ -vim-kakali translating - - - -Creating your first Git repository -====================================== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/open_abstract_pieces.jpg?itok=ZRt0Db00) - -Now it is time to learn how to create your own Git repository, and how to add files and make commits. - -In the previous installments in this series, you learned how to interact with Git as an end user; you were the aimless wanderer who stumbled upon an open source project's website, cloned a repository, and moved on with your life. You learned that interacting with Git wasn't as confusing as you may have thought it would be, and maybe you've been convinced that it's time to start leveraging Git for your own work. - -While Git is definitely the tool of choice for major software projects, it doesn't only work with major software projects. It can manage your grocery lists (if they're that important to you, and they may be!), your configuration files, a journal or diary, a novel in progress, and even source code! - -And it is well worth doing; after all, when have you ever been angry that you have a backup copy of something that you've just mangled beyond recognition? - -Git can't work for you unless you use it, and there's no time like the present. Or, translated to Git, "There is no push like origin HEAD". You'll understand that later, I promise. - -### The audio recording analogy - -We tend to speak of computer imaging in terms of snapshots because most of us can identify with the idea of having a photo album filled with particular moments in time. It may be more useful, however, to think of Git more like an analogue audio recording. - -A traditional studio tape deck, in case you're unfamiliar, has a few components: it contains the reels that turn either forward or in reverse, tape to preserve sound waves, and a playhead to record or detect sound waves on tape and present them to the listener. - -In addition to playing a tape forward, you can rewind it to get back to a previous point in the tape, or fast-forward to skip ahead to a later point. - -Imagine a band in the 1970s recording to tape. You can imagine practising a song over and over until all the parts are perfect, and then laying down a track. First, you record the drums, and then the bass, and then the guitar, and then the vocals. Each time you record, the studio engineer rewinds the tape and puts it into loop mode so that it plays the previous part as you play yours; that is, if you're on bass, you get to hear the drums in the background as you play, and then the guitarist hears the drums and bass (and cowbell) and so on. On each loop, you play over the part, and then on the following loop, the engineer hits the record button and lays the performance down on tape. - -You can also copy and swap out a reel of tape entirely, should you decide to do a re-mix of something you're working on. - -Now that I've hopefully painted a vivid Roger Dean-quality image of studio life in the 70s, let's translate that into Git. - -### Create a Git repository - -The first step is to go out and buy some tape for our virtual tape deck. In Git terms, that's the repository ; it's the medium or domain where all the work is going to live. - -Any directory can become a Git repository, but to begin with let's start a fresh one. It takes three commands: - -- Create the directory (you can do that in your GUI file manager, if you prefer). -- Visit that directory in a terminal. -- Initialise it as a directory managed by Git. - -Specifically, run these commands: - -``` -$ mkdir ~/jupiter # make directory -$ cd ~/jupiter # change into the new directory -$ git init . # initialise your new Git repo -``` - -Is this example, the folder jupiter is now an empty but valid Git repository. - -That's all it takes. You can clone the repository, you can go backward and forward in history (once it has a history), create alternate timelines, and everything else Git can normally do. - -Working inside the Git repository is the same as working in any directory; create files, copy files into the directory, save files into it. You can do everything as normal; Git doesn't get involved until you involve it. - -In a local Git repository, a file can have one of three states: - -- Untracked: a file you create in a repository, but not yet added to Git. -- Tracked: a file that has been added to Git. -- Staged: a tracked file that has been changed and added to Git's commit queue. - -Any file that you add to a Git repository starts life out as an untracked file. The file exists on your computer, but you have not told Git about it yet. In our tape deck analogy, the tape deck isn't even turned on yet; the band is just noodling around in the studio, nowhere near ready to record yet. - -That is perfectly acceptable, and Git will let you know when it happens: - -``` -$ echo "hello world" > foo -$ git status -On branch master -Untracked files: -(use "git add ..." to include in what will be committed) - foo -nothing added but untracked files present (use "git add" to track) -``` - -As you can see, Git also tells you how to start tracking files. - -### Git without Git - -Creating a repository in GitHub or GitLab is a lot more clicky and pointy. It isn't difficult; you click the New Repository button and follow the prompts. - -It is a good practice to include a README file so that people wandering by have some notion of what your repository is for, and it is a little more satisfying to clone a non-empty repository. - -Cloning the repository is no different than usual, but obtaining permission to write back into that repository on GitHub is slightly more complex, because in order to authenticate to GitHub you must have an SSH key. If you're on Linux, create one with this command: - -``` -$ ssh-keygen -``` - -Then copy your new key, which is plain text. You can open it in a plain text editor, or use the cat command: - -``` -$ cat ~/.ssh/id_rsa.pub -``` - -Now paste your key into [GitHub's SSH configuration][1], or your [GitLab configuration][2]. - -As long as you clone your GitHub project via SSH, you'll be able to write back to your repository. - -Alternately, you can use GitHub's file uploader interface to add files without even having Git on your system. - -![](https://opensource.com/sites/default/files/2_githubupload.jpg) - -### Tracking files - -As the output of git status tells you, if you want Git to start tracking a file, you must git add it. The git add action places a file in a special staging area, where files wait to be committed, or preserved for posterity in a snapshot. The point of a git add is to differentiate between files that you want to have included in a snapshot, and the new or temporary files you want Git to, at least for now, ignore. - -In our tape deck analogy, this action turns the tape deck on and arms it for recording. You can picture the tape deck with the record and pause button pushed, or in a playback loop awaiting the next track to be laid down. - -Once you add a file, Git will identify it as a tracked file: - -``` -$ git add foo -$ git status -On branch master -Changes to be committed: -(use "git reset HEAD ..." to unstage) -new file: foo -``` - -Adding a file to Git's tracking system is not making a recording. It just puts a file on the stage in preparation for recording. You can still change a file after you've added it; it's being tracked and remains staged, so you can continue to refine it or change it before committing it to tape (but be warned; you're NOT recording yet, so if you break something in a file that was perfect, there's no going back in time yet, because you never got that perfect moment on tape). - -If you decide that the file isn't really ready to be recorded in the annals of Git history, then you can unstage something, just as the Git message described: - -``` -$ git reset HEAD foo -``` - -This, in effect, disarms the tape deck from being ready to record, and you're back to just noodling around in the studio. - -### The big commit - -At some point, you're going to want to commit something; in our tape deck analogy, that means finally pressing record and laying a track down on tape. - -At different stages of a project's life, how often you press that record button varies. For example, if you're hacking your way through a new Python toolkit and finally manage to get a window to appear, then you'll certainly want to commit so you have something to fall back on when you inevitably break it later as you try out new display options. But if you're working on a rough draft of some new graphics in Inkscape, you might wait until you have something you want to develop from before committing. Ultimately, though, it's up to you how often you commit; Git doesn't "cost" that much and hard drives these days are big, so in my view, the more the better. - -A commit records all staged files in a repository. Git only records files that are tracked, that is, any file that you did a git add on at some point in the past. and that have been modified since the previous commit. If no previous commit exists, then all tracked files are included in the commit because they went from not existing to existing, which is a pretty major modification from Git's point-of-view. - -To make a commit, run this command: - -``` -$ git commit -m 'My great project, first commit.' -``` - -This preserves all files committed for posterity (or, if you speak Gallifreyan, they become "fixed points in time"). You can see not only the commit event, but also the reference pointer back to that commit in your Git log: - -``` -$ git log --oneline -55df4c2 My great project, first commit. -``` - -For a more detailed report, just use git log without the --oneline option. - -The reference number for the commit in this example is 55df4c2. It's called a commit hash and it represents all of the new material you just recorded, overlaid onto previous recordings. If you need to "rewind" back to that point in history, you can use that hash as a reference. - -You can think of a commit hash as [SMPTE timecode][3] on an audio tape, or if we bend the analogy a little, one of those big gaps between songs on a vinyl record, or track numbers on a CD. - -As you change files further and add them to the stage, and ultimately commit them, you accrue new commit hashes, each of which serve as pointers to different versions of your production. - -And that's why they call Git a version control system, Charlie Brown. - -In the next article, we'll explore everything you need to know about the Git HEAD, and we'll nonchalantly reveal the secret of time travel. No big deal, but you'll want to read it (or maybe you already have?). - - - --------------------------------------------------------------------------------- - -via: https://opensource.com/life/16/7/creating-your-first-git-repository - -作者:[Seth Kenlon][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[1]: https://github.com/settings/keys -[2]: https://gitlab.com/profile/keys -[3]: http://slackermedia.ml/handbook/doku.php?id=timecode diff --git a/translated/tech/20160718 Creating your first Git repository.md b/translated/tech/20160718 Creating your first Git repository.md new file mode 100644 index 0000000000..35382aba55 --- /dev/null +++ b/translated/tech/20160718 Creating your first Git repository.md @@ -0,0 +1,199 @@ + + +建立你的第一个仓库 +====================================== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/open_abstract_pieces.jpg?itok=ZRt0Db00) + + +现在是时候学习怎样创建你自己的仓库了,还有怎样增加文件和完成提交。 + +在本系列前面文章的安装过程中,你已经学习了作为一个目标用户怎样与 Git 进行交互;你就像一个漫无目的的流浪者一样偶然发现了一个开源项目网站,然后克隆了仓库,Git 走进了你的生活。学习怎样和 Git 进行交互并不像你想的那样困难,或许你并不确信现在是否应该使用 Git 完成你的工作。 + + +Git 被认为是选择大多软件项目的工具,它不仅能够完成大多软件项目的工作;它也能管理你杂乱项目的列表(如果他们不重要,也可以这样说!),你的配置文件,一个日记,项目进展日志,甚至源代码! + +使用 Git 是很有必要的,毕竟,你肯定有因为一个备份文件不能够辨认出版本信息而烦恼的时候。 + +你不使用 Git,它也就不会为你工作,或者也可以把 Git 理解为“没有任何推送就像源头指针一样”【译注: HEAD 可以理解为“头指针”,是当前工作区的“基础版本”,当执行提交时, HEAD 指向的提交将作为新提交的父提交。】。我保证,你很快就会对 Git 有所了解 。 + + +### 类比于录音 + + +我们更喜欢谈论快照上的图像,因为很多人都可以通过一个相册很快辨认出每个照片上特有的信息。这可能很有用,然而,我认为 Git 更像是在进行声音的记录。 + +传统的录音机,可能你对于它的部件不是很清楚:它包含转轴并且正转或反转,使用磁带保存声音波形,通过放音头记录声音并保存到磁带上然后播放给收听者。 + + +除了往前退磁带,你也可以把磁带多绕几圈到磁带前面的部分,或快进跳过前面的部分到最后。 + +想象一下 70 年代的磁带录制的声音。你可能想到那会正在反复练习一首歌直到非常完美,它们最终被记录下来了。起初,你记录了鼓声,低音,然后是吉他声,还有其他的声音。每次你录音,工作人员都会把磁带重绕并设置为环绕模式,这样在你演唱的时候录音磁带就会播放之前录制的声音。如果你是低音歌唱,你唱歌的时候就需要把有鼓声的部分作为背景音乐,然后就是吉他声、鼓声、低音(和牛铃声【译注:一种打击乐器,状如四棱锥。】)等等。在每一环,你完成了整个部分,到了下一环,工作人员就开始在磁带上制作你的演唱作品。 + + +你也可以拷贝或换出整个磁带,这是你需要继续录音并且进行多次混合的时候需要做的。 + + +现在我希望对于上述 70 年代的录音工作的描述足够生动,我们就可以把 Git 的工作想象成一个录音磁带了。 + + +### 新建一个 Git 仓库 + + +首先得为我们的虚拟的录音机买一些磁带。在 Git 术语中,这就是仓库;它是完成所有工作的基础,也就是说这里是存放 Git 文件的地方(即 Git 工作区)。 + +任何目录都可以是一个 Git 仓库,但是在开始的时候需要进行一次更新。需要下面三个命令: + + +- 创建目录(如果你喜欢的话,你可以在你的 GUI 文件管理器里面完成。) +- 在终端里查看目录。 +- 初始化这个目录使它可以被 Git管理。 + + +特别是运行如下代码: + +``` +$ mkdir ~/jupiter # 创建目录 +$ cd ~/jupiter # 进入目录 +$ git init . # 初始化你的新 Git 工作区 +``` + + +在这个例子中,文件夹 jupiter 是空的但却成为了你的 Git 仓库。 + +有了仓库接下来的事件就按部就班了。你可以克隆项目仓库,你可以在一个历史点前后来回穿梭(前提是你有一个历史点),创建可交替时间线,然后剩下的工作 Git 就都能正常完成了。 + + +在 Git 仓库里面工作和在任何目录里面工作都是一样的;在仓库中新建文件,复制文件,保存文件。你可以像平常一样完成工作;Git 并不复杂,除非你把它想复杂了。 + +在本地的 Git 仓库中,一个文件可以有下面这三种状态: +- 未跟踪文件:你在仓库里新建了一个文件,但是你没有把文件加入到 Git 的提交任务(提交暂存区,stage)中。 +- 已跟踪文件:已经加入到 Git 暂存区的文件。 +- 暂存区文件:存在于暂存区的文件已经加入到 Git 的提交队列中。 + + +任何你新加入到 Git 仓库中的文件都是未跟踪文件。文件还保存在你的电脑硬盘上,但是你没有告诉 Git 这是需要提交的文件,就像我们的录音机,如果你没有打开录音机;乐队开始演唱了,但是录音机并没有准备录音。 + +不用担心,Git 会告诉你存在的问题并提示你怎么解决: +``` +$ echo "hello world" > foo +$ git status +位于您当前工作的分支 master 上 +未跟踪文件: +(使用 "git add " 更新要提交的内容) + foo +没有任何提交任务,但是存在未跟踪文件(用 "git add" 命令加入到提交任务) +``` + + +你看到了,Git 会提醒你怎样把文件加入到提交任务中。 + +### 不使用 Git 命令进行 Git 操作 + + +在 GitHub 或 GitLab(译注:GitLab 是一个用于仓库管理系统的开源项目。使用Git作为代码管理工具,并在此基础上搭建起来的web服务。)上创建一个仓库大多是使用鼠标点击完成的。这不会很难,你单击 New Repository 这个按钮就会很快创建一个仓库。 + +在仓库中新建一个 README 文件是一个好习惯,这样人们在浏览你的仓库的时候就可以知道你的仓库基于什么项目,更有用的是通过 README 文件可以确定克隆的是否为一个非空仓库。 + + +克隆仓库通常很简单,但是在 GitHub 上获取仓库改动权限就不简单了,为了进行用户验证你必须有一个 SSH 秘钥。如果你使用 Linux 系统,通过下面的命令可以生成一个秘钥: +``` +$ ssh-keygen +``` + + +复制纯文本文件里的秘钥。你可以使用一个文本编辑器打开它,也可以使用 cat 命令: + +``` +$ cat ~/.ssh/id_rsa.pub +``` + + +现在把你的秘钥拷贝到 [GitHub SSH 配置文件][1] 中,或者 [GitLab 配置文件[2]。 + +如果你通过使用 SSH 模式克隆了你的项目,就可以在你的仓库开始工作了。 + +另外,如果你的系统上没有安装 Git 的话也可以使用 GitHub 的文件上传接口来克隆仓库。 + +![](https://opensource.com/sites/default/files/2_githubupload.jpg) + + +### 跟踪文件 + +命令 git status 的输出会告诉你如果你想让 git 跟踪一个文件,你必须使用命令 git add 把它加入到提交任务中。这个命令把文件存在了暂存区,暂存区存放的都是等待提交的文件,或者把仓库保存为一个快照。git add 命令的最主要目的是为了区分你已经保存在仓库快照里的文件,还有新建的或你想提交的临时文件,至少现在,你都不用为它们之间的不同之处而费神了。 + +类比大型录音机,这个动作就像打开录音机开始准备录音一样。你可以按已经录音的录音机上的 pause 按钮来完成推送,或者拉下重置环等待开始跟踪下一个文件。 + +如果你把文件加入到提交任务中,Git 会自动标识为跟踪文件: + +``` +$ git add foo +$ git status +位于您当前工作的分支 master 上 +下列修改将被提交: +(使用 "git reset HEAD ..." 将下列改动撤出提交任务) +新增文件:foo +``` + + +加入文件到提交任务中并不会生成一个记录。这仅仅是为了之后方便记录而把文件存放到暂存区。在你把文件加入到提交任务后仍然可以修改文件;文件会被标记为跟踪文件并且存放到暂存区,所以你在最终提交之前都可以改动文件或撤出提交任务(但是请注意:你并没有记录文件,所以如果你完全改变了文件就没有办法撤销了,因为你没有记住最终修改的准确时间。)。 + +如果你决定不把文件记录到 Git 历史列表中,那么你可以撤出提交任务,在 Git 中是这样做的: +``` +$ git reset HEAD foo +``` + + +这实际上就是删除了录音机里面的录音,你只是在工作区转了一圈而已而已。 + +### 大型提交 + +有时候,你会需要完成很多提交;我们以录音机类比,这就好比按下录音键并最终按下保存键一样。 + +在一个项目从建立到完成,你会按记录键无数次。比如,如果你通过你的方式使用一个新的 Python 工具包并且最终实现了窗口展示,然后你就很肯定的提交了文件,但是不可避免的你最后会发生一些错误,现在你却不能撤销你的提交操作了。 + +一次提交会记录仓库中所有的暂存区文件。Git 只记录加入到提交任务中的文件,也就是说在过去某个时刻你使用 git add 命令加入到暂存区的所有文件。还有从先前的提交开始被改动的文件。如果没有其他的提交,所有的跟踪文件都包含在这次提交中,因为在浏览 Git 历史点的时候,它们没有存在于仓库中。 + +完成一次提交需要运行下面的命令: +``` +$ git commit -m 'My great project, first commit.' +``` + +这就保存了所有需要在仓库中提交的文件(或者,如果你说到 Gallifreyan【译注:英国电视剧《神秘博士》里的时间领主使用的一种优雅的语言,】,它们可能就是“固定的时间点” )。你不仅能看到整个提交记录,还能通过 git log 命令查看修改日志找到提交时的版本号: +``` +$ git log --oneline +55df4c2 My great project, first commit. +``` + + +如果想浏览更多信息,只需要使用不带 --oneline 选项的 git log 命令。 + + +在这个例子中提交时的版本号是 55df4c2。它被叫做 commit hash(译注:一个SHA-1生成的哈希码,用于表示一个git commit对象。),它表示着刚才你的提交包含的所有改动,覆盖了先前的记录。如果你想要“倒回”到你的提交历史点上就可以用这个 commit hash 作为依据。 + +你可以把 commit hash 想象成一个声音磁带上的 [SMPTE timecode][3],或者再夸张一点,这就是好比一个黑胶唱片两首不同的歌之间的不同点,或是一个 CD 上的轨段编号。 + + +你在很久前改动了文件并且把它们加入到提交任务中,最终完成提交,这就会生成新的 commit hashes,每个 commit hashes 标示的历史点都代表着你的产品不同的版本。 + + +这就是 Charlie Brown 把 Git 称为版本控制系统的原因。 + +在接下来的文章中,我们将会讨论你需要知道的关于 Git HEAD 的一切,我们不准备讨论关于 Git 的提交历史问题。基本不会提及,但是你可能会需要了解它(或许你已经有所了解?)。 + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/16/7/creating-your-first-git-repository + +作者:[Seth Kenlon][a] +译者:[vim-kakali](https://github.com/vim-kakali) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[1]: https://github.com/settings/keys +[2]: https://gitlab.com/profile/keys +[3]: http://slackermedia.ml/handbook/doku.php?id=timecode From e05b6e265869065180e827fe2b02da50377036ed Mon Sep 17 00:00:00 2001 From: ChrisLeeGit Date: Thu, 28 Jul 2016 15:55:58 +0800 Subject: [PATCH 1277/1469] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0160630 What makes up the Fedora kernel.md | 35 ------------------- ...0160630 What makes up the Fedora kernel.md | 31 ++++++++++++++++ 2 files changed, 31 insertions(+), 35 deletions(-) delete mode 100644 sources/tech/20160630 What makes up the Fedora kernel.md create mode 100644 translated/tech/20160630 What makes up the Fedora kernel.md diff --git a/sources/tech/20160630 What makes up the Fedora kernel.md b/sources/tech/20160630 What makes up the Fedora kernel.md deleted file mode 100644 index 603aefa575..0000000000 --- a/sources/tech/20160630 What makes up the Fedora kernel.md +++ /dev/null @@ -1,35 +0,0 @@ -Being translated by ChrisLeeGit - -What makes up the Fedora kernel? -==================================== - -![](https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/kernel-945x400.png) - -Every Fedora system runs a kernel. Many pieces of code come together to make this a reality. - -Each release of the Fedora kernel starts with a baseline release from the [upstream community][1]. This is often called a ‘vanilla’ kernel. The upstream kernel is the standard. The goal is to have as much code upstream as possible. This makes it easier for bug fixes and API updates to happen as well as having more people review the code. In an ideal world, Fedora would be able to to take the kernel straight from kernel.org and send that out to all users. - -Realistically, using the vanilla kernel isn’t complete enough for Fedora. Some features Fedora users want may not be available. The [Fedora kernel][2] that users actually receive contains a number of patches on top of the vanilla kernel. These patches are considered ‘out of tree’. Many of these patches will not exist out of tree patches very long. If patches are available to fix an issue, the patches may be pulled in to the Fedora tree so the fix can go out to users faster. When the kernel is rebased to a new version, the patches will be removed if they are in the new version. - -Some patches remain in the Fedora kernel tree for an extended period of time. A good example of patches that fall into this category are the secure boot patches. These patches provide a feature Fedora wants to support even though the upstream community has not yet accepted them. It takes effort to keep these patches up to date so Fedora tries to minimize the number of patches that are carried without being accepted by an upstream kernel maintainer. - -Generally, the best way to get a patch included in the Fedora kernel is to send it to the ]Linux Kernel Mailing List (LKML)][3] first and then ask for it to be included in Fedora. If a patch has been accepted by a maintainer it stands a very high chance of being included in the Fedora kernel tree. Patches that come from places like github which have not been submitted to LKML are unlikely to be taken into the tree. It’s important to send the patches to LKML first to ensure Fedora is carrying the correct patches in its tree. Without the community review, Fedora could end up carrying patches which are buggy and cause problems. - -The Fedora kernel contains code from many places. All of it is necessary to give the best experience possible. - - - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/makes-fedora-kernel/ - -作者:[Laura Abbott][a] -译者:[ChrisLeeGit](https://github.com/chrisleegit) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/makes-fedora-kernel/ -[1]: http://www.kernel.org/ -[2]: http://pkgs.fedoraproject.org/cgit/rpms/kernel.git/ -[3]: http://www.labbott.name/blog/2015/10/02/the-art-of-communicating-with-lkml/ diff --git a/translated/tech/20160630 What makes up the Fedora kernel.md b/translated/tech/20160630 What makes up the Fedora kernel.md new file mode 100644 index 0000000000..954c4cb440 --- /dev/null +++ b/translated/tech/20160630 What makes up the Fedora kernel.md @@ -0,0 +1,31 @@ +Fedora 内核是由什么构成的? +==================================== + +![](https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/kernel-945x400.png) + +每个 Fedora 系统都运行着一个内核。许多代码段组合在一起使之成为现实。 + +每个 Fedora 内核都起始于一个来自于 [上游社区][1] 的基线版本,通常称之为 vanilla 内核。上游内核就是标准。(Fedora 的)目标是包含尽可能多的上游代码,这样使得 bug 修复和 API 更新更加容易,同时也会有更多的人审查代码。理想情况下,Fedora 能够直接从 kernel.org 获得内核,然后发送给所有用户。 + +现实情况是,使用 vanilla 内核并不能完全满足 Fedora。Vanilla 内核可能并不支持一些 Fedora 用户希望拥有的功能。用户接收的 [Fedora 内核] 是在 vanilla 内核之上打了很多补丁的内核。这些补丁被认为“不在树上”。许多这些位于补丁树之外的补丁都不会存在太久。如果某补丁能够修复一个问题,那么该补丁可能会被合并到 Fedora 树,以便用户能够更快地收到修复。当内核变基到一个新版本时,在新版本中的补丁都将被清除。 + +一些补丁会在 Fedora 内核树上存在很长时间。一个很好的例子是,安全启动补丁就是这类补丁。这些补丁提供了 Fedora 希望支持的功能,即使上游社区还没有接受它们。保持这些补丁更新是需要付出很多努力的,所以 Fedora 尝试减少不被上游内核维护者接受的补丁数量。 + +通常来说,想要在 Fedora 内核中获得一个补丁的最佳方法是先给 [Linux 内核邮件列表(LKML)][3] 发送补丁,然后请求将该补丁包含到 Fedora 中。如果某个维护者接受了补丁,就意味着 Fedora 内核树中将来很有可能会包含该补丁。一些来自于 GitHub 等地方的还没有提交给 LKML 的补丁是不可能进入内核树的。首先向 LKML 发送补丁是非常重要的,它能确保 Fedora 内核树中携带的补丁是功能正常的。如果没有社区审查,Fedora 最终携带的补丁将会充满 bug 并会导致问题。 + +Fedora 内核中包含的代码来自许多地方。一切都需要提供最佳的体验。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/makes-fedora-kernel/ + +作者:[Laura Abbott][a] +译者:[ChrisLeeGit](https://github.com/chrisleegit) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/makes-fedora-kernel/ +[1]: http://www.kernel.org/ +[2]: http://pkgs.fedoraproject.org/cgit/rpms/kernel.git/ +[3]: http://www.labbott.name/blog/2015/10/02/the-art-of-communicating-with-lkml/ From 018abadd1c026f23d7607880765102b4546b840f Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 28 Jul 2016 16:55:15 +0800 Subject: [PATCH 1278/1469] PUB:20160621 Container technologies in Fedora - systemd-nspawn MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @ChrisLeeGit 翻译的很好! --- ...technologies in Fedora - systemd-nspawn.md | 38 +++++++++++-------- 1 file changed, 22 insertions(+), 16 deletions(-) rename {translated/tech => published}/20160621 Container technologies in Fedora - systemd-nspawn.md (61%) diff --git a/translated/tech/20160621 Container technologies in Fedora - systemd-nspawn.md b/published/20160621 Container technologies in Fedora - systemd-nspawn.md similarity index 61% rename from translated/tech/20160621 Container technologies in Fedora - systemd-nspawn.md rename to published/20160621 Container technologies in Fedora - systemd-nspawn.md index f47d17556a..69cbf688d8 100644 --- a/translated/tech/20160621 Container technologies in Fedora - systemd-nspawn.md +++ b/published/20160621 Container technologies in Fedora - systemd-nspawn.md @@ -4,19 +4,20 @@ Fedora 中的容器技术:systemd-nspawn 欢迎来到“Fedora 中的容器技术”系列!本文是该系列文章中的第一篇,它将说明你可以怎样使用 Fedora 中各种可用的容器技术。本文将学习 `systemd-nspawn` 的相关知识。 ### 容器是什么? -一个容器就是一个用户空间实例,它能够在与托管容器的系统(叫做宿主系统)隔离的环境中运行一个程序或者一个操作系统。这和 `chroot` 或 [虚拟机][1] 的思想非常类似。 -运行在容器中的进程是由与宿主操作系统相同的内核来管理的,但它们是与宿主文件系统以及其它进程隔离开的。 +一个容器就是一个用户空间实例,它能够在与托管容器的系统(叫做宿主系统)相隔离的环境中运行一个程序或者一个操作系统。这和 `chroot` 或 [虚拟机][1] 的思想非常类似。运行在容器中的进程是由与宿主操作系统相同的内核来管理的,但它们是与宿主文件系统以及其它进程隔离开的。 ### 什么是 systemd-nspawn? -systemd 项目认为应当将容器技术变成桌面的基础部分,并且应当和剩余的用户系统集成在一起。为此,systemd 提供了 `systemd-nspawn`,这款工具能够使用多种 Linux 技术创建容器。它也提供了一些容器管理工具。 -`systemd-nspawn` 和 `chroot` 在许多方面都是类似的,但是前者更加强大。它虚拟化了文件系统、进程树以及客户系统中的进程间通信。它的引力在于它提供了很多用于管理容器的工具,例如 `machinectl`。由 `systemd-nspawn` 运行的容器将会与 systemd 组件一同运行在宿主系统上。举例来说,一个容器的日志可以输出到宿主系统的日志中。 +systemd 项目认为应当将容器技术变成桌面的基础部分,并且应当和用户的其余系统集成在一起。为此,systemd 提供了 `systemd-nspawn`,这款工具能够使用多种 Linux 技术创建容器。它也提供了一些容器管理工具。 -在 Fedora 24 上,`systemd-nspawn` 已经和 systemd 软件包分开了,所以你需要安装 `systemd-container` 软件包。一如往常,你可以使用 `dnf install systemd-container` 进行安装。 +`systemd-nspawn` 和 `chroot` 在许多方面都是类似的,但是前者更加强大。它虚拟化了文件系统、进程树以及客户系统中的进程间通信。它的吸引力在于它提供了很多用于管理容器的工具,例如用来管理容器的 `machinectl`。由 `systemd-nspawn` 运行的容器将会与 systemd 组件一同运行在宿主系统上。举例来说,一个容器的日志可以输出到宿主系统的日志中。 + +在 Fedora 24 上,`systemd-nspawn` 已经从 systemd 软件包分离出来了,所以你需要安装 `systemd-container` 软件包。一如往常,你可以使用 `dnf install systemd-container` 进行安装。 ### 创建容器 -使用 `systemd-nspawn` 创建一个容器是很容易的。假设你有一个专门为 Debian 创造的应用,并且无法在其它地方正常运行。那并不是一个问题,我们可以创造一个容器!为了设置容器使用最新版本的 Debian(此时是 Jessie),你需要挑选一个目录来放置你的系统。我暂时将使用目录 `~/DebianJessie`。 + +使用 `systemd-nspawn` 创建一个容器是很容易的。假设你有一个专门为 Debian 创造的应用,并且无法在其它发行版中正常运行。那并不是一个问题,我们可以创造一个容器!为了设置容器使用最新版本的 Debian(现在是 Jessie),你需要挑选一个目录来放置你的系统。我暂时将使用目录 `~/DebianJessie`。 一旦你创建完目录,你需要运行 `debootstrap`,你可以从 Fedora 仓库中安装它。对于 Debian Jessie,你运行下面的命令来初始化一个 Debian 文件系统。 @@ -32,9 +33,9 @@ $ debootstrap --arch=amd64 stable ~/DebianJessie $ systemd-nspawn -bD ~/DebianJessie ``` -容器将会在数秒后准备好并运行,当你一尝试登录就会注意到:你无法在你的系统上使用任何账户。这是因为 `systemd-nspawn` 虚拟化了用户。修复的方法很简单:将之前的命令中的 `-b` 移除即可。你将直接进入容器的 root shell。此时,你只能使用 `passwd` 命令为 root 设置密码,或者使用 `adduser` 命令添加一个新用户。一旦设置好密码或添加好用户,你就可以把 `-b` 标志添加回去然后继续了。你会进入到熟悉的登录控制台,然后你使用设置好的认证信息登录进去。 +容器将会在数秒后准备好并运行,当你试图登录时就会注意到:你无法使用你的系统上任何账户。这是因为 `systemd-nspawn` 虚拟化了用户。修复的方法很简单:将之前的命令中的 `-b` 移除即可。你将直接进入容器的 root 用户的 shell。此时,你只能使用 `passwd` 命令为 root 设置密码,或者使用 `adduser` 命令添加一个新用户。一旦设置好密码或添加好用户,你就可以把 `-b` 标志添加回去然后继续了。你会进入到熟悉的登录控制台,然后你使用设置好的认证信息登录进去。 -以上对于任意你想在容器中运行的发行版都适用,但前提是你需要使用正确的包管理器创建系统。对于 Fedora,你应使用 DNF 而非 `debootstrap`。想要设置一个最小化的 Fedora 系统,你可以运行下面的命令,要将绝对路径替换成任何你希望容器存放的位置。 +以上对于任意你想在容器中运行的发行版都适用,但前提是你需要使用正确的包管理器创建系统。对于 Fedora,你应使用 DNF 而非 `debootstrap`。想要设置一个最小化的 Fedora 系统,你可以运行下面的命令,要将“/absolute/path/”替换成任何你希望容器存放的位置。 ``` $ sudo dnf --releasever=24 --installroot=/absolute/path/ install systemd passwd dnf fedora-release @@ -43,8 +44,8 @@ $ sudo dnf --releasever=24 --installroot=/absolute/path/ install systemd passwd ![](https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/Screenshot-from-2016-06-17-15-04-14.png) ### 设置网络 -如果你尝试启动一个服务,但它绑定了你宿主机正在使用的端口,你将会注意到这个问题:你的容器正在使用和宿主机相同的网络接口。 -幸运的是,`systemd-nspawn` 提供了几种方法可以将网络从宿主机分开。 + +如果你尝试启动一个服务,但它绑定了你宿主机正在使用的端口,你将会注意到这个问题:你的容器正在使用和宿主机相同的网络接口。幸运的是,`systemd-nspawn` 提供了几种可以将网络从宿主机分开的方法。 #### 本地网络 @@ -52,33 +53,38 @@ $ sudo dnf --releasever=24 --installroot=/absolute/path/ install systemd passwd #### 多个网络接口 -如果你有多个网络接口设备,你可以使用 `--network-interface` 标志给容器分配一个接口。想要给我的容器分配 `eno1`,我会添加标志 `--network-interface=eno1`。当某个接口分配给一个容器后,宿主机就不能同时使用那个接口了。只有当容器彻底关闭后,宿主机才可以使用那个接口。 - +如果你有多个网络接口设备,你可以使用 `--network-interface` 标志给容器分配一个接口。想要给我的容器分配 `eno1`,我会添加选项 `--network-interface=eno1`。当某个接口分配给一个容器后,宿主机就不能同时使用那个接口了。只有当容器彻底关闭后,宿主机才可以使用那个接口。 #### 共享网络接口 -对于我们中那些并没有额外的网络设备的人来说,还有其它方法可以访问容器。一种就是使用 `--port` 标志。这会将容器中的一个端口定向到宿主机。使用格式是 `协议:宿主机:容器`,这里的协议可以是 `tcp` 或者 `udp`,`宿主机` 是宿主机的一个合法端口,`容器` 则是容器中的一个合法端口。你可以省略协议,只指定 `宿主机:容器`。我通常的用法类似 `--port=2222:22`。 + +对于我们中那些并没有额外的网络设备的人来说,还有其它方法可以访问容器。一种就是使用 `--port` 选项。这会将容器中的一个端口定向到宿主机。使用格式是 `协议:宿主机端口:容器端口`,这里的协议可以是 `tcp` 或者 `udp`,`宿主机端口` 是宿主机的一个合法端口,`容器端口` 则是容器中的一个合法端口。你可以省略协议,只指定 `宿主机端口:容器端口`。我通常的用法类似 `--port=2222:22`。 你可以使用 `--network-veth` 启用完全的、仅宿主机模式的网络,这会在宿主机和容器之间创建一个虚拟的网络接口。你也可以使用 `--network-bridge` 桥接二者的连接。 ### 使用 systemd 组件 + 如果你容器中的系统含有 D-Bus,你可以使用 systemd 提供的实用工具来控制并监视你的容器。基础安装的 Debian 并不包含 `dbus`。如果你想在 Debian Jessie 中使用 `dbus`,你需要运行命令 `apt install dbus`。 #### machinectl + 为了能够轻松地管理容器,systemd 提供了 `machinectl` 实用工具。使用 `machinectl`,你可以使用 `machinectl login name` 登录到一个容器中、使用 `machinectl status name`检查状态、使用 `machinectl reboot name` 启动容器或者使用 `machinectl poweroff name` 关闭容器。 ### 其它 systemd 命令 -多数 systemd 命令,例如 `journalctl`, `systemd-analyze` 和 `systemctl`,都支持使用了 `--machine` 选项的容器。例如,如果你想查看一个名为 "foobar" 的容器日志,你可以使用 `journalctl --machine=foobar`。你也可以使用 `systemctl --machine=foobar status service` 来查看运行在这个容器中的服务状态。 + +多数 systemd 命令,例如 `journalctl`, `systemd-analyze` 和 `systemctl`,都支持使用 `--machine` 选项来指定容器。例如,如果你想查看一个名为 “foobar” 的容器的日志,你可以使用 `journalctl --machine=foobar`。你也可以使用 `systemctl --machine=foobar status service` 来查看运行在这个容器中的服务状态。 ![](https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/Screenshot-from-2016-06-17-15-09-25.png) ### 和 SELinux 一起工作 + 如果你要使用 SELinux 强制模式(Fedora 默认模式),你需要为你的容器设置 SELinux 环境。想要那样的话,你需要在宿主系统上运行下面两行命令。 ``` $ semanage fcontext -a -t svirt_sandbox_file_t "/path/to/container(/.*)?" $ restorecon -R /path/to/container/ ``` -确保使用你的容器路径替换 "/path/to/container"。对于我的容器 "DebianJessie",我会运行下面的命令: + +确保使用你的容器路径替换 “/path/to/container”。对于我的容器 "DebianJessie",我会运行下面的命令: ``` $ semanage fcontext -a -t svirt_sandbox_file_t "/home/johnmh/DebianJessie(/.*)?" @@ -91,7 +97,7 @@ via: https://fedoramagazine.org/container-technologies-fedora-systemd-nspawn/ 作者:[John M. Harris, Jr.][a] 译者:[ChrisLeeGit](https://github.com/chrisleegit) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 6bd966ef31cf12b07239b3dcc946d3a671c2e350 Mon Sep 17 00:00:00 2001 From: kakali <1799225723@qq.com> Date: Thu, 28 Jul 2016 17:49:55 +0800 Subject: [PATCH 1279/1469] vim-kakali translated (#4236) * vim-kakali translated * vim-kakali translating --- ...riables, Numeric Expressions and Assignment Operators.md | 2 +- .../tech/20160718 Creating your first Git repository.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sources/tech/awk/20160714 Part 8 - Learn How to Use Awk Variables, Numeric Expressions and Assignment Operators.md b/sources/tech/awk/20160714 Part 8 - Learn How to Use Awk Variables, Numeric Expressions and Assignment Operators.md index d7cfd4c064..dd2494529d 100644 --- a/sources/tech/awk/20160714 Part 8 - Learn How to Use Awk Variables, Numeric Expressions and Assignment Operators.md +++ b/sources/tech/awk/20160714 Part 8 - Learn How to Use Awk Variables, Numeric Expressions and Assignment Operators.md @@ -1,4 +1,4 @@ -vim-kakali translating +translating by vim-kakali Learn How to Use Awk Variables, Numeric Expressions and Assignment Operators – part8 diff --git a/translated/tech/20160718 Creating your first Git repository.md b/translated/tech/20160718 Creating your first Git repository.md index 35382aba55..722fe2ea56 100644 --- a/translated/tech/20160718 Creating your first Git repository.md +++ b/translated/tech/20160718 Creating your first Git repository.md @@ -122,7 +122,7 @@ $ cat ~/.ssh/id_rsa.pub 命令 git status 的输出会告诉你如果你想让 git 跟踪一个文件,你必须使用命令 git add 把它加入到提交任务中。这个命令把文件存在了暂存区,暂存区存放的都是等待提交的文件,或者把仓库保存为一个快照。git add 命令的最主要目的是为了区分你已经保存在仓库快照里的文件,还有新建的或你想提交的临时文件,至少现在,你都不用为它们之间的不同之处而费神了。 -类比大型录音机,这个动作就像打开录音机开始准备录音一样。你可以按已经录音的录音机上的 pause 按钮来完成推送,或者拉下重置环等待开始跟踪下一个文件。 +类比大型录音机,这个动作就像打开录音机开始准备录音一样。你可以按已经录音的录音机上的 pause 按钮来完成推送,或者按下重置按钮等待开始跟踪下一个文件。 如果你把文件加入到提交任务中,Git 会自动标识为跟踪文件: @@ -150,7 +150,7 @@ $ git reset HEAD foo 有时候,你会需要完成很多提交;我们以录音机类比,这就好比按下录音键并最终按下保存键一样。 -在一个项目从建立到完成,你会按记录键无数次。比如,如果你通过你的方式使用一个新的 Python 工具包并且最终实现了窗口展示,然后你就很肯定的提交了文件,但是不可避免的你最后会发生一些错误,现在你却不能撤销你的提交操作了。 +在一个项目从建立到完成,你会按记录键无数次。比如,如果你通过你的方式使用一个新的 Python 工具包并且最终实现了窗口展示,然后你就很肯定的提交了文件,但是不可避免的会发生一些错误,现在你却不能撤销你的提交操作了。 一次提交会记录仓库中所有的暂存区文件。Git 只记录加入到提交任务中的文件,也就是说在过去某个时刻你使用 git add 命令加入到暂存区的所有文件。还有从先前的提交开始被改动的文件。如果没有其他的提交,所有的跟踪文件都包含在这次提交中,因为在浏览 Git 历史点的时候,它们没有存在于仓库中。 @@ -171,7 +171,7 @@ $ git log --oneline 在这个例子中提交时的版本号是 55df4c2。它被叫做 commit hash(译注:一个SHA-1生成的哈希码,用于表示一个git commit对象。),它表示着刚才你的提交包含的所有改动,覆盖了先前的记录。如果你想要“倒回”到你的提交历史点上就可以用这个 commit hash 作为依据。 -你可以把 commit hash 想象成一个声音磁带上的 [SMPTE timecode][3],或者再夸张一点,这就是好比一个黑胶唱片两首不同的歌之间的不同点,或是一个 CD 上的轨段编号。 +你可以把 commit hash 想象成一个声音磁带上的 [SMPTE timecode][3],或者再夸张一点,这就是好比一个黑胶唱片上两首不同的歌之间的不同点,或是一个 CD 上的轨段编号。 你在很久前改动了文件并且把它们加入到提交任务中,最终完成提交,这就会生成新的 commit hashes,每个 commit hashes 标示的历史点都代表着你的产品不同的版本。 From 6c6fff61eff8c6e703f58d33164f9973ae6815fe Mon Sep 17 00:00:00 2001 From: Christopher L Date: Thu, 28 Jul 2016 21:57:04 +0800 Subject: [PATCH 1280/1469] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...figure and Troubleshoot Grand Unified Bootloader (GRUB).md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/LFCS/Part 13 - How to Configure and Troubleshoot Grand Unified Bootloader (GRUB).md b/sources/tech/LFCS/Part 13 - How to Configure and Troubleshoot Grand Unified Bootloader (GRUB).md index cf24c51b58..2d1cbef467 100644 --- a/sources/tech/LFCS/Part 13 - How to Configure and Troubleshoot Grand Unified Bootloader (GRUB).md +++ b/sources/tech/LFCS/Part 13 - How to Configure and Troubleshoot Grand Unified Bootloader (GRUB).md @@ -1,3 +1,5 @@ +Being translated by ChrisLeeGit + Part 13 - LFCS: How to Configure and Troubleshoot Grand Unified Bootloader (GRUB) ===================================================================================== @@ -167,7 +169,7 @@ Do you have questions or comments? Don’t hesitate to let us know using the com via: http://www.tecmint.com/linux-basic-shell-scripting-and-linux-filesystem-troubleshooting/ 作者:[Gabriel Cánepa][a] -译者:[译者ID](https://github.com/译者ID) +译者:[ChrisLeeGit](https://github.com/chrisleegit) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 89de15b01650ef16a9110a53ffa168f8a7c1379f Mon Sep 17 00:00:00 2001 From: Mike Tang Date: Fri, 29 Jul 2016 00:42:03 +0800 Subject: [PATCH 1281/1469] OPEN SOURCE ACCOUNTING SOFTWARE --- sources/tech/20160718 OPEN SOURCE ACCOUNTING SOFTWARE.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160718 OPEN SOURCE ACCOUNTING SOFTWARE.md b/sources/tech/20160718 OPEN SOURCE ACCOUNTING SOFTWARE.md index 4232e6cda8..edc260a1bc 100644 --- a/sources/tech/20160718 OPEN SOURCE ACCOUNTING SOFTWARE.md +++ b/sources/tech/20160718 OPEN SOURCE ACCOUNTING SOFTWARE.md @@ -1,3 +1,5 @@ +MikeCoder Translating... + GNU KHATA: OPEN SOURCE ACCOUNTING SOFTWARE ============================================ From 193ab20ecbba980fd60b06b3a1a0a1ae5279e184 Mon Sep 17 00:00:00 2001 From: gitfuture Date: Fri, 29 Jul 2016 11:21:35 +0800 Subject: [PATCH 1282/1469] Finished Translating --- ...o Encrypt a Flash Drive Using VeraCrypt.md | 102 ------------------ ...o Encrypt a Flash Drive Using VeraCrypt.md | 100 +++++++++++++++++ 2 files changed, 100 insertions(+), 102 deletions(-) delete mode 100644 sources/tech/20160705 How to Encrypt a Flash Drive Using VeraCrypt.md create mode 100644 translated/tech/20160705 How to Encrypt a Flash Drive Using VeraCrypt.md diff --git a/sources/tech/20160705 How to Encrypt a Flash Drive Using VeraCrypt.md b/sources/tech/20160705 How to Encrypt a Flash Drive Using VeraCrypt.md deleted file mode 100644 index 27a0b950bd..0000000000 --- a/sources/tech/20160705 How to Encrypt a Flash Drive Using VeraCrypt.md +++ /dev/null @@ -1,102 +0,0 @@ -Translating by GitFuture [07.26] - -How to Encrypt a Flash Drive Using VeraCrypt -============================================ - -Many security experts prefer open source software like VeraCrypt, which can be used to encrypt flash drives, because of its readily available source code. - -Encryption is a smart idea for protecting data on a USB flash drive, as we covered in our piece that described ]how to encrypt a flash drive][1] using Microsoft BitLocker. - -But what if you do not want to use BitLocker? - -You may be concerned that because Microsoft's source code is not available for inspection, it could be susceptible to security "backdoors" used by the government or others. Because source code for open source software is widely shared, many security experts feel open source software is far less likely to have any backdoors. - -Fortunately, there are several open source encryption alternatives to BitLocker. - -If you need to be able to encrypt and access files on any Windows machine, as well as computers running Apple OS X or Linux, the open source [VeraCrypt][2] offers an excellent alternative. - -VeraCrypt is derived from TrueCrypt, a well-regarded open source encryption software product that has now been discontinued. But the code for TrueCrypt was audited and no major security flaws were found. In addition, it has since been improved in VeraCrypt. - -Versions exist for Windows, OS X and Linux. - -Encrypting a USB flash drive with VeraCrypt is not as straightforward as it is with BitLocker, but it still only takes a few minutes. - -### Encrypting Flash Drive with VeraCrypt in 8 Steps - -After [downloading VeraCrypt][3] for your operating system: - -Start VeraCrypt, and click on Create Volume to start the VeraCrypt Volume Creation Wizard. - -![](http://www.esecurityplanet.com/imagesvr_ce/6246/Vera0.jpg) - -The VeraCrypt Volume Creation Wizard allows you to create an encrypted file container on the flash drive which sits along with other unencrypted files, or you can choose to encrypt the entire flash drive. For the moment, we will choose to encrypt the entire flash drive. - -![](http://www.esecurityplanet.com/imagesvr_ce/6703/Vera1.jpg) - -On the next screen, choose Standard VeraCrypt Volume. - -![](http://www.esecurityplanet.com/imagesvr_ce/835/Vera2.jpg) - -Select the drive letter of the flash drive you want to encrypt (in this case O:). - -![](http://www.esecurityplanet.com/imagesvr_ce/9427/Vera3.jpg) - -Choose the Volume Creation Mode. If your flash drive is empty or you want to delete everything it contains, choose the first option. If you want to keep any existing files, choose the second option. - -![](http://www.esecurityplanet.com/imagesvr_ce/7828/Vera4.jpg) - -This screen allows you to choose your encryption options. If you are unsure of which to choose, leave the default settings of AES and SHA-512. - -![](http://www.esecurityplanet.com/imagesvr_ce/5918/Vera5.jpg) - -After confirming the Volume Size screen, enter and re-enter the password you want to use to encrypt your data. - -![](http://www.esecurityplanet.com/imagesvr_ce/3850/Vera6.jpg) - -To work effectively, VeraCrypt must draw from a pool of entropy or "randomness." To generate this pool, you'll be asked to move your mouse around in a random fashion for about a minute. Once the bar has turned green, or preferably when it reaches the far right of the screen, click Format to finish creating your encrypted drive. - -![](http://www.esecurityplanet.com/imagesvr_ce/7468/Vera8.jpg) - -### Using a Flash Drive Encrypted with VeraCrypt - -When you want to use an encrypted flash drive, first insert the drive in the computer and start VeraCrypt. - -Then select an unused drive letter (such as z:) and click Auto-Mount Devices. - -![](http://www.esecurityplanet.com/imagesvr_ce/2016/Vera10.jpg) - -Enter your password and click OK. - -![](http://www.esecurityplanet.com/imagesvr_ce/8222/Vera11.jpg) - -The mounting process may take a few minutes, after which your unencrypted drive will become available with the drive letter you selected previously. - -### VeraCrypt Traveler Disk Setup - -If you set up a flash drive with an encrypted container rather than encrypting the whole drive, you also have the option to create what VeraCrypt calls a traveler disk. This installs a copy of VeraCrypt on the USB flash drive itself, so when you insert the drive in another Windows computer you can run VeraCrypt automatically from the flash drive; there is no need to install it on the computer. - -You can set up a flash drive to be a Traveler Disk by choosing Traveler Disk SetUp from the Tools menu of VeraCrypt. - -![](http://www.esecurityplanet.com/imagesvr_ce/5812/Vera12.jpg) - -It is worth noting that in order to run VeraCrypt from a Traveler Disk on a computer, you must have administrator privileges on that computer. While that may seem to be a limitation, no confidential files can be opened safely on a computer that you do not control, such as one in a business center. - ->Paul Rubens has been covering enterprise technology for over 20 years. In that time he has written for leading UK and international publications including The Economist, The Times, Financial Times, the BBC, Computing and ServerWatch. - --------------------------------------------------------------------------------- - -via: http://www.esecurityplanet.com/open-source-security/how-to-encrypt-flash-drive-using-veracrypt.html - -作者:[Paul Rubens ][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://www.esecurityplanet.com/author/3700/Paul-Rubens -[1]: http://www.esecurityplanet.com/views/article.php/3880616/How-to-Encrypt-a-USB-Flash-Drive.htm -[2]: http://www.esecurityplanet.com/open-source-security/veracrypt-a-worthy-truecrypt-alternative.html -[3]: https://veracrypt.codeplex.com/releases/view/619351 - - - diff --git a/translated/tech/20160705 How to Encrypt a Flash Drive Using VeraCrypt.md b/translated/tech/20160705 How to Encrypt a Flash Drive Using VeraCrypt.md new file mode 100644 index 0000000000..a049bfd73c --- /dev/null +++ b/translated/tech/20160705 How to Encrypt a Flash Drive Using VeraCrypt.md @@ -0,0 +1,100 @@ +用 VeraCrypt 加密闪存盘 +============================================ + +很多安全专家偏好像 VeraCrypt 这类能够用来加密闪存盘的开源软件。因为获取它的源代码很简单。 + +保护 USB闪存盘里的数据,加密是一个聪明的方法,正如我们在使用 Microsoft 的 BitLocker [加密闪存盘][1] 一文中提到的。 + +但是如果你不想用 BitLocker 呢? + +你可能有顾虑,因为你不能够查看 Microsoft 的程序源码,那么它容易被植入用于政府或其它用途的“后门”。由于开源软件的源码是公开的,很多安全专家认为开源软件很少藏有后门。 + +还好,有几个开源加密软件能作为 BitLocker 的替代。 + +要是你需要在 Windows 系统,苹果的 OS X 系统或者 Linux 系统上加密以及访问文件,开源软件 [VeraCrypt][2] 提供绝佳的选择。 + +VeraCrypt 源于 TrueCrypt。TrueCrypt是一个备受好评的开源加密软件,尽管它现在已经停止维护了。但是 TrueCrypt 的代码通过了审核,没有发现什么重要的安全漏洞。另外,它已经在 VeraCrypt 中进行了改善。 + +Windows,OS X 和 Linux 系统的版本都有。 + +用 VeraCrypt 加密 USB 闪存盘不像用 BitLocker 那么简单,但是它只要几分钟就好了。 + +### 用 VeraCrypt 加密闪存盘的 8 个步骤 + +对应操作系统 [下载 VeraCrypt][3] 之后: + +打开 VeraCrypt,点击 Create Volume,进入 VeraCrypt 的创建卷的向导程序(VeraCrypt Volume Creation Wizard)。(注:VeraCrypt Volume Creation Wizard 首字母全大写,不清楚是否需要翻译,之后有很多首字母大写的词,都以括号标出) + +![](http://www.esecurityplanet.com/imagesvr_ce/6246/Vera0.jpg) + +VeraCrypt 创建卷向导(VeraCrypt Volume Creation Wizard)允许你在闪存盘里新建一个加密文件容器,这与其它未加密文件是独立的。或者你也可以选择加密整个闪存盘。这个时候你就选加密整个闪存盘就行。 + +![](http://www.esecurityplanet.com/imagesvr_ce/6703/Vera1.jpg) + +然后选择标准模式(Standard VeraCrypt Volume)。 + +![](http://www.esecurityplanet.com/imagesvr_ce/835/Vera2.jpg) + +选择你想加密的闪存盘的驱动器卷标(这里是 O:)。 + +![](http://www.esecurityplanet.com/imagesvr_ce/9427/Vera3.jpg) + +选择创建卷标模式(Volume Creation Mode)。如果你的闪存盘是空的,或者你想要删除它里面的所有东西,选第一个。要么你想保持所有现存的文件,选第二个就好了。 + +![](http://www.esecurityplanet.com/imagesvr_ce/7828/Vera4.jpg) + +这一步允许你选择加密选项。要是你不确定选哪个,就用默认的 AES 和 SHA-512 设置。 + +![](http://www.esecurityplanet.com/imagesvr_ce/5918/Vera5.jpg) + +确定了卷标容量后,输入并确认你想要用来加密数据密码。 + +![](http://www.esecurityplanet.com/imagesvr_ce/3850/Vera6.jpg) + +要有效工作,VeraCrypt 要从一个熵或者“随机数”池中取出一个随机数。要初始化这个池,你将被要求随机地移动鼠标一分钟。一旦进度条变绿了,或者更方便的是等到进度条到了屏幕右边足够远的时候,点击 “Format” 来结束创建加密盘。 + +![](http://www.esecurityplanet.com/imagesvr_ce/7468/Vera8.jpg) + +### 用 VeraCrypt 使用加密过的闪存盘 + +当你想要使用一个加密了的闪存盘,先插入闪存盘到电脑上,启动 VeraCrypt。 + +然后选择一个没有用过的卷标(比如 z:),点击自动挂载设备(Auto-Mount Devices)。 + +![](http://www.esecurityplanet.com/imagesvr_ce/2016/Vera10.jpg) + +输入密码,点击确定。 + +![](http://www.esecurityplanet.com/imagesvr_ce/8222/Vera11.jpg) + +挂载过程需要几分钟,这之后你的解密盘就能通过你先前选择的盘符进行访问了。 + +### VeraCrypt 移动硬盘安装步骤 + +如果你设置闪存盘的时候,选择的是加密过的容器而不是加密整个盘,你可以选择创建 VeraCrypt 称为移动盘(Traveler Disk)的设备。这会复制安装一个 VeraCrypt 在 USB 闪存盘。当你在别的 Windows 电脑上插入 U 盘时,就能从 U 盘自动运行 VeraCrypt;也就是说没必要在新电脑上安装 VeraCrypt。 + +你可以设置闪存盘作为一个移动硬盘(Traveler Disk),在 VeraCrypt 的工具栏(Tools)菜单里选择 Traveler Disk SetUp 就行了。 + +![](http://www.esecurityplanet.com/imagesvr_ce/5812/Vera12.jpg) + +要从移动盘(Traveler Disk)上运行 VeraCrypt,你必须要有那台电脑的管理员权限,这不足为奇。尽管这看起来是个限制,机密文件无法在不受控制的电脑上安全打开,比如在一个商务中心的电脑上。 + +>Paul Rubens 从事技术行业已经超过 20 年。这期间他为英国和国际主要的出版社,包括 《The Economist》《The Times》《Financial Times》《The BBC》《Computing》和《ServerWatch》等出版社写过文章, + +-------------------------------------------------------------------------------- + +via: http://www.esecurityplanet.com/open-source-security/how-to-encrypt-flash-drive-using-veracrypt.html + +作者:[Paul Rubens ][a] +译者:[GitFuture](https://github.com/GitFuture) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.esecurityplanet.com/author/3700/Paul-Rubens +[1]: http://www.esecurityplanet.com/views/article.php/3880616/How-to-Encrypt-a-USB-Flash-Drive.htm +[2]: http://www.esecurityplanet.com/open-source-security/veracrypt-a-worthy-truecrypt-alternative.html +[3]: https://veracrypt.codeplex.com/releases/view/619351 + + + From 0921361a3fd8732a180d5b748fb721086bd3d7a9 Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 29 Jul 2016 13:35:24 +0800 Subject: [PATCH 1283/1469] =?UTF-8?q?20160729-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...f Earth as Your Linux Desktop Wallpaper.md | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 sources/tech/20160726 Set a Real Time Photo of Earth as Your Linux Desktop Wallpaper.md diff --git a/sources/tech/20160726 Set a Real Time Photo of Earth as Your Linux Desktop Wallpaper.md b/sources/tech/20160726 Set a Real Time Photo of Earth as Your Linux Desktop Wallpaper.md new file mode 100644 index 0000000000..1fd552e70c --- /dev/null +++ b/sources/tech/20160726 Set a Real Time Photo of Earth as Your Linux Desktop Wallpaper.md @@ -0,0 +1,38 @@ +Set a Real Time Photo of Earth as Your Linux Desktop Wallpaper +================================================================= + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2016/07/Screen-Shot-2016-07-26-at-16.36.47-1.jpg) + +Bored of looking at the same desktop background? Here’s something that’s (almost) out of this world. + +‘[Himawaripy][1]‘ is a small Python 3 script that fetches a near-real time picture of Earth taken by the [Japanese Himawari 8 weather satellite][2] and sets it as your desktop background. + +Once installed you can set the app to run as a cron job every 10 minutes (in the background, naturally) so that it can fetch and set a realtime picture of Earth as your desktop wallpaper. + +Because Himawari-8 is a geostationary satellite you’re only ever going to images of the earth as seen from above Australasia — but with real time weather patterns, cloud formations and lighting it’s still makes for spectacular scene, even if seeing things above the UK would be better for me! + +Advanced settings allow you to configure the quality of the images pulled from the satellite , but keep in mind that any increase in quality will result in an increased file size, and a longer download wait! + +Lastly, while this script is very similar to many others that we’ve covered over the years it is up-to-date and working. + +Get Himawaripy +Himawaripy has been tested on a range of desktop environments, including Unity, LXDE, i3, MATE and a host of other desktop environments. It is free, open-source software but is not entirely straightforward to set up and configure. + +Find all instructions on getting the app installed and set up (hint: there’s no one-click installer) on the project’s GitHub page. + +[Real time earth wallpaper script on GitHub][0] + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/mandatory-access-control-with-selinux-or-apparmor-linux/ + +作者:[ JOEY-ELIJAH SNEDDON][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://plus.google.com/117485690627814051450/?rel=author +[1]: https://github.com/boramalper/himawaripy +[2]: https://en.wikipedia.org/wiki/Himawari_8 +[0]: https://github.com/boramalper/himawaripy From 27b76b256636123ea14f7d823615ec8dd158f5db Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 29 Jul 2016 13:43:09 +0800 Subject: [PATCH 1284/1469] =?UTF-8?q?20160729-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20160715 bc - Command line calculator.md | 131 ++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 sources/tech/20160715 bc - Command line calculator.md diff --git a/sources/tech/20160715 bc - Command line calculator.md b/sources/tech/20160715 bc - Command line calculator.md new file mode 100644 index 0000000000..adf854e468 --- /dev/null +++ b/sources/tech/20160715 bc - Command line calculator.md @@ -0,0 +1,131 @@ +bc: Command line calculator +============================ + +![](https://cdn.fedoramagazine.org/wp-content/uploads/2016/07/bc-calculator-945x400.jpg) + +If you run a graphical desktop environment, you probably point and click your way to a calculator when you need one. The Fedora Workstation, for example, includes the Calculator tool. It features several different operating modes that allow you to do, for example, complex math or financial calculations. But did you know the command line also offers a similar calculator called bc? + +The bc utility gives you everything you expect from a scientific, financial, or even simple calculator. What’s more, it can be scripted from the command line if needed. This allows you to use it in shell scripts, in case you need to do more complex math. + +Because bc is used by some other system software, like CUPS printing services, it’s probably installed on your Fedora system already. You can check with this command: + +``` +dnf list installed bc +``` + +If you don’t see it for some reason, you can install the package with this command: + +``` +sudo dnf install bc +``` + +### Doing simple math with bc + +One way to use bc is to enter the calculator’s own shell. There you can run many calculations in a row. When you enter, the first thing that appears is a notice about the program: + +``` +$ bc +bc 1.06.95 +Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc. +This is free software with ABSOLUTELY NO WARRANTY. +For details type `warranty'. +``` + +Now you can type in calculations or commands, one per line: + +``` +1+1 +``` + +The calculator helpfully answers: + +``` +2 +``` + +You can perform other commands here. You can use addition (+), subtraction (-), multiplication (*), division (/), parentheses, exponents (^), and so forth. Note that the calculator respects all expected conventions such as order of operations. Try these examples: + +``` +(4+7)*2 +4+7*2 +``` + +To exit, send the “end of input” signal with the key combination Ctrl+D. + +Another way is to use the echo command to send calculations or commands. Here’s the calculator equivalent of “Hello, world,” using the shell’s pipe function (|) to send output from echo into bc: + +``` +echo '1+1' | bc +``` + +You can send more than one calculation using the shell pipe, with a semicolon to separate entries. The results are returned on separate lines. + +``` +echo '1+1; 2+2' | bc +``` + +### Scale + +The bc calculator uses the concept of scale, or the number of digits after a decimal point, in some calculations. The default scale is 0. Division operations always use the scale setting. So if you don’t set scale, you may get unexpected answers: + +``` +echo '3/2' | bc +echo 'scale=3; 3/2' | bc +``` + +Multiplication uses a more complex decision for scale: + +``` +echo '3*2' | bc +echo '3*2.0' | bc +``` + +Meanwhile, addition and subtraction are more as expected: + +``` +echo '7-4.15' | bc +``` + +### Other base number systems + +Another useful function is the ability to use number systems other than base-10 (decimal). For instance, you can easily do hexadecimal or binary math. Use the ibase and obase commands to set input and output base systems between base-2 and base-16. Remember that once you use ibase, any number you enter is expected to be in the new declared base. + +To do hexadecimal to decimal conversions or math, you can use a command like this. Note the hexadecimal digits above 9 must be in uppercase (A-F): + +``` +echo 'ibase=16; A42F' | bc +echo 'ibase=16; 5F72+C39B' | bc +``` + +To get results in hexadecimal, set the obase as well: + +``` +echo 'obase=16; ibase=16; 5F72+C39B' | bc +``` + +Here’s a trick, though. If you’re doing these calculations in the shell, how do you switch back to input in base-10? The answer is to use ibase, but you must set it to the equivalent of decimal number 10 in the current input base. For instance, if ibase was set to hexadecimal, enter: + +``` +ibase=A +``` + +Once you do this, all input numbers are now decimal again, so you can enter obase=10 to reset the output base system. + +### Conclusion + +This is only the beginning of what bc can do. It also allows you to define functions, variables, and loops for complex calculations and programs. You can save these programs as text files on your system to run whenever you need. You can find numerous resources on the web that offer examples and additional function libraries. Happy calculating! + + + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/mandatory-access-control-with-selinux-or-apparmor-linux/ + +作者:[Paul W. Frields][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/pfrields/ +[1]: http://phodd.net/gnu-bc/ From 8236318652e2e8187e386b6eb97bbcba8fe62114 Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 29 Jul 2016 13:49:10 +0800 Subject: [PATCH 1285/1469] =?UTF-8?q?20160729-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0160722 Keeweb A Linux Password Manager.md | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 sources/tech/20160722 Keeweb A Linux Password Manager.md diff --git a/sources/tech/20160722 Keeweb A Linux Password Manager.md b/sources/tech/20160722 Keeweb A Linux Password Manager.md new file mode 100644 index 0000000000..b829ea107e --- /dev/null +++ b/sources/tech/20160722 Keeweb A Linux Password Manager.md @@ -0,0 +1,62 @@ +Keeweb A Linux Password Manager +================================ + +![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/keeweb_1.png?608) + +Today we are depending on more and more online services. Each online service we sign up for, let us set a password and this way we have to remember hundreds of passwords. In this case, it is easy for anyone to forget passwords. In this article I am going to talk about Keeweb, a Linux password manager that can store all your passwords securely either online or offline. + +When we talk about Linux password managers, there are so many. Password managers like, [Keepass][1] and [Encryptr, a Zero-knowledge system based password manager][2] have already been talked about on LinuxAndUbuntu. Keeweb is another password manager for Linux that we are going to see in this article. + +### Keeweb can store passwords offline or online + +Keeweb is a cross-platform password manager. It can store all your passwords offline and sync it with your own cloud storage services like OneDrive, Google Drive, Dropbox etc. Keeweb does not have online database of its own to sync your passwords. + +To connect your online storage with Keeweb, just click more and click the service that you want to use. + +![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/keeweb.png?685) + +Now Keeweb will prompt you to sign in to your drive. After sign in authenticate Keeweb to use your account. + +![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/authenticate-dropbox-with-keeweb_orig.jpg?649) + +### Store passwords with Keeweb + +It is very easy to store your passwords with Keeweb. You can encrypt your password file with a complex password. Keeweb also allows you to lock file with a key file but I don't recommend it. If somebody gets your key file, it takes only a click to unlock your passwords file. + +#### Create Passwords + +To create a new password simply click the '+' sign and you will be presented all entries to fill up. You can create more entries if you want. + +#### Search Passwords + +![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/search-passwords_orig.png) + +Keeweb has a library of icons so that you can find any particular password entry easily. You can change the color of icons, download more icons and even import icons from your computer. When talking about finding passwords the search comes very handy. ​ + +Passwords of similar services can be grouped so that you can find them all at one place in one folder. You can also tag passwords to store them all in different categories. + +![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/tags-passwords-in-keeweb.png?283) + +### Themes + +![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/themes.png?304) + +If you like light themes like white or high contrast then you can change theme from Settings > General > Themes. There are four themes available, two are dark and two are light. + +### Dont' you Like Linux Passwords Manager? No problem! + +I have already posted about two other Linux password managers, Keepass and Encryptr and there were arguments on Reddit, and other social media. There were people against using any password manager and vice-versa. In this article I want to clear out that it is our responsibility to save the file that passwords are stored in. I think Password managers like Keepass and Keeweb are good to use as they don't store your passwords in the cloud. These password managers create a file and you can store it on your hard drive or encrypt it with apps like VeraCrypt. I myself don't use or recommend to use services that store passwords in their own database. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/mandatory-access-control-with-selinux-or-apparmor-linux/ + +作者:[author][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.linuxandubuntu.com/home/keeweb-a-linux-password-manager +[1]: http://www.linuxandubuntu.com/home/keepass-password-management-tool-creates-strong-passwords-and-keeps-them-secure +[2]: http://www.linuxandubuntu.com/home/encryptr-zero-knowledge-system-based-password-manager-for-linux From 231a1636b91ee1568c7aac5f6681f3101e3d4661 Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 29 Jul 2016 13:55:13 +0800 Subject: [PATCH 1286/1469] =?UTF-8?q?20160729-4=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...r With Multiple Terminals In One Window.md | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 sources/tech/20160724 Terminator A Linux Terminal Emulator With Multiple Terminals In One Window.md diff --git a/sources/tech/20160724 Terminator A Linux Terminal Emulator With Multiple Terminals In One Window.md b/sources/tech/20160724 Terminator A Linux Terminal Emulator With Multiple Terminals In One Window.md new file mode 100644 index 0000000000..eb50d539a1 --- /dev/null +++ b/sources/tech/20160724 Terminator A Linux Terminal Emulator With Multiple Terminals In One Window.md @@ -0,0 +1,85 @@ +Terminator A Linux Terminal Emulator With Multiple Terminals In One Window +============================================================================= + +![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/lots-of-terminals-in-terminator_1.jpg?659) + +Each Linux distribution has a default terminal emulator for interacting with system through commands. But the default terminal app might not be perfect for you. There are so many terminal apps that will provide you more functionalities to perform more tasks simultaneously to sky-rocket speed of your work. Such useful terminal emulators include Terminator, a multi-windows supported free terminal emulator for your Linux system. + +### What Is Linux Terminal Emulator? + +A Linux terminal emulator is a program that lets you interact with the shell. All Linux distributions come with a default Linux terminal app that let you pass commands to the shell. + +### Terminator, A Free Linux Terminal App + +Terminator is a Linux terminal emulator that provides several features that your default terminal app does not support. It provides the ability to create multiple terminals in one window and faster your work progress. Other than multiple windows, it allows you to change other properties such as, terminal fonts, fonts colour, background colour and so on. Let's see how we can install and use Terminator in different Linux distributions. + +### How To Install Terminator In Linux? + +#### Install Terminator In Ubuntu Based Distributions + +Terminator is available in the default Ubuntu repository. So you don't require to add any additional PPA. Just use APT or Software App to install it in Ubuntu. + +``` +sudo apt-get install terminator +``` + +In case Terminator is not available in your default repository, just compile Terminator from source code. + +[DOWNLOAD SOURCE CODE][1] + +Download Terminator source code and extract it on your desktop. Now open your default terminal & cd into the extracted folder. + +Now use the following command to install Terminator - + +``` +sudo ./setup.py install +``` + +#### Install Terminator In Fedora & Other Derivatives + +``` +dnf install terminator +``` + +#### Install Terminator In OpenSuse + +[INSTALL IN OPENSUSE][2] + +### How To Use Multiple Terminals In One Window? + +After you have installed Terminator, simply open multiple terminals in one window. Simply right click and divide. + +![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/multiple-terminals-in-terminator_orig.jpg) + +![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/multiple-terminals-in-terminator-emulator.jpg?697) + +You can create as many terminals as you want, if you can manage them. + +![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/lots-of-terminals-in-terminator.jpg?706) + +### Customise Terminals + +Right click the terminal and click Properties. Now you can customise fonts, fonts colour, title colour & background and terminal fonts colour & background. + +![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/customize-terminator-interface.jpg?702) + +![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/free-terminal-emulator_orig.jpg) + +### Conclusion & What Is Your Favorite Terminal Emulator? + +Terminator is an advanced terminal emulator and it also let you customize the interface. If you have not yet switched from your default terminal emulator then just try this one. I know you'll like it. If you're using any other free terminal emulator, then let us know your favorite terminal emulator. Also don't forget to share this article with your friends. Perhaps your friends are searching for something like this. + + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/mandatory-access-control-with-selinux-or-apparmor-linux/ + +作者:[author][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.linuxandubuntu.com/home/terminator-a-linux-terminal-emulator-with-multiple-terminals-in-one-window +[1]: https://launchpad.net/terminator/+download +[2]: http://software.opensuse.org/download.html?project=home%3AKorbi123&package=terminator From 1b6e4f293dda28a37848ae4453c060efa8dbaad6 Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 29 Jul 2016 14:15:33 +0800 Subject: [PATCH 1287/1469] =?UTF-8?q?20160729-4=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...pt-get on Ubuntu Linux 16.04 LTS server.md | 218 ++++++++++++++++++ 1 file changed, 218 insertions(+) create mode 100644 sources/tech/20160727-How-to-use-multiple-connections-to-speed-up-apt-get on Ubuntu Linux 16.04 LTS server.md diff --git a/sources/tech/20160727-How-to-use-multiple-connections-to-speed-up-apt-get on Ubuntu Linux 16.04 LTS server.md b/sources/tech/20160727-How-to-use-multiple-connections-to-speed-up-apt-get on Ubuntu Linux 16.04 LTS server.md new file mode 100644 index 0000000000..460dabc03c --- /dev/null +++ b/sources/tech/20160727-How-to-use-multiple-connections-to-speed-up-apt-get on Ubuntu Linux 16.04 LTS server.md @@ -0,0 +1,218 @@ +How to use multiple connections to speed up apt-get/apt on Ubuntu Linux 16.04 LTS server +========================================================================================= + +ow do I speed up my apt-get or apt command to download packages from multiple repos on a Ubuntu Linux 16.04 or 14.04 LTS server? + +You need to use apt-fast shell script wrapper. It should speed up apt-get command/apt command and aptitude command by downloading packages with multiple connections per package. All packages are downloaded simultaneously in parallel. It uses aria2c as default download accelerator. + +### Install apt-fast tool + +Type the following command on Ubuntu Linux 14.04 and later versions: + +``` +$ sudo add-apt-repository ppa:saiarcot895/myppa +``` + +Sample outputs: + +![](http://s0.cyberciti.org/uploads/faq/2016/07/install-apt-fast-repo.jpg) + +Update your repo: + +``` +$ sudo apt-get update +``` + +OR + +``` +$ sudo apt update +``` + +![](http://s0.cyberciti.org/uploads/faq/2016/07/install-apt-fast-command.jpg) + +Install apt-fast shell wrapper: + +``` +$ sudo apt-get -y install apt-fast +``` + +OR + +``` +$ sudo apt -y install apt-fast +``` + +Sample outputs: + + +``` +Reading package lists... Done +Building dependency tree +Reading state information... Done +The following additional packages will be installed: + aria2 libc-ares2 libssh2-1 +Suggested packages: + aptitude +The following NEW packages will be installed: + apt-fast aria2 libc-ares2 libssh2-1 +0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded. +Need to get 1,282 kB of archives. +After this operation, 4,786 kB of additional disk space will be used. +Do you want to continue? [Y/n] y +Get:1 http://01.archive.ubuntu.com/ubuntu xenial/universe amd64 libssh2-1 amd64 1.5.0-2 [70.3 kB] +Get:2 http://ppa.launchpad.net/saiarcot895/myppa/ubuntu xenial/main amd64 apt-fast all 1.8.3~137+git7b72bb7-0ubuntu1~ppa3~xenial1 [34.4 kB] +Get:3 http://01.archive.ubuntu.com/ubuntu xenial/main amd64 libc-ares2 amd64 1.10.0-3 [33.9 kB] +Get:4 http://01.archive.ubuntu.com/ubuntu xenial/universe amd64 aria2 amd64 1.19.0-1build1 [1,143 kB] +54% [4 aria2 486 kB/1,143 kB 42%] 20.4 kB/s 32s +``` + +### Configure apt-fast + +You will be prompted as follows (a value between 5 and 16 must be entered): + +![](http://s0.cyberciti.org/uploads/faq/2016/07/max-connection-10.jpg) + +And: + +![](http://s0.cyberciti.org/uploads/faq/2016/07/apt-fast-confirmation-box.jpg) + +You can edit settings directly too: + +``` +$ sudo vi /etc/apt-fast.conf +``` + +>**Please note that this tool is not for slow network connections; it is for fast network connections. If you have a slow connection to the Internet, you are not going to benefit by this tool.** + +### How do I use apt-fast command? + +The syntax is: + +``` +apt-fast command +apt-fast [options] command +``` + +#### To retrieve new lists of packages using apt-fast + +``` +sudo apt-fast update +``` + +#### To perform an upgrade using apt-fast + +``` +sudo apt-fast upgrade +``` + + +#### To perform distribution upgrade (release or force kernel upgrade), enter: + +``` +$ sudo apt-fast dist-upgrade +``` + +#### To install new packages + +The syntax is: + +``` +sudo apt-fast install pkg +``` + +For example, install nginx package, enter: + +``` +$ sudo apt-fast install nginx +``` + +Sample outputs: + +![](http://s0.cyberciti.org/uploads/faq/2016/07/sudo-apt-fast-install.jpg) + +#### To remove packages + +``` +$ sudo apt-fast remove pkg +$ sudo apt-fast remove nginx +``` + +#### To remove packages and its config files too + +``` +$ sudo apt-fast purge pkg +$ sudo apt-fast purge nginx +``` + +#### To remove automatically all unused packages, enter: + +``` +$ sudo apt-fast autoremove +``` + +#### To Download source archives + +``` +$ sudo apt-fast source pkgNameHere +``` + +#### To erase downloaded archive files + +``` +$ sudo apt-fast clean +``` + +#### To erase old downloaded archive files + +``` +$ sudo apt-fast autoclean +``` + +#### To verify that there are no broken dependencies + +``` +$ sudo apt-fast check +``` + +#### To download the binary package into the current directory + +``` +$ sudo apt-fast download pkgNameHere +$ sudo apt-fast download nginx +``` + +Sample outputs: + +``` +[#7bee0c 0B/0B CN:1 DL:0B] +07/26 15:35:42 [NOTICE] Verification finished successfully. file=/home/vivek/nginx_1.10.0-0ubuntu0.16.04.2_all.deb +07/26 15:35:42 [NOTICE] Download complete: /home/vivek/nginx_1.10.0-0ubuntu0.16.04.2_all.deb +Download Results: +gid |stat|avg speed |path/URI +======+====+===========+======================================================= +7bee0c|OK | n/a|/home/vivek/nginx_1.10.0-0ubuntu0.16.04.2_all.deb +Status Legend: +(OK):download completed. +``` + +#### To download and display the changelog for the given package + +``` +$ sudo apt-fast changelog pkgNameHere +$ sudo apt-fast changelog nginx +``` + + + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/introducing-flatpak/ + +作者:[VIVEK GITE][a] +译者:[zky001](https://github.com/zky001) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.cyberciti.biz/tips/about-us From bd4ec60a566239d0d14beee337f7939d6e51f157 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 29 Jul 2016 14:41:49 +0800 Subject: [PATCH 1288/1469] PUB:20160630 What makes up the Fedora kernel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @ChrisLeeGit 好棒!翻译的精确而优雅。 --- .../20160630 What makes up the Fedora kernel.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename {translated/tech => published}/20160630 What makes up the Fedora kernel.md (70%) diff --git a/translated/tech/20160630 What makes up the Fedora kernel.md b/published/20160630 What makes up the Fedora kernel.md similarity index 70% rename from translated/tech/20160630 What makes up the Fedora kernel.md rename to published/20160630 What makes up the Fedora kernel.md index 954c4cb440..67c26ee93c 100644 --- a/translated/tech/20160630 What makes up the Fedora kernel.md +++ b/published/20160630 What makes up the Fedora kernel.md @@ -3,11 +3,11 @@ Fedora 内核是由什么构成的? ![](https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/kernel-945x400.png) -每个 Fedora 系统都运行着一个内核。许多代码段组合在一起使之成为现实。 +每个 Fedora 系统都运行着一个内核。许多代码片段组合在一起使之成为现实。 -每个 Fedora 内核都起始于一个来自于 [上游社区][1] 的基线版本,通常称之为 vanilla 内核。上游内核就是标准。(Fedora 的)目标是包含尽可能多的上游代码,这样使得 bug 修复和 API 更新更加容易,同时也会有更多的人审查代码。理想情况下,Fedora 能够直接从 kernel.org 获得内核,然后发送给所有用户。 +每个 Fedora 内核都起始于一个来自于[上游社区][1]的基线版本——通常称之为 vanilla 内核。上游内核就是标准。(Fedora 的)目标是包含尽可能多的上游代码,这样使得 bug 修复和 API 更新更加容易,同时也会有更多的人审查代码。理想情况下,Fedora 能够直接获取 kernel.org 的内核,然后发送给所有用户。 -现实情况是,使用 vanilla 内核并不能完全满足 Fedora。Vanilla 内核可能并不支持一些 Fedora 用户希望拥有的功能。用户接收的 [Fedora 内核] 是在 vanilla 内核之上打了很多补丁的内核。这些补丁被认为“不在树上”。许多这些位于补丁树之外的补丁都不会存在太久。如果某补丁能够修复一个问题,那么该补丁可能会被合并到 Fedora 树,以便用户能够更快地收到修复。当内核变基到一个新版本时,在新版本中的补丁都将被清除。 +现实情况是,使用 vanilla 内核并不能完全满足 Fedora。Vanilla 内核可能并不支持一些 Fedora 用户希望拥有的功能。用户接收的 [Fedora 内核] 是在 vanilla 内核之上打了很多补丁的内核。这些补丁被认为“不在树上(out of tree)”。许多这些位于补丁树之外的补丁都不会存在太久。如果某补丁能够修复一个问题,那么该补丁可能会被合并到 Fedora 树,以便用户能够更快地收到修复。当内核变基到一个新版本时,在新版本中的补丁都将被清除。 一些补丁会在 Fedora 内核树上存在很长时间。一个很好的例子是,安全启动补丁就是这类补丁。这些补丁提供了 Fedora 希望支持的功能,即使上游社区还没有接受它们。保持这些补丁更新是需要付出很多努力的,所以 Fedora 尝试减少不被上游内核维护者接受的补丁数量。 @@ -21,7 +21,7 @@ via: https://fedoramagazine.org/makes-fedora-kernel/ 作者:[Laura Abbott][a] 译者:[ChrisLeeGit](https://github.com/chrisleegit) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a8048d99cc63ff10bbbf7e7676ba43274a08d195 Mon Sep 17 00:00:00 2001 From: Mike Date: Fri, 29 Jul 2016 16:08:32 +0800 Subject: [PATCH 1289/1469] translated/tech/20160718 OPEN SOURCE ACCOUNTING SOFTWARE.md (#4240) * translated/tech/20160718 OPEN SOURCE ACCOUNTING SOFTWARE.md * translated/tech/20160718 OPEN SOURCE ACCOUNTING SOFTWARE.md --- ...0160718 OPEN SOURCE ACCOUNTING SOFTWARE.md | 73 ------------------- ...0160718 OPEN SOURCE ACCOUNTING SOFTWARE.md | 71 ++++++++++++++++++ 2 files changed, 71 insertions(+), 73 deletions(-) delete mode 100644 sources/tech/20160718 OPEN SOURCE ACCOUNTING SOFTWARE.md create mode 100644 translated/tech/20160718 OPEN SOURCE ACCOUNTING SOFTWARE.md diff --git a/sources/tech/20160718 OPEN SOURCE ACCOUNTING SOFTWARE.md b/sources/tech/20160718 OPEN SOURCE ACCOUNTING SOFTWARE.md deleted file mode 100644 index edc260a1bc..0000000000 --- a/sources/tech/20160718 OPEN SOURCE ACCOUNTING SOFTWARE.md +++ /dev/null @@ -1,73 +0,0 @@ -MikeCoder Translating... - -GNU KHATA: OPEN SOURCE ACCOUNTING SOFTWARE -============================================ - -Being an active Linux enthusiast, I usually introduce my friends to Linux, help them choose the best distro to suit their needs, and finally get them set with open source alternative software for their work. - -But in one case, I was pretty helpless. My uncle, who is a freelance accountant, uses a set of some pretty sophisticated paid software for work. And I wasn’t sure if I’d find anything under FOSS for him, until Yesterday. - -Abhishek was suggesting me some [cool apps][1] to check out and this particular one, GNU Khata stuck out. - -[GNU Khata][2] is an accounting tool. Or shall I say a collection of accounting tools? It is like the [Evernote][3] of economy management. It is so versatile that it can be used from personal Finance management to large scale business management, from store inventory management to corporate tax works. - -One interesting fact for you. ‘Khata’ in Hindi and other Indian languages means account and hence this accounting software is called GNU Khata. - -### INSTALLATION - -There are many installation instructions floating around the internet which actually install the older web app version of GNU Khata. Currently, GNU Khata is available only for Debian/Ubuntu and their derivatives. I suggest you follow the steps given in GNU Khata official Website to install the updated standalone. Let me give them out real quick. - -- Download the installer [here][4]. -- Open the terminal in download location. -- Copy and paste the below code in terminal and run. - -``` -sudo chmod 755 GNUKhatasetup.run -sudo ./GNUKhatasetup.run -``` - -- That’s it. Open the GNU Khata from the dash or the application menu. -### FIRST LAUNCH - -GNU Khata opens up in the browser and displays the following page. - -![](https://itsfoss.com/wp-content/uploads/2016/07/GNU-khata-1.jpg) - -Fill in the Organization name, case and organization type, financial year and click on proceed to go to the admin setup page. - -![](https://itsfoss.com/wp-content/uploads/2016/07/GNU-khata-2.jpg) - -Carefully feed in your name, password, security question and the answer and click on “create and login”. - -![](https://itsfoss.com/wp-content/uploads/2016/07/GNU-khata-3.jpg) - -You’re all set now. Use the Menu bar to start using GNU Khata to manage your finances. It’s that easy. - -### DOES GNU KHATA REALLY RIVAL THE PAID ACCOUNTING SOFTWARE IN THE MARKET? - -To begin with, GNU Khata keeps it all simple. The menu bar up top is very conveniently organized to help you work faster and better. You can choose to manage different accounts and projects and access them easily. [Their Website][5] states that GNU Khata can be “easily transformed into Indian languages”. Also, did you know that GNU Khata can be used on the cloud too? - -All the major accounting tools like ledgers, project statements, statement of affairs etc are formatted in a professional manner and are made available in both instantly presentable as well as customizable formats. It makes accounting and inventory management look so easy. - -The Project is very actively evolving, seeks feedback and guidance from practicing accountants to make improvements in the software. Considering the maturity, ease of use and the absence of a price tag, GNU Khata can be the perfect assistant in bookkeeping. - -Let us know what you think about GNU Khata in the comments below. - - - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/using-gnu-khata/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 - -作者:[Aquil Roshan][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/aquil/ -[1]: https://itsfoss.com/category/apps/ -[2]: http://www.gnukhata.in/ -[3]: https://evernote.com/ -[4]: https://cloud.openmailbox.org/index.php/s/L8ppsxtsFq1345E/download -[5]: http://www.gnukhata.in/ diff --git a/translated/tech/20160718 OPEN SOURCE ACCOUNTING SOFTWARE.md b/translated/tech/20160718 OPEN SOURCE ACCOUNTING SOFTWARE.md new file mode 100644 index 0000000000..8093f8eae2 --- /dev/null +++ b/translated/tech/20160718 OPEN SOURCE ACCOUNTING SOFTWARE.md @@ -0,0 +1,71 @@ +GNU KHATA:开源的会计管理软件 +============================================ + +作为一个活跃的 Linux 爱好者,我经常向我的朋友们介绍 Linux,帮助他们选择最适合他们的发行版本,同时也会帮助他们安装一些适用于他们工作的开源软件。 + +但是,又一次,我就变得很无奈。我的叔叔,他是一个自由职业的会计师。他会有一系列的为了会计工作的付费软件。我就不那么确定,我能在在开软软件中找到这么一款可以替代的软件。直到昨天。 + +Abhishek 给我推荐了一些[很酷的软件][1],并且,GNU Khata 这个特殊的一款,脱颖而出。 + +[GNU Khata][2] 是一个会计工具。 或者,我可以说成是一系列的会计工具集合?这像经济管理方面的[Evernote][3]。他的应用是如此之广,以至于他可以处理个人的财务管理,到大型公司的管理,从店铺存货管理到税率计算,都可以有效处理。 + +对你来说一个有趣的点,'Khata' 在印度或者是其他的印度语国家中意味着账户,所以这个会计软件叫做 GNU Khata。 + +### 安装 + +互联网上有很多关于老旧版本的 Khata 安装的介绍。现在,GNU Khata 已经可以在 Debian/Ubuntu 和他们的衍生产中得到。我建议你按照如下 GNU Khata 官网的步骤来安装。我们来一次快速的入门。 + +- 从[这][4]下载安装器。 +- 在下载目录打开终端。 +- 粘贴复制以下的代码到终端,并且执行。 + +``` +sudo chmod 755 GNUKhatasetup.run +sudo ./GNUKhatasetup.run +``` + +- 这就结束了,从你的 Dash 或者是应用菜单中启动 GNU Khata 吧。 +### 第一次启动 + +GNU Khata 在浏览器中打开,并且展现以下的画面。 + +![](https://itsfoss.com/wp-content/uploads/2016/07/GNU-khata-1.jpg) + +填写组织的名字和组织形式,经济年份并且点击 proceed 按钮进入管理设置页面。 + +![](https://itsfoss.com/wp-content/uploads/2016/07/GNU-khata-2.jpg) + +仔细填写你的姓名,密码,安全问题和他的答案,并且点击“create and login”。 + +![](https://itsfoss.com/wp-content/uploads/2016/07/GNU-khata-3.jpg) + +你已经全部设置完成了。使用菜单栏来开始使用 GNU Khata 来管理你的经济吧。这很容易。 + +### GNU KHATA 真的是市面上付费会计应用的竞争对手吗? + +首先,GNU Khata 让所有的事情变得简单。顶部的菜单栏被方便的组织,可以帮助你有效的进行工作。 你可以选择管理不同的账户和项目,并且切换非常容易。[他们的官网][5]表明,GNU Khata 可以“方便的转变成印度语”。同时,你知道 GNU Khata 也可以在云端使用吗? + +所有的主流的账户管理工具,将账簿分类,项目介绍,法规介绍等等用专业的方式整理,并且支持自定义整理和实时显示。这让会计和进存储管理看起来如此的简单。 + +这个项目正在积极的发展,从实际的操作中提交反馈来帮助这个软件更加进步。考虑到软件的成熟性,使用的便利性还有免费的 tag。GNU Khata 可能会成为最好的账簿助手。 + +请在评论框里留言吧,让我们知道你是如何看待 GNU Khata 的。 + + + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/using-gnu-khata/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 + +作者:[Aquil Roshan][a] +译者:[MikeCoder](https://github.com/MikeCoder) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/aquil/ +[1]: https://itsfoss.com/category/apps/ +[2]: http://www.gnukhata.in/ +[3]: https://evernote.com/ +[4]: https://cloud.openmailbox.org/index.php/s/L8ppsxtsFq1345E/download +[5]: http://www.gnukhata.in/ From cfe454e814f9ca9d3e27151870871b5840e9b257 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 29 Jul 2016 19:11:15 +0800 Subject: [PATCH 1290/1469] translating --- ... Real Time Photo of Earth as Your Linux Desktop Wallpaper.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160726 Set a Real Time Photo of Earth as Your Linux Desktop Wallpaper.md b/sources/tech/20160726 Set a Real Time Photo of Earth as Your Linux Desktop Wallpaper.md index 1fd552e70c..9c0f673900 100644 --- a/sources/tech/20160726 Set a Real Time Photo of Earth as Your Linux Desktop Wallpaper.md +++ b/sources/tech/20160726 Set a Real Time Photo of Earth as Your Linux Desktop Wallpaper.md @@ -1,3 +1,5 @@ +Translating---geekpi + Set a Real Time Photo of Earth as Your Linux Desktop Wallpaper ================================================================= From 6a44b74276c3da5d38d03d3265a919d6c9263537 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 29 Jul 2016 19:11:51 +0800 Subject: [PATCH 1291/1469] translating --- ...ions-to-speed-up-apt-get on Ubuntu Linux 16.04 LTS server.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160727-How-to-use-multiple-connections-to-speed-up-apt-get on Ubuntu Linux 16.04 LTS server.md b/sources/tech/20160727-How-to-use-multiple-connections-to-speed-up-apt-get on Ubuntu Linux 16.04 LTS server.md index 460dabc03c..6803f2ec47 100644 --- a/sources/tech/20160727-How-to-use-multiple-connections-to-speed-up-apt-get on Ubuntu Linux 16.04 LTS server.md +++ b/sources/tech/20160727-How-to-use-multiple-connections-to-speed-up-apt-get on Ubuntu Linux 16.04 LTS server.md @@ -1,3 +1,5 @@ +translating---geekpi + How to use multiple connections to speed up apt-get/apt on Ubuntu Linux 16.04 LTS server ========================================================================================= From f8ad5216d1ca06009f04d4bf180a6ad9e127efc7 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 29 Jul 2016 20:45:47 +0800 Subject: [PATCH 1292/1469] translated --- ...f Earth as Your Linux Desktop Wallpaper.md | 40 ------------------- ...f Earth as Your Linux Desktop Wallpaper.md | 39 ++++++++++++++++++ 2 files changed, 39 insertions(+), 40 deletions(-) delete mode 100644 sources/tech/20160726 Set a Real Time Photo of Earth as Your Linux Desktop Wallpaper.md create mode 100644 translated/tech/20160726 Set a Real Time Photo of Earth as Your Linux Desktop Wallpaper.md diff --git a/sources/tech/20160726 Set a Real Time Photo of Earth as Your Linux Desktop Wallpaper.md b/sources/tech/20160726 Set a Real Time Photo of Earth as Your Linux Desktop Wallpaper.md deleted file mode 100644 index 9c0f673900..0000000000 --- a/sources/tech/20160726 Set a Real Time Photo of Earth as Your Linux Desktop Wallpaper.md +++ /dev/null @@ -1,40 +0,0 @@ -Translating---geekpi - -Set a Real Time Photo of Earth as Your Linux Desktop Wallpaper -================================================================= - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2016/07/Screen-Shot-2016-07-26-at-16.36.47-1.jpg) - -Bored of looking at the same desktop background? Here’s something that’s (almost) out of this world. - -‘[Himawaripy][1]‘ is a small Python 3 script that fetches a near-real time picture of Earth taken by the [Japanese Himawari 8 weather satellite][2] and sets it as your desktop background. - -Once installed you can set the app to run as a cron job every 10 minutes (in the background, naturally) so that it can fetch and set a realtime picture of Earth as your desktop wallpaper. - -Because Himawari-8 is a geostationary satellite you’re only ever going to images of the earth as seen from above Australasia — but with real time weather patterns, cloud formations and lighting it’s still makes for spectacular scene, even if seeing things above the UK would be better for me! - -Advanced settings allow you to configure the quality of the images pulled from the satellite , but keep in mind that any increase in quality will result in an increased file size, and a longer download wait! - -Lastly, while this script is very similar to many others that we’ve covered over the years it is up-to-date and working. - -Get Himawaripy -Himawaripy has been tested on a range of desktop environments, including Unity, LXDE, i3, MATE and a host of other desktop environments. It is free, open-source software but is not entirely straightforward to set up and configure. - -Find all instructions on getting the app installed and set up (hint: there’s no one-click installer) on the project’s GitHub page. - -[Real time earth wallpaper script on GitHub][0] - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/mandatory-access-control-with-selinux-or-apparmor-linux/ - -作者:[ JOEY-ELIJAH SNEDDON][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://plus.google.com/117485690627814051450/?rel=author -[1]: https://github.com/boramalper/himawaripy -[2]: https://en.wikipedia.org/wiki/Himawari_8 -[0]: https://github.com/boramalper/himawaripy diff --git a/translated/tech/20160726 Set a Real Time Photo of Earth as Your Linux Desktop Wallpaper.md b/translated/tech/20160726 Set a Real Time Photo of Earth as Your Linux Desktop Wallpaper.md new file mode 100644 index 0000000000..8dc73bf150 --- /dev/null +++ b/translated/tech/20160726 Set a Real Time Photo of Earth as Your Linux Desktop Wallpaper.md @@ -0,0 +1,39 @@ +为你的Linux桌面设置一张真实的地球照片 +================================================================= + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2016/07/Screen-Shot-2016-07-26-at-16.36.47-1.jpg) + +厌倦了看同样的桌面背景了么?这里有一个几乎这世界上最好的东西。 + +‘[Himawaripy][1]‘是一个Python 3脚本,它会接近实时抓取由[日本Himawari 8气象卫星][2]拍摄的地球照片,并将它设置成你的桌面背景。 + +安装完成后,你可以将它设置成每10分钟运行的任务(自然地它是在后台运行),这样它就可以实时地取回地球的照片并设置成背景了。 + +因为Himawari-8是一颗同步轨道卫星,你只能看到澳大利亚上空的地球的图片-但是它实时的天气形态、云团和光线仍使它很壮丽,即使对我而言在看到英国上方的更好! + +高级设置允许你配置从卫星取回的图片质量,但是要记住增加图片质量会增加文件大小及更长的下载等待! + +最后,虽然这个脚本与其他我们提到过的其他类似,它还仍保持更新及可用。 + +获取Himawaripy + +Himawaripy已经在一系列的桌面环境中都测试过了,包括Unity、LXDE、i3、MATE和其他桌面环境。它是免费、开源软件但是并不能直接设置及配置。 + +在Github上查找获取安装的应用程序和设置的所有指令()提示:有没有一键安装)上。 + +[GitHub上的实时地球壁纸脚本][0] + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/mandatory-access-control-with-selinux-or-apparmor-linux/ + +作者:[ JOEY-ELIJAH SNEDDON][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://plus.google.com/117485690627814051450/?rel=author +[1]: https://github.com/boramalper/himawaripy +[2]: https://en.wikipedia.org/wiki/Himawari_8 +[0]: https://github.com/boramalper/himawaripy From b2d8ab5f01db13d78b83987fe8fb9812692f652a Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 30 Jul 2016 00:03:05 +0800 Subject: [PATCH 1293/1469] PUB:20160628 How To Setup Open Source Discussion Platform Discourse On Ubuntu Linux 16.04 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @kokialoves 请注意标点符号。 --- ...latform Discourse On Ubuntu Linux 16.04.md | 101 ++++++++++++++++++ ...latform Discourse On Ubuntu Linux 16.04.md | 101 ------------------ 2 files changed, 101 insertions(+), 101 deletions(-) create mode 100644 published/20160628 How To Setup Open Source Discussion Platform Discourse On Ubuntu Linux 16.04.md delete mode 100644 translated/tech/20160628 How To Setup Open Source Discussion Platform Discourse On Ubuntu Linux 16.04.md diff --git a/published/20160628 How To Setup Open Source Discussion Platform Discourse On Ubuntu Linux 16.04.md b/published/20160628 How To Setup Open Source Discussion Platform Discourse On Ubuntu Linux 16.04.md new file mode 100644 index 0000000000..45c5d634dc --- /dev/null +++ b/published/20160628 How To Setup Open Source Discussion Platform Discourse On Ubuntu Linux 16.04.md @@ -0,0 +1,101 @@ +如何在 Ubuntu Linux 16.04上安装开源的 Discourse 论坛 +=============================================================================== + +Discourse 是一个开源的论坛,它可以以邮件列表、聊天室或者论坛等多种形式工作。它是一个广受欢迎的现代的论坛工具。在服务端,它使用 Ruby on Rails 和 Postgres 搭建, 并且使用 Redis 缓存来减少读取时间 , 在客户端,它使用支持 Java Script 的浏览器。它非常容易定制,结构良好,并且它提供了转换插件,可以对你现存的论坛、公告板进行转换,例如: vBulletin、phpBB、Drupal、SMF 等等。在这篇文章中,我们将学习在 Ubuntu 操作系统下安装 Discourse。 + +它以安全作为设计思想,所以发垃圾信息的人和黑客们不能轻易的实现其企图。它能很好的支持各种现代设备,并可以相应的调整以手机和平板的显示。 + +### 在 Ubuntu 16.04 上安装 Discourse + +让我们开始吧 ! 最少需要 1G 的内存,并且官方支持的安装过程需要已经安装了 docker。 说到 docker,它还需要安装Git。要满足以上的两点要求我们只需要运行下面的命令: + +``` +wget -qO- https://get.docker.com/ | sh +``` + +![](http://linuxpitstop.com/wp-content/uploads/2016/06/124.png) + +用不了多久就安装好了 docker 和 Git,安装结束以后,在你的系统上的 /var 分区创建一个 Discourse 文件夹(当然你也可以选择其他的分区)。 + +``` +mkdir /var/discourse +``` + +现在我们来克隆 Discourse 的 Github 仓库到这个新建的文件夹。 + +``` +git clone https://github.com/discourse/discourse_docker.git /var/discourse +``` + +进入这个克隆的文件夹。 + +``` +cd /var/discourse +``` + +![](http://linuxpitstop.com/wp-content/uploads/2016/06/314.png) + +你将看到“discourse-setup” 脚本文件,运行这个脚本文件进行 Discourse 的初始化。 + +``` +./discourse-setup +``` + +**备注: 在安装 discourse 之前请确保你已经安装好了邮件服务器。** + +安装向导将会问你以下六个问题: + +``` +Hostname for your Discourse? +Email address for admin account? +SMTP server address? +SMTP user name? +SMTP port [587]: +SMTP password? []: +``` + +![](http://linuxpitstop.com/wp-content/uploads/2016/06/411.png) + +当你提交了以上信息以后, 它会让你提交确认, 如果一切都很正常,点击回车以后安装开始。 + +![](http://linuxpitstop.com/wp-content/uploads/2016/06/511.png) + +现在“坐等放宽”,需要花费一些时间来完成安装,倒杯咖啡,看看有什么错误信息没有。 + +![](http://linuxpitstop.com/wp-content/uploads/2016/06/610.png) + +安装成功以后看起来应该像这样。 + +![](http://linuxpitstop.com/wp-content/uploads/2016/06/710.png) + +现在打开浏览器,如果已经做了域名解析,你可以使用你的域名来连接 Discourse 页面 ,否则你只能使用IP地址了。你将看到如下信息: + +![](http://linuxpitstop.com/wp-content/uploads/2016/06/85.png) + +就是这个,点击 “Sign Up” 选项创建一个新的账户,然后进行你的 Discourse 设置。 + +![](http://linuxpitstop.com/wp-content/uploads/2016/06/106.png) + +### 结论 + +它安装简便,运行完美。 它拥有现代论坛所有必备功能。它以 GPL 发布,是完全开源的产品。简单、易用、以及特性丰富是它的最大特点。希望你喜欢这篇文章,如果有问题,你可以给我们留言。 + +-------------------------------------------------------------------------------- + +via: http://linuxpitstop.com/install-discourse-on-ubuntu-linux-16-04/ + +作者:[Aun][a] +译者:[kokialoves](https://github.com/kokialoves) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://linuxpitstop.com/author/aun/ + + + + + + + + diff --git a/translated/tech/20160628 How To Setup Open Source Discussion Platform Discourse On Ubuntu Linux 16.04.md b/translated/tech/20160628 How To Setup Open Source Discussion Platform Discourse On Ubuntu Linux 16.04.md deleted file mode 100644 index 742fd381dd..0000000000 --- a/translated/tech/20160628 How To Setup Open Source Discussion Platform Discourse On Ubuntu Linux 16.04.md +++ /dev/null @@ -1,101 +0,0 @@ -如何在 Ubuntu Linux 16.04上安装开源的Discourse论坛 -=============================================================================== - -Discourse 是一个开源的论坛, 它可以以邮件列表, 聊天室或者论坛等多种形式工作. 它是一个广受欢迎的现代的论坛工具. 在服务端,它使用Ruby on Rails 和 Postgres 搭建, 并且使用Redis caching 减少读取时间 , 在客户端, 它用浏览器的Java Script运行. 它是一个非常好的定制和构架工具. 并且它提供了转换插件对你现存的论坛进行转换例如: vBulletin, phpBB, Drupal, SMF 等等. 在这篇文章中, 我们将学习在Ubuntu操作系统下安装 Discourse. - -它是基于安全开发的, 黑客们不能轻易的发现漏洞. 它能很好的支持各个平台, 相应的调整手机和平板的显示设置. - -### Installing Discourse on Ubuntu 16.04 - -让我们开始吧 ! 最少需要1G的内存并且你要保证dockers已经安装了. 说到dockers, 它还需要安装Git. 要达到以上的两点要求我们只需要运行下面的命令. - -``` -wget -qO- https://get.docker.com/ | sh -``` - -![](http://linuxpitstop.com/wp-content/uploads/2016/06/124.png) - -用不了多久就安装好了Docker 和 Git, 安装结束以后, 创建一个 Discourse 文件夹在 /var 分区 (当然你也可以选择其他的分区). - -``` -mkdir /var/discourse -``` - -现在我们来克隆 Discourse’s Github 项目到这个新建的文件夹. - -``` -git clone https://github.com/discourse/discourse_docker.git /var/discourse -``` - -进入克隆文件夹. - -``` -cd /var/discourse -``` - -![](http://linuxpitstop.com/wp-content/uploads/2016/06/314.png) - -你将 看到“discourse-setup” 脚本文件, 运行这个脚本文件进行Discourse的初始化. - -``` -./discourse-setup -``` - -**Side note: 在安装discourse之前请确保你已经安装了邮件服务器.** - -安装向导将会问你以下六个问题. - -``` -Hostname for your Discourse? -Email address for admin account? -SMTP server address? -SMTP user name? -SMTP port [587]: -SMTP password? []: -``` - -![](http://linuxpitstop.com/wp-content/uploads/2016/06/411.png) - -当你提交了以上信息以后, 它会让你提交确认, 恩一切都很正常, 点击回车以后安装开始. - -![](http://linuxpitstop.com/wp-content/uploads/2016/06/511.png) - -现在坐下来,倒杯茶,看看有什么错误信息没有. - -![](http://linuxpitstop.com/wp-content/uploads/2016/06/610.png) - -安装成功以后看起来应该像这样. - -![](http://linuxpitstop.com/wp-content/uploads/2016/06/710.png) - -现在打开浏览器, 如果已经做了域名解析, 你可以使用你的域名来连接Discourse页面 , 否则你只能使用IP地址了. 你讲看到如下信息: - -![](http://linuxpitstop.com/wp-content/uploads/2016/06/85.png) - -就是这个, 用 “Sign Up” 选项创建一个新管理账户. - -![](http://linuxpitstop.com/wp-content/uploads/2016/06/106.png) - -### 结论 - -它是安装简便安全易用的. 它拥有当前所有论坛功能. 它支持所有的开源产品. 简单, 易用, 各类实用的功能. 希望你喜欢这篇文章你可以给我们留言. - --------------------------------------------------------------------------------- - -via: http://linuxpitstop.com/install-discourse-on-ubuntu-linux-16-04/ - -作者:[Aun][a] -译者:[kokialoves](https://github.com/kokialoves) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://linuxpitstop.com/author/aun/ - - - - - - - - From 8c8bba067989fd9c536a9aaf7bc118f3bc1c2033 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 30 Jul 2016 06:32:57 +0800 Subject: [PATCH 1294/1469] translated --- ...f Earth as Your Linux Desktop Wallpaper.md | 2 +- ...pt-get on Ubuntu Linux 16.04 LTS server.md | 74 +++++++++---------- 2 files changed, 37 insertions(+), 39 deletions(-) rename {sources => translated}/tech/20160727-How-to-use-multiple-connections-to-speed-up-apt-get on Ubuntu Linux 16.04 LTS server.md (64%) diff --git a/translated/tech/20160726 Set a Real Time Photo of Earth as Your Linux Desktop Wallpaper.md b/translated/tech/20160726 Set a Real Time Photo of Earth as Your Linux Desktop Wallpaper.md index 8dc73bf150..d05fd97eb2 100644 --- a/translated/tech/20160726 Set a Real Time Photo of Earth as Your Linux Desktop Wallpaper.md +++ b/translated/tech/20160726 Set a Real Time Photo of Earth as Your Linux Desktop Wallpaper.md @@ -28,7 +28,7 @@ Himawaripy已经在一系列的桌面环境中都测试过了,包括Unity、LX via: http://www.tecmint.com/mandatory-access-control-with-selinux-or-apparmor-linux/ 作者:[ 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/) 荣誉推出 diff --git a/sources/tech/20160727-How-to-use-multiple-connections-to-speed-up-apt-get on Ubuntu Linux 16.04 LTS server.md b/translated/tech/20160727-How-to-use-multiple-connections-to-speed-up-apt-get on Ubuntu Linux 16.04 LTS server.md similarity index 64% rename from sources/tech/20160727-How-to-use-multiple-connections-to-speed-up-apt-get on Ubuntu Linux 16.04 LTS server.md rename to translated/tech/20160727-How-to-use-multiple-connections-to-speed-up-apt-get on Ubuntu Linux 16.04 LTS server.md index 6803f2ec47..4824bd7f7d 100644 --- a/sources/tech/20160727-How-to-use-multiple-connections-to-speed-up-apt-get on Ubuntu Linux 16.04 LTS server.md +++ b/translated/tech/20160727-How-to-use-multiple-connections-to-speed-up-apt-get on Ubuntu Linux 16.04 LTS server.md @@ -1,31 +1,29 @@ -translating---geekpi - -How to use multiple connections to speed up apt-get/apt on Ubuntu Linux 16.04 LTS server +如何在Ubuntu Linux 16.04 LTS中使用多条连接加速apt-get/apt ========================================================================================= -ow do I speed up my apt-get or apt command to download packages from multiple repos on a Ubuntu Linux 16.04 or 14.04 LTS server? +我该如何在Ubuntu Linux 16.04或者14.04 LTS中从多个仓库中下载包来加速apt-get或者apt命令? -You need to use apt-fast shell script wrapper. It should speed up apt-get command/apt command and aptitude command by downloading packages with multiple connections per package. All packages are downloaded simultaneously in parallel. It uses aria2c as default download accelerator. +你需要使用到apt-fast这个脚本。它会通过多个连接同时下载一个包来加速apt-get/apt和aptitude命令。所有的包都会同时下载。它使用aria2c作为默认的下载加速。 -### Install apt-fast tool +### 安装 apt-fast 工具 -Type the following command on Ubuntu Linux 14.04 and later versions: +在Ubuntu Linux 14.04或者之后的版本尝试下面的命令: ``` $ sudo add-apt-repository ppa:saiarcot895/myppa ``` -Sample outputs: +示例输出: ![](http://s0.cyberciti.org/uploads/faq/2016/07/install-apt-fast-repo.jpg) -Update your repo: +更新你的仓库: ``` $ sudo apt-get update ``` -OR +或者 ``` $ sudo apt update @@ -33,19 +31,19 @@ $ sudo apt update ![](http://s0.cyberciti.org/uploads/faq/2016/07/install-apt-fast-command.jpg) -Install apt-fast shell wrapper: +安装 apt-fast: ``` $ sudo apt-get -y install apt-fast ``` -OR +或者 ``` $ sudo apt -y install apt-fast ``` -Sample outputs: +示例输出: ``` @@ -69,122 +67,122 @@ Get:4 http://01.archive.ubuntu.com/ubuntu xenial/universe amd64 aria2 amd64 1.19 54% [4 aria2 486 kB/1,143 kB 42%] 20.4 kB/s 32s ``` -### Configure apt-fast +### 配置 apt-fast -You will be prompted as follows (a value between 5 and 16 must be entered): +你将会得到下面的提示(必须输入一个5到16的数值): ![](http://s0.cyberciti.org/uploads/faq/2016/07/max-connection-10.jpg) -And: +并且 ![](http://s0.cyberciti.org/uploads/faq/2016/07/apt-fast-confirmation-box.jpg) -You can edit settings directly too: +你可以直接编辑设置: ``` $ sudo vi /etc/apt-fast.conf ``` ->**Please note that this tool is not for slow network connections; it is for fast network connections. If you have a slow connection to the Internet, you are not going to benefit by this tool.** +>**请注意这个工具并不是给慢速网络连接的,它是给快速网络连接的。如果你的网速慢,那么你将无法从这个工具中得到好处。** -### How do I use apt-fast command? +### 我该怎么使用 apt-fast 命令? -The syntax is: +语法是: ``` apt-fast command apt-fast [options] command ``` -#### To retrieve new lists of packages using apt-fast +#### 使用apt-fast取回新的包列表 ``` sudo apt-fast update ``` -#### To perform an upgrade using apt-fast +#### 使用apt-fast执行升级 ``` sudo apt-fast upgrade ``` -#### To perform distribution upgrade (release or force kernel upgrade), enter: +#### 执行发行版升级(发布或者强制内核升级),输入: ``` $ sudo apt-fast dist-upgrade ``` -#### To install new packages +#### 安装新的包 -The syntax is: +语法是: ``` sudo apt-fast install pkg ``` -For example, install nginx package, enter: +比如要安装nginx,输入: ``` $ sudo apt-fast install nginx ``` -Sample outputs: +示例输出: ![](http://s0.cyberciti.org/uploads/faq/2016/07/sudo-apt-fast-install.jpg) -#### To remove packages +#### 删除包 ``` $ sudo apt-fast remove pkg $ sudo apt-fast remove nginx ``` -#### To remove packages and its config files too +#### 删除包和它的配置文件 ``` $ sudo apt-fast purge pkg $ sudo apt-fast purge nginx ``` -#### To remove automatically all unused packages, enter: +#### 删除所有未使用的包 ``` $ sudo apt-fast autoremove ``` -#### To Download source archives +#### 下载源码包 ``` $ sudo apt-fast source pkgNameHere ``` -#### To erase downloaded archive files +#### 清理下载的文件 ``` $ sudo apt-fast clean ``` -#### To erase old downloaded archive files +#### 清理旧的下载文件 ``` $ sudo apt-fast autoclean ``` -#### To verify that there are no broken dependencies +#### 验证没有破坏的依赖 ``` $ sudo apt-fast check ``` -#### To download the binary package into the current directory +#### 下载二进制包到当前目录 ``` $ sudo apt-fast download pkgNameHere $ sudo apt-fast download nginx ``` -Sample outputs: +示例输出: ``` [#7bee0c 0B/0B CN:1 DL:0B] @@ -198,7 +196,7 @@ Status Legend: (OK):download completed. ``` -#### To download and display the changelog for the given package +#### 下载并显示指定包的changelog ``` $ sudo apt-fast changelog pkgNameHere @@ -212,7 +210,7 @@ $ sudo apt-fast changelog nginx via: https://fedoramagazine.org/introducing-flatpak/ 作者:[VIVEK GITE][a] -译者:[zky001](https://github.com/zky001) +译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 59a3e3f759a1d8a72857f77c2600391f290ba036 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 30 Jul 2016 06:41:09 +0800 Subject: [PATCH 1295/1469] Update 20160727-How-to-use-multiple-connections-to-speed-up-apt-get on Ubuntu Linux 16.04 LTS server.md --- ...ions-to-speed-up-apt-get on Ubuntu Linux 16.04 LTS server.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20160727-How-to-use-multiple-connections-to-speed-up-apt-get on Ubuntu Linux 16.04 LTS server.md b/translated/tech/20160727-How-to-use-multiple-connections-to-speed-up-apt-get on Ubuntu Linux 16.04 LTS server.md index 4824bd7f7d..e36813cdc9 100644 --- a/translated/tech/20160727-How-to-use-multiple-connections-to-speed-up-apt-get on Ubuntu Linux 16.04 LTS server.md +++ b/translated/tech/20160727-How-to-use-multiple-connections-to-speed-up-apt-get on Ubuntu Linux 16.04 LTS server.md @@ -3,7 +3,7 @@ 我该如何在Ubuntu Linux 16.04或者14.04 LTS中从多个仓库中下载包来加速apt-get或者apt命令? -你需要使用到apt-fast这个脚本。它会通过多个连接同时下载一个包来加速apt-get/apt和aptitude命令。所有的包都会同时下载。它使用aria2c作为默认的下载加速。 +你需要使用到apt-fast这个shell封装器。它会通过多个连接同时下载一个包来加速apt-get/apt和aptitude命令。所有的包都会同时下载。它使用aria2c作为默认的下载加速。 ### 安装 apt-fast 工具 From 89dd3858da807582e575a98b2c97759976278ee2 Mon Sep 17 00:00:00 2001 From: Christopher L Date: Sat, 30 Jul 2016 16:02:11 +0800 Subject: [PATCH 1296/1469] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20160722 Keeweb A Linux Password Manager.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20160722 Keeweb A Linux Password Manager.md b/sources/tech/20160722 Keeweb A Linux Password Manager.md index b829ea107e..b55de2a4cb 100644 --- a/sources/tech/20160722 Keeweb A Linux Password Manager.md +++ b/sources/tech/20160722 Keeweb A Linux Password Manager.md @@ -1,3 +1,5 @@ +Being translated by ChrisLeeGit + Keeweb A Linux Password Manager ================================ @@ -52,7 +54,7 @@ I have already posted about two other Linux password managers, Keepass and Encry via: http://www.tecmint.com/mandatory-access-control-with-selinux-or-apparmor-linux/ 作者:[author][a] -译者:[译者ID](https://github.com/译者ID) +译者:[ChrisLeeGit](https://github.com/chrisleegit) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From e0a9969aac1cd53e6b47fef5fa67f0f4ae8e92ac Mon Sep 17 00:00:00 2001 From: cposture Date: Sat, 30 Jul 2016 22:09:51 +0800 Subject: [PATCH 1297/1469] Translating 20%: --- ...18 An Introduction to Mocking in Python.md | 138 +++++++++--------- 1 file changed, 67 insertions(+), 71 deletions(-) diff --git a/sources/tech/20160618 An Introduction to Mocking in Python.md b/sources/tech/20160618 An Introduction to Mocking in Python.md index 182f596431..9c6c912b60 100644 --- a/sources/tech/20160618 An Introduction to Mocking in Python.md +++ b/sources/tech/20160618 An Introduction to Mocking in Python.md @@ -1,34 +1,36 @@ -Translating by cposture 2016-07-29 -An Introduction to Mocking in Python +Mock 在 Python 中的使用介绍 ===================================== +http://www.oschina.net/translate/an-introduction-to-mocking-in-python?cmp +本文讲述的是 Python 中 Mock 的使用 -This article is about mocking in python, +**如何在避免测试你的耐心的情景下执行单元测试** -**How to Run Unit Tests Without Testing Your Patience** +通常,我们编写的软件会直接与我们称之为肮脏无比的服务交互。用外行人的话说:交互已设计好的服务对我们的应用程序很重要,但是这会带来我们不希望的副作用,也就是那些在我们自己测试的时候不希望的功能。例如:我们正在写一个社交 app,并且想要测试一下我们 "发布到 Facebook" 的新功能,但是不想每次运行测试集的时候真的发布到 Facebook。 -More often than not, the software we write directly interacts with what we would label as “dirty” services. In layman’s terms: services that are crucial to our application, but whose interactions have intended but undesired side-effects—that is, undesired in the context of an autonomous test run.For example: perhaps we’re writing a social app and want to test out our new ‘Post to Facebook feature’, but don’t want to actually post to Facebook every time we run our test suite. -The Python unittest library includes a subpackage named unittest.mock—or if you declare it as a dependency, simply mock—which provides extremely powerful and useful means by which to mock and stub out these undesired side-effects. +Python 的单元测试库包含了一个名为 unittest.mock 或者可以称之为依赖的子包,简言之为 mock——其提供了极其强大和有用的方法,通过它们可以模拟和打桩我们不希望的副作用。 + >Source | -Note: mock is [newly included][1] in the standard library as of Python 3.3; prior distributions will have to use the Mock library downloadable via [PyPI][2]. +注意:mock [最近收录][1]到了 Python 3.3 的标准库中;先前发布的版本必须通过 [PyPI][2] 下载 Mock 库。 +### ### Fear System Calls -To give you another example, and one that we’ll run with for the rest of the article, consider system calls. It’s not difficult to see that these are prime candidates for mocking: whether you’re writing a script to eject a CD drive, a web server which removes antiquated cache files from /tmp, or a socket server which binds to a TCP port, these calls all feature undesired side-effects in the context of your unit-tests. +再举另一个例子,思考一个我们会在余文讨论的系统调用。不难发现,这些系统调用都是主要的模拟对象:无论你是正在写一个可以弹出 CD 驱动的脚本,还是一个用来删除 /tmp 下过期的缓存文件的 Web 服务,这些调用都是在你的单元测试上下文中不希望的副作用。 ->As a developer, you care more that your library successfully called the system function for ejecting a CD as opposed to experiencing your CD tray open every time a test is run. +> 作为一个开发者,你需要更关心你的库是否成功地调用了一个可以弹出 CD 的系统函数,而不是切身经历 CD 托盘每次在测试执行的时候都打开了。 -As a developer, you care more that your library successfully called the system function for ejecting a CD (with the correct arguments, etc.) as opposed to actually experiencing your CD tray open every time a test is run. (Or worse, multiple times, as multiple tests reference the eject code during a single unit-test run!) +作为一个开发者,你需要更关心你的库是否成功地调用了一个可以弹出 CD 的系统函数(使用了正确的参数等等),而不是切身经历 CD 托盘每次在测试执行的时候都打开了。(或者更糟糕的是,很多次,在一个单元测试运行期间多个测试都引用了弹出代码!) -Likewise, keeping your unit-tests efficient and performant means keeping as much “slow code” out of the automated test runs, namely filesystem and network access. +同样,保持你的单元测试的效率和性能意味着需要让如此多的 "缓慢代码" 远离自动测试,比如文件系统和网络访问。 -For our first example, we’ll refactor a standard Python test case from original form to one using mock. We’ll demonstrate how writing a test case with mocks will make our tests smarter, faster, and able to reveal more about how the software works. +对于我们首个例子,我们要从原始形式到使用 mock 地重构一个标准 Python 测试用例。我们会演示如何使用 mock 写一个测试用例使我们的测试更加智能、快速,并且能展示更多关于我们软件的工作原理。 -### A Simple Delete Function +### 一个简单的删除函数 -We all need to delete files from our filesystem from time to time, so let’s write a function in Python which will make it a bit easier for our scripts to do so. +有时,我们都需要从文件系统中删除文件,因此,让我们在 Python 中写一个可以使我们的脚本更加轻易完成此功能的函数。 ``` #!/usr/bin/env python @@ -40,9 +42,9 @@ def rm(filename): os.remove(filename) ``` -Obviously, our rm method at this point in time doesn’t provide much more than the underlying os.remove method, but our codebase will improve, allowing us to add more functionality here. +很明显,我们的 rm 方法此时无法提供比相关 os.remove 方法更多的功能,但我们的基础代码会逐步改善,允许我们在这里添加更多的功能。 -Let’s write a traditional test case, i.e., without mocks: +让我们写一个传统的测试用例,即,没有使用 mock: ``` #!/usr/bin/env python @@ -61,7 +63,7 @@ class RmTestCase(unittest.TestCase): def setUp(self): with open(self.tmpfilepath, "wb") as f: f.write("Delete me!") - + def test_rm(self): # remove the file rm(self.tmpfilepath) @@ -69,9 +71,11 @@ class RmTestCase(unittest.TestCase): self.assertFalse(os.path.isfile(self.tmpfilepath), "Failed to remove the file.") ``` -Our test case is pretty simple, but every time it is run, a temporary file is created and then deleted. Additionally, we have no way of testing whether our rm method properly passes the argument down to the os.remove call. We can assume that it does based on the test above, but much is left to be desired. +我们的测试用例相当简单,但是当它每次运行的时候,它都会创建一个临时文件并且随后删除。此外,我们没有办法测试我们的 rm 方法是否正确地将我们的参数向下传递给 os.remove 调用。我们可以基于以上的测试认为它做到了,但还有很多需要改进的地方。 -Refactoring with MocksLet’s refactor our test case using mock: +### 使用 Mock 重构 + +让我们使用 mock 重构我们的测试用例: ``` #!/usr/bin/env python @@ -83,7 +87,7 @@ import mock import unittest class RmTestCase(unittest.TestCase): - + @mock.patch('mymodule.os') def test_rm(self, mock_os): rm("any path") @@ -91,10 +95,11 @@ class RmTestCase(unittest.TestCase): mock_os.remove.assert_called_with("any path") ``` -With these refactors, we have fundamentally changed the way that the test operates. Now, we have an insider, an object we can use to verify the functionality of another. +使用这些重构,我们从根本上改变了该测试用例的运行方式。现在,我们有一个可以用于验证其他功能的内部对象。 -### Potential Pitfalls +### 潜在陷阱 +第一件需要注意的事情就是,我们使用了用于模拟 mock.patch 方法的装饰器位于mymodule.os One of the first things that should stick out is that we’re using the mock.patch method decorator to mock an object located at mymodule.os, and injecting that mock into our test case method. Wouldn’t it make more sense to just mock os itself, rather than the reference to it at mymodule.os? Well, Python is somewhat of a sneaky snake when it comes to imports and managing modules. At runtime, the mymodule module has its own os which is imported into its own local scope in the module. Thus, if we mock os, we won’t see the effects of the mock in the mymodule module. @@ -135,23 +140,23 @@ import mock import unittest class RmTestCase(unittest.TestCase): - + @mock.patch('mymodule.os.path') @mock.patch('mymodule.os') def test_rm(self, mock_os, mock_path): # set up the mock mock_path.isfile.return_value = False - + rm("any path") - + # test that the remove call was NOT called. self.assertFalse(mock_os.remove.called, "Failed to not remove the file if not present.") - + # make the file 'exist' mock_path.isfile.return_value = True - + rm("any path") - + mock_os.remove.assert_called_with("any path") ``` @@ -190,26 +195,26 @@ import mock import unittest class RemovalServiceTestCase(unittest.TestCase): - + @mock.patch('mymodule.os.path') @mock.patch('mymodule.os') def test_rm(self, mock_os, mock_path): # instantiate our service reference = RemovalService() - + # set up the mock mock_path.isfile.return_value = False - + reference.rm("any path") - + # test that the remove call was NOT called. self.assertFalse(mock_os.remove.called, "Failed to not remove the file if not present.") - + # make the file 'exist' mock_path.isfile.return_value = True - + reference.rm("any path") - + mock_os.remove.assert_called_with("any path") ``` @@ -228,13 +233,13 @@ class RemovalService(object): def rm(self, filename): if os.path.isfile(filename): os.remove(filename) - + class UploadService(object): def __init__(self, removal_service): self.removal_service = removal_service - + def upload_complete(self, filename): self.removal_service.rm(filename) ``` @@ -262,29 +267,29 @@ import mock import unittest class RemovalServiceTestCase(unittest.TestCase): - + @mock.patch('mymodule.os.path') @mock.patch('mymodule.os') def test_rm(self, mock_os, mock_path): # instantiate our service reference = RemovalService() - + # set up the mock mock_path.isfile.return_value = False - + reference.rm("any path") - + # test that the remove call was NOT called. self.assertFalse(mock_os.remove.called, "Failed to not remove the file if not present.") - + # make the file 'exist' mock_path.isfile.return_value = True - + reference.rm("any path") - + mock_os.remove.assert_called_with("any path") - - + + class UploadServiceTestCase(unittest.TestCase): @mock.patch.object(RemovalService, 'rm') @@ -292,13 +297,13 @@ class UploadServiceTestCase(unittest.TestCase): # build our dependencies removal_service = RemovalService() reference = UploadService(removal_service) - + # call upload_complete, which should, in turn, call `rm`: reference.upload_complete("my uploaded file") - + # check that it called the rm method of any RemovalService mock_rm.assert_called_with("my uploaded file") - + # check that it called the rm method of _our_ removal_service removal_service.rm.assert_called_with("my uploaded file") ``` @@ -339,39 +344,39 @@ import mock import unittest class RemovalServiceTestCase(unittest.TestCase): - + @mock.patch('mymodule.os.path') @mock.patch('mymodule.os') def test_rm(self, mock_os, mock_path): # instantiate our service reference = RemovalService() - + # set up the mock mock_path.isfile.return_value = False - + reference.rm("any path") - + # test that the remove call was NOT called. self.assertFalse(mock_os.remove.called, "Failed to not remove the file if not present.") - + # make the file 'exist' mock_path.isfile.return_value = True - + reference.rm("any path") - + mock_os.remove.assert_called_with("any path") - - + + class UploadServiceTestCase(unittest.TestCase): def test_upload_complete(self, mock_rm): # build our dependencies mock_removal_service = mock.create_autospec(RemovalService) reference = UploadService(mock_removal_service) - + # call upload_complete, which should, in turn, call `rm`: reference.upload_complete("my uploaded file") - + # test that it called the rm method mock_removal_service.rm.assert_called_with("my uploaded file") ``` @@ -427,7 +432,7 @@ To finish up, let’s write a more applicable real-world example, one which we m import facebook class SimpleFacebook(object): - + def __init__(self, oauth_token): self.graph = facebook.GraphAPI(oauth_token) @@ -445,7 +450,7 @@ import mock import unittest class SimpleFacebookTestCase(unittest.TestCase): - + @mock.patch.object(facebook.GraphAPI, 'put_object', autospec=True) def test_post_message(self, mock_put_object): sf = simple_facebook.SimpleFacebook("fake oauth token") @@ -480,12 +485,3 @@ via: http://slviki.com/index.php/2016/06/18/introduction-to-mocking-in-python/ [6]: http://www.voidspace.org.uk/python/mock/mock.html [7]: http://www.toptal.com/qa/how-to-write-testable-code-and-why-it-matters [8]: http://www.toptal.com/python - - - - - - - - - From 9f91c8b545c4e0d0f3d9080e8ecbcb1fe4b35167 Mon Sep 17 00:00:00 2001 From: cposture Date: Sat, 30 Jul 2016 23:38:30 +0800 Subject: [PATCH 1298/1469] Translating 21% --- .../tech/20160618 An Introduction to Mocking in Python.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sources/tech/20160618 An Introduction to Mocking in Python.md b/sources/tech/20160618 An Introduction to Mocking in Python.md index 9c6c912b60..64c26b8ec5 100644 --- a/sources/tech/20160618 An Introduction to Mocking in Python.md +++ b/sources/tech/20160618 An Introduction to Mocking in Python.md @@ -99,15 +99,19 @@ class RmTestCase(unittest.TestCase): ### 潜在陷阱 -第一件需要注意的事情就是,我们使用了用于模拟 mock.patch 方法的装饰器位于mymodule.os +第一件需要注意的事情就是,我们使用了位于 mymodule.os 且用于模拟对象的 mock.patch 方法装饰器,并且将该 mock 注入到我们的测试用例方法。相比在 mymodule.os 引用它,那么只是模拟 os 本身,会不会更有意义? One of the first things that should stick out is that we’re using the mock.patch method decorator to mock an object located at mymodule.os, and injecting that mock into our test case method. Wouldn’t it make more sense to just mock os itself, rather than the reference to it at mymodule.os? +当然,当涉及到导入和管理模块,Python 的用法非常灵活。在运行时,mymodule 模块拥有被导入到本模块局部作用域的 os。因此,如果我们模拟 os,我们是看不到模拟在 mymodule 模块中的作用的。 Well, Python is somewhat of a sneaky snake when it comes to imports and managing modules. At runtime, the mymodule module has its own os which is imported into its own local scope in the module. Thus, if we mock os, we won’t see the effects of the mock in the mymodule module. +这句话需要深刻地记住: The mantra to keep repeating is this: +> 模拟测试一个项目,只需要了解它用在哪里,而不是它从哪里来。 > Mock an item where it is used, not where it came from. + If you need to mock the tempfile module for myproject.app.MyElaborateClass, you probably need to apply the mock to myproject.app.tempfile, as each module keeps its own imports. With that pitfall out of the way, let’s keep mocking. From a236f0fac4ec7d07f9c3bc8924f96e5039d5082b Mon Sep 17 00:00:00 2001 From: maywanting Date: Sun, 31 Jul 2016 00:11:26 +0800 Subject: [PATCH 1299/1469] finish the translation of 20160721 5 tricks for getting started with Vim.md --- ...1 5 tricks for getting started with Vim.md | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 translated/tech/20160721 5 tricks for getting started with Vim.md diff --git a/translated/tech/20160721 5 tricks for getting started with Vim.md b/translated/tech/20160721 5 tricks for getting started with Vim.md new file mode 100644 index 0000000000..7e9808d6d0 --- /dev/null +++ b/translated/tech/20160721 5 tricks for getting started with Vim.md @@ -0,0 +1,60 @@ +Vim 学习的 5 个技巧 +===================================== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/education/BUSINESS_peloton.png?itok=nuMbW9d3) + +多年来,我一直想学 Vim 。如今 Vim 是我最喜欢的 Linux 文本编辑器,也是开发者和系统管理者最喜爱的开源工具。我说的学习,指的是真正意义上的学习。想要精通确实很难,所以我只想要达到熟练的水平。根据我多年使用 Linux 的经验,我会的也仅仅只是打开一个文件,使用上下左右箭头按键来移动光标,切换到 insert 模式,更改一些文本,保存,然后退出。 + +但那只是 Vim 的最基本操作。我可以在终端修改文本文档,但是无法使用任何一个我想象中强大的文本处理功能。这样我无法说明 Vim 完全优于 Pico 和 Nano 。 + +所以到底为什么要学习 Vim ?因为我需要花费相当多的时间用于编辑文本,而且有很大的效率提升空间。为什么不选择 Emacs ,或者是更为现代化的编辑器例如 Atom ?因为 Vim 适合我,至少我有一丁点的使用经验。而且,很重要的一点就是,在我需要处理的系统上很少碰见没有装 Vim 或者它的简化版(Vi)。如果你有强烈的欲望想学习 Emacs ,我希望这些对于 Emacs 同类编辑器的建议能对你有所帮助。 + +花了几周的时间专注提高我的 Vim 使用技巧之后,我想分享的第一个建议就是必须使用工具。虽然这看起来就是明知故问的回答,但事实上比我所想的在代码层面上还要困难。我的大多数工作是在网页浏览器上进行的,而且我每次都得有针对性的用 Gedit 打开并修改一段浏览器之外的文本。Gedit 需要快捷键来启动,所以第一步就是移出快捷键然后替换成 Vim 的快捷键。 + +为了跟更好的学习 Vim ,我尝试了很多。如果你也正想学习,以下列举了一些作为推荐。 + +### Vimtutor + +通常如何开始学习最好就是使用应用本身。我找到一个小的应用叫 Vimtutor ,当你在学习编辑一个文本时它能辅导你一些基础知识,它向我展示了很多我这些年都忽视的基础命令。Vimtutor 上到处都是 Vim 影子,如果你的系统上没有 Vim ,Vimtutor可以很容易从你的包管理器上下载。 + +### GVim + +我知道并不是每个人都看好这个,但就是它让我从使用在终端的 Vim 转战到使用 GVim 来满足我基本编辑需求。反对者表示 GVim 鼓励使用鼠标,而 Vim 主要是为键盘党设计的。但是我能通过 GVim 的下拉菜单快速找到想找的指令,并且 GVim 可以提醒我正确的指令然后通过敲键盘执行它。努力学习一个新的编辑器然后陷入无法解决的困境,这种感觉并不好受。每隔几分钟读一下 man 出来的文字或者使用搜索引擎来提醒你指令也并不是最好的学习新事务的方法。 + +### Keyboard maps + +当我转战 GVim ,我发现有一个键盘的“作弊表”来提醒我最基础的按键很是便利。网上有很多这种可用的表,你可以下载,打印,然后贴在你身边的某一处地方。但是为了我的笔记本键盘,我选择买一沓便签纸。这些便签纸在美国不到10美元,而且当我使用键盘编辑文本尝试新的命令的时候,可以随时提醒我。 + +### Vimium + +上文提到,我工作都在浏览器上进行。其中一条我觉得很有帮助的建议就是,使用 [Vimium](1)来用增强使用 Vim 的体验。Vimium 是 Chrome 浏览器上的一个开源插件,能用 Vim 的指令快捷操作 Chrome。当我有意识的使用快捷键切换文本的次数越少时,这说明我越来越多的使用这些快捷键。同样的扩展 Firefox 上也有,例如 [Vimerator](2)。 + +### 人 + +毫无疑问,最好的学习方法就是求助于在你之前探索过的人,让他给你建议、反馈和解决方法。 + +如果你住在一个大城市,那么附近可能会有一个 Vim meetup 组,不然就是在 Freenode IRC 上的 #vim 频道。#vim 频道是 Freenode 上最活跃的频道之一,那上面可以针对你个人的问题来提供帮助。听上面的人发发牢骚或者看看别人尝试解决自己没有遇到过的问题,仅仅是这样我都觉得很有趣。 + +------ + +所以是什么成就了现在?如今便是极好。为它所花的时间是否值得就在于之后它为你节省了多少时间。但是我经常收到意外的惊喜与快乐,当我发现一个新的按键指令来复制、跳过词,或者一些相似的小技巧。每天我至少可以看见,一点点回报,正在逐渐配得上当初的付出。 + +学习 Vim 并不仅仅只有这些建议,还有很多。我很喜欢指引别人去 [Vim Advantures](3),它是一种只能使用 Vim 的快捷键的在线游戏。而且某天我发现了一个非常神奇的虚拟学习工具,在 [Vimgifts.com](4),那上面有明确的你想要的:用一个 gif 动图来描述,使用一点点 Vim 操作来达到他们想要的。 + +你有花时间学习 Vim 吗?或者有遇到任何关于按键复杂的插件的问题吗?什么适合你,你认为这些努力值得吗?效率的提高有达到你的预期?分享你们的故事在下面的评论区吧。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/16/7/tips-getting-started-vim + +作者:[Jason Baker ][a] +译者:[maywanting](https://github.com/maywanting) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jason-baker +[1]: https://github.com/philc/vimium +[2]: http://www.vimperator.org/ +[3]: http://vim-adventures.com/ +[4]: http://vimgifs.com/ From 15019d3beb05f47dfafc302ec178301df9506e5e Mon Sep 17 00:00:00 2001 From: maywanting Date: Sun, 31 Jul 2016 00:22:24 +0800 Subject: [PATCH 1300/1469] change the small sign --- ...1 5 tricks for getting started with Vim.md | 62 ------------------- ...1 5 tricks for getting started with Vim.md | 14 ++--- 2 files changed, 7 insertions(+), 69 deletions(-) delete mode 100644 sources/tech/20160721 5 tricks for getting started with Vim.md diff --git a/sources/tech/20160721 5 tricks for getting started with Vim.md b/sources/tech/20160721 5 tricks for getting started with Vim.md deleted file mode 100644 index 417b51ed45..0000000000 --- a/sources/tech/20160721 5 tricks for getting started with Vim.md +++ /dev/null @@ -1,62 +0,0 @@ -maywanting - -5 tricks for getting started with Vim -===================================== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/education/BUSINESS_peloton.png?itok=nuMbW9d3) - -For years, I've wanted to learn Vim, now my preferred Linux text editor and a favorite open source tool among developers and system administrators. And when I say learn, I mean really learn. Master is probably too strong a word, but I'd settle for advanced proficiency. For most of my years using Linux, my skillset included the ability to open a file, use the arrow keys to navigate up and down, switch into insert mode, change some text, save, and exit. - -But that's like minimum-viable-Vim. My skill level enabled me edit text documents from the terminal, but hasn't actually empowered me with any of the text editing super powers I've always imagined were possible. And it didn't justify using Vim over the totally capable Pico or Nano. - -So why learn Vim at all? Because I do spend an awful lot of time editing text, and I know I could be more efficient at it. And why not Emacs, or a more modern editor like Atom? Because Vim works for me, and at least I have some minimal experience in it. And perhaps, importantly, because it's rare that I encounter a system that I'm working on which doesn't have Vim or it's less-improved cousin (vi) available on it already. If you've always had a desire to learn Emacs, more power to you—I hope the Emacs-analog of these tips will prove useful to you, too. - -A few weeks in to this concentrated effort to up my Vim-use ability, the number one tip I have to share is that you actually must use the tool. While it seems like a piece of advice straight from Captain Obvious, I actually found it considerably harder than I expected to stay in the program. Most of my work happens inside of a web browser, and I had to untrain my trigger-like opening of (Gedit) every time I needed to edit a block of text outside of a browser. Gedit had made its way to my quick launcher, and so step one was removing this shortcut and putting Vim there instead. - -I've tried a number of things that have helped me learn. Here's a few of them I would recommend if you're looking to learn as well. - -### Vimtutor - -Sometimes the best place to get started isn't far from the application itself. I found Vimtutor, a tiny application that is basically a tutorial in a text file that you edit as you learn, to be as helpful as anything else in showing me the basics of the commands I had skipped learning through the years. Vimtutor is typically found everywhere Vim is, and is an easy install from your package manager if it's not already on your system. - -### GVim - -I know not everyone will agree with this one, but I found it useful to stop using the version of Vim that lives in my terminal and start using GVim for my basic editing needs. Naysayers will argue that it encourages using the mouse in an environment designed for keyboards, but I found it helpful to be able to quickly find the command I was looking for in a drop-down menu, reminding myself of the correct command, and then executing it with a keyboard. The alternative was often frustration at the inability to figure out how to do something, which is not a good feeling to be under constantly as you struggle to learn a new editor. No, stopping every few minutes to read a man page or use a search engine to remind you of a key sequence is not the best way to learn something new. - -### Keyboard maps - -Along with switching to GVim, I also found it handy to have a keyboard "cheat sheet" handy to remind me of the basic keystrokes. There are many available on the web that you can download, print, and set beside your station, but I opted for buying a set of stickers for my laptop keyboard. They were less than ten dollars US and had the added bonus of being a subtle reminder every time I used the laptop to at least try out one new thing as I edited. - -### Vimium - -As I mentioned, I live in the web browser most of the day. One of the tricks I've found helpful to reinforce the Vim way of navigation is to use [Vimium][1], an open source extension for Chrome that makes Chrome mimick the shortcuts used by Vim. I've found the fewer times I switch contexts for the keyboard shortcuts I'm using, the more likely I am to actually use them. Similar extensions, like [Vimerator][2], exist for Firefox. - -### Other human beings - -Without a doubt, there's no better way to get help learning something new than to get advice, feedback, and solutions from other people who have gone down a path before you. - -If you live in a larger urban area, there might be a Vim meetup group near you. Otherwise, the place to be is the #vim channel on Freenode IRC. One of the more popular channels on Freenode, the #vim channel is always full of helpful individuals willing to offer help with your problems. I find it interesting just to listen to the chatter and see what sorts of problems others are trying to solve to see what I'm missing out on. - ------- - -And so what to make of this effort? So far, so good. The time spent has probably yet to pay for itself in terms of time saved, but I'm always mildly surprised and amused when I find myself with a new reflex, jumping words with the right keypress sequence, or some similarly small feat. I can at least see that every day, the investment is bringing itself a little closer to payoff. - -These aren't the only tricks for learning Vim, by far. I also like to point people towards [Vim Adventures][3], an online game in which you navigate using the Vim keystrokes. And just the other day I came across a marvelous visual learning tool at [Vimgifs.com][4], which is exactly what you might expect it to be: illustrated examples with Vim so small they fit nicely in a gif. - -Have you invested the time to learn Vim, or really, any program with a keyboard-heavy interface? What worked for you, and, did you think the effort was worth it? Has your productivity changed as much as you thought it would? Lets share stories in the comments below. - --------------------------------------------------------------------------------- - -via: https://opensource.com/life/16/7/tips-getting-started-vim - -作者:[Jason Baker ][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jason-baker -[1]: https://github.com/philc/vimium -[2]: http://www.vimperator.org/ -[3]: http://vim-adventures.com/ -[4]: http://vimgifs.com/ diff --git a/translated/tech/20160721 5 tricks for getting started with Vim.md b/translated/tech/20160721 5 tricks for getting started with Vim.md index 7e9808d6d0..3dbc910d8d 100644 --- a/translated/tech/20160721 5 tricks for getting started with Vim.md +++ b/translated/tech/20160721 5 tricks for getting started with Vim.md @@ -3,19 +3,19 @@ Vim 学习的 5 个技巧 ![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/education/BUSINESS_peloton.png?itok=nuMbW9d3) -多年来,我一直想学 Vim 。如今 Vim 是我最喜欢的 Linux 文本编辑器,也是开发者和系统管理者最喜爱的开源工具。我说的学习,指的是真正意义上的学习。想要精通确实很难,所以我只想要达到熟练的水平。根据我多年使用 Linux 的经验,我会的也仅仅只是打开一个文件,使用上下左右箭头按键来移动光标,切换到 insert 模式,更改一些文本,保存,然后退出。 +多年来,我一直想学 Vim。如今 Vim 是我最喜欢的 Linux 文本编辑器,也是开发者和系统管理者最喜爱的开源工具。我说的学习,指的是真正意义上的学习。想要精通确实很难,所以我只想要达到熟练的水平。根据我多年使用 Linux 的经验,我会的也仅仅只是打开一个文件,使用上下左右箭头按键来移动光标,切换到 insert 模式,更改一些文本,保存,然后退出。 -但那只是 Vim 的最基本操作。我可以在终端修改文本文档,但是无法使用任何一个我想象中强大的文本处理功能。这样我无法说明 Vim 完全优于 Pico 和 Nano 。 +但那只是 Vim 的最基本操作。我可以在终端修改文本文档,但是无法使用任何一个我想象中强大的文本处理功能。这样我无法说明 Vim 完全优于 Pico 和 Nano。 -所以到底为什么要学习 Vim ?因为我需要花费相当多的时间用于编辑文本,而且有很大的效率提升空间。为什么不选择 Emacs ,或者是更为现代化的编辑器例如 Atom ?因为 Vim 适合我,至少我有一丁点的使用经验。而且,很重要的一点就是,在我需要处理的系统上很少碰见没有装 Vim 或者它的简化版(Vi)。如果你有强烈的欲望想学习 Emacs ,我希望这些对于 Emacs 同类编辑器的建议能对你有所帮助。 +所以到底为什么要学习 Vim?因为我需要花费相当多的时间用于编辑文本,而且有很大的效率提升空间。为什么不选择 Emacs,或者是更为现代化的编辑器例如 Atom?因为 Vim 适合我,至少我有一丁点的使用经验。而且,很重要的一点就是,在我需要处理的系统上很少碰见没有装 Vim 或者它的简化版(Vi)。如果你有强烈的欲望想学习 Emacs,我希望这些对于 Emacs 同类编辑器的建议能对你有所帮助。 花了几周的时间专注提高我的 Vim 使用技巧之后,我想分享的第一个建议就是必须使用工具。虽然这看起来就是明知故问的回答,但事实上比我所想的在代码层面上还要困难。我的大多数工作是在网页浏览器上进行的,而且我每次都得有针对性的用 Gedit 打开并修改一段浏览器之外的文本。Gedit 需要快捷键来启动,所以第一步就是移出快捷键然后替换成 Vim 的快捷键。 -为了跟更好的学习 Vim ,我尝试了很多。如果你也正想学习,以下列举了一些作为推荐。 +为了跟更好的学习 Vim,我尝试了很多。如果你也正想学习,以下列举了一些作为推荐。 ### Vimtutor -通常如何开始学习最好就是使用应用本身。我找到一个小的应用叫 Vimtutor ,当你在学习编辑一个文本时它能辅导你一些基础知识,它向我展示了很多我这些年都忽视的基础命令。Vimtutor 上到处都是 Vim 影子,如果你的系统上没有 Vim ,Vimtutor可以很容易从你的包管理器上下载。 +通常如何开始学习最好就是使用应用本身。我找到一个小的应用叫 Vimtutor,当你在学习编辑一个文本时它能辅导你一些基础知识,它向我展示了很多我这些年都忽视的基础命令。Vimtutor 上到处都是 Vim 影子,如果你的系统上没有 Vim,Vimtutor可以很容易从你的包管理器上下载。 ### GVim @@ -23,11 +23,11 @@ Vim 学习的 5 个技巧 ### Keyboard maps -当我转战 GVim ,我发现有一个键盘的“作弊表”来提醒我最基础的按键很是便利。网上有很多这种可用的表,你可以下载,打印,然后贴在你身边的某一处地方。但是为了我的笔记本键盘,我选择买一沓便签纸。这些便签纸在美国不到10美元,而且当我使用键盘编辑文本尝试新的命令的时候,可以随时提醒我。 +当我转战 GVim,我发现有一个键盘的“作弊表”来提醒我最基础的按键很是便利。网上有很多这种可用的表,你可以下载,打印,然后贴在你身边的某一处地方。但是为了我的笔记本键盘,我选择买一沓便签纸。这些便签纸在美国不到10美元,而且当我使用键盘编辑文本尝试新的命令的时候,可以随时提醒我。 ### Vimium -上文提到,我工作都在浏览器上进行。其中一条我觉得很有帮助的建议就是,使用 [Vimium](1)来用增强使用 Vim 的体验。Vimium 是 Chrome 浏览器上的一个开源插件,能用 Vim 的指令快捷操作 Chrome。当我有意识的使用快捷键切换文本的次数越少时,这说明我越来越多的使用这些快捷键。同样的扩展 Firefox 上也有,例如 [Vimerator](2)。 +上文提到,我工作都在浏览器上进行。其中一条我觉得很有帮助的建议就是,使用 [Vimium](1) 来用增强使用 Vim 的体验。Vimium 是 Chrome 浏览器上的一个开源插件,能用 Vim 的指令快捷操作 Chrome。当我有意识的使用快捷键切换文本的次数越少时,这说明我越来越多的使用这些快捷键。同样的扩展 Firefox 上也有,例如 [Vimerator](2)。 ### 人 From e0444ab80940a97472434d38e7f235e9f4a6a219 Mon Sep 17 00:00:00 2001 From: cvsher <478990879@qq.com> Date: Sun, 31 Jul 2016 00:26:03 +0800 Subject: [PATCH 1301/1469] Create 20160706 What is Git.md --- translated/tech/20160706 What is Git.md | 118 ++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 translated/tech/20160706 What is Git.md diff --git a/translated/tech/20160706 What is Git.md b/translated/tech/20160706 What is Git.md new file mode 100644 index 0000000000..8a43ef717d --- /dev/null +++ b/translated/tech/20160706 What is Git.md @@ -0,0 +1,118 @@ +什么是Git +=========== + +欢迎阅读本系列关于Git版本控制系统的教程!通过本文的介绍,你将会了解到Git的用途及谁该使用Git。 + +如果你刚步入开源的世界,你很有可能会遇到一些在Git上托管代码或者发布使用版本的开源软件。事实上,不管你知道与否,你都在使用基于Git进行版本管理的软件:linux内核(就算你没有在手机或者电脑上使用linux,你正在访问的网站也是运行在linux系统上的),Firefox,Chrome等其他很多项目都在Git上和世界各地开发者共享他们的代码。 + +换个角度来说,你是否仅仅通过Git就可以和其他人共享你的代码?你是否可以在家里或者企业里私有化的使用Git?你必须要通过一个GitHub账号来使用Git吗?为什么要使用Git呢?Git的优势又是什么?Git是我唯一的选择吗?这对Git所有的疑问都会把我们搞的一脑浆糊。 + +因此,忘记你以前所知的Git,我们从新走进Git世界的大门。 + +### 什么是版本控制系统? + +现在市面上有很多不同的版本控制系统:CVS,SVN,Mercurial,Fossil 当然还有 Git。 + +很多像 GitHub 和 GitLab 这样的服务是以Git为基础的,但是你也可以只使用Git而无需使用其他额外的服务。这意味着你可以以私有或者公有的方式来使用Git。 + +如果你曾经和其他人有过任何数字方面的合作,你就会知道传统版本管理的工作流程。开始是很简单的:你有一个原始的版本,你把这个版本发送给你的同事,他们在接收到的版本上做了些修改,现在你们有两个版本了,然后他们把他们手上修改过的版本发回来给你。你把他们的修改合并到你手上的版本中,现在两个版本又合并成一个最新的版本了。 + +然后,你修改了你手上最新的版本,同时,你的同事也修改了他们手上合并前的版本。现在你们有3个不同的版本了,分别是合并后最新的版本,你修改后的版本,你同事手上继续修改过的版本。至此,你们的版本管理工作开始变得越来越混乱了。 + +正如 Jason van Gumster 在他的文章中指出 [即使是艺术家也需要版本控制][1],而且这也有向个人设置方向发展的趋势。无论是艺术家还是科学家,在一些想法上开发出实验版本都是比较常见的;在你的项目中,可能有某个版本大获成功,把项目推向一个新的高度,也可能有某个版本惨遭失败。因此,最终你不可避免的会创建出一堆名为project_justTesting.kdenlive、project_betterVersion.kdenlive、project_best_FINAL.kdenlive、project_FINAL-alternateVersion.kdenlive等类似名称的文件。 + +不管你是修改一个for循环,还是一些简单的文本编辑,一个好的版本控制系统都会让我们的生活更加的轻松。 + +### Git快照 + +Git会为每个项目创建快照,并且为项目的每个版本都保存一个唯一的快照。 + +如果你将项目带领到了一个错误的方向上,你可以回退到上一个正确的版本,并且 开始尝试另一个可行的方向。 + +如果你是和别人合作开发,当有人向你发送他们的修改时,你可以将这些修改合并到你的工作分支中,然后你的同事就可以获取到合并后的最新版本,并在此基础上继续工作。 + +Git并不是魔法,因此冲突还是会发生的(“你修改了某文件的最后一行,但是我把这行整行都删除了;我们怎样处理这些冲突呢?”),但是总体而言,Git会为你保留了所有更改的历史版本,甚至允许并行版本。这为你保留了以任何方式处理冲突的能力。 + +### 分布式Git + +在不同的机器上为同一个项目工作是一件复杂的事情。因为在你开始工作时,你想要获得项目的最新版本,然后此基础上进行修改,最后向你的同事共享这些改动。传统的方法是通过笨重的在线文件共享服务或者老旧的电邮附件,但是这两种方式都是效率低下且容易出错。 + +Git天生是为分布式工作设计的。如果你要参与到某个项目中,你可以克隆(clone)该项目的Git仓库,然后就像这个项目只有你本地一个版本一样对项目进行修改。最后使用一些简单的命令你就可以拉取(pull)其他开发者的修改,或者你可以把你的修改推送(push)给别人。现在不用担心谁手上的是最新的版本,或者谁的版本又存放在哪里等这些问题了。全部人都是在本地进行开发,然后向共同的目标推送或者拉取更新。(或者不是共同的目标,这取决于项目的开发方式)。 + +### Git 界面 + +最原始的Git是运行在Linux终端上的应用软件。然而,得益于Git是开源的,并且拥有良好的设计,世界各地的开发者都可以为Git设计不同的问接入界面。 + +Git完全是免费的,并且附带在Linux,BSD,Illumos 和其他类unix系统中,Git命令看起来像: + +``` +$ git --version +git version 2.5.3 +``` + +可能最著名的Git访问界面是基于网页的,像GitHub,开源的GitLab,Savannah,BitBucket和SourceForge这些网站都是基于网页端的Git界面。这些站点为面向公众和面向社会的开源软件提供了最大限度的代码托管服务。在一定程度上,基于浏览器的图形界面(GUI)可以尽量的减缓Git的学习曲线。下面的GitLab接口的截图: + +![](https://opensource.com/sites/default/files/0_gitlab.png) + +再者,第三方Git服务提供商或者独立开发者甚至在Git的基础上开发出不是基于HTML的定制化前端接口。此类接口让你可以不用打开浏览器就可以方便的使用Git进行版本管理。其中对用户最透明的方式是直接集成到文件管理器中。KDE文件管理器,Dolphin 可以直接在目录中显示Git状态,甚至支持提交,推送和拉取更新操作。 + +![](https://opensource.com/sites/default/files/0_dolphin.jpg) + +[Sparkleshare][2]使用Git作为其Dropbox类文件共享接口的基础。 + +![](https://opensource.com/sites/default/files/0_sparkleshare_1.jpg) + +想了解更多的内容,可以查看[Git wiki][3],此页面中展示了很多Git的图形界面项目。 + +### 谁应该使用Git? + +就是你!我们更应该关心的问题是什么时候使用Git?和用Git来干嘛? + +### 我应该在什么时候使用Git呢?我要用Git来干嘛呢? + +想更深入的学习Git,我们必须比平常考虑更多关于文件格式的问题。 + +Git是为了管理源代码而设计的,在大多数编程语言中,源代码就意味者一行行的文本。当然,Git并不知道你把这些文本当成是源代码还是下一部伟大的美式小说。因此,只要文件内容是以文本构成的,使用Git来跟踪和管理其版本就是一个很好的选择了。 + +但是什么是文本呢?如果你在像Libre Office这类办公软件中编辑一些内容,通常并不会产生纯文本内容。因为通常复杂的应用软件都会对原始的文本内容进行一层封装,就如把原始文本内容用XML标记语言包装起来,然后封装在Zip容器中。这种对原始文本内容进行一层封装的做法可以保证当你把文件发送给其他人时,他们可以看到你在办公软件中编辑的内容及特定的文本效果。奇怪的是,虽然,通常你的需求可能会很复杂,就像保存[Kdenlive][4]项目文件,或者保存从[Inkscape][5]导出的SVG文件,但是,事实上使用Git管理像XML文本这样的纯文本类容是最简单的。 + +如果你在使用Unix系统,你可以使用 file 命令来查看文件内容构成: + +``` +$ file ~/path/to/my-file.blah +my-file.blah: ASCII text +$ file ~/path/to/different-file.kra: Zip data (MIME type "application/x-krita") +``` + +如果还是不确定,你可以使用 head 命令来查看文件内容: + +``` +$ head ~/path/to/my-file.blah +``` + +如果输出的文本你基本能看懂,这个文件就很有可能是文本文件。如果你仅仅在一堆乱码中偶尔看到几个熟悉的字符,那么这个文件就可能不是文本文件了。 + +准确的说:Git可以管理其他格式的文件,但是它会把这些文件当成二进制大对象(blob)。两者的区别是,在文本文件中,Git可以明确的告诉你在这两个快照(或者说提交)间有3行是修改过的。但是如果你在两个提交间对一张图片进行的编辑操作,Git会怎么指出这种修改呢?实际上,因为图片并不是以某种可以增加或删除的有意义的文本构成,因此Git并不能明确的描述这种变化。当然我个人是非常希望图片的编辑可以像把本文"丑陋的蓝绿色"修改成"漂浮着蓬松白云的天蓝色"一样的简单,但是事实上图片的编辑并没有这么简单。 + +经常有人在Git上记录png图标、电子表格或者流程图这类二进制大型对象。尽管,我们知道在Git上管理此类大型文件并不直观,但是,如果你需要使用Git来管理此类文件,你也并不需要过多的担心。如果你参与的项目同时生成文本文件和二进制大文件对象(如视频游戏中常见的场景,这些和源代码同样重要的图像和音频材料),那么你有两条路可以走:要么开发出你自己的解决方案,就如使用指向共享网络驱动器的指针;要么使用Git插件,如Joey Hess开发的[git annex][6], 或者 [Git-Media][7] 项目。 + +你看,Git真的是一个任何人都可以使用的工具。它是你进行文件版本管理的一个强大而且好用工具,同时它并没有你开始认为的那么可怕。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/resources/what-is-git + +作者:[Seth Kenlon ][a] +译者:[cvsher](https://github.com/cvsher) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[1]: https://opensource.com/life/16/2/version-control-isnt-just-programmers +[2]: http://sparkleshare.org/ +[3]: https://git.wiki.kernel.org/index.php/InterfacesFrontendsAndTools#Graphical_Interfaces +[4]: https://opensource.com/life/11/11/introduction-kdenlive +[5]: http://inkscape.org/ +[6]: https://git-annex.branchable.com/ +[7]: https://github.com/alebedev/git-media From 82d69780088789c52fd132ca3c2e8b69820ba9d7 Mon Sep 17 00:00:00 2001 From: cvsher <478990879@qq.com> Date: Sun, 31 Jul 2016 00:38:49 +0800 Subject: [PATCH 1302/1469] Update 20160706 What is Git.md --- translated/tech/20160706 What is Git.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translated/tech/20160706 What is Git.md b/translated/tech/20160706 What is Git.md index 8a43ef717d..f2f01b8d39 100644 --- a/translated/tech/20160706 What is Git.md +++ b/translated/tech/20160706 What is Git.md @@ -41,7 +41,7 @@ Git天生是为分布式工作设计的。如果你要参与到某个项目中 ### Git 界面 -最原始的Git是运行在Linux终端上的应用软件。然而,得益于Git是开源的,并且拥有良好的设计,世界各地的开发者都可以为Git设计不同的问接入界面。 +最原始的Git是运行在Linux终端上的应用软件。然而,得益于Git是开源的,并且拥有良好的设计,世界各地的开发者都可以为Git设计不同的接入界面。 Git完全是免费的,并且附带在Linux,BSD,Illumos 和其他类unix系统中,Git命令看起来像: @@ -54,7 +54,7 @@ git version 2.5.3 ![](https://opensource.com/sites/default/files/0_gitlab.png) -再者,第三方Git服务提供商或者独立开发者甚至在Git的基础上开发出不是基于HTML的定制化前端接口。此类接口让你可以不用打开浏览器就可以方便的使用Git进行版本管理。其中对用户最透明的方式是直接集成到文件管理器中。KDE文件管理器,Dolphin 可以直接在目录中显示Git状态,甚至支持提交,推送和拉取更新操作。 +再者,第三方Git服务提供商或者独立开发者甚至可以在Git的基础上开发出不是基于HTML的定制化前端接口。此类接口让你可以不用打开浏览器就可以方便的使用Git进行版本管理。其中对用户最透明的方式是直接集成到文件管理器中。KDE文件管理器,Dolphin 可以直接在目录中显示Git状态,甚至支持提交,推送和拉取更新操作。 ![](https://opensource.com/sites/default/files/0_dolphin.jpg) From 5260df0109f620e8362516743bb1fcb7464a37ec Mon Sep 17 00:00:00 2001 From: maywanting Date: Sun, 31 Jul 2016 01:13:30 +0800 Subject: [PATCH 1303/1469] the last version --- ...20160721 5 tricks for getting started with Vim.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/translated/tech/20160721 5 tricks for getting started with Vim.md b/translated/tech/20160721 5 tricks for getting started with Vim.md index 3dbc910d8d..67d64ced2f 100644 --- a/translated/tech/20160721 5 tricks for getting started with Vim.md +++ b/translated/tech/20160721 5 tricks for getting started with Vim.md @@ -5,7 +5,7 @@ Vim 学习的 5 个技巧 多年来,我一直想学 Vim。如今 Vim 是我最喜欢的 Linux 文本编辑器,也是开发者和系统管理者最喜爱的开源工具。我说的学习,指的是真正意义上的学习。想要精通确实很难,所以我只想要达到熟练的水平。根据我多年使用 Linux 的经验,我会的也仅仅只是打开一个文件,使用上下左右箭头按键来移动光标,切换到 insert 模式,更改一些文本,保存,然后退出。 -但那只是 Vim 的最基本操作。我可以在终端修改文本文档,但是无法使用任何一个我想象中强大的文本处理功能。这样我无法说明 Vim 完全优于 Pico 和 Nano。 +但那只是 Vim 的最基本操作。Vim 可以让我在终端修改文本,但是它并没有任何一个我想象中强大的文本处理功能。这样我无法说明 Vim 完全优于 Pico 和 Nano。 所以到底为什么要学习 Vim?因为我需要花费相当多的时间用于编辑文本,而且有很大的效率提升空间。为什么不选择 Emacs,或者是更为现代化的编辑器例如 Atom?因为 Vim 适合我,至少我有一丁点的使用经验。而且,很重要的一点就是,在我需要处理的系统上很少碰见没有装 Vim 或者它的简化版(Vi)。如果你有强烈的欲望想学习 Emacs,我希望这些对于 Emacs 同类编辑器的建议能对你有所帮助。 @@ -15,11 +15,11 @@ Vim 学习的 5 个技巧 ### Vimtutor -通常如何开始学习最好就是使用应用本身。我找到一个小的应用叫 Vimtutor,当你在学习编辑一个文本时它能辅导你一些基础知识,它向我展示了很多我这些年都忽视的基础命令。Vimtutor 上到处都是 Vim 影子,如果你的系统上没有 Vim,Vimtutor可以很容易从你的包管理器上下载。 +通常如何开始学习最好就是使用应用本身。我找到一个小的应用叫 Vimtutor,当你在学习编辑一个文本时它能辅导你一些基础知识,它向我展示了很多我这些年都忽视的基础命令。Vimtutor 上到处都是 Vim 影子,如果你的系统上没有 Vimtutor,Vimtutor可以很容易从你的包管理器上下载。 ### GVim -我知道并不是每个人都看好这个,但就是它让我从使用在终端的 Vim 转战到使用 GVim 来满足我基本编辑需求。反对者表示 GVim 鼓励使用鼠标,而 Vim 主要是为键盘党设计的。但是我能通过 GVim 的下拉菜单快速找到想找的指令,并且 GVim 可以提醒我正确的指令然后通过敲键盘执行它。努力学习一个新的编辑器然后陷入无法解决的困境,这种感觉并不好受。每隔几分钟读一下 man 出来的文字或者使用搜索引擎来提醒你指令也并不是最好的学习新事务的方法。 +我知道并不是每个人都认同这个,但就是它让我从使用在终端的 Vim 转战到使用 GVim 来满足我基本编辑需求。反对者表示 GVim 鼓励使用鼠标,而 Vim 主要是为键盘党设计的。但是我能通过 GVim 的下拉菜单快速找到想找的指令,并且 GVim 可以提醒我正确的指令然后通过敲键盘执行它。努力学习一个新的编辑器然后陷入无法解决的困境,这种感觉并不好受。每隔几分钟读一下 man 出来的文字或者使用搜索引擎来提醒你指令也并不是最好的学习新事务的方法。 ### Keyboard maps @@ -27,7 +27,7 @@ Vim 学习的 5 个技巧 ### Vimium -上文提到,我工作都在浏览器上进行。其中一条我觉得很有帮助的建议就是,使用 [Vimium](1) 来用增强使用 Vim 的体验。Vimium 是 Chrome 浏览器上的一个开源插件,能用 Vim 的指令快捷操作 Chrome。当我有意识的使用快捷键切换文本的次数越少时,这说明我越来越多的使用这些快捷键。同样的扩展 Firefox 上也有,例如 [Vimerator](2)。 +上文提到,我工作都在浏览器上进行。其中一条我觉得很有帮助的建议就是,使用 [Vimium][1] 来用增强使用 Vim 的体验。Vimium 是 Chrome 浏览器上的一个开源插件,能用 Vim 的指令快捷操作 Chrome。当我有意识的使用快捷键切换文本的次数越少时,这说明我越来越多的使用这些快捷键。同样的扩展 Firefox 上也有,例如 [Vimerator][2]。 ### 人 @@ -39,9 +39,9 @@ Vim 学习的 5 个技巧 所以是什么成就了现在?如今便是极好。为它所花的时间是否值得就在于之后它为你节省了多少时间。但是我经常收到意外的惊喜与快乐,当我发现一个新的按键指令来复制、跳过词,或者一些相似的小技巧。每天我至少可以看见,一点点回报,正在逐渐配得上当初的付出。 -学习 Vim 并不仅仅只有这些建议,还有很多。我很喜欢指引别人去 [Vim Advantures](3),它是一种只能使用 Vim 的快捷键的在线游戏。而且某天我发现了一个非常神奇的虚拟学习工具,在 [Vimgifts.com](4),那上面有明确的你想要的:用一个 gif 动图来描述,使用一点点 Vim 操作来达到他们想要的。 +学习 Vim 并不仅仅只有这些建议,还有很多。我很喜欢指引别人去 [Vim Advantures][3],它是一种只能使用 Vim 的快捷键的在线游戏。而且某天我发现了一个非常神奇的虚拟学习工具,在 [Vimgifts.com][4],那上面有明确的你想要的:用一个 gif 动图来描述,使用一点点 Vim 操作来达到他们想要的。 -你有花时间学习 Vim 吗?或者有遇到任何关于按键复杂的插件的问题吗?什么适合你,你认为这些努力值得吗?效率的提高有达到你的预期?分享你们的故事在下面的评论区吧。 +你有花时间学习 Vim 吗?或者有大量键盘操作交互体验的程序上投资时间吗?那些经过你努力后掌握的工具,你认为这些努力值得吗?效率的提高有达到你的预期?分享你们的故事在下面的评论区吧。 -------------------------------------------------------------------------------- From 28f0a31b6e1057c66a4971c26fb3a0495ab3324f Mon Sep 17 00:00:00 2001 From: sevenot <469147394@qq.com> Date: Sun, 31 Jul 2016 01:45:28 +0800 Subject: [PATCH 1304/1469] sevenot translating --- ...ux Terminal Emulator With Multiple Terminals In One Window.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160724 Terminator A Linux Terminal Emulator With Multiple Terminals In One Window.md b/sources/tech/20160724 Terminator A Linux Terminal Emulator With Multiple Terminals In One Window.md index eb50d539a1..2f1b393c80 100644 --- a/sources/tech/20160724 Terminator A Linux Terminal Emulator With Multiple Terminals In One Window.md +++ b/sources/tech/20160724 Terminator A Linux Terminal Emulator With Multiple Terminals In One Window.md @@ -1,3 +1,4 @@ +sevenot translating Terminator A Linux Terminal Emulator With Multiple Terminals In One Window ============================================================================= From 35dea8011103be3f36c44ac055622f2e9163f74c Mon Sep 17 00:00:00 2001 From: cvsher <478990879@qq.com> Date: Sun, 31 Jul 2016 07:24:44 +0800 Subject: [PATCH 1305/1469] Delete 20160706 What is Git.md --- sources/tech/20160706 What is Git.md | 123 --------------------------- 1 file changed, 123 deletions(-) delete mode 100644 sources/tech/20160706 What is Git.md diff --git a/sources/tech/20160706 What is Git.md b/sources/tech/20160706 What is Git.md deleted file mode 100644 index f98de42fd3..0000000000 --- a/sources/tech/20160706 What is Git.md +++ /dev/null @@ -1,123 +0,0 @@ -translating by cvsher -What is Git -=========== - -Welcome to my series on learning how to use the Git version control system! In this introduction to the series, you will learn what Git is for and who should use it. - -If you're just starting out in the open source world, you're likely to come across a software project that keeps its code in, and possibly releases it for use, by way of Git. In fact, whether you know it or not, you're certainly using software right now that is developed using Git: the Linux kernel (which drives the website you're on right now, if not the desktop or mobile phone you're accessing it on), Firefox, Chrome, and many more projects share their codebase with the world in a Git repository. - -On the other hand, all the excitement and hype over Git tends to make things a little muddy. Can you only use Git to share your code with others, or can you use Git in the privacy of your own home or business? Do you have to have a GitHub account to use Git? Why use Git at all? What are the benefits of Git? Is Git the only option? - -So forget what you know or what you think you know about Git, and let's take it from the beginning. - -### What is version control? - -Git is, first and foremost, a version control system (VCS). There are many version control systems out there: CVS, SVN, Mercurial, Fossil, and, of course, Git. - -Git serves as the foundation for many services, like GitHub and GitLab, but you can use Git without using any other service. This means that you can use Git privately or publicly. - -If you have ever collaborated on anything digital with anyone, then you know how it goes. It starts out simple: you have your version, and you send it to your partner. They make some changes, so now there are two versions, and send the suggestions back to you. You integrate their changes into your version, and now there is one version again. - -Then it gets worse: while you change your version further, your partner makes more changes to their version. Now you have three versions; the merged copy that you both worked on, the version you changed, and the version your partner has changed. - -As Jason van Gumster points out in his article, 【Even artists need version control][1], this syndrome tends to happen in individual settings as well. In both art and science, it's not uncommon to develop a trial version of something; a version of your project that might make it a lot better, or that might fail miserably. So you create file names like project_justTesting.kdenlive and project_betterVersion.kdenlive, and then project_best_FINAL.kdenlive, but with the inevitable allowance for project_FINAL-alternateVersion.kdenlive, and so on. - -Whether it's a change to a for loop or an editing change, it happens to the best of us. That is where a good version control system makes life easier. - -### Git snapshots - -Git takes snapshots of a project, and stores those snapshots as unique versions. - -If you go off in a direction with your project that you decide was the wrong direction, you can just roll back to the last good version and continue along an alternate path. - -If you're collaborating, then when someone sends you changes, you can merge those changes into your working branch, and then your collaborator can grab the merged version of the project and continue working from the new current version. - -Git isn't magic, so conflicts do occur ("You changed the last line of the book, but I deleted that line entirely; how do we resolve that?"), but on the whole, Git enables you to manage the many potential variants of a single work, retaining the history of all the changes, and even allows for parallel versions. - -### Git distributes - -Working on a project on separate machines is complex, because you want to have the latest version of a project while you work, makes your own changes, and share your changes with your collaborators. The default method of doing this tends to be clunky online file sharing services, or old school email attachments, both of which are inefficient and error-prone. - -Git is designed for distributed development. If you're involved with a project you can clone the project's Git repository, and then work on it as if it was the only copy in existence. Then, with a few simple commands, you can pull in any changes from other contributors, and you can also push your changes over to someone else. Now there is no confusion about who has what version of a project, or whose changes exist where. It is all locally developed, and pushed and pulled toward a common target (or not, depending on how the project chooses to develop). - -### Git interfaces - -In its natural state, Git is an application that runs in the Linux terminal. However, as it is well-designed and open source, developers all over the world have designed other ways to access it. - -It is free, available to anyone for $0, and comes in packages on Linux, BSD, Illumos, and other Unix-like operating systems. It looks like this: - -``` -$ git --version -git version 2.5.3 -``` - -Probably the most well-known Git interfaces are web-based: sites like GitHub, the open source GitLab, Savannah, BitBucket, and SourceForge all offer online code hosting to maximise the public and social aspect of open source along with, in varying degrees, browser-based GUIs to minimise the learning curve of using Git. This is what the GitLab interface looks like: - -![](https://opensource.com/sites/default/files/0_gitlab.png) - -Additionally, it is possible that a Git service or independent developer may even have a custom Git frontend that is not HTML-based, which is particularly handy if you don't live with a browser eternally open. The most transparent integration comes in the form of file manager support. The KDE file manager, Dolphin, can show the Git status of a directory, and even generate commits, pushes, and pulls. - -![](https://opensource.com/sites/default/files/0_dolphin.jpg) - -[Sparkleshare][2] uses Git as a foundation for its own Dropbox-style file sharing interface. - -![](https://opensource.com/sites/default/files/0_sparkleshare_1.jpg) - -For more, see the (long) page on the official [Git wiki][3] listing projects with graphical interfaces to Git. - -### Who should use Git? - -You should! The real question is when? And what for? - -### When should I use Git, and what should I use it for? - -To get the most out of Git, you need to think a little bit more than usual about file formats. - -Git is designed to manage source code, which in most languages consists of lines of text. Of course, Git doesn't know if you're feeding it source code or the next Great American Novel, so as long as it breaks down to text, Git is a great option for managing and tracking versions. - -But what is text? If you write something in an office application like Libre Office, then you're probably not generating raw text. There is usually a wrapper around complex applications like that which encapsulate the raw text in XML markup and then in a zip container, as a way to ensure that all of the assets for your office file are available when you send that file to someone else. Strangely, though, something that you might expect to be very complex, like the save files for a [Kdenlive][4] project, or an SVG from [Inkscape][5], are actually raw XML files that can easily be managed by Git. - -If you use Unix, you can check to see what a file is made of with the file command: - -``` -$ file ~/path/to/my-file.blah -my-file.blah: ASCII text -$ file ~/path/to/different-file.kra: Zip data (MIME type "application/x-krita") -``` - -If unsure, you can view the contents of a file with the head command: - -``` -$ head ~/path/to/my-file.blah -``` - -If you see text that is mostly readable by you, then it is probably a file made of text. If you see garbage with some familiar text characters here and there, it is probably not made of text. - -Make no mistake: Git can manage other formats of files, but it treats them as blobs. The difference is that in a text file, two Git snapshots (or commits, as we call them) might be, say, three lines different from each other. If you have a photo that has been altered between two different commits, how can Git express that change? It can't, really, because photographs are not made of any kind of sensible text that can just be inserted or removed. I wish photo editing were as easy as just changing some text from "ugly greenish-blue" to "blue-with-fluffy-clouds" but it truly is not. - -People check in blobs, like PNG icons or a speadsheet or a flowchart, to Git all the time, so if you're working in Git then don't be afraid to do that. Know that it's not sensible to do that with huge files, though. If you are working on a project that does generate both text files and large blobs (a common scenario with video games, which have equal parts source code to graphical and audio assets), then you can do one of two things: either invent your own solution, such as pointers to a shared network drive, or use a Git add-on like Joey Hess's excellent [git annex][6], or the [Git-Media][7] project. - -So you see, Git really is for everyone. It is a great way to manage versions of your files, it is a powerful tool, and it is not as scary as it first seems. - --------------------------------------------------------------------------------- - -via: https://opensource.com/resources/what-is-git - -作者:[Seth Kenlon ][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[1]: https://opensource.com/life/16/2/version-control-isnt-just-programmers -[2]: http://sparkleshare.org/ -[3]: https://git.wiki.kernel.org/index.php/InterfacesFrontendsAndTools#Graphical_Interfaces -[4]: https://opensource.com/life/11/11/introduction-kdenlive -[5]: http://inkscape.org/ -[6]: https://git-annex.branchable.com/ -[7]: https://github.com/alebedev/git-media - - - - From fafb7ca2a5cb862f22497fd03586cd18bd9566a2 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 31 Jul 2016 11:52:41 +0800 Subject: [PATCH 1306/1469] =?UTF-8?q?20160731-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...160509 Android vs. iPhone Pros and Cons.md | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 sources/talk/20160509 Android vs. iPhone Pros and Cons.md diff --git a/sources/talk/20160509 Android vs. iPhone Pros and Cons.md b/sources/talk/20160509 Android vs. iPhone Pros and Cons.md new file mode 100644 index 0000000000..92feeba307 --- /dev/null +++ b/sources/talk/20160509 Android vs. iPhone Pros and Cons.md @@ -0,0 +1,86 @@ +Android vs. iPhone: Pros and Cons +=================================== + +>When comparing Android vs. iPhone, clearly Android has certain advantages even as the iPhone is superior in some key ways. But ultimately, which is better? + +The question of Android vs. iPhone is a personal one. + +Take myself, for example. I'm someone who has used both Android and the iPhone iOS. I'm well aware of the strengths of both platforms along with their weaknesses. Because of this, I decided to share my perspective regarding these two mobile platforms. Additionally, we'll take a look at my impressions of the new Ubuntu mobile platform and where it stacks up. + +### What iPhone gets right + +Even though I'm a full time Android user these days, I do recognize the areas where the iPhone got it right. First, Apple has a better record in updating their devices. This is especially true for older devices running iOS. With Android, if it's not a “Google blessed” Nexus...it better be a higher end carrier supported phone. Otherwise, you're going to find updates are either sparse or non-existent. + +Another area where the iPhone does well is apps availability. Expanding on that: iPhone apps almost always have a cleaner look to them. This isn't to say that Android apps are ugly, rather, they may not have an expected flow and consistency found with iOS. Two examples of exclusivity and great iOS-only layout would have to be [Dark Sky][1] (weather) and [Facebook Paper][2]. + +Then there is the backup process. Android can, by default, back stuff up to Google. But that doesn't help much with application data! By contrast, iCloud can essentially make a full backup of your iOS device. + +### Where iPhone loses me + +The biggest indisputable issue I have with the iPhone is more of a hardware limitation than a software one. That issue is storage. + +Look, with most Android phones, I can buy a smaller capacity phone and then add an SD card later. This does two things: First, I can use the SD card to store a lot of media files. Second, I can even use the SD card to store "some" of my apps. Apple has nothing that will touch this. + +Another area where the iPhone loses me is in the lack of choice it provides. Backing up your device? Hope you like iTunes or iCloud. For someone like myself who uses Linux, this means my ONLY option would be to use iCloud. + +To be ultimately fair, there are additional solutions for your iPhone if you're willing to jailbreak it. But that's not what this article is about. Same goes for rooting Android. This article is addressing a vanilla setup for both platforms. + +Finally, let us not forget this little treat – [iTunes decides to delete a user's music][3] because it was seen as a duplication of Apple Music contents...or something along those lines. Not iPhone specific? I disagree, as that music would have very well ended up onto the iPhone at some point. I can say with great certainty that in no universe would I ever put up with this kind of nonsense! + +![](http://www.datamation.com/imagesvr_ce/5552/mobile-abstract-icon-200x150.jpg) +>The Android vs. iPhone debate depends on what features matter the most to you. + +### What Android gets right + +The biggest thing Android gives me that the iPhone doesn't: choice. Choices in applications, devices and overall layout of how my phone works. + +I love desktop widgets! To iPhone users, they may seem really silly. But I can tell you that they save me from opening up applications as I can see the desired data without the extra hassle. Another similar feature I love is being able to install custom launchers instead of my phone's default! + +Finally, I can utilize tools like [Airdroid][4] and [Tasker][5] to add full computer-like functionality to my smart phone. Airdroid allows me treat my Android phone like a computer with file management and SMS with anyone – this becomes a breeze to use with my mouse and keyboard. Tasker is awesome in that I can setup "recipes" to connect/disconnect, put my phone into meeting mode or even put itself into power saving mode when I set the parameters to do so. I can even set it to launch applications when I arrive at specific destinations. + +### Where Android loses me + +Backup options are limited to specific user data, not a full clone of your phone. Without rooting, you're either left out in the wind or you must look to the Android SDK for solutions. Expecting casual users to either root their phone or run the SDK for a complete (I mean everything) Android backup is a joke. + +Yes, Google's backup service will backup Google app data, along with other related customizations. But it's nowhere near as complete as what we see with the iPhone. To accomplish something similar to what the iPhone enjoys, I've found you're going to either be rooting your Android phone or connecting it to a Windows PC to utilize some random program. + +To be fair, however, I believe Nexus owners benefit from a [full backup service][6] that is device specific. Sorry, but Google's default backup is not cutting it. Same applies for adb backups via your PC – they don't always restore things as expected. + +Wait, it gets better. Now after a lot of failed let downs and frustration, I found that there was one app that looked like it "might" offer a glimmer of hope, it's called Helium. Unlike other applications I found to be misleading and frustrating with their limitations, [Helium][7] initially looked like it was the backup application Google should have been offering all along -- emphasis on "looked like." Sadly, it was a huge let down. Not only did I need to connect it to my computer for a first run, it didn't even work using their provided Linux script. After removing their script, I settling for a good old fashioned adb backup...to my Linux PC. Fun facts: You will need to turn on a laundry list of stuff in developer tools, plus if you run the Twilight app, that needs to be turned off. It took me a bit to put this together when the backup option for adb on my phone wasn't responding. + +At the end of the day, Android has ample options for non-rooted users to backup superficial stuff like contacts, SMS and other data easily. But a deep down phone backup is best left to a wired connection and adb from my experience. + +### Ubuntu will save us? + +With the good and the bad examined between the two major players in the mobile space, there's a lot of hope that we're going to see good things from Ubuntu on the mobile front. Well, thus far, it's been pretty lackluster. + +I like what the developers are doing with the OS and I certainly love the idea of a third option for mobile besides iPhone and Android. Unfortunately, though, it's not that popular on the phone and the tablet received a lot of bad press due to subpar hardware and a lousy demonstration that made its way onto YouTube. + +To be fair, I've had subpar experiences with iPhone and Android, too, in the past. So this isn't a dig on Ubuntu. But until it starts showing up with a ready to go ecosystem of functionality that matches what Android and iOS offer, it's not something I'm terribly interested in yet. At a later date, perhaps, I'll feel like the Ubuntu phones are ready to meet my needs. + +### Android vs. iPhone bottom line: Why Android wins long term + +Despite its painful shortcomings, Android treats me like an adult. It doesn't lock me into only two methods for backing up my data. Yes, some of Android's limitations are due to the fact that it's focused on letting me choose how to handle my data. But, I also get to choose my own device, add storage on a whim. Android enables me to do a lot of cool stuff that the iPhone simply isn't capable of doing. + +At its core, Android gives non-root users greater access to the phone's functionality. For better or worse, it's a level of freedom that I think people are gravitating towards. Now there are going to be many of you who swear by the iPhone thanks to efforts like the [libimobiledevice][8] project. But take a long hard look at all the stuff Apple blocks Linux users from doing...then ask yourself – is it really worth it as a Linux user? Hit the Comments, share your thoughts on Android, iPhone or Ubuntu. + +------------------------------------------------------------------------------ + +via: http://www.datamation.com/mobile-wireless/android-vs.-iphone-pros-and-cons.html + +作者:[Matt Hartley][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.datamation.com/author/Matt-Hartley-3080.html +[1]: http://darkskyapp.com/ +[2]: https://www.facebook.com/paper/ +[3]: https://blog.vellumatlanta.com/2016/05/04/apple-stole-my-music-no-seriously/ +[4]: https://www.airdroid.com/ +[5]: http://tasker.dinglisch.net/ +[6]: https://support.google.com/nexus/answer/2819582?hl=en +[7]: https://play.google.com/store/apps/details?id=com.koushikdutta.backup&hl=en +[8]: http://www.libimobiledevice.org/ + From 419bb28718c5277cf84db526207d2cf63f23dde1 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 31 Jul 2016 12:01:35 +0800 Subject: [PATCH 1307/1469] =?UTF-8?q?20160731-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Use Awk Special Patterns begin and end.md | 166 ++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 sources/tech/awk/20160719 Part 9 - Learn How to Use Awk Special Patterns begin and end.md diff --git a/sources/tech/awk/20160719 Part 9 - Learn How to Use Awk Special Patterns begin and end.md b/sources/tech/awk/20160719 Part 9 - Learn How to Use Awk Special Patterns begin and end.md new file mode 100644 index 0000000000..f64e834ca1 --- /dev/null +++ b/sources/tech/awk/20160719 Part 9 - Learn How to Use Awk Special Patterns begin and end.md @@ -0,0 +1,166 @@ +Learn How to Use Awk Special Patterns ‘BEGIN and END’ – Part 9 +=============================================================== + +In Part 8 of this Awk series, we introduced some powerful Awk command features, that is variables, numeric expressions and assignment operators. + +As we advance, in this segment, we shall cover more Awk features, and that is the special patterns: `BEGIN` and `END`. + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Learn-Awk-Patterns-BEGIN-and-END.png) +>Learn Awk Patterns BEGIN and END + +These special features will prove helpful as we try to expand on and explore more methods of building complex Awk operations. + +To get started, let us drive our thoughts back to the introduction of the Awk series, remember when we started this series, I pointed out that the general syntax of a running an Awk command is: + +``` +# awk 'script' filenames +``` + +And in the syntax above, the Awk script has the form: + +``` +/pattern/ { actions } +``` + +When you consider the pattern in the script, it is normally a regular expression, additionally, you can also think of pattern as special patterns `BEGIN` and `END`. Therefore, we can also write an Awk command in the form below: + +``` +awk ' +BEGIN { actions } +/pattern/ { actions } +/pattern/ { actions } +………. +END { actions } +' filenames +``` + +In the event that you use the special patterns: `BEGIN` and `END` in an Awk script, this is what each of them means: + +- `BEGIN` pattern: means that Awk will execute the action(s) specified in `BEGIN` once before any input lines are read. +- `END` pattern: means that Awk will execute the action(s) specified in `END` before it actually exits. + +And the flow of execution of the an Awk command script which contains these special patterns is as follows: + +- When the `BEGIN` pattern is used in a script, all the actions for `BEGIN` are executed once before any input line is read. +- Then an input line is read and parsed into the different fields. +- Next, each of the non-special patterns specified is compared with the input line for a match, when a match is found, the action(s) for that pattern are then executed. This stage will be repeated for all the patterns you have specified. +- Next, stage 2 and 3 are repeated for all input lines. +- When all input lines have been read and dealt with, in case you specify the `END` pattern, the action(s) will be executed. + +You should always remember this sequence of execution when working with the special patterns to achieve the best results in an Awk operation. + +To understand it all, let us illustrate using the example from part 8, about the list of domains owned by Tecmint, as stored in a file named domains.txt. + +``` +news.tecmint.com +tecmint.com +linuxsay.com +windows.tecmint.com +tecmint.com +news.tecmint.com +tecmint.com +linuxsay.com +tecmint.com +news.tecmint.com +tecmint.com +linuxsay.com +windows.tecmint.com +tecmint.com +``` + +``` +$ cat ~/domains.txt +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/07/View-Contents-of-File.png) +>View Contents of File + +In this example, we want to count the number of times the domain `tecmint.com` is listed in the file domains.txt. So we wrote a small shell script to help us do that using the idea of variables, numeric expressions and assignment operators which has the following content: + +``` +#!/bin/bash +for file in $@; do +if [ -f $file ] ; then +#print out filename +echo "File is: $file" +#print a number incrementally for every line containing tecmint.com +awk '/^tecmint.com/ { counter+=1 ; printf "%s\n", counter ; }' $file +else +#print error info incase input is not a file +echo "$file is not a file, please specify a file." >&2 && exit 1 +fi +done +#terminate script with exit code 0 in case of successful execution +exit 0 +``` + +Let us now employ the two special patterns: `BEGIN` and `END` in the Awk command in the script above as follows: + +We shall alter the script: + +``` +awk '/^tecmint.com/ { counter+=1 ; printf "%s\n", counter ; }' $file +``` + +To: + +``` +awk ' BEGIN { print "The number of times tecmint.com appears in the file is:" ; } +/^tecmint.com/ { counter+=1 ; } +END { printf "%s\n", counter ; } +' $file +``` + +After making the changes to the Awk command, the complete shell script now looks like this: + +``` +#!/bin/bash +for file in $@; do +if [ -f $file ] ; then +#print out filename +echo "File is: $file" +#print the total number of times tecmint.com appears in the file +awk ' BEGIN { print "The number of times tecmint.com appears in the file is:" ; } +/^tecmint.com/ { counter+=1 ; } +END { printf "%s\n", counter ; } +' $file +else +#print error info incase input is not a file +echo "$file is not a file, please specify a file." >&2 && exit 1 +fi +done +#terminate script with exit code 0 in case of successful execution +exit 0 +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Awk-BEGIN-and-END-Patterns.png) +>Awk BEGIN and END Patterns + +When we run the script above, it will first of all print the location of the file domains.txt, then the Awk command script is executed, where the `BEGIN` special pattern helps us print out the message “`The number of times tecmint.com appears in the file is:`” before any input lines are read from the file. + +Then our pattern, `/^tecmint.com/` is compared against every input line and the action, `{ counter+=1 ; }` is executed for each input line, which counts the number of times `tecmint.com` appears in the file. + +Finally, the `END` pattern will print the total the number of times the domain `tecmint.com` appears in the file. + +``` +$ ./script.sh ~/domains.txt +``` +![](http://www.tecmint.com/wp-content/uploads/2016/07/Script-to-Count-Number-of-Times-String-Appears.png) +>Script to Count Number of Times String Appears + +To conclude, we walked through more Awk features exploring on the concepts of special pattern: `BEGIN` and `END`. + +As I pointed out before, these Awk features will help us build more complex text filtering operations, there is more to cover under Awk features and in part 10, we shall approach the idea of Awk built-in variables, so stay connected. + + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/learn-use-awk-special-patterns-begin-and-end/ + +作者:[Aaron Kili][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/aaronkili/ From 4a6dae274e72492ba7c2bfcbcdbecf3e7dc54541 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 31 Jul 2016 12:07:54 +0800 Subject: [PATCH 1308/1469] =?UTF-8?q?20160731-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Learn How to Use Awk Built-in Variables.md | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 sources/tech/awk/20160725 Part 10 - Learn How to Use Awk Built-in Variables.md diff --git a/sources/tech/awk/20160725 Part 10 - Learn How to Use Awk Built-in Variables.md b/sources/tech/awk/20160725 Part 10 - Learn How to Use Awk Built-in Variables.md new file mode 100644 index 0000000000..4cbecac8c9 --- /dev/null +++ b/sources/tech/awk/20160725 Part 10 - Learn How to Use Awk Built-in Variables.md @@ -0,0 +1,119 @@ +Learn How to Use Awk Built-in Variables – Part 10 +================================================= + +As we uncover the section of Awk features, in this part of the series, we shall walk through the concept of built-in variables in Awk. There are two types of variables you can use in Awk, these are; user-defined variables, which we covered in Part 8 and built-in variables. + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Awk-Built-in-Variables-Examples.png) +>Awk Built in Variables Examples + +Built-in variables have values already defined in Awk, but we can also carefully alter those values, the built-in variables include: + +- `FILENAME` : current input file name( do not change variable name) +- `FR` : number of the current input line (that is input line 1, 2, 3… so on, do not change variable name) +- `NF` : number of fields in current input line (do not change variable name) +- `OFS` : output field separator +- `FS` : input field separator +- `ORS` : output record separator +- `RS` : input record separator + +Let us proceed to illustrate the use of some of the Awk built-in variables above: + +To read the filename of the current input file, you can use the `FILENAME` built-in variable as follows: + +``` +$ awk ' { print FILENAME } ' ~/domains.txt +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Awk-FILENAME-Variable.png) +>Awk FILENAME Variable + +You will realize that, the filename is printed out for each input line, that is the default behavior of Awk when you use `FILENAME` built-in variable. + +Using `NR` to count the number of lines (records) in an input file, remember that, it also counts the empty lines, as we shall see in the example below. + +When we view the file domains.txt using cat command, it contains 14 lines with text and empty 2 lines: + +``` +$ cat ~/domains.txt +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Print-Contents-of-File.png) +>Print Contents of File + + +``` +$ awk ' END { print "Number of records in file is: ", NR } ' ~/domains.txt +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Awk-Count-Number-of-Lines.png) +>Awk Count Number of Lines + +To count the number of fields in a record or line, we use the NR built-in variable as follows: + +``` +$ cat ~/names.txt +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/07/List-File-Contents.png) +>List File Contents + +``` +$ awk '{ print "Record:",NR,"has",NF,"fields" ; }' ~/names.txt +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Awk-Count-Number-of-Fields-in-File.png) +>Awk Count Number of Fields in File + +Next, you can also specify an input field separator using the FS built-in variable, it defines how Awk divides input lines into fields. + +The default value for FS is space and tab, but we can change the value of FS to any character that will instruct Awk to divide input lines accordingly. + +There are two methods to do this: + +- one method is to use the FS built-in variable +- and the second is to invoke the -F Awk option + +Consider the file /etc/passwd on a Linux system, the fields in this file are divided using the : character, so we can specify it as the new input field separator when we want to filter out certain fields as in the following examples: + +We can use the `-F` option as follows: + +``` +$ awk -F':' '{ print $1, $4 ;}' /etc/passwd +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Awk-Filter-Fields-in-Password-File.png) +>Awk Filter Fields in Password File + +Optionally, we can also take advantage of the FS built-in variable as below: + +``` +$ awk ' BEGIN { FS=“:” ; } { print $1, $4 ; } ' /etc/passwd +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Filter-Fields-in-File-Using-Awk.png) +>Filter Fields in File Using Awk + +To specify an output field separator, use the OFS built-in variable, it defines how the output fields will be separated using the character we use as in the example below: + +``` +$ awk -F':' ' BEGIN { OFS="==>" ;} { print $1, $4 ;}' /etc/passwd +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Add-Separator-to-Field-in-File.png) +>Add Separator to Field in File + +In this Part 10, we have explored the idea of using Awk built-in variables which come with predefined values. But we can also change these values, though, it is not recommended to do so unless you know what you are doing, with adequate understanding. + +After this, we shall progress to cover how we can use shell variables in Awk command operations, therefore, stay connected to Tecmint. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/awk-built-in-variables-examples/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tecmint+%28Tecmint%3A+Linux+Howto%27s+Guide%29 + +作者:[Aaron Kili][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/aaronkili/ From b6f2ecb0404edbd7074f9ffd3da07bd5f421a55f Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 31 Jul 2016 12:19:36 +0800 Subject: [PATCH 1309/1469] =?UTF-8?q?20160731-4=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Audio files with Octave 4.0.0 on Ubuntu.md | 138 ++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 sources/tech/20160616 Part 1 - Scientific Audio Processing How to read and write Audio files with Octave 4.0.0 on Ubuntu.md diff --git a/sources/tech/20160616 Part 1 - Scientific Audio Processing How to read and write Audio files with Octave 4.0.0 on Ubuntu.md b/sources/tech/20160616 Part 1 - Scientific Audio Processing How to read and write Audio files with Octave 4.0.0 on Ubuntu.md new file mode 100644 index 0000000000..80300deb6b --- /dev/null +++ b/sources/tech/20160616 Part 1 - Scientific Audio Processing How to read and write Audio files with Octave 4.0.0 on Ubuntu.md @@ -0,0 +1,138 @@ +Scientific Audio Processing, Part I - How to read and write Audio files with Octave 4.0.0 on Ubuntu +================ + +Octave, the equivalent software to Matlab in Linux, has a number of functions and commands that allow the acquisition, recording, playback and digital processing of audio signals for entertainment applications, research, medical, or any other science areas. In this tutorial, we will use Octave V4.0.0 in Ubuntu and will start reading from audio files through writing and playing signals to emulate sounds used in a wide range of activities. + +Note that the main focus of this tutorial is not to install or learn to use an audio processing software already established, but rather to understand how it works from the point of view of design and audio engineering. + +### Prerequisites + +The first step is to install octave. Run the following commands in a terminal to add the Octave PPA in Ubuntu and install the software. + +``` +sudo apt-add-repository ppa:octave/stable +sudo apt-get update +sudo apt-get install octave +``` + +### Step 1: Opening Octave. + +In this step we open the software by clicking on its icon, we can change the work directory by clicking on the File Browser dropdown. + +![](https://www.howtoforge.com/images/how-to-read-and-write-audio-files-with-octave-4-in-ubuntu/initial.png) + +### Step 2: Audio Info + +The command "audioinfo" shows us relevant information about the audio file that we will process. + +``` +>> info = audioinfo ('testing.ogg') +``` + +![](https://www.howtoforge.com/images/how-to-read-and-write-audio-files-with-octave-4-in-ubuntu/audioinfo.png) + +### Step 3: Reading an audio File + +In this tutorial I will read and use ogg files for which it is feasible to read characteristics like sampling , audio type (stereo or mono), number of channels, etc. I should mention that for purposes of this tutorial, all the commands used will be executed in the terminal window of Octave. First, we have to save the ogg file in a variable. Note: it´s important that the file must be in the work path of Octave + +``` +>> file='yourfile.ogg' +``` + +``` +>> [M, fs] = audioread(file) +``` + +Where M is a matrix of one or two columns, depending on the number of channels and fs is the sampling frequency. + +![](https://www.howtoforge.com/images/how-to-read-and-write-audio-files-with-octave-4-in-ubuntu/reading.png) + +![](https://www.howtoforge.com/images/how-to-read-and-write-audio-files-with-octave-4-in-ubuntu/matrix.png) + +![](https://www.howtoforge.com/images/how-to-read-and-write-audio-files-with-octave-4-in-ubuntu/big/frequency.png) + +There are some options that we can use for reading audio files, such as: + +``` +>> [y, fs] = audioread (filename, samples) + +>> [y, fs] = audioread (filename, datatype) + +>> [y, fs] = audioread (filename, samples, datatype) +``` + +Where samples specifies starting and ending frames and datatype specifies the data type to return. We can assign values to any variable: + +``` +>> samples = [1, fs) + +>> [y, fs] = audioread (filename, samples) +``` + +And about datatype: + +``` +>> [y,Fs] = audioread(filename,'native') +``` + +If the value is 'native' then the type of data depends on how the data is stored in the audio file. + +### Step 4: Writing an audio file + +Creating the ogg file: + +For this purpose, we are going to generate an ogg file with values from a cosine. The sampling frequency that I will use is 44100 samples per second and the file will last for 10 seconds. The frequency of the cosine signal is 440 Hz. + +``` +>> filename='cosine.ogg'; +>> fs=44100; +>> t=0:1/fs:10; +>> w=2*pi*440*t; +>> signal=cos(w); +>> audiowrite(filename, signal, fs); +``` + +This creates a file named 'cosine.ogg' in our workspace that contains the cosine signal. + +![](https://www.howtoforge.com/images/how-to-read-and-write-audio-files-with-octave-4-in-ubuntu/cosinefile.png) + +If we play the 'cosine.ogg' file then this will reproduce a 440Hz tone which is equivalent to an 'A' musical tone. If we want to see the values saved in the file we have to 'read' the file with the 'audioread' function. In a further tutorial, we will see how to write an audio file with two channels. + +### Step 5: Playing an audio file + +Octave, by default, has an audio player that we can use for testing purposes. Use the following functions as example: + +``` + >> [y,fs]=audioread('yourfile.ogg'); +>> player=audioplayer(y, fs, 8) + + scalar structure containing the fields: + + BitsPerSample = 8 + CurrentSample = 0 + DeviceID = -1 + NumberOfChannels = 1 + Running = off + SampleRate = 44100 + TotalSamples = 236473 + Tag = + Type = audioplayer + UserData = [](0x0) +>> play(player); +``` + +In the next parts of the tutorial, we will see advanced audio processing features and possible use cases for scientific and commercial use. + +-------------------------------------------------------------------------------- + +via: https://www.howtoforge.com/tutorial/how-to-read-and-write-audio-files-with-octave-4-in-ubuntu/ + +作者:[David Duarte][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对ID](https://github.com/校对ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://twitter.com/intent/follow?original_referer=https%3A%2F%2Fwww.howtoforge.com%2Ftutorial%2Fhow-to-read-and-write-audio-files-with-octave-4-in-ubuntu%2F&ref_src=twsrc%5Etfw®ion=follow_link&screen_name=howtoforgecom&tw_p=followbutton + + From db95b0e90111e70434454575b4790dc94557bce4 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 31 Jul 2016 13:16:10 +0800 Subject: [PATCH 1310/1469] =?UTF-8?q?20160731-0=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 长文,机器学习 --- ...ce portfolio - Machine learning project.md | 845 ++++++++++++++++++ 1 file changed, 845 insertions(+) create mode 100644 sources/tech/20160705 Building a data science portfolio - Machine learning project.md diff --git a/sources/tech/20160705 Building a data science portfolio - Machine learning project.md b/sources/tech/20160705 Building a data science portfolio - Machine learning project.md new file mode 100644 index 0000000000..ca57b2e83c --- /dev/null +++ b/sources/tech/20160705 Building a data science portfolio - Machine learning project.md @@ -0,0 +1,845 @@ +Building a data science portfolio: Machine learning project +=========================================================== + +>This is the third in a series of posts on how to build a Data Science Portfolio. If you like this and want to know when the next post in the series is released, you can [subscribe at the bottom of the page][1]. + +Data science companies are increasingly looking at portfolios when making hiring decisions. One of the reasons for this is that a portfolio is the best way to judge someone’s real-world skills. The good news for you is that a portfolio is entirely within your control. If you put some work in, you can make a great portfolio that companies are impressed by. + +The first step in making a high-quality portfolio is to know what skills to demonstrate. The primary skills that companies want in data scientists, and thus the primary skills they want a portfolio to demonstrate, are: + +- Ability to communicate +- Ability to collaborate with others +- Technical competence +- Ability to reason about data +- Motivation and ability to take initiative + +Any good portfolio will be composed of multiple projects, each of which may demonstrate 1-2 of the above points. This is the third post in a series that will cover how to make a well-rounded data science portfolio. In this post, we’ll cover how to make the second project in your portfolio, and how to build an end to end machine learning project. At the end, you’ll have a project that shows your ability to reason about data, and your technical competence. [Here’s][2] the completed project if you want to take a look. + +### An end to end project + +As a data scientist, there are times when you’ll be asked to take a dataset and figure out how to [tell a story with it][3]. In times like this, it’s important to communicate very well, and walk through your process. Tools like Jupyter notebook, which we used in a previous post, are very good at helping you do this. The expectation here is that the deliverable is a presentation or document summarizing your findings. + +However, there are other times when you’ll be asked to create a project that has operational value. A project with operational value directly impacts the day-to-day operations of a company, and will be used more than once, and often by multiple people. A task like this might be “create an algorithm to forecast our churn rate”, or “create a model that can automatically tag our articles”. In cases like this, storytelling is less important than technical competence. You need to be able to take a dataset, understand it, then create a set of scripts that can process that data. It’s often important that these scripts run quickly, and use minimal system resources like memory. It’s very common that these scripts will be run several times, so the deliverable becomes the scripts themselves, not a presentation. The deliverable is often integrated into operational flows, and may even be user-facing. + +The main components of building an end to end project are: + +- Understanding the context +- Exploring the data and figuring out the nuances +- Creating a well-structured project, so its easy to integrate into operational flows +- Writing high-performance code that runs quickly and uses minimal system resources +- Documenting the installation and usage of your code well, so others can use it + +In order to effectively create a project of this kind, we’ll need to work with multiple files. Using a text editor like [Atom][4], or an IDE like [PyCharm][5] is highly recommended. These tools will allow you to jump between files, and edit files of different types, like markdown files, Python files, and csv files. Structuring your project so it’s easy to version control and upload to collaborative coding tools like [Github][6] is also useful. + +![](https://www.dataquest.io/blog/images/end_to_end/github.png) +>This project on Github. + +We’ll use our editing tools along with libraries like [Pandas][7] and [scikit-learn][8] in this post. We’ll make extensive use of Pandas [DataFrames][9], which make it easy to read in and work with tabular data in Python. + +### Finding good datasets + +A good dataset for an end to end portfolio project can be hard to find. [The dataset][10] needs to be sufficiently large that memory and performance constraints come into play. It also needs to potentially be operationally useful. For instance, this dataset, which contains data on the admission criteria, graduation rates, and graduate future earnings for US colleges would be a great dataset to use to tell a story. However, as you think about the dataset, it becomes clear that there isn’t enough nuance to build a good end to end project with it. For example, you could tell someone their potential future earnings if they went to a specific college, but that would be a quick lookup without enough nuance to demonstrate technical competence. You could also figure out if colleges with higher admissions standards tend to have graduates who earn more, but that would be more storytelling than operational. + +These memory and performance constraints tend to come into play when you have more than a gigabyte of data, and when you have some nuance to what you want to predict, which involves running algorithms over the dataset. + +A good operational dataset enables you to build a set of scripts that transform the data, and answer dynamic questions. A good example would be a dataset of stock prices. You would be able to predict the prices for the next day, and keep feeding new data to the algorithm as the markets closed. This would enable you to make trades, and potentially even profit. This wouldn’t be telling a story – it would be adding direct value. + +Some good places to find datasets like this are: + +- [/r/datasets][11] – a subreddit that has hundreds of interesting datasets. +- [Google Public Datasets][12] – public datasets available through Google BigQuery. +- [Awesome datasets][13] – a list of datasets, hosted on Github. + +As you look through these datasets, think about what questions someone might want answered with the dataset, and think if those questions are one-time (“how did housing prices correlate with the S&P 500?”), or ongoing (“can you predict the stock market?”). The key here is to find questions that are ongoing, and require the same code to be run multiple times with different inputs (different data). + +For the purposes of this post, we’ll look at [Fannie Mae Loan Data][14]. Fannie Mae is a government sponsored enterprise in the US that buys mortgage loans from other lenders. It then bundles these loans up into mortgage-backed securities and resells them. This enables lenders to make more mortgage loans, and creates more liquidity in the market. This theoretically leads to more homeownership, and better loan terms. From a borrowers perspective, things stay largely the same, though. + +Fannie Mae releases two types of data – data on loans it acquires, and data on how those loans perform over time. In the ideal case, someone borrows money from a lender, then repays the loan until the balance is zero. However, some borrowers miss multiple payments, which can cause foreclosure. Foreclosure is when the house is seized by the bank because mortgage payments cannot be made. Fannie Mae tracks which loans have missed payments on them, and which loans needed to be foreclosed on. This data is published quarterly, and lags the current date by 1 year. As of this writing, the most recent dataset that’s available is from the first quarter of 2015. + +Acquisition data, which is published when the loan is acquired by Fannie Mae, contains information on the borrower, including credit score, and information on their loan and home. Performance data, which is published every quarter after the loan is acquired, contains information on the payments being made by the borrower, and the foreclosure status, if any. A loan that is acquired may have dozens of rows in the performance data. A good way to think of this is that the acquisition data tells you that Fannie Mae now controls the loan, and the performance data contains a series of status updates on the loan. One of the status updates may tell us that the loan was foreclosed on during a certain quarter. + +![](https://www.dataquest.io/blog/images/end_to_end/foreclosure.jpg) +>A foreclosed home being sold. + +### Picking an angle + +There are a few directions we could go in with the Fannie Mae dataset. We could: + +- Try to predict the sale price of a house after it’s foreclosed on. +- Predict the payment history of a borrower. +- Figure out a score for each loan at acquisition time. + +The important thing is to stick to a single angle. Trying to focus on too many things at once will make it hard to make an effective project. It’s also important to pick an angle that has sufficient nuance. Here are examples of angles without much nuance: + +- Figuring out which banks sold loans to Fannie Mae that were foreclosed on the most. +- Figuring out trends in borrower credit scores. +- Exploring which types of homes are foreclosed on most often. +- Exploring the relationship between loan amounts and foreclosure sale prices + +All of the above angles are interesting, and would be great if we were focused on storytelling, but aren’t great fits for an operational project. + +With the Fannie Mae dataset, we’ll try to predict whether a loan will be foreclosed on in the future by only using information that was available when the loan was acquired. In effect, we’ll create a “score” for any mortgage that will tell us if Fannie Mae should buy it or not. This will give us a nice foundation to build on, and will be a great portfolio piece. + +### Understanding the data + +Let’s take a quick look at the raw data files. Here are the first few rows of the acquisition data from quarter 1 of 2012: + +``` +100000853384|R|OTHER|4.625|280000|360|02/2012|04/2012|31|31|1|23|801|N|C|SF|1|I|CA|945||FRM| +100003735682|R|SUNTRUST MORTGAGE INC.|3.99|466000|360|01/2012|03/2012|80|80|2|30|794|N|P|SF|1|P|MD|208||FRM|788 +100006367485|C|PHH MORTGAGE CORPORATION|4|229000|360|02/2012|04/2012|67|67|2|36|802|N|R|SF|1|P|CA|959||FRM|794 +``` + +Here are the first few rows of the performance data from quarter 1 of 2012: + +``` +100000853384|03/01/2012|OTHER|4.625||0|360|359|03/2042|41860|0|N|||||||||||||||| +100000853384|04/01/2012||4.625||1|359|358|03/2042|41860|0|N|||||||||||||||| +100000853384|05/01/2012||4.625||2|358|357|03/2042|41860|0|N|||||||||||||||| +``` + +Before proceeding too far into coding, it’s useful to take some time and really understand the data. This is more critical in operational projects – because we aren’t interactively exploring the data, it can be harder to spot certain nuances unless we find them upfront. In this case, the first step is to read the materials on the Fannie Mae site: + +- [Overview][15] +- [Glossary of useful terms][16] +- [FAQs][17] +- [Columns in the Acquisition and Performance files][18] +- [Sample Acquisition data file][19] +- [Sample Performance data file][20] + +After reading through these files, we know some key facts that will help us: + +- There’s an Acquisition file and a Performance file for each quarter, starting from the year 2000 to present. There’s a 1 year lag in the data, so the most recent data is from 2015 as of this writing. +- The files are in text format, with a pipe (|) as a delimiter. +- The files don’t have headers, but we have a list of what each column is. +- All together, the files contain data on 22 million loans. +- Because the Performance files contain information on loans acquired in previous years, there will be more performance data for loans acquired in earlier years (ie loans acquired in 2014 won’t have much performance history). + +These small bits of information will save us a ton of time as we figure out how to structure our project and work with the data. + +### Structuring the project + +Before we start downloading and exploring the data, it’s important to think about how we’ll structure the project. When building an end-to-end project, our primary goals are: + +- Creating a solution that works +- Having a solution that runs quickly and uses minimal resources +- Enabling others to easily extend our work +- Making it easy for others to understand our code +- Writing as little code as possible + +In order to achieve these goals, we’ll need to structure our project well. A well structured project follows a few principles: + +- Separates data files and code files. +- Separates raw data from generated data. +- Has a README.md file that walks people through installing and using the project. +- Has a requirements.txt file that contains all the packages needed to run the project. +- Has a single settings.py file that contains any settings that are used in other files. + - For example, if you are reading the same file from multiple Python scripts, it’s useful to have them all import settings and get the file name from a centralized place. +- Has a .gitignore file that prevents large or secret files from being committed. +- Breaks each step in our task into a separate file that can be executed separately. + - For example, we may have one file for reading in the data, one for creating features, and one for making predictions. +- Stores intermediate values. For example, one script may output a file that the next script can read. + - This enables us to make changes in our data processing flow without recalculating everything. + +Our file structure will look something like this shortly: + +``` +loan-prediction +├── data +├── processed +├── .gitignore +├── README.md +├── requirements.txt +├── settings.py +``` + +### Creating the initial files + +To start with, we’ll need to create a loan-prediction folder. Inside that folder, we’ll need to make a data folder and a processed folder. The first will store our raw data, and the second will store any intermediate calculated values. + +Next, we’ll make a .gitignore file. A .gitignore file will make sure certain files are ignored by git and not pushed to Github. One good example of such a file is the .DS_Store file created by OSX in every folder. A good starting point for a .gitignore file is here. We’ll also want to ignore the data files because they are very large, and the Fannie Mae terms prevent us from redistributing them, so we should add two lines to the end of our file: + +``` +data +processed +``` + +[Here’s][21] an example .gitignore file for this project. + +Next, we’ll need to create README.md, which will help people understand the project. .md indicates that the file is in markdown format. Markdown enables you write plain text, but also add some fancy formatting if you want. [Here’s][22] a guide on markdown. If you upload a file called README.md to Github, Github will automatically process the markdown, and show it to anyone who views the project. [Here’s][23] an example. + +For now, we just need to put a simple description in README.md: + +``` +Loan Prediction +----------------------- + +Predict whether or not loans acquired by Fannie Mae will go into foreclosure. Fannie Mae acquires loans from other lenders as a way of inducing them to lend more. Fannie Mae releases data on the loans it has acquired and their performance afterwards [here](http://www.fanniemae.com/portal/funding-the-market/data/loan-performance-data.html). +``` + +Now, we can create a requirements.txt file. This will make it easy for other people to install our project. We don’t know exactly what libraries we’ll be using yet, but here’s a good starting point: + +``` +pandas +matplotlib +scikit-learn +numpy +ipython +scipy +``` + +The above libraries are the most commonly used for data analysis tasks in Python, and its fair to assume that we’ll be using most of them. [Here’s][24] an example requirements file for this project. + +After creating requirements.txt, you should install the packages. For this post, we’ll be using Python 3. If you don’t have Python installed, you should look into using [Anaconda][25], a Python installer that also installs all the packages listed above. + +Finally, we can just make a blank settings.py file, since we don’t have any settings for our project yet. + +### Acquiring the data + +Once we have the skeleton of our project, we can get the raw data. + +Fannie Mae has some restrictions around acquiring the data, so you’ll need to sign up for an account. You can find the download page [here][26]. After creating an account, you’ll be able to download as few or as many loan data files as you want. The files are in zip format, and are reasonably large after decompression. + +For the purposes of this blog post, we’ll download everything from Q1 2012 to Q1 2015, inclusive. We’ll then need to unzip all of the files. After unzipping the files, remove the original .zip files. At the end, the loan-prediction folder should look something like this: + +``` +loan-prediction +├── data +│ ├── Acquisition_2012Q1.txt +│ ├── Acquisition_2012Q2.txt +│ ├── Performance_2012Q1.txt +│ ├── Performance_2012Q2.txt +│ └── ... +├── processed +├── .gitignore +├── README.md +├── requirements.txt +├── settings.py +``` + +After downloading the data, you can use the head and tail shell commands to look at the lines in the files. Do you see any columns that aren’t needed? It might be useful to consult the [pdf of column names][27] while doing this. + +### Reading in the data + +There are two issues that make our data hard to work with right now: + +- The acquisition and performance datasets are segmented across multiple files. +- Each file is missing headers. + +Before we can get started on working with the data, we’ll need to get to the point where we have one file for the acquisition data, and one file for the performance data. Each of the files will need to contain only the columns we care about, and have the proper headers. One wrinkle here is that the performance data is quite large, so we should try to trim some of the columns if we can. + +The first step is to add some variables to settings.py, which will contain the paths to our raw data and our processed data. We’ll also add a few other settings that will be useful later on: + +``` +DATA_DIR = "data" +PROCESSED_DIR = "processed" +MINIMUM_TRACKING_QUARTERS = 4 +TARGET = "foreclosure_status" +NON_PREDICTORS = [TARGET, "id"] +CV_FOLDS = 3 +``` + +Putting the paths in settings.py will put them in a centralized place and make them easy to change down the line. When referring to the same variables in multiple files, it’s easier to put them in a central place than edit them in every file when you want to change them. [Here’s][28] an example settings.py file for this project. + +The second step is to create a file called assemble.py that will assemble all the pieces into 2 files. When we run python assemble.py, we’ll get 2 data files in the processed directory. + +We’ll then start writing code in assemble.py. We’ll first need to define the headers for each file, so we’ll need to look at [pdf of column names][29] and create lists of the columns in each Acquisition and Performance file: + +``` +HEADERS = { + "Acquisition": [ + "id", + "channel", + "seller", + "interest_rate", + "balance", + "loan_term", + "origination_date", + "first_payment_date", + "ltv", + "cltv", + "borrower_count", + "dti", + "borrower_credit_score", + "first_time_homebuyer", + "loan_purpose", + "property_type", + "unit_count", + "occupancy_status", + "property_state", + "zip", + "insurance_percentage", + "product_type", + "co_borrower_credit_score" + ], + "Performance": [ + "id", + "reporting_period", + "servicer_name", + "interest_rate", + "balance", + "loan_age", + "months_to_maturity", + "maturity_date", + "msa", + "delinquency_status", + "modification_flag", + "zero_balance_code", + "zero_balance_date", + "last_paid_installment_date", + "foreclosure_date", + "disposition_date", + "foreclosure_costs", + "property_repair_costs", + "recovery_costs", + "misc_costs", + "tax_costs", + "sale_proceeds", + "credit_enhancement_proceeds", + "repurchase_proceeds", + "other_foreclosure_proceeds", + "non_interest_bearing_balance", + "principal_forgiveness_balance" + ] +} +``` + +The next step is to define the columns we want to keep. Since all we’re measuring on an ongoing basis about the loan is whether or not it was ever foreclosed on, we can discard many of the columns in the performance data. We’ll need to keep all the columns in the acquisition data, though, because we want to maximize the information we have about when the loan was acquired (after all, we’re predicting if the loan will ever be foreclosed or not at the point it’s acquired). Discarding columns will enable us to save disk space and memory, while also speeding up our code. + +``` +SELECT = { + "Acquisition": HEADERS["Acquisition"], + "Performance": [ + "id", + "foreclosure_date" + ] +} +``` + +Next, we’ll write a function to concatenate the data sets. The below code will: + +- Import a few needed libraries, including settings. +- Define a function concatenate, that: + - Gets the names of all the files in the data directory. + - Loops through each file. + - If the file isn’t the right type (doesn’t start with the prefix we want), we ignore it. + - Reads the file into a [DataFrame][30] with the right settings using the Pandas [read_csv][31] function. + - Sets the separator to | so the fields are read in correctly. + - The data has no header row, so sets header to None to indicate this. + - Sets names to the right value from the HEADERS dictionary – these will be the column names of our DataFrame. + - Picks only the columns from the DataFrame that we added in SELECT. +- Concatenates all the DataFrames together. +- Writes the concatenated DataFrame back to a file. + +``` +import os +import settings +import pandas as pd + +def concatenate(prefix="Acquisition"): + files = os.listdir(settings.DATA_DIR) + full = [] + for f in files: + if not f.startswith(prefix): + continue + + data = pd.read_csv(os.path.join(settings.DATA_DIR, f), sep="|", header=None, names=HEADERS[prefix], index_col=False) + data = data[SELECT[prefix]] + full.append(data) + + full = pd.concat(full, axis=0) + + full.to_csv(os.path.join(settings.PROCESSED_DIR, "{}.txt".format(prefix)), sep="|", header=SELECT[prefix], index=False) +``` + +We can call the above function twice with the arguments Acquisition and Performance to concatenate all the acquisition and performance files together. The below code will: + +- Only execute if the script is called from the command line with python assemble.py. +- Concatenate all the files, and result in two files: + - `processed/Acquisition.txt` + - `processed/Performance.txt` + +``` +if __name__ == "__main__": + concatenate("Acquisition") + concatenate("Performance") +``` + +We now have a nice, compartmentalized assemble.py that’s easy to execute, and easy to build off of. By decomposing the problem into pieces like this, we make it easy to build our project. Instead of one messy script that does everything, we define the data that will pass between the scripts, and make them completely separate from each other. When you’re working on larger projects, it’s a good idea to do this, because it makes it much easier to change individual pieces without having unexpected consequences on unrelated pieces of the project. + +Once we finish the assemble.py script, we can run python assemble.py. You can find the complete assemble.py file [here][32]. + +This will result in two files in the processed directory: + +``` +loan-prediction +├── data +│ ├── Acquisition_2012Q1.txt +│ ├── Acquisition_2012Q2.txt +│ ├── Performance_2012Q1.txt +│ ├── Performance_2012Q2.txt +│ └── ... +├── processed +│ ├── Acquisition.txt +│ ├── Performance.txt +├── .gitignore +├── assemble.py +├── README.md +├── requirements.txt +├── settings.py +``` + +### Computing values from the performance data + +The next step we’ll take is to calculate some values from processed/Performance.txt. All we want to do is to predict whether or not a property is foreclosed on. To figure this out, we just need to check if the performance data associated with a loan ever has a foreclosure_date. If foreclosure_date is None, then the property was never foreclosed on. In order to avoid including loans with little performance history in our sample, we’ll also want to count up how many rows exist in the performance file for each loan. This will let us filter loans without much performance history from our training data. + +One way to think of the loan data and the performance data is like this: + +![](https://github.com/LCTT/wiki-images/blob/master/TranslateProject/ref_img/001.png) + +As you can see above, each row in the Acquisition data can be related to multiple rows in the Performance data. In the Performance data, foreclosure_date will appear in the quarter when the foreclosure happened, so it should be blank prior to that. Some loans are never foreclosed on, so all the rows related to them in the Performance data have foreclosure_date blank. + +We need to compute foreclosure_status, which is a Boolean that indicates whether a particular loan id was ever foreclosed on, and performance_count, which is the number of rows in the performance data for each loan id. + +There are a few different ways to compute the counts we want: + +- We could read in all the performance data, then use the Pandas groupby method on the DataFrame to figure out the number of rows associated with each loan id, and also if the foreclosure_date is ever not None for the id. + - The upside of this method is that it’s easy to implement from a syntax perspective. + - The downside is that reading in all 129236094 lines in the data will take a lot of memory, and be extremely slow. +- We could read in all the performance data, then use apply on the acquisition DataFrame to find the counts for each id. + - The upside is that it’s easy to conceptualize. + - The downside is that reading in all 129236094 lines in the data will take a lot of memory, and be extremely slow. +- We could iterate over each row in the performance dataset, and keep a separate dictionary of counts. + - The upside is that the dataset doesn’t need to be loaded into memory, so it’s extremely fast and memory-efficient. + - The downside is that it will take slightly longer to conceptualize and implement, and we need to parse the rows manually. + +Loading in all the data will take quite a bit of memory, so let’s go with the third option above. All we need to do is to iterate through all the rows in the Performance data, while keeping a dictionary of counts per loan id. In the dictionary, we’ll keep track of how many times the id appears in the performance data, as well as if foreclosure_date is ever not None. This will give us foreclosure_status and performance_count. + +We’ll create a new file called annotate.py, and add in code that will enable us to compute these values. In the below code, we’ll: + +- Import needed libraries. +- Define a function called count_performance_rows. + - Open processed/Performance.txt. This doesn’t read the file into memory, but instead opens a file handler that can be used to read in the file line by line. + - Loop through each line in the file. + - Split the line on the delimiter (|) + - Check if the loan_id is not in the counts dictionary. + - If not, add it to counts. + - Increment performance_count for the given loan_id because we’re on a row that contains it. + - If date is not None, then we know that the loan was foreclosed on, so set foreclosure_status appropriately. + +``` +import os +import settings +import pandas as pd + +def count_performance_rows(): + counts = {} + with open(os.path.join(settings.PROCESSED_DIR, "Performance.txt"), 'r') as f: + for i, line in enumerate(f): + if i == 0: + # Skip header row + continue + loan_id, date = line.split("|") + loan_id = int(loan_id) + if loan_id not in counts: + counts[loan_id] = { + "foreclosure_status": False, + "performance_count": 0 + } + counts[loan_id]["performance_count"] += 1 + if len(date.strip()) > 0: + counts[loan_id]["foreclosure_status"] = True + return counts +``` + +### Getting the values + +Once we create our counts dictionary, we can make a function that will extract values from the dictionary if a loan_id and a key are passed in: + +``` +def get_performance_summary_value(loan_id, key, counts): + value = counts.get(loan_id, { + "foreclosure_status": False, + "performance_count": 0 + }) + return value[key] +``` + +The above function will return the appropriate value from the counts dictionary, and will enable us to assign a foreclosure_status value and a performance_count value to each row in the Acquisition data. The [get][33] method on dictionaries returns a default value if a key isn’t found, so this enables us to return sensible default values if a key isn’t found in the counts dictionary. + +### Annotating the data + +We’ve already added a few functions to annotate.py, but now we can get into the meat of the file. We’ll need to convert the acquisition data into a training dataset that can be used in a machine learning algorithm. This involves a few things: + +- Converting all columns to numeric. +- Filling in any missing values. +- Assigning a performance_count and a foreclosure_status to each row. +- Removing any rows that don’t have a lot of performance history (where performance_count is low). + +Several of our columns are strings, which aren’t useful to a machine learning algorithm. However, they are actually categorical variables, where there are a few different category codes, like R, S, and so on. We can convert these columns to numeric by assigning a number to each category label: + +![](https://github.com/LCTT/wiki-images/blob/master/TranslateProject/ref_img/002.png) + +Converting the columns this way will allow us to use them in our machine learning algorithm. + +Some of the columns also contain dates (first_payment_date and origination_date). We can split these dates into 2 columns each: + +![](https://github.com/LCTT/wiki-images/blob/master/TranslateProject/ref_img/003.png) +In the below code, we’ll transform the Acquisition data. We’ll define a function that: + +- Creates a foreclosure_status column in acquisition by getting the values from the counts dictionary. +- Creates a performance_count column in acquisition by getting the values from the counts dictionary. +- Converts each of the following columns from a string column to an integer column: + - channel + - seller + - first_time_homebuyer + - loan_purpose + - property_type + - occupancy_status + - property_state + - product_type +- Converts first_payment_date and origination_date to 2 columns each: + - Splits the column on the forward slash. + - Assigns the first part of the split list to a month column. + - Assigns the second part of the split list to a year column. + - Deletes the column. + - At the end, we’ll have first_payment_month, first_payment_year, origination_month, and origination_year. +- Fills any missing values in acquisition with -1. + +``` +def annotate(acquisition, counts): + acquisition["foreclosure_status"] = acquisition["id"].apply(lambda x: get_performance_summary_value(x, "foreclosure_status", counts)) + acquisition["performance_count"] = acquisition["id"].apply(lambda x: get_performance_summary_value(x, "performance_count", counts)) + for column in [ + "channel", + "seller", + "first_time_homebuyer", + "loan_purpose", + "property_type", + "occupancy_status", + "property_state", + "product_type" + ]: + acquisition[column] = acquisition[column].astype('category').cat.codes + + for start in ["first_payment", "origination"]: + column = "{}_date".format(start) + acquisition["{}_year".format(start)] = pd.to_numeric(acquisition[column].str.split('/').str.get(1)) + acquisition["{}_month".format(start)] = pd.to_numeric(acquisition[column].str.split('/').str.get(0)) + del acquisition[column] + + acquisition = acquisition.fillna(-1) + acquisition = acquisition[acquisition["performance_count"] > settings.MINIMUM_TRACKING_QUARTERS] + return acquisition +``` + +### Pulling everything together + +We’re almost ready to pull everything together, we just need to add a bit more code to annotate.py. In the below code, we: + +- Define a function to read in the acquisition data. +- Define a function to write the processed data to processed/train.csv +- If this file is called from the command line, like python annotate.py: + - Read in the acquisition data. + - Compute the counts for the performance data, and assign them to counts. + - Annotate the acquisition DataFrame. + - Write the acquisition DataFrame to train.csv. + +``` +def read(): + acquisition = pd.read_csv(os.path.join(settings.PROCESSED_DIR, "Acquisition.txt"), sep="|") + return acquisition + +def write(acquisition): + acquisition.to_csv(os.path.join(settings.PROCESSED_DIR, "train.csv"), index=False) + +if __name__ == "__main__": + acquisition = read() + counts = count_performance_rows() + acquisition = annotate(acquisition, counts) + write(acquisition) +``` + +Once you’re done updating the file, make sure to run it with python annotate.py, to generate the train.csv file. You can find the complete annotate.py file [here][34]. + +The folder should now look like this: + +``` +loan-prediction +├── data +│ ├── Acquisition_2012Q1.txt +│ ├── Acquisition_2012Q2.txt +│ ├── Performance_2012Q1.txt +│ ├── Performance_2012Q2.txt +│ └── ... +├── processed +│ ├── Acquisition.txt +│ ├── Performance.txt +│ ├── train.csv +├── .gitignore +├── annotate.py +├── assemble.py +├── README.md +├── requirements.txt +├── settings.py +``` + +### Finding an error metric + +We’re done with generating our training dataset, and now we’ll just need to do the final step, generating predictions. We’ll need to figure out an error metric, as well as how we want to evaluate our data. In this case, there are many more loans that aren’t foreclosed on than are, so typical accuracy measures don’t make much sense. + +If we read in the training data, and check the counts in the foreclosure_status column, here’s what we get: + +``` +import pandas as pd +import settings + +train = pd.read_csv(os.path.join(settings.PROCESSED_DIR, "train.csv")) +train["foreclosure_status"].value_counts() +``` + +``` +False 4635982 +True 1585 +Name: foreclosure_status, dtype: int64 +``` + +Since so few of the loans were foreclosed on, just checking the percentage of labels that were correctly predicted will mean that we can make a machine learning model that predicts False for every row, and still gets a very high accuracy. Instead, we’ll want to use a metric that takes the class imbalance into account, and ensures that we predict foreclosures accurately. We don’t want too many false positives, where we make predict that a loan will be foreclosed on even though it won’t, or too many false negatives, where we predict that a loan won’t be foreclosed on, but it is. Of these two, false negatives are more costly for Fannie Mae, because they’re buying loans where they may not be able to recoup their investment. + +We’ll define false negative rate as the number of loans where the model predicts no foreclosure but the the loan was actually foreclosed on, divided by the number of total loans that were actually foreclosed on. This is the percentage of actual foreclosures that the model “Missed”. Here’s a diagram: + +![](https://github.com/LCTT/wiki-images/blob/master/TranslateProject/ref_img/004.png) + +In the diagram above, 1 loan was predicted as not being foreclosed on, but it actually was. If we divide this by the number of loans that were actually foreclosed on, 2, we get the false negative rate, 50%. We’ll use this as our error metric, so we can evaluate our model’s performance. + +### Setting up the classifier for machine learning + +We’ll use cross validation to make predictions. With cross validation, we’ll divide our data into 3 groups. Then we’ll do the following: + +- Train a model on groups 1 and 2, and use the model to make predictions for group 3. +- Train a model on groups 1 and 3, and use the model to make predictions for group 2. +- Train a model on groups 2 and 3, and use the model to make predictions for group 1. + +Splitting it up into groups this way means that we never train a model using the same data we’re making predictions for. This avoids overfitting. If we overfit, we’ll get a falsely low false negative rate, which makes it hard to improve our algorithm or use it in the real world. + +[Scikit-learn][35] has a function called [cross_val_predict][36] which will make it easy to perform cross validation. + +We’ll also need to pick an algorithm to use to make predictions. We need a classifier that can do [binary classification][37]. The target variable, foreclosure_status only has two values, True and False. + +We’ll use [logistic regression][38], because it works well for binary classification, runs extremely quickly, and uses little memory. This is due to how the algorithm works – instead of constructing dozens of trees, like a random forest, or doing expensive transformations, like a support vector machine, logistic regression has far fewer steps involving fewer matrix operations. + +We can use the [logistic regression classifier][39] algorithm that’s implemented in scikit-learn. The only thing we need to pay attention to is the weights of each class. If we weight the classes equally, the algorithm will predict False for every row, because it is trying to minimize errors. However, we care much more about foreclosures than we do about loans that aren’t foreclosed on. Thus, we’ll pass balanced to the class_weight keyword argument of the [LogisticRegression][40] class, to get the algorithm to weight the foreclosures more to account for the difference in the counts of each class. This will ensure that the algorithm doesn’t predict False for every row, and instead is penalized equally for making errors in predicting either class. + +### Making predictions + +Now that we have the preliminaries out of the way, we’re ready to make predictions. We’ll create a new file called predict.py that will use the train.csv file we created in the last step. The below code will: + +- Import needed libraries. +- Create a function called cross_validate that: + - Creates a logistic regression classifier with the right keyword arguments. + - Creates a list of columns that we want to use to train the model, removing id and foreclosure_status. + - Run cross validation across the train DataFrame. + - Return the predictions. + + +``` +import os +import settings +import pandas as pd +from sklearn import cross_validation +from sklearn.linear_model import LogisticRegression +from sklearn import metrics + +def cross_validate(train): + clf = LogisticRegression(random_state=1, class_weight="balanced") + + predictors = train.columns.tolist() + predictors = [p for p in predictors if p not in settings.NON_PREDICTORS] + + predictions = cross_validation.cross_val_predict(clf, train[predictors], train[settings.TARGET], cv=settings.CV_FOLDS) + return predictions +``` + +### Predicting error + +Now, we just need to write a few functions to compute error. The below code will: + +- Create a function called compute_error that: + - Uses scikit-learn to compute a simple accuracy score (the percentage of predictions that matched the actual foreclosure_status values). +- Create a function called compute_false_negatives that: + - Combines the target and the predictions into a DataFrame for convenience. + - Finds the false negative rate. +- Create a function called compute_false_positives that: + - Combines the target and the predictions into a DataFrame for convenience. + - Finds the false positive rate. + - Finds the number of loans that weren’t foreclosed on that the model predicted would be foreclosed on. + - Divide by the total number of loans that weren’t foreclosed on. + +``` +def compute_error(target, predictions): + return metrics.accuracy_score(target, predictions) + +def compute_false_negatives(target, predictions): + df = pd.DataFrame({"target": target, "predictions": predictions}) + return df[(df["target"] == 1) & (df["predictions"] == 0)].shape[0] / (df[(df["target"] == 1)].shape[0] + 1) + +def compute_false_positives(target, predictions): + df = pd.DataFrame({"target": target, "predictions": predictions}) + return df[(df["target"] == 0) & (df["predictions"] == 1)].shape[0] / (df[(df["target"] == 0)].shape[0] + 1) +``` + +### Putting it all together + +Now, we just have to put the functions together in predict.py. The below code will: + +- Read in the dataset. +- Compute cross validated predictions. +- Compute the 3 error metrics above. +- Print the error metrics. + +``` +def read(): + train = pd.read_csv(os.path.join(settings.PROCESSED_DIR, "train.csv")) + return train + +if __name__ == "__main__": + train = read() + predictions = cross_validate(train) + error = compute_error(train[settings.TARGET], predictions) + fn = compute_false_negatives(train[settings.TARGET], predictions) + fp = compute_false_positives(train[settings.TARGET], predictions) + print("Accuracy Score: {}".format(error)) + print("False Negatives: {}".format(fn)) + print("False Positives: {}".format(fp)) +``` + +Once you’ve added the code, you can run python predict.py to generate predictions. Running everything shows that our false negative rate is .26, which means that of the foreclosed loans, we missed predicting 26% of them. This is a good start, but can use a lot of improvement! + +You can find the complete predict.py file [here][41]. + +Your file tree should now look like this: + +``` +loan-prediction +├── data +│ ├── Acquisition_2012Q1.txt +│ ├── Acquisition_2012Q2.txt +│ ├── Performance_2012Q1.txt +│ ├── Performance_2012Q2.txt +│ └── ... +├── processed +│ ├── Acquisition.txt +│ ├── Performance.txt +│ ├── train.csv +├── .gitignore +├── annotate.py +├── assemble.py +├── predict.py +├── README.md +├── requirements.txt +├── settings.py +``` + +### Writing up a README + +Now that we’ve finished our end to end project, we just have to write up a README.md file so that other people know what we did, and how to replicate it. A typical README.md for a project should include these sections: + +- A high level overview of the project, and what the goals are. +- Where to download any needed data or materials. +- Installation instructions. + - How to install the requirements. +- Usage instructions. + - How to run the project. + - What you should see after each step. +- How to contribute to the project. + - Good next steps for extending the project. + +[Here’s][42] a sample README.md for this project. + +### Next steps + +Congratulations, you’re done making an end to end machine learning project! You can find a complete example project [here][43]. It’s a good idea to upload your project to [Github][44] once you’ve finished it, so others can see it as part of your portfolio. + +There are still quite a few angles left to explore with this data. Broadly, we can split them up into 3 categories – extending this project and making it more accurate, finding other columns to predict, and exploring the data. Here are some ideas: + +- Generate more features in annotate.py. +- Switch algorithms in predict.py. +- Try using more data from Fannie Mae than we used in this post. +- Add in a way to make predictions on future data. The code we wrote will still work if we add more data, so we can add more past or future data. +- Try seeing if you can predict if a bank should have issued the loan originally (vs if Fannie Mae should have acquired the loan). + - Remove any columns from train that the bank wouldn’t have known at the time of issuing the loan. + - Some columns are known when Fannie Mae bought the loan, but not before. + - Make predictions. +- Explore seeing if you can predict columns other than foreclosure_status. + - Can you predict how much the property will be worth at sale time? +- Explore the nuances between performance updates. + - Can you predict how many times the borrower will be late on payments? + - Can you map out the typical loan lifecycle? +- Map out data on a state by state or zip code by zip code level. + - Do you see any interesting patterns? + +If you build anything interesting, please let us know in the comments! + +If you liked this, you might like to read the other posts in our ‘Build a Data Science Porfolio’ series: + +- [Storytelling with data][45]. +- [How to setup up a data science blog][46]. + + +-------------------------------------------------------------------------------- + +via: https://www.dataquest.io/blog/data-science-portfolio-machine-learning/ + +作者:[Vik Paruchuri][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对ID](https://github.com/校对ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.dataquest.io/blog +[1]: https://www.dataquest.io/blog/data-science-portfolio-machine-learning/#email-signup +[2]: https://github.com/dataquestio/loan-prediction +[3]: https://www.dataquest.io/blog/data-science-portfolio-project/ +[4]: https://atom.io/ +[5]: https://www.jetbrains.com/pycharm/ +[6]: https://github.com/ +[7]: http://pandas.pydata.org/ +[8]: http://scikit-learn.org/ +[9]: http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.html +[10]: https://collegescorecard.ed.gov/data/ +[11]: https://reddit.com/r/datasets +[12]: https://cloud.google.com/bigquery/public-data/#usa-names +[13]: https://github.com/caesar0301/awesome-public-datasets +[14]: http://www.fanniemae.com/portal/funding-the-market/data/loan-performance-data.html +[15]: http://www.fanniemae.com/portal/funding-the-market/data/loan-performance-data.html +[16]: https://loanperformancedata.fanniemae.com/lppub-docs/lppub_glossary.pdf +[17]: https://loanperformancedata.fanniemae.com/lppub-docs/lppub_faq.pdf +[18]: https://loanperformancedata.fanniemae.com/lppub-docs/lppub_file_layout.pdf +[19]: https://loanperformancedata.fanniemae.com/lppub-docs/acquisition-sample-file.txt +[20]: https://loanperformancedata.fanniemae.com/lppub-docs/performance-sample-file.txt +[21]: https://github.com/dataquestio/loan-prediction/blob/master/.gitignore +[22]: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet +[23]: https://github.com/dataquestio/loan-prediction +[24]: https://github.com/dataquestio/loan-prediction/blob/master/requirements.txt +[25]: https://www.continuum.io/downloads +[26]: https://loanperformancedata.fanniemae.com/lppub/index.html +[27]: https://loanperformancedata.fanniemae.com/lppub-docs/lppub_file_layout.pdf +[28]: https://github.com/dataquestio/loan-prediction/blob/master/settings.py +[29]: https://loanperformancedata.fanniemae.com/lppub-docs/lppub_file_layout.pdf +[30]: http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.html +[31]: http://pandas.pydata.org/pandas-docs/stable/generated/pandas.read_csv.html +[32]: https://github.com/dataquestio/loan-prediction/blob/master/assemble.py +[33]: https://docs.python.org/3/library/stdtypes.html#dict.get +[34]: https://github.com/dataquestio/loan-prediction/blob/master/annotate.py +[35]: http://scikit-learn.org/ +[36]: http://scikit-learn.org/stable/modules/generated/sklearn.cross_validation.cross_val_predict.html +[37]: https://en.wikipedia.org/wiki/Binary_classification +[38]: https://en.wikipedia.org/wiki/Logistic_regression +[39]: http://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html +[40]: http://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html +[41]: https://github.com/dataquestio/loan-prediction/blob/master/predict.py +[42]: https://github.com/dataquestio/loan-prediction/blob/master/README.md +[43]: https://github.com/dataquestio/loan-prediction +[44]: https://www.github.com/ +[45]: https://www.dataquest.io/blog/data-science-portfolio-project/ +[46]: https://www.dataquest.io/blog/how-to-setup-a-data-science-blog/ From 6d8fcc7fc1ff9f72e367c960e1b4e2105bf00fb2 Mon Sep 17 00:00:00 2001 From: cposture Date: Sun, 31 Jul 2016 13:18:35 +0800 Subject: [PATCH 1311/1469] Translating 50% --- ...18 An Introduction to Mocking in Python.md | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/sources/tech/20160618 An Introduction to Mocking in Python.md b/sources/tech/20160618 An Introduction to Mocking in Python.md index 64c26b8ec5..d28fae272d 100644 --- a/sources/tech/20160618 An Introduction to Mocking in Python.md +++ b/sources/tech/20160618 An Introduction to Mocking in Python.md @@ -99,26 +99,26 @@ class RmTestCase(unittest.TestCase): ### 潜在陷阱 -第一件需要注意的事情就是,我们使用了位于 mymodule.os 且用于模拟对象的 mock.patch 方法装饰器,并且将该 mock 注入到我们的测试用例方法。相比在 mymodule.os 引用它,那么只是模拟 os 本身,会不会更有意义? +第一件需要注意的事情就是,我们使用了位于 mymodule.os 且用于模拟对象的 mock.patch 方法装饰器,并且将该 mock 注入到我们的测试用例方法。相比在 mymodule.os 引用它,那么只是模拟 os 本身,会不会更有意义呢? One of the first things that should stick out is that we’re using the mock.patch method decorator to mock an object located at mymodule.os, and injecting that mock into our test case method. Wouldn’t it make more sense to just mock os itself, rather than the reference to it at mymodule.os? 当然,当涉及到导入和管理模块,Python 的用法非常灵活。在运行时,mymodule 模块拥有被导入到本模块局部作用域的 os。因此,如果我们模拟 os,我们是看不到模拟在 mymodule 模块中的作用的。 -Well, Python is somewhat of a sneaky snake when it comes to imports and managing modules. At runtime, the mymodule module has its own os which is imported into its own local scope in the module. Thus, if we mock os, we won’t see the effects of the mock in the mymodule module. 这句话需要深刻地记住: -The mantra to keep repeating is this: > 模拟测试一个项目,只需要了解它用在哪里,而不是它从哪里来。 > Mock an item where it is used, not where it came from. - +如果你需要为 myproject.app.MyElaborateClass 模拟 tempfile 模块,你可能需要 If you need to mock the tempfile module for myproject.app.MyElaborateClass, you probably need to apply the mock to myproject.app.tempfile, as each module keeps its own imports. +先将那个陷阱置身事外,让我们继续模拟。 With that pitfall out of the way, let’s keep mocking. -### Adding Validation to ‘rm’ +### 向 ‘rm’ 中加入验证 + +之前定义的 rm 方法相当的简单。在盲目地删除之前,我们倾向于拿它来验证一个路径是否存在,并验证其是否是一个文件。让我们重构 rm 使其变得更加智能: -The rm method defined earlier is quite oversimplified. We’d like to have it validate that a path exists and is a file before just blindly attempting to remove it. Let’s refactor rm to be a bit smarter: ``` #!/usr/bin/env python @@ -132,7 +132,7 @@ def rm(filename): os.remove(filename) ``` -Great. Now, let’s adjust our test case to keep coverage up. +很好。现在,让我们调整测试用例来保持测试的覆盖程度。 ``` #!/usr/bin/env python @@ -164,13 +164,13 @@ class RmTestCase(unittest.TestCase): mock_os.remove.assert_called_with("any path") ``` -Our testing paradigm has completely changed. We now can verify and validate internal functionality of methods without any side-effects. +我们的测试用例完全改变了。现在我们可以在没有任何副作用下核实并验证方法的内部功能。 -### File-Removal as a Service +### 将文件删除作为服务 -So far, we’ve only been working with supplying mocks for functions, but not for methods on objects or cases where mocking is necessary for sending parameters. Let’s cover object methods first. +到目前为止,我们只是对函数功能提供模拟测试,并没对需要传递参数的对象和实例的方法进行模拟测试。接下来我们将介绍如何对对象的方法进行模拟测试。 -We’ll begin with a refactor of the rm method into a service class. There really isn’t a justifiable need, per se, to encapsulate such a simple function into an object, but it will at the very least help us demonstrate key concepts in mock. Let’s refactor: +首先,我们将rm方法重构成一个服务类。实际上将这样一个简单的函数转换成一个对象,在本质上,这不是一个合理的需求,但它能够帮助我们了解mock的关键概念。让我们开始重构: ``` #!/usr/bin/env python @@ -187,6 +187,7 @@ class RemovalService(object): os.remove(filename) ``` +### 你会注意到我们的测试用例没有太大的变化 ### You’ll notice that not much has changed in our test case: ``` @@ -222,6 +223,7 @@ class RemovalServiceTestCase(unittest.TestCase): mock_os.remove.assert_called_with("any path") ``` +很好,我们知道 RemovalService 会如期工作。接下来让我们创建另一个服务,将其声明为一个依赖 Great, so we now know that the RemovalService works as planned. Let’s create another service which declares it as a dependency: ``` From c716df7f93993b1e043e0e53a2bc68dcae5cc4b0 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 31 Jul 2016 15:23:05 +0800 Subject: [PATCH 1312/1469] PUB:20160104 What is good stock portfolio management software on Linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @ivo-wang 翻译中要采用中文的语句习惯。 --- ... portfolio management software on Linux.md | 111 ++++++++++++++++++ ... portfolio management software on Linux.md | 109 ----------------- 2 files changed, 111 insertions(+), 109 deletions(-) create mode 100644 published/20160104 What is good stock portfolio management software on Linux.md delete mode 100644 translated/tech/20160104 What is good stock portfolio management software on Linux.md diff --git a/published/20160104 What is good stock portfolio management software on Linux.md b/published/20160104 What is good stock portfolio management software on Linux.md new file mode 100644 index 0000000000..15c5091b6a --- /dev/null +++ b/published/20160104 What is good stock portfolio management software on Linux.md @@ -0,0 +1,111 @@ +JStock:Linux 上不错的股票投资组合管理软件 +================================================================================ + +如果你在股票市场做投资,那么你可能非常清楚投资组合管理计划有多重要。管理投资组合的目标是依据你能承受的风险,时间层面的长短和资金盈利的目标去为你量身打造的一种投资计划。鉴于这类软件的重要性,因此从来不会缺乏商业性的 app 和股票行情检测软件,每一个都可以兜售复杂的投资组合以及跟踪报告功能。 + +对于我们这些 Linux 爱好者们,我也找到了一些**好用的开源投资组合管理工具**,用来在 Linux 上管理和跟踪股票的投资组合,这里高度推荐一个基于 java 编写的管理软件 [JStock][1]。如果你不是一个 java 粉,也许你会放弃它,JStock 需要运行在沉重的 JVM 环境上。但同时,在每一个安装了 JRE 的环境中它都可以马上运行起来,在你的 Linux 环境中它会运行的很顺畅。 + +“开源”就意味着免费或标准低下的时代已经过去了。鉴于 JStock 只是一个个人完成的产物,作为一个投资组合管理软件它最令人印象深刻的是包含了非常多实用的功能,以上所有的荣誉属于它的作者 Yan Cheng Cheok!例如,JStock 支持通过监视列表去监控价格,多种投资组合,自选/内置的股票指标与相关监测,支持27个不同的股票市场和跨平台的云端备份/还原。JStock 支持多平台部署(Linux, OS X, Android 和 Windows),你可以通过云端保存你的 JStock 投资组合,并通过云平台无缝的备份/还原到其他的不同平台上面。 + +现在我将向你展示如何安装以及使用过程的一些具体细节。 + +### 在 Linux 上安装 JStock ### + +因为 JStock 使用Java编写,所以必须[安装 JRE][2]才能让它运行起来。小提示,JStock 需要 JRE1.7 或更高版本。如你的 JRE 版本不能满足这个需求,JStock 将会运行失败然后出现下面的报错。 + + Exception in thread "main" java.lang.UnsupportedClassVersionError: org/yccheok/jstock/gui/JStock : Unsupported major.minor version 51.0 + + +在你的 Linux 上安装好了 JRE 之后,从其官网下载最新的发布的 JStock,然后加载启动它。 + + $ wget https://github.com/yccheok/jstock/releases/download/release_1-0-7-13/jstock-1.0.7.13-bin.zip + $ unzip jstock-1.0.7.13-bin.zip + $ cd jstock + $ chmod +x jstock.sh + $ ./jstock.sh + +教程的其他部分,让我来给大家展示一些 JStock 的实用功能 + +### 监视监控列表中股票价格的波动 ### + +使用 JStock 你可以创建一个或多个监视列表,它可以自动的监视股票价格的波动并给你提供相应的通知。在每一个监视列表里面你可以添加多个感兴趣的股票进去。之后在“Fall Below”和“Rise Above”的表格里添加你的警戒值,分别设定该股票的最低价格和最高价格。 + +![](https://c2.staticflickr.com/2/1588/23795349969_37f4b0f23c_c.jpg) + +例如你设置了 AAPL 股票的最低/最高价格分别是 $102 和 $115.50,只要在价格低于 $102 或高于 $115.50 时你就得到桌面通知。 + +你也可以设置邮件通知,这样你将收到一些价格信息的邮件通知。设置邮件通知在“Options”菜单里,在“Alert”标签中国,打开“Send message to email(s)”,填入你的 Gmail 账户。一旦完成 Gmail 认证步骤,JStock 就会开始发送邮件通知到你的 Gmail 账户(也可以设置其他的第三方邮件地址)。 + +![](https://c2.staticflickr.com/2/1644/24080560491_3aef056e8d_b.jpg) + +### 管理多个投资组合 ### + +JStock 允许你管理多个投资组合。这个功能对于你使用多个股票经纪人时是非常实用的。你可以为每个经纪人创建一个投资组合去管理你的“买入/卖出/红利”用来了解每一个经纪人的业务情况。你也可以在“Portfolio”菜单里面选择特定的投资组合来切换不同的组合项目。下面是一张截图用来展示一个假设的投资组合。 + +![](https://c2.staticflickr.com/2/1646/23536385433_df6c036c9a_c.jpg) + +你也可以设置付给中介费,你可以为每个买卖交易设置中介费、印花税以及结算费。如果你比较懒,你也可以在选项菜单里面启用自动费用计算,并提前为每一家经济事务所设置费用方案。当你为你的投资组合增加交易之后,JStock 将自动的计算并计入费用。 + +![](https://c2.staticflickr.com/2/1653/24055085262_0e315c3691_b.jpg) + +### 使用内置/自选股票指标来监控 ### + +如果你要做一些股票的技术分析,你可能需要基于各种不同的标准来监控股票(这里叫做“股票指标”)。对于股票的跟踪,JStock提供多个[预设的技术指示器][3] 去获得股票上涨/下跌/逆转指数的趋势。下面的列表里面是一些可用的指标。 + +- 平滑异同移动平均线(MACD) +- 相对强弱指标 (RSI) +- 资金流向指标 (MFI) +- 顺势指标 (CCI) +- 十字线 +- 黄金交叉线,死亡交叉线 +- 涨幅/跌幅 + +开启预设指示器能需要在 JStock 中点击“Stock Indicator Editor”标签。之后点击右侧面板中的安装按钮。选择“Install from JStock server”选项,之后安装你想要的指示器。 + +![](https://c2.staticflickr.com/2/1476/23867534660_b6a9c95a06_c.jpg) + +一旦安装了一个或多个指示器,你可以用他们来扫描股票。选择“Stock Indicator Scanner”标签,点击底部的“Scan”按钮,选择需要的指示器。 + +![](https://c2.staticflickr.com/2/1653/24137054996_e8fcd10393_c.jpg) + +当你选择完需要扫描的股票(例如, NYSE, NASDAQ)以后,JStock 将执行该扫描,并将该指示器捕获的结果通过列表展现。 + +![](https://c2.staticflickr.com/2/1446/23795349889_0f1aeef608_c.jpg) + +除了预设指示器以外,你也可以使用一个图形化的工具来定义自己的指示器。下面这张图例用于监控当前价格小于或等于60天平均价格的股票。 + +![](https://c2.staticflickr.com/2/1605/24080560431_3d26eac6b5_c.jpg) + +### 通过云在 Linux 和 Android JStock 之间备份/恢复### + +另一个非常棒的功能是 JStock 支持云备份恢复。Jstock 可以通过 Google Drive 把你的投资组合/监视列表在云上备份和恢复,这个功能可以实现在不同平台上无缝穿梭。如果你在两个不同的平台之间来回切换使用 Jstock,这种跨平台备份和还原非常有用。我在 Linux 桌面和 Android 手机上测试过我的 Jstock 投资组合,工作的非常漂亮。我在 Android 上将 Jstock 投资组合信息保存到 Google Drive 上,然后我可以在我的 Linux 版的 Jstock 上恢复它。如果能够自动同步到云上,而不用我手动地触发云备份/恢复就更好了,十分期望这个功能出现。 + +![](https://c2.staticflickr.com/2/1537/24163165565_bb47e04d6c_c.jpg) + +![](https://c2.staticflickr.com/2/1556/23536385333_9ed1a75d72_c.jpg) + +如果你在从 Google Drive 还原之后不能看到你的投资信息以及监视列表,请确认你的国家信息与“Country”菜单里面设置的保持一致。 + +JStock 的安卓免费版可以从 [Google Play Store][4] 获取到。如果你需要完整的功能(比如云备份,通知,图表等),你需要一次性支付费用升级到高级版。我认为高级版物有所值。 + +![](https://c2.staticflickr.com/2/1687/23867534720_18b917028c_c.jpg) + +写在最后,我应该说一下它的作者,Yan Cheng Cheok,他是一个十分活跃的开发者,有bug及时反馈给他。这一切都要感谢他!!! + +关于 JStock 这个投资组合跟踪软件你有什么想法呢? + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/stock-portfolio-management-software-Linux.html + +作者:[Dan Nanni][a] +译者:[ivo-wang](https://github.com/ivo-wang) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://Linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/nanni +[1]:http://jstock.org/ +[2]:http://ask.xmodulo.com/install-java-runtime-Linux.html +[3]:http://jstock.org/ma_indicator.html +[4]:https://play.google.com/store/apps/details?id=org.yccheok.jstock.gui diff --git a/translated/tech/20160104 What is good stock portfolio management software on Linux.md b/translated/tech/20160104 What is good stock portfolio management software on Linux.md deleted file mode 100644 index 7e0c8a05fd..0000000000 --- a/translated/tech/20160104 What is good stock portfolio management software on Linux.md +++ /dev/null @@ -1,109 +0,0 @@ -Translating by ivo-wang -What is good stock portfolio management software on Linux -linux上那些不错的管理股票组合投资软件 -================================================================================ -如果你在股票市场做投资,那么你可能非常清楚管理组合投资的计划有多重要。管理组合投资的目标是依据你能承受的风险,时间层面的长短和资金盈利的目标去为你量身打造的一种投资计划。鉴于这类软件的重要性,难怪从不缺乏商业性质的app和股票行情检测软件,每一个都可以兜售复杂的组合投资以及跟踪报告功能。 - -对于这些linux爱好者们,我们找到了一些 **好用的开源组合投资管理工具** 用来在linux上管理和跟踪股票的组合投资,这里高度推荐一个基于java编写的管理软件[JStock][1]。如果你不是一个java粉,你不得不面对这样一个事实JStock需要运行在重型的JVM环境上。同时我相信许多人非常欣赏JStock,安装JRE以后它可以非常迅速的安装在各个linux平台上。没有障碍能阻止你将它安装在你的linux环境中。 - -开源就意味着免费或标准低下的时代已经过去了。鉴于JStock只是一个个人完成的产物,作为一个组合投资管理软件它最令人印象深刻的是包含了非常多实用的功能,以上所有的荣誉属于它的作者Yan Cheng Cheok!例如,JStock 支持通过监视列表去监控价格,多种组合投资,按习惯/按固定 做股票指示与相关扫描,支持27个不同的股票市场和交易平台云端备份/还原。JStock支持多平台部署(Linux, OS X, Android 和 Windows),你可以通过云端保存你的JStock记录,它可以无缝的备份还原到其他的不同平台上面。 - -现在我将向你展示如何安装以及使用过程的一些具体细节。 - -### 在Linux上安装JStock ### - -因为JStock使用Java编写,所以必须[安装 JRE][2]才能让它运行起来.小提示JStock 需要JRE1.7或更高版本。如你的JRE版本不能满足这个需求,JStock将会安装失败然后出现下面的报错。 - - Exception in thread "main" java.lang.UnsupportedClassVersionError: org/yccheok/jstock/gui/JStock : Unsupported major.minor version 51.0 - - -一旦你安装了JRE在你的linux上,从官网下载最新的发布的JStock,然后加载启动它。 - - $ wget https://github.com/yccheok/jstock/releases/download/release_1-0-7-13/jstock-1.0.7.13-bin.zip - $ unzip jstock-1.0.7.13-bin.zip - $ cd jstock - $ chmod +x jstock.sh - $ ./jstock.sh - -教程的其他部分,让我来给大家展示一些JStock的实用功能 - -### 监视监控列表股票价格的波动 ### - -使用JStock你可以创建一个或多个监视列表,它可以自动的监视股票价格的波动并给你提供相应的通知。在每一个监视列表里面你可以添加多个感兴趣的股票进去。之后添加你的警戒值在"Fall Below"和"Rise Above"的表格里,分别是在设定最低价格和最高价格。 - -![](https://c2.staticflickr.com/2/1588/23795349969_37f4b0f23c_c.jpg) - -例如你设置了AAPL股票的最低/最高价格分别是$102 和 $115.50,你将在价格低于$102或高于$115.50的任意时间在桌面得到通知。 - -你也可以设置邮件通知,之后你将收到一些价格信息的邮件通知。设置邮件通知在栏的"Options"选项。在"Alert"标签,打开"Send message to email(s)",填入你的Gmail账户。一旦完成Gmail认证步骤,JStock将开始发送邮件通知到你的Gmail账户(也可以设置其他的第三方邮件地址) -![](https://c2.staticflickr.com/2/1644/24080560491_3aef056e8d_b.jpg) - -### 管理多个组合投资 ### - -JStock能够允许你管理多个组合投资。这个功能对于股票经纪人是非常实用的。你可以为经纪人创建一个投资项去管理你的 买入/卖出/红利 用来了解每一个经纪人的业务情况。你也可以切换不同的组合项目通过选择一个特殊项目在"Portfolio"菜单里面。下面是一张截图用来展示一个意向投资 -![](https://c2.staticflickr.com/2/1646/23536385433_df6c036c9a_c.jpg) - -因为能够设置付给经纪人小费的选项,所以你能付给经纪人任意的小费,印花税以及清空每一比交易的小费。如果你非常懒,你也可以在菜单里面设置自动计算小费和给每一个经纪人固定的小费。在完成交易之后JStock将自动的计算并发送小费。 - -![](https://c2.staticflickr.com/2/1653/24055085262_0e315c3691_b.jpg) - -### 显示固定/自选股票提示 ### - -如果你要做一些股票的技术分析,你可能需要不同股票的指数(这里叫做“平均股指”),对于股票的跟踪,JStock提供多个[预设技术指示器][3] 去获得股票上涨/下跌/逆转指数的趋势。下面的列表里面是一些可用的指示。 -- 异同平均线(MACD) -- 相对强弱指数 (RSI) -- 货币流通指数 (MFI) -- 顺势指标 (CCI) -- 十字线 -- 黄金交叉线, 死亡交叉线 -- 涨幅/跌幅 - -开启预设指示器能需要在JStock中点击"Stock Indicator Editor"标签。之后点击右侧面板中的安装按钮。选择"Install from JStock server"选项,之后安装你想要的指示器。 - -![](https://c2.staticflickr.com/2/1476/23867534660_b6a9c95a06_c.jpg) - -一旦安装了一个或多个指示器,你可以用他们来扫描股票。选择"Stock Indicator Scanner"标签,点击底部的"Scan"按钮,选择需要的指示器。 - -![](https://c2.staticflickr.com/2/1653/24137054996_e8fcd10393_c.jpg) - -当你选择完需要扫描的股票(例如e.g., NYSE, NASDAQ)以后,JStock将执行扫描,并将捕获的结果通过列表的形式展现在指示器上面。 - -![](https://c2.staticflickr.com/2/1446/23795349889_0f1aeef608_c.jpg) - -除了预设指示器以外,你也可以使用一个图形化的工具来定义自己的指示器。下面这张图例中展示的是当前价格小于或等于60天平均价格 - -![](https://c2.staticflickr.com/2/1605/24080560431_3d26eac6b5_c.jpg) - -### 云备份还原Linux 和 Android JStock ### - -另一个非常棒的功能是JStock可以支持云备份还原。Jstock也可以把你的组合投资/监视列表备份还原在 Google Drive,这个功能可以实现在不同平台(例如Linux和Android)上无缝穿梭。举个例子,如果你把Android Jstock组合投资的信息保存在Google Drive上,你可以在Linux班级本上还原他们。 - -![](https://c2.staticflickr.com/2/1537/24163165565_bb47e04d6c_c.jpg) - -![](https://c2.staticflickr.com/2/1556/23536385333_9ed1a75d72_c.jpg) - -如果你在从Google Drive还原之后不能看到你的投资信息以及监视列表,请确认你的国家信息与“Country”菜单里面设置的保持一致。 - -JStock的安卓免费版可以从[Google Play Store][4]获取到。如果你需要完整的功能(比如云备份,通知,图表等),你需要一次性支付费用升级到高级版。我想高级版肯定有它的价值所在。 - -![](https://c2.staticflickr.com/2/1687/23867534720_18b917028c_c.jpg) - -写在最后,我应该说一下它的作者,Yan Cheng Cheok,他是一个十分活跃的开发者,有bug及时反馈给他。最后多有的荣耀都属于他一个人!!! - -关于JStock这个组合投资跟踪软件你有什么想法呢? - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/stock-portfolio-management-software-linux.html - -作者:[Dan Nanni][a] -译者:[ivo-wang](https://github.com/ivo-wang) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://xmodulo.com/author/nanni -[1]:http://jstock.org/ -[2]:http://ask.xmodulo.com/install-java-runtime-linux.html -[3]:http://jstock.org/ma_indicator.html -[4]:https://play.google.com/store/apps/details?id=org.yccheok.jstock.gui From 60ba5b6d27f61fdea3cabf8a1669f707ca9f92f5 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 31 Jul 2016 18:06:20 +0800 Subject: [PATCH 1313/1469] PUB:20160721 YOU CAN TRY A DEMO UBUNTU VERSION IN A WEB BROWSER @kokialoves --- ... A DEMO UBUNTU VERSION IN A WEB BROWSER.md | 36 ++++++++++++++++++ ... A DEMO UBUNTU VERSION IN A WEB BROWSER.md | 37 ------------------- 2 files changed, 36 insertions(+), 37 deletions(-) create mode 100644 published/20160721 YOU CAN TRY A DEMO UBUNTU VERSION IN A WEB BROWSER.md delete mode 100644 translated/tech/20160721 YOU CAN TRY A DEMO UBUNTU VERSION IN A WEB BROWSER.md diff --git a/published/20160721 YOU CAN TRY A DEMO UBUNTU VERSION IN A WEB BROWSER.md b/published/20160721 YOU CAN TRY A DEMO UBUNTU VERSION IN A WEB BROWSER.md new file mode 100644 index 0000000000..0fd776c078 --- /dev/null +++ b/published/20160721 YOU CAN TRY A DEMO UBUNTU VERSION IN A WEB BROWSER.md @@ -0,0 +1,36 @@ +在浏览器中体验 Ubuntu +===================================================== + +[Ubuntu][2] 的背后的公司 [Canonical][1] 为 Linux 推广做了很多努力。无论你有多么不喜欢 Ubuntu,你必须承认它对 “Linux 易用性”的影响。Ubuntu 以及其衍生是使用最多的 Linux 版本。 + +为了进一步推广 Ubuntu Linux,Canonical 把它放到了浏览器里,你可以在任何地方使用这个 [Ubuntu 演示版][0]。 它将帮你更好的体验 Ubuntu,以便让新人更容易决定是否使用它。 + +你可能争辩说 USB 版的 Linux 更好。我同意,但是你要知道你要下载 ISO,创建 USB 启动盘,修改配置文件,然后才能使用这个 USB 启动盘来体验。这么乏味并不是每个人都乐意这么干的。 在线体验是一个更好的选择。 + +那么,你能在 Ubuntu 在线看到什么。实际上并不多。 + +你可以浏览文件,你可以使用 Unity Dash,浏览 Ubuntu 软件中心,甚至装几个应用(当然它们不会真的安装),看一看文件浏览器和其它一些东西。以上就是全部了。但是在我看来,这已经做的很好了,让你知道它是个什么,对这个流行的操作系统有个直接感受。 + +![](https://itsfoss.com/wp-content/uploads/2016/07/Ubuntu-online-demo.jpeg) + +![](https://itsfoss.com/wp-content/uploads/2016/07/Ubuntu-online-demo-1.jpeg) + +![](https://itsfoss.com/wp-content/uploads/2016/07/Ubuntu-online-demo-2.jpeg) + +如果你的朋友或者家人对试试 Linux 抱有兴趣,但是想在安装前想体验一下 Linux 。你可以给他们以下链接:[Ubuntu 在线导览][0] 。 + + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-online-demo/ + +作者:[Abhishek Prakash][a] +译者:[kokialoves](https://github.com/kokialoves) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[0]: http://tour.ubuntu.com/en/ +[1]: http://www.canonical.com/ +[2]: http://www.ubuntu.com/ diff --git a/translated/tech/20160721 YOU CAN TRY A DEMO UBUNTU VERSION IN A WEB BROWSER.md b/translated/tech/20160721 YOU CAN TRY A DEMO UBUNTU VERSION IN A WEB BROWSER.md deleted file mode 100644 index d79969e3e7..0000000000 --- a/translated/tech/20160721 YOU CAN TRY A DEMO UBUNTU VERSION IN A WEB BROWSER.md +++ /dev/null @@ -1,37 +0,0 @@ -你能在浏览器中运行UBUNTU -===================================================== - -Canonical, Ubuntu的母公司, 为Linux推广做了很多努力. 无论你有多么不喜欢 Ubuntu, 你必须承认它对 “Linux 易用性”的影响. Ubuntu 以及其衍生是应用最多的Linux版本 . - -为了进一步推广 Ubuntu Linux, Canonical 把它放到了浏览器里你可以再任何地方使用 [demo version of Ubuntu][1]. 它将帮你更好的体验 Ubuntu. 以便让新人更容易决定是否使用. - -你可能争辩说USB版的linux更好. 我同意但是你要知道你要下载ISO, 创建USB驱动, 修改配置文件. 并不是每个人都乐意这么干的. 在线体验是一个更好的选择. - -因此, 你能在Ubuntu在线看到什么. 实际上并不多. - -你可以浏览文件, 你可以使用 Unity Dash, 浏览 Ubuntu Software Center, 甚至装几个 apps (当然它们不会真的安装), 看一看文件浏览器 和其它一些东西. 以上就是全部了. 但是在我看来, 它是非常漂亮的 - -![](https://itsfoss.com/wp-content/uploads/2016/07/Ubuntu-online-demo.jpeg) - -![](https://itsfoss.com/wp-content/uploads/2016/07/Ubuntu-online-demo-1.jpeg) - -![](https://itsfoss.com/wp-content/uploads/2016/07/Ubuntu-online-demo-2.jpeg) - -如果你的朋友或者家人想试试Linux又不乐意安装, 你可以给他们以下链接: - -[Ubuntu Online Tour][0] - - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/ubuntu-online-demo/?utm_source=newsletter&utm_medium=email&utm_campaign=linux_and_open_source_stories_this_week - -作者:[Abhishek Prakash][a] -译者:[kokialoves](https://github.com/kokialoves) -校对:[校对ID](https://github.com/校对ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[0]: http://tour.ubuntu.com/en/ -[1]: http://tour.ubuntu.com/en/ From 1132d343cdc7f88dcfc3f8ac8a09a712fe2df86e Mon Sep 17 00:00:00 2001 From: Mike Date: Sun, 31 Jul 2016 18:17:42 +0800 Subject: [PATCH 1314/1469] What containers and unikernels can learn from Arduino and Raspberry Pi (#4251) * translated/tech/20160718 OPEN SOURCE ACCOUNTING SOFTWARE.md * translated/tech/20160718 OPEN SOURCE ACCOUNTING SOFTWARE.md * sources/talk/20160525 What containers and unikernels can learn from Arduino and Raspberry Pi.md --- ...rs and unikernels can learn from Arduino and Raspberry Pi.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/talk/20160525 What containers and unikernels can learn from Arduino and Raspberry Pi.md b/sources/talk/20160525 What containers and unikernels can learn from Arduino and Raspberry Pi.md index a1d6257d4d..ff81871630 100644 --- a/sources/talk/20160525 What containers and unikernels can learn from Arduino and Raspberry Pi.md +++ b/sources/talk/20160525 What containers and unikernels can learn from Arduino and Raspberry Pi.md @@ -1,3 +1,5 @@ +MikeCoder Translating... + What containers and unikernels can learn from Arduino and Raspberry Pi ========================================================================== From 601aec7515ab2e66e3e16b4c4945e76e3c12cc36 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 31 Jul 2016 18:40:17 +0800 Subject: [PATCH 1315/1469] PUB:20160718 OPEN SOURCE ACCOUNTING SOFTWARE @MikeCoder --- ...0160718 OPEN SOURCE ACCOUNTING SOFTWARE.md | 80 +++++++++++++++++++ ...0160718 OPEN SOURCE ACCOUNTING SOFTWARE.md | 71 ---------------- 2 files changed, 80 insertions(+), 71 deletions(-) create mode 100644 published/20160718 OPEN SOURCE ACCOUNTING SOFTWARE.md delete mode 100644 translated/tech/20160718 OPEN SOURCE ACCOUNTING SOFTWARE.md diff --git a/published/20160718 OPEN SOURCE ACCOUNTING SOFTWARE.md b/published/20160718 OPEN SOURCE ACCOUNTING SOFTWARE.md new file mode 100644 index 0000000000..7598de6bf1 --- /dev/null +++ b/published/20160718 OPEN SOURCE ACCOUNTING SOFTWARE.md @@ -0,0 +1,80 @@ +GNU KHATA:开源的会计管理软件 +============================================ + +作为一个活跃的 Linux 爱好者,我经常向我的朋友们介绍 Linux,帮助他们选择最适合他们的发行版本,同时也会帮助他们安装一些适用于他们工作的开源软件。 + +但是在这一次,我就变得很无奈。我的叔叔,他是一个自由职业的会计师。他会有一系列的为了会计工作的漂亮而成熟的付费软件。我不那么确定我能在在开源软件中找到这么一款可以替代的软件——直到昨天。 + +Abhishek 给我推荐了一些[很酷的软件][1],而其中 GNU Khata 脱颖而出。 + +[GNU Khata][2] 是一个会计工具。 或者,我应该说成是一系列的会计工具集合?它就像经济管理方面的 [Evernote][3] 一样。它的应用是如此之广,以至于它不但可以用于个人的财务管理,也可以用于大型公司的管理,从店铺存货管理到税率计算,都可以有效处理。 + +有个有趣的地方,Khata 这个词在印度或者是其他的印度语国家中意味着账户,所以这个会计软件叫做 GNU Khata。 + +### 安装 + +互联网上有很多关于旧的 Web 版本的 Khata 安装介绍。现在,GNU Khata 只能用在 Debian/Ubuntu 和它们的衍生版本中。我建议你按照 GNU Khata 官网给出的如下步骤来安装。我们来快速过一下。 + +- 从[这里][4]下载安装器。 +- 在下载目录打开终端。 +- 粘贴复制以下的代码到终端,并且执行。 + +``` +sudo chmod 755 GNUKhatasetup.run +sudo ./GNUKhatasetup.run +``` + +这就结束了,从你的 Dash 或者是应用菜单中启动 GNU Khata 吧。 + +### 第一次启动 + +GNU Khata 在浏览器中打开,并且展现以下的画面。 + +![](https://itsfoss.com/wp-content/uploads/2016/07/GNU-khata-1.jpg) + +填写组织的名字、组织形式,财务年度并且点击 proceed 按钮进入管理设置页面。 + +![](https://itsfoss.com/wp-content/uploads/2016/07/GNU-khata-2.jpg) + +仔细填写你的用户名、密码、安全问题及其答案,并且点击“create and login”。 + +![](https://itsfoss.com/wp-content/uploads/2016/07/GNU-khata-3.jpg) + +你已经全部设置完成了。使用菜单栏来开始使用 GNU Khata 来管理你的财务吧。这很容易。 + +### 移除 GNU KHATA + +如果你不想使用 GNU Khata 了,你可以执行如下命令移除: + +``` +sudo apt-get remove --auto-remove gnukhata-core-engine +``` + +你也可以通过新立得软件管理来删除它。 + +### GNU KHATA 真的是市面上付费会计应用的竞争对手吗? + +首先,GNU Khata 以简化为设计原则。顶部的菜单栏组织的很方便,可以帮助你有效的进行工作。你可以选择管理不同的账户和项目,并且切换非常容易。[它们的官网][5]表明,GNU Khata 可以“像说印度语一样方便”(LCTT 译注:原谅我,这个软件作者和本文作者是印度人……)。同时,你知道 GNU Khata 也可以在云端使用吗? + +所有的主流的账户管理工具,比如分类账簿、项目报表、财务报表等等都用专业的方式整理,并且支持自定义格式和即时展示。这让会计和仓储管理看起来如此的简单。 + +这个项目正在积极的发展,正在寻求实操中的反馈以帮助这个软件更加进步。考虑到软件的成熟性、使用的便利性还有免费的情况,GNU Khata 可能会成为你最好的账簿助手。 + +请在评论框里留言吧,让我们知道你是如何看待 GNU Khata 的。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/using-gnu-khata/ + +作者:[Aquil Roshan][a] +译者:[MikeCoder](https://github.com/MikeCoder) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/aquil/ +[1]: https://itsfoss.com/category/apps/ +[2]: http://www.gnukhata.in/ +[3]: https://evernote.com/ +[4]: https://cloud.openmailbox.org/index.php/s/L8ppsxtsFq1345E/download +[5]: http://www.gnukhata.in/ diff --git a/translated/tech/20160718 OPEN SOURCE ACCOUNTING SOFTWARE.md b/translated/tech/20160718 OPEN SOURCE ACCOUNTING SOFTWARE.md deleted file mode 100644 index 8093f8eae2..0000000000 --- a/translated/tech/20160718 OPEN SOURCE ACCOUNTING SOFTWARE.md +++ /dev/null @@ -1,71 +0,0 @@ -GNU KHATA:开源的会计管理软件 -============================================ - -作为一个活跃的 Linux 爱好者,我经常向我的朋友们介绍 Linux,帮助他们选择最适合他们的发行版本,同时也会帮助他们安装一些适用于他们工作的开源软件。 - -但是,又一次,我就变得很无奈。我的叔叔,他是一个自由职业的会计师。他会有一系列的为了会计工作的付费软件。我就不那么确定,我能在在开软软件中找到这么一款可以替代的软件。直到昨天。 - -Abhishek 给我推荐了一些[很酷的软件][1],并且,GNU Khata 这个特殊的一款,脱颖而出。 - -[GNU Khata][2] 是一个会计工具。 或者,我可以说成是一系列的会计工具集合?这像经济管理方面的[Evernote][3]。他的应用是如此之广,以至于他可以处理个人的财务管理,到大型公司的管理,从店铺存货管理到税率计算,都可以有效处理。 - -对你来说一个有趣的点,'Khata' 在印度或者是其他的印度语国家中意味着账户,所以这个会计软件叫做 GNU Khata。 - -### 安装 - -互联网上有很多关于老旧版本的 Khata 安装的介绍。现在,GNU Khata 已经可以在 Debian/Ubuntu 和他们的衍生产中得到。我建议你按照如下 GNU Khata 官网的步骤来安装。我们来一次快速的入门。 - -- 从[这][4]下载安装器。 -- 在下载目录打开终端。 -- 粘贴复制以下的代码到终端,并且执行。 - -``` -sudo chmod 755 GNUKhatasetup.run -sudo ./GNUKhatasetup.run -``` - -- 这就结束了,从你的 Dash 或者是应用菜单中启动 GNU Khata 吧。 -### 第一次启动 - -GNU Khata 在浏览器中打开,并且展现以下的画面。 - -![](https://itsfoss.com/wp-content/uploads/2016/07/GNU-khata-1.jpg) - -填写组织的名字和组织形式,经济年份并且点击 proceed 按钮进入管理设置页面。 - -![](https://itsfoss.com/wp-content/uploads/2016/07/GNU-khata-2.jpg) - -仔细填写你的姓名,密码,安全问题和他的答案,并且点击“create and login”。 - -![](https://itsfoss.com/wp-content/uploads/2016/07/GNU-khata-3.jpg) - -你已经全部设置完成了。使用菜单栏来开始使用 GNU Khata 来管理你的经济吧。这很容易。 - -### GNU KHATA 真的是市面上付费会计应用的竞争对手吗? - -首先,GNU Khata 让所有的事情变得简单。顶部的菜单栏被方便的组织,可以帮助你有效的进行工作。 你可以选择管理不同的账户和项目,并且切换非常容易。[他们的官网][5]表明,GNU Khata 可以“方便的转变成印度语”。同时,你知道 GNU Khata 也可以在云端使用吗? - -所有的主流的账户管理工具,将账簿分类,项目介绍,法规介绍等等用专业的方式整理,并且支持自定义整理和实时显示。这让会计和进存储管理看起来如此的简单。 - -这个项目正在积极的发展,从实际的操作中提交反馈来帮助这个软件更加进步。考虑到软件的成熟性,使用的便利性还有免费的 tag。GNU Khata 可能会成为最好的账簿助手。 - -请在评论框里留言吧,让我们知道你是如何看待 GNU Khata 的。 - - - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/using-gnu-khata/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ItsFoss+%28Its+FOSS%21+An+Open+Source+Blog%29 - -作者:[Aquil Roshan][a] -译者:[MikeCoder](https://github.com/MikeCoder) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/aquil/ -[1]: https://itsfoss.com/category/apps/ -[2]: http://www.gnukhata.in/ -[3]: https://evernote.com/ -[4]: https://cloud.openmailbox.org/index.php/s/L8ppsxtsFq1345E/download -[5]: http://www.gnukhata.in/ From 9c8a11a995865b85bf04bbdb59d7b7b582da1de5 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 31 Jul 2016 19:07:19 +0800 Subject: [PATCH 1316/1469] PUB:20160726 Set a Real Time Photo of Earth as Your Linux Desktop Wallpaper @geekpi --- ...f Earth as Your Linux Desktop Wallpaper.md | 90 +++++++++++++++++++ ...f Earth as Your Linux Desktop Wallpaper.md | 39 -------- 2 files changed, 90 insertions(+), 39 deletions(-) create mode 100644 published/20160726 Set a Real Time Photo of Earth as Your Linux Desktop Wallpaper.md delete mode 100644 translated/tech/20160726 Set a Real Time Photo of Earth as Your Linux Desktop Wallpaper.md diff --git a/published/20160726 Set a Real Time Photo of Earth as Your Linux Desktop Wallpaper.md b/published/20160726 Set a Real Time Photo of Earth as Your Linux Desktop Wallpaper.md new file mode 100644 index 0000000000..40ba237020 --- /dev/null +++ b/published/20160726 Set a Real Time Photo of Earth as Your Linux Desktop Wallpaper.md @@ -0,0 +1,90 @@ +为你的 Linux 桌面设置一张实时的地球照片 +================================================================= + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2016/07/Screen-Shot-2016-07-26-at-16.36.47-1.jpg) + +厌倦了看同样的桌面背景了么?这里有一个(可能是)世界上最棒的东西。 + +‘[Himawaripy][1]’ 是一个 Python 3 小脚本,它会抓取由[日本 Himawari 8 气象卫星][2]拍摄的接近实时的地球照片,并将它设置成你的桌面背景。 + +安装完成后,你可以将它设置成每 10 分钟运行的定时任务(自然,它要在后台运行),这样它就可以实时地取回地球的照片并设置成背景了。 + +因为 Himawari-8 是一颗同步轨道卫星,你只能看到澳大利亚上空的地球的图片——但是它实时的天气形态、云团和光线仍使它很壮丽,对我而言要是看到英国上方的就更好了! + +高级设置允许你配置从卫星取回的图片质量,但是要记住增加图片质量会增加文件大小及更长的下载等待! + +最后,虽然这个脚本与其他我们提到过的其他脚本类似,它还仍保持更新及可用。 + +###获取 Himawaripy + +Himawaripy 已经在一系列的桌面环境中都测试过了,包括 Unity、LXDE、i3、MATE 和其他桌面环境。它是自由开源软件,但是整体来说安装及配置不太简单。 + +在该项目的 [Github 主页][0]上可以找到安装和设置该应用程序的所有指导(提示:没有一键安装功能)。 + +- [实时地球壁纸脚本的 GitHub 主页][0] + +### 安装及使用 + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2016/07/Screen-Shot-2016-07-26-at-16.46.13-750x143.png) + +一些读者请我在本文中补充一下一步步安装该应用的步骤。以下所有步骤都在其 GitHub 主页上,这里再贴一遍。 + +1、下载及解压 Himawaripy + +这是最容易的步骤。点击下面的下载链接,然后下载最新版本,并解压到你的下载目录里面。 + + - [下载 Himawaripy 主干文件(.zip 格式)][3] + +2、安装 python3-setuptools + +你需要手工来安装主干软件包,Ubuntu 里面默认没有安装它: + +``` +sudo apt install python3-setuptools +``` + +3、安装 Himawaripy + +在终端中,你需要切换到之前解压的目录中,并运行如下安装命令: + +``` +cd ~/Downloads/himawaripy-master +sudo python3 setup.py install +``` + +4、 看看它是否可以运行并下载最新的实时图片: +``` +himawaripy +``` +5、 设置定时任务 + +如果你希望该脚本可以在后台自动运行并更新(如果你需要手动更新,只需要运行 ‘himarwaripy’ 即可) + +在终端中运行: +``` +crontab -e +``` +在其中新加一行(默认每10分钟运行一次) +``` +*/10 * * * * /usr/local/bin/himawaripy +``` +关于[配置定时任务][4]可以在 Ubuntu Wiki 上找到更多信息。 + +该脚本安装后你不需要不断运行它,它会自动的每十分钟在后台运行一次。 + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2016/07/set-real-time-earth-wallpaper-ubuntu-desktop + +作者:[JOEY-ELIJAH SNEDDON][a] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://plus.google.com/117485690627814051450/?rel=author +[1]: https://github.com/boramalper/himawaripy +[2]: https://en.wikipedia.org/wiki/Himawari_8 +[0]: https://github.com/boramalper/himawaripy +[3]: https://github.com/boramalper/himawaripy/archive/master.zip +[4]: https://help.ubuntu.com/community/CronHowto \ No newline at end of file diff --git a/translated/tech/20160726 Set a Real Time Photo of Earth as Your Linux Desktop Wallpaper.md b/translated/tech/20160726 Set a Real Time Photo of Earth as Your Linux Desktop Wallpaper.md deleted file mode 100644 index d05fd97eb2..0000000000 --- a/translated/tech/20160726 Set a Real Time Photo of Earth as Your Linux Desktop Wallpaper.md +++ /dev/null @@ -1,39 +0,0 @@ -为你的Linux桌面设置一张真实的地球照片 -================================================================= - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2016/07/Screen-Shot-2016-07-26-at-16.36.47-1.jpg) - -厌倦了看同样的桌面背景了么?这里有一个几乎这世界上最好的东西。 - -‘[Himawaripy][1]‘是一个Python 3脚本,它会接近实时抓取由[日本Himawari 8气象卫星][2]拍摄的地球照片,并将它设置成你的桌面背景。 - -安装完成后,你可以将它设置成每10分钟运行的任务(自然地它是在后台运行),这样它就可以实时地取回地球的照片并设置成背景了。 - -因为Himawari-8是一颗同步轨道卫星,你只能看到澳大利亚上空的地球的图片-但是它实时的天气形态、云团和光线仍使它很壮丽,即使对我而言在看到英国上方的更好! - -高级设置允许你配置从卫星取回的图片质量,但是要记住增加图片质量会增加文件大小及更长的下载等待! - -最后,虽然这个脚本与其他我们提到过的其他类似,它还仍保持更新及可用。 - -获取Himawaripy - -Himawaripy已经在一系列的桌面环境中都测试过了,包括Unity、LXDE、i3、MATE和其他桌面环境。它是免费、开源软件但是并不能直接设置及配置。 - -在Github上查找获取安装的应用程序和设置的所有指令()提示:有没有一键安装)上。 - -[GitHub上的实时地球壁纸脚本][0] - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/mandatory-access-control-with-selinux-or-apparmor-linux/ - -作者:[ JOEY-ELIJAH SNEDDON][a] -译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://plus.google.com/117485690627814051450/?rel=author -[1]: https://github.com/boramalper/himawaripy -[2]: https://en.wikipedia.org/wiki/Himawari_8 -[0]: https://github.com/boramalper/himawaripy From d592e68b58f12b4f81d258e424941677c22030a5 Mon Sep 17 00:00:00 2001 From: ChrisLeeGit Date: Sun, 31 Jul 2016 19:24:56 +0800 Subject: [PATCH 1317/1469] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=EF=BC=9AHow=20to=20Configure=20and=20Troubleshoot=20Grand=20Un?= =?UTF-8?q?ified=20Bootloader=20(GRUB)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...leshoot Grand Unified Bootloader (GRUB).md | 187 ------------------ ...leshoot Grand Unified Bootloader (GRUB).md | 184 +++++++++++++++++ 2 files changed, 184 insertions(+), 187 deletions(-) delete mode 100644 sources/tech/LFCS/Part 13 - How to Configure and Troubleshoot Grand Unified Bootloader (GRUB).md create mode 100644 translated/tech/LFCS/Part 13 - How to Configure and Troubleshoot Grand Unified Bootloader (GRUB).md diff --git a/sources/tech/LFCS/Part 13 - How to Configure and Troubleshoot Grand Unified Bootloader (GRUB).md b/sources/tech/LFCS/Part 13 - How to Configure and Troubleshoot Grand Unified Bootloader (GRUB).md deleted file mode 100644 index 2d1cbef467..0000000000 --- a/sources/tech/LFCS/Part 13 - How to Configure and Troubleshoot Grand Unified Bootloader (GRUB).md +++ /dev/null @@ -1,187 +0,0 @@ -Being translated by ChrisLeeGit - -Part 13 - LFCS: How to Configure and Troubleshoot Grand Unified Bootloader (GRUB) -===================================================================================== - -Because of the changes in the LFCS exam requirements effective Feb. 2, 2016, we are adding the necessary topics to the [LFCS series][1] published here. To prepare for this exam, your are highly encouraged to use the [LFCE series][2] as well. - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Configure-Troubleshoot-Grub-Boot-Loader.png) ->LFCS: Configure and Troubleshoot Grub Boot Loader – Part 13 - -In this article we will introduce you to GRUB and explain why a boot loader is necessary, and how it adds versatility to the system. - -The [Linux boot process][3] from the time you press the power button of your computer until you get a fully-functional system follows this high-level sequence: - -* 1. A process known as **POST** (**Power-On Self Test**) performs an overall check on the hardware components of your computer. -* 2. When **POST** completes, it passes the control over to the boot loader, which in turn loads the Linux kernel in memory (along with **initramfs**) and executes it. The most used boot loader in Linux is the **GRand Unified Boot loader**, or **GRUB** for short. -* 3. The kernel checks and accesses the hardware, and then runs the initial process (mostly known by its generic name “**init**”) which in turn completes the system boot by starting services. - -In Part 7 of this series (“[SysVinit, Upstart, and Systemd][4]”) we introduced the [service management systems and tools][5] used by modern Linux distributions. You may want to review that article before proceeding further. - -### Introducing GRUB Boot Loader - -Two major **GRUB** versions (**v1** sometimes called **GRUB Legacy** and **v2**) can be found in modern systems, although most distributions use **v2** by default in their latest versions. Only **Red Hat Enterprise Linux 6** and its derivatives still use **v1** today. - -Thus, we will focus primarily on the features of **v2** in this guide. - -Regardless of the **GRUB** version, a boot loader allows the user to: - -* 1). modify the way the system behaves by specifying different kernels to use, -* 2). choose between alternate operating systems to boot, and -* 3). add or edit configuration stanzas to change boot options, among other things. - -Today, **GRUB** is maintained by the **GNU** project and is well documented in their website. You are encouraged to use the [GNU official documentation][6] while going through this guide. - -When the system boots you are presented with the following **GRUB** screen in the main console. Initially, you are prompted to choose between alternate kernels (by default, the system will boot using the latest kernel) and are allowed to enter a **GRUB** command line (with `c`) or edit the boot options (by pressing the `e` key). - -![](http://www.tecmint.com/wp-content/uploads/2016/03/GRUB-Boot-Screen.png) ->GRUB Boot Screen - -One of the reasons why you would consider booting with an older kernel is a hardware device that used to work properly and has started “acting up” after an upgrade (refer to [this link][7] in the AskUbuntu forums for an example). - -The **GRUB v2** configuration is read on boot from `/boot/grub/grub.cfg` or `/boot/grub2/grub.cfg`, whereas `/boot/grub/grub.conf` or `/boot/grub/menu.lst` are used in **v1**. These files are NOT to be edited by hand, but are modified based on the contents of `/etc/default/grub` and the files found inside `/etc/grub.d`. - -In a **CentOS 7**, here’s the configuration file that is created when the system is first installed: - -``` -GRUB_TIMEOUT=5 -GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)" -GRUB_DEFAULT=saved -GRUB_DISABLE_SUBMENU=true -GRUB_TERMINAL_OUTPUT="console" -GRUB_CMDLINE_LINUX="vconsole.keymap=la-latin1 rd.lvm.lv=centos_centos7-2/swap crashkernel=auto vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos_centos7-2/root rhgb quiet" -GRUB_DISABLE_RECOVERY="true" -``` - -In addition to the online documentation, you can also find the GNU GRUB manual using info as follows: - -``` -# info grub -``` - -If you’re interested specifically in the options available for /etc/default/grub, you can invoke the configuration section directly: - -``` -# info -f grub -n 'Simple configuration' -``` - -Using the command above you will find out that `GRUB_TIMEOUT` sets the time between the moment when the initial screen appears and the system automatic booting begins unless interrupted by the user. When this variable is set to `-1`, boot will not be started until the user makes a selection. - -When multiple operating systems or kernels are installed in the same machine, `GRUB_DEFAULT` requires an integer value that indicates which OS or kernel entry in the GRUB initial screen should be selected to boot by default. The list of entries can be viewed not only in the splash screen shown above, but also using the following command: - -### In CentOS and openSUSE: - -``` -# awk -F\' '$1=="menuentry " {print $2}' /boot/grub2/grub.cfg -``` - -### In Ubuntu: - -``` -# awk -F\' '$1=="menuentry " {print $2}' /boot/grub/grub.cfg -``` - -In the example shown in the below image, if we wish to boot with the kernel version **3.10.0-123.el7.x86_64** (4th entry), we need to set `GRUB_DEFAULT` to `3` (entries are internally numbered beginning with zero) as follows: - -``` -GRUB_DEFAULT=3 -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Boot-System-with-Old-Kernel-Version.png) ->Boot System with Old Kernel Version - -One final GRUB configuration variable that is of special interest is `GRUB_CMDLINE_LINUX`, which is used to pass options to the kernel. The options that can be passed through GRUB to the kernel are well documented in the [Kernel Parameters file][8] and in [man 7 bootparam][9]. - -Current options in my **CentOS 7** server are: - -``` -GRUB_CMDLINE_LINUX="vconsole.keymap=la-latin1 rd.lvm.lv=centos_centos7-2/swap crashkernel=auto vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos_centos7-2/root rhgb quiet" -``` - -Why would you want to modify the default kernel parameters or pass extra options? In simple terms, there may be times when you need to tell the kernel certain hardware parameters that it may not be able to determine on its own, or to override the values that it would detect. - -This happened to me not too long ago when I tried **Vector Linux**, a derivative of **Slackware**, on my 10-year old laptop. After installation it did not detect the right settings for my video card so I had to modify the kernel options passed through GRUB in order to make it work. - -Another example is when you need to bring the system to single-user mode to perform maintenance tasks. You can do this by appending the word single to `GRUB_CMDLINE_LINUX` and rebooting: - -``` -GRUB_CMDLINE_LINUX="vconsole.keymap=la-latin1 rd.lvm.lv=centos_centos7-2/swap crashkernel=auto vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos_centos7-2/root rhgb quiet single" -``` - -After editing `/etc/defalt/grub`, you will need to run `update-grub` (Ubuntu) or `grub2-mkconfig -o /boot/grub2/grub.cfg` (**CentOS** and **openSUSE**) afterwards to update `grub.cfg` (otherwise, changes will be lost upon boot). - -This command will process the boot configuration files mentioned earlier to update `grub.cfg`. This method ensures changes are permanent, while options passed through GRUB at boot time will only last during the current session. - -### Fixing Linux GRUB Issues - -If you install a second operating system or if your GRUB configuration file gets corrupted due to human error, there are ways you can get your system back on its feet and be able to boot again. - -In the initial screen, press `c` to get a GRUB command line (remember that you can also press `e` to edit the default boot options), and use help to bring the available commands in the GRUB prompt: - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Fix-Grub-Issues-in-Linux.png) ->Fix Grub Configuration Issues in Linux - -We will focus on **ls**, which will list the installed devices and filesystems, and we will examine what it finds. In the image below we can see that there are 4 hard drives (`hd0` through `hd3`). - -Only `hd0` seems to have been partitioned (as evidenced by msdos1 and msdos2, where 1 and 2 are the partition numbers and msdos is the partitioning scheme). - -Let’s now examine the first partition on `hd0` (**msdos1**) to see if we can find GRUB there. This approach will allow us to boot Linux and there use other high level tools to repair the configuration file or reinstall GRUB altogether if it is needed: - -``` -# ls (hd0,msdos1)/ -``` - -As we can see in the highlighted area, we found the `grub2` directory in this partition: - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Find-Grub-Configuration.png) ->Find Grub Configuration - -Once we are sure that GRUB resides in (**hd0,msdos1**), let’s tell GRUB where to find its configuration file and then instruct it to attempt to launch its menu: - -``` -set prefix=(hd0,msdos1)/grub2 -set root=(hd0,msdos1) -insmod normal -normal -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/03/Find-and-Launch-Grub-Menu.png) ->Find and Launch Grub Menu - -Then in the GRUB menu, choose an entry and press **Enter** to boot using it. Once the system has booted you can issue the `grub2-install /dev/sdX` command (change `sdX` with the device you want to install GRUB on). The boot information will then be updated and all related files be restored. - -``` -# grub2-install /dev/sdX -``` - -Other more complex scenarios are documented, along with their suggested fixes, in the [Ubuntu GRUB2 Troubleshooting guide][10]. The concepts explained there are valid for other distributions as well. - -### Summary - -In this article we have introduced you to GRUB, indicated where you can find documentation both online and offline, and explained how to approach an scenario where a system has stopped booting properly due to a bootloader-related issue. - -Fortunately, GRUB is one of the tools that is best documented and you can easily find help either in the installed docs or online using the resources we have shared in this article. - -Do you have questions or comments? Don’t hesitate to let us know using the comment form below. We look forward to hearing from you! - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/linux-basic-shell-scripting-and-linux-filesystem-troubleshooting/ - -作者:[Gabriel Cánepa][a] -译者:[ChrisLeeGit](https://github.com/chrisleegit) -校对:[校对者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/installing-network-services-and-configuring-services-at-system-boot/ -[3]: http://www.tecmint.com/linux-boot-process/ -[4]: http://www.tecmint.com/linux-boot-process-and-manage-services/ -[5]: http://www.tecmint.com/best-linux-log-monitoring-and-management-tools/ -[6]: http://www.gnu.org/software/grub/manual/ -[7]: http://askubuntu.com/questions/82140/how-can-i-boot-with-an-older-kernel-version -[8]: https://www.kernel.org/doc/Documentation/kernel-parameters.txt -[9]: http://man7.org/linux/man-pages/man7/bootparam.7.html -[10]: https://help.ubuntu.com/community/Grub2/Troubleshooting diff --git a/translated/tech/LFCS/Part 13 - How to Configure and Troubleshoot Grand Unified Bootloader (GRUB).md b/translated/tech/LFCS/Part 13 - How to Configure and Troubleshoot Grand Unified Bootloader (GRUB).md new file mode 100644 index 0000000000..d8b7b294e2 --- /dev/null +++ b/translated/tech/LFCS/Part 13 - How to Configure and Troubleshoot Grand Unified Bootloader (GRUB).md @@ -0,0 +1,184 @@ +LFCS 系列第十三讲:如何配置并排除 GNU 引导加载程序(GRUB)故障 +===================================================================================== + +由于 LFCS 考试需求的变动已于 2016 年 2 月 2 日生效,因此我们向 [LFCS 系列][1] 添加了一些必要的话题。为了准备认证考试,我们也强烈推荐你去看 [LFCE 系列][2]。 + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Configure-Troubleshoot-Grub-Boot-Loader.png) +>LFCS 系列第十三讲:配置并排除 Grub 引导加载程序故障。 + +本文将会向你介绍 GRUB 的知识,并会说明你为什么需要一个引导加载程序,以及它是如何增强系统通用性的。 + +[Linux 引导过程][3] 是从你按下你的电脑电源键开始,直到你拥有一个全功能的系统为止,整个过程遵循着这样的高层次顺序: + +* 1. 一个叫做 **POST**(**上电自检**)的过程会对你的电脑硬件组件做全面的检查。 +* 2. 当 **POST** 完成后,它会把控制权转交给引导加载程序,接下来引导加载程序会将 Linux 内核(以及 **initramfs**)加载到内存中并执行。 +* 3. 内核首先检查并访问硬件,然后运行初始进程(主要以它的通用名 **init** 而为人熟知),接下来初始进程会启动一些服务,最后完成系统启动过程。 + +在该系列的第七讲(“[SysVinit, Upstart, 和 Systemd][4]”)中,我们介绍了现代 Linux 发行版使用的一些服务管理系统和工具。在继续学习之前,你可能想要回顾一下那一讲的知识。 + +### GRUB 引导装载程序介绍 + +在现代系统中,你会发现有两种主要的 **GRUB** 版本(一种是偶尔被成为 **GRUB Legacy** 的 **v1** 版本,另一种则是 **v2** 版本),虽说多数最新版本的发行版系统都默认使用了 **v2** 版本。如今,只有 **红帽企业版 Linux 6** 及其衍生系统仍在使用 **v1** 版本。 + +因此,在本指南中,我们将着重关注 **v2** 版本的功能。 + +不管 **GRUB** 的版本是什么,一个引导加载程序都允许用户: + +* 1). 通过指定使用不同的内核来修改系统的表现方式; +* 2). 从多个操作系统中选择一个启动; +* 3). 添加或编辑配置节点来改变启动选项等。 + +如今,**GNU** 项目负责维护 **GRUB**,并在它们的网站上提供了丰富的文档。当你在阅读这篇指南时,我们强烈建议你看下 [GNU 官方文档][6]。 + +当系统引导时,你会在主控制台看到如下的 **GRUB** 画面。最开始,你可以根据提示在多个内核版本中选择一个内核(默认情况下,系统将会使用最新的内核启动),并且可以进入 **GRUB** 命令行模式(使用 `c` 键),或者编辑启动项(按下 `e` 键)。 + +![](http://www.tecmint.com/wp-content/uploads/2016/03/GRUB-Boot-Screen.png) +> GRUB 启动画面 + +你会考虑使用一个旧版内核启动的原因之一是之前工作正常的某个硬件设备在一次升级后出现了“怪毛病(acting up)”(例如,你可以参考 AskUbuntu 论坛中的 [这条链接][7])。 + +**GRUB v2** 的配置文件会在启动时从 `/boot/grub/grub.cfg` 或 `/boot/grub2/grub.cfg` 文件中读取,而 **GRUB v1** 使用的配置文件则来自 `/boot/grub/grub.conf` 或 `/boot/grub/menu.lst`。这些文件不能直接手动编辑,而是根据 `/etc/default/grub` 的内容和 `/etc/grub.d` 目录中的文件来修改的。 + +在 **CentOS 7** 上,当系统最初完成安装后,会生成如下的配置文件: + +``` +GRUB_TIMEOUT=5 +GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)" +GRUB_DEFAULT=saved +GRUB_DISABLE_SUBMENU=true +GRUB_TERMINAL_OUTPUT="console" +GRUB_CMDLINE_LINUX="vconsole.keymap=la-latin1 rd.lvm.lv=centos_centos7-2/swap crashkernel=auto vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos_centos7-2/root rhgb quiet" +GRUB_DISABLE_RECOVERY="true" +``` + +除了在线文档外,你也可以使用下面的命令查阅 GNU GRUB 手册: + +``` +# info grub +``` + +如果你对 `/etc/default/grub` 文件中的可用选项特别感兴趣的话,你可以直接查阅配置一节的帮助文档: + +``` +# info -f grub -n 'Simple configuration' +``` + +使用上述命令,你会发现 `GRUB_TIMEOUT` 用于设置启动画面出现和系统自动开始启动(除非被用户中断)之间的时间。当该变量值为 `-1` 时,除非用户主动做出选择,否则不会开始启动。 + +当同一台机器上安装了多个操作系统或内核后,`GRUB_DEFAULT` 就需要用一个整数来指定 GRUB 启动画面默认选择启动的操作系统或内核条目。我们既可以通过上述启动画查看启动条目列表,也可以使用下面的命令: + +### 在 CentOS 和 openSUSE 系统上 + +``` +# awk -F\' '$1=="menuentry " {print $2}' /boot/grub2/grub.cfg +``` + +### 在 Ubuntu 系统上 + +``` +# awk -F\' '$1=="menuentry " {print $2}' /boot/grub/grub.cfg +``` + +如下图所示的例子中,如果我们想要使用版本为 `3.10.0-123.el7.x86_64` 的内核(第四个条目),我们需要将 `GRUB_DEFAULT` 设置为 `3`(条目从零开始编号),如下所示: + +``` +GRUB_DEFAULT=3 +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Boot-System-with-Old-Kernel-Version.png) +> 使用旧版内核启动系统 + +最后一个需要特别关注的 GRUB 配置变量是 `GRUB_CMDLINE_LINUX`,它是用来给内核传递选项的。我们可以在 [内核变量文件][8] 和 [man 7 bootparam][9] 中找到能够通过 GRUB 传递给内核的选项的详细文档。 + +我的 **CentOS 7** 服务器上当前的选项是: + +``` +GRUB_CMDLINE_LINUX="vconsole.keymap=la-latin1 rd.lvm.lv=centos_centos7-2/swap crashkernel=auto vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos_centos7-2/root rhgb quiet" +``` +为什么你希望修改默认的内核参数或者传递额外的选项呢?简单来说,在很多情况下,你需要告诉内核某些由内核自身无法判断的硬件参数,或者是覆盖一些内核会检测的值。 + +不久之前,就在我身上发生过这样的事情,当时我在自己已用了 10 年的老笔记本上尝试衍生自 **Slackware** 的 **Vector Linux**。完成安装后,内核并没有检测出我的显卡的正确配置,所以我不得不通过 GRUB 传递修改过的内核选项来让它工作。 + +另外一个例子是当你需要将系统切换到单用户模式以执行维护工作时。为此,你可以直接在 `GRUB_CMDLINE_LINUX` 变量中直接追加 `single` 并重启即可: + +``` +GRUB_CMDLINE_LINUX="vconsole.keymap=la-latin1 rd.lvm.lv=centos_centos7-2/swap crashkernel=auto vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos_centos7-2/root rhgb quiet single" +``` + +编辑完 `/etc/default/grub` 之后,你需要运行 `update-grub` (在 Ubuntu 上)或者 `grub2-mkconfig -o /boot/grub2/grub.cfg` (在 **CentOS** 和 **openSUSE** 上)命令来更新 `grub.cfg` 文件(否则,改动会在系统启动时丢失)。 + +这条命令会处理早先提到的一些启动配置文件来更新 `grub.cfg` 文件。这种方法可以确保改动持久化,而在启动时刻通过 GRUB 传递的选项仅在当前会话期间有效。 + +### 修复 Linux GRUB 问题 + +如果你安装了第二个操作系统,或者由于人为失误而导致你的 GRUB 配置文件损坏了,依然有一些方法可以让你恢复并能够再次启动系统。 + +在启动画面中按下 `c` 键进入 GRUB 命令行模式(记住,你也可以按下 `e` 键编辑默认启动选项),并可以在 GRUB 提示中输入 `help` 命令获得可用命令: + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Fix-Grub-Issues-in-Linux.png) +> 修复 Linux 的 Grub 配置问题 + +我们将会着重关注 **ls** 命令,它会列出已安装的设备和文件系统,并且我们将会看看它可以查找什么。在下面的图片中,我们可以看到有 4 块硬盘(`hd0` 到 `hd3`)。 + +貌似只有 `hd0` 已经分区了(msdos1 和 msdos2 可以证明,这里的 1 和 2 是分区号,msdos 则是分区方案)。 + +现在我们来看看能否在第一个分区 `hd0`(**msdos1**)上找到 GRUB。这种方法允许我们启动 Linux,并且使用高级工具修复配置文件或者如果有必要的话,干脆重新安装 GRUB: + +``` +# ls (hd0,msdos1)/ +``` + +从高亮区域可以发现,`grub2` 目录就在这个分区: + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Find-Grub-Configuration.png) +> 查找 Grub 配置 + +一旦我们确信了 GRUB 位于 (**hd0, msdos1**),那就让我们告诉 GRUB 该去哪儿查找它的配置文件并指示它去尝试启动它的菜单: + +``` +set prefix=(hd0,msdos1)/grub2 +set root=(hd0,msdos1) +insmod normal +normal +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/03/Find-and-Launch-Grub-Menu.png) +> 查找并启动 Grub 菜单 + +然后,在 GRUB 菜单中,选择一个条目并按下 **Enter** 键以使用它启动。一旦系统成功启动后,你就可以运行 `grub2-install /dev/sdX` 命令修复问题了(将 `sdX` 改成你想要安装 GRUB 的设备)。然后启动信息将会更新,并且所有相关文件都会得到恢复。 + +``` +# grub2-install /dev/sdX +``` + +其它更加复杂的情景及其修复建议都记录在 [Ubuntu GRUB2 故障排除指南][10] 中。该指南中阐述的概念对于其它发行版也是有效的。 + +### 总结 + +本文向你介绍了 GRUB,并指导你可以在何处找到线上和线下的文档,同时说明了如何面对由于引导加载相关的问题而导致系统无法正常启动的情况。 + +幸运的是,GRUB 是文档支持非常丰富的工具之一,你可以使用我们在文中分享的资源非常轻松地获取已安装的文档或在线文档。 + +你有什么问题或建议吗?请不要犹豫,使用下面的评论框告诉我们吧。我们期待着来自你的回复! + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/configure-and-troubleshoot-grub-boot-loader-linux/ + +作者:[Gabriel Cánepa][a] +译者:[ChrisLeeGit](https://github.com/chrisleegit) +校对:[校对者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/installing-network-services-and-configuring-services-at-system-boot/ +[3]: http://www.tecmint.com/linux-boot-process/ +[4]: http://www.tecmint.com/linux-boot-process-and-manage-services/ +[5]: http://www.tecmint.com/best-linux-log-monitoring-and-management-tools/ +[6]: http://www.gnu.org/software/grub/manual/ +[7]: http://askubuntu.com/questions/82140/how-can-i-boot-with-an-older-kernel-version +[8]: https://www.kernel.org/doc/Documentation/kernel-parameters.txt +[9]: http://man7.org/linux/man-pages/man7/bootparam.7.html +[10]: https://help.ubuntu.com/community/Grub2/Troubleshooting From a99e94384d18bc39e73223dc62b37d182c897909 Mon Sep 17 00:00:00 2001 From: ChrisLeeGit Date: Sun, 31 Jul 2016 21:51:00 +0800 Subject: [PATCH 1318/1469] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=EF=BC=9AKeeweb=20A=20Linux=20Password=20Manager?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0160722 Keeweb A Linux Password Manager.md | 64 ------------------- ...0160722 Keeweb A Linux Password Manager.md | 62 ++++++++++++++++++ 2 files changed, 62 insertions(+), 64 deletions(-) delete mode 100644 sources/tech/20160722 Keeweb A Linux Password Manager.md create mode 100644 translated/tech/20160722 Keeweb A Linux Password Manager.md diff --git a/sources/tech/20160722 Keeweb A Linux Password Manager.md b/sources/tech/20160722 Keeweb A Linux Password Manager.md deleted file mode 100644 index b55de2a4cb..0000000000 --- a/sources/tech/20160722 Keeweb A Linux Password Manager.md +++ /dev/null @@ -1,64 +0,0 @@ -Being translated by ChrisLeeGit - -Keeweb A Linux Password Manager -================================ - -![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/keeweb_1.png?608) - -Today we are depending on more and more online services. Each online service we sign up for, let us set a password and this way we have to remember hundreds of passwords. In this case, it is easy for anyone to forget passwords. In this article I am going to talk about Keeweb, a Linux password manager that can store all your passwords securely either online or offline. - -When we talk about Linux password managers, there are so many. Password managers like, [Keepass][1] and [Encryptr, a Zero-knowledge system based password manager][2] have already been talked about on LinuxAndUbuntu. Keeweb is another password manager for Linux that we are going to see in this article. - -### Keeweb can store passwords offline or online - -Keeweb is a cross-platform password manager. It can store all your passwords offline and sync it with your own cloud storage services like OneDrive, Google Drive, Dropbox etc. Keeweb does not have online database of its own to sync your passwords. - -To connect your online storage with Keeweb, just click more and click the service that you want to use. - -![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/keeweb.png?685) - -Now Keeweb will prompt you to sign in to your drive. After sign in authenticate Keeweb to use your account. - -![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/authenticate-dropbox-with-keeweb_orig.jpg?649) - -### Store passwords with Keeweb - -It is very easy to store your passwords with Keeweb. You can encrypt your password file with a complex password. Keeweb also allows you to lock file with a key file but I don't recommend it. If somebody gets your key file, it takes only a click to unlock your passwords file. - -#### Create Passwords - -To create a new password simply click the '+' sign and you will be presented all entries to fill up. You can create more entries if you want. - -#### Search Passwords - -![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/search-passwords_orig.png) - -Keeweb has a library of icons so that you can find any particular password entry easily. You can change the color of icons, download more icons and even import icons from your computer. When talking about finding passwords the search comes very handy. ​ - -Passwords of similar services can be grouped so that you can find them all at one place in one folder. You can also tag passwords to store them all in different categories. - -![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/tags-passwords-in-keeweb.png?283) - -### Themes - -![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/themes.png?304) - -If you like light themes like white or high contrast then you can change theme from Settings > General > Themes. There are four themes available, two are dark and two are light. - -### Dont' you Like Linux Passwords Manager? No problem! - -I have already posted about two other Linux password managers, Keepass and Encryptr and there were arguments on Reddit, and other social media. There were people against using any password manager and vice-versa. In this article I want to clear out that it is our responsibility to save the file that passwords are stored in. I think Password managers like Keepass and Keeweb are good to use as they don't store your passwords in the cloud. These password managers create a file and you can store it on your hard drive or encrypt it with apps like VeraCrypt. I myself don't use or recommend to use services that store passwords in their own database. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/mandatory-access-control-with-selinux-or-apparmor-linux/ - -作者:[author][a] -译者:[ChrisLeeGit](https://github.com/chrisleegit) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://www.linuxandubuntu.com/home/keeweb-a-linux-password-manager -[1]: http://www.linuxandubuntu.com/home/keepass-password-management-tool-creates-strong-passwords-and-keeps-them-secure -[2]: http://www.linuxandubuntu.com/home/encryptr-zero-knowledge-system-based-password-manager-for-linux diff --git a/translated/tech/20160722 Keeweb A Linux Password Manager.md b/translated/tech/20160722 Keeweb A Linux Password Manager.md new file mode 100644 index 0000000000..3e32d1001c --- /dev/null +++ b/translated/tech/20160722 Keeweb A Linux Password Manager.md @@ -0,0 +1,62 @@ +Linux 密码管理器:Keeweb +================================ + +![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/keeweb_1.png?608) + +如今,我们依赖于越来越多的线上服务。我们每注册一个线上服务,就要设置一个密码;如此,我们就不得不记住数以百计的密码。这样对于每个人来说,都很容易忘记密码。我将在本文中介绍 Keeweb,它是一款 Linux 密码管理器,可以将你所有的密码安全地存储在线上或线下。 + +当谈及 Linux 密码管理器时,我们会发现有很多这样的软件。我们已经在 LinuxAndUbuntu 上讨论过像 [Keepass][1] 和 [Encryptr,一个基于零知识系统的密码管理器][2] 这样的密码管理器。Keeweb 则是另外一款我们将在本文讲解的 Linux 密码管理器。 + +### Keeweb 可以在线下或线上存储密码 + +Keeweb 是一款跨平台的密码管理器。它可以在线下存储你所有的密码,并且能够同步到你自己的云存储服务上,例如 OneDrive, Google Drive, Dropbox 等。Keeweb 并没有它自己的用于同步你密码的在线数据库。 + +要使用 Keeweb 连接你的线上存储服务,只需要点击更多,然后再点击你想要使用的服务即可。 + +![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/keeweb.png?685) + +现在,Keeweb 会提示你登录到你的云盘。登录成功后,给 Keeweb 授权使用你的账户。 + +![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/authenticate-dropbox-with-keeweb_orig.jpg?649) + +### 使用 Keeweb 存储密码 + +使用 Keeweb 存储你的密码是非常容易的。你可以使用一个复杂的密码加密你的密码文件。Keeweb 也允许你使用一个秘钥文件来锁定密码文件,但是我并不推荐这种方式。如果某个家伙拿到了你的秘钥文件,他只需要简单点击一下就可以解锁你的密码文件。 + +#### 创建密码 + +想要创建一个新的密码,你只需要简单地点击 `+` 号,然后你就会看到所有需要填充的输入框。如果你想的话,可以创建更多的输入框。 + +#### 搜索密码 + +![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/search-passwords_orig.png) + +Keeweb 拥有一个图标库,这样你就可以轻松地找到任何特定的密码入口。你可以改变图标的颜色、下载更多的图标,甚至可以直接从你的电脑中导入图标。这对于密码搜索来说,异常好使。 + +相似服务的密码可以分组,这样你就可以在一个文件夹的一个地方同时找到它们。你也可以给密码打上标签并把它们存放在不同分类中。 + +![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/tags-passwords-in-keeweb.png?283) + +### 主题 + +![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/themes.png?304) + +如果你喜欢类似于白色或者高对比度的亮色主题,你可以在“设置 > 通用 > 主题”中修改。(Keeweb)有四款可供选择的主题,其中两款为暗色,另外两款为亮色。 + +### 不喜欢 Linux 密码管理器?没问题! + +我已经发表过文章介绍了另外两款 Linux 密码管理器,它们分别是 Keepass 和 Encryptr,在 Reddit 和其它社交媒体上有些关于它们的争论。有些人反对使用任何密码管理器,反之亦然。在本文中,我想要澄清的是,存放密码文件是我们自己的责任。我认为像 keepass 和 Keeweb 这样的密码管理器是非常好用的,因为它们并没有自己的云来存放你的密码。这些密码管理器会创建一个文件,然后你可以将它存放在你的硬盘上,或者使用像 VeraCrypt 这样的应用给它加密。我个人不使用也不推荐使用那些将密码存储在它们自己数据库的服务。 + +-------------------------------------------------------------------------------- + +via: http://www.linuxandubuntu.com/home/keeweb-a-linux-password-manager + +作者:[author][a] +译者:[ChrisLeeGit](https://github.com/chrisleegit) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.linuxandubuntu.com/home/keeweb-a-linux-password-manager +[1]: http://www.linuxandubuntu.com/home/keepass-password-management-tool-creates-strong-passwords-and-keeps-them-secure +[2]: http://www.linuxandubuntu.com/home/encryptr-zero-knowledge-system-based-password-manager-for-linux From 35a7b4b8d36880eccc22b65d2540d1afdf04e5d5 Mon Sep 17 00:00:00 2001 From: alim0x Date: Sun, 31 Jul 2016 22:20:32 +0800 Subject: [PATCH 1319/1469] [translating]Implementing Mandatory Access Control with SELinux or AppArmor in Linux --- ...andatory Access Control with SELinux or AppArmor in Linux.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160608 Implementing Mandatory Access Control with SELinux or AppArmor in Linux.md b/sources/tech/20160608 Implementing Mandatory Access Control with SELinux or AppArmor in Linux.md index 65c8657dff..c4c6aecec6 100644 --- a/sources/tech/20160608 Implementing Mandatory Access Control with SELinux or AppArmor in Linux.md +++ b/sources/tech/20160608 Implementing Mandatory Access Control with SELinux or AppArmor in Linux.md @@ -1,3 +1,5 @@ +alim0x translating + Implementing Mandatory Access Control with SELinux or AppArmor in Linux =========================================================================== From b6719d8cc4c0c141c014628b89c5ae2cec9accab Mon Sep 17 00:00:00 2001 From: ChrisLeeGit Date: Sun, 31 Jul 2016 22:58:17 +0800 Subject: [PATCH 1320/1469] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...9 - Learn How to Use Awk Special Patterns begin and end.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/awk/20160719 Part 9 - Learn How to Use Awk Special Patterns begin and end.md b/sources/tech/awk/20160719 Part 9 - Learn How to Use Awk Special Patterns begin and end.md index f64e834ca1..b3f99e6d4f 100644 --- a/sources/tech/awk/20160719 Part 9 - Learn How to Use Awk Special Patterns begin and end.md +++ b/sources/tech/awk/20160719 Part 9 - Learn How to Use Awk Special Patterns begin and end.md @@ -1,3 +1,5 @@ +Being translated by ChrisLeeGit + Learn How to Use Awk Special Patterns ‘BEGIN and END’ – Part 9 =============================================================== @@ -158,7 +160,7 @@ As I pointed out before, these Awk features will help us build more complex text via: http://www.tecmint.com/learn-use-awk-special-patterns-begin-and-end/ 作者:[Aaron Kili][a] -译者:[译者ID](https://github.com/译者ID) +译者:[ChrisLeeGit](https://github.com/chrisleegit) 校对:[校对ID](https://github.com/校对ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 705f188aa63789937172d89bf488e737c1979aa3 Mon Sep 17 00:00:00 2001 From: vim-kakali <1799225723@qq.com> Date: Mon, 1 Aug 2016 02:07:10 +0800 Subject: [PATCH 1321/1469] translated --- ...ic Expressions and Assignment Operators.md | 275 ------------------ ...ic Expressions and Assignment Operators.md | 275 ++++++++++++++++++ 2 files changed, 275 insertions(+), 275 deletions(-) delete mode 100644 sources/tech/awk/20160714 Part 8 - Learn How to Use Awk Variables, Numeric Expressions and Assignment Operators.md create mode 100644 translated/tech/awk/20160714 Part 8 - Learn How to Use Awk Variables, Numeric Expressions and Assignment Operators.md diff --git a/sources/tech/awk/20160714 Part 8 - Learn How to Use Awk Variables, Numeric Expressions and Assignment Operators.md b/sources/tech/awk/20160714 Part 8 - Learn How to Use Awk Variables, Numeric Expressions and Assignment Operators.md deleted file mode 100644 index dd2494529d..0000000000 --- a/sources/tech/awk/20160714 Part 8 - Learn How to Use Awk Variables, Numeric Expressions and Assignment Operators.md +++ /dev/null @@ -1,275 +0,0 @@ -translating by vim-kakali - - -Learn How to Use Awk Variables, Numeric Expressions and Assignment Operators – part8 - -======================================================================================= - -The [Awk command series][1] is getting exciting I believe, in the previous seven parts, we walked through some fundamentals of Awk that you need to master to enable you perform some basic text or string filtering in Linux. - -Starting with this part, we shall dive into advance areas of Awk to handle more complex text or string filtering operations. Therefore, we are going to cover Awk features such as variables, numeric expressions and assignment operators. - -![](http://www.tecmint.com/wp-content/uploads/2016/07/Learn-Awk-Variables-Numeric-Expressions-Assignment-Operators.png) ->Learn Awk Variables, Numeric Expressions and Assignment Operators - -These concepts are not comprehensively distinct from the ones you may have probably encountered in many programming languages before such shell, C, Python plus many others, so there is no need to worry much about this topic, we are simply revising the common ideas of using these mentioned features. - -This will probably be one of the easiest Awk command sections to understand, so sit back and lets get going. - -### 1. Awk Variables - -In any programming language, a variable is a place holder which stores a value, when you create a variable in a program file, as the file is executed, some space is created in memory that will store the value you specify for the variable. - -You can define Awk variables in the same way you define shell variables as follows: - -``` -variable_name=value -``` - -In the syntax above: - -- `variable_name`: is the name you give a variable -- `value`: the value stored in the variable - -Let’s look at some examples below: - -``` -computer_name=”tecmint.com” -port_no=”22” -email=”admin@tecmint.com” -server=”computer_name” -``` - -Take a look at the simple examples above, in the first variable definition, the value `tecmint.com` is assigned to the variable `computer_name`. - -Furthermore, the value 22 is assigned to the variable port_no, it is also possible to assign the value of one variable to another variable as in the last example where we assigned the value of computer_name to the variable server. - -If you can recall, right from [part 2 of this Awk series][2] were we covered field editing, we talked about how Awk divides input lines into fields and uses standard field access operator, $ to read the different fields that have been parsed. We can also use variables to store the values of fields as follows. - -``` -first_name=$2 -second_name=$3 -``` - -In the examples above, the value of first_name is set to second field and second_name is set to the third field. - -As an illustration, consider a file named names.txt which contains a list of an application’s users indicating their first and last names plus gender. Using the [cat command][3], we can view the contents of the file as follows: - -``` -$ cat names.txt -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/07/List-File-Content-Using-cat-Command.png) ->List File Content Using cat Command - -Then, we can also use the variables first_name and second_name to store the first and second names of the first user on the list as by running the Awk command below: - -``` -$ awk '/Aaron/{ first_name=$2 ; second_name=$3 ; print first_name, second_name ; }' names.txt -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/07/Store-Variables-Using-Awk-Command.png) ->Store Variables Using Awk Command - -Let us also take a look at another case, when you issue the command `uname -a` on your terminal, it prints out all your system information. - -The second field contains your `hostname`, therefore we can store the hostname in a variable called hostname and print it using Awk as follows: - -``` -$ uname -a -$ uname -a | awk '{hostname=$2 ; print hostname ; }' -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/07/Store-Command-Output-to-Variable-Using-Awk.png) ->Store Command Output to Variable Using Awk - -### 2. Numeric Expressions - -In Awk, numeric expressions are built using the following numeric operators: - -- `*` : multiplication operator -- `+` : addition operator -- `/` : division operator -- `-` : subtraction operator -- `%` : modulus operator -- `^` : exponentiation operator - -The syntax for a numeric expressions is: - -``` -$ operand1 operator operand2 -``` - -In the form above, operand1 and operand2 can be numbers or variable names, and operator is any of the operators above. - -Below are some examples to demonstrate how to build numeric expressions: - -``` -counter=0 -num1=5 -num2=10 -num3=num2-num1 -counter=counter+1 -``` - -To understand the use of numeric expressions in Awk, we shall consider the following example below, with the file domains.txt which contains all domains owned by Tecmint. - -``` -news.tecmint.com -tecmint.com -linuxsay.com -windows.tecmint.com -tecmint.com -news.tecmint.com -tecmint.com -linuxsay.com -tecmint.com -news.tecmint.com -tecmint.com -linuxsay.com -windows.tecmint.com -tecmint.com -``` - -To view the contents of the file, use the command below: - -``` -$ cat domains.txt -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/07/View-Contents-of-File.png) ->View Contents of File - -If we want to count the number of times the domain tecmint.com appears in the file, we can write a simple script to do that as follows: - -``` -#!/bin/bash -for file in $@; do -if [ -f $file ] ; then -#print out filename -echo "File is: $file" -#print a number incrementally for every line containing tecmint.com -awk '/^tecmint.com/ { counter=counter+1 ; printf "%s\n", counter ; }' $file -else -#print error info incase input is not a file -echo "$file is not a file, please specify a file." >&2 && exit 1 -fi -done -#terminate script with exit code 0 in case of successful execution -exit 0 -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/07/Shell-Script-to-Count-a-String-in-File.png) ->Shell Script to Count a String or Text in File - -After creating the script, save it and make it executable, when we run it with the file, domains.txt as out input, we get the following output: - -``` -$ ./script.sh ~/domains.txt -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/07/Script-To-Count-String.png) ->Script to Count String or Text - -From the output of the script, there are 6 lines in the file domains.txt which contain tecmint.com, to confirm that you can manually count them. - -### 3. Assignment Operators - -The last Awk feature we shall cover is assignment operators, there are several assignment operators in Awk and these include the following: - -- `*=` : multiplication assignment operator -- `+=` : addition assignment operator -- `/=` : division assignment operator -- `-=` : subtraction assignment operator -- `%=` : modulus assignment operator -- `^=` : exponentiation assignment operator - -The simplest syntax of an assignment operation in Awk is as follows: - -``` -$ variable_name=variable_name operator operand -``` - -Examples: - -``` -counter=0 -counter=counter+1 -num=20 -num=num-1 -``` - -You can use the assignment operators above to shorten assignment operations in Awk, consider the previous examples, we could perform the assignment in the following form: - -``` -variable_name operator=operand -counter=0 -counter+=1 -num=20 -num-=1 -``` - -Therefore, we can alter the Awk command in the shell script we just wrote above using += assignment operator as follows: - -``` -#!/bin/bash -for file in $@; do -if [ -f $file ] ; then -#print out filename -echo "File is: $file" -#print a number incrementally for every line containing tecmint.com -awk '/^tecmint.com/ { counter+=1 ; printf "%s\n", counter ; }' $file -else -#print error info incase input is not a file -echo "$file is not a file, please specify a file." >&2 && exit 1 -fi -done -#terminate script with exit code 0 in case of successful execution -exit 0 -``` - - -![](http://www.tecmint.com/wp-content/uploads/2016/07/Alter-Shell-Script.png) ->Alter Shell Script - -In this segment of the [Awk series][4], we covered some powerful Awk features, that is variables, building numeric expressions and using assignment operators, plus some few illustrations of how we can actually use them. - -These concepts are not any different from the one in other programming languages but there may be some significant distinctions under Awk programming. - -In part 9, we shall look at more Awk features that is special patterns: BEGIN and END. Until then, stay connected to Tecmint. - - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/learn-awk-variables-numeric-expressions-and-assignment-operators/ - -作者:[Aaron Kili][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/aaronkili/ - - - - - - - - - - - - - - - - - - - -[1]: http://www.tecmint.com/category/awk-command/ -[2]: http://www.tecmint.com/awk-print-fields-columns-with-space-separator/ -[3]: http://www.tecmint.com/13-basic-cat-command-examples-in-linux/ -[4]: http://www.tecmint.com/category/awk-command/ diff --git a/translated/tech/awk/20160714 Part 8 - Learn How to Use Awk Variables, Numeric Expressions and Assignment Operators.md b/translated/tech/awk/20160714 Part 8 - Learn How to Use Awk Variables, Numeric Expressions and Assignment Operators.md new file mode 100644 index 0000000000..a5eb6b6df4 --- /dev/null +++ b/translated/tech/awk/20160714 Part 8 - Learn How to Use Awk Variables, Numeric Expressions and Assignment Operators.md @@ -0,0 +1,275 @@ + + +第 8 节--学习怎样使用 Awk 变量,数值表达式以及赋值运算符 + +======================================================================================= + + +我相信 [Awk 命令系列][1] 将会令人兴奋不已,在系列的前几节我们讨论了在 Linux 中处理文件和筛选字符串需要的基本 Awk 命令。 + + +在这一部分,我们会对处理更复杂的文件和筛选字符串操作需要的更高级的命令进行讨论。因此,我们将会看到关于 Awk 的一些特性诸如变量,数值表达式和赋值运算符。 +![](http://www.tecmint.com/wp-content/uploads/2016/07/Learn-Awk-Variables-Numeric-Expressions-Assignment-Operators.png) +>学习 Awk 变量,数值表达式和赋值运算符 + +你可能已经在很多编程语言中接触过它们,比如 shell,C,Python等;这些概念在理解上和这些语言没有什么不同,所以在这一小节中你不用担心很难理解,我们将会简短的提及常用的一些 Awk 特性。 + +这一小节可能是 Awk 命令里最容易理解的部分,所以放松点,我们开始吧。 +### 1. Awk 变量 + + +在任何编程语言中,当你在程序中新建一个变量的时候这个变量就是一个存储了值的占位符,程序一运行就占用了一些内存空间,你为变量赋的值会存储在这些内存空间上。 + + +你可以像下面这样定义 shell 变量一样定义 Awk 变量: +``` +variable_name=value +``` + +上面的语法: + +- `variable_name`: 为定义的变量的名字 +- `value`: 为变量赋的值 + +再看下面的一些例子: +``` +computer_name=”tecmint.com” +port_no=”22” +email=”admin@tecmint.com” +server=”computer_name” +``` + +观察上面的简单的例子,在定义第一个变量的时候,值 'tecmint.com' 被赋给了 'computer_name' 变量。 + + +此外,值 22 也被赋给了 port_no 变量,把一个变量的值赋给另一个变量也是可以的,在最后的例子中我们把变量 computer_name 的值赋给了变量 server。 + +你可以看看 [本系列的第 2 节][2] 中提到的字段编辑,我们讨论了 Awk 怎样将输入的行分隔为若干字段并且使用标准的字段进行输入操作 ,$ 访问不同的被分配的字段。我们也可以像下面这样使用变量为字段赋值。 + +``` +first_name=$2 +second_name=$3 +``` + +在上面的例子中,变量 first_name 的值设置为第二个字段,second_name 的值设置为第三个字段。 + + +再举个例子,有一个名为 names.txt 的文件,这个文件包含了一个应用程序的用户列表,这个用户列表显示了用户的名字和曾用名以及性别。可以使用 [cat 命令][3] 查看文件内容: +``` +$ cat names.txt +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/07/List-File-Content-Using-cat-Command.png) +>使用 cat 命令查看列表文件内容 + + +然后,我们也可以使用下面的 Awk 命令把列表中第一个用户的第一个和第二个名字分别存储到变量 first_name 和 second_name 上: +``` +$ awk '/Aaron/{ first_name=$2 ; second_name=$3 ; print first_name, second_name ; }' names.txt +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Store-Variables-Using-Awk-Command.png) +>使用 Awk 命令为变量赋值 + + +再看一个例子,当你在终端运行 'uname -a' 时,它可以打印出所有的系统信息。 + +第二个字段包含了你的 'hostname',因此,我们可以像下面这样把它赋给一个叫做 hostname 的变量并且用 Awk 打印出来。 +``` +$ uname -a +$ uname -a | awk '{hostname=$2 ; print hostname ; }' +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Store-Command-Output-to-Variable-Using-Awk.png) +>使用 Awk 把命令的输出赋给变量 + +### 2. 数值表达式 + +在 Awk 中,数值表达式使用下面的数值运算符组成: + +- `*` : 乘法运算符 +- `+` : 加法运算符 +- `/` : 除法运算符 +- `-` : 减法运算符 +- `%` : 取模运算符 +- `^` : 指数运算符 + + +数值表达式的语法是: +``` +$ operand1 operator operand2 +``` + +上面的 operand1 和 operand2 可以是数值和变量,运算符可以是上面列出的任意一种。 + +下面是一些展示怎样使用数值表达式的例子: +``` +counter=0 +num1=5 +num2=10 +num3=num2-num1 +counter=counter+1 +``` + + +理解了 Awk 中数值表达式的用法,我们就可以看下面的例子了,文件 domians.txt 里包括了所有属于 Tecmint 的域名。 +``` +news.tecmint.com +tecmint.com +linuxsay.com +windows.tecmint.com +tecmint.com +news.tecmint.com +tecmint.com +linuxsay.com +tecmint.com +news.tecmint.com +tecmint.com +linuxsay.com +windows.tecmint.com +tecmint.com +``` + +可以使用下面的命令查看文件的内容; +``` +$ cat domains.txt +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/07/View-Contents-of-File.png) +>查看文件内容 + + +如果想要计算出域名 tecmint.com 在文件中出现的次数,我们就可以通过写一个简单的脚本实现这个功能: +``` +#!/bin/bash +for file in $@; do +if [ -f $file ] ; then +#print out filename +echo "File is: $file" +#print a number incrementally for every line containing tecmint.com +awk '/^tecmint.com/ { counter=counter+1 ; printf "%s\n", counter ; }' $file +else +#print error info incase input is not a file +echo "$file is not a file, please specify a file." >&2 && exit 1 +fi +done +#terminate script with exit code 0 in case of successful execution +exit 0 +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Shell-Script-to-Count-a-String-in-File.png) +>计算一个字符串或文本在文件中出现次数的 shell 脚本 + + +写完脚本后保存并赋予执行权限,当我们使用文件运行脚本的时候,文件 domains.txt 作为脚本的输入,我们会得到下面的输出: + +``` +$ ./script.sh ~/domains.txt +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Script-To-Count-String.png) +>计算字符串或文本出现次数的脚本 + + +从脚本执行后的输出中,可以看到在文件 domains.txt 中包含域名 tecmint.com 的地方有 6 行,你可以自己计算进行验证。 + +### 3. 赋值操作符 + +我们要说的最后的 Awk 特性是赋值运算符,下面列出的只是 Awk 中的部分赋值运算符: + +- `*=` : 乘法赋值运算符 +- `+=` : 加法赋值运算符 +- `/=` : 除法赋值运算符 +- `-=` : 减法赋值运算符 +- `%=` : 取模赋值运算符 +- `^=` : 指数赋值运算符 + +下面是 Awk 中最简单的一个赋值操作的语法: +``` +$ variable_name=variable_name operator operand +``` + + +例子: + +``` +counter=0 +counter=counter+1 +num=20 +num=num-1 +``` + + +你可以使用在 Awk 中使用上面的赋值操作符使命令更简短,从先前的例子中,我们可以使用下面这种格式进行赋值操作: +``` +variable_name operator=operand +counter=0 +counter+=1 +num=20 +num-=1 +``` + + +因此,我们可以在 shell 脚本中改变 Awk 命令,使用上面提到的 += 操作符: +``` +#!/bin/bash +for file in $@; do +if [ -f $file ] ; then +#print out filename +echo "File is: $file" +#print a number incrementally for every line containing tecmint.com +awk '/^tecmint.com/ { counter+=1 ; printf "%s\n", counter ; }' $file +else +#print error info incase input is not a file +echo "$file is not a file, please specify a file." >&2 && exit 1 +fi +done +#terminate script with exit code 0 in case of successful execution +exit 0 +``` + + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Alter-Shell-Script.png) +>改变了的 shell 脚本 + + +在 [Awk 系列][4] 的这一部分,我们讨论了一些有用的 Awk 特性,有变量,使用数值表达式和赋值运算符,还有一些使用他们的实例。 + +这些概念和其他的编程语言没有任何不同,但是可能在 Awk 中有一些意义上的区别。 + +在本系列的第 9 节,我们会学习更多的 Awk 特性,比如特殊格式: BEGIN 和 END。这也会与 Tecmit 有联系。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/learn-awk-variables-numeric-expressions-and-assignment-operators/ + +作者:[Aaron Kili][a] +译者:[vim-kakali](https://github.com/vim-kakali) +校对:[校对ID](https://github.com/校对ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.tecmint.com/author/aaronkili/ + + + + + + + + + + + + + + + + + + + +[1]: http://www.tecmint.com/category/awk-command/ +[2]: http://www.tecmint.com/awk-print-fields-columns-with-space-separator/ +[3]: http://www.tecmint.com/13-basic-cat-command-examples-in-linux/ +[4]: http://www.tecmint.com/category/awk-command/ From 7acdcd342428534d6482b2f32e5c9b1791ca92fa Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 1 Aug 2016 07:25:05 +0800 Subject: [PATCH 1322/1469] =?UTF-8?q?=E5=BD=92=E6=A1=A3=20201607?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{ => 201607}/20151117 How bad a boss is Linus Torvalds.md | 0 ...Securi-Pi--Using the Raspberry Pi as a Secure Landing Point.md | 0 ...4 What is good stock portfolio management software on Linux.md | 0 .../20160218 How to Best Manage Encryption Keys on Linux.md | 0 .../20160218 What do Linux developers think of Git and GitHub.md | 0 ...ow to Setup Lighttpd Web server on Ubuntu 15.04 or CentOS 7.md | 0 .../20160220 Best Cloud Services For Linux To Replace Copy.md | 0 ...volving Market for Commercial Software Built On Open Source.md | 0 .../20160303 Top 5 open source command shells for Linux.md | 0 .../20160304 Microservices with Python RabbitMQ and Nameko.md | 0 ...20160425 How to Use Awk to Print Fields and Columns in File.md | 0 ...An introduction to data processing with Cassandra and Spark.md | 0 ...160519 The future of sharing integrating Pydio and ownCloud.md | 0 .../20160527 Turn Your Old Laptop into a Chromebook.md | 0 ...DB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md | 0 .../20160531 HOW TO USE WEBP IMAGES IN UBUNTU LINUX.md | 0 .../{ => 201607}/20160531 Why Ubuntu-based Distros Are Leaders.md | 0 ...ount your Google Drive on Linux with google-drive-ocamlfuse.md | 0 ...VBoxManage On Ubuntu 16.04 And Use Its Command line Options.md | 0 .../{ => 201607}/20160606 Basic Git Commands You Must Know.md | 0 .../20160609 How to record your terminal session on Linux.md | 0 .../20160609 INSTALL MATE 1.14 IN UBUNTU MATE 16.04 VIA PPA.md | 0 published/{ => 201607}/20160610 Getting started with ReactOS.md | 0 ...sic Linux Commands That Every Linux Newbies Should Remember.md | 0 .../20160616 6 Amazing Linux Distributions For Kids.md | 0 .../{ => 201607}/20160620 Detecting cats in images with OpenCV.md | 0 published/{ => 201607}/20160620 Monitor Linux With Netdata.md | 0 ...0 PowerPC gains an Android 4.4 port with Big Endian support.md | 0 .../20160621 Container technologies in Fedora - systemd-nspawn.md | 0 .../20160624 How to permanently mount a Windows share on Linux.md | 0 ...uns on the cloud and the cloud runs on Linux. Any questions.md | 0 ...160624 Industrial SBC builds on Raspberry Pi Compute Module.md | 0 ...5 How to Hide Linux Command Line History by Going Incognito.md | 0 ... Source Discussion Platform Discourse On Ubuntu Linux 16.04.md | 0 .../{ => 201607}/20160629 USE TASK MANAGER EQUIVALENT IN LINUX.md | 0 .../{ => 201607}/20160630 What makes up the Fedora kernel.md | 0 ...up Bridge (br0) Network on Ubuntu Linux 14.04 and 16.04 LTS.md | 0 .../20160705 Create Your Own Shell in Python - Part I.md | 0 .../20160706 Create Your Own Shell in Python - Part II.md | 0 ... Using Vagrant to control your DigitalOcean cloud instances.md | 0 .../{ => 201607}/20160718 OPEN SOURCE ACCOUNTING SOFTWARE.md | 0 ...20160721 YOU CAN TRY A DEMO UBUNTU VERSION IN A WEB BROWSER.md | 0 .../{ => 201607}/20160722 7 Best Markdown Editors for Linux.md | 0 .../20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md | 0 ...2 Terminix – A New GTK 3 Tiling Terminal Emulator for Linux.md | 0 ... a Real Time Photo of Earth as Your Linux Desktop Wallpaper.md | 0 46 files changed, 0 insertions(+), 0 deletions(-) rename published/{ => 201607}/20151117 How bad a boss is Linus Torvalds.md (100%) rename published/{ => 201607}/20151215 Securi-Pi--Using the Raspberry Pi as a Secure Landing Point.md (100%) rename published/{ => 201607}/20160104 What is good stock portfolio management software on Linux.md (100%) rename published/{ => 201607}/20160218 How to Best Manage Encryption Keys on Linux.md (100%) rename published/{ => 201607}/20160218 What do Linux developers think of Git and GitHub.md (100%) rename published/{ => 201607}/20160219 How to Setup Lighttpd Web server on Ubuntu 15.04 or CentOS 7.md (100%) rename published/{ => 201607}/20160220 Best Cloud Services For Linux To Replace Copy.md (100%) rename published/{ => 201607}/20160301 The Evolving Market for Commercial Software Built On Open Source.md (100%) rename published/{ => 201607}/20160303 Top 5 open source command shells for Linux.md (100%) rename published/{ => 201607}/20160304 Microservices with Python RabbitMQ and Nameko.md (100%) rename published/{ => 201607}/20160425 How to Use Awk to Print Fields and Columns in File.md (100%) rename published/{ => 201607}/20160511 An introduction to data processing with Cassandra and Spark.md (100%) rename published/{ => 201607}/20160519 The future of sharing integrating Pydio and ownCloud.md (100%) rename published/{ => 201607}/20160527 Turn Your Old Laptop into a Chromebook.md (100%) rename published/{ => 201607}/20160530 Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md (100%) rename published/{ => 201607}/20160531 HOW TO USE WEBP IMAGES IN UBUNTU LINUX.md (100%) rename published/{ => 201607}/20160531 Why Ubuntu-based Distros Are Leaders.md (100%) rename published/{ => 201607}/20160602 How to mount your Google Drive on Linux with google-drive-ocamlfuse.md (100%) rename published/{ => 201607}/20160603 How To Install And Use VBoxManage On Ubuntu 16.04 And Use Its Command line Options.md (100%) rename published/{ => 201607}/20160606 Basic Git Commands You Must Know.md (100%) rename published/{ => 201607}/20160609 How to record your terminal session on Linux.md (100%) rename published/{ => 201607}/20160609 INSTALL MATE 1.14 IN UBUNTU MATE 16.04 VIA PPA.md (100%) rename published/{ => 201607}/20160610 Getting started with ReactOS.md (100%) rename published/{ => 201607}/20160616 10 Basic Linux Commands That Every Linux Newbies Should Remember.md (100%) rename published/{ => 201607}/20160616 6 Amazing Linux Distributions For Kids.md (100%) rename published/{ => 201607}/20160620 Detecting cats in images with OpenCV.md (100%) rename published/{ => 201607}/20160620 Monitor Linux With Netdata.md (100%) rename published/{ => 201607}/20160620 PowerPC gains an Android 4.4 port with Big Endian support.md (100%) rename published/{ => 201607}/20160621 Container technologies in Fedora - systemd-nspawn.md (100%) rename published/{ => 201607}/20160624 How to permanently mount a Windows share on Linux.md (100%) rename published/{ => 201607}/20160624 IT runs on the cloud and the cloud runs on Linux. Any questions.md (100%) rename published/{ => 201607}/20160624 Industrial SBC builds on Raspberry Pi Compute Module.md (100%) rename published/{ => 201607}/20160625 How to Hide Linux Command Line History by Going Incognito.md (100%) rename published/{ => 201607}/20160628 How To Setup Open Source Discussion Platform Discourse On Ubuntu Linux 16.04.md (100%) rename published/{ => 201607}/20160629 USE TASK MANAGER EQUIVALENT IN LINUX.md (100%) rename published/{ => 201607}/20160630 What makes up the Fedora kernel.md (100%) rename published/{ => 201607}/20160701 How To Setup Bridge (br0) Network on Ubuntu Linux 14.04 and 16.04 LTS.md (100%) rename published/{ => 201607}/20160705 Create Your Own Shell in Python - Part I.md (100%) rename published/{ => 201607}/20160706 Create Your Own Shell in Python - Part II.md (100%) rename published/{ => 201607}/20160708 Using Vagrant to control your DigitalOcean cloud instances.md (100%) rename published/{ => 201607}/20160718 OPEN SOURCE ACCOUNTING SOFTWARE.md (100%) rename published/{ => 201607}/20160721 YOU CAN TRY A DEMO UBUNTU VERSION IN A WEB BROWSER.md (100%) rename published/{ => 201607}/20160722 7 Best Markdown Editors for Linux.md (100%) rename published/{ => 201607}/20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md (100%) rename published/{ => 201607}/20160722 Terminix – A New GTK 3 Tiling Terminal Emulator for Linux.md (100%) rename published/{ => 201607}/20160726 Set a Real Time Photo of Earth as Your Linux Desktop Wallpaper.md (100%) diff --git a/published/20151117 How bad a boss is Linus Torvalds.md b/published/201607/20151117 How bad a boss is Linus Torvalds.md similarity index 100% rename from published/20151117 How bad a boss is Linus Torvalds.md rename to published/201607/20151117 How bad a boss is Linus Torvalds.md diff --git a/published/20151215 Securi-Pi--Using the Raspberry Pi as a Secure Landing Point.md b/published/201607/20151215 Securi-Pi--Using the Raspberry Pi as a Secure Landing Point.md similarity index 100% rename from published/20151215 Securi-Pi--Using the Raspberry Pi as a Secure Landing Point.md rename to published/201607/20151215 Securi-Pi--Using the Raspberry Pi as a Secure Landing Point.md diff --git a/published/20160104 What is good stock portfolio management software on Linux.md b/published/201607/20160104 What is good stock portfolio management software on Linux.md similarity index 100% rename from published/20160104 What is good stock portfolio management software on Linux.md rename to published/201607/20160104 What is good stock portfolio management software on Linux.md diff --git a/published/20160218 How to Best Manage Encryption Keys on Linux.md b/published/201607/20160218 How to Best Manage Encryption Keys on Linux.md similarity index 100% rename from published/20160218 How to Best Manage Encryption Keys on Linux.md rename to published/201607/20160218 How to Best Manage Encryption Keys on Linux.md diff --git a/published/20160218 What do Linux developers think of Git and GitHub.md b/published/201607/20160218 What do Linux developers think of Git and GitHub.md similarity index 100% rename from published/20160218 What do Linux developers think of Git and GitHub.md rename to published/201607/20160218 What do Linux developers think of Git and GitHub.md diff --git a/published/20160219 How to Setup Lighttpd Web server on Ubuntu 15.04 or CentOS 7.md b/published/201607/20160219 How to Setup Lighttpd Web server on Ubuntu 15.04 or CentOS 7.md similarity index 100% rename from published/20160219 How to Setup Lighttpd Web server on Ubuntu 15.04 or CentOS 7.md rename to published/201607/20160219 How to Setup Lighttpd Web server on Ubuntu 15.04 or CentOS 7.md diff --git a/published/20160220 Best Cloud Services For Linux To Replace Copy.md b/published/201607/20160220 Best Cloud Services For Linux To Replace Copy.md similarity index 100% rename from published/20160220 Best Cloud Services For Linux To Replace Copy.md rename to published/201607/20160220 Best Cloud Services For Linux To Replace Copy.md diff --git a/published/20160301 The Evolving Market for Commercial Software Built On Open Source.md b/published/201607/20160301 The Evolving Market for Commercial Software Built On Open Source.md similarity index 100% rename from published/20160301 The Evolving Market for Commercial Software Built On Open Source.md rename to published/201607/20160301 The Evolving Market for Commercial Software Built On Open Source.md diff --git a/published/20160303 Top 5 open source command shells for Linux.md b/published/201607/20160303 Top 5 open source command shells for Linux.md similarity index 100% rename from published/20160303 Top 5 open source command shells for Linux.md rename to published/201607/20160303 Top 5 open source command shells for Linux.md diff --git a/published/20160304 Microservices with Python RabbitMQ and Nameko.md b/published/201607/20160304 Microservices with Python RabbitMQ and Nameko.md similarity index 100% rename from published/20160304 Microservices with Python RabbitMQ and Nameko.md rename to published/201607/20160304 Microservices with Python RabbitMQ and Nameko.md diff --git a/published/20160425 How to Use Awk to Print Fields and Columns in File.md b/published/201607/20160425 How to Use Awk to Print Fields and Columns in File.md similarity index 100% rename from published/20160425 How to Use Awk to Print Fields and Columns in File.md rename to published/201607/20160425 How to Use Awk to Print Fields and Columns in File.md diff --git a/published/20160511 An introduction to data processing with Cassandra and Spark.md b/published/201607/20160511 An introduction to data processing with Cassandra and Spark.md similarity index 100% rename from published/20160511 An introduction to data processing with Cassandra and Spark.md rename to published/201607/20160511 An introduction to data processing with Cassandra and Spark.md diff --git a/published/20160519 The future of sharing integrating Pydio and ownCloud.md b/published/201607/20160519 The future of sharing integrating Pydio and ownCloud.md similarity index 100% rename from published/20160519 The future of sharing integrating Pydio and ownCloud.md rename to published/201607/20160519 The future of sharing integrating Pydio and ownCloud.md diff --git a/published/20160527 Turn Your Old Laptop into a Chromebook.md b/published/201607/20160527 Turn Your Old Laptop into a Chromebook.md similarity index 100% rename from published/20160527 Turn Your Old Laptop into a Chromebook.md rename to published/201607/20160527 Turn Your Old Laptop into a Chromebook.md diff --git a/published/20160530 Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md b/published/201607/20160530 Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md similarity index 100% rename from published/20160530 Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md rename to published/201607/20160530 Install LEMP with MariaDB 10, PHP 7 and HTTP 2.0 Support for Nginx on Ubuntu 16.04.md diff --git a/published/20160531 HOW TO USE WEBP IMAGES IN UBUNTU LINUX.md b/published/201607/20160531 HOW TO USE WEBP IMAGES IN UBUNTU LINUX.md similarity index 100% rename from published/20160531 HOW TO USE WEBP IMAGES IN UBUNTU LINUX.md rename to published/201607/20160531 HOW TO USE WEBP IMAGES IN UBUNTU LINUX.md diff --git a/published/20160531 Why Ubuntu-based Distros Are Leaders.md b/published/201607/20160531 Why Ubuntu-based Distros Are Leaders.md similarity index 100% rename from published/20160531 Why Ubuntu-based Distros Are Leaders.md rename to published/201607/20160531 Why Ubuntu-based Distros Are Leaders.md diff --git a/published/20160602 How to mount your Google Drive on Linux with google-drive-ocamlfuse.md b/published/201607/20160602 How to mount your Google Drive on Linux with google-drive-ocamlfuse.md similarity index 100% rename from published/20160602 How to mount your Google Drive on Linux with google-drive-ocamlfuse.md rename to published/201607/20160602 How to mount your Google Drive on Linux with google-drive-ocamlfuse.md diff --git a/published/20160603 How To Install And Use VBoxManage On Ubuntu 16.04 And Use Its Command line Options.md b/published/201607/20160603 How To Install And Use VBoxManage On Ubuntu 16.04 And Use Its Command line Options.md similarity index 100% rename from published/20160603 How To Install And Use VBoxManage On Ubuntu 16.04 And Use Its Command line Options.md rename to published/201607/20160603 How To Install And Use VBoxManage On Ubuntu 16.04 And Use Its Command line Options.md diff --git a/published/20160606 Basic Git Commands You Must Know.md b/published/201607/20160606 Basic Git Commands You Must Know.md similarity index 100% rename from published/20160606 Basic Git Commands You Must Know.md rename to published/201607/20160606 Basic Git Commands You Must Know.md diff --git a/published/20160609 How to record your terminal session on Linux.md b/published/201607/20160609 How to record your terminal session on Linux.md similarity index 100% rename from published/20160609 How to record your terminal session on Linux.md rename to published/201607/20160609 How to record your terminal session on Linux.md diff --git a/published/20160609 INSTALL MATE 1.14 IN UBUNTU MATE 16.04 VIA PPA.md b/published/201607/20160609 INSTALL MATE 1.14 IN UBUNTU MATE 16.04 VIA PPA.md similarity index 100% rename from published/20160609 INSTALL MATE 1.14 IN UBUNTU MATE 16.04 VIA PPA.md rename to published/201607/20160609 INSTALL MATE 1.14 IN UBUNTU MATE 16.04 VIA PPA.md diff --git a/published/20160610 Getting started with ReactOS.md b/published/201607/20160610 Getting started with ReactOS.md similarity index 100% rename from published/20160610 Getting started with ReactOS.md rename to published/201607/20160610 Getting started with ReactOS.md diff --git a/published/20160616 10 Basic Linux Commands That Every Linux Newbies Should Remember.md b/published/201607/20160616 10 Basic Linux Commands That Every Linux Newbies Should Remember.md similarity index 100% rename from published/20160616 10 Basic Linux Commands That Every Linux Newbies Should Remember.md rename to published/201607/20160616 10 Basic Linux Commands That Every Linux Newbies Should Remember.md diff --git a/published/20160616 6 Amazing Linux Distributions For Kids.md b/published/201607/20160616 6 Amazing Linux Distributions For Kids.md similarity index 100% rename from published/20160616 6 Amazing Linux Distributions For Kids.md rename to published/201607/20160616 6 Amazing Linux Distributions For Kids.md diff --git a/published/20160620 Detecting cats in images with OpenCV.md b/published/201607/20160620 Detecting cats in images with OpenCV.md similarity index 100% rename from published/20160620 Detecting cats in images with OpenCV.md rename to published/201607/20160620 Detecting cats in images with OpenCV.md diff --git a/published/20160620 Monitor Linux With Netdata.md b/published/201607/20160620 Monitor Linux With Netdata.md similarity index 100% rename from published/20160620 Monitor Linux With Netdata.md rename to published/201607/20160620 Monitor Linux With Netdata.md diff --git a/published/20160620 PowerPC gains an Android 4.4 port with Big Endian support.md b/published/201607/20160620 PowerPC gains an Android 4.4 port with Big Endian support.md similarity index 100% rename from published/20160620 PowerPC gains an Android 4.4 port with Big Endian support.md rename to published/201607/20160620 PowerPC gains an Android 4.4 port with Big Endian support.md diff --git a/published/20160621 Container technologies in Fedora - systemd-nspawn.md b/published/201607/20160621 Container technologies in Fedora - systemd-nspawn.md similarity index 100% rename from published/20160621 Container technologies in Fedora - systemd-nspawn.md rename to published/201607/20160621 Container technologies in Fedora - systemd-nspawn.md diff --git a/published/20160624 How to permanently mount a Windows share on Linux.md b/published/201607/20160624 How to permanently mount a Windows share on Linux.md similarity index 100% rename from published/20160624 How to permanently mount a Windows share on Linux.md rename to published/201607/20160624 How to permanently mount a Windows share on Linux.md diff --git a/published/20160624 IT runs on the cloud and the cloud runs on Linux. Any questions.md b/published/201607/20160624 IT runs on the cloud and the cloud runs on Linux. Any questions.md similarity index 100% rename from published/20160624 IT runs on the cloud and the cloud runs on Linux. Any questions.md rename to published/201607/20160624 IT runs on the cloud and the cloud runs on Linux. Any questions.md diff --git a/published/20160624 Industrial SBC builds on Raspberry Pi Compute Module.md b/published/201607/20160624 Industrial SBC builds on Raspberry Pi Compute Module.md similarity index 100% rename from published/20160624 Industrial SBC builds on Raspberry Pi Compute Module.md rename to published/201607/20160624 Industrial SBC builds on Raspberry Pi Compute Module.md diff --git a/published/20160625 How to Hide Linux Command Line History by Going Incognito.md b/published/201607/20160625 How to Hide Linux Command Line History by Going Incognito.md similarity index 100% rename from published/20160625 How to Hide Linux Command Line History by Going Incognito.md rename to published/201607/20160625 How to Hide Linux Command Line History by Going Incognito.md diff --git a/published/20160628 How To Setup Open Source Discussion Platform Discourse On Ubuntu Linux 16.04.md b/published/201607/20160628 How To Setup Open Source Discussion Platform Discourse On Ubuntu Linux 16.04.md similarity index 100% rename from published/20160628 How To Setup Open Source Discussion Platform Discourse On Ubuntu Linux 16.04.md rename to published/201607/20160628 How To Setup Open Source Discussion Platform Discourse On Ubuntu Linux 16.04.md diff --git a/published/20160629 USE TASK MANAGER EQUIVALENT IN LINUX.md b/published/201607/20160629 USE TASK MANAGER EQUIVALENT IN LINUX.md similarity index 100% rename from published/20160629 USE TASK MANAGER EQUIVALENT IN LINUX.md rename to published/201607/20160629 USE TASK MANAGER EQUIVALENT IN LINUX.md diff --git a/published/20160630 What makes up the Fedora kernel.md b/published/201607/20160630 What makes up the Fedora kernel.md similarity index 100% rename from published/20160630 What makes up the Fedora kernel.md rename to published/201607/20160630 What makes up the Fedora kernel.md diff --git a/published/20160701 How To Setup Bridge (br0) Network on Ubuntu Linux 14.04 and 16.04 LTS.md b/published/201607/20160701 How To Setup Bridge (br0) Network on Ubuntu Linux 14.04 and 16.04 LTS.md similarity index 100% rename from published/20160701 How To Setup Bridge (br0) Network on Ubuntu Linux 14.04 and 16.04 LTS.md rename to published/201607/20160701 How To Setup Bridge (br0) Network on Ubuntu Linux 14.04 and 16.04 LTS.md diff --git a/published/20160705 Create Your Own Shell in Python - Part I.md b/published/201607/20160705 Create Your Own Shell in Python - Part I.md similarity index 100% rename from published/20160705 Create Your Own Shell in Python - Part I.md rename to published/201607/20160705 Create Your Own Shell in Python - Part I.md diff --git a/published/20160706 Create Your Own Shell in Python - Part II.md b/published/201607/20160706 Create Your Own Shell in Python - Part II.md similarity index 100% rename from published/20160706 Create Your Own Shell in Python - Part II.md rename to published/201607/20160706 Create Your Own Shell in Python - Part II.md diff --git a/published/20160708 Using Vagrant to control your DigitalOcean cloud instances.md b/published/201607/20160708 Using Vagrant to control your DigitalOcean cloud instances.md similarity index 100% rename from published/20160708 Using Vagrant to control your DigitalOcean cloud instances.md rename to published/201607/20160708 Using Vagrant to control your DigitalOcean cloud instances.md diff --git a/published/20160718 OPEN SOURCE ACCOUNTING SOFTWARE.md b/published/201607/20160718 OPEN SOURCE ACCOUNTING SOFTWARE.md similarity index 100% rename from published/20160718 OPEN SOURCE ACCOUNTING SOFTWARE.md rename to published/201607/20160718 OPEN SOURCE ACCOUNTING SOFTWARE.md diff --git a/published/20160721 YOU CAN TRY A DEMO UBUNTU VERSION IN A WEB BROWSER.md b/published/201607/20160721 YOU CAN TRY A DEMO UBUNTU VERSION IN A WEB BROWSER.md similarity index 100% rename from published/20160721 YOU CAN TRY A DEMO UBUNTU VERSION IN A WEB BROWSER.md rename to published/201607/20160721 YOU CAN TRY A DEMO UBUNTU VERSION IN A WEB BROWSER.md diff --git a/published/20160722 7 Best Markdown Editors for Linux.md b/published/201607/20160722 7 Best Markdown Editors for Linux.md similarity index 100% rename from published/20160722 7 Best Markdown Editors for Linux.md rename to published/201607/20160722 7 Best Markdown Editors for Linux.md diff --git a/published/20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md b/published/201607/20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md similarity index 100% rename from published/20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md rename to published/201607/20160722 HOW TO CHANGE DEFAULT APPLICATIONS IN UBUNTU.md diff --git a/published/20160722 Terminix – A New GTK 3 Tiling Terminal Emulator for Linux.md b/published/201607/20160722 Terminix – A New GTK 3 Tiling Terminal Emulator for Linux.md similarity index 100% rename from published/20160722 Terminix – A New GTK 3 Tiling Terminal Emulator for Linux.md rename to published/201607/20160722 Terminix – A New GTK 3 Tiling Terminal Emulator for Linux.md diff --git a/published/20160726 Set a Real Time Photo of Earth as Your Linux Desktop Wallpaper.md b/published/201607/20160726 Set a Real Time Photo of Earth as Your Linux Desktop Wallpaper.md similarity index 100% rename from published/20160726 Set a Real Time Photo of Earth as Your Linux Desktop Wallpaper.md rename to published/201607/20160726 Set a Real Time Photo of Earth as Your Linux Desktop Wallpaper.md From ac0320c3f9ec1358316d0f4a022b7c848c6bf3ce Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 1 Aug 2016 07:25:42 +0800 Subject: [PATCH 1323/1469] PUB:20160706 What is Git MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @cvsher 这篇翻译的很用心,很好! --- published/20160706 What is Git.md | 118 ++++++++++++++++++++++++ translated/tech/20160706 What is Git.md | 118 ------------------------ 2 files changed, 118 insertions(+), 118 deletions(-) create mode 100644 published/20160706 What is Git.md delete mode 100644 translated/tech/20160706 What is Git.md diff --git a/published/20160706 What is Git.md b/published/20160706 What is Git.md new file mode 100644 index 0000000000..f0fa7dded8 --- /dev/null +++ b/published/20160706 What is Git.md @@ -0,0 +1,118 @@ +Git 系列(一):什么是 Git +=========== + +欢迎阅读本系列关于如何使用 Git 版本控制系统的教程!通过本文的介绍,你将会了解到 Git 的用途及谁该使用 Git。 + +如果你刚步入开源的世界,你很有可能会遇到一些在 Git 上托管代码或者发布使用版本的开源软件。事实上,不管你知道与否,你都在使用基于 Git 进行版本管理的软件:Linux 内核(就算你没有在手机或者电脑上使用 Linux,你正在访问的网站也是运行在 Linux 系统上的),Firefox、Chrome 等其他很多项目都通过 Git 代码库和世界各地开发者共享他们的代码。 + +换个角度来说,你是否仅仅通过 Git 就可以和其他人共享你的代码?你是否可以在家里或者企业里私有化的使用 Git?你必须要通过一个 GitHub 账号来使用 Git 吗?为什么要使用 Git 呢?Git 的优势又是什么?Git 是我唯一的选择吗?这对 Git 所有的疑问都会把我们搞的一脑浆糊。 + +因此,忘记你以前所知的 Git,让我们重新走进 Git 世界的大门。 + +### 什么是版本控制系统? + +Git 首先是一个版本控制系统。现在市面上有很多不同的版本控制系统:CVS、SVN、Mercurial、Fossil 当然还有 Git。 + +很多像 GitHub 和 GitLab 这样的服务是以 Git 为基础的,但是你也可以只使用 Git 而无需使用其他额外的服务。这意味着你可以以私有或者公有的方式来使用 Git。 + +如果你曾经和其他人有过任何电子文件方面的合作,你就会知道传统版本管理的工作流程。开始是很简单的:你有一个原始的版本,你把这个版本发送给你的同事,他们在接收到的版本上做了些修改,现在你们有两个版本了,然后他们把他们手上修改过的版本发回来给你。你把他们的修改合并到你手上的版本中,现在两个版本又合并成一个最新的版本了。 + +然后,你修改了你手上最新的版本,同时,你的同事也修改了他们手上合并前的版本。现在你们有 3 个不同的版本了,分别是合并后最新的版本,你修改后的版本,你同事手上继续修改过的版本。至此,你们的版本管理工作开始变得越来越混乱了。 + +正如 Jason van Gumster 在他的文章中指出 [即使是艺术家也需要版本控制][1],而且已经在个别人那里发现了这种趋势变化。无论是艺术家还是科学家,开发一个某种实验版本是并不鲜见的;在你的项目中,可能有某个版本大获成功,把项目推向一个新的高度,也可能有某个版本惨遭失败。因此,最终你不可避免的会创建出一堆名为project\_justTesting.kdenlive、project\_betterVersion.kdenlive、project\_best\_FINAL.kdenlive、project\_FINAL-alternateVersion.kdenlive 等类似名称的文件。 + +不管你是修改一个 for 循环,还是一些简单的文本编辑,一个好的版本控制系统都会让我们的生活更加的轻松。 + +### Git 快照 + +Git 可以为项目创建快照,并且存储这些快照为唯一的版本。 + +如果你将项目带领到了一个错误的方向上,你可以回退到上一个正确的版本,并且开始尝试另一个可行的方向。 + +如果你是和别人合作开发,当有人向你发送他们的修改时,你可以将这些修改合并到你的工作分支中,然后你的同事就可以获取到合并后的最新版本,并在此基础上继续工作。 + +Git 并不是魔法,因此冲突还是会发生的(“你修改了某文件的最后一行,但是我把这行整行都删除了;我们怎样处理这些冲突呢?”),但是总体而言,Git 会为你保留了所有更改的历史版本,甚至允许并行版本。这为你保留了以任何方式处理冲突的能力。 + +### 分布式 Git + +在不同的机器上为同一个项目工作是一件复杂的事情。因为在你开始工作时,你想要获得项目的最新版本,然后此基础上进行修改,最后向你的同事共享这些改动。传统的方法是通过笨重的在线文件共享服务或者老旧的电邮附件,但是这两种方式都是效率低下且容易出错。 + +Git 天生是为分布式工作设计的。如果你要参与到某个项目中,你可以克隆(clone)该项目的 Git 仓库,然后就像这个项目只有你本地一个版本一样对项目进行修改。最后使用一些简单的命令你就可以拉取(pull)其他开发者的修改,或者你可以把你的修改推送(push)给别人。现在不用担心谁手上的是最新的版本,或者谁的版本又存放在哪里等这些问题了。全部人都是在本地进行开发,然后向共同的目标推送或者拉取更新。(或者不是共同的目标,这取决于项目的开发方式)。 + +### Git 界面 + +最原始的 Git 是运行在 Linux 终端上的应用软件。然而,得益于 Git 是开源的,并且拥有良好的设计,世界各地的开发者都可以为 Git 设计不同的访问界面。 + +Git 完全是免费的,并且已经打包在 Linux,BSD,Illumos 和其他类 Unix 系统中,Git 命令看起来像这样: + +``` +$ git --version +git version 2.5.3 +``` + +可能最著名的 Git 访问界面是基于网页的,像 GitHub、开源的 GitLab、Savannah、BitBucket 和 SourceForge 这些网站都是基于网页端的 Git 界面。这些站点为面向公众和面向社会的开源软件提供了最大限度的代码托管服务。在一定程度上,基于浏览器的图形界面(GUI)可以尽量的减缓 Git 的学习曲线。下面的 GitLab 界面的截图: + +![](https://opensource.com/sites/default/files/0_gitlab.png) + +再者,第三方 Git 服务提供商或者独立开发者甚至可以在 Git 的基础上开发出不是基于 HTML 的定制化前端界面。此类界面让你可以不用打开浏览器就可以方便的使用 Git 进行版本管理。其中对用户最透明的方式是直接集成到文件管理器中。KDE 文件管理器 Dolphin 可以直接在目录中显示 Git 状态,甚至支持提交,推送和拉取更新操作。 + +![](https://opensource.com/sites/default/files/0_dolphin.jpg) + +[Sparkleshare][2] 使用 Git 作为其 Dropbox 式的文件共享界面的基础。 + +![](https://opensource.com/sites/default/files/0_sparkleshare_1.jpg) + +想了解更多的内容,可以查看 [Git wiki][3],这个(长长的)页面中展示了很多 Git 的图形界面项目。 + +### 谁应该使用 Git? + +就是你!我们更应该关心的问题是什么时候使用 Git?和用 Git 来干嘛? + +### 我应该在什么时候使用 Git 呢?我要用 Git 来干嘛呢? + +想更深入的学习 Git,我们必须比平常考虑更多关于文件格式的问题。 + +Git 是为了管理源代码而设计的,在大多数编程语言中,源代码就意味者一行行的文本。当然,Git 并不知道你把这些文本当成是源代码还是下一部伟大的美式小说。因此,只要文件内容是以文本构成的,使用 Git 来跟踪和管理其版本就是一个很好的选择了。 + +但是什么是文本呢?如果你在像 Libre Office 这类办公软件中编辑一些内容,通常并不会产生纯文本内容。因为通常复杂的应用软件都会对原始的文本内容进行一层封装,就如把原始文本内容用 XML 标记语言包装起来,然后封装在 Zip 包中。这种对原始文本内容进行一层封装的做法可以保证当你把文件发送给其他人时,他们可以看到你在办公软件中编辑的内容及特定的文本效果。奇怪的是,虽然,通常你的需求可能会很复杂,就像保存 [Kdenlive][4] 项目文件,或者保存从 [Inkscape][5] 导出的SVG文件,但是,事实上使用 Git 管理像 XML 文本这样的纯文本类容是最简单的。 + +如果你在使用 Unix 系统,你可以使用 `file` 命令来查看文件内容构成: + +``` +$ file ~/path/to/my-file.blah +my-file.blah: ASCII text +$ file ~/path/to/different-file.kra: Zip data (MIME type "application/x-krita") +``` + +如果还是不确定,你可以使用 `head` 命令来查看文件内容: + +``` +$ head ~/path/to/my-file.blah +``` + +如果输出的文本你基本能看懂,这个文件就很有可能是文本文件。如果你仅仅在一堆乱码中偶尔看到几个熟悉的字符,那么这个文件就可能不是文本文件了。 + +准确的说:Git 可以管理其他格式的文件,但是它会把这些文件当成二进制大对象(blob)。两者的区别是,在文本文件中,Git 可以明确的告诉你在这两个快照(或者说提交)间有 3 行是修改过的。但是如果你在两个提交(commit)之间对一张图片进行的编辑操作,Git 会怎么指出这种修改呢?实际上,因为图片并不是以某种可以增加或删除的有意义的文本构成,因此 Git 并不能明确的描述这种变化。当然我个人是非常希望图片的编辑可以像把文本“\丑陋的蓝绿色\”修改成“\漂浮着蓬松白云的天蓝色\”一样的简单,但是事实上图片的编辑并没有这么简单。 + +经常有人在 Git 上放入 png 图标、电子表格或者流程图这类二进制大型对象(blob)。尽管,我们知道在 Git 上管理此类大型文件并不直观,但是,如果你需要使用 Git 来管理此类文件,你也并不需要过多的担心。如果你参与的项目同时生成文本文件和二进制大文件对象(如视频游戏中常见的场景,这些和源代码同样重要的图像和音频材料),那么你有两条路可以走:要么开发出你自己的解决方案,就如使用指向共享网络驱动器的引用;要么使用 Git 插件,如 Joey Hess 开发的 [git annex][6],以及 [Git-Media][7] 项目。 + +你看,Git 真的是一个任何人都可以使用的工具。它是你进行文件版本管理的一个强大而且好用工具,同时它并没有你开始认为的那么可怕。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/resources/what-is-git + +作者:[Seth Kenlon][a] +译者:[cvsher](https://github.com/cvsher) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[1]: https://opensource.com/life/16/2/version-control-isnt-just-programmers +[2]: http://sparkleshare.org/ +[3]: https://git.wiki.kernel.org/index.php/InterfacesFrontendsAndTools#Graphical_Interfaces +[4]: https://opensource.com/life/11/11/introduction-kdenlive +[5]: http://inkscape.org/ +[6]: https://git-annex.branchable.com/ +[7]: https://github.com/alebedev/git-media diff --git a/translated/tech/20160706 What is Git.md b/translated/tech/20160706 What is Git.md deleted file mode 100644 index f2f01b8d39..0000000000 --- a/translated/tech/20160706 What is Git.md +++ /dev/null @@ -1,118 +0,0 @@ -什么是Git -=========== - -欢迎阅读本系列关于Git版本控制系统的教程!通过本文的介绍,你将会了解到Git的用途及谁该使用Git。 - -如果你刚步入开源的世界,你很有可能会遇到一些在Git上托管代码或者发布使用版本的开源软件。事实上,不管你知道与否,你都在使用基于Git进行版本管理的软件:linux内核(就算你没有在手机或者电脑上使用linux,你正在访问的网站也是运行在linux系统上的),Firefox,Chrome等其他很多项目都在Git上和世界各地开发者共享他们的代码。 - -换个角度来说,你是否仅仅通过Git就可以和其他人共享你的代码?你是否可以在家里或者企业里私有化的使用Git?你必须要通过一个GitHub账号来使用Git吗?为什么要使用Git呢?Git的优势又是什么?Git是我唯一的选择吗?这对Git所有的疑问都会把我们搞的一脑浆糊。 - -因此,忘记你以前所知的Git,我们从新走进Git世界的大门。 - -### 什么是版本控制系统? - -现在市面上有很多不同的版本控制系统:CVS,SVN,Mercurial,Fossil 当然还有 Git。 - -很多像 GitHub 和 GitLab 这样的服务是以Git为基础的,但是你也可以只使用Git而无需使用其他额外的服务。这意味着你可以以私有或者公有的方式来使用Git。 - -如果你曾经和其他人有过任何数字方面的合作,你就会知道传统版本管理的工作流程。开始是很简单的:你有一个原始的版本,你把这个版本发送给你的同事,他们在接收到的版本上做了些修改,现在你们有两个版本了,然后他们把他们手上修改过的版本发回来给你。你把他们的修改合并到你手上的版本中,现在两个版本又合并成一个最新的版本了。 - -然后,你修改了你手上最新的版本,同时,你的同事也修改了他们手上合并前的版本。现在你们有3个不同的版本了,分别是合并后最新的版本,你修改后的版本,你同事手上继续修改过的版本。至此,你们的版本管理工作开始变得越来越混乱了。 - -正如 Jason van Gumster 在他的文章中指出 [即使是艺术家也需要版本控制][1],而且这也有向个人设置方向发展的趋势。无论是艺术家还是科学家,在一些想法上开发出实验版本都是比较常见的;在你的项目中,可能有某个版本大获成功,把项目推向一个新的高度,也可能有某个版本惨遭失败。因此,最终你不可避免的会创建出一堆名为project_justTesting.kdenlive、project_betterVersion.kdenlive、project_best_FINAL.kdenlive、project_FINAL-alternateVersion.kdenlive等类似名称的文件。 - -不管你是修改一个for循环,还是一些简单的文本编辑,一个好的版本控制系统都会让我们的生活更加的轻松。 - -### Git快照 - -Git会为每个项目创建快照,并且为项目的每个版本都保存一个唯一的快照。 - -如果你将项目带领到了一个错误的方向上,你可以回退到上一个正确的版本,并且 开始尝试另一个可行的方向。 - -如果你是和别人合作开发,当有人向你发送他们的修改时,你可以将这些修改合并到你的工作分支中,然后你的同事就可以获取到合并后的最新版本,并在此基础上继续工作。 - -Git并不是魔法,因此冲突还是会发生的(“你修改了某文件的最后一行,但是我把这行整行都删除了;我们怎样处理这些冲突呢?”),但是总体而言,Git会为你保留了所有更改的历史版本,甚至允许并行版本。这为你保留了以任何方式处理冲突的能力。 - -### 分布式Git - -在不同的机器上为同一个项目工作是一件复杂的事情。因为在你开始工作时,你想要获得项目的最新版本,然后此基础上进行修改,最后向你的同事共享这些改动。传统的方法是通过笨重的在线文件共享服务或者老旧的电邮附件,但是这两种方式都是效率低下且容易出错。 - -Git天生是为分布式工作设计的。如果你要参与到某个项目中,你可以克隆(clone)该项目的Git仓库,然后就像这个项目只有你本地一个版本一样对项目进行修改。最后使用一些简单的命令你就可以拉取(pull)其他开发者的修改,或者你可以把你的修改推送(push)给别人。现在不用担心谁手上的是最新的版本,或者谁的版本又存放在哪里等这些问题了。全部人都是在本地进行开发,然后向共同的目标推送或者拉取更新。(或者不是共同的目标,这取决于项目的开发方式)。 - -### Git 界面 - -最原始的Git是运行在Linux终端上的应用软件。然而,得益于Git是开源的,并且拥有良好的设计,世界各地的开发者都可以为Git设计不同的接入界面。 - -Git完全是免费的,并且附带在Linux,BSD,Illumos 和其他类unix系统中,Git命令看起来像: - -``` -$ git --version -git version 2.5.3 -``` - -可能最著名的Git访问界面是基于网页的,像GitHub,开源的GitLab,Savannah,BitBucket和SourceForge这些网站都是基于网页端的Git界面。这些站点为面向公众和面向社会的开源软件提供了最大限度的代码托管服务。在一定程度上,基于浏览器的图形界面(GUI)可以尽量的减缓Git的学习曲线。下面的GitLab接口的截图: - -![](https://opensource.com/sites/default/files/0_gitlab.png) - -再者,第三方Git服务提供商或者独立开发者甚至可以在Git的基础上开发出不是基于HTML的定制化前端接口。此类接口让你可以不用打开浏览器就可以方便的使用Git进行版本管理。其中对用户最透明的方式是直接集成到文件管理器中。KDE文件管理器,Dolphin 可以直接在目录中显示Git状态,甚至支持提交,推送和拉取更新操作。 - -![](https://opensource.com/sites/default/files/0_dolphin.jpg) - -[Sparkleshare][2]使用Git作为其Dropbox类文件共享接口的基础。 - -![](https://opensource.com/sites/default/files/0_sparkleshare_1.jpg) - -想了解更多的内容,可以查看[Git wiki][3],此页面中展示了很多Git的图形界面项目。 - -### 谁应该使用Git? - -就是你!我们更应该关心的问题是什么时候使用Git?和用Git来干嘛? - -### 我应该在什么时候使用Git呢?我要用Git来干嘛呢? - -想更深入的学习Git,我们必须比平常考虑更多关于文件格式的问题。 - -Git是为了管理源代码而设计的,在大多数编程语言中,源代码就意味者一行行的文本。当然,Git并不知道你把这些文本当成是源代码还是下一部伟大的美式小说。因此,只要文件内容是以文本构成的,使用Git来跟踪和管理其版本就是一个很好的选择了。 - -但是什么是文本呢?如果你在像Libre Office这类办公软件中编辑一些内容,通常并不会产生纯文本内容。因为通常复杂的应用软件都会对原始的文本内容进行一层封装,就如把原始文本内容用XML标记语言包装起来,然后封装在Zip容器中。这种对原始文本内容进行一层封装的做法可以保证当你把文件发送给其他人时,他们可以看到你在办公软件中编辑的内容及特定的文本效果。奇怪的是,虽然,通常你的需求可能会很复杂,就像保存[Kdenlive][4]项目文件,或者保存从[Inkscape][5]导出的SVG文件,但是,事实上使用Git管理像XML文本这样的纯文本类容是最简单的。 - -如果你在使用Unix系统,你可以使用 file 命令来查看文件内容构成: - -``` -$ file ~/path/to/my-file.blah -my-file.blah: ASCII text -$ file ~/path/to/different-file.kra: Zip data (MIME type "application/x-krita") -``` - -如果还是不确定,你可以使用 head 命令来查看文件内容: - -``` -$ head ~/path/to/my-file.blah -``` - -如果输出的文本你基本能看懂,这个文件就很有可能是文本文件。如果你仅仅在一堆乱码中偶尔看到几个熟悉的字符,那么这个文件就可能不是文本文件了。 - -准确的说:Git可以管理其他格式的文件,但是它会把这些文件当成二进制大对象(blob)。两者的区别是,在文本文件中,Git可以明确的告诉你在这两个快照(或者说提交)间有3行是修改过的。但是如果你在两个提交间对一张图片进行的编辑操作,Git会怎么指出这种修改呢?实际上,因为图片并不是以某种可以增加或删除的有意义的文本构成,因此Git并不能明确的描述这种变化。当然我个人是非常希望图片的编辑可以像把本文"丑陋的蓝绿色"修改成"漂浮着蓬松白云的天蓝色"一样的简单,但是事实上图片的编辑并没有这么简单。 - -经常有人在Git上记录png图标、电子表格或者流程图这类二进制大型对象。尽管,我们知道在Git上管理此类大型文件并不直观,但是,如果你需要使用Git来管理此类文件,你也并不需要过多的担心。如果你参与的项目同时生成文本文件和二进制大文件对象(如视频游戏中常见的场景,这些和源代码同样重要的图像和音频材料),那么你有两条路可以走:要么开发出你自己的解决方案,就如使用指向共享网络驱动器的指针;要么使用Git插件,如Joey Hess开发的[git annex][6], 或者 [Git-Media][7] 项目。 - -你看,Git真的是一个任何人都可以使用的工具。它是你进行文件版本管理的一个强大而且好用工具,同时它并没有你开始认为的那么可怕。 - --------------------------------------------------------------------------------- - -via: https://opensource.com/resources/what-is-git - -作者:[Seth Kenlon ][a] -译者:[cvsher](https://github.com/cvsher) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[1]: https://opensource.com/life/16/2/version-control-isnt-just-programmers -[2]: http://sparkleshare.org/ -[3]: https://git.wiki.kernel.org/index.php/InterfacesFrontendsAndTools#Graphical_Interfaces -[4]: https://opensource.com/life/11/11/introduction-kdenlive -[5]: http://inkscape.org/ -[6]: https://git-annex.branchable.com/ -[7]: https://github.com/alebedev/git-media From 3b3cea5dc788eb6f20a20a927509e86c0ea76cf5 Mon Sep 17 00:00:00 2001 From: may Date: Mon, 1 Aug 2016 08:58:56 +0800 Subject: [PATCH 1324/1469] translating by maywanting --- sources/talk/20160620 5 SSH Hardening Tips.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/talk/20160620 5 SSH Hardening Tips.md b/sources/talk/20160620 5 SSH Hardening Tips.md index ad6741ab26..e1a7353807 100644 --- a/sources/talk/20160620 5 SSH Hardening Tips.md +++ b/sources/talk/20160620 5 SSH Hardening Tips.md @@ -1,3 +1,5 @@ +translating by maywanting + 5 SSH Hardening Tips ====================== From 7047bb29cf12b05c2b15c8a348b2ac5cb7a6432a Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 1 Aug 2016 07:42:23 +0800 Subject: [PATCH 1325/1469] PUB:20160705 How to Encrypt a Flash Drive Using VeraCrypt @GitFuture --- ...o Encrypt a Flash Drive Using VeraCrypt.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) rename {translated/tech => published}/20160705 How to Encrypt a Flash Drive Using VeraCrypt.md (72%) diff --git a/translated/tech/20160705 How to Encrypt a Flash Drive Using VeraCrypt.md b/published/20160705 How to Encrypt a Flash Drive Using VeraCrypt.md similarity index 72% rename from translated/tech/20160705 How to Encrypt a Flash Drive Using VeraCrypt.md rename to published/20160705 How to Encrypt a Flash Drive Using VeraCrypt.md index a049bfd73c..71a2e01a24 100644 --- a/translated/tech/20160705 How to Encrypt a Flash Drive Using VeraCrypt.md +++ b/published/20160705 How to Encrypt a Flash Drive Using VeraCrypt.md @@ -1,29 +1,29 @@ 用 VeraCrypt 加密闪存盘 ============================================ -很多安全专家偏好像 VeraCrypt 这类能够用来加密闪存盘的开源软件。因为获取它的源代码很简单。 +很多安全专家偏好像 VeraCrypt 这类能够用来加密闪存盘的开源软件,是因为可以获取到它的源代码。 -保护 USB闪存盘里的数据,加密是一个聪明的方法,正如我们在使用 Microsoft 的 BitLocker [加密闪存盘][1] 一文中提到的。 +保护 USB 闪存盘里的数据,加密是一个聪明的方法,正如我们在使用 Microsoft 的 BitLocker [加密闪存盘][1] 一文中提到的。 但是如果你不想用 BitLocker 呢? -你可能有顾虑,因为你不能够查看 Microsoft 的程序源码,那么它容易被植入用于政府或其它用途的“后门”。由于开源软件的源码是公开的,很多安全专家认为开源软件很少藏有后门。 +你可能有顾虑,因为你不能够查看 Microsoft 的程序源码,那么它容易被植入用于政府或其它用途的“后门”。而由于开源软件的源码是公开的,很多安全专家认为开源软件很少藏有后门。 还好,有几个开源加密软件能作为 BitLocker 的替代。 要是你需要在 Windows 系统,苹果的 OS X 系统或者 Linux 系统上加密以及访问文件,开源软件 [VeraCrypt][2] 提供绝佳的选择。 -VeraCrypt 源于 TrueCrypt。TrueCrypt是一个备受好评的开源加密软件,尽管它现在已经停止维护了。但是 TrueCrypt 的代码通过了审核,没有发现什么重要的安全漏洞。另外,它已经在 VeraCrypt 中进行了改善。 +VeraCrypt 源于 TrueCrypt。TrueCrypt 是一个备受好评的开源加密软件,尽管它现在已经停止维护了。但是 TrueCrypt 的代码通过了审核,没有发现什么重要的安全漏洞。另外,在 VeraCrypt 中对它进行了改善。 Windows,OS X 和 Linux 系统的版本都有。 -用 VeraCrypt 加密 USB 闪存盘不像用 BitLocker 那么简单,但是它只要几分钟就好了。 +用 VeraCrypt 加密 USB 闪存盘不像用 BitLocker 那么简单,但是它也只要几分钟就好了。 ### 用 VeraCrypt 加密闪存盘的 8 个步骤 -对应操作系统 [下载 VeraCrypt][3] 之后: +对应你的操作系统 [下载 VeraCrypt][3] 之后: -打开 VeraCrypt,点击 Create Volume,进入 VeraCrypt 的创建卷的向导程序(VeraCrypt Volume Creation Wizard)。(注:VeraCrypt Volume Creation Wizard 首字母全大写,不清楚是否需要翻译,之后有很多首字母大写的词,都以括号标出) +打开 VeraCrypt,点击 Create Volume,进入 VeraCrypt 的创建卷的向导程序(VeraCrypt Volume Creation Wizard)。 ![](http://www.esecurityplanet.com/imagesvr_ce/6246/Vera0.jpg) @@ -39,7 +39,7 @@ VeraCrypt 创建卷向导(VeraCrypt Volume Creation Wizard)允许你在闪 ![](http://www.esecurityplanet.com/imagesvr_ce/9427/Vera3.jpg) -选择创建卷标模式(Volume Creation Mode)。如果你的闪存盘是空的,或者你想要删除它里面的所有东西,选第一个。要么你想保持所有现存的文件,选第二个就好了。 +选择创建卷模式(Volume Creation Mode)。如果你的闪存盘是空的,或者你想要删除它里面的所有东西,选第一个。要么你想保持所有现存的文件,选第二个就好了。 ![](http://www.esecurityplanet.com/imagesvr_ce/7828/Vera4.jpg) @@ -47,7 +47,7 @@ VeraCrypt 创建卷向导(VeraCrypt Volume Creation Wizard)允许你在闪 ![](http://www.esecurityplanet.com/imagesvr_ce/5918/Vera5.jpg) -确定了卷标容量后,输入并确认你想要用来加密数据密码。 +确定了卷容量后,输入并确认你想要用来加密数据密码。 ![](http://www.esecurityplanet.com/imagesvr_ce/3850/Vera6.jpg) @@ -71,7 +71,7 @@ VeraCrypt 创建卷向导(VeraCrypt Volume Creation Wizard)允许你在闪 ### VeraCrypt 移动硬盘安装步骤 -如果你设置闪存盘的时候,选择的是加密过的容器而不是加密整个盘,你可以选择创建 VeraCrypt 称为移动盘(Traveler Disk)的设备。这会复制安装一个 VeraCrypt 在 USB 闪存盘。当你在别的 Windows 电脑上插入 U 盘时,就能从 U 盘自动运行 VeraCrypt;也就是说没必要在新电脑上安装 VeraCrypt。 +如果你设置闪存盘的时候,选择的是加密过的容器而不是加密整个盘,你可以选择创建 VeraCrypt 称为移动盘(Traveler Disk)的设备。这会复制安装一个 VeraCrypt 到 USB 闪存盘。当你在别的 Windows 电脑上插入 U 盘时,就能从 U 盘自动运行 VeraCrypt;也就是说没必要在新电脑上安装 VeraCrypt。 你可以设置闪存盘作为一个移动硬盘(Traveler Disk),在 VeraCrypt 的工具栏(Tools)菜单里选择 Traveler Disk SetUp 就行了。 @@ -79,15 +79,15 @@ VeraCrypt 创建卷向导(VeraCrypt Volume Creation Wizard)允许你在闪 要从移动盘(Traveler Disk)上运行 VeraCrypt,你必须要有那台电脑的管理员权限,这不足为奇。尽管这看起来是个限制,机密文件无法在不受控制的电脑上安全打开,比如在一个商务中心的电脑上。 ->Paul Rubens 从事技术行业已经超过 20 年。这期间他为英国和国际主要的出版社,包括 《The Economist》《The Times》《Financial Times》《The BBC》《Computing》和《ServerWatch》等出版社写过文章, +> 本文作者 Paul Rubens 从事技术行业已经超过 20 年。这期间他为英国和国际主要的出版社,包括 《The Economist》《The Times》《Financial Times》《The BBC》《Computing》和《ServerWatch》等出版社写过文章, -------------------------------------------------------------------------------- via: http://www.esecurityplanet.com/open-source-security/how-to-encrypt-flash-drive-using-veracrypt.html -作者:[Paul Rubens ][a] +作者:[Paul Rubens][a] 译者:[GitFuture](https://github.com/GitFuture) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 6da38f56d75ba8092dbdd3690459cdc3839393d8 Mon Sep 17 00:00:00 2001 From: ezio Date: Mon, 1 Aug 2016 21:06:19 +0800 Subject: [PATCH 1326/1469] =?UTF-8?q?=E7=BB=84=E9=98=9F=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=20Building=20a=20data=20science=20portfolio=20-=20Machine=20le?= =?UTF-8?q?arning=20project?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/team_test/README.md | 4 + ...ce portfolio - Machine learning project.md | 79 +++++++ ...ce portfolio - Machine learning project.md | 114 ++++++++++ ...ce portfolio - Machine learning project.md | 194 ++++++++++++++++++ ...ce portfolio - Machine learning project.md | 80 ++++++++ ...ce portfolio - Machine learning project.md | 166 +++++++++++++++ ...ce portfolio - Machine learning project.md | 173 ++++++++++++++++ 7 files changed, 810 insertions(+) create mode 100644 sources/team_test/README.md create mode 100644 sources/team_test/part 1 - Building a data science portfolio - Machine learning project.md create mode 100644 sources/team_test/part 2 - Building a data science portfolio - Machine learning project.md create mode 100644 sources/team_test/part 3 - Building a data science portfolio - Machine learning project.md create mode 100644 sources/team_test/part 4 - Building a data science portfolio - Machine learning project.md create mode 100644 sources/team_test/part 5 - Building a data science portfolio - Machine learning project.md create mode 100644 sources/team_test/part 6 - Building a data science portfolio - Machine learning project.md diff --git a/sources/team_test/README.md b/sources/team_test/README.md new file mode 100644 index 0000000000..d2bdd305f8 --- /dev/null +++ b/sources/team_test/README.md @@ -0,0 +1,4 @@ +组队翻译 : 《Building a data science portfolio: Machine learning project》 +本次组织者 : @选题-oska874 +参加译者 : @译者-vim-kakali @译者-Noobfish @译者-zky001 @译者-kokialoves @译者-ideas4u @译者-cposture +分配方式 : 原文按大致长度分成 6 部分,参与者自由选择,先到先选,如有疑问联系 @选题-oska874 diff --git a/sources/team_test/part 1 - Building a data science portfolio - Machine learning project.md b/sources/team_test/part 1 - Building a data science portfolio - Machine learning project.md new file mode 100644 index 0000000000..70d9b65f92 --- /dev/null +++ b/sources/team_test/part 1 - Building a data science portfolio - Machine learning project.md @@ -0,0 +1,79 @@ +>This is the third in a series of posts on how to build a Data Science Portfolio. If you like this and want to know when the next post in the series is released, you can [subscribe at the bottom of the page][1]. + +Data science companies are increasingly looking at portfolios when making hiring decisions. One of the reasons for this is that a portfolio is the best way to judge someone’s real-world skills. The good news for you is that a portfolio is entirely within your control. If you put some work in, you can make a great portfolio that companies are impressed by. + +The first step in making a high-quality portfolio is to know what skills to demonstrate. The primary skills that companies want in data scientists, and thus the primary skills they want a portfolio to demonstrate, are: + +- Ability to communicate +- Ability to collaborate with others +- Technical competence +- Ability to reason about data +- Motivation and ability to take initiative + +Any good portfolio will be composed of multiple projects, each of which may demonstrate 1-2 of the above points. This is the third post in a series that will cover how to make a well-rounded data science portfolio. In this post, we’ll cover how to make the second project in your portfolio, and how to build an end to end machine learning project. At the end, you’ll have a project that shows your ability to reason about data, and your technical competence. [Here’s][2] the completed project if you want to take a look. + +### An end to end project + +As a data scientist, there are times when you’ll be asked to take a dataset and figure out how to [tell a story with it][3]. In times like this, it’s important to communicate very well, and walk through your process. Tools like Jupyter notebook, which we used in a previous post, are very good at helping you do this. The expectation here is that the deliverable is a presentation or document summarizing your findings. + +However, there are other times when you’ll be asked to create a project that has operational value. A project with operational value directly impacts the day-to-day operations of a company, and will be used more than once, and often by multiple people. A task like this might be “create an algorithm to forecast our churn rate”, or “create a model that can automatically tag our articles”. In cases like this, storytelling is less important than technical competence. You need to be able to take a dataset, understand it, then create a set of scripts that can process that data. It’s often important that these scripts run quickly, and use minimal system resources like memory. It’s very common that these scripts will be run several times, so the deliverable becomes the scripts themselves, not a presentation. The deliverable is often integrated into operational flows, and may even be user-facing. + +The main components of building an end to end project are: + +- Understanding the context +- Exploring the data and figuring out the nuances +- Creating a well-structured project, so its easy to integrate into operational flows +- Writing high-performance code that runs quickly and uses minimal system resources +- Documenting the installation and usage of your code well, so others can use it + +In order to effectively create a project of this kind, we’ll need to work with multiple files. Using a text editor like [Atom][4], or an IDE like [PyCharm][5] is highly recommended. These tools will allow you to jump between files, and edit files of different types, like markdown files, Python files, and csv files. Structuring your project so it’s easy to version control and upload to collaborative coding tools like [Github][6] is also useful. + +![](https://www.dataquest.io/blog/images/end_to_end/github.png) +>This project on Github. + +We’ll use our editing tools along with libraries like [Pandas][7] and [scikit-learn][8] in this post. We’ll make extensive use of Pandas [DataFrames][9], which make it easy to read in and work with tabular data in Python. + +### Finding good datasets + +A good dataset for an end to end portfolio project can be hard to find. [The dataset][10] needs to be sufficiently large that memory and performance constraints come into play. It also needs to potentially be operationally useful. For instance, this dataset, which contains data on the admission criteria, graduation rates, and graduate future earnings for US colleges would be a great dataset to use to tell a story. However, as you think about the dataset, it becomes clear that there isn’t enough nuance to build a good end to end project with it. For example, you could tell someone their potential future earnings if they went to a specific college, but that would be a quick lookup without enough nuance to demonstrate technical competence. You could also figure out if colleges with higher admissions standards tend to have graduates who earn more, but that would be more storytelling than operational. + +These memory and performance constraints tend to come into play when you have more than a gigabyte of data, and when you have some nuance to what you want to predict, which involves running algorithms over the dataset. + +A good operational dataset enables you to build a set of scripts that transform the data, and answer dynamic questions. A good example would be a dataset of stock prices. You would be able to predict the prices for the next day, and keep feeding new data to the algorithm as the markets closed. This would enable you to make trades, and potentially even profit. This wouldn’t be telling a story – it would be adding direct value. + +Some good places to find datasets like this are: + +- [/r/datasets][11] – a subreddit that has hundreds of interesting datasets. +- [Google Public Datasets][12] – public datasets available through Google BigQuery. +- [Awesome datasets][13] – a list of datasets, hosted on Github. + +As you look through these datasets, think about what questions someone might want answered with the dataset, and think if those questions are one-time (“how did housing prices correlate with the S&P 500?”), or ongoing (“can you predict the stock market?”). The key here is to find questions that are ongoing, and require the same code to be run multiple times with different inputs (different data). + +For the purposes of this post, we’ll look at [Fannie Mae Loan Data][14]. Fannie Mae is a government sponsored enterprise in the US that buys mortgage loans from other lenders. It then bundles these loans up into mortgage-backed securities and resells them. This enables lenders to make more mortgage loans, and creates more liquidity in the market. This theoretically leads to more homeownership, and better loan terms. From a borrowers perspective, things stay largely the same, though. + +Fannie Mae releases two types of data – data on loans it acquires, and data on how those loans perform over time. In the ideal case, someone borrows money from a lender, then repays the loan until the balance is zero. However, some borrowers miss multiple payments, which can cause foreclosure. Foreclosure is when the house is seized by the bank because mortgage payments cannot be made. Fannie Mae tracks which loans have missed payments on them, and which loans needed to be foreclosed on. This data is published quarterly, and lags the current date by 1 year. As of this writing, the most recent dataset that’s available is from the first quarter of 2015. + +Acquisition data, which is published when the loan is acquired by Fannie Mae, contains information on the borrower, including credit score, and information on their loan and home. Performance data, which is published every quarter after the loan is acquired, contains information on the payments being made by the borrower, and the foreclosure status, if any. A loan that is acquired may have dozens of rows in the performance data. A good way to think of this is that the acquisition data tells you that Fannie Mae now controls the loan, and the performance data contains a series of status updates on the loan. One of the status updates may tell us that the loan was foreclosed on during a certain quarter. + +![](https://www.dataquest.io/blog/images/end_to_end/foreclosure.jpg) +>A foreclosed home being sold. + +### Picking an angle + +There are a few directions we could go in with the Fannie Mae dataset. We could: + +- Try to predict the sale price of a house after it’s foreclosed on. +- Predict the payment history of a borrower. +- Figure out a score for each loan at acquisition time. + +The important thing is to stick to a single angle. Trying to focus on too many things at once will make it hard to make an effective project. It’s also important to pick an angle that has sufficient nuance. Here are examples of angles without much nuance: + +- Figuring out which banks sold loans to Fannie Mae that were foreclosed on the most. +- Figuring out trends in borrower credit scores. +- Exploring which types of homes are foreclosed on most often. +- Exploring the relationship between loan amounts and foreclosure sale prices + +All of the above angles are interesting, and would be great if we were focused on storytelling, but aren’t great fits for an operational project. + +With the Fannie Mae dataset, we’ll try to predict whether a loan will be foreclosed on in the future by only using information that was available when the loan was acquired. In effect, we’ll create a “score” for any mortgage that will tell us if Fannie Mae should buy it or not. This will give us a nice foundation to build on, and will be a great portfolio piece. + diff --git a/sources/team_test/part 2 - Building a data science portfolio - Machine learning project.md b/sources/team_test/part 2 - Building a data science portfolio - Machine learning project.md new file mode 100644 index 0000000000..2b429aaab8 --- /dev/null +++ b/sources/team_test/part 2 - Building a data science portfolio - Machine learning project.md @@ -0,0 +1,114 @@ +### Understanding the data + +Let’s take a quick look at the raw data files. Here are the first few rows of the acquisition data from quarter 1 of 2012: + +``` +100000853384|R|OTHER|4.625|280000|360|02/2012|04/2012|31|31|1|23|801|N|C|SF|1|I|CA|945||FRM| +100003735682|R|SUNTRUST MORTGAGE INC.|3.99|466000|360|01/2012|03/2012|80|80|2|30|794|N|P|SF|1|P|MD|208||FRM|788 +100006367485|C|PHH MORTGAGE CORPORATION|4|229000|360|02/2012|04/2012|67|67|2|36|802|N|R|SF|1|P|CA|959||FRM|794 +``` + +Here are the first few rows of the performance data from quarter 1 of 2012: + +``` +100000853384|03/01/2012|OTHER|4.625||0|360|359|03/2042|41860|0|N|||||||||||||||| +100000853384|04/01/2012||4.625||1|359|358|03/2042|41860|0|N|||||||||||||||| +100000853384|05/01/2012||4.625||2|358|357|03/2042|41860|0|N|||||||||||||||| +``` + +Before proceeding too far into coding, it’s useful to take some time and really understand the data. This is more critical in operational projects – because we aren’t interactively exploring the data, it can be harder to spot certain nuances unless we find them upfront. In this case, the first step is to read the materials on the Fannie Mae site: + +- [Overview][15] +- [Glossary of useful terms][16] +- [FAQs][17] +- [Columns in the Acquisition and Performance files][18] +- [Sample Acquisition data file][19] +- [Sample Performance data file][20] + +After reading through these files, we know some key facts that will help us: + +- There’s an Acquisition file and a Performance file for each quarter, starting from the year 2000 to present. There’s a 1 year lag in the data, so the most recent data is from 2015 as of this writing. +- The files are in text format, with a pipe (|) as a delimiter. +- The files don’t have headers, but we have a list of what each column is. +- All together, the files contain data on 22 million loans. +- Because the Performance files contain information on loans acquired in previous years, there will be more performance data for loans acquired in earlier years (ie loans acquired in 2014 won’t have much performance history). + +These small bits of information will save us a ton of time as we figure out how to structure our project and work with the data. + +### Structuring the project + +Before we start downloading and exploring the data, it’s important to think about how we’ll structure the project. When building an end-to-end project, our primary goals are: + +- Creating a solution that works +- Having a solution that runs quickly and uses minimal resources +- Enabling others to easily extend our work +- Making it easy for others to understand our code +- Writing as little code as possible + +In order to achieve these goals, we’ll need to structure our project well. A well structured project follows a few principles: + +- Separates data files and code files. +- Separates raw data from generated data. +- Has a README.md file that walks people through installing and using the project. +- Has a requirements.txt file that contains all the packages needed to run the project. +- Has a single settings.py file that contains any settings that are used in other files. + - For example, if you are reading the same file from multiple Python scripts, it’s useful to have them all import settings and get the file name from a centralized place. +- Has a .gitignore file that prevents large or secret files from being committed. +- Breaks each step in our task into a separate file that can be executed separately. + - For example, we may have one file for reading in the data, one for creating features, and one for making predictions. +- Stores intermediate values. For example, one script may output a file that the next script can read. + - This enables us to make changes in our data processing flow without recalculating everything. + +Our file structure will look something like this shortly: + +``` +loan-prediction +├── data +├── processed +├── .gitignore +├── README.md +├── requirements.txt +├── settings.py +``` + +### Creating the initial files + +To start with, we’ll need to create a loan-prediction folder. Inside that folder, we’ll need to make a data folder and a processed folder. The first will store our raw data, and the second will store any intermediate calculated values. + +Next, we’ll make a .gitignore file. A .gitignore file will make sure certain files are ignored by git and not pushed to Github. One good example of such a file is the .DS_Store file created by OSX in every folder. A good starting point for a .gitignore file is here. We’ll also want to ignore the data files because they are very large, and the Fannie Mae terms prevent us from redistributing them, so we should add two lines to the end of our file: + +``` +data +processed +``` + +[Here’s][21] an example .gitignore file for this project. + +Next, we’ll need to create README.md, which will help people understand the project. .md indicates that the file is in markdown format. Markdown enables you write plain text, but also add some fancy formatting if you want. [Here’s][22] a guide on markdown. If you upload a file called README.md to Github, Github will automatically process the markdown, and show it to anyone who views the project. [Here’s][23] an example. + +For now, we just need to put a simple description in README.md: + +``` +Loan Prediction +----------------------- + +Predict whether or not loans acquired by Fannie Mae will go into foreclosure. Fannie Mae acquires loans from other lenders as a way of inducing them to lend more. Fannie Mae releases data on the loans it has acquired and their performance afterwards [here](http://www.fanniemae.com/portal/funding-the-market/data/loan-performance-data.html). +``` + +Now, we can create a requirements.txt file. This will make it easy for other people to install our project. We don’t know exactly what libraries we’ll be using yet, but here’s a good starting point: + +``` +pandas +matplotlib +scikit-learn +numpy +ipython +scipy +``` + +The above libraries are the most commonly used for data analysis tasks in Python, and its fair to assume that we’ll be using most of them. [Here’s][24] an example requirements file for this project. + +After creating requirements.txt, you should install the packages. For this post, we’ll be using Python 3. If you don’t have Python installed, you should look into using [Anaconda][25], a Python installer that also installs all the packages listed above. + +Finally, we can just make a blank settings.py file, since we don’t have any settings for our project yet. + diff --git a/sources/team_test/part 3 - Building a data science portfolio - Machine learning project.md b/sources/team_test/part 3 - Building a data science portfolio - Machine learning project.md new file mode 100644 index 0000000000..31fb6f0fc9 --- /dev/null +++ b/sources/team_test/part 3 - Building a data science portfolio - Machine learning project.md @@ -0,0 +1,194 @@ +### Acquiring the data + +Once we have the skeleton of our project, we can get the raw data. + +Fannie Mae has some restrictions around acquiring the data, so you’ll need to sign up for an account. You can find the download page [here][26]. After creating an account, you’ll be able to download as few or as many loan data files as you want. The files are in zip format, and are reasonably large after decompression. + +For the purposes of this blog post, we’ll download everything from Q1 2012 to Q1 2015, inclusive. We’ll then need to unzip all of the files. After unzipping the files, remove the original .zip files. At the end, the loan-prediction folder should look something like this: + +``` +loan-prediction +├── data +│ ├── Acquisition_2012Q1.txt +│ ├── Acquisition_2012Q2.txt +│ ├── Performance_2012Q1.txt +│ ├── Performance_2012Q2.txt +│ └── ... +├── processed +├── .gitignore +├── README.md +├── requirements.txt +├── settings.py +``` + +After downloading the data, you can use the head and tail shell commands to look at the lines in the files. Do you see any columns that aren’t needed? It might be useful to consult the [pdf of column names][27] while doing this. + +### Reading in the data + +There are two issues that make our data hard to work with right now: + +- The acquisition and performance datasets are segmented across multiple files. +- Each file is missing headers. + +Before we can get started on working with the data, we’ll need to get to the point where we have one file for the acquisition data, and one file for the performance data. Each of the files will need to contain only the columns we care about, and have the proper headers. One wrinkle here is that the performance data is quite large, so we should try to trim some of the columns if we can. + +The first step is to add some variables to settings.py, which will contain the paths to our raw data and our processed data. We’ll also add a few other settings that will be useful later on: + +``` +DATA_DIR = "data" +PROCESSED_DIR = "processed" +MINIMUM_TRACKING_QUARTERS = 4 +TARGET = "foreclosure_status" +NON_PREDICTORS = [TARGET, "id"] +CV_FOLDS = 3 +``` + +Putting the paths in settings.py will put them in a centralized place and make them easy to change down the line. When referring to the same variables in multiple files, it’s easier to put them in a central place than edit them in every file when you want to change them. [Here’s][28] an example settings.py file for this project. + +The second step is to create a file called assemble.py that will assemble all the pieces into 2 files. When we run python assemble.py, we’ll get 2 data files in the processed directory. + +We’ll then start writing code in assemble.py. We’ll first need to define the headers for each file, so we’ll need to look at [pdf of column names][29] and create lists of the columns in each Acquisition and Performance file: + +``` +HEADERS = { + "Acquisition": [ + "id", + "channel", + "seller", + "interest_rate", + "balance", + "loan_term", + "origination_date", + "first_payment_date", + "ltv", + "cltv", + "borrower_count", + "dti", + "borrower_credit_score", + "first_time_homebuyer", + "loan_purpose", + "property_type", + "unit_count", + "occupancy_status", + "property_state", + "zip", + "insurance_percentage", + "product_type", + "co_borrower_credit_score" + ], + "Performance": [ + "id", + "reporting_period", + "servicer_name", + "interest_rate", + "balance", + "loan_age", + "months_to_maturity", + "maturity_date", + "msa", + "delinquency_status", + "modification_flag", + "zero_balance_code", + "zero_balance_date", + "last_paid_installment_date", + "foreclosure_date", + "disposition_date", + "foreclosure_costs", + "property_repair_costs", + "recovery_costs", + "misc_costs", + "tax_costs", + "sale_proceeds", + "credit_enhancement_proceeds", + "repurchase_proceeds", + "other_foreclosure_proceeds", + "non_interest_bearing_balance", + "principal_forgiveness_balance" + ] +} +``` + +The next step is to define the columns we want to keep. Since all we’re measuring on an ongoing basis about the loan is whether or not it was ever foreclosed on, we can discard many of the columns in the performance data. We’ll need to keep all the columns in the acquisition data, though, because we want to maximize the information we have about when the loan was acquired (after all, we’re predicting if the loan will ever be foreclosed or not at the point it’s acquired). Discarding columns will enable us to save disk space and memory, while also speeding up our code. + +``` +SELECT = { + "Acquisition": HEADERS["Acquisition"], + "Performance": [ + "id", + "foreclosure_date" + ] +} +``` + +Next, we’ll write a function to concatenate the data sets. The below code will: + +- Import a few needed libraries, including settings. +- Define a function concatenate, that: + - Gets the names of all the files in the data directory. + - Loops through each file. + - If the file isn’t the right type (doesn’t start with the prefix we want), we ignore it. + - Reads the file into a [DataFrame][30] with the right settings using the Pandas [read_csv][31] function. + - Sets the separator to | so the fields are read in correctly. + - The data has no header row, so sets header to None to indicate this. + - Sets names to the right value from the HEADERS dictionary – these will be the column names of our DataFrame. + - Picks only the columns from the DataFrame that we added in SELECT. +- Concatenates all the DataFrames together. +- Writes the concatenated DataFrame back to a file. + +``` +import os +import settings +import pandas as pd + +def concatenate(prefix="Acquisition"): + files = os.listdir(settings.DATA_DIR) + full = [] + for f in files: + if not f.startswith(prefix): + continue + + data = pd.read_csv(os.path.join(settings.DATA_DIR, f), sep="|", header=None, names=HEADERS[prefix], index_col=False) + data = data[SELECT[prefix]] + full.append(data) + + full = pd.concat(full, axis=0) + + full.to_csv(os.path.join(settings.PROCESSED_DIR, "{}.txt".format(prefix)), sep="|", header=SELECT[prefix], index=False) +``` + +We can call the above function twice with the arguments Acquisition and Performance to concatenate all the acquisition and performance files together. The below code will: + +- Only execute if the script is called from the command line with python assemble.py. +- Concatenate all the files, and result in two files: + - `processed/Acquisition.txt` + - `processed/Performance.txt` + +``` +if __name__ == "__main__": + concatenate("Acquisition") + concatenate("Performance") +``` + +We now have a nice, compartmentalized assemble.py that’s easy to execute, and easy to build off of. By decomposing the problem into pieces like this, we make it easy to build our project. Instead of one messy script that does everything, we define the data that will pass between the scripts, and make them completely separate from each other. When you’re working on larger projects, it’s a good idea to do this, because it makes it much easier to change individual pieces without having unexpected consequences on unrelated pieces of the project. + +Once we finish the assemble.py script, we can run python assemble.py. You can find the complete assemble.py file [here][32]. + +This will result in two files in the processed directory: + +``` +loan-prediction +├── data +│ ├── Acquisition_2012Q1.txt +│ ├── Acquisition_2012Q2.txt +│ ├── Performance_2012Q1.txt +│ ├── Performance_2012Q2.txt +│ └── ... +├── processed +│ ├── Acquisition.txt +│ ├── Performance.txt +├── .gitignore +├── assemble.py +├── README.md +├── requirements.txt +├── settings.py +``` diff --git a/sources/team_test/part 4 - Building a data science portfolio - Machine learning project.md b/sources/team_test/part 4 - Building a data science portfolio - Machine learning project.md new file mode 100644 index 0000000000..66db19bc54 --- /dev/null +++ b/sources/team_test/part 4 - Building a data science portfolio - Machine learning project.md @@ -0,0 +1,80 @@ +### Computing values from the performance data + +The next step we’ll take is to calculate some values from processed/Performance.txt. All we want to do is to predict whether or not a property is foreclosed on. To figure this out, we just need to check if the performance data associated with a loan ever has a foreclosure_date. If foreclosure_date is None, then the property was never foreclosed on. In order to avoid including loans with little performance history in our sample, we’ll also want to count up how many rows exist in the performance file for each loan. This will let us filter loans without much performance history from our training data. + +One way to think of the loan data and the performance data is like this: + +![](https://github.com/LCTT/wiki-images/blob/master/TranslateProject/ref_img/001.png) + +As you can see above, each row in the Acquisition data can be related to multiple rows in the Performance data. In the Performance data, foreclosure_date will appear in the quarter when the foreclosure happened, so it should be blank prior to that. Some loans are never foreclosed on, so all the rows related to them in the Performance data have foreclosure_date blank. + +We need to compute foreclosure_status, which is a Boolean that indicates whether a particular loan id was ever foreclosed on, and performance_count, which is the number of rows in the performance data for each loan id. + +There are a few different ways to compute the counts we want: + +- We could read in all the performance data, then use the Pandas groupby method on the DataFrame to figure out the number of rows associated with each loan id, and also if the foreclosure_date is ever not None for the id. + - The upside of this method is that it’s easy to implement from a syntax perspective. + - The downside is that reading in all 129236094 lines in the data will take a lot of memory, and be extremely slow. +- We could read in all the performance data, then use apply on the acquisition DataFrame to find the counts for each id. + - The upside is that it’s easy to conceptualize. + - The downside is that reading in all 129236094 lines in the data will take a lot of memory, and be extremely slow. +- We could iterate over each row in the performance dataset, and keep a separate dictionary of counts. + - The upside is that the dataset doesn’t need to be loaded into memory, so it’s extremely fast and memory-efficient. + - The downside is that it will take slightly longer to conceptualize and implement, and we need to parse the rows manually. + +Loading in all the data will take quite a bit of memory, so let’s go with the third option above. All we need to do is to iterate through all the rows in the Performance data, while keeping a dictionary of counts per loan id. In the dictionary, we’ll keep track of how many times the id appears in the performance data, as well as if foreclosure_date is ever not None. This will give us foreclosure_status and performance_count. + +We’ll create a new file called annotate.py, and add in code that will enable us to compute these values. In the below code, we’ll: + +- Import needed libraries. +- Define a function called count_performance_rows. + - Open processed/Performance.txt. This doesn’t read the file into memory, but instead opens a file handler that can be used to read in the file line by line. + - Loop through each line in the file. + - Split the line on the delimiter (|) + - Check if the loan_id is not in the counts dictionary. + - If not, add it to counts. + - Increment performance_count for the given loan_id because we’re on a row that contains it. + - If date is not None, then we know that the loan was foreclosed on, so set foreclosure_status appropriately. + +``` +import os +import settings +import pandas as pd + +def count_performance_rows(): + counts = {} + with open(os.path.join(settings.PROCESSED_DIR, "Performance.txt"), 'r') as f: + for i, line in enumerate(f): + if i == 0: + # Skip header row + continue + loan_id, date = line.split("|") + loan_id = int(loan_id) + if loan_id not in counts: + counts[loan_id] = { + "foreclosure_status": False, + "performance_count": 0 + } + counts[loan_id]["performance_count"] += 1 + if len(date.strip()) > 0: + counts[loan_id]["foreclosure_status"] = True + return counts +``` + +### Getting the values + +Once we create our counts dictionary, we can make a function that will extract values from the dictionary if a loan_id and a key are passed in: + +``` +def get_performance_summary_value(loan_id, key, counts): + value = counts.get(loan_id, { + "foreclosure_status": False, + "performance_count": 0 + }) + return value[key] +``` + +The above function will return the appropriate value from the counts dictionary, and will enable us to assign a foreclosure_status value and a performance_count value to each row in the Acquisition data. The [get][33] method on dictionaries returns a default value if a key isn’t found, so this enables us to return sensible default values if a key isn’t found in the counts dictionary. + + + diff --git a/sources/team_test/part 5 - Building a data science portfolio - Machine learning project.md b/sources/team_test/part 5 - Building a data science portfolio - Machine learning project.md new file mode 100644 index 0000000000..64be5f9492 --- /dev/null +++ b/sources/team_test/part 5 - Building a data science portfolio - Machine learning project.md @@ -0,0 +1,166 @@ +### Annotating the data + +We’ve already added a few functions to annotate.py, but now we can get into the meat of the file. We’ll need to convert the acquisition data into a training dataset that can be used in a machine learning algorithm. This involves a few things: + +- Converting all columns to numeric. +- Filling in any missing values. +- Assigning a performance_count and a foreclosure_status to each row. +- Removing any rows that don’t have a lot of performance history (where performance_count is low). + +Several of our columns are strings, which aren’t useful to a machine learning algorithm. However, they are actually categorical variables, where there are a few different category codes, like R, S, and so on. We can convert these columns to numeric by assigning a number to each category label: + +![](https://github.com/LCTT/wiki-images/blob/master/TranslateProject/ref_img/002.png) + +Converting the columns this way will allow us to use them in our machine learning algorithm. + +Some of the columns also contain dates (first_payment_date and origination_date). We can split these dates into 2 columns each: + +![](https://github.com/LCTT/wiki-images/blob/master/TranslateProject/ref_img/003.png) +In the below code, we’ll transform the Acquisition data. We’ll define a function that: + +- Creates a foreclosure_status column in acquisition by getting the values from the counts dictionary. +- Creates a performance_count column in acquisition by getting the values from the counts dictionary. +- Converts each of the following columns from a string column to an integer column: + - channel + - seller + - first_time_homebuyer + - loan_purpose + - property_type + - occupancy_status + - property_state + - product_type +- Converts first_payment_date and origination_date to 2 columns each: + - Splits the column on the forward slash. + - Assigns the first part of the split list to a month column. + - Assigns the second part of the split list to a year column. + - Deletes the column. + - At the end, we’ll have first_payment_month, first_payment_year, origination_month, and origination_year. +- Fills any missing values in acquisition with -1. + +``` +def annotate(acquisition, counts): + acquisition["foreclosure_status"] = acquisition["id"].apply(lambda x: get_performance_summary_value(x, "foreclosure_status", counts)) + acquisition["performance_count"] = acquisition["id"].apply(lambda x: get_performance_summary_value(x, "performance_count", counts)) + for column in [ + "channel", + "seller", + "first_time_homebuyer", + "loan_purpose", + "property_type", + "occupancy_status", + "property_state", + "product_type" + ]: + acquisition[column] = acquisition[column].astype('category').cat.codes + + for start in ["first_payment", "origination"]: + column = "{}_date".format(start) + acquisition["{}_year".format(start)] = pd.to_numeric(acquisition[column].str.split('/').str.get(1)) + acquisition["{}_month".format(start)] = pd.to_numeric(acquisition[column].str.split('/').str.get(0)) + del acquisition[column] + + acquisition = acquisition.fillna(-1) + acquisition = acquisition[acquisition["performance_count"] > settings.MINIMUM_TRACKING_QUARTERS] + return acquisition +``` + +### Pulling everything together + +We’re almost ready to pull everything together, we just need to add a bit more code to annotate.py. In the below code, we: + +- Define a function to read in the acquisition data. +- Define a function to write the processed data to processed/train.csv +- If this file is called from the command line, like python annotate.py: + - Read in the acquisition data. + - Compute the counts for the performance data, and assign them to counts. + - Annotate the acquisition DataFrame. + - Write the acquisition DataFrame to train.csv. + +``` +def read(): + acquisition = pd.read_csv(os.path.join(settings.PROCESSED_DIR, "Acquisition.txt"), sep="|") + return acquisition + +def write(acquisition): + acquisition.to_csv(os.path.join(settings.PROCESSED_DIR, "train.csv"), index=False) + +if __name__ == "__main__": + acquisition = read() + counts = count_performance_rows() + acquisition = annotate(acquisition, counts) + write(acquisition) +``` + +Once you’re done updating the file, make sure to run it with python annotate.py, to generate the train.csv file. You can find the complete annotate.py file [here][34]. + +The folder should now look like this: + +``` +loan-prediction +├── data +│ ├── Acquisition_2012Q1.txt +│ ├── Acquisition_2012Q2.txt +│ ├── Performance_2012Q1.txt +│ ├── Performance_2012Q2.txt +│ └── ... +├── processed +│ ├── Acquisition.txt +│ ├── Performance.txt +│ ├── train.csv +├── .gitignore +├── annotate.py +├── assemble.py +├── README.md +├── requirements.txt +├── settings.py +``` + +### Finding an error metric + +We’re done with generating our training dataset, and now we’ll just need to do the final step, generating predictions. We’ll need to figure out an error metric, as well as how we want to evaluate our data. In this case, there are many more loans that aren’t foreclosed on than are, so typical accuracy measures don’t make much sense. + +If we read in the training data, and check the counts in the foreclosure_status column, here’s what we get: + +``` +import pandas as pd +import settings + +train = pd.read_csv(os.path.join(settings.PROCESSED_DIR, "train.csv")) +train["foreclosure_status"].value_counts() +``` + +``` +False 4635982 +True 1585 +Name: foreclosure_status, dtype: int64 +``` + +Since so few of the loans were foreclosed on, just checking the percentage of labels that were correctly predicted will mean that we can make a machine learning model that predicts False for every row, and still gets a very high accuracy. Instead, we’ll want to use a metric that takes the class imbalance into account, and ensures that we predict foreclosures accurately. We don’t want too many false positives, where we make predict that a loan will be foreclosed on even though it won’t, or too many false negatives, where we predict that a loan won’t be foreclosed on, but it is. Of these two, false negatives are more costly for Fannie Mae, because they’re buying loans where they may not be able to recoup their investment. + +We’ll define false negative rate as the number of loans where the model predicts no foreclosure but the the loan was actually foreclosed on, divided by the number of total loans that were actually foreclosed on. This is the percentage of actual foreclosures that the model “Missed”. Here’s a diagram: + +![](https://github.com/LCTT/wiki-images/blob/master/TranslateProject/ref_img/004.png) + +In the diagram above, 1 loan was predicted as not being foreclosed on, but it actually was. If we divide this by the number of loans that were actually foreclosed on, 2, we get the false negative rate, 50%. We’ll use this as our error metric, so we can evaluate our model’s performance. + +### Setting up the classifier for machine learning + +We’ll use cross validation to make predictions. With cross validation, we’ll divide our data into 3 groups. Then we’ll do the following: + +- Train a model on groups 1 and 2, and use the model to make predictions for group 3. +- Train a model on groups 1 and 3, and use the model to make predictions for group 2. +- Train a model on groups 2 and 3, and use the model to make predictions for group 1. + +Splitting it up into groups this way means that we never train a model using the same data we’re making predictions for. This avoids overfitting. If we overfit, we’ll get a falsely low false negative rate, which makes it hard to improve our algorithm or use it in the real world. + +[Scikit-learn][35] has a function called [cross_val_predict][36] which will make it easy to perform cross validation. + +We’ll also need to pick an algorithm to use to make predictions. We need a classifier that can do [binary classification][37]. The target variable, foreclosure_status only has two values, True and False. + +We’ll use [logistic regression][38], because it works well for binary classification, runs extremely quickly, and uses little memory. This is due to how the algorithm works – instead of constructing dozens of trees, like a random forest, or doing expensive transformations, like a support vector machine, logistic regression has far fewer steps involving fewer matrix operations. + +We can use the [logistic regression classifier][39] algorithm that’s implemented in scikit-learn. The only thing we need to pay attention to is the weights of each class. If we weight the classes equally, the algorithm will predict False for every row, because it is trying to minimize errors. However, we care much more about foreclosures than we do about loans that aren’t foreclosed on. Thus, we’ll pass balanced to the class_weight keyword argument of the [LogisticRegression][40] class, to get the algorithm to weight the foreclosures more to account for the difference in the counts of each class. This will ensure that the algorithm doesn’t predict False for every row, and instead is penalized equally for making errors in predicting either class. + + + + diff --git a/sources/team_test/part 6 - Building a data science portfolio - Machine learning project.md b/sources/team_test/part 6 - Building a data science portfolio - Machine learning project.md new file mode 100644 index 0000000000..e99087b496 --- /dev/null +++ b/sources/team_test/part 6 - Building a data science portfolio - Machine learning project.md @@ -0,0 +1,173 @@ +### Setting up the classifier for machine learning + +We’ll use cross validation to make predictions. With cross validation, we’ll divide our data into 3 groups. Then we’ll do the following: + +- Train a model on groups 1 and 2, and use the model to make predictions for group 3. +- Train a model on groups 1 and 3, and use the model to make predictions for group 2. +- Train a model on groups 2 and 3, and use the model to make predictions for group 1. + +Splitting it up into groups this way means that we never train a model using the same data we’re making predictions for. This avoids overfitting. If we overfit, we’ll get a falsely low false negative rate, which makes it hard to improve our algorithm or use it in the real world. + +[Scikit-learn][35] has a function called [cross_val_predict][36] which will make it easy to perform cross validation. + +We’ll also need to pick an algorithm to use to make predictions. We need a classifier that can do [binary classification][37]. The target variable, foreclosure_status only has two values, True and False. + +We’ll use [logistic regression][38], because it works well for binary classification, runs extremely quickly, and uses little memory. This is due to how the algorithm works – instead of constructing dozens of trees, like a random forest, or doing expensive transformations, like a support vector machine, logistic regression has far fewer steps involving fewer matrix operations. + +We can use the [logistic regression classifier][39] algorithm that’s implemented in scikit-learn. The only thing we need to pay attention to is the weights of each class. If we weight the classes equally, the algorithm will predict False for every row, because it is trying to minimize errors. However, we care much more about foreclosures than we do about loans that aren’t foreclosed on. Thus, we’ll pass balanced to the class_weight keyword argument of the [LogisticRegression][40] class, to get the algorithm to weight the foreclosures more to account for the difference in the counts of each class. This will ensure that the algorithm doesn’t predict False for every row, and instead is penalized equally for making errors in predicting either class. + +### Making predictions + +Now that we have the preliminaries out of the way, we’re ready to make predictions. We’ll create a new file called predict.py that will use the train.csv file we created in the last step. The below code will: + +- Import needed libraries. +- Create a function called cross_validate that: + - Creates a logistic regression classifier with the right keyword arguments. + - Creates a list of columns that we want to use to train the model, removing id and foreclosure_status. + - Run cross validation across the train DataFrame. + - Return the predictions. + + +``` +import os +import settings +import pandas as pd +from sklearn import cross_validation +from sklearn.linear_model import LogisticRegression +from sklearn import metrics + +def cross_validate(train): + clf = LogisticRegression(random_state=1, class_weight="balanced") + + predictors = train.columns.tolist() + predictors = [p for p in predictors if p not in settings.NON_PREDICTORS] + + predictions = cross_validation.cross_val_predict(clf, train[predictors], train[settings.TARGET], cv=settings.CV_FOLDS) + return predictions +``` + +### Predicting error + +Now, we just need to write a few functions to compute error. The below code will: + +- Create a function called compute_error that: + - Uses scikit-learn to compute a simple accuracy score (the percentage of predictions that matched the actual foreclosure_status values). +- Create a function called compute_false_negatives that: + - Combines the target and the predictions into a DataFrame for convenience. + - Finds the false negative rate. +- Create a function called compute_false_positives that: + - Combines the target and the predictions into a DataFrame for convenience. + - Finds the false positive rate. + - Finds the number of loans that weren’t foreclosed on that the model predicted would be foreclosed on. + - Divide by the total number of loans that weren’t foreclosed on. + +``` +def compute_error(target, predictions): + return metrics.accuracy_score(target, predictions) + +def compute_false_negatives(target, predictions): + df = pd.DataFrame({"target": target, "predictions": predictions}) + return df[(df["target"] == 1) & (df["predictions"] == 0)].shape[0] / (df[(df["target"] == 1)].shape[0] + 1) + +def compute_false_positives(target, predictions): + df = pd.DataFrame({"target": target, "predictions": predictions}) + return df[(df["target"] == 0) & (df["predictions"] == 1)].shape[0] / (df[(df["target"] == 0)].shape[0] + 1) +``` + + +### Putting it all together + +Now, we just have to put the functions together in predict.py. The below code will: + +- Read in the dataset. +- Compute cross validated predictions. +- Compute the 3 error metrics above. +- Print the error metrics. + +``` +def read(): + train = pd.read_csv(os.path.join(settings.PROCESSED_DIR, "train.csv")) + return train + +if __name__ == "__main__": + train = read() + predictions = cross_validate(train) + error = compute_error(train[settings.TARGET], predictions) + fn = compute_false_negatives(train[settings.TARGET], predictions) + fp = compute_false_positives(train[settings.TARGET], predictions) + print("Accuracy Score: {}".format(error)) + print("False Negatives: {}".format(fn)) + print("False Positives: {}".format(fp)) +``` + +Once you’ve added the code, you can run python predict.py to generate predictions. Running everything shows that our false negative rate is .26, which means that of the foreclosed loans, we missed predicting 26% of them. This is a good start, but can use a lot of improvement! + +You can find the complete predict.py file [here][41]. + +Your file tree should now look like this: + +``` +loan-prediction +├── data +│ ├── Acquisition_2012Q1.txt +│ ├── Acquisition_2012Q2.txt +│ ├── Performance_2012Q1.txt +│ ├── Performance_2012Q2.txt +│ └── ... +├── processed +│ ├── Acquisition.txt +│ ├── Performance.txt +│ ├── train.csv +├── .gitignore +├── annotate.py +├── assemble.py +├── predict.py +├── README.md +├── requirements.txt +├── settings.py +``` + +### Writing up a README + +Now that we’ve finished our end to end project, we just have to write up a README.md file so that other people know what we did, and how to replicate it. A typical README.md for a project should include these sections: + +- A high level overview of the project, and what the goals are. +- Where to download any needed data or materials. +- Installation instructions. + - How to install the requirements. +- Usage instructions. + - How to run the project. + - What you should see after each step. +- How to contribute to the project. + - Good next steps for extending the project. + +[Here’s][42] a sample README.md for this project. + +### Next steps + +Congratulations, you’re done making an end to end machine learning project! You can find a complete example project [here][43]. It’s a good idea to upload your project to [Github][44] once you’ve finished it, so others can see it as part of your portfolio. + +There are still quite a few angles left to explore with this data. Broadly, we can split them up into 3 categories – extending this project and making it more accurate, finding other columns to predict, and exploring the data. Here are some ideas: + +- Generate more features in annotate.py. +- Switch algorithms in predict.py. +- Try using more data from Fannie Mae than we used in this post. +- Add in a way to make predictions on future data. The code we wrote will still work if we add more data, so we can add more past or future data. +- Try seeing if you can predict if a bank should have issued the loan originally (vs if Fannie Mae should have acquired the loan). + - Remove any columns from train that the bank wouldn’t have known at the time of issuing the loan. + - Some columns are known when Fannie Mae bought the loan, but not before. + - Make predictions. +- Explore seeing if you can predict columns other than foreclosure_status. + - Can you predict how much the property will be worth at sale time? +- Explore the nuances between performance updates. + - Can you predict how many times the borrower will be late on payments? + - Can you map out the typical loan lifecycle? +- Map out data on a state by state or zip code by zip code level. + - Do you see any interesting patterns? + +If you build anything interesting, please let us know in the comments! + +If you liked this, you might like to read the other posts in our ‘Build a Data Science Porfolio’ series: + +- [Storytelling with data][45]. +- [How to setup up a data science blog][46]. From 54212848c6ee922a9919e6e84e77bb9e5effbcb6 Mon Sep 17 00:00:00 2001 From: ezio Date: Mon, 1 Aug 2016 21:07:52 +0800 Subject: [PATCH 1327/1469] fix typo --- sources/team_test/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sources/team_test/README.md b/sources/team_test/README.md index d2bdd305f8..0798a592ef 100644 --- a/sources/team_test/README.md +++ b/sources/team_test/README.md @@ -1,4 +1,7 @@ 组队翻译 : 《Building a data science portfolio: Machine learning project》 + 本次组织者 : @选题-oska874 + 参加译者 : @译者-vim-kakali @译者-Noobfish @译者-zky001 @译者-kokialoves @译者-ideas4u @译者-cposture + 分配方式 : 原文按大致长度分成 6 部分,参与者自由选择,先到先选,如有疑问联系 @选题-oska874 From 1b666b6fe8d3537162b6e353e75136e23c9ddd57 Mon Sep 17 00:00:00 2001 From: vim-kakali <1799225723@qq.com> Date: Mon, 1 Aug 2016 21:33:36 +0800 Subject: [PATCH 1328/1469] vim-kakali translating --- ...ing a data science portfolio - Machine learning project.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sources/team_test/part 4 - Building a data science portfolio - Machine learning project.md b/sources/team_test/part 4 - Building a data science portfolio - Machine learning project.md index 66db19bc54..a9af49b188 100644 --- a/sources/team_test/part 4 - Building a data science portfolio - Machine learning project.md +++ b/sources/team_test/part 4 - Building a data science portfolio - Machine learning project.md @@ -1,3 +1,7 @@ +vim-kakali translating + + + ### Computing values from the performance data The next step we’ll take is to calculate some values from processed/Performance.txt. All we want to do is to predict whether or not a property is foreclosed on. To figure this out, we just need to check if the performance data associated with a loan ever has a foreclosure_date. If foreclosure_date is None, then the property was never foreclosed on. In order to avoid including loans with little performance history in our sample, we’ll also want to count up how many rows exist in the performance file for each loan. This will let us filter loans without much performance history from our training data. From 1325b98f208b7a4355061b17bb319daf61efdf97 Mon Sep 17 00:00:00 2001 From: vim-kakali <1799225723@qq.com> Date: Mon, 1 Aug 2016 21:56:50 +0800 Subject: [PATCH 1329/1469] vim-kakali translating --- ... read and write Audio files with Octave 4.0.0 on Ubuntu.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sources/tech/20160616 Part 1 - Scientific Audio Processing How to read and write Audio files with Octave 4.0.0 on Ubuntu.md b/sources/tech/20160616 Part 1 - Scientific Audio Processing How to read and write Audio files with Octave 4.0.0 on Ubuntu.md index 80300deb6b..f35e0724a6 100644 --- a/sources/tech/20160616 Part 1 - Scientific Audio Processing How to read and write Audio files with Octave 4.0.0 on Ubuntu.md +++ b/sources/tech/20160616 Part 1 - Scientific Audio Processing How to read and write Audio files with Octave 4.0.0 on Ubuntu.md @@ -1,3 +1,7 @@ +vim-kakali translating + + + Scientific Audio Processing, Part I - How to read and write Audio files with Octave 4.0.0 on Ubuntu ================ From cb90401f21b819bb641106eedfcac48a7b408195 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 1 Aug 2016 23:51:51 +0800 Subject: [PATCH 1330/1469] PUB:20160711 Getting started with Git MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @ChrisLeeGit 翻译的不错~ --- .../20160711 Getting started with Git.md | 41 ++++++++++++------- 1 file changed, 26 insertions(+), 15 deletions(-) rename {translated/tech => published}/20160711 Getting started with Git.md (77%) diff --git a/translated/tech/20160711 Getting started with Git.md b/published/20160711 Getting started with Git.md similarity index 77% rename from translated/tech/20160711 Getting started with Git.md rename to published/20160711 Getting started with Git.md index afa6b7382b..a490e59e2d 100644 --- a/translated/tech/20160711 Getting started with Git.md +++ b/published/20160711 Getting started with Git.md @@ -2,20 +2,23 @@ ========================= ![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/get_started_lead.jpeg?itok=r22AKc6P) -> 图片来源:opensource.com -在这个系列的介绍中,我们学习到了谁应该使用 Git,以及 Git 是用来做什么的。今天,我们将学习如何克隆公共的 Git 仓库,以及如何提取出独立的文件而不用克隆整个仓库。 +*图片来源:opensource.com* + +在这个系列的[介绍篇][4]中,我们学习到了谁应该使用 Git,以及 Git 是用来做什么的。今天,我们将学习如何克隆公共 Git 仓库,以及如何提取出独立的文件而不用克隆整个仓库。 由于 Git 如此流行,因而如果你能够至少熟悉一些基础的 Git 知识也能为你的生活带来很多便捷。如果你可以掌握 Git 基础(你可以的,我发誓!),那么你将能够下载任何你需要的东西,甚至还可能做一些贡献作为回馈。毕竟,那就是开源的精髓所在:你拥有获取你使用的软件代码的权利,拥有和他人分享的自由,以及只要你愿意就可以修改它的权利。只要你熟悉了 Git,它就可以让这一切都变得很容易。 那么,让我们一起来熟悉 Git 吧。 ### 读和写 + 一般来说,有两种方法可以和 Git 仓库交互:你可以从仓库中读取,或者你也能够向仓库中写入。它就像一个文件:有时候你打开一个文档只是为了阅读它,而其它时候你打开文档是因为你需要做些改动。 本文仅讲解如何从 Git 仓库读取。我们将会在后面的一篇文章中讲解如何向 Git 仓库写回的主题。 ### Git 还是 GitHub? + 一句话澄清:Git 不同于 GitHub(或 GitLab,或 Bitbucket)。Git 是一个命令行程序,所以它就像下面这样: ``` @@ -31,29 +34,32 @@ usage: Git [--version] [--help] [-C ] 我的文章系列将首先教你纯粹的 Git 知识,因为一旦你理解了 Git 在做什么,那么你就无需关心正在使用的前端工具是什么了。然而,我的文章系列也将涵盖通过流行的 Git 服务完成每项任务的常用方法,因为那些将可能是你首先会遇到的。 ### 安装 Git + 在 Linux 系统上,你可以从所使用的发行版软件仓库中获取并安装 Git。BSD 用户应当在 Ports 树的 devel 部分查找 Git。 -对于闭源的操作系统,请前往 [项目网站][1] 并根据说明安装。一旦安装后,在 Linux、BSD 和 Mac OS X 上的命令应当没有任何差别。Windows 用户需要调整 Git 命令,从而和 Windows 文件系统相匹配,或者安装 Cygwin 以原生的方式运行 Git,而不受 Windows 文件系统转换问题的羁绊。 +对于闭源的操作系统,请前往其[项目官网][1],并根据说明安装。一旦安装后,在 Linux、BSD 和 Mac OS X 上的命令应当没有任何差别。Windows 用户需要调整 Git 命令,从而和 Windows 文件系统相匹配,或者安装 Cygwin 以原生的方式运行 Git,而不受 Windows 文件系统转换问题的羁绊。 + +### Git 下午茶 -### 下午茶和 Git 并非每个人都需要立刻将 Git 加入到我们的日常生活中。有些时候,你和 Git 最多的交互就是访问一个代码库,下载一两个文件,然后就不用它了。以这样的方式看待 Git,它更像是下午茶而非一次正式的宴会。你进行一些礼节性的交谈,获得了需要的信息,然后你就会离开,至少接下来的三个月你不再想这样说话。 当然,那是可以的。 一般来说,有两种方法访问 Git:使用命令行,或者使用一种神奇的因特网技术通过 web 浏览器快速轻松地访问。 -假设你想要在终端中安装并使用一个回收站,因为你已经被 rm 命令毁掉太多次了。你已经听说过 Trashy 了,它称自己为「理智的 rm 命令媒介」,并且你想在安装它之前阅读它的文档。幸运的是,[Trashy 公开地托管在 GitLab.com][2]。 +假设你想要给终端安装一个回收站,因为你已经被 rm 命令毁掉太多次了。你可能听说过 Trashy ,它称自己为「理智的 rm 命令中间人」,也许你想在安装它之前阅读它的文档。幸运的是,[Trashy 公开地托管在 GitLab.com][2]。 ### Landgrab + 我们工作的第一步是对这个 Git 仓库使用 landgrab 排序方法:我们会克隆这个完整的仓库,然后会根据内容排序。由于该仓库是托管在公共的 Git 服务平台上,所以有两种方式来完成工作:使用命令行,或者使用 web 界面。 -要想使用 Git 获取整个仓库,就要使用 git clone 命令和 Git 仓库的 URL 作为参数。如果你不清楚正确的 URL 是什么,仓库应该会告诉你的。GitLab 为你提供了 [Trashy][3] 仓库的拷贝-粘贴 URL。 +要想使用 Git 获取整个仓库,就要使用 git clone 命令和 Git 仓库的 URL 作为参数。如果你不清楚正确的 URL 是什么,仓库应该会告诉你的。GitLab 为你提供了 [Trashy][3] 仓库的用于拷贝粘贴的 URL。 ![](https://opensource.com/sites/default/files/1_gitlab-url.jpg) 你也许注意到了,在某些服务平台上,会同时提供 SSH 和 HTTPS 链接。只有当你拥有仓库的写权限时,你才可以使用 SSH。否则的话,你必须使用 HTTPS URL。 -一旦你获得了正确的 URL,克隆仓库是非常容易的。就是 git clone 这个 URL 即可,可选项是可以指定要克隆到的目录。默认情况下会将 git 目录克隆到你当前所在的位置;例如,'trashy.git' 表示将仓库克隆到你当前位置的 'trashy' 目录。我使用 .clone 扩展名标记那些只读的仓库,使用 .git 扩展名标记那些我可以读写的仓库,但那无论如何也不是官方要求的。 +一旦你获得了正确的 URL,克隆仓库是非常容易的。就是 git clone 该 URL 即可,以及一个可选的指定要克隆到的目录。默认情况下会将 git 目录克隆到你当前所在的目录;例如,'trashy.git' 将会克隆到你当前位置的 'trashy' 目录。我使用 .clone 扩展名标记那些只读的仓库,而使用 .git 扩展名标记那些我可以读写的仓库,不过这并不是官方要求的。 ``` $ git clone https://gitlab.com/trashy/trashy.git trashy.clone @@ -68,30 +74,34 @@ Checking connectivity... done. 一旦成功地克隆了仓库,你就可以像对待你电脑上任何其它目录那样浏览仓库中的文件。 -另外一种获得仓库拷贝的方式是使用 web 界面。GitLab 和 GitHub 都会提供一个 .zip 格式的仓库快照文件。GitHub 有一个大的绿色下载按钮,但是在 GitLab 中,可以浏览器的右侧找到并不显眼的下载按钮。 +另外一种获得仓库拷贝的方式是使用 web 界面。GitLab 和 GitHub 都会提供一个 .zip 格式的仓库快照文件。GitHub 有一个大大的绿色下载按钮,但是在 GitLab 中,可以在浏览器的右侧找到并不显眼的下载按钮。 ![](https://opensource.com/sites/default/files/1_gitlab-zip.jpg) ### 仔细挑选 -另外一种从 Git 仓库中获取文件的方法是找到你想要的文件,然后把它从仓库中拽出来。只有 web 界面才提供这种方法,本质上来说,你看到的是别人仓库的克隆;你可以把它想象成一个 HTTP 共享目录。 + +另外一种从 Git 仓库中获取文件的方法是找到你想要的文件,然后把它从仓库中拽出来。只有 web 界面才提供这种方法,本质上来说,你看到的是别人的仓库克隆;你可以把它想象成一个 HTTP 共享目录。 使用这种方法的问题是,你也许会发现某些文件并不存在于原始仓库中,因为完整形式的文件可能只有在执行 make 命令后才能构建,那只有你下载了完整的仓库,阅读了 README 或者 INSTALL 文件,然后运行相关命令之后才会产生。不过,假如你确信文件存在,而你只想进入仓库,获取那个文件,然后离开的话,你就可以那样做。 -在 GitLab 和 GitHub 中,单击文件链接,并在 Raw 模式下查看,然后使用你的 web 浏览器的保存功能,例如:在 Firefox 中,文件 > 保存页面为。在一个 GitWeb 仓库中(一些更喜欢自己托管 git 的人使用的私有 git 仓库 web 查看器),Raw 查看链接在文件列表视图中。 +在 GitLab 和 GitHub 中,单击文件链接,并在 Raw 模式下查看,然后使用你的 web 浏览器的保存功能,例如:在 Firefox 中,“文件” \> “保存页面为”。在一个 GitWeb 仓库中(这是一个某些更喜欢自己托管 git 的人使用的私有 git 仓库 web 查看器),Raw 查看链接在文件列表视图中。 ![](https://opensource.com/sites/default/files/1_webgit-file.jpg) ### 最佳实践 + 通常认为,和 Git 交互的正确方式是克隆完整的 Git 仓库。这样认为是有几个原因的。首先,可以使用 git pull 命令轻松地使克隆仓库保持更新,这样你就不必在每次文件改变时就重回 web 站点获得一份全新的拷贝。第二,你碰巧需要做些改进,只要保持仓库整洁,那么你可以非常轻松地向原来的作者提交所做的变更。 -现在,可能是时候练习查找感兴趣的 Git 仓库,然后将它们克隆到你的硬盘中了。只要你了解使用终端的基础知识,那就不会太难做到。还不知道终端使用基础吗?那再给多我 5 分钟时间吧。 +现在,可能是时候练习查找感兴趣的 Git 仓库,然后将它们克隆到你的硬盘中了。只要你了解使用终端的基础知识,那就不会太难做到。还不知道基本的终端使用方式吗?那再给多我 5 分钟时间吧。 ### 终端使用基础 + 首先要知道的是,所有的文件都有一个路径。这是有道理的;如果我让你在常规的非终端环境下为我打开一个文件,你就要导航到文件在你硬盘的位置,并且直到你找到那个文件,你要浏览一大堆窗口。例如,你也许要点击你的家目录 > 图片 > InktoberSketches > monkey.kra。 -在那样的场景下,我们可以说文件 monkeysketch.kra 的路径是:$HOME/图片/InktoberSketches/monkey.kra。 +在那样的场景下,文件 monkeysketch.kra 的路径是:$HOME/图片/InktoberSketches/monkey.kra。 在终端中,除非你正在处理一些特殊的系统管理员任务,你的文件路径通常是以 $HOME 开头的(或者,如果你很懒,就使用 ~ 字符),后面紧跟着一些列的文件夹直到文件名自身。 + 这就和你在 GUI 中点击各种图标直到找到相关的文件或文件夹类似。 如果你想把 Git 仓库克隆到你的文档目录,那么你可以打开一个终端然后运行下面的命令: @@ -100,6 +110,7 @@ Checking connectivity... done. $ git clone https://gitlab.com/foo/bar.git $HOME/文档/bar.clone ``` + 一旦克隆完成,你可以打开一个文件管理器窗口,导航到你的文档文件夹,然后你就会发现 bar.clone 目录正在等待着你访问。 如果你想要更高级点,你或许会在以后再次访问那个仓库,可以尝试使用 git pull 命令来查看项目有没有更新: @@ -111,7 +122,7 @@ bar.clone $ git pull ``` -到目前为止,你需要初步了解的所有终端命令就是那些了,那就去探索吧。你实践得越多,Git 掌握得就越好(孰能生巧),那就是游戏的名称,至少给了或取了一个元音。 +到目前为止,你需要初步了解的所有终端命令就是那些了,那就去探索吧。你实践得越多,Git 掌握得就越好(熟能生巧),这是重点,也是事情的本质。 -------------------------------------------------------------------------------- @@ -119,7 +130,7 @@ via: https://opensource.com/life/16/7/stumbling-git 作者:[Seth Kenlon][a] 译者:[ChrisLeeGit](https://github.com/chrisleegit) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -127,4 +138,4 @@ via: https://opensource.com/life/16/7/stumbling-git [1]: https://git-scm.com/download [2]: https://gitlab.com/trashy/trashy [3]: https://gitlab.com/trashy/trashy.git - +[4]: https://linux.cn/article-7639-1.html From 6605d61db2546c2523362a1d801fad568cf28145 Mon Sep 17 00:00:00 2001 From: Ezio Date: Tue, 2 Aug 2016 00:01:02 +0800 Subject: [PATCH 1331/1469] =?UTF-8?q?=E7=BB=84=E9=98=9F=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=20Building=20a=20data=20science=20portfolio=20-=20Machine=20le?= =?UTF-8?q?arning=20project?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ence portfolio - Machine learning project.md | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/sources/team_test/part 6 - Building a data science portfolio - Machine learning project.md b/sources/team_test/part 6 - Building a data science portfolio - Machine learning project.md index e99087b496..86ecbe127d 100644 --- a/sources/team_test/part 6 - Building a data science portfolio - Machine learning project.md +++ b/sources/team_test/part 6 - Building a data science portfolio - Machine learning project.md @@ -1,20 +1,3 @@ -### Setting up the classifier for machine learning - -We’ll use cross validation to make predictions. With cross validation, we’ll divide our data into 3 groups. Then we’ll do the following: - -- Train a model on groups 1 and 2, and use the model to make predictions for group 3. -- Train a model on groups 1 and 3, and use the model to make predictions for group 2. -- Train a model on groups 2 and 3, and use the model to make predictions for group 1. - -Splitting it up into groups this way means that we never train a model using the same data we’re making predictions for. This avoids overfitting. If we overfit, we’ll get a falsely low false negative rate, which makes it hard to improve our algorithm or use it in the real world. - -[Scikit-learn][35] has a function called [cross_val_predict][36] which will make it easy to perform cross validation. - -We’ll also need to pick an algorithm to use to make predictions. We need a classifier that can do [binary classification][37]. The target variable, foreclosure_status only has two values, True and False. - -We’ll use [logistic regression][38], because it works well for binary classification, runs extremely quickly, and uses little memory. This is due to how the algorithm works – instead of constructing dozens of trees, like a random forest, or doing expensive transformations, like a support vector machine, logistic regression has far fewer steps involving fewer matrix operations. - -We can use the [logistic regression classifier][39] algorithm that’s implemented in scikit-learn. The only thing we need to pay attention to is the weights of each class. If we weight the classes equally, the algorithm will predict False for every row, because it is trying to minimize errors. However, we care much more about foreclosures than we do about loans that aren’t foreclosed on. Thus, we’ll pass balanced to the class_weight keyword argument of the [LogisticRegression][40] class, to get the algorithm to weight the foreclosures more to account for the difference in the counts of each class. This will ensure that the algorithm doesn’t predict False for every row, and instead is penalized equally for making errors in predicting either class. ### Making predictions From 263406bc4d937c1988c6f2a02c037141731c54b2 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Tue, 2 Aug 2016 07:04:24 +0800 Subject: [PATCH 1332/1469] Update 20160715 bc - Command line calculator.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 准备进行翻译。 --- sources/tech/20160715 bc - Command line calculator.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160715 bc - Command line calculator.md b/sources/tech/20160715 bc - Command line calculator.md index adf854e468..a85ebc4985 100644 --- a/sources/tech/20160715 bc - Command line calculator.md +++ b/sources/tech/20160715 bc - Command line calculator.md @@ -1,3 +1,5 @@ +FSSlc translating + bc: Command line calculator ============================ From 19ed340a8d11ba269efc7b18c4df21e699d80922 Mon Sep 17 00:00:00 2001 From: kokialoves <498497353@qq.com> Date: Tue, 2 Aug 2016 08:46:55 +0800 Subject: [PATCH 1333/1469] Update part 5 - Building a data science portfolio - Machine learning project.md --- ...ilding a data science portfolio - Machine learning project.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/team_test/part 5 - Building a data science portfolio - Machine learning project.md b/sources/team_test/part 5 - Building a data science portfolio - Machine learning project.md index 64be5f9492..722aa8f286 100644 --- a/sources/team_test/part 5 - Building a data science portfolio - Machine learning project.md +++ b/sources/team_test/part 5 - Building a data science portfolio - Machine learning project.md @@ -1,3 +1,4 @@ +[translating by kokialoves] ### Annotating the data We’ve already added a few functions to annotate.py, but now we can get into the meat of the file. We’ll need to convert the acquisition data into a training dataset that can be used in a machine learning algorithm. This involves a few things: From 6846cec1e9cef45d8a31951fe3fc47ba2bb5cbce Mon Sep 17 00:00:00 2001 From: ChrisLeeGit Date: Tue, 2 Aug 2016 09:45:45 +0800 Subject: [PATCH 1334/1469] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=EF=BC=9ALearn=20How=20to=20Use=20Awk=20Special=20Patterns=20be?= =?UTF-8?q?gin=20and=20end?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Use Awk Special Patterns begin and end.md | 168 ------------------ ... Use Awk Special Patterns begin and end.md | 166 +++++++++++++++++ 2 files changed, 166 insertions(+), 168 deletions(-) delete mode 100644 sources/tech/awk/20160719 Part 9 - Learn How to Use Awk Special Patterns begin and end.md create mode 100644 translated/tech/awk/20160719 Part 9 - Learn How to Use Awk Special Patterns begin and end.md diff --git a/sources/tech/awk/20160719 Part 9 - Learn How to Use Awk Special Patterns begin and end.md b/sources/tech/awk/20160719 Part 9 - Learn How to Use Awk Special Patterns begin and end.md deleted file mode 100644 index b3f99e6d4f..0000000000 --- a/sources/tech/awk/20160719 Part 9 - Learn How to Use Awk Special Patterns begin and end.md +++ /dev/null @@ -1,168 +0,0 @@ -Being translated by ChrisLeeGit - -Learn How to Use Awk Special Patterns ‘BEGIN and END’ – Part 9 -=============================================================== - -In Part 8 of this Awk series, we introduced some powerful Awk command features, that is variables, numeric expressions and assignment operators. - -As we advance, in this segment, we shall cover more Awk features, and that is the special patterns: `BEGIN` and `END`. - -![](http://www.tecmint.com/wp-content/uploads/2016/07/Learn-Awk-Patterns-BEGIN-and-END.png) ->Learn Awk Patterns BEGIN and END - -These special features will prove helpful as we try to expand on and explore more methods of building complex Awk operations. - -To get started, let us drive our thoughts back to the introduction of the Awk series, remember when we started this series, I pointed out that the general syntax of a running an Awk command is: - -``` -# awk 'script' filenames -``` - -And in the syntax above, the Awk script has the form: - -``` -/pattern/ { actions } -``` - -When you consider the pattern in the script, it is normally a regular expression, additionally, you can also think of pattern as special patterns `BEGIN` and `END`. Therefore, we can also write an Awk command in the form below: - -``` -awk ' -BEGIN { actions } -/pattern/ { actions } -/pattern/ { actions } -………. -END { actions } -' filenames -``` - -In the event that you use the special patterns: `BEGIN` and `END` in an Awk script, this is what each of them means: - -- `BEGIN` pattern: means that Awk will execute the action(s) specified in `BEGIN` once before any input lines are read. -- `END` pattern: means that Awk will execute the action(s) specified in `END` before it actually exits. - -And the flow of execution of the an Awk command script which contains these special patterns is as follows: - -- When the `BEGIN` pattern is used in a script, all the actions for `BEGIN` are executed once before any input line is read. -- Then an input line is read and parsed into the different fields. -- Next, each of the non-special patterns specified is compared with the input line for a match, when a match is found, the action(s) for that pattern are then executed. This stage will be repeated for all the patterns you have specified. -- Next, stage 2 and 3 are repeated for all input lines. -- When all input lines have been read and dealt with, in case you specify the `END` pattern, the action(s) will be executed. - -You should always remember this sequence of execution when working with the special patterns to achieve the best results in an Awk operation. - -To understand it all, let us illustrate using the example from part 8, about the list of domains owned by Tecmint, as stored in a file named domains.txt. - -``` -news.tecmint.com -tecmint.com -linuxsay.com -windows.tecmint.com -tecmint.com -news.tecmint.com -tecmint.com -linuxsay.com -tecmint.com -news.tecmint.com -tecmint.com -linuxsay.com -windows.tecmint.com -tecmint.com -``` - -``` -$ cat ~/domains.txt -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/07/View-Contents-of-File.png) ->View Contents of File - -In this example, we want to count the number of times the domain `tecmint.com` is listed in the file domains.txt. So we wrote a small shell script to help us do that using the idea of variables, numeric expressions and assignment operators which has the following content: - -``` -#!/bin/bash -for file in $@; do -if [ -f $file ] ; then -#print out filename -echo "File is: $file" -#print a number incrementally for every line containing tecmint.com -awk '/^tecmint.com/ { counter+=1 ; printf "%s\n", counter ; }' $file -else -#print error info incase input is not a file -echo "$file is not a file, please specify a file." >&2 && exit 1 -fi -done -#terminate script with exit code 0 in case of successful execution -exit 0 -``` - -Let us now employ the two special patterns: `BEGIN` and `END` in the Awk command in the script above as follows: - -We shall alter the script: - -``` -awk '/^tecmint.com/ { counter+=1 ; printf "%s\n", counter ; }' $file -``` - -To: - -``` -awk ' BEGIN { print "The number of times tecmint.com appears in the file is:" ; } -/^tecmint.com/ { counter+=1 ; } -END { printf "%s\n", counter ; } -' $file -``` - -After making the changes to the Awk command, the complete shell script now looks like this: - -``` -#!/bin/bash -for file in $@; do -if [ -f $file ] ; then -#print out filename -echo "File is: $file" -#print the total number of times tecmint.com appears in the file -awk ' BEGIN { print "The number of times tecmint.com appears in the file is:" ; } -/^tecmint.com/ { counter+=1 ; } -END { printf "%s\n", counter ; } -' $file -else -#print error info incase input is not a file -echo "$file is not a file, please specify a file." >&2 && exit 1 -fi -done -#terminate script with exit code 0 in case of successful execution -exit 0 -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/07/Awk-BEGIN-and-END-Patterns.png) ->Awk BEGIN and END Patterns - -When we run the script above, it will first of all print the location of the file domains.txt, then the Awk command script is executed, where the `BEGIN` special pattern helps us print out the message “`The number of times tecmint.com appears in the file is:`” before any input lines are read from the file. - -Then our pattern, `/^tecmint.com/` is compared against every input line and the action, `{ counter+=1 ; }` is executed for each input line, which counts the number of times `tecmint.com` appears in the file. - -Finally, the `END` pattern will print the total the number of times the domain `tecmint.com` appears in the file. - -``` -$ ./script.sh ~/domains.txt -``` -![](http://www.tecmint.com/wp-content/uploads/2016/07/Script-to-Count-Number-of-Times-String-Appears.png) ->Script to Count Number of Times String Appears - -To conclude, we walked through more Awk features exploring on the concepts of special pattern: `BEGIN` and `END`. - -As I pointed out before, these Awk features will help us build more complex text filtering operations, there is more to cover under Awk features and in part 10, we shall approach the idea of Awk built-in variables, so stay connected. - - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/learn-use-awk-special-patterns-begin-and-end/ - -作者:[Aaron Kili][a] -译者:[ChrisLeeGit](https://github.com/chrisleegit) -校对:[校对ID](https://github.com/校对ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://www.tecmint.com/author/aaronkili/ diff --git a/translated/tech/awk/20160719 Part 9 - Learn How to Use Awk Special Patterns begin and end.md b/translated/tech/awk/20160719 Part 9 - Learn How to Use Awk Special Patterns begin and end.md new file mode 100644 index 0000000000..378811776a --- /dev/null +++ b/translated/tech/awk/20160719 Part 9 - Learn How to Use Awk Special Patterns begin and end.md @@ -0,0 +1,166 @@ +awk 系列:如何使用 awk 的特殊模式 BEGIN 和 END +=============================================================== +在 awk 系列的第八节,我们介绍了一些强大的 awk 命令功能,它们是变量、数字表达式和赋值运算符。 + +本节我们将学习更多的 awk 功能,即 awk 的特殊模式:`BEGIN` 和 `END`。 + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Learn-Awk-Patterns-BEGIN-and-END.png) +> 学习 awk 的模式 BEGIN 和 END + +随着我们逐渐展开,并探索出更多构建复杂 awk 操作的方法,将会证明 awk 的这些特殊功能的是多么强大。 + +开始前,先让我们回顾一下 awk 系列的介绍,记得当我们开始这个系列时,我就指出 awk 指令的通用语法是这样的: + +``` +# awk 'script' filenames +``` + +在上述语法中,awk 脚本拥有这样的形式: + +``` +/pattern/ { actions } +``` + +当你看脚本中的模式(`/pattern`)时,你会发现它通常是一个正则表达式,此外,你也可以将模式(`/pattern`)当成特殊模式 `BEGIN` 和 `END`。 +因此,我们也能按照下面的形式编写一条 awk 命令: + +``` +awk ' +BEGIN { actions } +/pattern/ { actions } +/pattern/ { actions } +………. +END { actions } +' filenames +``` + +假如你在 awk 脚本中使用了特殊模式:`BEGIN` 和 `END`,以下则是它们对应的含义: + +- `BEGIN` 模式:是指 awk 将在读取任何输入行之前立即执行 `BEGIN` 中指定的动作。 +- `END` 模式:是指 awk 将在它正式退出前执行 `END` 中指定的动作。 + +含有这些特殊模式的 awk 命令脚本的执行流程如下: + +- 当在脚本中使用了 `BEGIN` 模式,则 `BEGIN` 中所有的动作都会在读取任何输入行之前执行。 +- 然后,读入一个输入行并解析成不同的段。 +- 接下来,每一条指定的非特殊模式都会和输入行进行比较匹配,当匹配成功后,就会执行模式对应的动作。对所有你指定的模式重复此执行该步骤。 +- 再接下来,对于所有输入行重复执行步骤 2 和 步骤 3。 +- 当读取并处理完所有输入行后,假如你指定了 `END` 模式,那么将会执行相应的动作。 + +当你使用特殊模式时,想要在 awk 操作中获得最好的结果,你应当记住上面的执行顺序。 + +为了便于理解,让我们使用第八节的例子进行演示,那个例子是关于 Tecmint 拥有的域名列表,并保存在一个叫做 domains.txt 的文件中。 + +``` +news.tecmint.com +tecmint.com +linuxsay.com +windows.tecmint.com +tecmint.com +news.tecmint.com +tecmint.com +linuxsay.com +tecmint.com +news.tecmint.com +tecmint.com +linuxsay.com +windows.tecmint.com +tecmint.com +``` + +``` +$ cat ~/domains.txt +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/07/View-Contents-of-File.png) +> 查看文件内容 + +在这个例子中,我们希望统计出 domains.txt 文件中域名 `tecmint.com` 出现的次数。所以,我们编写了一个简单的 shell 脚本帮助我们完成任务,它使用了变量、数学表达式和赋值运算符的思想,脚本内容如下: + +``` +#!/bin/bash +for file in $@; do +if [ -f $file ] ; then +# 输出文件名 +echo "File is: $file" +# 输出一个递增的数字记录包含 tecmint.com 的行数 +awk '/^tecmint.com/ { counter+=1 ; printf "%s\n", counter ; }' $file +else +# 若输入不是文件,则输出错误信息 +echo "$file 不是一个文件,请指定一个文件。" >&2 && exit 1 +fi +done +# 成功执行后使用退出代码 0 终止脚本 +exit 0 +``` + +现在让我们像下面这样在上述脚本的 awk 命令中应用这两个特殊模式:`BEGIN` 和 `END`: + +我们应当把脚本: + +``` +awk '/^tecmint.com/ { counter+=1 ; printf "%s\n", counter ; }' $file +``` + +改成: + +``` +awk ' BEGIN { print "文件中出现 tecmint.com 的次数是:" ; } +/^tecmint.com/ { counter+=1 ; } +END { printf "%s\n", counter ; } +' $file +``` + +在修改了 awk 命令之后,现在完整的 shell 脚本就像下面这样: + +``` +#!/bin/bash +for file in $@; do +if [ -f $file ] ; then +# 输出文件名 +echo "File is: $file" +# 输出文件中 tecmint.com 出现的总次数 +awk ' BEGIN { print "文件中出现 tecmint.com 的次数是:" ; } +/^tecmint.com/ { counter+=1 ; } +END { printf "%s\n", counter ; } +' $file +else +# 若输入不是文件,则输出错误信息 +echo "$file 不是一个文件,请指定一个文件。" >&2 && exit 1 +fi +done +# 成功执行后使用退出代码 0 终止脚本 +exit 0 +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Awk-BEGIN-and-END-Patterns.png) +> awk 模式 BEGIN 和 END + +当我们运行上面的脚本时,它会首先输出 domains.txt 文件的位置,然后执行 awk 命令脚本,该命令脚本中的特殊模式 `BEGIN` 将会在从文件读取任何行之前帮助我们输出这样的消息“`文件中出现 tecmint.com 的次数是:`”。 + +接下来,我们的模式 `/^tecmint.com/` 会在每个输入行中进行比较,对应的动作 `{ counter+=1 ; }` 会在每个匹配成功的行上执行,它会统计出 `tecmint.com` 在文件中出现的次数。 + +最终,`END` 模式将会输出域名 `tecmint.com` 在文件中出现的总次数。 + +``` +$ ./script.sh ~/domains.txt +``` +![](http://www.tecmint.com/wp-content/uploads/2016/07/Script-to-Count-Number-of-Times-String-Appears.png) +> 用于统计字符串出现次数的脚本 + +最后总结一下,我们在本节中演示了更多的 awk 功能,并学习了特殊模式 `BEGIN` 和 `END` 的概念。 + +正如我之前所言,这些 awk 功能将会帮助我们构建出更复杂的文本过滤操作。第十节将会给出更多的 awk 功能,我们将会学习 awk 内置变量的思想,所以,请继续保持关注。 + + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/learn-use-awk-special-patterns-begin-and-end/ + +作者:[Aaron Kili][a] +译者:[ChrisLeeGit](https://github.com/chrisleegit) +校对:[校对ID](https://github.com/校对ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.tecmint.com/author/aaronkili/ From 99c74fdce7d8c3b23b2659bdcbdd616f77f94a6d Mon Sep 17 00:00:00 2001 From: ChrisLeeGit Date: Tue, 2 Aug 2016 11:39:25 +0800 Subject: [PATCH 1335/1469] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=20Part=2010=20-=20Learn=20How=20to=20Use=20Awk=20Built-in=20Va?= =?UTF-8?q?riables?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...160725 Part 10 - Learn How to Use Awk Built-in Variables.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/awk/20160725 Part 10 - Learn How to Use Awk Built-in Variables.md b/sources/tech/awk/20160725 Part 10 - Learn How to Use Awk Built-in Variables.md index 4cbecac8c9..9b66a0cbfe 100644 --- a/sources/tech/awk/20160725 Part 10 - Learn How to Use Awk Built-in Variables.md +++ b/sources/tech/awk/20160725 Part 10 - Learn How to Use Awk Built-in Variables.md @@ -1,3 +1,4 @@ +Being translated by ChrisLeeGit Learn How to Use Awk Built-in Variables – Part 10 ================================================= @@ -111,7 +112,7 @@ After this, we shall progress to cover how we can use shell variables in Awk com via: http://www.tecmint.com/awk-built-in-variables-examples/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tecmint+%28Tecmint%3A+Linux+Howto%27s+Guide%29 作者:[Aaron Kili][a] -译者:[译者ID](https://github.com/译者ID) +译者:[ChrisLeeGit](https://github.com/chrisleegit) 校对:[校对ID](https://github.com/校对ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 020d5f489bd5e3ad3c0c20b1aa9c500641dc3c17 Mon Sep 17 00:00:00 2001 From: kokialoves <498497353@qq.com> Date: Tue, 2 Aug 2016 12:00:37 +0800 Subject: [PATCH 1336/1469] part 5 - Building a data science portfolio - Machine learning project.md (#4264) * Delete part 5 - Building a data science portfolio - Machine learning project.md * part 5 - Building a data science portfolio - Machine learning project.md --- ...ce portfolio - Machine learning project.md | 146 ++++++++---------- 1 file changed, 61 insertions(+), 85 deletions(-) diff --git a/sources/team_test/part 5 - Building a data science portfolio - Machine learning project.md b/sources/team_test/part 5 - Building a data science portfolio - Machine learning project.md index 722aa8f286..99e1046e70 100644 --- a/sources/team_test/part 5 - Building a data science portfolio - Machine learning project.md +++ b/sources/team_test/part 5 - Building a data science portfolio - Machine learning project.md @@ -1,44 +1,38 @@ -[translating by kokialoves] -### Annotating the data +注解数据 +我们已经在annotate.py中添加了一些功能, 现在我们来看一看数据文件. 我们需要将采集到的数据转换到training dataset来进行机器学习的训练. 这涉及到以下几件事情: -We’ve already added a few functions to annotate.py, but now we can get into the meat of the file. We’ll need to convert the acquisition data into a training dataset that can be used in a machine learning algorithm. This involves a few things: +转换所以列数字. +填充缺失值. +分配 performance_count 和 foreclosure_status. +移除出现次数很少的行(performance_count 计数低). +我们有几个列是strings类型的, 看起来对于机器学习算法来说并不是很有用. 然而, 他们实际上是分类变量, 其中有很多不同的类别代码, 例如R,S等等. 我们可以把这些类别标签转换为数值: -- Converting all columns to numeric. -- Filling in any missing values. -- Assigning a performance_count and a foreclosure_status to each row. -- Removing any rows that don’t have a lot of performance history (where performance_count is low). -Several of our columns are strings, which aren’t useful to a machine learning algorithm. However, they are actually categorical variables, where there are a few different category codes, like R, S, and so on. We can convert these columns to numeric by assigning a number to each category label: -![](https://github.com/LCTT/wiki-images/blob/master/TranslateProject/ref_img/002.png) +通过这种方法转换的列我们可以应用到机器学习算法中. -Converting the columns this way will allow us to use them in our machine learning algorithm. +还有一些包含日期的列 (first_payment_date 和 origination_date). 我们可以将这些日期放到两个列中: -Some of the columns also contain dates (first_payment_date and origination_date). We can split these dates into 2 columns each: + 在下面的代码中, 我们将转换采集到的数据. 我们将定义一个函数如下: -![](https://github.com/LCTT/wiki-images/blob/master/TranslateProject/ref_img/003.png) -In the below code, we’ll transform the Acquisition data. We’ll define a function that: - -- Creates a foreclosure_status column in acquisition by getting the values from the counts dictionary. -- Creates a performance_count column in acquisition by getting the values from the counts dictionary. -- Converts each of the following columns from a string column to an integer column: - - channel - - seller - - first_time_homebuyer - - loan_purpose - - property_type - - occupancy_status - - property_state - - product_type -- Converts first_payment_date and origination_date to 2 columns each: - - Splits the column on the forward slash. - - Assigns the first part of the split list to a month column. - - Assigns the second part of the split list to a year column. - - Deletes the column. - - At the end, we’ll have first_payment_month, first_payment_year, origination_month, and origination_year. -- Fills any missing values in acquisition with -1. - -``` +在采集到的数据中创建foreclosure_status列 . +在采集到的数据中创建performance_count列. +将下面的string列转换为integer列: +channel +seller +first_time_homebuyer +loan_purpose +property_type +occupancy_status +property_state +product_type +转换first_payment_date 和 origination_date 为两列: +通过斜杠分离列. +将第一部分分离成月清单. +将第二部分分离成年清单. +删除这一列. +最后, 我们得到 first_payment_month, first_payment_year, origination_month, and origination_year. +所有缺失值填充为-1. def annotate(acquisition, counts): acquisition["foreclosure_status"] = acquisition["id"].apply(lambda x: get_performance_summary_value(x, "foreclosure_status", counts)) acquisition["performance_count"] = acquisition["id"].apply(lambda x: get_performance_summary_value(x, "performance_count", counts)) @@ -63,25 +57,21 @@ def annotate(acquisition, counts): acquisition = acquisition.fillna(-1) acquisition = acquisition[acquisition["performance_count"] > settings.MINIMUM_TRACKING_QUARTERS] return acquisition -``` -### Pulling everything together +聚合到一起 +我们差不多准备就绪了, 我们只需要再在annotate.py添加一点点代码. 在下面代码中, 我们将: -We’re almost ready to pull everything together, we just need to add a bit more code to annotate.py. In the below code, we: - -- Define a function to read in the acquisition data. -- Define a function to write the processed data to processed/train.csv -- If this file is called from the command line, like python annotate.py: - - Read in the acquisition data. - - Compute the counts for the performance data, and assign them to counts. - - Annotate the acquisition DataFrame. - - Write the acquisition DataFrame to train.csv. - -``` +定义一个函数来读取采集的数据. +定义一个函数来写入数据到/train.csv +如果我们在命令行运行annotate.py来读取更新过的数据文件,它将做如下事情: +读取采集到的数据. +计算数据性能. +注解数据. +将注解数据写入到train.csv. def read(): acquisition = pd.read_csv(os.path.join(settings.PROCESSED_DIR, "Acquisition.txt"), sep="|") return acquisition - + def write(acquisition): acquisition.to_csv(os.path.join(settings.PROCESSED_DIR, "train.csv"), index=False) @@ -90,13 +80,11 @@ if __name__ == "__main__": counts = count_performance_rows() acquisition = annotate(acquisition, counts) write(acquisition) -``` -Once you’re done updating the file, make sure to run it with python annotate.py, to generate the train.csv file. You can find the complete annotate.py file [here][34]. +修改完成以后为了确保annotate.py能够生成train.csv文件. 你可以在这里找到完整的 annotate.py file [here][34]. -The folder should now look like this: +文件夹结果应该像这样: -``` loan-prediction ├── data │ ├── Acquisition_2012Q1.txt @@ -114,54 +102,42 @@ loan-prediction ├── README.md ├── requirements.txt ├── settings.py -``` -### Finding an error metric +找到标准 +我们已经完成了training dataset的生成, 现在我们需要最后一步, 生成预测. 我们需要找到错误的标准, 以及该如何评估我们的数据. 在这种情况下, 因为有很多的贷款没有收回, 所以根本不可能做到精确的计算. -We’re done with generating our training dataset, and now we’ll just need to do the final step, generating predictions. We’ll need to figure out an error metric, as well as how we want to evaluate our data. In this case, there are many more loans that aren’t foreclosed on than are, so typical accuracy measures don’t make much sense. +我们需要读取数据, 并且计算foreclosure_status列, 我们将得到如下信息: -If we read in the training data, and check the counts in the foreclosure_status column, here’s what we get: - -``` import pandas as pd import settings train = pd.read_csv(os.path.join(settings.PROCESSED_DIR, "train.csv")) train["foreclosure_status"].value_counts() -``` -``` False 4635982 True 1585 Name: foreclosure_status, dtype: int64 -``` -Since so few of the loans were foreclosed on, just checking the percentage of labels that were correctly predicted will mean that we can make a machine learning model that predicts False for every row, and still gets a very high accuracy. Instead, we’ll want to use a metric that takes the class imbalance into account, and ensures that we predict foreclosures accurately. We don’t want too many false positives, where we make predict that a loan will be foreclosed on even though it won’t, or too many false negatives, where we predict that a loan won’t be foreclosed on, but it is. Of these two, false negatives are more costly for Fannie Mae, because they’re buying loans where they may not be able to recoup their investment. +因为只有一点点贷款收回, 通过百分比标签来建立的机器学习模型会把每行都设置为Fasle, 所以我们在这里要考虑每个样本的不平衡性,确保我们做出的预测是准确的. 我们不想要这么多假的false, 我们将预计贷款收回但是它并没有收回, 我们预计贷款不会回收但是却回收了. 通过以上两点, Fannie Mae的false太多了, 因此显示他们可能无法收回投资. -We’ll define false negative rate as the number of loans where the model predicts no foreclosure but the the loan was actually foreclosed on, divided by the number of total loans that were actually foreclosed on. This is the percentage of actual foreclosures that the model “Missed”. Here’s a diagram: - -![](https://github.com/LCTT/wiki-images/blob/master/TranslateProject/ref_img/004.png) - -In the diagram above, 1 loan was predicted as not being foreclosed on, but it actually was. If we divide this by the number of loans that were actually foreclosed on, 2, we get the false negative rate, 50%. We’ll use this as our error metric, so we can evaluate our model’s performance. - -### Setting up the classifier for machine learning - -We’ll use cross validation to make predictions. With cross validation, we’ll divide our data into 3 groups. Then we’ll do the following: - -- Train a model on groups 1 and 2, and use the model to make predictions for group 3. -- Train a model on groups 1 and 3, and use the model to make predictions for group 2. -- Train a model on groups 2 and 3, and use the model to make predictions for group 1. - -Splitting it up into groups this way means that we never train a model using the same data we’re making predictions for. This avoids overfitting. If we overfit, we’ll get a falsely low false negative rate, which makes it hard to improve our algorithm or use it in the real world. - -[Scikit-learn][35] has a function called [cross_val_predict][36] which will make it easy to perform cross validation. - -We’ll also need to pick an algorithm to use to make predictions. We need a classifier that can do [binary classification][37]. The target variable, foreclosure_status only has two values, True and False. - -We’ll use [logistic regression][38], because it works well for binary classification, runs extremely quickly, and uses little memory. This is due to how the algorithm works – instead of constructing dozens of trees, like a random forest, or doing expensive transformations, like a support vector machine, logistic regression has far fewer steps involving fewer matrix operations. - -We can use the [logistic regression classifier][39] algorithm that’s implemented in scikit-learn. The only thing we need to pay attention to is the weights of each class. If we weight the classes equally, the algorithm will predict False for every row, because it is trying to minimize errors. However, we care much more about foreclosures than we do about loans that aren’t foreclosed on. Thus, we’ll pass balanced to the class_weight keyword argument of the [LogisticRegression][40] class, to get the algorithm to weight the foreclosures more to account for the difference in the counts of each class. This will ensure that the algorithm doesn’t predict False for every row, and instead is penalized equally for making errors in predicting either class. +所以我们将定义一个百分比,就是模型预测没有收回但是实际上收回了, 这个数除以总的负债回收总数. 这个负债回收百分比模型实际上是“没有的”. 下面看这个图表: +通过上面的图表, 1个负债预计不会回收, 也确实没有回收. 如果我们将这个数除以总数, 2, 我们将得到false的概率为50%. 我们将使用这个标准, 因此我们可以评估一下模型的性能. +设置机器学习分类器 +我们使用交叉验证预测. 通过交叉验证法, 我们将数据分为3组. 按照下面的方法来做: + +Train a model on groups 1 and 2, and use the model to make predictions for group 3. +Train a model on groups 1 and 3, and use the model to make predictions for group 2. +Train a model on groups 2 and 3, and use the model to make predictions for group 1. +将它们分割到不同的组 ,这意味着我们永远不会用相同的数据来为预测训练模型. 这样就避免了 overfitting. 如果我们overfit, 我们将得到很低的false概率, 这使得我们难以改进算法或者应用到现实生活中. + +[Scikit-learn][35] 有一个叫做 [cross_val_predict][36] 他可以帮助我们理解交叉算法. + +我们还需要一种算法来帮我们预测. 我们还需要一个分类器 [binary classification][37](二元分类). 目标变量foreclosure_status 只有两个值, True 和 False. + +我们用[logistic regression][38](回归算法), 因为它能很好的进行binary classification(二元分类), 并且运行很快, 占用内存很小. 我们来说一下它是如何工作的 – 取代许多树状结构, 更像随机森林, 进行转换, 更像一个向量机, 逻辑回归涉及更少的步骤和更少的矩阵. + +我们可以使用[logistic regression classifier][39](逻辑回归分类器)算法 来实现scikit-learn. 我们唯一需要注意的是每个类的标准. 如果我们使用同样标准的类, 算法将会预测每行都为false, 因为它总是试图最小化误差.不管怎样, 我们关注有多少贷款能够回收而不是有多少不能回收. 因此, 我们通过 [LogisticRegression][40](逻辑回归)来平衡标准参数, 并计算回收贷款的标准. 这将使我们的算法不会认为每一行都为false. From 725d3a6a81c30c27799bc055a116d7439da3138b Mon Sep 17 00:00:00 2001 From: FSSlc Date: Tue, 2 Aug 2016 13:33:49 +0800 Subject: [PATCH 1337/1469] [Translated]20160715 bc-Command line calculator.md --- .../20160715 bc - Command line calculator.md | 133 ------------------ .../20160715 bc - Command line calculator.md | 129 +++++++++++++++++ 2 files changed, 129 insertions(+), 133 deletions(-) delete mode 100644 sources/tech/20160715 bc - Command line calculator.md create mode 100644 translated/tech/20160715 bc - Command line calculator.md diff --git a/sources/tech/20160715 bc - Command line calculator.md b/sources/tech/20160715 bc - Command line calculator.md deleted file mode 100644 index a85ebc4985..0000000000 --- a/sources/tech/20160715 bc - Command line calculator.md +++ /dev/null @@ -1,133 +0,0 @@ -FSSlc translating - -bc: Command line calculator -============================ - -![](https://cdn.fedoramagazine.org/wp-content/uploads/2016/07/bc-calculator-945x400.jpg) - -If you run a graphical desktop environment, you probably point and click your way to a calculator when you need one. The Fedora Workstation, for example, includes the Calculator tool. It features several different operating modes that allow you to do, for example, complex math or financial calculations. But did you know the command line also offers a similar calculator called bc? - -The bc utility gives you everything you expect from a scientific, financial, or even simple calculator. What’s more, it can be scripted from the command line if needed. This allows you to use it in shell scripts, in case you need to do more complex math. - -Because bc is used by some other system software, like CUPS printing services, it’s probably installed on your Fedora system already. You can check with this command: - -``` -dnf list installed bc -``` - -If you don’t see it for some reason, you can install the package with this command: - -``` -sudo dnf install bc -``` - -### Doing simple math with bc - -One way to use bc is to enter the calculator’s own shell. There you can run many calculations in a row. When you enter, the first thing that appears is a notice about the program: - -``` -$ bc -bc 1.06.95 -Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc. -This is free software with ABSOLUTELY NO WARRANTY. -For details type `warranty'. -``` - -Now you can type in calculations or commands, one per line: - -``` -1+1 -``` - -The calculator helpfully answers: - -``` -2 -``` - -You can perform other commands here. You can use addition (+), subtraction (-), multiplication (*), division (/), parentheses, exponents (^), and so forth. Note that the calculator respects all expected conventions such as order of operations. Try these examples: - -``` -(4+7)*2 -4+7*2 -``` - -To exit, send the “end of input” signal with the key combination Ctrl+D. - -Another way is to use the echo command to send calculations or commands. Here’s the calculator equivalent of “Hello, world,” using the shell’s pipe function (|) to send output from echo into bc: - -``` -echo '1+1' | bc -``` - -You can send more than one calculation using the shell pipe, with a semicolon to separate entries. The results are returned on separate lines. - -``` -echo '1+1; 2+2' | bc -``` - -### Scale - -The bc calculator uses the concept of scale, or the number of digits after a decimal point, in some calculations. The default scale is 0. Division operations always use the scale setting. So if you don’t set scale, you may get unexpected answers: - -``` -echo '3/2' | bc -echo 'scale=3; 3/2' | bc -``` - -Multiplication uses a more complex decision for scale: - -``` -echo '3*2' | bc -echo '3*2.0' | bc -``` - -Meanwhile, addition and subtraction are more as expected: - -``` -echo '7-4.15' | bc -``` - -### Other base number systems - -Another useful function is the ability to use number systems other than base-10 (decimal). For instance, you can easily do hexadecimal or binary math. Use the ibase and obase commands to set input and output base systems between base-2 and base-16. Remember that once you use ibase, any number you enter is expected to be in the new declared base. - -To do hexadecimal to decimal conversions or math, you can use a command like this. Note the hexadecimal digits above 9 must be in uppercase (A-F): - -``` -echo 'ibase=16; A42F' | bc -echo 'ibase=16; 5F72+C39B' | bc -``` - -To get results in hexadecimal, set the obase as well: - -``` -echo 'obase=16; ibase=16; 5F72+C39B' | bc -``` - -Here’s a trick, though. If you’re doing these calculations in the shell, how do you switch back to input in base-10? The answer is to use ibase, but you must set it to the equivalent of decimal number 10 in the current input base. For instance, if ibase was set to hexadecimal, enter: - -``` -ibase=A -``` - -Once you do this, all input numbers are now decimal again, so you can enter obase=10 to reset the output base system. - -### Conclusion - -This is only the beginning of what bc can do. It also allows you to define functions, variables, and loops for complex calculations and programs. You can save these programs as text files on your system to run whenever you need. You can find numerous resources on the web that offer examples and additional function libraries. Happy calculating! - - - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/mandatory-access-control-with-selinux-or-apparmor-linux/ - -作者:[Paul W. Frields][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/author/pfrields/ -[1]: http://phodd.net/gnu-bc/ diff --git a/translated/tech/20160715 bc - Command line calculator.md b/translated/tech/20160715 bc - Command line calculator.md new file mode 100644 index 0000000000..d5dc711909 --- /dev/null +++ b/translated/tech/20160715 bc - Command line calculator.md @@ -0,0 +1,129 @@ +bc : 一个命令行计算器 +============================ + +![](https://cdn.fedoramagazine.org/wp-content/uploads/2016/07/bc-calculator-945x400.jpg) + +假如你运行在一个图形桌面环境中,当你需要一个计算器时,你可能只需要一路进行点击便可以找到一个计算器。例如,Fedora 工作站中就已经包含了一个名为 `Calculator` 的工具。它有着几种不同的操作模式,例如,你可以进行复杂的数学运算或者金融运算。但是,你知道吗,命令行也提供了一个与之相似的名为 `bc` 的工具? + +`bc` 工具可以为你提供你期望一个科学计算器、金融计算器或者是简单的计算器所能提供的所有功能。另外,假如需要的话,它还可以从命令行中被脚本化。这使得当你需要做复杂的数学运算时,你可以在 shell 脚本中使用它。 + +因为 bc 被其他的系统软件所使用,例如 CUPS 打印服务,它可能已经在你的 Fedora 系统中被安装了。你可以使用下面这个命令来进行检查: + +``` +dnf list installed bc +``` + +假如因为某些原因你没有在上面命令的输出中看到它,你可以使用下面的这个命令来安装它: + +``` +sudo dnf install bc +``` + +### 用 bc 做一些简单的数学运算 + +使用 bc 的一种方式是进入它自己的 shell。在那里你可以在一行中做许多次计算。但在你键入 bc 后,首先出现的是有关这个程序的警告: + +``` +$ bc +bc 1.06.95 +Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc. +This is free software with ABSOLUTELY NO WARRANTY. +For details type `warranty'. +``` + +现在你可以按照每行一个输入运算式或者命令了: + +``` +1+1 +``` + +bc 会回答上面计算式的答案是: + +``` +2 +``` + +在这里你还可以执行其他的命令。你可以使用 加(+)、减(-)、乘(*)、除(/)、圆括号、指数符号(^) 等等。请注意 bc 同样也遵循所有约定俗成的运算规定,例如运算的先后顺序。你可以试试下面的例子: + +``` +(4+7)*2 +4+7*2 +``` + +若要离开 bc 可以通过按键组合 `Ctrl+D` 来发送 “输入结束”信号给 bc 。 + +使用 bc 的另一种方式是使用 `echo` 命令来传递运算式或命令。下面这个示例类似于计算器中的 "Hello, world" 例子,使用 shell 的管道函数(|) 来将 `echo` 的输出传入 `bc` 中: + +``` +echo '1+1' | bc +``` + +使用 shell 的管道,你可以发送不止一个运算操作,你需要使用分号来分隔不同的运算。结果将在不同的行中返回。 + +``` +echo '1+1; 2+2' | bc +``` + +### 精度 + +在某些计算中,bc 会使用精度的概念,即小数点后面的数字位数。默认的精度是 0。除法操作总是使用精度的设定。所以,如果你没有设置精度,有可能会带来意想不到的答案: + +``` +echo '3/2' | bc +echo 'scale=3; 3/2' | bc +``` + +乘法使用一个更复杂的精度选择机制: + +``` +echo '3*2' | bc +echo '3*2.0' | bc +``` + +同时,加法和减法的相关运算则与之相似: + +``` +echo '7-4.15' | bc +``` + +### 其他进制系统 + +bc 的另一个有用的功能是可以使用除 十进制以外的其他计数系统。例如,你可以轻松地做十六进制或二进制的数学运算。可以使用 `ibase` 和 `obase` 命令来分别设定输入和输出的进制系统。需要记住的是一旦你使用了 `ibase`,之后你输入的任何数字都将被认为是在新定义的进制系统中。 + +要做十六进制数到十进制数的转换或运算,你可以使用类似下面的命令。请注意大于 9 的十六进制数必须是大写的(A-F): + +``` +echo 'ibase=16; A42F' | bc +echo 'ibase=16; 5F72+C39B' | bc +``` + +若要使得结果是十六进制数,则需要设定 `obase` : + +``` +echo 'obase=16; ibase=16; 5F72+C39B' | bc +``` + +下面是一个小技巧。假如你在 shell 中做这些运算,怎样才能使得输入重新为十进制数呢?答案是使用 `ibase` 命令,但你必须设定它为在当前进制中与十进制中的 10 等价的值。例如,假如 `ibase` 被设定为十六进制,你需要输入: + +``` +ibase=A +``` + +一旦你执行了上面的命令,所有输入的数字都将是十进制的了,接着你便可以输入 `obase=10` 来重置输出的进制系统。 + +### 结论 + +上面所提到的只是 bc 所能做到的基础。它还允许你为某些复杂的运算和程序定义函数、变量和循环结构。你可以在你的系统中将这些程序保存为文本文件以便你在需要的时候使用。你还可以在网上找到更多的资源,它们提供了更多的例子以及额外的函数库。快乐地计算吧! + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/mandatory-access-control-with-selinux-or-apparmor-linux/ + +作者:[Paul W. Frields][a] +译者:[FSSlc](https://github.com/FSSlc) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/pfrields/ +[1]: http://phodd.net/gnu-bc/ From a49a41f4118638a4b0e60ca491691aa577c8adf5 Mon Sep 17 00:00:00 2001 From: cposture Date: Tue, 2 Aug 2016 13:35:33 +0800 Subject: [PATCH 1338/1469] Translating by cposture --- ...lding a data science portfolio - Machine learning project.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/team_test/part 6 - Building a data science portfolio - Machine learning project.md b/sources/team_test/part 6 - Building a data science portfolio - Machine learning project.md index 86ecbe127d..3bec1d0a98 100644 --- a/sources/team_test/part 6 - Building a data science portfolio - Machine learning project.md +++ b/sources/team_test/part 6 - Building a data science portfolio - Machine learning project.md @@ -1,4 +1,4 @@ - +Translating by cposture 2016-08-02 ### Making predictions Now that we have the preliminaries out of the way, we’re ready to make predictions. We’ll create a new file called predict.py that will use the train.csv file we created in the last step. The below code will: From 38e37b6e10377cb56045ae51075f2f53ba1e37b0 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 2 Aug 2016 14:05:14 +0800 Subject: [PATCH 1339/1469] PUB:20160721 5 tricks for getting started with Vim MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @maywanting 翻译的不错,不过有个别语句我有不同理解,你可以看看,如有不同意见,欢迎讨论改进。 --- ...1 5 tricks for getting started with Vim.md | 60 +++++++++++++++++++ ...1 5 tricks for getting started with Vim.md | 60 ------------------- 2 files changed, 60 insertions(+), 60 deletions(-) create mode 100644 published/20160721 5 tricks for getting started with Vim.md delete mode 100644 translated/tech/20160721 5 tricks for getting started with Vim.md diff --git a/published/20160721 5 tricks for getting started with Vim.md b/published/20160721 5 tricks for getting started with Vim.md new file mode 100644 index 0000000000..684a1d6295 --- /dev/null +++ b/published/20160721 5 tricks for getting started with Vim.md @@ -0,0 +1,60 @@ +Vim 起步的五个技巧 +===================================== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/education/BUSINESS_peloton.png?itok=nuMbW9d3) + +多年来,我一直想学 Vim。如今 Vim 是我最喜欢的 Linux 文本编辑器,也是开发者和系统管理者最喜爱的开源工具。我说的学习,指的是真正意义上的学习。想要精通确实很难,所以我只想要达到熟练的水平。我使用了这么多年的 Linux ,我会的也仅仅只是打开一个文件,使用上下左右箭头按键来移动光标,切换到插入模式,更改一些文本,保存,然后退出。 + +但那只是 Vim 的最最基本的操作。我的技能水平只能让我在终端使用 Vim 修改文本,但是它并没有任何一个我想象中强大的文本处理功能。这样我完全无法用 Vim 发挥出胜出 Pico 和 Nano 的能力。 + +所以到底为什么要学习 Vim?因为我花费了相当多的时间用于编辑文本,而且我知道还有很大的效率提升空间。为什么不选择 Emacs,或者是更为现代化的编辑器例如 Atom?因为 Vim 适合我,至少我有一丁点的使用经验。而且,很重要的一点就是,在我需要处理的系统上很少碰见没有装 Vim 或者它的弱化版(Vi)。如果你有强烈的欲望想学习对你来说更给力的 Emacs,我希望这些对于 Emacs 同类编辑器的建议能对你有所帮助。 + +花了几周的时间专注提高我的 Vim 使用技巧之后,我想分享的第一个建议就是必须使用它。虽然这看起来就是明知故问的回答,但事实上它比我所预想的计划要困难一些。我的大多数工作是在网页浏览器上进行的,而且每次我需要在浏览器之外打开并编辑一段文本时,就需要避免下意识地打开 Gedit。Gedit 已经放在了我的快速启动栏中,所以第一步就是移除这个快捷方式,然后替换成 Vim 的。 + +为了更好的学习 Vim,我尝试了很多。如果你也正想学习,以下列举了一些作为推荐。 + +### Vimtutor + +通常如何开始学习最好就是使用应用本身。我找到一个小的应用叫 Vimtutor,当你在学习编辑一个文本时它能辅导你一些基础知识,它向我展示了很多我这些年都忽视的基础命令。Vimtutor 一般在有 Vim 的地方都能找到它,如果你的系统上没有 Vimtutor,Vimtutor 可以很容易从你的包管理器上安装。 + +### GVim + +我知道并不是每个人都认同这个,但就是它让我从使用终端中的 Vim 转战到使用 GVim 来满足我基本编辑需求。反对者表示 GVim 鼓励使用鼠标,而 Vim 主要是为键盘党设计的。但是我能通过 GVim 的下拉菜单快速找到想找的指令,并且 GVim 可以提醒我正确的指令然后通过敲键盘执行它。努力学习一个新的编辑器然后陷入无法解决的困境,这种感觉并不好受。每隔几分钟读一下 man 出来的文字或者使用搜索引擎来提醒你该用的按键序列也并不是最好的学习新事物的方法。 + +### 键盘表 + +当我转战 GVim,我发现有一个键盘的“速查表”来提醒我最基础的按键很是便利。网上有很多这种可用的表,你可以下载、打印,然后贴在你身边的某一处地方。但是为了我的笔记本键盘,我选择买一沓便签纸。这些便签纸在美国不到 10 美元,当我使用键盘编辑文本,尝试新的命令的时候,可以随时提醒我。 + +### Vimium + +上文提到,我工作都在浏览器上进行。其中一条我觉得很有帮助的建议就是,使用 [Vimium][1] 来用增强使用 Vim 的体验。Vimium 是 Chrome 浏览器上的一个开源插件,能用 Vim 的指令快捷操作 Chrome。我发现我只用了几次使用快捷键切换上下文,就好像比之前更熟悉这些快捷键了。同样的扩展 Firefox 上也有,例如 [Vimerator][2]。 + +### 其它人 + +毫无疑问,最好的学习方法就是求助于在你之前探索过的人,让他给你建议、反馈和解决方法。 + +如果你住在一个大城市,那么附近可能会有一个 Vim meetup 小组,或者还有 Freenode IRC 上的 #vim 频道。#vim 频道是 Freenode 上最活跃的频道之一,那上面可以针对你个人的问题来提供帮助。听上面的人发发牢骚或者看看别人尝试解决自己没有遇到过的问题,仅仅是这样我都觉得很有趣。 + +------ + +那么,现在怎么样了?到现在为止还不错。为它所花的时间是否值得就在于之后它为你节省了多少时间。但是当我发现一个新的按键序列可以来跳过词,或者一些相似的小技巧,我经常会收获意外的惊喜与快乐。每天我至少可以看见,一点点的回报,正在逐渐配得上当初的付出。 + +学习 Vim 并不仅仅只有这些建议,还有很多。我很喜欢指引别人去 [Vim Advantures][3],它是一种使用 Vim 按键方式进行移动的在线游戏。而在另外一天我在 [Vimgifts.com][4] 发现了一个非常神奇的虚拟学习工具,那可能就是你真正想要的:用一个小小的 gif 动图来描述 Vim 操作。 + +你有花时间学习 Vim 吗?或者是任何需要大量键盘操作的程序?那些经过你努力后掌握的工具,你认为这些努力值得吗?效率的提高有没有达到你的预期?分享你们的故事在下面的评论区吧。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/16/7/tips-getting-started-vim + +作者:[Jason Baker][a] +译者:[maywanting](https://github.com/maywanting) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jason-baker +[1]: https://github.com/philc/vimium +[2]: http://www.vimperator.org/ +[3]: http://vim-adventures.com/ +[4]: http://vimgifs.com/ diff --git a/translated/tech/20160721 5 tricks for getting started with Vim.md b/translated/tech/20160721 5 tricks for getting started with Vim.md deleted file mode 100644 index 67d64ced2f..0000000000 --- a/translated/tech/20160721 5 tricks for getting started with Vim.md +++ /dev/null @@ -1,60 +0,0 @@ -Vim 学习的 5 个技巧 -===================================== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/education/BUSINESS_peloton.png?itok=nuMbW9d3) - -多年来,我一直想学 Vim。如今 Vim 是我最喜欢的 Linux 文本编辑器,也是开发者和系统管理者最喜爱的开源工具。我说的学习,指的是真正意义上的学习。想要精通确实很难,所以我只想要达到熟练的水平。根据我多年使用 Linux 的经验,我会的也仅仅只是打开一个文件,使用上下左右箭头按键来移动光标,切换到 insert 模式,更改一些文本,保存,然后退出。 - -但那只是 Vim 的最基本操作。Vim 可以让我在终端修改文本,但是它并没有任何一个我想象中强大的文本处理功能。这样我无法说明 Vim 完全优于 Pico 和 Nano。 - -所以到底为什么要学习 Vim?因为我需要花费相当多的时间用于编辑文本,而且有很大的效率提升空间。为什么不选择 Emacs,或者是更为现代化的编辑器例如 Atom?因为 Vim 适合我,至少我有一丁点的使用经验。而且,很重要的一点就是,在我需要处理的系统上很少碰见没有装 Vim 或者它的简化版(Vi)。如果你有强烈的欲望想学习 Emacs,我希望这些对于 Emacs 同类编辑器的建议能对你有所帮助。 - -花了几周的时间专注提高我的 Vim 使用技巧之后,我想分享的第一个建议就是必须使用工具。虽然这看起来就是明知故问的回答,但事实上比我所想的在代码层面上还要困难。我的大多数工作是在网页浏览器上进行的,而且我每次都得有针对性的用 Gedit 打开并修改一段浏览器之外的文本。Gedit 需要快捷键来启动,所以第一步就是移出快捷键然后替换成 Vim 的快捷键。 - -为了跟更好的学习 Vim,我尝试了很多。如果你也正想学习,以下列举了一些作为推荐。 - -### Vimtutor - -通常如何开始学习最好就是使用应用本身。我找到一个小的应用叫 Vimtutor,当你在学习编辑一个文本时它能辅导你一些基础知识,它向我展示了很多我这些年都忽视的基础命令。Vimtutor 上到处都是 Vim 影子,如果你的系统上没有 Vimtutor,Vimtutor可以很容易从你的包管理器上下载。 - -### GVim - -我知道并不是每个人都认同这个,但就是它让我从使用在终端的 Vim 转战到使用 GVim 来满足我基本编辑需求。反对者表示 GVim 鼓励使用鼠标,而 Vim 主要是为键盘党设计的。但是我能通过 GVim 的下拉菜单快速找到想找的指令,并且 GVim 可以提醒我正确的指令然后通过敲键盘执行它。努力学习一个新的编辑器然后陷入无法解决的困境,这种感觉并不好受。每隔几分钟读一下 man 出来的文字或者使用搜索引擎来提醒你指令也并不是最好的学习新事务的方法。 - -### Keyboard maps - -当我转战 GVim,我发现有一个键盘的“作弊表”来提醒我最基础的按键很是便利。网上有很多这种可用的表,你可以下载,打印,然后贴在你身边的某一处地方。但是为了我的笔记本键盘,我选择买一沓便签纸。这些便签纸在美国不到10美元,而且当我使用键盘编辑文本尝试新的命令的时候,可以随时提醒我。 - -### Vimium - -上文提到,我工作都在浏览器上进行。其中一条我觉得很有帮助的建议就是,使用 [Vimium][1] 来用增强使用 Vim 的体验。Vimium 是 Chrome 浏览器上的一个开源插件,能用 Vim 的指令快捷操作 Chrome。当我有意识的使用快捷键切换文本的次数越少时,这说明我越来越多的使用这些快捷键。同样的扩展 Firefox 上也有,例如 [Vimerator][2]。 - -### 人 - -毫无疑问,最好的学习方法就是求助于在你之前探索过的人,让他给你建议、反馈和解决方法。 - -如果你住在一个大城市,那么附近可能会有一个 Vim meetup 组,不然就是在 Freenode IRC 上的 #vim 频道。#vim 频道是 Freenode 上最活跃的频道之一,那上面可以针对你个人的问题来提供帮助。听上面的人发发牢骚或者看看别人尝试解决自己没有遇到过的问题,仅仅是这样我都觉得很有趣。 - ------- - -所以是什么成就了现在?如今便是极好。为它所花的时间是否值得就在于之后它为你节省了多少时间。但是我经常收到意外的惊喜与快乐,当我发现一个新的按键指令来复制、跳过词,或者一些相似的小技巧。每天我至少可以看见,一点点回报,正在逐渐配得上当初的付出。 - -学习 Vim 并不仅仅只有这些建议,还有很多。我很喜欢指引别人去 [Vim Advantures][3],它是一种只能使用 Vim 的快捷键的在线游戏。而且某天我发现了一个非常神奇的虚拟学习工具,在 [Vimgifts.com][4],那上面有明确的你想要的:用一个 gif 动图来描述,使用一点点 Vim 操作来达到他们想要的。 - -你有花时间学习 Vim 吗?或者有大量键盘操作交互体验的程序上投资时间吗?那些经过你努力后掌握的工具,你认为这些努力值得吗?效率的提高有达到你的预期?分享你们的故事在下面的评论区吧。 - --------------------------------------------------------------------------------- - -via: https://opensource.com/life/16/7/tips-getting-started-vim - -作者:[Jason Baker ][a] -译者:[maywanting](https://github.com/maywanting) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jason-baker -[1]: https://github.com/philc/vimium -[2]: http://www.vimperator.org/ -[3]: http://vim-adventures.com/ -[4]: http://vimgifs.com/ From d4e82db38c29b847f19e2b9118e5ee8a49311780 Mon Sep 17 00:00:00 2001 From: WEIYUE XIE Date: Tue, 2 Aug 2016 19:15:14 +0800 Subject: [PATCH 1340/1469] =?UTF-8?q?Update=20and=20rename=20part=202=20-?= =?UTF-8?q?=20Building=20a=20data=20science=20portfolio=20-=20Machine=20le?= =?UTF-8?q?arning=20project.md=20to=20=E7=BF=BB=E8=AF=91=E4=B8=AD=20ideas4?= =?UTF-8?q?u=20part=202=20-=20Building=20a=20data=20science=20portfolio=20?= =?UTF-8?q?-=20Machine=20learning=20project.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ideas4u 翻译中 --- ...data science portfolio - Machine learning project.md} | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) rename sources/team_test/{part 2 - Building a data science portfolio - Machine learning project.md => 翻译中 ideas4u part 2 - Building a data science portfolio - Machine learning project.md} (91%) diff --git a/sources/team_test/part 2 - Building a data science portfolio - Machine learning project.md b/sources/team_test/翻译中 ideas4u part 2 - Building a data science portfolio - Machine learning project.md similarity index 91% rename from sources/team_test/part 2 - Building a data science portfolio - Machine learning project.md rename to sources/team_test/翻译中 ideas4u part 2 - Building a data science portfolio - Machine learning project.md index 2b429aaab8..4a4fe73553 100644 --- a/sources/team_test/part 2 - Building a data science portfolio - Machine learning project.md +++ b/sources/team_test/翻译中 ideas4u part 2 - Building a data science portfolio - Machine learning project.md @@ -1,7 +1,7 @@ -### Understanding the data +### 理解数据 Let’s take a quick look at the raw data files. Here are the first few rows of the acquisition data from quarter 1 of 2012: - +让我们来简单看一下原始数据文件。下面是2012年1季度采集数据的前几行。 ``` 100000853384|R|OTHER|4.625|280000|360|02/2012|04/2012|31|31|1|23|801|N|C|SF|1|I|CA|945||FRM| 100003735682|R|SUNTRUST MORTGAGE INC.|3.99|466000|360|01/2012|03/2012|80|80|2|30|794|N|P|SF|1|P|MD|208||FRM|788 @@ -10,6 +10,7 @@ Let’s take a quick look at the raw data files. Here are the first few rows of Here are the first few rows of the performance data from quarter 1 of 2012: +下面是2012年1季度执行数据的前几行 ``` 100000853384|03/01/2012|OTHER|4.625||0|360|359|03/2042|41860|0|N|||||||||||||||| 100000853384|04/01/2012||4.625||1|359|358|03/2042|41860|0|N|||||||||||||||| @@ -17,10 +18,14 @@ Here are the first few rows of the performance data from quarter 1 of 2012: ``` Before proceeding too far into coding, it’s useful to take some time and really understand the data. This is more critical in operational projects – because we aren’t interactively exploring the data, it can be harder to spot certain nuances unless we find them upfront. In this case, the first step is to read the materials on the Fannie Mae site: - +在开始编码之前,花些时间真正理解数据是值得的。这对于操作项目优为重要,因为我们没有交互式探索数据,将很难察觉到细微的差别除非我们在前期发现他们。在这种情况下,第一个步骤是阅读房利美站点的资料: - [Overview][15] +- [概述][15] - [Glossary of useful terms][16] +- [用用的术语表][16] - [FAQs][17] +- [问答][17] +- [Columns in the Acquisition and Performance files][18] - [Columns in the Acquisition and Performance files][18] - [Sample Acquisition data file][19] - [Sample Performance data file][20] From 4110b9b4fa4f9753a42de5723cc832d0fa67d79a Mon Sep 17 00:00:00 2001 From: WEIYUE XIE Date: Tue, 2 Aug 2016 20:30:46 +0800 Subject: [PATCH 1341/1469] =?UTF-8?q?Update=20=E7=BF=BB=E8=AF=91=E4=B8=AD?= =?UTF-8?q?=20ideas4u=20part=202=20-=20Building=20a=20data=20science=20por?= =?UTF-8?q?tfolio=20-=20Machine=20learning=20project.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译2 --- ...ience portfolio - Machine learning project.md | 47 ++++++++----------- 1 file changed, 20 insertions(+), 27 deletions(-) diff --git a/sources/team_test/翻译中 ideas4u part 2 - Building a data science portfolio - Machine learning project.md b/sources/team_test/翻译中 ideas4u part 2 - Building a data science portfolio - Machine learning project.md index 4a4fe73553..27c7604922 100644 --- a/sources/team_test/翻译中 ideas4u part 2 - Building a data science portfolio - Machine learning project.md +++ b/sources/team_test/翻译中 ideas4u part 2 - Building a data science portfolio - Machine learning project.md @@ -1,54 +1,47 @@ ### 理解数据 -Let’s take a quick look at the raw data files. Here are the first few rows of the acquisition data from quarter 1 of 2012: -让我们来简单看一下原始数据文件。下面是2012年1季度采集数据的前几行。 +我们来简单看一下原始数据文件。下面是2012年1季度前几行的采集数据。 ``` 100000853384|R|OTHER|4.625|280000|360|02/2012|04/2012|31|31|1|23|801|N|C|SF|1|I|CA|945||FRM| 100003735682|R|SUNTRUST MORTGAGE INC.|3.99|466000|360|01/2012|03/2012|80|80|2|30|794|N|P|SF|1|P|MD|208||FRM|788 100006367485|C|PHH MORTGAGE CORPORATION|4|229000|360|02/2012|04/2012|67|67|2|36|802|N|R|SF|1|P|CA|959||FRM|794 ``` -Here are the first few rows of the performance data from quarter 1 of 2012: - -下面是2012年1季度执行数据的前几行 +下面是2012年1季度的前几行执行数据 ``` 100000853384|03/01/2012|OTHER|4.625||0|360|359|03/2042|41860|0|N|||||||||||||||| 100000853384|04/01/2012||4.625||1|359|358|03/2042|41860|0|N|||||||||||||||| 100000853384|05/01/2012||4.625||2|358|357|03/2042|41860|0|N|||||||||||||||| ``` - -Before proceeding too far into coding, it’s useful to take some time and really understand the data. This is more critical in operational projects – because we aren’t interactively exploring the data, it can be harder to spot certain nuances unless we find them upfront. In this case, the first step is to read the materials on the Fannie Mae site: 在开始编码之前,花些时间真正理解数据是值得的。这对于操作项目优为重要,因为我们没有交互式探索数据,将很难察觉到细微的差别除非我们在前期发现他们。在这种情况下,第一个步骤是阅读房利美站点的资料: -- [Overview][15] - [概述][15] -- [Glossary of useful terms][16] -- [用用的术语表][16] -- [FAQs][17] +- [有用的术语表][16] - [问答][17] -- [Columns in the Acquisition and Performance files][18] -- [Columns in the Acquisition and Performance files][18] -- [Sample Acquisition data file][19] -- [Sample Performance data file][20] - -After reading through these files, we know some key facts that will help us: - -- There’s an Acquisition file and a Performance file for each quarter, starting from the year 2000 to present. There’s a 1 year lag in the data, so the most recent data is from 2015 as of this writing. -- The files are in text format, with a pipe (|) as a delimiter. -- The files don’t have headers, but we have a list of what each column is. -- All together, the files contain data on 22 million loans. -- Because the Performance files contain information on loans acquired in previous years, there will be more performance data for loans acquired in earlier years (ie loans acquired in 2014 won’t have much performance history). - -These small bits of information will save us a ton of time as we figure out how to structure our project and work with the data. +- [采集和执行文件中的列][18] +- [采集数据文件样本][19] +- [执行数据文件样本][20] +在看完这些文件后后,我们了解到一些能帮助我们的关键点: +- 从2000年到现在,每季度都有一个采集和执行文件,因数据是滞后一年的,所以到目前为止最新数据是2015年的。 +- 这些文件是文本格式的,采用管道符号“|”进行分割。 +- 这些文件是没有表头的,但我们有文件各列的名称。 +- 所有一起,文件包含2200万个贷款的数据。 +由于执行文件包含过去几年获得的贷款的信息,在早些年获得的贷款将有更多的执行数据(即在2014获得的贷款没有多少历史执行数据)。 +这些小小的信息将会为我们节省很多时间,因为我们知道如何构造我们的项目和利用这些数据。 ### Structuring the project - +### 构造项目 Before we start downloading and exploring the data, it’s important to think about how we’ll structure the project. When building an end-to-end project, our primary goals are: - +在我们开始下载和探索数据之前,先想一想将如何构造项目是很重要的。当建立端到端项目时,我们的主要目标是: - Creating a solution that works +- 创建一个可行解决方案 - Having a solution that runs quickly and uses minimal resources +- 有一个快速运行且占用最小资源的解决方案 - Enabling others to easily extend our work +- 容易可扩展 - Making it easy for others to understand our code +- 容易理解的代码 - Writing as little code as possible +- 写尽量少的代码 In order to achieve these goals, we’ll need to structure our project well. A well structured project follows a few principles: From 2f0e2db40c5bde9e80db4e50433b0bce719d2485 Mon Sep 17 00:00:00 2001 From: WEIYUE XIE Date: Tue, 2 Aug 2016 21:09:04 +0800 Subject: [PATCH 1342/1469] =?UTF-8?q?Update=20=E7=BF=BB=E8=AF=91=E4=B8=AD?= =?UTF-8?q?=20ideas4u=20part=202=20-=20Building=20a=20data=20science=20por?= =?UTF-8?q?tfolio=20-=20Machine=20learning=20project.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 保存进度3 --- ...ience portfolio - Machine learning project.md | 31 ++++++++----------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/sources/team_test/翻译中 ideas4u part 2 - Building a data science portfolio - Machine learning project.md b/sources/team_test/翻译中 ideas4u part 2 - Building a data science portfolio - Machine learning project.md index 27c7604922..370a9853e5 100644 --- a/sources/team_test/翻译中 ideas4u part 2 - Building a data science portfolio - Machine learning project.md +++ b/sources/team_test/翻译中 ideas4u part 2 - Building a data science portfolio - Machine learning project.md @@ -28,33 +28,28 @@ - 所有一起,文件包含2200万个贷款的数据。 由于执行文件包含过去几年获得的贷款的信息,在早些年获得的贷款将有更多的执行数据(即在2014获得的贷款没有多少历史执行数据)。 这些小小的信息将会为我们节省很多时间,因为我们知道如何构造我们的项目和利用这些数据。 -### Structuring the project + ### 构造项目 -Before we start downloading and exploring the data, it’s important to think about how we’ll structure the project. When building an end-to-end project, our primary goals are: 在我们开始下载和探索数据之前,先想一想将如何构造项目是很重要的。当建立端到端项目时,我们的主要目标是: -- Creating a solution that works - 创建一个可行解决方案 -- Having a solution that runs quickly and uses minimal resources - 有一个快速运行且占用最小资源的解决方案 -- Enabling others to easily extend our work - 容易可扩展 -- Making it easy for others to understand our code -- 容易理解的代码 -- Writing as little code as possible +- 写容易理解的代码 - 写尽量少的代码 -In order to achieve these goals, we’ll need to structure our project well. A well structured project follows a few principles: - -- Separates data files and code files. -- Separates raw data from generated data. -- Has a README.md file that walks people through installing and using the project. -- Has a requirements.txt file that contains all the packages needed to run the project. -- Has a single settings.py file that contains any settings that are used in other files. - - For example, if you are reading the same file from multiple Python scripts, it’s useful to have them all import settings and get the file name from a centralized place. -- Has a .gitignore file that prevents large or secret files from being committed. -- Breaks each step in our task into a separate file that can be executed separately. +为了实现这些目标,需要对我们的项目进行良好的构造。一个结构良好的项目遵循几个原则: +- 分离数据文件和代码文件 +- 从原始数据中分离生成的数据。 +- 有一个README.md文件帮助人们安装和使用该项目。 +- 有一个requirements.txt文件列明项目运行所需的所有包。 +- 有一个单独的settings.py 文件列明其它文件中使用的所有的设置 + - 例如,如果从多个Python脚本读取相同的文件,把它们全部import设置和从一个集中的地方获得文件名是有用的。 +- 有一个.gitignore文件,防止大的或秘密文件被提交。 +- 分解任务中每一步可以单独执行的步骤到单独的文件中。 - For example, we may have one file for reading in the data, one for creating features, and one for making predictions. + - 例如, - Stores intermediate values. For example, one script may output a file that the next script can read. + - This enables us to make changes in our data processing flow without recalculating everything. Our file structure will look something like this shortly: From c430acb471201c8b9e02c69ced00267861a332a4 Mon Sep 17 00:00:00 2001 From: Noobfish Date: Tue, 2 Aug 2016 21:12:45 +0800 Subject: [PATCH 1343/1469] Translating by noobfish since 2016.08.02 --- ...ng a data science portfolio - Machine learning project.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sources/team_test/part 1 - Building a data science portfolio - Machine learning project.md b/sources/team_test/part 1 - Building a data science portfolio - Machine learning project.md index 70d9b65f92..439be578ce 100644 --- a/sources/team_test/part 1 - Building a data science portfolio - Machine learning project.md +++ b/sources/team_test/part 1 - Building a data science portfolio - Machine learning project.md @@ -1,3 +1,8 @@ ++@noobfish translating since Aug 2nd,2016. ++ ++ + + >This is the third in a series of posts on how to build a Data Science Portfolio. If you like this and want to know when the next post in the series is released, you can [subscribe at the bottom of the page][1]. Data science companies are increasingly looking at portfolios when making hiring decisions. One of the reasons for this is that a portfolio is the best way to judge someone’s real-world skills. The good news for you is that a portfolio is entirely within your control. If you put some work in, you can make a great portfolio that companies are impressed by. From a088e129d23496de91278e9d53b9291b06b83c01 Mon Sep 17 00:00:00 2001 From: WEIYUE XIE Date: Tue, 2 Aug 2016 21:34:22 +0800 Subject: [PATCH 1344/1469] =?UTF-8?q?Update=20=E7=BF=BB=E8=AF=91=E4=B8=AD?= =?UTF-8?q?=20ideas4u=20part=202=20-=20Building=20a=20data=20science=20por?= =?UTF-8?q?tfolio=20-=20Machine=20learning=20project.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...a science portfolio - Machine learning project.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/sources/team_test/翻译中 ideas4u part 2 - Building a data science portfolio - Machine learning project.md b/sources/team_test/翻译中 ideas4u part 2 - Building a data science portfolio - Machine learning project.md index 370a9853e5..b311cd814d 100644 --- a/sources/team_test/翻译中 ideas4u part 2 - Building a data science portfolio - Machine learning project.md +++ b/sources/team_test/翻译中 ideas4u part 2 - Building a data science portfolio - Machine learning project.md @@ -24,7 +24,7 @@ 在看完这些文件后后,我们了解到一些能帮助我们的关键点: - 从2000年到现在,每季度都有一个采集和执行文件,因数据是滞后一年的,所以到目前为止最新数据是2015年的。 - 这些文件是文本格式的,采用管道符号“|”进行分割。 -- 这些文件是没有表头的,但我们有文件各列的名称。 +- 这些文件是没有表头的,但我们有文件列明各列的名称。 - 所有一起,文件包含2200万个贷款的数据。 由于执行文件包含过去几年获得的贷款的信息,在早些年获得的贷款将有更多的执行数据(即在2014获得的贷款没有多少历史执行数据)。 这些小小的信息将会为我们节省很多时间,因为我们知道如何构造我们的项目和利用这些数据。 @@ -46,13 +46,13 @@ - 例如,如果从多个Python脚本读取相同的文件,把它们全部import设置和从一个集中的地方获得文件名是有用的。 - 有一个.gitignore文件,防止大的或秘密文件被提交。 - 分解任务中每一步可以单独执行的步骤到单独的文件中。 - - For example, we may have one file for reading in the data, one for creating features, and one for making predictions. - - 例如, -- Stores intermediate values. For example, one script may output a file that the next script can read. + - 例如,我们将有一个文件用于读取数据,一个用于创建特征,一个用于做出预测。 +- 保存中间结果,例如,一个脚本可输出下一个脚本可读取的文件。 - - This enables us to make changes in our data processing flow without recalculating everything. + - 这使我们无需重新计算就可以在数据处理流程中进行更改。 + -Our file structure will look something like this shortly: +我们的文件结构大体如下: ``` loan-prediction @@ -64,8 +64,7 @@ loan-prediction ├── settings.py ``` -### Creating the initial files - +### 创建初始文件 To start with, we’ll need to create a loan-prediction folder. Inside that folder, we’ll need to make a data folder and a processed folder. The first will store our raw data, and the second will store any intermediate calculated values. Next, we’ll make a .gitignore file. A .gitignore file will make sure certain files are ignored by git and not pushed to Github. One good example of such a file is the .DS_Store file created by OSX in every folder. A good starting point for a .gitignore file is here. We’ll also want to ignore the data files because they are very large, and the Fannie Mae terms prevent us from redistributing them, so we should add two lines to the end of our file: From 108dde60df911aef8edc5c81906557c78d4f578c Mon Sep 17 00:00:00 2001 From: WEIYUE XIE Date: Tue, 2 Aug 2016 21:40:28 +0800 Subject: [PATCH 1345/1469] =?UTF-8?q?Update=20and=20rename=20=E7=BF=BB?= =?UTF-8?q?=E8=AF=91=E4=B8=AD=20ideas4u=20part=202=20-=20Building=20a=20da?= =?UTF-8?q?ta=20science=20portfolio=20-=20Machine=20learning=20project.md?= =?UTF-8?q?=20to=20part=202=20-=20Building=20a=20data=20science=20portfoli?= =?UTF-8?q?o=20-=20Machine=20learning=20project.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 占坑 --- ...Building a data science portfolio - Machine learning project.md} | 1 + 1 file changed, 1 insertion(+) rename sources/team_test/{翻译中 ideas4u part 2 - Building a data science portfolio - Machine learning project.md => part 2 - Building a data science portfolio - Machine learning project.md} (99%) diff --git a/sources/team_test/翻译中 ideas4u part 2 - Building a data science portfolio - Machine learning project.md b/sources/team_test/part 2 - Building a data science portfolio - Machine learning project.md similarity index 99% rename from sources/team_test/翻译中 ideas4u part 2 - Building a data science portfolio - Machine learning project.md rename to sources/team_test/part 2 - Building a data science portfolio - Machine learning project.md index b311cd814d..19e1fed3a7 100644 --- a/sources/team_test/翻译中 ideas4u part 2 - Building a data science portfolio - Machine learning project.md +++ b/sources/team_test/part 2 - Building a data science portfolio - Machine learning project.md @@ -1,4 +1,5 @@ +翻译中 by ideas4u ### 理解数据 我们来简单看一下原始数据文件。下面是2012年1季度前几行的采集数据。 ``` From 044fb2dbd56ca01617538d61abc4f37d842d2552 Mon Sep 17 00:00:00 2001 From: WEIYUE XIE Date: Tue, 2 Aug 2016 23:19:10 +0800 Subject: [PATCH 1346/1469] part 2 - Building a data science portfolio - Machine learning project.md (#4270) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update part 2 - Building a data science portfolio - Machine learning project.md save changes 5 * Update part 2 - Building a data science portfolio - Machine learning project.md 初稿完成了。 --- ...ce portfolio - Machine learning project.md | 27 +++++++------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/sources/team_test/part 2 - Building a data science portfolio - Machine learning project.md b/sources/team_test/part 2 - Building a data science portfolio - Machine learning project.md index 19e1fed3a7..ff979de34f 100644 --- a/sources/team_test/part 2 - Building a data science portfolio - Machine learning project.md +++ b/sources/team_test/part 2 - Building a data science portfolio - Machine learning project.md @@ -66,21 +66,16 @@ loan-prediction ``` ### 创建初始文件 -To start with, we’ll need to create a loan-prediction folder. Inside that folder, we’ll need to make a data folder and a processed folder. The first will store our raw data, and the second will store any intermediate calculated values. - -Next, we’ll make a .gitignore file. A .gitignore file will make sure certain files are ignored by git and not pushed to Github. One good example of such a file is the .DS_Store file created by OSX in every folder. A good starting point for a .gitignore file is here. We’ll also want to ignore the data files because they are very large, and the Fannie Mae terms prevent us from redistributing them, so we should add two lines to the end of our file: - +首先,我们需要创建一个loan-prediction文件夹,在此文件夹下面,再创建一个data文件夹和一个processed文件夹。data文件夹存放原始数据,processed文件夹存放所有的中间计算结果。 +其次,创建.gitignore文件,.gitignore文件将保证某些文件被git忽略而不会被推送至github。关于这个文件的一个好的例子是由OSX在每一个文件夹都会创建的.DS_Store文件,.gitignore文件一个很好的起点就是在这了。我们还想忽略数据文件因为他们实在是太大了,同时房利美的条文禁止我们重新分发该数据文件,所以我们应该在我们的文件后面添加以下2行: ``` data processed ``` -[Here’s][21] an example .gitignore file for this project. - -Next, we’ll need to create README.md, which will help people understand the project. .md indicates that the file is in markdown format. Markdown enables you write plain text, but also add some fancy formatting if you want. [Here’s][22] a guide on markdown. If you upload a file called README.md to Github, Github will automatically process the markdown, and show it to anyone who views the project. [Here’s][23] an example. - -For now, we just need to put a simple description in README.md: - +这是该项目的一个关于.gitignore文件的例子。 +再次,我们需要创建README.md文件,它将帮助人们理解该项目。后缀.md表示这个文件采用markdown格式。Markdown使你能够写纯文本文件,同时还可以添加你想要的梦幻格式。这是关于markdown的导引。如果你上传一个叫README.md的文件至Github,Github会自动处理该markdown,同时展示给浏览该项目的人。 +至此,我们仅需在README.md文件中添加简单的描述: ``` Loan Prediction ----------------------- @@ -88,8 +83,7 @@ Loan Prediction Predict whether or not loans acquired by Fannie Mae will go into foreclosure. Fannie Mae acquires loans from other lenders as a way of inducing them to lend more. Fannie Mae releases data on the loans it has acquired and their performance afterwards [here](http://www.fanniemae.com/portal/funding-the-market/data/loan-performance-data.html). ``` -Now, we can create a requirements.txt file. This will make it easy for other people to install our project. We don’t know exactly what libraries we’ll be using yet, but here’s a good starting point: - +现在,我们可以创建requirements.txt文件了。这会唯其它人可以很方便地安装我们的项目。我们还不知道我们将会具体用到哪些库,但是以下几个库是一个很好的开始: ``` pandas matplotlib @@ -99,9 +93,6 @@ ipython scipy ``` -The above libraries are the most commonly used for data analysis tasks in Python, and its fair to assume that we’ll be using most of them. [Here’s][24] an example requirements file for this project. - -After creating requirements.txt, you should install the packages. For this post, we’ll be using Python 3. If you don’t have Python installed, you should look into using [Anaconda][25], a Python installer that also installs all the packages listed above. - -Finally, we can just make a blank settings.py file, since we don’t have any settings for our project yet. - +以上几个是在python数据分析任务中最常用到的库。可以认为我们将会用到大部分这些库。这里是【24】该项目requirements文件的一个例子。 + 创建requirements.txt文件之后,你应该安装包了。我们将会使用python3.如果你没有安装python,你应该考虑使用 [Anaconda][25],一个python安装程序,同时安装了上面列出的所有包。 +最后,我们可以建立一个空白的settings.py文件,因为我们的项目还没有任何设置。 From 307cd103c0370581b85a869913f16b1963b6b3b6 Mon Sep 17 00:00:00 2001 From: kokialoves <498497353@qq.com> Date: Wed, 3 Aug 2016 09:58:43 +0800 Subject: [PATCH 1347/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= =?UTF-8?q?=20(#4271)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Delete part 5 - Building a data science portfolio - Machine learning project.md * Create part 5 - Building a data science portfolio - Machine learning project.md --- ...ce portfolio - Machine learning project.md | 106 +++++++++++------- 1 file changed, 63 insertions(+), 43 deletions(-) diff --git a/sources/team_test/part 5 - Building a data science portfolio - Machine learning project.md b/sources/team_test/part 5 - Building a data science portfolio - Machine learning project.md index 99e1046e70..a92bb01900 100644 --- a/sources/team_test/part 5 - Building a data science portfolio - Machine learning project.md +++ b/sources/team_test/part 5 - Building a data science portfolio - Machine learning project.md @@ -1,38 +1,44 @@ -注解数据 -我们已经在annotate.py中添加了一些功能, 现在我们来看一看数据文件. 我们需要将采集到的数据转换到training dataset来进行机器学习的训练. 这涉及到以下几件事情: -转换所以列数字. -填充缺失值. -分配 performance_count 和 foreclosure_status. -移除出现次数很少的行(performance_count 计数低). -我们有几个列是strings类型的, 看起来对于机器学习算法来说并不是很有用. 然而, 他们实际上是分类变量, 其中有很多不同的类别代码, 例如R,S等等. 我们可以把这些类别标签转换为数值: +### 注解数据 +我们已经在annotate.py中添加了一些功能, 现在我们来看一看数据文件. 我们需要将采集到的数据转换到训练数据表来进行机器学习的训练. 这涉及到以下几件事情: +- 转换所以列数字. +- 填充缺失值. +- 分配 performance_count 和 foreclosure_status. +- 移除出现次数很少的行(performance_count 计数低). + +我们有几个列是文本类型的, 看起来对于机器学习算法来说并不是很有用. 然而, 他们实际上是分类变量, 其中有很多不同的类别代码, 例如R,S等等. 我们可以把这些类别标签转换为数值: + +![](https://github.com/LCTT/wiki-images/blob/master/TranslateProject/ref_img/002.png) 通过这种方法转换的列我们可以应用到机器学习算法中. 还有一些包含日期的列 (first_payment_date 和 origination_date). 我们可以将这些日期放到两个列中: - 在下面的代码中, 我们将转换采集到的数据. 我们将定义一个函数如下: +![](https://github.com/LCTT/wiki-images/blob/master/TranslateProject/ref_img/003.png) +在下面的代码中, 我们将转换采集到的数据. 我们将定义一个函数如下: -在采集到的数据中创建foreclosure_status列 . -在采集到的数据中创建performance_count列. -将下面的string列转换为integer列: -channel -seller -first_time_homebuyer -loan_purpose -property_type -occupancy_status -property_state -product_type -转换first_payment_date 和 origination_date 为两列: -通过斜杠分离列. -将第一部分分离成月清单. -将第二部分分离成年清单. -删除这一列. -最后, 我们得到 first_payment_month, first_payment_year, origination_month, and origination_year. -所有缺失值填充为-1. +- 在采集到的数据中创建foreclosure_status列 . +- 在采集到的数据中创建performance_count列. +- 将下面的string列转换为integer列: + - channel + - seller + - first_time_homebuyer + - loan_purpose + - property_type + - occupancy_status + - property_state + - product_type +- 转换first_payment_date 和 origination_date 为两列: + - 通过斜杠分离列. + - 将第一部分分离成月清单. + - 将第二部分分离成年清单. + - 删除这一列. + - 最后, 我们得到 first_payment_month, first_payment_year, origination_month, and origination_year. +- 所有缺失值填充为-1. + +``` def annotate(acquisition, counts): acquisition["foreclosure_status"] = acquisition["id"].apply(lambda x: get_performance_summary_value(x, "foreclosure_status", counts)) acquisition["performance_count"] = acquisition["id"].apply(lambda x: get_performance_summary_value(x, "performance_count", counts)) @@ -57,21 +63,25 @@ def annotate(acquisition, counts): acquisition = acquisition.fillna(-1) acquisition = acquisition[acquisition["performance_count"] > settings.MINIMUM_TRACKING_QUARTERS] return acquisition +``` + +### 聚合到一起 -聚合到一起 我们差不多准备就绪了, 我们只需要再在annotate.py添加一点点代码. 在下面代码中, 我们将: -定义一个函数来读取采集的数据. -定义一个函数来写入数据到/train.csv -如果我们在命令行运行annotate.py来读取更新过的数据文件,它将做如下事情: -读取采集到的数据. -计算数据性能. -注解数据. -将注解数据写入到train.csv. +- 定义一个函数来读取采集的数据. +- 定义一个函数来写入数据到/train.csv +- 如果我们在命令行运行annotate.py来读取更新过的数据文件,它将做如下事情: + - 读取采集到的数据. + - 计算数据性能. + - 注解数据. + - 将注解数据写入到train.csv. + +``` def read(): acquisition = pd.read_csv(os.path.join(settings.PROCESSED_DIR, "Acquisition.txt"), sep="|") return acquisition - + def write(acquisition): acquisition.to_csv(os.path.join(settings.PROCESSED_DIR, "train.csv"), index=False) @@ -80,11 +90,13 @@ if __name__ == "__main__": counts = count_performance_rows() acquisition = annotate(acquisition, counts) write(acquisition) +``` 修改完成以后为了确保annotate.py能够生成train.csv文件. 你可以在这里找到完整的 annotate.py file [here][34]. 文件夹结果应该像这样: +``` loan-prediction ├── data │ ├── Acquisition_2012Q1.txt @@ -102,37 +114,45 @@ loan-prediction ├── README.md ├── requirements.txt ├── settings.py +``` -找到标准 -我们已经完成了training dataset的生成, 现在我们需要最后一步, 生成预测. 我们需要找到错误的标准, 以及该如何评估我们的数据. 在这种情况下, 因为有很多的贷款没有收回, 所以根本不可能做到精确的计算. +### 找到标准 + +我们已经完成了训练数据表的生成, 现在我们需要最后一步, 生成预测. 我们需要找到错误的标准, 以及该如何评估我们的数据. 在这种情况下, 因为有很多的贷款没有收回, 所以根本不可能做到精确的计算. 我们需要读取数据, 并且计算foreclosure_status列, 我们将得到如下信息: +``` import pandas as pd import settings train = pd.read_csv(os.path.join(settings.PROCESSED_DIR, "train.csv")) train["foreclosure_status"].value_counts() +``` +``` False 4635982 True 1585 Name: foreclosure_status, dtype: int64 +``` 因为只有一点点贷款收回, 通过百分比标签来建立的机器学习模型会把每行都设置为Fasle, 所以我们在这里要考虑每个样本的不平衡性,确保我们做出的预测是准确的. 我们不想要这么多假的false, 我们将预计贷款收回但是它并没有收回, 我们预计贷款不会回收但是却回收了. 通过以上两点, Fannie Mae的false太多了, 因此显示他们可能无法收回投资. 所以我们将定义一个百分比,就是模型预测没有收回但是实际上收回了, 这个数除以总的负债回收总数. 这个负债回收百分比模型实际上是“没有的”. 下面看这个图表: - +![](https://github.com/LCTT/wiki-images/blob/master/TranslateProject/ref_img/004.png) 通过上面的图表, 1个负债预计不会回收, 也确实没有回收. 如果我们将这个数除以总数, 2, 我们将得到false的概率为50%. 我们将使用这个标准, 因此我们可以评估一下模型的性能. -设置机器学习分类器 +### 设置机器学习分类器 + 我们使用交叉验证预测. 通过交叉验证法, 我们将数据分为3组. 按照下面的方法来做: -Train a model on groups 1 and 2, and use the model to make predictions for group 3. -Train a model on groups 1 and 3, and use the model to make predictions for group 2. -Train a model on groups 2 and 3, and use the model to make predictions for group 1. -将它们分割到不同的组 ,这意味着我们永远不会用相同的数据来为预测训练模型. 这样就避免了 overfitting. 如果我们overfit, 我们将得到很低的false概率, 这使得我们难以改进算法或者应用到现实生活中. +- Train a model on groups 1 and 2, and use the model to make predictions for group 3. +- Train a model on groups 1 and 3, and use the model to make predictions for group 2. +- Train a model on groups 2 and 3, and use the model to make predictions for group 1. + +将它们分割到不同的组 ,这意味着我们永远不会用相同的数据来为预测训练模型. 这样就避免了overfitting(过拟合). 如果我们overfit(过拟合), 我们将得到很低的false概率, 这使得我们难以改进算法或者应用到现实生活中. [Scikit-learn][35] 有一个叫做 [cross_val_predict][36] 他可以帮助我们理解交叉算法. From bfa16485d321e1a1d8b0f7d34ed9a8a13390bace Mon Sep 17 00:00:00 2001 From: joVoV <704451873@qq.com> Date: Wed, 3 Aug 2016 18:03:35 +0800 Subject: [PATCH 1348/1469] =?UTF-8?q?=E6=AD=A3=E5=9C=A8=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/talk/20160509 Android vs. iPhone Pros and Cons.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/talk/20160509 Android vs. iPhone Pros and Cons.md b/sources/talk/20160509 Android vs. iPhone Pros and Cons.md index 92feeba307..9977d46d35 100644 --- a/sources/talk/20160509 Android vs. iPhone Pros and Cons.md +++ b/sources/talk/20160509 Android vs. iPhone Pros and Cons.md @@ -1,6 +1,7 @@ Android vs. iPhone: Pros and Cons =================================== +正在翻译 by jovov >When comparing Android vs. iPhone, clearly Android has certain advantages even as the iPhone is superior in some key ways. But ultimately, which is better? The question of Android vs. iPhone is a personal one. From 60ad576a3a0ac8645b098cfa417b82926879ba0a Mon Sep 17 00:00:00 2001 From: Purling Nayuki Date: Thu, 4 Aug 2016 00:25:46 +0800 Subject: [PATCH 1349/1469] Proofread 20160706 Doing for User Space What We Did for Kernel Space --- ...User Space What We Did for Kernel Space.md | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/translated/tech/20160706 Doing for User Space What We Did for Kernel Space.md b/translated/tech/20160706 Doing for User Space What We Did for Kernel Space.md index 0b31016003..a62f9ad09f 100644 --- a/translated/tech/20160706 Doing for User Space What We Did for Kernel Space.md +++ b/translated/tech/20160706 Doing for User Space What We Did for Kernel Space.md @@ -3,51 +3,51 @@ 我相信,Linux 最好也是最坏的事情,就是内核空间和用户空间之间的巨大差别。 -但是如果抛开这个区别,Linux 可能也不会成为世界上影响力最大的操作系统。如今,Linux 已经拥有世界上最大数量的用户,和最大范围的应用。尽管大多数用户并不知道,当他们进行谷歌搜索,或者触摸安卓手机的时候,他们其实正在使用 Linux。如果不是 Linux 的巨大成功,Apple 公司也可能并不会成为现在这样(苹果在他们的电脑产品中使用 BSD 发行版)。 +但是如果没有这个区别,Linux 可能也不会成为世界上影响力最大的操作系统。如今,Linux 的使用范围在世界上是最大的,而这些应用又有着世界上最大的用户群——尽管大多数用户并不知道,当他们进行谷歌搜索或者触摸安卓手机的时候,他们其实正在使用 Linux。如果不是 Linux 的巨大成功,Apple 公司也可能并不会成为现在这样(即在他们的电脑产品中使用 BSD 的技术)(注:Linux 获得成功后,Apple 曾与 Linus 协商使用 Linux 核心作为 Apple 电脑的操作系统并帮助开发的事宜,但遭到拒绝。因此,Apple 转向使用许可证更为宽松的 BSD 。)。 -不用担心,用户空间是 Linux 内核开发中的一个特性,并不是一个缺陷。正如 Linus 在 2003 的极客巡航中提到的那样,“”我只做内核相关技术……我并不知道内核之外发生的事情,而且我并不关心。我只关注内核部分发生的事情。” 在 Andrew Morton 在多年之后的另一个极客巡航上给我上了另外的一课,我写到: +不(需要)关注用户空间是 Linux 内核开发中的一个特点而非缺陷。正如 Linus 在 2003 的极客巡航中提到的那样,“我只做内核相关技术……我并不知道内核之外发生的事情,而且我并不关心。我只关注内核部分发生的事情。” 多年之后的另一个极客巡航上, Andrew Morton 给我上了另外的一课,这之后我写道: -> 内核空间是 Linux 核心存在的地方。用户空间是使用 Linux 时使用的空间,和其他的自然的建筑材料一样。内核空间和用户空间的区别,和自然材料和人类从中生产的人造材料的区别很类似。 +> Linux 存在于内核空间,而在用户空间中被使用,和其他的自然的建筑材料一样。内核空间和用户空间的区别,和自然材料与人类从中生产的人造材料的区别很类似。 -这个区别的自然而然的结果,就是尽管外面的世界一刻也离不开 Linux, 但是 Linux 社区还是保持相对较小。所以,为了增加我们社区团体的数量,我希望指出两件事情。第一件已经非常火热,另外一件可能热门。 +这个区别的自然而然的结果,就是尽管外面的世界一刻也离不开 Linux, 但是 Linux 社区还是保持相对较小。所以,为了增加哪怕一点我们社区团体的规模,我希望指出两件事情。第一件已经非常火了,另外一件可能会火起来。 -第一件事情就是 [blockchain][1],出自著名的分布式货币,比特币之手。当你正在阅读这篇文章的同时,对 blockchain 的[兴趣已经直线上升][2]。 +第一件事情就是 [blockchain][1],出自著名的分布式货币——比特币之手。当你正在阅读这篇文章的同时,人们对 blockchain 的[关注度正在直线上升][2]。 ![](http://www.linuxjournal.com/files/linuxjournal.com/ufiles/imagecache/large-550px-centered/u1000009/12042f1.png) -> 图1. 谷歌 Blockchain 的趋势 +> 图1. Blockchain 的谷歌搜索趋势 -第二件事就是自主身份。为了解释这个,让我先来问你,你是谁或者你是什么。 +第二件事就是自主身份。为了解释这个概念,让我先来问你:你是谁,你来自哪里? -如果你从你的雇员,你的医生,或者车管所,Facebook,Twitter 或者谷歌上得到答案,你就会发现他们每一个都有明显的社会性: 为了他们自己的便利,在进入这些机构的控制前,他们都会添加自己的命名空间。正如 Timothy Ruff 在 [Evernym][3] 中解释的,”你并不为了他们而存在,你只为了自己的身份而活。“。你的身份可能会变化,但是唯一不变的就是控制着身份的人,也就是这个组织。 +如果你从你的雇员、你的医生或者车管所,Facebook、Twitter 或者谷歌上得到答案,你就会发现它们都是行政身份——机构完全以自己的便利为原因设置这些身份和职位。正如 [Evernym][3] 的 Timothy Ruff 所说,“你并不因组织而存在,但你的身份却因此存在。”身份是个因变量。自变量——即控制着身份的变量——是(你所在的)组织。 如果你的答案出自你自己,我们就有一个广大空间来发展一个新的领域,在这个领域中,我们完全自由。 -第一个解释这个的人,据我所知,是 [Devon Loffreto][4]。在 2012 年 2 月,在的他的博客中,他写道 ”什么是' Sovereign Source Authority'?“,[Moxy Tongue][5]。在他发表在 2016 年 2 月的 "[Self-Sovereign Identity][6]" 中,他写道: +据我所知,第一个解释这个的人是 [Devon Loffreto][4]。在 2012 年 2 月,他在博客[Moxy Tongue][5] 中写道:“什么是'Sovereign Source Authority'?”。在发表于 2016 年 2 月的 "[Self-Sovereign Identity][6]" 中,他写道: -> 自主身份必须是独立个人提出的,并且不包含社会因素。。。自主身份源于每个个体对其自身本源的认识。 一个自主身份可以为个体带来新的社会面貌。每个个体都可能为自己生成一个自主身份,并且这并不会改变固有的人权。使用自主身份机制是所有参与者参与的基石,并且 依旧可以同各种形式的人类社会保持联系。 +> 自主身份必须是独立个人提出的,并且不包含社会因素……自主身份源于每个个体对其自身本源的认识。 一个自主身份可以为个体带来新的社会面貌。每个个体都可能为自己生成一个自主身份,并且这并不会改变固有的人权。使用自主身份机制是所有参与者参与的基石,并且依旧可以同各种形式的人类社会保持联系。 -为了将这个发布在 Linux 条款中,只有个人才能为他或她设定一个自己的开源社区身份。这在现实实践中,这只是一个非常偶然的事件。举个例子,我自己的身份包括: +将这个概念放在 Linux 领域中,只有个人才能为他或她设定一个自己的开源社区身份。这在现实实践中,这只是一个非常正从的事件。举个例子,我自己的身份包括: - David Allen Searls,我父母会这样叫我。 - David Searls,正式场合下我会这么称呼自己。 - Dave,我的亲戚和好朋友会这么叫我。 - Doc,大多数人会这么叫我。 -在上述提到的身份认证中,我可以在不同的情景中轻易的转换。但是,这只是在现实世界中。在虚拟世界中,这就变得非常困难。除了上述的身份之外,我还可以是 @dsearls(我的 twitter 账号) 和 dsearls (其他的网络账号)。然而为了记住成百上千的不同账号的登录名和密码,我已经不堪重负。 +作为承认以上称呼的自主身份来源,我可以在不同的情景中轻易的转换。但是,这只是在现实世界中。在虚拟世界中,这就变得非常困难。除了上述的身份之外,我还可以是 @dsearls(我的 twitter 账号) 和 dsearls (其他的网络账号)。然而为了记住成百上千的不同账号的登录名和密码,我已经不堪重负。 -你可以在你的浏览器上感受到这个糟糕的体验。在火狐上,我有成百上千个用户名密码。很多已经废弃(很多都是从 Netscape 时代遗留下来的),但是我依旧假设我有时会有大量的工作账号需要处理。对于这些,我只是被动接受者。没有其他的解决方法。甚至一些安全较低的用户认证,已经成为了现实世界中不可缺少的一环。 +你可以在你的浏览器上感受到这个糟糕的体验。在火狐上,我有成百上千个用户名密码。很多已经废弃(很多都是从 Netscape 时代遗留下来的),但是我想会有大量的工作账号需要处理。对于这些,我只是被动接受者。没有其他的解决方法。甚至一些安全较低的用户认证,已经成为了现实世界中不可缺少的一环。 -现在,最简单的方式来联系账号,就是通过 "Log in with Facebook" 或者 "Login in with Twitter" 来进行身份认证。在这些例子中,我们中的每一个甚至并不是真正意义上的自己,或者某种程度上是我们希望被大家认识的自己(如果我们希望被其他人认识的话)。 +现在,最简单的方式来联系账号,就是通过 "Log in with Facebook" 或者 "Login in with Twitter" 来进行身份认证。在这种情况下,我们中的每一个甚至并不是真正意义上的自己,甚至(如果我们希望被其他人认识的话)缺乏对其他实体如何认识我们的控制。 我们从一开始就需要的是一个可以实体化我们的自主身份和交流时选择如何保护和展示自身的个人系统。因为缺少这个能力,我们现在陷入混乱。Shoshana Zuboff 称之为 "监视资本主义",她如此说道: ->...难以想象,在见证了互联网和获得了的巨大成功的谷歌背后。世界因 Apple 和 FBI 的对决而紧密联系在一起。真相就是,被热衷于监视的资本家开发监视系统,是每一个国家安全机构真正的恶。 +>...难以想象,在见证了互联网和获得了的巨大成功的谷歌背后。世界因 Apple 和 FBI 的对决而紧密联系在一起。讲道理,热衷于监视的资本家开发的监视系统是每一个国家安全机构都渴望的。 然后,她问道,”我们怎样才能保护自己远离他人的影响?“ -我建议使用自主身份。我相信这是我们唯一的方式,来保证我们从一个被监视的世界中脱离出来。以此为基础,我们才可以完全无顾忌的和社会,政治,商业上的人交流。 +我建议使用自主身份。我相信这是我们唯一的既可以保证我们从监视中逃脱、又可以使我们有一个有序的世界的办法。以此为基础,我们才可以完全无顾忌地和社会,政治,商业上的人交流。 -我在五月联合国举行的 [ID2020][7] 会议中总结了这个临时的结论。很高兴,Devon Loffreto 也在那,自从他在2013年被选为作为轮值主席之后。这就是[我曾经写的一些文章][8],引用了 Devon 的早期博客(比如上面的原文)。 +我在五月联合国举行的 [ID2020][7] 会议中总结了这个临时的结论。很高兴,Devon Loffreto 也在那,他于 2013 年推动了自主身份的创立。这是[我那时写的一些文章][8],引用了 Devon 的早期博客(比如上面的原文)。 这有三篇这个领域的准则: @@ -55,14 +55,14 @@ - "[System or Human First][10]" - Devon Loffreto. - "[The Path to Self-Sovereign Identity][11]" - Christopher Allen. -从Evernym 的简要说明中,[digi.me][12], [iRespond][13] 和 [Respect Network][14] 也被包括在内。自主身份和社会身份 (也被称为”current model“) 的对比结果,显示在图二中。 +从Evernym 的简要说明中,[digi.me][12], [iRespond][13] 和 [Respect Network][14] 也被包括在内。自主身份和社会身份 (也被称为“current model”) 的对比结果,显示在图二中。 ![](http://www.linuxjournal.com/files/linuxjournal.com/ufiles/imagecache/large-550px-centered/u1000009/12042f2.jpg) > 图 2. Current Model 身份 vs. 自主身份 -为此而生的[平台][15]就是 Sovrin,也被解释为“”依托于先进技术的,授权机制的,分布式货币上的一个完全开源,基于标识,声明身份的图平台“ 同时,这也有一本[白皮书][16]。代号为 [plenum][17],而且它在 Github 上。 +Sovrin 就是为此而生的[平台][15],它阐述自己为一个“依托于先进、专用、经授权、分布式平台的,完全开源、基于标识的身份声明图平台”。同时,这也有一本[白皮书][16]。它的代码名为 [plenum][17],并且公开在 Github 上。 -在这-或者其他类似的地方-我们就可以在用户空间中重现我们在上一个的四分之一世纪中已经做过的事情。 +在这里——或者其他类似的地方——我们就可以在用户空间中重现我们在过去 25 年中在内核空间做过的事情。 -------------------------------------------------------------------------------- @@ -70,8 +70,8 @@ via: https://www.linuxjournal.com/content/doing-user-space-what-we-did-kernel-space 作者:[Doc Searls][a] -译者:[译者ID](https://github.com/MikeCoder) -校对:[校对者ID](https://github.com/校对者ID) +译者:[MikeCoder](https://github.com/MikeCoder) +校对:[PurlingNayuki](https://github.com/PurlingNayuki) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 0c45724b1a7e2d01edc34aa835cfa8eefa7604b2 Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 4 Aug 2016 09:20:37 +0800 Subject: [PATCH 1350/1469] =?UTF-8?q?20160804-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...w to restore older file versions in Git.md | 181 ++++++++++++++++++ 1 file changed, 181 insertions(+) create mode 100644 sources/tech/20160726 How to restore older file versions in Git.md diff --git a/sources/tech/20160726 How to restore older file versions in Git.md b/sources/tech/20160726 How to restore older file versions in Git.md new file mode 100644 index 0000000000..a8fc789672 --- /dev/null +++ b/sources/tech/20160726 How to restore older file versions in Git.md @@ -0,0 +1,181 @@ +How to restore older file versions in Git +============================================= + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/file_system.jpg?itok=s2b60oIB) + +In today's article you will learn how to find out where you are in the history of your project, how to restore older file versions, and how to make Git branches so you can safely conduct wild experiments. + +Where you are in the history of your Git project, much like your location in the span of a rock album, is determined by a marker called HEAD (like the playhead of a tape recorder or record player). To move HEAD around in your own Git timeline, use the git checkout command. + +There are two ways to use the git checkout command. A common use is to restore a file from a previous commit, and you can also rewind your entire tape reel and go in an entirely different direction. + +### Restore a file + +This happens when you realize you've utterly destroyed an otherwise good file. We all do it; we get a file to a great place, we add and commit it, and then we decide that what it really needs is one last adjustment, and the file ends up completely unrecognizable. + +To restore it to its former glory, use git checkout from the last known commit, which is HEAD: + +``` +$ git checkout HEAD filename +``` + +If you accidentally committed a bad version of a file and need to yank a version from even further back in time, look in your Git log to see your previous commits, and then check it out from the appropriate commit: + +``` +$ git log --oneline +79a4e5f bad take +f449007 The second commit +55df4c2 My great project, first commit. + +$ git checkout 55df4c2 filename + +``` + +Now the older version of the file is restored into your current position. (You can see your current status at any time with the git status command.) You need to add the file because it has changed, and then commit it: + +``` +$ git add filename +$ git commit -m 'restoring filename from first commit.' +``` + +Look in your Git log to verify what you did: + +``` +$ git log --oneline +d512580 restoring filename from first commit +79a4e5f bad take +f449007 The second commit +55df4c2 My great project, first commit. +``` + +Essentially, you have rewound the tape and are taping over a bad take. So you need to re-record the good take. + +### Rewind the timeline + +The other way to check out a file is to rewind the entire Git project. This introduces the idea of branches, which are, in a way, alternate takes of the same song. + +When you go back in history, you rewind your Git HEAD to a previous version of your project. This example rewinds all the way back to your original commit: + +``` +$ git log --oneline +d512580 restoring filename from first commit +79a4e5f bad take +f449007 The second commit +55df4c2 My great project, first commit. + +$ git checkout 55df4c2 +``` + +When you rewind the tape in this way, if you hit the record button and go forward, you are destroying your future work. By default, Git assumes you do not want to do this, so it detaches HEAD from the project and lets you work as needed without accidentally recording over something you have recorded later. + +If you look at your previous version and realise suddenly that you want to re-do everything, or at least try a different approach, then the safe way to do that is to create a new branch. You can think of this process as trying out a different version of the same song, or creating a remix. The original material exists, but you're branching off and doing your own version for fun. + +To get your Git HEAD back down on blank tape, make a new branch: + +``` +$ git checkout -b remix +Switched to a new branch 'remix' +``` + +Now you've moved back in time, with an alternate and clean workspace in front of you, ready for whatever changes you want to make. + +You can do the same thing without moving in time. Maybe you're perfectly happy with how your progress is going, but would like to switch to a temporary workspace just to try some crazy ideas out. That's a perfectly acceptable workflow, as well: + +``` +$ git status +On branch master +nothing to commit, working directory clean + +$ git checkout -b crazy_idea +Switched to a new branch 'crazy_idea' +``` + +Now you have a clean workspace where you can sandbox some crazy new ideas. Once you're done, you can either keep your changes, or you can forget they ever existed and switch back to your master branch. + +To forget your ideas in shame, change back to your master branch and pretend your new branch doesn't exist: + +``` +$ git checkout master +``` + +To keep your crazy ideas and pull them back into your master branch, change back to your master branch and merge your new branch: + +``` +$ git checkout master +$ git merge crazy_idea +``` + +Branches are powerful aspects of git, and it's common for developers to create a new branch immediately after cloning a repository; that way, all of their work is contained on their own branch, which they can submit for merging to the master branch. Git is pretty flexible, so there's no "right" or "wrong" way (even a master branch can be distinguished from what remote it belongs to), but branching makes it easy to separate tasks and contributions. Don't get too carried away, but between you and me, you can have as many Git branches as you please. They're free! + +### Working with remotes + +So far you've maintained a Git repository in the comfort and privacy of your own home, but what about when you're working with other people? + +There are several different ways to set Git up so that many people can work on a project at once, so for now we'll focus on working on a clone, whether you got that clone from someone's personal Git server or their GitHub page, or from a shared drive on the same network. + +The only difference between working on your own private Git repository and working on something you want to share with others is that at some point, you need to push your changes to someone else's repository. We call the repository you are working in a local repository, and any other repository a remote. + +When you clone a repository with read and write permissions from another source, your clone inherits the remote from whence it came as its origin. You can see a clone's remote: + +``` +$ git remote --verbose +origin seth@example.com:~/myproject.Git (fetch) +origin seth@example.com:~/myproject.Git (push) +``` + +Having a remote origin is handy because it is functionally an offsite backup, and it also allows someone else to be working on the project. + +If your clone didn't inherit a remote origin, or if you choose to add one later, use the git remote command: + +``` +$ git remote add seth@example.com:~/myproject.Git +``` + +If you have changed files and want to send them to your remote origin, and have read and write permissions to the repository, use git push. The first time you push changes, you must also send your branch information. It is a good practice to not work on master, unless you've been told to do so: + +``` +$ git checkout -b seth-dev +$ git add exciting-new-file.txt +$ git commit -m 'first push to remote' +$ git push -u origin HEAD +``` + +This pushes your current location (HEAD, naturally) and the branch it exists on to the remote. After you've pushed your branch once, you can drop the -u option: + +``` +$ git add another-file.txt +$ git commit -m 'another push to remote' +$ git push origin HEAD +``` + +### Merging branches + +When you're working alone in a Git repository you can merge test branches into your master branch whenever you want. When working in tandem with a contributor, you'll probably want to review their changes before merging them into your master branch: + +``` +$ git checkout contributor +$ git pull +$ less blah.txt # review the changed files +$ git checkout master +$ git merge contributor +``` + +If you are using GitHub or GitLab or something similar, the process is different. There, it is traditional to fork the project and treat it as though it is your own repository. You can work in the repository and send changes to your GitHub or GitLab account without getting permission from anyone, because it's your repository. + +If you want the person you forked it from to receive your changes, you create a pull request, which uses the web service's backend to send patches to the real owner, and allows them to review and pull in your changes. + +Forking a project is usually done on the web service, but the Git commands to manage your copy of the project are the same, even the push process. Then it's back to the web service to open a pull request, and the job is done. + +In our next installment we'll look at some convenience add-ons to help you integrate Git comfortably into your everyday workflow. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/16/7/how-restore-older-file-versions-git + +作者:[Seth Kenlon][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth From c5ab34a90b78a432e272ff42af3643cebde43da0 Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 4 Aug 2016 09:25:55 +0800 Subject: [PATCH 1351/1469] =?UTF-8?q?20160804-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20160802 3 graphical tools for Git.md | 117 ++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 sources/tech/20160802 3 graphical tools for Git.md diff --git a/sources/tech/20160802 3 graphical tools for Git.md b/sources/tech/20160802 3 graphical tools for Git.md new file mode 100644 index 0000000000..c09afed48b --- /dev/null +++ b/sources/tech/20160802 3 graphical tools for Git.md @@ -0,0 +1,117 @@ +3 graphical tools for Git +============================= + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/government/BUSINESS_meritladder.png?itok=4CAH2wV0) + +In this article, we'll take a look at some convenience add-ons to help you integrate Git comfortably into your everyday workflow. + +I learned Git before many of these fancy interfaces existed, and my workflow is frequently text-based anyway, so most of the inbuilt conveniences of Git suit me pretty well. It is always best, in my opinion, to understand how Git works natively. However, it is always nice to have options, so these are some of the ways you can start using Git outside of the terminal. + +### Git in KDE Dolphin + +I am a KDE user, if not always within the Plasma desktop, then as my application layer in Fluxbox. Dolphin is an excellent file manager with lots of options and plenty of secret little features. Particularly useful are all the plugins people develop for it, one of which is a nearly-complete Git interface. Yes, you can manage your Git repositories natively from the comfort of your own desktop. + +But first, you'll need to make sure the add-ons are installed. Some distros come with a filled-to-the-brim KDE, while others give you just the basics, so if you don't see the Git options in the next few steps, search your repository for something like dolphin-extras or dolphin-plugins. + +To activate Git integration, go to the Settings menu in any Dolphin window and select Configure Dolphin. + +In the Configure Dolphin window, click on the Services icon in the left column. + +In the Services panel, scroll through the list of available plugins until you find Git. + +![](https://opensource.com/sites/default/files/4_dolphinconfig.jpg) + +Save your changes and close your Dolphin window. When you re-launch Dolphin, navigate to a Git repository and have a look around. Notice that all icons now have emblems: green boxes for committed files, solid green boxes for modified files, no icon for untracked files, and so on. + +Your right-click menu now has contextual Git options when invoked inside a Git repository. You can initiate a checkout, push or pull when clicking inside a Dolphin window, and you can even do a git add or git remove on your files. + +![](https://opensource.com/sites/default/files/4_dolphingit.jpg) + +You can't clone a repository or change remote paths in Dolphin, but will have to drop to a terminal, which is just an F4 away. + +Frankly, this feature of KDE is so kool [sic] that this article could just end here. The integration of Git in your native file manager makes working with Git almost transparent; everything you need to do just happens no matter what stage of the process you are in. Git in the terminal, and Git waiting for you when you switch to the GUI. It is perfection. + +But wait, there's more! + +### Sparkleshare + +From the other side of the desktop pond comes SparkleShare, a project that uses a file synchronization model ("like Dropbox!") that got started by some GNOME developers. It is not integrated into any specific part of GNOME, so you can use it on all platforms. + +If you run Linux, install SparkleShare from your software repository. Other operating systems should download from the SparkleShare website. You can safely ignore the instructions on the SparkleShare website, which are for setting up a SparkleShare server, which is not what we will do here. You certainly can set up a SparkleShare server if you want, but SparkleShare is compatible with any Git repository, so you don't need to create your own server. + +After it is installed, launch SparkleShare from your applications menu. Step through the setup wizard, which is two steps plus a brief tutorial, and optionally set SparkleShare as a startup item for your desktop. + +![](https://opensource.com/sites/default/files/4_sparklesetup.jpg) + +An orange SparkleShare directory is now in your system tray. Currently, SparkleShare is oblivious to anything on your computer, so you need to add a hosted project. + +To add a directory for SparkleShare to track, click the SparkleShare icon in your system tray and select Add Hosted Project. + +![](https://opensource.com/sites/default/files/4_sparklehost.jpg) + +SparkleShare can work with self-hosted Git projects, or projects hosted on public Git services like GitHub and Bitbucket. For full access, you'll probably need to use the Client ID that SparkleShare provides to you. This is an SSH key acting as the authentication token for the service you use for hosting, including your own Git server, which should also use SSH public key authentication rather than password login. Copy the Client ID into the authorized_hosts file of your Git user on your server, or into the SSH key panel of your Git host. + +After configuring the host you want to use, SparkleShare downloads the Git project, including, at your option, the commit history. Find the files in ~/SparkleShare. + +Unlike Dolphin's Git integration, SparkleShare is unnervingly invisible. When you make a change, it quietly syncs the change to your remote project. For many people, that is a huge benefit: all the power of Git with none of the maintenance. To me, it is unsettling, because I like to govern what I commit and which branch I use. + +SparkleShare may not be for everyone, but it is a powerful and simple Git solution that shows how different open source projects fit together in perfect harmony to create something unique. + +### Git-cola + +Yet another model of working with Git repositories is less native and more of a monitoring approach; rather than using an integrated application to interact directly with your Git project, you can use a desktop client to monitor changes in your project and deal with each change in whatever way you choose. An advantage to this approach is focus. You might not care about all 125 files in your project when only three of them are actively being worked on, so it is helpful to bring them to the forefront. + +If you thought there were a lot of Git web hosts out there, you haven't seen anything yet. [Git clients for your desktop][1] are a dime-a-dozen. In fact, Git actually ships with an inbuilt graphical Git client. The most cross-platform and most configurable of them all is the open source Git-cola client, written in Python and Qt. + +If you're on Linux, Git-cola may be in your software repository. Otherwise, just download it from the site and install it: + +``` +$ python setup.py install +``` + +When Git-cola launches, you're given three buttons to open an existing repository, create a new repo, or clone an existing repository. + +Whichever you choose, at some point you end up with a Git repository. Git-cola, and indeed most desktop clients that I've used, don't try to be your interface into your repository; they leave that up to your normal operating system tools. In other words, I might start a repository with Git-cola, but then I would open that repository in Thunar or Emacs to start my work. Leaving Git-cola open as a monitor works quite well, because as you create new files, or change existing ones, they appear in Git-cola's Status panel. + +The default layout of Git-cola is a little non-linear. I prefer to move from left-to-right, and because Git-cola happens to be very configurable, you're welcome to change your layout. I set mine up so that the left-most panel is Status, showing any changes made to my current branch, then to the right, a Diff panel in case I want to review a change, and the Actions panel for quick-access buttons to common tasks, and finally the right-most panel is a Commit panel where I can write commit messages. + +![](https://opensource.com/sites/default/files/4_gitcola.jpg) + +Even if you use a different layout, this is the general flow of Git-cola: + +Changes appear in the Status panel. Right-click a change entry, or select a file and click the Stage button in the Action panel, to stage a file. + +A staged file's icon changes to a green triangle to indicate that it has been both modified and staged. You can unstage a file by right-clicking and selecting Unstage Selected, or by clicking the Unstage button in the Actions panel. + +Review your changes in the Diff panel. + +When you are ready to commit, enter a commit message and click the Commit button. + +There are other buttons in the Actions panel for other common tasks like a git pull or git push. The menus round out the task list, with dedicated actions for branching, reviewing diffs, rebasing, and a lot more. + +I tend to think of Git-cola as a kind of floating panel for my file manager (and I only use Git-cola when Dolphin is not available). On one hand, it's less interactive than a fully integrated and Git-aware file manager, but on the other, it offers practically everything that raw Git does, so it's actually more powerful. + +There are plenty of graphical Git clients. Some are paid software with no source code available, others are viewers only, others attempt to reinvent Git with special terms that are specific to the client ("sync" instead of "push"..?), and still others are platform-specific. Git-Cola has consistently been the easiest to use on any platform, and the one that stays closest to pure Git so that users learn Git whilst using it, and experts feel comfortable with the interface and terminology. + +### Git or graphical? + +I don't generally use graphical tools to access Git; mostly I use the ones I've discussed when helping other people find a comfortable interface for themselves. At the end of the day, though, it comes down to what fits with how you work. I like terminal-based Git because it integrates well with Emacs, but on a day where I'm working mostly in Inkscape, I might naturally fall back to using Git in Dolphin because I'm in Dolphin anyway. + +It's up to you how you use Git; the most important thing to remember is that Git is meant to make your life easier and those crazy ideas you have for your work safer to try out. Get familiar with the way Git works, and then use Git from whatever angle you find works best for you. + +In our next installment, we will learn how to set up and manage a Git server, including user access and management, and running custom scripts. + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/16/8/graphical-tools-git + +作者:[Seth Kenlon][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[1]: https://git-scm.com/downloads/guis From 569747cdee068155773a7a6b5b8b9841ecb73ac1 Mon Sep 17 00:00:00 2001 From: tianfeiyu Date: Thu, 4 Aug 2016 09:28:11 +0800 Subject: [PATCH 1352/1469] Update 20160726 How to restore older file versions in Git.md --- .../tech/20160726 How to restore older file versions in Git.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160726 How to restore older file versions in Git.md b/sources/tech/20160726 How to restore older file versions in Git.md index a8fc789672..675167aaad 100644 --- a/sources/tech/20160726 How to restore older file versions in Git.md +++ b/sources/tech/20160726 How to restore older file versions in Git.md @@ -1,3 +1,4 @@ +translated by strugglingyouth How to restore older file versions in Git ============================================= From a42cbc7cf6c3e5e7af7a32ef5782a3e6d41f1ccd Mon Sep 17 00:00:00 2001 From: David Dai Date: Thu, 4 Aug 2016 11:16:47 +0800 Subject: [PATCH 1353/1469] =?UTF-8?q?Traslating=2020160309=20Let=E2=80=99s?= =?UTF-8?q?=20Build=20A=20Web=20Server.=20Part=201.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20160309 Let’s Build A Web Server. Part 1.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160309 Let’s Build A Web Server. Part 1.md b/sources/tech/20160309 Let’s Build A Web Server. Part 1.md index 4c8048786d..63f08f754d 100644 --- a/sources/tech/20160309 Let’s Build A Web Server. Part 1.md +++ b/sources/tech/20160309 Let’s Build A Web Server. Part 1.md @@ -1,3 +1,4 @@ +Translating by StdioA Let’s Build A Web Server. Part 1. ===================================== From ae01fb620328fa04a45b336282b2ef234c1ee169 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 3 Aug 2016 20:17:49 +0800 Subject: [PATCH 1354/1469] PUB:20160602 How to build and deploy a Facebook Messenger bot with Python and Flask MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @wyangsun 只翻译了一半。。。 --- ...ook Messenger bot with Python and Flask.md | 392 ++++++++++++++++++ ...ook Messenger bot with Python and Flask.md | 319 -------------- 2 files changed, 392 insertions(+), 319 deletions(-) create mode 100644 published/20160602 How to build and deploy a Facebook Messenger bot with Python and Flask.md delete mode 100644 translated/tech/20160602 How to build and deploy a Facebook Messenger bot with Python and Flask.md diff --git a/published/20160602 How to build and deploy a Facebook Messenger bot with Python and Flask.md b/published/20160602 How to build and deploy a Facebook Messenger bot with Python and Flask.md new file mode 100644 index 0000000000..e2191b88c1 --- /dev/null +++ b/published/20160602 How to build and deploy a Facebook Messenger bot with Python and Flask.md @@ -0,0 +1,392 @@ +如何用 Python 和 Flask 建立部署一个 Facebook Messenger 机器人 +========================================================================== + +这是我建立一个简单的 Facebook Messenger 机器人的记录。功能很简单,它是一个回显机器人,只是打印回用户写了什么。 + +回显服务器类似于服务器的“Hello World”例子。 + +这个项目的目的不是建立最好的 Messenger 机器人,而是让你了解如何建立一个小型机器人和每个事物是如何整合起来的。 + +- [技术栈][1] +- [机器人架构][2] +- [机器人服务器][3] +- [部署到 Heroku][4] +- [创建 Facebook 应用][5] +- [结论][6] + +### 技术栈 + +使用到的技术栈: + +- [Heroku][7] 做后端主机。免费级足够这个等级的教程。回显机器人不需要任何种类的数据持久,所以不需要数据库。 +- [Python][8] 是我们选择的语言。版本选择 2.7,虽然它移植到 Pyhton 3 很容易,只需要很少的改动。 +- [Flask][9] 作为网站开发框架。它是非常轻量的框架,用在小型工程或微服务是非常完美的。 +- 最后 [Git][10] 版本控制系统用来维护代码和部署到 Heroku。 +- 值得一提:[Virtualenv][11]。这个 python 工具是用来创建清洁的 python 库“环境”的,这样你可以只安装必要的需求和最小化应用的大小。 + +### 机器人架构 + +Messenger 机器人是由一个响应两种请求的服务器组成的: + +- GET 请求被用来认证。他们与你注册的 FaceBook 认证码一同被 Messenger 发出。 +- POST 请求被用来实际的通信。典型的工作流是,机器人将通过用户发送带有消息数据的 POST 请求而建立通信,然后我们将处理这些数据,并发回我们的 POST 请求。如果这个请求完全成功(返回一个 200 OK 状态码),我们也将响应一个 200 OK 状态码给初始的 Messenger请求。 + +这个教程应用将托管到 Heroku,它提供了一个优雅而简单的部署应用的接口。如前所述,免费级可以满足这个教程。 + +在应用已经部署并且运行后,我们将创建一个 Facebook 应用然后连接它到我们的应用,以便 Messenger 知道发送请求到哪,这就是我们的机器人。 + +### 机器人服务器 + +基本的服务器代码可以在 Github 用户 [hult(Magnus Hult)][13] 的 [Chatbot][12] 项目上获取,做了一些只回显消息的代码修改和修正了一些我遇到的错误。最终版本的服务器代码如下: + +``` +from flask import Flask, request +import json +import requests + +app = Flask(__name__) + +### 这需要填写被授予的页面通行令牌(PAT) +### 它由将要创建的 Facebook 应用提供。 +PAT = '' + +@app.route('/', methods=['GET']) +def handle_verification(): + print "Handling Verification." + if request.args.get('hub.verify_token', '') == 'my_voice_is_my_password_verify_me': + print "Verification successful!" + return request.args.get('hub.challenge', '') + else: + print "Verification failed!" + return 'Error, wrong validation token' + +@app.route('/', methods=['POST']) +def handle_messages(): + print "Handling Messages" + payload = request.get_data() + print payload + for sender, message in messaging_events(payload): + print "Incoming from %s: %s" % (sender, message) + send_message(PAT, sender, message) + return "ok" + +def messaging_events(payload): + """Generate tuples of (sender_id, message_text) from the + provided payload. + """ + data = json.loads(payload) + messaging_events = data["entry"][0]["messaging"] + for event in messaging_events: + if "message" in event and "text" in event["message"]: + yield event["sender"]["id"], event["message"]["text"].encode('unicode_escape') + else: + yield event["sender"]["id"], "I can't echo this" + + +def send_message(token, recipient, text): + """Send the message text to recipient with id recipient. + """ + + r = requests.post("https://graph.facebook.com/v2.6/me/messages", + params={"access_token": token}, + data=json.dumps({ + "recipient": {"id": recipient}, + "message": {"text": text.decode('unicode_escape')} + }), + headers={'Content-type': 'application/json'}) + if r.status_code != requests.codes.ok: + print r.text + +if __name__ == '__main__': + app.run() +``` + +让我们分解代码。第一部分是引入所需的依赖: + +``` +from flask import Flask, request +import json +import requests +``` + +接下来我们定义两个函数(使用 Flask 特定的 app.route 装饰器),用来处理到我们的机器人的 GET 和 POST 请求。 + +``` +@app.route('/', methods=['GET']) +def handle_verification(): + print "Handling Verification." + if request.args.get('hub.verify_token', '') == 'my_voice_is_my_password_verify_me': + print "Verification successful!" + return request.args.get('hub.challenge', '') + else: + print "Verification failed!" + return 'Error, wrong validation token' +``` + +当我们创建 Facebook 应用时,verify_token 对象将由我们声明的 Messenger 发送。我们必须自己来校验它。最后我们返回“hub.challenge”给 Messenger。 + +处理 POST 请求的函数更有意思一些: + +``` +@app.route('/', methods=['POST']) +def handle_messages(): + print "Handling Messages" + payload = request.get_data() + print payload + for sender, message in messaging_events(payload): + print "Incoming from %s: %s" % (sender, message) + send_message(PAT, sender, message) + return "ok" +``` + +当被调用时,我们抓取消息载荷,使用函数 messaging_events 来拆解它,并且提取发件人身份和实际发送的消息,生成一个可以循环处理的 python 迭代器。请注意 Messenger 发送的每个请求有可能多于一个消息。 + +``` +def messaging_events(payload): + """Generate tuples of (sender_id, message_text) from the + provided payload. + """ + data = json.loads(payload) + messaging_events = data["entry"][0]["messaging"] + for event in messaging_events: + if "message" in event and "text" in event["message"]: + yield event["sender"]["id"], event["message"]["text"].encode('unicode_escape') + else: + yield event["sender"]["id"], "I can't echo this" +``` + +对每个消息迭代时,我们会调用 send_message 函数,然后我们使用 Facebook Graph messages API 对 Messenger 发回 POST 请求。在这期间我们一直没有回应我们阻塞的原始 Messenger请求。这会导致超时和 5XX 错误。 + +上述情况是我在解决遇到错误时发现的,当用户发送表情时实际上是发送的 unicode 标识符,但是被 Python 错误的编码了,最终我们发回了一些乱码。 + +这个发回 Messenger 的 POST 请求将永远不会完成,这会导致给初始请求返回 5xx 状态码,显示服务不可用。 + +通过使用 `encode('unicode_escape')` 封装消息,然后在我们发送回消息前用 `decode('unicode_escape')` 解码消息就可以解决。 + +``` +def send_message(token, recipient, text): + """Send the message text to recipient with id recipient. + """ + + r = requests.post("https://graph.facebook.com/v2.6/me/messages", + params={"access_token": token}, + data=json.dumps({ + "recipient": {"id": recipient}, + "message": {"text": text.decode('unicode_escape')} + }), + headers={'Content-type': 'application/json'}) + if r.status_code != requests.codes.ok: + print r.text +``` + +### 部署到 Heroku + +一旦代码已经建立成我想要的样子时就可以进行下一步。部署应用。 + +那么,该怎么做? + +我之前在 Heroku 上部署过应用(主要是 Rails),然而我总是遵循某种教程做的,所用的配置是创建好了的。而在本文的情况下,我就需要从头开始。 + +幸运的是有官方 [Heroku 文档][14]来帮忙。这篇文档很好地说明了运行应用程序所需的最低限度。 + +长话短说,我们需要的除了我们的代码还有两个文件。第一个文件是“requirements.txt”,它列出了运行应用所依赖的库。 + +需要的第二个文件是“Procfile”。这个文件通知 Heroku 如何运行我们的服务。此外这个文件只需要一点点内容: + +``` +web: gunicorn echoserver:app +``` + +Heroku 对它的解读是,我们的应用通过运行 echoserver.py 启动,并且应用将使用 gunicorn 作为 Web 服务器。我们使用一个额外的网站服务器是因为与性能相关,在上面的 Heroku 文档里对此解释了: + +> Web 应用程序并发处理传入的 HTTP 请求比一次只处理一个请求的 Web 应用程序会更有效利地用测试机的资源。由于这个原因,我们建议使用支持并发请求的 Web 服务器来部署和运行产品级服务。 + +> Django 和 Flask web 框架提供了一个方便的内建 Web 服务器,但是这些阻塞式服务器一个时刻只能处理一个请求。如果你部署这种服务到 Heroku 上,你的测试机就会资源利用率低下,应用会感觉反应迟钝。 + +> Gunicorn 是一个纯 Python 的 HTTP 服务器,用于 WSGI 应用。允许你在单独一个测试机内通过运行多 Python 进程的方式来并发的运行各种 Python 应用。它在性能、灵活性和配置简易性方面取得了完美的平衡。 + +回到我们之前提到过的“requirements.txt”文件,让我们看看它如何结合 Virtualenv 工具。 + +很多情况下,你的开发机器也许已经安装了很多 python 库。当部署应用时你不想全部加载那些库,但是辨认出你实际使用哪些库很困难。 + +Virtualenv 可以创建一个新的空白虚拟环境,以便你可以只安装你应用所需要的库。 + +你可以运行如下命令来检查当前安装了哪些库: + +``` +kostis@KostisMBP ~ $ pip freeze +cycler==0.10.0 +Flask==0.10.1 +gunicorn==19.6.0 +itsdangerous==0.24 +Jinja2==2.8 +MarkupSafe==0.23 +matplotlib==1.5.1 +numpy==1.10.4 +pyparsing==2.1.0 +python-dateutil==2.5.0 +pytz==2015.7 +requests==2.10.0 +scipy==0.17.0 +six==1.10.0 +virtualenv==15.0.1 +Werkzeug==0.11.10 +``` + +注意:pip 工具应该已经与 Python 一起安装在你的机器上。如果没有,查看[官方网站][15]如何安装它。 + +现在让我们使用 Virtualenv 来创建一个新的空白环境。首先我们给我们的项目创建一个新文件夹,然后进到目录下: + +``` +kostis@KostisMBP projects $ mkdir echoserver +kostis@KostisMBP projects $ cd echoserver/ +kostis@KostisMBP echoserver $ +``` + +现在来创建一个叫做 echobot 的新环境。运行下面的 source 命令激活它,然后使用 pip freeze 检查,我们能看到现在是空的。 + +``` +kostis@KostisMBP echoserver $ virtualenv echobot +kostis@KostisMBP echoserver $ source echobot/bin/activate +(echobot) kostis@KostisMBP echoserver $ pip freeze +(echobot) kostis@KostisMBP echoserver $ +``` + +我们可以安装需要的库。我们需要是 flask、gunicorn 和 requests,它们被安装后我们就创建 requirements.txt 文件: + +``` +(echobot) kostis@KostisMBP echoserver $ pip install flask +(echobot) kostis@KostisMBP echoserver $ pip install gunicorn +(echobot) kostis@KostisMBP echoserver $ pip install requests +(echobot) kostis@KostisMBP echoserver $ pip freeze +click==6.6 +Flask==0.11 +gunicorn==19.6.0 +itsdangerous==0.24 +Jinja2==2.8 +MarkupSafe==0.23 +requests==2.10.0 +Werkzeug==0.11.10 +(echobot) kostis@KostisMBP echoserver $ pip freeze > requirements.txt +``` + +上述完成之后,我们用 python 代码创建 echoserver.py 文件,然后用之前提到的命令创建 Procfile,我们最终的文件/文件夹如下: + +``` +(echobot) kostis@KostisMBP echoserver $ ls +Procfile echobot echoserver.py requirements.txt +``` + +我们现在准备上传到 Heroku。我们需要做两件事。第一是如果还没有安装 Heroku toolbet,就安装它(详见 [Heroku][16])。第二是通过 Heroku [网页界面][17]创建一个新的 Heroku 应用。 + +点击右上的大加号然后选择“Create new app”。 + +![](http://tsaprailis.com/assets/create_app.png) + +为你的应用选择一个名字,然后点击“Create App”。 + +![](http://tsaprailis.com/assets/create.png) + +你将会重定向到你的应用的控制面板,在那里你可以找到如何部署你的应用到 Heroku 的细节说明。 + +``` +(echobot) kostis@KostisMBP echoserver $ heroku login +(echobot) kostis@KostisMBP echoserver $ git init +(echobot) kostis@KostisMBP echoserver $ heroku git:remote -a +(echobot) kostis@KostisMBP echoserver $ git add . +(echobot) kostis@KostisMBP echoserver $ git commit -m "Initial commit" +(echobot) kostis@KostisMBP echoserver (master) $ git push heroku master +... +remote: https://.herokuapp.com/ deployed to Heroku +... +(echobot) kostis@KostisMBP echoserver (master) $ heroku config:set WEB_CONCURRENCY=3 +``` + +如上,当你推送你的修改到 Heroku 之后,你会得到一个用于公开访问你新创建的应用的 URL。保存该 URL,下一步需要它。 + +### 创建这个 Facebook 应用 + +让我们的机器人可以工作的最后一步是创建这个我们将连接到其上的 Facebook 应用。Facebook 通常要求每个应用都有一个相关页面,所以我们来[创建一个][18]。 + +接下来我们去 [Facebook 开发者专页][19],点击右上角的“My Apps”按钮并选择“Add a New App”。不要选择建议的那个,而是点击“basic setup”。填入需要的信息并点击“Create App Id”,然后你会重定向到新的应用页面。 + +![](http://tsaprailis.com/assets/facebook_app.png) + + +在 “Products” 菜单之下,点击“+ Add Product” ,然后在“Messenger”下点击“Get Started”。跟随这些步骤设置 Messenger,当完成后你就可以设置你的 webhooks 了。Webhooks 简单的来说是你的服务所用的 URL 的名称。点击 “Setup Webhooks” 按钮,并添加该 Heroku 应用的 URL (你之前保存的那个)。在校验元组中写入 ‘my_voice_is_my_password_verify_me’。你可以写入任何你要的内容,但是不管你在这里写入的是什么内容,要确保同时修改代码中 handle_verification 函数。然后勾选 “messages” 选项。 + +![](http://tsaprailis.com/assets/webhooks.png) + +点击“Verify and Save” 就完成了。Facebook 将访问该 Heroku 应用并校验它。如果不工作,可以试试运行: + +``` +(echobot) kostis@KostisMBP heroku logs -t +``` + +然后看看日志中是否有错误。如果发现错误, Google 搜索一下可能是最快的解决方法。 + +最后一步是取得页面访问元组(PAT),它可以将该 Facebook 应用于你创建好的页面连接起来。 + +![](http://tsaprailis.com/assets/PAT.png) + +从下拉列表中选择你创建好的页面。这会在“Page Access Token”(PAT)下面生成一个字符串。点击复制它,然后编辑 echoserver.py 文件,将其贴入 PAT 变量中。然后在 Git 中添加、提交并推送该修改。 + +``` +(echobot) kostis@KostisMBP echoserver (master) $ git add . +(echobot) kostis@KostisMBP echoserver (master) $ git commit -m "Initial commit" +(echobot) kostis@KostisMBP echoserver (master) $ git push heroku master +``` + +最后,在 Webhooks 菜单下再次选择你的页面并点击“Subscribe”。 + +![](http://tsaprailis.com/assets/subscribe.png) + +现在去访问你的页面并建立会话: + +![](http://tsaprailis.com/assets/success.png) + +成功了,机器人回显了! + +注意:除非你要将这个机器人用在 Messenger 上测试,否则你就是机器人唯一响应的那个人。如果你想让其他人也试试它,到 [Facebook 开发者专页][19]中,选择你的应用、角色,然后添加你要添加的测试者。 + +###总结 + +这对于我来说是一个非常有用的项目,希望它可以指引你找到开始的正确方向。[官方的 Facebook 指南][20]有更多的资料可以帮你学到更多。 + +你可以在 [Github][21] 上找到该项目的代码。 + +如果你有任何评论、勘误和建议,请随时联系我。 + + +-------------------------------------------------------------------------------- + +via: http://tsaprailis.com/2016/06/02/How-to-build-and-deploy-a-Facebook-Messenger-bot-with-Python-and-Flask-a-tutorial/ + +作者:[Konstantinos Tsaprailis][a] +译者:[wyangsun](https://github.com/wyangsun) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://github.com/kostistsaprailis +[1]: http://tsaprailis.com/2016/06/02/How-to-build-and-deploy-a-Facebook-Messenger-bot-with-Python-and-Flask-a-tutorial/#tech-stack +[2]: http://tsaprailis.com/2016/06/02/How-to-build-and-deploy-a-Facebook-Messenger-bot-with-Python-and-Flask-a-tutorial/#bot-architecture +[3]: http://tsaprailis.com/2016/06/02/How-to-build-and-deploy-a-Facebook-Messenger-bot-with-Python-and-Flask-a-tutorial/#the-bot-server +[4]: http://tsaprailis.com/2016/06/02/How-to-build-and-deploy-a-Facebook-Messenger-bot-with-Python-and-Flask-a-tutorial/#deploying-to-heroku +[5]: http://tsaprailis.com/2016/06/02/How-to-build-and-deploy-a-Facebook-Messenger-bot-with-Python-and-Flask-a-tutorial/#creating-the-facebook-app +[6]: http://tsaprailis.com/2016/06/02/How-to-build-and-deploy-a-Facebook-Messenger-bot-with-Python-and-Flask-a-tutorial/#conclusion +[7]: https://www.heroku.com +[8]: https://www.python.org +[9]: http://flask.pocoo.org +[10]: https://git-scm.com +[11]: https://virtualenv.pypa.io/en/stable +[12]: https://github.com/hult/facebook-chatbot-python +[13]: https://github.com/hult +[14]: https://devcenter.heroku.com/articles/python-gunicorn +[15]: https://pip.pypa.io/en/stable/installing +[16]: https://toolbelt.heroku.com +[17]: https://dashboard.heroku.com/apps +[18]: https://www.facebook.com/pages/create +[19]: https://developers.facebook.com/ +[20]: https://developers.facebook.com/docs/messenger-platform/implementation +[21]: https://github.com/kostistsaprailis/messenger-bot-tutorial \ No newline at end of file diff --git a/translated/tech/20160602 How to build and deploy a Facebook Messenger bot with Python and Flask.md b/translated/tech/20160602 How to build and deploy a Facebook Messenger bot with Python and Flask.md deleted file mode 100644 index 5ad4e62816..0000000000 --- a/translated/tech/20160602 How to build and deploy a Facebook Messenger bot with Python and Flask.md +++ /dev/null @@ -1,319 +0,0 @@ -如何用Python和Flask建立部署一个Facebook信使机器人教程 -========================================================================== - -这是我建立一个简单的Facebook信使机器人的记录。功能很简单,他是一个回显机器人,只是打印回用户写了什么。 - -回显服务器类似于服务器的“Hello World”例子。 - -这个项目的目的不是建立最好的信使机器人,而是获得建立一个小型机器人和每个事物是如何整合起来的感觉。 - -- [技术栈][1] -- [机器人架构][2] -- [机器人服务器][3] -- [部署到 Heroku][4] -- [创建 Facebook 应用][5] -- [结论][6] - -### 技术栈 - -使用到的技术栈: - -- [Heroku][7] 做后端主机。免费层足够这个等级的教程。回显机器人不需要任何种类的数据持久,所以不需要数据库。 -- [Python][8] 是选择的一个语言。版本选择2.7,虽然它移植到 Pyhton 3 很容易,只需要很少的改动。 -- [Flask][9] 作为网站开发框架。它是非常轻量的框架,用在小型工程或微服务是完美的。 -- 最后 [Git][10] 版本控制系统用来维护代码和部署到 Heroku。 -- 值得一提:[Virtualenv][11]。这个 python 工具是用来创建清洁的 python 库“环境”的,你只用安装必要的需求和最小化的应用封装。 - -### 机器人架构 - -信使机器人是由一个服务器组成,响应两种请求: - -- GET 请求被用来认证。他们与你注册的 FB 认证码一同被信使发出。 -- POST 请求被用来真实的通信。传统的工作流是,机器人将通过发送 POST 请求与用户发送的消息数据建立通信,我们将处理它,发送一个我们自己的 POST 请求回去。如果这一个完全成功(返回一个200 OK 状态)我们也响应一个200 OK 码给初始信使请求。 -这个教程应用将托管到Heroku,他提供了一个很好并且简单的接口来部署应用。如前所述,免费层可以满足这个教程。 - -在应用已经部署并且运行后,我们将创建一个 Facebook 应用然后连接它到我们的应用,以便信使知道发送请求到哪,这就是我们的机器人。 - -### 机器人服务器 - -基本的服务器代码可以在Github用户 [hult(Magnus Hult)][13] 的 [Chatbot][12] 工程上获取,经过一些代码修改只回显消息和一些我遇到的错误更正。最终版本的服务器代码: - -``` -from flask import Flask, request -import json -import requests - -app = Flask(__name__) - -# 这需要填写被授予的页面通行令牌 -# 通过 Facebook 应用创建令牌。 -PAT = '' - -@app.route('/', methods=['GET']) -def handle_verification(): - print "Handling Verification." - if request.args.get('hub.verify_token', '') == 'my_voice_is_my_password_verify_me': - print "Verification successful!" - return request.args.get('hub.challenge', '') - else: - print "Verification failed!" - return 'Error, wrong validation token' - -@app.route('/', methods=['POST']) -def handle_messages(): - print "Handling Messages" - payload = request.get_data() - print payload - for sender, message in messaging_events(payload): - print "Incoming from %s: %s" % (sender, message) - send_message(PAT, sender, message) - return "ok" - -def messaging_events(payload): - """Generate tuples of (sender_id, message_text) from the - provided payload. - """ - data = json.loads(payload) - messaging_events = data["entry"][0]["messaging"] - for event in messaging_events: - if "message" in event and "text" in event["message"]: - yield event["sender"]["id"], event["message"]["text"].encode('unicode_escape') - else: - yield event["sender"]["id"], "I can't echo this" - - -def send_message(token, recipient, text): - """Send the message text to recipient with id recipient. - """ - - r = requests.post("https://graph.facebook.com/v2.6/me/messages", - params={"access_token": token}, - data=json.dumps({ - "recipient": {"id": recipient}, - "message": {"text": text.decode('unicode_escape')} - }), - headers={'Content-type': 'application/json'}) - if r.status_code != requests.codes.ok: - print r.text - -if __name__ == '__main__': - app.run() -``` - -让我们分解代码。第一部分是引入所需: - -``` -from flask import Flask, request -import json -import requests -``` - -接下来我们定义两个函数(使用 Flask 特定的 app.route 装饰器),用来处理到我们的机器人的 GET 和 POST 请求。 - -``` -@app.route('/', methods=['GET']) -def handle_verification(): - print "Handling Verification." - if request.args.get('hub.verify_token', '') == 'my_voice_is_my_password_verify_me': - print "Verification successful!" - return request.args.get('hub.challenge', '') - else: - print "Verification failed!" - return 'Error, wrong validation token' -``` - -当我们创建 Facebook 应用时声明由信使发送的 verify_token 对象。我们必须对自己进行认证。最后我们返回“hub.challenge”给信使。 - -处理 POST 请求的函数更有趣 - -``` -@app.route('/', methods=['POST']) -def handle_messages(): - print "Handling Messages" - payload = request.get_data() - print payload - for sender, message in messaging_events(payload): - print "Incoming from %s: %s" % (sender, message) - send_message(PAT, sender, message) - return "ok" -``` - -当调用我们抓取的消息负载时,使用函数 messaging_events 来中断它并且提取发件人身份和真实发送消息,生成一个 python 迭代器循环遍历。请注意信使发送的每个请求有可能多于一个消息。 - -``` -def messaging_events(payload): - """Generate tuples of (sender_id, message_text) from the - provided payload. - """ - data = json.loads(payload) - messaging_events = data["entry"][0]["messaging"] - for event in messaging_events: - if "message" in event and "text" in event["message"]: - yield event["sender"]["id"], event["message"]["text"].encode('unicode_escape') - else: - yield event["sender"]["id"], "I can't echo this" -``` - -迭代完每个消息时我们调用send_message函数然后我们执行POST请求回给使用Facebook图形消息接口信使。在这期间我们一直没有回应我们阻塞的原始信使请求。这会导致超时和5XX错误。 - -上述的发现错误是中断期间我偶然发现的,当用户发送表情时其实的是当成了 unicode 标识,无论如何 Python 发生了误编码。我们以发送回垃圾结束。 - -这个 POST 请求回到信使将不会结束,这会导致发生5xx状态返回给原始的请求,显示服务不可用。 - -通过使用`encode('unicode_escape')`转义消息然后在我们发送回消息前用`decode('unicode_escape')`解码消息就可以解决。 - -``` -def send_message(token, recipient, text): - """Send the message text to recipient with id recipient. - """ - - r = requests.post("https://graph.facebook.com/v2.6/me/messages", - params={"access_token": token}, - data=json.dumps({ - "recipient": {"id": recipient}, - "message": {"text": text.decode('unicode_escape')} - }), - headers={'Content-type': 'application/json'}) - if r.status_code != requests.codes.ok: - print r.text -``` - -### 部署到 Heroku - -一旦代码已经建立成我想要的样子时就可以进行下一步。部署应用。 - -当然,但是怎么做? - -我之前已经部署了应用到 Heroku (主要是 Rails)然而我总是遵循某种教程,所以配置已经创建。在这种情况下,尽管我必须从头开始。 - -幸运的是有官方[Heroku文档][14]来帮忙。这篇文章很好地说明了运行应用程序所需的最低限度。 - -长话短说,我们需要的除了我们的代码还有两个文件。第一个文件是“requirements.txt”他列出了运行应用所依赖的库。 - -需要的第二个文件是“Procfile”。这个文件通知 Heroku 如何运行我们的服务。此外这个文件最低限度如下: - ->web: gunicorn echoserver:app - -heroku解读他的方式是我们的应用通过运行 echoserver.py 开始并且应用将使用 gunicorn 作为网站服务器。我们使用一个额外的网站服务器是因为与性能相关并在上面的Heroku文档里解释了: - ->Web 应用程序并发处理传入的HTTP请求比一次只处理一个请求的Web应用程序,更有效利地用动态资源。由于这个原因,我们建议使用支持并发请求的 web 服务器处理开发和生产运行的服务。 - ->Django 和 Flask web 框架特性方便内建 web 服务器,但是这些阻塞式服务器一个时刻只处理一个请求。如果你部署这种服务到 Heroku上,你的动态资源不会充分使用并且你的应用会感觉迟钝。 - ->Gunicorn 是一个纯 Python HTTP 的 WSGI 引用服务器。允许你在单独一个动态资源内通过并发运行多 Python 进程的方式运行任一 Python 应用。它提供了一个完美性能,弹性,简单配置的平衡。 - -回到我们提到的“requirements.txt”文件,让我们看看它如何结合 Virtualenv 工具。 - -在任何时候,你的开发机器也许有若干已安装的 python 库。当部署应用时你不想这些库被加载因为很难辨认出你实际使用哪些库。 - -Virtualenv 创建一个新的空白虚拟环境,因此你可以只安装你应用需要的库。 - -你可以检查当前安装使用哪些库的命令如下: - -``` -kostis@KostisMBP ~ $ pip freeze -cycler==0.10.0 -Flask==0.10.1 -gunicorn==19.6.0 -itsdangerous==0.24 -Jinja2==2.8 -MarkupSafe==0.23 -matplotlib==1.5.1 -numpy==1.10.4 -pyparsing==2.1.0 -python-dateutil==2.5.0 -pytz==2015.7 -requests==2.10.0 -scipy==0.17.0 -six==1.10.0 -virtualenv==15.0.1 -Werkzeug==0.11.10 -``` - -注意:pip 工具应该已经与 Python 一起安装在你的机器上。 - -如果没有,查看[官方网站][15]如何安装他。 - -现在让我们使用 Virtualenv 来创建一个新的空白环境。首先我们给我们的工程创建一个新文件夹,然后进到目录下: - -``` -kostis@KostisMBP projects $ mkdir echoserver -kostis@KostisMBP projects $ cd echoserver/ -kostis@KostisMBP echoserver $ -``` - -现在来创建一个叫做 echobot 新的环境。运行下面的 source 命令激活它,然后使用 pip freeze 检查,我们能看到现在是空的。 - -``` -kostis@KostisMBP echoserver $ virtualenv echobot -kostis@KostisMBP echoserver $ source echobot/bin/activate -(echobot) kostis@KostisMBP echoserver $ pip freeze -(echobot) kostis@KostisMBP echoserver $ -``` - -我们可以安装需要的库。我们需要是 flask,gunicorn,和 requests,他们被安装完我们就创建 requirements.txt 文件: - -``` -(echobot) kostis@KostisMBP echoserver $ pip install flask -(echobot) kostis@KostisMBP echoserver $ pip install gunicorn -(echobot) kostis@KostisMBP echoserver $ pip install requests -(echobot) kostis@KostisMBP echoserver $ pip freeze -click==6.6 -Flask==0.11 -gunicorn==19.6.0 -itsdangerous==0.24 -Jinja2==2.8 -MarkupSafe==0.23 -requests==2.10.0 -Werkzeug==0.11.10 -(echobot) kostis@KostisMBP echoserver $ pip freeze > requirements.txt -``` - -毕竟上文已经被运行,我们用 python 代码创建 echoserver.py 文件然后用之前提到的命令创建 Procfile,我们应该以下面的文件/文件夹结束: - -``` -(echobot) kostis@KostisMBP echoserver $ ls -Procfile echobot echoserver.py requirements.txt -``` - -我们现在准备上传到 Heroku。我们需要做两件事。第一是安装 Heroku toolbet 如果你还没安装到你的系统中(详细看[Heroku][16])。第二通过[网页接口][17]创建一个新的 Heroku 应用。 - -点击右上的大加号然后选择“Create new app”。 - - - - - - - - --------------------------------------------------------------------------------- - -via: http://tsaprailis.com/2016/06/02/How-to-build-and-deploy-a-Facebook-Messenger-bot-with-Python-and-Flask-a-tutorial/ - -作者:[Konstantinos Tsaprailis][a] -译者:[wyangsun](https://github.com/wyangsun) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://github.com/kostistsaprailis -[1]: http://tsaprailis.com/2016/06/02/How-to-build-and-deploy-a-Facebook-Messenger-bot-with-Python-and-Flask-a-tutorial/#tech-stack -[2]: http://tsaprailis.com/2016/06/02/How-to-build-and-deploy-a-Facebook-Messenger-bot-with-Python-and-Flask-a-tutorial/#bot-architecture -[3]: http://tsaprailis.com/2016/06/02/How-to-build-and-deploy-a-Facebook-Messenger-bot-with-Python-and-Flask-a-tutorial/#the-bot-server -[4]: http://tsaprailis.com/2016/06/02/How-to-build-and-deploy-a-Facebook-Messenger-bot-with-Python-and-Flask-a-tutorial/#deploying-to-heroku -[5]: http://tsaprailis.com/2016/06/02/How-to-build-and-deploy-a-Facebook-Messenger-bot-with-Python-and-Flask-a-tutorial/#creating-the-facebook-app -[6]: http://tsaprailis.com/2016/06/02/How-to-build-and-deploy-a-Facebook-Messenger-bot-with-Python-and-Flask-a-tutorial/#conclusion -[7]: https://www.heroku.com -[8]: https://www.python.org -[9]: http://flask.pocoo.org -[10]: https://git-scm.com -[11]: https://virtualenv.pypa.io/en/stable -[12]: https://github.com/hult/facebook-chatbot-python -[13]: https://github.com/hult -[14]: https://devcenter.heroku.com/articles/python-gunicorn -[15]: https://pip.pypa.io/en/stable/installing -[16]: https://toolbelt.heroku.com -[17]: https://dashboard.heroku.com/apps - - From e5ff58184b2cd9608d0c8d559fc94c6cfc25ca6c Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 4 Aug 2016 16:36:43 +0800 Subject: [PATCH 1355/1469] PUB:20160718 Creating your first Git repository MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @vim-kakali 校对累死我了——这个作者写的真累。 --- ...0718 Creating your first Git repository.md | 176 ++++++++++++++++ ...0718 Creating your first Git repository.md | 199 ------------------ 2 files changed, 176 insertions(+), 199 deletions(-) create mode 100644 published/20160718 Creating your first Git repository.md delete mode 100644 translated/tech/20160718 Creating your first Git repository.md diff --git a/published/20160718 Creating your first Git repository.md b/published/20160718 Creating your first Git repository.md new file mode 100644 index 0000000000..d1a8ca2840 --- /dev/null +++ b/published/20160718 Creating your first Git repository.md @@ -0,0 +1,176 @@ +Git 系列(三):建立你的第一个 Git 仓库 +====================================== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/open_abstract_pieces.jpg?itok=ZRt0Db00) + +现在是时候学习怎样创建你自己的 Git 仓库了,还有怎样增加文件和完成提交。 + +在本系列[前面的文章][4]中,你已经学习了怎样作为一个最终用户与 Git 进行交互;你就像一个漫无目的的流浪者一样偶然发现了一个开源项目网站,克隆了仓库,然后你就可以继续钻研它了。你知道了和 Git 进行交互并不像你想的那样困难,或许你只是需要被说服现在去使用 Git 完成你的工作罢了。 + +虽然 Git 确实是被许多重要软件选作版本控制工具,但是并不是仅能用于这些重要软件;它也能管理你购物清单(如果它们对你来说很重要的话,当然可以了!)、你的配置文件、周报或日记、项目进展日志、甚至源代码! + +使用 Git 是很有必要的,毕竟,你肯定有过因为一个备份文件不能够辨认出版本信息而抓狂的时候。 + +Git 无法帮助你,除非你开始使用它,而现在就是开始学习和使用它的最好时机。或者,用 Git 的话来说,“没有其他的 `push` 能像 `origin HEAD` 一样有帮助了”(千里之行始于足下的意思)。我保证,你很快就会理解这一点的。 + +### 类比于录音 + +我们经常用名词“快照”来指代计算机上的镜像,因为很多人都能够对插满了不同时光的照片的相册充满了感受。这很有用,不过,我认为 Git 更像是进行一场录音。 + +也许你不太熟悉传统的录音棚卡座式录音机,它包括几个部件:一个可以正转或反转的转轴、保存声音波形的磁带,可以通过拾音头在磁带上记录声音波形,或者检测到磁带上的声音波形并播放给听众。 + +除了往前播放磁带,你也可以把磁带倒回到之前的部分,或快进跳过后面的部分。 + +想象一下上世纪 70 年代乐队录制磁带的情形。你可以想象到他们一遍遍地练习歌曲,直到所有部分都非常完美,然后记录到音轨上。起初,你会录下鼓声,然后是低音,再然后是吉他声,最后是主唱。每次你录音时,录音棚工作人员都会把磁带倒带,然后进入循环模式,这样它就会播放你之前录制的部分。比如说如果你正在录制低音,你就会在背景音乐里听到鼓声,就像你自己在击鼓一样,然后吉他手在录制时会听到鼓声、低音(和牛铃声)等等。在每个循环中,你都会录制一部分,在接下来的循环中,工作人员就会按下录音按钮将其合并记录到磁带中。 + +你也可以拷贝或换下整个磁带,如果你要对你的作品重新混音的话。 + +现在我希望对于上述的上世纪 70 年代的录音工作的描述足够生动,这样我们就可以把 Git 的工作想象成一个录音工作了。 + +### 新建一个 Git 仓库 + +首先得为我们的虚拟的录音机买一些磁带。用 Git 的话说,这些磁带就是*仓库*;它是完成所有工作的基础,也就是说这里是存放 Git 文件的地方(即 Git 工作区)。 + +任何目录都可以成为一个 Git 仓库,但是让我们从一个新目录开始。这需要下面三个命令: + +- 创建目录(如果你喜欢的话,你可以在你的图形化的文件管理器里面完成。) +- 在终端里切换到目录。 +- 将其初始化成一个 Git 管理的目录。 + +也就是运行如下代码: + +``` +$ mkdir ~/jupiter # 创建目录 +$ cd ~/jupiter # 进入目录 +$ git init . # 初始化你的新 Git 工作区 +``` + +在这个例子中,文件夹 jupiter 是一个空的但是合法的 Git 仓库。 + +有了仓库接下来的事情就可以按部就班进行了。你可以克隆该仓库,你可以在一个历史点前后来回穿梭(前提是你有一个历史点),创建交替的时间线,以及做 Git 能做的其它任何事情。 + +在 Git 仓库里面工作和在任何目录里面工作都是一样的,可以在仓库中新建文件、复制文件、保存文件。你可以像平常一样做各种事情;Git 并不复杂,除非你把它想复杂了。 + +在本地的 Git 仓库中,一个文件可以有以下这三种状态: + +- 未跟踪文件(Untracked):你在仓库里新建了一个文件,但是你没有把文件加入到 Git 的管理之中。 +- 已跟踪文件(Tracked):已经加入到 Git 管理的文件。 +- 暂存区文件(Staged):被修改了的已跟踪文件,并加入到 Git 的提交队列中。 + +任何你新加入到 Git 仓库中的文件都是未跟踪文件。这些文件保存在你的电脑硬盘上,但是你没有告诉 Git 这是需要管理的文件,用我们的录音机来类比,就是录音机还没打开;乐队就开始在录音棚里忙碌了,但是录音机并没有准备录音。 + +不用担心,Git 会在出现这种情况时告诉你: + +``` +$ echo "hello world" > foo +$ git status +On branch master +Untracked files: +(use "git add ..." to include in what will be committed) + foo +nothing added but untracked files present (use "git add" to track) +``` + +你看到了,Git 会提醒你怎样把文件加入到提交任务中。 + +### 不使用 Git 命令进行 Git 操作 + +在 GitHub 或 GitLab 上创建一个仓库只需要用鼠标点几下即可。这并不难,你单击“New Repository”这个按钮然后跟着提示做就可以了。 + +在仓库中包括一个“README”文件是一个好习惯,这样人们在浏览你的仓库的时候就可以知道你的仓库是干什么的,更有用的是可以让你在克隆一个有东西的仓库前知道它有些什么。 + +克隆仓库通常很简单,但是在 GitHub 上获取仓库改动权限就稍微复杂一些,为了通过 GitHub 验证你必须有一个 SSH 密钥。如果你使用 Linux 系统,可以通过下面的命令生成: + +``` +$ ssh-keygen +``` + +然后复制你的新密钥的内容,它是纯文本文件,你可以使用一个文本编辑器打开它,也可以使用如下 cat 命令查看: + +``` +$ cat ~/.ssh/id_rsa.pub +``` + +现在把你的密钥粘贴到 [GitHub SSH 配置文件][1] 中,或者 [GitLab 配置文件][2]。 + +如果你通过使用 SSH 模式克隆了你的项目,你就可以将修改写回到你的仓库了。 + +另外,如果你的系统上没有安装 Git 的话也可以使用 GitHub 的文件上传接口来添加文件。 + +![](https://opensource.com/sites/default/files/2_githubupload.jpg) + +### 跟踪文件 + +正如命令 `git status` 的输出告诉你的那样,如果你想让 git 跟踪一个文件,你必须使用命令 `git add` 把它加入到提交任务中。这个命令把文件存在了暂存区,这里存放的都是等待提交的文件,或者也可以用在快照中。在将文件包括到快照中,和添加要 Git 管理的新的或临时文件时,`git add` 命令的目的是不同的,不过至少现在,你不用为它们之间的不同之处而费神。 + +类比录音机,这个动作就像打开录音机开始准备录音一样。你可以想象为对已经在录音的录音机按下暂停按钮,或者倒回开头等着记录下个音轨。 + +当你把文件添加到 Git 管理中,它会标识其为已跟踪文件: + +``` +$ git add foo +$ git status +On branch master +Changes to be committed: +(use "git reset HEAD ..." to unstage) +new file: foo +``` + +加入文件到提交任务中并不是“准备录音”。这仅仅是将该文件置于准备录音的状态。在你添加文件后,你仍然可以修改该文件;它只是被标记为**已跟踪**和**处于暂存区**,所以在它被写到“磁带”前你可以将它撤出或修改它(当然你也可以再次将它加入来做些修改)。但是请注意:你还没有在磁带中记录该文件,所以如果弄坏了一个之前还是好的文件,你是没有办法恢复的,因为你没有在“磁带”中记下那个文件还是好着的时刻。 + +如果你最后决定不把文件记录到 Git 历史列表中,那么你可以撤销提交任务,在 Git 中是这样做的: + +``` +$ git reset HEAD foo +``` + +这实际上就是解除了录音机的准备录音状态,你只是在录音棚中转了一圈而已。 + +### 大型提交 + +有时候,你想要提交一些内容到仓库;我们以录音机类比,这就好比按下录音键然后记录到磁带中一样。 + +在一个项目所经历的不同阶段中,你会按下这个“记录键”无数次。比如,如果你尝试了一个新的 Python 工具包并且最终实现了窗口呈现功能,然后你肯定要进行提交,以便你在实验新的显示选项时搞砸了可以回退到这个阶段。但是如果你在 Inkscape 中画了一些图形草样,在提交前你可能需要等到已经有了一些要开发的内容。尽管你可能提交了很多次,但是 Git 并不会浪费很多,也不会占用太多磁盘空间,所以在我看来,提交的越多越好。 + +`commit` 命令会“记录”仓库中所有的暂存区文件。Git 只“记录”已跟踪的文件,即,在过去某个时间点你使用 `git add` 命令加入到暂存区的所有文件,以及从上次提交后被改动的文件。如果之前没有过提交,那么所有跟踪的文件都包含在这次提交中,以 Git 的角度来看,这是一次非常重要的修改,因为它们从没放到仓库中变成了放进去。 + +完成一次提交需要运行下面的命令: + +``` +$ git commit -m 'My great project, first commit.' +``` + +这就保存了所有提交的文件,之后可以用于其它操作(或者,用英国电视剧《神秘博士》中时间领主所讲的 Gallifreyan 语说,它们成为了“固定的时间点” )。这不仅是一个提交事件,也是一个你在 Git 日志中找到该提交的引用指针: + +``` +$ git log --oneline +55df4c2 My great project, first commit. +``` + +如果想浏览更多信息,只需要使用不带 `--oneline` 选项的 `git log` 命令。 + +在这个例子中提交时的引用号码是 55df4c2。它被叫做“提交哈希(commit hash)”(LCTT 译注:这是一个 SHA-1 算法生成的哈希码,用于表示一个 git 提交对象),它代表着刚才你的提交所包含的所有新改动,覆盖到了先前的记录上。如果你想要“倒回”到你的提交历史点上,就可以用这个哈希作为依据。 + +你可以把这个哈希想象成一个声音磁带上的 [SMPTE 时间码][3],或者再形象一点,这就是好比一个黑胶唱片上两首不同的歌之间的空隙,或是一个 CD 上的音轨编号。 + +当你改动了文件之后并且把它们加入到提交任务中,最终完成提交,这就会生成新的提交哈希,它们每一个所标示的历史点都代表着你的产品不同的版本。 + +这就是 Charlie Brown 这样的音乐家们为什么用 Git 作为版本控制系统的原因。 + +在接下来的文章中,我们将会讨论关于 Git HEAD 的各个方面,我们会真正地向你揭示时间旅行的秘密。不用担心,你只需要继续读下去就行了(或许你已经在读了?)。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/16/7/creating-your-first-git-repository + +作者:[Seth Kenlon][a] +译者:[vim-kakali](https://github.com/vim-kakali) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[1]: https://github.com/settings/keys +[2]: https://gitlab.com/profile/keys +[3]: http://slackermedia.ml/handbook/doku.php?id=timecode +[4]: https://linux.cn/article-7641-1.html diff --git a/translated/tech/20160718 Creating your first Git repository.md b/translated/tech/20160718 Creating your first Git repository.md deleted file mode 100644 index 722fe2ea56..0000000000 --- a/translated/tech/20160718 Creating your first Git repository.md +++ /dev/null @@ -1,199 +0,0 @@ - - -建立你的第一个仓库 -====================================== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/open_abstract_pieces.jpg?itok=ZRt0Db00) - - -现在是时候学习怎样创建你自己的仓库了,还有怎样增加文件和完成提交。 - -在本系列前面文章的安装过程中,你已经学习了作为一个目标用户怎样与 Git 进行交互;你就像一个漫无目的的流浪者一样偶然发现了一个开源项目网站,然后克隆了仓库,Git 走进了你的生活。学习怎样和 Git 进行交互并不像你想的那样困难,或许你并不确信现在是否应该使用 Git 完成你的工作。 - - -Git 被认为是选择大多软件项目的工具,它不仅能够完成大多软件项目的工作;它也能管理你杂乱项目的列表(如果他们不重要,也可以这样说!),你的配置文件,一个日记,项目进展日志,甚至源代码! - -使用 Git 是很有必要的,毕竟,你肯定有因为一个备份文件不能够辨认出版本信息而烦恼的时候。 - -你不使用 Git,它也就不会为你工作,或者也可以把 Git 理解为“没有任何推送就像源头指针一样”【译注: HEAD 可以理解为“头指针”,是当前工作区的“基础版本”,当执行提交时, HEAD 指向的提交将作为新提交的父提交。】。我保证,你很快就会对 Git 有所了解 。 - - -### 类比于录音 - - -我们更喜欢谈论快照上的图像,因为很多人都可以通过一个相册很快辨认出每个照片上特有的信息。这可能很有用,然而,我认为 Git 更像是在进行声音的记录。 - -传统的录音机,可能你对于它的部件不是很清楚:它包含转轴并且正转或反转,使用磁带保存声音波形,通过放音头记录声音并保存到磁带上然后播放给收听者。 - - -除了往前退磁带,你也可以把磁带多绕几圈到磁带前面的部分,或快进跳过前面的部分到最后。 - -想象一下 70 年代的磁带录制的声音。你可能想到那会正在反复练习一首歌直到非常完美,它们最终被记录下来了。起初,你记录了鼓声,低音,然后是吉他声,还有其他的声音。每次你录音,工作人员都会把磁带重绕并设置为环绕模式,这样在你演唱的时候录音磁带就会播放之前录制的声音。如果你是低音歌唱,你唱歌的时候就需要把有鼓声的部分作为背景音乐,然后就是吉他声、鼓声、低音(和牛铃声【译注:一种打击乐器,状如四棱锥。】)等等。在每一环,你完成了整个部分,到了下一环,工作人员就开始在磁带上制作你的演唱作品。 - - -你也可以拷贝或换出整个磁带,这是你需要继续录音并且进行多次混合的时候需要做的。 - - -现在我希望对于上述 70 年代的录音工作的描述足够生动,我们就可以把 Git 的工作想象成一个录音磁带了。 - - -### 新建一个 Git 仓库 - - -首先得为我们的虚拟的录音机买一些磁带。在 Git 术语中,这就是仓库;它是完成所有工作的基础,也就是说这里是存放 Git 文件的地方(即 Git 工作区)。 - -任何目录都可以是一个 Git 仓库,但是在开始的时候需要进行一次更新。需要下面三个命令: - - -- 创建目录(如果你喜欢的话,你可以在你的 GUI 文件管理器里面完成。) -- 在终端里查看目录。 -- 初始化这个目录使它可以被 Git管理。 - - -特别是运行如下代码: - -``` -$ mkdir ~/jupiter # 创建目录 -$ cd ~/jupiter # 进入目录 -$ git init . # 初始化你的新 Git 工作区 -``` - - -在这个例子中,文件夹 jupiter 是空的但却成为了你的 Git 仓库。 - -有了仓库接下来的事件就按部就班了。你可以克隆项目仓库,你可以在一个历史点前后来回穿梭(前提是你有一个历史点),创建可交替时间线,然后剩下的工作 Git 就都能正常完成了。 - - -在 Git 仓库里面工作和在任何目录里面工作都是一样的;在仓库中新建文件,复制文件,保存文件。你可以像平常一样完成工作;Git 并不复杂,除非你把它想复杂了。 - -在本地的 Git 仓库中,一个文件可以有下面这三种状态: -- 未跟踪文件:你在仓库里新建了一个文件,但是你没有把文件加入到 Git 的提交任务(提交暂存区,stage)中。 -- 已跟踪文件:已经加入到 Git 暂存区的文件。 -- 暂存区文件:存在于暂存区的文件已经加入到 Git 的提交队列中。 - - -任何你新加入到 Git 仓库中的文件都是未跟踪文件。文件还保存在你的电脑硬盘上,但是你没有告诉 Git 这是需要提交的文件,就像我们的录音机,如果你没有打开录音机;乐队开始演唱了,但是录音机并没有准备录音。 - -不用担心,Git 会告诉你存在的问题并提示你怎么解决: -``` -$ echo "hello world" > foo -$ git status -位于您当前工作的分支 master 上 -未跟踪文件: -(使用 "git add " 更新要提交的内容) - foo -没有任何提交任务,但是存在未跟踪文件(用 "git add" 命令加入到提交任务) -``` - - -你看到了,Git 会提醒你怎样把文件加入到提交任务中。 - -### 不使用 Git 命令进行 Git 操作 - - -在 GitHub 或 GitLab(译注:GitLab 是一个用于仓库管理系统的开源项目。使用Git作为代码管理工具,并在此基础上搭建起来的web服务。)上创建一个仓库大多是使用鼠标点击完成的。这不会很难,你单击 New Repository 这个按钮就会很快创建一个仓库。 - -在仓库中新建一个 README 文件是一个好习惯,这样人们在浏览你的仓库的时候就可以知道你的仓库基于什么项目,更有用的是通过 README 文件可以确定克隆的是否为一个非空仓库。 - - -克隆仓库通常很简单,但是在 GitHub 上获取仓库改动权限就不简单了,为了进行用户验证你必须有一个 SSH 秘钥。如果你使用 Linux 系统,通过下面的命令可以生成一个秘钥: -``` -$ ssh-keygen -``` - - -复制纯文本文件里的秘钥。你可以使用一个文本编辑器打开它,也可以使用 cat 命令: - -``` -$ cat ~/.ssh/id_rsa.pub -``` - - -现在把你的秘钥拷贝到 [GitHub SSH 配置文件][1] 中,或者 [GitLab 配置文件[2]。 - -如果你通过使用 SSH 模式克隆了你的项目,就可以在你的仓库开始工作了。 - -另外,如果你的系统上没有安装 Git 的话也可以使用 GitHub 的文件上传接口来克隆仓库。 - -![](https://opensource.com/sites/default/files/2_githubupload.jpg) - - -### 跟踪文件 - -命令 git status 的输出会告诉你如果你想让 git 跟踪一个文件,你必须使用命令 git add 把它加入到提交任务中。这个命令把文件存在了暂存区,暂存区存放的都是等待提交的文件,或者把仓库保存为一个快照。git add 命令的最主要目的是为了区分你已经保存在仓库快照里的文件,还有新建的或你想提交的临时文件,至少现在,你都不用为它们之间的不同之处而费神了。 - -类比大型录音机,这个动作就像打开录音机开始准备录音一样。你可以按已经录音的录音机上的 pause 按钮来完成推送,或者按下重置按钮等待开始跟踪下一个文件。 - -如果你把文件加入到提交任务中,Git 会自动标识为跟踪文件: - -``` -$ git add foo -$ git status -位于您当前工作的分支 master 上 -下列修改将被提交: -(使用 "git reset HEAD ..." 将下列改动撤出提交任务) -新增文件:foo -``` - - -加入文件到提交任务中并不会生成一个记录。这仅仅是为了之后方便记录而把文件存放到暂存区。在你把文件加入到提交任务后仍然可以修改文件;文件会被标记为跟踪文件并且存放到暂存区,所以你在最终提交之前都可以改动文件或撤出提交任务(但是请注意:你并没有记录文件,所以如果你完全改变了文件就没有办法撤销了,因为你没有记住最终修改的准确时间。)。 - -如果你决定不把文件记录到 Git 历史列表中,那么你可以撤出提交任务,在 Git 中是这样做的: -``` -$ git reset HEAD foo -``` - - -这实际上就是删除了录音机里面的录音,你只是在工作区转了一圈而已而已。 - -### 大型提交 - -有时候,你会需要完成很多提交;我们以录音机类比,这就好比按下录音键并最终按下保存键一样。 - -在一个项目从建立到完成,你会按记录键无数次。比如,如果你通过你的方式使用一个新的 Python 工具包并且最终实现了窗口展示,然后你就很肯定的提交了文件,但是不可避免的会发生一些错误,现在你却不能撤销你的提交操作了。 - -一次提交会记录仓库中所有的暂存区文件。Git 只记录加入到提交任务中的文件,也就是说在过去某个时刻你使用 git add 命令加入到暂存区的所有文件。还有从先前的提交开始被改动的文件。如果没有其他的提交,所有的跟踪文件都包含在这次提交中,因为在浏览 Git 历史点的时候,它们没有存在于仓库中。 - -完成一次提交需要运行下面的命令: -``` -$ git commit -m 'My great project, first commit.' -``` - -这就保存了所有需要在仓库中提交的文件(或者,如果你说到 Gallifreyan【译注:英国电视剧《神秘博士》里的时间领主使用的一种优雅的语言,】,它们可能就是“固定的时间点” )。你不仅能看到整个提交记录,还能通过 git log 命令查看修改日志找到提交时的版本号: -``` -$ git log --oneline -55df4c2 My great project, first commit. -``` - - -如果想浏览更多信息,只需要使用不带 --oneline 选项的 git log 命令。 - - -在这个例子中提交时的版本号是 55df4c2。它被叫做 commit hash(译注:一个SHA-1生成的哈希码,用于表示一个git commit对象。),它表示着刚才你的提交包含的所有改动,覆盖了先前的记录。如果你想要“倒回”到你的提交历史点上就可以用这个 commit hash 作为依据。 - -你可以把 commit hash 想象成一个声音磁带上的 [SMPTE timecode][3],或者再夸张一点,这就是好比一个黑胶唱片上两首不同的歌之间的不同点,或是一个 CD 上的轨段编号。 - - -你在很久前改动了文件并且把它们加入到提交任务中,最终完成提交,这就会生成新的 commit hashes,每个 commit hashes 标示的历史点都代表着你的产品不同的版本。 - - -这就是 Charlie Brown 把 Git 称为版本控制系统的原因。 - -在接下来的文章中,我们将会讨论你需要知道的关于 Git HEAD 的一切,我们不准备讨论关于 Git 的提交历史问题。基本不会提及,但是你可能会需要了解它(或许你已经有所了解?)。 - - - --------------------------------------------------------------------------------- - -via: https://opensource.com/life/16/7/creating-your-first-git-repository - -作者:[Seth Kenlon][a] -译者:[vim-kakali](https://github.com/vim-kakali) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[1]: https://github.com/settings/keys -[2]: https://gitlab.com/profile/keys -[3]: http://slackermedia.ml/handbook/doku.php?id=timecode From aca86e505b95b8aeb0de6968a7165478199206d9 Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 4 Aug 2016 21:13:55 +0800 Subject: [PATCH 1356/1469] =?UTF-8?q?20160804-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...How to Allow Awk to Use Shell Variables.md | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 sources/tech/awk/20160802 Part 11 - How to Allow Awk to Use Shell Variables.md diff --git a/sources/tech/awk/20160802 Part 11 - How to Allow Awk to Use Shell Variables.md b/sources/tech/awk/20160802 Part 11 - How to Allow Awk to Use Shell Variables.md new file mode 100644 index 0000000000..b407050da7 --- /dev/null +++ b/sources/tech/awk/20160802 Part 11 - How to Allow Awk to Use Shell Variables.md @@ -0,0 +1,95 @@ +How to Allow Awk to Use Shell Variables – Part 11 +================================================== + +When we write shell scripts, we normally include other smaller programs or commands such as Awk operations in our scripts. In the case of Awk, we have to find ways of passing some values from the shell to Awk operations. + +This can be done by using shell variables within Awk commands, and in this part of the series, we shall learn how to allow Awk to use shell variables that may contain values we want to pass to Awk commands. + +There possibly two ways you can enable Awk to use shell variables: + +### 1. Using Shell Quoting + +Let us take a look at an example to illustrate how you can actually use shell quoting to substitute the value of a shell variable in an Awk command. In this example, we want to search for a username in the file /etc/passwd, filter and print the user’s account information. + +Therefore, we can write a `test.sh` script with the following content: + +``` +#!/bin/bash + +#read user input +read -p "Please enter username:" username + +#search for username in /etc/passwd file and print details on the screen +cat /etc/passwd | awk "/$username/ "' { print $0 }' +``` + +Thereafter, save the file and exit. + +Interpretation of the Awk command in the test.sh script above: + +``` +cat /etc/passwd | awk "/$username/ "' { print $0 }' +``` + +`"/$username/ "` – shell quoting used to substitute value of shell variable username in Awk command. The value of username is the pattern to be searched in the file /etc/passwd. + +Note that the double quote is outside the Awk script, `‘{ print $0 }’`. + +Then make the script executable and run it as follows: + +``` +$ chmod +x test.sh +$ ./text.sh +``` + +After running the script, you will be prompted to enter a username, type a valid username and hit Enter. You will view the user’s account details from the /etc/passwd file as below: + +![](http://www.tecmint.com/wp-content/uploads/2016/08/Shell-Script-to-Find-Username-in-Passwd-File.png) +>Shell Script to Find Username in Password File + +### 2. Using Awk’s Variable Assignment + +This method is much simpler and better in comparison to method one above. Considering the example above, we can run a simple command to accomplish the job. Under this method, we use the -v option to assign a shell variable to a Awk variable. + +Firstly, create a shell variable, username and assign it the name that we want to search in the /etc/passswd file: + +``` +username="aaronkilik" +``` + +Then type the command below and hit Enter: + +``` +# cat /etc/passwd | awk -v name="$username" ' $0 ~ name {print $0}' +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/08/Find-Username-in-Password-File-Using-Awk.png) +>Find Username in Password File Using Awk + +Explanation of the above command: + +- `-v` – Awk option to declare a variable +- `username` – is the shell variable +- `name` – is the Awk variable +Let us take a careful look at `$0 ~ name` inside the Awk script, `' $0 ~ name {print $0}'`. Remember, when we covered Awk comparison operators in Part 4 of this series, one of the comparison operators was value ~ pattern, which means: true if value matches the pattern. + +The `output($0)` of cat command piped to Awk matches the pattern `(aaronkilik)` which is the name we are searching for in /etc/passwd, as a result, the comparison operation is true. The line containing the user’s account information is then printed on the screen. + +### Conclusion + +We have covered an important section of Awk features, that can help us use shell variables within Awk commands. Many times, you will write small Awk programs or commands within shell scripts and therefore, you need to have a clear understanding of how to use shell variables within Awk commands. + +In the next part of the Awk series, we shall dive into yet another critical section of Awk features, that is flow control statements. So stay tunned and let’s keep learning and sharing. + + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/use-shell-script-variable-in-awk/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tecmint+%28Tecmint%3A+Linux+Howto%27s+Guide%29 + +作者:[Aaron Kili][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/aaronkili/ From 8bc5f01bcc13547081445b448858d1a81351c6b5 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 5 Aug 2016 09:16:12 +0800 Subject: [PATCH 1357/1469] PUB:Part 8 - Learn How to Use Awk Variables, Numeric Expressions and Assignment Operators @vim-kakali --- ...ic Expressions and Assignment Operators.md | 121 ++++++++---------- 1 file changed, 55 insertions(+), 66 deletions(-) rename translated/tech/awk/20160714 Part 8 - Learn How to Use Awk Variables, Numeric Expressions and Assignment Operators.md => published/awk/Part 8 - Learn How to Use Awk Variables, Numeric Expressions and Assignment Operators.md (59%) diff --git a/translated/tech/awk/20160714 Part 8 - Learn How to Use Awk Variables, Numeric Expressions and Assignment Operators.md b/published/awk/Part 8 - Learn How to Use Awk Variables, Numeric Expressions and Assignment Operators.md similarity index 59% rename from translated/tech/awk/20160714 Part 8 - Learn How to Use Awk Variables, Numeric Expressions and Assignment Operators.md rename to published/awk/Part 8 - Learn How to Use Awk Variables, Numeric Expressions and Assignment Operators.md index a5eb6b6df4..1f44f3c37a 100644 --- a/translated/tech/awk/20160714 Part 8 - Learn How to Use Awk Variables, Numeric Expressions and Assignment Operators.md +++ b/published/awk/Part 8 - Learn How to Use Awk Variables, Numeric Expressions and Assignment Operators.md @@ -1,27 +1,24 @@ - - -第 8 节--学习怎样使用 Awk 变量,数值表达式以及赋值运算符 - +awk 系列:怎样使用 awk 变量、数值表达式以及赋值运算符 ======================================================================================= +我觉得 [awk 系列][1] 将会越来越好,在本系列的前七节我们讨论了在 Linux 中处理文件和筛选字符串所需要的一些 awk 命令基础。 -我相信 [Awk 命令系列][1] 将会令人兴奋不已,在系列的前几节我们讨论了在 Linux 中处理文件和筛选字符串需要的基本 Awk 命令。 +在这一部分,我们将会进入 awk 更高级的部分,使用 awk 处理更复杂的文本和进行字符串过滤操作。因此,我们将会讲到 Awk 的一些特性,诸如变量、数值表达式和赋值运算符。 - -在这一部分,我们会对处理更复杂的文件和筛选字符串操作需要的更高级的命令进行讨论。因此,我们将会看到关于 Awk 的一些特性诸如变量,数值表达式和赋值运算符。 ![](http://www.tecmint.com/wp-content/uploads/2016/07/Learn-Awk-Variables-Numeric-Expressions-Assignment-Operators.png) ->学习 Awk 变量,数值表达式和赋值运算符 -你可能已经在很多编程语言中接触过它们,比如 shell,C,Python等;这些概念在理解上和这些语言没有什么不同,所以在这一小节中你不用担心很难理解,我们将会简短的提及常用的一些 Awk 特性。 +*学习 Awk 变量,数值表达式和赋值运算符* + +你可能已经在很多编程语言中接触过它们,比如 shell,C,Python 等;这些概念在理解上和这些语言没有什么不同,所以在这一小节中你不用担心很难理解,我们将会简短的提及常用的一些 awk 特性。 + +这一小节可能是 awk 命令里最容易理解的部分,所以放松点,我们开始吧。 -这一小节可能是 Awk 命令里最容易理解的部分,所以放松点,我们开始吧。 ### 1. Awk 变量 - -在任何编程语言中,当你在程序中新建一个变量的时候这个变量就是一个存储了值的占位符,程序一运行就占用了一些内存空间,你为变量赋的值会存储在这些内存空间上。 - +在很多编程语言中,变量就是一个存储了值的占位符,当你在程序中新建一个变量的时候,程序一运行就会在内存中创建一些空间,你为变量赋的值会存储在这些内存空间上。 你可以像下面这样定义 shell 变量一样定义 Awk 变量: + ``` variable_name=value ``` @@ -32,56 +29,59 @@ variable_name=value - `value`: 为变量赋的值 再看下面的一些例子: + ``` computer_name=”tecmint.com” port_no=”22” email=”admin@tecmint.com” -server=”computer_name” +server=computer_name ``` 观察上面的简单的例子,在定义第一个变量的时候,值 'tecmint.com' 被赋给了 'computer_name' 变量。 +此外,值 22 也被赋给了 port\_no 变量,把一个变量的值赋给另一个变量也是可以的,在最后的例子中我们把变量 computer\_name 的值赋给了变量 server。 -此外,值 22 也被赋给了 port_no 变量,把一个变量的值赋给另一个变量也是可以的,在最后的例子中我们把变量 computer_name 的值赋给了变量 server。 - -你可以看看 [本系列的第 2 节][2] 中提到的字段编辑,我们讨论了 Awk 怎样将输入的行分隔为若干字段并且使用标准的字段进行输入操作 ,$ 访问不同的被分配的字段。我们也可以像下面这样使用变量为字段赋值。 +你可以看看[本系列的第 2 节][2]中提到的字段编辑,我们讨论了 awk 怎样将输入的行分隔为若干字段并且使用标准字段访问操作符 `$` 来访问拆分出来的不同字段。我们也可以像下面这样使用变量为字段赋值。 ``` first_name=$2 second_name=$3 ``` -在上面的例子中,变量 first_name 的值设置为第二个字段,second_name 的值设置为第三个字段。 +在上面的例子中,变量 first\_name 的值设置为第二个字段,second\_name 的值设置为第三个字段。 +再举个例子,有一个名为 names.txt 的文件,这个文件包含了一个应用程序的用户列表,这个用户列表包含了用户的名和姓以及性别。可以使用 [cat 命令][3] 查看文件内容: -再举个例子,有一个名为 names.txt 的文件,这个文件包含了一个应用程序的用户列表,这个用户列表显示了用户的名字和曾用名以及性别。可以使用 [cat 命令][3] 查看文件内容: ``` $ cat names.txt ``` ![](http://www.tecmint.com/wp-content/uploads/2016/07/List-File-Content-Using-cat-Command.png) ->使用 cat 命令查看列表文件内容 +*使用 cat 命令查看列表文件内容* + +然后,我们也可以使用下面的 awk 命令把列表中第一个用户的第一个和第二个名字分别存储到变量 first\_name 和 second\_name 上: -然后,我们也可以使用下面的 Awk 命令把列表中第一个用户的第一个和第二个名字分别存储到变量 first_name 和 second_name 上: ``` $ awk '/Aaron/{ first_name=$2 ; second_name=$3 ; print first_name, second_name ; }' names.txt ``` ![](http://www.tecmint.com/wp-content/uploads/2016/07/Store-Variables-Using-Awk-Command.png) ->使用 Awk 命令为变量赋值 +*使用 Awk 命令为变量赋值* 再看一个例子,当你在终端运行 'uname -a' 时,它可以打印出所有的系统信息。 -第二个字段包含了你的 'hostname',因此,我们可以像下面这样把它赋给一个叫做 hostname 的变量并且用 Awk 打印出来。 +第二个字段包含了你的主机名,因此,我们可以像下面这样把它赋给一个叫做 hostname 的变量并且用 awk 打印出来。 + ``` $ uname -a $ uname -a | awk '{hostname=$2 ; print hostname ; }' ``` ![](http://www.tecmint.com/wp-content/uploads/2016/07/Store-Command-Output-to-Variable-Using-Awk.png) ->使用 Awk 把命令的输出赋给变量 + +*使用 Awk 把命令的输出赋给变量* ### 2. 数值表达式 @@ -94,8 +94,8 @@ $ uname -a | awk '{hostname=$2 ; print hostname ; }' - `%` : 取模运算符 - `^` : 指数运算符 - 数值表达式的语法是: + ``` $ operand1 operator operand2 ``` @@ -103,6 +103,7 @@ $ operand1 operator operand2 上面的 operand1 和 operand2 可以是数值和变量,运算符可以是上面列出的任意一种。 下面是一些展示怎样使用数值表达式的例子: + ``` counter=0 num1=5 @@ -112,7 +113,8 @@ counter=counter+1 ``` -理解了 Awk 中数值表达式的用法,我们就可以看下面的例子了,文件 domians.txt 里包括了所有属于 Tecmint 的域名。 +要理解 Awk 中数值表达式的用法,我们可以看看下面的例子,文件 domians.txt 里包括了所有属于 Tecmint 的域名。 + ``` news.tecmint.com tecmint.com @@ -130,16 +132,19 @@ windows.tecmint.com tecmint.com ``` -可以使用下面的命令查看文件的内容; +可以使用下面的命令查看文件的内容: + ``` $ cat domains.txt ``` ![](http://www.tecmint.com/wp-content/uploads/2016/07/View-Contents-of-File.png) ->查看文件内容 + +*查看文件内容* 如果想要计算出域名 tecmint.com 在文件中出现的次数,我们就可以通过写一个简单的脚本实现这个功能: + ``` #!/bin/bash for file in $@; do @@ -158,7 +163,8 @@ exit 0 ``` ![](http://www.tecmint.com/wp-content/uploads/2016/07/Shell-Script-to-Count-a-String-in-File.png) ->计算一个字符串或文本在文件中出现次数的 shell 脚本 + +*计算一个字符串或文本在文件中出现次数的 shell 脚本* 写完脚本后保存并赋予执行权限,当我们使用文件运行脚本的时候,文件 domains.txt 作为脚本的输入,我们会得到下面的输出: @@ -168,23 +174,24 @@ $ ./script.sh ~/domains.txt ``` ![](http://www.tecmint.com/wp-content/uploads/2016/07/Script-To-Count-String.png) ->计算字符串或文本出现次数的脚本 +*计算字符串或文本出现次数的脚本* 从脚本执行后的输出中,可以看到在文件 domains.txt 中包含域名 tecmint.com 的地方有 6 行,你可以自己计算进行验证。 ### 3. 赋值操作符 -我们要说的最后的 Awk 特性是赋值运算符,下面列出的只是 Awk 中的部分赋值运算符: +我们要说的最后的 Awk 特性是赋值操作符,下面列出的只是 awk 中的部分赋值运算符: -- `*=` : 乘法赋值运算符 -- `+=` : 加法赋值运算符 -- `/=` : 除法赋值运算符 -- `-=` : 减法赋值运算符 -- `%=` : 取模赋值运算符 -- `^=` : 指数赋值运算符 +- `*=` : 乘法赋值操作符 +- `+=` : 加法赋值操作符 +- `/=` : 除法赋值操作符 +- `-=` : 减法赋值操作符 +- `%=` : 取模赋值操作符 +- `^=` : 指数赋值操作符 下面是 Awk 中最简单的一个赋值操作的语法: + ``` $ variable_name=variable_name operator operand ``` @@ -199,8 +206,8 @@ num=20 num=num-1 ``` +你可以使用在 awk 中使用上面的赋值操作符使命令更简短,从先前的例子中,我们可以使用下面这种格式进行赋值操作: -你可以使用在 Awk 中使用上面的赋值操作符使命令更简短,从先前的例子中,我们可以使用下面这种格式进行赋值操作: ``` variable_name operator=operand counter=0 @@ -209,8 +216,8 @@ num=20 num-=1 ``` +因此,我们可以在 shell 脚本中改变 awk 命令,使用上面提到的 += 操作符: -因此,我们可以在 shell 脚本中改变 Awk 命令,使用上面提到的 += 操作符: ``` #!/bin/bash for file in $@; do @@ -230,14 +237,15 @@ exit 0 ![](http://www.tecmint.com/wp-content/uploads/2016/07/Alter-Shell-Script.png) ->改变了的 shell 脚本 + +*修改了的 shell 脚本* -在 [Awk 系列][4] 的这一部分,我们讨论了一些有用的 Awk 特性,有变量,使用数值表达式和赋值运算符,还有一些使用他们的实例。 +在 [awk 系列][4] 的这一部分,我们讨论了一些有用的 awk 特性,有变量,使用数值表达式和赋值运算符,还有一些使用它们的实例。 -这些概念和其他的编程语言没有任何不同,但是可能在 Awk 中有一些意义上的区别。 +这些概念和其他的编程语言没有任何不同,但是可能在 awk 中有一些意义上的区别。 -在本系列的第 9 节,我们会学习更多的 Awk 特性,比如特殊格式: BEGIN 和 END。这也会与 Tecmit 有联系。 +在本系列的第 9 节,我们会学习更多的 awk 特性,比如特殊格式: BEGIN 和 END。请继续关注。 -------------------------------------------------------------------------------- @@ -245,31 +253,12 @@ via: http://www.tecmint.com/learn-awk-variables-numeric-expressions-and-assignme 作者:[Aaron Kili][a] 译者:[vim-kakali](https://github.com/vim-kakali) -校对:[校对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/aaronkili/ - - - - - - - - - - - - - - - - - - - -[1]: http://www.tecmint.com/category/awk-command/ -[2]: http://www.tecmint.com/awk-print-fields-columns-with-space-separator/ +[1]: https://linux.cn/article-7586-1.html +[2]: https://linux.cn/article-7587-1.html [3]: http://www.tecmint.com/13-basic-cat-command-examples-in-linux/ -[4]: http://www.tecmint.com/category/awk-command/ +[4]: https://linux.cn/article-7586-1.html From f183752cc349b4d421ae1fde90fca2f0c661c752 Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 5 Aug 2016 09:50:32 +0800 Subject: [PATCH 1358/1469] =?UTF-8?q?20160805-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/talk/20160803 The revenge of Linux.md | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 sources/talk/20160803 The revenge of Linux.md diff --git a/sources/talk/20160803 The revenge of Linux.md b/sources/talk/20160803 The revenge of Linux.md new file mode 100644 index 0000000000..57a1ebe27c --- /dev/null +++ b/sources/talk/20160803 The revenge of Linux.md @@ -0,0 +1,36 @@ +The revenge of Linux +======================== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/penguin%20swimming.jpg?itok=mfhEdRdM) + +In the beginning of Linux they laughed at it and didn't think it could do anything. Now Linux is everywhere! + +I was a junior at college studying Computer Engineering in Brazil, and working at the same time in a global auditing and consulting company as a sysadmin. The company decided to implement some enterprise resource planning (ERP) software with an Oracle database. I got training in Digital UNIX OS (DEC Alpha), and it blew my mind. + +The UNIX system was very powerful and gave us absolute control of the machine: storage systems, networking, applications, and everything. + +I started writing lots of scripts in ksh and Bash to automate backup, file transfer, extract, transform, load (ETL) operations, automate DBA routines, and created many other services that came up from different projects. Moreover, doing database and operating system tuning gave me a good understanding of how to get the best from a server. At that time, I used Windows 95 on my PC, and I would have loved to have Digital UNIX in my PC box, or even Solaris or HP-UX, but those UNIX systems were made to run on specific hardware. I read all the documentation that came with the systems, looked for additional books to get more information, and tested crazy ideas in our development environment. + +Later in college, I heard about Linux from my colleagues. I downloaded it back in the time of dialup internet, and I was very excited. The idea of having my standard PC with a UNIX-like system was amazing! + +As Linux is made to run in any general PC hardware, unlike UNIX systems, at the beginning it was really hard to get it working. Linux was just for sysadmins and geeks. I even made adjustments in drivers using C language to get it running. My previous experience with UNIX made me feel at home when I was compiling the Linux kernel, troubleshooting, and so on. It was very challenging for Linux to work with any unexpected hardware setups, as opposed to closed systems that fit just some specific hardware. + +I have been seeing Linux get space in data centers. Some adventurous sysadmins start boxes to help in everyday tasks for monitoring and managing the infrastructure, and then Linux gets more space as DNS and DHCP servers, printer management, and file servers. There used to be lots of FUD (fear, uncertainty and doubt) and criticism about Linux for the enterprise: Who is the owner of it? Who supports it? Are there applications for it? + +But nowadays it seems the revenge of Linux is everywhere! From developer's PCs to huge enterprise servers; we can find it in smart phones, watches, and in the Internet of Things (IoT) devices such as Raspberry Pi. Even Mac OS X has a kind of prompt with commands we are used to. Microsoft is making its own distribution, runs it at Azure, and then... Windows 10 is going to get Bash on it. + +The interesting thing is that the IT market creates and quickly replaces new technologies, but the knowledge we got with old systems such as Digital UNIX, HP-UX, and Solaris is still useful and relevant with Linux, for business and just for fun. Now we can get absolute control of our systems, and use it at its maximum capabilities. Moreover Linux has an enthusiastic community! + +I really recommend that youngsters looking for a career in computing learn Linux. It does not matter what your branch in IT is. If you learn deeply how a standard home PC works, you can get in front of any big box talking basically the same language. With Linux you learn fundamental computing, and build skills that work anywhere in IT. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/16/8/revenge-linux + +作者:[Daniel Carvalho][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/danielscarvalho From 90d137399556eedc51bf3b3ce3c975269e8ab145 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 5 Aug 2016 14:53:20 +0800 Subject: [PATCH 1359/1469] PUB:20160316 Growing a career alongside Linux @chenxinlong --- ...160316 Growing a career alongside Linux.md | 49 +++++++++++++++++++ ...160316 Growing a career alongside Linux.md | 49 ------------------- 2 files changed, 49 insertions(+), 49 deletions(-) create mode 100644 published/20160316 Growing a career alongside Linux.md delete mode 100644 translated/talk/my-open-source-story/20160316 Growing a career alongside Linux.md diff --git a/published/20160316 Growing a career alongside Linux.md b/published/20160316 Growing a career alongside Linux.md new file mode 100644 index 0000000000..d536dea1bb --- /dev/null +++ b/published/20160316 Growing a career alongside Linux.md @@ -0,0 +1,49 @@ +伴随 Linux 成长的职业生涯 +================================== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/OPENHERE_blue.png?itok=3eqp-7gT) + +我与 Linux 的故事开始于 1998 年,一直延续到今天。 当时我在 Gap 公司工作,管理着成千台运行着 [OS/2][1] 系统的台式机 ( 在随后的几年里变成了 [Warp 3.0][2])。 作为一个 OS/2 的粉丝,那时我非常喜欢那个时候。 随着这些台式机的嗡鸣,我们使用 Gap 开发的工具轻而易举地就能支撑起对成千的用户的服务支持。 然而,一切都将改变了。 + +在 1998 年的 11 月, 我收到邀请加入一个新成立的公司,这家公司将专注于企业级 Linux 上。 这就是后来非常出名的 [Linuxcare][2]。 + +### 我在 Linuxcare 的时光 + +我曾经接触过一些 Linux , 但我从未想过要把它提供给企业客户。仅仅几个月后 ( 从这里开始成为了空间和时间上的转折点 ), 我就在管理一整条线的业务,让企业获得他们的软件,硬件,甚至是证书认证等各种在当时非常盛行的 Linux 服务。 + +我支持的客户包括像 IBM ,Dell ,HP 这样的厂商以确保他们的硬件能够成功的运行 Linux 。 今天你们应该都听过许多关于在硬件上预装 Linux 的事, 但当时 Dell 邀请我去讨论为即将到来的贸易展上将 Linux 运行在认证的笔记本电脑上。 这是多么激动人心的时刻 !同时我们在之后几年内也支持了 IBM 和 HP 等多项认证工作。 + +Linux 变化得非常快,并且它总是这样。 它也获得了更多的关键设备的支持,比如声音,网络和图形。在这段时间, 我把个人使用的系统从基于 RPM 的系统换成了 [Debian][3] 。 + +### 使用 Linux 的这些年 + +几年前我在一些做 Linux 硬件设备、Linux 定制软件以及 Linux 数据中心的公司工作。而在二十世纪中期的时候,那时我正在忙为那些在雷蒙德附近(微软公司所在地)的大一些的软件公司做咨询工作,为他们对比 Linux 解决方案及其自己的解决方案做分析和验证。 我个人使用的系统一直没有改变,我仍会在尽可能的情况下运行 Debian 测试系统。 + +我真的非常欣赏发行版的灵活性和永久更新状态。 Debian 是我所使用过的最有趣且拥有良好支持的发行版,并且它拥有最好的社区,而我是社区的一份子。 + +当我回首我使用 Linux 的这几年,我仍记得大约在二十世纪前期和中期的时候在圣何塞,旧金山,波士顿和纽约召开的那些 Linux Expo 大会。在 Linuxcare 时我们总是会摆一些有趣而且时髦的展位,在那边逛的时候总会碰到一些老朋友。这一切工作都是需要付出代价的,所有的这一切都是在努力地强调使用 Linux 的乐趣。 + +随着虚拟化和云的崛起也让 Linux 变得更加有趣。 当我在 Linuxcare 的时候, 我们常和斯坦福大学附近的帕洛阿尔托的一个约 30 人左右的小公司在一块。我们会开车到他们的办公处,然后帮他们准备和我们一起参加展览的东西。 谁会想得到这个小小的初创公司会成就后来的 VMware ? + +我还有许多的故事,能认识这些人并和他们一起工作我感到很幸运。 Linux 在各方面都不断发展且变得尤为重要。 并且甚至随着它重要性的提升,它使用起来仍然非常有趣。 我认为它的开放性和可定制能力给它带来了大量的新用户,这也是让我感到非常震惊的一点。 + +### 现在 + +在过去的五年里我的工作重心逐渐离开 Linux。 我所管理的大规模基础设施项目中包含着许多不同的操作系统 ( 包括非开源的和开源的 ), 但我的心一直以来都是和 Linux 在一起的。 + +在使用 Linux 过程中的乐趣和不断进步是在过去的 18 年里一直驱动我的动力。我从 Linux 2.0 内核开始看着它变成现在的这样。 Linux 是一个卓越的、生机勃勃的且非常酷的东西。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/16/3/my-linux-story-michael-perry + +作者:[Michael Perry][a] +译者:[chenxinlong](https://github.com/chenxinlong) +校对:[wxy](https://github.com/wxy) + +[a]: https://opensource.com/users/mpmilestogo +[1]: https://en.wikipedia.org/wiki/OS/2 +[2]: https://archive.org/details/IBMOS2Warp3Collection +[3]: https://en.wikipedia.org/wiki/Linuxcare +[4]: https://www.debian.org/ +[5]: diff --git a/translated/talk/my-open-source-story/20160316 Growing a career alongside Linux.md b/translated/talk/my-open-source-story/20160316 Growing a career alongside Linux.md deleted file mode 100644 index f7ddefb92c..0000000000 --- a/translated/talk/my-open-source-story/20160316 Growing a career alongside Linux.md +++ /dev/null @@ -1,49 +0,0 @@ -培养一个 Linux 职业生涯 -================================== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/OPENHERE_blue.png?itok=3eqp-7gT) - -我与 Linux 的故事开始于 1998 年,一直延续到今天。 当时我在 Gap 公司工作,管理着成千台运行着 [OS/2][1] 系统的台式机 ( 并且在随后的几年里是 [Warp 3.0][2])。 作为一个 OS/2 的使用者,那时我非常高兴。 随着这些台式机的嗡鸣,我们使用 Gap 开发的工具轻而易举地就能支撑起对成千的用户的服务支持。 然而,一切都将改变了。 - -在 1998 年的 11 月, 我收到邀请加入一个新成立的公司,这家公司将专注于 Linux 上。 这就是后来非常出名的 [Linuxcare][2]. - -### 我在 Linuxcare 的时光 - -我曾经有接触过一些 Linux , 但我从未想过要把它提供给企业客户。仅仅几个月后 ( 从这里开始成为了空间和时间上的转折点 ), 我就在管理一整条线的业务,让企业获得他们的软件,硬件,甚至是证书认证等不同风格且在当时非常盛行的的 Linux 服务。 - -我向我的客户提供像 IBM ,Dell ,HP 等产品以确保他们的硬件能够成功的运行 Linux 。 今天你们应该都听过许多关于在硬件上预载 Linux 的事, 但当时我被邀请到 Dell 去讨论有关于为即将到来的贸易展在笔记本电脑上运行 Linux 的相关事宜。 这是多么激动人心的时刻 !同时我们也在有效期的几年内支持 IBM 和 HP 等多项认证工作。 - -Linux 变化得非常快,并且它总是这样。 它也获得了更多的关键设备的支持,比如声音,网络和图形。在这段时间, 我把个人使用的系统从基于 RPM 的系统换成了 [Debian][3] 。 - -### 使用 Linux 的这些年 - -几年前我在一些以 Linux 为硬设备,客户软件以及数据中心的公司工作。而在二十世纪中期的时候,那时我正在忙着做咨询,而那些在 Redmond 的大型软件公司正围绕着 Linux 做一些分析和验证以和自己的解决方案做对比。 我个人使用的系统一直改变,我仍会在任何能做到的时候运行 Debian 测试系统。 - -我真的非常欣赏其发行版本的灵活性和永久更新状态。 Debian 是我所使用过的最有趣且拥有良好支持的发行版本且拥有最好的社区的版本之一。 - -当我回首我使用 Linux 的这几年,我仍记得大约在二十世纪前期和中期的时候在圣何塞,旧金山,波士顿和纽约的那些 Linux 的展览会。在 Linuxcare 时我们总是会做一些有趣而且时髦的展览位,在那边逛的时候总会碰到一些老朋友。这一切工作都是需要付出代价的,所有的这一切都是在努力地强调使用 Linux 的乐趣。 - -同时,虚拟化和云的崛起也让 Linux 变得更加有趣。 当我在 Linuxcare 的时候, 我们常和 Palo Alto 的一个约 30 人左右的小公司在一块。我们会开车到他们的办公处然后准备一个展览并且他们也会参与进来。 谁会想得到这个小小的开端会成就后来的 VMware ? - -我还有许多的故事,能认识这些人并和他们一起工作我感到很幸运。 Linux 在各方面都不断发展且变得尤为重要。 并且甚至随着它重要性的提升,它使用起来仍然非常有趣。 我认为它的开放性和可定制能力给它带来了大量的新用户,这也是让我感到非常震惊的一点。 - -### 现在 - -在过去的五年里我逐渐离开 Linux 的主流事物。 我所管理的大规模基础设施项目中包含着许多不同的操作系统 ( 包括非开源的和开源的 ), 但我的心一直以来都是和 Linux 在一起的。 - -在使用 Linux 过程中的乐趣和不断进步是在过去的 18 年里一直驱动我的动力。我从 Linux 2.0 内核开始看着它变成现在的这样。 Linux 是一个卓越,有机且非常酷的东西。 - --------------------------------------------------------------------------------- - -via: https://opensource.com/life/16/3/my-linux-story-michael-perry - -作者:[Michael Perry][a] -译者:[译者ID](https://github.com/chenxinlong) -校对:[校对者ID](https://github.com/校对者ID) - -[a]: https://opensource.com/users/mpmilestogo -[1]: https://en.wikipedia.org/wiki/OS/2 -[2]: https://archive.org/details/IBMOS2Warp3Collection -[3]: https://en.wikipedia.org/wiki/Linuxcare -[4]: https://www.debian.org/ -[5]: From bca82aabae1c3c0f718b3aa484356c4a3377bfaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=AE=B6=E5=90=AF?= Date: Fri, 5 Aug 2016 17:24:54 +0800 Subject: [PATCH 1360/1469] Translated by cposture (#4275) * 75 * Translated by cposture --- ...18 An Introduction to Mocking in Python.md | 114 +++++++++--------- 1 file changed, 56 insertions(+), 58 deletions(-) rename {sources => translated}/tech/20160618 An Introduction to Mocking in Python.md (53%) diff --git a/sources/tech/20160618 An Introduction to Mocking in Python.md b/translated/tech/20160618 An Introduction to Mocking in Python.md similarity index 53% rename from sources/tech/20160618 An Introduction to Mocking in Python.md rename to translated/tech/20160618 An Introduction to Mocking in Python.md index d28fae272d..b8daaed937 100644 --- a/sources/tech/20160618 An Introduction to Mocking in Python.md +++ b/translated/tech/20160618 An Introduction to Mocking in Python.md @@ -1,32 +1,34 @@ Mock 在 Python 中的使用介绍 ===================================== -http://www.oschina.net/translate/an-introduction-to-mocking-in-python?cmp + 本文讲述的是 Python 中 Mock 的使用 -**如何在避免测试你的耐心的情景下执行单元测试** +**如何在避免测试你的耐心的情况下执行单元测试** -通常,我们编写的软件会直接与我们称之为肮脏无比的服务交互。用外行人的话说:交互已设计好的服务对我们的应用程序很重要,但是这会带来我们不希望的副作用,也就是那些在我们自己测试的时候不希望的功能。例如:我们正在写一个社交 app,并且想要测试一下我们 "发布到 Facebook" 的新功能,但是不想每次运行测试集的时候真的发布到 Facebook。 +很多时候,我们编写的软件会直接与那些被标记为肮脏无比的服务交互。用外行人的话说:交互已设计好的服务对我们的应用程序很重要,但是这会给我们带来不希望的副作用,也就是那些在一个自动化测试运行的上下文中不希望的功能。 + +例如:我们正在写一个社交 app,并且想要测试一下 "发布到 Facebook" 的新功能,但是不想每次运行测试集的时候真的发布到 Facebook。 -Python 的单元测试库包含了一个名为 unittest.mock 或者可以称之为依赖的子包,简言之为 mock——其提供了极其强大和有用的方法,通过它们可以模拟和打桩我们不希望的副作用。 +Python 的 `unittest` 库包含了一个名为 `unittest.mock` 或者可以称之为依赖的子包,简称为 +`mock` —— 其提供了极其强大和有用的方法,通过它们可以模拟和打桩来去除我们不希望的副作用。 >Source | -注意:mock [最近收录][1]到了 Python 3.3 的标准库中;先前发布的版本必须通过 [PyPI][2] 下载 Mock 库。 +> 注意:`mock` [最近收录][1]到了 Python 3.3 的标准库中;先前发布的版本必须通过 [PyPI][2] 下载 Mock 库。 -### -### Fear System Calls +### 恐惧系统调用 -再举另一个例子,思考一个我们会在余文讨论的系统调用。不难发现,这些系统调用都是主要的模拟对象:无论你是正在写一个可以弹出 CD 驱动的脚本,还是一个用来删除 /tmp 下过期的缓存文件的 Web 服务,这些调用都是在你的单元测试上下文中不希望的副作用。 +再举另一个例子,思考一个我们会在余文讨论的系统调用。不难发现,这些系统调用都是主要的模拟对象:无论你是正在写一个可以弹出 CD 驱动的脚本,还是一个用来删除 /tmp 下过期的缓存文件的 Web 服务,或者一个绑定到 TCP 端口的 socket 服务器,这些调用都是在你的单元测试上下文中不希望的副作用。 > 作为一个开发者,你需要更关心你的库是否成功地调用了一个可以弹出 CD 的系统函数,而不是切身经历 CD 托盘每次在测试执行的时候都打开了。 作为一个开发者,你需要更关心你的库是否成功地调用了一个可以弹出 CD 的系统函数(使用了正确的参数等等),而不是切身经历 CD 托盘每次在测试执行的时候都打开了。(或者更糟糕的是,很多次,在一个单元测试运行期间多个测试都引用了弹出代码!) -同样,保持你的单元测试的效率和性能意味着需要让如此多的 "缓慢代码" 远离自动测试,比如文件系统和网络访问。 +同样,保持单元测试的效率和性能意味着需要让如此多的 "缓慢代码" 远离自动测试,比如文件系统和网络访问。 -对于我们首个例子,我们要从原始形式到使用 mock 地重构一个标准 Python 测试用例。我们会演示如何使用 mock 写一个测试用例使我们的测试更加智能、快速,并且能展示更多关于我们软件的工作原理。 +对于首个例子,我们要从原始形式到使用 `mock` 重构一个标准 Python 测试用例。我们会演示如何使用 mock 写一个测试用例,使我们的测试更加智能、快速,并展示更多关于我们软件的工作原理。 ### 一个简单的删除函数 @@ -42,9 +44,9 @@ def rm(filename): os.remove(filename) ``` -很明显,我们的 rm 方法此时无法提供比相关 os.remove 方法更多的功能,但我们的基础代码会逐步改善,允许我们在这里添加更多的功能。 +很明显,我们的 `rm` 方法此时无法提供比 `os.remove` 方法更多的相关功能,但我们可以在这里添加更多的功能,使我们的基础代码逐步改善。 -让我们写一个传统的测试用例,即,没有使用 mock: +让我们写一个传统的测试用例,即,没有使用 `mock`: ``` #!/usr/bin/env python @@ -71,7 +73,7 @@ class RmTestCase(unittest.TestCase): self.assertFalse(os.path.isfile(self.tmpfilepath), "Failed to remove the file.") ``` -我们的测试用例相当简单,但是当它每次运行的时候,它都会创建一个临时文件并且随后删除。此外,我们没有办法测试我们的 rm 方法是否正确地将我们的参数向下传递给 os.remove 调用。我们可以基于以上的测试认为它做到了,但还有很多需要改进的地方。 +我们的测试用例相当简单,但是在它每次运行的时候,它都会创建一个临时文件并且随后删除。此外,我们没有办法测试我们的 `rm` 方法是否正确地将我们的参数向下传递给 `os.remove` 调用。我们可以基于以上的测试认为它做到了,但还有很多需要改进的地方。 ### 使用 Mock 重构 @@ -95,29 +97,25 @@ class RmTestCase(unittest.TestCase): mock_os.remove.assert_called_with("any path") ``` -使用这些重构,我们从根本上改变了该测试用例的运行方式。现在,我们有一个可以用于验证其他功能的内部对象。 +使用这些重构,我们从根本上改变了测试用例的操作方式。现在,我们有一个可以用于验证其他功能的内部对象。 ### 潜在陷阱 -第一件需要注意的事情就是,我们使用了位于 mymodule.os 且用于模拟对象的 mock.patch 方法装饰器,并且将该 mock 注入到我们的测试用例方法。相比在 mymodule.os 引用它,那么只是模拟 os 本身,会不会更有意义呢? -One of the first things that should stick out is that we’re using the mock.patch method decorator to mock an object located at mymodule.os, and injecting that mock into our test case method. Wouldn’t it make more sense to just mock os itself, rather than the reference to it at mymodule.os? +第一件需要注意的事情就是,我们使用了 `mock.patch` 方法装饰器,用于模拟位于 `mymodule.os` 的对象,并且将 mock 注入到我们的测试用例方法。那么只是模拟 `os` 本身,而不是 `mymodule.os` 下 `os` 的引用(注意 `@mock.patch('mymodule.os')` 便是模拟 `mymodule.os` 下的 `os`,译者注),会不会更有意义呢? -当然,当涉及到导入和管理模块,Python 的用法非常灵活。在运行时,mymodule 模块拥有被导入到本模块局部作用域的 os。因此,如果我们模拟 os,我们是看不到模拟在 mymodule 模块中的作用的。 +当然,当涉及到导入和管理模块,Python 的用法非常灵活。在运行时,`mymodule` 模块拥有被导入到本模块局部作用域的 `os`。因此,如果我们模拟 `os`,我们是看不到 mock 在 `mymodule` 模块中的作用的。 这句话需要深刻地记住: > 模拟测试一个项目,只需要了解它用在哪里,而不是它从哪里来。 -> Mock an item where it is used, not where it came from. -如果你需要为 myproject.app.MyElaborateClass 模拟 tempfile 模块,你可能需要 -If you need to mock the tempfile module for myproject.app.MyElaborateClass, you probably need to apply the mock to myproject.app.tempfile, as each module keeps its own imports. +如果你需要为 `myproject.app.MyElaborateClass` 模拟 `tempfile` 模块,你可能需要将 mock 用于 `myproject.app.tempfile`,而其他模块保持自己的导入。 先将那个陷阱置身事外,让我们继续模拟。 -With that pitfall out of the way, let’s keep mocking. ### 向 ‘rm’ 中加入验证 -之前定义的 rm 方法相当的简单。在盲目地删除之前,我们倾向于拿它来验证一个路径是否存在,并验证其是否是一个文件。让我们重构 rm 使其变得更加智能: +之前定义的 rm 方法相当的简单。在盲目地删除之前,我们倾向于验证一个路径是否存在,并验证其是否是一个文件。让我们重构 rm 使其变得更加智能: ``` @@ -132,7 +130,7 @@ def rm(filename): os.remove(filename) ``` -很好。现在,让我们调整测试用例来保持测试的覆盖程度。 +很好。现在,让我们调整测试用例来保持测试的覆盖率。 ``` #!/usr/bin/env python @@ -168,9 +166,9 @@ class RmTestCase(unittest.TestCase): ### 将文件删除作为服务 -到目前为止,我们只是对函数功能提供模拟测试,并没对需要传递参数的对象和实例的方法进行模拟测试。接下来我们将介绍如何对对象的方法进行模拟测试。 +到目前为止,我们只是将 mock 应用在函数上,并没应用在需要传递参数的对象和实例的方法。我们现在开始涵盖对象的方法。 -首先,我们将rm方法重构成一个服务类。实际上将这样一个简单的函数转换成一个对象,在本质上,这不是一个合理的需求,但它能够帮助我们了解mock的关键概念。让我们开始重构: +首先,我们将 `rm` 方法重构成一个服务类。实际上将这样一个简单的函数转换成一个对象,在本质上这不是一个合理的需求,但它能够帮助我们了解 `mock` 的关键概念。让我们开始重构: ``` #!/usr/bin/env python @@ -187,8 +185,7 @@ class RemovalService(object): os.remove(filename) ``` -### 你会注意到我们的测试用例没有太大的变化 -### You’ll notice that not much has changed in our test case: +你会注意到我们的测试用例没有太大变化: ``` #!/usr/bin/env python @@ -223,8 +220,8 @@ class RemovalServiceTestCase(unittest.TestCase): mock_os.remove.assert_called_with("any path") ``` -很好,我们知道 RemovalService 会如期工作。接下来让我们创建另一个服务,将其声明为一个依赖 -Great, so we now know that the RemovalService works as planned. Let’s create another service which declares it as a dependency: +很好,我们知道 `RemovalService` 会如期工作。接下来让我们创建另一个服务,将 `RemovalService` 声明为它的一个依赖: +: ``` #!/usr/bin/env python @@ -250,18 +247,18 @@ class UploadService(object): self.removal_service.rm(filename) ``` -Since we already have test coverage on the RemovalService, we’re not going to validate internal functionality of the rm method in our tests of UploadService. Rather, we’ll simply test (without side-effects, of course) that UploadService calls the RemovalService.rm method, which we know “just works™” from our previous test case. +因为我们的测试覆盖了 `RemovalService`,因此我们不会对我们测试用例中 `UploadService` 的内部函数 `rm` 进行验证。相反,我们将调用 `UploadService` 的 `RemovalService.rm` 方法来进行简单测试(当然没有其他副作用),我们通过之前的测试用例便能知道它可以正确地工作。 -There are two ways to go about this: +这里有两种方法来实现测试: -1. Mock out the RemovalService.rm method itself. -2. Supply a mocked instance in the constructor of UploadService. +1. 模拟 RemovalService.rm 方法本身。 +2. 在 UploadService 的构造函数中提供一个模拟实例。 -As both methods are often important in unit-testing, we’ll review both. +因为这两种方法都是单元测试中非常重要的方法,所以我们将同时对这两种方法进行回顾。 -### Option 1: Mocking Instance Methods +### 方法 1:模拟实例的方法 -The mock library has a special method decorator for mocking object instance methods and properties, the @mock.patch.object decorator: +`mock` 库有一个特殊的方法装饰器,可以模拟对象实例的方法和属性,即 `@mock.patch.object decorator` 装饰器: ``` #!/usr/bin/env python @@ -314,31 +311,32 @@ class UploadServiceTestCase(unittest.TestCase): removal_service.rm.assert_called_with("my uploaded file") ``` -Great! We’ve validated that the UploadService successfully calls our instance’s rm method. Notice anything interesting in there? The patching mechanism actually replaced the rm method of all RemovalService instances in our test method. That means that we can actually inspect the instances themselves. If you want to see more, try dropping in a breakpoint in your mocking code to get a good feel for how the patching mechanism works. +非常棒!我们验证了 UploadService 成功调用了我们实例的 rm 方法。你是否注意到一些有趣的地方?这种修补机制(patching mechanism)实际上替换了我们测试用例中的所有 `RemovalService` 实例的 `rm` 方法。这意味着我们可以检查实例本身。如果你想要了解更多,可以试着在你模拟的代码下断点,以对这种修补机制的原理获得更好的认识。 -### Pitfall: Decorator Order +### 陷阱:装饰顺序 + +当我们在测试方法中使用多个装饰器,其顺序是很重要的,并且很容易混乱。基本上,当装饰器被映射到方法参数时,[装饰器的工作顺序是反向的][3]。思考这个例子: -When using multiple decorators on your test methods, order is important, and it’s kind of confusing. Basically, when mapping decorators to method parameters, [work backwards][3]. Consider this example: ``` -@mock.patch('mymodule.sys') + @mock.patch('mymodule.sys') @mock.patch('mymodule.os') @mock.patch('mymodule.os.path') def test_something(self, mock_os_path, mock_os, mock_sys): pass ``` -Notice how our parameters are matched to the reverse order of the decorators? That’s partly because of [the way that Python works][4]. With multiple method decorators, here’s the order of execution in pseudocode: +注意到我们的参数和装饰器的顺序是反向匹配了吗?这多多少少是由 [Python 的工作方式][4] 导致的。这里是使用多个装饰器的情况下它们执行顺序的伪代码: ``` patch_sys(patch_os(patch_os_path(test_something))) ``` -Since the patch to sys is the outermost patch, it will be executed last, making it the last parameter in the actual test method arguments. Take note of this well and use a debugger when running your tests to make sure that the right parameters are being injected in the right order. +因为 sys 补丁位于最外层,所以它最晚执行,使得它成为实际测试方法参数的最后一个参数。请特别注意这一点,并且在运行你的测试用例时,使用调试器来保证正确的参数以正确的顺序注入。 -### Option 2: Creating Mock Instances +### 方法 2:创建 Mock 实例 -Instead of mocking the specific instance method, we could instead just supply a mocked instance to UploadService with its constructor. I prefer option 1 above, as it’s a lot more precise, but there are many cases where option 2 might be efficient or necessary. Let’s refactor our test again: +我们可以使用构造函数为 UploadService 提供一个 Mock 实例,而不是模拟特定的实例方法。我更推荐方法 1,因为它更加精确,但在多数情况,方法 2 或许更加有效和必要。让我们再次重构测试用例: ``` #!/usr/bin/env python @@ -387,13 +385,13 @@ class UploadServiceTestCase(unittest.TestCase): mock_removal_service.rm.assert_called_with("my uploaded file") ``` -In this example, we haven’t even had to patch any functionality, we simply create an auto-spec for the RemovalService class, and then inject this instance into our UploadService to validate the functionality. +在这个例子中,我们甚至不需要补充任何功能,只需为 `RemovalService` 类创建一个 auto-spec,然后将实例注入到我们的 `UploadService` 以验证功能。 -The [mock.create_autospec][5] method creates a functionally equivalent instance to the provided class. What this means, practically speaking, is that when the returned instance is interacted with, it will raise exceptions if used in illegal ways. More specifically, if a method is called with the wrong number of arguments, an exception will be raised. This is extremely important as refactors happen. As a library changes, tests break and that is expected. Without using an auto-spec, our tests will still pass even though the underlying implementation is broken. +`mock.create_autospec` 方法为类提供了一个同等功能实例。实际上来说,这意味着在使用返回的实例进行交互的时候,如果使用了非法的方式将会引发异常。更具体地说,如果一个方法被调用时的参数数目不正确,将引发一个异常。这对于重构来说是非常重要。当一个库发生变化的时候,中断测试正是所期望的。如果不使用 auto-spec,尽管底层的实现已经被破坏,我们的测试仍然会通过。 -### Pitfall: The mock.Mock and mock.MagicMock Classes +### 陷阱:mock.Mock 和 mock.MagicMock 类 -The mock library also includes two important classes upon which most of the internal functionality is built upon: [mock.Mock][6] and mock.MagicMock. When given a choice to use a mock.Mock instance, a mock.MagicMock instance, or an auto-spec, always favor using an auto-spec, as it helps keep your tests sane for future changes. This is because mock.Mock and mock.MagicMock accept all method calls and property assignments regardless of the underlying API. Consider the following use case: +`mock` 库包含了两个重要的类 [mock.Mock](http://www.voidspace.org.uk/python/mock/mock.html) 和 [mock.MagicMock](http://www.voidspace.org.uk/python/mock/magicmock.html#magic-mock),大多数内部函数都是建立在这两个类之上的。当在选择使用 `mock.Mock` 实例,`mock.MagicMock` 实例或 auto-spec 的时候,通常倾向于选择使用 auto-spec,因为对于未来的变化,它更能保持测试的健全。这是因为 `mock.Mock` 和 `mock.MagicMock` 会无视底层的 API,接受所有的方法调用和属性赋值。比如下面这个用例: ``` class Target(object): @@ -404,7 +402,7 @@ def method(target, value): return target.apply(value) ``` -We can test this with a mock.Mock instance like this: +我们可以像下面这样使用 mock.Mock 实例进行测试: ``` class MethodTestCase(unittest.TestCase): @@ -417,7 +415,7 @@ class MethodTestCase(unittest.TestCase): target.apply.assert_called_with("value") ``` -This logic seems sane, but let’s modify the Target.apply method to take more parameters: +这个逻辑看似合理,但如果我们修改 `Target.apply` 方法接受更多参数: ``` class Target(object): @@ -428,11 +426,11 @@ class Target(object): return None ``` -Re-run your test, and you’ll find that it still passes. That’s because it isn’t built against your actual API. This is why you should always use the create_autospec method and the autospec parameter with the @patch and @patch.object decorators. +重新运行你的测试,你会发现它仍能通过。这是因为它不是针对你的 API 创建的。这就是为什么你总是应该使用 `create_autospec` 方法,并且在使用 `@patch`和 `@patch.object` 装饰方法时使用 `autospec` 参数。 -### Real-World Example: Mocking a Facebook API Call +### 现实例子:模拟 Facebook API 调用 -To finish up, let’s write a more applicable real-world example, one which we mentioned in the introduction: posting a message to Facebook. We’ll write a nice wrapper class and a corresponding test case. +为了完成,我们写一个更加适用的现实例子,一个在介绍中提及的功能:发布消息到 Facebook。我将写一个不错的包装类及其对应的测试用例。 ``` import facebook @@ -447,7 +445,7 @@ class SimpleFacebook(object): self.graph.put_object("me", "feed", message=message) ``` -Here’s our test case, which checks that we post the message without actually posting the message: +这是我们的测试用例,它可以检查我们发布的消息,而不是真正地发布消息: ``` import facebook @@ -466,18 +464,18 @@ class SimpleFacebookTestCase(unittest.TestCase): mock_put_object.assert_called_with(message="Hello World!") ``` -As we’ve seen so far, it’s really simple to start writing smarter tests with mock in Python. +正如我们所看到的,在 Python 中,通过 mock,我们可以非常容易地动手写一个更加智能的测试用例。 -### Mocking in python Conclusion +### Python Mock 总结 -Python’s mock library, if a little confusing to work with, is a game-changer for [unit-testing][7]. We’ve demonstrated common use-cases for getting started using mock in unit-testing, and hopefully this article will help [Python developers][8] overcome the initial hurdles and write excellent, tested code. +对 [单元测试][7] 来说,Python 的 `mock` 库可以说是一个游戏变革者,即使对于它的使用还有点困惑。我们已经演示了单元测试中常见的用例以开始使用 `mock`,并希望这篇文章能够帮助 [Python 开发者][8] 克服初期的障碍,写出优秀、经受过考验的代码。 -------------------------------------------------------------------------------- via: http://slviki.com/index.php/2016/06/18/introduction-to-mocking-in-python/ 作者:[Dasun Sucharith][a] -译者:[译者ID](https://github.com/译者ID) +译者:[cposture](https://github.com/cposture) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 06bc98749eb7f6b462f8f39acd641cd3ed20ed76 Mon Sep 17 00:00:00 2001 From: joVoV <704451873@qq.com> Date: Fri, 5 Aug 2016 17:25:10 +0800 Subject: [PATCH 1361/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= =?UTF-8?q?=20(#4276)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...160509 Android vs. iPhone Pros and Cons.md | 87 ------------------- ...160509 Android vs. iPhone Pros and Cons.md | 87 +++++++++++++++++++ 2 files changed, 87 insertions(+), 87 deletions(-) delete mode 100644 sources/talk/20160509 Android vs. iPhone Pros and Cons.md create mode 100644 translated/talk/20160509 Android vs. iPhone Pros and Cons.md diff --git a/sources/talk/20160509 Android vs. iPhone Pros and Cons.md b/sources/talk/20160509 Android vs. iPhone Pros and Cons.md deleted file mode 100644 index 9977d46d35..0000000000 --- a/sources/talk/20160509 Android vs. iPhone Pros and Cons.md +++ /dev/null @@ -1,87 +0,0 @@ -Android vs. iPhone: Pros and Cons -=================================== - -正在翻译 by jovov ->When comparing Android vs. iPhone, clearly Android has certain advantages even as the iPhone is superior in some key ways. But ultimately, which is better? - -The question of Android vs. iPhone is a personal one. - -Take myself, for example. I'm someone who has used both Android and the iPhone iOS. I'm well aware of the strengths of both platforms along with their weaknesses. Because of this, I decided to share my perspective regarding these two mobile platforms. Additionally, we'll take a look at my impressions of the new Ubuntu mobile platform and where it stacks up. - -### What iPhone gets right - -Even though I'm a full time Android user these days, I do recognize the areas where the iPhone got it right. First, Apple has a better record in updating their devices. This is especially true for older devices running iOS. With Android, if it's not a “Google blessed” Nexus...it better be a higher end carrier supported phone. Otherwise, you're going to find updates are either sparse or non-existent. - -Another area where the iPhone does well is apps availability. Expanding on that: iPhone apps almost always have a cleaner look to them. This isn't to say that Android apps are ugly, rather, they may not have an expected flow and consistency found with iOS. Two examples of exclusivity and great iOS-only layout would have to be [Dark Sky][1] (weather) and [Facebook Paper][2]. - -Then there is the backup process. Android can, by default, back stuff up to Google. But that doesn't help much with application data! By contrast, iCloud can essentially make a full backup of your iOS device. - -### Where iPhone loses me - -The biggest indisputable issue I have with the iPhone is more of a hardware limitation than a software one. That issue is storage. - -Look, with most Android phones, I can buy a smaller capacity phone and then add an SD card later. This does two things: First, I can use the SD card to store a lot of media files. Second, I can even use the SD card to store "some" of my apps. Apple has nothing that will touch this. - -Another area where the iPhone loses me is in the lack of choice it provides. Backing up your device? Hope you like iTunes or iCloud. For someone like myself who uses Linux, this means my ONLY option would be to use iCloud. - -To be ultimately fair, there are additional solutions for your iPhone if you're willing to jailbreak it. But that's not what this article is about. Same goes for rooting Android. This article is addressing a vanilla setup for both platforms. - -Finally, let us not forget this little treat – [iTunes decides to delete a user's music][3] because it was seen as a duplication of Apple Music contents...or something along those lines. Not iPhone specific? I disagree, as that music would have very well ended up onto the iPhone at some point. I can say with great certainty that in no universe would I ever put up with this kind of nonsense! - -![](http://www.datamation.com/imagesvr_ce/5552/mobile-abstract-icon-200x150.jpg) ->The Android vs. iPhone debate depends on what features matter the most to you. - -### What Android gets right - -The biggest thing Android gives me that the iPhone doesn't: choice. Choices in applications, devices and overall layout of how my phone works. - -I love desktop widgets! To iPhone users, they may seem really silly. But I can tell you that they save me from opening up applications as I can see the desired data without the extra hassle. Another similar feature I love is being able to install custom launchers instead of my phone's default! - -Finally, I can utilize tools like [Airdroid][4] and [Tasker][5] to add full computer-like functionality to my smart phone. Airdroid allows me treat my Android phone like a computer with file management and SMS with anyone – this becomes a breeze to use with my mouse and keyboard. Tasker is awesome in that I can setup "recipes" to connect/disconnect, put my phone into meeting mode or even put itself into power saving mode when I set the parameters to do so. I can even set it to launch applications when I arrive at specific destinations. - -### Where Android loses me - -Backup options are limited to specific user data, not a full clone of your phone. Without rooting, you're either left out in the wind or you must look to the Android SDK for solutions. Expecting casual users to either root their phone or run the SDK for a complete (I mean everything) Android backup is a joke. - -Yes, Google's backup service will backup Google app data, along with other related customizations. But it's nowhere near as complete as what we see with the iPhone. To accomplish something similar to what the iPhone enjoys, I've found you're going to either be rooting your Android phone or connecting it to a Windows PC to utilize some random program. - -To be fair, however, I believe Nexus owners benefit from a [full backup service][6] that is device specific. Sorry, but Google's default backup is not cutting it. Same applies for adb backups via your PC – they don't always restore things as expected. - -Wait, it gets better. Now after a lot of failed let downs and frustration, I found that there was one app that looked like it "might" offer a glimmer of hope, it's called Helium. Unlike other applications I found to be misleading and frustrating with their limitations, [Helium][7] initially looked like it was the backup application Google should have been offering all along -- emphasis on "looked like." Sadly, it was a huge let down. Not only did I need to connect it to my computer for a first run, it didn't even work using their provided Linux script. After removing their script, I settling for a good old fashioned adb backup...to my Linux PC. Fun facts: You will need to turn on a laundry list of stuff in developer tools, plus if you run the Twilight app, that needs to be turned off. It took me a bit to put this together when the backup option for adb on my phone wasn't responding. - -At the end of the day, Android has ample options for non-rooted users to backup superficial stuff like contacts, SMS and other data easily. But a deep down phone backup is best left to a wired connection and adb from my experience. - -### Ubuntu will save us? - -With the good and the bad examined between the two major players in the mobile space, there's a lot of hope that we're going to see good things from Ubuntu on the mobile front. Well, thus far, it's been pretty lackluster. - -I like what the developers are doing with the OS and I certainly love the idea of a third option for mobile besides iPhone and Android. Unfortunately, though, it's not that popular on the phone and the tablet received a lot of bad press due to subpar hardware and a lousy demonstration that made its way onto YouTube. - -To be fair, I've had subpar experiences with iPhone and Android, too, in the past. So this isn't a dig on Ubuntu. But until it starts showing up with a ready to go ecosystem of functionality that matches what Android and iOS offer, it's not something I'm terribly interested in yet. At a later date, perhaps, I'll feel like the Ubuntu phones are ready to meet my needs. - -### Android vs. iPhone bottom line: Why Android wins long term - -Despite its painful shortcomings, Android treats me like an adult. It doesn't lock me into only two methods for backing up my data. Yes, some of Android's limitations are due to the fact that it's focused on letting me choose how to handle my data. But, I also get to choose my own device, add storage on a whim. Android enables me to do a lot of cool stuff that the iPhone simply isn't capable of doing. - -At its core, Android gives non-root users greater access to the phone's functionality. For better or worse, it's a level of freedom that I think people are gravitating towards. Now there are going to be many of you who swear by the iPhone thanks to efforts like the [libimobiledevice][8] project. But take a long hard look at all the stuff Apple blocks Linux users from doing...then ask yourself – is it really worth it as a Linux user? Hit the Comments, share your thoughts on Android, iPhone or Ubuntu. - ------------------------------------------------------------------------------- - -via: http://www.datamation.com/mobile-wireless/android-vs.-iphone-pros-and-cons.html - -作者:[Matt Hartley][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://www.datamation.com/author/Matt-Hartley-3080.html -[1]: http://darkskyapp.com/ -[2]: https://www.facebook.com/paper/ -[3]: https://blog.vellumatlanta.com/2016/05/04/apple-stole-my-music-no-seriously/ -[4]: https://www.airdroid.com/ -[5]: http://tasker.dinglisch.net/ -[6]: https://support.google.com/nexus/answer/2819582?hl=en -[7]: https://play.google.com/store/apps/details?id=com.koushikdutta.backup&hl=en -[8]: http://www.libimobiledevice.org/ - diff --git a/translated/talk/20160509 Android vs. iPhone Pros and Cons.md b/translated/talk/20160509 Android vs. iPhone Pros and Cons.md new file mode 100644 index 0000000000..efbef243b9 --- /dev/null +++ b/translated/talk/20160509 Android vs. iPhone Pros and Cons.md @@ -0,0 +1,87 @@ +Android 和 iPhone 的优缺点 +=================================== + + +>当我们比较 Android 与 iPhone 的时候,很显然 iPhone 和 Android 在一些关键方面都具有一定的优势,但是,究竟哪个比较好呢? + + Android 与 iPhone 两者比较是个私人的问题。 + +就好比我来说,我两个都用。我深知这两个平台的优劣势。所以,我决定分享关于这两个移动平台的观点。另外,然后谈谈我对新的 Ubuntu 移动平台的印象和它的优势。 + +### iPhone 的优点 + +虽然这些天我是个十足的 Android 用户,但我必须承认到 iPhone 在某些方面做的是不错。首先,苹果公司在更新他们的设备有更好的战绩。尤其是在旧设备也能运行 iOS 。反观 Android ,如果它不是谷歌福利的关系,它最好是一个更高端的运营商支持的手机。否则,你将发现找那些更新少的可怜或者不存在。 + +其中 iPhone 做得很好的另一个领域是应用程序的可用性。扩展上: iPhone 应用程序几乎总是有一个简洁的外观。这并不是说 Android 应用程序是难看的,相反,他们可能没有和预期的流动性和一致性当建立在 iOS 上。有两个例子 [Dark Sky][1] (天气)和 [Facebook Paper][2] 很好表现了 iOS 的布局。 + +再有就是备份过程。 Android 可以备份,默认情况下是备份到谷歌。但是对应用数据起不了太多作用。对比 iPhone ,iCloud 基本上可以让你的 iOS 设备进行完整备份。 + +### iPhone 令我失望的地方 + +我使用 iPhone 的最大的不容置疑的问题是它的硬件限制大于软件,换句话来说,就是存储问题。 + +你看,对于大多数 Android 手机,我可以买一个容量较小的手机,然后在以后添加 SD 卡。这做了两件事:第一,我可以使用 SD 卡来存储大量的媒体文件。其次,我甚至可以用 SD 卡来存储我的应用程序的一些文件。苹果完全不能这么做。 + +另一个 iPhone 让我失望的地方是它提供的选择很少。备份您的设备?希望大家喜欢 iTunes 或 iCloud 。但对一些像我一样用 Linux 的人,那就意味着,我唯一的选择便是使用 iCloud 。 + +为了最终公平的,如果你愿意越狱,你的 iPhone 还有一些其他解决方案的。但这并不是文章所讲的。 Android 的 root 也一样。本文章针对的是两个用户的原生设置。 + +最后,让我们不要忘记这小小的玩意儿—— [iTunes 决定删除用户的音乐][3] 因为它被视为苹果音乐内容的重复...或者类似的规定。 iPhone 并不明确?我不同意,就算音乐在有些时候很好地在结束在 iPhone 上。我也十分肯定地说在任何地方我会不会忍受这种废话! + +![](http://www.datamation.com/imagesvr_ce/5552/mobile-abstract-icon-200x150.jpg) +> Android 和 iPhone 的对决取决于什么功能对你来说最重要。 + +### Android 的优点 + + Android 给我最大的事情就是 iPhone 提供不了的选择。包括应用程序,设备和我的手机是如何工作的整体布局。 + +我爱桌面小工具!对于 iPhone 用户,它们也许看上去很蠢。但我可以告诉你,他们可以让我不用打开应用程序就可以看到所需的数据,而无需额外的麻烦。另一个类似的功能,我喜欢安装自定义应用,而不是我的手机的默认! + +最后,我可以利用像 [Airdroid][4] 和 [Tasker][5] 工具添加全电脑式的功能到我的智能手机。AirDroid 可以让我对待我的 Android 手机就像一个文件管理和通信的计算机–这使得使用我的鼠标和键盘变得轻而易举的。Tasker 很厉害,我可以用它让我手机可联系或不可联系,当我设置参数时,我可以把我的手机处在会议模式,甚至把它自己变成省电模式。我甚至可以设置它来启动应用程序时当我到达特定的目的地时。 + +### Android 让我失望的地方 + +备份选项仅限于特定的用户数据,而不是手机的完整克隆。没有 root ,你将要么乘风而去或者你必须看看 Android SDK 开发解决方案。期望普通用户 root 他们的手机或运行 SDK来进行所有的Android的备份(我的意思是一切)将是一个笑话。 + +是的,谷歌的备份服务将备份谷歌应用程序的数据,以及其他相关的自定义设置。但它是远不及我们所看到的苹果一样完整。为了完成类似于在苹果的功能,我发现你就必须要 root 你的安卓手机或利用一些随机程序将其连接到一个在 PC 机上来。 + +为了公平的,但是,我相信 Nexus 所有者受益于一个 [完整备份服务][6] ,这是设备特定。对不起,但谷歌的默认备份是不削减它。同样的应用来备份您的电脑——他们不总是恢复预期的东西。 + +等待,它会变得更好。现在经过了很多失败的失望和挫折,我发现有一个应用程序,看起来它“可能”提供了一个微小的希望,它被称为 Helium 。它不像我发现的其他应用程序那样拥有误导性的和令人沮丧的局限性,[Helium][7] 最初看起来像是谷歌应该一直提供的备份应用程序——强调“看起来像”。可悲的是,这是一个巨大的失望。我不仅需要将它连接到我的计算机上进行第一次运行,而且它甚至不使用他们提供的 Linux 脚本。删除他们的脚本后,我弄了一个很好的老式 adb (Android Debug Bridge) 备份到我的Linux PC 。有趣的事实:你需要在开发工具里打开一箩筐东西,再加上如果你运行 Twilight app,那是需要被关闭的。当 adb (Android Debug Bridge) 的备份选项在手机上不起作用时,它花了我一点时间把这个弄在一起。 + +最终,Android 为非 root 用户也提供了可以轻松备份一些如联系人,短信等简单东西的选择。但是,要深度手机备份的话,以我经验还是通过有线连接和 adb (Android Debug Bridge) 。 + +### Ubuntu 会救我们吗? + +在手机领域,通过两大玩家之间的好坏考核,我们将有很多的希望从 Ubuntu 看到好的一方面。但是,迄今为止,它已经相当低迷。 + +我喜欢开发人员正在基于 OS 所做的,我当然喜欢除了 iPhone 和 Android 手机的第三个选项的想法。但是不幸的是,它在手机和平板上并不受欢迎且受到很多坏新闻,就是由于不符合标准的硬件和一个 YouTube 上的糟糕的示范。 + +公平来说,我在以前用 iPhone 和 Android 也不是很规范。所以这不是对 Ubuntu 的挖苦。但是直到它开始表现出准备提供生态系统功能来与 iPhone 和 Android 竞争,那就另说了,这还不是我现在特别感兴趣的东西。在以后的日子里,也许,我会觉得 Ubuntu 手机可以满足我的需要了。 + +###Android pk iPhone:为什么Android 长期胜利 + +忽视 Android 那些痛苦的缺点,它起码对待我像一个成年人。它并没有把我困在只有两种方法来备份我的数据。是的,一些 Android 的限制是由于它的关注点在让我选择如何处理我的数据。但是,我也可以选择我自己的设备,一时兴起扩充内存。 Android 让我做了很多很酷的东西,那些手机根本就没有能力做的事情。 + +在其核心, Android 给非 root 用户提供更大的访问手机的功能。无论是好是坏,这是人们倾向的一种自由。现在你们其中有很多用 iPhone 谩骂的人多亏了像 [libimobiledevice][8] 类似影响的项目。但要看看苹果阻止 Linux 用户所做的事情……然后问自己:作为一个 Linux 用户这是真的值得吗?评论,分享你对 iPhone 、 Android 或 Ubuntu 的看法。 + +------------------------------------------------------------------------------ + +via: http://www.datamation.com/mobile-wireless/android-vs.-iphone-pros-and-cons.html + +作者:[Matt Hartley][a] +译者:[jovov](https://github.com/jovov) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.datamation.com/author/Matt-Hartley-3080.html +[1]: http://darkskyapp.com/ +[2]: https://www.facebook.com/paper/ +[3]: https://blog.vellumatlanta.com/2016/05/04/apple-stole-my-music-no-seriously/ +[4]: https://www.airdroid.com/ +[5]: http://tasker.dinglisch.net/ +[6]: https://support.google.com/nexus/answer/2819582?hl=en +[7]: https://play.google.com/store/apps/details?id=com.koushikdutta.backup&hl=en +[8]: http://www.libimobiledevice.org/ + From ac188917fb2c85de001f073b1554cc32c59167c0 Mon Sep 17 00:00:00 2001 From: ChrisLeeGit Date: Sat, 6 Aug 2016 09:31:29 +0800 Subject: [PATCH 1362/1469] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=20=20Part=2010=20-=20Learn=20How=20to=20Use=20Awk=20Built-in?= =?UTF-8?q?=20Variables?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Learn How to Use Awk Built-in Variables.md | 120 ------------------ ...Learn How to Use Awk Built-in Variables.md | 119 +++++++++++++++++ 2 files changed, 119 insertions(+), 120 deletions(-) delete mode 100644 sources/tech/awk/20160725 Part 10 - Learn How to Use Awk Built-in Variables.md create mode 100644 translated/tech/awk/20160725 Part 10 - Learn How to Use Awk Built-in Variables.md diff --git a/sources/tech/awk/20160725 Part 10 - Learn How to Use Awk Built-in Variables.md b/sources/tech/awk/20160725 Part 10 - Learn How to Use Awk Built-in Variables.md deleted file mode 100644 index 9b66a0cbfe..0000000000 --- a/sources/tech/awk/20160725 Part 10 - Learn How to Use Awk Built-in Variables.md +++ /dev/null @@ -1,120 +0,0 @@ -Being translated by ChrisLeeGit -Learn How to Use Awk Built-in Variables – Part 10 -================================================= - -As we uncover the section of Awk features, in this part of the series, we shall walk through the concept of built-in variables in Awk. There are two types of variables you can use in Awk, these are; user-defined variables, which we covered in Part 8 and built-in variables. - -![](http://www.tecmint.com/wp-content/uploads/2016/07/Awk-Built-in-Variables-Examples.png) ->Awk Built in Variables Examples - -Built-in variables have values already defined in Awk, but we can also carefully alter those values, the built-in variables include: - -- `FILENAME` : current input file name( do not change variable name) -- `FR` : number of the current input line (that is input line 1, 2, 3… so on, do not change variable name) -- `NF` : number of fields in current input line (do not change variable name) -- `OFS` : output field separator -- `FS` : input field separator -- `ORS` : output record separator -- `RS` : input record separator - -Let us proceed to illustrate the use of some of the Awk built-in variables above: - -To read the filename of the current input file, you can use the `FILENAME` built-in variable as follows: - -``` -$ awk ' { print FILENAME } ' ~/domains.txt -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/07/Awk-FILENAME-Variable.png) ->Awk FILENAME Variable - -You will realize that, the filename is printed out for each input line, that is the default behavior of Awk when you use `FILENAME` built-in variable. - -Using `NR` to count the number of lines (records) in an input file, remember that, it also counts the empty lines, as we shall see in the example below. - -When we view the file domains.txt using cat command, it contains 14 lines with text and empty 2 lines: - -``` -$ cat ~/domains.txt -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/07/Print-Contents-of-File.png) ->Print Contents of File - - -``` -$ awk ' END { print "Number of records in file is: ", NR } ' ~/domains.txt -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/07/Awk-Count-Number-of-Lines.png) ->Awk Count Number of Lines - -To count the number of fields in a record or line, we use the NR built-in variable as follows: - -``` -$ cat ~/names.txt -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/07/List-File-Contents.png) ->List File Contents - -``` -$ awk '{ print "Record:",NR,"has",NF,"fields" ; }' ~/names.txt -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/07/Awk-Count-Number-of-Fields-in-File.png) ->Awk Count Number of Fields in File - -Next, you can also specify an input field separator using the FS built-in variable, it defines how Awk divides input lines into fields. - -The default value for FS is space and tab, but we can change the value of FS to any character that will instruct Awk to divide input lines accordingly. - -There are two methods to do this: - -- one method is to use the FS built-in variable -- and the second is to invoke the -F Awk option - -Consider the file /etc/passwd on a Linux system, the fields in this file are divided using the : character, so we can specify it as the new input field separator when we want to filter out certain fields as in the following examples: - -We can use the `-F` option as follows: - -``` -$ awk -F':' '{ print $1, $4 ;}' /etc/passwd -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/07/Awk-Filter-Fields-in-Password-File.png) ->Awk Filter Fields in Password File - -Optionally, we can also take advantage of the FS built-in variable as below: - -``` -$ awk ' BEGIN { FS=“:” ; } { print $1, $4 ; } ' /etc/passwd -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/07/Filter-Fields-in-File-Using-Awk.png) ->Filter Fields in File Using Awk - -To specify an output field separator, use the OFS built-in variable, it defines how the output fields will be separated using the character we use as in the example below: - -``` -$ awk -F':' ' BEGIN { OFS="==>" ;} { print $1, $4 ;}' /etc/passwd -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/07/Add-Separator-to-Field-in-File.png) ->Add Separator to Field in File - -In this Part 10, we have explored the idea of using Awk built-in variables which come with predefined values. But we can also change these values, though, it is not recommended to do so unless you know what you are doing, with adequate understanding. - -After this, we shall progress to cover how we can use shell variables in Awk command operations, therefore, stay connected to Tecmint. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/awk-built-in-variables-examples/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tecmint+%28Tecmint%3A+Linux+Howto%27s+Guide%29 - -作者:[Aaron Kili][a] -译者:[ChrisLeeGit](https://github.com/chrisleegit) -校对:[校对ID](https://github.com/校对ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://www.tecmint.com/author/aaronkili/ diff --git a/translated/tech/awk/20160725 Part 10 - Learn How to Use Awk Built-in Variables.md b/translated/tech/awk/20160725 Part 10 - Learn How to Use Awk Built-in Variables.md new file mode 100644 index 0000000000..321b1dc588 --- /dev/null +++ b/translated/tech/awk/20160725 Part 10 - Learn How to Use Awk Built-in Variables.md @@ -0,0 +1,119 @@ +awk 系列:如何使用 awk 内置变量 +================================================= + +我们将逐渐揭开 awk 功能的神秘面纱,在本节中,我们将介绍 awk 内置(built-in)变量的概念。你可以在 awk 中使用两种类型的变量,它们是:用户自定义(user-defined)变量(我们在第八节中已经介绍了)和内置变量。 + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Awk-Built-in-Variables-Examples.png) +> awk 内置变量示例 + +awk 内置变量已经有预先定义的值了,但我们也可以谨慎地修改这些值,awk 内置变量包括: + +- `FILENAME` : 当前输入文件名称(不要修改变量名) +- `NR` : 当前输入行编号(是指输入行 1,2,3……等,不要改变变量名) +- `NF` : 当前输入行段编号(不要修改变量名) +- `OFS` : 输出段分隔符 +- `FS` : 输入段分隔符 +- `ORS` : 输出记录分隔符 +- `RS` : 输入记录分隔符 + +让我们继续演示一些使用上述 awk 内置变量的方法: + +想要读取当前输入文件的名称,你可以使用 `FILENAME` 内置变量,如下: + +``` +$ awk ' { print FILENAME } ' ~/domains.txt +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Awk-FILENAME-Variable.png) +> awk FILENAME 变量 + +你会看到,每一行都会对应输出一次文件名,那是你使用 `FILENAME` 内置变量时 awk 默认的行为。 + +我们可以使用 `NR` 来统计一个输入文件的行数(记录),谨记,它也会计算空行,正如我们将要在下面的例子中看到的那样。 + +当我们使用 cat 命令查看文件 domains.txt 时,会发现它有 14 行文本和 2 个空行: + +``` +$ cat ~/domains.txt +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Print-Contents-of-File.png) +> 输出文件内容 + + +``` +$ awk ' END { print "文件记录数是:", NR } ' ~/domains.txt +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Awk-Count-Number-of-Lines.png) +> awk 统计行数 + +想要统计一条记录或一行中的段数,我们可以像下面那样使用 NR 内置变量: + +``` +$ cat ~/names.txt +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/07/List-File-Contents.png) +> 列出文件内容 + +``` +$ awk '{ print "记录:",NR,"有",NF,"段" ; }' ~/names.txt +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Awk-Count-Number-of-Fields-in-File.png) +> awk 统计文件中的段数 + +接下来,你也可以使用 FS 内置变量指定一个输入文件分隔符,它会定义 awk 如何将输入行划分成段。 + +FS 默认值为空格和 TAB,但我们也能将 FS 值修改为任何字符来让 awk 根据情况分隔输入行。 + +有两种方法可以达到目的: + +- 第一种方法是使用 FS 内置变量 +- 第二种方法是使用 awk 的 -F 选项 + +来看 Linux 系统上的 `/etc/passwd` 文件,该文件中的各段是使用 `:` 分隔的,因此,当我们想要过滤出某些段时,可以将 `:` 指定为新的输入段分隔符,示例如下: + +我们可以使用 `-F` 选项,如下: + +``` +$ awk -F':' '{ print $1, $4 ;}' /etc/passwd +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Awk-Filter-Fields-in-Password-File.png) +> awk 过滤密码文件中的各段 + +此外,我们也可以利用 FS 内置变量,如下: + +``` +$ awk ' BEGIN { FS=“:” ; } { print $1, $4 ; } ' /etc/passwd +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Filter-Fields-in-File-Using-Awk.png) +> 使用 awk 过滤文件中的各段 + +使用 OFS 内置变量来指定一个输出段分隔符,它会定义如何使用指定的字符分隔输出段,示例如下: + +``` +$ awk -F':' ' BEGIN { OFS="==>" ;} { print $1, $4 ;}' /etc/passwd +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/07/Add-Separator-to-Field-in-File.png) +> 向文件中的段添加分隔符 + +在第十节(即本节)中,我们已经学习了使用含有预定义值的 awk 内置变量的理念。但我们也能够修改这些值,虽然并不推荐这样做,除非你晓得自己在做什么,并且充分理解(这些变量值)。 + +此后,我们将继续学习如何在 awk 命令操作中使用 shell 变量,所以,请继续关注 Tecmint。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/awk-built-in-variables-examples/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tecmint+%28Tecmint%3A+Linux+Howto%27s+Guide%29 + +作者:[Aaron Kili][a] +译者:[ChrisLeeGit](https://github.com/chrisleegit) +校对:[校对ID](https://github.com/校对ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.tecmint.com/author/aaronkili/ From dde1507ae311ec40a716a570728282d76c6d7f13 Mon Sep 17 00:00:00 2001 From: ChrisLeeGit Date: Sat, 6 Aug 2016 13:59:06 +0800 Subject: [PATCH 1363/1469] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91P?= =?UTF-8?q?art=2011=20-=20How=20to=20Allow=20Awk=20to=20Use=20Shell=20Vari?= =?UTF-8?q?ables?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...60802 Part 11 - How to Allow Awk to Use Shell Variables.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/awk/20160802 Part 11 - How to Allow Awk to Use Shell Variables.md b/sources/tech/awk/20160802 Part 11 - How to Allow Awk to Use Shell Variables.md index b407050da7..5930cadb64 100644 --- a/sources/tech/awk/20160802 Part 11 - How to Allow Awk to Use Shell Variables.md +++ b/sources/tech/awk/20160802 Part 11 - How to Allow Awk to Use Shell Variables.md @@ -1,3 +1,5 @@ +Being translated by ChrisLeeGit + How to Allow Awk to Use Shell Variables – Part 11 ================================================== @@ -87,7 +89,7 @@ In the next part of the Awk series, we shall dive into yet another critical sect via: http://www.tecmint.com/use-shell-script-variable-in-awk/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tecmint+%28Tecmint%3A+Linux+Howto%27s+Guide%29 作者:[Aaron Kili][a] -译者:[译者ID](https://github.com/译者ID) +译者:[ChrisLeeGit](https://github.com/chrisleegit) 校对:[校对ID](https://github.com/校对ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 05dd878226858c5e8191cb683e5c182a9a5421eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=AE=B6=E5=90=AF?= Date: Sat, 6 Aug 2016 15:34:54 +0800 Subject: [PATCH 1364/1469] Translated by cposture (#4279) * 75 * Translated by cposture * Translated by cposture * Translated by cposture --- ...ce portfolio - Machine learning project.md | 130 +++++++++--------- 1 file changed, 62 insertions(+), 68 deletions(-) diff --git a/sources/team_test/part 6 - Building a data science portfolio - Machine learning project.md b/sources/team_test/part 6 - Building a data science portfolio - Machine learning project.md index 3bec1d0a98..2ea994c119 100644 --- a/sources/team_test/part 6 - Building a data science portfolio - Machine learning project.md +++ b/sources/team_test/part 6 - Building a data science portfolio - Machine learning project.md @@ -1,17 +1,15 @@ -Translating by cposture 2016-08-02 -### Making predictions +### 做出预测 -Now that we have the preliminaries out of the way, we’re ready to make predictions. We’ll create a new file called predict.py that will use the train.csv file we created in the last step. The below code will: +既然完成了前期准备,我们可以开始准备做出预测了。我将创建一个名为 predict.py 的新文件,它会使用我们在最后一步创建的 train.csv 文件。下面的代码: -- Import needed libraries. -- Create a function called cross_validate that: - - Creates a logistic regression classifier with the right keyword arguments. - - Creates a list of columns that we want to use to train the model, removing id and foreclosure_status. - - Run cross validation across the train DataFrame. - - Return the predictions. +- 导入所需的库 +- 创建一个名为 `cross_validate` 的函数: + - 使用正确的关键词参数创建逻辑回归分类器(logistic regression classifier) + - 创建移除了 `id` 和 `foreclosure_status` 属性的用于训练模型的列 + - 跨 `train` 数据帧使用交叉验证 + - 返回预测结果 - -``` +```python import os import settings import pandas as pd @@ -29,22 +27,19 @@ def cross_validate(train): return predictions ``` -### Predicting error +### 预测误差 -Now, we just need to write a few functions to compute error. The below code will: +现在,我们仅仅需要写一些函数来计算误差。下面的代码: -- Create a function called compute_error that: - - Uses scikit-learn to compute a simple accuracy score (the percentage of predictions that matched the actual foreclosure_status values). -- Create a function called compute_false_negatives that: - - Combines the target and the predictions into a DataFrame for convenience. - - Finds the false negative rate. -- Create a function called compute_false_positives that: - - Combines the target and the predictions into a DataFrame for convenience. - - Finds the false positive rate. - - Finds the number of loans that weren’t foreclosed on that the model predicted would be foreclosed on. - - Divide by the total number of loans that weren’t foreclosed on. +- 创建函数 `compute_error`: + - 使用 scikit-learn 计算一个简单的精确分数(与实际 `foreclosure_status` 值匹配的预测百分比) +- 创建函数 `compute_false_negatives`: + - 为了方便,将目标和预测结果合并到一个数据帧 + - 查找漏报率 + - 找到原本应被预测模型取消但没有取消的贷款数目 + - 除以没被取消的贷款总数目 -``` +```python def compute_error(target, predictions): return metrics.accuracy_score(target, predictions) @@ -57,21 +52,20 @@ def compute_false_positives(target, predictions): return df[(df["target"] == 0) & (df["predictions"] == 1)].shape[0] / (df[(df["target"] == 0)].shape[0] + 1) ``` +### 聚合到一起 -### Putting it all together +现在,我们可以把函数都放在 `predict.py`。下面的代码: -Now, we just have to put the functions together in predict.py. The below code will: +- 读取数据集 +- 计算交叉验证预测 +- 计算上面的 3 个误差 +- 打印误差 -- Read in the dataset. -- Compute cross validated predictions. -- Compute the 3 error metrics above. -- Print the error metrics. - -``` +```python def read(): train = pd.read_csv(os.path.join(settings.PROCESSED_DIR, "train.csv")) return train - + if __name__ == "__main__": train = read() predictions = cross_validate(train) @@ -83,11 +77,11 @@ if __name__ == "__main__": print("False Positives: {}".format(fp)) ``` -Once you’ve added the code, you can run python predict.py to generate predictions. Running everything shows that our false negative rate is .26, which means that of the foreclosed loans, we missed predicting 26% of them. This is a good start, but can use a lot of improvement! +一旦你添加完代码,你可以运行 `python predict.py` 来产生预测结果。运行结果向我们展示漏报率为 `.26`,这意味着我们没能预测 `26%` 的取消贷款。这是一个好的开始,但仍有很多改善的地方! -You can find the complete predict.py file [here][41]. +你可以在[这里][41]找到完整的 `predict.py` 文件 -Your file tree should now look like this: +你的文件树现在看起来像下面这样: ``` loan-prediction @@ -110,47 +104,47 @@ loan-prediction ├── settings.py ``` -### Writing up a README +### 撰写 README -Now that we’ve finished our end to end project, we just have to write up a README.md file so that other people know what we did, and how to replicate it. A typical README.md for a project should include these sections: +既然我们完成了端到端的项目,那么我们可以撰写 README.md 文件了,这样其他人便可以知道我们做的事,以及如何复制它。一个项目典型的 README.md 应该包括这些部分: -- A high level overview of the project, and what the goals are. -- Where to download any needed data or materials. -- Installation instructions. - - How to install the requirements. -- Usage instructions. - - How to run the project. - - What you should see after each step. -- How to contribute to the project. - - Good next steps for extending the project. +- 一个高水准的项目概览,并介绍项目目的 +- 任何必需的数据和材料的下载地址 +- 安装命令 + - 如何安装要求依赖 +- 使用命令 + - 如何运行项目 + - 每一步之后会看到的结果 +- 如何为这个项目作贡献 + - 扩展项目的下一步计划 -[Here’s][42] a sample README.md for this project. +[这里][42] 是这个项目的一个 README.md 样例。 -### Next steps +### 下一步 -Congratulations, you’re done making an end to end machine learning project! You can find a complete example project [here][43]. It’s a good idea to upload your project to [Github][44] once you’ve finished it, so others can see it as part of your portfolio. +恭喜你完成了端到端的机器学习项目!你可以在[这里][43]找到一个完整的示例项目。一旦你完成了项目,把它上传到 [Github][44] 是一个不错的主意,这样其他人也可以看到你的文件夹的部分项目。 -There are still quite a few angles left to explore with this data. Broadly, we can split them up into 3 categories – extending this project and making it more accurate, finding other columns to predict, and exploring the data. Here are some ideas: +这里仍有一些留待探索数据的角度。总的来说,我们可以把它们分割为 3 类 - 扩展这个项目并使它更加精确,发现预测其他列并探索数据。这是其中一些想法: -- Generate more features in annotate.py. -- Switch algorithms in predict.py. -- Try using more data from Fannie Mae than we used in this post. -- Add in a way to make predictions on future data. The code we wrote will still work if we add more data, so we can add more past or future data. -- Try seeing if you can predict if a bank should have issued the loan originally (vs if Fannie Mae should have acquired the loan). - - Remove any columns from train that the bank wouldn’t have known at the time of issuing the loan. - - Some columns are known when Fannie Mae bought the loan, but not before. - - Make predictions. -- Explore seeing if you can predict columns other than foreclosure_status. - - Can you predict how much the property will be worth at sale time? -- Explore the nuances between performance updates. - - Can you predict how many times the borrower will be late on payments? - - Can you map out the typical loan lifecycle? -- Map out data on a state by state or zip code by zip code level. - - Do you see any interesting patterns? +- 在 `annotate.py` 中生成更多的特性 +- 切换 `predict.py` 中的算法 +- 尝试使用比我们发表在这里的更多的来自 `Fannie Mae` 的数据 +- 添加对未来数据进行预测的方法。如果我们添加更多数据,我们所写的代码仍然可以起作用,这样我们可以添加更多过去和未来的数据。 +- 尝试看看是否你能预测一个银行是否应该发放贷款(相对地,`Fannie Mae` 是否应该获得贷款) + - 移除 train 中银行不知道发放贷款的时间的任何列 + - 当 Fannie Mae 购买贷款时,一些列是已知的,但不是之前 + - 做出预测 +- 探索是否你可以预测除了 foreclosure_status 的其他列 + - 你可以预测在销售时财产值多少? +- 探索探索性能更新之间的细微差别 + - 你能否预测借款人会逾期还款多少次? + - 你能否标出的典型贷款周期? +- 标出一个州到州或邮政编码到邮政级水平的数据 + - 你看到一些有趣的模式了吗? -If you build anything interesting, please let us know in the comments! +如果你建立了任何有趣的东西,请在评论中让我们知道! -If you liked this, you might like to read the other posts in our ‘Build a Data Science Porfolio’ series: +如果你喜欢这个,你可能会喜欢阅读 ‘Build a Data Science Porfolio’ 系列的其他文章: - [Storytelling with data][45]. - [How to setup up a data science blog][46]. From e2ac066705b7ad6e4d1502a476782638c9915cdd Mon Sep 17 00:00:00 2001 From: Frank Zhang Date: Sat, 6 Aug 2016 17:45:22 +0800 Subject: [PATCH 1365/1469] [translating] 20160802 3 graphical tools for Git.md --- sources/tech/20160802 3 graphical tools for Git.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160802 3 graphical tools for Git.md b/sources/tech/20160802 3 graphical tools for Git.md index c09afed48b..579ec09fdc 100644 --- a/sources/tech/20160802 3 graphical tools for Git.md +++ b/sources/tech/20160802 3 graphical tools for Git.md @@ -1,3 +1,4 @@ +zpl1025 3 graphical tools for Git ============================= From 7fe1182dc58e269230e8c95dcb1e418c85337947 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 6 Aug 2016 17:52:02 +0800 Subject: [PATCH 1366/1469] PUB:20160706 Doing for User Space What We Did for Kernel Space @MikeCoder @PurlingNayuki --- ...User Space What We Did for Kernel Space.md | 37 ++++++++++--------- 1 file changed, 20 insertions(+), 17 deletions(-) rename {translated/tech => published}/20160706 Doing for User Space What We Did for Kernel Space.md (59%) diff --git a/translated/tech/20160706 Doing for User Space What We Did for Kernel Space.md b/published/20160706 Doing for User Space What We Did for Kernel Space.md similarity index 59% rename from translated/tech/20160706 Doing for User Space What We Did for Kernel Space.md rename to published/20160706 Doing for User Space What We Did for Kernel Space.md index a62f9ad09f..f9dfb89593 100644 --- a/translated/tech/20160706 Doing for User Space What We Did for Kernel Space.md +++ b/published/20160706 Doing for User Space What We Did for Kernel Space.md @@ -1,45 +1,46 @@ 在用户空间做我们会在内核空间做的事情 ======================================================= -我相信,Linux 最好也是最坏的事情,就是内核空间和用户空间之间的巨大差别。 +我相信,Linux 最好也是最坏的事情,就是内核空间(kernel space)和用户空间(user space)之间的巨大差别。 -但是如果没有这个区别,Linux 可能也不会成为世界上影响力最大的操作系统。如今,Linux 的使用范围在世界上是最大的,而这些应用又有着世界上最大的用户群——尽管大多数用户并不知道,当他们进行谷歌搜索或者触摸安卓手机的时候,他们其实正在使用 Linux。如果不是 Linux 的巨大成功,Apple 公司也可能并不会成为现在这样(即在他们的电脑产品中使用 BSD 的技术)(注:Linux 获得成功后,Apple 曾与 Linus 协商使用 Linux 核心作为 Apple 电脑的操作系统并帮助开发的事宜,但遭到拒绝。因此,Apple 转向使用许可证更为宽松的 BSD 。)。 +如果没有这个区别,Linux 可能也不会成为世界上影响力最大的操作系统。如今,Linux 的使用范围在世界上是最大的,而这些应用又有着世界上最大的用户群——尽管大多数用户并不知道,当他们进行谷歌搜索或者触摸安卓手机的时候,他们其实正在使用 Linux。如果不是 Linux 的巨大成功,Apple 公司也可能并不会成为现在这样(即在他们的电脑产品中使用 BSD 的技术)(LCTT 译注:Linux 获得成功后,Apple 曾与 Linus 协商使用 Linux 核心作为 Apple 电脑的操作系统并帮助开发的事宜,但遭到拒绝。因此,Apple 转向使用许可证更为宽松的 BSD 。)。 -不(需要)关注用户空间是 Linux 内核开发中的一个特点而非缺陷。正如 Linus 在 2003 的极客巡航中提到的那样,“我只做内核相关技术……我并不知道内核之外发生的事情,而且我并不关心。我只关注内核部分发生的事情。” 多年之后的另一个极客巡航上, Andrew Morton 给我上了另外的一课,这之后我写道: +不(需要)关注用户空间是 Linux 内核开发中的一个特点而非缺陷。正如 Linus 在 2003 年的[极客巡航(Geek Cruise)][18]中提到的那样,“我只做内核相关的东西……我并不知道内核之外发生的事情,而且我也并不关心。我只关注内核部分发生的事情。” 多年之后的[另一次极客巡航][19]上, Andrew Morton 给我上了另外的一课,这之后我写道: -> Linux 存在于内核空间,而在用户空间中被使用,和其他的自然的建筑材料一样。内核空间和用户空间的区别,和自然材料与人类从中生产的人造材料的区别很类似。 +> 内核空间是Linux 所在的地方,而用户空间是 Linux 与其它的“自然材料”一起使用的地方。内核空间和用户空间的区别,和自然材料与人类用其生产的人造材料的区别很类似。 -这个区别的自然而然的结果,就是尽管外面的世界一刻也离不开 Linux, 但是 Linux 社区还是保持相对较小。所以,为了增加哪怕一点我们社区团体的规模,我希望指出两件事情。第一件已经非常火了,另外一件可能会火起来。 +这个区别是自然而然的结果,就是尽管外面的世界一刻也离不开 Linux, 但是 Linux 社区还是保持相对较小。所以,为了增加哪怕一点我们社区团体的规模,我希望指出两件事情。第一件已经非常火了,另外一件可能会火起来。 -第一件事情就是 [blockchain][1],出自著名的分布式货币——比特币之手。当你正在阅读这篇文章的同时,人们对 blockchain 的[关注度正在直线上升][2]。 +第一件事情就是 [区块链(blockchain)][1],出自著名的分布式货币——比特币之手。当你正在阅读这篇文章的同时,人们对区块链的[关注度正在直线上升][2]。 ![](http://www.linuxjournal.com/files/linuxjournal.com/ufiles/imagecache/large-550px-centered/u1000009/12042f1.png) -> 图1. Blockchain 的谷歌搜索趋势 -第二件事就是自主身份。为了解释这个概念,让我先来问你:你是谁,你来自哪里? +*图1. 区块链的谷歌搜索趋势* -如果你从你的雇员、你的医生或者车管所,Facebook、Twitter 或者谷歌上得到答案,你就会发现它们都是行政身份——机构完全以自己的便利为原因设置这些身份和职位。正如 [Evernym][3] 的 Timothy Ruff 所说,“你并不因组织而存在,但你的身份却因此存在。”身份是个因变量。自变量——即控制着身份的变量——是(你所在的)组织。 +第二件事就是自主身份(self-sovereign identity)。为了解释这个概念,让我先来问你:你是谁,你来自哪里? + +如果你从你的老板、你的医生或者车管所,Facebook、Twitter 或者谷歌上得到答案,你就会发现它们都是行政身份(administrative identifiers)——这些机构完全以自己的便利为原因设置这些身份和职位。正如一家区块链技术公司 [Evernym][3] 的 Timothy Ruff 所说,“你并不因组织而存在,但你的身份却因此存在。”身份是个因变量。自变量——即控制着身份的变量——是(你所在的)组织。 如果你的答案出自你自己,我们就有一个广大空间来发展一个新的领域,在这个领域中,我们完全自由。 -据我所知,第一个解释这个的人是 [Devon Loffreto][4]。在 2012 年 2 月,他在博客[Moxy Tongue][5] 中写道:“什么是'Sovereign Source Authority'?”。在发表于 2016 年 2 月的 "[Self-Sovereign Identity][6]" 中,他写道: +据我所知,第一个解释这个的人是 [Devon Loffreto][4]。在 2012 年 2 月,他在博客 [Moxy Tongue][5] 中写道:“什么是 'Sovereign Source Authority'?”。在发表于 2016 年 2 月的 “[Self-Sovereign Identity][6]” 一文中,他写道: > 自主身份必须是独立个人提出的,并且不包含社会因素……自主身份源于每个个体对其自身本源的认识。 一个自主身份可以为个体带来新的社会面貌。每个个体都可能为自己生成一个自主身份,并且这并不会改变固有的人权。使用自主身份机制是所有参与者参与的基石,并且依旧可以同各种形式的人类社会保持联系。 -将这个概念放在 Linux 领域中,只有个人才能为他或她设定一个自己的开源社区身份。这在现实实践中,这只是一个非常正从的事件。举个例子,我自己的身份包括: +将这个概念放在 Linux 领域中,只有个人才能为他或她设定一个自己的开源社区身份。这在现实实践中,这只是一个非常正常的事件。举个例子,我自己的身份包括: - David Allen Searls,我父母会这样叫我。 - David Searls,正式场合下我会这么称呼自己。 - Dave,我的亲戚和好朋友会这么叫我。 - Doc,大多数人会这么叫我。 -作为承认以上称呼的自主身份来源,我可以在不同的情景中轻易的转换。但是,这只是在现实世界中。在虚拟世界中,这就变得非常困难。除了上述的身份之外,我还可以是 @dsearls(我的 twitter 账号) 和 dsearls (其他的网络账号)。然而为了记住成百上千的不同账号的登录名和密码,我已经不堪重负。 +作为承认以上称呼的自主身份来源,我可以在不同的情景中轻易的转换。但是,这只是在现实世界中。在虚拟世界中,这就变得非常困难。除了上述的身份之外,我还可以是 @dsearls (我的 twitter 账号) 和 dsearls (其他的网络账号)。然而为了记住成百上千的不同账号的登录名和密码,我已经不堪重负。 你可以在你的浏览器上感受到这个糟糕的体验。在火狐上,我有成百上千个用户名密码。很多已经废弃(很多都是从 Netscape 时代遗留下来的),但是我想会有大量的工作账号需要处理。对于这些,我只是被动接受者。没有其他的解决方法。甚至一些安全较低的用户认证,已经成为了现实世界中不可缺少的一环。 -现在,最简单的方式来联系账号,就是通过 "Log in with Facebook" 或者 "Login in with Twitter" 来进行身份认证。在这种情况下,我们中的每一个甚至并不是真正意义上的自己,甚至(如果我们希望被其他人认识的话)缺乏对其他实体如何认识我们的控制。 +现在,最简单的方式来联系账号,就是通过 “Log in with Facebook” 或者 “Login in with Twitter” 来进行身份认证。在这种情况下,我们中的每一个甚至并不是真正意义上的自己,甚至(如果我们希望被其他人认识的话)缺乏对其他实体如何认识我们的控制。 -我们从一开始就需要的是一个可以实体化我们的自主身份和交流时选择如何保护和展示自身的个人系统。因为缺少这个能力,我们现在陷入混乱。Shoshana Zuboff 称之为 "监视资本主义",她如此说道: +我们从一开始就需要的是一个可以实体化我们的自主身份和交流时选择如何保护和展示自身的个人系统。因为缺少这个能力,我们现在陷入混乱。Shoshana Zuboff 称之为 “监视资本主义”,她如此说道: >...难以想象,在见证了互联网和获得了的巨大成功的谷歌背后。世界因 Apple 和 FBI 的对决而紧密联系在一起。讲道理,热衷于监视的资本家开发的监视系统是每一个国家安全机构都渴望的。 @@ -55,16 +56,16 @@ - "[System or Human First][10]" - Devon Loffreto. - "[The Path to Self-Sovereign Identity][11]" - Christopher Allen. -从Evernym 的简要说明中,[digi.me][12], [iRespond][13] 和 [Respect Network][14] 也被包括在内。自主身份和社会身份 (也被称为“current model”) 的对比结果,显示在图二中。 +从 Evernym 的简要说明中,[digi.me][12]、 [iRespond][13] 和 [Respect Network][14] 也被包括在内。自主身份和社会身份 (也被称为“当前模式(current model)”) 的对比结果,显示在图二中。 ![](http://www.linuxjournal.com/files/linuxjournal.com/ufiles/imagecache/large-550px-centered/u1000009/12042f2.jpg) -> 图 2. Current Model 身份 vs. 自主身份 + +*图 2. 当前模式身份 vs. 自主身份* Sovrin 就是为此而生的[平台][15],它阐述自己为一个“依托于先进、专用、经授权、分布式平台的,完全开源、基于标识的身份声明图平台”。同时,这也有一本[白皮书][16]。它的代码名为 [plenum][17],并且公开在 Github 上。 在这里——或者其他类似的地方——我们就可以在用户空间中重现我们在过去 25 年中在内核空间做过的事情。 - -------------------------------------------------------------------------------- via: https://www.linuxjournal.com/content/doing-user-space-what-we-did-kernel-space @@ -93,3 +94,5 @@ via: https://www.linuxjournal.com/content/doing-user-space-what-we-did-kernel-sp [15]: http://evernym.com/technology [16]: http://evernym.com/assets/doc/Identity-System-Essentials.pdf?v=167284fd65 [17]: https://github.com/evernym/plenum +[18]: http://www.linuxjournal.com/article/6427 +[19]: http://www.linuxjournal.com/article/8664 \ No newline at end of file From 824b4e85232bd9d1613def115457fcd8100e181f Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 6 Aug 2016 17:54:46 +0800 Subject: [PATCH 1367/1469] =?UTF-8?q?=E5=B7=B2=E6=A0=A1=E5=AF=B9=E5=8F=91?= =?UTF-8?q?=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...eate Your Own Shell in Python - Part II.md | 216 ------------------ 1 file changed, 216 deletions(-) delete mode 100644 translated/tech/20160706 Create Your Own Shell in Python - Part II.md diff --git a/translated/tech/20160706 Create Your Own Shell in Python - Part II.md b/translated/tech/20160706 Create Your Own Shell in Python - Part II.md deleted file mode 100644 index 88f6a0fba8..0000000000 --- a/translated/tech/20160706 Create Your Own Shell in Python - Part II.md +++ /dev/null @@ -1,216 +0,0 @@ -使用 Python 创建你自己的 Shell:Part II -=========================================== - -在 [part 1][1] 中,我们已经创建了一个主要的 shell 循环、切分了的命令输入,以及通过 `fork` 和 `exec` 执行命令。在这部分,我们将会解决剩下的问题。首先,`cd test_dir2` 命令无法修改我们的当前目录。其次,我们仍无法优雅地从 shell 中退出。 - -### 步骤 4:内置命令 - -“cd test_dir2 无法修改我们的当前目录” 这句话是对的,但在某种意义上也是错的。在执行完该命令之后,我们仍然处在同一目录,从这个意义上讲,它是对的。然而,目录实际上已经被修改,只不过它是在子进程中被修改。 - -还记得我们 fork 了一个子进程,然后执行命令,执行命令的过程没有发生在父进程上。结果是我们只是改变了子进程的当前目录,而不是父进程的目录。 - -然后子进程退出,而父进程在原封不动的目录下继续运行。 - -因此,这类与 shell 自己相关的命令必须是内置命令。它必须在 shell 进程中执行而没有分叉(forking)。 - -#### cd - -让我们从 `cd` 命令开始。 - -我们首先创建一个 `builtins` 目录。每一个内置命令都会被放进这个目录中。 - -```shell -yosh_project -|-- yosh - |-- builtins - | |-- __init__.py - | |-- cd.py - |-- __init__.py - |-- shell.py -``` - -在 `cd.py` 中,我们通过使用系统调用 `os.chdir` 实现自己的 `cd` 命令。 - -```python -import os -from yosh.constants import * - - -def cd(args): - os.chdir(args[0]) - - return SHELL_STATUS_RUN -``` - -注意,我们会从内置函数返回 shell 的运行状态。所以,为了能够在项目中继续使用常量,我们将它们移至 `yosh/constants.py`。 - -```shell -yosh_project -|-- yosh - |-- builtins - | |-- __init__.py - | |-- cd.py - |-- __init__.py - |-- constants.py - |-- shell.py -``` - -在 `constants.py` 中,我们将状态常量都放在这里。 - -```python -SHELL_STATUS_STOP = 0 -SHELL_STATUS_RUN = 1 -``` - -现在,我们的内置 `cd` 已经准备好了。让我们修改 `shell.py` 来处理这些内置函数。 - -```python -... -# Import constants -from yosh.constants import * - -# Hash map to store built-in function name and reference as key and value -built_in_cmds = {} - - -def tokenize(string): - return shlex.split(string) - - -def execute(cmd_tokens): - # Extract command name and arguments from tokens - cmd_name = cmd_tokens[0] - cmd_args = cmd_tokens[1:] - - # If the command is a built-in command, invoke its function with arguments - if cmd_name in built_in_cmds: - return built_in_cmds[cmd_name](cmd_args) - - ... -``` - -我们使用一个 python 字典变量 `built_in_cmds` 作为哈希映射(hash map),以存储我们的内置函数。我们在 `execute` 函数中提取命令的名字和参数。如果该命令在我们的哈希映射中,则调用对应的内置函数。 - -(提示:`built_in_cmds[cmd_name]` 返回能直接使用参数调用的函数引用的。) - -我们差不多准备好使用内置的 `cd` 函数了。最后一步是将 `cd` 函数添加到 `built_in_cmds` 映射中。 - -``` -... -# Import all built-in function references -from yosh.builtins import * - -... - -# Register a built-in function to built-in command hash map -def register_command(name, func): - built_in_cmds[name] = func - - -# Register all built-in commands here -def init(): - register_command("cd", cd) - - -def main(): - # Init shell before starting the main loop - init() - shell_loop() -``` - -我们定义了 `register_command` 函数,以添加一个内置函数到我们内置的命令哈希映射。接着,我们定义 `init` 函数并且在这里注册内置的 `cd` 函数。 - -注意这行 `register_command("cd", cd)` 。第一个参数为命令的名字。第二个参数为一个函数引用。为了能够让第二个参数 `cd` 引用到 `yosh/builtins/cd.py` 中的 `cd` 函数引用,我们必须将以下这行代码放在 `yosh/builtins/__init__.py` 文件中。 - -``` -from yosh.builtins.cd import * -``` - -因此,在 `yosh/shell.py` 中,当我们从 `yosh.builtins` 导入 `*` 时,我们可以得到已经通过 `yosh.builtins` 导入的 `cd` 函数引用。 - -我们已经准备好了代码。让我们尝试在 `yosh` 同级目录下以模块形式运行我们的 shell,`python -m yosh.shell`。 - -现在,`cd` 命令可以正确修改我们的 shell 目录了,同时非内置命令仍然可以工作。非常好! - -#### exit - -最后一块终于来了:优雅地退出。 - -我们需要一个可以修改 shell 状态为 `SHELL_STATUS_STOP` 的函数。这样,shell 循环可以自然地结束,shell 将到达终点而退出。 - -和 `cd` 一样,如果我们在子进程中 fork 和执行 `exit` 函数,其对父进程是不起作用的。因此,`exit` 函数需要成为一个 shell 内置函数。 - -让我们从这开始:在 `builtins` 目录下创建一个名为 `exit.py` 的新文件。 - -``` -yosh_project -|-- yosh - |-- builtins - | |-- __init__.py - | |-- cd.py - | |-- exit.py - |-- __init__.py - |-- constants.py - |-- shell.py -``` - -`exit.py` 定义了一个 `exit` 函数,该函数仅仅返回一个可以退出主循环的状态。 - -``` -from yosh.constants import * - - -def exit(args): - return SHELL_STATUS_STOP -``` - -然后,我们导入位于 `yosh/builtins/__init__.py` 文件的 `exit` 函数引用。 - -``` -from yosh.builtins.cd import * -from yosh.builtins.exit import * -``` - -最后,我们在 `shell.py` 中的 `init()` 函数注册 `exit` 命令。 - - -``` -... - -# Register all built-in commands here -def init(): - register_command("cd", cd) - register_command("exit", exit) - -... -``` - -到此为止! - -尝试执行 `python -m yosh.shell`。现在你可以输入 `exit` 优雅地退出程序了。 - -### 最后的想法 - -我希望你能像我一样享受创建 `yosh` (**y**our **o**wn **sh**ell)的过程。但我的 `yosh` 版本仍处于早期阶段。我没有处理一些会使 shell 崩溃的极端状况。还有很多我没有覆盖的内置命令。为了提高性能,一些非内置命令也可以实现为内置命令(避免新进程创建时间)。同时,大量的功能还没有实现(请看 [公共特性](http://tldp.org/LDP/Bash-Beginners-Guide/html/x7243.html) 和 [不同特性](http://www.tldp.org/LDP/intro-linux/html/x12249.html)) - -我已经在 github.com/supasate/yosh 中提供了源代码。请随意 fork 和尝试。 - -现在该是创建你真正自己拥有的 Shell 的时候了。 - -Happy Coding! - --------------------------------------------------------------------------------- - -via: https://hackercollider.com/articles/2016/07/06/create-your-own-shell-in-python-part-2/ - -作者:[Supasate Choochaisri][a] -译者:[cposture](https://github.com/cposture) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://disqus.com/by/supasate_choochaisri/ -[1]: https://hackercollider.com/articles/2016/07/05/create-your-own-shell-in-python-part-1/ -[2]: http://tldp.org/LDP/Bash-Beginners-Guide/html/x7243.html -[3]: http://www.tldp.org/LDP/intro-linux/html/x12249.html -[4]: https://github.com/supasate/yosh From b0f2444bf204778cf530e20037c2b5e4458a3075 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 6 Aug 2016 18:24:41 +0800 Subject: [PATCH 1368/1469] PUB:20160715 bc - Command line calculator @FSSlc --- .../20160715 bc - Command line calculator.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) rename {translated/tech => published}/20160715 bc - Command line calculator.md (57%) diff --git a/translated/tech/20160715 bc - Command line calculator.md b/published/20160715 bc - Command line calculator.md similarity index 57% rename from translated/tech/20160715 bc - Command line calculator.md rename to published/20160715 bc - Command line calculator.md index d5dc711909..bf96f9c464 100644 --- a/translated/tech/20160715 bc - Command line calculator.md +++ b/published/20160715 bc - Command line calculator.md @@ -3,11 +3,11 @@ bc : 一个命令行计算器 ![](https://cdn.fedoramagazine.org/wp-content/uploads/2016/07/bc-calculator-945x400.jpg) -假如你运行在一个图形桌面环境中,当你需要一个计算器时,你可能只需要一路进行点击便可以找到一个计算器。例如,Fedora 工作站中就已经包含了一个名为 `Calculator` 的工具。它有着几种不同的操作模式,例如,你可以进行复杂的数学运算或者金融运算。但是,你知道吗,命令行也提供了一个与之相似的名为 `bc` 的工具? +假如你在一个图形桌面环境中需要一个计算器时,你可能只需要一路进行点击便可以找到一个计算器。例如,Fedora 工作站中就已经包含了一个名为 `Calculator` 的工具。它有着几种不同的操作模式,例如,你可以进行复杂的数学运算或者金融运算。但是,你知道吗,命令行也提供了一个与之相似的名为 `bc` 的工具? -`bc` 工具可以为你提供你期望一个科学计算器、金融计算器或者是简单的计算器所能提供的所有功能。另外,假如需要的话,它还可以从命令行中被脚本化。这使得当你需要做复杂的数学运算时,你可以在 shell 脚本中使用它。 +`bc` 工具可以为你提供的功能可以满足你对科学计算器、金融计算器或者是简单计算器的期望。另外,假如需要的话,它还可以从命令行中被脚本化。这使得当你需要做复杂的数学运算时,你可以在 shell 脚本中使用它。 -因为 bc 被其他的系统软件所使用,例如 CUPS 打印服务,它可能已经在你的 Fedora 系统中被安装了。你可以使用下面这个命令来进行检查: +因为 bc 也被用于其他的系统软件,例如 CUPS 打印服务,所以它可能已经在你的 Fedora 系统中被安装了。你可以使用下面这个命令来进行检查: ``` dnf list installed bc @@ -21,7 +21,7 @@ sudo dnf install bc ### 用 bc 做一些简单的数学运算 -使用 bc 的一种方式是进入它自己的 shell。在那里你可以在一行中做许多次计算。但在你键入 bc 后,首先出现的是有关这个程序的警告: +使用 bc 的一种方式是进入它自己的 shell。在那里你可以按行进行许多次计算。当你键入 bc 后,首先出现的是有关这个程序的警告: ``` $ bc @@ -43,16 +43,16 @@ bc 会回答上面计算式的答案是: 2 ``` -在这里你还可以执行其他的命令。你可以使用 加(+)、减(-)、乘(*)、除(/)、圆括号、指数符号(^) 等等。请注意 bc 同样也遵循所有约定俗成的运算规定,例如运算的先后顺序。你可以试试下面的例子: +在这里你还可以执行其他的命令。你可以使用 加(+)、减(-)、乘(*)、除(/)、圆括号、指数符号(\^) 等等。请注意 bc 同样也遵循所有约定俗成的运算规则,例如运算的先后顺序。你可以试试下面的例子: ``` (4+7)*2 4+7*2 ``` -若要离开 bc 可以通过按键组合 `Ctrl+D` 来发送 “输入结束”信号给 bc 。 +若要退出 bc 可以通过按键组合 `Ctrl+D` 来发送 “输入结束”信号给 bc 。 -使用 bc 的另一种方式是使用 `echo` 命令来传递运算式或命令。下面这个示例类似于计算器中的 "Hello, world" 例子,使用 shell 的管道函数(|) 来将 `echo` 的输出传入 `bc` 中: +使用 bc 的另一种方式是使用 `echo` 命令来传递运算式或命令。下面这个示例就是计算器中的 “Hello, world” 例子,使用 shell 的管道函数(|) 来将 `echo` 的输出传入 `bc` 中: ``` echo '1+1' | bc @@ -88,7 +88,7 @@ echo '7-4.15' | bc ### 其他进制系统 -bc 的另一个有用的功能是可以使用除 十进制以外的其他计数系统。例如,你可以轻松地做十六进制或二进制的数学运算。可以使用 `ibase` 和 `obase` 命令来分别设定输入和输出的进制系统。需要记住的是一旦你使用了 `ibase`,之后你输入的任何数字都将被认为是在新定义的进制系统中。 +bc 的另一个有用的功能是可以使用除了十进制以外的其他计数系统。例如,你可以轻松地做十六进制或二进制的数学运算。可以使用 `ibase` 和 `obase` 命令来分别设定输入和输出的进制系统。需要记住的是一旦你使用了 `ibase`,之后你输入的任何数字都将被认为是在新定义的进制系统中。 要做十六进制数到十进制数的转换或运算,你可以使用类似下面的命令。请注意大于 9 的十六进制数必须是大写的(A-F): @@ -103,7 +103,7 @@ echo 'ibase=16; 5F72+C39B' | bc echo 'obase=16; ibase=16; 5F72+C39B' | bc ``` -下面是一个小技巧。假如你在 shell 中做这些运算,怎样才能使得输入重新为十进制数呢?答案是使用 `ibase` 命令,但你必须设定它为在当前进制中与十进制中的 10 等价的值。例如,假如 `ibase` 被设定为十六进制,你需要输入: +下面是一个小技巧。假如你在 shell 中做这些十六进制运算,怎样才能使得输入重新为十进制数呢?答案是使用 `ibase` 命令,但你必须设定它为在当前进制中与十进制中的 10 等价的值。例如,假如 `ibase` 被设定为十六进制,你需要输入: ``` ibase=A @@ -117,11 +117,11 @@ ibase=A -------------------------------------------------------------------------------- -via: http://www.tecmint.com/mandatory-access-control-with-selinux-or-apparmor-linux/ +via: https://fedoramagazine.org/bc-command-line-calculator/ 作者:[Paul W. Frields][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 b45e17341fe8ea717b7710133299c85022b5bb81 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 6 Aug 2016 18:42:44 +0800 Subject: [PATCH 1369/1469] PUB:Part 9 - Learn How to Use Awk Special Patterns begin and end @ChrisLeeGit --- ... Use Awk Special Patterns begin and end.md | 40 ++++++++++--------- 1 file changed, 21 insertions(+), 19 deletions(-) rename translated/tech/awk/20160719 Part 9 - Learn How to Use Awk Special Patterns begin and end.md => published/awk/Part 9 - Learn How to Use Awk Special Patterns begin and end.md (78%) diff --git a/translated/tech/awk/20160719 Part 9 - Learn How to Use Awk Special Patterns begin and end.md b/published/awk/Part 9 - Learn How to Use Awk Special Patterns begin and end.md similarity index 78% rename from translated/tech/awk/20160719 Part 9 - Learn How to Use Awk Special Patterns begin and end.md rename to published/awk/Part 9 - Learn How to Use Awk Special Patterns begin and end.md index 378811776a..5791ffb0f9 100644 --- a/translated/tech/awk/20160719 Part 9 - Learn How to Use Awk Special Patterns begin and end.md +++ b/published/awk/Part 9 - Learn How to Use Awk Special Patterns begin and end.md @@ -21,8 +21,7 @@ awk 系列:如何使用 awk 的特殊模式 BEGIN 和 END /pattern/ { actions } ``` -当你看脚本中的模式(`/pattern`)时,你会发现它通常是一个正则表达式,此外,你也可以将模式(`/pattern`)当成特殊模式 `BEGIN` 和 `END`。 -因此,我们也能按照下面的形式编写一条 awk 命令: +你通常会发现脚本中的模式(`/pattern/`)是一个正则表达式,不过你也可以将模式使用特殊模式 `BEGIN` 和 `END`。因此,我们也能按照下面的形式编写一条 awk 命令: ``` awk ' @@ -41,11 +40,11 @@ END { actions } 含有这些特殊模式的 awk 命令脚本的执行流程如下: -- 当在脚本中使用了 `BEGIN` 模式,则 `BEGIN` 中所有的动作都会在读取任何输入行之前执行。 -- 然后,读入一个输入行并解析成不同的段。 -- 接下来,每一条指定的非特殊模式都会和输入行进行比较匹配,当匹配成功后,就会执行模式对应的动作。对所有你指定的模式重复此执行该步骤。 -- 再接下来,对于所有输入行重复执行步骤 2 和 步骤 3。 -- 当读取并处理完所有输入行后,假如你指定了 `END` 模式,那么将会执行相应的动作。 +1. 当在脚本中使用了 `BEGIN` 模式,则 `BEGIN` 中所有的动作都会在读取任何输入行之前执行。 +2. 然后,读入一个输入行并解析成不同的段。 +3. 接下来,每一条指定的非特殊模式都会和输入行进行比较匹配,当匹配成功后,就会执行模式对应的动作。对所有你指定的模式重复此执行该步骤。 +4. 再接下来,对于所有输入行重复执行步骤 2 和 步骤 3。 +5. 当读取并处理完所有输入行后,假如你指定了 `END` 模式,那么将会执行相应的动作。 当你使用特殊模式时,想要在 awk 操作中获得最好的结果,你应当记住上面的执行顺序。 @@ -73,7 +72,8 @@ $ cat ~/domains.txt ``` ![](http://www.tecmint.com/wp-content/uploads/2016/07/View-Contents-of-File.png) -> 查看文件内容 + +*查看文件内容* 在这个例子中,我们希望统计出 domains.txt 文件中域名 `tecmint.com` 出现的次数。所以,我们编写了一个简单的 shell 脚本帮助我们完成任务,它使用了变量、数学表达式和赋值运算符的思想,脚本内容如下: @@ -81,16 +81,16 @@ $ cat ~/domains.txt #!/bin/bash for file in $@; do if [ -f $file ] ; then -# 输出文件名 +### 输出文件名 echo "File is: $file" -# 输出一个递增的数字记录包含 tecmint.com 的行数 +### 输出一个递增的数字记录包含 tecmint.com 的行数 awk '/^tecmint.com/ { counter+=1 ; printf "%s\n", counter ; }' $file else -# 若输入不是文件,则输出错误信息 +### 若输入不是文件,则输出错误信息 echo "$file 不是一个文件,请指定一个文件。" >&2 && exit 1 fi done -# 成功执行后使用退出代码 0 终止脚本 +### 成功执行后使用退出代码 0 终止脚本 exit 0 ``` @@ -117,24 +117,25 @@ END { printf "%s\n", counter ; } #!/bin/bash for file in $@; do if [ -f $file ] ; then -# 输出文件名 +### 输出文件名 echo "File is: $file" -# 输出文件中 tecmint.com 出现的总次数 +### 输出文件中 tecmint.com 出现的总次数 awk ' BEGIN { print "文件中出现 tecmint.com 的次数是:" ; } /^tecmint.com/ { counter+=1 ; } END { printf "%s\n", counter ; } ' $file else -# 若输入不是文件,则输出错误信息 +### 若输入不是文件,则输出错误信息 echo "$file 不是一个文件,请指定一个文件。" >&2 && exit 1 fi done -# 成功执行后使用退出代码 0 终止脚本 +### 成功执行后使用退出代码 0 终止脚本 exit 0 ``` ![](http://www.tecmint.com/wp-content/uploads/2016/07/Awk-BEGIN-and-END-Patterns.png) -> awk 模式 BEGIN 和 END + +*awk 模式 BEGIN 和 END* 当我们运行上面的脚本时,它会首先输出 domains.txt 文件的位置,然后执行 awk 命令脚本,该命令脚本中的特殊模式 `BEGIN` 将会在从文件读取任何行之前帮助我们输出这样的消息“`文件中出现 tecmint.com 的次数是:`”。 @@ -146,7 +147,8 @@ exit 0 $ ./script.sh ~/domains.txt ``` ![](http://www.tecmint.com/wp-content/uploads/2016/07/Script-to-Count-Number-of-Times-String-Appears.png) -> 用于统计字符串出现次数的脚本 + +*用于统计字符串出现次数的脚本* 最后总结一下,我们在本节中演示了更多的 awk 功能,并学习了特殊模式 `BEGIN` 和 `END` 的概念。 @@ -159,7 +161,7 @@ via: http://www.tecmint.com/learn-use-awk-special-patterns-begin-and-end/ 作者:[Aaron Kili][a] 译者:[ChrisLeeGit](https://github.com/chrisleegit) -校对:[校对ID](https://github.com/校对ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1200da79093ba4c9085703508a3b5d4b064c6577 Mon Sep 17 00:00:00 2001 From: ChrisLeeGit Date: Sat, 6 Aug 2016 22:03:19 +0800 Subject: [PATCH 1370/1469] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=20Part=2011=20-=20How=20to=20Allow=20Awk=20to=20Use=20Shell=20?= =?UTF-8?q?Variables?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...How to Allow Awk to Use Shell Variables.md | 97 ------------------- ...How to Allow Awk to Use Shell Variables.md | 95 ++++++++++++++++++ 2 files changed, 95 insertions(+), 97 deletions(-) delete mode 100644 sources/tech/awk/20160802 Part 11 - How to Allow Awk to Use Shell Variables.md create mode 100644 translated/tech/awk/20160802 Part 11 - How to Allow Awk to Use Shell Variables.md diff --git a/sources/tech/awk/20160802 Part 11 - How to Allow Awk to Use Shell Variables.md b/sources/tech/awk/20160802 Part 11 - How to Allow Awk to Use Shell Variables.md deleted file mode 100644 index 5930cadb64..0000000000 --- a/sources/tech/awk/20160802 Part 11 - How to Allow Awk to Use Shell Variables.md +++ /dev/null @@ -1,97 +0,0 @@ -Being translated by ChrisLeeGit - -How to Allow Awk to Use Shell Variables – Part 11 -================================================== - -When we write shell scripts, we normally include other smaller programs or commands such as Awk operations in our scripts. In the case of Awk, we have to find ways of passing some values from the shell to Awk operations. - -This can be done by using shell variables within Awk commands, and in this part of the series, we shall learn how to allow Awk to use shell variables that may contain values we want to pass to Awk commands. - -There possibly two ways you can enable Awk to use shell variables: - -### 1. Using Shell Quoting - -Let us take a look at an example to illustrate how you can actually use shell quoting to substitute the value of a shell variable in an Awk command. In this example, we want to search for a username in the file /etc/passwd, filter and print the user’s account information. - -Therefore, we can write a `test.sh` script with the following content: - -``` -#!/bin/bash - -#read user input -read -p "Please enter username:" username - -#search for username in /etc/passwd file and print details on the screen -cat /etc/passwd | awk "/$username/ "' { print $0 }' -``` - -Thereafter, save the file and exit. - -Interpretation of the Awk command in the test.sh script above: - -``` -cat /etc/passwd | awk "/$username/ "' { print $0 }' -``` - -`"/$username/ "` – shell quoting used to substitute value of shell variable username in Awk command. The value of username is the pattern to be searched in the file /etc/passwd. - -Note that the double quote is outside the Awk script, `‘{ print $0 }’`. - -Then make the script executable and run it as follows: - -``` -$ chmod +x test.sh -$ ./text.sh -``` - -After running the script, you will be prompted to enter a username, type a valid username and hit Enter. You will view the user’s account details from the /etc/passwd file as below: - -![](http://www.tecmint.com/wp-content/uploads/2016/08/Shell-Script-to-Find-Username-in-Passwd-File.png) ->Shell Script to Find Username in Password File - -### 2. Using Awk’s Variable Assignment - -This method is much simpler and better in comparison to method one above. Considering the example above, we can run a simple command to accomplish the job. Under this method, we use the -v option to assign a shell variable to a Awk variable. - -Firstly, create a shell variable, username and assign it the name that we want to search in the /etc/passswd file: - -``` -username="aaronkilik" -``` - -Then type the command below and hit Enter: - -``` -# cat /etc/passwd | awk -v name="$username" ' $0 ~ name {print $0}' -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/08/Find-Username-in-Password-File-Using-Awk.png) ->Find Username in Password File Using Awk - -Explanation of the above command: - -- `-v` – Awk option to declare a variable -- `username` – is the shell variable -- `name` – is the Awk variable -Let us take a careful look at `$0 ~ name` inside the Awk script, `' $0 ~ name {print $0}'`. Remember, when we covered Awk comparison operators in Part 4 of this series, one of the comparison operators was value ~ pattern, which means: true if value matches the pattern. - -The `output($0)` of cat command piped to Awk matches the pattern `(aaronkilik)` which is the name we are searching for in /etc/passwd, as a result, the comparison operation is true. The line containing the user’s account information is then printed on the screen. - -### Conclusion - -We have covered an important section of Awk features, that can help us use shell variables within Awk commands. Many times, you will write small Awk programs or commands within shell scripts and therefore, you need to have a clear understanding of how to use shell variables within Awk commands. - -In the next part of the Awk series, we shall dive into yet another critical section of Awk features, that is flow control statements. So stay tunned and let’s keep learning and sharing. - - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/use-shell-script-variable-in-awk/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tecmint+%28Tecmint%3A+Linux+Howto%27s+Guide%29 - -作者:[Aaron Kili][a] -译者:[ChrisLeeGit](https://github.com/chrisleegit) -校对:[校对ID](https://github.com/校对ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://www.tecmint.com/author/aaronkili/ diff --git a/translated/tech/awk/20160802 Part 11 - How to Allow Awk to Use Shell Variables.md b/translated/tech/awk/20160802 Part 11 - How to Allow Awk to Use Shell Variables.md new file mode 100644 index 0000000000..e4ec78abd4 --- /dev/null +++ b/translated/tech/awk/20160802 Part 11 - How to Allow Awk to Use Shell Variables.md @@ -0,0 +1,95 @@ +awk 系列:如何让 awk 使用 Shell 变量 +================================================== + +当我们编写 shell 脚本时,我们通常会在脚本中包含其它小程序或命令,例如 awk 操作。对于 awk 而言,我们需要找一些将某些值从 shell 传递到 awk 操作中的方法。 + +我们可以通过在 awk 命令中使用 shell 变量达到目的,在 awk 系列的这一节中,我们将学习如何让 awk 使用 shell 变量,这些变量可能包含我们希望传递给 awk 命令的值。 + +有两种可能的方法可以让 awk 使用 shell 变量: + +### 1. 使用 Shell 引用 + +让我们用一个示例来演示如何在一条 awk 命令中使用 shell 引用替代一个 shell 变量。在该示例中,我们希望在文件 /etc/passwd 中搜索一个用户名,过滤并输出用户的账户信息。 + +因此,我们可以编写一个 `test.sh` 脚本,内容如下: + +``` +#!/bin/bash + +# 读取用户名 +read -p "请输入用户名:" username + +# 在 /etc/passwd 中搜索用户名,然后在屏幕上输出详细信息 +cat /etc/passwd | awk "/$username/ "' { print $0 }' +``` + +然后,保存文件并退出。 + +上述 `test.sh` 脚本中 awk 命令的说明: + +``` +cat /etc/passwd | awk "/$username/ "' { print $0 }' +``` + +`"/$username/ "`:在 awk 命令中使用 shell 引用来替代 shell 变量 `username` 的值。`username` 的值就是要在文件 /etc/passwd 中搜索的模式。 + +注意,双引号位于 awk 脚本 `'{ print $0 }'` 之外。 + +接下来给脚本添加可执行权限并运行它,操作如下: + +``` +$ chmod +x test.sh +$ ./text.sh +``` + +运行脚本后,它会提示你输入一个用户名,然后你输入一个合法的用户名并回车。你将会看到来自 /etc/passwd 文件中详细的用户账户信息,如下图所示: + +![](http://www.tecmint.com/wp-content/uploads/2016/08/Shell-Script-to-Find-Username-in-Passwd-File.png) +> *在 Password 文件中查找用户名的 shell 脚本* + +### 2. 使用 awk 进行变量赋值 + +和上面介绍的方法相比,该方法更加单,并且更好。考虑上面的示例,我们可以运行一条简单的命令来完成同样的任务。 +在该方法中,我们使用 `-v` 选项将一个 shell 变量的值赋给一个 awk 变量。 +首先,创建一个 shell 变量 `username`,然后给它赋予一个我们希望在 /etc/passwd 文件中搜索的名称。 + +``` +username="aaronkilik" +``` +然后输入下面的命令并回车: + +``` +# cat /etc/passwd | awk -v name="$username" ' $0 ~ name {print $0}' +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/08/Find-Username-in-Password-File-Using-Awk.png) +> *使用 awk 在 Password 文件中查找用户名* + +上述命令的说明: + +- `-v`:awk 选项之一,用于声明一个变量 +- `username`:是 shell 变量 +- `name`:是 awk 变量 + +让我们仔细瞧瞧 awk 脚本 `' $0 ~ name {print $0}'` 中的 `$0 ~ name`。还记得么,当我们在 awk 系列第四节中介绍 awk 比较运算符时,`value ~ pattern` 便是比较运算符之一,它是指:如果 `value` 匹配了 `pattern` 则返回 `true`。 + +cat 命令通过管道传给 awk 的 `output($0)` 与模式 `(aaronkilik)` 匹配,该模式即为我们在 /etc/passwd 中搜索的名称,最后,比较操作返回 `true`。接下来会在屏幕上输出包含用户账户信息的行。 + +### 结论 + +我们已经介绍了 awk 功能的一个重要部分,它能帮助我们在 awk 命令中使用 shell 变量。很多时候,你都会在 shell 脚本中编写小的 awk 程序或命令,因此,你需要清晰地理解如何在 awk 命令中使用 shell 变量。 + +在 awk 系列的下一个部分,我们将会深入学习 awk 功能的另外一个关键部分,即流程控制语句。所以请继续保持关注,并让我们坚持学习与分享。 + + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/use-shell-script-variable-in-awk/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tecmint+%28Tecmint%3A+Linux+Howto%27s+Guide%29 + +作者:[Aaron Kili][a] +译者:[ChrisLeeGit](https://github.com/chrisleegit) +校对:[校对ID](https://github.com/校对ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.tecmint.com/author/aaronkili/ From 4b2273b2da59f601ec0a48010b348c0c8fb41c07 Mon Sep 17 00:00:00 2001 From: vim-kakali <1799225723@qq.com> Date: Sat, 6 Aug 2016 23:56:44 +0800 Subject: [PATCH 1371/1469] =?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 --- ...ce portfolio - Machine learning project.md | 64 +++++++++---------- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/sources/team_test/part 4 - Building a data science portfolio - Machine learning project.md b/sources/team_test/part 4 - Building a data science portfolio - Machine learning project.md index a9af49b188..9e6aa7c1fe 100644 --- a/sources/team_test/part 4 - Building a data science portfolio - Machine learning project.md +++ b/sources/team_test/part 4 - Building a data science portfolio - Machine learning project.md @@ -1,44 +1,42 @@ -vim-kakali translating +### 计算运用数据中的值 +接下来我们会计算过程数据或运用数据中的值。我们要做的就是推测这些数据代表的贷款是否被收回。如果能够计算出来,我们只要看一下包含贷款的运用数据的参数 foreclosure_date 就可以了。如果这个参数的值是 None ,那么这些贷款肯定没有收回。为了避免我们的样例中存在少量的运用数据,我们会计算出运用数据中有贷款数据的行的行数。这样我们就能够从我们的训练数据中筛选出贷款数据,排除了一些运用数据。 -### Computing values from the performance data - -The next step we’ll take is to calculate some values from processed/Performance.txt. All we want to do is to predict whether or not a property is foreclosed on. To figure this out, we just need to check if the performance data associated with a loan ever has a foreclosure_date. If foreclosure_date is None, then the property was never foreclosed on. In order to avoid including loans with little performance history in our sample, we’ll also want to count up how many rows exist in the performance file for each loan. This will let us filter loans without much performance history from our training data. - -One way to think of the loan data and the performance data is like this: +下面是一种区分贷款数据和运用数据的方法: ![](https://github.com/LCTT/wiki-images/blob/master/TranslateProject/ref_img/001.png) -As you can see above, each row in the Acquisition data can be related to multiple rows in the Performance data. In the Performance data, foreclosure_date will appear in the quarter when the foreclosure happened, so it should be blank prior to that. Some loans are never foreclosed on, so all the rows related to them in the Performance data have foreclosure_date blank. -We need to compute foreclosure_status, which is a Boolean that indicates whether a particular loan id was ever foreclosed on, and performance_count, which is the number of rows in the performance data for each loan id. +在上面的表格中,采集数据中的每一行数据都与运用数据中的多行数据有联系。在运用数据中,在收回贷款的时候 foreclosure_date 就会以季度的的形式显示出收回时间,而且它会在该行数据的最前面显示一个空格。一些贷款没有收回,所以与运用数据中的贷款数据有关的行都会在前面出现一个表示 foreclosure_date 的空格。 -There are a few different ways to compute the counts we want: +我们需要计算 foreclosure_status 的值,它的值是布尔类型,可以表示一个特殊的贷款数据 id 是否被收回过,还有一个参数 performance_count ,它记录了运用数据中每个贷款 id 出现的行数。  -- We could read in all the performance data, then use the Pandas groupby method on the DataFrame to figure out the number of rows associated with each loan id, and also if the foreclosure_date is ever not None for the id. - - The upside of this method is that it’s easy to implement from a syntax perspective. - - The downside is that reading in all 129236094 lines in the data will take a lot of memory, and be extremely slow. -- We could read in all the performance data, then use apply on the acquisition DataFrame to find the counts for each id. - - The upside is that it’s easy to conceptualize. - - The downside is that reading in all 129236094 lines in the data will take a lot of memory, and be extremely slow. -- We could iterate over each row in the performance dataset, and keep a separate dictionary of counts. - - The upside is that the dataset doesn’t need to be loaded into memory, so it’s extremely fast and memory-efficient. - - The downside is that it will take slightly longer to conceptualize and implement, and we need to parse the rows manually. +计算这些行数有多种不同的方法: -Loading in all the data will take quite a bit of memory, so let’s go with the third option above. All we need to do is to iterate through all the rows in the Performance data, while keeping a dictionary of counts per loan id. In the dictionary, we’ll keep track of how many times the id appears in the performance data, as well as if foreclosure_date is ever not None. This will give us foreclosure_status and performance_count. +- 我们能够读取所有的运用数据,然后我们用 Pandas 的 groupby 方法在数据框中计算出与每个贷款 id 有关的行的行数,然后就可以查看贷款 id 的 foreclosure_date 值是否为 None 。 +    - 这种方法的优点是从语法上来说容易执行。 +    - 它的缺点需要读取所有的 129236094 行数据,这样就会占用大量内存,并且运行起来极慢。 +- 我们可以读取所有的运用数据,然后使用采集到的数据框去计算每个贷款 id 出现的次数。 +    - 这种方法的优点是容易理解。 +    - 缺点是需要读取所有的 129236094 行数据。这样会占用大量内存,并且运行起来极慢。 +- 我们可以在迭代访问运用数据中的每一行数据,而且会建立一个区分开的计数字典。 + - 这种方法的优点是数据不需要被加载到内存中,所以运行起来会很快且不需要占用内存。 +    - 缺点是这样的话理解和执行上可能有点耗费时间,我们需要对每一行数据进行语法分析。 -We’ll create a new file called annotate.py, and add in code that will enable us to compute these values. In the below code, we’ll: +加载所有的数据会非常耗费内存,所以我们采用第三种方法。我们要做的就是迭代运用数据中的每一行数据,然后为每一个贷款 id 生成一个字典值。在这个字典中,我们会计算出贷款 id 在运用数据中出现的次数,而且如果 foreclosure_date 不是 Nnoe 。我们可以查看 foreclosure_status 和 performance_count 的值 。 -- Import needed libraries. -- Define a function called count_performance_rows. - - Open processed/Performance.txt. This doesn’t read the file into memory, but instead opens a file handler that can be used to read in the file line by line. - - Loop through each line in the file. - - Split the line on the delimiter (|) - - Check if the loan_id is not in the counts dictionary. - - If not, add it to counts. - - Increment performance_count for the given loan_id because we’re on a row that contains it. - - If date is not None, then we know that the loan was foreclosed on, so set foreclosure_status appropriately. +我们会新建一个 annotate.py 文件,文件中的代码可以计算这些值。我们会使用下面的代码: + +- 导入需要的库 +- 定义一个函数 count_performance_rows 。 + - 打开 processed/Performance.txt 文件。这不是在内存中读取文件而是打开了一个文件标识符,这个标识符可以用来以行为单位读取文件。  + - 迭代文件的每一行数据。 + - 使用分隔符(|)分开每行的不同数据。 + - 检查 loan_id 是否在计数字典中。 + - 如果不存在,进行一次计数。 + - loan_id 的 performance_count 参数自增 1 次,因为我们这次迭代也包含其中。 + - 如果日期是 None ,我们就会知道贷款被收回了,然后为foreclosure_status 设置合适的值。 ``` import os @@ -65,9 +63,9 @@ def count_performance_rows(): return counts ``` -### Getting the values +### 获取值 -Once we create our counts dictionary, we can make a function that will extract values from the dictionary if a loan_id and a key are passed in: +只要我们创建了计数字典,我们就可以使用一个函数通过一个 loan_id 和一个 key 从字典中提取到需要的参数的值: ``` def get_performance_summary_value(loan_id, key, counts): @@ -78,7 +76,7 @@ def get_performance_summary_value(loan_id, key, counts): return value[key] ``` -The above function will return the appropriate value from the counts dictionary, and will enable us to assign a foreclosure_status value and a performance_count value to each row in the Acquisition data. The [get][33] method on dictionaries returns a default value if a key isn’t found, so this enables us to return sensible default values if a key isn’t found in the counts dictionary. - + +上面的函数会从计数字典中返回合适的值,我们也能够为采集数据中的每一行赋一个 foreclosure_status 值和一个 performance_count 值。如果键不存在,字典的 [get][33] 方法会返回一个默认值,所以在字典中不存在键的时候我们就可以得到一个可知的默认值。 From 4049083f78cfc68108e6a484c06ddbb0b678b83b Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 7 Aug 2016 08:40:08 +0800 Subject: [PATCH 1372/1469] PUB:20160506 Linus Torvalds Talks IoT Smart Devices Security Concerns and More @vim-kakali --- ...mart Devices Security Concerns and More.md | 49 +++++++++++++++++++ ...mart Devices Security Concerns and More.md | 48 ------------------ 2 files changed, 49 insertions(+), 48 deletions(-) create mode 100644 published/20160506 Linus Torvalds Talks IoT Smart Devices Security Concerns and More.md delete mode 100644 translated/talk/20160506 Linus Torvalds Talks IoT Smart Devices Security Concerns and More.md diff --git a/published/20160506 Linus Torvalds Talks IoT Smart Devices Security Concerns and More.md b/published/20160506 Linus Torvalds Talks IoT Smart Devices Security Concerns and More.md new file mode 100644 index 0000000000..78af0dc3de --- /dev/null +++ b/published/20160506 Linus Torvalds Talks IoT Smart Devices Security Concerns and More.md @@ -0,0 +1,49 @@ +Linus Torvalds 谈及物联网、智能设备、安全连接等问题 +=========================================================================== + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/elc-linus-b.jpg?itok=6WwnCSjL) + +*Dirk Hohndel 在嵌入式大会上采访 Linus Torvalds 。* + + +4 月 4 日到 6 日,在圣迭戈召开的[嵌入式 Linux 大会(Embedded Linux Conference)][0](ELC) 从首次举办到现在已经有 11 年了,该会议包括了与 Linus Torvalds 的主题讨论。作为 Linux 内核的缔造者和最高决策者——用采访他的英特尔 Linux 和开源技术总监 Dirk Hohndel 的话说,“(他是)我们聚在一起的理由”——他对 Linux 在嵌入式和物联网应用程序领域的发展表示乐观。Torvalds 很明确地力挺了嵌入式 Linux,它被 Linux 桌面、服务器和云技术这些掩去光芒已经很多年了。 + +![](https://www.linux.com/sites/lcom/files/styles/floated_images/public/elc-linus_0.jpg?itok=FNPIDe8k) + +*Linus Torvalds 在嵌入式 Linux 大会上的演讲。* + +物联网是嵌入式大会的主题,在 OpenIoT 峰会讲演中谈到了,在 Torvalds 的访谈中也是主要话题。 + +Torvalds 对 Hohndel 说到,“或许你不会在物联网末端设备上看到 Linux 的影子,但是在你有一个中心设备的时候,你就会需要它。尤其是物联网标准都有 23 个的时候,你就更需要智能设备了。如果你全部使用的是低级设备,它们没必要一定运行 Linux;如果它们采用的标准稍有差异,你就需要很多的智能设备。我们将来也不会有一个完全开放的标准来将这些物联网设备统一到一起,但是我们会有 3/4 的主要协议是一样的,然后那些智能的中心设备就可以对它们进行互相转换。” + +当 Hohndel 问及在物联网的巨大安全漏洞的时候,Torvalds 神情如常。他说:“我不担心安全问题因为我们能做的不是很多,物联网(设备)是不能更新的,这是我们面对的事实。" + +Linux 缔造者看起来更关心的是一次性嵌入式项目缺少对上游的及时贡献,尽管他注意到近年来这些有了一些显著改善,特别是在硬件整合方面。 + +“嵌入式领域历来就很难与开源开发者有所联系,但是我认为这些都在发生改变。”Torvalds 说:“ARM 社区变得越来越好了。内核维护者实际上现在也能跟上了一些硬件的更新换代。一切都在变好,但是还不够。” + +Torvalds 承认他在家经常使用桌面系统而不是嵌入式系统,并且对硬件不是很熟悉。 + +“我已经用电烙铁弄坏了很多东西。”他说到。“我真的不适合搞硬件开发。”另一方面,Torvalds 设想如果他现在是个年轻人,他可能也在摆弄 Raspberry Pi 和 BeagleBone(猎兔犬板)。“最棒的是你不需要精通焊接,你只需要买个新的板子就行。” + +同时,Torvalds 也承诺他要为 Linux 桌面再奋斗一个 25 年。他笑着说:“我要为它工作一生。” + +下面,请看完整[视频](https://youtu.be/tQKUWkR-wtM)。 + + +要获取关于嵌入式 Linux 和物联网的最新信息,请访问 2016 年嵌入式 Linux 大会 150+ 分钟的会议全程。[现在观看][1]。 + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/linus-torvalds-talks-iot-smart-devices-security-concerns-and-more-video + +作者:[ERIC BROWN][a] +译者:[vim-kakali](https://github.com/vim-kakali) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/ericstephenbrown +[0]: http://events.linuxfoundation.org/events/embedded-linux-conference +[1]: http://go.linuxfoundation.org/elc-openiot-summit-2016-videos?utm_source=lf&utm_medium=blog&utm_campaign=linuxcom + diff --git a/translated/talk/20160506 Linus Torvalds Talks IoT Smart Devices Security Concerns and More.md b/translated/talk/20160506 Linus Torvalds Talks IoT Smart Devices Security Concerns and More.md deleted file mode 100644 index 876f84f68e..0000000000 --- a/translated/talk/20160506 Linus Torvalds Talks IoT Smart Devices Security Concerns and More.md +++ /dev/null @@ -1,48 +0,0 @@ - -Linus Torvalds 谈及物联网,智能设备,安全连接等问题[video] -=========================================================================== - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/elc-linus-b.jpg?itok=6WwnCSjL) ->Dirk Hohndel 在嵌入式大会上采访 Linus Torvalds 。 - - - [嵌入式大会(Embedded Linux Conference)][0] 从在 San Diego 【译注:圣迭戈,美国加利福尼亚州的一个太平洋沿岸城市。】开始举办到现在已经有 11 年了,在 4 月 4 日到 6 日,Linus Torvalds 加入了会议的主题讨论。他是 Linux 内核的缔造者和最高决策者,也是“我们都在这里的原因”,在采访他的对话中,英特尔的 Linux 和开源技术总监 Dirk Hohndel 谈到了 Linux 在嵌入式和物联网应用程序领域的快速发展前景。Torvalds 很少出席嵌入式 Linux 大会,这些大会经常被 Linux 桌面、服务器和云技术夺去光芒。 -![](https://www.linux.com/sites/lcom/files/styles/floated_images/public/elc-linus_0.jpg?itok=FNPIDe8k) ->Linus Torvalds 在嵌入式 Linux 大会上的演讲。 - - -物联网是嵌入式大会的主题,也包括未来开放物联网的最高发展方向(OpenIoT Summit),这是采访 Torvalds 的主要话题。 - -Torvalds 对 Hohndel 说到,“或许你不会在物联网设备上看到 Linux 的影子,但是在你有一个核心设备的时候,你就会需要它。你需要智能设备尤其在你有 23 [物联网标准]的时候。如果你全部使用低级设备,它们没必要一定运行 Linux ,它们采用的标准稍微有点不同,所以你需要很多智能设备。我们将来也不会有一个完全开放的标准,只是给它一个统一的标准,但是你将会需要 4 分之 3 的主要协议,它们都是这些智能核心的转化形式。” - -当 Hohndel 问及在物联网的巨大安全漏洞的时候, Torvalds 神情如常。他说:“我不担心安全问题因为我们能做的不是很多,物联网如果遭受攻击是无法挽回的-这是事实。" - -Linux 缔造者看起来更关心的是一次性的嵌入式项目缺少及时的上游贡献,尽管他注意到近年来这些都有一些本质上的提升,特别是在硬件上的发展。 - -Torvalds 说:”嵌入式领域历来就很难与开源开发者有所联系,但是我认为这些都在发生改变,ARM 团队也已经很优秀了。内核维护者事实上也看到了硬件性能的提升。一切都在变好,但是昨天却不是这样的。” - -Torvalds 承认他在家经常使用桌面系统而不是嵌入式系统,并且在使用硬件的时候他有“两只左手”。 - -“我已经用电烙铁弄坏了很多东西。”他说到。“我真的不适合搞硬件开发。”;另一方面,Torvalds 设想如果他现在是个年轻人,他可能被 Raspberry Pi(树莓派) 和 BeagleBone(猎兔犬板)【译注:Beagle板实际是由TI支持的一个以教育(STEP)为目的的开源项目】欺骗。“最主要是原因是如果你善于焊接,那么你就仅仅是买到了一个新的板子。” - -同时,Torvalds 也承诺他要为 Linux 桌面再奋斗一个 25 年。他笑着说:“我要为它工作一生。” - -下面,请看完整视频。 - -获取关于嵌入式 Linux 和物联网的最新信息。进入 2016 年嵌入式 Linux 大会 150+ 分钟的会议全程。[现在观看][1]. -[video](https://youtu.be/tQKUWkR-wtM) - --------------------------------------------------------------------------------- - -via: https://www.linux.com/news/linus-torvalds-talks-iot-smart-devices-security-concerns-and-more-video - -作者:[ERIC BROWN][a] -译者:[vim-kakali](https://github.com/vim-kakali) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.linux.com/users/ericstephenbrown -[0]: http://events.linuxfoundation.org/events/embedded-linux-conference -[1]: http://go.linuxfoundation.org/elc-openiot-summit-2016-videos?utm_source=lf&utm_medium=blog&utm_campaign=linuxcom - From 41d774bfe8ee0627ab16d039ae7d409f61e8b456 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 7 Aug 2016 08:40:43 +0800 Subject: [PATCH 1373/1469] PUB:20160727-How-to-use-multiple-connections-to-speed-up-apt-get on Ubuntu Linux 16.04 LTS server @geekpi --- ...pt-get on Ubuntu Linux 16.04 LTS server.md | 29 +++++++++---------- 1 file changed, 13 insertions(+), 16 deletions(-) rename {translated/tech => published}/20160727-How-to-use-multiple-connections-to-speed-up-apt-get on Ubuntu Linux 16.04 LTS server.md (78%) diff --git a/translated/tech/20160727-How-to-use-multiple-connections-to-speed-up-apt-get on Ubuntu Linux 16.04 LTS server.md b/published/20160727-How-to-use-multiple-connections-to-speed-up-apt-get on Ubuntu Linux 16.04 LTS server.md similarity index 78% rename from translated/tech/20160727-How-to-use-multiple-connections-to-speed-up-apt-get on Ubuntu Linux 16.04 LTS server.md rename to published/20160727-How-to-use-multiple-connections-to-speed-up-apt-get on Ubuntu Linux 16.04 LTS server.md index e36813cdc9..d60a04cf8a 100644 --- a/translated/tech/20160727-How-to-use-multiple-connections-to-speed-up-apt-get on Ubuntu Linux 16.04 LTS server.md +++ b/published/20160727-How-to-use-multiple-connections-to-speed-up-apt-get on Ubuntu Linux 16.04 LTS server.md @@ -1,13 +1,13 @@ -如何在Ubuntu Linux 16.04 LTS中使用多条连接加速apt-get/apt -========================================================================================= +如何在 Ubuntu Linux 16.04 LTS 中使用多个连接加速 apt-get/apt +================================================= -我该如何在Ubuntu Linux 16.04或者14.04 LTS中从多个仓库中下载包来加速apt-get或者apt命令? +我该如何加速在 Ubuntu Linux 16.04 或者 14.04 LTS 上从多个仓库中下载包的 apt-get 或者 apt 命令? -你需要使用到apt-fast这个shell封装器。它会通过多个连接同时下载一个包来加速apt-get/apt和aptitude命令。所有的包都会同时下载。它使用aria2c作为默认的下载加速。 +你需要使用到 apt-fast 这个 shell 封装器。它会通过多个连接同时下载一个包来加速 apt-get/apt 和 aptitude 命令。所有的包都会同时下载。它使用 aria2c 作为默认的下载加速器。 ### 安装 apt-fast 工具 -在Ubuntu Linux 14.04或者之后的版本尝试下面的命令: +在 Ubuntu Linux 14.04 或者之后的版本尝试下面的命令: ``` $ sudo add-apt-repository ppa:saiarcot895/myppa @@ -45,7 +45,6 @@ $ sudo apt -y install apt-fast 示例输出: - ``` Reading package lists... Done Building dependency tree @@ -77,13 +76,13 @@ Get:4 http://01.archive.ubuntu.com/ubuntu xenial/universe amd64 aria2 amd64 1.19 ![](http://s0.cyberciti.org/uploads/faq/2016/07/apt-fast-confirmation-box.jpg) -你可以直接编辑设置: +你也可以直接编辑设置: ``` $ sudo vi /etc/apt-fast.conf ``` ->**请注意这个工具并不是给慢速网络连接的,它是给快速网络连接的。如果你的网速慢,那么你将无法从这个工具中得到好处。** +> **请注意这个工具并不是给慢速网络连接的,它是给快速网络连接的。如果你的网速慢,那么你将无法从这个工具中得到好处。** ### 我该怎么使用 apt-fast 命令? @@ -94,13 +93,13 @@ apt-fast command apt-fast [options] command ``` -#### 使用apt-fast取回新的包列表 +#### 使用 apt-fast 取回新的包列表 ``` sudo apt-fast update ``` -#### 使用apt-fast执行升级 +#### 使用 apt-fast 执行升级 ``` sudo apt-fast upgrade @@ -121,7 +120,7 @@ $ sudo apt-fast dist-upgrade sudo apt-fast install pkg ``` -比如要安装nginx,输入: +比如要安装 nginx,输入: ``` $ sudo apt-fast install nginx @@ -196,22 +195,20 @@ Status Legend: (OK):download completed. ``` -#### 下载并显示指定包的changelog +#### 下载并显示指定包的 changelog ``` $ sudo apt-fast changelog pkgNameHere $ sudo apt-fast changelog nginx ``` - - -------------------------------------------------------------------------------- -via: https://fedoramagazine.org/introducing-flatpak/ +via: http://www.cyberciti.biz/faq/how-to-speed-up-apt-get-apt-command-ubuntu-linux/ 作者:[VIVEK GITE][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 d3054ff6454f175b63bd6b290de8a792e6efd340 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 7 Aug 2016 10:00:41 +0800 Subject: [PATCH 1374/1469] PUB:20160502 The intersection of Drupal, IoT, and open hardware @zpl1025 --- ...ction of Drupal, IoT, and open hardware.md | 61 ++++++++++++++++++ ...ction of Drupal, IoT, and open hardware.md | 62 ------------------- 2 files changed, 61 insertions(+), 62 deletions(-) create mode 100644 published/20160502 The intersection of Drupal, IoT, and open hardware.md delete mode 100644 translated/tech/20160502 The intersection of Drupal, IoT, and open hardware.md diff --git a/published/20160502 The intersection of Drupal, IoT, and open hardware.md b/published/20160502 The intersection of Drupal, IoT, and open hardware.md new file mode 100644 index 0000000000..168bbce778 --- /dev/null +++ b/published/20160502 The intersection of Drupal, IoT, and open hardware.md @@ -0,0 +1,61 @@ +Drupal、IoT 和开源硬件之间的交集 +======================================================= + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/drupal_blue_gray_lead.jpeg?itok=t7W_KD-D) + + +来认识一下 [Amber Matz][1],她是来自 Lullabot Education 旗下的 [Drupalize.Me][3] 的产品经理以及培训师。当她没有倒腾 Arduino、Raspberry Pi 以及电子穿戴设备时,通常会在波特兰 Drupal 用户组里担任辩论主持人。 + +在即将举行的 [DrupalCon NOLA][3] 大会上,Amber 将主持一个关于 Drupal 和 IoT 的主题。如果你会去参加,也想了解下开源硬件,IoT 和 Drupal 之间的交集,那这个将很合适。如果你去不了新奥尔良的现场也没关系,Amber 还分享了许多很酷的事情。在这次采访中,她讲述了自己参与 Drupal 的原因,一些她自己喜欢的开源硬件项目,以及 IoT 和 Drupal 的未来。 + +![](https://opensource.com/sites/default/files/images/life/Interview%20banner%20Q%26A.png) + +**你是怎么加入 Drupal 社区的?** + +在这之前,我在一家大型非盈利性机构市场部的“网站管理部”工作,飞快地批量生产出各种定制 PHP/MySQL 表单。最终我厌烦了这一切,并开始在网上寻找更好的方式。然后我找到了 Drupal 6 并开始沉迷进去。过了几年,在一次跳槽之后,我发现了波特兰 Drupal 用户组,然后在里面找了一份全职的 Drupal 开发者工作。我一直经常参加在波特兰的聚会,在那里我找到了大量的社区、朋友和专业方面的发展。一个偶然的机会,我在 Lullabot 找了一份培训师的工作,为 Drupalize.Me 提供内容。现在,我管理着 Drupalize.Me 的内容输出,负责编撰 Drupal 8 相关的内容,还很大程度地参与到波特兰 Drupal 社区中。我是今年的协调员,寻找并安排演讲者们。 + +**我们想知道:什么是 Arduino 原型,你是怎么找到它的,以及你用 Arduino 做过的最酷的事是什么?** + +Arduino,Raspberry Pi,以及可穿戴电子设备,这些年到处都能听到这些术语。我在几年前通过 Becky Stern 的 YouTube 秀(最近由 Becky 继续主持,每周三播出)发现了 [Adafruit 的可穿戴电子设备][4]。我被那些可穿戴设备迷住了,还订了一套 LED 缝制工具,不过没做出任何东西。我不太适合它。我没有任何电子相关的背景,而且在我被那些项目吸引的时候,我根本不知道怎么做出那样的东西,它似乎看上去太遥远了。 + +后来,我在 Coursera 上找到了一个“物联网”专题。(很时髦,对吧?)我很快就喜欢上了。我最终找到了 Arduino 是什么的解释,以及所有这些其他的重要术语和概念。我订了一套推荐的 Arduino 初学者套件,还附带了一本如何上手的小册子。当我第一次让 LED 闪烁的时候,开心极了。我在圣诞节以及之后有两个星期的假期,然而我什么都没干,就一直根据初学者小册子给 Arduino 电路编程。很奇怪我觉得很放松!我太喜欢了。 + +在一月份的时候,我开始构思我自己的原型设备。在知道我需要主持公司培训的开场白时,我用五个 LED 灯和 Arduino 搭建了一个开场白视觉计时器的原型。 + +![](https://opensource.com/sites/default/files/resize/amber-arduino-lightning-talk-timer-400x400.jpg) + +这是一次巨大的成功。我还做了我的第一个可穿戴项目,一件会发光的连帽衫,使用了和 Arduino IDE 兼容的 Gemma 微控制器,一个小的圆形可缝制部件,然后用可导电的线缝起来,将一个滑动可变电阻和衣服帽口的收缩绳连在一起,用来控制缝到帽子里的五个 NeoPixel 灯的颜色。这就是我对原型设计的看法:做一些很好玩也可能会有点实际用途的疯狂项目。 + +**Drupal 和 IoT 带来的最大机遇是什么??** + +IoT 与 Web Service 以及 Drupal 分层趋势实际并没有太大差别。就是将数据从一个东西传送到另一个东西,然后将数据转换成一些有用的东西。但数据是如何送达?能用来做点什么?你觉得现在就有一大堆现成的解决方案、应用、中间层,以及 API 吗?采用 IoT,这只会继续成几何指数级的增长。我觉得,给我任何一个设备或“东西”,总有办法来将它连接到互联网上,有很多办法。而且有大量现成的代码库来帮助创客们将他们的数据从一个东西传到另一个东西。 + +那么 Drupal 在这里处于什么位置?首先,Web services 将是第一个明显的地方。但作为一个创客,我不希望将时间花在编写 Drupal 的订制模块上。我想要的是即插即用!所以我很高兴出现这样的模块能连接 IoT 云端 API 和服务,比如 ThingSpeak,Adafruit.io,IFTTT,以及其他的。我觉得也有一个很好的商业机会,在 Drupal 里构建一套 IoT 云服务,允许用户发送和存储他们的传感器数据,并可以制成表格和图像,还可以写一些插件可以响应特定数据或阙值。每一个 IoT 云 API 服务都是一个细分的机会,所以能留下很大空间给其他人。 + +**这次 DrupalCon 你有哪些期待?** + +我喜欢与 Drupal 上的朋友重逢,认识一些新的人,还能见到 Lullabot 和 Drupalize.Me 的同事(我们是分布式的公司)!Drupal 8 有太多东西可以去探索了,我们给我们的客户们提供了海量的培训资料。所以,我很期待参与一些 Drupal 8 相关的主题,以及跟上最新的开发进度。最后,我对新奥尔良也很感兴趣!我曾经在 2004 年去过,很期待将这次将看到哪些改变。 + +**谈一谈你这次 DrupalCon 上的演讲:“超越闪烁:将 Drupal 加到你的 IoT 游乐场中”。别人为什么要参加?他们最重要的收获会是什么?** + +我的主题的标题是,“超越闪烁:将 Drupal 加到你的 IoT 游乐场中”,假设我们所有人都处在同一进度和层次,你不需要了解任何关于 Arduino、物联网、甚至是 Drupal,都能跟上。我将从用 Arduino 让 LED 灯闪烁开始,然后我会谈一下我自己在这里面的最大收获:玩、学、教和做。我会列出一些曾经激励过我的例子,它们也很有希望能激发和鼓励其他听众去尝试一下。然后,就是展示时间! + +首先,第一个东西。它是一个建筑提醒信号灯。在这个展示里,我会说明如何将信号灯连到互联网上,以及如何响应从云 API 服务收到的数据。然后,第二个东西。它是一个蒸汽朋克风格 iPhone 外壳形式的“天气手表”。有一个小型 LED 矩阵用来显示我的天气的图标,一个气压和温度传感器,一个 GPS 模块,以及一个 Bluetooth LE 模块,都连接到一个 Adafruit Flora 微控制器上。第二个东西能通过蓝牙连接到我的 iPhone 上的一个应用,并将天气和位置数据通过 MQTT 协议发到 Adafruit.io 的服务器!然后,在 Drupal 这边,我会从云端下载这些数据,更新天气信息,然后更新地图。所以大家也能体验一下通过web service、地图和 Drupal 8 的功能块所能做的事情。 + +学习和制作这些展示原型是一次烧脑的探险,我也希望有人能参与这个主题并感染一点我对这种技术交叉的传染性热情!我很兴奋能分享一些我的发现。 + +------------------------------------------------------------------------------ + +via: https://opensource.com/business/16/5/drupalcon-interview-amber-matz + +作者:[Jason Hibbets][a] +译者:[zpl1025](https://github.com/zpl1025) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jhibbets +[1]: https://www.drupal.org/u/amber-himes-matz +[2]: https://drupalize.me/ +[3]: https://events.drupal.org/neworleans2016/ +[4]: https://www.adafruit.com/beckystern diff --git a/translated/tech/20160502 The intersection of Drupal, IoT, and open hardware.md b/translated/tech/20160502 The intersection of Drupal, IoT, and open hardware.md deleted file mode 100644 index 7cfffd953f..0000000000 --- a/translated/tech/20160502 The intersection of Drupal, IoT, and open hardware.md +++ /dev/null @@ -1,62 +0,0 @@ -Drupal, IoT 和开源硬件的交叉点 -======================================================= - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/drupal_blue_gray_lead.jpeg?itok=t7W_KD-D) - - -认识一下 [Amber Matz][1],来自由 Lullabot Education 提供的 [Drupalize.Me][3] 的生产经理以及培训师。当她没有倒腾 Arduino,Raspberry Pi 以及电子穿戴设备时,通常会在波特兰 Drupal 用户组里和主持人争论。 - -在即将举行的 [DrupalCon NOLA][3] 大会上,Amber 将主持一个关于 Drupal 和 IoT 的主题。如果你会去参加,也想了解下开源硬件,IoT 和 Drupal 之间的交叉点,那这个将很合适。如果你去不了新奥尔良的现场也没关系,Amber 还分享了许多很酷的事情。在这次采访中,她讲述了自己参与 Drupal 的原因,一些她自己喜欢的开源硬件项目,以及 IoT 和 Drupal 的未来。 - -![](https://opensource.com/sites/default/files/images/life/Interview%20banner%20Q%26A.png) - -**你是怎么加入 Drupal 社区的?** - -在这之前,我在一家大型非盈利性机构市场部的“站长办公室”工作,大量产出没人喜欢的定制 PHP/MySQL 表格。终于我觉得这样很烦并开始在网上寻找更好的方式。然后我找到了 Drupal 6 并开始自己沉迷进去。多年以后,在准备职业转换的时候,发现了波特兰 Drupal 用户组,然后在里面找了一份全职的 Drupal 开发者工作。我一直经常参加在波特兰的聚会,我觉得它是一种很好的社区,交友,以及专业开发的资源。一个偶然的机会,我在 Lullabot 找了一份培训师的工作为 Drupalize.Me 提供内容。现在,我管理着 Drupalize.Me 的内容管道,创建 Drupal 8 的内容,还很大程度地参与到波特兰 Drupal 社区中。我是今年的协调员,寻找并规划演讲者。 - -**我们得明白:什么是 Arduino 原型,你是怎么找到它的,以及你用 Arduino 做过的最酷的事是什么?** - -Arduino,Raspberry Pi,以及可穿戴电子设备,这些年到处都能听到这些术语。我在几年前通过 Becky Stern YouTube 秀(最近由 Becky 继续主持,每周三播出)发现了 [Adafruit 的可穿戴电子设备][4]。我被那些可穿戴设备迷住了,还订了一套 LED 缝制工具,不过没做出任何东西。我就是没搞懂。我没有任何电子相关的背景,而且在我被那些项目吸引的时候,我根本不知道怎么做出那样的东西。看上去太遥远了。 - -后来,我找到一个 Coursera 的“物联网”专题。(很时髦,对吧?)但我很快就喜欢上了。我最终找到了 Arduino 是什么的解释,以及所有这些其他的重要术语和概念。我订了一套推荐的 Arduino 初学者套件,还附带了一本如何上手的小册子。当我第一次让 LED 闪烁的时候,开心极了。我在圣诞节以及之后有两个星期的假期,然后我什么都没干,就一直根据初学者小册子给 Arduino 电路编程。很奇怪我觉得很放松!我太喜欢了。 - -一月份的时候,我开始构思我自己的原型设备。在知道我要主持公司培训的开场白时,我用五个 LED 灯和 Arduino 搭建了一个开场白视觉计时器。 - -![](https://opensource.com/sites/default/files/resize/amber-arduino-lightning-talk-timer-400x400.jpg) - -这是一次巨大的成功。我还做了我的第一个可穿戴项目,一件会发光的连帽衫,使用了和 Arduino IDE 兼容的 Gemma 微控制器,一个小的圆形可缝制部件,然后用可导电的线缝起来,将一个滑动可变电阻和衣服帽口的收缩绳连在一起,用来控制缝到帽子里的五个 NeoPixel 灯的颜色。这就是我对原型设计的看法:开展一些很好玩也可能会有点实际用途的疯狂项目。 - -**Drupal 和 IoT 带来的最大机遇是什么??** - -IoT 和网站服务以及 Drupal 分层趋势实际并没有太大差别。就是将数据从一个物体传送到另一个物体,然后将数据转换成一些有用的东西。但数据是如何送达?能用来做点什么?你觉得现在就有一大堆现成的解决方案,应用,中间层,以及 API?采用 IoT,这只会继续成指数增长。我觉得,给我任何一个设备或“物体”,需要只用一种方式来将它连接到因特网的无线可能上。然后有现成的各种代码库来帮助制作者将他们的数据从一个物体送到另一个物体。 - -那么 Drupal 在这里处于什么位置?首先,网站服务将是第一个明显的地方。但作为一个制作者,我不希望将时间花在编写 Drupal 的订制模块上。我想要的是即插即用!所以我很高兴出现这样的模块能连接 IoT 云端 API 和服务,比如 ThingSpeak,Adafruit.io,IFTTT,以及其他的。我觉得也有一个很好的商业机会,在 Drupal 里构建一套 IoT 云服务,允许用户发送和存储他们的传感器数据,并可以制成表格和图像,还可以写一些插件可以响应特定数据或阙值。每一个 IoT 云 API 服务都是一个细分的机会,所以能留下很大空间给其他人。 - -**这次 DrupalCon 你有哪些期待?** - -我喜欢重新联系 Drupal 上的朋友,认识一些新的人,还能见到 Lullabot 和 Drupalize.Me 的同事(我们是分布式的公司)!Drupal 8 有太多东西可以去探索了,不可抗拒地要帮我们的客户收集培训资料。所以,我很期待参与一些 Drupal 8 相关的主题,以及跟上最新的开发活动。最后,我对新奥尔良也很感兴趣!我曾经在 2004 年去过,很期待将这次将看到哪些改变。 - -**谈一谈你这次 DrupalCon 上的演讲,超越闪烁:将 Drupal 加到你的 IoT 游乐场中。别人为什么要参与?他们最重要的收获会是什么?** - -我的主题的标题是,超越闪烁:将 Drupal 加到你的 IoT 游乐场中,本身有很多假设,我将让所有人都放在同一速度和层次。你不需要了解任何关于 Arduino,物联网,甚至是 Drupal,都能跟上。我将从用 Arduino 让 LED 灯闪烁开始,然后我会谈一下我自己在这里面的最大收获:玩,学,教,和做。我会列出一些曾经激发过我的例子,它们也很有希望能激发和鼓励其他听众去尝试一下。然后,就是展示时间! - -首先,第一个东西。它是一个构建提醒信号灯。在这个展示里,我会说明如何将信号灯连到互联网上,以及如何响应从云 API 服务收到的数据。然后,第二个东西。它是一个蒸汽朋克风格 iPhone 外壳形式的“天气手表”。有一个小型 LED 矩阵用来显示我的天气的图标,一个气压和温度传感器,一个 GPS 模块,以及一个 Bluetooth LE 模块,都连接到一个 Adafruit Flora 微控制器上。第二个东西能通过蓝牙连接到我的 iPhone 上的一个应用,并将天气和位置数据通过 MQTT 协议发到 Adafruit.io 的服务器!然后,在 Drupal 这边,我会从云端下载这些数据,根据天气更新一个功能块,然后更新地图。所以大家也能体验一下通过网站服务,地图和 Drupal 8 的功能块所能做的事情。 - -学习和制作这些展示原型是一次烧脑的探险,我也希望有人能参与这个主题并感染一点我对这个技术交叉的传染性热情!我很兴奋能分享一些我的发现。 - - ------------------------------------------------------------------------------- - -via: https://opensource.com/business/16/5/drupalcon-interview-amber-matz - -作者:[Jason Hibbets][a] -译者:[zpl1025](https://github.com/zpl1025) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jhibbets -[1]: https://www.drupal.org/u/amber-himes-matz -[2]: https://drupalize.me/ -[3]: https://events.drupal.org/neworleans2016/ -[4]: https://www.adafruit.com/beckystern From 0a978c116682d2acff7a7a8fb37b447ad4630578 Mon Sep 17 00:00:00 2001 From: Stdio A Date: Sun, 7 Aug 2016 11:33:58 +0800 Subject: [PATCH 1375/1469] =?UTF-8?q?Finish=2020160309=20Let=E2=80=99s=20B?= =?UTF-8?q?uild=20A=20Web=20Server.=20Part=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...160309 Let’s Build A Web Server. Part 1.md | 151 ------------------ ...160309 Let’s Build A Web Server. Part 1.md | 150 +++++++++++++++++ 2 files changed, 150 insertions(+), 151 deletions(-) delete mode 100644 sources/tech/20160309 Let’s Build A Web Server. Part 1.md create mode 100644 translated/tech/20160309 Let’s Build A Web Server. Part 1.md diff --git a/sources/tech/20160309 Let’s Build A Web Server. Part 1.md b/sources/tech/20160309 Let’s Build A Web Server. Part 1.md deleted file mode 100644 index 63f08f754d..0000000000 --- a/sources/tech/20160309 Let’s Build A Web Server. Part 1.md +++ /dev/null @@ -1,151 +0,0 @@ -Translating by StdioA -Let’s Build A Web Server. Part 1. -===================================== - -Out for a walk one day, a woman came across a construction site and saw three men working. She asked the first man, “What are you doing?” Annoyed by the question, the first man barked, “Can’t you see that I’m laying bricks?” Not satisfied with the answer, she asked the second man what he was doing. The second man answered, “I’m building a brick wall.” Then, turning his attention to the first man, he said, “Hey, you just passed the end of the wall. You need to take off that last brick.” Again not satisfied with the answer, she asked the third man what he was doing. And the man said to her while looking up in the sky, “I am building the biggest cathedral this world has ever known.” While he was standing there and looking up in the sky the other two men started arguing about the errant brick. The man turned to the first two men and said, “Hey guys, don’t worry about that brick. It’s an inside wall, it will get plastered over and no one will ever see that brick. Just move on to another layer.”1 - -The moral of the story is that when you know the whole system and understand how different pieces fit together (bricks, walls, cathedral), you can identify and fix problems faster (errant brick). - -What does it have to do with creating your own Web server from scratch? - -I believe to become a better developer you MUST get a better understanding of the underlying software systems you use on a daily basis and that includes programming languages, compilers and interpreters, databases and operating systems, web servers and web frameworks. And, to get a better and deeper understanding of those systems you MUST re-build them from scratch, brick by brick, wall by wall. - -Confucius put it this way: - ->“I hear and I forget.” - -![](https://ruslanspivak.com/lsbasi-part4/LSBAWS_confucius_hear.png) - ->“I see and I remember.” - -![](https://ruslanspivak.com/lsbasi-part4/LSBAWS_confucius_see.png) - ->“I do and I understand.” - -![](https://ruslanspivak.com/lsbasi-part4/LSBAWS_confucius_do.png) - -I hope at this point you’re convinced that it’s a good idea to start re-building different software systems to learn how they work. - -In this three-part series I will show you how to build your own basic Web server. Let’s get started. - -First things first, what is a Web server? - -![](https://ruslanspivak.com/lsbaws-part1/LSBAWS_HTTP_request_response.png) - -In a nutshell it’s a networking server that sits on a physical server (oops, a server on a server) and waits for a client to send a request. When it receives a request, it generates a response and sends it back to the client. The communication between a client and a server happens using HTTP protocol. A client can be your browser or any other software that speaks HTTP. - -What would a very simple implementation of a Web server look like? Here is my take on it. The example is in Python but even if you don’t know Python (it’s a very easy language to pick up, try it!) you still should be able to understand concepts from the code and explanations below: - -``` -import socket - -HOST, PORT = '', 8888 - -listen_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) -listen_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) -listen_socket.bind((HOST, PORT)) -listen_socket.listen(1) -print 'Serving HTTP on port %s ...' % PORT -while True: - client_connection, client_address = listen_socket.accept() - request = client_connection.recv(1024) - print request - - http_response = """\ -HTTP/1.1 200 OK - -Hello, World! -""" - client_connection.sendall(http_response) - client_connection.close() -``` - -Save the above code as webserver1.py or download it directly from GitHub and run it on the command line like this - -``` -$ python webserver1.py -Serving HTTP on port 8888 … -``` - -Now type in the following URL in your Web browser’s address bar http://localhost:8888/hello, hit Enter, and see magic in action. You should see “Hello, World!” displayed in your browser like this: - -![](https://ruslanspivak.com/lsbaws-part1/browser_hello_world.png) - -Just do it, seriously. I will wait for you while you’re testing it. - -Done? Great. Now let’s discuss how it all actually works. - -First let’s start with the Web address you’ve entered. It’s called an URL and here is its basic structure: - -![](https://ruslanspivak.com/lsbaws-part1/LSBAWS_URL_Web_address.png) - -This is how you tell your browser the address of the Web server it needs to find and connect to and the page (path) on the server to fetch for you. Before your browser can send a HTTP request though, it first needs to establish a TCP connection with the Web server. Then it sends an HTTP request over the TCP connection to the server and waits for the server to send an HTTP response back. And when your browser receives the response it displays it, in this case it displays “Hello, World!” - -Let’s explore in more detail how the client and the server establish a TCP connection before sending HTTP requests and responses. To do that they both use so-called sockets. Instead of using a browser directly you are going to simulate your browser manually by using telnet on the command line. - -On the same computer you’re running the Web server fire up a telnet session on the command line specifying a host to connect to localhost and the port to connect to 8888 and then press Enter: - -``` -$ telnet localhost 8888 -Trying 127.0.0.1 … -Connected to localhost. -``` - -At this point you’ve established a TCP connection with the server running on your local host and ready to send and receive HTTP messages. In the picture below you can see a standard procedure a server has to go through to be able to accept new TCP connections. - -![](https://ruslanspivak.com/lsbaws-part1/LSBAWS_socket.png) - -In the same telnet session type GET /hello HTTP/1.1 and hit Enter: - -``` -$ telnet localhost 8888 -Trying 127.0.0.1 … -Connected to localhost. -GET /hello HTTP/1.1 - -HTTP/1.1 200 OK -Hello, World! -``` - -You’ve just manually simulated your browser! You sent an HTTP request and got an HTTP response back. This is the basic structure of an HTTP request: - -![](https://ruslanspivak.com/lsbaws-part1/LSBAWS_HTTP_request_anatomy.png) - -The HTTP request consists of the line indicating the HTTP method (GET, because we are asking our server to return us something), the path /hello that indicates a “page” on the server we want and the protocol version. - -For simplicity’s sake our Web server at this point completely ignores the above request line. You could just as well type in any garbage instead of “GET /hello HTTP/1.1” and you would still get back a “Hello, World!” response. - -Once you’ve typed the request line and hit Enter the client sends the request to the server, the server reads the request line, prints it and returns the proper HTTP response. - -Here is the HTTP response that the server sends back to your client (telnet in this case): - -![](https://ruslanspivak.com/lsbaws-part1/LSBAWS_HTTP_response_anatomy.png) - -Let’s dissect it. The response consists of a status line HTTP/1.1 200 OK, followed by a required empty line, and then the HTTP response body. - -The response status line HTTP/1.1 200 OK consists of the HTTP Version, the HTTP status code and the HTTP status code reason phrase OK. When the browser gets the response, it displays the body of the response and that’s why you see “Hello, World!” in your browser. - -And that’s the basic model of how a Web server works. To sum it up: The Web server creates a listening socket and starts accepting new connections in a loop. The client initiates a TCP connection and, after successfully establishing it, the client sends an HTTP request to the server and the server responds with an HTTP response that gets displayed to the user. To establish a TCP connection both clients and servers use sockets. - -Now you have a very basic working Web server that you can test with your browser or some other HTTP client. As you’ve seen and hopefully tried, you can also be a human HTTP client too, by using telnet and typing HTTP requests manually. - -Here’s a question for you: “How do you run a Django application, Flask application, and Pyramid application under your freshly minted Web server without making a single change to the server to accommodate all those different Web frameworks?” - -I will show you exactly how in Part 2 of the series. Stay tuned. - -BTW, I’m writing a book “Let’s Build A Web Server: First Steps” that explains how to write a basic web server from scratch and goes into more detail on topics I just covered. Subscribe to the mailing list to get the latest updates about the book and the release date. - --------------------------------------------------------------------------------- - -via: https://ruslanspivak.com/lsbaws-part1/ - -作者:[Ruslan][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://linkedin.com/in/ruslanspivak/ - - - diff --git a/translated/tech/20160309 Let’s Build A Web Server. Part 1.md b/translated/tech/20160309 Let’s Build A Web Server. Part 1.md new file mode 100644 index 0000000000..8ccee84871 --- /dev/null +++ b/translated/tech/20160309 Let’s Build A Web Server. Part 1.md @@ -0,0 +1,150 @@ +搭个 Web 服务器:第一部分 +===================================== + +一天,有一个正在散步的妇人恰好路过一个建筑工地,看到三个正在工作的工人。她问第一个人:“你在做什么?”第一个人没好气地喊道:“你没看到我在砌砖吗?”妇人对这个答案不满意,于是问第二个人:“你在做什么?”第二个人回答说:“我在建一堵砖墙。”说完,他转向第一个人,跟他说:“嗨,你把墙砌过头了。去把刚刚那块砖弄下来!”然而,妇人对这个答案依然不满意,于是又问了第三个人相同的问题。第三个人仰头看着天,对她说:“我在建造世界上最大的教堂。”当他回答时,第一个人和第二个人在为刚刚砌错的砖而争吵。他转向那两个人,说:“不用管那块砖了。这堵墙在室内,它会被水泥填平,没人会看见它的。去砌下一层吧。” + +这个故事告诉我们:如果你能够理解整个系统的构造,了解系统的各个部件如何相互结合(如砖、墙还有整个教堂),你就能够更快地定位及修复问题(那块砌错的砖)。 + +如果你想从头开始创造一个 Web 服务器,那么你需要做些什么呢? + +我相信,如果你想成为一个更好的开发者,你**必须**对日常使用的软件系统的内部结构有更深的理解,包括编程语言、编译器与解释器、数据库及操作系统、Web 服务器及 Web 框架。而且,为了更好更深入地理解这些系统,你**必须**从头开始,用一砖一瓦来重新构建这个系统。 + +孔子曾经用这几句话来表达这种思想: + +>“不闻不若闻之。” + +![](https://ruslanspivak.com/lsbasi-part4/LSBAWS_confucius_hear.png) + +>“闻之不若见之。” + +![](https://ruslanspivak.com/lsbasi-part4/LSBAWS_confucius_see.png) + +>“知之不若行之。” + +![](https://ruslanspivak.com/lsbasi-part4/LSBAWS_confucius_do.png) + +我希望你现在能够意识到,重新建造一个软件系统来了解它的工作方式是一个好主意。 + +在这个由三篇文章组成的系列中,我将会教你构建你自己的 Web 服务器。我们开始吧~ + +先说首要问题:Web 服务器是什么? + +![](https://ruslanspivak.com/lsbaws-part1/LSBAWS_HTTP_request_response.png) + +简而言之,它是一个运行在一个物理服务器上的网络服务器(啊呀,服务器套服务器),等待客户端向其发送请求。当它接收请求后,会生成一个响应,并回送至客户端。客户端和服务端之间通过 HTTP 协议来实现相互交流。客户端可以是你的浏览器,也可以是使用 HTTP 协议的其它任何软件。 + +最简单的 Web 服务器实现应该是什么样的呢?这里我给出我的实现。这个例子由 Python 写成,即使你没听说过 Python(它是一门超级容易上手的语言,快去试试看!),你也应该能够从代码及注释中理解其中的理念: + +``` +import socket + +HOST, PORT = '', 8888 + +listen_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +listen_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +listen_socket.bind((HOST, PORT)) +listen_socket.listen(1) +print 'Serving HTTP on port %s ...' % PORT +while True: + client_connection, client_address = listen_socket.accept() + request = client_connection.recv(1024) + print request + + http_response = """\ +HTTP/1.1 200 OK + +Hello, World! +""" + client_connection.sendall(http_response) + client_connection.close() +``` + +将以上代码保存为 webserver1.py,或者直接从 GitHub 上下载这个文件。然后,在命令行中运行这个程序。像这样: + +``` +$ python webserver1.py +Serving HTTP on port 8888 … +``` + +现在,在你的网页浏览器的地址栏中输入 URL:http://localhost:8888/hello ,敲一下回车,然后来见证奇迹。你应该看到“Hello, World!”显示在你的浏览器中,就像下图那样: + +![](https://ruslanspivak.com/lsbaws-part1/browser_hello_world.png) + +说真的,快去试一试。你做实验的时候,我会等着你的。 + +完成了?不错。现在我们来讨论一下它实际上是怎么工作的。 + +首先我们从你刚刚输入的 Web 地址开始。它叫 URL,这是它的基本结构: + +![](https://ruslanspivak.com/lsbaws-part1/LSBAWS_URL_Web_address.png) + +URL 是一个 Web 服务器的地址,浏览器用这个地址来寻找并连接 Web 服务器,并将上面的内容返回给你。在你的浏览器能够发送 HTTP 请求之前,它需要与 Web 服务器建立一个 TCP 连接。然后会在 TCP 连接中发送 HTTP 请求,并等待服务器返回 HTTP 响应。当你的浏览器收到响应后,就会显示其内容,在上面的例子中,它显示了“Hello, World!”。 + +我们来进一步探索在发送 HTTP 请求之前,客户端与服务器建立 TCP 连接的过程。为了建立链接,它们使用了所谓“套接字”。我们现在不直接使用浏览器发送请求,而在命令行中使用 telnet 来人工模拟这个过程。 + +在你运行 Web 服务器的电脑上,在命令行中建立一个 telnet 会话,指定一个本地域名,使用端口 8888,然后按下回车: + +``` +$ telnet localhost 8888 +Trying 127.0.0.1 … +Connected to localhost. +``` + +这个时候,你已经与运行在你本地主机的服务器建立了一个 TCP 连接。在下图中,你可以看到一个服务器从头开始,到能够建立 TCP 连接的基本过程。 + +![](https://ruslanspivak.com/lsbaws-part1/LSBAWS_socket.png) + +在同一个 telnet 会话中,输入 GET /hello HTTP/1.1,然后输入回车: + +``` +$ telnet localhost 8888 +Trying 127.0.0.1 … +Connected to localhost. +GET /hello HTTP/1.1 + +HTTP/1.1 200 OK +Hello, World! +``` + +你刚刚手动模拟了你的浏览器!你发送了 HTTP 请求,并且收到了一个 HTTP 应答。下面是一个 HTTP 请求的基本结构: + +![](https://ruslanspivak.com/lsbaws-part1/LSBAWS_HTTP_request_anatomy.png) + +HTTP 请求的第一行由三部分组成:HTTP 方法(GET,因为我们想让我们的服务器返回一些内容),以及标明所需页面的路径 /hello,还有协议版本。 + +为了简单一些,我们刚刚构建的 Web 服务器完全忽略了上面的请求内容。你也可以试着输入一些无用内容而不是“GET /hello HTTP/1.1”,但你仍然会收到一个“Hello, World!”响应。 + +一旦你输入了请求行并敲了回车,客户端就会将请求发送至服务器;服务器读取请求行,就会返回相应的 HTTP 响应。 + +下面是服务器返回客户端(在上面的例子里是 telnet)的响应内容: + +![](https://ruslanspivak.com/lsbaws-part1/LSBAWS_HTTP_response_anatomy.png) + +我们来解析它。这个响应由三部分组成:一个状态行 HTTP/1.1 200 OK,后面跟着一个空行,再下面是响应正文。 + +HTTP 响应的状态行 HTTP/1.1 200 OK 包含 HTTP 版本号,HTTP 状态码以及 HTTP 状态短语“OK”。当浏览器收到响应后,它会将响应正文显示出来,这也就是为什么你会在浏览器中看到“Hello, World!”。 + +以上就是 Web 服务器的基本工作模型。总结一下:Web 服务器创建一个处于监听状态的套接字,循环接收新的连接。客户端建立 TCP 连接成功后,会向服务器发送 HTTP 请求,然后服务器会以一个 HTTP 响应做应答,客户端会将 HTTP 的响应内容显示给用户。为了建立 TCP 连接,客户端和服务端均会使用套接字。 + +现在,你应该了解了 Web 服务器的基本工作方式,你可以使用浏览器或其它 HTTP 客户端进行试验。如果你尝试过、观察过,你应该也能够使用 telnet,人工编写 HTTP 请求,成为一个人形 HTTP 客户端。 + +现在留一个小问题:“你要如何在不对程序做任何改动的情况下,在你刚刚搭建起来的 Web 服务器上适配 Django, Flask 或 Pyramid 应用呢? + +我会在本系列的第二部分中来详细讲解。敬请期待。 + +顺便,我在撰写《搭个 Web 服务器:从头开始》。这本书讲解了如何从头开始编写一个基本的 Web 服务器,里面包含本文中没有的更多细节。订阅邮件列表,你就可以获取到这本书的最新进展,以及发布日期。 + +-------------------------------------------------------------------------------- + +via: https://ruslanspivak.com/lsbaws-part1/ + +作者:[Ruslan][a] +译者:[StdioA](https://github.com/StdioA) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://linkedin.com/in/ruslanspivak/ + + + From 32123d2936adb91d2cb785c7da8c70c1af8df9f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=AE=B6=E5=90=AF?= Date: Sun, 7 Aug 2016 14:38:52 +0800 Subject: [PATCH 1376/1469] =?UTF-8?q?=E8=BF=94=E5=9B=9E=E6=96=87=E7=AB=A0?= =?UTF-8?q?=20(#4284)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 75 * Translated by cposture * Translated by cposture * Translated by cposture * 应 erlinux 的要求,把未翻译完的文章移到 source * 应 erlinux 的要求,把未翻译完的文章移到 source,同时删除 translated文章 --- ... Rapid prototyping with docker-compose.md | 45 ++++++++++--------- 1 file changed, 23 insertions(+), 22 deletions(-) rename {translated => sources}/tech/20160512 Rapid prototyping with docker-compose.md (66%) diff --git a/translated/tech/20160512 Rapid prototyping with docker-compose.md b/sources/tech/20160512 Rapid prototyping with docker-compose.md similarity index 66% rename from translated/tech/20160512 Rapid prototyping with docker-compose.md rename to sources/tech/20160512 Rapid prototyping with docker-compose.md index a32f894d4b..0c67223697 100644 --- a/translated/tech/20160512 Rapid prototyping with docker-compose.md +++ b/sources/tech/20160512 Rapid prototyping with docker-compose.md @@ -1,36 +1,36 @@ -使用docker快速组成样品机 + +Rapid prototyping with docker-compose ======================================== -在写前,我们将看看 Node.js 样机 ** 找寻树莓派 PI Zero ** 的供应在英国三个主要销售. +In this write-up we'll look at a Node.js prototype for **finding stock of the Raspberry PI Zero** from three major outlets in the UK. -我写的代码,黑客部署到 Azure Ubuntu 虚拟机一个晚上就可以到位。Docker 和 docker-compose 工具做出调配和更新过程非常快。 +I wrote the code and deployed it to an Ubuntu VM in Azure within a single evening of hacking. Docker and the docker-compose tool made the deployment and update process extremely quick. -### 建立链接? +### Remember linking? - -如果您已经通过 [动手 Docker 教程指南] [1] 那么你已有在命令行建立 Docker 容器的经验。链接一个Redis 服务器计数器节点在命令行上可能是这样: +If you've already been through the [Hands-On Docker tutorial][1] then you will have experience linking Docker containers on the command line. Linking a Node hit counter to a Redis server on the command line may look like this: ``` $ docker run -d -P --name redis1 $ docker run -d hit_counter -p 3000:3000 --link redis1:redis ``` -现在,假设应用程序中有三个等级 +Now imagine your application has three tiers -- Web 前端 -- 批次层处理长时间运行的任务 -- Redis 或 MongoDB 数据库 +- Web front-end +- Batch tier for processing long running tasks +- Redis or mongo database -通过 `--link` 管理几个容器,但可能失效,可以添加多层级或容器到应用程序。 +Explicit linking through `--link` is just about manageable with a couple of containers, but can get out of hand as we add more tiers or containers to the application. -### 键入 docker 撰写 +### Enter docker-compose ![](http://blog.alexellis.io/content/images/2016/05/docker-compose-logo-01.png) ->Docker 撰写图标 +>Docker Compose logo -docker-compose 工具是标准的 docker工具箱的一部分,也可以单独下载。它提供了丰富功能,通过一个纯文本YAML文件配置所有应用程序组件。 +The docker-compose tool is part of the standard Docker Toolbox and can also be downloaded separately. It provides a rich set of features to configure all of an application's parts through a plain-text YAML file. -上述提供了一个例子: +The above example would look like this: ``` version: "2.0" @@ -43,18 +43,18 @@ services: - 3000:3000 ``` -从Docker 1.10起,我们可以充分利用网络来帮助我们在多个主机进行扩展覆盖。在此之前,仅通过单个主机工作。“docker-compose scale” 命令可用于更多计算能力有需要时。 +From Docker 1.10 onwards we can take advantage of network overlays to help us scale out across multiple hosts. Prior to this linking only worked across a single host. The `docker-compose scale` command can be used to bring on more computing power as the need arises. ->参考docker.com上关于"docker-compose" +>View the [docker-compose][2] reference on docker.com -### 真实例子:树莓派 PI 到货通知 +### Real-world example: Raspberry PI Stock Alert ![](http://blog.alexellis.io/content/images/2016/05/Raspberry_Pi_Zero_ver_1-3_1_of_3_large.JPG) ->新版树莓派 PI Zero V1.3 图片提供来自Pimoroni +>The new Raspberry PI Zero v1.3 image courtesy of Pimoroni -树莓派 PI Zero - 巨大的轰动一个微型计算机具有一个1GHz 处理器 和 512MB 内存能够运行完整 Linux,Docker,Node.js,Ruby 和许多流行的开源工具。一个关于 PI Zero 的好消息是,成本只有5美元。这也意味着,存量迅速抢购一空。 +There is a huge buzz around the Raspberry PI Zero - a tiny microcomputer with a 1GHz CPU and 512MB RAM capable of running full Linux, Docker, Node.js, Ruby and many other popular open-source tools. One of the best things about the PI Zero is that costs only 5 USD. That also means that stock gets snapped up really quickly. -*如果您想尝试Docker 或集群在PI看看下面的教程。* +*If you want to try Docker or Swarm on the PI check out the tutorial below.* >[Docker Swarm on the PI Zero][3] @@ -127,7 +127,7 @@ Preview as of 16th of May 2016 via: http://blog.alexellis.io/rapid-prototype-docker-compose/ 作者:[Alex Ellis][a] -译者:[erlinux](https://github.com/erlinux) +译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -139,3 +139,4 @@ via: http://blog.alexellis.io/rapid-prototype-docker-compose/ [4]: https://github.com/alexellis/pi_zero_stock [5]: https://github.com/alexellis/pi_zero_stock [6]: http://stockalert.alexellis.io/ + From 39eb115a31c076f0c0deee4689c172a39c387644 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 7 Aug 2016 21:18:46 +0800 Subject: [PATCH 1377/1469] PUB:20160722 Keeweb A Linux Password Manager @ChrisLeeGit --- ...0160722 Keeweb A Linux Password Manager.md | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) rename {translated/tech => published}/20160722 Keeweb A Linux Password Manager.md (67%) diff --git a/translated/tech/20160722 Keeweb A Linux Password Manager.md b/published/20160722 Keeweb A Linux Password Manager.md similarity index 67% rename from translated/tech/20160722 Keeweb A Linux Password Manager.md rename to published/20160722 Keeweb A Linux Password Manager.md index 3e32d1001c..6838c3105d 100644 --- a/translated/tech/20160722 Keeweb A Linux Password Manager.md +++ b/published/20160722 Keeweb A Linux Password Manager.md @@ -1,17 +1,17 @@ -Linux 密码管理器:Keeweb +Linux 下的密码管理器:Keeweb ================================ ![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/keeweb_1.png?608) -如今,我们依赖于越来越多的线上服务。我们每注册一个线上服务,就要设置一个密码;如此,我们就不得不记住数以百计的密码。这样对于每个人来说,都很容易忘记密码。我将在本文中介绍 Keeweb,它是一款 Linux 密码管理器,可以将你所有的密码安全地存储在线上或线下。 +如今,我们依赖于越来越多的线上服务。我们每注册一个线上服务,就要设置一个密码;如此,我们就不得不记住数以百计的密码。这样对于每个人来说,都很容易忘记密码。我将在本文中介绍 Keeweb,它是一款 Linux 密码管理器,可以为你离线或在线地安全存储所有的密码。 当谈及 Linux 密码管理器时,我们会发现有很多这样的软件。我们已经在 LinuxAndUbuntu 上讨论过像 [Keepass][1] 和 [Encryptr,一个基于零知识系统的密码管理器][2] 这样的密码管理器。Keeweb 则是另外一款我们将在本文讲解的 Linux 密码管理器。 -### Keeweb 可以在线下或线上存储密码 +### Keeweb 可以离线或在线存储密码 -Keeweb 是一款跨平台的密码管理器。它可以在线下存储你所有的密码,并且能够同步到你自己的云存储服务上,例如 OneDrive, Google Drive, Dropbox 等。Keeweb 并没有它自己的用于同步你密码的在线数据库。 +Keeweb 是一款跨平台的密码管理器。它可以离线存储你所有的密码,并且能够同步到你自己的云存储服务上,例如 OneDrive、Google Drive、Dropbox 等。Keeweb 并没有它提供它自己的在线数据库来的同步你的密码。 -要使用 Keeweb 连接你的线上存储服务,只需要点击更多,然后再点击你想要使用的服务即可。 +要使用 Keeweb 连接你的线上存储服务,只需要点击界面中的“more”,然后再点击你想要使用的服务即可。 ![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/keeweb.png?685) @@ -25,15 +25,15 @@ Keeweb 是一款跨平台的密码管理器。它可以在线下存储你所有 #### 创建密码 -想要创建一个新的密码,你只需要简单地点击 `+` 号,然后你就会看到所有需要填充的输入框。如果你想的话,可以创建更多的输入框。 +想要创建一个新的密码,你只需要简单地点击 `+` 号,然后你就会看到所有需要填充的输入框。根据你的需要创建更多的密码记录。 #### 搜索密码 ![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/search-passwords_orig.png) -Keeweb 拥有一个图标库,这样你就可以轻松地找到任何特定的密码入口。你可以改变图标的颜色、下载更多的图标,甚至可以直接从你的电脑中导入图标。这对于密码搜索来说,异常好使。 +Keeweb 拥有一个图标库,这样你就可以轻松地找到各种特定的密码记录。你可以改变图标的颜色、下载更多的图标,甚至可以直接从你的电脑中导入图标。这对于密码搜索来说,异常好使。 -相似服务的密码可以分组,这样你就可以在一个文件夹的一个地方同时找到它们。你也可以给密码打上标签并把它们存放在不同分类中。 +相似的服务的密码可以分组,这样你就可以在一个文件夹里找到它们。你也可以给密码打上标签并把它们存放在不同分类中。 ![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/tags-passwords-in-keeweb.png?283) @@ -45,15 +45,14 @@ Keeweb 拥有一个图标库,这样你就可以轻松地找到任何特定的 ### 不喜欢 Linux 密码管理器?没问题! -我已经发表过文章介绍了另外两款 Linux 密码管理器,它们分别是 Keepass 和 Encryptr,在 Reddit 和其它社交媒体上有些关于它们的争论。有些人反对使用任何密码管理器,反之亦然。在本文中,我想要澄清的是,存放密码文件是我们自己的责任。我认为像 keepass 和 Keeweb 这样的密码管理器是非常好用的,因为它们并没有自己的云来存放你的密码。这些密码管理器会创建一个文件,然后你可以将它存放在你的硬盘上,或者使用像 VeraCrypt 这样的应用给它加密。我个人不使用也不推荐使用那些将密码存储在它们自己数据库的服务。 +我已经发表过文章介绍了另外两款 Linux 密码管理器,它们分别是 Keepass 和 Encryptr,在 Reddit 和其它社交媒体上有些关于它们的争论。有些人反对使用任何密码管理器,也有人持相反意见。在本文中,我想要澄清的是,存放密码文件是我们自己的责任。我认为像 keepass 和 Keeweb 这样的密码管理器是非常好用的,因为它们并没有自己的云来存放你的密码。这些密码管理器会创建一个文件,然后你可以将它存放在你的硬盘上,或者使用像 VeraCrypt 这样的应用给它加密。我个人不使用也不推荐使用那些将密码存储在它们自己数据库的服务。 -------------------------------------------------------------------------------- via: http://www.linuxandubuntu.com/home/keeweb-a-linux-password-manager -作者:[author][a] 译者:[ChrisLeeGit](https://github.com/chrisleegit) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1b1830a6ed4fca74dca18dd5f54798448413d629 Mon Sep 17 00:00:00 2001 From: tianfeiyu Date: Mon, 8 Aug 2016 10:20:33 +0800 Subject: [PATCH 1378/1469] Create 20160726 How to restore older file versions in Git.md --- ...w to restore older file versions in Git.md | 188 ++++++++++++++++++ 1 file changed, 188 insertions(+) create mode 100644 translated/tech/20160726 How to restore older file versions in Git.md diff --git a/translated/tech/20160726 How to restore older file versions in Git.md b/translated/tech/20160726 How to restore older file versions in Git.md new file mode 100644 index 0000000000..ccf9863e14 --- /dev/null +++ b/translated/tech/20160726 How to restore older file versions in Git.md @@ -0,0 +1,188 @@ + +在 Git 中进行版本回退 +============================================= + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/file_system.jpg?itok=s2b60oIB) + +在这篇文章中,你将学到如何查看项目中的历史版本,如何进行版本回退,以及如何使用 Git 分支,你可以大胆的进行尝试。 + + +在你的 Git 项目中,你的位置就像是一个滚动的标签,由一个被称为 HEAD 的 标记(如磁带录音机或留声机的播放头)来确定。要让 HEAD 指向你想到的时间线上,需要使用 git checkout 命令。 + + +git checkout 命令的使用方式有两种。最常见的用途是恢复一个以前提交过的文件,你也可以用他切换到另一个分支。 + + +### 恢复一个文件 + + +当你意识到一个文件被你完全改乱了。我们不得不将它恢复到以前的某个位置,然后 a添加并提交,因此我们需要的是该文件最后一次修改的位置,然后替换文件。 + + +查看最后一次提交的 HEAD,然后使用 git checkout 将其恢复到以前的版本: + +``` +$ git checkout HEAD filename +``` + +如果回退会的文件依然有问题,使用 git log 查看你更早的提交,然后切换到正确的版本: + +``` +$ git log --oneline +79a4e5f bad take +f449007 The second commit +55df4c2 My great project, first commit. + +$ git checkout 55df4c2 filename + +``` + +现在,以前的文件恢复到了你当前的位置。(你可以用 git status 命令查看你当前的状态)然后添加刚改变的文件再进行提交: + +``` +$ git add filename +$ git commit -m 'restoring filename from first commit.' +``` + +使用 Git log 验证你所提交的: + +``` +$ git log --oneline +d512580 restoring filename from first commit +79a4e5f bad take +f449007 The second commit +55df4c2 My great project, first commit. +``` + +从本质上讲,你已经倒好了磁带并修复了坏的地方。所以你需要重新记录正确的。 + +### 回退时间线 + +恢复文件的另一种方式是回退整个 Git 项目。这里使用了分支的思想,这是另一种替代方法。 + +你要将 Git HEAD 回退到以前的版本才能回到历史提交。这个例子将回到最初的提交处: + +``` +$ git log --oneline +d512580 restoring filename from first commit +79a4e5f bad take +f449007 The second commit +55df4c2 My great project, first commit. + +$ git checkout 55df4c2 +``` + +当你以这种方式回退,如果你重新开始提交,会丢失以前的工作。Git 默认假定你不想这样做,所以将 HEAD 从项目中分离出来,并将以前的记录保存下来。 + +如果你想看看以前的版本,想要重新做或者尝试不同的方法,那么安全一点的方式就是创建一个新的分支。可以将这个过程想象为尝试同一首歌曲的不同版本,或者创建一个混音的。原始的依然存在,关闭分支做你想做的版本吧。 + +把你的 Git HEAD 回退到另一个起点处: + +``` +$ git checkout -b remix +Switched to a new branch 'remix' +``` + +现在你已经切换到了另一个分支,你当前的工作区是干净的,准备开始工作吧。 + +也可以不用改变时间线来做同样的事情。也许你很想这么做,但切换到一个临时的工作区只是为了尝试一些疯狂的想法。这在工作中完全是可以接受的,请看: + +``` +$ git status +On branch master +nothing to commit, working directory clean + +$ git checkout -b crazy_idea +Switched to a new branch 'crazy_idea' +``` + +现在你有一个干净的工作空间,在这里你可以完成一些奇怪的想法。一旦你完成了,可以保留你的改变,或者丢弃他们,并切换回你的主分支。 + +若要放弃你的想法,切换到你的主分支,假装新分支不存在: + +``` +$ git checkout master +``` + +想要继续使用你的 crazy ideas,需要把他们拉回到主分支,切换到主分支然后合并新分支到主分支: + +``` +$ git checkout master +$ git merge crazy_idea +``` + +git 的分支功能很强大,在克隆仓库后为开发人员创建一个新分支是很常见的;这样,他们所有的工作都在自己的分支上,可以提交并合并到主分支。Git 是很灵活的,所以没有“正确”或“错误”的方式(甚至一个主分支也可以区分远程分支),但分支易于分离任务和提交贡献。两个人之间可以有很多的 Git 分支。 + +### 远程协作 + +到目前为止你已经在自己的家目录下维护着一个 Git 仓库,但如何与其他人协同工作呢? + +有好几种不同的方式来设置 Git 以便让多人可以同时在一个项目上工作,所以首先我们要克隆仓库,是否你已经从某人的 Git 服务器或 GitHub 主页克隆了一个仓库,或在局域网中使用了共享存储。 + +工作在私人仓库下和共享仓库唯一不同的是你需要把你的改变提交到别人的仓库。我们把工作的仓库称之为本地仓库,其他仓库称为远程仓库。 + + +当你以读写的方式克隆一个仓库时,克隆的仓库会继承远程库并且你会看到一个名为 origin 的远程库。你可以看看克隆的远程仓库: + +``` +$ git remote --verbose +origin seth@example.com:~/myproject.Git (fetch) +origin seth@example.com:~/myproject.Git (push) +``` + +有一个 origin 远程库非常有用,因为它有异地备份的功能,并允许其他人在该项目上工作。 + +如果克隆没有继承 origin 远程库,或者如果你选择以后再添加,可以使用 git remote 命令: + +``` +$ git remote add seth@example.com:~/myproject.Git +``` + +如果你修改了文件,想把它们发到有读写权限的 origin 远程库,使用 git push。第一次推送改变,必须发送分支信息。不直接在主分支上工作是一个很好的做法,除非你被要求这样做: + +``` +$ git checkout -b seth-dev +$ git add exciting-new-file.txt +$ git commit -m 'first push to remote' +$ git push -u origin HEAD +``` + +它会推送你当前的位置(HEAD)和存在的分支到远程。当推送过一次后,以后每次推送可以不使用 -u 选项: + +``` +$ git add another-file.txt +$ git commit -m 'another push to remote' +$ git push origin HEAD +``` + +### 合并分支 + +当一个人工作在一个 Git 仓库时,你可以合并任意测试分支到主分支。当团队协作时,你可能会想检查他们的改变,然后再将它们合并到主分支: + +``` +$ git checkout contributor +$ git pull +$ less blah.txt # 检查改变的文件 +$ git checkout master +$ git merge contributor +``` + +如果你正在使用 GitHub 或 GitLab 以及类似的东西,虽然过程是不同的,但克隆项目并把它作为你自己的仓库都是相似的。你可以在本地工作,将改变提交到 GitHub 或 GitLab 帐户,其他人对这些仓库没有任何权限。 + +如果你想要为克隆的仓库推送,需要创建了一个拉取请求,它使用 Web 服务的后端发送补丁到真正的拥有者,并允许他们审查和拉取的改变。 + +克隆一个项目通常是在 Web 服务端完成的,它和使用 Git 命令来管理项目是类似的,甚至推送的过程。然后它返回到 Web 服务打开一个拉取请求,工作就完成了。 + +下一部分我们将整合一些有用的插件到 Git 中来帮你轻松的完成日常工作。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/16/7/how-restore-older-file-versions-git + +作者:[Seth Kenlon][a] +译者:[译者ID](https://github.com/strugglingyouth) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth From c9682e0c75005ff6d54edc8f9c7125de1c9dd312 Mon Sep 17 00:00:00 2001 From: tianfeiyu Date: Mon, 8 Aug 2016 10:21:59 +0800 Subject: [PATCH 1379/1469] Delete 20160726 How to restore older file versions in Git.md --- ...w to restore older file versions in Git.md | 182 ------------------ 1 file changed, 182 deletions(-) delete mode 100644 sources/tech/20160726 How to restore older file versions in Git.md diff --git a/sources/tech/20160726 How to restore older file versions in Git.md b/sources/tech/20160726 How to restore older file versions in Git.md deleted file mode 100644 index 675167aaad..0000000000 --- a/sources/tech/20160726 How to restore older file versions in Git.md +++ /dev/null @@ -1,182 +0,0 @@ -translated by strugglingyouth -How to restore older file versions in Git -============================================= - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/file_system.jpg?itok=s2b60oIB) - -In today's article you will learn how to find out where you are in the history of your project, how to restore older file versions, and how to make Git branches so you can safely conduct wild experiments. - -Where you are in the history of your Git project, much like your location in the span of a rock album, is determined by a marker called HEAD (like the playhead of a tape recorder or record player). To move HEAD around in your own Git timeline, use the git checkout command. - -There are two ways to use the git checkout command. A common use is to restore a file from a previous commit, and you can also rewind your entire tape reel and go in an entirely different direction. - -### Restore a file - -This happens when you realize you've utterly destroyed an otherwise good file. We all do it; we get a file to a great place, we add and commit it, and then we decide that what it really needs is one last adjustment, and the file ends up completely unrecognizable. - -To restore it to its former glory, use git checkout from the last known commit, which is HEAD: - -``` -$ git checkout HEAD filename -``` - -If you accidentally committed a bad version of a file and need to yank a version from even further back in time, look in your Git log to see your previous commits, and then check it out from the appropriate commit: - -``` -$ git log --oneline -79a4e5f bad take -f449007 The second commit -55df4c2 My great project, first commit. - -$ git checkout 55df4c2 filename - -``` - -Now the older version of the file is restored into your current position. (You can see your current status at any time with the git status command.) You need to add the file because it has changed, and then commit it: - -``` -$ git add filename -$ git commit -m 'restoring filename from first commit.' -``` - -Look in your Git log to verify what you did: - -``` -$ git log --oneline -d512580 restoring filename from first commit -79a4e5f bad take -f449007 The second commit -55df4c2 My great project, first commit. -``` - -Essentially, you have rewound the tape and are taping over a bad take. So you need to re-record the good take. - -### Rewind the timeline - -The other way to check out a file is to rewind the entire Git project. This introduces the idea of branches, which are, in a way, alternate takes of the same song. - -When you go back in history, you rewind your Git HEAD to a previous version of your project. This example rewinds all the way back to your original commit: - -``` -$ git log --oneline -d512580 restoring filename from first commit -79a4e5f bad take -f449007 The second commit -55df4c2 My great project, first commit. - -$ git checkout 55df4c2 -``` - -When you rewind the tape in this way, if you hit the record button and go forward, you are destroying your future work. By default, Git assumes you do not want to do this, so it detaches HEAD from the project and lets you work as needed without accidentally recording over something you have recorded later. - -If you look at your previous version and realise suddenly that you want to re-do everything, or at least try a different approach, then the safe way to do that is to create a new branch. You can think of this process as trying out a different version of the same song, or creating a remix. The original material exists, but you're branching off and doing your own version for fun. - -To get your Git HEAD back down on blank tape, make a new branch: - -``` -$ git checkout -b remix -Switched to a new branch 'remix' -``` - -Now you've moved back in time, with an alternate and clean workspace in front of you, ready for whatever changes you want to make. - -You can do the same thing without moving in time. Maybe you're perfectly happy with how your progress is going, but would like to switch to a temporary workspace just to try some crazy ideas out. That's a perfectly acceptable workflow, as well: - -``` -$ git status -On branch master -nothing to commit, working directory clean - -$ git checkout -b crazy_idea -Switched to a new branch 'crazy_idea' -``` - -Now you have a clean workspace where you can sandbox some crazy new ideas. Once you're done, you can either keep your changes, or you can forget they ever existed and switch back to your master branch. - -To forget your ideas in shame, change back to your master branch and pretend your new branch doesn't exist: - -``` -$ git checkout master -``` - -To keep your crazy ideas and pull them back into your master branch, change back to your master branch and merge your new branch: - -``` -$ git checkout master -$ git merge crazy_idea -``` - -Branches are powerful aspects of git, and it's common for developers to create a new branch immediately after cloning a repository; that way, all of their work is contained on their own branch, which they can submit for merging to the master branch. Git is pretty flexible, so there's no "right" or "wrong" way (even a master branch can be distinguished from what remote it belongs to), but branching makes it easy to separate tasks and contributions. Don't get too carried away, but between you and me, you can have as many Git branches as you please. They're free! - -### Working with remotes - -So far you've maintained a Git repository in the comfort and privacy of your own home, but what about when you're working with other people? - -There are several different ways to set Git up so that many people can work on a project at once, so for now we'll focus on working on a clone, whether you got that clone from someone's personal Git server or their GitHub page, or from a shared drive on the same network. - -The only difference between working on your own private Git repository and working on something you want to share with others is that at some point, you need to push your changes to someone else's repository. We call the repository you are working in a local repository, and any other repository a remote. - -When you clone a repository with read and write permissions from another source, your clone inherits the remote from whence it came as its origin. You can see a clone's remote: - -``` -$ git remote --verbose -origin seth@example.com:~/myproject.Git (fetch) -origin seth@example.com:~/myproject.Git (push) -``` - -Having a remote origin is handy because it is functionally an offsite backup, and it also allows someone else to be working on the project. - -If your clone didn't inherit a remote origin, or if you choose to add one later, use the git remote command: - -``` -$ git remote add seth@example.com:~/myproject.Git -``` - -If you have changed files and want to send them to your remote origin, and have read and write permissions to the repository, use git push. The first time you push changes, you must also send your branch information. It is a good practice to not work on master, unless you've been told to do so: - -``` -$ git checkout -b seth-dev -$ git add exciting-new-file.txt -$ git commit -m 'first push to remote' -$ git push -u origin HEAD -``` - -This pushes your current location (HEAD, naturally) and the branch it exists on to the remote. After you've pushed your branch once, you can drop the -u option: - -``` -$ git add another-file.txt -$ git commit -m 'another push to remote' -$ git push origin HEAD -``` - -### Merging branches - -When you're working alone in a Git repository you can merge test branches into your master branch whenever you want. When working in tandem with a contributor, you'll probably want to review their changes before merging them into your master branch: - -``` -$ git checkout contributor -$ git pull -$ less blah.txt # review the changed files -$ git checkout master -$ git merge contributor -``` - -If you are using GitHub or GitLab or something similar, the process is different. There, it is traditional to fork the project and treat it as though it is your own repository. You can work in the repository and send changes to your GitHub or GitLab account without getting permission from anyone, because it's your repository. - -If you want the person you forked it from to receive your changes, you create a pull request, which uses the web service's backend to send patches to the real owner, and allows them to review and pull in your changes. - -Forking a project is usually done on the web service, but the Git commands to manage your copy of the project are the same, even the push process. Then it's back to the web service to open a pull request, and the job is done. - -In our next installment we'll look at some convenience add-ons to help you integrate Git comfortably into your everyday workflow. - --------------------------------------------------------------------------------- - -via: https://opensource.com/life/16/7/how-restore-older-file-versions-git - -作者:[Seth Kenlon][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth From a35ac1e11429c9144d7f37b972c83ffb619f7e63 Mon Sep 17 00:00:00 2001 From: ChrisLeeGit Date: Mon, 8 Aug 2016 12:56:47 +0800 Subject: [PATCH 1380/1469] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91W?= =?UTF-8?q?eb=20Service=20Efficiency=20at=20Instagram=20with=20Python?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0160602 Web Service Efficiency at Instagram with Python.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20160602 Web Service Efficiency at Instagram with Python.md b/sources/tech/20160602 Web Service Efficiency at Instagram with Python.md index f637331336..b3cf1f4192 100644 --- a/sources/tech/20160602 Web Service Efficiency at Instagram with Python.md +++ b/sources/tech/20160602 Web Service Efficiency at Instagram with Python.md @@ -1,3 +1,5 @@ +Being translated by ChrisLeeGit + Web Service Efficiency at Instagram with Python =============================================== @@ -64,7 +66,7 @@ With the work we’ve put into building the efficiency framework for Instagram via: https://engineering.instagram.com/web-service-efficiency-at-instagram-with-python-4976d078e366#.tiakuoi4p 作者:[Min Ni][a] -译者:[译者ID](https://github.com/译者ID) +译者:[ChrisLeeGit](https://github.com/chrisleegit) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 663745585c2fe69538436b10e1720ce9f184c178 Mon Sep 17 00:00:00 2001 From: Markgolzh Date: Mon, 8 Aug 2016 13:48:47 +0800 Subject: [PATCH 1381/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= =?UTF-8?q?=EF=BC=8Dby=20zky001?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译文件 --- ...ce portfolio - Machine learning project.md | 189 ++++++++++++++++++ 1 file changed, 189 insertions(+) create mode 100644 sources/team_test/part 3Building a data science portfolio - Machine learning project.md diff --git a/sources/team_test/part 3Building a data science portfolio - Machine learning project.md b/sources/team_test/part 3Building a data science portfolio - Machine learning project.md new file mode 100644 index 0000000000..8160ef18b6 --- /dev/null +++ b/sources/team_test/part 3Building a data science portfolio - Machine learning project.md @@ -0,0 +1,189 @@ +### 获取数据 + +一旦我们拥有项目的基本架构,我们就可以去获得原始数据 + +Fannie Mae 对获取数据有一些限制,所有你需要去注册一个账户。在创建完账户之后,你可以找到下载页面[在这里][26],你可以按照你所需要的下载非常少量或者很多的借款数据文件。文件格式是zip,在解压后当然是非常大的。 + +为了达到我们这个博客文章的目的,我们将要下载从2012年1季度到2015 +年1季度的所有数据。接着我们需要解压所有的文件。解压过后,删掉原来的.zip格式的文件。最后,借款预测文件夹看起来应该像下面的一样: +``` +loan-prediction +├── data +│ ├── Acquisition_2012Q1.txt +│ ├── Acquisition_2012Q2.txt +│ ├── Performance_2012Q1.txt +│ ├── Performance_2012Q2.txt +│ └── ... +├── processed +├── .gitignore +├── README.md +├── requirements.txt +├── settings.py +``` + +在下载完数据后,你可以在shell命令行中使用head和tail命令去查看文件中的行数据,你看到任何的不需要的列数据了吗?在做这件事的同时查阅[列名称的pdf文件][27]可能是有用的事情。 +### 读入数据 + +有两个问题让我们的数据难以现在就使用: +- 收购数据和业绩数据被分割在多个文件中 +- 每个文件都缺少标题 + +在我们开始使用数据之前,我们需要首先明白我们要在哪里去存一个收购数据的文件,同时到哪里去存储一个业绩数据的文件。每个文件仅仅需要包括我们关注的那些数据列,同时拥有正确的标题。这里有一个小问题是业绩数据非常大,因此我们需要尝试去修剪一些数据列。 + +第一步是向settings.py文件中增加一些变量,这个文件中同时也包括了我们原始数据的存放路径和处理出的数据存放路径。我们同时也将添加其他一些可能在接下来会用到的设置数据: +``` +DATA_DIR = "data" +PROCESSED_DIR = "processed" +MINIMUM_TRACKING_QUARTERS = 4 +TARGET = "foreclosure_status" +NON_PREDICTORS = [TARGET, "id"] +CV_FOLDS = 3 +``` + +把路径设置在settings.py中将使它们放在一个集中的地方,同时使其修改更加的容易。当提到在多个文件中的相同的变量时,你想改变它的话,把他们放在一个地方比分散放在每一个文件时更加容易。[这里的][28]是一个这个工程的示例settings.py文件 + +第二步是创建一个文件名为assemble.py,它将所有的数据分为2个文件。当我们运行Python assemble.py,我们在处理数据文件的目录会获得2个数据文件。 + +接下来我们开始写assemble.py文件中的代码。首先我们需要为每个文件定义相应的标题,因此我们需要查看[列名称的pdf文件][29]同时创建在每一个收购数据和业绩数据的文件的列数据的列表: +``` +HEADERS = { + "Acquisition": [ + "id", + "channel", + "seller", + "interest_rate", + "balance", + "loan_term", + "origination_date", + "first_payment_date", + "ltv", + "cltv", + "borrower_count", + "dti", + "borrower_credit_score", + "first_time_homebuyer", + "loan_purpose", + "property_type", + "unit_count", + "occupancy_status", + "property_state", + "zip", + "insurance_percentage", + "product_type", + "co_borrower_credit_score" + ], + "Performance": [ + "id", + "reporting_period", + "servicer_name", + "interest_rate", + "balance", + "loan_age", + "months_to_maturity", + "maturity_date", + "msa", + "delinquency_status", + "modification_flag", + "zero_balance_code", + "zero_balance_date", + "last_paid_installment_date", + "foreclosure_date", + "disposition_date", + "foreclosure_costs", + "property_repair_costs", + "recovery_costs", + "misc_costs", + "tax_costs", + "sale_proceeds", + "credit_enhancement_proceeds", + "repurchase_proceeds", + "other_foreclosure_proceeds", + "non_interest_bearing_balance", + "principal_forgiveness_balance" + ] +} +``` + + +接下来一步是定义我们想要保持的数据列。我们将需要保留收购数据中的所有列数据,丢弃列数据将会使我们节省下内存和硬盘空间,同时也会加速我们的代码。 +``` +SELECT = { + "Acquisition": HEADERS["Acquisition"], + "Performance": [ + "id", + "foreclosure_date" + ] +} +``` + +下一步,我们将编写一个函数来连接数据集。下面的代码将: +- 引用一些需要的库,包括设置。 +- 定义一个函数concatenate, 目的是: + - 获取到所有数据目录中的文件名. + - 在每个文件中循环. + - 如果文件不是正确的格式 (不是以我们需要的格式作为开头), 我们将忽略它. + - 把文件读入一个[数据帧][30] 伴随着正确的设置通过使用Pandas [读取csv][31]函数. + - 在|处设置分隔符以便所有的字段能被正确读出. + - 数据没有标题行,因此设置标题为None来进行标示. + - 从HEADERS字典中设置正确的标题名称 – 这将会是我们数据帧中的数据列名称. + - 通过SELECT来选择我们加入数据的数据帧中的列. +- 把所有的数据帧共同连接在一起. +- 把已经连接好的数据帧写回一个文件. + +``` +import os +import settings +import pandas as pd + +def concatenate(prefix="Acquisition"): + files = os.listdir(settings.DATA_DIR) + full = [] + for f in files: + if not f.startswith(prefix): + continue + + data = pd.read_csv(os.path.join(settings.DATA_DIR, f), sep="|", header=None, names=HEADERS[prefix], index_col=False) + data = data[SELECT[prefix]] + full.append(data) + + full = pd.concat(full, axis=0) + + full.to_csv(os.path.join(settings.PROCESSED_DIR, "{}.txt".format(prefix)), sep="|", header=SELECT[prefix], index=False) +``` + +我们可以通过调用上面的函数,通过传递的参数收购和业绩两次以将所有收购和业绩文件连接在一起。下面的代码将: +- 仅仅在脚本被在命令行中通过python assemble.py被唤起而执行. +- 将所有的数据连接在一起,并且产生2个文件: + - `processed/Acquisition.txt` + - `processed/Performance.txt` + +``` +if __name__ == "__main__": + concatenate("Acquisition") + concatenate("Performance") +``` + +我们现在拥有了一个漂亮的,划分过的assemble.py文件,它很容易执行,也容易被建立。通过像这样把问题分解为一块一块的,我们构建工程就会变的容易许多。不用一个可以做所有的凌乱的脚本,我们定义的数据将会在多个脚本间传递,同时使脚本间完全的0耦合。当你正在一个大的项目中工作,这样做是一个好的想法,因为这样可以更佳容易的修改其中的某一部分而不会引起其他项目中不关联部分产生超出预期的结果。 + +一旦我们完成assemble.py脚本文件, 我们可以运行python assemble.py命令. 你可以查看完整的assemble.py文件[在这里][32]. + +这将会在处理结果目录下产生2个文件: + +``` +loan-prediction +├── data +│ ├── Acquisition_2012Q1.txt +│ ├── Acquisition_2012Q2.txt +│ ├── Performance_2012Q1.txt +│ ├── Performance_2012Q2.txt +│ └── ... +├── processed +│ ├── Acquisition.txt +│ ├── Performance.txt +├── .gitignore +├── assemble.py +├── README.md +├── requirements.txt +├── settings.py +``` + From d0189a1cc583c498a595868e2cbb19c5d749c5fc Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 8 Aug 2016 19:25:02 +0800 Subject: [PATCH 1382/1469] PUB:20160725 Part 10 - Learn How to Use Awk Built-in Variables.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @ChrisLeeGit 你的译文质量很好,谢谢你的贡献。就此文,有一点需要说明的:1、内置变量列表那里,原文有些表述是不清晰的,也不好确定其原意,所以从译文中删除了,以 免引起读者疑惑。(我估计原意应该是“最好不要修改该变量值”,但是和原文相去较远)2、文末提及“请继续关注 Tecmint”,我们并不是避讳提及 Tecmint (原文链接保留,并明确表明本文是译文),但是发表在 LC 的话就有点感觉突兀,所以做了修改。 3、“段”修改为“字段”。以上,请了解。 --- ...Learn How to Use Awk Built-in Variables.md | 62 +++++++++++-------- 1 file changed, 36 insertions(+), 26 deletions(-) rename translated/tech/awk/20160725 Part 10 - Learn How to Use Awk Built-in Variables.md => published/awk/Part 10 - Learn How to Use Awk Built-in Variables.md (64%) diff --git a/translated/tech/awk/20160725 Part 10 - Learn How to Use Awk Built-in Variables.md b/published/awk/Part 10 - Learn How to Use Awk Built-in Variables.md similarity index 64% rename from translated/tech/awk/20160725 Part 10 - Learn How to Use Awk Built-in Variables.md rename to published/awk/Part 10 - Learn How to Use Awk Built-in Variables.md index 321b1dc588..70f494fb90 100644 --- a/translated/tech/awk/20160725 Part 10 - Learn How to Use Awk Built-in Variables.md +++ b/published/awk/Part 10 - Learn How to Use Awk Built-in Variables.md @@ -1,18 +1,19 @@ awk 系列:如何使用 awk 内置变量 ================================================= -我们将逐渐揭开 awk 功能的神秘面纱,在本节中,我们将介绍 awk 内置(built-in)变量的概念。你可以在 awk 中使用两种类型的变量,它们是:用户自定义(user-defined)变量(我们在第八节中已经介绍了)和内置变量。 +我们将逐渐揭开 awk 功能的神秘面纱,在本节中,我们将介绍 awk 内置(built-in)变量的概念。你可以在 awk 中使用两种类型的变量,它们是:用户自定义(user-defined)变量(我们在[第八节][1]中已经介绍了)和内置变量。 ![](http://www.tecmint.com/wp-content/uploads/2016/07/Awk-Built-in-Variables-Examples.png) -> awk 内置变量示例 + +*awk 内置变量示例* awk 内置变量已经有预先定义的值了,但我们也可以谨慎地修改这些值,awk 内置变量包括: -- `FILENAME` : 当前输入文件名称(不要修改变量名) -- `NR` : 当前输入行编号(是指输入行 1,2,3……等,不要改变变量名) -- `NF` : 当前输入行段编号(不要修改变量名) -- `OFS` : 输出段分隔符 -- `FS` : 输入段分隔符 +- `FILENAME` : 当前输入文件名称 +- `NR` : 当前输入行编号(是指输入行 1,2,3……等) +- `NF` : 当前输入行的字段编号 +- `OFS` : 输出字段分隔符 +- `FS` : 输入字段分隔符 - `ORS` : 输出记录分隔符 - `RS` : 输入记录分隔符 @@ -25,7 +26,8 @@ $ awk ' { print FILENAME } ' ~/domains.txt ``` ![](http://www.tecmint.com/wp-content/uploads/2016/07/Awk-FILENAME-Variable.png) -> awk FILENAME 变量 + +*awk FILENAME 变量* 你会看到,每一行都会对应输出一次文件名,那是你使用 `FILENAME` 内置变量时 awk 默认的行为。 @@ -38,42 +40,46 @@ $ cat ~/domains.txt ``` ![](http://www.tecmint.com/wp-content/uploads/2016/07/Print-Contents-of-File.png) -> 输出文件内容 + +*输出文件内容* ``` -$ awk ' END { print "文件记录数是:", NR } ' ~/domains.txt +$ awk ' END { print "Number of records in file is: ", NR } ' ~/domains.txt ``` ![](http://www.tecmint.com/wp-content/uploads/2016/07/Awk-Count-Number-of-Lines.png) -> awk 统计行数 -想要统计一条记录或一行中的段数,我们可以像下面那样使用 NR 内置变量: +*awk 统计行数* + +想要统计一条记录或一行中的字段数,我们可以像下面那样使用 NR 内置变量: ``` $ cat ~/names.txt ``` ![](http://www.tecmint.com/wp-content/uploads/2016/07/List-File-Contents.png) -> 列出文件内容 + +*列出文件内容* ``` -$ awk '{ print "记录:",NR,"有",NF,"段" ; }' ~/names.txt +$ awk '{ "Record:",NR,"has",NF,"fields" ; }' ~/names.txt ``` ![](http://www.tecmint.com/wp-content/uploads/2016/07/Awk-Count-Number-of-Fields-in-File.png) -> awk 统计文件中的段数 -接下来,你也可以使用 FS 内置变量指定一个输入文件分隔符,它会定义 awk 如何将输入行划分成段。 +*awk 统计文件中的字段数* -FS 默认值为空格和 TAB,但我们也能将 FS 值修改为任何字符来让 awk 根据情况分隔输入行。 +接下来,你也可以使用 FS 内置变量指定一个输入文件分隔符,它会定义 awk 如何将输入行划分成字段。 + +FS 默认值为“空格”和“制表符”,但我们也能将 FS 值修改为任何字符来让 awk 根据情况切分输入行。 有两种方法可以达到目的: - 第一种方法是使用 FS 内置变量 - 第二种方法是使用 awk 的 -F 选项 -来看 Linux 系统上的 `/etc/passwd` 文件,该文件中的各段是使用 `:` 分隔的,因此,当我们想要过滤出某些段时,可以将 `:` 指定为新的输入段分隔符,示例如下: +来看 Linux 系统上的 `/etc/passwd` 文件,该文件中的各字段是使用 `:` 分隔的,因此,当我们想要过滤出某些字段时,可以将 `:` 指定为新的输入字段分隔符,示例如下: 我们可以使用 `-F` 选项,如下: @@ -82,7 +88,8 @@ $ awk -F':' '{ print $1, $4 ;}' /etc/passwd ``` ![](http://www.tecmint.com/wp-content/uploads/2016/07/Awk-Filter-Fields-in-Password-File.png) -> awk 过滤密码文件中的各段 + +*awk 过滤密码文件中的各字段* 此外,我们也可以利用 FS 内置变量,如下: @@ -91,29 +98,32 @@ $ awk ' BEGIN { FS=“:” ; } { print $1, $4 ; } ' /etc/passwd ``` ![](http://www.tecmint.com/wp-content/uploads/2016/07/Filter-Fields-in-File-Using-Awk.png) -> 使用 awk 过滤文件中的各段 -使用 OFS 内置变量来指定一个输出段分隔符,它会定义如何使用指定的字符分隔输出段,示例如下: +*使用 awk 过滤文件中的各字段* + +使用 OFS 内置变量来指定一个用于输出的字段分隔符,它会定义如何使用指定的字符分隔输出字段,示例如下: ``` $ awk -F':' ' BEGIN { OFS="==>" ;} { print $1, $4 ;}' /etc/passwd ``` ![](http://www.tecmint.com/wp-content/uploads/2016/07/Add-Separator-to-Field-in-File.png) -> 向文件中的段添加分隔符 -在第十节(即本节)中,我们已经学习了使用含有预定义值的 awk 内置变量的理念。但我们也能够修改这些值,虽然并不推荐这样做,除非你晓得自己在做什么,并且充分理解(这些变量值)。 +*向文件中的字段添加分隔符* -此后,我们将继续学习如何在 awk 命令操作中使用 shell 变量,所以,请继续关注 Tecmint。 +在本节中,我们已经学习了使用含有预定义值的 awk 内置变量的理念。但我们也能够修改这些值,虽然并不推荐这样做,除非你明白自己在做什么,并且充分理解(这些变量值)。 + +此后,我们将继续学习如何在 awk 命令操作中使用 shell 变量,所以,请继续关注我们。 -------------------------------------------------------------------------------- -via: http://www.tecmint.com/awk-built-in-variables-examples/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tecmint+%28Tecmint%3A+Linux+Howto%27s+Guide%29 +via: http://www.tecmint.com/awk-built-in-variables-examples/ 作者:[Aaron Kili][a] 译者:[ChrisLeeGit](https://github.com/chrisleegit) -校对:[校对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/aaronkili/ +[1]: https://linux.cn/article-7650-1.html From d6fcd00f942ae449783fc4200afeff6645bc5fb8 Mon Sep 17 00:00:00 2001 From: Stdio A Date: Mon, 8 Aug 2016 21:04:30 +0800 Subject: [PATCH 1383/1469] =?UTF-8?q?Translate=2020160406=20Let=E2=80=99s?= =?UTF-8?q?=20Build=20A=20Web=20Server.=20Part=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20160406 Let’s Build A Web Server. Part 2.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160406 Let’s Build A Web Server. Part 2.md b/sources/tech/20160406 Let’s Build A Web Server. Part 2.md index 482352ac9a..15593c5085 100644 --- a/sources/tech/20160406 Let’s Build A Web Server. Part 2.md +++ b/sources/tech/20160406 Let’s Build A Web Server. Part 2.md @@ -1,3 +1,5 @@ +Translating by StdioA + Let’s Build A Web Server. Part 2. =================================== From d34a8f088ddf2727786a85f747242319dbd98ba7 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 8 Aug 2016 21:16:39 +0800 Subject: [PATCH 1384/1469] =?UTF-8?q?PUB:20160309=20Let=E2=80=99s=20Build?= =?UTF-8?q?=20A=20Web=20Server.=20Part=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @StdioA 翻译的不错,轻松诙谐。继续加油将本系列搞定! --- ...160309 Let’s Build A Web Server. Part 1.md | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) rename {translated/tech => published}/20160309 Let’s Build A Web Server. Part 1.md (76%) diff --git a/translated/tech/20160309 Let’s Build A Web Server. Part 1.md b/published/20160309 Let’s Build A Web Server. Part 1.md similarity index 76% rename from translated/tech/20160309 Let’s Build A Web Server. Part 1.md rename to published/20160309 Let’s Build A Web Server. Part 1.md index 8ccee84871..d55d5720d2 100644 --- a/translated/tech/20160309 Let’s Build A Web Server. Part 1.md +++ b/published/20160309 Let’s Build A Web Server. Part 1.md @@ -1,4 +1,4 @@ -搭个 Web 服务器:第一部分 +搭个 Web 服务器(一) ===================================== 一天,有一个正在散步的妇人恰好路过一个建筑工地,看到三个正在工作的工人。她问第一个人:“你在做什么?”第一个人没好气地喊道:“你没看到我在砌砖吗?”妇人对这个答案不满意,于是问第二个人:“你在做什么?”第二个人回答说:“我在建一堵砖墙。”说完,他转向第一个人,跟他说:“嗨,你把墙砌过头了。去把刚刚那块砖弄下来!”然而,妇人对这个答案依然不满意,于是又问了第三个人相同的问题。第三个人仰头看着天,对她说:“我在建造世界上最大的教堂。”当他回答时,第一个人和第二个人在为刚刚砌错的砖而争吵。他转向那两个人,说:“不用管那块砖了。这堵墙在室内,它会被水泥填平,没人会看见它的。去砌下一层吧。” @@ -9,17 +9,17 @@ 我相信,如果你想成为一个更好的开发者,你**必须**对日常使用的软件系统的内部结构有更深的理解,包括编程语言、编译器与解释器、数据库及操作系统、Web 服务器及 Web 框架。而且,为了更好更深入地理解这些系统,你**必须**从头开始,用一砖一瓦来重新构建这个系统。 -孔子曾经用这几句话来表达这种思想: +荀子曾经用这几句话来表达这种思想: ->“不闻不若闻之。” +>“不闻不若闻之。(I hear and I forget.)” ![](https://ruslanspivak.com/lsbasi-part4/LSBAWS_confucius_hear.png) ->“闻之不若见之。” +>“闻之不若见之。(I see and I remember.)” ![](https://ruslanspivak.com/lsbasi-part4/LSBAWS_confucius_see.png) ->“知之不若行之。” +>“知之不若行之。(I do and I understand.)” ![](https://ruslanspivak.com/lsbasi-part4/LSBAWS_confucius_do.png) @@ -59,7 +59,7 @@ Hello, World! client_connection.close() ``` -将以上代码保存为 webserver1.py,或者直接从 GitHub 上下载这个文件。然后,在命令行中运行这个程序。像这样: +将以上代码保存为 webserver1.py,或者直接从 [GitHub][1] 上下载这个文件。然后,在命令行中运行这个程序。像这样: ``` $ python webserver1.py @@ -72,15 +72,15 @@ Serving HTTP on port 8888 … 说真的,快去试一试。你做实验的时候,我会等着你的。 -完成了?不错。现在我们来讨论一下它实际上是怎么工作的。 +完成了?不错!现在我们来讨论一下它实际上是怎么工作的。 -首先我们从你刚刚输入的 Web 地址开始。它叫 URL,这是它的基本结构: +首先我们从你刚刚输入的 Web 地址开始。它叫 [URL][2],这是它的基本结构: ![](https://ruslanspivak.com/lsbaws-part1/LSBAWS_URL_Web_address.png) URL 是一个 Web 服务器的地址,浏览器用这个地址来寻找并连接 Web 服务器,并将上面的内容返回给你。在你的浏览器能够发送 HTTP 请求之前,它需要与 Web 服务器建立一个 TCP 连接。然后会在 TCP 连接中发送 HTTP 请求,并等待服务器返回 HTTP 响应。当你的浏览器收到响应后,就会显示其内容,在上面的例子中,它显示了“Hello, World!”。 -我们来进一步探索在发送 HTTP 请求之前,客户端与服务器建立 TCP 连接的过程。为了建立链接,它们使用了所谓“套接字”。我们现在不直接使用浏览器发送请求,而在命令行中使用 telnet 来人工模拟这个过程。 +我们来进一步探索在发送 HTTP 请求之前,客户端与服务器建立 TCP 连接的过程。为了建立链接,它们使用了所谓“套接字(socket)”。我们现在不直接使用浏览器发送请求,而在命令行中使用 `telnet` 来人工模拟这个过程。 在你运行 Web 服务器的电脑上,在命令行中建立一个 telnet 会话,指定一个本地域名,使用端口 8888,然后按下回车: @@ -94,7 +94,7 @@ Connected to localhost. ![](https://ruslanspivak.com/lsbaws-part1/LSBAWS_socket.png) -在同一个 telnet 会话中,输入 GET /hello HTTP/1.1,然后输入回车: +在同一个 telnet 会话中,输入 `GET /hello HTTP/1.1`,然后输入回车: ``` $ telnet localhost 8888 @@ -106,11 +106,11 @@ HTTP/1.1 200 OK Hello, World! ``` -你刚刚手动模拟了你的浏览器!你发送了 HTTP 请求,并且收到了一个 HTTP 应答。下面是一个 HTTP 请求的基本结构: +你刚刚手动模拟了你的浏览器(的工作)!你发送了 HTTP 请求,并且收到了一个 HTTP 应答。下面是一个 HTTP 请求的基本结构: ![](https://ruslanspivak.com/lsbaws-part1/LSBAWS_HTTP_request_anatomy.png) -HTTP 请求的第一行由三部分组成:HTTP 方法(GET,因为我们想让我们的服务器返回一些内容),以及标明所需页面的路径 /hello,还有协议版本。 +HTTP 请求的第一行由三部分组成:HTTP 方法(`GET`,因为我们想让我们的服务器返回一些内容),以及标明所需页面的路径 `/hello`,还有协议版本。 为了简单一些,我们刚刚构建的 Web 服务器完全忽略了上面的请求内容。你也可以试着输入一些无用内容而不是“GET /hello HTTP/1.1”,但你仍然会收到一个“Hello, World!”响应。 @@ -120,19 +120,19 @@ HTTP 请求的第一行由三部分组成:HTTP 方法(GET,因为我们想 ![](https://ruslanspivak.com/lsbaws-part1/LSBAWS_HTTP_response_anatomy.png) -我们来解析它。这个响应由三部分组成:一个状态行 HTTP/1.1 200 OK,后面跟着一个空行,再下面是响应正文。 +我们来解析它。这个响应由三部分组成:一个状态行 `HTTP/1.1 200 OK`,后面跟着一个空行,再下面是响应正文。 -HTTP 响应的状态行 HTTP/1.1 200 OK 包含 HTTP 版本号,HTTP 状态码以及 HTTP 状态短语“OK”。当浏览器收到响应后,它会将响应正文显示出来,这也就是为什么你会在浏览器中看到“Hello, World!”。 +HTTP 响应的状态行 HTTP/1.1 200 OK 包含了 HTTP 版本号,HTTP 状态码以及 HTTP 状态短语“OK”。当浏览器收到响应后,它会将响应正文显示出来,这也就是为什么你会在浏览器中看到“Hello, World!”。 以上就是 Web 服务器的基本工作模型。总结一下:Web 服务器创建一个处于监听状态的套接字,循环接收新的连接。客户端建立 TCP 连接成功后,会向服务器发送 HTTP 请求,然后服务器会以一个 HTTP 响应做应答,客户端会将 HTTP 的响应内容显示给用户。为了建立 TCP 连接,客户端和服务端均会使用套接字。 -现在,你应该了解了 Web 服务器的基本工作方式,你可以使用浏览器或其它 HTTP 客户端进行试验。如果你尝试过、观察过,你应该也能够使用 telnet,人工编写 HTTP 请求,成为一个人形 HTTP 客户端。 +现在,你应该了解了 Web 服务器的基本工作方式,你可以使用浏览器或其它 HTTP 客户端进行试验。如果你尝试过、观察过,你应该也能够使用 telnet,人工编写 HTTP 请求,成为一个“人形” HTTP 客户端。 -现在留一个小问题:“你要如何在不对程序做任何改动的情况下,在你刚刚搭建起来的 Web 服务器上适配 Django, Flask 或 Pyramid 应用呢? +现在留一个小问题:“你要如何在不对程序做任何改动的情况下,在你刚刚搭建起来的 Web 服务器上适配 Django, Flask 或 Pyramid 应用呢?” 我会在本系列的第二部分中来详细讲解。敬请期待。 -顺便,我在撰写《搭个 Web 服务器:从头开始》。这本书讲解了如何从头开始编写一个基本的 Web 服务器,里面包含本文中没有的更多细节。订阅邮件列表,你就可以获取到这本书的最新进展,以及发布日期。 +顺便,我在撰写一本名为《搭个 Web 服务器:从头开始》的书。这本书讲解了如何从头开始编写一个基本的 Web 服务器,里面包含本文中没有的更多细节。订阅邮件列表,你就可以获取到这本书的最新进展,以及发布日期。 -------------------------------------------------------------------------------- @@ -140,11 +140,11 @@ via: https://ruslanspivak.com/lsbaws-part1/ 作者:[Ruslan][a] 译者:[StdioA](https://github.com/StdioA) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://linkedin.com/in/ruslanspivak/ - - +[1]: https://github.com/rspivak/lsbaws/blob/master/part1/webserver1.py +[2]: http://en.wikipedia.org/wiki/Uniform_resource_locator From cb803378c0fe36c684705ef1766f0dc6e5263561 Mon Sep 17 00:00:00 2001 From: Markgolzh Date: Mon, 8 Aug 2016 23:32:24 +0800 Subject: [PATCH 1385/1469] =?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 删掉原文 --- ...Flatpak brings standalone apps to Linux.md | 35 ------------------- 1 file changed, 35 deletions(-) delete mode 100644 sources/tech/20160621 Flatpak brings standalone apps to Linux.md diff --git a/sources/tech/20160621 Flatpak brings standalone apps to Linux.md b/sources/tech/20160621 Flatpak brings standalone apps to Linux.md deleted file mode 100644 index c2c1b51e7b..0000000000 --- a/sources/tech/20160621 Flatpak brings standalone apps to Linux.md +++ /dev/null @@ -1,35 +0,0 @@ -翻译中:by zky001 -Flatpak brings standalone apps to Linux -=== - -![](https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/flatpak-945x400.jpg) - -The development team behind [Flatpak][1] has [just announced the general availability][2] of the Flatpak desktop application framework. Flatpak (which was also known during development as xdg-app) provides the ability for an application — bundled as a Flatpak — to be installed and run easily and consistently on many different Linux distributions. Applications bundled as Flatpaks also have the ability to be sandboxed for security, isolating them from your operating system, and other applications. Check out the [Flatpak website][3], and the [press release][4] for more information on the tech that makes up the Flatpak framework. - -### Installing Flatpak on Fedora - -For users wanting to run applications bundled as Flatpaks, installation on Fedora is easy, with Flatpak already available in the official Fedora 23 and Fedora 24 repositories. The Flatpak website has [full details on installation on Fedora][5], as well as how to install on Arch, Debian, Mageia, and Ubuntu. [Many applications][6] have builds already bundled with Flatpak — including LibreOffice, and nightly builds of popular graphics applications Inkscape and GIMP. - -### For Application Developers - -If you are an application developer, the Flatpak website also contains some great resources on getting started [bundling and distributing your applications with Flatpak][7]. These resources contain information on using Flakpak SDKs to build standalone, sandboxed Flatpak applications. - - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/introducing-flatpak/ - -作者:[Ryan Lerch][a] -译者:[zky001](https://github.com/zky001) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/introducing-flatpak/ -[1]: http://flatpak.org/ -[2]: http://flatpak.org/press/2016-06-21-flatpak-released.html -[3]: http://flatpak.org/ -[4]: http://flatpak.org/press/2016-06-21-flatpak-released.html -[5]: http://flatpak.org/getting.html -[6]: http://flatpak.org/apps.html -[7]: http://flatpak.org/developer.html From 51c318d8f16617a90be7b7264c64786dd7e552ea Mon Sep 17 00:00:00 2001 From: Markgolzh Date: Mon, 8 Aug 2016 23:33:44 +0800 Subject: [PATCH 1386/1469] =?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 中文翻译部分 --- ...Flatpak brings standalone apps to Linux.md | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 translated/tech/20160621 Flatpak brings standalone apps to Linux.md diff --git a/translated/tech/20160621 Flatpak brings standalone apps to Linux.md b/translated/tech/20160621 Flatpak brings standalone apps to Linux.md new file mode 100644 index 0000000000..cad3fff909 --- /dev/null +++ b/translated/tech/20160621 Flatpak brings standalone apps to Linux.md @@ -0,0 +1,36 @@ +翻译中:by zky001 +Flatpak给Linux带来了独立的应用 +=== + +![](https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/flatpak-945x400.jpg) + + +在[Flatpak][1]背后的开发团队已经[刚刚宣布Flatpak作为桌面应用开发框架基本的能力][2]。 Flatpak为一个应用提供了这种能力—提供了一个应用程序的能力,应用程序捆绑为Flatpak 被安装在许多不同的Linux发行版,并且它可以很轻易地运行。应用程序捆绑的Flatpaks也有沙盒安全能力,可以从你的操作系统隔离它们和其他应用程序。查看[Flatpak网站][3],[网站指导手册][4]来获取更多的关于Flatpak框架的技术。 + +### 在Fedora中安装Flatpak + +对于想要以打包格式Flatpaks来运行程序的话,安装在Fedora上是很容易的,Flatpak格式已经可以在官方的Fedora 23和Fedora 24版本源中获得。Flatpak网站有[完整的在Fedora上安装的细节][5],同时也有如何在Arch, Debian,Mageia,和Ubuntu中安装的方法。[许多的应用][6]已经使用Flatpak来进行打包构建的程序-包括LibreOffice,Inkscape和GIMP。 +### 对应用开发者 + +如果你是一个应用开发者,Flatpak网站也包含许多有关于[使用Flatpak打包和分发应用程序][7]的优秀资源。这些资源包括了使用Flakpak SDKs来构建独立的,沙河的Flakpak应用程序。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/introducing-flatpak/ + +作者:[Ryan Lerch][a] +译者:[zky001](https://github.com/zky001) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/introducing-flatpak/ +[1]: http://flatpak.org/ +[2]: http://flatpak.org/press/2016-06-21-flatpak-released.html +[3]: http://flatpak.org/ +[4]: http://flatpak.org/press/2016-06-21-flatpak-released.html +[5]: http://flatpak.org/getting.html +[6]: http://flatpak.org/apps.html +[7]: http://flatpak.org/developer.html + + From 7766872f2f0953237bfa8a06f0bb84700070f386 Mon Sep 17 00:00:00 2001 From: Purling Nayuki Date: Tue, 9 Aug 2016 01:25:56 +0800 Subject: [PATCH 1387/1469] Proofread 20160531 The Anatomy of a Linux User --- .../20160531 The Anatomy of a Linux User.md | 42 +++++++++---------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/translated/talk/20160531 The Anatomy of a Linux User.md b/translated/talk/20160531 The Anatomy of a Linux User.md index a404697347..116bd88b41 100644 --- a/translated/talk/20160531 The Anatomy of a Linux User.md +++ b/translated/talk/20160531 The Anatomy of a Linux User.md @@ -1,57 +1,55 @@ - - -一个 Linux 用户的故事 +深入理解 Linux 用戶 ================================ -**一些新的 GNU/Linux 用户都很清楚的知道 Linux 不是 Windows .其他很多人都不是很清楚的知道.最好的发行版设计者努力保持新的思想** +**一些新的 GNU/Linux 用户都很清楚地知道 Linux 不是 Windows。但其他人对此都不甚了解。最好的发行版设计者努力保持新的思想。** ### Linux 的核心 -不管怎么说,Nicky 都不是那种表面上看起来很值得注意的人.她已经三十岁了,却决定回到学校学习.她在海军待了6年时间直到她的老友给她一份新的工作,而且这份工作比她在军队的工作还好.在过去的军事分支服务期间发生了很多事情.我认识她还是她在军队工作的时候.她是8个州的货车运输业协商区域的管理者.那会我在达拉斯跑肉品包装工具的运输. +不管怎么说,Nicky 看起来都不引人注目。她已经三十岁了,却决定回到学校学习。她在海军待了 6 年,后来接受了一份老友给她的新工作,她认为这份工作比她在军队的工作更有前途。认定其他工作更有前途而换工作的事情在战后的军事后勤处非常常见。我正是因此而认识的她。她那时是一个有 8 个州参与的的货车运输业协商组织的区域经理。那会我在达拉斯跑肉品包装工具的运输。 ![](http://i2.wp.com/fossforce.com/wp-content/uploads/2016/05/anatomy.jpg?w=525) -Nicky 和我在 2006 年成为了好朋友.她很外向,并且有很强的好奇心,她几乎走过每个运输商走的路线.一个星期五晚上我们在灯光下有一场很激烈的争论,像这样的 达 30 分钟的争论在我们之间并不少见.或许这并不比油漆一个球场省事,但是气氛还是可以控制的住的,感觉就像是一个很恐怖的游戏.在这次争论的时候她问到我是否可以修复她的电脑. +Nicky 和我在 2006 年成为了好朋友。她很外向,对所有她跑过的线路的拥有者。我们经常星期五晚上我们相约去一家室内激光枪战中心打真人 CS。像这样连续激战半个小时对我们来说并不罕见。或许这并不像彩弹游戏[译注:一种军事游戏,双方以汽枪互射彩色染料弹丸,对方被击中后衣服上会留下彩色印渍即表示“被消灭”(必应词典)]一样便宜,但是气氛还是可以控制得住的,而且令人感觉比较恐怖。某次活动的时候,她问我能否帮她维修电脑。 -她知道我为了一些贫穷的孩子能拥有他们自己的电脑做出的努力,当她抱怨她的电脑很慢的时候,我提到了参加 Bill Gate 的 401k 计划[译注:这个计划是为那些为内部收益代码做过贡献的人们提供由税收定义的养老金账户.].Nicky 说这是了解 Linux 的最佳时间. +她知道我为了一些贫穷的孩子能拥有他们自己的电脑做出的努力,当她抱怨她的电脑很慢的时候,我开玩笑地提到了参加比尔盖茨的 401k 计划[译注:这个计划是为那些为内部收益代码做过贡献的人们提供由税收定义的养老金账户。]。Nicky 说这是了解 Linux 的最佳时间。 -她的电脑相当好,它是一个带有 Dell 19 显示器的华硕电脑.不好的是,当不需要一些东西的时候,这个 Windows 电脑会强制性的显示所有的工具条和文本菜单.我们把电脑上的文件都做了备份之后就开始安装 Linux 了.我们一起完成了安装,并且我确信她知道了如何分区.不到一个小时,她的电脑上就有了一个漂亮的 PCLinuxOS 桌面. +她的电脑相当好,它是一个带有 Dell 19'' 显示器的华硕电脑。不幸的是,即使当不需要一些东西的时候,这台 Windows 电脑也会强制性的显示所有的工具条和文本菜单。我们把电脑上的文件都做了备份之后就开始安装 Linux 了。我们一起完成了安装,并且确信她知道了如何分区。不到一个小时,她的电脑上就有了一个漂亮的 PCLinuxOS 桌面。 -她会经常谈论她使用新系统的方法,系统看起来多么漂亮.她不曾提及的是,她几乎被她面前的井然有序的漂亮桌面吸引.她说她的桌面带有漂亮的"微光".这是我在安装系统期间特意设置的.我每次在安装 Linux 的时候都会进行这样的配置.我想让每个 Linux 用户的桌面都配置这个漂亮的微光. +在她操作新系统时,她经常评论这个系统看起来多么漂亮。她并非随口一说;她为眼前光鲜亮丽的桌面着了魔。她说她的桌面带有漂亮的"微光"[译注:即文字闪光效果,shimmer]。这是我在安装系统期间特意设置的。我每次安装 Linux 的时候都会进行这样的配置。我想让每个 Linux 用户的桌面都拥有这个漂亮的微光。 -大概第一周左右,她给我打电话或者发邮件问了一些常规的问题,但是最主要的问题还是她想知道怎样保存她打开的 Office 文件(OpenOffice)以至于她的同事也可以读这些文件.教一个人使用 Linux 或者 Open/LibreOffice 的时候最重要的就是教她保存文件.大多数用户仅仅看到第一个提示,只需要手指轻轻一点就可以以打开文件模式( Open Document Format )保存. +大概第一周左右,她通过电话和邮件问了我一些常规问题,而最主要的问题还是她想知道如何保存她OpenOffice 文件才可以让她的同事也可以读这些文件。教一个人使用 Linux 或者 Open/LibreOffice 的时候最重要的就是教她保存文件。大多数用户直接点了保存,结果就用默认的开放文档格式(Open Document Format)保存了,这让他们吃了不少苦头。 -大约一年前或者更久,一个高中生说他没有通过期末考试,因为教授不能打开他写着论文的文件.这引来不能决定谁对谁错的读者的激烈评论.这个高中生和教授都不知道这件事该怪谁. +大约一年前或者更久,一个高中生说他没有通过期末考试,因为教授不能打开他上交的 ODF 格式的论文。这引来了一些读者的激烈评论,大家都不知道这件事该怪谁。 -我知道一些大学教授甚至每个人都能够打开一个 ODF 文件.见鬼,很少有像微软这样优秀的公司,我想 Microsoft Office 现在已经能打开 ODT 或者 ODF 文件了.我也不能确保,毕竟我最近一次用 Microsoft Office 是在 2005 年. +我知道一些大学教授甚至每个人都能够打开一个 ODF 文件。另外,我想 Microsoft Office 现在已经能打开 ODT 或者 ODF 文件了。不过我也不确定,毕竟我最近一次用 Microsoft Office 是在 2005 年。 -甚至在困难时期,当 Microsoft 很受欢迎并且很热衷于为使用他们系统的厂商的企业桌面上安装他们自己的软件的时候,我和一些使用 Microsoft Office 的用户的产品生意和合作从来没有出现过问题,因为我会提前想到可能出现的问题并且不会有侥幸心理.我会发邮件给他们询问他们正在使用的 Office 版本.这样,我就可以确保以他们能够读写的格式保存文件. +甚至在过去糟糕的日子里,当 Microsoft 很受欢迎并且很热衷于为使用他们系统的厂商的企业桌面上安装他们自己的软件的时候,我和一些 Microsoft Office 用户的产品生意和合作从来没有出现过问题,因为我会提前想到可能出现的问题并且不会有侥幸心理。我会发邮件给他们询问他们正在使用的 Office 版本。这样,我就可以确保以他们能够读写的格式保存文件。 -说到 Nicky ,她花了很多时间学习她的 Linux 系统.我很惊奇于她的热情. +说回 Nicky ,她花了很多时间学习她的 Linux 系统。我很惊奇于她的热情。 -当人们意识到所有的使用 Windows 的习惯和工具都要被抛弃的时候,学习 Linux 系统也会很容易.甚至在我们谈论第一次用的系统时,我查看这些系统的桌面或者下载文件夹大多都找不到 some_dodgy_file.exe 这样的文件. +当人们意识到所有的使用 Windows 的习惯和工具都要被抛弃的时候,学习 Linux 系统也会很容易。甚至在告诉孩子们如何使用之后,他们都不会试图下载和执行 .exe 文件。 -在我们通常讨论这些文件的时候,我们也会提及关于更新的问题.很长时间我都不会在一台电脑上反复设置去完成多种程序的更新和安装.比如 Mint ,它没有带有 Synaptic [译注:一个 Linux 管理图像程序包]的完整更新方法,这让我失去兴趣.但是我们的老成员 dpkg 和 apt 是我们的好朋友,聪明的领导者已经得到肯定并且认识到命令行看起来不是那么舒服,同时欢迎新的用户加入. +在我们通常讨论这些文件的时候,我们也会提及关于更新的问题。很长时间我都不会在一台电脑上反复设置去完成多种程序的更新和安装。比如 Mint,它禁用了 Synaptic[译注:一个 Linux 管理图像程序包]的完整(系统)更新功能,这让我失去兴趣。但是即便我们仍然在使用 dpkg 和 apt,智能的前端已经开始占据上风,并使大家开始意识到命令行对心用户来说并不那么温馨而友好。 -我很生气,强烈反对机器对 Synaptic 的削弱,最后我放弃使用它.你记得你第一次使用的 Linux 发行版吗?记得你什么时候在 Synaptic 中详细查看大量的软件列表吗?记得你怎样开始检查并标记每个你发现的很酷的程序吗?你记得有多少这样的程序开始都是使用"lib"这样的文件吗? +我曾严正抗议并强烈谴责 Synaptic 功能上的削弱。你记得你第一次使用的 Linux 发行版吗?记得你什么时候在 Synaptic 中详细查看大量的软件列表吗?记得你怎样开始检查并标记每个你发现的很酷的程序吗?你记得有多少这样的程序开始都是使用"lib"这样的文件吗? -是的,我也是。我安装并且查看了一些新的安装程序,直到我发现那些库文件是应用程序的螺母和螺栓,而不是应用程序本身.这就是为什么这些聪明的开发者在 Linux Mint 和 Ubuntu 之后创造了聪明、漂亮和易于使用的应用程序的安装程序.Synaptic 仍然是我们的老大,但是对于一些后来者,安装像 lib 文件这样的方式需要打开大量的文件夹,很多这样的事情都会导致他们放弃使用这个系统.在新的安装程序中,这些文件会被放在一个文件夹中甚至不会展示给用户.总之,这也是该有的解决方法. +是的,我也是。我安装又弄坏了好次 Linux,后来我才发现那些库文件是应用程序的螺母和螺栓,而不是应用程序本身。这就是 Linux Mint 和 Ubuntu 幕后那些聪明的开发者创造了智能、漂亮和易于使用的应用程序的安装程序的理由。Synaptic 仍然是我们的老大,但是对于一些后来者,安装像 lib 文件这样的方式需要打开大量的文件夹,很多这样的事情都会导致他们放弃使用这个系统。在新的安装程序中,这些文件会被折叠起来,不会展示给用户。讲真,这也是它应该做的。 -除非你要改变应该支持的需求. +除非你要改变应该支持的需求。 -现在的 Linux 发行版中有很多有用的软件,我也很感谢这些开发者,因为他们,我的工作变得容易.不是每一个 Linux 新用户都像 Nicky 这样富有热情.她相当不错的完成了安装过程并且达到了忘我的状态.像她这样极具热情的毕竟是少数.大多数新的 Linux 用户也就是在需要的时候才这样用心. +现在的 Linux 发行版中藏了很多智慧的结晶,我也很感谢这些开发者,因为他们,我的工作变得容易。不是每一个 Linux 新用户都像 Nicky 这样富有学习能力和热情。她对我来说就是一个“安装后不管”的项目,只需要为她解答一些问题,其他的她会自己研究解决。像她这样极具学习能力和热情的用户的毕竟是少数。这样的 Linux 新人任何时候都是珍稀物种。 -很不错,他们都是要教自己的孩子使用 Linux 的人. +很不错,他们都是要教自己的孩子使用 Linux 的人。 -------------------------------------------------------------------------------- via: http://fossforce.com/2016/05/anatomy-linux-user/ 作者:[Ken Starks][a] 译者:[vim-kakali](https://github.com/vim-kakali) -校对:[校对者ID](https://github.com/校对者ID) +校对:[PurlingNayuki](https://github.com/PurlingNayuki) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 77e4d18eab0343c0717be399e6c4ab9a22e2ce9c Mon Sep 17 00:00:00 2001 From: Markgolzh Date: Tue, 9 Aug 2016 01:31:22 +0800 Subject: [PATCH 1388/1469] =?UTF-8?q?zky001=E7=BF=BB=E8=AF=91=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译中by zky001 --- .../20160615 Excel Filter and Edit - Demonstrated in Pandas.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20160615 Excel Filter and Edit - Demonstrated in Pandas.md b/sources/tech/20160615 Excel Filter and Edit - Demonstrated in Pandas.md index 348f66196f..4e9c973066 100644 --- a/sources/tech/20160615 Excel Filter and Edit - Demonstrated in Pandas.md +++ b/sources/tech/20160615 Excel Filter and Edit - Demonstrated in Pandas.md @@ -1,3 +1,4 @@ +翻译中 by-zky001 Excel “Filter and Edit” - Demonstrated in Pandas ================================================== @@ -313,7 +314,7 @@ Thanks for reading through the article. I find that one of the biggest challenge via: http://pbpython.com/excel-filter-edit.html 作者:[Chris Moffitt ][a] -译者:[译者ID](https://github.com/译者ID) +译者:[zky001](https://github.com/zky001) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 27aa4c166fb3b000648b3eb77f75dfc549227d22 Mon Sep 17 00:00:00 2001 From: Purling Nayuki Date: Tue, 9 Aug 2016 01:35:54 +0800 Subject: [PATCH 1389/1469] Proofread 20160531 The Anatomy of a Linux User and correct some translations --- translated/talk/20160531 The Anatomy of a Linux User.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/translated/talk/20160531 The Anatomy of a Linux User.md b/translated/talk/20160531 The Anatomy of a Linux User.md index 116bd88b41..99e3f0acc5 100644 --- a/translated/talk/20160531 The Anatomy of a Linux User.md +++ b/translated/talk/20160531 The Anatomy of a Linux User.md @@ -32,11 +32,11 @@ Nicky 和我在 2006 年成为了好朋友。她很外向,对所有她跑过 当人们意识到所有的使用 Windows 的习惯和工具都要被抛弃的时候,学习 Linux 系统也会很容易。甚至在告诉孩子们如何使用之后,他们都不会试图下载和执行 .exe 文件。 -在我们通常讨论这些文件的时候,我们也会提及关于更新的问题。很长时间我都不会在一台电脑上反复设置去完成多种程序的更新和安装。比如 Mint,它禁用了 Synaptic[译注:一个 Linux 管理图像程序包]的完整(系统)更新功能,这让我失去兴趣。但是即便我们仍然在使用 dpkg 和 apt,智能的前端已经开始占据上风,并使大家开始意识到命令行对心用户来说并不那么温馨而友好。 +在我们通常讨论这些文件的时候,我们也会提及关于更新的问题。很长时间我都不会在一台电脑上反复设置去完成多种程序的更新和安装。比如 Mint,它禁用了 Synaptic[译注:一个 Linux 管理图像程序包]的完整(系统)更新功能,这让我失去兴趣。但是即便我们仍然在使用 dpkg 和 apt,睿智的玩家已经开始意识到命令行对新用户来说并不那么温馨而友好。 -我曾严正抗议并强烈谴责 Synaptic 功能上的削弱。你记得你第一次使用的 Linux 发行版吗?记得你什么时候在 Synaptic 中详细查看大量的软件列表吗?记得你怎样开始检查并标记每个你发现的很酷的程序吗?你记得有多少这样的程序开始都是使用"lib"这样的文件吗? +我曾严正抗议并强烈谴责 Synaptic 功能上的削弱。你记得你第一次使用的 Linux 发行版吗?记得你什么时候在 Synaptic 中详细查看大量的软件列表吗?记得你怎样开始标记你发现的每个很酷的程序吗?你记得有多少这样的程序都是以字母"lib"开头的吗? -是的,我也是。我安装又弄坏了好次 Linux,后来我才发现那些库文件是应用程序的螺母和螺栓,而不是应用程序本身。这就是 Linux Mint 和 Ubuntu 幕后那些聪明的开发者创造了智能、漂亮和易于使用的应用程序的安装程序的理由。Synaptic 仍然是我们的老大,但是对于一些后来者,安装像 lib 文件这样的方式需要打开大量的文件夹,很多这样的事情都会导致他们放弃使用这个系统。在新的安装程序中,这些文件会被折叠起来,不会展示给用户。讲真,这也是它应该做的。 +我也曾做过那样的事。我安装又弄坏了好次 Linux,后来我才发现那些库(lib)文件是应用程序的螺母和螺栓,而不是应用程序本身。这就是 Linux Mint 和 Ubuntu 幕后那些聪明的开发者创造了智能、漂亮和易于使用的应用程序的安装程序的理由。Synaptic 仍然是我们这些老玩家爱用的工具,但是对于一些新手,Synaptic 中有太多的方式可以让他们安装库文件和其他类似的包,把系统弄乱。在新的安装程序中,这些包会被折叠起来,不会展示给用户。讲真,这也是它应该做的。 除非你要改变应该支持的需求。 From e19a22994cc7bcc7e74bb2d7f4d09311e564a9a5 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 9 Aug 2016 08:21:55 +0800 Subject: [PATCH 1390/1469] PUB:20160628 Python 101 An Intro to urllib @oska874 --- .../20160628 Python 101 An Intro to urllib.md | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) rename {translated/tech => published}/20160628 Python 101 An Intro to urllib.md (66%) diff --git a/translated/tech/20160628 Python 101 An Intro to urllib.md b/published/20160628 Python 101 An Intro to urllib.md similarity index 66% rename from translated/tech/20160628 Python 101 An Intro to urllib.md rename to published/20160628 Python 101 An Intro to urllib.md index 641ac2baf1..2ba5ea85b8 100644 --- a/translated/tech/20160628 Python 101 An Intro to urllib.md +++ b/published/20160628 Python 101 An Intro to urllib.md @@ -1,7 +1,7 @@ -Python 101: urllib 简介 +Python 学习:urllib 简介 ================================= -Python 3 的 urllib 模块是一堆可以处理 URL 的组件集合。如果你有 Python 2 背景,那么你就会注意到 Python 2 中有 urllib 和 urllib2 两个版本的模块。这些现在都是 Python 3 的 urllib 包的一部分。当前版本的 urllib 包括下面几部分: +Python 3 的 urllib 模块是一堆可以处理 URL 的组件集合。如果你有 Python 2 的知识,那么你就会注意到 Python 2 中有 urllib 和 urllib2 两个版本的模块。这些现在都是 Python 3 的 urllib 包的一部分。当前版本的 urllib 包括下面几部分: - urllib.request - urllib.error @@ -10,11 +10,10 @@ Python 3 的 urllib 模块是一堆可以处理 URL 的组件集合。如果你 接下来我们会分开讨论除了 urllib.error 以外的几部分。官方文档实际推荐你尝试第三方库, requests,一个高级的 HTTP 客户端接口。然而我依然认为知道如何不依赖第三方库打开 URL 并与之进行交互是很有用的,而且这也可以帮助你理解为什么 requests 包是如此的流行。 ---- ### urllib.request -urllib.request 模块期初是用来打开和获取 URL 的。让我们看看你可以用函数 urlopen可以做的事: +urllib.request 模块期初是用来打开和获取 URL 的。让我们看看你可以用函数 urlopen 可以做的事: ``` @@ -50,11 +49,11 @@ urllib.request 模块期初是用来打开和获取 URL 的。让我们看看你 在这里我们包含了需要的模块,然后告诉它打开 Google 的 URL。现在我们就有了一个可以交互的 HTTPResponse 对象。我们要做的第一件事是调用方法 geturl ,它会返回根据 URL 获取的资源。这可以让我们发现 URL 是否进行了重定向。 -接下来调用 info ,它会返回网页的元数据,比如头信息。因此,我们可以将结果赋给我们的 headers 变量,然后调用它的方法 as_string 。就可以打印出我们从 Google 收到的头信息。你也可以通过 getcode 得到网页的 HTTP 响应码,当前情况下就是 200,意思是正常工作。 +接下来调用 info ,它会返回网页的元数据,比如请求头信息。因此,我们可以将结果赋给我们的 headers 变量,然后调用它的方法 as_string 。就可以打印出我们从 Google 收到的头信息。你也可以通过 getcode 得到网页的 HTTP 响应码,当前情况下就是 200,意思是正常工作。 如果你想看看网页的 HTML 代码,你可以调用变量 url 的方法 read。我不准备再现这个过程,因为输出结果太长了。 -请注意 request 对象默认是 GET 请求,除非你指定它的 data 参数。你应该给它传递 data 参数,这样 request 对象才会变成 POST 请求。 +请注意 request 对象默认发起 GET 请求,除非你指定了它的 data 参数。如果你给它传递了 data 参数,这样 request 对象将会变成 POST 请求。 --- @@ -72,7 +71,7 @@ urllib 一个典型的应用场景是下载文件。让我们看看几种可以 ... ``` -这个例子中我们打开一个保存在我的博客上的 zip 压缩文件的 URL。然后我们读出数据并将数据写到磁盘。一个替代方法是使用 urlretrieve : +这个例子中我们打开一个保存在我的博客上的 zip 压缩文件的 URL。然后我们读出数据并将数据写到磁盘。一个替代此操作的方案是使用 urlretrieve : ``` >>> import urllib.request @@ -83,7 +82,7 @@ urllib 一个典型的应用场景是下载文件。让我们看看几种可以 ... fobj.write(tmp.read()) ``` -方法 urlretrieve 会把网络对象拷贝到本地文件。除非你在使用 urlretrieve 的第二个参数指定你要保存文件的路径,否则这个文件在本地是随机命名的并且是保存在临时文件夹。这个可以为你节省一步操作,并且使代码开起来更简单: +方法 urlretrieve 会把网络对象拷贝到本地文件。除非你在使用 urlretrieve 的第二个参数指定你要保存文件的路径,否则这个文件将被拷贝到临时文件夹的随机命名的一个文件中。这个可以为你节省一步操作,并且使代码看起来更简单: ``` >>> import urllib.request @@ -97,7 +96,7 @@ urllib 一个典型的应用场景是下载文件。让我们看看几种可以 ### 设置你的用户代理 -当你使用浏览器访问网页时,浏览器会告诉网站它是谁。这就是所谓的 user-agent 字段。Python 的 urllib 会表示他自己为 Python-urllib/x.y , 其中 x 和 y 是你使用的 Python 的主、次版本号。有一些网站不认识这个用户代理字段,然后网站的可能会有奇怪的表现或者根本不能正常工作。辛运的是你可以很轻松的设置你自己的 user-agent 字段。 +当你使用浏览器访问网页时,浏览器会告诉网站它是谁。这就是所谓的 user-agent (用户代理)字段。Python 的 urllib 会表示它自己为 Python-urllib/x.y , 其中 x 和 y 是你使用的 Python 的主、次版本号。有一些网站不认识这个用户代理字段,然后网站可能会有奇怪的表现或者根本不能正常工作。辛运的是你可以很轻松的设置你自己的 user-agent 字段。 ``` >>> import urllib.request @@ -132,7 +131,7 @@ ParseResult(scheme='https', netloc='duckduckgo.com', path='/', params='', query= None ``` -这里我们导入了函数 urlparse , 并且把一个包含搜索查询 duckduckgo 的 URL 作为参数传给它。我的查询的关于 “python stubbing” 的文章。如你所见,它返回了一个 ParseResult 对象,你可以用这个对象了解更多关于 URL 的信息。举个例子,你可以获取到短信息(此处的没有端口信息),网络位置,路径和很多其他东西。 +这里我们导入了函数 urlparse , 并且把一个包含搜索查询字串的 duckduckgo 的 URL 作为参数传给它。我的查询字串是搜索关于 “python stubbing” 的文章。如你所见,它返回了一个 ParseResult 对象,你可以用这个对象了解更多关于 URL 的信息。举个例子,你可以获取到端口信息(本例中没有端口信息)、网络位置、路径和很多其它东西。 ### 提交一个 Web 表单 @@ -151,13 +150,13 @@ None ... f.write(response.read()) ``` -这个例子很直接。基本上我们想使用 Python 而不是浏览器向 duckduckgo 提交一个查询。要完成这个我们需要使用 urlencode 构建我们的查询字符串。然后我们把这个字符串和网址拼接成一个完整的正确 URL ,然后使用 urllib.request 提交这个表单。最后我们就获取到了结果然后保存到磁盘上。 +这个例子很直接。基本上我们是使用 Python 而不是浏览器向 duckduckgo 提交了一个查询。要完成这个我们需要使用 urlencode 构建我们的查询字符串。然后我们把这个字符串和网址拼接成一个完整的正确 URL ,然后使用 urllib.request 提交这个表单。最后我们就获取到了结果然后保存到磁盘上。 --- ### urllib.robotparser -robotparser 模块是由一个单独的类 —— RobotFileParser —— 构成的。这个类会回答诸如一个特定的用户代理可以获取已经设置 robot.txt 的网站。 robot.txt 文件会告诉网络爬虫或者机器人当前网站的那些部分是不允许被访问的。让我们看一个简单的例子: +robotparser 模块是由一个单独的类 RobotFileParser 构成的。这个类会回答诸如一个特定的用户代理是否获取已经设置了 robot.txt 的网站的 URL。 robot.txt 文件会告诉网络爬虫或者机器人当前网站的那些部分是不允许被访问的。让我们看一个简单的例子: ``` >>> import urllib.robotparser @@ -172,13 +171,13 @@ True False ``` -这里我们导入了 robot 分析器类,然后创建一个实例。然后我们给它传递一个表明网站 robots.txt 位置的 URL 。接下来我们告诉分析器来读取这个文件。现在就完成了,我们给它了一组不同的 URL 让它找出那些我们可以爬取而那些不能爬取。我们很快就看到我们可以访问主站但是不包括 cgi-bin 路径。 +这里我们导入了 robot 分析器类,然后创建一个实例。然后我们给它传递一个表明网站 robots.txt 位置的 URL 。接下来我们告诉分析器来读取这个文件。完成后,我们给它了一组不同的 URL 让它找出那些我们可以爬取而那些不能爬取。我们很快就看到我们可以访问主站但是不能访问 cgi-bin 路径。 --- ### 总结一下 -现在你就有能力使用 Python 的 urllib 包了。在这一节里,我们学习了如何下载文件,提交 Web 表单,修改自己的用户代理以及访问 robots.txt。 urllib 还有一大堆附加功能没有在这里提及,比如网站授权。然后你可能会考虑在使用 urllib 进行认证之前切换到 requests 库,因为 requests 已经以更易用和易调试的方式实现了这些功能。我同时也希望提醒你 Python 已经通过 http.cookies 模块支持 Cookies 了,虽然在 request 包里也很好的封装了这个功能。你应该可能考虑同时试试两个来决定那个最适合你。 +现在你就有能力使用 Python 的 urllib 包了。在这一节里,我们学习了如何下载文件、提交 Web 表单、修改自己的用户代理以及访问 robots.txt。 urllib 还有一大堆附加功能没有在这里提及,比如网站身份认证。你可能会考虑在使用 urllib 进行身份认证之前切换到 requests 库,因为 requests 已经以更易用和易调试的方式实现了这些功能。我同时也希望提醒你 Python 已经通过 http.cookies 模块支持 Cookies 了,虽然在 request 包里也很好的封装了这个功能。你应该可能考虑同时试试两个来决定那个最适合你。 -------------------------------------------------------------------------------- @@ -186,7 +185,7 @@ via: http://www.blog.pythonlibrary.org/2016/06/28/python-101-an-intro-to-urllib/ 作者:[Mike][a] 译者:[Ezio](https://github.com/oska874) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From d658889532bf7d3ea7c7c6ac689d3e7ab2674e75 Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Tue, 9 Aug 2016 14:14:26 +0800 Subject: [PATCH 1391/1469] =?UTF-8?q?20160809-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...cker Containers using Grafana on Ubuntu.md | 253 ++++++++++++++++++ 1 file changed, 253 insertions(+) create mode 100644 sources/tech/20160809 How to Monitor Docker Containers using Grafana on Ubuntu.md diff --git a/sources/tech/20160809 How to Monitor Docker Containers using Grafana on Ubuntu.md b/sources/tech/20160809 How to Monitor Docker Containers using Grafana on Ubuntu.md new file mode 100644 index 0000000000..cafd93ab19 --- /dev/null +++ b/sources/tech/20160809 How to Monitor Docker Containers using Grafana on Ubuntu.md @@ -0,0 +1,253 @@ +How to Monitor Docker Containers using Grafana on Ubuntu +================================================================================ + +Grafana is an open source feature rich metrics dashboard. It is very useful for visualizing large-scale measurement data. It provides a powerful and elegant way to create, share, and explore data and dashboards from your disparate metric databases. + +It supports a wide variety of graphing options for ultimate flexibility. Furthermore, it supports many different storage backends for your Data Source. Each Data Source has a specific Query Editor that is customized for the features and capabilities that the particular Data Source exposes. The following datasources are officially supported by Grafana: Graphite, InfluxDB, OpenTSDB, Prometheus, Elasticsearch and Cloudwatch + +The query language and capabilities of each Data Source are obviously very different. You can combine data from multiple Data Sources onto a single Dashboard, but each Panel is tied to a specific Data Source that belongs to a particular Organization. It supports authenticated login and a basic role based access control implementation. It is deployed as a single software installation which is written in Go and Javascript. + +In this article, I'll explain on how to install Grafana on a docker container in Ubuntu 16.04 and configure docker monitoring using this software. + +### Pre-requisites ### + +- Docker installed server + +### Installing Grafana ### + +We can build our Grafana in a docker container. There is an official docker image available for building Grafana. Please run this command to build a Grafana container. + + root@ubuntu:~# docker run -i -p 3000:3000 grafana/grafana + + Unable to find image 'grafana/grafana:latest' locally + latest: Pulling from grafana/grafana + 5c90d4a2d1a8: Pull complete + b1a9a0b6158e: Pull complete + acb23b0d58de: Pull complete + Digest: sha256:34ca2f9c7986cb2d115eea373083f7150a2b9b753210546d14477e2276074ae1 + Status: Downloaded newer image for grafana/grafana:latest + t=2016-07-27T15:20:19+0000 lvl=info msg="Starting Grafana" logger=main version=3.1.0 commit=v3.1.0 compiled=2016-07-12T06:42:28+0000 + t=2016-07-27T15:20:19+0000 lvl=info msg="Config loaded from" logger=settings file=/usr/share/grafana/conf/defaults.ini + t=2016-07-27T15:20:19+0000 lvl=info msg="Config loaded from" logger=settings file=/etc/grafana/grafana.ini + t=2016-07-27T15:20:19+0000 lvl=info msg="Config overriden from command line" logger=settings arg="default.paths.data=/var/lib/grafana" + t=2016-07-27T15:20:19+0000 lvl=info msg="Config overriden from command line" logger=settings arg="default.paths.logs=/var/log/grafana" + t=2016-07-27T15:20:19+0000 lvl=info msg="Config overriden from command line" logger=settings arg="default.paths.plugins=/var/lib/grafana/plugins" + t=2016-07-27T15:20:19+0000 lvl=info msg="Path Home" logger=settings path=/usr/share/grafana + t=2016-07-27T15:20:19+0000 lvl=info msg="Path Data" logger=settings path=/var/lib/grafana + t=2016-07-27T15:20:19+0000 lvl=info msg="Path Logs" logger=settings path=/var/log/grafana + t=2016-07-27T15:20:19+0000 lvl=info msg="Path Plugins" logger=settings path=/var/lib/grafana/plugins + t=2016-07-27T15:20:19+0000 lvl=info msg="Initializing DB" logger=sqlstore dbtype=sqlite3 + + t=2016-07-27T15:20:20+0000 lvl=info msg="Executing migration" logger=migrator id="create playlist table v2" + t=2016-07-27T15:20:20+0000 lvl=info msg="Executing migration" logger=migrator id="create playlist item table v2" + t=2016-07-27T15:20:20+0000 lvl=info msg="Executing migration" logger=migrator id="drop preferences table v2" + t=2016-07-27T15:20:20+0000 lvl=info msg="Executing migration" logger=migrator id="drop preferences table v3" + t=2016-07-27T15:20:20+0000 lvl=info msg="Executing migration" logger=migrator id="create preferences table v3" + t=2016-07-27T15:20:20+0000 lvl=info msg="Created default admin user: [admin]" + t=2016-07-27T15:20:20+0000 lvl=info msg="Starting plugin search" logger=plugins + t=2016-07-27T15:20:20+0000 lvl=info msg="Server Listening" logger=server address=0.0.0.0:3000 protocol=http subUrl= + +We can confirm the working of the Grafana container by running this command `docker ps -a` or by accessing it by URL `http://Docker IP:3000` + +All Grafana configuration settings are defined using environment variables, this is much useful when using container technology. The Grafana configuration file is located at /etc/grafana/grafana.ini. + +### Understanding the Configuration ### + +The Grafana has number of configuration options that can be specified in its configuration file as .ini file or can be specified using environment variables as mentioned before. + +#### Config file locations #### + +Normal config file locations. + +- Default configuration from : $WORKING_DIR/conf/defaults.ini +- Custom configuration from : $WORKING_DIR/conf/custom.ini + +PS : When you install Grafana using the deb or rpm packages or docker images, then your configuration file is located at /etc/grafana/grafana.ini + +#### Understanding the config variables #### + +Let's see some of the variables in the configuration file below: + +`instance_name` : It's the name of the grafana server instance. It default value is fetched from ${HOSTNAME}, which will be replaced with environment variable HOSTNAME, if that is empty or does not exist Grafana will try to use system calls to get the machine name. + +`[paths]` + +`data` : It's the path where Grafana stores the sqlite3 database (when used), file based sessions (when used), and other data. + +`logs` : It's where Grafana stores the logs. + +Both these paths are usually specified via command line in the init.d scripts or the systemd service file. + +`[server]` + +`http_addr` : The IP address to bind the application. If it's left empty it will bind to all interfaces. + +`http_port` : The port to which the application is bind to, defaults is 3000. You can redirect your 80 port to 3000 using the below command. + + $iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 3000 + +`root_url` : This is the URL used to access Grafana from a web browser. + +`cert_file` : Path to the certificate file (if protocol is set to https). + +`cert_key` : Path to the certificate key file (if protocol is set to https). + +`[database]` + +Grafana uses a database to store its users and dashboards and other informations. By default it is configured to use sqlite3 which is an embedded database included in the main Grafana binary. + +`type` +You can choose mysql, postgres or sqlite3 as per our requirement. + +`path` +It's applicable only for sqlite3 database. The file path where the database will be stored. + +`host` +It's applicable only to MySQL or Postgres. it includes IP or hostname and port. For example, for MySQL running on the same host as Grafana: host = 127.0.0.1:3306 + +`name` +The name of the Grafana database. Leave it set to grafana or some other name. + +`user` +The database user (not applicable for sqlite3). + +`password` +The database user's password (not applicable for sqlite3). + +`ssl_mode` +For Postgres, use either disable, require or verify-full. For MySQL, use either true, false, or skip-verify. + +`ca_cert_path` +(MySQL only) The path to the CA certificate to use. On many linux systems, certs can be found in /etc/ssl/certs. + +`client_key_path` +(MySQL only) The path to the client key. Only if server requires client authentication. + +`client_cert_path` +(MySQL only) The path to the client cert. Only if server requires client authentication. + +`server_cert_name` +(MySQL only) The common name field of the certificate used by the mysql server. Not necessary if ssl_mode is set to skip-verify. + +`[security]` + +`admin_user` : It is the name of the default Grafana admin user. The default name set is admin. + +`admin_password` : It is the password of the default Grafana admin. It is set on first-run. The default password is admin. + +`login_remember_days` : The number of days the keep me logged in / remember me cookie lasts. + +`secret_key` : It is used for signing keep me logged in / remember me cookies. + +### Essentials components for setting up Monitoring ### + +We use the below components to create our Docker Monitoring system. + +`cAdvisor` : It is otherwise called Container Advisor. It provides its users an understanding of the resource usage and performance characteristics. It collects, aggregates, processes and exports information about the running containers. You can go through this documentation for more information about this. + +`InfluxDB` : It is a time series, metrics, and analytic database. We use this datasource for setting up our monitoring. cAdvisor displays only real time information and doesn’t store the metrics. Influx Db helps to store the monitoring information which cAdvisor provides in order to display a time range other than real time. + +`Grafana Dashboard` : It allows us to combine all the pieces of information together visually. This powerful Dashboard allows us to run queries against the data store InfluxDB and chart them accordingly in beautiful layout. + +### Installation of Docker Monitoring ### + +We need to install each of these components one by one in our docker system. + +#### Installing InfluxDB #### + +We can use this command to pull InfluxDB image and setuup a influxDB container. + + root@ubuntu:~# docker run -d -p 8083:8083 -p 8086:8086 --expose 8090 --expose 8099 -e PRE_CREATE_DB=cadvisor --name influxsrv tutum/influxdb:0.8.8 + Unable to find image 'tutum/influxdb:0.8.8' locally + 0.8.8: Pulling from tutum/influxdb + a3ed95caeb02: Already exists + 23efb549476f: Already exists + aa2f8df21433: Already exists + ef072d3c9b41: Already exists + c9f371853f28: Already exists + a248b0871c3c: Already exists + 749db6d368d0: Already exists + 7d7c7d923e63: Pull complete + e47cc7808961: Pull complete + 1743b6eeb23f: Pull complete + Digest: sha256:8494b31289b4dbc1d5b444e344ab1dda3e18b07f80517c3f9aae7d18133c0c42 + Status: Downloaded newer image for tutum/influxdb:0.8.8 + d3b6f7789e0d1d01fa4e0aacdb636c221421107d1df96808ecbe8e241ceb1823 + + -p 8083:8083 : user interface, log in with username-admin, pass-admin + -p 8086:8086 : interaction with other application + --name influxsrv : container have name influxsrv, use to cAdvisor link it. + +You can test your InfluxDB installation by calling this URL >>http://45.79.148.234:8083 and login with user/password as "root". + +![InfluxDB Administration 2016-08-01 14-10-08](http://blog.linoxide.com/wp-content/uploads/2016/07/InfluxDB-Administration-2016-08-01-14-10-08-1-1024x530.png) + +We can create our required databases from this tab. + +![createDB influx](http://blog.linoxide.com/wp-content/uploads/2016/07/createDB-influx-1024x504.png) + +#### Installing cAdvisor #### + +Our next step is to install cAdvisor container and link it to the InfluxDB container. You can use this command to create it. + + root@ubuntu:~# docker run --volume=/:/rootfs:ro --volume=/var/run:/var/run:rw --volume=/sys:/sys:ro --volume=/var/lib/docker/:/var/lib/docker:ro --publish=8080:8080 --detach=true --link influxsrv:influxsrv --name=cadvisor google/cadvisor:latest -storage_driver_db=cadvisor -storage_driver_host=influxsrv:8086 + Unable to find image 'google/cadvisor:latest' locally + latest: Pulling from google/cadvisor + 09d0220f4043: Pull complete + 151807d34af9: Pull complete + 14cd28dce332: Pull complete + Digest: sha256:8364c7ab7f56a087b757a304f9376c3527c8c60c848f82b66dd728980222bd2f + Status: Downloaded newer image for google/cadvisor:latest + 3bfdf7fdc83872485acb06666a686719983a1172ac49895cd2a260deb1cdde29 + root@ubuntu:~# + + --publish=8080:8080 : user interface + --link=influxsrv:influxsrv: link to container influxsrv + -storage_driver=influxdb: set the storage driver as InfluxDB + Specify what InfluxDB instance to push data to: + -storage_driver_host=influxsrv:8086: The ip:port of the database. Default is ‘localhost:8086’ + -storage_driver_db=cadvisor: database name. Uses db ‘cadvisor’ by default + +You can test our cAdvisor installation by calling this URL >>http://45.79.148.234:8080. This will provide you the statistics of your Docker host and containers. + +![cAdvisor - Docker Containers 2016-08-01 14-24-18](http://blog.linoxide.com/wp-content/uploads/2016/07/cAdvisor-Docker-Containers-2016-08-01-14-24-18-776x1024.png) + +#### Installing the Grafana Dashboard #### + +Finally, we need to install the Grafana Dashboard and link to the InfluxDB. You can run this command to setup that. + + root@ubuntu:~# docker run -d -p 3000:3000 -e INFLUXDB_HOST=localhost -e INFLUXDB_PORT=8086 -e INFLUXDB_NAME=cadvisor -e INFLUXDB_USER=root -e INFLUXDB_PASS=root --link influxsrv:influxsrv --name grafana grafana/grafana + f3b7598529202b110e4e6b998dca6b6e60e8608d75dcfe0d2b09ae408f43684a + +Now we can login to Grafana and configure the Data Sources. Navigate to http://45.79.148.234:3000 or just http://45.79.148.234: + +Username - admin +Password - admin + +Once we've installed Grafana, we can connect the InfluxDB. Login on the Dashboard and click on the Grafana icon(Fireball) in the upper left hand corner of the panel. Click on Data Sources to configure. + +![addingdatabsource](http://blog.linoxide.com/wp-content/uploads/2016/08/addingdatabsource-1-1024x804.png) + +Now you can add our new Graph to our default Datasource InfluxDB. + +![panelgraph](http://blog.linoxide.com/wp-content/uploads/2016/08/panelgraph-1024x576.png) + +We can edit and modify our query by adjusting our graph at Metric tab. + +![Grafana - Grafana Dashboard 2016-08-01 14-53-40](http://blog.linoxide.com/wp-content/uploads/2016/08/Grafana-Grafana-Dashboard-2016-08-01-14-53-40-1024x504.png) + +![Grafana - Grafana Dashboard](http://blog.linoxide.com/wp-content/uploads/2016/08/Grafana-Grafana-Dashboard-1024x509.png) + +You can get [more information][1] on docker monitoring here. Thank you for reading this. I would suggest your valuable comments and suggestions on this. Hope you'd a wonderful day! + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/monitor-docker-containers-grafana-ubuntu/ + +作者:[Saheetha Shameer][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/saheethas/ \ No newline at end of file From ba719f40e335bd6ef94bf2368d381813f5fc1be7 Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Tue, 9 Aug 2016 15:08:12 +0800 Subject: [PATCH 1392/1469] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=9D=97=E6=A0=B7=E5=BC=8F=E3=80=81=E8=A1=A5=E5=85=85=E9=93=BE?= =?UTF-8?q?=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...cker Containers using Grafana on Ubuntu.md | 143 ++++++++++-------- 1 file changed, 77 insertions(+), 66 deletions(-) diff --git a/sources/tech/20160809 How to Monitor Docker Containers using Grafana on Ubuntu.md b/sources/tech/20160809 How to Monitor Docker Containers using Grafana on Ubuntu.md index cafd93ab19..3d7b171788 100644 --- a/sources/tech/20160809 How to Monitor Docker Containers using Grafana on Ubuntu.md +++ b/sources/tech/20160809 How to Monitor Docker Containers using Grafana on Ubuntu.md @@ -17,35 +17,37 @@ In this article, I'll explain on how to install Grafana on a docker container in We can build our Grafana in a docker container. There is an official docker image available for building Grafana. Please run this command to build a Grafana container. - root@ubuntu:~# docker run -i -p 3000:3000 grafana/grafana +``` +root@ubuntu:~# docker run -i -p 3000:3000 grafana/grafana - Unable to find image 'grafana/grafana:latest' locally - latest: Pulling from grafana/grafana - 5c90d4a2d1a8: Pull complete - b1a9a0b6158e: Pull complete - acb23b0d58de: Pull complete - Digest: sha256:34ca2f9c7986cb2d115eea373083f7150a2b9b753210546d14477e2276074ae1 - Status: Downloaded newer image for grafana/grafana:latest - t=2016-07-27T15:20:19+0000 lvl=info msg="Starting Grafana" logger=main version=3.1.0 commit=v3.1.0 compiled=2016-07-12T06:42:28+0000 - t=2016-07-27T15:20:19+0000 lvl=info msg="Config loaded from" logger=settings file=/usr/share/grafana/conf/defaults.ini - t=2016-07-27T15:20:19+0000 lvl=info msg="Config loaded from" logger=settings file=/etc/grafana/grafana.ini - t=2016-07-27T15:20:19+0000 lvl=info msg="Config overriden from command line" logger=settings arg="default.paths.data=/var/lib/grafana" - t=2016-07-27T15:20:19+0000 lvl=info msg="Config overriden from command line" logger=settings arg="default.paths.logs=/var/log/grafana" - t=2016-07-27T15:20:19+0000 lvl=info msg="Config overriden from command line" logger=settings arg="default.paths.plugins=/var/lib/grafana/plugins" - t=2016-07-27T15:20:19+0000 lvl=info msg="Path Home" logger=settings path=/usr/share/grafana - t=2016-07-27T15:20:19+0000 lvl=info msg="Path Data" logger=settings path=/var/lib/grafana - t=2016-07-27T15:20:19+0000 lvl=info msg="Path Logs" logger=settings path=/var/log/grafana - t=2016-07-27T15:20:19+0000 lvl=info msg="Path Plugins" logger=settings path=/var/lib/grafana/plugins - t=2016-07-27T15:20:19+0000 lvl=info msg="Initializing DB" logger=sqlstore dbtype=sqlite3 +Unable to find image 'grafana/grafana:latest' locally +latest: Pulling from grafana/grafana +5c90d4a2d1a8: Pull complete +b1a9a0b6158e: Pull complete +acb23b0d58de: Pull complete +Digest: sha256:34ca2f9c7986cb2d115eea373083f7150a2b9b753210546d14477e2276074ae1 +Status: Downloaded newer image for grafana/grafana:latest +t=2016-07-27T15:20:19+0000 lvl=info msg="Starting Grafana" logger=main version=3.1.0 commit=v3.1.0 compiled=2016-07-12T06:42:28+0000 +t=2016-07-27T15:20:19+0000 lvl=info msg="Config loaded from" logger=settings file=/usr/share/grafana/conf/defaults.ini +t=2016-07-27T15:20:19+0000 lvl=info msg="Config loaded from" logger=settings file=/etc/grafana/grafana.ini +t=2016-07-27T15:20:19+0000 lvl=info msg="Config overriden from command line" logger=settings arg="default.paths.data=/var/lib/grafana" +t=2016-07-27T15:20:19+0000 lvl=info msg="Config overriden from command line" logger=settings arg="default.paths.logs=/var/log/grafana" +t=2016-07-27T15:20:19+0000 lvl=info msg="Config overriden from command line" logger=settings arg="default.paths.plugins=/var/lib/grafana/plugins" +t=2016-07-27T15:20:19+0000 lvl=info msg="Path Home" logger=settings path=/usr/share/grafana +t=2016-07-27T15:20:19+0000 lvl=info msg="Path Data" logger=settings path=/var/lib/grafana +t=2016-07-27T15:20:19+0000 lvl=info msg="Path Logs" logger=settings path=/var/log/grafana +t=2016-07-27T15:20:19+0000 lvl=info msg="Path Plugins" logger=settings path=/var/lib/grafana/plugins +t=2016-07-27T15:20:19+0000 lvl=info msg="Initializing DB" logger=sqlstore dbtype=sqlite3 - t=2016-07-27T15:20:20+0000 lvl=info msg="Executing migration" logger=migrator id="create playlist table v2" - t=2016-07-27T15:20:20+0000 lvl=info msg="Executing migration" logger=migrator id="create playlist item table v2" - t=2016-07-27T15:20:20+0000 lvl=info msg="Executing migration" logger=migrator id="drop preferences table v2" - t=2016-07-27T15:20:20+0000 lvl=info msg="Executing migration" logger=migrator id="drop preferences table v3" - t=2016-07-27T15:20:20+0000 lvl=info msg="Executing migration" logger=migrator id="create preferences table v3" - t=2016-07-27T15:20:20+0000 lvl=info msg="Created default admin user: [admin]" - t=2016-07-27T15:20:20+0000 lvl=info msg="Starting plugin search" logger=plugins - t=2016-07-27T15:20:20+0000 lvl=info msg="Server Listening" logger=server address=0.0.0.0:3000 protocol=http subUrl= +t=2016-07-27T15:20:20+0000 lvl=info msg="Executing migration" logger=migrator id="create playlist table v2" +t=2016-07-27T15:20:20+0000 lvl=info msg="Executing migration" logger=migrator id="create playlist item table v2" +t=2016-07-27T15:20:20+0000 lvl=info msg="Executing migration" logger=migrator id="drop preferences table v2" +t=2016-07-27T15:20:20+0000 lvl=info msg="Executing migration" logger=migrator id="drop preferences table v3" +t=2016-07-27T15:20:20+0000 lvl=info msg="Executing migration" logger=migrator id="create preferences table v3" +t=2016-07-27T15:20:20+0000 lvl=info msg="Created default admin user: [admin]" +t=2016-07-27T15:20:20+0000 lvl=info msg="Starting plugin search" logger=plugins +t=2016-07-27T15:20:20+0000 lvl=info msg="Server Listening" logger=server address=0.0.0.0:3000 protocol=http subUrl= +``` We can confirm the working of the Grafana container by running this command `docker ps -a` or by accessing it by URL `http://Docker IP:3000` @@ -84,7 +86,9 @@ Both these paths are usually specified via command line in the init.d scripts or `http_port` : The port to which the application is bind to, defaults is 3000. You can redirect your 80 port to 3000 using the below command. - $iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 3000 +``` +$iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 3000 +``` `root_url` : This is the URL used to access Grafana from a web browser. @@ -157,26 +161,28 @@ We need to install each of these components one by one in our docker system. We can use this command to pull InfluxDB image and setuup a influxDB container. - root@ubuntu:~# docker run -d -p 8083:8083 -p 8086:8086 --expose 8090 --expose 8099 -e PRE_CREATE_DB=cadvisor --name influxsrv tutum/influxdb:0.8.8 - Unable to find image 'tutum/influxdb:0.8.8' locally - 0.8.8: Pulling from tutum/influxdb - a3ed95caeb02: Already exists - 23efb549476f: Already exists - aa2f8df21433: Already exists - ef072d3c9b41: Already exists - c9f371853f28: Already exists - a248b0871c3c: Already exists - 749db6d368d0: Already exists - 7d7c7d923e63: Pull complete - e47cc7808961: Pull complete - 1743b6eeb23f: Pull complete - Digest: sha256:8494b31289b4dbc1d5b444e344ab1dda3e18b07f80517c3f9aae7d18133c0c42 - Status: Downloaded newer image for tutum/influxdb:0.8.8 - d3b6f7789e0d1d01fa4e0aacdb636c221421107d1df96808ecbe8e241ceb1823 +``` +root@ubuntu:~# docker run -d -p 8083:8083 -p 8086:8086 --expose 8090 --expose 8099 -e PRE_CREATE_DB=cadvisor --name influxsrv tutum/influxdb:0.8.8 +Unable to find image 'tutum/influxdb:0.8.8' locally +0.8.8: Pulling from tutum/influxdb +a3ed95caeb02: Already exists +23efb549476f: Already exists +aa2f8df21433: Already exists +ef072d3c9b41: Already exists +c9f371853f28: Already exists +a248b0871c3c: Already exists +749db6d368d0: Already exists +7d7c7d923e63: Pull complete +e47cc7808961: Pull complete +1743b6eeb23f: Pull complete +Digest: sha256:8494b31289b4dbc1d5b444e344ab1dda3e18b07f80517c3f9aae7d18133c0c42 +Status: Downloaded newer image for tutum/influxdb:0.8.8 +d3b6f7789e0d1d01fa4e0aacdb636c221421107d1df96808ecbe8e241ceb1823 - -p 8083:8083 : user interface, log in with username-admin, pass-admin - -p 8086:8086 : interaction with other application - --name influxsrv : container have name influxsrv, use to cAdvisor link it. + -p 8083:8083 : user interface, log in with username-admin, pass-admin + -p 8086:8086 : interaction with other application + --name influxsrv : container have name influxsrv, use to cAdvisor link it. +``` You can test your InfluxDB installation by calling this URL >>http://45.79.148.234:8083 and login with user/password as "root". @@ -190,23 +196,25 @@ We can create our required databases from this tab. Our next step is to install cAdvisor container and link it to the InfluxDB container. You can use this command to create it. - root@ubuntu:~# docker run --volume=/:/rootfs:ro --volume=/var/run:/var/run:rw --volume=/sys:/sys:ro --volume=/var/lib/docker/:/var/lib/docker:ro --publish=8080:8080 --detach=true --link influxsrv:influxsrv --name=cadvisor google/cadvisor:latest -storage_driver_db=cadvisor -storage_driver_host=influxsrv:8086 - Unable to find image 'google/cadvisor:latest' locally - latest: Pulling from google/cadvisor - 09d0220f4043: Pull complete - 151807d34af9: Pull complete - 14cd28dce332: Pull complete - Digest: sha256:8364c7ab7f56a087b757a304f9376c3527c8c60c848f82b66dd728980222bd2f - Status: Downloaded newer image for google/cadvisor:latest - 3bfdf7fdc83872485acb06666a686719983a1172ac49895cd2a260deb1cdde29 - root@ubuntu:~# +``` +root@ubuntu:~# docker run --volume=/:/rootfs:ro --volume=/var/run:/var/run:rw --volume=/sys:/sys:ro --volume=/var/lib/docker/:/var/lib/docker:ro --publish=8080:8080 --detach=true --link influxsrv:influxsrv --name=cadvisor google/cadvisor:latest -storage_driver_db=cadvisor -storage_driver_host=influxsrv:8086 +Unable to find image 'google/cadvisor:latest' locally +latest: Pulling from google/cadvisor +09d0220f4043: Pull complete +151807d34af9: Pull complete +14cd28dce332: Pull complete +Digest: sha256:8364c7ab7f56a087b757a304f9376c3527c8c60c848f82b66dd728980222bd2f +Status: Downloaded newer image for google/cadvisor:latest +3bfdf7fdc83872485acb06666a686719983a1172ac49895cd2a260deb1cdde29 +root@ubuntu:~# - --publish=8080:8080 : user interface - --link=influxsrv:influxsrv: link to container influxsrv - -storage_driver=influxdb: set the storage driver as InfluxDB - Specify what InfluxDB instance to push data to: - -storage_driver_host=influxsrv:8086: The ip:port of the database. Default is ‘localhost:8086’ - -storage_driver_db=cadvisor: database name. Uses db ‘cadvisor’ by default + --publish=8080:8080 : user interface + --link=influxsrv:influxsrv: link to container influxsrv + -storage_driver=influxdb: set the storage driver as InfluxDB + Specify what InfluxDB instance to push data to: + -storage_driver_host=influxsrv:8086: The ip:port of the database. Default is ‘localhost:8086’ + -storage_driver_db=cadvisor: database name. Uses db ‘cadvisor’ by default +``` You can test our cAdvisor installation by calling this URL >>http://45.79.148.234:8080. This will provide you the statistics of your Docker host and containers. @@ -216,8 +224,10 @@ You can test our cAdvisor installation by calling this URL >>http://45.79.148.23 Finally, we need to install the Grafana Dashboard and link to the InfluxDB. You can run this command to setup that. - root@ubuntu:~# docker run -d -p 3000:3000 -e INFLUXDB_HOST=localhost -e INFLUXDB_PORT=8086 -e INFLUXDB_NAME=cadvisor -e INFLUXDB_USER=root -e INFLUXDB_PASS=root --link influxsrv:influxsrv --name grafana grafana/grafana - f3b7598529202b110e4e6b998dca6b6e60e8608d75dcfe0d2b09ae408f43684a +``` +root@ubuntu:~# docker run -d -p 3000:3000 -e INFLUXDB_HOST=localhost -e INFLUXDB_PORT=8086 -e INFLUXDB_NAME=cadvisor -e INFLUXDB_USER=root -e INFLUXDB_PASS=root --link influxsrv:influxsrv --name grafana grafana/grafana +f3b7598529202b110e4e6b998dca6b6e60e8608d75dcfe0d2b09ae408f43684a +``` Now we can login to Grafana and configure the Data Sources. Navigate to http://45.79.148.234:3000 or just http://45.79.148.234: @@ -250,4 +260,5 @@ via: http://linoxide.com/linux-how-to/monitor-docker-containers-grafana-ubuntu/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://linoxide.com/author/saheethas/ \ No newline at end of file +[a]:http://linoxide.com/author/saheethas/ +[1]:https://github.com/vegasbrianc/docker-monitoring \ No newline at end of file From bc1739c098ed9f41a9e88b8c4ac8b2d4705ee866 Mon Sep 17 00:00:00 2001 From: chenzhijun <522858454@qq.com> Date: Tue, 9 Aug 2016 15:55:48 +0800 Subject: [PATCH 1393/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C20160717?= =?UTF-8?q?=20BEST=20TEXT=20EDITORS=20FOR=20LINUX=20COMMAND=20LINE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...EST TEXT EDITORS FOR LINUX COMMAND LINE.md | 95 ------------------- ...EST TEXT EDITORS FOR LINUX COMMAND LINE.md | 93 ++++++++++++++++++ 2 files changed, 93 insertions(+), 95 deletions(-) delete mode 100644 sources/tech/20160717 BEST TEXT EDITORS FOR LINUX COMMAND LINE.md create mode 100644 translated/tech/20160717 BEST TEXT EDITORS FOR LINUX COMMAND LINE.md diff --git a/sources/tech/20160717 BEST TEXT EDITORS FOR LINUX COMMAND LINE.md b/sources/tech/20160717 BEST TEXT EDITORS FOR LINUX COMMAND LINE.md deleted file mode 100644 index 80f4b1439c..0000000000 --- a/sources/tech/20160717 BEST TEXT EDITORS FOR LINUX COMMAND LINE.md +++ /dev/null @@ -1,95 +0,0 @@ -Translating by chenzhijun - - -BEST TEXT EDITORS FOR LINUX COMMAND LINE -========================================== - -![](https://itsfoss.com/wp-content/uploads/2016/07/Best-Command-Line-Text-Editors-for-Linux.jpg) - -A text editor is a must have application for any operating system. We have no dearth of [best modern editors for Linux][1]. But those are GUI based editors. - -As you know, the real power of Linux lies in the command line. And when you are working in command line, you would need a text editor that could work right inside the terminal. - -For that purpose, today we are going to make a list of best command line text editors for Linux. - -### [VIM][2] - -If you’re on Linux for quite some time, you must have heard about Vim. Vim is an extensively configurable, cross-platform and highly efficient text editor. - -Almost every Linux distribution comes with Vim pre-installed. It is extremely popular for its wide range of features. - -![](https://itsfoss.com/wp-content/uploads/2016/07/vim.png) ->Vim User Interface - -Vim can be quite agonizing for first-time users. I remember the first time I tried to edit a text file with Vim, I was completely puzzled. I couldn’t type a single letter on it and the funny part is, I couldn’t even figure out how to close this thing. If you are going to use Vim, you have to be determined for climbing up a very steep learning curve. - -But after you have gone through all that, combed through some documentations, remembered its commands and shortcuts you will find that the hassle was worth it. You can bend Vim to your will – customizing its interface however it seems fit to you, give your workflow a boost by using various user scripts, plugins and so on. Vim supports syntax highlighting, macro recording and action history. - -As in the official site, it is stated that, - ->**Vim: The power tool for everyone!** - -It is completely up to you how you will use it. You can just use it for simple text editing, or you can customize it to behave as a full-fledged IDE. - -### [GNU EMACS][3] - -GNU Emacs is undoubtedly one of the most powerful text editor out there. If you have heard about both Vim and Emacs, you should know that both of these editors have a very loyal fan-base and often they are very serious about their text editor of choice. And you can find lots of humor and stuff on the internet about it: - -Suggested Read [Download Linux Wallpapers That Are Also Cheat Sheets][4] - -![](https://itsfoss.com/wp-content/uploads/2016/07/vi-emacs-768x426.png) ->Vim vs Emacs - -Emacs is cross-platform and has both command-line and graphical user interface. It is also very rich with various features and, most importantly, extensible. - -![](https://itsfoss.com/wp-content/uploads/2016/07/emacs.png) ->Emacs User Interface - -Just as Vim, Emacs too comes with a steep learning curve. But once you master it, you can completely leverage its power. Emacs can handle just about any types of text files. The interface is customizable to suit your workflow. It supports macro recording and shortcuts. - -The unique power of Emacs is that it can be transformed into something completely different from a text editor. There is a large collection of modules that can transform the application for using in completely different scenarios, like – calendar, news reader, word processor etc. You can even play games in Emacs! - -### [NANO][5] - -When it comes to simplicity, Nano is the one. Unlike Vim or Emacs, the learning curve for nano is almost flat. - -If you want to simply create & edit a text file and get on with your life, look no further than Nano. - -![](https://itsfoss.com/wp-content/uploads/2016/07/nano.png) ->Nano User Interface - -The shortcuts available on Nano are displayed at the bottom of the user interface. Nano includes only the basic functions of a text editor. - -It is minimal and perfectly suitable for editing system & configuration files. For those who doesn’t need advanced features from a command-line text editor, Nano is the perfect match. - -### OTHERS - -There is one more editor I’d like to mention: - -[The Nice Editor (ne)][6]: The official site says, - ->If you have the resources and the patience to use emacs or the right mental twist to use vi then probably ne is not for you. - -Basically, ne features many advanced features like Vim or Emacs, including – scripting and macro recording. But it comes with a more intuitive control and not so steep learning curve. - -### WHAT DO YOU THINK? - -I know that if you are a seasoned Linux user, you’ll say these are the obvious candidates for the list of best command line text editors for Linux. Therefore, I would like to ask you, if there are some other command line text editors for Linux that you want to share with us? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/command-line-text-editors-linux/?utm_source=newsletter&utm_medium=email&utm_campaign=ubuntu_forums_hacked_new_skype_for_linux_and_more_linux_stories - -作者:[Munif Tanjim][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/munif/ -[1]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/ -[2]: http://www.vim.org/ -[3]: https://www.gnu.org/software/emacs/ -[4]: https://itsfoss.com/download-linux-wallpapers-cheat-sheets/ -[5]: http://www.nano-editor.org/ -[6]: http://ne.di.unimi.it/ diff --git a/translated/tech/20160717 BEST TEXT EDITORS FOR LINUX COMMAND LINE.md b/translated/tech/20160717 BEST TEXT EDITORS FOR LINUX COMMAND LINE.md new file mode 100644 index 0000000000..fdb8d34098 --- /dev/null +++ b/translated/tech/20160717 BEST TEXT EDITORS FOR LINUX COMMAND LINE.md @@ -0,0 +1,93 @@ + +Linux命令行下的优秀文本编辑软件 +========================================== + +![](https://itsfoss.com/wp-content/uploads/2016/07/Best-Command-Line-Text-Editors-for-Linux.jpg) + +文本编辑软件在任何操作系统上都是必备的软件。我们不缺乏在 Linux 上非常现代化的编辑软件,但是他们都是基于 GUI (图形界面)的编辑软件。 + +正如你所了解的,Linux 真正的魅力在于命令行。另外当你正在用命令行工作时,你可能需要一个可以在控制台窗口就可以运行的文本编辑器。 + +正因为这个目的,我们准备了一个基于 Linux 命令行的文本编辑器清单。 + +### [VIM][2] + +如果你已经使用 Linux 有一段时间,那么你肯定听到过 Vim 。Vim 是一个高可配、跨平台、高效率的文本编辑器。 + +几乎所有的 Linux 发行版本都已经内置了 Vim ,由于它的丰富特性已经变得非常流行的。 + +![](https://itsfoss.com/wp-content/uploads/2016/07/vim.png) +>Vim 用户窗口 + +Vim 可能会让第一次使用它的人感到非常痛苦。我记得我第一次尝试使用 Vim 编辑一个文本文件时,我是非常困惑的。我不能用 Vim 输入一个字母,更有趣的是,我甚至不知道该怎么关闭它。如果你准备使用 Vim ,你需要有决心跨过一个曲折的学习路线。 + +一旦你经历过那些,通过梳理一些文档,记住它的命令和快捷键,你会发现这段学习经历是非常值得的。你可以将 Vim 按照你的意愿进行改造--配置一个让你看起来舒服的界面,通过使用脚本或者插件等来提高工作效率。Vim 支持语句高亮,宏记录和操作记录。 + +在Vim官网上,它是这样介绍的: + +>**Vim: The power tool for everyone!** + +如何使用它完全取决于你。你可以仅仅使用它作为文本编辑器,或者你可以将它打造成一个完善的IDE( Integrated Development Environment:集成开发环境)。 + +### [GNU EMACS][3] + +GNU Emacs 毫无疑问是一个非常强大的文本编辑器。如果你听说过 Vim 和 Emacs ,你应该知道这两个编辑器都拥有非常忠诚的粉丝基础,并且他们对于文本编辑器的选择非常看重。你也可以在互联网上找到大量关于他们的段子: + +建议阅读 [Download Linux Wallpapers That Are Also Cheat Sheets][4] + +![](https://itsfoss.com/wp-content/uploads/2016/07/vi-emacs-768x426.png) +>Vim vs Emacs + +Emacs 是一个拥有图形界面和命令行界面并且跨平台的软件。它也拥有非常多的特性,更重要的是,它是支持扩展的。 + +![](https://itsfoss.com/wp-content/uploads/2016/07/emacs.png) +>Emacs 用户界面 + +像Vim一样,Emacs 也需要经历一个曲折的学习路线。但是一旦你掌握它,你就能知道它的强大。Emacs可以处理几乎所有类型文本文件。它的界面可以定制成适合你的工作流。它也支持宏记录和快捷键。 + +Emacs 独特的特性是它可以转换成和文本编辑器完全不同的的东西。这里有大量的模块集可是使它在不同的场景下成为不同的应用,例如-计算器,新闻阅读,文字处理器等。你甚至都可以在 Emacs 里面玩游戏。 + +### [NANO][5] + +如果说到简易方便的软件,Nano 就是一个。 不像 Vim 和 Emacs , nano 的学习曲线是平滑的。 + +如果在生活中你仅仅是想创建和编辑一个文本文件,Nano 估计是最适合你的了。 + +![](https://itsfoss.com/wp-content/uploads/2016/07/nano.png) +>Nano 用户界面 + +Nano 可用的快捷键都在用户界面的下方展示出来了。Nano 仅仅拥有最基础的文本编辑软件的功能。 + +它非常小巧并且非常适合编辑系统和配置文件。对于那些不需要命令行编辑器功能的人来说,Nano是完美配备。 + +### 其它 +这里还有一些我想要提及其它编辑器: + +[The Nice Editor (ne)][6]: 官网是这样介绍的: + +>如果你有相关的资源或者耐心来使用 Emacs 或者正确的心理准备来使用 Vim ,那么 ne 可能不适合你。 + +基本上 ne 拥有像 Vim 和 Emacs 一样多的先进功能,包括--脚本和宏记录。但是它有更为直观的操作方式和平滑的学习路线。 + + +### 你认为呢? + +我知道如果你是一个熟练的 Linux 用户,你可以会说上面列举的 Linux 最好的命令行编辑器清单上的候选者都是非常明显的。因此我想跟你说,如果你还知道其他的 Linux 命令行文本编辑器你是否愿意跟我们一同分享? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/command-line-text-editors-linux/?utm_source=newsletter&utm_medium=email&utm_campaign=ubuntu_forums_hacked_new_skype_for_linux_and_more_linux_stories + +作者:[Munif Tanjim][a] +译者:[chenzhijun](https://github.com/chenzhijun) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/munif/ +[1]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/ +[2]: http://www.vim.org/ +[3]: https://www.gnu.org/software/emacs/ +[4]: https://itsfoss.com/download-linux-wallpapers-cheat-sheets/ +[5]: http://www.nano-editor.org/ +[6]: http://ne.di.unimi.it/ From 224a9f96ec5b31cafc926e8686f6f48bc4354c4f Mon Sep 17 00:00:00 2001 From: Mike Tang Date: Tue, 9 Aug 2016 16:02:14 +0800 Subject: [PATCH 1394/1469] translated/talk/20160525 What containers and unikernels can learn from Arduino and Raspberry Pi.md --- ...can learn from Arduino and Raspberry Pi.md | 53 ------------------- ...can learn from Arduino and Raspberry Pi.md | 51 ++++++++++++++++++ 2 files changed, 51 insertions(+), 53 deletions(-) delete mode 100644 sources/talk/20160525 What containers and unikernels can learn from Arduino and Raspberry Pi.md create mode 100644 translated/talk/20160525 What containers and unikernels can learn from Arduino and Raspberry Pi.md diff --git a/sources/talk/20160525 What containers and unikernels can learn from Arduino and Raspberry Pi.md b/sources/talk/20160525 What containers and unikernels can learn from Arduino and Raspberry Pi.md deleted file mode 100644 index ff81871630..0000000000 --- a/sources/talk/20160525 What containers and unikernels can learn from Arduino and Raspberry Pi.md +++ /dev/null @@ -1,53 +0,0 @@ -MikeCoder Translating... - -What containers and unikernels can learn from Arduino and Raspberry Pi -========================================================================== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/bus-containers.png?itok=vM7_7vs0) - - -Just the other day, I was speaking with a friend who is a mechanical engineer. He works on computer assisted braking systems for semi trucks and mentioned that his company has [Arduinos][1] all over the office. The idea is to encourage people to quickly experiment with new ideas. He also mentioned that Arduinos are more expensive than printed circuits. I was surprised by his comment about price, because coming from the software side of things, my perceptions of Arduinos was that they cost less than designing a specialized circuit. - -I had always viewed [Arduinos][2] and [Raspberry Pi][3] as these cool, little, specialized devices that can be used to make all kinds of fun gadgets. I came from the software side of the world and have always considered Linux on x86 and x86-64 "general purpose." The truth is, Arduinos are not specialized. In fact, they are very general purpose. They are fairly small, fairly cheap, and extremely flexible—that's why they caught on like wildfire. They have all kinds of I/O ports and expansion cards. They allow a maker to go out and build something cool really quickly. They even allow companies to build new products quickly. - -The unit price for an Arduino is much higher than a printed circuit, but time to a minimum viable idea is much lower. With a printed circuit, the unit price can be driven much lower but the upfront capital investment is much higher. So, long story short, the answer is—it depends. - -### Unikernels, rump kernels, and container hosts - -Enter unikernels, rump kernels, and minimal Linux distributions—these operating systems are purpose-built for specific use cases. These specialized operating systems are kind of like printed circuits. They require some up-front investment in planning and design to utilize, but could provide a great performance increase when deploying a specific workload at scale. - -Minimal operating systems such as Red Hat Enterprise Linux Atomic or CoreOS are purpose-built to run containers. They are small, quick, easily configured at boot time, and run containers quite well. The downside is that it requires extra engineering to add third-party extensions such as monitoring agents or tools for virtualization. Some side-loaded tooling needs redesigned as super-privileged containers. This extra engineering could be worth it if you are building a big enough container environment, but might not be necessary to just try out containers. - -Containers provide the ability to run standard workloads (things built on [glibc][4], etc.). The advantage is that the workload artifact (Docker image) can be built and tested on your desktop and deployed in production on completely different hardware or in the cloud with confidence that it will run with the same characteristics. In the production environment, container hosts are still configured by the operations teams, but the application is controlled by the developer. This is a sort of a best of both worlds. - -Unikernels and rump kernels are also purpose-built, but go a step further. The entire operating system is configured at build time by the developer or architect. This has benefits and challenges. - -One benefit is that the developer can control a lot about how the workload will run. Theoretically, a developer could try out [different TCP stacks][5] for different performance characteristics and choose the best one. The developer can configure the IP address ahead of time or have the system configure itself at boot with DHCP. The developer can also cut out anything that is not necessary for their application. There is also the promise of increased performance because of less [context switching][6]. - -There are also challenges with unikernels. Currently, there is a lot of tooling missing. It's much like a printed circuit world right now. A developer has to invest a lot of time and energy discerning if all of the right libraries exist, or they have to change the way their application works. There may also be challenges with how the "embedded" operating system is configured at runtime. Finally, every time a major change is made to the OS, it requires [going back to the developer][7] to change it. This is not a clean separation between development and operations, so I envision some organizational changes being necessary to truly adopt this model. - -### Conclusion - -There is a lot of interesting buzz around specialized container hosts, rump kernels, and unikernels because they hold the potential to revolutionize certain workloads (embedded, cloud, etc.). Keep your eye on this exciting, fast moving space, but cautiously. - -Currently, unikernels seem quite similar to building printed circuits. They require a lot of upfront investment to utilize and are very specialized, providing benefits for certain workloads. In the meantime containers are quite interesting even for conventional workloads and don't require as much investment. Typically an operations team should be able to port an application to containers, whereas it takes real re-engineering to port an application to unikernels and the industry is still not quite sure what workloads can be ported to unikernels. - -Here's to an exciting future of containers, rump kernels, and unikernels! - --------------------------------------- -via: https://opensource.com/business/16/5/containers-unikernels-learn-arduino-raspberry-pi - -作者:[Scott McCarty][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/fatherlinux -[1]: https://opensource.com/resources/what-arduino -[2]: https://opensource.com/life/16/4/arduino-day-3-projects -[3]: https://opensource.com/resources/what-raspberry-pi -[4]: https://en.wikipedia.org/wiki/GNU_C_Library -[5]: http://www.eetasia.com/ARTICLES/2001JUN/2001JUN18_NTEK_CT_AN5.PDF -[6]: https://en.wikipedia.org/wiki/Context_switch -[7]: http://developers.redhat.com/blog/2016/05/18/3-reasons-i-should-build-my-containerized-applications-on-rhel-and-openshift/ diff --git a/translated/talk/20160525 What containers and unikernels can learn from Arduino and Raspberry Pi.md b/translated/talk/20160525 What containers and unikernels can learn from Arduino and Raspberry Pi.md new file mode 100644 index 0000000000..958cf7ee67 --- /dev/null +++ b/translated/talk/20160525 What containers and unikernels can learn from Arduino and Raspberry Pi.md @@ -0,0 +1,51 @@ +容器和 Unikernel 能从 Raspberry Pi(树莓派)和 Arduino 学到什么 +========================================================================== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/bus-containers.png?itok=vM7_7vs0) + + +某一天,我和我的一个机械工程师朋友聊天的时候。 他最近在做一个给半挂卡车的电子辅助刹车系统,他提到他们公司的办公室里都是 [Arduinos][1]。这主要是方便员工可以快速的对新的想法进行实验。他也提到了,Arduinos 其实比自己画电路板更加昂贵。对此,我感到非常震惊。因为我从软件行业得到的印象是 Arduinos 比定制电路板更加便宜。 + +我常常把 [Arduinos][2] 和 [Raspberry Pi][3] 看做是可以制作非常有趣设备的小型,Cool,特别的组件。我主要是从事软件行业,并且常常想让 Linux 在 x86 和 x86-64 设备上都可以执行一致。真相就是,Arduinos 并不特殊。实际上,他们非常通用。他们相当的小,便宜,但是非常得灵活。这就是为什么他们向野火一样流行起来。他们有所有种类的输入输出设备,和扩展卡。他们能让制作者快速的构建非常 Cool 的设备。他们甚至可以让公司可以快速的开发产品。 + +一整套 Arduino 的价格比批量生产的电路板高了很多,但是,看不见的时间成本却低了很多。当电路板大规模生产的时候,价格可以控制的很低,但是,之前的研发费用却高了很多。所以,长话短说,答案就是,使用 Arduino 划得来。 + +### Unikernel, Rump 内核,和容器主机 + +Unikernel, Rump 内核和迷你 Linux 发行版,这些操作系统是为了特有用途而构建的。这些特有的操作系统,某种程度上就像定制电路板。他们需要前期的研发,还需要为了工具化而设计,但是,当大规模部署的时候,他可以提供强大的性能。 + +迷你操作系统,例如:红帽企业版或者 CoreOS 是为了运行容器而构建的。他们很小,快速,并且很容易在启动时配置,并且运行容器非常良好。缺点就是他需要额外的工程量来添加第三方插件,比如监控客户端或者虚拟化的工具。一些工具也需要为了超级权限的容器而重新设计。 如果你正在构建一个巨大的容器环境,这些额外的工作量是划算的。但是,如果只是尝试,那就没必要了。 + +容器提供了运行标准化的工作流程 (比如使用 [glibc][4] 编译) 的能力。一个好处就是你可以在你的电脑上构建和测试这个工作单元 (Docker 镜像) 并且在完全不同的硬件上或者云端非常顺利的部署。而且保持着相同的特性。在生产环境中,容器的宿主机可以依旧被运维配置管理,但是应用被开发团队控制。这就是对两个团队来说最好的合作方式。 + +Unikernels 和 Rump 内核依旧是为了特定目标构建的,但是却更进一步。整个的操作系统在构建的时候就被开发或者架构师配置了。这带来了好处,同时还有挑战。 + +一个好处就是,开发人员可以控制这个工作流程的运转。理论上说,一个开发者可以为了不同的特性,尝试 [不同的 TCP 协议栈][5],并且选择最好的一个。在操作系统启动的时候,开发人也可以配置 IP 地址,而不是通过 DHCP。 开发人员也可以裁剪任何对于应用而言不需要的部分。这也是性能提升的保障,通过减少[不必要的上下文切换][6]。 + +同时,Unikernel 也带来了挑战。目前,有很大的工具缺口。 现在,和画板子的世界类似,开发人员需要花费很多时间和精力在检查是否有完整的库文件存在,不然的话,他们必须改变他们应用的执行方式。在如何让嵌入式操作系统在运行时配置的时候,也存在挑战。最后,每次操作系统的大改动,都需要[反馈到开发人员][7]来进行修改。这并没有一个在开发和运维之间明确的界限,所以我能想象,为了接受了这个开发流程,一些组织或者公司必须要改变。 + +### 结论 + +这也有一些有趣的传闻在专门的容器主机,Rump 内核和 Unikernel,因为,他们会带来一个特定工作流程的潜在变革(嵌入式,云,等等)。在这个令人激动又快速发展的领域请保持你的关注,但是也不要放松警惕。 + +目前,Unikernel 看起来和定制电路板很像。他们都需要前期的研发投资,并且都是独特的,可以为确定的工作流程带来好处。同时,容器甚至在常规的工作流中都非常有趣,而且他不需要那么多的投入。一个简单的例子,运维团队能方便的在容器上部署一个应用,但是在 Unikernel 上部署一个应用则需要重新设计和编码,而且业界并不能完全保证,这个工作流程可以被部署在 Unikernel 上。 + +容器,Rump 内核 和 Unikernel 有一个光明的未来! + +-------------------------------------- +via: https://opensource.com/business/16/5/containers-unikernels-learn-arduino-raspberry-pi + +作者:[Scott McCarty][a] +译者:[MikeCoder](https://github.com/MikeCoder) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/fatherlinux +[1]: https://opensource.com/resources/what-arduino +[2]: https://opensource.com/life/16/4/arduino-day-3-projects +[3]: https://opensource.com/resources/what-raspberry-pi +[4]: https://en.wikipedia.org/wiki/GNU_C_Library +[5]: http://www.eetasia.com/ARTICLES/2001JUN/2001JUN18_NTEK_CT_AN5.PDF +[6]: https://en.wikipedia.org/wiki/Context_switch +[7]: http://developers.redhat.com/blog/2016/05/18/3-reasons-i-should-build-my-containerized-applications-on-rhel-and-openshift/ From ea8b62122676037e9990aa97d1e37ae86a35132c Mon Sep 17 00:00:00 2001 From: Ezio Date: Tue, 9 Aug 2016 21:41:17 +0800 Subject: [PATCH 1395/1469] =?UTF-8?q?20160809-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...729 Best Password Manager all platform.md | 459 ++++++++++++++++++ 1 file changed, 459 insertions(+) create mode 100644 sources/tech/20160729 Best Password Manager all platform.md diff --git a/sources/tech/20160729 Best Password Manager all platform.md b/sources/tech/20160729 Best Password Manager all platform.md new file mode 100644 index 0000000000..09c62bf93b --- /dev/null +++ b/sources/tech/20160729 Best Password Manager all platform.md @@ -0,0 +1,459 @@ +Best Password Manager — For Windows, Linux, Mac, Android, iOS and Enterprise +============================== + +![](https://4.bp.blogspot.com/-uMOdpnxBV9w/V5x4YW54SbI/AAAAAAAAo_E/o-gUmO46UB0Ji2IMzd_xdY5pVsCcJnFwQCLcB/s1600/free-best-password-manager-2016.png) + +When it comes to safeguarding your Internet security, installing an antivirus software or running a [Secure Linux OS][1] on your system does not mean you are safe enough from all kinds of cyber-threats. + +Today majority of Internet users are vulnerable to cyber attacks, not because they aren't using any best antivirus software or other security measures, but because they are using [weak passwords][2] to secure their online accounts. + +Passwords are your last lines of defense against online threats. Just look back to some recent data breaches and cyber attacks, including high-profile [data breach at OPM][3] (United States Office of Personnel Management) and the extra-marital affair site [Ashley Madison][4], that led to the exposure of hundreds of millions of records online. + +Although you can not control data breaches, it is still important to create strong passwords that can withstand dictionary and [brute-force attacks][5]. + +You see, the longer and more complex your password is, the much harder it is crack. + +### How to Stay Secure Online? + +Security researchers have always advised online users to create long, complex and different passwords for their various online accounts. So, if one site is breached, your other accounts on other websites are secure enough from being hacked. + +Ideally, your strong password should be at least 16 characters long, should contain a combination of digits, symbols, uppercase letters and lowercase letters and most importantly the most secure password is one you don't even know. + +The password should be free of repetition and not contain any dictionary word, pronoun, your username or ID, and any other predefined letter or number sequences. + +I know this is a real pain to memorize such complex password strings and unless we are human supercomputers, remembering different passwords for several online accounts is not an easy task. + +The issue is that today people subscribe to a lot of online sites and services, and it's usually hard to create and remember different passwords for every single account. + +But, Luckily to make this whole process easy, there's a growing market for password managers for PCs and phones that can significantly reduce your password memorizing problem, along with the cure for your bad habit of setting weak passwords. + +### What is Password Manager? + +![](https://1.bp.blogspot.com/-LY7pI45tMq0/V5r_XV083RI/AAAAAAAAo6M/MivILg0_4Vs7UgLKZJqM5vhvYujQCCcpgCLcB/s1600/best-password-manager-software.png) + +Password Manager software has come a very long way in the past few years and is an excellent system that both allows you to create complex passwords for different sites and remember them. + +A password manager is just software that creates, stores and organizes all your passwords for your computers, websites, applications and networks. + +Password managers that generate passwords and double as a form filler are also available in the market, which has the ability to enter your username and password automatically into login forms on websites. + +So, if you want super secure passwords for your multiple online accounts, but you do not want to memorize them all, Password Manager is the way to go. + +### How does a Password Manager work? + +Typically, Password Manager software works by generating long, complex, and, most importantly, unique password strings for you, and then stores them in encrypted form to protect the confidential data from hackers with physical access to your PC or mobile device. + +The encrypted file is accessible only through a master password. So, all you need to do is remember just one master password to open your password manager or vault and unlock all your other passwords. + +? + +However, you need to make sure your master password is extra-secure of at least 16 characters long. + +### Which is the Best Password Manager? How to Choose? + +I've long recommended password managers, but most of our readers always ask: + +- Which password manager is best? +- Which password manager is the most secure? Help! + +So, today I'm introducing you some of the best Password Manager currently available in the market for Windows, Linux, Mac, Android, iOS and Enterprise. + +Before choosing a good password manager for your devices, you should check these following features: + +- Cross-Platform Application +- Works with zero-knowledge model +- Offers two-factor authentication (multi-factor authentication) + +Note: Once adopted, start relying on your password manager because if you are still using weak passwords for your important online accounts, nobody can save you from malicious hackers. + +### Best Password Managers for Windows + +![](https://2.bp.blogspot.com/-8MUEI5RctdA/V5sDM_oCoaI/AAAAAAAAo60/LX4AktoS_f0JeYDORSqmDZMfmsbOa6QnACLcB/s1600/Best-Password-Manager-for-Windows.png) + +Windows users are most vulnerable to cyber attacks because Windows operating system has always been the favorite target of hackers. So, it is important for Windows users to make use of a good password manager. + +Some other best password manager for windows: Keeper, Password Safe, LockCrypt, 1Password, and Dashlane. + +- 1. Keeper Password Manager (Cross-Platform) + +![](https://1.bp.blogspot.com/-9ISKGyTAX9U/V5xec18I21I/AAAAAAAAo8E/i8IqZXXpDwMGe8wnI6Adj3qduR_Qm5o3ACLcB/s1600/keeper-Password-Manager-for-mac-os-x.png) + +Keeper is a secure, easy-to-use and robust password manager for your Windows, Mac, iPhone, iPad, and iPod devices. + +Using military-grade 256-bit AES encryption, Keeper password manager keeps your data safe from prying eyes. + +It has a secure digital vault for protecting and managing your passwords, as well as other secret information. Keeper password manager application supports Two-factor authentication and available for every major operating system. + +There is also an important security feature, called Self-destruct, which if enabled, will delete all records from your device if the incorrect master password is entered more than five times incorrectly. + +But you don't need worry, as this action will not delete the backup records stored on Keeper's Cloud Security Vault. + +Download Keeper Password Manager: [Windows, Linux and Mac][6] | [iOS][7] | [Android][8] | [Kindle][9] + +- 2. Dashlane Password Manager (Cross-Platform) + +![](https://3.bp.blogspot.com/-2BuFpcAe9K8/V5xjugOWPuI/AAAAAAAAo9A/wpooAjcH74EzxfNJwrFu-Mcn0IkwiRGjACLcB/s1600/Dashlane-Password-Manager-for-Android.png) + +DashLane Password Manager software is a little newer, but it offers great features for almost every platform. + +DashLane password manager works by encrypting your personal info and accounts' passwords with AES-256 encryption on a local machine, and then syncs your details with its online server, so that you can access your accounts database from anywhere. + +The best part of DashLane is that it has an automatic password changer that can change your accounts' passwords for you without having to deal with it yourself. + +DashLane Password Manager app for Android gives you the secure password management tools right to your Android phone: your password vault and form auto-filler for online stores and other sites. + +DashLane Password Manager app for Android is completely free to use on a single device and for accessing multiple devices, you can buy a premium version of the app. + +Download DashLane Password Manager: [Windows][10] and [Mac][11] | [iOS][12] | [Android][13] + +- 3. LastPass Password Manager (Cross-Platform) + +![](https://3.bp.blogspot.com/--o_hWTgXh2M/V5sAjw7FlYI/AAAAAAAAo6U/Ajmvt0rgRAQE3M_YeYurpbsUoLBN8OTLwCLcB/s1600/LastPass-Password-Manager-for-Windows.png) + +LastPass is one of the best Password Manager for Windows users, though it comes with the extension, mobile app, and even desktop app support for all the browsers and operating systems. + +LastPass is an incredibly powerful cloud-based password manager software that encrypts your personal info and accounts' passwords with AES-256 bit encryption and even offers a variety of two-factor authentication options in order to ensure no one else can log into your password vault. + +LastPass Password Manager comes for free as well as a premium with a fingerprint reader support. + +Download LastPass Password Manager: [Windows, Mac, and Linux][14] | [iOS][15] | [Android][16] + +### Best Password Manager for Mac OS X + +![](https://2.bp.blogspot.com/-lEim3E-0wcg/V5sFhOVYK7I/AAAAAAAAo7A/z6Lp8_ULdJAD8ErZ1a-FevXPO8nR3JKNACLcB/s1600/Best-Password-Manager-for-mac-os-x.png) + +People often say that Mac computers are more secure than Windows and that "Macs don't get viruses," but it is not entirely correct. + +As proof, you can read our previous articles on cyber attacks against Mac and iOs users, and then decide yourself that you need a password manager or not. + +Some other best password manager for Mac OS X: 1Password, Dashlane, LastPass, OneSafe, PwSafe. + +- 1. LogMeOnce Password Manager (Cross-Platform) + +![](https://4.bp.blogspot.com/-fl64fXK2bdA/V5sHL215j_I/AAAAAAAAo7M/fbn4EsrQMkU3tWWfiAsWlTgKKXb0oEzlwCLcB/s1600/LogMeOnce-Password-Manager-for-Mac-os-x.png) + +LogMeOnce Password Management Suite is one of the best password manager for Mac OS X, as well as syncs your passwords across Windows, iOS, and Android devices. + +LogMeOnce is one of the best Premium and Enterprise Password Management Software that offers a wide variety of features and options, including Mugshot feature. + +If your phone is ever stolen, LogMeOnce Mugshot feature tracks the location of the thief and also secretly takes a photo of the intruder when trying to gain access to your account without permission. + +LogmeOnce protects your passwords with military-grade AES-256 encryption technology and offers Two-factor authentication to ensure that even with the master password in hand, a thief hacks your account. + +Download LogMeOnce Password Manager: [Windows and Mac][17] | [iOS][18] | [Android][19] + +- 2. KeePass Password Manager (Cross-Platform) + +![](https://4.bp.blogspot.com/-XWwdG1z9sDw/V5sA7azAy6I/AAAAAAAAo6c/dkkfMRuxDoE_gi5OMRvDOUFq15P5NRO6QCLcB/s1600/Keepass-Password-Manager-for-Windows.png) + +Although LastPass is one of the best password manager, some people are not comfortable with a cloud-based password manager. + +KeePass is a popular password manager application for Windows, but there are browser extensions and mobile apps for KeePass as well. + +KeePass password manager for Windows stores your accounts' passwords on your PC, so you remain in control of them, and also on Dropbox, so you can access it using multiple devices. + +KeePass encrypts your passwords and login info using the most secure encryption algorithms currently known: AES 256-bit encryption by default, or optional, Twofish 256-bit encryption. + +KeePass is not just free, but it is also open source, which means its code and integrity can be examined by anyone, adding a degree of confidence. + +Download KeePass Password Manager: [Windows and Linux][20] | [Mac][21] | [iOS][22] | [Android][23] +3. Apple iCloud Keychain + +![](https://4.bp.blogspot.com/-vwY_dmsKIBg/V5xfhIZGxxI/AAAAAAAAo8M/OjPrBsp9GysF-bK3oqHtW74hKNYO61W9QCLcB/s1600/Apple-iCloud-Keychain-Security.png) + +Apple introduced the iCloud Keychain password management system as a convenient way to store and automatically sync all your login credentials, Wi-Fi passwords, and credit card numbers securely across your approved Apple devices, including Mac OS X, iPhone, and iPad. + +Your Secret Data in Keychain is encrypted with 256-bit AES (Advanced Encryption Standard) and secured with elliptic curve asymmetric cryptography and key wrapping. + +Also, iCloud Keychain generates new, unique and strong passwords for you to use to protect your computer and accounts. + +Major limitation: Keychain doesn't work with other browsers other than Apple Safari. + +Also Read: [How to Setup iCloud Keychain][24]? +Best Password Manager for Linux + +![](https://1.bp.blogspot.com/-2zDAqYEQTQA/V5xgbo_OcQI/AAAAAAAAo8Y/hWzGLW7R4vse3QnpCM5-qmSHLtzK5M1VACLcB/s1600/best-Password-Manager-for-linux.png) + +No doubt, some Linux distributions are the safest operating systems exist on the earth, but as I said above that adopting Linux doesn't completely protect your online accounts from hackers. + +There are a number of cross-platform password managers available that sync all your accounts' passwords across all your devices, such as LastPass, KeePass, RoboForm password managers. + +Here below I have listed two popular and secure open source password managers for Linux: + +- 1. SpiderOak Encryptr Password Manager (Cross-Platform) + +![](https://4.bp.blogspot.com/-SZkmP7dpXZM/V5xiKeuT4KI/AAAAAAAAo8s/QhvfBz3OX78IUit_HLym0sdKxlz99qFfgCLcB/s1600/SpiderOak-Encryptr-Password-Manager-for-linux.png) + +SpiderOak's Encryptr Password Manager is a zero-knowledge cloud-based password manager that encrypts protect your passwords using Crypton JavaScript framework, developed by SpiderOak and recommended by Edward Snowden. + +It is a cross-platform, open-Source and free password manager that uses end-to-end encryption and works perfectly for Ubuntu, Debian Linux Mint, and other Linux distributions. + +Encryptr Password Manager application itself is very simple and comes with some basic features. + +Encryptr software lets you encrypt three types of files: Passwords, Credit Card numbers and general any text/keys. + +Download Encryptr Password Manager: [Windows, Linux and Mac][25] | [iOS][26] | [Android][27] + +2. EnPass Password Manager (Cross-Platform) + +![](https://4.bp.blogspot.com/-_IF81t9rL7U/V5xhBIPUSHI/AAAAAAAAo8c/6-kbLXTl2G0EESTH4sP9KvZLzTFlCyypACLcB/s1600/EnPass-Password-Manager-for-Linux.png) + +Enpass is an excellent security oriented Linux password manager that works perfectly with other platforms too. Enpass offers you to backup and restores stored passwords with third-party cloud services, including Google Drive, Dropbox, OneDrive, or OwnCloud. + +It makes sure to provide the high levels of security and protects your data by a master password and encrypted it with 256-bit AES using open-source encryption engine SQLCipher, before uploading backup onto the cloud. +"We do not host your Enpass data on our servers. So, no signup is required for us. Your data is only stored on your device," EnPass says. +Additionally, by default, Enpass locks itself every minute when you leave your computer unattended and clears clipboard memory every 30 seconds to prevent your passwords from being stolen by any other malicious software. + +Download EnPass Password Manager: [Windows][28], [Linux][29] | [Mac][30] | [iOS][31] | [Android][32] + +3. RoboForm Password Manager (Cross-Platform) + +![](https://3.bp.blogspot.com/-g8Qf9V1EdqU/V5sBkDk614I/AAAAAAAAo6k/5ZTr9LyosU82F16GxajewvU4sWYyJFq5gCLcB/s1600/Roboform-Password-Manager-for-Windows.png) + +You can easily find good password managers for Windows OS, but RoboForm Free Password Manager software goes a step further. + +Besides creating complex passwords and remembering them for you, RoboForm also offers a smart form filler feature to save your time while browsing the Web. + +RoboForm encrypts your login info and accounts' passwords using military grade AES encryption with the key that is obtained from your RoboForm Master Password. + +RoboForm is available for browsers like Internet Explorer, Chrome, and Firefox as well as mobile platforms with apps available for iOS, Android, and Windows Phone. + +Download RoboForm Password Manager: [Windows and Mac][33] | [Linux][34] | [iOS][35] | [Android][36] + +### Best Password Manager for Android + +![](https://1.bp.blogspot.com/-1PXI2KDrDEU/V5xigbW8lgI/AAAAAAAAo8w/Zv5hrdOcbSU7LA0kYrNpvJ1rxjg7EoOewCLcB/s1600/best-Password-Manager-for-android.png) + +More than half of the world's population today is using Android devices, so it becomes necessary for Android users to secure their online accounts from hackers who are always seeking access to these devices. + +Some of the best Password Manager apps for Android include 1Password, Keeper, DashLane, EnPass, OneSafe, mSecure and SplashID Safe. + +- 1. 1Password Password Manager (Cross-Platform) + +![](https://4.bp.blogspot.com/--w3s9SoWgYA/V5xjJwVRUTI/AAAAAAAAo84/BSucybvPdtUKYYcRtDbn-_2cOz-mfMA9gCLcB/s1600/1password-Password-Manager-for-android.png) + +1Password Password Manager app for Android is one of the best apps for managing all your accounts' passwords. + +1Password password manager app creates strong, unique and secure passwords for every account, remembers them all for you, and logs you in with just a single tap. + +1Password password manager software secures your logins and passwords with AES-256 bit encryption, and syncs them to all of your devices via your Dropbox account or stores locally for any other application to sync if you choose. + +Recently, the Android version of 1Password password manager app has added Fingerprint support for unlocking all of your passwords instead of using your master password. + +Download 1Password Password Manager: [Windows and Mac][37] | [iOS][38] | [Android][39] + +- 2. mSecure Password Manager (Cross-Platform) + +![](https://4.bp.blogspot.com/-nvjjS2dWfPc/V5xkEdAOYvI/AAAAAAAAo9I/EDGfA5hzacIq46gWG-6BD2UPHwQAHD-pgCLcB/s1600/mSecure-password-manager-for-android.png) + +Like other popular password manager solutions, mSecure Password Manager for Android automatically generates secure passwords for you and stores them using 256-bit Blowfish encryption. + +The catchy and unique feature mSecure Password Manager software provides its ability to self-destruct database after 5, 10, or 20 failed attempts (as per your preference) to input the right password. + +You can also sync all of your devices with Dropbox, or via a private Wi-Fi network. In either case, all your data is transmitted safely and securely between devices regardless of the security of your cloud account. + +Download mSecure Password Manager software: [Windows and Mac][40] | [iOS][41] | [Android][42] + +### Best Password Manager for iOS + +![](https://4.bp.blogspot.com/-SOXYw_9mFq0/V5xk6Kl8-DI/AAAAAAAAo9Q/AMbEl_t3HjAJ4ZX7gLVoa33z-myE4bK5wCLcB/s1600/best-Password-Manager-for-ios-iphone.png) + +As I said, Apple's iOS is also prone to cyber attacks, so you can use some of the best password manager apps for iOS to secure your online accounts, including Keeper, OneSafe, Enpass, mSecure, LastPass, RoboForm, SplashID Safe and LoginBox Pro. + +- 1. OneSafe Password Manager (Cross-Platform) + +![](https://2.bp.blogspot.com/-HPEJpqeOs00/V5xlSh7OUxI/AAAAAAAAo9Y/d5qkOy3BieMSxjGrnrnH4fvzUzAzDqhCgCLcB/s1600/onesafe-password-manager-for-ios.png) + +OneSafe is one of the best Password Manager apps for iOS devices that lets you store not only your accounts' passwords but also sensitive documents, credit card details, photos, and more. + +OneSafe password manager app for iOS encrypts your data behind a master password, with AES-256 encryption — the highest level available on mobile — and Touch ID. There is also an option for additional passwords for given folders. + +OneSafe password manager for iOS also offers an in-app browser that supports autofill of logins, so that you don't need to enter your login details every time. + +Besides this, OneSafe also provides advanced security for your accounts' passwords with features like auto-lock, intrusion detection, self-destruct mode, decoy safe and double protection. + +Download OneSafe Password Manager: [iOS][43] | [Mac][44] | [Android][45] | [Windows][46] + +- 2. SplashID Safe Password Manager (Cross-Platform) + +![](https://1.bp.blogspot.com/-FcNub2p-QNE/V5xmDW7QXvI/AAAAAAAAo9o/23VuGUAMCYYS64kKlUqBcfx3JIfBr5gTgCLcB/s1600/SplashID-Safe-password-manager-for-ios.png) + +SplashID Safe is one of the oldest and best password manager tools for iOS that allows users to securely store their login data and other sensitive information in an encrypted record. + +All your information, including website logins, credit card and social security data, photos and file attachments, are protected with 256-bit encryption. + +SplashID Safe Password Manager app for iOS also provides web autofill option, meaning you will not have to bother copy-pasting your passwords in login. + +The free version of SplashID Safe app comes with basic record storage functionality, though you can opt for premium subscriptions that provide cross-device syncing among other premium features. + +Download SplashID Safe Password Manager: [Windows and Mac][47] | [iOS][48] | [Android][49] + +3. LoginBox Pro Password Manager + +![](https://3.bp.blogspot.com/-4GzhwZFXDHQ/V5xogkDk49I/AAAAAAAAo90/69rmVdKD-VUG0kHJXIqE2x-mVlWZEDrYwCLcB/s1600/LoginBox-Pro-Password-Manager-for-ios.png) + +LoginBox Pro is another great password manager app for iOS devices. The app provides a single tap login to any website you visit, making the password manager app as the safest and fastest way to sign in to password-protected internet sites. + +LoginBox Password Manager app for iOS combines a password manager as well as a browser. + +From the moment you download it, all your login actions, including entering information, tapping buttons, checking boxes, or answering security questions, automatically completes by the LoginBox Password Manager app. + +For security, LoginBox Password Manager app uses hardware-accelerated AES encryption and passcode to encrypt your data and save it on your device itself. + +Download LoginBox Password Manager: [iOS][50] | [Android][51] + +### Best Online Password Managers + +Using an online password manager tool is the easiest way to keep your personal and private information safe and secure from hackers and people with malicious intents. + +Here I have listed some of the best online password managers that you can rely on to keep yourself safe online: + +- 1. Google Online Password Manager + +![](https://2.bp.blogspot.com/-HCSzj5tKgwY/V5xqVjjtfgI/AAAAAAAAo-A/OYcgv-S5wmQlAskF1jrEGQAy98ogMnXTgCLcB/s1600/google-online-password-manager.png) + +Did you know Google has its homebrew dedicated password manager? + +Google Chrome has a built-in password manager tool that offers you an option to save your password whenever you sign in to a website or web service using Chrome. + +All of your stored accounts' passwords are synced with your Google Account, making them available across all of your devices using the same Google Account. + +Chrome password manager lets you manage all your accounts' passwords from the Web. + +So, if you prefer using a different browser, like Microsoft Edge on Windows 10 or Safari on iPhone, just visit [passwords.google.com][52], and you'll see a list of all your passwords you have saved with Chrome. Google's two-factor authentication protects this list. + +- 2. Clipperz Online Password Manager + +![](https://2.bp.blogspot.com/-gs8b_N_k6CA/V5xrvzbUIKI/AAAAAAAAo-M/vsTXHZNErkQu6g8v9V1R2FxLkdppZq_GACLcB/s1600/Clipperz-Online-Password-Manager.png) + +Clipperz is a free, cross-platform best online password manager that does not require you to download any software. Clipperz online password manager uses a bookmarklet or sidebar to create and use direct logins. + +Clipperz also offers an offline password manager version of its software that allows you to download your passwords to an [encrypted disk][53] or a USB drive so you can take them with you while traveling and access your accounts' passwords when you are offline. + +Some features of Clipperz online password manager also includes password strength indicator, application locking, SSL secure connection, one-time password and a password generator. + +Clipperz online password manager can work on any computer that runs a browser with a JavaScript browser. + +- 3. Passpack Online Password Manager + +![](https://4.bp.blogspot.com/-ng91nPnzbWI/V5xsarl2mqI/AAAAAAAAo-Q/zJlFK-63vugeoyymDL26c5mPiWNsGQjuACLcB/s1600/Passpack-Free-Online-Password-Manager.png) + +Passpack is an excellent online password manager with a competitive collection of features that creates, stores and manages passwords for your different online accounts. + +PassPack online password manager also allows you to share your passwords safely with your family or coworkers for managing multiple projects, team members, clients, and employees easily. + +Your usernames and passwords for different accounts are encrypted with AES-256 Encryption on PassPack's servers that even hackers access to its server can not read your login information. + +Download the PassPack online password manager toolbar to your web browser and navigate the web normally. Whenever you log into any password-protected site, PassPack saves your login data so that you do not have to save your username and password manually on its site. + +### Best Enterprise Password Manager + +Over the course of last 12 months, we've seen some of the biggest data breaches in the history of the Internet and year-over-year the growth is heating up. + +According to statistics, a majority of employees even don't know how to protect themselves online, which led company’s business at risk. + +To keep password sharing mechanism secure in an organization, there exist some password management tools specially designed for enterprises use, such as Vaultier, CommonKey, Meldium, PassWork, and Zoho Vault. + +- 1. Meldium Enterprise Password Manager Software + +![](https://3.bp.blogspot.com/-3rKr3KUpuiQ/V5xs8JR7pVI/AAAAAAAAo-c/VF1tmKbwPzoJmNvA3Ym69CizG7_VqM6ywCLcB/s1600/Meldium-Enterprise-Password-Manager.png) + +LogMeIn's Meldium password management tool comes with a one-click single sign-on solution that helps businesses access to web apps securely and quickly. + +It automatically logs users into apps and websites without typing usernames and passwords and also tracks password usage within your organization. + +Meldium password manager is perfect for sharing accounts within your team member without sharing the actual password, which helps organizations to protect themselves from phishing attacks. + +- 2. Zoho Vault Password Management Software + +![](https://2.bp.blogspot.com/-J-N_1wOYxmI/V5xtrz42QWI/AAAAAAAAo-o/QF4n4QAF7ZMBd7uIRdjM6Hdd1MHwsXWQACLcB/s1600/zoho-vault--Enterprise-Password-Manager.png) + +Zoho Vault is one of the best Password Manager for Enterprise users that helps your team share passwords and other sensitive information fast and securely while monitoring each user's usage. + +All your team members need to download is the Zoho browser extension. Zoho Vault password manager will automatically fill passwords from your team's shared vault. + +Zoho Vault also provides features that let you monitor your team's password usage and security level so that you can know who is using which login. + +The Zoho Vault enterprise-level package even alerts you whenever a password is changed or accessed. + +### For Extra Security, Use 2-Factor Authentication + +![](https://4.bp.blogspot.com/-jDnJBDoibtQ/V5xuHVHukRI/AAAAAAAAo-w/1Erjgk-IvKs__TXwYDz-8Groz9hWEElZgCLcB/s1600/two-factor-authentication-password-security.png) + +No matter how strong your password is, there still remains a possibility for hackers to find some or the other way to hack into your account. + +Two-factor authentication is designed to fight this issue. Instead of just one password, it requires you to enter the second passcode which is sent either to your mobile number via an SMS or to your email address via an email. + +So, I recommend you to enable two-factor authentication now along with using a password manager software to secure your online accounts and sensitive information from hackers. + + + + + +-------------------------------------------------------------------------------- + +via: https://thehackernews.com/2016/07/best-password-manager.html + +作者:[Swati Khandelwal][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://thehackernews.com/2016/07/best-password-manager.html#author-info + +[1]: http://thehackernews.com/2016/03/subgraph-secure-operating-system.html +[2]: http://thehackernews.com/2016/01/password-security-manager.html +[3]: http://thehackernews.com/2015/09/opm-hack-fingerprint.html +[4]: http://thehackernews.com/2015/08/ashley-madison-accounts-leaked-online.html +[5]: http://thehackernews.com/2013/05/cracking-16-character-strong-passwords.html +[6]: https://keepersecurity.com/download.html +[7]: https://itunes.apple.com/us/app/keeper-password-manager-digital/id287170072?mt=8 +[8]: https://play.google.com/store/apps/details?id=com.callpod.android_apps.keeper +[9]: http://www.amazon.com/gp/mas/dl/android?p=com.callpod.android_apps.keeper +[10]: https://www.dashlane.com/download +[11]: https://www.dashlane.com/passwordmanager/mac-password-manager +[12]: https://itunes.apple.com/in/app/dashlane-free-secure-password/id517914548?mt=8 +[13]: https://play.google.com/store/apps/details?id=com.dashlane&hl=en +[14]: https://lastpass.com/misc_download2.php +[15]: https://itunes.apple.com/us/app/lastpass-for-premium-customers/id324613447?mt=8&ign-mpt=uo%3D4 +[16]: https://play.google.com/store/apps/details?id=com.lastpass.lpandroid +[17]: https://www.logmeonce.com/download/ +[18]: https://itunes.apple.com/us/app/logmeonce-free-password-manager/id972000703?ls=1&mt=8 +[19]: https://play.google.com/store/apps/details?id=log.me.once + +[20]: http://keepass.info/download.html +[21]: https://itunes.apple.com/us/app/kypass-companion/id555293879?ls=1&mt=12 +[22]: https://itunes.apple.com/de/app/ikeepass/id299697688?mt=8 +[23]: https://play.google.com/store/apps/details?id=keepass2android.keepass2android +[24]: https://support.apple.com/en-in/HT204085 +[25]: https://spideroak.com/opendownload +[26]: https://itunes.apple.com/us/app/spideroak/id360584371?mt=8 +[27]: https://play.google.com/store/apps/details?id=com.spideroak.android +[28]: https://www.enpass.io/download-enpass-for-windows/ +[29]: https://www.enpass.io/download-enpass-linux/ +[30]: https://itunes.apple.com/app/enpass-password-manager-best/id732710998?mt=12 +[31]: https://itunes.apple.com/us/app/enpass-password-manager/id455566716?mt=8 +[32]: https://play.google.com/store/apps/details?id=io.enpass.app&hl=en +[33]: http://www.roboform.com/download +[34]: http://www.roboform.com/for-linux +[35]: https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=331787573&mt=8 +[36]: https://play.google.com/store/apps/details?id=com.siber.roboform +[37]: https://1password.com/downloads/ +[38]: https://itunes.apple.com/in/app/1password-password-manager/id568903335?mt=8 +[39]: https://play.google.com/store/apps/details?id=com.agilebits.onepassword&hl=en +[40]: https://www.msecure.com/desktop-app/ +[41]: https://itunes.apple.com/in/app/msecure-password-manager/id292411902?mt=8 +[42]: https://play.google.com/store/apps/details?id=com.mseven.msecure&hl=en +[43]: https://itunes.apple.com/us/app/onesafe/id455190486?ls=1&mt=8 +[44]: https://itunes.apple.com/us/app/onesafe-secure-password-manager/id595543758?ls=1&mt=12 +[45]: https://play.google.com/store/apps/details?id=com.lunabee.onesafe +[46]: https://www.microsoft.com/en-us/store/apps/onesafe/9wzdncrddtx9 +[47]: https://splashid.com/downloads.php +[48]: https://itunes.apple.com/app/splashid-safe-password-manager/id284334840?mt=8 +[49]: https://play.google.com/store/apps/details?id=com.splashidandroid&hl=en +[50]: https://itunes.apple.com/app/loginbox-pro/id579954762?mt=8 +[51]: https://play.google.com/store/apps/details?id=com.mygosoftware.android.loginbox +[52]: https://passwords.google.com/ +[53]: http://thehackernews.com/2014/01/Kali-linux-Self-Destruct-nuke-password.html + From be32b533e38a96b0281df148a12d464a9fb04b36 Mon Sep 17 00:00:00 2001 From: ChrisLeeGit Date: Tue, 9 Aug 2016 22:09:04 +0800 Subject: [PATCH 1396/1469] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=20How=20to=20Monitor=20Docker=20Containers=20using=20Grafana?= =?UTF-8?q?=20on=20Ubuntu=20=E5=A4=9A=E8=B0=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...w to Monitor Docker Containers using Grafana on Ubuntu.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sources/tech/20160809 How to Monitor Docker Containers using Grafana on Ubuntu.md b/sources/tech/20160809 How to Monitor Docker Containers using Grafana on Ubuntu.md index 3d7b171788..acdfff0b4f 100644 --- a/sources/tech/20160809 How to Monitor Docker Containers using Grafana on Ubuntu.md +++ b/sources/tech/20160809 How to Monitor Docker Containers using Grafana on Ubuntu.md @@ -1,3 +1,4 @@ +Being translated by ChrisLeeGit How to Monitor Docker Containers using Grafana on Ubuntu ================================================================================ @@ -255,10 +256,10 @@ You can get [more information][1] on docker monitoring here. Thank you for readi via: http://linoxide.com/linux-how-to/monitor-docker-containers-grafana-ubuntu/ 作者:[Saheetha Shameer][a] -译者:[译者ID](https://github.com/译者ID) +译者:[ChrisLeeGit](https://github.com/chrisleegit) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://linoxide.com/author/saheethas/ -[1]:https://github.com/vegasbrianc/docker-monitoring \ No newline at end of file +[1]:https://github.com/vegasbrianc/docker-monitoring From e12eb3a0054fbcbe7a0a72f58d4653421efb3ffd Mon Sep 17 00:00:00 2001 From: Ezio Date: Tue, 9 Aug 2016 22:11:49 +0800 Subject: [PATCH 1397/1469] =?UTF-8?q?20160809-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/Part 3 - Let’s Build A Web Server.md | 1012 +++++++++++++++++ 1 file changed, 1012 insertions(+) create mode 100644 sources/tech/Part 3 - Let’s Build A Web Server.md diff --git a/sources/tech/Part 3 - Let’s Build A Web Server.md b/sources/tech/Part 3 - Let’s Build A Web Server.md new file mode 100644 index 0000000000..40a9ccd0b7 --- /dev/null +++ b/sources/tech/Part 3 - Let’s Build A Web Server.md @@ -0,0 +1,1012 @@ +Part 3 - Let’s Build A Web Server +===================================== + +>“We learn most when we have to invent” —Piaget + +In Part 2 you created a minimalistic WSGI server that could handle basic HTTP GET requests. And I asked you a question, “How can you make your server handle more than one request at a time?” In this article you will find the answer. So, buckle up and shift into high gear. You’re about to have a really fast ride. Have your Linux, Mac OS X (or any *nix system) and Python ready. All source code from the article is available on [GitHub][1]. + +First let’s remember what a very basic Web server looks like and what the server needs to do to service client requests. The server you created in Part 1 and Part 2 is an iterative server that handles one client request at a time. It cannot accept a new connection until after it has finished processing a current client request. Some clients might be unhappy with it because they will have to wait in line, and for busy servers the line might be too long. + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part3_it1.png) + +Here is the code of the iterative server [webserver3a.py][2]: + +``` +##################################################################### +# Iterative server - webserver3a.py # +# # +# Tested with Python 2.7.9 & Python 3.4 on Ubuntu 14.04 & Mac OS X # +##################################################################### +import socket + +SERVER_ADDRESS = (HOST, PORT) = '', 8888 +REQUEST_QUEUE_SIZE = 5 + + +def handle_request(client_connection): + request = client_connection.recv(1024) + print(request.decode()) + http_response = b"""\ +HTTP/1.1 200 OK + +Hello, World! +""" + client_connection.sendall(http_response) + + +def serve_forever(): + listen_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + listen_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + listen_socket.bind(SERVER_ADDRESS) + listen_socket.listen(REQUEST_QUEUE_SIZE) + print('Serving HTTP on port {port} ...'.format(port=PORT)) + + while True: + client_connection, client_address = listen_socket.accept() + handle_request(client_connection) + client_connection.close() + +if __name__ == '__main__': + serve_forever() +``` + +To observe your server handling only one client request at a time, modify the server a little bit and add a 60 second delay after sending a response to a client. The change is only one line to tell the server process to sleep for 60 seconds. + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part3_it2.png) + +And here is the code of the sleeping server [webserver3b.py][3]: + +``` +######################################################################### +# Iterative server - webserver3b.py # +# # +# Tested with Python 2.7.9 & Python 3.4 on Ubuntu 14.04 & Mac OS X # +# # +# - Server sleeps for 60 seconds after sending a response to a client # +######################################################################### +import socket +import time + +SERVER_ADDRESS = (HOST, PORT) = '', 8888 +REQUEST_QUEUE_SIZE = 5 + + +def handle_request(client_connection): + request = client_connection.recv(1024) + print(request.decode()) + http_response = b"""\ +HTTP/1.1 200 OK + +Hello, World! +""" + client_connection.sendall(http_response) + time.sleep(60) # sleep and block the process for 60 seconds + + +def serve_forever(): + listen_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + listen_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + listen_socket.bind(SERVER_ADDRESS) + listen_socket.listen(REQUEST_QUEUE_SIZE) + print('Serving HTTP on port {port} ...'.format(port=PORT)) + + while True: + client_connection, client_address = listen_socket.accept() + handle_request(client_connection) + client_connection.close() + +if __name__ == '__main__': + serve_forever() +``` + +Start the server with: + +``` +$ python webserver3b.py +``` + +Now open up a new terminal window and run the curl command. You should instantly see the “Hello, World!” string printed on the screen: + +``` +$ curl http://localhost:8888/hello +Hello, World! +``` + +And without delay open up a second terminal window and run the same curl command: + + +``` +$ curl http://localhost:8888/hello +``` + +If you’ve done that within 60 seconds then the second curl should not produce any output right away and should just hang there. The server shouldn’t print a new request body on its standard output either. Here is how it looks like on my Mac (the window at the bottom right corner highlighted in yellow shows the second curl command hanging, waiting for the connection to be accepted by the server): + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part3_it3.png) + +After you’ve waited long enough (more than 60 seconds) you should see the first curl terminate and the second curl print “Hello, World!” on the screen, then hang for 60 seconds, and then terminate: + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part3_it4.png) + +The way it works is that the server finishes servicing the first curl client request and then it starts handling the second request only after it sleeps for 60 seconds. It all happens sequentially, or iteratively, one step, or in our case one client request, at a time. + +Let’s talk about the communication between clients and servers for a bit. In order for two programs to communicate with each other over a network, they have to use sockets. And you saw sockets both in Part 1 and Part 2. But what is a socket? + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part3_it_socket.png) + +A socket is an abstraction of a communication endpoint and it allows your program to communicate with another program using file descriptors. In this article I’ll be talking specifically about TCP/IP sockets on Linux/Mac OS X. An important notion to understand is the TCP socket pair. + +>The socket pair for a TCP connection is a 4-tuple that identifies two endpoints of the TCP connection: the local IP address, local port, foreign IP address, and foreign port. A socket pair uniquely identifies every TCP connection on a network. The two values that identify each endpoint, an IP address and a port number, are often called a socket.[1 +][4] + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part3_it_socketpair.png) + +So, the tuple {10.10.10.2:49152, 12.12.12.3:8888} is a socket pair that uniquely identifies two endpoints of the TCP connection on the client and the tuple {12.12.12.3:8888, 10.10.10.2:49152} is a socket pair that uniquely identifies the same two endpoints of the TCP connection on the server. The two values that identify the server endpoint of the TCP connection, the IP address 12.12.12.3 and the port 8888, are referred to as a socket in this case (the same applies to the client endpoint). + +The standard sequence a server usually goes through to create a socket and start accepting client connections is the following: + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part3_it_server_socket_sequence.png) + +1. The server creates a TCP/IP socket. This is done with the following statement in Python: + +``` +listen_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +``` + +2. The server might set some socket options (this is optional, but you can see that the server code above does just that to be able to re-use the same address over and over again if you decide to kill and re-start the server right away). + +``` +listen_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) +``` + +3. Then, the server binds the address. The bind function assigns a local protocol address to the socket. With TCP, calling bind lets you specify a port number, an IP address, both, or neither.[1][4] + +``` +listen_socket.bind(SERVER_ADDRESS) +``` + +4. Then, the server makes the socket a listening socket + +``` +listen_socket.listen(REQUEST_QUEUE_SIZE) +``` + +The listen method is only called by servers. It tells the kernel that it should accept incoming connection requests for this socket. + +After that’s done, the server starts accepting client connections one connection at a time in a loop. When there is a connection available the accept call returns the connected client socket. Then, the server reads the request data from the connected client socket, prints the data on its standard output and sends a message back to the client. Then, the server closes the client connection and it is ready again to accept a new client connection. + +Here is what a client needs to do to communicate with the server over TCP/IP: + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part3_it_client_socket_sequence.png) + +Here is the sample code for a client to connect to your server, send a request and print the response: + +``` +import socket + + # create a socket and connect to a server + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + sock.connect(('localhost', 8888)) + + # send and receive some data + sock.sendall(b'test') + data = sock.recv(1024) + print(data.decode()) +``` + +After creating the socket, the client needs to connect to the server. This is done with the connect call: + +``` +sock.connect(('localhost', 8888)) +``` + +The client only needs to provide the remote IP address or host name and the remote port number of a server to connect to. + +You’ve probably noticed that the client doesn’t call bind and accept. The client doesn’t need to call bind because the client doesn’t care about the local IP address and the local port number. The TCP/IP stack within the kernel automatically assigns the local IP address and the local port when the client calls connect. The local port is called an ephemeral port, i.e. a short-lived port. + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part3_it_ephemeral_port.png) + +A port on a server that identifies a well-known service that a client connects to is called a well-known port (for example, 80 for HTTP and 22 for SSH). Fire up your Python shell and make a client connection to the server you run on localhost and see what ephemeral port the kernel assigns to the socket you’ve created (start the server webserver3a.py or webserver3b.py before trying the following example): + +``` +>>> import socket +>>> sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +>>> sock.connect(('localhost', 8888)) +>>> host, port = sock.getsockname()[:2] +>>> host, port +('127.0.0.1', 60589) +``` + +In the case above the kernel assigned the ephemeral port 60589 to the socket. + +There are some other important concepts that I need to cover quickly before I get to answer the question from Part 2. You will see shortly why this is important. The two concepts are that of a process and a file descriptor. + +What is a process? A process is just an instance of an executing program. When the server code is executed, for example, it’s loaded into memory and an instance of that executing program is called a process. The kernel records a bunch of information about the process - its process ID would be one example - to keep track of it. When you run your iterative server webserver3a.py or webserver3b.py you run just one process. + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part3_it_server_process.png) + +Start the server webserver3b.py in a terminal window: + +``` +$ python webserver3b.py +``` + +And in a different terminal window use the ps command to get the information about that process: + +``` +$ ps | grep webserver3b | grep -v grep +7182 ttys003 0:00.04 python webserver3b.py +``` + +The ps command shows you that you have indeed run just one Python process webserver3b. When a process gets created the kernel assigns a process ID to it, PID. In UNIX, every user process also has a parent that, in turn, has its own process ID called parent process ID, or PPID for short. I assume that you run a BASH shell by default and when you start the server, a new process gets created with a PID and its parent PID is set to the PID of the BASH shell. + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part3_it_ppid_pid.png) + +Try it out and see for yourself how it all works. Fire up your Python shell again, which will create a new process, and then get the PID of the Python shell process and the parent PID (the PID of your BASH shell) using os.getpid() and os.getppid() system calls. Then, in another terminal window run ps command and grep for the PPID (parent process ID, which in my case is 3148). In the screenshot below you can see an example of a parent-child relationship between my child Python shell process and the parent BASH shell process on my Mac OS X: + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part3_it_pid_ppid_screenshot.png) + +Another important concept to know is that of a file descriptor. So what is a file descriptor? A file descriptor is a non-negative integer that the kernel returns to a process when it opens an existing file, creates a new file or when it creates a new socket. You’ve probably heard that in UNIX everything is a file. The kernel refers to the open files of a process by a file descriptor. When you need to read or write a file you identify it with the file descriptor. Python gives you high-level objects to deal with files (and sockets) and you don’t have to use file descriptors directly to identify a file but, under the hood, that’s how files and sockets are identified in UNIX: by their integer file descriptors. + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part3_it_process_descriptors.png) + +By default, UNIX shells assign file descriptor 0 to the standard input of a process, file descriptor 1 to the standard output of the process and file descriptor 2 to the standard error. + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part3_it_default_descriptors.png) + +As I mentioned before, even though Python gives you a high-level file or file-like object to work with, you can always use the fileno() method on the object to get the file descriptor associated with the file. Back to your Python shell to see how you can do that: + + +``` +>>> import sys +>>> sys.stdin +', mode 'r' at 0x102beb0c0> +>>> sys.stdin.fileno() +0 +>>> sys.stdout.fileno() +1 +>>> sys.stderr.fileno() +2 +``` + +And while working with files and sockets in Python, you’ll usually be using a high-level file/socket object, but there may be times where you need to use a file descriptor directly. Here is an example of how you can write a string to the standard output using a write system call that takes a file descriptor integer as a parameter: + +``` +>>> import sys +>>> import os +>>> res = os.write(sys.stdout.fileno(), 'hello\n') +hello +``` + +And here is an interesting part - which should not be surprising to you anymore because you already know that everything is a file in Unix - your socket also has a file descriptor associated with it. Again, when you create a socket in Python you get back an object and not a non-negative integer, but you can always get direct access to the integer file descriptor of the socket with the fileno() method that I mentioned earlier. + +``` +>>> import socket +>>> sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +>>> sock.fileno() +3 +``` +One more thing I wanted to mention: have you noticed that in the second example of the iterative server webserver3b.py, when the server process was sleeping for 60 seconds you could still connect to the server with the second curl command? Sure, the curl didn’t output anything right away and it was just hanging out there but how come the server was not accept ing a connection at the time and the client was not rejected right away, but instead was able to connect to the server? The answer to that is the listen method of a socket object and its BACKLOG argument, which I called REQUEST_QUEUE_SIZE in the code. The BACKLOG argument determines the size of a queue within the kernel for incoming connection requests. When the server webserver3b.py was sleeping, the second curl command that you ran was able to connect to the server because the kernel had enough space available in the incoming connection request queue for the server socket. + +While increasing the BACKLOG argument does not magically turn your server into a server that can handle multiple client requests at a time, it is important to have a fairly large backlog parameter for busy servers so that the accept call would not have to wait for a new connection to be established but could grab the new connection off the queue right away and start processing a client request without delay. + +Whoo-hoo! You’ve covered a lot of ground. Let’s quickly recap what you’ve learned (or refreshed if it’s all basics to you) so far. + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part3_checkpoint.png) + +- Iterative server +- Server socket creation sequence (socket, bind, listen, accept) +- Client connection creation sequence (socket, connect) +- Socket pair +- Socket +- Ephemeral port and well-known port +- Process +- Process ID (PID), parent process ID (PPID), and the parent-child relationship. +- File descriptors +- The meaning of the BACKLOG argument of the listen socket method + +Now I am ready to answer the question from Part 2: “How can you make your server handle more than one request at a time?” Or put another way, “How do you write a concurrent server?” + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part3_conc2_service_clients.png) + +The simplest way to write a concurrent server under Unix is to use a fork() system call. + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part3_fork.png) + +Here is the code of your new shiny concurrent server webserver3c.py that can handle multiple client requests at the same time (as in our iterative server example webserver3b.py, every child process sleeps for 60 secs): + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part3_it2.png) + +``` +########################################################################### +# Concurrent server - webserver3c.py # +# # +# Tested with Python 2.7.9 & Python 3.4 on Ubuntu 14.04 & Mac OS X # +# # +# - Child process sleeps for 60 seconds after handling a client's request # +# - Parent and child processes close duplicate descriptors # +# # +########################################################################### +import os +import socket +import time + +SERVER_ADDRESS = (HOST, PORT) = '', 8888 +REQUEST_QUEUE_SIZE = 5 + + +def handle_request(client_connection): + request = client_connection.recv(1024) + print( + 'Child PID: {pid}. Parent PID {ppid}'.format( + pid=os.getpid(), + ppid=os.getppid(), + ) + ) + print(request.decode()) + http_response = b"""\ +HTTP/1.1 200 OK + +Hello, World! +""" + client_connection.sendall(http_response) + time.sleep(60) + + +def serve_forever(): + listen_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + listen_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + listen_socket.bind(SERVER_ADDRESS) + listen_socket.listen(REQUEST_QUEUE_SIZE) + print('Serving HTTP on port {port} ...'.format(port=PORT)) + print('Parent PID (PPID): {pid}\n'.format(pid=os.getpid())) + + while True: + client_connection, client_address = listen_socket.accept() + pid = os.fork() + if pid == 0: # child + listen_socket.close() # close child copy + handle_request(client_connection) + client_connection.close() + os._exit(0) # child exits here + else: # parent + client_connection.close() # close parent copy and loop over + +if __name__ == '__main__': + serve_forever() +``` + +Before diving in and discussing how fork works, try it, and see for yourself that the server can indeed handle multiple client requests at the same time, unlike its iterative counterparts webserver3a.py and webserver3b.py. Start the server on the command line with: + +``` +$ python webserver3c.py +``` + +And try the same two curl commands you’ve tried before with the iterative server and see for yourself that, now, even though the server child process sleeps for 60 seconds after serving a client request, it doesn’t affect other clients because they are served by different and completely independent processes. You should see your curl commands output “Hello, World!” instantly and then hang for 60 secs. You can keep on running as many curl commands as you want (well, almost as many as you want :) and all of them will output the server’s response “Hello, World” immediately and without any noticeable delay. Try it. + +The most important point to understand about fork() is that you call fork once but it returns twice: once in the parent process and once in the child process. When you fork a new process the process ID returned to the child process is 0. When the fork returns in the parent process it returns the child’s PID. + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part3_conc2_how_fork_works.png) + +I still remember how fascinated I was by fork when I first read about it and tried it. It looked like magic to me. Here I was reading a sequential code and then “boom!”: the code cloned itself and now there were two instances of the same code running concurrently. I thought it was nothing short of magic, seriously. + +When a parent forks a new child, the child process gets a copy of the parent’s file descriptors: + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part3_conc2_shared_descriptors.png) + +You’ve probably noticed that the parent process in the code above closed the client connection: + +``` +else: # parent + client_connection.close() # close parent copy and loop over +``` + +So how come a child process is still able to read the data from a client socket if its parent closed the very same socket? The answer is in the picture above. The kernel uses descriptor reference counts to decide whether to close a socket or not. It closes the socket only when its descriptor reference count becomes 0. When your server creates a child process, the child gets the copy of the parent’s file descriptors and the kernel increments the reference counts for those descriptors. In the case of one parent and one child, the descriptor reference count would be 2 for the client socket and when the parent process in the code above closes the client connection socket, it merely decrements its reference count which becomes 1, not small enough to cause the kernel to close the socket. The child process also closes the duplicate copy of the parent’s listen_socket because the child doesn’t care about accepting new client connections, it cares only about processing requests from the established client connection: + +``` +listen_socket.close() # close child copy +``` + +I’ll talk about what happens if you do not close duplicate descriptors later in the article. + +As you can see from the source code of your concurrent server, the sole role of the server parent process now is to accept a new client connection, fork a new child process to handle that client request, and loop over to accept another client connection, and nothing more. The server parent process does not process client requests - its children do. + +A little aside. What does it mean when we say that two events are concurrent? + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part3_conc2_concurrent_events.png) + +When we say that two events are concurrent we usually mean that they happen at the same time. As a shorthand that definition is fine, but you should remember the strict definition: + +>Two events are concurrent if you cannot tell by looking at the program which will happen first.[2][5] + +Again, it’s time to recap the main ideas and concepts you’ve covered so far. + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part3_checkpoint.png) + +- The simplest way to write a concurrent server in Unix is to - use the fork() system call +- When a process forks a new process it becomes a parent process to that newly forked child process. +- Parent and child share the same file descriptors after the call to fork. +- The kernel uses descriptor reference counts to decide whether to close the file/socket or not +- The role of a server parent process: all it does now is accept a new connection from a client, fork a child to handle the client request, and loop over to accept a new client connection. + +Let’s see what is going to happen if you don’t close duplicate socket descriptors in the parent and child processes. Here is a modified version of the concurrent server where the server does not close duplicate descriptors, webserver3d.py: + +``` +########################################################################### +# Concurrent server - webserver3d.py # +# # +# Tested with Python 2.7.9 & Python 3.4 on Ubuntu 14.04 & Mac OS X # +########################################################################### +import os +import socket + +SERVER_ADDRESS = (HOST, PORT) = '', 8888 +REQUEST_QUEUE_SIZE = 5 + + +def handle_request(client_connection): + request = client_connection.recv(1024) + http_response = b"""\ +HTTP/1.1 200 OK + +Hello, World! +""" + client_connection.sendall(http_response) + + +def serve_forever(): + listen_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + listen_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + listen_socket.bind(SERVER_ADDRESS) + listen_socket.listen(REQUEST_QUEUE_SIZE) + print('Serving HTTP on port {port} ...'.format(port=PORT)) + + clients = [] + while True: + client_connection, client_address = listen_socket.accept() + # store the reference otherwise it's garbage collected + # on the next loop run + clients.append(client_connection) + pid = os.fork() + if pid == 0: # child + listen_socket.close() # close child copy + handle_request(client_connection) + client_connection.close() + os._exit(0) # child exits here + else: # parent + # client_connection.close() + print(len(clients)) + +if __name__ == '__main__': + serve_forever() +``` + +Start the server with: + +``` +$ python webserver3d.py +``` + +Use curl to connect to the server: + +``` +$ curl http://localhost:8888/hello +Hello, World! +``` + +Okay, the curl printed the response from the concurrent server but it did not terminate and kept hanging. What is happening here? The server no longer sleeps for 60 seconds: its child process actively handles a client request, closes the client connection and exits, but the client curl still does not terminate. + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part3_conc3_child_is_active.png) + +So why does the curl not terminate? The reason is the duplicate file descriptors. When the child process closed the client connection, the kernel decremented the reference count of that client socket and the count became 1. The server child process exited, but the client socket was not closed by the kernel because the reference count for that socket descriptor was not 0, and, as a result, the termination packet (called FIN in TCP/IP parlance) was not sent to the client and the client stayed on the line, so to speak. There is also another problem. If your long-running server doesn’t close duplicate file descriptors, it will eventually run out of available file descriptors: + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part3_conc3_out_of_descriptors.png) + +Stop your server webserver3d.py with Control-C and check out the default resources available to your server process set up by your shell with the shell built-in command ulimit: + +``` +$ ulimit -a +core file size (blocks, -c) 0 +data seg size (kbytes, -d) unlimited +scheduling priority (-e) 0 +file size (blocks, -f) unlimited +pending signals (-i) 3842 +max locked memory (kbytes, -l) 64 +max memory size (kbytes, -m) unlimited +open files (-n) 1024 +pipe size (512 bytes, -p) 8 +POSIX message queues (bytes, -q) 819200 +real-time priority (-r) 0 +stack size (kbytes, -s) 8192 +cpu time (seconds, -t) unlimited +max user processes (-u) 3842 +virtual memory (kbytes, -v) unlimited +file locks (-x) unlimited +``` + +As you can see above, the maximum number of open file descriptors (open files) available to the server process on my Ubuntu box is 1024. + +Now let’s see how your server can run out of available file descriptors if it doesn’t close duplicate descriptors. In an existing or new terminal window, set the maximum number of open file descriptors for your server to be 256: + +``` +$ ulimit -n 256 +``` + +Start the server webserver3d.py in the same terminal where you’ve just run the $ ulimit -n 256 command: + +``` +$ python webserver3d.py +``` + +and use the following client client3.py to test the server. + +``` +##################################################################### +# Test client - client3.py # +# # +# Tested with Python 2.7.9 & Python 3.4 on Ubuntu 14.04 & Mac OS X # +##################################################################### +import argparse +import errno +import os +import socket + + +SERVER_ADDRESS = 'localhost', 8888 +REQUEST = b"""\ +GET /hello HTTP/1.1 +Host: localhost:8888 + +""" + + +def main(max_clients, max_conns): + socks = [] + for client_num in range(max_clients): + pid = os.fork() + if pid == 0: + for connection_num in range(max_conns): + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + sock.connect(SERVER_ADDRESS) + sock.sendall(REQUEST) + socks.append(sock) + print(connection_num) + os._exit(0) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser( + description='Test client for LSBAWS.', + formatter_class=argparse.ArgumentDefaultsHelpFormatter, + ) + parser.add_argument( + '--max-conns', + type=int, + default=1024, + help='Maximum number of connections per client.' + ) + parser.add_argument( + '--max-clients', + type=int, + default=1, + help='Maximum number of clients.' + ) + args = parser.parse_args() + main(args.max_clients, args.max_conns) +``` + +In a new terminal window, start the client3.py and tell it to create 300 simultaneous connections to the server: + +``` +$ python client3.py --max-clients=300 +``` + +Soon enough your server will explode. Here is a screenshot of the exception on my box: + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part3_conc3_too_many_fds_exc.png) + +The lesson is clear - your server should close duplicate descriptors. But even if you close duplicate descriptors, you are not out of the woods yet because there is another problem with your server, and that problem is zombies! + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part3_conc3_zombies.png) + +Yes, your server code actually creates zombies. Let’s see how. Start up your server again: + +``` +$ python webserver3d.py +``` + +Run the following curl command in another terminal window: + +``` +$ curl http://localhost:8888/hello +``` + +And now run the ps command to show running Python processes. This the example of ps output on my Ubuntu box: + +``` +$ ps auxw | grep -i python | grep -v grep +vagrant 9099 0.0 1.2 31804 6256 pts/0 S+ 16:33 0:00 python webserver3d.py +vagrant 9102 0.0 0.0 0 0 pts/0 Z+ 16:33 0:00 [python] +``` + +Do you see the second line above where it says the status of the process with PID 9102 is Z+ and the name of the process is ? That’s our zombie there. The problem with zombies is that you can’t kill them. + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part3_conc3_kill_zombie.png) + +Even if you try to kill zombies with $ kill -9 , they will survive. Try it and see for yourself. + +What is a zombie anyway and why does our server create them? A zombie is a process that has terminated, but its parent has not waited for it and has not received its termination status yet. When a child process exits before its parent, the kernel turns the child process into a zombie and stores some information about the process for its parent process to retrieve later. The information stored is usually the process ID, the process termination status, and the resource usage by the process. Okay, so zombies serve a purpose, but if your server doesn’t take care of these zombies your system will get clogged up. Let’s see how that happens. First stop your running server and, in a new terminal window, use the ulimit command to set the max user processess to 400(make sure to set open files to a high number, let’s say 500 too): + +``` +$ ulimit -u 400 +$ ulimit -n 500 +``` + +Start the server webserver3d.py in the same terminal where you’ve just run the $ ulimit -u 400 command: + +``` +$ python webserver3d.py +``` + +In a new terminal window, start the client3.py and tell it to create 500 simultaneous connections to the server: + +``` +$ python client3.py --max-clients=500 +``` + +And, again, soon enough your server will blow up with an OSError: Resource temporarily unavailable exception when it tries to create a new child process, but it can’t because it has reached the limit for the maximum number of child processes it’s allowed to create. Here is a screenshot of the exception on my box: + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part3_conc3_resource_unavailable.png) + +As you can see, zombies create problems for your long-running server if it doesn’t take care of them. I will discuss shortly how the server should deal with that zombie problem. + +Let’s recap the main points you’ve covered so far: + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part3_checkpoint.png) + +- If you don’t close duplicate descriptors, the clients won’t terminate because the client connections won’t get closed. +- If you don’t close duplicate descriptors, your long-running server will eventually run out of available file descriptors (max open files). +- When you fork a child process and it exits and the parent process doesn’t wait for it and doesn’t collect its termination status, it becomes a zombie. +- Zombies need to eat something and, in our case, it’s memory. Your server will eventually run out of available processes (max user processes) if it doesn’t take care of zombies. +- You can’t kill a zombie, you need to wait for it. + +So what do you need to do to take care of zombies? You need to modify your server code to wait for zombies to get their termination status. You can do that by modifying your server to call a wait system call. Unfortunately, that’s far from ideal because if you call wait and there is no terminated child process the call to wait will block your server, effectively preventing your server from handling new client connection requests. Are there any other options? Yes, there are, and one of them is the combination of a signal handler with the wait system call. + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part3_conc4_signaling.png) + +Here is how it works. When a child process exits, the kernel sends a SIGCHLD signal. The parent process can set up a signal handler to be asynchronously notified of that SIGCHLD event and then it can wait for the child to collect its termination status, thus preventing the zombie process from being left around. + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part_conc4_sigchld_async.png) + +By the way, an asynchronous event means that the parent process doesn’t know ahead of time that the event is going to happen. + +Modify your server code to set up a SIGCHLD event handler and wait for a terminated child in the event handler. The code is available in webserver3e.py file: + +``` +########################################################################### +# Concurrent server - webserver3e.py # +# # +# Tested with Python 2.7.9 & Python 3.4 on Ubuntu 14.04 & Mac OS X # +########################################################################### +import os +import signal +import socket +import time + +SERVER_ADDRESS = (HOST, PORT) = '', 8888 +REQUEST_QUEUE_SIZE = 5 + + +def grim_reaper(signum, frame): + pid, status = os.wait() + print( + 'Child {pid} terminated with status {status}' + '\n'.format(pid=pid, status=status) + ) + + +def handle_request(client_connection): + request = client_connection.recv(1024) + print(request.decode()) + http_response = b"""\ +HTTP/1.1 200 OK + +Hello, World! +""" + client_connection.sendall(http_response) + # sleep to allow the parent to loop over to 'accept' and block there + time.sleep(3) + + +def serve_forever(): + listen_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + listen_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + listen_socket.bind(SERVER_ADDRESS) + listen_socket.listen(REQUEST_QUEUE_SIZE) + print('Serving HTTP on port {port} ...'.format(port=PORT)) + + signal.signal(signal.SIGCHLD, grim_reaper) + + while True: + client_connection, client_address = listen_socket.accept() + pid = os.fork() + if pid == 0: # child + listen_socket.close() # close child copy + handle_request(client_connection) + client_connection.close() + os._exit(0) + else: # parent + client_connection.close() + +if __name__ == '__main__': + serve_forever() +``` + +Start the server: + +``` +$ python webserver3e.py +``` + +Use your old friend curl to send a request to the modified concurrent server: + +``` +$ curl http://localhost:8888/hello +``` + +Look at the server: + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part3_conc4_eintr.png) + +What just happened? The call to accept failed with the error EINTR. + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part3_conc4_eintr_error.png) + +The parent process was blocked in accept call when the child process exited which caused SIGCHLD event, which in turn activated the signal handler and when the signal handler finished the accept system call got interrupted: + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part3_conc4_eintr_accept.png) + +Don’t worry, it’s a pretty simple problem to solve, though. All you need to do is to re-start the accept system call. Here is the modified version of the server webserver3f.py that handles that problem: + + +``` +########################################################################### +# Concurrent server - webserver3f.py # +# # +# Tested with Python 2.7.9 & Python 3.4 on Ubuntu 14.04 & Mac OS X # +########################################################################### +import errno +import os +import signal +import socket + +SERVER_ADDRESS = (HOST, PORT) = '', 8888 +REQUEST_QUEUE_SIZE = 1024 + + +def grim_reaper(signum, frame): + pid, status = os.wait() + + +def handle_request(client_connection): + request = client_connection.recv(1024) + print(request.decode()) + http_response = b"""\ +HTTP/1.1 200 OK + +Hello, World! +""" + client_connection.sendall(http_response) + + +def serve_forever(): + listen_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + listen_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + listen_socket.bind(SERVER_ADDRESS) + listen_socket.listen(REQUEST_QUEUE_SIZE) + print('Serving HTTP on port {port} ...'.format(port=PORT)) + + signal.signal(signal.SIGCHLD, grim_reaper) + + while True: + try: + client_connection, client_address = listen_socket.accept() + except IOError as e: + code, msg = e.args + # restart 'accept' if it was interrupted + if code == errno.EINTR: + continue + else: + raise + + pid = os.fork() + if pid == 0: # child + listen_socket.close() # close child copy + handle_request(client_connection) + client_connection.close() + os._exit(0) + else: # parent + client_connection.close() # close parent copy and loop over + + +if __name__ == '__main__': + serve_forever() +``` + +Start the updated server webserver3f.py: + +``` +$ python webserver3f.py +``` + +Use curl to send a request to the modified concurrent server: + +``` +$ curl http://localhost:8888/hello +``` + +See? No EINTR exceptions any more. Now, verify that there are no more zombies either and that your SIGCHLD event handler with wait call took care of terminated children. To do that, just run the ps command and see for yourself that there are no more Python processes with Z+ status (no more processes). Great! It feels safe without zombies running around. + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part3_checkpoint.png) + +- If you fork a child and don’t wait for it, it becomes a zombie. +- Use the SIGCHLD event handler to asynchronously wait for a terminated child to get its termination status +- When using an event handler you need to keep in mind that system calls might get interrupted and you need to be prepared for that scenario + +Okay, so far so good. No problems, right? Well, almost. Try your webserver3f.py again, but instead of making one request with curl use client3.py to create 128 simultaneous connections: + +``` +$ python client3.py --max-clients 128 +``` + +Now run the ps command again + +``` +$ ps auxw | grep -i python | grep -v grep +``` + +and see that, oh boy, zombies are back again! + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part3_conc5_zombies_again.png) + +What went wrong this time? When you ran 128 simultaneous clients and established 128 connections, the child processes on the server handled the requests and exited almost at the same time causing a flood of SIGCHLD signals being sent to the parent process. The problem is that the signals are not queued and your server process missed several signals, which left several zombies running around unattended: + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part3_conc5_signals_not_queued.png) + +The solution to the problem is to set up a SIGCHLD event handler but instead of wait use a waitpid system call with a WNOHANG option in a loop to make sure that all terminated child processes are taken care of. Here is the modified server code, webserver3g.py: + +``` +########################################################################### +# Concurrent server - webserver3g.py # +# # +# Tested with Python 2.7.9 & Python 3.4 on Ubuntu 14.04 & Mac OS X # +########################################################################### +import errno +import os +import signal +import socket + +SERVER_ADDRESS = (HOST, PORT) = '', 8888 +REQUEST_QUEUE_SIZE = 1024 + + +def grim_reaper(signum, frame): + while True: + try: + pid, status = os.waitpid( + -1, # Wait for any child process + os.WNOHANG # Do not block and return EWOULDBLOCK error + ) + except OSError: + return + + if pid == 0: # no more zombies + return + + +def handle_request(client_connection): + request = client_connection.recv(1024) + print(request.decode()) + http_response = b"""\ +HTTP/1.1 200 OK + +Hello, World! +""" + client_connection.sendall(http_response) + + +def serve_forever(): + listen_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + listen_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + listen_socket.bind(SERVER_ADDRESS) + listen_socket.listen(REQUEST_QUEUE_SIZE) + print('Serving HTTP on port {port} ...'.format(port=PORT)) + + signal.signal(signal.SIGCHLD, grim_reaper) + + while True: + try: + client_connection, client_address = listen_socket.accept() + except IOError as e: + code, msg = e.args + # restart 'accept' if it was interrupted + if code == errno.EINTR: + continue + else: + raise + + pid = os.fork() + if pid == 0: # child + listen_socket.close() # close child copy + handle_request(client_connection) + client_connection.close() + os._exit(0) + else: # parent + client_connection.close() # close parent copy and loop over + +if __name__ == '__main__': + serve_forever() +``` + +Start the server: + +``` +$ python webserver3g.py +``` + +Use the test client client3.py: + +``` +$ python client3.py --max-clients 128 +``` + +And now verify that there are no more zombies. Yay! Life is good without zombies :) + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part3_conc5_no_zombies.png) + +Congratulations! It’s been a pretty long journey but I hope you liked it. Now you have your own simple concurrent server and the code can serve as a foundation for your further work towards a production grade Web server. + +I’ll leave it as an exercise for you to update the WSGI server from Part 2 and make it concurrent. You can find the modified version here. But look at my code only after you’ve implemented your own version. You have all the necessary information to do that. So go and just do it :) + +What’s next? As Josh Billings said, + +>“Be like a postage stamp — stick to one thing until you get there.” + +Start mastering the basics. Question what you already know. And always dig deeper. + +![](https://ruslanspivak.com/lsbaws-part3/lsbaws_part3_dig_deeper.png) + +>“If you learn only methods, you’ll be tied to your methods. But if you learn principles, you can devise your own methods.” —Ralph Waldo Emerson + +Below is a list of books that I’ve drawn on for most of the material in this article. They will help you broaden and deepen your knowledge about the topics I’ve covered. I highly recommend you to get those books somehow: borrow them from your friends, check them out from your local library, or just buy them on Amazon. They are the keepers: + +1. [Unix Network Programming, Volume 1: The Sockets Networking API (3rd Edition)][6] +2. [Advanced Programming in the UNIX Environment, 3rd Edition][7] +3. [The Linux Programming Interface: A Linux and UNIX System Programming Handbook][8] +4. [TCP/IP Illustrated, Volume 1: The Protocols (2nd Edition) (Addison-Wesley Professional Computing Series)][9] +5. [The Little Book of SEMAPHORES (2nd Edition): The Ins and Outs of Concurrency Control and Common Mistakes][10]. Also available for free on the author’s site [here][11]. + +BTW, I’m writing a book “Let’s Build A Web Server: First Steps” that explains how to write a basic web server from scratch and goes into more detail on the topics I just covered. Subscribe to the mailing list to get the latest updates about the book and the release date. + +-------------------------------------------------------------------------------- + +via: https://ruslanspivak.com/lsbaws-part3/ + +作者:[Ruslan][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://github.com/rspivak/ + +[1]: https://github.com/rspivak/lsbaws/blob/master/part3/ +[2]: https://github.com/rspivak/lsbaws/blob/master/part3/webserver3a.py +[3]: https://github.com/rspivak/lsbaws/blob/master/part3/webserver3b.py +[4]: https://ruslanspivak.com/lsbaws-part3/#fn:1 +[5]: https://ruslanspivak.com/lsbaws-part3/#fn:2 +[6]: http://www.amazon.com/gp/product/0131411551/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0131411551&linkCode=as2&tag=russblo0b-20&linkId=2F4NYRBND566JJQL +[7]: http://www.amazon.com/gp/product/0321637739/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0321637739&linkCode=as2&tag=russblo0b-20&linkId=3ZYAKB537G6TM22J +[8]: http://www.amazon.com/gp/product/1593272200/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1593272200&linkCode=as2&tag=russblo0b-20&linkId=CHFOMNYXN35I2MON +[9]: http://www.amazon.com/gp/product/0321336313/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0321336313&linkCode=as2&tag=russblo0b-20&linkId=K467DRFYMXJ5RWAY +[10]: http://www.amazon.com/gp/product/1441418687/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1441418687&linkCode=as2&tag=russblo0b-20&linkId=QFOAWARN62OWTWUG +[11]: http://greenteapress.com/semaphores/ From 1459084ebe4d7549a0db8426c2ae4b2651716e2a Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 10 Aug 2016 01:36:10 +0800 Subject: [PATCH 1398/1469] PUB:20160531 The Anatomy of a Linux User MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @vim-kakali @PurlingNayuki 尽力了,可能还有不足或谬误的地方吧。 --- .../20160531 The Anatomy of a Linux User.md | 54 ++++++++++++++++++ .../20160531 The Anatomy of a Linux User.md | 56 ------------------- 2 files changed, 54 insertions(+), 56 deletions(-) create mode 100644 published/20160531 The Anatomy of a Linux User.md delete mode 100644 translated/talk/20160531 The Anatomy of a Linux User.md diff --git a/published/20160531 The Anatomy of a Linux User.md b/published/20160531 The Anatomy of a Linux User.md new file mode 100644 index 0000000000..750df665f5 --- /dev/null +++ b/published/20160531 The Anatomy of a Linux User.md @@ -0,0 +1,54 @@ +深入理解 Linux 用戶 +================================ + +**一些新的 GNU/Linux 用户很清楚 Linux 不是 Windows,但其他人对此则不甚了解,而最好的发行版设计者们则会谨记着这两种人的存在。** + +### Linux 的核心 + +不管怎么说,Nicky 看起来都不太引人注目。她已经三十岁了,却决定在离开学校多年后回到学校学习。她在海军待了六年,后来接受了一份老友给她的新工作,想试试这份工作会不会比她在军队的工作更有前途。这种换工作的事情在战后的军事后勤处非常常见。我正是因此而认识的她。她那时是一个八个州的货车运输业中介组织的区域经理,而那会我在达拉斯跑肉品包装工具的运输。 + +![](http://i2.wp.com/fossforce.com/wp-content/uploads/2016/05/anatomy.jpg?w=525) + +Nicky 和我在 2006 年成为了好朋友。她很外向,几乎每一个途经她负责的线路上的人她都乐于接触。我们经常星期五晚上相约去一家室内激光枪战中心打真人 CS。像这样一次就打三个的半小时战役对我们来说并不鲜见。或许这并不像彩弹游戏(LCTT 译注:一种军事游戏,双方以汽枪互射彩色染料弹丸,对方被击中后衣服上会留下彩色印渍即表示“被消灭”——必应词典)一样便宜,但是它很有临场感,还稍微有点恐怖游戏的感觉。某次活动的时候,她问我能否帮她维修电脑。 + +她知道我在为了让一些贫穷的孩子能拥有他们自己的电脑而奔走,当她抱怨她的电脑很慢的时候,我开玩笑地说她可以给比尔盖茨的 401k 计划交钱了(LCTT 译注:401k 计划始于20世纪80年代初,是一种由雇员、雇主共同缴费建立起来的完全基金式的养老保险制度。此处隐喻需要购买新电脑而向比尔盖茨的微软公司付费软件费用。)。Nicky 却说这是了解 Linux 的最佳时间。 + +她的电脑是品牌机,是个带有 Dell 19'' 显示器的 2005 年中款的华硕电脑。不幸的是,这台电脑没有好好照料,上面充斥着所能找到的各种关都关不掉的工具栏和弹窗软件。我们把电脑上的文件都做了备份之后就开始安装 Linux 了。我们一起完成了安装,并且确信她知道了如何分区。不到一个小时,她的电脑上就有了一个“金闪闪”的 PCLinuxOS 桌面。 + +在她操作新系统时,她经常评论这个系统看起来多么漂亮。她并非随口一说;她为眼前光鲜亮丽的桌面着了魔。她说她的桌面漂亮的就像化了“彩妆”一样。这是我在安装系统期间特意设置的,我每次安装 Linux 的时候都会把它打扮的漂漂亮亮的。我希望这些桌面让每个人看起来都觉得漂亮。 + +大概第一周左右,她通过电话和邮件问了我一些常规问题,而最主要的问题还是她想知道如何保存她 OpenOffice 文件才可以让她的同事也可以打开这些文件。教一个人使用 Linux 或者 Open/LibreOffice 的时候最重要的就是教她保存文件。大多数用户在弹出的对话框中直接点了保存,结果就用默认的开放文档格式(Open Document Format)保存了,这让他们吃了不少苦头。 + +曾经有过这么一件事,大约一年前或者更久,一个高中生说他没有通过期末考试,因为教授不能打开包含他的论文的文件。这引来了一些读者的激烈评论,大家都不知道这件事该怪谁,这孩子没错,而他的教授,似乎也没错。 + +我认识的一些大学教授他们每一个人都知道怎么打开 ODF 文件。另外,那个该死的微软在这方面做得真 XX 的不错,我觉得微软 Office 现在已经能打开 ODT 或者 ODF 文件了。不过我也不确定,毕竟我从 2005 年就没用过 Microsoft Office 了。 + +甚至在过去糟糕的日子里,微软公开而悍然地通过产品绑架的方式来在企业桌面领域推行他们的软件时,我和一些微软 Office 的用户在开展业务和洽谈合作时从来没有出现过问题,因为我会提前想到可能出现的问题并且不会有侥幸心理。我会发邮件给他们询问他们正在使用的 Office 版本。这样,我就可以确保以他们能够读写的格式保存文件。 + +说回 Nicky ,她花了很多时间学习她的 Linux 系统。我很惊奇于她的热情。 + +当人们意识到需要抛弃所有的 Windows 的使用习惯和工具的时候,学习 Linux 系统就会很容易。甚至在告诉那些淘气的孩子们如何使用之后,再次回来检查的时候,他们都不会试图把 .exe 文件下载到桌面上或某个下载文件夹。 + +在我们通常讨论这些文件的时候,我们也会提及关于更新的问题。长久以来我一直反对在一台机器上有多个软件安装系统和更新管理软件。以 Mint 来说,它完全禁用了 Synaptic 中的更新功能,这让我失去兴趣。但是即便对于我们这些仍然在使用 dpkg 和 apt 的老家伙们来说,睿智的脑袋也已经开始意识到命令行对新用户来说并不那么温馨而友好。 + +我曾严正抗议并强烈谴责 Synaptic 功能上的削弱,直到它说服了我。你记得什么时候第一次使用的新打造的 Linux 发行版,并拥有了最高管理权限吗? 你记得什么时候对 Synaptic 中列出的大量软件进行过梳理吗?你记得怎样开始安装每个你发现的很酷的程序吗?你记得有多少这样的程序都是以字母"lib"开头的吗? + +我也曾做过那样的事。我安装又弄坏了好几次 Linux,后来我才发现那些库(lib)文件是应用程序的螺母和螺栓,而不是应用程序本身。这就是 Linux Mint 和 Ubuntu 幕后那些聪明的开发者创造了智能、漂亮和易用的应用安装器的原因。Synaptic 仍然是我们这些老玩家爱用的工具,但是对于那些在我们之后才来的新手来说,有太多的方式可以让他们安装库文件和其他类似的包。在新的安装程序中,这些文件的显示会被折叠起来,不会展示给用户。真的,这才是它应该做的。 + +除非你要准备好了打很多支持电话。 + +现在的 Linux 发行版中藏了很多智慧的结晶,我也很感谢这些开发者们,因为他们,我的工作变得更容易。不是每一个 Linux 新用户都像 Nicky 这样富有学习能力和热情。她对我来说就是一个“装好就行”的项目,只需要为她解答一些问题,其它的她会自己研究解决。像她这样极具学习能力和热情的用户的毕竟是少数。这样的 Linux 新人任何时候都是珍稀物种。 + +很不错,他们都是要教自己的孩子使用 Linux 的人。 + +-------------------------------------------------------------------------------- + +via: http://fossforce.com/2016/05/anatomy-linux-user/ + +作者:[Ken Starks][a] +译者:[vim-kakali](https://github.com/vim-kakali) +校对:[PurlingNayuki](https://github.com/PurlingNayuki), [wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://linuxlock.blogspot.com/ diff --git a/translated/talk/20160531 The Anatomy of a Linux User.md b/translated/talk/20160531 The Anatomy of a Linux User.md deleted file mode 100644 index 99e3f0acc5..0000000000 --- a/translated/talk/20160531 The Anatomy of a Linux User.md +++ /dev/null @@ -1,56 +0,0 @@ -深入理解 Linux 用戶 -================================ - - - -**一些新的 GNU/Linux 用户都很清楚地知道 Linux 不是 Windows。但其他人对此都不甚了解。最好的发行版设计者努力保持新的思想。** - -### Linux 的核心 - -不管怎么说,Nicky 看起来都不引人注目。她已经三十岁了,却决定回到学校学习。她在海军待了 6 年,后来接受了一份老友给她的新工作,她认为这份工作比她在军队的工作更有前途。认定其他工作更有前途而换工作的事情在战后的军事后勤处非常常见。我正是因此而认识的她。她那时是一个有 8 个州参与的的货车运输业协商组织的区域经理。那会我在达拉斯跑肉品包装工具的运输。 -![](http://i2.wp.com/fossforce.com/wp-content/uploads/2016/05/anatomy.jpg?w=525) - - -Nicky 和我在 2006 年成为了好朋友。她很外向,对所有她跑过的线路的拥有者。我们经常星期五晚上我们相约去一家室内激光枪战中心打真人 CS。像这样连续激战半个小时对我们来说并不罕见。或许这并不像彩弹游戏[译注:一种军事游戏,双方以汽枪互射彩色染料弹丸,对方被击中后衣服上会留下彩色印渍即表示“被消灭”(必应词典)]一样便宜,但是气氛还是可以控制得住的,而且令人感觉比较恐怖。某次活动的时候,她问我能否帮她维修电脑。 - -她知道我为了一些贫穷的孩子能拥有他们自己的电脑做出的努力,当她抱怨她的电脑很慢的时候,我开玩笑地提到了参加比尔盖茨的 401k 计划[译注:这个计划是为那些为内部收益代码做过贡献的人们提供由税收定义的养老金账户。]。Nicky 说这是了解 Linux 的最佳时间。 - -她的电脑相当好,它是一个带有 Dell 19'' 显示器的华硕电脑。不幸的是,即使当不需要一些东西的时候,这台 Windows 电脑也会强制性的显示所有的工具条和文本菜单。我们把电脑上的文件都做了备份之后就开始安装 Linux 了。我们一起完成了安装,并且确信她知道了如何分区。不到一个小时,她的电脑上就有了一个漂亮的 PCLinuxOS 桌面。 - -在她操作新系统时,她经常评论这个系统看起来多么漂亮。她并非随口一说;她为眼前光鲜亮丽的桌面着了魔。她说她的桌面带有漂亮的"微光"[译注:即文字闪光效果,shimmer]。这是我在安装系统期间特意设置的。我每次安装 Linux 的时候都会进行这样的配置。我想让每个 Linux 用户的桌面都拥有这个漂亮的微光。 - -大概第一周左右,她通过电话和邮件问了我一些常规问题,而最主要的问题还是她想知道如何保存她OpenOffice 文件才可以让她的同事也可以读这些文件。教一个人使用 Linux 或者 Open/LibreOffice 的时候最重要的就是教她保存文件。大多数用户直接点了保存,结果就用默认的开放文档格式(Open Document Format)保存了,这让他们吃了不少苦头。 - - -大约一年前或者更久,一个高中生说他没有通过期末考试,因为教授不能打开他上交的 ODF 格式的论文。这引来了一些读者的激烈评论,大家都不知道这件事该怪谁。 - -我知道一些大学教授甚至每个人都能够打开一个 ODF 文件。另外,我想 Microsoft Office 现在已经能打开 ODT 或者 ODF 文件了。不过我也不确定,毕竟我最近一次用 Microsoft Office 是在 2005 年。 - -甚至在过去糟糕的日子里,当 Microsoft 很受欢迎并且很热衷于为使用他们系统的厂商的企业桌面上安装他们自己的软件的时候,我和一些 Microsoft Office 用户的产品生意和合作从来没有出现过问题,因为我会提前想到可能出现的问题并且不会有侥幸心理。我会发邮件给他们询问他们正在使用的 Office 版本。这样,我就可以确保以他们能够读写的格式保存文件。 - -说回 Nicky ,她花了很多时间学习她的 Linux 系统。我很惊奇于她的热情。 - -当人们意识到所有的使用 Windows 的习惯和工具都要被抛弃的时候,学习 Linux 系统也会很容易。甚至在告诉孩子们如何使用之后,他们都不会试图下载和执行 .exe 文件。 - -在我们通常讨论这些文件的时候,我们也会提及关于更新的问题。很长时间我都不会在一台电脑上反复设置去完成多种程序的更新和安装。比如 Mint,它禁用了 Synaptic[译注:一个 Linux 管理图像程序包]的完整(系统)更新功能,这让我失去兴趣。但是即便我们仍然在使用 dpkg 和 apt,睿智的玩家已经开始意识到命令行对新用户来说并不那么温馨而友好。 - -我曾严正抗议并强烈谴责 Synaptic 功能上的削弱。你记得你第一次使用的 Linux 发行版吗?记得你什么时候在 Synaptic 中详细查看大量的软件列表吗?记得你怎样开始标记你发现的每个很酷的程序吗?你记得有多少这样的程序都是以字母"lib"开头的吗? - -我也曾做过那样的事。我安装又弄坏了好次 Linux,后来我才发现那些库(lib)文件是应用程序的螺母和螺栓,而不是应用程序本身。这就是 Linux Mint 和 Ubuntu 幕后那些聪明的开发者创造了智能、漂亮和易于使用的应用程序的安装程序的理由。Synaptic 仍然是我们这些老玩家爱用的工具,但是对于一些新手,Synaptic 中有太多的方式可以让他们安装库文件和其他类似的包,把系统弄乱。在新的安装程序中,这些包会被折叠起来,不会展示给用户。讲真,这也是它应该做的。 - -除非你要改变应该支持的需求。 - -现在的 Linux 发行版中藏了很多智慧的结晶,我也很感谢这些开发者,因为他们,我的工作变得容易。不是每一个 Linux 新用户都像 Nicky 这样富有学习能力和热情。她对我来说就是一个“安装后不管”的项目,只需要为她解答一些问题,其他的她会自己研究解决。像她这样极具学习能力和热情的用户的毕竟是少数。这样的 Linux 新人任何时候都是珍稀物种。 - -很不错,他们都是要教自己的孩子使用 Linux 的人。 --------------------------------------------------------------------------------- - -via: http://fossforce.com/2016/05/anatomy-linux-user/ - -作者:[Ken Starks][a] -译者:[vim-kakali](https://github.com/vim-kakali) -校对:[PurlingNayuki](https://github.com/PurlingNayuki) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://linuxlock.blogspot.com/ From 1804bbae80b1bfd79505b4f33b0db747aa09799b Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 10 Aug 2016 09:39:02 +0800 Subject: [PATCH 1399/1469] PUB:Part 11 - How to Allow Awk to Use Shell Variables @ChrisLeeGit --- ...How to Allow Awk to Use Shell Variables.md | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) rename translated/tech/awk/20160802 Part 11 - How to Allow Awk to Use Shell Variables.md => published/awk/Part 11 - How to Allow Awk to Use Shell Variables.md (81%) diff --git a/translated/tech/awk/20160802 Part 11 - How to Allow Awk to Use Shell Variables.md b/published/awk/Part 11 - How to Allow Awk to Use Shell Variables.md similarity index 81% rename from translated/tech/awk/20160802 Part 11 - How to Allow Awk to Use Shell Variables.md rename to published/awk/Part 11 - How to Allow Awk to Use Shell Variables.md index e4ec78abd4..7caf10ec28 100644 --- a/translated/tech/awk/20160802 Part 11 - How to Allow Awk to Use Shell Variables.md +++ b/published/awk/Part 11 - How to Allow Awk to Use Shell Variables.md @@ -5,21 +5,23 @@ awk 系列:如何让 awk 使用 Shell 变量 我们可以通过在 awk 命令中使用 shell 变量达到目的,在 awk 系列的这一节中,我们将学习如何让 awk 使用 shell 变量,这些变量可能包含我们希望传递给 awk 命令的值。 +![](http://www.tecmint.com/wp-content/uploads/2016/08/Use-Shell-Variables-in-Awk.png) + 有两种可能的方法可以让 awk 使用 shell 变量: ### 1. 使用 Shell 引用 -让我们用一个示例来演示如何在一条 awk 命令中使用 shell 引用替代一个 shell 变量。在该示例中,我们希望在文件 /etc/passwd 中搜索一个用户名,过滤并输出用户的账户信息。 +让我们用一个示例来演示如何在一条 awk 命令中使用 shell 引用来替代一个 shell 变量。在该示例中,我们希望在文件 /etc/passwd 中搜索一个用户名,过滤并输出用户的账户信息。 因此,我们可以编写一个 `test.sh` 脚本,内容如下: ``` #!/bin/bash -# 读取用户名 +### 读取用户名 read -p "请输入用户名:" username -# 在 /etc/passwd 中搜索用户名,然后在屏幕上输出详细信息 +### 在 /etc/passwd 中搜索用户名,然后在屏幕上输出详细信息 cat /etc/passwd | awk "/$username/ "' { print $0 }' ``` @@ -31,7 +33,7 @@ cat /etc/passwd | awk "/$username/ "' { print $0 }' cat /etc/passwd | awk "/$username/ "' { print $0 }' ``` -`"/$username/ "`:在 awk 命令中使用 shell 引用来替代 shell 变量 `username` 的值。`username` 的值就是要在文件 /etc/passwd 中搜索的模式。 +`"/$username/ "`:该 shell 引用用于在 awk 命令中替换 shell 变量 `username` 的值。`username` 的值就是要在文件 /etc/passwd 中搜索的模式。 注意,双引号位于 awk 脚本 `'{ print $0 }'` 之外。 @@ -45,12 +47,14 @@ $ ./text.sh 运行脚本后,它会提示你输入一个用户名,然后你输入一个合法的用户名并回车。你将会看到来自 /etc/passwd 文件中详细的用户账户信息,如下图所示: ![](http://www.tecmint.com/wp-content/uploads/2016/08/Shell-Script-to-Find-Username-in-Passwd-File.png) -> *在 Password 文件中查找用户名的 shell 脚本* + +*在 Password 文件中查找用户名的 shell 脚本* ### 2. 使用 awk 进行变量赋值 和上面介绍的方法相比,该方法更加单,并且更好。考虑上面的示例,我们可以运行一条简单的命令来完成同样的任务。 在该方法中,我们使用 `-v` 选项将一个 shell 变量的值赋给一个 awk 变量。 + 首先,创建一个 shell 变量 `username`,然后给它赋予一个我们希望在 /etc/passwd 文件中搜索的名称。 ``` @@ -63,7 +67,8 @@ username="aaronkilik" ``` ![](http://www.tecmint.com/wp-content/uploads/2016/08/Find-Username-in-Password-File-Using-Awk.png) -> *使用 awk 在 Password 文件中查找用户名* + +*使用 awk 在 Password 文件中查找用户名* 上述命令的说明: @@ -71,7 +76,7 @@ username="aaronkilik" - `username`:是 shell 变量 - `name`:是 awk 变量 -让我们仔细瞧瞧 awk 脚本 `' $0 ~ name {print $0}'` 中的 `$0 ~ name`。还记得么,当我们在 awk 系列第四节中介绍 awk 比较运算符时,`value ~ pattern` 便是比较运算符之一,它是指:如果 `value` 匹配了 `pattern` 则返回 `true`。 +让我们仔细瞧瞧 awk 脚本 `' $0 ~ name {print $0}'` 中的 `$0 ~ name`。还记得么,当我们在 awk 系列第四节中介绍 awk 比较运算符时,`value ~ pattern` 便是比较运算符之一,它是指:如果 `value` 匹配了 `pattern` 则返回 `true`。 cat 命令通过管道传给 awk 的 `output($0)` 与模式 `(aaronkilik)` 匹配,该模式即为我们在 /etc/passwd 中搜索的名称,最后,比较操作返回 `true`。接下来会在屏幕上输出包含用户账户信息的行。 @@ -84,11 +89,11 @@ cat 命令通过管道传给 awk 的 `output($0)` 与模式 `(aaronkilik)` 匹 -------------------------------------------------------------------------------- -via: http://www.tecmint.com/use-shell-script-variable-in-awk/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tecmint+%28Tecmint%3A+Linux+Howto%27s+Guide%29 +via: http://www.tecmint.com/use-shell-script-variable-in-awk/ 作者:[Aaron Kili][a] 译者:[ChrisLeeGit](https://github.com/chrisleegit) -校对:[校对ID](https://github.com/校对ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 18f72540c2b8ae3dd2459c727378e025cefff07f Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 10 Aug 2016 10:32:09 +0800 Subject: [PATCH 1400/1469] =?UTF-8?q?PUB:20160615=20Explanation=20of=20?= =?UTF-8?q?=E2=80=9CEverything=20is=20a=20File=E2=80=9D=20and=20Types=20of?= =?UTF-8?q?=20Files=20in=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @runningwater --- ...ng is a File” and Types of Files in Linux.md | 58 +++++++++---------- 1 file changed, 28 insertions(+), 30 deletions(-) rename {translated/talk => published}/20160615 Explanation of “Everything is a File” and Types of Files in Linux.md (75%) diff --git a/translated/talk/20160615 Explanation of “Everything is a File” and Types of Files in Linux.md b/published/20160615 Explanation of “Everything is a File” and Types of Files in Linux.md similarity index 75% rename from translated/talk/20160615 Explanation of “Everything is a File” and Types of Files in Linux.md rename to published/20160615 Explanation of “Everything is a File” and Types of Files in Linux.md index c9a1b243ff..62379377cd 100755 --- a/translated/talk/20160615 Explanation of “Everything is a File” and Types of Files in Linux.md +++ b/published/20160615 Explanation of “Everything is a File” and Types of Files in Linux.md @@ -2,15 +2,16 @@ ==================================================================== ![](http://www.tecmint.com/wp-content/uploads/2016/05/Everything-is-a-File-in-Linux.png) ->Linux 系统中一切都是文件并有相应的文件类型 + +*Linux 系统中一切都是文件并有相应的文件类型* 在 Unix 和它衍生的比如 Linux 系统中,一切都可以看做文件。虽然它仅仅只是一个泛泛的概念,但这是事实。如果有不是文件的,那它一定是正运行的进程。 -要理解这点,可以举个例子,您的根目录(/) 的空间是由不同类型的 Linux 文件所占据的。当您创建一个文件或向系统传一个文件时,它在物理磁盘上占据的一些空间,可以认为是一个特定的格式(文件类型)。 +要理解这点,可以举个例子,您的根目录(/)的空间充斥着不同类型的 Linux 文件。当您创建一个文件或向系统传输一个文件时,它会在物理磁盘上占据的一些空间,而且是一个特定的格式(文件类型)。 -虽然 Linux 系统中文件和目录没有什么不同,但目录还有一个重要的功能,那就是有结构性的分组存储其它文件,以方便查找访问。所有的硬件部件都表示为文件,系统使用这些文件来与硬件通信。 +虽然 Linux 系统中文件和目录没有什么不同,但目录还有一个重要的功能,那就是有结构性的分组存储其它文件,以方便查找访问。所有的硬件组件都表示为文件,系统使用这些文件来与硬件通信。 -这些思想是对伟大的 Linux 财产的重要阐述,因此像文档、目录(Mac OS X 和 Windows 系统下是文件夹)、键盘、监视器、硬盘、可移动媒体设备、打印机、调制解调器、虚拟终端,还有进程间通信(IPC)和网络通信等输入/输出资源都在定义在文件系统空间下的字节流。 +这些思想是对 Linux 中的各种事物的重要阐述,因此像文档、目录(Mac OS X 和 Windows 系统下称之为文件夹)、键盘、监视器、硬盘、可移动媒体设备、打印机、调制解调器、虚拟终端,还有进程间通信(IPC)和网络通信等输入/输出资源都是定义在文件系统空间下的字节流。 一切都可看作是文件,其最显著的好处是对于上面所列出的输入/输出资源,只需要相同的一套 Linux 工具、实用程序和 API。 @@ -28,7 +29,7 @@ Linux 系统中有三种基本的文件类型: 它们是包含文本、数据、程序指令等数据的文件,其在 Linux 系统中是最常见的一种。包括如下: -- 只读文件 +- 可读文件 - 二进制文件 - 图像文件 - 压缩文件等等 @@ -37,7 +38,7 @@ Linux 系统中有三种基本的文件类型: 特殊文件包括以下几种: -块文件:设备文件,对访问系统硬件部件提供了缓存接口。他们提供了一种使用文件系统与设备驱动通信的方法。 +块文件(block):设备文件,对访问系统硬件部件提供了缓存接口。它们提供了一种通过文件系统与设备驱动通信的方法。 有关于块文件一个重要的性能就是它们能在指定时间内传输大块的数据和信息。 @@ -73,7 +74,7 @@ brw-rw---- 1 root disk 1, 5 May 18 10:26 ram5 ... ``` -字符文件: 也是设备文件,对访问系统硬件组件提供了非缓冲串行接口。它们与设备的通信工作方式是一次只传输一个字符的数据。 +字符文件(Character): 也是设备文件,对访问系统硬件组件提供了非缓冲串行接口。它们与设备的通信工作方式是一次只传输一个字符的数据。 列出某目录下的字符文件: @@ -113,7 +114,7 @@ crw-rw-rw- 1 root tty 5, 2 May 18 17:40 ptmx crw-rw-rw- 1 root root 1, 8 May 18 10:26 random ``` -符号链接文件 : 符号链接是指向系统上其他文件的引用。因此,符号链接文件是指向其它文件的文件,也可以是目录或常规文件。 +符号链接文件(Symbolic link) : 符号链接是指向系统上其他文件的引用。因此,符号链接文件是指向其它文件的文件,那些文件可以是目录或常规文件。 列出某目录下的符号链接文件: @@ -142,11 +143,11 @@ Linux 中使用 `ln` 工具就可以创建一个符号链接文件,如下所 # ls -l /home/tecmint/ | grep "^l" [列出符号链接文件] ``` -在上面的例子中,首先我们在 `/tmp` 目录创建了一个名叫 `file1.txt` 的文件,然后创建符号链接文件,所以 `/home/tecmint/file1.txt` 指向 `/tmp/file1.txt` 文件。 +在上面的例子中,首先我们在 `/tmp` 目录创建了一个名叫 `file1.txt` 的文件,然后创建符号链接文件,将 `/home/tecmint/file1.txt` 指向 `/tmp/file1.txt` 文件。 -套接字和命令管道 : 连接一个进行的输出和另一个进程的输入,允许进程间通信的文件。 +管道(Pipes)和命令管道(Named pipes) : 将一个进程的输出连接到另一个进程的输入,从而允许进程间通信(IPC)的文件。 -命名管道实际上是一个文件,用来使两个进程彼此通信,就像一个 Linux pipe(管道) 命令一样。 +命名管道实际上是一个文件,用来使两个进程彼此通信,就像一个 Linux 管道一样。 列出某目录下的管道文件: @@ -154,7 +155,7 @@ Linux 中使用 `ln` 工具就可以创建一个符号链接文件,如下所 # ls -l | grep "^p" ``` -输出例子 +输出例子: ``` prw-rw-r-- 1 tecmint tecmint 0 May 18 17:47 pipe1 @@ -171,19 +172,17 @@ prw-rw-r-- 1 tecmint tecmint 0 May 18 17:47 pipe5 # echo "This is named pipe1" > pipe1 ``` -在上的例子中,我们创建了一个名叫 `pipe1` 的命名管道,然后使用 [echo 命令][2] 加入一些数据,在这操作后,要使用这些输入数据就要用非交互的 shell 了。 +在上的例子中,我们创建了一个名叫 `pipe1` 的命名管道,然后使用 [echo 命令][2] 加入一些数据,这之后在处理输入的数据时 shell 就变成非交互式的了(LCTT 译注:被管道占住了)。 - - -然后,我们打开另外的 shell 终端,运行另外的命令来打印出刚加入管道的数据。 +然后,我们打开另外一个 shell 终端,运行另外的命令来打印出刚加入管道的数据。 ``` # while read line ;do echo "This was passed-'$line' "; done Date: Wed, 10 Aug 2016 12:06:00 +0800 Subject: [PATCH 1401/1469] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=20Web=20Service=20Efficiency=20at=20Instagram=20with=20Python?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ice Efficiency at Instagram with Python.md | 75 ------------------ ...ice Efficiency at Instagram with Python.md | 78 +++++++++++++++++++ 2 files changed, 78 insertions(+), 75 deletions(-) delete mode 100644 sources/tech/20160602 Web Service Efficiency at Instagram with Python.md create mode 100644 translated/tech/20160602 Web Service Efficiency at Instagram with Python.md diff --git a/sources/tech/20160602 Web Service Efficiency at Instagram with Python.md b/sources/tech/20160602 Web Service Efficiency at Instagram with Python.md deleted file mode 100644 index b3cf1f4192..0000000000 --- a/sources/tech/20160602 Web Service Efficiency at Instagram with Python.md +++ /dev/null @@ -1,75 +0,0 @@ -Being translated by ChrisLeeGit - -Web Service Efficiency at Instagram with Python -=============================================== - -Instagram currently features the world’s largest deployment of the Django web framework, which is written entirely in Python. We initially chose to use Python because of its reputation for simplicity and practicality, which aligns well with our philosophy of “do the simple thing first.” But simplicity can come with a tradeoff: efficiency. Instagram has doubled in size over the last two years and recently crossed 500 million users, so there is a strong need to maximize web service efficiency so that our platform can continue to scale smoothly. In the past year we’ve made our efficiency program a priority, and over the last six months we’ve been able to maintain our user growth without adding new capacity to our Django tiers. In this post, we’ll share some of the tools we built and how we use them to optimize our daily deployment flow. - -### Why Efficiency? - -Instagram, like all software, is limited by physical constraints like servers and datacenter power. With these constraints in mind, there are two main goals we want to achieve with our efficiency program: - -1. Instagram should be able to serve traffic normally with continuous code rollouts in the case of lost capacity in one data center region, due to natural disaster, regional network issues, etc. -2. Instagram should be able to freely roll out new products and features without being blocked by capacity. - -To meet these goals, we realized we needed to persistently monitor our system and battle regression. - -### Defining Efficiency - -Web services are usually bottlenecked by available CPU time on each server. Efficiency in this context means using the same amount of CPU resources to do more work, a.k.a, processing more user requests per second (RPS). As we look for ways to optimize, our first challenge is trying to quantify our current efficiency. Up to this point, we were approximating efficiency using ‘Average CPU time per requests,’ but there were two inherent limitations to using this metric: - -1. Diversity of devices. Using CPU time for measuring CPU resources is not ideal because it is affected by both CPU models and CPU loads. -2. Request impacts data. Measuring CPU resource per request is not ideal because adding and removing light or heavy requests would also impact the efficiency metric using the per-requests measurement. - -Compared to CPU time, CPU instruction is a better metric, as it reports the same numbers regardless of CPU models and CPU loads for the same request. Instead of linking all our data to each user request, we chose to use a ‘per active user’ metric. We eventually landed on measuring efficiency by using ‘CPU instruction per active user during peak minute.’ With our new metric established, our next step was to learn more about our regressions by profiling Django. - -### Profiling the Django Service - -There are two major questions we want to answer by profiling our Django web service: - -1. Does a CPU regression happen? -2. What causes the CPU regression and how do we fix it? - -To answer the first question, we need to track the CPU-instruction-per-active-user metric. If this metric increases, we know a CPU regression has occurred. - -The tool we built for this purpose is called Dynostats. Dynostats utilizes Django middleware to sample user requests by a certain rate, recording key efficiency and performance metrics such as the total CPU instructions, end to end requests latency, time spent on accessing memcache and database services, etc. On the other hand, each request has multiple metadata that we can use for aggregation, such as the endpoint name, the HTTP return code of the request, the server name that serves this request, and the latest commit hash on the request. Having two aspects for a single request record is especially powerful because we can slice and dice on various dimensions that help us narrow down the cause of any CPU regression. For example, we can aggregate all requests by their endpoint names as shown in the time series chart below, where it is very obvious to spot if any regression happens on a specific endpoint. - -![](https://d262ilb51hltx0.cloudfront.net/max/800/1*3iouYiAchYBwzF-v0bALMw.png) - -CPU instructions matter for measuring efficiency — and they’re also the hardest to get. Python does not have common libraries that support direct access to the CPU hardware counters (CPU hardware counters are the CPU registers that can be programmed to measure performance metrics, such as CPU instructions). Linux kernel, on the other hand, provides the perf_event_open system call. Bridging through Python ctypes enables us to call the syscall function in standard C library, which also provides C compatible data types for programming the hardware counters and reading data from them. - - With Dynostats, we can already find CPU regressions and dig into the cause of the CPU regression, such as which endpoint gets impacted most, who committed the changes that actually cause the CPU regression, etc. However, when a developer is notified that their changes have caused a CPU regression, they usually have a hard time finding the problem. If it was obvious, the regression probably wouldn’t have been committed in the first place! - - That’s why we needed a Python profiler that the developer can use to find the root cause of the regression (once Dynostats identifies it). Instead of starting from scratch, we decided to make slight alterations to cProfile, a readily available Python profiler. The cProfile module normally provides a set of statistics describing how long and how often various parts of a program were executed. Instead of measuring in time, we took cProfile and replaced the timer with a CPU instruction counter that reads from hardware counters. The data is created at the end of the sampled requests and sent to some data pipelines. We also send metadata similar to what we have in Dynostats, such as server name, cluster, region, endpoint name, etc. -On the other side of the data pipeline, we created a tailer to consume the data. The main functionality of the tailer is to parse the cProfile stats data and create entities that represent Python function-level CPU instructions. By doing so, we can aggregate CPU instructions by Python functions, making it easier to tell which functions contribute to CPU regression. - -### Monitoring and Alerting Mechanism - -At Instagram, we [deploy our backend 30–50 times a day][1]. Any one of these deployments can contain troublesome CPU regressions. Since each rollout usually includes at least one diff, it is easy to identify the cause of any regression. Our efficiency monitoring mechanism includes scanning the CPU instruction in Dynostats before and after each rollout, and sending out alerts when the change exceeds a certain threshold. For the CPU regressions happening over longer periods of time, we also have a detector to scan daily and weekly changes for the most heavily loaded endpoints. - - Deploying new changes is not the only thing that can trigger a CPU regression. In many cases, the new features or new code paths are controlled by global environment variables (GEV). There are very common practices for rolling out new features to a subset of users on a planned schedule. We added this information as extra metadata fields for each request in Dynostats and cProfile stats data. Grouping requests by those fields reveal possible CPU regressions caused by turning the GEVs. This enables us to catch CPU regressions before they can impact performance. - -### What’s Next? - -Dynostats and our customized cProfile, along with the monitoring and alerting mechanism we’ve built to support them, can effectively identify the culprit for most CPU regressions. These developments have helped us recover more than 50% of unnecessary CPU regressions, which would have otherwise gone unnoticed. - - There are still areas where we can improve and make it easier to embed into Instagram’s daily deployment flow: - -1. The CPU instruction metric is supposed to be more stable than other metrics like CPU time, but we still observe variances that make our alerting noisy. Keeping signal:noise ratio reasonably low is important so that developers can focus on the real regressions. This could be improved by introducing the concept of confidence intervals and only alarm when it is high. For different endpoints, the threshold of variation could also be set differently. -2. One limitation for detecting CPU regressions by GEV change is that we have to manually enable the logging of those comparisons in Dynostats. As the number of GEVs increases and more features are developed, this wont scale well. Instead, we could leverage an automatic framework that schedules the logging of these comparisons and iterates through all GEVs, and send alerts when regressions are detected. -3. cProfile needs some enhancement to handle wrapper functions and their children functions better. - -With the work we’ve put into building the efficiency framework for Instagram’s web service, we are confident that we will keep scaling our service infrastructure using Python. We’ve also started to invest more into the Python language itself, and are beginning to explore moving our Python from version 2 to 3. We will continue to explore this and more experiments to keep improving both infrastructure and developer efficiency, and look forward to sharing more soon. - --------------------------------------------------------------------------------- - -via: https://engineering.instagram.com/web-service-efficiency-at-instagram-with-python-4976d078e366#.tiakuoi4p - -作者:[Min Ni][a] -译者:[ChrisLeeGit](https://github.com/chrisleegit) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://engineering.instagram.com/@InstagramEng?source=post_header_lockup -[1]: https://engineering.instagram.com/continuous-deployment-at-instagram-1e18548f01d1#.p5adp7kcz diff --git a/translated/tech/20160602 Web Service Efficiency at Instagram with Python.md b/translated/tech/20160602 Web Service Efficiency at Instagram with Python.md new file mode 100644 index 0000000000..b35fad81eb --- /dev/null +++ b/translated/tech/20160602 Web Service Efficiency at Instagram with Python.md @@ -0,0 +1,78 @@ +Instagram Web 服务效率与 Python +=============================================== + +Instagram 目前是世界上最大规模部署 Django web 框架(该框架完全使用 Python 编写)的主角。我们最初选用 Python 是因为它久负盛名的简洁性与实用性,这非常符合我们的哲学思想——“先做简单的事情”。但简洁性也会带来效率方面的折衷。Instagram 的规模在过去两年中已经翻番,并且最近已突破 5 亿用户,所以急需最大程度地提升 web 服务效率以便我们的平台能够继续顺利地扩大。在过去的一年,我们已经将效率计划(efficiency program)提上日程,并在过去的六个月,我们已经能够做到无需向我们的 Django 层(Django tiers)添加新的容量来维护我们的用户增长。我们将在本文分享一些由我们构建的工具以及如何使用它们来优化我们的日常部署流程。 + +### 为何需要提升效率? + +Instagram,正如所有的软件,受限于像服务器和数据中心能源这样的样物理限制。鉴于这些限制,在我们的效率计划中有两个我们希望实现的主要目标: + +1. Instagram 应当能够利用持续代码发布提供正常地通信服务,防止因为自然灾害、区域性网络问题等造成某一个数据中心区丢失。 +2. Instagram 应当能够自由地滚动发布新产品和新功能,不必因容量而受阻。 + +想要实现这些目标,我们意识到我们需要持续不断地监控我们的系统并在战斗中回归(battle regression)。 + + +### 定义效率 + +Web 服务器的瓶颈通常在于每台服务器上可用的 CPU 时间。在这种环境下,效率就意味着利用相同的 CPU 资源完成更多的任务,也就是说,每秒处理更多的用户请求(requests per second, RPS)。当我们寻找优化方法时,我们面临的第一个最大的挑战就是尝试量化我们当前的效率。到目前为止,我们一直在使用“每次请求的平均 CPU 时间”来评估效率,但使用这种指标也有其固有限制: + +1. 设备多样性。使用 CPU 时间来测量 CPU 资源并非理想方案,因为它同时受到 CPU 模型与 CPU 负载影响。 +1. 请求影响数据。测量每次请求的 CPU 资源并非理想方案,因为在使用每次请求测量(per-request measurement)方案时,添加或移除轻量级或重量级的请求也会影响到效率指标。 + +相对于 CPU 时间来说,CPU 指令是一种更好的指标,因为对于相同的请求,它会报告相同的数字,不管 CPU 模型和 CPU 负载情况如何。我们选择使用了一种叫做”每个活动用户(per active user)“的指标,而不是将我们所有的数据链接到每个用户请求上。我们最终采用”每个活动用户在高峰期间的 CPU 指令(CPU instruction per active user during peak minute)“来测量效率。我们建立好新的度量标准后,下一步就是通过对 Django 的分析来学习更多关于我们的回归(our regressions)。 + +### Django 服务分析 + +通过分析我们的 Django web 服务,我们希望回答两个主要问题: + +1. 一次 CPU 回归会发生吗? +2. 是什么导致了 CPU 回归问题发生以及我们该怎样修复它? + +想要回答第一个问题,我们需要追踪”每个活动用户的 CPU 指令(CPU-instruction-per-active-user)“指标。如果该指标增加,我们就知道一次 CPU 回归已经发生了。 + +我们为此构建的工具叫做 Dynostats。Dynostats 利用 Django 中间件以一定的速率采样用户请求,记录键效率以及性能指标,例如 CPU 总指令数、端到端请求时延、花费在访问内存缓存(memcache)和数据库服务的时间等。另一方面,每个请求都有很多可用于聚合的元数据(metadata),例如端点名称、HTTP 请求返回码、服务该请求的服务器名称以及请求中最新提交的哈希值(hash)。对于单个请求记录来说,有两个方面非常强大,因为我们可以在不同的维度上进行切割,那将帮助我们减少任何导致 CPU 回归的原因。例如,我们可以根据他们的端点名称聚合所有请求,正如下面的时间序列图所示,从图中可以清晰地看出在特定端点上是否发生了回归。 + +![](https://d262ilb51hltx0.cloudfront.net/max/800/1*3iouYiAchYBwzF-v0bALMw.png) + +CPU 指令对测量效率很重要——当然,它们也很难获得。Python 并没有支持直接访问 CPU 硬件计数器(CPU 硬件计数器是指可编程 CPU 寄存器,用于测量性能指标,例如 CPU 指令)的公共库。另一方面,Linux 内核提供了 `perf_event_open` 系统调用。通过 Python ctypes 桥接技术能够让我们调用标准 C 库编写的系统调用函数,它也为我们提供了兼容 C 的数据类型,从而可以编程硬件计数器并从它们读取数据。 + +使用 Dynostats,我们已经可以找出 CPU 回归,并探究 CPU 回归发生的原因,例如哪个端点受到的影响最多,谁提交了真正会导致 CPU 回归的变更等。然而,当开发者收到他们的变更已经导致一次 CPU 回归发生的通知时,他们通常难以找出问题所在。如果问题很明显,那么回归可能就不会一开始就被提交! + +这就是为何我们需要一个 Python 分析器,从而使开发者能够使用它找出回归(一旦 Dynostats 发现了它)发生的根本原因。不同于白手起家,我们决定对一个现成的 Python 分析器 cProfile 做适当的修改。cProfile 模块通常会提供一个统计集合来描述程序不同的部分执行时间和执行频率。我们将 cProfile 的定时器(timer)替换成了一个从硬件计数器读取的 CPU 指令计数器,以此取代对时间的测量。我们在采样请求后产生数据并把数据发送到数据流水线。我们也会发送一些我们在 Dynostats 所拥有的类似元数据,例如服务器名称、集群、区域、端点名称等。 +在数据流水线的另一边,我们创建了一个消费数据的尾随者(tailer)。尾随者的主要功能是解析 cProfile 的统计数据并创建能够表示 Python 函数级别的 CPU 指令的实体。如此,我们能够通过 Python 函数来聚集 CPU 指令,从而更加方便地找出是什么函数导致了 CPU 回归。 + +### 监控与警报机制 + +在 Instagram,我们 [每天部署 30-50 次后端服务][1]。这些部署中的任何一个都能发生 CPU 回归的问题。因为每次发生通常都包含至少一个区别(diff),所以找出任何回归是很容易的。我们的效率监控机制包含在每次发布前后都会在 Dynostats 中哦了过扫描 CPU 指令,并且当变更超出某个阈值时发出警告。对于长期会发生 CPU 回归的情况,我们也有一个探测器为负载最繁重的端点提供日常和每周的变更扫描。 + +部署新的变更并非触发一次 CPU 回归的唯一情况。在许多情况下,新的功能和新的代码路径都由全局环境变量(global environment variables, GEV)控制。 在一个计划好的时间表上,给一个用户子集发布新功能有一些非常一般的实践。我们在 Dynostats 和 cProfile 统计数据中为每个请求添加了这个信息作为额外的元数据字段。来自这些字段的组请求通过转变全局环境变量(GEV),从而暴露出可能的 CPU 回归问题。这让我们能够在它们对性能造成影响前就捕获到 CPU 回归。 + + +### 接下来是什么? + +Dynostats 和我们定制的 cProfile,以及我们建立去支持它们的监控和警报机制能够有效地找出大多数导致 CPU 回归的元凶。这些进展已经帮助我们恢复了超过 50% 的不必要的 CPU 回归,否则我们就根本不会知道。 + +我们仍然还有一些可以提升的方面并可以更加便捷将它们地加入到 Instagram 的日常部署流程中: + +1. CPU 指令指标应该要比其它指标如 CPU 时间更加稳定,但我们仍然观察了让我们头疼的差异。保持信号“信噪比(noise ratio)”合理地低是非常重要的,这样开发者们就可以集中于真实的回归上。这可以通过引入置信区间(confidence intervals)的概念来提升,并在信噪比过高时发出警报。针对不同的端点,变化的阈值也可以设置为不同值。 +2. 通过更改 GEV 来探测 CPU 回归的一个限制就是我们要在 Dynostats 中手动启用这些比较的日志输出。当 GEV 逐渐增加,越来越多的功能被开发出来,这就不便于扩展了。 +作为替代,我们能够利用一个自动化框架来调度这些比较的日志输出,并对所有的 GEV 进行遍历,然后当检查到回归时就发出警告。 +3. cProfile 需要一些增强以便更好地处理装饰器函数以及它们的子函数。 + +鉴于我们在为 Instagram 的 web 服务构建效率框架中所投入的工作,所以我们对于将来使用 Python 继续扩展我们的服务很有信心。 +我们也开始向 Python 语言自身投入更多,并且开始探索从 Python 2 转移 Python 3 之道。我们将会继续探索并做更多的实验以继续提升基础设施与开发者效率,我们期待着很快能够分享更多的经验。 + + +-------------------------------------------------------------------------------- + +via: https://engineering.instagram.com/web-service-efficiency-at-instagram-with-python-4976d078e366#.tiakuoi4p + +作者:[Min Ni][a] +译者:[ChrisLeeGit](https://github.com/chrisleegit) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://engineering.instagram.com/@InstagramEng?source=post_header_lockup +[1]: https://engineering.instagram.com/continuous-deployment-at-instagram-1e18548f01d1#.p5adp7kcz From ae99559d8b8a770d8478a76f87d0fc8bed324b06 Mon Sep 17 00:00:00 2001 From: alim0x Date: Wed, 10 Aug 2016 21:09:37 +0800 Subject: [PATCH 1402/1469] [translated]Implementing Mandatory Access Control ...with SELinux or AppArmor in Linux --- ...ntrol with SELinux or AppArmor in Linux.md | 250 ------------------ ...ntrol with SELinux or AppArmor in Linux.md | 247 +++++++++++++++++ 2 files changed, 247 insertions(+), 250 deletions(-) delete mode 100644 sources/tech/20160608 Implementing Mandatory Access Control with SELinux or AppArmor in Linux.md create mode 100644 translated/tech/20160608 Implementing Mandatory Access Control with SELinux or AppArmor in Linux.md diff --git a/sources/tech/20160608 Implementing Mandatory Access Control with SELinux or AppArmor in Linux.md b/sources/tech/20160608 Implementing Mandatory Access Control with SELinux or AppArmor in Linux.md deleted file mode 100644 index c4c6aecec6..0000000000 --- a/sources/tech/20160608 Implementing Mandatory Access Control with SELinux or AppArmor in Linux.md +++ /dev/null @@ -1,250 +0,0 @@ -alim0x translating - -Implementing Mandatory Access Control with SELinux or AppArmor in Linux -=========================================================================== - -To overcome the limitations of and to increase the security mechanisms provided by standard ugo/rwx permissions and [access control lists][1], the United States National Security Agency (NSA) devised a flexible Mandatory Access Control (MAC) method known as SELinux (short for Security Enhanced Linux) in order to restrict among other things, the ability of processes to access or perform other operations on system objects (such as files, directories, network ports, etc) to the least permission possible, while still allowing for later modifications to this model. - -![](http://www.tecmint.com/wp-content/uploads/2016/06/SELinux-AppArmor-Security-Hardening-Linux.png) ->SELinux and AppArmor Security Hardening Linux - -Another popular and widely-used MAC is AppArmor, which in addition to the features provided by SELinux, includes a learning mode that allows the system to “learn” how a specific application behaves, and to set limits by configuring profiles for safe application usage. - -In CentOS 7, SELinux is incorporated into the kernel itself and is enabled in Enforcing mode by default (more on this in the next section), as opposed to openSUSE and Ubuntu which use AppArmor. - -In this article we will explain the essentials of SELinux and AppArmor and how to use one of these tools for your benefit depending on your chosen distribution. - -### Introduction to SELinux and How to Use it on CentOS 7 - -Security Enhanced Linux can operate in two different ways: - -- Enforcing: SELinux denies access based on SELinux policy rules, a set of guidelines that control the security engine. -- Permissive: SELinux does not deny access, but denials are logged for actions that would have been denied if running in enforcing mode. - -SELinux can also be disabled. Although it is not an operation mode itself, it is still an option. However, learning how to use this tool is better than just ignoring it. Keep it in mind! - -To display the current mode of SELinux, use getenforce. If you want to toggle the operation mode, use setenforce 0 (to set it to Permissive) or setenforce 1 (Enforcing). - -Since this change will not survive a reboot, you will need to edit the /etc/selinux/config file and set the SELINUX variable to either enforcing, permissive, or disabled in order to achieve persistence across reboots: - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Enable-Disable-SELinux-Mode.png) ->How to Enable and Disable SELinux Mode - -On a side note, if getenforce returns Disabled, you will have to edit /etc/selinux/config with the desired operation mode and reboot. Otherwise, you will not be able to set (or toggle) the operation mode with setenforce. - -One of the typical uses of setenforce consists of toggling between SELinux modes (from enforcing to permissive or the other way around) to troubleshoot an application that is misbehaving or not working as expected. If it works after you set SELinux to Permissive mode, you can be confident you’re looking at a SELinux permissions issue. - -Two classic cases where we will most likely have to deal with SELinux are: - -- Changing the default port where a daemon listens on. -- Setting the DocumentRoot directive for a virtual host outside of /var/www/html. - -Let’s take a look at these two cases using the following examples. - -#### EXAMPLE 1: Changing the default port for the sshd daemon - -One of the first thing most system administrators do in order to secure their servers is change the port where the SSH daemon listens on, mostly to discourage port scanners and external attackers. To do this, we use the Port directive in `/etc/ssh/sshd_config` followed by the new port number as follows (we will use port 9999 in this case): - -``` -Port 9999 -``` - -After attempting to restart the service and checking its status we will see that it failed to start: - -``` -# systemctl restart sshd -# systemctl status sshd -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Check-sshd-Service-Status.png) ->Check SSH Service Status - -If we take a look at /var/log/audit/audit.log, we will see that sshd was prevented from starting on port 9999 by SELinux because that is a reserved port for the JBoss Management service (SELinux log messages include the word “AVC” so that they might be easily identified from other messages): - -``` -# cat /var/log/audit/audit.log | grep AVC | tail -1 -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Check-Linux-Audit-Logs.png) ->Check Linux Audit Logs - -At this point most people would probably disable SELinux but we won’t. We will see that there’s a way for SELinux, and sshd listening on a different port, to live in harmony together. Make sure you have the policycoreutils-python package installed and run: - -``` -# yum install policycoreutils-python -``` - -To view a list of the ports where SELinux allows sshd to listen on. In the following image we can also see that port 9999 was reserved for another service and thus we can’t use it to run another service for the time being: - -``` -# semanage port -l | grep ssh -``` - -Of course we could choose another port for SSH, but if we are certain that we will not need to use this specific machine for any JBoss-related services, we can then modify the existing SELinux rule and assign that port to SSH instead: - -``` -# semanage port -m -t ssh_port_t -p tcp 9999 -``` - -After that, we can use the first semanage command to check if the port was correctly assigned, or the -lC options (short for list custom): - -``` -# semanage port -lC -# semanage port -l | grep ssh -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Assign-Port-to-SSH.png) ->Assign Port to SSH - -We can now restart SSH and connect to the service using port 9999. Note that this change WILL survive a reboot. - -#### EXAMPLE 2: Choosing a DocumentRoot outside /var/www/html for a virtual host - -If you need to [set up a Apache virtual host][2] using a directory other than /var/www/html as DocumentRoot (say, for example, `/websrv/sites/gabriel/public_html`): - -``` -DocumentRoot “/websrv/sites/gabriel/public_html” -``` - -Apache will refuse to serve the content because the index.html has been labeled with the default_t SELinux type, which Apache can’t access: - -``` -# wget http://localhost/index.html -# ls -lZ /websrv/sites/gabriel/public_html/index.html -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Labeled-default_t-SELinux-Type.png) ->Labeled as default_t SELinux Type - -As with the previous example, you can use the following command to verify that this is indeed a SELinux-related issue: - -``` -# cat /var/log/audit/audit.log | grep AVC | tail -1 -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Check-Logs-for-SELinux-Issues.png) ->Check Logs for SELinux Issues - -To change the label of /websrv/sites/gabriel/public_html recursively to httpd_sys_content_t, do: - -``` -# semanage fcontext -a -t httpd_sys_content_t "/websrv/sites/gabriel/public_html(/.*)?" -``` - -The above command will grant Apache read-only access to that directory and its contents. - -Finally, to apply the policy (and make the label change effective immediately), do: - -``` -# restorecon -R -v /websrv/sites/gabriel/public_html -``` - -Now you should be able to access the directory: - -``` -# wget http://localhost/index.html -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Access-Apache-Directory.png) ->Access Apache Directory - -For more information on SELinux, refer to the Fedora 22 [SELinux and Administrator guide][3]. - - -### Introduction to AppArmor and How to Use it on OpenSUSE and Ubuntu - -The operation of AppArmor is based on profiles defined in plain text files where the allowed permissions and access control rules are set. Profiles are then used to place limits on how applications interact with processes and files in the system. - -A set of profiles is provided out-of-the-box with the operating system, whereas others can be put in place either automatically by applications when they are installed or manually by the system administrator. - -Like SELinux, AppArmor runs profiles in two modes. In enforce mode, applications are given the minimum permissions that are necessary for them to run, whereas in complain mode AppArmor allows an application to take restricted actions and saves the “complaints” resulting from that operation to a log (/var/log/kern.log, /var/log/audit/audit.log, and other logs inside /var/log/apparmor). - -These logs will show through lines with the word audit in them errors that would occur should the profile be run in enforce mode. Thus, you can try out an application in complain mode and adjust its behavior before running it under AppArmor in enforce mode. - -The current status of AppArmor can be shown using: - -``` -$ sudo apparmor_status -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Check-AppArmor-Status.png) ->Check AppArmor Status - -The image above indicates that the profiles /sbin/dhclient, /usr/sbin/, and /usr/sbin/tcpdump are in enforce mode (that is true by default in Ubuntu). - -Since not all applications include the associated AppArmor profiles, the apparmor-profiles package, which provides other profiles that have not been shipped by the packages they provide confinement for. By default, they are configured to run in complain mode so that system administrators can test them and choose which ones are desired. - -We will make use of apparmor-profiles since writing our own profiles is out of the scope of the LFCS [certification][4]. However, since profiles are plain text files, you can view them and study them in preparation to create your own profiles in the future. - -AppArmor profiles are stored inside /etc/apparmor.d. Let’s take a look at the contents of that directory before and after installing apparmor-profiles: - -``` -$ ls /etc/apparmor.d -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/06/View-AppArmor-Directory-Content.png) ->View AppArmor Directory Content - -If you execute sudo apparmor_status again, you will see a longer list of profiles in complain mode. You can now perform the following operations: - -To switch a profile currently in enforce mode to complain mode: - -``` -$ sudo aa-complain /path/to/file -``` - -and the other way around (complain –> enforce): - -``` -$ sudo aa-enforce /path/to/file -``` - -Wildcards are allowed in the above cases. For example, - -``` -$ sudo aa-complain /etc/apparmor.d/* -``` - -will place all profiles inside /etc/apparmor.d into complain mode, whereas - -``` -$ sudo aa-enforce /etc/apparmor.d/* -``` - -will switch all profiles to enforce mode. - -To entirely disable a profile, create a symbolic link in the /etc/apparmor.d/disabled directory: - -``` -$ sudo ln -s /etc/apparmor.d/profile.name /etc/apparmor.d/disable/ -``` - -For more information on AppArmor, please refer to the [official AppArmor wiki][5] and to the documentation [provided by Ubuntu][6]. - -### Summary - -In this article we have gone through the basics of SELinux and AppArmor, two well-known MACs. When to use one or the other? To avoid difficulties, you may want to consider sticking with the one that comes with your chosen distribution. In any event, they will help you place restrictions on processes and access to system resources to increase the security in your servers. - -Do you have any questions, comments, or suggestions about this article? Feel free to let us know using the form below. Don’t hesitate to let us know if you have any questions or comments. - - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/mandatory-access-control-with-selinux-or-apparmor-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/secure-files-using-acls-in-linux/ -[2]: http://www.tecmint.com/apache-virtual-hosting-in-centos/ -[3]: https://docs.fedoraproject.org/en-US/Fedora/22/html/SELinux_Users_and_Administrators_Guide/index.html -[4]: http://www.tecmint.com/sed-command-to-create-edit-and-manipulate-files-in-linux/ -[5]: http://wiki.apparmor.net/index.php/Main_Page -[6]: https://help.ubuntu.com/community/AppArmor - - - diff --git a/translated/tech/20160608 Implementing Mandatory Access Control with SELinux or AppArmor in Linux.md b/translated/tech/20160608 Implementing Mandatory Access Control with SELinux or AppArmor in Linux.md new file mode 100644 index 0000000000..82dd1a3484 --- /dev/null +++ b/translated/tech/20160608 Implementing Mandatory Access Control with SELinux or AppArmor in Linux.md @@ -0,0 +1,247 @@ +在 Linux 上用 SELinux 或 AppArmor 实现强制访问控制 +=========================================================================== + +为了克服标准 用户-组-其他/读-写-执行 权限以及[访问控制列表][1]的限制以及加强安全机制,美国国家安全局(NSA)设计出一个灵活的强制访问控制(MAC)方法 SELinux(Security Enhanced Linux 的缩写),来限制其他事物,在仍然允许对这个模型后续修改的情况下,让进程尽可能以最小权限访问或在系统对象(如文件,文件夹,网络端口等)上执行其他操作。 + +![](http://www.tecmint.com/wp-content/uploads/2016/06/SELinux-AppArmor-Security-Hardening-Linux.png) +>SELinux 和 AppArmor 加固 Linux 安全 + +另一个流行并且广泛使用的 MAC 是 AppArmor,相比于 SELinux 它提供额外的特性,包括一个学习模型,让系统“学习”一个特定应用的行为,通过配置文件设置限制实现安全的应用使用。 + +在 CentOS 7 中,SELinux 合并进了内核并且默认启用强制(Enforcing)模式(下一节会介绍这方面更多的内容),与使用 AppArmor 的 openSUSE 和 Ubuntu 完全不同。 + +在这篇文章中我们会解释 SELinux 和 AppArmor 的本质以及如何在你选择的发行版上使用这两个工具之一并从中获益。 + +### SELinux 介绍以及如何在 CentOS 7 中使用 + +Security Enhanced Linux 可以以两种不同模式运行: + +- 强制(Enforcing):SELinux 基于 SELinux 策略规则拒绝访问,一个指导准则集合控制安全引擎。 +- 宽容(Permissive):SELinux 不拒绝访问,但如果在强制模式下会被拒绝的操作会被记录下来。 + +SELinux 也能被禁用。尽管这不是它的一个操作模式,不过也是一个选项。但学习如何使用这个工具强过只是忽略它。时刻牢记这一点! + +使用 getenforce 命令来显示 SELinux 的当前模式。如果你想要更改模式,使用 setenforce 0(设置为宽容模式)或 setenforce 1(强制模式)。 + +因为这些设置重启后就失效了,你需要编辑 /etc/selinux/ 的配置文件并设置 SELINUX 变量为 enforcing,permissive 或 disabled 来保存设置让其重启后也有效: + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Enable-Disable-SELinux-Mode.png) +>如何启用和禁用 SELinux 模式 + +还有一点要注意,如果 getenforce 返回 Disabled,你得编辑 /etc/selinux/ 配置为你想要的操作模式并重启。否则你无法利用 setenforce 设置(或切换)操作模式。 + +setenforce 的典型用法之一包括在 SELinux 模式之间切换(从强制到宽容或相反)来定位一个应用是否行为不端或没有像预期一样工作。如果它在你将 SELinux 设置为宽容模式正常工作,你就可以确定你遇到的是 SELinux 权限问题。 + +两种我们使用 SELinux 可能需要解决的典型案例: + +- 改变一个守护进程监听的默认端口。 +- 给一个虚拟主机设置 /var/www/html 以外的文档根路径值。 + +让我们用以下例子来看看这两种情况。 + +#### 例 1:更改 sshd 守护进程的默认端口 + +大部分系统管理员为了加强服务器安全首先要做的事情之一就是更改 SSH 守护进程监听的端口,主要是为了组织端口扫描和外部攻击。要达到这个目的,我们要更改 `/etc/ssh/sshd_config` 中的 Port 值为以下值(我们在这里使用端口 9999 为例): + +``` +Port 9999 +``` + +在尝试重启服务并检查它的状态之后,我们会看到它启动失败: + +``` +# systemctl restart sshd +# systemctl status sshd +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Check-sshd-Service-Status.png) +>检查 SSH 服务状态 + +如果我们看看 /var/log/audit/audit.log,就会看到 sshd 被 SELinux 组织在端口 9999 上启动,因为他是 JBoss 管理服务的保留端口(SELinux 日志信息包含了词语“AVC”,所以应该很容易把它同其他信息区分开来): + +``` +# cat /var/log/audit/audit.log | grep AVC | tail -1 +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Check-Linux-Audit-Logs.png) +>检查 Linux 审计日志 + +在这种情况下大部分人可能会禁用 SELinux,但我们不这么做。我们会看到有个让 Selinux 和监听其他端口的 sshd 和谐共处的方法。首先确保你有 policycoreutils-python 这个包,执行: + +``` +# yum install policycoreutils-python +``` + +查看 SELinux 允许 sshd 监听的端口列表。在接下来的图片中我们还能看到端口 9999 是为其他服务保留的,所以我们暂时无法用它来运行其他服务: + +``` +# semanage port -l | grep ssh +``` + +当然我们可以给 SSH 选择其他端口,但如果我们确定我们不会使用这台机器跑任何 JBoss 相关的服务,我们就可以修改 SELinux 已存在的规则,转而给 SSH 分配那个端口: + +``` +# semanage port -m -t ssh_port_t -p tcp 9999 +``` + +在那之后,我们可以用第一个 semanage 命令检查端口是否正确分配了,或用 -lC 参数(list custom 的简称): + +``` +# semanage port -lC +# semanage port -l | grep ssh +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Assign-Port-to-SSH.png) +>给 SSH 分配端口 + +我们现在可以重启 SSH 服务并通过端口 9999 连接了。注意这个更改重启之后依然有效。 + +#### 例 2:给一个虚拟主机设置 /var/www/html 以外的文档根路径值 + +如果你需要用除 /var/www/html 以外目录作为文档根目录[设置一个 Apache 虚拟主机][2](也就是说,比如 `/websrv/sites/gabriel/public_html`): + +``` +DocumentRoot “/websrv/sites/gabriel/public_html” +``` + +Apache 会拒绝提供内容,因为 index.html 已经被标记为了 default_t SELinux 类型,Apache 无法访问它: + +``` +# wget http://localhost/index.html +# ls -lZ /websrv/sites/gabriel/public_html/index.html +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Labeled-default_t-SELinux-Type.png) +>被标记为 default_t SELinux 类型 + +和之前的例子一样,你可以用以下命令验证这是不是 SELinux 相关的问题: + +``` +# cat /var/log/audit/audit.log | grep AVC | tail -1 +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Check-Logs-for-SELinux-Issues.png) +>检查日志确定是不是 SELinux 的问题 + +要将 /websrv/sites/gabriel/public_html 整个目录内容标记为 httpd_sys_content_t,执行: + +``` +# semanage fcontext -a -t httpd_sys_content_t "/websrv/sites/gabriel/public_html(/.*)?" +``` + +上面这个命令会赋予 Apache 对那个目录以及其内容的读取权限。 + +最后,要应用这条策略(并让更改的标记立即生效),执行: + +``` +# restorecon -R -v /websrv/sites/gabriel/public_html +``` + +现在你应该可以访问这个目录了: + +``` +# wget http://localhost/index.html +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Access-Apache-Directory.png) +>访问 Apache 目录 + +要获取关于 SELinux 的更多信息,参阅 Fedora 22 [SELinux 以及 管理员指南][3]。 + + +### AppArmor 介绍以及如何在 OpenSUSE 和 Ubuntu 上使用它 + +AppArmor 的操作是基于纯文本文件的规则定义,该文件中含有允许权限和访问控制规则。安全配置文件用来限制应用程序如何与系统中的进程和文件进行交互。 + +系统初始就提供了一系列的配置文件,但其他的也可以由应用程序安装的时候设置或由系统管理员手动设置。 + +像 SELinux 一样,AppArmor 以两种模式运行。在 enforce 模式下,应用被赋予它们运行所需要的最小权限,但在 complain 模式下 AppArmor 允许一个应用执行有限的操作并将操作造成的“抱怨”记录到日志里(/var/log/kern.log,/var/log/audit/audit.log,和其它在 /var/log/apparmor 中的日志)。 + +日志中会显示配置文件在强制模式下运行时会产生错误的记录,它们中带有审计这个词。因此,你可以在 AppArmor 的 enforce 模式下运行之前,先在 complain 模式下尝试运行一个应用并调整它的行为。 + +可以用这个命令显示 AppArmor 的当前状态: + +``` +$ sudo apparmor_status +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Check-AppArmor-Status.png) +>查看 AppArmor 的状态 + +上面的图片指明配置 /sbin/dhclient,/usr/sbin/,和 /usr/sbin/tcpdump 在 enforce 模式下(在 Ubuntu 下默认就是这样的)。 + +因为不是所有的应用都包含相关的 AppArmor 配置,apparmor-profiles 包提供了其它配置给没有提供限制的包。默认它们配置在 complain 模式下运行以便系统管理员能够测试并选择一个所需要的配置。 + +我们将会利用 apparmor-profiles,因为写一份我们自己的配置已经超出了 LFCS [认证][4]的范围了。但是,由于配置都是纯文本文件,你可以查看并学习它们,为以后创建自己的配置做准备。 + +AppArmor 配置保存在 /etc/apparmor.d 中。让我们来看看这个文件夹在安装 apparmor-profiles 之前和之后有什么不同: + +``` +$ ls /etc/apparmor.d +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/06/View-AppArmor-Directory-Content.png) +>查看 AppArmor 文件夹内容 + +如果你再次执行 sudo apparmor_status,你会在 complain 模式看到更长的配置文件列表。你现在可以执行下列操作: + +将当前在 enforce 模式下的配置文件切换到 complain 模式: + +``` +$ sudo aa-complain /path/to/file +``` + +以及相反的操作(complain –> enforce): + +``` +$ sudo aa-enforce /path/to/file +``` + +上面这些例子是允许使用通配符的。举个例子: + +``` +$ sudo aa-complain /etc/apparmor.d/* +``` + +会将 /etc/apparmor.d 中的所有配置文件设置为 complain 模式,反之 + +``` +$ sudo aa-enforce /etc/apparmor.d/* +``` + +会将所有配置文件设置为 enforce 模式。 + +要完全禁用一个配置,在 /etc/apparmor.d/disabled 目录中创建一个符号链接: + +``` +$ sudo ln -s /etc/apparmor.d/profile.name /etc/apparmor.d/disable/ +``` + +要获取关于 AppArmor 的更多信息,参阅[官方 AppArmor wiki][5] 以及 [Ubuntu 提供的][6]文档。 + +### 总结 + +在这篇文章中我们学习了一些 SELinux 和 AppArmor 这两个著名强制访问控制系统的基本知识。什么时候使用两者中的一个或是另一个?为了避免提高难度,你可能需要考虑专注于你选择的发行版自带的那一个。不管怎样,它们会帮助你限制进程和系统资源的访问,以提高你服务器的安全性。 + +关于本文你有任何的问题,评论,或建议,欢迎在下方发表。不要犹豫,让我们知道你是否有疑问或评论。 + + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/mandatory-access-control-with-selinux-or-apparmor-linux/ + +作者:[Gabriel Cánepa][a] +译者:[alim0x](https://github.com/alim0x) +校对:[校对者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/secure-files-using-acls-in-linux/ +[2]: http://www.tecmint.com/apache-virtual-hosting-in-centos/ +[3]: https://docs.fedoraproject.org/en-US/Fedora/22/html/SELinux_Users_and_Administrators_Guide/index.html +[4]: http://www.tecmint.com/sed-command-to-create-edit-and-manipulate-files-in-linux/ +[5]: http://wiki.apparmor.net/index.php/Main_Page +[6]: https://help.ubuntu.com/community/AppArmor + + From 65138a5a1f57e4c375ce7fd4ab6d6478611cf9c6 Mon Sep 17 00:00:00 2001 From: CHL Date: Thu, 11 Aug 2016 00:35:28 +0800 Subject: [PATCH 1403/1469] [Translating by Flowsnow] [Translating by Flowsnow!]Best Password Manager for ALL Platforms --- sources/tech/20160729 Best Password Manager all platform.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160729 Best Password Manager all platform.md b/sources/tech/20160729 Best Password Manager all platform.md index 09c62bf93b..1c90462aae 100644 --- a/sources/tech/20160729 Best Password Manager all platform.md +++ b/sources/tech/20160729 Best Password Manager all platform.md @@ -1,3 +1,4 @@ +Translating by Flowsnow! Best Password Manager — For Windows, Linux, Mac, Android, iOS and Enterprise ============================== From 12235f6d3cdc00d1bf88952f8d2b9606922cf233 Mon Sep 17 00:00:00 2001 From: CHL Date: Thu, 11 Aug 2016 10:39:31 +0800 Subject: [PATCH 1404/1469] [Translated]72% Of The People I Follow On Twitter Are Men (#4301) * [Translating]72% Of The People I Follow On Twitter Are Men Translating by Flowsnow! 72% Of The People I Follow On Twitter Are Men * update --- ... The People I Follow On Twitter Are Men.md | 88 ------------------- ... The People I Follow On Twitter Are Men.md | 83 +++++++++++++++++ 2 files changed, 83 insertions(+), 88 deletions(-) delete mode 100644 sources/tech/20160623 72% Of The People I Follow On Twitter Are Men.md create mode 100644 translated/tech/20160623 72% Of The People I Follow On Twitter Are Men.md diff --git a/sources/tech/20160623 72% Of The People I Follow On Twitter Are Men.md b/sources/tech/20160623 72% Of The People I Follow On Twitter Are Men.md deleted file mode 100644 index 71a23511e9..0000000000 --- a/sources/tech/20160623 72% Of The People I Follow On Twitter Are Men.md +++ /dev/null @@ -1,88 +0,0 @@ -Translating by Flowsnow! -72% Of The People I Follow On Twitter Are Men -=============================================== - -![](https://emptysqua.re/blog/gender-of-twitter-users-i-follow/abacus.jpg) - -At least, that's my estimate. Twitter does not ask users their gender, so I [have written a program that guesses][1] based on their names. Among those who follow me, the distribution is even worse: 83% are men. None are gender-nonbinary as far as I can tell. - -The way to fix the first number is not mysterious: I should notice and seek more women experts tweeting about my interests, and follow them. - -The second number, on the other hand, I can merely influence, but I intend to improve it as well. My network on Twitter should represent of the software industry's diverse future, not its unfair present. - -### How Did I Measure It? - -I set out to estimate the gender distribution of the people I follow—my "friends" in Twitter's jargon—and found it surprisingly hard. [Twitter analytics][2] readily shows me the converse, an estimate of my followers' gender: - -![](https://emptysqua.re/blog/gender-of-twitter-users-i-follow/twitter-analytics.png) - -So, Twitter analytics divides my followers' accounts among male, female, and unknown, and tells me the ratio of the first two groups. (Gender-nonbinary folk are absent here—they're lumped in with the Twitter accounts of organizations, and those whose gender is simply unknown.) But Twitter doesn't tell me the ratio of my friends. That [which is measured improves][3], so I searched for a service that would measure this number for me, and found [FollowerWonk][4]. - -FollowerWonk guesses my friends are 71% men. Is this a good guess? For the sake of validation, I compare FollowerWonk's estimate of my followers to Twitter's estimate: - -**Twitter analytics** - - |men |women -:-- |:-- |:-- -Followers |83% |17% - -**FollowerWonk** - - |men |women -:-- |:-- |:-- -Followers |81% |19% -Friends I follow |72% |28% - -My followers show up 81% male here, close to the Twitter analytics number. So far so good. If FollowerWonk and Twitter agree on the gender ratio of my followers, that suggests FollowerWonk's estimate of the people I follow (which Twitter doesn't analyze) is reasonably good. With it, I can make a habit of measuring my numbers, and improve them. - -At $30 a month, however, checking my friends' gender distribution with FollowerWonk is a pricey habit. I don't need all its features anyhow. Can I solve only the gender-distribution problem economically? - -Since FollowerWonk's numbers seem reasonable, I tried to reproduce them. Using Python and [some nice Philadelphians' Twitter][5] API wrapper, I began downloading the profiles of all my friends and followers. I immediately found that Twitter's rate limits are miserly, so I randomly sampled only a subset of users instead. - -I wrote a rudimentary program that searches for a pronoun announcement in each of my friends' profiles. For example, a profile description that includes "she/her" probably belongs to a woman, a description with "they/them" is probably nonbinary. But most don't state their pronouns: for these, the best gender-correlated information is the "name" field: for example, @gvanrossum's name field is "Guido van Rossum", and the first name "Guido" suggests that @gvanrossum is male. Where pronouns were not announced, I decided to use first names to estimate my numbers. - -My script passes parts of each name to the SexMachine library to guess gender. [SexMachine][6] has predictable downfalls, like mistaking "Brooklyn Zen Center" for a woman named "Brooklyn", but its estimates are as good as FollowerWonk's and Twitter's: - - - - |nonbinary |men |women |no gender,unknown -:-- |:-- |:-- |:-- |:-- -Friends I follow |1 |168 |66 |173 - |0% |72% |28% | -Followers |0 |459 |108 |433 - |0% |81% |19% | - -(Based on all 408 friends and a sample of 1000 followers.) - -### Know Your Number - -I want you to check your Twitter network's gender distribution, too. So I've deployed "Proportional" to PythonAnywhere's handy service for $10 a month: - -> - -The application may rate-limit you or otherwise fail, so use it gently. The [code is on GitHub][7]. It includes a command-line tool, as well. - -Who is represented in your network on Twitter? Are you speaking and listening to the same unfairly distributed group who have been talking about software for the last few decades, or does your network look like the software industry of the future? Let's know our numbers and improve them. - - - - - --------------------------------------------------------------------------------- - -via: https://emptysqua.re/blog/gender-of-twitter-users-i-follow/ - -作者:[A. Jesse Jiryu Davis][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://disqus.com/by/AJesseJiryuDavis/ -[1]: https://www.proporti.onl/ -[2]: https://analytics.twitter.com/ -[3]: http://english.stackexchange.com/questions/14952/that-which-is-measured-improves -[4]: https://moz.com/followerwonk/ -[5]: https://github.com/bear/python-twitter/graphs/contributors -[6]: https://pypi.python.org/pypi/SexMachine/ -[7]: https://github.com/ajdavis/twitter-gender-distribution diff --git a/translated/tech/20160623 72% Of The People I Follow On Twitter Are Men.md b/translated/tech/20160623 72% Of The People I Follow On Twitter Are Men.md new file mode 100644 index 0000000000..e836bfe4ab --- /dev/null +++ b/translated/tech/20160623 72% Of The People I Follow On Twitter Are Men.md @@ -0,0 +1,83 @@ +在推特上我关注的人72%都是男性 +=============================================== + +![](https://emptysqua.re/blog/gender-of-twitter-users-i-follow/abacus.jpg) + +至少,这是我的估计。推特并不会询问用户的性别,因此我 [写了一个程序][1] ,根据姓名猜测他们的性别。在我的那些关注者中,性别分布甚至更糟,83%的是男性。据我所知,其他的还不全都是女性。 + +修正第一个数字并不是什么神秘的事:我注意寻找更多支持我兴趣的女性专家,并且关注他们。 + +另一方面,第二个数字,我只能只能轻微影响一点,但是我也打算改进下。我在推特上的关系网应该代表的是软件行业的多元化未来,而不是不公平的现状。 + +### 我应该怎么估算呢 + +我开始估算我关注的人(推特的上的术语是“朋友”)的性别分布,然后这格外的难。[推特的分析][2]经常显示相反的结果。 一个我的关注者的性别估算结果: + +![](https://emptysqua.re/blog/gender-of-twitter-users-i-follow/twitter-analytics.png) + +因此,推特的分析将我的关注者分成了三类:男性、女性、未知,并且给我们展示了前面两组的比例。(性别二值化现象在这里并不存在——未知性别的人都集中在组织的推特账号上。)但是我关注的人的性别比例,推特并没有告诉我。 [而这就是可以改进的][3], 然后我开始搜索能够帮我估算这个数字的服务,最终发现了 [FollowerWonk][4] 。 + +FollowerWonk 估算我关注的人里面有71%的都是男性。这个估算准确吗? 为了准确性,我把FollowerWonk和Twitter对我关注的人的进行了估算,结果如下: + +**推特分析** + +| | 男性 | 女性 | +| --------- | ---- | ---- | +| **我的关注者** | 83% | 17% | + +**FollowerWonk** + +| | 男性 | 女性 | +| --------- | ---- | ---- | +| **我的关注者** | 81% | 19% | +| **我关注的人** | 72% | 28% | + +FollowerWonk的分析显示我的关注者中81%的人都是男性,很接近推特分析的数字。这个结果还说得过去。如果FollowerWonk 和Twitter 在我的关注者的性别比例上是一致的,这就表明FollowerWonk对我关注的人的性别估算也应当是合理的。使用FollowerWonk我就能养成估算这些数字的爱好,并且做出改进。 + +然而,使用FollowerWonk 检测我关注的人的性别分布一个月需要30美元,这真是一个昂贵的爱好。我并不需要FollowerWonk 的所有的功能。我能很经济的解决只需要性别分布的问题吗? + +因为FollowerWonk 的估算数字看起来比较合理,我试图做一个自己的FollowerWonk 。使用Python和[一些好心的费城人写的Twitter API封装类][5](LCTT译者注:Twitter API封装类是由Mike Taylor等一批费城人在github上开源的一个项目),我开始下载我所有关注的人和我所有的关注者的简介。我马上就发现推特的比例限制是极少的,因此我随机的采样了一部分用户。 + +我写了一个初步的程序,在所有我关注的人的简介中搜索一个和性别相关的代词。例如,如果简介中包含了“she”或者“her”这样的字眼,可能这就属于一个女性,如果简介中包含了“they”或者”then“,那么可能这就是性别位置的。但是大多数简介中不会出现这些代词。对于这种简介,和性别关联最紧密的信息就是姓名了。例如:@gvanrossum的姓名那一栏是“Guido van Rossum”,第一姓名是“Guido”,这表明@gvanrossum是一个女的。当找不到代词的时候,我就使用第一姓名来评估性别估算数字。 + +我的脚本把每个名字的一部分传到性别检测机中去检测性别。[性别检测机][6]也有可预见的失败,比如错误的把“Brooklyn Zen Center”当做一个名叫“Brooklyn”的女性,但是它的评估结果与FollowerWonk和Twitter的相比也是很合理的: + +| | 非男非女 | 男性 | 女性 | 性别未知的 | +| ----- | ---- | ---- | ---- | ----- | +| 我关注的人 | 1 | 168 | 66 | 173 | +| | 0% | 72% | 28% | | +| 我的关注者 | 0 | 459 | 108 | 433 | +| | 0% | 81% | 19% | | + +(数据基于我所有的408个关注的人和1000个关注者。) + +### 了解你的数字 + +我想你们也能检测你们推特关系网的性别分布。所以我每月花费10美元将“Proportional”应用发布到PythonAnywhere这个便利的服务上: + +> + +这个应用可能会在速率上有限制,否则会失败,因此请温柔的对待它。github上放了源代码[代码][7] ,也有命令行的工具。 + +是谁代表了你的推特关系网?你还在忍受那些在过去几十年里一直在谈论的软件的不公平的分布组吗?或者你的关系网看起来像软件行业的未来吗?让我们了解我们的数字并且改善他们。 + + + +-------------------------------------------------------------------------------- + +via: https://emptysqua.re/blog/gender-of-twitter-users-i-follow/ + +作者:[A. Jesse Jiryu Davis][a] +译者:[Flowsnow](https://github.com/Flowsnow) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://disqus.com/by/AJesseJiryuDavis/ +[1]: https://www.proporti.onl/ +[2]: https://analytics.twitter.com/ +[3]: http://english.stackexchange.com/questions/14952/that-which-is-measured-improves +[4]: https://moz.com/followerwonk/ +[5]: https://github.com/bear/python-twitter/graphs/contributors +[6]: https://pypi.python.org/pypi/SexMachine/ +[7]: https://github.com/ajdavis/twitter-gender-distribution \ No newline at end of file From 301b313e78c3a84b882e5c46ca1a910721e77d79 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 11 Aug 2016 13:57:58 +0800 Subject: [PATCH 1405/1469] PUB:20160717 BEST TEXT EDITORS FOR LINUX COMMAND LINE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @chenzhijun 翻译的不错。 --- ...EST TEXT EDITORS FOR LINUX COMMAND LINE.md | 94 +++++++++++++++++++ ...EST TEXT EDITORS FOR LINUX COMMAND LINE.md | 93 ------------------ 2 files changed, 94 insertions(+), 93 deletions(-) create mode 100644 published/20160717 BEST TEXT EDITORS FOR LINUX COMMAND LINE.md delete mode 100644 translated/tech/20160717 BEST TEXT EDITORS FOR LINUX COMMAND LINE.md diff --git a/published/20160717 BEST TEXT EDITORS FOR LINUX COMMAND LINE.md b/published/20160717 BEST TEXT EDITORS FOR LINUX COMMAND LINE.md new file mode 100644 index 0000000000..f2a76f10bb --- /dev/null +++ b/published/20160717 BEST TEXT EDITORS FOR LINUX COMMAND LINE.md @@ -0,0 +1,94 @@ +Linux 命令行下的最佳文本编辑器 +========================================== + +![](https://itsfoss.com/wp-content/uploads/2016/07/Best-Command-Line-Text-Editors-for-Linux.jpg) + +文本编辑软件在任何操作系统上都是必备的软件。我们在 Linux 上不缺乏[非常现代化的编辑软件][1],但是它们都是基于 GUI(图形界面)的编辑软件。 + +正如你所了解的,Linux 真正的魅力在于命令行。当你正在用命令行工作时,你就需要一个可以在控制台窗口运行的文本编辑器。 + +正因为这个目的,我们准备了一个基于 Linux 命令行的文本编辑器清单。 + +### [VIM][2] + +如果你已经使用 Linux 有一段时间,那么你肯定听到过 Vim 。Vim 是一个高度可配置的、跨平台的、高效率的文本编辑器。 + +几乎所有的 Linux 发行版本都已经内置了 Vim ,由于其特性之丰富,它已经变得非常流行了。 + +![](https://itsfoss.com/wp-content/uploads/2016/07/vim.png) + +*Vim 用户界面* + +Vim 可能会让第一次使用它的人感到非常痛苦。我记得我第一次尝试使用 Vim 编辑一个文本文件时,我是非常困惑的。我不能用 Vim 输入一个字母,更有趣的是,我甚至不知道该怎么关闭它。如果你准备使用 Vim ,你需要有决心跨过一个陡峭的学习路线。 + +但是一旦你经历过了那些,通过梳理一些文档,记住它的命令和快捷键,你会发现这段学习经历是非常值得的。你可以将 Vim 按照你的意愿进行改造:配置一个让你看起来舒服的界面,通过使用脚本或者插件等来提高工作效率。Vim 支持格式高亮,宏记录和操作记录。 + +在Vim官网上,它是这样介绍的: + +>**Vim: The power tool for everyone!** + +如何使用它完全取决于你。你可以仅仅使用它作为文本编辑器,或者你可以将它打造成一个完善的IDE(Integrated Development Environment:集成开发环境)。 + +### [GNU EMACS][3] + +GNU Emacs 毫无疑问是非常强大的文本编辑器之一。如果你听说过 Vim 和 Emacs ,你应该知道这两个编辑器都拥有非常忠诚的粉丝基础,并且他们对于文本编辑器的选择非常看重。你也可以在互联网上找到大量关于他们的段子: + +![](https://itsfoss.com/wp-content/uploads/2016/07/vi-emacs-768x426.png) + +*Vim vs Emacs* + +Emacs 是一个跨平台的、既有有图形界面也有命令行界面的软件。它也拥有非常多的特性,更重要的是,可扩展! + +![](https://itsfoss.com/wp-content/uploads/2016/07/emacs.png) + +*Emacs 用户界面* + +像 Vim一样,Emacs 也需要经历一个陡峭的学习路线。但是一旦你掌握了它,你就能完全体会到它的强大。Emacs 可以处理几乎所有类型文本文件。它的界面可以定制以适应你的工作流。它也支持宏记录和快捷键。 + +Emacs 独特的特性是它可以“变形”成和文本编辑器完全不同的的东西。有大量的模块可使它在不同的场景下成为不同的应用,例如:计算器、新闻阅读器、文字处理器等。你甚至都可以在 Emacs 里面玩游戏。 + +### [NANO][5] + +如果说到简易方便的软件,Nano 就是一个。不像 Vim 和 Emacs,nano 的学习曲线是平滑的。 + +如果你仅仅是想创建和编辑一个文本文件,不想给自己找太多挑战,Nano 估计是最适合你的了。 + +![](https://itsfoss.com/wp-content/uploads/2016/07/nano.png) + +*Nano 用户界面* + +Nano 可用的快捷键都在用户界面的下方展示出来了。Nano 仅仅拥有最基础的文本编辑软件的功能。 + +它是非常小巧的,非常适合编辑系统配置文件。对于那些不需要复杂的命令行编辑功能的人来说,Nano 是完美配备。 + +### 其它 + +这里还有一些我想要提及其它编辑器: + +[The Nice Editor (ne)][6]: 官网是这样介绍的: + +> 如果你有足够的资料,也有使用 Emacs 的耐心或使用 Vim 的良好心态,那么 ne 可能不适合你。 + +基本上 ne 拥有像 Vim 和 Emacs 一样多的高级功能,包括:脚本和宏记录。但是它有更为直观的操作方式和平滑的学习路线。 + +### 你认为呢? + +我知道,如果你是一个熟练的 Linux 用户,你可以会说还有很多应该被列入 “Linux 最好的命令行编辑器”清单上。因此我想跟你说,如果你还知道其他的 Linux 命令行文本编辑器,你是否愿意跟我们一同分享? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/command-line-text-editors-linux/ + +作者:[Munif Tanjim][a] +译者:[chenzhijun](https://github.com/chenzhijun) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/munif/ +[1]: https://linux.cn/article-7468-1.html +[2]: http://www.vim.org/ +[3]: https://www.gnu.org/software/emacs/ +[4]: https://itsfoss.com/download-linux-wallpapers-cheat-sheets/ +[5]: http://www.nano-editor.org/ +[6]: http://ne.di.unimi.it/ diff --git a/translated/tech/20160717 BEST TEXT EDITORS FOR LINUX COMMAND LINE.md b/translated/tech/20160717 BEST TEXT EDITORS FOR LINUX COMMAND LINE.md deleted file mode 100644 index fdb8d34098..0000000000 --- a/translated/tech/20160717 BEST TEXT EDITORS FOR LINUX COMMAND LINE.md +++ /dev/null @@ -1,93 +0,0 @@ - -Linux命令行下的优秀文本编辑软件 -========================================== - -![](https://itsfoss.com/wp-content/uploads/2016/07/Best-Command-Line-Text-Editors-for-Linux.jpg) - -文本编辑软件在任何操作系统上都是必备的软件。我们不缺乏在 Linux 上非常现代化的编辑软件,但是他们都是基于 GUI (图形界面)的编辑软件。 - -正如你所了解的,Linux 真正的魅力在于命令行。另外当你正在用命令行工作时,你可能需要一个可以在控制台窗口就可以运行的文本编辑器。 - -正因为这个目的,我们准备了一个基于 Linux 命令行的文本编辑器清单。 - -### [VIM][2] - -如果你已经使用 Linux 有一段时间,那么你肯定听到过 Vim 。Vim 是一个高可配、跨平台、高效率的文本编辑器。 - -几乎所有的 Linux 发行版本都已经内置了 Vim ,由于它的丰富特性已经变得非常流行的。 - -![](https://itsfoss.com/wp-content/uploads/2016/07/vim.png) ->Vim 用户窗口 - -Vim 可能会让第一次使用它的人感到非常痛苦。我记得我第一次尝试使用 Vim 编辑一个文本文件时,我是非常困惑的。我不能用 Vim 输入一个字母,更有趣的是,我甚至不知道该怎么关闭它。如果你准备使用 Vim ,你需要有决心跨过一个曲折的学习路线。 - -一旦你经历过那些,通过梳理一些文档,记住它的命令和快捷键,你会发现这段学习经历是非常值得的。你可以将 Vim 按照你的意愿进行改造--配置一个让你看起来舒服的界面,通过使用脚本或者插件等来提高工作效率。Vim 支持语句高亮,宏记录和操作记录。 - -在Vim官网上,它是这样介绍的: - ->**Vim: The power tool for everyone!** - -如何使用它完全取决于你。你可以仅仅使用它作为文本编辑器,或者你可以将它打造成一个完善的IDE( Integrated Development Environment:集成开发环境)。 - -### [GNU EMACS][3] - -GNU Emacs 毫无疑问是一个非常强大的文本编辑器。如果你听说过 Vim 和 Emacs ,你应该知道这两个编辑器都拥有非常忠诚的粉丝基础,并且他们对于文本编辑器的选择非常看重。你也可以在互联网上找到大量关于他们的段子: - -建议阅读 [Download Linux Wallpapers That Are Also Cheat Sheets][4] - -![](https://itsfoss.com/wp-content/uploads/2016/07/vi-emacs-768x426.png) ->Vim vs Emacs - -Emacs 是一个拥有图形界面和命令行界面并且跨平台的软件。它也拥有非常多的特性,更重要的是,它是支持扩展的。 - -![](https://itsfoss.com/wp-content/uploads/2016/07/emacs.png) ->Emacs 用户界面 - -像Vim一样,Emacs 也需要经历一个曲折的学习路线。但是一旦你掌握它,你就能知道它的强大。Emacs可以处理几乎所有类型文本文件。它的界面可以定制成适合你的工作流。它也支持宏记录和快捷键。 - -Emacs 独特的特性是它可以转换成和文本编辑器完全不同的的东西。这里有大量的模块集可是使它在不同的场景下成为不同的应用,例如-计算器,新闻阅读,文字处理器等。你甚至都可以在 Emacs 里面玩游戏。 - -### [NANO][5] - -如果说到简易方便的软件,Nano 就是一个。 不像 Vim 和 Emacs , nano 的学习曲线是平滑的。 - -如果在生活中你仅仅是想创建和编辑一个文本文件,Nano 估计是最适合你的了。 - -![](https://itsfoss.com/wp-content/uploads/2016/07/nano.png) ->Nano 用户界面 - -Nano 可用的快捷键都在用户界面的下方展示出来了。Nano 仅仅拥有最基础的文本编辑软件的功能。 - -它非常小巧并且非常适合编辑系统和配置文件。对于那些不需要命令行编辑器功能的人来说,Nano是完美配备。 - -### 其它 -这里还有一些我想要提及其它编辑器: - -[The Nice Editor (ne)][6]: 官网是这样介绍的: - ->如果你有相关的资源或者耐心来使用 Emacs 或者正确的心理准备来使用 Vim ,那么 ne 可能不适合你。 - -基本上 ne 拥有像 Vim 和 Emacs 一样多的先进功能,包括--脚本和宏记录。但是它有更为直观的操作方式和平滑的学习路线。 - - -### 你认为呢? - -我知道如果你是一个熟练的 Linux 用户,你可以会说上面列举的 Linux 最好的命令行编辑器清单上的候选者都是非常明显的。因此我想跟你说,如果你还知道其他的 Linux 命令行文本编辑器你是否愿意跟我们一同分享? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/command-line-text-editors-linux/?utm_source=newsletter&utm_medium=email&utm_campaign=ubuntu_forums_hacked_new_skype_for_linux_and_more_linux_stories - -作者:[Munif Tanjim][a] -译者:[chenzhijun](https://github.com/chenzhijun) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/munif/ -[1]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/ -[2]: http://www.vim.org/ -[3]: https://www.gnu.org/software/emacs/ -[4]: https://itsfoss.com/download-linux-wallpapers-cheat-sheets/ -[5]: http://www.nano-editor.org/ -[6]: http://ne.di.unimi.it/ From 33a0fa95c2247f393d6dc725a98b51121fb2bdc0 Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 11 Aug 2016 15:07:17 +0800 Subject: [PATCH 1406/1469] =?UTF-8?q?20190811-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...160809 How to build your own Git server.md | 223 ++++++++++++++++++ 1 file changed, 223 insertions(+) create mode 100644 sources/tech/20160809 How to build your own Git server.md diff --git a/sources/tech/20160809 How to build your own Git server.md b/sources/tech/20160809 How to build your own Git server.md new file mode 100644 index 0000000000..ac5b229d96 --- /dev/null +++ b/sources/tech/20160809 How to build your own Git server.md @@ -0,0 +1,223 @@ +How to build your own Git server +==================== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/bus-big-data.png?itok=sOQHDuID) + +Now we will learn how to build a Git server, and how to write custom Git hooks to trigger specific actions on certain events (such as notifications), and publishing your code to a website. + +Up until now, the focus has been interacting with Git as a user. In this article I'll discuss the administration of Git, and the design of a flexible Git infrastructure. You might think it sounds like a euphemism for "advanced Git techniques" or "only read this if you're a super-nerd", but actually none of these tasks require advanced knowledge or any special training beyond an intermediate understanding of how Git works, and in some cases a little bit of knowledge about Linux. + +### Shared Git server + +Creating your own shared Git server is surprisingly simple, and in many cases well worth the trouble. Not only does it ensure that you always have access to your code, it also opens doors to stretching the reach of Git with extensions such as personal Git hooks, unlimited data storage, and continuous integration and deployment. + +If you know how to use Git and SSH, then you already know how to create a Git server. The way Git is designed, the moment you create or clone a repository, you have already set up half the server. Then enable SSH access to the repository, and anyone with access can use your repo as the basis for a new clone. + +However, that's a little ad hoc. With some planning a you can construct a well-designed Git server with about the same amount of effort, but with better scalability. + +First things first: identify your users, both current and in the future. If you're the only user then no changes are necessary, but if you intend to invite contributors aboard, then you should allow for a dedicated shared system user for your developers. + +Assuming that you have a server available (if not, that's not exactly a problem Git can help with, but CentOS on a Raspberry Pi 3 is a good start), then the first step is to enable SSH logins using only SSH key authorization. This is much stronger than password logins because it is immune to brute-force attacks, and disabling a user is as simple as deleting their key. + +Once you have SSH key authorization enabled, create the gituser. This is a shared user for all of your authorized users: + +``` +$ su -c 'adduser gituser' +``` + +Then switch over to that user, and create an ~/.ssh framework with the appropriate permissions. This is important, because for your own protection SSH will default to failure if you set the permissions too liberally. + +``` +$ su - gituser +$ mkdir .ssh && chmod 700 .ssh +$ touch .ssh/authorized_keys +$ chmod 600 .ssh/authorized_keys +``` + +The authorized_keys file holds the SSH public keys of all developers you give permission to work on your Git project. Your developers must create their own SSH key pairs and send you their public keys. Copy the public keys into the gituser's authorized_keys file. For instance, for a developer called Bob, run these commands: + +``` +$ cat ~/path/to/id_rsa.bob.pub >> \ +/home/gituser/.ssh/authorized_keys +``` + +As long as developer Bob has the private key that matches the public key he sent you, Bob can access the server as gituser. + +However, you don't really want to give your developers access to your server, even if only as gituser. You only want to give them access to the Git repository. For this very reason, Git provides a limited shell called, appropriately, git-shell. Run these commands as root to add git-shell to your system, and then make it the default shell for your gituser: + +``` +# grep git-shell /etc/shells || su -c \ +"echo `which git-shell` >> /etc/shells" +# su -c 'usermod -s git-shell gituser' +``` + +Now the gituser can only use SSH to push and pull Git repositories, and cannot access a login shell. You should add yourself to the corresponding group for the gituser, which in our example server is also gituser. + +For example: + +``` +# usermod -a -G gituser seth +``` + +The only step remaining is to make a Git repository. Since no one is going to interact with it directly on the server (that is, you're not going to SSH to the server and work directly in this repository), make it a bare repository. If you want to use the repo on the server to get work done, you'll clone it from where it lives and work on it in your home directory. + +Strictly speaking, you don't have to make this a bare repository; it would work as a normal repo. However, a bare repository has no *working tree* (that is, no branch is ever in a `checkout` state). This is important because remote users are not permitted to push to an active branch (how would you like it if you were working in a `dev` branch and suddenly someone pushed changes into your workspace?). Since a bare repo can have no active branch, that won't ever be an issue. + +You can place this repository anywhere you please, just as long as the users and groups you want to grant permission to access it can do so. You do NOT want to store the directory in a user's home directory, for instance, because the permissions there are pretty strict, but in a common shared location, such as /opt or /usr/local/share. + +Create a bare repository as root: + +``` +# git init --bare /opt/jupiter.git +# chown -R gituser:gituser /opt/jupiter.git +# chmod -R 770 /opt/jupiter.git +``` + +Now any user who is either authenticated as gituser or is in the gituser group can read from and write to the jupiter.git repository. Try it out on a local machine: + +``` +$ git clone gituser@example.com:/opt/jupiter.git jupiter.clone +Cloning into 'jupiter.clone'... +Warning: you appear to have cloned an empty repository. +``` + +Remember: developers MUST have their public SSH key entered into the authorized_keys file of gituser, or if they have accounts on the server (as you would), then they must be members of the gituser group. + +### Git hooks + +One of the nice things about running your own Git server is that it makes Git hooks available. Git hosting services sometimes provide a hook-like interface, but they don't give you true Git hooks with access to the file system. A Git hook is a script that gets executed at some point during a Git process; a hook can be executed when a repository is about to receive a commit, or after it has accepted a commit, or before it receives a push, or after a push, and so on. + +It is a simple system: any executable script placed in the .git/hooks directory, using a standard naming scheme, is executed at the designated time. When a script should be executed is determined by the name; a pre-push script is executed before a push, a post-receive script is executed after a commit has been received, and so on. It's more or less self-documenting. + +Scripts can be written in any language; if you can execute a language's hello world script on your system, then you can use that language to script a Git hook. By default, Git ships with some samples but does not have any enabled. + +Want to see one in action? It's easy to get started. First, create a Git repository if you don't already have one: + +``` +$ mkdir jupiter +$ cd jupiter +$ git init . +``` + +Then write a "hello world" Git hook. Since I use tcsh at work for legacy support, I'll stick with that as my scripting language, but feel free to use your preferred language (Bash, Python, Ruby, Perl, Rust, Swift, Go) instead: + +``` +$ echo "#\!/bin/tcsh" > .git/hooks/post-commit +$ echo "echo 'POST-COMMIT SCRIPT TRIGGERED'" >> \ +~/jupiter/.git/hooks/post-commit +$ chmod +x ~/jupiter/.git/hooks/post-commit +``` + +Now test it out: + +``` +$ echo "hello world" > foo.txt +$ git add foo.txt +$ git commit -m 'first commit' +! POST-COMMIT SCRIPT TRIGGERED +[master (root-commit) c8678e0] first commit +1 file changed, 1 insertion(+) +create mode 100644 foo.txt +``` + +And there you have it: your first functioning Git hook. + +### The famous push-to-web hook + +A popular use of Git hooks is to automatically push changes to a live, in-production web server directory. It is a great way to ditch FTP, retain full version control of what is in production, and integrate and automate publication of content. + +If done correctly, it works brilliantly and is, in a way, exactly how web publishing should have been done all along. It is that good. I don't know who came up with the idea initially, but the first I heard of it was from my Emacs- and Git- mentor, Bill von Hagen at IBM. His article remains the definitive introduction to the process: [Git changes the game of distributed Web development][1]. + +### Git variables + +Each Git hook gets a different set of variables relevant to the Git action that triggered it. You may or may not need to use those variables; it depends on what you're writing. If all you want is a generic email alerting you that someone pushed something, then you don't need specifics, and probably don't even need to write the script as the existing samples may work for you. If you want to see the commit message and author of a commit in that email, then your script becomes more demanding. + +Git hooks aren't run by the user directly, so figuring out how to gather important information can be confusing. In fact, a Git hook script is just like any other script, accepting arguments from stdin in the same way that BASH, Python, C++, and anything else does. The difference is, we aren't providing that input ourselves, so to use it you need to know what to expect. + +Before writing a Git hook, look at the samples that Git provides in your project's .git/hooks directory. The pre-push.sample file, for instance, states in the comments section: + +``` +# $1 -- Name of the remote to which the push is being done +# $2 -- URL to which the push is being done +# If pushing without using a named remote those arguments will be equal. +# +# Information about commit is supplied as lines +# to the standard input in this form: +# +``` + +Not all samples are that clear, and documentation on what hook gets what variable is still a little sparse (unless you want to read the source code of Git), but if in doubt, you can learn a lot from the [trials of other users][2] online, or just write a basic script and echo $1, $2, $3, and so on. + +### Branch detection example + +I have found that a common requirement in production instances is a hook that triggers specific events based on what branch is being affected. Here is an example of how to tackle such a task. + +First of all, Git hooks are not, themselves, version controlled. That is, Git doesn't track its own hooks because a Git hook is part of Git, not a part of your repository. For that reason, a Git hook that oversees commits and pushes probably make most sense living in a bare repository on your Git server, rather than as a part of your local repositories. + +Let's write a hook that runs upon post-receive (that is, after a commit has been received). The first step is to identify the branch name: + +``` +#!/bin/tcsh + +foreach arg ( $< ) + set argv = ( $arg ) + set refname = $1 +end +``` + +This for-loop reads in the first arg ($1) and then loops again to overwrite that with the value of the second ($2), and then again with the third ($3). There is a better way to do that in Bash: use the read command and put the values into an array. However, this being tcsh and the variable order being predictable, it's safe to hack through it. + +When we have the refname of what is being commited, we can use Git to discover the human-readable name of the branch: + +``` +set branch = `git rev-parse --symbolic --abbrev-ref $refname` +echo $branch #DEBUG +``` + +And then compare the branch name to the keywords we want to base the action on: + +``` +if ( "$branch" == "master" ) then + echo "Branch detected: master" + git \ + --work-tree=/path/to/where/you/want/to/copy/stuff/to \ + checkout -f $branch || echo "master fail" +else if ( "$branch" == "dev" ) then + echo "Branch detected: dev" + Git \ + --work-tree=/path/to/where/you/want/to/copy/stuff/to \ + checkout -f $branch || echo "dev fail" + else + echo "Your push was successful." + echo "Private branch detected. No action triggered." +endif +``` + +Make the script executable: + +``` +$ chmod +x ~/jupiter/.git/hooks/post-receive +``` + +Now when a user commits to the server's master branch, the code is copied to an in-production directory, a commit to the dev branch get copied someplace else, and any other branch triggers no action. + +It's just as simple to create a pre-commit script that, for instance, checks to see if someone is trying to push to a branch that they should not be pushing to, or to parse commit messages for approval strings, and so on. + +Git hooks can get complex, and they can be confusing due to the level of abstraction that working through Git imposes, but they're a powerful system that allows you to design all manner of actions in your Git infrastructure. They're worth dabbling in, if only to become familiar with the process, and worth mastering if you're a serious Git user or full-time Git admin. + +In our next and final article in this series, we will learn how to use Git to manage non-text binary blobs, such as audio and graphics files. + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/16/8/how-construct-your-own-git-server-part-6 + +作者:[Seth Kenlon][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[1]: http://www.ibm.com/developerworks/library/wa-git/ +[2]: https://www.analysisandsolutions.com/code/git-hooks-summary-cheat-sheet.htm From ae223bd445cb4abb5a0e70d8aba0b3296b7bcf1e Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 11 Aug 2016 15:12:55 +0800 Subject: [PATCH 1407/1469] =?UTF-8?q?20160811-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../talk/20160809 7 reasons to love Vim.md | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 sources/talk/20160809 7 reasons to love Vim.md diff --git a/sources/talk/20160809 7 reasons to love Vim.md b/sources/talk/20160809 7 reasons to love Vim.md new file mode 100644 index 0000000000..868a1f5773 --- /dev/null +++ b/sources/talk/20160809 7 reasons to love Vim.md @@ -0,0 +1,46 @@ +7 reasons to love Vim +==================== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BUS_OpenSourceExperience_520x292_cm.png?itok=APna2N9Y) + +When I started using the vi text editor, I hated it. I thought it was the most painful and counter-intuitive editor ever designed. But I'd decided I had to learn the thing, because if you're using Unix, vi was everywhere and was the only editor you were guaranteed to have access to. That was back in 1998, but it remains true today—vi is available, usually as part of the base install, on almost every Linux distribution in existence. + +It took about a month before I could do anything with any proficiency in vi and I still didn't love it, but by then I'd realized that there was an insanely powerful editor hiding behind this bizarre facade. So I stuck with it, and eventually found out that once you know what you're doing, it's an incredibly fast editor. + +The name "vi" is short for "visual." When vi originated, line editing was the norm and being able to display and edit multiple lines at once was unusual. Vim, a contraction of "Vi IMproved" and originally released by Bram Moolenaar in 1991, has become the dominant vi clone and continued to extend the capabilities of an already powerful editor. Vim's powerful regex and ":" command-line syntax started in the world of line editing and teletypes. + +Vim, with its 40 years of history, has had time to develop a massive and complex bag of tricks that even the most knowledgeable users don't fully grasp. Here are a few reasons to love Vim: + +1. Colour schemes: You probably know Vim has colour syntax highlighting. Did you know you can download literally hundreds of colour schemes? [Find some of the better ones here][1]. +2. You never need to take your hands off the keyboard or reach for the mouse. +3. Vi or Vim is everywhere. Even [OpenWRT][2] has vi (okay, it's [BusyBox][3], but it works). +4. Vimscript: You've probably remapped a few keys, but did you know that Vim has its own programming language? You can rewrite the behaviour of your editor, or create language-specific editor extensions. (Recently I've spent time customizing Vim's behaviour with Ansible.) The best entry point to the language is Steve Losh's brilliant [Learn Vimscript the Hard Way][4]. +5. Vim has plugins. Use [Vundle][5] (my choice) or [Pathogen][6] to manage your plugins to improve Vim's capabilities. +6. Plugins to integrate git (or your VCS of choice) into Vim are available. +7. The online community is huge and active, and if you ask your question about Vim online, it will be answered. + +The irony of my original hatred of vi is that I'd been bouncing from editor to editor for five years, always looking for "something better." I never hated any editor as much as I hated vi, and now I've stuck with it for 17 years because I can no longer imagine a better editor. Well, maybe a little better: Go try Neovim—it's the future. It looks like Bram Moolenaar will be merging most of Neovim into Vim version 8, which will mean a 30% reduction in the code base, better tab completion, real async, built-in terminal, built-in mouse support, and complete compatibility. + +In his [LinuxCon talk][7] in Toronto, Giles will explain some of the features you may have missed in the welter of extensions and improvements added in the past four decades. The class isn't for beginners, so if you don't know why "hjklia:wq" are important, this probably isn't the talk for you. He'll also cover a bit about the history of vi, because knowing some history helps to understand how we've ended up where we are now. Attend his talk to find out how to make your favourite editor better and faster. + + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/business/16/8/7-reasons-love-vim + +作者:[Giles Orr][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/gilesorr +[1]: http://www.gilesorr.com/blog/vim-colours.html +[2]: https://www.openwrt.org/ +[3]: https://busybox.net/ +[4]: http://learnvimscriptthehardway.stevelosh.com/ +[5]: https://github.com/VundleVim/Vundle.vim +[6]: https://github.com/tpope/vim-pathogen +[7]: http://sched.co/7JWz From 365cb7cac015fa4e806abaa9ac9034e9a9ecce83 Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 11 Aug 2016 15:19:43 +0800 Subject: [PATCH 1408/1469] =?UTF-8?q?20160811-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...n to Linux containers and image signing.md | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 sources/tech/20160810 A brief introduction to Linux containers and image signing.md diff --git a/sources/tech/20160810 A brief introduction to Linux containers and image signing.md b/sources/tech/20160810 A brief introduction to Linux containers and image signing.md new file mode 100644 index 0000000000..c91eab815f --- /dev/null +++ b/sources/tech/20160810 A brief introduction to Linux containers and image signing.md @@ -0,0 +1,62 @@ +A brief introduction to Linux containers and image signing +==================== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/containers_2015-1-osdc-lead.png?itok=E1imOYe4) + +Fundamentally, all major software, even open source, was designed before image-based containers. This means that putting software inside of containers is fundamentally a platform migration. This also means that some programs are easy to migrate into containers, [while others are more difficult][1]. + +I started working with image-based containers nearly 3.5 years ago. In this time I have containerized a ton of applications. I have learned what's real, and what is superstition. Today, I'd like to give a brief introduction to how Linux containers are designed and talk briefly about image signing. + +### How Linux containers are designed + +What most people find confusing about the image based Linux containers, is that it's really about breaking an operating system into two parts: [the kernel and the user space][2]. In a traditional operating system, the kernel runs on the hardware and you never interact with it directly. The user space is what you actually interact with and this includes all the files, libraries, and programs that you see when you look at a file browser or run the ls command. When you use the ifconfig command to change an IP address, you are actually leveraging a user space program to make kernel changes to the TCP stack. This often blows people's minds if they haven't studied [Linux/Unix fundamentals][3]. + +Historically, the libraries in the user space supported programs that interacted with the kernel (ifconfig, sysctl, tuned-adm) and user-facing programs such as web servers or databases. Everything was dumped together in a single filesystem hierarchy. Users could inspect the /sbin or /lib directories and see all of the applications and libraries that support the operating system itself, or inspect the /usr/sbin or /usr/lib directory to see all of the user-facing programs and libraries (Check out the [Filesystem Hierarchy Standard][4]). The problem with this model was that there was never complete isolation between operating system programs and business supporting applications. Programs in /usr/bin might rely on libraries which live in /lib. If an application owner needed to change something, it could break the operating system. Conversely, if the team in charge of doing security updates needed to change a library, it could (and often did) break business facing applications. It was a mess. + +With image-based containers such as Docker, LXD, and RKT, an application owner can package and modify all of the dependencies in /sbin, /lib, /usr/bin, and /usr/lib without worrying about breaking the underlying operating system. Essentially, using image-based containers cleanly isolates the operating system into two parts, again, the kernel and the user space. Now dev and ops can update things independently of each other, kinda... + +There is some serous confusion though. Often, each application owner (or developer) doesn't want to be responsible for updating application dependencies such as openssl, glibc, or hardening underlying components, such as XML parsers, or JVMs, or dealing with performance settings. Historically, these problems were delegated to the operations team. Since we are packing a lot of dependencies in the container, the delegation of responsibility for all of the pieces in the container is still a real problem for many organizations. + +### Migrating existing applications to Linux containers + +Putting software inside of containers is basically a platform migration. I'd like to highlight what makes this difficult to migrate some applications into containers. + +Developers now have complete control over what's in /sbin, /lib, /usr/bin, and /usr/lib. But, one of the challenges they have is, they still need to put data and configuration in folders such as /etc or /var/lib. With image-based containers, this is a bad idea. We really want good separation of code, configuration, and data. We want the developers to provide the code in the container, but we want the data and configuration to come from the environment, e.g. development, testing, or production. + +This means we need to mount some files from /etc or directories from /var/lib when we (or better, the platform) instantiate a container. This will allow us to move the containers around and still get its configuration and data from the environment. Cool, right? Well, there is a problem, that means we have to be able to isolate configuration and data cleanly. Many modern open source programs like Apache, MySQL, MongoDB, or Nginx do this by default, [but many home-grown, legacy, or proprietary programs are not designed to do this by default][5]. This is a major pain point for many organizations. A best practice for developers would be to start architecting new applications and migrating legacy code so that configuration and data are cleanly isolated. + +### Introduction to image signing + +Trust is a major issue with containers. Container image signing allows a user to add a digital fingerprint to an image. This fingerprint can later be cryptographically tested to verify trust. This allows the user of a container image to verify the source and trust the container image. + +The container community uses the words “container image" quite a lot, but this nomenclature can be quite confusing. Docker, LXD, and RKT operate on the concept of pulling remote files and running them as a container. Each of these technologies treats containers images in different ways. LXD pulls a single container image with a single layer, while Docker and RKT use Open Container Image (OCI)-based images which can be made up of multiple layers. Worse, different teams or even organization may be responsible for different layers of a container image. Implicit in the concept of a container image is the concept of a Container Image Format. Having a standard image format such as OCI will allow an ecosystem to flourish around container scanning, signing, and movement between cloud providers. + +Now on to signing. + +One of the problems with containers is we package a bunch of code, binaries, and libraries into a container image. Once we package the code, we share it with essentially fancy file servers which we call Registry Servers. Once the code is shared, it is basically anonymous without some form of cryptographic signing. Worse yet, container images are often made up of image layers which are controlled by different people or teams of people. Each team needs to have the ability to check the last team's work, add their work, and then put their stamp of approval on it. They then need to send it on to the next team. + +The final user of the container image (really made up of multiple images) really needs to check the chain of custody. They need to verify trust with every team that added files to the container image. It is critical for end users to have confidence about every single layer of the container image. + +Scott McCarty will give a talk called [Containers for Grownups: Migrating Traditional & Existing Applications][6] at ContainerCon on August 24. Talk attendees will gain a new understanding of how containers work, and be able to leverage their current architectural knowledge to the world of containers. He will teach attendees which applications are easy to put in containers and why, and he'll explain which types of programs are more difficult and why. He will provide tons of examples and help attendees gain confidence in building and migrating their own applications into containers. + + + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/bus/16/8/introduction-linux-containers-and-image-signing + +作者:[Scott McCarty][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/fatherlinux +[1]: http://rhelblog.redhat.com/2016/04/21/architecting-containers-part-4-workload-characteristics-and-candidates-for-containerization/ +[2]: http://rhelblog.redhat.com/2015/07/29/architecting-containers-part-1-user-space-vs-kernel-space/ +[3]: http://rhelblog.redhat.com/tag/architecting-containers/ +[4]: https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard +[5]: http://rhelblog.redhat.com/2016/04/21/architecting-containers-part-4-workload-characteristics-and-candidates-for-containerization/ +[6]: https://lcccna2016.sched.org/event/7JUc/containers-for-grownups-migrating-traditional-existing-applications-scott-mccarty-red-hat From 2287cdd1af0867418817bd867fded6f2d785b50e Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 11 Aug 2016 16:04:15 +0800 Subject: [PATCH 1409/1469] PUB:20160621 Flatpak brings standalone apps to Linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @zky001 翻译应该再细心一些,并自己通读几遍。 --- ...Flatpak brings standalone apps to Linux.md | 35 ++++++++++++++++++ ...Flatpak brings standalone apps to Linux.md | 36 ------------------- 2 files changed, 35 insertions(+), 36 deletions(-) create mode 100644 published/20160621 Flatpak brings standalone apps to Linux.md delete mode 100644 translated/tech/20160621 Flatpak brings standalone apps to Linux.md diff --git a/published/20160621 Flatpak brings standalone apps to Linux.md b/published/20160621 Flatpak brings standalone apps to Linux.md new file mode 100644 index 0000000000..488c404f45 --- /dev/null +++ b/published/20160621 Flatpak brings standalone apps to Linux.md @@ -0,0 +1,35 @@ +Flatpak 为 Linux 带来了独立应用 +================ + +![](https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/flatpak-945x400.jpg) + +[Flatpak][1] 的开发团队[宣布了][2] Flatpak 桌面应用框架已经可用了。 Flatpak (以前在开发时名为 xdg-app)为应用提供了捆绑为一个 Flatpak 软件包的能力,可以让应用在很多 Linux 发行版上都以轻松而一致的体验来安装和运行。将应用程序捆绑成 Flatpak 为其提供了沙盒安全环境,可以将它们与操作系统和彼此之间相互隔离。查看 [Flatpak 网站][3]上的[发布公告][4]来了解关于 Flatpak 框架技术的更多信息。 + +### 在 Fedora 中安装 Flatpak + +如果用户想要运行以 Flatpak 格式打包的应用,在 Fedora 上安装是很容易的,Flatpak 格式已经可以在官方的 Fedora 23 和 Fedora 24 仓库中获得。Flatpak 网站上有[在 Fedora 上安装的完整细节][5],同时也有如何在 Arch、 Debian、Mageia 和 Ubuntu 中安装的方法。[许多的应用][6]已经使用 Flatpak 打包构建了,这包括 LibreOffice、Inkscape 和 GIMP。 + +### 对应用开发者 + +如果你是一个应用开发者,Flatpak 网站也包含许多有关于[使用 Flatpak 打包和分发应用程序][7]的重要资料。这些资料中包括了使用 Flakpak SDK 构建独立的、沙盒化的 Flakpak 应用程序的信息。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/introducing-flatpak/ + +作者:[Ryan Lerch][a] +译者:[zky001](https://github.com/zky001) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/introducing-flatpak/ +[1]: http://flatpak.org/ +[2]: http://flatpak.org/press/2016-06-21-flatpak-released.html +[3]: http://flatpak.org/ +[4]: http://flatpak.org/press/2016-06-21-flatpak-released.html +[5]: http://flatpak.org/getting.html +[6]: http://flatpak.org/apps.html +[7]: http://flatpak.org/developer.html + + diff --git a/translated/tech/20160621 Flatpak brings standalone apps to Linux.md b/translated/tech/20160621 Flatpak brings standalone apps to Linux.md deleted file mode 100644 index cad3fff909..0000000000 --- a/translated/tech/20160621 Flatpak brings standalone apps to Linux.md +++ /dev/null @@ -1,36 +0,0 @@ -翻译中:by zky001 -Flatpak给Linux带来了独立的应用 -=== - -![](https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/flatpak-945x400.jpg) - - -在[Flatpak][1]背后的开发团队已经[刚刚宣布Flatpak作为桌面应用开发框架基本的能力][2]。 Flatpak为一个应用提供了这种能力—提供了一个应用程序的能力,应用程序捆绑为Flatpak 被安装在许多不同的Linux发行版,并且它可以很轻易地运行。应用程序捆绑的Flatpaks也有沙盒安全能力,可以从你的操作系统隔离它们和其他应用程序。查看[Flatpak网站][3],[网站指导手册][4]来获取更多的关于Flatpak框架的技术。 - -### 在Fedora中安装Flatpak - -对于想要以打包格式Flatpaks来运行程序的话,安装在Fedora上是很容易的,Flatpak格式已经可以在官方的Fedora 23和Fedora 24版本源中获得。Flatpak网站有[完整的在Fedora上安装的细节][5],同时也有如何在Arch, Debian,Mageia,和Ubuntu中安装的方法。[许多的应用][6]已经使用Flatpak来进行打包构建的程序-包括LibreOffice,Inkscape和GIMP。 -### 对应用开发者 - -如果你是一个应用开发者,Flatpak网站也包含许多有关于[使用Flatpak打包和分发应用程序][7]的优秀资源。这些资源包括了使用Flakpak SDKs来构建独立的,沙河的Flakpak应用程序。 - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/introducing-flatpak/ - -作者:[Ryan Lerch][a] -译者:[zky001](https://github.com/zky001) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/introducing-flatpak/ -[1]: http://flatpak.org/ -[2]: http://flatpak.org/press/2016-06-21-flatpak-released.html -[3]: http://flatpak.org/ -[4]: http://flatpak.org/press/2016-06-21-flatpak-released.html -[5]: http://flatpak.org/getting.html -[6]: http://flatpak.org/apps.html -[7]: http://flatpak.org/developer.html - - From d5f08e4b6256b56510898df7b7be7c4ba73e0b50 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 11 Aug 2016 21:12:39 +0800 Subject: [PATCH 1410/1469] PUB:20151208 6 creative ways to use ownCloud MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @GHLandy 翻译的不错。 --- ...0151208 6 creative ways to use ownCloud.md | 96 +++++++++++++++++++ ...0151208 6 creative ways to use ownCloud.md | 95 ------------------ 2 files changed, 96 insertions(+), 95 deletions(-) create mode 100644 published/20151208 6 creative ways to use ownCloud.md delete mode 100644 translated/talk/yearbook2015/20151208 6 creative ways to use ownCloud.md diff --git a/published/20151208 6 creative ways to use ownCloud.md b/published/20151208 6 creative ways to use ownCloud.md new file mode 100644 index 0000000000..02824a4255 --- /dev/null +++ b/published/20151208 6 creative ways to use ownCloud.md @@ -0,0 +1,96 @@ +ownCloud 的六大神奇用法 +================================================================================ + +![Yearbook cover 2015](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/osdc-open-source-yearbook-lead1-inc0335020sw-201511-01.png) + +(图片来源:Opensource.com) + +[ownCloud][1] 是一个自行托管的开源文件同步和共享服务器。就像“行业老大” Dropbox、Google Drive、Box 和其他的同类服务一样,ownCloud 也可以让你访问自己的文件、日历、联系人和其他数据。你可以在自己设备之间同步任意数据(或部分数据)并分享给其他人。然而,ownCloud 要比其它的商业解决方案更棒,可以[将 ownCloud 运行在自己的服务器][2]而不是其它人的服务器上。 + +现在,让我们一起来看看在 ownCloud 上的六个创造性的应用方式。其中一些是由于 ownCloud 的开源才得以完成,而另外的则是 ownCloud 自身特有的功能。 + +### 1. 可扩展的 ownCloud “派”集群 ### + +由于 ownCloud 是开源的,你可以选择将它运行在自己的服务器中,或者从你信任的服务商那里获取空间——没必要将你的文件存储在那些大公司的服务器中,谁知他们将你的文件存储到哪里去。[点击此处查看部分 ownCloud 服务商][3],或者下载该服务软件到你的虚拟主机中[搭建自己的服务器][4]. + +![](https://opensource.com/sites/default/files/images/life-uploads/banana-pi-owncloud-cluster.jpg) + +*拍摄: Jörn Friedrich Dreyer. [CC BY-SA 4.0.][5]* + +我们见过最具创意的事情就是架设[香蕉派集群][6]和[树莓派集群][7]。ownCloud 的扩展性通常用于支持成千上万的用户,但有些人则将它往不同方向发展,通过将多个微型系统集群在一起,就可以创建出运行速度超快的 ownCloud。酷毙了! + +### 2. 密码同步 ### + +为了让 ownCloud 更容易扩展,我们将它变得超级的模块化,甚至还有一个 [ownCloud 应用商店][8]。你可以在里边找到音乐和视频播放器、日历、联系人、生产力应用、游戏、应用模板(sketching app)等等。 + +从近 200 多个应用中仅挑选一个是一件非常困难的事,但密码管理则是一个很独特的功能。只有不超过三个应用提供这个功能:[Passwords][9]、[Secure Container][10] 和 [Passman][11]。 + +![](https://opensource.com/sites/default/files/images/life-uploads/password.png) + +### 3. 随心所欲地存储文件 ### + +外部存储可以让你将现有数据挂载到 ownCloud 上,让你通过一个界面来访问存储在 FTP、WebDAV、Amazon S3,甚至 Dropbox 和 Google Drive 的文件。 + +注:youtube 视频 + + +行业老大们喜欢创建自己的 “藩篱花园”,Box 的用户只能和其它的 Box 用户协作;假如你想从 Google Drive 分享你的文件,你的同伴也必须要有一个 Google 账号才可以访问的分享。通过 ownCloud 的外部存储功能,你可以轻松打破这些。 + +最有创意的就是把 Google Drive 和 Dropbox 添加为外部存储。这样你就可以无缝连接它们,通过一个简单的链接即可分享给其它人——并不需要账户。 + +### 4. 获取上传的文件 ### + +由于 ownCloud 是开源开,人们可以不受公司需求的制约而向它贡献感兴趣的功能。我们的贡献者总是很在意安全和隐私,所以 ownCloud 引入的通过密码保护公共链接并[设置失效期限][12]的功能要比其它人早很多。 + +现在,ownCloud 可以配置分享链接的读写权限了,这就是说链接的访问者可以无缝的编辑你分享给他们的文件(可以有密码保护,也可以没有),或者将文件上传到服务器前不用强制他们提供私人信息来注册服务。 + +注:youtube 视频 + + +对于有人想给你分享大体积的文件时,这个特性就非常有用了。相比于上传到第三方站点、然后给你发送一个连接、你再去下载文件(通常需要登录),ownCloud 仅需要上传文件到你提供的分享文件夹,你就可以马上获取到文件了。 + +### 5. 免费却又安全的存储空间 ### + +之前就强调过,我们的代码贡献者最关注的就是安全和隐私,这就是 ownCloud 中有用于加密和解密存储数据的应用的原因。 + +通过使用 ownCloud 将你的文件存储到 Dropbox 或者 Google Drive,则会违背夺回数据的控制权并保持数据隐私的初衷。但是加密应用则可以改变这个状况。在发送数据给这些提供商前进行数据加密,并在取回数据的时候进行解密,你的数据就会变得很安全。 + +### 6. 在你的可控范围内分享文件 ### + +作为开源项目,ownCloud 没有必要自建 “藩篱花园”。通过“联邦云共享(Federated Cloud Sharing)”:这个[由 ownCloud 开发和发布的][13]协议使不同的文件同步和共享服务器可以彼此之间进行通信,并能够安全地传输文件。联邦云共享本身来自一个有趣的事情:有 [22 所德国大学][14] 想要为自身的 50 万名学生建立一个庞大的云服务,但是每个大学都想控制自己学生的数据。于是乎,我们需要一个创造性的解决方案:也就是联邦云服务。该解决方案可以连接全部的大学,使得学生们可以无缝的协同工作。同时,每个大学的系统管理员保持着对自己学生创建的文件的控制权,并可采用自己的策略,如限制限额,或者限制什么人、什么文件以及如何共享。 + +注:youtube 视频 + + +并且,这项神奇的技术并没有限制于德国的大学之间,每个 ownCloud 用户都能在自己的用户设置中找到自己的[联邦云 ID][15],并将之分享给同伴。 + +现在你明白了吧。通过这六个方式,ownCloud 就能让人们做一些特殊而独特的事。而使这一切成为可能的,就是 ownCloud 是开源的,其设计目标就是让你的数据自由。 + +你有其它的 ownCloud 的创意用法吗?请发表评论让我们知道。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/15/12/6-creative-ways-use-owncloud + +作者:[Jos Poortvliet][a] +译者:[GHLandy](https://github.com/GHLandy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/jospoortvliet +[1]:https://owncloud.com/ +[2]:https://blogs.fsfe.org/mk/new-stickers-and-leaflets-no-cloud-and-e-mail-self-defense/ +[3]:https://owncloud.org/providers +[4]:https://owncloud.org/install/#instructions-server +[5]:https://creativecommons.org/licenses/by-sa/4.0/ +[6]:http://www.owncluster.de/ +[7]:https://christopherjcoleman.wordpress.com/2013/01/05/host-your-owncloud-on-a-raspberry-pi-cluster/ +[8]:https://apps.owncloud.com/ +[9]:https://apps.owncloud.com/content/show.php/Passwords?content=170480 +[10]:https://apps.owncloud.com/content/show.php/Secure+Container?content=167268 +[11]:https://apps.owncloud.com/content/show.php/Passman?content=166285 +[12]:https://owncloud.com/owncloud45-community/ +[13]:http://karlitschek.de/2015/08/announcing-the-draft-federated-cloud-sharing-api/ +[14]:https://owncloud.com/customer/sciebo/ +[15]:https://owncloud.org/federation/ diff --git a/translated/talk/yearbook2015/20151208 6 creative ways to use ownCloud.md b/translated/talk/yearbook2015/20151208 6 creative ways to use ownCloud.md deleted file mode 100644 index 5d81ed9cdf..0000000000 --- a/translated/talk/yearbook2015/20151208 6 creative ways to use ownCloud.md +++ /dev/null @@ -1,95 +0,0 @@ -GHLandy Translated - -使用 ownCloud 的六个创意方法 -================================================================================ -![Yearbook cover 2015](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/osdc-open-source-yearbook-lead1-inc0335020sw-201511-01.png) - -图片来源:Opensource.com - -[ownCloud][1] 是一个自我托管且开源的文件同步和共享服务上。就像 "big boys" Dropbox、Google Drive、Box 和其他的同类服务一样,ownCloud 可以让你访问自己的文件、日历、联系人和其他数据。你可以在自己设备之间进行任意数据(包括它自身的一部分)同步以及给其他人分享文件。然而,ownCloud 并非只能运行在它自己的开发商之中,试试[将 ownCloud 运行在其他服务器上][2] - -现在,一起来看看在 ownCloud 上的六件创意事件。其中一些是由于 ownCloud 的开源才得以完成,而另外的则是 ownCloud 自身特有的功能。 - -### 1. 可扩展的 ownCloud 派集群 ### - -由于 ownCloud 是开源的,你可以选择将它运行在自己的服务器中,或者从你信任的服务器提供商那里获取空间——没必要将你的文件存储在大公司的服务器中,谁知他们将你的文件存储到哪里去。[点击此处查看部分 ownCloud 服务商][3],或者下载该服务软件到你的虚拟主机中[搭建自己的服务器][4]. - -![](https://opensource.com/sites/default/files/images/life-uploads/banana-pi-owncloud-cluster.jpg) - -拍摄: Jörn Friedrich Dreyer. [CC BY-SA 4.0.][5] - -我们见过最具创意的事情就是组建 [香蕉派集群][6] 和 [树莓派集群][7]。ownCloud 的扩展性通常是成千上万的用户来完成的,这些人则将它往不同方向发展,通过大量的小型系统集群在一起,就可以创建出运行速度非常快的 ownCloud。酷毙了! - -### 2. 密码同步 ### - -为了让 ownCloud 更容易扩展,我们需要将它模块化,并拥有 [ownCloud app store][8]。然后你就可以在里边搜索音乐、视频播放器、日历、联系人、生产应用、游戏、应用框架等。 - -仅从 200 多个可用应用中挑选一个是一件非常困难的事,但密码管理则是一个很好的特性。ownCloud app store 里边至少有三款这种应用:[Passwords][9]、[Secure Container][10] 和 [Passman][11]。 - -![](https://opensource.com/sites/default/files/images/life-uploads/password.png) - -### 3. 随心所欲地存储文件 ### - -外部存储允许你通过接口将现有数据联系到 ownCloud,让你轻松访问存储在FTP、WebDAV、Amazon S3,甚至 Dropbox 和Google Drive。 - -注:youtube 视频 - - -DropBox 喜欢创建自己的 “围墙式花园”,只有注册用户之间才可以进行协作;假如你通过Google Drive 来分享文件,你的同伴也必须要有一个 Google 账号才可以访问的分享。通过 ownCloud 的外部存储功能,你可以轻松打破这些规则障碍。 - -最有创意的就是把 Google Drive 和 Dropbox 添加为外部存储。这样你就可以无缝的使用它们,并使用不需要账户地链接把文件分享给和你协作的人。 - -### 4. 下载以上传的文件 ### - -由于 ownCloud 的开源,人们可以不受公司需求限制地向它共享代码,增加新特性。共献者关注的往往是安全和隐私,所以 ownCloud 引入的特性常常比别人的要早,比如通过密码保护的公共链接和[设置失效期限][12]。 - -现在,ownCloud 可以配置分享链接的读写权限了,这就是说链接的访问者可以无缝的编辑你分享给他们的文件(不管是否有密码保护),或者在不提供他们的私人数据来登录其他服务的情况下将文件上传到服务器。 - -注:youtube 视频 - - -对于有人想给你分享大体积的文件时,这个特性就非常有用了。相比于上传到第三方站点、然后给你发送一个连接、你再去下载文件(通常需要登录),ownCloud 仅需要上传文件到你提供的分享文件夹、你就可以买上获取到文件了。 - -### 5. 免费却又安全的存储空间 ### - -之前就强调过,我们的代码贡献者最关注的就是安全和隐私,这就是 ownCloud 中有用于加密和解密存储数据的应用的原因。 - -通过使用 ownCloud 将你的文件存储到 Dropbox 或者 Google Drive,则会违背控制数据以及保持数据隐私的原则。但是加密应用则刚好可以满足安全及隐私问题。在发送数据给这些提供商前进行数据加密,并在取回数据的时候进行解密,你的数据就会变得很安全。 - -### 6. 在你的可控范围内分享文件 ### - -作为开源项目,ownCloud 没有必要自建 “围墙式花园”。进入联邦云共享:[developed and published by ownCloud][13] 协议使不同的文件同步和共享服务器可以彼此之间进行通信,并能够安全地传输文件。联邦云共享本身有一个有趣的故事:[22 所德国大学][14] 想要为自身的 500,000 学生建立一个庞大的云服务,但是每个大学都想控制自己学生数据。于是乎,我们需要一个可行性解决方案:也就是联邦云服务。该解决方案让让学生保持连接,使得他们可以无缝的协同工作。同时,每个大学的系统管理员保持着对自己学生创建的文件的控制权,如限制存储或者限制什么人、什么文件以及如何共享。 - -注:youtube 视频 - - -并且,这项令人崇敬的技术并没有限制于德国的大学之间,而是每个 ownCloud 用户都能在自己的用户设置中找到自己的 [联邦云 ID][15],并将之分享给同伴。 - -现在你明白了吧。仅六个方法,ownCloud 就能让人们完成特殊和特别的事。而是这一切成为可能的,就是 ownCloud 的开源 —— 设计用来释放你数据。 - --------------------------------------------------------------------------------- - -via: https://opensource.com/life/15/12/6-creative-ways-use-owncloud - -作者:[Jos Poortvliet][a] -译者:[GHLandy](https://github.com/GHLandy) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/jospoortvliet -[1]:https://owncloud.com/ -[2]:https://blogs.fsfe.org/mk/new-stickers-and-leaflets-no-cloud-and-e-mail-self-defense/ -[3]:https://owncloud.org/providers -[4]:https://owncloud.org/install/#instructions-server -[5]:https://creativecommons.org/licenses/by-sa/4.0/ -[6]:http://www.owncluster.de/ -[7]:https://christopherjcoleman.wordpress.com/2013/01/05/host-your-owncloud-on-a-raspberry-pi-cluster/ -[8]:https://apps.owncloud.com/ -[9]:https://apps.owncloud.com/content/show.php/Passwords?content=170480 -[10]:https://apps.owncloud.com/content/show.php/Secure+Container?content=167268 -[11]:https://apps.owncloud.com/content/show.php/Passman?content=166285 -[12]:https://owncloud.com/owncloud45-community/ -[13]:http://karlitschek.de/2015/08/announcing-the-draft-federated-cloud-sharing-api/ -[14]:https://owncloud.com/customer/sciebo/ -[15]:https://owncloud.org/federation/ From 33f340f5ee71931e6c9d9259c73cb4d361bff680 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 12 Aug 2016 08:57:38 +0800 Subject: [PATCH 1411/1469] PUB:20160518 Python 3 - An Intro to Encryption MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Cathon 翻译的不错,很用心。 --- ...60518 Python 3 - An Intro to Encryption.md | 49 +++++++------------ 1 file changed, 18 insertions(+), 31 deletions(-) rename {translated/tech => published}/20160518 Python 3 - An Intro to Encryption.md (74%) diff --git a/translated/tech/20160518 Python 3 - An Intro to Encryption.md b/published/20160518 Python 3 - An Intro to Encryption.md similarity index 74% rename from translated/tech/20160518 Python 3 - An Intro to Encryption.md rename to published/20160518 Python 3 - An Intro to Encryption.md index 5c57264aa7..cb37986f4c 100644 --- a/translated/tech/20160518 Python 3 - An Intro to Encryption.md +++ b/published/20160518 Python 3 - An Intro to Encryption.md @@ -1,15 +1,13 @@ Python 3: 加密简介 =================================== -Python 3 的标准库中没什么用来解决加密的,不过却有用于处理哈希的库。在这里我们会对其进行一个简单的介绍,但重点会放在两个第三方的软件包: PyCrypto 和 cryptography 上。我们将学习如何使用这两个库,来加密和解密字符串。 - ---- +Python 3 的标准库中没多少用来解决加密的,不过却有用于处理哈希的库。在这里我们会对其进行一个简单的介绍,但重点会放在两个第三方的软件包:PyCrypto 和 cryptography 上。我们将学习如何使用这两个库,来加密和解密字符串。 ### 哈希 -如果需要用到安全哈希算法或是消息摘要算法,那么你可以使用标准库中的 **hashlib** 模块。这个模块包含了标准的安全哈希算法,包括 SHA1,SHA224,SHA256,SHA384,SHA512 以及 RSA 的 MD5 算法。Python 的 **zlib** 模块也提供 adler32 以及 crc32 哈希函数。 +如果需要用到安全哈希算法或是消息摘要算法,那么你可以使用标准库中的 **hashlib** 模块。这个模块包含了符合 FIPS(美国联邦信息处理标准)的安全哈希算法,包括 SHA1,SHA224,SHA256,SHA384,SHA512 以及 RSA 的 MD5 算法。Python 也支持 adler32 以及 crc32 哈希函数,不过它们在 **zlib** 模块中。 -一个哈希最常见的用法是,存储密码的哈希值而非密码本身。当然了,使用的哈希函数需要稳健一点,否则容易被破解。另一个常见的用法是,计算一个文件的哈希值,然后将这个文件和它的哈希值分别发送。接受到文件的人可以计算文件的哈希值,检验是否与接受到的哈希值相符。如果两者相符,就说明文件在传送的过程中未经篡改。 +哈希的一个最常见的用法是,存储密码的哈希值而非密码本身。当然了,使用的哈希函数需要稳健一点,否则容易被破解。另一个常见的用法是,计算一个文件的哈希值,然后将这个文件和它的哈希值分别发送。接收到文件的人可以计算文件的哈希值,检验是否与接受到的哈希值相符。如果两者相符,就说明文件在传送的过程中未经篡改。 让我们试着创建一个 md5 哈希: @@ -26,8 +24,6 @@ TypeError: Unicode-objects must be encoded before hashing b'\x14\x82\xec\x1b#d\xf6N}\x16*+[\x16\xf4w' ``` -Let’s take a moment to break this down a bit. First off, we import **hashlib** and then we create an instance of an md5 HASH object. Next we add some text to the hash object and we get a traceback. It turns out that to use the md5 hash, you have to pass it a byte string instead of a regular string. So we try that and then call it’s **digest** method to get our hash. If you prefer the hex digest, we can do that too: - 让我们花点时间一行一行来讲解。首先,我们导入 **hashlib** ,然后创建一个 md5 哈希对象的实例。接着,我们向这个实例中添加一个字符串后,却得到了报错信息。原来,计算 md5 哈希时,需要使用字节形式的字符串而非普通字符串。正确添加字符串后,我们调用它的 **digest** 函数来得到哈希值。如果你想要十六进制的哈希值,也可以用以下方法: ``` @@ -35,7 +31,7 @@ Let’s take a moment to break this down a bit. First off, we import **hashlib** '1482ec1b2364f64e7d162a2b5b16f477' ``` -实际上,有一种精简的方法来创建哈希,下面我们看一下用这种方法创建一个 sha512 哈希: +实际上,有一种精简的方法来创建哈希,下面我们看一下用这种方法创建一个 sha1 哈希: ``` >>> sha = hashlib.sha1(b'Hello Python').hexdigest() @@ -45,14 +41,11 @@ Let’s take a moment to break this down a bit. First off, we import **hashlib** 可以看到,我们可以同时创建一个哈希实例并且调用其 digest 函数。然后,我们打印出这个哈希值看一下。这里我使用 sha1 哈希函数作为例子,但它不是特别安全,读者可以随意尝试其他的哈希函数。 - ---- - ### 密钥导出 -Python 的标准库对密钥导出支持较弱。实际上,hashlib 函数库提供的唯一方法就是 **pbkdf2_hmac** 函数。它是基于口令的密钥导出函数 PKCS#5 ,并使用 HMAC 作为伪随机函数。因为它支持加盐和迭代操作,你可以使用类似的方法来哈希你的密码。例如,如果你打算使用 SHA-256 加密方法,你将需要至少 16 个字节的盐,以及最少 100000 次的迭代操作。 +Python 的标准库对密钥导出支持较弱。实际上,hashlib 函数库提供的唯一方法就是 **pbkdf2_hmac** 函数。它是 PKCS#5 的基于口令的第二个密钥导出函数,并使用 HMAC 作为伪随机函数。因为它支持“加盐(salt)”和迭代操作,你可以使用类似的方法来哈希你的密码。例如,如果你打算使用 SHA-256 加密方法,你将需要至少 16 个字节的“盐”,以及最少 100000 次的迭代操作。 -简单来说,盐就是随机的数据,被用来加入到哈希的过程中,以加大破解的难度。这基本可以保护你的密码免受字典和彩虹表的攻击。 +简单来说,“盐”就是随机的数据,被用来加入到哈希的过程中,以加大破解的难度。这基本可以保护你的密码免受字典和彩虹表(rainbow table)的攻击。 让我们看一个简单的例子: @@ -66,9 +59,7 @@ Python 的标准库对密钥导出支持较弱。实际上,hashlib 函数库 b'6e97bad21f6200f9087036a71e7ca9fa01a59e1d697f7e0284cd7f9b897d7c02' ``` -这里,我们用 SHA256 对一个密码进行哈希,使用了一个糟糕的盐,但经过了 100000 次迭代操作。当然,SHA 实际上并不被推荐用来创建密码的密钥。你应该使用类似 **scrypt** 的算法来替代。另一个不错的选择是使用一个叫 **bcrypt** 的第三方库。它是被专门设计出来哈希密码的。 - ---- +这里,我们用 SHA256 对一个密码进行哈希,使用了一个糟糕的盐,但经过了 100000 次迭代操作。当然,SHA 实际上并不被推荐用来创建密码的密钥。你应该使用类似 **scrypt** 的算法来替代。另一个不错的选择是使用一个叫 **bcrypt** 的第三方库,它是被专门设计出来哈希密码的。 ### PyCryptodome @@ -86,11 +77,11 @@ pip install pycryptodome pip install pycryptodomex ``` -如果你遇到了问题,可能是因为你没有安装正确的依赖包(译者注:如 python-devel),或者你的 Windows 系统需要一个编译器。如果你需要安装上的帮助或技术支持,可以访问 PyCryptodome 的[网站][1]。 +如果你遇到了问题,可能是因为你没有安装正确的依赖包(LCTT 译注:如 python-devel),或者你的 Windows 系统需要一个编译器。如果你需要安装上的帮助或技术支持,可以访问 PyCryptodome 的[网站][1]。 还值得注意的是,PyCryptodome 在 PyCrypto 最后版本的基础上有很多改进。非常值得去访问它们的主页,看看有什么新的特性。 -### 加密字符串 +#### 加密字符串 访问了他们的主页之后,我们可以看一些例子。在第一个例子中,我们将使用 DES 算法来加密一个字符串: @@ -116,8 +107,7 @@ ValueError: Input strings must be a multiple of 8 in length b'>\xfc\x1f\x16x\x87\xb2\x93\x0e\xfcH\x02\xd59VQ' ``` -这段代码稍有些复杂,让我们一点点来看。首先需要注意的是,DES 加密使用的密钥长度为 8 个字节,这也是我们将密钥变量设置为 8 个字符的原因。而我们需要加密的字符串的长度必须是 8 的倍数,所以我们创建了一个名为 **pad** 的函数,来给一个字符串末尾添加空格,直到它的长度是 8 的倍数。然后,我们创建了一个 DES 的实例,以及我们需要加密的文本。我们还创建了一个经过填充处理的文本。我们尝试这对未经填充处理的文本进行加密,啊欧,报错了!我们需要对经过填充处理的文本进行加密,然后得到加密的字符串。 -(译者注:encrypt 函数的参数应为 byte 类型字符串,代码为:`encrypted_text = des.encrypt(padded_textpadded_text.encode('uf-8'))`) +这段代码稍有些复杂,让我们一点点来看。首先需要注意的是,DES 加密使用的密钥长度为 8 个字节,这也是我们将密钥变量设置为 8 个字符的原因。而我们需要加密的字符串的长度必须是 8 的倍数,所以我们创建了一个名为 **pad** 的函数,来给一个字符串末尾填充空格,直到它的长度是 8 的倍数。然后,我们创建了一个 DES 的实例,以及我们需要加密的文本。我们还创建了一个经过填充处理的文本。我们尝试着对未经填充处理的文本进行加密,啊欧,报了一个 ValueError 错误!我们需要对经过填充处理的文本进行加密,然后得到加密的字符串。(LCTT 译注:encrypt 函数的参数应为 byte 类型字符串,代码为:`encrypted_text = des.encrypt(padded_text.encode('utf-8'))`) 知道了如何加密,还要知道如何解密: @@ -128,7 +118,7 @@ b'Python rocks! ' 幸运的是,解密非常容易,我们只需要调用 des 对象的 **decrypt** 方法就可以得到我们原来的 byte 类型字符串了。下一个任务是学习如何用 RSA 算法加密和解密一个文件。首先,我们需要创建一些 RSA 密钥。 -### 创建 RSA 密钥 +#### 创建 RSA 密钥 如果你希望使用 RSA 算法加密数据,那么你需要拥有访问 RAS 公钥和私钥的权限,否则你需要生成一组自己的密钥对。在这个例子中,我们将生成自己的密钥对。创建 RSA 密钥非常容易,所以我们将在 Python 解释器中完成。 @@ -148,9 +138,9 @@ b'Python rocks! ' 接下来,我们通过 RSA 密钥实例的 **publickey** 方法创建我们的公钥。我们使用方法链调用 publickey 和 exportKey 方法生成公钥,同样将它写入磁盘上的文件。 -### 加密文件 +#### 加密文件 -有了私钥和公钥之后,我们就可以加密一些数据,并写入文件了。这儿有个比较标准的例子: +有了私钥和公钥之后,我们就可以加密一些数据,并写入文件了。这里有个比较标准的例子: ``` from Crypto.PublicKey import RSA @@ -204,17 +194,15 @@ with open('/path/to/encrypted_data.bin', 'rb') as fobj: print(data) ``` -如果你认真看了上一个例子,这段代码应该很容易解析。在这里,我们先读取二进制的加密文件,然后导入私钥。注意,当你导入私钥时,需要提供一个密码,否则会出现错误。然后,我们文件中读取数据,首先是加密的会话密钥,然后是 16 字节的随机数和 16 字节的消息认证码,最后是剩下的加密的数据。 +如果你认真看了上一个例子,这段代码应该很容易解析。在这里,我们先以二进制模式读取我们的加密文件,然后导入私钥。注意,当你导入私钥时,需要提供一个密码,否则会出现错误。然后,我们文件中读取数据,首先是加密的会话密钥,然后是 16 字节的随机数和 16 字节的消息认证码,最后是剩下的加密的数据。 接下来我们需要解密出会话密钥,重新创建 AES 密钥,然后解密出数据。 你还可以用 PyCryptodome 库做更多的事。不过我们要接着讨论在 Python 中还可以用什么来满足我们加密解密的需求。 ---- - ### cryptography 包 -**cryptography** 的目标是成为人类易于使用的密码学包,就像 **requests** 是人类易于使用的 HTTP 库一样。这个想法使你能够创建简单安全,易于使用的加密方案。如果有需要的话,你也可以使用一些底层的密码学基元,但这也需要你知道更多的细节,否则创建的东西将是不安全的。 +**cryptography** 的目标是成为“人类易于使用的密码学包(cryptography for humans)”,就像 **requests** 是“人类易于使用的 HTTP 库(HTTP for Humans)”一样。这个想法使你能够创建简单安全、易于使用的加密方案。如果有需要的话,你也可以使用一些底层的密码学基元,但这也需要你知道更多的细节,否则创建的东西将是不安全的。 如果你使用的 Python 版本是 3.5, 你可以使用 pip 安装,如下: @@ -222,7 +210,7 @@ print(data) pip install cryptography ``` -你会看到 cryptography 包还安装了一些依赖包(译者注:如 libopenssl-devel)。如果安装都顺利,我们就可以试着加密一些文本了。让我们使用 **Fernet** 对称加密算法,它保证了你加密的任何信息在不知道密码的情况下不能被篡改或读取。Fernet 还通过 **MultiFernet** 支持密钥轮换。下面让我们看一个简单的例子: +你会看到 cryptography 包还安装了一些依赖包(LCTT 译注:如 libopenssl-devel)。如果安装都顺利,我们就可以试着加密一些文本了。让我们使用 **Fernet** 对称加密算法,它保证了你加密的任何信息在不知道密码的情况下不能被篡改或读取。Fernet 还通过 **MultiFernet** 支持密钥轮换。下面让我们看一个简单的例子: ``` >>> from cryptography.fernet import Fernet @@ -242,9 +230,8 @@ b'My super secret message' 首先我们需要导入 Fernet,然后生成一个密钥。我们输出密钥看看它是什么样儿。如你所见,它是一个随机的字节串。如果你愿意的话,可以试着多运行 **generate_key** 方法几次,生成的密钥会是不同的。然后我们使用这个密钥生成 Fernet 密码实例。 -现在我们有了用来加密和解密消息的密码。下一步是创建一个需要加密的消息,然后使用 **encrypt** 方法对它加密。我打印出加密的文本,然后你可以看到你不再能够读懂它。为了**解密**出我们的秘密消息,我们只需调用 decrypt 方法,并传入加密的文本作为参数。结果就是我们得到了消息字节串形式的纯文本。 +现在我们有了用来加密和解密消息的密码。下一步是创建一个需要加密的消息,然后使用 **encrypt** 方法对它加密。我打印出加密的文本,然后你可以看到你再也读不懂它了。为了解密出我们的秘密消息,我们只需调用 **decrypt** 方法,并传入加密的文本作为参数。结果就是我们得到了消息字节串形式的纯文本。 ---- ### 小结 @@ -268,7 +255,7 @@ via: http://www.blog.pythonlibrary.org/2016/05/18/python-3-an-intro-to-encryptio 作者:[Mike][a] 译者:[Cathon](https://github.com/Cathon) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 207dd4370034b2a6696c95f0c61170dda4d5ebd0 Mon Sep 17 00:00:00 2001 From: may Date: Fri, 12 Aug 2016 09:29:21 +0800 Subject: [PATCH 1412/1469] =?UTF-8?q?=EF=BD=94=EF=BD=92=EF=BD=81=EF=BD=8E?= =?UTF-8?q?=EF=BD=93=EF=BD=8C=EF=BD=81=EF=BD=94=EF=BD=89=EF=BD=8E=EF=BD=87?= =?UTF-8?q?=E3=80=80=EF=BD=86=EF=BD=89=EF=BD=8E=EF=BD=89=EF=BD=93=EF=BD=88?= =?UTF-8?q?=EF=BD=85=EF=BD=84=20(#4303)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * translating by maywanting * finish translating --- sources/talk/20160620 5 SSH Hardening Tips.md | 127 ------------------ .../talk/20160620 5 SSH Hardening Tips.md | 125 +++++++++++++++++ 2 files changed, 125 insertions(+), 127 deletions(-) delete mode 100644 sources/talk/20160620 5 SSH Hardening Tips.md create mode 100644 translated/talk/20160620 5 SSH Hardening Tips.md diff --git a/sources/talk/20160620 5 SSH Hardening Tips.md b/sources/talk/20160620 5 SSH Hardening Tips.md deleted file mode 100644 index e1a7353807..0000000000 --- a/sources/talk/20160620 5 SSH Hardening Tips.md +++ /dev/null @@ -1,127 +0,0 @@ -translating by maywanting - -5 SSH Hardening Tips -====================== - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/binary-1188510_1920_0.jpg?itok=ocPCL_9G) ->Make your OpenSSH sessions more secure with these simple tips. -> Creative Commons Zero - -When you look at your SSH server logs, chances are they are full of attempted logins from entities of ill intent. Here are 5 general ways (along with several specific tactics) to make your OpenSSH sessions more secure. - -### 1. Make Password Auth Stronger - -Password logins are convenient, because you can log in from any machine anywhere. But they are vulnerable to brute-force attacks. Try these tactics for strengthening your password logins. - -- Use a password generator, such as pwgen. pwgen takes several options; the most useful is password length (e.g., pwgen 12 generates a 12-character password). - -- Never reuse a password. Ignore all the bad advice about not writing down your passwords, and keep a notebook with your logins written in it. If you don't believe me that this is a good idea, then believe security guru [Bruce Schneier][1]. If you're reasonably careful, nobody will ever find your notebook, and it is immune from online attacks. - -- You can add extra protection to your login notebook by obscuring the logins recorded in your notebook with character substitution or padding. Use a simple, easily-memorable convention such as padding your passwords with two extra random characters, or use a single simple character substitution such as # for *. - -- Use a non-standard listening port on your SSH server. Yes, this is old advice, and it's still good. Examine your logs; chances are that port 22 is the standard attack point, with few attacks on other ports. - -- Use [Fail2ban][2] to dynamically protect your server from brute force attacks. - -- Create non-standard usernames. Never ever enable a remote root login, and avoid "admin". - -### 2. Fix Too Many Authentication Failures - -When my ssh logins fail with "Too many authentication failures for carla" error messages, it makes me feel bad. I know I shouldn't take it personally, but it still stings. But, as my wise granny used to say, hurt feelings don't fix the problem. The cure for this is to force a password-based login in your ~/.ssh/config file. If this file does not exist, first create the ~/.ssh/ directory: - -``` -$ mkdir ~/.ssh -$ chmod 700 ~/.ssh -``` - -Then create the `~/.ssh/config` file in a text editor and enter these lines, using your own remote HostName address: - -``` -HostName remote.site.com -PubkeyAuthentication=no -``` - -### 3. Use Public Key Authentication - -Public Key authentication is much stronger than password authentication, because it is immune to brute-force password attacks, but it’s less convenient because it relies on RSA key pairs. To begin, you create a public/private key pair. Next, the private key goes on your client computer, and you copy the public key to the remote server that you want to log into. You can log in to the remote server only from computers that have your private key. Your private key is just as sensitive as your house key; anyone who has possession of it can access your accounts. You can add a strong layer of protection by putting a passphrase on your private key. - -Using RSA key pairs is a great tool for managing multiple users. When a user leaves, disable their login by deleting their public key from the server. - -This example creates a new key pair of 3072 bits strength, which is stronger than the default 2048 bits, and gives it a unique name so you know what server it belongs to: - -``` -$ ssh-keygen -t rsa -b 3072 -f id_mailserver -``` - -This creates two new keys, id_mailserver and id_mailserver.pub. id_mailserver is your private key -- do not share this! Now securely copy your public key to your remote server with the ssh-copy-id command. You must already have a working SSH login on the remote server: - -``` -$ ssh-copy-id -i id_rsa.pub user@remoteserver - -/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed -user@remoteserver's password: - -Number of key(s) added: 1 - -Now try logging into the machine, with: "ssh 'user@remoteserver'" -and check to make sure that only the key(s) you wanted were added. -``` - -ssh-copy-id ensures that you will not accidentally copy your private key. Test your new key login by copying the example from your command output, with single quotes: - -``` -$ ssh 'user@remoteserver' -``` - -It should log you in using your new key, and if you set a password on your private key, it will prompt you for it. - -### 4. Disable Password Logins - -Once you have tested and verified your public key login, disable password logins so that your remote server is not vulnerable to brute force password attacks. Do this in the /etc/sshd_config file on your remote server with this line: - -``` -PasswordAuthentication no -``` - -Then restart your SSH daemon. - -### 5. Set Up Aliases -- They’re Fast and Cool - -You can set up aliases for remote logins that you use a lot, so instead of logging in with something like "ssh -u username -p 2222 remote.site.with.long-name", you can use "ssh remote1". Set it up like this in your ~/.ssh/config file: - -``` -Host remote1 -HostName remote.site.with.long-name -Port 2222 -User username -PubkeyAuthentication no -``` - -If you are using public key authentication, it looks like this: - -``` -Host remote1 -HostName remote.site.with.long-name -Port 2222 -User username -IdentityFile ~/.ssh/id_remoteserver -``` - -The [OpenSSH documentation][3] is long and detailed, but after you have mastered basic SSH use, you'll find it's very useful and contains a trove of cool things you can do with OpenSSH. - - - --------------------------------------------------------------------------------- - -via: https://www.linux.com/learn/5-ssh-hardening-tips - -作者:[CARLA SCHRODER][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.linux.com/users/cschroder -[1]: https://www.schneier.com/blog/archives/2005/06/write_down_your.html -[2]: http://www.fail2ban.org/wiki/index.php/Main_Page -[3]: http://www.openssh.com/ diff --git a/translated/talk/20160620 5 SSH Hardening Tips.md b/translated/talk/20160620 5 SSH Hardening Tips.md new file mode 100644 index 0000000000..a030e13186 --- /dev/null +++ b/translated/talk/20160620 5 SSH Hardening Tips.md @@ -0,0 +1,125 @@ +五条强化 SSH 安全的建议 +====================== + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/binary-1188510_1920_0.jpg?itok=ocPCL_9G) +>采用这些简单的建议,使你的 OpenSSH 会话更加安全。 + +> 创造性的零共有 + +当你查看你的 SSH 服务日志,很有可能都充斥着一些不怀好意的尝试性登录。这里有5条一般意义上的建议(和一些个别特殊策略),让你的 OpenSSH 会话更加安全。 + +### 1. 强化密码登录 + +密码登录很方便,因为你可以从任何地方的任何机器上登录。但是他们在暴力攻击面前也是脆弱的。尝试以下策略来强化你的密码登录。 + +- 使用一个密码生成工具,例如 pwgen。pwgen 会有几个选项;最有用的就是密码长度的选项(例如,`pwgen 12` 产生一个12位字符的密码) + +- 不要重复使用一个密码。忽略所有有关不要记下你的密码的建议,然后关于你所有登录信息都记在一本本子上。如果你不相信我的建议,那去相信安全权威 [Bruce Schneier][1]。如果你足够仔细,没有人能够发现你的笔记本,那么这样能够不受到网络上的那些攻击。 + +- 你可以为你的登录记事本增加一些额外的保护措施,例如用字符替换或者增加新的字符来掩盖笔记本上的登录密码。使用一个简单而且好记的规则,比如说给你的密码增加两个额外的随机字符,或者使用单个简单的字符替换,例如 `#` 替换成 `*`。 + +- 为你的 SSH 服务开启一个不是默认的监听端口。是的,这是很老套的建议,但是它确实很有效。检查你的登录;很有可能22端口是被普遍攻击的端口,其他端口则很少被攻击。 + +- 使用 [Fail2ban][2] 来动态保护你的服务器,是服务器免于被暴力攻击 + +- 使用不寻常的用户名。不能让root可以远程登录,并确避免用户名为“admin”。 + +### 2. 解决 `Too Many Authentication Failures` 报错 + +当我的 ssh 登录失败,并显示「Too many authentication failures for carla」的报错信息时,我很难过。我知道我应该不介意,但是这报错确实很碍眼。而且,正如我聪慧的奶奶曾经说过,伤痛之感并不能解决问题。解决办法就是在你的 `~/.ssh/config` 文件设置强制密码登录。如果这个文件不存在,首先创个 `~/.ssh/` 目录。 + +``` +$ mkdir ~/.ssh +$ chmod 700 ~/.ssh +``` + +然后在一个文本编辑器创建 `~/.ssh/confg` 文件,输入以下行,使用你自己的远程域名。 + +``` +HostName remote.site.com +PubkeyAuthentication=no +``` + +### 3. 使用公钥认证 + +公钥认证比密码登录安全多了,因为它不受暴力密码攻击的影响,但是并不方便因为它依赖于 RSA 密钥对。一开始,你创建一对公钥和私钥。下一步,私钥放于你的客户端电脑,并且复制公钥到你想登录的远程服务器。你只能从拥有私钥的电脑登录才能登录到远程服务器。你的私钥就和你的家门钥匙一样敏感;任何人获取到了私钥就可以获取你的账号。你可以给你的私钥加上密码来增加一些强化保护规则。 +使用 RSA 密钥对管理多种多样的用户是一种好的方法。当一个用户离开了,只要从服务器删了他的公钥就能取消他的登录。 + +以下例子创建一个新的 3072 bits 长度的密钥对,它比默认的 2048 bits 更安全,而且为它起一个独一无二的名字,这样你就可以知道它属于哪个服务器。 + +``` +$ ssh-keygen -t rsa -b 3072 -f id_mailserver +``` + +以下创建两个新的密钥, `id_mailserver` 和 `id_mailserver.pub`,`id_mailserver` 是你的私钥--不传播它!现在用 `ssh-copy-id` 命令安全地复制你的公钥到你的远程服务器。你必须确保有运作中的 SSH 登录到远程服务器。 + +``` +$ ssh-copy-id -i id_rsa.pub user@remoteserver + +/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed +user@remoteserver's password: + +Number of key(s) added: 1 + +Now try logging into the machine, with: "ssh 'user@remoteserver'" +and check to make sure that only the key(s) you wanted were added. +``` + +`ssh-copy-id` 确保你不会无意间复制你的私钥。复制你的命令输出样式,带上单引号,这样测试你的新的密钥登录。 + +``` +$ ssh 'user@remoteserver' +``` + +必须用你的新密钥登录,如果你为你的私钥设置了密码,它会提示你。 + +### 4. 取消密码登录 + +一旦你已经测试并且验证了你的公钥登录,取消密码登录,这样你的远程服务器就不会被暴力密码攻击。如下设置你的远程服务器的 `/etc/sshd_config` 文件。 + +``` +PasswordAuthentication no +``` + +然后重启 SSH 守护进程。 + +### 5. 设置别名 -- 这很快捷而且很有 B 格 + +你可以为你的远程登录设置常用的别名,来替代登录时输入的命令,例如 `ssh -u username -p 2222 remote.site.with.long-name`。你可以使用 `ssh remote1`。你的 `~/.ssh/config` 文件可以参照如下设置 + +``` +Host remote1 +HostName remote.site.with.long-name +Port 2222 +User username +PubkeyAuthentication no +``` + +如果你正在使用公钥登录,可以参照这个: + +``` +Host remote1 +HostName remote.site.with.long-name +Port 2222 +User username +IdentityFile ~/.ssh/id_remoteserver +``` + +[OpenSSH 文档][3] 很长而且详细,但是当你掌握了基础的 SSH 使用规则之后,你会发现它非常的有用而且包含很多可以通过 OpenSSH 来实现的炫酷效果。 + + + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/learn/5-ssh-hardening-tips + +作者:[CARLA SCHRODER][a] +译者:[maywanting](https://github.com/maywanting) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/cschroder +[1]: https://www.schneier.com/blog/archives/2005/06/write_down_your.html +[2]: http://www.fail2ban.org/wiki/index.php/Main_Page +[3]: http://www.openssh.com/ From 44281871ef28a488bc7d6b5edc29d9a74917ad1f Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 12 Aug 2016 13:13:56 +0800 Subject: [PATCH 1413/1469] PUB:20160726 How to restore older file versions in Git @strugglingyouth --- ...w to restore older file versions in Git.md | 182 +++++++++++++++++ ...w to restore older file versions in Git.md | 188 ------------------ 2 files changed, 182 insertions(+), 188 deletions(-) create mode 100644 published/20160726 How to restore older file versions in Git.md delete mode 100644 translated/tech/20160726 How to restore older file versions in Git.md diff --git a/published/20160726 How to restore older file versions in Git.md b/published/20160726 How to restore older file versions in Git.md new file mode 100644 index 0000000000..9008d9cf63 --- /dev/null +++ b/published/20160726 How to restore older file versions in Git.md @@ -0,0 +1,182 @@ +Git 系列(四):在 Git 中进行版本回退 +============================================= + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/file_system.jpg?itok=s2b60oIB) + +在这篇文章中,你将学到如何查看项目中的历史版本,如何进行版本回退,以及如何创建 Git 分支以便你可以大胆尝试而不会出现问题。 + +在你的 Git 项目的历史中,你的位置就像是摇滚专辑中的一个片段,由一个被称为 HEAD 的 标记来确定(如磁带录音机或录音播放器的播放头)。要在你的 Git 时间线上前后移动 HEAD ,需要使用 `git checkout` 命令。 + +git checkout 命令的使用方式有两种。最常见的用途是从一个以前的提交中恢复文件,你也可以整个倒回磁带,切换到另一个分支。 + + +### 恢复一个文件 + +当你意识到一个本来很好文件被你完全改乱了。我们都这么干过:我们把文件放到一个地方,添加并提交,然后我们发现它还需要做点最后的调整,最后这个文件被搞得面目全非了。 + +要把它恢复到最后的完好状态,使用 git checkout 从最后的提交(即 HEAD)中恢复: + +``` +$ git checkout HEAD filename +``` + +如果你碰巧提交了一个错误的版本,你需要找回更早的版本,使用 git log 查看你更早的提交,然后从合适的提交中找回它: + +``` +$ git log --oneline +79a4e5f bad take +f449007 The second commit +55df4c2 My great project, first commit. + +$ git checkout 55df4c2 filename + +``` + +现在,以前的文件恢复到了你当前的位置。(任何时候你都可以用 git status 命令查看你的当前状态)因为这个文件改变了,你需要添加这个文件,再进行提交: + +``` +$ git add filename +$ git commit -m 'restoring filename from first commit.' +``` + +使用 Git log 验证你所提交的: + +``` +$ git log --oneline +d512580 restoring filename from first commit +79a4e5f bad take +f449007 The second commit +55df4c2 My great project, first commit. +``` + +从本质上讲,你已经倒好了磁带并修复了坏的地方,所以你需要重新录制正确的。 + +### 回退时间线 + +恢复文件的另一种方式是回退整个 Git 项目。这里使用了分支的思想,这是另一种替代方法。 + +如果你要回到历史提交,你要将 Git HEAD 回退到以前的版本才行。这个例子将回到最初的提交处: + +``` +$ git log --oneline +d512580 restoring filename from first commit +79a4e5f bad take +f449007 The second commit +55df4c2 My great project, first commit. + +$ git checkout 55df4c2 +``` + +当你以这种方式倒回磁带,如果你按下录音键再次开始,就会丢失以前的工作。Git 默认假定你不想这样做,所以将 HEAD 从项目中分离出来,可以让你如所需的那样工作,而不会因为偶尔的记录而影响之后的工作。 + +如果你想看看以前的版本,想要重新做或者尝试不同的方法,那么安全一点的方式就是创建一个新的分支。可以将这个过程想象为尝试同一首歌曲的不同版本,或者创建一个混音的。原始的依然存在,关闭那个分支做你想做的版本吧。 + +就像记录到一个空白磁带一样,把你的 Git HEAD 指到一个新的分支处: + +``` +$ git checkout -b remix +Switched to a new branch 'remix' +``` + +现在你已经切换到了另一个分支,在你面前的是一个替代的干净工作区,准备开始工作吧。 + +也可以不用改变时间线来做同样的事情。也许你很想这么做,但切换到一个临时的工作区只是为了尝试一些疯狂的想法。这在工作中完全是可以接受的,请看: + +``` +$ git status +On branch master +nothing to commit, working directory clean + +$ git checkout -b crazy_idea +Switched to a new branch 'crazy_idea' +``` + +现在你有一个干净的工作空间,在这里你可以完成一些奇怪的想法。一旦你完成了,可以保留你的改变,或者丢弃他们,并切换回你的主分支。 + +若要放弃你的想法,切换到你的主分支,假装新分支不存在: + +``` +$ git checkout master +``` + +想要继续使用你的疯狂的想法,需要把它们拉回到主分支,切换到主分支然后合并新分支到主分支: + +``` +$ git checkout master +$ git merge crazy_idea +``` + +git 的分支功能很强大,开发人员在克隆仓库后马上创建一个新分支是很常见的做法;这样,他们所有的工作都在自己的分支上,可以提交并合并到主分支。Git 是很灵活的,所以没有“正确”或“错误”的方式(甚至一个主分支也可以与其所属的远程仓库分离),但分支易于分离任务和提交贡献。不要太激动,你可以如你所愿的有很多的 Git 分支。完全自由。 + +### 远程协作 + +到目前为止你已经在自己舒适而私密的家中维护着一个 Git 仓库,但如何与其他人协同工作呢? + +有好几种不同的方式来设置 Git 以便让多人可以同时在一个项目上工作,所以首先我们要克隆仓库,你可能已经从某人的 Git 服务器或 GitHub 主页,或在局域网中的共享存储上克隆了一个仓库。 + +工作在私人仓库下和共享仓库下唯一不同的是你需要把你的改变 `push` 到别人的仓库。我们把工作的仓库称之为本地(local)仓库,其他仓库称为远程(remote)仓库。 + +当你以读写的方式克隆一个仓库时,克隆的仓库会继承自被称为 origin 的远程库。你可以看看你的克隆仓库的远程仓库: + +``` +$ git remote --verbose +origin seth@example.com:~/myproject.Git (fetch) +origin seth@example.com:~/myproject.Git (push) +``` + +有一个 origin 远程库非常有用,因为它有异地备份的功能,并允许其他人在该项目上工作。 + +如果克隆没有继承 origin 远程库,或者如果你选择以后再添加,可以使用 `git remote` 命令: + +``` +$ git remote add seth@example.com:~/myproject.Git +``` + +如果你修改了文件,想把它们发到有读写权限的 origin 远程库,使用 `git push`。第一次推送改变,必须也发送分支信息。不直接在主分支上工作是一个很好的做法,除非你被要求这样做: + +``` +$ git checkout -b seth-dev +$ git add exciting-new-file.txt +$ git commit -m 'first push to remote' +$ git push -u origin HEAD +``` + +它会推送你当前的位置(HEAD)及其存在的分支到远程。当推送过一次后,以后每次推送可以不使用 -u 选项: + +``` +$ git add another-file.txt +$ git commit -m 'another push to remote' +$ git push origin HEAD +``` + +### 合并分支 + +当你工作在一个 Git 仓库时,你可以合并任意测试分支到主分支。当团队协作时,你可能想在将它们合并到主分支之前检查他们的改变: + +``` +$ git checkout contributor +$ git pull +$ less blah.txt ### 检查改变的文件 +$ git checkout master +$ git merge contributor +``` + +如果你正在使用 GitHub 或 GitLab 以及类似的东西,这个过程是不同的。但克隆项目并把它作为你自己的仓库都是相似的。你可以在本地工作,将改变提交到你的 GitHub 或 GitLab 帐户,而不用其它人的许可,因为这些库是你自己的。 + +如果你想要让你克隆的仓库接受你的改变,需要创建了一个拉取请求(pull request),它使用 Web 服务的后端发送补丁到真正的拥有者,并允许他们审查和拉取你的改变。 + +克隆一个项目通常是在 Web 服务端完成的,它和使用 Git 命令来管理项目是类似的,甚至推送的过程也是。然后它返回到 Web 服务打开一个拉取请求,工作就完成了。 + +下一部分我们将整合一些有用的插件到 Git 中来帮你轻松的完成日常工作。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/16/7/how-restore-older-file-versions-git + +作者:[Seth Kenlon][a] +译者:[strugglingyouth](https://github.com/strugglingyouth) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth diff --git a/translated/tech/20160726 How to restore older file versions in Git.md b/translated/tech/20160726 How to restore older file versions in Git.md deleted file mode 100644 index ccf9863e14..0000000000 --- a/translated/tech/20160726 How to restore older file versions in Git.md +++ /dev/null @@ -1,188 +0,0 @@ - -在 Git 中进行版本回退 -============================================= - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/file_system.jpg?itok=s2b60oIB) - -在这篇文章中,你将学到如何查看项目中的历史版本,如何进行版本回退,以及如何使用 Git 分支,你可以大胆的进行尝试。 - - -在你的 Git 项目中,你的位置就像是一个滚动的标签,由一个被称为 HEAD 的 标记(如磁带录音机或留声机的播放头)来确定。要让 HEAD 指向你想到的时间线上,需要使用 git checkout 命令。 - - -git checkout 命令的使用方式有两种。最常见的用途是恢复一个以前提交过的文件,你也可以用他切换到另一个分支。 - - -### 恢复一个文件 - - -当你意识到一个文件被你完全改乱了。我们不得不将它恢复到以前的某个位置,然后 a添加并提交,因此我们需要的是该文件最后一次修改的位置,然后替换文件。 - - -查看最后一次提交的 HEAD,然后使用 git checkout 将其恢复到以前的版本: - -``` -$ git checkout HEAD filename -``` - -如果回退会的文件依然有问题,使用 git log 查看你更早的提交,然后切换到正确的版本: - -``` -$ git log --oneline -79a4e5f bad take -f449007 The second commit -55df4c2 My great project, first commit. - -$ git checkout 55df4c2 filename - -``` - -现在,以前的文件恢复到了你当前的位置。(你可以用 git status 命令查看你当前的状态)然后添加刚改变的文件再进行提交: - -``` -$ git add filename -$ git commit -m 'restoring filename from first commit.' -``` - -使用 Git log 验证你所提交的: - -``` -$ git log --oneline -d512580 restoring filename from first commit -79a4e5f bad take -f449007 The second commit -55df4c2 My great project, first commit. -``` - -从本质上讲,你已经倒好了磁带并修复了坏的地方。所以你需要重新记录正确的。 - -### 回退时间线 - -恢复文件的另一种方式是回退整个 Git 项目。这里使用了分支的思想,这是另一种替代方法。 - -你要将 Git HEAD 回退到以前的版本才能回到历史提交。这个例子将回到最初的提交处: - -``` -$ git log --oneline -d512580 restoring filename from first commit -79a4e5f bad take -f449007 The second commit -55df4c2 My great project, first commit. - -$ git checkout 55df4c2 -``` - -当你以这种方式回退,如果你重新开始提交,会丢失以前的工作。Git 默认假定你不想这样做,所以将 HEAD 从项目中分离出来,并将以前的记录保存下来。 - -如果你想看看以前的版本,想要重新做或者尝试不同的方法,那么安全一点的方式就是创建一个新的分支。可以将这个过程想象为尝试同一首歌曲的不同版本,或者创建一个混音的。原始的依然存在,关闭分支做你想做的版本吧。 - -把你的 Git HEAD 回退到另一个起点处: - -``` -$ git checkout -b remix -Switched to a new branch 'remix' -``` - -现在你已经切换到了另一个分支,你当前的工作区是干净的,准备开始工作吧。 - -也可以不用改变时间线来做同样的事情。也许你很想这么做,但切换到一个临时的工作区只是为了尝试一些疯狂的想法。这在工作中完全是可以接受的,请看: - -``` -$ git status -On branch master -nothing to commit, working directory clean - -$ git checkout -b crazy_idea -Switched to a new branch 'crazy_idea' -``` - -现在你有一个干净的工作空间,在这里你可以完成一些奇怪的想法。一旦你完成了,可以保留你的改变,或者丢弃他们,并切换回你的主分支。 - -若要放弃你的想法,切换到你的主分支,假装新分支不存在: - -``` -$ git checkout master -``` - -想要继续使用你的 crazy ideas,需要把他们拉回到主分支,切换到主分支然后合并新分支到主分支: - -``` -$ git checkout master -$ git merge crazy_idea -``` - -git 的分支功能很强大,在克隆仓库后为开发人员创建一个新分支是很常见的;这样,他们所有的工作都在自己的分支上,可以提交并合并到主分支。Git 是很灵活的,所以没有“正确”或“错误”的方式(甚至一个主分支也可以区分远程分支),但分支易于分离任务和提交贡献。两个人之间可以有很多的 Git 分支。 - -### 远程协作 - -到目前为止你已经在自己的家目录下维护着一个 Git 仓库,但如何与其他人协同工作呢? - -有好几种不同的方式来设置 Git 以便让多人可以同时在一个项目上工作,所以首先我们要克隆仓库,是否你已经从某人的 Git 服务器或 GitHub 主页克隆了一个仓库,或在局域网中使用了共享存储。 - -工作在私人仓库下和共享仓库唯一不同的是你需要把你的改变提交到别人的仓库。我们把工作的仓库称之为本地仓库,其他仓库称为远程仓库。 - - -当你以读写的方式克隆一个仓库时,克隆的仓库会继承远程库并且你会看到一个名为 origin 的远程库。你可以看看克隆的远程仓库: - -``` -$ git remote --verbose -origin seth@example.com:~/myproject.Git (fetch) -origin seth@example.com:~/myproject.Git (push) -``` - -有一个 origin 远程库非常有用,因为它有异地备份的功能,并允许其他人在该项目上工作。 - -如果克隆没有继承 origin 远程库,或者如果你选择以后再添加,可以使用 git remote 命令: - -``` -$ git remote add seth@example.com:~/myproject.Git -``` - -如果你修改了文件,想把它们发到有读写权限的 origin 远程库,使用 git push。第一次推送改变,必须发送分支信息。不直接在主分支上工作是一个很好的做法,除非你被要求这样做: - -``` -$ git checkout -b seth-dev -$ git add exciting-new-file.txt -$ git commit -m 'first push to remote' -$ git push -u origin HEAD -``` - -它会推送你当前的位置(HEAD)和存在的分支到远程。当推送过一次后,以后每次推送可以不使用 -u 选项: - -``` -$ git add another-file.txt -$ git commit -m 'another push to remote' -$ git push origin HEAD -``` - -### 合并分支 - -当一个人工作在一个 Git 仓库时,你可以合并任意测试分支到主分支。当团队协作时,你可能会想检查他们的改变,然后再将它们合并到主分支: - -``` -$ git checkout contributor -$ git pull -$ less blah.txt # 检查改变的文件 -$ git checkout master -$ git merge contributor -``` - -如果你正在使用 GitHub 或 GitLab 以及类似的东西,虽然过程是不同的,但克隆项目并把它作为你自己的仓库都是相似的。你可以在本地工作,将改变提交到 GitHub 或 GitLab 帐户,其他人对这些仓库没有任何权限。 - -如果你想要为克隆的仓库推送,需要创建了一个拉取请求,它使用 Web 服务的后端发送补丁到真正的拥有者,并允许他们审查和拉取的改变。 - -克隆一个项目通常是在 Web 服务端完成的,它和使用 Git 命令来管理项目是类似的,甚至推送的过程。然后它返回到 Web 服务打开一个拉取请求,工作就完成了。 - -下一部分我们将整合一些有用的插件到 Git 中来帮你轻松的完成日常工作。 - --------------------------------------------------------------------------------- - -via: https://opensource.com/life/16/7/how-restore-older-file-versions-git - -作者:[Seth Kenlon][a] -译者:[译者ID](https://github.com/strugglingyouth) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth From e1dea4ed3f7f7ecbf336cd6deeb0a462b86f5625 Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 12 Aug 2016 22:47:43 +0800 Subject: [PATCH 1414/1469] =?UTF-8?q?=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 译者因时间放弃。 --- ...60627 TOP 5 BEST VIDEO EDITING SOFTWARE FOR LINUX IN 2016.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/sources/tech/20160627 TOP 5 BEST VIDEO EDITING SOFTWARE FOR LINUX IN 2016.md b/sources/tech/20160627 TOP 5 BEST VIDEO EDITING SOFTWARE FOR LINUX IN 2016.md index 4faee7eaef..44c66359f9 100644 --- a/sources/tech/20160627 TOP 5 BEST VIDEO EDITING SOFTWARE FOR LINUX IN 2016.md +++ b/sources/tech/20160627 TOP 5 BEST VIDEO EDITING SOFTWARE FOR LINUX IN 2016.md @@ -1,5 +1,3 @@ -name1e5s translating - TOP 5 BEST VIDEO EDITING SOFTWARE FOR LINUX IN 2016 ===================================================== From fe1368a7da246d72ffd756f889fcc3de8159ea5e Mon Sep 17 00:00:00 2001 From: tanete Date: Fri, 12 Aug 2016 23:00:12 +0800 Subject: [PATCH 1415/1469] Translating by Tanete A brief introduction to Linux containers and image signing --- ...A brief introduction to Linux containers and image signing.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160810 A brief introduction to Linux containers and image signing.md b/sources/tech/20160810 A brief introduction to Linux containers and image signing.md index c91eab815f..fc9bd181ae 100644 --- a/sources/tech/20160810 A brief introduction to Linux containers and image signing.md +++ b/sources/tech/20160810 A brief introduction to Linux containers and image signing.md @@ -1,3 +1,4 @@ +***Translating by Tanete*** A brief introduction to Linux containers and image signing ==================== From 9d4f8578c699970b0347167978d27d341025d6c9 Mon Sep 17 00:00:00 2001 From: Stdio A Date: Sat, 13 Aug 2016 17:01:57 +0800 Subject: [PATCH 1416/1469] =?UTF-8?q?Translated=2020160406=20Let=E2=80=99s?= =?UTF-8?q?=20Build=20A=20Web=20Server.=20Part=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...160406 Let’s Build A Web Server. Part 2.md | 429 ------------------ ...160406 Let’s Build A Web Server. Part 2.md | 424 +++++++++++++++++ 2 files changed, 424 insertions(+), 429 deletions(-) delete mode 100644 sources/tech/20160406 Let’s Build A Web Server. Part 2.md create mode 100644 translated/tech/20160406 Let’s Build A Web Server. Part 2.md diff --git a/sources/tech/20160406 Let’s Build A Web Server. Part 2.md b/sources/tech/20160406 Let’s Build A Web Server. Part 2.md deleted file mode 100644 index 15593c5085..0000000000 --- a/sources/tech/20160406 Let’s Build A Web Server. Part 2.md +++ /dev/null @@ -1,429 +0,0 @@ -Translating by StdioA - -Let’s Build A Web Server. Part 2. -=================================== - -Remember, in Part 1 I asked you a question: “How do you run a Django application, Flask application, and Pyramid application under your freshly minted Web server without making a single change to the server to accommodate all those different Web frameworks?” Read on to find out the answer. - -In the past, your choice of a Python Web framework would limit your choice of usable Web servers, and vice versa. If the framework and the server were designed to work together, then you were okay: - -![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_before_wsgi.png) - -But you could have been faced (and maybe you were) with the following problem when trying to combine a server and a framework that weren’t designed to work together: - -![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_after_wsgi.png) - -Basically you had to use what worked together and not what you might have wanted to use. - -So, how do you then make sure that you can run your Web server with multiple Web frameworks without making code changes either to the Web server or to the Web frameworks? And the answer to that problem became the Python Web Server Gateway Interface (or WSGI for short, pronounced “wizgy”). - -![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_wsgi_idea.png) - -WSGI allowed developers to separate choice of a Web framework from choice of a Web server. Now you can actually mix and match Web servers and Web frameworks and choose a pairing that suits your needs. You can run Django, Flask, or Pyramid, for example, with Gunicorn or Nginx/uWSGI or Waitress. Real mix and match, thanks to the WSGI support in both servers and frameworks: - -![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_wsgi_interop.png) - -So, WSGI is the answer to the question I asked you in Part 1 and repeated at the beginning of this article. Your Web server must implement the server portion of a WSGI interface and all modern Python Web Frameworks already implement the framework side of the WSGI interface, which allows you to use them with your Web server without ever modifying your server’s code to accommodate a particular Web framework. - -Now you know that WSGI support by Web servers and Web frameworks allows you to choose a pairing that suits you, but it is also beneficial to server and framework developers because they can focus on their preferred area of specialization and not step on each other’s toes. Other languages have similar interfaces too: Java, for example, has Servlet API and Ruby has Rack. - -It’s all good, but I bet you are saying: “Show me the code!” Okay, take a look at this pretty minimalistic WSGI server implementation: - -``` -# Tested with Python 2.7.9, Linux & Mac OS X -import socket -import StringIO -import sys - - -class WSGIServer(object): - - address_family = socket.AF_INET - socket_type = socket.SOCK_STREAM - request_queue_size = 1 - - def __init__(self, server_address): - # Create a listening socket - self.listen_socket = listen_socket = socket.socket( - self.address_family, - self.socket_type - ) - # Allow to reuse the same address - listen_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) - # Bind - listen_socket.bind(server_address) - # Activate - listen_socket.listen(self.request_queue_size) - # Get server host name and port - host, port = self.listen_socket.getsockname()[:2] - self.server_name = socket.getfqdn(host) - self.server_port = port - # Return headers set by Web framework/Web application - self.headers_set = [] - - def set_app(self, application): - self.application = application - - def serve_forever(self): - listen_socket = self.listen_socket - while True: - # New client connection - self.client_connection, client_address = listen_socket.accept() - # Handle one request and close the client connection. Then - # loop over to wait for another client connection - self.handle_one_request() - - def handle_one_request(self): - self.request_data = request_data = self.client_connection.recv(1024) - # Print formatted request data a la 'curl -v' - print(''.join( - '< {line}\n'.format(line=line) - for line in request_data.splitlines() - )) - - self.parse_request(request_data) - - # Construct environment dictionary using request data - env = self.get_environ() - - # It's time to call our application callable and get - # back a result that will become HTTP response body - result = self.application(env, self.start_response) - - # Construct a response and send it back to the client - self.finish_response(result) - - def parse_request(self, text): - request_line = text.splitlines()[0] - request_line = request_line.rstrip('\r\n') - # Break down the request line into components - (self.request_method, # GET - self.path, # /hello - self.request_version # HTTP/1.1 - ) = request_line.split() - - def get_environ(self): - env = {} - # The following code snippet does not follow PEP8 conventions - # but it's formatted the way it is for demonstration purposes - # to emphasize the required variables and their values - # - # Required WSGI variables - env['wsgi.version'] = (1, 0) - env['wsgi.url_scheme'] = 'http' - env['wsgi.input'] = StringIO.StringIO(self.request_data) - env['wsgi.errors'] = sys.stderr - env['wsgi.multithread'] = False - env['wsgi.multiprocess'] = False - env['wsgi.run_once'] = False - # Required CGI variables - env['REQUEST_METHOD'] = self.request_method # GET - env['PATH_INFO'] = self.path # /hello - env['SERVER_NAME'] = self.server_name # localhost - env['SERVER_PORT'] = str(self.server_port) # 8888 - return env - - def start_response(self, status, response_headers, exc_info=None): - # Add necessary server headers - server_headers = [ - ('Date', 'Tue, 31 Mar 2015 12:54:48 GMT'), - ('Server', 'WSGIServer 0.2'), - ] - self.headers_set = [status, response_headers + server_headers] - # To adhere to WSGI specification the start_response must return - # a 'write' callable. We simplicity's sake we'll ignore that detail - # for now. - # return self.finish_response - - def finish_response(self, result): - try: - status, response_headers = self.headers_set - response = 'HTTP/1.1 {status}\r\n'.format(status=status) - for header in response_headers: - response += '{0}: {1}\r\n'.format(*header) - response += '\r\n' - for data in result: - response += data - # Print formatted response data a la 'curl -v' - print(''.join( - '> {line}\n'.format(line=line) - for line in response.splitlines() - )) - self.client_connection.sendall(response) - finally: - self.client_connection.close() - - -SERVER_ADDRESS = (HOST, PORT) = '', 8888 - - -def make_server(server_address, application): - server = WSGIServer(server_address) - server.set_app(application) - return server - - -if __name__ == '__main__': - if len(sys.argv) < 2: - sys.exit('Provide a WSGI application object as module:callable') - app_path = sys.argv[1] - module, application = app_path.split(':') - module = __import__(module) - application = getattr(module, application) - httpd = make_server(SERVER_ADDRESS, application) - print('WSGIServer: Serving HTTP on port {port} ...\n'.format(port=PORT)) - httpd.serve_forever() -``` - -It’s definitely bigger than the server code in Part 1, but it’s also small enough (just under 150 lines) for you to understand without getting bogged down in details. The above server also does more - it can run your basic Web application written with your beloved Web framework, be it Pyramid, Flask, Django, or some other Python WSGI framework. - -Don’t believe me? Try it and see for yourself. Save the above code as webserver2.py or download it directly from GitHub. If you try to run it without any parameters it’s going to complain and exit. - -``` -$ python webserver2.py -Provide a WSGI application object as module:callable -``` - -It really wants to serve your Web application and that’s where the fun begins. To run the server the only thing you need installed is Python. But to run applications written with Pyramid, Flask, and Django you need to install those frameworks first. Let’s install all three of them. My preferred method is by using virtualenv. Just follow the steps below to create and activate a virtual environment and then install all three Web frameworks. - -``` -$ [sudo] pip install virtualenv -$ mkdir ~/envs -$ virtualenv ~/envs/lsbaws/ -$ cd ~/envs/lsbaws/ -$ ls -bin include lib -$ source bin/activate -(lsbaws) $ pip install pyramid -(lsbaws) $ pip install flask -(lsbaws) $ pip install django -``` - -At this point you need to create a Web application. Let’s start with Pyramid first. Save the following code as pyramidapp.py to the same directory where you saved webserver2.py or download the file directly from GitHub: - -``` -from pyramid.config import Configurator -from pyramid.response import Response - - -def hello_world(request): - return Response( - 'Hello world from Pyramid!\n', - content_type='text/plain', - ) - -config = Configurator() -config.add_route('hello', '/hello') -config.add_view(hello_world, route_name='hello') -app = config.make_wsgi_app() -``` - -Now you’re ready to serve your Pyramid application with your very own Web server: - -``` -(lsbaws) $ python webserver2.py pyramidapp:app -WSGIServer: Serving HTTP on port 8888 ... -``` - -You just told your server to load the ‘app’ callable from the python module ‘pyramidapp’ Your server is now ready to take requests and forward them to your Pyramid application. The application only handles one route now: the /hello route. Type http://localhost:8888/hello address into your browser, press Enter, and observe the result: - -![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_browser_pyramid.png) - -You can also test the server on the command line using the ‘curl’ utility: - -``` -$ curl -v http://localhost:8888/hello -... -``` - -Check what the server and curl prints to standard output. - -Now onto Flask. Let’s follow the same steps. - -``` -from flask import Flask -from flask import Response -flask_app = Flask('flaskapp') - - -@flask_app.route('/hello') -def hello_world(): - return Response( - 'Hello world from Flask!\n', - mimetype='text/plain' - ) - -app = flask_app.wsgi_app -``` - -Save the above code as flaskapp.py or download it from GitHub and run the server as: - -``` -(lsbaws) $ python webserver2.py flaskapp:app -WSGIServer: Serving HTTP on port 8888 ... -``` - -Now type in the http://localhost:8888/hello into your browser and press Enter: - -![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_browser_flask.png) - -Again, try ‘curl’ and see for yourself that the server returns a message generated by the Flask application: - -``` -$ curl -v http://localhost:8888/hello -... -``` - -Can the server also handle a Django application? Try it out! It’s a little bit more involved, though, and I would recommend cloning the whole repo and use djangoapp.py, which is part of the GitHub repository. Here is the source code which basically adds the Django ‘helloworld’ project (pre-created using Django’s django-admin.py startproject command) to the current Python path and then imports the project’s WSGI application. - -``` -import sys -sys.path.insert(0, './helloworld') -from helloworld import wsgi - - -app = wsgi.application -``` - -Save the above code as djangoapp.py and run the Django application with your Web server: - -``` -(lsbaws) $ python webserver2.py djangoapp:app -WSGIServer: Serving HTTP on port 8888 ... -``` - -Type in the following address and press Enter: - -![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_browser_django.png) - -And as you’ve already done a couple of times before, you can test it on the command line, too, and confirm that it’s the Django application that handles your requests this time around: - -``` -$ curl -v http://localhost:8888/hello -... -``` - -Did you try it? Did you make sure the server works with those three frameworks? If not, then please do so. Reading is important, but this series is about rebuilding and that means you need to get your hands dirty. Go and try it. I will wait for you, don’t worry. No seriously, you must try it and, better yet, retype everything yourself and make sure that it works as expected. - -Okay, you’ve experienced the power of WSGI: it allows you to mix and match your Web servers and Web frameworks. WSGI provides a minimal interface between Python Web servers and Python Web Frameworks. It’s very simple and it’s easy to implement on both the server and the framework side. The following code snippet shows the server and the framework side of the interface: - -``` -def run_application(application): - """Server code.""" - # This is where an application/framework stores - # an HTTP status and HTTP response headers for the server - # to transmit to the client - headers_set = [] - # Environment dictionary with WSGI/CGI variables - environ = {} - - def start_response(status, response_headers, exc_info=None): - headers_set[:] = [status, response_headers] - - # Server invokes the ‘application' callable and gets back the - # response body - result = application(environ, start_response) - # Server builds an HTTP response and transmits it to the client - … - -def app(environ, start_response): - """A barebones WSGI app.""" - start_response('200 OK', [('Content-Type', 'text/plain')]) - return ['Hello world!'] - -run_application(app) -``` - -Here is how it works: - -1. The framework provides an ‘application’ callable (The WSGI specification doesn’t prescribe how that should be implemented) -2. The server invokes the ‘application’ callable for each request it receives from an HTTP client. It passes a dictionary ‘environ’ containing WSGI/CGI variables and a ‘start_response’ callable as arguments to the ‘application’ callable. -3. The framework/application generates an HTTP status and HTTP response headers and passes them to the ‘start_response’ callable for the server to store them. The framework/application also returns a response body. -4. The server combines the status, the response headers, and the response body into an HTTP response and transmits it to the client (This step is not part of the specification but it’s the next logical step in the flow and I added it for clarity) - -And here is a visual representation of the interface: - -![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_wsgi_interface.png) - -So far, you’ve seen the Pyramid, Flask, and Django Web applications and you’ve seen the server code that implements the server side of the WSGI specification. You’ve even seen the barebones WSGI application code snippet that doesn’t use any framework. - -The thing is that when you write a Web application using one of those frameworks you work at a higher level and don’t work with WSGI directly, but I know you’re curious about the framework side of the WSGI interface, too because you’re reading this article. So, let’s create a minimalistic WSGI Web application/Web framework without using Pyramid, Flask, or Django and run it with your server: - -``` -def app(environ, start_response): - """A barebones WSGI application. - - This is a starting point for your own Web framework :) - """ - status = '200 OK' - response_headers = [('Content-Type', 'text/plain')] - start_response(status, response_headers) - return ['Hello world from a simple WSGI application!\n'] -``` - -Again, save the above code in wsgiapp.py file or download it from GitHub directly and run the application under your Web server as: - -``` -(lsbaws) $ python webserver2.py wsgiapp:app -WSGIServer: Serving HTTP on port 8888 ... -``` - -Type in the following address and press Enter. This is the result you should see: - -![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_browser_simple_wsgi_app.png) - -You just wrote your very own minimalistic WSGI Web framework while learning about how to create a Web server! Outrageous. - -Now, let’s get back to what the server transmits to the client. Here is the HTTP response the server generates when you call your Pyramid application using an HTTP client: - -![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_http_response.png) - -The response has some familiar parts that you saw in Part 1 but it also has something new. It has, for example, four HTTP headers that you haven’t seen before: Content-Type, Content-Length, Date, and Server. Those are the headers that a response from a Web server generally should have. None of them are strictly required, though. The purpose of the headers is to transmit additional information about the HTTP request/response. - -Now that you know more about the WSGI interface, here is the same HTTP response with some more information about what parts produced it: - -![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_http_response_explanation.png) - -I haven’t said anything about the ‘environ’ dictionary yet, but basically it’s a Python dictionary that must contain certain WSGI and CGI variables prescribed by the WSGI specification. The server takes the values for the dictionary from the HTTP request after parsing the request. This is what the contents of the dictionary look like: - -![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_environ.png) - -A Web framework uses the information from that dictionary to decide which view to use based on the specified route, request method etc., where to read the request body from and where to write errors, if any. - -By now you’ve created your own WSGI Web server and you’ve made Web applications written with different Web frameworks. And, you’ve also created your barebones Web application/Web framework along the way. It’s been a heck of a journey. Let’s recap what your WSGI Web server has to do to serve requests aimed at a WSGI application: - -- First, the server starts and loads an ‘application’ callable provided by your Web framework/application -- Then, the server reads a request -- Then, the server parses it -- Then, it builds an ‘environ’ dictionary using the request data -- Then, it calls the ‘application’ callable with the ‘environ’ dictionary and a ‘start_response’ callable as parameters and gets back a response body. -- Then, the server constructs an HTTP response using the data returned by the call to the ‘application’ object and the status and response headers set by the ‘start_response’ callable. -- And finally, the server transmits the HTTP response back to the client - -![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_server_summary.png) - -That’s about all there is to it. You now have a working WSGI server that can serve basic Web applications written with WSGI compliant Web frameworks like Django, Flask, Pyramid, or your very own WSGI framework. The best part is that the server can be used with multiple Web frameworks without any changes to the server code base. Not bad at all. - -Before you go, here is another question for you to think about, “How do you make your server handle more than one request at a time?” - -Stay tuned and I will show you a way to do that in Part 3. Cheers! - -BTW, I’m writing a book “Let’s Build A Web Server: First Steps” that explains how to write a basic web server from scratch and goes into more detail on topics I just covered. Subscribe to the mailing list to get the latest updates about the book and the release date. - --------------------------------------------------------------------------------- - -via: https://ruslanspivak.com/lsbaws-part2/ - -作者:[Ruslan][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://github.com/rspivak/ - - - - - - diff --git a/translated/tech/20160406 Let’s Build A Web Server. Part 2.md b/translated/tech/20160406 Let’s Build A Web Server. Part 2.md new file mode 100644 index 0000000000..2bbf783c51 --- /dev/null +++ b/translated/tech/20160406 Let’s Build A Web Server. Part 2.md @@ -0,0 +1,424 @@ +搭个 Web 服务器(二) +=================================== + +在第一部分中,我提出了一个问题:“你要如何在不对程序做任何改动的情况下,在你刚刚搭建起来的 Web 服务器上适配 Django, Flask 或 Pyramid 应用呢?”我们可以从这一篇中找到答案。 + +曾几何时,你对 Python Web 框架种类作出的选择会对可用的 Web 服务器类型造成限制,反之亦然。如果框架及服务器在设计层面可以一起工作(相互适配),那么一切正常: + +![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_before_wsgi.png) + +但你可能正面对着(或者曾经面对过)尝试将一对无法适配的框架和服务器搭配在一起的问题: + +![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_after_wsgi.png) + +基本上,你需要选择那些能够一起工作的框架和服务器,而不能选择你想用的那些。 + +所以,你该如何确保在不对代码做任何更改的情况下,让你的 Web 服务器和多个不同的 Web 框架一同工作呢?这个问题的答案,就是 Python Web 服务器网关接口(缩写为 WSGI,念做“wizgy”)。 + +![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_wsgi_idea.png) + +WSGI 允许开发者互不干扰地选择 Web 框架及 Web 服务器的类型。现在,你可以真正将 Web 服务器及框架任意搭配,然后选出你最中意的那对组合。比如,你可以使用 Django,Flask 或者 Pyramid,与 Gunicorn,Nginx/uWSGI 或 Waitress 进行结合。感谢 WSGI 同时对服务器与框架的支持,我们可以真正随意选择它们的搭配了。 + +![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_wsgi_interop.png) + +所以,WSGI 就是我在第一部分中提出,又在本文开头重复了一遍的那个问题的答案。你的 Web 服务器必须实现 WSGI 接口的服务器部分,而现代的 Python Web 框架均已实现了 WSGI 接口的框架部分,这使得你可以直接在 Web 服务器中使用任意框架,而不需要更改任何服务器代码,以对特定的 Web 框架实现兼容。 + +现在,你一个知道 Web 服务器及 Web 框架对 WSGI 的支持使得你可以选择最合适的一对来使用,而且它对服务器和框架的开发者依然有益,因为他们只需专注于他们擅长的部分来进行开发,而不需要触及另一部分的代码。其它语言也拥有类似的接口,比如:Java 拥有 Servlet API,而 Ruby 拥有 Rack. + +这些理论都不错,但是我打赌你在说:“给我看代码!” 那好,我们来看看下面这个很小的 WSGI 服务器实现: + +``` +# 使用 Python 2.7.9,在 Linux 及 Mac OS X 下测试通过 +import socket +import StringIO +import sys + + +class WSGIServer(object): + + address_family = socket.AF_INET + socket_type = socket.SOCK_STREAM + request_queue_size = 1 + + def __init__(self, server_address): + # Create a listening socket + self.listen_socket = listen_socket = socket.socket( + self.address_family, + self.socket_type + ) + # 允许复用同一地址 + listen_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + # 绑定地址 + listen_socket.bind(server_address) + # 激活套接字 + listen_socket.listen(self.request_queue_size) + # 获取主机名称及端口 + host, port = self.listen_socket.getsockname()[:2] + self.server_name = socket.getfqdn(host) + self.server_port = port + # 由 Web 框架/应用设定的响应头部字段 + self.headers_set = [] + + def set_app(self, application): + self.application = application + + def serve_forever(self): + listen_socket = self.listen_socket + while True: + # 获取新的客户端连接 + self.client_connection, client_address = listen_socket.accept() + # 处理一条请求后关闭连接,然后循环等待另一个连接建立 + self.handle_one_request() + + def handle_one_request(self): + self.request_data = request_data = self.client_connection.recv(1024) + # 以 'curl -v' 的风格输出格式化请求数据 + print(''.join( + '< {line}\n'.format(line=line) + for line in request_data.splitlines() + )) + + self.parse_request(request_data) + + # 根据请求数据构建环境字典 + env = self.get_environ() + + # 此时需要调用 Web 应用来获取结果, + # 取回的结果将成为 HTTP 响应体 + result = self.application(env, self.start_response) + + # 构造一个响应,回送至客户端 + self.finish_response(result) + + def parse_request(self, text): + request_line = text.splitlines()[0] + request_line = request_line.rstrip('\r\n') + # 将请求行分开成组 + (self.request_method, # GET + self.path, # /hello + self.request_version # HTTP/1.1 + ) = request_line.split() + + def get_environ(self): + env = {} + # 以下代码段没有遵循 PEP8 规则,但它这样排版,是为了通过强调 + # 所需变量及它们的值,来达到其展示目的。 + # + # WSGI 必需变量 + env['wsgi.version'] = (1, 0) + env['wsgi.url_scheme'] = 'http' + env['wsgi.input'] = StringIO.StringIO(self.request_data) + env['wsgi.errors'] = sys.stderr + env['wsgi.multithread'] = False + env['wsgi.multiprocess'] = False + env['wsgi.run_once'] = False + # CGI 必需变量 + env['REQUEST_METHOD'] = self.request_method # GET + env['PATH_INFO'] = self.path # /hello + env['SERVER_NAME'] = self.server_name # localhost + env['SERVER_PORT'] = str(self.server_port) # 8888 + return env + + def start_response(self, status, response_headers, exc_info=None): + # 添加必要的服务器头部字段 + server_headers = [ + ('Date', 'Tue, 31 Mar 2015 12:54:48 GMT'), + ('Server', 'WSGIServer 0.2'), + ] + self.headers_set = [status, response_headers + server_headers] + # 为了遵循 WSGI 协议,start_response 函数必须返回一个 'write' + # 可调用对象(返回值.write 可以作为函数调用)。为了简便,我们 + # 在这里无视这个细节。 + # return self.finish_response + + def finish_response(self, result): + try: + status, response_headers = self.headers_set + response = 'HTTP/1.1 {status}\r\n'.format(status=status) + for header in response_headers: + response += '{0}: {1}\r\n'.format(*header) + response += '\r\n' + for data in result: + response += data + # 以 'curl -v' 的风格输出格式化请求数据 + print(''.join( + '> {line}\n'.format(line=line) + for line in response.splitlines() + )) + self.client_connection.sendall(response) + finally: + self.client_connection.close() + + +SERVER_ADDRESS = (HOST, PORT) = '', 8888 + + +def make_server(server_address, application): + server = WSGIServer(server_address) + server.set_app(application) + return server + + +if __name__ == '__main__': + if len(sys.argv) < 2: + sys.exit('Provide a WSGI application object as module:callable') + app_path = sys.argv[1] + module, application = app_path.split(':') + module = __import__(module) + application = getattr(module, application) + httpd = make_server(SERVER_ADDRESS, application) + print('WSGIServer: Serving HTTP on port {port} ...\n'.format(port=PORT)) + httpd.serve_forever() +``` + +当然,这段代码要比第一部分的服务器代码长不少,但它仍然很短(只有不到 150 行),你可以轻松理解它,而不需要深究细节。上面的服务器代码还可以做更多——它可以用来运行一些你喜欢的框架写出的 Web 应用,可以是 Pyramid,Flask,Django 或其它 Python WSGI 框架。 + +不相信吗?自己来试试看吧。把以上的代码保存为 `webserver2.py`,或直接从 Github 上下载它。如果你打算不加任何参数而直接运行它,它会抱怨一句,然后退出。 + +``` +$ python webserver2.py +Provide a WSGI application object as module:callable +``` + +它想做的其实是为你的 Web 应用服务,而这才是重头戏。为了运行这个服务器,你只需要安装 Python。不过,如果你希望运行 Pyramid,Flask 或 Django 应用,你还需要先安装那些框架。那我们把这三个都装上吧。我推荐的安装方式是通过 `virtualenv` 安装。按照以下几步来做,你就可以创建并激活一个虚拟环境,并在其中安装以上三个 Web 框架。 + +``` +$ [sudo] pip install virtualenv +$ mkdir ~/envs +$ virtualenv ~/envs/lsbaws/ +$ cd ~/envs/lsbaws/ +$ ls +bin include lib +$ source bin/activate +(lsbaws) $ pip install pyramid +(lsbaws) $ pip install flask +(lsbaws) $ pip install django +``` + +现在,你需要创建一个 Web 应用。我们先从 Pyramid 开始吧。把以下代码保存为 `pyramidapp.py`,并与刚刚的 `webserver2.py` 放置在同一目录,或直接从 Github 下载该文件: + +``` +from pyramid.config import Configurator +from pyramid.response import Response + + +def hello_world(request): + return Response( + 'Hello world from Pyramid!\n', + content_type='text/plain', + ) + +config = Configurator() +config.add_route('hello', '/hello') +config.add_view(hello_world, route_name='hello') +app = config.make_wsgi_app() +``` + +现在,你可以用你自己的 Web 服务器来运行你的 Pyramid 应用了: + +``` +(lsbaws) $ python webserver2.py pyramidapp:app +WSGIServer: Serving HTTP on port 8888 ... +``` + +你刚刚让你的服务器去加载 Python 模块 `pyramidapp` 中的可执行对象 `app`。现在你的服务器可以接收请求,并将它们转发到 Pyramid 应用中了。在浏览器中输入 http://localhost:8888/hello ,敲一下回车,然后看看结果: + +![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_browser_pyramid.png) + +你也可以使用命令行工具 `curl` 来测试服务器: + +``` +$ curl -v http://localhost:8888/hello +... +``` + +看看服务器和 `curl` 向标准输出流打印的内容吧。 + +现在来试试 `Flask`。运行步骤跟上面的一样。 + +``` +from flask import Flask +from flask import Response +flask_app = Flask('flaskapp') + + +@flask_app.route('/hello') +def hello_world(): + return Response( + 'Hello world from Flask!\n', + mimetype='text/plain' + ) + +app = flask_app.wsgi_app +``` + +将以上代码保存为 `flaskapp.py`,或者直接从 Github + 下载,然后输入以下命令运行服务器: + +``` +(lsbaws) $ python webserver2.py flaskapp:app +WSGIServer: Serving HTTP on port 8888 ... +``` + +现在在浏览器中输入 http://localhost:8888/hello ,敲一下回车: + +![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_browser_flask.png) + +同样,尝试一下 `curl`,然后你会看到服务器返回了一条 `Flask` 应用生成的信息: + +``` +$ curl -v http://localhost:8888/hello +... +``` + +这个服务器能处理 Django 应用吗?试试看吧!不过这个任务可能有点复杂,所以我建议你将整个仓库克隆下来,然后使用 Github 仓库中的 `djangoapp.py` 来完成这个实验。下面是它的源代码,你可以看到它将 Django `helloword` 工程(已使用 `Django` 的 `django-admin.py startproject` 命令创建完毕)添加到了当前的 Python 路径中,然后导入了这个工程的 WSGI 应用。 + +``` +import sys +sys.path.insert(0, './helloworld') +from helloworld import wsgi + + +app = wsgi.application +``` + +将以上代码保存为 `djangoapp.py`,然后用你的 Web 服务器运行这个 Django 应用: + +``` +(lsbaws) $ python webserver2.py djangoapp:app +WSGIServer: Serving HTTP on port 8888 ... +``` + +输入以下链接,敲回车: + +![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_browser_django.png) + +你这次也可以在命令行中测试——你之前应该已经做过两次了——来确认 Django 应用处理了你的请求: + +``` +$ curl -v http://localhost:8888/hello +... +``` + +你试过了吗?你确定这个服务器可以与那三个框架搭配工作吗?如果没试,请去试一下。阅读固然重要,但这个系列的内容是重建,这意味着你需要亲自动手干点活。去试一下吧。别担心,我等着你呢。不开玩笑,你真的需要试一下,亲自尝试每一步,并确保它像预期的那样工作。 + +好,你已经体验到了 WSGI 的威力:它可以使 Web 服务器及 Web 框架随意搭配。WSGI 在 Python Web 服务器及框架之间提供了一个微型接口。它非常简单,而且在服务器和框架端均可以轻易实现。下面的代码片段展示了 WSGI 接口的服务器及框架端实现: + +``` +def run_application(application): + """服务器端代码。""" + # Web 应用/框架在这里存储 HTTP 状态码以及 HTTP 响应头部, + # 服务器会将这些信息传递给客户端 + headers_set = [] + # 用于存储 WSGI/CGI 环境变量的字典 + environ = {} + + def start_response(status, response_headers, exc_info=None): + headers_set[:] = [status, response_headers] + + # 服务器唤醒可执行变量“application”,获得响应头部 + result = application(environ, start_response) + # 服务器组装一个 HTTP 响应,将其传送至客户端 + … + +def app(environ, start_response): + """一个空的 WSGI 应用""" + start_response('200 OK', [('Content-Type', 'text/plain')]) + return ['Hello world!'] + +run_application(app) +``` + +这是它的工作原理: + +1. Web 框架提供一个可调用对象 `application` (WSGI 规范没有规定它的实现方式) +2. Web 服务器每次收到来自客户端的 HTTP 请求后,会唤醒可调用对象 `applition`。它会向该对象传递一个包含 WSGI/CGI 变量的字典,以及一个可调用对象 `start_response` +3. Web 框架或应用生成 HTTP 状态码、HTTP 响应头部,然后将它传给 `start_response` 函数,服务器会将其存储起来。同时,Web 框架或应用也会返回 HTTP 响应正文。 +4. 服务器将状态码、响应头部及响应正文组装成一个 HTTP 响应,然后将其传送至客户端(这一步并不在 WSGI 规范中,但从逻辑上讲,这一步应该包含在工作流程之中。所以为了明确这个过程,我把它写了出来) + +这是这个接口规范的图形化表达: + +![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_wsgi_interface.png) + +到现在为止,你已经看过了用 Pyramid, Flask 和 Django 写出的 Web 应用的代码,你也看到了一个 Web 服务器如何用代码来实现另一半(服务器端的) WSGI 规范。你甚至还看到了我们如何在不使用任何框架的情况下,使用一段代码来实现一个最简单的 WSGI Web 应用。 + +其实,当你使用上面的框架编写一个 Web 应用时,你只是在较高的层面工作,而不需要直接与 WSGI 打交道。但是我知道你一定也对 WSGI 接口的框架部分,因为你在看这篇文章呀。所以,我们不用 Pyramid, Flask 或 Django,而是自己动手来创造一个最朴素的 WSGI Web 应用(或 Web 框架),然后将它和你的服务器一起运行: + +``` +def app(environ, start_response): + """一个最简单的 WSGI 应用。 + + 这是你自己的 Web 框架的起点 ^_^ + """ + status = '200 OK' + response_headers = [('Content-Type', 'text/plain')] + start_response(status, response_headers) + return ['Hello world from a simple WSGI application!\n'] +``` + +同样,将上面的代码保存至 `wsgiapp.py` 或直接从 Github 上下载该文件,然后在 Web 服务器上运行这个应用,像这样: + +``` +(lsbaws) $ python webserver2.py wsgiapp:app +WSGIServer: Serving HTTP on port 8888 ... +``` + +在浏览器中输入下面的地址,然后按下回车。这是你应该看到的结果: + +![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_browser_simple_wsgi_app.png) + +你刚刚在学习如何创建一个 Web 服务器的过程中,自己编写了一个最朴素的 WSGI Web 框架!棒极了! + +现在,我们再回来看看服务器传给客户端的那些东西。这是在使用 HTTP 客户端调用你的 Pyramid 应用时,服务器生成的 HTTP 响应内容: + +![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_http_response.png) + +这个响应和你在本系列第一部分中看到的 HTTP 响应有一部分共同点,但它还多出来了一些内容。比如说,它拥有四个你曾经没见过的 HTTP 头部:`Content-Type`, `Content-Length`, `Date` 以及 `Server`。这些头部内容基本上在每个 Web 服务器返回的响应中都会出现。不过,它们都不是被严格要求出现的。HTTP 请求/响应头部字段的目的,在于它可以向你传递一些关于 HTTP 请求/响应的额外信息。 + +既然你对 WSGI 接口了解的更深了一些,那我再来展示一下上面那个 HTTP 响应中的各个部分的信息来源: + +![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_http_response_explanation.png) + +我现在还没有对上面那个 `environ` 字典做任何解释,不过基本上这个字典必须包含那些被 WSGI 规范事先定义好的 WSGI 及 CGI 变量值。服务器在解析 HTTP 请求时,会从请求中获取这些变量的值。这是 `environ` 字典应该有的样子: + +![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_environ.png) + +Web 框架会利用以上字典中包含的信息,通过字典中的请求路径、请求动作等等来决定使用哪个视图来处理响应、在哪里读取请求正文、在哪里输出错误信息(如果有的话)。 + +现在,你已经创造了属于你自己的 WSGI Web 服务器,你也使用不同 Web 框架做了几个 Web 应用。而且,你在这个过程中也自己创造出了一个朴素的 Web 应用及框架。这个过程真是累人。现在我们来回顾一下,你的 WSGI Web 服务器在服务请求时,需要针对 WSGI 应用做些什么: + +- 首先,服务器开始工作,然后会加载一个可调用对象 `application`,这个对象由你的 Web 框架或应用提供 +- 然后,服务器读取一个请求 +- 然后,服务器会解析这个请求 +- 然后,服务器会使用请求数据来构建一个 `environ` 字典 +- 然后,它会用 `environ` 字典及一个可调用对象 `start_response` 作为参数,来调用 `application`,并获取响应体内容。 +- 然后,服务器会使用 `application` 返回的响应体,和 `start_response` 函数设置的状态码及响应头部内容,来构建一个 HTTP 响应。 +- 最终,服务器将 HTTP 响应回送给客户端。 + +![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_server_summary.png) + +这基本上是服务器要做的全部内容了。你现在有了一个可以正常工作的 WSGI 服务器,它可以为使用任何遵循 WSGI 规范的 Web 框架(如 Django, Flask, Pyramid, 还有你刚刚自己写的那个框架)构建出的 Web 应用服务。最棒的部分在于,它可以在不用更改任何服务器代码的情况下,与多个不同的 Web 框架一起工作。真不错。 + +在结束之前,你可以想想这个问题:“你该如何让你的服务器在同一时间处理多个请求呢?” + +敬请期待,我会在第三部分向你展示一种解决这个问题的方法。干杯! + +顺便,我在撰写一本名为《搭个 Web 服务器:从头开始》的书。这本书讲解了如何从头开始编写一个基本的 Web 服务器,里面包含本文中没有的更多细节。订阅邮件列表,你就可以获取到这本书的最新进展,以及发布日期。 + +-------------------------------------------------------------------------------- + +via: https://ruslanspivak.com/lsbaws-part2/ + +作者:[Ruslan][a] +译者:[StdioA](https://github.com/StdioA) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://github.com/rspivak/ + + + + + + From 9bb78dd4277143661442efcfd89cd3f526f7478f Mon Sep 17 00:00:00 2001 From: Stdio A Date: Sat, 13 Aug 2016 17:07:35 +0800 Subject: [PATCH 1417/1469] =?UTF-8?q?Translationg=2020160809=20Part=203=20?= =?UTF-8?q?-=20Let=E2=80=99s=20Build=20A=20Web=20Server.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...eb Server.md => 20160809 Part 3 - Let’s Build A Web Server.md} | 2 ++ 1 file changed, 2 insertions(+) rename sources/tech/{Part 3 - Let’s Build A Web Server.md => 20160809 Part 3 - Let’s Build A Web Server.md} (99%) diff --git a/sources/tech/Part 3 - Let’s Build A Web Server.md b/sources/tech/20160809 Part 3 - Let’s Build A Web Server.md similarity index 99% rename from sources/tech/Part 3 - Let’s Build A Web Server.md rename to sources/tech/20160809 Part 3 - Let’s Build A Web Server.md index 40a9ccd0b7..4301ab8afb 100644 --- a/sources/tech/Part 3 - Let’s Build A Web Server.md +++ b/sources/tech/20160809 Part 3 - Let’s Build A Web Server.md @@ -1,3 +1,5 @@ +translating by StdioA + Part 3 - Let’s Build A Web Server ===================================== From 79fce5d06b07042eff24f71cea2628c226450cbb Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 13 Aug 2016 20:36:32 +0800 Subject: [PATCH 1418/1469] PUB:20160306 5 Favorite Open Source Django Packages @StdioA --- ... 5 Favorite Open Source Django Packages.md | 161 +++++++++++++++++ ... 5 Favorite Open Source Django Packages.md | 164 ------------------ 2 files changed, 161 insertions(+), 164 deletions(-) create mode 100644 published/20160306 5 Favorite Open Source Django Packages.md delete mode 100644 translated/talk/yearbook2015/20160306 5 Favorite Open Source Django Packages.md diff --git a/published/20160306 5 Favorite Open Source Django Packages.md b/published/20160306 5 Favorite Open Source Django Packages.md new file mode 100644 index 0000000000..c97ed74570 --- /dev/null +++ b/published/20160306 5 Favorite Open Source Django Packages.md @@ -0,0 +1,161 @@ +5 个最受人喜爱的开源 Django 包 +================================================================================ + +![Yearbook cover 2015](https://opensource.com/sites/default/files/styles/image-full-size/public/u23316/osdc-open-source-yearbook-lead8.png?itok=0_5-hdFE) + +图片来源:Opensource.com + +_Jacob Kaplan-Moss 和 Frank Wiles 也参与了本文的写作。_ + +Django 围绕“[可重用应用][1]”的思想建立:自包含的包提供了可重复使用的特性。你可以将这些可重用应用组装起来,在加上适用于你的网站的特定代码,来搭建你自己的网站。Django 具有一个丰富多样的、由可供你使用的可重用应用组建起来的生态系统——PyPI 列出了[超过 8000个 Django 应用][2]——可你该如何知道哪些是最好的呢? + +为了节省你的时间,我们总结了五个最受喜爱的 Django 应用。它们是: + +- [Cookiecutter][3]: 建立 Django 网站的最佳方式。 +- [Whitenoise][4]: 最棒的静态资源服务器。 +- [Django Rest Framework][5]: 使用 Django 开发 REST API 的最佳方式。 +- [Wagtail][6]: 基于 Django 的最佳内容管理系统(CMS)。 +- [django-allauth][7]: 提供社交账户登录的最佳应用(如 Twitter, Facebook, GitHub 等)。 + +我们同样推荐你看看 [Django Packages][8],这是一个可重用 Django 应用的目录。Django Packages 将 Django 应用组织成“表格”,你可以在功能相似的不同应用之间进行比较并做出选择。你可以查看每个包中提供的特性和使用统计情况。(比如:这是[ REST 工具的表格][9],也许可以帮助你理解我们为何推荐 Django REST Framework。 + +### 为什么你应该相信我们? + +我们使用 Django 的时间几乎比任何人都长。在 Django 发布之前,我们当中的两个人(Frank 和 Jacob)就在 [Lawrence Journal-World][10] (Django 的发源地)工作(事实上,是他们两人推动了 Django 开源发布的进程)。我们在过去的八年当中运行着一个咨询公司,来建议公司怎样最好地应用 Django。 + +所以,我们见证了 Django 项目和社群的完整历史,我们见证了那些流行的软件包的兴起和没落。在我们三个之中,我们个人可能试用了 8000 个应用中至少一半以上,或者我们知道谁试用过这些。我们对如何使应用变得坚实可靠有着深刻的理解,并且我们对给予这些应用持久力量的来源也有着深入的了解。 + +### 建立 Django 网站的最佳方式:[Cookiecutter][3] + +建立一个新项目或应用总是有些痛苦。你可以用 Django 内建的 `startproject`。不过,如果你像我们一样,对如何做事比较挑剔。Cookiecutter 为你提供了一个快捷简单的方式来构建项目或易于重用的应用模板,从而解决了这个问题。一个简单的例子:键入 `pip install cookiecutter`,然后在命令行中运行以下命令: + +```bash +$ cookiecutter https://github.com/marcofucci/cookiecutter-simple-django +``` + +接下来你需要回答几个简单的问题,比如你的项目名称、目录(repo)、作者名字、E-Mail 和其他几个关于配置的小问题。这些能够帮你补充项目相关的细节。我们使用最最原始的 “_foo_” 作为我们的目录名称。所以 cokkiecutter 在子目录 “_foo_” 下建立了一个简单的 Django 项目。 + +如果你在 “_foo_” 项目中闲逛,你会看见你刚刚选择的其它设置已通过模板,连同所需的子目录一同嵌入到文件当中。这个“模板”在我们刚刚在执行 `cookiecutter` 命令时输入的唯一一个参数 Github 仓库 URL 中定义。这个样例工程使用了一个 Github 远程仓库作为模板;不过你也可以使用本地的模板,这在建立非重用项目时非常有用。 + +我们认为 cookiecutter 是一个极棒的 Django 包,但是,事实上其实它在面对纯 Python 甚至非 Python 相关需求时也极为有用。你能够将所有文件以一种可重复的方式精确地摆放在任何位置上,使得 cookiecutter 成为了一个简化(DRY)工作流程的极佳工具。 + +### 最棒的静态资源服务器:[Whitenoise][4] + +多年来,托管网站的静态资源——图片、Javascript、CSS——都是一件很痛苦的事情。Django 内建的 [django.views.static.serve][11] 视图,就像 Django 文章所述的那样,“在生产环境中不可靠,所以只应为开发环境的提供辅助功能。”但使用一个“真正的” Web 服务器,如 NGINX 或者借助 CDN 来托管媒体资源,配置起来会比较困难。 + +Whitenoice 很简洁地解决了这个问题。它可以像在开发环境那样轻易地在生产环境中设置静态服务器,并且针对生产环境进行了加固和优化。它的设置方法极为简单: + +1. 确保你在使用 Django 的 [contrib.staticfiles][12] 应用,并确认你在配置文件中正确设置了 `STATIC_ROOT` 变量。 + +2. 在 `wsgi.py` 文件中启用 Whitenoise: + + ```python + from django.core.wsgi import get_wsgi_application + from whitenoise.django import DjangoWhiteNoise + + application = get_wsgi_application() + application = DjangoWhiteNoise(application) + ``` + +配置它真的就这么简单!对于大型应用,你可能想要使用一个专用的媒体服务器和/或一个 CDN,但对于大多数小型或中型 Django 网站,Whitenoise 已经足够强大。 + +如需查看更多关于 Whitenoise 的信息,[请查看文档][13]。 + +### 开发 REST API 的最佳工具:[Django REST Framework][5] + +REST API 正在迅速成为现代 Web 应用的标准功能。 API 就是简单的使用 JSON 对话而不是 HTML,当然你可以只用 Django 做到这些。你可以制作自己的视图,设置合适的 `Content-Type`,然后返回 JSON 而不是渲染后的 HTML 响应。这是在像 [Django Rest Framework][14](下称 DRF)这样的 API 框架发布之前,大多数人所做的。 + +如果你对 Django 的视图类很熟悉,你会觉得使用 DRF 构建 REST API 与使用它们很相似,不过 DRF 只针对特定 API 使用场景而设计。一般的 API 设置只需要一点代码,所以我们没有提供一份让你兴奋的示例代码,而是强调了一些可以让你生活的更舒适的 DRF 特性: + +* 可自动预览的 API 可以使你的开发和人工测试轻而易举。你可以查看 DRF 的[示例代码][15]。你可以查看 API 响应,并且不需要你做任何事就可以支持 POST/PUT/DELETE 类型的操作。 +* 便于集成各种认证方式,如 OAuth, Basic Auth, 或API Tokens。 +* 内建请求速率限制。 +* 当与 [django-rest-swagger][16] 组合使用时,API 文档几乎可以自动生成。 +* 广泛的第三方库生态。 + +当然,你可以不依赖 DRF 来构建 API,但我们无法想象你不去使用 DRF 的原因。就算你不使用 DRF 的全部特性,使用一个成熟的视图库来构建你自己的 API 也会使你的 API 更加一致、完全,更能提高你的开发速度。如果你还没有开始使用 DRF, 你应该找点时间去体验一下。 + +## 基于 Django 的最佳 CMS:[Wagtail][6] + +Wagtail 是当下 Django CMS(内容管理系统)世界中最受人青睐的应用,并且它的热门有足够的理由。就像大多数的 CMS 一样,它具有极佳的灵活性,可以通过简单的 Django 模型来定义不同类型的页面及其内容。使用它,你可以从零开始在几个小时而不是几天之内来和建造一个基本可以运行的内容管理系统。举一个小例子,为你公司的员工定义一个员工页面类型可以像下面一样简单: + +```python +from wagtail.wagtailcore.models import Page +from wagtail.wagtailcore.fields import RichTextField +from wagtail.wagtailadmin.edit_handlers import FieldPanel, MultiFieldPanel +from wagtail.wagtailimages.edit_handlers import ImageChooserPanel + +class StaffPage(Page): + name = models.CharField(max_length=100) + hire_date = models.DateField() + bio = models.RichTextField() + email = models.EmailField() + headshot = models.ForeignKey('wagtailimages.Image', null=True, blank=True) + content_panels = Page.content_panels + [ + FieldPanel('name'), + FieldPanel('hire_date'), + FieldPanel('email'), + FieldPanel('bio',classname="full"), + ImageChoosePanel('headshot'), + ] +``` + +然而,Wagtail 真正出彩的地方在于它的灵活性及其易于使用的现代化管理页面。你可以控制不同类型的页面在哪网站的哪些区域可以访问,为页面添加复杂的附加逻辑,还天生就支持标准的适应/审批工作流。在大多数 CMS 系统中,你会在开发时在某些点上遇到困难。而使用 Wagtail 时,我们经过不懈努力找到了一个突破口,使得让我们轻易地开发出一套简洁稳定的系统,使得程序完全依照我们的想法运行。如果你对此感兴趣,我们写了一篇[深入理解 Wagtail][17。 + +### 提供社交账户登录的最佳工具:[django-allauth][7] + +django-allauth 是一个能够解决你的注册和认证需求的、可重用的 Django 应用。无论你需要构建本地注册系统还是社交账户注册系统,django-allauth 都能够帮你做到。 + +这个应用支持多种认证体系,比如用户名或电子邮件。一旦用户注册成功,它还可以提供从无需认证到电子邮件认证的多种账户验证的策略。同时,它也支持多种社交账户和电子邮件账户。它还支持插拔式注册表单,可让用户在注册时回答一些附加问题。 + +django-allauth 支持多于 20 种认证提供者,包括 Facebook、Github、Google 和 Twitter。如果你发现了一个它不支持的社交网站,很有可能通过第三方插件提供该网站的接入支持。这个项目还支持自定义后端,可以支持自定义的认证方式,对每个有定制认证需求的人来说这都很棒。 + +django-allauth 易于配置,且有[完善的文档][18]。该项目通过了很多测试,所以你可以相信它的所有部件都会正常运作。 + +你有最喜爱的 Django 包吗?请在评论中告诉我们。 + +### 关于作者 + +![Photo](https://opensource.com/sites/default/files/styles/profile_pictures/public/pictures/main-one-i-use-everywhere.png?itok=66GC-D1q) + +*Jeff Triplett 劳伦斯,堪萨斯州 * + +我在 2007 年搬到了堪萨斯州的劳伦斯,在 Django 的发源地—— Lawrence Journal-World 工作。我现在在劳伦斯市的 [Revolution Systems (Revsys)][19] 工作,做一位开发者兼顾问。 + +我是[北美 Django 运动基金会(DEFNA)][20]的联合创始人,2015 和 2016 年 [DjangoCon US][21] 的会议主席,而且我在 Django 的发源地劳伦斯参与组织了 [Django Birthday][22] 来庆祝 Django 的 10 岁生日。 + +我是当地越野跑小组的成员,我喜欢篮球,我还喜欢梦见自己随着一道气流游遍美国。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/business/15/12/5-favorite-open-source-django-packages + +作者:[Jeff Triplett][a] +译者:[StdioA](https://github.com/StdioA) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/jefftriplett +[1]:https://docs.djangoproject.com/en/1.8/intro/reusable-apps/ +[2]:https://pypi.python.org/pypi?:action=browse&c=523 +[3]:https://github.com/audreyr/cookiecutter +[4]:http://whitenoise.evans.io/en/latest/base.html +[5]:http://www.django-rest-framework.org/ +[6]:https://wagtail.io/ +[7]:http://www.intenct.nl/projects/django-allauth/ +[8]:https://www.djangopackages.com/ +[9]:https://www.djangopackages.com/grids/g/rest/ +[10]:http://www2.ljworld.com/news/2015/jul/09/happy-birthday-django/ +[11]:https://docs.djangoproject.com/en/1.8/ref/views/#django.views.static.serve +[12]:https://docs.djangoproject.com/en/1.8/ref/contrib/staticfiles/ +[13]:http://whitenoise.evans.io/en/latest/index.html +[14]:http://www.django-rest-framework.org/ +[15]:http://restframework.herokuapp.com/ +[16]:http://django-rest-swagger.readthedocs.org/en/latest/index.html +[17]:https://opensource.com/business/15/5/wagtail-cms +[18]:http://django-allauth.readthedocs.org/en/latest/ +[19]:http://www.revsys.com/ +[20]:http://defna.org/ +[21]:https://2015.djangocon.us/ +[22]:https://djangobirthday.com/ diff --git a/translated/talk/yearbook2015/20160306 5 Favorite Open Source Django Packages.md b/translated/talk/yearbook2015/20160306 5 Favorite Open Source Django Packages.md deleted file mode 100644 index 81e999fd80..0000000000 --- a/translated/talk/yearbook2015/20160306 5 Favorite Open Source Django Packages.md +++ /dev/null @@ -1,164 +0,0 @@ -5个最受喜爱的开源Django包 -================================================================================ -![Yearbook cover 2015](https://opensource.com/sites/default/files/styles/image-full-size/public/u23316/osdc-open-source-yearbook-lead8.png?itok=0_5-hdFE) - -图片来源:Opensource.com - -_Jacob Kaplan-Moss和Frank Wiles也参与了本文的写作。_ - -Django围绕“[可重用应用][1]”观点建立:自我包含了提供可重复使用特性的包。你可以将这些可重用应用组装起来,在加上适用于你的网站的特定代码,来搭建你自己的网站。Django具有一个丰富多样的、由可供你使用的可重用应用组建起来的生态系统——PyPI列出了[超过8000个 Django 应用][2]——可你该如何知道哪些是最好的呢? - -为了节省你的时间,我们总结了五个最受喜爱的 Django 应用。它们是: -- [Cookiecutter][3]: 建立 Django 网站的最佳方式。 -- [Whitenoise][4]: 最棒的静态资源服务器。 -- [Django Rest Framework][5]: 使用 Django 开发 REST API 的最佳方式。 -- [Wagtail][6]: 基于 Django 的最佳内容管理系统。 -- [django-allauth][7]: 提供社交账户登录的最佳应用(如 Twitter, Facebook, GitHub 等)。 - -我们同样推荐你查看 [Django Packages][8],一个可重用 Django 应用的目录。Django Packages 将 Django 应用组织成“表格”,你可以在功能相似的不同应用之间进行比较并做出选择。你可以查看每个包中提供的特性,和使用统计情况。(比如:这是[ REST 工具的表格][9],也许可以帮助你理解我们为何推荐 Django REST Framework. - -## 为什么你应该相信我们? - -我们使用 Django 的时间比几乎其他人都长。在 Django 发布之前,我们当中的两个人(Frank 和 Jacob)在 [Lawrence Journal-World][10] (Django 的发源地)工作(事实上他们两人推动了 Django 开源发布的进程)。我们在过去的八年当中运行着一个咨询公司,来建议公司使用 Django 去将事情做到最好。 - -所以,我们见证了Django项目和社群的完整历史,我们见证了流行软件包的兴起和没落。在我们三个中,我们可能私下试用了8000个应用中的一半以上,或者我们知道谁试用过这些。我们对如何使应用变得坚实可靠有着深刻的理解,并且我们对给予这些应用持久力量的来源也有不错的理解。 - -## 建立Django网站的最佳方式:[Cookiecutter][3] - -建立一个新项目或应用总是有些痛苦。你可以用Django内建的 `startproject`。不过,如果你像我们一样,你可能会对你的办事方式很挑剔。Cookiecutter 为你提供了一个快捷简单的方式来构建易于使用的项目或应用模板,从而解决了这个问题。一个简单的例子:键入 `pip install cookiecutter`,然后在命令行中运行以下命令: - -```bash -$ cookiecutter https://github.com/marcofucci/cookiecutter-simple-django -``` - -接下来你需要回答几个简单的问题,比如你的项目名称、目录、作者名字、E-Mail和其他几个关于配置的小问题。这些能够帮你补充项目相关的细节。我们使用最最原始的 "_foo_" 作为我们的目录名称。所以 cokkiecutter 在子目录 "_foo_" 下建立了一个简单的 Django 项目。 - -如果你在"_foo_"项目中闲逛,你会看见你刚刚选择的其它设置已通过模板,连同子目录一同嵌入到文件当中。这个“模板”在我们刚刚在执行 `cookiecutter` 命令时输入的 Github 仓库 URL 中定义。这个样例工程使用了一个 Github 远程仓库作为模板;不过你也可以使用本地的模板,这在建立非重用项目时非常有用。 - -我们认为 cookiecutter 是一个极棒的 Django 包,但是,事实上其实它在面对纯 Python 甚至非 Python 相关需求时也极为有用。你能够将所有文件依你所愿精确摆放在任何位置上,使得 cookiecutter 成为了一个简化工作流程的极佳工具。 - -## 最棒的静态资源服务器:[Whitenoise][4] - -多年来,托管网站的静态资源——图片、Javascript、CSS——都是一件很痛苦的事情。Django 内建的 [django.views.static.serve][11] 视图,就像Django文章所述的那样,“在生产环境中不可靠,所以只应为开发环境的提供辅助功能。”但使用一个“真正的” Web 服务器,如 NGINX 或者借助 CDN 来托管媒体资源,配置起来会相当困难。 - -Whitenoice 很简洁地解决了这个问题。它可以像在开发环境那样轻易地在生产环境中设置静态服务器,并且针对生产环境进行了加固和优化。它的设置方法极为简单: - -1. 确保你在使用 Django 的 [contrib.staticfiles][12] 应用,并确认你在配置文件中正确设置了 `STATIC_ROOT` 变量。 - -2. 在 `wsgi.py` 文件中启用 Whitenoise: - - ```python - from django.core.wsgi import get_wsgi_application - from whitenoise.django import DjangoWhiteNoise - - application = get_wsgi_application() - application = DjangoWhiteNoise(application) - ``` - -配置它真的就这么简单!对于大型应用,你可能想要使用一个专用的媒体服务器和/或一个 CDN,但对于大多数小型或中型 Django 网站,Whitenoise 已经足够强大。 - -如需查看更多关于 Whitenoise 的信息,[请查看文档][13]。 - -## 开发REST API的最佳工具:[Django REST Framework][5] - -REST API 正在迅速成为现代 Web 应用的标准功能。与一个 API 进行简短的会话,你只需使用 JSON 而不是 HTML,当然你可以只用 Django 做到这些。你可以制作自己的视图,设置合适的 `Content-Type`, 然后返回 JSON 而不是渲染后的 HTML 响应。这是在像 [Django Rest Framework][14](下称DRF)这样的API框架发布之前,大多数人所做的。 - -如果你对 Django 的视图类很熟悉,你会觉得使用DRF构建REST API与使用它们很相似,不过 DRF 只针对特定 API 使用场景而设计。在一般 API 设计中,你会用到它的不少代码,所以我们强调了一些 DRF 的特性来使你更快地接受它,而不是去看一份让你兴奋的示例代码: - -* 可自动预览的 API 可以使你的开发和人工测试轻而易举。你可以查看 DRF 的[示例代码][15]。你可以查看 API 响应,并且它支持 POST/PUT/DELETE 类型的操作,不需要你做任何事。 - - -* 认证方式易于迁移,如OAuth, Basic Auth, 或API Tokens. -* 内建请求速度限制。 -* 当与 [django-rest-swagger][16] 结合时,API文档几乎可以自动生成。 -* 第三方库拥有广泛的生态。 - -当然你可以不依赖 DRF 来构建 API,但我们无法推测你不开始使用 DRF 的原因。就算你不使用 DRF 的全部特性,使用一个成熟的视图库来构建你自己的 API 也会使你的 API 更加一致、完全,更能提高你的开发速度。如果你还没有开始使用 DRF, 你应该找点时间去体验一下。 - -## 以 Django 为基础的最佳 CMS:[Wagtail][6] - -Wagtail是当下Django CMS(内容管理系统)世界中最受人青睐的应用,并且它的热门有足够的理由。就想大多数的 CMS 一样,它具有极佳的灵活性,可以通过简单的 Django 模型来定义不同类型的页面及其内容。使用它,你可以从零开始,在几个小时而不是几天之内来和建造一个基本可以运行的内容管理系统。举一个小例子,为你公司的员工定义一个页面类型可以像下面一样简单: - -```python -from wagtail.wagtailcore.models import Page -from wagtail.wagtailcore.fields import RichTextField -from wagtail.wagtailadmin.edit_handlers import FieldPanel, MultiFieldPanel -from wagtail.wagtailimages.edit_handlers import ImageChooserPanel - -class StaffPage(Page): - name = models.CharField(max_length=100) - hire_date = models.DateField() - bio = models.RichTextField() - email = models.EmailField() - headshot = models.ForeignKey('wagtailimages.Image', null=True, blank=True) - content_panels = Page.content_panels + [ - FieldPanel('name'), - FieldPanel('hire_date'), - FieldPanel('email'), - FieldPanel('bio',classname="full"), - ImageChoosePanel('headshot'), - ] -``` - -然而,Wagtail 真正出彩的地方在于它的灵活性及其易于使用的现代化管理页面。你可以控制不同类型的页面在哪网站的哪些区域可以访问,为页面添加复杂的附加逻辑,还可以极为方便地取得标准的适应/审批工作流。在大多数 CMS 系统中,你会在开发时在某些点上遇到困难。而使用 Wagtail 时,我们经过不懈努力找到了一个突破口,使得让我们轻易地开发出一套简洁稳定的系统,使得程序完全依照我们的想法运行。如果你对此感兴趣,我们写了一篇[深入理解 Wagtail][17]. - -## 提供社交账户登录的最佳工具:[django-allauth][7] - -django-allauth 是一个能够解决你的注册和认证需求的、可重用的Django应用。无论你需要构建本地注册系统还是社交账户注册系统,django-allauth 都能够帮你做到。 - -这个应用支持多种认证体系,比如用户名或电子邮件。一旦用户注册成功,它可以提供从零到电子邮件认证的多种账户验证的策略。同时,它也支持多种社交账户和电子邮件账户关联。它还支持可插拔的注册表单,可让用户在注册时回答一些附加问题。 - -django-allauth 支持多于 20 种认证提供者,包括 Facebook, Github, Google 和 Twitter。如果你发现了一个它不支持的社交网站,那很有可能有一款第三方插件提供该网站的接入支持。这个项目还支持自定义后台开发,可以支持自定义的认证方式。 - -django-allauth 易于配置,且有[完善的文档][18]。该项目通过了很多测试,所以你可以相信它的所有部件都会正常运作。 - -你有最喜爱的 Django 包吗?请在评论中告诉我们。 - -## 关于作者 - -![Photo](https://opensource.com/sites/default/files/styles/profile_pictures/public/pictures/main-one-i-use-everywhere.png?itok=66GC-D1q) - -Jeff Triplett - -劳伦斯,堪萨斯州 - - -我在 2007 年搬到了堪萨斯州的劳伦斯,在 Django 的发源地—— Lawrence Journal-World 工作。我现在在劳伦斯市的 [Revolution Systems (Revsys)][19] 工作,做一位开发者兼顾问。 - -我是[北美 Django 运动基金会(DEFNA)][20]的联合创始人,2015 和 2016 年 [DjangoCon US][21] 的会议主席,而且我在 Django 的发源地劳伦斯参与组织了 [Django Birthday][22] 来庆祝 Django 的 10 岁生日。 - -我是当地越野跑小组的成员,我喜欢篮球,我还喜欢梦见自己随着一道气流游遍美国。 - --------------------------------------------------------------------------------- - -via: https://opensource.com/business/15/12/5-favorite-open-source-django-packages - -作者:[Jeff Triplett][a] -译者:[StdioA](https://github.com/StdioA) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/jefftriplett -[1]:https://docs.djangoproject.com/en/1.8/intro/reusable-apps/ -[2]:https://pypi.python.org/pypi?:action=browse&c=523 -[3]:https://github.com/audreyr/cookiecutter -[4]:http://whitenoise.evans.io/en/latest/base.html -[5]:http://www.django-rest-framework.org/ -[6]:https://wagtail.io/ -[7]:http://www.intenct.nl/projects/django-allauth/ -[8]:https://www.djangopackages.com/ -[9]:https://www.djangopackages.com/grids/g/rest/ -[10]:http://www2.ljworld.com/news/2015/jul/09/happy-birthday-django/ -[11]:https://docs.djangoproject.com/en/1.8/ref/views/#django.views.static.serve -[12]:https://docs.djangoproject.com/en/1.8/ref/contrib/staticfiles/ -[13]:http://whitenoise.evans.io/en/latest/index.html -[14]:http://www.django-rest-framework.org/ -[15]:http://restframework.herokuapp.com/ -[16]:http://django-rest-swagger.readthedocs.org/en/latest/index.html -[17]:https://opensource.com/business/15/5/wagtail-cms -[18]:http://django-allauth.readthedocs.org/en/latest/ -[19]:http://www.revsys.com/ -[20]:http://defna.org/ -[21]:https://2015.djangocon.us/ -[22]:https://djangobirthday.com/ From a35d8980ac554646270bdf28bf2e1495b3695f8d Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 13 Aug 2016 20:38:31 +0800 Subject: [PATCH 1419/1469] =?UTF-8?q?=E6=9B=B4=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- published/20160306 5 Favorite Open Source Django Packages.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20160306 5 Favorite Open Source Django Packages.md b/published/20160306 5 Favorite Open Source Django Packages.md index c97ed74570..8c73c702e1 100644 --- a/published/20160306 5 Favorite Open Source Django Packages.md +++ b/published/20160306 5 Favorite Open Source Django Packages.md @@ -75,7 +75,7 @@ REST API 正在迅速成为现代 Web 应用的标准功能。 API 就是简单 当然,你可以不依赖 DRF 来构建 API,但我们无法想象你不去使用 DRF 的原因。就算你不使用 DRF 的全部特性,使用一个成熟的视图库来构建你自己的 API 也会使你的 API 更加一致、完全,更能提高你的开发速度。如果你还没有开始使用 DRF, 你应该找点时间去体验一下。 -## 基于 Django 的最佳 CMS:[Wagtail][6] +### 基于 Django 的最佳 CMS:[Wagtail][6] Wagtail 是当下 Django CMS(内容管理系统)世界中最受人青睐的应用,并且它的热门有足够的理由。就像大多数的 CMS 一样,它具有极佳的灵活性,可以通过简单的 Django 模型来定义不同类型的页面及其内容。使用它,你可以从零开始在几个小时而不是几天之内来和建造一个基本可以运行的内容管理系统。举一个小例子,为你公司的员工定义一个员工页面类型可以像下面一样简单: From 9fec424d17f3d4802c5039e46bc2cee453e02415 Mon Sep 17 00:00:00 2001 From: WangYue <815420852@qq.com> Date: Sat, 13 Aug 2016 20:43:13 +0800 Subject: [PATCH 1420/1469] =?UTF-8?q?=E3=80=90=E7=BF=BB=E8=AF=91=E4=B8=AD?= =?UTF-8?q?=E3=80=9118=20Best=20IDEs=20for=20C/C++=20Programming=20or=20So?= =?UTF-8?q?urce=20Code=20Editors=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 原译者很久没更新 --- ...DEs for C+C++ Programming or Source Code Editors on Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20160630 18 Best IDEs for C+C++ Programming or Source Code Editors on Linux.md b/sources/tech/20160630 18 Best IDEs for C+C++ Programming or Source Code Editors on Linux.md index 01fb7c5c22..03b18de986 100644 --- a/sources/tech/20160630 18 Best IDEs for C+C++ Programming or Source Code Editors on Linux.md +++ b/sources/tech/20160630 18 Best IDEs for C+C++ Programming or Source Code Editors on Linux.md @@ -1,4 +1,4 @@ -translating by fw8899 +translating by WangYueScream & LiBrad 18 Best IDEs for C/C++ Programming or Source Code Editors on Linux ====================================================================== From e4b35e4f9e50bd49e0111aa55b56315ffdff8b37 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 13 Aug 2016 22:52:44 +0800 Subject: [PATCH 1421/1469] PUB:20160623 Advanced Image Processing with Python MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Johnny-Liao 辛苦了,这篇太专业了。@oska874 以后不要选这么冷僻的文章了。 --- ...3 Advanced Image Processing with Python.md | 113 ++++++++++++++++ ...3 Advanced Image Processing with Python.md | 124 ------------------ 2 files changed, 113 insertions(+), 124 deletions(-) create mode 100644 published/20160623 Advanced Image Processing with Python.md delete mode 100644 translated/tech/20160623 Advanced Image Processing with Python.md diff --git a/published/20160623 Advanced Image Processing with Python.md b/published/20160623 Advanced Image Processing with Python.md new file mode 100644 index 0000000000..f668a63924 --- /dev/null +++ b/published/20160623 Advanced Image Processing with Python.md @@ -0,0 +1,113 @@ +Python 高级图像处理 +====================================== + +![](http://www.cuelogic.com/blog/wp-content/uploads/2016/06/Image-Search-Engine.png) + +构建图像搜索引擎并不是一件容易的任务。这里有几个概念、工具、想法和技术需要实现。主要的图像处理概念之一是逆图像查询(RIQ:reverse image querying)。Google、Cloudera、Sumo Logic 和 Birst 等公司在使用逆图像搜索中名列前茅。通过分析图像和使用数据挖掘 RIQ 提供了很好的洞察分析能力。 + +### 顶级公司与逆图像搜索 + +有很多顶级的技术公司使用 RIQ 来取得了不错的收益。例如:在 2014 年 Pinterest 第一次带来了视觉搜索。随后在 2015 年发布了一份白皮书,披露了其架构。逆图像搜索让 Pinterest 获得了时尚品的视觉特征,并可以显示相似产品的推荐。 + +众所周知,谷歌图片使用逆图像搜索允许用户上传一张图片然后搜索相关联的图片。通过使用先进的算法对提交的图片进行分析和数学建模,然后和谷歌数据库中无数的其他图片进行比较得到相似的结果。 + +**这是 OpenCV 2.4.9 特征比较报告一个图表:** + +![](http://www.cuelogic.com/blog/wp-content/uploads/2016/06/search-engine-graph.jpg) + +### 算法 & Python库 + +在我们使用它工作之前,让我们过一遍构建图像搜索引擎的 Python 库的主要元素: + +### 专利算法 + +#### 尺度不变特征变换(SIFT - Scale-Invariant Feature Transform)算法 + +1. 带有非自由功能的一个专利技术,利用图像识别符,以识别相似图像,甚至那些来自不同的角度,大小,深度和尺度的图片,也会被包括在搜索结果中。[点击这里][4]查看 SIFT 详细视频。 +2. SIFT 能与从许多图片中提取了特征的大型数据库正确地匹配搜索条件。 +3. 能匹配不同视角的相同图像和匹配不变特征来获得搜索结果是 SIFT 的另一个特征。了解更多关于尺度不变[关键点][5]。 + +#### 加速鲁棒特征(SURF - Speeded Up Robust Features)算法 + +1. [SURF][1] 也是一种带有非自由功能的专利技术,而且还是一种“加速”的 SIFT 版本。不像 SIFT,SURF 接近于带有箱式过滤器(Box Filter)的高斯拉普拉斯算子(Laplacian of Gaussian)。 +2. SURF 依赖于黑塞矩阵(Hessian Matrix)的位置和尺度。 +3. 在许多应用中,旋转不变性不是一个必要条件,所以不按这个方向查找加速了处理。 +4. SURF 包括了几种特性,提升了每一步的速度。SIFT 在旋转和模糊化方面做的很好,比 SIFT 的速度快三倍。然而它不擅长处理照明和变换视角。 +5. OpenCV 程序功能库提供了 SURF 功能,SURF.compute() 和 SURF.Detect() 可以用来找到描述符和要点。阅读更多关于SURF[点击这里][2] + +### 开源算法 + +#### KAZE 算法 + +1. KAZE是一个开源的非线性尺度空间的二维多尺度和新的特征检测和描述算法。在加性算子分裂(Additive Operator Splitting, AOS)和可变电导扩散中的有效技术被用来建立非线性尺度空间。 +2. 多尺度图像处理的基本原理很简单:创建一个图像的尺度空间,同时用正确的函数过滤原始图像,以提高时间或尺度。 + +#### 加速的 KAZE(AKAZE - Accelerated-KAZE) 算法 + +1. 顾名思义,这是一个更快的图像搜索方式,它会在两幅图像之间找到匹配的关键点。AKAZE 使用二进制描述符和非线性尺度空间来平衡精度和速度。 + +#### 二进制鲁棒性不变尺度可变关键点(BRISK - Binary Robust Invariant Scalable Keypoints) 算法 + +1. BRISK 非常适合关键点的描述、检测与匹配。 +2. 是一种高度自适应的算法,基于尺度空间 FAST 的快速检测器和一个位字符串描述符,有助于显著加快搜索。 +3. 尺度空间关键点检测与关键点描述帮助优化当前相关任务的性能。 + +#### 快速视网膜关键点(FREAK - Fast Retina Keypoint) + +1. 这个新的关键点描述的灵感来自人的眼睛。通过图像强度比能有效地计算一个二进制串级联。FREAK 算法相比 BRISK、SURF 和 SIFT 算法可以更快的计算与内存负载较低。 + +#### 定向 FAST 和旋转 BRIEF(ORB - Oriented FAST and Rotated BRIEF) + +1. 快速的二进制描述符,ORB 具有抗噪声和旋转不变性。ORB 建立在 FAST 关键点检测器和 BRIEF 描述符之上,有成本低、性能好的元素属性。 +2. 除了快速和精确的定位元件,有效地计算定向的 BRIEF,分析变动和面向 BRIEF 特点相关,是另一个 ORB 的特征。 + +### Python库 + +#### OpenCV + +1. OpenCV 支持学术和商业用途,它是一个开源的机器学习和计算机视觉库,OpenCV 便于组织利用和修改代码。 +2. 超过 2500 个优化的算法,包括当前最先进的机器学习和计算机视觉算法服务与各种图像搜索--人脸检测、目标识别、摄像机目标跟踪,从图像数据库中寻找类似图像、眼球运动跟随、风景识别等。 +3. 像谷歌,IBM,雅虎,索尼,本田,微软和英特尔这样的大公司广泛的使用 OpenCV。 +4. OpenCV 拥有 python,java,C,C++ 和 MATLAB 接口,同时支持 Windows,Linux,Mac OS 和 Android。 + +#### Python 图像库 (PIL) + +1. Python 图像库(PIL)支持多种文件格式,同时提供图像处理和图形解决方案。开源的 PIL 为你的 Python解释器添加了图像处理能力。 +2. 标准的图像处理能力包括图像增强、透明和遮罩处理、图像过滤、像素操作等。 + +详细的数据和图表,请看[这里][3]的 OpenCV 2.4.9 特征比较报告。 + +### 构建图像搜索引擎 + +图像搜索引擎可以从预置的图像库选择相似的图像。其中最受欢迎的是谷歌的著名的图像搜索引擎。对于初学者来说,有不同的方法来建立这样的系统。提几个如下: + +1. 采用图像提取、图像描述提取、元数据提取和搜索结果提取,建立图像搜索引擎。 +2. 定义你的图像描述符,数据集索引,定义你的相似性度量,然后进行搜索和排名。 +3. 选择要搜索的图像,选择用于进行搜索的目录,搜索所有图片的目录,创建图片特征索引,评估搜索图片的相同特征,匹配搜索的图片并获得匹配的图片。 + +我们的方法基本上从比较灰度版本的图像,逐渐演变到复杂的特征匹配算法如 SIFT 和 SURF,最后采用的是开源的解决方案 BRISK 。所有这些算法都提供了有效的结果,但在性能和延迟有细微变化。建立在这些算法上的引擎有许多应用,如分析流行统计的图形数据,在图形内容中识别对象,等等。 + +**举例**:一个 IT 公司为其客户建立了一个图像搜索引擎。因此,如果如果搜索一个品牌的标志图像,所有相关的品牌形象也应该显示在搜索结果。所得到的结果也能够被客户用于分析,使他们能够根据地理位置估计品牌知名度。但它还比较年轻,RIQ(反向图像搜索)的潜力尚未被完全挖掘利用。 + +这就结束了我们的文章,使用 Python 构建图像搜索引擎。浏览我们的博客部分来查看最新的编程技术。 + +数据来源:OpenCV 2.4.9 特征比较报告(computer-vision-talks.com) + +(感谢 Ananthu Nair 的指导与补充) + +-------------------------------------------------------------------------------- + +via: http://www.cuelogic.com/blog/advanced-image-processing-with-python/ + +作者:[Snehith Kumbla][a] +译者:[Johnny-Liao](https://github.com/Johnny-Liao) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.cuelogic.com/blog/author/snehith-kumbla/ +[1]: http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_feature2d/py_surf_intro/py_surf_intro.html +[2]: http://www.vision.ee.ethz.ch/~surf/eccv06.pdf +[3]: https://docs.google.com/spreadsheets/d/1gYJsy2ROtqvIVvOKretfxQG_0OsaiFvb7uFRDu5P8hw/edit#gid=10 +[4]: https://www.youtube.com/watch?v=NPcMS49V5hg +[5]: https://www.cs.ubc.ca/~lowe/papers/ijcv04.pdf diff --git a/translated/tech/20160623 Advanced Image Processing with Python.md b/translated/tech/20160623 Advanced Image Processing with Python.md deleted file mode 100644 index 73f8751225..0000000000 --- a/translated/tech/20160623 Advanced Image Processing with Python.md +++ /dev/null @@ -1,124 +0,0 @@ -Python高级图像处理 -====================================== - -![](http://www.cuelogic.com/blog/wp-content/uploads/2016/06/Image-Search-Engine.png) - -构建图像搜索引擎并不是一件容易的任务。这里有几个概念、工具、想法和技术需要实现。主要的图像处理概念之一是逆图像查询(RIQ)或者说逆图像搜索。Google、Cloudera、Sumo Logic 和 Birst等公司在使用逆图像搜索中名列前茅。通过分析图像和使用数据挖掘RIQ提供了很好的洞察分析能力。 - -### 顶级公司与逆图像搜索 - -有很多顶级的技术公司使用RIQ来产生最好的收益。例如:在2014年Pinterest第一次带来了视觉搜索。随后在2015年发布了一份白皮书,揭示了其架构。逆图像搜索让Pinterest获得对时尚对象的视觉特征和显示类似的产品建议的能力。 - -众所周知,谷歌图片使用逆图像搜索允许用户上传一张图片然后搜索相关联的图片。通过使用先进的算法对提交的图片进行分析和数学建模。然后和谷歌数据库中无数的其他图片进行比较得到相似的结果。 - -**这是opencv 2.4.9特征比较报告一个图表:** - -![](http://www.cuelogic.com/blog/wp-content/uploads/2016/06/search-engine-graph.jpg) - -### 算法 & Python库 - -在我们使用它工作之前,让我们过一遍构建图像搜索引擎的Python库的主要元素: - -### 专利算法 - -#### 尺度不变特征变换算法(SIFT - Scale-Invariant Feature Transform) - -1. 非自由功能的一个专利技术,利用图像识别符,以识别相似图像,甚至那些从不同的角度,大小,深度和规模点击,它们被包括在搜索结果中。[点击这里][4]查看SIFT详细视频。 -2. SIFT能与从许多图片中提取的特征的大型数据库正确的匹配搜索条件。 -3. 从不同的方面来匹配相同的图像和匹配不变特征来获得搜索结果是SIFT的另一个特征。了解更多关于尺度不变[关键点][5] - -#### 加速鲁棒特征(SURF - Speeded Up Robust Features)算法 - -1. [SURF][1] 也是一种非自由功能的专利技术而且还是一种“加速”的SIFT版本。不像SIFT, - -2. SURF依赖于Hessian矩阵行列式的位置和尺度。 - -3. 在许多应用中,旋转不变性是不是一个必要条件。所以找不到这个方向的速度加快了这个过程。 - -4. SURF包括几种特性,在每一步的速度提高。比SIFT快三倍的速度,SIFT擅长旋转和模糊化。然而它不擅长处理照明和变换视角。 - -5. Open CV,一个程序功能库提供SURF相似的功能,SURF.compute()和SURF.Detect()可以用来找到描述符和要点。阅读更多关于SURF[点击这里][2] - -### 开源算法 - -#### KAZE 算法 - -1. KAZE是一个开源的非线性尺度空间的二维多尺度和新的特征检测和描述算法。在加性算子分裂的有效技术(AOS)和可变电导扩散是用来建立非线性尺度空间。 - -2. 多尺度图像处理基础是简单的创建一个图像的尺度空间,同时用正确的函数过滤原始图像,提高时间或规模。 - -#### AKAZE (Accelerated-KAZE) 算法 - -1. 顾名思义,这是一个更快的图像搜索方式,找到匹配的关键点在两幅图像之间。AKAZE 使用二进制描述符和非线性尺度空间来平衡精度和速度。 - -#### BRISK (Binary Robust Invariant Scalable Keypoints) 算法 - -1. BRISK 非常适合描述关键点的检测与匹配。 - -2. 是一种高度自适应的算法,基于尺度空间的快速检测器和一个位字符串描述符,有助于加快搜索显着。 - -3. 尺度空间关键点检测与关键点描述帮助优化手头相关任务的性能 - -#### FREAK (Fast Retina Keypoint) - -1. 这个新的关键点描述的灵感来自人的眼睛。通过图像强度比能有效地计算一个二进制串级联。FREAK算法相比BRISK,SURF和SIFT算法有更快的计算与较低的内存负载。 - -#### ORB (Oriented FAST and Rotated BRIEF) - -1. 快速的二进制描述符,ORB具有抗噪声和旋转不变性。ORB建立在FAST关键点检测器和BRIEF描述符之上,有成本低、性能好的元素属性。 - -2. 除了快速和精确的定位元件,有效地计算定向的BRIEF,分析变动和面向BRIEF特点相关,是另一个ORB的特征。 - -### Python库 - -#### Open CV - -1. Open CV提供学术和商业用途。一个开源的机器学习和计算机视觉库,OpenCV便于组织利用和修改代码。 - -2. 超过2500个优化算法,包括国家最先进的机器学习和计算机视觉算法服务与各种图像搜索--人脸检测、目标识别、摄像机目标跟踪,从图像数据库中寻找类似图像、眼球运动跟随、风景识别等。 - -3. 像谷歌,IBM,雅虎,IBM,索尼,本田,微软和英特尔这样的大公司广泛的使用OpenCV。 - -4. OpenCV拥有python,java,C,C++和MATLAB接口,同时支持Windows,Linux,Mac OS和Android。 - -#### Python图像库 (PIL) - -1. Python图像库(PIL)支持多种文件格式,同时提供图像处理和图形解决方案。开源的PIL为你的Python解释器添加图像处理能力。 -2. 标准的图像处理能力包括图像增强、透明和屏蔽作用、图像过滤、像素操作等。 - -详细的数据和图表,请看OpenCV 2.4.9 特征比较报告。[这里][3] - -### 构建图像搜索引擎 - -图像搜索引擎可以从预置集图像库选择相似的图像。其中最受欢迎的是谷歌的著名的图像搜索引擎。对于初学者来说,有不同的方法来建立这样的系统。提几个如下: - -1. 采用图像提取、图像描述提取、元数据提取和搜索结果提取,建立图像搜索引擎。 -2. 定义你的图像描述符,数据集索引,定义你的相似性度量,然后搜索和排名。 -3. 选择要搜索的图像,选择用于进行搜索的目录,所有图片的搜索目录,创建图片特征索引,评估相同的搜索图片的功能,在搜索中匹配图片,并获得匹配的图片。 - -我们的方法基本上就比较grayscaled版本的图像,逐渐移动到复杂的特征匹配算法如SIFT和SURF,最后沉淀下来的是开源的解决方案称为BRISK。所有这些算法提供了有效的结果,在性能和延迟的细微变化。建立在这些算法上的引擎有许多应用,如分析流行统计的图形数据,在图形内容中识别对象,以及更多。 - -**例如**:一个图像搜索引擎需要由一个IT公司作为客户机来建立。因此,如果一个品牌的标志图像被提交在搜索中,所有相关的品牌形象搜索显示结果。所得到的结果也可以通过客户端分析,使他们能够根据地理位置估计品牌知名度。但它还比较年轻,RIQ或反向图像搜索尚未被完全挖掘利用。 - -这就结束了我们的文章,使用Python构建图像搜索引擎。浏览我们的博客部分来查看最新的编程技术。 - -数据来源:OpenCV 2.4.9 特征比较报告(computer-vision-talks.com) - -(Ananthu Nair 的指导与补充) - --------------------------------------------------------------------------------- - -via: http://www.cuelogic.com/blog/advanced-image-processing-with-python/ - -作者:[Snehith Kumbla][a] -译者:[Johnny-Liao](https://github.com/Johnny-Liao) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://www.cuelogic.com/blog/author/snehith-kumbla/ -[1]: http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_feature2d/py_surf_intro/py_surf_intro.html -[2]: http://www.vision.ee.ethz.ch/~surf/eccv06.pdf -[3]: https://docs.google.com/spreadsheets/d/1gYJsy2ROtqvIVvOKretfxQG_0OsaiFvb7uFRDu5P8hw/edit#gid=10 -[4]: https://www.youtube.com/watch?v=NPcMS49V5hg -[5]: https://www.cs.ubc.ca/~lowe/papers/ijcv04.pdf From 762fd2dd8f4c9ede4cb721fd0c19903bc16c5b39 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 14 Aug 2016 01:27:21 +0800 Subject: [PATCH 1422/1469] =?UTF-8?q?20160814-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...asks and Application Deployments Over SSH.md | 252 ++++++++++++++++++ 1 file changed, 252 insertions(+) create mode 100644 sources/tech/20151118 Fabric – Automate Your Linux Administration Tasks and Application Deployments Over SSH.md diff --git a/sources/tech/20151118 Fabric – Automate Your Linux Administration Tasks and Application Deployments Over SSH.md b/sources/tech/20151118 Fabric – Automate Your Linux Administration Tasks and Application Deployments Over SSH.md new file mode 100644 index 0000000000..43b1fe59c7 --- /dev/null +++ b/sources/tech/20151118 Fabric – Automate Your Linux Administration Tasks and Application Deployments Over SSH.md @@ -0,0 +1,252 @@ +Fabric – Automate Your Linux Administration Tasks and Application Deployments Over SSH +=========================== + +When it comes to managing remote machines and deployment of applications, there are several command line tools out there in existence though many have a common problem of lack of detailed documentation. + +In this guide, we shall cover the steps to introduce and get started on how to use fabric to improve on administering groups of servers. + +![](http://www.tecmint.com/wp-content/uploads/2015/11/Automate-Linux-Administration-Tasks-Using-Fabric.png) +>Automate Linux Administration Tasks Using Fabric + +Fabric is a python library and a powerful command line tool for performing system administration tasks such as executing SSH commands on multiple machines and application deployment. + +Having a working knowledge of Python can be helpful when using Fabric, but may certainly not be necessary. + +Reasons why you should choose fabric over other alternatives: + +- Simplicity +- It is well-documented +- You don’t need to learn another language if you’re already a python guy. +- Easy to install and use. +- It is fast in its operations. +- It supports parallel remote execution. + +### How to Install Fabric Automation Tool in Linux + +An important characteristic about fabric is that the remote machines which you need to administer only need to have the standard OpenSSH server installed. You only need certain requirements installed on the server from which you are administering the remote servers before you can get started. + +#### Requirements: + +- Python 2.5+ with the development headers +- Python-setuptools and pip (optional, but preferred) gcc + +Fabric is easily installed using pip (highly recommended), but you may also prefer to choose your default package manager `yum`, `dnf` or `apt-get` to install fabric package, typically called fabric or python-fabric. + +For RHEL/CentOS based distributions, you must have [EPEL repository][1] installed and enabled on the system to install fabric package. + +``` +# yum install fabric [On RedHat based systems] +# dnf install fabric [On Fedora 22+ versions] +``` + +For Debian and it’s derivatives such as Ubuntu and Mint users can simply do apt-get to install the fabric package as shown: + +``` +# apt-get install fabric +``` + +If you want to install development version of fabric, you may use pip to grab the most recent master branch. + +``` +# yum install python-pip [On RedHat based systems] +# dnf install python-pip [On Fedora 22+ versions] +# apt-get install python-pip [On Debian based systems] +``` + +Once pip has been installed successfully, you may use pip to grab the latest version of fabric as shown: + +``` +# pip install fabric +``` + +### How to Use Fabric to Automate Linux Administration Tasks + +So lets get started on how you can use Fabric. During the installation process, a Python script called fab was added to a directory in your path. The `fab` script does all the work when using fabric. + +#### Executing commands on the local Linux machine + +By convention, you need to start by creating a Python file called fabfile.py using your favorite editor. Remember you can give this file a different name as you wish but you will need to specify the file path as follows: + +``` +# fabric --fabfile /path/to/the/file.py +``` + +Fabric uses `fabfile.py` to execute tasks. The fabfile should be in the same directory where you run the Fabric tool. + +Example 1: Let’s create a basic `Hello World` first. + +``` +# vi fabfile.py +``` + +Add these lines of code in the file. + +``` +def hello(): +print('Hello world, Tecmint community') +``` + +Save the file and run the command below. + +``` +# fab hello +``` + +![](http://www.tecmint.com/wp-content/uploads/2015/11/Create-Fabric-Fab-Python-File.gif) +>Fabric Tool Usage + +And paste the following lines of code in the file. + +``` +#! /usr/bin/env python +from fabric.api import local +def uptime(): +local('uptime') +``` + +Then save the file and run the following command: + +``` +# fab uptime +``` + +![](http://www.tecmint.com/wp-content/uploads/2015/11/Fabric-Uptime.gif) +>Fabric: Check System Uptime + +#### Executing commands on remote Linux machines to automate tasks + +The Fabric API uses a configuration dictionary which is Python’s equivalent of an associative array known as `env`, which stores values that control what Fabric does. + +The `env.hosts` is a list of servers on which you want run Fabric tasks. If your network is 192.168.0.0 and wish to manage host 192.168.0.2 and 192.168.0.6 with your fabfile, you could configure the env.hosts as follows: + +``` +#!/usr/bin/env python +from fabric.api import env +env.hosts = [ '192.168.0.2', '192.168.0.6' ] +``` + +The above line of code only specify the hosts on which you will run Fabric tasks but do nothing more. Therefore you can define some tasks, Fabric provides a set of functions which you can use to interact with your remote machines. + +Although there are many functions, the most commonly used are: + +- run – which runs a shell command on a remote machine. +- local – which runs command on the local machine. +- sudo – which runs a shell command on a remote machine, with root privileges. +- Get – which downloads one or more files from a remote machine. +- Put – which uploads one or more files to a remote machine. + +Example 3: To echo a message on multiple machines create a fabfile.py such as the one below. + +``` +#!/usr/bin/env python +from fabric.api import env, run +env.hosts = ['192.168.0.2','192.168.0.6'] +def echo(): +run("echo -n 'Hello, you are tuned to Tecmint ' ") +``` + +To execute the tasks, run the following command: + +``` +# fab echo +``` + +![](http://www.tecmint.com/wp-content/uploads/2015/11/Fabrick-Automate-Linux-Tasks.gif) +>Fabric: Automate Linux Tasks on Remote Linux + +Example 4: You can improve the fabfile.py which you created earlier on to execute the uptime command on the local machine, so that it runs the uptime command and also checks disk usage using the df command on multiple machines as follows: + +``` +#!/usr/bin/env python +from fabric.api import env, run +env.hosts = ['192.168.0.2','192.168.0.6'] +def uptime(): +run('uptime') +def disk_space(): +run('df -h') +``` + +Save the file and run the following command: + +``` +# fab uptime +# fab disk_space +``` + +![](http://www.tecmint.com/wp-content/uploads/2015/11/Fabric-Run-Multiple-Commands-on-Multiple-Linux-Systems.gif) +>Fabric: Automate Tasks on Multiple Linux Systems + +#### Automatically Deploy LAMP Stack on Remote Linux Server + +Example 4: Let us look at an example to deploy LAMP (Linux, Apache, MySQL/MariaDB and PHP) server on a remote Linux server. + +We shall write a function that will allow LAMP to be installed remotely using root privileges. + +##### For RHEL/CentOS and Fedora + +``` +#!/usr/bin/env python +from fabric.api import env, run +env.hosts = ['192.168.0.2','192.168.0.6'] +def deploy_lamp(): +run ("yum install -y httpd mariadb-server php php-mysql") +``` + +##### For Debian/Ubuntu and Linux Mint + +``` +#!/usr/bin/env python +from fabric.api import env, run +env.hosts = ['192.168.0.2','192.168.0.6'] +def deploy_lamp(): +sudo("apt-get install -q apache2 mysql-server libapache2-mod-php5 php5-mysql") +``` + +Save the file and run the following command: + +``` +# fab deploy_lamp +``` + +Note: Due to large output, it’s not possible for us to create a screencast (animated gif) for this example. + +Now you can able to [automate Linux server management tasks][2] using Fabric and its features and examples given above… + +#### Some Useful Options to Use with Fabric + +- You can run fab –help to view help information and a long list of available command line options. +- An important option is –fabfile=PATH that helps you to specify a different python module file to import other then fabfile.py. +- To specify a username to use when connecting to remote hosts, use the –user=USER option. +- To use password for authentication and/or sudo, use the –password=PASSWORD option. +- To print detailed info about command NAME, use –display=NAME option. +- To view formats use –list option, choices: short, normal, nested, use the –list-format=FORMAT option. +- To print list of possible commands and exit, include the –list option. +- You can specify the location of config file to use by using the –config=PATH option. +- To display a colored error output, use –colorize-errors. +- To view the program’s version number and exit, use the –version option. + +### Summary + +Fabric is a powerful tool and is well documented and provides easy usage for newbies. You can read the full documentation to get more understanding of it. If you have any information to add or incase of any errors you encounter during installation and usage, you can leave a comment and we shall find ways to fix them. + +Reference: [Fabric documentation][3] + + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/automating-linux-system-administration-tasks/ + +作者:[Aaron Kili ][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/aaronkili/ +[1]: http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/ +[2]: http://www.tecmint.com/use-ansible-playbooks-to-automate-complex-tasks-on-multiple-linux-servers/ +[3]: http://docs.fabfile.org/en/1.4.0/usage/env.html + + + + From 188bf1cf67c7a80f54b7f15028963dfdf9f5f278 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 14 Aug 2016 01:38:38 +0800 Subject: [PATCH 1423/1469] =?UTF-8?q?20160814-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/ubuntu vs ubuntu on windows.md | 34 +++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 sources/tech/ubuntu vs ubuntu on windows.md diff --git a/sources/tech/ubuntu vs ubuntu on windows.md b/sources/tech/ubuntu vs ubuntu on windows.md new file mode 100644 index 0000000000..3074c5fd5b --- /dev/null +++ b/sources/tech/ubuntu vs ubuntu on windows.md @@ -0,0 +1,34 @@ +Ubuntu 14.04/16.04 vs. Ubuntu Bash On Windows 10 Anniversary Performance +=========================== + +When Microsoft and Canonical brought [Bash and Ubuntu's user-space to Windows 10][1] earlier this year I ran some preliminary [benchmarks of Ubuntu on Windows 10 versus a native Ubuntu installation][2] on the same hardware. Now that this "Windows Subsystem for Linux" is part of the recent Windows 10 Anniversary Update, I've carried out some fresh benchmarks of Ubuntu running atop Windows 10 compared to Ubuntu running bare metal. + +![](http://www.phoronix.net/image.php?id=windows10-anv-wsl&image=windows_wsl_1_med) + +The Windows Subsystem for Linux testing was done with the Windows 10 Anniversary Update plus all available system updates as of last week. The default Ubuntu user-space on Windows 10 continues to be Ubuntu 14.04 LTS, but it worked out to upgrade to Ubuntu 16.04 LTS. So at first I carried out the benchmarks in the 14.04-based stock environment on Windows followed by upgrading the user-space to Ubuntu 16.04 LTS and then repeating the tests. After all of the Windows-based testing was completed, I did clean installs of Ubuntu 14.04.5 and Ubuntu 16.04 LTS on the same system to see how the performance compares. + +![](http://www.phoronix.net/image.php?id=windows10-anv-wsl&image=windows_wsl_2_med) + +An Intel Core i5 6600K Skylake system with 16GB of RAM and 256GB Toshiba SSD were used during the testing process. Each OS was left at its default settings/packages during the testing process. + + +![](https://openbenchmarking.org/embed.php?i=1608096-LO-BASHWINDO87&sha=09989b3&p=2) +>点击放大查看 + + +The testing of Ubuntu/Bash on Windows and the native Ubuntu Linux installations were carried out in a fully-automated and reproducible manner using the open-source Phoronix Test Suite benchmarking software. + +-------------------------------------------------------------------------------- + +via: https://www.phoronix.com/scan.php?page=article&item=windows10-anv-wsl&num=1 + +作者:[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=news_item&px=Ubuntu-User-Space-On-Win10 +[2]: http://www.phoronix.com/scan.php?page=article&item=windows-10-lxcore&num=1 + From 2c0762ee57a25a67e03d45c4d0c8a479e1854b48 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 14 Aug 2016 01:42:27 +0800 Subject: [PATCH 1424/1469] =?UTF-8?q?20160814-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...uring IT productivity is so challenging.md | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 sources/talk/20160808 Why measuring IT productivity is so challenging.md diff --git a/sources/talk/20160808 Why measuring IT productivity is so challenging.md b/sources/talk/20160808 Why measuring IT productivity is so challenging.md new file mode 100644 index 0000000000..a0a29c57ae --- /dev/null +++ b/sources/talk/20160808 Why measuring IT productivity is so challenging.md @@ -0,0 +1,39 @@ +Why measuring IT productivity is so challenging +=========================== + +![](https://enterprisersproject.com/sites/default/files/styles/620x350/public/images/cio_talent_6.png?itok=JV-zSor3) + +In some professions, there are metrics that one can use to determine an individual’s productivity. If you’re a widget maker, for instance, you might be measured on how many widgets you can make in a month. If you work in a call center – how many calls did you answer, and what’s your average handle time? These are over-simplified examples, but even if you're a doctor, you may be measured on how many operations you perform, or how many patients you can see in a month. Whether or not these are the right metrics, they offer a general picture of how an individual performed within a set timeframe. + +In the case of technology, however, it becomes almost impossible to measure a person’s productivity because there is so much variability. For example, it may be tempting to measure a developer's time by lines of code built. But, depending on the coding language, one line of code in one language versus another might be significantly more or less time consuming or difficult. + +Has it always been this nuanced? Many years ago, you might have heard about or experienced IT measurement in terms of function points. These measurements were about the critical features that developers were able to create. But that, too, is becoming harder to do in today’s environment, where developers are often encapsulating logic that may already exist, such as integration of function points through a vendor. This makes it harder to measure productivity based simply on the number of function points built. + +These two examples shed light on why CIOs sometimes struggle when we talk to our peers about IT productivity. Consider this hypothetical conversation: + +>IT leader: “Wow, I think this developer is great.” +>HR: “Really? What do they do?” +>IT leader: “They built this excellent application.” +>HR: “Well, are they better than the other developer who built ten applications?” +>IT leader: “That depends on what you mean by 'better.'” + +Typically, when in the midst of a conversation like the above, there is so much subjectivity involved that it's difficult to answer the question. This is just the tip of the iceberg when it comes to measuring IT performance in a meaningful way. And it doesn't just make conversations harder – it makes it harder for CIOs to showcase the value of their organization to the business. + +This certainly isn't a new problem. I’ve been trying to figure this out for the last 30 years, and I’ve mostly come to the conclusion that we really shouldn’t bother with productivity – we'll never get there. + +I believe we need to change the conversation and stop trying to speak in terms of throughput and cost and productivity but instead, focus on measuring the overall business value of IT. Again, it won't be easy. Business value realization is a hard thing to do. But if CIOs can partner with the business to figure that out, then attributing real value can become more of a science than an art form. + + + +-------------------------------------------------------------------------------- + +via: https://enterprisersproject.com/article/2016/8/why-measuring-it-productivity-so-challenging + +作者:[Anil Cheriyan][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://enterprisersproject.com/user/anil-cheriyan + From d1998f572acbffce3946e07ba1fa6bf6bc2ac1fc Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 14 Aug 2016 01:47:46 +0800 Subject: [PATCH 1425/1469] =?UTF-8?q?20160814-4=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0808 How to cache static files on nginx.md | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 sources/tech/20160808 How to cache static files on nginx.md diff --git a/sources/tech/20160808 How to cache static files on nginx.md b/sources/tech/20160808 How to cache static files on nginx.md new file mode 100644 index 0000000000..380d567852 --- /dev/null +++ b/sources/tech/20160808 How to cache static files on nginx.md @@ -0,0 +1,79 @@ +How to cache static files on nginx +=========================== + +This tutorial explains how you can configure nginx to set the Expires HTTP header and the max-age directive of the Cache-Control HTTP header of static files (such as images, CSS and Javascript files) to a date in the future so that these files will be cached by your visitors' browsers. This saves bandwidth and makes your web site appear faster (if a user visits your site for a second time, static files will be fetched from the browser cache). + +### 1 Preliminary Note + +I'm assuming you have a working nginx setup, e.g. as shown in this tutorial: [Installing Nginx with PHP 7 and MySQL 5.7 (LEMP) on Ubuntu 16.04 LTS][1] + +### 2 Configuring nginx + +The Expires HTTP header can be set with the help of the [expires][2] directive which can be placed in inside http {}, server {}, location {}, or an if statement inside a location {} block. Usually you will use it in a location block for your static files, e.g. as follows: + +``` +location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ { + expires 365d; +} +``` + +In the above example, all `.jpg`, `.jpeg`, `.png`, `.gif`, `.ico`, `.css`, and `.js` files get an Expires header with a date 365 days in the future from the browser access time. Therefore, you should make sure that the location {} block really only contain static files that can be cached by browsers. +Reload nginx after your changes: + +``` +/etc/init.d/nginx reload +``` + +You can use the following time settings with the expires directive: + +- off makes that the Expires and Cache-Control headers will not be modified. +- epoch sets the Expires header to 1 January, 1970 00:00:01 GMT. +- max sets the Expires header to 31 December 2037 23:59:59 GMT, and the Cache-Control max-age to 10 years. +- A time without an @ prefix means an expiry time relative to the browser access time. A negative time can be specified, which sets the Cache-Control header to no-cache. Example: expires 10d; or expires 14w3d; +- A time with an @ prefix specifies an absolute time-of-day expiry, written in either the form Hh or Hh:Mm, where H ranges from 0 to 24, and M ranges from 0 to 59. Exmaple: expires @15:34; + +You can use the following time units: + +- ms: milliseconds +- s: seconds +- - m: minutes +- h: hours +- d: days +- w: weeks +- M: months (30 days) +- y: years (365 days) + +Examples: 1h30m for one hour thirty minutes, 1y6M for one year and six months. + +Also note that if you use a far future Expires header you have to change the component's filename whenever the component changes. Therefore it's a good idea to version your files. For example, if you have a file javascript.js and want to modify it, you should add a version number to the file name of the modified file (e.g. javascript-1.1.js) so that browsers have to download it. If you don't change the file name, browsers will load the (old) file from their cache. + +Instead of basing the Expires header on the access time of the browser (e.g. expires 10d;), you can also base it on the modification date of a file (please note that this works only for real files that are stored on the hard drive!) by using the modified keyword which precedes the time: + +``` +expires modified 10d; +``` + +### 3 Testing + +To test if your configuration works, you can use the Network analysis function of the Developer tools in the Firefox Browser and access a static file through Firefox (e.g. an image). In the Header output, you should now see an Expires header and a Cache-Control header with a max-age directive (max-age contains a value in seconds, for example 31536000 is one year in the future): + +![](https://www.howtoforge.com/images/how-to-cache-static-files-on-nginx/accept_headers.png) + +### 4 Links + +nginx HttpHeadersModule: + + +-------------------------------------------------------------------------------- + +via: https://www.howtoforge.com/tutorial/how-to-cache-static-files-on-nginx/ + +作者:[Falko Timme][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.howtoforge.com/tutorial/how-to-cache-static-files-on-nginx/ +[1]: https://www.howtoforge.com/tutorial/installing-nginx-with-php7-fpm-and-mysql-on-ubuntu-16.04-lts-lemp/ +[2]:http://nginx.org/en/docs/http/ngx_http_headers_module.html#expires From 3620af6dfbba4b1cfbbcc5e26f9cde10f89d5911 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 14 Aug 2016 01:58:00 +0800 Subject: [PATCH 1426/1469] =?UTF-8?q?20160814-5=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rtTrue is truthy - assertFalse is falsy.md | 176 ++++++++++++++++++ 1 file changed, 176 insertions(+) create mode 100644 sources/tech/20160512 Python unittest - assertTrue is truthy - assertFalse is falsy.md diff --git a/sources/tech/20160512 Python unittest - assertTrue is truthy - assertFalse is falsy.md b/sources/tech/20160512 Python unittest - assertTrue is truthy - assertFalse is falsy.md new file mode 100644 index 0000000000..bfed46fb0e --- /dev/null +++ b/sources/tech/20160512 Python unittest - assertTrue is truthy - assertFalse is falsy.md @@ -0,0 +1,176 @@ +Python unittest: assertTrue is truthy, assertFalse is falsy +=========================== + +In this post, I explore the differences between the unittest boolean assert methods assertTrue and assertFalse and the assertIs identity assertion. + +### Definitions + +Here’s what the [unittest module documentation][1] currently notes about assertTrue and assertFalse, with the appropriate code highlighted: + + +>assertTrue(expr, msg=None) + +>assertFalse(expr, msg=None) + +>>Test that expr is true (or false). + +>>Note that this is equivalent to + +>>bool(expr) is True + +>>and not to + +>>expr is True + +>>(use assertIs(expr, True) for the latter). + +[Mozilla Developer Network defines truthy][2] as: + +> A value that translates to true when evaluated in a Boolean context. +In Python this is equivalent to: + +``` +bool(expr) is True +``` + +Which exactly matches what assertTrue is testing for. + +Therefore the documentation already indicates assertTrue is truthy and assertFalse is falsy. These assertion methods are creating a bool from the received value and then evaluating it. It also suggests that we really shouldn’t use assertTrue or assertFalse for very much at all. + +### What does this mean in practice? + +Let’s use a very simple example - a function called always_true that returns True. We’ll write the tests for it and then make changes to the code and see how the tests perform. + +Starting with the tests, we’ll have two tests. One is “loose”, using assertTrue to test for a truthy value. The other is “strict” using assertIs as recommended by the documentation: + +``` +import unittest + +from func import always_true + + +class TestAlwaysTrue(unittest.TestCase): + + def test_assertTrue(self): + """ + always_true returns a truthy value + """ + result = always_true() + + self.assertTrue(result) + + def test_assertIs(self): + """ + always_true returns True + """ + result = always_true() + + self.assertIs(result, True) +``` + +Here’s the code for our simple function in func.py: + +``` +def always_true(): + """ + I'm always True. + + Returns: + bool: True + """ + return True +``` + +When run, everything passes: + +``` +always_true returns True ... ok +always_true returns a truthy value ... ok + +---------------------------------------------------------------------- +Ran 2 tests in 0.004s + +OK +``` + +Happy days! + +Now, “someone” changes always_true to the following: + +``` +def always_true(): + """ + I'm always True. + + Returns: + bool: True + """ + return 'True' +``` + +Instead of returning True (boolean), it’s now returning string 'True'. (Of course this “someone” hasn’t updated the docstring - we’ll raise a ticket later.) + +This time the result is not so happy: + +``` +always_true returns True ... FAIL +always_true returns a truthy value ... ok + +====================================================================== +FAIL: always_true returns True +---------------------------------------------------------------------- +Traceback (most recent call last): + File "/tmp/assertttt/test.py", line 22, in test_is_true + self.assertIs(result, True) +AssertionError: 'True' is not True + +---------------------------------------------------------------------- +Ran 2 tests in 0.004s + +FAILED (failures=1) +``` + +Only one test failed! This means assertTrue gave us a false-positive. It passed when it shouldn’t have. It’s lucky we wrote the second test with assertIs. + +Therefore, just as we learned from the manual, to keep the functionality of always_true pinned tightly the stricter assertIs should be used rather than assertTrue. + +### Use assertion helpers + +Writing out assertIs to test for True and False values is not too lengthy. However, if you have a project in which you often need to check that values are exactly True or exactly False, then you can make yourself the assertIsTrue and assertIsFalse assertion helpers. + +This doesn’t save a particularly large amount of code, but it does improve readability in my opinion. + +``` +def assertIsTrue(self, value): + self.assertIs(value, True) + +def assertIsFalse(self, value): + self.assertIs(value, False) +``` + +### Summary + +In general, my recommendation is to keep tests as tight as possible. If you mean to test for the exact value True or False, then follow the [documentation][3] and use assertIs. Do not use assertTrue or assertFalse unless you really have to. + +If you are looking at a function that can return various types, for example, sometimes bool sometimes int, then consider refactoring. This is a code smell and in Python, that False value for an error would probably be better raised as an exception. + +In addition, if you really need to assert the return value from a function under test is truthy, there might be a second code smell - is your code correctly encapsulated? If assertTrue and assertFalse are asserting that function return values will trigger if statements correctly, then it might be worth sense-checking you’ve encapsulated everything you intended in the appropriate place. Maybe those if statements should be encapsulated within the function under test. + +Happy testing! + + + +-------------------------------------------------------------------------------- + +via: http://jamescooke.info/python-unittest-asserttrue-is-truthy-assertfalse-is-falsy.html + +作者:[James Cooke][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://jamescooke.info/pages/hello-my-name-is-james.html +[1]:https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertTrue +[2]:https://developer.mozilla.org/en-US/docs/Glossary/Truthy +[3]:https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertTrue From f03c4a265481ba645e1061ffa240a47b19d2fa06 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 14 Aug 2016 02:12:10 +0800 Subject: [PATCH 1427/1469] =?UTF-8?q?20160814-6=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/talk/20160808 What is open source.md | 121 +++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 sources/talk/20160808 What is open source.md diff --git a/sources/talk/20160808 What is open source.md b/sources/talk/20160808 What is open source.md new file mode 100644 index 0000000000..1ff197dee4 --- /dev/null +++ b/sources/talk/20160808 What is open source.md @@ -0,0 +1,121 @@ +What is open source +=========================== + +The term "open source" refers to something people can modify and share because its design is publicly accessible. + +The term originated in the context of software development to designate a specific approach to creating computer programs. Today, however, "open source" designates a broader set of values—what we call "[the open source way][1]." Open source projects, products, or initiatives embrace and celebrate principles of open exchange, collaborative participation, rapid prototyping, transparency, meritocracy, and community-oriented development. + +### What is open source software? + +Open source software is software with source code that anyone can inspect, modify, and enhance. + +"Source code" is the part of software that most computer users don't ever see; it's the code computer programmers can manipulate to change how a piece of software—a "program" or "application"—works. Programmers who have access to a computer program's source code can improve that program by adding features to it or fixing parts that don't always work correctly. + +### What's the difference between open source software and other types of software? + +Some software has source code that only the person, team, or organization who created it—and maintains exclusive control over it—can modify. People call this kind of software "proprietary" or "closed source" software. + +Only the original authors of proprietary software can legally copy, inspect, and alter that software. And in order to use proprietary software, computer users must agree (usually by signing a license displayed the first time they run this software) that they will not do anything with the software that the software's authors have not expressly permitted. Microsoft Office and Adobe Photoshop are examples of proprietary software. + +Open source software is different. Its authors [make its source code available][2] to others who would like to view that code, copy it, learn from it, alter it, or share it. [LibreOffice][3] and the [GNU Image Manipulation Program][4] are examples of open source software. + +As they do with proprietary software, users must accept the terms of a [license][5] when they use open source software—but the legal terms of open source licenses differ dramatically from those of proprietary licenses. + +Open source licenses affect the way people can [use, study, modify, and distribute][6] software. In general, open source licenses grant computer users [permission to use open source software for any purpose they wish][7]. Some open source licenses—what some people call "copyleft" licenses—stipulate that anyone who releases a modified open source program must also release the source code for that program alongside it. Moreover, [some open source licenses][8] stipulate that anyone who alters and shares a program with others must also share that program's source code without charging a licensing fee for it. + +By design, open source software licenses promote collaboration and sharing because they permit other people to make modifications to source code and incorporate those changes into their own projects. They encourage computer programmers to access, view, and modify open source software whenever they like, as long as they let others do the same when they share their work. + +### Is open source software only important to computer programmers? + +No. Open source technology and open source thinking both benefit programmers and non-programmers. + +Because early inventors built much of the Internet itself on open source technologies—like [the Linux operating system][9] and the[ Apache Web server][10] application—anyone using the Internet today benefits from open source software. + +Every time computer users view web pages, check email, chat with friends, stream music online, or play multiplayer video games, their computers, mobile phones, or gaming consoles connect to a global network of computers using open source software to route and transmit their data to the "local" devices they have in front of them. The computers that do all this important work are typically located in faraway places that users don't actually see or can't physically access—which is why some people call these computers "remote computers." + +More and more, people rely on remote computers when performing tasks they might otherwise perform on their local devices. For example, they may use online word processing, email management, and image editing software that they don't install and run on their personal computers. Instead, they simply access these programs on remote computers by using a Web browser or mobile phone application. When they do this, they're engaged in "remote computing." + +Some people call remote computing "cloud computing," because it involves activities (like storing files, sharing photos, or watching videos) that incorporate not only local devices but also a global network of remote computers that form an "atmosphere" around them. + +Cloud computing is an increasingly important aspect of everyday life with Internet-connected devices. Some cloud computing applications, like Google Apps, are proprietary. Others, like ownCloud and Nextcloud, are open source. + +Cloud computing applications run "on top" of additional software that helps them operate smoothly and efficiently, so people will often say that software running "underneath" cloud computing applications acts as a "platform" for those applications. Cloud computing platforms can be open source or closed source. OpenStack is an example of an open source cloud computing platform. + +### Why do people prefer using open source software? + +People prefer open source software to proprietary software for a number of reasons, including: + +Control. Many people prefer open source software because they [have more control][11] over that kind of software. They can examine the code to make sure it's not doing anything they don't want it to do, and they can change parts of it they don't like. Users who aren't programmers also benefit from open source software, because they can use this software for any purpose they wish—not merely the way someone else thinks they should. + +Training. Other people like open source software because it helps them [become better programmers][12]. Because open source code is publicly accessible, students can easily study it as they learn to make better software. Students can also share their work with others, inviting comment and critique, as they develop their skills. When people discover mistakes in programs' source code, they can share those mistakes with others to help them avoid making those same mistakes themselves. + +Security. Some people prefer open source software because they consider it more [secure][13] and stable than proprietary software. Because anyone can view and modify open source software, someone might spot and correct errors or omissions that a program's original authors might have missed. And because so many programmers can work on a piece of open source software without asking for permission from original authors, they can fix, update, and upgrade open source software more [quickly][14] than they can proprietary software. + +Stability. Many users prefer open source software to proprietary software for important, long-term projects. Because programmers [publicly distribute][15] the source code for open source software, users relying on that software for critical tasks can be sure their tools won't disappear or fall into disrepair if their original creators stop working on them. Additionally, open source software tends to both incorporate and operate according to open standards. + +### Doesn't "open source" just mean something is free of charge? + +No. This is a [common misconception][16] about what "open source" implies, and the concept's implications are [not only economic][17]. + +Open source software programmers can charge money for the open source software they create or to which they contribute. But in some cases, because an open source license might require them to release their source code when they sell software to others, some programmers find that charging users money for software services and support (rather than for the software itself) is more lucrative. This way, their software remains free of charge, and they [make money helping others][18] install, use, and troubleshoot it. + +While some open source software may be free of charge, skill in programming and troubleshooting open source software can be [quite valuable][19]. Many employers specifically seek to [hire programmers with experience][20] working on open source software. + +### What is open source "beyond software"? + +At Opensource.com, we like to say that we're interested in the ways open source values and principles apply to the world beyond software. We like to think of open source as not only a way to develop and license computer software, but also an attitude. + +Approaching all aspects of life "[the open source way][21]" means expressing a willingness to share, collaborating with others in ways that are transparent (so that others can watch and join too), embracing failure as a means of improving, and expecting—even encouraging—everyone else to do the same. + +It also means committing to playing an active role in improving the world, which is possible only when [everyone has access][22] to the way that world is designed. + +The world is full of "source code"—[blueprints][23], [recipes][24], [rules][25]—that guide and shape the way we think and act in it. We believe this underlying code (whatever its form) should be open, accessible, and shared—so many people can have a hand in altering it for the better. + +Here, we tell stories about the impact of open source values on all areas of life—[science][26], [education][27], [government][28], [manufacturing][29], health, law, and [organizational dynamics][30]. We're a community committed to telling others how the open source way is the best way, because a love of open source is just like anything else: it's better when it's shared. + +Where can I learn more about open source? + +We've compiled several resources designed to help you learn more about [open source. We recommend you read our open source FAQs, how-to guides, and tutorials][31] to get started. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/resources/what-open-source + +作者:[opensource.com][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: opensource.com +[1]:https://opensource.com/open-source-way +[2]:https://opensource.com/business/13/5/open-source-your-code +[3]:https://www.libreoffice.org/ +[4]:http://www.gimp.org/ +[5]:https://opensource.com/law/13/1/which-open-source-software-license-should-i-use +[6]:https://opensource.com/law/10/10/license-compliance-not-problem-open-source-users +[7]:https://opensource.org/docs/osd +[8]:https://opensource.com/law/13/5/does-your-code-need-license +[9]:https://opensource.com/resources/what-is-linux +[10]:http://httpd.apache.org/ +[11]:https://opensource.com/life/13/5/tumblr-open-publishing +[12]:https://opensource.com/life/13/6/learning-program-open-source-way +[13]:https://opensource.com/government/10/9/scap-computer-security-rest-us +[14]:https://opensource.com/government/13/2/bug-fix-day +[15]:https://opensource.com/life/12/9/should-we-develop-open-source-openly +[16]:https://opensource.com/education/12/7/clearing-open-source-misconceptions +[17]:https://opensource.com/open-organization/16/5/appreciating-full-power-open +[18]:https://opensource.com/business/14/7/making-your-product-free-and-open-source-crazy-talk +[19]:https://opensource.com/business/16/2/add-open-source-to-your-resume +[20]:https://opensource.com/business/16/5/2016-open-source-jobs-report +[21]:https://opensource.com/open-source-way +[22]:https://opensource.com/resources/what-open-access +[23]:https://opensource.com/life/11/6/architecture-open-source-applications-learn-those-you +[24]:https://opensource.com/life/12/6/open-source-like-sharing-recipe +[25]:https://opensource.com/life/12/4/day-my-mind-became-open-sourced +[26]:https://opensource.com/resources/open-science +[27]:https://opensource.com/resources/what-open-education +[28]:https://opensource.com/resources/open-government +[29]:https://opensource.com/resources/what-open-hardware +[30]:https://opensource.com/resources/what-open-organization +[31]:https://opensource.com/resources From 18a5651b30b4808a96368b6c88b744bb37837315 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 14 Aug 2016 09:35:50 +0800 Subject: [PATCH 1428/1469] =?UTF-8?q?PUB:20160604=20Smem=20=E2=80=93=20Rep?= =?UTF-8?q?orts=20Memory=20Consumption=20Per-Process=20and=20Per-User=20Ba?= =?UTF-8?q?sis=20in=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @dongfengweixiao --- ...n Per-Process and Per-User Basis in Linux.md | 89 ++++++++++--------- 1 file changed, 46 insertions(+), 43 deletions(-) rename {translated/tech => published}/20160604 Smem – Reports Memory Consumption Per-Process and Per-User Basis in Linux.md (86%) diff --git a/translated/tech/20160604 Smem – Reports Memory Consumption Per-Process and Per-User Basis in Linux.md b/published/20160604 Smem – Reports Memory Consumption Per-Process and Per-User Basis in Linux.md similarity index 86% rename from translated/tech/20160604 Smem – Reports Memory Consumption Per-Process and Per-User Basis in Linux.md rename to published/20160604 Smem – Reports Memory Consumption Per-Process and Per-User Basis in Linux.md index befcdb5d31..1554186fbf 100644 --- a/translated/tech/20160604 Smem – Reports Memory Consumption Per-Process and Per-User Basis in Linux.md +++ b/published/20160604 Smem – Reports Memory Consumption Per-Process and Per-User Basis in Linux.md @@ -1,45 +1,45 @@ -Smem – Linux 下基于进程和用户的内存占用报告程序 +Smem – Linux 下基于进程和用户的内存占用报告 =========================================================================== +Linux 系统的内存管理工作中,内存使用情况的监控是十分重要的,在各种 Linux 发行版上你会找到许多这种工具。它们的工作方式多种多样,在这里,我们将会介绍如何安装和使用这样的一个名为 SMEM 的工具软件。 -Linux 系统的内存管理工作中,内存使用情况的监控是十分重要的,不同的 Linux 发行版可能会提供不同的工具。但是它们的工作方式多种多样,这里,我们将会介绍如何安装和使用这样的一个名为 SMEM 的工具软件。 - -Smem 是一款命令行下的内存使用情况报告工具。和其它传统的内存报告工具不同个,它仅做这一件事情——报告 PPS(实际使用的物理内存[比例分配共享库占用的内存]),这种内存使用量表示方法对于那些在虚拟内存中的应用和库更有意义。 +Smem 是一款命令行下的内存使用情况报告工具,它能够给用户提供 Linux 系统下的内存使用的多种报告。和其它传统的内存报告工具不同的是,它有个独特的功能,可以报告 PSS(按比例占用大小:Proportional Set Size),这种内存使用量表示方法对于那些在虚拟内存中的应用和库更有意义。 ![](http://www.tecmint.com/wp-content/uploads/2016/06/Smem-Linux-Memory-Reporting-Tool.png) ->Smem – Linux 内存报告工具 -已有的传统工具会将目光主要集中于读取 RSS(实际使用物理内存[包含共享库占用的内存]),这种方法对于恒量那些使用物理内存方案的使用情况来说是标准方法,但是应用程序往往会高估内存的使用情况。 +*Smem – Linux 内存报告工具* -PSS 从另一个侧面,为那些使用虚拟内存方案的应用和库提供了给出了确定内存“公评分担”的合理措施。 +已有的传统工具会将目光主要集中于读取 RSS(实际占用大小:Resident Set Size),这种方法是以物理内存方案来衡量使用情况的标准方法,但是往往高估了应用程序的内存的使用情况。 -你可以 [阅读此指南了解 (关于内存的 RSS 和 PSS)][1] Linux 系统中的内存占用。 +PSS 从另一个侧面,通过判定在虚拟内存中的应用和库所使用的“合理分享”的内存,来给出更可信的衡量结果。 + +你可以阅读此[指南 (关于内存的 RSS 和 PSS)][1]了解 Linux 系统中的内存占用,不过现在让我们继续看看 smem 的特点。 ### Smem 这一工具的特点 - 系统概览列表 -- 以进程,映射和用户来显示或者是过滤 +- 以进程、映射和用户来显示或者是过滤 - 从 /proc 文件系统中得到数据 -- 从多个数据源配置显示条目 -- 可配置输出单元和百分比 -- 易于配置列表标题和汇总 +- 从多个数据源配置显示的条目 +- 可配置输出单位和百分比 +- 易于配置列表表头和汇总 - 从镜像文件夹或者是压缩的 tar 文件中获得数据快照 - 内置的图表生成机制 -- 在嵌入式系统中使用轻量级的捕获工具 +- 轻量级的捕获工具,可用于嵌入式系统 ### 如何安装 Smem - Linux 下的内存使用情况报告工具 安装之前,需要确保满足以下的条件: -- 现代内存 (版本号高于 2.6.27) +- 现代内核 (版本号高于 2.6.27) - 较新的 Python 版本 (2.4 及以后版本) - 可选的 [matplotlib][2] 库用于生成图表 -对于当今的大多数的 Linux 发行版而言,内核版本和 Python 的版本都能够 满足需要,所以仅需要为生成良好的图表安装 matplotlib 库。 +对于当今的大多数的 Linux 发行版而言,内核版本和 Python 的版本都能够满足需要,所以仅需要为生成良好的图表安装 matplotlib 库。 #### RHEL, CentOS 和 Fedora -首先启用 [EPEL (Extra Packages for Enterprise Linux)][3] 软件源然后按照下列步骤操作: +首先启用 [EPEL (Extra Packages for Enterprise Linux)][3] 软件源,然后按照下列步骤操作: ``` # yum install smem python-matplotlib python-tk @@ -59,7 +59,7 @@ $ sudo apt-get install smem python-matplotlib python-tk #### Arch Linux -使用此 [AUR repository][4]。 +使用此 [AUR 仓库][4]。 ### 如何使用 Smem – Linux 下的内存使用情况报告工具 @@ -69,7 +69,7 @@ $ sudo apt-get install smem python-matplotlib python-tk $ sudo smem ``` -监视 Linux 系统中的内存使用情况 +*监视 Linux 系统中的内存使用情况* ``` PID User Command Swap USS PSS RSS @@ -108,7 +108,7 @@ $ sudo smem .... ``` -当常规用户运行 smem,将会显示由用户启用的进程的占用情况,其中进程按照 PSS 的值升序排列。 +当普通用户运行 smem,将会显示由该用户启用的进程的占用情况,其中进程按照 PSS 的值升序排列。 下面的输出为用户 “aaronkilik” 启用的进程的使用情况: @@ -116,7 +116,7 @@ $ sudo smem $ smem ``` -监视 Linux 系统中的内存使用情况 +*监视 Linux 系统中的内存使用情况* ``` PID User Command Swap USS PSS RSS @@ -156,12 +156,13 @@ $ smem ... ``` -使用 smem 是还有一些参数可以选用,例如当参看整个系统的内存占用情况,运行以下的命令: +使用 smem 时还有一些参数可以选用,例如当查看整个系统的内存占用情况,运行以下的命令: ``` $ sudo smem -w ``` -监视 Linux 系统中的内存使用情况 + +*监视 Linux 系统中的内存使用情况* ``` Area Used Cache Noncache @@ -178,7 +179,7 @@ free memory 4424936 4424936 0 $ sudo smem -u ``` -Linux 下以用户为单位监控内存占用情况 +*Linux 下以用户为单位监控内存占用情况* ``` User Count Swap USS PSS RSS @@ -201,7 +202,7 @@ tecmint 64 0 1652888 1815699 2763112 $ sudo smem -m ``` -Linux 下以映射为单位监控内存占用情况 +*Linux 下以映射为单位监控内存占用情况* ``` Map PIDs AVGPSS PSS @@ -231,15 +232,15 @@ Map PIDs AVGPSS PSS .... ``` -还有其它的选项用于 smem 的输出,下面将会举两个例子。 +还有其它的选项可以筛选 smem 的输出,下面将会举两个例子。 -要按照用户名筛选输出的信息,调用 -u 或者是 --userfilter="regex" 选项,就像下面的命令这样: +要按照用户名筛选输出的信息,使用 -u 或者是 --userfilter="regex" 选项,就像下面的命令这样: ``` $ sudo smem -u ``` -按照用户报告内存使用情况 +*按照用户报告内存使用情况* ``` User Count Swap USS PSS RSS @@ -256,13 +257,13 @@ root 39 0 323804 353374 496552 tecmint 64 0 1708900 1871766 2819212 ``` -要按照进程名称筛选输出信息,调用 -P 或者是 --processfilter="regex" 选项,就像下面的命令这样: +要按照进程名称筛选输出信息,使用 -P 或者是 --processfilter="regex" 选项,就像下面的命令这样: ``` $ sudo smem --processfilter="firefox" ``` -按照进程名称报告内存使用情况 +*按照进程名称报告内存使用情况* ``` PID User Command Swap USS PSS RSS @@ -271,7 +272,7 @@ PID User Command Swap USS PSS RSS 4424 tecmint /usr/lib/firefox/firefox 0 931732 937590 961504 ``` -输出的格式有时候也很重要,smem 提供了一些参数帮助您格式化内存使用报告,我们将举出几个例子。 +输出的格式有时候也很重要,smem 提供了一些帮助您格式化内存使用报告的参数,我们将举出几个例子。 设置哪些列在报告中,使用 -c 或者是 --columns选项,就像下面的命令这样: @@ -279,7 +280,7 @@ PID User Command Swap USS PSS RSS $ sudo smem -c "name user pss rss" ``` -按列报告内存使用情况 +*按列报告内存使用情况* ``` Name User PSS RSS @@ -317,7 +318,7 @@ ssh-agent tecmint 485 992 $ sudo smem -p ``` -按百分比报告内存使用情况 +*按百分比报告内存使用情况* ``` PID User Command Swap USS PSS RSS @@ -345,13 +346,13 @@ $ sudo smem -p .... ``` -下面的额命令将会在输出的最后输出一行汇总信息: +下面的命令将会在输出的最后输出一行汇总信息: ``` $ sudo smem -t ``` -报告内存占用合计 +*报告内存占用合计* ``` PID User Command Swap USS PSS RSS @@ -389,27 +390,29 @@ PID User Command Swap USS PSS RSS 比如,你可以生成一张进程的 PSS 和 RSS 值的条状图。在下面的例子中,我们会生成属于 root 用户的进程的内存占用图。 -纵坐标为每一个进程的 PSS 和 RSS 值,横坐标为 root 用户的所有进程: +纵坐标为每一个进程的 PSS 和 RSS 值,横坐标为 root 用户的所有进程(的 ID): ``` $ sudo smem --userfilter="root" --bar pid -c"pss rss" ``` ![](http://www.tecmint.com/wp-content/uploads/2016/06/Linux-Memory-Usage-in-PSS-and-RSS-Values.png) ->Linux Memory Usage in PSS and RSS Values -也可以生成进程及其 PSS 和 RSS 占用量的饼状图。以下的命令将会输出一张 root 用户的所有进程的饼状。 +*Linux Memory Usage in PSS and RSS Values* -`--pie` name 意思为以各个进程名字为标签,`-s` 选项帮助以 PSS 的值排序。 +也可以生成进程及其 PSS 和 RSS 占用量的饼状图。以下的命令将会输出一张 root 用户的所有进程的饼状图。 + +`--pie` name 意思为以各个进程名字为标签,`-s` 选项用来以 PSS 的值排序。 ``` $ sudo smem --userfilter="root" --pie name -s pss ``` ![](http://www.tecmint.com/wp-content/uploads/2016/06/Linux-Memory-Consumption-by-Processes.png) ->Linux Memory Consumption by Processes -它们还提供了一些其它与 PSS 和 RSS 相关的字段用于图表的标签: +*Linux Memory Consumption by Processes* + +除了 PSS 和 RSS ,其它的字段也可以用于图表的标签: 假如需要获得帮助,非常简单,仅需要输入 `smem -h` 或者是浏览帮助页面。 @@ -420,16 +423,16 @@ $ sudo smem --userfilter="root" --pie name -s pss -------------------------------------------------------------------------------- -via: http://www.tecmint.com/smem-linux-memory-usage-per-process-per-user/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tecmint+%28Tecmint%3A+Linux+Howto%27s+Guide%29 +via: http://www.tecmint.com/smem-linux-memory-usage-per-process-per-user/ 作者:[Aaron Kili][a] 译者:[dongfengweixiao](https://github.com/dongfengweixiao) -校对:[校对者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/aaronkili/ [1]: https://emilics.com/notebook/enblog/p871.html [2]: http://matplotlib.org/index.html -[3]: http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/ +[3]: https://linux.cn/article-2324-1.html [4]: https://www.archlinux.org/packages/community/i686/smem/ From 5927329554915f9974102238ae56f3b33e6d4c40 Mon Sep 17 00:00:00 2001 From: Frank Zhang Date: Sun, 14 Aug 2016 14:40:40 +0800 Subject: [PATCH 1429/1469] [translated] 20160802 3 graphical tools for Git.md --- .../20160802 3 graphical tools for Git.md | 118 ------------------ .../20160802 3 graphical tools for Git.md | 117 +++++++++++++++++ 2 files changed, 117 insertions(+), 118 deletions(-) delete mode 100644 sources/tech/20160802 3 graphical tools for Git.md create mode 100644 translated/tech/20160802 3 graphical tools for Git.md diff --git a/sources/tech/20160802 3 graphical tools for Git.md b/sources/tech/20160802 3 graphical tools for Git.md deleted file mode 100644 index 579ec09fdc..0000000000 --- a/sources/tech/20160802 3 graphical tools for Git.md +++ /dev/null @@ -1,118 +0,0 @@ -zpl1025 -3 graphical tools for Git -============================= - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/government/BUSINESS_meritladder.png?itok=4CAH2wV0) - -In this article, we'll take a look at some convenience add-ons to help you integrate Git comfortably into your everyday workflow. - -I learned Git before many of these fancy interfaces existed, and my workflow is frequently text-based anyway, so most of the inbuilt conveniences of Git suit me pretty well. It is always best, in my opinion, to understand how Git works natively. However, it is always nice to have options, so these are some of the ways you can start using Git outside of the terminal. - -### Git in KDE Dolphin - -I am a KDE user, if not always within the Plasma desktop, then as my application layer in Fluxbox. Dolphin is an excellent file manager with lots of options and plenty of secret little features. Particularly useful are all the plugins people develop for it, one of which is a nearly-complete Git interface. Yes, you can manage your Git repositories natively from the comfort of your own desktop. - -But first, you'll need to make sure the add-ons are installed. Some distros come with a filled-to-the-brim KDE, while others give you just the basics, so if you don't see the Git options in the next few steps, search your repository for something like dolphin-extras or dolphin-plugins. - -To activate Git integration, go to the Settings menu in any Dolphin window and select Configure Dolphin. - -In the Configure Dolphin window, click on the Services icon in the left column. - -In the Services panel, scroll through the list of available plugins until you find Git. - -![](https://opensource.com/sites/default/files/4_dolphinconfig.jpg) - -Save your changes and close your Dolphin window. When you re-launch Dolphin, navigate to a Git repository and have a look around. Notice that all icons now have emblems: green boxes for committed files, solid green boxes for modified files, no icon for untracked files, and so on. - -Your right-click menu now has contextual Git options when invoked inside a Git repository. You can initiate a checkout, push or pull when clicking inside a Dolphin window, and you can even do a git add or git remove on your files. - -![](https://opensource.com/sites/default/files/4_dolphingit.jpg) - -You can't clone a repository or change remote paths in Dolphin, but will have to drop to a terminal, which is just an F4 away. - -Frankly, this feature of KDE is so kool [sic] that this article could just end here. The integration of Git in your native file manager makes working with Git almost transparent; everything you need to do just happens no matter what stage of the process you are in. Git in the terminal, and Git waiting for you when you switch to the GUI. It is perfection. - -But wait, there's more! - -### Sparkleshare - -From the other side of the desktop pond comes SparkleShare, a project that uses a file synchronization model ("like Dropbox!") that got started by some GNOME developers. It is not integrated into any specific part of GNOME, so you can use it on all platforms. - -If you run Linux, install SparkleShare from your software repository. Other operating systems should download from the SparkleShare website. You can safely ignore the instructions on the SparkleShare website, which are for setting up a SparkleShare server, which is not what we will do here. You certainly can set up a SparkleShare server if you want, but SparkleShare is compatible with any Git repository, so you don't need to create your own server. - -After it is installed, launch SparkleShare from your applications menu. Step through the setup wizard, which is two steps plus a brief tutorial, and optionally set SparkleShare as a startup item for your desktop. - -![](https://opensource.com/sites/default/files/4_sparklesetup.jpg) - -An orange SparkleShare directory is now in your system tray. Currently, SparkleShare is oblivious to anything on your computer, so you need to add a hosted project. - -To add a directory for SparkleShare to track, click the SparkleShare icon in your system tray and select Add Hosted Project. - -![](https://opensource.com/sites/default/files/4_sparklehost.jpg) - -SparkleShare can work with self-hosted Git projects, or projects hosted on public Git services like GitHub and Bitbucket. For full access, you'll probably need to use the Client ID that SparkleShare provides to you. This is an SSH key acting as the authentication token for the service you use for hosting, including your own Git server, which should also use SSH public key authentication rather than password login. Copy the Client ID into the authorized_hosts file of your Git user on your server, or into the SSH key panel of your Git host. - -After configuring the host you want to use, SparkleShare downloads the Git project, including, at your option, the commit history. Find the files in ~/SparkleShare. - -Unlike Dolphin's Git integration, SparkleShare is unnervingly invisible. When you make a change, it quietly syncs the change to your remote project. For many people, that is a huge benefit: all the power of Git with none of the maintenance. To me, it is unsettling, because I like to govern what I commit and which branch I use. - -SparkleShare may not be for everyone, but it is a powerful and simple Git solution that shows how different open source projects fit together in perfect harmony to create something unique. - -### Git-cola - -Yet another model of working with Git repositories is less native and more of a monitoring approach; rather than using an integrated application to interact directly with your Git project, you can use a desktop client to monitor changes in your project and deal with each change in whatever way you choose. An advantage to this approach is focus. You might not care about all 125 files in your project when only three of them are actively being worked on, so it is helpful to bring them to the forefront. - -If you thought there were a lot of Git web hosts out there, you haven't seen anything yet. [Git clients for your desktop][1] are a dime-a-dozen. In fact, Git actually ships with an inbuilt graphical Git client. The most cross-platform and most configurable of them all is the open source Git-cola client, written in Python and Qt. - -If you're on Linux, Git-cola may be in your software repository. Otherwise, just download it from the site and install it: - -``` -$ python setup.py install -``` - -When Git-cola launches, you're given three buttons to open an existing repository, create a new repo, or clone an existing repository. - -Whichever you choose, at some point you end up with a Git repository. Git-cola, and indeed most desktop clients that I've used, don't try to be your interface into your repository; they leave that up to your normal operating system tools. In other words, I might start a repository with Git-cola, but then I would open that repository in Thunar or Emacs to start my work. Leaving Git-cola open as a monitor works quite well, because as you create new files, or change existing ones, they appear in Git-cola's Status panel. - -The default layout of Git-cola is a little non-linear. I prefer to move from left-to-right, and because Git-cola happens to be very configurable, you're welcome to change your layout. I set mine up so that the left-most panel is Status, showing any changes made to my current branch, then to the right, a Diff panel in case I want to review a change, and the Actions panel for quick-access buttons to common tasks, and finally the right-most panel is a Commit panel where I can write commit messages. - -![](https://opensource.com/sites/default/files/4_gitcola.jpg) - -Even if you use a different layout, this is the general flow of Git-cola: - -Changes appear in the Status panel. Right-click a change entry, or select a file and click the Stage button in the Action panel, to stage a file. - -A staged file's icon changes to a green triangle to indicate that it has been both modified and staged. You can unstage a file by right-clicking and selecting Unstage Selected, or by clicking the Unstage button in the Actions panel. - -Review your changes in the Diff panel. - -When you are ready to commit, enter a commit message and click the Commit button. - -There are other buttons in the Actions panel for other common tasks like a git pull or git push. The menus round out the task list, with dedicated actions for branching, reviewing diffs, rebasing, and a lot more. - -I tend to think of Git-cola as a kind of floating panel for my file manager (and I only use Git-cola when Dolphin is not available). On one hand, it's less interactive than a fully integrated and Git-aware file manager, but on the other, it offers practically everything that raw Git does, so it's actually more powerful. - -There are plenty of graphical Git clients. Some are paid software with no source code available, others are viewers only, others attempt to reinvent Git with special terms that are specific to the client ("sync" instead of "push"..?), and still others are platform-specific. Git-Cola has consistently been the easiest to use on any platform, and the one that stays closest to pure Git so that users learn Git whilst using it, and experts feel comfortable with the interface and terminology. - -### Git or graphical? - -I don't generally use graphical tools to access Git; mostly I use the ones I've discussed when helping other people find a comfortable interface for themselves. At the end of the day, though, it comes down to what fits with how you work. I like terminal-based Git because it integrates well with Emacs, but on a day where I'm working mostly in Inkscape, I might naturally fall back to using Git in Dolphin because I'm in Dolphin anyway. - -It's up to you how you use Git; the most important thing to remember is that Git is meant to make your life easier and those crazy ideas you have for your work safer to try out. Get familiar with the way Git works, and then use Git from whatever angle you find works best for you. - -In our next installment, we will learn how to set up and manage a Git server, including user access and management, and running custom scripts. - - - --------------------------------------------------------------------------------- - -via: https://opensource.com/life/16/8/graphical-tools-git - -作者:[Seth Kenlon][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[1]: https://git-scm.com/downloads/guis diff --git a/translated/tech/20160802 3 graphical tools for Git.md b/translated/tech/20160802 3 graphical tools for Git.md new file mode 100644 index 0000000000..e26b1c10d9 --- /dev/null +++ b/translated/tech/20160802 3 graphical tools for Git.md @@ -0,0 +1,117 @@ +3 个 Git 图形工具 +============================= + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/government/BUSINESS_meritladder.png?itok=4CAH2wV0) + +在本文里,我们来了解几个能帮你在日常工作中舒服地用上 Git 的工具。 + +我是在这许多漂亮界面出来之前学习的 Git,而且我的日常工作经常是基于字符界面的,所以 Git 本身自带的大部分功能已经足够我用了。在我看来,最好能理解 Git 的工作原理。不过,能有的选也不错,下面这些就是能让你不用终端酒可以开始使用 Git 的一些方式。 + +### KDE Dolphin 里的 Git + +我是一个 KDE 用户,如果不在 Plasma 桌面环境下,就是在 Fluxbox 的应用层。Dolphin 是一个非常优秀的文件管理器,有很多配置项以及大量秘密小功能。大家为它开发的插件都特别好用,其中一个是几乎完整的 Git 界面。是的,你可以直接在自己的桌面上很方便地管理你的 Git 仓库。 + +但首先,你得先确认已经安装了这个插件。有些发行版带的 KDE 将各种插件都装的满满的,而有些只装了一些最基本的,所以如果你在下面的步骤里没有看到 Git 相关选项,就在你的配置目录里找找类似 dolphin-extras 或者 dolphin-plugins 的字样。 + +要打开 Git 集成,在任何 Dolphin 窗口里点击 Settings 菜单,并选择 Configure Dolphin。 + +在弹出的 Configure Dolphin 窗口里,点击左边侧栏里的 Services 图标。 + +在 Services 面板里,滚动可用的插件列表找到 Git。 + +![](https://opensource.com/sites/default/files/4_dolphinconfig.jpg) + +保存你的改动并关闭 Dolphin 窗口。重新启动 Dolphin,浏览一个 Git 仓库试试看。你会发现现在所有文件图标都带有标记:绿色方框表示已经提交的文件,绿色实心方块表示文件有改动,没加入库里的文件没有标记,等等。 + +之后你在 Git 仓库目录下点击鼠标右键弹出的菜单里就会有 Git 选项了。你在 Dolphin 窗口里点击鼠标就可以检出一个版本,推送或提交改动,还可以对文件进行 git add 或 git remove 操作。 + +![](https://opensource.com/sites/default/files/4_dolphingit.jpg) + +不过 Dolphin 不支持克隆仓库或是改变远端路径,需要到终端窗口操作,按下 F4 就可以很方便地进行切换。 + +坦白地说,KDE 的这个功能太牛了,这篇文章已经可以到此为止。将 Git 集成到原生文件管理器里可以让 Git 操作非常清晰;不管你在工作流程的哪个阶段,一切都能直接地摆在面前。在终端里 Git,切换到 GUI 后也是一样 Git。完美。 + +不过别急,还有好多呢! + +### Sparkleshare + +SparkleShare 来自桌面环境的另一大阵营,由一些 GNOME 开发人员发起,一个使用文件同步模型 ("例如 Dropbox!") 的项目。不过它并没有直接嵌入到 GNOME 里,所以你可以在任何平台使用。 + +如果你在用 Linux,可以从你的软件仓库直接安装 SparkleShare。如果是其它操作系统,可以去 SparkleShare 网站下载。你可以不用看 SparkleShare 网站上的指引,那个是告诉你如何架设 SparkleShare 服务器的,不是我们这里讨论的。当然你想的话也可以架 SparkleShare 服务器,但是 SparkleShare 能兼容 Git 仓库,所以其实没必要再架一个自己的。 + +在安装完成后,从应用程序菜单里启动 SparkleShare。走一遍设置向导,只有两个步骤外加一个简单介绍,然后可以选择是否将 SparkleShare 设置为随桌面自动启动。 + +![](https://opensource.com/sites/default/files/4_sparklesetup.jpg) + +之后在你的系统托盘里会出现一个橙色的 SparkleShare 目录。目前,SparkleShare 对你电脑上的任何东西都一无所知,所以你需要添加一个项目。 + +要添加一个目录给 SparkleShare 追踪,可以点击系统托盘里的 SparkleShare 图标然后选择 Add Hosted Project。 + +![](https://opensource.com/sites/default/files/4_sparklehost.jpg) + +SparkleShare 支持本地 Git 项目,也可以是存放在像 GitHub 和 Bitbucket 这样的 Git 服务器上的项目。要获得访问权限,你可能会需要使用 SparkleShare 生成的客户端 ID。这是一个 SSH 密钥,作为你所用到服务的授权标记,包括你自己的 Git 服务器,应该也是用 SSH 公钥认证而不是用户名密码。将客户端 ID 拷贝到你服务器上 Git 用户的 authorized_hosts 文件里,或者是你的 Git 主机的 SSH 密钥面板里。 + +在配置要你要用的主机后,SparkleShare 会下载整个 Git 项目,包括(你可以自己选择)提交历史。可以在 ~/SparkleShare 目录下找到同步完成的文件。 + +不像 Dolphin 那样的集成方式,SparkleShare 是不透明的,让人心里没底。在你做出改动后,它会悄悄地把改动同步到服务器远端项目中。对大部分人来说,这样做有一个很大的好处:可以用到 Git 的全部威力但是不用维护。对我来说,这样有些乱,因为我想自己管理我的提交以及要用的分支。 + +SparkleShare 可能不适合所有人,但是它是一个强大而且简单的 Git 解决方案,展示了不同的开源项目完美地协调整合到一起后所创造出的独特项目。 + +### Git-cola + +另一种配合 Git 仓库工作的模型,没那么原生,更多的是监视方式;不是使用一个集成的应用程序和你的 Git 项目直接交互,而是你可以使用一个桌面客户端来监视项目改动,并随意处理每一个改动。这种方式的一个优势就是专注。当你实际只用到项目里的三个文件的时候,你可能不会关心所有的 125 个文件,能将这三个文件挑出来就很方便了。 + +如果你觉得有好多 Git 网站,只是你还不知道。[桌面上的 Git 客户端][1] 上有一大把。实际上,Git 默认自带一个图形客户端。它们中平台适用最广,配置最丰富的是开源的 Git-cola 客户端,用 Python 和 Qt 写的。 + +如果你在用 Linux,Git-cola 应该在你的软件仓库里有。不是的话,可以直接从网站下载安装: + +``` +$ python setup.py install +``` + +启动 git-cola 后,会有三个按钮用来打开仓库,创建新仓库,或克隆仓库。 + +不管选哪个,最终都会停在一个 Git 仓库中。和大多数我用过的客户端一样,Git-cola 不会尝试成为你的仓库的接口;它们一般会让操作系统工具来做这个。换句话说,我可以通过 Git-cola 创建一个仓库,但随后我就在 Thunar 或 Emacs 里打开仓库开始工作。打开 Git-cola 来监视仓库很不错,因为当你创建新文件,或者改动文件的时候,它们都会出现在 Git-cola 的状态栏里。 + +Git-cola 的默认布局不是线性的。我喜欢从左向右排列,因为 Git-cola 又是高度可配置的,你可以随便修改布局。我自己设置成最左边是状态栏,显示当前分支的任何改动,然后右边是改动栏,可以浏览当前改动,然后是动作栏,放一些常用任务的快速按钮,最后,最右边是提交栏,可以写提交信息。 + +![](https://opensource.com/sites/default/files/4_gitcola.jpg) + +不管怎么改布局,下面是 Git-cola 的通用流程: + +改动会出现在状态栏里。右键点击一个改动或选中一个文件,然后在动作栏里点击 Stage 按钮来将文件加入待提交暂存区。 + +待提交文件的图标会变成绿色三角形,表示该文件有改动并且正等待提交。你也可以右键点击并选择 Unstage Selected 将改动移出待提交暂存区,或者点击动作栏里的 Unstage 按钮。 + +在改动栏里检查你的改动。 + +当准备好提交后,输入提交信息并点击 Commit 按钮。 + +在动作栏里还有其它按钮用来处理其它普通任务,比如抽取或推送。菜单里有更多的任务列表,比如专用的操作分支,改动审查,变更基础,等等。 + +我更愿意将 Git-cola 当作文件管理器的一个浮动面板(在不能用 Dolphin 的时候我只用 Git-cola)。虽然它的交互性没有完全集成 Git 的文件管理器那么强,但另一方面,它几乎提供了原始 Git 命令的所有功能,所以它实际上更为强大。 + +有很多 Git 图形客户端。有些是不提供源代码的付费软件,有些只是用来查看,有些尝试加入新的特定术语(用 "sync" 替代 "push" ...?) 来重造 Git,也有一些是适合特定平台。Git-cola 一直是最简单的能在任意平台上使用的客户端,也是最贴近纯粹 Git 命令的,可以让用户在使用过程中学习 Git,高手也很满意它的界面和术语。 + +### Git 命令还是图形界面? + +我一般不用图形工具来操作 Git;大多数时候我使用上面介绍的工具,是帮助其他人找出适合他们的界面。不过在一天结束的时候,不同的工作适合不一样的工具。我喜欢基于终端的 Git 命令是因为可以很好地集成到 Emacs 里,但如果某天我几乎都在用 Inkscape 工作时,我一般会很自然地使用 Dolphin 里带的 Git,因为我在 Dolphin 环境里。 + +如何使用 Git 你自己可以选择;但要记住 Git 是一种让生活更轻松的方式,也是让你在工作中更安全地尝试一些疯狂点子的方法。熟悉 Git 的工作模式,然后不管什么方式使用 Git,只要能让你觉得最适合就可以。 + +在下一期文章里,我们将了解如何架设和管理 Git 服务器,包括用户权限和管理,以及运行定制脚本。 + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/16/8/graphical-tools-git + +作者:[Seth Kenlon][a] +译者:[zpl1025](https://github.com/zpl1025) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[1]: https://git-scm.com/downloads/guis From b9e140dbfb29d5855bddb40dec35c5c1e08133b3 Mon Sep 17 00:00:00 2001 From: NearTan Date: Sun, 14 Aug 2016 17:56:09 +0800 Subject: [PATCH 1430/1469] =?UTF-8?q?NearTan=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 --- ...x Administration Tasks and Application Deployments Over SSH.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20151118 Fabric – Automate Your Linux Administration Tasks and Application Deployments Over SSH.md b/sources/tech/20151118 Fabric – Automate Your Linux Administration Tasks and Application Deployments Over SSH.md index 43b1fe59c7..f45d1e9702 100644 --- a/sources/tech/20151118 Fabric – Automate Your Linux Administration Tasks and Application Deployments Over SSH.md +++ b/sources/tech/20151118 Fabric – Automate Your Linux Administration Tasks and Application Deployments Over SSH.md @@ -1,3 +1,5 @@ +NearTan 认领 + Fabric – Automate Your Linux Administration Tasks and Application Deployments Over SSH =========================== From aaebd2aa5e3bb467a3cfc3fb8cf918b1a065bf17 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 14 Aug 2016 21:31:34 +0800 Subject: [PATCH 1431/1469] PUB:20160620 5 SSH Hardening Tips @maywanting --- published/20160620 5 SSH Hardening Tips.md | 119 +++++++++++++++++ .../talk/20160620 5 SSH Hardening Tips.md | 125 ------------------ 2 files changed, 119 insertions(+), 125 deletions(-) create mode 100644 published/20160620 5 SSH Hardening Tips.md delete mode 100644 translated/talk/20160620 5 SSH Hardening Tips.md diff --git a/published/20160620 5 SSH Hardening Tips.md b/published/20160620 5 SSH Hardening Tips.md new file mode 100644 index 0000000000..22f6edae6e --- /dev/null +++ b/published/20160620 5 SSH Hardening Tips.md @@ -0,0 +1,119 @@ +五条强化 SSH 安全的建议 +====================== + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/binary-1188510_1920_0.jpg?itok=ocPCL_9G) + +*采用这些简单的建议,使你的 OpenSSH 会话更加安全。* + +当你查看你的 SSH 服务日志,可能你会发现充斥着一些不怀好意的尝试性登录。这里有 5 条常规建议(和一些个别特殊策略)可以让你的 OpenSSH 会话更加安全。 + +### 1. 强化密码登录 + +密码登录很方便,因为你可以从任何地方的任何机器上登录。但是它们在暴力攻击面前也是脆弱的。尝试以下策略来强化你的密码登录。 + +- 使用一个密码生成工具,例如 pwgen。pwgen 有几个选项,最有用的就是密码长度的选项(例如,`pwgen 12` 产生一个12位字符的密码) +- 不要重复使用密码。忽略所有那些不要写下你的密码的建议,然后将你的所有登录信息都记在一个本子上。如果你不相信我的建议,那总可以相信安全权威 [Bruce Schneier][1] 吧。如果你足够细心,没有人能够发现你的笔记本,那么这样能够不受到网络上的那些攻击。 +- 你可以为你的登录记事本增加一些额外的保护措施,例如用字符替换或者增加新的字符来掩盖笔记本上的登录密码。使用一个简单而且好记的规则,比如说给你的密码增加两个额外的随机字符,或者使用单个简单的字符替换,例如 `#` 替换成 `*`。 +- 为你的 SSH 服务开启一个非默认的监听端口。是的,这是很老套的建议,但是它确实很有效。检查你的登录;很有可能 22 端口是被普遍攻击的端口,其他端口则很少被攻击。 +- 使用 [Fail2ban][2] 来动态保护你的服务器,是服务器免于被暴力攻击。 +- 使用不常用的用户名。绝不能让 root 可以远程登录,并避免用户名为“admin”。 + +### 2. 解决 `Too Many Authentication Failures` 报错 + +当我的 ssh 登录失败,并显示“Too many authentication failures for carla”的报错信息时,我很难过。我知道我应该不介意,但是这报错确实很碍眼。而且,正如我聪慧的奶奶曾经说过,伤痛之感并不能解决问题。解决办法就是在你的(客户端的) `~/.ssh/config` 文件设置强制密码登录。如果这个文件不存在,首先创个 `~/.ssh/` 目录。 + +``` +$ mkdir ~/.ssh +$ chmod 700 ~/.ssh +``` +然后在一个文本编辑器创建 `~/.ssh/confg` 文件,输入以下行,使用你自己的远程域名替换 HostName。 + +``` +HostName remote.site.com +PubkeyAuthentication=no +``` + +(LCTT 译注:这种错误发生在你使用一台 Linux 机器使用 ssh 登录另外一台服务器时,你的 .ssh 目录中存储了过多的私钥文件,而 ssh 客户端在你没有指定 -i 选项时,会默认逐一尝试使用这些私钥来登录远程服务器后才会提示密码登录,如果这些私钥并不能匹配远程主机,显然会触发这样的报错,甚至拒绝连接。因此本条是通过禁用本地私钥的方式来强制使用密码登录——显然这并不可取,如果你确实要避免用私钥登录,那你应该用 `-o PubkeyAuthentication=no` 选项登录。显然这条和下两条是互相矛盾的,所以请无视本条即可。) + +### 3. 使用公钥认证 + +公钥认证比密码登录安全多了,因为它不受暴力密码攻击的影响,但是并不方便因为它依赖于 RSA 密钥对。首先,你要创建一个公钥/私钥对。下一步,私钥放于你的客户端电脑,并且复制公钥到你想登录的远程服务器。你只能从拥有私钥的电脑登录才能登录到远程服务器。你的私钥就和你的家门钥匙一样敏感;任何人获取到了私钥就可以获取你的账号。你可以给你的私钥加上密码来增加一些强化保护规则。 + +使用 RSA 密钥对管理多个用户是一种好的方法。当一个用户离开了,只要从服务器删了他的公钥就能取消他的登录。 + +以下例子创建一个新的 3072 位长度的密钥对,它比默认的 2048 位更安全,而且为它起一个独一无二的名字,这样你就可以知道它属于哪个服务器。 + +``` +$ ssh-keygen -t rsa -b 3072 -f id_mailserver +``` + +以下创建两个新的密钥, `id_mailserver` 和 `id_mailserver.pub`,`id_mailserver` 是你的私钥--不要传播它!现在用 `ssh-copy-id` 命令安全地复制你的公钥到你的远程服务器。你必须确保在远程服务器上有可用的 SSH 登录方式。 + +``` +$ ssh-copy-id -i id_rsa.pub user@remoteserver + +/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed +user@remoteserver's password: + +Number of key(s) added: 1 + +Now try logging into the machine, with: "ssh 'user@remoteserver'" +and check to make sure that only the key(s) you wanted were added. +``` + +`ssh-copy-id` 会确保你不会无意间复制了你的私钥。从上述输出中复制登录命令,记得带上其中的单引号,以测试你的新的密钥登录。 + +``` +$ ssh 'user@remoteserver' +``` + +它将用你的新密钥登录,如果你为你的私钥设置了密码,它会提示你输入。 + +### 4. 取消密码登录 + +一旦你已经测试并且验证了你的公钥可以登录,就可以取消密码登录,这样你的远程服务器就不会被暴力密码攻击。如下设置**你的远程服务器**的 `/etc/sshd_config` 文件。 + +``` +PasswordAuthentication no +``` + +然后重启服务器上的 SSH 守护进程。 + +### 5. 设置别名 -- 这很快捷而且很有 B 格 + +你可以为你的远程登录设置常用的别名,来替代登录时输入的命令,例如 `ssh -u username -p 2222 remote.site.with.long-name`。你可以使用 `ssh remote1`。你的客户端机器上的 `~/.ssh/config` 文件可以参照如下设置 + +``` +Host remote1 +HostName remote.site.with.long-name +Port 2222 +User username +PubkeyAuthentication no +``` + +如果你正在使用公钥登录,可以参照这个: + +``` +Host remote1 +HostName remote.site.with.long-name +Port 2222 +User username +IdentityFile ~/.ssh/id_remoteserver +``` + +[OpenSSH 文档][3] 很长而且详细,但是当你掌握了基础的 SSH 使用规则之后,你会发现它非常的有用,而且包含很多可以通过 OpenSSH 来实现的炫酷效果。 + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/learn/5-ssh-hardening-tips + +作者:[CARLA SCHRODER][a] +译者:[maywanting](https://github.com/maywanting) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/cschroder +[1]: https://www.schneier.com/blog/archives/2005/06/write_down_your.html +[2]: http://www.fail2ban.org/wiki/index.php/Main_Page +[3]: http://www.openssh.com/ diff --git a/translated/talk/20160620 5 SSH Hardening Tips.md b/translated/talk/20160620 5 SSH Hardening Tips.md deleted file mode 100644 index a030e13186..0000000000 --- a/translated/talk/20160620 5 SSH Hardening Tips.md +++ /dev/null @@ -1,125 +0,0 @@ -五条强化 SSH 安全的建议 -====================== - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/binary-1188510_1920_0.jpg?itok=ocPCL_9G) ->采用这些简单的建议,使你的 OpenSSH 会话更加安全。 - -> 创造性的零共有 - -当你查看你的 SSH 服务日志,很有可能都充斥着一些不怀好意的尝试性登录。这里有5条一般意义上的建议(和一些个别特殊策略),让你的 OpenSSH 会话更加安全。 - -### 1. 强化密码登录 - -密码登录很方便,因为你可以从任何地方的任何机器上登录。但是他们在暴力攻击面前也是脆弱的。尝试以下策略来强化你的密码登录。 - -- 使用一个密码生成工具,例如 pwgen。pwgen 会有几个选项;最有用的就是密码长度的选项(例如,`pwgen 12` 产生一个12位字符的密码) - -- 不要重复使用一个密码。忽略所有有关不要记下你的密码的建议,然后关于你所有登录信息都记在一本本子上。如果你不相信我的建议,那去相信安全权威 [Bruce Schneier][1]。如果你足够仔细,没有人能够发现你的笔记本,那么这样能够不受到网络上的那些攻击。 - -- 你可以为你的登录记事本增加一些额外的保护措施,例如用字符替换或者增加新的字符来掩盖笔记本上的登录密码。使用一个简单而且好记的规则,比如说给你的密码增加两个额外的随机字符,或者使用单个简单的字符替换,例如 `#` 替换成 `*`。 - -- 为你的 SSH 服务开启一个不是默认的监听端口。是的,这是很老套的建议,但是它确实很有效。检查你的登录;很有可能22端口是被普遍攻击的端口,其他端口则很少被攻击。 - -- 使用 [Fail2ban][2] 来动态保护你的服务器,是服务器免于被暴力攻击 - -- 使用不寻常的用户名。不能让root可以远程登录,并确避免用户名为“admin”。 - -### 2. 解决 `Too Many Authentication Failures` 报错 - -当我的 ssh 登录失败,并显示「Too many authentication failures for carla」的报错信息时,我很难过。我知道我应该不介意,但是这报错确实很碍眼。而且,正如我聪慧的奶奶曾经说过,伤痛之感并不能解决问题。解决办法就是在你的 `~/.ssh/config` 文件设置强制密码登录。如果这个文件不存在,首先创个 `~/.ssh/` 目录。 - -``` -$ mkdir ~/.ssh -$ chmod 700 ~/.ssh -``` - -然后在一个文本编辑器创建 `~/.ssh/confg` 文件,输入以下行,使用你自己的远程域名。 - -``` -HostName remote.site.com -PubkeyAuthentication=no -``` - -### 3. 使用公钥认证 - -公钥认证比密码登录安全多了,因为它不受暴力密码攻击的影响,但是并不方便因为它依赖于 RSA 密钥对。一开始,你创建一对公钥和私钥。下一步,私钥放于你的客户端电脑,并且复制公钥到你想登录的远程服务器。你只能从拥有私钥的电脑登录才能登录到远程服务器。你的私钥就和你的家门钥匙一样敏感;任何人获取到了私钥就可以获取你的账号。你可以给你的私钥加上密码来增加一些强化保护规则。 -使用 RSA 密钥对管理多种多样的用户是一种好的方法。当一个用户离开了,只要从服务器删了他的公钥就能取消他的登录。 - -以下例子创建一个新的 3072 bits 长度的密钥对,它比默认的 2048 bits 更安全,而且为它起一个独一无二的名字,这样你就可以知道它属于哪个服务器。 - -``` -$ ssh-keygen -t rsa -b 3072 -f id_mailserver -``` - -以下创建两个新的密钥, `id_mailserver` 和 `id_mailserver.pub`,`id_mailserver` 是你的私钥--不传播它!现在用 `ssh-copy-id` 命令安全地复制你的公钥到你的远程服务器。你必须确保有运作中的 SSH 登录到远程服务器。 - -``` -$ ssh-copy-id -i id_rsa.pub user@remoteserver - -/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed -user@remoteserver's password: - -Number of key(s) added: 1 - -Now try logging into the machine, with: "ssh 'user@remoteserver'" -and check to make sure that only the key(s) you wanted were added. -``` - -`ssh-copy-id` 确保你不会无意间复制你的私钥。复制你的命令输出样式,带上单引号,这样测试你的新的密钥登录。 - -``` -$ ssh 'user@remoteserver' -``` - -必须用你的新密钥登录,如果你为你的私钥设置了密码,它会提示你。 - -### 4. 取消密码登录 - -一旦你已经测试并且验证了你的公钥登录,取消密码登录,这样你的远程服务器就不会被暴力密码攻击。如下设置你的远程服务器的 `/etc/sshd_config` 文件。 - -``` -PasswordAuthentication no -``` - -然后重启 SSH 守护进程。 - -### 5. 设置别名 -- 这很快捷而且很有 B 格 - -你可以为你的远程登录设置常用的别名,来替代登录时输入的命令,例如 `ssh -u username -p 2222 remote.site.with.long-name`。你可以使用 `ssh remote1`。你的 `~/.ssh/config` 文件可以参照如下设置 - -``` -Host remote1 -HostName remote.site.with.long-name -Port 2222 -User username -PubkeyAuthentication no -``` - -如果你正在使用公钥登录,可以参照这个: - -``` -Host remote1 -HostName remote.site.with.long-name -Port 2222 -User username -IdentityFile ~/.ssh/id_remoteserver -``` - -[OpenSSH 文档][3] 很长而且详细,但是当你掌握了基础的 SSH 使用规则之后,你会发现它非常的有用而且包含很多可以通过 OpenSSH 来实现的炫酷效果。 - - - --------------------------------------------------------------------------------- - -via: https://www.linux.com/learn/5-ssh-hardening-tips - -作者:[CARLA SCHRODER][a] -译者:[maywanting](https://github.com/maywanting) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.linux.com/users/cschroder -[1]: https://www.schneier.com/blog/archives/2005/06/write_down_your.html -[2]: http://www.fail2ban.org/wiki/index.php/Main_Page -[3]: http://www.openssh.com/ From 88db2b4a5f65cde681d3bb0a4e0d13c93c70014e Mon Sep 17 00:00:00 2001 From: VicYu Date: Mon, 15 Aug 2016 16:54:47 +0800 Subject: [PATCH 1432/1469] Vic020 --- sources/tech/ubuntu vs ubuntu on windows.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/ubuntu vs ubuntu on windows.md b/sources/tech/ubuntu vs ubuntu on windows.md index 3074c5fd5b..c3300bf984 100644 --- a/sources/tech/ubuntu vs ubuntu on windows.md +++ b/sources/tech/ubuntu vs ubuntu on windows.md @@ -1,3 +1,5 @@ + Vic020 + Ubuntu 14.04/16.04 vs. Ubuntu Bash On Windows 10 Anniversary Performance =========================== From 41db9c99564d1e1423a661b7f8ec5e564122b352 Mon Sep 17 00:00:00 2001 From: VicYu Date: Mon, 15 Aug 2016 17:21:25 +0800 Subject: [PATCH 1433/1469] complete sources/tech/ubuntu vs ubuntu on windows.md --- sources/tech/ubuntu vs ubuntu on windows.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/sources/tech/ubuntu vs ubuntu on windows.md b/sources/tech/ubuntu vs ubuntu on windows.md index c3300bf984..b8f81c8b8a 100644 --- a/sources/tech/ubuntu vs ubuntu on windows.md +++ b/sources/tech/ubuntu vs ubuntu on windows.md @@ -1,31 +1,30 @@ - Vic020 - -Ubuntu 14.04/16.04 vs. Ubuntu Bash On Windows 10 Anniversary Performance +Ubuntu 14.04/16.04 与Windows 10周年版ubuntu Bash性能对比 =========================== -When Microsoft and Canonical brought [Bash and Ubuntu's user-space to Windows 10][1] earlier this year I ran some preliminary [benchmarks of Ubuntu on Windows 10 versus a native Ubuntu installation][2] on the same hardware. Now that this "Windows Subsystem for Linux" is part of the recent Windows 10 Anniversary Update, I've carried out some fresh benchmarks of Ubuntu running atop Windows 10 compared to Ubuntu running bare metal. +今年初,当Microsoft和Canonical发布[Windows 10 Bash 和Ubuntu用户空间][1],我尝试做了一些初步性能测试 [Ubuntu on Windows 10 对比 原生Ubuntu][2],这次我发布更多的,关于原生纯净Ubuntu和Base on Windows 10的基准对比。 ![](http://www.phoronix.net/image.php?id=windows10-anv-wsl&image=windows_wsl_1_med) -The Windows Subsystem for Linux testing was done with the Windows 10 Anniversary Update plus all available system updates as of last week. The default Ubuntu user-space on Windows 10 continues to be Ubuntu 14.04 LTS, but it worked out to upgrade to Ubuntu 16.04 LTS. So at first I carried out the benchmarks in the 14.04-based stock environment on Windows followed by upgrading the user-space to Ubuntu 16.04 LTS and then repeating the tests. After all of the Windows-based testing was completed, I did clean installs of Ubuntu 14.04.5 and Ubuntu 16.04 LTS on the same system to see how the performance compares. +Windows的Linux子系统测试在上周刚刚完成所有测试,并放出升级。 默认的Ubuntu用户空间还是Ubuntu 14.04,但是已经可以升级到16.04。所以测试首先在14.04测试,完成后将系统升级升级到16.04版本并重复所有测试。完成所有基于Windows的测试后,我删除了Ubuntu14.04.5和Ubuntu 16.04 LTS来对比查看性能 + ![](http://www.phoronix.net/image.php?id=windows10-anv-wsl&image=windows_wsl_2_med) -An Intel Core i5 6600K Skylake system with 16GB of RAM and 256GB Toshiba SSD were used during the testing process. Each OS was left at its default settings/packages during the testing process. +配置为Intel i5 6600K Skylake框架, 16G内存和256东芝ssd, 所有测试都采用原生默认配置。 ![](https://openbenchmarking.org/embed.php?i=1608096-LO-BASHWINDO87&sha=09989b3&p=2) >点击放大查看 -The testing of Ubuntu/Bash on Windows and the native Ubuntu Linux installations were carried out in a fully-automated and reproducible manner using the open-source Phoronix Test Suite benchmarking software. +这次Ubuntu/Bash on Windows和原生Ubuntu对比测试,采用开源软件Phoronix测试套件,完全自动化并可重复测试。 -------------------------------------------------------------------------------- via: https://www.phoronix.com/scan.php?page=article&item=windows10-anv-wsl&num=1 作者:[Michael Larabel][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 91b189d2cfb775c2d8e012fbbb6dae1005908bdc Mon Sep 17 00:00:00 2001 From: VicYu Date: Mon, 15 Aug 2016 17:22:52 +0800 Subject: [PATCH 1434/1469] Translated and moved to translaed folder --- {sources => translated}/tech/ubuntu vs ubuntu on windows.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/ubuntu vs ubuntu on windows.md (100%) diff --git a/sources/tech/ubuntu vs ubuntu on windows.md b/translated/tech/ubuntu vs ubuntu on windows.md similarity index 100% rename from sources/tech/ubuntu vs ubuntu on windows.md rename to translated/tech/ubuntu vs ubuntu on windows.md From bfd9acc3ba0ea1d31e7cb06ecdf952fd320f1a1d Mon Sep 17 00:00:00 2001 From: kokialoves <498497353@qq.com> Date: Mon, 15 Aug 2016 18:16:28 +0800 Subject: [PATCH 1435/1469] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= =?UTF-8?q?=20(#4314)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Delete part 1 - Building a data science portfolio - Machine learning project.md * Create part 1 - Building a data science portfolio - Machine learning project.md --- ...ce portfolio - Machine learning project.md | 97 +++++++++---------- 1 file changed, 46 insertions(+), 51 deletions(-) diff --git a/sources/team_test/part 1 - Building a data science portfolio - Machine learning project.md b/sources/team_test/part 1 - Building a data science portfolio - Machine learning project.md index 439be578ce..9acb80676b 100644 --- a/sources/team_test/part 1 - Building a data science portfolio - Machine learning project.md +++ b/sources/team_test/part 1 - Building a data science portfolio - Machine learning project.md @@ -1,84 +1,79 @@ -+@noobfish translating since Aug 2nd,2016. -+ -+ +>这是这个系列的第三次发布关于如何建立科学的投资数据. 如果你喜欢这个系列并且想继续关注, 你可以在订阅页面的底部找到链接[subscribe at the bottom of the page][1]. ->This is the third in a series of posts on how to build a Data Science Portfolio. If you like this and want to know when the next post in the series is released, you can [subscribe at the bottom of the page][1]. +数据科学公司越来越关注投资组合问题. 这其中的一个原因是,投资组合是最好的判断人们生活技能的方法. 好消息是投资组合是完全在你的控制之下的. 只要你做些投资方面的工作,就可以做出很棒的投资组合. -Data science companies are increasingly looking at portfolios when making hiring decisions. One of the reasons for this is that a portfolio is the best way to judge someone’s real-world skills. The good news for you is that a portfolio is entirely within your control. If you put some work in, you can make a great portfolio that companies are impressed by. +高质量投资组合的第一步就是知道需要什么技能. 客户想要将这些初级技能应用到数据科学, 因此这些投资技能显示如下: -The first step in making a high-quality portfolio is to know what skills to demonstrate. The primary skills that companies want in data scientists, and thus the primary skills they want a portfolio to demonstrate, are: +- 沟通能力 +- 协作能力 +- 技术能力 +- 数据推理能力 +- 主动性 -- Ability to communicate -- Ability to collaborate with others -- Technical competence -- Ability to reason about data -- Motivation and ability to take initiative +任何好的投资组合都由多个能力组成,其中必然包含以上一到两点. 这里我们主要讲第三点如何做好科学的数据投资组合. 在这一节, 我们主要讲第二项以及如何创建一个端对端的机器学习项目. 在最后, 在最后我们将拥有一个项目它将显示你的能力和技术水平. [Here’s][2]如果你想看一下这里有一个完整的例子. -Any good portfolio will be composed of multiple projects, each of which may demonstrate 1-2 of the above points. This is the third post in a series that will cover how to make a well-rounded data science portfolio. In this post, we’ll cover how to make the second project in your portfolio, and how to build an end to end machine learning project. At the end, you’ll have a project that shows your ability to reason about data, and your technical competence. [Here’s][2] the completed project if you want to take a look. +### 一个端到端的项目 -### An end to end project +作为一个数据科学家, 有时候你会拿到一个数据集并被问到是 [如何产生的][3]. 在这个时候, 交流是非常重要的, 走一遍流程. 用用Jupyter notebook, 看一看以前的例子,这对你非常有帮助. 在这里你能找到一些可以用的报告或者文档. -As a data scientist, there are times when you’ll be asked to take a dataset and figure out how to [tell a story with it][3]. In times like this, it’s important to communicate very well, and walk through your process. Tools like Jupyter notebook, which we used in a previous post, are very good at helping you do this. The expectation here is that the deliverable is a presentation or document summarizing your findings. +不管怎样, 有时候你会被要求创建一个具有操作价值的项目. 一个直接影响公司业务的项目, 不止一次的, 许多人用的项目. 这个任务可能像这样 “创建一个算法来预测波动率”或者 “创建一个模型来自动标签我们的文章”. 在这种情况下, 技术能力比说评书更重要. 你必须能够创建一个数据集, 并且理解它, 然后创建脚本处理该数据. 还有很重要的脚本要运行的很快, 占用系统资源很小. 它可能要运行很多次, 脚本的可使用性也很重要,并不仅仅是一个演示版. 可使用性是指整合操作流程, 因为他很有可能是面向用户的. -However, there are other times when you’ll be asked to create a project that has operational value. A project with operational value directly impacts the day-to-day operations of a company, and will be used more than once, and often by multiple people. A task like this might be “create an algorithm to forecast our churn rate”, or “create a model that can automatically tag our articles”. In cases like this, storytelling is less important than technical competence. You need to be able to take a dataset, understand it, then create a set of scripts that can process that data. It’s often important that these scripts run quickly, and use minimal system resources like memory. It’s very common that these scripts will be run several times, so the deliverable becomes the scripts themselves, not a presentation. The deliverable is often integrated into operational flows, and may even be user-facing. +端对端项目的主要组成部分: -The main components of building an end to end project are: +- 理解背景 +- 浏览数据并找出细微差别 +- 创建结构化项目, 那样比较容易整合操作流程 +- 运行速度快占用系统资源小的代码 +- 写好文档以便其他人用 -- Understanding the context -- Exploring the data and figuring out the nuances -- Creating a well-structured project, so its easy to integrate into operational flows -- Writing high-performance code that runs quickly and uses minimal system resources -- Documenting the installation and usage of your code well, so others can use it - -In order to effectively create a project of this kind, we’ll need to work with multiple files. Using a text editor like [Atom][4], or an IDE like [PyCharm][5] is highly recommended. These tools will allow you to jump between files, and edit files of different types, like markdown files, Python files, and csv files. Structuring your project so it’s easy to version control and upload to collaborative coding tools like [Github][6] is also useful. +为类有效的创建这种类型的项目, 我们可能需要处理多个文件. 强烈推荐使用 [Atom][4]或者[PyCharm][5] . 这些工具允许你在文件间跳转, 编辑不同类型的文件, 例如 markdown 文件, Python 文件, 和csv 文件. 结构化你的项目还利于版本控制 [Github][6] 也很有用. ![](https://www.dataquest.io/blog/images/end_to_end/github.png) ->This project on Github. +>Github上的这个项目. -We’ll use our editing tools along with libraries like [Pandas][7] and [scikit-learn][8] in this post. We’ll make extensive use of Pandas [DataFrames][9], which make it easy to read in and work with tabular data in Python. +在这一节中我们将使用 [Pandas][7] 和 [scikit-learn][8]扩展包 . 我们还将用到Pandas [DataFrames][9], 它使得python读取和处理表格数据更加方便. -### Finding good datasets +### 找到好的数据集 -A good dataset for an end to end portfolio project can be hard to find. [The dataset][10] needs to be sufficiently large that memory and performance constraints come into play. It also needs to potentially be operationally useful. For instance, this dataset, which contains data on the admission criteria, graduation rates, and graduate future earnings for US colleges would be a great dataset to use to tell a story. However, as you think about the dataset, it becomes clear that there isn’t enough nuance to build a good end to end project with it. For example, you could tell someone their potential future earnings if they went to a specific college, but that would be a quick lookup without enough nuance to demonstrate technical competence. You could also figure out if colleges with higher admissions standards tend to have graduates who earn more, but that would be more storytelling than operational. +找到一个好的端到端投资项目数据集很难. [The dataset][10]数据集需要足够大但是内存和性能限制了它. 它还需要实际有用的. 例如, 这个数据集, 它包含有美国院校的录取标准, 毕业率以及毕业以后的收入是个很好的数据集了. 不管怎样, 不管你如何想这个数据, 很显然它不适合创建端到端的项目. 比如, 你能告诉人们他们去了这些大学以后的未来收益, 但是却没有足够的细微差别. 你还能找出院校招生标准收入更高, 但是却没有告诉你如何实际操作. -These memory and performance constraints tend to come into play when you have more than a gigabyte of data, and when you have some nuance to what you want to predict, which involves running algorithms over the dataset. +这里还有内存和性能约束的问题比如你有几千兆的数据或者有一些细微差别需要你去预测或者运行什么样的算法数据集等. -A good operational dataset enables you to build a set of scripts that transform the data, and answer dynamic questions. A good example would be a dataset of stock prices. You would be able to predict the prices for the next day, and keep feeding new data to the algorithm as the markets closed. This would enable you to make trades, and potentially even profit. This wouldn’t be telling a story – it would be adding direct value. +一个好的数据集包括你可以动态的转换数组, 并且回答动态的问题. 一个很好的例子是股票价格数据集. 你可以预测明天的价格, 持续的添加数据在算法中. 它将有助于你预测利润. 这不是讲故事这是真实的. -Some good places to find datasets like this are: +一些找到数据集的好地方: -- [/r/datasets][11] – a subreddit that has hundreds of interesting datasets. -- [Google Public Datasets][12] – public datasets available through Google BigQuery. -- [Awesome datasets][13] – a list of datasets, hosted on Github. +- [/r/datasets][11] – subreddit(Reddit是国外一个社交新闻站点,subreddit指该论坛下的各不同板块). +- [Google Public Datasets][12] – 通过Google BigQuery发布的可用数据集. +- [Awesome datasets][13] – Github上的数据集. -As you look through these datasets, think about what questions someone might want answered with the dataset, and think if those questions are one-time (“how did housing prices correlate with the S&P 500?”), or ongoing (“can you predict the stock market?”). The key here is to find questions that are ongoing, and require the same code to be run multiple times with different inputs (different data). +当你查看这些数据集, 想一下人们想要在这些数据集中得到什么答案, 哪怕这些问题只想过一次 (“放假是如何S&P 500关联的?”), 或者更进一步(“你能预测股市吗?”). 这里的关键是更进一步找出问题, 并且多次运行不同的数据相同的代码. -For the purposes of this post, we’ll look at [Fannie Mae Loan Data][14]. Fannie Mae is a government sponsored enterprise in the US that buys mortgage loans from other lenders. It then bundles these loans up into mortgage-backed securities and resells them. This enables lenders to make more mortgage loans, and creates more liquidity in the market. This theoretically leads to more homeownership, and better loan terms. From a borrowers perspective, things stay largely the same, though. +为了这个目标, 我们来看一下[Fannie Mae 贷款数据][14]. Fannie Mae 是一家政府赞助的企业抵押贷款公司它从其他银行购买按揭贷款. 然后捆绑这些贷款为抵押贷款来倒卖证券. 这使得贷款机构可以提供更多的抵押贷款, 在市场上创造更多的流动性. 这在理论上会导致更多的住房和更好的贷款条件. 从借款人的角度来说,他们大体上差不多, 话虽这样说. -Fannie Mae releases two types of data – data on loans it acquires, and data on how those loans perform over time. In the ideal case, someone borrows money from a lender, then repays the loan until the balance is zero. However, some borrowers miss multiple payments, which can cause foreclosure. Foreclosure is when the house is seized by the bank because mortgage payments cannot be made. Fannie Mae tracks which loans have missed payments on them, and which loans needed to be foreclosed on. This data is published quarterly, and lags the current date by 1 year. As of this writing, the most recent dataset that’s available is from the first quarter of 2015. +Fannie Mae 发布了两种类型的数据 – 它获得的贷款, 随着时间的推移这些贷款是否被偿还.在理想的情况下, 有人向贷款人借钱, 然后还清贷款. 不管怎样, 有些人没还的起钱, 丧失了抵押品赎回权. Foreclosure 是说没钱还了被银行把房子给回收了. Fannie Mae 追踪谁没还钱, 并且需要收回房屋抵押权. 每个季度会发布此数据, 并滞后一年. 当前可用是2015年第一季度数据. -Acquisition data, which is published when the loan is acquired by Fannie Mae, contains information on the borrower, including credit score, and information on their loan and home. Performance data, which is published every quarter after the loan is acquired, contains information on the payments being made by the borrower, and the foreclosure status, if any. A loan that is acquired may have dozens of rows in the performance data. A good way to think of this is that the acquisition data tells you that Fannie Mae now controls the loan, and the performance data contains a series of status updates on the loan. One of the status updates may tell us that the loan was foreclosed on during a certain quarter. +采集数据是由Fannie Mae发布的贷款数据, 它包含借款人的信息, 信用评分, 和他们的家庭贷款信息. 性能数据, 贷款回收后的每一个季度公布, 包含借贷人所支付款项信息和丧失抵押品赎回状态, 收回贷款的性能数据可能有十几行.一个很好的思路是这样的采集数据告诉你Fannie Mae所控制的贷款, 性能数据包含几个属性来更新贷款. 其中一个属性告诉我们每个季度的贷款赎回权. ![](https://www.dataquest.io/blog/images/end_to_end/foreclosure.jpg) ->A foreclosed home being sold. +>一个没有及时还贷的房子就这样的被卖了. -### Picking an angle +### 选择一个角度 -There are a few directions we could go in with the Fannie Mae dataset. We could: +这里有几个方向我们可以去分析 Fannie Mae 数据集. 我们可以: -- Try to predict the sale price of a house after it’s foreclosed on. -- Predict the payment history of a borrower. -- Figure out a score for each loan at acquisition time. +- 预测房屋的销售价格. +- 预测借款人还款历史. +- 在收购时为每一笔贷款打分. -The important thing is to stick to a single angle. Trying to focus on too many things at once will make it hard to make an effective project. It’s also important to pick an angle that has sufficient nuance. Here are examples of angles without much nuance: +最重要的事情是坚持单一的角度. 关注太多的事情很难做出效果. 选择一个有着足够细节的角度也很重要. 下面的理解就没有太多差别: -- Figuring out which banks sold loans to Fannie Mae that were foreclosed on the most. -- Figuring out trends in borrower credit scores. -- Exploring which types of homes are foreclosed on most often. -- Exploring the relationship between loan amounts and foreclosure sale prices +- 找出哪些银行将贷款出售给Fannie Mae. +- 计算贷款人的信用评分趋势. +- 搜索哪些类型的家庭没有偿还贷款的能力. +- 搜索贷款金额和抵押品价格之间的关系 -All of the above angles are interesting, and would be great if we were focused on storytelling, but aren’t great fits for an operational project. - -With the Fannie Mae dataset, we’ll try to predict whether a loan will be foreclosed on in the future by only using information that was available when the loan was acquired. In effect, we’ll create a “score” for any mortgage that will tell us if Fannie Mae should buy it or not. This will give us a nice foundation to build on, and will be a great portfolio piece. +上面的想法非常有趣, 它会告诉我们很多有意思的事情, 但是不是一个很适合操作的项目。 +在Fannie Mae数据集中, 我们将预测贷款是否能被偿还. 实际上, 我们将建立一个抵押贷款的分数来告诉 Fannie Mae买还是不买. 这将给我提供很好的基础. From 7dda4e1fff6207b0fe7cc3e3cbf300df3d7709b6 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 15 Aug 2016 23:02:36 +0800 Subject: [PATCH 1436/1469] =?UTF-8?q?PUB:20160406=20Let=E2=80=99s=20Build?= =?UTF-8?q?=20A=20Web=20Server.=20Part=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @StdioA --- ...160406 Let’s Build A Web Server. Part 2.md | 138 +++++++++--------- 1 file changed, 72 insertions(+), 66 deletions(-) rename {translated/tech => published}/20160406 Let’s Build A Web Server. Part 2.md (64%) diff --git a/translated/tech/20160406 Let’s Build A Web Server. Part 2.md b/published/20160406 Let’s Build A Web Server. Part 2.md similarity index 64% rename from translated/tech/20160406 Let’s Build A Web Server. Part 2.md rename to published/20160406 Let’s Build A Web Server. Part 2.md index 2bbf783c51..38c09e9915 100644 --- a/translated/tech/20160406 Let’s Build A Web Server. Part 2.md +++ b/published/20160406 Let’s Build A Web Server. Part 2.md @@ -1,9 +1,9 @@ 搭个 Web 服务器(二) =================================== -在第一部分中,我提出了一个问题:“你要如何在不对程序做任何改动的情况下,在你刚刚搭建起来的 Web 服务器上适配 Django, Flask 或 Pyramid 应用呢?”我们可以从这一篇中找到答案。 +在[第一部分][1]中,我提出了一个问题:“如何在你刚刚搭建起来的 Web 服务器上适配 Django, Flask 或 Pyramid 应用,而不用单独对 Web 服务器做做出改动以适应各种不同的 Web 框架呢?”我们可以从这一篇中找到答案。 -曾几何时,你对 Python Web 框架种类作出的选择会对可用的 Web 服务器类型造成限制,反之亦然。如果框架及服务器在设计层面可以一起工作(相互适配),那么一切正常: +曾几何时,你所选择的 Python Web 框架会限制你所可选择的 Web 服务器,反之亦然。如果某个框架及服务器设计用来协同工作的,那么一切正常: ![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_before_wsgi.png) @@ -13,22 +13,22 @@ 基本上,你需要选择那些能够一起工作的框架和服务器,而不能选择你想用的那些。 -所以,你该如何确保在不对代码做任何更改的情况下,让你的 Web 服务器和多个不同的 Web 框架一同工作呢?这个问题的答案,就是 Python Web 服务器网关接口(缩写为 WSGI,念做“wizgy”)。 +所以,你该如何确保在不对 Web 服务器或框架的代码做任何更改的情况下,让你的 Web 服务器和多个不同的 Web 框架一同工作呢?这个问题的答案,就是 Python Web 服务器网关接口(Web Server Gateway Interface )(缩写为 [WSGI][2],念做“wizgy”)。 ![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_wsgi_idea.png) -WSGI 允许开发者互不干扰地选择 Web 框架及 Web 服务器的类型。现在,你可以真正将 Web 服务器及框架任意搭配,然后选出你最中意的那对组合。比如,你可以使用 Django,Flask 或者 Pyramid,与 Gunicorn,Nginx/uWSGI 或 Waitress 进行结合。感谢 WSGI 同时对服务器与框架的支持,我们可以真正随意选择它们的搭配了。 +WSGI 允许开发者互不干扰地选择 Web 框架及 Web 服务器的类型。现在,你可以真正将 Web 服务器及框架任意搭配,然后选出你最中意的那对组合。比如,你可以使用 [Django][3],[Flask][4] 或者 [Pyramid][5],与 [Gunicorn][6],[Nginx/uWSGI][7] 或 [Waitress][8] 进行结合。感谢 WSGI 同时对服务器与框架的支持,我们可以真正随意选择它们的搭配了。 ![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_wsgi_interop.png) 所以,WSGI 就是我在第一部分中提出,又在本文开头重复了一遍的那个问题的答案。你的 Web 服务器必须实现 WSGI 接口的服务器部分,而现代的 Python Web 框架均已实现了 WSGI 接口的框架部分,这使得你可以直接在 Web 服务器中使用任意框架,而不需要更改任何服务器代码,以对特定的 Web 框架实现兼容。 -现在,你一个知道 Web 服务器及 Web 框架对 WSGI 的支持使得你可以选择最合适的一对来使用,而且它对服务器和框架的开发者依然有益,因为他们只需专注于他们擅长的部分来进行开发,而不需要触及另一部分的代码。其它语言也拥有类似的接口,比如:Java 拥有 Servlet API,而 Ruby 拥有 Rack. +现在,你已经知道 Web 服务器及 Web 框架对 WSGI 的支持使得你可以选择最合适的一对来使用,而且它也有利于服务器和框架的开发者,这样他们只需专注于其擅长的部分来进行开发,而不需要触及另一部分的代码。其它语言也拥有类似的接口,比如:Java 拥有 Servlet API,而 Ruby 拥有 Rack。 -这些理论都不错,但是我打赌你在说:“给我看代码!” 那好,我们来看看下面这个很小的 WSGI 服务器实现: +这些理论都不错,但是我打赌你在说:“Show me the code!” 那好,我们来看看下面这个很小的 WSGI 服务器实现: ``` -# 使用 Python 2.7.9,在 Linux 及 Mac OS X 下测试通过 +### 使用 Python 2.7.9,在 Linux 及 Mac OS X 下测试通过 import socket import StringIO import sys @@ -41,22 +41,22 @@ class WSGIServer(object): request_queue_size = 1 def __init__(self, server_address): - # Create a listening socket + ### 创建一个监听的套接字 self.listen_socket = listen_socket = socket.socket( self.address_family, self.socket_type ) - # 允许复用同一地址 + ### 允许复用同一地址 listen_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) - # 绑定地址 + ### 绑定地址 listen_socket.bind(server_address) - # 激活套接字 + ### 激活套接字 listen_socket.listen(self.request_queue_size) - # 获取主机名称及端口 + ### 获取主机的名称及端口 host, port = self.listen_socket.getsockname()[:2] self.server_name = socket.getfqdn(host) self.server_port = port - # 由 Web 框架/应用设定的响应头部字段 + ### 返回由 Web 框架/应用设定的响应头部字段 self.headers_set = [] def set_app(self, application): @@ -65,14 +65,14 @@ class WSGIServer(object): def serve_forever(self): listen_socket = self.listen_socket while True: - # 获取新的客户端连接 + ### 获取新的客户端连接 self.client_connection, client_address = listen_socket.accept() - # 处理一条请求后关闭连接,然后循环等待另一个连接建立 + ### 处理一条请求后关闭连接,然后循环等待另一个连接建立 self.handle_one_request() def handle_one_request(self): self.request_data = request_data = self.client_connection.recv(1024) - # 以 'curl -v' 的风格输出格式化请求数据 + ### 以 'curl -v' 的风格输出格式化请求数据 print(''.join( '< {line}\n'.format(line=line) for line in request_data.splitlines() @@ -80,20 +80,20 @@ class WSGIServer(object): self.parse_request(request_data) - # 根据请求数据构建环境字典 + ### 根据请求数据构建环境变量字典 env = self.get_environ() - # 此时需要调用 Web 应用来获取结果, - # 取回的结果将成为 HTTP 响应体 + ### 此时需要调用 Web 应用来获取结果, + ### 取回的结果将成为 HTTP 响应体 result = self.application(env, self.start_response) - # 构造一个响应,回送至客户端 + ### 构造一个响应,回送至客户端 self.finish_response(result) def parse_request(self, text): request_line = text.splitlines()[0] request_line = request_line.rstrip('\r\n') - # 将请求行分开成组 + ### 将请求行分成几个部分 (self.request_method, # GET self.path, # /hello self.request_version # HTTP/1.1 @@ -101,10 +101,10 @@ class WSGIServer(object): def get_environ(self): env = {} - # 以下代码段没有遵循 PEP8 规则,但它这样排版,是为了通过强调 - # 所需变量及它们的值,来达到其展示目的。 - # - # WSGI 必需变量 + ### 以下代码段没有遵循 PEP8 规则,但这样排版,是为了通过强调 + ### 所需变量及它们的值,来达到其展示目的。 + ### + ### WSGI 必需变量 env['wsgi.version'] = (1, 0) env['wsgi.url_scheme'] = 'http' env['wsgi.input'] = StringIO.StringIO(self.request_data) @@ -112,7 +112,7 @@ class WSGIServer(object): env['wsgi.multithread'] = False env['wsgi.multiprocess'] = False env['wsgi.run_once'] = False - # CGI 必需变量 + ### CGI 必需变量 env['REQUEST_METHOD'] = self.request_method # GET env['PATH_INFO'] = self.path # /hello env['SERVER_NAME'] = self.server_name # localhost @@ -120,16 +120,16 @@ class WSGIServer(object): return env def start_response(self, status, response_headers, exc_info=None): - # 添加必要的服务器头部字段 + ### 添加必要的服务器头部字段 server_headers = [ ('Date', 'Tue, 31 Mar 2015 12:54:48 GMT'), ('Server', 'WSGIServer 0.2'), ] self.headers_set = [status, response_headers + server_headers] - # 为了遵循 WSGI 协议,start_response 函数必须返回一个 'write' - # 可调用对象(返回值.write 可以作为函数调用)。为了简便,我们 - # 在这里无视这个细节。 - # return self.finish_response + ### 为了遵循 WSGI 协议,start_response 函数必须返回一个 'write' + ### 可调用对象(返回值.write 可以作为函数调用)。为了简便,我们 + ### 在这里无视这个细节。 + ### return self.finish_response def finish_response(self, result): try: @@ -140,7 +140,7 @@ class WSGIServer(object): response += '\r\n' for data in result: response += data - # 以 'curl -v' 的风格输出格式化请求数据 + ### 以 'curl -v' 的风格输出格式化请求数据 print(''.join( '> {line}\n'.format(line=line) for line in response.splitlines() @@ -149,16 +149,13 @@ class WSGIServer(object): finally: self.client_connection.close() - SERVER_ADDRESS = (HOST, PORT) = '', 8888 - def make_server(server_address, application): server = WSGIServer(server_address) server.set_app(application) return server - if __name__ == '__main__': if len(sys.argv) < 2: sys.exit('Provide a WSGI application object as module:callable') @@ -173,14 +170,14 @@ if __name__ == '__main__': 当然,这段代码要比第一部分的服务器代码长不少,但它仍然很短(只有不到 150 行),你可以轻松理解它,而不需要深究细节。上面的服务器代码还可以做更多——它可以用来运行一些你喜欢的框架写出的 Web 应用,可以是 Pyramid,Flask,Django 或其它 Python WSGI 框架。 -不相信吗?自己来试试看吧。把以上的代码保存为 `webserver2.py`,或直接从 Github 上下载它。如果你打算不加任何参数而直接运行它,它会抱怨一句,然后退出。 +不相信吗?自己来试试看吧。把以上的代码保存为 `webserver2.py`,或直接从 [Github][9] 上下载它。如果你打算不加任何参数而直接运行它,它会抱怨一句,然后退出。 ``` $ python webserver2.py Provide a WSGI application object as module:callable ``` -它想做的其实是为你的 Web 应用服务,而这才是重头戏。为了运行这个服务器,你只需要安装 Python。不过,如果你希望运行 Pyramid,Flask 或 Django 应用,你还需要先安装那些框架。那我们把这三个都装上吧。我推荐的安装方式是通过 `virtualenv` 安装。按照以下几步来做,你就可以创建并激活一个虚拟环境,并在其中安装以上三个 Web 框架。 +它想做的其实是为你的 Web 应用服务,而这才是重头戏。为了运行这个服务器,你唯一需要的就是安装好 Python。不过,如果你希望运行 Pyramid,Flask 或 Django 应用,你还需要先安装那些框架。那我们把这三个都装上吧。我推荐的安装方式是通过 `virtualenv` 安装。按照以下几步来做,你就可以创建并激活一个虚拟环境,并在其中安装以上三个 Web 框架。 ``` $ [sudo] pip install virtualenv @@ -195,7 +192,7 @@ $ source bin/activate (lsbaws) $ pip install django ``` -现在,你需要创建一个 Web 应用。我们先从 Pyramid 开始吧。把以下代码保存为 `pyramidapp.py`,并与刚刚的 `webserver2.py` 放置在同一目录,或直接从 Github 下载该文件: +现在,你需要创建一个 Web 应用。我们先从 Pyramid 开始吧。把以下代码保存为 `pyramidapp.py`,并与刚刚的 `webserver2.py` 放置在同一目录,或直接从 [Github][10] 下载该文件: ``` from pyramid.config import Configurator @@ -221,7 +218,7 @@ app = config.make_wsgi_app() WSGIServer: Serving HTTP on port 8888 ... ``` -你刚刚让你的服务器去加载 Python 模块 `pyramidapp` 中的可执行对象 `app`。现在你的服务器可以接收请求,并将它们转发到 Pyramid 应用中了。在浏览器中输入 http://localhost:8888/hello ,敲一下回车,然后看看结果: +你刚刚让你的服务器去加载 Python 模块 `pyramidapp` 中的可执行对象 `app`。现在你的服务器可以接收请求,并将它们转发到你的 Pyramid 应用中了。在浏览器中输入 http://localhost:8888/hello ,敲一下回车,然后看看结果: ![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_browser_pyramid.png) @@ -252,8 +249,7 @@ def hello_world(): app = flask_app.wsgi_app ``` -将以上代码保存为 `flaskapp.py`,或者直接从 Github - 下载,然后输入以下命令运行服务器: +将以上代码保存为 `flaskapp.py`,或者直接从 [Github][11] 下载,然后输入以下命令运行服务器: ``` (lsbaws) $ python webserver2.py flaskapp:app @@ -271,7 +267,7 @@ $ curl -v http://localhost:8888/hello ... ``` -这个服务器能处理 Django 应用吗?试试看吧!不过这个任务可能有点复杂,所以我建议你将整个仓库克隆下来,然后使用 Github 仓库中的 `djangoapp.py` 来完成这个实验。下面是它的源代码,你可以看到它将 Django `helloword` 工程(已使用 `Django` 的 `django-admin.py startproject` 命令创建完毕)添加到了当前的 Python 路径中,然后导入了这个工程的 WSGI 应用。 +这个服务器能处理 Django 应用吗?试试看吧!不过这个任务可能有点复杂,所以我建议你将整个仓库克隆下来,然后使用 [Github][13] 仓库中的 [djangoapp.py][12] 来完成这个实验。这里的源代码主要是将 Django 的 helloworld 工程(已使用 `Django` 的 `django-admin.py startproject` 命令创建完毕)添加到了当前的 Python 路径中,然后导入了这个工程的 WSGI 应用。(LCTT 译注:除了这里展示的代码,还需要一个配合的 helloworld 工程才能工作,代码可以参见 [Github][13] 仓库。) ``` import sys @@ -300,25 +296,25 @@ $ curl -v http://localhost:8888/hello ... ``` -你试过了吗?你确定这个服务器可以与那三个框架搭配工作吗?如果没试,请去试一下。阅读固然重要,但这个系列的内容是重建,这意味着你需要亲自动手干点活。去试一下吧。别担心,我等着你呢。不开玩笑,你真的需要试一下,亲自尝试每一步,并确保它像预期的那样工作。 +你试过了吗?你确定这个服务器可以与那三个框架搭配工作吗?如果没试,请去试一下。阅读固然重要,但这个系列的内容是**重新搭建**,这意味着你需要亲自动手干点活。去试一下吧。别担心,我等着你呢。不开玩笑,你真的需要试一下,亲自尝试每一步,并确保它像预期的那样工作。 好,你已经体验到了 WSGI 的威力:它可以使 Web 服务器及 Web 框架随意搭配。WSGI 在 Python Web 服务器及框架之间提供了一个微型接口。它非常简单,而且在服务器和框架端均可以轻易实现。下面的代码片段展示了 WSGI 接口的服务器及框架端实现: ``` def run_application(application): """服务器端代码。""" - # Web 应用/框架在这里存储 HTTP 状态码以及 HTTP 响应头部, - # 服务器会将这些信息传递给客户端 + ### Web 应用/框架在这里存储 HTTP 状态码以及 HTTP 响应头部, + ### 服务器会将这些信息传递给客户端 headers_set = [] - # 用于存储 WSGI/CGI 环境变量的字典 + ### 用于存储 WSGI/CGI 环境变量的字典 environ = {} def start_response(status, response_headers, exc_info=None): headers_set[:] = [status, response_headers] - # 服务器唤醒可执行变量“application”,获得响应头部 + ### 服务器唤醒可执行变量“application”,获得响应头部 result = application(environ, start_response) - # 服务器组装一个 HTTP 响应,将其传送至客户端 + ### 服务器组装一个 HTTP 响应,将其传送至客户端 … def app(environ, start_response): @@ -331,18 +327,18 @@ run_application(app) 这是它的工作原理: -1. Web 框架提供一个可调用对象 `application` (WSGI 规范没有规定它的实现方式) -2. Web 服务器每次收到来自客户端的 HTTP 请求后,会唤醒可调用对象 `applition`。它会向该对象传递一个包含 WSGI/CGI 变量的字典,以及一个可调用对象 `start_response` -3. Web 框架或应用生成 HTTP 状态码、HTTP 响应头部,然后将它传给 `start_response` 函数,服务器会将其存储起来。同时,Web 框架或应用也会返回 HTTP 响应正文。 +1. Web 框架提供一个可调用对象 `application` (WSGI 规范没有规定它的实现方式)。 +2. Web 服务器每次收到来自客户端的 HTTP 请求后,会唤醒可调用对象 `applition`。它会向该对象传递一个包含 WSGI/CGI 变量的环境变量字典 `environ`,以及一个可调用对象 `start_response`。 +3. Web 框架或应用生成 HTTP 状态码和 HTTP 响应头部,然后将它传给 `start_response` 函数,服务器会将其存储起来。同时,Web 框架或应用也会返回 HTTP 响应正文。 4. 服务器将状态码、响应头部及响应正文组装成一个 HTTP 响应,然后将其传送至客户端(这一步并不在 WSGI 规范中,但从逻辑上讲,这一步应该包含在工作流程之中。所以为了明确这个过程,我把它写了出来) 这是这个接口规范的图形化表达: ![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_wsgi_interface.png) -到现在为止,你已经看过了用 Pyramid, Flask 和 Django 写出的 Web 应用的代码,你也看到了一个 Web 服务器如何用代码来实现另一半(服务器端的) WSGI 规范。你甚至还看到了我们如何在不使用任何框架的情况下,使用一段代码来实现一个最简单的 WSGI Web 应用。 +到现在为止,你已经看过了用 Pyramid、Flask 和 Django 写出的 Web 应用的代码,你也看到了一个 Web 服务器如何用代码来实现另一半(服务器端的) WSGI 规范。你甚至还看到了我们如何在不使用任何框架的情况下,使用一段代码来实现一个最简单的 WSGI Web 应用。 -其实,当你使用上面的框架编写一个 Web 应用时,你只是在较高的层面工作,而不需要直接与 WSGI 打交道。但是我知道你一定也对 WSGI 接口的框架部分,因为你在看这篇文章呀。所以,我们不用 Pyramid, Flask 或 Django,而是自己动手来创造一个最朴素的 WSGI Web 应用(或 Web 框架),然后将它和你的服务器一起运行: +其实,当你使用上面的框架编写一个 Web 应用时,你只是在较高的层面工作,而不需要直接与 WSGI 打交道。但是我知道你一定也对 WSGI 接口的框架部分感兴趣,因为你在看这篇文章呀。所以,我们不用 Pyramid、Flask 或 Django,而是自己动手来创造一个最朴素的 WSGI Web 应用(或 Web 框架),然后将它和你的服务器一起运行: ``` def app(environ, start_response): @@ -356,7 +352,7 @@ def app(environ, start_response): return ['Hello world from a simple WSGI application!\n'] ``` -同样,将上面的代码保存至 `wsgiapp.py` 或直接从 Github 上下载该文件,然后在 Web 服务器上运行这个应用,像这样: +同样,将上面的代码保存为 `wsgiapp.py` 或直接从 [Github][14] 上下载该文件,然后在 Web 服务器上运行这个应用,像这样: ``` (lsbaws) $ python webserver2.py wsgiapp:app @@ -367,13 +363,13 @@ WSGIServer: Serving HTTP on port 8888 ... ![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_browser_simple_wsgi_app.png) -你刚刚在学习如何创建一个 Web 服务器的过程中,自己编写了一个最朴素的 WSGI Web 框架!棒极了! +你刚刚在学习如何创建一个 Web 服务器的过程中自己编写了一个最朴素的 WSGI Web 框架!棒极了! 现在,我们再回来看看服务器传给客户端的那些东西。这是在使用 HTTP 客户端调用你的 Pyramid 应用时,服务器生成的 HTTP 响应内容: ![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_http_response.png) -这个响应和你在本系列第一部分中看到的 HTTP 响应有一部分共同点,但它还多出来了一些内容。比如说,它拥有四个你曾经没见过的 HTTP 头部:`Content-Type`, `Content-Length`, `Date` 以及 `Server`。这些头部内容基本上在每个 Web 服务器返回的响应中都会出现。不过,它们都不是被严格要求出现的。HTTP 请求/响应头部字段的目的,在于它可以向你传递一些关于 HTTP 请求/响应的额外信息。 +这个响应和你在本系列第一部分中看到的 HTTP 响应有一部分共同点,但它还多出来了一些内容。比如说,它拥有四个你曾经没见过的 [HTTP 头部][15]:`Content-Type`, `Content-Length`, `Date` 以及 `Server`。这些头部内容基本上在每个 Web 服务器返回的响应中都会出现。不过,它们都不是被严格要求出现的。这些 HTTP 请求/响应头部字段的目的在于它可以向你传递一些关于 HTTP 请求/响应的额外信息。 既然你对 WSGI 接口了解的更深了一些,那我再来展示一下上面那个 HTTP 响应中的各个部分的信息来源: @@ -381,7 +377,7 @@ WSGIServer: Serving HTTP on port 8888 ... 我现在还没有对上面那个 `environ` 字典做任何解释,不过基本上这个字典必须包含那些被 WSGI 规范事先定义好的 WSGI 及 CGI 变量值。服务器在解析 HTTP 请求时,会从请求中获取这些变量的值。这是 `environ` 字典应该有的样子: -![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_environ.png) +![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_environ.png) Web 框架会利用以上字典中包含的信息,通过字典中的请求路径、请求动作等等来决定使用哪个视图来处理响应、在哪里读取请求正文、在哪里输出错误信息(如果有的话)。 @@ -397,13 +393,13 @@ Web 框架会利用以上字典中包含的信息,通过字典中的请求路 ![](https://ruslanspivak.com/lsbaws-part2/lsbaws_part2_server_summary.png) -这基本上是服务器要做的全部内容了。你现在有了一个可以正常工作的 WSGI 服务器,它可以为使用任何遵循 WSGI 规范的 Web 框架(如 Django, Flask, Pyramid, 还有你刚刚自己写的那个框架)构建出的 Web 应用服务。最棒的部分在于,它可以在不用更改任何服务器代码的情况下,与多个不同的 Web 框架一起工作。真不错。 +这基本上是服务器要做的全部内容了。你现在有了一个可以正常工作的 WSGI 服务器,它可以为使用任何遵循 WSGI 规范的 Web 框架(如 Django、Flask、Pyramid,还有你刚刚自己写的那个框架)构建出的 Web 应用服务。最棒的部分在于,它可以在不用更改任何服务器代码的情况下,与多个不同的 Web 框架一起工作。真不错。 在结束之前,你可以想想这个问题:“你该如何让你的服务器在同一时间处理多个请求呢?” 敬请期待,我会在第三部分向你展示一种解决这个问题的方法。干杯! -顺便,我在撰写一本名为《搭个 Web 服务器:从头开始》的书。这本书讲解了如何从头开始编写一个基本的 Web 服务器,里面包含本文中没有的更多细节。订阅邮件列表,你就可以获取到这本书的最新进展,以及发布日期。 +顺便,我在撰写一本名为《搭个 Web 服务器:从头开始》的书。这本书讲解了如何从头开始编写一个基本的 Web 服务器,里面包含本文中没有的更多细节。[订阅邮件列表][16],你就可以获取到这本书的最新进展,以及发布日期。 -------------------------------------------------------------------------------- @@ -411,14 +407,24 @@ via: https://ruslanspivak.com/lsbaws-part2/ 作者:[Ruslan][a] 译者:[StdioA](https://github.com/StdioA) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://github.com/rspivak/ - - - - - - +[1]: https://linux.cn/article-7662-1.html +[2]: https://www.python.org/dev/peps/pep-0333/ +[3]: https://www.djangoproject.com/ +[4]: http://flask.pocoo.org/ +[5]: http://trypyramid.com/ +[6]: http://gunicorn.org/ +[7]: http://uwsgi-docs.readthedocs.org/ +[8]: http://waitress.readthedocs.org/ +[9]: https://github.com/rspivak/lsbaws/blob/master/part2/webserver2.py +[10]: https://github.com/rspivak/lsbaws/blob/master/part2/pyramidapp.py +[11]: https://github.com/rspivak/lsbaws/blob/master/part2/flaskapp.py +[12]: https://github.com/rspivak/lsbaws/blob/master/part2/flaskapp.py +[13]: https://github.com/rspivak/lsbaws/ +[14]: https://github.com/rspivak/lsbaws/blob/master/part2/wsgiapp.py +[15]: http://en.wikipedia.org/wiki/List_of_HTTP_header_fields +[16]: https://ruslanspivak.com/lsbaws-part2/ \ No newline at end of file From 078175fa5e35af466797e27a496c9424e3124117 Mon Sep 17 00:00:00 2001 From: may Date: Tue, 16 Aug 2016 09:03:48 +0800 Subject: [PATCH 1437/1469] =?UTF-8?q?=E5=86=8D=E6=9D=A5=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=EF=BC=81=20(#4315)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * translating by maywanting * finish translating * translating start * delete the file --- sources/tech/20160809 How to build your own Git server.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160809 How to build your own Git server.md b/sources/tech/20160809 How to build your own Git server.md index ac5b229d96..7f75c33195 100644 --- a/sources/tech/20160809 How to build your own Git server.md +++ b/sources/tech/20160809 How to build your own Git server.md @@ -1,3 +1,5 @@ +translating by maywanting + How to build your own Git server ==================== From c99f1586c608a7e950c90ec6743eca4cf5a42947 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 16 Aug 2016 10:57:43 +0800 Subject: [PATCH 1438/1469] PUB:Part 2 - LXD 2.0--Installing and configuring LXD MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @oska874 @PurlingNayuki 这个系列居然有12篇之多。。 --- ...LXD 2.0--Installing and configuring LXD.md | 43 ++++++++----------- 1 file changed, 19 insertions(+), 24 deletions(-) rename {translated/tech => published}/LXD/Part 2 - LXD 2.0--Installing and configuring LXD.md (78%) diff --git a/translated/tech/LXD/Part 2 - LXD 2.0--Installing and configuring LXD.md b/published/LXD/Part 2 - LXD 2.0--Installing and configuring LXD.md similarity index 78% rename from translated/tech/LXD/Part 2 - LXD 2.0--Installing and configuring LXD.md rename to published/LXD/Part 2 - LXD 2.0--Installing and configuring LXD.md index fe386f3229..a523ffa1e6 100644 --- a/translated/tech/LXD/Part 2 - LXD 2.0--Installing and configuring LXD.md +++ b/published/LXD/Part 2 - LXD 2.0--Installing and configuring LXD.md @@ -1,4 +1,4 @@ -Part 2 - LXD 2.0: 安装与配置 +LXD 2.0 系列(二):安装与配置 ================================================= 这是 LXD 2.0 [系列介绍文章][2]的第二篇。 @@ -11,7 +11,7 @@ Part 2 - LXD 2.0: 安装与配置 #### Ubuntu 标准版 -所有新发布的 LXD 都会在发布几分钟后上传到 Ubuntu 开发版的安装源里。这个安装包然后就会当作种子给全部其他的安装包源,供 Ubuntu 用户使用。 +所有新发布的 LXD 都会在发布几分钟后上传到 Ubuntu 开发版的安装源里。这个安装包然后就会作为 Ubuntu 用户的其他安装包源的种子。 如果使用 Ubuntu 16.04,可以直接安装: @@ -54,7 +54,7 @@ sudo emerge --ask lxd #### 使用源代码安装 -如果你曾经编译过 Go 语言的项目,那么从源代码编译 LXD 并不是十分困难。然而注意,你需要 LXC 的开发头文件。为了运行 LXD, 你的发布版需也要使用比较新的内核(最起码是 3.13)、比较新的 LXC (1.1.4 或更高版本)、LXCFS 以及支持用户子 uid/gid 分配的 shadow。 +如果你曾经编译过 Go 语言的项目,那么从源代码编译 LXD 并不是十分困难。然而注意,你需要 LXC 的开发头文件。为了运行 LXD, 你的发布版需也要使用比较新的内核(最起码是 3.13)、比较新的 LXC (1.1.4 或更高版本)、LXCFS 以及支持用户子 uid/gid 分配的 shadow 文件。 从源代码编译 LXD 的最新教程可以在[上游 README][2]里找到。 @@ -76,13 +76,13 @@ sudo lxd init ### 存储后端 -LXD 提供了许多集中存储后端。在开始使用 LXD 之前,你应该决定将要使用的后端,因为我们不支持在后端之间迁移已经生成的容器。 +LXD 提供了几种存储后端。在开始使用 LXD 之前,你应该决定将要使用的后端,因为我们不支持在后端之间迁移已经生成的容器。 各个[后端特性比较表][3]可以在[这里][3]找到。 #### ZFS -我们的推荐是 ZFS, 因为它能支持 LXD 的全部特性,同时提供最快和最可靠的容器体验。它包括了以容器为单位的磁盘配额,即时快照和恢复,优化了的迁移(发送/接收),以及快速从镜像创建容器的能力。它同时也被认为要比 btrfs 更成熟。 +我们的推荐是 ZFS, 因为它能支持 LXD 的全部特性,同时提供最快和最可靠的容器体验。它包括了以容器为单位的磁盘配额、即时快照和恢复、优化后的迁移(发送/接收),以及快速从镜像创建容器的能力。它同时也被认为要比 btrfs 更成熟。 要和 LXD 一起使用 ZFS ,你需要首先在你的系统上安装 ZFS。 @@ -112,11 +112,11 @@ sudo apt install ubuntu-zfs sudo lxd init ``` -这条命令接下来会向你提问一下一些 ZFS 的配置细节,然后为你配置好 ZFS。 +这条命令接下来会向你提问一些 ZFS 的配置细节,然后为你配置好 ZFS。 #### btrfs -如果 ZFS 不可用,那么 btrfs 可以提供相同级别的集成,但不会合理地报告容器内的磁盘使用情况(虽然配额仍然可用)。 +如果 ZFS 不可用,那么 btrfs 可以提供相同级别的集成,但不能正确地报告容器内的磁盘使用情况(虽然配额仍然可用)。 btrfs 同时拥有很好的嵌套属性,而这是 ZFS 所不具有的。也就是说如果你计划在 LXD 中再使用 LXD,那么 btrfs 就很值得你考虑。 @@ -126,14 +126,13 @@ btrfs 同时拥有很好的嵌套属性,而这是 ZFS 所不具有的。也就 如果 ZFS 和 btrfs 都不是你想要的,你还可以考虑使用 LVM 以获得部分特性。 LXD 会以自动精简配置的方式使用 LVM,为每个镜像和容器创建 LV,如果需要的话也会使用 LVM 的快照功能。 -要配置 LXD 使用 LVM,需要创建一个 LVM VG,然后运行: - +要配置 LXD 使用 LVM,需要创建一个 LVM 卷组,然后运行: ``` lxc config set storage.lvm_vg_name "THE-NAME-OF-YOUR-VG" ``` -默认情况下 LXD 使用 ext4 作为全部 LV 的文件系统。如果你喜欢的话可以改成 XFS: +默认情况下 LXD 使用 ext4 作为全部逻辑卷的文件系统。如果你喜欢的话可以改成 XFS: ``` lxc config set storage.lvm_fstype xfs @@ -151,7 +150,7 @@ LXD 守护进程的完整配置项列表可以在[这里找到][4]。 #### 网络配置 -默认情况下 LXD 不会监听网络。和它通信的唯一办法是通过 `/var/lib/lxd/unix.socket` 使用本地 unix socket 进行通信。 +默认情况下 LXD 不会监听网络。和它通信的唯一办法是通过 `/var/lib/lxd/unix.socket` 使用本地 unix 套接字进行通信。 要让 LXD 监听网络,下面有两个有用的命令: @@ -160,11 +159,11 @@ lxc config set core.https_address [::] lxc config set core.trust_password some-secret-string ``` -第一条命令将 LXD 绑定到 IPv6 地址 “::”,也就是监听机器的所有 IPv6 地址。你可以显式的使用一个特定的 IPv4 或者 IPv6 地址替代默认地址,如果你想绑定 TCP 端口(默认是 8443)的话可以在地址后面添加端口号即可。 +第一条命令将 LXD 绑定到 IPv6 地址 “::”,也就是监听机器的所有 IPv6 地址。你可以显式的使用一个特定的 IPv4 或者 IPv6 地址替代默认地址,如果你想绑定某个 TCP 端口(默认是 8443)的话可以在地址后面添加端口号即可。 -第二条命令设置了密码,用于让远程客户端用来把自己添加到 LXD 可信证书中心。如果已经给主机设置了密码,当添加 LXD 主机时会提示输入密码,LXD 守护进程会保存他们的客户端的证书以确保客户端是可信的,这样就不需要再次输入密码(可以随时设置和取消)。 +第二条命令设置了密码,用于让远程客户端把自己添加到 LXD 可信证书中心。如果已经给主机设置了密码,当添加 LXD 主机时会提示输入密码,LXD 守护进程会保存他们的客户端证书以确保客户端是可信的,这样就不需要再次输入密码(可以随时设置和取消)。 -你也可以选择不设置密码,然后通过给每个客户端发送“client.crt”(来自于 `~/.config/lxc`)文件,然后把它添加到你自己的可信中信来实现人工验证每个新客户端是否可信,可以使用下面的命令: +你也可以选择不设置密码,而是人工验证每个新客户端是否可信——让每个客户端发送“client.crt”(来自于 `~/.config/lxc`)文件,然后把它添加到你自己的可信证书中心: ``` lxc config trust add client.crt @@ -186,7 +185,7 @@ lxc config set core.proxy_ignore_hosts image-server.local #### 镜像管理 -LXD 使用动态镜像缓存。当从远程镜像创建容器的时候,它会自动把镜像下载到本地镜像商店,同时标志为已缓存并记录来源。几天后(默认 10 天)如果某个镜像没有被使用过,那么它就会自动地被删除。每个几小时(默认是 6 小时)LXD 还会检查一下这个镜像是否有新版本,然后更新镜像的本地拷贝。 +LXD 使用动态镜像缓存。当从远程镜像创建容器的时候,它会自动把镜像下载到本地镜像商店,同时标志为已缓存并记录来源。几天后(默认 10 天)如果某个镜像没有被使用过,那么它就会自动地被删除。每隔几小时(默认是 6 小时)LXD 还会检查一下这个镜像是否有新版本,然后更新镜像的本地拷贝。 所有这些都可以通过下面的配置选项进行配置: @@ -196,8 +195,7 @@ lxc config set images.auto_update_interval 24 lxc config set images.auto_update_cached false ``` -这些命令让 LXD 修改了它的默认属性,缓存期替换为 5 天,更新间隔为 24 小时,而且只更新那些标记为自动更新的镜像(lxc 镜像拷贝被标记为 `–auto-update`)而不是 LXD 自动缓存的镜像。 - +这些命令让 LXD 修改了它的默认属性,缓存期替换为 5 天,更新间隔为 24 小时,而且只更新那些标记为自动更新(–auto-update)的镜像(lxc 镜像拷贝被标记为 `–auto-update`)而不是 LXD 自动缓存的镜像。 ### 总结 @@ -205,13 +203,10 @@ lxc config set images.auto_update_cached false ### 额外信息 -LXD 的主站在: - -LXD 的 GitHub 仓库: - -LXD 的邮件列表: - -LXD 的 IRC 频道: #lxcontainers on irc.freenode.net +- LXD 的主站在: +- LXD 的 GitHub 仓库: +- LXD 的邮件列表: +- LXD 的 IRC 频道: #lxcontainers on irc.freenode.net 如果你不想或者不能在你的机器上安装 LXD ,你可以[试试在线版的 LXD][1]。 From 83ef5767f9d23c52c05eebcc47c0345b48f9d0c4 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 16 Aug 2016 17:45:46 +0800 Subject: [PATCH 1439/1469] PUB:20151220 GCC-Inline-Assembly-HOWTO MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @cposture 辛苦了,好长! --- .../20151220 GCC-Inline-Assembly-HOWTO.md | 498 ++++++++++++++ .../20151220 GCC-Inline-Assembly-HOWTO.md | 632 ------------------ 2 files changed, 498 insertions(+), 632 deletions(-) create mode 100644 published/20151220 GCC-Inline-Assembly-HOWTO.md delete mode 100644 translated/tech/20151220 GCC-Inline-Assembly-HOWTO.md diff --git a/published/20151220 GCC-Inline-Assembly-HOWTO.md b/published/20151220 GCC-Inline-Assembly-HOWTO.md new file mode 100644 index 0000000000..e89e7fa256 --- /dev/null +++ b/published/20151220 GCC-Inline-Assembly-HOWTO.md @@ -0,0 +1,498 @@ +* * * + +# GCC 内联汇编 HOWTO + +v0.1, 01 March 2003. +* * * + +_本 HOWTO 文档将讲解 GCC 提供的内联汇编特性的用途和用法。对于阅读这篇文章,这里只有两个前提要求,很明显,就是 x86 汇编语言和 C 语言的基本认识。_ + +* * * + +## 1. 简介 + +### 1.1 版权许可 + +Copyright (C)2003 Sandeep S. + +本文档自由共享;你可以重新发布它,并且/或者在遵循自由软件基金会发布的 GNU 通用公共许可证下修改它;也可以是该许可证的版本 2 或者(按照你的需求)更晚的版本。 + +发布这篇文档是希望它能够帮助别人,但是没有任何担保;甚至不包括可售性和适用于任何特定目的的担保。关于更详细的信息,可以查看 GNU 通用许可证。 + +### 1.2 反馈校正 + +请将反馈和批评一起提交给 [Sandeep.S](mailto:busybox@sancharnet.in) 。我将感谢任何一个指出本文档中错误和不准确之处的人;一被告知,我会马上改正它们。 + +### 1.3 致谢 + +我对提供如此棒的特性的 GNU 人们表示真诚的感谢。感谢 Mr.Pramode C E 所做的所有帮助。感谢在 Govt Engineering College 和 Trichur 的朋友们的精神支持和合作,尤其是 Nisha Kurur 和 Sakeeb S 。 感谢在 Gvot Engineering College 和 Trichur 的老师们的合作。 + +另外,感谢 Phillip , Brennan Underwood 和 colin@nyx.net ;这里的许多东西都厚颜地直接取自他们的工作成果。 + +* * * + +## 2. 概览 + +在这里,我们将学习 GCC 内联汇编。这里内联(inline)表示的是什么呢? + +我们可以要求编译器将一个函数的代码插入到调用者代码中函数被实际调用的地方。这样的函数就是内联函数。这听起来和宏差不多?这两者确实有相似之处。 + +内联函数的优点是什么呢? + +这种内联方法可以减少函数调用开销。同时如果所有实参的值为常量,它们的已知值可以在编译期允许简化,因此并非所有的内联函数代码都需要被包含进去。代码大小的影响是不可预测的,这取决于特定的情况。为了声明一个内联函数,我们必须在函数声明中使用 `inline` 关键字。 + +现在我们正处于一个猜测内联汇编到底是什么的点上。它只不过是一些写为内联函数的汇编程序。在系统编程上,它们方便、快速并且极其有用。我们主要集中学习(GCC)内联汇编函数的基本格式和用法。为了声明内联汇编函数,我们使用 `asm` 关键词。 + +内联汇编之所以重要,主要是因为它可以操作并且使其输出通过 C 变量显示出来。正是因为此能力, "asm" 可以用作汇编指令和包含它的 C 程序之间的接口。 + +* * * + +## 3. GCC 汇编语法 + +Linux上的 GNU C 编译器 GCC ,使用 **AT&T** / **UNIX** 汇编语法。在这里,我们将使用 AT&T 语法 进行汇编编码。如果你对 AT&T 语法不熟悉的话,请不要紧张,我会教你的。AT&T 语法和 Intel 语法的差别很大。我会给出主要的区别。 + +1. 源操作数和目的操作数顺序 + + AT&T 语法的操作数方向和 Intel 语法的刚好相反。在Intel 语法中,第一操作数为目的操作数,第二操作数为源操作数,然而在 AT&T 语法中,第一操作数为源操作数,第二操作数为目的操作数。也就是说, + + Intel 语法中的 `Op-code dst src` 变为 + + AT&T 语法中的 `Op-code src dst`。 + +2. 寄存器命名 + + 寄存器名称有 `%` 前缀,即如果必须使用 `eax`,它应该用作 `%eax`。 + +3. 立即数 + + AT&T 立即数以 `$` 为前缀。静态 "C" 变量也使用 `$` 前缀。在 Intel 语法中,十六进制常量以 `h` 为后缀,然而 AT&T 不使用这种语法,这里我们给常量添加前缀 `0x`。所以,对于十六进制,我们首先看到一个 `$`,然后是 `0x`,最后才是常量。 + +4. 操作数大小 + + 在 AT&T 语法中,存储器操作数的大小取决于操作码名字的最后一个字符。操作码后缀 ’b’ 、’w’、’l’ 分别指明了字节(byte)(8位)、字(word)(16位)、长型(long)(32位)存储器引用。Intel 语法通过给存储器操作数添加 `byte ptr`、 `word ptr` 和 `dword ptr` 前缀来实现这一功能。 + + 因此,Intel的 `mov al, byte ptr foo` 在 AT&T 语法中为 `movb foo, %al`。 + +5. 存储器操作数 + + 在 Intel 语法中,基址寄存器包含在 `[` 和 `]` 中,然而在 AT&T 中,它们变为 `(` 和 `)`。另外,在 Intel 语法中, 间接内存引用为 + + `section:[base + index*scale + disp]`,在 AT&T中变为 `section:disp(base, index, scale)`。 + + 需要牢记的一点是,当一个常量用于 disp 或 scale,不能添加 `$` 前缀。 + +现在我们看到了 Intel 语法和 AT&T 语法之间的一些主要差别。我仅仅写了它们差别的一部分而已。关于更完整的信息,请参考 GNU 汇编文档。现在为了更好地理解,我们可以看一些示例。 + +``` ++------------------------------+------------------------------------+ +| Intel Code | AT&T Code | ++------------------------------+------------------------------------+ +| mov eax,1 | movl $1,%eax | +| mov ebx,0ffh | movl $0xff,%ebx | +| int 80h | int $0x80 | +| mov ebx, eax | movl %eax, %ebx | +| mov eax,[ecx] | movl (%ecx),%eax | +| mov eax,[ebx+3] | movl 3(%ebx),%eax | +| mov eax,[ebx+20h] | movl 0x20(%ebx),%eax | +| add eax,[ebx+ecx*2h] | addl (%ebx,%ecx,0x2),%eax | +| lea eax,[ebx+ecx] | leal (%ebx,%ecx),%eax | +| sub eax,[ebx+ecx*4h-20h] | subl -0x20(%ebx,%ecx,0x4),%eax | ++------------------------------+------------------------------------+ +``` +* * * + +## 4. 基本内联 + +基本内联汇编的格式非常直接了当。它的基本格式为 + +`asm("汇编代码");` + +示例 + +``` +asm("movl %ecx %eax"); /* 将 ecx 寄存器的内容移至 eax */ +__asm__("movb %bh (%eax)"); /* 将 bh 的一个字节数据 移至 eax 寄存器指向的内存 */ +``` + +你可能注意到了这里我使用了 `asm ` 和 `__asm__`。这两者都是有效的。如果关键词 `asm` 和我们程序的一些标识符冲突了,我们可以使用 `__asm__`。如果我们的指令多于一条,我们可以每个一行,并用双引号圈起,同时为每条指令添加 ’\n’ 和 ’\t’ 后缀。这是因为 gcc 将每一条当作字符串发送给 **as**(GAS)(LCTT 译注: GAS 即 GNU 汇编器),并且通过使用换行符/制表符发送正确格式化后的行给汇编器。 + +示例 + +``` +__asm__ ("movl %eax, %ebx\n\t" + "movl $56, %esi\n\t" + "movl %ecx, $label(%edx,%ebx,$4)\n\t" + "movb %ah, (%ebx)"); +``` + +如果在代码中,我们涉及到一些寄存器(即改变其内容),但在没有恢复这些变化的情况下从汇编中返回,这将会导致一些意想不到的事情。这是因为 GCC 并不知道寄存器内容的变化,这会导致问题,特别是当编译器做了某些优化。在没有告知 GCC 的情况下,它将会假设一些寄存器存储了一些值——而我们可能已经改变却没有告知 GCC——它会像什么事都没发生一样继续运行(LCTT 译注:什么事都没发生一样是指GCC不会假设寄存器装入的值是有效的,当退出改变了寄存器值的内联汇编后,寄存器的值不会保存到相应的变量或内存空间)。我们所可以做的是使用那些没有副作用的指令,或者当我们退出时恢复这些寄存器,要不就等着程序崩溃吧。这是为什么我们需要一些扩展功能,扩展汇编给我们提供了那些功能。 + +* * * + +## 5. 扩展汇编 + +在基本内联汇编中,我们只有指令。然而在扩展汇编中,我们可以同时指定操作数。它允许我们指定输入寄存器、输出寄存器以及修饰寄存器列表。GCC 不强制用户必须指定使用的寄存器。我们可以把头疼的事留给 GCC ,这可能可以更好地适应 GCC 的优化。不管怎么说,基本格式为: + +``` +asm ( 汇编程序模板 + : 输出操作数 /* 可选的 */ + : 输入操作数 /* 可选的 */ + : 修饰寄存器列表 /* 可选的 */ + ); +``` + +汇编程序模板由汇编指令组成。每一个操作数由一个操作数约束字符串所描述,其后紧接一个括弧括起的 C 表达式。冒号用于将汇编程序模板和第一个输出操作数分开,另一个(冒号)用于将最后一个输出操作数和第一个输入操作数分开(如果存在的话)。逗号用于分离每一个组内的操作数。总操作数的数目限制在 10 个,或者机器描述中的任何指令格式中的最大操作数数目,以较大者为准。 + +如果没有输出操作数但存在输入操作数,你必须将两个连续的冒号放置于输出操作数原本会放置的地方周围。 + +示例: + +``` +asm ("cld\n\t" + "rep\n\t" + "stosl" + : /* 无输出寄存器 */ + : "c" (count), "a" (fill_value), "D" (dest) + : "%ecx", "%edi" + ); +``` + +现在来看看这段代码是干什么的?以上的内联汇编是将 `fill_value` 值连续 `count` 次拷贝到寄存器 `edi` 所指位置(LCTT 译注:每执行 stosl 一次,寄存器 edi 的值会递增或递减,这取决于是否设置了 direction 标志,因此以上代码实则初始化一个内存块)。 它也告诉 gcc 寄存器 `ecx` 和 `edi` 一直无效(LCTT 译注:原文为 eax ,但代码修饰寄存器列表中为 ecx,因此这可能为作者的纰漏。)。为了更加清晰地说明,让我们再看一个示例。 + +``` +int a=10, b; +asm ("movl %1, %%eax; + movl %%eax, %0;" + :"=r"(b) /* 输出 */ + :"r"(a) /* 输入 */ + :"%eax" /* 修饰寄存器 */ + ); +``` + +这里我们所做的是使用汇编指令使 ’b’ 变量的值等于 ’a’ 变量的值。一些有意思的地方是: + +* "b" 为输出操作数,用 %0 引用,并且 "a" 为输入操作数,用 %1 引用。 +* "r" 为操作数约束。之后我们会更详细地了解约束(字符串)。目前,"r" 告诉 GCC 可以使用任一寄存器存储操作数。输出操作数约束应该有一个约束修饰符 "=" 。这修饰符表明它是一个只读的输出操作数。 +* 寄存器名字以两个 % 为前缀。这有利于 GCC 区分操作数和寄存器。操作数以一个 % 为前缀。 +* 第三个冒号之后的修饰寄存器 %eax 用于告诉 GCC %eax 的值将会在 "asm" 内部被修改,所以 GCC 将不会使用此寄存器存储任何其他值。 + +当 “asm” 执行完毕, "b" 变量会映射到更新的值,因为它被指定为输出操作数。换句话说, “asm” 内 "b" 变量的修改应该会被映射到 “asm” 外部。 + +现在,我们可以更详细地看看每一个域。 + +### 5.1 汇编程序模板 + +汇编程序模板包含了被插入到 C 程序的汇编指令集。其格式为:每条指令用双引号圈起,或者整个指令组用双引号圈起。同时每条指令应以分界符结尾。有效的分界符有换行符(`\n`)和分号(`;`)。`\n` 可以紧随一个制表符(`\t`)。我们应该都明白使用换行符或制表符的原因了吧(LCTT 译注:就是为了排版和分隔)?和 C 表达式对应的操作数使用 %0、%1 ... 等等表示。 + +### 5.2 操作数 + +C 表达式用作 “asm” 内的汇编指令操作数。每个操作数前面是以双引号圈起的操作数约束。对于输出操作数,在引号内还有一个约束修饰符,其后紧随一个用于表示操作数的 C 表达式。即,“操作数约束”(C 表达式)是一个通用格式。对于输出操作数,还有一个额外的修饰符。约束字符串主要用于决定操作数的寻址方式,同时也用于指定使用的寄存器。 + +如果我们使用的操作数多于一个,那么每一个操作数用逗号隔开。 + +在汇编程序模板中,每个操作数用数字引用。编号方式如下。如果总共有 n 个操作数(包括输入和输出操作数),那么第一个输出操作数编号为 0 ,逐项递增,并且最后一个输入操作数编号为 n - 1 。操作数的最大数目在前一节我们讲过。 + +输出操作数表达式必须为左值。输入操作数的要求不像这样严格。它们可以为表达式。扩展汇编特性常常用于编译器所不知道的机器指令 ;-)。如果输出表达式无法直接寻址(即,它是一个位域),我们的约束字符串必须给定一个寄存器。在这种情况下,GCC 将会使用该寄存器作为汇编的输出,然后存储该寄存器的内容到输出。 + +正如前面所陈述的一样,普通的输出操作数必须为只写的; GCC 将会假设指令前的操作数值是死的,并且不需要被(提前)生成。扩展汇编也支持输入-输出或者读-写操作数。 + +所以现在我们来关注一些示例。我们想要求一个数的5次方结果。为了计算该值,我们使用 `lea` 指令。 + +``` +asm ("leal (%1,%1,4), %0" + : "=r" (five_times_x) + : "r" (x) + ); +``` + +这里我们的输入为 x。我们不指定使用的寄存器。 GCC 将会选择一些输入寄存器,一个输出寄存器,来做我们预期的工作。如果我们想要输入和输出放在同一个寄存器里,我们也可以要求 GCC 这样做。这里我们使用那些读-写操作数类型。这里我们通过指定合适的约束来实现它。 + +``` +asm ("leal (%0,%0,4), %0" + : "=r" (five_times_x) + : "0" (x) + ); +``` + +现在输出和输出操作数位于同一个寄存器。但是我们无法得知是哪一个寄存器。现在假如我们也想要指定操作数所在的寄存器,这里有一种方法。 + +``` +asm ("leal (%%ecx,%%ecx,4), %%ecx" + : "=c" (x) + : "c" (x) + ); +``` + +在以上三个示例中,我们并没有在修饰寄存器列表里添加任何寄存器,为什么?在头两个示例, GCC 决定了寄存器并且它知道发生了什么改变。在最后一个示例,我们不必将 'ecx' 添加到修饰寄存器列表(LCTT 译注: 原文修饰寄存器列表这个单词拼写有错,这里已修正),gcc 知道它表示 x。因此,因为它可以知道 `ecx` 的值,它就不被当作修饰的(寄存器)了。 + +### 5.3 修饰寄存器列表 + +一些指令会破坏一些硬件寄存器内容。我们不得不在修饰寄存器中列出这些寄存器,即汇编函数内第三个 ’**:**’ 之后的域。这可以通知 gcc 我们将会自己使用和修改这些寄存器,这样 gcc 就不会假设存入这些寄存器的值是有效的。我们不用在这个列表里列出输入、输出寄存器。因为 gcc 知道 “asm” 使用了它们(因为它们被显式地指定为约束了)。如果指令隐式或显式地使用了任何其他寄存器,(并且寄存器没有出现在输出或者输出约束列表里),那么就需要在修饰寄存器列表中指定这些寄存器。 + +如果我们的指令可以修改条件码寄存器(cc),我们必须将 "cc" 添加进修饰寄存器列表。 + +如果我们的指令以不可预测的方式修改了内存,那么需要将 "memory" 添加进修饰寄存器列表。这可以使 GCC 不会在汇编指令间保持缓存于寄存器的内存值。如果被影响的内存不在汇编的输入或输出列表中,我们也必须添加 **volatile** 关键词。 + +我们可以按我们的需求多次读写修饰寄存器。参考一下模板内的多指令示例;它假设子例程 _foo 接受寄存器 `eax` 和 `ecx` 里的参数。 + +``` +asm ("movl %0,%%eax; + movl %1,%%ecx; + call _foo" + : /* no outputs */ + : "g" (from), "g" (to) + : "eax", "ecx" + ); +``` + +### 5.4 Volatile ...? + +如果你熟悉内核源码或者类似漂亮的代码,你一定见过许多声明为 `volatile` 或者 `__volatile__`的函数,其跟着一个 `asm` 或者 `__asm__`。我之前提到过关键词 `asm` 和 `__asm__`。那么什么是 `volatile` 呢? + +如果我们的汇编语句必须在我们放置它的地方执行(例如,不能为了优化而被移出循环语句),将关键词 `volatile` 放置在 asm 后面、()的前面。以防止它被移动、删除或者其他操作,我们将其声明为 `asm volatile ( ... : ... : ... : ...);` + +如果担心发生冲突,请使用 `__volatile__`。 + +如果我们的汇编只是用于一些计算并且没有任何副作用,不使用 `volatile` 关键词会更好。不使用 `volatile` 可以帮助 gcc 优化代码并使代码更漂亮。 + + +在“一些实用的诀窍”一节中,我提供了多个内联汇编函数的例子。那里我们可以了解到修饰寄存器列表的细节。 + +* * * + +## 6. 更多关于约束 + +到这个时候,你可能已经了解到约束和内联汇编有很大的关联。但我们对约束讲的还不多。约束用于表明一个操作数是否可以位于寄存器和位于哪种寄存器;操作数是否可以为一个内存引用和哪种地址;操作数是否可以为一个立即数和它可能的取值范围(即值的范围),等等。 + +### 6.1 常用约束 + +在许多约束中,只有小部分是常用的。我们来看看这些约束。 + +1. **寄存器操作数约束(r)** + + 当使用这种约束指定操作数时,它们存储在通用寄存器(GPR)中。请看下面示例: + + `asm ("movl %%eax, %0\n" :"=r"(myval));` + + 这里,变量 myval 保存在寄存器中,寄存器 eax 的值被复制到该寄存器中,并且 myval 的值从寄存器更新到了内存。当指定 "r" 约束时, gcc 可以将变量保存在任何可用的 GPR 中。要指定寄存器,你必须使用特定寄存器约束直接地指定寄存器的名字。它们为: + + ``` + +---+--------------------+ + | r | Register(s) | + +---+--------------------+ + | a | %eax, %ax, %al | + | b | %ebx, %bx, %bl | + | c | %ecx, %cx, %cl | + | d | %edx, %dx, %dl | + | S | %esi, %si | + | D | %edi, %di | + +---+--------------------+ + ``` + +2. **内存操作数约束(m)** + + 当操作数位于内存时,任何对它们的操作将直接发生在内存位置,这与寄存器约束相反,后者首先将值存储在要修改的寄存器中,然后将它写回到内存位置。但寄存器约束通常用于一个指令必须使用它们或者它们可以大大提高处理速度的地方。当需要在 “asm” 内更新一个 C 变量,而又不想使用寄存器去保存它的值,使用内存最为有效。例如,IDTR 寄存器的值存储于内存位置 loc 处: + + `asm("sidt %0\n" : :"m"(loc));` + +3. **匹配(数字)约束** + + 在某些情况下,一个变量可能既充当输入操作数,也充当输出操作数。可以通过使用匹配约束在 "asm" 中指定这种情况。 + + `asm ("incl %0" :"=a"(var):"0"(var));` + + 在操作数那一节中,我们也看到了一些类似的示例。在这个匹配约束的示例中,寄存器 "%eax" 既用作输入变量,也用作输出变量。 var 输入被读进 %eax,并且等递增后更新的 %eax 再次被存储进 var。这里的 "0" 用于指定与第 0 个输出变量相同的约束。也就是,它指定 var 输出实例应只被存储在 "%eax" 中。该约束可用于: + - 在输入从变量读取或变量修改后且修改被写回同一变量的情况 + - 在不需要将输入操作数实例和输出操作数实例分开的情况 + + 使用匹配约束最重要的意义在于它们可以有效地使用可用寄存器。 + +其他一些约束: + +1. "m" : 允许一个内存操作数,可以使用机器普遍支持的任一种地址。 +2. "o" : 允许一个内存操作数,但只有当地址是可偏移的。即,该地址加上一个小的偏移量可以得到一个有效地址。 +3. "V" : 一个不允许偏移的内存操作数。换言之,任何适合 "m" 约束而不适合 "o" 约束的操作数。 +4. "i" : 允许一个(带有常量)的立即整形操作数。这包括其值仅在汇编时期知道的符号常量。 +5. "n" : 允许一个带有已知数字的立即整形操作数。许多系统不支持汇编时期的常量,因为操作数少于一个字宽。对于此种操作数,约束应该使用 'n' 而不是'i'。 +6. "g" : 允许任一寄存器、内存或者立即整形操作数,不包括通用寄存器之外的寄存器。 + +以下约束为 x86 特有。 + +1. "r" : 寄存器操作数约束,查看上面给定的表格。 +2. "q" : 寄存器 a、b、c 或者 d。 +3. "I" : 范围从 0 到 31 的常量(对于 32 位移位)。 +4. "J" : 范围从 0 到 63 的常量(对于 64 位移位)。 +5. "K" : 0xff。 +6. "L" : 0xffff。 +7. "M" : 0、1、2 或 3 (lea 指令的移位)。 +8. "N" : 范围从 0 到 255 的常量(对于 out 指令)。 +9. "f" : 浮点寄存器 +10. "t" : 第一个(栈顶)浮点寄存器 +11. "u" : 第二个浮点寄存器 +12. "A" : 指定 `a` 或 `d` 寄存器。这主要用于想要返回 64 位整形数,使用 `d` 寄存器保存最高有效位和 `a` 寄存器保存最低有效位。 + +### 6.2 约束修饰符 + +当使用约束时,对于更精确的控制超过了对约束作用的需求,GCC 给我们提供了约束修饰符。最常用的约束修饰符为: + +1. "=" : 意味着对于这条指令,操作数为只写的;旧值会被忽略并被输出数据所替换。 +2. "&" : 意味着这个操作数为一个早期改动的操作数,其在该指令完成前通过使用输入操作数被修改了。因此,这个操作数不可以位于一个被用作输出操作数或任何内存地址部分的寄存器。如果在旧值被写入之前它仅用作输入而已,一个输入操作数可以为一个早期改动操作数。 + +上述的约束列表和解释并不完整。示例可以让我们对内联汇编的用途和用法更好的理解。在下一节,我们会看到一些示例,在那里我们会发现更多关于修饰寄存器列表的东西。 + +* * * + +## 7. 一些实用的诀窍 + +现在我们已经介绍了关于 GCC 内联汇编的基础理论,现在我们将专注于一些简单的例子。将内联汇编函数写成宏的形式总是非常方便的。我们可以在 Linux 内核代码里看到许多汇编函数。(usr/src/linux/include/asm/*.h)。 + +1. 首先我们从一个简单的例子入手。我们将写一个两个数相加的程序。 + + ``` + int main(void) + { + int foo = 10, bar = 15; + __asm__ __volatile__("addl %%ebx,%%eax" + :"=a"(foo) + :"a"(foo), "b"(bar) + ); + printf("foo+bar=%d\n", foo); + return 0; + } + ``` + + 这里我们要求 GCC 将 foo 存放于 %eax,将 bar 存放于 %ebx,同时我们也想要在 %eax 中存放结果。'=' 符号表示它是一个输出寄存器。现在我们可以以其他方式将一个整数加到一个变量。 + + ``` + __asm__ __volatile__( + " lock ;\n" + " addl %1,%0 ;\n" + : "=m" (my_var) + : "ir" (my_int), "m" (my_var) + : /* 无修饰寄存器列表 */ + ); + ``` + + 这是一个原子加法。为了移除原子性,我们可以移除指令 'lock'。在输出域中,"=m" 表明 my_var 是一个输出且位于内存。类似地,"ir" 表明 my_int 是一个整型,并应该存在于其他寄存器(回想我们上面看到的表格)。没有寄存器位于修饰寄存器列表中。 + +2. 现在我们将在一些寄存器/变量上展示一些操作,并比较值。 + + ``` + __asm__ __volatile__( "decl %0; sete %1" + : "=m" (my_var), "=q" (cond) + : "m" (my_var) + : "memory" + ); + ``` + + 这里,my_var 的值减 1 ,并且如果结果的值为 0,则变量 cond 置 1。我们可以通过将指令 "lock;\n\t" 添加为汇编模板的第一条指令以增加原子性。 + + 以类似的方式,为了增加 my_var,我们可以使用 "incl %0" 而不是 "decl %0"。 + + 这里需要注意的地方是(i)my_var 是一个存储于内存的变量。(ii)cond 位于寄存器 eax、ebx、ecx、edx 中的任何一个。约束 "=q" 保证了这一点。(iii)同时我们可以看到 memory 位于修饰寄存器列表中。也就是说,代码将改变内存中的内容。 + +3. 如何置 1 或清 0 寄存器中的一个比特位。作为下一个诀窍,我们将会看到它。 + + ``` + __asm__ __volatile__( "btsl %1,%0" + : "=m" (ADDR) + : "Ir" (pos) + : "cc" + ); + ``` + + 这里,ADDR 变量(一个内存变量)的 'pos' 位置上的比特被设置为 1。我们可以使用 'btrl' 来清除由 'btsl' 设置的比特位。pos 的约束 "Ir" 表明 pos 位于寄存器,并且它的值为 0-31(x86 相关约束)。也就是说,我们可以设置/清除 ADDR 变量上第 0 到 31 位的任一比特位。因为条件码会被改变,所以我们将 "cc" 添加进修饰寄存器列表。 + +4. 现在我们看看一些更为复杂而有用的函数。字符串拷贝。 + + ``` + static inline char * strcpy(char * dest,const char *src) + { + int d0, d1, d2; + __asm__ __volatile__( "1:\tlodsb\n\t" + "stosb\n\t" + "testb %%al,%%al\n\t" + "jne 1b" + : "=&S" (d0), "=&D" (d1), "=&a" (d2) + : "0" (src),"1" (dest) + : "memory"); + return dest; + } + ``` + + 源地址存放于 esi,目标地址存放于 edi,同时开始拷贝,当我们到达 **0** 时,拷贝完成。约束 "&S"、"&D"、"&a" 表明寄存器 esi、edi 和 eax 早期修饰寄存器,也就是说,它们的内容在函数完成前会被改变。这里很明显可以知道为什么 "memory" 会放在修饰寄存器列表。 + + 我们可以看到一个类似的函数,它能移动双字块数据。注意函数被声明为一个宏。 + + ``` + #define mov_blk(src, dest, numwords) \ + __asm__ __volatile__ ( \ + "cld\n\t" \ + "rep\n\t" \ + "movsl" \ + : \ + : "S" (src), "D" (dest), "c" (numwords) \ + : "%ecx", "%esi", "%edi" \ + ) + ``` + + 这里我们没有输出,寄存器 ecx、esi和 edi 的内容发生了改变,这是块移动的副作用。因此我们必须将它们添加进修饰寄存器列表。 + +5. 在 Linux 中,系统调用使用 GCC 内联汇编实现。让我们看看如何实现一个系统调用。所有的系统调用被写成宏(linux/unistd.h)。例如,带有三个参数的系统调用被定义为如下所示的宏。 + + ``` + type name(type1 arg1,type2 arg2,type3 arg3) \ + { \ + long __res; \ + __asm__ volatile ( "int $0x80" \ + : "=a" (__res) \ + : "0" (__NR_##name),"b" ((long)(arg1)),"c" ((long)(arg2)), \ + "d" ((long)(arg3))); \ + __syscall_return(type,__res); \ + } + ``` + + 无论何时调用带有三个参数的系统调用,以上展示的宏就会用于执行调用。系统调用号位于 eax 中,每个参数位于 ebx、ecx、edx 中。最后 "int 0x80" 是一条用于执行系统调用的指令。返回值被存储于 eax 中。 + + 每个系统调用都以类似的方式实现。Exit 是一个单一参数的系统调用,让我们看看它的代码看起来会是怎样。它如下所示。 + + ``` + { + asm("movl $1,%%eax; /* SYS_exit is 1 */ + xorl %%ebx,%%ebx; /* Argument is in ebx, it is 0 */ + int $0x80" /* Enter kernel mode */ + ); + } + ``` + + Exit 的系统调用号是 1,同时它的参数是 0。因此我们分配 eax 包含 1,ebx 包含 0,同时通过 `int $0x80` 执行 `exit(0)`。这就是 exit 的工作原理。 + +* * * + +## 8. 结束语 + +这篇文档已经将 GCC 内联汇编过了一遍。一旦你理解了基本概念,你就可以按照自己的需求去使用它们了。我们看了许多例子,它们有助于理解 GCC 内联汇编的常用特性。 + +GCC 内联是一个极大的主题,这篇文章是不完整的。更多关于我们讨论过的语法细节可以在 GNU 汇编器的官方文档上获取。类似地,要获取完整的约束列表,可以参考 GCC 的官方文档。 + +当然,Linux 内核大量地使用了 GCC 内联。因此我们可以在内核源码中发现许多各种各样的例子。它们可以帮助我们很多。 + +如果你发现任何的错别字,或者本文中的信息已经过时,请告诉我们。 + +* * * + +## 9. 参考 + +1. [Brennan’s Guide to Inline Assembly](http://www.delorie.com/djgpp/doc/brennan/brennan_att_inline_djgpp.html) +2. [Using Assembly Language in Linux](http://linuxassembly.org/articles/linasm.html) +3. [Using as, The GNU Assembler](http://www.gnu.org/manual/gas-2.9.1/html_mono/as.html) +4. [Using and Porting the GNU Compiler Collection (GCC)](http://gcc.gnu.org/onlinedocs/gcc_toc.html) +5. [Linux Kernel Source](http://ftp.kernel.org/) + +* * * + +via: http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html + + 作者:[Sandeep.S](mailto:busybox@sancharnet.in) 译者:[cposture](https://github.com/cposture) 校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/translated/tech/20151220 GCC-Inline-Assembly-HOWTO.md b/translated/tech/20151220 GCC-Inline-Assembly-HOWTO.md deleted file mode 100644 index e0e1fc6d50..0000000000 --- a/translated/tech/20151220 GCC-Inline-Assembly-HOWTO.md +++ /dev/null @@ -1,632 +0,0 @@ -* * * - -# GCC 内联汇编 HOWTO - -v0.1, 01 March 2003. -* * * - -_本 HOWTO 文档将讲解 GCC 提供的内联汇编特性的用途和用法。对于阅读这篇文章,这里只有两个前提要求,很明显,就是 x86 汇编语言和 C 语言的基本认识。_ - -* * * - -## 1. 简介 - -## 1.1 版权许可 - -Copyright (C)2003 Sandeep S. - -本文档自由共享;你可以重新发布它,并且/或者在遵循自由软件基金会发布的 GNU 通用公共许可证下修改它;或者该许可证的版本 2 ,或者(按照你的需求)更晚的版本。 - -发布这篇文档是希望它能够帮助别人,但是没有任何保证;甚至不包括可售性和适用于任何特定目的的保证。关于更详细的信息,可以查看 GNU 通用许可证。 - -## 1.2 反馈校正 - -请将反馈和批评一起提交给 [Sandeep.S](mailto:busybox@sancharnet.in) 。我将感谢任何一个指出本文档中错误和不准确之处的人;一被告知,我会马上改正它们。 - -## 1.3 致谢 - -我对提供如此棒的特性的 GNU 人们表示真诚的感谢。感谢 Mr.Pramode C E 所做的所有帮助。感谢在 Govt Engineering College 和 Trichur 的朋友们的精神支持和合作,尤其是 Nisha Kurur 和 Sakeeb S 。 感谢在 Gvot Engineering College 和 Trichur 的老师们的合作。 - -另外,感谢 Phillip , Brennan Underwood 和 colin@nyx.net ;这里的许多东西都厚颜地直接取自他们的工作成果。 - -* * * - -## 2. 概览 - -在这里,我们将学习 GCC 内联汇编。这内联表示的是什么呢? - -我们可以要求编译器将一个函数的代码插入到调用者代码中函数被实际调用的地方。这样的函数就是内联函数。这听起来和宏差不多?这两者确实有相似之处。 - -内联函数的优点是什么呢? - -这种内联方法可以减少函数调用开销。同时如果所有实参的值为常量,它们的已知值可以在编译期允许简化,因此并非所有的内联函数代码都需要被包含。代码大小的影响是不可预测的,这取决于特定的情况。为了声明一个内联函数,我们必须在函数声明中使用 `inline` 关键字。 - -现在我们正处于一个猜测内联汇编到底是什么的点上。它只不过是一些写为内联函数的汇编程序。在系统编程上,它们方便、快速并且极其有用。我们主要集中学习(GCC)内联汇编函数的基本格式和用法。为了声明内联汇编函数,我们使用 `asm` 关键词。 - -内联汇编之所以重要,主要是因为它可以操作并且使其输出通过 C 变量显示出来。正是因为此能力, "asm" 可以用作汇编指令和包含它的 C 程序之间的接口。 - -* * * - -## 3. GCC 汇编语法 - -GCC , Linux上的 GNU C 编译器,使用 **AT&T** / **UNIX** 汇编语法。在这里,我们将使用 AT&T 语法 进行汇编编码。如果你对 AT&T 语法不熟悉的话,请不要紧张,我会教你的。AT&T 语法和 Intel 语法的差别很大。我会给出主要的区别。 - -1. 源操作数和目的操作数顺序 - - AT&T 语法的操作数方向和 Intel 语法的刚好相反。在Intel 语法中,第一操作数为目的操作数,第二操作数为源操作数,然而在 AT&T 语法中,第一操作数为源操作数,第二操作数为目的操作数。也就是说, - - Intel 语法中的 "Op-code dst src" 变为 - - AT&T 语法中的 "Op-code src dst"。 - -2. 寄存器命名 - - 寄存器名称有 % 前缀,即如果必须使用 eax,它应该用作 %eax。 - -3. 立即数 - - AT&T 立即数以 ’$’ 为前缀。静态 "C" 变量 也使用 ’$’ 前缀。在 Intel 语法中,十六进制常量以 ’h’ 为后缀,然而AT&T不使用这种语法,这里我们给常量添加前缀 ’0x’。所以,对于十六进制,我们首先看到一个 ’$’,然后是 ’0x’,最后才是常量。 - -4. 操作数大小 - - 在 AT&T 语法中,存储器操作数的大小取决于操作码名字的最后一个字符。操作码后缀 ’b’ 、’w’、’l’分别指明了字节(byte)(8位)、字(word)(16位)、长型(long)(32位)存储器引用。Intel 语法通过给存储器操作数添加’byte ptr’、 ’word ptr’ 和 ’dword ptr’前缀来实现这一功能。 - - 因此,Intel的 "mov al, byte ptr foo" 在 AT&T 语法中为 "movb foo, %al"。 - -5. 存储器操作数 - - 在 Intel 语法中,基址寄存器包含在 ’[’ 和 ’]’ 中,然而在 AT&T 中,它们变为 ’(’ 和 ’)’。另外,在 Intel 语法中, 间接内存引用为 - - section:[base + index*scale + disp], 在 AT&T中变为 - - section:disp(base, index, scale)。 - - 需要牢记的一点是,当一个常量用于 disp 或 scale,不能添加’$’前缀。 - -现在我们看到了 Intel 语法和 AT&T 语法之间的一些主要差别。我仅仅写了它们差别的一部分而已。关于更完整的信息,请参考 GNU 汇编文档。现在为了更好地理解,我们可以看一些示例。 - -> ` -> ->
+------------------------------+------------------------------------+
-> |       Intel Code             |      AT&T Code                     |
-> +------------------------------+------------------------------------+
-> | mov     eax,1                |  movl    $1,%eax                   |   
-> | mov     ebx,0ffh             |  movl    $0xff,%ebx                |   
-> | int     80h                  |  int     $0x80                     |   
-> | mov     ebx, eax             |  movl    %eax, %ebx                |
-> | mov     eax,[ecx]            |  movl    (%ecx),%eax               |
-> | mov     eax,[ebx+3]          |  movl    3(%ebx),%eax              | 
-> | mov     eax,[ebx+20h]        |  movl    0x20(%ebx),%eax           |
-> | add     eax,[ebx+ecx*2h]     |  addl    (%ebx,%ecx,0x2),%eax      |
-> | lea     eax,[ebx+ecx]        |  leal    (%ebx,%ecx),%eax          |
-> | sub     eax,[ebx+ecx*4h-20h] |  subl    -0x20(%ebx,%ecx,0x4),%eax |
-> +------------------------------+------------------------------------+
-> 
-> -> ` - -* * * - -## 4. 基本内联 - -基本内联汇编的格式非常直接了当。它的基本格式为 - -`asm("汇编代码");` - -示例 - -> ` -> -> * * * -> ->
asm("movl %ecx %eax"); /* 将 ecx 寄存器的内容移至 eax  */
-> __asm__("movb %bh (%eax)"); /* 将 bh 的一个字节数据 移至 eax 寄存器指向的内存 */
-> 
-> -> * * * -> -> ` - -你可能注意到了这里我使用了 `asm ` 和 `__asm__`。这两者都是有效的。如果关键词 `asm` 和我们程序的一些标识符冲突了,我们可以使用 `__asm__`。如果我们的指令多余一条,我们可以写成一行,并用括号括起,也可以为每条指令添加 ’\n’ 和 ’\t’ 后缀。这是因为gcc将每一条当作字符串发送给 **as**(GAS)( GAS 即 GNU 汇编器 ——译者注),并且通过使用换行符/制表符发送正确地格式化行给汇编器。 - -示例 - -> ` -> -> * * * -> ->
 __asm__ ("movl %eax, %ebx\n\t"
->           "movl $56, %esi\n\t"
->           "movl %ecx, $label(%edx,%ebx,$4)\n\t"
->           "movb %ah, (%ebx)");
-> 
-> -> * * * -> -> ` - -如果在代码中,我们涉及到一些寄存器(即改变其内容),但在没有固定这些变化的情况下从汇编中返回,这将会导致一些不好的事情。这是因为 GCC 并不知道寄存器内容的变化,这会导致问题,特别是当编译器做了某些优化。在没有告知 GCC 的情况下,它将会假设一些寄存器存储了我们可能已经改变的变量的值,它会像什么事都没发生一样继续运行(什么事都没发生一样是指GCC不会假设寄存器装入的值是有效的,当退出改变了寄存器值的内联汇编后,寄存器的值不会保存到相应的变量或内存空间 ——译者注)。我们所可以做的是使用这些没有副作用的指令,或者当我们退出时固定这些寄存器,或者等待程序崩溃。这是为什么我们需要一些扩展功能。扩展汇编正好给我们提供了那样的功能。 - -* * * - -## 5. 扩展汇编 - -在基本内联汇编中,我们只有指令。然而在扩展汇编中,我们可以同时指定操作数。它允许我们指定输入寄存器、输出寄存器以及修饰寄存器列表。GCC 不强制用户必须指定使用的寄存器。我们可以把头疼的事留给 GCC ,这可能可以更好地适应 GCC 的优化。不管怎樣,基本格式为: - -> ` -> -> * * * -> ->
       asm ( 汇编程序模板 
->            : 输出操作数					/* 可选的 */
->            : 输入操作数                   /* 可选的 */
->            : 修饰寄存器列表			    /* 可选的 */
->            );
-> 
-> -> * * * -> -> ` - -汇编程序模板由汇编指令组成.每一个操作数由一个操作数约束字符串所描述,其后紧接一个括弧括起的 C 表达式。冒号用于将汇编程序模板和第一个输出操作数分开,另一个(冒号)用于将最后一个输出操作数和第一个输入操作数分开,如果存在的话。逗号用于分离每一个组内的操作数。总操作数的数目限制在10个,或者机器描述中的任何指令格式中的最大操作数数目,以较大者为准。 - -如果没有输出操作数但存在输入操作数,你必须将两个连续的冒号放置于输出操作数原本会放置的地方周围。 - -示例: - -> ` -> -> * * * -> ->
        asm ("cld\n\t"
->              "rep\n\t"
->              "stosl"
->              : /* 无输出寄存器 */
->              : "c" (count), "a" (fill_value), "D" (dest)
->              : "%ecx", "%edi" 
->              );
-> 
-> -> * * * -> -> ` - -现在,这段代码是干什么的?以上的内联汇编是将 `fill_value` 值 连续 `count` 次 拷贝到 寄存器 `edi` 所指位置(每执行stosl一次,寄存器 edi 的值会递增或递减,这取决于是否设置了 direction 标志,因此以上代码实则初始化一个内存块 ——译者注)。 它也告诉 gcc 寄存器 `ecx` 和 `edi` 一直无效(原文为 eax ,但代码修饰寄存器列表中为 ecx,因此这可能为作者的纰漏 ——译者注)。为了使扩展汇编更加清晰,让我们再看一个示例。 - -> ` -> -> * * * -> ->
        
->         int a=10, b;
->         asm ("movl %1, %%eax; 
->               movl %%eax, %0;"
->              :"=r"(b)        /* 输出 */
->              :"r"(a)         /* 输入 */
->              :"%eax"         /* 修饰寄存器 */
->              );       
-> 
-> -> * * * -> -> ` - -这里我们所做的是使用汇编指令使 ’b’ 变量的值等于 ’a’ 变量的值。一些有意思的地方是: - -* "b" 为输出操作数,用 %0 引用,并且 "a" 为输入操作数,用 %1 引用。 -* "r" 为操作数约束。之后我们会更详细地了解约束(字符串)。目前,"r" 告诉 GCC 可以使用任一寄存器存储操作数。输出操作数约束应该有一个约束修饰符 "=" 。这修饰符表明它是一个只读的输出操作数。 -* 寄存器名字以两个%为前缀。这有利于 GCC 区分操作数和寄存器。操作数以一个 % 为前缀。 -* 第三个冒号之后的修饰寄存器 %eax 告诉 GCC %eax的值将会在 "asm" 内部被修改,所以 GCC 将不会使用此寄存器存储任何其他值。 - -当 "asm" 执行完毕, "b" 变量会映射到更新的值,因为它被指定为输出操作数。换句话说, "asm" 内 "b" 变量的修改 应该会被映射到 "asm" 外部。 - -现在,我们可以更详细地看看每一个域。 - -## 5.1 汇编程序模板 - -汇编程序模板包含了被插入到 C 程序的汇编指令集。其格式为:每条指令用双引号圈起,或者整个指令组用双引号圈起。同时每条指令应以分界符结尾。有效的分界符有换行符(\n)和逗号(;)。’\n’ 可以紧随一个制表符(\t)。我们应该都明白使用换行符或制表符的原因了吧?和 C 表达式对应的操作数使用 %0、%1 ... 等等表示。 - -## 5.2 操作数 - -C 表达式用作 "asm" 内的汇编指令操作数。作为第一双引号内的操作数约束,写下每一操作数。对于输出操作数,在引号内还有一个约束修饰符,其后紧随一个用于表示操作数的 C 表达式。即, - -"约束字符串"(C 表达式),它是一个通用格式。对于输出操作数,还有一个额外的修饰符。约束字符串主要用于决定操作数的寻找方式,同时也用于指定使用的寄存器。 - -如果我们使用的操作数多于一个,那么每一个操作数用逗号隔开。 - -在汇编程序模板,每个操作数用数字引用。编号方式如下。如果总共有 n 个操作数(包括输入和输出操作数),那么第一个输出操作数编号为 0 ,逐项递增,并且最后一个输入操作数编号为 n - 1 。操作数的最大数目为前一节我们所看到的那样。 - -输出操作数表达式必须为左值。输入操作数的要求不像这样严格。它们可以为表达式。扩展汇编特性常常用于编译器自己不知道其存在的机器指令 ;-)。如果输出表达式无法直接寻址(例如,它是一个位域),我们的约束字符串必须给定一个寄存器。在这种情况下,GCC 将会使用该寄存器作为汇编的输出,然后存储该寄存器的内容到输出。 - -正如前面所陈述的一样,普通的输出操作数必须为只写的; GCC 将会假设指令前的操作数值是死的,并且不需要被(提前)生成。扩展汇编也支持输入-输出或者读-写操作数。 - -所以现在我们来关注一些示例。我们想要求一个数的5次方结果。为了计算该值,我们使用 `lea` 指令。 - -> ` -> -> * * * -> ->
        asm ("leal (%1,%1,4), %0"
->              : "=r" (five_times_x)
->              : "r" (x) 
->              );
-> 
-> -> * * * -> -> ` - -这里我们的输入为x。我们不指定使用的寄存器。 GCC 将会选择一些输入寄存器,一个输出寄存器,并且做我们期望的事。如果我们想要输入和输出存在于同一个寄存器里,我们可以要求 GCC 这样做。这里我们使用那些读-写操作数类型。这里我们通过指定合适的约束来实现它。 - -> ` -> -> * * * -> ->
        asm ("leal (%0,%0,4), %0"
->              : "=r" (five_times_x)
->              : "0" (x) 
->              );
-> 
-> -> * * * -> -> ` - -现在输出和输出操作数位于同一个寄存器。但是我们无法得知是哪一个寄存器。现在假如我们也想要指定操作数所在的寄存器,这里有一种方法。 - -> ` -> -> * * * -> ->
        asm ("leal (%%ecx,%%ecx,4), %%ecx"
->              : "=c" (x)
->              : "c" (x) 
->              );
-> 
-> -> * * * -> -> ` - -在以上三个示例中,我们并没有添加任何寄存器到修饰寄存器里,为什么?在头两个示例, GCC 决定了寄存器并且它知道发生了什么改变。在最后一个示例,我们不必将 'ecx' 添加到修饰寄存器列表(原文修饰寄存器列表拼写有错,这里已修正 ——译者注), gcc 知道它表示x。因此,因为它可以知道 `ecx` 的值,它就不被当作修饰的(寄存器)了。 - -## 5.3 修饰寄存器列表 - -一些指令会破坏一些硬件寄存器。我们不得不在修饰寄存器中列出这些寄存器,即汇编函数内第三个 ’**:**’ 之后的域。这可以通知 gcc 我们将会自己使用和修改这些寄存器。所以 gcc 将不会假设存入这些寄存器的值是有效的。我们不用在这个列表里列出输入输出寄存器。因为 gcc 知道 "asm" 使用了它们(因为它们被显式地指定为约束了)。如果指令隐式或显式地使用了任何其他寄存器,(并且寄存器不能出现在输出或者输出约束列表里),那么不得不在修饰寄存器列表中指定这些寄存器。 - -如果我们的指令可以修改状态寄存器,我们必须将 "cc" 添加进修饰寄存器列表。 - -如果我们的指令以不可预测的方式修改了内存,那么需要将 "memory" 添加进修饰寄存器列表。这可以使 GCC 不会在汇编指令间保持缓存于寄存器的内存值。如果被影响的内存不在汇编的输入或输出列表中,我们也必须添加 **volatile** 关键词。 - -我们可以按我们的需求多次读写修饰寄存器。考虑一个模板内的多指令示例;它假设子例程 _foo 接受寄存器 `eax` 和 `ecx` 里的参数。 - -> ` -> -> * * * -> ->
        asm ("movl %0,%%eax;
->               movl %1,%%ecx;
->               call _foo"
->              : /* no outputs */
->              : "g" (from), "g" (to)
->              : "eax", "ecx"
->              );
-> 
-> -> * * * -> -> ` - -## 5.4 Volatile ...? - -如果你熟悉内核源码或者其他像内核源码一样漂亮的代码,你一定见过许多声明为 `volatile` 或者 `__volatile__`的函数,其跟着一个 `asm` 或者 `__asm__`。我之前提过关键词 `asm` 和 `__asm__`。那么什么是 `volatile`呢? - -如果我们的汇编语句必须在我们放置它的地方执行(即,不能作为一种优化被移出循环语句),将关键词 `volatile` 放置在 asm 后面,()的前面。因为为了防止它被移动、删除或者其他操作,我们将其声明为 - -`asm volatile ( ... : ... : ... : ...);` - -当我们必须非常谨慎时,请使用 `__volatile__`。 - -如果我们的汇编只是用于一些计算并且没有任何副作用,不使用 `volatile` 关键词会更好。不使用 `volatile` 可以帮助 gcc 优化代码并使代码更漂亮。 - - -在 `Some Useful Recipes` 一节中,我提供了多个内联汇编函数的例子。这儿我们详细查看修饰寄存器列表。 - -* * * - -## 6. 更多关于约束 - -到这个时候,你可能已经了解到约束和内联汇编有很大的关联。但我们很少说到约束。约束用于表明一个操作数是否可以位于寄存器和位于哪个寄存器;是否操作数可以为一个内存引用和哪种地址;是否操作数可以为一个立即数和为哪一个可能的值(即值的范围)。它可以有...等等。 - -## 6.1 常用约束 - -在许多约束中,只有小部分是常用的。我们将看看这些约束。 - -1. **寄存器操作数约束(r)** - - 当使用这种约束指定操作数时,它们存储在通用寄存器(GPR)中。请看下面示例: - - `asm ("movl %%eax, %0\n" :"=r"(myval));` - - 这里,变量 myval 保存在寄存器中,寄存器 eax 的值被复制到该寄存器中,并且myval的值从寄存器更新到了内存。当指定 "r" 约束时, gcc 可以将变量保存在任何可用的 GPR 中。为了指定寄存器,你必须使用特定寄存器约束直接地指定寄存器的名字。它们为: - - > ` - > - >
+---+--------------------+
-    > | r |    Register(s)     |
-    > +---+--------------------+
-    > | a |   %eax, %ax, %al   |
-    > | b |   %ebx, %bx, %bl   |
-    > | c |   %ecx, %cx, %cl   |
-    > | d |   %edx, %dx, %dl   |
-    > | S |   %esi, %si        |
-    > | D |   %edi, %di        |
-    > +---+--------------------+
-    > 
- > - > ` - -2. **内存操作数约束(m)** - - 当操作数位于内存时,任何对它们的操作将直接发生在内存位置,这与寄存器约束相反,后者首先将值存储在要修改的寄存器中,然后将它写回到内存位置。但寄存器约束通常用于一个指令必须使用它们或者它们可以大大提高进程速度的地方。当需要在 "asm" 内更新一个 C 变量,而又不想使用寄存器去保存它的只,使用内存最为有效。例如, idtr 的值存储于内存位置: - - `asm("sidt %0\n" : :"m"(loc));` - -3. **匹配(数字)约束** - - 在某些情况下,一个变量可能既充当输入操作数,也充当输出操作数。可以通过使用匹配约束在 "asm" 中指定这种情况。 - - `asm ("incl %0" :"=a"(var):"0"(var));` - - 在操作数子节中,我们也看到了一些类似的示例。在这个匹配约束的示例中,寄存器 "%eax" 既用作输入变量,也用作输出变量。 var 输入被读进 %eax ,并且更新的 %eax 再次被存储进 var。这里的 "0" 用于指定与第0个输出变量相同的约束。也就是,它指定 var 输出实例应只被存储在 "%eax" 中。该约束可用于: - - * 在输入从变量读取或变量修改后,修改被写回同一变量的情况 - * 在不需要将输入操作数实例和输出操作数实例分开的情况 - - 使用匹配约束最重要的意义在于它们可以导致有效地使用可用寄存器。 - -其他一些约束: - -1. "m" : 允许一个内存操作数使用机器普遍支持的任一种地址。 -2. "o" : 允许一个内存操作数,但只有当地址是可偏移的。即,该地址加上一个小的偏移量可以得到一个地址。 -3. "V" : A memory operand that is not offsettable. In other words, anything that would fit the `m’ constraint but not the `o’constraint. -4. "i" : 允许一个(带有常量)的立即整形操作数。这包括其值仅在汇编时期知道的符号常量。 -5. "n" : 允许一个带有已知数字的立即整形操作数。许多系统不支持汇编时期的常量,因为操作数少于一个字宽。对于此种操作数,约束应该使用 'n' 而不是'i'。 -6. "g" : 允许任一寄存器、内存或者立即整形操作数,不包括通用寄存器之外的寄存器。 - - -以下约束为x86特有。 - -1. "r" : 寄存器操作数约束,查看上面给定的表格。 -2. "q" : 寄存器 a、b、c 或者 d。 -3. "I" : 范围从 0 到 31 的常量(对于 32 位移位)。 -4. "J" : 范围从 0 到 63 的常量(对于 64 位移位)。 -5. "K" : 0xff。 -6. "L" : 0xffff。 -7. "M" : 0, 1, 2, or 3 (lea 指令的移位)。 -8. "N" : 范围从 0 到 255 的常量(对于 out 指令)。 -9. "f" : 浮点寄存器 -10. "t" : 第一个(栈顶)浮点寄存器 -11. "u" : 第二个浮点寄存器 -12. "A" : 指定 `a` 或 `d` 寄存器。这主要用于想要返回 64 位整形数,使用 `d` 寄存器保存最高有效位和 `a` 寄存器保存最低有效位。 - -## 6.2 约束修饰符 - -当使用约束时,对于更精确的控制超越了约束作用的需求,GCC 给我们提供了约束修饰符。最常用的约束修饰符为: - -1. "=" : 意味着对于这条指令,操作数为只写的;旧值会被忽略并被输出数据所替换。 -2. "&" : 意味着这个操作数为一个早期的改动操作数,其在该指令完成前通过使用输入操作数被修改了。因此,这个操作数不可以位于一个被用作输出操作数或任何内存地址部分的寄存器。如果在旧值被写入之前它仅用作输入而已,一个输入操作数可以为一个早期改动操作数。 - - 约束的列表和解释是决不完整的。示例可以给我们一个关于内联汇编的用途和用法的更好的理解。在下一节,我们会看到一些示例,在那里我们会发现更多关于修饰寄存器列表的东西。 - -* * * - -## 7. 一些实用的诀窍 - -现在我们已经介绍了关于 GCC 内联汇编的基础理论,现在我们将专注于一些简单的例子。将内联汇编函数写成宏的形式总是非常方便的。我们可以在内核代码里看到许多汇编函数。(usr/src/linux/include/asm/*.h)。 - -1. 首先我们从一个简单的例子入手。我们将写一个两个数相加的程序。 - - > ` - > - > * * * - > - >
int main(void)
-    > {
-    >         int foo = 10, bar = 15;
-    >         __asm__ __volatile__("addl  %%ebx,%%eax"
-    >                              :"=a"(foo)
-    >                              :"a"(foo), "b"(bar)
-    >                              );
-    >         printf("foo+bar=%d\n", foo);
-    >         return 0;
-    > }
-    > 
- > - > * * * - > - > ` - - 这里我们要求 GCC 将 foo 存放于 %eax,将 bar 存放于 %ebx,同时我们也想要在 %eax 中存放结果。'=' 符号表示它是一个输出寄存器。现在我们可以以其他方式将一个整数加到一个变量。 - - > ` - > - > * * * - > - >
 __asm__ __volatile__(
-    >                       "   lock       ;\n"
-    >                       "   addl %1,%0 ;\n"
-    >                       : "=m"  (my_var)
-    >                       : "ir"  (my_int), "m" (my_var)
-    >                       :                                 /* 无修饰寄存器列表 */
-    >                       );
-    > 
- > - > * * * - > - > ` - - 这是一个原子加法。为了移除原子性,我们可以移除指令 'lock'。在输出域中,"=m" 表明 my_var 是一个输出且位于内存。类似地,"ir" 表明 my_int 是一个整型,并应该存在于其他寄存器(回想我们上面看到的表格)。没有寄存器位于修饰寄存器列表中。 - -2. 现在我们将在一些寄存器/变量上展示一些操作,并比较值。 - - > ` - > - > * * * - > - >
 __asm__ __volatile__(  "decl %0; sete %1"
-    >                       : "=m" (my_var), "=q" (cond)
-    >                       : "m" (my_var) 
-    >                       : "memory"
-    >                       );
-    > 
- > - > * * * - > - > ` - - 这里,my_var 的值减 1 ,并且如果结果的值为 0,则变量 cond 置 1。我们可以通过添加指令 "lock;\n\t" 作为汇编模板的第一条指令来添加原子性。 - - 以类似的方式,为了增加 my_var,我们可以使用 "incl %0" 而不是 "decl %0"。 - - 这里需要注意的点为(i)my_var 是一个存储于内存的变量。(ii)cond 位于任何一个寄存器 eax、ebx、ecx、edx。约束 "=q" 保证这一点。(iii)同时我们可以看到 memory 位于修饰寄存器列表中。也就是说,代码将改变内存中的内容。 - -3. 如何置1或清0寄存器中的一个比特位。作为下一个诀窍,我们将会看到它。 - - > ` - > - > * * * - > - >
__asm__ __volatile__(   "btsl %1,%0"
-    >                       : "=m" (ADDR)
-    >                       : "Ir" (pos)
-    >                       : "cc"
-    >                       );
-    > 
- > - > * * * - > - > ` - - 这里,ADDR 变量(一个内存变量)的 'pos' 位置上的比特被设置为 1。我们可以使用 'btrl' 来清楚由 'btsl' 设置的比特位。pos 的约束 "Ir" 表明 pos 位于寄存器并且它的值为 0-31(x86 相关约束)。也就是说,我们可以设置/清除 ADDR 变量上第 0 到 31 位的任一比特位。因为条件码会被改变,所以我们将 "cc" 添加进修饰寄存器列表。 - -4. 现在我们看看一些更为复杂而有用的函数。字符串拷贝。 - - > ` - > - > * * * - > - >
static inline char * strcpy(char * dest,const char *src)
-    > {
-    > int d0, d1, d2;
-    > __asm__ __volatile__(  "1:\tlodsb\n\t"
-    >                        "stosb\n\t"
-    >                        "testb %%al,%%al\n\t"
-    >                        "jne 1b"
-    >                      : "=&S" (d0), "=&D" (d1), "=&a" (d2)
-    >                      : "0" (src),"1" (dest) 
-    >                      : "memory");
-    > return dest;
-    > }
-    > 
- > - > * * * - > - > ` - - 源地址存放于 esi,目标地址存放于 edi,同时开始拷贝,当我们到达 **0** 时,拷贝完成。约束 "&S"、"&D"、"&a" 表明寄存器 esi、edi和 eax 早期的修饰寄存器,也就是说,它们的内容在函数完成前会被改变。这里很明显可以知道为什么 "memory" 会放在修饰寄存器列表。 - - 我们可以看到一个类似的函数,它能移动双字块数据。注意函数被声明为一个宏。 - - > ` - > - > * * * - > - >
#define mov_blk(src, dest, numwords) \
-    > __asm__ __volatile__ (                                          \
-    >                        "cld\n\t"                                \
-    >                        "rep\n\t"                                \
-    >                        "movsl"                                  \
-    >                        :                                        \
-    >                        : "S" (src), "D" (dest), "c" (numwords)  \
-    >                        : "%ecx", "%esi", "%edi"                 \
-    >                        )
-    > 
- > - > * * * - > - > ` - - 这里我们没有输出,所以寄存器 ecx、esi和 edi 的内容发生改变,这是块移动的副作用。因此我们必须将它们添加进修饰寄存器列表。 - -5. 在 Linux 中,系统调用使用 GCC 内联汇编实现。让我们看看如何实现一个系统调用。所有的系统调用被写成宏(linux/unistd.h)。例如,带有三个参数的系统调用被定义为如下所示的宏。 - - > ` - > - > * * * - > - > type name(type1 arg1,type2 arg2,type3 arg3) \ - > { \ - > long __res; \ - > __asm__ volatile ( "int $0x80" \ - > : "=a" (__res) \ - > : "0" (__NR_##name),"b" ((long)(arg1)),"c" ((long)(arg2)), \ - > "d" ((long)(arg3))); \ - > __syscall_return(type,__res); \ - > } - >
- > - > * * * - > - > ` - - 无论何时调用带有三个参数的系统调用,以上展示的宏用于执行调用。系统调用号位于 eax 中,每个参数位于 ebx、ecx、edx 中。最后 "int 0x80" 是一条用于执行系统调用的指令。返回值被存储于 eax 中。 - - 每个系统调用都以类似的方式实现。Exit 是一个单一参数的系统调用,让我们看看它的代码看起来会是怎样。它如下所示。 - - > ` - > - > * * * - > - >
{
-    >         asm("movl $1,%%eax;         /* SYS_exit is 1 */
-    >              xorl %%ebx,%%ebx;      /* Argument is in ebx, it is 0 */
-    >              int  $0x80"            /* Enter kernel mode */
-    >              );
-    > }
-    > 
- > - > * * * - > - > ` - - Exit 的系统调用号是 1 同时它的参数是 0。因此我们分配 eax 包含 1,ebx 包含 0,同时通过 `int $0x80` 执行 `exit(0)`。这就是 exit 的工作原理。 - -* * * - -## 8. 结束语 - -这篇文档已经将 GCC 内联汇编过了一遍。一旦你理解了基本概念,你便不难采取自己的行动。我们看了许多例子,它们有助于理解 GCC 内联汇编的常用特性。 - -GCC 内联是一个极大的主题,这篇文章是不完整的。更多关于我们讨论过的语法细节可以在 GNU 汇编器的官方文档上获取。类似地,对于一个完整的约束列表,可以参考 GCC 的官方文档。 - -当然,Linux 内核 大规模地使用 GCC 内联。因此我们可以在内核源码中发现许多各种各样的例子。它们可以帮助我们很多。 - -如果你发现任何的错别字,或者本文中的信息已经过时,请告诉我们。 - -* * * - -## 9. 参考 - -1. [Brennan’s Guide to Inline Assembly](http://www.delorie.com/djgpp/doc/brennan/brennan_att_inline_djgpp.html) -2. [Using Assembly Language in Linux](http://linuxassembly.org/articles/linasm.html) -3. [Using as, The GNU Assembler](http://www.gnu.org/manual/gas-2.9.1/html_mono/as.html) -4. [Using and Porting the GNU Compiler Collection (GCC)](http://gcc.gnu.org/onlinedocs/gcc_toc.html) -5. [Linux Kernel Source](http://ftp.kernel.org/) - -* * * -via: http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html - - 作者:[Sandeep.S](mailto:busybox@sancharnet.in) 译者:[cposture](https://github.com/cposture) 校对:[]() - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From a5d7d25e756b78ddaacd09abf25c41590196343c Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 18 Aug 2016 00:38:12 +0800 Subject: [PATCH 1440/1469] PUB:20160623 72% Of The People I Follow On Twitter Are Men @Flowsnow --- ... The People I Follow On Twitter Are Men.md | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) rename {translated/tech => published}/20160623 72% Of The People I Follow On Twitter Are Men.md (54%) diff --git a/translated/tech/20160623 72% Of The People I Follow On Twitter Are Men.md b/published/20160623 72% Of The People I Follow On Twitter Are Men.md similarity index 54% rename from translated/tech/20160623 72% Of The People I Follow On Twitter Are Men.md rename to published/20160623 72% Of The People I Follow On Twitter Are Men.md index e836bfe4ab..e0cc100587 100644 --- a/translated/tech/20160623 72% Of The People I Follow On Twitter Are Men.md +++ b/published/20160623 72% Of The People I Follow On Twitter Are Men.md @@ -1,9 +1,9 @@ -在推特上我关注的人72%都是男性 +在推特上我关注的人 72% 都是男性 =============================================== ![](https://emptysqua.re/blog/gender-of-twitter-users-i-follow/abacus.jpg) -至少,这是我的估计。推特并不会询问用户的性别,因此我 [写了一个程序][1] ,根据姓名猜测他们的性别。在我的那些关注者中,性别分布甚至更糟,83%的是男性。据我所知,其他的还不全都是女性。 +至少,这是我的估计。推特并不会询问用户的性别,因此我 [写了一个程序][1] ,根据姓名猜测他们的性别。在那些关注我的人当中,性别分布甚至更糟,83% 的是男性。据我所知,其他的还不全都是女性。 修正第一个数字并不是什么神秘的事:我注意寻找更多支持我兴趣的女性专家,并且关注他们。 @@ -11,13 +11,13 @@ ### 我应该怎么估算呢 -我开始估算我关注的人(推特的上的术语是“朋友”)的性别分布,然后这格外的难。[推特的分析][2]经常显示相反的结果。 一个我的关注者的性别估算结果: +我开始估算我关注的人(推特的上的术语是“朋友”)的性别分布,然后发现这格外的难。[推特的分析][2]给我展示了如下的结果, 关于关注我的人的性别估算: ![](https://emptysqua.re/blog/gender-of-twitter-users-i-follow/twitter-analytics.png) -因此,推特的分析将我的关注者分成了三类:男性、女性、未知,并且给我们展示了前面两组的比例。(性别二值化现象在这里并不存在——未知性别的人都集中在组织的推特账号上。)但是我关注的人的性别比例,推特并没有告诉我。 [而这就是可以改进的][3], 然后我开始搜索能够帮我估算这个数字的服务,最终发现了 [FollowerWonk][4] 。 +因此,推特的分析将我的关注者分成了三类:男性、女性、未知,并且给我们展示了前面两组的比例。(性别二值化现象在这里并不存在——未知性别的人都集中在组织的推特账号上。)但是我关注的人的性别比例,推特并没有告诉我。 [而这就是可以改进的][3],然后我开始搜索能够帮我估算这个数字的服务,最终发现了 [FollowerWonk][4] 。 -FollowerWonk 估算我关注的人里面有71%的都是男性。这个估算准确吗? 为了准确性,我把FollowerWonk和Twitter对我关注的人的进行了估算,结果如下: +FollowerWonk 估算我关注的人里面有 71% 都是男性。这个估算准确吗? 为了评估一下,我把 FollowerWonk 和 Twitter 对我关注的人的进行了估算,结果如下: **推特分析** @@ -32,15 +32,15 @@ FollowerWonk 估算我关注的人里面有71%的都是男性。这个估算准 | **我的关注者** | 81% | 19% | | **我关注的人** | 72% | 28% | -FollowerWonk的分析显示我的关注者中81%的人都是男性,很接近推特分析的数字。这个结果还说得过去。如果FollowerWonk 和Twitter 在我的关注者的性别比例上是一致的,这就表明FollowerWonk对我关注的人的性别估算也应当是合理的。使用FollowerWonk我就能养成估算这些数字的爱好,并且做出改进。 +FollowerWonk 的分析显示我的关注者中 81% 的人都是男性,很接近推特分析的数字。这个结果还说得过去。如果FollowerWonk 和 Twitter 在我的关注者的性别比例上是一致的,这就表明 FollowerWonk 对我关注的人的性别估算也应当是合理的。使用 FollowerWonk 我就能养成估算这些数字的爱好,并且做出改进。 -然而,使用FollowerWonk 检测我关注的人的性别分布一个月需要30美元,这真是一个昂贵的爱好。我并不需要FollowerWonk 的所有的功能。我能很经济的解决只需要性别分布的问题吗? +然而,使用 FollowerWonk 检测我关注的人的性别分布一个月需要 30 美元,这真是一个昂贵的爱好。我并不需要FollowerWonk 的所有的功能。我能很经济的解决只需要性别分布的问题吗? -因为FollowerWonk 的估算数字看起来比较合理,我试图做一个自己的FollowerWonk 。使用Python和[一些好心的费城人写的Twitter API封装类][5](LCTT译者注:Twitter API封装类是由Mike Taylor等一批费城人在github上开源的一个项目),我开始下载我所有关注的人和我所有的关注者的简介。我马上就发现推特的比例限制是极少的,因此我随机的采样了一部分用户。 +因为 FollowerWonk 的估算数字看起来比较合理,我试图做一个自己的 FollowerWonk 。使用 Python 和[一些好心的费城人写的 Twitter API 封装类][5](LCTT 译注:Twitter API 封装类是由 Mike Taylor 等一批费城人在 github 上开源的一个项目),我开始下载我所有关注的人和我所有的关注者的简介。我马上就发现推特的速率限制是很低,因此我随机的采样了一部分用户。 -我写了一个初步的程序,在所有我关注的人的简介中搜索一个和性别相关的代词。例如,如果简介中包含了“she”或者“her”这样的字眼,可能这就属于一个女性,如果简介中包含了“they”或者”then“,那么可能这就是性别位置的。但是大多数简介中不会出现这些代词。对于这种简介,和性别关联最紧密的信息就是姓名了。例如:@gvanrossum的姓名那一栏是“Guido van Rossum”,第一姓名是“Guido”,这表明@gvanrossum是一个女的。当找不到代词的时候,我就使用第一姓名来评估性别估算数字。 +我写了一个初步的程序,在所有我关注的人的简介中搜索一个和性别相关的代词。例如,如果简介中包含了“she”或者“her”这样的字眼,可能这就属于一个女性,如果简介中包含了“they”或者“them”,那么可能这就是性别未知的。但是大多数简介中不会出现这些代词。对于这种简介,和性别关联最紧密的信息就是姓名了。例如:@gvanrossum 的姓名那一栏是“Guido van Rossum”,第一姓名是“Guido”,这表明 @gvanrossum 是一个女的。当找不到代词的时候,我就使用名字来评估性别估算数字。 -我的脚本把每个名字的一部分传到性别检测机中去检测性别。[性别检测机][6]也有可预见的失败,比如错误的把“Brooklyn Zen Center”当做一个名叫“Brooklyn”的女性,但是它的评估结果与FollowerWonk和Twitter的相比也是很合理的: +我的脚本把每个名字的一部分传到性别检测机中去检测性别。[性别检测机][6]也有可预见的失败,比如错误的把“Brooklyn Zen Center”当做一个名叫“Brooklyn”的女性,但是它的评估结果与 FollowerWonk 和 Twitter 的相比也是很合理的: | | 非男非女 | 男性 | 女性 | 性别未知的 | | ----- | ---- | ---- | ---- | ----- | @@ -53,15 +53,13 @@ FollowerWonk的分析显示我的关注者中81%的人都是男性,很接近 ### 了解你的数字 -我想你们也能检测你们推特关系网的性别分布。所以我每月花费10美元将“Proportional”应用发布到PythonAnywhere这个便利的服务上: +我想你们也能检测你们推特关系网的性别分布。所以我将“Proportional”应用发布到 PythonAnywhere 这个便利的服务上,每月仅需 10 美元: -> - -这个应用可能会在速率上有限制,否则会失败,因此请温柔的对待它。github上放了源代码[代码][7] ,也有命令行的工具。 - -是谁代表了你的推特关系网?你还在忍受那些在过去几十年里一直在谈论的软件的不公平的分布组吗?或者你的关系网看起来像软件行业的未来吗?让我们了解我们的数字并且改善他们。 +> +这个应用可能会在速率上有限制,超过会失败,因此请温柔的对待它。github 上放了源代码[代码][7] ,也有命令行的工具。 +是谁代表了你的推特关系网?你还在忍受那些在过去几十年里一直在谈论的软件行业的不公平的男女分布吗?或者你的关系网看起来像软件行业的未来吗?让我们了解我们的数字并且改善他们。 -------------------------------------------------------------------------------- @@ -69,7 +67,7 @@ via: https://emptysqua.re/blog/gender-of-twitter-users-i-follow/ 作者:[A. Jesse Jiryu Davis][a] 译者:[Flowsnow](https://github.com/Flowsnow) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From f3220bf920ca6af95c39fe98a44a095c22adeb18 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 18 Aug 2016 01:13:36 +0800 Subject: [PATCH 1441/1469] =?UTF-8?q?PUB:20160525=20Getting=20Started=20wi?= =?UTF-8?q?th=20Python=20Programming=20and=20Scripting=20in=20Linux=20?= =?UTF-8?q?=E2=80=93=20Part=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @StdioA --- ...ramming and Scripting in Linux – Part 1.md | 58 ++++++++++--------- 1 file changed, 31 insertions(+), 27 deletions(-) rename {translated/tech => published}/20160525 Getting Started with Python Programming and Scripting in Linux – Part 1.md (76%) diff --git a/translated/tech/20160525 Getting Started with Python Programming and Scripting in Linux – Part 1.md b/published/20160525 Getting Started with Python Programming and Scripting in Linux – Part 1.md similarity index 76% rename from translated/tech/20160525 Getting Started with Python Programming and Scripting in Linux – Part 1.md rename to published/20160525 Getting Started with Python Programming and Scripting in Linux – Part 1.md index 24df8ca66b..a0caa58efa 100644 --- a/translated/tech/20160525 Getting Started with Python Programming and Scripting in Linux – Part 1.md +++ b/published/20160525 Getting Started with Python Programming and Scripting in Linux – Part 1.md @@ -1,21 +1,19 @@ -Linux 平台下 Python 脚本编程入门 – Part 1 +Linux 平台下 Python 脚本编程入门(一) =============================================================================== - 众所周知,系统管理员需要精通一门脚本语言,而且招聘机构列出的职位需求上也会这么写。大多数人会认为 Bash (或者其他的 shell 语言)用起来很方便,但一些强大的语言(比如 Python)会给你带来一些其它的好处。 ![](http://www.tecmint.com/wp-content/uploads/2016/05/Learn-Python-Programming-Scripting-in-Linux.png) -> 在 Linux 中学习 Python 脚本编程 + +*在 Linux 中学习 Python 脚本编程* 首先,我们会使用 Python 的命令行工具,还会接触到 Python 的面向对象特性(这篇文章的后半部分会谈到它)。 -最后,学习 Python - 可以助力于你在[桌面应用开发][2]及[数据科学领域][3]的事业。 +学习 Python 可以助力于你在[桌面应用开发][2]及[数据科学领域][3]的职业发展。 -容易上手,广泛使用,拥有海量“开箱即用”的模块(它是一组包含 Python 声明的外部文件),Python 理所当然地成为了美国计算机专业大学生在一年级时所上的程序设计课所用语言的不二之选。 +容易上手,广泛使用,拥有海量“开箱即用”的模块(它是一组包含 Python 语句的外部文件),Python 理所当然地成为了美国计算机专业大学生在一年级时所上的程序设计课所用语言的不二之选。 -在这个由两篇文章构成的系列中,我们将回顾 Python -的基础部分,希望初学编程的你能够将这篇实用的文章作为一个编程入门的跳板,和日后使用 Python 时的一篇快速指引。 +在这个由两篇文章构成的系列中,我们将回顾 Python 的基础部分,希望初学编程的你能够将这篇实用的文章作为一个编程入门的跳板,和日后使用 Python 时的一篇快速指引。 ### Linux 中的 Python @@ -33,7 +31,8 @@ $ python3 ``` ![](http://www.tecmint.com/wp-content/uploads/2016/05/Running-Python-Commands-on-Linux.png) -> 在 Linux 中运行 Python 命令 + +*在 Linux 中运行 Python 命令* 如果你希望在键入 `python` 时使用 Python 3.x 而不是 2.x,你可以像下面一样更改对应的符号链接: @@ -44,11 +43,12 @@ $ ln -s python3.2 python # Choose the Python 3.x binary here ``` ![](http://www.tecmint.com/wp-content/uploads/2016/05/Remove-Python-2-and-Use-Python-3.png) -> 删除 Python 2,使用 Python 3 + +*删除 Python 2,使用 Python 3* 顺便一提,有一点需要注意:尽管 Python 2.x 仍旧被使用,但它并不会被积极维护。因此,你可能要考虑像上面指示的那样来切换到 3.x。2.x 和 3.x 的语法有一些不同,我们会在这个系列文章中使用后者。 -另一个在 Linux 中使用 Python 的方法是通过 IDLE (the Python Integrated Development Environment),一个为编写 Python 代码而生的图形用户界面。在安装它之前,你最好查看一下适用于你的 Linux 发行版的 IDLE 可用版本。 +另一个在 Linux 中使用 Python 的方法是通过 IDLE (the Python Integrated Development Environment),这是一个为编写 Python 代码而生的图形用户界面。在安装它之前,你最好查看一下适用于你的 Linux 发行版的 IDLE 可用版本。 ``` # aptitude search idle [Debian 及其衍生发行版] @@ -68,23 +68,24 @@ $ sudo aptitude install idle-python3.2 # I'm using Linux Mint 13 1. 轻松打开外部文件 (File → Open); -![](http://www.tecmint.com/wp-content/uploads/2016/05/Python-Shell.png) -> Python Shell + ![](http://www.tecmint.com/wp-content/uploads/2016/05/Python-Shell.png) + + *Python Shell* 2. 复制 (`Ctrl + C`) 和粘贴 (`Ctrl + V`) 文本; 3. 查找和替换文本; -4. 显示可能的代码补全(一个在其他 IDE 里可能叫做 Intellisense 或者 Autocompletion 的功能); +4. 显示可能的代码补全(一个在其他 IDE 里可能叫做“智能感知”或者“自动补完”的功能); 5. 更改字体和字号,等等。 -最厉害的是,你可以用 IDLE 创建桌面工程。 +最厉害的是,你可以用 IDLE 创建桌面应用。 我们在这两篇文章中不会开发桌面应用,所以你可以根据喜好来选择 IDLE 或 Python shell 去运行下面的例子。 ### Python 中的基本运算 -就像你预料的那样,你能够直接进行算术操作(你可以在所有操作中使用足够多的括号!),还可以轻松地使用 Python 拼接字符串。 +就像你预料的那样,你能够直接进行算术操作(你可以在你的所有运算中使用足够多的括号!),还可以轻松地使用 Python 拼接字符串。 -你还可以将运算结果赋给一个变量,然后在屏幕上显示它。Python 有一个叫做输出 (concatenation) 的实用功能——把一串变量和/或字符串用逗号分隔,然后在 print 函数中插入,它会返回一个由你刚才提供的变量依序构成的句子: +你还可以将运算结果赋给一个变量,然后在屏幕上显示它。Python 有一个叫做拼接 (concatenation) 的实用功能——给 print 函数提供一串用逗号分隔的变量和/或字符串,它会返回一个由你刚才提供的变量依序构成的句子: ``` >>> a = 5 @@ -100,15 +101,16 @@ $ sudo aptitude install idle-python3.2 # I'm using Linux Mint 13 如果你尝试在静态类型语言中(如 Java 或 C#)做这件事,它将抛出一个错误。 ![](http://www.tecmint.com/wp-content/uploads/2016/05/Learn-Python-Basic-Operations.png) -> 学习 Python 的基本操作 + +*学习 Python 的基本操作* ### 面向对象编程的简单介绍 -在面向对象编程(OOP)中,程序中的所有实体都会由对象的形式呈现,所以它们可以与其他对象交互。因此,对象拥有属性,而且大多数对象可以完成动作(这被称为对象的方法)。 +在面向对象编程(OOP)中,程序中的所有实体都会由对象的形式呈现,并且它们可以与其他对象交互。因此,对象拥有属性,而且大多数对象可以执行动作(这被称为对象的方法)。 举个例子:我们来想象一下,创建一个对象“狗”。它可能拥有的一些属性有`颜色`、`品种`、`年龄`等等,而它可以完成的动作有 `叫()`、`吃()`、`睡觉()`,诸如此类。 -你可以看到,方法名后面会跟着一对括号,他们当中可能会包含一个或多个参数(向方法中传递的值),也有可能什么都不包含。 +你可以看到,方法名后面会跟着一对括号,括号当中可能会包含一个或多个参数(向方法中传递的值),也有可能什么都不包含。 我们用 Python 的基本对象类型之一——列表来解释这些概念。 @@ -139,19 +141,21 @@ $ sudo aptitude install idle-python3.2 # I'm using Linux Mint 13 >>> rockBands.pop(0) ``` -如果你输入了对象的名字,然后在后面输入了一个点,你可以按 Ctrl + 空格来显示这个对象的可用方法列表。 +如果你输入了对象的名字,然后在后面输入了一个点,你可以按 `Ctrl + space` 来显示这个对象的可用方法列表。 ![](http://www.tecmint.com/wp-content/uploads/2016/05/List-Available-Python-Methods.png) -> 列出可用的 Python 方法 + +*列出可用的 Python 方法* 列表中含有的元素个数是它的一个属性。它通常被叫做“长度”,你可以通过向内建函数 `len` 传递一个列表作为它的参数来显示该列表的长度(顺便一提,之前的例子中提到的 print 语句,是 Python 的另一个内建函数)。 如果你在 IDLE 中输入 `len`,然后跟上一个不闭合的括号,你会看到这个函数的默认语法: ![](http://www.tecmint.com/wp-content/uploads/2016/05/Python-len-Function.png) -> Python 的 len 函数 -现在我们来看看列表中的特定条目。他们也有属性和方法吗?答案是肯定的。比如,你可以将一个字符串条目装换为大写形式,并获取这个字符串所包含的字符数量。像下面这样做: +*Python 的 len 函数* + +现在我们来看看列表中的特定条目。它们也有属性和方法吗?答案是肯定的。比如,你可以将一个字符串条目转换为大写形式,并获取这个字符串所包含的字符数量。像下面这样做: ``` >>> rockBands[0].upper() @@ -162,11 +166,11 @@ $ sudo aptitude install idle-python3.2 # I'm using Linux Mint 13 ### 总结 -在这篇文章中,我们简要介绍了 Python,它的命令行 shell,IDLE,展示了如何执行算术运算,如何在变量中存储数据,如何使用 `print` 函数在屏幕上重新显示那些数据(无论是它们本身还是它们的一部分),还通过一个实际的例子解释了对象的属性和方法。 +在这篇文章中,我们简要介绍了 Python、它的命令行 shell、IDLE,展示了如何执行算术运算,如何在变量中存储数据,如何使用 `print` 函数在屏幕上重新显示那些数据(无论是它们本身还是它们的一部分),还通过一个实际的例子解释了对象的属性和方法。 下一篇文章中,我们会展示如何使用条件语句和循环语句来实现流程控制。我们也会解释如何编写一个脚本来帮助我们完成系统管理任务。 -你是不是想继续学习一些有关 Python 的知识呢?敬请期待本系列的第二部分(我们会将 Python 的慷慨、脚本中的命令行工具与其他部分结合在一起),你还可以考虑购买我们的《终极 Python 编程》系列教程([这里][4]有详细信息)。 +你是不是想继续学习一些有关 Python 的知识呢?敬请期待本系列的第二部分(我们会在脚本中将 Python 和命令行工具的优点结合在一起),你还可以考虑购买我们的《终极 Python 编程》系列教程([这里][4]有详细信息)。 像往常一样,如果你对这篇文章有什么问题,可以向我们寻求帮助。你可以使用下面的联系表单向我们发送留言,我们会尽快回复你。 @@ -176,7 +180,7 @@ via: http://www.tecmint.com/learn-python-programming-and-scripting-in-linux/ 作者:[Gabriel Cánepa][a] 译者:[StdioA](https://github.com/StdioA) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From e62929cb0dd761692029f57205a2a89f4aef01fb Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 18 Aug 2016 21:25:04 +0800 Subject: [PATCH 1442/1469] =?UTF-8?q?20160818-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ystem or Directory Using SSHFS Over SSH.md | 145 ++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 sources/tech/20160811 How to Mount Remote Linux Filesystem or Directory Using SSHFS Over SSH.md diff --git a/sources/tech/20160811 How to Mount Remote Linux Filesystem or Directory Using SSHFS Over SSH.md b/sources/tech/20160811 How to Mount Remote Linux Filesystem or Directory Using SSHFS Over SSH.md new file mode 100644 index 0000000000..6b51e41a9c --- /dev/null +++ b/sources/tech/20160811 How to Mount Remote Linux Filesystem or Directory Using SSHFS Over SSH.md @@ -0,0 +1,145 @@ +How to Mount Remote Linux Filesystem or Directory Using SSHFS Over SSH +============================ + +The main purpose of writing this article is to provide a step-by-step guide on how to mount remote Linux file system using SSHFS client over SSH. + +This article is useful for those users and system administrators who want to mount remote file system on their local systems for whatever purposes. We have practically tested by installing SSHFS client on one of our Linux system and successfully mounted remote file systems. + +Before we go further installation let’s understand about SSHFS and how it works. + +![](http://www.tecmint.com/wp-content/uploads/2012/08/Sshfs-Mount-Remote-Linux-Filesystem-Directory.png) +>Sshfs Mount Remote Linux Filesystem or Directory + +### What Is SSHFS? + +SSHFS stands for (Secure SHell FileSystem) client that enable us to mount remote filesystem and interact with remote directories and files on a local machine using SSH File Transfer Protocol (SFTP). + +SFTP is a secure file transfer protocol that provides file access, file transfer and file management features over Secure Shell protocol. Because SSH uses encryption while transferring files over the network from one computer to another computer and SSHFS comes with built-in FUSE (Filesystem in Userspace) kernel module that allows any non-privileged users to create their file system without modifying kernel code. + +In this article, we will show you how to install and use SSHFS client on any Linux distribution to mount remote Linux filesystem or directory on a local Linux machine. + +#### Step 1: Install SSHFS Client in Linux Systems + +By default sshfs packages does not exists on all major Linux distributions, you need to enable [epel repository][1] under your Linux systems to install sshfs with the help of Yum command with their dependencies. + +``` +# yum install sshfs +# dnf install sshfs [On Fedora 22+ releases] +$ sudo apt-get install sshfs [On Debian/Ubuntu based systems] +``` + +#### Step 2: Creating SSHFS Mount Directory + +Once the sshfs package installed, you need to create a mount point directory where you will mount your remote file system. For example, we have created mount directory under /mnt/tecmint. + +``` +# mkdir /mnt/tecmint +$ sudo mkdir /mnt/tecmint [On Debian/Ubuntu based systems] +``` + +### Step 3: Mounting Remote Filesystem with SSHFS + +Once you have created your mount point directory, now run the following command as a root user to mount remote file system under /mnt/tecmint. In your case the mount directory would be anything. + +The following command will mount remote directory called /home/tecmint under /mnt/tecmint in local system. (Don’t forget replace x.x.x.x with your IP Address and mount point). + +``` +# sshfs tecmint@x.x.x.x:/home/tecmint/ /mnt/tecmint +$ sudo sshfs -o allow_other tecmint@x.x.x.x:/home/tecmint/ /mnt/tecmint [On Debian/Ubuntu based systems] +``` + +If your Linux server is configured with SSH key based authorization, then you will need to specify the path to your public keys as shown in the following command. + +``` +# sshfs -o IdentityFile=~/.ssh/id_rsa tecmint@x.x.x.x:/home/tecmint/ /mnt/tecmint +$ sudo sshfs -o allow_other,IdentityFile=~/.ssh/id_rsa tecmint@x.x.x.x:/home/tecmint/ /mnt/tecmint [On Debian/Ubuntu based systems] +``` + +#### Step 4: Verifying Remote Filesystem is Mounted + +If you have run the above command successfully without any errors, you will see the list of remote files and directories mounted under /mnt/tecmint. + +``` +# cd /mnt/tecmint +# ls +[root@ tecmint]# ls +12345.jpg ffmpeg-php-0.6.0.tbz2 Linux news-closeup.xsl s3.jpg +cmslogs gmd-latest.sql.tar.bz2 Malware newsletter1.html sshdallow +epel-release-6-5.noarch.rpm json-1.2.1 movies_list.php pollbeta.sql +ffmpeg-php-0.6.0 json-1.2.1.tgz my_next_artical_v2.php pollbeta.tar.bz2 +``` + +#### Step 5: Checking Mount Point with df -hT Command + +If you run df -hT command you will see the remote file system mount point. + +``` +# df -hT +``` + +Sample Output + +``` +Filesystem Type Size Used Avail Use% Mounted on +udev devtmpfs 730M 0 730M 0% /dev +tmpfs tmpfs 150M 4.9M 145M 4% /run +/dev/sda1 ext4 31G 5.5G 24G 19% / +tmpfs tmpfs 749M 216K 748M 1% /dev/shm +tmpfs tmpfs 5.0M 4.0K 5.0M 1% /run/lock +tmpfs tmpfs 749M 0 749M 0% /sys/fs/cgroup +tmpfs tmpfs 150M 44K 150M 1% /run/user/1000 +tecmint@192.168.0.102:/home/tecmint fuse.sshfs 324G 55G 253G 18% /mnt/tecmint +``` + +#### Step 6: Mounting Remote Filesystem Permanently + +To mount remote filesystem permanently, you need to edit the file called /etc/fstab. To do, open the file with your favorite editor. + +``` +# vi /etc/fstab +$ sudo vi /etc/fstab [On Debian/Ubuntu based systems] +``` + +Go to the bottom of the file and add the following line to it and save the file and exit. The below entry mount remote server file system with default settings. + +``` +sshfs#tecmint@x.x.x.x:/home/tecmint/ /mnt/tecmint fuse.sshfs defaults 0 0 +``` + +Make sure you’ve [SSH Passwordless Login][2] in place between servers to auto mount filesystem during system reboots.. + +``` +sshfs#tecmint@x.x.x.x:/home/tecmint/ /mnt/tecmint fuse.sshfs IdentityFile=~/.ssh/id_rsa defaults 0 0 +``` + +Next, you need to update the fstab file to reflect the changes. + +``` +# mount -a +$ sudo mount -a [On Debian/Ubuntu based systems] +``` + +#### Step 7: Unmounting Remote Filesystem + +To unmount remote filesystem, jun issue the following command it will unmount the remote file system. + +``` +# umount /mnt/tecmint +``` + +That’s all for now, if you’re facing any difficulties or need any help in mounting remote file system, please contact us via comments and if you feel this article is much useful then share it with your friends. + + +------------------------------------------------------------------------------- + +via: http://www.tecmint.com/sshfs-mount-remote-linux-filesystem-directory-using-ssh/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tecmint+%28Tecmint%3A+Linux+Howto%27s+Guide%29 + +作者:[Ravi Saive][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.tecmint.com/author/admin/ +[1]: http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/ +[2]: http://www.tecmint.com/ssh-passwordless-login-using-ssh-keygen-in-5-easy-steps/ From d4e9624498af686bf5984afdfeb1725f4a284742 Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 19 Aug 2016 10:27:29 +0800 Subject: [PATCH 1443/1469] =?UTF-8?q?20160819-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20160811 5 best linux init system.md | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 sources/tech/20160811 5 best linux init system.md diff --git a/sources/tech/20160811 5 best linux init system.md b/sources/tech/20160811 5 best linux init system.md new file mode 100644 index 0000000000..460acdef3f --- /dev/null +++ b/sources/tech/20160811 5 best linux init system.md @@ -0,0 +1,103 @@ +5 Best Modern Linux ‘init’ Systems (1992-2015) +============================================ + +In Linux and other Unix-like operating systems, the init (initialization) process is the first process executed by the kernel at boot time. It has a process ID (PID) of 1, it is executed in the background until the system is shut down. + +The init process starts all other processes, that is daemons, services and other background processes, therefore, it is the mother of all other processes on the system. A process can start many other child processes on the system, but in the event that a parent process dies, init becomes the parent of the orphan process. + +![](http://www.tecmint.com/wp-content/uploads/2016/08/Linux-init-Systems.png) + +Over the years, many init systems have emerged in major Linux distributions and in this guide, we shall take a look at some of the best init systems you can work with on the Linux operating system. + +### 1. System V Init + +System V (SysV) is a mature and popular init scheme on Unix-like operating systems, it is the parent of all processes on a Unix/Linux system. SysV is the first commercial Unix operating system designed. + +Almost all Linux distributions first used SysV init scheme except Gentoo which has a custom init and Slackware using BSD-style init scheme. + +As years have passed by, due to some imperfections, several SysV init replacements have been developed in quests to create more efficient and perfect init systems for Linux. + +Although these alternatives seek to improve SysV and probably offer new features, they are still compatible with original SysV init scripts. + +### 2. SystemD + +SystemD is a relatively new init scheme on the Linux platform. Introduced in Fedora 15, its is an assortment of tools for easy system management. The main purpose is to initialize, manage and keep track of all system processes in the boot process and while the system is running. + +Systemd init is comprehensively distinct from other traditional Unix init systems, in the way it practically approaches system and services management. It is also compatible with SysV and LBS init scripts. + +It has some of the following eminent features: + +- Clean, straightforward and efficient design +- Concurrent and parallel processing at bootup +- Better APIv +- Enables removal of optional processes +- Supports event logging using journald +- Supports job scheduling using systemd calender timers +- Storage of logs in binary files +- Preservation of systemd state for future reference +- Better integration with GNOME plus many more + +Read the Systemd init Overview: + +### 3. Upstart + +Upstart is an event-based init system developed by makers of Ubuntu as a replacement for SysV init system. It starts different system tasks and processes, inspects them while the system is running and stops them during system shut down. + +It is a hybrid init system which uses both SysV startup scripts and also Systemd scripts, some of the notable features of Upstart init system include: + +- Originally developed for Ubuntu Linux but can run on all other distributions +- Event-based starting and stopping of tasks and services +- Events are generated during starting and stopping of tasks and services +- Events can be sent by other system processes +- Communication with init process through D-Bus +- Users can start and stop their own processes +- Re-spawning of services that die abruptly and many more + +Visit Homepage: + +### 4. OpenRC + +OpenRC is a dependency-based init scheme for Unix-like operating systems, it is compatible with SysV init. As much as it brings some improvements to Sys V, you must keep in mind that OpenRC is not an absolute replacement for /sbin/init file. + +It offers some illustrious features and these include: + +- It can run on other many Linux distributions including Gentoo and also on BSD +- Supports hardware initiated init scripts +- Supports a single configuration file +- No per-service configurations supported +- Runs as a daemon +- Parallel services startup and many more + +Visit Homepage: + +### 5. runit + +runit is also a cross-platform init system that can run on GNU/Linux, Solaris, *BSD and Mac OS X and it is an alternative for SysV init, that offers service supervision. + +It comes with some benefits and remarkable components not found in SysV init and possibly other init systems in Linux and these include: + +Service supervision, where each service is associated with a service directory +Clean process state, it guarantees each process a clean state +It has a reliable logging facility +Fast system boot up and shutdown +It is also portable +Packaging friendly +Small code size and many more +Visit Homepage: + +As I had earlier on mentioned, the init system starts and manages all other processes on a Linux system. Additionally, SysV is the primary init scheme on Linux operating systems, but due to some performance weaknesses, system programmers have developed several replacements for it. + +And here, we looked at a few of those replacements, but there could be other init systems that you think are worth mentioning in this list. You can let us know of them via the comment section below. + + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/best-linux-init-systems/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tecmint+%28Tecmint%3A+Linux+Howto%27s+Guide%29 + +作者:[Aaron Kili ][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/aaronkili/ From 6d258b9e209176cb269ac5d7fe17cd5346a35765 Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 19 Aug 2016 10:31:26 +0800 Subject: [PATCH 1444/1469] =?UTF-8?q?20160819-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ow Awk to Use Shell Variables – Part 11.md | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 sources/tech/awk/20160802 How to Allow Awk to Use Shell Variables – Part 11.md diff --git a/sources/tech/awk/20160802 How to Allow Awk to Use Shell Variables – Part 11.md b/sources/tech/awk/20160802 How to Allow Awk to Use Shell Variables – Part 11.md new file mode 100644 index 0000000000..b08f3fa15d --- /dev/null +++ b/sources/tech/awk/20160802 How to Allow Awk to Use Shell Variables – Part 11.md @@ -0,0 +1,106 @@ +How to Allow Awk to Use Shell Variables – Part 11 +=========================================== + +When we write shell scripts, we normally include other smaller programs or commands such as Awk operations in our scripts. In the case of Awk, we have to find ways of passing some values from the shell to Awk operations. + +This can be done by using shell variables within Awk commands, and in this part of the series, we shall learn how to allow Awk to use shell variables that may contain values we want to pass to Awk commands. + +There possibly two ways you can enable Awk to use shell variables: + +### 1. Using Shell Quoting + +Let us take a look at an example to illustrate how you can actually use shell quoting to substitute the value of a shell variable in an Awk command. In this example, we want to search for a username in the file /etc/passwd, filter and print the user’s account information. + +Therefore, we can write a `test.sh` script with the following content: + +``` +#!/bin/bash + +#read user input +read -p "Please enter username:" username + +#search for username in /etc/passwd file and print details on the screen +cat /etc/passwd | awk "/$username/ "' { print $0 }' +``` + +Thereafter, save the file and exit. + +Interpretation of the Awk command in the test.sh script above: + +``` +cat /etc/passwd | awk "/$username/ "' { print $0 }' +``` + +`"/$username/ "` – shell quoting used to substitute value of shell variable username in Awk command. The value of username is the pattern to be searched in the file /etc/passwd. + +Note that the double quote is outside the Awk script, `‘{ print $0 }’`. + +Then make the script executable and run it as follows: + +``` +$ chmod +x test.sh +$ ./text.sh +``` + +After running the script, you will be prompted to enter a username, type a valid username and hit Enter. You will view the user’s account details from the /etc/passwd file as below: + +![](http://www.tecmint.com/wp-content/uploads/2016/08/Shell-Script-to-Find-Username-in-Passwd-File.png) + +### 2. Using Awk’s Variable Assignment + +This method is much simpler and better in comparison to method one above. Considering the example above, we can run a simple command to accomplish the job. Under this method, we use the -v option to assign a shell variable to a Awk variable. + +Firstly, create a shell variable, username and assign it the name that we want to search in the /etc/passswd file: + +``` +username="aaronkilik" +``` + +Then type the command below and hit Enter: + +``` +# cat /etc/passwd | awk -v name="$username" ' $0 ~ name {print $0}' +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/08/Find-Username-in-Password-File-Using-Awk.png) + +Explanation of the above command: + +- `-v` – Awk option to declare a variable +- `username` – is the shell variable +- `name` – is the Awk variable + +Let us take a careful look at `$0 ~ name` inside the Awk script, `' $0 ~ name {print $0}'`. Remember, when we covered Awk comparison operators in Part 4 of this series, one of the comparison operators was value ~ pattern, which means: true if value matches the pattern. + +The `output($0)` of cat command piped to Awk matches the pattern (aaronkilik) which is the name we are searching for in /etc/passwd, as a result, the comparison operation is true. The line containing the user’s account information is then printed on the screen. + +### Conclusion + +We have covered an important section of Awk features, that can help us use shell variables within Awk commands. Many times, you will write small Awk programs or commands within shell scripts and therefore, you need to have a clear understanding of how to use shell variables within Awk commands. + +In the next part of the Awk series, we shall dive into yet another critical section of Awk features, that is flow control statements. So stay tunned and let’s keep learning and sharing. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/use-shell-script-variable-in-awk/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tecmint+%28Tecmint%3A+Linux+Howto%27s+Guide%29 + +作者:[Aaron Kili][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/aaronkili/ + + + + + + + + + + + + + From 065a34868642f80d0122b2f5ce68f7af405e8966 Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 19 Aug 2016 10:43:16 +0800 Subject: [PATCH 1445/1469] =?UTF-8?q?20160819-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...08 Simple Python Framework from Scratch.md | 461 ++++++++++++++++++ 1 file changed, 461 insertions(+) create mode 100644 sources/tech/20160608 Simple Python Framework from Scratch.md diff --git a/sources/tech/20160608 Simple Python Framework from Scratch.md b/sources/tech/20160608 Simple Python Framework from Scratch.md new file mode 100644 index 0000000000..f4e7ce0518 --- /dev/null +++ b/sources/tech/20160608 Simple Python Framework from Scratch.md @@ -0,0 +1,461 @@ +Simple Python Framework from Scratch +=================================== + +Why would you want to build a web framework? I can think of a few reasons: + +- Novel idea that will displace other frameworks. +- Get some mad street cred. +- Your problem domain is so unique that other frameworks don't fit. +- You're curious how web frameworks work because you want to become a better web developer. + +I'll focus on the last point. This post aims to describe what I learned by writing a small server and framework by explaining the design and implementation process step by step, function by function. The complete code for this project can be found in this [repository][1]. + +I hope this encourages other people to try because the it was fun, taught me a lot about how web applications work, and it was a lot easier than I thought! + +### Scope + +Frameworks handle things like the request-response cycle, authentication, database access, generating templates, and lots more. Web developers use frameworks because most web applications share a lot of functionality and it doesn't make sense to re-implement all of that for every project. + +Bigger frameworks like Rails or Django operate on a high level of abstraction and are said to be "batteries-included". It would take thousands of man-hours to implement all of those features so it's important to focus on tiny subset for this project. Before setting down a single line of code I created a list of features and constraints. + +Features: + +- Must handle GET and POST HTTP requests. You can get a brief overview of HTTP in [this wiki article][2]). +- Must be asynchronous (I'm loving the Python 3 asyncio module). +- Must include simple routing logic along with capturing parameters. +- Must provide a simple user-facing API like other cool microframeworks. +- Must handle authentication, because it's cool to learn that too (saved for Part 2). + +Constraints: + +- Will only handle a small subset of HTTP/1.1: no transfer-encoding, no http-auth, no content-encoding (gzip), no [persistant connections][3]. +- No MIME-guessing for responses - users will have to set this manually. +- No WSGI - just simple TCP connection handling. +- No database support. + +I decided a small use case would make the above more concrete. It would also demonstrate the framework's API: + +``` +from diy_framework import App, Router +from diy_framework.http_utils import Response + + +# GET simple route +async def home(r): + rsp = Response() + rsp.set_header('Content-Type', 'text/html') + rsp.body = 'test' + return rsp + + +# GET route + params +async def welcome(r, name): + return "Welcome {}".format(name) + +# POST route + body param +async def parse_form(r): + if r.method == 'GET': + return 'form' + else: + name = r.body.get('name', '')[0] + password = r.body.get('password', '')[0] + + return "{0}:{1}".format(name, password) + +# application = router + http server +router = Router() +router.add_routes({ + r'/welcome/{name}': welcome, + r'/': home, + r'/login': parse_form,}) + +app = App(router) +app.start_server() +``` + +The user is supposed to be able to define a few asynchronous functions that either return strings or Response objects, then pair those functions up with strings that represent routes, and finally start handling requests with a single function call (start_server). + +Having created the designs, I condensed it into abstract things I needed to code up: + +- Something that should accept TCP connections and schedule an asynchronous function to handle them. +- Something to parse raw text into some kind of abstracted container. +- Something to decide which function should be called for each request. +- Something that bundles all of the above together and presents a simple interface to a developer. + +I started by writing tests that were essentially contracts describing each piece of functionality. After a few refactorings, the layout settled into a handful of composable pieces. Each piece is relatively decoupled from the other components, which is especially beneficial in this case because each piece can be studied on its own. The pieces are concrete reflections of the abstractions that I listed above: + +- A HTTPServer object that holds onto a Router object and a http_parser module and uses them to initialize... +- HTTPConnection objects, where each one represents a single client HTTP connection and takes care of the request-response cycle: parses incoming bytes into a Request object using the http_parser module; uses an instance of Router to find the correct function to call to generate a response; finally send the response back to the client. +- A pair of Request and Response objects that give a user a comfortable way to work with what are in essence specially formatted strings of bytes. The user shouldn't be aware of the correct message format or delimiters. +- A Router object that contains route:function pairs. It exposes a way to add these pairs and a way, given a URL path, to find a function. +- Finally, an App object that contains configuration and uses it to instantiate a HTTPServer instance. + +Let's go over each of these pieces, starting from HTTPConnection. + +### Modelling Asynchronous Connections + +To satisfy the contraints, each HTTP request is a separate TCP connection. This makes request handling slower because of the relatively high cost of establishing multiple TCP connections (cost of DNS lookup, hand-shake, [Slow Start][4], etc.) but it's much easier to model. For this task, I chose the fairly high-level [asyncio-stream][5] module that rests on top of [asyncio's transports and protocols][6]. I recommend checking out the code for it in the stdlib because it's a joy to read! + +An instance of HTTPConnection handles multiple tasks. First, it reads data incrementally from a TCP connection using an asyncio.StreamReader object and stores it in a buffer. After each read operation, it tries to parse whatever is in the buffer and build out a Request object. Once it receives the whole request, it generates a reply and sends it back to the client through an asyncio.StreamWriter object. It also handles two more tasks: timing out a connection and handling errors. + +You can view the complete code for the class [here][7]. I'll introduce each part of the code separately, with the docstrings removed for brevity: + +``` +class HTTPConnection(object): + def init(self, http_server, reader, writer): + self.router = http_server.router + self.http_parser = http_server.http_parser + self.loop = http_server.loop + + self._reader = reader + self._writer = writer + self._buffer = bytearray() + self._conn_timeout = None + self.request = Request() +``` + +The init method is boring: it just collects objects to work with later. It stores a router, an http_parser, and loop objects, which are used to generate responses, parse requests, and schedule things in the event loop. + +Next, it stores the reader-writer pair, which together represent a TCP connection, and an empty [bytearray][8] that serves as buffer for raw bytes. _conn_timeout stores an instance of [asyncio.Handle][9] that is used to manage the timeout logic. Finally, it also stores a single instance of Request. + +The following code handles the core functionality of receiving and sending data: + +``` +async def handle_request(self): + try: + while not self.request.finished and not self._reader.at_eof(): + data = await self._reader.read(1024) + if data: + self._reset_conn_timeout() + await self.process_data(data) + if self.request.finished: + await self.reply() + elif self._reader.at_eof(): + raise BadRequestException() + except (NotFoundException, + BadRequestException) as e: + self.error_reply(e.code, body=Response.reason_phrases[e.code]) + except Exception as e: + self.error_reply(500, body=Response.reason_phrases[500]) + + self.close_connection() +``` + +Everything here is closed in a try-except block so that any exceptions thrown during parsing a request or replying to one are caught and an error response is sent back to the client. + +The request is read inside of a while loop until the parser sets self.request.finished = True or until the client closed the connection, signalled by self._reader.at_eof() method returning True. The code tries to read data from a StreamReader on every iteration of the loop and incrementally build out self.request through the call to self.process_data(data). The connection timeout timer is reset everytime the loop reads any data. + +There's an error in there - can you spot it? I'll get back to it shortly. I also have to note that this loop can potentially eat up all of the CPU because self._reader.read() returns b'' objects if there is nothing to read - meaning the loop will cycle millions of times, doing nothing. A possible solution here would be to wait a bit of time in a non-blocking fashion: await asyncio.sleep(0.1). I'll hold off on optimizing this until it's needed. + +Remember the error that I mentioned at the start of the previous paragraph? The self._reset_conn_timeout() method is called only when data is read from the StreamReader. The way it's set up now means that the timeout is not initiated until the first byte arrives. If a client opens a connection to the server and doesn't send any data - it never times out. This could be used to exhaust system resources and cause a denial of service. The fix is to simply call self._reset_conn_timeout() in the init method. + +When the request is received or when the connection drops, the code hits an if-else block. This block determines if the parser, having received all the data, finished parsing the request? Yes? Great - generate a reply and send it back! No? Uh-oh - something's wrong with the request - raise an exception! Finally, self.close_connection is called to perform cleanup. + +Parsing the parts of a request is done inside the self.process_data method. It's a very short and simple method that's easy to test: + +``` +async def process_data(self, data): + self._buffer.extend(data) + + self._buffer = self.http_parser.parse_into( + self.request, self._buffer) +``` + +Each call accumulates data into self._buffer and then tries to parse whatever has gathered inside of the buffer using self.http_parser. It's worth pointing out here that this code exhibits a pattern called [Dependency Injection][10]. If you remember the init function, you know that I pass in a http_server object, which contains a http_parser object. In this case, the http_parser object is a module that is part of the diy_framework package, but it could potentially be anything else that has a parse_into function that accepts a Request object and a bytearray. This is useful for two reasons. First, it means that this code is easier to extend. Someone could come along and want to use HTTPConnection with a different parser - no problem - just pass it in as an argument! Second, it makes testing much easier because the http_parser is not hard coded anywhere so replacing it with a dummy or [mock][11] object is super easy. + +The next interesting piece is the reply method: + +``` +async def reply(self): + request = self.request + handler = self.router.get_handler(request.path) + + response = await handler.handle(request) + + if not isinstance(response, Response): + response = Response(code=200, body=response) + + self._writer.write(response.to_bytes()) + await self._writer.drain() +``` + +Here, an instance of HTTPConnection uses a router object it got from the HTTPServer (another example of Dependency Injection) to obtain an object that will generate a response. A router can be anything that has a get_handler method that accepts a string and returns a callable or raises a NotFoundException. The callable object is then used to process the request and generate a response. Handlers are written by the users of the framework, as outlined in use case above, and should return either strings or Response objects. Response objects give us a nice interface so the simple if block ensures that whatever a handler returns, the code further along ends up with a uniform Response object. + +Next, the StreamWriter instance assigned to self._writer is called to send back a string of bytes to the client. Before the function returns, it awaits at await self._writer.drain(), which ensures that all the data has been sent to the client. This ensures that a call to self._writer.close won't happen when there is still unsent data in the buffer. + +There are two more interesting parts of the HTTPConnection class: a method that closes the connection and a group of methods that handle the timeout mechanism. First, closing a connection is accomplished by this little function: + +``` +def close_connection(self): + self._cancel_conn_timeout() + self._writer.close() +``` + +Any time a connection is to be closed, the code has to first cancel the timeout to clean it out of the event loop. + +The timeout mechanism is a set of three related functions: a function that acts on the timeout by sending an error message to the client and closing the connection; a function that cancels the current timeout; and a function that schedules the timeout. The first two are simple and I add them for completeness, but I'll explain the third one — _reset_conn_timeout — in more detail. + +``` +def _conn_timeout_close(self): + self.error_reply(500, 'timeout') + self.close_connection() + +def _cancel_conn_timeout(self): + if self._conn_timeout: + self._conn_timeout.cancel() + +def _reset_conn_timeout(self, timeout=TIMEOUT): + self._cancel_conn_timeout() + self._conn_timeout = self.loop.call_later( + timeout, self._conn_timeout_close) +``` + +Everytime _reset_conn_timeout is called, it first cancels any previously set asyncio.Handle object assigned to self._conn_timeout. Then, using the BaseEventLoop.call_later function, it schedules the _conn_timeout_close function to run after timeout seconds. If you remember the contents of the handle_request function, you'll know that this function gets called every time any data is received. This cancels any existing timeout and re-schedules the _conn_timeout_close function timeout seconds in the future. As long as there is data coming, this cycle will keep resetting the timeout callback. If no data is received inside of timeout seconds, the _conn_timeout_close finally gets called. + +### Creating the Connections + +Something has to create HTTPConnection objects and it has to do it correctly. This task is delegated to the HTTPServer class, which is a very simple container that helps to store some configuration (the parser, router, and event loop instances) and then use that configuration to create instances of HTTPConnection: + +``` +class HTTPServer(object): + def init(self, router, http_parser, loop): + self.router = router + self.http_parser = http_parser + self.loop = loop + + async def handle_connection(self, reader, writer): + connection = HTTPConnection(self, reader, writer) + asyncio.ensure_future(connection.handle_request(), loop=self.loop) +``` + +Each instance of HTTPServer can listen on one port. It has an asynchronous handle_connection method that creates instances of HTTPConnection and schedules them for execution in the event loop. This method is passed to [asyncio.start_server][12] and serves as a callbacks: it's called every time a TCP connection is initiated with a StreamReader and StreamWriter as the arguments. + +``` + self._server = HTTPServer(self.router, self.http_parser, self.loop) + self._connection_handler = asyncio.start_server( + self._server.handle_connection, + host=self.host, + port=self.port, + reuse_address=True, + reuse_port=True, + loop=self.loop) +``` + +This forms the core of how the application works: asyncio.start_server accepts TCP connections and calls a method on a preconfigured HTTPServer object. This method handles all the logic for a single connection: reading, parsing, generating and sending a reply back to the client, and closing the connection. It focuses on IO logic and coordinates parsing and generating a reply. + +With the core IO stuff out of the way lets move on over to... + +### Parsing Requests + +The users of this tiny framework are spoiled and don't want to work with bytes. They want a higher level of abstraction - a more convenientt way of working with requests. The tiny framework includes a simple HTTP parser that transforms bytes into Request objects. + +These Request objects are containers that looks like: + +``` +class Request(object): + def init(self): + self.method = None + self.path = None + self.query_params = {} + self.path_params = {} + self.headers = {} + self.body = None + self.body_raw = None + self.finished = False +``` + +It has everything that a developer needs in order to accept data coming from a client in an easily understandable package. Well, everything except cookies, which are crucial in order to do things like authentication. I'll leave that for part 2. + +Each HTTP request contains certain required pieces - like the path or the method. It also contains certain optional pieces like the body, headers, or URL parameters. Furthermore, owing to the popularity of REST, the URL, minus the URL parameters, may also contain pieces of information eg. "/users/1/edit" contains a user's id. + +Each part of a request has to be identified, parsed, and assigned to the correct part of a Request object. The fact that HTTP/1.1 is text protocol simplifies things (HTTP/2 is binary protocol - whole 'nother level of fun). + +The http_parser module is a group of functions inside because the parser does not need to keep track of state. Instead, the calling code has to manage a Request object and pass it into the parse_into function along with a bytearray containing the raw bytes of a request. To this end, the parser modifies both the request object as well as the bytearray buffer passed to it. The request object gets fuller and fuller while the bytearray buffer gets emptier and emptier. + +The core functionality of the http_parser module is inside the parse_into function: + +``` +def parse_into(request, buffer): + _buffer = buffer[:] + if not request.method and can_parse_request_line(_buffer): + (request.method, request.path, + request.query_params) = parse_request_line(_buffer) + remove_request_line(_buffer) + + if not request.headers and can_parse_headers(_buffer): + request.headers = parse_headers(_buffer) + if not has_body(request.headers): + request.finished = True + + remove_intro(_buffer) + + if not request.finished and can_parse_body(request.headers, _buffer): + request.body_raw, request.body = parse_body(request.headers, _buffer) + clear_buffer(_buffer) + request.finished = True + return _buffer +``` + +As you can see in the code above, I divided the parsing process into three parts: parsing the request line (the line that goes GET /resource HTTP/1.1), parsing the headers, and parsing the body. + +The request line contains the HTTP method and the URL. The URL in turn contains yet more information: the path, url parameters, and developer defined url parameters. Parsing out the method and URL is easy - it's a matter of splitting the string appropriately. The urlparse.parse function is used to parse out the URL parameters, if any, from the URL. The developer defined url parameters are extracted using regular expressions. + +Next up are the HTTP headers. These are simply lines of text that are key-value pairs. The catch is that a there may be multiple headers of the same name but with different values. An important header to watch out for is the Content-Length header that specifies the length of the body (not the whole request, just the body!), which is important in determining whether to parse the body at all. + +Finally, the parser looks at the HTTP method and headers and decides whether to parse the request's body. + +### Routing! + +The router is a bridge between the framework and the user in the sense that the user creates a Router object and fills it with path/function pairs using the appropriate methods and then gives the Router object to the App. The App object in turn uses the get_handler function to get a hold of a callable that generates a response. In short, the router is responsible for two things - storing pairs of paths/functions and handing back a pair to whatever asks for one. + +There are two methods in the Router class that allow an end-developer to add routes: add_routes and add_route. Since add_routes is a convenient wrapper around add_route, I'll skip describing it and focus on add_route: + +``` +def add_route(self, path, handler): + compiled_route = self.class.build_route_regexp(path) + if compiled_route not in self.routes: + self.routes[compiled_route] = handler + else: + raise DuplicateRoute +``` + +This method first "compiles" a route — a string like '/cars/{id}' — into a compiled regexp object using the Router.build_route_regexp class method. These compiled regexp objects serve both to match a request's path and to extract developer defined URL parameters specified by that route. Next there's a check that raises an exception if the same route already exists, and finally the route/handler pair is added to a simple dictionary — self.routes. + +Here's how the Router "compiles" routes: + +``` +@classmethod +def build_route_regexp(cls, regexp_str): + """ + Turns a string into a compiled regular expression. Parses '{}' into + named groups ie. '/path/{variable}' is turned into + '/path/(?P[a-zA-Z0-9_-]+)'. + + :param regexp_str: a string representing a URL path. + :return: a compiled regular expression. + """ + def named_groups(matchobj): + return '(?P<{0}>[a-zA-Z0-9_-]+)'.format(matchobj.group(1)) + + re_str = re.sub(r'{([a-zA-Z0-9_-]+)}', named_groups, regexp_str) + re_str = ''.join(('^', re_str, '$',)) + return re.compile(re_str) +``` + +The method uses regular expressions to substitute all occurrences of "{variable}" with named regexp groups: "(?P...)". Then it adds the ^ and $ regexp signifiers at the beginning and end of the resulting string, and finally compiles regexp object out of it. + +Storing a route is just half the battle, here's how to get one back: + +``` +def get_handler(self, path): + logger.debug('Getting handler for: {0}'.format(path)) + for route, handler in self.routes.items(): + path_params = self.class.match_path(route, path) + if path_params is not None: + logger.debug('Got handler for: {0}'.format(path)) + wrapped_handler = HandlerWrapper(handler, path_params) + return wrapped_handler + + raise NotFoundException() +``` + +Once the App has a Request object, it also has the path part of the URL (ie. /users/15/edit). Having that, it needs a matching function to generate the response or a 404 error. get_handler takes a path as an argument, loops over routes and calls the Router.match_path class method on each one to check if any compiled regexp matches the request's path. If it does, it wraps the route's function in a HandleWrapper. The path_params dictionary contains path variables (ie. the '15' from /users/15/edit) or is left empty if the route doesn't specify any variables. Finally it returns the wrapped route's function to the App. + +If the code iterates through all the routes and none of them matches the path, the function raises a NotFoundException. + +The Route.match class method is simple: + +``` +def match_path(cls, route, path): + match = route.match(path) + try: + return match.groupdict() + except AttributeError: + return None +``` + +It uses the regexp object's match method to check if the route and path matches. It returns None on no matches. + +Finally, we have the HandleWrapper class. Its only job is to wrap an asynchronous function, store the path_params dictionary, and expose a uniform interface through the handle method: + +``` +class HandlerWrapper(object): + def init(self, handler, path_params): + self.handler = handler + self.path_params = path_params + self.request = None + + async def handle(self, request): + return await self.handler(request, **self.path_params) +``` + +### Bringing it All Together + +The last piece of the framework is the one that ties everything together — the App class. + +The App class serves to gather all the configuration details. An App object uses its single method — start_server — to create an instance of HTTPServer using some of the configuration data, and then feed it to the function asyncio.start_server more info here. The asyncio.start_server function will call the HTTPServer object's handle_connection method for every incoming TCP connection: + +``` +def start_server(self): + if not self._server: + self.loop = asyncio.get_event_loop() + self._server = HTTPServer(self.router, self.http_parser, self.loop) + self._connection_handler = asyncio.start_server( + self._server.handle_connection, + host=self.host, + port=self.port, + reuse_address=True, + reuse_port=True, + loop=self.loop) + + logger.info('Starting server on {0}:{1}'.format( + self.host, self.port)) + self.loop.run_until_complete(self._connection_handler) + + try: + self.loop.run_forever() + except KeyboardInterrupt: + logger.info('Got signal, killing server') + except DiyFrameworkException as e: + logger.error('Critical framework failure:') + logger.error(e.traceback) + finally: + self.loop.close() + else: + logger.info('Server already started - {0}'.format(self)) +``` + +### Lessons learned + +If you look at the repo, you'll notice that the whole thing is roughly 320 lines of code if you don't count the tests (it's ~540 if you do). It really surprised me that it's possible to fit so much functionality in so little code. Granted, this framework does not offer useful pieces like templates, authentication, or database access, but hey, it's something fun to work on :). This also gave me an idea how other framework like Django or Tornado work at a general level and it's already paying off in how quickly I'm able to debug things. + +This is also the first project that I did in true TDD fashion and it's just amazing how pleasant and productive the process was. Writing tests first forced me to think about design and architecture and not just on gluing bits of code together to "make it work". Don't get me wrong, there are many scenarios when the latter approach is preferred, but if you're placing a premium on low-maintenance code that you and others will be able to work in weeks or months in the future then TDD is exactly what you need. + +I explored things like [the Clean Architecture][13] and dependency injection, which is most evident in how the Router class is a higher-level abstraction (Entity?) that's close to the "core" whereas pieces like the http_parser or App are somewhere on the outer edges because they do either itty-bitty string or bytes work or interface with mid-level IO stuff. Whereas TDD forced me to think about each small part separately, this made me ask myself questions like: Does this combination of method calls compose into an understandable action? Do the class names accurately reflect the problem that I'm solving? Is it easy to distinguish different levels of abstraction in my code? + +Go ahead, write a small framework, it's a ton of fun! + +-------------------------------------------------------------------------------- + +via: http://mattscodecave.com/posts/simple-python-framework-from-scratch.html + +作者:[Matt][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://mattscodecave.com/hire-me.html +[1]: https://github.com/sirMackk/diy_framework +[2]:https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol +[3]: https://en.wikipedia.org/wiki/HTTP_persistent_connection +[4]: https://en.wikipedia.org/wiki/TCP_congestion-avoidance_algorithm#Slow_start +[5]: https://docs.python.org/3/library/asyncio-stream.html +[6]: https://docs.python.org/3/library/asyncio-protocol.html +[7]: https://github.com/sirMackk/diy_framework/blob/88968e6b30e59504251c0c7cd80abe88f51adb79/diy_framework/http_server.py#L46 +[8]: https://docs.python.org/3/library/functions.html#bytearray +[9]: https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.Handle +[10]: https://en.wikipedia.org/wiki/Dependency_injection +[11]: https://docs.python.org/3/library/unittest.mock.html +[12]: https://docs.python.org/3/library/asyncio-stream.html#asyncio.start_server +[13]: https://blog.8thlight.com/uncle-bob/2012/08/13/the-clean-architecture.html From 83c695e40ae9da31df819adc2a668cbeff62c5b9 Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 19 Aug 2016 10:46:12 +0800 Subject: [PATCH 1446/1469] =?UTF-8?q?20160819-4=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...een Linuxing since before you were born.md | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 sources/talk/20160728 I've been Linuxing since before you were born.md diff --git a/sources/talk/20160728 I've been Linuxing since before you were born.md b/sources/talk/20160728 I've been Linuxing since before you were born.md new file mode 100644 index 0000000000..d9fbeb9970 --- /dev/null +++ b/sources/talk/20160728 I've been Linuxing since before you were born.md @@ -0,0 +1,66 @@ +I've been Linuxing since before you were born +===================== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/OSDC_Penguin_Image_520x292_12324207_0714_mm_v1a.png?itok=WfAkwbFy) + +Once upon a time, there was no Linux. No, really! It did not exist. It was not like today, with Linux everywhere. There were multiple flavors of Unix, there was Apple, and there was Microsoft Windows. + +When it comes to Windows, the more things change, the more they stay the same. Despite adding 20+ gigabytes of gosh-knows-what, Windows is mostly the same. (Except you can't drop to a DOS prompt to get actual work done.) Hey, who remembers Gorilla.bas, the exploding banana game that came in DOS? Fun times! The Internet never forgets, and you can play a Flash version on Kongregate.com. + +Apple changed, evolving from a friendly system that encouraged hacking to a sleek, sealed box that you are not supposed to open, and that dictates what hardware interfaces you are allowed to use. 1998: no more floppy disk. 2012: no more optical drive. The 12-inch MacBook has only a single USB Type-C port that supplies power, Bluetooth, Wi-Fi, external storage, video output, and accessories. If you want to plug in more than one thing at a time and don't want to tote a herd of dongles and adapters around with you, too bad. Next up: The headphone jack. Yes, the one remaining non-proprietary standard hardware port in Apple-land is doomed. + +There was a sizable gaggle of other operating systems such as Amiga, BeOS, OS/2, and dozens more that you can look up should you feel so inclined, which I encourage because looking things up is so easy now there is no excuse not to. Amiga, BeOS, and OS/2 were noteworthy for having advanced functionality such as 32-bit multitasking and advanced graphics handling. But marketing clout defeats higher quality, and so the less-capable Apple and Windows dominated the market while the others faded away. + +Then came Linux, and the world changed. + +### First PC + +The first PC I ever used was an Apple IIc, somewheres around 1994, when Linux was three years old. A friend loaned it to me and it was all right, but too inflexible. Then I bought a used Tandy PC for something like $500, which was sad for the person who sold it because it cost a couple thousand dollars. Back then, computers depreciated very quickly. It was a monster: an Intel 386SX CPU, 4 megabytes RAM, a 107-megabyte hard drive, 14-inch color CRT monitor, running MS-DOS 5 and Windows 3.1. + +I tore that poor thing apart multiple times and reinstalled Windows and DOS many times. Windows was marginally usable, so I did most of my work in DOS. I loved gory video games and played Doom, Duke Nukem, Quake, and Heretic. Ah, those glorious, jiggedy 8-bit graphics. + +In those days the hardware was always behind the software, so I upgraded frequently. Now we have all the horsepower we need and then some. I haven't had to upgrade the hardware in any of my computers for several years. + +### Computer bits + +Back in those golden years, there were independent computer stores on every corner and you could hardly walk down the block without tripping over a local independent Internet service provider (ISP). ISPs were very different then. They were not horrid customer-hostile megacorporations like our good friends the American telcos and cable companies. They were nice, and offered all kinds of extra services like Bulletin Board Services (BBS), file downloads, and Multi-User Domains (MUDs), which were multi-player online games. + +I spent a lot of time buying parts in the computer stores, and half the fun was shocking the store staff by being a woman. It is puzzling how this is so upsetting to some people. Now I'm an old fart of 58 and they're still not used to it. I hope that being a woman nerd will become acceptable by the time I die. + +Those stores had racks of Computer Bits magazine. Check out this old issue of Computer Bits on the Internet Archive. Computer Bits was a local free paper with good articles and tons of ads. Unfortunately, the print ads did not appear in the online edition, so you can't see how they included a wealth of detailed information. You know how advertisers are so whiny, and complain about ad blockers, and have turned tech journalism into barely-disguised advertising? They need to learn some lessons from the past. Those ads were useful. People wanted to read them. I learned everything about computer hardware from reading the ads in Computer Bits and other computer magazines. Computer Shopper was an especially fabulous resource; it had several hundred pages of ads and high-quality articles. + +![](https://opensource.com/sites/default/files/resize/march2002-300x387.jpg) + +The publisher of Computer Bits, Paul Harwood, launched my writing career. My first ever professional writing was for Computer Bits. Paul, if you're still around, thank you! + +You can see something in the Internet Archives of Computer Bits that barely exists anymore, and that is the classified ads section. Classified ads generated significant income for print publications. Craigslist killed the classifieds, which killed newspapers and publications like Computer Bits. + +One of my cherished memories is when the 12-year-old twit who ran my favorite computer store, who could never get over my blatant woman-ness and could never accept that I knew what I was doing, handed me a copy of Computer Bits as a good resource for beginners. I opened it to show him one of my Linux articles and said "Oh yes, I know." He turned colors I didn't think were physiologically possible and scuttled away. (No, my fine literalists, he was not really 12, but in his early 20s. Perhaps by now his emotional maturity has caught up a little.) + +### Discovering Linux + +I first learned about Linux in Computer Bits magazine, maybe around 1997 or so. My first Linuxes were Red Hat 5 and Mandrake Linux. Mandrake was glorious. It was the first easy-to-install Linux, and it bundled graphics and sound drivers so I could immediately play Tux Racer. Unlike most Linux nerds at the time I did not come from a Unix background, so I had a steep learning curve. But that was alright, because everything I learned was useful. In contrast to my Windows adventures, where most of what I learned was working around its awfulness, then giving up and dropping to a DOS shell. + +Playing with computers was so much fun I drifted into freelance consulting, forcing Windows computers to more or less function, and helping IT staff in small shops migrate to Linux servers. Usually we did this on the sneak, because those were the days of Microsoft calling Linux a cancer, and implying that it was a communist conspiracy to sap and impurify all of our precious bodily fluids. + +### Linux won + +I continued consulting for a number of years, doing a little bit of everything: Repairing and upgrading hardware, pulling cable, system and network administration, and running mixed Apple/Windows/Linux networks. Apple and Windows were absolutely hellish to integrate into mixed networks as they deliberately tried to make it impossible. One of the coolest things about Linux and FOSS is there is always someone ready and able to defeat the barriers erected by proprietary vendors. + +It is very different now. There are still proprietary barriers to interoperability, and there is still no Tier 1 desktop Linux OEM vendor. In my opinion this is because Microsoft and Apple have a hard lock on retail distribution. Maybe they're doing us a favor, because you get way better service and quality from wonderful independent Linux vendors like ZaReason and System76. They're Linux experts, and they don't treat us like unwelcome afterthoughts. + +Aside from the retail desktop, Linux dominates all aspects of computing from embedded to supercomputing and distributed computing. Open source dominates software development. All of the significant new frontiers in software, such as containers, clusters, and artificial intelligence are all powered by open source software. When you measure the distance from my first little old 386SX PC til now, that is phenomenal progress. + +It would not have happened without Linux and open source. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/life/16/7/my-linux-story-carla-schroder + +作者:[Carla Schroder ][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/carlaschroder From 09708bdb438ee3721eedb6c11a64464373e3d62e Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 19 Aug 2016 10:54:49 +0800 Subject: [PATCH 1447/1469] =?UTF-8?q?20160819-5=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...o Write and Tune Shell Scripts – Part 2.md | 253 ++++++++++++++++++ 1 file changed, 253 insertions(+) create mode 100644 sources/tech/20160601 Learn Python Control Flow and Loops to Write and Tune Shell Scripts – Part 2.md diff --git a/sources/tech/20160601 Learn Python Control Flow and Loops to Write and Tune Shell Scripts – Part 2.md b/sources/tech/20160601 Learn Python Control Flow and Loops to Write and Tune Shell Scripts – Part 2.md new file mode 100644 index 0000000000..2ec64d9cf6 --- /dev/null +++ b/sources/tech/20160601 Learn Python Control Flow and Loops to Write and Tune Shell Scripts – Part 2.md @@ -0,0 +1,253 @@ +Learn Python Control Flow and Loops to Write and Tune Shell Scripts – Part 2 +==================================== + +In the previous article of this Python series we shared a brief introduction to Python, its command-line shell, and the IDLE. We also demonstrated how to perform arithmetic calculations, how to store values in variables, and how to print back those values to the screen. Finally, we explained the concepts of methods and properties in the context of Object Oriented Programming through a practical example. + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Write-Shell-Scripts-in-Python-Programming.png) + +In this guide we will discuss control flow (to choose different courses of action depending on information entered by a user, the result of a calculation, or the current value of a variable) and loops (to automate repetitive tasks) and then apply what we have learned so far to write a simple shell script that will display the operating system type, the hostname, the kernel release, version, and the machine hardware name. + +This example, although basic, will help us illustrate how we can leverage Python OOP’s capabilities to write shell scripts easier than using regular bash tools. + +In other words, we want to go from + +``` +# uname -snrvm +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Check-Hostname-of-Linux.png) + +to + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Check-Linux-Hostname-Using-Python-Script.png) + +Looks pretty, doesn’t it? Let’s roll up our sleeves and make it happen. + +### Control flow in Python + +As we said earlier, control flow allows us to choose different outcomes depending on a given condition. Its most simple implementation in Python is an if / else clause. + +The basic syntax is: + +``` +if condition: +# action 1 +else: +# action 2 +``` + +When condition evaluates to true, the code block below will be executed (represented by # action 1. Otherwise, the code under else will be run. + +A condition can be any statement that can evaluate to either true or false. + +For example: + +1. 1 < 3 # true + +2. firstName == “Gabriel” # true for me, false for anyone not named Gabriel + +- In the first example we compared two values to determine if one is greater than the other. +- In the second example we compared firstName (a variable) to determine if, at the current execution point, its value is identical to “Gabriel” +- The condition and the else statement must be followed by a colon (:) +- Indentation is important in Python. Lines with identical indentation are considered to be in the same code block. + +Please note that the if / else statement is only one of the many control flow tools available in Python. We reviewed it here since we will use it in our script later. You can learn more about the rest of the tools in the [official docs][1]. + +### Loops in Python + +Simply put, a loop is a sequence of instructions or statements that are executed in order as long as a condition is true, or once per item in a list. + +The most simple loop in Python is represented by the for loop iterates over the items of a given list or string beginning with the first item and ending with the last. + +Basic syntax: + +``` +for x in example: +# do this +``` + +Here example can be either a list or a string. If the former, the variable named x represents each item in the list; if the latter, x represents each character in the string: + +``` +>>> rockBands = [] +>>> rockBands.append("Roxette") +>>> rockBands.append("Guns N' Roses") +>>> rockBands.append("U2") +>>> for x in rockBands: +print(x) +or +>>> firstName = "Gabriel" +>>> for x in firstName: +print(x) +``` + +The output of the above examples is shown in the following image: + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Learn-Loops-in-Python.png) + +### Python Modules + +For obvious reasons, there must be a way to save a sequence of Python instructions and statements in a file that can be invoked when it is needed. + +That is precisely what a module is. Particularly, the os module provides an interface to the underlying operating system and allows us to perform many of the operations we usually do in a command-line prompt. + +As such, it incorporates several methods and properties that can be called as we explained in the previous article. However, we need to import (or include) it in our environment using the import keyword: + +``` +>>> import os +``` + +Let’s print the current working directory: + +``` +>>> os.getcwd() +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Learn-Python-Modules.png) + +Let’s now put all of this together (along with the concepts discussed in the previous article) to write the desired script. + +### Python Script + +It is considered good practice to start a script with a statement that indicates the purpose of the script, the license terms under which it is released, and a revision history listing the changes that have been made. Although this is more of a personal preference, it adds a professional touch to our work. + +Here’s the script that produces the output we shown at the top of this article. It is heavily commented so that you can understand what’s happening. + +Take a few minutes to go through it before proceeding. Note how we use an if / else structure to determine whether the length of each field caption is greater than the value of the field itself. + +Based on the result, we use empty characters to fill in the space between a field caption and the next. Also, we use the right number of dashes as separator between the field caption and its value below. + +``` +#!/usr/bin/python3 +# Change the above line to #!/usr/bin/python if you don't have Python 3 installed +# Script name: uname.py +# Purpose: Illustrate Python's OOP capabilities to write shell scripts more easily +# License: GPL v3 (http://www.gnu.org/licenses/gpl.html) +# Copyright (C) 2016 Gabriel Alejandro Cánepa +# ​Facebook / Skype / G+ / Twitter / Github: gacanepa +# Email: gacanepa (at) gmail (dot) com +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# REVISION HISTORY +# DATE VERSION AUTHOR CHANGE DESCRIPTION +# ---------- ------- -------------- +# 2016-05-28 1.0 Gabriel Cánepa Initial version +# Import the os module +import os +# Assign the output of os.uname() to the the systemInfo variable +# os.uname() returns a 5-string tuple (sysname, nodename, release, version, machine) +# Documentation: https://docs.python.org/3.2/library/os.html#module-os +systemInfo = os.uname() +# This is a fixed array with the desired captions in the script output +headers = ["Operating system","Hostname","Release","Version","Machine"] +# Initial value of the index variable. It is used to define the +# index of both systemInfo and headers in each step of the iteration. +index = 0 +# Initial value of the caption variable. +caption = "" +# Initial value of the values variable +values = "" +# Initial value of the separators variable +separators = "" +# Start of the loop +for item in systemInfo: +if len(item) < len(headers[index]): +# A string containing dashes to the length of item[index] or headers[index] +# To repeat a character(s), enclose it within quotes followed +# by the star sign (*) and the desired number of times. +separators = separators + "-" * len(headers[index]) + " " +caption = caption + headers[index] + " " +values = values + systemInfo[index] + " " * (len(headers[index]) - len(item)) + " " +else: +separators = separators + "-" * len(item) + " " +caption = caption + headers[index] + " " * (len(item) - len(headers[index]) + 1) +values = values + item + " " +# Increment the value of index by 1 +index = index + 1 +# End of the loop +# Print the variable named caption converted to uppercase +print(caption.upper()) +# Print separators +print(separators) +# Print values (items in systemInfo) +print(values) +# INSTRUCTIONS: +# 1) Save the script as uname.py (or another name of your choosing) and give it execute permissions: +# chmod +x uname.py +# 2) Execute it: +# ./uname.py +``` + +Once you have saved the above script to a file, give it execute permissions and run it as indicated at the bottom of the code: + +``` +# chmod +x uname.py +# ./uname.py +``` + +If you get the following error while attempting to execute the script: + +``` +-bash: ./uname.py: /usr/bin/python3: bad interpreter: No such file or directory +``` + +It means you don’t have Python 3 installed. If that is the case, you can either install the package or replace the interpreter line (pay special attention and be very careful if you followed the steps to update the symbolic links to the Python binaries as outlined in the previous article): + +``` +#!/usr/bin/python3 +``` + +with + +``` +#!/usr/bin/python +``` + +which will cause the installed version of Python 2 to execute the script instead. + +Note: This script has been tested successfully both in Python 2.x and 3.x. + +Although somewhat rudimentary, you can think of this script as a Python module. This means that you can open it in the IDLE (File → Open… → Select file): + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Open-Python-in-IDLE.png) + +A new window will open with the contents of the file. Then go to Run → Run module (or just press F5). The output of the script will be shown in the original shell: + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Run-Python-Script.png) + +If you want to obtain the same results with a script written purely in Bash, you would need to use a combination of awk, sed, and resort to complex methods to store and retrieve items in a list (not to mention the use of tr to convert lowercase letters to uppercase). + +In addition, Python provides portability in that all Linux systems ship with at least one Python version (either 2.x or 3.x, sometimes both). Should you need to rely on a shell to accomplish the same goal, you would need to write different versions of the script based on the shell. + +This goes to show that Object Oriented Programming features can become strong allies of system administrators. + +Note: You can find this python script (and others) in one of my GitHub repositories. + +### Summary + +In this article we have reviewed the concepts of control flow, loops / iteration, and modules in Python. We have shown how to leverage OOP methods and properties in Python to simplify otherwise complex shell scripts. + +Do you have any other ideas you would like to test? Go ahead and write your own Python scripts and let us know if you have any questions. Don’t hesitate to drop us a line using the comment form below, and we will get back to you as soon as we can. + + + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/learn-python-programming-to-write-linux-shell-scripts/2/ + +作者:[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://please%20note%20that%20the%20if%20/%20else%20statement%20is%20only%20one%20of%20the%20many%20control%20flow%20tools%20available%20in%20Python.%20We%20reviewed%20it%20here%20since%20we%20will%20use%20it%20in%20our%20script%20later.%20You%20can%20learn%20more%20about%20the%20rest%20of%20the%20tools%20in%20the%20official%20docs. From f59107204f61e988f56e4e10517815585c6a4b8e Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 19 Aug 2016 11:05:07 +0800 Subject: [PATCH 1448/1469] =?UTF-8?q?20160819-6=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nux how long a process has been running.md | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 sources/tech/20160801 Linux how long a process has been running.md diff --git a/sources/tech/20160801 Linux how long a process has been running.md b/sources/tech/20160801 Linux how long a process has been running.md new file mode 100644 index 0000000000..1dee75b429 --- /dev/null +++ b/sources/tech/20160801 Linux how long a process has been running.md @@ -0,0 +1,75 @@ +Linux how long a process has been running +===================== + +![](http://s0.cyberciti.org/images/category/old/linux-logo.png) + +>I‘m a new Linux system user. How do I check how long a process or pid has been running on my Ubuntu Linux server? + +You need to use the ps command to see information about a selection of the active processes. The ps command provide following two formatting options: + +1. etime Display elapsed time since the process was started, in the form [[DD-]hh:]mm:ss. +2. etimes Display elapsed time since the process was started, in seconds. + +### How to check how long a process has been running? + +You need to pass the -o etimes or -o etime to the ps command. The syntax is: + +``` +ps -p {PID-HERE} -o etime +ps -p {PID-HERE} -o etimes +``` + +#### Step 1: Find PID of a process (say openvpn) + +``` +$ pidof openvpn +6176 +``` + +#### Step 2: How long a openvpn process has been running? + +``` +$ ps -p 6176 -o etime +``` + +OR + +``` +$ ps -p 6176 -o etimes +``` + +To hide header: + +``` +$ ps -p 6176 -o etime= +$ ps -p 6176 -o etimes= +``` + +Sample outputs: + +![](http://s0.cyberciti.org/uploads/faq/2016/08/How-to-check-how-long-a-process-has-been-running.jpg) + +The 6176 is the PID of the process you want to check. In this case I’m looking into openvpn process. Feel free to replace openvpn and PID # 6176 as per your own requirements. In this find example, I am printing PID, command, elapsed time, user ID, and group ID: + +``` +$ ps -p 6176 -o pid,cmd,etime,uid,gid +``` + +Sample outputs: + +``` + PID CMD ELAPSED UID GID + 6176 /usr/sbin/openvpn --daemon 15:25 65534 65534 +``` + +-------------------------------------------------------------------------------- + +via: http://www.cyberciti.biz/faq/how-to-check-how-long-a-process-has-been-running/ + +作者:[VIVEK GITE][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.cyberciti.biz/faq/how-to-check-how-long-a-process-has-been-running/ From 822efd228ac5abd2f24601eac8546d33e1c0910f Mon Sep 17 00:00:00 2001 From: Mike Tang Date: Fri, 19 Aug 2016 15:09:12 +0800 Subject: [PATCH 1449/1469] sources/tech/20160801 Linux how long a process has been running.md --- .../tech/20160801 Linux how long a process has been running.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160801 Linux how long a process has been running.md b/sources/tech/20160801 Linux how long a process has been running.md index 1dee75b429..352da47db8 100644 --- a/sources/tech/20160801 Linux how long a process has been running.md +++ b/sources/tech/20160801 Linux how long a process has been running.md @@ -1,3 +1,5 @@ +MikeCoder translating... + Linux how long a process has been running ===================== From bfffe7dee8d9f820e6a28c3a50bf5ee225b4af59 Mon Sep 17 00:00:00 2001 From: Mike Date: Fri, 19 Aug 2016 16:40:17 +0800 Subject: [PATCH 1450/1469] translated/tech/20160801 Linux how long a process has been running.md (#4317) --- ...nux how long a process has been running.md | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) rename {sources => translated}/tech/20160801 Linux how long a process has been running.md (50%) diff --git a/sources/tech/20160801 Linux how long a process has been running.md b/translated/tech/20160801 Linux how long a process has been running.md similarity index 50% rename from sources/tech/20160801 Linux how long a process has been running.md rename to translated/tech/20160801 Linux how long a process has been running.md index 352da47db8..9ef5a22859 100644 --- a/sources/tech/20160801 Linux how long a process has been running.md +++ b/translated/tech/20160801 Linux how long a process has been running.md @@ -1,63 +1,62 @@ -MikeCoder translating... - -Linux how long a process has been running +在 Linux 如何查看一个进程的运行时间 ===================== ![](http://s0.cyberciti.org/images/category/old/linux-logo.png) ->I‘m a new Linux system user. How do I check how long a process or pid has been running on my Ubuntu Linux server? +>我是一个 Linux 系统的新手。我该如何在我的 Ubuntu 服务器上查看一个进程或者根据一个进程 id 来查看他已经运行的时间? You need to use the ps command to see information about a selection of the active processes. The ps command provide following two formatting options: +你需要使用 ps 命令来查看关于一组正在运行的进程的信息。ps 命令提供了如下的两种格式化选项。 -1. etime Display elapsed time since the process was started, in the form [[DD-]hh:]mm:ss. -2. etimes Display elapsed time since the process was started, in seconds. +1. etime 显示了自从该进程启动以来,经历过的时间。以[[DD-]hh:]mm:ss 的格式。 +2. etimes 显示了自该进程启动以来,经历过的时间,以秒的形式。 -### How to check how long a process has been running? +### 如何查看一个进程已经运行的时间? -You need to pass the -o etimes or -o etime to the ps command. The syntax is: +你需要在 ps 命令之后添加 -o etimes 或者 -o etime 参数。它的语法如下: ``` ps -p {PID-HERE} -o etime ps -p {PID-HERE} -o etimes ``` -#### Step 1: Find PID of a process (say openvpn) +#### 第一步:找到一个进程的 PID (openvpn 为例) ``` $ pidof openvpn 6176 ``` -#### Step 2: How long a openvpn process has been running? +#### 第二步:openvpn 进程运行了多长时间? ``` $ ps -p 6176 -o etime ``` -OR +或者 ``` $ ps -p 6176 -o etimes ``` -To hide header: +隐藏头部: ``` $ ps -p 6176 -o etime= $ ps -p 6176 -o etimes= ``` -Sample outputs: +样例输出: ![](http://s0.cyberciti.org/uploads/faq/2016/08/How-to-check-how-long-a-process-has-been-running.jpg) -The 6176 is the PID of the process you want to check. In this case I’m looking into openvpn process. Feel free to replace openvpn and PID # 6176 as per your own requirements. In this find example, I am printing PID, command, elapsed time, user ID, and group ID: +这个 6176 就是你想查看的进程的 PID。在这个例子中,我查看的是 openvpn 进程。你可以按照你的需求随意的更换 openvpn 进程名或者是 PID。在下面的例子中,我打印了 PID,执行命令,运行时间,用户 ID,和用户组 ID: ``` $ ps -p 6176 -o pid,cmd,etime,uid,gid ``` -Sample outputs: +样例输出: ``` PID CMD ELAPSED UID GID @@ -69,7 +68,7 @@ Sample outputs: via: http://www.cyberciti.biz/faq/how-to-check-how-long-a-process-has-been-running/ 作者:[VIVEK GITE][a] -译者:[译者ID](https://github.com/译者ID) +译者:[MikeCoder](https://github.com/MikeCoder) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 875a070a949a218659505caeb08fc9144b399de5 Mon Sep 17 00:00:00 2001 From: WangYue <815420852@qq.com> Date: Sat, 20 Aug 2016 10:18:05 +0800 Subject: [PATCH 1451/1469] =?UTF-8?q?=E3=80=90=E7=BF=BB=E8=AF=91=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E3=80=9120160630=2018=20Best=20IDEs=20for=20C+C++=20P?= =?UTF-8?q?rogramming=20or=20Source=20Code=20Editors=20on=20Linux.md=20(#4?= =?UTF-8?q?320)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 【翻译完成】20160630 18 Best IDEs for C+C++ Programming or Source Code Editors on Linux.md 源文件删除【翻译完成】20160630 18 Best IDEs for C+C++ Programming or Source Code Editors on Linux.md * 【翻译完成】20160630 18 Best IDEs for C+C++ Programming or Source Code Editors on Linux.md 提交译文【翻译完成】20160630 18 Best IDEs for C+C++ Programming or Source Code Editors on Linux.md --- ...ramming or Source Code Editors on Linux.md | 305 ------------------ ...ramming or Source Code Editors on Linux.md | 302 +++++++++++++++++ 2 files changed, 302 insertions(+), 305 deletions(-) delete mode 100644 sources/tech/20160630 18 Best IDEs for C+C++ Programming or Source Code Editors on Linux.md create mode 100644 translated/tech/20160630 18 Best IDEs for C+C++ Programming or Source Code Editors on Linux.md diff --git a/sources/tech/20160630 18 Best IDEs for C+C++ Programming or Source Code Editors on Linux.md b/sources/tech/20160630 18 Best IDEs for C+C++ Programming or Source Code Editors on Linux.md deleted file mode 100644 index 03b18de986..0000000000 --- a/sources/tech/20160630 18 Best IDEs for C+C++ Programming or Source Code Editors on Linux.md +++ /dev/null @@ -1,305 +0,0 @@ -translating by WangYueScream & LiBrad -18 Best IDEs for C/C++ Programming or Source Code Editors on Linux -====================================================================== - -C++, an extension of well known C language, is an excellent, powerful and general purpose programming language that offers modern and generic programming features for developing large-scale applications ranging from video games, search engines, other computer software to operating systems. - -C++ is highly reliable and also enables low-level memory manipulation for more advanced programming requirements. - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Best-Linux-IDE-Editors.png) - -There are several text editors out there that programmers can use to write C/C++ code, but IDE have come up to offer comprehensive facilities and components for easy and ideal programming. - -In this article, we shall look at some of the best IDE’s you can find on the Linux platform for C++ or any other programming. - -### 1. Netbeans for C/C++ Development - -Netbeans is a free, open-source and popular cross-platform IDE for C/C++ and many other programming languages. Its fully extensible using community developed plugins. - -It includes project types and templates for C/C++ and you can build applications using static and dynamic libraries. Additionally, you can reuse existing code to create your projects, and also use drag and drop feature to import binary files into it to build applications from the ground. - -Let us look at some of its features: - -- The C/C++ editor is well integrated with multi-session [GNU GDB][1] debugger tool. -- Support for code assistance -- C++11 support -- Create and run C/C++ tests from within -- Qt toolkit support -- Support for automatic packaging of compiled application into .tar, .zip and many more archive files -- Support for multiple compilers such as GNU, Clang/LLVM, Cygwin, Oracle Solaris Studio and MinGW -- Support for remote development -- File navigation -- Source inspection - -![](http://www.tecmint.com/wp-content/uploads/2016/06/NetBeans-IDE.png) ->Visit Homepage: - -### 2. Code::Blocks - -Code::Blocks is a free, highly extensible and configurable, cross-platform C++ IDE built to offer users the most demanded and ideal features. It delivers a consistent user interface and feel. - -And most importantly, you can extend its functionality by using plugins developed by users, some of the plugins are part of Code::Blocks release and many are not, written by individual users not part of the Code::Block development team. - -Its features are categorized into compiler, debugger and interface features and these include: - -Multiple compiler support including GCC, clang, Borland C++ 5.5, digital mars plus many more -Very fast, no need for makefiles -Multi-target projects -Workspace that supports combining of projects -Interfaces GNU GDB -Support for full breakpoints including code breakpoints, data breakpoints, breakpoint conditions plus many more -display local functions symbols and arguments -custom memory dump and syntax highlighting -Customizable and extensible interface plus many more other features including those added through user built plugins - -![](http://www.tecmint.com/wp-content/uploads/2016/06/CodeBlocks-IDE-for-Linux.png) ->Visit Homepage: - -### 3. Eclipse CDT(C/C++ Development Tooling) - -Eclipse is a well known open-source, cross-platform IDE in the programming arena. It offers users a great GUI with support for drag and drop functionality for easy arrangement of interface elements. - -The Eclipse CDT is a project based on the primary Eclipse platform and it provides a full functional C/C++ IDE with following features: - -- Supports project creation -- Managed build for various toolchains -- Standard make build -- Source navigation -- Several knowledge tools such as call graph, type hierarchy, in-built browser, macro definition browser -- Code editor with support for syntax highlighting -- Support for folding and hyperlink navigation -- Source code refactoring plus code generation -- Tools for visual debugging such as memory, registers -- Disassembly viewers and many more - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Eclipse-IDE-for-Linux.png) ->Visit Homepage: - -### 4. CodeLite IDE - -CodeLite is also a free, open-source, cross-platform IDE designed and built specifically for C/C++, JavaScript (Node.js) and PHP programming. - -Some of its main features include: - -- Code completion, and it offers two code completion engines -- Supports several compilers including GCC, clang/VC++ -- Displays errors as code glossary -- Clickable errors via build tab -- Support for LLDB next generation debugger -- GDB support -- Support for refactoring -- Code navigation -- Remote development using built-in SFTP -- Source control plugins -- RAD (Rapid Application Development) tool for developing wxWidgets-based apps plus many more features - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Codelite-IDE.png) ->Visit Homepage: - -### 6. Bluefish Editor - -Bluefish is a more than just a normal editor, it is a lightweight, fast editor that offers programmers IDE like features for developing websites, writing scripts and software code. It is multi-platform, runs on Linux, Mac OSX, FreeBSD, OpenBSD, Solaris and Windows, and also supports many programming languages including C/C++. - -It is feature rich including the ones listed below: - -- Multiple document interface -- Supports recursive opening of files based on filename patterns or content pattern -- Offers a very powerful search and replace functionality -- Snippet sidebar -- Support for integrating external filters of your own, pipe documents using commands such as awk, sed, sort plus custom built scripts -- Supports full screen editing -- Site uploader and downloader -- Multiple encoding support and many more other features - -![](http://www.tecmint.com/wp-content/uploads/2016/06/BlueFish-IDE-Editor-for-Linux.png) ->Visit Homepage: - -### 7. Brackets Code Editor - -Brackets is a modern and open-source text editor designed specifically for web designing and development. It is highly extensible through plugins, therefore C/C++ programmers can use it by installing the C/C++/Objective-C pack extension, this pack is designed to enhance C/C++ code writing and to offer IDE like features. - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Brackets-Code-Editor-for-Linux.png) ->Visit Homepage: - -### 8. Atom Code Editor - -Atom is also a modern, open-source, multi-platform text editor that can run on Linux, Windows or Mac OS X. It is also hackable down to its base, therefore users can customize it to meet their code writing demands. - -It is fully featured and some of its main features include: - -- Built-in package manager -- Smart auto-completion -- In-built file browser -- Find and replace functionality and many more - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Atom-Code-Editor-for-Linux.png) ->Visit Homepage: >https://atom.io/> ->Installation Instructions: - -### 9. Sublime Text Editor - -Sublime Text is a well refined, multi-platform text editor designed and developed for code, markup and prose. You can use it for writing C/C++ code and offers a great user interface. - -It’s features list comprises of: - -- Multiple selections -- Command palette -- Goto anything functionality -- Distraction free mode -- Split editing -- Instant project switching support -- Highly customizable -- Plugin API support based on Python plus other small features - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Sublime-Code-Editor-for-Linux.png) ->Visit Homepage: ->Installation Instructions: - -### 10. JetBrains CLion - -CLion is a non-free, powerful and cross-platform IDE for C/C++ programming. It is a fully integrated C/C++ development environment for programmers, providing Cmake as a project model, an embedded terminal window and a keyboard oriented approach to code writing. - -It also offers a smart and modern code editor plus many more exciting features to enable an ideal code writing environment and these features include: - -- Supports several languages other than C/C++ -- Easy navigation to symbol declarations or context usage -- Code generation and refactoring -- Editor customization -- On-the-fly code analysis -- An integrated code debugger -- Supports Git, Subversion, Mercurial, CVS, Perforce(via plugin) and TFS -- Seamlessly integrates with Google test frameworks -- Support for Vim text editor via Vim-emulation plugin - -![](http://www.tecmint.com/wp-content/uploads/2016/06/JetBains-CLion-IDE.png) ->Visit Homepage: - -### 11. Microsoft’s Visual Studio Code Editor - -Visual Studio is a rich, fully integrated, cross-platform development environment that runs on Linux, Windows and Mac OS X. It was recently made open-source to Linux users and it has redefined code editing, offering users every tool needed for building every app for multiple platforms including Windows, Android, iOS and the web. - -It is feature full, with features categorized under application development, application lifecycle management, and extend and integrate features. You can read a comprehensive features list from the Visual Studio website. - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Visual-Studio-Code-Editor.png) ->Visit Homepage: - -### 12. KDevelop - -KDevelop is just another free, open-source and cross-platform IDE that works on Linux, Solaris, FreeBSD, Windows, Mac OSX and other Unix-like operating systems. It is based on the KDevPlatform, KDE and Qt libraries. KDevelop is highly extensible through plugins and feature rich with the following notable features: - -- Support for Clang-based C/C++ plugin -- KDE 4 config migration support -- Revival of Oketa plugin support -- Support for different line editings in various views and plugins -- Support for Grep view and Uses widget to save vertical space plus many more - -![](http://www.tecmint.com/wp-content/uploads/2016/06/KDevelop-IDE-Editor.png) ->Visit Homepage: - -### 13. Geany IDE - -Geany is a free, fast, lightweight and cross-platform IDE developed to work with few dependencies and also operate independently from popular Linux desktops such as GNOME and KDE. It requires GTK2 libraries for functionality. - -Its features list consists of the following: - -- Support for syntax highlighting -- Code folding -- Call tips -- Symbol name auto completion -- Symbol lists -- Code navigation -- A simple project management tool -- In-built system to compile and run a users code -- Extensible through plugins - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Geany-IDE-for-Linux.png) ->Visit Homepage: - -### 14. Ajunta DeveStudio - -Ajunta DevStudio is a simple GNOME yet powerful software development studio that supports several programming languages including C/C++. - -It offers advanced programming tools such as project management, GUI designer, interactive debugger, application wizard, source editor, version control plus so many other facilities. Additionally, to above features, Ajunta DevStudio also has some other great IDE features and these include: - -- Simple user interface -- Extensible with plugins -- Integrated Glade for WYSIWYG UI development -- Project wizards and templates -- Integrated GDB debugger -- In-built file manager -- Integrated DevHelp for context sensitive programming help -- Source code editor with features such as syntax highlighting, smart indentation, auto-indentation, code folding/hiding, text zooming plus many more - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Anjuta-DevStudio-for-Linux.png) ->Visit Homepage: - -### 15. The GNAT Programming Studio - -The GNAT Programming Studio is a free easy to use IDE designed and developed to unify the interaction between a developer and his/her code and software. - -Built for ideal programming by facilitating source navigation while highlighting important sections and ideas of a program. It is also designed to offer a high-level of programming comfortability, enabling users to developed comprehensive systems from the ground. - -It is feature rich with the following features: - -- - Intuitive user interface -- Developer friendly -- Multi-lingual and multi-platform -- Flexible MDI(multiple document interface) -- Highly customizable -- Fully extensible with preferred tools - -![](http://www.tecmint.com/wp-content/uploads/2016/06/GNAT-Programming-Studio.jpg) ->Visit Homepage: - -### 16. Qt Creator - -It is a non-free, cross-platform IDE designed for creation of connected devices, UIs and applications. Qt creator enables users to do more of creation than actual coding of applications. - -It can be used to create mobile and desktop applications, and also connected embedded devices. - -Some of its features include: - -- Sophisticated code editor -- Support for version control -- Project and build management tools -- Multi-screen and multi-platform support for easy switching between build targets plus many more - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Qt-Creator.png) ->Visit Homepage: - -### 17. Emacs Editor - -Emacs is a free, powerful, highly extensible and customizable, cross-platform text editors you can use on Linux, Solaris, FreeBSD, NetBSD, OpenBSD, Windows and Mac OS X. - -The core of Emacs is also an interpreter for Emacs Lisp which is a language under the Lisp programming language. As of this writing, the latest release of GNU Emacs is version 24.5 and the fundamental and notable features of Emacs include: - -- Content-aware editing modes -- Full Unicode support -- Highly customizable using GUI or Emacs Lisp code -- A packaging system for downloading and installing extensions -- Ecosystem of functionalities beyond normal text editing including project planner, mail, calender and news reader plus many more -- A complete built-in documentation plus user tutorials and many more - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Emacs-Editor.png) ->Visit Homepage: https://www.gnu.org/software/emacs/ - -### 18. VI/VIM Editor - -Vim an improved version of VI editor, is a free, powerful, popular and highly configurable text editor. It is built to enable efficient text editing, and offers exciting editor features for Unix/Linux users, therefore, it is also a good option for writing and editing C/C++ code. - -Generally, IDEs offer more programming comfortability then traditional text editors, therefore it is always a good idea to use them. They come with exciting features and offer a comprehensive development environment, sometimes programmers are caught up between choosing the best IDE to use for C/C++ programming. - -There many other IDEs you can find out there and download from the Internet, but trying out several of them can help you find that which suites your needs. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/best-linux-ide-editors-source-code-editors/ - -作者:[Aaron Kili][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/aaronkili/ -[1]: http://www.tecmint.com/debug-source-code-in-linux-using-gdb/ diff --git a/translated/tech/20160630 18 Best IDEs for C+C++ Programming or Source Code Editors on Linux.md b/translated/tech/20160630 18 Best IDEs for C+C++ Programming or Source Code Editors on Linux.md new file mode 100644 index 0000000000..cb991d80c9 --- /dev/null +++ b/translated/tech/20160630 18 Best IDEs for C+C++ Programming or Source Code Editors on Linux.md @@ -0,0 +1,302 @@ + +# Linux 下 18 个最好的 C/C++ 编程或者源代码编辑的集成开发环境 + +C++,一个众所周知的 C 语言的扩展,是一个优秀的,强大的,通用的编程语言,能够提供现代化的和通用的编程功能,可以用于开发大型应用,包括视频游戏,搜索引擎,其他计算机软件甚至操作系统。 + +C++,提供高度可靠性的同时还能够允许操作底层内存来满足更高级的编程要求。 + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Best-Linux-IDE-Editors.png) + +虽然已经有了一些供程序员用来写 C/C++ 代码的文本编辑器,但 IDE 可以为简单、完美的编程提供全面的工具和组件。 + +在这篇文章里,我们会向你展示一些可以在 Linux 平台上找到的用于 C++ 或者其他编程语言编程的最好的 IDE。  + +### 1. Netbeans for C/C++ Development + +Netbeans 是一个免费的、开源和流行跨平台的 IDE 并且用于 C/C++ 以及其他编程语言。由社区提供成熟的插件使它可以充分利用其扩展性。 + +它包含项目类型和 C/C++ 模版,并且你可以使用静态和动态函数库来搭建应用程序。此外,你可以利用现有的代码去创造你的工程,并且使用它的特点将二进制文件拖放进文件夹到开发应用程序的地方。 + +让我们来看看关于它的特性: + +- C/C++ 编辑器是很好的集成多元化的 GNU GDB 调试工具 +- 支持代码协助 +- 支持 C++11 标准 +- 在里面创建和运行 C/C++ 测试程序 +- 支持 QT 工具包 +- 支持自动由已编译的应用程序到 .tar,.zip 和其他更多的归档文件封包 +- 支持多个编译器,例如: GNU,Clang/LLVM,Cygwin,Oracle Solaris Studio 和 MinGW +- 支持远程开发 +- 文件导航 +- 源代码检查 + +![](http://www.tecmint.com/wp-content/uploads/2016/06/NetBeans-IDE.png) +>Visit Homepage: + +### 2. Code::Blocks +Code::Blocks 是一个免费的、具有高度扩展性的、并且可以配置的跨平台 C++ IDE, 它为用户提供最需要的最理想形象。它给用户一种协调的界面感觉。 + +并且最为重要的是,你可以通过用户开发的插件扩展它的功能,这些插件中一部分是 Code::Blocks发布的然而大多数不是这样,而是由非 Code::Block 开发团队成员的个人用户所写的。 + +其特色分为编译器、调试器、接口特性,它们包括: + +- 支持多种编译器如 GCC, clang, Borland C++ 5.5, digital mars 等等 +- 非常快,不需要 makefiles +- Multi-target 工程 +- 支持组合项目的工作空间 +- GNU GDB 接口 +- 支持完整的断点,包括代码的断点,数据断点,断点条件等等 +- 显示本地函数符号和参数 +- 自定义储存仓库和语法高亮显示 +- 可自定义、可扩展的接口以及许多其他的的功能,包括那些用户开发的插件 + +![](http://www.tecmint.com/wp-content/uploads/2016/06/CodeBlocks-IDE-for-Linux.png) +>Visit Homepage: + +### 3. Eclipse CDT(C/C++ Development Tooling) +Eclipse 在编程界是一款著名的、开源的、跨平台的 IDE。为了方便界面元素的布置,它给用户提供了一个很棒的支持拖拽的界面。 + +Eclipse CDT 项目是基于 Eclipse 平台,它给 C/C++ 提供一个全新的 IDE 并具有以下功能: + +- 支持项目创建 +- 管理并建立各种工具链 +- 标准的构建 +- 源导航 +- 一些知识工具,如调用图,类型分级结构,内置浏览程序,定义宏浏览程序 +- 支持语法高亮的代码编辑器 +- 支持折叠和超链接导航 +- 代码重构与代码生成 +- 可视化的调试工具,如存储器、寄存器 +- 反汇编浏览区以及更多功能 + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Eclipse-IDE-for-Linux.png) +>Visit Homepage: + +### 4.CodeLite IDE +CodeLite 也是一款为 C/C++,JavaScript(Node.js) 和 PHP 编程专门设计并建造的免费,开源,跨平台的 IDE。 + +它的一些主要特点包括: + +- 代码自动完成,内置了两个帮助代码自动完成的引擎 +- 支持多种编译器, 包括 GCC,clang/VC++ +- 显示代码词汇的错误 +- 通过构建选项卡点击error +- 支持下一代LLDB调试器 +- 支持 GDB +- 支持重构 +- 代码导航 +- 使用内置的 SFTP 远程开发 +- 源代码控制插件 +- RAD(快速应用程序开发)工具开发 wxWidgets-based 应用以及更多的特性 + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Codelite-IDE.png) +>Visit Homepage: + +### 6. Bluefish Editor + +Bluefish 不仅仅是一个常规的编辑器,它是一个轻量级的,快速的编辑器,为程序员提供了 IDE 的特性如开发网站,编写脚本和软件代码。它支持多平台,在 Linux,Mac OSX,FreeBSD,OpenBSD,Solaris 和 Windows上运行,同时支持众多编程语言包括 C/C++。 + +下面列出的是它众多功能的一部分: + +- 多文档界面 +- 支持递归打开文件,基于文件名通配模式或者内容模式 +- 提供一个非常强大的搜索和替换功能 +- 侧边导航摘要 +- 支持个人的集成外部过滤器,使用命令如awk,sed,sort加上自定义构建脚本组成的管道文件 +- 支持全屏编辑 +- 网站上传和下载 +- 支持多种编码等许多其他功能 + +![](http://www.tecmint.com/wp-content/uploads/2016/06/BlueFish-IDE-Editor-for-Linux.png) +>Visit Homepage: + +### 7. Brackets Code Editor + +Brackets 是一个现代的开源的文本编辑器,专为 Web 设计与开发打造。它可以通过插件进行高度扩展,因此 C/C++ 程序员通过安装 C/C++/Objective-C 包来使用它,这个包用来在改进 C/C++ 代码编写的同时提供 IDE 等特性。 + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Brackets-Code-Editor-for-Linux.png) +>Visit Homepage: + +### 8. Atom Code Editor + +Atom 也是一个现代化风格、开源的多平台文本编辑器,它能运行在 Linux, Windows 或是 Mac OS X 平台。它的底层库可以删除,因此用户可以自定义编译器,以便满足各种编写代码的需求。 + +它功能完整,主要的功能包括: + +- 内置包管理器 +- 快速的自动完成 +- 内置文件浏览器 +- 查找、替换以及其他更多的功能 + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Atom-Code-Editor-for-Linux.png) +>Visit Homepage: >https://atom.io/> +>Installation Instructions: + +### 9. Sublime Text Editor + +Sublime Text 是一个完善的,跨平台的文本编辑器,用于写码、标记和撰文。它可以用来编写 C/C++ 代码,并且提供非常棒的用户界面。 + +它的功能列表包括: + +- 多重选择 +- 命令调色 +- 重要的 Goto 功能 +- 免打扰模式 +- 分离编辑器 +- 支持项目之间快速的切换 +- 高度可制定 +- 支持基于 Python 的 API 插件以及其他特性 + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Sublime-Code-Editor-for-Linux.png) +>Visit Homepage: +>Installation Instructions: + +### 10. JetBrains CLion + +JetBrains CLion 是一个收费的,强大的并且跨平台的 C/C++ IDE。它是一个全面的 C/C++ 程序集成开发环境,并提供 Cmake 项目模型,一个嵌入式终端的窗口和一个编码的定向键入通道。 + +它还提供了一个漂亮的现代化的编辑器,和许多令人激动的功能,提供理想的编码环境,这些功能包括: + +- 除了 C/C++ 还支持其他多种语言 +- 便利的符号声明或上下文导航 +- 代码生成和重构 +- 可制定的编辑 +- 关于代码的快速分享 +- 一个集成的代码调试器 +- 支持 Git,Subversion,Mercurial,CVS,Perforcevia p(lugin) 和 TFS +- 无缝连接 Google 测试框架 +- 通过 Vim 仿真插件支持 Vim 文本编辑器 + +![](http://www.tecmint.com/wp-content/uploads/2016/06/JetBains-CLion-IDE.png) +>Visit Homepage: + +### 11. Microsoft’s Visual Studio Code Editor + +Visual Studio 是一个丰富的,完全集成的,跨平台的开发环境,运行在 Linux,Windows 和 Mac OS X。 最近它向 Linux 用户开源,同时它重新定义了代码编辑,提供了用户所需的所有工具用来开发不同平台下的应用,包括的平台有 Windows,Android,iOS 和 Web。 + +它功能完整,功能分类成应用程序开发、应用生命周期管理、扩展和集成特性。你可以从 Visual Studio 官网阅读全面的功能列表。 + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Visual-Studio-Code-Editor.png) +>Visit Homepage: + +### 12. KDevelop + +KDevelop 是另一个免费,开源和跨平台的 IDE,能够运行在 Linux,Solaris,FreeBSD,Windows,Mac OS X 和其他类 Unix 操作系统。它基于 KDevPlatform,KDE 和 Qt 库。KDevelop 可以通过插件高度扩展,功能丰富并具有以下显著特色: + +- 支持基于 Clang 的 C/C++ 插件 +- 支持 KDE 4 配置迁移 +- Oketa 插件支持的复兴 +- 支持众多视图插件下的不同行编辑 +- 支持 Grep 视图,使用窗口小部件节省垂直空间等 + +![](http://www.tecmint.com/wp-content/uploads/2016/06/KDevelop-IDE-Editor.png) +>Visit Homepage: + +### 13. Geany IDE + +Geany 是一个免费,快速,轻量级和跨平台的 IDE, 操作很少有依赖性,独立运行在流行的 Linux 桌面环境下,比如 GNOME 和 KDE. 它需要 GTK2 库实现功能。 + +它的特性包括以下列出的内容: + +- 支持语法高亮显示 +- 代码折叠 +- 调用提示 +- 符号名自动完成 +- 符号列表 +- 代码提示 +- 一个简单的项目管理工具 +- 内置系统编译并运行用户的代码 +- 可以通过插件扩展 + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Geany-IDE-for-Linux.png) +>Visit Homepage: + +### 14. Ajunta DeveStudio + +Ajunta DevStudio 是一个简单,强大的 GNOME 界面的软件开发工作室,支持包括 C/C++ 在内的众多编程语言。 + +它提供了先进的编程工具,比如项目管理,GUI 设计,交互式调试器,应用程序向导,源代码编辑,版本控制等。此外,除了以上特点,Ajunta DeveStudio 也有其他很多不错的 IDE 特色,包括这些: + +- 简单的用户界面 +- 通过插件扩展 +- 针对 WYSIWYG UI 开发的 Glade 集成 +- 工程的向导和模板 +- 集成的 GDB 调试器 +- 内置文件管理器 +- 使用 DevHelp 集成提供上下文敏感编程辅助 +- 源码编辑支持语法高亮显示,智能缩进,自动缩进,代码折叠/隐藏,文本缩放等 + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Anjuta-DevStudio-for-Linux.png) +>Visit Homepage: + +### 15. The GNAT Programming Studio + +The GNAT Programming Studio 是一个免费的易于使用的用来设计与开发的 IDE,可以统一开发人员与他/她的代码,软件之间的交互。 + +通过促进源导航的同时强调一个程序的重要部分和想法打造理想的编程`。`它也会带给你高水平舒适的编程体验,使用户能够开发综合性的系统。 + +它丰富的特性包括以下这些: + +- 直观的用户界面 +- 对开发者的友好性 +- 支持多种编程语言,跨平台 +- 灵活的 MDI (多文档界面) +- 高度可定制 +- 首选工具的完全可扩展性 + +![](http://www.tecmint.com/wp-content/uploads/2016/06/GNAT-Programming-Studio.jpg) +>Visit Homepage: + +### 16. Qt Creator + +这是一款非免费的,跨平台的 IDE, 用于创建连接设备、用户界面和应用程序。Qt Creator 可以让用户比实际应用编码有更多的创新。 + +它可以用来创建移动和桌面应用程序,以及嵌入式设备连接。 + +它的优点包含以下几点: + +- 复杂的代码编辑器 +- 支持版本控制 +- 项目构造管理工具 +- 支持多屏幕和多平台,易于构建目标之间的切换等等 + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Qt-Creator.png) +>Visit Homepage: + + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Emacs-Editor.png) +>Visit Homepage: https://www.gnu.org/software/emacs/ + +### 17. Emacs Editor + +Emacs是一个免费的,强大的,可大幅度扩展的、可定制的、跨平台的文本编辑器,你可以在Linux,Solaris,FreeBSD,NetBSD,OpenBSD,Windows和Mac OS X这些系统中使用该编辑器. + +Emacs 的核心也是一种 Emacs Lisp 的解释器,Emascs Lisp 是一种基于 Lisp 的编程语言。在撰写本文时,GNU Emacs的最新版本是24.5,Emacs的基本功能包括: + +- 内容识别编辑模式 +- 完全支持 Unicode +- 高度可定制地使用 GUI 或 Emacs Lisp 代码 +- 一种用于下载和安装扩展的打包系统 +- 系统本身的功能超出正常文本编辑的功能,包括项目策划、邮件、日历和新闻阅读器等 +- 一个完整的内置文档,以及用户指南等等 + +### 18. VI/VIM Editor + +Vim,一款 VI 编辑器的改进版本,是一款免费的、强大的、流行的并且高度可配置的文本编辑器。它为有效率地文本编辑而生,并且为 Unix/Linux 使用者提供了激动人心的编辑器特性,因此,它对于撰写和编辑 C/C++ 代码也是一个好的选择。 + +总的来说,与传统的文本编辑器相比,IDE 为编程提供了更多的便利,因此使用它们是一个很好的选择。它们带有激动人心的特征并且提供了一个综合性的开发环境,有时候程序员不得不陷入对最好的 C/C++ IDE 的选择。 + +在互联网上你还可以找到许多 IDE 来下载,但不妨试试我们推荐的这几款,可以帮助你尽快找到哪一款是你需要的。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/best-linux-ide-editors-source-code-editors/ + +作者:[Aaron Kili][a] +译者:[ZenMoore](https://github.com/ZenMoore) [LiBrad](https://github.com/LiBrad) [WangYueScream](https://github.com/WangYueScream) [LemonDemo](https://github.com/LemonDemo) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.tecmint.com/author/aaronkili/ +[1]: http://www.tecmint.com/debug-source-code-in-linux-using-gdb/ From 2948514d818a7a8e36649b17a876791a7ae08a6b Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 20 Aug 2016 15:08:48 +0800 Subject: [PATCH 1452/1469] =?UTF-8?q?PUB:20160601=20Learn=20Python=20Contr?= =?UTF-8?q?ol=20Flow=20and=20Loops=20to=20Write=20and=20Tune=20Shell=20Scr?= =?UTF-8?q?ipts=20=E2=80=93=20Part=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @wi-cuckoo --- ...o Write and Tune Shell Scripts – Part 2.md | 292 ++++++++++++++++++ ...o Write and Tune Shell Scripts – Part 2.md | 285 ----------------- 2 files changed, 292 insertions(+), 285 deletions(-) create mode 100644 published/20160601 Learn Python Control Flow and Loops to Write and Tune Shell Scripts – Part 2.md delete mode 100644 translated/tech/20160601 Learn Python Control Flow and Loops to Write and Tune Shell Scripts – Part 2.md diff --git a/published/20160601 Learn Python Control Flow and Loops to Write and Tune Shell Scripts – Part 2.md b/published/20160601 Learn Python Control Flow and Loops to Write and Tune Shell Scripts – Part 2.md new file mode 100644 index 0000000000..b2bc20848a --- /dev/null +++ b/published/20160601 Learn Python Control Flow and Loops to Write and Tune Shell Scripts – Part 2.md @@ -0,0 +1,292 @@ +Linux 平台下 Python 脚本编程入门(二) +====================================================================================== + +在“[Linux 平台下 Python 脚本编程入门][1]”系列之前的文章里,我们向你介绍了 Python 的简介,它的命令行 shell 和 IDLE(LCTT 译注:python 自带的一个 IDE)。我们也演示了如何进行算术运算、如何在变量中存储值、还有如何打印那些值到屏幕上。最后,我们通过一个练习示例讲解了面向对象编程中方法和属性概念。 + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Write-Shell-Scripts-in-Python-Programming.png) + +*在 Python 编程中写 Linux Shell 脚本* + +本篇中,我们会讨论控制流(根据用户输入的信息、计算的结果,或者一个变量的当前值选择不同的动作行为)和循环(自动重复执行任务),接着应用我们目前所学东西来编写一个简单的 shell 脚本,这个脚本会显示操作系统类型、主机名、内核版本、版本号和机器硬件架构。 + +这个例子尽管很基础,但是会帮助我们证明,比起使用一般的 bash 工具,我们通过发挥 Python 面向对象的特性来编写 shell 脚本会更简单些。 + +换句话说,我们想从这里出发: + +``` +# uname -snrvm +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Check-Hostname-of-Linux.png) + +*检查 Linux 的主机名* + +到 + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Check-Linux-Hostname-Using-Python-Script.png) + +*用 Python 脚本来检查 Linux 的主机名* + +或者 + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Script-to-Check-Linux-System-Information.png) + +*用脚本检查 Linux 系统信息* + +看着不错,不是吗?那我们就挽起袖子,开干吧。 + +### Python 中的控制流 + +如我们刚说那样,控制流允许我们根据一个给定的条件,选择不同的输出结果。在 Python 中最简单的实现就是一个 `if`/`else` 语句。 + +基本语法是这样的: + +``` +if 条件: + # 动作 1 +else: + # 动作 2 +``` + +当“条件”求值为真(true),下面的代码块就会被执行(`# 动作 1`代表的部分)。否则,else 下面的代码就会运行。 +“条件”可以是任何表达式,只要可以求得值为真或者假。 + +举个例子: + +1. `1 < 3` # 真 +2. `firstName == "Gabriel"` # 对 firstName 为 Gabriel 的人是真,对其他不叫 Gabriel 的人为假 + +- 在第一个例子中,我们比较了两个值,判断 1 是否小于 3。 +- 在第二个例子中,我们比较了 firstName(一个变量)与字符串 “Gabriel”,看在当前执行的位置,firstName 的值是否等于该字符串。 +- 条件和 else 表达式都必须跟着一个冒号(`:`)。 +- **缩进在 Python 中非常重要**。同样缩进下的行被认为是相同的代码块。 + +请注意,`if`/`else` 表达式只是 Python 中许多控制流工具的一个而已。我们先在这里了解以下,后面会用在我们的脚本中。你可以在[官方文档][2]中学到更多工具。 + +### Python 中的循环 + +简单来说,一个循环就是一组指令或者表达式序列,可以按顺序一直执行,只要条件为真,或者对列表里每个项目执行一一次。 + +Python 中最简单的循环,就是用 for 循环迭代一个给定列表的元素,或者对一个字符串从第一个字符开始到执行到最后一个字符结束。 + +基本语句: + +``` +for x in example: + # do this +``` + +这里的 example 可以是一个列表或者一个字符串。如果是列表,变量 x 就代表列表中每个元素;如果是字符串,x 就代表字符串中每个字符。 + +``` +>>> rockBands = [] +>>> rockBands.append("Roxette") +>>> rockBands.append("Guns N' Roses") +>>> rockBands.append("U2") +>>> for x in rockBands: + print(x) +或 +>>> firstName = "Gabriel" +>>> for x in firstName: + print(x) +``` + +上面例子的输出如下图所示: + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Learn-Loops-in-Python.png) + +*学习 Python 中的循环* + +### Python 模块 + +很明显,必须有个办法将一系列的 Python 指令和表达式保存到文件里,然后在需要的时候取出来。 + +准确来说模块就是这样的。比如,os 模块提供了一个到操作系统的底层的接口,可以允许我们做许多通常在命令行下执行的操作。 + +没错,os 模块包含了许多可以用来调用的方法和属性,就如我们之前文章里讲解的那样。不过,我们需要使用 `import` 关键词导入(或者叫包含)模块到运行环境里来: + +``` +>>> import os +``` + +我们来打印出当前的工作目录: + +``` +>>> os.getcwd() +``` + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Learn-Python-Modules.png) + +*学习 Python 模块* + +现在,让我们把这些结合在一起(包括之前文章里讨论的概念),编写需要的脚本。 + +### Python 脚本 + +以一段声明文字开始一个脚本是个不错的想法,它可以表明脚本的目的、发布所依据的许可证,以及一个列出做出的修改的修订历史。尽管这主要是个人喜好,但这会让我们的工作看起来比较专业。 + +这里有个脚本,可以输出这篇文章最前面展示的那样。脚本做了大量的注释,可以让大家可以理解发生了什么。 + +在进行下一步之前,花点时间来理解它。注意,我们是如何使用一个 `if`/`else` 结构,判断每个字段标题的长度是否比字段本身的值还大。 + +基于比较结果,我们用空字符去填充一个字段标题和下一个之间的空格。同时,我们使用一定数量的短线作为字段标题与其值之间的分割符。 + +``` +#!/usr/bin/python3 +# 如果你没有安装 Python 3 ,那么修改这一行为 #!/usr/bin/python + +# Script name: uname.py +# Purpose: Illustrate Python's OOP capabilities to write shell scripts more easily +# License: GPL v3 (http://www.gnu.org/licenses/gpl.html) + +# Copyright (C) 2016 Gabriel Alejandro Cánepa +# ​Facebook / Skype / G+ / Twitter / Github: gacanepa +# Email: gacanepa (at) gmail (dot) com + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# REVISION HISTORY +# DATE VERSION AUTHOR CHANGE DESCRIPTION +# ---------- ------- -------------- +# 2016-05-28 1.0 Gabriel Cánepa Initial version + +### 导入 os 模块 +import os + +### 将 os.uname() 的输出赋值给 systemInfo 变量 +### os.uname() 会返回五个字符串元组(sysname, nodename, release, version, machine) +### 参见文档:https://docs.python.org/3.2/library/os.html#module-os +systemInfo = os.uname() + +### 这是一个固定的数组,用于描述脚本输出的字段标题 +headers = ["Operating system","Hostname","Release","Version","Machine"] + +### 初始化索引值,用于定义每一步迭代中 +### systemInfo 和字段标题的索引 +index = 0 + +### 字段标题变量的初始值 +caption = "" + +### 值变量的初始值 +values = "" + +### 分隔线变量的初始值 +separators = "" + +### 开始循环 +for item in systemInfo: + if len(item) < len(headers[index]): + ### 一个包含横线的字符串,横线长度等于item[index] 或 headers[index] + ### 要重复一个字符,用引号圈起来并用星号(*)乘以所需的重复次数 + separators = separators + "-" * len(headers[index]) + " " + caption = caption + headers[index] + " " + values = values + systemInfo[index] + " " * (len(headers[index]) - len(item)) + " " + else: + separators = separators + "-" * len(item) + " " + caption = caption + headers[index] + " " * (len(item) - len(headers[index]) + 1) + values = values + item + " " + ### 索引加 1 + index = index + 1 +### 终止循环 + +### 输出转换为大写的变量(字段标题)名 +print(caption.upper()) + +### 输出分隔线 +print(separators) + +# 输出值(systemInfo 中的项目) +print(values) + +### 步骤: +### 1) 保持该脚本为 uname.py (或任何你想要的名字) +### 并通过如下命令给其执行权限: +### chmod +x uname.py +### 2) 执行它; +### ./uname.py +``` + +如果你已经按照上述描述将上面的脚本保存到一个文件里,并给文件增加了执行权限,那么运行它: + +``` +# chmod +x uname.py +# ./uname.py +``` + +如果试图运行脚本时你得到了如下的错误: + +``` +-bash: ./uname.py: /usr/bin/python3: bad interpreter: No such file or directory +``` + +这意味着你没有安装 Python3。如果那样的话,你要么安装 Python3 的包,要么替换解释器那行(如果如之前文章里概述的那样,跟着下面的步骤去更新 Python 执行文件的软连接,要特别注意并且非常小心): + +``` +#!/usr/bin/python3 +``` + +为 + +``` +#!/usr/bin/python +``` + +这样会通过使用已经安装好的 Python 2 去执行该脚本。 + +**注意**:该脚本在 Python 2.x 与 Pyton 3.x 上都测试成功过了。 + +尽管比较粗糙,你可以认为该脚本就是一个 Python 模块。这意味着你可以在 IDLE 中打开它(File → Open… → Select file): + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Open-Python-in-IDLE.png) + +*在 IDLE 中打开 Python* + +一个包含有文件内容的新窗口就会打开。然后执行 Run → Run module(或者按 F5)。脚本的输出就会在原始的 Shell 里显示出来: + +![](http://www.tecmint.com/wp-content/uploads/2016/05/Run-Python-Script.png) + +*执行 Python 脚本* + +如果你想纯粹用 bash 写一个脚本,也获得同样的结果,你可能需要结合使用 [awk][3]、[sed][4],并且借助复杂的方法来存储与获得列表中的元素(不要忘了使用 tr 命令将小写字母转为大写)。 + +另外,在所有的 Linux 系统版本中都至少集成了一个 Python 版本(2.x 或者 3.x,或者两者都有)。你还需要依赖 shell 去完成同样的目标吗?那样你可能需要为不同的 shell 编写不同的版本。 + +这里演示了面向对象编程的特性,它会成为一个系统管理员得力的助手。 + +**注意**:你可以在我的 Github 仓库里获得 [这个 python 脚本][5](或者其他的)。 + +### 总结 + +这篇文章里,我们讲解了 Python 中控制流、循环/迭代、和模块的概念。我们也演示了如何利用 Python 中面向对象编程的方法和属性来简化复杂的 shell 脚本。 + +你有任何其他希望去验证的想法吗?开始吧,写出自己的 Python 脚本,如果有任何问题可以咨询我们。不必犹豫,在分割线下面留下评论,我们会尽快回复你。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/learn-python-programming-to-write-linux-shell-scripts/ + +作者:[Gabriel Cánepa][a] +译者:[wi-cuckoo](https://github.com/wi-cuckoo) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.tecmint.com/author/gacanepa/ +[1]: http://www.tecmint.com/learn-python-programming-and-scripting-in-linux/ +[2]: http://please%20note%20that%20the%20if%20/%20else%20statement%20is%20only%20one%20of%20the%20many%20control%20flow%20tools%20available%20in%20Python.%20We%20reviewed%20it%20here%20since%20we%20will%20use%20it%20in%20our%20script%20later.%20You%20can%20learn%20more%20about%20the%20rest%20of%20the%20tools%20in%20the%20official%20docs. +[3]: http://www.tecmint.com/use-linux-awk-command-to-filter-text-string-in-files/ +[4]: http://www.tecmint.com/sed-command-to-create-edit-and-manipulate-files-in-linux/ +[5]: https://github.com/gacanepa/scripts/blob/master/python/uname.py + diff --git a/translated/tech/20160601 Learn Python Control Flow and Loops to Write and Tune Shell Scripts – Part 2.md b/translated/tech/20160601 Learn Python Control Flow and Loops to Write and Tune Shell Scripts – Part 2.md deleted file mode 100644 index d7b6bf6c2e..0000000000 --- a/translated/tech/20160601 Learn Python Control Flow and Loops to Write and Tune Shell Scripts – Part 2.md +++ /dev/null @@ -1,285 +0,0 @@ -学习使用 python 控制流和循环来编写和执行 Shell 脚本 —— Part 2 -====================================================================================== - -在[Python series][1]之前的文章里,我们分享了 Python的一个简介,它的命令行 shell 和 IDLE(译者注:python 自带的一个IDE)。我们也演示了如何进行数值运算,如何用变量存储值,还有如何打印那些值到屏幕上。最后,我们通过一个练习示例讲解了面向对象编程中方法和属性概念。 - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Write-Shell-Scripts-in-Python-Programming.png) ->在 Python 编程中写 Linux Shell 脚本 - -本篇中,我嫩会讨论控制流(根据用户输入的信息,计算的结果,或者一个变量的当前值选择不同的动作行为)和循环(自动重复执行任务),接着应用到我们目前所学东西中,编写一个简单的 shell 脚本,这个脚本会显示操作系统类型,主机名,内核发行版,版本号和机器硬件名字。 - -这个例子尽管很基础,但是会帮助我们证明,比起使用一些 bash 工具写 shell 脚本,我们可以使得用 Python OOP 的兼容特性来编写 shell 脚本会更简单些。 - -换句话说,我们想从这里出发 - -``` -# uname -snrvm -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Check-Hostname-of-Linux.png) -> 检查 Linux 的主机号 - -到 - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Check-Linux-Hostname-Using-Python-Script.png) -> 用 Python 脚本来检查 Linux 的主机号 - -或者 - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Script-to-Check-Linux-System-Information.png) -> 用脚本检查 Linux 系统信息 - -看着不错,不是吗?那我们就挽起袖子,开干吧。 - -### Python 中的控制流 - -如我们刚说那样,控制流允许我们根据一个给定的条件,选择不同的输出结果。在 Python 中最简单的实现就是一个 if/else 语句。 - -基本语法是这样的: - -``` -if condition: - # action 1 -else: - # action 2 -``` - -当 condition 求值为真(true),下面的代码块就会被执行(`# action 1`代表的部分)。否则,else 下面的代码就会运行。 -condition 可以是任何表达式,只要可以求得值为真或者假。 - -举个例子: - -1. 1 < 3 # 真 - -2. firstName == "Gabriel" # 对 firstName 为 Gabriel 的人是真,对其他不叫 Gabriel 的人为假 - - - 在第一个例子中,我们比较了两个值,判断 1 是否小于 3。 - - 在第二个例子中,我们比较了 firstName(一个变量)与字符串 “Gabriel”,看在当前执行的位置,firstName 的值是否等于该字符串。 - - 条件和 else 表达式都必须带着一个冒号(:)。 - - 缩进在 Python 非常重要。同样缩进下的行被认为是相同的代码块。 - -请注意,if/else 表达式只是 Python 中许多控制流工具的一个而已。我们先在这里了解以下,后面会用在我们的脚本中。你可以在[官方文档][2]中学到更多工具。 - -### Python 中的循环 - -简单来说,一个循环就是一组指令或者表达式序列,可以按顺序一直执行,只要一个条件为真,或者在一个列表里一次执行一个条目。 - -Python 中最简单的循环,就是 for 循环迭代一个给定列表的元素,或者一个字符串从第一个字符开始到最后一个字符结束。 - -基本语句: - -``` -for x in example: - # do this -``` - -这里的 example 可以是一个列表或者一个字符串。如果是列表,变量 x 就代表列表中每个元素;如果是字符串,x 就代表字符串中每个字符。 - -``` ->>> rockBands = [] ->>> rockBands.append("Roxette") ->>> rockBands.append("Guns N' Roses") ->>> rockBands.append("U2") ->>> for x in rockBands: - print(x) -or ->>> firstName = "Gabriel" ->>> for x in firstName: - print(x) -``` - -上面例子的输出如下图所示: - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Learn-Loops-in-Python.png) ->学习 Python 中的循环 - -### Python 模块 - -很明显,必须有个途径可以保存一系列的 Python 指令和表达式到文件里,然后需要的时候再取出来。 - -准确来说模块就是这样的。特别地,os 模块提供了一个接口到操作系统的底层,允许我们做许多通常在命令行下的操作。 - -没错,os 模块包含了许多方法和属性,可以用来调用,就如我们之前文章里讲解的那样。尽管如此,我们需要使用 import 关键词导入(或者叫包含)模块到开发环境里来: - -``` ->>> import os -``` - -我们来打印出当前的工作目录: - -``` ->>> os.getcwd() -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Learn-Python-Modules.png) ->学习 Python 模块 - -现在,让我们把所有结合在一起(包括之前文章里讨论的概念),编写需要的脚本。 - -### Python 脚本 - -以一个声明开始一个脚本是个不错的想法,表明脚本的目的,发行所依据的证书,和一个修订历史列出所做的修改。尽管这主要是个人喜好,但这会让我们的工作看起来比较专业。 - -这里有个脚本,可以输出这篇文章最前面展示的那样。脚本做了大量的注释,为了让大家可以理解发生了什么。 - -在进行下一步之前,花点时间来理解它。注意,我们是如何使用一个 if/else 结构,判断每个字段标题的长度是否比字段本身的值还大。 - -基于这个结果,我们用空字符去填充一个字段标题和下一个之间的空格。同时,我们使用一定数量的短线作为字段标题与其值之间的分割符。 - -``` -#!/usr/bin/python3 -# Change the above line to #!/usr/bin/python if you don't have Python 3 installed - -# Script name: uname.py -# Purpose: Illustrate Python's OOP capabilities to write shell scripts more easily -# License: GPL v3 (http://www.gnu.org/licenses/gpl.html) - -# Copyright (C) 2016 Gabriel Alejandro Cánepa -# ​Facebook / Skype / G+ / Twitter / Github: gacanepa -# Email: gacanepa (at) gmail (dot) com - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# REVISION HISTORY -# DATE VERSION AUTHOR CHANGE DESCRIPTION -# ---------- ------- -------------- -# 2016-05-28 1.0 Gabriel Cánepa Initial version - -# Import the os module -import os - -# Assign the output of os.uname() to the the systemInfo variable -# os.uname() returns a 5-string tuple (sysname, nodename, release, version, machine) -# Documentation: https://docs.python.org/3.2/library/os.html#module-os -systemInfo = os.uname() - -# This is a fixed array with the desired captions in the script output -headers = ["Operating system","Hostname","Release","Version","Machine"] - -# Initial value of the index variable. It is used to define the -# index of both systemInfo and headers in each step of the iteration. -index = 0 - -# Initial value of the caption variable. -caption = "" - -# Initial value of the values variable -values = "" - -# Initial value of the separators variable -separators = "" - -# Start of the loop -for item in systemInfo: - if len(item) < len(headers[index]): - # A string containing dashes to the length of item[index] or headers[index] - # To repeat a character(s), enclose it within quotes followed - # by the star sign (*) and the desired number of times. - separators = separators + "-" * len(headers[index]) + " " - caption = caption + headers[index] + " " - values = values + systemInfo[index] + " " * (len(headers[index]) - len(item)) + " " - else: - separators = separators + "-" * len(item) + " " - caption = caption + headers[index] + " " * (len(item) - len(headers[index]) + 1) - values = values + item + " " - # Increment the value of index by 1 - index = index + 1 -# End of the loop - -# Print the variable named caption converted to uppercase -print(caption.upper()) - -# Print separators -print(separators) - -# Print values (items in systemInfo) -print(values) - -# INSTRUCTIONS: -# 1) Save the script as uname.py (or another name of your choosing) and give it execute permissions: -# chmod +x uname.py -# 2) Execute it: -# ./uname.py -``` - -如果你已经保存上面的脚本到一个文件里,给文件执行权限,并且运行它,像代码底部描述的那样: - -``` -# chmod +x uname.py -# ./uname.py -``` - -如果试图运行脚本时,你得到了如下的错误: - -``` --bash: ./uname.py: /usr/bin/python3: bad interpreter: No such file or directory -``` - -这意味着你没有安装 Python3。如果那样的话,你要么安装 Python3 的包,要么替换解释器那行(如果你跟着下面的步骤去更新 Python 执行文件的软连接,如之前文章里概述的那样,要特别注意并且非常小心): - -``` -#!/usr/bin/python3 -``` - -为 - -``` -#!/usr/bin/python -``` - -这样会导致使用安装好的 Python 2 版本去执行该脚本。 - -**注意**: 该脚本在 Python 2.x 与 Pyton 3.x 上都测试成功过了。 - -尽管比较粗糙,你可以认为该脚本就是一个 Python 模块。这意味着你可以在 IDLE 中打开它(File → Open… → Select file): - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Open-Python-in-IDLE.png) ->在 IDLE 中打开 Python - -一个包含有文件内容的新窗口就会打开。然后执行 Run → Run module(或者按 F5)。脚本的输出就会在原 Shell 里显示出来: - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Run-Python-Script.png) ->执行 Python 脚本 - -如果你想纯粹用 bash 写一个脚本,也获得同样的结果,你可能需要结合使用 [awk][3],[sed][4],并且借助复杂的方法来存储与获得列表中的元素(忘了提醒使用 tr 命令将小写字母转为大写) - -另外,Python 在所有的 Linux 系统版本中集成了至少一个 Python 版本(2.x 或者 3.x,或者两者都有)。你还需要依赖 shell 去完成同样的目标吗,那样你可能会为不同的 shell 编写不同的版本。 - -这里演示了面向对象编程的特性,会成为一个系统管理员得力的助手。 - -**注意**:你可以在我的 Github 仓库里获得 [这个 python 脚本][5](或者其他的)。 - -### 总结 - -这篇文章里,我们讲解了 Python 中控制流,循环/迭代,和模块的概念。我们也演示了如何利用 Python 中 OOP 的方法和属性,来简化复杂的 shell 脚本。 - -你有任何其他希望去验证的想法吗?开始吧,写出自己的 Python 脚本,如果有任何问题可以咨询我们。不必犹豫,在分割线下面留下评论,我们会尽快回复你。 - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/learn-python-programming-to-write-linux-shell-scripts/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tecmint+%28Tecmint%3A+Linux+Howto%27s+Guide%29 - -作者:[Gabriel Cánepa][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/gacanepa/ -[1]: http://www.tecmint.com/learn-python-programming-and-scripting-in-linux/ -[2]: http://please%20note%20that%20the%20if%20/%20else%20statement%20is%20only%20one%20of%20the%20many%20control%20flow%20tools%20available%20in%20Python.%20We%20reviewed%20it%20here%20since%20we%20will%20use%20it%20in%20our%20script%20later.%20You%20can%20learn%20more%20about%20the%20rest%20of%20the%20tools%20in%20the%20official%20docs. -[3]: http://www.tecmint.com/use-linux-awk-command-to-filter-text-string-in-files/ -[4]: http://www.tecmint.com/sed-command-to-create-edit-and-manipulate-files-in-linux/ -[5]: https://github.com/gacanepa/scripts/blob/master/python/uname.py - From cd81201c1949457846c56e210ff08dce0ab2b945 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 20 Aug 2016 15:18:03 +0800 Subject: [PATCH 1453/1469] PUB:20160801 Linux how long a process has been running @MikeCoder --- ...801 Linux how long a process has been running.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) rename {translated/tech => published}/20160801 Linux how long a process has been running.md (76%) diff --git a/translated/tech/20160801 Linux how long a process has been running.md b/published/20160801 Linux how long a process has been running.md similarity index 76% rename from translated/tech/20160801 Linux how long a process has been running.md rename to published/20160801 Linux how long a process has been running.md index 9ef5a22859..e7e90948b1 100644 --- a/translated/tech/20160801 Linux how long a process has been running.md +++ b/published/20160801 Linux how long a process has been running.md @@ -1,14 +1,13 @@ -在 Linux 如何查看一个进程的运行时间 +在 Linux 下如何查看一个进程的运行时间 ===================== ![](http://s0.cyberciti.org/images/category/old/linux-logo.png) ->我是一个 Linux 系统的新手。我该如何在我的 Ubuntu 服务器上查看一个进程或者根据一个进程 id 来查看他已经运行的时间? +> 我是一个 Linux 系统的新手。我该如何在我的 Ubuntu 服务器上查看一个进程(或者根据进程 id 查看)已经运行了多久? -You need to use the ps command to see information about a selection of the active processes. The ps command provide following two formatting options: 你需要使用 ps 命令来查看关于一组正在运行的进程的信息。ps 命令提供了如下的两种格式化选项。 -1. etime 显示了自从该进程启动以来,经历过的时间。以[[DD-]hh:]mm:ss 的格式。 +1. etime 显示了自从该进程启动以来,经历过的时间,格式为 `[[DD-]hh:]mm:ss`。 2. etimes 显示了自该进程启动以来,经历过的时间,以秒的形式。 ### 如何查看一个进程已经运行的时间? @@ -39,7 +38,7 @@ $ ps -p 6176 -o etime $ ps -p 6176 -o etimes ``` -隐藏头部: +隐藏输出头部: ``` $ ps -p 6176 -o etime= @@ -50,7 +49,7 @@ $ ps -p 6176 -o etimes= ![](http://s0.cyberciti.org/uploads/faq/2016/08/How-to-check-how-long-a-process-has-been-running.jpg) -这个 6176 就是你想查看的进程的 PID。在这个例子中,我查看的是 openvpn 进程。你可以按照你的需求随意的更换 openvpn 进程名或者是 PID。在下面的例子中,我打印了 PID,执行命令,运行时间,用户 ID,和用户组 ID: +这个 6176 就是你想查看的进程的 PID。在这个例子中,我查看的是 openvpn 进程。你可以按照你的需求随意的更换 openvpn 进程名或者是 PID。在下面的例子中,我打印了 PID、执行命令、运行时间、用户 ID、和用户组 ID: ``` $ ps -p 6176 -o pid,cmd,etime,uid,gid @@ -69,7 +68,7 @@ via: http://www.cyberciti.biz/faq/how-to-check-how-long-a-process-has-been-runni 作者:[VIVEK GITE][a] 译者:[MikeCoder](https://github.com/MikeCoder) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 6519b7b569b2160dc4aa8123b5e26edb3f8ef90c Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 20 Aug 2016 16:14:22 +0800 Subject: [PATCH 1454/1469] PUB:20160802 3 graphical tools for Git @zpl1025 --- .../20160802 3 graphical tools for Git.md | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) rename {translated/tech => published}/20160802 3 graphical tools for Git.md (61%) diff --git a/translated/tech/20160802 3 graphical tools for Git.md b/published/20160802 3 graphical tools for Git.md similarity index 61% rename from translated/tech/20160802 3 graphical tools for Git.md rename to published/20160802 3 graphical tools for Git.md index e26b1c10d9..1cbad11ba6 100644 --- a/translated/tech/20160802 3 graphical tools for Git.md +++ b/published/20160802 3 graphical tools for Git.md @@ -1,19 +1,19 @@ -3 个 Git 图形工具 +Git 系列(五):三个 Git 图形化工具 ============================= ![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/government/BUSINESS_meritladder.png?itok=4CAH2wV0) 在本文里,我们来了解几个能帮你在日常工作中舒服地用上 Git 的工具。 -我是在这许多漂亮界面出来之前学习的 Git,而且我的日常工作经常是基于字符界面的,所以 Git 本身自带的大部分功能已经足够我用了。在我看来,最好能理解 Git 的工作原理。不过,能有的选也不错,下面这些就是能让你不用终端酒可以开始使用 Git 的一些方式。 +我是在这许多漂亮界面出来之前学习的 Git,而且我的日常工作经常是基于字符界面的,所以 Git 本身自带的大部分功能已经足够我用了。在我看来,最好能理解 Git 的工作原理。不过,能有的选也不错,下面这些就是能让你不用终端就可以开始使用 Git 的一些方式。 ### KDE Dolphin 里的 Git -我是一个 KDE 用户,如果不在 Plasma 桌面环境下,就是在 Fluxbox 的应用层。Dolphin 是一个非常优秀的文件管理器,有很多配置项以及大量秘密小功能。大家为它开发的插件都特别好用,其中一个是几乎完整的 Git 界面。是的,你可以直接在自己的桌面上很方便地管理你的 Git 仓库。 +我是一个 KDE 用户,如果不在 Plasma 桌面环境下,就是在 Fluxbox 的应用层。Dolphin 是一个非常优秀的文件管理器,有很多配置项以及大量秘密小功能。大家为它开发的插件都特别好用,其中一个几乎就是完整的 Git 界面。是的,你可以直接在自己的桌面上很方便地管理你的 Git 仓库。 -但首先,你得先确认已经安装了这个插件。有些发行版带的 KDE 将各种插件都装的满满的,而有些只装了一些最基本的,所以如果你在下面的步骤里没有看到 Git 相关选项,就在你的配置目录里找找类似 dolphin-extras 或者 dolphin-plugins 的字样。 +但首先,你得先确认已经安装了这个插件。有些发行版带的 KDE 将各种插件都装的满满的,而有些只装了一些最基本的,所以如果你在下面的步骤里没有看到 Git 相关选项,就在你的软件仓库里找找类似 dolphin-extras 或者 dolphin-plugins 的包。 -要打开 Git 集成,在任何 Dolphin 窗口里点击 Settings 菜单,并选择 Configure Dolphin。 +要打开 Git 集成功能,在 Dolphin 的任一窗口里点击 Settings 菜单,并选择 Configure Dolphin。 在弹出的 Configure Dolphin 窗口里,点击左边侧栏里的 Services 图标。 @@ -21,13 +21,13 @@ ![](https://opensource.com/sites/default/files/4_dolphinconfig.jpg) -保存你的改动并关闭 Dolphin 窗口。重新启动 Dolphin,浏览一个 Git 仓库试试看。你会发现现在所有文件图标都带有标记:绿色方框表示已经提交的文件,绿色实心方块表示文件有改动,没加入库里的文件没有标记,等等。 +(勾选上它,)然后保存你的改动并关闭 Dolphin 窗口。重新启动 Dolphin,浏览一个 Git 仓库试试看。你会发现现在所有文件图标都带有标记:绿色方框表示已经提交的文件,绿色实心方块表示文件有改动,没加入库里的文件没有标记,等等。 -之后你在 Git 仓库目录下点击鼠标右键弹出的菜单里就会有 Git 选项了。你在 Dolphin 窗口里点击鼠标就可以检出一个版本,推送或提交改动,还可以对文件进行 git add 或 git remove 操作。 +之后你在 Git 仓库目录下点击鼠标右键弹出的菜单里就会有 Git 选项了。你在 Dolphin 窗口里点击鼠标就可以检出一个版本,推送或提交改动,还可以对文件进行 `git add` 或 `git remove` 操作。 ![](https://opensource.com/sites/default/files/4_dolphingit.jpg) -不过 Dolphin 不支持克隆仓库或是改变远端路径,需要到终端窗口操作,按下 F4 就可以很方便地进行切换。 +不过 Dolphin 不支持克隆仓库或是改变远端仓库路径,需要到终端窗口操作,按下 F4 就可以很方便地进行切换。 坦白地说,KDE 的这个功能太牛了,这篇文章已经可以到此为止。将 Git 集成到原生文件管理器里可以让 Git 操作非常清晰;不管你在工作流程的哪个阶段,一切都能直接地摆在面前。在终端里 Git,切换到 GUI 后也是一样 Git。完美。 @@ -35,9 +35,9 @@ ### Sparkleshare -SparkleShare 来自桌面环境的另一大阵营,由一些 GNOME 开发人员发起,一个使用文件同步模型 ("例如 Dropbox!") 的项目。不过它并没有直接嵌入到 GNOME 里,所以你可以在任何平台使用。 +SparkleShare 来自桌面环境的另一大阵营,由一些 GNOME 开发人员发起,一个使用文件同步模型 (“就像 Dropbox 一样!”) 的项目。不过它并没有集成任何 GNOME 特有的组件,所以你可以在任何平台使用。 -如果你在用 Linux,可以从你的软件仓库直接安装 SparkleShare。如果是其它操作系统,可以去 SparkleShare 网站下载。你可以不用看 SparkleShare 网站上的指引,那个是告诉你如何架设 SparkleShare 服务器的,不是我们这里讨论的。当然你想的话也可以架 SparkleShare 服务器,但是 SparkleShare 能兼容 Git 仓库,所以其实没必要再架一个自己的。 +如果你在用 Linux,可以从你的软件仓库直接安装 SparkleShare。如果是其它操作系统,可以去 SparkleShare 网站下载。你可以不用看 SparkleShare 网站上的指引,那个是告诉你如何架设 SparkleShare 服务器的,不是我们这里讨论的。当然你想的话也可以架设 SparkleShare 服务器,但是 SparkleShare 能兼容 Git 仓库,所以其实没必要再架一个自己的。 在安装完成后,从应用程序菜单里启动 SparkleShare。走一遍设置向导,只有两个步骤外加一个简单介绍,然后可以选择是否将 SparkleShare 设置为随桌面自动启动。 @@ -49,7 +49,7 @@ SparkleShare 来自桌面环境的另一大阵营,由一些 GNOME 开发人员 ![](https://opensource.com/sites/default/files/4_sparklehost.jpg) -SparkleShare 支持本地 Git 项目,也可以是存放在像 GitHub 和 Bitbucket 这样的 Git 服务器上的项目。要获得访问权限,你可能会需要使用 SparkleShare 生成的客户端 ID。这是一个 SSH 密钥,作为你所用到服务的授权标记,包括你自己的 Git 服务器,应该也是用 SSH 公钥认证而不是用户名密码。将客户端 ID 拷贝到你服务器上 Git 用户的 authorized_hosts 文件里,或者是你的 Git 主机的 SSH 密钥面板里。 +SparkleShare 支持本地 Git 项目,也可以是存放在像 GitHub 和 Bitbucket 这样的公共 Git 服务器上的项目。要获得完整访问权限,你可能会需要使用 SparkleShare 生成的客户端 ID。这是一个 SSH 密钥,作为你所用到服务的授权令牌,包括你自己的 Git 服务器,应该也使用 SSH 公钥认证而不是用户名密码。将客户端 ID 拷贝到你服务器上 Git 用户的 `authorized_hosts` 文件里,或者是你的 Git 主机的 SSH 密钥面板里。 在配置要你要用的主机后,SparkleShare 会下载整个 Git 项目,包括(你可以自己选择)提交历史。可以在 ~/SparkleShare 目录下找到同步完成的文件。 @@ -61,9 +61,9 @@ SparkleShare 可能不适合所有人,但是它是一个强大而且简单的 另一种配合 Git 仓库工作的模型,没那么原生,更多的是监视方式;不是使用一个集成的应用程序和你的 Git 项目直接交互,而是你可以使用一个桌面客户端来监视项目改动,并随意处理每一个改动。这种方式的一个优势就是专注。当你实际只用到项目里的三个文件的时候,你可能不会关心所有的 125 个文件,能将这三个文件挑出来就很方便了。 -如果你觉得有好多 Git 网站,只是你还不知道。[桌面上的 Git 客户端][1] 上有一大把。实际上,Git 默认自带一个图形客户端。它们中平台适用最广,配置最丰富的是开源的 Git-cola 客户端,用 Python 和 Qt 写的。 +如果你觉得有好多 Git 托管网站,那只是你还不知道 Git 客户端有多少。[桌面上的 Git 客户端][1] 上有一大把。实际上,Git 默认自带一个图形客户端。它们中最跨平台、最可配置的就是开源的 [Git-cola][2] 客户端,用 Python 和 Qt 写的。 -如果你在用 Linux,Git-cola 应该在你的软件仓库里有。不是的话,可以直接从网站下载安装: +如果你在用 Linux,Git-cola 应该在你的软件仓库里就有。不是的话,可以直接从它的[网站下载][2]并安装: ``` $ python setup.py install @@ -71,47 +71,47 @@ $ python setup.py install 启动 git-cola 后,会有三个按钮用来打开仓库,创建新仓库,或克隆仓库。 -不管选哪个,最终都会停在一个 Git 仓库中。和大多数我用过的客户端一样,Git-cola 不会尝试成为你的仓库的接口;它们一般会让操作系统工具来做这个。换句话说,我可以通过 Git-cola 创建一个仓库,但随后我就在 Thunar 或 Emacs 里打开仓库开始工作。打开 Git-cola 来监视仓库很不错,因为当你创建新文件,或者改动文件的时候,它们都会出现在 Git-cola 的状态栏里。 +不管选哪个,最终都会停在一个 Git 仓库中。和大多数我用过的客户端一样,Git-cola 不会尝试成为你的仓库的接口;它们一般会让操作系统工具来做这个。换句话说,我可以通过 Git-cola 创建一个仓库,但随后我就在 Thunar 或 Emacs 里打开仓库开始工作。打开 Git-cola 来监视仓库很不错,因为当你创建新文件,或者改动文件的时候,它们都会出现在 Git-cola 的状态面板里。 -Git-cola 的默认布局不是线性的。我喜欢从左向右排列,因为 Git-cola 又是高度可配置的,你可以随便修改布局。我自己设置成最左边是状态栏,显示当前分支的任何改动,然后右边是改动栏,可以浏览当前改动,然后是动作栏,放一些常用任务的快速按钮,最后,最右边是提交栏,可以写提交信息。 +Git-cola 的默认布局不是线性的。我喜欢从左向右分布,因为 Git-cola 是高度可配置的,所以你可以随便修改布局。我自己设置成最左边是状态面板,显示当前分支的任何改动,然后右边是差异面板,可以浏览当前改动,然后是动作面板,放一些常用任务的快速按钮,最后,最右边是提交面板,可以写提交信息。 ![](https://opensource.com/sites/default/files/4_gitcola.jpg) 不管怎么改布局,下面是 Git-cola 的通用流程: -改动会出现在状态栏里。右键点击一个改动或选中一个文件,然后在动作栏里点击 Stage 按钮来将文件加入待提交暂存区。 +改动会出现在状态面板里。右键点击一个改动或选中一个文件,然后在动作面板里点击 Stage 按钮来将文件加入待提交暂存区。 -待提交文件的图标会变成绿色三角形,表示该文件有改动并且正等待提交。你也可以右键点击并选择 Unstage Selected 将改动移出待提交暂存区,或者点击动作栏里的 Unstage 按钮。 +待提交文件的图标会变成绿色三角形,表示该文件有改动并且正等待提交。你也可以右键点击并选择 Unstage Selected 将改动移出待提交暂存区,或者点击动作面板里的 Unstage 按钮。 -在改动栏里检查你的改动。 +在差异面板里检查你的改动。 当准备好提交后,输入提交信息并点击 Commit 按钮。 -在动作栏里还有其它按钮用来处理其它普通任务,比如抽取或推送。菜单里有更多的任务列表,比如专用的操作分支,改动审查,变更基础,等等。 +在动作面板里还有其它按钮用来处理其它普通任务,比如拉取或推送。菜单里有更多的任务列表,比如用于操作分支,改动审查,变基等等的专用操作。 我更愿意将 Git-cola 当作文件管理器的一个浮动面板(在不能用 Dolphin 的时候我只用 Git-cola)。虽然它的交互性没有完全集成 Git 的文件管理器那么强,但另一方面,它几乎提供了原始 Git 命令的所有功能,所以它实际上更为强大。 -有很多 Git 图形客户端。有些是不提供源代码的付费软件,有些只是用来查看,有些尝试加入新的特定术语(用 "sync" 替代 "push" ...?) 来重造 Git,也有一些是适合特定平台。Git-cola 一直是最简单的能在任意平台上使用的客户端,也是最贴近纯粹 Git 命令的,可以让用户在使用过程中学习 Git,高手也很满意它的界面和术语。 +有很多 Git 图形客户端。有些是不提供源代码的付费软件,有些只是用来查看,有些尝试加入新的特定术语(用 "sync" 替代 "push" ...?) 来重造 Git,也有一些只适合特定的平台。Git-cola 一直是能在任意平台上使用的最简单的客户端,也是最贴近纯粹 Git 命令的,可以让用户在使用过程中学习 Git,即便是高手也会很满意它的界面和术语。 ### Git 命令还是图形界面? -我一般不用图形工具来操作 Git;大多数时候我使用上面介绍的工具,是帮助其他人找出适合他们的界面。不过在一天结束的时候,不同的工作适合不一样的工具。我喜欢基于终端的 Git 命令是因为可以很好地集成到 Emacs 里,但如果某天我几乎都在用 Inkscape 工作时,我一般会很自然地使用 Dolphin 里带的 Git,因为我在 Dolphin 环境里。 +我一般不用图形工具来操作 Git;一般我使用上面介绍的工具时,只是帮助其他人找出适合他们的界面。不过,最终归结于怎么适合你的工作。我喜欢基于终端的 Git 命令是因为它可以很好地集成到 Emacs 里,但如果某天我几乎都在用 Inkscape 工作时,我一般会很自然地使用 Dolphin 里带的 Git,因为我在 Dolphin 环境里。 -如何使用 Git 你自己可以选择;但要记住 Git 是一种让生活更轻松的方式,也是让你在工作中更安全地尝试一些疯狂点子的方法。熟悉 Git 的工作模式,然后不管什么方式使用 Git,只要能让你觉得最适合就可以。 +如何使用 Git 你自己可以选择;但要记住 Git 是一种让生活更轻松的方式,也是让你在工作中更安全地尝试一些疯狂点子的方法。熟悉 Git 的工作模式,然后不管以什么方式使用 Git,只要能让你觉得最适合就可以。 在下一期文章里,我们将了解如何架设和管理 Git 服务器,包括用户权限和管理,以及运行定制脚本。 - -------------------------------------------------------------------------------- via: https://opensource.com/life/16/8/graphical-tools-git 作者:[Seth Kenlon][a] 译者:[zpl1025](https://github.com/zpl1025) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/seth [1]: https://git-scm.com/downloads/guis +[2]: https://git-cola.github.io/ From 4402eeb0d44a96f9ed0b931c18e7b4e31f16e4ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=AE=B6=E5=90=AF?= Date: Sat, 20 Aug 2016 18:51:28 +0800 Subject: [PATCH 1455/1469] Translating by cposture (#4321) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 75 * Translated by cposture * Translated by cposture * Translated by cposture * 应 erlinux 的要求,把未翻译完的文章移到 source * 应 erlinux 的要求,把未翻译完的文章移到 source,同时删除 translated文章 * Translating --- ...hon unittest - assertTrue is truthy - assertFalse is falsy.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160512 Python unittest - assertTrue is truthy - assertFalse is falsy.md b/sources/tech/20160512 Python unittest - assertTrue is truthy - assertFalse is falsy.md index bfed46fb0e..30589a9d63 100644 --- a/sources/tech/20160512 Python unittest - assertTrue is truthy - assertFalse is falsy.md +++ b/sources/tech/20160512 Python unittest - assertTrue is truthy - assertFalse is falsy.md @@ -1,3 +1,4 @@ +Translating by cposture Python unittest: assertTrue is truthy, assertFalse is falsy =========================== From f201901d69dec1c3f80f092c5ae1bd780da2c849 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 20 Aug 2016 18:52:24 +0800 Subject: [PATCH 1456/1469] =?UTF-8?q?20160820-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ....js applications with HTTP2 Server Push.md | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 sources/tech/20160816 Accelerating Node.js applications with HTTP2 Server Push.md diff --git a/sources/tech/20160816 Accelerating Node.js applications with HTTP2 Server Push.md b/sources/tech/20160816 Accelerating Node.js applications with HTTP2 Server Push.md new file mode 100644 index 0000000000..9ea8c9079a --- /dev/null +++ b/sources/tech/20160816 Accelerating Node.js applications with HTTP2 Server Push.md @@ -0,0 +1,114 @@ +Accelerating Node.js applications with HTTP/2 Server Push +========================================================= + +In April, we [announced support for HTTP/2 Server][3] Push via the HTTP Link header. My coworker John has demonstrated how easy it is to [add Server Push to an example PHP application][4]. + +![](https://blog.cloudflare.com/content/images/2016/08/489477622_594bf9e3d9_z.jpg) + +We wanted to make it easy to improve the performance of contemporary websites built with Node.js. we developed the netjet middleware to parse the generated HTML and automatically add the Link headers. When used with an example Express application you can see the headers being added: + +![](https://blog.cloudflare.com/content/images/2016/08/2016-08-11_13-32-45.png) + +We use Ghost to power this blog, so if your browser supports HTTP/2 you have already benefited from Server Push without realizing it! More on that below. + +In netjet, we use the PostHTML project to parse the HTML with a custom plugin. Right now it is looking for images, scripts and external stylesheets. You can implement this same technique in other environments too. + +Putting an HTML parser in the response stack has a downside: it will increase the page load latency (or "time to first byte"). In most cases, the added latency will be overshadowed by other parts of your application, such as database access. However, netjet includes an adjustable LRU cache keyed by ETag headers, allowing netjet to insert Link headers quickly on pages already parsed. + +If you are designing a brand new application, however, you should consider storing metadata on embedded resources alongside your content, eliminating the HTML parse, and possible latency increase, entirely. + +Netjet is compatible with any Node.js HTML framework that supports Express-like middleware. Getting started is as simple as adding netjet to the beginning of your middleware chain. + +``` +var express = require('express'); +var netjet = require('netjet'); +var root = '/path/to/static/folder'; + +express() + .use(netjet({ + cache: { + max: 100 + } + })) + .use(express.static(root)) + .listen(1337); +``` + +With a little more work, you can even use netjet without frameworks. + +``` +var http = require('http'); +var netjet = require('netjet'); + +var port = 1337; +var hostname = 'localhost'; +var preload = netjet({ + cache: { + max: 100 + } +}); + +var server = http.createServer(function (req, res) { + preload(req, res, function () { + res.statusCode = 200; + res.setHeader('Content-Type', 'text/html'); + res.end('

Hello World

'); + }); +}); + +server.listen(port, hostname, function () { + console.log('Server running at http://' + hostname + ':' + port+ '/'); +}); +``` + +See the [netjet documentation][1] for more information on the supported options. + +### Seeing what’s pushed + +![](https://blog.cloudflare.com/content/images/2016/08/2016-08-02_10-49-33.png) + +Chrome's Developer Tools makes it easy to verify that your site is using Server Push. The Network tab shows pushed assets with "Push" included as part of the initiator. + +Unfortunately, Firefox's Developers Tools don't yet directly expose if the resource pushed. You can, however, check for the cf-h2-pushed header in the page's response headers, which contains a list of resources that CloudFlare offered browsers over Server Push. + +Contributions to improve netjet or the documentation are greatly appreciated. I'm excited to hear where people are using netjet. + +### Ghost and Server Push + +Ghost is one such exciting integration. With the aid of the Ghost team, I've integrated netjet, and it has been available as an opt-in beta since version 0.8.0. + +If you are running a Ghost instance, you can enable Server Push by modifying the server's config.js file and add the preloadHeaders option to the production configuration block. + + +``` +production: { + url: 'https://my-ghost-blog.com', + preloadHeaders: 100, + // ... +} +``` + +Ghost has put together [a support article][2] for Ghost(Pro) customers. + +### Conclusion + +With netjet, your Node.js applications can start to use browser preloading and, when used with CloudFlare, HTTP/2 Server Push today. + +At CloudFlare, we're excited to make tools to help increase the performance of websites. If you find this interesting, we are hiring in Austin, Texas; Champaign, Illinois; London; San Francisco; and Singapore. + + +-------------------------------------------------------------------------------- + +via: https://blog.cloudflare.com/accelerating-node-js-applications-with-http-2-server-push/?utm_source=nodeweekly&utm_medium=email + +作者:[Terin Stock][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://blog.cloudflare.com/author/terin-stock/ +[1]: https://www.npmjs.com/package/netjet +[2]: http://support.ghost.org/preload-headers/ +[3]: https://www.cloudflare.com/http2/server-push/ +[4]: https://blog.cloudflare.com/using-http-2-server-push-with-php/ From 7f26b08ef20ee726a76e646c234bb2116183bf33 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 20 Aug 2016 18:59:53 +0800 Subject: [PATCH 1457/1469] =?UTF-8?q?20160820-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Deploying React with Zero Configuration.md | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 sources/tech/20160816 Deploying React with Zero Configuration.md diff --git a/sources/tech/20160816 Deploying React with Zero Configuration.md b/sources/tech/20160816 Deploying React with Zero Configuration.md new file mode 100644 index 0000000000..e2cb16a223 --- /dev/null +++ b/sources/tech/20160816 Deploying React with Zero Configuration.md @@ -0,0 +1,69 @@ +Deploying React with Zero Configuration +======================== + +So you want to build an app with [React][1]? "[Getting started][2]" is easy… and then what? + +React is a library for building user interfaces, which comprise only one part of an app. Deciding on all the other parts — styles, routers, npm modules, ES6 code, bundling and more — and then figuring out how to use them is a drain on developers. This has become known as [javascript fatigue][3]. Despite this complexity, usage of React continues to grow. + +The community answers this challenge by sharing boilerplates. These [boilerplates][4] reveal the profusion of architectural choices developers must make. That official "Getting Started" seems so far away from the reality of an operational app. + +### New, Zero-configuration Experience + +Inspired by the cohesive developer experience provided by [Ember.js][5] and [Elm][6], the folks at Facebook wanted to provide an easy, opinionated way forward. They created a new way to develop React apps, `create-react-app`. In the three weeks since initial public release, it has received tremendous community awareness (over 8,000 GitHub stargazers) and support (dozens of pull requests). + +`create-react-app` is different than many past attempts with boilerplates and starter kits. It targets zero configuration [[convention-over-configuration]][7], focusing the developer on what is interesting and different about their application. + +A powerful side-effect of zero configuration is that the tools can now evolve in the background. Zero configuration lays the foundation for the tools ecosystem to create automation and delight developers far beyond React itself. + +### Zero-configuration Deploy to Heroku + +Thanks to the zero-config foundation of create-react-app, the idea of zero-config deployment seemed within reach. Since these new apps all share a common, implicit architecture, the build process can be automated and then served with intelligent defaults. So, [we created this community buildpack to experiment with no-configuration deployment to Heroku][8]. + +#### Create and Deploy a React App in Two Minutes + +You can get started building React apps for free on Heroku. + +``` +npm install -g create-react-app +create-react-app my-app +cd my-app +git init +heroku create -b https://github.com/mars/create-react-app-buildpack.git +git add . +git commit -m "react-create-app on Heroku" +git push heroku master +heroku open +``` + +Try it yourself [using the buildpack docs][9]. + +### Growing Up from Zero Config + +create-react-app is very new (currently version 0.2) and since its target is a crystal-clear developer experience, more advanced use cases are not supported (or may never be supported). For example, it does not provide server-side rendering or customized bundles. + +To support greater control, create-react-app includes the command npm run eject. Eject unpacks all the tooling (config files and package.json dependencies) into the app's directory, so you can customize to your heart's content. Once ejected, changes you make may necessitate switching to a custom deployment with Node.js and/or static buildpacks. Always perform such project changes through a branch / pull request, so they can be easily undone. Heroku's Review Apps are perfect for testing changes to the deployment. + +We'll be tracking progress on create-react-app and adapting the buildpack to support more advanced use cases as they become available. Happy deploying! + + + +-------------------------------------------------------------------------------- + +via: https://blog.heroku.com/deploying-react-with-zero-configuration?c=7013A000000NnBFQA0&utm_campaign=Display%20-%20Endemic%20-Cooper%20-Node%20-%20Blog%20-%20Zero-Configuration&utm_medium=display&utm_source=cooperpress&utm_content=blog&utm_term=node + +作者:[Mars Hall][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://blog.heroku.com/deploying-react-with-zero-configuration?c=7013A000000NnBFQA0&utm_campaign=Display%20-%20Endemic%20-Cooper%20-Node%20-%20Blog%20-%20Zero-Configuration&utm_medium=display&utm_source=cooperpress&utm_content=blog&utm_term=node +[1]: https://facebook.github.io/react/ +[2]: https://facebook.github.io/react/docs/getting-started.html +[3]: https://medium.com/@ericclemmons/javascript-fatigue-48d4011b6fc4 +[4]: https://github.com/search?q=react+boilerplate +[5]: http://emberjs.com/ +[6]: http://elm-lang.org/ +[7]: http://rubyonrails.org/doctrine/#convention-over-configuration +[8]: https://github.com/mars/create-react-app-buildpack +[9]: https://github.com/mars/create-react-app-buildpack#usage From 7c2d01895c137d72d40c84fcc901e20b01a87634 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 20 Aug 2016 19:08:50 +0800 Subject: [PATCH 1458/1469] =?UTF-8?q?20160820-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...JavaScript framework - Execution timing.md | 192 ++++++++++++++++++ 1 file changed, 192 insertions(+) create mode 100644 sources/tech/20160812 Writing a JavaScript framework - Execution timing.md diff --git a/sources/tech/20160812 Writing a JavaScript framework - Execution timing.md b/sources/tech/20160812 Writing a JavaScript framework - Execution timing.md new file mode 100644 index 0000000000..601abecb80 --- /dev/null +++ b/sources/tech/20160812 Writing a JavaScript framework - Execution timing.md @@ -0,0 +1,192 @@ +Writing a JavaScript framework - Execution timing, beyond setTimeout +=================== + +This is the second chapter of the Writing a JavaScript framework series. In this chapter, I am going to explain the different ways of executing asynchronous code in the browser. You will read about the event loop and the differences between timing techniques, like setTimeout and Promises. + +The series is about an open-source client-side framework, called NX. During the series, I explain the main difficulties I had to overcome while writing the framework. If you are interested in NX please visit the [home page][1]. + +The series includes the following chapters: + +The series includes the following chapters: + +1. [Project structuring][2] +2. Execution timing (current chapter) +3. [Sandboxed code evaluation][3] +4. Data binding (part 1) +5. Data binding (part 2) +6. Custom elements +7. Client side routing + +### Async code execution + +Most of you are probably familiar with Promise, process.nextTick(), setTimeout() and maybe requestAnimationFrame() as ways of executing asynchronous code. They all use the event loop internally, but they behave quite differently regarding precise timing. + +In this chapter, I will explain the differences, then show you how to implement a timing system that a modern framework, like NX requires. Instead of reinventing the wheel we will use the native event loop to achieve our goals. + +### The event loop + +The event loop is not even mentioned in the ES6 spec. JavaScript only has jobs and job queues on its own. A more complex event loop is specified separately by NodeJS and the HTML5 spec. Since this series is about the front-end I will explain the latter one here. + +The event loop is called a loop for a reason. It is infinitely looping and looking for new tasks to execute. A single iteration of this loop is called a tick. The code executed during a tick is called a task. + +``` +while (eventLoop.waitForTask()) { + eventLoop.processNextTask() +} +``` + +Tasks are synchronous pieces of code that may schedule other tasks in the loop. An easy programmatic way to schedule a new task is setTimeout(taskFn). However, tasks may come from several other sources like user events, networking or DOM manipulation. + +![](https://risingstack-blog.s3.amazonaws.com/2016/Aug/Execution_timing_event_lopp_with_tasks-1470127590983.svg) + +### Task queues + +To complicate things a bit, the event loop can have multiple task queues. The only two restrictions are that events from the same task source must belong to the same queue and tasks must be processed in insertion order in every queue. Apart from these, the user agent is free to do as it wills. For example, it may decide which task queue to process next. + +``` +while (eventLoop.waitForTask()) { + const taskQueue = eventLoop.selectTaskQueue() + if (taskQueue.hasNextTask()) { + taskQueue.processNextTask() + } +} +``` + +With this model, we loose precise control over timing. The browser may decide to totally empty several other queues before it gets to our task scheduled with setTimeout(). + +![](https://risingstack-blog.s3.amazonaws.com/2016/Aug/Execution_timing_event_loop_with_task_queues-1470127624172.svg) + +### The microtask queue + +Fortunately, the event loop also has a single queue called the microtask queue. The microtask queue is completely emptied in every tick after the current task finished executing. + + +``` +while (eventLoop.waitForTask()) { + const taskQueue = eventLoop.selectTaskQueue() + if (taskQueue.hasNextTask()) { + taskQueue.processNextTask() + } + + const microtaskQueue = eventLoop.microTaskQueue + while (microtaskQueue.hasNextMicrotask()) { + microtaskQueue.processNextMicrotask() + } +} +``` + +The easiest way to schedule a microtask is Promise.resolve().then(microtaskFn). Microtasks are processed in insertion order, and since there is only one microtask queue, the user agent can't mess with us this time. + +Moreover, microtasks can schedule new microtasks that will be inserted in the same queue and processed in the same tick. + +![](https://risingstack-blog.s3.amazonaws.com/2016/Aug/Execution_timing_event_loop_with_microtask_queue-1470127679393.svg) + +### Rendering + +The last thing missing is the rendering schedule. Unlike event handling or parsing, rendering is not done by separate background tasks. It is an algorithm that may run at the end of every loop tick. + +The user agent has a lot of freedom again: It may render after every task, but it may decide to let hundreds of tasks execute without rendering. + +Fortunately, there is requestAnimationFrame(), that executes the passed function right before the next render. Our final event loop model looks like this. + +``` +while (eventLoop.waitForTask()) { + const taskQueue = eventLoop.selectTaskQueue() + if (taskQueue.hasNextTask()) { + taskQueue.processNextTask() + } + + const microtaskQueue = eventLoop.microTaskQueue + while (microtaskQueue.hasNextMicrotask()) { + microtaskQueue.processNextMicrotask() + } + + if (shouldRender()) { + applyScrollResizeAndCSS() + runAnimationFrames() + render() + } +} +``` + +Now let’s use all this knowledge to build a timing system! + +### Using the event loop + +As most modern frameworks, NX deals with DOM manipulation and data binding in the background. It batches operations and executes them asynchronously for better performance. To time these things right it relies on Promises, MutationObservers and requestAnimationFrame(). + +The desired timing is this: + +1. Code from the developer +2. Data binding and DOM manipulation reactions by NX +3. Hooks defined by the developer +4. Rendering by the user agent + +#### Step 1 + +NX registers object mutations with ES6 Proxies and DOM mutations with a MutationObserver synchronously (more about these in the next chapters). It delays the reactions as microtasks until step 2 for optimized performance. This delay is done by Promise.resolve().then(reaction) for object mutations, and handled automatically by the MutationObserver as it uses microtasks internally. + +#### Step 2 + +The code (task) from the developer finished running. The microtask reactions registered by NX start executing. Since they are microtasks they run in order. Note that we are still in the same loop tick. + +#### Step 3 + +NX runs the hooks passed by the developer using requestAnimationFrame(hook). This may happen in a later loop tick. The important thing is that the hooks run before the next render and after all data, DOM and CSS changes are processed. + +#### Step 4 + +The browser renders the next view. This may also happen in a later loop tick, but it never happens before the previous steps in a tick. + +### Things to keep in mind + +We just implemented a simple but effective timing system on top of the native event loop. It works well in theory, but timing is a delicate thing, and slight mistakes can cause some very strange bugs. + +In a complex system, it is important to set up some rules about the timing and keep to them later. For NX I have the following rules. + +1. Never use setTimeout(fn, 0) for internal operations +2. Register microtasks with the same method +3. Reserve microtasks for internal operations only +4. Do not pollute the developer hook execution time window with anything else + +#### Rule 1 and 2 + +Reactions on data and DOM manipulation should execute in the order the manipulations happened. It is okay to delay them as long as their execution order is not mixed up. Mixing execution order makes things unpredictable and difficult to reason about. + +setTimeout(fn, 0) is totally unpredictable. Registering microtasks with different methods also leads to mixed up execution order. For example microtask2 would incorrectly execute before microtask1 in the example below. + +``` +Promise.resolve().then().then(microtask1) +Promise.resolve().then(microtask2) +``` + +![](https://risingstack-blog.s3.amazonaws.com/2016/Aug/Execution_timing_microtask_registration_method-1470127727609.svg) + +#### Rule 3 and 4 + +Separating the time window of the developer code execution and the internal operations is important. Mixing these two would start to cause seemingly unpredictable behavior, and it would eventually force developers to learn about the internal working of the framework. I think many front-end developers have experiences like this already. + +### Conclusion + +If you are interested in the NX framework, please visit the home page. Adventurous readers can find the [NX source code][5] in this Github repository. + +I hope you found this a good read, see you next time when I’ll discuss [sandboxed code evaluation][4]! + +If you have any thoughts on the topic, please share them in the comments. + +-------------------------------------------------------------------------------- + +via: https://blog.risingstack.com/writing-a-javascript-framework-execution-timing-beyond-settimeout/?utm_source=javascriptweekly&utm_medium=email + +作者:[Bertalan Miklos][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://blog.risingstack.com/author/bertalan/ +[1]: http://nx-framework.com/ +[2]: https://blog.risingstack.com/writing-a-javascript-framework-project-structuring/ +[3]: https://blog.risingstack.com/writing-a-javascript-framework-sandboxed-code-evaluation/ +[4]: https://blog.risingstack.com/writing-a-javascript-framework-sandboxed-code-evaluation/ +[5]: https://github.com/RisingStack/nx-framework From 6a163ec25b6d8e31b332c210d8fe7dca5c6358c3 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 20 Aug 2016 19:11:23 +0800 Subject: [PATCH 1459/1469] =?UTF-8?q?20160820-4=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0160805 Introducing React Native Ubuntu.md | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 sources/tech/20160805 Introducing React Native Ubuntu.md diff --git a/sources/tech/20160805 Introducing React Native Ubuntu.md b/sources/tech/20160805 Introducing React Native Ubuntu.md new file mode 100644 index 0000000000..48e7be997c --- /dev/null +++ b/sources/tech/20160805 Introducing React Native Ubuntu.md @@ -0,0 +1,39 @@ +Introducing React Native Ubuntu +===================== + +In the Webapps team at Canonical, we are always looking to make sure that web and near-web technologies are available to developers. We want to make everyone's life easier, enable the use of tools that are familiar to web developers and provide an easy path to using them on the Ubuntu platform. + +We have support for web applications and creating and packaging Cordova applications, both of these enable any web framework to be used in creating great application experiences on the Ubuntu platform. + +One popular web framework that can be used in these environments is React.js; React.js is a UI framework with a declarative programming model and strong component system, which focuses primarily on the composition of the UI, so you can use what you like elsewhere. + +While these environments are great, sometimes you need just that bit more performance, or to be able to work with native UI components directly, but working in a less familiar environment might not be a good use of time. If you are familiar with React.js, it's easy to move into full native development with all your existing knowledge and tools by developing with React Native. React Native is the sister to React.js, you can use the same style and code to create an application that works directly with native components with native levels of performance, but with the ease of and rapid development you would expect. + + +![](http://i.imgur.com/ZsSHWXP.png) + +We are happy to announce that along with our HTML5 application support, it is now possible to develop React Native applications on the Ubuntu platform. You can port existing iOS or Android React Native applications, or you can start a new application leveraging your web-dev skills. + +You can find the source code for React Native Ubuntu [here][1], + +To get started, follow the instructions in [README-ubuntu.md][2] and create your first application. + +The Ubuntu support includes the ability to generate packages. Managed by the React Native CLI, building a snap is as easy as 'react-native package-ubuntu --snap'. It's also possible to build a click package for Ubuntu devices; meaning React Native Ubuntu apps are store ready from the start. + +Over the next little while there will be blogs posts on everything you need to know about developing a React Native Application for the Ubuntu platform; creating the app, the development process, packaging and releasing to the store. There will also be some information on how to develop new reusable modules, that can add extra functionality to the runtime and be distributed as Node Package Manager (npm) modules. + +Go and experiment, and see what you can create. + +-------------------------------------------------------------------------------- + +via: https://developer.ubuntu.com/en/blog/2016/08/05/introducing-react-native-ubuntu/?utm_source=javascriptweekly&utm_medium=email + +作者:[Justin McPherson][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://developer.ubuntu.com/en/blog/authors/justinmcp/ +[1]: https://github.com/CanonicalLtd/react-native +[2]: https://github.com/CanonicalLtd/react-native/blob/ubuntu/README-ubuntu.md From 9804fb6f418b8eb2ddc2c3ad24a238a3c82f6eee Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 20 Aug 2016 19:22:08 +0800 Subject: [PATCH 1460/1469] =?UTF-8?q?20160820-5=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20160813 Journey-to-HTTP2.md | 213 ++++++++++++++++++++++ 1 file changed, 213 insertions(+) create mode 100644 sources/tech/20160813 Journey-to-HTTP2.md diff --git a/sources/tech/20160813 Journey-to-HTTP2.md b/sources/tech/20160813 Journey-to-HTTP2.md new file mode 100644 index 0000000000..706ec1485f --- /dev/null +++ b/sources/tech/20160813 Journey-to-HTTP2.md @@ -0,0 +1,213 @@ +Journey to HTTP/2 +=================== + +It has been quite some time since I last wrote through my blog and the reason is not being able to find enough time to put into it. I finally got some time today and thought to put some of it writing about HTTP. + +HTTP is the protocol that every web developer should know as it powers the whole web and knowing it is definitely going to help you develop better applications. + +In this article, I am going to be discussing what HTTP is, how it came to be, where it is today and how did we get here. + +### What is HTTP? + +First things first, what is HTTP? HTTP is the TCP/IP based application layer communication protocol which standardizes how the client and server communicate with each other. It defines how the content is requested and transmitted across the internet. By application layer protocol, I mean it’s just an abstraction layer that standardizes how the hosts (clients and servers) communicate and itself it depends upon TCP/IP to get request and response between the client and server. By default TCP port 80 is used but other ports can be used as well. HTTPS, however, uses port 443. + +#### HTTP/0.9 - The One Liner (1991) + +The first documented version of HTTP was HTTP/0.9 which was put forward in 1991. It was the simplest protocol ever; having a single method called GET. If a client had to access some webpage on the server, it would have made the simple request like below + +``` +GET /index.html +``` + +And the response from server would have looked as follows + +``` +(response body) +(connection closed) +``` + +That is, the server would get the request, reply with the HTML in response and as soon as the content has been transferred, the connection will be closed. There were + +- No headers +- GET was the only allowed method +- Response had to be HTML + +As you can see, the protocol really had nothing more than being a stepping stone for what was to come. + +#### HTTP/1.0 - 1996 + +In 1996, the next version of HTTP i.e. HTTP/1.0 evolved that vastly improved over the original version. + +Unlike HTTP/0.9 which was only designed for HTML response, HTTP/1.0 could now deal with other response formats i.e. images, video files, plain text or any other content type as well. It added more methods (i.e. POST and HEAD), request/response formats got changed, HTTP headers got added to both the request and responses, status codes were added to identify the response, character set support was introduced, multi-part types, authorization, caching, content encoding and more was included. + +Here is how a sample HTTP/1.0 request and response might have looked like: + +``` +GET / HTTP/1.0 +Host: kamranahmed.info +User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) +Accept: */* +``` + +As you can see, alongside the request, client has also sent it’s personal information, required response type etc. While in HTTP/0.9 client could never send such information because there were no headers. + +Example response to the request above may have looked like below + +``` +HTTP/1.0 200 OK +Content-Type: text/plain +Content-Length: 137582 +Expires: Thu, 05 Dec 1997 16:00:00 GMT +Last-Modified: Wed, 5 August 1996 15:55:28 GMT +Server: Apache 0.84 + +(response body) +(connection closed) +``` + +In the very beginning of the response there is HTTP/1.0 (HTTP followed by the version number), then there is the status code 200 followed by the reason phrase (or description of the status code, if you will). + +In this newer version, request and response headers were still kept as ASCII encoded, but the response body could have been of any type i.e. image, video, HTML, plain text or any other content type. So, now that server could send any content type to the client; not so long after the introduction, the term “Hyper Text” in HTTP became misnomer. HMTP or Hypermedia transfer protocol might have made more sense but, I guess, we are stuck with the name for life. + +One of the major drawbacks of HTTP/1.0 were you couldn’t have multiple requests per connection. That is, whenever a client will need something from the server, it will have to open a new TCP connection and after that single request has been fulfilled, connection will be closed. And for any next requirement, it will have to be on a new connection. Why is it bad? Well, let’s assume that you visit a webpage having 10 images, 5 stylesheets and 5 javascript files, totalling to 20 items that needs to fetched when request to that webpage is made. Since the server closes the connection as soon as the request has been fulfilled, there will be a series of 20 separate connections where each of the items will be served one by one on their separate connections. This large number of connections results in a serious performance hit as requiring a new TCP connection imposes a significant performance penalty because of three-way handshake followed by slow-start. + +### Three-way Handshake + +Three-way handshake in it’s simples form is that all the TCP connections begin with a three-way handshake in which the client and the server share a series of packets before starting to share the application data. + +- SYN - Client picks up a random number, let’s say x, and sends it to the server. +- SYN ACK - Server acknowledges the request by sending an ACK packet back to the client which is made up of a random number, let’s say y picked up by server and the number x+1 where x is the number that was sent by the client +- ACK - Client increments the number y received from the server and sends an ACK packet back with the number x+1 + +Once the three-way handshake is completed, the data sharing between the client and server may begin. It should be noted that the client may start sending the application data as soon as it dispatches the last ACK packet but the server will still have to wait for the ACK packet to be recieved in order to fulfill the request. + +![](http://i.imgur.com/uERG2G2.png) + +However, some implementations of HTTP/1.0 tried to overcome this issue by introducing a new header called Connection: keep-alive which was meant to tell the server “Hey server, do not close this connection, I need it again”. But still, it wasn’t that widely supported and the problem still persisted. + +Apart from being connectionless, HTTP also is a stateless protocol i.e. server doesn’t maintain the information about the client and so each of the requests has to have the information necessary for the server to fulfill the request on it’s own without any association with any old requests. And so this adds fuel to the fire i.e. apart from the large number of connections that the client has to open, it also has to send some redundant data on the wire causing increased bandwidth usage. + +#### HTTP/1.1 - 1999 + +After merely 3 years of HTTP/1.0, the next version i.e. HTTP/1.1 was released in 1999; which made alot of improvements over it’s predecessor. The major improvements over HTTP/1.0 included + +- New HTTP methods were added, which introduced PUT, PATCH, HEAD, OPTIONS, DELETE + +- Hostname Identification In HTTP/1.0 Host header wasn’t required but HTTP/1.1 made it required. + +- Persistent Connections As discussed above, in HTTP/1.0 there was only one request per connection and the connection was closed as soon as the request was fulfilled which resulted in accute performance hit and latency problems. HTTP/1.1 introduced the persistent connections i.e. connections weren’t closed by default and were kept open which allowed multiple sequential requests. To close the connections, the header Connection: close had to be available on the request. Clients usually send this header in the last request to safely close the connection. + +- Pipelining It also introduced the support for pipelining, where the client could send multiple requests to the server without waiting for the response from server on the same connection and server had to send the response in the same sequence in which requests were received. But how does the client know that this is the point where first response download completes and the content for next response starts, you may ask! Well, to solve this, there must be Content-Length header present which clients can use to identify where the response ends and it can start waiting for the next response. + +>It should be noted that in order to benefit from persistent connections or pipelining, Content-Length header must be available on the response, because this would let the client know when the transmission completes and it can send the next request (in normal sequential way of sending requests) or start waiting for the the next response (when pipelining is enabled). + +>But there was still an issue with this approach. And that is, what if the data is dynamic and server cannot find the content length before hand? Well in that case, you really can’t benefit from persistent connections, could you?! In order to solve this HTTP/1.1 introduced chunked encoding. In such cases server may omit content-Length in favor of chunked encoding (more to it in a moment). However, if none of them are available, then the connection must be closed at the end of request. + +- Chunked Transfers In case of dynamic content, when the server cannot really find out the Content-Length when the transmission starts, it may start sending the content in pieces (chunk by chunk) and add the Content-Length for each chunk when it is sent. And when all of the chunks are sent i.e. whole transmission has completed, it sends an empty chunk i.e. the one with Content-Length set to zero in order to identify the client that transmission has completed. In order to notify the client about the chunked transfer, server includes the header Transfer-Encoding: chunked + +- Unlike HTTP/1.0 which had Basic authentication only, HTTP/1.1 included digest and proxy authentication +- Caching +- Byte Ranges +- Character sets +- Language negotiation +- Client cookies +- Enhanced compression support +- New status codes +- ..and more + +I am not going to dwell about all the HTTP/1.1 features in this post as it is a topic in itself and you can already find a lot about it. The one such document that I would recommend you to read is Key differences between HTTP/1.0 and HTTP/1.1 and here is the link to original RFC for the overachievers. + +HTTP/1.1 was introduced in 1999 and it had been a standard for many years. Although, it improved alot over it’s predecessor; with the web changing everyday, it started to show it’s age. Loading a web page these days is more resource-intensive than it ever was. A simple webpage these days has to open more than 30 connections. Well HTTP/1.1 has persistent connections, then why so many connections? you say! The reason is, in HTTP/1.1 it can only have one outstanding connection at any moment of time. HTTP/1.1 tried to fix this by introducing pipelining but it didn’t completely address the issue because of the head-of-line blocking where a slow or heavy request may block the requests behind and once a request gets stuck in a pipeline, it will have to wait for the next requests to be fulfilled. To overcome these shortcomings of HTTP/1.1, the developers started implementing the workarounds, for example use of spritesheets, encoded images in CSS, single humungous CSS/Javascript files, domain sharding etc. + +#### SPDY - 2009 + +Google went ahead and started experimenting with alternative protocols to make the web faster and improving web security while reducing the latency of web pages. In 2009, they announced SPDY. + +>SPDY is a trademark of Google and isn’t an acronym. + +It was seen that if we keep increasing the bandwidth, the network performance increases in the beginning but a point comes when there is not much of a performance gain. But if you do the same with latency i.e. if we keep dropping the latency, there is a constant performance gain. This was the core idea for performance gain behind SPDY, decrease the latency to increase the network performance. + +>For those who don’t know the difference, latency is the delay i.e. how long it takes for data to travel between the source and destination (measured in milliseconds) and bandwidth is the amount of data transfered per second (bits per second). + +The features of SPDY included, multiplexing, compression, prioritization, security etc. I am not going to get into the details of SPDY, as you will get the idea when we get into the nitty gritty of HTTP/2 in the next section as I said HTTP/2 is mostly inspired from SPDY. + +SPDY didn’t really try to replace HTTP; it was a translation layer over HTTP which existed at the application layer and modified the request before sending it over to the wire. It started to become a defacto standards and majority of browsers started implementing it. + +In 2015, at Google, they didn’t want to have two competing standards and so they decided to merge it into HTTP while giving birth to HTTP/2 and deprecating SPDY. + +#### HTTP/2 - 2015 + +By now, you must be convinced that why we needed another revision of the HTTP protocol. HTTP/2 was designed for low latency transport of content. The key features or differences from the old version of HTTP/1.1 include + +- Binary instead of Textual +- Multiplexing - Multiple asynchronous HTTP requests over a single connection +- Header compression using HPACK +- Server Push - Multiple responses for single request +- Request Prioritization +- Security + +![](http://i.imgur.com/S85j8gg.png) + +##### 1. Binary Protocol + +HTTP/2 tends to address the issue of increased latency that existed in HTTP/1.x by making it a binary protocol. Being a binary protocol, it easier to parse but unlike HTTP/1.x it is no longer readable by the human eye. The major building blocks of HTTP/2 are Frames and Streams + +**Frames and Streams** + +HTTP messages are now composed of one or more frames. There is a HEADERS frame for the meta data and DATA frame for the payload and there exist several other types of frames (HEADERS, DATA, RST_STREAM, SETTINGS, PRIORITY etc) that you can check through the HTTP/2 specs. + +Every HTTP/2 request and response is given a unique stream ID and it is divided into frames. Frames are nothing but binary pieces of data. A collection of frames is called a Stream. Each frame has a stream id that identifies the stream to which it belongs and each frame has a common header. Also, apart from stream ID being unique, it is worth mentioning that, any request initiated by client uses odd numbers and the response from server has even numbers stream IDs. + +Apart from the HEADERS and DATA, another frame type that I think worth mentioning here is RST_STREAM which is a special frame type that is used to abort some stream i.e. client may send this frame to let the server know that I don’t need this stream anymore. In HTTP/1.1 the only way to make the server stop sending the response to client was closing the connection which resulted in increased latency because a new connection had to be opened for any consecutive requests. While in HTTP/2, client can use RST_STREAM and stop receiving a specific stream while the connection will still be open and the other streams will still be in play. + +##### 2. Multiplexing + +Since HTTP/2 is now a binary protocol and as I said above that it uses frames and streams for requests and responses, once a TCP connection is opened, all the streams are sent asynchronously through the same connection without opening any additional connections. And in turn, the server responds in the same asynchronous way i.e. the response has no order and the client uses the assigned stream id to identify the stream to which a specific packet belongs. This also solves the head-of-line blocking issue that existed in HTTP/1.x i.e. the client will not have to wait for the request that is taking time and other requests will still be getting processed. + +##### 3. HPACK Header Compression + +It was part of a separate RFC which was specifically aimed at optimizing the sent headers. The essence of it is that when we are constantly accessing the server from a same client there is alot of redundant data that we are sending in the headers over and over, and sometimes there might be cookies increasing the headers size which results in bandwidth usage and increased latency. To overcome this, HTTP/2 introduced header compression. + +![](http://i.imgur.com/3IPWXvR.png) + +Unlike request and response, headers are not compressed in gzip or compress etc formats but there is a different mechanism in place for header compression which is literal values are encoded using Huffman code and a headers table is maintained by the client and server and both the client and server omit any repetitive headers (e.g. user agent etc) in the subsequent requests and reference them using the headers table maintained by both. + +While we are talking headers, let me add here that the headers are still the same as in HTTP/1.1, except for the addition of some pseudo headers i.e. :method, :scheme, :host and :path + +##### 4. Server Push + +Server push is another tremendous feature of HTTP/2 where the server, knowing that the client is going to ask for a certain resource, can push it to the client without even client asking for it. For example, let’s say a browser loads a web page, it parses the whole page to find out the remote content that it has to load from the server and then sends consequent requests to the server to get that content. + +Server push allows the server to decrease the roundtrips by pushing the data that it knows that client is going to demand. How it is done is, server sends a special frame called PUSH_PROMISE notifying the client that, “Hey, I am about to send this resource to you! Do not ask me for it.” The PUSH_PROMISE frame is associated with the stream that caused the push to happen and it contains the promised stream ID i.e. the stream on which the server will send the resource to be pushed. + +##### 5. Request Prioritization + +A client can assign a priority to a stream by including the prioritization information in the HEADERS frame by which a stream is opened. At any other time, client can send a PRIORITY frame to change the priority of a stream. + +Without any priority information, server processes the requests asynchronously i.e. without any order. If there is priority assigned to a stream, then based on this prioritization information, server decides how much of the resources need to be given to process which request. + +##### 6. Security + +There was extensive discussion on whether security (through TLS) should be made mandatory for HTTP/2 or not. In the end, it was decided not to make it mandatory. However, most vendors stated that they will only support HTTP/2 when it is used over TLS. So, although HTTP/2 doesn’t require encryption by specs but it has kind of become mandatory by default anyway. With that out of the way, HTTP/2 when implemented over TLS does impose some requirementsi.e. TLS version 1.2 or higher must be used, there must be a certain level of minimum keysizes, ephemeral keys are required etc. + +HTTP/2 is here and it has already surpassed SPDY in adaption which is gradually increasing. HTTP/2 has alot to offer in terms of performance gain and it is about time we should start using it. + +For anyone interested in further details here is the [link to specs][1] and a [link demonstrating the performance benefits of][2] HTTP/2. For any questions or comments, use the comments section below. Also, while reading, if you find any blatant lies; do point them out. + +And that about wraps it up. Until next time! stay tuned. + +-------------------------------------------------------------------------------- + +via: http://kamranahmed.info/blog/2016/08/13/http-in-depth/?utm_source=webopsweekly&utm_medium=email + +作者:[Kamran Ahmed][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://github.com/kamranahmedse + +[1]: https://http2.github.io/http2-spec +[2]: http://www.http2demo.io/ + From 49c0a770e6e86596160a5ca2ed433034f09bf016 Mon Sep 17 00:00:00 2001 From: hkurj <663831938@qq.com> Date: Sat, 20 Aug 2016 21:26:01 +0800 Subject: [PATCH 1461/1469] translating --- sources/talk/20160809 7 reasons to love Vim.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/talk/20160809 7 reasons to love Vim.md b/sources/talk/20160809 7 reasons to love Vim.md index 868a1f5773..dc0caca838 100644 --- a/sources/talk/20160809 7 reasons to love Vim.md +++ b/sources/talk/20160809 7 reasons to love Vim.md @@ -1,3 +1,5 @@ +hkurj translating + 7 reasons to love Vim ==================== From b580c34f3b7a0784fe753cab9f925d7615c7f0eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=AE=B6=E5=90=AF?= Date: Sun, 21 Aug 2016 14:52:57 +0800 Subject: [PATCH 1462/1469] Translated by cposture (#4324) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 75 * Translated by cposture * Translated by cposture * Translated by cposture * 应 erlinux 的要求,把未翻译完的文章移到 source * 应 erlinux 的要求,把未翻译完的文章移到 source,同时删除 translated文章 * Translating * Translated by cposture * 更新格式 * Translated by cposture --- .../20160820 Protocol Buffer Basics C++.md | 411 ++++++++++++++++++ 1 file changed, 411 insertions(+) create mode 100644 translated/tech/20160820 Protocol Buffer Basics C++.md diff --git a/translated/tech/20160820 Protocol Buffer Basics C++.md b/translated/tech/20160820 Protocol Buffer Basics C++.md new file mode 100644 index 0000000000..ed86014010 --- /dev/null +++ b/translated/tech/20160820 Protocol Buffer Basics C++.md @@ -0,0 +1,411 @@ +Protocol Buffer Basics: C++ +============================ + +这篇教程提供了一个面向 C++ 程序员、关于 `protocol buffers` 的基础介绍。通过创建一个简单的示例应用程序,它将向我们展示: + +* 在 `.proto` 文件中定义消息格式 +* 使用 `protocol buffer` 编译器 +* 使用 `C++ protocol buffer API` 读写消息 + +这不是一个关于使用 C++ protocol buffers 的全面指南。要获取更详细的信息,请参考 [Protocol Buffer Language Guide][1] 和 [Encoding Reference][2]。 + +### 为什么使用 Protocol Buffers + +我们接下来要使用的例子是一个非常简单的"地址簿"应用程序,它能从文件中读取联系人详细信息。地址簿中的每一个人都有一个名字,ID,邮件地址和联系电话。 + +如何序列化和获取结构化的数据?这里有几种解决方案: + +* 以二进制形式发送/接收原生的内存数据结构。通常,这是一种脆弱的方法,因为接收/读取代码的编译必须基于完全相同的内存布局、大小端等等。同时,当文件增加时,原始格式数据会随着与该格式相连的软件拷贝而迅速扩散,这将很难扩展文件格式。 + +* 你可以创造一种 `ad-hoc` 方法,将数据项编码为一个字符串——比如将 4 个整数编码为 "12:3:-23:67"。虽然它需要编写一次性的编码和解码代码且解码需要耗费小的运行时成本,但这是一种简单灵活的方法。这最适合编码非常简单的数据。 + +* 序列化数据为 `XML`。这种方法是非常吸引人的,因为 `XML` 是一种适合人阅读的格式,并且有为许多语言开发的库。如果你想与其他程序和项目共享数据,这可能是一种不错的选择。然而,众所周知,`XML` 是空间密集型的,且在编码和解码时,它对程序会造成巨大的性能损失。同时,使用 XML DOM 树被认为比操作一个类的简单字段更加复杂。 + +`Protocol buffers` 是针对这个问题的一种灵活、高效、自动化的解决方案。使用 `Protocol buffers`,你需要写一个 `.proto` 说明,用于描述你所希望存储的数据结构。利用 `.proto` 文件,protocol buffer 编译器可以创建一个类,用于实现自动化编码和解码高效的二进制格式的 protocol buffer 数据。产生的类提供了构造 `protocol buffer` 的字段的 getters 和 setters,并且作为一个单元,关注读写 `protocol buffer` 的细节。重要的是,`protocol buffer` 格式支持扩展格式,代码仍然可以读取以旧格式编码的数据。 + +### 在哪可以找到示例代码 + +示例代码被包含于源代码包,位于 "examples" 文件夹。在[这][4]下载代码。 + +### 定义你的协议格式 + +为了创建自己的地址簿应用程序,你需要从 `.proto` 开始。`.proto` 文件中的定义很简单:为你所需要序列化的数据结构添加一个消息(message),然后为消息中的每一个字段指定一个名字和类型。这里是定义你消息的 `.proto` 文件,`addressbook.proto`。 + +``` +package tutorial; + +message Person { + required string name = 1; + required int32 id = 2; + optional string email = 3; + + enum PhoneType { + MOBILE = 0; + HOME = 1; + WORK = 2; + } + + message PhoneNumber { + required string number = 1; + optional PhoneType type = 2 [default = HOME]; + } + + repeated PhoneNumber phone = 4; +} + +message AddressBook { + repeated Person person = 1; +} +``` + +如你所见,其语法类似于 C++ 或 Java。我们开始看看文件的每一部分内容做了什么。 + +`.proto` 文件以一个 package 声明开始,这可以避免不同项目的命名冲突。在 C++,你生成的类会被置于与 package 名字一样的命名空间。 + +下一步,你需要定义消息(message)。消息只是一个包含一系列类型字段的集合。大多标准简单数据类型是可以作为字段类型的,包括 `bool`、`int32`、`float`、`double` 和 `string`。你也可以通过使用其他消息类型作为字段类型,将更多的数据结构添加到你的消息中——在以上的示例,`Person` 消息包含了 `PhoneNumber` 消息,同时 `AddressBook` 消息包含 `Person` 消息。你甚至可以定义嵌套在其他消息内的消息类型——如你所见,`PhoneNumber` 类型定义于 `Person` 内部。如果你想要其中某一个字段拥有预定义值列表中的某个值,你也可以定义 `enum` 类型——这儿你想指定一个电话号码可以是 `MOBILE`、`HOME` 或 `WORK` 中的某一个。 + +每一个元素上的 “=1”、"=2" 标记确定了用于二进制编码的唯一"标签"(tag)。标签数字 1-15 的编码比更大的数字少需要一个字节,因此作为一种优化,你可以将这些标签用于经常使用或 repeated 元素,剩下 16 以及更高的标签用于非经常使用或 optional 元素。每一个 repeated 字段的元素需要重新编码标签数字,因此 repeated 字段对于这优化是一个特别好的候选者。 + +每一个字段必须使用下面的修饰符加以标注: + +* required:必须提供字段的值,否则消息会被认为是 "未初始化的"(uninitialized)。如果 `libprotobuf` 以 debug 模式编译,序列化未初始化的消息将引起一个断言失败。以优化形式构建,将会跳过检查,并且无论如何都会写入消息。然而,解析未初始化的消息总是会失败(通过 parse 方法返回 `false`)。除此之外,一个 required 字段的表现与 optional 字段完全一样。 + +* optional:字段可能会被设置,也可能不会。如果一个 optional 字段没被设置,它将使用默认值。对于简单类型,你可以指定你自己的默认值,正如例子中我们对电话号码的 `type` 一样,否则使用系统默认值:数字类型为 0、字符串为空字符串、布尔值为 false。对于嵌套消息,默认值总为消息的"默认实例"或"原型",它的所有字段都没被设置。调用 accessor 来获取一个没有显式设置的 optional(或 required) 字段的值总是返回字段的默认值。 + +* repeated:字段可以重复任意次数(包括 0)。repeated 值的顺序会被保存于 protocol buffer。可以将 repeated 字段想象为动态大小的数组。 + +你可以查找关于编写 `.proto` 文件的完整指导——包括所有可能的字段类型——在 [Protocol Buffer Language Guide][6]。不要在这里面查找与类继承相似的特性,因为 protocol buffers 不会做这些。 + +> required 是永久性的,在把一个字段标识为 required 的时候,你应该特别小心。如果在某些情况下你不想写入或者发送一个 required 的字段,那么将该字段更改为 optional 可能会遇到问题——旧版本的读者(译者注:即读取、解析旧版本 Protocol Buffer 消息的一方)会认为不含该字段的消息是不完整的,从而有可能会拒绝解析。在这种情况下,你应该考虑编写特别针对于应用程序的、自定义的消息校验函数。Google 的一些工程师得出了一个结论:使用 required 弊多于利;他们更愿意使用 optional 和 repeated 而不是 required。当然,这个观点并不具有普遍性。 + +### 编译你的 Protocol Buffers + +既然你有了一个 `.proto`,那你需要做的下一件事就是生成一个将用于读写 `AddressBook` 消息的类(从而包括 `Person` 和 `PhoneNumber`)。为了做到这样,你需要在你的 `.proto` 上运行 protocol buffer 编译器 `protoc`: + +1. 如果你没有安装编译器,请[下载这个包][4],并按照 README 中的指令进行安装。 +2. 现在运行编译器,知道源目录(你的应用程序源代码位于哪里——如果你没有提供任何值,将使用当前目录),目标目录(你想要生成的代码放在哪里;常与 `$SRC_DIR` 相同),并且你的 `.proto` 路径。在此示例,你...: + +``` +protoc -I=$SRC_DIR --cpp_out=$DST_DIR $SRC_DIR/addressbook.proto +``` + +因为你想要 C++ 的类,所以你使用了 `--cpp_out` 选项——也为其他支持的语言提供了类似选项。 + +在你指定的目标文件夹,将生成以下的文件: + +* `addressbook.pb.h`,声明你生成类的头文件。 +* `addressbook.pb.cc`,包含你的类的实现。 + +### Protocol Buffer API + +让我们看看生成的一些代码,了解一下编译器为你创建了什么类和函数。如果你查看 `tutorial.pb.h`,你可以看到有一个在 `tutorial.proto` 中指定所有消息的类。关注 `Person` 类,可以看到编译器为每个字段生成了读写函数(accessors)。例如,对于 `name`、`id`、`email` 和 `phone` 字段,有下面这些方法: + +```c++ +// name +inline bool has_name() const; +inline void clear_name(); +inline const ::std::string& name() const; +inline void set_name(const ::std::string& value); +inline void set_name(const char* value); +inline ::std::string* mutable_name(); + +// id +inline bool has_id() const; +inline void clear_id(); +inline int32_t id() const; +inline void set_id(int32_t value); + +// email +inline bool has_email() const; +inline void clear_email(); +inline const ::std::string& email() const; +inline void set_email(const ::std::string& value); +inline void set_email(const char* value); +inline ::std::string* mutable_email(); + +// phone +inline int phone_size() const; +inline void clear_phone(); +inline const ::google::protobuf::RepeatedPtrField< ::tutorial::Person_PhoneNumber >& phone() const; +inline ::google::protobuf::RepeatedPtrField< ::tutorial::Person_PhoneNumber >* mutable_phone(); +inline const ::tutorial::Person_PhoneNumber& phone(int index) const; +inline ::tutorial::Person_PhoneNumber* mutable_phone(int index); +inline ::tutorial::Person_PhoneNumber* add_phone(); +``` + +正如你所见到,getters 的名字与字段的小写名字完全一样,并且 setter 方法以 set_ 开头。同时每个单一(singular)(required 或 optional)字段都有 `has_` 方法,该方法在字段被设置了值的情况下返回 true。最后,所有字段都有一个 `clear_` 方法,用以清除字段到空(empty)状态。 + +数字 `id` 字段仅有上述的基本读写函数集合(accessors),而 `name` 和 `email` 字段有两个额外的方法,因为它们是字符串——一个是可以获得字符串直接指针的`mutable_` getter ,另一个为额外的 setter。注意,尽管 `email` 还没被设置(set),你也可以调用 `mutable_email`;因为 `email` 会被自动地初始化为空字符串。在本例中,如果你有一个单一的(required 或 optional)消息字段,它会有一个 `mutable_` 方法,而没有 `set_` 方法。 + +repeated 字段也有一些特殊的方法——如果你看看 repeated `phone` 字段的方法,你可以看到: + +* 检查 repeated 字段的 `_size`(也就是说,与 `Person` 相关的电话号码的个数) +* 使用下标取得特定的电话号码 +* 更新特定下标的电话号码 +* 添加新的电话号码到消息中,之后你便可以编辑。(repeated 标量类型有一个 `add_` 方法,用于传入新的值) + +为了获取 protocol 编译器为所有字段定义生成的方法的信息,可以查看 [C++ generated code reference][5]。 + +#### 枚举和嵌套类(Enums and Nested Classes) + +与 `.proto` 的枚举相对应,生成的代码包含了一个 `PhoneType` 枚举。你可以通过 `Person::PhoneType` 引用这个类型,通过 `Person::MOBILE`、`Person::HOME` 和 `Person::WORK` 引用它的值。(实现细节有点复杂,但是你无须了解它们而可以直接使用) + +编译器也生成了一个 `Person::PhoneNumber` 的嵌套类。如果你查看代码,你可以发现真正的类型为 `Person_PhoneNumber`,但它通过在 `Person` 内部使用 typedef 定义,使你可以把 `Person_PhoneNumber` 当成嵌套类。唯一产生影响的一个例子是,如果你想要在其他文件前置声明该类——在 C++ 中你不能前置声明嵌套类,但是你可以前置声明 `Person_PhoneNumber`。 + +#### 标准的消息方法 + +所有的消息方法都包含了许多别的方法,用于检查和操作整个消息,包括: + +* `bool IsInitialized() const;` :检查是否所有 `required` 字段已经被设置。 +* `string DebugString() const;`:返回人类可读的消息表示,对 debug 特别有用。 +* `void CopyFrom(const Person& from);`:使用给定的值重写消息。 +* `void Clear();`:清除所有元素为空(empty)的状态。 + +上面这些方法以及下一节要讲的 I/O 方法实现了被所有 C++ protocol buffer 类共享的消息(Message)接口。为了获取更多信息,请查看 [complete API documentation for Message][7]。 + +#### 解析和序列化(Parsing and Serialization) + +最后,所有 protocol buffer 类都有读写你选定类型消息的方法,这些方法使用了特定的 protocol buffer [二进制格式][8]。这些方法包括: + +* `bool SerializeToString(string* output) const;`:序列化消息以及将消息字节数据存储在给定的字符串。注意,字节数据是二进制格式的,而不是文本格式;我们只使用 `string` 类作为合适的容器。 +* `bool ParseFromString(const string& data);`:从给定的字符创解析消息。 +* `bool SerializeToOstream(ostream* output) const;`:将消息写到给定的 C++ `ostream`。 +* `bool ParseFromIstream(istream* input);`:从给定的 C++ `istream` 解析消息。 + +这些只是两个用于解析和序列化的选择。再次说明,可以查看 `Message API reference` 完整的列表。 + +> Protocol Buffers 和 面向对象设计的 Protocol buffer 类通常只是纯粹的数据存储器(像 C++ 中的结构体);它们在对象模型中并不是一等公民。如果你想向生成的 protocol buffer 类中添加更丰富的行为,最好的方法就是在应用程序中对它进行封装。如果你无权控制 .proto 文件的设计的话,封装 protocol buffers 也是一个好主意(例如,你从另一个项目中重用一个 .proto 文件)。在那种情况下,你可以用封装类来设计接口,以更好地适应你的应用程序的特定环境:隐藏一些数据和方法,暴露一些便于使用的函数,等等。但是你绝对不要通过继承生成的类来添加行为。这样做的话,会破坏其内部机制,并且不是一个好的面向对象的实践。 + +### 写消息(Writing A Message) + +现在我们尝试使用 protocol buffer 类。你的地址簿程序想要做的第一件事是将个人详细信息写入到地址簿文件。为了做到这一点,你需要创建、填充 protocol buffer 类实例,并且将它们写入到一个输出流(output stream)。 + +这里的程序可以从文件读取 `AddressBook`,根据用户输入,将新 `Person` 添加到 `AddressBook`,并且再次将新的 `AddressBook` 写回文件。这部分直接调用或引用 protocol buffer 类的代码会高亮显示。 + +```c++ +#include +#include +#include +#include "addressbook.pb.h" +using namespace std; + +// This function fills in a Person message based on user input. +void PromptForAddress(tutorial::Person* person) { + cout << "Enter person ID number: "; + int id; + cin >> id; + person->set_id(id); + cin.ignore(256, '\n'); + + cout << "Enter name: "; + getline(cin, *person->mutable_name()); + + cout << "Enter email address (blank for none): "; + string email; + getline(cin, email); + if (!email.empty()) { + person->set_email(email); + } + + while (true) { + cout << "Enter a phone number (or leave blank to finish): "; + string number; + getline(cin, number); + if (number.empty()) { + break; + } + + tutorial::Person::PhoneNumber* phone_number = person->add_phone(); + phone_number->set_number(number); + + cout << "Is this a mobile, home, or work phone? "; + string type; + getline(cin, type); + if (type == "mobile") { + phone_number->set_type(tutorial::Person::MOBILE); + } else if (type == "home") { + phone_number->set_type(tutorial::Person::HOME); + } else if (type == "work") { + phone_number->set_type(tutorial::Person::WORK); + } else { + cout << "Unknown phone type. Using default." << endl; + } + } +} + +// Main function: Reads the entire address book from a file, +// adds one person based on user input, then writes it back out to the same +// file. +int main(int argc, char* argv[]) { + // Verify that the version of the library that we linked against is + // compatible with the version of the headers we compiled against. + GOOGLE_PROTOBUF_VERIFY_VERSION; + + if (argc != 2) { + cerr << "Usage: " << argv[0] << " ADDRESS_BOOK_FILE" << endl; + return -1; + } + + tutorial::AddressBook address_book; + + { + // Read the existing address book. + fstream input(argv[1], ios::in | ios::binary); + if (!input) { + cout << argv[1] << ": File not found. Creating a new file." << endl; + } else if (!address_book.ParseFromIstream(&input)) { + cerr << "Failed to parse address book." << endl; + return -1; + } + } + + // Add an address. + PromptForAddress(address_book.add_person()); + + { + // Write the new address book back to disk. + fstream output(argv[1], ios::out | ios::trunc | ios::binary); + if (!address_book.SerializeToOstream(&output)) { + cerr << "Failed to write address book." << endl; + return -1; + } + } + + // Optional: Delete all global objects allocated by libprotobuf. + google::protobuf::ShutdownProtobufLibrary(); + + return 0; +} +``` + +注意 `GOOGLE_PROTOBUF_VERIFY_VERSION` 宏。它是一种好的实践——虽然不是严格必须的——在使用 C++ Protocol Buffer 库之前执行该宏。它可以保证避免不小心链接到一个与编译的头文件版本不兼容的库版本。如果被检查出来版本不匹配,程序将会终止。注意,每个 `.pb.cc` 文件在初始化时会自动调用这个宏。 + +同时注意在程序最后调用 `ShutdownProtobufLibrary()`。它用于释放 Protocol Buffer 库申请的所有全局对象。对大部分程序,这不是必须的,因为虽然程序只是简单退出,但是 OS 会处理释放程序的所有内存。然而,如果你使用了内存泄漏检测工具,工具要求全部对象都要释放,或者你正在写一个库,该库可能会被一个进程多次加载和卸载,那么你可能需要强制 Protocol Buffer 清除所有东西。 + +### 读取消息 + +当然,如果你无法从它获取任何信息,那么这个地址簿没多大用处!这个示例读取上面例子创建的文件,并打印文件里的所有内容。 + +```c++ +#include +#include +#include +#include "addressbook.pb.h" +using namespace std; + +// Iterates though all people in the AddressBook and prints info about them. +void ListPeople(const tutorial::AddressBook& address_book) { + for (int i = 0; i < address_book.person_size(); i++) { + const tutorial::Person& person = address_book.person(i); + + cout << "Person ID: " << person.id() << endl; + cout << " Name: " << person.name() << endl; + if (person.has_email()) { + cout << " E-mail address: " << person.email() << endl; + } + + for (int j = 0; j < person.phone_size(); j++) { + const tutorial::Person::PhoneNumber& phone_number = person.phone(j); + + switch (phone_number.type()) { + case tutorial::Person::MOBILE: + cout << " Mobile phone #: "; + break; + case tutorial::Person::HOME: + cout << " Home phone #: "; + break; + case tutorial::Person::WORK: + cout << " Work phone #: "; + break; + } + cout << phone_number.number() << endl; + } + } +} + +// Main function: Reads the entire address book from a file and prints all +// the information inside. +int main(int argc, char* argv[]) { + // Verify that the version of the library that we linked against is + // compatible with the version of the headers we compiled against. + GOOGLE_PROTOBUF_VERIFY_VERSION; + + if (argc != 2) { + cerr << "Usage: " << argv[0] << " ADDRESS_BOOK_FILE" << endl; + return -1; + } + + tutorial::AddressBook address_book; + + { + // Read the existing address book. + fstream input(argv[1], ios::in | ios::binary); + if (!address_book.ParseFromIstream(&input)) { + cerr << "Failed to parse address book." << endl; + return -1; + } + } + + ListPeople(address_book); + + // Optional: Delete all global objects allocated by libprotobuf. + google::protobuf::ShutdownProtobufLibrary(); + + return 0; +} +``` + +### 扩展 Protocol Buffer + +早晚在你发布了使用 protocol buffer 的代码之后,毫无疑问,你会想要 "改善" + protocol buffer 的定义。如果你想要新的 buffers 向后兼容,并且老的 buffers 向前兼容——几乎可以肯定你很渴望这个——这里有一些规则,你需要遵守。在新的 protocol buffer 版本: + + * 你绝不可以修改任何已存在字段的标签数字 + * 你绝不可以添加或删除任何 required 字段 + * 你可以删除 optional 或 repeated 字段 + * 你可以添加新的 optional 或 repeated 字段,但是你必须使用新的标签数字(也就是说,标签数字在 protocol buffer 中从未使用过,甚至不能是已删除字段的标签数字)。 + + (这是对于上面规则的一些[异常情况][9],但它们很少用到。) + + 如果你能遵守这些规则,旧代码则可以欢快地读取新的消息,并且简单地忽略所有新的字段。对于旧代码来说,被删除的 optional 字段将会简单地赋予默认值,被删除的 `repeated` 字段会为空。新代码显然可以读取旧消息。然而,请记住新的 optional 字段不会呈现在旧消息中,因此你需要显式地使用 `has_` 检查它们是否被设置或者在 `.proto` 文件在标签数字后使用 `[default = value]` 提供一个合理的默认值。如果一个 optional 元素没有指定默认值,它将会使用类型特定的默认值:对于字符串,默认值为空字符串;对于布尔值,默认值为 false;对于数字类型,默认类型为 0。注意,如果你添加一个新的 repeated 字段,新代码将无法辨别它被留空(left empty)(被新代码)或者从没被设置(被旧代码),因为 repeated 字段没有 `has_` 标志。 + +### 优化技巧 + +C++ Protocol Buffer 库已极度优化过了。但是,恰当的用法能够更多地提高性能。这里是一些技巧,可以帮你从库中挤压出最后一点速度: + +* 尽可能复用消息对象。即使它们被清除掉,消息也会尽量保存所有被分配来重用的内存。因此,如果我们正在处理许多相同类型或一系列相似结构的消息,一个好的办法是重用相同的消息对象,从而减少内存分配的负担。但是,随着时间的流逝,对象可能会膨胀变大,尤其是当你的消息尺寸(译者注:各消息内容不同,有些消息内容多一些,有些消息内容少一些)不同的时候,或者你偶尔创建了一个比平常大很多的消息的时候。你应该自己通过调用 [SpaceUsed][10] 方法监测消息对象的大小,并在它太大的时候删除它。 + +* 对于在多线程中分配大量小对象的情况,你的操作系统内存分配器可能优化得不够好。你可以尝试使用 google 的 [tcmalloc][11]。 + +### 高级用法 + +Protocol Buffers 绝不仅用于简单的数据存取以及序列化。请阅读 [C++ API reference][12] 来看看你还能用它来做什么。 + +protocol 消息类所提供的一个关键特性就是反射。你不需要编写针对一个特殊的消息类型的代码,就可以遍历一个消息的字段并操作它们的值。一个使用反射的有用方法是 protocol 消息与其他编码互相转换,比如 XML 或 JSON。反射的一个更高级的用法可能就是可以找出两个相同类型的消息之间的区别,或者开发某种 "协议消息的正则表达式",利用正则表达式,你可以对某种消息内容进行匹配。只要你发挥你的想像力,就有可能将 Protocol Buffers 应用到一个更广泛的、你可能一开始就期望解决的问题范围上。 + +反射是由 [Message::Reflection interface][13] 提供的。 + +-------------------------------------------------------------------------------- + +via: https://developers.google.com/protocol-buffers/docs/cpptutorial + +作者:[Google][a] +译者:[cposture](https://github.com/cposture) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://developers.google.com/protocol-buffers/docs/cpptutorial +[1]: https://developers.google.com/protocol-buffers/docs/proto +[2]: https://developers.google.com/protocol-buffers/docs/encoding +[3]: https://developers.google.com/protocol-buffers/docs/downloads +[4]: https://developers.google.com/protocol-buffers/docs/downloads.html +[5]: https://developers.google.com/protocol-buffers/docs/reference/cpp-generated +[6]: https://developers.google.com/protocol-buffers/docs/proto +[7]: https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message.html#Message +[8]: https://developers.google.com/protocol-buffers/docs/encoding +[9]: https://developers.google.com/protocol-buffers/docs/proto#updating +[10]: https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message.html#Message.SpaceUsed.details +[11]: http://code.google.com/p/google-perftools/ +[12]: https://developers.google.com/protocol-buffers/docs/reference/cpp/index.html +[13]: https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message.html#Message.Reflection From 98cffc134cb3536fc5b465c9886351d59d1eee14 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 21 Aug 2016 18:41:29 +0800 Subject: [PATCH 1463/1469] PUB:20160630 18 Best IDEs for C+C++ Programming or Source Code Editors on Linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @ZenMoore @LiBrad @WangYueScream @LemonDemo 基本上不错,有些地方需要再细心些。 --- ...ramming or Source Code Editors on Linux.md | 322 ++++++++++++++++++ ...ramming or Source Code Editors on Linux.md | 302 ---------------- 2 files changed, 322 insertions(+), 302 deletions(-) create mode 100644 published/20160630 18 Best IDEs for C+C++ Programming or Source Code Editors on Linux.md delete mode 100644 translated/tech/20160630 18 Best IDEs for C+C++ Programming or Source Code Editors on Linux.md diff --git a/published/20160630 18 Best IDEs for C+C++ Programming or Source Code Editors on Linux.md b/published/20160630 18 Best IDEs for C+C++ Programming or Source Code Editors on Linux.md new file mode 100644 index 0000000000..9b0b74e62e --- /dev/null +++ b/published/20160630 18 Best IDEs for C+C++ Programming or Source Code Editors on Linux.md @@ -0,0 +1,322 @@ +17 个 Linux 下用于 C/C++ 的最好的 IDE /编辑器 +======================= + +C++,一个众所周知的 C 语言的扩展,是一个优秀的、强大的、通用编程语言,它能够提供现代化的、通用的编程功能,可以用于开发包括视频游戏、搜索引擎、其他计算机软件乃至操作系统等在内的各种大型应用。 + +C++,提供高度可靠性的同时还能够允许操作底层内存来满足更高级的编程要求。 + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Best-Linux-IDE-Editors.png) + +虽然已经有了一些供程序员用来写 C/C++ 代码的文本编辑器,但 IDE 可以为轻松、完美的编程提供综合的环境和组件。 + +在这篇文章里,我们会向你展示一些可以在 Linux 平台上找到的用于 C++ 或者其他编程语言编程的最好的 IDE。  + +### 1. 用于 C/C++ 开发的 Netbeans + +Netbeans 是一个自由而开源的、流行的跨平台 IDE ,可用于 C/C++ 以及其他编程语言,可以使用由社区开发的插件展现了其完全的扩展性。 + +它包含了用于 C/C++ 开发的项目类型和模版,并且你可以使用静态和动态函数库来构建应用程序。此外,你可以利用现有的代码去创造你的工程,并且也可以通过拖放的方式导入二进制文件来从头构建应用。 + +让我们来看看关于它的特性: + +- C/C++ 编辑器很好的整合了多线程的 [GNU GDB 调试工具][1] +- 支持代码协助 +- 支持 C++11 标准 +- 在里面创建和运行 C/C++ 测试程序 +- 支持 QT 工具包 +- 支持将已编译的应用程序自动打包到 .tar,.zip 等归档文件 +- 支持多个编译器,例如: GNU、Clang/LLVM、Cygwin、Oracle Solaris Studio 和 MinGW +- 支持远程开发 +- 文件导航 +- 源代码检查 + +![](http://www.tecmint.com/wp-content/uploads/2016/06/NetBeans-IDE.png) + +主页: + +### 2. Code::Blocks + +Code::Blocks 是一个免费的、具有高度扩展性的、并且可以配置的跨平台 C++ IDE,它为用户提供了必备而典范的功能。它具有一致的界面和体验。 + +最重要的是,你可以通过用户开发的插件扩展它的功能,一些插件是随同 Code::Blocks 发布的,而另外一些则不是,它们由 Code::Block 开发团队之外的个人用户所编写的。 + +其功能分为编译器、调试器、界面功能,它们包括: + +- 支持多种编译器如 GCC、clang、Borland C++ 5.5、digital mars 等等 +- 非常快,不需要 makefile +- 支持多个目标平台的项目 +- 支持将项目组合起来的工作空间 +- GNU GDB 接口 +- 支持完整的断点功能,包括代码断点,数据断点,断点条件等等 +- 显示本地函数的符号和参数 +- 用户内存导出和语法高亮显示 +- 可自定义、可扩展的界面以及许多其他的的功能,包括那些用户开发的插件添加功能 + +![](http://www.tecmint.com/wp-content/uploads/2016/06/CodeBlocks-IDE-for-Linux.png) + +主页: + +### 3. Eclipse CDT (C/C++ Development Tooling) + +Eclipse 在编程界是一款著名的、开源的、跨平台的 IDE。它给用户提供了一个很棒的界面,并支持拖拽功能以方便界面元素的布置。 + +Eclipse CDT 是一个基于 Eclipse 主平台的项目,它提供了一个完整功能的 C/C++ IDE,并具有以下功能: + +- 支持项目创建 +- 管理各种工具链的构建 +- 标准的 make 构建 +- 源代码导航 +- 一些知识工具,如调用图、类型分级结构,内置浏览器,宏定义浏览器 +- 支持语法高亮的代码编辑器 +- 支持代码折叠和超链接导航 +- 代码重构与代码生成 +- 可视化调试存储器、寄存器的工具 +- 反汇编查看器以及更多功能 + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Eclipse-IDE-for-Linux.png) + +主页: + +### 4.CodeLite IDE + +CodeLite 也是一款为 C/C++、JavaScript(Node.js)和 PHP 编程专门设计打造的自由而开源的、跨平台的 IDE。 + +它的一些主要特点包括: + +- 代码补完,提供了两个代码补完引擎 +- 支持多种编译器,包括 GCC、clang/VC++ +- 以代码词汇的方式显示错误 +- 构建选项卡中的错误消息可点击 +- 支持下一代 LLDB 调试器 +- 支持 GDB +- 支持重构 +- 代码导航 +- 使用内置的 SFTP 进行远程开发 +- 源代码控制插件 +- 开发基于 wxWidgets 应用的 RAD(快速应用程序开发)工具,以及更多的特性 + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Codelite-IDE.png) + +主页: + +### 5. Bluefish 编辑器 + +Bluefish 不仅仅是一个一般的编辑器,它是一个轻量级的、快捷的编辑器,为程序员提供了如开发网站、编写脚本和软件代码的 IDE 特性。它支持多平台,可以在 Linux、Mac OSX、FreeBSD、OpenBSD、Solaris 和 Windows 上运行,同时支持包括 C/C++ 在内的众多编程语言。 + +下面列出的是它众多功能的一部分: + +- 多文档界面 +- 支持递归打开文件,基于文件名通配模式或者内容模式 +- 提供一个非常强大的搜索和替换功能 +- 代码片段边栏 +- 支持整合个人的外部过滤器,可使用命令如 awk,sed,sort 以及自定义构建脚本组成(过滤器的)管道文件 +- 支持全屏编辑 +- 网站上传和下载 +- 支持多种编码等许多其他功能 + +![](http://www.tecmint.com/wp-content/uploads/2016/06/BlueFish-IDE-Editor-for-Linux.png) + +主页: + +### 6. Brackets 代码编辑器 + +Brackets 是一个现代化风格的、开源的文本编辑器,专为 Web 设计与开发打造。它可以通过插件进行高度扩展,因此 C/C++ 程序员通过安装 C/C++/Objective-C 包来使用它来开发,这个包用来在辅助 C/C++ 代码编写的同时提供了 IDE 之类的特性。 + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Brackets-Code-Editor-for-Linux.png) + +主页: + +### 7. Atom 代码编辑器 + +Atom 也是一个现代化风格、开源的多平台文本编辑器,它能运行在 Linux、Windows 或是 Mac OS X 平台。它的定制可深入底层,用户可以自定义它,以便满足各种编写代码的需求。 + +它功能完整,主要的功能包括: + +- 内置了包管理器 +- 智能的自动补完 +- 内置文件浏览器 +- 查找、替换以及其他更多的功能 + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Atom-Code-Editor-for-Linux.png) + +主页: + +安装指南: + +### 8. Sublime Text 编辑器 + +Sublime Text 是一个完善的、跨平台的文本编辑器,可用于代码、标记语言和一般文字。它可以用来编写 C/C++ 代码,并且提供了非常棒的用户界面。 + +它的功能列表包括: + +- 多重选择 +- 按模式搜索命令 +- 抵达任何一处的功能 +- 免打扰模式 +- 窗口分割 +- 支持项目之间快速的切换 +- 高度可定制 +- 支持基于 Python 的 API 插件以及其他特性 + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Sublime-Code-Editor-for-Linux.png) + +主页: + +安装指南: + +### 9. JetBrains CLion + +JetBrains CLion 是一个收费的、强大的跨平台 C/C++ IDE。它是一个完全整合的 C/C++ 程序开发环境,并提供 Cmake 项目模型、一个嵌入式终端窗口和一个主要以键盘操作的编码环境。 + +它还提供了一个智能而现代化的编辑器,具有许多令人激动的功能,提供了理想的编码环境,这些功能包括: + +- 除了 C/C++ 还支持其他多种语言 +- 在符号声明和上下文中轻松导航 +- 代码生成和重构 +- 可定制的编辑器 +- 即时代码分析 +- 集成的代码调试器 +- 支持 Git、Subversion、Mercurial、CVS、Perforcevia(通过插件)和 TFS +- 无缝集成了 Google 测试框架 +- 通过 Vim 仿真插件支持 Vim 编辑体验 + +![](http://www.tecmint.com/wp-content/uploads/2016/06/JetBains-CLion-IDE.png) + +主页: + +### 10. 微软的 Visual Studio Code 编辑器 + +Visual Studio 是一个功能丰富的、完全整合的、跨平台开发环境,运行在 Linux、Windows 和 Mac OS X 上。 最近它向 Linux 用户开源了,它重新定义了代码编辑这件事,为用户提供了在 Windows、Android、iOS 和 Web 等多个平台开发不同应用所需的一切工具。 + +它功能完备,功能分类为应用程序开发、应用生命周期管理、扩展和集成特性。你可以从 Visual Studio 官网阅读全面的功能列表。 + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Visual-Studio-Code-Editor.png) + +主页: + +### 11. KDevelop + +KDevelop 是另一个自由而开源的跨平台 IDE,能够运行在 Linux、Solaris、FreeBSD、Windows、Mac OS X 和其他类 Unix 操作系统上。它基于 KDevPlatform、KDE 和 Qt 库。KDevelop 可以通过插件高度扩展,功能丰富且具有以下显著特色: + +- 支持基于 Clang 的 C/C++ 插件 +- 支持 KDE 4 配置迁移 +- 支持调用二进制编辑器 Oketa +- 支持众多视图插件下的差异行编辑 +- 支持 Grep 视图,使用窗口小部件节省垂直空间等 + +![](http://www.tecmint.com/wp-content/uploads/2016/06/KDevelop-IDE-Editor.png) + +主页: + +### 12. Geany IDE + +Geany 是一个免费的、快速的、轻量级跨平台 IDE,只需要很少的依赖包就可以工作,独立于流行的 Linux 桌面环境下,比如 GNOME 和 KDE。它需要 GTK2 库实现功能。 + +它的特性包括以下列出的内容: + +- 支持语法高亮显示 +- 代码折叠 +- 调用提示 +- 符号名自动补完 +- 符号列表 +- 代码导航 +- 一个简单的项目管理工具 +- 可以编译并运行用户代码的内置系统 +- 可以通过插件扩展 + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Geany-IDE-for-Linux.png) + +主页: + +### 13. Ajunta DeveStudio + +Ajunta DevStudio 是一个简单,强大的 GNOME 界面的软件开发工作室,支持包括 C/C++ 在内的几种编程语言。 + +它提供了先进的编程工具,比如项目管理、GUI 设计、交互式调试器、应用程序向导、源代码编辑器、版本控制等。此外,除了以上特点,Ajunta DeveStudio 也有其他很多不错的 IDE 功能,包括: + +- 简单的用户界面 +- 可通过插件扩展 +- 整合了 Glade 用于所见即所得的 UI 开发 +- 项目向导和模板 +- 整合了 GDB 调试器 +- 内置文件管理器 +- 使用 DevHelp 提供上下文敏感的编程辅助 +- 源代码编辑器支持语法高亮显示、智能缩进、自动缩进、代码折叠/隐藏、文本缩放等 + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Anjuta-DevStudio-for-Linux.png) + +主页: + +### 14. GNAT Programming Studio + +GNAT Programming Studio 是一个免费的、易于使用的 IDE,设计的目的用于统一开发人员与他/她的代码和软件之间的交互。 + +它通过高亮程序的重要部分和逻辑从而提升源代码导航体验,打造了一个理想的编程环境。它的设计目标是为你带来更舒适的编程体验,使用户能够从头开始开发全面的系统。 + +它丰富的特性包括以下这些: + +- 直观的用户界面 +- 对开发者的友好性 +- 支持多种编程语言,跨平台 +- 灵活的 MDI(多文档界面) +- 高度可定制 +- 使用喜欢的工具获得全面的可扩展性 + +![](http://www.tecmint.com/wp-content/uploads/2016/06/GNAT-Programming-Studio.jpg) + +主页: + +### 15. Qt Creator + +这是一款收费的、跨平台的 IDE,用于创建连接设备、用户界面和应用程序。Qt Creator 可以让用户比应用的编码做到更多的创新。 + +它可以用来创建移动和桌面应用程序,也可以连接到嵌入式设备。 + +它的优点包含以下几点: + +- 复杂的代码编辑器 +- 支持版本控制 +- 项目和构建管理工具 +- 支持多屏幕和多平台,易于构建目标之间的切换等等 + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Qt-Creator.png) + +主页: + +### 16. Emacs 编辑器 + +Emacs 是一个自由的、强大的、可高度扩展的、可定制的、跨平台文本编辑器,你可以在 Linux、Solaris、FreeBSD、NetBSD、OpenBSD、Windows 和 Mac OS X 这些系统中使用该编辑器。 + +Emacs 的核心也是一个 Emacs Lisp 的解释器,Emacs Lisp 是一种基于 Lisp 的编程语言。在撰写本文时,GNU Emacs 的最新版本是 24.5,Emacs 的基本功能包括: + +- 内容识别编辑模式 +- Unicode 的完全支持 +- 可使用 GUI 或 Emacs Lisp 代码高度定制 +- 下载和安装扩展的打包系统 +- 超出了正常文本编辑的功能生态系统,包括项目策划、邮件、日历和新闻阅读器等 +- 完整的内置文档,以及用户指南等等 + +![](http://www.tecmint.com/wp-content/uploads/2016/06/Emacs-Editor.png) + +主页: https://www.gnu.org/software/emacs/ + +### 17. VI/VIM 编辑器 + +Vim,一款 VI 编辑器的改进版本,是一款自由的、强大的、流行的并且高度可配置的文本编辑器。它为有效率地文本编辑而生,并且为 Unix/Linux 使用者提供了激动人心的编辑器特性,因此,它对于撰写和编辑 C/C++ 代码也是一个好的选择。 + +总的来说,与传统的文本编辑器相比,IDE 为编程提供了更多的便利,因此使用它们是一个很好的选择。它们带有激动人心的特征并且提供了一个综合性的开发环境,有时候程序员不得不陷入对最好的 C/C++ IDE 的选择。 + +在互联网上你还可以找到许多 IDE 来下载,但不妨试试我们推荐的这几款,可以帮助你尽快找到哪一款是你需要的。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/best-linux-ide-editors-source-code-editors/ + +作者:[Aaron Kili][a] +译者:[ZenMoore](https://github.com/ZenMoore) ,[LiBrad](https://github.com/LiBrad) ,[WangYueScream](https://github.com/WangYueScream) ,[LemonDemo](https://github.com/LemonDemo) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.tecmint.com/author/aaronkili/ +[1]: http://www.tecmint.com/debug-source-code-in-linux-using-gdb/ diff --git a/translated/tech/20160630 18 Best IDEs for C+C++ Programming or Source Code Editors on Linux.md b/translated/tech/20160630 18 Best IDEs for C+C++ Programming or Source Code Editors on Linux.md deleted file mode 100644 index cb991d80c9..0000000000 --- a/translated/tech/20160630 18 Best IDEs for C+C++ Programming or Source Code Editors on Linux.md +++ /dev/null @@ -1,302 +0,0 @@ - -# Linux 下 18 个最好的 C/C++ 编程或者源代码编辑的集成开发环境 - -C++,一个众所周知的 C 语言的扩展,是一个优秀的,强大的,通用的编程语言,能够提供现代化的和通用的编程功能,可以用于开发大型应用,包括视频游戏,搜索引擎,其他计算机软件甚至操作系统。 - -C++,提供高度可靠性的同时还能够允许操作底层内存来满足更高级的编程要求。 - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Best-Linux-IDE-Editors.png) - -虽然已经有了一些供程序员用来写 C/C++ 代码的文本编辑器,但 IDE 可以为简单、完美的编程提供全面的工具和组件。 - -在这篇文章里,我们会向你展示一些可以在 Linux 平台上找到的用于 C++ 或者其他编程语言编程的最好的 IDE。  - -### 1. Netbeans for C/C++ Development - -Netbeans 是一个免费的、开源和流行跨平台的 IDE 并且用于 C/C++ 以及其他编程语言。由社区提供成熟的插件使它可以充分利用其扩展性。 - -它包含项目类型和 C/C++ 模版,并且你可以使用静态和动态函数库来搭建应用程序。此外,你可以利用现有的代码去创造你的工程,并且使用它的特点将二进制文件拖放进文件夹到开发应用程序的地方。 - -让我们来看看关于它的特性: - -- C/C++ 编辑器是很好的集成多元化的 GNU GDB 调试工具 -- 支持代码协助 -- 支持 C++11 标准 -- 在里面创建和运行 C/C++ 测试程序 -- 支持 QT 工具包 -- 支持自动由已编译的应用程序到 .tar,.zip 和其他更多的归档文件封包 -- 支持多个编译器,例如: GNU,Clang/LLVM,Cygwin,Oracle Solaris Studio 和 MinGW -- 支持远程开发 -- 文件导航 -- 源代码检查 - -![](http://www.tecmint.com/wp-content/uploads/2016/06/NetBeans-IDE.png) ->Visit Homepage: - -### 2. Code::Blocks -Code::Blocks 是一个免费的、具有高度扩展性的、并且可以配置的跨平台 C++ IDE, 它为用户提供最需要的最理想形象。它给用户一种协调的界面感觉。 - -并且最为重要的是,你可以通过用户开发的插件扩展它的功能,这些插件中一部分是 Code::Blocks发布的然而大多数不是这样,而是由非 Code::Block 开发团队成员的个人用户所写的。 - -其特色分为编译器、调试器、接口特性,它们包括: - -- 支持多种编译器如 GCC, clang, Borland C++ 5.5, digital mars 等等 -- 非常快,不需要 makefiles -- Multi-target 工程 -- 支持组合项目的工作空间 -- GNU GDB 接口 -- 支持完整的断点,包括代码的断点,数据断点,断点条件等等 -- 显示本地函数符号和参数 -- 自定义储存仓库和语法高亮显示 -- 可自定义、可扩展的接口以及许多其他的的功能,包括那些用户开发的插件 - -![](http://www.tecmint.com/wp-content/uploads/2016/06/CodeBlocks-IDE-for-Linux.png) ->Visit Homepage: - -### 3. Eclipse CDT(C/C++ Development Tooling) -Eclipse 在编程界是一款著名的、开源的、跨平台的 IDE。为了方便界面元素的布置,它给用户提供了一个很棒的支持拖拽的界面。 - -Eclipse CDT 项目是基于 Eclipse 平台,它给 C/C++ 提供一个全新的 IDE 并具有以下功能: - -- 支持项目创建 -- 管理并建立各种工具链 -- 标准的构建 -- 源导航 -- 一些知识工具,如调用图,类型分级结构,内置浏览程序,定义宏浏览程序 -- 支持语法高亮的代码编辑器 -- 支持折叠和超链接导航 -- 代码重构与代码生成 -- 可视化的调试工具,如存储器、寄存器 -- 反汇编浏览区以及更多功能 - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Eclipse-IDE-for-Linux.png) ->Visit Homepage: - -### 4.CodeLite IDE -CodeLite 也是一款为 C/C++,JavaScript(Node.js) 和 PHP 编程专门设计并建造的免费,开源,跨平台的 IDE。 - -它的一些主要特点包括: - -- 代码自动完成,内置了两个帮助代码自动完成的引擎 -- 支持多种编译器, 包括 GCC,clang/VC++ -- 显示代码词汇的错误 -- 通过构建选项卡点击error -- 支持下一代LLDB调试器 -- 支持 GDB -- 支持重构 -- 代码导航 -- 使用内置的 SFTP 远程开发 -- 源代码控制插件 -- RAD(快速应用程序开发)工具开发 wxWidgets-based 应用以及更多的特性 - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Codelite-IDE.png) ->Visit Homepage: - -### 6. Bluefish Editor - -Bluefish 不仅仅是一个常规的编辑器,它是一个轻量级的,快速的编辑器,为程序员提供了 IDE 的特性如开发网站,编写脚本和软件代码。它支持多平台,在 Linux,Mac OSX,FreeBSD,OpenBSD,Solaris 和 Windows上运行,同时支持众多编程语言包括 C/C++。 - -下面列出的是它众多功能的一部分: - -- 多文档界面 -- 支持递归打开文件,基于文件名通配模式或者内容模式 -- 提供一个非常强大的搜索和替换功能 -- 侧边导航摘要 -- 支持个人的集成外部过滤器,使用命令如awk,sed,sort加上自定义构建脚本组成的管道文件 -- 支持全屏编辑 -- 网站上传和下载 -- 支持多种编码等许多其他功能 - -![](http://www.tecmint.com/wp-content/uploads/2016/06/BlueFish-IDE-Editor-for-Linux.png) ->Visit Homepage: - -### 7. Brackets Code Editor - -Brackets 是一个现代的开源的文本编辑器,专为 Web 设计与开发打造。它可以通过插件进行高度扩展,因此 C/C++ 程序员通过安装 C/C++/Objective-C 包来使用它,这个包用来在改进 C/C++ 代码编写的同时提供 IDE 等特性。 - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Brackets-Code-Editor-for-Linux.png) ->Visit Homepage: - -### 8. Atom Code Editor - -Atom 也是一个现代化风格、开源的多平台文本编辑器,它能运行在 Linux, Windows 或是 Mac OS X 平台。它的底层库可以删除,因此用户可以自定义编译器,以便满足各种编写代码的需求。 - -它功能完整,主要的功能包括: - -- 内置包管理器 -- 快速的自动完成 -- 内置文件浏览器 -- 查找、替换以及其他更多的功能 - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Atom-Code-Editor-for-Linux.png) ->Visit Homepage: >https://atom.io/> ->Installation Instructions: - -### 9. Sublime Text Editor - -Sublime Text 是一个完善的,跨平台的文本编辑器,用于写码、标记和撰文。它可以用来编写 C/C++ 代码,并且提供非常棒的用户界面。 - -它的功能列表包括: - -- 多重选择 -- 命令调色 -- 重要的 Goto 功能 -- 免打扰模式 -- 分离编辑器 -- 支持项目之间快速的切换 -- 高度可制定 -- 支持基于 Python 的 API 插件以及其他特性 - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Sublime-Code-Editor-for-Linux.png) ->Visit Homepage: ->Installation Instructions: - -### 10. JetBrains CLion - -JetBrains CLion 是一个收费的,强大的并且跨平台的 C/C++ IDE。它是一个全面的 C/C++ 程序集成开发环境,并提供 Cmake 项目模型,一个嵌入式终端的窗口和一个编码的定向键入通道。 - -它还提供了一个漂亮的现代化的编辑器,和许多令人激动的功能,提供理想的编码环境,这些功能包括: - -- 除了 C/C++ 还支持其他多种语言 -- 便利的符号声明或上下文导航 -- 代码生成和重构 -- 可制定的编辑 -- 关于代码的快速分享 -- 一个集成的代码调试器 -- 支持 Git,Subversion,Mercurial,CVS,Perforcevia p(lugin) 和 TFS -- 无缝连接 Google 测试框架 -- 通过 Vim 仿真插件支持 Vim 文本编辑器 - -![](http://www.tecmint.com/wp-content/uploads/2016/06/JetBains-CLion-IDE.png) ->Visit Homepage: - -### 11. Microsoft’s Visual Studio Code Editor - -Visual Studio 是一个丰富的,完全集成的,跨平台的开发环境,运行在 Linux,Windows 和 Mac OS X。 最近它向 Linux 用户开源,同时它重新定义了代码编辑,提供了用户所需的所有工具用来开发不同平台下的应用,包括的平台有 Windows,Android,iOS 和 Web。 - -它功能完整,功能分类成应用程序开发、应用生命周期管理、扩展和集成特性。你可以从 Visual Studio 官网阅读全面的功能列表。 - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Visual-Studio-Code-Editor.png) ->Visit Homepage: - -### 12. KDevelop - -KDevelop 是另一个免费,开源和跨平台的 IDE,能够运行在 Linux,Solaris,FreeBSD,Windows,Mac OS X 和其他类 Unix 操作系统。它基于 KDevPlatform,KDE 和 Qt 库。KDevelop 可以通过插件高度扩展,功能丰富并具有以下显著特色: - -- 支持基于 Clang 的 C/C++ 插件 -- 支持 KDE 4 配置迁移 -- Oketa 插件支持的复兴 -- 支持众多视图插件下的不同行编辑 -- 支持 Grep 视图,使用窗口小部件节省垂直空间等 - -![](http://www.tecmint.com/wp-content/uploads/2016/06/KDevelop-IDE-Editor.png) ->Visit Homepage: - -### 13. Geany IDE - -Geany 是一个免费,快速,轻量级和跨平台的 IDE, 操作很少有依赖性,独立运行在流行的 Linux 桌面环境下,比如 GNOME 和 KDE. 它需要 GTK2 库实现功能。 - -它的特性包括以下列出的内容: - -- 支持语法高亮显示 -- 代码折叠 -- 调用提示 -- 符号名自动完成 -- 符号列表 -- 代码提示 -- 一个简单的项目管理工具 -- 内置系统编译并运行用户的代码 -- 可以通过插件扩展 - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Geany-IDE-for-Linux.png) ->Visit Homepage: - -### 14. Ajunta DeveStudio - -Ajunta DevStudio 是一个简单,强大的 GNOME 界面的软件开发工作室,支持包括 C/C++ 在内的众多编程语言。 - -它提供了先进的编程工具,比如项目管理,GUI 设计,交互式调试器,应用程序向导,源代码编辑,版本控制等。此外,除了以上特点,Ajunta DeveStudio 也有其他很多不错的 IDE 特色,包括这些: - -- 简单的用户界面 -- 通过插件扩展 -- 针对 WYSIWYG UI 开发的 Glade 集成 -- 工程的向导和模板 -- 集成的 GDB 调试器 -- 内置文件管理器 -- 使用 DevHelp 集成提供上下文敏感编程辅助 -- 源码编辑支持语法高亮显示,智能缩进,自动缩进,代码折叠/隐藏,文本缩放等 - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Anjuta-DevStudio-for-Linux.png) ->Visit Homepage: - -### 15. The GNAT Programming Studio - -The GNAT Programming Studio 是一个免费的易于使用的用来设计与开发的 IDE,可以统一开发人员与他/她的代码,软件之间的交互。 - -通过促进源导航的同时强调一个程序的重要部分和想法打造理想的编程`。`它也会带给你高水平舒适的编程体验,使用户能够开发综合性的系统。 - -它丰富的特性包括以下这些: - -- 直观的用户界面 -- 对开发者的友好性 -- 支持多种编程语言,跨平台 -- 灵活的 MDI (多文档界面) -- 高度可定制 -- 首选工具的完全可扩展性 - -![](http://www.tecmint.com/wp-content/uploads/2016/06/GNAT-Programming-Studio.jpg) ->Visit Homepage: - -### 16. Qt Creator - -这是一款非免费的,跨平台的 IDE, 用于创建连接设备、用户界面和应用程序。Qt Creator 可以让用户比实际应用编码有更多的创新。 - -它可以用来创建移动和桌面应用程序,以及嵌入式设备连接。 - -它的优点包含以下几点: - -- 复杂的代码编辑器 -- 支持版本控制 -- 项目构造管理工具 -- 支持多屏幕和多平台,易于构建目标之间的切换等等 - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Qt-Creator.png) ->Visit Homepage: - - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Emacs-Editor.png) ->Visit Homepage: https://www.gnu.org/software/emacs/ - -### 17. Emacs Editor - -Emacs是一个免费的,强大的,可大幅度扩展的、可定制的、跨平台的文本编辑器,你可以在Linux,Solaris,FreeBSD,NetBSD,OpenBSD,Windows和Mac OS X这些系统中使用该编辑器. - -Emacs 的核心也是一种 Emacs Lisp 的解释器,Emascs Lisp 是一种基于 Lisp 的编程语言。在撰写本文时,GNU Emacs的最新版本是24.5,Emacs的基本功能包括: - -- 内容识别编辑模式 -- 完全支持 Unicode -- 高度可定制地使用 GUI 或 Emacs Lisp 代码 -- 一种用于下载和安装扩展的打包系统 -- 系统本身的功能超出正常文本编辑的功能,包括项目策划、邮件、日历和新闻阅读器等 -- 一个完整的内置文档,以及用户指南等等 - -### 18. VI/VIM Editor - -Vim,一款 VI 编辑器的改进版本,是一款免费的、强大的、流行的并且高度可配置的文本编辑器。它为有效率地文本编辑而生,并且为 Unix/Linux 使用者提供了激动人心的编辑器特性,因此,它对于撰写和编辑 C/C++ 代码也是一个好的选择。 - -总的来说,与传统的文本编辑器相比,IDE 为编程提供了更多的便利,因此使用它们是一个很好的选择。它们带有激动人心的特征并且提供了一个综合性的开发环境,有时候程序员不得不陷入对最好的 C/C++ IDE 的选择。 - -在互联网上你还可以找到许多 IDE 来下载,但不妨试试我们推荐的这几款,可以帮助你尽快找到哪一款是你需要的。 - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/best-linux-ide-editors-source-code-editors/ - -作者:[Aaron Kili][a] -译者:[ZenMoore](https://github.com/ZenMoore) [LiBrad](https://github.com/LiBrad) [WangYueScream](https://github.com/WangYueScream) [LemonDemo](https://github.com/LemonDemo) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://www.tecmint.com/author/aaronkili/ -[1]: http://www.tecmint.com/debug-source-code-in-linux-using-gdb/ From 7516d88c776ebcdf52b39198156c3f7aaf565231 Mon Sep 17 00:00:00 2001 From: NearTan Date: Mon, 22 Aug 2016 01:17:07 +0800 Subject: [PATCH 1464/1469] translated --- ...asks and Application Deployments Over SSH.md | 254 ----------------- ...asks and Application Deployments Over SSH.md | 257 ++++++++++++++++++ 2 files changed, 257 insertions(+), 254 deletions(-) delete mode 100644 sources/tech/20151118 Fabric – Automate Your Linux Administration Tasks and Application Deployments Over SSH.md create mode 100644 translated/tech/20151118 Fabric – Automate Your Linux Administration Tasks and Application Deployments Over SSH.md diff --git a/sources/tech/20151118 Fabric – Automate Your Linux Administration Tasks and Application Deployments Over SSH.md b/sources/tech/20151118 Fabric – Automate Your Linux Administration Tasks and Application Deployments Over SSH.md deleted file mode 100644 index f45d1e9702..0000000000 --- a/sources/tech/20151118 Fabric – Automate Your Linux Administration Tasks and Application Deployments Over SSH.md +++ /dev/null @@ -1,254 +0,0 @@ -NearTan 认领 - -Fabric – Automate Your Linux Administration Tasks and Application Deployments Over SSH -=========================== - -When it comes to managing remote machines and deployment of applications, there are several command line tools out there in existence though many have a common problem of lack of detailed documentation. - -In this guide, we shall cover the steps to introduce and get started on how to use fabric to improve on administering groups of servers. - -![](http://www.tecmint.com/wp-content/uploads/2015/11/Automate-Linux-Administration-Tasks-Using-Fabric.png) ->Automate Linux Administration Tasks Using Fabric - -Fabric is a python library and a powerful command line tool for performing system administration tasks such as executing SSH commands on multiple machines and application deployment. - -Having a working knowledge of Python can be helpful when using Fabric, but may certainly not be necessary. - -Reasons why you should choose fabric over other alternatives: - -- Simplicity -- It is well-documented -- You don’t need to learn another language if you’re already a python guy. -- Easy to install and use. -- It is fast in its operations. -- It supports parallel remote execution. - -### How to Install Fabric Automation Tool in Linux - -An important characteristic about fabric is that the remote machines which you need to administer only need to have the standard OpenSSH server installed. You only need certain requirements installed on the server from which you are administering the remote servers before you can get started. - -#### Requirements: - -- Python 2.5+ with the development headers -- Python-setuptools and pip (optional, but preferred) gcc - -Fabric is easily installed using pip (highly recommended), but you may also prefer to choose your default package manager `yum`, `dnf` or `apt-get` to install fabric package, typically called fabric or python-fabric. - -For RHEL/CentOS based distributions, you must have [EPEL repository][1] installed and enabled on the system to install fabric package. - -``` -# yum install fabric [On RedHat based systems] -# dnf install fabric [On Fedora 22+ versions] -``` - -For Debian and it’s derivatives such as Ubuntu and Mint users can simply do apt-get to install the fabric package as shown: - -``` -# apt-get install fabric -``` - -If you want to install development version of fabric, you may use pip to grab the most recent master branch. - -``` -# yum install python-pip [On RedHat based systems] -# dnf install python-pip [On Fedora 22+ versions] -# apt-get install python-pip [On Debian based systems] -``` - -Once pip has been installed successfully, you may use pip to grab the latest version of fabric as shown: - -``` -# pip install fabric -``` - -### How to Use Fabric to Automate Linux Administration Tasks - -So lets get started on how you can use Fabric. During the installation process, a Python script called fab was added to a directory in your path. The `fab` script does all the work when using fabric. - -#### Executing commands on the local Linux machine - -By convention, you need to start by creating a Python file called fabfile.py using your favorite editor. Remember you can give this file a different name as you wish but you will need to specify the file path as follows: - -``` -# fabric --fabfile /path/to/the/file.py -``` - -Fabric uses `fabfile.py` to execute tasks. The fabfile should be in the same directory where you run the Fabric tool. - -Example 1: Let’s create a basic `Hello World` first. - -``` -# vi fabfile.py -``` - -Add these lines of code in the file. - -``` -def hello(): -print('Hello world, Tecmint community') -``` - -Save the file and run the command below. - -``` -# fab hello -``` - -![](http://www.tecmint.com/wp-content/uploads/2015/11/Create-Fabric-Fab-Python-File.gif) ->Fabric Tool Usage - -And paste the following lines of code in the file. - -``` -#! /usr/bin/env python -from fabric.api import local -def uptime(): -local('uptime') -``` - -Then save the file and run the following command: - -``` -# fab uptime -``` - -![](http://www.tecmint.com/wp-content/uploads/2015/11/Fabric-Uptime.gif) ->Fabric: Check System Uptime - -#### Executing commands on remote Linux machines to automate tasks - -The Fabric API uses a configuration dictionary which is Python’s equivalent of an associative array known as `env`, which stores values that control what Fabric does. - -The `env.hosts` is a list of servers on which you want run Fabric tasks. If your network is 192.168.0.0 and wish to manage host 192.168.0.2 and 192.168.0.6 with your fabfile, you could configure the env.hosts as follows: - -``` -#!/usr/bin/env python -from fabric.api import env -env.hosts = [ '192.168.0.2', '192.168.0.6' ] -``` - -The above line of code only specify the hosts on which you will run Fabric tasks but do nothing more. Therefore you can define some tasks, Fabric provides a set of functions which you can use to interact with your remote machines. - -Although there are many functions, the most commonly used are: - -- run – which runs a shell command on a remote machine. -- local – which runs command on the local machine. -- sudo – which runs a shell command on a remote machine, with root privileges. -- Get – which downloads one or more files from a remote machine. -- Put – which uploads one or more files to a remote machine. - -Example 3: To echo a message on multiple machines create a fabfile.py such as the one below. - -``` -#!/usr/bin/env python -from fabric.api import env, run -env.hosts = ['192.168.0.2','192.168.0.6'] -def echo(): -run("echo -n 'Hello, you are tuned to Tecmint ' ") -``` - -To execute the tasks, run the following command: - -``` -# fab echo -``` - -![](http://www.tecmint.com/wp-content/uploads/2015/11/Fabrick-Automate-Linux-Tasks.gif) ->Fabric: Automate Linux Tasks on Remote Linux - -Example 4: You can improve the fabfile.py which you created earlier on to execute the uptime command on the local machine, so that it runs the uptime command and also checks disk usage using the df command on multiple machines as follows: - -``` -#!/usr/bin/env python -from fabric.api import env, run -env.hosts = ['192.168.0.2','192.168.0.6'] -def uptime(): -run('uptime') -def disk_space(): -run('df -h') -``` - -Save the file and run the following command: - -``` -# fab uptime -# fab disk_space -``` - -![](http://www.tecmint.com/wp-content/uploads/2015/11/Fabric-Run-Multiple-Commands-on-Multiple-Linux-Systems.gif) ->Fabric: Automate Tasks on Multiple Linux Systems - -#### Automatically Deploy LAMP Stack on Remote Linux Server - -Example 4: Let us look at an example to deploy LAMP (Linux, Apache, MySQL/MariaDB and PHP) server on a remote Linux server. - -We shall write a function that will allow LAMP to be installed remotely using root privileges. - -##### For RHEL/CentOS and Fedora - -``` -#!/usr/bin/env python -from fabric.api import env, run -env.hosts = ['192.168.0.2','192.168.0.6'] -def deploy_lamp(): -run ("yum install -y httpd mariadb-server php php-mysql") -``` - -##### For Debian/Ubuntu and Linux Mint - -``` -#!/usr/bin/env python -from fabric.api import env, run -env.hosts = ['192.168.0.2','192.168.0.6'] -def deploy_lamp(): -sudo("apt-get install -q apache2 mysql-server libapache2-mod-php5 php5-mysql") -``` - -Save the file and run the following command: - -``` -# fab deploy_lamp -``` - -Note: Due to large output, it’s not possible for us to create a screencast (animated gif) for this example. - -Now you can able to [automate Linux server management tasks][2] using Fabric and its features and examples given above… - -#### Some Useful Options to Use with Fabric - -- You can run fab –help to view help information and a long list of available command line options. -- An important option is –fabfile=PATH that helps you to specify a different python module file to import other then fabfile.py. -- To specify a username to use when connecting to remote hosts, use the –user=USER option. -- To use password for authentication and/or sudo, use the –password=PASSWORD option. -- To print detailed info about command NAME, use –display=NAME option. -- To view formats use –list option, choices: short, normal, nested, use the –list-format=FORMAT option. -- To print list of possible commands and exit, include the –list option. -- You can specify the location of config file to use by using the –config=PATH option. -- To display a colored error output, use –colorize-errors. -- To view the program’s version number and exit, use the –version option. - -### Summary - -Fabric is a powerful tool and is well documented and provides easy usage for newbies. You can read the full documentation to get more understanding of it. If you have any information to add or incase of any errors you encounter during installation and usage, you can leave a comment and we shall find ways to fix them. - -Reference: [Fabric documentation][3] - - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/automating-linux-system-administration-tasks/ - -作者:[Aaron Kili ][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/aaronkili/ -[1]: http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/ -[2]: http://www.tecmint.com/use-ansible-playbooks-to-automate-complex-tasks-on-multiple-linux-servers/ -[3]: http://docs.fabfile.org/en/1.4.0/usage/env.html - - - - diff --git a/translated/tech/20151118 Fabric – Automate Your Linux Administration Tasks and Application Deployments Over SSH.md b/translated/tech/20151118 Fabric – Automate Your Linux Administration Tasks and Application Deployments Over SSH.md new file mode 100644 index 0000000000..ba0dc2d2a1 --- /dev/null +++ b/translated/tech/20151118 Fabric – Automate Your Linux Administration Tasks and Application Deployments Over SSH.md @@ -0,0 +1,257 @@ + +Fabric - 通过 SSH 来自动化管理 Linux 任务和布署应用 +=========================== + +当要管理远程机器或者要布署应用时,你会有多种命令行工具的选择,但是其中很多工具都缺少详细的使用文档。 + +在这篇教程中,我们将会一步一步地向你介绍如何使用 fabric 来帮助你更好得管理多台服务器。 + +![](http://www.tecmint.com/wp-content/uploads/2015/11/Automate-Linux-Administration-Tasks-Using-Fabric.png) +>使用 Fabric 来自动化地管理 Linux 任务 + +Fabric 是一个用 Python 编写的命令行工具库,它可以帮助系统管理员高效地执行某些任务,比如 SSH 到多台机器上执行某些命令,远程布署应用等。 + +在使用之前,如果你拥有使用 Python 的经验能帮你更好的使用 Fabric。当然,如果没有那也不影响使用 Fabric。 + +我们为什么要选择 Fabric + +- 简单 +- 拥有详细的文档 +- 如果你会 Python,不用增加学习其他语言的成本 +- 即插即用 +- 使用便捷 +- 支持多台机器并行操作 + +### 在 Linux 上如何安装 Fabric + +Fabric 有一个特点就是要远程操作的机器只需要支持标准的 OpenSSH 服务即可。只要保证在机器上安装并开启了这个服务就能使用 Fabric 来管理机器。 + +#### 依赖: + +- Python 2.5 或更新版本,以及对应的开发组件 +- Python-setuptools 和 pip(可选,但是非常推荐)gcc + +我们推荐使用 pip 安装 Fabric,你可以使用系统自带的包管理器如 `yum`, `dnf` 或 `apt-get` 来安装,包名一般是 `fabric` 或 `python-fabric`。 + +如果是基于 RHEL/CentOS 的发行版本的系统,你可以使用系统自带的 [EPEL 源][1] 来安装 fabric + +``` +# yum install fabric [适用于基于 RedHat 系统] +# dnf install fabric [适用于 Fedora 22+ 版本] +``` + +如果你是 Debian 或者其派生的系统如 Ubuntu 和 Mint 用户,你可以使用 apt-gte 来安装,如下所示: + +``` +# apt-get install fabric +``` + +如果你要安装开发版的 Fabric,你应该安装 master 分支上最新版本的 pip + +``` +# yum install python-pip [适用于基于 RedHat 系统] +# dnf install python-pip [适用于Fedora 22+ 版本] +# apt-get install python-pip [适用于基于 Debian 系统] +``` + +安装好 pip 后,你可以使用 pip 获取最新版本的 Fabric + +``` +# pip install fabric +``` + +### 如何使用 Fabric 来自动化管理 Linux 任务 + +现在我们来开始使用 Fabric,在之前的安装的过程中,Fabric Python 脚本已经被增加到我们的系统目录,当我们要运行 Fabric 时输入 `fab` 命令即可。 + +#### 在本地 Linux 机器上运行命令行 + +按照惯例,先用你最喜欢的编辑器创建一个名为 fabfile.py 的 Python 脚本。你可以使用其他名字来命名脚本,但是需要先声明这个脚本的路径,如下所示: + +``` +# fabric --fabfile /path/to/the/file.py +``` + +如果你要使用 Fabric 来执行 `fabfile.py` 里面的任务,文件必需在你执行 Fabric 命令下的同一目录 + +例 1:创建入门的 `Hello World` 任务: + +``` +# vi fabfile.py +``` + +在文件内输入如下内容: + +``` +def hello(): + print('Hello world, Tecmint community') +``` + +保存文件并执行以下命令: + +``` +# fab hello +``` + +![](http://www.tecmint.com/wp-content/uploads/2015/11/Create-Fabric-Fab-Python-File.gif) +>Fabric 工具使用说明 + +让我们看看这个例子,fabfile.py 文件在本机执行了 uptime 这个命令 + +例子2:新建一个名为 fabfile.py 的文件并打开: + +粘贴以下代码至文件(to 校对:选题时的文章缺少了上面这三句话,译者从原网站补充至本文,请校对注意) + +``` +#! /usr/bin/env python +from fabric.api import local + +def uptime(): + local('uptime') +``` + +保存文件并执行以下命令: + +``` +# fab uptime +``` + +![](http://www.tecmint.com/wp-content/uploads/2015/11/Fabric-Uptime.gif) +>Fabric: 检查系统运行时间 + +#### 在远程 Linux 机器上运行命令行来执行自动化任务 + +Fabric API 提供了一个名为 `env` 的关联数组(Python 中的词典)来储存 Fabric 要控制的机器的相关信息。 + +`env.hosts` 是一个 list 用来存储你要执行 Fabric 任务的机器,如果你的 IP 地址是 192.168.0.0,想要用 Fabric 来管理地址为 192.168.0.2 和 192.168.0.6 的机器,需要的配置如下所示: + +``` +#!/usr/bin/env python +from fabric.api import env + env.hosts = [ '192.168.0.2', '192.168.0.6' ] +``` + +上面这几行代码只是声明了你要执行 Fabric 任务的主机地址,但是实际上并没有执行任何任务,下面我们就来定义一些任务。Fabric 提供了一系列可以与远程服务器交互的方法。 + +Fabric 提供了众多的方法,这里列出几个经常会用到的: + +- run - 可以在远程机器上运行的 shell 命令 +- local - 可以在本机上运行的 shell 命令 +- sudo 使用 root 权限运行的 shell 命令 +- get - 从远程机器上下载文件 +- put - 上传文件到远程机器 + +例子 3:在多台机子上输出信息,新建新的 fabfile.py 文件如下所示 + +``` +#!/usr/bin/env python +from fabric.api import env, run +env.hosts = ['192.168.0.2','192.168.0.6'] +def echo(): + run("echo -n 'Hello, you are tuned to Tecmint ' ") +``` + +运行以下命令执行 Fabric 任务 + +``` +# fab echo +``` + +![](http://www.tecmint.com/wp-content/uploads/2015/11/Fabrick-Automate-Linux-Tasks.gif) +>fabric: 自动在远程 Linux 机器上执行任务 + +例子 4:你可以继续改进之前创建的执行 uptime 任务的 fabfile.py 文件,让它可以在多台服务器上检查其磁盘使用情况,如下所示: + +``` +#!/usr/bin/env python +from fabric.api import env, run +env.hosts = ['192.168.0.2','192.168.0.6'] +def uptime(): + run('uptime') +def disk_space(): + run('df -h') +``` + +保存并执行以下命令 + +``` +# fab uptime +# fab disk_space +``` + +![](http://www.tecmint.com/wp-content/uploads/2015/11/Fabric-Run-Multiple-Commands-on-Multiple-Linux-Systems.gif) +>Fabric:自动在多台服务器上执行任务 + +#### 在远程服务器上自动化布署 LAMP + +Example 4(5?):我们来尝试一下在远程服务器上布署 LAMP(Linux, Apache, MySQL/MariaDB and PHP) + + +我们在远程安装 LAMP 时应该使用 root 权限。 + +##### 在 RHEL/CentOS 或 Fedora 上 + +``` +#!/usr/bin/env python +from fabric.api import env, run +env.hosts = ['192.168.0.2','192.168.0.6'] +def deploy_lamp(): + run ("yum install -y httpd mariadb-server php php-mysql") +``` + +##### 在 Debian/Ubuntu 或 Linux Mint 上 + +``` +#!/usr/bin/env python +from fabric.api import env, run +env.hosts = ['192.168.0.2','192.168.0.6'] +def deploy_lamp(): + sudo("apt-get install -q apache2 mysql-server libapache2-mod-php5 php5-mysql") +``` + +保存并执行以下命令: + +``` +# fab deploy_lamp +``` + +注:由于安装时会输出大量信息,这个例子我们就不提供屏幕 gif 图了 + +现在你可以使用上文例子所示的功能来[自动化的管理 Linux 服务器上的任务][2]了。 + +#### 一些 Fabric 有用的选项 + + +- 你可以运行 `fab -help` 输出帮助信息,里面列出了所有可以使用的命令行信息 +- `–fabfile=PATH` 选项可以让你定义除了名为 fabfile.py 之外的模块 +- 如果你想用指定的用户名登录远程主机,请使用 `-user=USER` 选项 +- 如果你需要密码进行验证或者 sudo 提权,请使用 `–password=PASSWORD` 选项 +- 如果需要输出某个命令行的详细信息,请使用 `–display=NAME` 选项 +- 使用 `--list-format=FORMAT` 选项能格式化 `-list` 选项输出的信息,可选的有 short, normal, nested +- 使用 `--list` 输出所有可用的任务(to 校对:建议与上一条交换位置) +- `--config=PATH` 选项可以指定读取配置文件的地址 +- `-–colorize-errors` 能显示彩色的错误输出信息 +- `--version` 输出当前版本 +(to 校对:以上根据原文格式加了代码标签,并且根据 Fabric 文档修正了命令使用) + +### Summary + +Fabric 是一个强大并且拥有充足文档的工具,对于新手来说也能很快上手,阅读提供的文档能帮助你更好的了解这个它。如果你在安装和使用 Fabric 时发现什么问题可以在评论区留言,我们会及时回复。 + +引文:[Fabric 文档][3] + + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/automating-linux-system-administration-tasks/ + +作者:[Aaron Kili ][a] +译者:[NearTan](https://github.com/NearTan) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.tecmint.com/author/aaronkili/ +[1]: http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/ +[2]: http://www.tecmint.com/use-ansible-playbooks-to-automate-complex-tasks-on-multiple-linux-servers/ +[3]: http://docs.fabfile.org/en/1.4.0/usage/env.html From 5eb1b1b806e25b1753ea04d7e8c9b95d631c7b7c Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 22 Aug 2016 09:56:26 +0800 Subject: [PATCH 1465/1469] =?UTF-8?q?PUB:20151118=20Fabric=20=E2=80=93=20A?= =?UTF-8?q?utomate=20Your=20Linux=20Administration=20Tasks=20and=20Applica?= =?UTF-8?q?tion=20Deployments=20Over=20SSH?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @NearTan 翻译的很用心。个别语句理解有点偏差。 --- ...asks and Application Deployments Over SSH.md | 96 +++++++++---------- 1 file changed, 48 insertions(+), 48 deletions(-) rename {translated/tech => published}/20151118 Fabric – Automate Your Linux Administration Tasks and Application Deployments Over SSH.md (60%) diff --git a/translated/tech/20151118 Fabric – Automate Your Linux Administration Tasks and Application Deployments Over SSH.md b/published/20151118 Fabric – Automate Your Linux Administration Tasks and Application Deployments Over SSH.md similarity index 60% rename from translated/tech/20151118 Fabric – Automate Your Linux Administration Tasks and Application Deployments Over SSH.md rename to published/20151118 Fabric – Automate Your Linux Administration Tasks and Application Deployments Over SSH.md index ba0dc2d2a1..fdd53956c4 100644 --- a/translated/tech/20151118 Fabric – Automate Your Linux Administration Tasks and Application Deployments Over SSH.md +++ b/published/20151118 Fabric – Automate Your Linux Administration Tasks and Application Deployments Over SSH.md @@ -1,24 +1,24 @@ - Fabric - 通过 SSH 来自动化管理 Linux 任务和布署应用 =========================== -当要管理远程机器或者要布署应用时,你会有多种命令行工具的选择,但是其中很多工具都缺少详细的使用文档。 +当要管理远程机器或者要布署应用时,虽然你有多种命令行工具可以选择,但是其中很多工具都缺少详细的使用文档。 在这篇教程中,我们将会一步一步地向你介绍如何使用 fabric 来帮助你更好得管理多台服务器。 ![](http://www.tecmint.com/wp-content/uploads/2015/11/Automate-Linux-Administration-Tasks-Using-Fabric.png) ->使用 Fabric 来自动化地管理 Linux 任务 -Fabric 是一个用 Python 编写的命令行工具库,它可以帮助系统管理员高效地执行某些任务,比如 SSH 到多台机器上执行某些命令,远程布署应用等。 +*使用 Fabric 来自动化地管理 Linux 任务* + +Fabric 是一个用 Python 编写的命令行工具库,它可以帮助系统管理员高效地执行某些任务,比如通过 SSH 到多台机器上执行某些命令,远程布署应用等。 在使用之前,如果你拥有使用 Python 的经验能帮你更好的使用 Fabric。当然,如果没有那也不影响使用 Fabric。 -我们为什么要选择 Fabric +我们为什么要选择 Fabric: - 简单 -- 拥有详细的文档 +- 完备的文档 - 如果你会 Python,不用增加学习其他语言的成本 -- 即插即用 +- 易于安装使用 - 使用便捷 - 支持多台机器并行操作 @@ -26,27 +26,27 @@ Fabric 是一个用 Python 编写的命令行工具库,它可以帮助系统 Fabric 有一个特点就是要远程操作的机器只需要支持标准的 OpenSSH 服务即可。只要保证在机器上安装并开启了这个服务就能使用 Fabric 来管理机器。 -#### 依赖: +#### 依赖 - Python 2.5 或更新版本,以及对应的开发组件 - Python-setuptools 和 pip(可选,但是非常推荐)gcc -我们推荐使用 pip 安装 Fabric,你可以使用系统自带的包管理器如 `yum`, `dnf` 或 `apt-get` 来安装,包名一般是 `fabric` 或 `python-fabric`。 +我们推荐使用 pip 安装 Fabric,但是你也可以使用系统自带的包管理器如 `yum`, `dnf` 或 `apt-get` 来安装,包名一般是 `fabric` 或 `python-fabric`。 -如果是基于 RHEL/CentOS 的发行版本的系统,你可以使用系统自带的 [EPEL 源][1] 来安装 fabric +如果是基于 RHEL/CentOS 的发行版本的系统,你可以使用系统自带的 [EPEL 源][1] 来安装 fabric。 ``` # yum install fabric [适用于基于 RedHat 系统] # dnf install fabric [适用于 Fedora 22+ 版本] ``` -如果你是 Debian 或者其派生的系统如 Ubuntu 和 Mint 用户,你可以使用 apt-gte 来安装,如下所示: +如果你是 Debian 或者其派生的系统如 Ubuntu 和 Mint 的用户,你可以使用 apt-get 来安装,如下所示: ``` # apt-get install fabric ``` -如果你要安装开发版的 Fabric,你应该安装 master 分支上最新版本的 pip +如果你要安装开发版的 Fabric,你需要安装 pip 来安装 master 分支上最新版本。 ``` # yum install python-pip [适用于基于 RedHat 系统] @@ -54,7 +54,7 @@ Fabric 有一个特点就是要远程操作的机器只需要支持标准的 Ope # apt-get install python-pip [适用于基于 Debian 系统] ``` -安装好 pip 后,你可以使用 pip 获取最新版本的 Fabric +安装好 pip 后,你可以使用 pip 获取最新版本的 Fabric。 ``` # pip install fabric @@ -62,19 +62,19 @@ Fabric 有一个特点就是要远程操作的机器只需要支持标准的 Ope ### 如何使用 Fabric 来自动化管理 Linux 任务 -现在我们来开始使用 Fabric,在之前的安装的过程中,Fabric Python 脚本已经被增加到我们的系统目录,当我们要运行 Fabric 时输入 `fab` 命令即可。 +现在我们来开始使用 Fabric,在之前的安装的过程中,Fabric Python 脚本已经被放到我们的系统目录,当我们要运行 Fabric 时输入 `fab` 命令即可。 #### 在本地 Linux 机器上运行命令行 -按照惯例,先用你最喜欢的编辑器创建一个名为 fabfile.py 的 Python 脚本。你可以使用其他名字来命名脚本,但是需要先声明这个脚本的路径,如下所示: +按照惯例,先用你喜欢的编辑器创建一个名为 fabfile.py 的 Python 脚本。你可以使用其他名字来命名脚本,但是就需要指定这个脚本的路径,如下所示: ``` # fabric --fabfile /path/to/the/file.py ``` -如果你要使用 Fabric 来执行 `fabfile.py` 里面的任务,文件必需在你执行 Fabric 命令下的同一目录 +Fabric 使用 `fabfile.py` 来执行任务,这个文件应该放在你执行 Fabric 命令的目录里面。 -例 1:创建入门的 `Hello World` 任务: +**例子 1**:创建入门的 `Hello World` 任务: ``` # vi fabfile.py @@ -94,18 +94,16 @@ def hello(): ``` ![](http://www.tecmint.com/wp-content/uploads/2015/11/Create-Fabric-Fab-Python-File.gif) ->Fabric 工具使用说明 -让我们看看这个例子,fabfile.py 文件在本机执行了 uptime 这个命令 +*Fabric 工具使用说明* -例子2:新建一个名为 fabfile.py 的文件并打开: +**例子 2**:新建一个名为 fabfile.py 的文件并打开: -粘贴以下代码至文件(to 校对:选题时的文章缺少了上面这三句话,译者从原网站补充至本文,请校对注意) +粘贴以下代码至文件: ``` #! /usr/bin/env python from fabric.api import local - def uptime(): local('uptime') ``` @@ -117,13 +115,16 @@ def uptime(): ``` ![](http://www.tecmint.com/wp-content/uploads/2015/11/Fabric-Uptime.gif) ->Fabric: 检查系统运行时间 -#### 在远程 Linux 机器上运行命令行来执行自动化任务 +*Fabric: 检查系统运行时间* -Fabric API 提供了一个名为 `env` 的关联数组(Python 中的词典)来储存 Fabric 要控制的机器的相关信息。 +让我们看看这个例子,fabfile.py 文件在本机执行了 uptime 这个命令。 -`env.hosts` 是一个 list 用来存储你要执行 Fabric 任务的机器,如果你的 IP 地址是 192.168.0.0,想要用 Fabric 来管理地址为 192.168.0.2 和 192.168.0.6 的机器,需要的配置如下所示: +#### 在远程 Linux 机器上运行命令来执行自动化任务 + +Fabric API 使用了一个名为 `env` 的关联数组(Python 中的词典)作为配置目录,来储存 Fabric 要控制的机器的相关信息。 + +`env.hosts` 是一个用来存储你要执行 Fabric 任务的机器的列表,如果你的 IP 地址是 192.168.0.0,想要用 Fabric 来管理地址为 192.168.0.2 和 192.168.0.6 的机器,需要的配置如下所示: ``` #!/usr/bin/env python @@ -137,11 +138,11 @@ Fabric 提供了众多的方法,这里列出几个经常会用到的: - run - 可以在远程机器上运行的 shell 命令 - local - 可以在本机上运行的 shell 命令 -- sudo 使用 root 权限运行的 shell 命令 -- get - 从远程机器上下载文件 -- put - 上传文件到远程机器 +- sudo - 使用 root 权限在远程机器上运行的 shell 命令 +- get - 从远程机器上下载一个或多个文件 +- put - 上传一个或多个文件到远程机器 -例子 3:在多台机子上输出信息,新建新的 fabfile.py 文件如下所示 +**例子 3**:在多台机子上输出信息,新建新的 fabfile.py 文件如下所示 ``` #!/usr/bin/env python @@ -158,9 +159,10 @@ def echo(): ``` ![](http://www.tecmint.com/wp-content/uploads/2015/11/Fabrick-Automate-Linux-Tasks.gif) ->fabric: 自动在远程 Linux 机器上执行任务 -例子 4:你可以继续改进之前创建的执行 uptime 任务的 fabfile.py 文件,让它可以在多台服务器上检查其磁盘使用情况,如下所示: +*fabric: 自动在远程 Linux 机器上执行任务* + +**例子 4**:你可以继续改进之前创建的执行 uptime 任务的 fabfile.py 文件,让它可以在多台服务器上运行 uptime 命令,也可以检查其磁盘使用情况,如下所示: ``` #!/usr/bin/env python @@ -180,14 +182,14 @@ def disk_space(): ``` ![](http://www.tecmint.com/wp-content/uploads/2015/11/Fabric-Run-Multiple-Commands-on-Multiple-Linux-Systems.gif) ->Fabric:自动在多台服务器上执行任务 + +*Fabric:自动在多台服务器上执行任务* #### 在远程服务器上自动化布署 LAMP -Example 4(5?):我们来尝试一下在远程服务器上布署 LAMP(Linux, Apache, MySQL/MariaDB and PHP) +**例子 5**:我们来尝试一下在远程服务器上布署 LAMP(Linux, Apache, MySQL/MariaDB and PHP) - -我们在远程安装 LAMP 时应该使用 root 权限。 +我们要写个函数在远程使用 root 权限安装 LAMP。 ##### 在 RHEL/CentOS 或 Fedora 上 @@ -217,41 +219,39 @@ def deploy_lamp(): 注:由于安装时会输出大量信息,这个例子我们就不提供屏幕 gif 图了 -现在你可以使用上文例子所示的功能来[自动化的管理 Linux 服务器上的任务][2]了。 +现在你可以使用 Fabric 和上文例子所示的功能来[自动化的管理 Linux 服务器上的任务][2]了。 #### 一些 Fabric 有用的选项 - - 你可以运行 `fab -help` 输出帮助信息,里面列出了所有可以使用的命令行信息 - `–fabfile=PATH` 选项可以让你定义除了名为 fabfile.py 之外的模块 - 如果你想用指定的用户名登录远程主机,请使用 `-user=USER` 选项 - 如果你需要密码进行验证或者 sudo 提权,请使用 `–password=PASSWORD` 选项 -- 如果需要输出某个命令行的详细信息,请使用 `–display=NAME` 选项 -- 使用 `--list-format=FORMAT` 选项能格式化 `-list` 选项输出的信息,可选的有 short, normal, nested -- 使用 `--list` 输出所有可用的任务(to 校对:建议与上一条交换位置) +- 如果需要输出某个命令的详细信息,请使用 `–display=命令名` 选项 +- 使用 `--list` 输出所有可用的任务 +- 使用 `--list-format=FORMAT` 选项能格式化 `-list` 选项输出的信息,可选的有 short、normal、 nested - `--config=PATH` 选项可以指定读取配置文件的地址 - `-–colorize-errors` 能显示彩色的错误输出信息 - `--version` 输出当前版本 -(to 校对:以上根据原文格式加了代码标签,并且根据 Fabric 文档修正了命令使用) -### Summary +### 总结 -Fabric 是一个强大并且拥有充足文档的工具,对于新手来说也能很快上手,阅读提供的文档能帮助你更好的了解这个它。如果你在安装和使用 Fabric 时发现什么问题可以在评论区留言,我们会及时回复。 +Fabric 是一个强大并且文档完备的工具,对于新手来说也能很快上手,阅读提供的文档能帮助你更好的了解它。如果你在安装和使用 Fabric 时发现什么问题可以在评论区留言,我们会及时回复。 -引文:[Fabric 文档][3] +参考:[Fabric 文档][3] -------------------------------------------------------------------------------- via: http://www.tecmint.com/automating-linux-system-administration-tasks/ -作者:[Aaron Kili ][a] +作者:[Aaron Kili][a] 译者:[NearTan](https://github.com/NearTan) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: http://www.tecmint.com/author/aaronkili/ -[1]: http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/ +[1]: https://linux.cn/article-2324-1.html [2]: http://www.tecmint.com/use-ansible-playbooks-to-automate-complex-tasks-on-multiple-linux-servers/ [3]: http://docs.fabfile.org/en/1.4.0/usage/env.html From e2b9e646fc24883e55c3ec180be5113d5c768d8f Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 22 Aug 2016 10:24:39 +0800 Subject: [PATCH 1466/1469] =?UTF-8?q?20160822-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...n for the Android platform 101 - Part 1.md | 107 ++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 sources/tech/20160817 Dependency Injection for the Android platform 101 - Part 1.md diff --git a/sources/tech/20160817 Dependency Injection for the Android platform 101 - Part 1.md b/sources/tech/20160817 Dependency Injection for the Android platform 101 - Part 1.md new file mode 100644 index 0000000000..93ddf0f20a --- /dev/null +++ b/sources/tech/20160817 Dependency Injection for the Android platform 101 - Part 1.md @@ -0,0 +1,107 @@ +Dependency Injection for the Android platform 101 - Part 1 +=========================== + +![](https://d262ilb51hltx0.cloudfront.net/max/2000/1*YWlAzAY20KLLGIyyD_mzZw.png) + +When we first start studying software engineering, we usually bump into something like: + +>Software shall be SOLID. + +but what does that mean, in fact? Well, let’s just say that each character of the acronym means something really important for the architecture, such as: + +- [Single Responsibility Principle][1] +- [Open/closed principle][2] +- [Liskov substitution principle][3] +- [Interface segregation principle][4] +- [Dependency inversion principle][5] which is the core concept on which the dependency injection is based. + +Simply, we need to provide a class with all the objects it needs in order to perform its duties. + +### Overview + +Dependency Injection sounds like a very complex term for something that is, in fact, really easy and could be explained with this example: + +As we can see, in the first case, we create the dependency in the constructor, while in the second case it gets passed as a parameter. The second case is what we call dependency injection. We do this so that our class does not depend on the specific implementation of its dependency but it just uses it. +Moreover, based on whether the parameter is passed over to the constructor or to a method, we talk either about constructor dependency injection or method dependency injection: + +If you want to know more about Dependency Injection in general, be sure to check out this amazing talk from Dan Lew that actually inspired this overview. + +On Android, we have different choices when it comes to frameworks for solving this particular problem but the most famous is Dagger 2, first made by the awesome guys at Square and then evolved by Google itself. Specifically, Dagger 1 was made by the first and then Big G took over the project and created the second version, with major changes such being based on annotations and doing its job at compile time. + +### Importing the framework + +Setting up Dagger is no big deal, but it requires us to import the android-apt plugin by adding its dependency in the build.gradle file in the root directory of the project: + +``` +buildscript{ + ... + dependencies{ + ... + classpath ‘com.neenbedankt.gradle.plugins:android-apt:1.8’ + } +} +``` + +Then, we need to apply the android-apt plugin in the top part of the app’s build.gradle file, right below the Android application one: + +``` +apply plugin: ‘com.neenbedankt.android-apt’ +``` + +At this point, we just need to add the dependencies so that we are now able to use the libraries and its annotations: + +``` +dependencies{ + ... + compile ‘com.google.dagger:dagger:2.6’ + apt ‘com.google.dagger:dagger-compiler:2.6’ + provided ‘javax.annotation:jsr250-api:1.0’ +} +``` + +>The last dependency is needed because the @Generated annotation is not yet available on Android, but it’s pure Java. + +### Dagger Modules + +For injecting our dependencies, we first need to tell the framework what we can provide (i.e. the Context) and how that specific object is built. In order to do this, we annotate a specific class with the @Module annotation (so that Dagger is able to pick it up) scan for the @Provide annotated methods and generate the graph that will give us the object we request. + +Let’s see an example where we create a module that will give us the ConnectivityManager. So we need the Context that we will pass in the constructor of the module: + +>A very interesting feature of Dagger is providing a Singleton by simply annotating a method, dealing with all the issues inherited from Java by itself. + +### The Components + +Once we have a module, we need to tell Dagger where we want our dependencies to be injected: we do this in a Component, a specifically annotated interface in which we create different methods, where the parameters are the classes into which we want our dependencies to be injected. + +Let’s give an example and say that we want our MainActivity class to be able to receive the ConnectivityManager (or any other dependency in the graph). We would simply do something like this: + +>As we can see, the @Component annotation takes some parameters, one being an array of the modules supported, meaning the dependencies it can provide. In our case, that would be both the Context and the ConnectivityManager, as they are declared in the ApplicationModule class. + +### Wiring up + +At this point, what we need to do is create the Component as soon as possible (such as in the onCreate phase of the Application) and return it, so that the classes can use it for injecting the dependencies: + +>In order to have the DaggerApplicationComponent automatically generated by the framework, we need to build our projects so that Dagger can scan our codebase and generate the parts we need. + +In our MainActivity, though, the two things we need to do are annotate a property we want to inject with the @Inject annotation and invoke the method we declared in the ApplicationComponent interface (note that this last part varies based on what kind of injection we are performing, but for the moment we can leave it as is for the simplicity), so that our dependencies get injected and we can use them freely: + +### Conclusion + +Of course, we could do Dependency Injection manually, managing all the different objects, but Dagger takes away a lot of the “noise” involved with such boilerplate, giving us some nice additions (such as Singleton) that would otherwise be pretty awful to deal with in Java. + +-------------------------------------------------------------------------------- + +via: https://medium.com/di-101/di-101-part-1-81896c2858a0#.3hg0jj14o + +作者:[Roberto Orgiu][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://medium.com/@_tiwiz +[1]: https://en.wikipedia.org/wiki/Single_responsibility_principle +[2]: https://en.wikipedia.org/wiki/Open/closed_principle +[3]: http://liskov_substitution_principle/ +[4]: https://en.wikipedia.org/wiki/Interface_segregation_principle +[5]: https://en.wikipedia.org/wiki/Dependency_inversion_principle From ba47ddc85efda504b03dcda710b3d8662b31e0f7 Mon Sep 17 00:00:00 2001 From: kokialoves <498497353@qq.com> Date: Mon, 22 Aug 2016 10:27:53 +0800 Subject: [PATCH 1467/1469] Update 20160812 Writing a JavaScript framework - Execution timing.md --- ...20160812 Writing a JavaScript framework - Execution timing.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20160812 Writing a JavaScript framework - Execution timing.md b/sources/tech/20160812 Writing a JavaScript framework - Execution timing.md index 601abecb80..44f5a2653e 100644 --- a/sources/tech/20160812 Writing a JavaScript framework - Execution timing.md +++ b/sources/tech/20160812 Writing a JavaScript framework - Execution timing.md @@ -1,3 +1,4 @@ +[translating by kokialoves] Writing a JavaScript framework - Execution timing, beyond setTimeout =================== From 1df5c832433d7db2ae9f5b94e667f1ddbffdcfc9 Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 22 Aug 2016 10:35:30 +0800 Subject: [PATCH 1468/1469] =?UTF-8?q?20160822-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Android Dev And What I Learned From It.md | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 sources/talk/20160814 How I Got to be an Android Dev And What I Learned From It.md diff --git a/sources/talk/20160814 How I Got to be an Android Dev And What I Learned From It.md b/sources/talk/20160814 How I Got to be an Android Dev And What I Learned From It.md new file mode 100644 index 0000000000..f8fe109506 --- /dev/null +++ b/sources/talk/20160814 How I Got to be an Android Dev And What I Learned From It.md @@ -0,0 +1,59 @@ +How I Got to be an Android Dev And What I Learned From It +============================= + +They say all relationships go through a rough patch at two, seven, then ten years. I don't remember who said it, but someone told me that many years ago. + +Next week will be my moving-to-Sydney second anniversary, so I figured this is a good time to write this post. + +During I/O last May, I met one of the coolest ladies ever, Yasmine. She asked me how I got into Android development, and when I was done telling her she said I should blog about it. So here it is, Yasmine. Better late than never. ;) + +### In the beginning... + +If there's one thing you should know about me, it's that I find it very hard to make decisions. Who's your best friend? What's your favourite food? What should you name your stuffed panda? I don't know the answer to these things. So imagine 16-year-old me, about to graduate high school, and I had Zero Idea what I wanted to major in. The first university I applied to? I wrote down what major I was applying for right in front of the registrar, literally before handing her my application form (Business Economics). + +I ended up going to another school, majoring in Electronics and Communications Engineering. I had one computer programming subject in freshman year. And I hated it. I hated it with a passion. I couldn't figure how anything works, and I swore I would never do that again. + +My first job after uni was with Intel as a product engineer. I worked there for two years. Lived in the middle of nowhere, worked long hours. But I thought that's par for the course; part of being an adult is working hard, right? And then the semiconductor industry in the Philippines started flipping out. A lot of other factories closed down, some of the products we used to look after were being transferred to other sites. I decided I'd rather look for another job now, than being retrenched and not knowing how long I will be jobless for. + +### What Now? + +I wanted a job back in the city, and I kinda don't want to stay in a sinking industry. But then again, there is nothing else I know how to do. Yeah, I am a licensed engineer, so technically I could work for a telco, or a TV station even! But at that time, if you want to for a telco, you'd have a better chance of getting hired if you interned with them right out of uni. And I didn't, so that's out. There were a lot of job postings for software developers though. But I hated programming! I don't know how to do it! + +And this is when my first lucky break came. I am so fortunate that I met a manager who trusted in me. I was upfront with her, I don't know shit. I would have to learn on the job, so it would be a slow start. Needless to say, I learned a lot in that job. I worked on some pretty cool stuff (we made apps installed in SIM cards), and met a lot of really nice people. But more importantly, it kickstarted my foray into software development. + +I eventually worked on more enterprise-y stuff (boring). Until the time we ran out of projects. I mean I'm all for coming in puttering around the office doing nothing and getting paid for it. But after two days it turns out it kinda sucks. It was 2009 and I keep on hearing about this new OS from Google called Android and that the SDK is Out Now! and that You Should Try It Out. So I installed all the things and started Android-ing. + +### Things Get Interesting + +So now that I have built a shiny, new Hello World app that runs on an emulator, I took that as a sign that I have the creds to apply for an Android development job. I joined a start up, and again, I was upfront about it -- I don't know how to do this, I have just been playing around, but if you want to pay me to play around, then we can be friends. And so I was met with another lucky break. + +It was an encouraging time to be a dev. The Android Dev StackOverflow community was much smaller, we are all learning at the same time, and honestly, I think everyone was kinder and more forgiving+. + +I eventually worked for a company whose mobile team is distributed across offices in Manila, Sydney, and New York. I was the first Android developer in the Manila office, but by then I was so used to it that I didn't mind. + +It was there that I met the guy who would eventually refer me to Domain, and for that I am forever grateful to him. Domain has done so much for me, both personally and professionally. I work with a really talented team, and I have never seen a company love a product so much. Domain made my dream of attending IO a reality, and through my work with them I got to work on a lot of pretty sweet features that I never dreamed of++. Another lucky break, and I mean to make the most out of it. + +### And? + +I guess what I mean to say is that I have just been winging it all these years. But at least I'm honest about it, right? It there's anything I have learned, it is that there is nothing wrong with saying "I don't know". There are times when we need to pretend to know things, but there are a lot more times when we need to accept that we do not know things. + +Do not be afraid to try something new, no matter how scared it makes you feel. Easier said than done, I know. But sometimes it really helps to take a deep breath, close your eyes, and just jump+++. Lundagin mo, baby! + + + +`+` I was looking at my old StackOverflow questions, and I seriously think that if I asked them today, I would have a lot of "What are you, stupid?" comments. Or maybe I'm just old and cynical. I don't know. The point is, we have all been there, so be kind to another, okay? +`++` This merits a post all on its own +`+++` I distinctly remember that's how I applied to my first Android job. I wrote my cover letter, proof read it, hovered my mouse over the Send button, took a deep breath, then clicked it before I could change my mind. + + +-------------------------------------------------------------------------------- + +via: http://www.zdominguez.com/2016/08/winging-it-how-i-got-to-be-android-dev.html?utm_source=Android+Weekly&utm_campaign=9314c56ae3-Android_Weekly_219&utm_medium=email&utm_term=0_4eb677ad19-9314c56ae3-338075705 + +作者:[Zarah Dominguez ][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/102371834744366149197 From 21b4d42ba058eefa14f773fb399d617fbd8dba65 Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 22 Aug 2016 12:50:49 +0800 Subject: [PATCH 1469/1469] =?UTF-8?q?Delete=2020160601=20Learn=20Python=20?= =?UTF-8?q?Control=20Flow=20and=20Loops=20to=20Write=20and=20Tune=20Shell?= =?UTF-8?q?=20Scripts=20=E2=80=93=20Part=202.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...o Write and Tune Shell Scripts – Part 2.md | 253 ------------------ 1 file changed, 253 deletions(-) delete mode 100644 sources/tech/20160601 Learn Python Control Flow and Loops to Write and Tune Shell Scripts – Part 2.md diff --git a/sources/tech/20160601 Learn Python Control Flow and Loops to Write and Tune Shell Scripts – Part 2.md b/sources/tech/20160601 Learn Python Control Flow and Loops to Write and Tune Shell Scripts – Part 2.md deleted file mode 100644 index 2ec64d9cf6..0000000000 --- a/sources/tech/20160601 Learn Python Control Flow and Loops to Write and Tune Shell Scripts – Part 2.md +++ /dev/null @@ -1,253 +0,0 @@ -Learn Python Control Flow and Loops to Write and Tune Shell Scripts – Part 2 -==================================== - -In the previous article of this Python series we shared a brief introduction to Python, its command-line shell, and the IDLE. We also demonstrated how to perform arithmetic calculations, how to store values in variables, and how to print back those values to the screen. Finally, we explained the concepts of methods and properties in the context of Object Oriented Programming through a practical example. - -![](http://www.tecmint.com/wp-content/uploads/2016/06/Write-Shell-Scripts-in-Python-Programming.png) - -In this guide we will discuss control flow (to choose different courses of action depending on information entered by a user, the result of a calculation, or the current value of a variable) and loops (to automate repetitive tasks) and then apply what we have learned so far to write a simple shell script that will display the operating system type, the hostname, the kernel release, version, and the machine hardware name. - -This example, although basic, will help us illustrate how we can leverage Python OOP’s capabilities to write shell scripts easier than using regular bash tools. - -In other words, we want to go from - -``` -# uname -snrvm -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Check-Hostname-of-Linux.png) - -to - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Check-Linux-Hostname-Using-Python-Script.png) - -Looks pretty, doesn’t it? Let’s roll up our sleeves and make it happen. - -### Control flow in Python - -As we said earlier, control flow allows us to choose different outcomes depending on a given condition. Its most simple implementation in Python is an if / else clause. - -The basic syntax is: - -``` -if condition: -# action 1 -else: -# action 2 -``` - -When condition evaluates to true, the code block below will be executed (represented by # action 1. Otherwise, the code under else will be run. - -A condition can be any statement that can evaluate to either true or false. - -For example: - -1. 1 < 3 # true - -2. firstName == “Gabriel” # true for me, false for anyone not named Gabriel - -- In the first example we compared two values to determine if one is greater than the other. -- In the second example we compared firstName (a variable) to determine if, at the current execution point, its value is identical to “Gabriel” -- The condition and the else statement must be followed by a colon (:) -- Indentation is important in Python. Lines with identical indentation are considered to be in the same code block. - -Please note that the if / else statement is only one of the many control flow tools available in Python. We reviewed it here since we will use it in our script later. You can learn more about the rest of the tools in the [official docs][1]. - -### Loops in Python - -Simply put, a loop is a sequence of instructions or statements that are executed in order as long as a condition is true, or once per item in a list. - -The most simple loop in Python is represented by the for loop iterates over the items of a given list or string beginning with the first item and ending with the last. - -Basic syntax: - -``` -for x in example: -# do this -``` - -Here example can be either a list or a string. If the former, the variable named x represents each item in the list; if the latter, x represents each character in the string: - -``` ->>> rockBands = [] ->>> rockBands.append("Roxette") ->>> rockBands.append("Guns N' Roses") ->>> rockBands.append("U2") ->>> for x in rockBands: -print(x) -or ->>> firstName = "Gabriel" ->>> for x in firstName: -print(x) -``` - -The output of the above examples is shown in the following image: - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Learn-Loops-in-Python.png) - -### Python Modules - -For obvious reasons, there must be a way to save a sequence of Python instructions and statements in a file that can be invoked when it is needed. - -That is precisely what a module is. Particularly, the os module provides an interface to the underlying operating system and allows us to perform many of the operations we usually do in a command-line prompt. - -As such, it incorporates several methods and properties that can be called as we explained in the previous article. However, we need to import (or include) it in our environment using the import keyword: - -``` ->>> import os -``` - -Let’s print the current working directory: - -``` ->>> os.getcwd() -``` - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Learn-Python-Modules.png) - -Let’s now put all of this together (along with the concepts discussed in the previous article) to write the desired script. - -### Python Script - -It is considered good practice to start a script with a statement that indicates the purpose of the script, the license terms under which it is released, and a revision history listing the changes that have been made. Although this is more of a personal preference, it adds a professional touch to our work. - -Here’s the script that produces the output we shown at the top of this article. It is heavily commented so that you can understand what’s happening. - -Take a few minutes to go through it before proceeding. Note how we use an if / else structure to determine whether the length of each field caption is greater than the value of the field itself. - -Based on the result, we use empty characters to fill in the space between a field caption and the next. Also, we use the right number of dashes as separator between the field caption and its value below. - -``` -#!/usr/bin/python3 -# Change the above line to #!/usr/bin/python if you don't have Python 3 installed -# Script name: uname.py -# Purpose: Illustrate Python's OOP capabilities to write shell scripts more easily -# License: GPL v3 (http://www.gnu.org/licenses/gpl.html) -# Copyright (C) 2016 Gabriel Alejandro Cánepa -# ​Facebook / Skype / G+ / Twitter / Github: gacanepa -# Email: gacanepa (at) gmail (dot) com -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# REVISION HISTORY -# DATE VERSION AUTHOR CHANGE DESCRIPTION -# ---------- ------- -------------- -# 2016-05-28 1.0 Gabriel Cánepa Initial version -# Import the os module -import os -# Assign the output of os.uname() to the the systemInfo variable -# os.uname() returns a 5-string tuple (sysname, nodename, release, version, machine) -# Documentation: https://docs.python.org/3.2/library/os.html#module-os -systemInfo = os.uname() -# This is a fixed array with the desired captions in the script output -headers = ["Operating system","Hostname","Release","Version","Machine"] -# Initial value of the index variable. It is used to define the -# index of both systemInfo and headers in each step of the iteration. -index = 0 -# Initial value of the caption variable. -caption = "" -# Initial value of the values variable -values = "" -# Initial value of the separators variable -separators = "" -# Start of the loop -for item in systemInfo: -if len(item) < len(headers[index]): -# A string containing dashes to the length of item[index] or headers[index] -# To repeat a character(s), enclose it within quotes followed -# by the star sign (*) and the desired number of times. -separators = separators + "-" * len(headers[index]) + " " -caption = caption + headers[index] + " " -values = values + systemInfo[index] + " " * (len(headers[index]) - len(item)) + " " -else: -separators = separators + "-" * len(item) + " " -caption = caption + headers[index] + " " * (len(item) - len(headers[index]) + 1) -values = values + item + " " -# Increment the value of index by 1 -index = index + 1 -# End of the loop -# Print the variable named caption converted to uppercase -print(caption.upper()) -# Print separators -print(separators) -# Print values (items in systemInfo) -print(values) -# INSTRUCTIONS: -# 1) Save the script as uname.py (or another name of your choosing) and give it execute permissions: -# chmod +x uname.py -# 2) Execute it: -# ./uname.py -``` - -Once you have saved the above script to a file, give it execute permissions and run it as indicated at the bottom of the code: - -``` -# chmod +x uname.py -# ./uname.py -``` - -If you get the following error while attempting to execute the script: - -``` --bash: ./uname.py: /usr/bin/python3: bad interpreter: No such file or directory -``` - -It means you don’t have Python 3 installed. If that is the case, you can either install the package or replace the interpreter line (pay special attention and be very careful if you followed the steps to update the symbolic links to the Python binaries as outlined in the previous article): - -``` -#!/usr/bin/python3 -``` - -with - -``` -#!/usr/bin/python -``` - -which will cause the installed version of Python 2 to execute the script instead. - -Note: This script has been tested successfully both in Python 2.x and 3.x. - -Although somewhat rudimentary, you can think of this script as a Python module. This means that you can open it in the IDLE (File → Open… → Select file): - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Open-Python-in-IDLE.png) - -A new window will open with the contents of the file. Then go to Run → Run module (or just press F5). The output of the script will be shown in the original shell: - -![](http://www.tecmint.com/wp-content/uploads/2016/05/Run-Python-Script.png) - -If you want to obtain the same results with a script written purely in Bash, you would need to use a combination of awk, sed, and resort to complex methods to store and retrieve items in a list (not to mention the use of tr to convert lowercase letters to uppercase). - -In addition, Python provides portability in that all Linux systems ship with at least one Python version (either 2.x or 3.x, sometimes both). Should you need to rely on a shell to accomplish the same goal, you would need to write different versions of the script based on the shell. - -This goes to show that Object Oriented Programming features can become strong allies of system administrators. - -Note: You can find this python script (and others) in one of my GitHub repositories. - -### Summary - -In this article we have reviewed the concepts of control flow, loops / iteration, and modules in Python. We have shown how to leverage OOP methods and properties in Python to simplify otherwise complex shell scripts. - -Do you have any other ideas you would like to test? Go ahead and write your own Python scripts and let us know if you have any questions. Don’t hesitate to drop us a line using the comment form below, and we will get back to you as soon as we can. - - - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/learn-python-programming-to-write-linux-shell-scripts/2/ - -作者:[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://please%20note%20that%20the%20if%20/%20else%20statement%20is%20only%20one%20of%20the%20many%20control%20flow%20tools%20available%20in%20Python.%20We%20reviewed%20it%20here%20since%20we%20will%20use%20it%20in%20our%20script%20later.%20You%20can%20learn%20more%20about%20the%20rest%20of%20the%20tools%20in%20the%20official%20docs.